From: support Date: Wed, 28 Dec 2022 15:03:12 +0000 (+0000) Subject: Built motion from commit 4d4d9a88.|2.6.26 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22https:/fonts.googleapis.com//%22my-avatar.png/%22?a=commitdiff_plain;h=9c526b81c7c22c103102875e58af7b66484c36b9;p=motion2.git Built motion from commit 4d4d9a88.|2.6.26 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f8c8e85..bad1669 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-28T14:41:25.678Z", + "time": "2022-12-28T14:55:21.972Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 7b75e7d..b658c5d 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-28T14:41:25.678Z", + "time": "2022-12-28T14:55:21.972Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 00d5f1b..3fbc912 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 _0x897a=['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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','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)]'];(function(_0x37228e,_0x2f0c36){var _0x760077=function(_0x2ef6fb){while(--_0x2ef6fb){_0x37228e['push'](_0x37228e['shift']());}};_0x760077(++_0x2f0c36);}(_0x897a,0xe3));var _0xa897=function(_0x2cc6da,_0x477245){_0x2cc6da=_0x2cc6da-0x0;var _0x1b8b1d=_0x897a[_0x2cc6da];return _0x1b8b1d;};'use strict';var Sequelize=require(_0xa897('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x420ee0){return this[_0xa897('0x1')](_0xa897('0x2'));}},'action':{'type':Sequelize[_0xa897('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xa897('0x4'),'integration',_0xa897('0x5'),_0xa897('0x6'),_0xa897('0x7'),_0xa897('0x8'),_0xa897('0x9'),_0xa897('0xa')]],'msg':_0xa897('0xb')}},'comment':_0xa897('0xb')},'data1':{'type':Sequelize[_0xa897('0x3')](0x1000),'comment':_0xa897('0xc')},'data2':{'type':Sequelize[_0xa897('0x3')](0x1000),'comment':_0xa897('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xa897('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xa897('0xf')},'data5':{'type':Sequelize[_0xa897('0x3')](0x1000),'comments':_0xa897('0x10')},'data6':{'type':Sequelize[_0xa897('0x3')],'comments':_0xa897('0x11')},'data7':{'type':Sequelize[_0xa897('0x12')],'comments':_0xa897('0x13')}}; \ No newline at end of file +var _0xabce=['browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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[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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','contactManager','integration','motionbar'];(function(_0x23a0b8,_0x5d9f58){var _0x3490df=function(_0x251d81){while(--_0x251d81){_0x23a0b8['push'](_0x23a0b8['shift']());}};_0x3490df(++_0x5d9f58);}(_0xabce,0x103));var _0xeabc=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xabce[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'get':function(_0x572221){return this[_0xeabc('0x3')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xeabc('0x4'),_0xeabc('0x5'),_0xeabc('0x6'),'jscripty','urlForward',_0xeabc('0x7'),'bot',_0xeabc('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xeabc('0x9')},'data1':{'type':Sequelize[_0xeabc('0xa')](0x1000),'comment':_0xeabc('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xeabc('0xc')},'data3':{'type':Sequelize[_0xeabc('0xa')](0x1000),'comment':_0xeabc('0xd')},'data4':{'type':Sequelize[_0xeabc('0xa')](0x1000),'comments':_0xeabc('0xe')},'data5':{'type':Sequelize[_0xeabc('0xa')](0x1000),'comments':_0xeabc('0xf')},'data6':{'type':Sequelize[_0xeabc('0xa')],'comments':_0xeabc('0x10')},'data7':{'type':Sequelize[_0xeabc('0x11')],'comments':_0xeabc('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 36b11cb..9b36c0e 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 _0xc20a=['path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','send','body','find','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xc20a,0xad));var _0xac20=function(_0x7c4037,_0x4e7dbc){_0x7c4037=_0x7c4037-0x0;var _0x3e9366=_0xc20a[_0x7c4037];return _0x3e9366;};'use strict';var emlformat=require(_0xac20('0x0'));var rimraf=require(_0xac20('0x1'));var zipdir=require(_0xac20('0x2'));var jsonpatch=require(_0xac20('0x3'));var rp=require(_0xac20('0x4'));var moment=require('moment');var BPromise=require(_0xac20('0x5'));var Mustache=require(_0xac20('0x6'));var util=require('util');var path=require(_0xac20('0x7'));var sox=require(_0xac20('0x8'));var csv=require(_0xac20('0x9'));var ejs=require(_0xac20('0xa'));var fs=require('fs');var fs_extra=require(_0xac20('0xb'));var _=require('lodash');var squel=require(_0xac20('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xac20('0xd'));var toCsv=require(_0xac20('0x9'));var querystring=require(_0xac20('0xe'));var Papa=require(_0xac20('0xf'));var Redis=require(_0xac20('0x10'));var authService=require(_0xac20('0x11'));var qs=require(_0xac20('0x12'));var as=require(_0xac20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac20('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xac20('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xac20('0x16'))['db'];function respondWithStatusCode(_0x598f2c,_0xd0ac8c){_0xd0ac8c=_0xd0ac8c||0xcc;return function(_0xdb4124){if(_0xdb4124){return _0x598f2c['sendStatus'](_0xd0ac8c);}return _0x598f2c[_0xac20('0x17')](_0xd0ac8c)[_0xac20('0x18')]();};}function respondWithResult(_0x56549b,_0xf24bb6){_0xf24bb6=_0xf24bb6||0xc8;return function(_0x1aa3b6){if(_0x1aa3b6){return _0x56549b[_0xac20('0x17')](_0xf24bb6)[_0xac20('0x19')](_0x1aa3b6);}};}function respondWithFilteredResult(_0x192a90,_0x5d7640){return function(_0x19994b){if(_0x19994b){var _0xe75337=typeof _0x5d7640[_0xac20('0x1a')]===_0xac20('0x1b')&&typeof _0x5d7640['limit']===_0xac20('0x1b');var _0x424724=_0x19994b[_0xac20('0x1c')];var _0x1b38ac=_0xe75337?0x0:_0x5d7640[_0xac20('0x1a')];var _0x2e0a59=_0xe75337?_0x19994b['count']:_0x5d7640[_0xac20('0x1a')]+_0x5d7640[_0xac20('0x1d')];var _0x4d9518;if(_0x2e0a59>=_0x424724){_0x2e0a59=_0x424724;_0x4d9518=0xc8;}else{_0x4d9518=0xce;}_0x192a90[_0xac20('0x17')](_0x4d9518);return _0x192a90[_0xac20('0x1e')](_0xac20('0x1f'),_0x1b38ac+'-'+_0x2e0a59+'/'+_0x424724)[_0xac20('0x19')](_0x19994b);}return null;};}function patchUpdates(_0x2cfe60){return function(_0xe8cb86){try{jsonpatch[_0xac20('0x20')](_0xe8cb86,_0x2cfe60,!![]);}catch(_0x20973c){return BPromise['reject'](_0x20973c);}return _0xe8cb86[_0xac20('0x21')]();};}function saveUpdates(_0x5b26f0,_0x62683e){return function(_0x1be743){if(_0x1be743){return _0x1be743[_0xac20('0x22')](_0x5b26f0)['then'](function(_0x2a6544){return _0x2a6544;});}return null;};}function removeEntity(_0x18848e,_0x348a95){return function(_0x34beeb){if(_0x34beeb){return _0x34beeb[_0xac20('0x23')]()[_0xac20('0x24')](function(){_0x18848e[_0xac20('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45031b,_0x4e618c){return function(_0x4b2c74){if(!_0x4b2c74){_0x45031b[_0xac20('0x25')](0x194);}return _0x4b2c74;};}function handleError(_0x449825,_0x5b0ca2){_0x5b0ca2=_0x5b0ca2||0x1f4;return function(_0x3d0441){logger['error'](_0x3d0441[_0xac20('0x26')]);if(_0x3d0441[_0xac20('0x27')]){delete _0x3d0441[_0xac20('0x27')];}_0x449825[_0xac20('0x17')](_0x5b0ca2)[_0xac20('0x28')](_0x3d0441);};}exports[_0xac20('0x22')]=function(_0x35eee0,_0x3e42ef){if(_0x35eee0[_0xac20('0x29')]['id']){delete _0x35eee0[_0xac20('0x29')]['id'];}return db['Action'][_0xac20('0x2a')]({'where':{'id':_0x35eee0['params']['id']}})[_0xac20('0x24')](handleEntityNotFound(_0x3e42ef,null))[_0xac20('0x24')](saveUpdates(_0x35eee0[_0xac20('0x29')],null))[_0xac20('0x24')](respondWithResult(_0x3e42ef,null))[_0xac20('0x2b')](handleError(_0x3e42ef,null));};exports['destroy']=function(_0xfe102,_0x3e747d){return db['Action'][_0xac20('0x2a')]({'where':{'id':_0xfe102[_0xac20('0x2c')]['id']}})[_0xac20('0x24')](handleEntityNotFound(_0x3e747d,null))[_0xac20('0x24')](removeEntity(_0x3e747d,null))['catch'](handleError(_0x3e747d,null));}; \ No newline at end of file +var _0x70fa=['stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x70fa,0x158));var _0xa70f=function(_0x32292b,_0x4e9525){_0x32292b=_0x32292b-0x0;var _0x1845b4=_0x70fa[_0x32292b];return _0x1845b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa70f('0x0'));var zipdir=require(_0xa70f('0x1'));var jsonpatch=require(_0xa70f('0x2'));var rp=require('request-promise');var moment=require(_0xa70f('0x3'));var BPromise=require(_0xa70f('0x4'));var Mustache=require(_0xa70f('0x5'));var util=require(_0xa70f('0x6'));var path=require(_0xa70f('0x7'));var sox=require('sox');var csv=require(_0xa70f('0x8'));var ejs=require(_0xa70f('0x9'));var fs=require('fs');var fs_extra=require(_0xa70f('0xa'));var _=require('lodash');var squel=require(_0xa70f('0xb'));var crypto=require(_0xa70f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa70f('0xd'));var toCsv=require(_0xa70f('0x8'));var querystring=require('querystring');var Papa=require(_0xa70f('0xe'));var Redis=require(_0xa70f('0xf'));var authService=require(_0xa70f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa70f('0x11'));var logger=require(_0xa70f('0x12'))(_0xa70f('0x13'));var utils=require('../../config/utils');var config=require(_0xa70f('0x14'));var licenseUtil=require(_0xa70f('0x15'));var db=require(_0xa70f('0x16'))['db'];function respondWithStatusCode(_0x58b3d5,_0x15ef52){_0x15ef52=_0x15ef52||0xcc;return function(_0x2c14e8){if(_0x2c14e8){return _0x58b3d5[_0xa70f('0x17')](_0x15ef52);}return _0x58b3d5[_0xa70f('0x18')](_0x15ef52)[_0xa70f('0x19')]();};}function respondWithResult(_0x33d9ee,_0x392101){_0x392101=_0x392101||0xc8;return function(_0xd61092){if(_0xd61092){return _0x33d9ee[_0xa70f('0x18')](_0x392101)['json'](_0xd61092);}};}function respondWithFilteredResult(_0x4aea2f,_0x24eb32){return function(_0x278bd0){if(_0x278bd0){var _0x5aa48a=typeof _0x24eb32['offset']===_0xa70f('0x1a')&&typeof _0x24eb32[_0xa70f('0x1b')]===_0xa70f('0x1a');var _0x1db228=_0x278bd0[_0xa70f('0x1c')];var _0x11edec=_0x5aa48a?0x0:_0x24eb32['offset'];var _0x39f164=_0x5aa48a?_0x278bd0['count']:_0x24eb32[_0xa70f('0x1d')]+_0x24eb32[_0xa70f('0x1b')];var _0x418314;if(_0x39f164>=_0x1db228){_0x39f164=_0x1db228;_0x418314=0xc8;}else{_0x418314=0xce;}_0x4aea2f[_0xa70f('0x18')](_0x418314);return _0x4aea2f[_0xa70f('0x1e')](_0xa70f('0x1f'),_0x11edec+'-'+_0x39f164+'/'+_0x1db228)[_0xa70f('0x20')](_0x278bd0);}return null;};}function patchUpdates(_0x4c64d4){return function(_0x803b1){try{jsonpatch[_0xa70f('0x21')](_0x803b1,_0x4c64d4,!![]);}catch(_0x27d301){return BPromise[_0xa70f('0x22')](_0x27d301);}return _0x803b1[_0xa70f('0x23')]();};}function saveUpdates(_0x5f25ee,_0x5f10c5){return function(_0x4570ee){if(_0x4570ee){return _0x4570ee[_0xa70f('0x24')](_0x5f25ee)[_0xa70f('0x25')](function(_0x2fb040){return _0x2fb040;});}return null;};}function removeEntity(_0x51f94c,_0x296802){return function(_0x191a19){if(_0x191a19){return _0x191a19[_0xa70f('0x26')]()[_0xa70f('0x25')](function(){_0x51f94c['status'](0xcc)[_0xa70f('0x19')]();});}};}function handleEntityNotFound(_0x42a297,_0x29312e){return function(_0x285248){if(!_0x285248){_0x42a297[_0xa70f('0x17')](0x194);}return _0x285248;};}function handleError(_0x1ab4b5,_0x539beb){_0x539beb=_0x539beb||0x1f4;return function(_0x535537){logger[_0xa70f('0x27')](_0x535537[_0xa70f('0x28')]);if(_0x535537[_0xa70f('0x29')]){delete _0x535537[_0xa70f('0x29')];}_0x1ab4b5[_0xa70f('0x18')](_0x539beb)[_0xa70f('0x2a')](_0x535537);};}exports[_0xa70f('0x24')]=function(_0x5dfb6d,_0x3b4b8d){if(_0x5dfb6d[_0xa70f('0x2b')]['id']){delete _0x5dfb6d[_0xa70f('0x2b')]['id'];}return db[_0xa70f('0x2c')][_0xa70f('0x2d')]({'where':{'id':_0x5dfb6d[_0xa70f('0x2e')]['id']}})['then'](handleEntityNotFound(_0x3b4b8d,null))[_0xa70f('0x25')](saveUpdates(_0x5dfb6d[_0xa70f('0x2b')],null))[_0xa70f('0x25')](respondWithResult(_0x3b4b8d,null))[_0xa70f('0x2f')](handleError(_0x3b4b8d,null));};exports[_0xa70f('0x26')]=function(_0x131421,_0x10f5e5){return db[_0xa70f('0x2c')]['find']({'where':{'id':_0x131421[_0xa70f('0x2e')]['id']}})[_0xa70f('0x25')](handleEntityNotFound(_0x10f5e5,null))[_0xa70f('0x25')](removeEntity(_0x10f5e5,null))[_0xa70f('0x2f')](handleError(_0x10f5e5,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 98eed0c..9536f66 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 _0x854e=['request-promise','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash','util','moment','bluebird'];(function(_0x1a1032,_0x584887){var _0x200077=function(_0x59d99c){while(--_0x59d99c){_0x1a1032['push'](_0x1a1032['shift']());}};_0x200077(++_0x584887);}(_0x854e,0xa4));var _0xe854=function(_0x20ef83,_0xea60f9){_0x20ef83=_0x20ef83-0x0;var _0x18c673=_0x854e[_0x20ef83];return _0x18c673;};'use strict';var _=require(_0xe854('0x0'));var util=require(_0xe854('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe854('0x2'));var BPromise=require(_0xe854('0x3'));var rp=require(_0xe854('0x4'));var fs=require('fs');var path=require(_0xe854('0x5'));var rimraf=require('rimraf');var config=require(_0xe854('0x6'));var attributes=require(_0xe854('0x7'));module[_0xe854('0x8')]=function(_0x616c4f,_0x465450){return _0x616c4f[_0xe854('0x9')](_0xe854('0xa'),attributes,{'tableName':_0xe854('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8409=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./action.attributes','define','Action'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x8409,0x91));var _0x9840=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x8409[_0x455c6c];return _0x488242;};'use strict';var _=require(_0x9840('0x0'));var util=require(_0x9840('0x1'));var logger=require(_0x9840('0x2'))(_0x9840('0x3'));var moment=require(_0x9840('0x4'));var BPromise=require(_0x9840('0x5'));var rp=require(_0x9840('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9840('0x7'));var config=require('../../config/environment');var attributes=require(_0x9840('0x8'));module['exports']=function(_0x206f57,_0x4d5e34){return _0x206f57[_0x9840('0x9')](_0x9840('0xa'),attributes,{'tableName':_0x9840('0xb'),'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 4ec6a01..2178e03 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2ccb62,_0x229005){var _0x2617b0=function(_0x1247f1){while(--_0x1247f1){_0x2ccb62['push'](_0x2ccb62['shift']());}};_0x2617b0(++_0x229005);}(_0xabce,0x103));var _0xeabc=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xabce[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ 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','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x1cb9,0x14e));var _0x91cb=function(_0x408779,_0x37b6b2){_0x408779=_0x408779-0x0;var _0x156038=_0x1cb9[_0x408779];return _0x156038;};'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')]('Action,\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/action/index.js b/server/api/action/index.js index c9fff72..e4c22a0 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 _0x0d61=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x14b8fa,_0x53a624){var _0x28d552=function(_0x1dca3b){while(--_0x1dca3b){_0x14b8fa['push'](_0x14b8fa['shift']());}};_0x28d552(++_0x53a624);}(_0x0d61,0x1c0));var _0x10d6=function(_0x121985,_0x252db3){_0x121985=_0x121985-0x0;var _0x20bc79=_0x0d61[_0x121985];return _0x20bc79;};'use strict';var multer=require(_0x10d6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x10d6('0x1'));var express=require(_0x10d6('0x2'));var router=express[_0x10d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x10d6('0x4'));var interaction=require(_0x10d6('0x5'));var config=require(_0x10d6('0x6'));var controller=require(_0x10d6('0x7'));router[_0x10d6('0x8')](_0x10d6('0x9'),auth[_0x10d6('0xa')](),controller[_0x10d6('0xb')]);router[_0x10d6('0xc')](_0x10d6('0x9'),auth['isAuthenticated'](),controller[_0x10d6('0xd')]);module[_0x10d6('0xe')]=router; \ No newline at end of file +var _0x7b02=['put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x7b02,0xa9));var _0x27b0=function(_0x5cde56,_0x1ea67d){_0x5cde56=_0x5cde56-0x0;var _0x646669=_0x7b02[_0x5cde56];return _0x646669;};'use strict';var multer=require(_0x27b0('0x0'));var util=require(_0x27b0('0x1'));var path=require(_0x27b0('0x2'));var timeout=require(_0x27b0('0x3'));var express=require(_0x27b0('0x4'));var router=express[_0x27b0('0x5')]();var fs_extra=require(_0x27b0('0x6'));var auth=require(_0x27b0('0x7'));var interaction=require(_0x27b0('0x8'));var config=require(_0x27b0('0x9'));var controller=require(_0x27b0('0xa'));router[_0x27b0('0xb')](_0x27b0('0xc'),auth[_0x27b0('0xd')](),controller[_0x27b0('0xe')]);router[_0x27b0('0xf')](_0x27b0('0xc'),auth[_0x27b0('0xd')](),controller[_0x27b0('0x10')]);module[_0x27b0('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 51d9f10..2e9ff14 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 _0x425d=['sequelize','STRING','TEXT'];(function(_0x3a2942,_0xdc3983){var _0x246f0a=function(_0x1ffd23){while(--_0x1ffd23){_0x3a2942['push'](_0x3a2942['shift']());}};_0x246f0a(++_0xdc3983);}(_0x425d,0x1e0));var _0xd425=function(_0x4ca538,_0xe09873){_0x4ca538=_0x4ca538-0x0;var _0x3c2324=_0x425d[_0x4ca538];return _0x3c2324;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}}; \ No newline at end of file +var _0xc4aa=['STRING','sequelize','exports'];(function(_0x21f372,_0x4f17a6){var _0xfdc7b8=function(_0x3c42cf){while(--_0x3c42cf){_0x21f372['push'](_0x21f372['shift']());}};_0xfdc7b8(++_0x4f17a6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xac4a('0x2')]},'parent':{'type':Sequelize[_0xac4a('0x2')]},'table':{'type':Sequelize[_0xac4a('0x2')]},'conditions':{'type':Sequelize['TEXT']},'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 e5a1240..9aaebbc 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 _0xd96c=['fork','../../components/export/','../../files/reports','savename','COUNT(*)','run','runReport','SUM(%s)','DATE(%s)','keyBy','Limited\x20Query:','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','end','status','json','offset','undefined','limit','count','set','reject','update','get','CustomReports','then','sendStatus','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','merge','type','filter','options','AnalyticCustomReport','includeAll','findAll','catch','show','params','rawAttributes','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','parse','joins','parentKey','foreignTable','foreignKey','conditions','debug','sequelize','toString','QueryTypes','SELECT','left_join','COUNT(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ValidationErrorItem','AnalyticMetric','select','groupBy','%s.%s\x20=\x20%s.%s','clone','output','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process'];(function(_0x1f2d4f,_0x2e0a79){var _0x15c51=function(_0x5b460e){while(--_0x5b460e){_0x1f2d4f['push'](_0x1f2d4f['shift']());}};_0x15c51(++_0x2e0a79);}(_0xd96c,0xaf));var _0xcd96=function(_0x57b786,_0x22db7a){_0x57b786=_0x57b786-0x0;var _0x248894=_0xd96c[_0x57b786];return _0x248894;};'use strict';var emlformat=require(_0xcd96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd96('0x1'));var jsonpatch=require(_0xcd96('0x2'));var rp=require(_0xcd96('0x3'));var moment=require(_0xcd96('0x4'));var BPromise=require(_0xcd96('0x5'));var Mustache=require('mustache');var util=require(_0xcd96('0x6'));var path=require(_0xcd96('0x7'));var sox=require(_0xcd96('0x8'));var csv=require(_0xcd96('0x9'));var ejs=require(_0xcd96('0xa'));var fs=require('fs');var fs_extra=require(_0xcd96('0xb'));var _=require('lodash');var squel=require(_0xcd96('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcd96('0x9'));var querystring=require(_0xcd96('0xd'));var Papa=require(_0xcd96('0xe'));var Redis=require(_0xcd96('0xf'));var authService=require(_0xcd96('0x10'));var qs=require(_0xcd96('0x11'));var as=require(_0xcd96('0x12'));var hardwareService=require(_0xcd96('0x13'));var logger=require(_0xcd96('0x14'))(_0xcd96('0x15'));var utils=require('../../config/utils');var config=require(_0xcd96('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd96('0x17'))['db'];var dbH=require(_0xcd96('0x17'))[_0xcd96('0x18')];function respondWithStatusCode(_0x1fa625,_0x57d9c2){_0x57d9c2=_0x57d9c2||0xcc;return function(_0x14d51c){if(_0x14d51c){return _0x1fa625['sendStatus'](_0x57d9c2);}return _0x1fa625['status'](_0x57d9c2)[_0xcd96('0x19')]();};}function respondWithResult(_0x47b2fa,_0x5aff48){_0x5aff48=_0x5aff48||0xc8;return function(_0x4d3fab){if(_0x4d3fab){return _0x47b2fa[_0xcd96('0x1a')](_0x5aff48)[_0xcd96('0x1b')](_0x4d3fab);}};}function respondWithFilteredResult(_0x33eecf,_0x138a1e){return function(_0xc57496){if(_0xc57496){var _0x3d7d87=typeof _0x138a1e[_0xcd96('0x1c')]===_0xcd96('0x1d')&&typeof _0x138a1e[_0xcd96('0x1e')]===_0xcd96('0x1d');var _0x34b229=_0xc57496['count'];var _0x495489=_0x3d7d87?0x0:_0x138a1e['offset'];var _0x34e560=_0x3d7d87?_0xc57496[_0xcd96('0x1f')]:_0x138a1e['offset']+_0x138a1e['limit'];var _0x3ab39a;if(_0x34e560>=_0x34b229){_0x34e560=_0x34b229;_0x3ab39a=0xc8;}else{_0x3ab39a=0xce;}_0x33eecf[_0xcd96('0x1a')](_0x3ab39a);return _0x33eecf[_0xcd96('0x20')]('Content-Range',_0x495489+'-'+_0x34e560+'/'+_0x34b229)[_0xcd96('0x1b')](_0xc57496);}return null;};}function patchUpdates(_0x273d29){return function(_0x4ff36c){try{jsonpatch['apply'](_0x4ff36c,_0x273d29,!![]);}catch(_0x2de363){return BPromise[_0xcd96('0x21')](_0x2de363);}return _0x4ff36c['save']();};}function saveUpdates(_0x468a24,_0x483347){return function(_0x2d0a54){if(_0x2d0a54){return _0x2d0a54[_0xcd96('0x22')](_0x468a24)['then'](function(_0x26a604){return _0x26a604;});}return null;};}function removeEntity(_0xe6a001,_0x27cc93){return function(_0x265d7f){if(_0x265d7f){return _0x265d7f['destroy']()['then'](function(){var _0x49c64d=_0x265d7f[_0xcd96('0x23')]({'plain':!![]});var _0x5b8560=_0xcd96('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x5b8560,'resourceId':_0x49c64d['id']}})[_0xcd96('0x25')](function(){return _0x265d7f;});})['then'](function(){_0xe6a001[_0xcd96('0x1a')](0xcc)[_0xcd96('0x19')]();});}};}function handleEntityNotFound(_0x2e1971,_0xda8143){return function(_0x4671f2){if(!_0x4671f2){_0x2e1971[_0xcd96('0x26')](0x194);}return _0x4671f2;};}function handleError(_0x55bc59,_0x199995){_0x199995=_0x199995||0x1f4;return function(_0x11b0a1){logger['error'](_0x11b0a1[_0xcd96('0x27')]);if(_0x11b0a1[_0xcd96('0x28')]){delete _0x11b0a1[_0xcd96('0x28')];}_0x55bc59[_0xcd96('0x1a')](_0x199995)[_0xcd96('0x29')](_0x11b0a1);};}exports[_0xcd96('0x2a')]=function(_0x457135,_0x34f1dd){var _0x5f317d={},_0x1d5c3a={},_0x5c8140={'count':0x0,'rows':[]};var _0x5000a9=_[_0xcd96('0x2b')](db['AnalyticCustomReport']['rawAttributes'],function(_0x5b6587){return{'name':_0x5b6587[_0xcd96('0x2c')],'type':_0x5b6587['type'][_0xcd96('0x2d')]};});_0x1d5c3a[_0xcd96('0x2e')]=_[_0xcd96('0x2b')](_0x5000a9,_0xcd96('0x28'));_0x1d5c3a[_0xcd96('0x2f')]=_[_0xcd96('0x30')](_0x457135['query']);_0x1d5c3a[_0xcd96('0x31')]=_[_0xcd96('0x32')](_0x1d5c3a[_0xcd96('0x2e')],_0x1d5c3a[_0xcd96('0x2f')]);_0x5f317d[_0xcd96('0x33')]=_[_0xcd96('0x32')](_0x1d5c3a[_0xcd96('0x2e')],qs[_0xcd96('0x34')](_0x457135[_0xcd96('0x2f')]['fields']));_0x5f317d[_0xcd96('0x33')]=_0x5f317d[_0xcd96('0x33')]['length']?_0x5f317d[_0xcd96('0x33')]:_0x1d5c3a[_0xcd96('0x2e')];if(!_0x457135[_0xcd96('0x2f')]['hasOwnProperty']('nolimit')){_0x5f317d[_0xcd96('0x1e')]=qs[_0xcd96('0x1e')](_0x457135[_0xcd96('0x2f')][_0xcd96('0x1e')]);_0x5f317d[_0xcd96('0x1c')]=qs[_0xcd96('0x1c')](_0x457135[_0xcd96('0x2f')][_0xcd96('0x1c')]);}_0x5f317d[_0xcd96('0x35')]=qs[_0xcd96('0x36')](_0x457135[_0xcd96('0x2f')]['sort']);_0x5f317d[_0xcd96('0x37')]=qs[_0xcd96('0x31')](_[_0xcd96('0x38')](_0x457135[_0xcd96('0x2f')],_0x1d5c3a['filters']),_0x5000a9);if(_0x457135[_0xcd96('0x2f')]['filter']){_0x5f317d[_0xcd96('0x37')]=_[_0xcd96('0x39')](_0x5f317d['where'],{'$or':_[_0xcd96('0x2b')](_0x5000a9,function(_0x198cce){if(_0x198cce[_0xcd96('0x3a')]!=='VIRTUAL'){var _0x257cd0={};_0x257cd0[_0x198cce[_0xcd96('0x28')]]={'$like':'%'+_0x457135[_0xcd96('0x2f')][_0xcd96('0x3b')]+'%'};return _0x257cd0;}})});}_0x5f317d=_['merge']({},_0x5f317d,_0x457135[_0xcd96('0x3c')]);var _0x40e1d6={'where':_0x5f317d[_0xcd96('0x37')]};return db[_0xcd96('0x3d')]['count'](_0x40e1d6)[_0xcd96('0x25')](function(_0x10abc2){_0x5c8140[_0xcd96('0x1f')]=_0x10abc2;if(_0x457135[_0xcd96('0x2f')][_0xcd96('0x3e')]){_0x5f317d['include']=[{'all':!![]}];}return db[_0xcd96('0x3d')][_0xcd96('0x3f')](_0x5f317d);})[_0xcd96('0x25')](function(_0x731c5){_0x5c8140['rows']=_0x731c5;return _0x5c8140;})[_0xcd96('0x25')](respondWithFilteredResult(_0x34f1dd,_0x5f317d))[_0xcd96('0x40')](handleError(_0x34f1dd,null));};exports[_0xcd96('0x41')]=function(_0x13697,_0x2e66e2){var _0x189d9a={'raw':![],'where':{'id':_0x13697[_0xcd96('0x42')]['id']}},_0x50f398={};_0x50f398['model']=_[_0xcd96('0x30')](db[_0xcd96('0x3d')][_0xcd96('0x43')]);_0x50f398['query']=_[_0xcd96('0x30')](_0x13697[_0xcd96('0x2f')]);_0x50f398['filters']=_[_0xcd96('0x32')](_0x50f398[_0xcd96('0x2e')],_0x50f398[_0xcd96('0x2f')]);_0x189d9a['attributes']=_[_0xcd96('0x32')](_0x50f398['model'],qs[_0xcd96('0x34')](_0x13697[_0xcd96('0x2f')][_0xcd96('0x34')]));_0x189d9a['attributes']=_0x189d9a[_0xcd96('0x33')][_0xcd96('0x44')]?_0x189d9a['attributes']:_0x50f398[_0xcd96('0x2e')];if(_0x13697[_0xcd96('0x2f')][_0xcd96('0x3e')]){_0x189d9a[_0xcd96('0x45')]=[{'all':!![]}];}_0x189d9a=_[_0xcd96('0x39')]({},_0x189d9a,_0x13697['options']);return db[_0xcd96('0x3d')]['find'](_0x189d9a)['then'](handleEntityNotFound(_0x2e66e2,null))[_0xcd96('0x25')](respondWithResult(_0x2e66e2,null))[_0xcd96('0x40')](handleError(_0x2e66e2,null));};exports[_0xcd96('0x46')]=function(_0x252728,_0x22e0e5){return db[_0xcd96('0x3d')][_0xcd96('0x46')](_0x252728[_0xcd96('0x47')],{})[_0xcd96('0x25')](function(_0x45f52e){var _0x3a37d9=_0x252728[_0xcd96('0x48')]['get']({'plain':!![]});if(!_0x3a37d9)throw new Error(_0xcd96('0x49'));if(_0x3a37d9[_0xcd96('0x4a')]===_0xcd96('0x48')){var _0xc1abd=_0x45f52e[_0xcd96('0x23')]({'plain':!![]});var _0x15d6e7=_0xcd96('0x4b');return db[_0xcd96('0x4c')][_0xcd96('0x4d')]({'where':{'name':_0x15d6e7,'userProfileId':_0x3a37d9[_0xcd96('0x4e')]},'raw':!![]})['then'](function(_0x2ea2ec){if(_0x2ea2ec&&_0x2ea2ec[_0xcd96('0x4f')]===0x0){return db[_0xcd96('0x50')][_0xcd96('0x46')]({'name':_0xc1abd['name'],'resourceId':_0xc1abd['id'],'type':_0xcd96('0x24'),'sectionId':_0x2ea2ec['id']},{})[_0xcd96('0x25')](function(){return _0x45f52e;});}else{return _0x45f52e;}})[_0xcd96('0x40')](function(_0x5bccd6){logger['error'](_0xcd96('0x51'),_0x5bccd6);throw _0x5bccd6;});}return _0x45f52e;})[_0xcd96('0x25')](respondWithResult(_0x22e0e5,0xc9))[_0xcd96('0x40')](handleError(_0x22e0e5,null));};exports['update']=function(_0x20e1af,_0x1b14be){if(_0x20e1af[_0xcd96('0x47')]['id']){delete _0x20e1af[_0xcd96('0x47')]['id'];}return db[_0xcd96('0x3d')][_0xcd96('0x4d')]({'where':{'id':_0x20e1af[_0xcd96('0x42')]['id']}})[_0xcd96('0x25')](handleEntityNotFound(_0x1b14be,null))[_0xcd96('0x25')](saveUpdates(_0x20e1af['body'],null))[_0xcd96('0x25')](respondWithResult(_0x1b14be,null))[_0xcd96('0x40')](handleError(_0x1b14be,null));};exports[_0xcd96('0x52')]=function(_0x273ebc,_0x38e258){return db[_0xcd96('0x3d')][_0xcd96('0x4d')]({'where':{'id':_0x273ebc[_0xcd96('0x42')]['id']}})[_0xcd96('0x25')](handleEntityNotFound(_0x38e258,null))['then'](removeEntity(_0x38e258,null))['catch'](handleError(_0x38e258,null));};exports['preview']=function(_0x3c156b,_0x5cdc98){var _0x3655b7=0xa;var _0x130455=[_0xcd96('0x53'),'left_join',_0xcd96('0x54'),_0xcd96('0x55')];var _0x17a9b4={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcd96('0x56'),'MAX':_0xcd96('0x57'),'MIN':_0xcd96('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcd96('0x59'),'GROUP_CONCAT ASC':_0xcd96('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x102424={'SEC_TO_TIME':_0xcd96('0x5b'),'DATE':'DATE(%s)','HOUR':_0xcd96('0x5c'),'ROUND':_0xcd96('0x5d'),'UNIX_TIMESTAMP':_0xcd96('0x5e')};var _0x18c3c9=function(_0xdc681b){return!_[_0xcd96('0x5f')]([_0xcd96('0x60'),_0xcd96('0x61'),_0xcd96('0x62'),_0xcd96('0x63')],_0xdc681b);};var _0x2f4d87=function(_0x30f228){if(!_0x30f228||!_0x30f228[_0xcd96('0x64')]['length']){return'';}for(var _0x4c4312='(',_0x151df6=0x0;_0x151df6<_0x30f228[_0xcd96('0x64')]['length'];_0x151df6+=0x1){_0x151df6>0x0&&(_0x4c4312+='\x20'+_0x30f228[_0xcd96('0x65')]+'\x20');_0x4c4312+=_0x30f228[_0xcd96('0x64')][_0x151df6]['group']?_0x2f4d87(_0x30f228[_0xcd96('0x64')][_0x151df6][_0xcd96('0x66')]):_0x30f228[_0xcd96('0x64')][_0x151df6][_0xcd96('0x67')]+'\x20'+_0x30f228[_0xcd96('0x64')][_0x151df6][_0xcd96('0x68')]+(_0x18c3c9(_0x30f228['rules'][_0x151df6][_0xcd96('0x68')])?'\x20'+_0x30f228['rules'][_0x151df6][_0xcd96('0x69')]:'');}return _0x4c4312+')';};var _0x256e30={'where':{'id':_0x3c156b['params']['id']}},_0x3c69ca,_0x309ea4,_0x338d17,_0x5be174,_0x321403;_0x256e30=_['merge']({},_0x256e30,_0x3c156b[_0xcd96('0x3c')]);return db[_0xcd96('0x3d')][_0xcd96('0x4d')](_0x256e30)[_0xcd96('0x25')](function(_0x51c73f){if(_0x51c73f){_0x3c69ca=_0x51c73f;return _0x51c73f[_0xcd96('0x6a')]();}return null;})[_0xcd96('0x25')](function(_0x54048c){if(_0x54048c){if(!_0x54048c['length']){throw new db[(_0xcd96('0x6b'))]['ValidationErrorItem'](_0xcd96('0x6c'),0x193);}_0x309ea4=_0x54048c;return db['AnalyticMetric'][_0xcd96('0x3f')]({'raw':!![]});}return null;})[_0xcd96('0x25')](function(_0x3e3f10){if(_0x3e3f10){_0x338d17=_['keyBy'](_0x3e3f10,'id');var _0x701a34;var _0x5bd67c=squel['select']();_0x5bd67c[_0xcd96('0x6d')](_0x3c69ca[_0xcd96('0x6e')]);for(var _0x484d46=0x0;_0x484d46<_0x309ea4[_0xcd96('0x44')];_0x484d46+=0x1){_0x701a34=_0x309ea4[_0x484d46][_0xcd96('0x6f')]?_0x338d17[_0x309ea4[_0x484d46][_0xcd96('0x6f')]][_0xcd96('0x70')]:_0x309ea4[_0x484d46]['field'];_0x701a34=_0x309ea4[_0x484d46][_0xcd96('0x71')]?_[_0xcd96('0x72')](_0x17a9b4[_0x309ea4[_0x484d46][_0xcd96('0x71')]],'%s',_0x701a34):_0x701a34;_0x701a34=_0x309ea4[_0x484d46]['format']?_['replace'](_0x102424[_0x309ea4[_0x484d46][_0xcd96('0x73')]],'%s',_0x701a34):_0x701a34;if(_0x309ea4[_0x484d46]['groupBy']){_0x5bd67c[_0xcd96('0x66')](_0x701a34);}_0x309ea4[_0x484d46][_0xcd96('0x74')]&&_0x5bd67c[_0xcd96('0x35')](_0x701a34,_0x309ea4[_0x484d46][_0xcd96('0x74')]===_0xcd96('0x75')?![]:!![]);_0x5bd67c[_0xcd96('0x67')](_0x701a34,_0x309ea4[_0x484d46][_0xcd96('0x76')]||_0x701a34);}if(_0x3c69ca['joins']){_0x3c69ca['joins']=JSON[_0xcd96('0x77')](_0x3c69ca[_0xcd96('0x78')]);for(var _0x22d00e=0x0;_0x22d00e<_0x3c69ca[_0xcd96('0x78')][_0xcd96('0x44')];_0x22d00e+=0x1){if(_0x3c69ca['joins'][_0x22d00e]['type']&&_[_0xcd96('0x5f')](_0x130455,_0x3c69ca[_0xcd96('0x78')][_0x22d00e]['type'])&&_0x3c69ca['joins'][_0x22d00e][_0xcd96('0x79')]&&_0x3c69ca['joins'][_0x22d00e][_0xcd96('0x7a')]&&_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x7b')]){_0x5bd67c[_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x3a')]](_0x3c69ca['joins'][_0x22d00e][_0xcd96('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3c69ca[_0xcd96('0x6e')],_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x79')],_0x3c69ca[_0xcd96('0x78')][_0x22d00e][_0xcd96('0x7a')],_0x3c69ca[_0xcd96('0x78')][_0x22d00e]['foreignKey']));}}}if(_0x3c69ca[_0xcd96('0x7c')]){_0x3c69ca['conditions']=JSON['parse'](_0x3c69ca[_0xcd96('0x7c')]);_0x5bd67c[_0xcd96('0x37')](_0x2f4d87(_0x3c69ca[_0xcd96('0x7c')]['group']));}_0x321403=_0x5bd67c['clone']();_0x5bd67c[_0xcd96('0x1e')](_0x3655b7);_0x5bd67c['offset'](0x0);logger[_0xcd96('0x7d')]('Limited\x20Query:',_0x5bd67c['toString']());return dbH[_0xcd96('0x7e')]['query'](_0x5bd67c[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')][_0xcd96('0x80')][_0xcd96('0x81')]});}})['then'](respondWithResult(_0x5cdc98,null))[_0xcd96('0x40')](handleError(_0x5cdc98,null));};function runReport(_0x109358,_0xca2a3d,_0x4c754e){var _0x1e03c9=_0xca2a3d[_0xcd96('0x28')];var _0x35650d=0xa;var _0x103004=[_0xcd96('0x53'),_0xcd96('0x82'),'right_join',_0xcd96('0x55')];var _0x13a182={'SUM':'SUM(%s)','COUNT':_0xcd96('0x83'),'COUNT DISTINCT':_0xcd96('0x56'),'MAX':_0xcd96('0x57'),'MIN':_0xcd96('0x58'),'AVG':_0xcd96('0x84'),'GROUP_CONCAT':_0xcd96('0x59'),'GROUP_CONCAT ASC':_0xcd96('0x5a'),'GROUP_CONCAT DESC':_0xcd96('0x85')};var _0x23d846={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xcd96('0x5c'),'ROUND':_0xcd96('0x5d'),'UNIX_TIMESTAMP':_0xcd96('0x5e')};var _0xd8c673=function(_0x3b0775){return!_[_0xcd96('0x5f')]([_0xcd96('0x60'),_0xcd96('0x61'),_0xcd96('0x62'),_0xcd96('0x63')],_0x3b0775);};var _0x34fb39=function(_0xf01f01){if(!_0xf01f01||!_0xf01f01['rules']['length']){return'';}for(var _0x4031f1='(',_0x4e979b=0x0;_0x4e979b<_0xf01f01[_0xcd96('0x64')][_0xcd96('0x44')];_0x4e979b+=0x1){_0x4e979b>0x0&&(_0x4031f1+='\x20'+_0xf01f01[_0xcd96('0x65')]+'\x20');_0x4031f1+=_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x66')]?_0x34fb39(_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x66')]):_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x67')]+'\x20'+_0xf01f01[_0xcd96('0x64')][_0x4e979b][_0xcd96('0x68')]+(_0xd8c673(_0xf01f01['rules'][_0x4e979b][_0xcd96('0x68')])?'\x20'+_0xf01f01['rules'][_0x4e979b][_0xcd96('0x69')]:'');}return _0x4031f1+')';};var _0x5ea8b3={'where':{'id':_0x109358['id']}},_0x46bab5,_0x5a2447,_0x58c697,_0x4f7ebe,_0x2c29de;_0x5ea8b3=_['merge']({},_0x5ea8b3,_0x4c754e);return db[_0xcd96('0x3d')][_0xcd96('0x4d')](_0x5ea8b3)[_0xcd96('0x25')](function(_0x3dcbf6){if(_0x3dcbf6){_0x46bab5=_0x3dcbf6;return _0x3dcbf6[_0xcd96('0x6a')]();}return null;})[_0xcd96('0x25')](function(_0x47daab){if(_0x47daab){if(!_0x47daab['length']){throw new db[(_0xcd96('0x6b'))][(_0xcd96('0x86'))](_0xcd96('0x6c'),0x193);}_0x5a2447=_0x47daab;return db[_0xcd96('0x87')][_0xcd96('0x3f')]({'raw':!![]});}return null;})[_0xcd96('0x25')](function(_0xf51f37){if(_0xf51f37){_0x58c697=_['keyBy'](_0xf51f37,'id');var _0x4305e7;var _0x51a595=squel[_0xcd96('0x88')]();_0x51a595[_0xcd96('0x6d')](_0x46bab5[_0xcd96('0x6e')]);for(var _0x2905aa=0x0;_0x2905aa<_0x5a2447[_0xcd96('0x44')];_0x2905aa+=0x1){_0x4305e7=_0x5a2447[_0x2905aa][_0xcd96('0x6f')]?_0x58c697[_0x5a2447[_0x2905aa]['MetricId']][_0xcd96('0x70')]:_0x5a2447[_0x2905aa]['field'];_0x4305e7=_0x5a2447[_0x2905aa][_0xcd96('0x71')]?_[_0xcd96('0x72')](_0x13a182[_0x5a2447[_0x2905aa][_0xcd96('0x71')]],'%s',_0x4305e7):_0x4305e7;_0x4305e7=_0x5a2447[_0x2905aa][_0xcd96('0x73')]?_[_0xcd96('0x72')](_0x23d846[_0x5a2447[_0x2905aa][_0xcd96('0x73')]],'%s',_0x4305e7):_0x4305e7;if(_0x5a2447[_0x2905aa][_0xcd96('0x89')]){_0x51a595[_0xcd96('0x66')](_0x4305e7);}_0x5a2447[_0x2905aa][_0xcd96('0x74')]&&_0x51a595[_0xcd96('0x35')](_0x4305e7,_0x5a2447[_0x2905aa]['orderBy']===_0xcd96('0x75')?![]:!![]);_0x51a595[_0xcd96('0x67')](_0x4305e7,_0x5a2447[_0x2905aa][_0xcd96('0x76')]||_0x4305e7);}if(_0x46bab5[_0xcd96('0x78')]){_0x46bab5[_0xcd96('0x78')]=JSON[_0xcd96('0x77')](_0x46bab5[_0xcd96('0x78')]);for(var _0x11aa28=0x0;_0x11aa28<_0x46bab5[_0xcd96('0x78')][_0xcd96('0x44')];_0x11aa28+=0x1){if(_0x46bab5['joins'][_0x11aa28][_0xcd96('0x3a')]&&_[_0xcd96('0x5f')](_0x103004,_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x3a')])&&_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x79')]&&_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x7a')]&&_0x46bab5[_0xcd96('0x78')][_0x11aa28]['foreignKey']){_0x51a595[_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x3a')]](_0x46bab5['joins'][_0x11aa28][_0xcd96('0x7a')],null,util['format'](_0xcd96('0x8a'),_0x46bab5['table'],_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x79')],_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x7a')],_0x46bab5[_0xcd96('0x78')][_0x11aa28][_0xcd96('0x7b')]));}}}if(_0x46bab5[_0xcd96('0x7c')]){_0x46bab5[_0xcd96('0x7c')]=JSON[_0xcd96('0x77')](_0x46bab5[_0xcd96('0x7c')]);_0x51a595['where'](_0x34fb39(_0x46bab5[_0xcd96('0x7c')][_0xcd96('0x66')]));}_0x2c29de=_0x51a595[_0xcd96('0x8b')]();_0x51a595[_0xcd96('0x1e')](_0x35650d);_0x51a595['offset'](0x0);return;}})[_0xcd96('0x25')](function(){if(_0xca2a3d[_0xcd96('0x8c')]==='web'){return null;}var _0x4e0ec2=_[_0xcd96('0x39')](_0xca2a3d,{'name':_0xca2a3d[_0xcd96('0x8d')]||_0xca2a3d[_0xcd96('0x28')]||_0x46bab5['name'],'basename':_0x1e03c9,'savename':util[_0xcd96('0x73')](_0xcd96('0x8e'),_0xca2a3d[_0xcd96('0x28')]||_0x46bab5[_0xcd96('0x28')],require(_0xcd96('0x8f'))[_0xcd96('0x90')](0x4),_0xca2a3d[_0xcd96('0x8c')]||'csv'),'reportId':_0x46bab5['id'],'reportType':_0xcd96('0x91')});return db[_0xcd96('0x92')][_0xcd96('0x46')](_0x4e0ec2,{'raw':!![]});})['then'](function(_0x509032){if(_0x46bab5[_0xcd96('0x6e')]===_0xcd96('0x93')){_0x2c29de[_0xcd96('0x37')](_0x46bab5[_0xcd96('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xca2a3d[_0xcd96('0x94')],_0xca2a3d[_0xcd96('0x95')]);}else{_0x2c29de[_0xcd96('0x37')](_0x46bab5[_0xcd96('0x6e')]+_0xcd96('0x96'),_0xca2a3d[_0xcd96('0x94')],_0xca2a3d[_0xcd96('0x95')]);}if(_0x509032){logger[_0xcd96('0x97')]('Run\x20Query:',_0x2c29de[_0xcd96('0x7f')]());require(_0xcd96('0x98'))[_0xcd96('0x99')](path['join'](__dirname,_0xcd96('0x9a'),_0x509032[_0xcd96('0x8c')]),[_0x509032['id'],_0x2c29de[_0xcd96('0x7f')](),path[_0xcd96('0x53')](__dirname,_0xcd96('0x9b'),_0x509032[_0xcd96('0x9c')]),_0x1e03c9]);return _0x509032;}else{var _0x3f8feb=squel[_0xcd96('0x88')]();_0x3f8feb['from']('('+_0x2c29de[_0xcd96('0x7f')]()+')','countTable');_0x3f8feb[_0xcd96('0x67')](_0xcd96('0x9d'),_0xcd96('0x1f'));_0x2c29de[_0xcd96('0x1e')](_0xca2a3d[_0xcd96('0x1e')]||_0x35650d);_0x2c29de['offset'](_0xca2a3d[_0xcd96('0x1c')]||0x0);return dbH['sequelize'][_0xcd96('0x2f')](_0x3f8feb[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')][_0xcd96('0x80')]['SELECT']})[_0xcd96('0x25')](function(_0x1046d8){if(!_0x1046d8[_0xcd96('0x44')]){_0x4f7ebe=0x0;}else{_0x4f7ebe=_0x1046d8[0x0]['count']||0x0;}return dbH[_0xcd96('0x7e')][_0xcd96('0x2f')](_0x2c29de[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')]['QueryTypes'][_0xcd96('0x81')]});})[_0xcd96('0x25')](function(_0x21bb3b){return{'rows':_0x21bb3b||[],'count':_0x4f7ebe};});}});}exports[_0xcd96('0x9e')]=function(_0x4b3e12,_0x2088d){return runReport(_0x4b3e12['params'],_0x4b3e12['query'],_0x4b3e12[_0xcd96('0x3c')])[_0xcd96('0x25')](respondWithResult(_0x2088d,null))['catch'](handleError(_0x2088d,null));};exports[_0xcd96('0x9f')]=runReport;exports[_0xcd96('0x2f')]=function(_0x5c793a,_0x3f2e14){var _0x2841d2=0xa;var _0x23797f=[_0xcd96('0x53'),'left_join',_0xcd96('0x54'),_0xcd96('0x55')];var _0x46858d={'SUM':_0xcd96('0xa0'),'COUNT':_0xcd96('0x83'),'COUNT DISTINCT':_0xcd96('0x56'),'MAX':_0xcd96('0x57'),'MIN':_0xcd96('0x58'),'AVG':_0xcd96('0x84'),'GROUP_CONCAT':_0xcd96('0x59'),'GROUP_CONCAT ASC':_0xcd96('0x5a'),'GROUP_CONCAT DESC':_0xcd96('0x85')};var _0x4c8c0={'SEC_TO_TIME':_0xcd96('0x5b'),'DATE':_0xcd96('0xa1'),'HOUR':_0xcd96('0x5c'),'ROUND':_0xcd96('0x5d'),'UNIX_TIMESTAMP':_0xcd96('0x5e')};var _0x1d530e=function(_0x5f5b27){return!_['includes'](['IS\x20NULL',_0xcd96('0x61'),_0xcd96('0x62'),_0xcd96('0x63')],_0x5f5b27);};var _0x561ba8=function(_0x4a5356){if(!_0x4a5356||!_0x4a5356[_0xcd96('0x64')][_0xcd96('0x44')]){return'';}for(var _0x302211='(',_0x19e089=0x0;_0x19e089<_0x4a5356['rules']['length'];_0x19e089+=0x1){_0x19e089>0x0&&(_0x302211+='\x20'+_0x4a5356[_0xcd96('0x65')]+'\x20');_0x302211+=_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x66')]?_0x561ba8(_0x4a5356['rules'][_0x19e089][_0xcd96('0x66')]):_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x67')]+'\x20'+_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x68')]+(_0x1d530e(_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x68')])?'\x20'+_0x4a5356[_0xcd96('0x64')][_0x19e089][_0xcd96('0x69')]:'');}return _0x302211+')';};var _0x9deef5={'where':{'id':_0x5c793a[_0xcd96('0x42')]['id']}},_0x2d97da,_0x339b40,_0x1ef3cb,_0x25d955,_0x10ea4e;_0x9deef5=_[_0xcd96('0x39')]({},_0x9deef5,_0x5c793a['options']);return db[_0xcd96('0x3d')][_0xcd96('0x4d')](_0x9deef5)['then'](function(_0x395fc5){if(_0x395fc5){_0x2d97da=_0x395fc5;return _0x395fc5[_0xcd96('0x6a')]();}return null;})[_0xcd96('0x25')](function(_0x484acd){if(_0x484acd){if(!_0x484acd[_0xcd96('0x44')]){throw new db[(_0xcd96('0x6b'))][(_0xcd96('0x86'))](_0xcd96('0x6c'),0x193);}_0x339b40=_0x484acd;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xcd96('0x25')](function(_0x3aaeaa){if(_0x3aaeaa){_0x1ef3cb=_[_0xcd96('0xa2')](_0x3aaeaa,'id');var _0x539834;var _0x4c16a8=squel[_0xcd96('0x88')]();_0x4c16a8[_0xcd96('0x6d')](_0x2d97da['table']);for(var _0x2d8a84=0x0;_0x2d8a84<_0x339b40[_0xcd96('0x44')];_0x2d8a84+=0x1){_0x539834=_0x339b40[_0x2d8a84][_0xcd96('0x6f')]?_0x1ef3cb[_0x339b40[_0x2d8a84][_0xcd96('0x6f')]]['metric']:_0x339b40[_0x2d8a84][_0xcd96('0x67')];_0x539834=_0x339b40[_0x2d8a84][_0xcd96('0x71')]?_[_0xcd96('0x72')](_0x46858d[_0x339b40[_0x2d8a84][_0xcd96('0x71')]],'%s',_0x539834):_0x539834;_0x539834=_0x339b40[_0x2d8a84]['format']?_[_0xcd96('0x72')](_0x4c8c0[_0x339b40[_0x2d8a84][_0xcd96('0x73')]],'%s',_0x539834):_0x539834;if(_0x339b40[_0x2d8a84][_0xcd96('0x89')]){_0x4c16a8['group'](_0x539834);}_0x339b40[_0x2d8a84][_0xcd96('0x74')]&&_0x4c16a8[_0xcd96('0x35')](_0x539834,_0x339b40[_0x2d8a84][_0xcd96('0x74')]===_0xcd96('0x75')?![]:!![]);_0x4c16a8[_0xcd96('0x67')](_0x539834,_0x339b40[_0x2d8a84][_0xcd96('0x76')]||_0x539834);}if(_0x2d97da[_0xcd96('0x78')]){_0x2d97da[_0xcd96('0x78')]=JSON[_0xcd96('0x77')](_0x2d97da['joins']);for(var _0x5ced99=0x0;_0x5ced99<_0x2d97da[_0xcd96('0x78')][_0xcd96('0x44')];_0x5ced99+=0x1){if(_0x2d97da[_0xcd96('0x78')][_0x5ced99]['type']&&_[_0xcd96('0x5f')](_0x23797f,_0x2d97da['joins'][_0x5ced99][_0xcd96('0x3a')])&&_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x79')]&&_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x7a')]&&_0x2d97da['joins'][_0x5ced99][_0xcd96('0x7b')]){_0x4c16a8[_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x3a')]](_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x7a')],null,util[_0xcd96('0x73')](_0xcd96('0x8a'),_0x2d97da['table'],_0x2d97da[_0xcd96('0x78')][_0x5ced99][_0xcd96('0x79')],_0x2d97da[_0xcd96('0x78')][_0x5ced99]['foreignTable'],_0x2d97da['joins'][_0x5ced99][_0xcd96('0x7b')]));}}}if(_0x2d97da[_0xcd96('0x7c')]){_0x2d97da[_0xcd96('0x7c')]=JSON[_0xcd96('0x77')](_0x2d97da[_0xcd96('0x7c')]);_0x4c16a8[_0xcd96('0x37')](_0x561ba8(_0x2d97da[_0xcd96('0x7c')][_0xcd96('0x66')]));}_0x10ea4e=_0x4c16a8[_0xcd96('0x8b')]();_0x4c16a8['limit'](_0x2841d2);_0x4c16a8[_0xcd96('0x1c')](0x0);logger[_0xcd96('0x7d')](_0xcd96('0xa3'),_0x4c16a8['toString']());return dbH[_0xcd96('0x7e')]['query'](_0x4c16a8[_0xcd96('0x7f')](),{'type':dbH[_0xcd96('0x7e')][_0xcd96('0x80')][_0xcd96('0x81')]});}})['then'](function(){return{'sql':_0x10ea4e[_0xcd96('0x7f')]()};})[_0xcd96('0x25')](respondWithResult(_0x3f2e14,null))['catch'](handleError(_0x3f2e14,null));}; \ No newline at end of file +var _0x78bd=['from','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','key','map','keys','query','intersection','attributes','fields','length','model','nolimit','order','where','filters','pick','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','SUM(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','ValidationErrorItem','groupBy','DESC','output','fullPath','%s-%s.%s','randomstring','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','runReport','getFields'];(function(_0x1d1727,_0x3bf08b){var _0x1f6d13=function(_0x430941){while(--_0x430941){_0x1d1727['push'](_0x1d1727['shift']());}};_0x1f6d13(++_0x3bf08b);}(_0x78bd,0x1f0));var _0xd78b=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x78bd[_0x490be3];return _0x3f5140;};'use strict';var emlformat=require(_0xd78b('0x0'));var rimraf=require(_0xd78b('0x1'));var zipdir=require(_0xd78b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd78b('0x3'));var BPromise=require(_0xd78b('0x4'));var Mustache=require(_0xd78b('0x5'));var util=require(_0xd78b('0x6'));var path=require('path');var sox=require(_0xd78b('0x7'));var csv=require('to-csv');var ejs=require(_0xd78b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd78b('0x9'));var squel=require('squel');var crypto=require(_0xd78b('0xa'));var jsforce=require(_0xd78b('0xb'));var deskjs=require(_0xd78b('0xc'));var toCsv=require(_0xd78b('0xd'));var querystring=require(_0xd78b('0xe'));var Papa=require(_0xd78b('0xf'));var Redis=require(_0xd78b('0x10'));var authService=require(_0xd78b('0x11'));var qs=require(_0xd78b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd78b('0x13'))(_0xd78b('0x14'));var utils=require(_0xd78b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd78b('0x16'));var db=require(_0xd78b('0x17'))['db'];var dbH=require(_0xd78b('0x17'))[_0xd78b('0x18')];function respondWithStatusCode(_0x27cc76,_0x5eabac){_0x5eabac=_0x5eabac||0xcc;return function(_0x33610f){if(_0x33610f){return _0x27cc76[_0xd78b('0x19')](_0x5eabac);}return _0x27cc76[_0xd78b('0x1a')](_0x5eabac)[_0xd78b('0x1b')]();};}function respondWithResult(_0x2a783a,_0x2f36a7){_0x2f36a7=_0x2f36a7||0xc8;return function(_0x168df1){if(_0x168df1){return _0x2a783a['status'](_0x2f36a7)[_0xd78b('0x1c')](_0x168df1);}};}function respondWithFilteredResult(_0x57395b,_0xfdc037){return function(_0x4da9fa){if(_0x4da9fa){var _0x2a7e10=typeof _0xfdc037[_0xd78b('0x1d')]==='undefined'&&typeof _0xfdc037[_0xd78b('0x1e')]===_0xd78b('0x1f');var _0x8879fe=_0x4da9fa[_0xd78b('0x20')];var _0x66f6d0=_0x2a7e10?0x0:_0xfdc037[_0xd78b('0x1d')];var _0x4c5f8b=_0x2a7e10?_0x4da9fa['count']:_0xfdc037[_0xd78b('0x1d')]+_0xfdc037['limit'];var _0x43968f;if(_0x4c5f8b>=_0x8879fe){_0x4c5f8b=_0x8879fe;_0x43968f=0xc8;}else{_0x43968f=0xce;}_0x57395b[_0xd78b('0x1a')](_0x43968f);return _0x57395b[_0xd78b('0x21')]('Content-Range',_0x66f6d0+'-'+_0x4c5f8b+'/'+_0x8879fe)['json'](_0x4da9fa);}return null;};}function patchUpdates(_0x14e5ab){return function(_0x11b6a2){try{jsonpatch[_0xd78b('0x22')](_0x11b6a2,_0x14e5ab,!![]);}catch(_0x1b4c10){return BPromise[_0xd78b('0x23')](_0x1b4c10);}return _0x11b6a2['save']();};}function saveUpdates(_0x16bfbc,_0x27c21a){return function(_0x1b093d){if(_0x1b093d){return _0x1b093d['update'](_0x16bfbc)[_0xd78b('0x24')](function(_0x2054b3){return _0x2054b3;});}return null;};}function removeEntity(_0x332b5e,_0x3b435a){return function(_0x46a6ab){if(_0x46a6ab){return _0x46a6ab[_0xd78b('0x25')]()[_0xd78b('0x24')](function(){var _0x59e9cf=_0x46a6ab[_0xd78b('0x26')]({'plain':!![]});var _0x3649e7=_0xd78b('0x27');return db[_0xd78b('0x28')][_0xd78b('0x25')]({'where':{'type':_0x3649e7,'resourceId':_0x59e9cf['id']}})[_0xd78b('0x24')](function(){return _0x46a6ab;});})[_0xd78b('0x24')](function(){_0x332b5e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x397dc6,_0x39bdf5){return function(_0x1f411a){if(!_0x1f411a){_0x397dc6[_0xd78b('0x19')](0x194);}return _0x1f411a;};}function handleError(_0x20ae4b,_0x4e90d9){_0x4e90d9=_0x4e90d9||0x1f4;return function(_0x2a9d4c){logger[_0xd78b('0x29')](_0x2a9d4c[_0xd78b('0x2a')]);if(_0x2a9d4c[_0xd78b('0x2b')]){delete _0x2a9d4c[_0xd78b('0x2b')];}_0x20ae4b['status'](_0x4e90d9)[_0xd78b('0x2c')](_0x2a9d4c);};}exports[_0xd78b('0x2d')]=function(_0x2ddb0d,_0x37afe1){var _0x1f7555={},_0x17db8b={},_0x2d7eb5={'count':0x0,'rows':[]};var _0x87c72=_['map'](db[_0xd78b('0x2e')][_0xd78b('0x2f')],function(_0x3f02cb){return{'name':_0x3f02cb['fieldName'],'type':_0x3f02cb['type'][_0xd78b('0x30')]};});_0x17db8b['model']=_[_0xd78b('0x31')](_0x87c72,_0xd78b('0x2b'));_0x17db8b['query']=_[_0xd78b('0x32')](_0x2ddb0d[_0xd78b('0x33')]);_0x17db8b['filters']=_[_0xd78b('0x34')](_0x17db8b['model'],_0x17db8b[_0xd78b('0x33')]);_0x1f7555[_0xd78b('0x35')]=_[_0xd78b('0x34')](_0x17db8b['model'],qs[_0xd78b('0x36')](_0x2ddb0d[_0xd78b('0x33')][_0xd78b('0x36')]));_0x1f7555[_0xd78b('0x35')]=_0x1f7555[_0xd78b('0x35')][_0xd78b('0x37')]?_0x1f7555[_0xd78b('0x35')]:_0x17db8b[_0xd78b('0x38')];if(!_0x2ddb0d[_0xd78b('0x33')]['hasOwnProperty'](_0xd78b('0x39'))){_0x1f7555[_0xd78b('0x1e')]=qs['limit'](_0x2ddb0d['query'][_0xd78b('0x1e')]);_0x1f7555['offset']=qs[_0xd78b('0x1d')](_0x2ddb0d[_0xd78b('0x33')][_0xd78b('0x1d')]);}_0x1f7555[_0xd78b('0x3a')]=qs['sort'](_0x2ddb0d[_0xd78b('0x33')]['sort']);_0x1f7555[_0xd78b('0x3b')]=qs[_0xd78b('0x3c')](_[_0xd78b('0x3d')](_0x2ddb0d[_0xd78b('0x33')],_0x17db8b[_0xd78b('0x3c')]),_0x87c72);if(_0x2ddb0d[_0xd78b('0x33')]['filter']){_0x1f7555['where']=_['merge'](_0x1f7555['where'],{'$or':_['map'](_0x87c72,function(_0x4c8f96){if(_0x4c8f96[_0xd78b('0x3e')]!==_0xd78b('0x3f')){var _0x1be7ed={};_0x1be7ed[_0x4c8f96[_0xd78b('0x2b')]]={'$like':'%'+_0x2ddb0d[_0xd78b('0x33')]['filter']+'%'};return _0x1be7ed;}})});}_0x1f7555=_[_0xd78b('0x40')]({},_0x1f7555,_0x2ddb0d[_0xd78b('0x41')]);var _0x545ba7={'where':_0x1f7555[_0xd78b('0x3b')]};return db[_0xd78b('0x2e')][_0xd78b('0x20')](_0x545ba7)['then'](function(_0x163f7e){_0x2d7eb5[_0xd78b('0x20')]=_0x163f7e;if(_0x2ddb0d['query'][_0xd78b('0x42')]){_0x1f7555[_0xd78b('0x43')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xd78b('0x44')](_0x1f7555);})['then'](function(_0x3806c1){_0x2d7eb5['rows']=_0x3806c1;return _0x2d7eb5;})[_0xd78b('0x24')](respondWithFilteredResult(_0x37afe1,_0x1f7555))[_0xd78b('0x45')](handleError(_0x37afe1,null));};exports[_0xd78b('0x46')]=function(_0x238a87,_0x51a963){var _0x10cbf1={'raw':![],'where':{'id':_0x238a87[_0xd78b('0x47')]['id']}},_0x1b6637={};_0x1b6637[_0xd78b('0x38')]=_[_0xd78b('0x32')](db[_0xd78b('0x2e')][_0xd78b('0x2f')]);_0x1b6637[_0xd78b('0x33')]=_[_0xd78b('0x32')](_0x238a87[_0xd78b('0x33')]);_0x1b6637[_0xd78b('0x3c')]=_[_0xd78b('0x34')](_0x1b6637[_0xd78b('0x38')],_0x1b6637['query']);_0x10cbf1[_0xd78b('0x35')]=_[_0xd78b('0x34')](_0x1b6637['model'],qs[_0xd78b('0x36')](_0x238a87[_0xd78b('0x33')]['fields']));_0x10cbf1[_0xd78b('0x35')]=_0x10cbf1[_0xd78b('0x35')]['length']?_0x10cbf1[_0xd78b('0x35')]:_0x1b6637['model'];if(_0x238a87[_0xd78b('0x33')]['includeAll']){_0x10cbf1[_0xd78b('0x43')]=[{'all':!![]}];}_0x10cbf1=_['merge']({},_0x10cbf1,_0x238a87[_0xd78b('0x41')]);return db['AnalyticCustomReport'][_0xd78b('0x48')](_0x10cbf1)[_0xd78b('0x24')](handleEntityNotFound(_0x51a963,null))[_0xd78b('0x24')](respondWithResult(_0x51a963,null))['catch'](handleError(_0x51a963,null));};exports[_0xd78b('0x49')]=function(_0x60f39f,_0x4c1468){return db['AnalyticCustomReport'][_0xd78b('0x49')](_0x60f39f[_0xd78b('0x4a')],{})[_0xd78b('0x24')](function(_0x243784){var _0x25df36=_0x60f39f['user'][_0xd78b('0x26')]({'plain':!![]});if(!_0x25df36)throw new Error(_0xd78b('0x4b'));if(_0x25df36[_0xd78b('0x4c')]===_0xd78b('0x4d')){var _0x312366=_0x243784[_0xd78b('0x26')]({'plain':!![]});var _0x13a1b3=_0xd78b('0x4e');return db[_0xd78b('0x4f')][_0xd78b('0x48')]({'where':{'name':_0x13a1b3,'userProfileId':_0x25df36[_0xd78b('0x50')]},'raw':!![]})[_0xd78b('0x24')](function(_0x5d6503){if(_0x5d6503&&_0x5d6503[_0xd78b('0x51')]===0x0){return db[_0xd78b('0x28')][_0xd78b('0x49')]({'name':_0x312366[_0xd78b('0x2b')],'resourceId':_0x312366['id'],'type':_0xd78b('0x27'),'sectionId':_0x5d6503['id']},{})['then'](function(){return _0x243784;});}else{return _0x243784;}})[_0xd78b('0x45')](function(_0x189de8){logger[_0xd78b('0x29')](_0xd78b('0x52'),_0x189de8);throw _0x189de8;});}return _0x243784;})[_0xd78b('0x24')](respondWithResult(_0x4c1468,0xc9))[_0xd78b('0x45')](handleError(_0x4c1468,null));};exports['update']=function(_0x3a269a,_0x4200f4){if(_0x3a269a[_0xd78b('0x4a')]['id']){delete _0x3a269a[_0xd78b('0x4a')]['id'];}return db[_0xd78b('0x2e')][_0xd78b('0x48')]({'where':{'id':_0x3a269a[_0xd78b('0x47')]['id']}})['then'](handleEntityNotFound(_0x4200f4,null))['then'](saveUpdates(_0x3a269a['body'],null))['then'](respondWithResult(_0x4200f4,null))[_0xd78b('0x45')](handleError(_0x4200f4,null));};exports[_0xd78b('0x25')]=function(_0x35fbc,_0x5c3109){return db['AnalyticCustomReport']['find']({'where':{'id':_0x35fbc[_0xd78b('0x47')]['id']}})[_0xd78b('0x24')](handleEntityNotFound(_0x5c3109,null))['then'](removeEntity(_0x5c3109,null))[_0xd78b('0x45')](handleError(_0x5c3109,null));};exports[_0xd78b('0x53')]=function(_0x307a05,_0xf7ad56){var _0xb87fe4=0xa;var _0xf383ed=[_0xd78b('0x54'),_0xd78b('0x55'),'right_join',_0xd78b('0x56')];var _0x5b46fa={'SUM':'SUM(%s)','COUNT':_0xd78b('0x57'),'COUNT DISTINCT':_0xd78b('0x58'),'MAX':'MAX(%s)','MIN':_0xd78b('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd78b('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xbee3db={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd78b('0x5b'),'HOUR':_0xd78b('0x5c'),'ROUND':_0xd78b('0x5d'),'UNIX_TIMESTAMP':_0xd78b('0x5e')};var _0x1c6ff4=function(_0x66bf4e){return!_[_0xd78b('0x5f')]([_0xd78b('0x60'),_0xd78b('0x61'),_0xd78b('0x62'),_0xd78b('0x63')],_0x66bf4e);};var _0x195e18=function(_0x11e4b0){if(!_0x11e4b0||!_0x11e4b0[_0xd78b('0x64')]['length']){return'';}for(var _0x277364='(',_0x1dafcb=0x0;_0x1dafcb<_0x11e4b0[_0xd78b('0x64')][_0xd78b('0x37')];_0x1dafcb+=0x1){_0x1dafcb>0x0&&(_0x277364+='\x20'+_0x11e4b0[_0xd78b('0x65')]+'\x20');_0x277364+=_0x11e4b0[_0xd78b('0x64')][_0x1dafcb][_0xd78b('0x66')]?_0x195e18(_0x11e4b0['rules'][_0x1dafcb][_0xd78b('0x66')]):_0x11e4b0[_0xd78b('0x64')][_0x1dafcb][_0xd78b('0x67')]+'\x20'+_0x11e4b0[_0xd78b('0x64')][_0x1dafcb][_0xd78b('0x68')]+(_0x1c6ff4(_0x11e4b0['rules'][_0x1dafcb][_0xd78b('0x68')])?'\x20'+_0x11e4b0[_0xd78b('0x64')][_0x1dafcb][_0xd78b('0x69')]:'');}return _0x277364+')';};var _0x46f8ce={'where':{'id':_0x307a05[_0xd78b('0x47')]['id']}},_0x2c5346,_0x3cee3c,_0x54fe4d,_0x1b6e51,_0x51e8de;_0x46f8ce=_[_0xd78b('0x40')]({},_0x46f8ce,_0x307a05[_0xd78b('0x41')]);return db[_0xd78b('0x2e')][_0xd78b('0x48')](_0x46f8ce)[_0xd78b('0x24')](function(_0x51eaf1){if(_0x51eaf1){_0x2c5346=_0x51eaf1;return _0x51eaf1['getFields']();}return null;})[_0xd78b('0x24')](function(_0x17bb7a){if(_0x17bb7a){if(!_0x17bb7a[_0xd78b('0x37')]){throw new db[(_0xd78b('0x6a'))]['ValidationErrorItem'](_0xd78b('0x6b'),0x193);}_0x3cee3c=_0x17bb7a;return db[_0xd78b('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3afe25){if(_0x3afe25){_0x54fe4d=_[_0xd78b('0x6d')](_0x3afe25,'id');var _0x2d69ab;var _0xb000c6=squel[_0xd78b('0x6e')]();_0xb000c6['from'](_0x2c5346['table']);for(var _0x265553=0x0;_0x265553<_0x3cee3c[_0xd78b('0x37')];_0x265553+=0x1){_0x2d69ab=_0x3cee3c[_0x265553][_0xd78b('0x6f')]?_0x54fe4d[_0x3cee3c[_0x265553][_0xd78b('0x6f')]][_0xd78b('0x70')]:_0x3cee3c[_0x265553][_0xd78b('0x67')];_0x2d69ab=_0x3cee3c[_0x265553][_0xd78b('0x71')]?_[_0xd78b('0x72')](_0x5b46fa[_0x3cee3c[_0x265553][_0xd78b('0x71')]],'%s',_0x2d69ab):_0x2d69ab;_0x2d69ab=_0x3cee3c[_0x265553][_0xd78b('0x73')]?_[_0xd78b('0x72')](_0xbee3db[_0x3cee3c[_0x265553]['format']],'%s',_0x2d69ab):_0x2d69ab;if(_0x3cee3c[_0x265553]['groupBy']){_0xb000c6[_0xd78b('0x66')](_0x2d69ab);}_0x3cee3c[_0x265553][_0xd78b('0x74')]&&_0xb000c6['order'](_0x2d69ab,_0x3cee3c[_0x265553][_0xd78b('0x74')]==='DESC'?![]:!![]);_0xb000c6[_0xd78b('0x67')](_0x2d69ab,_0x3cee3c[_0x265553][_0xd78b('0x75')]||_0x2d69ab);}if(_0x2c5346[_0xd78b('0x76')]){_0x2c5346[_0xd78b('0x76')]=JSON[_0xd78b('0x77')](_0x2c5346[_0xd78b('0x76')]);for(var _0xb8a651=0x0;_0xb8a651<_0x2c5346['joins']['length'];_0xb8a651+=0x1){if(_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x3e')]&&_[_0xd78b('0x5f')](_0xf383ed,_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x3e')])&&_0x2c5346['joins'][_0xb8a651][_0xd78b('0x78')]&&_0x2c5346['joins'][_0xb8a651][_0xd78b('0x79')]&&_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x7a')]){_0xb000c6[_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x3e')]](_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x79')],null,util[_0xd78b('0x73')](_0xd78b('0x7b'),_0x2c5346[_0xd78b('0x7c')],_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x78')],_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x79')],_0x2c5346[_0xd78b('0x76')][_0xb8a651][_0xd78b('0x7a')]));}}}if(_0x2c5346[_0xd78b('0x7d')]){_0x2c5346['conditions']=JSON[_0xd78b('0x77')](_0x2c5346[_0xd78b('0x7d')]);_0xb000c6['where'](_0x195e18(_0x2c5346[_0xd78b('0x7d')][_0xd78b('0x66')]));}_0x51e8de=_0xb000c6[_0xd78b('0x7e')]();_0xb000c6[_0xd78b('0x1e')](_0xb87fe4);_0xb000c6[_0xd78b('0x1d')](0x0);logger[_0xd78b('0x7f')](_0xd78b('0x80'),_0xb000c6[_0xd78b('0x81')]());return dbH[_0xd78b('0x82')][_0xd78b('0x33')](_0xb000c6[_0xd78b('0x81')](),{'type':dbH['sequelize']['QueryTypes'][_0xd78b('0x83')]});}})[_0xd78b('0x24')](respondWithResult(_0xf7ad56,null))[_0xd78b('0x45')](handleError(_0xf7ad56,null));};function runReport(_0x232f8f,_0x3ffac6,_0x4ee224){var _0x37bbc9=_0x3ffac6['name'];var _0x1260a3=0xa;var _0x33c6d3=['join',_0xd78b('0x55'),_0xd78b('0x84'),'cross_join'];var _0x1e1100={'SUM':_0xd78b('0x85'),'COUNT':_0xd78b('0x57'),'COUNT DISTINCT':_0xd78b('0x58'),'MAX':_0xd78b('0x86'),'MIN':'MIN(%s)','AVG':_0xd78b('0x87'),'GROUP_CONCAT':_0xd78b('0x5a'),'GROUP_CONCAT ASC':_0xd78b('0x88'),'GROUP_CONCAT DESC':_0xd78b('0x89')};var _0x2dc1c4={'SEC_TO_TIME':_0xd78b('0x8a'),'DATE':_0xd78b('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0xd78b('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x32a867=function(_0x3577fb){return!_[_0xd78b('0x5f')]([_0xd78b('0x60'),_0xd78b('0x61'),_0xd78b('0x62'),_0xd78b('0x63')],_0x3577fb);};var _0x1e8d98=function(_0x1cc3ec){if(!_0x1cc3ec||!_0x1cc3ec[_0xd78b('0x64')]['length']){return'';}for(var _0x19490e='(',_0x598b20=0x0;_0x598b20<_0x1cc3ec['rules']['length'];_0x598b20+=0x1){_0x598b20>0x0&&(_0x19490e+='\x20'+_0x1cc3ec[_0xd78b('0x65')]+'\x20');_0x19490e+=_0x1cc3ec['rules'][_0x598b20]['group']?_0x1e8d98(_0x1cc3ec['rules'][_0x598b20][_0xd78b('0x66')]):_0x1cc3ec[_0xd78b('0x64')][_0x598b20][_0xd78b('0x67')]+'\x20'+_0x1cc3ec[_0xd78b('0x64')][_0x598b20][_0xd78b('0x68')]+(_0x32a867(_0x1cc3ec[_0xd78b('0x64')][_0x598b20]['condition'])?'\x20'+_0x1cc3ec['rules'][_0x598b20][_0xd78b('0x69')]:'');}return _0x19490e+')';};var _0x4cb086={'where':{'id':_0x232f8f['id']}},_0x17408d,_0x44855b,_0x5a44f2,_0x257c14,_0x39dd13;_0x4cb086=_[_0xd78b('0x40')]({},_0x4cb086,_0x4ee224);return db[_0xd78b('0x2e')][_0xd78b('0x48')](_0x4cb086)['then'](function(_0x392637){if(_0x392637){_0x17408d=_0x392637;return _0x392637['getFields']();}return null;})[_0xd78b('0x24')](function(_0x2d8cbd){if(_0x2d8cbd){if(!_0x2d8cbd[_0xd78b('0x37')]){throw new db['Sequelize'][(_0xd78b('0x8b'))](_0xd78b('0x6b'),0x193);}_0x44855b=_0x2d8cbd;return db[_0xd78b('0x6c')][_0xd78b('0x44')]({'raw':!![]});}return null;})[_0xd78b('0x24')](function(_0x72089d){if(_0x72089d){_0x5a44f2=_[_0xd78b('0x6d')](_0x72089d,'id');var _0x398021;var _0x5319e5=squel[_0xd78b('0x6e')]();_0x5319e5['from'](_0x17408d[_0xd78b('0x7c')]);for(var _0x19de12=0x0;_0x19de12<_0x44855b['length'];_0x19de12+=0x1){_0x398021=_0x44855b[_0x19de12][_0xd78b('0x6f')]?_0x5a44f2[_0x44855b[_0x19de12][_0xd78b('0x6f')]][_0xd78b('0x70')]:_0x44855b[_0x19de12][_0xd78b('0x67')];_0x398021=_0x44855b[_0x19de12][_0xd78b('0x71')]?_[_0xd78b('0x72')](_0x1e1100[_0x44855b[_0x19de12][_0xd78b('0x71')]],'%s',_0x398021):_0x398021;_0x398021=_0x44855b[_0x19de12][_0xd78b('0x73')]?_['replace'](_0x2dc1c4[_0x44855b[_0x19de12][_0xd78b('0x73')]],'%s',_0x398021):_0x398021;if(_0x44855b[_0x19de12][_0xd78b('0x8c')]){_0x5319e5[_0xd78b('0x66')](_0x398021);}_0x44855b[_0x19de12][_0xd78b('0x74')]&&_0x5319e5[_0xd78b('0x3a')](_0x398021,_0x44855b[_0x19de12][_0xd78b('0x74')]===_0xd78b('0x8d')?![]:!![]);_0x5319e5['field'](_0x398021,_0x44855b[_0x19de12][_0xd78b('0x75')]||_0x398021);}if(_0x17408d[_0xd78b('0x76')]){_0x17408d[_0xd78b('0x76')]=JSON[_0xd78b('0x77')](_0x17408d[_0xd78b('0x76')]);for(var _0x34568c=0x0;_0x34568c<_0x17408d[_0xd78b('0x76')][_0xd78b('0x37')];_0x34568c+=0x1){if(_0x17408d[_0xd78b('0x76')][_0x34568c]['type']&&_[_0xd78b('0x5f')](_0x33c6d3,_0x17408d[_0xd78b('0x76')][_0x34568c][_0xd78b('0x3e')])&&_0x17408d[_0xd78b('0x76')][_0x34568c][_0xd78b('0x78')]&&_0x17408d[_0xd78b('0x76')][_0x34568c][_0xd78b('0x79')]&&_0x17408d[_0xd78b('0x76')][_0x34568c][_0xd78b('0x7a')]){_0x5319e5[_0x17408d['joins'][_0x34568c][_0xd78b('0x3e')]](_0x17408d[_0xd78b('0x76')][_0x34568c][_0xd78b('0x79')],null,util[_0xd78b('0x73')]('%s.%s\x20=\x20%s.%s',_0x17408d[_0xd78b('0x7c')],_0x17408d[_0xd78b('0x76')][_0x34568c][_0xd78b('0x78')],_0x17408d[_0xd78b('0x76')][_0x34568c][_0xd78b('0x79')],_0x17408d['joins'][_0x34568c]['foreignKey']));}}}if(_0x17408d[_0xd78b('0x7d')]){_0x17408d['conditions']=JSON[_0xd78b('0x77')](_0x17408d[_0xd78b('0x7d')]);_0x5319e5[_0xd78b('0x3b')](_0x1e8d98(_0x17408d['conditions']['group']));}_0x39dd13=_0x5319e5['clone']();_0x5319e5[_0xd78b('0x1e')](_0x1260a3);_0x5319e5[_0xd78b('0x1d')](0x0);return;}})['then'](function(){if(_0x3ffac6[_0xd78b('0x8e')]==='web'){return null;}var _0x5650cf=_[_0xd78b('0x40')](_0x3ffac6,{'name':_0x3ffac6[_0xd78b('0x8f')]||_0x3ffac6[_0xd78b('0x2b')]||_0x17408d[_0xd78b('0x2b')],'basename':_0x37bbc9,'savename':util['format'](_0xd78b('0x90'),_0x3ffac6['name']||_0x17408d[_0xd78b('0x2b')],require(_0xd78b('0x91'))['generate'](0x4),_0x3ffac6['output']||_0xd78b('0x92')),'reportId':_0x17408d['id'],'reportType':_0xd78b('0x93')});return db['AnalyticExtractedReport'][_0xd78b('0x49')](_0x5650cf,{'raw':!![]});})[_0xd78b('0x24')](function(_0x4b5ea9){if(_0x17408d[_0xd78b('0x7c')]===_0xd78b('0x94')){_0x39dd13[_0xd78b('0x3b')](_0x17408d[_0xd78b('0x7c')]+_0xd78b('0x95'),_0x3ffac6[_0xd78b('0x96')],_0x3ffac6[_0xd78b('0x97')]);}else{_0x39dd13[_0xd78b('0x3b')](_0x17408d[_0xd78b('0x7c')]+_0xd78b('0x98'),_0x3ffac6[_0xd78b('0x96')],_0x3ffac6[_0xd78b('0x97')]);}if(_0x4b5ea9){logger['info'](_0xd78b('0x99'),_0x39dd13['toString']());require(_0xd78b('0x9a'))[_0xd78b('0x9b')](path[_0xd78b('0x54')](__dirname,_0xd78b('0x9c'),_0x4b5ea9[_0xd78b('0x8e')]),[_0x4b5ea9['id'],_0x39dd13[_0xd78b('0x81')](),path[_0xd78b('0x54')](__dirname,_0xd78b('0x9d'),_0x4b5ea9[_0xd78b('0x9e')]),_0x37bbc9]);return _0x4b5ea9;}else{var _0x6dfebd=squel['select']();_0x6dfebd['from']('('+_0x39dd13[_0xd78b('0x81')]()+')',_0xd78b('0x9f'));_0x6dfebd['field'](_0xd78b('0xa0'),'count');_0x39dd13['limit'](_0x3ffac6[_0xd78b('0x1e')]||_0x1260a3);_0x39dd13[_0xd78b('0x1d')](_0x3ffac6[_0xd78b('0x1d')]||0x0);return dbH[_0xd78b('0x82')][_0xd78b('0x33')](_0x6dfebd[_0xd78b('0x81')](),{'type':dbH[_0xd78b('0x82')][_0xd78b('0xa1')]['SELECT']})[_0xd78b('0x24')](function(_0x159236){if(!_0x159236[_0xd78b('0x37')]){_0x257c14=0x0;}else{_0x257c14=_0x159236[0x0]['count']||0x0;}return dbH[_0xd78b('0x82')][_0xd78b('0x33')](_0x39dd13[_0xd78b('0x81')](),{'type':dbH[_0xd78b('0x82')][_0xd78b('0xa1')][_0xd78b('0x83')]});})['then'](function(_0x139d38){return{'rows':_0x139d38||[],'count':_0x257c14};});}});}exports['run']=function(_0x1c5147,_0x2d5e6d){return runReport(_0x1c5147[_0xd78b('0x47')],_0x1c5147[_0xd78b('0x33')],_0x1c5147[_0xd78b('0x41')])['then'](respondWithResult(_0x2d5e6d,null))[_0xd78b('0x45')](handleError(_0x2d5e6d,null));};exports[_0xd78b('0xa2')]=runReport;exports[_0xd78b('0x33')]=function(_0x2cbb92,_0x1951ea){var _0x38c37e=0xa;var _0x22154e=[_0xd78b('0x54'),_0xd78b('0x55'),'right_join','cross_join'];var _0x83d42={'SUM':_0xd78b('0x85'),'COUNT':_0xd78b('0x57'),'COUNT DISTINCT':_0xd78b('0x58'),'MAX':_0xd78b('0x86'),'MIN':_0xd78b('0x59'),'AVG':_0xd78b('0x87'),'GROUP_CONCAT':_0xd78b('0x5a'),'GROUP_CONCAT ASC':_0xd78b('0x88'),'GROUP_CONCAT DESC':_0xd78b('0x89')};var _0x49a267={'SEC_TO_TIME':_0xd78b('0x8a'),'DATE':_0xd78b('0x5b'),'HOUR':_0xd78b('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c1532=function(_0x3880fc){return!_[_0xd78b('0x5f')]([_0xd78b('0x60'),_0xd78b('0x61'),_0xd78b('0x62'),_0xd78b('0x63')],_0x3880fc);};var _0x280f72=function(_0xfd6806){if(!_0xfd6806||!_0xfd6806['rules'][_0xd78b('0x37')]){return'';}for(var _0x31306b='(',_0x49db29=0x0;_0x49db29<_0xfd6806[_0xd78b('0x64')][_0xd78b('0x37')];_0x49db29+=0x1){_0x49db29>0x0&&(_0x31306b+='\x20'+_0xfd6806[_0xd78b('0x65')]+'\x20');_0x31306b+=_0xfd6806['rules'][_0x49db29]['group']?_0x280f72(_0xfd6806[_0xd78b('0x64')][_0x49db29][_0xd78b('0x66')]):_0xfd6806[_0xd78b('0x64')][_0x49db29][_0xd78b('0x67')]+'\x20'+_0xfd6806['rules'][_0x49db29][_0xd78b('0x68')]+(_0x1c1532(_0xfd6806[_0xd78b('0x64')][_0x49db29][_0xd78b('0x68')])?'\x20'+_0xfd6806['rules'][_0x49db29][_0xd78b('0x69')]:'');}return _0x31306b+')';};var _0x184411={'where':{'id':_0x2cbb92[_0xd78b('0x47')]['id']}},_0x37a6a5,_0x19c294,_0x113ac6,_0x4b93f0,_0x176b00;_0x184411=_[_0xd78b('0x40')]({},_0x184411,_0x2cbb92['options']);return db[_0xd78b('0x2e')][_0xd78b('0x48')](_0x184411)[_0xd78b('0x24')](function(_0xc48067){if(_0xc48067){_0x37a6a5=_0xc48067;return _0xc48067[_0xd78b('0xa3')]();}return null;})[_0xd78b('0x24')](function(_0x57e4b9){if(_0x57e4b9){if(!_0x57e4b9['length']){throw new db[(_0xd78b('0x6a'))][(_0xd78b('0x8b'))](_0xd78b('0x6b'),0x193);}_0x19c294=_0x57e4b9;return db[_0xd78b('0x6c')][_0xd78b('0x44')]({'raw':!![]});}return null;})[_0xd78b('0x24')](function(_0x138216){if(_0x138216){_0x113ac6=_[_0xd78b('0x6d')](_0x138216,'id');var _0x246ca9;var _0x3aa61b=squel[_0xd78b('0x6e')]();_0x3aa61b[_0xd78b('0xa4')](_0x37a6a5[_0xd78b('0x7c')]);for(var _0x3590cb=0x0;_0x3590cb<_0x19c294[_0xd78b('0x37')];_0x3590cb+=0x1){_0x246ca9=_0x19c294[_0x3590cb][_0xd78b('0x6f')]?_0x113ac6[_0x19c294[_0x3590cb][_0xd78b('0x6f')]][_0xd78b('0x70')]:_0x19c294[_0x3590cb][_0xd78b('0x67')];_0x246ca9=_0x19c294[_0x3590cb]['function']?_[_0xd78b('0x72')](_0x83d42[_0x19c294[_0x3590cb]['function']],'%s',_0x246ca9):_0x246ca9;_0x246ca9=_0x19c294[_0x3590cb]['format']?_[_0xd78b('0x72')](_0x49a267[_0x19c294[_0x3590cb][_0xd78b('0x73')]],'%s',_0x246ca9):_0x246ca9;if(_0x19c294[_0x3590cb][_0xd78b('0x8c')]){_0x3aa61b[_0xd78b('0x66')](_0x246ca9);}_0x19c294[_0x3590cb][_0xd78b('0x74')]&&_0x3aa61b['order'](_0x246ca9,_0x19c294[_0x3590cb][_0xd78b('0x74')]===_0xd78b('0x8d')?![]:!![]);_0x3aa61b[_0xd78b('0x67')](_0x246ca9,_0x19c294[_0x3590cb][_0xd78b('0x75')]||_0x246ca9);}if(_0x37a6a5['joins']){_0x37a6a5[_0xd78b('0x76')]=JSON[_0xd78b('0x77')](_0x37a6a5[_0xd78b('0x76')]);for(var _0x412185=0x0;_0x412185<_0x37a6a5[_0xd78b('0x76')][_0xd78b('0x37')];_0x412185+=0x1){if(_0x37a6a5[_0xd78b('0x76')][_0x412185][_0xd78b('0x3e')]&&_[_0xd78b('0x5f')](_0x22154e,_0x37a6a5['joins'][_0x412185][_0xd78b('0x3e')])&&_0x37a6a5['joins'][_0x412185][_0xd78b('0x78')]&&_0x37a6a5[_0xd78b('0x76')][_0x412185][_0xd78b('0x79')]&&_0x37a6a5[_0xd78b('0x76')][_0x412185]['foreignKey']){_0x3aa61b[_0x37a6a5[_0xd78b('0x76')][_0x412185][_0xd78b('0x3e')]](_0x37a6a5[_0xd78b('0x76')][_0x412185][_0xd78b('0x79')],null,util[_0xd78b('0x73')](_0xd78b('0x7b'),_0x37a6a5[_0xd78b('0x7c')],_0x37a6a5[_0xd78b('0x76')][_0x412185][_0xd78b('0x78')],_0x37a6a5[_0xd78b('0x76')][_0x412185][_0xd78b('0x79')],_0x37a6a5['joins'][_0x412185][_0xd78b('0x7a')]));}}}if(_0x37a6a5[_0xd78b('0x7d')]){_0x37a6a5[_0xd78b('0x7d')]=JSON['parse'](_0x37a6a5['conditions']);_0x3aa61b[_0xd78b('0x3b')](_0x280f72(_0x37a6a5[_0xd78b('0x7d')][_0xd78b('0x66')]));}_0x176b00=_0x3aa61b[_0xd78b('0x7e')]();_0x3aa61b['limit'](_0x38c37e);_0x3aa61b[_0xd78b('0x1d')](0x0);logger[_0xd78b('0x7f')](_0xd78b('0x80'),_0x3aa61b['toString']());return dbH[_0xd78b('0x82')][_0xd78b('0x33')](_0x3aa61b['toString'](),{'type':dbH[_0xd78b('0x82')][_0xd78b('0xa1')][_0xd78b('0x83')]});}})[_0xd78b('0x24')](function(){return{'sql':_0x176b00[_0xd78b('0x81')]()};})[_0xd78b('0x24')](respondWithResult(_0x1951ea,null))[_0xd78b('0x45')](handleError(_0x1951ea,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index c89c85c..3e486b8 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 _0xbf11=['lodash','util','api','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports'];(function(_0x31acc7,_0x168431){var _0x10d549=function(_0x4b5412){while(--_0x4b5412){_0x31acc7['push'](_0x31acc7['shift']());}};_0x10d549(++_0x168431);}(_0xbf11,0x181));var _0x1bf1=function(_0x1ce575,_0xbcf48f){_0x1ce575=_0x1ce575-0x0;var _0x20118a=_0xbf11[_0x1ce575];return _0x20118a;};'use strict';var _=require(_0x1bf1('0x0'));var util=require(_0x1bf1('0x1'));var logger=require('../../config/logger')(_0x1bf1('0x2'));var moment=require('moment');var BPromise=require(_0x1bf1('0x3'));var rp=require(_0x1bf1('0x4'));var fs=require('fs');var path=require(_0x1bf1('0x5'));var rimraf=require('rimraf');var config=require(_0x1bf1('0x6'));var attributes=require(_0x1bf1('0x7'));module[_0x1bf1('0x8')]=function(_0x39807e,_0x5a051d){return _0x39807e[_0x1bf1('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x1bf1('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe28=['util','../../config/logger','api','bluebird','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash'];(function(_0x48ec91,_0x212edc){var _0x22766c=function(_0x136751){while(--_0x136751){_0x48ec91['push'](_0x48ec91['shift']());}};_0x22766c(++_0x212edc);}(_0xfe28,0x104));var _0x8fe2=function(_0x5a1377,_0x1ba21d){_0x5a1377=_0x5a1377-0x0;var _0x5a54d5=_0xfe28[_0x5a1377];return _0x5a54d5;};'use strict';var _=require(_0x8fe2('0x0'));var util=require(_0x8fe2('0x1'));var logger=require(_0x8fe2('0x2'))(_0x8fe2('0x3'));var moment=require('moment');var BPromise=require(_0x8fe2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8fe2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8fe2('0x6'));module['exports']=function(_0x162c5c,_0x1a47c7){return _0x162c5c[_0x8fe2('0x7')](_0x8fe2('0x8'),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 c7ce254..9e46c8e 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 _0xb845=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x2b80e0,_0x2eccc4){var _0x5e8c0d=function(_0x2b2a6c){while(--_0x2b2a6c){_0x2b80e0['push'](_0x2b80e0['shift']());}};_0x5e8c0d(++_0x2eccc4);}(_0xb845,0x13f));var _0x5b84=function(_0x5b8e9f,_0x20def9){_0x5b8e9f=_0x5b8e9f-0x0;var _0x367af0=_0xb845[_0x5b8e9f];return _0x367af0;};'use strict';var _=require(_0x5b84('0x0'));var util=require('util');var moment=require(_0x5b84('0x1'));var BPromise=require(_0x5b84('0x2'));var rs=require(_0x5b84('0x3'));var fs=require('fs');var Redis=require(_0x5b84('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b84('0x5'))(_0x5b84('0x6'));var config=require(_0x5b84('0x7'));var jayson=require(_0x5b84('0x8'));var client=jayson[_0x5b84('0x9')][_0x5b84('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f2936,_0x5d98a9,_0x453e79){return new BPromise(function(_0x32dce0,_0xd53975){return client[_0x5b84('0xb')](_0x4f2936,_0x453e79)[_0x5b84('0xc')](function(_0x291bf1){logger[_0x5b84('0xd')](_0x5b84('0xe'),_0x5d98a9,_0x5b84('0xf'));logger['debug'](_0x5b84('0x10'),_0x5d98a9,'request\x20sent',JSON['stringify'](_0x291bf1));if(_0x291bf1[_0x5b84('0x11')]){if(_0x291bf1[_0x5b84('0x11')]['code']===0x1f4){logger[_0x5b84('0x11')](_0x5b84('0xe'),_0x5d98a9,_0x291bf1['error'][_0x5b84('0x12')]);return _0xd53975(_0x291bf1[_0x5b84('0x11')][_0x5b84('0x12')]);}logger[_0x5b84('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d98a9,_0x291bf1['error']['message']);return _0x32dce0(_0x291bf1['error'][_0x5b84('0x12')]);}else{logger[_0x5b84('0xd')](_0x5b84('0xe'),_0x5d98a9,_0x5b84('0xf'));_0x32dce0(_0x291bf1[_0x5b84('0x13')][_0x5b84('0x12')]);}})[_0x5b84('0x14')](function(_0x49c44d){logger[_0x5b84('0x11')](_0x5b84('0xe'),_0x5d98a9,_0x49c44d);_0xd53975(_0x49c44d);});});} \ No newline at end of file +var _0x453b=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x2150af,_0x128fab){var _0x1c89b6=function(_0x31af22){while(--_0x31af22){_0x2150af['push'](_0x2150af['shift']());}};_0x1c89b6(++_0x128fab);}(_0x453b,0x17f));var _0xb453=function(_0x337537,_0x4ea7b8){_0x337537=_0x337537-0x0;var _0x4fdd67=_0x453b[_0x337537];return _0x4fdd67;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var moment=require('moment');var BPromise=require(_0xb453('0x2'));var rs=require(_0xb453('0x3'));var fs=require('fs');var Redis=require(_0xb453('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb453('0x5'));var logger=require(_0xb453('0x6'))(_0xb453('0x7'));var config=require(_0xb453('0x8'));var jayson=require(_0xb453('0x9'));var client=jayson['client'][_0xb453('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d566e,_0x3c19c8,_0x3acda0){return new BPromise(function(_0x2bd0ac,_0x277759){return client[_0xb453('0xb')](_0x2d566e,_0x3acda0)['then'](function(_0x5b928c){logger[_0xb453('0xc')](_0xb453('0xd'),_0x3c19c8,_0xb453('0xe'));logger[_0xb453('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3c19c8,'request\x20sent',JSON['stringify'](_0x5b928c));if(_0x5b928c['error']){if(_0x5b928c[_0xb453('0x10')]['code']===0x1f4){logger[_0xb453('0x10')](_0xb453('0xd'),_0x3c19c8,_0x5b928c[_0xb453('0x10')][_0xb453('0x11')]);return _0x277759(_0x5b928c[_0xb453('0x10')]['message']);}logger[_0xb453('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3c19c8,_0x5b928c[_0xb453('0x10')][_0xb453('0x11')]);return _0x2bd0ac(_0x5b928c[_0xb453('0x10')]['message']);}else{logger[_0xb453('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3c19c8,_0xb453('0xe'));_0x2bd0ac(_0x5b928c[_0xb453('0x12')][_0xb453('0x11')]);}})[_0xb453('0x13')](function(_0x17565b){logger['error'](_0xb453('0xd'),_0x3c19c8,_0x17565b);_0x277759(_0x17565b);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index e2c791c..91a0e3a 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 _0x3266=['update','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x3266,0xe8));var _0x6326=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x3266[_0x1147ab];return _0x55cb5a;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require('path');var timeout=require(_0x6326('0x2'));var express=require('express');var router=express[_0x6326('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6326('0x4'));var config=require(_0x6326('0x5'));var controller=require(_0x6326('0x6'));router['get']('/',auth[_0x6326('0x7')](),controller['index']);router[_0x6326('0x8')](_0x6326('0x9'),auth[_0x6326('0x7')](),controller[_0x6326('0xa')]);router[_0x6326('0x8')](_0x6326('0xb'),auth[_0x6326('0x7')](),controller[_0x6326('0xc')]);router[_0x6326('0x8')](_0x6326('0xd'),auth[_0x6326('0x7')](),controller[_0x6326('0xe')]);router[_0x6326('0x8')](_0x6326('0xf'),auth[_0x6326('0x7')](),controller[_0x6326('0x10')]);router[_0x6326('0x11')]('/',auth[_0x6326('0x7')](),controller[_0x6326('0x12')]);router[_0x6326('0x13')](_0x6326('0x9'),auth[_0x6326('0x7')](),controller[_0x6326('0x14')]);router['delete'](_0x6326('0x9'),auth[_0x6326('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xee4a=['/:id/query','query','post','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','index','/:id','/:id/preview','isAuthenticated','preview','/:id/run'];(function(_0x2f4d7f,_0x62f4b7){var _0x147ba1=function(_0x14ef36){while(--_0x14ef36){_0x2f4d7f['push'](_0x2f4d7f['shift']());}};_0x147ba1(++_0x62f4b7);}(_0xee4a,0xd8));var _0xaee4=function(_0x3434b0,_0xb5e967){_0x3434b0=_0x3434b0-0x0;var _0x28f0a1=_0xee4a[_0x3434b0];return _0x28f0a1;};'use strict';var multer=require(_0xaee4('0x0'));var util=require(_0xaee4('0x1'));var path=require(_0xaee4('0x2'));var timeout=require(_0xaee4('0x3'));var express=require(_0xaee4('0x4'));var router=express[_0xaee4('0x5')]();var fs_extra=require(_0xaee4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xaee4('0x7'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xaee4('0x8')]('/',auth['isAuthenticated'](),controller[_0xaee4('0x9')]);router[_0xaee4('0x8')](_0xaee4('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xaee4('0x8')](_0xaee4('0xb'),auth[_0xaee4('0xc')](),controller[_0xaee4('0xd')]);router['get'](_0xaee4('0xe'),auth[_0xaee4('0xc')](),controller['run']);router[_0xaee4('0x8')](_0xaee4('0xf'),auth[_0xaee4('0xc')](),controller[_0xaee4('0x10')]);router[_0xaee4('0x11')]('/',auth[_0xaee4('0xc')](),controller['create']);router[_0xaee4('0x12')](_0xaee4('0xa'),auth['isAuthenticated'](),controller[_0xaee4('0x13')]);router['delete']('/:id',auth[_0xaee4('0xc')](),controller[_0xaee4('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index fd0d96d..6dd2f45 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 _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x7611ce,_0x4a4441){var _0x67d3ab=function(_0x1456d8){while(--_0x1456d8){_0x7611ce['push'](_0x7611ce['shift']());}};_0x67d3ab(++_0x4a4441);}(_0x5075,0x73));var _0x5507=function(_0x2eb35d,_0x4a7a45){_0x2eb35d=_0x2eb35d-0x0;var _0x1f9854=_0x5075[_0x2eb35d];return _0x1f9854;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x17cae8,_0x38a643){var _0xad9680=function(_0x47aae8){while(--_0x47aae8){_0x17cae8['push'](_0x17cae8['shift']());}};_0xad9680(++_0x38a643);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index c67ed8e..b2b9a8c 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 _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x39d7c0,_0x3903a5){var _0x39abf1=function(_0x1a4676){while(--_0x1a4676){_0x39d7c0['push'](_0x39d7c0['shift']());}};_0x39abf1(++_0x3903a5);}(_0x5fab,0x177));var _0xb5fa=function(_0x21bf22,_0x16172a){_0x21bf22=_0x21bf22-0x0;var _0x144ee9=_0x5fab[_0x21bf22];return _0x144ee9;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));}; \ No newline at end of file +var _0x3f8a=['get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','keys','intersection','model','attributes','fields','query','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','include','findAll','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','condition','ValidationErrorItem','metric','DESC','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','run','runReport','%s.%s\x20=\x20%s.%s','debug','eml-format','rimraf','zip-dir','fast-json-patch','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','dbH','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then'];(function(_0x43e4e0,_0x1e9055){var _0x40a7ea=function(_0x21d377){while(--_0x21d377){_0x43e4e0['push'](_0x43e4e0['shift']());}};_0x40a7ea(++_0x1e9055);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x34df48,_0x92b99f){_0x34df48=_0x34df48-0x0;var _0x1bf00a=_0x3f8a[_0x34df48];return _0x1bf00a;};'use strict';var emlformat=require(_0xa3f8('0x0'));var rimraf=require(_0xa3f8('0x1'));var zipdir=require(_0xa3f8('0x2'));var jsonpatch=require(_0xa3f8('0x3'));var rp=require('request-promise');var moment=require(_0xa3f8('0x4'));var BPromise=require(_0xa3f8('0x5'));var Mustache=require(_0xa3f8('0x6'));var util=require(_0xa3f8('0x7'));var path=require(_0xa3f8('0x8'));var sox=require(_0xa3f8('0x9'));var csv=require(_0xa3f8('0xa'));var ejs=require(_0xa3f8('0xb'));var fs=require('fs');var fs_extra=require(_0xa3f8('0xc'));var _=require(_0xa3f8('0xd'));var squel=require(_0xa3f8('0xe'));var crypto=require(_0xa3f8('0xf'));var jsforce=require(_0xa3f8('0x10'));var deskjs=require(_0xa3f8('0x11'));var toCsv=require(_0xa3f8('0xa'));var querystring=require(_0xa3f8('0x12'));var Papa=require(_0xa3f8('0x13'));var Redis=require('ioredis');var authService=require(_0xa3f8('0x14'));var qs=require(_0xa3f8('0x15'));var as=require(_0xa3f8('0x16'));var hardwareService=require(_0xa3f8('0x17'));var logger=require('../../config/logger')(_0xa3f8('0x18'));var utils=require(_0xa3f8('0x19'));var config=require(_0xa3f8('0x1a'));var licenseUtil=require(_0xa3f8('0x1b'));var db=require(_0xa3f8('0x1c'))['db'];var dbH=require(_0xa3f8('0x1c'))[_0xa3f8('0x1d')];function respondWithStatusCode(_0x63de8b,_0x324aa8){_0x324aa8=_0x324aa8||0xcc;return function(_0x36b1b8){if(_0x36b1b8){return _0x63de8b[_0xa3f8('0x1e')](_0x324aa8);}return _0x63de8b[_0xa3f8('0x1f')](_0x324aa8)['end']();};}function respondWithResult(_0x2d8f74,_0xe55848){_0xe55848=_0xe55848||0xc8;return function(_0x45014f){if(_0x45014f){return _0x2d8f74[_0xa3f8('0x1f')](_0xe55848)['json'](_0x45014f);}};}function respondWithFilteredResult(_0x39c450,_0x33b98e){return function(_0x46a8d9){if(_0x46a8d9){var _0x8cd130=typeof _0x33b98e[_0xa3f8('0x20')]===_0xa3f8('0x21')&&typeof _0x33b98e[_0xa3f8('0x22')]===_0xa3f8('0x21');var _0x2cb49f=_0x46a8d9[_0xa3f8('0x23')];var _0x54b870=_0x8cd130?0x0:_0x33b98e[_0xa3f8('0x20')];var _0x5a0e18=_0x8cd130?_0x46a8d9[_0xa3f8('0x23')]:_0x33b98e[_0xa3f8('0x20')]+_0x33b98e[_0xa3f8('0x22')];var _0x46042d;if(_0x5a0e18>=_0x2cb49f){_0x5a0e18=_0x2cb49f;_0x46042d=0xc8;}else{_0x46042d=0xce;}_0x39c450['status'](_0x46042d);return _0x39c450[_0xa3f8('0x24')]('Content-Range',_0x54b870+'-'+_0x5a0e18+'/'+_0x2cb49f)[_0xa3f8('0x25')](_0x46a8d9);}return null;};}function patchUpdates(_0x58336d){return function(_0x4066bb){try{jsonpatch[_0xa3f8('0x26')](_0x4066bb,_0x58336d,!![]);}catch(_0x353daa){return BPromise[_0xa3f8('0x27')](_0x353daa);}return _0x4066bb[_0xa3f8('0x28')]();};}function saveUpdates(_0x1e5f30,_0x187352){return function(_0x490717){if(_0x490717){return _0x490717[_0xa3f8('0x29')](_0x1e5f30)['then'](function(_0x3ce57b){return _0x3ce57b;});}return null;};}function removeEntity(_0xa5a697,_0x24985a){return function(_0x37b290){if(_0x37b290){return _0x37b290[_0xa3f8('0x2a')]()[_0xa3f8('0x2b')](function(){var _0x6e3cb4=_0x37b290[_0xa3f8('0x2c')]({'plain':!![]});var _0x1e22b8=_0xa3f8('0x2d');return db['UserProfileResource'][_0xa3f8('0x2a')]({'where':{'type':_0x1e22b8,'resourceId':_0x6e3cb4['id']}})[_0xa3f8('0x2b')](function(){return _0x37b290;});})[_0xa3f8('0x2b')](function(){_0xa5a697['status'](0xcc)[_0xa3f8('0x2e')]();});}};}function handleEntityNotFound(_0x57f6be,_0xbad6a6){return function(_0x3a3746){if(!_0x3a3746){_0x57f6be[_0xa3f8('0x1e')](0x194);}return _0x3a3746;};}function handleError(_0x4ea213,_0x458824){_0x458824=_0x458824||0x1f4;return function(_0x5e69e2){logger[_0xa3f8('0x2f')](_0x5e69e2[_0xa3f8('0x30')]);if(_0x5e69e2[_0xa3f8('0x31')]){delete _0x5e69e2[_0xa3f8('0x31')];}_0x4ea213[_0xa3f8('0x1f')](_0x458824)[_0xa3f8('0x32')](_0x5e69e2);};}exports[_0xa3f8('0x33')]=function(_0x424a3e,_0x25f9f5){var _0x290a4e={},_0x6e83b0={},_0x57c465={'count':0x0,'rows':[]};var _0x4404da=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x3bb4b0){return{'name':_0x3bb4b0['fieldName'],'type':_0x3bb4b0[_0xa3f8('0x37')][_0xa3f8('0x38')]};});_0x6e83b0['model']=_[_0xa3f8('0x34')](_0x4404da,_0xa3f8('0x31'));_0x6e83b0['query']=_[_0xa3f8('0x39')](_0x424a3e['query']);_0x6e83b0['filters']=_[_0xa3f8('0x3a')](_0x6e83b0[_0xa3f8('0x3b')],_0x6e83b0['query']);_0x290a4e[_0xa3f8('0x3c')]=_['intersection'](_0x6e83b0[_0xa3f8('0x3b')],qs[_0xa3f8('0x3d')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x290a4e['attributes']=_0x290a4e[_0xa3f8('0x3c')]['length']?_0x290a4e[_0xa3f8('0x3c')]:_0x6e83b0['model'];if(!_0x424a3e[_0xa3f8('0x3e')]['hasOwnProperty']('nolimit')){_0x290a4e['limit']=qs[_0xa3f8('0x22')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x22')]);_0x290a4e[_0xa3f8('0x20')]=qs['offset'](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x20')]);}_0x290a4e[_0xa3f8('0x3f')]=qs[_0xa3f8('0x40')](_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x40')]);_0x290a4e['where']=qs[_0xa3f8('0x41')](_[_0xa3f8('0x42')](_0x424a3e[_0xa3f8('0x3e')],_0x6e83b0['filters']),_0x4404da);if(_0x424a3e[_0xa3f8('0x3e')][_0xa3f8('0x43')]){_0x290a4e['where']=_[_0xa3f8('0x44')](_0x290a4e['where'],{'$or':_[_0xa3f8('0x34')](_0x4404da,function(_0x5a077c){if(_0x5a077c[_0xa3f8('0x37')]!==_0xa3f8('0x45')){var _0x9a00e7={};_0x9a00e7[_0x5a077c[_0xa3f8('0x31')]]={'$like':'%'+_0x424a3e[_0xa3f8('0x3e')]['filter']+'%'};return _0x9a00e7;}})});}_0x290a4e=_[_0xa3f8('0x44')]({},_0x290a4e,_0x424a3e[_0xa3f8('0x46')]);var _0x4db9c5={'where':_0x290a4e[_0xa3f8('0x47')]};return db['AnalyticDefaultReport'][_0xa3f8('0x23')](_0x4db9c5)[_0xa3f8('0x2b')](function(_0x1542cc){_0x57c465[_0xa3f8('0x23')]=_0x1542cc;if(_0x424a3e[_0xa3f8('0x3e')]['includeAll']){_0x290a4e[_0xa3f8('0x48')]=[{'all':!![]}];}return db[_0xa3f8('0x35')][_0xa3f8('0x49')](_0x290a4e);})[_0xa3f8('0x2b')](function(_0x337808){_0x57c465['rows']=_0x337808;return _0x57c465;})[_0xa3f8('0x2b')](respondWithFilteredResult(_0x25f9f5,_0x290a4e))[_0xa3f8('0x4a')](handleError(_0x25f9f5,null));};exports[_0xa3f8('0x4b')]=function(_0x32e371,_0x2a124b){var _0x314dba={'raw':!![],'where':{'id':_0x32e371[_0xa3f8('0x4c')]['id']}},_0x497217={};_0x497217[_0xa3f8('0x3b')]=_[_0xa3f8('0x39')](db[_0xa3f8('0x35')][_0xa3f8('0x36')]);_0x497217[_0xa3f8('0x3e')]=_['keys'](_0x32e371['query']);_0x497217['filters']=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],_0x497217[_0xa3f8('0x3e')]);_0x314dba[_0xa3f8('0x3c')]=_[_0xa3f8('0x3a')](_0x497217[_0xa3f8('0x3b')],qs['fields'](_0x32e371[_0xa3f8('0x3e')][_0xa3f8('0x3d')]));_0x314dba[_0xa3f8('0x3c')]=_0x314dba[_0xa3f8('0x3c')]['length']?_0x314dba[_0xa3f8('0x3c')]:_0x497217[_0xa3f8('0x3b')];if(_0x32e371[_0xa3f8('0x3e')]['includeAll']){_0x314dba['include']=[{'all':!![]}];}_0x314dba=_['merge']({},_0x314dba,_0x32e371[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')]['find'](_0x314dba)[_0xa3f8('0x2b')](handleEntityNotFound(_0x2a124b,null))[_0xa3f8('0x2b')](respondWithResult(_0x2a124b,null))[_0xa3f8('0x4a')](handleError(_0x2a124b,null));};exports[_0xa3f8('0x4d')]=function(_0x14932f,_0x3c74b5){return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x14932f[_0xa3f8('0x4e')],{})[_0xa3f8('0x2b')](function(_0x338554){var _0x29d8f5=_0x14932f[_0xa3f8('0x4f')][_0xa3f8('0x2c')]({'plain':!![]});if(!_0x29d8f5)throw new Error(_0xa3f8('0x50'));if(_0x29d8f5[_0xa3f8('0x51')]===_0xa3f8('0x4f')){var _0x559ae7=_0x338554['get']({'plain':!![]});var _0x1fad80=_0xa3f8('0x52');return db['UserProfileSection'][_0xa3f8('0x53')]({'where':{'name':_0x1fad80,'userProfileId':_0x29d8f5[_0xa3f8('0x54')]},'raw':!![]})[_0xa3f8('0x2b')](function(_0xaff79b){if(_0xaff79b&&_0xaff79b[_0xa3f8('0x55')]===0x0){return db[_0xa3f8('0x56')][_0xa3f8('0x4d')]({'name':_0x559ae7[_0xa3f8('0x31')],'resourceId':_0x559ae7['id'],'type':_0xa3f8('0x2d'),'sectionId':_0xaff79b['id']},{})[_0xa3f8('0x2b')](function(){return _0x338554;});}else{return _0x338554;}})[_0xa3f8('0x4a')](function(_0x3752fa){logger[_0xa3f8('0x2f')](_0xa3f8('0x57'),_0x3752fa);throw _0x3752fa;});}return _0x338554;})[_0xa3f8('0x2b')](respondWithResult(_0x3c74b5,0xc9))[_0xa3f8('0x4a')](handleError(_0x3c74b5,null));};exports['update']=function(_0x593614,_0xd0628e){if(_0x593614['body']['id']){delete _0x593614[_0xa3f8('0x4e')]['id'];}return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x593614['params']['id']}})[_0xa3f8('0x2b')](handleEntityNotFound(_0xd0628e,null))[_0xa3f8('0x2b')](saveUpdates(_0x593614[_0xa3f8('0x4e')],null))[_0xa3f8('0x2b')](respondWithResult(_0xd0628e,null))['catch'](handleError(_0xd0628e,null));};exports[_0xa3f8('0x2a')]=function(_0x47cc0c,_0x392e1e){return db[_0xa3f8('0x35')][_0xa3f8('0x53')]({'where':{'id':_0x47cc0c['params']['id']}})['then'](handleEntityNotFound(_0x392e1e,null))[_0xa3f8('0x2b')](removeEntity(_0x392e1e,null))[_0xa3f8('0x4a')](handleError(_0x392e1e,null));};exports[_0xa3f8('0x58')]=function(_0x6ad40a,_0x48f5a6){var _0x36eac9=0xa;var _0x3478e8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x5d7877={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521719={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x27de61=function(_0x356643){return!_[_0xa3f8('0x68')](['IS\x20NULL',_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x356643);};var _0x42e3f8=function(_0x27c5aa){if(!_0x27c5aa||!_0x27c5aa[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x4d0404='(',_0x33ea06=0x0;_0x33ea06<_0x27c5aa[_0xa3f8('0x6c')]['length'];_0x33ea06+=0x1){_0x33ea06>0x0&&(_0x4d0404+='\x20'+_0x27c5aa[_0xa3f8('0x6e')]+'\x20');_0x4d0404+=_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]?_0x42e3f8(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x6f')]):_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x70')]+'\x20'+_0x27c5aa['rules'][_0x33ea06]['condition']+(_0x27de61(_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06]['condition'])?'\x20'+_0x27c5aa[_0xa3f8('0x6c')][_0x33ea06][_0xa3f8('0x71')]:'');}return _0x4d0404+')';};var _0x3ff369={'where':{'id':_0x6ad40a[_0xa3f8('0x4c')]['id']}},_0x1dba7e,_0x452e99,_0x35d4d6,_0xeca2dc,_0x14508d;_0x3ff369=_[_0xa3f8('0x44')]({},_0x3ff369,_0x6ad40a[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x3ff369)['then'](function(_0x5efdcf){if(_0x5efdcf){_0x1dba7e=_0x5efdcf;return _0x5efdcf[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x1688ca){if(_0x1688ca){if(!_0x1688ca[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))]['ValidationErrorItem'](_0xa3f8('0x74'),0x193);}_0x452e99=_0x1688ca;return db[_0xa3f8('0x75')][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x28d359){if(_0x28d359){_0x35d4d6=_[_0xa3f8('0x76')](_0x28d359,'id');var _0x3d45ae;var _0x3a2362=squel[_0xa3f8('0x77')]();_0x3a2362[_0xa3f8('0x78')](_0x1dba7e[_0xa3f8('0x79')]);for(var _0x5d4fe5=0x0;_0x5d4fe5<_0x452e99[_0xa3f8('0x6d')];_0x5d4fe5+=0x1){_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7a')]?_0x35d4d6[_0x452e99[_0x5d4fe5]['MetricId']]['metric']:_0x452e99[_0x5d4fe5][_0xa3f8('0x70')];_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x5d7877[_0x452e99[_0x5d4fe5][_0xa3f8('0x7b')]],'%s',_0x3d45ae):_0x3d45ae;_0x3d45ae=_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x521719[_0x452e99[_0x5d4fe5][_0xa3f8('0x7d')]],'%s',_0x3d45ae):_0x3d45ae;if(_0x452e99[_0x5d4fe5][_0xa3f8('0x7e')]){_0x3a2362['group'](_0x3d45ae);}_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]&&_0x3a2362[_0xa3f8('0x3f')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3a2362[_0xa3f8('0x70')](_0x3d45ae,_0x452e99[_0x5d4fe5][_0xa3f8('0x80')]||_0x3d45ae);}if(_0x1dba7e['joins']){_0x1dba7e[_0xa3f8('0x81')]=JSON[_0xa3f8('0x82')](_0x1dba7e[_0xa3f8('0x81')]);for(var _0x14a5b5=0x0;_0x14a5b5<_0x1dba7e[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x14a5b5+=0x1){if(_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x3478e8,_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x37')])&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x83')]&&_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')]&&_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x85')]){_0x3a2362[_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x37')]](_0x1dba7e['joins'][_0x14a5b5][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')]('%s.%s\x20=\x20%s.%s',_0x1dba7e[_0xa3f8('0x79')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x83')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5][_0xa3f8('0x84')],_0x1dba7e[_0xa3f8('0x81')][_0x14a5b5]['foreignKey']));}}}if(_0x1dba7e[_0xa3f8('0x86')]){_0x1dba7e[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1dba7e['conditions']);_0x3a2362[_0xa3f8('0x47')](_0x42e3f8(_0x1dba7e['conditions'][_0xa3f8('0x6f')]));}_0x14508d=_0x3a2362['clone']();_0x3a2362['limit'](_0x36eac9);_0x3a2362[_0xa3f8('0x20')](0x0);logger['debug'](_0xa3f8('0x87'),_0x3a2362['toString']());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3a2362[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](respondWithResult(_0x48f5a6,null))['catch'](handleError(_0x48f5a6,null));};function runReport(_0x3187e0,_0xd0d568,_0x3715ea){var _0x345089=_0xd0d568[_0xa3f8('0x31')];var _0x20ae51=0xa;var _0x190ce8=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x7dc5ec={'SUM':_0xa3f8('0x5c'),'COUNT':_0xa3f8('0x5d'),'COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2e2d99={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x599484=function(_0x24fe62){return!_[_0xa3f8('0x68')]([_0xa3f8('0x8c'),_0xa3f8('0x69'),'IS\x20EMPTY',_0xa3f8('0x6b')],_0x24fe62);};var _0x427830=function(_0x3c5091){if(!_0x3c5091||!_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')]){return'';}for(var _0x2db7dd='(',_0x12fe03=0x0;_0x12fe03<_0x3c5091[_0xa3f8('0x6c')][_0xa3f8('0x6d')];_0x12fe03+=0x1){_0x12fe03>0x0&&(_0x2db7dd+='\x20'+_0x3c5091[_0xa3f8('0x6e')]+'\x20');_0x2db7dd+=_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']?_0x427830(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03]['group']):_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x70')]+'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')]+(_0x599484(_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x8d')])?'\x20'+_0x3c5091[_0xa3f8('0x6c')][_0x12fe03][_0xa3f8('0x71')]:'');}return _0x2db7dd+')';};var _0x4bb7dd={'where':{'id':_0x3187e0['id']}},_0x2c6efe,_0x4f9513,_0x39bd5c,_0x52fcc3,_0x2d2883;_0x4bb7dd=_['merge']({},_0x4bb7dd,_0x3715ea);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x4bb7dd)[_0xa3f8('0x2b')](function(_0xe3cc6a){if(_0xe3cc6a){_0x2c6efe=_0xe3cc6a;return _0xe3cc6a['getFields']();}return null;})[_0xa3f8('0x2b')](function(_0x3d343f){if(_0x3d343f){if(!_0x3d343f[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f9513=_0x3d343f;return db['AnalyticMetric'][_0xa3f8('0x49')]({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0xbe1a54){if(_0xbe1a54){_0x39bd5c=_[_0xa3f8('0x76')](_0xbe1a54,'id');var _0x477b0a;var _0x565a10=squel[_0xa3f8('0x77')]();_0x565a10[_0xa3f8('0x78')](_0x2c6efe['table']);for(var _0x4494a5=0x0;_0x4494a5<_0x4f9513[_0xa3f8('0x6d')];_0x4494a5+=0x1){_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7a')]?_0x39bd5c[_0x4f9513[_0x4494a5]['MetricId']][_0xa3f8('0x8f')]:_0x4f9513[_0x4494a5][_0xa3f8('0x70')];_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]?_[_0xa3f8('0x7c')](_0x7dc5ec[_0x4f9513[_0x4494a5][_0xa3f8('0x7b')]],'%s',_0x477b0a):_0x477b0a;_0x477b0a=_0x4f9513[_0x4494a5][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x2e2d99[_0x4f9513[_0x4494a5]['format']],'%s',_0x477b0a):_0x477b0a;if(_0x4f9513[_0x4494a5][_0xa3f8('0x7e')]){_0x565a10[_0xa3f8('0x6f')](_0x477b0a);}_0x4f9513[_0x4494a5]['orderBy']&&_0x565a10[_0xa3f8('0x3f')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x7f')]===_0xa3f8('0x90')?![]:!![]);_0x565a10[_0xa3f8('0x70')](_0x477b0a,_0x4f9513[_0x4494a5][_0xa3f8('0x80')]||_0x477b0a);}if(_0x2c6efe[_0xa3f8('0x81')]){_0x2c6efe[_0xa3f8('0x81')]=JSON['parse'](_0x2c6efe[_0xa3f8('0x81')]);for(var _0x151bab=0x0;_0x151bab<_0x2c6efe[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x151bab+=0x1){if(_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x190ce8,_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')])&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')]&&_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable']&&_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x85')]){_0x565a10[_0x2c6efe['joins'][_0x151bab][_0xa3f8('0x37')]](_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x84')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x2c6efe[_0xa3f8('0x79')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab][_0xa3f8('0x83')],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignTable'],_0x2c6efe[_0xa3f8('0x81')][_0x151bab]['foreignKey']));}}}if(_0x2c6efe[_0xa3f8('0x86')]){_0x2c6efe[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x2c6efe['conditions']);_0x565a10['where'](_0x427830(_0x2c6efe['conditions'][_0xa3f8('0x6f')]));}_0x2d2883=_0x565a10[_0xa3f8('0x91')]();_0x565a10[_0xa3f8('0x22')](_0x20ae51);_0x565a10[_0xa3f8('0x20')](0x0);return;}})[_0xa3f8('0x2b')](function(){if(_0xd0d568[_0xa3f8('0x92')]===_0xa3f8('0x93')){return null;}var _0x18890e=_['merge'](_0xd0d568,{'name':_0xd0d568[_0xa3f8('0x94')]||_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe[_0xa3f8('0x31')],'basename':_0x345089,'savename':util['format'](_0xa3f8('0x95'),_0xd0d568[_0xa3f8('0x31')]||_0x2c6efe['name'],require(_0xa3f8('0x96'))[_0xa3f8('0x97')](0x4),_0xd0d568['output']||_0xa3f8('0x98')),'reportId':_0x2c6efe['id'],'reportType':_0xa3f8('0x99')});return db['AnalyticExtractedReport'][_0xa3f8('0x4d')](_0x18890e,{'raw':!![]});})[_0xa3f8('0x2b')](function(_0x21cc1d){if(_0x2c6efe['table']===_0xa3f8('0x9a')){_0x2d2883[_0xa3f8('0x47')](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9b'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568['endDate']);}else{_0x2d2883['where'](_0x2c6efe[_0xa3f8('0x79')]+_0xa3f8('0x9d'),_0xd0d568[_0xa3f8('0x9c')],_0xd0d568[_0xa3f8('0x9e')]);}if(_0x21cc1d){logger['info'](_0xa3f8('0x9f'),_0x2d2883[_0xa3f8('0x89')]());require(_0xa3f8('0xa0'))[_0xa3f8('0xa1')](path[_0xa3f8('0x59')](__dirname,_0xa3f8('0xa2'),_0x21cc1d[_0xa3f8('0x92')]),[_0x21cc1d['id'],_0x2d2883[_0xa3f8('0x89')](),path['join'](__dirname,_0xa3f8('0xa3'),_0x21cc1d['savename']),_0x345089]);return _0x21cc1d;}else{var _0xe9842=squel['select']();_0xe9842['from']('('+_0x2d2883[_0xa3f8('0x89')]()+')',_0xa3f8('0xa4'));_0xe9842[_0xa3f8('0x70')](_0xa3f8('0xa5'),_0xa3f8('0x23'));_0x2d2883['limit'](_0xd0d568['limit']||_0x20ae51);_0x2d2883[_0xa3f8('0x20')](_0xd0d568[_0xa3f8('0x20')]||0x0);return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0xe9842[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')]['QueryTypes'][_0xa3f8('0x8a')]})[_0xa3f8('0x2b')](function(_0x5a4f4a){if(!_0x5a4f4a['length']){_0x52fcc3=0x0;}else{_0x52fcc3=_0x5a4f4a[0x0][_0xa3f8('0x23')]||0x0;}return dbH[_0xa3f8('0x88')]['query'](_0x2d2883[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});})[_0xa3f8('0x2b')](function(_0x52f592){return{'rows':_0x52f592||[],'count':_0x52fcc3};});}});}exports[_0xa3f8('0xa7')]=function(_0x59026b,_0x234636){return runReport(_0x59026b[_0xa3f8('0x4c')],_0x59026b['query'],_0x59026b['options'])[_0xa3f8('0x2b')](respondWithResult(_0x234636,null))[_0xa3f8('0x4a')](handleError(_0x234636,null));};exports[_0xa3f8('0xa8')]=runReport;exports[_0xa3f8('0x3e')]=function(_0x26ec07,_0x2c9db8){var _0x18ab67=0xa;var _0x1f21a2=[_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),'cross_join'];var _0x15a11c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa3f8('0x5e'),'MAX':_0xa3f8('0x5f'),'MIN':_0xa3f8('0x60'),'AVG':_0xa3f8('0x61'),'GROUP_CONCAT':_0xa3f8('0x62'),'GROUP_CONCAT ASC':_0xa3f8('0x8b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x481b70={'SEC_TO_TIME':_0xa3f8('0x63'),'DATE':_0xa3f8('0x64'),'HOUR':_0xa3f8('0x65'),'ROUND':_0xa3f8('0x66'),'UNIX_TIMESTAMP':_0xa3f8('0x67')};var _0x1f776a=function(_0x5b1527){return!_['includes']([_0xa3f8('0x8c'),_0xa3f8('0x69'),_0xa3f8('0x6a'),_0xa3f8('0x6b')],_0x5b1527);};var _0x4670cc=function(_0xfde509){if(!_0xfde509||!_0xfde509['rules']['length']){return'';}for(var _0x3d81fe='(',_0x15111a=0x0;_0x15111a<_0xfde509[_0xa3f8('0x6c')]['length'];_0x15111a+=0x1){_0x15111a>0x0&&(_0x3d81fe+='\x20'+_0xfde509[_0xa3f8('0x6e')]+'\x20');_0x3d81fe+=_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']?_0x4670cc(_0xfde509[_0xa3f8('0x6c')][_0x15111a]['group']):_0xfde509[_0xa3f8('0x6c')][_0x15111a]['field']+'\x20'+_0xfde509['rules'][_0x15111a][_0xa3f8('0x8d')]+(_0x1f776a(_0xfde509[_0xa3f8('0x6c')][_0x15111a][_0xa3f8('0x8d')])?'\x20'+_0xfde509[_0xa3f8('0x6c')][_0x15111a]['value']:'');}return _0x3d81fe+')';};var _0x2e694e={'where':{'id':_0x26ec07[_0xa3f8('0x4c')]['id']}},_0x1669be,_0x4f248f,_0x6ef1ad,_0xae3a31,_0x31d45c;_0x2e694e=_[_0xa3f8('0x44')]({},_0x2e694e,_0x26ec07[_0xa3f8('0x46')]);return db[_0xa3f8('0x35')][_0xa3f8('0x53')](_0x2e694e)[_0xa3f8('0x2b')](function(_0x529021){if(_0x529021){_0x1669be=_0x529021;return _0x529021[_0xa3f8('0x72')]();}return null;})[_0xa3f8('0x2b')](function(_0x35c498){if(_0x35c498){if(!_0x35c498[_0xa3f8('0x6d')]){throw new db[(_0xa3f8('0x73'))][(_0xa3f8('0x8e'))](_0xa3f8('0x74'),0x193);}_0x4f248f=_0x35c498;return db[_0xa3f8('0x75')]['findAll']({'raw':!![]});}return null;})[_0xa3f8('0x2b')](function(_0x286490){if(_0x286490){_0x6ef1ad=_['keyBy'](_0x286490,'id');var _0x16e98d;var _0x3be5c9=squel['select']();_0x3be5c9[_0xa3f8('0x78')](_0x1669be[_0xa3f8('0x79')]);for(var _0x5260e0=0x0;_0x5260e0<_0x4f248f[_0xa3f8('0x6d')];_0x5260e0+=0x1){_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7a')]?_0x6ef1ad[_0x4f248f[_0x5260e0]['MetricId']][_0xa3f8('0x8f')]:_0x4f248f[_0x5260e0][_0xa3f8('0x70')];_0x16e98d=_0x4f248f[_0x5260e0]['function']?_['replace'](_0x15a11c[_0x4f248f[_0x5260e0][_0xa3f8('0x7b')]],'%s',_0x16e98d):_0x16e98d;_0x16e98d=_0x4f248f[_0x5260e0][_0xa3f8('0x7d')]?_[_0xa3f8('0x7c')](_0x481b70[_0x4f248f[_0x5260e0]['format']],'%s',_0x16e98d):_0x16e98d;if(_0x4f248f[_0x5260e0]['groupBy']){_0x3be5c9[_0xa3f8('0x6f')](_0x16e98d);}_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]&&_0x3be5c9['order'](_0x16e98d,_0x4f248f[_0x5260e0][_0xa3f8('0x7f')]==='DESC'?![]:!![]);_0x3be5c9[_0xa3f8('0x70')](_0x16e98d,_0x4f248f[_0x5260e0]['alias']||_0x16e98d);}if(_0x1669be[_0xa3f8('0x81')]){_0x1669be['joins']=JSON['parse'](_0x1669be[_0xa3f8('0x81')]);for(var _0x5ac693=0x0;_0x5ac693<_0x1669be[_0xa3f8('0x81')][_0xa3f8('0x6d')];_0x5ac693+=0x1){if(_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]&&_[_0xa3f8('0x68')](_0x1f21a2,_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')])&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')]&&_0x1669be['joins'][_0x5ac693][_0xa3f8('0x84')]&&_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]){_0x3be5c9[_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x37')]](_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x84')],null,util[_0xa3f8('0x7d')](_0xa3f8('0xa9'),_0x1669be[_0xa3f8('0x79')],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x83')],_0x1669be[_0xa3f8('0x81')][_0x5ac693]['foreignTable'],_0x1669be[_0xa3f8('0x81')][_0x5ac693][_0xa3f8('0x85')]));}}}if(_0x1669be[_0xa3f8('0x86')]){_0x1669be[_0xa3f8('0x86')]=JSON[_0xa3f8('0x82')](_0x1669be[_0xa3f8('0x86')]);_0x3be5c9['where'](_0x4670cc(_0x1669be[_0xa3f8('0x86')][_0xa3f8('0x6f')]));}_0x31d45c=_0x3be5c9[_0xa3f8('0x91')]();_0x3be5c9[_0xa3f8('0x22')](_0x18ab67);_0x3be5c9[_0xa3f8('0x20')](0x0);logger[_0xa3f8('0xaa')](_0xa3f8('0x87'),_0x3be5c9[_0xa3f8('0x89')]());return dbH[_0xa3f8('0x88')][_0xa3f8('0x3e')](_0x3be5c9[_0xa3f8('0x89')](),{'type':dbH[_0xa3f8('0x88')][_0xa3f8('0xa6')][_0xa3f8('0x8a')]});}})[_0xa3f8('0x2b')](function(){return{'sql':_0x31d45c[_0xa3f8('0x89')]()};})[_0xa3f8('0x2b')](respondWithResult(_0x2c9db8,null))[_0xa3f8('0x4a')](handleError(_0x2c9db8,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 1766348..53e8a9e 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 _0x0f62=['util','../../config/logger','api','moment','bluebird','rimraf','./analyticDefaultReport.attributes','analytics_default_reports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x0f62,0x160));var _0x20f6=function(_0x450cef,_0x309639){_0x450cef=_0x450cef-0x0;var _0x337f5d=_0x0f62[_0x450cef];return _0x337f5d;};'use strict';var _=require('lodash');var util=require(_0x20f6('0x0'));var logger=require(_0x20f6('0x1'))(_0x20f6('0x2'));var moment=require(_0x20f6('0x3'));var BPromise=require(_0x20f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x20f6('0x5'));var config=require('../../config/environment');var attributes=require(_0x20f6('0x6'));module['exports']=function(_0x56161f,_0x4fd2e9){return _0x56161f['define']('AnalyticDefaultReport',attributes,{'tableName':_0x20f6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0e3=['../../config/logger','api','../../config/environment','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x1b87cd,_0x57fb93){var _0x37dbc4=function(_0x4ea588){while(--_0x4ea588){_0x1b87cd['push'](_0x1b87cd['shift']());}};_0x37dbc4(++_0x57fb93);}(_0xf0e3,0x15c));var _0x3f0e=function(_0x12a4a8,_0x2310a6){_0x12a4a8=_0x12a4a8-0x0;var _0x5c2ddd=_0xf0e3[_0x12a4a8];return _0x5c2ddd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f0e('0x0'))(_0x3f0e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3f0e('0x2'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x310073,_0x330200){return _0x310073[_0x3f0e('0x3')](_0x3f0e('0x4'),attributes,{'tableName':_0x3f0e('0x5'),'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 1644216..64045c6 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 _0x46c6=['error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x59d615,_0x46a59b){var _0x4b6bd0=function(_0x37667a){while(--_0x37667a){_0x59d615['push'](_0x59d615['shift']());}};_0x4b6bd0(++_0x46a59b);}(_0x46c6,0xf6));var _0x646c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x46c6[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var util=require(_0x646c('0x0'));var moment=require(_0x646c('0x1'));var BPromise=require(_0x646c('0x2'));var rs=require(_0x646c('0x3'));var fs=require('fs');var Redis=require(_0x646c('0x4'));var db=require(_0x646c('0x5'))['db'];var utils=require(_0x646c('0x6'));var logger=require('../../config/logger')(_0x646c('0x7'));var config=require('../../config/environment');var jayson=require(_0x646c('0x8'));var client=jayson[_0x646c('0x9')][_0x646c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cf739,_0x2abcb4,_0x428af6){return new BPromise(function(_0x4c5838,_0x3e6bdc){return client[_0x646c('0xb')](_0x1cf739,_0x428af6)[_0x646c('0xc')](function(_0x38d4e7){logger[_0x646c('0xd')](_0x646c('0xe'),_0x2abcb4,_0x646c('0xf'));logger['debug'](_0x646c('0x10'),_0x2abcb4,_0x646c('0xf'),JSON[_0x646c('0x11')](_0x38d4e7));if(_0x38d4e7[_0x646c('0x12')]){if(_0x38d4e7['error'][_0x646c('0x13')]===0x1f4){logger[_0x646c('0x12')](_0x646c('0xe'),_0x2abcb4,_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);return _0x3e6bdc(_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);}logger['error'](_0x646c('0xe'),_0x2abcb4,_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);return _0x4c5838(_0x38d4e7[_0x646c('0x12')][_0x646c('0x14')]);}else{logger[_0x646c('0xd')](_0x646c('0xe'),_0x2abcb4,_0x646c('0xf'));_0x4c5838(_0x38d4e7['result'][_0x646c('0x14')]);}})[_0x646c('0x15')](function(_0x3e001c){logger['error'](_0x646c('0xe'),_0x2abcb4,_0x3e001c);_0x3e6bdc(_0x3e001c);});});} \ No newline at end of file +var _0x22cd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x22cd,0xd1));var _0xd22c=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0x22cd[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require(_0xd22c('0x0'));var util=require(_0xd22c('0x1'));var moment=require(_0xd22c('0x2'));var BPromise=require(_0xd22c('0x3'));var rs=require(_0xd22c('0x4'));var fs=require('fs');var Redis=require(_0xd22c('0x5'));var db=require(_0xd22c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd22c('0x7'));var config=require(_0xd22c('0x8'));var jayson=require(_0xd22c('0x9'));var client=jayson[_0xd22c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f79e1,_0x27bc0d,_0x567dfa){return new BPromise(function(_0x2007ab,_0x4b5ff0){return client['request'](_0x4f79e1,_0x567dfa)[_0xd22c('0xb')](function(_0xd605bd){logger['info'](_0xd22c('0xc'),_0x27bc0d,_0xd22c('0xd'));logger[_0xd22c('0xe')](_0xd22c('0xf'),_0x27bc0d,_0xd22c('0xd'),JSON[_0xd22c('0x10')](_0xd605bd));if(_0xd605bd[_0xd22c('0x11')]){if(_0xd605bd['error'][_0xd22c('0x12')]===0x1f4){logger[_0xd22c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x27bc0d,_0xd605bd[_0xd22c('0x11')]['message']);return _0x4b5ff0(_0xd605bd[_0xd22c('0x11')][_0xd22c('0x13')]);}logger['error'](_0xd22c('0xc'),_0x27bc0d,_0xd605bd[_0xd22c('0x11')][_0xd22c('0x13')]);return _0x2007ab(_0xd605bd[_0xd22c('0x11')][_0xd22c('0x13')]);}else{logger[_0xd22c('0x14')](_0xd22c('0xc'),_0x27bc0d,_0xd22c('0xd'));_0x2007ab(_0xd605bd['result'][_0xd22c('0x13')]);}})['catch'](function(_0x315aa0){logger['error'](_0xd22c('0xc'),_0x27bc0d,_0x315aa0);_0x4b5ff0(_0x315aa0);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9158371..80460c2 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 _0xef0d=['show','/:id/preview','preview','/:id/run','run','query','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id'];(function(_0x570699,_0x284d3d){var _0x5139b8=function(_0x55ae37){while(--_0x55ae37){_0x570699['push'](_0x570699['shift']());}};_0x5139b8(++_0x284d3d);}(_0xef0d,0xdc));var _0xdef0=function(_0x221dec,_0x1a8890){_0x221dec=_0x221dec-0x0;var _0x11be40=_0xef0d[_0x221dec];return _0x11be40;};'use strict';var multer=require(_0xdef0('0x0'));var util=require('util');var path=require(_0xdef0('0x1'));var timeout=require(_0xdef0('0x2'));var express=require(_0xdef0('0x3'));var router=express[_0xdef0('0x4')]();var fs_extra=require(_0xdef0('0x5'));var auth=require(_0xdef0('0x6'));var interaction=require(_0xdef0('0x7'));var config=require(_0xdef0('0x8'));var controller=require(_0xdef0('0x9'));router['get']('/',auth[_0xdef0('0xa')](),controller[_0xdef0('0xb')]);router[_0xdef0('0xc')](_0xdef0('0xd'),auth[_0xdef0('0xa')](),controller[_0xdef0('0xe')]);router[_0xdef0('0xc')](_0xdef0('0xf'),auth['isAuthenticated'](),controller[_0xdef0('0x10')]);router[_0xdef0('0xc')](_0xdef0('0x11'),auth[_0xdef0('0xa')](),controller[_0xdef0('0x12')]);router[_0xdef0('0xc')]('/:id/query',auth[_0xdef0('0xa')](),controller[_0xdef0('0x13')]);router['post']('/',auth[_0xdef0('0xa')](),controller[_0xdef0('0x14')]);router[_0xdef0('0x15')]('/:id',auth[_0xdef0('0xa')](),controller[_0xdef0('0x16')]);router[_0xdef0('0x17')](_0xdef0('0xd'),auth[_0xdef0('0xa')](),controller[_0xdef0('0x18')]);module[_0xdef0('0x19')]=router; \ No newline at end of file +var _0x801f=['Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','show','/:id/preview','isAuthenticated','/:id/run','/:id/query','query','post','create','update','delete','destroy','exports','util'];(function(_0x3a175b,_0x505d13){var _0x9b84fa=function(_0x5533e1){while(--_0x5533e1){_0x3a175b['push'](_0x3a175b['shift']());}};_0x9b84fa(++_0x505d13);}(_0x801f,0x153));var _0xf801=function(_0x38441d,_0x12e5f5){_0x38441d=_0x38441d-0x0;var _0x23c0a0=_0x801f[_0x38441d];return _0x23c0a0;};'use strict';var multer=require('multer');var util=require(_0xf801('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf801('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xf801('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf801('0x3'));var controller=require(_0xf801('0x4'));router[_0xf801('0x5')]('/',auth['isAuthenticated'](),controller[_0xf801('0x6')]);router['get'](_0xf801('0x7'),auth['isAuthenticated'](),controller[_0xf801('0x8')]);router[_0xf801('0x5')](_0xf801('0x9'),auth[_0xf801('0xa')](),controller['preview']);router[_0xf801('0x5')](_0xf801('0xb'),auth[_0xf801('0xa')](),controller['run']);router[_0xf801('0x5')](_0xf801('0xc'),auth[_0xf801('0xa')](),controller[_0xf801('0xd')]);router[_0xf801('0xe')]('/',auth[_0xf801('0xa')](),controller[_0xf801('0xf')]);router['put']('/:id',auth[_0xf801('0xa')](),controller[_0xf801('0x10')]);router[_0xf801('0x11')](_0xf801('0x7'),auth[_0xf801('0xa')](),controller[_0xf801('0x12')]);module[_0xf801('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e5ff2b9..212f8a1 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 _0xa130=['scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','manual'];(function(_0x328483,_0x474554){var _0x398216=function(_0x1fa19c){while(--_0x1fa19c){_0x328483['push'](_0x328483['shift']());}};_0x398216(++_0x474554);}(_0xa130,0xf5));var _0x0a13=function(_0x3b6e23,_0x145906){_0x3b6e23=_0x3b6e23-0x0;var _0xf0db59=_0xa130[_0x3b6e23];return _0xf0db59;};'use strict';var Sequelize=require(_0x0a13('0x0'));var moment=require(_0x0a13('0x1'));module[_0x0a13('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0a13('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0a13('0x4')](_0x0a13('0x5'),'pdf',_0x0a13('0x6')),'allowNull':![],'defaultValue':_0x0a13('0x5')},'savename':{'type':Sequelize[_0x0a13('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x0a13('0x7'),_0x0a13('0x8')),'allowNull':![],'defaultValue':_0x0a13('0x7')},'reportId':{'type':Sequelize[_0x0a13('0x9')](0xb)[_0x0a13('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x12b2=['ENUM','pdf','xlsx','STRING','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x12b2,0xca));var _0x212b=function(_0x3fa2b3,_0xdf1df5){_0x3fa2b3=_0x3fa2b3-0x0;var _0x14cf1a=_0x12b2[_0x3fa2b3];return _0x14cf1a;};'use strict';var Sequelize=require(_0x212b('0x0'));var moment=require(_0x212b('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x212b('0x2')]('csv',_0x212b('0x3'),_0x212b('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x212b('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0x212b('0x6')]},'endDate':{'type':Sequelize[_0x212b('0x6')]},'status':{'type':Sequelize[_0x212b('0x5')],'defaultValue':_0x212b('0x7')},'type':{'type':Sequelize['ENUM'](_0x212b('0x8'),_0x212b('0x9')),'allowNull':![],'defaultValue':_0x212b('0x8')},'reportId':{'type':Sequelize[_0x212b('0xa')](0xb)[_0x212b('0xb')]},'reportType':{'type':Sequelize[_0x212b('0x5')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index e33a36a..31822d4 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 _0xf900=['destroy','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','UserProfileResource','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x3feb4a,_0x537c6e){var _0x41f421=function(_0x46736b){while(--_0x46736b){_0x3feb4a['push'](_0x3feb4a['shift']());}};_0x41f421(++_0x537c6e);}(_0xf900,0x189));var _0x0f90=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xf900[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x0f90('0x0'));var rimraf=require(_0x0f90('0x1'));var zipdir=require(_0x0f90('0x2'));var jsonpatch=require(_0x0f90('0x3'));var rp=require('request-promise');var moment=require(_0x0f90('0x4'));var BPromise=require(_0x0f90('0x5'));var Mustache=require('mustache');var util=require(_0x0f90('0x6'));var path=require(_0x0f90('0x7'));var sox=require('sox');var csv=require(_0x0f90('0x8'));var ejs=require(_0x0f90('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f90('0xa'));var squel=require(_0x0f90('0xb'));var crypto=require('crypto');var jsforce=require(_0x0f90('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0f90('0x8'));var querystring=require(_0x0f90('0xd'));var Papa=require(_0x0f90('0xe'));var Redis=require(_0x0f90('0xf'));var authService=require(_0x0f90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0f90('0x11'));var hardwareService=require(_0x0f90('0x12'));var logger=require(_0x0f90('0x13'))(_0x0f90('0x14'));var utils=require(_0x0f90('0x15'));var config=require(_0x0f90('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f90('0x17'))['db'];function respondWithStatusCode(_0x48a4cc,_0xa24e6e){_0xa24e6e=_0xa24e6e||0xcc;return function(_0x290584){if(_0x290584){return _0x48a4cc[_0x0f90('0x18')](_0xa24e6e);}return _0x48a4cc[_0x0f90('0x19')](_0xa24e6e)[_0x0f90('0x1a')]();};}function respondWithResult(_0x3c5e22,_0x1c65b7){_0x1c65b7=_0x1c65b7||0xc8;return function(_0x17c01b){if(_0x17c01b){return _0x3c5e22[_0x0f90('0x19')](_0x1c65b7)[_0x0f90('0x1b')](_0x17c01b);}};}function respondWithFilteredResult(_0x1e475c,_0x162418){return function(_0x5d8539){if(_0x5d8539){var _0x25cdfe=typeof _0x162418['offset']===_0x0f90('0x1c')&&typeof _0x162418[_0x0f90('0x1d')]==='undefined';var _0x16f982=_0x5d8539[_0x0f90('0x1e')];var _0x2f9e7e=_0x25cdfe?0x0:_0x162418[_0x0f90('0x1f')];var _0x5bb3fd=_0x25cdfe?_0x5d8539[_0x0f90('0x1e')]:_0x162418[_0x0f90('0x1f')]+_0x162418[_0x0f90('0x1d')];var _0xff3020;if(_0x5bb3fd>=_0x16f982){_0x5bb3fd=_0x16f982;_0xff3020=0xc8;}else{_0xff3020=0xce;}_0x1e475c[_0x0f90('0x19')](_0xff3020);return _0x1e475c[_0x0f90('0x20')](_0x0f90('0x21'),_0x2f9e7e+'-'+_0x5bb3fd+'/'+_0x16f982)['json'](_0x5d8539);}return null;};}function patchUpdates(_0x337dab){return function(_0x3afef6){try{jsonpatch[_0x0f90('0x22')](_0x3afef6,_0x337dab,!![]);}catch(_0x40fd9b){return BPromise[_0x0f90('0x23')](_0x40fd9b);}return _0x3afef6[_0x0f90('0x24')]();};}function saveUpdates(_0x2dc3c5,_0x2bd804){return function(_0x5a74a3){if(_0x5a74a3){return _0x5a74a3[_0x0f90('0x25')](_0x2dc3c5)[_0x0f90('0x26')](function(_0x2df677){return _0x2df677;});}return null;};}function removeEntity(_0x29ccee,_0x2b4bc4){return function(_0x9fcdf3){if(_0x9fcdf3){return _0x9fcdf3['destroy']()[_0x0f90('0x26')](function(){var _0x5acbff=_0x9fcdf3[_0x0f90('0x27')]({'plain':!![]});var _0x30837c=_0x0f90('0x28');return db[_0x0f90('0x29')]['destroy']({'where':{'type':_0x30837c,'resourceId':_0x5acbff['id']}})['then'](function(){return _0x9fcdf3;});})[_0x0f90('0x26')](function(){_0x29ccee[_0x0f90('0x19')](0xcc)[_0x0f90('0x1a')]();});}};}function handleEntityNotFound(_0x2d6320,_0x140169){return function(_0x55bad0){if(!_0x55bad0){_0x2d6320[_0x0f90('0x18')](0x194);}return _0x55bad0;};}function handleError(_0x7ab9b8,_0x30b4c1){_0x30b4c1=_0x30b4c1||0x1f4;return function(_0x3f1cb0){logger[_0x0f90('0x2a')](_0x3f1cb0[_0x0f90('0x2b')]);if(_0x3f1cb0[_0x0f90('0x2c')]){delete _0x3f1cb0[_0x0f90('0x2c')];}_0x7ab9b8['status'](_0x30b4c1)[_0x0f90('0x2d')](_0x3f1cb0);};}exports['index']=function(_0x5af6c2,_0x42bcb8){var _0x596325={},_0x90f1a2={},_0x391e8e={'count':0x0,'rows':[]};var _0x3401df=_['map'](db[_0x0f90('0x2e')][_0x0f90('0x2f')],function(_0x279f32){return{'name':_0x279f32[_0x0f90('0x30')],'type':_0x279f32[_0x0f90('0x31')][_0x0f90('0x32')]};});_0x90f1a2[_0x0f90('0x33')]=_['map'](_0x3401df,_0x0f90('0x2c'));_0x90f1a2['query']=_[_0x0f90('0x34')](_0x5af6c2[_0x0f90('0x35')]);_0x90f1a2[_0x0f90('0x36')]=_[_0x0f90('0x37')](_0x90f1a2[_0x0f90('0x33')],_0x90f1a2[_0x0f90('0x35')]);_0x596325[_0x0f90('0x38')]=_[_0x0f90('0x37')](_0x90f1a2[_0x0f90('0x33')],qs['fields'](_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x39')]));_0x596325[_0x0f90('0x38')]=_0x596325[_0x0f90('0x38')][_0x0f90('0x3a')]?_0x596325[_0x0f90('0x38')]:_0x90f1a2[_0x0f90('0x33')];if(!_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x3b')](_0x0f90('0x3c'))){_0x596325['limit']=qs[_0x0f90('0x1d')](_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x1d')]);_0x596325[_0x0f90('0x1f')]=qs[_0x0f90('0x1f')](_0x5af6c2['query'][_0x0f90('0x1f')]);}_0x596325[_0x0f90('0x3d')]=qs[_0x0f90('0x3e')](_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x3e')]);_0x596325[_0x0f90('0x3f')]=qs[_0x0f90('0x36')](_['pick'](_0x5af6c2[_0x0f90('0x35')],_0x90f1a2[_0x0f90('0x36')]),_0x3401df);if(_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x40')]){_0x596325[_0x0f90('0x3f')]=_[_0x0f90('0x41')](_0x596325['where'],{'$or':_['map'](_0x3401df,function(_0x2a37ff){if(_0x2a37ff['type']!==_0x0f90('0x42')){var _0x428fa0={};_0x428fa0[_0x2a37ff[_0x0f90('0x2c')]]={'$like':'%'+_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x40')]+'%'};return _0x428fa0;}})});}_0x596325=_[_0x0f90('0x41')]({},_0x596325,_0x5af6c2[_0x0f90('0x43')]);var _0x5a6dd7={'where':_0x596325[_0x0f90('0x3f')]};return db['AnalyticExtractedReport'][_0x0f90('0x1e')](_0x5a6dd7)[_0x0f90('0x26')](function(_0x2b346e){_0x391e8e[_0x0f90('0x1e')]=_0x2b346e;if(_0x5af6c2[_0x0f90('0x35')][_0x0f90('0x44')]){_0x596325['include']=[{'all':!![]}];}return db[_0x0f90('0x2e')]['findAll'](_0x596325);})[_0x0f90('0x26')](function(_0x4b001a){_0x391e8e[_0x0f90('0x45')]=_0x4b001a;return _0x391e8e;})[_0x0f90('0x26')](respondWithFilteredResult(_0x42bcb8,_0x596325))['catch'](handleError(_0x42bcb8,null));};exports[_0x0f90('0x46')]=function(_0x3c05f8,_0x4ea748){var _0x23f919={'raw':!![],'where':{'id':_0x3c05f8[_0x0f90('0x47')]['id']}},_0x286d2f={};_0x286d2f['model']=_[_0x0f90('0x34')](db[_0x0f90('0x2e')][_0x0f90('0x2f')]);_0x286d2f[_0x0f90('0x35')]=_[_0x0f90('0x34')](_0x3c05f8['query']);_0x286d2f[_0x0f90('0x36')]=_['intersection'](_0x286d2f[_0x0f90('0x33')],_0x286d2f[_0x0f90('0x35')]);_0x23f919[_0x0f90('0x38')]=_['intersection'](_0x286d2f[_0x0f90('0x33')],qs[_0x0f90('0x39')](_0x3c05f8[_0x0f90('0x35')][_0x0f90('0x39')]));_0x23f919[_0x0f90('0x38')]=_0x23f919['attributes']['length']?_0x23f919[_0x0f90('0x38')]:_0x286d2f[_0x0f90('0x33')];if(_0x3c05f8['query'][_0x0f90('0x44')]){_0x23f919['include']=[{'all':!![]}];}_0x23f919=_[_0x0f90('0x41')]({},_0x23f919,_0x3c05f8['options']);return db[_0x0f90('0x2e')][_0x0f90('0x48')](_0x23f919)[_0x0f90('0x26')](handleEntityNotFound(_0x4ea748,null))[_0x0f90('0x26')](respondWithResult(_0x4ea748,null))[_0x0f90('0x49')](handleError(_0x4ea748,null));};exports[_0x0f90('0x4a')]=function(_0x239b95,_0x419641){return db[_0x0f90('0x2e')][_0x0f90('0x4a')](_0x239b95['body'],{})[_0x0f90('0x26')](function(_0xb20121){var _0x450d8f=_0x239b95[_0x0f90('0x4b')]['get']({'plain':!![]});if(!_0x450d8f)throw new Error(_0x0f90('0x4c'));if(_0x450d8f['role']==='user'){var _0x1f4dfd=_0xb20121[_0x0f90('0x27')]({'plain':!![]});var _0x439dbf=_0x0f90('0x28');return db[_0x0f90('0x4d')][_0x0f90('0x48')]({'where':{'name':_0x439dbf,'userProfileId':_0x450d8f[_0x0f90('0x4e')]},'raw':!![]})[_0x0f90('0x26')](function(_0x33c01a){if(_0x33c01a&&_0x33c01a[_0x0f90('0x4f')]===0x0){return db[_0x0f90('0x29')][_0x0f90('0x4a')]({'name':_0x1f4dfd[_0x0f90('0x2c')],'resourceId':_0x1f4dfd['id'],'type':_0x33c01a[_0x0f90('0x2c')],'sectionId':_0x33c01a['id']},{})[_0x0f90('0x26')](function(){return _0xb20121;});}else{return _0xb20121;}})[_0x0f90('0x49')](function(_0x5c4b66){logger['error'](_0x0f90('0x50'),_0x5c4b66);throw _0x5c4b66;});}return _0xb20121;})[_0x0f90('0x26')](respondWithResult(_0x419641,0xc9))[_0x0f90('0x49')](handleError(_0x419641,null));};exports[_0x0f90('0x25')]=function(_0x3e99bb,_0x5b9a5d){if(_0x3e99bb[_0x0f90('0x51')]['id']){delete _0x3e99bb['body']['id'];}return db['AnalyticExtractedReport'][_0x0f90('0x48')]({'where':{'id':_0x3e99bb[_0x0f90('0x47')]['id']}})[_0x0f90('0x26')](handleEntityNotFound(_0x5b9a5d,null))[_0x0f90('0x26')](saveUpdates(_0x3e99bb[_0x0f90('0x51')],null))['then'](respondWithResult(_0x5b9a5d,null))[_0x0f90('0x49')](handleError(_0x5b9a5d,null));};exports[_0x0f90('0x52')]=function(_0x3c049f,_0x170544){return db[_0x0f90('0x2e')][_0x0f90('0x48')]({'where':{'id':_0x3c049f['params']['id']}})['then'](handleEntityNotFound(_0x170544,null))['then'](removeEntity(_0x170544,null))[_0x0f90('0x49')](handleError(_0x170544,null));};exports[_0x0f90('0x53')]=function(_0x58a835,_0x2a35fe,_0x2e88c8){return db[_0x0f90('0x2e')][_0x0f90('0x48')]({'where':{'id':_0x58a835['params']['id']},'attributes':[_0x0f90('0x2c'),_0x0f90('0x54'),_0x0f90('0x55'),_0x0f90('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x2a35fe,null))[_0x0f90('0x26')](function(_0x398087){if(_0x398087){if(!fs['existsSync'](path[_0x0f90('0x57')](config[_0x0f90('0x58')],_0x0f90('0x59'),_0x398087['savename']))){throw new db[(_0x0f90('0x5a'))][(_0x0f90('0x5b'))](_0x0f90('0x5c'));}if(_0x58a835[_0x0f90('0x35')]['exists']){return _0x2a35fe['sendStatus'](0xc8);}return _0x2a35fe[_0x0f90('0x53')](path[_0x0f90('0x57')](config[_0x0f90('0x58')],_0x0f90('0x59'),_0x398087[_0x0f90('0x55')]),util[_0x0f90('0x5d')](_0x0f90('0x5e'),_0x398087[_0x0f90('0x54')]||_0x398087['name'],_0x398087['output']['toLowerCase']()));}})[_0x0f90('0x49')](handleError(_0x2a35fe,null));}; \ No newline at end of file +var _0x7075=['apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','AnalyticExtractedReport','includeAll','rows','catch','show','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set'];(function(_0x158799,_0x24658b){var _0x222f58=function(_0x837b06){while(--_0x837b06){_0x158799['push'](_0x158799['shift']());}};_0x222f58(++_0x24658b);}(_0x7075,0xa2));var _0x5707=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7075[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5707('0x0'));var zipdir=require(_0x5707('0x1'));var jsonpatch=require(_0x5707('0x2'));var rp=require(_0x5707('0x3'));var moment=require('moment');var BPromise=require(_0x5707('0x4'));var Mustache=require(_0x5707('0x5'));var util=require(_0x5707('0x6'));var path=require(_0x5707('0x7'));var sox=require(_0x5707('0x8'));var csv=require(_0x5707('0x9'));var ejs=require(_0x5707('0xa'));var fs=require('fs');var fs_extra=require(_0x5707('0xb'));var _=require(_0x5707('0xc'));var squel=require(_0x5707('0xd'));var crypto=require('crypto');var jsforce=require(_0x5707('0xe'));var deskjs=require(_0x5707('0xf'));var toCsv=require(_0x5707('0x9'));var querystring=require('querystring');var Papa=require(_0x5707('0x10'));var Redis=require(_0x5707('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5707('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5707('0x13'));var logger=require(_0x5707('0x14'))('api');var utils=require(_0x5707('0x15'));var config=require(_0x5707('0x16'));var licenseUtil=require(_0x5707('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28d97c,_0x20f616){_0x20f616=_0x20f616||0xcc;return function(_0xf4d8cc){if(_0xf4d8cc){return _0x28d97c['sendStatus'](_0x20f616);}return _0x28d97c[_0x5707('0x18')](_0x20f616)[_0x5707('0x19')]();};}function respondWithResult(_0x31775b,_0x39eab4){_0x39eab4=_0x39eab4||0xc8;return function(_0x44b120){if(_0x44b120){return _0x31775b[_0x5707('0x18')](_0x39eab4)[_0x5707('0x1a')](_0x44b120);}};}function respondWithFilteredResult(_0x4bc7a8,_0x34b664){return function(_0x302191){if(_0x302191){var _0x574c70=typeof _0x34b664[_0x5707('0x1b')]===_0x5707('0x1c')&&typeof _0x34b664[_0x5707('0x1d')]===_0x5707('0x1c');var _0x88770=_0x302191[_0x5707('0x1e')];var _0x89b83d=_0x574c70?0x0:_0x34b664[_0x5707('0x1b')];var _0x4936b9=_0x574c70?_0x302191[_0x5707('0x1e')]:_0x34b664[_0x5707('0x1b')]+_0x34b664[_0x5707('0x1d')];var _0x3845d5;if(_0x4936b9>=_0x88770){_0x4936b9=_0x88770;_0x3845d5=0xc8;}else{_0x3845d5=0xce;}_0x4bc7a8[_0x5707('0x18')](_0x3845d5);return _0x4bc7a8[_0x5707('0x1f')]('Content-Range',_0x89b83d+'-'+_0x4936b9+'/'+_0x88770)[_0x5707('0x1a')](_0x302191);}return null;};}function patchUpdates(_0x283ae2){return function(_0x14973b){try{jsonpatch[_0x5707('0x20')](_0x14973b,_0x283ae2,!![]);}catch(_0x3bdc9c){return BPromise[_0x5707('0x21')](_0x3bdc9c);}return _0x14973b[_0x5707('0x22')]();};}function saveUpdates(_0x44741c,_0x5e8459){return function(_0x1659d2){if(_0x1659d2){return _0x1659d2[_0x5707('0x23')](_0x44741c)['then'](function(_0x30bd83){return _0x30bd83;});}return null;};}function removeEntity(_0x14a188,_0x5f0e5c){return function(_0x29d6a0){if(_0x29d6a0){return _0x29d6a0[_0x5707('0x24')]()[_0x5707('0x25')](function(){var _0x54e98d=_0x29d6a0[_0x5707('0x26')]({'plain':!![]});var _0x4f1d30='ExtractedReports';return db[_0x5707('0x27')][_0x5707('0x24')]({'where':{'type':_0x4f1d30,'resourceId':_0x54e98d['id']}})[_0x5707('0x25')](function(){return _0x29d6a0;});})[_0x5707('0x25')](function(){_0x14a188['status'](0xcc)[_0x5707('0x19')]();});}};}function handleEntityNotFound(_0x3fdb38,_0x33622c){return function(_0xb67a21){if(!_0xb67a21){_0x3fdb38[_0x5707('0x28')](0x194);}return _0xb67a21;};}function handleError(_0x4b1b2e,_0x226a41){_0x226a41=_0x226a41||0x1f4;return function(_0x55ab31){logger[_0x5707('0x29')](_0x55ab31[_0x5707('0x2a')]);if(_0x55ab31[_0x5707('0x2b')]){delete _0x55ab31[_0x5707('0x2b')];}_0x4b1b2e[_0x5707('0x18')](_0x226a41)[_0x5707('0x2c')](_0x55ab31);};}exports[_0x5707('0x2d')]=function(_0x4f35e1,_0x1976fe){var _0x23bb42={},_0x59959c={},_0x2f31e9={'count':0x0,'rows':[]};var _0x49481d=_[_0x5707('0x2e')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x24dc58){return{'name':_0x24dc58['fieldName'],'type':_0x24dc58[_0x5707('0x2f')][_0x5707('0x30')]};});_0x59959c[_0x5707('0x31')]=_[_0x5707('0x2e')](_0x49481d,_0x5707('0x2b'));_0x59959c[_0x5707('0x32')]=_[_0x5707('0x33')](_0x4f35e1[_0x5707('0x32')]);_0x59959c[_0x5707('0x34')]=_['intersection'](_0x59959c[_0x5707('0x31')],_0x59959c[_0x5707('0x32')]);_0x23bb42[_0x5707('0x35')]=_[_0x5707('0x36')](_0x59959c[_0x5707('0x31')],qs[_0x5707('0x37')](_0x4f35e1[_0x5707('0x32')][_0x5707('0x37')]));_0x23bb42[_0x5707('0x35')]=_0x23bb42['attributes'][_0x5707('0x38')]?_0x23bb42[_0x5707('0x35')]:_0x59959c[_0x5707('0x31')];if(!_0x4f35e1[_0x5707('0x32')][_0x5707('0x39')](_0x5707('0x3a'))){_0x23bb42[_0x5707('0x1d')]=qs[_0x5707('0x1d')](_0x4f35e1[_0x5707('0x32')][_0x5707('0x1d')]);_0x23bb42[_0x5707('0x1b')]=qs[_0x5707('0x1b')](_0x4f35e1[_0x5707('0x32')][_0x5707('0x1b')]);}_0x23bb42[_0x5707('0x3b')]=qs[_0x5707('0x3c')](_0x4f35e1['query'][_0x5707('0x3c')]);_0x23bb42[_0x5707('0x3d')]=qs['filters'](_[_0x5707('0x3e')](_0x4f35e1[_0x5707('0x32')],_0x59959c['filters']),_0x49481d);if(_0x4f35e1[_0x5707('0x32')][_0x5707('0x3f')]){_0x23bb42[_0x5707('0x3d')]=_[_0x5707('0x40')](_0x23bb42['where'],{'$or':_[_0x5707('0x2e')](_0x49481d,function(_0x358156){if(_0x358156[_0x5707('0x2f')]!==_0x5707('0x41')){var _0x4b87aa={};_0x4b87aa[_0x358156[_0x5707('0x2b')]]={'$like':'%'+_0x4f35e1[_0x5707('0x32')][_0x5707('0x3f')]+'%'};return _0x4b87aa;}})});}_0x23bb42=_[_0x5707('0x40')]({},_0x23bb42,_0x4f35e1['options']);var _0x47bc17={'where':_0x23bb42['where']};return db[_0x5707('0x42')][_0x5707('0x1e')](_0x47bc17)[_0x5707('0x25')](function(_0x321f8c){_0x2f31e9['count']=_0x321f8c;if(_0x4f35e1[_0x5707('0x32')][_0x5707('0x43')]){_0x23bb42['include']=[{'all':!![]}];}return db[_0x5707('0x42')]['findAll'](_0x23bb42);})[_0x5707('0x25')](function(_0x300a27){_0x2f31e9[_0x5707('0x44')]=_0x300a27;return _0x2f31e9;})[_0x5707('0x25')](respondWithFilteredResult(_0x1976fe,_0x23bb42))[_0x5707('0x45')](handleError(_0x1976fe,null));};exports[_0x5707('0x46')]=function(_0x15ad11,_0x510d93){var _0x46bf02={'raw':!![],'where':{'id':_0x15ad11['params']['id']}},_0x792a57={};_0x792a57[_0x5707('0x31')]=_[_0x5707('0x33')](db['AnalyticExtractedReport']['rawAttributes']);_0x792a57[_0x5707('0x32')]=_['keys'](_0x15ad11[_0x5707('0x32')]);_0x792a57[_0x5707('0x34')]=_[_0x5707('0x36')](_0x792a57[_0x5707('0x31')],_0x792a57[_0x5707('0x32')]);_0x46bf02[_0x5707('0x35')]=_[_0x5707('0x36')](_0x792a57[_0x5707('0x31')],qs[_0x5707('0x37')](_0x15ad11[_0x5707('0x32')][_0x5707('0x37')]));_0x46bf02[_0x5707('0x35')]=_0x46bf02[_0x5707('0x35')][_0x5707('0x38')]?_0x46bf02[_0x5707('0x35')]:_0x792a57[_0x5707('0x31')];if(_0x15ad11[_0x5707('0x32')]['includeAll']){_0x46bf02[_0x5707('0x47')]=[{'all':!![]}];}_0x46bf02=_['merge']({},_0x46bf02,_0x15ad11[_0x5707('0x48')]);return db['AnalyticExtractedReport']['find'](_0x46bf02)['then'](handleEntityNotFound(_0x510d93,null))[_0x5707('0x25')](respondWithResult(_0x510d93,null))[_0x5707('0x45')](handleError(_0x510d93,null));};exports[_0x5707('0x49')]=function(_0x2839fd,_0x4f9a49){return db[_0x5707('0x42')][_0x5707('0x49')](_0x2839fd['body'],{})[_0x5707('0x25')](function(_0x6411ab){var _0x52520e=_0x2839fd[_0x5707('0x4a')][_0x5707('0x26')]({'plain':!![]});if(!_0x52520e)throw new Error(_0x5707('0x4b'));if(_0x52520e[_0x5707('0x4c')]==='user'){var _0x383d53=_0x6411ab['get']({'plain':!![]});var _0x53cab3=_0x5707('0x4d');return db[_0x5707('0x4e')][_0x5707('0x4f')]({'where':{'name':_0x53cab3,'userProfileId':_0x52520e[_0x5707('0x50')]},'raw':!![]})[_0x5707('0x25')](function(_0x255f84){if(_0x255f84&&_0x255f84[_0x5707('0x51')]===0x0){return db['UserProfileResource'][_0x5707('0x49')]({'name':_0x383d53[_0x5707('0x2b')],'resourceId':_0x383d53['id'],'type':_0x255f84['name'],'sectionId':_0x255f84['id']},{})[_0x5707('0x25')](function(){return _0x6411ab;});}else{return _0x6411ab;}})[_0x5707('0x45')](function(_0x666801){logger['error'](_0x5707('0x52'),_0x666801);throw _0x666801;});}return _0x6411ab;})[_0x5707('0x25')](respondWithResult(_0x4f9a49,0xc9))[_0x5707('0x45')](handleError(_0x4f9a49,null));};exports['update']=function(_0x99a1d5,_0x52b98c){if(_0x99a1d5[_0x5707('0x53')]['id']){delete _0x99a1d5[_0x5707('0x53')]['id'];}return db[_0x5707('0x42')][_0x5707('0x4f')]({'where':{'id':_0x99a1d5[_0x5707('0x54')]['id']}})['then'](handleEntityNotFound(_0x52b98c,null))[_0x5707('0x25')](saveUpdates(_0x99a1d5[_0x5707('0x53')],null))[_0x5707('0x25')](respondWithResult(_0x52b98c,null))[_0x5707('0x45')](handleError(_0x52b98c,null));};exports[_0x5707('0x24')]=function(_0x410c0c,_0x3d8c00){return db[_0x5707('0x42')][_0x5707('0x4f')]({'where':{'id':_0x410c0c[_0x5707('0x54')]['id']}})[_0x5707('0x25')](handleEntityNotFound(_0x3d8c00,null))[_0x5707('0x25')](removeEntity(_0x3d8c00,null))[_0x5707('0x45')](handleError(_0x3d8c00,null));};exports['download']=function(_0x276c48,_0x28f40d,_0x177309){return db[_0x5707('0x42')][_0x5707('0x4f')]({'where':{'id':_0x276c48[_0x5707('0x54')]['id']},'attributes':['name','basename',_0x5707('0x55'),_0x5707('0x56')],'raw':!![]})['then'](handleEntityNotFound(_0x28f40d,null))[_0x5707('0x25')](function(_0x2c7536){if(_0x2c7536){if(!fs[_0x5707('0x57')](path[_0x5707('0x58')](config['root'],_0x5707('0x59'),_0x2c7536[_0x5707('0x55')]))){throw new db[(_0x5707('0x5a'))][(_0x5707('0x5b'))](_0x5707('0x5c'));}if(_0x276c48['query'][_0x5707('0x5d')]){return _0x28f40d[_0x5707('0x28')](0xc8);}return _0x28f40d[_0x5707('0x5e')](path[_0x5707('0x58')](config['root'],_0x5707('0x59'),_0x2c7536[_0x5707('0x55')]),util[_0x5707('0x5f')]('%s.%s',_0x2c7536['basename']||_0x2c7536[_0x5707('0x2b')],_0x2c7536[_0x5707('0x56')][_0x5707('0x60')]()));}})[_0x5707('0x45')](handleError(_0x28f40d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 32f8421..b412c91 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 _0x03b5=['analytics_extracted_reports','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0xe11b16,_0x1a7294){var _0x59bd29=function(_0x254c4d){while(--_0x254c4d){_0xe11b16['push'](_0xe11b16['shift']());}};_0x59bd29(++_0x1a7294);}(_0x03b5,0x91));var _0x503b=function(_0x1b7c93,_0x3e6b09){_0x1b7c93=_0x1b7c93-0x0;var _0x6c434d=_0x03b5[_0x1b7c93];return _0x6c434d;};'use strict';var _=require('lodash');var util=require(_0x503b('0x0'));var logger=require(_0x503b('0x1'))('api');var moment=require(_0x503b('0x2'));var BPromise=require(_0x503b('0x3'));var rp=require(_0x503b('0x4'));var fs=require('fs');var path=require(_0x503b('0x5'));var rimraf=require(_0x503b('0x6'));var config=require(_0x503b('0x7'));var attributes=require(_0x503b('0x8'));module[_0x503b('0x9')]=function(_0x27c494,_0x45e2ed){return _0x27c494[_0x503b('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x503b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbebe=['define','analytics_extracted_reports','lodash','util','../../config/logger','moment','path','./analyticExtractedReport.attributes'];(function(_0x5e869b,_0x38982d){var _0x5e687b=function(_0x4a2d73){while(--_0x4a2d73){_0x5e869b['push'](_0x5e869b['shift']());}};_0x5e687b(++_0x38982d);}(_0xbebe,0x182));var _0xebeb=function(_0x1521f3,_0x7b1dd6){_0x1521f3=_0x1521f3-0x0;var _0x390f97=_0xbebe[_0x1521f3];return _0x390f97;};'use strict';var _=require(_0xebeb('0x0'));var util=require(_0xebeb('0x1'));var logger=require(_0xebeb('0x2'))('api');var moment=require(_0xebeb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xebeb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xebeb('0x5'));module['exports']=function(_0x3aaa1a,_0x17996f){return _0x3aaa1a[_0xebeb('0x6')]('AnalyticExtractedReport',attributes,{'tableName':_0xebeb('0x7'),'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 b9c4002..0fd4704 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 _0xd557=['../../config/utils','rpc','jayson/promise','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x24b504,_0x300231){var _0x4ebed9=function(_0x36c6e2){while(--_0x36c6e2){_0x24b504['push'](_0x24b504['shift']());}};_0x4ebed9(++_0x300231);}(_0xd557,0x18a));var _0x7d55=function(_0x2a1432,_0x3f09bb){_0x2a1432=_0x2a1432-0x0;var _0x359c02=_0xd557[_0x2a1432];return _0x359c02;};'use strict';var _=require(_0x7d55('0x0'));var util=require(_0x7d55('0x1'));var moment=require(_0x7d55('0x2'));var BPromise=require(_0x7d55('0x3'));var rs=require(_0x7d55('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d55('0x5'))['db'];var utils=require(_0x7d55('0x6'));var logger=require('../../config/logger')(_0x7d55('0x7'));var config=require('../../config/environment');var jayson=require(_0x7d55('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x353fd9,_0x556884,_0x2511e0){return new BPromise(function(_0x1487a3,_0x3e2667){return client[_0x7d55('0x9')](_0x353fd9,_0x2511e0)[_0x7d55('0xa')](function(_0xcf66b){logger[_0x7d55('0xb')](_0x7d55('0xc'),_0x556884,'request\x20sent');logger[_0x7d55('0xd')](_0x7d55('0xe'),_0x556884,'request\x20sent',JSON['stringify'](_0xcf66b));if(_0xcf66b[_0x7d55('0xf')]){if(_0xcf66b[_0x7d55('0xf')][_0x7d55('0x10')]===0x1f4){logger['error'](_0x7d55('0xc'),_0x556884,_0xcf66b[_0x7d55('0xf')][_0x7d55('0x11')]);return _0x3e2667(_0xcf66b['error'][_0x7d55('0x11')]);}logger[_0x7d55('0xf')](_0x7d55('0xc'),_0x556884,_0xcf66b[_0x7d55('0xf')][_0x7d55('0x11')]);return _0x1487a3(_0xcf66b[_0x7d55('0xf')][_0x7d55('0x11')]);}else{logger[_0x7d55('0xb')](_0x7d55('0xc'),_0x556884,'request\x20sent');_0x1487a3(_0xcf66b[_0x7d55('0x12')][_0x7d55('0x11')]);}})[_0x7d55('0x13')](function(_0x2729d8){logger['error'](_0x7d55('0xc'),_0x556884,_0x2729d8);_0x3e2667(_0x2729d8);});});} \ No newline at end of file +var _0x20fb=['../../config/environment','jayson/promise','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x508c10,_0x5a15f0){var _0x3108b5=function(_0x4bccaa){while(--_0x4bccaa){_0x508c10['push'](_0x508c10['shift']());}};_0x3108b5(++_0x5a15f0);}(_0x20fb,0x1b2));var _0xb20f=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x20fb[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0xb20f('0x0'));var util=require(_0xb20f('0x1'));var moment=require(_0xb20f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb20f('0x3'));var db=require(_0xb20f('0x4'))['db'];var utils=require(_0xb20f('0x5'));var logger=require('../../config/logger')(_0xb20f('0x6'));var config=require(_0xb20f('0x7'));var jayson=require(_0xb20f('0x8'));var client=jayson['client'][_0xb20f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3da3c6,_0x36431c,_0x2a6adf){return new BPromise(function(_0x2e5586,_0x41099a){return client[_0xb20f('0xa')](_0x3da3c6,_0x2a6adf)[_0xb20f('0xb')](function(_0x134063){logger[_0xb20f('0xc')](_0xb20f('0xd'),_0x36431c,_0xb20f('0xe'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x36431c,'request\x20sent',JSON[_0xb20f('0xf')](_0x134063));if(_0x134063[_0xb20f('0x10')]){if(_0x134063[_0xb20f('0x10')][_0xb20f('0x11')]===0x1f4){logger[_0xb20f('0x10')](_0xb20f('0xd'),_0x36431c,_0x134063[_0xb20f('0x10')][_0xb20f('0x12')]);return _0x41099a(_0x134063['error']['message']);}logger[_0xb20f('0x10')](_0xb20f('0xd'),_0x36431c,_0x134063[_0xb20f('0x10')][_0xb20f('0x12')]);return _0x2e5586(_0x134063[_0xb20f('0x10')]['message']);}else{logger[_0xb20f('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x36431c,_0xb20f('0xe'));_0x2e5586(_0x134063[_0xb20f('0x13')]['message']);}})[_0xb20f('0x14')](function(_0x3d62ba){logger[_0xb20f('0x10')](_0xb20f('0xd'),_0x36431c,_0x3d62ba);_0x41099a(_0x3d62ba);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 4b4e0eb..540583d 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 _0x22a5=['/:id','isAuthenticated','show','/:id/download','download','post','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get'];(function(_0x5d8b34,_0x413fce){var _0x5599ba=function(_0x3d43a4){while(--_0x3d43a4){_0x5d8b34['push'](_0x5d8b34['shift']());}};_0x5599ba(++_0x413fce);}(_0x22a5,0xe1));var _0x522a=function(_0x5cc67e,_0x3e5960){_0x5cc67e=_0x5cc67e-0x0;var _0x8a4199=_0x22a5[_0x5cc67e];return _0x8a4199;};'use strict';var multer=require(_0x522a('0x0'));var util=require(_0x522a('0x1'));var path=require('path');var timeout=require(_0x522a('0x2'));var express=require(_0x522a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x522a('0x4'));var interaction=require(_0x522a('0x5'));var config=require(_0x522a('0x6'));var controller=require(_0x522a('0x7'));router[_0x522a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x522a('0x8')](_0x522a('0x9'),auth[_0x522a('0xa')](),controller[_0x522a('0xb')]);router['get'](_0x522a('0xc'),auth[_0x522a('0xa')](),controller[_0x522a('0xd')]);router[_0x522a('0xe')]('/',auth[_0x522a('0xa')](),controller['create']);router['put'](_0x522a('0x9'),auth[_0x522a('0xa')](),controller['update']);router[_0x522a('0xf')](_0x522a('0x9'),auth[_0x522a('0xa')](),controller[_0x522a('0x10')]);module[_0x522a('0x11')]=router; \ No newline at end of file +var _0xac13=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id','isAuthenticated','show','/:id/download','download','post','update','destroy','exports','multer'];(function(_0x16fe1e,_0x347004){var _0xc98c84=function(_0x298138){while(--_0x298138){_0x16fe1e['push'](_0x16fe1e['shift']());}};_0xc98c84(++_0x347004);}(_0xac13,0x18b));var _0x3ac1=function(_0x73614f,_0x394381){_0x73614f=_0x73614f-0x0;var _0x233a7e=_0xac13[_0x73614f];return _0x233a7e;};'use strict';var multer=require(_0x3ac1('0x0'));var util=require(_0x3ac1('0x1'));var path=require(_0x3ac1('0x2'));var timeout=require(_0x3ac1('0x3'));var express=require(_0x3ac1('0x4'));var router=express[_0x3ac1('0x5')]();var fs_extra=require(_0x3ac1('0x6'));var auth=require(_0x3ac1('0x7'));var interaction=require(_0x3ac1('0x8'));var config=require(_0x3ac1('0x9'));var controller=require(_0x3ac1('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x3ac1('0xb')]);router[_0x3ac1('0xc')](_0x3ac1('0xd'),auth[_0x3ac1('0xe')](),controller[_0x3ac1('0xf')]);router['get'](_0x3ac1('0x10'),auth[_0x3ac1('0xe')](),controller[_0x3ac1('0x11')]);router[_0x3ac1('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3ac1('0xd'),auth['isAuthenticated'](),controller[_0x3ac1('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3ac1('0x14')]);module[_0x3ac1('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 f310be2..02c51fe 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 _0x4fd8=['sequelize','exports','STRING','BOOLEAN'];(function(_0x8d065b,_0x4c6115){var _0x1244e3=function(_0x2555ff){while(--_0x2555ff){_0x8d065b['push'](_0x8d065b['shift']());}};_0x1244e3(++_0x4c6115);}(_0x4fd8,0x104));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x84fd('0x0'));module[_0x84fd('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x84fd('0x2')]},'function':{'type':Sequelize[_0x84fd('0x2')]},'format':{'type':Sequelize[_0x84fd('0x2')]},'groupBy':{'type':Sequelize[_0x84fd('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x84fd('0x2')]},'custom':{'type':Sequelize[_0x84fd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xfbb0=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x52ab8a,_0xee034b){var _0x5d6ddc=function(_0x283fa6){while(--_0x283fa6){_0x52ab8a['push'](_0x52ab8a['shift']());}};_0x5d6ddc(++_0xee034b);}(_0xfbb0,0x80));var _0x0fbb=function(_0x44597d,_0x58264c){_0x44597d=_0x44597d-0x0;var _0x5b0b2a=_0xfbb0[_0x44597d];return _0x5b0b2a;};'use strict';var Sequelize=require(_0x0fbb('0x0'));module[_0x0fbb('0x1')]={'field':{'type':Sequelize[_0x0fbb('0x2')]},'alias':{'type':Sequelize[_0x0fbb('0x3')]},'function':{'type':Sequelize[_0x0fbb('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0fbb('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0fbb('0x3')]},'custom':{'type':Sequelize[_0x0fbb('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 1fe2d2f..b26c9d8 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 _0x5543=['addFields','findOne','sequelize','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','AnalyticFieldReport','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','options','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','bulkCreate','find','destroy','ids'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0x5543,0x147));var _0x3554=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x5543[_0x4bd06e];return _0x85ebb;};'use strict';var emlformat=require(_0x3554('0x0'));var rimraf=require(_0x3554('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3554('0x2'));var moment=require(_0x3554('0x3'));var BPromise=require(_0x3554('0x4'));var Mustache=require(_0x3554('0x5'));var util=require(_0x3554('0x6'));var path=require(_0x3554('0x7'));var sox=require(_0x3554('0x8'));var csv=require(_0x3554('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3554('0xa'));var squel=require(_0x3554('0xb'));var crypto=require(_0x3554('0xc'));var jsforce=require(_0x3554('0xd'));var deskjs=require(_0x3554('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3554('0xf'));var Papa=require('papaparse');var Redis=require(_0x3554('0x10'));var authService=require(_0x3554('0x11'));var qs=require(_0x3554('0x12'));var as=require(_0x3554('0x13'));var hardwareService=require(_0x3554('0x14'));var logger=require('../../config/logger')(_0x3554('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3554('0x16'))['db'];function respondWithStatusCode(_0x4ca6ad,_0x4f1cff){_0x4f1cff=_0x4f1cff||0xcc;return function(_0x38e587){if(_0x38e587){return _0x4ca6ad[_0x3554('0x17')](_0x4f1cff);}return _0x4ca6ad[_0x3554('0x18')](_0x4f1cff)[_0x3554('0x19')]();};}function respondWithResult(_0x1d86aa,_0x45e979){_0x45e979=_0x45e979||0xc8;return function(_0x7db94c){if(_0x7db94c){return _0x1d86aa[_0x3554('0x18')](_0x45e979)[_0x3554('0x1a')](_0x7db94c);}};}function respondWithFilteredResult(_0x5a02dd,_0x128c81){return function(_0x14db03){if(_0x14db03){var _0x4e9b58=typeof _0x128c81[_0x3554('0x1b')]===_0x3554('0x1c')&&typeof _0x128c81[_0x3554('0x1d')]===_0x3554('0x1c');var _0x3b6379=_0x14db03[_0x3554('0x1e')];var _0x5b632d=_0x4e9b58?0x0:_0x128c81[_0x3554('0x1b')];var _0xe1be12=_0x4e9b58?_0x14db03[_0x3554('0x1e')]:_0x128c81['offset']+_0x128c81[_0x3554('0x1d')];var _0x2dbf37;if(_0xe1be12>=_0x3b6379){_0xe1be12=_0x3b6379;_0x2dbf37=0xc8;}else{_0x2dbf37=0xce;}_0x5a02dd[_0x3554('0x18')](_0x2dbf37);return _0x5a02dd[_0x3554('0x1f')](_0x3554('0x20'),_0x5b632d+'-'+_0xe1be12+'/'+_0x3b6379)[_0x3554('0x1a')](_0x14db03);}return null;};}function patchUpdates(_0x179741){return function(_0xb96e6){try{jsonpatch[_0x3554('0x21')](_0xb96e6,_0x179741,!![]);}catch(_0x46a738){return BPromise[_0x3554('0x22')](_0x46a738);}return _0xb96e6[_0x3554('0x23')]();};}function saveUpdates(_0x48e88b,_0x2f197a){return function(_0x5ec2d9){if(_0x5ec2d9){return _0x5ec2d9[_0x3554('0x24')](_0x48e88b)[_0x3554('0x25')](function(_0x358a78){return _0x358a78;});}return null;};}function removeEntity(_0x1ae83c,_0x458324){return function(_0x361d52){if(_0x361d52){return _0x361d52['destroy']()[_0x3554('0x25')](function(){_0x1ae83c[_0x3554('0x18')](0xcc)[_0x3554('0x19')]();});}};}function handleEntityNotFound(_0x319288,_0xdc1180){return function(_0x448464){if(!_0x448464){_0x319288[_0x3554('0x17')](0x194);}return _0x448464;};}function handleError(_0x5a4337,_0x354b83){_0x354b83=_0x354b83||0x1f4;return function(_0x38707b){logger[_0x3554('0x26')](_0x38707b[_0x3554('0x27')]);if(_0x38707b[_0x3554('0x28')]){delete _0x38707b[_0x3554('0x28')];}_0x5a4337[_0x3554('0x18')](_0x354b83)[_0x3554('0x29')](_0x38707b);};}exports[_0x3554('0x2a')]=function(_0x4af3ad,_0x2637b2){var _0x5f3b07={},_0x51b139={},_0x28d773={'count':0x0,'rows':[]};var _0x36a8ec=_['map'](db[_0x3554('0x2b')]['rawAttributes'],function(_0x131b4b){return{'name':_0x131b4b[_0x3554('0x2c')],'type':_0x131b4b[_0x3554('0x2d')][_0x3554('0x2e')]};});_0x51b139['model']=_['map'](_0x36a8ec,_0x3554('0x28'));_0x51b139[_0x3554('0x2f')]=_[_0x3554('0x30')](_0x4af3ad[_0x3554('0x2f')]);_0x51b139['filters']=_[_0x3554('0x31')](_0x51b139[_0x3554('0x32')],_0x51b139[_0x3554('0x2f')]);_0x5f3b07[_0x3554('0x33')]=_[_0x3554('0x31')](_0x51b139[_0x3554('0x32')],qs['fields'](_0x4af3ad[_0x3554('0x2f')][_0x3554('0x34')]));_0x5f3b07[_0x3554('0x33')]=_0x5f3b07['attributes'][_0x3554('0x35')]?_0x5f3b07[_0x3554('0x33')]:_0x51b139['model'];if(!_0x4af3ad[_0x3554('0x2f')][_0x3554('0x36')](_0x3554('0x37'))){_0x5f3b07[_0x3554('0x1d')]=qs[_0x3554('0x1d')](_0x4af3ad[_0x3554('0x2f')][_0x3554('0x1d')]);_0x5f3b07['offset']=qs[_0x3554('0x1b')](_0x4af3ad[_0x3554('0x2f')][_0x3554('0x1b')]);}_0x5f3b07[_0x3554('0x38')]=qs[_0x3554('0x39')](_0x4af3ad['query']['sort']);_0x5f3b07[_0x3554('0x3a')]=qs[_0x3554('0x3b')](_[_0x3554('0x3c')](_0x4af3ad['query'],_0x51b139[_0x3554('0x3b')]),_0x36a8ec);if(_0x4af3ad[_0x3554('0x2f')][_0x3554('0x3d')]){_0x5f3b07[_0x3554('0x3a')]=_[_0x3554('0x3e')](_0x5f3b07[_0x3554('0x3a')],{'$or':_[_0x3554('0x3f')](_0x36a8ec,function(_0x4da091){if(_0x4da091[_0x3554('0x2d')]!=='VIRTUAL'){var _0x44a43a={};_0x44a43a[_0x4da091[_0x3554('0x28')]]={'$like':'%'+_0x4af3ad[_0x3554('0x2f')]['filter']+'%'};return _0x44a43a;}})});}_0x5f3b07=_[_0x3554('0x3e')]({},_0x5f3b07,_0x4af3ad[_0x3554('0x40')]);var _0x397c99={'where':_0x5f3b07['where']};return db[_0x3554('0x2b')][_0x3554('0x1e')](_0x397c99)[_0x3554('0x25')](function(_0x4413a0){_0x28d773[_0x3554('0x1e')]=_0x4413a0;if(_0x4af3ad[_0x3554('0x2f')][_0x3554('0x41')]){_0x5f3b07['include']=[{'all':!![]}];}return db[_0x3554('0x2b')][_0x3554('0x42')](_0x5f3b07);})[_0x3554('0x25')](function(_0x3bf7a9){_0x28d773[_0x3554('0x43')]=_0x3bf7a9;return _0x28d773;})[_0x3554('0x25')](respondWithFilteredResult(_0x2637b2,_0x5f3b07))[_0x3554('0x44')](handleError(_0x2637b2,null));};exports['show']=function(_0x317d57,_0x42549c){var _0x57564e={'raw':![],'where':{'id':_0x317d57[_0x3554('0x45')]['id']}},_0x31658c={};_0x31658c[_0x3554('0x32')]=_[_0x3554('0x30')](db[_0x3554('0x2b')][_0x3554('0x46')]);_0x31658c['query']=_[_0x3554('0x30')](_0x317d57[_0x3554('0x2f')]);_0x31658c['filters']=_[_0x3554('0x31')](_0x31658c[_0x3554('0x32')],_0x31658c['query']);_0x57564e[_0x3554('0x33')]=_[_0x3554('0x31')](_0x31658c[_0x3554('0x32')],qs[_0x3554('0x34')](_0x317d57[_0x3554('0x2f')][_0x3554('0x34')]));_0x57564e['attributes']=_0x57564e['attributes']['length']?_0x57564e[_0x3554('0x33')]:_0x31658c['model'];if(_0x317d57['query'][_0x3554('0x41')]){_0x57564e[_0x3554('0x47')]=[{'all':!![]}];}_0x57564e=_['merge']({},_0x57564e,_0x317d57[_0x3554('0x40')]);return db[_0x3554('0x2b')]['find'](_0x57564e)['then'](handleEntityNotFound(_0x42549c,null))['then'](respondWithResult(_0x42549c,null))[_0x3554('0x44')](handleError(_0x42549c,null));};exports['create']=function(_0xd67246,_0x26bdc3){return db[_0x3554('0x2b')][_0x3554('0x48')](_0xd67246[_0x3554('0x49')],{})[_0x3554('0x25')](respondWithResult(_0x26bdc3,0xc9))[_0x3554('0x44')](handleError(_0x26bdc3,null));};exports[_0x3554('0x4a')]=function(_0x4382f9,_0x10cc65){return db[_0x3554('0x2b')][_0x3554('0x4a')](_0x4382f9['body'],{'raw':![],'individualHooks':!![]})[_0x3554('0x25')](respondWithResult(_0x10cc65,0xc9))[_0x3554('0x44')](handleError(_0x10cc65,null));};exports[_0x3554('0x24')]=function(_0x508d52,_0x474bd5){if(_0x508d52[_0x3554('0x49')]['id']){delete _0x508d52['body']['id'];}return db[_0x3554('0x2b')][_0x3554('0x4b')]({'where':{'id':_0x508d52['params']['id']}})[_0x3554('0x25')](handleEntityNotFound(_0x474bd5,null))[_0x3554('0x25')](saveUpdates(_0x508d52['body'],null))[_0x3554('0x25')](respondWithResult(_0x474bd5,null))[_0x3554('0x44')](handleError(_0x474bd5,null));};exports[_0x3554('0x4c')]=function(_0x28d720,_0x28a05e){return db[_0x3554('0x2b')][_0x3554('0x4b')]({'where':{'id':_0x28d720['params']['id']}})[_0x3554('0x25')](handleEntityNotFound(_0x28a05e,null))['then'](removeEntity(_0x28a05e,null))[_0x3554('0x44')](handleError(_0x28a05e,null));};exports['bulkDestroy']=function(_0x955138,_0x304c0c){return db['AnalyticFieldReport'][_0x3554('0x4c')]({'where':{'id':_0x955138['query'][_0x3554('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x3554('0x25')](respondWithResult(_0x304c0c,0xcc))[_0x3554('0x44')](handleError(_0x304c0c,null));};exports[_0x3554('0x4e')]=function(_0x85df6b,_0x507b76,_0x5c5f97){return db['AnalyticCustomReport'][_0x3554('0x4f')]({'where':{'id':_0x85df6b[_0x3554('0x45')]['id']}})[_0x3554('0x25')](handleEntityNotFound(_0x507b76,null))[_0x3554('0x25')](function(_0x1de011){if(_0x1de011){return db[_0x3554('0x50')]['transaction'](function(_0x4849fb){return db[_0x3554('0x2b')][_0x3554('0x4c')]({'where':{'CustomReportId':_0x85df6b[_0x3554('0x45')]['id']},'transaction':_0x4849fb})[_0x3554('0x25')](function(_0x643eb4){var _0x3d06a6=_[_0x3554('0x3f')](_0x85df6b[_0x3554('0x49')],function(_0x42c104){delete _0x42c104['id'];_0x42c104['CustomReportId']=_0x85df6b[_0x3554('0x45')]['id'];return _0x42c104;});return db[_0x3554('0x2b')]['bulkCreate'](_0x3d06a6,{'transaction':_0x4849fb});});})[_0x3554('0x25')](function(){return db[_0x3554('0x2b')]['findAll']({'where':{'CustomReportId':_0x85df6b['params']['id']}});});}})[_0x3554('0x25')](respondWithResult(_0x507b76,null))[_0x3554('0x44')](handleError(_0x507b76,null));}; \ No newline at end of file +var _0x3532=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','rows','catch','params','find','create','bulkCreate','body','bulkDestroy','ids','addFields','findOne','sequelize','CustomReportId','findAll','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1478e6,_0x58b4ab){var _0x3643b6=function(_0x52d393){while(--_0x52d393){_0x1478e6['push'](_0x1478e6['shift']());}};_0x3643b6(++_0x58b4ab);}(_0x3532,0x1bf));var _0x2353=function(_0x40e71d,_0xde873d){_0x40e71d=_0x40e71d-0x0;var _0x30a126=_0x3532[_0x40e71d];return _0x30a126;};'use strict';var emlformat=require(_0x2353('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2353('0x1'));var jsonpatch=require(_0x2353('0x2'));var rp=require('request-promise');var moment=require(_0x2353('0x3'));var BPromise=require(_0x2353('0x4'));var Mustache=require(_0x2353('0x5'));var util=require('util');var path=require(_0x2353('0x6'));var sox=require(_0x2353('0x7'));var csv=require('to-csv');var ejs=require(_0x2353('0x8'));var fs=require('fs');var fs_extra=require(_0x2353('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2353('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2353('0xb'));var Papa=require('papaparse');var Redis=require(_0x2353('0xc'));var authService=require(_0x2353('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x2353('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2353('0xf'))(_0x2353('0x10'));var utils=require(_0x2353('0x11'));var config=require(_0x2353('0x12'));var licenseUtil=require(_0x2353('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x598cd5,_0x2e5b16){_0x2e5b16=_0x2e5b16||0xcc;return function(_0x1a310a){if(_0x1a310a){return _0x598cd5[_0x2353('0x14')](_0x2e5b16);}return _0x598cd5[_0x2353('0x15')](_0x2e5b16)[_0x2353('0x16')]();};}function respondWithResult(_0x23c9e0,_0x18c552){_0x18c552=_0x18c552||0xc8;return function(_0x30f62c){if(_0x30f62c){return _0x23c9e0[_0x2353('0x15')](_0x18c552)['json'](_0x30f62c);}};}function respondWithFilteredResult(_0xf8e235,_0x45effe){return function(_0x34a29a){if(_0x34a29a){var _0x3bfc14=typeof _0x45effe['offset']===_0x2353('0x17')&&typeof _0x45effe[_0x2353('0x18')]==='undefined';var _0x25a8f1=_0x34a29a[_0x2353('0x19')];var _0xf442a=_0x3bfc14?0x0:_0x45effe['offset'];var _0x6de7e=_0x3bfc14?_0x34a29a['count']:_0x45effe[_0x2353('0x1a')]+_0x45effe['limit'];var _0xc7bc7b;if(_0x6de7e>=_0x25a8f1){_0x6de7e=_0x25a8f1;_0xc7bc7b=0xc8;}else{_0xc7bc7b=0xce;}_0xf8e235['status'](_0xc7bc7b);return _0xf8e235[_0x2353('0x1b')](_0x2353('0x1c'),_0xf442a+'-'+_0x6de7e+'/'+_0x25a8f1)[_0x2353('0x1d')](_0x34a29a);}return null;};}function patchUpdates(_0x34ee91){return function(_0x588c4d){try{jsonpatch[_0x2353('0x1e')](_0x588c4d,_0x34ee91,!![]);}catch(_0x3f29e0){return BPromise[_0x2353('0x1f')](_0x3f29e0);}return _0x588c4d['save']();};}function saveUpdates(_0x42d45c,_0x5ae350){return function(_0x590409){if(_0x590409){return _0x590409[_0x2353('0x20')](_0x42d45c)[_0x2353('0x21')](function(_0x20ce3a){return _0x20ce3a;});}return null;};}function removeEntity(_0x61eeab,_0x287116){return function(_0x20f30b){if(_0x20f30b){return _0x20f30b[_0x2353('0x22')]()[_0x2353('0x21')](function(){_0x61eeab[_0x2353('0x15')](0xcc)[_0x2353('0x16')]();});}};}function handleEntityNotFound(_0x5e6ee0,_0x4faff1){return function(_0x221211){if(!_0x221211){_0x5e6ee0[_0x2353('0x14')](0x194);}return _0x221211;};}function handleError(_0x19b239,_0x27fabc){_0x27fabc=_0x27fabc||0x1f4;return function(_0xca9ca4){logger[_0x2353('0x23')](_0xca9ca4[_0x2353('0x24')]);if(_0xca9ca4[_0x2353('0x25')]){delete _0xca9ca4['name'];}_0x19b239[_0x2353('0x15')](_0x27fabc)[_0x2353('0x26')](_0xca9ca4);};}exports['index']=function(_0x22b98a,_0x16b1d4){var _0x2d1a71={},_0x4f5c70={},_0x272340={'count':0x0,'rows':[]};var _0x32ba9e=_[_0x2353('0x27')](db['AnalyticFieldReport'][_0x2353('0x28')],function(_0x29cb3c){return{'name':_0x29cb3c[_0x2353('0x29')],'type':_0x29cb3c['type']['key']};});_0x4f5c70[_0x2353('0x2a')]=_['map'](_0x32ba9e,_0x2353('0x25'));_0x4f5c70[_0x2353('0x2b')]=_[_0x2353('0x2c')](_0x22b98a['query']);_0x4f5c70[_0x2353('0x2d')]=_['intersection'](_0x4f5c70[_0x2353('0x2a')],_0x4f5c70[_0x2353('0x2b')]);_0x2d1a71['attributes']=_[_0x2353('0x2e')](_0x4f5c70[_0x2353('0x2a')],qs[_0x2353('0x2f')](_0x22b98a[_0x2353('0x2b')][_0x2353('0x2f')]));_0x2d1a71[_0x2353('0x30')]=_0x2d1a71[_0x2353('0x30')][_0x2353('0x31')]?_0x2d1a71[_0x2353('0x30')]:_0x4f5c70[_0x2353('0x2a')];if(!_0x22b98a[_0x2353('0x2b')][_0x2353('0x32')]('nolimit')){_0x2d1a71[_0x2353('0x18')]=qs['limit'](_0x22b98a[_0x2353('0x2b')][_0x2353('0x18')]);_0x2d1a71[_0x2353('0x1a')]=qs[_0x2353('0x1a')](_0x22b98a['query'][_0x2353('0x1a')]);}_0x2d1a71[_0x2353('0x33')]=qs[_0x2353('0x34')](_0x22b98a[_0x2353('0x2b')][_0x2353('0x34')]);_0x2d1a71[_0x2353('0x35')]=qs['filters'](_[_0x2353('0x36')](_0x22b98a[_0x2353('0x2b')],_0x4f5c70[_0x2353('0x2d')]),_0x32ba9e);if(_0x22b98a[_0x2353('0x2b')][_0x2353('0x37')]){_0x2d1a71[_0x2353('0x35')]=_[_0x2353('0x38')](_0x2d1a71[_0x2353('0x35')],{'$or':_['map'](_0x32ba9e,function(_0x59ec38){if(_0x59ec38[_0x2353('0x39')]!==_0x2353('0x3a')){var _0x3d0875={};_0x3d0875[_0x59ec38[_0x2353('0x25')]]={'$like':'%'+_0x22b98a[_0x2353('0x2b')][_0x2353('0x37')]+'%'};return _0x3d0875;}})});}_0x2d1a71=_[_0x2353('0x38')]({},_0x2d1a71,_0x22b98a[_0x2353('0x3b')]);var _0x19c4e7={'where':_0x2d1a71[_0x2353('0x35')]};return db[_0x2353('0x3c')][_0x2353('0x19')](_0x19c4e7)[_0x2353('0x21')](function(_0x573825){_0x272340['count']=_0x573825;if(_0x22b98a[_0x2353('0x2b')][_0x2353('0x3d')]){_0x2d1a71[_0x2353('0x3e')]=[{'all':!![]}];}return db[_0x2353('0x3c')]['findAll'](_0x2d1a71);})[_0x2353('0x21')](function(_0x552882){_0x272340[_0x2353('0x3f')]=_0x552882;return _0x272340;})['then'](respondWithFilteredResult(_0x16b1d4,_0x2d1a71))[_0x2353('0x40')](handleError(_0x16b1d4,null));};exports['show']=function(_0xdfed5d,_0x474f98){var _0x382735={'raw':![],'where':{'id':_0xdfed5d[_0x2353('0x41')]['id']}},_0x4138e7={};_0x4138e7[_0x2353('0x2a')]=_[_0x2353('0x2c')](db[_0x2353('0x3c')][_0x2353('0x28')]);_0x4138e7[_0x2353('0x2b')]=_['keys'](_0xdfed5d[_0x2353('0x2b')]);_0x4138e7[_0x2353('0x2d')]=_['intersection'](_0x4138e7[_0x2353('0x2a')],_0x4138e7['query']);_0x382735[_0x2353('0x30')]=_[_0x2353('0x2e')](_0x4138e7[_0x2353('0x2a')],qs[_0x2353('0x2f')](_0xdfed5d[_0x2353('0x2b')][_0x2353('0x2f')]));_0x382735['attributes']=_0x382735['attributes'][_0x2353('0x31')]?_0x382735[_0x2353('0x30')]:_0x4138e7[_0x2353('0x2a')];if(_0xdfed5d[_0x2353('0x2b')][_0x2353('0x3d')]){_0x382735[_0x2353('0x3e')]=[{'all':!![]}];}_0x382735=_[_0x2353('0x38')]({},_0x382735,_0xdfed5d[_0x2353('0x3b')]);return db['AnalyticFieldReport'][_0x2353('0x42')](_0x382735)[_0x2353('0x21')](handleEntityNotFound(_0x474f98,null))[_0x2353('0x21')](respondWithResult(_0x474f98,null))[_0x2353('0x40')](handleError(_0x474f98,null));};exports[_0x2353('0x43')]=function(_0x4948f9,_0x4f7016){return db['AnalyticFieldReport']['create'](_0x4948f9['body'],{})[_0x2353('0x21')](respondWithResult(_0x4f7016,0xc9))[_0x2353('0x40')](handleError(_0x4f7016,null));};exports[_0x2353('0x44')]=function(_0x1c3040,_0xb4bdb7){return db[_0x2353('0x3c')][_0x2353('0x44')](_0x1c3040[_0x2353('0x45')],{'raw':![],'individualHooks':!![]})[_0x2353('0x21')](respondWithResult(_0xb4bdb7,0xc9))[_0x2353('0x40')](handleError(_0xb4bdb7,null));};exports['update']=function(_0x3f09ec,_0x20f206){if(_0x3f09ec[_0x2353('0x45')]['id']){delete _0x3f09ec[_0x2353('0x45')]['id'];}return db[_0x2353('0x3c')]['find']({'where':{'id':_0x3f09ec[_0x2353('0x41')]['id']}})['then'](handleEntityNotFound(_0x20f206,null))[_0x2353('0x21')](saveUpdates(_0x3f09ec[_0x2353('0x45')],null))['then'](respondWithResult(_0x20f206,null))[_0x2353('0x40')](handleError(_0x20f206,null));};exports['destroy']=function(_0x44ec2c,_0x365fe2){return db['AnalyticFieldReport'][_0x2353('0x42')]({'where':{'id':_0x44ec2c[_0x2353('0x41')]['id']}})[_0x2353('0x21')](handleEntityNotFound(_0x365fe2,null))[_0x2353('0x21')](removeEntity(_0x365fe2,null))['catch'](handleError(_0x365fe2,null));};exports[_0x2353('0x46')]=function(_0xf456b9,_0x2350ba){return db['AnalyticFieldReport'][_0x2353('0x22')]({'where':{'id':_0xf456b9[_0x2353('0x2b')][_0x2353('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2350ba,0xcc))[_0x2353('0x40')](handleError(_0x2350ba,null));};exports[_0x2353('0x48')]=function(_0x239e5e,_0x6fd7d3,_0x4bc7af){return db['AnalyticCustomReport'][_0x2353('0x49')]({'where':{'id':_0x239e5e[_0x2353('0x41')]['id']}})[_0x2353('0x21')](handleEntityNotFound(_0x6fd7d3,null))['then'](function(_0x3f6be1){if(_0x3f6be1){return db[_0x2353('0x4a')]['transaction'](function(_0x24e8fe){return db[_0x2353('0x3c')][_0x2353('0x22')]({'where':{'CustomReportId':_0x239e5e[_0x2353('0x41')]['id']},'transaction':_0x24e8fe})[_0x2353('0x21')](function(_0x462ed9){var _0x243d5e=_[_0x2353('0x27')](_0x239e5e[_0x2353('0x45')],function(_0x394bd0){delete _0x394bd0['id'];_0x394bd0[_0x2353('0x4b')]=_0x239e5e['params']['id'];return _0x394bd0;});return db[_0x2353('0x3c')][_0x2353('0x44')](_0x243d5e,{'transaction':_0x24e8fe});});})[_0x2353('0x21')](function(){return db['AnalyticFieldReport'][_0x2353('0x4c')]({'where':{'CustomReportId':_0x239e5e[_0x2353('0x41')]['id']}});});}})['then'](respondWithResult(_0x6fd7d3,null))['catch'](handleError(_0x6fd7d3,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3a254c9..3550590 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 _0x6e14=['analytics_report_fields','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6e14,0x12d));var _0x46e1=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x6e14[_0x1ee5be];return _0x177140;};'use strict';var _=require(_0x46e1('0x0'));var util=require(_0x46e1('0x1'));var logger=require(_0x46e1('0x2'))('api');var moment=require(_0x46e1('0x3'));var BPromise=require('bluebird');var rp=require(_0x46e1('0x4'));var fs=require('fs');var path=require(_0x46e1('0x5'));var rimraf=require(_0x46e1('0x6'));var config=require(_0x46e1('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x5c0d21,_0x3e7cb7){return _0x5c0d21[_0x46e1('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x46e1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x33c3=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xd31e67,_0x6cd072){var _0x5b7768=function(_0x4c1618){while(--_0x4c1618){_0xd31e67['push'](_0xd31e67['shift']());}};_0x5b7768(++_0x6cd072);}(_0x33c3,0x13a));var _0x333c=function(_0x3bd582,_0x313894){_0x3bd582=_0x3bd582-0x0;var _0x190112=_0x33c3[_0x3bd582];return _0x190112;};'use strict';var _=require(_0x333c('0x0'));var util=require(_0x333c('0x1'));var logger=require(_0x333c('0x2'))(_0x333c('0x3'));var moment=require('moment');var BPromise=require(_0x333c('0x4'));var rp=require(_0x333c('0x5'));var fs=require('fs');var path=require(_0x333c('0x6'));var rimraf=require(_0x333c('0x7'));var config=require(_0x333c('0x8'));var attributes=require(_0x333c('0x9'));module[_0x333c('0xa')]=function(_0x20ef80,_0x519175){return _0x20ef80[_0x333c('0xb')](_0x333c('0xc'),attributes,{'tableName':_0x333c('0xd'),'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 808bf71..9b0c0dc 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 _0xe284=['jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe284,0x18d));var _0x4e28=function(_0x1e6951,_0x4d39ee){_0x1e6951=_0x1e6951-0x0;var _0x235723=_0xe284[_0x1e6951];return _0x235723;};'use strict';var _=require(_0x4e28('0x0'));var util=require(_0x4e28('0x1'));var moment=require(_0x4e28('0x2'));var BPromise=require(_0x4e28('0x3'));var rs=require(_0x4e28('0x4'));var fs=require('fs');var Redis=require(_0x4e28('0x5'));var db=require(_0x4e28('0x6'))['db'];var utils=require(_0x4e28('0x7'));var logger=require(_0x4e28('0x8'))(_0x4e28('0x9'));var config=require(_0x4e28('0xa'));var jayson=require(_0x4e28('0xb'));var client=jayson[_0x4e28('0xc')][_0x4e28('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x47424a,_0x4dcf55,_0x52308d){return new BPromise(function(_0x50da2c,_0x1b6d7f){return client[_0x4e28('0xe')](_0x47424a,_0x52308d)['then'](function(_0x198bc7){logger[_0x4e28('0xf')](_0x4e28('0x10'),_0x4dcf55,_0x4e28('0x11'));logger[_0x4e28('0x12')](_0x4e28('0x13'),_0x4dcf55,_0x4e28('0x11'),JSON['stringify'](_0x198bc7));if(_0x198bc7[_0x4e28('0x14')]){if(_0x198bc7['error']['code']===0x1f4){logger['error'](_0x4e28('0x10'),_0x4dcf55,_0x198bc7['error'][_0x4e28('0x15')]);return _0x1b6d7f(_0x198bc7['error'][_0x4e28('0x15')]);}logger['error'](_0x4e28('0x10'),_0x4dcf55,_0x198bc7[_0x4e28('0x14')][_0x4e28('0x15')]);return _0x50da2c(_0x198bc7[_0x4e28('0x14')][_0x4e28('0x15')]);}else{logger[_0x4e28('0xf')](_0x4e28('0x10'),_0x4dcf55,_0x4e28('0x11'));_0x50da2c(_0x198bc7[_0x4e28('0x16')][_0x4e28('0x15')]);}})[_0x4e28('0x17')](function(_0x2fe18c){logger[_0x4e28('0x14')](_0x4e28('0x10'),_0x4dcf55,_0x2fe18c);_0x1b6d7f(_0x2fe18c);});});} \ No newline at end of file +var _0x71d0=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4995f6,_0x5381a3){var _0x4f2e35=function(_0x2e5d01){while(--_0x2e5d01){_0x4995f6['push'](_0x4995f6['shift']());}};_0x4f2e35(++_0x5381a3);}(_0x71d0,0xcd));var _0x071d=function(_0x36f33d,_0x341049){_0x36f33d=_0x36f33d-0x0;var _0x17aad7=_0x71d0[_0x36f33d];return _0x17aad7;};'use strict';var _=require(_0x071d('0x0'));var util=require(_0x071d('0x1'));var moment=require(_0x071d('0x2'));var BPromise=require('bluebird');var rs=require(_0x071d('0x3'));var fs=require('fs');var Redis=require(_0x071d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x071d('0x5'));var logger=require(_0x071d('0x6'))(_0x071d('0x7'));var config=require(_0x071d('0x8'));var jayson=require(_0x071d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd6f8d2,_0x20418f,_0xfa168b){return new BPromise(function(_0x460d87,_0x213fee){return client[_0x071d('0xa')](_0xd6f8d2,_0xfa168b)[_0x071d('0xb')](function(_0x3c019b){logger[_0x071d('0xc')](_0x071d('0xd'),_0x20418f,_0x071d('0xe'));logger[_0x071d('0xf')](_0x071d('0x10'),_0x20418f,_0x071d('0xe'),JSON['stringify'](_0x3c019b));if(_0x3c019b[_0x071d('0x11')]){if(_0x3c019b['error']['code']===0x1f4){logger['error'](_0x071d('0xd'),_0x20418f,_0x3c019b[_0x071d('0x11')][_0x071d('0x12')]);return _0x213fee(_0x3c019b[_0x071d('0x11')][_0x071d('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x20418f,_0x3c019b[_0x071d('0x11')][_0x071d('0x12')]);return _0x460d87(_0x3c019b[_0x071d('0x11')][_0x071d('0x12')]);}else{logger[_0x071d('0xc')](_0x071d('0xd'),_0x20418f,_0x071d('0xe'));_0x460d87(_0x3c019b[_0x071d('0x13')]['message']);}})[_0x071d('0x14')](function(_0x54d25e){logger[_0x071d('0x11')](_0x071d('0xd'),_0x20418f,_0x54d25e);_0x213fee(_0x54d25e);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index b1f62f8..65e96e2 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(_0x36936d,_0x266864){var _0x2e57ba=function(_0x2ba593){while(--_0x2ba593){_0x36936d['push'](_0x36936d['shift']());}};_0x2e57ba(++_0x266864);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x3d2555,_0x3bb2ac){var _0x2a8b63=function(_0x278e33){while(--_0x278e33){_0x3d2555['push'](_0x3d2555['shift']());}};_0x2a8b63(++_0x3bb2ac);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 ebd40d6..b4f0c2f 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 _0x6324=['name','TEXT','sequelize','exports','STRING'];(function(_0x58d092,_0x36a559){var _0xe2d411=function(_0x3b3c34){while(--_0x3b3c34){_0x58d092['push'](_0x58d092['shift']());}};_0xe2d411(++_0x36a559);}(_0x6324,0x142));var _0x4632=function(_0x207d4e,_0x5158dc){_0x207d4e=_0x207d4e-0x0;var _0x24b6f4=_0x6324[_0x207d4e];return _0x24b6f4;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'name':{'type':Sequelize[_0x4632('0x2')],'allowNull':![],'unique':_0x4632('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x4632('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfc4c=['STRING','TEXT','sequelize','exports'];(function(_0x485925,_0xa0bcf1){var _0x3cb3d4=function(_0x138d9a){while(--_0x138d9a){_0x485925['push'](_0x485925['shift']());}};_0x3cb3d4(++_0xa0bcf1);}(_0xfc4c,0xca));var _0xcfc4=function(_0x1f37b1,_0xe5d581){_0x1f37b1=_0x1f37b1-0x0;var _0x3a3980=_0xfc4c[_0x1f37b1];return _0x3a3980;};'use strict';var Sequelize=require(_0xcfc4('0x0'));module[_0xcfc4('0x1')]={'name':{'type':Sequelize[_0xcfc4('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xcfc4('0x2')]},'metric':{'type':Sequelize[_0xcfc4('0x3')]},'description':{'type':Sequelize[_0xcfc4('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index cef7ed2..5fe46bc 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 _0xa41a=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Metrics','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','send','map','AnalyticMetric','type','key','model','query','keys','intersection','fields'];(function(_0x432316,_0x1ed0eb){var _0x459083=function(_0x249a29){while(--_0x249a29){_0x432316['push'](_0x432316['shift']());}};_0x459083(++_0x1ed0eb);}(_0xa41a,0x6b));var _0xaa41=function(_0x13296d,_0x5ded55){_0x13296d=_0x13296d-0x0;var _0x282e7b=_0xa41a[_0x13296d];return _0x282e7b;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){var _0x5c3074=_0x21f596['get']({'plain':!![]});var _0x16aec5='Metrics';return db['UserProfileResource'][_0xaa41('0x24')]({'where':{'type':_0x16aec5,'resourceId':_0x5c3074['id']}})['then'](function(){return _0x21f596;});})['then'](function(){_0x43a85c[_0xaa41('0x1a')](0xcc)[_0xaa41('0x1b')]();});}};}function handleEntityNotFound(_0x392214,_0x632fd2){return function(_0x3f5272){if(!_0x3f5272){_0x392214[_0xaa41('0x19')](0x194);}return _0x3f5272;};}function handleError(_0x57ef96,_0x30a174){_0x30a174=_0x30a174||0x1f4;return function(_0x1f0275){logger[_0xaa41('0x26')](_0x1f0275[_0xaa41('0x27')]);if(_0x1f0275[_0xaa41('0x28')]){delete _0x1f0275[_0xaa41('0x28')];}_0x57ef96[_0xaa41('0x1a')](_0x30a174)[_0xaa41('0x29')](_0x1f0275);};}exports['index']=function(_0x377add,_0x48b48b){var _0x5dad80={},_0x714537={},_0x1176bd={'count':0x0,'rows':[]};var _0x534a85=_[_0xaa41('0x2a')](db[_0xaa41('0x2b')]['rawAttributes'],function(_0x5022fb){return{'name':_0x5022fb['fieldName'],'type':_0x5022fb[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x714537[_0xaa41('0x2e')]=_[_0xaa41('0x2a')](_0x534a85,'name');_0x714537[_0xaa41('0x2f')]=_[_0xaa41('0x30')](_0x377add[_0xaa41('0x2f')]);_0x714537['filters']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],_0x714537[_0xaa41('0x2f')]);_0x5dad80['attributes']=_[_0xaa41('0x31')](_0x714537[_0xaa41('0x2e')],qs['fields'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x5dad80[_0xaa41('0x33')]=_0x5dad80['attributes'][_0xaa41('0x34')]?_0x5dad80['attributes']:_0x714537[_0xaa41('0x2e')];if(!_0x377add[_0xaa41('0x2f')][_0xaa41('0x35')]('nolimit')){_0x5dad80['limit']=qs['limit'](_0x377add[_0xaa41('0x2f')][_0xaa41('0x1e')]);_0x5dad80[_0xaa41('0x20')]=qs[_0xaa41('0x20')](_0x377add['query']['offset']);}_0x5dad80[_0xaa41('0x36')]=qs[_0xaa41('0x37')](_0x377add[_0xaa41('0x2f')][_0xaa41('0x37')]);_0x5dad80[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_[_0xaa41('0x3a')](_0x377add['query'],_0x714537[_0xaa41('0x39')]),_0x534a85);if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]){_0x5dad80[_0xaa41('0x38')]=_['merge'](_0x5dad80['where'],{'$or':_[_0xaa41('0x2a')](_0x534a85,function(_0x275fa3){if(_0x275fa3['type']!==_0xaa41('0x3c')){var _0x563687={};_0x563687[_0x275fa3[_0xaa41('0x28')]]={'$like':'%'+_0x377add[_0xaa41('0x2f')][_0xaa41('0x3b')]+'%'};return _0x563687;}})});}_0x5dad80=_[_0xaa41('0x3d')]({},_0x5dad80,_0x377add[_0xaa41('0x3e')]);var _0x12ba1a={'where':_0x5dad80[_0xaa41('0x38')]};return db[_0xaa41('0x2b')]['count'](_0x12ba1a)[_0xaa41('0x25')](function(_0x2abf39){_0x1176bd[_0xaa41('0x1f')]=_0x2abf39;if(_0x377add[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x5dad80[_0xaa41('0x40')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5dad80);})[_0xaa41('0x25')](function(_0x4f9086){_0x1176bd[_0xaa41('0x41')]=_0x4f9086;return _0x1176bd;})[_0xaa41('0x25')](respondWithFilteredResult(_0x48b48b,_0x5dad80))[_0xaa41('0x42')](handleError(_0x48b48b,null));};exports[_0xaa41('0x43')]=function(_0x2aac10,_0x10bf09){var _0x2db8d6={'raw':!![],'where':{'id':_0x2aac10[_0xaa41('0x44')]['id']}},_0x5ee74c={};_0x5ee74c['model']=_['keys'](db[_0xaa41('0x2b')]['rawAttributes']);_0x5ee74c['query']=_['keys'](_0x2aac10[_0xaa41('0x2f')]);_0x5ee74c['filters']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],_0x5ee74c['query']);_0x2db8d6['attributes']=_[_0xaa41('0x31')](_0x5ee74c[_0xaa41('0x2e')],qs[_0xaa41('0x32')](_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x32')]));_0x2db8d6[_0xaa41('0x33')]=_0x2db8d6[_0xaa41('0x33')][_0xaa41('0x34')]?_0x2db8d6[_0xaa41('0x33')]:_0x5ee74c['model'];if(_0x2aac10[_0xaa41('0x2f')][_0xaa41('0x3f')]){_0x2db8d6[_0xaa41('0x40')]=[{'all':!![]}];}_0x2db8d6=_[_0xaa41('0x3d')]({},_0x2db8d6,_0x2aac10[_0xaa41('0x3e')]);return db[_0xaa41('0x2b')]['find'](_0x2db8d6)[_0xaa41('0x25')](handleEntityNotFound(_0x10bf09,null))[_0xaa41('0x25')](respondWithResult(_0x10bf09,null))[_0xaa41('0x42')](handleError(_0x10bf09,null));};exports[_0xaa41('0x45')]=function(_0x57d1f6,_0x23bc61){return db['AnalyticMetric']['create'](_0x57d1f6[_0xaa41('0x46')],{})[_0xaa41('0x25')](function(_0x3e16ef){var _0x4ca114=_0x57d1f6[_0xaa41('0x47')][_0xaa41('0x48')]({'plain':!![]});if(!_0x4ca114)throw new Error(_0xaa41('0x49'));if(_0x4ca114['role']===_0xaa41('0x47')){var _0x3c4f24=_0x3e16ef[_0xaa41('0x48')]({'plain':!![]});var _0x1378f9=_0xaa41('0x4a');return db[_0xaa41('0x4b')][_0xaa41('0x4c')]({'where':{'name':_0x1378f9,'userProfileId':_0x4ca114[_0xaa41('0x4d')]},'raw':!![]})['then'](function(_0x9f0a81){if(_0x9f0a81&&_0x9f0a81['autoAssociation']===0x0){return db['UserProfileResource'][_0xaa41('0x45')]({'name':_0x3c4f24[_0xaa41('0x28')],'resourceId':_0x3c4f24['id'],'type':_0x9f0a81[_0xaa41('0x28')],'sectionId':_0x9f0a81['id']},{})[_0xaa41('0x25')](function(){return _0x3e16ef;});}else{return _0x3e16ef;}})[_0xaa41('0x42')](function(_0x288db3){logger[_0xaa41('0x26')](_0xaa41('0x4e'),_0x288db3);throw _0x288db3;});}return _0x3e16ef;})['then'](respondWithResult(_0x23bc61,0xc9))[_0xaa41('0x42')](handleError(_0x23bc61,null));};exports[_0xaa41('0x23')]=function(_0x1d518f,_0x4f9e92){if(_0x1d518f[_0xaa41('0x46')]['id']){delete _0x1d518f[_0xaa41('0x46')]['id'];}return db['AnalyticMetric'][_0xaa41('0x4c')]({'where':{'id':_0x1d518f[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x4f9e92,null))['then'](saveUpdates(_0x1d518f[_0xaa41('0x46')],null))[_0xaa41('0x25')](respondWithResult(_0x4f9e92,null))['catch'](handleError(_0x4f9e92,null));};exports['destroy']=function(_0x3745ed,_0x3cd14f){return db[_0xaa41('0x2b')]['find']({'where':{'id':_0x3745ed[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x3cd14f,null))[_0xaa41('0x25')](removeEntity(_0x3cd14f,null))[_0xaa41('0x42')](handleError(_0x3cd14f,null));}; \ No newline at end of file +var _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../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','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1cd4e6,_0x5abf26){var _0x90f2d2=function(_0x4b2f25){while(--_0x4b2f25){_0x1cd4e6['push'](_0x1cd4e6['shift']());}};_0x90f2d2(++_0x5abf26);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x2730da,_0x1098bd){_0x2730da=_0x2730da-0x0;var _0xfe9991=_0xf2ca[_0x2730da];return _0xfe9991;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 05b7800..1f966d9 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 _0x5419=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x143838,_0x59ccb8){var _0xc0f103=function(_0x368024){while(--_0x368024){_0x143838['push'](_0x143838['shift']());}};_0xc0f103(++_0x59ccb8);}(_0x5419,0x175));var _0x9541=function(_0x5dc198,_0x5389cb){_0x5dc198=_0x5dc198-0x0;var _0x4934e1=_0x5419[_0x5dc198];return _0x4934e1;};'use strict';var _=require(_0x9541('0x0'));var util=require(_0x9541('0x1'));var logger=require(_0x9541('0x2'))(_0x9541('0x3'));var moment=require(_0x9541('0x4'));var BPromise=require(_0x9541('0x5'));var rp=require(_0x9541('0x6'));var fs=require('fs');var path=require(_0x9541('0x7'));var rimraf=require(_0x9541('0x8'));var config=require(_0x9541('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x9541('0xa')]=function(_0x1f9139,_0xbdabaf){return _0x1f9139[_0x9541('0xb')](_0x9541('0xc'),attributes,{'tableName':_0x9541('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81c6=['AnalyticMetric','util','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x4c6d70,_0x195007){var _0x51f476=function(_0x282d1e){while(--_0x282d1e){_0x4c6d70['push'](_0x4c6d70['shift']());}};_0x51f476(++_0x195007);}(_0x81c6,0x1d5));var _0x681c=function(_0x27380a,_0x11b4db){_0x27380a=_0x27380a-0x0;var _0x49557d=_0x81c6[_0x27380a];return _0x49557d;};'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':'analytics_metrics','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 97c308d..d55fb7f 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 _0xd3c6=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd3c6,0xe2));var _0x6d3c=function(_0x1eddf1,_0x4f51b7){_0x1eddf1=_0x1eddf1-0x0;var _0xd0e46d=_0xd3c6[_0x1eddf1];return _0xd0e46d;};'use strict';var _=require(_0x6d3c('0x0'));var util=require('util');var moment=require(_0x6d3c('0x1'));var BPromise=require(_0x6d3c('0x2'));var rs=require(_0x6d3c('0x3'));var fs=require('fs');var Redis=require(_0x6d3c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d3c('0x5'));var logger=require(_0x6d3c('0x6'))(_0x6d3c('0x7'));var config=require(_0x6d3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d3c('0x9')][_0x6d3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e4789,_0x19bc51,_0x5a7808){return new BPromise(function(_0x2b8608,_0x583284){return client[_0x6d3c('0xb')](_0x4e4789,_0x5a7808)[_0x6d3c('0xc')](function(_0x4b4316){logger[_0x6d3c('0xd')](_0x6d3c('0xe'),_0x19bc51,_0x6d3c('0xf'));logger[_0x6d3c('0x10')](_0x6d3c('0x11'),_0x19bc51,_0x6d3c('0xf'),JSON['stringify'](_0x4b4316));if(_0x4b4316[_0x6d3c('0x12')]){if(_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x13')]===0x1f4){logger[_0x6d3c('0x12')](_0x6d3c('0xe'),_0x19bc51,_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x14')]);return _0x583284(_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x14')]);}logger[_0x6d3c('0x12')](_0x6d3c('0xe'),_0x19bc51,_0x4b4316[_0x6d3c('0x12')][_0x6d3c('0x14')]);return _0x2b8608(_0x4b4316['error'][_0x6d3c('0x14')]);}else{logger[_0x6d3c('0xd')](_0x6d3c('0xe'),_0x19bc51,_0x6d3c('0xf'));_0x2b8608(_0x4b4316[_0x6d3c('0x15')][_0x6d3c('0x14')]);}})[_0x6d3c('0x16')](function(_0xc91037){logger['error'](_0x6d3c('0xe'),_0x19bc51,_0xc91037);_0x583284(_0xc91037);});});} \ No newline at end of file +var _0x7b2d=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0xbee8ad,_0x1595fb){var _0x4665ff=function(_0x1c48fe){while(--_0x1c48fe){_0xbee8ad['push'](_0xbee8ad['shift']());}};_0x4665ff(++_0x1595fb);}(_0x7b2d,0x6e));var _0xd7b2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7b2d[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xd7b2('0x0'));var util=require(_0xd7b2('0x1'));var moment=require('moment');var BPromise=require(_0xd7b2('0x2'));var rs=require(_0xd7b2('0x3'));var fs=require('fs');var Redis=require(_0xd7b2('0x4'));var db=require(_0xd7b2('0x5'))['db'];var utils=require(_0xd7b2('0x6'));var logger=require(_0xd7b2('0x7'))('rpc');var config=require(_0xd7b2('0x8'));var jayson=require(_0xd7b2('0x9'));var client=jayson[_0xd7b2('0xa')][_0xd7b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x180b57,_0x3ddb68,_0x5e5f3f){return new BPromise(function(_0x412e8c,_0x4caaee){return client[_0xd7b2('0xc')](_0x180b57,_0x5e5f3f)[_0xd7b2('0xd')](function(_0x489344){logger[_0xd7b2('0xe')](_0xd7b2('0xf'),_0x3ddb68,'request\x20sent');logger[_0xd7b2('0x10')](_0xd7b2('0x11'),_0x3ddb68,'request\x20sent',JSON['stringify'](_0x489344));if(_0x489344[_0xd7b2('0x12')]){if(_0x489344['error'][_0xd7b2('0x13')]===0x1f4){logger[_0xd7b2('0x12')](_0xd7b2('0xf'),_0x3ddb68,_0x489344[_0xd7b2('0x12')][_0xd7b2('0x14')]);return _0x4caaee(_0x489344[_0xd7b2('0x12')][_0xd7b2('0x14')]);}logger[_0xd7b2('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3ddb68,_0x489344[_0xd7b2('0x12')][_0xd7b2('0x14')]);return _0x412e8c(_0x489344[_0xd7b2('0x12')][_0xd7b2('0x14')]);}else{logger['info'](_0xd7b2('0xf'),_0x3ddb68,_0xd7b2('0x15'));_0x412e8c(_0x489344['result']['message']);}})[_0xd7b2('0x16')](function(_0x4a1a3d){logger['error'](_0xd7b2('0xf'),_0x3ddb68,_0x4a1a3d);_0x4caaee(_0x4a1a3d);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 0a0a2d0..73e0ff0 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 _0x9c48=['exports','multer','util','path','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1f3b66,_0x4a2b08){var _0x49da97=function(_0x43d14a){while(--_0x43d14a){_0x1f3b66['push'](_0x1f3b66['shift']());}};_0x49da97(++_0x4a2b08);}(_0x9c48,0xa1));var _0x89c4=function(_0x5eda1d,_0x337454){_0x5eda1d=_0x5eda1d-0x0;var _0x1c4e09=_0x9c48[_0x5eda1d];return _0x1c4e09;};'use strict';var multer=require(_0x89c4('0x0'));var util=require(_0x89c4('0x1'));var path=require(_0x89c4('0x2'));var timeout=require('connect-timeout');var express=require(_0x89c4('0x3'));var router=express[_0x89c4('0x4')]();var fs_extra=require(_0x89c4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x89c4('0x6'));var controller=require(_0x89c4('0x7'));router['get']('/',auth[_0x89c4('0x8')](),controller[_0x89c4('0x9')]);router[_0x89c4('0xa')](_0x89c4('0xb'),auth[_0x89c4('0x8')](),controller[_0x89c4('0xc')]);router[_0x89c4('0xd')]('/',auth[_0x89c4('0x8')](),controller[_0x89c4('0xe')]);router[_0x89c4('0xf')](_0x89c4('0xb'),auth[_0x89c4('0x8')](),controller[_0x89c4('0x10')]);router[_0x89c4('0x11')](_0x89c4('0xb'),auth[_0x89c4('0x8')](),controller[_0x89c4('0x12')]);module[_0x89c4('0x13')]=router; \ No newline at end of file +var _0x0f80=['get','isAuthenticated','index','/:id','show','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x0f80,0x108));var _0x00f8=function(_0x56952b,_0x6368ce){_0x56952b=_0x56952b-0x0;var _0x18cf2f=_0x0f80[_0x56952b];return _0x18cf2f;};'use strict';var multer=require('multer');var util=require(_0x00f8('0x0'));var path=require(_0x00f8('0x1'));var timeout=require(_0x00f8('0x2'));var express=require(_0x00f8('0x3'));var router=express[_0x00f8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x00f8('0x5'));var interaction=require(_0x00f8('0x6'));var config=require(_0x00f8('0x7'));var controller=require('./analyticMetric.controller');router[_0x00f8('0x8')]('/',auth[_0x00f8('0x9')](),controller[_0x00f8('0xa')]);router[_0x00f8('0x8')](_0x00f8('0xb'),auth[_0x00f8('0x9')](),controller[_0x00f8('0xc')]);router['post']('/',auth[_0x00f8('0x9')](),controller[_0x00f8('0xd')]);router[_0x00f8('0xe')]('/:id',auth[_0x00f8('0x9')](),controller[_0x00f8('0xf')]);router[_0x00f8('0x10')](_0x00f8('0xb'),auth[_0x00f8('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 5a11636..354bd1a 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 _0x9cfd=['exports','TEXT'];(function(_0x34d981,_0x2f2c64){var _0x2a3805=function(_0x4e5906){while(--_0x4e5906){_0x34d981['push'](_0x34d981['shift']());}};_0x2a3805(++_0x2f2c64);}(_0x9cfd,0x134));var _0xd9cf=function(_0x46975e,_0x512f40){_0x46975e=_0x46975e-0x0;var _0x4feae6=_0x9cfd[_0x46975e];return _0x4feae6;};'use strict';var Sequelize=require('sequelize');module[_0xd9cf('0x0')]={'tree':{'type':Sequelize[_0xd9cf('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe7e1=['sequelize','TEXT'];(function(_0x17d70d,_0x1998ce){var _0x540290=function(_0x9c5493){while(--_0x9c5493){_0x17d70d['push'](_0x17d70d['shift']());}};_0x540290(++_0x1998ce);}(_0xe7e1,0xc6));var _0x1e7e=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xe7e1[_0x1a36a5];return _0x746243;};'use strict';var Sequelize=require(_0x1e7e('0x0'));module['exports']={'tree':{'type':Sequelize[_0x1e7e('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 3522e89..dfc60da 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 _0x876d=['keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','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','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x876d,0x67));var _0xd876=function(_0x26f50a,_0x15ad29){_0x26f50a=_0x26f50a-0x0;var _0x4bf8c3=_0x876d[_0x26f50a];return _0x4bf8c3;};'use strict';var emlformat=require(_0xd876('0x0'));var rimraf=require(_0xd876('0x1'));var zipdir=require(_0xd876('0x2'));var jsonpatch=require(_0xd876('0x3'));var rp=require(_0xd876('0x4'));var moment=require(_0xd876('0x5'));var BPromise=require(_0xd876('0x6'));var Mustache=require(_0xd876('0x7'));var util=require(_0xd876('0x8'));var path=require(_0xd876('0x9'));var sox=require(_0xd876('0xa'));var csv=require('to-csv');var ejs=require(_0xd876('0xb'));var fs=require('fs');var fs_extra=require(_0xd876('0xc'));var _=require(_0xd876('0xd'));var squel=require('squel');var crypto=require(_0xd876('0xe'));var jsforce=require(_0xd876('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd876('0x10'));var querystring=require(_0xd876('0x11'));var Papa=require(_0xd876('0x12'));var Redis=require(_0xd876('0x13'));var authService=require(_0xd876('0x14'));var qs=require(_0xd876('0x15'));var as=require(_0xd876('0x16'));var hardwareService=require(_0xd876('0x17'));var logger=require('../../config/logger')(_0xd876('0x18'));var utils=require(_0xd876('0x19'));var config=require(_0xd876('0x1a'));var licenseUtil=require(_0xd876('0x1b'));var db=require(_0xd876('0x1c'))['db'];function respondWithStatusCode(_0x4b0cd2,_0x6c9e68){_0x6c9e68=_0x6c9e68||0xcc;return function(_0x587b84){if(_0x587b84){return _0x4b0cd2[_0xd876('0x1d')](_0x6c9e68);}return _0x4b0cd2[_0xd876('0x1e')](_0x6c9e68)[_0xd876('0x1f')]();};}function respondWithResult(_0x5577d8,_0x4713c4){_0x4713c4=_0x4713c4||0xc8;return function(_0x278644){if(_0x278644){return _0x5577d8[_0xd876('0x1e')](_0x4713c4)['json'](_0x278644);}};}function respondWithFilteredResult(_0x5300c9,_0x334cdd){return function(_0x572b4d){if(_0x572b4d){var _0x4b9696=typeof _0x334cdd[_0xd876('0x20')]===_0xd876('0x21')&&typeof _0x334cdd[_0xd876('0x22')]===_0xd876('0x21');var _0x419af6=_0x572b4d[_0xd876('0x23')];var _0x54df21=_0x4b9696?0x0:_0x334cdd['offset'];var _0x16c9d0=_0x4b9696?_0x572b4d['count']:_0x334cdd['offset']+_0x334cdd['limit'];var _0x3325b8;if(_0x16c9d0>=_0x419af6){_0x16c9d0=_0x419af6;_0x3325b8=0xc8;}else{_0x3325b8=0xce;}_0x5300c9[_0xd876('0x1e')](_0x3325b8);return _0x5300c9['set'](_0xd876('0x24'),_0x54df21+'-'+_0x16c9d0+'/'+_0x419af6)[_0xd876('0x25')](_0x572b4d);}return null;};}function patchUpdates(_0x390649){return function(_0x425e04){try{jsonpatch[_0xd876('0x26')](_0x425e04,_0x390649,!![]);}catch(_0x474a99){return BPromise[_0xd876('0x27')](_0x474a99);}return _0x425e04[_0xd876('0x28')]();};}function saveUpdates(_0x2ef192,_0x97a2e2){return function(_0x5d9958){if(_0x5d9958){return _0x5d9958['update'](_0x2ef192)[_0xd876('0x29')](function(_0x499836){return _0x499836;});}return null;};}function removeEntity(_0x35aa1f,_0x4453f1){return function(_0x5c3dd2){if(_0x5c3dd2){return _0x5c3dd2[_0xd876('0x2a')]()[_0xd876('0x29')](function(){_0x35aa1f[_0xd876('0x1e')](0xcc)[_0xd876('0x1f')]();});}};}function handleEntityNotFound(_0x59b06d,_0xcd633e){return function(_0xfb7b00){if(!_0xfb7b00){_0x59b06d[_0xd876('0x1d')](0x194);}return _0xfb7b00;};}function handleError(_0x2edf5e,_0xe6fd33){_0xe6fd33=_0xe6fd33||0x1f4;return function(_0x29b3a4){logger[_0xd876('0x2b')](_0x29b3a4[_0xd876('0x2c')]);if(_0x29b3a4[_0xd876('0x2d')]){delete _0x29b3a4['name'];}_0x2edf5e[_0xd876('0x1e')](_0xe6fd33)[_0xd876('0x2e')](_0x29b3a4);};}exports[_0xd876('0x2f')]=function(_0x4f8df5,_0x26aaa9){var _0x23496d={},_0x52d99e={},_0x25ba5f={'count':0x0,'rows':[]};var _0x19be29=_[_0xd876('0x30')](db[_0xd876('0x31')]['rawAttributes'],function(_0x4f1956){return{'name':_0x4f1956[_0xd876('0x32')],'type':_0x4f1956[_0xd876('0x33')][_0xd876('0x34')]};});_0x52d99e['model']=_['map'](_0x19be29,'name');_0x52d99e['query']=_[_0xd876('0x35')](_0x4f8df5[_0xd876('0x36')]);_0x52d99e['filters']=_[_0xd876('0x37')](_0x52d99e[_0xd876('0x38')],_0x52d99e[_0xd876('0x36')]);_0x23496d['attributes']=_[_0xd876('0x37')](_0x52d99e[_0xd876('0x38')],qs['fields'](_0x4f8df5['query'][_0xd876('0x39')]));_0x23496d[_0xd876('0x3a')]=_0x23496d['attributes'][_0xd876('0x3b')]?_0x23496d['attributes']:_0x52d99e[_0xd876('0x38')];if(!_0x4f8df5[_0xd876('0x36')][_0xd876('0x3c')](_0xd876('0x3d'))){_0x23496d[_0xd876('0x22')]=qs[_0xd876('0x22')](_0x4f8df5[_0xd876('0x36')]['limit']);_0x23496d[_0xd876('0x20')]=qs['offset'](_0x4f8df5['query'][_0xd876('0x20')]);}_0x23496d['order']=qs[_0xd876('0x3e')](_0x4f8df5[_0xd876('0x36')][_0xd876('0x3e')]);_0x23496d[_0xd876('0x3f')]=qs[_0xd876('0x40')](_[_0xd876('0x41')](_0x4f8df5[_0xd876('0x36')],_0x52d99e[_0xd876('0x40')]),_0x19be29);if(_0x4f8df5[_0xd876('0x36')][_0xd876('0x42')]){_0x23496d['where']=_['merge'](_0x23496d[_0xd876('0x3f')],{'$or':_[_0xd876('0x30')](_0x19be29,function(_0x46494b){if(_0x46494b[_0xd876('0x33')]!==_0xd876('0x43')){var _0x4d705a={};_0x4d705a[_0x46494b['name']]={'$like':'%'+_0x4f8df5[_0xd876('0x36')][_0xd876('0x42')]+'%'};return _0x4d705a;}})});}_0x23496d=_[_0xd876('0x44')]({},_0x23496d,_0x4f8df5[_0xd876('0x45')]);var _0x463605={'where':_0x23496d[_0xd876('0x3f')]};return db[_0xd876('0x31')][_0xd876('0x23')](_0x463605)[_0xd876('0x29')](function(_0x22ae79){_0x25ba5f[_0xd876('0x23')]=_0x22ae79;if(_0x4f8df5[_0xd876('0x36')][_0xd876('0x46')]){_0x23496d[_0xd876('0x47')]=[{'all':!![]}];}return db[_0xd876('0x31')]['findAll'](_0x23496d);})[_0xd876('0x29')](function(_0x195cdb){_0x25ba5f['rows']=_0x195cdb;return _0x25ba5f;})[_0xd876('0x29')](respondWithFilteredResult(_0x26aaa9,_0x23496d))[_0xd876('0x48')](handleError(_0x26aaa9,null));};exports[_0xd876('0x49')]=function(_0x4a65b2,_0x5e8d40){var _0x2a588b={'raw':!![],'where':{'id':_0x4a65b2[_0xd876('0x4a')]['id']}},_0x4d89cd={};_0x4d89cd[_0xd876('0x38')]=_[_0xd876('0x35')](db[_0xd876('0x31')]['rawAttributes']);_0x4d89cd['query']=_[_0xd876('0x35')](_0x4a65b2[_0xd876('0x36')]);_0x4d89cd['filters']=_[_0xd876('0x37')](_0x4d89cd['model'],_0x4d89cd[_0xd876('0x36')]);_0x2a588b[_0xd876('0x3a')]=_[_0xd876('0x37')](_0x4d89cd[_0xd876('0x38')],qs['fields'](_0x4a65b2[_0xd876('0x36')]['fields']));_0x2a588b[_0xd876('0x3a')]=_0x2a588b[_0xd876('0x3a')][_0xd876('0x3b')]?_0x2a588b[_0xd876('0x3a')]:_0x4d89cd['model'];if(_0x4a65b2['query'][_0xd876('0x46')]){_0x2a588b['include']=[{'all':!![]}];}_0x2a588b=_['merge']({},_0x2a588b,_0x4a65b2['options']);return db[_0xd876('0x31')]['find'](_0x2a588b)[_0xd876('0x29')](handleEntityNotFound(_0x5e8d40,null))[_0xd876('0x29')](respondWithResult(_0x5e8d40,null))[_0xd876('0x48')](handleError(_0x5e8d40,null));};exports['create']=function(_0x4d48ff,_0x1e3413){return db['AnalyticTreeReport'][_0xd876('0x4b')](_0x4d48ff[_0xd876('0x4c')],{})[_0xd876('0x29')](respondWithResult(_0x1e3413,0xc9))[_0xd876('0x48')](handleError(_0x1e3413,null));};exports[_0xd876('0x4d')]=function(_0x1bdf25,_0x44bd01){if(_0x1bdf25[_0xd876('0x4c')]['id']){delete _0x1bdf25[_0xd876('0x4c')]['id'];}return db[_0xd876('0x31')]['find']({'where':{'id':_0x1bdf25[_0xd876('0x4a')]['id']}})[_0xd876('0x29')](handleEntityNotFound(_0x44bd01,null))[_0xd876('0x29')](saveUpdates(_0x1bdf25[_0xd876('0x4c')],null))[_0xd876('0x29')](respondWithResult(_0x44bd01,null))[_0xd876('0x48')](handleError(_0x44bd01,null));};exports[_0xd876('0x2a')]=function(_0x4fefd7,_0x3e9bbd){return db[_0xd876('0x31')]['find']({'where':{'id':_0x4fefd7[_0xd876('0x4a')]['id']}})[_0xd876('0x29')](handleEntityNotFound(_0x3e9bbd,null))['then'](removeEntity(_0x3e9bbd,null))['catch'](handleError(_0x3e9bbd,null));}; \ No newline at end of file +var _0x1d5a=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x363743,_0x369d16){var _0x270606=function(_0x540105){while(--_0x540105){_0x363743['push'](_0x363743['shift']());}};_0x270606(++_0x369d16);}(_0x1d5a,0x19b));var _0xa1d5=function(_0x261f8e,_0xc79b51){_0x261f8e=_0x261f8e-0x0;var _0xf215e5=_0x1d5a[_0x261f8e];return _0xf215e5;};'use strict';var emlformat=require(_0xa1d5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1d5('0x1'));var rp=require(_0xa1d5('0x2'));var moment=require(_0xa1d5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa1d5('0x4'));var util=require(_0xa1d5('0x5'));var path=require(_0xa1d5('0x6'));var sox=require(_0xa1d5('0x7'));var csv=require(_0xa1d5('0x8'));var ejs=require(_0xa1d5('0x9'));var fs=require('fs');var fs_extra=require(_0xa1d5('0xa'));var _=require(_0xa1d5('0xb'));var squel=require('squel');var crypto=require(_0xa1d5('0xc'));var jsforce=require(_0xa1d5('0xd'));var deskjs=require(_0xa1d5('0xe'));var toCsv=require(_0xa1d5('0x8'));var querystring=require(_0xa1d5('0xf'));var Papa=require(_0xa1d5('0x10'));var Redis=require(_0xa1d5('0x11'));var authService=require(_0xa1d5('0x12'));var qs=require(_0xa1d5('0x13'));var as=require(_0xa1d5('0x14'));var hardwareService=require(_0xa1d5('0x15'));var logger=require('../../config/logger')(_0xa1d5('0x16'));var utils=require(_0xa1d5('0x17'));var config=require(_0xa1d5('0x18'));var licenseUtil=require(_0xa1d5('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bf31d,_0x9e30e6){_0x9e30e6=_0x9e30e6||0xcc;return function(_0x2739b4){if(_0x2739b4){return _0x5bf31d[_0xa1d5('0x1a')](_0x9e30e6);}return _0x5bf31d['status'](_0x9e30e6)[_0xa1d5('0x1b')]();};}function respondWithResult(_0x16cf7c,_0x3e709b){_0x3e709b=_0x3e709b||0xc8;return function(_0x420bb3){if(_0x420bb3){return _0x16cf7c['status'](_0x3e709b)['json'](_0x420bb3);}};}function respondWithFilteredResult(_0x48db48,_0x16dbf6){return function(_0x234ba9){if(_0x234ba9){var _0x1bec41=typeof _0x16dbf6[_0xa1d5('0x1c')]===_0xa1d5('0x1d')&&typeof _0x16dbf6['limit']===_0xa1d5('0x1d');var _0x2e7d65=_0x234ba9[_0xa1d5('0x1e')];var _0x2f65a4=_0x1bec41?0x0:_0x16dbf6['offset'];var _0x58f2ea=_0x1bec41?_0x234ba9[_0xa1d5('0x1e')]:_0x16dbf6[_0xa1d5('0x1c')]+_0x16dbf6[_0xa1d5('0x1f')];var _0x41d2e8;if(_0x58f2ea>=_0x2e7d65){_0x58f2ea=_0x2e7d65;_0x41d2e8=0xc8;}else{_0x41d2e8=0xce;}_0x48db48[_0xa1d5('0x20')](_0x41d2e8);return _0x48db48[_0xa1d5('0x21')](_0xa1d5('0x22'),_0x2f65a4+'-'+_0x58f2ea+'/'+_0x2e7d65)[_0xa1d5('0x23')](_0x234ba9);}return null;};}function patchUpdates(_0x4756e5){return function(_0x3862c6){try{jsonpatch[_0xa1d5('0x24')](_0x3862c6,_0x4756e5,!![]);}catch(_0x548a3b){return BPromise[_0xa1d5('0x25')](_0x548a3b);}return _0x3862c6['save']();};}function saveUpdates(_0x2ba309,_0x163e29){return function(_0x5d2bfe){if(_0x5d2bfe){return _0x5d2bfe[_0xa1d5('0x26')](_0x2ba309)[_0xa1d5('0x27')](function(_0x489f55){return _0x489f55;});}return null;};}function removeEntity(_0x223f5a,_0x4978d4){return function(_0x5cbbb6){if(_0x5cbbb6){return _0x5cbbb6['destroy']()[_0xa1d5('0x27')](function(){_0x223f5a[_0xa1d5('0x20')](0xcc)[_0xa1d5('0x1b')]();});}};}function handleEntityNotFound(_0x81a258,_0x1da3c4){return function(_0x53372f){if(!_0x53372f){_0x81a258[_0xa1d5('0x1a')](0x194);}return _0x53372f;};}function handleError(_0x315cb7,_0xe2131f){_0xe2131f=_0xe2131f||0x1f4;return function(_0x1106a2){logger[_0xa1d5('0x28')](_0x1106a2[_0xa1d5('0x29')]);if(_0x1106a2[_0xa1d5('0x2a')]){delete _0x1106a2[_0xa1d5('0x2a')];}_0x315cb7[_0xa1d5('0x20')](_0xe2131f)[_0xa1d5('0x2b')](_0x1106a2);};}exports[_0xa1d5('0x2c')]=function(_0x4488b4,_0x3b896d){var _0x436cf8={},_0x15f203={},_0x4b1a8d={'count':0x0,'rows':[]};var _0x273707=_[_0xa1d5('0x2d')](db[_0xa1d5('0x2e')][_0xa1d5('0x2f')],function(_0x2e63ce){return{'name':_0x2e63ce['fieldName'],'type':_0x2e63ce[_0xa1d5('0x30')][_0xa1d5('0x31')]};});_0x15f203['model']=_['map'](_0x273707,_0xa1d5('0x2a'));_0x15f203[_0xa1d5('0x32')]=_[_0xa1d5('0x33')](_0x4488b4[_0xa1d5('0x32')]);_0x15f203[_0xa1d5('0x34')]=_[_0xa1d5('0x35')](_0x15f203[_0xa1d5('0x36')],_0x15f203['query']);_0x436cf8[_0xa1d5('0x37')]=_[_0xa1d5('0x35')](_0x15f203[_0xa1d5('0x36')],qs[_0xa1d5('0x38')](_0x4488b4[_0xa1d5('0x32')]['fields']));_0x436cf8[_0xa1d5('0x37')]=_0x436cf8[_0xa1d5('0x37')][_0xa1d5('0x39')]?_0x436cf8['attributes']:_0x15f203[_0xa1d5('0x36')];if(!_0x4488b4[_0xa1d5('0x32')][_0xa1d5('0x3a')](_0xa1d5('0x3b'))){_0x436cf8[_0xa1d5('0x1f')]=qs[_0xa1d5('0x1f')](_0x4488b4['query']['limit']);_0x436cf8['offset']=qs[_0xa1d5('0x1c')](_0x4488b4['query'][_0xa1d5('0x1c')]);}_0x436cf8[_0xa1d5('0x3c')]=qs[_0xa1d5('0x3d')](_0x4488b4[_0xa1d5('0x32')][_0xa1d5('0x3d')]);_0x436cf8[_0xa1d5('0x3e')]=qs[_0xa1d5('0x34')](_[_0xa1d5('0x3f')](_0x4488b4[_0xa1d5('0x32')],_0x15f203[_0xa1d5('0x34')]),_0x273707);if(_0x4488b4[_0xa1d5('0x32')][_0xa1d5('0x40')]){_0x436cf8['where']=_[_0xa1d5('0x41')](_0x436cf8['where'],{'$or':_[_0xa1d5('0x2d')](_0x273707,function(_0x1fdb5b){if(_0x1fdb5b[_0xa1d5('0x30')]!==_0xa1d5('0x42')){var _0x3e77e5={};_0x3e77e5[_0x1fdb5b[_0xa1d5('0x2a')]]={'$like':'%'+_0x4488b4['query'][_0xa1d5('0x40')]+'%'};return _0x3e77e5;}})});}_0x436cf8=_[_0xa1d5('0x41')]({},_0x436cf8,_0x4488b4['options']);var _0x5a6eda={'where':_0x436cf8[_0xa1d5('0x3e')]};return db[_0xa1d5('0x2e')][_0xa1d5('0x1e')](_0x5a6eda)[_0xa1d5('0x27')](function(_0x425eab){_0x4b1a8d[_0xa1d5('0x1e')]=_0x425eab;if(_0x4488b4['query']['includeAll']){_0x436cf8[_0xa1d5('0x43')]=[{'all':!![]}];}return db[_0xa1d5('0x2e')][_0xa1d5('0x44')](_0x436cf8);})[_0xa1d5('0x27')](function(_0x48ba5b){_0x4b1a8d[_0xa1d5('0x45')]=_0x48ba5b;return _0x4b1a8d;})['then'](respondWithFilteredResult(_0x3b896d,_0x436cf8))[_0xa1d5('0x46')](handleError(_0x3b896d,null));};exports[_0xa1d5('0x47')]=function(_0x65c0ff,_0x5d2e38){var _0x755efd={'raw':!![],'where':{'id':_0x65c0ff[_0xa1d5('0x48')]['id']}},_0x55053e={};_0x55053e['model']=_[_0xa1d5('0x33')](db['AnalyticTreeReport'][_0xa1d5('0x2f')]);_0x55053e['query']=_[_0xa1d5('0x33')](_0x65c0ff[_0xa1d5('0x32')]);_0x55053e[_0xa1d5('0x34')]=_[_0xa1d5('0x35')](_0x55053e[_0xa1d5('0x36')],_0x55053e[_0xa1d5('0x32')]);_0x755efd['attributes']=_[_0xa1d5('0x35')](_0x55053e[_0xa1d5('0x36')],qs[_0xa1d5('0x38')](_0x65c0ff['query']['fields']));_0x755efd['attributes']=_0x755efd[_0xa1d5('0x37')][_0xa1d5('0x39')]?_0x755efd[_0xa1d5('0x37')]:_0x55053e[_0xa1d5('0x36')];if(_0x65c0ff['query'][_0xa1d5('0x49')]){_0x755efd[_0xa1d5('0x43')]=[{'all':!![]}];}_0x755efd=_['merge']({},_0x755efd,_0x65c0ff['options']);return db[_0xa1d5('0x2e')][_0xa1d5('0x4a')](_0x755efd)[_0xa1d5('0x27')](handleEntityNotFound(_0x5d2e38,null))['then'](respondWithResult(_0x5d2e38,null))['catch'](handleError(_0x5d2e38,null));};exports[_0xa1d5('0x4b')]=function(_0x17a5af,_0x12aa92){return db['AnalyticTreeReport'][_0xa1d5('0x4b')](_0x17a5af[_0xa1d5('0x4c')],{})[_0xa1d5('0x27')](respondWithResult(_0x12aa92,0xc9))[_0xa1d5('0x46')](handleError(_0x12aa92,null));};exports[_0xa1d5('0x26')]=function(_0x2c35d9,_0x29221f){if(_0x2c35d9['body']['id']){delete _0x2c35d9[_0xa1d5('0x4c')]['id'];}return db[_0xa1d5('0x2e')][_0xa1d5('0x4a')]({'where':{'id':_0x2c35d9['params']['id']}})[_0xa1d5('0x27')](handleEntityNotFound(_0x29221f,null))[_0xa1d5('0x27')](saveUpdates(_0x2c35d9[_0xa1d5('0x4c')],null))[_0xa1d5('0x27')](respondWithResult(_0x29221f,null))[_0xa1d5('0x46')](handleError(_0x29221f,null));};exports[_0xa1d5('0x4d')]=function(_0x2acfec,_0x495a08){return db[_0xa1d5('0x2e')][_0xa1d5('0x4a')]({'where':{'id':_0x2acfec[_0xa1d5('0x48')]['id']}})['then'](handleEntityNotFound(_0x495a08,null))[_0xa1d5('0x27')](removeEntity(_0x495a08,null))[_0xa1d5('0x46')](handleError(_0x495a08,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index a503fd5..0318863 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 _0x117f=['rimraf','../../config/environment','./analyticTreeReport.attributes','define','analytics_report_trees','lodash','util','api','bluebird','path'];(function(_0x4400bf,_0x3dae8a){var _0x5aa062=function(_0x114528){while(--_0x114528){_0x4400bf['push'](_0x4400bf['shift']());}};_0x5aa062(++_0x3dae8a);}(_0x117f,0x131));var _0xf117=function(_0x7030b9,_0x31be49){_0x7030b9=_0x7030b9-0x0;var _0x5e2765=_0x117f[_0x7030b9];return _0x5e2765;};'use strict';var _=require(_0xf117('0x0'));var util=require(_0xf117('0x1'));var logger=require('../../config/logger')(_0xf117('0x2'));var moment=require('moment');var BPromise=require(_0xf117('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf117('0x4'));var rimraf=require(_0xf117('0x5'));var config=require(_0xf117('0x6'));var attributes=require(_0xf117('0x7'));module['exports']=function(_0x4d21f1,_0xb2d912){return _0x4d21f1[_0xf117('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xf117('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47d8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0x47d8,0xa8));var _0x847d=function(_0xcb11e,_0x208dae){_0xcb11e=_0xcb11e-0x0;var _0x94ca31=_0x47d8[_0xcb11e];return _0x94ca31;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x847d('0x0'));var moment=require(_0x847d('0x1'));var BPromise=require(_0x847d('0x2'));var rp=require(_0x847d('0x3'));var fs=require('fs');var path=require(_0x847d('0x4'));var rimraf=require(_0x847d('0x5'));var config=require(_0x847d('0x6'));var attributes=require(_0x847d('0x7'));module[_0x847d('0x8')]=function(_0x405682,_0x3188cd){return _0x405682[_0x847d('0x9')](_0x847d('0xa'),attributes,{'tableName':_0x847d('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 693a4bb..f93654d 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x30392d,_0x4045fd){var _0x24e4be=function(_0x567956){while(--_0x567956){_0x30392d['push'](_0x30392d['shift']());}};_0x24e4be(++_0x4045fd);}(_0xdb28,0x106));var _0x8db2=function(_0x8d27dc,_0x30ba92){_0x8d27dc=_0x8d27dc-0x0;var _0xef9f86=_0xdb28[_0x8d27dc];return _0xef9f86;};'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')]('AnalyticTreeReport,\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 _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(_0x9a5a79,_0x446bc9){var _0x4c682=function(_0x22249a){while(--_0x22249a){_0x9a5a79['push'](_0x9a5a79['shift']());}};_0x4c682(++_0x446bc9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index b29ddc4..d01a6b9 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 _0x1f92=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','exports','multer'];(function(_0xb60a95,_0xdb478f){var _0x2c876c=function(_0x234c62){while(--_0x234c62){_0xb60a95['push'](_0xb60a95['shift']());}};_0x2c876c(++_0xdb478f);}(_0x1f92,0xfb));var _0x21f9=function(_0x4e74dd,_0x32f425){_0x4e74dd=_0x4e74dd-0x0;var _0x1b22f0=_0x1f92[_0x4e74dd];return _0x1b22f0;};'use strict';var multer=require(_0x21f9('0x0'));var util=require(_0x21f9('0x1'));var path=require(_0x21f9('0x2'));var timeout=require('connect-timeout');var express=require(_0x21f9('0x3'));var router=express[_0x21f9('0x4')]();var fs_extra=require(_0x21f9('0x5'));var auth=require(_0x21f9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x21f9('0x7'));var controller=require(_0x21f9('0x8'));router[_0x21f9('0x9')]('/',auth[_0x21f9('0xa')](),controller[_0x21f9('0xb')]);router[_0x21f9('0x9')](_0x21f9('0xc'),auth[_0x21f9('0xa')](),controller[_0x21f9('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x21f9('0xe')]);router[_0x21f9('0xf')]('/:id',auth[_0x21f9('0xa')](),controller[_0x21f9('0x10')]);router['delete']('/:id',auth[_0x21f9('0xa')](),controller['destroy']);module[_0x21f9('0x11')]=router; \ No newline at end of file +var _0xf199=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x1486e5,_0x39684f){var _0x29d89b=function(_0x4a0a80){while(--_0x4a0a80){_0x1486e5['push'](_0x1486e5['shift']());}};_0x29d89b(++_0x39684f);}(_0xf199,0x136));var _0x9f19=function(_0x2aeffd,_0x5e0ce5){_0x2aeffd=_0x2aeffd-0x0;var _0x5ae8bb=_0xf199[_0x2aeffd];return _0x5ae8bb;};'use strict';var multer=require(_0x9f19('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9f19('0x1'));var express=require(_0x9f19('0x2'));var router=express[_0x9f19('0x3')]();var fs_extra=require(_0x9f19('0x4'));var auth=require(_0x9f19('0x5'));var interaction=require(_0x9f19('0x6'));var config=require(_0x9f19('0x7'));var controller=require(_0x9f19('0x8'));router[_0x9f19('0x9')]('/',auth[_0x9f19('0xa')](),controller[_0x9f19('0xb')]);router[_0x9f19('0x9')](_0x9f19('0xc'),auth[_0x9f19('0xa')](),controller[_0x9f19('0xd')]);router[_0x9f19('0xe')]('/',auth[_0x9f19('0xa')](),controller['create']);router[_0x9f19('0xf')](_0x9f19('0xc'),auth['isAuthenticated'](),controller[_0x9f19('0x10')]);router[_0x9f19('0x11')](_0x9f19('0xc'),auth['isAuthenticated'](),controller[_0x9f19('0x12')]);module[_0x9f19('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 00ff31e..84a32d3 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 _0x6c4b=['sequelize','exports','STRING'];(function(_0xe8b9c7,_0x534838){var _0x4b606f=function(_0x355178){while(--_0x355178){_0xe8b9c7['push'](_0xe8b9c7['shift']());}};_0x4b606f(++_0x534838);}(_0x6c4b,0x93));var _0xb6c4=function(_0x412dd8,_0x355780){_0x412dd8=_0x412dd8-0x0;var _0x47b96=_0x6c4b[_0x412dd8];return _0x47b96;};'use strict';var Sequelize=require(_0xb6c4('0x0'));module[_0xb6c4('0x1')]={'name':{'type':Sequelize[_0xb6c4('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb6c4('0x2')]}}; \ No newline at end of file +var _0xc524=['STRING'];(function(_0x50e5a7,_0x2ffa5f){var _0xaaf20d=function(_0x5d626d){while(--_0x5d626d){_0x50e5a7['push'](_0x50e5a7['shift']());}};_0xaaf20d(++_0x2ffa5f);}(_0xc524,0x1bf));var _0x4c52=function(_0x5cbec8,_0x21434b){_0x5cbec8=_0x5cbec8-0x0;var _0x1bca8e=_0xc524[_0x5cbec8];return _0x1bca8e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4c52('0x0')]},'basename':{'type':Sequelize[_0x4c52('0x0')]},'type':{'type':Sequelize[_0x4c52('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 346157d..bd81768 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 _0x84ef=['get','omit','createdAt','updatedAt','body','create','originalname','basename','file','filename','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Attachment','includeAll','findAll','rows','catch','params','keys','fields','include','rawAttributes'];(function(_0x19d1fc,_0x283cae){var _0x4194a1=function(_0x36b266){while(--_0x36b266){_0x19d1fc['push'](_0x19d1fc['shift']());}};_0x4194a1(++_0x283cae);}(_0x84ef,0xbb));var _0xf84e=function(_0x46ed5a,_0x540a37){_0x46ed5a=_0x46ed5a-0x0;var _0x35ab60=_0x84ef[_0x46ed5a];return _0x35ab60;};'use strict';var emlformat=require(_0xf84e('0x0'));var rimraf=require(_0xf84e('0x1'));var zipdir=require(_0xf84e('0x2'));var jsonpatch=require(_0xf84e('0x3'));var rp=require(_0xf84e('0x4'));var moment=require(_0xf84e('0x5'));var BPromise=require(_0xf84e('0x6'));var Mustache=require(_0xf84e('0x7'));var util=require('util');var path=require(_0xf84e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf84e('0x9'));var squel=require(_0xf84e('0xa'));var crypto=require(_0xf84e('0xb'));var jsforce=require(_0xf84e('0xc'));var deskjs=require(_0xf84e('0xd'));var toCsv=require(_0xf84e('0xe'));var querystring=require('querystring');var Papa=require(_0xf84e('0xf'));var Redis=require(_0xf84e('0x10'));var authService=require(_0xf84e('0x11'));var qs=require(_0xf84e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf84e('0x13'))('api');var utils=require(_0xf84e('0x14'));var config=require(_0xf84e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf84e('0x16'))['db'];function respondWithStatusCode(_0x577645,_0x4b39a4){_0x4b39a4=_0x4b39a4||0xcc;return function(_0x39ea40){if(_0x39ea40){return _0x577645[_0xf84e('0x17')](_0x4b39a4);}return _0x577645[_0xf84e('0x18')](_0x4b39a4)[_0xf84e('0x19')]();};}function respondWithResult(_0x23e307,_0x2e27da){_0x2e27da=_0x2e27da||0xc8;return function(_0x80c77c){if(_0x80c77c){return _0x23e307[_0xf84e('0x18')](_0x2e27da)[_0xf84e('0x1a')](_0x80c77c);}};}function respondWithFilteredResult(_0xb76228,_0x3a20ec){return function(_0x4cac83){if(_0x4cac83){var _0x4bb21d=typeof _0x3a20ec[_0xf84e('0x1b')]===_0xf84e('0x1c')&&typeof _0x3a20ec[_0xf84e('0x1d')]===_0xf84e('0x1c');var _0x478f8c=_0x4cac83[_0xf84e('0x1e')];var _0x46431d=_0x4bb21d?0x0:_0x3a20ec[_0xf84e('0x1b')];var _0xd5c31=_0x4bb21d?_0x4cac83[_0xf84e('0x1e')]:_0x3a20ec['offset']+_0x3a20ec[_0xf84e('0x1d')];var _0x4b5106;if(_0xd5c31>=_0x478f8c){_0xd5c31=_0x478f8c;_0x4b5106=0xc8;}else{_0x4b5106=0xce;}_0xb76228[_0xf84e('0x18')](_0x4b5106);return _0xb76228[_0xf84e('0x1f')]('Content-Range',_0x46431d+'-'+_0xd5c31+'/'+_0x478f8c)[_0xf84e('0x1a')](_0x4cac83);}return null;};}function patchUpdates(_0x2aae96){return function(_0x1274cf){try{jsonpatch[_0xf84e('0x20')](_0x1274cf,_0x2aae96,!![]);}catch(_0x359bf5){return BPromise[_0xf84e('0x21')](_0x359bf5);}return _0x1274cf[_0xf84e('0x22')]();};}function saveUpdates(_0x756703,_0x4e118b){return function(_0x57320c){if(_0x57320c){return _0x57320c[_0xf84e('0x23')](_0x756703)[_0xf84e('0x24')](function(_0x1afd24){return _0x1afd24;});}return null;};}function removeEntity(_0x3f0b9d,_0x2e9446){return function(_0x5c8c2e){if(_0x5c8c2e){return _0x5c8c2e['destroy']()[_0xf84e('0x24')](function(){_0x3f0b9d[_0xf84e('0x18')](0xcc)[_0xf84e('0x19')]();});}};}function handleEntityNotFound(_0xb4e5be,_0x28eddf){return function(_0x38cea4){if(!_0x38cea4){_0xb4e5be[_0xf84e('0x17')](0x194);}return _0x38cea4;};}function handleError(_0x1fd885,_0x273a99){_0x273a99=_0x273a99||0x1f4;return function(_0x4b0c1d){logger[_0xf84e('0x25')](_0x4b0c1d[_0xf84e('0x26')]);if(_0x4b0c1d[_0xf84e('0x27')]){delete _0x4b0c1d['name'];}_0x1fd885[_0xf84e('0x18')](_0x273a99)[_0xf84e('0x28')](_0x4b0c1d);};}exports[_0xf84e('0x29')]=function(_0x24ab0d,_0x318a17){var _0x5b58d5={},_0x56d58d={},_0x229a86={'count':0x0,'rows':[]};var _0x550666=_[_0xf84e('0x2a')](db['Attachment']['rawAttributes'],function(_0x55a1d9){return{'name':_0x55a1d9[_0xf84e('0x2b')],'type':_0x55a1d9[_0xf84e('0x2c')][_0xf84e('0x2d')]};});_0x56d58d[_0xf84e('0x2e')]=_[_0xf84e('0x2a')](_0x550666,_0xf84e('0x27'));_0x56d58d[_0xf84e('0x2f')]=_['keys'](_0x24ab0d[_0xf84e('0x2f')]);_0x56d58d[_0xf84e('0x30')]=_[_0xf84e('0x31')](_0x56d58d[_0xf84e('0x2e')],_0x56d58d[_0xf84e('0x2f')]);_0x5b58d5[_0xf84e('0x32')]=_[_0xf84e('0x31')](_0x56d58d[_0xf84e('0x2e')],qs['fields'](_0x24ab0d[_0xf84e('0x2f')]['fields']));_0x5b58d5['attributes']=_0x5b58d5[_0xf84e('0x32')][_0xf84e('0x33')]?_0x5b58d5[_0xf84e('0x32')]:_0x56d58d['model'];if(!_0x24ab0d['query'][_0xf84e('0x34')](_0xf84e('0x35'))){_0x5b58d5[_0xf84e('0x1d')]=qs[_0xf84e('0x1d')](_0x24ab0d[_0xf84e('0x2f')]['limit']);_0x5b58d5[_0xf84e('0x1b')]=qs[_0xf84e('0x1b')](_0x24ab0d[_0xf84e('0x2f')][_0xf84e('0x1b')]);}_0x5b58d5[_0xf84e('0x36')]=qs[_0xf84e('0x37')](_0x24ab0d[_0xf84e('0x2f')][_0xf84e('0x37')]);_0x5b58d5[_0xf84e('0x38')]=qs[_0xf84e('0x30')](_[_0xf84e('0x39')](_0x24ab0d[_0xf84e('0x2f')],_0x56d58d['filters']),_0x550666);if(_0x24ab0d[_0xf84e('0x2f')][_0xf84e('0x3a')]){_0x5b58d5[_0xf84e('0x38')]=_[_0xf84e('0x3b')](_0x5b58d5[_0xf84e('0x38')],{'$or':_[_0xf84e('0x2a')](_0x550666,function(_0x57433a){if(_0x57433a[_0xf84e('0x2c')]!=='VIRTUAL'){var _0x1ebb52={};_0x1ebb52[_0x57433a[_0xf84e('0x27')]]={'$like':'%'+_0x24ab0d[_0xf84e('0x2f')]['filter']+'%'};return _0x1ebb52;}})});}_0x5b58d5=_[_0xf84e('0x3b')]({},_0x5b58d5,_0x24ab0d[_0xf84e('0x3c')]);var _0x3ffecd={'where':_0x5b58d5[_0xf84e('0x38')]};return db[_0xf84e('0x3d')]['count'](_0x3ffecd)[_0xf84e('0x24')](function(_0x52270b){_0x229a86[_0xf84e('0x1e')]=_0x52270b;if(_0x24ab0d['query'][_0xf84e('0x3e')]){_0x5b58d5['include']=[{'all':!![]}];}return db['Attachment'][_0xf84e('0x3f')](_0x5b58d5);})['then'](function(_0x952456){_0x229a86[_0xf84e('0x40')]=_0x952456;return _0x229a86;})[_0xf84e('0x24')](respondWithFilteredResult(_0x318a17,_0x5b58d5))[_0xf84e('0x41')](handleError(_0x318a17,null));};exports['show']=function(_0x25ca6e,_0x518556){var _0x1d5d33={'raw':!![],'where':{'id':_0x25ca6e[_0xf84e('0x42')]['id']}},_0x17905a={};_0x17905a[_0xf84e('0x2e')]=_[_0xf84e('0x43')](db[_0xf84e('0x3d')]['rawAttributes']);_0x17905a[_0xf84e('0x2f')]=_[_0xf84e('0x43')](_0x25ca6e[_0xf84e('0x2f')]);_0x17905a['filters']=_['intersection'](_0x17905a[_0xf84e('0x2e')],_0x17905a[_0xf84e('0x2f')]);_0x1d5d33['attributes']=_['intersection'](_0x17905a[_0xf84e('0x2e')],qs[_0xf84e('0x44')](_0x25ca6e[_0xf84e('0x2f')][_0xf84e('0x44')]));_0x1d5d33[_0xf84e('0x32')]=_0x1d5d33[_0xf84e('0x32')][_0xf84e('0x33')]?_0x1d5d33['attributes']:_0x17905a[_0xf84e('0x2e')];if(_0x25ca6e[_0xf84e('0x2f')][_0xf84e('0x3e')]){_0x1d5d33[_0xf84e('0x45')]=[{'all':!![]}];}_0x1d5d33=_[_0xf84e('0x3b')]({},_0x1d5d33,_0x25ca6e[_0xf84e('0x3c')]);return db[_0xf84e('0x3d')]['find'](_0x1d5d33)[_0xf84e('0x24')](handleEntityNotFound(_0x518556,null))[_0xf84e('0x24')](respondWithResult(_0x518556,null))[_0xf84e('0x41')](handleError(_0x518556,null));};exports['clone']=function(_0x1e8858,_0x3f2f9f){var _0x2d1a47={'where':{'id':_0x1e8858['params']['id']}},_0x1989a9={};_0x1989a9[_0xf84e('0x2e')]=_[_0xf84e('0x43')](db[_0xf84e('0x3d')][_0xf84e('0x46')]);_0x2d1a47[_0xf84e('0x32')]=_[_0xf84e('0x31')](_0x1989a9[_0xf84e('0x2e')],qs['fields'](_0x1e8858['query'][_0xf84e('0x44')]));_0x2d1a47[_0xf84e('0x32')]=_0x2d1a47[_0xf84e('0x32')][_0xf84e('0x33')]?_0x2d1a47[_0xf84e('0x32')]:_0x1989a9[_0xf84e('0x2e')];if(_0x1e8858['query'][_0xf84e('0x3e')]){_0x2d1a47[_0xf84e('0x45')]=[{'all':!![]}];}_0x2d1a47=_['merge']({},_0x2d1a47,_0x1e8858[_0xf84e('0x3c')]);return db[_0xf84e('0x3d')]['find'](_0x2d1a47)[_0xf84e('0x24')](handleEntityNotFound(_0x3f2f9f,null))['then'](function(_0x5cb08e){if(_0x5cb08e){var _0x3ef581=_0x5cb08e[_0xf84e('0x47')]({'plain':!![]});_0x3ef581=qs[_0xf84e('0x48')](_0x3ef581,['id',_0xf84e('0x49'),_0xf84e('0x4a')]);_0x1e8858[_0xf84e('0x4b')]=_[_0xf84e('0x48')](_0x1e8858[_0xf84e('0x4b')],['id',_0xf84e('0x49'),_0xf84e('0x4a')]);return db[_0xf84e('0x3d')][_0xf84e('0x4c')](_[_0xf84e('0x3b')](_0x3ef581,_0x1e8858['body']),{'include':_0x1e8858[_0xf84e('0x2f')][_0xf84e('0x3e')]?[{'all':!![]}]:undefined});}})[_0xf84e('0x24')](respondWithResult(_0x3f2f9f,0xc9))[_0xf84e('0x41')](handleError(_0x3f2f9f,null));};exports[_0xf84e('0x23')]=function(_0x40fe05,_0xcf6f3b){if(_0x40fe05[_0xf84e('0x4b')]['id']){delete _0x40fe05[_0xf84e('0x4b')]['id'];}return db['Attachment']['find']({'where':{'id':_0x40fe05[_0xf84e('0x42')]['id']}})[_0xf84e('0x24')](handleEntityNotFound(_0xcf6f3b,null))['then'](saveUpdates(_0x40fe05[_0xf84e('0x4b')],null))[_0xf84e('0x24')](respondWithResult(_0xcf6f3b,null))[_0xf84e('0x41')](handleError(_0xcf6f3b,null));};exports['destroy']=function(_0x56e4a8,_0x2641ac){return db['Attachment']['find']({'where':{'id':_0x56e4a8[_0xf84e('0x42')]['id']}})[_0xf84e('0x24')](handleEntityNotFound(_0x2641ac,null))[_0xf84e('0x24')](removeEntity(_0x2641ac,null))[_0xf84e('0x41')](handleError(_0x2641ac,null));};exports[_0xf84e('0x4c')]=function(_0x2188c1,_0x551229,_0x1e8f96){_0x2188c1[_0xf84e('0x4b')][_0xf84e('0x27')]=_0x2188c1['file'][_0xf84e('0x4d')];_0x2188c1[_0xf84e('0x4b')][_0xf84e('0x4e')]=_0x2188c1[_0xf84e('0x4f')][_0xf84e('0x50')];_0x2188c1['body'][_0xf84e('0x2c')]=_0x2188c1[_0xf84e('0x4f')]['mimetype'];return db[_0xf84e('0x3d')][_0xf84e('0x4c')](_0x2188c1['body'])[_0xf84e('0x24')](respondWithResult(_0x551229,0xc9))[_0xf84e('0x41')](handleError(_0x551229,null));};exports['download']=function(_0x4074ab,_0x264e16,_0x43be6b){return db['Attachment'][_0xf84e('0x51')]({'where':{'id':_0x4074ab['params']['id']},'raw':!![]})[_0xf84e('0x24')](handleEntityNotFound(_0x264e16,null))['then'](function(_0x245985){if(_0x245985){var _0x430e38=_0x245985[_0xf84e('0x52')]!==null;var _0x442c7c=path[_0xf84e('0x53')](config[_0xf84e('0x54')],_0xf84e('0x55'));if(_0x430e38){_0x442c7c=path[_0xf84e('0x53')](_0x442c7c,'offline-chat/');}var _0x55d7dd=path[_0xf84e('0x53')](_0x442c7c,_0x245985[_0xf84e('0x4e')]);return _0x264e16['download'](_0x55d7dd);}})[_0xf84e('0x41')](handleError(_0x264e16,null));}; \ No newline at end of file +var _0x090a=['catch','params','clone','find','get','omit','createdAt','updatedAt','body','create','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','name','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows'];(function(_0x440f9c,_0x228e4e){var _0x33262f=function(_0x578de4){while(--_0x578de4){_0x440f9c['push'](_0x440f9c['shift']());}};_0x33262f(++_0x228e4e);}(_0x090a,0x1b9));var _0xa090=function(_0x5adbfc,_0x595ef6){_0x5adbfc=_0x5adbfc-0x0;var _0x462fdb=_0x090a[_0x5adbfc];return _0x462fdb;};'use strict';var emlformat=require(_0xa090('0x0'));var rimraf=require(_0xa090('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa090('0x2'));var rp=require(_0xa090('0x3'));var moment=require('moment');var BPromise=require(_0xa090('0x4'));var Mustache=require(_0xa090('0x5'));var util=require('util');var path=require(_0xa090('0x6'));var sox=require(_0xa090('0x7'));var csv=require(_0xa090('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa090('0x9'));var _=require(_0xa090('0xa'));var squel=require('squel');var crypto=require(_0xa090('0xb'));var jsforce=require(_0xa090('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa090('0x8'));var querystring=require('querystring');var Papa=require(_0xa090('0xd'));var Redis=require(_0xa090('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa090('0xf'));var as=require(_0xa090('0x10'));var hardwareService=require(_0xa090('0x11'));var logger=require(_0xa090('0x12'))(_0xa090('0x13'));var utils=require(_0xa090('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa090('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ebe2f,_0x2a7e5a){_0x2a7e5a=_0x2a7e5a||0xcc;return function(_0x54e756){if(_0x54e756){return _0x3ebe2f[_0xa090('0x16')](_0x2a7e5a);}return _0x3ebe2f[_0xa090('0x17')](_0x2a7e5a)[_0xa090('0x18')]();};}function respondWithResult(_0x31e3ca,_0xde219a){_0xde219a=_0xde219a||0xc8;return function(_0x1a8695){if(_0x1a8695){return _0x31e3ca['status'](_0xde219a)[_0xa090('0x19')](_0x1a8695);}};}function respondWithFilteredResult(_0x2c5feb,_0x19b40d){return function(_0x50b263){if(_0x50b263){var _0x460c56=typeof _0x19b40d[_0xa090('0x1a')]===_0xa090('0x1b')&&typeof _0x19b40d['limit']===_0xa090('0x1b');var _0x462eb1=_0x50b263[_0xa090('0x1c')];var _0x452c17=_0x460c56?0x0:_0x19b40d[_0xa090('0x1a')];var _0x458269=_0x460c56?_0x50b263['count']:_0x19b40d[_0xa090('0x1a')]+_0x19b40d[_0xa090('0x1d')];var _0x4f53da;if(_0x458269>=_0x462eb1){_0x458269=_0x462eb1;_0x4f53da=0xc8;}else{_0x4f53da=0xce;}_0x2c5feb[_0xa090('0x17')](_0x4f53da);return _0x2c5feb[_0xa090('0x1e')]('Content-Range',_0x452c17+'-'+_0x458269+'/'+_0x462eb1)[_0xa090('0x19')](_0x50b263);}return null;};}function patchUpdates(_0x5de21b){return function(_0x56fdc3){try{jsonpatch[_0xa090('0x1f')](_0x56fdc3,_0x5de21b,!![]);}catch(_0x2ddb8e){return BPromise['reject'](_0x2ddb8e);}return _0x56fdc3[_0xa090('0x20')]();};}function saveUpdates(_0x46719b,_0xe3421){return function(_0x36d39a){if(_0x36d39a){return _0x36d39a[_0xa090('0x21')](_0x46719b)[_0xa090('0x22')](function(_0x2644e){return _0x2644e;});}return null;};}function removeEntity(_0x168180,_0x3016a2){return function(_0x1cf9e3){if(_0x1cf9e3){return _0x1cf9e3[_0xa090('0x23')]()[_0xa090('0x22')](function(){_0x168180[_0xa090('0x17')](0xcc)[_0xa090('0x18')]();});}};}function handleEntityNotFound(_0xeb45d1,_0x3b1300){return function(_0x330007){if(!_0x330007){_0xeb45d1['sendStatus'](0x194);}return _0x330007;};}function handleError(_0x364290,_0x2caaab){_0x2caaab=_0x2caaab||0x1f4;return function(_0x12004c){logger['error'](_0x12004c['stack']);if(_0x12004c[_0xa090('0x24')]){delete _0x12004c['name'];}_0x364290[_0xa090('0x17')](_0x2caaab)['send'](_0x12004c);};}exports['index']=function(_0x37c09c,_0x2b53ab){var _0x3e171e={},_0x564e84={},_0x3d1506={'count':0x0,'rows':[]};var _0x22a9f6=_[_0xa090('0x25')](db[_0xa090('0x26')][_0xa090('0x27')],function(_0xc67070){return{'name':_0xc67070[_0xa090('0x28')],'type':_0xc67070[_0xa090('0x29')][_0xa090('0x2a')]};});_0x564e84[_0xa090('0x2b')]=_[_0xa090('0x25')](_0x22a9f6,_0xa090('0x24'));_0x564e84[_0xa090('0x2c')]=_[_0xa090('0x2d')](_0x37c09c[_0xa090('0x2c')]);_0x564e84[_0xa090('0x2e')]=_[_0xa090('0x2f')](_0x564e84[_0xa090('0x2b')],_0x564e84['query']);_0x3e171e[_0xa090('0x30')]=_[_0xa090('0x2f')](_0x564e84[_0xa090('0x2b')],qs[_0xa090('0x31')](_0x37c09c[_0xa090('0x2c')][_0xa090('0x31')]));_0x3e171e[_0xa090('0x30')]=_0x3e171e[_0xa090('0x30')][_0xa090('0x32')]?_0x3e171e[_0xa090('0x30')]:_0x564e84[_0xa090('0x2b')];if(!_0x37c09c[_0xa090('0x2c')][_0xa090('0x33')](_0xa090('0x34'))){_0x3e171e[_0xa090('0x1d')]=qs[_0xa090('0x1d')](_0x37c09c['query'][_0xa090('0x1d')]);_0x3e171e[_0xa090('0x1a')]=qs[_0xa090('0x1a')](_0x37c09c[_0xa090('0x2c')][_0xa090('0x1a')]);}_0x3e171e[_0xa090('0x35')]=qs['sort'](_0x37c09c[_0xa090('0x2c')][_0xa090('0x36')]);_0x3e171e['where']=qs[_0xa090('0x2e')](_['pick'](_0x37c09c[_0xa090('0x2c')],_0x564e84['filters']),_0x22a9f6);if(_0x37c09c[_0xa090('0x2c')]['filter']){_0x3e171e[_0xa090('0x37')]=_[_0xa090('0x38')](_0x3e171e[_0xa090('0x37')],{'$or':_[_0xa090('0x25')](_0x22a9f6,function(_0x2f8b2d){if(_0x2f8b2d['type']!==_0xa090('0x39')){var _0x5cbb02={};_0x5cbb02[_0x2f8b2d[_0xa090('0x24')]]={'$like':'%'+_0x37c09c[_0xa090('0x2c')][_0xa090('0x3a')]+'%'};return _0x5cbb02;}})});}_0x3e171e=_[_0xa090('0x38')]({},_0x3e171e,_0x37c09c[_0xa090('0x3b')]);var _0x54d923={'where':_0x3e171e['where']};return db[_0xa090('0x26')][_0xa090('0x1c')](_0x54d923)['then'](function(_0x17297d){_0x3d1506[_0xa090('0x1c')]=_0x17297d;if(_0x37c09c[_0xa090('0x2c')][_0xa090('0x3c')]){_0x3e171e[_0xa090('0x3d')]=[{'all':!![]}];}return db[_0xa090('0x26')]['findAll'](_0x3e171e);})[_0xa090('0x22')](function(_0x17da61){_0x3d1506[_0xa090('0x3e')]=_0x17da61;return _0x3d1506;})[_0xa090('0x22')](respondWithFilteredResult(_0x2b53ab,_0x3e171e))[_0xa090('0x3f')](handleError(_0x2b53ab,null));};exports['show']=function(_0x12748e,_0x4ca3c2){var _0x5300c3={'raw':!![],'where':{'id':_0x12748e[_0xa090('0x40')]['id']}},_0x386da0={};_0x386da0[_0xa090('0x2b')]=_[_0xa090('0x2d')](db[_0xa090('0x26')][_0xa090('0x27')]);_0x386da0[_0xa090('0x2c')]=_[_0xa090('0x2d')](_0x12748e['query']);_0x386da0[_0xa090('0x2e')]=_[_0xa090('0x2f')](_0x386da0[_0xa090('0x2b')],_0x386da0[_0xa090('0x2c')]);_0x5300c3[_0xa090('0x30')]=_['intersection'](_0x386da0[_0xa090('0x2b')],qs['fields'](_0x12748e[_0xa090('0x2c')]['fields']));_0x5300c3['attributes']=_0x5300c3[_0xa090('0x30')]['length']?_0x5300c3[_0xa090('0x30')]:_0x386da0[_0xa090('0x2b')];if(_0x12748e[_0xa090('0x2c')]['includeAll']){_0x5300c3[_0xa090('0x3d')]=[{'all':!![]}];}_0x5300c3=_['merge']({},_0x5300c3,_0x12748e['options']);return db[_0xa090('0x26')]['find'](_0x5300c3)[_0xa090('0x22')](handleEntityNotFound(_0x4ca3c2,null))[_0xa090('0x22')](respondWithResult(_0x4ca3c2,null))['catch'](handleError(_0x4ca3c2,null));};exports[_0xa090('0x41')]=function(_0x90b876,_0x3a9076){var _0x27d5e6={'where':{'id':_0x90b876['params']['id']}},_0x434aea={};_0x434aea['model']=_['keys'](db[_0xa090('0x26')][_0xa090('0x27')]);_0x27d5e6[_0xa090('0x30')]=_[_0xa090('0x2f')](_0x434aea[_0xa090('0x2b')],qs[_0xa090('0x31')](_0x90b876[_0xa090('0x2c')]['fields']));_0x27d5e6[_0xa090('0x30')]=_0x27d5e6[_0xa090('0x30')][_0xa090('0x32')]?_0x27d5e6[_0xa090('0x30')]:_0x434aea['model'];if(_0x90b876[_0xa090('0x2c')]['includeAll']){_0x27d5e6[_0xa090('0x3d')]=[{'all':!![]}];}_0x27d5e6=_[_0xa090('0x38')]({},_0x27d5e6,_0x90b876[_0xa090('0x3b')]);return db[_0xa090('0x26')][_0xa090('0x42')](_0x27d5e6)[_0xa090('0x22')](handleEntityNotFound(_0x3a9076,null))[_0xa090('0x22')](function(_0x45afaa){if(_0x45afaa){var _0x5b04b5=_0x45afaa[_0xa090('0x43')]({'plain':!![]});_0x5b04b5=qs[_0xa090('0x44')](_0x5b04b5,['id',_0xa090('0x45'),_0xa090('0x46')]);_0x90b876[_0xa090('0x47')]=_[_0xa090('0x44')](_0x90b876[_0xa090('0x47')],['id',_0xa090('0x45'),_0xa090('0x46')]);return db['Attachment']['create'](_[_0xa090('0x38')](_0x5b04b5,_0x90b876[_0xa090('0x47')]),{'include':_0x90b876[_0xa090('0x2c')][_0xa090('0x3c')]?[{'all':!![]}]:undefined});}})[_0xa090('0x22')](respondWithResult(_0x3a9076,0xc9))[_0xa090('0x3f')](handleError(_0x3a9076,null));};exports[_0xa090('0x21')]=function(_0x451e77,_0x4e1388){if(_0x451e77[_0xa090('0x47')]['id']){delete _0x451e77[_0xa090('0x47')]['id'];}return db[_0xa090('0x26')][_0xa090('0x42')]({'where':{'id':_0x451e77[_0xa090('0x40')]['id']}})['then'](handleEntityNotFound(_0x4e1388,null))[_0xa090('0x22')](saveUpdates(_0x451e77[_0xa090('0x47')],null))[_0xa090('0x22')](respondWithResult(_0x4e1388,null))[_0xa090('0x3f')](handleError(_0x4e1388,null));};exports[_0xa090('0x23')]=function(_0x56519a,_0x78d73a){return db[_0xa090('0x26')]['find']({'where':{'id':_0x56519a[_0xa090('0x40')]['id']}})[_0xa090('0x22')](handleEntityNotFound(_0x78d73a,null))[_0xa090('0x22')](removeEntity(_0x78d73a,null))['catch'](handleError(_0x78d73a,null));};exports[_0xa090('0x48')]=function(_0x1d3204,_0x194f69,_0x30abf8){_0x1d3204['body'][_0xa090('0x24')]=_0x1d3204['file']['originalname'];_0x1d3204[_0xa090('0x47')]['basename']=_0x1d3204[_0xa090('0x49')][_0xa090('0x4a')];_0x1d3204[_0xa090('0x47')][_0xa090('0x29')]=_0x1d3204[_0xa090('0x49')][_0xa090('0x4b')];return db[_0xa090('0x26')][_0xa090('0x48')](_0x1d3204[_0xa090('0x47')])[_0xa090('0x22')](respondWithResult(_0x194f69,0xc9))[_0xa090('0x3f')](handleError(_0x194f69,null));};exports[_0xa090('0x4c')]=function(_0x31122b,_0x511793,_0x25e2e7){return db[_0xa090('0x26')][_0xa090('0x4d')]({'where':{'id':_0x31122b['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x511793,null))[_0xa090('0x22')](function(_0x204be8){if(_0x204be8){var _0x5799d4=_0x204be8[_0xa090('0x4e')]!==null;var _0x5a84d7=path[_0xa090('0x4f')](config[_0xa090('0x50')],_0xa090('0x51'));if(_0x5799d4){_0x5a84d7=path[_0xa090('0x4f')](_0x5a84d7,_0xa090('0x52'));}var _0x2f200e=path[_0xa090('0x4f')](_0x5a84d7,_0x204be8[_0xa090('0x53')]);return _0x511793[_0xa090('0x4c')](_0x2f200e);}})['catch'](handleError(_0x511793,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 500b6fe..9df4430 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 _0x51be=['util','../../config/logger','request-promise','path','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x42f985,_0x168c69){var _0x3f00ea=function(_0x571a6f){while(--_0x571a6f){_0x42f985['push'](_0x42f985['shift']());}};_0x3f00ea(++_0x168c69);}(_0x51be,0x180));var _0xe51b=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0x51be[_0x420513];return _0x1b44ec;};'use strict';var _=require(_0xe51b('0x0'));var util=require(_0xe51b('0x1'));var logger=require(_0xe51b('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe51b('0x3'));var fs=require('fs');var path=require(_0xe51b('0x4'));var rimraf=require('rimraf');var config=require(_0xe51b('0x5'));var attributes=require(_0xe51b('0x6'));module[_0xe51b('0x7')]=function(_0x5a5dfb,_0x41a431){return _0x5a5dfb[_0xe51b('0x8')](_0xe51b('0x9'),attributes,{'tableName':_0xe51b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9b7=['request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2b3aae,_0x24b5cc){var _0x3f6fa4=function(_0x4bef99){while(--_0x4bef99){_0x2b3aae['push'](_0x2b3aae['shift']());}};_0x3f6fa4(++_0x24b5cc);}(_0xb9b7,0xf2));var _0x7b9b=function(_0x976112,_0x1c4db4){_0x976112=_0x976112-0x0;var _0x1a1bd2=_0xb9b7[_0x976112];return _0x1a1bd2;};'use strict';var _=require(_0x7b9b('0x0'));var util=require('util');var logger=require(_0x7b9b('0x1'))(_0x7b9b('0x2'));var moment=require(_0x7b9b('0x3'));var BPromise=require(_0x7b9b('0x4'));var rp=require(_0x7b9b('0x5'));var fs=require('fs');var path=require(_0x7b9b('0x6'));var rimraf=require(_0x7b9b('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b9b('0x8'));module[_0x7b9b('0x9')]=function(_0xbdd4f3,_0x6baaab){return _0xbdd4f3[_0x7b9b('0xa')](_0x7b9b('0xb'),attributes,{'tableName':_0x7b9b('0xc'),'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 6afcbee..eea507b 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 _0x70e0=['options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body'];(function(_0x5e1aa7,_0x58c9d0){var _0x2caf29=function(_0x4f5c5e){while(--_0x4f5c5e){_0x5e1aa7['push'](_0x5e1aa7['shift']());}};_0x2caf29(++_0x58c9d0);}(_0x70e0,0x17b));var _0x070e=function(_0x528b90,_0x54de92){_0x528b90=_0x528b90-0x0;var _0x337124=_0x70e0[_0x528b90];return _0x337124;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('Attachment,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('Attachment,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}exports[_0x070e('0x16')]=function(_0x38f6e6){var _0x2060cc=this;return new Promise(function(_0x364b3f,_0x5037eb){return db[_0x070e('0x17')][_0x070e('0x18')](_0x38f6e6[_0x070e('0x19')],{'raw':_0x38f6e6[_0x070e('0x1a')]?_0x38f6e6[_0x070e('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e958f){logger[_0x070e('0xb')](_0x070e('0x16'),_0x38f6e6);logger[_0x070e('0xc')]('CreateAttachment',_0x38f6e6,JSON[_0x070e('0xf')](_0x4e958f));_0x364b3f(_0x4e958f);})['catch'](function(_0xf8dd5d){logger[_0x070e('0x10')](_0x070e('0x16'),_0xf8dd5d[_0x070e('0x13')],_0x38f6e6);_0x5037eb(_0x2060cc[_0x070e('0x10')](0x1f4,_0xf8dd5d[_0x070e('0x13')]));});});}; \ No newline at end of file +var _0xc831=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','Attachment,\x20%s,\x20%s','message','result','catch','create','options','then','util','moment','bluebird','randomstring','ioredis'];(function(_0x46bffd,_0xdea53e){var _0x2d73ed=function(_0x2c1508){while(--_0x2c1508){_0x46bffd['push'](_0x46bffd['shift']());}};_0x2d73ed(++_0xdea53e);}(_0xc831,0x103));var _0x1c83=function(_0x574a7a,_0x2443a5){_0x574a7a=_0x574a7a-0x0;var _0x8d420a=_0xc831[_0x574a7a];return _0x8d420a;};'use strict';var _=require('lodash');var util=require(_0x1c83('0x0'));var moment=require(_0x1c83('0x1'));var BPromise=require(_0x1c83('0x2'));var rs=require(_0x1c83('0x3'));var fs=require('fs');var Redis=require(_0x1c83('0x4'));var db=require(_0x1c83('0x5'))['db'];var utils=require(_0x1c83('0x6'));var logger=require(_0x1c83('0x7'))(_0x1c83('0x8'));var config=require(_0x1c83('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1c83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ec70,_0x1ce77e,_0x1953e5){return new BPromise(function(_0x29ceee,_0x38f254){return client[_0x1c83('0xb')](_0x52ec70,_0x1953e5)['then'](function(_0x9cb1e2){logger[_0x1c83('0xc')]('Attachment,\x20%s,\x20%s',_0x1ce77e,'request\x20sent');logger[_0x1c83('0xd')](_0x1c83('0xe'),_0x1ce77e,_0x1c83('0xf'),JSON['stringify'](_0x9cb1e2));if(_0x9cb1e2[_0x1c83('0x10')]){if(_0x9cb1e2['error']['code']===0x1f4){logger[_0x1c83('0x10')](_0x1c83('0x11'),_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x38f254(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}logger[_0x1c83('0x10')]('Attachment,\x20%s,\x20%s',_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x29ceee(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}else{logger[_0x1c83('0xc')]('Attachment,\x20%s,\x20%s',_0x1ce77e,_0x1c83('0xf'));_0x29ceee(_0x9cb1e2[_0x1c83('0x13')][_0x1c83('0x12')]);}})[_0x1c83('0x14')](function(_0x596a69){logger[_0x1c83('0x10')]('Attachment,\x20%s,\x20%s',_0x1ce77e,_0x596a69);_0x38f254(_0x596a69);});});}exports['CreateAttachment']=function(_0x3b3369){var _0x1d6027=this;return new Promise(function(_0x2ec743,_0x37a7ac){return db['Attachment'][_0x1c83('0x15')](_0x3b3369['body'],{'raw':_0x3b3369[_0x1c83('0x16')]?_0x3b3369[_0x1c83('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x1c83('0x17')](function(_0x1b5a71){logger['info']('CreateAttachment',_0x3b3369);logger[_0x1c83('0xd')]('CreateAttachment',_0x3b3369,JSON['stringify'](_0x1b5a71));_0x2ec743(_0x1b5a71);})[_0x1c83('0x14')](function(_0x3e216d){logger[_0x1c83('0x10')]('CreateAttachment',_0x3e216d[_0x1c83('0x12')],_0x3b3369);_0x37a7ac(_0x1d6027[_0x1c83('0x10')](0x1f4,_0x3e216d[_0x1c83('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index f4d97f0..6e130d9 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x22c481,_0x316d79){_0x22c481=_0x22c481-0x0;var _0x1023b3=_0xdb28[_0x22c481];return _0x1023b3;};'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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5f66[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('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 54d8187..aaf585f 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 _0xdc69=['Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','blockedAt','admin','agent','name','then','disabled','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','User','passport','Strategy','moment','bluebird','util','../../mysqldb','../../config/utils','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured'];(function(_0x178d1a,_0xfe0877){var _0x1250fd=function(_0x4c24f5){while(--_0x4c24f5){_0x178d1a['push'](_0x178d1a['shift']());}};_0x1250fd(++_0xfe0877);}(_0xdc69,0x165));var _0x9dc6=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xdc69[_0xf51c06];return _0x1d5420;};'use strict';var passport=require(_0x9dc6('0x0'));var LocalStrategy=require('passport-local')[_0x9dc6('0x1')];var moment=require(_0x9dc6('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x9dc6('0x3'));var util=require(_0x9dc6('0x4'));var db=require(_0x9dc6('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x9dc6('0x6'));var config=require('../../config/environment');var logger=require(_0x9dc6('0x7'))('api');function isActiveDirectoryConfigured(_0x57566c){var _0x3fb2d4=![];if(typeof _0x57566c[_0x9dc6('0x8')]!==_0x9dc6('0x9')){_0x3fb2d4=_0x57566c['activedirectory'][_0x9dc6('0xa')]&&_0x57566c[_0x9dc6('0x8')][_0x9dc6('0xb')]&&_0x57566c[_0x9dc6('0x8')][_0x9dc6('0xc')];}return _0x3fb2d4;}function adAuthenticate(_0x2f7aa7,_0x9e9cc0,_0x470bca){return new BPromise(function(_0x580e2e,_0x402de7){try{var _0x151d2f=new ActiveDirectory(_0x2f7aa7);_0x151d2f[_0x9dc6('0xd')](_0x9e9cc0,_0x470bca,function(_0x4591f0,_0x2204eb){if(_0x4591f0){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x9e9cc0,util[_0x9dc6('0xe')](_0x4591f0,{'showHidden':![],'depth':null}));_0x402de7(_0x9dc6('0xf'));}else if(!_0x2204eb){logger[_0x9dc6('0x10')](_0x9dc6('0x11'),_0x9e9cc0);_0x402de7(_0x9dc6('0xf'));}else{_0x580e2e(_0x2204eb);}});}catch(_0x351d61){_0x402de7(_0x351d61);}});}function ActiveDirectoryAuthenticate(_0x13c92c,_0x67f6e1,_0xc66da6,_0x78776e){var _0xa55e99,_0xa177cf;if(!isActiveDirectoryConfigured(config)){logger[_0x9dc6('0x10')](_0x9dc6('0x12'),_0x67f6e1);return _0x78776e(null,![],{'message':_0x9dc6('0xf')});}return db[_0x9dc6('0x13')][_0x9dc6('0x14')]({'where':{'id':0x1},'attributes':[_0x9dc6('0x15'),_0x9dc6('0x16')],'raw':!![]})['then'](function(_0x2140ea){_0xa55e99=_0x2140ea;if(!_0xa55e99[_0x9dc6('0x15')]){logger[_0x9dc6('0x10')](_0x9dc6('0x17'),_0x67f6e1);throw new Error(_0x9dc6('0xf'));}return _0x13c92c['findOne']({'attributes':['id','name',_0x9dc6('0x18'),_0x9dc6('0x19'),_0x9dc6('0x1a'),'disabled',_0x9dc6('0x1b'),_0x9dc6('0x1c'),'online'],'where':{'name':_0x67f6e1,'role':{'$or':[_0x9dc6('0x1d'),'user',_0x9dc6('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x257499){if(!_0x257499||_0x257499&&_0x257499['name']!==_0x67f6e1){throw new Error(_0x9dc6('0xf'));}_0xa177cf=_0x257499;var _0x2a6bc6=_0xa177cf[_0x9dc6('0x1f')]+'@'+config[_0x9dc6('0x8')]['domain'];return adAuthenticate(config[_0x9dc6('0x8')],_0x2a6bc6,_0xc66da6);})[_0x9dc6('0x20')](function(_0x2afda8){if(_0xa177cf[_0x9dc6('0x21')]){throw new Error(_0x9dc6('0xf'));}if(_0xa55e99['blockDuration']>0x0){if(_0xa177cf[_0x9dc6('0x1b')]){if(moment(_0xa177cf[_0x9dc6('0x1c')])['add'](_0xa55e99[_0x9dc6('0x16')],'minutes')>moment()){throw new Error(_0x9dc6('0xf'));}return utils['clearBlockUser'](_0xa177cf,0x0,![],null)[_0x9dc6('0x20')](function(){return utils[_0x9dc6('0x22')](_0xa177cf);})[_0x9dc6('0x20')](function(){return _0x78776e(null,_0xa177cf);});}else{return utils[_0x9dc6('0x22')](_0xa177cf)[_0x9dc6('0x20')](function(){return _0x78776e(null,_0xa177cf);});}}else{return utils['getLicense'](_0xa177cf)[_0x9dc6('0x20')](function(){return _0x78776e(null,_0xa177cf);});}})[_0x9dc6('0x23')](function(_0x3926f5){return _0x78776e(null,![],_0x3926f5);});}function handleError(_0x132b68,_0x8a1da6,_0x52648d){return _0x132b68[_0x9dc6('0x24')](_0x8a1da6||0x1f4)[_0x9dc6('0x25')]({'message':_0x52648d?_0x52648d[_0x9dc6('0x26')]||_0x52648d:''});}exports[_0x9dc6('0x27')]=function(_0x16136e,_0x2c3f4c,_0x3adac1){passport[_0x9dc6('0xd')](_0x9dc6('0x28'),function(_0x1edc90,_0x1e2834,_0x2a3565){var _0x49d0c0=_0x1edc90||_0x2a3565;if(_0x49d0c0){return handleError(_0x2c3f4c,0x191,_0x49d0c0);}if(!_0x1e2834){return handleError(_0x2c3f4c,0x194,{'message':_0x9dc6('0x29')});}else{var _0x5ccc30={'payload':{'id':_0x1e2834['id'],'role':_0x1e2834[_0x9dc6('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x9dc6('0x2a')](_0x5ccc30)[_0x9dc6('0x20')](function(_0x26407d){_0x2c3f4c[_0x9dc6('0x2b')]({'id':_0x1e2834['id'],'token':_0x26407d,'statusCall':'','isAlreadyLogged':_0x1e2834[_0x9dc6('0x2c')]});});}})(_0x16136e,_0x2c3f4c,_0x3adac1);};passport[_0x9dc6('0x2d')](_0x9dc6('0x28'),new LocalStrategy({'usernameField':_0x9dc6('0x1f'),'passwordField':'password'},function(_0x3925a3,_0x4b1503,_0x3bbad1){return ActiveDirectoryAuthenticate(db[_0x9dc6('0x2e')],_0x3925a3,_0x4b1503,_0x3bbad1);})); \ No newline at end of file +var _0x45db=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','admin','user','domain','then','disabled','add','minutes','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils','../../config/environment','api','undefined','activedirectory','error','Error\x20authenticate\x20%s:\x20%s','inspect'];(function(_0x15a958,_0x458a4f){var _0x3bd7b4=function(_0x25869b){while(--_0x25869b){_0x15a958['push'](_0x15a958['shift']());}};_0x3bd7b4(++_0x458a4f);}(_0x45db,0xa9));var _0xb45d=function(_0x53d809,_0x3b3b3c){_0x53d809=_0x53d809-0x0;var _0x271c17=_0x45db[_0x53d809];return _0x271c17;};'use strict';var passport=require(_0xb45d('0x0'));var LocalStrategy=require(_0xb45d('0x1'))[_0xb45d('0x2')];var moment=require(_0xb45d('0x3'));var ActiveDirectory=require(_0xb45d('0x4'));var BPromise=require(_0xb45d('0x5'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0xb45d('0x6'));var utils=require(_0xb45d('0x7'));var config=require(_0xb45d('0x8'));var logger=require('../../config/logger')(_0xb45d('0x9'));function isActiveDirectoryConfigured(_0x3e6f4c){var _0x3d8ff8=![];if(typeof _0x3e6f4c['activedirectory']!==_0xb45d('0xa')){_0x3d8ff8=_0x3e6f4c[_0xb45d('0xb')]['baseDN']&&_0x3e6f4c[_0xb45d('0xb')]['url']&&_0x3e6f4c[_0xb45d('0xb')]['domain'];}return _0x3d8ff8;}function adAuthenticate(_0x3158fa,_0xc709fa,_0x2250d8){return new BPromise(function(_0x21d972,_0x456fbc){try{var _0x40586c=new ActiveDirectory(_0x3158fa);_0x40586c['authenticate'](_0xc709fa,_0x2250d8,function(_0x2d5655,_0x59807e){if(_0x2d5655){logger[_0xb45d('0xc')](_0xb45d('0xd'),_0xc709fa,util[_0xb45d('0xe')](_0x2d5655,{'showHidden':![],'depth':null}));_0x456fbc(_0xb45d('0xf'));}else if(!_0x59807e){logger[_0xb45d('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0xc709fa);_0x456fbc(_0xb45d('0xf'));}else{_0x21d972(_0x59807e);}});}catch(_0x1dfabf){_0x456fbc(_0x1dfabf);}});}function ActiveDirectoryAuthenticate(_0x257dea,_0x46d104,_0x8d819e,_0x4cd610){var _0x39698c,_0x124f13;if(!isActiveDirectoryConfigured(config)){logger[_0xb45d('0xc')](_0xb45d('0x10'),_0x46d104);return _0x4cd610(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xb45d('0x11')][_0xb45d('0x12')]({'where':{'id':0x1},'attributes':[_0xb45d('0x13'),_0xb45d('0x14')],'raw':!![]})['then'](function(_0x27fc49){_0x39698c=_0x27fc49;if(!_0x39698c[_0xb45d('0x13')]){logger[_0xb45d('0xc')](_0xb45d('0x15'),_0x46d104);throw new Error(_0xb45d('0xf'));}return _0x257dea[_0xb45d('0x12')]({'attributes':['id',_0xb45d('0x16'),_0xb45d('0x17'),_0xb45d('0x18'),_0xb45d('0x19'),'disabled',_0xb45d('0x1a'),_0xb45d('0x1b'),'online'],'where':{'name':_0x46d104,'role':{'$or':[_0xb45d('0x1c'),_0xb45d('0x1d'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0x53df64){if(!_0x53df64||_0x53df64&&_0x53df64[_0xb45d('0x16')]!==_0x46d104){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x124f13=_0x53df64;var _0x520964=_0x124f13[_0xb45d('0x16')]+'@'+config[_0xb45d('0xb')][_0xb45d('0x1e')];return adAuthenticate(config[_0xb45d('0xb')],_0x520964,_0x8d819e);})[_0xb45d('0x1f')](function(_0x2c5932){if(_0x124f13[_0xb45d('0x20')]){throw new Error(_0xb45d('0xf'));}if(_0x39698c['blockDuration']>0x0){if(_0x124f13['blocked']){if(moment(_0x124f13[_0xb45d('0x1b')])[_0xb45d('0x21')](_0x39698c['blockDuration'],_0xb45d('0x22'))>moment()){throw new Error(_0xb45d('0xf'));}return utils['clearBlockUser'](_0x124f13,0x0,![],null)[_0xb45d('0x1f')](function(){return utils['getLicense'](_0x124f13);})[_0xb45d('0x1f')](function(){return _0x4cd610(null,_0x124f13);});}else{return utils[_0xb45d('0x23')](_0x124f13)[_0xb45d('0x1f')](function(){return _0x4cd610(null,_0x124f13);});}}else{return utils[_0xb45d('0x23')](_0x124f13)['then'](function(){return _0x4cd610(null,_0x124f13);});}})[_0xb45d('0x24')](function(_0x43b710){return _0x4cd610(null,![],_0x43b710);});}function handleError(_0x73d2d,_0x53875a,_0x4a535f){return _0x73d2d[_0xb45d('0x25')](_0x53875a||0x1f4)[_0xb45d('0x26')]({'message':_0x4a535f?_0x4a535f[_0xb45d('0x27')]||_0x4a535f:''});}exports[_0xb45d('0x28')]=function(_0x263563,_0x5dae57,_0x2886d9){passport['authenticate'](_0xb45d('0x29'),function(_0x3d9efd,_0x5570a9,_0xfefa39){var _0x4f3a65=_0x3d9efd||_0xfefa39;if(_0x4f3a65){return handleError(_0x5dae57,0x191,_0x4f3a65);}if(!_0x5570a9){return handleError(_0x5dae57,0x194,{'message':_0xb45d('0x2a')});}else{var _0x49e1b8={'payload':{'id':_0x5570a9['id'],'role':_0x5570a9[_0xb45d('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x49e1b8)[_0xb45d('0x1f')](function(_0x396bf2){_0x5dae57['json']({'id':_0x5570a9['id'],'token':_0x396bf2,'statusCall':'','isAlreadyLogged':_0x5570a9[_0xb45d('0x2b')]});});}})(_0x263563,_0x5dae57,_0x2886d9);};passport[_0xb45d('0x2c')](_0xb45d('0x29'),new LocalStrategy({'usernameField':_0xb45d('0x16'),'passwordField':_0xb45d('0x17')},function(_0x59c985,_0x3bd3c9,_0x5d2eda){return ActiveDirectoryAuthenticate(db[_0xb45d('0x2d')],_0x59c985,_0x3bd3c9,_0x5d2eda);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 4367fef..0cefedd 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 _0xfb62=['login','exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x9dbb75,_0x16bee2){var _0x2ec973=function(_0x2b58f2){while(--_0x2b58f2){_0x9dbb75['push'](_0x9dbb75['shift']());}};_0x2ec973(++_0x16bee2);}(_0xfb62,0xf8));var _0x2fb6=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xfb62[_0x53ccf2];return _0x5a2964;};'use strict';var express=require(_0x2fb6('0x0'));var router=express[_0x2fb6('0x1')]();var controller=require(_0x2fb6('0x2'));router[_0x2fb6('0x3')]('/',controller[_0x2fb6('0x4')]);module[_0x2fb6('0x5')]=router; \ No newline at end of file +var _0xedff=['post','login','express','Router','./authActiveDirectory.controller'];(function(_0x114bdf,_0x42e9d3){var _0x1cb120=function(_0x13481b){while(--_0x13481b){_0x114bdf['push'](_0x114bdf['shift']());}};_0x1cb120(++_0x42e9d3);}(_0xedff,0x98));var _0xfedf=function(_0x5c942a,_0x4c8872){_0x5c942a=_0x5c942a-0x0;var _0x21c584=_0xedff[_0x5c942a];return _0x21c584;};'use strict';var express=require(_0xfedf('0x0'));var router=express[_0xfedf('0x1')]();var controller=require(_0xfedf('0x2'));router[_0xfedf('0x3')]('/',controller[_0xfedf('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index e976998..76b4ed3 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(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x7a54,0x106));var _0x47a5=function(_0x195af7,_0x31db9b){_0x195af7=_0x195af7-0x0;var _0x228f4a=_0x7a54[_0x195af7];return _0x228f4a;};'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(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x7a54,0x106));var _0x47a5=function(_0xdbd08e,_0x1c13ee){_0xdbd08e=_0xdbd08e-0x0;var _0x9703c1=_0x7a54[_0xdbd08e];return _0x9703c1;};'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 422486f..c77a250 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 _0x6355=['exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','login','get','/callback','callback','isMiddleware'];(function(_0x4f7c3e,_0x21b13a){var _0x4c9e84=function(_0x38b549){while(--_0x38b549){_0x4f7c3e['push'](_0x4f7c3e['shift']());}};_0x4c9e84(++_0x21b13a);}(_0x6355,0x16c));var _0x5635=function(_0x272f20,_0x16cf90){_0x272f20=_0x272f20-0x0;var _0x176fc9=_0x6355[_0x272f20];return _0x176fc9;};'use strict';var express=require(_0x5635('0x0'));var passport=require(_0x5635('0x1'));var router=express[_0x5635('0x2')]();var controller=require(_0x5635('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x5635('0x4'));router['get']('/',controller[_0x5635('0x5')]);router[_0x5635('0x6')](_0x5635('0x7'),controller[_0x5635('0x8')],authService[_0x5635('0x9')],userController[_0x5635('0x5')],authService['setTokenCookie']);module[_0x5635('0xa')]=router; \ No newline at end of file +var _0x4e8e=['login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','../user/user.controller.js','../../components/auth/service','get'];(function(_0x140202,_0x4245c7){var _0x3037c2=function(_0x525d19){while(--_0x525d19){_0x140202['push'](_0x140202['shift']());}};_0x3037c2(++_0x4245c7);}(_0x4e8e,0x95));var _0xe4e8=function(_0x1f8b01,_0x4367ca){_0x1f8b01=_0x1f8b01-0x0;var _0x42c065=_0x4e8e[_0x1f8b01];return _0x42c065;};'use strict';var express=require(_0xe4e8('0x0'));var passport=require(_0xe4e8('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xe4e8('0x2'));var authService=require(_0xe4e8('0x3'));router[_0xe4e8('0x4')]('/',controller[_0xe4e8('0x5')]);router['get'](_0xe4e8('0x6'),controller[_0xe4e8('0x7')],authService[_0xe4e8('0x8')],userController['login'],authService[_0xe4e8('0x9')]);module[_0xe4e8('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 4b6ac36..bb0fdfd 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 _0x41c5=['jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','Setting','allowedLoginAttempts','blockDuration','then','name','salt','blockedAt','user','agent','loginAttempts','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','forgot','body','generate','trim','findOne','User','find','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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','status','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','use','passport','passport-local','Strategy'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x41c5,0x179));var _0x541c=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x41c5[_0x40a045];return _0x1a687c;};'use strict';var util=require('util');var passport=require(_0x541c('0x0'));var LocalStrategy=require(_0x541c('0x1'))[_0x541c('0x2')];var jayson=require(_0x541c('0x3'));var _=require('lodash');var rs=require(_0x541c('0x4'));var moment=require(_0x541c('0x5'));var db=require(_0x541c('0x6'))['db'];var authService=require(_0x541c('0x7'));var utils=require(_0x541c('0x8'));var client=jayson[_0x541c('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x226aef,_0x876cde,_0x2fc30b,_0x4167f5){var _0x38c13f,_0x254c41;return db[_0x541c('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x541c('0xb'),_0x541c('0xc')],'raw':!![]})[_0x541c('0xd')](function(_0x268d31){_0x38c13f=_0x268d31;return _0x226aef['findOne']({'attributes':['id',_0x541c('0xe'),'password',_0x541c('0xf'),'role','disabled','blocked',_0x541c('0x10'),'loginAttempts'],'where':{'name':_0x876cde,'role':{'$or':['admin',_0x541c('0x11'),_0x541c('0x12')]}}});})[_0x541c('0xd')](function(_0x3d812e){if(!_0x3d812e||_0x3d812e&&_0x3d812e['name']!==_0x876cde){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x254c41=_0x3d812e;return _0x254c41;}})[_0x541c('0xd')](function(){_0x254c41['authenticate'](_0x2fc30b,function(_0x56cb21,_0x1cf3af){var _0x1e84dd=_0x254c41[_0x541c('0x13')]+0x1;if(_0x56cb21){return _0x4167f5(_0x56cb21);}else if(!_0x1cf3af){if(_0x254c41[_0x541c('0x14')]){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else if(_0x38c13f[_0x541c('0xb')]>0x0){if(_0x254c41[_0x541c('0x16')]){if(_0x38c13f[_0x541c('0xc')]>0x0){if(moment(_0x254c41[_0x541c('0x10')])[_0x541c('0x17')](_0x38c13f['blockDuration'],_0x541c('0x18'))>moment()){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else{return utils[_0x541c('0x19')](_0x254c41,_0x1e84dd,![],null)[_0x541c('0xd')](function(){return _0x4167f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x4167f5(null,![],{'message':_0x541c('0x15')});}}else{if(_0x1e84dd>=_0x38c13f[_0x541c('0xb')]){return utils['clearBlockUser'](_0x254c41,0x0,!![],moment())['then'](function(){return _0x4167f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x254c41,_0x1e84dd,![],null)['then'](function(){return _0x4167f5(null,![],{'message':_0x541c('0x15')});});}}}else{return _0x4167f5(null,![],{'message':_0x541c('0x15')});}}else{if(_0x254c41[_0x541c('0x14')]){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else if(_0x38c13f['allowedLoginAttempts']>0x0){if(_0x254c41[_0x541c('0x16')]){if(_0x38c13f[_0x541c('0xc')]>0x0){if(moment(_0x254c41[_0x541c('0x10')])[_0x541c('0x17')](_0x38c13f['blockDuration'],'minutes')>moment()){return _0x4167f5(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x541c('0x19')](_0x254c41,0x0,![],null)['then'](function(){return utils[_0x541c('0x1a')](_0x254c41);})[_0x541c('0xd')](function(){return _0x4167f5(null,_0x254c41);});}}else{return _0x4167f5(null,![],{'message':_0x541c('0x15')});}}else{return utils[_0x541c('0x19')](_0x254c41,0x0,![],null)[_0x541c('0xd')](function(){return utils['getLicense'](_0x254c41);})[_0x541c('0xd')](function(){return _0x4167f5(null,_0x254c41);})[_0x541c('0x1b')](function(_0x184e97){return _0x4167f5(null,![],_0x184e97);});}}else{if(_0x254c41[_0x541c('0x16')]){return _0x4167f5(null,![],{'message':_0x541c('0x15')});}else{return utils[_0x541c('0x1a')](_0x254c41)[_0x541c('0xd')](function(){return _0x4167f5(null,_0x254c41);});}}}});})[_0x541c('0x1b')](function(_0x3e2729){return _0x4167f5(null,![],_0x3e2729);});}function sendServiceMail(_0x353f3c){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x541c('0xe'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x541c('0x1c'),'include':[{'model':db[_0x541c('0x1d')],'as':'CloudProvider'}]}]})[_0x541c('0xd')](function(_0x42e3af){if(!_0x42e3af){throw new Error(_0x541c('0x1e'));}var _0x2dc0c3=_0x42e3af['getSmtpOptions']();var _0x12c62e={'account':_0x2dc0c3,'message':_[_0x541c('0x1f')]({'from':util[_0x541c('0x20')]('\x22%s\x22\x20<%s>',_0x42e3af[_0x541c('0xe')],_0x42e3af[_0x541c('0x21')]||_0x42e3af[_0x541c('0x1c')][_0x541c('0x11')])},_0x353f3c)};return client[_0x541c('0x22')](_0x541c('0x23'),_0x12c62e);})[_0x541c('0xd')](function(_0x2a5d48){if(_0x2a5d48[_0x541c('0x24')]){throw new Error(util[_0x541c('0x20')](_0x541c('0x25'),_0x2a5d48['error'][_0x541c('0x26')]||JSON[_0x541c('0x27')](_0x2a5d48[_0x541c('0x24')])));}return!![];});}function handleError(_0x37060d,_0x5945c8,_0x5aed25){return _0x37060d['status'](_0x5945c8||0x1f4)[_0x541c('0x28')]({'message':_0x5aed25?_0x5aed25['message']||_0x5aed25:''});}exports[_0x541c('0x29')]=function(_0x2ba9b2,_0x10bde5,_0x5794ee){passport[_0x541c('0x2a')](_0x541c('0x2b'),function(_0x1ca4a6,_0x3406b8,_0x43ec4d){var _0xa48e0=_0x1ca4a6||_0x43ec4d;if(_0xa48e0){return handleError(_0x10bde5,0x191,_0xa48e0);}if(!_0x3406b8){return handleError(_0x10bde5,0x194,{'message':_0x541c('0x2c')});}else{var _0x1a2ed3={'payload':{'id':_0x3406b8['id'],'role':_0x3406b8[_0x541c('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0x541c('0x2e')](_0x1a2ed3)[_0x541c('0xd')](function(_0x1109e1){_0x10bde5[_0x541c('0x2f')]({'id':_0x3406b8['id'],'token':_0x1109e1,'statusCall':'','isAlreadyLogged':_0x3406b8['online']});});}})(_0x2ba9b2,_0x10bde5,_0x5794ee);};exports[_0x541c('0x30')]=function(_0x24ff22,_0x148e33){if(!_0x24ff22[_0x541c('0x31')][_0x541c('0x21')]){return handleError(_0x148e33,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x554808=rs[_0x541c('0x32')]();_0x24ff22['body'][_0x541c('0x21')]=_0x24ff22[_0x541c('0x31')][_0x541c('0x21')][_0x541c('0x33')]()['toLowerCase']();var _0x18ee1d;return db['Setting'][_0x541c('0x34')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x541c('0xd')](function(_0x4d6711){_0x18ee1d=_0x4d6711;return db[_0x541c('0x35')][_0x541c('0x36')]({'where':{'email':_0x24ff22[_0x541c('0x31')]['email']}});})[_0x541c('0xd')](function(_0x21d232){if(!_0x21d232){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x21d232[_0x541c('0x14')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x21d232[_0x541c('0x16')]){if(moment(_0x21d232[_0x541c('0x10')])['add'](_0x18ee1d[_0x541c('0xc')],_0x541c('0x18'))>moment()){throw new Error(_0x541c('0x37'));}else{_0x21d232[_0x541c('0x16')]=![];_0x21d232[_0x541c('0x10')]=null;}}_0x21d232[_0x541c('0x38')]=_0x554808;_0x21d232[_0x541c('0x39')]=Date[_0x541c('0x3a')]()+0x36ee80;return _0x21d232[_0x541c('0x3b')]();})[_0x541c('0xd')](function(){return sendServiceMail({'to':_0x24ff22[_0x541c('0x31')][_0x541c('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x541c('0x3c')+_0x541c('0x3d')+_0x541c('0x3e')+_0x24ff22[_0x541c('0x3f')][_0x541c('0x40')]+'/reset/'+_0x554808+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x541c('0xd')](function(){_0x148e33[_0x541c('0x41')](0xc8)[_0x541c('0x28')]({'message':'Reset\x20Email\x20sent!'});})[_0x541c('0x1b')](function(_0x1b1b48){return handleError(_0x148e33,0x1f4,_0x1b1b48);});};exports['reset']=function(_0x1be986,_0x462098){return db[_0x541c('0x35')]['find']({'where':{'resetPasswordToken':_0x1be986[_0x541c('0x42')][_0x541c('0x43')],'resetPasswordExpires':{'$gt':Date[_0x541c('0x3a')]()}}})[_0x541c('0xd')](function(_0x115c4f){if(!_0x115c4f){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x541c('0x34')]({'attributes':['id',_0x541c('0x44'),_0x541c('0x45'),_0x541c('0x46')]})[_0x541c('0xd')](function(_0xfd358f){if(_0xfd358f[_0x541c('0x44')])authService[_0x541c('0x47')](_0x1be986['body'][_0x541c('0x48')]);if(!_0xfd358f['enforcePasswordHistory']||!_0x115c4f[_0x541c('0x49')])return _0x115c4f;authService[_0x541c('0x4a')](_0x1be986[_0x541c('0x31')][_0x541c('0x48')],_0x115c4f[_0x541c('0x49')],_0xfd358f[_0x541c('0x46')]);return _0x115c4f;})[_0x541c('0xd')](function(){_0x115c4f[_0x541c('0x48')]=_0x1be986[_0x541c('0x31')]['password'];_0x115c4f[_0x541c('0x38')]=null;_0x115c4f[_0x541c('0x39')]=null;return _0x115c4f[_0x541c('0x3b')]();});})[_0x541c('0xd')](function(){_0x462098['status'](0xc8)[_0x541c('0x28')]({'message':'Password\x20reset!'});})['catch'](function(_0x3155a5){return handleError(_0x462098,0x1f4,_0x3155a5);});};passport[_0x541c('0x4b')](_0x541c('0x2b'),new LocalStrategy({'usernameField':_0x541c('0xe'),'passwordField':_0x541c('0x48')},function(_0xb34857,_0x2dbd39,_0x4a8c86){return localAuthenticate(db['User'],_0xb34857,_0x2dbd39,_0x4a8c86);})); \ No newline at end of file +var _0x55ac=['Setting','findOne','blockDuration','name','role','disabled','blockedAt','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blocked','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','status','Reset\x20Email\x20sent!','params','now','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','password','previousPasswords','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils'];(function(_0x1a5bc2,_0x555317){var _0x35b5c9=function(_0x459486){while(--_0x459486){_0x1a5bc2['push'](_0x1a5bc2['shift']());}};_0x35b5c9(++_0x555317);}(_0x55ac,0x8c));var _0xc55a=function(_0x3d9ab1,_0x20dcf3){_0x3d9ab1=_0x3d9ab1-0x0;var _0x5ecefe=_0x55ac[_0x3d9ab1];return _0x5ecefe;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xc55a('0x0'));var _=require(_0xc55a('0x1'));var rs=require(_0xc55a('0x2'));var moment=require(_0xc55a('0x3'));var db=require(_0xc55a('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc55a('0x5'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x108e3d,_0x37b72d,_0xebd0be,_0x4baa64){var _0x103bbd,_0x544534;return db[_0xc55a('0x6')][_0xc55a('0x7')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc55a('0x8')],'raw':!![]})['then'](function(_0x401f11){_0x103bbd=_0x401f11;return _0x108e3d[_0xc55a('0x7')]({'attributes':['id',_0xc55a('0x9'),'password','salt',_0xc55a('0xa'),_0xc55a('0xb'),'blocked',_0xc55a('0xc'),_0xc55a('0xd')],'where':{'name':_0x37b72d,'role':{'$or':['admin',_0xc55a('0xe'),_0xc55a('0xf')]}}});})[_0xc55a('0x10')](function(_0x4d0b61){if(!_0x4d0b61||_0x4d0b61&&_0x4d0b61[_0xc55a('0x9')]!==_0x37b72d){throw new Error(_0xc55a('0x11'));}else{_0x544534=_0x4d0b61;return _0x544534;}})['then'](function(){_0x544534[_0xc55a('0x12')](_0xebd0be,function(_0x46ae5a,_0x4ab8b3){var _0x4672c7=_0x544534['loginAttempts']+0x1;if(_0x46ae5a){return _0x4baa64(_0x46ae5a);}else if(!_0x4ab8b3){if(_0x544534[_0xc55a('0xb')]){return _0x4baa64(null,![],{'message':_0xc55a('0x11')});}else if(_0x103bbd[_0xc55a('0x13')]>0x0){if(_0x544534[_0xc55a('0x14')]){if(_0x103bbd[_0xc55a('0x8')]>0x0){if(moment(_0x544534[_0xc55a('0xc')])[_0xc55a('0x15')](_0x103bbd[_0xc55a('0x8')],_0xc55a('0x16'))>moment()){return _0x4baa64(null,![],{'message':_0xc55a('0x11')});}else{return utils['clearBlockUser'](_0x544534,_0x4672c7,![],null)['then'](function(){return _0x4baa64(null,![],{'message':_0xc55a('0x11')});});}}else{return _0x4baa64(null,![],{'message':_0xc55a('0x11')});}}else{if(_0x4672c7>=_0x103bbd['allowedLoginAttempts']){return utils[_0xc55a('0x17')](_0x544534,0x0,!![],moment())[_0xc55a('0x10')](function(){return _0x4baa64(null,![],{'message':_0xc55a('0x11')});});}else{return utils[_0xc55a('0x17')](_0x544534,_0x4672c7,![],null)['then'](function(){return _0x4baa64(null,![],{'message':_0xc55a('0x11')});});}}}else{return _0x4baa64(null,![],{'message':_0xc55a('0x11')});}}else{if(_0x544534['disabled']){return _0x4baa64(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x103bbd[_0xc55a('0x13')]>0x0){if(_0x544534[_0xc55a('0x14')]){if(_0x103bbd[_0xc55a('0x8')]>0x0){if(moment(_0x544534[_0xc55a('0xc')])[_0xc55a('0x15')](_0x103bbd[_0xc55a('0x8')],_0xc55a('0x16'))>moment()){return _0x4baa64(null,![],{'message':_0xc55a('0x11')});}else{return utils[_0xc55a('0x17')](_0x544534,0x0,![],null)[_0xc55a('0x10')](function(){return utils[_0xc55a('0x18')](_0x544534);})[_0xc55a('0x10')](function(){return _0x4baa64(null,_0x544534);});}}else{return _0x4baa64(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc55a('0x17')](_0x544534,0x0,![],null)[_0xc55a('0x10')](function(){return utils[_0xc55a('0x18')](_0x544534);})[_0xc55a('0x10')](function(){return _0x4baa64(null,_0x544534);})[_0xc55a('0x19')](function(_0x3bec24){return _0x4baa64(null,![],_0x3bec24);});}}else{if(_0x544534['blocked']){return _0x4baa64(null,![],{'message':_0xc55a('0x11')});}else{return utils[_0xc55a('0x18')](_0x544534)[_0xc55a('0x10')](function(){return _0x4baa64(null,_0x544534);});}}}});})['catch'](function(_0x49bf1a){return _0x4baa64(null,![],_0x49bf1a);});}function sendServiceMail(_0x5aad8e){return db[_0xc55a('0x1a')][_0xc55a('0x1b')]({'where':{'service':!![]},'attributes':['id',_0xc55a('0x9'),_0xc55a('0x1c')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0xc55a('0x1d')],'as':_0xc55a('0x1d')}]}]})[_0xc55a('0x10')](function(_0x181521){if(!_0x181521){throw new Error(_0xc55a('0x1e'));}var _0x472bfd=_0x181521[_0xc55a('0x1f')]();var _0x105042={'account':_0x472bfd,'message':_[_0xc55a('0x20')]({'from':util[_0xc55a('0x21')]('\x22%s\x22\x20<%s>',_0x181521[_0xc55a('0x9')],_0x181521['email']||_0x181521[_0xc55a('0x22')][_0xc55a('0xe')])},_0x5aad8e)};return client[_0xc55a('0x23')](_0xc55a('0x24'),_0x105042);})[_0xc55a('0x10')](function(_0x389b45){if(_0x389b45[_0xc55a('0x25')]){throw new Error(util[_0xc55a('0x21')](_0xc55a('0x26'),_0x389b45[_0xc55a('0x25')][_0xc55a('0x27')]||JSON[_0xc55a('0x28')](_0x389b45['error'])));}return!![];});}function handleError(_0x48d8de,_0x8b9563,_0x2888b9){return _0x48d8de['status'](_0x8b9563||0x1f4)[_0xc55a('0x29')]({'message':_0x2888b9?_0x2888b9['message']||_0x2888b9:''});}exports['login']=function(_0x3ef243,_0x1fa6a5,_0xbe1b13){passport[_0xc55a('0x12')](_0xc55a('0x2a'),function(_0x3b6d37,_0x4e2f98,_0x273e5f){var _0x56fe6a=_0x3b6d37||_0x273e5f;if(_0x56fe6a){return handleError(_0x1fa6a5,0x191,_0x56fe6a);}if(!_0x4e2f98){return handleError(_0x1fa6a5,0x194,{'message':_0xc55a('0x2b')});}else{var _0x21284f={'payload':{'id':_0x4e2f98['id'],'role':_0x4e2f98[_0xc55a('0xa')]},'options':{'expiresIn':0x15180}};return authService[_0xc55a('0x2c')](_0x21284f)[_0xc55a('0x10')](function(_0x2d62f1){_0x1fa6a5['json']({'id':_0x4e2f98['id'],'token':_0x2d62f1,'statusCall':'','isAlreadyLogged':_0x4e2f98['online']});});}})(_0x3ef243,_0x1fa6a5,_0xbe1b13);};exports[_0xc55a('0x2d')]=function(_0x3e5197,_0xb02b60){if(!_0x3e5197[_0xc55a('0x2e')]['email']){return handleError(_0xb02b60,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3ea6ba=rs[_0xc55a('0x2f')]();_0x3e5197['body']['email']=_0x3e5197[_0xc55a('0x2e')][_0xc55a('0x1c')][_0xc55a('0x30')]()['toLowerCase']();var _0x3b929a;return db[_0xc55a('0x6')][_0xc55a('0x7')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xc55a('0x10')](function(_0x4cc034){_0x3b929a=_0x4cc034;return db[_0xc55a('0x31')]['find']({'where':{'email':_0x3e5197[_0xc55a('0x2e')][_0xc55a('0x1c')]}});})[_0xc55a('0x10')](function(_0x35d437){if(!_0x35d437){throw new Error(_0xc55a('0x32'));}if(_0x35d437[_0xc55a('0xb')]){throw new Error(_0xc55a('0x33'));}if(_0x35d437[_0xc55a('0x14')]){if(moment(_0x35d437['blockedAt'])['add'](_0x3b929a[_0xc55a('0x8')],_0xc55a('0x16'))>moment()){throw new Error(_0xc55a('0x34'));}else{_0x35d437['blocked']=![];_0x35d437['blockedAt']=null;}}_0x35d437['resetPasswordToken']=_0x3ea6ba;_0x35d437[_0xc55a('0x35')]=Date['now']()+0x36ee80;return _0x35d437[_0xc55a('0x36')]();})[_0xc55a('0x10')](function(){return sendServiceMail({'to':_0x3e5197[_0xc55a('0x2e')][_0xc55a('0x1c')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc55a('0x37')+'https://'+_0x3e5197[_0xc55a('0x38')][_0xc55a('0x39')]+_0xc55a('0x3a')+_0x3ea6ba+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0xb02b60[_0xc55a('0x3b')](0xc8)[_0xc55a('0x29')]({'message':_0xc55a('0x3c')});})[_0xc55a('0x19')](function(_0x1ab4c5){return handleError(_0xb02b60,0x1f4,_0x1ab4c5);});};exports['reset']=function(_0x523e4f,_0xcf7278){return db[_0xc55a('0x31')][_0xc55a('0x1b')]({'where':{'resetPasswordToken':_0x523e4f[_0xc55a('0x3d')]['token'],'resetPasswordExpires':{'$gt':Date[_0xc55a('0x3e')]()}}})[_0xc55a('0x10')](function(_0x2ce6b5){if(!_0x2ce6b5){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc55a('0x6')]['findOne']({'attributes':['id','securePassword',_0xc55a('0x3f'),_0xc55a('0x40')]})['then'](function(_0x3223f5){if(_0x3223f5[_0xc55a('0x41')])authService[_0xc55a('0x42')](_0x523e4f[_0xc55a('0x2e')][_0xc55a('0x43')]);if(!_0x3223f5[_0xc55a('0x3f')]||!_0x2ce6b5[_0xc55a('0x44')])return _0x2ce6b5;authService[_0xc55a('0x45')](_0x523e4f[_0xc55a('0x2e')]['password'],_0x2ce6b5['previousPasswords'],_0x3223f5[_0xc55a('0x40')]);return _0x2ce6b5;})[_0xc55a('0x10')](function(){_0x2ce6b5[_0xc55a('0x43')]=_0x523e4f[_0xc55a('0x2e')][_0xc55a('0x43')];_0x2ce6b5[_0xc55a('0x46')]=null;_0x2ce6b5[_0xc55a('0x35')]=null;return _0x2ce6b5[_0xc55a('0x36')]();});})[_0xc55a('0x10')](function(){_0xcf7278[_0xc55a('0x3b')](0xc8)['send']({'message':_0xc55a('0x47')});})[_0xc55a('0x19')](function(_0x28f112){return handleError(_0xcf7278,0x1f4,_0x28f112);});};passport[_0xc55a('0x48')](_0xc55a('0x2a'),new LocalStrategy({'usernameField':_0xc55a('0x9'),'passwordField':'password'},function(_0x17f0f7,_0x10ba9a,_0x4e1a63){return localAuthenticate(db[_0xc55a('0x31')],_0x17f0f7,_0x10ba9a,_0x4e1a63);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 8d9285f..e85b758 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 _0xf935=['reset','exports','express','Router','./authLocal.controller','post','login','forgot'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xf935,0x14a));var _0x5f93=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf935[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x5f93('0x0'));var router=express[_0x5f93('0x1')]();var controller=require(_0x5f93('0x2'));router[_0x5f93('0x3')]('/',controller[_0x5f93('0x4')]);router[_0x5f93('0x3')]('/forgot',controller[_0x5f93('0x5')]);router['post']('/reset/:token',controller[_0x5f93('0x6')]);module[_0x5f93('0x7')]=router; \ No newline at end of file +var _0x23be=['Router','login','post','/forgot','forgot','/reset/:token','reset','express'];(function(_0x4eea34,_0x4bb8d1){var _0x459caf=function(_0x334735){while(--_0x334735){_0x4eea34['push'](_0x4eea34['shift']());}};_0x459caf(++_0x4bb8d1);}(_0x23be,0x1ef));var _0xe23b=function(_0x5264c6,_0x5100e6){_0x5264c6=_0x5264c6-0x0;var _0x24230d=_0x23be[_0x5264c6];return _0x24230d;};'use strict';var express=require(_0xe23b('0x0'));var router=express[_0xe23b('0x1')]();var controller=require('./authLocal.controller');router['post']('/',controller[_0xe23b('0x2')]);router[_0xe23b('0x3')](_0xe23b('0x4'),controller[_0xe23b('0x5')]);router['post'](_0xe23b('0x6'),controller[_0xe23b('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 94f0254..2ca6313 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 _0xc620=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xc620,0x12a));var _0x0c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc620[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0c62('0x0'));module[_0x0c62('0x1')]={'name':{'type':Sequelize[_0x0c62('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0c62('0x2')]},'description':{'type':Sequelize[_0x0c62('0x2')]},'status':{'type':Sequelize[_0x0c62('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0c62('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xa68f=['exports','STRING','INTEGER','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa68f,0x8f));var _0xfa68=function(_0xec6d30,_0xde2baf){_0xec6d30=_0xec6d30-0x0;var _0x42d5b8=_0xa68f[_0xec6d30];return _0x42d5b8;};'use strict';var Sequelize=require(_0xfa68('0x0'));module[_0xfa68('0x1')]={'name':{'type':Sequelize[_0xfa68('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfa68('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfa68('0x3')],'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 9a4316f..36bcb45 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 _0xdba8=['keys','includeAll','find','create','body','addConditions','Condition','ids','omit','getConditions','findOne','filter','addActions','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','Automation','include','findAll','catch','params'];(function(_0x64c2e7,_0x4f757c){var _0x3ecb19=function(_0x53667d){while(--_0x53667d){_0x64c2e7['push'](_0x64c2e7['shift']());}};_0x3ecb19(++_0x4f757c);}(_0xdba8,0xb5));var _0x8dba=function(_0x105063,_0x36b9e4){_0x105063=_0x105063-0x0;var _0x92cd2b=_0xdba8[_0x105063];return _0x92cd2b;};'use strict';var emlformat=require(_0x8dba('0x0'));var rimraf=require(_0x8dba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8dba('0x2'));var rp=require(_0x8dba('0x3'));var moment=require(_0x8dba('0x4'));var BPromise=require(_0x8dba('0x5'));var Mustache=require(_0x8dba('0x6'));var util=require(_0x8dba('0x7'));var path=require('path');var sox=require(_0x8dba('0x8'));var csv=require(_0x8dba('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8dba('0xa'));var _=require(_0x8dba('0xb'));var squel=require('squel');var crypto=require(_0x8dba('0xc'));var jsforce=require(_0x8dba('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8dba('0xe'));var Papa=require(_0x8dba('0xf'));var Redis=require('ioredis');var authService=require(_0x8dba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8dba('0x11'));var hardwareService=require(_0x8dba('0x12'));var logger=require(_0x8dba('0x13'))('api');var utils=require(_0x8dba('0x14'));var config=require(_0x8dba('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8dba('0x16'))['db'];function respondWithStatusCode(_0x279430,_0x4764b3){_0x4764b3=_0x4764b3||0xcc;return function(_0x55ba75){if(_0x55ba75){return _0x279430[_0x8dba('0x17')](_0x4764b3);}return _0x279430[_0x8dba('0x18')](_0x4764b3)['end']();};}function respondWithResult(_0x446f76,_0x5704aa){_0x5704aa=_0x5704aa||0xc8;return function(_0x28f1b0){if(_0x28f1b0){return _0x446f76['status'](_0x5704aa)['json'](_0x28f1b0);}};}function respondWithFilteredResult(_0x316b8a,_0x486b56){return function(_0x221600){if(_0x221600){var _0xd4ab42=typeof _0x486b56[_0x8dba('0x19')]===_0x8dba('0x1a')&&typeof _0x486b56[_0x8dba('0x1b')]==='undefined';var _0x57cdb2=_0x221600[_0x8dba('0x1c')];var _0x4da06d=_0xd4ab42?0x0:_0x486b56[_0x8dba('0x19')];var _0x526605=_0xd4ab42?_0x221600['count']:_0x486b56['offset']+_0x486b56[_0x8dba('0x1b')];var _0x49d058;if(_0x526605>=_0x57cdb2){_0x526605=_0x57cdb2;_0x49d058=0xc8;}else{_0x49d058=0xce;}_0x316b8a[_0x8dba('0x18')](_0x49d058);return _0x316b8a[_0x8dba('0x1d')](_0x8dba('0x1e'),_0x4da06d+'-'+_0x526605+'/'+_0x57cdb2)[_0x8dba('0x1f')](_0x221600);}return null;};}function patchUpdates(_0x42d948){return function(_0x4f51ce){try{jsonpatch[_0x8dba('0x20')](_0x4f51ce,_0x42d948,!![]);}catch(_0x27f3f1){return BPromise[_0x8dba('0x21')](_0x27f3f1);}return _0x4f51ce[_0x8dba('0x22')]();};}function saveUpdates(_0x30ac0d,_0x3cc0a8){return function(_0x1557bc){if(_0x1557bc){return _0x1557bc[_0x8dba('0x23')](_0x30ac0d)['then'](function(_0x5b6110){return _0x5b6110;});}return null;};}function removeEntity(_0x29f0c0,_0x3250c2){return function(_0x399404){if(_0x399404){return _0x399404[_0x8dba('0x24')]()[_0x8dba('0x25')](function(){_0x29f0c0[_0x8dba('0x18')](0xcc)[_0x8dba('0x26')]();});}};}function handleEntityNotFound(_0x5ea6e1,_0x440443){return function(_0x2b8b14){if(!_0x2b8b14){_0x5ea6e1[_0x8dba('0x17')](0x194);}return _0x2b8b14;};}function handleError(_0x13c87d,_0x516d90){_0x516d90=_0x516d90||0x1f4;return function(_0x30de2a){logger[_0x8dba('0x27')](_0x30de2a[_0x8dba('0x28')]);if(_0x30de2a['name']){delete _0x30de2a[_0x8dba('0x29')];}_0x13c87d[_0x8dba('0x18')](_0x516d90)['send'](_0x30de2a);};}exports[_0x8dba('0x2a')]=function(_0x22cb90,_0x529bed){var _0x328837={},_0x30adcb={},_0x44c23a={'count':0x0,'rows':[]};var _0x37c2a2=_[_0x8dba('0x2b')](db['Automation'][_0x8dba('0x2c')],function(_0x3add46){return{'name':_0x3add46[_0x8dba('0x2d')],'type':_0x3add46['type'][_0x8dba('0x2e')]};});_0x30adcb[_0x8dba('0x2f')]=_['map'](_0x37c2a2,_0x8dba('0x29'));_0x30adcb[_0x8dba('0x30')]=_['keys'](_0x22cb90['query']);_0x30adcb[_0x8dba('0x31')]=_[_0x8dba('0x32')](_0x30adcb['model'],_0x30adcb[_0x8dba('0x30')]);_0x328837[_0x8dba('0x33')]=_[_0x8dba('0x32')](_0x30adcb[_0x8dba('0x2f')],qs[_0x8dba('0x34')](_0x22cb90['query'][_0x8dba('0x34')]));_0x328837[_0x8dba('0x33')]=_0x328837[_0x8dba('0x33')][_0x8dba('0x35')]?_0x328837[_0x8dba('0x33')]:_0x30adcb[_0x8dba('0x2f')];if(!_0x22cb90[_0x8dba('0x30')][_0x8dba('0x36')](_0x8dba('0x37'))){_0x328837['limit']=qs[_0x8dba('0x1b')](_0x22cb90[_0x8dba('0x30')][_0x8dba('0x1b')]);_0x328837[_0x8dba('0x19')]=qs[_0x8dba('0x19')](_0x22cb90['query'][_0x8dba('0x19')]);}_0x328837[_0x8dba('0x38')]=qs['sort'](_0x22cb90[_0x8dba('0x30')][_0x8dba('0x39')]);_0x328837[_0x8dba('0x3a')]=qs[_0x8dba('0x31')](_[_0x8dba('0x3b')](_0x22cb90[_0x8dba('0x30')],_0x30adcb[_0x8dba('0x31')]),_0x37c2a2);if(_0x22cb90['query']['filter']){_0x328837[_0x8dba('0x3a')]=_[_0x8dba('0x3c')](_0x328837[_0x8dba('0x3a')],{'$or':_[_0x8dba('0x2b')](_0x37c2a2,function(_0x5823fb){if(_0x5823fb[_0x8dba('0x3d')]!=='VIRTUAL'){var _0x22f98a={};_0x22f98a[_0x5823fb[_0x8dba('0x29')]]={'$like':'%'+_0x22cb90[_0x8dba('0x30')]['filter']+'%'};return _0x22f98a;}})});}_0x328837=_[_0x8dba('0x3c')]({},_0x328837,_0x22cb90[_0x8dba('0x3e')]);var _0x153829={'where':_0x328837[_0x8dba('0x3a')]};return db[_0x8dba('0x3f')]['count'](_0x153829)['then'](function(_0x8b25cb){_0x44c23a['count']=_0x8b25cb;if(_0x22cb90[_0x8dba('0x30')]['includeAll']){_0x328837[_0x8dba('0x40')]=[{'all':!![]}];}return db[_0x8dba('0x3f')][_0x8dba('0x41')](_0x328837);})['then'](function(_0x58eb58){_0x44c23a['rows']=_0x58eb58;return _0x44c23a;})[_0x8dba('0x25')](respondWithFilteredResult(_0x529bed,_0x328837))[_0x8dba('0x42')](handleError(_0x529bed,null));};exports['show']=function(_0x1a6b36,_0x17e170){var _0xdd081b={'raw':![],'where':{'id':_0x1a6b36[_0x8dba('0x43')]['id']}},_0x579d24={};_0x579d24[_0x8dba('0x2f')]=_[_0x8dba('0x44')](db[_0x8dba('0x3f')][_0x8dba('0x2c')]);_0x579d24[_0x8dba('0x30')]=_[_0x8dba('0x44')](_0x1a6b36[_0x8dba('0x30')]);_0x579d24['filters']=_[_0x8dba('0x32')](_0x579d24[_0x8dba('0x2f')],_0x579d24[_0x8dba('0x30')]);_0xdd081b['attributes']=_[_0x8dba('0x32')](_0x579d24['model'],qs[_0x8dba('0x34')](_0x1a6b36[_0x8dba('0x30')]['fields']));_0xdd081b['attributes']=_0xdd081b[_0x8dba('0x33')][_0x8dba('0x35')]?_0xdd081b[_0x8dba('0x33')]:_0x579d24[_0x8dba('0x2f')];if(_0x1a6b36[_0x8dba('0x30')][_0x8dba('0x45')]){_0xdd081b[_0x8dba('0x40')]=[{'all':!![]}];}_0xdd081b=_[_0x8dba('0x3c')]({},_0xdd081b,_0x1a6b36[_0x8dba('0x3e')]);return db[_0x8dba('0x3f')][_0x8dba('0x46')](_0xdd081b)[_0x8dba('0x25')](handleEntityNotFound(_0x17e170,null))[_0x8dba('0x25')](respondWithResult(_0x17e170,null))[_0x8dba('0x42')](handleError(_0x17e170,null));};exports[_0x8dba('0x47')]=function(_0x539ea7,_0x5bee96){return db[_0x8dba('0x3f')][_0x8dba('0x47')](_0x539ea7[_0x8dba('0x48')],{})[_0x8dba('0x25')](respondWithResult(_0x5bee96,0xc9))[_0x8dba('0x42')](handleError(_0x5bee96,null));};exports['update']=function(_0x1208e9,_0x54b9ce){if(_0x1208e9['body']['id']){delete _0x1208e9['body']['id'];}return db[_0x8dba('0x3f')][_0x8dba('0x46')]({'where':{'id':_0x1208e9['params']['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x54b9ce,null))[_0x8dba('0x25')](saveUpdates(_0x1208e9[_0x8dba('0x48')],null))[_0x8dba('0x25')](respondWithResult(_0x54b9ce,null))['catch'](handleError(_0x54b9ce,null));};exports[_0x8dba('0x24')]=function(_0x1b8182,_0x168702){return db['Automation'][_0x8dba('0x46')]({'where':{'id':_0x1b8182[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x168702,null))[_0x8dba('0x25')](removeEntity(_0x168702,null))['catch'](handleError(_0x168702,null));};exports[_0x8dba('0x49')]=function(_0x3d9dc1,_0x22c909,_0x5a2b96){return db[_0x8dba('0x4a')][_0x8dba('0x46')]({'where':{'id':_0x3d9dc1[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x22c909,null))['then'](function(_0x480994){if(_0x480994){return _0x480994[_0x8dba('0x49')](_0x3d9dc1[_0x8dba('0x48')][_0x8dba('0x4b')],_[_0x8dba('0x4c')](_0x3d9dc1[_0x8dba('0x48')],[_0x8dba('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x22c909,null))[_0x8dba('0x42')](handleError(_0x22c909,null));};exports[_0x8dba('0x4d')]=function(_0x4fa8ab,_0x18ea6b,_0x315e93){var _0x44d63f={};var _0x588f29={};var _0x584592;var _0x5db280;return db[_0x8dba('0x3f')][_0x8dba('0x4e')]({'where':{'id':_0x4fa8ab[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x18ea6b,null))[_0x8dba('0x25')](function(_0x4627d3){if(_0x4627d3){_0x584592=_0x4627d3;_0x588f29[_0x8dba('0x2f')]=_[_0x8dba('0x44')](db[_0x8dba('0x4a')][_0x8dba('0x2c')]);_0x588f29[_0x8dba('0x30')]=_[_0x8dba('0x44')](_0x4fa8ab[_0x8dba('0x30')]);_0x588f29[_0x8dba('0x31')]=_['intersection'](_0x588f29[_0x8dba('0x2f')],_0x588f29[_0x8dba('0x30')]);_0x44d63f[_0x8dba('0x33')]=_[_0x8dba('0x32')](_0x588f29[_0x8dba('0x2f')],qs[_0x8dba('0x34')](_0x4fa8ab[_0x8dba('0x30')][_0x8dba('0x34')]));_0x44d63f[_0x8dba('0x33')]=_0x44d63f['attributes'][_0x8dba('0x35')]?_0x44d63f[_0x8dba('0x33')]:_0x588f29[_0x8dba('0x2f')];_0x44d63f[_0x8dba('0x38')]=qs[_0x8dba('0x39')](_0x4fa8ab[_0x8dba('0x30')]['sort']);_0x44d63f['where']=qs[_0x8dba('0x31')](_['pick'](_0x4fa8ab[_0x8dba('0x30')],_0x588f29[_0x8dba('0x31')]));if(_0x4fa8ab['query'][_0x8dba('0x4f')]){_0x44d63f[_0x8dba('0x3a')]=_[_0x8dba('0x3c')](_0x44d63f[_0x8dba('0x3a')],{'$or':_[_0x8dba('0x2b')](_0x44d63f[_0x8dba('0x33')],function(_0x1a9fc9){var _0x2a4b8a={};_0x2a4b8a[_0x1a9fc9]={'$like':'%'+_0x4fa8ab['query'][_0x8dba('0x4f')]+'%'};return _0x2a4b8a;})});}_0x44d63f=_[_0x8dba('0x3c')]({},_0x44d63f,_0x4fa8ab['options']);return _0x584592[_0x8dba('0x4d')](_0x44d63f);}})[_0x8dba('0x25')](function(_0x4ac7df){if(_0x4ac7df){_0x5db280=_0x4ac7df[_0x8dba('0x35')];if(!_0x4fa8ab[_0x8dba('0x30')][_0x8dba('0x36')](_0x8dba('0x37'))){_0x44d63f[_0x8dba('0x1b')]=qs['limit'](_0x4fa8ab[_0x8dba('0x30')]['limit']);_0x44d63f['offset']=qs[_0x8dba('0x19')](_0x4fa8ab['query'][_0x8dba('0x19')]);}return _0x584592[_0x8dba('0x4d')](_0x44d63f);}})[_0x8dba('0x25')](function(_0x1fe002){if(_0x1fe002){return _0x1fe002?{'count':_0x5db280,'rows':_0x1fe002}:null;}})[_0x8dba('0x25')](respondWithResult(_0x18ea6b,null))[_0x8dba('0x42')](handleError(_0x18ea6b,null));};exports[_0x8dba('0x50')]=function(_0x25c07f,_0x45f18e,_0x155216){return db[_0x8dba('0x51')]['find']({'where':{'id':_0x25c07f[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x45f18e,null))['then'](function(_0x16bcf0){if(_0x16bcf0){return _0x16bcf0['addActions'](_0x25c07f[_0x8dba('0x48')][_0x8dba('0x4b')],_[_0x8dba('0x4c')](_0x25c07f[_0x8dba('0x48')],[_0x8dba('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x45f18e,null))[_0x8dba('0x42')](handleError(_0x45f18e,null));};exports[_0x8dba('0x52')]=function(_0x1c7cbe,_0x3aab2e,_0x126a83){var _0xb3d799={};var _0x56f728={};var _0xc50342;var _0x27e3cb;return db[_0x8dba('0x3f')][_0x8dba('0x4e')]({'where':{'id':_0x1c7cbe[_0x8dba('0x43')]['id']}})[_0x8dba('0x25')](handleEntityNotFound(_0x3aab2e,null))['then'](function(_0x34d594){if(_0x34d594){_0xc50342=_0x34d594;_0x56f728[_0x8dba('0x2f')]=_['keys'](db['Action']['rawAttributes']);_0x56f728[_0x8dba('0x30')]=_[_0x8dba('0x44')](_0x1c7cbe['query']);_0x56f728[_0x8dba('0x31')]=_[_0x8dba('0x32')](_0x56f728['model'],_0x56f728[_0x8dba('0x30')]);_0xb3d799[_0x8dba('0x33')]=_[_0x8dba('0x32')](_0x56f728[_0x8dba('0x2f')],qs[_0x8dba('0x34')](_0x1c7cbe['query'][_0x8dba('0x34')]));_0xb3d799[_0x8dba('0x33')]=_0xb3d799[_0x8dba('0x33')][_0x8dba('0x35')]?_0xb3d799['attributes']:_0x56f728[_0x8dba('0x2f')];_0xb3d799['order']=qs[_0x8dba('0x39')](_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x39')]);_0xb3d799['where']=qs[_0x8dba('0x31')](_[_0x8dba('0x3b')](_0x1c7cbe[_0x8dba('0x30')],_0x56f728[_0x8dba('0x31')]));if(_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x4f')]){_0xb3d799['where']=_[_0x8dba('0x3c')](_0xb3d799[_0x8dba('0x3a')],{'$or':_['map'](_0xb3d799[_0x8dba('0x33')],function(_0x2747c9){var _0x376578={};_0x376578[_0x2747c9]={'$like':'%'+_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x4f')]+'%'};return _0x376578;})});}_0xb3d799=_[_0x8dba('0x3c')]({},_0xb3d799,_0x1c7cbe['options']);return _0xc50342[_0x8dba('0x52')](_0xb3d799);}})['then'](function(_0xa05c87){if(_0xa05c87){_0x27e3cb=_0xa05c87['length'];if(!_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x36')](_0x8dba('0x37'))){_0xb3d799[_0x8dba('0x1b')]=qs[_0x8dba('0x1b')](_0x1c7cbe[_0x8dba('0x30')][_0x8dba('0x1b')]);_0xb3d799['offset']=qs['offset'](_0x1c7cbe[_0x8dba('0x30')]['offset']);}return _0xc50342[_0x8dba('0x52')](_0xb3d799);}})['then'](function(_0x14d5d3){if(_0x14d5d3){return _0x14d5d3?{'count':_0x27e3cb,'rows':_0x14d5d3}:null;}})[_0x8dba('0x25')](respondWithResult(_0x3aab2e,null))[_0x8dba('0x42')](handleError(_0x3aab2e,null));}; \ No newline at end of file +var _0xb433=['json','offset','count','set','Content-Range','update','destroy','then','end','sendStatus','error','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','limit','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','addConditions','omit','getConditions','findOne','Condition','order','nolimit','Action','addActions','ids','getActions','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status'];(function(_0xac0463,_0x3d0ebe){var _0x1b7b69=function(_0x5b3617){while(--_0x5b3617){_0xac0463['push'](_0xac0463['shift']());}};_0x1b7b69(++_0x3d0ebe);}(_0xb433,0x126));var _0x3b43=function(_0x4935d3,_0x37bb5b){_0x4935d3=_0x4935d3-0x0;var _0x457d57=_0xb433[_0x4935d3];return _0x457d57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b43('0x0'));var zipdir=require(_0x3b43('0x1'));var jsonpatch=require(_0x3b43('0x2'));var rp=require(_0x3b43('0x3'));var moment=require(_0x3b43('0x4'));var BPromise=require(_0x3b43('0x5'));var Mustache=require('mustache');var util=require(_0x3b43('0x6'));var path=require(_0x3b43('0x7'));var sox=require(_0x3b43('0x8'));var csv=require(_0x3b43('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b43('0xa'));var _=require(_0x3b43('0xb'));var squel=require(_0x3b43('0xc'));var crypto=require(_0x3b43('0xd'));var jsforce=require(_0x3b43('0xe'));var deskjs=require(_0x3b43('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3b43('0x10'));var Papa=require(_0x3b43('0x11'));var Redis=require('ioredis');var authService=require(_0x3b43('0x12'));var qs=require(_0x3b43('0x13'));var as=require(_0x3b43('0x14'));var hardwareService=require(_0x3b43('0x15'));var logger=require(_0x3b43('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x3b43('0x17'));var licenseUtil=require(_0x3b43('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x573d39,_0x4a4bcb){_0x4a4bcb=_0x4a4bcb||0xcc;return function(_0x37d639){if(_0x37d639){return _0x573d39['sendStatus'](_0x4a4bcb);}return _0x573d39[_0x3b43('0x19')](_0x4a4bcb)['end']();};}function respondWithResult(_0xbc951d,_0x7225b9){_0x7225b9=_0x7225b9||0xc8;return function(_0xbf2bf8){if(_0xbf2bf8){return _0xbc951d[_0x3b43('0x19')](_0x7225b9)[_0x3b43('0x1a')](_0xbf2bf8);}};}function respondWithFilteredResult(_0x40f9f8,_0x2835a7){return function(_0xaa4dfc){if(_0xaa4dfc){var _0x4d8fc5=typeof _0x2835a7[_0x3b43('0x1b')]==='undefined'&&typeof _0x2835a7['limit']==='undefined';var _0x1aa86e=_0xaa4dfc[_0x3b43('0x1c')];var _0x1dfd91=_0x4d8fc5?0x0:_0x2835a7[_0x3b43('0x1b')];var _0x47d450=_0x4d8fc5?_0xaa4dfc[_0x3b43('0x1c')]:_0x2835a7[_0x3b43('0x1b')]+_0x2835a7['limit'];var _0xa0b3d8;if(_0x47d450>=_0x1aa86e){_0x47d450=_0x1aa86e;_0xa0b3d8=0xc8;}else{_0xa0b3d8=0xce;}_0x40f9f8['status'](_0xa0b3d8);return _0x40f9f8[_0x3b43('0x1d')](_0x3b43('0x1e'),_0x1dfd91+'-'+_0x47d450+'/'+_0x1aa86e)[_0x3b43('0x1a')](_0xaa4dfc);}return null;};}function patchUpdates(_0x24760c){return function(_0x66761f){try{jsonpatch['apply'](_0x66761f,_0x24760c,!![]);}catch(_0x1638ea){return BPromise['reject'](_0x1638ea);}return _0x66761f['save']();};}function saveUpdates(_0x15abbf,_0x5c38ad){return function(_0x488046){if(_0x488046){return _0x488046[_0x3b43('0x1f')](_0x15abbf)['then'](function(_0x3bc3ee){return _0x3bc3ee;});}return null;};}function removeEntity(_0x4aa5ce,_0x5b3fe1){return function(_0x35d3b0){if(_0x35d3b0){return _0x35d3b0[_0x3b43('0x20')]()[_0x3b43('0x21')](function(){_0x4aa5ce[_0x3b43('0x19')](0xcc)[_0x3b43('0x22')]();});}};}function handleEntityNotFound(_0x26ecfc,_0x1a94fc){return function(_0x31ec39){if(!_0x31ec39){_0x26ecfc[_0x3b43('0x23')](0x194);}return _0x31ec39;};}function handleError(_0x2606c4,_0x28e314){_0x28e314=_0x28e314||0x1f4;return function(_0x1780a0){logger[_0x3b43('0x24')](_0x1780a0['stack']);if(_0x1780a0['name']){delete _0x1780a0[_0x3b43('0x25')];}_0x2606c4['status'](_0x28e314)[_0x3b43('0x26')](_0x1780a0);};}exports[_0x3b43('0x27')]=function(_0x5adce6,_0x567663){var _0x380bdc={},_0x324b76={},_0x32c5d8={'count':0x0,'rows':[]};var _0x193a8c=_[_0x3b43('0x28')](db[_0x3b43('0x29')][_0x3b43('0x2a')],function(_0x20098f){return{'name':_0x20098f['fieldName'],'type':_0x20098f[_0x3b43('0x2b')][_0x3b43('0x2c')]};});_0x324b76[_0x3b43('0x2d')]=_[_0x3b43('0x28')](_0x193a8c,_0x3b43('0x25'));_0x324b76[_0x3b43('0x2e')]=_[_0x3b43('0x2f')](_0x5adce6[_0x3b43('0x2e')]);_0x324b76['filters']=_[_0x3b43('0x30')](_0x324b76[_0x3b43('0x2d')],_0x324b76['query']);_0x380bdc[_0x3b43('0x31')]=_['intersection'](_0x324b76['model'],qs[_0x3b43('0x32')](_0x5adce6[_0x3b43('0x2e')][_0x3b43('0x32')]));_0x380bdc[_0x3b43('0x31')]=_0x380bdc[_0x3b43('0x31')][_0x3b43('0x33')]?_0x380bdc[_0x3b43('0x31')]:_0x324b76[_0x3b43('0x2d')];if(!_0x5adce6['query']['hasOwnProperty']('nolimit')){_0x380bdc[_0x3b43('0x34')]=qs[_0x3b43('0x34')](_0x5adce6['query'][_0x3b43('0x34')]);_0x380bdc['offset']=qs[_0x3b43('0x1b')](_0x5adce6[_0x3b43('0x2e')]['offset']);}_0x380bdc['order']=qs[_0x3b43('0x35')](_0x5adce6[_0x3b43('0x2e')][_0x3b43('0x35')]);_0x380bdc['where']=qs['filters'](_[_0x3b43('0x36')](_0x5adce6[_0x3b43('0x2e')],_0x324b76[_0x3b43('0x37')]),_0x193a8c);if(_0x5adce6['query'][_0x3b43('0x38')]){_0x380bdc[_0x3b43('0x39')]=_[_0x3b43('0x3a')](_0x380bdc['where'],{'$or':_[_0x3b43('0x28')](_0x193a8c,function(_0x4dc5c7){if(_0x4dc5c7[_0x3b43('0x2b')]!==_0x3b43('0x3b')){var _0x799a9e={};_0x799a9e[_0x4dc5c7[_0x3b43('0x25')]]={'$like':'%'+_0x5adce6[_0x3b43('0x2e')]['filter']+'%'};return _0x799a9e;}})});}_0x380bdc=_['merge']({},_0x380bdc,_0x5adce6[_0x3b43('0x3c')]);var _0x4ebd39={'where':_0x380bdc[_0x3b43('0x39')]};return db['Automation'][_0x3b43('0x1c')](_0x4ebd39)['then'](function(_0x15bacb){_0x32c5d8[_0x3b43('0x1c')]=_0x15bacb;if(_0x5adce6['query'][_0x3b43('0x3d')]){_0x380bdc[_0x3b43('0x3e')]=[{'all':!![]}];}return db[_0x3b43('0x29')]['findAll'](_0x380bdc);})[_0x3b43('0x21')](function(_0x5b2da6){_0x32c5d8['rows']=_0x5b2da6;return _0x32c5d8;})['then'](respondWithFilteredResult(_0x567663,_0x380bdc))[_0x3b43('0x3f')](handleError(_0x567663,null));};exports['show']=function(_0x1cb163,_0x2f1017){var _0x23ad64={'raw':![],'where':{'id':_0x1cb163[_0x3b43('0x40')]['id']}},_0xaafce={};_0xaafce[_0x3b43('0x2d')]=_[_0x3b43('0x2f')](db[_0x3b43('0x29')]['rawAttributes']);_0xaafce[_0x3b43('0x2e')]=_['keys'](_0x1cb163[_0x3b43('0x2e')]);_0xaafce[_0x3b43('0x37')]=_[_0x3b43('0x30')](_0xaafce[_0x3b43('0x2d')],_0xaafce[_0x3b43('0x2e')]);_0x23ad64[_0x3b43('0x31')]=_[_0x3b43('0x30')](_0xaafce[_0x3b43('0x2d')],qs[_0x3b43('0x32')](_0x1cb163[_0x3b43('0x2e')]['fields']));_0x23ad64[_0x3b43('0x31')]=_0x23ad64[_0x3b43('0x31')]['length']?_0x23ad64[_0x3b43('0x31')]:_0xaafce[_0x3b43('0x2d')];if(_0x1cb163[_0x3b43('0x2e')]['includeAll']){_0x23ad64['include']=[{'all':!![]}];}_0x23ad64=_[_0x3b43('0x3a')]({},_0x23ad64,_0x1cb163[_0x3b43('0x3c')]);return db['Automation'][_0x3b43('0x41')](_0x23ad64)[_0x3b43('0x21')](handleEntityNotFound(_0x2f1017,null))[_0x3b43('0x21')](respondWithResult(_0x2f1017,null))['catch'](handleError(_0x2f1017,null));};exports[_0x3b43('0x42')]=function(_0x3189e7,_0x23d379){return db[_0x3b43('0x29')][_0x3b43('0x42')](_0x3189e7[_0x3b43('0x43')],{})[_0x3b43('0x21')](respondWithResult(_0x23d379,0xc9))[_0x3b43('0x3f')](handleError(_0x23d379,null));};exports[_0x3b43('0x1f')]=function(_0x1449f9,_0x578d33){if(_0x1449f9[_0x3b43('0x43')]['id']){delete _0x1449f9[_0x3b43('0x43')]['id'];}return db[_0x3b43('0x29')][_0x3b43('0x41')]({'where':{'id':_0x1449f9[_0x3b43('0x40')]['id']}})[_0x3b43('0x21')](handleEntityNotFound(_0x578d33,null))[_0x3b43('0x21')](saveUpdates(_0x1449f9[_0x3b43('0x43')],null))[_0x3b43('0x21')](respondWithResult(_0x578d33,null))[_0x3b43('0x3f')](handleError(_0x578d33,null));};exports['destroy']=function(_0x5e045c,_0x51066c){return db[_0x3b43('0x29')][_0x3b43('0x41')]({'where':{'id':_0x5e045c['params']['id']}})[_0x3b43('0x21')](handleEntityNotFound(_0x51066c,null))[_0x3b43('0x21')](removeEntity(_0x51066c,null))[_0x3b43('0x3f')](handleError(_0x51066c,null));};exports[_0x3b43('0x44')]=function(_0x4a7789,_0x423407,_0x34c6b7){return db['Condition'][_0x3b43('0x41')]({'where':{'id':_0x4a7789[_0x3b43('0x40')]['id']}})[_0x3b43('0x21')](handleEntityNotFound(_0x423407,null))[_0x3b43('0x21')](function(_0x432861){if(_0x432861){return _0x432861[_0x3b43('0x44')](_0x4a7789[_0x3b43('0x43')]['ids'],_[_0x3b43('0x45')](_0x4a7789[_0x3b43('0x43')],['ids','id'])||{});}})[_0x3b43('0x21')](respondWithResult(_0x423407,null))[_0x3b43('0x3f')](handleError(_0x423407,null));};exports[_0x3b43('0x46')]=function(_0x229304,_0xc599dc,_0x30c4e9){var _0x43ca28={};var _0x165f4e={};var _0x1750cd;var _0x166262;return db[_0x3b43('0x29')][_0x3b43('0x47')]({'where':{'id':_0x229304[_0x3b43('0x40')]['id']}})['then'](handleEntityNotFound(_0xc599dc,null))[_0x3b43('0x21')](function(_0x5675cf){if(_0x5675cf){_0x1750cd=_0x5675cf;_0x165f4e[_0x3b43('0x2d')]=_[_0x3b43('0x2f')](db[_0x3b43('0x48')][_0x3b43('0x2a')]);_0x165f4e[_0x3b43('0x2e')]=_[_0x3b43('0x2f')](_0x229304[_0x3b43('0x2e')]);_0x165f4e[_0x3b43('0x37')]=_[_0x3b43('0x30')](_0x165f4e['model'],_0x165f4e[_0x3b43('0x2e')]);_0x43ca28[_0x3b43('0x31')]=_[_0x3b43('0x30')](_0x165f4e[_0x3b43('0x2d')],qs[_0x3b43('0x32')](_0x229304[_0x3b43('0x2e')][_0x3b43('0x32')]));_0x43ca28['attributes']=_0x43ca28[_0x3b43('0x31')][_0x3b43('0x33')]?_0x43ca28[_0x3b43('0x31')]:_0x165f4e[_0x3b43('0x2d')];_0x43ca28[_0x3b43('0x49')]=qs[_0x3b43('0x35')](_0x229304[_0x3b43('0x2e')][_0x3b43('0x35')]);_0x43ca28['where']=qs['filters'](_[_0x3b43('0x36')](_0x229304['query'],_0x165f4e['filters']));if(_0x229304[_0x3b43('0x2e')][_0x3b43('0x38')]){_0x43ca28[_0x3b43('0x39')]=_[_0x3b43('0x3a')](_0x43ca28[_0x3b43('0x39')],{'$or':_['map'](_0x43ca28[_0x3b43('0x31')],function(_0x435ee5){var _0x3cd94e={};_0x3cd94e[_0x435ee5]={'$like':'%'+_0x229304[_0x3b43('0x2e')][_0x3b43('0x38')]+'%'};return _0x3cd94e;})});}_0x43ca28=_[_0x3b43('0x3a')]({},_0x43ca28,_0x229304[_0x3b43('0x3c')]);return _0x1750cd[_0x3b43('0x46')](_0x43ca28);}})[_0x3b43('0x21')](function(_0x23edbd){if(_0x23edbd){_0x166262=_0x23edbd[_0x3b43('0x33')];if(!_0x229304['query']['hasOwnProperty'](_0x3b43('0x4a'))){_0x43ca28['limit']=qs[_0x3b43('0x34')](_0x229304[_0x3b43('0x2e')][_0x3b43('0x34')]);_0x43ca28[_0x3b43('0x1b')]=qs[_0x3b43('0x1b')](_0x229304['query'][_0x3b43('0x1b')]);}return _0x1750cd['getConditions'](_0x43ca28);}})[_0x3b43('0x21')](function(_0xc9de26){if(_0xc9de26){return _0xc9de26?{'count':_0x166262,'rows':_0xc9de26}:null;}})[_0x3b43('0x21')](respondWithResult(_0xc599dc,null))[_0x3b43('0x3f')](handleError(_0xc599dc,null));};exports['addActions']=function(_0x43b7b1,_0x2cee4e,_0x5eaf3d){return db[_0x3b43('0x4b')][_0x3b43('0x41')]({'where':{'id':_0x43b7b1['params']['id']}})[_0x3b43('0x21')](handleEntityNotFound(_0x2cee4e,null))[_0x3b43('0x21')](function(_0x18767f){if(_0x18767f){return _0x18767f[_0x3b43('0x4c')](_0x43b7b1['body'][_0x3b43('0x4d')],_[_0x3b43('0x45')](_0x43b7b1['body'],[_0x3b43('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x2cee4e,null))['catch'](handleError(_0x2cee4e,null));};exports[_0x3b43('0x4e')]=function(_0x206124,_0x466707,_0x25c65f){var _0x3e95be={};var _0x1bd4a1={};var _0x1d3213;var _0x5c0a0f;return db[_0x3b43('0x29')][_0x3b43('0x47')]({'where':{'id':_0x206124['params']['id']}})[_0x3b43('0x21')](handleEntityNotFound(_0x466707,null))[_0x3b43('0x21')](function(_0x169d6a){if(_0x169d6a){_0x1d3213=_0x169d6a;_0x1bd4a1[_0x3b43('0x2d')]=_[_0x3b43('0x2f')](db[_0x3b43('0x4b')][_0x3b43('0x2a')]);_0x1bd4a1[_0x3b43('0x2e')]=_[_0x3b43('0x2f')](_0x206124[_0x3b43('0x2e')]);_0x1bd4a1[_0x3b43('0x37')]=_['intersection'](_0x1bd4a1[_0x3b43('0x2d')],_0x1bd4a1[_0x3b43('0x2e')]);_0x3e95be[_0x3b43('0x31')]=_[_0x3b43('0x30')](_0x1bd4a1[_0x3b43('0x2d')],qs['fields'](_0x206124[_0x3b43('0x2e')][_0x3b43('0x32')]));_0x3e95be[_0x3b43('0x31')]=_0x3e95be['attributes'][_0x3b43('0x33')]?_0x3e95be['attributes']:_0x1bd4a1['model'];_0x3e95be['order']=qs[_0x3b43('0x35')](_0x206124[_0x3b43('0x2e')][_0x3b43('0x35')]);_0x3e95be[_0x3b43('0x39')]=qs['filters'](_[_0x3b43('0x36')](_0x206124[_0x3b43('0x2e')],_0x1bd4a1['filters']));if(_0x206124[_0x3b43('0x2e')][_0x3b43('0x38')]){_0x3e95be['where']=_[_0x3b43('0x3a')](_0x3e95be[_0x3b43('0x39')],{'$or':_[_0x3b43('0x28')](_0x3e95be[_0x3b43('0x31')],function(_0x3d60aa){var _0x2027df={};_0x2027df[_0x3d60aa]={'$like':'%'+_0x206124[_0x3b43('0x2e')]['filter']+'%'};return _0x2027df;})});}_0x3e95be=_[_0x3b43('0x3a')]({},_0x3e95be,_0x206124[_0x3b43('0x3c')]);return _0x1d3213[_0x3b43('0x4e')](_0x3e95be);}})[_0x3b43('0x21')](function(_0x5d3d67){if(_0x5d3d67){_0x5c0a0f=_0x5d3d67[_0x3b43('0x33')];if(!_0x206124[_0x3b43('0x2e')][_0x3b43('0x4f')](_0x3b43('0x4a'))){_0x3e95be['limit']=qs[_0x3b43('0x34')](_0x206124[_0x3b43('0x2e')][_0x3b43('0x34')]);_0x3e95be[_0x3b43('0x1b')]=qs[_0x3b43('0x1b')](_0x206124[_0x3b43('0x2e')][_0x3b43('0x1b')]);}return _0x1d3213[_0x3b43('0x4e')](_0x3e95be);}})['then'](function(_0x42c179){if(_0x42c179){return _0x42c179?{'count':_0x5c0a0f,'rows':_0x42c179}:null;}})[_0x3b43('0x21')](respondWithResult(_0x466707,null))[_0x3b43('0x3f')](handleError(_0x466707,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b8c02f6..d4cbb88 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 _0x8b80=['api','moment','request-promise','path','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util'];(function(_0x281c59,_0x58ea23){var _0x340fd6=function(_0x6956b0){while(--_0x6956b0){_0x281c59['push'](_0x281c59['shift']());}};_0x340fd6(++_0x58ea23);}(_0x8b80,0x13d));var _0x08b8=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x8b80[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x08b8('0x0'));var util=require(_0x08b8('0x1'));var logger=require('../../config/logger')(_0x08b8('0x2'));var moment=require(_0x08b8('0x3'));var BPromise=require('bluebird');var rp=require(_0x08b8('0x4'));var fs=require('fs');var path=require(_0x08b8('0x5'));var rimraf=require('rimraf');var config=require(_0x08b8('0x6'));var attributes=require(_0x08b8('0x7'));module[_0x08b8('0x8')]=function(_0x2518fc,_0x3e61a9){return _0x2518fc[_0x08b8('0x9')]('Automation',attributes,{'tableName':_0x08b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c11=['tools_automations','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9c11,0x9a));var _0x19c1=function(_0x5edb42,_0x59dc23){_0x5edb42=_0x5edb42-0x0;var _0x313cf7=_0x9c11[_0x5edb42];return _0x313cf7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x19c1('0x0'))('api');var moment=require(_0x19c1('0x1'));var BPromise=require(_0x19c1('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19c1('0x3'));var rimraf=require(_0x19c1('0x4'));var config=require(_0x19c1('0x5'));var attributes=require(_0x19c1('0x6'));module[_0x19c1('0x7')]=function(_0x20fee5,_0x18edbe){return _0x20fee5['define']('Automation',attributes,{'tableName':_0x19c1('0x8'),'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 2ba1ec0..a347d53 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 _0xb78e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0xcc3caf,_0x11800f){var _0x5d1173=function(_0x398db1){while(--_0x398db1){_0xcc3caf['push'](_0xcc3caf['shift']());}};_0x5d1173(++_0x11800f);}(_0xb78e,0x1c9));var _0xeb78=function(_0x5b2bd1,_0x190f6d){_0x5b2bd1=_0x5b2bd1-0x0;var _0x47ab4f=_0xb78e[_0x5b2bd1];return _0x47ab4f;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var moment=require('moment');var BPromise=require(_0xeb78('0x2'));var rs=require(_0xeb78('0x3'));var fs=require('fs');var Redis=require(_0xeb78('0x4'));var db=require(_0xeb78('0x5'))['db'];var utils=require(_0xeb78('0x6'));var logger=require(_0xeb78('0x7'))(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb78('0xa')][_0xeb78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ccc2f,_0x30c884,_0x2b7925){return new BPromise(function(_0x36963f,_0x5259aa){return client['request'](_0x1ccc2f,_0x2b7925)[_0xeb78('0xc')](function(_0x1c941d){logger[_0xeb78('0xd')](_0xeb78('0xe'),_0x30c884,_0xeb78('0xf'));logger[_0xeb78('0x10')](_0xeb78('0x11'),_0x30c884,_0xeb78('0xf'),JSON[_0xeb78('0x12')](_0x1c941d));if(_0x1c941d['error']){if(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x14')]===0x1f4){logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);return _0x5259aa(_0x1c941d[_0xeb78('0x13')][_0xeb78('0x15')]);}logger[_0xeb78('0x13')](_0xeb78('0xe'),_0x30c884,_0x1c941d['error'][_0xeb78('0x15')]);return _0x36963f(_0x1c941d[_0xeb78('0x13')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x30c884,_0xeb78('0xf'));_0x36963f(_0x1c941d['result'][_0xeb78('0x15')]);}})[_0xeb78('0x16')](function(_0x49123d){logger[_0xeb78('0x13')]('Automation,\x20%s,\x20%s',_0x30c884,_0x49123d);_0x5259aa(_0x49123d);});});} \ No newline at end of file +var _0xc4d8=['then','info','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','Automation,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x26cc37,_0x1c49d2){var _0x244e5c=function(_0xa9d9d9){while(--_0xa9d9d9){_0x26cc37['push'](_0x26cc37['shift']());}};_0x244e5c(++_0x1c49d2);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xc4d8[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x8c4d('0x0'));var util=require('util');var moment=require(_0x8c4d('0x1'));var BPromise=require(_0x8c4d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c4d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c4d('0x4'));var config=require(_0x8c4d('0x5'));var jayson=require(_0x8c4d('0x6'));var client=jayson[_0x8c4d('0x7')][_0x8c4d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15da54,_0x19ac49,_0x75b3d6){return new BPromise(function(_0x3369b8,_0x521b76){return client[_0x8c4d('0x9')](_0x15da54,_0x75b3d6)[_0x8c4d('0xa')](function(_0x36b577){logger[_0x8c4d('0xb')]('Automation,\x20%s,\x20%s',_0x19ac49,'request\x20sent');logger[_0x8c4d('0xc')](_0x8c4d('0xd'),_0x19ac49,_0x8c4d('0xe'),JSON[_0x8c4d('0xf')](_0x36b577));if(_0x36b577[_0x8c4d('0x10')]){if(_0x36b577[_0x8c4d('0x10')][_0x8c4d('0x11')]===0x1f4){logger[_0x8c4d('0x10')]('Automation,\x20%s,\x20%s',_0x19ac49,_0x36b577[_0x8c4d('0x10')][_0x8c4d('0x12')]);return _0x521b76(_0x36b577[_0x8c4d('0x10')][_0x8c4d('0x12')]);}logger[_0x8c4d('0x10')](_0x8c4d('0x13'),_0x19ac49,_0x36b577[_0x8c4d('0x10')][_0x8c4d('0x12')]);return _0x3369b8(_0x36b577['error']['message']);}else{logger[_0x8c4d('0xb')](_0x8c4d('0x13'),_0x19ac49,'request\x20sent');_0x3369b8(_0x36b577[_0x8c4d('0x14')][_0x8c4d('0x12')]);}})[_0x8c4d('0x15')](function(_0x4d8ded){logger[_0x8c4d('0x10')](_0x8c4d('0x13'),_0x19ac49,_0x4d8ded);_0x521b76(_0x4d8ded);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 2b4a3d2..8d6989b 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 _0x54da=['/:id/actions','post','create','addConditions','addActions','put','/:id','update','destroy','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','index','get','/:id/conditions','isAuthenticated'];(function(_0x40c0dd,_0x171ea5){var _0x2d4984=function(_0x28088a){while(--_0x28088a){_0x40c0dd['push'](_0x40c0dd['shift']());}};_0x2d4984(++_0x171ea5);}(_0x54da,0x9d));var _0xa54d=function(_0x5af81e,_0x3a0d0b){_0x5af81e=_0x5af81e-0x0;var _0x198f7c=_0x54da[_0x5af81e];return _0x198f7c;};'use strict';var multer=require(_0xa54d('0x0'));var util=require('util');var path=require(_0xa54d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa54d('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa54d('0x3'));var interaction=require(_0xa54d('0x4'));var config=require(_0xa54d('0x5'));var controller=require(_0xa54d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa54d('0x7')]);router[_0xa54d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa54d('0x8')](_0xa54d('0x9'),auth[_0xa54d('0xa')](),controller['getConditions']);router[_0xa54d('0x8')](_0xa54d('0xb'),auth['isAuthenticated'](),controller['getActions']);router[_0xa54d('0xc')]('/',auth['isAuthenticated'](),controller[_0xa54d('0xd')]);router[_0xa54d('0xc')](_0xa54d('0x9'),auth['isAuthenticated'](),controller[_0xa54d('0xe')]);router['post']('/:id/actions',auth['isAuthenticated'](),controller[_0xa54d('0xf')]);router[_0xa54d('0x10')](_0xa54d('0x11'),auth[_0xa54d('0xa')](),controller[_0xa54d('0x12')]);router['delete'](_0xa54d('0x11'),auth[_0xa54d('0xa')](),controller[_0xa54d('0x13')]);module[_0xa54d('0x14')]=router; \ No newline at end of file +var _0xea89=['path','connect-timeout','express','fs-extra','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','put','update','delete','exports','multer','util'];(function(_0x5d31e7,_0x543588){var _0x750a60=function(_0x4fe74a){while(--_0x4fe74a){_0x5d31e7['push'](_0x5d31e7['shift']());}};_0x750a60(++_0x543588);}(_0xea89,0x1e2));var _0x9ea8=function(_0x322a26,_0x408ced){_0x322a26=_0x322a26-0x0;var _0x8191ba=_0xea89[_0x322a26];return _0x8191ba;};'use strict';var multer=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var path=require(_0x9ea8('0x2'));var timeout=require(_0x9ea8('0x3'));var express=require(_0x9ea8('0x4'));var router=express['Router']();var fs_extra=require(_0x9ea8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ea8('0x6'));var config=require('../../config/environment');var controller=require(_0x9ea8('0x7'));router[_0x9ea8('0x8')]('/',auth[_0x9ea8('0x9')](),controller[_0x9ea8('0xa')]);router[_0x9ea8('0x8')](_0x9ea8('0xb'),auth[_0x9ea8('0x9')](),controller['show']);router[_0x9ea8('0x8')](_0x9ea8('0xc'),auth['isAuthenticated'](),controller[_0x9ea8('0xd')]);router[_0x9ea8('0x8')](_0x9ea8('0xe'),auth['isAuthenticated'](),controller[_0x9ea8('0xf')]);router[_0x9ea8('0x10')]('/',auth[_0x9ea8('0x9')](),controller[_0x9ea8('0x11')]);router[_0x9ea8('0x10')](_0x9ea8('0xc'),auth[_0x9ea8('0x9')](),controller['addConditions']);router[_0x9ea8('0x10')](_0x9ea8('0xe'),auth[_0x9ea8('0x9')](),controller['addActions']);router[_0x9ea8('0x12')](_0x9ea8('0xb'),auth[_0x9ea8('0x9')](),controller[_0x9ea8('0x13')]);router[_0x9ea8('0x14')](_0x9ea8('0xb'),auth[_0x9ea8('0x9')](),controller['destroy']);module[_0x9ea8('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 e55bf2e..c4df818 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 _0xed9d=['INTEGER','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','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xed9d,0x101));var _0xded9=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xed9d[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0xded9('0x0'));module['exports']={'name':{'type':Sequelize[_0xded9('0x1')],'unique':_0xded9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xded9('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xded9('0x4')},'description':{'type':Sequelize[_0xded9('0x1')]},'active':{'type':Sequelize[_0xded9('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xded9('0x6')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xded9('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'comment':_0xded9('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xded9('0xf')},'dialTimezone':{'type':Sequelize[_0xded9('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xded9('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xded9('0x11'),_0xded9('0x12'),_0xded9('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xded9('0x5')],'defaultValue':0x0,'comment':_0xded9('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xded9('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xded9('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xded9('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xded9('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xded9('0x18')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xded9('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xded9('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xded9('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xded9('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xded9('0x9')](0x9)[_0xded9('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xded9('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xded9('0x1d')},'dialPrefix':{'type':Sequelize[_0xded9('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xded9('0x1e')},'dialCutDigit':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xded9('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xded9('0x24')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xded9('0x9')](0x5)[_0xded9('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xded9('0x9')](0x3)[_0xded9('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xded9('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0xeaec=['#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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)','sequelize','name','ENUM','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','UNSIGNED','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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x45034c,_0x259ac9){var _0x63a0af=function(_0x237ebe){while(--_0x237ebe){_0x45034c['push'](_0x45034c['shift']());}};_0x63a0af(++_0x259ac9);}(_0xeaec,0x191));var _0xceae=function(_0xbbe044,_0x8fa4bd){_0xbbe044=_0xbbe044-0x0;var _0x343d81=_0xeaec[_0xbbe044];return _0x343d81;};'use strict';var Sequelize=require(_0xceae('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xceae('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xceae('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xceae('0x3')]},'active':{'type':Sequelize[_0xceae('0x4')],'defaultValue':0x0,'comment':_0xceae('0x5')},'limitCalls':{'type':Sequelize[_0xceae('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xceae('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xceae('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xceae('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceae('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0xceae('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xceae('0x6')](0x5)[_0xceae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceae('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xceae('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceae('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xceae('0x6')](0x5)[_0xceae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceae('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xceae('0x6')](0x3)[_0xceae('0x9')],'defaultValue':0x3,'comment':_0xceae('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xceae('0x6')](0x5)[_0xceae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xceae('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xceae('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xceae('0x3')],'defaultValue':_0xceae('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xceae('0x2')](_0xceae('0xf'),_0xceae('0x10'),_0xceae('0x11')),'defaultValue':_0xceae('0xf')},'dialAMDActive':{'type':Sequelize[_0xceae('0x4')],'defaultValue':0x0,'comment':_0xceae('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0xceae('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xceae('0x6')](0x9)[_0xceae('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xceae('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xceae('0x6')](0x9)[_0xceae('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceae('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xceae('0x6')](0x9)[_0xceae('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xceae('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xceae('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xceae('0x6')](0x9)[_0xceae('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xceae('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xceae('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xceae('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xceae('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0xceae('0x2')](_0xceae('0x18'),_0xceae('0x19')),'defaultValue':_0xceae('0x18')},'dialPrefix':{'type':Sequelize[_0xceae('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xceae('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceae('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xceae('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xceae('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xceae('0x6')](0x3)[_0xceae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceae('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xceae('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceae('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xceae('0x6')](0x3)[_0xceae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceae('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xceae('0x6')](0x5)[_0xceae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceae('0x1f')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xceae('0x6')](0x5)[_0xceae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceae('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xceae('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xceae('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xceae('0x6')](0x5)[_0xceae('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xceae('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index d71fb05..e6c57b8 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 _0xb226=['zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','hasOwnProperty','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','catch','show','params','length','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','clone','omit','createdAt','updatedAt','destroy','getHoppers','findOne','nolimit','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','getLists','CmList','addLists','format','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','insert','fromQuery','ListId\x20=\x20?','OrderBy','h.id','NOW()','ci.item','ci.OrderBY','join','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf'];(function(_0x3b4c39,_0x264c16){var _0x1d3fe1=function(_0x3a9664){while(--_0x3a9664){_0x3b4c39['push'](_0x3b4c39['shift']());}};_0x1d3fe1(++_0x264c16);}(_0xb226,0x11c));var _0x6b22=function(_0xab567d,_0x1874c0){_0xab567d=_0xab567d-0x0;var _0x144513=_0xb226[_0xab567d];return _0x144513;};'use strict';var emlformat=require(_0x6b22('0x0'));var rimraf=require(_0x6b22('0x1'));var zipdir=require(_0x6b22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b22('0x3'));var moment=require('moment');var BPromise=require(_0x6b22('0x4'));var Mustache=require(_0x6b22('0x5'));var util=require(_0x6b22('0x6'));var path=require(_0x6b22('0x7'));var sox=require('sox');var csv=require(_0x6b22('0x8'));var ejs=require(_0x6b22('0x9'));var fs=require('fs');var fs_extra=require(_0x6b22('0xa'));var _=require(_0x6b22('0xb'));var squel=require(_0x6b22('0xc'));var crypto=require(_0x6b22('0xd'));var jsforce=require(_0x6b22('0xe'));var deskjs=require(_0x6b22('0xf'));var toCsv=require(_0x6b22('0x8'));var querystring=require(_0x6b22('0x10'));var Papa=require('papaparse');var Redis=require(_0x6b22('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6b22('0x12'));var as=require(_0x6b22('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b22('0x14'))('api');var utils=require(_0x6b22('0x15'));var config=require(_0x6b22('0x16'));var licenseUtil=require(_0x6b22('0x17'));var db=require(_0x6b22('0x18'))['db'];function respondWithStatusCode(_0x1d3e25,_0x2ad007){_0x2ad007=_0x2ad007||0xcc;return function(_0xe26e19){if(_0xe26e19){return _0x1d3e25[_0x6b22('0x19')](_0x2ad007);}return _0x1d3e25[_0x6b22('0x1a')](_0x2ad007)[_0x6b22('0x1b')]();};}function respondWithResult(_0x145c00,_0x5d08cb){_0x5d08cb=_0x5d08cb||0xc8;return function(_0x2e6200){if(_0x2e6200){return _0x145c00[_0x6b22('0x1a')](_0x5d08cb)['json'](_0x2e6200);}};}function respondWithFilteredResult(_0x1119c0,_0x47f1e6){return function(_0x51de96){if(_0x51de96){var _0x4b9e43=typeof _0x47f1e6[_0x6b22('0x1c')]===_0x6b22('0x1d')&&typeof _0x47f1e6[_0x6b22('0x1e')]===_0x6b22('0x1d');var _0x4c1ab8=_0x51de96[_0x6b22('0x1f')];var _0x46210a=_0x4b9e43?0x0:_0x47f1e6[_0x6b22('0x1c')];var _0x3666d4=_0x4b9e43?_0x51de96[_0x6b22('0x1f')]:_0x47f1e6[_0x6b22('0x1c')]+_0x47f1e6[_0x6b22('0x1e')];var _0x8af7b4;if(_0x3666d4>=_0x4c1ab8){_0x3666d4=_0x4c1ab8;_0x8af7b4=0xc8;}else{_0x8af7b4=0xce;}_0x1119c0[_0x6b22('0x1a')](_0x8af7b4);return _0x1119c0[_0x6b22('0x20')](_0x6b22('0x21'),_0x46210a+'-'+_0x3666d4+'/'+_0x4c1ab8)['json'](_0x51de96);}return null;};}function patchUpdates(_0x80c585){return function(_0x15882c){try{jsonpatch[_0x6b22('0x22')](_0x15882c,_0x80c585,!![]);}catch(_0x20e2ef){return BPromise[_0x6b22('0x23')](_0x20e2ef);}return _0x15882c['save']();};}function saveUpdates(_0x406b55,_0x81eaeb){return function(_0x2c8022){if(_0x2c8022){return _0x2c8022[_0x6b22('0x24')](_0x406b55)[_0x6b22('0x25')](function(_0x1df743){return _0x1df743;});}return null;};}function removeEntity(_0x29657e,_0x50a54d){return function(_0x2e9984){if(_0x2e9984){return _0x2e9984['destroy']()[_0x6b22('0x25')](function(){var _0x5b31f9=_0x2e9984[_0x6b22('0x26')]({'plain':!![]});var _0x3220fb='IvrCampaigns';return db[_0x6b22('0x27')]['destroy']({'where':{'type':_0x3220fb,'resourceId':_0x5b31f9['id']}})[_0x6b22('0x25')](function(){return _0x2e9984;});})[_0x6b22('0x25')](function(){_0x29657e['status'](0xcc)[_0x6b22('0x1b')]();});}};}function handleEntityNotFound(_0xa34588,_0xaa3c39){return function(_0x43dd3b){if(!_0x43dd3b){_0xa34588['sendStatus'](0x194);}return _0x43dd3b;};}function handleError(_0x4ebc70,_0x4cc9d1){_0x4cc9d1=_0x4cc9d1||0x1f4;return function(_0x5e6cd4){logger['error'](_0x5e6cd4['stack']);if(_0x5e6cd4['name']){delete _0x5e6cd4[_0x6b22('0x28')];}_0x4ebc70[_0x6b22('0x1a')](_0x4cc9d1)[_0x6b22('0x29')](_0x5e6cd4);};}exports[_0x6b22('0x2a')]=function(_0xdf32ca,_0x29568c){var _0xf5c953={},_0x509bbd={},_0x3a0070={'count':0x0,'rows':[]};var _0x339752=_[_0x6b22('0x2b')](db['Campaign'][_0x6b22('0x2c')],function(_0x2da62b){return{'name':_0x2da62b[_0x6b22('0x2d')],'type':_0x2da62b[_0x6b22('0x2e')]['key']};});_0x509bbd[_0x6b22('0x2f')]=_[_0x6b22('0x2b')](_0x339752,'name');_0x509bbd['query']=_[_0x6b22('0x30')](_0xdf32ca[_0x6b22('0x31')]);_0x509bbd['filters']=_[_0x6b22('0x32')](_0x509bbd[_0x6b22('0x2f')],_0x509bbd[_0x6b22('0x31')]);_0xf5c953['attributes']=_[_0x6b22('0x32')](_0x509bbd[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x33')]));_0xf5c953[_0x6b22('0x34')]=_0xf5c953[_0x6b22('0x34')]['length']?_0xf5c953[_0x6b22('0x34')]:_0x509bbd['model'];if(!_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x35')]('nolimit')){_0xf5c953['limit']=qs[_0x6b22('0x1e')](_0xdf32ca['query'][_0x6b22('0x1e')]);_0xf5c953[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0xdf32ca[_0x6b22('0x31')]['offset']);}_0xf5c953[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x37')]);_0xf5c953['where']=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0xdf32ca[_0x6b22('0x31')],_0x509bbd['filters']),_0x339752);if(_0xdf32ca[_0x6b22('0x31')]['filter']){_0xf5c953['where']=_[_0x6b22('0x3a')](_0xf5c953[_0x6b22('0x3b')],{'$or':_['map'](_0x339752,function(_0x272967){if(_0x272967[_0x6b22('0x2e')]!==_0x6b22('0x3c')){var _0x162840={};_0x162840[_0x272967[_0x6b22('0x28')]]={'$like':'%'+_0xdf32ca[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x162840;}})});}_0xf5c953=_[_0x6b22('0x3a')]({},_0xf5c953,_0xdf32ca[_0x6b22('0x3e')]);var _0x4c99fa={'where':_0xf5c953[_0x6b22('0x3b')]};return db[_0x6b22('0x3f')][_0x6b22('0x1f')](_0x4c99fa)['then'](function(_0x1e937f){_0x3a0070['count']=_0x1e937f;if(_0xdf32ca['query'][_0x6b22('0x40')]){_0xf5c953[_0x6b22('0x41')]=[{'all':!![]}];}return db[_0x6b22('0x3f')][_0x6b22('0x42')](_0xf5c953);})[_0x6b22('0x25')](function(_0x17b647){_0x3a0070['rows']=_0x17b647;return _0x3a0070;})[_0x6b22('0x25')](respondWithFilteredResult(_0x29568c,_0xf5c953))[_0x6b22('0x43')](handleError(_0x29568c,null));};exports[_0x6b22('0x44')]=function(_0x1e950b,_0x29fb5a){var _0x1dfbf0={'raw':![],'where':{'id':_0x1e950b[_0x6b22('0x45')]['id']}},_0xbacda7={};_0xbacda7[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x3f')][_0x6b22('0x2c')]);_0xbacda7['query']=_[_0x6b22('0x30')](_0x1e950b[_0x6b22('0x31')]);_0xbacda7[_0x6b22('0x38')]=_[_0x6b22('0x32')](_0xbacda7[_0x6b22('0x2f')],_0xbacda7[_0x6b22('0x31')]);_0x1dfbf0[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0xbacda7[_0x6b22('0x2f')],qs['fields'](_0x1e950b['query']['fields']));_0x1dfbf0[_0x6b22('0x34')]=_0x1dfbf0[_0x6b22('0x34')][_0x6b22('0x46')]?_0x1dfbf0['attributes']:_0xbacda7[_0x6b22('0x2f')];if(_0x1e950b[_0x6b22('0x31')][_0x6b22('0x40')]){_0x1dfbf0[_0x6b22('0x41')]=[{'all':!![]}];}_0x1dfbf0=_['merge']({},_0x1dfbf0,_0x1e950b[_0x6b22('0x3e')]);return db[_0x6b22('0x3f')][_0x6b22('0x47')](_0x1dfbf0)['then'](handleEntityNotFound(_0x29fb5a,null))[_0x6b22('0x25')](respondWithResult(_0x29fb5a,null))[_0x6b22('0x43')](handleError(_0x29fb5a,null));};exports[_0x6b22('0x48')]=function(_0x52ab18,_0x3bc72c){return db[_0x6b22('0x3f')][_0x6b22('0x48')](_0x52ab18[_0x6b22('0x49')],{})['then'](function(_0x4291db){var _0x46aa98=_0x52ab18[_0x6b22('0x4a')]['get']({'plain':!![]});if(!_0x46aa98)throw new Error(_0x6b22('0x4b'));if(_0x46aa98['role']===_0x6b22('0x4a')){var _0xf23059=_0x4291db[_0x6b22('0x26')]({'plain':!![]});var _0x55949c='IvrCampaigns';return db[_0x6b22('0x4c')][_0x6b22('0x47')]({'where':{'name':_0x55949c,'userProfileId':_0x46aa98[_0x6b22('0x4d')]},'raw':!![]})[_0x6b22('0x25')](function(_0x115c33){if(_0x115c33&&_0x115c33[_0x6b22('0x4e')]===0x0){return db[_0x6b22('0x27')][_0x6b22('0x48')]({'name':_0xf23059[_0x6b22('0x28')],'resourceId':_0xf23059['id'],'type':_0x115c33[_0x6b22('0x28')],'sectionId':_0x115c33['id']},{})[_0x6b22('0x25')](function(){return _0x4291db;});}else{return _0x4291db;}})[_0x6b22('0x43')](function(_0x5c5588){logger[_0x6b22('0x4f')](_0x6b22('0x50'),_0x5c5588);throw _0x5c5588;});}return _0x4291db;})[_0x6b22('0x25')](respondWithResult(_0x3bc72c,0xc9))[_0x6b22('0x43')](handleError(_0x3bc72c,null));};exports[_0x6b22('0x51')]=function(_0x47b58f,_0x9ec569){var _0x1391c2={'where':{'id':_0x47b58f[_0x6b22('0x45')]['id']}},_0x3c626b={};_0x3c626b[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x3f')]['rawAttributes']);_0x1391c2['attributes']=_['intersection'](_0x3c626b['model'],qs[_0x6b22('0x33')](_0x47b58f[_0x6b22('0x31')][_0x6b22('0x33')]));_0x1391c2['attributes']=_0x1391c2['attributes'][_0x6b22('0x46')]?_0x1391c2[_0x6b22('0x34')]:_0x3c626b['model'];if(_0x47b58f[_0x6b22('0x31')][_0x6b22('0x40')]){_0x1391c2['include']=[{'all':!![]}];}_0x1391c2=_['merge']({},_0x1391c2,_0x47b58f[_0x6b22('0x3e')]);return db[_0x6b22('0x3f')][_0x6b22('0x47')](_0x1391c2)[_0x6b22('0x25')](handleEntityNotFound(_0x9ec569,null))[_0x6b22('0x25')](function(_0x54fba9){if(_0x54fba9){var _0x5a8bcb=_0x54fba9[_0x6b22('0x26')]({'plain':!![]});_0x5a8bcb=qs[_0x6b22('0x52')](_0x5a8bcb,['id',_0x6b22('0x53'),'updatedAt']);_0x47b58f[_0x6b22('0x49')]=_[_0x6b22('0x52')](_0x47b58f[_0x6b22('0x49')],['id',_0x6b22('0x53'),_0x6b22('0x54')]);return db['Campaign'][_0x6b22('0x48')](_[_0x6b22('0x3a')](_0x5a8bcb,_0x47b58f[_0x6b22('0x49')]),{'include':_0x47b58f[_0x6b22('0x31')]['includeAll']?[{'all':!![]}]:undefined})[_0x6b22('0x25')](function(_0x3d14f7){var _0x4c16dd=_0x47b58f[_0x6b22('0x4a')][_0x6b22('0x26')]({'plain':!![]});if(!_0x4c16dd)throw new Error(_0x6b22('0x4b'));if(_0x4c16dd['role']===_0x6b22('0x4a')){var _0x11d181=_0x3d14f7[_0x6b22('0x26')]({'plain':!![]});var _0x1143cc='IvrCampaigns';return db['UserProfileSection'][_0x6b22('0x47')]({'where':{'name':_0x1143cc,'userProfileId':_0x4c16dd[_0x6b22('0x4d')]},'raw':!![]})[_0x6b22('0x25')](function(_0x5c3533){if(_0x5c3533&&_0x5c3533[_0x6b22('0x4e')]===0x0){return db['UserProfileResource'][_0x6b22('0x48')]({'name':_0x11d181['name'],'resourceId':_0x11d181['id'],'type':_0x5c3533[_0x6b22('0x28')],'sectionId':_0x5c3533['id']},{})[_0x6b22('0x25')](function(){return _0x3d14f7;});}else{return _0x3d14f7;}})[_0x6b22('0x43')](function(_0x2e926b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e926b);throw _0x2e926b;});}return _0x3d14f7;});}})[_0x6b22('0x25')](respondWithResult(_0x9ec569,0xc9))['catch'](handleError(_0x9ec569,null));};exports[_0x6b22('0x24')]=function(_0x54fcb9,_0x1c6a3b){if(_0x54fcb9[_0x6b22('0x49')]['id']){delete _0x54fcb9[_0x6b22('0x49')]['id'];}return db['Campaign'][_0x6b22('0x47')]({'where':{'id':_0x54fcb9[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x1c6a3b,null))[_0x6b22('0x25')](saveUpdates(_0x54fcb9['body'],null))[_0x6b22('0x25')](respondWithResult(_0x1c6a3b,null))['catch'](handleError(_0x1c6a3b,null));};exports[_0x6b22('0x55')]=function(_0x149ad2,_0x20d36a){return db['Campaign'][_0x6b22('0x47')]({'where':{'id':_0x149ad2[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x20d36a,null))[_0x6b22('0x25')](removeEntity(_0x20d36a,null))[_0x6b22('0x43')](handleError(_0x20d36a,null));};exports[_0x6b22('0x56')]=function(_0x1a4f5c,_0x53f532,_0x4b0e27){var _0x51a45f={'raw':!![],'where':{}};var _0x3a7b95={};var _0x41bbfd={'count':0x0,'rows':[]};return db[_0x6b22('0x3f')][_0x6b22('0x57')]({'where':{'id':_0x1a4f5c[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x53f532,null))['then'](function(_0x2d79b4){if(_0x2d79b4){_0x3a7b95[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db['CmHopper'][_0x6b22('0x2c')]);_0x3a7b95['query']=_[_0x6b22('0x30')](_0x1a4f5c[_0x6b22('0x31')]);_0x3a7b95['filters']=_[_0x6b22('0x32')](_0x3a7b95[_0x6b22('0x2f')],_0x3a7b95[_0x6b22('0x31')]);_0x51a45f[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x3a7b95[_0x6b22('0x2f')],qs['fields'](_0x1a4f5c['query'][_0x6b22('0x33')]));_0x51a45f[_0x6b22('0x34')]=_0x51a45f[_0x6b22('0x34')][_0x6b22('0x46')]?_0x51a45f[_0x6b22('0x34')]:_0x3a7b95[_0x6b22('0x2f')];if(!_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x35')](_0x6b22('0x58'))){_0x51a45f[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x1e')]);_0x51a45f[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x1a4f5c['query'][_0x6b22('0x1c')]);}_0x51a45f[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x37')]);_0x51a45f[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x1a4f5c['query'],_0x3a7b95[_0x6b22('0x38')]));_0x51a45f[_0x6b22('0x3b')]['CampaignId']=_0x2d79b4['id'];if(_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x51a45f[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x51a45f[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x51a45f[_0x6b22('0x34')],function(_0x5157eb){var _0x4100dd={};_0x4100dd[_0x5157eb]={'$like':'%'+_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x4100dd;})});}_0x51a45f=_[_0x6b22('0x3a')]({},_0x51a45f,_0x1a4f5c[_0x6b22('0x3e')]);return db[_0x6b22('0x59')][_0x6b22('0x1f')]({'where':_0x51a45f[_0x6b22('0x3b')]})['then'](function(_0x4656f0){_0x41bbfd[_0x6b22('0x1f')]=_0x4656f0;if(_0x1a4f5c[_0x6b22('0x31')][_0x6b22('0x40')]){_0x51a45f[_0x6b22('0x41')]=[{'all':!![]}];}return db[_0x6b22('0x59')][_0x6b22('0x42')](_0x51a45f);})['then'](function(_0x9ef97f){_0x41bbfd[_0x6b22('0x5a')]=_0x9ef97f;return _0x41bbfd;});}})[_0x6b22('0x25')](respondWithFilteredResult(_0x53f532,_0x51a45f))[_0x6b22('0x43')](handleError(_0x53f532,null));};exports[_0x6b22('0x5b')]=function(_0x52703c,_0x19ce26,_0x5e2d9e){var _0x115238={'raw':!![],'where':{}};var _0x5698b2={};var _0x3de7c7={'count':0x0,'rows':[]};return db['Campaign'][_0x6b22('0x57')]({'where':{'id':_0x52703c[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x19ce26,null))[_0x6b22('0x25')](function(_0x2b7930){if(_0x2b7930){_0x5698b2[_0x6b22('0x2f')]=_['keys'](db[_0x6b22('0x5c')][_0x6b22('0x2c')]);_0x5698b2[_0x6b22('0x31')]=_[_0x6b22('0x30')](_0x52703c[_0x6b22('0x31')]);_0x5698b2[_0x6b22('0x38')]=_['intersection'](_0x5698b2[_0x6b22('0x2f')],_0x5698b2['query']);_0x115238[_0x6b22('0x34')]=_['intersection'](_0x5698b2[_0x6b22('0x2f')],qs['fields'](_0x52703c['query']['fields']));_0x115238[_0x6b22('0x34')]=_0x115238[_0x6b22('0x34')][_0x6b22('0x46')]?_0x115238[_0x6b22('0x34')]:_0x5698b2[_0x6b22('0x2f')];if(!_0x52703c[_0x6b22('0x31')][_0x6b22('0x35')]('nolimit')){_0x115238[_0x6b22('0x1e')]=qs['limit'](_0x52703c[_0x6b22('0x31')][_0x6b22('0x1e')]);_0x115238[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x52703c[_0x6b22('0x31')]['offset']);}_0x115238[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x52703c['query'][_0x6b22('0x37')]);_0x115238[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_['pick'](_0x52703c[_0x6b22('0x31')],_0x5698b2[_0x6b22('0x38')]));_0x115238[_0x6b22('0x3b')]['CampaignId']=_0x2b7930['id'];if(_0x52703c[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x115238[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x115238[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x115238[_0x6b22('0x34')],function(_0xac1035){var _0x491948={};_0x491948[_0xac1035]={'$like':'%'+_0x52703c[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x491948;})});}_0x115238=_[_0x6b22('0x3a')]({},_0x115238,_0x52703c['options']);return db[_0x6b22('0x5c')][_0x6b22('0x1f')]({'where':_0x115238[_0x6b22('0x3b')]})['then'](function(_0x161b81){_0x3de7c7[_0x6b22('0x1f')]=_0x161b81;if(_0x52703c[_0x6b22('0x31')][_0x6b22('0x40')]){_0x115238[_0x6b22('0x41')]=[{'all':!![]}];}return db[_0x6b22('0x5c')][_0x6b22('0x42')](_0x115238);})[_0x6b22('0x25')](function(_0x21268a){_0x3de7c7[_0x6b22('0x5a')]=_0x21268a;return _0x3de7c7;});}})[_0x6b22('0x25')](respondWithFilteredResult(_0x19ce26,_0x115238))['catch'](handleError(_0x19ce26,null));};exports[_0x6b22('0x5d')]=function(_0x275086,_0x17223e,_0x2176b0){var _0x5cf4dc={'raw':!![],'where':{}};var _0x257576={};var _0x2b2319={'count':0x0,'rows':[]};return db[_0x6b22('0x3f')][_0x6b22('0x57')]({'where':{'id':_0x275086[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x17223e,null))[_0x6b22('0x25')](function(_0x180ec7){if(_0x180ec7){_0x257576[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x5e')][_0x6b22('0x2c')]);_0x257576['query']=_[_0x6b22('0x30')](_0x275086[_0x6b22('0x31')]);_0x257576[_0x6b22('0x38')]=_['intersection'](_0x257576[_0x6b22('0x2f')],_0x257576[_0x6b22('0x31')]);_0x5cf4dc[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x257576[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x275086[_0x6b22('0x31')][_0x6b22('0x33')]));_0x5cf4dc[_0x6b22('0x34')]=_0x5cf4dc[_0x6b22('0x34')][_0x6b22('0x46')]?_0x5cf4dc['attributes']:_0x257576[_0x6b22('0x2f')];if(!_0x275086[_0x6b22('0x31')][_0x6b22('0x35')](_0x6b22('0x58'))){_0x5cf4dc[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x275086['query']['limit']);_0x5cf4dc[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x275086[_0x6b22('0x31')][_0x6b22('0x1c')]);}_0x5cf4dc[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x275086[_0x6b22('0x31')][_0x6b22('0x37')]);_0x5cf4dc['where']=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x275086['query'],_0x257576[_0x6b22('0x38')]));_0x5cf4dc[_0x6b22('0x3b')]['CampaignId']=_0x180ec7['id'];if(_0x275086[_0x6b22('0x31')]['filter']){_0x5cf4dc['where']=_[_0x6b22('0x3a')](_0x5cf4dc[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x5cf4dc[_0x6b22('0x34')],function(_0xea7953){var _0x567691={};_0x567691[_0xea7953]={'$like':'%'+_0x275086[_0x6b22('0x31')]['filter']+'%'};return _0x567691;})});}_0x5cf4dc=_[_0x6b22('0x3a')]({},_0x5cf4dc,_0x275086[_0x6b22('0x3e')]);return db[_0x6b22('0x5e')][_0x6b22('0x1f')]({'where':_0x5cf4dc['where']})[_0x6b22('0x25')](function(_0x16bf7c){_0x2b2319[_0x6b22('0x1f')]=_0x16bf7c;if(_0x275086[_0x6b22('0x31')][_0x6b22('0x40')]){_0x5cf4dc['include']=[{'all':!![]}];}return db[_0x6b22('0x5e')][_0x6b22('0x42')](_0x5cf4dc);})[_0x6b22('0x25')](function(_0x3d904a){_0x2b2319[_0x6b22('0x5a')]=_0x3d904a;return _0x2b2319;});}})['then'](respondWithFilteredResult(_0x17223e,_0x5cf4dc))[_0x6b22('0x43')](handleError(_0x17223e,null));};exports[_0x6b22('0x5f')]=function(_0x2337f2,_0x373ba1,_0x199224){var _0x417c0d={'raw':!![],'where':{}};var _0x3984b6={};var _0x2e3615={'count':0x0,'rows':[]};return db[_0x6b22('0x3f')]['findOne']({'where':{'id':_0x2337f2[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x373ba1,null))[_0x6b22('0x25')](function(_0x16735f){if(_0x16735f){_0x3984b6[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x60')]['rawAttributes']);_0x3984b6[_0x6b22('0x31')]=_[_0x6b22('0x30')](_0x2337f2['query']);_0x3984b6[_0x6b22('0x38')]=_[_0x6b22('0x32')](_0x3984b6[_0x6b22('0x2f')],_0x3984b6[_0x6b22('0x31')]);_0x417c0d[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x3984b6[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x2337f2[_0x6b22('0x31')][_0x6b22('0x33')]));_0x417c0d[_0x6b22('0x34')]=_0x417c0d[_0x6b22('0x34')][_0x6b22('0x46')]?_0x417c0d[_0x6b22('0x34')]:_0x3984b6[_0x6b22('0x2f')];if(!_0x2337f2['query']['hasOwnProperty'](_0x6b22('0x58'))){_0x417c0d[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x2337f2['query'][_0x6b22('0x1e')]);_0x417c0d['offset']=qs[_0x6b22('0x1c')](_0x2337f2[_0x6b22('0x31')][_0x6b22('0x1c')]);}_0x417c0d[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x2337f2[_0x6b22('0x31')]['sort']);_0x417c0d[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x2337f2[_0x6b22('0x31')],_0x3984b6[_0x6b22('0x38')]));_0x417c0d[_0x6b22('0x3b')][_0x6b22('0x61')]=_0x16735f['id'];if(_0x2337f2[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x417c0d[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x417c0d[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x417c0d[_0x6b22('0x34')],function(_0x327d03){var _0x325a9e={};_0x325a9e[_0x327d03]={'$like':'%'+_0x2337f2['query'][_0x6b22('0x3d')]+'%'};return _0x325a9e;})});}_0x417c0d=_[_0x6b22('0x3a')]({},_0x417c0d,_0x2337f2[_0x6b22('0x3e')]);return db[_0x6b22('0x60')][_0x6b22('0x1f')]({'where':_0x417c0d[_0x6b22('0x3b')]})['then'](function(_0x3272f1){_0x2e3615[_0x6b22('0x1f')]=_0x3272f1;if(_0x2337f2[_0x6b22('0x31')]['includeAll']){_0x417c0d['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x6b22('0x42')](_0x417c0d);})['then'](function(_0x371a9c){_0x2e3615[_0x6b22('0x5a')]=_0x371a9c;return _0x2e3615;});}})[_0x6b22('0x25')](respondWithFilteredResult(_0x373ba1,_0x417c0d))[_0x6b22('0x43')](handleError(_0x373ba1,null));};exports[_0x6b22('0x62')]=function(_0x1a6385,_0x382e5a,_0x52e072){var _0x221caf={};var _0x32aaaf={};var _0x4a3d10;var _0x3c68bb;return db[_0x6b22('0x3f')][_0x6b22('0x57')]({'where':{'id':_0x1a6385[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x382e5a,null))[_0x6b22('0x25')](function(_0x5c07c1){if(_0x5c07c1){_0x4a3d10=_0x5c07c1;_0x32aaaf[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x63')][_0x6b22('0x2c')]);_0x32aaaf[_0x6b22('0x31')]=_[_0x6b22('0x30')](_0x1a6385[_0x6b22('0x31')]);_0x32aaaf[_0x6b22('0x38')]=_[_0x6b22('0x32')](_0x32aaaf[_0x6b22('0x2f')],_0x32aaaf[_0x6b22('0x31')]);_0x221caf[_0x6b22('0x34')]=_[_0x6b22('0x32')](_0x32aaaf[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x1a6385['query'][_0x6b22('0x33')]));_0x221caf[_0x6b22('0x34')]=_0x221caf['attributes'][_0x6b22('0x46')]?_0x221caf['attributes']:_0x32aaaf[_0x6b22('0x2f')];_0x221caf['order']=qs[_0x6b22('0x37')](_0x1a6385['query'][_0x6b22('0x37')]);_0x221caf[_0x6b22('0x3b')]=qs[_0x6b22('0x38')](_[_0x6b22('0x39')](_0x1a6385[_0x6b22('0x31')],_0x32aaaf['filters']));if(_0x1a6385[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x221caf[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x221caf[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x221caf[_0x6b22('0x34')],function(_0x380dff){var _0x98af4f={};_0x98af4f[_0x380dff]={'$like':'%'+_0x1a6385[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x98af4f;})});}_0x221caf=_[_0x6b22('0x3a')]({},_0x221caf,_0x1a6385['options']);return _0x4a3d10[_0x6b22('0x62')](_0x221caf);}})[_0x6b22('0x25')](function(_0x3a33a6){if(_0x3a33a6){_0x3c68bb=_0x3a33a6[_0x6b22('0x46')];if(!_0x1a6385['query'][_0x6b22('0x35')](_0x6b22('0x58'))){_0x221caf['limit']=qs['limit'](_0x1a6385[_0x6b22('0x31')]['limit']);_0x221caf[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x1a6385[_0x6b22('0x31')][_0x6b22('0x1c')]);}return _0x4a3d10[_0x6b22('0x62')](_0x221caf);}})[_0x6b22('0x25')](function(_0x509475){if(_0x509475){return _0x509475?{'count':_0x3c68bb,'rows':_0x509475}:null;}})[_0x6b22('0x25')](respondWithResult(_0x382e5a,null))['catch'](handleError(_0x382e5a,null));};exports[_0x6b22('0x64')]=function(_0x31dac8,_0x160f81,_0x26216b){var _0x1c5f81,_0x2b09de;var _0x32590c=[];var _0xfcb567=moment()[_0x6b22('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x6b22('0x3f')][_0x6b22('0x47')]({'where':{'id':_0x31dac8[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x160f81,null))[_0x6b22('0x25')](function(_0x272287){if(_0x272287){_0x2b09de=_0x272287;return _0x272287[_0x6b22('0x64')](_0x31dac8['body'][_0x6b22('0x66')],_['omit'](_0x31dac8[_0x6b22('0x49')],[_0x6b22('0x66'),'id'])||{});}return null;})[_0x6b22('0x67')](function(_0xb9b3ec){var _0xbdbd08;var _0x196481;_0x1c5f81=_0xb9b3ec||[];var _0x198c5a=[];if(_0xb9b3ec){for(var _0x41f7ac=0x0;_0x41f7ac<_0xb9b3ec[_0x6b22('0x46')];_0x41f7ac+=0x1){var _0x1a12e4=_0xb9b3ec[_0x41f7ac][_0x6b22('0x26')]({'plain':!![]});_0x2b09de['dialCheckDuplicateType']=_0x31dac8[_0x6b22('0x49')][_0x6b22('0x68')]?_0x31dac8['body'][_0x6b22('0x68')]:_0x2b09de['dialCheckDuplicateType'];switch(_0x2b09de[_0x6b22('0x68')]){case _0x6b22('0x69'):_0xbdbd08=squel['insert']()[_0x6b22('0x6a')](_0x6b22('0x6b'))['fromQuery']([_0x6b22('0x6c'),_0x6b22('0x6d'),_0x6b22('0x6e'),_0x6b22('0x6f'),_0x6b22('0x61'),_0x6b22('0x53'),'updatedAt'],squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x6c'),'phone')[_0x6b22('0x71')]('NOW()','scheduledAt')[_0x6b22('0x71')]('id',_0x6b22('0x6e'))['field'](_0x1a12e4[_0x6b22('0x72')]['toString'](),_0x6b22('0x6f'))[_0x6b22('0x71')](_0x31dac8['params']['id'][_0x6b22('0x73')](),_0x6b22('0x61'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x53'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))['from'](_0x6b22('0x74'))[_0x6b22('0x3b')](_0x6b22('0x75'))[_0x6b22('0x3b')]('ListId\x20=\x20?',_0x1a12e4['CmListId']['toString']())[_0x6b22('0x3b')](_0x6b22('0x76'))[_0x6b22('0x3b')](_0x6b22('0x77'),squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x78'))[_0x6b22('0x79')]('cm_hopper_final')[_0x6b22('0x3b')](_0x6b22('0x7a'),_0x31dac8['params']['id'][_0x6b22('0x73')]()))[_0x6b22('0x3b')](_0x6b22('0x77'),squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x7b'))[_0x6b22('0x79')](_0x6b22('0x6b'))['where'](_0x6b22('0x7a'),_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')]())))[_0x6b22('0x73')]();break;case'onlyIfOpen':_0xbdbd08=squel[_0x6b22('0x7c')]()['into'](_0x6b22('0x6b'))['fromQuery']([_0x6b22('0x6c'),_0x6b22('0x6d'),'ContactId','ListId',_0x6b22('0x61'),_0x6b22('0x53'),_0x6b22('0x54')],squel[_0x6b22('0x70')]()['field'](_0x6b22('0x6c'),'phone')[_0x6b22('0x71')]('NOW()',_0x6b22('0x6d'))[_0x6b22('0x71')]('id','ContactId')['field'](_0x1a12e4['CmListId'][_0x6b22('0x73')](),_0x6b22('0x6f'))['field'](_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')](),_0x6b22('0x61'))[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27',_0x6b22('0x53'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))[_0x6b22('0x79')]('cm_contacts')[_0x6b22('0x3b')](_0x6b22('0x75'))[_0x6b22('0x3b')]('ListId\x20=\x20?',_0x1a12e4[_0x6b22('0x72')][_0x6b22('0x73')]())['where'](_0x6b22('0x76'))['where'](_0x6b22('0x77'),squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x7b'))[_0x6b22('0x79')](_0x6b22('0x6b'))[_0x6b22('0x3b')](_0x6b22('0x7a'),_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')]())))['toString']();break;default:_0xbdbd08=squel[_0x6b22('0x7c')]()['into'](_0x6b22('0x6b'))[_0x6b22('0x7d')](['phone','scheduledAt',_0x6b22('0x6e'),_0x6b22('0x6f'),_0x6b22('0x61'),'createdAt',_0x6b22('0x54')],squel['select']()[_0x6b22('0x71')](_0x6b22('0x6c'),_0x6b22('0x6c'))['field']('NOW()',_0x6b22('0x6d'))[_0x6b22('0x71')]('id',_0x6b22('0x6e'))[_0x6b22('0x71')](_0x1a12e4[_0x6b22('0x72')][_0x6b22('0x73')](),_0x6b22('0x6f'))[_0x6b22('0x71')](_0x31dac8[_0x6b22('0x45')]['id'][_0x6b22('0x73')](),_0x6b22('0x61'))['field']('\x27'+_0xfcb567+'\x27',_0x6b22('0x53'))[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))[_0x6b22('0x79')](_0x6b22('0x74'))['where'](_0x6b22('0x75'))[_0x6b22('0x3b')](_0x6b22('0x7e'),_0x1a12e4['CmListId']['toString']())[_0x6b22('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x6b22('0x73')]();}_0x196481=squel[_0x6b22('0x7c')]()[_0x6b22('0x6a')]('cm_hopper_additional_phones')[_0x6b22('0x7d')](['cmHopperId',_0x6b22('0x6d'),_0x6b22('0x6c'),_0x6b22('0x7f'),'createdAt','updatedAt'],squel[_0x6b22('0x70')]()[_0x6b22('0x71')](_0x6b22('0x80'),'id')['field'](_0x6b22('0x81'),'scheduledAt')[_0x6b22('0x71')](_0x6b22('0x82'),'phone')[_0x6b22('0x71')](_0x6b22('0x83'),_0x6b22('0x7f'))[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27','createdAt')[_0x6b22('0x71')]('\x27'+_0xfcb567+'\x27',_0x6b22('0x54'))[_0x6b22('0x79')]('cm_contact_has_items','ci')[_0x6b22('0x84')](_0x6b22('0x6b'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x6b22('0x3b')]('h.ListId\x20=\x20?',_0x1a12e4[_0x6b22('0x72')][_0x6b22('0x73')]())[_0x6b22('0x3b')]('h.CampaignId=?',_0x31dac8['params']['id'][_0x6b22('0x73')]())[_0x6b22('0x3b')](_0x6b22('0x85'),_0xfcb567))[_0x6b22('0x73')]();_0x198c5a[_0x6b22('0x86')](db[_0x6b22('0x87')][_0x6b22('0x31')](_0xbdbd08));_0x32590c[_0x6b22('0x86')](db[_0x6b22('0x87')][_0x6b22('0x31')](_0x196481));}return BPromise[_0x6b22('0x88')](_0x198c5a);}})[_0x6b22('0x25')](function(){return BPromise[_0x6b22('0x88')](_0x32590c);})['then'](function(){return _0x1c5f81;})[_0x6b22('0x25')](respondWithResult(_0x160f81,null))['catch'](handleError(_0x160f81,null));};exports[_0x6b22('0x89')]=function(_0x43a6d6,_0x1f7efa,_0x50a02e){return db[_0x6b22('0x3f')]['find']({'where':{'id':_0x43a6d6[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x1f7efa,null))[_0x6b22('0x25')](function(_0x49c9f6){if(_0x49c9f6){return _0x49c9f6[_0x6b22('0x89')](_0x43a6d6['query'][_0x6b22('0x66')]);}})[_0x6b22('0x25')](function(_0x1baf96){if(_0x1baf96){return db[_0x6b22('0x59')]['destroy']({'where':{'ListId':_0x43a6d6[_0x6b22('0x31')][_0x6b22('0x66')],'CampaignId':_0x43a6d6[_0x6b22('0x45')]['id']}})['then'](function(){return _0x1baf96;});}})[_0x6b22('0x25')](respondWithStatusCode(_0x1f7efa,null))[_0x6b22('0x43')](handleError(_0x1f7efa,null));};exports[_0x6b22('0x8a')]=function(_0x4d1217,_0x5f2a3b,_0x4529ec){var _0x4b59ee={};var _0x32ac2e={};var _0x16b852;var _0x1b5a5f;return db['Campaign'][_0x6b22('0x57')]({'where':{'id':_0x4d1217[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x5f2a3b,null))[_0x6b22('0x25')](function(_0x3ad18a){if(_0x3ad18a){_0x16b852=_0x3ad18a;_0x32ac2e[_0x6b22('0x2f')]=_[_0x6b22('0x30')](db[_0x6b22('0x63')][_0x6b22('0x2c')]);_0x32ac2e[_0x6b22('0x31')]=_['keys'](_0x4d1217[_0x6b22('0x31')]);_0x32ac2e['filters']=_['intersection'](_0x32ac2e[_0x6b22('0x2f')],_0x32ac2e['query']);_0x4b59ee['attributes']=_['intersection'](_0x32ac2e[_0x6b22('0x2f')],qs[_0x6b22('0x33')](_0x4d1217['query'][_0x6b22('0x33')]));_0x4b59ee[_0x6b22('0x34')]=_0x4b59ee[_0x6b22('0x34')][_0x6b22('0x46')]?_0x4b59ee['attributes']:_0x32ac2e['model'];_0x4b59ee[_0x6b22('0x36')]=qs[_0x6b22('0x37')](_0x4d1217[_0x6b22('0x31')][_0x6b22('0x37')]);_0x4b59ee[_0x6b22('0x3b')]=qs['filters'](_[_0x6b22('0x39')](_0x4d1217[_0x6b22('0x31')],_0x32ac2e[_0x6b22('0x38')]));if(_0x4d1217[_0x6b22('0x31')][_0x6b22('0x3d')]){_0x4b59ee[_0x6b22('0x3b')]=_[_0x6b22('0x3a')](_0x4b59ee[_0x6b22('0x3b')],{'$or':_[_0x6b22('0x2b')](_0x4b59ee[_0x6b22('0x34')],function(_0xc5d0b1){var _0x5adc83={};_0x5adc83[_0xc5d0b1]={'$like':'%'+_0x4d1217[_0x6b22('0x31')][_0x6b22('0x3d')]+'%'};return _0x5adc83;})});}_0x4b59ee=_[_0x6b22('0x3a')]({},_0x4b59ee,_0x4d1217['options']);return _0x16b852['getBlackLists'](_0x4b59ee);}})[_0x6b22('0x25')](function(_0x2d09ac){if(_0x2d09ac){_0x1b5a5f=_0x2d09ac[_0x6b22('0x46')];if(!_0x4d1217['query']['hasOwnProperty'](_0x6b22('0x58'))){_0x4b59ee[_0x6b22('0x1e')]=qs[_0x6b22('0x1e')](_0x4d1217[_0x6b22('0x31')][_0x6b22('0x1e')]);_0x4b59ee[_0x6b22('0x1c')]=qs[_0x6b22('0x1c')](_0x4d1217[_0x6b22('0x31')]['offset']);}return _0x16b852[_0x6b22('0x8a')](_0x4b59ee);}})[_0x6b22('0x25')](function(_0x12ae68){if(_0x12ae68){return _0x12ae68?{'count':_0x1b5a5f,'rows':_0x12ae68}:null;}})['then'](respondWithResult(_0x5f2a3b,null))[_0x6b22('0x43')](handleError(_0x5f2a3b,null));};exports[_0x6b22('0x8b')]=function(_0x3406ab,_0x2ff4db,_0xc35f32){var _0x6b7aa7,_0x437262;var _0x4825ae=[];var _0x5f10dc=moment()['format'](_0x6b22('0x8c'));return db[_0x6b22('0x3f')][_0x6b22('0x47')]({'where':{'id':_0x3406ab[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](handleEntityNotFound(_0x2ff4db,null))[_0x6b22('0x25')](function(_0x2289e7){if(_0x2289e7){_0x437262=_0x2289e7;return _0x2289e7[_0x6b22('0x8b')](_0x3406ab[_0x6b22('0x49')][_0x6b22('0x66')],_[_0x6b22('0x52')](_0x3406ab[_0x6b22('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0xd0052b){var _0x2e51c9;var _0x11bdd5;_0x6b7aa7=_0xd0052b||[];var _0x167b35=[];if(_0xd0052b){for(var _0x38a4a3=0x0;_0x38a4a3<_0xd0052b[_0x6b22('0x46')];_0x38a4a3+=0x1){var _0x50c069=_0xd0052b[_0x38a4a3]['get']({'plain':!![]});_0x2e51c9=squel[_0x6b22('0x7c')]()['into'](_0x6b22('0x8d'))[_0x6b22('0x7d')](['phone',_0x6b22('0x6e'),_0x6b22('0x6f'),_0x6b22('0x61'),_0x6b22('0x53'),_0x6b22('0x54')],squel[_0x6b22('0x70')]()['field'](_0x6b22('0x6c'),_0x6b22('0x6c'))['field']('id',_0x6b22('0x6e'))[_0x6b22('0x71')](_0x50c069[_0x6b22('0x72')]['toString'](),_0x6b22('0x6f'))[_0x6b22('0x71')](_0x3406ab[_0x6b22('0x45')]['id'][_0x6b22('0x73')](),_0x6b22('0x61'))[_0x6b22('0x71')](_0x6b22('0x81'),_0x6b22('0x53'))[_0x6b22('0x71')](_0x6b22('0x81'),_0x6b22('0x54'))[_0x6b22('0x79')](_0x6b22('0x74'))[_0x6b22('0x3b')](_0x6b22('0x75'))[_0x6b22('0x3b')](_0x6b22('0x7e'),_0x50c069[_0x6b22('0x72')][_0x6b22('0x73')]())[_0x6b22('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x6b22('0x73')]();_0x167b35[_0x6b22('0x86')](db['sequelize'][_0x6b22('0x31')](_0x2e51c9));}return BPromise[_0x6b22('0x88')](_0x167b35);}})[_0x6b22('0x25')](function(){return _0x6b7aa7;})[_0x6b22('0x25')](respondWithResult(_0x2ff4db,null))[_0x6b22('0x43')](handleError(_0x2ff4db,null));};exports[_0x6b22('0x8e')]=function(_0x24d6f5,_0x149067,_0x406362){return db['Campaign'][_0x6b22('0x47')]({'where':{'id':_0x24d6f5[_0x6b22('0x45')]['id']}})['then'](handleEntityNotFound(_0x149067,null))['then'](function(_0x4dca95){if(_0x4dca95){return _0x4dca95[_0x6b22('0x8e')](_0x24d6f5[_0x6b22('0x31')][_0x6b22('0x66')]);}})[_0x6b22('0x25')](function(_0x2f00c4){if(_0x2f00c4){return db[_0x6b22('0x60')][_0x6b22('0x55')]({'where':{'ListId':_0x24d6f5['query'][_0x6b22('0x66')],'CampaignId':_0x24d6f5[_0x6b22('0x45')]['id']}})[_0x6b22('0x25')](function(){return _0x2f00c4;});}})[_0x6b22('0x25')](respondWithStatusCode(_0x149067,null))[_0x6b22('0x43')](handleError(_0x149067,null));}; \ No newline at end of file +var _0xcbde=['into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','select','field','NOW()','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','ContactId','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','index','map','Campaign','fieldName','type','key','model','name','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','find','getHoppers','CmHopper','CampaignId','filter','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert'];(function(_0x24b3fd,_0x3d7922){var _0x5bebf4=function(_0x39dfdc){while(--_0x39dfdc){_0x24b3fd['push'](_0x24b3fd['shift']());}};_0x5bebf4(++_0x3d7922);}(_0xcbde,0x141));var _0xecbd=function(_0x5f3024,_0x46419e){_0x5f3024=_0x5f3024-0x0;var _0x593a79=_0xcbde[_0x5f3024];return _0x593a79;};'use strict';var emlformat=require(_0xecbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xecbd('0x1'));var jsonpatch=require(_0xecbd('0x2'));var rp=require(_0xecbd('0x3'));var moment=require(_0xecbd('0x4'));var BPromise=require(_0xecbd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xecbd('0x6'));var sox=require(_0xecbd('0x7'));var csv=require('to-csv');var ejs=require(_0xecbd('0x8'));var fs=require('fs');var fs_extra=require(_0xecbd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xecbd('0xa'));var jsforce=require(_0xecbd('0xb'));var deskjs=require(_0xecbd('0xc'));var toCsv=require(_0xecbd('0xd'));var querystring=require(_0xecbd('0xe'));var Papa=require(_0xecbd('0xf'));var Redis=require('ioredis');var authService=require(_0xecbd('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xecbd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xecbd('0x12'));var utils=require('../../config/utils');var config=require(_0xecbd('0x13'));var licenseUtil=require(_0xecbd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c6429,_0x444a88){_0x444a88=_0x444a88||0xcc;return function(_0x447856){if(_0x447856){return _0x3c6429[_0xecbd('0x15')](_0x444a88);}return _0x3c6429[_0xecbd('0x16')](_0x444a88)[_0xecbd('0x17')]();};}function respondWithResult(_0x1f4122,_0xd9295c){_0xd9295c=_0xd9295c||0xc8;return function(_0x244e8f){if(_0x244e8f){return _0x1f4122['status'](_0xd9295c)[_0xecbd('0x18')](_0x244e8f);}};}function respondWithFilteredResult(_0x1607ec,_0x2cc3f0){return function(_0x3805a){if(_0x3805a){var _0x1ea87a=typeof _0x2cc3f0[_0xecbd('0x19')]===_0xecbd('0x1a')&&typeof _0x2cc3f0[_0xecbd('0x1b')]===_0xecbd('0x1a');var _0x3896ca=_0x3805a['count'];var _0x200782=_0x1ea87a?0x0:_0x2cc3f0['offset'];var _0x116cfd=_0x1ea87a?_0x3805a[_0xecbd('0x1c')]:_0x2cc3f0[_0xecbd('0x19')]+_0x2cc3f0[_0xecbd('0x1b')];var _0x3131b2;if(_0x116cfd>=_0x3896ca){_0x116cfd=_0x3896ca;_0x3131b2=0xc8;}else{_0x3131b2=0xce;}_0x1607ec[_0xecbd('0x16')](_0x3131b2);return _0x1607ec[_0xecbd('0x1d')]('Content-Range',_0x200782+'-'+_0x116cfd+'/'+_0x3896ca)[_0xecbd('0x18')](_0x3805a);}return null;};}function patchUpdates(_0x2a3166){return function(_0x3cde92){try{jsonpatch[_0xecbd('0x1e')](_0x3cde92,_0x2a3166,!![]);}catch(_0x342c41){return BPromise['reject'](_0x342c41);}return _0x3cde92[_0xecbd('0x1f')]();};}function saveUpdates(_0x3ab72d,_0x11b003){return function(_0x257000){if(_0x257000){return _0x257000['update'](_0x3ab72d)[_0xecbd('0x20')](function(_0x47b0cc){return _0x47b0cc;});}return null;};}function removeEntity(_0x190cab,_0x3b66ed){return function(_0x292cce){if(_0x292cce){return _0x292cce[_0xecbd('0x21')]()['then'](function(){var _0x493b02=_0x292cce[_0xecbd('0x22')]({'plain':!![]});var _0x138630=_0xecbd('0x23');return db[_0xecbd('0x24')]['destroy']({'where':{'type':_0x138630,'resourceId':_0x493b02['id']}})[_0xecbd('0x20')](function(){return _0x292cce;});})[_0xecbd('0x20')](function(){_0x190cab[_0xecbd('0x16')](0xcc)[_0xecbd('0x17')]();});}};}function handleEntityNotFound(_0x27bab5,_0x119a5e){return function(_0x3dfed3){if(!_0x3dfed3){_0x27bab5[_0xecbd('0x15')](0x194);}return _0x3dfed3;};}function handleError(_0x4560a5,_0x1128f0){_0x1128f0=_0x1128f0||0x1f4;return function(_0x1a237f){logger[_0xecbd('0x25')](_0x1a237f[_0xecbd('0x26')]);if(_0x1a237f['name']){delete _0x1a237f['name'];}_0x4560a5['status'](_0x1128f0)['send'](_0x1a237f);};}exports[_0xecbd('0x27')]=function(_0x26fbe2,_0x58682d){var _0xd903ee={},_0x23844c={},_0x5130c3={'count':0x0,'rows':[]};var _0xeca49c=_[_0xecbd('0x28')](db[_0xecbd('0x29')]['rawAttributes'],function(_0x22dcd3){return{'name':_0x22dcd3[_0xecbd('0x2a')],'type':_0x22dcd3[_0xecbd('0x2b')][_0xecbd('0x2c')]};});_0x23844c[_0xecbd('0x2d')]=_[_0xecbd('0x28')](_0xeca49c,_0xecbd('0x2e'));_0x23844c[_0xecbd('0x2f')]=_[_0xecbd('0x30')](_0x26fbe2[_0xecbd('0x2f')]);_0x23844c[_0xecbd('0x31')]=_['intersection'](_0x23844c[_0xecbd('0x2d')],_0x23844c[_0xecbd('0x2f')]);_0xd903ee['attributes']=_['intersection'](_0x23844c[_0xecbd('0x2d')],qs[_0xecbd('0x32')](_0x26fbe2[_0xecbd('0x2f')][_0xecbd('0x32')]));_0xd903ee[_0xecbd('0x33')]=_0xd903ee['attributes'][_0xecbd('0x34')]?_0xd903ee[_0xecbd('0x33')]:_0x23844c['model'];if(!_0x26fbe2[_0xecbd('0x2f')][_0xecbd('0x35')](_0xecbd('0x36'))){_0xd903ee[_0xecbd('0x1b')]=qs[_0xecbd('0x1b')](_0x26fbe2[_0xecbd('0x2f')][_0xecbd('0x1b')]);_0xd903ee[_0xecbd('0x19')]=qs['offset'](_0x26fbe2['query'][_0xecbd('0x19')]);}_0xd903ee[_0xecbd('0x37')]=qs[_0xecbd('0x38')](_0x26fbe2[_0xecbd('0x2f')][_0xecbd('0x38')]);_0xd903ee[_0xecbd('0x39')]=qs[_0xecbd('0x31')](_[_0xecbd('0x3a')](_0x26fbe2[_0xecbd('0x2f')],_0x23844c[_0xecbd('0x31')]),_0xeca49c);if(_0x26fbe2[_0xecbd('0x2f')]['filter']){_0xd903ee[_0xecbd('0x39')]=_['merge'](_0xd903ee[_0xecbd('0x39')],{'$or':_[_0xecbd('0x28')](_0xeca49c,function(_0x4dc72b){if(_0x4dc72b[_0xecbd('0x2b')]!==_0xecbd('0x3b')){var _0x271e39={};_0x271e39[_0x4dc72b[_0xecbd('0x2e')]]={'$like':'%'+_0x26fbe2[_0xecbd('0x2f')]['filter']+'%'};return _0x271e39;}})});}_0xd903ee=_[_0xecbd('0x3c')]({},_0xd903ee,_0x26fbe2[_0xecbd('0x3d')]);var _0x3bdfda={'where':_0xd903ee[_0xecbd('0x39')]};return db[_0xecbd('0x29')][_0xecbd('0x1c')](_0x3bdfda)[_0xecbd('0x20')](function(_0x23c4e1){_0x5130c3[_0xecbd('0x1c')]=_0x23c4e1;if(_0x26fbe2[_0xecbd('0x2f')][_0xecbd('0x3e')]){_0xd903ee[_0xecbd('0x3f')]=[{'all':!![]}];}return db[_0xecbd('0x29')][_0xecbd('0x40')](_0xd903ee);})[_0xecbd('0x20')](function(_0x3ba0cc){_0x5130c3[_0xecbd('0x41')]=_0x3ba0cc;return _0x5130c3;})[_0xecbd('0x20')](respondWithFilteredResult(_0x58682d,_0xd903ee))[_0xecbd('0x42')](handleError(_0x58682d,null));};exports[_0xecbd('0x43')]=function(_0x448e0c,_0x5a3b04){var _0x598bf7={'raw':![],'where':{'id':_0x448e0c[_0xecbd('0x44')]['id']}},_0x4e78e8={};_0x4e78e8[_0xecbd('0x2d')]=_[_0xecbd('0x30')](db[_0xecbd('0x29')][_0xecbd('0x45')]);_0x4e78e8[_0xecbd('0x2f')]=_['keys'](_0x448e0c[_0xecbd('0x2f')]);_0x4e78e8[_0xecbd('0x31')]=_[_0xecbd('0x46')](_0x4e78e8[_0xecbd('0x2d')],_0x4e78e8['query']);_0x598bf7['attributes']=_[_0xecbd('0x46')](_0x4e78e8[_0xecbd('0x2d')],qs[_0xecbd('0x32')](_0x448e0c[_0xecbd('0x2f')]['fields']));_0x598bf7[_0xecbd('0x33')]=_0x598bf7[_0xecbd('0x33')]['length']?_0x598bf7['attributes']:_0x4e78e8[_0xecbd('0x2d')];if(_0x448e0c[_0xecbd('0x2f')]['includeAll']){_0x598bf7['include']=[{'all':!![]}];}_0x598bf7=_[_0xecbd('0x3c')]({},_0x598bf7,_0x448e0c[_0xecbd('0x3d')]);return db[_0xecbd('0x29')]['find'](_0x598bf7)['then'](handleEntityNotFound(_0x5a3b04,null))[_0xecbd('0x20')](respondWithResult(_0x5a3b04,null))[_0xecbd('0x42')](handleError(_0x5a3b04,null));};exports[_0xecbd('0x47')]=function(_0x3bb563,_0x12e757){return db['Campaign']['create'](_0x3bb563[_0xecbd('0x48')],{})[_0xecbd('0x20')](function(_0x179fad){var _0xa4e33f=_0x3bb563[_0xecbd('0x49')][_0xecbd('0x22')]({'plain':!![]});if(!_0xa4e33f)throw new Error(_0xecbd('0x4a'));if(_0xa4e33f[_0xecbd('0x4b')]===_0xecbd('0x49')){var _0x57a30b=_0x179fad['get']({'plain':!![]});var _0x3a4161=_0xecbd('0x23');return db[_0xecbd('0x4c')]['find']({'where':{'name':_0x3a4161,'userProfileId':_0xa4e33f[_0xecbd('0x4d')]},'raw':!![]})[_0xecbd('0x20')](function(_0x3595c6){if(_0x3595c6&&_0x3595c6[_0xecbd('0x4e')]===0x0){return db[_0xecbd('0x24')]['create']({'name':_0x57a30b[_0xecbd('0x2e')],'resourceId':_0x57a30b['id'],'type':_0x3595c6[_0xecbd('0x2e')],'sectionId':_0x3595c6['id']},{})[_0xecbd('0x20')](function(){return _0x179fad;});}else{return _0x179fad;}})[_0xecbd('0x42')](function(_0x2296c3){logger['error'](_0xecbd('0x4f'),_0x2296c3);throw _0x2296c3;});}return _0x179fad;})[_0xecbd('0x20')](respondWithResult(_0x12e757,0xc9))[_0xecbd('0x42')](handleError(_0x12e757,null));};exports['clone']=function(_0x509be2,_0x5927dc){var _0x34698a={'where':{'id':_0x509be2[_0xecbd('0x44')]['id']}},_0x1ddb81={};_0x1ddb81[_0xecbd('0x2d')]=_[_0xecbd('0x30')](db[_0xecbd('0x29')][_0xecbd('0x45')]);_0x34698a['attributes']=_['intersection'](_0x1ddb81['model'],qs[_0xecbd('0x32')](_0x509be2[_0xecbd('0x2f')]['fields']));_0x34698a[_0xecbd('0x33')]=_0x34698a[_0xecbd('0x33')][_0xecbd('0x34')]?_0x34698a['attributes']:_0x1ddb81['model'];if(_0x509be2[_0xecbd('0x2f')][_0xecbd('0x3e')]){_0x34698a[_0xecbd('0x3f')]=[{'all':!![]}];}_0x34698a=_[_0xecbd('0x3c')]({},_0x34698a,_0x509be2[_0xecbd('0x3d')]);return db[_0xecbd('0x29')]['find'](_0x34698a)[_0xecbd('0x20')](handleEntityNotFound(_0x5927dc,null))[_0xecbd('0x20')](function(_0x1b320f){if(_0x1b320f){var _0x383945=_0x1b320f['get']({'plain':!![]});_0x383945=qs[_0xecbd('0x50')](_0x383945,['id',_0xecbd('0x51'),'updatedAt']);_0x509be2[_0xecbd('0x48')]=_[_0xecbd('0x50')](_0x509be2[_0xecbd('0x48')],['id',_0xecbd('0x51'),'updatedAt']);return db[_0xecbd('0x29')]['create'](_[_0xecbd('0x3c')](_0x383945,_0x509be2[_0xecbd('0x48')]),{'include':_0x509be2[_0xecbd('0x2f')][_0xecbd('0x3e')]?[{'all':!![]}]:undefined})[_0xecbd('0x20')](function(_0x138de8){var _0x399d29=_0x509be2[_0xecbd('0x49')]['get']({'plain':!![]});if(!_0x399d29)throw new Error(_0xecbd('0x4a'));if(_0x399d29[_0xecbd('0x4b')]===_0xecbd('0x49')){var _0x1cc38a=_0x138de8['get']({'plain':!![]});var _0x433d35=_0xecbd('0x23');return db[_0xecbd('0x4c')][_0xecbd('0x52')]({'where':{'name':_0x433d35,'userProfileId':_0x399d29[_0xecbd('0x4d')]},'raw':!![]})[_0xecbd('0x20')](function(_0x360ad4){if(_0x360ad4&&_0x360ad4[_0xecbd('0x4e')]===0x0){return db[_0xecbd('0x24')][_0xecbd('0x47')]({'name':_0x1cc38a[_0xecbd('0x2e')],'resourceId':_0x1cc38a['id'],'type':_0x360ad4[_0xecbd('0x2e')],'sectionId':_0x360ad4['id']},{})[_0xecbd('0x20')](function(){return _0x138de8;});}else{return _0x138de8;}})['catch'](function(_0x289708){logger['error'](_0xecbd('0x4f'),_0x289708);throw _0x289708;});}return _0x138de8;});}})[_0xecbd('0x20')](respondWithResult(_0x5927dc,0xc9))[_0xecbd('0x42')](handleError(_0x5927dc,null));};exports['update']=function(_0x845d5d,_0x48e387){if(_0x845d5d[_0xecbd('0x48')]['id']){delete _0x845d5d['body']['id'];}return db[_0xecbd('0x29')][_0xecbd('0x52')]({'where':{'id':_0x845d5d[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x48e387,null))[_0xecbd('0x20')](saveUpdates(_0x845d5d['body'],null))[_0xecbd('0x20')](respondWithResult(_0x48e387,null))[_0xecbd('0x42')](handleError(_0x48e387,null));};exports[_0xecbd('0x21')]=function(_0x3f622e,_0x395c65){return db[_0xecbd('0x29')][_0xecbd('0x52')]({'where':{'id':_0x3f622e[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x395c65,null))[_0xecbd('0x20')](removeEntity(_0x395c65,null))[_0xecbd('0x42')](handleError(_0x395c65,null));};exports[_0xecbd('0x53')]=function(_0x1e6bf7,_0x3add86,_0x2bafaa){var _0x497053={'raw':!![],'where':{}};var _0x54a92f={};var _0x13bd45={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x1e6bf7[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x3add86,null))[_0xecbd('0x20')](function(_0x3a0970){if(_0x3a0970){_0x54a92f[_0xecbd('0x2d')]=_[_0xecbd('0x30')](db[_0xecbd('0x54')]['rawAttributes']);_0x54a92f[_0xecbd('0x2f')]=_[_0xecbd('0x30')](_0x1e6bf7[_0xecbd('0x2f')]);_0x54a92f[_0xecbd('0x31')]=_[_0xecbd('0x46')](_0x54a92f[_0xecbd('0x2d')],_0x54a92f[_0xecbd('0x2f')]);_0x497053[_0xecbd('0x33')]=_['intersection'](_0x54a92f[_0xecbd('0x2d')],qs[_0xecbd('0x32')](_0x1e6bf7['query'][_0xecbd('0x32')]));_0x497053[_0xecbd('0x33')]=_0x497053[_0xecbd('0x33')][_0xecbd('0x34')]?_0x497053[_0xecbd('0x33')]:_0x54a92f[_0xecbd('0x2d')];if(!_0x1e6bf7[_0xecbd('0x2f')][_0xecbd('0x35')](_0xecbd('0x36'))){_0x497053['limit']=qs[_0xecbd('0x1b')](_0x1e6bf7[_0xecbd('0x2f')][_0xecbd('0x1b')]);_0x497053[_0xecbd('0x19')]=qs['offset'](_0x1e6bf7[_0xecbd('0x2f')][_0xecbd('0x19')]);}_0x497053[_0xecbd('0x37')]=qs[_0xecbd('0x38')](_0x1e6bf7[_0xecbd('0x2f')][_0xecbd('0x38')]);_0x497053[_0xecbd('0x39')]=qs[_0xecbd('0x31')](_[_0xecbd('0x3a')](_0x1e6bf7['query'],_0x54a92f[_0xecbd('0x31')]));_0x497053['where'][_0xecbd('0x55')]=_0x3a0970['id'];if(_0x1e6bf7[_0xecbd('0x2f')][_0xecbd('0x56')]){_0x497053['where']=_['merge'](_0x497053[_0xecbd('0x39')],{'$or':_[_0xecbd('0x28')](_0x497053[_0xecbd('0x33')],function(_0x1342ec){var _0x19ba76={};_0x19ba76[_0x1342ec]={'$like':'%'+_0x1e6bf7['query'][_0xecbd('0x56')]+'%'};return _0x19ba76;})});}_0x497053=_[_0xecbd('0x3c')]({},_0x497053,_0x1e6bf7[_0xecbd('0x3d')]);return db[_0xecbd('0x54')][_0xecbd('0x1c')]({'where':_0x497053[_0xecbd('0x39')]})[_0xecbd('0x20')](function(_0x420cac){_0x13bd45['count']=_0x420cac;if(_0x1e6bf7[_0xecbd('0x2f')][_0xecbd('0x3e')]){_0x497053[_0xecbd('0x3f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x497053);})[_0xecbd('0x20')](function(_0x2c0dc8){_0x13bd45[_0xecbd('0x41')]=_0x2c0dc8;return _0x13bd45;});}})[_0xecbd('0x20')](respondWithFilteredResult(_0x3add86,_0x497053))[_0xecbd('0x42')](handleError(_0x3add86,null));};exports['getHopperHistories']=function(_0x609e29,_0x2f9ce2,_0x1fa9f9){var _0x32738b={'raw':!![],'where':{}};var _0x5af7aa={};var _0xdbc074={'count':0x0,'rows':[]};return db['Campaign'][_0xecbd('0x57')]({'where':{'id':_0x609e29[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x2f9ce2,null))[_0xecbd('0x20')](function(_0x33b215){if(_0x33b215){_0x5af7aa[_0xecbd('0x2d')]=_[_0xecbd('0x30')](db[_0xecbd('0x58')][_0xecbd('0x45')]);_0x5af7aa[_0xecbd('0x2f')]=_[_0xecbd('0x30')](_0x609e29[_0xecbd('0x2f')]);_0x5af7aa[_0xecbd('0x31')]=_[_0xecbd('0x46')](_0x5af7aa['model'],_0x5af7aa[_0xecbd('0x2f')]);_0x32738b[_0xecbd('0x33')]=_['intersection'](_0x5af7aa[_0xecbd('0x2d')],qs[_0xecbd('0x32')](_0x609e29[_0xecbd('0x2f')][_0xecbd('0x32')]));_0x32738b[_0xecbd('0x33')]=_0x32738b[_0xecbd('0x33')]['length']?_0x32738b[_0xecbd('0x33')]:_0x5af7aa[_0xecbd('0x2d')];if(!_0x609e29[_0xecbd('0x2f')][_0xecbd('0x35')](_0xecbd('0x36'))){_0x32738b[_0xecbd('0x1b')]=qs['limit'](_0x609e29['query'][_0xecbd('0x1b')]);_0x32738b[_0xecbd('0x19')]=qs[_0xecbd('0x19')](_0x609e29[_0xecbd('0x2f')][_0xecbd('0x19')]);}_0x32738b[_0xecbd('0x37')]=qs[_0xecbd('0x38')](_0x609e29[_0xecbd('0x2f')][_0xecbd('0x38')]);_0x32738b[_0xecbd('0x39')]=qs['filters'](_[_0xecbd('0x3a')](_0x609e29['query'],_0x5af7aa[_0xecbd('0x31')]));_0x32738b[_0xecbd('0x39')][_0xecbd('0x55')]=_0x33b215['id'];if(_0x609e29[_0xecbd('0x2f')][_0xecbd('0x56')]){_0x32738b[_0xecbd('0x39')]=_['merge'](_0x32738b[_0xecbd('0x39')],{'$or':_[_0xecbd('0x28')](_0x32738b['attributes'],function(_0x1eb613){var _0x24fd1b={};_0x24fd1b[_0x1eb613]={'$like':'%'+_0x609e29[_0xecbd('0x2f')][_0xecbd('0x56')]+'%'};return _0x24fd1b;})});}_0x32738b=_[_0xecbd('0x3c')]({},_0x32738b,_0x609e29['options']);return db[_0xecbd('0x58')]['count']({'where':_0x32738b[_0xecbd('0x39')]})[_0xecbd('0x20')](function(_0x277a7c){_0xdbc074[_0xecbd('0x1c')]=_0x277a7c;if(_0x609e29[_0xecbd('0x2f')]['includeAll']){_0x32738b[_0xecbd('0x3f')]=[{'all':!![]}];}return db[_0xecbd('0x58')][_0xecbd('0x40')](_0x32738b);})['then'](function(_0x41e4f9){_0xdbc074['rows']=_0x41e4f9;return _0xdbc074;});}})[_0xecbd('0x20')](respondWithFilteredResult(_0x2f9ce2,_0x32738b))['catch'](handleError(_0x2f9ce2,null));};exports[_0xecbd('0x59')]=function(_0x163a5b,_0x5670f5,_0x479721){var _0x3b8f99={'raw':!![],'where':{}};var _0x599681={};var _0x59b961={'count':0x0,'rows':[]};return db['Campaign'][_0xecbd('0x57')]({'where':{'id':_0x163a5b[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x5670f5,null))['then'](function(_0x371392){if(_0x371392){_0x599681['model']=_[_0xecbd('0x30')](db[_0xecbd('0x5a')][_0xecbd('0x45')]);_0x599681[_0xecbd('0x2f')]=_[_0xecbd('0x30')](_0x163a5b[_0xecbd('0x2f')]);_0x599681[_0xecbd('0x31')]=_['intersection'](_0x599681[_0xecbd('0x2d')],_0x599681[_0xecbd('0x2f')]);_0x3b8f99[_0xecbd('0x33')]=_[_0xecbd('0x46')](_0x599681['model'],qs[_0xecbd('0x32')](_0x163a5b['query'][_0xecbd('0x32')]));_0x3b8f99[_0xecbd('0x33')]=_0x3b8f99[_0xecbd('0x33')][_0xecbd('0x34')]?_0x3b8f99['attributes']:_0x599681[_0xecbd('0x2d')];if(!_0x163a5b[_0xecbd('0x2f')][_0xecbd('0x35')](_0xecbd('0x36'))){_0x3b8f99['limit']=qs[_0xecbd('0x1b')](_0x163a5b[_0xecbd('0x2f')][_0xecbd('0x1b')]);_0x3b8f99['offset']=qs[_0xecbd('0x19')](_0x163a5b[_0xecbd('0x2f')]['offset']);}_0x3b8f99[_0xecbd('0x37')]=qs['sort'](_0x163a5b[_0xecbd('0x2f')]['sort']);_0x3b8f99[_0xecbd('0x39')]=qs[_0xecbd('0x31')](_[_0xecbd('0x3a')](_0x163a5b[_0xecbd('0x2f')],_0x599681[_0xecbd('0x31')]));_0x3b8f99[_0xecbd('0x39')]['CampaignId']=_0x371392['id'];if(_0x163a5b[_0xecbd('0x2f')]['filter']){_0x3b8f99[_0xecbd('0x39')]=_[_0xecbd('0x3c')](_0x3b8f99['where'],{'$or':_[_0xecbd('0x28')](_0x3b8f99[_0xecbd('0x33')],function(_0x391ca7){var _0x3cf3b4={};_0x3cf3b4[_0x391ca7]={'$like':'%'+_0x163a5b[_0xecbd('0x2f')][_0xecbd('0x56')]+'%'};return _0x3cf3b4;})});}_0x3b8f99=_[_0xecbd('0x3c')]({},_0x3b8f99,_0x163a5b[_0xecbd('0x3d')]);return db[_0xecbd('0x5a')][_0xecbd('0x1c')]({'where':_0x3b8f99[_0xecbd('0x39')]})[_0xecbd('0x20')](function(_0x51e472){_0x59b961[_0xecbd('0x1c')]=_0x51e472;if(_0x163a5b[_0xecbd('0x2f')][_0xecbd('0x3e')]){_0x3b8f99[_0xecbd('0x3f')]=[{'all':!![]}];}return db[_0xecbd('0x5a')][_0xecbd('0x40')](_0x3b8f99);})[_0xecbd('0x20')](function(_0x4f88ce){_0x59b961['rows']=_0x4f88ce;return _0x59b961;});}})[_0xecbd('0x20')](respondWithFilteredResult(_0x5670f5,_0x3b8f99))[_0xecbd('0x42')](handleError(_0x5670f5,null));};exports[_0xecbd('0x5b')]=function(_0x562fd4,_0x516a6f,_0x4b8b88){var _0x1a6a75={'raw':!![],'where':{}};var _0x40050e={};var _0x53702d={'count':0x0,'rows':[]};return db[_0xecbd('0x29')]['findOne']({'where':{'id':_0x562fd4[_0xecbd('0x44')]['id']}})['then'](handleEntityNotFound(_0x516a6f,null))[_0xecbd('0x20')](function(_0x15eb7a){if(_0x15eb7a){_0x40050e[_0xecbd('0x2d')]=_[_0xecbd('0x30')](db[_0xecbd('0x5c')]['rawAttributes']);_0x40050e[_0xecbd('0x2f')]=_[_0xecbd('0x30')](_0x562fd4[_0xecbd('0x2f')]);_0x40050e['filters']=_[_0xecbd('0x46')](_0x40050e[_0xecbd('0x2d')],_0x40050e[_0xecbd('0x2f')]);_0x1a6a75[_0xecbd('0x33')]=_['intersection'](_0x40050e['model'],qs[_0xecbd('0x32')](_0x562fd4[_0xecbd('0x2f')][_0xecbd('0x32')]));_0x1a6a75['attributes']=_0x1a6a75[_0xecbd('0x33')][_0xecbd('0x34')]?_0x1a6a75[_0xecbd('0x33')]:_0x40050e[_0xecbd('0x2d')];if(!_0x562fd4[_0xecbd('0x2f')]['hasOwnProperty'](_0xecbd('0x36'))){_0x1a6a75['limit']=qs[_0xecbd('0x1b')](_0x562fd4[_0xecbd('0x2f')]['limit']);_0x1a6a75[_0xecbd('0x19')]=qs[_0xecbd('0x19')](_0x562fd4[_0xecbd('0x2f')]['offset']);}_0x1a6a75[_0xecbd('0x37')]=qs[_0xecbd('0x38')](_0x562fd4[_0xecbd('0x2f')][_0xecbd('0x38')]);_0x1a6a75[_0xecbd('0x39')]=qs[_0xecbd('0x31')](_[_0xecbd('0x3a')](_0x562fd4[_0xecbd('0x2f')],_0x40050e[_0xecbd('0x31')]));_0x1a6a75[_0xecbd('0x39')][_0xecbd('0x55')]=_0x15eb7a['id'];if(_0x562fd4[_0xecbd('0x2f')][_0xecbd('0x56')]){_0x1a6a75[_0xecbd('0x39')]=_[_0xecbd('0x3c')](_0x1a6a75[_0xecbd('0x39')],{'$or':_[_0xecbd('0x28')](_0x1a6a75[_0xecbd('0x33')],function(_0x47c2d4){var _0xcafee3={};_0xcafee3[_0x47c2d4]={'$like':'%'+_0x562fd4[_0xecbd('0x2f')][_0xecbd('0x56')]+'%'};return _0xcafee3;})});}_0x1a6a75=_[_0xecbd('0x3c')]({},_0x1a6a75,_0x562fd4[_0xecbd('0x3d')]);return db[_0xecbd('0x5c')][_0xecbd('0x1c')]({'where':_0x1a6a75[_0xecbd('0x39')]})[_0xecbd('0x20')](function(_0x201bb7){_0x53702d['count']=_0x201bb7;if(_0x562fd4[_0xecbd('0x2f')][_0xecbd('0x3e')]){_0x1a6a75['include']=[{'all':!![]}];}return db[_0xecbd('0x5c')][_0xecbd('0x40')](_0x1a6a75);})[_0xecbd('0x20')](function(_0x12d29c){_0x53702d[_0xecbd('0x41')]=_0x12d29c;return _0x53702d;});}})[_0xecbd('0x20')](respondWithFilteredResult(_0x516a6f,_0x1a6a75))[_0xecbd('0x42')](handleError(_0x516a6f,null));};exports[_0xecbd('0x5d')]=function(_0x5a6b2f,_0x3675e1,_0x2173a9){var _0x5bcce8={};var _0x9b9100={};var _0x2b3646;var _0x1aa13b;return db[_0xecbd('0x29')]['findOne']({'where':{'id':_0x5a6b2f[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x3675e1,null))[_0xecbd('0x20')](function(_0x10e246){if(_0x10e246){_0x2b3646=_0x10e246;_0x9b9100[_0xecbd('0x2d')]=_['keys'](db[_0xecbd('0x5e')][_0xecbd('0x45')]);_0x9b9100['query']=_[_0xecbd('0x30')](_0x5a6b2f[_0xecbd('0x2f')]);_0x9b9100[_0xecbd('0x31')]=_[_0xecbd('0x46')](_0x9b9100[_0xecbd('0x2d')],_0x9b9100[_0xecbd('0x2f')]);_0x5bcce8[_0xecbd('0x33')]=_[_0xecbd('0x46')](_0x9b9100['model'],qs[_0xecbd('0x32')](_0x5a6b2f[_0xecbd('0x2f')][_0xecbd('0x32')]));_0x5bcce8[_0xecbd('0x33')]=_0x5bcce8[_0xecbd('0x33')][_0xecbd('0x34')]?_0x5bcce8['attributes']:_0x9b9100[_0xecbd('0x2d')];_0x5bcce8[_0xecbd('0x37')]=qs[_0xecbd('0x38')](_0x5a6b2f[_0xecbd('0x2f')]['sort']);_0x5bcce8['where']=qs['filters'](_['pick'](_0x5a6b2f['query'],_0x9b9100[_0xecbd('0x31')]));if(_0x5a6b2f[_0xecbd('0x2f')][_0xecbd('0x56')]){_0x5bcce8[_0xecbd('0x39')]=_['merge'](_0x5bcce8[_0xecbd('0x39')],{'$or':_[_0xecbd('0x28')](_0x5bcce8[_0xecbd('0x33')],function(_0x4d65b4){var _0x1bf346={};_0x1bf346[_0x4d65b4]={'$like':'%'+_0x5a6b2f[_0xecbd('0x2f')]['filter']+'%'};return _0x1bf346;})});}_0x5bcce8=_[_0xecbd('0x3c')]({},_0x5bcce8,_0x5a6b2f[_0xecbd('0x3d')]);return _0x2b3646['getLists'](_0x5bcce8);}})[_0xecbd('0x20')](function(_0x2d105a){if(_0x2d105a){_0x1aa13b=_0x2d105a['length'];if(!_0x5a6b2f[_0xecbd('0x2f')][_0xecbd('0x35')](_0xecbd('0x36'))){_0x5bcce8[_0xecbd('0x1b')]=qs[_0xecbd('0x1b')](_0x5a6b2f[_0xecbd('0x2f')][_0xecbd('0x1b')]);_0x5bcce8[_0xecbd('0x19')]=qs[_0xecbd('0x19')](_0x5a6b2f[_0xecbd('0x2f')][_0xecbd('0x19')]);}return _0x2b3646['getLists'](_0x5bcce8);}})[_0xecbd('0x20')](function(_0x9071a3){if(_0x9071a3){return _0x9071a3?{'count':_0x1aa13b,'rows':_0x9071a3}:null;}})['then'](respondWithResult(_0x3675e1,null))[_0xecbd('0x42')](handleError(_0x3675e1,null));};exports[_0xecbd('0x5f')]=function(_0x1ab417,_0x4fca5a,_0x46f637){var _0x3a5651,_0x49f093;var _0x2482ed=[];var _0x41c426=moment()['format'](_0xecbd('0x60'));return db[_0xecbd('0x29')]['find']({'where':{'id':_0x1ab417[_0xecbd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4fca5a,null))[_0xecbd('0x20')](function(_0x369cae){if(_0x369cae){_0x49f093=_0x369cae;return _0x369cae[_0xecbd('0x5f')](_0x1ab417[_0xecbd('0x48')][_0xecbd('0x61')],_[_0xecbd('0x50')](_0x1ab417[_0xecbd('0x48')],[_0xecbd('0x61'),'id'])||{});}return null;})[_0xecbd('0x62')](function(_0x36b5d0){var _0x472802;var _0xe2de24;_0x3a5651=_0x36b5d0||[];var _0x3f7c7e=[];if(_0x36b5d0){for(var _0x392e01=0x0;_0x392e01<_0x36b5d0[_0xecbd('0x34')];_0x392e01+=0x1){var _0x4eca25=_0x36b5d0[_0x392e01]['get']({'plain':!![]});_0x49f093['dialCheckDuplicateType']=_0x1ab417[_0xecbd('0x48')][_0xecbd('0x63')]?_0x1ab417[_0xecbd('0x48')][_0xecbd('0x63')]:_0x49f093[_0xecbd('0x63')];switch(_0x49f093[_0xecbd('0x63')]){case _0xecbd('0x64'):_0x472802=squel[_0xecbd('0x65')]()[_0xecbd('0x66')](_0xecbd('0x67'))[_0xecbd('0x68')]([_0xecbd('0x69'),_0xecbd('0x6a'),'ContactId',_0xecbd('0x6b'),'CampaignId',_0xecbd('0x51'),_0xecbd('0x6c')],squel[_0xecbd('0x6d')]()[_0xecbd('0x6e')](_0xecbd('0x69'),_0xecbd('0x69'))[_0xecbd('0x6e')](_0xecbd('0x6f'),_0xecbd('0x6a'))[_0xecbd('0x6e')]('id','ContactId')[_0xecbd('0x6e')](_0x4eca25[_0xecbd('0x70')]['toString'](),_0xecbd('0x6b'))[_0xecbd('0x6e')](_0x1ab417[_0xecbd('0x44')]['id'][_0xecbd('0x71')](),_0xecbd('0x55'))['field']('\x27'+_0x41c426+'\x27','createdAt')[_0xecbd('0x6e')]('\x27'+_0x41c426+'\x27',_0xecbd('0x6c'))[_0xecbd('0x72')](_0xecbd('0x73'))[_0xecbd('0x39')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x4eca25[_0xecbd('0x70')][_0xecbd('0x71')]())[_0xecbd('0x39')](_0xecbd('0x74'))['where'](_0xecbd('0x75'),squel['select']()[_0xecbd('0x6e')](_0xecbd('0x76'))[_0xecbd('0x72')](_0xecbd('0x77'))[_0xecbd('0x39')](_0xecbd('0x78'),_0x1ab417[_0xecbd('0x44')]['id'][_0xecbd('0x71')]()))[_0xecbd('0x39')](_0xecbd('0x75'),squel[_0xecbd('0x6d')]()['field']('COALESCE(phone,\x27\x27)')[_0xecbd('0x72')](_0xecbd('0x67'))['where']('CampaignId\x20=\x20?',_0x1ab417['params']['id'][_0xecbd('0x71')]())))['toString']();break;case'onlyIfOpen':_0x472802=squel[_0xecbd('0x65')]()['into'](_0xecbd('0x67'))['fromQuery']([_0xecbd('0x69'),_0xecbd('0x6a'),'ContactId','ListId',_0xecbd('0x55'),'createdAt','updatedAt'],squel[_0xecbd('0x6d')]()[_0xecbd('0x6e')](_0xecbd('0x69'),_0xecbd('0x69'))[_0xecbd('0x6e')]('NOW()',_0xecbd('0x6a'))[_0xecbd('0x6e')]('id',_0xecbd('0x79'))[_0xecbd('0x6e')](_0x4eca25[_0xecbd('0x70')][_0xecbd('0x71')](),_0xecbd('0x6b'))[_0xecbd('0x6e')](_0x1ab417[_0xecbd('0x44')]['id'][_0xecbd('0x71')](),_0xecbd('0x55'))[_0xecbd('0x6e')]('\x27'+_0x41c426+'\x27',_0xecbd('0x51'))[_0xecbd('0x6e')]('\x27'+_0x41c426+'\x27','updatedAt')[_0xecbd('0x72')]('cm_contacts')[_0xecbd('0x39')]('deletedAt\x20IS\x20NULL')[_0xecbd('0x39')](_0xecbd('0x7a'),_0x4eca25[_0xecbd('0x70')]['toString']())[_0xecbd('0x39')](_0xecbd('0x74'))[_0xecbd('0x39')](_0xecbd('0x75'),squel[_0xecbd('0x6d')]()[_0xecbd('0x6e')]('COALESCE(phone,\x27\x27)')[_0xecbd('0x72')](_0xecbd('0x67'))[_0xecbd('0x39')](_0xecbd('0x78'),_0x1ab417['params']['id'][_0xecbd('0x71')]())))[_0xecbd('0x71')]();break;default:_0x472802=squel[_0xecbd('0x65')]()[_0xecbd('0x66')](_0xecbd('0x67'))[_0xecbd('0x68')]([_0xecbd('0x69'),_0xecbd('0x6a'),_0xecbd('0x79'),'ListId',_0xecbd('0x55'),_0xecbd('0x51'),'updatedAt'],squel['select']()[_0xecbd('0x6e')](_0xecbd('0x69'),_0xecbd('0x69'))['field'](_0xecbd('0x6f'),'scheduledAt')['field']('id',_0xecbd('0x79'))[_0xecbd('0x6e')](_0x4eca25[_0xecbd('0x70')]['toString'](),'ListId')['field'](_0x1ab417[_0xecbd('0x44')]['id']['toString'](),_0xecbd('0x55'))[_0xecbd('0x6e')]('\x27'+_0x41c426+'\x27',_0xecbd('0x51'))['field']('\x27'+_0x41c426+'\x27','updatedAt')[_0xecbd('0x72')](_0xecbd('0x73'))[_0xecbd('0x39')](_0xecbd('0x7b'))[_0xecbd('0x39')](_0xecbd('0x7a'),_0x4eca25[_0xecbd('0x70')][_0xecbd('0x71')]())[_0xecbd('0x39')](_0xecbd('0x74')))[_0xecbd('0x71')]();}_0xe2de24=squel[_0xecbd('0x65')]()[_0xecbd('0x66')]('cm_hopper_additional_phones')[_0xecbd('0x68')]([_0xecbd('0x7c'),'scheduledAt','phone','OrderBy',_0xecbd('0x51'),_0xecbd('0x6c')],squel[_0xecbd('0x6d')]()[_0xecbd('0x6e')](_0xecbd('0x7d'),'id')[_0xecbd('0x6e')](_0xecbd('0x6f'),'scheduledAt')[_0xecbd('0x6e')](_0xecbd('0x7e'),_0xecbd('0x69'))[_0xecbd('0x6e')](_0xecbd('0x7f'),_0xecbd('0x80'))[_0xecbd('0x6e')]('\x27'+_0x41c426+'\x27','createdAt')[_0xecbd('0x6e')]('\x27'+_0x41c426+'\x27',_0xecbd('0x6c'))['from'](_0xecbd('0x81'),'ci')[_0xecbd('0x82')](_0xecbd('0x67'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xecbd('0x39')]('h.ListId\x20=\x20?',_0x4eca25[_0xecbd('0x70')][_0xecbd('0x71')]())[_0xecbd('0x39')](_0xecbd('0x83'),_0x1ab417[_0xecbd('0x44')]['id']['toString']())[_0xecbd('0x39')]('h.createdAt\x20=\x20?',_0x41c426))[_0xecbd('0x71')]();_0x3f7c7e[_0xecbd('0x84')](db[_0xecbd('0x85')][_0xecbd('0x2f')](_0x472802));_0x2482ed[_0xecbd('0x84')](db[_0xecbd('0x85')][_0xecbd('0x2f')](_0xe2de24));}return BPromise[_0xecbd('0x86')](_0x3f7c7e);}})[_0xecbd('0x20')](function(){return BPromise[_0xecbd('0x86')](_0x2482ed);})[_0xecbd('0x20')](function(){return _0x3a5651;})[_0xecbd('0x20')](respondWithResult(_0x4fca5a,null))['catch'](handleError(_0x4fca5a,null));};exports['removeLists']=function(_0x367bcd,_0x23244f,_0x24e130){return db['Campaign']['find']({'where':{'id':_0x367bcd[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x23244f,null))[_0xecbd('0x20')](function(_0x47cd4c){if(_0x47cd4c){return _0x47cd4c[_0xecbd('0x87')](_0x367bcd[_0xecbd('0x2f')][_0xecbd('0x61')]);}})['then'](function(_0x4a8ec7){if(_0x4a8ec7){return db[_0xecbd('0x54')][_0xecbd('0x21')]({'where':{'ListId':_0x367bcd[_0xecbd('0x2f')][_0xecbd('0x61')],'CampaignId':_0x367bcd['params']['id']}})[_0xecbd('0x20')](function(){return _0x4a8ec7;});}})['then'](respondWithStatusCode(_0x23244f,null))['catch'](handleError(_0x23244f,null));};exports[_0xecbd('0x88')]=function(_0x1eaf0f,_0x12f89e,_0x18c1c9){var _0x4c6446={};var _0x14f7d3={};var _0x21455f;var _0x444df0;return db[_0xecbd('0x29')][_0xecbd('0x57')]({'where':{'id':_0x1eaf0f[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x12f89e,null))[_0xecbd('0x20')](function(_0x5d92c7){if(_0x5d92c7){_0x21455f=_0x5d92c7;_0x14f7d3[_0xecbd('0x2d')]=_[_0xecbd('0x30')](db[_0xecbd('0x5e')][_0xecbd('0x45')]);_0x14f7d3[_0xecbd('0x2f')]=_[_0xecbd('0x30')](_0x1eaf0f[_0xecbd('0x2f')]);_0x14f7d3['filters']=_[_0xecbd('0x46')](_0x14f7d3[_0xecbd('0x2d')],_0x14f7d3[_0xecbd('0x2f')]);_0x4c6446['attributes']=_[_0xecbd('0x46')](_0x14f7d3[_0xecbd('0x2d')],qs[_0xecbd('0x32')](_0x1eaf0f['query']['fields']));_0x4c6446[_0xecbd('0x33')]=_0x4c6446[_0xecbd('0x33')][_0xecbd('0x34')]?_0x4c6446['attributes']:_0x14f7d3[_0xecbd('0x2d')];_0x4c6446['order']=qs[_0xecbd('0x38')](_0x1eaf0f[_0xecbd('0x2f')]['sort']);_0x4c6446[_0xecbd('0x39')]=qs[_0xecbd('0x31')](_['pick'](_0x1eaf0f[_0xecbd('0x2f')],_0x14f7d3[_0xecbd('0x31')]));if(_0x1eaf0f[_0xecbd('0x2f')][_0xecbd('0x56')]){_0x4c6446[_0xecbd('0x39')]=_[_0xecbd('0x3c')](_0x4c6446['where'],{'$or':_[_0xecbd('0x28')](_0x4c6446['attributes'],function(_0x37d95d){var _0x53aa05={};_0x53aa05[_0x37d95d]={'$like':'%'+_0x1eaf0f[_0xecbd('0x2f')][_0xecbd('0x56')]+'%'};return _0x53aa05;})});}_0x4c6446=_['merge']({},_0x4c6446,_0x1eaf0f[_0xecbd('0x3d')]);return _0x21455f[_0xecbd('0x88')](_0x4c6446);}})[_0xecbd('0x20')](function(_0x5cd44b){if(_0x5cd44b){_0x444df0=_0x5cd44b[_0xecbd('0x34')];if(!_0x1eaf0f[_0xecbd('0x2f')][_0xecbd('0x35')](_0xecbd('0x36'))){_0x4c6446[_0xecbd('0x1b')]=qs['limit'](_0x1eaf0f['query'][_0xecbd('0x1b')]);_0x4c6446['offset']=qs['offset'](_0x1eaf0f['query']['offset']);}return _0x21455f['getBlackLists'](_0x4c6446);}})[_0xecbd('0x20')](function(_0x38a542){if(_0x38a542){return _0x38a542?{'count':_0x444df0,'rows':_0x38a542}:null;}})[_0xecbd('0x20')](respondWithResult(_0x12f89e,null))['catch'](handleError(_0x12f89e,null));};exports[_0xecbd('0x89')]=function(_0x27a75a,_0xc0fcc4,_0x52f9eb){var _0x2b5614,_0x303358;var _0x57adc4=[];var _0x3d028d=moment()[_0xecbd('0x8a')](_0xecbd('0x60'));return db['Campaign']['find']({'where':{'id':_0x27a75a[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0xc0fcc4,null))[_0xecbd('0x20')](function(_0xbc55ab){if(_0xbc55ab){_0x303358=_0xbc55ab;return _0xbc55ab['addBlackLists'](_0x27a75a['body'][_0xecbd('0x61')],_[_0xecbd('0x50')](_0x27a75a[_0xecbd('0x48')],['ids','id'])||{});}return null;})['spread'](function(_0x397aeb){var _0x568652;var _0x524c05;_0x2b5614=_0x397aeb||[];var _0x2e0d07=[];if(_0x397aeb){for(var _0x4610f5=0x0;_0x4610f5<_0x397aeb[_0xecbd('0x34')];_0x4610f5+=0x1){var _0x5278f3=_0x397aeb[_0x4610f5][_0xecbd('0x22')]({'plain':!![]});_0x568652=squel[_0xecbd('0x65')]()[_0xecbd('0x66')](_0xecbd('0x8b'))['fromQuery']([_0xecbd('0x69'),_0xecbd('0x79'),_0xecbd('0x6b'),_0xecbd('0x55'),'createdAt',_0xecbd('0x6c')],squel[_0xecbd('0x6d')]()['field']('phone','phone')['field']('id',_0xecbd('0x79'))['field'](_0x5278f3['CmListId'][_0xecbd('0x71')](),'ListId')[_0xecbd('0x6e')](_0x27a75a['params']['id']['toString'](),_0xecbd('0x55'))[_0xecbd('0x6e')](_0xecbd('0x6f'),_0xecbd('0x51'))['field'](_0xecbd('0x6f'),_0xecbd('0x6c'))[_0xecbd('0x72')](_0xecbd('0x73'))[_0xecbd('0x39')]('deletedAt\x20IS\x20NULL')[_0xecbd('0x39')]('ListId\x20=\x20?',_0x5278f3[_0xecbd('0x70')]['toString']())[_0xecbd('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xecbd('0x71')]();_0x2e0d07[_0xecbd('0x84')](db['sequelize'][_0xecbd('0x2f')](_0x568652));}return BPromise[_0xecbd('0x86')](_0x2e0d07);}})['then'](function(){return _0x2b5614;})[_0xecbd('0x20')](respondWithResult(_0xc0fcc4,null))[_0xecbd('0x42')](handleError(_0xc0fcc4,null));};exports[_0xecbd('0x8c')]=function(_0x4b96f0,_0x85d2b4,_0x148bc8){return db[_0xecbd('0x29')][_0xecbd('0x52')]({'where':{'id':_0x4b96f0[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](handleEntityNotFound(_0x85d2b4,null))[_0xecbd('0x20')](function(_0xd44a72){if(_0xd44a72){return _0xd44a72[_0xecbd('0x8c')](_0x4b96f0[_0xecbd('0x2f')][_0xecbd('0x61')]);}})[_0xecbd('0x20')](function(_0x5f2334){if(_0x5f2334){return db[_0xecbd('0x5c')][_0xecbd('0x21')]({'where':{'ListId':_0x4b96f0['query'][_0xecbd('0x61')],'CampaignId':_0x4b96f0[_0xecbd('0x44')]['id']}})[_0xecbd('0x20')](function(){return _0x5f2334;});}})['then'](respondWithStatusCode(_0x85d2b4,null))['catch'](handleError(_0x85d2b4,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index f7d951d..033d84f 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(_0xdfd552,_0x5f39a0){var _0x598335=function(_0x1dc924){while(--_0x1dc924){_0xdfd552['push'](_0xdfd552['shift']());}};_0x598335(++_0x5f39a0);}(_0x7a54,0x106));var _0x47a5=function(_0x542446,_0x5a6f4f){_0x542446=_0x542446-0x0;var _0x636a98=_0x7a54[_0x542446];return _0x636a98;};'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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x493030,_0x29ec7e){var _0x56f5e4=function(_0xb929a1){while(--_0xb929a1){_0x493030['push'](_0x493030['shift']());}};_0x56f5e4(++_0x29ec7e);}(_0x7a54,0x106));var _0x47a5=function(_0x3dd33e,_0xdee545){_0x3dd33e=_0x3dd33e-0x0;var _0x593e3f=_0x7a54[_0x3dd33e];return _0x593e3f;};'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 diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 608432c..1604416 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 _0xab3a=['request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetCampaign','Campaign','findAll','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab3a,0x1d3));var _0xaab3=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0xab3a[_0x479650];return _0x26b288;};'use strict';var _=require(_0xaab3('0x0'));var util=require(_0xaab3('0x1'));var moment=require(_0xaab3('0x2'));var BPromise=require(_0xaab3('0x3'));var rs=require(_0xaab3('0x4'));var fs=require('fs');var Redis=require(_0xaab3('0x5'));var db=require(_0xaab3('0x6'))['db'];var utils=require(_0xaab3('0x7'));var logger=require(_0xaab3('0x8'))(_0xaab3('0x9'));var config=require(_0xaab3('0xa'));var jayson=require(_0xaab3('0xb'));var client=jayson[_0xaab3('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5760e8,_0x501657,_0x1fd19f){return new BPromise(function(_0x146453,_0x21527a){return client[_0xaab3('0xd')](_0x5760e8,_0x1fd19f)[_0xaab3('0xe')](function(_0x15841e){logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));logger[_0xaab3('0x12')]('Campaign,\x20%s,\x20%s,\x20%s',_0x501657,'request\x20sent',JSON[_0xaab3('0x13')](_0x15841e));if(_0x15841e[_0xaab3('0x14')]){if(_0x15841e[_0xaab3('0x14')][_0xaab3('0x15')]===0x1f4){logger['error'](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x21527a(_0x15841e['error'][_0xaab3('0x16')]);}logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x15841e['error'][_0xaab3('0x16')]);return _0x146453(_0x15841e[_0xaab3('0x14')]['message']);}else{logger[_0xaab3('0xf')](_0xaab3('0x10'),_0x501657,_0xaab3('0x11'));_0x146453(_0x15841e['result']['message']);}})['catch'](function(_0x484dc5){logger[_0xaab3('0x14')](_0xaab3('0x10'),_0x501657,_0x484dc5);_0x21527a(_0x484dc5);});});}exports[_0xaab3('0x17')]=function(_0x5a3ecc){var _0x3052a5=this;return new Promise(function(_0x46aefc,_0x3a06f2){return db[_0xaab3('0x18')][_0xaab3('0x19')]({'raw':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1b')]||null:null,'attributes':_0x5a3ecc[_0xaab3('0x1a')]?_0x5a3ecc[_0xaab3('0x1a')]['attributes']||null:null,'limit':_0x5a3ecc['options']?_0x5a3ecc['options']['limit']||null:null,'include':_0x5a3ecc['options']?_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x5a3ecc[_0xaab3('0x1a')][_0xaab3('0x1c')],function(_0x1816ab){return{'model':db[_0x1816ab[_0xaab3('0x1e')]],'as':_0x1816ab['as'],'attributes':_0x1816ab[_0xaab3('0x1f')],'include':_0x1816ab[_0xaab3('0x1c')]?_[_0xaab3('0x1d')](_0x1816ab[_0xaab3('0x1c')],function(_0x3097ec){return{'model':db[_0x3097ec[_0xaab3('0x1e')]],'as':_0x3097ec['as'],'attributes':_0x3097ec['attributes'],'include':_0x3097ec[_0xaab3('0x1c')]?_['map'](_0x3097ec[_0xaab3('0x1c')],function(_0x2904f8){return{'model':db[_0x2904f8['model']],'as':_0x2904f8['as'],'attributes':_0x2904f8[_0xaab3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaab3('0xe')](function(_0x263362){logger['info']('GetCampaign',_0x5a3ecc);logger[_0xaab3('0x12')](_0xaab3('0x17'),_0x5a3ecc,JSON[_0xaab3('0x13')](_0x263362));_0x46aefc(_0x263362);})['catch'](function(_0x168eb0){logger[_0xaab3('0x14')](_0xaab3('0x17'),_0x168eb0[_0xaab3('0x16')],_0x5a3ecc);_0x3a06f2(_0x3052a5[_0xaab3('0x14')](0x1f4,_0x168eb0[_0xaab3('0x16')]));});});}; \ No newline at end of file +var _0xb18e=['attributes','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xb18e,0x181));var _0xeb18=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0xb18e[_0x569caa];return _0x44cb5a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeb18('0x0'));var BPromise=require('bluebird');var rs=require(_0xeb18('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb18('0x2'))['db'];var utils=require(_0xeb18('0x3'));var logger=require('../../config/logger')(_0xeb18('0x4'));var config=require(_0xeb18('0x5'));var jayson=require(_0xeb18('0x6'));var client=jayson[_0xeb18('0x7')][_0xeb18('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x183bdf,_0x4a9ddd,_0x1bc3ee){return new BPromise(function(_0x131389,_0x534358){return client[_0xeb18('0x9')](_0x183bdf,_0x1bc3ee)[_0xeb18('0xa')](function(_0x942945){logger[_0xeb18('0xb')](_0xeb18('0xc'),_0x4a9ddd,_0xeb18('0xd'));logger[_0xeb18('0xe')](_0xeb18('0xf'),_0x4a9ddd,_0xeb18('0xd'),JSON[_0xeb18('0x10')](_0x942945));if(_0x942945['error']){if(_0x942945[_0xeb18('0x11')][_0xeb18('0x12')]===0x1f4){logger['error'](_0xeb18('0xc'),_0x4a9ddd,_0x942945['error']['message']);return _0x534358(_0x942945[_0xeb18('0x11')][_0xeb18('0x13')]);}logger[_0xeb18('0x11')]('Campaign,\x20%s,\x20%s',_0x4a9ddd,_0x942945['error'][_0xeb18('0x13')]);return _0x131389(_0x942945[_0xeb18('0x11')]['message']);}else{logger[_0xeb18('0xb')](_0xeb18('0xc'),_0x4a9ddd,_0xeb18('0xd'));_0x131389(_0x942945['result'][_0xeb18('0x13')]);}})[_0xeb18('0x14')](function(_0x318043){logger[_0xeb18('0x11')](_0xeb18('0xc'),_0x4a9ddd,_0x318043);_0x534358(_0x318043);});});}exports[_0xeb18('0x15')]=function(_0x284733){var _0x5bc586=this;return new Promise(function(_0x30f706,_0x5c4adc){return db[_0xeb18('0x16')][_0xeb18('0x17')]({'raw':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')][_0xeb18('0x19')]===undefined?!![]:![]:!![],'where':_0x284733['options']?_0x284733[_0xeb18('0x18')][_0xeb18('0x1a')]||null:null,'attributes':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')]['attributes']||null:null,'limit':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')][_0xeb18('0x1b')]||null:null,'include':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')][_0xeb18('0x1c')]?_[_0xeb18('0x1d')](_0x284733[_0xeb18('0x18')][_0xeb18('0x1c')],function(_0x7464fd){return{'model':db[_0x7464fd[_0xeb18('0x1e')]],'as':_0x7464fd['as'],'attributes':_0x7464fd[_0xeb18('0x1f')],'include':_0x7464fd['include']?_[_0xeb18('0x1d')](_0x7464fd['include'],function(_0x51867f){return{'model':db[_0x51867f[_0xeb18('0x1e')]],'as':_0x51867f['as'],'attributes':_0x51867f[_0xeb18('0x1f')],'include':_0x51867f[_0xeb18('0x1c')]?_[_0xeb18('0x1d')](_0x51867f[_0xeb18('0x1c')],function(_0x48d10b){return{'model':db[_0x48d10b['model']],'as':_0x48d10b['as'],'attributes':_0x48d10b[_0xeb18('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xeb18('0xa')](function(_0x3312d8){logger['info'](_0xeb18('0x15'),_0x284733);logger[_0xeb18('0xe')]('GetCampaign',_0x284733,JSON[_0xeb18('0x10')](_0x3312d8));_0x30f706(_0x3312d8);})['catch'](function(_0x54e62b){logger['error']('GetCampaign',_0x54e62b['message'],_0x284733);_0x5c4adc(_0x5bc586[_0xeb18('0x11')](0x1f4,_0x54e62b[_0xeb18('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index e25e49c..d4eabdf 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 _0xf5c4=['getHopperFinals','/:id/hopper_black','/:id/lists','getLists','getBlackLists','post','clone','addLists','/:id/blacklists','addBlackLists','put','update','delete','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','/:id','show','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x133296,_0xe8ff9a){var _0x193517=function(_0x161ffd){while(--_0x161ffd){_0x133296['push'](_0x133296['shift']());}};_0x193517(++_0xe8ff9a);}(_0xf5c4,0x1a7));var _0x4f5c=function(_0x2e69fb,_0x4359e3){_0x2e69fb=_0x2e69fb-0x0;var _0x4d2404=_0xf5c4[_0x2e69fb];return _0x4d2404;};'use strict';var multer=require(_0x4f5c('0x0'));var util=require(_0x4f5c('0x1'));var path=require(_0x4f5c('0x2'));var timeout=require(_0x4f5c('0x3'));var express=require(_0x4f5c('0x4'));var router=express[_0x4f5c('0x5')]();var fs_extra=require(_0x4f5c('0x6'));var auth=require(_0x4f5c('0x7'));var interaction=require(_0x4f5c('0x8'));var config=require(_0x4f5c('0x9'));var controller=require(_0x4f5c('0xa'));router['get']('/',auth[_0x4f5c('0xb')](),controller['index']);router['get'](_0x4f5c('0xc'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0xd')]);router[_0x4f5c('0xe')](_0x4f5c('0xf'),auth['isAuthenticated'](),controller[_0x4f5c('0x10')]);router['get'](_0x4f5c('0x11'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x12')]);router[_0x4f5c('0xe')]('/:id/hopper_finals',auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x13')]);router[_0x4f5c('0xe')](_0x4f5c('0x14'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x4f5c('0xe')](_0x4f5c('0x15'),auth['isAuthenticated'](),controller[_0x4f5c('0x16')]);router['get']('/:id/blacklists',auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x17')]);router[_0x4f5c('0x18')]('/',auth[_0x4f5c('0xb')](),controller['create']);router[_0x4f5c('0x18')]('/:id/clone',auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x19')]);router[_0x4f5c('0x18')](_0x4f5c('0x15'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x1a')]);router[_0x4f5c('0x18')](_0x4f5c('0x1b'),auth['isAuthenticated'](),controller[_0x4f5c('0x1c')]);router[_0x4f5c('0x1d')](_0x4f5c('0xc'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x1e')]);router['delete'](_0x4f5c('0xc'),auth[_0x4f5c('0xb')](),controller['destroy']);router[_0x4f5c('0x1f')](_0x4f5c('0x15'),auth[_0x4f5c('0xb')](),controller[_0x4f5c('0x20')]);router['delete']('/:id/blacklists',auth[_0x4f5c('0xb')](),controller['removeBlackLists']);module[_0x4f5c('0x21')]=router; \ No newline at end of file +var _0xb7ec=['/:id/hopper_black','/:id/lists','getLists','post','/:id/clone','clone','addLists','/:id/blacklists','put','update','destroy','delete','removeBlackLists','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals'];(function(_0x54dc2,_0xa77a2f){var _0x1ca1b4=function(_0x169cce){while(--_0x169cce){_0x54dc2['push'](_0x54dc2['shift']());}};_0x1ca1b4(++_0xa77a2f);}(_0xb7ec,0x137));var _0xcb7e=function(_0x418321,_0x52b4f1){_0x418321=_0x418321-0x0;var _0x402cbd=_0xb7ec[_0x418321];return _0x402cbd;};'use strict';var multer=require('multer');var util=require(_0xcb7e('0x0'));var path=require(_0xcb7e('0x1'));var timeout=require(_0xcb7e('0x2'));var express=require(_0xcb7e('0x3'));var router=express[_0xcb7e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb7e('0x5'));var interaction=require(_0xcb7e('0x6'));var config=require(_0xcb7e('0x7'));var controller=require(_0xcb7e('0x8'));router[_0xcb7e('0x9')]('/',auth[_0xcb7e('0xa')](),controller[_0xcb7e('0xb')]);router['get'](_0xcb7e('0xc'),auth['isAuthenticated'](),controller[_0xcb7e('0xd')]);router[_0xcb7e('0x9')](_0xcb7e('0xe'),auth['isAuthenticated'](),controller[_0xcb7e('0xf')]);router[_0xcb7e('0x9')](_0xcb7e('0x10'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0xcb7e('0x11'),auth[_0xcb7e('0xa')](),controller[_0xcb7e('0x12')]);router[_0xcb7e('0x9')](_0xcb7e('0x13'),auth['isAuthenticated'](),controller['getHopperBlacks']);router['get'](_0xcb7e('0x14'),auth['isAuthenticated'](),controller[_0xcb7e('0x15')]);router[_0xcb7e('0x9')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router[_0xcb7e('0x16')]('/',auth[_0xcb7e('0xa')](),controller['create']);router[_0xcb7e('0x16')](_0xcb7e('0x17'),auth['isAuthenticated'](),controller[_0xcb7e('0x18')]);router[_0xcb7e('0x16')]('/:id/lists',auth['isAuthenticated'](),controller[_0xcb7e('0x19')]);router[_0xcb7e('0x16')](_0xcb7e('0x1a'),auth[_0xcb7e('0xa')](),controller['addBlackLists']);router[_0xcb7e('0x1b')](_0xcb7e('0xc'),auth[_0xcb7e('0xa')](),controller[_0xcb7e('0x1c')]);router['delete'](_0xcb7e('0xc'),auth[_0xcb7e('0xa')](),controller[_0xcb7e('0x1d')]);router[_0xcb7e('0x1e')](_0xcb7e('0x14'),auth[_0xcb7e('0xa')](),controller['removeLists']);router[_0xcb7e('0x1e')](_0xcb7e('0x1a'),auth['isAuthenticated'](),controller[_0xcb7e('0x1f')]);module[_0xcb7e('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ff45fbe..3fb5b70 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 _0x2d9d=['medium','VIRTUAL','getDataValue','key','sequelize','exports','STRING','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2d9d,0x134));var _0xd2d9=function(_0x21d0d7,_0x4c55a3){_0x21d0d7=_0x21d0d7-0x0;var _0x5e725b=_0x2d9d[_0x21d0d7];return _0x5e725b;};'use strict';var Sequelize=require(_0xd2d9('0x0'));module[_0xd2d9('0x1')]={'key':{'type':Sequelize[_0xd2d9('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xd2d9('0x3')],'length':_0xd2d9('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xd2d9('0x2')]},'name':{'type':Sequelize[_0xd2d9('0x5')],'get':function(){return this[_0xd2d9('0x6')](_0xd2d9('0x7'));}}}; \ No newline at end of file +var _0xd38e=['medium','VIRTUAL','getDataValue','key','exports','TEXT'];(function(_0x584ca7,_0x13614b){var _0x4bfd18=function(_0x2a6bb3){while(--_0x2a6bb3){_0x584ca7['push'](_0x584ca7['shift']());}};_0x4bfd18(++_0x13614b);}(_0xd38e,0x196));var _0xed38=function(_0x33051f,_0x490726){_0x33051f=_0x33051f-0x0;var _0xf6e53b=_0xd38e[_0x33051f];return _0xf6e53b;};'use strict';var Sequelize=require('sequelize');module[_0xed38('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xed38('0x1')],'length':_0xed38('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xed38('0x3')],'get':function(){return this[_0xed38('0x4')](_0xed38('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f493f35..f32c9bb 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 _0x0422=['OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','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','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','rows','catch','params','body','find','create','MailAccountId','SmsAccountId'];(function(_0x1193f3,_0x384810){var _0xc266c2=function(_0x344bff){while(--_0x344bff){_0x1193f3['push'](_0x1193f3['shift']());}};_0xc266c2(++_0x384810);}(_0x0422,0xb4));var _0x2042=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x0422[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0x2042('0x0'));var rimraf=require(_0x2042('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2042('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2042('0x3'));var path=require(_0x2042('0x4'));var sox=require(_0x2042('0x5'));var csv=require(_0x2042('0x6'));var ejs=require(_0x2042('0x7'));var fs=require('fs');var fs_extra=require(_0x2042('0x8'));var _=require(_0x2042('0x9'));var squel=require('squel');var crypto=require(_0x2042('0xa'));var jsforce=require(_0x2042('0xb'));var deskjs=require(_0x2042('0xc'));var toCsv=require(_0x2042('0x6'));var querystring=require(_0x2042('0xd'));var Papa=require('papaparse');var Redis=require(_0x2042('0xe'));var authService=require(_0x2042('0xf'));var qs=require(_0x2042('0x10'));var as=require(_0x2042('0x11'));var hardwareService=require(_0x2042('0x12'));var logger=require(_0x2042('0x13'))('api');var utils=require(_0x2042('0x14'));var config=require(_0x2042('0x15'));var licenseUtil=require(_0x2042('0x16'));var db=require(_0x2042('0x17'))['db'];function respondWithStatusCode(_0x17f870,_0x903924){_0x903924=_0x903924||0xcc;return function(_0x2b2b1e){if(_0x2b2b1e){return _0x17f870['sendStatus'](_0x903924);}return _0x17f870[_0x2042('0x18')](_0x903924)[_0x2042('0x19')]();};}function respondWithResult(_0x42c77a,_0xc432f4){_0xc432f4=_0xc432f4||0xc8;return function(_0x4ab301){if(_0x4ab301){return _0x42c77a[_0x2042('0x18')](_0xc432f4)['json'](_0x4ab301);}};}function respondWithFilteredResult(_0x18ea10,_0x42a8bd){return function(_0x3afc91){if(_0x3afc91){var _0x5cfea6=typeof _0x42a8bd['offset']===_0x2042('0x1a')&&typeof _0x42a8bd['limit']===_0x2042('0x1a');var _0xc5044b=_0x3afc91[_0x2042('0x1b')];var _0x13ba00=_0x5cfea6?0x0:_0x42a8bd[_0x2042('0x1c')];var _0x5c4a53=_0x5cfea6?_0x3afc91[_0x2042('0x1b')]:_0x42a8bd[_0x2042('0x1c')]+_0x42a8bd['limit'];var _0x1ff2fc;if(_0x5c4a53>=_0xc5044b){_0x5c4a53=_0xc5044b;_0x1ff2fc=0xc8;}else{_0x1ff2fc=0xce;}_0x18ea10[_0x2042('0x18')](_0x1ff2fc);return _0x18ea10[_0x2042('0x1d')](_0x2042('0x1e'),_0x13ba00+'-'+_0x5c4a53+'/'+_0xc5044b)[_0x2042('0x1f')](_0x3afc91);}return null;};}function patchUpdates(_0x553d61){return function(_0x587885){try{jsonpatch[_0x2042('0x20')](_0x587885,_0x553d61,!![]);}catch(_0x478dea){return BPromise[_0x2042('0x21')](_0x478dea);}return _0x587885['save']();};}function saveUpdates(_0x42b395,_0x544055){return function(_0x3214de){if(_0x3214de){return _0x3214de[_0x2042('0x22')](_0x42b395)[_0x2042('0x23')](function(_0x21d537){return _0x21d537;});}return null;};}function removeEntity(_0x3512bd,_0x308794){return function(_0x47a043){if(_0x47a043){return _0x47a043[_0x2042('0x24')]()[_0x2042('0x23')](function(){var _0x18722d=_0x47a043[_0x2042('0x25')]({'plain':!![]});var _0x24cc00=_0x2042('0x26');return db[_0x2042('0x27')][_0x2042('0x24')]({'where':{'type':_0x24cc00,'resourceId':_0x18722d['id']}})[_0x2042('0x23')](function(){return _0x47a043;});})[_0x2042('0x23')](function(){_0x3512bd[_0x2042('0x18')](0xcc)[_0x2042('0x19')]();});}};}function handleEntityNotFound(_0x2845ad,_0x352e01){return function(_0x209cf8){if(!_0x209cf8){_0x2845ad['sendStatus'](0x194);}return _0x209cf8;};}function handleError(_0x47a54a,_0xfdaaa6){_0xfdaaa6=_0xfdaaa6||0x1f4;return function(_0x13db7e){logger[_0x2042('0x28')](_0x13db7e[_0x2042('0x29')]);if(_0x13db7e[_0x2042('0x2a')]){delete _0x13db7e[_0x2042('0x2a')];}_0x47a54a[_0x2042('0x18')](_0xfdaaa6)['send'](_0x13db7e);};}exports[_0x2042('0x2b')]=function(_0x542188,_0x7343a8){var _0x212d31={},_0x2a38fa={},_0x45e5fc={'count':0x0,'rows':[]};var _0x309e58=_[_0x2042('0x2c')](db[_0x2042('0x2d')][_0x2042('0x2e')],function(_0x549370){return{'name':_0x549370[_0x2042('0x2f')],'type':_0x549370['type'][_0x2042('0x30')]};});_0x2a38fa[_0x2042('0x31')]=_[_0x2042('0x2c')](_0x309e58,_0x2042('0x2a'));_0x2a38fa[_0x2042('0x32')]=_[_0x2042('0x33')](_0x542188['query']);_0x2a38fa[_0x2042('0x34')]=_['intersection'](_0x2a38fa[_0x2042('0x31')],_0x2a38fa['query']);_0x212d31[_0x2042('0x35')]=_[_0x2042('0x36')](_0x2a38fa[_0x2042('0x31')],qs[_0x2042('0x37')](_0x542188['query'][_0x2042('0x37')]));_0x212d31[_0x2042('0x35')]=_0x212d31[_0x2042('0x35')][_0x2042('0x38')]?_0x212d31[_0x2042('0x35')]:_0x2a38fa[_0x2042('0x31')];if(!_0x542188[_0x2042('0x32')]['hasOwnProperty'](_0x2042('0x39'))){_0x212d31['limit']=qs['limit'](_0x542188[_0x2042('0x32')][_0x2042('0x3a')]);_0x212d31[_0x2042('0x1c')]=qs[_0x2042('0x1c')](_0x542188[_0x2042('0x32')]['offset']);}_0x212d31[_0x2042('0x3b')]=qs[_0x2042('0x3c')](_0x542188[_0x2042('0x32')][_0x2042('0x3c')]);_0x212d31[_0x2042('0x3d')]=qs[_0x2042('0x34')](_['pick'](_0x542188['query'],_0x2a38fa['filters']),_0x309e58);if(_0x542188[_0x2042('0x32')][_0x2042('0x3e')]){_0x212d31[_0x2042('0x3d')]=_[_0x2042('0x3f')](_0x212d31[_0x2042('0x3d')],{'$or':[{'key':{'$like':'%'+_0x542188[_0x2042('0x32')][_0x2042('0x3e')]+'%'}},{'value':{'$like':'%'+_0x542188[_0x2042('0x32')]['filter']+'%'}}]});}_0x212d31=_[_0x2042('0x3f')]({},_0x212d31,_0x542188[_0x2042('0x40')]);var _0x4f6922={'where':_0x212d31[_0x2042('0x3d')]};return db['CannedAnswer'][_0x2042('0x1b')](_0x4f6922)[_0x2042('0x23')](function(_0x1020bf){_0x45e5fc[_0x2042('0x1b')]=_0x1020bf;if(_0x542188[_0x2042('0x32')][_0x2042('0x41')]){_0x212d31[_0x2042('0x42')]=[{'all':!![]}];}return db[_0x2042('0x2d')]['findAll'](_0x212d31);})['then'](function(_0x3a265a){_0x45e5fc[_0x2042('0x43')]=_0x3a265a;return _0x45e5fc;})[_0x2042('0x23')](respondWithFilteredResult(_0x7343a8,_0x212d31))[_0x2042('0x44')](handleError(_0x7343a8,null));};exports['show']=function(_0x5f28b5,_0x16c85e){var _0x4bac68={'raw':!![],'where':{'id':_0x5f28b5[_0x2042('0x45')]['id']}},_0x5a1b19={};_0x5a1b19[_0x2042('0x31')]=_[_0x2042('0x33')](db[_0x2042('0x2d')][_0x2042('0x2e')]);_0x5a1b19[_0x2042('0x32')]=_[_0x2042('0x33')](_0x5f28b5['query']);_0x5a1b19['filters']=_[_0x2042('0x36')](_0x5a1b19[_0x2042('0x31')],_0x5a1b19[_0x2042('0x32')]);_0x4bac68[_0x2042('0x35')]=_[_0x2042('0x36')](_0x5a1b19[_0x2042('0x31')],qs[_0x2042('0x37')](_0x5f28b5['query'][_0x2042('0x37')]));_0x4bac68[_0x2042('0x35')]=_0x4bac68[_0x2042('0x35')]['length']?_0x4bac68[_0x2042('0x35')]:_0x5a1b19[_0x2042('0x31')];if(_0x5f28b5[_0x2042('0x32')][_0x2042('0x41')]){_0x4bac68[_0x2042('0x42')]=[{'all':!![]}];}_0x4bac68=_[_0x2042('0x3f')]({},_0x4bac68,_0x5f28b5[_0x2042('0x40')]);return db[_0x2042('0x2d')]['find'](_0x4bac68)[_0x2042('0x23')](handleEntityNotFound(_0x16c85e,null))['then'](respondWithResult(_0x16c85e,null))[_0x2042('0x44')](handleError(_0x16c85e,null));};exports['update']=function(_0x503f91,_0x53fd2f){if(_0x503f91[_0x2042('0x46')]['id']){delete _0x503f91['body']['id'];}return db[_0x2042('0x2d')]['find']({'where':{'id':_0x503f91['params']['id']}})['then'](handleEntityNotFound(_0x53fd2f,null))[_0x2042('0x23')](saveUpdates(_0x503f91[_0x2042('0x46')],null))[_0x2042('0x23')](respondWithResult(_0x53fd2f,null))[_0x2042('0x44')](handleError(_0x53fd2f,null));};exports[_0x2042('0x24')]=function(_0x3aacc8,_0x388c90){return db[_0x2042('0x2d')][_0x2042('0x47')]({'where':{'id':_0x3aacc8[_0x2042('0x45')]['id']}})[_0x2042('0x23')](handleEntityNotFound(_0x388c90,null))[_0x2042('0x23')](removeEntity(_0x388c90,null))[_0x2042('0x44')](handleError(_0x388c90,null));};exports[_0x2042('0x48')]=function(_0x2b4e71,_0x4ebe48){var _0x5a655d={'key':_0x2b4e71[_0x2042('0x46')][_0x2042('0x30')]};if(_0x2b4e71[_0x2042('0x46')][_0x2042('0x49')]){_0x5a655d[_0x2042('0x49')]=_0x2b4e71[_0x2042('0x46')][_0x2042('0x49')];}else if(_0x2b4e71[_0x2042('0x46')]['SmsAccountId']){_0x5a655d[_0x2042('0x4a')]=_0x2b4e71['body'][_0x2042('0x4a')];}else if(_0x2b4e71[_0x2042('0x46')][_0x2042('0x4b')]){_0x5a655d[_0x2042('0x4b')]=_0x2b4e71[_0x2042('0x46')]['OpenchannelAccountId'];}else if(_0x2b4e71[_0x2042('0x46')]['ChatWebsiteId']){_0x5a655d[_0x2042('0x4c')]=_0x2b4e71[_0x2042('0x46')][_0x2042('0x4c')];}return db[_0x2042('0x2d')][_0x2042('0x47')]({'where':_0x5a655d})[_0x2042('0x23')](function(_0x2120a5){if(_0x2120a5){throw new db[(_0x2042('0x4d'))][(_0x2042('0x4e'))](_0x2042('0x4f'));}return db['CannedAnswer'][_0x2042('0x48')](_0x2b4e71['body']);})[_0x2042('0x23')](function(_0x2316ac){var _0x274c83=_0x2b4e71['user']['get']({'plain':!![]});if(!_0x274c83)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x274c83['role']===_0x2042('0x50')){var _0x2e3184=_0x2316ac[_0x2042('0x25')]({'plain':!![]});return db[_0x2042('0x51')][_0x2042('0x47')]({'where':{'name':_0x2042('0x26'),'userProfileId':_0x274c83[_0x2042('0x52')]},'raw':!![]})['then'](function(_0x3649ab){if(_0x3649ab&&_0x3649ab[_0x2042('0x53')]===0x0){return db[_0x2042('0x27')][_0x2042('0x48')]({'name':_0x2e3184[_0x2042('0x2a')],'resourceId':_0x2e3184['id'],'type':_0x3649ab['name'],'sectionId':_0x3649ab['id']},{})[_0x2042('0x23')](function(){return _0x2316ac;});}else{return _0x2316ac;}})[_0x2042('0x44')](function(_0x420c27){logger[_0x2042('0x28')](_0x2042('0x54'),_0x420c27);throw _0x420c27;});}return _0x2316ac;})[_0x2042('0x23')](respondWithResult(_0x4ebe48,0xc9))[_0x2042('0x44')](handleError(_0x4ebe48,null));}; \ No newline at end of file +var _0x0e83=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','CannedAnswers','UserProfileResource','then','sendStatus','error','name','map','CannedAnswer','rawAttributes','fieldName','type','key'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x0e83,0x1ba));var _0x30e8=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x0e83[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0x30e8('0x0'));var rimraf=require(_0x30e8('0x1'));var zipdir=require(_0x30e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x30e8('0x3'));var moment=require(_0x30e8('0x4'));var BPromise=require(_0x30e8('0x5'));var Mustache=require(_0x30e8('0x6'));var util=require(_0x30e8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x30e8('0x8'));var ejs=require(_0x30e8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x30e8('0xa'));var crypto=require('crypto');var jsforce=require(_0x30e8('0xb'));var deskjs=require(_0x30e8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x30e8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x30e8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x30e8('0xf'));var hardwareService=require(_0x30e8('0x10'));var logger=require(_0x30e8('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x30e8('0x12'))['db'];function respondWithStatusCode(_0x1e06e9,_0x5677ac){_0x5677ac=_0x5677ac||0xcc;return function(_0x20b2c3){if(_0x20b2c3){return _0x1e06e9['sendStatus'](_0x5677ac);}return _0x1e06e9[_0x30e8('0x13')](_0x5677ac)[_0x30e8('0x14')]();};}function respondWithResult(_0xf477bb,_0x55f593){_0x55f593=_0x55f593||0xc8;return function(_0xe71a40){if(_0xe71a40){return _0xf477bb['status'](_0x55f593)[_0x30e8('0x15')](_0xe71a40);}};}function respondWithFilteredResult(_0x29c250,_0x19a658){return function(_0x4d9b6f){if(_0x4d9b6f){var _0x4b5cf4=typeof _0x19a658[_0x30e8('0x16')]===_0x30e8('0x17')&&typeof _0x19a658[_0x30e8('0x18')]===_0x30e8('0x17');var _0x5e4c5e=_0x4d9b6f[_0x30e8('0x19')];var _0x542c63=_0x4b5cf4?0x0:_0x19a658[_0x30e8('0x16')];var _0x486cbd=_0x4b5cf4?_0x4d9b6f[_0x30e8('0x19')]:_0x19a658[_0x30e8('0x16')]+_0x19a658[_0x30e8('0x18')];var _0x1d91a1;if(_0x486cbd>=_0x5e4c5e){_0x486cbd=_0x5e4c5e;_0x1d91a1=0xc8;}else{_0x1d91a1=0xce;}_0x29c250[_0x30e8('0x13')](_0x1d91a1);return _0x29c250['set'](_0x30e8('0x1a'),_0x542c63+'-'+_0x486cbd+'/'+_0x5e4c5e)['json'](_0x4d9b6f);}return null;};}function patchUpdates(_0x325d69){return function(_0x433ecf){try{jsonpatch[_0x30e8('0x1b')](_0x433ecf,_0x325d69,!![]);}catch(_0x51650b){return BPromise[_0x30e8('0x1c')](_0x51650b);}return _0x433ecf[_0x30e8('0x1d')]();};}function saveUpdates(_0x591d6f,_0x3311c3){return function(_0x3100bc){if(_0x3100bc){return _0x3100bc[_0x30e8('0x1e')](_0x591d6f)['then'](function(_0x1f9b7d){return _0x1f9b7d;});}return null;};}function removeEntity(_0xfc99fb,_0x5ecc2f){return function(_0x4711f8){if(_0x4711f8){return _0x4711f8[_0x30e8('0x1f')]()['then'](function(){var _0x4980f4=_0x4711f8['get']({'plain':!![]});var _0x24a34e=_0x30e8('0x20');return db[_0x30e8('0x21')]['destroy']({'where':{'type':_0x24a34e,'resourceId':_0x4980f4['id']}})[_0x30e8('0x22')](function(){return _0x4711f8;});})[_0x30e8('0x22')](function(){_0xfc99fb[_0x30e8('0x13')](0xcc)[_0x30e8('0x14')]();});}};}function handleEntityNotFound(_0x199160,_0x3547ae){return function(_0x303506){if(!_0x303506){_0x199160[_0x30e8('0x23')](0x194);}return _0x303506;};}function handleError(_0x51ffda,_0x23ed90){_0x23ed90=_0x23ed90||0x1f4;return function(_0x400920){logger[_0x30e8('0x24')](_0x400920['stack']);if(_0x400920[_0x30e8('0x25')]){delete _0x400920[_0x30e8('0x25')];}_0x51ffda[_0x30e8('0x13')](_0x23ed90)['send'](_0x400920);};}exports['index']=function(_0x421142,_0x1fa0d6){var _0x929dbe={},_0x2b7a5e={},_0x1362a9={'count':0x0,'rows':[]};var _0x40418a=_[_0x30e8('0x26')](db[_0x30e8('0x27')][_0x30e8('0x28')],function(_0x29e113){return{'name':_0x29e113[_0x30e8('0x29')],'type':_0x29e113[_0x30e8('0x2a')][_0x30e8('0x2b')]};});_0x2b7a5e[_0x30e8('0x2c')]=_[_0x30e8('0x26')](_0x40418a,'name');_0x2b7a5e[_0x30e8('0x2d')]=_[_0x30e8('0x2e')](_0x421142[_0x30e8('0x2d')]);_0x2b7a5e['filters']=_[_0x30e8('0x2f')](_0x2b7a5e[_0x30e8('0x2c')],_0x2b7a5e[_0x30e8('0x2d')]);_0x929dbe[_0x30e8('0x30')]=_[_0x30e8('0x2f')](_0x2b7a5e[_0x30e8('0x2c')],qs[_0x30e8('0x31')](_0x421142[_0x30e8('0x2d')]['fields']));_0x929dbe[_0x30e8('0x30')]=_0x929dbe[_0x30e8('0x30')][_0x30e8('0x32')]?_0x929dbe[_0x30e8('0x30')]:_0x2b7a5e[_0x30e8('0x2c')];if(!_0x421142[_0x30e8('0x2d')][_0x30e8('0x33')]('nolimit')){_0x929dbe[_0x30e8('0x18')]=qs[_0x30e8('0x18')](_0x421142[_0x30e8('0x2d')]['limit']);_0x929dbe[_0x30e8('0x16')]=qs[_0x30e8('0x16')](_0x421142['query'][_0x30e8('0x16')]);}_0x929dbe[_0x30e8('0x34')]=qs[_0x30e8('0x35')](_0x421142[_0x30e8('0x2d')]['sort']);_0x929dbe[_0x30e8('0x36')]=qs[_0x30e8('0x37')](_[_0x30e8('0x38')](_0x421142[_0x30e8('0x2d')],_0x2b7a5e[_0x30e8('0x37')]),_0x40418a);if(_0x421142['query'][_0x30e8('0x39')]){_0x929dbe[_0x30e8('0x36')]=_[_0x30e8('0x3a')](_0x929dbe[_0x30e8('0x36')],{'$or':[{'key':{'$like':'%'+_0x421142[_0x30e8('0x2d')][_0x30e8('0x39')]+'%'}},{'value':{'$like':'%'+_0x421142[_0x30e8('0x2d')][_0x30e8('0x39')]+'%'}}]});}_0x929dbe=_[_0x30e8('0x3a')]({},_0x929dbe,_0x421142[_0x30e8('0x3b')]);var _0x4262c7={'where':_0x929dbe[_0x30e8('0x36')]};return db[_0x30e8('0x27')][_0x30e8('0x19')](_0x4262c7)[_0x30e8('0x22')](function(_0x22f882){_0x1362a9[_0x30e8('0x19')]=_0x22f882;if(_0x421142[_0x30e8('0x2d')][_0x30e8('0x3c')]){_0x929dbe['include']=[{'all':!![]}];}return db[_0x30e8('0x27')][_0x30e8('0x3d')](_0x929dbe);})[_0x30e8('0x22')](function(_0x3ad06e){_0x1362a9['rows']=_0x3ad06e;return _0x1362a9;})[_0x30e8('0x22')](respondWithFilteredResult(_0x1fa0d6,_0x929dbe))[_0x30e8('0x3e')](handleError(_0x1fa0d6,null));};exports[_0x30e8('0x3f')]=function(_0x20cc57,_0x437fea){var _0xde720={'raw':!![],'where':{'id':_0x20cc57[_0x30e8('0x40')]['id']}},_0x28e25c={};_0x28e25c[_0x30e8('0x2c')]=_[_0x30e8('0x2e')](db[_0x30e8('0x27')]['rawAttributes']);_0x28e25c[_0x30e8('0x2d')]=_[_0x30e8('0x2e')](_0x20cc57['query']);_0x28e25c[_0x30e8('0x37')]=_[_0x30e8('0x2f')](_0x28e25c['model'],_0x28e25c[_0x30e8('0x2d')]);_0xde720[_0x30e8('0x30')]=_[_0x30e8('0x2f')](_0x28e25c['model'],qs[_0x30e8('0x31')](_0x20cc57[_0x30e8('0x2d')]['fields']));_0xde720['attributes']=_0xde720['attributes'][_0x30e8('0x32')]?_0xde720[_0x30e8('0x30')]:_0x28e25c[_0x30e8('0x2c')];if(_0x20cc57[_0x30e8('0x2d')]['includeAll']){_0xde720[_0x30e8('0x41')]=[{'all':!![]}];}_0xde720=_[_0x30e8('0x3a')]({},_0xde720,_0x20cc57['options']);return db['CannedAnswer'][_0x30e8('0x42')](_0xde720)[_0x30e8('0x22')](handleEntityNotFound(_0x437fea,null))[_0x30e8('0x22')](respondWithResult(_0x437fea,null))['catch'](handleError(_0x437fea,null));};exports[_0x30e8('0x1e')]=function(_0x4c8884,_0x56614a){if(_0x4c8884[_0x30e8('0x43')]['id']){delete _0x4c8884[_0x30e8('0x43')]['id'];}return db[_0x30e8('0x27')][_0x30e8('0x42')]({'where':{'id':_0x4c8884[_0x30e8('0x40')]['id']}})[_0x30e8('0x22')](handleEntityNotFound(_0x56614a,null))['then'](saveUpdates(_0x4c8884['body'],null))[_0x30e8('0x22')](respondWithResult(_0x56614a,null))['catch'](handleError(_0x56614a,null));};exports[_0x30e8('0x1f')]=function(_0x55ef2f,_0x232dab){return db[_0x30e8('0x27')][_0x30e8('0x42')]({'where':{'id':_0x55ef2f['params']['id']}})[_0x30e8('0x22')](handleEntityNotFound(_0x232dab,null))[_0x30e8('0x22')](removeEntity(_0x232dab,null))[_0x30e8('0x3e')](handleError(_0x232dab,null));};exports['create']=function(_0x2381c6,_0xf7c73b){var _0x2a1c74={'key':_0x2381c6['body'][_0x30e8('0x2b')]};if(_0x2381c6['body']['MailAccountId']){_0x2a1c74['MailAccountId']=_0x2381c6['body'][_0x30e8('0x44')];}else if(_0x2381c6['body'][_0x30e8('0x45')]){_0x2a1c74[_0x30e8('0x45')]=_0x2381c6[_0x30e8('0x43')][_0x30e8('0x45')];}else if(_0x2381c6['body'][_0x30e8('0x46')]){_0x2a1c74[_0x30e8('0x46')]=_0x2381c6[_0x30e8('0x43')]['OpenchannelAccountId'];}else if(_0x2381c6[_0x30e8('0x43')][_0x30e8('0x47')]){_0x2a1c74[_0x30e8('0x47')]=_0x2381c6[_0x30e8('0x43')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x30e8('0x42')]({'where':_0x2a1c74})[_0x30e8('0x22')](function(_0x4a4b96){if(_0x4a4b96){throw new db['Sequelize'][(_0x30e8('0x48'))](_0x30e8('0x49'));}return db[_0x30e8('0x27')][_0x30e8('0x4a')](_0x2381c6[_0x30e8('0x43')]);})['then'](function(_0x5b4f99){var _0x47d52a=_0x2381c6[_0x30e8('0x4b')][_0x30e8('0x4c')]({'plain':!![]});if(!_0x47d52a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47d52a[_0x30e8('0x4d')]===_0x30e8('0x4b')){var _0x2d4ac2=_0x5b4f99['get']({'plain':!![]});return db[_0x30e8('0x4e')][_0x30e8('0x42')]({'where':{'name':_0x30e8('0x20'),'userProfileId':_0x47d52a['userProfileId']},'raw':!![]})['then'](function(_0x51361f){if(_0x51361f&&_0x51361f[_0x30e8('0x4f')]===0x0){return db['UserProfileResource'][_0x30e8('0x4a')]({'name':_0x2d4ac2[_0x30e8('0x25')],'resourceId':_0x2d4ac2['id'],'type':_0x51361f[_0x30e8('0x25')],'sectionId':_0x51361f['id']},{})[_0x30e8('0x22')](function(){return _0x5b4f99;});}else{return _0x5b4f99;}})[_0x30e8('0x3e')](function(_0x5b3d69){logger[_0x30e8('0x24')](_0x30e8('0x50'),_0x5b3d69);throw _0x5b3d69;});}return _0x5b4f99;})[_0x30e8('0x22')](respondWithResult(_0xf7c73b,0xc9))['catch'](handleError(_0xf7c73b,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 104b32f..5c4f6ce 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 _0xc374=['api','moment','bluebird','../../config/environment','./cannedAnswer.attributes','exports','define','utf8mb4','util','../../config/logger'];(function(_0x2ccb91,_0xa2c1b4){var _0x4136ca=function(_0x4326f0){while(--_0x4326f0){_0x2ccb91['push'](_0x2ccb91['shift']());}};_0x4136ca(++_0xa2c1b4);}(_0xc374,0x184));var _0x4c37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc374[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x4c37('0x0'));var logger=require(_0x4c37('0x1'))(_0x4c37('0x2'));var moment=require(_0x4c37('0x3'));var BPromise=require(_0x4c37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c37('0x5'));var attributes=require(_0x4c37('0x6'));module[_0x4c37('0x7')]=function(_0x41eb49,_0x1443eb){return _0x41eb49[_0x4c37('0x8')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4c37('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x233e=['api','moment','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x233e,0x148));var _0xe233=function(_0x26f50f,_0x40f05b){_0x26f50f=_0x26f50f-0x0;var _0x17196d=_0x233e[_0x26f50f];return _0x17196d;};'use strict';var _=require(_0xe233('0x0'));var util=require('util');var logger=require(_0xe233('0x1'))(_0xe233('0x2'));var moment=require(_0xe233('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe233('0x4'));var rimraf=require(_0xe233('0x5'));var config=require(_0xe233('0x6'));var attributes=require(_0xe233('0x7'));module[_0xe233('0x8')]=function(_0x4d8b6a,_0x431d66){return _0x4d8b6a['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe233('0x9')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 2a6ce4b..26b19fd 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(_0x89d5a2,_0x2ace47){var _0x34e507=function(_0x42d9ee){while(--_0x42d9ee){_0x89d5a2['push'](_0x89d5a2['shift']());}};_0x34e507(++_0x2ace47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x29781b,_0x13cdf8){var _0x43f349=function(_0x244514){while(--_0x244514){_0x29781b['push'](_0x29781b['shift']());}};_0x43f349(++_0x13cdf8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 8e582fc..20c3142 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 _0xc018=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','update','delete','destroy','multer','util'];(function(_0x4b7362,_0x189886){var _0x33025e=function(_0x5874f6){while(--_0x5874f6){_0x4b7362['push'](_0x4b7362['shift']());}};_0x33025e(++_0x189886);}(_0xc018,0x174));var _0x8c01=function(_0x58d4f8,_0x71966d){_0x58d4f8=_0x58d4f8-0x0;var _0x178e25=_0xc018[_0x58d4f8];return _0x178e25;};'use strict';var multer=require(_0x8c01('0x0'));var util=require(_0x8c01('0x1'));var path=require(_0x8c01('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c01('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8c01('0x4'));var interaction=require(_0x8c01('0x5'));var config=require(_0x8c01('0x6'));var controller=require(_0x8c01('0x7'));router[_0x8c01('0x8')]('/',auth[_0x8c01('0x9')](),controller[_0x8c01('0xa')]);router[_0x8c01('0x8')](_0x8c01('0xb'),auth[_0x8c01('0x9')](),controller[_0x8c01('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8c01('0xd')]);router['put']('/:id',auth[_0x8c01('0x9')](),controller[_0x8c01('0xe')]);router[_0x8c01('0xf')](_0x8c01('0xb'),auth[_0x8c01('0x9')](),controller[_0x8c01('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc8fe=['destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x27abfd,_0x4edca1){var _0x4fd9d1=function(_0x59672d){while(--_0x59672d){_0x27abfd['push'](_0x27abfd['shift']());}};_0x4fd9d1(++_0x4edca1);}(_0xc8fe,0x123));var _0xec8f=function(_0x202e3a,_0x137882){_0x202e3a=_0x202e3a-0x0;var _0x448ba1=_0xc8fe[_0x202e3a];return _0x448ba1;};'use strict';var multer=require(_0xec8f('0x0'));var util=require('util');var path=require(_0xec8f('0x1'));var timeout=require('connect-timeout');var express=require(_0xec8f('0x2'));var router=express['Router']();var fs_extra=require(_0xec8f('0x3'));var auth=require(_0xec8f('0x4'));var interaction=require(_0xec8f('0x5'));var config=require(_0xec8f('0x6'));var controller=require(_0xec8f('0x7'));router[_0xec8f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec8f('0x8')](_0xec8f('0x9'),auth[_0xec8f('0xa')](),controller[_0xec8f('0xb')]);router[_0xec8f('0xc')]('/',auth[_0xec8f('0xa')](),controller[_0xec8f('0xd')]);router['put'](_0xec8f('0x9'),auth[_0xec8f('0xa')](),controller[_0xec8f('0xe')]);router['delete'](_0xec8f('0x9'),auth[_0xec8f('0xa')](),controller[_0xec8f('0xf')]);module[_0xec8f('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 60c465d..cd720bc 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 _0x6916=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0xc8129b,_0x2b7c4){var _0x1c0e80=function(_0x469f93){while(--_0x469f93){_0xc8129b['push'](_0xc8129b['shift']());}};_0x1c0e80(++_0x2b7c4);}(_0x6916,0x1ed));var _0x6691=function(_0x8217b7,_0x3fadbe){_0x8217b7=_0x8217b7-0x0;var _0x539db3=_0x6916[_0x8217b7];return _0x539db3;};'use strict';var Sequelize=require('sequelize');module[_0x6691('0x0')]={'calldate':{'type':Sequelize[_0x6691('0x1')],'allowNull':![],'defaultValue':_0x6691('0x2')},'clid':{'type':Sequelize[_0x6691('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x6691('0x3')]},'dcontext':{'type':Sequelize[_0x6691('0x3')]},'channel':{'type':Sequelize[_0x6691('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6691('0x3')]},'duration':{'type':Sequelize[_0x6691('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6691('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6691('0x3')]},'amaflags':{'type':Sequelize[_0x6691('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6691('0x3')]},'userfield':{'type':Sequelize[_0x6691('0x3')]},'uniqueid':{'type':Sequelize[_0x6691('0x3')]},'linkedid':{'type':Sequelize[_0x6691('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x6691('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x6691('0x3')]}}; \ No newline at end of file +var _0x9265=['INTEGER','sequelize','1970-01-01\x2000:00:01','STRING'];(function(_0x46939c,_0x56009e){var _0x35f4a5=function(_0x13e70b){while(--_0x13e70b){_0x46939c['push'](_0x46939c['shift']());}};_0x35f4a5(++_0x56009e);}(_0x9265,0x1dd));var _0x5926=function(_0x50868e,_0x59417d){_0x50868e=_0x50868e-0x0;var _0x5675ff=_0x9265[_0x50868e];return _0x5675ff;};'use strict';var Sequelize=require(_0x5926('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5926('0x1')},'clid':{'type':Sequelize[_0x5926('0x2')]},'src':{'type':Sequelize[_0x5926('0x2')]},'dst':{'type':Sequelize[_0x5926('0x2')]},'dcontext':{'type':Sequelize[_0x5926('0x2')]},'channel':{'type':Sequelize[_0x5926('0x2')]},'dstchannel':{'type':Sequelize[_0x5926('0x2')]},'lastapp':{'type':Sequelize[_0x5926('0x2')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x5926('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5926('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5926('0x2')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5926('0x2')]},'userfield':{'type':Sequelize[_0x5926('0x2')]},'uniqueid':{'type':Sequelize[_0x5926('0x2')]},'linkedid':{'type':Sequelize[_0x5926('0x2')]},'sequence':{'type':Sequelize[_0x5926('0x2')]},'peeraccount':{'type':Sequelize[_0x5926('0x2')]},'type':{'type':Sequelize[_0x5926('0x2')]},'tag':{'type':Sequelize[_0x5926('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 44efcc4..08fd545 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 _0xdc97=['api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','sendStatus','error','name','send','index','map','query','keys','filters','intersection','fields','attributes','length','model','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','Cdr','include','rows','catch','params','rawAttributes','includeAll','find','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1e77c2,_0x56f35a){var _0x4a179c=function(_0x553e79){while(--_0x553e79){_0x1e77c2['push'](_0x1e77c2['shift']());}};_0x4a179c(++_0x56f35a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3d13fc,_0x249275){_0x3d13fc=_0x3d13fc-0x0;var _0x2013d4=_0xdc97[_0x3d13fc];return _0x2013d4;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){_0xffc080[_0x7dc9('0x16')](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x55a482,_0x48c6bc){return function(_0x4b9ba6){if(!_0x4b9ba6){_0x55a482[_0x7dc9('0x22')](0x194);}return _0x4b9ba6;};}function handleError(_0x32d032,_0x5843bf){_0x5843bf=_0x5843bf||0x1f4;return function(_0x585eef){logger[_0x7dc9('0x23')](_0x585eef['stack']);if(_0x585eef[_0x7dc9('0x24')]){delete _0x585eef[_0x7dc9('0x24')];}_0x32d032[_0x7dc9('0x16')](_0x5843bf)[_0x7dc9('0x25')](_0x585eef);};}exports[_0x7dc9('0x26')]=function(_0x450124,_0x236d42){var _0x229f8e={},_0x1fcf0e={},_0x3c4379={'count':0x0,'rows':[]};var _0x14083d=_[_0x7dc9('0x27')](db['Cdr']['rawAttributes'],function(_0x513dd6){return{'name':_0x513dd6['fieldName'],'type':_0x513dd6['type']['key']};});_0x1fcf0e['model']=_['map'](_0x14083d,_0x7dc9('0x24'));_0x1fcf0e[_0x7dc9('0x28')]=_[_0x7dc9('0x29')](_0x450124[_0x7dc9('0x28')]);_0x1fcf0e[_0x7dc9('0x2a')]=_[_0x7dc9('0x2b')](_0x1fcf0e['model'],_0x1fcf0e['query']);_0x229f8e['attributes']=_[_0x7dc9('0x2b')](_0x1fcf0e['model'],qs[_0x7dc9('0x2c')](_0x450124[_0x7dc9('0x28')][_0x7dc9('0x2c')]));_0x229f8e[_0x7dc9('0x2d')]=_0x229f8e[_0x7dc9('0x2d')][_0x7dc9('0x2e')]?_0x229f8e[_0x7dc9('0x2d')]:_0x1fcf0e[_0x7dc9('0x2f')];if(!_0x450124['query'][_0x7dc9('0x30')]('nolimit')){_0x229f8e[_0x7dc9('0x1a')]=qs[_0x7dc9('0x1a')](_0x450124[_0x7dc9('0x28')][_0x7dc9('0x1a')]);_0x229f8e['offset']=qs[_0x7dc9('0x18')](_0x450124['query'][_0x7dc9('0x18')]);}_0x229f8e['order']=qs['sort'](_0x450124[_0x7dc9('0x28')][_0x7dc9('0x31')]);_0x229f8e[_0x7dc9('0x32')]=qs[_0x7dc9('0x2a')](_['pick'](_0x450124[_0x7dc9('0x28')],_0x1fcf0e[_0x7dc9('0x2a')]),_0x14083d);if(_0x450124[_0x7dc9('0x28')][_0x7dc9('0x33')]){_0x229f8e[_0x7dc9('0x32')]=_[_0x7dc9('0x34')](_0x229f8e[_0x7dc9('0x32')],{'$or':_[_0x7dc9('0x27')](_0x14083d,function(_0x166906){if(_0x166906[_0x7dc9('0x35')]!==_0x7dc9('0x36')){var _0x3a8d80={};_0x3a8d80[_0x166906['name']]={'$like':'%'+_0x450124[_0x7dc9('0x28')][_0x7dc9('0x33')]+'%'};return _0x3a8d80;}})});}_0x229f8e=_[_0x7dc9('0x34')]({},_0x229f8e,_0x450124[_0x7dc9('0x37')]);var _0x4bcdce={'where':_0x229f8e[_0x7dc9('0x32')]};return db[_0x7dc9('0x38')][_0x7dc9('0x1b')](_0x4bcdce)[_0x7dc9('0x21')](function(_0x295853){_0x3c4379[_0x7dc9('0x1b')]=_0x295853;if(_0x450124['query']['includeAll']){_0x229f8e[_0x7dc9('0x39')]=[{'all':!![]}];}return db[_0x7dc9('0x38')]['findAll'](_0x229f8e);})[_0x7dc9('0x21')](function(_0x4a37ec){_0x3c4379[_0x7dc9('0x3a')]=_0x4a37ec;return _0x3c4379;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x236d42,_0x229f8e))[_0x7dc9('0x3b')](handleError(_0x236d42,null));};exports['show']=function(_0x1d5671,_0x1df27f){var _0x1929b6={'raw':!![],'where':{'id':_0x1d5671[_0x7dc9('0x3c')]['id']}},_0x95513c={};_0x95513c[_0x7dc9('0x2f')]=_[_0x7dc9('0x29')](db['Cdr'][_0x7dc9('0x3d')]);_0x95513c['query']=_['keys'](_0x1d5671[_0x7dc9('0x28')]);_0x95513c[_0x7dc9('0x2a')]=_[_0x7dc9('0x2b')](_0x95513c[_0x7dc9('0x2f')],_0x95513c[_0x7dc9('0x28')]);_0x1929b6[_0x7dc9('0x2d')]=_[_0x7dc9('0x2b')](_0x95513c[_0x7dc9('0x2f')],qs[_0x7dc9('0x2c')](_0x1d5671['query'][_0x7dc9('0x2c')]));_0x1929b6[_0x7dc9('0x2d')]=_0x1929b6[_0x7dc9('0x2d')][_0x7dc9('0x2e')]?_0x1929b6[_0x7dc9('0x2d')]:_0x95513c[_0x7dc9('0x2f')];if(_0x1d5671['query'][_0x7dc9('0x3e')]){_0x1929b6[_0x7dc9('0x39')]=[{'all':!![]}];}_0x1929b6=_['merge']({},_0x1929b6,_0x1d5671[_0x7dc9('0x37')]);return db[_0x7dc9('0x38')][_0x7dc9('0x3f')](_0x1929b6)['then'](handleEntityNotFound(_0x1df27f,null))[_0x7dc9('0x21')](respondWithResult(_0x1df27f,null))['catch'](handleError(_0x1df27f,null));};exports['create']=function(_0x303795,_0x30a315){return db[_0x7dc9('0x38')]['create'](_0x303795['body'],{})[_0x7dc9('0x21')](respondWithResult(_0x30a315,0xc9))['catch'](handleError(_0x30a315,null));};exports[_0x7dc9('0x20')]=function(_0x4ab558,_0x5e2d59){if(_0x4ab558[_0x7dc9('0x40')]['id']){delete _0x4ab558[_0x7dc9('0x40')]['id'];}return db[_0x7dc9('0x38')][_0x7dc9('0x3f')]({'where':{'id':_0x4ab558[_0x7dc9('0x3c')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x5e2d59,null))[_0x7dc9('0x21')](saveUpdates(_0x4ab558[_0x7dc9('0x40')],null))[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,null))[_0x7dc9('0x3b')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x41')]=function(_0x13580b,_0x1658c0){return db['Cdr'][_0x7dc9('0x3f')]({'where':{'id':_0x13580b['params']['id']}})['then'](handleEntityNotFound(_0x1658c0,null))[_0x7dc9('0x21')](removeEntity(_0x1658c0,null))[_0x7dc9('0x3b')](handleError(_0x1658c0,null));};exports[_0x7dc9('0x42')]=function(_0x3902aa,_0x346d27){return db['Cdr'][_0x7dc9('0x42')]()[_0x7dc9('0x21')](respondWithResult(_0x346d27,null))[_0x7dc9('0x3b')](handleError(_0x346d27,null));}; \ No newline at end of file +var _0xfb65=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Cdr','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x383875,_0x45b02b){var _0x128fc2=function(_0x247f99){while(--_0x247f99){_0x383875['push'](_0x383875['shift']());}};_0x128fc2(++_0x45b02b);}(_0xfb65,0x82));var _0x5fb6=function(_0x11f15e,_0x2cc181){_0x11f15e=_0x11f15e-0x0;var _0x27dad5=_0xfb65[_0x11f15e];return _0x27dad5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5fb6('0x0'));var zipdir=require(_0x5fb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fb6('0x2'));var moment=require('moment');var BPromise=require(_0x5fb6('0x3'));var Mustache=require(_0x5fb6('0x4'));var util=require(_0x5fb6('0x5'));var path=require(_0x5fb6('0x6'));var sox=require(_0x5fb6('0x7'));var csv=require(_0x5fb6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5fb6('0x9'));var squel=require(_0x5fb6('0xa'));var crypto=require(_0x5fb6('0xb'));var jsforce=require(_0x5fb6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5fb6('0x8'));var querystring=require(_0x5fb6('0xd'));var Papa=require(_0x5fb6('0xe'));var Redis=require(_0x5fb6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5fb6('0x10'));var as=require(_0x5fb6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5fb6('0x12'))(_0x5fb6('0x13'));var utils=require(_0x5fb6('0x14'));var config=require(_0x5fb6('0x15'));var licenseUtil=require(_0x5fb6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1927d0,_0x15b296){_0x15b296=_0x15b296||0xcc;return function(_0x42285b){if(_0x42285b){return _0x1927d0[_0x5fb6('0x17')](_0x15b296);}return _0x1927d0[_0x5fb6('0x18')](_0x15b296)[_0x5fb6('0x19')]();};}function respondWithResult(_0x1a391f,_0x1ded21){_0x1ded21=_0x1ded21||0xc8;return function(_0x5e69c3){if(_0x5e69c3){return _0x1a391f['status'](_0x1ded21)[_0x5fb6('0x1a')](_0x5e69c3);}};}function respondWithFilteredResult(_0xfaea56,_0x58febe){return function(_0x1d57b1){if(_0x1d57b1){var _0x21ddd3=typeof _0x58febe[_0x5fb6('0x1b')]==='undefined'&&typeof _0x58febe[_0x5fb6('0x1c')]===_0x5fb6('0x1d');var _0x27bd8b=_0x1d57b1[_0x5fb6('0x1e')];var _0x167354=_0x21ddd3?0x0:_0x58febe[_0x5fb6('0x1b')];var _0x50bca8=_0x21ddd3?_0x1d57b1[_0x5fb6('0x1e')]:_0x58febe['offset']+_0x58febe[_0x5fb6('0x1c')];var _0x54c319;if(_0x50bca8>=_0x27bd8b){_0x50bca8=_0x27bd8b;_0x54c319=0xc8;}else{_0x54c319=0xce;}_0xfaea56[_0x5fb6('0x18')](_0x54c319);return _0xfaea56[_0x5fb6('0x1f')](_0x5fb6('0x20'),_0x167354+'-'+_0x50bca8+'/'+_0x27bd8b)[_0x5fb6('0x1a')](_0x1d57b1);}return null;};}function patchUpdates(_0x5885f1){return function(_0x418f58){try{jsonpatch[_0x5fb6('0x21')](_0x418f58,_0x5885f1,!![]);}catch(_0x50a414){return BPromise['reject'](_0x50a414);}return _0x418f58[_0x5fb6('0x22')]();};}function saveUpdates(_0x39ace4,_0x48a70e){return function(_0xdf1794){if(_0xdf1794){return _0xdf1794[_0x5fb6('0x23')](_0x39ace4)[_0x5fb6('0x24')](function(_0x36457e){return _0x36457e;});}return null;};}function removeEntity(_0x582f60,_0x2fca34){return function(_0x44aebe){if(_0x44aebe){return _0x44aebe[_0x5fb6('0x25')]()[_0x5fb6('0x24')](function(){_0x582f60[_0x5fb6('0x18')](0xcc)[_0x5fb6('0x19')]();});}};}function handleEntityNotFound(_0x4e2bff,_0x4cbdaf){return function(_0x298b44){if(!_0x298b44){_0x4e2bff[_0x5fb6('0x17')](0x194);}return _0x298b44;};}function handleError(_0x92f94d,_0x3ce22f){_0x3ce22f=_0x3ce22f||0x1f4;return function(_0x2731a3){logger[_0x5fb6('0x26')](_0x2731a3[_0x5fb6('0x27')]);if(_0x2731a3['name']){delete _0x2731a3[_0x5fb6('0x28')];}_0x92f94d[_0x5fb6('0x18')](_0x3ce22f)[_0x5fb6('0x29')](_0x2731a3);};}exports['index']=function(_0x2afc08,_0x1b4ae4){var _0x49a828={},_0x218428={},_0x408fd9={'count':0x0,'rows':[]};var _0x52afd7=_[_0x5fb6('0x2a')](db['Cdr'][_0x5fb6('0x2b')],function(_0x53dbeb){return{'name':_0x53dbeb['fieldName'],'type':_0x53dbeb[_0x5fb6('0x2c')][_0x5fb6('0x2d')]};});_0x218428[_0x5fb6('0x2e')]=_[_0x5fb6('0x2a')](_0x52afd7,_0x5fb6('0x28'));_0x218428[_0x5fb6('0x2f')]=_['keys'](_0x2afc08[_0x5fb6('0x2f')]);_0x218428[_0x5fb6('0x30')]=_[_0x5fb6('0x31')](_0x218428[_0x5fb6('0x2e')],_0x218428[_0x5fb6('0x2f')]);_0x49a828[_0x5fb6('0x32')]=_[_0x5fb6('0x31')](_0x218428[_0x5fb6('0x2e')],qs[_0x5fb6('0x33')](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x33')]));_0x49a828['attributes']=_0x49a828[_0x5fb6('0x32')][_0x5fb6('0x34')]?_0x49a828['attributes']:_0x218428[_0x5fb6('0x2e')];if(!_0x2afc08['query']['hasOwnProperty'](_0x5fb6('0x35'))){_0x49a828[_0x5fb6('0x1c')]=qs[_0x5fb6('0x1c')](_0x2afc08['query'][_0x5fb6('0x1c')]);_0x49a828['offset']=qs['offset'](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x1b')]);}_0x49a828[_0x5fb6('0x36')]=qs[_0x5fb6('0x37')](_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x37')]);_0x49a828[_0x5fb6('0x38')]=qs[_0x5fb6('0x30')](_[_0x5fb6('0x39')](_0x2afc08[_0x5fb6('0x2f')],_0x218428[_0x5fb6('0x30')]),_0x52afd7);if(_0x2afc08[_0x5fb6('0x2f')]['filter']){_0x49a828[_0x5fb6('0x38')]=_[_0x5fb6('0x3a')](_0x49a828[_0x5fb6('0x38')],{'$or':_['map'](_0x52afd7,function(_0x1e83fc){if(_0x1e83fc['type']!==_0x5fb6('0x3b')){var _0x4bd9e5={};_0x4bd9e5[_0x1e83fc[_0x5fb6('0x28')]]={'$like':'%'+_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x3c')]+'%'};return _0x4bd9e5;}})});}_0x49a828=_[_0x5fb6('0x3a')]({},_0x49a828,_0x2afc08[_0x5fb6('0x3d')]);var _0x59875a={'where':_0x49a828[_0x5fb6('0x38')]};return db[_0x5fb6('0x3e')][_0x5fb6('0x1e')](_0x59875a)[_0x5fb6('0x24')](function(_0x52e858){_0x408fd9[_0x5fb6('0x1e')]=_0x52e858;if(_0x2afc08[_0x5fb6('0x2f')][_0x5fb6('0x3f')]){_0x49a828[_0x5fb6('0x40')]=[{'all':!![]}];}return db[_0x5fb6('0x3e')][_0x5fb6('0x41')](_0x49a828);})['then'](function(_0x10c242){_0x408fd9[_0x5fb6('0x42')]=_0x10c242;return _0x408fd9;})[_0x5fb6('0x24')](respondWithFilteredResult(_0x1b4ae4,_0x49a828))[_0x5fb6('0x43')](handleError(_0x1b4ae4,null));};exports[_0x5fb6('0x44')]=function(_0x290e77,_0xd3245f){var _0x529c2d={'raw':!![],'where':{'id':_0x290e77[_0x5fb6('0x45')]['id']}},_0x2e3f97={};_0x2e3f97[_0x5fb6('0x2e')]=_['keys'](db[_0x5fb6('0x3e')]['rawAttributes']);_0x2e3f97[_0x5fb6('0x2f')]=_[_0x5fb6('0x46')](_0x290e77['query']);_0x2e3f97[_0x5fb6('0x30')]=_[_0x5fb6('0x31')](_0x2e3f97[_0x5fb6('0x2e')],_0x2e3f97['query']);_0x529c2d['attributes']=_[_0x5fb6('0x31')](_0x2e3f97[_0x5fb6('0x2e')],qs[_0x5fb6('0x33')](_0x290e77[_0x5fb6('0x2f')][_0x5fb6('0x33')]));_0x529c2d[_0x5fb6('0x32')]=_0x529c2d[_0x5fb6('0x32')][_0x5fb6('0x34')]?_0x529c2d[_0x5fb6('0x32')]:_0x2e3f97[_0x5fb6('0x2e')];if(_0x290e77[_0x5fb6('0x2f')]['includeAll']){_0x529c2d[_0x5fb6('0x40')]=[{'all':!![]}];}_0x529c2d=_['merge']({},_0x529c2d,_0x290e77['options']);return db[_0x5fb6('0x3e')][_0x5fb6('0x47')](_0x529c2d)[_0x5fb6('0x24')](handleEntityNotFound(_0xd3245f,null))[_0x5fb6('0x24')](respondWithResult(_0xd3245f,null))[_0x5fb6('0x43')](handleError(_0xd3245f,null));};exports[_0x5fb6('0x48')]=function(_0x45ba31,_0x5729a2){return db[_0x5fb6('0x3e')][_0x5fb6('0x48')](_0x45ba31['body'],{})[_0x5fb6('0x24')](respondWithResult(_0x5729a2,0xc9))[_0x5fb6('0x43')](handleError(_0x5729a2,null));};exports[_0x5fb6('0x23')]=function(_0x3fc547,_0x3b508a){if(_0x3fc547[_0x5fb6('0x49')]['id']){delete _0x3fc547[_0x5fb6('0x49')]['id'];}return db[_0x5fb6('0x3e')]['find']({'where':{'id':_0x3fc547[_0x5fb6('0x45')]['id']}})[_0x5fb6('0x24')](handleEntityNotFound(_0x3b508a,null))['then'](saveUpdates(_0x3fc547[_0x5fb6('0x49')],null))[_0x5fb6('0x24')](respondWithResult(_0x3b508a,null))[_0x5fb6('0x43')](handleError(_0x3b508a,null));};exports[_0x5fb6('0x25')]=function(_0x4bf156,_0x4bb943){return db[_0x5fb6('0x3e')][_0x5fb6('0x47')]({'where':{'id':_0x4bf156[_0x5fb6('0x45')]['id']}})['then'](handleEntityNotFound(_0x4bb943,null))[_0x5fb6('0x24')](removeEntity(_0x4bb943,null))['catch'](handleError(_0x4bb943,null));};exports[_0x5fb6('0x4a')]=function(_0x5eb7cf,_0xa949ae){return db[_0x5fb6('0x3e')][_0x5fb6('0x4a')]()['then'](respondWithResult(_0xa949ae,null))[_0x5fb6('0x43')](handleError(_0xa949ae,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 39b793f..9a2073f 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3be1e3,_0x248d3c){var _0x8289bd=function(_0x2c22fd){while(--_0x2c22fd){_0x3be1e3['push'](_0x3be1e3['shift']());}};_0x8289bd(++_0x248d3c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1f5a18,_0x26deb1){var _0x171af3=function(_0xec0a7b){while(--_0xec0a7b){_0x1f5a18['push'](_0x1f5a18['shift']());}};_0x171af3(++_0x26deb1);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 efebe7d..0251699 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 _0x7ec9=['message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x329fb5,_0x2f6c95){var _0x442197=function(_0x2674c4){while(--_0x2674c4){_0x329fb5['push'](_0x329fb5['shift']());}};_0x442197(++_0x2f6c95);}(_0x7ec9,0x153));var _0x97ec=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x7ec9[_0x459423];return _0x42ed14;};'use strict';var _=require('lodash');var util=require(_0x97ec('0x0'));var moment=require(_0x97ec('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97ec('0x2'));var db=require(_0x97ec('0x3'))['db'];var utils=require(_0x97ec('0x4'));var logger=require(_0x97ec('0x5'))(_0x97ec('0x6'));var config=require('../../config/environment');var jayson=require(_0x97ec('0x7'));var client=jayson[_0x97ec('0x8')][_0x97ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40c35f,_0x15b1c6,_0x151e5d){return new BPromise(function(_0x4b5484,_0x36154b){return client[_0x97ec('0xa')](_0x40c35f,_0x151e5d)['then'](function(_0x375de4){logger[_0x97ec('0xb')](_0x97ec('0xc'),_0x15b1c6,'request\x20sent');logger[_0x97ec('0xd')](_0x97ec('0xe'),_0x15b1c6,_0x97ec('0xf'),JSON['stringify'](_0x375de4));if(_0x375de4[_0x97ec('0x10')]){if(_0x375de4[_0x97ec('0x10')][_0x97ec('0x11')]===0x1f4){logger[_0x97ec('0x10')](_0x97ec('0xc'),_0x15b1c6,_0x375de4[_0x97ec('0x10')][_0x97ec('0x12')]);return _0x36154b(_0x375de4['error'][_0x97ec('0x12')]);}logger[_0x97ec('0x10')](_0x97ec('0xc'),_0x15b1c6,_0x375de4[_0x97ec('0x10')][_0x97ec('0x12')]);return _0x4b5484(_0x375de4[_0x97ec('0x10')][_0x97ec('0x12')]);}else{logger['info'](_0x97ec('0xc'),_0x15b1c6,_0x97ec('0xf'));_0x4b5484(_0x375de4[_0x97ec('0x13')][_0x97ec('0x12')]);}})[_0x97ec('0x14')](function(_0x4580c3){logger[_0x97ec('0x10')](_0x97ec('0xc'),_0x15b1c6,_0x4580c3);_0x36154b(_0x4580c3);});});} \ No newline at end of file +var _0xa141=['rpc','../../config/environment','jayson/promise','http','then','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x348737,_0x51fbe0){var _0x160a81=function(_0x4a7f94){while(--_0x4a7f94){_0x348737['push'](_0x348737['shift']());}};_0x160a81(++_0x51fbe0);}(_0xa141,0x1db));var _0x1a14=function(_0x11c68a,_0x3f0052){_0x11c68a=_0x11c68a-0x0;var _0x46f941=_0xa141[_0x11c68a];return _0x46f941;};'use strict';var _=require(_0x1a14('0x0'));var util=require(_0x1a14('0x1'));var moment=require(_0x1a14('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a14('0x3'));var fs=require('fs');var Redis=require(_0x1a14('0x4'));var db=require(_0x1a14('0x5'))['db'];var utils=require(_0x1a14('0x6'));var logger=require(_0x1a14('0x7'))(_0x1a14('0x8'));var config=require(_0x1a14('0x9'));var jayson=require(_0x1a14('0xa'));var client=jayson['client'][_0x1a14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x287f1b,_0x115e4a,_0x1b7577){return new BPromise(function(_0x4e63ef,_0x40751b){return client['request'](_0x287f1b,_0x1b7577)[_0x1a14('0xc')](function(_0xbd22bf){logger['info'](_0x1a14('0xd'),_0x115e4a,'request\x20sent');logger['debug'](_0x1a14('0xe'),_0x115e4a,_0x1a14('0xf'),JSON[_0x1a14('0x10')](_0xbd22bf));if(_0xbd22bf['error']){if(_0xbd22bf[_0x1a14('0x11')]['code']===0x1f4){logger['error'](_0x1a14('0xd'),_0x115e4a,_0xbd22bf[_0x1a14('0x11')]['message']);return _0x40751b(_0xbd22bf[_0x1a14('0x11')]['message']);}logger[_0x1a14('0x11')]('Cdr,\x20%s,\x20%s',_0x115e4a,_0xbd22bf['error'][_0x1a14('0x12')]);return _0x4e63ef(_0xbd22bf[_0x1a14('0x11')][_0x1a14('0x12')]);}else{logger[_0x1a14('0x13')](_0x1a14('0xd'),_0x115e4a,_0x1a14('0xf'));_0x4e63ef(_0xbd22bf[_0x1a14('0x14')][_0x1a14('0x12')]);}})['catch'](function(_0x4cfe01){logger[_0x1a14('0x11')](_0x1a14('0xd'),_0x115e4a,_0x4cfe01);_0x40751b(_0x4cfe01);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 7bc9f53..05e94a4 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x36331a,_0x4c4a5c){var _0x22b292=function(_0x5b0d6a){while(--_0x5b0d6a){_0x36331a['push'](_0x36331a['shift']());}};_0x22b292(++_0x4c4a5c);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b2667,_0x279eb1){_0x1b2667=_0x1b2667-0x0;var _0x179ae8=_0xb10b[_0x1b2667];return _0x179ae8;};'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')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=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(_0x3fb9dd,_0x174fff){var _0x20136a=function(_0x480081){while(--_0x480081){_0x3fb9dd['push'](_0x3fb9dd['shift']());}};_0x20136a(++_0x174fff);}(_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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 235aa07..45c57bd 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 _0xe29d=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x1caf71,_0x3f5acc){var _0x435251=function(_0x52e455){while(--_0x52e455){_0x1caf71['push'](_0x1caf71['shift']());}};_0x435251(++_0x3f5acc);}(_0xe29d,0x128));var _0xde29=function(_0x371815,_0x1d73c5){_0x371815=_0x371815-0x0;var _0x49a4a4=_0xe29d[_0x371815];return _0x49a4a4;};'use strict';var Sequelize=require(_0xde29('0x0'));module[_0xde29('0x1')]={'priority':{'type':Sequelize[_0xde29('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xde29('0x3')},'appdata':{'type':Sequelize[_0xde29('0x4')]()},'description':{'type':Sequelize[_0xde29('0x5')]},'interval':{'type':Sequelize[_0xde29('0x5')],'defaultValue':_0xde29('0x6')}}; \ No newline at end of file +var _0x8453=['sequelize','exports','INTEGER','STRING','TEXT','*,*,*,*'];(function(_0x4749bd,_0xa62283){var _0x33f3a5=function(_0xbd8002){while(--_0xbd8002){_0x4749bd['push'](_0x4749bd['shift']());}};_0x33f3a5(++_0xa62283);}(_0x8453,0x174));var _0x3845=function(_0x4ac890,_0x1bba04){_0x4ac890=_0x4ac890-0x0;var _0x98d83=_0x8453[_0x4ac890];return _0x98d83;};'use strict';var Sequelize=require(_0x3845('0x0'));module[_0x3845('0x1')]={'priority':{'type':Sequelize[_0x3845('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3845('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3845('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3845('0x3')],'defaultValue':_0x3845('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index dc23940..8774e32 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 _0xbe31=['catch','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','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','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','find'];(function(_0x372f05,_0x4fab9){var _0x3099fc=function(_0x3c3f19){while(--_0x3c3f19){_0x372f05['push'](_0x372f05['shift']());}};_0x3099fc(++_0x4fab9);}(_0xbe31,0x83));var _0x1be3=function(_0x2439d0,_0x34c4cf){_0x2439d0=_0x2439d0-0x0;var _0xbbfc41=_0xbe31[_0x2439d0];return _0xbbfc41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be3('0x0'));var zipdir=require(_0x1be3('0x1'));var jsonpatch=require(_0x1be3('0x2'));var rp=require(_0x1be3('0x3'));var moment=require(_0x1be3('0x4'));var BPromise=require(_0x1be3('0x5'));var Mustache=require(_0x1be3('0x6'));var util=require(_0x1be3('0x7'));var path=require(_0x1be3('0x8'));var sox=require('sox');var csv=require(_0x1be3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1be3('0xa'));var _=require(_0x1be3('0xb'));var squel=require(_0x1be3('0xc'));var crypto=require(_0x1be3('0xd'));var jsforce=require(_0x1be3('0xe'));var deskjs=require(_0x1be3('0xf'));var toCsv=require(_0x1be3('0x9'));var querystring=require(_0x1be3('0x10'));var Papa=require(_0x1be3('0x11'));var Redis=require(_0x1be3('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1be3('0x13'));var as=require(_0x1be3('0x14'));var hardwareService=require(_0x1be3('0x15'));var logger=require(_0x1be3('0x16'))(_0x1be3('0x17'));var utils=require(_0x1be3('0x18'));var config=require(_0x1be3('0x19'));var licenseUtil=require(_0x1be3('0x1a'));var db=require(_0x1be3('0x1b'))['db'];function respondWithStatusCode(_0x50552d,_0x3601f7){_0x3601f7=_0x3601f7||0xcc;return function(_0x492f66){if(_0x492f66){return _0x50552d[_0x1be3('0x1c')](_0x3601f7);}return _0x50552d[_0x1be3('0x1d')](_0x3601f7)['end']();};}function respondWithResult(_0x26f888,_0x573684){_0x573684=_0x573684||0xc8;return function(_0xc7cc3){if(_0xc7cc3){return _0x26f888[_0x1be3('0x1d')](_0x573684)[_0x1be3('0x1e')](_0xc7cc3);}};}function respondWithFilteredResult(_0xd30cd,_0x1156bc){return function(_0x269ac3){if(_0x269ac3){var _0x567919=typeof _0x1156bc['offset']==='undefined'&&typeof _0x1156bc['limit']===_0x1be3('0x1f');var _0x4ebba6=_0x269ac3[_0x1be3('0x20')];var _0x6b7edf=_0x567919?0x0:_0x1156bc[_0x1be3('0x21')];var _0x1d0c2b=_0x567919?_0x269ac3[_0x1be3('0x20')]:_0x1156bc[_0x1be3('0x21')]+_0x1156bc[_0x1be3('0x22')];var _0x41c2af;if(_0x1d0c2b>=_0x4ebba6){_0x1d0c2b=_0x4ebba6;_0x41c2af=0xc8;}else{_0x41c2af=0xce;}_0xd30cd[_0x1be3('0x1d')](_0x41c2af);return _0xd30cd[_0x1be3('0x23')](_0x1be3('0x24'),_0x6b7edf+'-'+_0x1d0c2b+'/'+_0x4ebba6)[_0x1be3('0x1e')](_0x269ac3);}return null;};}function patchUpdates(_0x57c78c){return function(_0x49123f){try{jsonpatch[_0x1be3('0x25')](_0x49123f,_0x57c78c,!![]);}catch(_0x4cacb9){return BPromise[_0x1be3('0x26')](_0x4cacb9);}return _0x49123f[_0x1be3('0x27')]();};}function saveUpdates(_0x4366e8,_0x3bd167){return function(_0x3c0564){if(_0x3c0564){return _0x3c0564[_0x1be3('0x28')](_0x4366e8)[_0x1be3('0x29')](function(_0x57c192){return _0x57c192;});}return null;};}function removeEntity(_0x186b8a,_0x48862c){return function(_0x237a6c){if(_0x237a6c){return _0x237a6c[_0x1be3('0x2a')]()['then'](function(){_0x186b8a[_0x1be3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x134d79,_0x12023d){return function(_0x393f98){if(!_0x393f98){_0x134d79[_0x1be3('0x1c')](0x194);}return _0x393f98;};}function handleError(_0x4ce12f,_0x1e2943){_0x1e2943=_0x1e2943||0x1f4;return function(_0x8d1f58){logger['error'](_0x8d1f58[_0x1be3('0x2b')]);if(_0x8d1f58[_0x1be3('0x2c')]){delete _0x8d1f58[_0x1be3('0x2c')];}_0x4ce12f[_0x1be3('0x1d')](_0x1e2943)[_0x1be3('0x2d')](_0x8d1f58);};}exports[_0x1be3('0x2e')]=function(_0x5d35cf,_0x5bb993){var _0x49f0e0={'raw':!![],'where':{'id':_0x5d35cf['params']['id']}},_0x25ed26={};_0x25ed26[_0x1be3('0x2f')]=_[_0x1be3('0x30')](db['ChatApplication']['rawAttributes']);_0x25ed26[_0x1be3('0x31')]=_[_0x1be3('0x30')](_0x5d35cf[_0x1be3('0x31')]);_0x25ed26[_0x1be3('0x32')]=_[_0x1be3('0x33')](_0x25ed26[_0x1be3('0x2f')],_0x25ed26['query']);_0x49f0e0['attributes']=_['intersection'](_0x25ed26['model'],qs[_0x1be3('0x34')](_0x5d35cf[_0x1be3('0x31')][_0x1be3('0x34')]));_0x49f0e0[_0x1be3('0x35')]=_0x49f0e0[_0x1be3('0x35')][_0x1be3('0x36')]?_0x49f0e0[_0x1be3('0x35')]:_0x25ed26['model'];if(_0x5d35cf[_0x1be3('0x31')][_0x1be3('0x37')]){_0x49f0e0[_0x1be3('0x38')]=[{'all':!![]}];}_0x49f0e0=_[_0x1be3('0x39')]({},_0x49f0e0,_0x5d35cf[_0x1be3('0x3a')]);return db[_0x1be3('0x3b')][_0x1be3('0x3c')](_0x49f0e0)['then'](handleEntityNotFound(_0x5bb993,null))[_0x1be3('0x29')](respondWithResult(_0x5bb993,null))[_0x1be3('0x3d')](handleError(_0x5bb993,null));};exports[_0x1be3('0x28')]=function(_0x4f7751,_0x55e5c2){if(_0x4f7751[_0x1be3('0x3e')]['id']){delete _0x4f7751[_0x1be3('0x3e')]['id'];}return db[_0x1be3('0x3b')]['find']({'where':{'id':_0x4f7751['params']['id']}})['then'](handleEntityNotFound(_0x55e5c2,null))[_0x1be3('0x29')](saveUpdates(_0x4f7751[_0x1be3('0x3e')],null))[_0x1be3('0x29')](respondWithResult(_0x55e5c2,null))['catch'](handleError(_0x55e5c2,null));};exports[_0x1be3('0x2a')]=function(_0x519902,_0x3aefa9){return db[_0x1be3('0x3b')]['find']({'where':{'id':_0x519902[_0x1be3('0x3f')]['id']}})[_0x1be3('0x29')](handleEntityNotFound(_0x3aefa9,null))[_0x1be3('0x29')](removeEntity(_0x3aefa9,null))[_0x1be3('0x3d')](handleError(_0x3aefa9,null));}; \ No newline at end of file +var _0x14b7=['then','destroy','end','sendStatus','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','attributes','fields','length','include','merge','options','ChatApplication','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0xb4ad30,_0x59ab58){var _0x5c8d90=function(_0x5a4449){while(--_0x5a4449){_0xb4ad30['push'](_0xb4ad30['shift']());}};_0x5c8d90(++_0x59ab58);}(_0x14b7,0x144));var _0x714b=function(_0x4776cc,_0x3a715e){_0x4776cc=_0x4776cc-0x0;var _0x427bda=_0x14b7[_0x4776cc];return _0x427bda;};'use strict';var emlformat=require(_0x714b('0x0'));var rimraf=require(_0x714b('0x1'));var zipdir=require(_0x714b('0x2'));var jsonpatch=require(_0x714b('0x3'));var rp=require('request-promise');var moment=require(_0x714b('0x4'));var BPromise=require(_0x714b('0x5'));var Mustache=require(_0x714b('0x6'));var util=require(_0x714b('0x7'));var path=require(_0x714b('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x714b('0x9'));var fs=require('fs');var fs_extra=require(_0x714b('0xa'));var _=require(_0x714b('0xb'));var squel=require('squel');var crypto=require(_0x714b('0xc'));var jsforce=require(_0x714b('0xd'));var deskjs=require(_0x714b('0xe'));var toCsv=require(_0x714b('0xf'));var querystring=require(_0x714b('0x10'));var Papa=require('papaparse');var Redis=require(_0x714b('0x11'));var authService=require(_0x714b('0x12'));var qs=require(_0x714b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x714b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x714b('0x15'));var config=require(_0x714b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x714b('0x17'))['db'];function respondWithStatusCode(_0x253b28,_0x37bbf3){_0x37bbf3=_0x37bbf3||0xcc;return function(_0x2abf13){if(_0x2abf13){return _0x253b28['sendStatus'](_0x37bbf3);}return _0x253b28[_0x714b('0x18')](_0x37bbf3)['end']();};}function respondWithResult(_0x21112a,_0x232478){_0x232478=_0x232478||0xc8;return function(_0x5b2770){if(_0x5b2770){return _0x21112a[_0x714b('0x18')](_0x232478)[_0x714b('0x19')](_0x5b2770);}};}function respondWithFilteredResult(_0x1a8e93,_0x36688b){return function(_0x26c18f){if(_0x26c18f){var _0x3e430d=typeof _0x36688b[_0x714b('0x1a')]===_0x714b('0x1b')&&typeof _0x36688b[_0x714b('0x1c')]==='undefined';var _0xad2df2=_0x26c18f['count'];var _0x26d557=_0x3e430d?0x0:_0x36688b['offset'];var _0x448437=_0x3e430d?_0x26c18f[_0x714b('0x1d')]:_0x36688b[_0x714b('0x1a')]+_0x36688b[_0x714b('0x1c')];var _0x43205d;if(_0x448437>=_0xad2df2){_0x448437=_0xad2df2;_0x43205d=0xc8;}else{_0x43205d=0xce;}_0x1a8e93[_0x714b('0x18')](_0x43205d);return _0x1a8e93[_0x714b('0x1e')](_0x714b('0x1f'),_0x26d557+'-'+_0x448437+'/'+_0xad2df2)[_0x714b('0x19')](_0x26c18f);}return null;};}function patchUpdates(_0x42d74a){return function(_0x1b263b){try{jsonpatch[_0x714b('0x20')](_0x1b263b,_0x42d74a,!![]);}catch(_0x28ede1){return BPromise[_0x714b('0x21')](_0x28ede1);}return _0x1b263b[_0x714b('0x22')]();};}function saveUpdates(_0x49c25f,_0x1f599b){return function(_0x81de31){if(_0x81de31){return _0x81de31[_0x714b('0x23')](_0x49c25f)[_0x714b('0x24')](function(_0x567ed8){return _0x567ed8;});}return null;};}function removeEntity(_0x597b93,_0x384440){return function(_0x172db0){if(_0x172db0){return _0x172db0[_0x714b('0x25')]()[_0x714b('0x24')](function(){_0x597b93[_0x714b('0x18')](0xcc)[_0x714b('0x26')]();});}};}function handleEntityNotFound(_0x2f97e0,_0x5bdf8a){return function(_0x2045c1){if(!_0x2045c1){_0x2f97e0[_0x714b('0x27')](0x194);}return _0x2045c1;};}function handleError(_0x376d14,_0x5ac0b0){_0x5ac0b0=_0x5ac0b0||0x1f4;return function(_0x552a16){logger['error'](_0x552a16[_0x714b('0x28')]);if(_0x552a16[_0x714b('0x29')]){delete _0x552a16['name'];}_0x376d14[_0x714b('0x18')](_0x5ac0b0)[_0x714b('0x2a')](_0x552a16);};}exports[_0x714b('0x2b')]=function(_0x318072,_0x3c62ca){var _0x31f4a7={'raw':!![],'where':{'id':_0x318072[_0x714b('0x2c')]['id']}},_0x122a02={};_0x122a02[_0x714b('0x2d')]=_['keys'](db['ChatApplication'][_0x714b('0x2e')]);_0x122a02[_0x714b('0x2f')]=_[_0x714b('0x30')](_0x318072[_0x714b('0x2f')]);_0x122a02['filters']=_[_0x714b('0x31')](_0x122a02[_0x714b('0x2d')],_0x122a02['query']);_0x31f4a7[_0x714b('0x32')]=_[_0x714b('0x31')](_0x122a02[_0x714b('0x2d')],qs[_0x714b('0x33')](_0x318072[_0x714b('0x2f')][_0x714b('0x33')]));_0x31f4a7['attributes']=_0x31f4a7[_0x714b('0x32')][_0x714b('0x34')]?_0x31f4a7[_0x714b('0x32')]:_0x122a02[_0x714b('0x2d')];if(_0x318072[_0x714b('0x2f')]['includeAll']){_0x31f4a7[_0x714b('0x35')]=[{'all':!![]}];}_0x31f4a7=_[_0x714b('0x36')]({},_0x31f4a7,_0x318072[_0x714b('0x37')]);return db[_0x714b('0x38')][_0x714b('0x39')](_0x31f4a7)[_0x714b('0x24')](handleEntityNotFound(_0x3c62ca,null))[_0x714b('0x24')](respondWithResult(_0x3c62ca,null))[_0x714b('0x3a')](handleError(_0x3c62ca,null));};exports[_0x714b('0x23')]=function(_0x177467,_0x1e288c){if(_0x177467[_0x714b('0x3b')]['id']){delete _0x177467[_0x714b('0x3b')]['id'];}return db['ChatApplication'][_0x714b('0x39')]({'where':{'id':_0x177467['params']['id']}})[_0x714b('0x24')](handleEntityNotFound(_0x1e288c,null))[_0x714b('0x24')](saveUpdates(_0x177467['body'],null))[_0x714b('0x24')](respondWithResult(_0x1e288c,null))['catch'](handleError(_0x1e288c,null));};exports[_0x714b('0x25')]=function(_0xd4b967,_0x4b2296){return db[_0x714b('0x38')][_0x714b('0x39')]({'where':{'id':_0xd4b967[_0x714b('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4b2296,null))[_0x714b('0x24')](removeEntity(_0x4b2296,null))[_0x714b('0x3a')](handleError(_0x4b2296,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 652da62..9e62571 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 _0x78cd=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','define','chat_applications','utf8mb4_unicode_ci'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x78cd,0x114));var _0xd78c=function(_0x8e992d,_0x5dd91c){_0x8e992d=_0x8e992d-0x0;var _0x41dd7f=_0x78cd[_0x8e992d];return _0x41dd7f;};'use strict';var _=require('lodash');var util=require(_0xd78c('0x0'));var logger=require('../../config/logger')(_0xd78c('0x1'));var moment=require(_0xd78c('0x2'));var BPromise=require(_0xd78c('0x3'));var rp=require(_0xd78c('0x4'));var fs=require('fs');var path=require(_0xd78c('0x5'));var rimraf=require(_0xd78c('0x6'));var config=require(_0xd78c('0x7'));var attributes=require(_0xd78c('0x8'));module['exports']=function(_0x2866d3,_0x1d1ee2){return _0x2866d3[_0xd78c('0x9')]('ChatApplication',attributes,{'tableName':_0xd78c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd78c('0xb')});}; \ No newline at end of file +var _0x0a12=['util','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','chat_applications'];(function(_0x249dfe,_0x21f85c){var _0xc7c7be=function(_0x3d0837){while(--_0x3d0837){_0x249dfe['push'](_0x249dfe['shift']());}};_0xc7c7be(++_0x21f85c);}(_0x0a12,0xb8));var _0x20a1=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x0a12[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0x20a1('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x20a1('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20a1('0x2'));var rimraf=require(_0x20a1('0x3'));var config=require(_0x20a1('0x4'));var attributes=require(_0x20a1('0x5'));module[_0x20a1('0x6')]=function(_0x2e0ad3,_0x1fedd2){return _0x2e0ad3['define']('ChatApplication',attributes,{'tableName':_0x20a1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 4fbe530..2763571 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 _0x2d26=['code','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4dd89b,_0x4b4500){var _0x361679=function(_0x1a422a){while(--_0x1a422a){_0x4dd89b['push'](_0x4dd89b['shift']());}};_0x361679(++_0x4b4500);}(_0x2d26,0x16d));var _0x62d2=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x2d26[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x62d2('0x0'));var util=require(_0x62d2('0x1'));var moment=require(_0x62d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x62d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62d2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x62d2('0x5'))('rpc');var config=require(_0x62d2('0x6'));var jayson=require(_0x62d2('0x7'));var client=jayson[_0x62d2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14cd58,_0x1b8a8,_0x1959e0){return new BPromise(function(_0x1b70c5,_0x1f42d2){return client['request'](_0x14cd58,_0x1959e0)[_0x62d2('0x9')](function(_0x374319){logger[_0x62d2('0xa')](_0x62d2('0xb'),_0x1b8a8,_0x62d2('0xc'));logger['debug'](_0x62d2('0xd'),_0x1b8a8,'request\x20sent',JSON[_0x62d2('0xe')](_0x374319));if(_0x374319['error']){if(_0x374319['error'][_0x62d2('0xf')]===0x1f4){logger[_0x62d2('0x10')](_0x62d2('0xb'),_0x1b8a8,_0x374319[_0x62d2('0x10')][_0x62d2('0x11')]);return _0x1f42d2(_0x374319[_0x62d2('0x10')][_0x62d2('0x11')]);}logger['error'](_0x62d2('0xb'),_0x1b8a8,_0x374319['error'][_0x62d2('0x11')]);return _0x1b70c5(_0x374319[_0x62d2('0x10')]['message']);}else{logger['info'](_0x62d2('0xb'),_0x1b8a8,_0x62d2('0xc'));_0x1b70c5(_0x374319['result'][_0x62d2('0x11')]);}})[_0x62d2('0x12')](function(_0x2491ee){logger[_0x62d2('0x10')]('ChatApplication,\x20%s,\x20%s',_0x1b8a8,_0x2491ee);_0x1f42d2(_0x2491ee);});});} \ No newline at end of file +var _0xbdd9=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xbdd9,0x1ec));var _0x9bdd=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0xbdd9[_0x328b1c];return _0x4dbeaa;};'use strict';var _=require(_0x9bdd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9bdd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bdd('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9bdd('0x3'))(_0x9bdd('0x4'));var config=require(_0x9bdd('0x5'));var jayson=require(_0x9bdd('0x6'));var client=jayson[_0x9bdd('0x7')][_0x9bdd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x323651,_0x3b3362,_0x557392){return new BPromise(function(_0x18378f,_0x561512){return client['request'](_0x323651,_0x557392)[_0x9bdd('0x9')](function(_0x5833ee){logger[_0x9bdd('0xa')](_0x9bdd('0xb'),_0x3b3362,'request\x20sent');logger[_0x9bdd('0xc')](_0x9bdd('0xd'),_0x3b3362,_0x9bdd('0xe'),JSON[_0x9bdd('0xf')](_0x5833ee));if(_0x5833ee[_0x9bdd('0x10')]){if(_0x5833ee[_0x9bdd('0x10')]['code']===0x1f4){logger[_0x9bdd('0x10')](_0x9bdd('0xb'),_0x3b3362,_0x5833ee[_0x9bdd('0x10')][_0x9bdd('0x11')]);return _0x561512(_0x5833ee['error'][_0x9bdd('0x11')]);}logger[_0x9bdd('0x10')](_0x9bdd('0xb'),_0x3b3362,_0x5833ee['error'][_0x9bdd('0x11')]);return _0x18378f(_0x5833ee[_0x9bdd('0x10')][_0x9bdd('0x11')]);}else{logger[_0x9bdd('0xa')](_0x9bdd('0xb'),_0x3b3362,_0x9bdd('0xe'));_0x18378f(_0x5833ee[_0x9bdd('0x12')]['message']);}})['catch'](function(_0x586502){logger['error'](_0x9bdd('0xb'),_0x3b3362,_0x586502);_0x561512(_0x586502);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 73dbf2c..138a2f4 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 _0x9e93=['express','Router','fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','put','update','destroy','multer','path','connect-timeout'];(function(_0x4e7cea,_0xc1b05a){var _0x4cefad=function(_0x139ef5){while(--_0x139ef5){_0x4e7cea['push'](_0x4e7cea['shift']());}};_0x4cefad(++_0xc1b05a);}(_0x9e93,0xb3));var _0x39e9=function(_0x540dcb,_0x4eacb6){_0x540dcb=_0x540dcb-0x0;var _0x49353c=_0x9e93[_0x540dcb];return _0x49353c;};'use strict';var multer=require(_0x39e9('0x0'));var util=require('util');var path=require(_0x39e9('0x1'));var timeout=require(_0x39e9('0x2'));var express=require(_0x39e9('0x3'));var router=express[_0x39e9('0x4')]();var fs_extra=require(_0x39e9('0x5'));var auth=require(_0x39e9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x39e9('0x7')](_0x39e9('0x8'),auth[_0x39e9('0x9')](),controller[_0x39e9('0xa')]);router[_0x39e9('0xb')](_0x39e9('0x8'),auth[_0x39e9('0x9')](),controller[_0x39e9('0xc')]);router['delete'](_0x39e9('0x8'),auth[_0x39e9('0x9')](),controller[_0x39e9('0xd')]);module['exports']=router; \ No newline at end of file +var _0x5399=['show','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5399,0x1f3));var _0x9539=function(_0x3b5964,_0x2f21c4){_0x3b5964=_0x3b5964-0x0;var _0xbc8296=_0x5399[_0x3b5964];return _0xbc8296;};'use strict';var multer=require(_0x9539('0x0'));var util=require('util');var path=require(_0x9539('0x1'));var timeout=require(_0x9539('0x2'));var express=require(_0x9539('0x3'));var router=express[_0x9539('0x4')]();var fs_extra=require(_0x9539('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9539('0x6'));var config=require(_0x9539('0x7'));var controller=require(_0x9539('0x8'));router[_0x9539('0x9')]('/:id',auth[_0x9539('0xa')](),controller[_0x9539('0xb')]);router[_0x9539('0xc')](_0x9539('0xd'),auth['isAuthenticated'](),controller[_0x9539('0xe')]);router[_0x9539('0xf')](_0x9539('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x9539('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 e65b045..2b70d6b 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 _0x3e65=['sequelize','STRING','BOOLEAN'];(function(_0xb49d15,_0x4cfe7b){var _0xb625b4=function(_0xd24c31){while(--_0xd24c31){_0xb49d15['push'](_0xb49d15['shift']());}};_0xb625b4(++_0x4cfe7b);}(_0x3e65,0xde));var _0x53e6=function(_0x477e62,_0x4db149){_0x477e62=_0x477e62-0x0;var _0xde0626=_0x3e65[_0x477e62];return _0xde0626;};'use strict';var Sequelize=require(_0x53e6('0x0'));module['exports']={'name':{'type':Sequelize[_0x53e6('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x53e6('0x1')]},'write':{'type':Sequelize[_0x53e6('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xdf13=['STRING','exports'];(function(_0x10c4fa,_0x1400e6){var _0x5cd3bf=function(_0x19b739){while(--_0x19b739){_0x10c4fa['push'](_0x10c4fa['shift']());}};_0x5cd3bf(++_0x1400e6);}(_0xdf13,0x171));var _0x3df1=function(_0x264c84,_0x598700){_0x264c84=_0x264c84-0x0;var _0x1fd84c=_0xdf13[_0x264c84];return _0x1fd84c;};'use strict';var Sequelize=require('sequelize');module[_0x3df1('0x0')]={'name':{'type':Sequelize[_0x3df1('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3df1('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 1ee0aba..92cfaba 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 _0x6717=['end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatGroup','findAll','rows','catch','show','includeAll','include','find','body','params','describe','getUnread','toInteger','addMembers','ids','getMembers','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','create','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus'];(function(_0x410fd3,_0x393742){var _0x4095e2=function(_0x411375){while(--_0x411375){_0x410fd3['push'](_0x410fd3['shift']());}};_0x4095e2(++_0x393742);}(_0x6717,0x9c));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7671('0x0'));var rimraf=require(_0x7671('0x1'));var zipdir=require(_0x7671('0x2'));var jsonpatch=require(_0x7671('0x3'));var rp=require(_0x7671('0x4'));var moment=require(_0x7671('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7671('0x6'));var path=require('path');var sox=require(_0x7671('0x7'));var csv=require(_0x7671('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7671('0x9'));var _=require('lodash');var squel=require(_0x7671('0xa'));var crypto=require(_0x7671('0xb'));var jsforce=require(_0x7671('0xc'));var deskjs=require(_0x7671('0xd'));var toCsv=require(_0x7671('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7671('0xe'));var authService=require(_0x7671('0xf'));var qs=require(_0x7671('0x10'));var as=require(_0x7671('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7671('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x7671('0x13'));var licenseUtil=require(_0x7671('0x14'));var db=require(_0x7671('0x15'))['db'];config['redis']=_['defaults'](config[_0x7671('0x16')],{'host':_0x7671('0x17'),'port':0x18eb});var socket=require(_0x7671('0x18'))(new Redis(config[_0x7671('0x16')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x1fe34e,_0x49241d){_0x49241d=_0x49241d||0xcc;return function(_0x5319fc){if(_0x5319fc){return _0x1fe34e[_0x7671('0x19')](_0x49241d);}return _0x1fe34e['status'](_0x49241d)[_0x7671('0x1a')]();};}function respondWithResult(_0x2342d4,_0x4ad75a){_0x4ad75a=_0x4ad75a||0xc8;return function(_0x4d1a88){if(_0x4d1a88){return _0x2342d4[_0x7671('0x1b')](_0x4ad75a)[_0x7671('0x1c')](_0x4d1a88);}};}function respondWithFilteredResult(_0x54067b,_0x5d2c87){return function(_0x1edf41){if(_0x1edf41){var _0x1cc84a=typeof _0x5d2c87['offset']==='undefined'&&typeof _0x5d2c87['limit']==='undefined';var _0x2abd74=_0x1edf41[_0x7671('0x1d')];var _0x68ff56=_0x1cc84a?0x0:_0x5d2c87[_0x7671('0x1e')];var _0x9904a8=_0x1cc84a?_0x1edf41[_0x7671('0x1d')]:_0x5d2c87[_0x7671('0x1e')]+_0x5d2c87[_0x7671('0x1f')];var _0x4e27e3;if(_0x9904a8>=_0x2abd74){_0x9904a8=_0x2abd74;_0x4e27e3=0xc8;}else{_0x4e27e3=0xce;}_0x54067b[_0x7671('0x1b')](_0x4e27e3);return _0x54067b[_0x7671('0x20')](_0x7671('0x21'),_0x68ff56+'-'+_0x9904a8+'/'+_0x2abd74)['json'](_0x1edf41);}return null;};}function patchUpdates(_0x1a60b2){return function(_0x2f8feb){try{jsonpatch[_0x7671('0x22')](_0x2f8feb,_0x1a60b2,!![]);}catch(_0x26687f){return BPromise['reject'](_0x26687f);}return _0x2f8feb[_0x7671('0x23')]();};}function saveUpdates(_0x2bfb01,_0x202e9c){return function(_0x18a268){if(_0x18a268){return _0x18a268[_0x7671('0x24')](_0x2bfb01)[_0x7671('0x25')](function(_0x21e7cd){return _0x21e7cd;});}return null;};}function removeEntity(_0x23935c,_0x4db916){return function(_0x24dc59){if(_0x24dc59){return _0x24dc59[_0x7671('0x26')]()['then'](function(){_0x23935c['status'](0xcc)[_0x7671('0x1a')]();});}};}function handleEntityNotFound(_0x3ef7b3,_0x473813){return function(_0x55a2bd){if(!_0x55a2bd){_0x3ef7b3[_0x7671('0x19')](0x194);}return _0x55a2bd;};}function handleError(_0x321501,_0x195892){_0x195892=_0x195892||0x1f4;return function(_0x45648b){logger[_0x7671('0x27')](_0x45648b['stack']);if(_0x45648b[_0x7671('0x28')]){delete _0x45648b['name'];}_0x321501['status'](_0x195892)['send'](_0x45648b);};}exports[_0x7671('0x29')]=function(_0x2fa819,_0x3e8613){var _0x1d8679={},_0x3c8927={},_0x2c4083={'count':0x0,'rows':[]};var _0x1fe55c=_[_0x7671('0x2a')](db['ChatGroup'][_0x7671('0x2b')],function(_0x10cd16){return{'name':_0x10cd16[_0x7671('0x2c')],'type':_0x10cd16[_0x7671('0x2d')][_0x7671('0x2e')]};});_0x3c8927[_0x7671('0x2f')]=_[_0x7671('0x2a')](_0x1fe55c,_0x7671('0x28'));_0x3c8927[_0x7671('0x30')]=_[_0x7671('0x31')](_0x2fa819[_0x7671('0x30')]);_0x3c8927[_0x7671('0x32')]=_['intersection'](_0x3c8927[_0x7671('0x2f')],_0x3c8927['query']);_0x1d8679[_0x7671('0x33')]=_[_0x7671('0x34')](_0x3c8927['model'],qs[_0x7671('0x35')](_0x2fa819[_0x7671('0x30')][_0x7671('0x35')]));_0x1d8679[_0x7671('0x33')]=_0x1d8679[_0x7671('0x33')][_0x7671('0x36')]?_0x1d8679[_0x7671('0x33')]:_0x3c8927[_0x7671('0x2f')];if(!_0x2fa819[_0x7671('0x30')][_0x7671('0x37')]('nolimit')){_0x1d8679[_0x7671('0x1f')]=qs[_0x7671('0x1f')](_0x2fa819[_0x7671('0x30')][_0x7671('0x1f')]);_0x1d8679['offset']=qs['offset'](_0x2fa819[_0x7671('0x30')][_0x7671('0x1e')]);}_0x1d8679[_0x7671('0x38')]=qs[_0x7671('0x39')](_0x2fa819[_0x7671('0x30')][_0x7671('0x39')]);_0x1d8679[_0x7671('0x3a')]=qs[_0x7671('0x32')](_[_0x7671('0x3b')](_0x2fa819[_0x7671('0x30')],_0x3c8927[_0x7671('0x32')]),_0x1fe55c);if(_0x2fa819['query'][_0x7671('0x3c')]){_0x1d8679[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x1d8679[_0x7671('0x3a')],{'$or':_[_0x7671('0x2a')](_0x1fe55c,function(_0x3f59d0){if(_0x3f59d0[_0x7671('0x2d')]!==_0x7671('0x3e')){var _0x1171fa={};_0x1171fa[_0x3f59d0[_0x7671('0x28')]]={'$like':'%'+_0x2fa819[_0x7671('0x30')]['filter']+'%'};return _0x1171fa;}})});}_0x1d8679=_[_0x7671('0x3d')]({},_0x1d8679,_0x2fa819[_0x7671('0x3f')]);var _0x45a17d={'where':_0x1d8679['where']};return db[_0x7671('0x40')]['count'](_0x45a17d)[_0x7671('0x25')](function(_0x4f9132){_0x2c4083[_0x7671('0x1d')]=_0x4f9132;if(_0x2fa819[_0x7671('0x30')]['includeAll']){_0x1d8679['include']=[{'all':!![]}];}return db['ChatGroup'][_0x7671('0x41')](_0x1d8679);})[_0x7671('0x25')](function(_0x34318b){_0x2c4083[_0x7671('0x42')]=_0x34318b;return _0x2c4083;})[_0x7671('0x25')](respondWithFilteredResult(_0x3e8613,_0x1d8679))[_0x7671('0x43')](handleError(_0x3e8613,null));};exports[_0x7671('0x44')]=function(_0x435710,_0x1d74b7){var _0x3cfb08={'raw':!![],'where':{'id':_0x435710['params']['id']}},_0x142ef8={};_0x142ef8['model']=_['keys'](db[_0x7671('0x40')][_0x7671('0x2b')]);_0x142ef8[_0x7671('0x30')]=_[_0x7671('0x31')](_0x435710[_0x7671('0x30')]);_0x142ef8[_0x7671('0x32')]=_['intersection'](_0x142ef8[_0x7671('0x2f')],_0x142ef8[_0x7671('0x30')]);_0x3cfb08[_0x7671('0x33')]=_['intersection'](_0x142ef8[_0x7671('0x2f')],qs['fields'](_0x435710[_0x7671('0x30')]['fields']));_0x3cfb08[_0x7671('0x33')]=_0x3cfb08['attributes']['length']?_0x3cfb08[_0x7671('0x33')]:_0x142ef8[_0x7671('0x2f')];if(_0x435710[_0x7671('0x30')][_0x7671('0x45')]){_0x3cfb08[_0x7671('0x46')]=[{'all':!![]}];}_0x3cfb08=_[_0x7671('0x3d')]({},_0x3cfb08,_0x435710[_0x7671('0x3f')]);return db['ChatGroup'][_0x7671('0x47')](_0x3cfb08)[_0x7671('0x25')](handleEntityNotFound(_0x1d74b7,null))[_0x7671('0x25')](respondWithResult(_0x1d74b7,null))[_0x7671('0x43')](handleError(_0x1d74b7,null));};exports['create']=function(_0x3406d3,_0x7accb7){return db[_0x7671('0x40')]['create'](_0x3406d3[_0x7671('0x48')],{})['then'](respondWithResult(_0x7accb7,0xc9))[_0x7671('0x43')](handleError(_0x7accb7,null));};exports[_0x7671('0x24')]=function(_0x4e1c75,_0x1d22e8){if(_0x4e1c75[_0x7671('0x48')]['id']){delete _0x4e1c75['body']['id'];}return db[_0x7671('0x40')][_0x7671('0x47')]({'where':{'id':_0x4e1c75[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x1d22e8,null))[_0x7671('0x25')](saveUpdates(_0x4e1c75[_0x7671('0x48')],null))[_0x7671('0x25')](respondWithResult(_0x1d22e8,null))[_0x7671('0x43')](handleError(_0x1d22e8,null));};exports[_0x7671('0x26')]=function(_0x12e7bf,_0x1c21e7){return db[_0x7671('0x40')][_0x7671('0x47')]({'where':{'id':_0x12e7bf[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x1c21e7,null))[_0x7671('0x25')](removeEntity(_0x1c21e7,null))[_0x7671('0x43')](handleError(_0x1c21e7,null));};exports[_0x7671('0x4a')]=function(_0x59424d,_0x1dbdf8){return db[_0x7671('0x40')]['describe']()[_0x7671('0x25')](respondWithResult(_0x1dbdf8,null))[_0x7671('0x43')](handleError(_0x1dbdf8,null));};exports[_0x7671('0x4b')]=function(_0x52afff,_0x4d2b4b,_0x508337){return db['ChatInternalMessage'][_0x7671('0x1d')]({'where':{'ChatGroupId':_0x52afff[_0x7671('0x49')]['id'],'ToId':_0x52afff['user']['id'],'read':![]}})[_0x7671('0x25')](function(_0x18084d){return{'id':_[_0x7671('0x4c')](_0x52afff[_0x7671('0x49')]['id']),'count':_0x18084d};})[_0x7671('0x25')](respondWithResult(_0x4d2b4b,null))[_0x7671('0x43')](handleError(_0x4d2b4b,null));};exports[_0x7671('0x4d')]=function(_0xb720cc,_0x2bfff2,_0x3f464e){return db[_0x7671('0x40')][_0x7671('0x47')]({'where':{'id':_0xb720cc['params']['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x2bfff2,null))[_0x7671('0x25')](function(_0x45a825){if(_0x45a825){return _0x45a825[_0x7671('0x4d')](_0xb720cc[_0x7671('0x48')][_0x7671('0x4e')],_['omit'](_0xb720cc['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2bfff2,null))[_0x7671('0x43')](handleError(_0x2bfff2,null));};exports[_0x7671('0x4f')]=function(_0x59bbdd,_0x901451,_0x28ef74){var _0x22ec0e={};var _0x1eb204={};var _0x5333e3;var _0xbf4d3d;return db[_0x7671('0x40')]['findOne']({'where':{'id':_0x59bbdd[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x901451,null))[_0x7671('0x25')](function(_0xc37a9f){if(_0xc37a9f){_0x5333e3=_0xc37a9f;_0x1eb204['model']=_[_0x7671('0x31')](db['User'][_0x7671('0x2b')]);_0x1eb204[_0x7671('0x30')]=_[_0x7671('0x31')](_0x59bbdd[_0x7671('0x30')]);_0x1eb204[_0x7671('0x32')]=_[_0x7671('0x34')](_0x1eb204[_0x7671('0x2f')],_0x1eb204[_0x7671('0x30')]);_0x22ec0e[_0x7671('0x33')]=_['intersection'](_0x1eb204['model'],qs[_0x7671('0x35')](_0x59bbdd[_0x7671('0x30')][_0x7671('0x35')]));_0x22ec0e[_0x7671('0x33')]=_0x22ec0e[_0x7671('0x33')][_0x7671('0x36')]?_0x22ec0e[_0x7671('0x33')]:_0x1eb204[_0x7671('0x2f')];_0x22ec0e[_0x7671('0x38')]=qs[_0x7671('0x39')](_0x59bbdd['query'][_0x7671('0x39')]);_0x22ec0e[_0x7671('0x3a')]=qs['filters'](_[_0x7671('0x3b')](_0x59bbdd[_0x7671('0x30')],_0x1eb204[_0x7671('0x32')]));if(_0x59bbdd[_0x7671('0x30')]['filter']){_0x22ec0e[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x22ec0e[_0x7671('0x3a')],{'$or':_[_0x7671('0x2a')](_0x22ec0e['attributes'],function(_0x5deb6b){var _0x21a82f={};_0x21a82f[_0x5deb6b]={'$like':'%'+_0x59bbdd[_0x7671('0x30')][_0x7671('0x3c')]+'%'};return _0x21a82f;})});}_0x22ec0e=_[_0x7671('0x3d')]({},_0x22ec0e,_0x59bbdd[_0x7671('0x3f')]);return _0x5333e3[_0x7671('0x4f')](_0x22ec0e);}})['then'](function(_0x5acba2){if(_0x5acba2){_0xbf4d3d=_0x5acba2[_0x7671('0x36')];if(!_0x59bbdd[_0x7671('0x30')][_0x7671('0x37')]('nolimit')){_0x22ec0e[_0x7671('0x1f')]=qs[_0x7671('0x1f')](_0x59bbdd[_0x7671('0x30')][_0x7671('0x1f')]);_0x22ec0e['offset']=qs['offset'](_0x59bbdd[_0x7671('0x30')]['offset']);}return _0x5333e3[_0x7671('0x4f')](_0x22ec0e);}})[_0x7671('0x25')](function(_0x5aa629){if(_0x5aa629){return _0x5aa629?{'count':_0xbf4d3d,'rows':_0x5aa629}:null;}})['then'](respondWithResult(_0x901451,null))[_0x7671('0x43')](handleError(_0x901451,null));};exports[_0x7671('0x50')]=function(_0x431fb5,_0x419907,_0x1bb8cd){return db['ChatGroup']['find']({'where':{'id':_0x431fb5['params']['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x419907,null))['then'](function(_0x483d69){if(_0x483d69){return _0x483d69['removeMembers'](_0x431fb5[_0x7671('0x30')][_0x7671('0x4e')]);}})[_0x7671('0x25')](respondWithStatusCode(_0x419907,null))[_0x7671('0x43')](handleError(_0x419907,null));};exports[_0x7671('0x51')]=function(_0x48e7c8,_0x395b35,_0x4be74b){if(_0x48e7c8[_0x7671('0x48')]['id']){delete _0x48e7c8[_0x7671('0x48')]['id'];}return db[_0x7671('0x40')]['find']({'where':{'id':_0x48e7c8['params']['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x395b35,null))['then'](function(_0x56a5a0){if(_0x56a5a0){_0x48e7c8[_0x7671('0x48')][_0x7671('0x52')]=_0x56a5a0['id'];return db[_0x7671('0x53')][_0x7671('0x54')](_0x48e7c8['body']);}})[_0x7671('0x25')](respondWithResult(_0x395b35,null))[_0x7671('0x43')](handleError(_0x395b35,null));};exports[_0x7671('0x55')]=function(_0x3a1c24,_0x3fc9da,_0x34199b){var _0x21b55d={};var _0x12dd15={};var _0x335559;var _0x4f7d7b;return db['ChatGroup'][_0x7671('0x56')]({'where':{'id':_0x3a1c24[_0x7671('0x49')]['id']}})[_0x7671('0x25')](handleEntityNotFound(_0x3fc9da,null))[_0x7671('0x25')](function(_0x326dc5){if(_0x326dc5){_0x335559=_0x326dc5;_0x12dd15['model']=_['keys'](db['ChatInternalMessage'][_0x7671('0x2b')]);_0x12dd15[_0x7671('0x30')]=_['keys'](_0x3a1c24[_0x7671('0x30')]);_0x12dd15[_0x7671('0x32')]=_[_0x7671('0x34')](_0x12dd15[_0x7671('0x2f')],_0x12dd15[_0x7671('0x30')]);_0x21b55d[_0x7671('0x33')]=_['intersection'](_0x12dd15['model'],qs[_0x7671('0x35')](_0x3a1c24[_0x7671('0x30')][_0x7671('0x35')]));_0x21b55d[_0x7671('0x33')]=_0x21b55d[_0x7671('0x33')]['length']?_0x21b55d['attributes']:_0x12dd15[_0x7671('0x2f')];_0x21b55d[_0x7671('0x38')]=qs[_0x7671('0x39')](_0x3a1c24['query'][_0x7671('0x39')]);_0x21b55d[_0x7671('0x3a')]=qs[_0x7671('0x32')](_[_0x7671('0x3b')](_0x3a1c24['query'],_0x12dd15[_0x7671('0x32')]));if(_0x3a1c24[_0x7671('0x30')][_0x7671('0x3c')]){_0x21b55d[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x21b55d[_0x7671('0x3a')],{'$or':_[_0x7671('0x2a')](_0x21b55d[_0x7671('0x33')],function(_0x41af64){var _0x8c70e6={};_0x8c70e6[_0x41af64]={'$like':'%'+_0x3a1c24[_0x7671('0x30')][_0x7671('0x3c')]+'%'};return _0x8c70e6;})});}if(_0x3a1c24[_0x7671('0x30')][_0x7671('0x57')]){var _0xa12a29=_0x3a1c24['query'][_0x7671('0x57')][_0x7671('0x58')](',');var _0x35d21a={};_0x35d21a[_0xa12a29[0x0]]={'$gte':moment(_0xa12a29[0x1])['format'](_0x7671('0x59'))};_0x21b55d[_0x7671('0x3a')]=_[_0x7671('0x3d')](_0x21b55d[_0x7671('0x3a')],_0x35d21a);}_0x21b55d=_['merge']({},_0x21b55d,_0x3a1c24[_0x7671('0x3f')]);return _0x335559[_0x7671('0x55')](_0x21b55d);}})['then'](function(_0xd27f4a){if(_0xd27f4a){_0x4f7d7b=_0xd27f4a[_0x7671('0x36')];if(!_0x3a1c24['query'][_0x7671('0x37')](_0x7671('0x5a'))){_0x21b55d[_0x7671('0x1f')]=qs[_0x7671('0x1f')](_0x3a1c24['query'][_0x7671('0x1f')]);_0x21b55d['offset']=qs['offset'](_0x3a1c24[_0x7671('0x30')]['offset']);}return _0x335559['getMessages'](_0x21b55d);}})[_0x7671('0x25')](function(_0x4569b0){if(_0x4569b0){return _0x4569b0?{'count':_0x4f7d7b,'rows':_0x4569b0}:null;}})['then'](respondWithResult(_0x3fc9da,null))[_0x7671('0x43')](handleError(_0x3fc9da,null));}; \ No newline at end of file +var _0xb8d4=['sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','ChatGroup','rawAttributes','type','key','model','map','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','intersection','includeAll','find','create','body','destroy','user','addMembers','ids','findOne','getMembers','removeMembers','addMessage','getMessages','ChatInternalMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x2f44be,_0x33a80d){var _0x5a6380=function(_0x5345fb){while(--_0x5345fb){_0x2f44be['push'](_0x2f44be['shift']());}};_0x5a6380(++_0x33a80d);}(_0xb8d4,0x1c4));var _0x4b8d=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb8d4[_0x13b8f3];return _0x1a6d06;};'use strict';var emlformat=require(_0x4b8d('0x0'));var rimraf=require(_0x4b8d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b8d('0x2'));var rp=require('request-promise');var moment=require(_0x4b8d('0x3'));var BPromise=require(_0x4b8d('0x4'));var Mustache=require(_0x4b8d('0x5'));var util=require(_0x4b8d('0x6'));var path=require(_0x4b8d('0x7'));var sox=require(_0x4b8d('0x8'));var csv=require(_0x4b8d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b8d('0xa'));var _=require(_0x4b8d('0xb'));var squel=require(_0x4b8d('0xc'));var crypto=require(_0x4b8d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4b8d('0x9'));var querystring=require('querystring');var Papa=require(_0x4b8d('0xe'));var Redis=require(_0x4b8d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4b8d('0x10'));var as=require(_0x4b8d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b8d('0x12'))(_0x4b8d('0x13'));var utils=require(_0x4b8d('0x14'));var config=require(_0x4b8d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b8d('0x16'))['db'];config[_0x4b8d('0x17')]=_[_0x4b8d('0x18')](config[_0x4b8d('0x17')],{'host':_0x4b8d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b8d('0x17')]));require(_0x4b8d('0x1a'))[_0x4b8d('0x1b')](socket);function respondWithStatusCode(_0x3e08cd,_0x471a07){_0x471a07=_0x471a07||0xcc;return function(_0x292c8a){if(_0x292c8a){return _0x3e08cd[_0x4b8d('0x1c')](_0x471a07);}return _0x3e08cd[_0x4b8d('0x1d')](_0x471a07)[_0x4b8d('0x1e')]();};}function respondWithResult(_0x20cdb8,_0x552438){_0x552438=_0x552438||0xc8;return function(_0x5b1989){if(_0x5b1989){return _0x20cdb8['status'](_0x552438)[_0x4b8d('0x1f')](_0x5b1989);}};}function respondWithFilteredResult(_0xc79903,_0x3200d9){return function(_0x10f5c0){if(_0x10f5c0){var _0x46a58d=typeof _0x3200d9[_0x4b8d('0x20')]===_0x4b8d('0x21')&&typeof _0x3200d9[_0x4b8d('0x22')]==='undefined';var _0x1c0fea=_0x10f5c0[_0x4b8d('0x23')];var _0x368bbb=_0x46a58d?0x0:_0x3200d9[_0x4b8d('0x20')];var _0x5e6160=_0x46a58d?_0x10f5c0[_0x4b8d('0x23')]:_0x3200d9['offset']+_0x3200d9[_0x4b8d('0x22')];var _0x112b1c;if(_0x5e6160>=_0x1c0fea){_0x5e6160=_0x1c0fea;_0x112b1c=0xc8;}else{_0x112b1c=0xce;}_0xc79903[_0x4b8d('0x1d')](_0x112b1c);return _0xc79903[_0x4b8d('0x24')](_0x4b8d('0x25'),_0x368bbb+'-'+_0x5e6160+'/'+_0x1c0fea)[_0x4b8d('0x1f')](_0x10f5c0);}return null;};}function patchUpdates(_0x2319c2){return function(_0x1a886a){try{jsonpatch[_0x4b8d('0x26')](_0x1a886a,_0x2319c2,!![]);}catch(_0x2a3783){return BPromise[_0x4b8d('0x27')](_0x2a3783);}return _0x1a886a[_0x4b8d('0x28')]();};}function saveUpdates(_0x2fb41d,_0x5d685b){return function(_0x5b2a2c){if(_0x5b2a2c){return _0x5b2a2c[_0x4b8d('0x29')](_0x2fb41d)['then'](function(_0x5b5020){return _0x5b5020;});}return null;};}function removeEntity(_0x1a8934,_0x407790){return function(_0x6fe6a0){if(_0x6fe6a0){return _0x6fe6a0['destroy']()[_0x4b8d('0x2a')](function(){_0x1a8934[_0x4b8d('0x1d')](0xcc)[_0x4b8d('0x1e')]();});}};}function handleEntityNotFound(_0xca5f15,_0x57935a){return function(_0x476c0c){if(!_0x476c0c){_0xca5f15[_0x4b8d('0x1c')](0x194);}return _0x476c0c;};}function handleError(_0x4027d5,_0x16014d){_0x16014d=_0x16014d||0x1f4;return function(_0x414478){logger[_0x4b8d('0x2b')](_0x414478['stack']);if(_0x414478['name']){delete _0x414478[_0x4b8d('0x2c')];}_0x4027d5[_0x4b8d('0x1d')](_0x16014d)[_0x4b8d('0x2d')](_0x414478);};}exports[_0x4b8d('0x2e')]=function(_0x18e205,_0x1603d8){var _0x20276f={},_0x3591e8={},_0x29814f={'count':0x0,'rows':[]};var _0xac6599=_['map'](db[_0x4b8d('0x2f')][_0x4b8d('0x30')],function(_0x4ebcc8){return{'name':_0x4ebcc8['fieldName'],'type':_0x4ebcc8[_0x4b8d('0x31')][_0x4b8d('0x32')]};});_0x3591e8[_0x4b8d('0x33')]=_[_0x4b8d('0x34')](_0xac6599,_0x4b8d('0x2c'));_0x3591e8[_0x4b8d('0x35')]=_[_0x4b8d('0x36')](_0x18e205[_0x4b8d('0x35')]);_0x3591e8[_0x4b8d('0x37')]=_['intersection'](_0x3591e8[_0x4b8d('0x33')],_0x3591e8[_0x4b8d('0x35')]);_0x20276f['attributes']=_['intersection'](_0x3591e8[_0x4b8d('0x33')],qs[_0x4b8d('0x38')](_0x18e205['query'][_0x4b8d('0x38')]));_0x20276f[_0x4b8d('0x39')]=_0x20276f[_0x4b8d('0x39')][_0x4b8d('0x3a')]?_0x20276f['attributes']:_0x3591e8[_0x4b8d('0x33')];if(!_0x18e205[_0x4b8d('0x35')][_0x4b8d('0x3b')]('nolimit')){_0x20276f[_0x4b8d('0x22')]=qs[_0x4b8d('0x22')](_0x18e205[_0x4b8d('0x35')]['limit']);_0x20276f[_0x4b8d('0x20')]=qs['offset'](_0x18e205[_0x4b8d('0x35')]['offset']);}_0x20276f[_0x4b8d('0x3c')]=qs[_0x4b8d('0x3d')](_0x18e205[_0x4b8d('0x35')]['sort']);_0x20276f[_0x4b8d('0x3e')]=qs[_0x4b8d('0x37')](_[_0x4b8d('0x3f')](_0x18e205['query'],_0x3591e8[_0x4b8d('0x37')]),_0xac6599);if(_0x18e205[_0x4b8d('0x35')][_0x4b8d('0x40')]){_0x20276f[_0x4b8d('0x3e')]=_[_0x4b8d('0x41')](_0x20276f[_0x4b8d('0x3e')],{'$or':_['map'](_0xac6599,function(_0x5ef48d){if(_0x5ef48d['type']!==_0x4b8d('0x42')){var _0x316197={};_0x316197[_0x5ef48d[_0x4b8d('0x2c')]]={'$like':'%'+_0x18e205[_0x4b8d('0x35')][_0x4b8d('0x40')]+'%'};return _0x316197;}})});}_0x20276f=_[_0x4b8d('0x41')]({},_0x20276f,_0x18e205[_0x4b8d('0x43')]);var _0x251c3b={'where':_0x20276f[_0x4b8d('0x3e')]};return db['ChatGroup']['count'](_0x251c3b)['then'](function(_0xb62291){_0x29814f[_0x4b8d('0x23')]=_0xb62291;if(_0x18e205[_0x4b8d('0x35')]['includeAll']){_0x20276f[_0x4b8d('0x44')]=[{'all':!![]}];}return db[_0x4b8d('0x2f')]['findAll'](_0x20276f);})[_0x4b8d('0x2a')](function(_0x8aa7c8){_0x29814f[_0x4b8d('0x45')]=_0x8aa7c8;return _0x29814f;})[_0x4b8d('0x2a')](respondWithFilteredResult(_0x1603d8,_0x20276f))[_0x4b8d('0x46')](handleError(_0x1603d8,null));};exports[_0x4b8d('0x47')]=function(_0x35e070,_0x14b763){var _0x5418c0={'raw':!![],'where':{'id':_0x35e070[_0x4b8d('0x48')]['id']}},_0x3dd87b={};_0x3dd87b['model']=_[_0x4b8d('0x36')](db[_0x4b8d('0x2f')]['rawAttributes']);_0x3dd87b[_0x4b8d('0x35')]=_[_0x4b8d('0x36')](_0x35e070['query']);_0x3dd87b[_0x4b8d('0x37')]=_['intersection'](_0x3dd87b[_0x4b8d('0x33')],_0x3dd87b['query']);_0x5418c0[_0x4b8d('0x39')]=_[_0x4b8d('0x49')](_0x3dd87b[_0x4b8d('0x33')],qs['fields'](_0x35e070['query'][_0x4b8d('0x38')]));_0x5418c0[_0x4b8d('0x39')]=_0x5418c0[_0x4b8d('0x39')][_0x4b8d('0x3a')]?_0x5418c0[_0x4b8d('0x39')]:_0x3dd87b[_0x4b8d('0x33')];if(_0x35e070['query'][_0x4b8d('0x4a')]){_0x5418c0[_0x4b8d('0x44')]=[{'all':!![]}];}_0x5418c0=_[_0x4b8d('0x41')]({},_0x5418c0,_0x35e070[_0x4b8d('0x43')]);return db['ChatGroup'][_0x4b8d('0x4b')](_0x5418c0)[_0x4b8d('0x2a')](handleEntityNotFound(_0x14b763,null))[_0x4b8d('0x2a')](respondWithResult(_0x14b763,null))['catch'](handleError(_0x14b763,null));};exports[_0x4b8d('0x4c')]=function(_0x3edb83,_0x51efc4){return db[_0x4b8d('0x2f')][_0x4b8d('0x4c')](_0x3edb83[_0x4b8d('0x4d')],{})[_0x4b8d('0x2a')](respondWithResult(_0x51efc4,0xc9))[_0x4b8d('0x46')](handleError(_0x51efc4,null));};exports[_0x4b8d('0x29')]=function(_0x121b21,_0x8b3949){if(_0x121b21['body']['id']){delete _0x121b21[_0x4b8d('0x4d')]['id'];}return db[_0x4b8d('0x2f')][_0x4b8d('0x4b')]({'where':{'id':_0x121b21['params']['id']}})[_0x4b8d('0x2a')](handleEntityNotFound(_0x8b3949,null))['then'](saveUpdates(_0x121b21[_0x4b8d('0x4d')],null))[_0x4b8d('0x2a')](respondWithResult(_0x8b3949,null))['catch'](handleError(_0x8b3949,null));};exports[_0x4b8d('0x4e')]=function(_0x1b1695,_0x276789){return db[_0x4b8d('0x2f')][_0x4b8d('0x4b')]({'where':{'id':_0x1b1695[_0x4b8d('0x48')]['id']}})['then'](handleEntityNotFound(_0x276789,null))['then'](removeEntity(_0x276789,null))['catch'](handleError(_0x276789,null));};exports['describe']=function(_0x98fd19,_0x2cb873){return db[_0x4b8d('0x2f')]['describe']()[_0x4b8d('0x2a')](respondWithResult(_0x2cb873,null))['catch'](handleError(_0x2cb873,null));};exports['getUnread']=function(_0x5de4de,_0xb0ddf5,_0x3d40ce){return db['ChatInternalMessage'][_0x4b8d('0x23')]({'where':{'ChatGroupId':_0x5de4de['params']['id'],'ToId':_0x5de4de[_0x4b8d('0x4f')]['id'],'read':![]}})['then'](function(_0x2c235e){return{'id':_['toInteger'](_0x5de4de['params']['id']),'count':_0x2c235e};})['then'](respondWithResult(_0xb0ddf5,null))[_0x4b8d('0x46')](handleError(_0xb0ddf5,null));};exports[_0x4b8d('0x50')]=function(_0x598611,_0x4ecde8,_0x422359){return db[_0x4b8d('0x2f')][_0x4b8d('0x4b')]({'where':{'id':_0x598611[_0x4b8d('0x48')]['id']}})[_0x4b8d('0x2a')](handleEntityNotFound(_0x4ecde8,null))[_0x4b8d('0x2a')](function(_0x44c573){if(_0x44c573){return _0x44c573[_0x4b8d('0x50')](_0x598611[_0x4b8d('0x4d')][_0x4b8d('0x51')],_['omit'](_0x598611[_0x4b8d('0x4d')],[_0x4b8d('0x51'),'id'])||{});}})[_0x4b8d('0x2a')](respondWithResult(_0x4ecde8,null))[_0x4b8d('0x46')](handleError(_0x4ecde8,null));};exports['getMembers']=function(_0x5525e2,_0x49a081,_0xb2b8bb){var _0x5bffc5={};var _0x5f508e={};var _0x277cfa;var _0xeec065;return db[_0x4b8d('0x2f')][_0x4b8d('0x52')]({'where':{'id':_0x5525e2['params']['id']}})['then'](handleEntityNotFound(_0x49a081,null))[_0x4b8d('0x2a')](function(_0x292045){if(_0x292045){_0x277cfa=_0x292045;_0x5f508e[_0x4b8d('0x33')]=_[_0x4b8d('0x36')](db['User']['rawAttributes']);_0x5f508e[_0x4b8d('0x35')]=_['keys'](_0x5525e2[_0x4b8d('0x35')]);_0x5f508e[_0x4b8d('0x37')]=_[_0x4b8d('0x49')](_0x5f508e[_0x4b8d('0x33')],_0x5f508e[_0x4b8d('0x35')]);_0x5bffc5['attributes']=_[_0x4b8d('0x49')](_0x5f508e[_0x4b8d('0x33')],qs[_0x4b8d('0x38')](_0x5525e2['query'][_0x4b8d('0x38')]));_0x5bffc5['attributes']=_0x5bffc5['attributes']['length']?_0x5bffc5['attributes']:_0x5f508e[_0x4b8d('0x33')];_0x5bffc5['order']=qs[_0x4b8d('0x3d')](_0x5525e2['query'][_0x4b8d('0x3d')]);_0x5bffc5[_0x4b8d('0x3e')]=qs[_0x4b8d('0x37')](_[_0x4b8d('0x3f')](_0x5525e2['query'],_0x5f508e[_0x4b8d('0x37')]));if(_0x5525e2[_0x4b8d('0x35')][_0x4b8d('0x40')]){_0x5bffc5[_0x4b8d('0x3e')]=_[_0x4b8d('0x41')](_0x5bffc5['where'],{'$or':_[_0x4b8d('0x34')](_0x5bffc5[_0x4b8d('0x39')],function(_0x320a8e){var _0x281d53={};_0x281d53[_0x320a8e]={'$like':'%'+_0x5525e2[_0x4b8d('0x35')][_0x4b8d('0x40')]+'%'};return _0x281d53;})});}_0x5bffc5=_[_0x4b8d('0x41')]({},_0x5bffc5,_0x5525e2[_0x4b8d('0x43')]);return _0x277cfa[_0x4b8d('0x53')](_0x5bffc5);}})['then'](function(_0x1d6fe8){if(_0x1d6fe8){_0xeec065=_0x1d6fe8[_0x4b8d('0x3a')];if(!_0x5525e2[_0x4b8d('0x35')][_0x4b8d('0x3b')]('nolimit')){_0x5bffc5['limit']=qs[_0x4b8d('0x22')](_0x5525e2[_0x4b8d('0x35')][_0x4b8d('0x22')]);_0x5bffc5['offset']=qs[_0x4b8d('0x20')](_0x5525e2['query'][_0x4b8d('0x20')]);}return _0x277cfa[_0x4b8d('0x53')](_0x5bffc5);}})[_0x4b8d('0x2a')](function(_0x26956b){if(_0x26956b){return _0x26956b?{'count':_0xeec065,'rows':_0x26956b}:null;}})[_0x4b8d('0x2a')](respondWithResult(_0x49a081,null))['catch'](handleError(_0x49a081,null));};exports['removeMembers']=function(_0x1520a5,_0x1aad4f,_0x1ff368){return db['ChatGroup'][_0x4b8d('0x4b')]({'where':{'id':_0x1520a5[_0x4b8d('0x48')]['id']}})[_0x4b8d('0x2a')](handleEntityNotFound(_0x1aad4f,null))[_0x4b8d('0x2a')](function(_0x40bde3){if(_0x40bde3){return _0x40bde3[_0x4b8d('0x54')](_0x1520a5[_0x4b8d('0x35')][_0x4b8d('0x51')]);}})['then'](respondWithStatusCode(_0x1aad4f,null))['catch'](handleError(_0x1aad4f,null));};exports[_0x4b8d('0x55')]=function(_0x2a0f4b,_0x484e11,_0x1a06fd){if(_0x2a0f4b[_0x4b8d('0x4d')]['id']){delete _0x2a0f4b['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x2a0f4b[_0x4b8d('0x48')]['id']}})[_0x4b8d('0x2a')](handleEntityNotFound(_0x484e11,null))[_0x4b8d('0x2a')](function(_0x309bff){if(_0x309bff){_0x2a0f4b[_0x4b8d('0x4d')]['ChatGroupId']=_0x309bff['id'];return db['ChatInternalMessage'][_0x4b8d('0x4c')](_0x2a0f4b[_0x4b8d('0x4d')]);}})[_0x4b8d('0x2a')](respondWithResult(_0x484e11,null))['catch'](handleError(_0x484e11,null));};exports[_0x4b8d('0x56')]=function(_0x5c9169,_0x5d1a4a,_0xd7351){var _0x4db391={};var _0x20f598={};var _0x29e837;var _0x51ff10;return db['ChatGroup'][_0x4b8d('0x52')]({'where':{'id':_0x5c9169[_0x4b8d('0x48')]['id']}})[_0x4b8d('0x2a')](handleEntityNotFound(_0x5d1a4a,null))[_0x4b8d('0x2a')](function(_0x3f1bbc){if(_0x3f1bbc){_0x29e837=_0x3f1bbc;_0x20f598['model']=_[_0x4b8d('0x36')](db[_0x4b8d('0x57')][_0x4b8d('0x30')]);_0x20f598['query']=_[_0x4b8d('0x36')](_0x5c9169[_0x4b8d('0x35')]);_0x20f598['filters']=_[_0x4b8d('0x49')](_0x20f598[_0x4b8d('0x33')],_0x20f598[_0x4b8d('0x35')]);_0x4db391[_0x4b8d('0x39')]=_[_0x4b8d('0x49')](_0x20f598['model'],qs[_0x4b8d('0x38')](_0x5c9169['query'][_0x4b8d('0x38')]));_0x4db391[_0x4b8d('0x39')]=_0x4db391[_0x4b8d('0x39')][_0x4b8d('0x3a')]?_0x4db391[_0x4b8d('0x39')]:_0x20f598[_0x4b8d('0x33')];_0x4db391['order']=qs[_0x4b8d('0x3d')](_0x5c9169[_0x4b8d('0x35')]['sort']);_0x4db391[_0x4b8d('0x3e')]=qs[_0x4b8d('0x37')](_[_0x4b8d('0x3f')](_0x5c9169[_0x4b8d('0x35')],_0x20f598[_0x4b8d('0x37')]));if(_0x5c9169[_0x4b8d('0x35')][_0x4b8d('0x40')]){_0x4db391['where']=_['merge'](_0x4db391[_0x4b8d('0x3e')],{'$or':_[_0x4b8d('0x34')](_0x4db391['attributes'],function(_0x1e99f6){var _0xffce82={};_0xffce82[_0x1e99f6]={'$like':'%'+_0x5c9169[_0x4b8d('0x35')][_0x4b8d('0x40')]+'%'};return _0xffce82;})});}if(_0x5c9169[_0x4b8d('0x35')][_0x4b8d('0x58')]){var _0x595ebc=_0x5c9169[_0x4b8d('0x35')][_0x4b8d('0x58')][_0x4b8d('0x59')](',');var _0x313420={};_0x313420[_0x595ebc[0x0]]={'$gte':moment(_0x595ebc[0x1])[_0x4b8d('0x5a')](_0x4b8d('0x5b'))};_0x4db391['where']=_[_0x4b8d('0x41')](_0x4db391['where'],_0x313420);}_0x4db391=_[_0x4b8d('0x41')]({},_0x4db391,_0x5c9169[_0x4b8d('0x43')]);return _0x29e837[_0x4b8d('0x56')](_0x4db391);}})['then'](function(_0x4a33c0){if(_0x4a33c0){_0x51ff10=_0x4a33c0[_0x4b8d('0x3a')];if(!_0x5c9169[_0x4b8d('0x35')][_0x4b8d('0x3b')]('nolimit')){_0x4db391[_0x4b8d('0x22')]=qs[_0x4b8d('0x22')](_0x5c9169['query'][_0x4b8d('0x22')]);_0x4db391[_0x4b8d('0x20')]=qs[_0x4b8d('0x20')](_0x5c9169[_0x4b8d('0x35')][_0x4b8d('0x20')]);}return _0x29e837[_0x4b8d('0x56')](_0x4db391);}})[_0x4b8d('0x2a')](function(_0x31489c){if(_0x31489c){return _0x31489c?{'count':_0x51ff10,'rows':_0x31489c}:null;}})[_0x4b8d('0x2a')](respondWithResult(_0x5d1a4a,null))[_0x4b8d('0x46')](handleError(_0x5d1a4a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f90ec39..6f33fba 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 _0x7e14=['hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2fda1b,_0x401dfe){var _0x5d4369=function(_0x549b58){while(--_0x549b58){_0x2fda1b['push'](_0x2fda1b['shift']());}};_0x5d4369(++_0x401dfe);}(_0x7e14,0x174));var _0x47e1=function(_0x1292a4,_0x365ab4){_0x1292a4=_0x1292a4-0x0;var _0x315df7=_0x7e14[_0x1292a4];return _0x315df7;};'use strict';var EventEmitter=require(_0x47e1('0x0'));var ChatGroup=require(_0x47e1('0x1'))['db'][_0x47e1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x47e1('0x3')](0x0);var events={'afterCreate':_0x47e1('0x4'),'afterUpdate':'update','afterDestroy':_0x47e1('0x5')};function emitEvent(_0x31ea5e){return function(_0x3ae82d,_0x194179,_0x5d2178){ChatGroupEvents['emit'](_0x31ea5e+':'+_0x3ae82d['id'],_0x3ae82d);ChatGroupEvents[_0x47e1('0x6')](_0x31ea5e,_0x3ae82d);_0x5d2178(null);};}for(var e in events){if(events[_0x47e1('0x7')](e)){var event=events[e];ChatGroup[_0x47e1('0x8')](e,emitEvent(event));}}module[_0x47e1('0x9')]=ChatGroupEvents; \ No newline at end of file +var _0x4024=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0xb0b01c,_0x466220){var _0x353d13=function(_0x370c30){while(--_0x370c30){_0xb0b01c['push'](_0xb0b01c['shift']());}};_0x353d13(++_0x466220);}(_0x4024,0x152));var _0x4402=function(_0x307f25,_0x77eb4){_0x307f25=_0x307f25-0x0;var _0x5e3d7f=_0x4024[_0x307f25];return _0x5e3d7f;};'use strict';var EventEmitter=require(_0x4402('0x0'));var ChatGroup=require(_0x4402('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4402('0x2')](0x0);var events={'afterCreate':_0x4402('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe9d839){return function(_0x29d395,_0xbb69c9,_0x2e157e){ChatGroupEvents['emit'](_0xe9d839+':'+_0x29d395['id'],_0x29d395);ChatGroupEvents[_0x4402('0x4')](_0xe9d839,_0x29d395);_0x2e157e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x4402('0x5')](e,emitEvent(event));}}module[_0x4402('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 9b59766..b4e8c24 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 _0x1d36=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','chat_groups','lodash','util'];(function(_0xd2f4f5,_0x341930){var _0x41fc10=function(_0x496824){while(--_0x496824){_0xd2f4f5['push'](_0xd2f4f5['shift']());}};_0x41fc10(++_0x341930);}(_0x1d36,0xfb));var _0x61d3=function(_0xa88306,_0x26272f){_0xa88306=_0xa88306-0x0;var _0x269ec3=_0x1d36[_0xa88306];return _0x269ec3;};'use strict';var _=require(_0x61d3('0x0'));var util=require(_0x61d3('0x1'));var logger=require(_0x61d3('0x2'))('api');var moment=require(_0x61d3('0x3'));var BPromise=require(_0x61d3('0x4'));var rp=require(_0x61d3('0x5'));var fs=require('fs');var path=require(_0x61d3('0x6'));var rimraf=require(_0x61d3('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0x61d3('0x8')]=function(_0x23d9ec,_0x329abb){return _0x23d9ec[_0x61d3('0x9')]('ChatGroup',attributes,{'tableName':_0x61d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dca=['ChatGroup','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0x2dca,0x160));var _0xa2dc=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0x2dca[_0x485abd];return _0x3379f1;};'use strict';var _=require(_0xa2dc('0x0'));var util=require(_0xa2dc('0x1'));var logger=require(_0xa2dc('0x2'))(_0xa2dc('0x3'));var moment=require(_0xa2dc('0x4'));var BPromise=require(_0xa2dc('0x5'));var rp=require(_0xa2dc('0x6'));var fs=require('fs');var path=require(_0xa2dc('0x7'));var rimraf=require(_0xa2dc('0x8'));var config=require(_0xa2dc('0x9'));var attributes=require(_0xa2dc('0xa'));module['exports']=function(_0x2f92fb,_0x2401dd){return _0x2f92fb[_0xa2dc('0xb')](_0xa2dc('0xc'),attributes,{'tableName':'chat_groups','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 2cc6a67..d4d1298 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 _0x3f2b=['localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2409f0,_0x2bd311){var _0x5ca407=function(_0x421d8d){while(--_0x421d8d){_0x2409f0['push'](_0x2409f0['shift']());}};_0x5ca407(++_0x2bd311);}(_0x3f2b,0x72));var _0xb3f2=function(_0x21eb63,_0x23e7d1){_0x21eb63=_0x21eb63-0x0;var _0x5183ae=_0x3f2b[_0x21eb63];return _0x5183ae;};'use strict';var _=require(_0xb3f2('0x0'));var util=require('util');var moment=require(_0xb3f2('0x1'));var BPromise=require(_0xb3f2('0x2'));var rs=require(_0xb3f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3f2('0x4'))['db'];var utils=require(_0xb3f2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb3f2('0x6'));var jayson=require(_0xb3f2('0x7'));var client=jayson[_0xb3f2('0x8')][_0xb3f2('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb3f2('0xa')],{'host':_0xb3f2('0xb'),'port':0x18eb});var socket=require(_0xb3f2('0xc'))(new Redis(config[_0xb3f2('0xa')]));require(_0xb3f2('0xd'))[_0xb3f2('0xe')](socket);function respondWithRpcPromise(_0x415fd9,_0x314877,_0x94fada){return new BPromise(function(_0xf9b4be,_0x185c58){return client[_0xb3f2('0xf')](_0x415fd9,_0x94fada)[_0xb3f2('0x10')](function(_0xaf3b86){logger[_0xb3f2('0x11')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0xb3f2('0x12'));logger['debug'](_0xb3f2('0x13'),_0x314877,_0xb3f2('0x12'),JSON['stringify'](_0xaf3b86));if(_0xaf3b86[_0xb3f2('0x14')]){if(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x15')]===0x1f4){logger['error'](_0xb3f2('0x16'),_0x314877,_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);return _0x185c58(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}logger[_0xb3f2('0x14')](_0xb3f2('0x16'),_0x314877,_0xaf3b86['error'][_0xb3f2('0x17')]);return _0xf9b4be(_0xaf3b86[_0xb3f2('0x14')][_0xb3f2('0x17')]);}else{logger[_0xb3f2('0x11')](_0xb3f2('0x16'),_0x314877,_0xb3f2('0x12'));_0xf9b4be(_0xaf3b86['result']['message']);}})[_0xb3f2('0x18')](function(_0x3a861a){logger[_0xb3f2('0x14')]('ChatGroup,\x20%s,\x20%s',_0x314877,_0x3a861a);_0x185c58(_0x3a861a);});});} \ No newline at end of file +var _0xcb3c=['register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xcb3c,0x150));var _0xccb3=function(_0x1c6a3e,_0x5c3938){_0x1c6a3e=_0x1c6a3e-0x0;var _0x3637da=_0xcb3c[_0x1c6a3e];return _0x3637da;};'use strict';var _=require(_0xccb3('0x0'));var util=require(_0xccb3('0x1'));var moment=require(_0xccb3('0x2'));var BPromise=require(_0xccb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccb3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xccb3('0x5'));var logger=require('../../config/logger')(_0xccb3('0x6'));var config=require(_0xccb3('0x7'));var jayson=require(_0xccb3('0x8'));var client=jayson[_0xccb3('0x9')][_0xccb3('0xa')]({'port':0x232a});config[_0xccb3('0xb')]=_[_0xccb3('0xc')](config[_0xccb3('0xb')],{'host':_0xccb3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xccb3('0xe')](socket);function respondWithRpcPromise(_0x49298f,_0x451c06,_0x1daeb9){return new BPromise(function(_0x3c4eb2,_0x57318c){return client['request'](_0x49298f,_0x1daeb9)[_0xccb3('0xf')](function(_0x7ba79f){logger[_0xccb3('0x10')](_0xccb3('0x11'),_0x451c06,_0xccb3('0x12'));logger[_0xccb3('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x451c06,_0xccb3('0x12'),JSON[_0xccb3('0x14')](_0x7ba79f));if(_0x7ba79f[_0xccb3('0x15')]){if(_0x7ba79f[_0xccb3('0x15')][_0xccb3('0x16')]===0x1f4){logger[_0xccb3('0x15')](_0xccb3('0x11'),_0x451c06,_0x7ba79f['error'][_0xccb3('0x17')]);return _0x57318c(_0x7ba79f[_0xccb3('0x15')]['message']);}logger[_0xccb3('0x15')]('ChatGroup,\x20%s,\x20%s',_0x451c06,_0x7ba79f['error'][_0xccb3('0x17')]);return _0x3c4eb2(_0x7ba79f[_0xccb3('0x15')][_0xccb3('0x17')]);}else{logger[_0xccb3('0x10')](_0xccb3('0x11'),_0x451c06,_0xccb3('0x12'));_0x3c4eb2(_0x7ba79f[_0xccb3('0x18')][_0xccb3('0x17')]);}})['catch'](function(_0x47b074){logger[_0xccb3('0x15')]('ChatGroup,\x20%s,\x20%s',_0x451c06,_0x47b074);_0x57318c(_0x47b074);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 4e6e254..ceb033d 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 _0xfe6a=['remove','update','emit','removeListener','chatGroup:','save'];(function(_0x2928cc,_0x20ed48){var _0x526b37=function(_0x12c57d){while(--_0x12c57d){_0x2928cc['push'](_0x2928cc['shift']());}};_0x526b37(++_0x20ed48);}(_0xfe6a,0x1e5));var _0xafe6=function(_0xce3815,_0x10ceb9){_0xce3815=_0xce3815-0x0;var _0x865d2f=_0xfe6a[_0xce3815];return _0x865d2f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xafe6('0x0'),_0xafe6('0x1'),_0xafe6('0x2')];function createListener(_0xf02d38,_0x3bc59a){return function(_0x3c3d45){_0x3bc59a[_0xafe6('0x3')](_0xf02d38,_0x3c3d45);};}function removeListener(_0x3a6930,_0x58a060){return function(){ChatGroupEvents[_0xafe6('0x4')](_0x3a6930,_0x58a060);};}exports['register']=function(_0x538a96){for(var _0x4b94fe=0x0,_0x59ad46=events['length'];_0x4b94fe<_0x59ad46;_0x4b94fe++){var _0x4d10a6=events[_0x4b94fe];var _0x24362d=createListener(_0xafe6('0x5')+_0x4d10a6,_0x538a96);ChatGroupEvents['on'](_0x4d10a6,_0x24362d);}}; \ No newline at end of file +var _0x662a=['length','chatGroup:','./chatGroup.events','save','remove','removeListener','register'];(function(_0x3c3249,_0x3fe770){var _0x41931d=function(_0x12b918){while(--_0x12b918){_0x3c3249['push'](_0x3c3249['shift']());}};_0x41931d(++_0x3fe770);}(_0x662a,0x1ad));var _0xa662=function(_0x4ece73,_0xc929c4){_0x4ece73=_0x4ece73-0x0;var _0x34e1d9=_0x662a[_0x4ece73];return _0x34e1d9;};'use strict';var ChatGroupEvents=require(_0xa662('0x0'));var events=[_0xa662('0x1'),_0xa662('0x2'),'update'];function createListener(_0x49ea56,_0x41d1b8){return function(_0x58da94){_0x41d1b8['emit'](_0x49ea56,_0x58da94);};}function removeListener(_0x12be5c,_0x477fec){return function(){ChatGroupEvents[_0xa662('0x3')](_0x12be5c,_0x477fec);};}exports[_0xa662('0x4')]=function(_0x48d3ce){for(var _0x39c64f=0x0,_0x35e4cc=events[_0xa662('0x5')];_0x39c64f<_0x35e4cc;_0x39c64f++){var _0x57db2b=events[_0x39c64f];var _0x275182=createListener(_0xa662('0x6')+_0x57db2b,_0x48d3ce);ChatGroupEvents['on'](_0x57db2b,_0x275182);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 47a67e3..0051005 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 _0x1c3a=['/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','addMembers','addMessage','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe'];(function(_0xa43ede,_0x518b08){var _0x5ae2f5=function(_0x3e31e5){while(--_0x3e31e5){_0xa43ede['push'](_0xa43ede['shift']());}};_0x5ae2f5(++_0x518b08);}(_0x1c3a,0x84));var _0xa1c3=function(_0x463934,_0x1e38ec){_0x463934=_0x463934-0x0;var _0x44c1a2=_0x1c3a[_0x463934];return _0x44c1a2;};'use strict';var multer=require(_0xa1c3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa1c3('0x1'));var express=require(_0xa1c3('0x2'));var router=express[_0xa1c3('0x3')]();var fs_extra=require(_0xa1c3('0x4'));var auth=require(_0xa1c3('0x5'));var interaction=require(_0xa1c3('0x6'));var config=require(_0xa1c3('0x7'));var controller=require(_0xa1c3('0x8'));router['get']('/',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0xa')]);router[_0xa1c3('0xb')]('/describe',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0xc')]);router[_0xa1c3('0xb')](_0xa1c3('0xd'),auth['isAuthenticated'](),controller[_0xa1c3('0xe')]);router[_0xa1c3('0xb')](_0xa1c3('0xf'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x10')]);router['get'](_0xa1c3('0x11'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x12')]);router[_0xa1c3('0xb')](_0xa1c3('0x13'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x14')]);router['post']('/',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x15')]);router['post'](_0xa1c3('0x11'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x16')]);router['post'](_0xa1c3('0x13'),auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x17')]);router['put'](_0xa1c3('0xd'),auth['isAuthenticated'](),controller[_0xa1c3('0x18')]);router[_0xa1c3('0x19')](_0xa1c3('0xd'),auth['isAuthenticated'](),controller[_0xa1c3('0x1a')]);router[_0xa1c3('0x19')]('/:id/members',auth[_0xa1c3('0x9')](),controller[_0xa1c3('0x1b')]);module[_0xa1c3('0x1c')]=router; \ No newline at end of file +var _0x8f9a=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','getMembers','create','post','/:id/members','addMembers','/:id/messages','addMessage','update','delete','destroy'];(function(_0x419d3b,_0x194567){var _0x3e50e0=function(_0x3d586c){while(--_0x3d586c){_0x419d3b['push'](_0x419d3b['shift']());}};_0x3e50e0(++_0x194567);}(_0x8f9a,0x12a));var _0xa8f9=function(_0x409186,_0x4b8b73){_0x409186=_0x409186-0x0;var _0x3deb43=_0x8f9a[_0x409186];return _0x3deb43;};'use strict';var multer=require(_0xa8f9('0x0'));var util=require('util');var path=require(_0xa8f9('0x1'));var timeout=require(_0xa8f9('0x2'));var express=require(_0xa8f9('0x3'));var router=express[_0xa8f9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa8f9('0x5'));var config=require(_0xa8f9('0x6'));var controller=require(_0xa8f9('0x7'));router[_0xa8f9('0x8')]('/',auth[_0xa8f9('0x9')](),controller[_0xa8f9('0xa')]);router[_0xa8f9('0x8')](_0xa8f9('0xb'),auth['isAuthenticated'](),controller[_0xa8f9('0xc')]);router[_0xa8f9('0x8')](_0xa8f9('0xd'),auth[_0xa8f9('0x9')](),controller[_0xa8f9('0xe')]);router['get']('/:id/unread',auth[_0xa8f9('0x9')](),controller[_0xa8f9('0xf')]);router[_0xa8f9('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xa8f9('0x10')]);router[_0xa8f9('0x8')]('/:id/messages',auth[_0xa8f9('0x9')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xa8f9('0x11')]);router[_0xa8f9('0x12')](_0xa8f9('0x13'),auth['isAuthenticated'](),controller[_0xa8f9('0x14')]);router[_0xa8f9('0x12')](_0xa8f9('0x15'),auth[_0xa8f9('0x9')](),controller[_0xa8f9('0x16')]);router['put']('/:id',auth[_0xa8f9('0x9')](),controller[_0xa8f9('0x17')]);router[_0xa8f9('0x18')](_0xa8f9('0xd'),auth[_0xa8f9('0x9')](),controller[_0xa8f9('0x19')]);router[_0xa8f9('0x18')](_0xa8f9('0x13'),auth[_0xa8f9('0x9')](),controller['removeMembers']);module[_0xa8f9('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 325516b..38cf927 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 _0x420e=['TEXT','STRING','DATE','long','INTEGER','sequelize','BOOLEAN','ENUM','star','thumb'];(function(_0x1d6eb4,_0x2a20d7){var _0x1277f0=function(_0x38477d){while(--_0x38477d){_0x1d6eb4['push'](_0x1d6eb4['shift']());}};_0x1277f0(++_0x2a20d7);}(_0x420e,0xcd));var _0xe420=function(_0x1d00ca,_0x1de96a){_0x1d00ca=_0x1d00ca-0x0;var _0x597916=_0x420e[_0x1d00ca];return _0x597916;};'use strict';var Sequelize=require(_0xe420('0x0'));module['exports']={'closed':{'type':Sequelize[_0xe420('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xe420('0x2')](_0xe420('0x3'),_0xe420('0x4')),'defaultValue':_0xe420('0x3')},'ratingMessage':{'type':Sequelize[_0xe420('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xe420('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe420('0x7')]},'disposition':{'type':Sequelize[_0xe420('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xe420('0x6')]},'browserName':{'type':Sequelize[_0xe420('0x6')]},'browserVersion':{'type':Sequelize[_0xe420('0x6')]},'osName':{'type':Sequelize[_0xe420('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xe420('0x6')]},'deviceVendor':{'type':Sequelize[_0xe420('0x6')]},'deviceType':{'type':Sequelize[_0xe420('0x6')]},'referer':{'type':Sequelize[_0xe420('0x5')]},'customerIp':{'type':Sequelize[_0xe420('0x6')]},'formData':{'type':Sequelize[_0xe420('0x5')](_0xe420('0x8'))},'read1stAt':{'type':Sequelize[_0xe420('0x7')]},'lastMsgAt':{'type':Sequelize[_0xe420('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xe420('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe420('0x6')]},'customerPort':{'type':Sequelize[_0xe420('0x6')]},'vidaooSessionId':{'type':Sequelize[_0xe420('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xe420('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe420('0x9')]}}; \ No newline at end of file +var _0x16ca=['INTEGER','star','TEXT','STRING','DATE','long','ENUM','sequelize'];(function(_0x2f6282,_0xe47106){var _0x4da8ec=function(_0x45b23b){while(--_0x45b23b){_0x2f6282['push'](_0x2f6282['shift']());}};_0x4da8ec(++_0xe47106);}(_0x16ca,0x147));var _0xa16c=function(_0x341a15,_0xaa08f7){_0x341a15=_0x341a15-0x0;var _0x5d1bd0=_0x16ca[_0x341a15];return _0x5d1bd0;};'use strict';var Sequelize=require(_0xa16c('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa16c('0x1')]},'ratingType':{'type':Sequelize['ENUM'](_0xa16c('0x2'),'thumb'),'defaultValue':_0xa16c('0x2')},'ratingMessage':{'type':Sequelize[_0xa16c('0x3')]},'pathTranscript':{'type':Sequelize[_0xa16c('0x3')]},'mailTranscript':{'type':Sequelize[_0xa16c('0x4')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa16c('0x5')]},'disposition':{'type':Sequelize[_0xa16c('0x4')]},'secondDisposition':{'type':Sequelize[_0xa16c('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa16c('0x4')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xa16c('0x4')]},'osName':{'type':Sequelize[_0xa16c('0x4')]},'osVersion':{'type':Sequelize[_0xa16c('0x4')]},'deviceModel':{'type':Sequelize[_0xa16c('0x4')]},'deviceVendor':{'type':Sequelize[_0xa16c('0x4')]},'deviceType':{'type':Sequelize[_0xa16c('0x4')]},'referer':{'type':Sequelize[_0xa16c('0x3')]},'customerIp':{'type':Sequelize[_0xa16c('0x4')]},'formData':{'type':Sequelize['TEXT'](_0xa16c('0x6'))},'read1stAt':{'type':Sequelize[_0xa16c('0x5')]},'lastMsgAt':{'type':Sequelize[_0xa16c('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xa16c('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa16c('0x4')]},'customerPort':{'type':Sequelize[_0xa16c('0x4')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xa16c('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index c026da7..2a5de8c 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 _0xbffc=['originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','join','offline-chat/','mailTranscript','root','format','transcript-%s.txt','now','Messages','User','ContactId','UserId','agentAlias','System','customer','agentIdentifier','website_alias','%s%d','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','getMyMessages','push','rows','addTags','setTags','spread','Tag','color','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','read','Account','Owner','mkdirSync','N.A.','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','transcript-','.pdf','Chat','createPdfFromHTML','rimraf','zip-dir','moment','mustache','util','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','undefined','limit','count','offset','Content-Range','update','destroy','sendStatus','stack','name','render','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','params','keys','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload'];(function(_0x1891c8,_0x52ffd0){var _0x3d3dca=function(_0x4230d0){while(--_0x4230d0){_0x1891c8['push'](_0x1891c8['shift']());}};_0x3d3dca(++_0x52ffd0);}(_0xbffc,0x12f));var _0xcbff=function(_0x2201dc,_0x4394f4){_0x2201dc=_0x2201dc-0x0;var _0x39b5e9=_0xbffc[_0x2201dc];return _0x39b5e9;};'use strict';var rimraf=require(_0xcbff('0x0'));var zipdir=require(_0xcbff('0x1'));var rp=require('request-promise');var moment=require(_0xcbff('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcbff('0x3'));var util=require(_0xcbff('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xcbff('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xcbff('0x6'));var pdf=require(_0xcbff('0x7'));var logger=require(_0xcbff('0x8'))(_0xcbff('0x9'));var config=require(_0xcbff('0xa'));var db=require(_0xcbff('0xb'))['db'];config[_0xcbff('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcbff('0xd'))(new Redis(config[_0xcbff('0xc')]));require(_0xcbff('0xe'))[_0xcbff('0xf')](socket);var jayson=require(_0xcbff('0x10'));var client=jayson[_0xcbff('0x11')][_0xcbff('0x12')]({'port':0x232b});var client9004=jayson[_0xcbff('0x11')][_0xcbff('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x26b9ed,_0x37d115,_0x3666fa,_0x35c221){return new BPromise(function(_0x2c01e4,_0x2337b8){var _0x52851f=_0x35c221||client;return _0x52851f[_0xcbff('0x13')](_0x26b9ed,_0x3666fa)[_0xcbff('0x14')](function(_0x2090b9){logger[_0xcbff('0x15')](_0xcbff('0x16'),_0x37d115,_0xcbff('0x17'));logger[_0xcbff('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x37d115,'request\x20sent',JSON[_0xcbff('0x19')](_0x2090b9));if(_0x2090b9[_0xcbff('0x1a')]){if(_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1b')]===0x1f4){logger[_0xcbff('0x1a')](_0xcbff('0x16'),_0x37d115,_0x2090b9['error']['message']);return _0x2337b8(_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1c')]);}logger['error'](_0xcbff('0x16'),_0x37d115,_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1c')]);return _0x2c01e4(_0x2090b9[_0xcbff('0x1a')][_0xcbff('0x1c')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x37d115,_0xcbff('0x17'));_0x2c01e4(_0x2090b9[_0xcbff('0x1d')][_0xcbff('0x1c')]);}})[_0xcbff('0x1e')](function(_0x1a7d85){logger[_0xcbff('0x1a')](_0xcbff('0x16'),_0x37d115,_0x1a7d85);_0x2337b8(_0x1a7d85);});});}function respondWithStatusCode(_0x13a84f,_0x21ed68){_0x21ed68=_0x21ed68||0xcc;return function(_0x54516e){if(_0x54516e){return _0x13a84f['sendStatus'](_0x21ed68);}return _0x13a84f['status'](_0x21ed68)[_0xcbff('0x1f')]();};}function respondWithResult(_0x14998d,_0x495166){_0x495166=_0x495166||0xc8;return function(_0x2d5a43){if(_0x2d5a43){return _0x14998d[_0xcbff('0x20')](_0x495166)[_0xcbff('0x21')](_0x2d5a43);}};}function respondWithFilteredResult(_0x58d880,_0xa3b834){return function(_0x5cbe14){if(_0x5cbe14){var _0x1bf238=typeof _0xa3b834['offset']===_0xcbff('0x22')&&typeof _0xa3b834[_0xcbff('0x23')]===_0xcbff('0x22');var _0x416062=_0x5cbe14[_0xcbff('0x24')];var _0x5e577f=_0x1bf238?0x0:_0xa3b834[_0xcbff('0x25')];var _0x9631f3=_0x1bf238?_0x5cbe14[_0xcbff('0x24')]:_0xa3b834['offset']+_0xa3b834[_0xcbff('0x23')];var _0x140f43;if(_0x9631f3>=_0x416062){_0x9631f3=_0x416062;_0x140f43=0xc8;}else{_0x140f43=0xce;}_0x58d880[_0xcbff('0x20')](_0x140f43);return _0x58d880['set'](_0xcbff('0x26'),_0x5e577f+'-'+_0x9631f3+'/'+_0x416062)['json'](_0x5cbe14);}return null;};}function saveUpdates(_0x599a20){return function(_0x4b8fa2){if(_0x4b8fa2){return _0x4b8fa2[_0xcbff('0x27')](_0x599a20)[_0xcbff('0x14')](function(_0x3ed51d){return _0x3ed51d;});}return null;};}function removeEntity(_0x410e67){return function(_0x1e8edb){if(_0x1e8edb){return _0x1e8edb[_0xcbff('0x28')]()['then'](function(){_0x410e67[_0xcbff('0x20')](0xcc)[_0xcbff('0x1f')]();});}};}function handleEntityNotFound(_0x3571f9){return function(_0x27142b){if(!_0x27142b){_0x3571f9[_0xcbff('0x29')](0x194);}return _0x27142b;};}function handleError(_0x422eba,_0x5a924b){_0x5a924b=_0x5a924b||0x1f4;return function(_0x5690fb){logger[_0xcbff('0x1a')](_0x5690fb[_0xcbff('0x2a')]);if(_0x5690fb[_0xcbff('0x2b')]){delete _0x5690fb[_0xcbff('0x2b')];}_0x422eba[_0xcbff('0x20')](_0x5a924b)['send'](_0x5690fb);};}function getMustacheRender(_0xc062a8,_0x442942){return Mustache[_0xcbff('0x2c')](_0xc062a8,_['merge'](_0x442942[_0xcbff('0x2d')],{'contact':_0x442942[_0xcbff('0x2e')],'message':_0x442942[_0xcbff('0x1c')],'agent':_0x442942[_0xcbff('0x2f')],'interaction':_0x442942[_0xcbff('0x30')],'account':_0x442942[_0xcbff('0x31')]}))||'';}exports['index']=function(_0x3a9592,_0x56fb1e){var _0x3f4605={};var _0x2857d5=_[_0xcbff('0x32')](db[_0xcbff('0x33')][_0xcbff('0x34')],function(_0x5e0bf6){return{'name':_0x5e0bf6[_0xcbff('0x35')],'type':_0x5e0bf6[_0xcbff('0x36')][_0xcbff('0x37')]};});_0x3f4605=qs[_0xcbff('0x38')](_0x2857d5,_0x3a9592);return interaction[_0xcbff('0x39')]('chat',_0x3a9592[_0xcbff('0x3a')],_0x3a9592[_0xcbff('0x3b')],_0x3f4605,_0x2857d5)[_0xcbff('0x14')](respondWithFilteredResult(_0x56fb1e,_0x3f4605))[_0xcbff('0x1e')](handleError(_0x56fb1e,null));};exports['show']=function(_0x5ea95b,_0x5253f5){var _0x2efd55={'raw':![],'where':{'id':_0x5ea95b[_0xcbff('0x3c')]['id']}},_0x192e3e={};_0x192e3e['model']=_['keys'](db[_0xcbff('0x33')]['rawAttributes']);_0x192e3e[_0xcbff('0x3a')]=_[_0xcbff('0x3d')](_0x5ea95b[_0xcbff('0x3a')]);_0x192e3e[_0xcbff('0x3e')]=_[_0xcbff('0x3f')](_0x192e3e[_0xcbff('0x40')],_0x192e3e[_0xcbff('0x3a')]);_0x2efd55['attributes']=_[_0xcbff('0x3f')](_0x192e3e[_0xcbff('0x40')],qs['fields'](_0x5ea95b[_0xcbff('0x3a')][_0xcbff('0x41')]));_0x2efd55[_0xcbff('0x42')]=_0x2efd55[_0xcbff('0x42')][_0xcbff('0x43')]?_0x2efd55['attributes']:_0x192e3e[_0xcbff('0x40')];if(_0x5ea95b[_0xcbff('0x3a')][_0xcbff('0x44')]){_0x2efd55[_0xcbff('0x45')]=[{'all':!![]}];}_0x2efd55=_['merge']({},_0x2efd55,_0x5ea95b[_0xcbff('0x46')]);return db[_0xcbff('0x33')][_0xcbff('0x47')](_0x2efd55)[_0xcbff('0x14')](handleEntityNotFound(_0x5253f5,null))[_0xcbff('0x14')](respondWithResult(_0x5253f5,null))[_0xcbff('0x1e')](handleError(_0x5253f5,null));};exports[_0xcbff('0x48')]=function(_0x4617d9,_0x108788){return db[_0xcbff('0x33')][_0xcbff('0x48')](_0x4617d9['body'],{})[_0xcbff('0x14')](respondWithResult(_0x108788,0xc9))[_0xcbff('0x1e')](handleError(_0x108788,null));};exports[_0xcbff('0x27')]=function(_0x23ee6c,_0x5525bc){if(_0x23ee6c[_0xcbff('0x2d')]['id']){delete _0x23ee6c[_0xcbff('0x2d')]['id'];}return db[_0xcbff('0x33')]['find']({'where':{'id':_0x23ee6c[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x5525bc,null))[_0xcbff('0x14')](saveUpdates(_0x23ee6c[_0xcbff('0x2d')],null))[_0xcbff('0x14')](respondWithResult(_0x5525bc,null))[_0xcbff('0x1e')](handleError(_0x5525bc,null));};exports['destroy']=function(_0x1cae9f,_0x465596){return db[_0xcbff('0x33')]['find']({'where':{'id':_0x1cae9f[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x465596,null))[_0xcbff('0x14')](removeEntity(_0x465596,null))[_0xcbff('0x1e')](handleError(_0x465596,null));};exports[_0xcbff('0x49')]=function(_0x2fdac3,_0x2dc884){return db[_0xcbff('0x33')][_0xcbff('0x49')]()[_0xcbff('0x14')](respondWithResult(_0x2dc884,null))[_0xcbff('0x1e')](handleError(_0x2dc884,null));};exports['createVidaooSession']=function(_0x402383,_0x58a019){var _0x157131=_0x402383[_0xcbff('0x3c')]['id'];var _0x1d8544;var _0x4a9ee5;var _0x49f725;return db[_0xcbff('0x33')][_0xcbff('0x4a')]({'where':{'id':_0x157131}})['then'](function(_0x5cb9c3){_0x1d8544=_0x5cb9c3;return db[_0xcbff('0x4b')]['findOne']({'where':{'id':_0x5cb9c3[_0xcbff('0x4c')]},'attributes':['id',_0xcbff('0x4d'),_0xcbff('0x4e'),_0xcbff('0x4f'),_0xcbff('0x50'),_0xcbff('0x51')],'raw':!![]});})[_0xcbff('0x14')](function(_0x5481e1){if(_0x5481e1&&_0x5481e1[_0xcbff('0x4d')]&&_0x5481e1[_0xcbff('0x4e')]){_0x4a9ee5=_0x5481e1;var _0x9e6bf3={'interaction':{'id':_0x157131},'agent':{'id':_0x402383[_0xcbff('0x3b')]['id'],'name':_0x402383[_0xcbff('0x3b')][_0xcbff('0x2b')],'fullname':_0x402383[_0xcbff('0x3b')][_0xcbff('0x52')],'email':_0x402383[_0xcbff('0x3b')][_0xcbff('0x53')]},'contact':_0x402383[_0xcbff('0x2d')]['contact'],'account':_0x402383['body'][_0xcbff('0x31')]};var _0xfd3523={'rejectUnauthorized':![],'method':_0xcbff('0x54'),'url':_0xcbff('0x55'),'headers':{'X-APIKEY':_0x5481e1[_0xcbff('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x402383['user']['email']],'buttons':null,'topic':_0x4a9ee5[_0xcbff('0x4f')],'note':_[_0xcbff('0x56')](_0x4a9ee5[_0xcbff('0x50')])?null:getMustacheRender(_0x4a9ee5[_0xcbff('0x50')],_0x9e6bf3),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x4a9ee5['vidaooMetadata'])){var _0x3891dd=getMustacheRender(_0x4a9ee5[_0xcbff('0x51')],_0x9e6bf3);var _0x3fcf1c=JSON[_0xcbff('0x57')](_0x3891dd);_0xfd3523['body'][_0xcbff('0x58')]=_0x3fcf1c;}}catch(_0x4b754d){throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x5b'));}return rp(_0xfd3523);}else{throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x5c'));}})[_0xcbff('0x14')](function(_0x4eadef){_0x49f725=_0x4eadef;if(_0x49f725['id']){var _0x4eb7bc={'body':_0x49f725[_0xcbff('0x5d')],'ChatWebsiteId':_0x4a9ee5['id'],'ChatInteractionId':_0x1d8544['id'],'direction':_0xcbff('0x5e'),'UserId':_0x402383[_0xcbff('0x3b')]['id']};return db[_0xcbff('0x5f')][_0xcbff('0x48')](_0x4eb7bc,{});}else{throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x60'));}})[_0xcbff('0x14')](function(){return _0x1d8544[_0xcbff('0x61')]({'vidaooSessionId':_0x49f725['id']});})[_0xcbff('0x14')](respondWithResult(_0x58a019,null))[_0xcbff('0x1e')](handleError(_0x58a019,null));};exports[_0xcbff('0x62')]=function(_0x3423a2,_0x4426aa){if(_0x3423a2[_0xcbff('0x2d')]['id']){delete _0x3423a2[_0xcbff('0x2d')]['id'];}return db[_0xcbff('0x33')][_0xcbff('0x47')]({'where':{'id':_0x3423a2['params']['id']},'include':[{'model':db[_0xcbff('0x63')],'as':'Contact'}]})[_0xcbff('0x14')](handleEntityNotFound(_0x4426aa,null))[_0xcbff('0x14')](saveUpdates(_0x3423a2['body'],null))[_0xcbff('0x14')](respondWithResult(_0x4426aa,null))[_0xcbff('0x1e')](handleError(_0x4426aa,null));};exports['abandon']=function(_0xb3f226,_0x232731){if(_0xb3f226[_0xcbff('0x2d')]['id']){delete _0xb3f226[_0xcbff('0x2d')]['id'];}return db['ChatInteraction'][_0xcbff('0x47')]({'where':{'id':_0xb3f226['params']['id']}})['then'](function(_0x5440d4){if(!_0x5440d4){logger[_0xcbff('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xcbff('0x64'));_0x232731[_0xcbff('0x29')](0x194);}else{if(_0x5440d4['UserId']){throw new db[(_0xcbff('0x59'))][(_0xcbff('0x5a'))](_0xcbff('0x65'));}}return _0x5440d4;})['then'](function(_0x41d41b){if(_0x41d41b){return _0x41d41b[_0xcbff('0x27')]({'closed':_0xb3f226[_0xcbff('0x2d')][_0xcbff('0x66')],'disposition':_0xb3f226[_0xcbff('0x2d')][_0xcbff('0x67')]})['then'](function(_0x248e41){return _0x248e41;});}})[_0xcbff('0x14')](function(){return respondWithRpcPromise(_0xcbff('0x68'),_0xcbff('0x69'),_0xb3f226['body'],client9004);})[_0xcbff('0x14')](respondWithResult(_0x232731,null))[_0xcbff('0x1e')](handleError(_0x232731,null));};exports[_0xcbff('0x6a')]=function(_0xc0af63,_0x4e5c7d){_0xc0af63[_0xcbff('0x2d')]['name']=_0xc0af63['file'][_0xcbff('0x6b')];_0xc0af63[_0xcbff('0x2d')][_0xcbff('0x6c')]=_0xc0af63[_0xcbff('0x6d')][_0xcbff('0x6e')];_0xc0af63[_0xcbff('0x2d')][_0xcbff('0x36')]=_0xc0af63[_0xcbff('0x6d')][_0xcbff('0x6f')];return db[_0xcbff('0x70')][_0xcbff('0x48')](_0xc0af63['body'])[_0xcbff('0x14')](respondWithResult(_0x4e5c7d,0xc9))[_0xcbff('0x1e')](handleError(_0x4e5c7d,null));};exports[_0xcbff('0x71')]=function(_0x3041a1,_0x4475e2){return db[_0xcbff('0x33')][_0xcbff('0x4a')]({'where':{'id':_0x3041a1[_0xcbff('0x3c')]['id']},'raw':!![]})[_0xcbff('0x14')](handleEntityNotFound(_0x4475e2,null))[_0xcbff('0x14')](function(_0x171de1){if(_0x171de1){if(_0x171de1['closed']){return _0x4475e2[_0xcbff('0x20')](0x193)['json']({'status':0x193,'message':_0xcbff('0x72')});}return db[_0xcbff('0x70')][_0xcbff('0x4a')]({'where':{'id':_0x3041a1['query']['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x4475e2,null));}})[_0xcbff('0x14')](function(_0x45db9e){if(_0x45db9e){var _0x135a63=_0x45db9e['ChatOfflineMessageId']!==null;var _0x17f5a9=path[_0xcbff('0x73')](config['root'],'server/files/attachments/');if(_0x135a63){_0x17f5a9=path[_0xcbff('0x73')](_0x17f5a9,_0xcbff('0x74'));}var _0x42c414=path[_0xcbff('0x73')](_0x17f5a9,_0x45db9e[_0xcbff('0x6c')]);return _0x4475e2['download'](_0x42c414);}})[_0xcbff('0x1e')](handleError(_0x4475e2,null));};exports['close']=function(_0xaa9b40,_0x4f0bd6){var _0x15e63c=null;var _0x8da360=null;var _0x4a97d7=null;if(_0xaa9b40[_0xcbff('0x2d')]['id']){delete _0xaa9b40[_0xcbff('0x2d')]['id'];}if(_0xaa9b40[_0xcbff('0x2d')][_0xcbff('0x75')]){_0x4a97d7=path[_0xcbff('0x73')](config[_0xcbff('0x76')],'server/files/chat/upload/',util[_0xcbff('0x77')](_0xcbff('0x78'),Date[_0xcbff('0x79')]()));_0xaa9b40[_0xcbff('0x2d')]['pathTranscript']=_0x4a97d7;}return db[_0xcbff('0x33')][_0xcbff('0x47')]({'where':{'id':_0xaa9b40[_0xcbff('0x3c')]['id']},'include':[{'model':db[_0xcbff('0x5f')],'as':_0xcbff('0x7a'),'include':[{'model':db[_0xcbff('0x7b')],'as':'User'}]}]})[_0xcbff('0x14')](handleEntityNotFound(_0x4f0bd6,null))['then'](saveUpdates(_0xaa9b40[_0xcbff('0x2d')],null))[_0xcbff('0x14')](function(_0x2bd5cb){if(_0x2bd5cb){_0x15e63c=_0x2bd5cb;return db[_0xcbff('0x4b')]['find']({'where':{'id':_0x15e63c['ChatWebsiteId']}});}})['then'](function(_0x391782){if(_0x391782){_0x8da360=_0x391782;return db['CmContact']['find']({'where':{'id':_0x15e63c[_0xcbff('0x7c')]}});}})[_0xcbff('0x14')](function(_0x4f1585){if(_0x4f1585){if(_0x4a97d7){var _0x3db607=null;for(var _0xd5689e=0x1;_0xd5689e<_0x15e63c[_0xcbff('0x7a')][_0xcbff('0x43')];++_0xd5689e){_0x3db607=_0x15e63c[_0xcbff('0x7a')][_0xd5689e];var _0x31c386=_0x3db607[_0xcbff('0x7d')]?util['format']('%s%d',_0x8da360[_0xcbff('0x7e')],_0x3db607[_0xcbff('0x7d')]):_0xcbff('0x7f');var _0x1d0cda=_0xaa9b40[_0xcbff('0x2d')][_0xcbff('0x80')]||util[_0xcbff('0x77')]('%s%d','Visitor',_0x3db607[_0xcbff('0x7c')]);switch(_0x8da360[_0xcbff('0x81')]){case _0xcbff('0x82'):_0x31c386=_0x3db607['UserId']?util[_0xcbff('0x77')](_0xcbff('0x83'),_0x8da360['agentAlias'],_0x3db607['UserId']):_0xcbff('0x7f');break;case'agent_alias':_0x31c386=_0x3db607[_0xcbff('0x7d')]?_0x3db607['User'][_0xcbff('0x84')]||_0x3db607[_0xcbff('0x7b')]['fullname']:'System';break;case _0xcbff('0x85'):_0x31c386=_0x3db607[_0xcbff('0x7d')]?_0x3db607['User'][_0xcbff('0x52')]:_0xcbff('0x7f');break;default:_0x31c386=_0x3db607[_0xcbff('0x7d')]?util[_0xcbff('0x77')]('%s%d',_0x8da360['agentAlias'],_0x3db607[_0xcbff('0x7d')]):_0xcbff('0x7f');}var _0x1cee65=util[_0xcbff('0x77')](_0xcbff('0x86'),moment(_0x3db607[_0xcbff('0x87')])[_0xcbff('0x77')](_0xcbff('0x88')),_0x3db607['direction']==='in'?_0x1d0cda:_0x31c386,_0x3db607['body']);if(!_0x3db607[_0xcbff('0x89')]){fs[_0xcbff('0x8a')](_0x4a97d7,_0x1cee65);}}return db[_0xcbff('0x8b')][_0xcbff('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0xcbff('0x8c')],'as':_0xcbff('0x8d'),'raw':!![],'include':[{'model':db[_0xcbff('0x8e')],'as':_0xcbff('0x8e'),'raw':!![]}]}]});}}})[_0xcbff('0x14')](function(_0x49bebf){if(!_0x49bebf||!_0x49bebf[_0xcbff('0x8d')]||!_0xaa9b40[_0xcbff('0x2d')])return _0x15e63c;var _0x12cc2a=_0x49bebf[_0xcbff('0x8f')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x12cc2a,'message':{'from':util[_0xcbff('0x77')](_0xcbff('0x90'),_0x49bebf[_0xcbff('0x2b')],_0x49bebf[_0xcbff('0x53')]||_0x49bebf[_0xcbff('0x8d')]['user']),'to':_0xaa9b40[_0xcbff('0x2d')][_0xcbff('0x75')],'subject':_0xcbff('0x91'),'text':util['format'](_0xcbff('0x92'),_0xaa9b40['body'][_0xcbff('0x75')]),'attachments':[{'path':_0x4a97d7}]}})[_0xcbff('0x14')](function(){return _0x15e63c;})['catch'](function(_0x54c51d){logger[_0xcbff('0x1a')](_0x54c51d);});})[_0xcbff('0x14')](respondWithStatusCode(_0x4f0bd6,0xc8))[_0xcbff('0x1e')](handleError(_0x4f0bd6,null));};exports[_0xcbff('0x93')]=function(_0x387c27,_0x4d8d97){return db['ChatMessage']['find']({'where':{'id':_0x387c27['params']['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x4d8d97,null))[_0xcbff('0x14')](function(_0x181731){if(_0x181731){return _0x181731[_0xcbff('0x93')](_0x387c27[_0xcbff('0x2d')][_0xcbff('0x94')],_[_0xcbff('0x95')](_0x387c27[_0xcbff('0x2d')],['ids','id'])||{});}})[_0xcbff('0x14')](respondWithResult(_0x4d8d97,null))[_0xcbff('0x1e')](handleError(_0x4d8d97,null));};exports[_0xcbff('0x96')]=function(_0x12477f,_0x14510c){var _0xa50827={'raw':![],'where':{}};var _0x5cb681={};var _0xf6a720={'count':0x0,'rows':[]};return db[_0xcbff('0x33')][_0xcbff('0x4a')]({'where':{'id':_0x12477f[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x14510c,null))['then'](function(_0x473141){if(_0x473141){_0x5cb681['model']=_[_0xcbff('0x3d')](db[_0xcbff('0x5f')][_0xcbff('0x34')]);_0x5cb681[_0xcbff('0x3a')]=_['keys'](_0x12477f['query']);_0x5cb681[_0xcbff('0x3e')]=_[_0xcbff('0x3f')](_0x5cb681[_0xcbff('0x40')],_0x5cb681[_0xcbff('0x3a')]);_0xa50827['attributes']=_[_0xcbff('0x3f')](_0x5cb681['model'],qs[_0xcbff('0x41')](_0x12477f['query'][_0xcbff('0x41')]));_0xa50827['attributes']=_0xa50827[_0xcbff('0x42')][_0xcbff('0x43')]?_0xa50827[_0xcbff('0x42')]:_0x5cb681['model'];if(!_0x12477f[_0xcbff('0x3a')][_0xcbff('0x97')](_0xcbff('0x98'))){_0xa50827[_0xcbff('0x23')]=qs[_0xcbff('0x23')](_0x12477f[_0xcbff('0x3a')][_0xcbff('0x23')]);_0xa50827['offset']=qs[_0xcbff('0x25')](_0x12477f['query'][_0xcbff('0x25')]);}_0xa50827[_0xcbff('0x99')]=qs[_0xcbff('0x9a')](_0x12477f[_0xcbff('0x3a')]['sort']);_0xa50827[_0xcbff('0x9b')]=qs['filters'](_[_0xcbff('0x9c')](_0x12477f[_0xcbff('0x3a')],_0x5cb681[_0xcbff('0x3e')]));_0xa50827[_0xcbff('0x9b')][_0xcbff('0x9d')]=_0x473141['id'];if(_0x12477f['query']['filter']){_0xa50827[_0xcbff('0x9b')]=_['merge'](_0xa50827[_0xcbff('0x9b')],{'$or':_['map'](_0xa50827[_0xcbff('0x42')],function(_0xa79788){var _0x50ed81={};_0x50ed81[_0xa79788]={'$like':'%'+_0x12477f['query'][_0xcbff('0x9e')]+'%'};return _0x50ed81;})});}if(_0x12477f[_0xcbff('0x3a')][_0xcbff('0x9f')]){var _0x377de3=_0x12477f[_0xcbff('0x3a')][_0xcbff('0x9f')][_0xcbff('0xa0')](',');var _0x4d5605={};_0x4d5605[_0x377de3[0x0]]={'$gte':moment(_0x377de3[0x1])[_0xcbff('0x77')](_0xcbff('0xa1'))};_0xa50827['where']=_[_0xcbff('0xa2')](_0xa50827[_0xcbff('0x9b')],_0x4d5605);}_0xa50827=_[_0xcbff('0xa2')]({},_0xa50827,_0x12477f[_0xcbff('0x46')]);return db['ChatMessage'][_0xcbff('0x24')]({'where':_0xa50827[_0xcbff('0x9b')]})['then'](function(_0x38354d){_0xf6a720[_0xcbff('0x24')]=_0x38354d;if(_0x12477f[_0xcbff('0x3a')][_0xcbff('0x44')]){_0xa50827[_0xcbff('0x45')]=[{'all':!![]}];}return db[_0xcbff('0x5f')][_0xcbff('0x39')](_0xa50827);})['then'](function(_0x2aff8d){_0xf6a720['rows']=_0x2aff8d;return _0xf6a720;});}})[_0xcbff('0x14')](respondWithFilteredResult(_0x14510c,_0xa50827))[_0xcbff('0x1e')](handleError(_0x14510c,null));};exports[_0xcbff('0xa3')]=function(_0x4f4df9,_0x32ce93){var _0x545e72={'where':{}},_0x235b14={},_0x378381={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xcbff('0x4a')]({'where':{'id':_0x4f4df9[_0xcbff('0x3c')]['id']}})['then'](handleEntityNotFound(_0x32ce93,null))[_0xcbff('0x14')](function(_0x4d41de){if(_0x4d41de){_0x235b14[_0xcbff('0x40')]=_[_0xcbff('0x3d')](db[_0xcbff('0x5f')][_0xcbff('0x34')]);_0x235b14[_0xcbff('0x3a')]=_[_0xcbff('0x3d')](_0x4f4df9['query']);_0x235b14[_0xcbff('0x3e')]=_[_0xcbff('0x3f')](_0x235b14[_0xcbff('0x40')],_0x235b14[_0xcbff('0x3a')]);_0x545e72[_0xcbff('0x42')]=_[_0xcbff('0x3f')](_0x235b14[_0xcbff('0x40')],qs[_0xcbff('0x41')](_0x4f4df9[_0xcbff('0x3a')]['fields']));_0x545e72[_0xcbff('0x42')]=_0x545e72[_0xcbff('0x42')][_0xcbff('0x43')]?_0x545e72[_0xcbff('0x42')]:_0x235b14[_0xcbff('0x40')];if(!_0x4f4df9['query'][_0xcbff('0x97')]('nolimit')){_0x545e72[_0xcbff('0x23')]=qs[_0xcbff('0x23')](_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x23')]);_0x545e72['offset']=qs[_0xcbff('0x25')](_0x4f4df9[_0xcbff('0x3a')]['offset']);}_0x545e72['order']=qs[_0xcbff('0x9a')](_0x4f4df9['query']['sort']);_0x545e72[_0xcbff('0x9b')]=qs[_0xcbff('0x3e')](_[_0xcbff('0x9c')](_0x4f4df9[_0xcbff('0x3a')],_0x235b14['filters']));_0x545e72['where'][_0xcbff('0x9d')]=_0x4d41de['id'];if(_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x9e')]){_0x545e72[_0xcbff('0x9b')]=_[_0xcbff('0xa2')](_0x545e72[_0xcbff('0x9b')],{'$or':_['map'](_0x545e72[_0xcbff('0x42')],function(_0x37621a){var _0x5a5225={};_0x5a5225[_0x37621a]={'$like':'%'+_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x9e')]+'%'};return _0x5a5225;})});}_0x545e72[_0xcbff('0x9b')][_0xcbff('0x89')]=![];if(_0x4f4df9[_0xcbff('0x3a')]['id']){_0x545e72[_0xcbff('0x9b')]['id']={'$gt':_0x4f4df9['query']['id']};}_0x545e72=_['merge']({},_0x545e72,_0x4f4df9[_0xcbff('0x46')]);return db[_0xcbff('0x5f')][_0xcbff('0x24')]({'where':_0x545e72['where']})[_0xcbff('0x14')](function(_0x42fd5a){_0x378381[_0xcbff('0x24')]=_0x42fd5a;_0x545e72['include']=[];if(_0x4f4df9[_0xcbff('0x3a')]['includeAgent']){_0x545e72[_0xcbff('0x45')][_0xcbff('0xa4')]({'model':db[_0xcbff('0x7b')],'as':_0xcbff('0x7b'),'attributes':['id',_0xcbff('0x52'),'alias']});}if(_0x4f4df9[_0xcbff('0x3a')][_0xcbff('0x44')]){_0x545e72[_0xcbff('0x45')]=[{'all':!![]}];}return db[_0xcbff('0x5f')][_0xcbff('0x39')](_0x545e72);})['then'](function(_0x3565c2){_0x378381[_0xcbff('0xa5')]=_0x3565c2;return _0x378381;});}})[_0xcbff('0x14')](respondWithFilteredResult(_0x32ce93,_0x545e72))[_0xcbff('0x1e')](handleError(_0x32ce93,null));};exports[_0xcbff('0xa6')]=function(_0x3f65b5,_0x59d450){return db['ChatInteraction']['find']({'where':{'id':_0x3f65b5[_0xcbff('0x3c')]['id']}})['then'](handleEntityNotFound(_0x59d450,null))[_0xcbff('0x14')](function(_0x266053){if(_0x266053){return _0x266053[_0xcbff('0xa7')](_0x3f65b5[_0xcbff('0x2d')][_0xcbff('0x94')],_[_0xcbff('0x95')](_0x3f65b5[_0xcbff('0x2d')],[_0xcbff('0x94'),'id'])||{})[_0xcbff('0xa8')](function(){return db[_0xcbff('0xa9')][_0xcbff('0x39')]({'attributes':['id',_0xcbff('0x2b'),_0xcbff('0xaa')],'where':{'id':_0x3f65b5[_0xcbff('0x2d')][_0xcbff('0x94')]}});})['then'](function(_0x4d522a){socket['emit'](_0xcbff('0xab'),{'id':Number(_0x3f65b5[_0xcbff('0x3c')]['id']),'tags':_0x4d522a||[]});return{'id':Number(_0x3f65b5[_0xcbff('0x3c')]['id']),'tags':_0x4d522a||[]};});}})[_0xcbff('0x14')](respondWithResult(_0x59d450,null))['catch'](handleError(_0x59d450,null));};exports[_0xcbff('0xac')]=function(_0xbf5a2a,_0x4100e3){return db[_0xcbff('0x33')][_0xcbff('0x47')]({'where':{'id':_0xbf5a2a[_0xcbff('0x3c')]['id']}})[_0xcbff('0x14')](handleEntityNotFound(_0x4100e3,null))[_0xcbff('0x14')](function(_0x1d19b1){if(_0x1d19b1){return _0x1d19b1[_0xcbff('0xac')](_0xbf5a2a[_0xcbff('0x3a')][_0xcbff('0x94')]);}})[_0xcbff('0x14')](respondWithStatusCode(_0x4100e3,null))[_0xcbff('0x1e')](handleError(_0x4100e3,null));};exports[_0xcbff('0xad')]=function(_0x500d43,_0x273583){var _0x338bcc=moment()[_0xcbff('0xae')]()[_0xcbff('0xaf')]();var _0xf2cc33=path[_0xcbff('0x73')](config[_0xcbff('0x76')],_0xcbff('0xb0'),_0xcbff('0xb1'),_0xcbff('0xb2'));var _0x53f1c0=path['join'](config[_0xcbff('0x76')],'server',_0xcbff('0xb1'),_0xcbff('0xb3'));var _0x4e4809=path[_0xcbff('0x73')](_0xf2cc33,_0x338bcc);var _0x45b3f1=util[_0xcbff('0x77')](_0xcbff('0xb4'),_0x500d43['params']['id'],_0x338bcc);var _0x43e2a0=path[_0xcbff('0x73')](_0xf2cc33,_0x45b3f1);var _0x30c365=[];_0x30c365['push']({'model':db['User'],'as':_0xcbff('0x7b'),'attributes':['id',_0xcbff('0x52')],'raw':!![]});_0x30c365['push']({'model':db[_0xcbff('0x63')],'as':'Contact','attributes':['id',_0xcbff('0xb5'),_0xcbff('0xb6')],'raw':!![]});if(_0x500d43[_0xcbff('0x3a')][_0xcbff('0xb3')]){_0x30c365[_0xcbff('0xa4')]({'model':db[_0xcbff('0x70')],'as':_0xcbff('0x70'),'raw':!![]});}var _0x4c0cf2=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xcbff('0x2d'),_0xcbff('0x87'),_0xcbff('0xb7'),_0xcbff('0x89'),_0xcbff('0xb8')],'include':_0x30c365}];_0x4c0cf2[_0xcbff('0xa4')]({'model':db['ChatWebsite'],'as':_0xcbff('0xb9'),'attributes':['id',_0xcbff('0x2b')]});_0x4c0cf2[_0xcbff('0xa4')]({'model':db[_0xcbff('0x7b')],'as':_0xcbff('0xba'),'attributes':['id','fullname']});return db['ChatInteraction'][_0xcbff('0x47')]({'where':{'id':_0x500d43[_0xcbff('0x3c')]['id']},'include':_0x4c0cf2})[_0xcbff('0x14')](handleEntityNotFound(_0x273583,null))[_0xcbff('0x14')](function(_0x59d441){if(_0x59d441){var _0xfa0235=_0x59d441['get']({'plain':!![]});fs[_0xcbff('0xbb')](_0x4e4809);var _0x188bc1={'channel':'Chat','account':_0xfa0235[_0xcbff('0xb9')][_0xcbff('0x2b')],'agent':_0xfa0235[_0xcbff('0xba')]?_0xfa0235[_0xcbff('0xba')][_0xcbff('0x52')]:_0xcbff('0xbc'),'createdAt':moment(_0xfa0235[_0xcbff('0x87')])[_0xcbff('0x77')](_0xcbff('0xa1'))['toString'](),'closedAt':_0xfa0235[_0xcbff('0x66')]?moment(_0xfa0235['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0xfa0235[_0xcbff('0x67')],'chatInfo':{'browser':_0xfa0235['browserName'],'os':_0xfa0235[_0xcbff('0xbd')],'referer':_0xfa0235[_0xcbff('0xbe')],'customerIp':_0xfa0235[_0xcbff('0xbf')],'customerPort':_0xfa0235['customerPort']?_0xfa0235[_0xcbff('0xc0')]:_0xcbff('0xbc')},'messages':_(_0xfa0235[_0xcbff('0x7a')])[_0xcbff('0xc1')]()[_0xcbff('0x9e')]({'secret':![]})[_0xcbff('0x32')](function(_0x3f2b08){if(_0x3f2b08[_0xcbff('0x70')]){var _0x346abe=path['join'](_0x53f1c0,_0x3f2b08[_0xcbff('0x70')][_0xcbff('0x6c')]);if(fs[_0xcbff('0xc2')](_0x346abe)){fs[_0xcbff('0xc3')](_0x346abe)[_0xcbff('0xc4')](fs[_0xcbff('0xc5')](path[_0xcbff('0x73')](_0x4e4809,_0x3f2b08[_0xcbff('0x70')][_0xcbff('0x6c')])));}}return{'date':moment(_0x3f2b08[_0xcbff('0x87')])[_0xcbff('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcbff('0xaf')](),'sender':_0x3f2b08[_0xcbff('0xb7')]===_0xcbff('0x5e')?_0x3f2b08[_0xcbff('0x7b')]?_0x3f2b08[_0xcbff('0x7b')][_0xcbff('0x52')]:_0xcbff('0x7f'):_0x3f2b08['Contact'][_0xcbff('0xb5')]+(_0x3f2b08['Contact'][_0xcbff('0xb6')]?'\x20'+_0x3f2b08['Contact']['lastName']:''),'body':_0x3f2b08[_0xcbff('0x70')]?_0x3f2b08[_0xcbff('0x70')][_0xcbff('0x6c')]:_0x3f2b08[_0xcbff('0x2d')],'direction':_0x3f2b08[_0xcbff('0xb7')]===_0xcbff('0x5e')?'A':'C','secret':_0x3f2b08[_0xcbff('0x89')],'read':_0x3f2b08[_0xcbff('0xb8')],'attachment':_0x3f2b08[_0xcbff('0x70')]};})[_0xcbff('0xc6')]()};return ejs[_0xcbff('0xc7')](path[_0xcbff('0x73')](config[_0xcbff('0x76')],_0xcbff('0xb0'),_0xcbff('0xc8'),'downloadInteraction.ejs'),{'interaction':_0x188bc1})['then'](function(_0xd4a280){var _0x46ecce=path[_0xcbff('0x73')](_0x4e4809,_0xcbff('0xc9')+_0xfa0235['id']+'-'+_0x338bcc+_0xcbff('0xca'));var _0x326965={'path':_0x46ecce,'channel':_0xcbff('0xcb'),'interactionId':_0xfa0235['id']};return pdf[_0xcbff('0xcc')](_0xd4a280,_0x326965);})['then'](function(){return new Promise(function(_0x5db8b6,_0x38d836){zipdir(_0x4e4809,{'saveTo':_0x43e2a0},function(_0x5f46c3,_0x2a0905){if(_0x5f46c3)return _0x38d836(_0x5f46c3);return _0x5db8b6(_0x2a0905);});})[_0xcbff('0x14')](function(){return new BPromise(function(_0x482659,_0x4b6419){rimraf(_0x4e4809,function(_0x237f26){if(_0x237f26)_0x4b6419(_0x237f26);return _0x482659();});});})['then'](function(){return _0x273583[_0xcbff('0xad')](_0x43e2a0,_0x45b3f1,function(_0x42fc51){if(_0x42fc51){logger[_0xcbff('0x1a')]('err',_0x42fc51);}else{fs['unlinkSync'](_0x43e2a0);}});});});}else{return _0x273583[_0xcbff('0x29')](0xc8);}})['catch'](handleError(_0x273583,null));}; \ No newline at end of file +var _0xb3d5=['lastName','out','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','err','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','http','client','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','update','destroy','stack','name','send','merge','contact','agent','interaction','map','ChatInteraction','fieldName','type','findAll','chat','query','show','rawAttributes','keys','filters','intersection','attributes','fields','length','model','includeAll','include','find','create','body','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsiteId','%s%d','agentAlias','System','customer','ContactId','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','where','rows','getMyMessages','options','includeAgent','push','addTags','setTags','Tag','emit','removeTags','unix','toString','server','files','attachments','transcript-%d-%s.zip','firstName','read','Account','Owner','get','Chat','browserName','osName','referer','customerIp','customerPort','N.A.','tail','createReadStream','pipe','createWriteStream'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb3d5,0xde));var _0x5b3d=function(_0x3fb9ef,_0x1ab798){_0x3fb9ef=_0x3fb9ef-0x0;var _0x4db6e1=_0xb3d5[_0x3fb9ef];return _0x4db6e1;};'use strict';var rimraf=require(_0x5b3d('0x0'));var zipdir=require(_0x5b3d('0x1'));var rp=require('request-promise');var moment=require(_0x5b3d('0x2'));var BPromise=require(_0x5b3d('0x3'));var Mustache=require(_0x5b3d('0x4'));var util=require(_0x5b3d('0x5'));var path=require(_0x5b3d('0x6'));var ejs=require(_0x5b3d('0x7'));var fs=require('fs');var _=require(_0x5b3d('0x8'));var Redis=require(_0x5b3d('0x9'));var interaction=require(_0x5b3d('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x5b3d('0xb'));var logger=require('../../config/logger')('api');var config=require(_0x5b3d('0xc'));var db=require(_0x5b3d('0xd'))['db'];config[_0x5b3d('0xe')]=_[_0x5b3d('0xf')](config['redis'],{'host':_0x5b3d('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b3d('0xe')]));require(_0x5b3d('0x11'))[_0x5b3d('0x12')](socket);var jayson=require(_0x5b3d('0x13'));var client=jayson['client'][_0x5b3d('0x14')]({'port':0x232b});var client9004=jayson[_0x5b3d('0x15')][_0x5b3d('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x55396f,_0x161a58,_0xe7fb9a,_0xc60b34){return new BPromise(function(_0x1a2bde,_0x364f87){var _0x393e4a=_0xc60b34||client;return _0x393e4a[_0x5b3d('0x16')](_0x55396f,_0xe7fb9a)[_0x5b3d('0x17')](function(_0xf4569e){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x161a58,_0x5b3d('0x18'));logger[_0x5b3d('0x19')](_0x5b3d('0x1a'),_0x161a58,_0x5b3d('0x18'),JSON[_0x5b3d('0x1b')](_0xf4569e));if(_0xf4569e[_0x5b3d('0x1c')]){if(_0xf4569e[_0x5b3d('0x1c')][_0x5b3d('0x1d')]===0x1f4){logger[_0x5b3d('0x1c')](_0x5b3d('0x1e'),_0x161a58,_0xf4569e[_0x5b3d('0x1c')]['message']);return _0x364f87(_0xf4569e['error'][_0x5b3d('0x1f')]);}logger['error'](_0x5b3d('0x1e'),_0x161a58,_0xf4569e[_0x5b3d('0x1c')][_0x5b3d('0x1f')]);return _0x1a2bde(_0xf4569e[_0x5b3d('0x1c')][_0x5b3d('0x1f')]);}else{logger['info'](_0x5b3d('0x1e'),_0x161a58,'request\x20sent');_0x1a2bde(_0xf4569e['result'][_0x5b3d('0x1f')]);}})[_0x5b3d('0x20')](function(_0x16be76){logger[_0x5b3d('0x1c')](_0x5b3d('0x1e'),_0x161a58,_0x16be76);_0x364f87(_0x16be76);});});}function respondWithStatusCode(_0x3c56a7,_0x126588){_0x126588=_0x126588||0xcc;return function(_0x16797a){if(_0x16797a){return _0x3c56a7[_0x5b3d('0x21')](_0x126588);}return _0x3c56a7[_0x5b3d('0x22')](_0x126588)[_0x5b3d('0x23')]();};}function respondWithResult(_0xfe1309,_0x5a7cd0){_0x5a7cd0=_0x5a7cd0||0xc8;return function(_0x47c967){if(_0x47c967){return _0xfe1309['status'](_0x5a7cd0)[_0x5b3d('0x24')](_0x47c967);}};}function respondWithFilteredResult(_0x4ff9e9,_0x27fd27){return function(_0x805c67){if(_0x805c67){var _0x426267=typeof _0x27fd27[_0x5b3d('0x25')]==='undefined'&&typeof _0x27fd27[_0x5b3d('0x26')]===_0x5b3d('0x27');var _0x101cfd=_0x805c67[_0x5b3d('0x28')];var _0x5ce410=_0x426267?0x0:_0x27fd27[_0x5b3d('0x25')];var _0x20a5ca=_0x426267?_0x805c67['count']:_0x27fd27[_0x5b3d('0x25')]+_0x27fd27[_0x5b3d('0x26')];var _0x921a61;if(_0x20a5ca>=_0x101cfd){_0x20a5ca=_0x101cfd;_0x921a61=0xc8;}else{_0x921a61=0xce;}_0x4ff9e9['status'](_0x921a61);return _0x4ff9e9[_0x5b3d('0x29')]('Content-Range',_0x5ce410+'-'+_0x20a5ca+'/'+_0x101cfd)[_0x5b3d('0x24')](_0x805c67);}return null;};}function saveUpdates(_0x33cf76){return function(_0x518ad1){if(_0x518ad1){return _0x518ad1[_0x5b3d('0x2a')](_0x33cf76)[_0x5b3d('0x17')](function(_0x2be2b1){return _0x2be2b1;});}return null;};}function removeEntity(_0x30a4ab){return function(_0xb7d802){if(_0xb7d802){return _0xb7d802[_0x5b3d('0x2b')]()['then'](function(){_0x30a4ab[_0x5b3d('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ceae3){return function(_0x3cc8b0){if(!_0x3cc8b0){_0x4ceae3['sendStatus'](0x194);}return _0x3cc8b0;};}function handleError(_0x1d3951,_0x265ea2){_0x265ea2=_0x265ea2||0x1f4;return function(_0xf0284e){logger[_0x5b3d('0x1c')](_0xf0284e[_0x5b3d('0x2c')]);if(_0xf0284e[_0x5b3d('0x2d')]){delete _0xf0284e['name'];}_0x1d3951['status'](_0x265ea2)[_0x5b3d('0x2e')](_0xf0284e);};}function getMustacheRender(_0x5d4b8f,_0x4fe08b){return Mustache['render'](_0x5d4b8f,_[_0x5b3d('0x2f')](_0x4fe08b['body'],{'contact':_0x4fe08b[_0x5b3d('0x30')],'message':_0x4fe08b['message'],'agent':_0x4fe08b[_0x5b3d('0x31')],'interaction':_0x4fe08b[_0x5b3d('0x32')],'account':_0x4fe08b['account']}))||'';}exports['index']=function(_0x426111,_0x2665a2){var _0x16660d={};var _0x1bade1=_[_0x5b3d('0x33')](db[_0x5b3d('0x34')]['rawAttributes'],function(_0x576a4a){return{'name':_0x576a4a[_0x5b3d('0x35')],'type':_0x576a4a[_0x5b3d('0x36')]['key']};});_0x16660d=qs['getOptions'](_0x1bade1,_0x426111);return interaction[_0x5b3d('0x37')](_0x5b3d('0x38'),_0x426111[_0x5b3d('0x39')],_0x426111['user'],_0x16660d,_0x1bade1)[_0x5b3d('0x17')](respondWithFilteredResult(_0x2665a2,_0x16660d))[_0x5b3d('0x20')](handleError(_0x2665a2,null));};exports[_0x5b3d('0x3a')]=function(_0x1db171,_0x6eab85){var _0x91fdc2={'raw':![],'where':{'id':_0x1db171['params']['id']}},_0xa1fde9={};_0xa1fde9['model']=_['keys'](db['ChatInteraction'][_0x5b3d('0x3b')]);_0xa1fde9[_0x5b3d('0x39')]=_[_0x5b3d('0x3c')](_0x1db171[_0x5b3d('0x39')]);_0xa1fde9[_0x5b3d('0x3d')]=_[_0x5b3d('0x3e')](_0xa1fde9['model'],_0xa1fde9[_0x5b3d('0x39')]);_0x91fdc2[_0x5b3d('0x3f')]=_['intersection'](_0xa1fde9['model'],qs[_0x5b3d('0x40')](_0x1db171['query'][_0x5b3d('0x40')]));_0x91fdc2[_0x5b3d('0x3f')]=_0x91fdc2['attributes'][_0x5b3d('0x41')]?_0x91fdc2['attributes']:_0xa1fde9[_0x5b3d('0x42')];if(_0x1db171[_0x5b3d('0x39')][_0x5b3d('0x43')]){_0x91fdc2[_0x5b3d('0x44')]=[{'all':!![]}];}_0x91fdc2=_[_0x5b3d('0x2f')]({},_0x91fdc2,_0x1db171['options']);return db[_0x5b3d('0x34')][_0x5b3d('0x45')](_0x91fdc2)[_0x5b3d('0x17')](handleEntityNotFound(_0x6eab85,null))['then'](respondWithResult(_0x6eab85,null))['catch'](handleError(_0x6eab85,null));};exports[_0x5b3d('0x46')]=function(_0x1e5bb2,_0x141c46){return db['ChatInteraction'][_0x5b3d('0x46')](_0x1e5bb2[_0x5b3d('0x47')],{})[_0x5b3d('0x17')](respondWithResult(_0x141c46,0xc9))[_0x5b3d('0x20')](handleError(_0x141c46,null));};exports[_0x5b3d('0x2a')]=function(_0x232283,_0x394c5e){if(_0x232283[_0x5b3d('0x47')]['id']){delete _0x232283[_0x5b3d('0x47')]['id'];}return db[_0x5b3d('0x34')][_0x5b3d('0x45')]({'where':{'id':_0x232283[_0x5b3d('0x48')]['id']}})['then'](handleEntityNotFound(_0x394c5e,null))[_0x5b3d('0x17')](saveUpdates(_0x232283[_0x5b3d('0x47')],null))[_0x5b3d('0x17')](respondWithResult(_0x394c5e,null))[_0x5b3d('0x20')](handleError(_0x394c5e,null));};exports['destroy']=function(_0x13c5e,_0xb73055){return db[_0x5b3d('0x34')][_0x5b3d('0x45')]({'where':{'id':_0x13c5e[_0x5b3d('0x48')]['id']}})['then'](handleEntityNotFound(_0xb73055,null))[_0x5b3d('0x17')](removeEntity(_0xb73055,null))[_0x5b3d('0x20')](handleError(_0xb73055,null));};exports['describe']=function(_0xe03fcc,_0x247991){return db[_0x5b3d('0x34')][_0x5b3d('0x49')]()[_0x5b3d('0x17')](respondWithResult(_0x247991,null))[_0x5b3d('0x20')](handleError(_0x247991,null));};exports[_0x5b3d('0x4a')]=function(_0x530ad8,_0x4646b1){var _0x519555=_0x530ad8[_0x5b3d('0x48')]['id'];var _0xdbb00b;var _0x565dc4;var _0x54e337;return db[_0x5b3d('0x34')][_0x5b3d('0x4b')]({'where':{'id':_0x519555}})[_0x5b3d('0x17')](function(_0x2d971a){_0xdbb00b=_0x2d971a;return db[_0x5b3d('0x4c')][_0x5b3d('0x4b')]({'where':{'id':_0x2d971a['ChatWebsiteId']},'attributes':['id',_0x5b3d('0x4d'),_0x5b3d('0x4e'),'vidaooTopic',_0x5b3d('0x4f'),_0x5b3d('0x50')],'raw':!![]});})[_0x5b3d('0x17')](function(_0xef8566){if(_0xef8566&&_0xef8566[_0x5b3d('0x4d')]&&_0xef8566['vidaooEscalation']){_0x565dc4=_0xef8566;var _0x4ebc05={'interaction':{'id':_0x519555},'agent':{'id':_0x530ad8['user']['id'],'name':_0x530ad8['user'][_0x5b3d('0x2d')],'fullname':_0x530ad8[_0x5b3d('0x51')][_0x5b3d('0x52')],'email':_0x530ad8[_0x5b3d('0x51')][_0x5b3d('0x53')]},'contact':_0x530ad8[_0x5b3d('0x47')]['contact'],'account':_0x530ad8[_0x5b3d('0x47')][_0x5b3d('0x54')]};var _0x39e925={'rejectUnauthorized':![],'method':_0x5b3d('0x55'),'url':_0x5b3d('0x56'),'headers':{'X-APIKEY':_0xef8566['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x530ad8[_0x5b3d('0x51')][_0x5b3d('0x53')]],'buttons':null,'topic':_0x565dc4[_0x5b3d('0x57')],'note':_[_0x5b3d('0x58')](_0x565dc4[_0x5b3d('0x4f')])?null:getMustacheRender(_0x565dc4[_0x5b3d('0x4f')],_0x4ebc05),'metadata':null},'redirect':_0x5b3d('0x59'),'json':!![]};try{if(!_['isNull'](_0x565dc4['vidaooMetadata'])){var _0x24fd85=getMustacheRender(_0x565dc4[_0x5b3d('0x50')],_0x4ebc05);var _0x4dbded=JSON[_0x5b3d('0x5a')](_0x24fd85);_0x39e925[_0x5b3d('0x47')]['metadata']=_0x4dbded;}}catch(_0x31a0c5){throw new db[(_0x5b3d('0x5b'))][(_0x5b3d('0x5c'))](_0x5b3d('0x5d'));}return rp(_0x39e925);}else{throw new db[(_0x5b3d('0x5b'))][(_0x5b3d('0x5c'))](_0x5b3d('0x5e'));}})['then'](function(_0xbc6318){_0x54e337=_0xbc6318;if(_0x54e337['id']){var _0x5bdb91={'body':_0x54e337[_0x5b3d('0x5f')],'ChatWebsiteId':_0x565dc4['id'],'ChatInteractionId':_0xdbb00b['id'],'direction':'out','UserId':_0x530ad8[_0x5b3d('0x51')]['id']};return db['ChatMessage'][_0x5b3d('0x46')](_0x5bdb91,{});}else{throw new db[(_0x5b3d('0x5b'))][(_0x5b3d('0x5c'))](_0x5b3d('0x60'));}})[_0x5b3d('0x17')](function(){return _0xdbb00b[_0x5b3d('0x61')]({'vidaooSessionId':_0x54e337['id']});})['then'](respondWithResult(_0x4646b1,null))[_0x5b3d('0x20')](handleError(_0x4646b1,null));};exports[_0x5b3d('0x62')]=function(_0xa9db,_0x2e7af7){if(_0xa9db[_0x5b3d('0x47')]['id']){delete _0xa9db[_0x5b3d('0x47')]['id'];}return db[_0x5b3d('0x34')][_0x5b3d('0x45')]({'where':{'id':_0xa9db[_0x5b3d('0x48')]['id']},'include':[{'model':db[_0x5b3d('0x63')],'as':_0x5b3d('0x64')}]})[_0x5b3d('0x17')](handleEntityNotFound(_0x2e7af7,null))[_0x5b3d('0x17')](saveUpdates(_0xa9db[_0x5b3d('0x47')],null))[_0x5b3d('0x17')](respondWithResult(_0x2e7af7,null))['catch'](handleError(_0x2e7af7,null));};exports[_0x5b3d('0x65')]=function(_0x236284,_0x161c36){if(_0x236284['body']['id']){delete _0x236284['body']['id'];}return db[_0x5b3d('0x34')]['find']({'where':{'id':_0x236284[_0x5b3d('0x48')]['id']}})[_0x5b3d('0x17')](function(_0x4e9215){if(!_0x4e9215){logger[_0x5b3d('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x5b3d('0x65'),0x194,'entity\x20not\x20found');_0x161c36[_0x5b3d('0x21')](0x194);}else{if(_0x4e9215[_0x5b3d('0x66')]){throw new db['Sequelize'][(_0x5b3d('0x5c'))](_0x5b3d('0x67'));}}return _0x4e9215;})[_0x5b3d('0x17')](function(_0x5ee7ad){if(_0x5ee7ad){return _0x5ee7ad[_0x5b3d('0x2a')]({'closed':_0x236284[_0x5b3d('0x47')][_0x5b3d('0x68')],'disposition':_0x236284['body'][_0x5b3d('0x69')]})[_0x5b3d('0x17')](function(_0x4b7b8b){return _0x4b7b8b;});}})['then'](function(){return respondWithRpcPromise(_0x5b3d('0x6a'),'abandon',_0x236284[_0x5b3d('0x47')],client9004);})['then'](respondWithResult(_0x161c36,null))[_0x5b3d('0x20')](handleError(_0x161c36,null));};exports[_0x5b3d('0x6b')]=function(_0x59fad3,_0x9b3cbd){_0x59fad3['body']['name']=_0x59fad3[_0x5b3d('0x6c')][_0x5b3d('0x6d')];_0x59fad3[_0x5b3d('0x47')]['basename']=_0x59fad3['file'][_0x5b3d('0x6e')];_0x59fad3[_0x5b3d('0x47')][_0x5b3d('0x36')]=_0x59fad3[_0x5b3d('0x6c')]['mimetype'];return db[_0x5b3d('0x6f')][_0x5b3d('0x46')](_0x59fad3[_0x5b3d('0x47')])['then'](respondWithResult(_0x9b3cbd,0xc9))[_0x5b3d('0x20')](handleError(_0x9b3cbd,null));};exports[_0x5b3d('0x70')]=function(_0x451c7a,_0x15012c){return db[_0x5b3d('0x34')][_0x5b3d('0x4b')]({'where':{'id':_0x451c7a['params']['id']},'raw':!![]})[_0x5b3d('0x17')](handleEntityNotFound(_0x15012c,null))['then'](function(_0x50cc07){if(_0x50cc07){if(_0x50cc07[_0x5b3d('0x68')]){return _0x15012c[_0x5b3d('0x22')](0x193)[_0x5b3d('0x24')]({'status':0x193,'message':_0x5b3d('0x71')});}return db[_0x5b3d('0x6f')]['findOne']({'where':{'id':_0x451c7a[_0x5b3d('0x39')][_0x5b3d('0x72')]},'raw':!![]})['then'](handleEntityNotFound(_0x15012c,null));}})[_0x5b3d('0x17')](function(_0x5d74f4){if(_0x5d74f4){var _0x58a693=_0x5d74f4[_0x5b3d('0x73')]!==null;var _0x451b85=path[_0x5b3d('0x74')](config[_0x5b3d('0x75')],_0x5b3d('0x76'));if(_0x58a693){_0x451b85=path['join'](_0x451b85,_0x5b3d('0x77'));}var _0x50ce64=path['join'](_0x451b85,_0x5d74f4[_0x5b3d('0x78')]);return _0x15012c['download'](_0x50ce64);}})[_0x5b3d('0x20')](handleError(_0x15012c,null));};exports[_0x5b3d('0x79')]=function(_0x393cf6,_0x3895ec){var _0x2d4d39=null;var _0x4e396c=null;var _0x20b39f=null;if(_0x393cf6['body']['id']){delete _0x393cf6[_0x5b3d('0x47')]['id'];}if(_0x393cf6[_0x5b3d('0x47')][_0x5b3d('0x7a')]){_0x20b39f=path[_0x5b3d('0x74')](config['root'],_0x5b3d('0x7b'),util[_0x5b3d('0x7c')](_0x5b3d('0x7d'),Date[_0x5b3d('0x7e')]()));_0x393cf6[_0x5b3d('0x47')][_0x5b3d('0x7f')]=_0x20b39f;}return db[_0x5b3d('0x34')][_0x5b3d('0x45')]({'where':{'id':_0x393cf6[_0x5b3d('0x48')]['id']},'include':[{'model':db[_0x5b3d('0x80')],'as':_0x5b3d('0x81'),'include':[{'model':db[_0x5b3d('0x82')],'as':_0x5b3d('0x82')}]}]})['then'](handleEntityNotFound(_0x3895ec,null))[_0x5b3d('0x17')](saveUpdates(_0x393cf6['body'],null))[_0x5b3d('0x17')](function(_0xb03dfa){if(_0xb03dfa){_0x2d4d39=_0xb03dfa;return db['ChatWebsite'][_0x5b3d('0x45')]({'where':{'id':_0x2d4d39[_0x5b3d('0x83')]}});}})[_0x5b3d('0x17')](function(_0xfab778){if(_0xfab778){_0x4e396c=_0xfab778;return db[_0x5b3d('0x63')][_0x5b3d('0x45')]({'where':{'id':_0x2d4d39['ContactId']}});}})[_0x5b3d('0x17')](function(_0x2cb7e2){if(_0x2cb7e2){if(_0x20b39f){var _0x4b753f=null;for(var _0x4072c7=0x1;_0x4072c7<_0x2d4d39[_0x5b3d('0x81')][_0x5b3d('0x41')];++_0x4072c7){_0x4b753f=_0x2d4d39['Messages'][_0x4072c7];var _0x58bec4=_0x4b753f['UserId']?util[_0x5b3d('0x7c')](_0x5b3d('0x84'),_0x4e396c[_0x5b3d('0x85')],_0x4b753f[_0x5b3d('0x66')]):_0x5b3d('0x86');var _0x2afd35=_0x393cf6[_0x5b3d('0x47')][_0x5b3d('0x87')]||util[_0x5b3d('0x7c')](_0x5b3d('0x84'),'Visitor',_0x4b753f[_0x5b3d('0x88')]);switch(_0x4e396c[_0x5b3d('0x89')]){case _0x5b3d('0x8a'):_0x58bec4=_0x4b753f[_0x5b3d('0x66')]?util[_0x5b3d('0x7c')](_0x5b3d('0x84'),_0x4e396c[_0x5b3d('0x85')],_0x4b753f[_0x5b3d('0x66')]):'System';break;case _0x5b3d('0x8b'):_0x58bec4=_0x4b753f[_0x5b3d('0x66')]?_0x4b753f['User']['alias']||_0x4b753f['User'][_0x5b3d('0x52')]:_0x5b3d('0x86');break;case _0x5b3d('0x8c'):_0x58bec4=_0x4b753f[_0x5b3d('0x66')]?_0x4b753f['User'][_0x5b3d('0x52')]:_0x5b3d('0x86');break;default:_0x58bec4=_0x4b753f['UserId']?util[_0x5b3d('0x7c')](_0x5b3d('0x84'),_0x4e396c[_0x5b3d('0x85')],_0x4b753f['UserId']):_0x5b3d('0x86');}var _0x2f9312=util[_0x5b3d('0x7c')](_0x5b3d('0x8d'),moment(_0x4b753f[_0x5b3d('0x8e')])[_0x5b3d('0x7c')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4b753f[_0x5b3d('0x8f')]==='in'?_0x2afd35:_0x58bec4,_0x4b753f[_0x5b3d('0x47')]);if(!_0x4b753f[_0x5b3d('0x90')]){fs[_0x5b3d('0x91')](_0x20b39f,_0x2f9312);}}return db[_0x5b3d('0x92')][_0x5b3d('0x4b')]({'where':{'service':!![]},'include':[{'model':db[_0x5b3d('0x93')],'as':_0x5b3d('0x94'),'raw':!![],'include':[{'model':db[_0x5b3d('0x95')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x5b3d('0x17')](function(_0x4aff89){if(!_0x4aff89||!_0x4aff89[_0x5b3d('0x94')]||!_0x393cf6[_0x5b3d('0x47')])return _0x2d4d39;var _0x2f88cc=_0x4aff89[_0x5b3d('0x96')]();return respondWithRpcPromise('SendMail',_0x5b3d('0x97'),{'account':_0x2f88cc,'message':{'from':util[_0x5b3d('0x7c')](_0x5b3d('0x98'),_0x4aff89[_0x5b3d('0x2d')],_0x4aff89['email']||_0x4aff89[_0x5b3d('0x94')][_0x5b3d('0x51')]),'to':_0x393cf6[_0x5b3d('0x47')][_0x5b3d('0x7a')],'subject':_0x5b3d('0x99'),'text':util[_0x5b3d('0x7c')](_0x5b3d('0x9a'),_0x393cf6[_0x5b3d('0x47')][_0x5b3d('0x7a')]),'attachments':[{'path':_0x20b39f}]}})['then'](function(){return _0x2d4d39;})[_0x5b3d('0x20')](function(_0x1a0da7){logger[_0x5b3d('0x1c')](_0x1a0da7);});})[_0x5b3d('0x17')](respondWithStatusCode(_0x3895ec,0xc8))[_0x5b3d('0x20')](handleError(_0x3895ec,null));};exports[_0x5b3d('0x9b')]=function(_0x729f4d,_0x2cd021){return db['ChatMessage'][_0x5b3d('0x45')]({'where':{'id':_0x729f4d['params']['id']}})['then'](handleEntityNotFound(_0x2cd021,null))[_0x5b3d('0x17')](function(_0x2b9c7b){if(_0x2b9c7b){return _0x2b9c7b[_0x5b3d('0x9b')](_0x729f4d[_0x5b3d('0x47')][_0x5b3d('0x9c')],_[_0x5b3d('0x9d')](_0x729f4d[_0x5b3d('0x47')],['ids','id'])||{});}})[_0x5b3d('0x17')](respondWithResult(_0x2cd021,null))['catch'](handleError(_0x2cd021,null));};exports[_0x5b3d('0x9e')]=function(_0x3d9e14,_0x413c49){var _0x9daf4a={'raw':![],'where':{}};var _0x53da44={};var _0x3c96be={'count':0x0,'rows':[]};return db[_0x5b3d('0x34')][_0x5b3d('0x4b')]({'where':{'id':_0x3d9e14[_0x5b3d('0x48')]['id']}})[_0x5b3d('0x17')](handleEntityNotFound(_0x413c49,null))[_0x5b3d('0x17')](function(_0x4d8c79){if(_0x4d8c79){_0x53da44[_0x5b3d('0x42')]=_[_0x5b3d('0x3c')](db[_0x5b3d('0x80')][_0x5b3d('0x3b')]);_0x53da44[_0x5b3d('0x39')]=_[_0x5b3d('0x3c')](_0x3d9e14[_0x5b3d('0x39')]);_0x53da44[_0x5b3d('0x3d')]=_[_0x5b3d('0x3e')](_0x53da44[_0x5b3d('0x42')],_0x53da44[_0x5b3d('0x39')]);_0x9daf4a[_0x5b3d('0x3f')]=_[_0x5b3d('0x3e')](_0x53da44[_0x5b3d('0x42')],qs[_0x5b3d('0x40')](_0x3d9e14['query'][_0x5b3d('0x40')]));_0x9daf4a[_0x5b3d('0x3f')]=_0x9daf4a[_0x5b3d('0x3f')][_0x5b3d('0x41')]?_0x9daf4a['attributes']:_0x53da44[_0x5b3d('0x42')];if(!_0x3d9e14[_0x5b3d('0x39')][_0x5b3d('0x9f')](_0x5b3d('0xa0'))){_0x9daf4a[_0x5b3d('0x26')]=qs['limit'](_0x3d9e14['query'][_0x5b3d('0x26')]);_0x9daf4a[_0x5b3d('0x25')]=qs[_0x5b3d('0x25')](_0x3d9e14[_0x5b3d('0x39')][_0x5b3d('0x25')]);}_0x9daf4a[_0x5b3d('0xa1')]=qs['sort'](_0x3d9e14[_0x5b3d('0x39')][_0x5b3d('0xa2')]);_0x9daf4a['where']=qs[_0x5b3d('0x3d')](_[_0x5b3d('0xa3')](_0x3d9e14[_0x5b3d('0x39')],_0x53da44[_0x5b3d('0x3d')]));_0x9daf4a['where'][_0x5b3d('0xa4')]=_0x4d8c79['id'];if(_0x3d9e14[_0x5b3d('0x39')]['filter']){_0x9daf4a['where']=_[_0x5b3d('0x2f')](_0x9daf4a['where'],{'$or':_[_0x5b3d('0x33')](_0x9daf4a[_0x5b3d('0x3f')],function(_0x4b5732){var _0x1c9775={};_0x1c9775[_0x4b5732]={'$like':'%'+_0x3d9e14[_0x5b3d('0x39')][_0x5b3d('0xa5')]+'%'};return _0x1c9775;})});}if(_0x3d9e14[_0x5b3d('0x39')][_0x5b3d('0xa6')]){var _0x5a3599=_0x3d9e14[_0x5b3d('0x39')][_0x5b3d('0xa6')][_0x5b3d('0xa7')](',');var _0x31b891={};_0x31b891[_0x5a3599[0x0]]={'$gte':moment(_0x5a3599[0x1])['format'](_0x5b3d('0xa8'))};_0x9daf4a[_0x5b3d('0xa9')]=_[_0x5b3d('0x2f')](_0x9daf4a[_0x5b3d('0xa9')],_0x31b891);}_0x9daf4a=_['merge']({},_0x9daf4a,_0x3d9e14['options']);return db['ChatMessage'][_0x5b3d('0x28')]({'where':_0x9daf4a[_0x5b3d('0xa9')]})[_0x5b3d('0x17')](function(_0x311ac9){_0x3c96be[_0x5b3d('0x28')]=_0x311ac9;if(_0x3d9e14[_0x5b3d('0x39')][_0x5b3d('0x43')]){_0x9daf4a[_0x5b3d('0x44')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x9daf4a);})[_0x5b3d('0x17')](function(_0x166ce8){_0x3c96be[_0x5b3d('0xaa')]=_0x166ce8;return _0x3c96be;});}})[_0x5b3d('0x17')](respondWithFilteredResult(_0x413c49,_0x9daf4a))[_0x5b3d('0x20')](handleError(_0x413c49,null));};exports[_0x5b3d('0xab')]=function(_0x47d2b4,_0x1f5f76){var _0x1ebc68={'where':{}},_0x40f67d={},_0x3cfedd={'count':0x0,'rows':[]};return db[_0x5b3d('0x34')]['findOne']({'where':{'id':_0x47d2b4[_0x5b3d('0x48')]['id']}})[_0x5b3d('0x17')](handleEntityNotFound(_0x1f5f76,null))[_0x5b3d('0x17')](function(_0x2b99e3){if(_0x2b99e3){_0x40f67d[_0x5b3d('0x42')]=_[_0x5b3d('0x3c')](db[_0x5b3d('0x80')][_0x5b3d('0x3b')]);_0x40f67d['query']=_[_0x5b3d('0x3c')](_0x47d2b4[_0x5b3d('0x39')]);_0x40f67d[_0x5b3d('0x3d')]=_[_0x5b3d('0x3e')](_0x40f67d[_0x5b3d('0x42')],_0x40f67d[_0x5b3d('0x39')]);_0x1ebc68[_0x5b3d('0x3f')]=_[_0x5b3d('0x3e')](_0x40f67d['model'],qs['fields'](_0x47d2b4[_0x5b3d('0x39')][_0x5b3d('0x40')]));_0x1ebc68[_0x5b3d('0x3f')]=_0x1ebc68[_0x5b3d('0x3f')][_0x5b3d('0x41')]?_0x1ebc68[_0x5b3d('0x3f')]:_0x40f67d['model'];if(!_0x47d2b4[_0x5b3d('0x39')][_0x5b3d('0x9f')](_0x5b3d('0xa0'))){_0x1ebc68[_0x5b3d('0x26')]=qs[_0x5b3d('0x26')](_0x47d2b4[_0x5b3d('0x39')][_0x5b3d('0x26')]);_0x1ebc68[_0x5b3d('0x25')]=qs['offset'](_0x47d2b4[_0x5b3d('0x39')][_0x5b3d('0x25')]);}_0x1ebc68[_0x5b3d('0xa1')]=qs[_0x5b3d('0xa2')](_0x47d2b4[_0x5b3d('0x39')][_0x5b3d('0xa2')]);_0x1ebc68[_0x5b3d('0xa9')]=qs[_0x5b3d('0x3d')](_[_0x5b3d('0xa3')](_0x47d2b4['query'],_0x40f67d['filters']));_0x1ebc68['where'][_0x5b3d('0xa4')]=_0x2b99e3['id'];if(_0x47d2b4[_0x5b3d('0x39')]['filter']){_0x1ebc68[_0x5b3d('0xa9')]=_[_0x5b3d('0x2f')](_0x1ebc68[_0x5b3d('0xa9')],{'$or':_[_0x5b3d('0x33')](_0x1ebc68[_0x5b3d('0x3f')],function(_0xd2e747){var _0x3432e0={};_0x3432e0[_0xd2e747]={'$like':'%'+_0x47d2b4[_0x5b3d('0x39')][_0x5b3d('0xa5')]+'%'};return _0x3432e0;})});}_0x1ebc68[_0x5b3d('0xa9')][_0x5b3d('0x90')]=![];if(_0x47d2b4['query']['id']){_0x1ebc68[_0x5b3d('0xa9')]['id']={'$gt':_0x47d2b4[_0x5b3d('0x39')]['id']};}_0x1ebc68=_[_0x5b3d('0x2f')]({},_0x1ebc68,_0x47d2b4[_0x5b3d('0xac')]);return db[_0x5b3d('0x80')][_0x5b3d('0x28')]({'where':_0x1ebc68['where']})[_0x5b3d('0x17')](function(_0x180b79){_0x3cfedd[_0x5b3d('0x28')]=_0x180b79;_0x1ebc68[_0x5b3d('0x44')]=[];if(_0x47d2b4['query'][_0x5b3d('0xad')]){_0x1ebc68['include'][_0x5b3d('0xae')]({'model':db['User'],'as':_0x5b3d('0x82'),'attributes':['id','fullname','alias']});}if(_0x47d2b4[_0x5b3d('0x39')][_0x5b3d('0x43')]){_0x1ebc68[_0x5b3d('0x44')]=[{'all':!![]}];}return db[_0x5b3d('0x80')][_0x5b3d('0x37')](_0x1ebc68);})['then'](function(_0x1ca068){_0x3cfedd[_0x5b3d('0xaa')]=_0x1ca068;return _0x3cfedd;});}})['then'](respondWithFilteredResult(_0x1f5f76,_0x1ebc68))[_0x5b3d('0x20')](handleError(_0x1f5f76,null));};exports[_0x5b3d('0xaf')]=function(_0x59ac03,_0x59c168){return db[_0x5b3d('0x34')][_0x5b3d('0x45')]({'where':{'id':_0x59ac03['params']['id']}})[_0x5b3d('0x17')](handleEntityNotFound(_0x59c168,null))[_0x5b3d('0x17')](function(_0x3f74a8){if(_0x3f74a8){return _0x3f74a8[_0x5b3d('0xb0')](_0x59ac03[_0x5b3d('0x47')][_0x5b3d('0x9c')],_[_0x5b3d('0x9d')](_0x59ac03[_0x5b3d('0x47')],[_0x5b3d('0x9c'),'id'])||{})['spread'](function(){return db[_0x5b3d('0xb1')][_0x5b3d('0x37')]({'attributes':['id',_0x5b3d('0x2d'),'color'],'where':{'id':_0x59ac03[_0x5b3d('0x47')][_0x5b3d('0x9c')]}});})[_0x5b3d('0x17')](function(_0xc05afc){socket[_0x5b3d('0xb2')]('chatInteractionTags:save',{'id':Number(_0x59ac03[_0x5b3d('0x48')]['id']),'tags':_0xc05afc||[]});return{'id':Number(_0x59ac03[_0x5b3d('0x48')]['id']),'tags':_0xc05afc||[]};});}})[_0x5b3d('0x17')](respondWithResult(_0x59c168,null))['catch'](handleError(_0x59c168,null));};exports[_0x5b3d('0xb3')]=function(_0x1b2a1d,_0x577272){return db[_0x5b3d('0x34')]['find']({'where':{'id':_0x1b2a1d['params']['id']}})['then'](handleEntityNotFound(_0x577272,null))[_0x5b3d('0x17')](function(_0x274ce7){if(_0x274ce7){return _0x274ce7['removeTags'](_0x1b2a1d[_0x5b3d('0x39')][_0x5b3d('0x9c')]);}})[_0x5b3d('0x17')](respondWithStatusCode(_0x577272,null))[_0x5b3d('0x20')](handleError(_0x577272,null));};exports['download']=function(_0xb48870,_0x3a6f8b){var _0x1e47d9=moment()[_0x5b3d('0xb4')]()[_0x5b3d('0xb5')]();var _0x31b433=path[_0x5b3d('0x74')](config[_0x5b3d('0x75')],_0x5b3d('0xb6'),_0x5b3d('0xb7'),'tmp');var _0x1be324=path[_0x5b3d('0x74')](config[_0x5b3d('0x75')],_0x5b3d('0xb6'),_0x5b3d('0xb7'),_0x5b3d('0xb8'));var _0x1d75c8=path[_0x5b3d('0x74')](_0x31b433,_0x1e47d9);var _0x4ebbd7=util[_0x5b3d('0x7c')](_0x5b3d('0xb9'),_0xb48870[_0x5b3d('0x48')]['id'],_0x1e47d9);var _0xa7d267=path[_0x5b3d('0x74')](_0x31b433,_0x4ebbd7);var _0x25b03b=[];_0x25b03b[_0x5b3d('0xae')]({'model':db[_0x5b3d('0x82')],'as':_0x5b3d('0x82'),'attributes':['id',_0x5b3d('0x52')],'raw':!![]});_0x25b03b[_0x5b3d('0xae')]({'model':db[_0x5b3d('0x63')],'as':_0x5b3d('0x64'),'attributes':['id',_0x5b3d('0xba'),'lastName'],'raw':!![]});if(_0xb48870[_0x5b3d('0x39')][_0x5b3d('0xb8')]){_0x25b03b[_0x5b3d('0xae')]({'model':db['Attachment'],'as':_0x5b3d('0x6f'),'raw':!![]});}var _0x475849=[{'model':db[_0x5b3d('0x80')],'as':_0x5b3d('0x81'),'attributes':['id',_0x5b3d('0x47'),'createdAt',_0x5b3d('0x8f'),_0x5b3d('0x90'),_0x5b3d('0xbb')],'include':_0x25b03b}];_0x475849[_0x5b3d('0xae')]({'model':db[_0x5b3d('0x4c')],'as':_0x5b3d('0xbc'),'attributes':['id',_0x5b3d('0x2d')]});_0x475849[_0x5b3d('0xae')]({'model':db['User'],'as':_0x5b3d('0xbd'),'attributes':['id','fullname']});return db[_0x5b3d('0x34')]['find']({'where':{'id':_0xb48870['params']['id']},'include':_0x475849})[_0x5b3d('0x17')](handleEntityNotFound(_0x3a6f8b,null))['then'](function(_0x3ef12d){if(_0x3ef12d){var _0x1315bf=_0x3ef12d[_0x5b3d('0xbe')]({'plain':!![]});fs['mkdirSync'](_0x1d75c8);var _0x33a60d={'channel':_0x5b3d('0xbf'),'account':_0x1315bf['Account']['name'],'agent':_0x1315bf[_0x5b3d('0xbd')]?_0x1315bf[_0x5b3d('0xbd')]['fullname']:'N.A.','createdAt':moment(_0x1315bf[_0x5b3d('0x8e')])[_0x5b3d('0x7c')](_0x5b3d('0xa8'))[_0x5b3d('0xb5')](),'closedAt':_0x1315bf[_0x5b3d('0x68')]?moment(_0x1315bf['closedAt'])['format'](_0x5b3d('0xa8'))[_0x5b3d('0xb5')]():'','disposition':_0x1315bf['disposition'],'chatInfo':{'browser':_0x1315bf[_0x5b3d('0xc0')],'os':_0x1315bf[_0x5b3d('0xc1')],'referer':_0x1315bf[_0x5b3d('0xc2')],'customerIp':_0x1315bf[_0x5b3d('0xc3')],'customerPort':_0x1315bf[_0x5b3d('0xc4')]?_0x1315bf['customerPort']:_0x5b3d('0xc5')},'messages':_(_0x1315bf[_0x5b3d('0x81')])[_0x5b3d('0xc6')]()[_0x5b3d('0xa5')]({'secret':![]})[_0x5b3d('0x33')](function(_0x3ae514){if(_0x3ae514[_0x5b3d('0x6f')]){var _0x3b4d2d=path[_0x5b3d('0x74')](_0x1be324,_0x3ae514[_0x5b3d('0x6f')][_0x5b3d('0x78')]);if(fs['existsSync'](_0x3b4d2d)){fs[_0x5b3d('0xc7')](_0x3b4d2d)[_0x5b3d('0xc8')](fs[_0x5b3d('0xc9')](path[_0x5b3d('0x74')](_0x1d75c8,_0x3ae514[_0x5b3d('0x6f')][_0x5b3d('0x78')])));}}return{'date':moment(_0x3ae514[_0x5b3d('0x8e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5b3d('0xb5')](),'sender':_0x3ae514['direction']==='out'?_0x3ae514[_0x5b3d('0x82')]?_0x3ae514[_0x5b3d('0x82')][_0x5b3d('0x52')]:_0x5b3d('0x86'):_0x3ae514[_0x5b3d('0x64')][_0x5b3d('0xba')]+(_0x3ae514['Contact'][_0x5b3d('0xca')]?'\x20'+_0x3ae514[_0x5b3d('0x64')][_0x5b3d('0xca')]:''),'body':_0x3ae514['Attachment']?_0x3ae514[_0x5b3d('0x6f')][_0x5b3d('0x78')]:_0x3ae514['body'],'direction':_0x3ae514[_0x5b3d('0x8f')]===_0x5b3d('0xcb')?'A':'C','secret':_0x3ae514[_0x5b3d('0x90')],'read':_0x3ae514[_0x5b3d('0xbb')],'attachment':_0x3ae514['Attachment']};})[_0x5b3d('0xcc')]()};return ejs[_0x5b3d('0xcd')](path[_0x5b3d('0x74')](config[_0x5b3d('0x75')],_0x5b3d('0xb6'),_0x5b3d('0xce'),'downloadInteraction.ejs'),{'interaction':_0x33a60d})[_0x5b3d('0x17')](function(_0x1fae5f){var _0x3c25e4=path['join'](_0x1d75c8,_0x5b3d('0xcf')+_0x1315bf['id']+'-'+_0x1e47d9+_0x5b3d('0xd0'));var _0x2a4335={'path':_0x3c25e4,'channel':'Chat','interactionId':_0x1315bf['id']};return pdf[_0x5b3d('0xd1')](_0x1fae5f,_0x2a4335);})[_0x5b3d('0x17')](function(){return new Promise(function(_0x83ef50,_0x5c5297){zipdir(_0x1d75c8,{'saveTo':_0xa7d267},function(_0x2f504d,_0x1a72bd){if(_0x2f504d)return _0x5c5297(_0x2f504d);return _0x83ef50(_0x1a72bd);});})['then'](function(){return new BPromise(function(_0x50b101,_0x3348af){rimraf(_0x1d75c8,function(_0x49e252){if(_0x49e252)_0x3348af(_0x49e252);return _0x50b101();});});})[_0x5b3d('0x17')](function(){return _0x3a6f8b[_0x5b3d('0xd2')](_0xa7d267,_0x4ebbd7,function(_0x2f2264){if(_0x2f2264){logger[_0x5b3d('0x1c')](_0x5b3d('0xd3'),_0x2f2264);}else{fs['unlinkSync'](_0xa7d267);}});});});}else{return _0x3a6f8b[_0x5b3d('0x21')](0xc8);}})[_0x5b3d('0x20')](handleError(_0x3a6f8b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 47028f8..781e65a 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 _0xb6c0=['setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','../../mysqldb','ChatMessage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb6c0,0x139));var _0x0b6c=function(_0x116b1a,_0x224d8d){_0x116b1a=_0x116b1a-0x0;var _0x426eb7=_0xb6c0[_0x116b1a];return _0x426eb7;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x0b6c('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x0b6c('0x0'))['db'][_0x0b6c('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0b6c('0x2')](0x0);var events={'afterCreate':_0x0b6c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x549346){return function(_0x3b5ee6,_0x2adf89,_0x3ff995){_0x3b5ee6[_0x0b6c('0x4')]({'attributes':['id'],'raw':!![]})[_0x0b6c('0x5')](function(_0x23b5a1){_0x3b5ee6[_0x0b6c('0x6')](_0x0b6c('0x7'),_0x23b5a1[_0x0b6c('0x8')](function(_0x2737e4){return{'id':_0x2737e4['id']};}));return ChatMessage[_0x0b6c('0x9')]({'where':{'ChatInteractionId':_0x3b5ee6['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x471b96){_0x3b5ee6[_0x0b6c('0x6')](_0x0b6c('0xa'),_0x471b96[_0x0b6c('0xb')]);ChatInteractionEvents[_0x0b6c('0xc')](_0x549346+':'+_0x3b5ee6['id'],_0x3b5ee6);ChatInteractionEvents[_0x0b6c('0xc')](_0x549346,_0x3b5ee6);_0x3ff995(null);})['catch'](_0x3ff995(null));};}for(var e in events){if(events[_0x0b6c('0xd')](e)){var event=events[e];ChatInteraction[_0x0b6c('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xb47a=['map','setDataValue','unreadMessages','length','catch','events','../../mysqldb','ChatInteraction','update','remove','getUsers','then','Users'];(function(_0x45d879,_0x4e1f98){var _0x4241b9=function(_0x4e823d){while(--_0x4e823d){_0x45d879['push'](_0x45d879['shift']());}};_0x4241b9(++_0x4e1f98);}(_0xb47a,0x87));var _0xab47=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xb47a[_0x15c421];return _0x5e5ed5;};'use strict';var EventEmitter=require(_0xab47('0x0'));var ChatInteraction=require(_0xab47('0x1'))['db'][_0xab47('0x2')];var ChatMessage=require(_0xab47('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xab47('0x3'),'afterDestroy':_0xab47('0x4')};function emitEvent(_0x56b568){return function(_0x43c313,_0x3a85ed,_0x17d981){_0x43c313[_0xab47('0x5')]({'attributes':['id'],'raw':!![]})[_0xab47('0x6')](function(_0x55a1a0){_0x43c313['setDataValue'](_0xab47('0x7'),_0x55a1a0[_0xab47('0x8')](function(_0x1338ab){return{'id':_0x1338ab['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x43c313['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1dad72){_0x43c313[_0xab47('0x9')](_0xab47('0xa'),_0x1dad72[_0xab47('0xb')]);ChatInteractionEvents['emit'](_0x56b568+':'+_0x43c313['id'],_0x43c313);ChatInteractionEvents['emit'](_0x56b568,_0x43c313);_0x17d981(null);})[_0xab47('0xc')](_0x17d981(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 003b7b9..1b53e60 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 _0x8587=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x8587,0x12f));var _0x7858=function(_0x31f2dc,_0x4b13bd){_0x31f2dc=_0x31f2dc-0x0;var _0x2359b2=_0x8587[_0x31f2dc];return _0x2359b2;};'use strict';var _=require(_0x7858('0x0'));var util=require(_0x7858('0x1'));var logger=require(_0x7858('0x2'))(_0x7858('0x3'));var moment=require(_0x7858('0x4'));var BPromise=require(_0x7858('0x5'));var rp=require(_0x7858('0x6'));var fs=require('fs');var path=require(_0x7858('0x7'));var rimraf=require(_0x7858('0x8'));var config=require(_0x7858('0x9'));var attributes=require('./chatInteraction.attributes');module[_0x7858('0xa')]=function(_0x4d2fbf,_0x4ae348){return _0x4d2fbf[_0x7858('0xb')]('ChatInteraction',attributes,{'tableName':_0x7858('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b48c2,_0x27410e,_0x31072d){if(_0x4b48c2[_0x7858('0xd')](_0x7858('0xe'))){_0x4b48c2[_0x7858('0xf')]=moment()[_0x7858('0x10')](_0x7858('0x11'));}_0x31072d(null,_0x4b48c2);}},'charset':'utf8mb4','collate':_0x7858('0x12')});}; \ No newline at end of file +var _0x2cea=['define','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0xc38896,_0x25bd37){var _0x17a257=function(_0x50f38e){while(--_0x50f38e){_0xc38896['push'](_0xc38896['shift']());}};_0x17a257(++_0x25bd37);}(_0x2cea,0x1b9));var _0xa2ce=function(_0x1081a3,_0x2ac784){_0x1081a3=_0x1081a3-0x0;var _0x5696a2=_0x2cea[_0x1081a3];return _0x5696a2;};'use strict';var _=require(_0xa2ce('0x0'));var util=require(_0xa2ce('0x1'));var logger=require(_0xa2ce('0x2'))(_0xa2ce('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2ce('0x4'));var rimraf=require(_0xa2ce('0x5'));var config=require(_0xa2ce('0x6'));var attributes=require(_0xa2ce('0x7'));module[_0xa2ce('0x8')]=function(_0x36e982,_0x427ee6){return _0x36e982[_0xa2ce('0x9')](_0xa2ce('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x33eb70,_0x480ffb,_0x479b82){if(_0x33eb70[_0xa2ce('0xb')](_0xa2ce('0xc'))){_0x33eb70[_0xa2ce('0xd')]=moment()[_0xa2ce('0xe')](_0xa2ce('0xf'));}_0x479b82(null,_0x33eb70);}},'charset':_0xa2ce('0x10'),'collate':_0xa2ce('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index ddd3347..ff1aa22 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 _0x9799=['where','addTags','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','attributes','limit','AddTagsToChatInteraction','find'];(function(_0x98d0d,_0x3b80af){var _0x4f382f=function(_0x599a96){while(--_0x599a96){_0x98d0d['push'](_0x98d0d['shift']());}};_0x4f382f(++_0x3b80af);}(_0x9799,0xad));var _0x9979=function(_0x19e0a8,_0x5a01a1){_0x19e0a8=_0x19e0a8-0x0;var _0xb909de=_0x9799[_0x19e0a8];return _0xb909de;};'use strict';var _=require(_0x9979('0x0'));var util=require(_0x9979('0x1'));var moment=require('moment');var BPromise=require(_0x9979('0x2'));var rs=require(_0x9979('0x3'));var fs=require('fs');var Redis=require(_0x9979('0x4'));var db=require(_0x9979('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9979('0x6'))(_0x9979('0x7'));var config=require(_0x9979('0x8'));var jayson=require(_0x9979('0x9'));var client=jayson[_0x9979('0xa')][_0x9979('0xb')]({'port':0x232a});config[_0x9979('0xc')]=_['defaults'](config[_0x9979('0xc')],{'host':_0x9979('0xd'),'port':0x18eb});var socket=require(_0x9979('0xe'))(new Redis(config[_0x9979('0xc')]));require(_0x9979('0xf'))[_0x9979('0x10')](socket);function respondWithRpcPromise(_0x18b638,_0x220d31,_0x4ed791){return new BPromise(function(_0x21bdca,_0x406746){return client[_0x9979('0x11')](_0x18b638,_0x4ed791)[_0x9979('0x12')](function(_0x5bfd7b){logger[_0x9979('0x13')](_0x9979('0x14'),_0x220d31,_0x9979('0x15'));logger[_0x9979('0x16')](_0x9979('0x17'),_0x220d31,_0x9979('0x15'),JSON[_0x9979('0x18')](_0x5bfd7b));if(_0x5bfd7b[_0x9979('0x19')]){if(_0x5bfd7b[_0x9979('0x19')]['code']===0x1f4){logger[_0x9979('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x220d31,_0x5bfd7b[_0x9979('0x19')][_0x9979('0x1a')]);return _0x406746(_0x5bfd7b[_0x9979('0x19')]['message']);}logger[_0x9979('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x220d31,_0x5bfd7b[_0x9979('0x19')][_0x9979('0x1a')]);return _0x21bdca(_0x5bfd7b[_0x9979('0x19')][_0x9979('0x1a')]);}else{logger[_0x9979('0x13')](_0x9979('0x14'),_0x220d31,_0x9979('0x15'));_0x21bdca(_0x5bfd7b['result'][_0x9979('0x1a')]);}})[_0x9979('0x1b')](function(_0x3cba0b){logger[_0x9979('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x220d31,_0x3cba0b);_0x406746(_0x3cba0b);});});}exports[_0x9979('0x1c')]=function(_0x200a3f){var _0x9a8948=this;return new Promise(function(_0x44afc9,_0x3ea334){return db[_0x9979('0x1d')]['update'](_0x200a3f[_0x9979('0x1e')],{'raw':_0x200a3f[_0x9979('0x1f')]?_0x200a3f['options'][_0x9979('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x200a3f['options']?_0x200a3f[_0x9979('0x1f')]['where']||null:null,'attributes':_0x200a3f['options']?_0x200a3f[_0x9979('0x1f')][_0x9979('0x21')]||null:null,'limit':_0x200a3f[_0x9979('0x1f')]?_0x200a3f[_0x9979('0x1f')][_0x9979('0x22')]||null:null})[_0x9979('0x12')](function(_0x528ccc){logger[_0x9979('0x13')]('UpdateChatInteraction',_0x200a3f);logger['debug'](_0x9979('0x1c'),_0x200a3f,JSON[_0x9979('0x18')](_0x528ccc));_0x44afc9(_0x528ccc);})[_0x9979('0x1b')](function(_0x308c6b){logger[_0x9979('0x19')](_0x9979('0x1c'),_0x308c6b['message'],_0x200a3f);_0x3ea334(_0x9a8948[_0x9979('0x19')](0x1f4,_0x308c6b[_0x9979('0x1a')]));});});};exports[_0x9979('0x23')]=function(_0x549d48){return new Promise(function(_0x469f2f,_0x32baf9){return db['ChatInteraction'][_0x9979('0x24')]({'where':_0x549d48[_0x9979('0x1f')]?_0x549d48[_0x9979('0x1f')][_0x9979('0x25')]||null:null})[_0x9979('0x12')](function(_0x3bef78){if(_0x3bef78){return _0x3bef78[_0x9979('0x26')](_0x549d48[_0x9979('0x1e')]['ids'],_[_0x9979('0x27')](_0x549d48[_0x9979('0x1e')],['ids','id'])||{});}})[_0x9979('0x28')](function(_0x380e56){logger[_0x9979('0x13')](_0x9979('0x29'),_0x549d48);logger['debug'](_0x9979('0x29'),_0x549d48,JSON[_0x9979('0x18')](_0x380e56));_0x469f2f(_0x380e56);})['catch'](function(_0x5863be){logger[_0x9979('0x19')]('AddTags',_0x5863be['message'],_0x549d48);_0x32baf9(_this[_0x9979('0x19')](0x1f4,_0x5863be[_0x9979('0x1a')]));});});}; \ No newline at end of file +var _0xb765=['raw','where','then','stringify','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','request','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options'];(function(_0x4e04a8,_0x2f2d6a){var _0x6c3e6f=function(_0x806cf7){while(--_0x806cf7){_0x4e04a8['push'](_0x4e04a8['shift']());}};_0x6c3e6f(++_0x2f2d6a);}(_0xb765,0x1c1));var _0x5b76=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb765[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x5b76('0x0'));var util=require(_0x5b76('0x1'));var moment=require(_0x5b76('0x2'));var BPromise=require(_0x5b76('0x3'));var rs=require(_0x5b76('0x4'));var fs=require('fs');var Redis=require(_0x5b76('0x5'));var db=require(_0x5b76('0x6'))['db'];var utils=require(_0x5b76('0x7'));var logger=require('../../config/logger')(_0x5b76('0x8'));var config=require('../../config/environment');var jayson=require(_0x5b76('0x9'));var client=jayson['client'][_0x5b76('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5b76('0xb')],{'host':_0x5b76('0xc'),'port':0x18eb});var socket=require(_0x5b76('0xd'))(new Redis(config['redis']));require(_0x5b76('0xe'))['register'](socket);function respondWithRpcPromise(_0x284e7e,_0x26ab1b,_0xfc0fb9){return new BPromise(function(_0x1a2567,_0x3e1c09){return client[_0x5b76('0xf')](_0x284e7e,_0xfc0fb9)['then'](function(_0x470452){logger[_0x5b76('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x26ab1b,'request\x20sent');logger[_0x5b76('0x11')](_0x5b76('0x12'),_0x26ab1b,_0x5b76('0x13'),JSON['stringify'](_0x470452));if(_0x470452['error']){if(_0x470452[_0x5b76('0x14')][_0x5b76('0x15')]===0x1f4){logger[_0x5b76('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x26ab1b,_0x470452[_0x5b76('0x14')][_0x5b76('0x16')]);return _0x3e1c09(_0x470452[_0x5b76('0x14')]['message']);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x26ab1b,_0x470452[_0x5b76('0x14')][_0x5b76('0x16')]);return _0x1a2567(_0x470452[_0x5b76('0x14')]['message']);}else{logger['info'](_0x5b76('0x17'),_0x26ab1b,_0x5b76('0x13'));_0x1a2567(_0x470452[_0x5b76('0x18')][_0x5b76('0x16')]);}})[_0x5b76('0x19')](function(_0x4b0e76){logger['error'](_0x5b76('0x17'),_0x26ab1b,_0x4b0e76);_0x3e1c09(_0x4b0e76);});});}exports[_0x5b76('0x1a')]=function(_0x43ed88){var _0x1bc0a1=this;return new Promise(function(_0x16bb4d,_0x579883){return db[_0x5b76('0x1b')][_0x5b76('0x1c')](_0x43ed88[_0x5b76('0x1d')],{'raw':_0x43ed88[_0x5b76('0x1e')]?_0x43ed88[_0x5b76('0x1e')][_0x5b76('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43ed88[_0x5b76('0x1e')]?_0x43ed88['options'][_0x5b76('0x20')]||null:null,'attributes':_0x43ed88[_0x5b76('0x1e')]?_0x43ed88[_0x5b76('0x1e')]['attributes']||null:null,'limit':_0x43ed88[_0x5b76('0x1e')]?_0x43ed88[_0x5b76('0x1e')]['limit']||null:null})[_0x5b76('0x21')](function(_0xab747c){logger[_0x5b76('0x10')](_0x5b76('0x1a'),_0x43ed88);logger[_0x5b76('0x11')](_0x5b76('0x1a'),_0x43ed88,JSON[_0x5b76('0x22')](_0xab747c));_0x16bb4d(_0xab747c);})[_0x5b76('0x19')](function(_0x48ed3c){logger[_0x5b76('0x14')](_0x5b76('0x1a'),_0x48ed3c[_0x5b76('0x16')],_0x43ed88);_0x579883(_0x1bc0a1[_0x5b76('0x14')](0x1f4,_0x48ed3c['message']));});});};exports['AddTagsToChatInteraction']=function(_0x43ea44){return new Promise(function(_0x508eaa,_0x54f536){return db[_0x5b76('0x1b')]['find']({'where':_0x43ea44[_0x5b76('0x1e')]?_0x43ea44[_0x5b76('0x1e')][_0x5b76('0x20')]||null:null})[_0x5b76('0x21')](function(_0x3014c8){if(_0x3014c8){return _0x3014c8[_0x5b76('0x23')](_0x43ea44[_0x5b76('0x1d')]['ids'],_[_0x5b76('0x24')](_0x43ea44[_0x5b76('0x1d')],[_0x5b76('0x25'),'id'])||{});}})[_0x5b76('0x26')](function(_0x17084a){logger['info']('AddTags',_0x43ea44);logger[_0x5b76('0x11')](_0x5b76('0x27'),_0x43ea44,JSON[_0x5b76('0x22')](_0x17084a));_0x508eaa(_0x17084a);})['catch'](function(_0x1e3777){logger[_0x5b76('0x14')](_0x5b76('0x27'),_0x1e3777['message'],_0x43ea44);_0x54f536(_this['error'](0x1f4,_0x1e3777[_0x5b76('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0feba9d..7c3c2cc 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 _0xe9b4=['removeListener','length','chatInteraction:','./chatInteraction.events','remove','update','emit'];(function(_0x4f3551,_0x361e66){var _0x4e4979=function(_0x45af3b){while(--_0x45af3b){_0x4f3551['push'](_0x4f3551['shift']());}};_0x4e4979(++_0x361e66);}(_0xe9b4,0x153));var _0x4e9b=function(_0x1ffd29,_0x27ef55){_0x1ffd29=_0x1ffd29-0x0;var _0x249780=_0xe9b4[_0x1ffd29];return _0x249780;};'use strict';var ChatInteractionEvents=require(_0x4e9b('0x0'));var events=['save',_0x4e9b('0x1'),_0x4e9b('0x2')];function createListener(_0x3b6ea7,_0x3cae7b){return function(_0x267703){_0x3cae7b[_0x4e9b('0x3')](_0x3b6ea7,_0x267703);};}function removeListener(_0x30838a,_0x349c32){return function(){ChatInteractionEvents[_0x4e9b('0x4')](_0x30838a,_0x349c32);};}exports['register']=function(_0x1abe7e){for(var _0x114c7e=0x0,_0x3c1a59=events[_0x4e9b('0x5')];_0x114c7e<_0x3c1a59;_0x114c7e++){var _0x3158b6=events[_0x114c7e];var _0x5a76e1=createListener(_0x4e9b('0x6')+_0x3158b6,_0x1abe7e);ChatInteractionEvents['on'](_0x3158b6,_0x5a76e1);}}; \ No newline at end of file +var _0x91e3=['remove','update','removeListener','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x1d0aee,_0x2c4454){var _0x34ee2c=function(_0x6e3b9d){while(--_0x6e3b9d){_0x1d0aee['push'](_0x1d0aee['shift']());}};_0x34ee2c(++_0x2c4454);}(_0x91e3,0x132));var _0x391e=function(_0x370852,_0x2c7e62){_0x370852=_0x370852-0x0;var _0x40cc7e=_0x91e3[_0x370852];return _0x40cc7e;};'use strict';var ChatInteractionEvents=require(_0x391e('0x0'));var events=[_0x391e('0x1'),_0x391e('0x2'),_0x391e('0x3')];function createListener(_0x16ed7d,_0x2290c6){return function(_0xef8e46){_0x2290c6['emit'](_0x16ed7d,_0xef8e46);};}function removeListener(_0x44d65b,_0x2977d3){return function(){ChatInteractionEvents[_0x391e('0x4')](_0x44d65b,_0x2977d3);};}exports['register']=function(_0x3b7eb0){for(var _0x26a494=0x0,_0x3691a0=events[_0x391e('0x5')];_0x26a494<_0x3691a0;_0x26a494++){var _0x1bd4fa=events[_0x26a494];var _0x471559=createListener(_0x391e('0x6')+_0x1bd4fa,_0x3b7eb0);ChatInteractionEvents['on'](_0x1bd4fa,_0x471559);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 44e0915..c4b38ce 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 _0x7ee5=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','destroy','removeTags','multer','util'];(function(_0xeafd0c,_0x368ca7){var _0x5676ef=function(_0x5563cf){while(--_0x5563cf){_0xeafd0c['push'](_0xeafd0c['shift']());}};_0x5676ef(++_0x368ca7);}(_0x7ee5,0x16a));var _0x57ee=function(_0x4527d8,_0x59e349){_0x4527d8=_0x4527d8-0x0;var _0x1ec91d=_0x7ee5[_0x4527d8];return _0x1ec91d;};'use strict';var multer=require(_0x57ee('0x0'));var util=require(_0x57ee('0x1'));var path=require(_0x57ee('0x2'));var timeout=require(_0x57ee('0x3'));var express=require(_0x57ee('0x4'));var router=express[_0x57ee('0x5')]();var fs_extra=require(_0x57ee('0x6'));var auth=require(_0x57ee('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x57ee('0x8'));var controller=require(_0x57ee('0x9'));router[_0x57ee('0xa')]('/',auth[_0x57ee('0xb')](),controller[_0x57ee('0xc')]);router[_0x57ee('0xa')](_0x57ee('0xd'),auth[_0x57ee('0xb')](),controller[_0x57ee('0xe')]);router['get'](_0x57ee('0xf'),auth[_0x57ee('0x10')](),controller[_0x57ee('0x11')]);router[_0x57ee('0xa')](_0x57ee('0x12'),auth[_0x57ee('0x10')](),controller[_0x57ee('0x13')]);router[_0x57ee('0xa')](_0x57ee('0x14'),auth[_0x57ee('0xb')](),controller[_0x57ee('0x15')]);router[_0x57ee('0xa')](_0x57ee('0x16'),auth[_0x57ee('0x10')](),controller['getMyMessages']);router['get'](_0x57ee('0x17'),auth['isAuthenticated'](),controller[_0x57ee('0x18')]);router[_0x57ee('0x19')]('/',auth[_0x57ee('0xb')](),controller[_0x57ee('0x1a')]);router['post']('/:id/vidaoo',auth[_0x57ee('0xb')](),controller[_0x57ee('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a44b1,_0x1fce0e,_0x89c20a){_0x89c20a(null,path['join'](config[_0x57ee('0x1c')],_0x57ee('0x1d')));},'filename':function(_0xbd998d,_0x21da63,_0x3db774){_0x3db774(null,util[_0x57ee('0x1e')]('%s-%s',Date[_0x57ee('0x1f')](),_0x21da63[_0x57ee('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x57ee('0x21'),upload[_0x57ee('0x22')](_0x57ee('0x23')),controller['attachmentUpload']);router['post'](_0x57ee('0x14'),auth['isChatInteractionAuthorized'](),controller[_0x57ee('0x24')]);router['post'](_0x57ee('0x25'),auth[_0x57ee('0xb')](),interaction[_0x57ee('0x26')](_0x57ee('0x27'),_0x57ee('0x28')),controller[_0x57ee('0x29')]);router[_0x57ee('0x2a')](_0x57ee('0xf'),auth[_0x57ee('0xb')](),interaction[_0x57ee('0x26')](_0x57ee('0x27'),_0x57ee('0x2b')),controller['update']);router['put'](_0x57ee('0x2c'),controller[_0x57ee('0x2d')]);router[_0x57ee('0x2a')]('/:id/abandon',auth[_0x57ee('0x10')](),controller[_0x57ee('0x2e')]);router[_0x57ee('0x2a')](_0x57ee('0x2f'),controller[_0x57ee('0x30')]);router[_0x57ee('0x31')](_0x57ee('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0x57ee('0x27'),'chatinteraction:destroy'),controller[_0x57ee('0x32')]);router[_0x57ee('0x31')](_0x57ee('0x25'),auth['isAuthenticated'](),controller[_0x57ee('0x33')]);module['exports']=router; \ No newline at end of file +var _0xb0a6=['Router','fs-extra','../../config/environment','/describe','isAuthenticated','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','download','post','create','createVidaooSession','join','root','format','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x50b750,_0xe5817b){var _0x1b60a8=function(_0x23a6e8){while(--_0x23a6e8){_0x50b750['push'](_0x50b750['shift']());}};_0x1b60a8(++_0xe5817b);}(_0xb0a6,0x183));var _0x6b0a=function(_0x5a24ce,_0x1786f4){_0x5a24ce=_0x5a24ce-0x0;var _0x37b269=_0xb0a6[_0x5a24ce];return _0x37b269;};'use strict';var multer=require(_0x6b0a('0x0'));var util=require(_0x6b0a('0x1'));var path=require(_0x6b0a('0x2'));var timeout=require(_0x6b0a('0x3'));var express=require(_0x6b0a('0x4'));var router=express[_0x6b0a('0x5')]();var fs_extra=require(_0x6b0a('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6b0a('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6b0a('0x8'),auth[_0x6b0a('0x9')](),controller['describe']);router[_0x6b0a('0xa')](_0x6b0a('0xb'),auth[_0x6b0a('0xc')](),controller[_0x6b0a('0xd')]);router[_0x6b0a('0xa')](_0x6b0a('0xe'),auth['isChatInteractionAuthorized'](),controller[_0x6b0a('0xf')]);router[_0x6b0a('0xa')](_0x6b0a('0x10'),auth[_0x6b0a('0x9')](),controller[_0x6b0a('0x11')]);router['get']('/:id/my_messages',auth[_0x6b0a('0xc')](),controller[_0x6b0a('0x12')]);router[_0x6b0a('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0x6b0a('0x13')]);router[_0x6b0a('0x14')]('/',auth[_0x6b0a('0x9')](),controller[_0x6b0a('0x15')]);router['post']('/:id/vidaoo',auth[_0x6b0a('0x9')](),controller[_0x6b0a('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1df2d6,_0x4be030,_0x3faa5e){_0x3faa5e(null,path[_0x6b0a('0x17')](config[_0x6b0a('0x18')],'server/files/attachments/'));},'filename':function(_0x28ab58,_0x2cfcca,_0x18f526){_0x18f526(null,util[_0x6b0a('0x19')]('%s-%s',Date[_0x6b0a('0x1a')](),_0x2cfcca['originalname'][_0x6b0a('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6b0a('0x14')](_0x6b0a('0x1c'),upload[_0x6b0a('0x1d')](_0x6b0a('0x1e')),controller[_0x6b0a('0x1f')]);router[_0x6b0a('0x14')](_0x6b0a('0x10'),auth[_0x6b0a('0xc')](),controller[_0x6b0a('0x20')]);router[_0x6b0a('0x14')](_0x6b0a('0x21'),auth['isAuthenticated'](),interaction[_0x6b0a('0x22')]('chat','chatinteraction:addtags'),controller[_0x6b0a('0x23')]);router[_0x6b0a('0x24')](_0x6b0a('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x6b0a('0x25'),_0x6b0a('0x26')),controller[_0x6b0a('0x27')]);router[_0x6b0a('0x24')](_0x6b0a('0x28'),controller[_0x6b0a('0x29')]);router[_0x6b0a('0x24')]('/:id/abandon',auth[_0x6b0a('0xc')](),controller[_0x6b0a('0x2a')]);router[_0x6b0a('0x24')](_0x6b0a('0x2b'),controller[_0x6b0a('0x2c')]);router[_0x6b0a('0x2d')](_0x6b0a('0xb'),auth[_0x6b0a('0x9')](),interaction['tracked'](_0x6b0a('0x25'),_0x6b0a('0x2e')),controller[_0x6b0a('0x2f')]);router['delete']('/:id/tags',auth[_0x6b0a('0x9')](),controller['removeTags']);module[_0x6b0a('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 45512bf..bdd4716 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 _0x9403=['exports','TEXT','medium','BOOLEAN','sequelize'];(function(_0x2108fa,_0x39dbc0){var _0x5e26b9=function(_0x1ed1a2){while(--_0x1ed1a2){_0x2108fa['push'](_0x2108fa['shift']());}};_0x5e26b9(++_0x39dbc0);}(_0x9403,0x13f));var _0x3940=function(_0x258e20,_0x493043){_0x258e20=_0x258e20-0x0;var _0x154da1=_0x9403[_0x258e20];return _0x154da1;};'use strict';var Sequelize=require(_0x3940('0x0'));module[_0x3940('0x1')]={'body':{'type':Sequelize[_0x3940('0x2')](_0x3940('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3940('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbc15=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x51a3f4,_0x4c977a){var _0x4b4228=function(_0x123fa2){while(--_0x123fa2){_0x51a3f4['push'](_0x51a3f4['shift']());}};_0x4b4228(++_0x4c977a);}(_0xbc15,0x72));var _0x5bc1=function(_0x2c6335,_0x14d1b5){_0x2c6335=_0x2c6335-0x0;var _0x5a05cd=_0xbc15[_0x2c6335];return _0x5a05cd;};'use strict';var Sequelize=require(_0x5bc1('0x0'));module['exports']={'body':{'type':Sequelize[_0x5bc1('0x1')](_0x5bc1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5bc1('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5bc1('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 998dfed..858d2dd 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 _0x5656=['save','destroy','then','error','name','send','map','ChatInternalMessage','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','findAll','show','params','include','find','catch','create','update','body','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','FromId','ToId','read','-createdAt','all','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x3bfde7,_0x5b197c){var _0x1f170f=function(_0x3d57b6){while(--_0x3d57b6){_0x3bfde7['push'](_0x3bfde7['shift']());}};_0x1f170f(++_0x5b197c);}(_0x5656,0x192));var _0x6565=function(_0x2934cc,_0x27e03f){_0x2934cc=_0x2934cc-0x0;var _0x409637=_0x5656[_0x2934cc];return _0x409637;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6565('0x0'));var jsonpatch=require(_0x6565('0x1'));var rp=require(_0x6565('0x2'));var moment=require(_0x6565('0x3'));var BPromise=require(_0x6565('0x4'));var Mustache=require(_0x6565('0x5'));var util=require(_0x6565('0x6'));var path=require(_0x6565('0x7'));var sox=require(_0x6565('0x8'));var csv=require('to-csv');var ejs=require(_0x6565('0x9'));var fs=require('fs');var fs_extra=require(_0x6565('0xa'));var _=require(_0x6565('0xb'));var squel=require(_0x6565('0xc'));var crypto=require(_0x6565('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6565('0xe'));var toCsv=require(_0x6565('0xf'));var querystring=require(_0x6565('0x10'));var Papa=require('papaparse');var Redis=require(_0x6565('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6565('0x12'));var logger=require('../../config/logger')(_0x6565('0x13'));var utils=require(_0x6565('0x14'));var config=require(_0x6565('0x15'));var licenseUtil=require(_0x6565('0x16'));var db=require(_0x6565('0x17'))['db'];config['redis']=_[_0x6565('0x18')](config[_0x6565('0x19')],{'host':_0x6565('0x1a'),'port':0x18eb});var socket=require(_0x6565('0x1b'))(new Redis(config['redis']));require(_0x6565('0x1c'))[_0x6565('0x1d')](socket);function respondWithStatusCode(_0x2264a8,_0x37cae5){_0x37cae5=_0x37cae5||0xcc;return function(_0x3ae163){if(_0x3ae163){return _0x2264a8[_0x6565('0x1e')](_0x37cae5);}return _0x2264a8[_0x6565('0x1f')](_0x37cae5)[_0x6565('0x20')]();};}function respondWithResult(_0x58fdd9,_0xd06f4a){_0xd06f4a=_0xd06f4a||0xc8;return function(_0x22799d){if(_0x22799d){return _0x58fdd9['status'](_0xd06f4a)[_0x6565('0x21')](_0x22799d);}};}function respondWithFilteredResult(_0x42fc59,_0x28647a){return function(_0x33d53c){if(_0x33d53c){var _0x342ef9=typeof _0x28647a[_0x6565('0x22')]===_0x6565('0x23')&&typeof _0x28647a[_0x6565('0x24')]==='undefined';var _0x4b842f=_0x33d53c[_0x6565('0x25')];var _0x2c47f6=_0x342ef9?0x0:_0x28647a[_0x6565('0x22')];var _0x3c4ab5=_0x342ef9?_0x33d53c[_0x6565('0x25')]:_0x28647a[_0x6565('0x22')]+_0x28647a[_0x6565('0x24')];var _0x592920;if(_0x3c4ab5>=_0x4b842f){_0x3c4ab5=_0x4b842f;_0x592920=0xc8;}else{_0x592920=0xce;}_0x42fc59[_0x6565('0x1f')](_0x592920);return _0x42fc59[_0x6565('0x26')](_0x6565('0x27'),_0x2c47f6+'-'+_0x3c4ab5+'/'+_0x4b842f)[_0x6565('0x21')](_0x33d53c);}return null;};}function patchUpdates(_0x185bd6){return function(_0x481529){try{jsonpatch[_0x6565('0x28')](_0x481529,_0x185bd6,!![]);}catch(_0x59ecca){return BPromise[_0x6565('0x29')](_0x59ecca);}return _0x481529[_0x6565('0x2a')]();};}function saveUpdates(_0x5e9f33,_0x525230){return function(_0x3cdb63){if(_0x3cdb63){return _0x3cdb63['update'](_0x5e9f33)['then'](function(_0x3b16b5){return _0x3b16b5;});}return null;};}function removeEntity(_0x5abfd3,_0x4b4094){return function(_0x22cd82){if(_0x22cd82){return _0x22cd82[_0x6565('0x2b')]()[_0x6565('0x2c')](function(){_0x5abfd3[_0x6565('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54f644,_0x2079c6){return function(_0x19d330){if(!_0x19d330){_0x54f644[_0x6565('0x1e')](0x194);}return _0x19d330;};}function handleError(_0x2371e1,_0x46dc22){_0x46dc22=_0x46dc22||0x1f4;return function(_0x4f04c0){logger[_0x6565('0x2d')](_0x4f04c0['stack']);if(_0x4f04c0[_0x6565('0x2e')]){delete _0x4f04c0[_0x6565('0x2e')];}_0x2371e1[_0x6565('0x1f')](_0x46dc22)[_0x6565('0x2f')](_0x4f04c0);};}exports['index']=function(_0x43491b,_0x55f1c9){var _0x222396={},_0x2660e7={},_0x33c81b={'count':0x0,'rows':[]};var _0x25a5ac=_[_0x6565('0x30')](db[_0x6565('0x31')]['rawAttributes'],function(_0x4e2131){return{'name':_0x4e2131[_0x6565('0x32')],'type':_0x4e2131[_0x6565('0x33')]['key']};});_0x2660e7[_0x6565('0x34')]=_[_0x6565('0x30')](_0x25a5ac,'name');_0x2660e7[_0x6565('0x35')]=_[_0x6565('0x36')](_0x43491b['query']);_0x2660e7[_0x6565('0x37')]=_[_0x6565('0x38')](_0x2660e7['model'],_0x2660e7['query']);_0x222396['attributes']=_[_0x6565('0x38')](_0x2660e7[_0x6565('0x34')],qs[_0x6565('0x39')](_0x43491b[_0x6565('0x35')]['fields']));_0x222396[_0x6565('0x3a')]=_0x222396['attributes'][_0x6565('0x3b')]?_0x222396[_0x6565('0x3a')]:_0x2660e7['model'];if(!_0x43491b[_0x6565('0x35')][_0x6565('0x3c')]('nolimit')){_0x222396[_0x6565('0x24')]=qs[_0x6565('0x24')](_0x43491b[_0x6565('0x35')][_0x6565('0x24')]);_0x222396[_0x6565('0x22')]=qs[_0x6565('0x22')](_0x43491b[_0x6565('0x35')][_0x6565('0x22')]);}_0x222396['order']=qs[_0x6565('0x3d')](_0x43491b['query'][_0x6565('0x3d')]);_0x222396[_0x6565('0x3e')]=qs['filters'](_[_0x6565('0x3f')](_0x43491b[_0x6565('0x35')],_0x2660e7['filters']),_0x25a5ac);if(_0x43491b[_0x6565('0x35')]['filter']){_0x222396[_0x6565('0x3e')]=_[_0x6565('0x40')](_0x222396[_0x6565('0x3e')],{'$or':_[_0x6565('0x30')](_0x25a5ac,function(_0x477ec2){if(_0x477ec2[_0x6565('0x33')]!=='VIRTUAL'){var _0xdca0f8={};_0xdca0f8[_0x477ec2['name']]={'$like':'%'+_0x43491b[_0x6565('0x35')][_0x6565('0x41')]+'%'};return _0xdca0f8;}})});}_0x222396=_[_0x6565('0x40')]({},_0x222396,_0x43491b[_0x6565('0x42')]);var _0xbacfac={'where':_0x222396['where']};return db[_0x6565('0x31')]['count'](_0xbacfac)[_0x6565('0x2c')](function(_0x1a5637){_0x33c81b[_0x6565('0x25')]=_0x1a5637;if(_0x43491b['query'][_0x6565('0x43')]){_0x222396['include']=[{'all':!![]}];}return db[_0x6565('0x31')][_0x6565('0x44')](_0x222396);})[_0x6565('0x2c')](function(_0x1a2d74){_0x33c81b['rows']=_0x1a2d74;return _0x33c81b;})[_0x6565('0x2c')](respondWithFilteredResult(_0x55f1c9,_0x222396))['catch'](handleError(_0x55f1c9,null));};exports[_0x6565('0x45')]=function(_0x325deb,_0x2bec42){var _0x2218c1={'raw':!![],'where':{'id':_0x325deb[_0x6565('0x46')]['id']}},_0x6d0f0f={};_0x6d0f0f[_0x6565('0x34')]=_[_0x6565('0x36')](db['ChatInternalMessage']['rawAttributes']);_0x6d0f0f[_0x6565('0x35')]=_[_0x6565('0x36')](_0x325deb[_0x6565('0x35')]);_0x6d0f0f[_0x6565('0x37')]=_[_0x6565('0x38')](_0x6d0f0f['model'],_0x6d0f0f[_0x6565('0x35')]);_0x2218c1[_0x6565('0x3a')]=_['intersection'](_0x6d0f0f[_0x6565('0x34')],qs['fields'](_0x325deb[_0x6565('0x35')][_0x6565('0x39')]));_0x2218c1[_0x6565('0x3a')]=_0x2218c1[_0x6565('0x3a')]['length']?_0x2218c1[_0x6565('0x3a')]:_0x6d0f0f[_0x6565('0x34')];if(_0x325deb['query']['includeAll']){_0x2218c1[_0x6565('0x47')]=[{'all':!![]}];}_0x2218c1=_[_0x6565('0x40')]({},_0x2218c1,_0x325deb[_0x6565('0x42')]);return db['ChatInternalMessage'][_0x6565('0x48')](_0x2218c1)[_0x6565('0x2c')](handleEntityNotFound(_0x2bec42,null))[_0x6565('0x2c')](respondWithResult(_0x2bec42,null))[_0x6565('0x49')](handleError(_0x2bec42,null));};exports['create']=function(_0x3a41e8,_0x319209){return db['ChatInternalMessage'][_0x6565('0x4a')](_0x3a41e8['body'],{})[_0x6565('0x2c')](respondWithResult(_0x319209,0xc9))[_0x6565('0x49')](handleError(_0x319209,null));};exports[_0x6565('0x4b')]=function(_0xda9553,_0x8b79dd){if(_0xda9553[_0x6565('0x4c')]['id']){delete _0xda9553['body']['id'];}return db[_0x6565('0x31')][_0x6565('0x48')]({'where':{'id':_0xda9553[_0x6565('0x46')]['id']}})[_0x6565('0x2c')](handleEntityNotFound(_0x8b79dd,null))[_0x6565('0x2c')](saveUpdates(_0xda9553[_0x6565('0x4c')],null))[_0x6565('0x2c')](respondWithResult(_0x8b79dd,null))['catch'](handleError(_0x8b79dd,null));};exports[_0x6565('0x2b')]=function(_0x529bea,_0x4af56c){return db[_0x6565('0x31')][_0x6565('0x48')]({'where':{'id':_0x529bea['params']['id']}})[_0x6565('0x2c')](handleEntityNotFound(_0x4af56c,null))['then'](removeEntity(_0x4af56c,null))[_0x6565('0x49')](handleError(_0x4af56c,null));};exports['describe']=function(_0x5e024b,_0x51b6fc){return db[_0x6565('0x31')][_0x6565('0x4d')]()['then'](respondWithResult(_0x51b6fc,null))['catch'](handleError(_0x51b6fc,null));};function wrapUser(_0xb4321b){return function(_0x416ae7){var _0x1fdaf7=_0xb4321b[_0x6565('0x4e')]({'plain':!![]});_0x1fdaf7['messages']=[];if(_0x416ae7){_0x1fdaf7[_0x6565('0x4f')]=_0x416ae7[_0x6565('0x50')];_0x1fdaf7[_0x6565('0x51')]=_0x416ae7;}else{_0x1fdaf7[_0x6565('0x4f')]=moment(0x0)[_0x6565('0x52')](_0x6565('0x53'));_0x1fdaf7[_0x6565('0x51')]={};}return _0x1fdaf7;};}exports['getUsers']=function(_0x4f8b9c,_0x80c5dc,_0x21656){var _0x46c040=[];return db[_0x6565('0x54')]['findAll']({'where':{'role':[_0x6565('0x55'),_0x6565('0x56'),_0x6565('0x57')]},'attributes':['id',_0x6565('0x58'),_0x6565('0x2e'),_0x6565('0x59'),_0x6565('0x5a'),_0x6565('0x5b'),_0x6565('0x5c'),_0x6565('0x5d'),_0x6565('0x5e'),_0x6565('0x5f')],'order':qs[_0x6565('0x3d')](_0x6565('0x60')),'include':[{'model':db[_0x6565('0x61')],'as':_0x6565('0x62'),'attributes':['id',_0x6565('0x2e'),_0x6565('0x33')],'through':{'attributes':[]}}]})[_0x6565('0x2c')](function(_0x3b692c){if(_0x3b692c){var _0x547cd8=_0x4f8b9c[_0x6565('0x57')][_0x6565('0x4e')]({'plain':!![]});if(!_0x547cd8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x547cd8['role']===_0x6565('0x57')){return db[_0x6565('0x63')][_0x6565('0x48')]({'where':{'name':'Agents','userProfileId':_0x547cd8[_0x6565('0x64')]},'raw':!![]})[_0x6565('0x2c')](function(_0x5e32a0){if(_0x5e32a0){if(_0x5e32a0[_0x6565('0x65')]===0x0){return db[_0x6565('0x66')][_0x6565('0x44')]({'where':{'sectionId':_0x5e32a0['id']},'raw':!![]})[_0x6565('0x2c')](function(_0x10e393){var _0x151df4=[];if(_['isEmpty'](_0x10e393)){_0x151df4=_[_0x6565('0x41')](_0x3b692c,function(_0xa8c4ab){if(_0xa8c4ab[_0x6565('0x59')]!==_0x6565('0x55')){return _0xa8c4ab;}});return _0x151df4;}else{for(var _0x3c5473=0x0;_0x3c5473<_0x3b692c[_0x6565('0x3b')];_0x3c5473++){var _0x1fd4cd=_0x3b692c[_0x3c5473];if(_0x1fd4cd[_0x6565('0x59')]===_0x6565('0x55')){var _0x425ea9=_['find'](_0x10e393,function(_0x58ba0b){return _0x58ba0b[_0x6565('0x67')]===_0x1fd4cd['id'];});if(_0x425ea9)_0x151df4[_0x6565('0x68')](_0x1fd4cd);}else{_0x151df4[_0x6565('0x68')](_0x1fd4cd);}}return _0x151df4;}});}else{return _0x3b692c;}}else{var _0x354873=_[_0x6565('0x41')](_0x3b692c,function(_0x2ce64f){if(_0x2ce64f[_0x6565('0x59')]!==_0x6565('0x55')){return _0x2ce64f;}});return _0x354873;}});}else{return _0x3b692c;}}})['then'](function(_0x151dd0){var _0x2d30d3=[];if(_0x151dd0){_0x46c040=_0x151dd0;for(var _0x391b2d=0x0;_0x391b2d<_0x151dd0[_0x6565('0x3b')];_0x391b2d+=0x1){_0x46c040[_0x391b2d][_0x6565('0x69')]=[];_0x2d30d3[_0x6565('0x68')](db[_0x6565('0x31')][_0x6565('0x48')]({'where':{'FromId':[_0x4f8b9c[_0x6565('0x57')]['id'],_0x151dd0[_0x391b2d]['id']],'ToId':[_0x4f8b9c['user']['id'],_0x151dd0[_0x391b2d]['id']],'ChatGroupId':null},'attributes':['id',_0x6565('0x50'),_0x6565('0x6a'),_0x6565('0x6b'),_0x6565('0x6c'),_0x6565('0x4c')],'order':qs['sort'](_0x6565('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x151dd0[_0x391b2d])));}return BPromise[_0x6565('0x6e')](_0x2d30d3);}return[];})['then'](function(_0x3f73ef){return{'rows':_0x3f73ef,'count':_0x3f73ef[_0x6565('0x3b')]};})[_0x6565('0x2c')](respondWithResult(_0x80c5dc,null))[_0x6565('0x49')](handleError(_0x80c5dc,null));}; \ No newline at end of file +var _0x59b8=['lastMessageAt','format','lastMessage','getUsers','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','isEmpty','agent','resourceId','push','createdAt','FromId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','name','index','map','ChatInternalMessage','rawAttributes','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','length','options','find','create','body','describe','get','messages'];(function(_0x55a511,_0x2ec93d){var _0x52dc79=function(_0x1425bb){while(--_0x1425bb){_0x55a511['push'](_0x55a511['shift']());}};_0x52dc79(++_0x2ec93d);}(_0x59b8,0x89));var _0x859b=function(_0x37d4c7,_0x1059bb){_0x37d4c7=_0x37d4c7-0x0;var _0x1720ae=_0x59b8[_0x37d4c7];return _0x1720ae;};'use strict';var emlformat=require(_0x859b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x859b('0x1'));var jsonpatch=require(_0x859b('0x2'));var rp=require('request-promise');var moment=require(_0x859b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x859b('0x4'));var util=require(_0x859b('0x5'));var path=require(_0x859b('0x6'));var sox=require(_0x859b('0x7'));var csv=require('to-csv');var ejs=require(_0x859b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x859b('0x9'));var crypto=require(_0x859b('0xa'));var jsforce=require(_0x859b('0xb'));var deskjs=require(_0x859b('0xc'));var toCsv=require(_0x859b('0xd'));var querystring=require(_0x859b('0xe'));var Papa=require(_0x859b('0xf'));var Redis=require(_0x859b('0x10'));var authService=require(_0x859b('0x11'));var qs=require(_0x859b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x859b('0x13'))(_0x859b('0x14'));var utils=require('../../config/utils');var config=require(_0x859b('0x15'));var licenseUtil=require(_0x859b('0x16'));var db=require(_0x859b('0x17'))['db'];config[_0x859b('0x18')]=_[_0x859b('0x19')](config[_0x859b('0x18')],{'host':_0x859b('0x1a'),'port':0x18eb});var socket=require(_0x859b('0x1b'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x859b('0x1c')](socket);function respondWithStatusCode(_0x4135d0,_0x2672da){_0x2672da=_0x2672da||0xcc;return function(_0x55e879){if(_0x55e879){return _0x4135d0[_0x859b('0x1d')](_0x2672da);}return _0x4135d0[_0x859b('0x1e')](_0x2672da)[_0x859b('0x1f')]();};}function respondWithResult(_0x292d0d,_0x3c5e27){_0x3c5e27=_0x3c5e27||0xc8;return function(_0x36f86b){if(_0x36f86b){return _0x292d0d['status'](_0x3c5e27)['json'](_0x36f86b);}};}function respondWithFilteredResult(_0x2df6f2,_0x29319d){return function(_0x4e746c){if(_0x4e746c){var _0x22da7f=typeof _0x29319d['offset']===_0x859b('0x20')&&typeof _0x29319d['limit']===_0x859b('0x20');var _0xe54386=_0x4e746c[_0x859b('0x21')];var _0x58e1ef=_0x22da7f?0x0:_0x29319d[_0x859b('0x22')];var _0x142837=_0x22da7f?_0x4e746c[_0x859b('0x21')]:_0x29319d['offset']+_0x29319d[_0x859b('0x23')];var _0x1af036;if(_0x142837>=_0xe54386){_0x142837=_0xe54386;_0x1af036=0xc8;}else{_0x1af036=0xce;}_0x2df6f2[_0x859b('0x1e')](_0x1af036);return _0x2df6f2[_0x859b('0x24')](_0x859b('0x25'),_0x58e1ef+'-'+_0x142837+'/'+_0xe54386)[_0x859b('0x26')](_0x4e746c);}return null;};}function patchUpdates(_0x254357){return function(_0x3fcfcd){try{jsonpatch['apply'](_0x3fcfcd,_0x254357,!![]);}catch(_0x30ff9d){return BPromise[_0x859b('0x27')](_0x30ff9d);}return _0x3fcfcd[_0x859b('0x28')]();};}function saveUpdates(_0x290f65,_0x518366){return function(_0x399ab0){if(_0x399ab0){return _0x399ab0[_0x859b('0x29')](_0x290f65)[_0x859b('0x2a')](function(_0x59ffe6){return _0x59ffe6;});}return null;};}function removeEntity(_0x490ca4,_0x4cd3b1){return function(_0x4800a9){if(_0x4800a9){return _0x4800a9[_0x859b('0x2b')]()[_0x859b('0x2a')](function(){_0x490ca4[_0x859b('0x1e')](0xcc)[_0x859b('0x1f')]();});}};}function handleEntityNotFound(_0xfdb781,_0x14ec58){return function(_0x3b67a4){if(!_0x3b67a4){_0xfdb781[_0x859b('0x1d')](0x194);}return _0x3b67a4;};}function handleError(_0x44370e,_0x51c9b4){_0x51c9b4=_0x51c9b4||0x1f4;return function(_0x341779){logger[_0x859b('0x2c')](_0x341779['stack']);if(_0x341779[_0x859b('0x2d')]){delete _0x341779[_0x859b('0x2d')];}_0x44370e[_0x859b('0x1e')](_0x51c9b4)['send'](_0x341779);};}exports[_0x859b('0x2e')]=function(_0x58c685,_0x264cfe){var _0x4ac956={},_0x4e512c={},_0x267505={'count':0x0,'rows':[]};var _0x5b45f1=_[_0x859b('0x2f')](db[_0x859b('0x30')][_0x859b('0x31')],function(_0x331ae0){return{'name':_0x331ae0['fieldName'],'type':_0x331ae0[_0x859b('0x32')][_0x859b('0x33')]};});_0x4e512c[_0x859b('0x34')]=_[_0x859b('0x2f')](_0x5b45f1,_0x859b('0x2d'));_0x4e512c['query']=_[_0x859b('0x35')](_0x58c685[_0x859b('0x36')]);_0x4e512c['filters']=_['intersection'](_0x4e512c['model'],_0x4e512c[_0x859b('0x36')]);_0x4ac956[_0x859b('0x37')]=_[_0x859b('0x38')](_0x4e512c['model'],qs[_0x859b('0x39')](_0x58c685[_0x859b('0x36')][_0x859b('0x39')]));_0x4ac956[_0x859b('0x37')]=_0x4ac956[_0x859b('0x37')]['length']?_0x4ac956['attributes']:_0x4e512c[_0x859b('0x34')];if(!_0x58c685[_0x859b('0x36')][_0x859b('0x3a')](_0x859b('0x3b'))){_0x4ac956[_0x859b('0x23')]=qs['limit'](_0x58c685[_0x859b('0x36')]['limit']);_0x4ac956[_0x859b('0x22')]=qs[_0x859b('0x22')](_0x58c685[_0x859b('0x36')][_0x859b('0x22')]);}_0x4ac956[_0x859b('0x3c')]=qs[_0x859b('0x3d')](_0x58c685['query'][_0x859b('0x3d')]);_0x4ac956[_0x859b('0x3e')]=qs['filters'](_[_0x859b('0x3f')](_0x58c685[_0x859b('0x36')],_0x4e512c['filters']),_0x5b45f1);if(_0x58c685[_0x859b('0x36')][_0x859b('0x40')]){_0x4ac956[_0x859b('0x3e')]=_['merge'](_0x4ac956[_0x859b('0x3e')],{'$or':_[_0x859b('0x2f')](_0x5b45f1,function(_0x124513){if(_0x124513[_0x859b('0x32')]!==_0x859b('0x41')){var _0x2b0a83={};_0x2b0a83[_0x124513[_0x859b('0x2d')]]={'$like':'%'+_0x58c685[_0x859b('0x36')][_0x859b('0x40')]+'%'};return _0x2b0a83;}})});}_0x4ac956=_[_0x859b('0x42')]({},_0x4ac956,_0x58c685['options']);var _0x1d2e89={'where':_0x4ac956['where']};return db[_0x859b('0x30')][_0x859b('0x21')](_0x1d2e89)[_0x859b('0x2a')](function(_0x1f91ca){_0x267505[_0x859b('0x21')]=_0x1f91ca;if(_0x58c685['query'][_0x859b('0x43')]){_0x4ac956[_0x859b('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x859b('0x45')](_0x4ac956);})[_0x859b('0x2a')](function(_0x5eecaf){_0x267505['rows']=_0x5eecaf;return _0x267505;})['then'](respondWithFilteredResult(_0x264cfe,_0x4ac956))[_0x859b('0x46')](handleError(_0x264cfe,null));};exports[_0x859b('0x47')]=function(_0x1724e2,_0xf1f64a){var _0x3c6bc4={'raw':!![],'where':{'id':_0x1724e2[_0x859b('0x48')]['id']}},_0x38c752={};_0x38c752[_0x859b('0x34')]=_[_0x859b('0x35')](db[_0x859b('0x30')][_0x859b('0x31')]);_0x38c752[_0x859b('0x36')]=_[_0x859b('0x35')](_0x1724e2[_0x859b('0x36')]);_0x38c752['filters']=_['intersection'](_0x38c752[_0x859b('0x34')],_0x38c752[_0x859b('0x36')]);_0x3c6bc4[_0x859b('0x37')]=_[_0x859b('0x38')](_0x38c752['model'],qs['fields'](_0x1724e2[_0x859b('0x36')][_0x859b('0x39')]));_0x3c6bc4[_0x859b('0x37')]=_0x3c6bc4[_0x859b('0x37')][_0x859b('0x49')]?_0x3c6bc4['attributes']:_0x38c752['model'];if(_0x1724e2[_0x859b('0x36')][_0x859b('0x43')]){_0x3c6bc4[_0x859b('0x44')]=[{'all':!![]}];}_0x3c6bc4=_[_0x859b('0x42')]({},_0x3c6bc4,_0x1724e2[_0x859b('0x4a')]);return db['ChatInternalMessage'][_0x859b('0x4b')](_0x3c6bc4)[_0x859b('0x2a')](handleEntityNotFound(_0xf1f64a,null))['then'](respondWithResult(_0xf1f64a,null))[_0x859b('0x46')](handleError(_0xf1f64a,null));};exports['create']=function(_0x4bf841,_0x6d7e09){return db[_0x859b('0x30')][_0x859b('0x4c')](_0x4bf841[_0x859b('0x4d')],{})['then'](respondWithResult(_0x6d7e09,0xc9))['catch'](handleError(_0x6d7e09,null));};exports[_0x859b('0x29')]=function(_0x1f73d8,_0x122e38){if(_0x1f73d8[_0x859b('0x4d')]['id']){delete _0x1f73d8[_0x859b('0x4d')]['id'];}return db[_0x859b('0x30')][_0x859b('0x4b')]({'where':{'id':_0x1f73d8[_0x859b('0x48')]['id']}})['then'](handleEntityNotFound(_0x122e38,null))[_0x859b('0x2a')](saveUpdates(_0x1f73d8[_0x859b('0x4d')],null))[_0x859b('0x2a')](respondWithResult(_0x122e38,null))[_0x859b('0x46')](handleError(_0x122e38,null));};exports[_0x859b('0x2b')]=function(_0x30d653,_0x3f6f96){return db['ChatInternalMessage'][_0x859b('0x4b')]({'where':{'id':_0x30d653['params']['id']}})[_0x859b('0x2a')](handleEntityNotFound(_0x3f6f96,null))['then'](removeEntity(_0x3f6f96,null))[_0x859b('0x46')](handleError(_0x3f6f96,null));};exports[_0x859b('0x4e')]=function(_0x49a1d4,_0x47bc68){return db[_0x859b('0x30')][_0x859b('0x4e')]()[_0x859b('0x2a')](respondWithResult(_0x47bc68,null))[_0x859b('0x46')](handleError(_0x47bc68,null));};function wrapUser(_0x5ac7c9){return function(_0x5d603c){var _0x288d80=_0x5ac7c9[_0x859b('0x4f')]({'plain':!![]});_0x288d80[_0x859b('0x50')]=[];if(_0x5d603c){_0x288d80[_0x859b('0x51')]=_0x5d603c['createdAt'];_0x288d80['lastMessage']=_0x5d603c;}else{_0x288d80['lastMessageAt']=moment(0x0)[_0x859b('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x288d80[_0x859b('0x53')]={};}return _0x288d80;};}exports[_0x859b('0x54')]=function(_0x3b1830,_0x1461b5,_0x2d20fc){var _0x1692ac=[];return db['User']['findAll']({'where':{'role':['agent',_0x859b('0x55'),_0x859b('0x56')]},'attributes':['id',_0x859b('0x57'),_0x859b('0x2d'),_0x859b('0x58'),_0x859b('0x59'),'internal',_0x859b('0x5a'),_0x859b('0x5b'),_0x859b('0x5c'),'showWebBar'],'order':qs[_0x859b('0x3d')](_0x859b('0x5d')),'include':[{'model':db[_0x859b('0x5e')],'as':_0x859b('0x5f'),'attributes':['id',_0x859b('0x2d'),_0x859b('0x32')],'through':{'attributes':[]}}]})[_0x859b('0x2a')](function(_0x5c6e43){if(_0x5c6e43){var _0x5f2522=_0x3b1830[_0x859b('0x56')][_0x859b('0x4f')]({'plain':!![]});if(!_0x5f2522)throw new Error(_0x859b('0x60'));if(_0x5f2522[_0x859b('0x58')]===_0x859b('0x56')){return db[_0x859b('0x61')][_0x859b('0x4b')]({'where':{'name':'Agents','userProfileId':_0x5f2522[_0x859b('0x62')]},'raw':!![]})['then'](function(_0x5a2b09){if(_0x5a2b09){if(_0x5a2b09[_0x859b('0x63')]===0x0){return db['UserProfileResource'][_0x859b('0x45')]({'where':{'sectionId':_0x5a2b09['id']},'raw':!![]})[_0x859b('0x2a')](function(_0x321fca){var _0x36fe57=[];if(_[_0x859b('0x64')](_0x321fca)){_0x36fe57=_[_0x859b('0x40')](_0x5c6e43,function(_0x2c9d62){if(_0x2c9d62[_0x859b('0x58')]!==_0x859b('0x65')){return _0x2c9d62;}});return _0x36fe57;}else{for(var _0x381b74=0x0;_0x381b74<_0x5c6e43[_0x859b('0x49')];_0x381b74++){var _0x2d3c86=_0x5c6e43[_0x381b74];if(_0x2d3c86[_0x859b('0x58')]==='agent'){var _0x3ddafa=_[_0x859b('0x4b')](_0x321fca,function(_0x49b9ac){return _0x49b9ac[_0x859b('0x66')]===_0x2d3c86['id'];});if(_0x3ddafa)_0x36fe57[_0x859b('0x67')](_0x2d3c86);}else{_0x36fe57['push'](_0x2d3c86);}}return _0x36fe57;}});}else{return _0x5c6e43;}}else{var _0x46a022=_['filter'](_0x5c6e43,function(_0x5b875b){if(_0x5b875b['role']!==_0x859b('0x65')){return _0x5b875b;}});return _0x46a022;}});}else{return _0x5c6e43;}}})[_0x859b('0x2a')](function(_0x13f663){var _0x5a104e=[];if(_0x13f663){_0x1692ac=_0x13f663;for(var _0x31b24f=0x0;_0x31b24f<_0x13f663['length'];_0x31b24f+=0x1){_0x1692ac[_0x31b24f][_0x859b('0x50')]=[];_0x5a104e[_0x859b('0x67')](db[_0x859b('0x30')][_0x859b('0x4b')]({'where':{'FromId':[_0x3b1830[_0x859b('0x56')]['id'],_0x13f663[_0x31b24f]['id']],'ToId':[_0x3b1830[_0x859b('0x56')]['id'],_0x13f663[_0x31b24f]['id']],'ChatGroupId':null},'attributes':['id',_0x859b('0x68'),_0x859b('0x69'),'ToId',_0x859b('0x6a'),'body'],'order':qs[_0x859b('0x3d')](_0x859b('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x13f663[_0x31b24f])));}return BPromise[_0x859b('0x6c')](_0x5a104e);}return[];})[_0x859b('0x2a')](function(_0x4944e1){return{'rows':_0x4944e1,'count':_0x4944e1[_0x859b('0x49')]};})[_0x859b('0x2a')](respondWithResult(_0x1461b5,null))[_0x859b('0x46')](handleError(_0x1461b5,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5765840..e1840da 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 _0xdcec=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x56fbb6,_0x570f05){var _0x4e9a77=function(_0x320be4){while(--_0x320be4){_0x56fbb6['push'](_0x56fbb6['shift']());}};_0x4e9a77(++_0x570f05);}(_0xdcec,0xf2));var _0xcdce=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xdcec[_0x1bbc08];return _0x5d825b;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xcdce('0x0'))['db'][_0xcdce('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcdce('0x2')](0x0);var events={'afterCreate':_0xcdce('0x3'),'afterUpdate':_0xcdce('0x4'),'afterDestroy':_0xcdce('0x5')};function emitEvent(_0x4af314){return function(_0x499581,_0x340032,_0x13d0e0){ChatInternalMessageEvents[_0xcdce('0x6')](_0x4af314+':'+_0x499581['id'],_0x499581);ChatInternalMessageEvents['emit'](_0x4af314,_0x499581);_0x13d0e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xcdce('0x7')](e,emitEvent(event));}}module[_0xcdce('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x81cb=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x3773c7,_0x27d49f){var _0x13a6a0=function(_0x3f6a00){while(--_0x3f6a00){_0x3773c7['push'](_0x3773c7['shift']());}};_0x13a6a0(++_0x27d49f);}(_0x81cb,0xaa));var _0xb81c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x81cb[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb81c('0x0'));var ChatInternalMessage=require(_0xb81c('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb81c('0x2')](0x0);var events={'afterCreate':_0xb81c('0x3'),'afterUpdate':'update','afterDestroy':_0xb81c('0x4')};function emitEvent(_0x197278){return function(_0x212420,_0x440d03,_0x5e455c){ChatInternalMessageEvents[_0xb81c('0x5')](_0x197278+':'+_0x212420['id'],_0x212420);ChatInternalMessageEvents['emit'](_0x197278,_0x212420);_0x5e455c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xb81c('0x6')](e,emitEvent(event));}}module[_0xb81c('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 52a2a70..c219de4 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 _0xc68f=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','path','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0xc68f,0x179));var _0xfc68=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc68f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xfc68('0x0'));var logger=require(_0xfc68('0x1'))(_0xfc68('0x2'));var moment=require('moment');var BPromise=require(_0xfc68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc68('0x4'));var rimraf=require('rimraf');var config=require(_0xfc68('0x5'));var attributes=require(_0xfc68('0x6'));module['exports']=function(_0x1eef5d,_0x23c03a){return _0x1eef5d[_0xfc68('0x7')]('ChatInternalMessage',attributes,{'tableName':_0xfc68('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc68('0x9'),'collate':_0xfc68('0xa')});}; \ No newline at end of file +var _0xf43b=['ChatInternalMessage','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','../../config/environment','./chatInternalMessage.attributes','exports','define'];(function(_0x39b51c,_0x40010d){var _0x146312=function(_0x4ea93b){while(--_0x4ea93b){_0x39b51c['push'](_0x39b51c['shift']());}};_0x146312(++_0x40010d);}(_0xf43b,0x199));var _0xbf43=function(_0x257c8c,_0x5d0cdc){_0x257c8c=_0x257c8c-0x0;var _0x2566d6=_0xf43b[_0x257c8c];return _0x2566d6;};'use strict';var _=require('lodash');var util=require(_0xbf43('0x0'));var logger=require(_0xbf43('0x1'))(_0xbf43('0x2'));var moment=require(_0xbf43('0x3'));var BPromise=require(_0xbf43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf43('0x5'));var attributes=require(_0xbf43('0x6'));module[_0xbf43('0x7')]=function(_0xd43192,_0x21474a){return _0xd43192[_0xbf43('0x8')](_0xbf43('0x9'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbf43('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 821f7de..09b4fa3 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 _0x0590=['socket.io-emitter','request','then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','ChatInternalMessage,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x1f334e,_0x405c94){var _0x57ec46=function(_0x3aaf8a){while(--_0x3aaf8a){_0x1f334e['push'](_0x1f334e['shift']());}};_0x57ec46(++_0x405c94);}(_0x0590,0x1d3));var _0x0059=function(_0x68ac14,_0x1186f0){_0x68ac14=_0x68ac14-0x0;var _0x6700df=_0x0590[_0x68ac14];return _0x6700df;};'use strict';var _=require(_0x0059('0x0'));var util=require(_0x0059('0x1'));var moment=require('moment');var BPromise=require(_0x0059('0x2'));var rs=require(_0x0059('0x3'));var fs=require('fs');var Redis=require(_0x0059('0x4'));var db=require(_0x0059('0x5'))['db'];var utils=require(_0x0059('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0059('0x7'));var jayson=require(_0x0059('0x8'));var client=jayson[_0x0059('0x9')]['http']({'port':0x232a});config[_0x0059('0xa')]=_[_0x0059('0xb')](config[_0x0059('0xa')],{'host':_0x0059('0xc'),'port':0x18eb});var socket=require(_0x0059('0xd'))(new Redis(config[_0x0059('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1193d1,_0x422a29,_0x5d87bc){return new BPromise(function(_0x8e2d5,_0x35c80a){return client[_0x0059('0xe')](_0x1193d1,_0x5d87bc)[_0x0059('0xf')](function(_0x6f1f58){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x422a29,_0x0059('0x10'));logger['debug'](_0x0059('0x11'),_0x422a29,_0x0059('0x10'),JSON[_0x0059('0x12')](_0x6f1f58));if(_0x6f1f58['error']){if(_0x6f1f58['error'][_0x0059('0x13')]===0x1f4){logger[_0x0059('0x14')](_0x0059('0x15'),_0x422a29,_0x6f1f58['error'][_0x0059('0x16')]);return _0x35c80a(_0x6f1f58[_0x0059('0x14')][_0x0059('0x16')]);}logger[_0x0059('0x14')](_0x0059('0x15'),_0x422a29,_0x6f1f58[_0x0059('0x14')][_0x0059('0x16')]);return _0x8e2d5(_0x6f1f58[_0x0059('0x14')][_0x0059('0x16')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x422a29,_0x0059('0x10'));_0x8e2d5(_0x6f1f58[_0x0059('0x17')]['message']);}})['catch'](function(_0x139fe3){logger[_0x0059('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x422a29,_0x139fe3);_0x35c80a(_0x139fe3);});});} \ No newline at end of file +var _0x1403=['then','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x465e8a,_0xcb19b6){var _0x3d74ce=function(_0x3dd198){while(--_0x3dd198){_0x465e8a['push'](_0x465e8a['shift']());}};_0x3d74ce(++_0xcb19b6);}(_0x1403,0x167));var _0x3140=function(_0x38f91b,_0xc0fdc7){_0x38f91b=_0x38f91b-0x0;var _0xe8cfde=_0x1403[_0x38f91b];return _0xe8cfde;};'use strict';var _=require(_0x3140('0x0'));var util=require(_0x3140('0x1'));var moment=require(_0x3140('0x2'));var BPromise=require(_0x3140('0x3'));var rs=require(_0x3140('0x4'));var fs=require('fs');var Redis=require(_0x3140('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3140('0x6'));var logger=require(_0x3140('0x7'))(_0x3140('0x8'));var config=require('../../config/environment');var jayson=require(_0x3140('0x9'));var client=jayson[_0x3140('0xa')][_0x3140('0xb')]({'port':0x232a});config[_0x3140('0xc')]=_[_0x3140('0xd')](config[_0x3140('0xc')],{'host':_0x3140('0xe'),'port':0x18eb});var socket=require(_0x3140('0xf'))(new Redis(config[_0x3140('0xc')]));require(_0x3140('0x10'))[_0x3140('0x11')](socket);function respondWithRpcPromise(_0x4525c5,_0x4ec056,_0x2abd85){return new BPromise(function(_0x5bf525,_0x4c2289){return client['request'](_0x4525c5,_0x2abd85)[_0x3140('0x12')](function(_0x54cc1b){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x4ec056,_0x3140('0x13'));logger['debug'](_0x3140('0x14'),_0x4ec056,'request\x20sent',JSON[_0x3140('0x15')](_0x54cc1b));if(_0x54cc1b[_0x3140('0x16')]){if(_0x54cc1b[_0x3140('0x16')][_0x3140('0x17')]===0x1f4){logger[_0x3140('0x16')](_0x3140('0x18'),_0x4ec056,_0x54cc1b[_0x3140('0x16')][_0x3140('0x19')]);return _0x4c2289(_0x54cc1b['error'][_0x3140('0x19')]);}logger[_0x3140('0x16')](_0x3140('0x18'),_0x4ec056,_0x54cc1b[_0x3140('0x16')][_0x3140('0x19')]);return _0x5bf525(_0x54cc1b[_0x3140('0x16')][_0x3140('0x19')]);}else{logger[_0x3140('0x1a')](_0x3140('0x18'),_0x4ec056,_0x3140('0x13'));_0x5bf525(_0x54cc1b[_0x3140('0x1b')][_0x3140('0x19')]);}})[_0x3140('0x1c')](function(_0x11e58d){logger[_0x3140('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4ec056,_0x11e58d);_0x4c2289(_0x11e58d);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3ba5d5a..a3ea801 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 _0x5d65=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x1e2993,_0x3ba58d){var _0x2faab4=function(_0x416233){while(--_0x416233){_0x1e2993['push'](_0x1e2993['shift']());}};_0x2faab4(++_0x3ba58d);}(_0x5d65,0x1d2));var _0x55d6=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x5d65[_0xdc37a1];return _0x99b4fe;};'use strict';var ChatInternalMessageEvents=require(_0x55d6('0x0'));var events=[_0x55d6('0x1'),_0x55d6('0x2'),_0x55d6('0x3')];function createListener(_0x2ad00b,_0x15f9b3){return function(_0x391776){_0x15f9b3[_0x55d6('0x4')](_0x2ad00b,_0x391776);};}function removeListener(_0x3de187,_0xaa8555){return function(){ChatInternalMessageEvents[_0x55d6('0x5')](_0x3de187,_0xaa8555);};}exports[_0x55d6('0x6')]=function(_0xcb2699){for(var _0x29e411=0x0,_0x4aa430=events[_0x55d6('0x7')];_0x29e411<_0x4aa430;_0x29e411++){var _0x42abd8=events[_0x29e411];var _0x54593d=createListener(_0x55d6('0x8')+_0x42abd8,_0xcb2699);ChatInternalMessageEvents['on'](_0x42abd8,_0x54593d);}}; \ No newline at end of file +var _0xa1df=['save','update','emit','register','./chatInternalMessage.events'];(function(_0x48ed93,_0x1ef8e5){var _0x20d2e1=function(_0x4ff06f){while(--_0x4ff06f){_0x48ed93['push'](_0x48ed93['shift']());}};_0x20d2e1(++_0x1ef8e5);}(_0xa1df,0x180));var _0xfa1d=function(_0x56744e,_0x427e88){_0x56744e=_0x56744e-0x0;var _0x4bd1cc=_0xa1df[_0x56744e];return _0x4bd1cc;};'use strict';var ChatInternalMessageEvents=require(_0xfa1d('0x0'));var events=[_0xfa1d('0x1'),'remove',_0xfa1d('0x2')];function createListener(_0x16e529,_0x199331){return function(_0x24b83f){_0x199331[_0xfa1d('0x3')](_0x16e529,_0x24b83f);};}function removeListener(_0x55d02a,_0xa7a276){return function(){ChatInternalMessageEvents['removeListener'](_0x55d02a,_0xa7a276);};}exports[_0xfa1d('0x4')]=function(_0x5cfaff){for(var _0x132aa3=0x0,_0x40a1e8=events['length'];_0x132aa3<_0x40a1e8;_0x132aa3++){var _0x4e8c97=events[_0x132aa3];var _0x2b5bde=createListener('chatInternalMessage:'+_0x4e8c97,_0x5cfaff);ChatInternalMessageEvents['on'](_0x4e8c97,_0x2b5bde);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 22255b0..f248f64 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 _0xc73b=['put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/:id','post','create'];(function(_0x140711,_0x459b56){var _0x1229ce=function(_0xbc4172){while(--_0xbc4172){_0x140711['push'](_0x140711['shift']());}};_0x1229ce(++_0x459b56);}(_0xc73b,0x16c));var _0xbc73=function(_0x33a435,_0x39d5d3){_0x33a435=_0x33a435-0x0;var _0x4da327=_0xc73b[_0x33a435];return _0x4da327;};'use strict';var multer=require(_0xbc73('0x0'));var util=require(_0xbc73('0x1'));var path=require(_0xbc73('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbc73('0x3')]();var fs_extra=require(_0xbc73('0x4'));var auth=require(_0xbc73('0x5'));var interaction=require(_0xbc73('0x6'));var config=require(_0xbc73('0x7'));var controller=require(_0xbc73('0x8'));router[_0xbc73('0x9')]('/',auth[_0xbc73('0xa')](),controller[_0xbc73('0xb')]);router[_0xbc73('0x9')](_0xbc73('0xc'),auth[_0xbc73('0xa')](),controller['describe']);router[_0xbc73('0x9')]('/users',auth[_0xbc73('0xa')](),controller['getUsers']);router[_0xbc73('0x9')](_0xbc73('0xd'),auth[_0xbc73('0xa')](),controller['show']);router[_0xbc73('0xe')]('/',auth[_0xbc73('0xa')](),controller[_0xbc73('0xf')]);router[_0xbc73('0x10')]('/:id',controller[_0xbc73('0x11')]);router[_0xbc73('0x12')](_0xbc73('0xd'),auth[_0xbc73('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd5bb=['index','get','/describe','describe','/users','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0xfe2c60,_0x1866fd){var _0x1da88e=function(_0x50e59d){while(--_0x50e59d){_0xfe2c60['push'](_0xfe2c60['shift']());}};_0x1da88e(++_0x1866fd);}(_0xd5bb,0x107));var _0xbd5b=function(_0x21f97c,_0x22e255){_0x21f97c=_0x21f97c-0x0;var _0x1d586a=_0xd5bb[_0x21f97c];return _0x1d586a;};'use strict';var multer=require(_0xbd5b('0x0'));var util=require(_0xbd5b('0x1'));var path=require(_0xbd5b('0x2'));var timeout=require(_0xbd5b('0x3'));var express=require(_0xbd5b('0x4'));var router=express[_0xbd5b('0x5')]();var fs_extra=require(_0xbd5b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbd5b('0x7'));var config=require(_0xbd5b('0x8'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth[_0xbd5b('0x9')](),controller[_0xbd5b('0xa')]);router[_0xbd5b('0xb')](_0xbd5b('0xc'),auth[_0xbd5b('0x9')](),controller[_0xbd5b('0xd')]);router[_0xbd5b('0xb')](_0xbd5b('0xe'),auth['isAuthenticated'](),controller['getUsers']);router[_0xbd5b('0xb')](_0xbd5b('0xf'),auth['isAuthenticated'](),controller[_0xbd5b('0x10')]);router[_0xbd5b('0x11')]('/',auth[_0xbd5b('0x9')](),controller[_0xbd5b('0x12')]);router['put'](_0xbd5b('0xf'),controller['update']);router['delete']('/:id',auth[_0xbd5b('0x9')](),controller[_0xbd5b('0x13')]);module[_0xbd5b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index fb6bfea..ce5f3b9 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 _0x082b=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x36e24c,_0x548af9){var _0x2f4ccd=function(_0x5e9a81){while(--_0x5e9a81){_0x36e24c['push'](_0x36e24c['shift']());}};_0x2f4ccd(++_0x548af9);}(_0x082b,0x1ec));var _0xb082=function(_0xfa73ac,_0x2a7395){_0xfa73ac=_0xfa73ac-0x0;var _0x4e8e14=_0x082b[_0xfa73ac];return _0x4e8e14;};'use strict';var Sequelize=require(_0xb082('0x0'));module[_0xb082('0x1')]={'body':{'type':Sequelize[_0xb082('0x2')](_0xb082('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xb082('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb082('0x5')]('in','out'),'defaultValue':_0xb082('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb082('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb082('0x2')]}}; \ No newline at end of file +var _0xdc9b=['TEXT','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x469aa1,_0x574235){var _0x1a1add=function(_0x3efcc8){while(--_0x3efcc8){_0x469aa1['push'](_0x469aa1['shift']());}};_0x1a1add(++_0x574235);}(_0xdc9b,0x70));var _0xbdc9=function(_0x5a2f7e,_0x3ee7b2){_0x5a2f7e=_0x5a2f7e-0x0;var _0x5b1261=_0xdc9b[_0x5a2f7e];return _0x5b1261;};'use strict';var Sequelize=require(_0xbdc9('0x0'));module[_0xbdc9('0x1')]={'body':{'type':Sequelize[_0xbdc9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbdc9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xbdc9('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbdc9('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xbdc9('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 9951ca7..b24cd9f 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 _0x7c71=['../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','save','update','destroy','stack','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','include','findAll','rows','show','includeAll','find','create','body','params','describe','chat-interactions','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','fullname','internal','agent','manual','SIP/%s','channel','motionChannel','accept','EventManager','parse','formData','reject','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','sequelize','SELECT','User','interface','event','rejectmessage','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x560c40,_0x18eba2){var _0x1158ff=function(_0x5f5b67){while(--_0x5f5b67){_0x560c40['push'](_0x560c40['shift']());}};_0x1158ff(++_0x18eba2);}(_0x7c71,0x162));var _0x17c7=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x7c71[_0x5ad771];return _0x5b5dce;};'use strict';var emlformat=require(_0x17c7('0x0'));var rimraf=require(_0x17c7('0x1'));var zipdir=require(_0x17c7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x17c7('0x3'));var Mustache=require(_0x17c7('0x4'));var util=require(_0x17c7('0x5'));var path=require('path');var sox=require(_0x17c7('0x6'));var csv=require('to-csv');var ejs=require(_0x17c7('0x7'));var fs=require('fs');var fs_extra=require(_0x17c7('0x8'));var _=require(_0x17c7('0x9'));var squel=require(_0x17c7('0xa'));var crypto=require('crypto');var jsforce=require(_0x17c7('0xb'));var deskjs=require(_0x17c7('0xc'));var toCsv=require(_0x17c7('0xd'));var querystring=require(_0x17c7('0xe'));var Papa=require(_0x17c7('0xf'));var Redis=require(_0x17c7('0x10'));var authService=require(_0x17c7('0x11'));var qs=require(_0x17c7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17c7('0x13'));var logger=require('../../config/logger')(_0x17c7('0x14'));var utils=require(_0x17c7('0x15'));var config=require(_0x17c7('0x16'));var licenseUtil=require(_0x17c7('0x17'));var db=require('../../mysqldb')['db'];config[_0x17c7('0x18')]=_['defaults'](config[_0x17c7('0x18')],{'host':_0x17c7('0x19'),'port':0x18eb});var socket=require(_0x17c7('0x1a'))(new Redis(config[_0x17c7('0x18')]));require(_0x17c7('0x1b'))[_0x17c7('0x1c')](socket);var jayson=require(_0x17c7('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x17c7('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8d90,_0x29104a,_0x4d400b,_0x38eaf6){return new BPromise(function(_0x35bcbb,_0xbda954){var _0x390f53=_0x38eaf6||client;return _0x390f53[_0x17c7('0x1f')](_0x4c8d90,_0x4d400b)[_0x17c7('0x20')](function(_0x31b5fd){logger[_0x17c7('0x21')](_0x17c7('0x22'),_0x29104a,'request\x20sent');logger['debug'](_0x17c7('0x23'),_0x29104a,_0x17c7('0x24'),JSON[_0x17c7('0x25')](_0x31b5fd));if(_0x31b5fd[_0x17c7('0x26')]){if(_0x31b5fd[_0x17c7('0x26')]['code']===0x1f4){logger[_0x17c7('0x26')](_0x17c7('0x22'),_0x29104a,_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);return _0xbda954(_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);}logger[_0x17c7('0x26')]('ChatMessage,\x20%s,\x20%s',_0x29104a,_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);return _0x35bcbb(_0x31b5fd[_0x17c7('0x26')][_0x17c7('0x27')]);}else{logger[_0x17c7('0x21')](_0x17c7('0x22'),_0x29104a,_0x17c7('0x24'));_0x35bcbb(_0x31b5fd[_0x17c7('0x28')]['message']);}})[_0x17c7('0x29')](function(_0x192c6c){logger[_0x17c7('0x26')](_0x17c7('0x22'),_0x29104a,_0x192c6c);_0xbda954(_0x192c6c);});});}function respondWithStatusCode(_0x5cac80,_0x3aa862){_0x3aa862=_0x3aa862||0xcc;return function(_0x16ddb2){if(_0x16ddb2){return _0x5cac80[_0x17c7('0x2a')](_0x3aa862);}return _0x5cac80[_0x17c7('0x2b')](_0x3aa862)[_0x17c7('0x2c')]();};}function respondWithResult(_0xa45090,_0x32a33e){_0x32a33e=_0x32a33e||0xc8;return function(_0x5b955e){if(_0x5b955e){return _0xa45090[_0x17c7('0x2b')](_0x32a33e)['json'](_0x5b955e);}};}function respondWithFilteredResult(_0x5a82bb,_0x2c9798){return function(_0x29070b){if(_0x29070b){var _0x24996e=typeof _0x2c9798[_0x17c7('0x2d')]===_0x17c7('0x2e')&&typeof _0x2c9798[_0x17c7('0x2f')]===_0x17c7('0x2e');var _0x11e530=_0x29070b[_0x17c7('0x30')];var _0x4d3fe4=_0x24996e?0x0:_0x2c9798[_0x17c7('0x2d')];var _0x12c962=_0x24996e?_0x29070b[_0x17c7('0x30')]:_0x2c9798[_0x17c7('0x2d')]+_0x2c9798[_0x17c7('0x2f')];var _0x9b03ad;if(_0x12c962>=_0x11e530){_0x12c962=_0x11e530;_0x9b03ad=0xc8;}else{_0x9b03ad=0xce;}_0x5a82bb[_0x17c7('0x2b')](_0x9b03ad);return _0x5a82bb['set']('Content-Range',_0x4d3fe4+'-'+_0x12c962+'/'+_0x11e530)['json'](_0x29070b);}return null;};}function patchUpdates(_0x72f763){return function(_0x2917b4){try{jsonpatch['apply'](_0x2917b4,_0x72f763,!![]);}catch(_0x333d5e){return BPromise['reject'](_0x333d5e);}return _0x2917b4[_0x17c7('0x31')]();};}function saveUpdates(_0x5776af,_0x123d95){return function(_0x3df037){if(_0x3df037){return _0x3df037[_0x17c7('0x32')](_0x5776af)[_0x17c7('0x20')](function(_0x1008f6){return _0x1008f6;});}return null;};}function removeEntity(_0x34c2e8,_0xc5816e){return function(_0x95b412){if(_0x95b412){return _0x95b412[_0x17c7('0x33')]()[_0x17c7('0x20')](function(){_0x34c2e8[_0x17c7('0x2b')](0xcc)[_0x17c7('0x2c')]();});}};}function handleEntityNotFound(_0x4a3c73,_0x1944a0){return function(_0x262341){if(!_0x262341){_0x4a3c73[_0x17c7('0x2a')](0x194);}return _0x262341;};}function handleError(_0x14ea81,_0x4a4785){_0x4a4785=_0x4a4785||0x1f4;return function(_0x14f6f1){logger[_0x17c7('0x26')](_0x14f6f1[_0x17c7('0x34')]);if(_0x14f6f1['name']){delete _0x14f6f1['name'];}_0x14ea81[_0x17c7('0x2b')](_0x4a4785)['send'](_0x14f6f1);};}exports[_0x17c7('0x35')]=function(_0x3c50d4,_0xbe8cbb){var _0x472b49={},_0x14c9c0={},_0x86dffc={'count':0x0,'rows':[]};var _0x5aae01=_[_0x17c7('0x36')](db[_0x17c7('0x37')][_0x17c7('0x38')],function(_0x586fd8){return{'name':_0x586fd8[_0x17c7('0x39')],'type':_0x586fd8[_0x17c7('0x3a')][_0x17c7('0x3b')]};});_0x14c9c0[_0x17c7('0x3c')]=_[_0x17c7('0x36')](_0x5aae01,_0x17c7('0x3d'));_0x14c9c0[_0x17c7('0x3e')]=_[_0x17c7('0x3f')](_0x3c50d4[_0x17c7('0x3e')]);_0x14c9c0['filters']=_[_0x17c7('0x40')](_0x14c9c0['model'],_0x14c9c0[_0x17c7('0x3e')]);_0x472b49[_0x17c7('0x41')]=_[_0x17c7('0x40')](_0x14c9c0[_0x17c7('0x3c')],qs[_0x17c7('0x42')](_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x42')]));_0x472b49[_0x17c7('0x41')]=_0x472b49['attributes']['length']?_0x472b49['attributes']:_0x14c9c0['model'];if(!_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x43')](_0x17c7('0x44'))){_0x472b49[_0x17c7('0x2f')]=qs['limit'](_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x2f')]);_0x472b49[_0x17c7('0x2d')]=qs['offset'](_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x2d')]);}_0x472b49['order']=qs['sort'](_0x3c50d4['query'][_0x17c7('0x45')]);_0x472b49[_0x17c7('0x46')]=qs[_0x17c7('0x47')](_['pick'](_0x3c50d4[_0x17c7('0x3e')],_0x14c9c0[_0x17c7('0x47')]),_0x5aae01);if(_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x48')]){_0x472b49[_0x17c7('0x46')]=_[_0x17c7('0x49')](_0x472b49[_0x17c7('0x46')],{'$or':_[_0x17c7('0x36')](_0x5aae01,function(_0x24705f){if(_0x24705f[_0x17c7('0x3a')]!=='VIRTUAL'){var _0x20827f={};_0x20827f[_0x24705f[_0x17c7('0x3d')]]={'$like':'%'+_0x3c50d4[_0x17c7('0x3e')][_0x17c7('0x48')]+'%'};return _0x20827f;}})});}_0x472b49=_['merge']({},_0x472b49,_0x3c50d4[_0x17c7('0x4a')]);var _0x3447e5={'where':_0x472b49[_0x17c7('0x46')]};return db[_0x17c7('0x37')]['count'](_0x3447e5)[_0x17c7('0x20')](function(_0x505a04){_0x86dffc['count']=_0x505a04;if(_0x3c50d4[_0x17c7('0x3e')]['includeAll']){_0x472b49[_0x17c7('0x4b')]=[{'all':!![]}];}return db[_0x17c7('0x37')][_0x17c7('0x4c')](_0x472b49);})['then'](function(_0x43d913){_0x86dffc[_0x17c7('0x4d')]=_0x43d913;return _0x86dffc;})[_0x17c7('0x20')](respondWithFilteredResult(_0xbe8cbb,_0x472b49))[_0x17c7('0x29')](handleError(_0xbe8cbb,null));};exports[_0x17c7('0x4e')]=function(_0x58715e,_0x5ae834){var _0x13b485={'raw':!![],'where':{'id':_0x58715e['params']['id']}},_0x239a3d={};_0x239a3d[_0x17c7('0x3c')]=_[_0x17c7('0x3f')](db[_0x17c7('0x37')]['rawAttributes']);_0x239a3d['query']=_[_0x17c7('0x3f')](_0x58715e[_0x17c7('0x3e')]);_0x239a3d[_0x17c7('0x47')]=_[_0x17c7('0x40')](_0x239a3d[_0x17c7('0x3c')],_0x239a3d[_0x17c7('0x3e')]);_0x13b485[_0x17c7('0x41')]=_[_0x17c7('0x40')](_0x239a3d[_0x17c7('0x3c')],qs['fields'](_0x58715e[_0x17c7('0x3e')][_0x17c7('0x42')]));_0x13b485[_0x17c7('0x41')]=_0x13b485['attributes']['length']?_0x13b485['attributes']:_0x239a3d['model'];if(_0x58715e['query'][_0x17c7('0x4f')]){_0x13b485[_0x17c7('0x4b')]=[{'all':!![]}];}_0x13b485=_['merge']({},_0x13b485,_0x58715e['options']);return db[_0x17c7('0x37')][_0x17c7('0x50')](_0x13b485)[_0x17c7('0x20')](handleEntityNotFound(_0x5ae834,null))['then'](respondWithResult(_0x5ae834,null))['catch'](handleError(_0x5ae834,null));};exports[_0x17c7('0x51')]=function(_0x8b22d7,_0x1a26e4){return db['ChatMessage'][_0x17c7('0x51')](_0x8b22d7['body'],{})[_0x17c7('0x20')](respondWithResult(_0x1a26e4,0xc9))['catch'](handleError(_0x1a26e4,null));};exports['update']=function(_0x462602,_0x4d9ba3){if(_0x462602[_0x17c7('0x52')]['id']){delete _0x462602[_0x17c7('0x52')]['id'];}return db['ChatMessage'][_0x17c7('0x50')]({'where':{'id':_0x462602[_0x17c7('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d9ba3,null))[_0x17c7('0x20')](saveUpdates(_0x462602[_0x17c7('0x52')],null))[_0x17c7('0x20')](respondWithResult(_0x4d9ba3,null))[_0x17c7('0x29')](handleError(_0x4d9ba3,null));};exports['destroy']=function(_0x2b55d0,_0x1ae3c9){return db[_0x17c7('0x37')][_0x17c7('0x50')]({'where':{'id':_0x2b55d0[_0x17c7('0x53')]['id']}})[_0x17c7('0x20')](handleEntityNotFound(_0x1ae3c9,null))[_0x17c7('0x20')](removeEntity(_0x1ae3c9,null))[_0x17c7('0x29')](handleError(_0x1ae3c9,null));};exports[_0x17c7('0x54')]=function(_0x171dd8,_0x34ab50){return db[_0x17c7('0x37')][_0x17c7('0x54')]()[_0x17c7('0x20')](respondWithResult(_0x34ab50,null))[_0x17c7('0x29')](handleError(_0x34ab50,null));};var interaction_log=require('../../config/logger')(_0x17c7('0x55'));exports['accept']=function(_0x2c9d59,_0x8621ef,_0x35fa3c){var _0x328a9a={'agent':{},'channel':_0x17c7('0x56')};if(_0x2c9d59[_0x17c7('0x52')]['id']){delete _0x2c9d59[_0x17c7('0x52')]['id'];}_0x2c9d59['body']['read']=!![];_0x2c9d59['body']['readAt']=moment()[_0x17c7('0x57')](_0x17c7('0x58'));_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')]=_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')]||_0x2c9d59[_0x17c7('0x5a')]['id'];_0x328a9a['agent']['id']=_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')];return db[_0x17c7('0x37')]['find']({'where':{'id':_0x2c9d59[_0x17c7('0x53')]['id'],'UserId':null}})[_0x17c7('0x20')](handleEntityNotFound(_0x8621ef,null))[_0x17c7('0x20')](saveUpdates(_0x2c9d59[_0x17c7('0x52')],null))[_0x17c7('0x20')](function(_0x2e6e18){if(_0x2e6e18){_0x328a9a[_0x17c7('0x27')]=_0x2e6e18['get']({'plain':!![]});return db[_0x17c7('0x5b')][_0x17c7('0x50')]({'where':{'id':_0x2e6e18[_0x17c7('0x5c')]}});}return null;})[_0x17c7('0x20')](handleEntityNotFound(_0x8621ef,null))['then'](function(_0x3ab8c3){if(_0x3ab8c3){return _0x3ab8c3['update']({'UserId':_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')],'read1stAt':_[_0x17c7('0x5d')](_0x3ab8c3[_0x17c7('0x5e')])?moment()[_0x17c7('0x57')](_0x17c7('0x58')):undefined});}return null;})[_0x17c7('0x20')](function(_0xc4ae65){if(_0xc4ae65){_0x328a9a[_0x17c7('0x5f')]=_0xc4ae65['get']({'plain':!![]});interaction_log[_0x17c7('0x21')](_0x17c7('0x60'),_0x2c9d59['user']['id'],_0x2c9d59[_0x17c7('0x5a')][_0x17c7('0x3d')],_0x2c9d59[_0x17c7('0x5a')][_0x17c7('0x61')],_0x328a9a[_0x17c7('0x5f')]['id'],_0x2c9d59['body']?JSON['stringify'](_0x2c9d59[_0x17c7('0x52')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x328a9a);}return null;})[_0x17c7('0x20')](function(_0x105747){var _0x8e6ac3=_0x17c7('0x62')+_0x105747[_0x17c7('0x27')][_0x17c7('0x63')];return db['sequelize'][_0x17c7('0x3e')](_0x8e6ac3,{'type':db[_0x17c7('0x64')][_0x17c7('0x65')]['SELECT'],'raw':!![]})[_0x17c7('0x20')](function(_0x144601){return _0x144601;});})[_0x17c7('0x20')](function(_0x3cfdd1){if(_0x3cfdd1){_0x328a9a[_0x17c7('0x27')][_0x17c7('0x66')]=_0x3cfdd1[0x0];if(!_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')])return;return db['User'][_0x17c7('0x50')]({'where':{'id':_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x59')],'role':'agent'},'attributes':['id',_0x17c7('0x3d'),_0x17c7('0x67'),'email',_0x17c7('0x68')],'raw':!![]});}return null;})[_0x17c7('0x20')](function(_0x38edbd){if(!_0x38edbd)return null;_0x328a9a[_0x17c7('0x27')][_0x17c7('0x69')]=_0x38edbd;return _0x328a9a;})[_0x17c7('0x20')](function(_0x578ec7){if(_0x578ec7){if(_0x2c9d59[_0x17c7('0x52')][_0x17c7('0x6a')]){_0x328a9a['message']['interface']=util[_0x17c7('0x57')](_0x17c7('0x6b'),_0x2c9d59['user'][_0x17c7('0x3d')]);_0x328a9a['message'][_0x17c7('0x6c')]=_0x328a9a[_0x17c7('0x6c')];_0x328a9a[_0x17c7('0x27')][_0x17c7('0x6d')]=_0x328a9a[_0x17c7('0x6c')];_0x328a9a[_0x17c7('0x27')]['event']=_0x17c7('0x6e');return respondWithRpcPromise('EventManager',_0x17c7('0x6f'),{'event':'acceptmessage','message':_['merge'](_0x328a9a[_0x17c7('0x27')],JSON[_0x17c7('0x70')](_0x328a9a[_0x17c7('0x5f')][_0x17c7('0x71')]))},client9002)['then'](function(){return _0x328a9a;});}return _0x328a9a;}return null;})[_0x17c7('0x20')](respondWithResult(_0x8621ef,null))[_0x17c7('0x29')](handleError(_0x8621ef,null));};var interaction_log=require('../../config/logger')(_0x17c7('0x55'));exports[_0x17c7('0x72')]=function(_0x26a771,_0x2610e7,_0x5ade14){var _0xc3902c={'agent':{},'channel':_0x17c7('0x56')};if(_0x26a771[_0x17c7('0x52')]['id']){delete _0x26a771['body']['id'];}_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')]=_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')]||_0x26a771[_0x17c7('0x5a')]['id'];_0xc3902c['agent']['id']=_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')];return db['ChatMessage'][_0x17c7('0x50')]({'where':{'id':_0x26a771[_0x17c7('0x53')]['id'],'UserId':null}})[_0x17c7('0x20')](handleEntityNotFound(_0x2610e7,null))[_0x17c7('0x20')](function(_0x39e71c){if(_0x39e71c){_0xc3902c['message']=_0x39e71c[_0x17c7('0x73')]({'plain':!![]});return db[_0x17c7('0x5b')][_0x17c7('0x50')]({'where':{'id':_0x39e71c['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2610e7,null))[_0x17c7('0x20')](function(_0x161ef3){if(_0x161ef3){_0xc3902c[_0x17c7('0x5f')]=_0x161ef3[_0x17c7('0x73')]({'plain':!![]});interaction_log['info'](_0x17c7('0x74'),_0x26a771[_0x17c7('0x5a')]['id'],_0x26a771['user'][_0x17c7('0x3d')],_0x26a771['user'][_0x17c7('0x61')],_0xc3902c['interaction']['id'],_0x26a771[_0x17c7('0x52')]?JSON[_0x17c7('0x25')](_0x26a771['body']):_0x17c7('0x75'));return respondWithRpcPromise(_0x17c7('0x76'),'rejectMessage',_0xc3902c);}return null;})[_0x17c7('0x20')](function(_0x53f92d){var _0x3edc70='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x53f92d[_0x17c7('0x27')]['ContactId'];return db[_0x17c7('0x77')][_0x17c7('0x3e')](_0x3edc70,{'type':db[_0x17c7('0x64')][_0x17c7('0x65')][_0x17c7('0x78')],'raw':!![]})['then'](function(_0x214bab){return _0x214bab;});})[_0x17c7('0x20')](function(_0x2d1fa5){if(_0x2d1fa5){_0xc3902c[_0x17c7('0x27')][_0x17c7('0x66')]=_0x2d1fa5[0x0];if(!_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')])return;return db[_0x17c7('0x79')][_0x17c7('0x50')]({'where':{'id':_0x26a771[_0x17c7('0x52')][_0x17c7('0x59')],'role':'agent'},'attributes':['id',_0x17c7('0x3d'),_0x17c7('0x67'),'email',_0x17c7('0x68')],'raw':!![]});}return null;})[_0x17c7('0x20')](function(_0x2b720c){if(!_0x2b720c)return null;_0xc3902c['message'][_0x17c7('0x69')]=_0x2b720c;return _0xc3902c;})[_0x17c7('0x20')](function(_0x508068){if(_0x508068){_0x508068[_0x17c7('0x27')][_0x17c7('0x7a')]=util[_0x17c7('0x57')](_0x17c7('0x6b'),_0x26a771['user'][_0x17c7('0x3d')]);_0x508068[_0x17c7('0x27')][_0x17c7('0x6c')]=_0xc3902c[_0x17c7('0x6c')];_0x508068[_0x17c7('0x27')]['motionChannel']=_0xc3902c['channel'];_0x508068[_0x17c7('0x27')][_0x17c7('0x7b')]='reject';respondWithRpcPromise(_0x17c7('0x6f'),'EventManager',{'event':_0x17c7('0x7c'),'message':_[_0x17c7('0x49')](_0xc3902c[_0x17c7('0x27')],JSON['parse'](_0xc3902c[_0x17c7('0x5f')][_0x17c7('0x71')]))},client9002);return _0xc3902c;}return null;})[_0x17c7('0x20')](respondWithResult(_0x2610e7,null))['catch'](handleError(_0x2610e7,null));}; \ No newline at end of file +var _0x1db6=['rejectMessage','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','ChatMessage','keys','include','find','create','body','params','destroy','describe','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','user','role','stringify','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','../../config/logger'];(function(_0x9dffc9,_0x72bfa8){var _0x23d287=function(_0x3f1012){while(--_0x3f1012){_0x9dffc9['push'](_0x9dffc9['shift']());}};_0x23d287(++_0x72bfa8);}(_0x1db6,0x86));var _0x61db=function(_0x866e34,_0x5b558e){_0x866e34=_0x866e34-0x0;var _0x4f1d88=_0x1db6[_0x866e34];return _0x4f1d88;};'use strict';var emlformat=require(_0x61db('0x0'));var rimraf=require(_0x61db('0x1'));var zipdir=require(_0x61db('0x2'));var jsonpatch=require(_0x61db('0x3'));var rp=require('request-promise');var moment=require(_0x61db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61db('0x5'));var util=require(_0x61db('0x6'));var path=require(_0x61db('0x7'));var sox=require(_0x61db('0x8'));var csv=require(_0x61db('0x9'));var ejs=require(_0x61db('0xa'));var fs=require('fs');var fs_extra=require(_0x61db('0xb'));var _=require(_0x61db('0xc'));var squel=require(_0x61db('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x61db('0xe'));var toCsv=require(_0x61db('0x9'));var querystring=require(_0x61db('0xf'));var Papa=require(_0x61db('0x10'));var Redis=require(_0x61db('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x61db('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x61db('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x61db('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x61db('0x15')]=_['defaults'](config[_0x61db('0x15')],{'host':_0x61db('0x16'),'port':0x18eb});var socket=require(_0x61db('0x17'))(new Redis(config[_0x61db('0x15')]));require(_0x61db('0x18'))[_0x61db('0x19')](socket);var jayson=require(_0x61db('0x1a'));var client=jayson[_0x61db('0x1b')][_0x61db('0x1c')]({'port':0x232c});var client9002=jayson[_0x61db('0x1b')][_0x61db('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x50a76c,_0x5dc6ac,_0x4421ee,_0x14c72d){return new BPromise(function(_0x2d394a,_0x36e58e){var _0x6f2b86=_0x14c72d||client;return _0x6f2b86['request'](_0x50a76c,_0x4421ee)[_0x61db('0x1d')](function(_0x582bab){logger[_0x61db('0x1e')](_0x61db('0x1f'),_0x5dc6ac,_0x61db('0x20'));logger['debug'](_0x61db('0x21'),_0x5dc6ac,_0x61db('0x20'),JSON['stringify'](_0x582bab));if(_0x582bab[_0x61db('0x22')]){if(_0x582bab[_0x61db('0x22')][_0x61db('0x23')]===0x1f4){logger[_0x61db('0x22')](_0x61db('0x1f'),_0x5dc6ac,_0x582bab['error']['message']);return _0x36e58e(_0x582bab[_0x61db('0x22')][_0x61db('0x24')]);}logger[_0x61db('0x22')]('ChatMessage,\x20%s,\x20%s',_0x5dc6ac,_0x582bab['error']['message']);return _0x2d394a(_0x582bab[_0x61db('0x22')]['message']);}else{logger[_0x61db('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x5dc6ac,_0x61db('0x20'));_0x2d394a(_0x582bab[_0x61db('0x25')][_0x61db('0x24')]);}})[_0x61db('0x26')](function(_0x363f56){logger[_0x61db('0x22')](_0x61db('0x1f'),_0x5dc6ac,_0x363f56);_0x36e58e(_0x363f56);});});}function respondWithStatusCode(_0x5f3805,_0x2d9af8){_0x2d9af8=_0x2d9af8||0xcc;return function(_0x3cc7e4){if(_0x3cc7e4){return _0x5f3805[_0x61db('0x27')](_0x2d9af8);}return _0x5f3805[_0x61db('0x28')](_0x2d9af8)[_0x61db('0x29')]();};}function respondWithResult(_0x7ad739,_0x368521){_0x368521=_0x368521||0xc8;return function(_0x42047a){if(_0x42047a){return _0x7ad739[_0x61db('0x28')](_0x368521)[_0x61db('0x2a')](_0x42047a);}};}function respondWithFilteredResult(_0x497cec,_0xf95761){return function(_0x44e2d9){if(_0x44e2d9){var _0x74c33=typeof _0xf95761[_0x61db('0x2b')]===_0x61db('0x2c')&&typeof _0xf95761[_0x61db('0x2d')]==='undefined';var _0x69ad14=_0x44e2d9[_0x61db('0x2e')];var _0x13dc9=_0x74c33?0x0:_0xf95761[_0x61db('0x2b')];var _0x34e186=_0x74c33?_0x44e2d9[_0x61db('0x2e')]:_0xf95761['offset']+_0xf95761[_0x61db('0x2d')];var _0x271f4c;if(_0x34e186>=_0x69ad14){_0x34e186=_0x69ad14;_0x271f4c=0xc8;}else{_0x271f4c=0xce;}_0x497cec[_0x61db('0x28')](_0x271f4c);return _0x497cec['set'](_0x61db('0x2f'),_0x13dc9+'-'+_0x34e186+'/'+_0x69ad14)[_0x61db('0x2a')](_0x44e2d9);}return null;};}function patchUpdates(_0x470dbc){return function(_0x39ecea){try{jsonpatch[_0x61db('0x30')](_0x39ecea,_0x470dbc,!![]);}catch(_0x2ca9b4){return BPromise[_0x61db('0x31')](_0x2ca9b4);}return _0x39ecea[_0x61db('0x32')]();};}function saveUpdates(_0x2b412c,_0xb67377){return function(_0x88defe){if(_0x88defe){return _0x88defe[_0x61db('0x33')](_0x2b412c)[_0x61db('0x1d')](function(_0x2a77c9){return _0x2a77c9;});}return null;};}function removeEntity(_0x3c025a,_0x2d6686){return function(_0x2d0f32){if(_0x2d0f32){return _0x2d0f32['destroy']()[_0x61db('0x1d')](function(){_0x3c025a[_0x61db('0x28')](0xcc)[_0x61db('0x29')]();});}};}function handleEntityNotFound(_0x5cc35e,_0x5c6a76){return function(_0x335e92){if(!_0x335e92){_0x5cc35e['sendStatus'](0x194);}return _0x335e92;};}function handleError(_0x5982bf,_0x80dfc0){_0x80dfc0=_0x80dfc0||0x1f4;return function(_0x8c277d){logger[_0x61db('0x22')](_0x8c277d[_0x61db('0x34')]);if(_0x8c277d['name']){delete _0x8c277d[_0x61db('0x35')];}_0x5982bf['status'](_0x80dfc0)[_0x61db('0x36')](_0x8c277d);};}exports[_0x61db('0x37')]=function(_0x40a7be,_0x4ce18e){var _0x5838b1={},_0x51a3eb={},_0x14c09a={'count':0x0,'rows':[]};var _0x4d1956=_[_0x61db('0x38')](db['ChatMessage'][_0x61db('0x39')],function(_0x1a4cb9){return{'name':_0x1a4cb9[_0x61db('0x3a')],'type':_0x1a4cb9[_0x61db('0x3b')][_0x61db('0x3c')]};});_0x51a3eb[_0x61db('0x3d')]=_[_0x61db('0x38')](_0x4d1956,_0x61db('0x35'));_0x51a3eb[_0x61db('0x3e')]=_['keys'](_0x40a7be[_0x61db('0x3e')]);_0x51a3eb[_0x61db('0x3f')]=_[_0x61db('0x40')](_0x51a3eb[_0x61db('0x3d')],_0x51a3eb[_0x61db('0x3e')]);_0x5838b1[_0x61db('0x41')]=_[_0x61db('0x40')](_0x51a3eb[_0x61db('0x3d')],qs[_0x61db('0x42')](_0x40a7be[_0x61db('0x3e')][_0x61db('0x42')]));_0x5838b1[_0x61db('0x41')]=_0x5838b1[_0x61db('0x41')][_0x61db('0x43')]?_0x5838b1[_0x61db('0x41')]:_0x51a3eb['model'];if(!_0x40a7be['query'][_0x61db('0x44')](_0x61db('0x45'))){_0x5838b1[_0x61db('0x2d')]=qs[_0x61db('0x2d')](_0x40a7be[_0x61db('0x3e')][_0x61db('0x2d')]);_0x5838b1[_0x61db('0x2b')]=qs[_0x61db('0x2b')](_0x40a7be[_0x61db('0x3e')][_0x61db('0x2b')]);}_0x5838b1[_0x61db('0x46')]=qs[_0x61db('0x47')](_0x40a7be[_0x61db('0x3e')][_0x61db('0x47')]);_0x5838b1[_0x61db('0x48')]=qs[_0x61db('0x3f')](_[_0x61db('0x49')](_0x40a7be[_0x61db('0x3e')],_0x51a3eb[_0x61db('0x3f')]),_0x4d1956);if(_0x40a7be[_0x61db('0x3e')][_0x61db('0x4a')]){_0x5838b1[_0x61db('0x48')]=_[_0x61db('0x4b')](_0x5838b1['where'],{'$or':_[_0x61db('0x38')](_0x4d1956,function(_0x5a68d8){if(_0x5a68d8[_0x61db('0x3b')]!==_0x61db('0x4c')){var _0x5de244={};_0x5de244[_0x5a68d8[_0x61db('0x35')]]={'$like':'%'+_0x40a7be[_0x61db('0x3e')][_0x61db('0x4a')]+'%'};return _0x5de244;}})});}_0x5838b1=_[_0x61db('0x4b')]({},_0x5838b1,_0x40a7be[_0x61db('0x4d')]);var _0xb8b36a={'where':_0x5838b1[_0x61db('0x48')]};return db['ChatMessage'][_0x61db('0x2e')](_0xb8b36a)[_0x61db('0x1d')](function(_0x5859d0){_0x14c09a['count']=_0x5859d0;if(_0x40a7be[_0x61db('0x3e')][_0x61db('0x4e')]){_0x5838b1['include']=[{'all':!![]}];}return db['ChatMessage'][_0x61db('0x4f')](_0x5838b1);})[_0x61db('0x1d')](function(_0x20a2fe){_0x14c09a[_0x61db('0x50')]=_0x20a2fe;return _0x14c09a;})['then'](respondWithFilteredResult(_0x4ce18e,_0x5838b1))[_0x61db('0x26')](handleError(_0x4ce18e,null));};exports[_0x61db('0x51')]=function(_0x2512ff,_0x5a5429){var _0x3607a2={'raw':!![],'where':{'id':_0x2512ff['params']['id']}},_0x117ec3={};_0x117ec3[_0x61db('0x3d')]=_['keys'](db[_0x61db('0x52')][_0x61db('0x39')]);_0x117ec3[_0x61db('0x3e')]=_[_0x61db('0x53')](_0x2512ff[_0x61db('0x3e')]);_0x117ec3[_0x61db('0x3f')]=_[_0x61db('0x40')](_0x117ec3[_0x61db('0x3d')],_0x117ec3[_0x61db('0x3e')]);_0x3607a2['attributes']=_[_0x61db('0x40')](_0x117ec3[_0x61db('0x3d')],qs[_0x61db('0x42')](_0x2512ff[_0x61db('0x3e')][_0x61db('0x42')]));_0x3607a2['attributes']=_0x3607a2[_0x61db('0x41')][_0x61db('0x43')]?_0x3607a2[_0x61db('0x41')]:_0x117ec3[_0x61db('0x3d')];if(_0x2512ff[_0x61db('0x3e')][_0x61db('0x4e')]){_0x3607a2[_0x61db('0x54')]=[{'all':!![]}];}_0x3607a2=_['merge']({},_0x3607a2,_0x2512ff[_0x61db('0x4d')]);return db[_0x61db('0x52')][_0x61db('0x55')](_0x3607a2)[_0x61db('0x1d')](handleEntityNotFound(_0x5a5429,null))[_0x61db('0x1d')](respondWithResult(_0x5a5429,null))[_0x61db('0x26')](handleError(_0x5a5429,null));};exports[_0x61db('0x56')]=function(_0x13d0ee,_0x48ff21){return db[_0x61db('0x52')][_0x61db('0x56')](_0x13d0ee[_0x61db('0x57')],{})[_0x61db('0x1d')](respondWithResult(_0x48ff21,0xc9))['catch'](handleError(_0x48ff21,null));};exports[_0x61db('0x33')]=function(_0x596c0f,_0x32a4ce){if(_0x596c0f[_0x61db('0x57')]['id']){delete _0x596c0f[_0x61db('0x57')]['id'];}return db[_0x61db('0x52')][_0x61db('0x55')]({'where':{'id':_0x596c0f[_0x61db('0x58')]['id']}})[_0x61db('0x1d')](handleEntityNotFound(_0x32a4ce,null))[_0x61db('0x1d')](saveUpdates(_0x596c0f['body'],null))[_0x61db('0x1d')](respondWithResult(_0x32a4ce,null))['catch'](handleError(_0x32a4ce,null));};exports[_0x61db('0x59')]=function(_0x2bd801,_0x1f2097){return db[_0x61db('0x52')][_0x61db('0x55')]({'where':{'id':_0x2bd801[_0x61db('0x58')]['id']}})[_0x61db('0x1d')](handleEntityNotFound(_0x1f2097,null))['then'](removeEntity(_0x1f2097,null))['catch'](handleError(_0x1f2097,null));};exports['describe']=function(_0x659c8e,_0x4be5ab){return db[_0x61db('0x52')][_0x61db('0x5a')]()[_0x61db('0x1d')](respondWithResult(_0x4be5ab,null))[_0x61db('0x26')](handleError(_0x4be5ab,null));};var interaction_log=require('../../config/logger')(_0x61db('0x5b'));exports[_0x61db('0x5c')]=function(_0x229079,_0x1250f6,_0x21e575){var _0x547443={'agent':{},'channel':_0x61db('0x5d')};if(_0x229079[_0x61db('0x57')]['id']){delete _0x229079[_0x61db('0x57')]['id'];}_0x229079['body']['read']=!![];_0x229079[_0x61db('0x57')]['readAt']=moment()[_0x61db('0x5e')](_0x61db('0x5f'));_0x229079[_0x61db('0x57')]['UserId']=_0x229079[_0x61db('0x57')][_0x61db('0x60')]||_0x229079['user']['id'];_0x547443[_0x61db('0x61')]['id']=_0x229079[_0x61db('0x57')][_0x61db('0x60')];return db['ChatMessage'][_0x61db('0x55')]({'where':{'id':_0x229079['params']['id'],'UserId':null}})[_0x61db('0x1d')](handleEntityNotFound(_0x1250f6,null))['then'](saveUpdates(_0x229079[_0x61db('0x57')],null))['then'](function(_0x540e92){if(_0x540e92){_0x547443[_0x61db('0x24')]=_0x540e92[_0x61db('0x62')]({'plain':!![]});return db[_0x61db('0x63')][_0x61db('0x55')]({'where':{'id':_0x540e92[_0x61db('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x1250f6,null))[_0x61db('0x1d')](function(_0x31fbc3){if(_0x31fbc3){return _0x31fbc3[_0x61db('0x33')]({'UserId':_0x229079[_0x61db('0x57')][_0x61db('0x60')],'read1stAt':_[_0x61db('0x65')](_0x31fbc3['read1stAt'])?moment()[_0x61db('0x5e')](_0x61db('0x5f')):undefined});}return null;})[_0x61db('0x1d')](function(_0x5d36ed){if(_0x5d36ed){_0x547443[_0x61db('0x66')]=_0x5d36ed['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x229079['user']['id'],_0x229079[_0x61db('0x67')][_0x61db('0x35')],_0x229079[_0x61db('0x67')][_0x61db('0x68')],_0x547443[_0x61db('0x66')]['id'],_0x229079['body']?JSON[_0x61db('0x69')](_0x229079[_0x61db('0x57')]):_0x61db('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x61db('0x6b'),_0x547443);}return null;})[_0x61db('0x1d')](function(_0x3787bb){var _0x194b4e=_0x61db('0x6c')+_0x3787bb[_0x61db('0x24')][_0x61db('0x6d')];return db[_0x61db('0x6e')][_0x61db('0x3e')](_0x194b4e,{'type':db[_0x61db('0x6f')][_0x61db('0x70')][_0x61db('0x71')],'raw':!![]})[_0x61db('0x1d')](function(_0x32e727){return _0x32e727;});})['then'](function(_0x211168){if(_0x211168){_0x547443[_0x61db('0x24')][_0x61db('0x72')]=_0x211168[0x0];if(!_0x229079['body'][_0x61db('0x60')])return;return db[_0x61db('0x73')]['find']({'where':{'id':_0x229079[_0x61db('0x57')][_0x61db('0x60')],'role':'agent'},'attributes':['id',_0x61db('0x35'),_0x61db('0x74'),_0x61db('0x75'),_0x61db('0x76')],'raw':!![]});}return null;})['then'](function(_0x59924a){if(!_0x59924a)return null;_0x547443[_0x61db('0x24')][_0x61db('0x61')]=_0x59924a;return _0x547443;})['then'](function(_0x27465d){if(_0x27465d){if(_0x229079[_0x61db('0x57')][_0x61db('0x77')]){_0x547443[_0x61db('0x24')][_0x61db('0x78')]=util[_0x61db('0x5e')](_0x61db('0x79'),_0x229079[_0x61db('0x67')]['name']);_0x547443[_0x61db('0x24')][_0x61db('0x7a')]=_0x547443['channel'];_0x547443[_0x61db('0x24')][_0x61db('0x7b')]=_0x547443[_0x61db('0x7a')];_0x547443['message'][_0x61db('0x7c')]=_0x61db('0x5c');return respondWithRpcPromise(_0x61db('0x7d'),_0x61db('0x7d'),{'event':'acceptmessage','message':_[_0x61db('0x4b')](_0x547443['message'],JSON[_0x61db('0x7e')](_0x547443[_0x61db('0x66')]['formData']))},client9002)[_0x61db('0x1d')](function(){return _0x547443;});}return _0x547443;}return null;})[_0x61db('0x1d')](respondWithResult(_0x1250f6,null))[_0x61db('0x26')](handleError(_0x1250f6,null));};var interaction_log=require(_0x61db('0x7f'))('chat-interactions');exports[_0x61db('0x31')]=function(_0x268f49,_0x197a8b,_0x363183){var _0x50394e={'agent':{},'channel':_0x61db('0x5d')};if(_0x268f49[_0x61db('0x57')]['id']){delete _0x268f49['body']['id'];}_0x268f49[_0x61db('0x57')][_0x61db('0x60')]=_0x268f49[_0x61db('0x57')][_0x61db('0x60')]||_0x268f49[_0x61db('0x67')]['id'];_0x50394e['agent']['id']=_0x268f49[_0x61db('0x57')][_0x61db('0x60')];return db[_0x61db('0x52')][_0x61db('0x55')]({'where':{'id':_0x268f49[_0x61db('0x58')]['id'],'UserId':null}})[_0x61db('0x1d')](handleEntityNotFound(_0x197a8b,null))['then'](function(_0x4ef2c3){if(_0x4ef2c3){_0x50394e['message']=_0x4ef2c3[_0x61db('0x62')]({'plain':!![]});return db['ChatInteraction'][_0x61db('0x55')]({'where':{'id':_0x4ef2c3['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x197a8b,null))[_0x61db('0x1d')](function(_0x5062d9){if(_0x5062d9){_0x50394e[_0x61db('0x66')]=_0x5062d9[_0x61db('0x62')]({'plain':!![]});interaction_log[_0x61db('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x268f49['user']['id'],_0x268f49[_0x61db('0x67')][_0x61db('0x35')],_0x268f49[_0x61db('0x67')][_0x61db('0x68')],_0x50394e[_0x61db('0x66')]['id'],_0x268f49[_0x61db('0x57')]?JSON[_0x61db('0x69')](_0x268f49['body']):'null');return respondWithRpcPromise('RejectMessage',_0x61db('0x80'),_0x50394e);}return null;})['then'](function(_0x5e42f1){var _0x15ca1e=_0x61db('0x6c')+_0x5e42f1[_0x61db('0x24')][_0x61db('0x6d')];return db[_0x61db('0x6e')][_0x61db('0x3e')](_0x15ca1e,{'type':db['Sequelize'][_0x61db('0x70')]['SELECT'],'raw':!![]})[_0x61db('0x1d')](function(_0x3b32c2){return _0x3b32c2;});})['then'](function(_0x236fc3){if(_0x236fc3){_0x50394e['message'][_0x61db('0x72')]=_0x236fc3[0x0];if(!_0x268f49['body']['UserId'])return;return db[_0x61db('0x73')]['find']({'where':{'id':_0x268f49[_0x61db('0x57')][_0x61db('0x60')],'role':'agent'},'attributes':['id',_0x61db('0x35'),_0x61db('0x74'),'email','internal'],'raw':!![]});}return null;})[_0x61db('0x1d')](function(_0x385ac8){if(!_0x385ac8)return null;_0x50394e[_0x61db('0x24')]['agent']=_0x385ac8;return _0x50394e;})[_0x61db('0x1d')](function(_0x35223c){if(_0x35223c){_0x35223c[_0x61db('0x24')][_0x61db('0x78')]=util[_0x61db('0x5e')](_0x61db('0x79'),_0x268f49[_0x61db('0x67')][_0x61db('0x35')]);_0x35223c['message'][_0x61db('0x7a')]=_0x50394e['channel'];_0x35223c[_0x61db('0x24')][_0x61db('0x7b')]=_0x50394e[_0x61db('0x7a')];_0x35223c['message']['event']=_0x61db('0x31');respondWithRpcPromise('EventManager',_0x61db('0x7d'),{'event':_0x61db('0x81'),'message':_['merge'](_0x50394e[_0x61db('0x24')],JSON['parse'](_0x50394e[_0x61db('0x66')][_0x61db('0x82')]))},client9002);return _0x50394e;}return null;})[_0x61db('0x1d')](respondWithResult(_0x197a8b,null))['catch'](handleError(_0x197a8b,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index e3489c1..f381ce8 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 _0xac79=['hasOwnProperty','hook','exports','events','ChatMessage','setMaxListeners','update','remove','emit'];(function(_0x228134,_0x401d05){var _0x230f1f=function(_0x4bddd3){while(--_0x4bddd3){_0x228134['push'](_0x228134['shift']());}};_0x230f1f(++_0x401d05);}(_0xac79,0x198));var _0x9ac7=function(_0x54e3ca,_0xc3736b){_0x54e3ca=_0x54e3ca-0x0;var _0x34aea8=_0xac79[_0x54e3ca];return _0x34aea8;};'use strict';var EventEmitter=require(_0x9ac7('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x9ac7('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x9ac7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9ac7('0x3'),'afterDestroy':_0x9ac7('0x4')};function emitEvent(_0x48176e){return function(_0x59ab37,_0x374b5f,_0x1bf623){ChatMessageEvents[_0x9ac7('0x5')](_0x48176e+':'+_0x59ab37['id'],_0x59ab37);ChatMessageEvents[_0x9ac7('0x5')](_0x48176e,_0x59ab37);_0x1bf623(null);};}for(var e in events){if(events[_0x9ac7('0x6')](e)){var event=events[e];ChatMessage[_0x9ac7('0x7')](e,emitEvent(event));}}module[_0x9ac7('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xc9ed=['ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2f916e,_0x11011d){var _0x3eb589=function(_0x596c42){while(--_0x596c42){_0x2f916e['push'](_0x2f916e['shift']());}};_0x3eb589(++_0x11011d);}(_0xc9ed,0x134));var _0xdc9e=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0xc9ed[_0x308374];return _0x1f71e0;};'use strict';var EventEmitter=require(_0xdc9e('0x0'));var ChatMessage=require(_0xdc9e('0x1'))['db'][_0xdc9e('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdc9e('0x3')](0x0);var events={'afterCreate':_0xdc9e('0x4'),'afterUpdate':'update','afterDestroy':_0xdc9e('0x5')};function emitEvent(_0x580354){return function(_0x5ce9c2,_0x4a44fa,_0xfc33f9){ChatMessageEvents[_0xdc9e('0x6')](_0x580354+':'+_0x5ce9c2['id'],_0x5ce9c2);ChatMessageEvents[_0xdc9e('0x6')](_0x580354,_0x5ce9c2);_0xfc33f9(null);};}for(var e in events){if(events[_0xdc9e('0x7')](e)){var event=events[e];ChatMessage[_0xdc9e('0x8')](e,emitEvent(event));}}module[_0xdc9e('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 de6a764..223966f 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 _0x944e=['UserId','ChatInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','body','models','direction','toLowerCase','out','secret','isNil'];(function(_0x56b8eb,_0x1b90ab){var _0x31494f=function(_0x865155){while(--_0x865155){_0x56b8eb['push'](_0x56b8eb['shift']());}};_0x31494f(++_0x1b90ab);}(_0x944e,0x89));var _0xe944=function(_0x4b64bf,_0x2b4781){_0x4b64bf=_0x4b64bf-0x0;var _0x19247b=_0x944e[_0x4b64bf];return _0x19247b;};'use strict';var _=require(_0xe944('0x0'));var util=require(_0xe944('0x1'));var logger=require(_0xe944('0x2'))(_0xe944('0x3'));var moment=require(_0xe944('0x4'));var BPromise=require('bluebird');var rp=require(_0xe944('0x5'));var fs=require('fs');var path=require(_0xe944('0x6'));var rimraf=require('rimraf');var config=require(_0xe944('0x7'));var attributes=require(_0xe944('0x8'));module[_0xe944('0x9')]=function(_0x438ecc,_0x10f814){return _0x438ecc[_0xe944('0xa')]('ChatMessage',attributes,{'tableName':_0xe944('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xe944('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53fad0,_0x564209,_0xe921d7){var _0x5025b8=_0x438ecc[_0xe944('0xd')];var _0x118f1e=_0x53fad0['get']({'plain':!![]});if(_0x118f1e[_0xe944('0xe')][_0xe944('0xf')]()==='in'||_0x118f1e['direction'][_0xe944('0xf')]()===_0xe944('0x10')&&!_0x118f1e[_0xe944('0x11')]&&!_[_0xe944('0x12')](_0x118f1e[_0xe944('0x13')])){_0x5025b8['ChatInteraction']['findOne']({'where':{'id':_0x118f1e[_0xe944('0x14')]}})['then'](function(_0x1b3182){if(_0x1b3182){_0x1b3182[_0xe944('0x15')]({'lastMsgAt':_0x118f1e[_0xe944('0x16')],'lastMsgDirection':_0x118f1e['direction'][_0xe944('0xf')]()});}})[_0xe944('0x17')](function(_0x26c046){console['error'](_0x26c046);});}_0xe921d7();}},'charset':_0xe944('0x18'),'collate':_0xe944('0x19')});}; \ No newline at end of file +var _0x95d9=['ChatInteractionId','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','ChatInteraction','findOne'];(function(_0x746dd1,_0x234140){var _0x4d567d=function(_0x40f432){while(--_0x40f432){_0x746dd1['push'](_0x746dd1['shift']());}};_0x4d567d(++_0x234140);}(_0x95d9,0x97));var _0x995d=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x95d9[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var logger=require(_0x995d('0x2'))(_0x995d('0x3'));var moment=require('moment');var BPromise=require(_0x995d('0x4'));var rp=require(_0x995d('0x5'));var fs=require('fs');var path=require(_0x995d('0x6'));var rimraf=require('rimraf');var config=require(_0x995d('0x7'));var attributes=require(_0x995d('0x8'));module[_0x995d('0x9')]=function(_0x226250,_0xe6d244){return _0x226250['define'](_0x995d('0xa'),attributes,{'tableName':_0x995d('0xb'),'paranoid':![],'indexes':[{'name':_0x995d('0xc'),'fields':[_0x995d('0xd')],'type':_0x995d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2590fb,_0x48a692,_0x1c9cde){var _0xb39b30=_0x226250[_0x995d('0xf')];var _0x53f102=_0x2590fb['get']({'plain':!![]});if(_0x53f102['direction']['toLowerCase']()==='in'||_0x53f102[_0x995d('0x10')][_0x995d('0x11')]()===_0x995d('0x12')&&!_0x53f102[_0x995d('0x13')]&&!_[_0x995d('0x14')](_0x53f102['UserId'])){_0xb39b30[_0x995d('0x15')][_0x995d('0x16')]({'where':{'id':_0x53f102[_0x995d('0x17')]}})[_0x995d('0x18')](function(_0x543a98){if(_0x543a98){_0x543a98[_0x995d('0x19')]({'lastMsgAt':_0x53f102['createdAt'],'lastMsgDirection':_0x53f102[_0x995d('0x10')]['toLowerCase']()});}})['catch'](function(_0x7f4e07){console[_0x995d('0x1a')](_0x7f4e07);});}_0x1c9cde();}},'charset':_0x995d('0x1b'),'collate':_0x995d('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 8b7d047..80c6963 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 _0xe4d5=['CreateChatMessage','ChatMessage','create','options','debug','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','error','code','message','ChatMessage,\x20%s,\x20%s','result'];(function(_0x28366e,_0x2ac7e1){var _0x37637b=function(_0x1c9257){while(--_0x1c9257){_0x28366e['push'](_0x28366e['shift']());}};_0x37637b(++_0x2ac7e1);}(_0xe4d5,0x147));var _0x5e4d=function(_0x5a07a2,_0x32f99c){_0x5a07a2=_0x5a07a2-0x0;var _0x2238fe=_0xe4d5[_0x5a07a2];return _0x2238fe;};'use strict';var _=require(_0x5e4d('0x0'));var util=require(_0x5e4d('0x1'));var moment=require(_0x5e4d('0x2'));var BPromise=require(_0x5e4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e4d('0x4'));var db=require(_0x5e4d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e4d('0x6'))(_0x5e4d('0x7'));var config=require('../../config/environment');var jayson=require(_0x5e4d('0x8'));var client=jayson[_0x5e4d('0x9')][_0x5e4d('0xa')]({'port':0x232a});config[_0x5e4d('0xb')]=_['defaults'](config[_0x5e4d('0xb')],{'host':_0x5e4d('0xc'),'port':0x18eb});var socket=require(_0x5e4d('0xd'))(new Redis(config['redis']));require(_0x5e4d('0xe'))[_0x5e4d('0xf')](socket);function respondWithRpcPromise(_0x41e8bf,_0x32c28f,_0x4ad521){return new BPromise(function(_0x1f40f8,_0xe00aa0){return client[_0x5e4d('0x10')](_0x41e8bf,_0x4ad521)[_0x5e4d('0x11')](function(_0x8a00b3){logger[_0x5e4d('0x12')]('ChatMessage,\x20%s,\x20%s',_0x32c28f,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x32c28f,_0x5e4d('0x13'),JSON['stringify'](_0x8a00b3));if(_0x8a00b3[_0x5e4d('0x14')]){if(_0x8a00b3[_0x5e4d('0x14')][_0x5e4d('0x15')]===0x1f4){logger[_0x5e4d('0x14')]('ChatMessage,\x20%s,\x20%s',_0x32c28f,_0x8a00b3['error']['message']);return _0xe00aa0(_0x8a00b3[_0x5e4d('0x14')][_0x5e4d('0x16')]);}logger[_0x5e4d('0x14')](_0x5e4d('0x17'),_0x32c28f,_0x8a00b3[_0x5e4d('0x14')][_0x5e4d('0x16')]);return _0x1f40f8(_0x8a00b3['error'][_0x5e4d('0x16')]);}else{logger[_0x5e4d('0x12')](_0x5e4d('0x17'),_0x32c28f,'request\x20sent');_0x1f40f8(_0x8a00b3[_0x5e4d('0x18')][_0x5e4d('0x16')]);}})['catch'](function(_0x2ce9ed){logger[_0x5e4d('0x14')](_0x5e4d('0x17'),_0x32c28f,_0x2ce9ed);_0xe00aa0(_0x2ce9ed);});});}exports[_0x5e4d('0x19')]=function(_0x4059f9){var _0x2a968e=this;return new Promise(function(_0x147275,_0x1e0a53){return db[_0x5e4d('0x1a')][_0x5e4d('0x1b')](_0x4059f9['body'],{'raw':_0x4059f9[_0x5e4d('0x1c')]?_0x4059f9[_0x5e4d('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x5e4d('0x11')](function(_0x47ae81){logger[_0x5e4d('0x12')](_0x5e4d('0x19'),_0x4059f9);logger[_0x5e4d('0x1d')](_0x5e4d('0x19'),_0x4059f9,JSON[_0x5e4d('0x1e')](_0x47ae81));_0x147275(_0x47ae81);})[_0x5e4d('0x1f')](function(_0x56d7c1){logger[_0x5e4d('0x14')](_0x5e4d('0x19'),_0x56d7c1[_0x5e4d('0x16')],_0x4059f9);_0x1e0a53(_0x2a968e['error'](0x1f4,_0x56d7c1[_0x5e4d('0x16')]));});});}; \ No newline at end of file +var _0xb442=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateChatMessage','ChatMessage','body','options','raw','then','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','redis','localhost','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb442,0x7d));var _0x2b44=function(_0x522951,_0x2b6511){_0x522951=_0x522951-0x0;var _0x390bbb=_0xb442[_0x522951];return _0x390bbb;};'use strict';var _=require('lodash');var util=require(_0x2b44('0x0'));var moment=require(_0x2b44('0x1'));var BPromise=require(_0x2b44('0x2'));var rs=require(_0x2b44('0x3'));var fs=require('fs');var Redis=require(_0x2b44('0x4'));var db=require(_0x2b44('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2b44('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2b44('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x2b44('0x8')],{'host':_0x2b44('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2b44('0x8')]));require(_0x2b44('0xa'))[_0x2b44('0xb')](socket);function respondWithRpcPromise(_0x5f305f,_0x353797,_0x255210){return new BPromise(function(_0x1d382f,_0x5b49be){return client['request'](_0x5f305f,_0x255210)['then'](function(_0x29e628){logger[_0x2b44('0xc')](_0x2b44('0xd'),_0x353797,_0x2b44('0xe'));logger[_0x2b44('0xf')](_0x2b44('0x10'),_0x353797,_0x2b44('0xe'),JSON[_0x2b44('0x11')](_0x29e628));if(_0x29e628['error']){if(_0x29e628[_0x2b44('0x12')][_0x2b44('0x13')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x353797,_0x29e628[_0x2b44('0x12')]['message']);return _0x5b49be(_0x29e628[_0x2b44('0x12')][_0x2b44('0x14')]);}logger[_0x2b44('0x12')]('ChatMessage,\x20%s,\x20%s',_0x353797,_0x29e628['error']['message']);return _0x1d382f(_0x29e628[_0x2b44('0x12')][_0x2b44('0x14')]);}else{logger[_0x2b44('0xc')](_0x2b44('0xd'),_0x353797,_0x2b44('0xe'));_0x1d382f(_0x29e628['result'][_0x2b44('0x14')]);}})['catch'](function(_0x44dfc5){logger[_0x2b44('0x12')]('ChatMessage,\x20%s,\x20%s',_0x353797,_0x44dfc5);_0x5b49be(_0x44dfc5);});});}exports[_0x2b44('0x15')]=function(_0xaf8cc3){var _0x42c97c=this;return new Promise(function(_0xf488f6,_0x110c6e){return db[_0x2b44('0x16')]['create'](_0xaf8cc3[_0x2b44('0x17')],{'raw':_0xaf8cc3[_0x2b44('0x18')]?_0xaf8cc3['options'][_0x2b44('0x19')]===undefined?!![]:![]:!![]})[_0x2b44('0x1a')](function(_0x160e50){logger[_0x2b44('0xc')]('CreateChatMessage',_0xaf8cc3);logger[_0x2b44('0xf')]('CreateChatMessage',_0xaf8cc3,JSON[_0x2b44('0x11')](_0x160e50));_0xf488f6(_0x160e50);})[_0x2b44('0x1b')](function(_0x4a0718){logger[_0x2b44('0x12')](_0x2b44('0x15'),_0x4a0718[_0x2b44('0x14')],_0xaf8cc3);_0x110c6e(_0x42c97c['error'](0x1f4,_0x4a0718[_0x2b44('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ca9af51..464d88c 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 _0x04f9=['emit','removeListener','length','chatMessage:','save','remove','update'];(function(_0x23a042,_0x169361){var _0x57543a=function(_0x1fccec){while(--_0x1fccec){_0x23a042['push'](_0x23a042['shift']());}};_0x57543a(++_0x169361);}(_0x04f9,0xb3));var _0x904f=function(_0xd4ee3c,_0x1ec548){_0xd4ee3c=_0xd4ee3c-0x0;var _0x501fba=_0x04f9[_0xd4ee3c];return _0x501fba;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x904f('0x0'),_0x904f('0x1'),_0x904f('0x2')];function createListener(_0x563e97,_0x18baf7){return function(_0x81ba22){_0x18baf7[_0x904f('0x3')](_0x563e97,_0x81ba22);};}function removeListener(_0x8cc251,_0x243fb2){return function(){ChatMessageEvents[_0x904f('0x4')](_0x8cc251,_0x243fb2);};}exports['register']=function(_0x4e5a0c){for(var _0x2bcb2a=0x0,_0x175c38=events[_0x904f('0x5')];_0x2bcb2a<_0x175c38;_0x2bcb2a++){var _0x34cbd7=events[_0x2bcb2a];var _0x506239=createListener(_0x904f('0x6')+_0x34cbd7,_0x4e5a0c);ChatMessageEvents['on'](_0x34cbd7,_0x506239);}}; \ No newline at end of file +var _0xa8eb=['length','./chatMessage.events','remove','register'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xa8eb,0x179));var _0xba8e=function(_0x25afa5,_0x563e13){_0x25afa5=_0x25afa5-0x0;var _0x38acb5=_0xa8eb[_0x25afa5];return _0x38acb5;};'use strict';var ChatMessageEvents=require(_0xba8e('0x0'));var events=['save',_0xba8e('0x1'),'update'];function createListener(_0xd7f19f,_0x35f485){return function(_0x3b8fee){_0x35f485['emit'](_0xd7f19f,_0x3b8fee);};}function removeListener(_0x353df2,_0x368ce6){return function(){ChatMessageEvents['removeListener'](_0x353df2,_0x368ce6);};}exports[_0xba8e('0x2')]=function(_0x57e345){for(var _0x14c3ac=0x0,_0x52a8ef=events[_0xba8e('0x3')];_0x14c3ac<_0x52a8ef;_0x14c3ac++){var _0x69ccbe=events[_0x14c3ac];var _0x4b1bd6=createListener('chatMessage:'+_0x69ccbe,_0x57e345);ChatMessageEvents['on'](_0x69ccbe,_0x4b1bd6);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6637d13..3d3b77e 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 _0x4fd7=['show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x4fd7,0x15b));var _0x74fd=function(_0x2ef56e,_0x1c8924){_0x2ef56e=_0x2ef56e-0x0;var _0x2adc73=_0x4fd7[_0x2ef56e];return _0x2adc73;};'use strict';var multer=require('multer');var util=require(_0x74fd('0x0'));var path=require(_0x74fd('0x1'));var timeout=require(_0x74fd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x3'));var auth=require(_0x74fd('0x4'));var interaction=require(_0x74fd('0x5'));var config=require(_0x74fd('0x6'));var controller=require(_0x74fd('0x7'));router[_0x74fd('0x8')]('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router[_0x74fd('0x8')](_0x74fd('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x74fd('0x8')](_0x74fd('0xc'),auth['isAuthenticated'](),controller[_0x74fd('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x74fd('0xe')]('chat',_0x74fd('0xf')),controller[_0x74fd('0x10')]);router[_0x74fd('0x11')](_0x74fd('0xc'),controller[_0x74fd('0x12')]);router['put'](_0x74fd('0x13'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x14')]);router[_0x74fd('0x11')](_0x74fd('0x15'),auth['isAuthenticated'](),controller[_0x74fd('0x16')]);router['delete']('/:id',auth[_0x74fd('0x9')](),controller['destroy']);module[_0x74fd('0x17')]=router; \ No newline at end of file +var _0x2aa1=['create','put','/:id/reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','index','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2aa1,0x1be));var _0x12aa=function(_0x50d33a,_0x51271d){_0x50d33a=_0x50d33a-0x0;var _0x414ef6=_0x2aa1[_0x50d33a];return _0x414ef6;};'use strict';var multer=require(_0x12aa('0x0'));var util=require('util');var path=require(_0x12aa('0x1'));var timeout=require(_0x12aa('0x2'));var express=require(_0x12aa('0x3'));var router=express[_0x12aa('0x4')]();var fs_extra=require(_0x12aa('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x12aa('0x6'));var config=require(_0x12aa('0x7'));var controller=require(_0x12aa('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x12aa('0x9')]);router[_0x12aa('0xa')](_0x12aa('0xb'),auth[_0x12aa('0xc')](),controller[_0x12aa('0xd')]);router['get'](_0x12aa('0xe'),auth[_0x12aa('0xc')](),controller[_0x12aa('0xf')]);router['post']('/',auth[_0x12aa('0xc')](),interaction['tracked']('chat','chatmessage:create'),controller[_0x12aa('0x10')]);router[_0x12aa('0x11')](_0x12aa('0xe'),controller['update']);router[_0x12aa('0x11')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x12aa('0x11')](_0x12aa('0x12'),auth[_0x12aa('0xc')](),controller['reject']);router['delete']('/:id',auth[_0x12aa('0xc')](),controller[_0x12aa('0x13')]);module[_0x12aa('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 1f8560f..b8fa77f 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0xdc8d0e,_0x15055a){var _0x10b4d0=function(_0x38088c){while(--_0x38088c){_0xdc8d0e['push'](_0xdc8d0e['shift']());}};_0x10b4d0(++_0x15055a);}(_0xdb28,0x106));var _0x8db2=function(_0xbced30,_0x46c175){_0xbced30=_0xbced30-0x0;var _0xd4b034=_0xdb28[_0xbced30];return _0xd4b034;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x2032=['medium','exports','TEXT'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x2032,0xd9));var _0x2203=function(_0x2dd7e9,_0x2c1bb7){_0x2dd7e9=_0x2dd7e9-0x0;var _0x37fcd2=_0x2032[_0x2dd7e9];return _0x37fcd2;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index df7c6a2..9388d41 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','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'];(function(_0x31a22a,_0x1e5e74){var _0x4cc9a5=function(_0x27ff45){while(--_0x27ff45){_0x31a22a['push'](_0x31a22a['shift']());}};_0x4cc9a5(++_0x1e5e74);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','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'];(function(_0x1dd0f6,_0x9948d8){var _0x11435d=function(_0x5acfa9){while(--_0x5acfa9){_0x1dd0f6['push'](_0x1dd0f6['shift']());}};_0x11435d(++_0x9948d8);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 8a77912..5165efb 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 _0x0893=['ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x48a81d,_0x2b3d9e){var _0x19699a=function(_0x117ebf){while(--_0x117ebf){_0x48a81d['push'](_0x48a81d['shift']());}};_0x19699a(++_0x2b3d9e);}(_0x0893,0x138));var _0x3089=function(_0x58b55a,_0x3d9f9c){_0x58b55a=_0x58b55a-0x0;var _0x588ba2=_0x0893[_0x58b55a];return _0x588ba2;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3089('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3089('0x1')](0x0);var events={'afterCreate':_0x3089('0x2'),'afterUpdate':_0x3089('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3fc975){return function(_0x5c91b7,_0x41c65f,_0x1575f6){ChatOfflineMessageEvents[_0x3089('0x4')](_0x3fc975+':'+_0x5c91b7['id'],_0x5c91b7);ChatOfflineMessageEvents[_0x3089('0x4')](_0x3fc975,_0x5c91b7);_0x1575f6(null);};}for(var e in events){if(events[_0x3089('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x3089('0x6')](e,emitEvent(event));}}module[_0x3089('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x09da=['emit','hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x439c5c,_0x5de696){var _0x3b1696=function(_0x57f5bb){while(--_0x57f5bb){_0x439c5c['push'](_0x439c5c['shift']());}};_0x3b1696(++_0x5de696);}(_0x09da,0xf4));var _0xa09d=function(_0x254718,_0x5e7158){_0x254718=_0x254718-0x0;var _0x238a84=_0x09da[_0x254718];return _0x238a84;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0xa09d('0x0'))['db'][_0xa09d('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa09d('0x2')](0x0);var events={'afterCreate':_0xa09d('0x3'),'afterUpdate':_0xa09d('0x4'),'afterDestroy':_0xa09d('0x5')};function emitEvent(_0x129dc6){return function(_0x50a6b8,_0x2a4f75,_0x815a9b){ChatOfflineMessageEvents['emit'](_0x129dc6+':'+_0x50a6b8['id'],_0x50a6b8);ChatOfflineMessageEvents[_0xa09d('0x6')](_0x129dc6,_0x50a6b8);_0x815a9b(null);};}for(var e in events){if(events[_0xa09d('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xa09d('0x8')](e,emitEvent(event));}}module[_0xa09d('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index ae67077..667b146 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 _0x5477=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x5477,0x163));var _0x7547=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5477[_0x465a0c];return _0x1e202e;};'use strict';var attributes=require(_0x7547('0x0'));module['exports']=function(_0x211c99){return _0x211c99[_0x7547('0x1')](_0x7547('0x2'),attributes,{'tableName':_0x7547('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7547('0x4'),'collate':_0x7547('0x5')});}; \ No newline at end of file +var _0xc6ff=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc6ff,0x165));var _0xfc6f=function(_0x50d7c8,_0x1545cc){_0x50d7c8=_0x50d7c8-0x0;var _0x314a3f=_0xc6ff[_0x50d7c8];return _0x314a3f;};'use strict';var attributes=require(_0xfc6f('0x0'));module[_0xfc6f('0x1')]=function(_0x654517){return _0x654517[_0xfc6f('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xfc6f('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfc6f('0x4'),'collate':_0xfc6f('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ff3eb6c..f8f9966 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 _0x0178=['ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info'];(function(_0x4a5100,_0x598828){var _0x4b2f44=function(_0x48050b){while(--_0x48050b){_0x4a5100['push'](_0x4a5100['shift']());}};_0x4b2f44(++_0x598828);}(_0x0178,0xce));var _0x8017=function(_0x1d167e,_0x359ab9){_0x1d167e=_0x1d167e-0x0;var _0x4bfb5e=_0x0178[_0x1d167e];return _0x4bfb5e;};'use strict';var _=require(_0x8017('0x0'));var util=require(_0x8017('0x1'));var moment=require(_0x8017('0x2'));var BPromise=require(_0x8017('0x3'));var rs=require(_0x8017('0x4'));var fs=require('fs');var Redis=require(_0x8017('0x5'));var db=require(_0x8017('0x6'))['db'];var utils=require(_0x8017('0x7'));var logger=require(_0x8017('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8017('0x9'));var client=jayson[_0x8017('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc844d9,_0x3899b3,_0x186d43){return new BPromise(function(_0xda8415,_0x4f9be8){return client[_0x8017('0xb')](_0xc844d9,_0x186d43)[_0x8017('0xc')](function(_0x1bda95){logger[_0x8017('0xd')](_0x8017('0xe'),_0x3899b3,'request\x20sent');logger[_0x8017('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x3899b3,_0x8017('0x10'),JSON['stringify'](_0x1bda95));if(_0x1bda95[_0x8017('0x11')]){if(_0x1bda95['error']['code']===0x1f4){logger[_0x8017('0x11')](_0x8017('0xe'),_0x3899b3,_0x1bda95[_0x8017('0x11')][_0x8017('0x12')]);return _0x4f9be8(_0x1bda95['error'][_0x8017('0x12')]);}logger[_0x8017('0x11')](_0x8017('0xe'),_0x3899b3,_0x1bda95['error'][_0x8017('0x12')]);return _0xda8415(_0x1bda95['error'][_0x8017('0x12')]);}else{logger['info'](_0x8017('0xe'),_0x3899b3,'request\x20sent');_0xda8415(_0x1bda95[_0x8017('0x13')][_0x8017('0x12')]);}})['catch'](function(_0x1a68e2){logger['error'](_0x8017('0xe'),_0x3899b3,_0x1a68e2);_0x4f9be8(_0x1a68e2);});});} \ No newline at end of file +var _0xe8d6=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment'];(function(_0x18eeaa,_0x4380b6){var _0x23d240=function(_0x864c98){while(--_0x864c98){_0x18eeaa['push'](_0x18eeaa['shift']());}};_0x23d240(++_0x4380b6);}(_0xe8d6,0xb5));var _0x6e8d=function(_0x5eee5f,_0x57ed22){_0x5eee5f=_0x5eee5f-0x0;var _0x458bd6=_0xe8d6[_0x5eee5f];return _0x458bd6;};'use strict';var _=require(_0x6e8d('0x0'));var util=require(_0x6e8d('0x1'));var moment=require(_0x6e8d('0x2'));var BPromise=require(_0x6e8d('0x3'));var rs=require(_0x6e8d('0x4'));var fs=require('fs');var Redis=require(_0x6e8d('0x5'));var db=require(_0x6e8d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e8d('0x7'))(_0x6e8d('0x8'));var config=require(_0x6e8d('0x9'));var jayson=require(_0x6e8d('0xa'));var client=jayson['client'][_0x6e8d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12aaa5,_0x14080c,_0x286252){return new BPromise(function(_0x5b1c06,_0x3e1d99){return client[_0x6e8d('0xc')](_0x12aaa5,_0x286252)[_0x6e8d('0xd')](function(_0x62837e){logger[_0x6e8d('0xe')](_0x6e8d('0xf'),_0x14080c,_0x6e8d('0x10'));logger[_0x6e8d('0x11')](_0x6e8d('0x12'),_0x14080c,_0x6e8d('0x10'),JSON[_0x6e8d('0x13')](_0x62837e));if(_0x62837e[_0x6e8d('0x14')]){if(_0x62837e[_0x6e8d('0x14')]['code']===0x1f4){logger[_0x6e8d('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x14080c,_0x62837e['error'][_0x6e8d('0x15')]);return _0x3e1d99(_0x62837e[_0x6e8d('0x14')][_0x6e8d('0x15')]);}logger['error'](_0x6e8d('0xf'),_0x14080c,_0x62837e['error']['message']);return _0x5b1c06(_0x62837e[_0x6e8d('0x14')][_0x6e8d('0x15')]);}else{logger['info'](_0x6e8d('0xf'),_0x14080c,'request\x20sent');_0x5b1c06(_0x62837e[_0x6e8d('0x16')]['message']);}})['catch'](function(_0x36368f){logger['error'](_0x6e8d('0xf'),_0x14080c,_0x36368f);_0x3e1d99(_0x36368f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 423bbb3..481627c 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 _0x383f=['exports','util','connect-timeout','express','Router','../../config/environment','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy'];(function(_0x592f08,_0x25c7b6){var _0x4cd8fb=function(_0x5887b1){while(--_0x5887b1){_0x592f08['push'](_0x592f08['shift']());}};_0x4cd8fb(++_0x25c7b6);}(_0x383f,0xb5));var _0xf383=function(_0x11aa15,_0x215f43){_0x11aa15=_0x11aa15-0x0;var _0xb8e22e=_0x383f[_0x11aa15];return _0xb8e22e;};'use strict';var multer=require('multer');var util=require(_0xf383('0x0'));var path=require('path');var timeout=require(_0xf383('0x1'));var express=require(_0xf383('0x2'));var router=express[_0xf383('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf383('0x4'));var controller=require(_0xf383('0x5'));router[_0xf383('0x6')]('/',auth['isAuthenticated'](),controller[_0xf383('0x7')]);router[_0xf383('0x6')]('/describe',auth[_0xf383('0x8')](),controller[_0xf383('0x9')]);router['get'](_0xf383('0xa'),auth[_0xf383('0x8')](),controller[_0xf383('0xb')]);router[_0xf383('0xc')]('/',auth[_0xf383('0x8')](),controller[_0xf383('0xd')]);router['put']('/:id',auth[_0xf383('0x8')](),controller[_0xf383('0xe')]);router[_0xf383('0xf')](_0xf383('0xa'),auth[_0xf383('0x8')](),controller[_0xf383('0x10')]);module[_0xf383('0x11')]=router; \ No newline at end of file +var _0x3d77=['index','/describe','describe','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x33f9b4,_0x5ef010){var _0x1aef13=function(_0x5a75e4){while(--_0x5a75e4){_0x33f9b4['push'](_0x33f9b4['shift']());}};_0x1aef13(++_0x5ef010);}(_0x3d77,0xc6));var _0x73d7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3d77[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x73d7('0x0'));var util=require(_0x73d7('0x1'));var path=require(_0x73d7('0x2'));var timeout=require(_0x73d7('0x3'));var express=require(_0x73d7('0x4'));var router=express[_0x73d7('0x5')]();var fs_extra=require(_0x73d7('0x6'));var auth=require(_0x73d7('0x7'));var interaction=require(_0x73d7('0x8'));var config=require(_0x73d7('0x9'));var controller=require('./chatOfflineMessage.controller');router[_0x73d7('0xa')]('/',auth[_0x73d7('0xb')](),controller[_0x73d7('0xc')]);router[_0x73d7('0xa')](_0x73d7('0xd'),auth['isAuthenticated'](),controller[_0x73d7('0xe')]);router[_0x73d7('0xa')](_0x73d7('0xf'),auth[_0x73d7('0xb')](),controller[_0x73d7('0x10')]);router[_0x73d7('0x11')]('/',auth[_0x73d7('0xb')](),controller[_0x73d7('0x12')]);router[_0x73d7('0x13')]('/:id',auth[_0x73d7('0xb')](),controller['update']);router[_0x73d7('0x14')](_0x73d7('0xf'),auth[_0x73d7('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ffb880f..16139c4 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 _0x20e9=['STRING','ENUM','mouseOver','INTEGER','sequelize','exports'];(function(_0x395e57,_0x349e66){var _0x5bb4fa=function(_0x1d3be9){while(--_0x1d3be9){_0x395e57['push'](_0x395e57['shift']());}};_0x5bb4fa(++_0x349e66);}(_0x20e9,0x166));var _0x920e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x20e9[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x920e('0x0'));module[_0x920e('0x1')]={'name':{'type':Sequelize[_0x920e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x920e('0x3')](_0x920e('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x920e('0x2')]},'timeout':{'type':Sequelize[_0x920e('0x5')]}}; \ No newline at end of file +var _0x9cc2=['STRING','ENUM','mouseOver','INTEGER'];(function(_0x4b5b42,_0x2ba151){var _0x42d774=function(_0x21d47b){while(--_0x21d47b){_0x4b5b42['push'](_0x4b5b42['shift']());}};_0x42d774(++_0x2ba151);}(_0x9cc2,0x1c8));var _0x29cc=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0x9cc2[_0x4687df];return _0x32eaef;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x29cc('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x29cc('0x1')](_0x29cc('0x2'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x29cc('0x0')]},'timeout':{'type':Sequelize[_0x29cc('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 5a3add3..c687aca 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 _0xa631=['query','intersection','fields','attributes','length','merge','ChatProactiveAction','create','body','catch','find','params','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','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','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','name','send','show','model','keys','rawAttributes'];(function(_0x1ec087,_0x357bbe){var _0x598a75=function(_0x1711c2){while(--_0x1711c2){_0x1ec087['push'](_0x1ec087['shift']());}};_0x598a75(++_0x357bbe);}(_0xa631,0xe4));var _0x1a63=function(_0x1ce2b8,_0x31a354){_0x1ce2b8=_0x1ce2b8-0x0;var _0x2a5ee3=_0xa631[_0x1ce2b8];return _0x2a5ee3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1a63('0x0'));var zipdir=require(_0x1a63('0x1'));var jsonpatch=require(_0x1a63('0x2'));var rp=require('request-promise');var moment=require(_0x1a63('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1a63('0x4'));var path=require(_0x1a63('0x5'));var sox=require(_0x1a63('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1a63('0x7'));var crypto=require(_0x1a63('0x8'));var jsforce=require(_0x1a63('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1a63('0xa'));var Papa=require(_0x1a63('0xb'));var Redis=require(_0x1a63('0xc'));var authService=require(_0x1a63('0xd'));var qs=require(_0x1a63('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1a63('0xf'));var logger=require(_0x1a63('0x10'))(_0x1a63('0x11'));var utils=require(_0x1a63('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x1a63('0x13'));var db=require(_0x1a63('0x14'))['db'];function respondWithStatusCode(_0x32269d,_0x55307f){_0x55307f=_0x55307f||0xcc;return function(_0xd7e70c){if(_0xd7e70c){return _0x32269d['sendStatus'](_0x55307f);}return _0x32269d[_0x1a63('0x15')](_0x55307f)[_0x1a63('0x16')]();};}function respondWithResult(_0x44bf20,_0x5301b6){_0x5301b6=_0x5301b6||0xc8;return function(_0x5b4ab8){if(_0x5b4ab8){return _0x44bf20[_0x1a63('0x15')](_0x5301b6)[_0x1a63('0x17')](_0x5b4ab8);}};}function respondWithFilteredResult(_0x436623,_0x3756e2){return function(_0x1c1e8c){if(_0x1c1e8c){var _0x4d66d4=typeof _0x3756e2[_0x1a63('0x18')]==='undefined'&&typeof _0x3756e2[_0x1a63('0x19')]===_0x1a63('0x1a');var _0x6a72c1=_0x1c1e8c[_0x1a63('0x1b')];var _0x52fdd1=_0x4d66d4?0x0:_0x3756e2[_0x1a63('0x18')];var _0x365ab8=_0x4d66d4?_0x1c1e8c[_0x1a63('0x1b')]:_0x3756e2[_0x1a63('0x18')]+_0x3756e2[_0x1a63('0x19')];var _0x491c8a;if(_0x365ab8>=_0x6a72c1){_0x365ab8=_0x6a72c1;_0x491c8a=0xc8;}else{_0x491c8a=0xce;}_0x436623[_0x1a63('0x15')](_0x491c8a);return _0x436623[_0x1a63('0x1c')]('Content-Range',_0x52fdd1+'-'+_0x365ab8+'/'+_0x6a72c1)[_0x1a63('0x17')](_0x1c1e8c);}return null;};}function patchUpdates(_0x444406){return function(_0x1e15a3){try{jsonpatch[_0x1a63('0x1d')](_0x1e15a3,_0x444406,!![]);}catch(_0x24646d){return BPromise[_0x1a63('0x1e')](_0x24646d);}return _0x1e15a3[_0x1a63('0x1f')]();};}function saveUpdates(_0x547d78,_0x3e4b57){return function(_0x524469){if(_0x524469){return _0x524469[_0x1a63('0x20')](_0x547d78)[_0x1a63('0x21')](function(_0x529be7){return _0x529be7;});}return null;};}function removeEntity(_0x564f9a,_0x58ff2){return function(_0x2c1a1f){if(_0x2c1a1f){return _0x2c1a1f[_0x1a63('0x22')]()[_0x1a63('0x21')](function(){_0x564f9a[_0x1a63('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x233b12,_0x22b4e1){return function(_0x3b551f){if(!_0x3b551f){_0x233b12['sendStatus'](0x194);}return _0x3b551f;};}function handleError(_0x471f63,_0x41e05e){_0x41e05e=_0x41e05e||0x1f4;return function(_0x81548f){logger[_0x1a63('0x23')](_0x81548f['stack']);if(_0x81548f['name']){delete _0x81548f[_0x1a63('0x24')];}_0x471f63[_0x1a63('0x15')](_0x41e05e)[_0x1a63('0x25')](_0x81548f);};}exports[_0x1a63('0x26')]=function(_0xa125b3,_0x399570){var _0x5e6eee={'raw':!![],'where':{'id':_0xa125b3['params']['id']}},_0x177171={};_0x177171[_0x1a63('0x27')]=_[_0x1a63('0x28')](db['ChatProactiveAction'][_0x1a63('0x29')]);_0x177171[_0x1a63('0x2a')]=_[_0x1a63('0x28')](_0xa125b3[_0x1a63('0x2a')]);_0x177171['filters']=_['intersection'](_0x177171[_0x1a63('0x27')],_0x177171[_0x1a63('0x2a')]);_0x5e6eee['attributes']=_[_0x1a63('0x2b')](_0x177171[_0x1a63('0x27')],qs[_0x1a63('0x2c')](_0xa125b3[_0x1a63('0x2a')][_0x1a63('0x2c')]));_0x5e6eee[_0x1a63('0x2d')]=_0x5e6eee['attributes'][_0x1a63('0x2e')]?_0x5e6eee[_0x1a63('0x2d')]:_0x177171[_0x1a63('0x27')];if(_0xa125b3[_0x1a63('0x2a')]['includeAll']){_0x5e6eee['include']=[{'all':!![]}];}_0x5e6eee=_[_0x1a63('0x2f')]({},_0x5e6eee,_0xa125b3['options']);return db[_0x1a63('0x30')]['find'](_0x5e6eee)[_0x1a63('0x21')](handleEntityNotFound(_0x399570,null))[_0x1a63('0x21')](respondWithResult(_0x399570,null))['catch'](handleError(_0x399570,null));};exports[_0x1a63('0x31')]=function(_0x1cb941,_0x20b129){return db[_0x1a63('0x30')]['create'](_0x1cb941[_0x1a63('0x32')],{})[_0x1a63('0x21')](respondWithResult(_0x20b129,0xc9))[_0x1a63('0x33')](handleError(_0x20b129,null));};exports[_0x1a63('0x20')]=function(_0x3954a6,_0xbe34e1){if(_0x3954a6['body']['id']){delete _0x3954a6['body']['id'];}return db[_0x1a63('0x30')][_0x1a63('0x34')]({'where':{'id':_0x3954a6[_0x1a63('0x35')]['id']}})[_0x1a63('0x21')](handleEntityNotFound(_0xbe34e1,null))[_0x1a63('0x21')](saveUpdates(_0x3954a6[_0x1a63('0x32')],null))['then'](respondWithResult(_0xbe34e1,null))[_0x1a63('0x33')](handleError(_0xbe34e1,null));};exports['destroy']=function(_0x59f1bc,_0x4c0f37){return db['ChatProactiveAction'][_0x1a63('0x34')]({'where':{'id':_0x59f1bc['params']['id']}})[_0x1a63('0x21')](handleEntityNotFound(_0x4c0f37,null))['then'](removeEntity(_0x4c0f37,null))[_0x1a63('0x33')](handleError(_0x4c0f37,null));}; \ No newline at end of file +var _0x0763=['query','fields','attributes','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','keys','intersection'];(function(_0x8905ed,_0x130f11){var _0x1d86cd=function(_0x588cd0){while(--_0x588cd0){_0x8905ed['push'](_0x8905ed['shift']());}};_0x1d86cd(++_0x130f11);}(_0x0763,0x87));var _0x3076=function(_0x572637,_0x216d95){_0x572637=_0x572637-0x0;var _0xb6748=_0x0763[_0x572637];return _0xb6748;};'use strict';var emlformat=require(_0x3076('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3076('0x1'));var jsonpatch=require(_0x3076('0x2'));var rp=require('request-promise');var moment=require(_0x3076('0x3'));var BPromise=require(_0x3076('0x4'));var Mustache=require(_0x3076('0x5'));var util=require(_0x3076('0x6'));var path=require('path');var sox=require(_0x3076('0x7'));var csv=require(_0x3076('0x8'));var ejs=require(_0x3076('0x9'));var fs=require('fs');var fs_extra=require(_0x3076('0xa'));var _=require(_0x3076('0xb'));var squel=require(_0x3076('0xc'));var crypto=require(_0x3076('0xd'));var jsforce=require(_0x3076('0xe'));var deskjs=require(_0x3076('0xf'));var toCsv=require(_0x3076('0x8'));var querystring=require('querystring');var Papa=require(_0x3076('0x10'));var Redis=require(_0x3076('0x11'));var authService=require(_0x3076('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3076('0x13'));var logger=require(_0x3076('0x14'))(_0x3076('0x15'));var utils=require(_0x3076('0x16'));var config=require(_0x3076('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3076('0x18'))['db'];function respondWithStatusCode(_0x209fc0,_0x2fe9d1){_0x2fe9d1=_0x2fe9d1||0xcc;return function(_0xc917fd){if(_0xc917fd){return _0x209fc0[_0x3076('0x19')](_0x2fe9d1);}return _0x209fc0[_0x3076('0x1a')](_0x2fe9d1)[_0x3076('0x1b')]();};}function respondWithResult(_0x3a6f74,_0x54ff6a){_0x54ff6a=_0x54ff6a||0xc8;return function(_0x5542c7){if(_0x5542c7){return _0x3a6f74[_0x3076('0x1a')](_0x54ff6a)[_0x3076('0x1c')](_0x5542c7);}};}function respondWithFilteredResult(_0x3bc84d,_0x1b2256){return function(_0x5a2088){if(_0x5a2088){var _0x5bf9ec=typeof _0x1b2256[_0x3076('0x1d')]===_0x3076('0x1e')&&typeof _0x1b2256[_0x3076('0x1f')]===_0x3076('0x1e');var _0x3d56fe=_0x5a2088[_0x3076('0x20')];var _0x21c242=_0x5bf9ec?0x0:_0x1b2256[_0x3076('0x1d')];var _0x1880b8=_0x5bf9ec?_0x5a2088[_0x3076('0x20')]:_0x1b2256[_0x3076('0x1d')]+_0x1b2256[_0x3076('0x1f')];var _0x4e441d;if(_0x1880b8>=_0x3d56fe){_0x1880b8=_0x3d56fe;_0x4e441d=0xc8;}else{_0x4e441d=0xce;}_0x3bc84d[_0x3076('0x1a')](_0x4e441d);return _0x3bc84d[_0x3076('0x21')]('Content-Range',_0x21c242+'-'+_0x1880b8+'/'+_0x3d56fe)[_0x3076('0x1c')](_0x5a2088);}return null;};}function patchUpdates(_0x50f366){return function(_0x34c831){try{jsonpatch[_0x3076('0x22')](_0x34c831,_0x50f366,!![]);}catch(_0x1f8914){return BPromise['reject'](_0x1f8914);}return _0x34c831[_0x3076('0x23')]();};}function saveUpdates(_0x250cc4,_0x2398f4){return function(_0x9b4bec){if(_0x9b4bec){return _0x9b4bec[_0x3076('0x24')](_0x250cc4)[_0x3076('0x25')](function(_0x1a2131){return _0x1a2131;});}return null;};}function removeEntity(_0xa975bc,_0x195606){return function(_0x39a33c){if(_0x39a33c){return _0x39a33c['destroy']()[_0x3076('0x25')](function(){_0xa975bc['status'](0xcc)[_0x3076('0x1b')]();});}};}function handleEntityNotFound(_0x4f4bdc,_0x53b45d){return function(_0x41ecf4){if(!_0x41ecf4){_0x4f4bdc[_0x3076('0x19')](0x194);}return _0x41ecf4;};}function handleError(_0x2f0848,_0x1b169b){_0x1b169b=_0x1b169b||0x1f4;return function(_0x28d834){logger[_0x3076('0x26')](_0x28d834[_0x3076('0x27')]);if(_0x28d834[_0x3076('0x28')]){delete _0x28d834[_0x3076('0x28')];}_0x2f0848[_0x3076('0x1a')](_0x1b169b)[_0x3076('0x29')](_0x28d834);};}exports['show']=function(_0x181591,_0x45805e){var _0x32bdbd={'raw':!![],'where':{'id':_0x181591[_0x3076('0x2a')]['id']}},_0x5af88e={};_0x5af88e[_0x3076('0x2b')]=_['keys'](db[_0x3076('0x2c')][_0x3076('0x2d')]);_0x5af88e['query']=_[_0x3076('0x2e')](_0x181591['query']);_0x5af88e['filters']=_[_0x3076('0x2f')](_0x5af88e[_0x3076('0x2b')],_0x5af88e[_0x3076('0x30')]);_0x32bdbd['attributes']=_[_0x3076('0x2f')](_0x5af88e[_0x3076('0x2b')],qs[_0x3076('0x31')](_0x181591[_0x3076('0x30')]['fields']));_0x32bdbd[_0x3076('0x32')]=_0x32bdbd[_0x3076('0x32')][_0x3076('0x33')]?_0x32bdbd[_0x3076('0x32')]:_0x5af88e[_0x3076('0x2b')];if(_0x181591['query'][_0x3076('0x34')]){_0x32bdbd[_0x3076('0x35')]=[{'all':!![]}];}_0x32bdbd=_[_0x3076('0x36')]({},_0x32bdbd,_0x181591[_0x3076('0x37')]);return db[_0x3076('0x2c')][_0x3076('0x38')](_0x32bdbd)['then'](handleEntityNotFound(_0x45805e,null))[_0x3076('0x25')](respondWithResult(_0x45805e,null))['catch'](handleError(_0x45805e,null));};exports[_0x3076('0x39')]=function(_0x1d6b0b,_0x605784){return db[_0x3076('0x2c')][_0x3076('0x39')](_0x1d6b0b[_0x3076('0x3a')],{})[_0x3076('0x25')](respondWithResult(_0x605784,0xc9))[_0x3076('0x3b')](handleError(_0x605784,null));};exports[_0x3076('0x24')]=function(_0x2c912c,_0x2ea216){if(_0x2c912c[_0x3076('0x3a')]['id']){delete _0x2c912c[_0x3076('0x3a')]['id'];}return db[_0x3076('0x2c')][_0x3076('0x38')]({'where':{'id':_0x2c912c[_0x3076('0x2a')]['id']}})[_0x3076('0x25')](handleEntityNotFound(_0x2ea216,null))[_0x3076('0x25')](saveUpdates(_0x2c912c[_0x3076('0x3a')],null))[_0x3076('0x25')](respondWithResult(_0x2ea216,null))[_0x3076('0x3b')](handleError(_0x2ea216,null));};exports[_0x3076('0x3c')]=function(_0x431681,_0x852954){return db[_0x3076('0x2c')][_0x3076('0x38')]({'where':{'id':_0x431681[_0x3076('0x2a')]['id']}})['then'](handleEntityNotFound(_0x852954,null))[_0x3076('0x25')](removeEntity(_0x852954,null))[_0x3076('0x3b')](handleError(_0x852954,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1fd5417..d12d8da 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 _0x0469=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api','moment','bluebird','request-promise','path'];(function(_0x48fdbb,_0x3239bd){var _0x198205=function(_0x1dd8c6){while(--_0x1dd8c6){_0x48fdbb['push'](_0x48fdbb['shift']());}};_0x198205(++_0x3239bd);}(_0x0469,0xe4));var _0x9046=function(_0x37edf6,_0x1ef3a8){_0x37edf6=_0x37edf6-0x0;var _0xbf0705=_0x0469[_0x37edf6];return _0xbf0705;};'use strict';var _=require('lodash');var util=require(_0x9046('0x0'));var logger=require('../../config/logger')(_0x9046('0x1'));var moment=require(_0x9046('0x2'));var BPromise=require(_0x9046('0x3'));var rp=require(_0x9046('0x4'));var fs=require('fs');var path=require(_0x9046('0x5'));var rimraf=require(_0x9046('0x6'));var config=require(_0x9046('0x7'));var attributes=require(_0x9046('0x8'));module[_0x9046('0x9')]=function(_0x17fd9c,_0x3a371e){return _0x17fd9c[_0x9046('0xa')](_0x9046('0xb'),attributes,{'tableName':_0x9046('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6e5=['exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x280146,_0x5bd8e6){var _0x476c54=function(_0xfa5133){while(--_0xfa5133){_0x280146['push'](_0x280146['shift']());}};_0x476c54(++_0x5bd8e6);}(_0xc6e5,0xed));var _0x5c6e=function(_0xe163e,_0x1867eb){_0xe163e=_0xe163e-0x0;var _0x204772=_0xc6e5[_0xe163e];return _0x204772;};'use strict';var _=require(_0x5c6e('0x0'));var util=require(_0x5c6e('0x1'));var logger=require(_0x5c6e('0x2'))(_0x5c6e('0x3'));var moment=require(_0x5c6e('0x4'));var BPromise=require(_0x5c6e('0x5'));var rp=require(_0x5c6e('0x6'));var fs=require('fs');var path=require(_0x5c6e('0x7'));var rimraf=require(_0x5c6e('0x8'));var config=require(_0x5c6e('0x9'));var attributes=require('./chatProactiveAction.attributes');module[_0x5c6e('0xa')]=function(_0x118639,_0x5e3080){return _0x118639[_0x5c6e('0xb')](_0x5c6e('0xc'),attributes,{'tableName':'chat_proactive_actions','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 287e49b..553118b 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 _0xc2f7=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xc2f7,0x1d4));var _0x7c2f=function(_0xb7da38,_0x488bcc){_0xb7da38=_0xb7da38-0x0;var _0x12749f=_0xc2f7[_0xb7da38];return _0x12749f;};'use strict';var _=require(_0x7c2f('0x0'));var util=require(_0x7c2f('0x1'));var moment=require(_0x7c2f('0x2'));var BPromise=require(_0x7c2f('0x3'));var rs=require(_0x7c2f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7c2f('0x5'))(_0x7c2f('0x6'));var config=require(_0x7c2f('0x7'));var jayson=require(_0x7c2f('0x8'));var client=jayson[_0x7c2f('0x9')][_0x7c2f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41f40c,_0x5adc32,_0x2ee20d){return new BPromise(function(_0x5217b2,_0x156bd3){return client['request'](_0x41f40c,_0x2ee20d)[_0x7c2f('0xb')](function(_0x34ebaf){logger[_0x7c2f('0xc')](_0x7c2f('0xd'),_0x5adc32,_0x7c2f('0xe'));logger[_0x7c2f('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5adc32,_0x7c2f('0xe'),JSON['stringify'](_0x34ebaf));if(_0x34ebaf['error']){if(_0x34ebaf[_0x7c2f('0x10')]['code']===0x1f4){logger['error'](_0x7c2f('0xd'),_0x5adc32,_0x34ebaf[_0x7c2f('0x10')][_0x7c2f('0x11')]);return _0x156bd3(_0x34ebaf[_0x7c2f('0x10')]['message']);}logger[_0x7c2f('0x10')](_0x7c2f('0xd'),_0x5adc32,_0x34ebaf['error'][_0x7c2f('0x11')]);return _0x5217b2(_0x34ebaf[_0x7c2f('0x10')][_0x7c2f('0x11')]);}else{logger[_0x7c2f('0xc')](_0x7c2f('0xd'),_0x5adc32,_0x7c2f('0xe'));_0x5217b2(_0x34ebaf[_0x7c2f('0x12')][_0x7c2f('0x11')]);}})[_0x7c2f('0x13')](function(_0x3e43b5){logger['error'](_0x7c2f('0xd'),_0x5adc32,_0x3e43b5);_0x156bd3(_0x3e43b5);});});} \ No newline at end of file +var _0xc67b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment'];(function(_0x41909f,_0x32eb77){var _0x50de06=function(_0x29f0e5){while(--_0x29f0e5){_0x41909f['push'](_0x41909f['shift']());}};_0x50de06(++_0x32eb77);}(_0xc67b,0x1df));var _0xbc67=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xc67b[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbc67('0x0'));var BPromise=require(_0xbc67('0x1'));var rs=require(_0xbc67('0x2'));var fs=require('fs');var Redis=require(_0xbc67('0x3'));var db=require(_0xbc67('0x4'))['db'];var utils=require(_0xbc67('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbc67('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x47ca4e,_0x48e160,_0x17a6ad){return new BPromise(function(_0x47e440,_0x3b1ac0){return client[_0xbc67('0x7')](_0x47ca4e,_0x17a6ad)[_0xbc67('0x8')](function(_0x484293){logger[_0xbc67('0x9')](_0xbc67('0xa'),_0x48e160,'request\x20sent');logger[_0xbc67('0xb')](_0xbc67('0xc'),_0x48e160,'request\x20sent',JSON[_0xbc67('0xd')](_0x484293));if(_0x484293[_0xbc67('0xe')]){if(_0x484293[_0xbc67('0xe')][_0xbc67('0xf')]===0x1f4){logger[_0xbc67('0xe')](_0xbc67('0xa'),_0x48e160,_0x484293[_0xbc67('0xe')][_0xbc67('0x10')]);return _0x3b1ac0(_0x484293['error']['message']);}logger[_0xbc67('0xe')](_0xbc67('0xa'),_0x48e160,_0x484293[_0xbc67('0xe')][_0xbc67('0x10')]);return _0x47e440(_0x484293[_0xbc67('0xe')][_0xbc67('0x10')]);}else{logger[_0xbc67('0x9')](_0xbc67('0xa'),_0x48e160,_0xbc67('0x11'));_0x47e440(_0x484293[_0xbc67('0x12')]['message']);}})[_0xbc67('0x13')](function(_0x2adf63){logger[_0xbc67('0xe')](_0xbc67('0xa'),_0x48e160,_0x2adf63);_0x3b1ac0(_0x2adf63);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d937627..b1e9b7a 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0xc02d1d,_0x4adc51){var _0x51e0a2=function(_0x4a0f13){while(--_0x4a0f13){_0xc02d1d['push'](_0xc02d1d['shift']());}};_0x51e0a2(++_0x4adc51);}(_0x33c5,0xe6));var _0x533c=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0x33c5[_0xbebf50];return _0xce1496;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x46ed,0x168));var _0xd46e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x46ed[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0xa')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')](_0xd46e('0x9'),auth[_0xd46e('0xa')](),controller['update']);router[_0xd46e('0xf')](_0xd46e('0x9'),auth['isAuthenticated'](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index caa03da..524ebda 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 _0xe549=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x256668,_0xa5a225){var _0x23668c=function(_0x1477db){while(--_0x1477db){_0x256668['push'](_0x256668['shift']());}};_0x23668c(++_0xa5a225);}(_0xe549,0xcc));var _0x9e54=function(_0x433be1,_0x3d5097){_0x433be1=_0x433be1-0x0;var _0x492e3f=_0xe549[_0x433be1];return _0x492e3f;};'use strict';var Sequelize=require(_0x9e54('0x0'));module[_0x9e54('0x1')]={'name':{'type':Sequelize[_0x9e54('0x2')],'unique':_0x9e54('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9e54('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9e54('0x5'),_0x9e54('0x6'),_0x9e54('0x7'))}}; \ No newline at end of file +var _0x9794=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x17a22a,_0x4d1ba7){var _0x1c1735=function(_0x1fac7d){while(--_0x1fac7d){_0x17a22a['push'](_0x17a22a['shift']());}};_0x1c1735(++_0x4d1ba7);}(_0x9794,0x113));var _0x4979=function(_0x370c77,_0x4b8e85){_0x370c77=_0x370c77-0x0;var _0x5a7ef7=_0x9794[_0x370c77];return _0x5a7ef7;};'use strict';var Sequelize=require(_0x4979('0x0'));module[_0x4979('0x1')]={'name':{'type':Sequelize[_0x4979('0x2')],'unique':_0x4979('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4979('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4979('0x4')](_0x4979('0x5'),_0x4979('0x6'),_0x4979('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 60af6e2..c9f29ce 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 _0x6e5e=['attributes','fields','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','length','order','sort','pick','ChatQueueId','filter','User','findAndCountAll','UserId','chatPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','hasOwnProperty','addTeams','ids','Agents','interface','flatMap','transaction','each','findOrCreate','emit','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','clone','push','toString','sequelize','SELECT','every','TeamId','includes','all','value','forEach','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','options','nolimit','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','./chatQueue.socket','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','query','findAll','rows','params','model','keys','filters','intersection'];(function(_0x1278b6,_0x24252e){var _0x2cff42=function(_0x46b845){while(--_0x46b845){_0x1278b6['push'](_0x1278b6['shift']());}};_0x2cff42(++_0x24252e);}(_0x6e5e,0x133));var _0xe6e5=function(_0x4f42db,_0x13c7aa){_0x4f42db=_0x4f42db-0x0;var _0x44b85d=_0x6e5e[_0x4f42db];return _0x44b85d;};'use strict';var BPromise=require('bluebird');var util=require(_0xe6e5('0x0'));var _=require(_0xe6e5('0x1'));var squel=require(_0xe6e5('0x2'));var Redis=require(_0xe6e5('0x3'));var qs=require(_0xe6e5('0x4'));var logger=require(_0xe6e5('0x5'))(_0xe6e5('0x6'));var config=require(_0xe6e5('0x7'));var db=require(_0xe6e5('0x8'))['db'];config[_0xe6e5('0x9')]=_['defaults'](config[_0xe6e5('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6e5('0x9')]));require(_0xe6e5('0xa'))[_0xe6e5('0xb')](socket);function respondWithStatusCode(_0x4a346a,_0x4e207c){_0x4e207c=_0x4e207c||0xcc;return function(_0x31045a){if(_0x31045a){return _0x4a346a[_0xe6e5('0xc')](_0x4e207c);}return _0x4a346a['status'](_0x4e207c)[_0xe6e5('0xd')]();};}function respondWithResult(_0x1c354b,_0x131531){_0x131531=_0x131531||0xc8;return function(_0x26f5cd){if(_0x26f5cd){return _0x1c354b['status'](_0x131531)['json'](_0x26f5cd);}};}function respondWithFilteredResult(_0x24f60c,_0x240b09){return function(_0x1218f2){if(_0x1218f2){var _0x3a8942=typeof _0x240b09[_0xe6e5('0xe')]===_0xe6e5('0xf')&&typeof _0x240b09[_0xe6e5('0x10')]===_0xe6e5('0xf');var _0x5e25b1=_0x1218f2[_0xe6e5('0x11')];var _0x22e4a=_0x3a8942?0x0:_0x240b09[_0xe6e5('0xe')];var _0x4118b1=_0x3a8942?_0x1218f2[_0xe6e5('0x11')]:_0x240b09[_0xe6e5('0xe')]+_0x240b09[_0xe6e5('0x10')];var _0x3bfc91;if(_0x4118b1>=_0x5e25b1){_0x4118b1=_0x5e25b1;_0x3bfc91=0xc8;}else{_0x3bfc91=0xce;}_0x24f60c[_0xe6e5('0x12')](_0x3bfc91);return _0x24f60c['set'](_0xe6e5('0x13'),_0x22e4a+'-'+_0x4118b1+'/'+_0x5e25b1)[_0xe6e5('0x14')](_0x1218f2);}return null;};}function saveUpdates(_0x3a4365){return function(_0x121ad2){if(_0x121ad2){return _0x121ad2[_0xe6e5('0x15')](_0x3a4365)[_0xe6e5('0x16')](function(_0x16d296){return _0x16d296;});}return null;};}function removeEntity(_0x1ef188){return function(_0x298cbb){if(_0x298cbb){return _0x298cbb[_0xe6e5('0x17')]()[_0xe6e5('0x16')](function(){var _0x1a3cff=_0x298cbb[_0xe6e5('0x18')]({'plain':!![]});var _0x10af43=_0xe6e5('0x19');return db[_0xe6e5('0x1a')]['destroy']({'where':{'type':_0x10af43,'resourceId':_0x1a3cff['id']}})[_0xe6e5('0x16')](function(){return _0x298cbb;});})[_0xe6e5('0x16')](function(){_0x1ef188[_0xe6e5('0x12')](0xcc)[_0xe6e5('0xd')]();});}};}function handleEntityNotFound(_0x243834){return function(_0x42e43c){if(!_0x42e43c){_0x243834['sendStatus'](0x194);}return _0x42e43c;};}function handleError(_0x578665,_0x46a8c3){_0x46a8c3=_0x46a8c3||0x1f4;return function(_0x1305fc){logger[_0xe6e5('0x1b')](_0x1305fc[_0xe6e5('0x1c')]);if(_0x1305fc[_0xe6e5('0x1d')]){delete _0x1305fc[_0xe6e5('0x1d')];}_0x578665['status'](_0x46a8c3)['send'](_0x1305fc);};}exports['index']=function(_0x2c2b18,_0x59eebb){var _0xafea7d={};var _0xdf4bfc={'count':0x0,'rows':[]};var _0x8bf0c2=_[_0xe6e5('0x1e')](db['ChatQueue'][_0xe6e5('0x1f')],function(_0x41588d){return{'name':_0x41588d[_0xe6e5('0x20')],'type':_0x41588d[_0xe6e5('0x21')][_0xe6e5('0x22')]};});_0xafea7d=qs[_0xe6e5('0x23')](_0x8bf0c2,_0x2c2b18);var _0x5305b8={'where':_0xafea7d[_0xe6e5('0x24')]};return db[_0xe6e5('0x25')]['count'](_0x5305b8)[_0xe6e5('0x16')](function(_0x186507){_0xdf4bfc[_0xe6e5('0x11')]=_0x186507;_0xafea7d[_0xe6e5('0x26')]=qs['include'](_0x2c2b18[_0xe6e5('0x27')]);return db[_0xe6e5('0x25')][_0xe6e5('0x28')](_0xafea7d);})[_0xe6e5('0x16')](function(_0x455491){_0xdf4bfc[_0xe6e5('0x29')]=_0x455491;return _0xdf4bfc;})[_0xe6e5('0x16')](respondWithFilteredResult(_0x59eebb,_0xafea7d))['catch'](handleError(_0x59eebb,null));};exports['show']=function(_0x28e3fd,_0x59b814){var _0xcc52cf={'raw':!![],'where':{'id':_0x28e3fd[_0xe6e5('0x2a')]['id']}},_0x4d5f88={};_0x4d5f88[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db['ChatQueue'][_0xe6e5('0x1f')]);_0x4d5f88['query']=_[_0xe6e5('0x2c')](_0x28e3fd['query']);_0x4d5f88[_0xe6e5('0x2d')]=_[_0xe6e5('0x2e')](_0x4d5f88[_0xe6e5('0x2b')],_0x4d5f88[_0xe6e5('0x27')]);_0xcc52cf[_0xe6e5('0x2f')]=_[_0xe6e5('0x2e')](_0x4d5f88[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x28e3fd[_0xe6e5('0x27')][_0xe6e5('0x30')]));_0xcc52cf['attributes']=_0xcc52cf[_0xe6e5('0x2f')]['length']?_0xcc52cf['attributes']:_0x4d5f88[_0xe6e5('0x2b')];if(_0x28e3fd[_0xe6e5('0x27')]['includeAll']){_0xcc52cf['include']=[{'all':!![]}];}_0xcc52cf=_[_0xe6e5('0x31')]({},_0xcc52cf,_0x28e3fd['options']);return db[_0xe6e5('0x25')][_0xe6e5('0x32')](_0xcc52cf)[_0xe6e5('0x16')](handleEntityNotFound(_0x59b814,null))['then'](respondWithResult(_0x59b814,null))[_0xe6e5('0x33')](handleError(_0x59b814,null));};exports[_0xe6e5('0x34')]=function(_0x4f7fcc,_0x275864){return db['ChatQueue'][_0xe6e5('0x34')](_0x4f7fcc[_0xe6e5('0x35')],{})[_0xe6e5('0x16')](function(_0x3477d0){var _0x5e8e76=_0x4f7fcc[_0xe6e5('0x36')][_0xe6e5('0x18')]({'plain':!![]});if(!_0x5e8e76)throw new Error(_0xe6e5('0x37'));if(_0x5e8e76[_0xe6e5('0x38')]===_0xe6e5('0x36')){var _0x1019e1=_0x3477d0['get']({'plain':!![]});var _0x596878=_0xe6e5('0x19');return db[_0xe6e5('0x39')][_0xe6e5('0x32')]({'where':{'name':_0x596878,'userProfileId':_0x5e8e76[_0xe6e5('0x3a')]},'raw':!![]})['then'](function(_0x2ff190){if(_0x2ff190&&_0x2ff190[_0xe6e5('0x3b')]===0x0){return db['UserProfileResource'][_0xe6e5('0x34')]({'name':_0x1019e1[_0xe6e5('0x1d')],'resourceId':_0x1019e1['id'],'type':_0x2ff190[_0xe6e5('0x1d')],'sectionId':_0x2ff190['id']},{})[_0xe6e5('0x16')](function(){return _0x3477d0;});}else{return _0x3477d0;}})[_0xe6e5('0x33')](function(_0x1a9b7d){logger[_0xe6e5('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a9b7d);throw _0x1a9b7d;});}return _0x3477d0;})[_0xe6e5('0x16')](respondWithResult(_0x275864,0xc9))[_0xe6e5('0x33')](handleError(_0x275864,null));};exports[_0xe6e5('0x15')]=function(_0x1201cc,_0x2d4699){if(_0x1201cc['body']['id']){delete _0x1201cc[_0xe6e5('0x35')]['id'];}return db[_0xe6e5('0x25')][_0xe6e5('0x32')]({'where':{'id':_0x1201cc[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x2d4699,null))[_0xe6e5('0x16')](saveUpdates(_0x1201cc[_0xe6e5('0x35')],null))['then'](respondWithResult(_0x2d4699,null))[_0xe6e5('0x33')](handleError(_0x2d4699,null));};exports['destroy']=function(_0x17e037,_0x45d9a4){return db[_0xe6e5('0x25')]['find']({'where':{'id':_0x17e037[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x45d9a4,null))[_0xe6e5('0x16')](removeEntity(_0x45d9a4,null))[_0xe6e5('0x33')](handleError(_0x45d9a4,null));};exports[_0xe6e5('0x3c')]=function(_0x107fcd,_0x5d14d9){return db[_0xe6e5('0x25')]['describe']()['then'](respondWithResult(_0x5d14d9,null))[_0xe6e5('0x33')](handleError(_0x5d14d9,null));};exports[_0xe6e5('0x3d')]=function(_0x482f39,_0x42b767){var _0x29c742={'raw':!![],'where':{}},_0x265d23={},_0xb63e58;return db['ChatQueue'][_0xe6e5('0x3e')]({'where':{'id':_0x482f39[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x42b767,null))[_0xe6e5('0x16')](function(_0x289d57){if(_0x289d57){_0xb63e58=_0x289d57[_0xe6e5('0x18')]({'plain':!![]});_0x265d23[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db[_0xe6e5('0x3f')][_0xe6e5('0x1f')]);_0x265d23['query']=_['keys'](_0x482f39[_0xe6e5('0x27')]);_0x265d23[_0xe6e5('0x2d')]=_[_0xe6e5('0x2e')](_0x265d23['model'],_0x265d23[_0xe6e5('0x27')]);_0x29c742['attributes']=_[_0xe6e5('0x2e')](_0x265d23[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x482f39[_0xe6e5('0x27')][_0xe6e5('0x30')]));_0x29c742[_0xe6e5('0x2f')]=_0x29c742[_0xe6e5('0x2f')][_0xe6e5('0x40')]?_0x29c742[_0xe6e5('0x2f')]:_0x265d23[_0xe6e5('0x2b')];if(!_0x482f39[_0xe6e5('0x27')]['hasOwnProperty']('nolimit')){_0x29c742[_0xe6e5('0x10')]=qs[_0xe6e5('0x10')](_0x482f39[_0xe6e5('0x27')]['limit']);_0x29c742[_0xe6e5('0xe')]=qs['offset'](_0x482f39[_0xe6e5('0x27')]['offset']);}_0x29c742[_0xe6e5('0x41')]=qs[_0xe6e5('0x42')](_0x482f39[_0xe6e5('0x27')][_0xe6e5('0x42')]);_0x29c742['where']=qs[_0xe6e5('0x2d')](_[_0xe6e5('0x43')](_0x482f39[_0xe6e5('0x27')],_0x265d23['filters']));_0x29c742[_0xe6e5('0x24')][_0xe6e5('0x44')]=_0x289d57['id'];if(_0x482f39[_0xe6e5('0x27')][_0xe6e5('0x45')]){_0x29c742['where']=_[_0xe6e5('0x31')](_0x29c742[_0xe6e5('0x24')],{'$or':_[_0xe6e5('0x1e')](_0x29c742['attributes'],function(_0x5e5414){var _0x3bc405={};_0x3bc405[_0x5e5414]={'$like':'%'+_0x482f39[_0xe6e5('0x27')]['filter']+'%'};return _0x3bc405;})});}_0x29c742=_[_0xe6e5('0x31')]({},_0x29c742,_0x482f39['options']);return db['UserChatQueue'][_0xe6e5('0x28')](_0x29c742);}})[_0xe6e5('0x16')](function(_0x53ddcd){if(_0x53ddcd){return db[_0xe6e5('0x46')][_0xe6e5('0x47')]({'where':{'id':_[_0xe6e5('0x1e')](_0x53ddcd,_0xe6e5('0x48')),'role':'agent'},'attributes':['id','name',_0xe6e5('0x49'),_0xe6e5('0x4a'),_0xe6e5('0x4b')]});}})[_0xe6e5('0x16')](function(_0x51ea5b){if(_0x51ea5b){return{'count':_0x51ea5b['count'],'rows':_[_0xe6e5('0x1e')](_0x51ea5b[_0xe6e5('0x29')],function(_0x3058f2){return{'membername':_0x3058f2[_0xe6e5('0x1d')],'UserId':_0x3058f2['id'],'queue_name':_0xb63e58[_0xe6e5('0x1d')],'ChatQueueId':_0xb63e58['id'],'interface':util['format'](_0xe6e5('0x4c'),_0xe6e5('0x4d'),_0x3058f2['name']),'penalty':0x0,'paused':_0x3058f2[_0xe6e5('0x49')],'createdAt':_0x3058f2[_0xe6e5('0x4b')],'updatedAt':_0x3058f2[_0xe6e5('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe6e5('0x16')](respondWithFilteredResult(_0x42b767,_0x29c742))[_0xe6e5('0x33')](handleError(_0x42b767,null));};exports['getTeams']=function(_0x592355,_0x12e178){var _0x5c1909={};var _0x14e99c={};var _0x582248;var _0x8d432;return db[_0xe6e5('0x25')][_0xe6e5('0x3e')]({'where':{'id':_0x592355[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x12e178,null))[_0xe6e5('0x16')](function(_0x5ac588){if(_0x5ac588){_0x582248=_0x5ac588;_0x14e99c[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db[_0xe6e5('0x4e')]['rawAttributes']);_0x14e99c[_0xe6e5('0x27')]=_['keys'](_0x592355[_0xe6e5('0x27')]);_0x14e99c['filters']=_[_0xe6e5('0x2e')](_0x14e99c[_0xe6e5('0x2b')],_0x14e99c[_0xe6e5('0x27')]);_0x5c1909[_0xe6e5('0x2f')]=_[_0xe6e5('0x2e')](_0x14e99c[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x592355['query']['fields']));_0x5c1909[_0xe6e5('0x2f')]=_0x5c1909[_0xe6e5('0x2f')]['length']?_0x5c1909['attributes']:_0x14e99c[_0xe6e5('0x2b')];_0x5c1909['order']=qs[_0xe6e5('0x42')](_0x592355['query'][_0xe6e5('0x42')]);_0x5c1909['where']=qs[_0xe6e5('0x2d')](_['pick'](_0x592355['query'],_0x14e99c[_0xe6e5('0x2d')]));if(_0x592355['query']['filter']){_0x5c1909[_0xe6e5('0x24')]=_[_0xe6e5('0x31')](_0x5c1909[_0xe6e5('0x24')],{'$or':_['map'](_0x5c1909[_0xe6e5('0x2f')],function(_0x5d2e0f){var _0x18a96f={};_0x18a96f[_0x5d2e0f]={'$like':'%'+_0x592355[_0xe6e5('0x27')]['filter']+'%'};return _0x18a96f;})});}_0x5c1909=_['merge']({},_0x5c1909,_0x592355['options']);return _0x582248[_0xe6e5('0x4f')](_0x5c1909);}})[_0xe6e5('0x16')](function(_0x420428){if(_0x420428){_0x8d432=_0x420428[_0xe6e5('0x40')];if(!_0x592355['query'][_0xe6e5('0x50')]('nolimit')){_0x5c1909[_0xe6e5('0x10')]=qs[_0xe6e5('0x10')](_0x592355['query'][_0xe6e5('0x10')]);_0x5c1909[_0xe6e5('0xe')]=qs[_0xe6e5('0xe')](_0x592355[_0xe6e5('0x27')][_0xe6e5('0xe')]);}return _0x582248[_0xe6e5('0x4f')](_0x5c1909);}})[_0xe6e5('0x16')](function(_0x545e4c){if(_0x545e4c){return _0x545e4c?{'count':_0x8d432,'rows':_0x545e4c}:null;}})[_0xe6e5('0x16')](respondWithResult(_0x12e178,null))[_0xe6e5('0x33')](handleError(_0x12e178,null));};exports[_0xe6e5('0x51')]=function(_0x2a801c,_0x2231df){var _0x5ee6d4=_0x2a801c[_0xe6e5('0x35')][_0xe6e5('0x52')];return db[_0xe6e5('0x4e')][_0xe6e5('0x28')]({'where':{'id':_0x5ee6d4},'attributes':['id'],'include':[{'model':db[_0xe6e5('0x46')],'as':_0xe6e5('0x53'),'attributes':['id','name','online','voicePause',_0xe6e5('0x54')],'raw':!![]}]})[_0xe6e5('0x16')](function(_0x38a3e1){if(_0x38a3e1){var _0xe521bb=_[_0xe6e5('0x55')](_0x38a3e1,function(_0x5a2e9f){var _0x3fdee1=_0x5a2e9f['get']({'plain':!![]});return _0x3fdee1[_0xe6e5('0x53')];});return db[_0xe6e5('0x25')][_0xe6e5('0x32')]({'where':{'id':_0x2a801c[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](function(_0x5adcc7){return db['sequelize'][_0xe6e5('0x56')](function(_0x271fd6){return _0x5adcc7[_0xe6e5('0x51')](_0x5ee6d4,{'transaction':_0x271fd6})[_0xe6e5('0x16')](function(){return BPromise[_0xe6e5('0x57')](_0xe521bb,function(_0x2313a5){return db['UserChatQueue'][_0xe6e5('0x58')]({'where':{'UserId':_0x2313a5['id'],'ChatQueueId':_0x2a801c[_0xe6e5('0x2a')]['id']},'transaction':_0x271fd6});});})['then'](function(){_0xe521bb['forEach'](function(_0x27156b){socket[_0xe6e5('0x59')]('userChatQueue:save',{'UserId':_0x27156b['id'],'ChatQueueId':_0x5adcc7['id']});});});});});}})['then'](respondWithStatusCode(_0x2231df,null))[_0xe6e5('0x33')](handleError(_0x2231df,null));};exports[_0xe6e5('0x5a')]=function(_0x5df89b,_0x5353b4){return db[_0xe6e5('0x4e')]['findAll']({'where':{'id':_0x5df89b[_0xe6e5('0x27')][_0xe6e5('0x52')]},'attributes':['id'],'include':[{'model':db[_0xe6e5('0x46')],'as':_0xe6e5('0x53'),'attributes':['id'],'raw':!![]}]})[_0xe6e5('0x16')](handleEntityNotFound(_0x5353b4,null))[_0xe6e5('0x16')](function(_0x29bd29){var _0x45550b=_[_0xe6e5('0x1e')](_0x29bd29,'id');var _0x640a5f=[];var _0x4f042a=[];var _0xeaa19a=squel['select']();_0xeaa19a[_0xe6e5('0x5b')](_0xe6e5('0x5c'))[_0xe6e5('0x5d')](_0xe6e5('0x5e'),'tq')[_0xe6e5('0x5f')](_0xe6e5('0x60'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe6e5('0x24')]('ChatQueueId\x20=\x20?',_0x5df89b[_0xe6e5('0x2a')]['id']);for(var _0x502e4e=0x0;_0x502e4e<_0x29bd29[_0xe6e5('0x40')];_0x502e4e+=0x1){let _0x4b50c6=_0x29bd29[_0x502e4e];for(var _0x52c53a=0x0;_0x52c53a<_0x4b50c6[_0xe6e5('0x53')]['length'];_0x52c53a+=0x1){let _0x54a87f=_0x4b50c6[_0xe6e5('0x53')][_0x52c53a];var _0x3d1ccc=_0xeaa19a[_0xe6e5('0x61')]();_0x3d1ccc[_0xe6e5('0x24')]('ut.UserId\x20=\x20?',_0x54a87f['id']);_0x4f042a[_0xe6e5('0x62')](db['sequelize']['query'](_0x3d1ccc[_0xe6e5('0x63')](),{'type':db[_0xe6e5('0x64')]['QueryTypes'][_0xe6e5('0x65')]})[_0xe6e5('0x16')](function(_0x25e4f0){if(_0x25e4f0[_0xe6e5('0x40')]===0x1){return _0x54a87f['id'];}else{var _0xc07923=_[_0xe6e5('0x66')](_[_0xe6e5('0x1e')](_0x25e4f0,_0xe6e5('0x67')),function(_0x5579f1){return _[_0xe6e5('0x68')](_0x45550b,_0x5579f1);});if(_0xc07923){return _0x54a87f['id'];}}}));}}return BPromise[_0xe6e5('0x69')](_0x4f042a)[_0xe6e5('0x16')](function(_0x2a243a){_0x640a5f=_(_0x640a5f)['union'](_0x2a243a)['compact']()[_0xe6e5('0x6a')]();return db[_0xe6e5('0x25')]['find']({'where':{'id':_0x5df89b[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](function(_0xe0f5b3){return db['sequelize'][_0xe6e5('0x56')](function(_0x5a40d8){return _0xe0f5b3['removeTeams'](_0x5df89b[_0xe6e5('0x27')][_0xe6e5('0x52')],{'transaction':_0x5a40d8})[_0xe6e5('0x16')](function(){if(!_['isEmpty'](_0x640a5f)){return _0xe0f5b3['removeAgents'](_0x640a5f,{'transaction':_0x5a40d8});}})['then'](function(){_0x640a5f[_0xe6e5('0x6b')](function(_0x4f89de){socket[_0xe6e5('0x59')](_0xe6e5('0x6c'),{'UserId':_0x4f89de,'ChatQueueId':_0xe0f5b3['id']});});});});});});})[_0xe6e5('0x16')](respondWithStatusCode(_0x5353b4,null))[_0xe6e5('0x33')](handleError(_0x5353b4,null));};exports[_0xe6e5('0x6d')]=function(_0x3b3476,_0x49d605){return db[_0xe6e5('0x25')]['find']({'where':{'id':_0x3b3476[_0xe6e5('0x2a')]['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x49d605,null))[_0xe6e5('0x16')](function(_0x20b8d6){if(_0x20b8d6){return _0x20b8d6['addAgents'](_0x3b3476[_0xe6e5('0x35')][_0xe6e5('0x52')],_[_0xe6e5('0x6e')](_0x3b3476[_0xe6e5('0x35')],[_0xe6e5('0x52'),'id'])||{})[_0xe6e5('0x6f')](function(_0x4ebbf2){for(var _0x32d7cf=0x0;_0x32d7cf<_0x3b3476[_0xe6e5('0x35')][_0xe6e5('0x52')]['length'];_0x32d7cf+=0x1){socket[_0xe6e5('0x59')](_0xe6e5('0x70'),{'UserId':Number(_0x3b3476[_0xe6e5('0x35')][_0xe6e5('0x52')][_0x32d7cf]),'ChatQueueId':Number(_0x3b3476[_0xe6e5('0x2a')]['id'])});}return _0x4ebbf2;});}})['then'](respondWithResult(_0x49d605,null))[_0xe6e5('0x33')](handleError(_0x49d605,null));};exports[_0xe6e5('0x71')]=function(_0x4e155a,_0x19d01a){return db['ChatQueue'][_0xe6e5('0x32')]({'where':{'id':_0x4e155a[_0xe6e5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x19d01a,null))[_0xe6e5('0x16')](function(_0x38555c){if(_0x38555c){return _0x38555c[_0xe6e5('0x71')](_0x4e155a['query']['ids'])[_0xe6e5('0x16')](function(){if(_[_0xe6e5('0x72')](_0x4e155a[_0xe6e5('0x27')][_0xe6e5('0x52')])){for(var _0x38e519=0x0;_0x38e519<_0x4e155a[_0xe6e5('0x27')][_0xe6e5('0x52')][_0xe6e5('0x40')];_0x38e519+=0x1){socket[_0xe6e5('0x59')](_0xe6e5('0x6c'),{'UserId':Number(_0x4e155a[_0xe6e5('0x27')][_0xe6e5('0x52')][_0x38e519]),'ChatQueueId':Number(_0x4e155a['params']['id'])});}}else{socket[_0xe6e5('0x59')](_0xe6e5('0x6c'),{'UserId':Number(_0x4e155a['query'][_0xe6e5('0x52')]),'ChatQueueId':Number(_0x4e155a[_0xe6e5('0x2a')]['id'])});}});}})[_0xe6e5('0x16')](respondWithStatusCode(_0x19d01a,null))[_0xe6e5('0x33')](handleError(_0x19d01a,null));};exports[_0xe6e5('0x73')]=function(_0x4d3370,_0x4ce4f2){var _0xdb6ef7={};var _0x4da7c7={};var _0x9b7127;var _0x2374ea;return db[_0xe6e5('0x25')][_0xe6e5('0x3e')]({'where':{'id':_0x4d3370['params']['id']}})[_0xe6e5('0x16')](handleEntityNotFound(_0x4ce4f2,null))[_0xe6e5('0x16')](function(_0x53d231){if(_0x53d231){_0x9b7127=_0x53d231;_0x4da7c7[_0xe6e5('0x2b')]=_[_0xe6e5('0x2c')](db[_0xe6e5('0x46')]['rawAttributes']);_0x4da7c7[_0xe6e5('0x27')]=_[_0xe6e5('0x2c')](_0x4d3370['query']);_0x4da7c7[_0xe6e5('0x2d')]=_[_0xe6e5('0x2e')](_0x4da7c7[_0xe6e5('0x2b')],_0x4da7c7[_0xe6e5('0x27')]);_0xdb6ef7[_0xe6e5('0x2f')]=_['intersection'](_0x4da7c7[_0xe6e5('0x2b')],qs[_0xe6e5('0x30')](_0x4d3370[_0xe6e5('0x27')]['fields']));_0xdb6ef7[_0xe6e5('0x2f')]=_0xdb6ef7[_0xe6e5('0x2f')][_0xe6e5('0x40')]?_0xdb6ef7[_0xe6e5('0x2f')]:_0x4da7c7[_0xe6e5('0x2b')];_0xdb6ef7[_0xe6e5('0x41')]=qs['sort'](_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x42')]);_0xdb6ef7['where']=qs[_0xe6e5('0x2d')](_[_0xe6e5('0x43')](_0x4d3370[_0xe6e5('0x27')],_0x4da7c7[_0xe6e5('0x2d')]));if(_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x45')]){_0xdb6ef7[_0xe6e5('0x24')]=_[_0xe6e5('0x31')](_0xdb6ef7['where'],{'$or':_[_0xe6e5('0x1e')](_0xdb6ef7[_0xe6e5('0x2f')],function(_0xfc8e96){var _0x2eae33={};_0x2eae33[_0xfc8e96]={'$like':'%'+_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x45')]+'%'};return _0x2eae33;})});}_0xdb6ef7=_[_0xe6e5('0x31')]({},_0xdb6ef7,_0x4d3370[_0xe6e5('0x74')]);return _0x9b7127[_0xe6e5('0x73')](_0xdb6ef7);}})[_0xe6e5('0x16')](function(_0x447106){if(_0x447106){_0x2374ea=_0x447106[_0xe6e5('0x40')];if(!_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0x50')](_0xe6e5('0x75'))){_0xdb6ef7['limit']=qs['limit'](_0x4d3370[_0xe6e5('0x27')]['limit']);_0xdb6ef7[_0xe6e5('0xe')]=qs[_0xe6e5('0xe')](_0x4d3370[_0xe6e5('0x27')][_0xe6e5('0xe')]);}return _0x9b7127[_0xe6e5('0x73')](_0xdb6ef7);}})[_0xe6e5('0x16')](function(_0xd458e4){if(_0xd458e4){return _0xd458e4?{'count':_0x2374ea,'rows':_0xd458e4}:null;}})[_0xe6e5('0x16')](respondWithResult(_0x4ce4f2,null))['catch'](handleError(_0x4ce4f2,null));}; \ No newline at end of file +var _0x48d5=['voicePause','flatMap','Agents','sequelize','transaction','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','every','TeamId','includes','union','compact','userChatQueue:remove','addAgents','omit','spread','removeAgents','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','get','ChatQueues','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','include','query','findAll','rows','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','update','describe','getMembers','findOne','filters','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','where','User','findAndCountAll','chatPause','createdAt','format','updatedAt','getTeams','addTeams','ids','Team','online'];(function(_0x5c99d5,_0x41a4ac){var _0x1e6020=function(_0x51d9c9){while(--_0x51d9c9){_0x5c99d5['push'](_0x5c99d5['shift']());}};_0x1e6020(++_0x41a4ac);}(_0x48d5,0xfc));var _0x548d=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0x48d5[_0x28be72];return _0x46c5da;};'use strict';var BPromise=require('bluebird');var util=require(_0x548d('0x0'));var _=require('lodash');var squel=require(_0x548d('0x1'));var Redis=require(_0x548d('0x2'));var qs=require(_0x548d('0x3'));var logger=require(_0x548d('0x4'))('api');var config=require('../../config/environment');var db=require(_0x548d('0x5'))['db'];config['redis']=_[_0x548d('0x6')](config[_0x548d('0x7')],{'host':_0x548d('0x8'),'port':0x18eb});var socket=require(_0x548d('0x9'))(new Redis(config[_0x548d('0x7')]));require(_0x548d('0xa'))[_0x548d('0xb')](socket);function respondWithStatusCode(_0x6d3986,_0x5ad580){_0x5ad580=_0x5ad580||0xcc;return function(_0x26f5c9){if(_0x26f5c9){return _0x6d3986['sendStatus'](_0x5ad580);}return _0x6d3986[_0x548d('0xc')](_0x5ad580)[_0x548d('0xd')]();};}function respondWithResult(_0x59a1dd,_0x1d32f0){_0x1d32f0=_0x1d32f0||0xc8;return function(_0x5ea980){if(_0x5ea980){return _0x59a1dd[_0x548d('0xc')](_0x1d32f0)[_0x548d('0xe')](_0x5ea980);}};}function respondWithFilteredResult(_0x436363,_0x7666fd){return function(_0x48423d){if(_0x48423d){var _0x3620a2=typeof _0x7666fd[_0x548d('0xf')]===_0x548d('0x10')&&typeof _0x7666fd[_0x548d('0x11')]===_0x548d('0x10');var _0x31bb3a=_0x48423d[_0x548d('0x12')];var _0x10ad2c=_0x3620a2?0x0:_0x7666fd[_0x548d('0xf')];var _0x55cf5a=_0x3620a2?_0x48423d[_0x548d('0x12')]:_0x7666fd['offset']+_0x7666fd[_0x548d('0x11')];var _0xda6e14;if(_0x55cf5a>=_0x31bb3a){_0x55cf5a=_0x31bb3a;_0xda6e14=0xc8;}else{_0xda6e14=0xce;}_0x436363[_0x548d('0xc')](_0xda6e14);return _0x436363[_0x548d('0x13')](_0x548d('0x14'),_0x10ad2c+'-'+_0x55cf5a+'/'+_0x31bb3a)['json'](_0x48423d);}return null;};}function saveUpdates(_0x5b21db){return function(_0x436643){if(_0x436643){return _0x436643['update'](_0x5b21db)[_0x548d('0x15')](function(_0x55f258){return _0x55f258;});}return null;};}function removeEntity(_0xd3b5bd){return function(_0x5dca87){if(_0x5dca87){return _0x5dca87[_0x548d('0x16')]()[_0x548d('0x15')](function(){var _0x4c25fc=_0x5dca87[_0x548d('0x17')]({'plain':!![]});var _0x3a9c2f=_0x548d('0x18');return db['UserProfileResource']['destroy']({'where':{'type':_0x3a9c2f,'resourceId':_0x4c25fc['id']}})[_0x548d('0x15')](function(){return _0x5dca87;});})['then'](function(){_0xd3b5bd[_0x548d('0xc')](0xcc)[_0x548d('0xd')]();});}};}function handleEntityNotFound(_0x5af731){return function(_0x1054e4){if(!_0x1054e4){_0x5af731['sendStatus'](0x194);}return _0x1054e4;};}function handleError(_0x35c9b2,_0x436843){_0x436843=_0x436843||0x1f4;return function(_0x1f24b6){logger[_0x548d('0x19')](_0x1f24b6[_0x548d('0x1a')]);if(_0x1f24b6[_0x548d('0x1b')]){delete _0x1f24b6[_0x548d('0x1b')];}_0x35c9b2['status'](_0x436843)[_0x548d('0x1c')](_0x1f24b6);};}exports[_0x548d('0x1d')]=function(_0x5a8fab,_0x2fb619){var _0xa8239a={};var _0x75f768={'count':0x0,'rows':[]};var _0x416587=_[_0x548d('0x1e')](db[_0x548d('0x1f')][_0x548d('0x20')],function(_0x369bbf){return{'name':_0x369bbf[_0x548d('0x21')],'type':_0x369bbf['type'][_0x548d('0x22')]};});_0xa8239a=qs[_0x548d('0x23')](_0x416587,_0x5a8fab);var _0x495f0c={'where':_0xa8239a['where']};return db['ChatQueue'][_0x548d('0x12')](_0x495f0c)[_0x548d('0x15')](function(_0x265b05){_0x75f768['count']=_0x265b05;_0xa8239a[_0x548d('0x24')]=qs['include'](_0x5a8fab[_0x548d('0x25')]);return db[_0x548d('0x1f')][_0x548d('0x26')](_0xa8239a);})['then'](function(_0xb96e0){_0x75f768[_0x548d('0x27')]=_0xb96e0;return _0x75f768;})[_0x548d('0x15')](respondWithFilteredResult(_0x2fb619,_0xa8239a))[_0x548d('0x28')](handleError(_0x2fb619,null));};exports[_0x548d('0x29')]=function(_0x2e671a,_0x22c99a){var _0x33a4ae={'raw':!![],'where':{'id':_0x2e671a[_0x548d('0x2a')]['id']}},_0x1a50df={};_0x1a50df[_0x548d('0x2b')]=_[_0x548d('0x2c')](db[_0x548d('0x1f')][_0x548d('0x20')]);_0x1a50df[_0x548d('0x25')]=_[_0x548d('0x2c')](_0x2e671a[_0x548d('0x25')]);_0x1a50df['filters']=_[_0x548d('0x2d')](_0x1a50df['model'],_0x1a50df[_0x548d('0x25')]);_0x33a4ae[_0x548d('0x2e')]=_['intersection'](_0x1a50df[_0x548d('0x2b')],qs[_0x548d('0x2f')](_0x2e671a[_0x548d('0x25')][_0x548d('0x2f')]));_0x33a4ae[_0x548d('0x2e')]=_0x33a4ae[_0x548d('0x2e')][_0x548d('0x30')]?_0x33a4ae['attributes']:_0x1a50df['model'];if(_0x2e671a['query'][_0x548d('0x31')]){_0x33a4ae[_0x548d('0x24')]=[{'all':!![]}];}_0x33a4ae=_[_0x548d('0x32')]({},_0x33a4ae,_0x2e671a[_0x548d('0x33')]);return db[_0x548d('0x1f')][_0x548d('0x34')](_0x33a4ae)['then'](handleEntityNotFound(_0x22c99a,null))['then'](respondWithResult(_0x22c99a,null))[_0x548d('0x28')](handleError(_0x22c99a,null));};exports[_0x548d('0x35')]=function(_0x1aef2c,_0x5712b4){return db[_0x548d('0x1f')]['create'](_0x1aef2c[_0x548d('0x36')],{})[_0x548d('0x15')](function(_0x4d5ebb){var _0x496f7b=_0x1aef2c[_0x548d('0x37')][_0x548d('0x17')]({'plain':!![]});if(!_0x496f7b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x496f7b[_0x548d('0x38')]===_0x548d('0x37')){var _0x349659=_0x4d5ebb['get']({'plain':!![]});var _0x5f2f6b='ChatQueues';return db['UserProfileSection']['find']({'where':{'name':_0x5f2f6b,'userProfileId':_0x496f7b[_0x548d('0x39')]},'raw':!![]})['then'](function(_0x5e6563){if(_0x5e6563&&_0x5e6563[_0x548d('0x3a')]===0x0){return db[_0x548d('0x3b')]['create']({'name':_0x349659[_0x548d('0x1b')],'resourceId':_0x349659['id'],'type':_0x5e6563[_0x548d('0x1b')],'sectionId':_0x5e6563['id']},{})[_0x548d('0x15')](function(){return _0x4d5ebb;});}else{return _0x4d5ebb;}})[_0x548d('0x28')](function(_0x5b33cb){logger[_0x548d('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b33cb);throw _0x5b33cb;});}return _0x4d5ebb;})['then'](respondWithResult(_0x5712b4,0xc9))[_0x548d('0x28')](handleError(_0x5712b4,null));};exports[_0x548d('0x3c')]=function(_0x4faceb,_0x25faf5){if(_0x4faceb['body']['id']){delete _0x4faceb[_0x548d('0x36')]['id'];}return db['ChatQueue'][_0x548d('0x34')]({'where':{'id':_0x4faceb[_0x548d('0x2a')]['id']}})[_0x548d('0x15')](handleEntityNotFound(_0x25faf5,null))[_0x548d('0x15')](saveUpdates(_0x4faceb[_0x548d('0x36')],null))[_0x548d('0x15')](respondWithResult(_0x25faf5,null))[_0x548d('0x28')](handleError(_0x25faf5,null));};exports[_0x548d('0x16')]=function(_0x5ae193,_0x2af626){return db['ChatQueue'][_0x548d('0x34')]({'where':{'id':_0x5ae193[_0x548d('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2af626,null))[_0x548d('0x15')](removeEntity(_0x2af626,null))[_0x548d('0x28')](handleError(_0x2af626,null));};exports[_0x548d('0x3d')]=function(_0x40da97,_0x5b2b94){return db[_0x548d('0x1f')]['describe']()['then'](respondWithResult(_0x5b2b94,null))['catch'](handleError(_0x5b2b94,null));};exports[_0x548d('0x3e')]=function(_0xa0a13a,_0x536463){var _0x17d695={'raw':!![],'where':{}},_0x4244b8={},_0x1b6317;return db[_0x548d('0x1f')][_0x548d('0x3f')]({'where':{'id':_0xa0a13a['params']['id']}})[_0x548d('0x15')](handleEntityNotFound(_0x536463,null))[_0x548d('0x15')](function(_0x34fb28){if(_0x34fb28){_0x1b6317=_0x34fb28[_0x548d('0x17')]({'plain':!![]});_0x4244b8[_0x548d('0x2b')]=_[_0x548d('0x2c')](db['UserChatQueue'][_0x548d('0x20')]);_0x4244b8['query']=_[_0x548d('0x2c')](_0xa0a13a[_0x548d('0x25')]);_0x4244b8[_0x548d('0x40')]=_[_0x548d('0x2d')](_0x4244b8['model'],_0x4244b8[_0x548d('0x25')]);_0x17d695['attributes']=_[_0x548d('0x2d')](_0x4244b8[_0x548d('0x2b')],qs[_0x548d('0x2f')](_0xa0a13a[_0x548d('0x25')]['fields']));_0x17d695[_0x548d('0x2e')]=_0x17d695[_0x548d('0x2e')][_0x548d('0x30')]?_0x17d695[_0x548d('0x2e')]:_0x4244b8[_0x548d('0x2b')];if(!_0xa0a13a[_0x548d('0x25')][_0x548d('0x41')](_0x548d('0x42'))){_0x17d695[_0x548d('0x11')]=qs[_0x548d('0x11')](_0xa0a13a[_0x548d('0x25')][_0x548d('0x11')]);_0x17d695[_0x548d('0xf')]=qs[_0x548d('0xf')](_0xa0a13a[_0x548d('0x25')][_0x548d('0xf')]);}_0x17d695[_0x548d('0x43')]=qs['sort'](_0xa0a13a[_0x548d('0x25')][_0x548d('0x44')]);_0x17d695['where']=qs[_0x548d('0x40')](_[_0x548d('0x45')](_0xa0a13a[_0x548d('0x25')],_0x4244b8['filters']));_0x17d695['where'][_0x548d('0x46')]=_0x34fb28['id'];if(_0xa0a13a[_0x548d('0x25')][_0x548d('0x47')]){_0x17d695[_0x548d('0x48')]=_[_0x548d('0x32')](_0x17d695[_0x548d('0x48')],{'$or':_[_0x548d('0x1e')](_0x17d695[_0x548d('0x2e')],function(_0xd6716c){var _0x2e0126={};_0x2e0126[_0xd6716c]={'$like':'%'+_0xa0a13a['query']['filter']+'%'};return _0x2e0126;})});}_0x17d695=_['merge']({},_0x17d695,_0xa0a13a[_0x548d('0x33')]);return db['UserChatQueue'][_0x548d('0x26')](_0x17d695);}})[_0x548d('0x15')](function(_0x27bd22){if(_0x27bd22){return db[_0x548d('0x49')][_0x548d('0x4a')]({'where':{'id':_[_0x548d('0x1e')](_0x27bd22,'UserId'),'role':'agent'},'attributes':['id',_0x548d('0x1b'),_0x548d('0x4b'),'updatedAt',_0x548d('0x4c')]});}})[_0x548d('0x15')](function(_0x49e31e){if(_0x49e31e){return{'count':_0x49e31e[_0x548d('0x12')],'rows':_[_0x548d('0x1e')](_0x49e31e['rows'],function(_0x14788c){return{'membername':_0x14788c['name'],'UserId':_0x14788c['id'],'queue_name':_0x1b6317[_0x548d('0x1b')],'ChatQueueId':_0x1b6317['id'],'interface':util[_0x548d('0x4d')]('%s/%s','SIP',_0x14788c['name']),'penalty':0x0,'paused':_0x14788c[_0x548d('0x4b')],'createdAt':_0x14788c[_0x548d('0x4c')],'updatedAt':_0x14788c[_0x548d('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x536463,_0x17d695))[_0x548d('0x28')](handleError(_0x536463,null));};exports['getTeams']=function(_0x254d32,_0xcc90ce){var _0x46ed1b={};var _0x697d18={};var _0x21b5f3;var _0x1b2e8e;return db['ChatQueue'][_0x548d('0x3f')]({'where':{'id':_0x254d32[_0x548d('0x2a')]['id']}})[_0x548d('0x15')](handleEntityNotFound(_0xcc90ce,null))[_0x548d('0x15')](function(_0x23dfaf){if(_0x23dfaf){_0x21b5f3=_0x23dfaf;_0x697d18[_0x548d('0x2b')]=_[_0x548d('0x2c')](db['Team'][_0x548d('0x20')]);_0x697d18['query']=_[_0x548d('0x2c')](_0x254d32[_0x548d('0x25')]);_0x697d18[_0x548d('0x40')]=_[_0x548d('0x2d')](_0x697d18['model'],_0x697d18[_0x548d('0x25')]);_0x46ed1b['attributes']=_[_0x548d('0x2d')](_0x697d18['model'],qs[_0x548d('0x2f')](_0x254d32['query'][_0x548d('0x2f')]));_0x46ed1b[_0x548d('0x2e')]=_0x46ed1b['attributes'][_0x548d('0x30')]?_0x46ed1b[_0x548d('0x2e')]:_0x697d18[_0x548d('0x2b')];_0x46ed1b[_0x548d('0x43')]=qs['sort'](_0x254d32['query'][_0x548d('0x44')]);_0x46ed1b['where']=qs['filters'](_[_0x548d('0x45')](_0x254d32[_0x548d('0x25')],_0x697d18[_0x548d('0x40')]));if(_0x254d32[_0x548d('0x25')][_0x548d('0x47')]){_0x46ed1b[_0x548d('0x48')]=_['merge'](_0x46ed1b[_0x548d('0x48')],{'$or':_[_0x548d('0x1e')](_0x46ed1b[_0x548d('0x2e')],function(_0x1b1510){var _0x5f15dd={};_0x5f15dd[_0x1b1510]={'$like':'%'+_0x254d32[_0x548d('0x25')][_0x548d('0x47')]+'%'};return _0x5f15dd;})});}_0x46ed1b=_[_0x548d('0x32')]({},_0x46ed1b,_0x254d32[_0x548d('0x33')]);return _0x21b5f3[_0x548d('0x4f')](_0x46ed1b);}})[_0x548d('0x15')](function(_0x84d109){if(_0x84d109){_0x1b2e8e=_0x84d109[_0x548d('0x30')];if(!_0x254d32[_0x548d('0x25')][_0x548d('0x41')]('nolimit')){_0x46ed1b[_0x548d('0x11')]=qs[_0x548d('0x11')](_0x254d32[_0x548d('0x25')][_0x548d('0x11')]);_0x46ed1b[_0x548d('0xf')]=qs[_0x548d('0xf')](_0x254d32[_0x548d('0x25')][_0x548d('0xf')]);}return _0x21b5f3[_0x548d('0x4f')](_0x46ed1b);}})['then'](function(_0x306805){if(_0x306805){return _0x306805?{'count':_0x1b2e8e,'rows':_0x306805}:null;}})[_0x548d('0x15')](respondWithResult(_0xcc90ce,null))[_0x548d('0x28')](handleError(_0xcc90ce,null));};exports[_0x548d('0x50')]=function(_0x42ee11,_0x48f70b){var _0x2cb1bd=_0x42ee11[_0x548d('0x36')][_0x548d('0x51')];return db[_0x548d('0x52')]['findAll']({'where':{'id':_0x2cb1bd},'attributes':['id'],'include':[{'model':db[_0x548d('0x49')],'as':'Agents','attributes':['id',_0x548d('0x1b'),_0x548d('0x53'),_0x548d('0x54'),'interface'],'raw':!![]}]})['then'](function(_0x3ec48d){if(_0x3ec48d){var _0x4a1517=_[_0x548d('0x55')](_0x3ec48d,function(_0x49d9b6){var _0x480273=_0x49d9b6['get']({'plain':!![]});return _0x480273[_0x548d('0x56')];});return db['ChatQueue'][_0x548d('0x34')]({'where':{'id':_0x42ee11[_0x548d('0x2a')]['id']}})['then'](function(_0x157d7d){return db[_0x548d('0x57')][_0x548d('0x58')](function(_0x54dd52){return _0x157d7d[_0x548d('0x50')](_0x2cb1bd,{'transaction':_0x54dd52})[_0x548d('0x15')](function(){return BPromise['each'](_0x4a1517,function(_0x3e682b){return db[_0x548d('0x59')][_0x548d('0x5a')]({'where':{'UserId':_0x3e682b['id'],'ChatQueueId':_0x42ee11['params']['id']},'transaction':_0x54dd52});});})[_0x548d('0x15')](function(){_0x4a1517[_0x548d('0x5b')](function(_0x1aeefd){socket[_0x548d('0x5c')](_0x548d('0x5d'),{'UserId':_0x1aeefd['id'],'ChatQueueId':_0x157d7d['id']});});});});});}})[_0x548d('0x15')](respondWithStatusCode(_0x48f70b,null))[_0x548d('0x28')](handleError(_0x48f70b,null));};exports[_0x548d('0x5e')]=function(_0x263d7f,_0x503c9a){return db[_0x548d('0x52')][_0x548d('0x26')]({'where':{'id':_0x263d7f[_0x548d('0x25')][_0x548d('0x51')]},'attributes':['id'],'include':[{'model':db[_0x548d('0x49')],'as':_0x548d('0x56'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x503c9a,null))[_0x548d('0x15')](function(_0x10b47a){var _0x3646ae=_[_0x548d('0x1e')](_0x10b47a,'id');var _0x222795=[];var _0x1c6ba5=[];var _0x30cd32=squel[_0x548d('0x5f')]();_0x30cd32['field'](_0x548d('0x60'))['from']('team_has_chat_queues','tq')[_0x548d('0x61')](_0x548d('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x548d('0x48')](_0x548d('0x63'),_0x263d7f[_0x548d('0x2a')]['id']);for(var _0x54b102=0x0;_0x54b102<_0x10b47a[_0x548d('0x30')];_0x54b102+=0x1){let _0x3e2dfc=_0x10b47a[_0x54b102];for(var _0x994934=0x0;_0x994934<_0x3e2dfc['Agents']['length'];_0x994934+=0x1){let _0x4b9258=_0x3e2dfc[_0x548d('0x56')][_0x994934];var _0x24acaa=_0x30cd32['clone']();_0x24acaa[_0x548d('0x48')](_0x548d('0x64'),_0x4b9258['id']);_0x1c6ba5['push'](db['sequelize'][_0x548d('0x25')](_0x24acaa[_0x548d('0x65')](),{'type':db[_0x548d('0x57')]['QueryTypes']['SELECT']})['then'](function(_0x5e5a23){if(_0x5e5a23[_0x548d('0x30')]===0x1){return _0x4b9258['id'];}else{var _0x5eb7c4=_[_0x548d('0x66')](_[_0x548d('0x1e')](_0x5e5a23,_0x548d('0x67')),function(_0x5e331c){return _[_0x548d('0x68')](_0x3646ae,_0x5e331c);});if(_0x5eb7c4){return _0x4b9258['id'];}}}));}}return BPromise['all'](_0x1c6ba5)['then'](function(_0x44003c){_0x222795=_(_0x222795)[_0x548d('0x69')](_0x44003c)[_0x548d('0x6a')]()['value']();return db[_0x548d('0x1f')][_0x548d('0x34')]({'where':{'id':_0x263d7f[_0x548d('0x2a')]['id']}})[_0x548d('0x15')](function(_0x52edbf){return db[_0x548d('0x57')]['transaction'](function(_0x3ba1ae){return _0x52edbf[_0x548d('0x5e')](_0x263d7f[_0x548d('0x25')][_0x548d('0x51')],{'transaction':_0x3ba1ae})[_0x548d('0x15')](function(){if(!_['isEmpty'](_0x222795)){return _0x52edbf['removeAgents'](_0x222795,{'transaction':_0x3ba1ae});}})[_0x548d('0x15')](function(){_0x222795['forEach'](function(_0x2b43bc){socket['emit'](_0x548d('0x6b'),{'UserId':_0x2b43bc,'ChatQueueId':_0x52edbf['id']});});});});});});})[_0x548d('0x15')](respondWithStatusCode(_0x503c9a,null))[_0x548d('0x28')](handleError(_0x503c9a,null));};exports[_0x548d('0x6c')]=function(_0x4e4d2f,_0x1a174b){return db[_0x548d('0x1f')][_0x548d('0x34')]({'where':{'id':_0x4e4d2f[_0x548d('0x2a')]['id']}})[_0x548d('0x15')](handleEntityNotFound(_0x1a174b,null))[_0x548d('0x15')](function(_0x5ca409){if(_0x5ca409){return _0x5ca409[_0x548d('0x6c')](_0x4e4d2f[_0x548d('0x36')]['ids'],_[_0x548d('0x6d')](_0x4e4d2f['body'],['ids','id'])||{})[_0x548d('0x6e')](function(_0x3bf296){for(var _0x403885=0x0;_0x403885<_0x4e4d2f[_0x548d('0x36')]['ids'][_0x548d('0x30')];_0x403885+=0x1){socket['emit'](_0x548d('0x5d'),{'UserId':Number(_0x4e4d2f[_0x548d('0x36')][_0x548d('0x51')][_0x403885]),'ChatQueueId':Number(_0x4e4d2f['params']['id'])});}return _0x3bf296;});}})['then'](respondWithResult(_0x1a174b,null))[_0x548d('0x28')](handleError(_0x1a174b,null));};exports[_0x548d('0x6f')]=function(_0x4bb7c6,_0x207245){return db[_0x548d('0x1f')][_0x548d('0x34')]({'where':{'id':_0x4bb7c6[_0x548d('0x2a')]['id']}})[_0x548d('0x15')](handleEntityNotFound(_0x207245,null))[_0x548d('0x15')](function(_0x16823){if(_0x16823){return _0x16823[_0x548d('0x6f')](_0x4bb7c6[_0x548d('0x25')][_0x548d('0x51')])['then'](function(){if(_['isArray'](_0x4bb7c6[_0x548d('0x25')][_0x548d('0x51')])){for(var _0x378d89=0x0;_0x378d89<_0x4bb7c6['query'][_0x548d('0x51')][_0x548d('0x30')];_0x378d89+=0x1){socket[_0x548d('0x5c')](_0x548d('0x6b'),{'UserId':Number(_0x4bb7c6[_0x548d('0x25')][_0x548d('0x51')][_0x378d89]),'ChatQueueId':Number(_0x4bb7c6[_0x548d('0x2a')]['id'])});}}else{socket[_0x548d('0x5c')](_0x548d('0x6b'),{'UserId':Number(_0x4bb7c6[_0x548d('0x25')][_0x548d('0x51')]),'ChatQueueId':Number(_0x4bb7c6[_0x548d('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x207245,null))[_0x548d('0x28')](handleError(_0x207245,null));};exports['getAgents']=function(_0x579b19,_0x442167){var _0x43c873={};var _0x1a8e56={};var _0x4f1da4;var _0x47b9bc;return db[_0x548d('0x1f')]['findOne']({'where':{'id':_0x579b19[_0x548d('0x2a')]['id']}})[_0x548d('0x15')](handleEntityNotFound(_0x442167,null))[_0x548d('0x15')](function(_0x1abd2e){if(_0x1abd2e){_0x4f1da4=_0x1abd2e;_0x1a8e56[_0x548d('0x2b')]=_['keys'](db[_0x548d('0x49')][_0x548d('0x20')]);_0x1a8e56['query']=_[_0x548d('0x2c')](_0x579b19[_0x548d('0x25')]);_0x1a8e56['filters']=_['intersection'](_0x1a8e56[_0x548d('0x2b')],_0x1a8e56[_0x548d('0x25')]);_0x43c873[_0x548d('0x2e')]=_[_0x548d('0x2d')](_0x1a8e56[_0x548d('0x2b')],qs[_0x548d('0x2f')](_0x579b19['query'][_0x548d('0x2f')]));_0x43c873['attributes']=_0x43c873[_0x548d('0x2e')][_0x548d('0x30')]?_0x43c873[_0x548d('0x2e')]:_0x1a8e56[_0x548d('0x2b')];_0x43c873[_0x548d('0x43')]=qs[_0x548d('0x44')](_0x579b19[_0x548d('0x25')][_0x548d('0x44')]);_0x43c873['where']=qs[_0x548d('0x40')](_[_0x548d('0x45')](_0x579b19[_0x548d('0x25')],_0x1a8e56[_0x548d('0x40')]));if(_0x579b19[_0x548d('0x25')]['filter']){_0x43c873[_0x548d('0x48')]=_['merge'](_0x43c873[_0x548d('0x48')],{'$or':_[_0x548d('0x1e')](_0x43c873[_0x548d('0x2e')],function(_0x300ecc){var _0xd94f37={};_0xd94f37[_0x300ecc]={'$like':'%'+_0x579b19[_0x548d('0x25')]['filter']+'%'};return _0xd94f37;})});}_0x43c873=_[_0x548d('0x32')]({},_0x43c873,_0x579b19['options']);return _0x4f1da4['getAgents'](_0x43c873);}})['then'](function(_0x123da8){if(_0x123da8){_0x47b9bc=_0x123da8[_0x548d('0x30')];if(!_0x579b19['query'][_0x548d('0x41')](_0x548d('0x42'))){_0x43c873[_0x548d('0x11')]=qs[_0x548d('0x11')](_0x579b19[_0x548d('0x25')][_0x548d('0x11')]);_0x43c873[_0x548d('0xf')]=qs[_0x548d('0xf')](_0x579b19[_0x548d('0x25')][_0x548d('0xf')]);}return _0x4f1da4['getAgents'](_0x43c873);}})[_0x548d('0x15')](function(_0x3f9596){if(_0x3f9596){return _0x3f9596?{'count':_0x47b9bc,'rows':_0x3f9596}:null;}})[_0x548d('0x15')](respondWithResult(_0x442167,null))['catch'](handleError(_0x442167,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 436f275..dd01d00 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 _0x44f1=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x40c12e,_0x58a6ca){var _0x771bfd=function(_0x2925e0){while(--_0x2925e0){_0x40c12e['push'](_0x40c12e['shift']());}};_0x771bfd(++_0x58a6ca);}(_0x44f1,0x169));var _0x144f=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x44f1[_0x40ac5e];return _0x2839d6;};'use strict';var EventEmitter=require(_0x144f('0x0'));var ChatQueue=require(_0x144f('0x1'))['db'][_0x144f('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x144f('0x3')](0x0);var events={'afterCreate':_0x144f('0x4'),'afterUpdate':_0x144f('0x5'),'afterDestroy':_0x144f('0x6')};function emitEvent(_0x54db15){return function(_0x5651d8,_0x678a34,_0x3d359c){ChatQueueEvents['emit'](_0x54db15+':'+_0x5651d8['id'],_0x5651d8);ChatQueueEvents[_0x144f('0x7')](_0x54db15,_0x5651d8);_0x3d359c(null);};}for(var e in events){if(events[_0x144f('0x8')](e)){var event=events[e];ChatQueue[_0x144f('0x9')](e,emitEvent(event));}}module[_0x144f('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0xffdc=['../../mysqldb','setMaxListeners','save','remove','hasOwnProperty','hook','exports'];(function(_0x541989,_0x1cb951){var _0x54df7d=function(_0x28a45d){while(--_0x28a45d){_0x541989['push'](_0x541989['shift']());}};_0x54df7d(++_0x1cb951);}(_0xffdc,0x9a));var _0xcffd=function(_0x100770,_0x2a6617){_0x100770=_0x100770-0x0;var _0x26c777=_0xffdc[_0x100770];return _0x26c777;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xcffd('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xcffd('0x1')](0x0);var events={'afterCreate':_0xcffd('0x2'),'afterUpdate':'update','afterDestroy':_0xcffd('0x3')};function emitEvent(_0x4926b8){return function(_0x1b93b4,_0x4fb5d9,_0x27b225){ChatQueueEvents['emit'](_0x4926b8+':'+_0x1b93b4['id'],_0x1b93b4);ChatQueueEvents['emit'](_0x4926b8,_0x1b93b4);_0x27b225(null);};}for(var e in events){if(events[_0xcffd('0x4')](e)){var event=events[e];ChatQueue[_0xcffd('0x5')](e,emitEvent(event));}}module[_0xcffd('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 97721af..34f7972 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 _0x23c3=['chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x1c4987,_0x1ac3ee){var _0x5aa453=function(_0x49ff6e){while(--_0x49ff6e){_0x1c4987['push'](_0x1c4987['shift']());}};_0x5aa453(++_0x1ac3ee);}(_0x23c3,0x71));var _0x323c=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x23c3[_0x45783c];return _0x1161da;};'use strict';var _=require(_0x323c('0x0'));var util=require(_0x323c('0x1'));var logger=require(_0x323c('0x2'))(_0x323c('0x3'));var moment=require(_0x323c('0x4'));var BPromise=require(_0x323c('0x5'));var rp=require(_0x323c('0x6'));var fs=require('fs');var path=require(_0x323c('0x7'));var rimraf=require(_0x323c('0x8'));var config=require('../../config/environment');var attributes=require(_0x323c('0x9'));module[_0x323c('0xa')]=function(_0x7bd08d,_0x28a1a5){return _0x7bd08d[_0x323c('0xb')](_0x323c('0xc'),attributes,{'tableName':_0x323c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b23=['bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger','api','moment'];(function(_0x10f99a,_0x46e1f1){var _0x5aba0e=function(_0x37a737){while(--_0x37a737){_0x10f99a['push'](_0x10f99a['shift']());}};_0x5aba0e(++_0x46e1f1);}(_0x1b23,0x18e));var _0x31b2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1b23[_0x432682];return _0x463d05;};'use strict';var _=require(_0x31b2('0x0'));var util=require(_0x31b2('0x1'));var logger=require(_0x31b2('0x2'))(_0x31b2('0x3'));var moment=require(_0x31b2('0x4'));var BPromise=require(_0x31b2('0x5'));var rp=require(_0x31b2('0x6'));var fs=require('fs');var path=require(_0x31b2('0x7'));var rimraf=require(_0x31b2('0x8'));var config=require('../../config/environment');var attributes=require(_0x31b2('0x9'));module[_0x31b2('0xa')]=function(_0xa1e84f,_0xc7d11f){return _0xa1e84f[_0x31b2('0xb')](_0x31b2('0xc'),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 b5b1aad..c2e383b 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 _0xe75a=['GetChatQueue','catch','find','ShowChatQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x3bc222,_0x481df5){var _0x574be4=function(_0x1f5a5a){while(--_0x1f5a5a){_0x3bc222['push'](_0x3bc222['shift']());}};_0x574be4(++_0x481df5);}(_0xe75a,0x115));var _0xae75=function(_0x3d7a9f,_0x24e0f1){_0x3d7a9f=_0x3d7a9f-0x0;var _0x13f5f1=_0xe75a[_0x3d7a9f];return _0x13f5f1;};'use strict';var _=require('lodash');var util=require(_0xae75('0x0'));var moment=require(_0xae75('0x1'));var BPromise=require(_0xae75('0x2'));var rs=require(_0xae75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae75('0x4'))['db'];var utils=require(_0xae75('0x5'));var logger=require(_0xae75('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae75('0x7')][_0xae75('0x8')]({'port':0x232a});config[_0xae75('0x9')]=_[_0xae75('0xa')](config['redis'],{'host':_0xae75('0xb'),'port':0x18eb});var socket=require(_0xae75('0xc'))(new Redis(config[_0xae75('0x9')]));require(_0xae75('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f3412,_0xfe558e,_0xa5a5ce){return new BPromise(function(_0xf924a6,_0x196972){return client[_0xae75('0xe')](_0x3f3412,_0xa5a5ce)[_0xae75('0xf')](function(_0x5f3c49){logger['info'](_0xae75('0x10'),_0xfe558e,_0xae75('0x11'));logger[_0xae75('0x12')](_0xae75('0x13'),_0xfe558e,'request\x20sent',JSON[_0xae75('0x14')](_0x5f3c49));if(_0x5f3c49['error']){if(_0x5f3c49[_0xae75('0x15')][_0xae75('0x16')]===0x1f4){logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49[_0xae75('0x15')]['message']);return _0x196972(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}logger[_0xae75('0x15')](_0xae75('0x10'),_0xfe558e,_0x5f3c49['error'][_0xae75('0x17')]);return _0xf924a6(_0x5f3c49[_0xae75('0x15')][_0xae75('0x17')]);}else{logger[_0xae75('0x18')]('ChatQueue,\x20%s,\x20%s',_0xfe558e,'request\x20sent');_0xf924a6(_0x5f3c49[_0xae75('0x19')]['message']);}})['catch'](function(_0x5e415d){logger['error'](_0xae75('0x10'),_0xfe558e,_0x5e415d);_0x196972(_0x5e415d);});});}exports['GetChatQueue']=function(_0x155454){var _0x2bdb10=this;return new Promise(function(_0x43c06b,_0x5b8df1){return db[_0xae75('0x1a')][_0xae75('0x1b')]({'raw':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x155454[_0xae75('0x1c')]?_0x155454['options']['where']||null:null,'attributes':_0x155454[_0xae75('0x1c')]?_0x155454['options'][_0xae75('0x1e')]||null:null,'limit':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x1f')]||null:null,'include':_0x155454[_0xae75('0x1c')]?_0x155454[_0xae75('0x1c')][_0xae75('0x20')]?_[_0xae75('0x21')](_0x155454[_0xae75('0x1c')][_0xae75('0x20')],function(_0x2ac86c){return{'model':db[_0x2ac86c[_0xae75('0x22')]],'as':_0x2ac86c['as'],'attributes':_0x2ac86c[_0xae75('0x1e')],'include':_0x2ac86c['include']?_[_0xae75('0x21')](_0x2ac86c[_0xae75('0x20')],function(_0x33eb2a){return{'model':db[_0x33eb2a[_0xae75('0x22')]],'as':_0x33eb2a['as'],'attributes':_0x33eb2a['attributes'],'include':_0x33eb2a['include']?_['map'](_0x33eb2a[_0xae75('0x20')],function(_0x4f5de0){return{'model':db[_0x4f5de0[_0xae75('0x22')]],'as':_0x4f5de0['as'],'attributes':_0x4f5de0[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x256993){logger['info']('GetChatQueue',_0x155454);logger[_0xae75('0x12')](_0xae75('0x23'),_0x155454,JSON[_0xae75('0x14')](_0x256993));_0x43c06b(_0x256993);})[_0xae75('0x24')](function(_0x42f7cb){logger[_0xae75('0x15')]('GetChatQueue',_0x42f7cb[_0xae75('0x17')],_0x155454);_0x5b8df1(_0x2bdb10[_0xae75('0x15')](0x1f4,_0x42f7cb[_0xae75('0x17')]));});});};exports['ShowChatQueue']=function(_0x136014){var _0x23c43e=this;return new Promise(function(_0x238928,_0x2042ae){return db['ChatQueue'][_0xae75('0x25')]({'raw':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1d')]===undefined?!![]:![]:!![],'where':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')]['where']||null:null,'attributes':_0x136014[_0xae75('0x1c')]?_0x136014[_0xae75('0x1c')][_0xae75('0x1e')]||null:null,'include':_0x136014[_0xae75('0x1c')]?_0x136014['options'][_0xae75('0x20')]?_['map'](_0x136014[_0xae75('0x1c')]['include'],function(_0x478525){return{'model':db[_0x478525[_0xae75('0x22')]],'as':_0x478525['as'],'attributes':_0x478525[_0xae75('0x1e')],'include':_0x478525[_0xae75('0x20')]?_[_0xae75('0x21')](_0x478525[_0xae75('0x20')],function(_0x25aa62){return{'model':db[_0x25aa62[_0xae75('0x22')]],'as':_0x25aa62['as'],'attributes':_0x25aa62[_0xae75('0x1e')],'include':_0x25aa62[_0xae75('0x20')]?_[_0xae75('0x21')](_0x25aa62[_0xae75('0x20')],function(_0x4f418f){return{'model':db[_0x4f418f[_0xae75('0x22')]],'as':_0x4f418f['as'],'attributes':_0x4f418f[_0xae75('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae75('0xf')](function(_0x5a0134){logger[_0xae75('0x18')](_0xae75('0x26'),_0x136014);logger[_0xae75('0x12')]('ShowChatQueue',_0x136014,JSON[_0xae75('0x14')](_0x5a0134));_0x238928(_0x5a0134);})[_0xae75('0x24')](function(_0x3463b8){logger[_0xae75('0x15')](_0xae75('0x26'),_0x3463b8['message'],_0x136014);_0x2042ae(_0x23c43e[_0xae75('0x15')](0x1f4,_0x3463b8[_0xae75('0x17')]));});});}; \ No newline at end of file +var _0x48bc=['raw','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ChatQueue','findAll','options'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x48bc,0x1b6));var _0xc48b=function(_0x3db167,_0x174cac){_0x3db167=_0x3db167-0x0;var _0x349ed4=_0x48bc[_0x3db167];return _0x349ed4;};'use strict';var _=require(_0xc48b('0x0'));var util=require(_0xc48b('0x1'));var moment=require(_0xc48b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc48b('0x3'));var fs=require('fs');var Redis=require(_0xc48b('0x4'));var db=require(_0xc48b('0x5'))['db'];var utils=require(_0xc48b('0x6'));var logger=require(_0xc48b('0x7'))(_0xc48b('0x8'));var config=require(_0xc48b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc48b('0xa')]['http']({'port':0x232a});config[_0xc48b('0xb')]=_[_0xc48b('0xc')](config['redis'],{'host':_0xc48b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc48b('0xb')]));require(_0xc48b('0xe'))['register'](socket);function respondWithRpcPromise(_0x2c0429,_0x3fcb54,_0xdea695){return new BPromise(function(_0x441e2c,_0x111e61){return client[_0xc48b('0xf')](_0x2c0429,_0xdea695)[_0xc48b('0x10')](function(_0x2fd6c7){logger[_0xc48b('0x11')](_0xc48b('0x12'),_0x3fcb54,_0xc48b('0x13'));logger[_0xc48b('0x14')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x3fcb54,_0xc48b('0x13'),JSON[_0xc48b('0x15')](_0x2fd6c7));if(_0x2fd6c7[_0xc48b('0x16')]){if(_0x2fd6c7['error'][_0xc48b('0x17')]===0x1f4){logger[_0xc48b('0x16')](_0xc48b('0x12'),_0x3fcb54,_0x2fd6c7[_0xc48b('0x16')][_0xc48b('0x18')]);return _0x111e61(_0x2fd6c7[_0xc48b('0x16')][_0xc48b('0x18')]);}logger[_0xc48b('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3fcb54,_0x2fd6c7[_0xc48b('0x16')]['message']);return _0x441e2c(_0x2fd6c7['error'][_0xc48b('0x18')]);}else{logger['info'](_0xc48b('0x12'),_0x3fcb54,'request\x20sent');_0x441e2c(_0x2fd6c7[_0xc48b('0x19')]['message']);}})[_0xc48b('0x1a')](function(_0x3bfd75){logger[_0xc48b('0x16')]('ChatQueue,\x20%s,\x20%s',_0x3fcb54,_0x3bfd75);_0x111e61(_0x3bfd75);});});}exports['GetChatQueue']=function(_0x12b34f){var _0x4a2997=this;return new Promise(function(_0x1c139c,_0x104a2f){return db[_0xc48b('0x1b')][_0xc48b('0x1c')]({'raw':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x1e')]===undefined?!![]:![]:!![],'where':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')]['where']||null:null,'attributes':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x1f')]||null:null,'limit':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x20')]||null:null,'include':_0x12b34f[_0xc48b('0x1d')]?_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x12b34f[_0xc48b('0x1d')][_0xc48b('0x21')],function(_0x4a6a22){return{'model':db[_0x4a6a22[_0xc48b('0x23')]],'as':_0x4a6a22['as'],'attributes':_0x4a6a22[_0xc48b('0x1f')],'include':_0x4a6a22[_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x4a6a22[_0xc48b('0x21')],function(_0x2b53a3){return{'model':db[_0x2b53a3[_0xc48b('0x23')]],'as':_0x2b53a3['as'],'attributes':_0x2b53a3['attributes'],'include':_0x2b53a3[_0xc48b('0x21')]?_['map'](_0x2b53a3['include'],function(_0x49916e){return{'model':db[_0x49916e[_0xc48b('0x23')]],'as':_0x49916e['as'],'attributes':_0x49916e[_0xc48b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc48b('0x10')](function(_0x3a65eb){logger[_0xc48b('0x11')]('GetChatQueue',_0x12b34f);logger['debug'](_0xc48b('0x24'),_0x12b34f,JSON[_0xc48b('0x15')](_0x3a65eb));_0x1c139c(_0x3a65eb);})['catch'](function(_0x31eaa0){logger[_0xc48b('0x16')](_0xc48b('0x24'),_0x31eaa0[_0xc48b('0x18')],_0x12b34f);_0x104a2f(_0x4a2997[_0xc48b('0x16')](0x1f4,_0x31eaa0[_0xc48b('0x18')]));});});};exports[_0xc48b('0x25')]=function(_0x72fe6e){var _0x2e82e5=this;return new Promise(function(_0x53735e,_0xc46482){return db[_0xc48b('0x1b')][_0xc48b('0x26')]({'raw':_0x72fe6e[_0xc48b('0x1d')]?_0x72fe6e[_0xc48b('0x1d')][_0xc48b('0x1e')]===undefined?!![]:![]:!![],'where':_0x72fe6e[_0xc48b('0x1d')]?_0x72fe6e[_0xc48b('0x1d')]['where']||null:null,'attributes':_0x72fe6e[_0xc48b('0x1d')]?_0x72fe6e[_0xc48b('0x1d')][_0xc48b('0x1f')]||null:null,'include':_0x72fe6e['options']?_0x72fe6e['options'][_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x72fe6e[_0xc48b('0x1d')][_0xc48b('0x21')],function(_0x4ec91a){return{'model':db[_0x4ec91a[_0xc48b('0x23')]],'as':_0x4ec91a['as'],'attributes':_0x4ec91a[_0xc48b('0x1f')],'include':_0x4ec91a[_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x4ec91a[_0xc48b('0x21')],function(_0x591b4f){return{'model':db[_0x591b4f[_0xc48b('0x23')]],'as':_0x591b4f['as'],'attributes':_0x591b4f['attributes'],'include':_0x591b4f[_0xc48b('0x21')]?_[_0xc48b('0x22')](_0x591b4f[_0xc48b('0x21')],function(_0x513b99){return{'model':db[_0x513b99[_0xc48b('0x23')]],'as':_0x513b99['as'],'attributes':_0x513b99[_0xc48b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc48b('0x10')](function(_0x35d211){logger[_0xc48b('0x11')](_0xc48b('0x25'),_0x72fe6e);logger[_0xc48b('0x14')](_0xc48b('0x25'),_0x72fe6e,JSON['stringify'](_0x35d211));_0x53735e(_0x35d211);})[_0xc48b('0x1a')](function(_0x378b6f){logger[_0xc48b('0x16')](_0xc48b('0x25'),_0x378b6f[_0xc48b('0x18')],_0x72fe6e);_0xc46482(_0x2e82e5[_0xc48b('0x16')](0x1f4,_0x378b6f['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e3ed20c..cd5e9bc 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 _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x13fd88,_0x1e0d26){var _0x399a2f=function(_0x179447){while(--_0x179447){_0x13fd88['push'](_0x13fd88['shift']());}};_0x399a2f(++_0x1e0d26);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x3c69a3,_0xb8ce21){_0x3c69a3=_0x3c69a3-0x0;var _0x46e814=_0x4c6d[_0x3c69a3];return _0x46e814;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}}; \ No newline at end of file +var _0x6f0d=['update','emit','removeListener','length','save','remove'];(function(_0xa656ef,_0x3d31df){var _0x20e81=function(_0x128119){while(--_0x128119){_0xa656ef['push'](_0xa656ef['shift']());}};_0x20e81(++_0x3d31df);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x3eb037,_0x19f179){_0x3eb037=_0x3eb037-0x0;var _0x284d5f=_0x6f0d[_0x3eb037];return _0x284d5f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xd6f0('0x0'),_0xd6f0('0x1'),_0xd6f0('0x2')];function createListener(_0x107a8c,_0x573473){return function(_0x275230){_0x573473[_0xd6f0('0x3')](_0x107a8c,_0x275230);};}function removeListener(_0x2f78fb,_0x25344b){return function(){ChatQueueEvents[_0xd6f0('0x4')](_0x2f78fb,_0x25344b);};}exports['register']=function(_0x2d2ce6){for(var _0x4a8b0c=0x0,_0xe21ac4=events[_0xd6f0('0x5')];_0x4a8b0c<_0xe21ac4;_0x4a8b0c++){var _0x8b89a9=events[_0x4a8b0c];var _0x1a48a0=createListener('chatQueue:'+_0x8b89a9,_0x2d2ce6);ChatQueueEvents['on'](_0x8b89a9,_0x1a48a0);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index de1339e..b9c69f9 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x5fc3,0xa8));var _0x35fc=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x5fc3[_0x375492];return _0x18ba5b;};'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')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5c5db0,_0x3989f0){var _0x379327=function(_0x22ffce){while(--_0x22ffce){_0x5c5db0['push'](_0x5c5db0['shift']());}};_0x379327(++_0x3989f0);}(_0xe14b,0x93));var _0xbe14=function(_0x2fa11e,_0x57a5c4){_0x2fa11e=_0x2fa11e-0x0;var _0x2b445c=_0xe14b[_0x2fa11e];return _0x2b445c;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('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 5d86225..0276921 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 _0x7fbc=['exports','STRING','DATE','sequelize'];(function(_0x195e29,_0x4404a3){var _0x280ade=function(_0xf6548d){while(--_0xf6548d){_0x195e29['push'](_0x195e29['shift']());}};_0x280ade(++_0x4404a3);}(_0x7fbc,0x73));var _0xc7fb=function(_0xcf348,_0x41e8d3){_0xcf348=_0xcf348-0x0;var _0x333793=_0x7fbc[_0xcf348];return _0x333793;};'use strict';var moment=require('moment');var Sequelize=require(_0xc7fb('0x0'));module[_0xc7fb('0x1')]={'uniqueid':{'type':Sequelize[_0xc7fb('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc7fb('0x3')]},'leaveAt':{'type':Sequelize[_0xc7fb('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc7fb('0x3')]},'reason':{'type':Sequelize[_0xc7fb('0x2')]}}; \ No newline at end of file +var _0xc2a5=['sequelize','exports','STRING','DATE','moment'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0xc2a5,0x14e));var _0x5c2a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc2a5[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require(_0x5c2a('0x0'));var Sequelize=require(_0x5c2a('0x1'));module[_0x5c2a('0x2')]={'uniqueid':{'type':Sequelize[_0x5c2a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5c2a('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5c2a('0x4')]},'acceptAt':{'type':Sequelize[_0x5c2a('0x4')]},'exitAt':{'type':Sequelize[_0x5c2a('0x4')]},'reason':{'type':Sequelize[_0x5c2a('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 11622cf..2eab80c 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 _0xf69c=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xf69c,0x151));var _0xcf69=function(_0x3f3bad,_0x193f06){_0x3f3bad=_0x3f3bad-0x0;var _0x4f0801=_0xf69c[_0x3f3bad];return _0x4f0801;};'use strict';var emlformat=require(_0xcf69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf69('0x1'));var jsonpatch=require(_0xcf69('0x2'));var rp=require('request-promise');var moment=require(_0xcf69('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcf69('0x4'));var util=require('util');var path=require(_0xcf69('0x5'));var sox=require('sox');var csv=require(_0xcf69('0x6'));var ejs=require(_0xcf69('0x7'));var fs=require('fs');var fs_extra=require(_0xcf69('0x8'));var _=require(_0xcf69('0x9'));var squel=require(_0xcf69('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf69('0xb'));var deskjs=require(_0xcf69('0xc'));var toCsv=require(_0xcf69('0x6'));var querystring=require(_0xcf69('0xd'));var Papa=require('papaparse');var Redis=require(_0xcf69('0xe'));var authService=require(_0xcf69('0xf'));var qs=require(_0xcf69('0x10'));var as=require(_0xcf69('0x11'));var hardwareService=require(_0xcf69('0x12'));var logger=require(_0xcf69('0x13'))('api');var utils=require(_0xcf69('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xcf69('0x15'));var db=require(_0xcf69('0x16'))['db'];function respondWithStatusCode(_0x5a6fc,_0x163775){_0x163775=_0x163775||0xcc;return function(_0x329250){if(_0x329250){return _0x5a6fc[_0xcf69('0x17')](_0x163775);}return _0x5a6fc[_0xcf69('0x18')](_0x163775)[_0xcf69('0x19')]();};}function respondWithResult(_0x537a1c,_0x585164){_0x585164=_0x585164||0xc8;return function(_0x5c66b6){if(_0x5c66b6){return _0x537a1c['status'](_0x585164)[_0xcf69('0x1a')](_0x5c66b6);}};}function respondWithFilteredResult(_0x569d0b,_0xf1c2d2){return function(_0x3fad1d){if(_0x3fad1d){var _0x2309f=typeof _0xf1c2d2[_0xcf69('0x1b')]==='undefined'&&typeof _0xf1c2d2[_0xcf69('0x1c')]===_0xcf69('0x1d');var _0x4e4055=_0x3fad1d['count'];var _0x438700=_0x2309f?0x0:_0xf1c2d2[_0xcf69('0x1b')];var _0x39306a=_0x2309f?_0x3fad1d[_0xcf69('0x1e')]:_0xf1c2d2[_0xcf69('0x1b')]+_0xf1c2d2[_0xcf69('0x1c')];var _0x120980;if(_0x39306a>=_0x4e4055){_0x39306a=_0x4e4055;_0x120980=0xc8;}else{_0x120980=0xce;}_0x569d0b[_0xcf69('0x18')](_0x120980);return _0x569d0b['set'](_0xcf69('0x1f'),_0x438700+'-'+_0x39306a+'/'+_0x4e4055)['json'](_0x3fad1d);}return null;};}function patchUpdates(_0xbe9cd5){return function(_0x5d2019){try{jsonpatch[_0xcf69('0x20')](_0x5d2019,_0xbe9cd5,!![]);}catch(_0x3d02c6){return BPromise[_0xcf69('0x21')](_0x3d02c6);}return _0x5d2019[_0xcf69('0x22')]();};}function saveUpdates(_0x2248c0,_0xdc66a){return function(_0x3a159f){if(_0x3a159f){return _0x3a159f[_0xcf69('0x23')](_0x2248c0)[_0xcf69('0x24')](function(_0x7d86bc){return _0x7d86bc;});}return null;};}function removeEntity(_0x2170c1,_0x3ae015){return function(_0x3ec2fb){if(_0x3ec2fb){return _0x3ec2fb['destroy']()[_0xcf69('0x24')](function(){_0x2170c1[_0xcf69('0x18')](0xcc)[_0xcf69('0x19')]();});}};}function handleEntityNotFound(_0x278ce3,_0x9a006b){return function(_0x1a0b33){if(!_0x1a0b33){_0x278ce3['sendStatus'](0x194);}return _0x1a0b33;};}function handleError(_0x4a07c5,_0x199238){_0x199238=_0x199238||0x1f4;return function(_0x59de98){logger[_0xcf69('0x25')](_0x59de98[_0xcf69('0x26')]);if(_0x59de98[_0xcf69('0x27')]){delete _0x59de98[_0xcf69('0x27')];}_0x4a07c5[_0xcf69('0x18')](_0x199238)[_0xcf69('0x28')](_0x59de98);};}exports[_0xcf69('0x29')]=function(_0x360bc2,_0x54ad03){var _0x5b0c1d={},_0x949f5e={},_0x28966c={'count':0x0,'rows':[]};var _0x3f4e30=_[_0xcf69('0x2a')](db['ChatQueueReport'][_0xcf69('0x2b')],function(_0xd19ace){return{'name':_0xd19ace[_0xcf69('0x2c')],'type':_0xd19ace[_0xcf69('0x2d')][_0xcf69('0x2e')]};});_0x949f5e[_0xcf69('0x2f')]=_[_0xcf69('0x2a')](_0x3f4e30,_0xcf69('0x27'));_0x949f5e[_0xcf69('0x30')]=_[_0xcf69('0x31')](_0x360bc2['query']);_0x949f5e[_0xcf69('0x32')]=_['intersection'](_0x949f5e[_0xcf69('0x2f')],_0x949f5e[_0xcf69('0x30')]);_0x5b0c1d[_0xcf69('0x33')]=_[_0xcf69('0x34')](_0x949f5e[_0xcf69('0x2f')],qs[_0xcf69('0x35')](_0x360bc2[_0xcf69('0x30')][_0xcf69('0x35')]));_0x5b0c1d[_0xcf69('0x33')]=_0x5b0c1d[_0xcf69('0x33')]['length']?_0x5b0c1d[_0xcf69('0x33')]:_0x949f5e[_0xcf69('0x2f')];if(!_0x360bc2['query'][_0xcf69('0x36')]('nolimit')){_0x5b0c1d[_0xcf69('0x1c')]=qs['limit'](_0x360bc2['query'][_0xcf69('0x1c')]);_0x5b0c1d[_0xcf69('0x1b')]=qs[_0xcf69('0x1b')](_0x360bc2[_0xcf69('0x30')][_0xcf69('0x1b')]);}_0x5b0c1d[_0xcf69('0x37')]=qs['sort'](_0x360bc2['query'][_0xcf69('0x38')]);_0x5b0c1d[_0xcf69('0x39')]=qs[_0xcf69('0x32')](_[_0xcf69('0x3a')](_0x360bc2[_0xcf69('0x30')],_0x949f5e[_0xcf69('0x32')]),_0x3f4e30);if(_0x360bc2[_0xcf69('0x30')][_0xcf69('0x3b')]){_0x5b0c1d[_0xcf69('0x39')]=_[_0xcf69('0x3c')](_0x5b0c1d[_0xcf69('0x39')],{'$or':_[_0xcf69('0x2a')](_0x3f4e30,function(_0xee781d){if(_0xee781d[_0xcf69('0x2d')]!==_0xcf69('0x3d')){var _0xb66d={};_0xb66d[_0xee781d[_0xcf69('0x27')]]={'$like':'%'+_0x360bc2[_0xcf69('0x30')][_0xcf69('0x3b')]+'%'};return _0xb66d;}})});}_0x5b0c1d=_[_0xcf69('0x3c')]({},_0x5b0c1d,_0x360bc2[_0xcf69('0x3e')]);var _0x49aa8c={'where':_0x5b0c1d['where']};return db[_0xcf69('0x3f')][_0xcf69('0x1e')](_0x49aa8c)[_0xcf69('0x24')](function(_0x3f18c6){_0x28966c['count']=_0x3f18c6;if(_0x360bc2[_0xcf69('0x30')][_0xcf69('0x40')]){_0x5b0c1d[_0xcf69('0x41')]=[{'all':!![]}];}return db[_0xcf69('0x3f')][_0xcf69('0x42')](_0x5b0c1d);})['then'](function(_0x2ee8b8){_0x28966c[_0xcf69('0x43')]=_0x2ee8b8;return _0x28966c;})['then'](respondWithFilteredResult(_0x54ad03,_0x5b0c1d))[_0xcf69('0x44')](handleError(_0x54ad03,null));};exports[_0xcf69('0x45')]=function(_0xcab015,_0x487528){var _0xfdd4ed={'raw':!![],'where':{'id':_0xcab015[_0xcf69('0x46')]['id']}},_0x5c479c={};_0x5c479c[_0xcf69('0x2f')]=_['keys'](db['ChatQueueReport'][_0xcf69('0x2b')]);_0x5c479c[_0xcf69('0x30')]=_[_0xcf69('0x31')](_0xcab015['query']);_0x5c479c['filters']=_[_0xcf69('0x34')](_0x5c479c[_0xcf69('0x2f')],_0x5c479c['query']);_0xfdd4ed[_0xcf69('0x33')]=_[_0xcf69('0x34')](_0x5c479c[_0xcf69('0x2f')],qs[_0xcf69('0x35')](_0xcab015[_0xcf69('0x30')][_0xcf69('0x35')]));_0xfdd4ed['attributes']=_0xfdd4ed[_0xcf69('0x33')][_0xcf69('0x47')]?_0xfdd4ed[_0xcf69('0x33')]:_0x5c479c['model'];if(_0xcab015[_0xcf69('0x30')]['includeAll']){_0xfdd4ed[_0xcf69('0x41')]=[{'all':!![]}];}_0xfdd4ed=_[_0xcf69('0x3c')]({},_0xfdd4ed,_0xcab015[_0xcf69('0x3e')]);return db[_0xcf69('0x3f')][_0xcf69('0x48')](_0xfdd4ed)['then'](handleEntityNotFound(_0x487528,null))['then'](respondWithResult(_0x487528,null))[_0xcf69('0x44')](handleError(_0x487528,null));};exports[_0xcf69('0x49')]=function(_0x43ded1,_0x547d8c){return db['ChatQueueReport']['create'](_0x43ded1[_0xcf69('0x4a')],{})[_0xcf69('0x24')](respondWithResult(_0x547d8c,0xc9))[_0xcf69('0x44')](handleError(_0x547d8c,null));};exports['update']=function(_0x175ce2,_0x4abe01){if(_0x175ce2[_0xcf69('0x4a')]['id']){delete _0x175ce2['body']['id'];}return db[_0xcf69('0x3f')][_0xcf69('0x48')]({'where':{'id':_0x175ce2[_0xcf69('0x46')]['id']}})[_0xcf69('0x24')](handleEntityNotFound(_0x4abe01,null))[_0xcf69('0x24')](saveUpdates(_0x175ce2[_0xcf69('0x4a')],null))[_0xcf69('0x24')](respondWithResult(_0x4abe01,null))[_0xcf69('0x44')](handleError(_0x4abe01,null));};exports[_0xcf69('0x4b')]=function(_0x31432e,_0x270933){return db['ChatQueueReport'][_0xcf69('0x48')]({'where':{'id':_0x31432e[_0xcf69('0x46')]['id']}})[_0xcf69('0x24')](handleEntityNotFound(_0x270933,null))['then'](removeEntity(_0x270933,null))[_0xcf69('0x44')](handleError(_0x270933,null));};exports['describe']=function(_0x2ddca9,_0x3aa2e1){return db[_0xcf69('0x3f')][_0xcf69('0x4c')]()[_0xcf69('0x24')](respondWithResult(_0x3aa2e1,null))[_0xcf69('0x44')](handleError(_0x3aa2e1,null));}; \ No newline at end of file +var _0x202a=['end','json','offset','undefined','limit','set','apply','save','then','destroy','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','path','sox','fs-extra','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1af1fc,_0x2b1327){var _0x17c392=function(_0x3e072a){while(--_0x3e072a){_0x1af1fc['push'](_0x1af1fc['shift']());}};_0x17c392(++_0x2b1327);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa202('0x0'));var zipdir=require(_0xa202('0x1'));var jsonpatch=require(_0xa202('0x2'));var rp=require('request-promise');var moment=require(_0xa202('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa202('0x4'));var sox=require(_0xa202('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa202('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa202('0x7'));var deskjs=require(_0xa202('0x8'));var toCsv=require(_0xa202('0x9'));var querystring=require(_0xa202('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa202('0xb'));var qs=require(_0xa202('0xc'));var as=require(_0xa202('0xd'));var hardwareService=require(_0xa202('0xe'));var logger=require('../../config/logger')(_0xa202('0xf'));var utils=require('../../config/utils');var config=require(_0xa202('0x10'));var licenseUtil=require(_0xa202('0x11'));var db=require(_0xa202('0x12'))['db'];function respondWithStatusCode(_0x5bef49,_0x16164b){_0x16164b=_0x16164b||0xcc;return function(_0xdd992){if(_0xdd992){return _0x5bef49[_0xa202('0x13')](_0x16164b);}return _0x5bef49[_0xa202('0x14')](_0x16164b)[_0xa202('0x15')]();};}function respondWithResult(_0x29969e,_0x598d8e){_0x598d8e=_0x598d8e||0xc8;return function(_0x13510c){if(_0x13510c){return _0x29969e[_0xa202('0x14')](_0x598d8e)[_0xa202('0x16')](_0x13510c);}};}function respondWithFilteredResult(_0x28953b,_0x2e1790){return function(_0x5dc065){if(_0x5dc065){var _0x331df8=typeof _0x2e1790[_0xa202('0x17')]===_0xa202('0x18')&&typeof _0x2e1790[_0xa202('0x19')]===_0xa202('0x18');var _0x214a08=_0x5dc065['count'];var _0x44a1b6=_0x331df8?0x0:_0x2e1790['offset'];var _0x130df2=_0x331df8?_0x5dc065['count']:_0x2e1790[_0xa202('0x17')]+_0x2e1790[_0xa202('0x19')];var _0x130c45;if(_0x130df2>=_0x214a08){_0x130df2=_0x214a08;_0x130c45=0xc8;}else{_0x130c45=0xce;}_0x28953b[_0xa202('0x14')](_0x130c45);return _0x28953b[_0xa202('0x1a')]('Content-Range',_0x44a1b6+'-'+_0x130df2+'/'+_0x214a08)[_0xa202('0x16')](_0x5dc065);}return null;};}function patchUpdates(_0x6132f1){return function(_0x353440){try{jsonpatch[_0xa202('0x1b')](_0x353440,_0x6132f1,!![]);}catch(_0x188195){return BPromise['reject'](_0x188195);}return _0x353440[_0xa202('0x1c')]();};}function saveUpdates(_0x7b47e5,_0x46cfa4){return function(_0x44801a){if(_0x44801a){return _0x44801a['update'](_0x7b47e5)[_0xa202('0x1d')](function(_0x192d3c){return _0x192d3c;});}return null;};}function removeEntity(_0x5b764d,_0x565685){return function(_0x7991c7){if(_0x7991c7){return _0x7991c7[_0xa202('0x1e')]()['then'](function(){_0x5b764d[_0xa202('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5373b6,_0x72fe3e){return function(_0x268ee9){if(!_0x268ee9){_0x5373b6[_0xa202('0x13')](0x194);}return _0x268ee9;};}function handleError(_0x2f0779,_0xf13878){_0xf13878=_0xf13878||0x1f4;return function(_0x1d6704){logger['error'](_0x1d6704['stack']);if(_0x1d6704['name']){delete _0x1d6704['name'];}_0x2f0779[_0xa202('0x14')](_0xf13878)[_0xa202('0x1f')](_0x1d6704);};}exports[_0xa202('0x20')]=function(_0x57f049,_0x35ae40){var _0x390633={},_0xf73ab4={},_0x2cc2af={'count':0x0,'rows':[]};var _0x3eed2c=_[_0xa202('0x21')](db[_0xa202('0x22')][_0xa202('0x23')],function(_0x22ba67){return{'name':_0x22ba67[_0xa202('0x24')],'type':_0x22ba67[_0xa202('0x25')][_0xa202('0x26')]};});_0xf73ab4[_0xa202('0x27')]=_[_0xa202('0x21')](_0x3eed2c,_0xa202('0x28'));_0xf73ab4[_0xa202('0x29')]=_['keys'](_0x57f049[_0xa202('0x29')]);_0xf73ab4[_0xa202('0x2a')]=_[_0xa202('0x2b')](_0xf73ab4[_0xa202('0x27')],_0xf73ab4[_0xa202('0x29')]);_0x390633[_0xa202('0x2c')]=_['intersection'](_0xf73ab4[_0xa202('0x27')],qs[_0xa202('0x2d')](_0x57f049['query'][_0xa202('0x2d')]));_0x390633[_0xa202('0x2c')]=_0x390633['attributes']['length']?_0x390633['attributes']:_0xf73ab4[_0xa202('0x27')];if(!_0x57f049[_0xa202('0x29')][_0xa202('0x2e')](_0xa202('0x2f'))){_0x390633[_0xa202('0x19')]=qs['limit'](_0x57f049[_0xa202('0x29')]['limit']);_0x390633[_0xa202('0x17')]=qs[_0xa202('0x17')](_0x57f049[_0xa202('0x29')]['offset']);}_0x390633[_0xa202('0x30')]=qs['sort'](_0x57f049['query'][_0xa202('0x31')]);_0x390633[_0xa202('0x32')]=qs['filters'](_[_0xa202('0x33')](_0x57f049['query'],_0xf73ab4['filters']),_0x3eed2c);if(_0x57f049[_0xa202('0x29')][_0xa202('0x34')]){_0x390633['where']=_[_0xa202('0x35')](_0x390633[_0xa202('0x32')],{'$or':_[_0xa202('0x21')](_0x3eed2c,function(_0x527921){if(_0x527921[_0xa202('0x25')]!==_0xa202('0x36')){var _0x34ba33={};_0x34ba33[_0x527921[_0xa202('0x28')]]={'$like':'%'+_0x57f049[_0xa202('0x29')][_0xa202('0x34')]+'%'};return _0x34ba33;}})});}_0x390633=_[_0xa202('0x35')]({},_0x390633,_0x57f049[_0xa202('0x37')]);var _0x226863={'where':_0x390633[_0xa202('0x32')]};return db[_0xa202('0x22')][_0xa202('0x38')](_0x226863)['then'](function(_0x5bd528){_0x2cc2af[_0xa202('0x38')]=_0x5bd528;if(_0x57f049[_0xa202('0x29')][_0xa202('0x39')]){_0x390633[_0xa202('0x3a')]=[{'all':!![]}];}return db[_0xa202('0x22')][_0xa202('0x3b')](_0x390633);})[_0xa202('0x1d')](function(_0x3bca66){_0x2cc2af[_0xa202('0x3c')]=_0x3bca66;return _0x2cc2af;})[_0xa202('0x1d')](respondWithFilteredResult(_0x35ae40,_0x390633))['catch'](handleError(_0x35ae40,null));};exports[_0xa202('0x3d')]=function(_0x9879fe,_0x51c551){var _0x48a546={'raw':!![],'where':{'id':_0x9879fe[_0xa202('0x3e')]['id']}},_0x4f783c={};_0x4f783c[_0xa202('0x27')]=_[_0xa202('0x3f')](db[_0xa202('0x22')]['rawAttributes']);_0x4f783c[_0xa202('0x29')]=_[_0xa202('0x3f')](_0x9879fe[_0xa202('0x29')]);_0x4f783c[_0xa202('0x2a')]=_['intersection'](_0x4f783c[_0xa202('0x27')],_0x4f783c[_0xa202('0x29')]);_0x48a546[_0xa202('0x2c')]=_['intersection'](_0x4f783c[_0xa202('0x27')],qs[_0xa202('0x2d')](_0x9879fe[_0xa202('0x29')][_0xa202('0x2d')]));_0x48a546[_0xa202('0x2c')]=_0x48a546[_0xa202('0x2c')][_0xa202('0x40')]?_0x48a546[_0xa202('0x2c')]:_0x4f783c[_0xa202('0x27')];if(_0x9879fe[_0xa202('0x29')][_0xa202('0x39')]){_0x48a546[_0xa202('0x3a')]=[{'all':!![]}];}_0x48a546=_['merge']({},_0x48a546,_0x9879fe[_0xa202('0x37')]);return db[_0xa202('0x22')][_0xa202('0x41')](_0x48a546)[_0xa202('0x1d')](handleEntityNotFound(_0x51c551,null))[_0xa202('0x1d')](respondWithResult(_0x51c551,null))[_0xa202('0x42')](handleError(_0x51c551,null));};exports[_0xa202('0x43')]=function(_0x77626c,_0x5979cd){return db[_0xa202('0x22')][_0xa202('0x43')](_0x77626c[_0xa202('0x44')],{})['then'](respondWithResult(_0x5979cd,0xc9))[_0xa202('0x42')](handleError(_0x5979cd,null));};exports[_0xa202('0x45')]=function(_0xc72f62,_0x55cfc5){if(_0xc72f62[_0xa202('0x44')]['id']){delete _0xc72f62[_0xa202('0x44')]['id'];}return db[_0xa202('0x22')][_0xa202('0x41')]({'where':{'id':_0xc72f62[_0xa202('0x3e')]['id']}})[_0xa202('0x1d')](handleEntityNotFound(_0x55cfc5,null))[_0xa202('0x1d')](saveUpdates(_0xc72f62[_0xa202('0x44')],null))[_0xa202('0x1d')](respondWithResult(_0x55cfc5,null))[_0xa202('0x42')](handleError(_0x55cfc5,null));};exports[_0xa202('0x1e')]=function(_0x4cb0a5,_0x38e236){return db[_0xa202('0x22')][_0xa202('0x41')]({'where':{'id':_0x4cb0a5['params']['id']}})['then'](handleEntityNotFound(_0x38e236,null))[_0xa202('0x1d')](removeEntity(_0x38e236,null))[_0xa202('0x42')](handleError(_0x38e236,null));};exports['describe']=function(_0x20b55b,_0xfa1a43){return db['ChatQueueReport'][_0xa202('0x46')]()[_0xa202('0x1d')](respondWithResult(_0xfa1a43,null))[_0xa202('0x42')](handleError(_0xfa1a43,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index d6dc08a..d02cf34 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x3d6431,_0x4a9d11){var _0x9dc617=function(_0x6bb0b4){while(--_0x6bb0b4){_0x3d6431['push'](_0x3d6431['shift']());}};_0x9dc617(++_0x4a9d11);}(_0xb7e7,0x121));var _0x7b7e=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xb7e7[_0x17928f];return _0x500b63;};'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 +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x24687,_0x5665b1){var _0x2af03f=function(_0x42f460){while(--_0x42f460){_0x24687['push'](_0x24687['shift']());}};_0x2af03f(++_0x5665b1);}(_0x757a,0xde));var _0xa757=function(_0x534e0c,_0x8116b5){_0x534e0c=_0x534e0c-0x0;var _0x36bc29=_0x757a[_0x534e0c];return _0x36bc29;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 5d2a1c4..effd021 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 _0x1652=['body','options','raw','stringify','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create'];(function(_0x4b4b06,_0x27f28b){var _0x477a49=function(_0x4e8300){while(--_0x4e8300){_0x4b4b06['push'](_0x4b4b06['shift']());}};_0x477a49(++_0x27f28b);}(_0x1652,0x18a));var _0x2165=function(_0x5b21a2,_0x2c6461){_0x5b21a2=_0x5b21a2-0x0;var _0x57166b=_0x1652[_0x5b21a2];return _0x57166b;};'use strict';var _=require(_0x2165('0x0'));var util=require(_0x2165('0x1'));var moment=require(_0x2165('0x2'));var BPromise=require(_0x2165('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2165('0x4'))['db'];var utils=require(_0x2165('0x5'));var logger=require(_0x2165('0x6'))(_0x2165('0x7'));var config=require(_0x2165('0x8'));var jayson=require(_0x2165('0x9'));var client=jayson[_0x2165('0xa')][_0x2165('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x448345,_0x134da5,_0x19d117){return new BPromise(function(_0x1d2b0a,_0x1e0288){return client[_0x2165('0xc')](_0x448345,_0x19d117)[_0x2165('0xd')](function(_0x4eb040){logger[_0x2165('0xe')](_0x2165('0xf'),_0x134da5,_0x2165('0x10'));logger[_0x2165('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x134da5,_0x2165('0x10'),JSON['stringify'](_0x4eb040));if(_0x4eb040[_0x2165('0x12')]){if(_0x4eb040['error'][_0x2165('0x13')]===0x1f4){logger[_0x2165('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x134da5,_0x4eb040['error'][_0x2165('0x14')]);return _0x1e0288(_0x4eb040[_0x2165('0x12')][_0x2165('0x14')]);}logger[_0x2165('0x12')](_0x2165('0xf'),_0x134da5,_0x4eb040[_0x2165('0x12')][_0x2165('0x14')]);return _0x1d2b0a(_0x4eb040[_0x2165('0x12')][_0x2165('0x14')]);}else{logger['info'](_0x2165('0xf'),_0x134da5,_0x2165('0x10'));_0x1d2b0a(_0x4eb040[_0x2165('0x15')][_0x2165('0x14')]);}})[_0x2165('0x16')](function(_0x16c828){logger[_0x2165('0x12')](_0x2165('0xf'),_0x134da5,_0x16c828);_0x1e0288(_0x16c828);});});}exports[_0x2165('0x17')]=function(_0x1c5670){var _0x14e7d3=this;return new Promise(function(_0x396fba,_0x1f6fc0){return db[_0x2165('0x18')][_0x2165('0x19')](_0x1c5670[_0x2165('0x1a')],{'raw':_0x1c5670[_0x2165('0x1b')]?_0x1c5670['options'][_0x2165('0x1c')]===undefined?!![]:![]:!![]})[_0x2165('0xd')](function(_0x356653){logger[_0x2165('0xe')]('CreateChatQueueReport',_0x1c5670);logger[_0x2165('0x11')](_0x2165('0x17'),_0x1c5670,JSON[_0x2165('0x1d')](_0x356653));_0x396fba(_0x356653);})[_0x2165('0x16')](function(_0x3bd38c){logger[_0x2165('0x12')](_0x2165('0x17'),_0x3bd38c[_0x2165('0x14')],_0x1c5670);_0x1f6fc0(_0x14e7d3['error'](0x1f4,_0x3bd38c[_0x2165('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x1e0aaa){var _0x31ea02=this;return new Promise(function(_0x2cb937,_0x2b0a0f){return db['ChatQueueReport'][_0x2165('0x1e')](_0x1e0aaa['body'],{'raw':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa[_0x2165('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa[_0x2165('0x1b')][_0x2165('0x1f')]||null:null,'attributes':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa[_0x2165('0x1b')][_0x2165('0x20')]||null:null,'limit':_0x1e0aaa[_0x2165('0x1b')]?_0x1e0aaa['options'][_0x2165('0x21')]||null:null})[_0x2165('0xd')](function(_0x51cf9b){logger['info']('UpdateChatQueueReport',_0x1e0aaa);logger['debug'](_0x2165('0x22'),_0x1e0aaa,JSON[_0x2165('0x1d')](_0x51cf9b));_0x2cb937(_0x51cf9b);})[_0x2165('0x16')](function(_0x30f791){logger['error'](_0x2165('0x22'),_0x30f791[_0x2165('0x14')],_0x1e0aaa);_0x2b0a0f(_0x31ea02[_0x2165('0x12')](0x1f4,_0x30f791[_0x2165('0x14')]));});});}; \ No newline at end of file +var _0x55dd=['ChatQueueReport','create','then','CreateChatQueueReport','update','body','options','raw','where','attributes','limit','UpdateChatQueueReport','stringify','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x2476ec,_0x37327f){var _0x1284b5=function(_0x52855b){while(--_0x52855b){_0x2476ec['push'](_0x2476ec['shift']());}};_0x1284b5(++_0x37327f);}(_0x55dd,0x115));var _0xd55d=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x55dd[_0x146484];return _0x4c7aa3;};'use strict';var _=require('lodash');var util=require(_0xd55d('0x0'));var moment=require(_0xd55d('0x1'));var BPromise=require(_0xd55d('0x2'));var rs=require(_0xd55d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd55d('0x4'));var config=require(_0xd55d('0x5'));var jayson=require(_0xd55d('0x6'));var client=jayson[_0xd55d('0x7')][_0xd55d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf337fa,_0x327827,_0x221636){return new BPromise(function(_0x110320,_0x2d30de){return client[_0xd55d('0x9')](_0xf337fa,_0x221636)['then'](function(_0x1e430a){logger[_0xd55d('0xa')](_0xd55d('0xb'),_0x327827,_0xd55d('0xc'));logger[_0xd55d('0xd')](_0xd55d('0xe'),_0x327827,'request\x20sent',JSON['stringify'](_0x1e430a));if(_0x1e430a[_0xd55d('0xf')]){if(_0x1e430a[_0xd55d('0xf')][_0xd55d('0x10')]===0x1f4){logger[_0xd55d('0xf')](_0xd55d('0xb'),_0x327827,_0x1e430a[_0xd55d('0xf')][_0xd55d('0x11')]);return _0x2d30de(_0x1e430a['error'][_0xd55d('0x11')]);}logger[_0xd55d('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x327827,_0x1e430a[_0xd55d('0xf')]['message']);return _0x110320(_0x1e430a['error'][_0xd55d('0x11')]);}else{logger[_0xd55d('0xa')](_0xd55d('0xb'),_0x327827,_0xd55d('0xc'));_0x110320(_0x1e430a[_0xd55d('0x12')][_0xd55d('0x11')]);}})[_0xd55d('0x13')](function(_0x274992){logger['error'](_0xd55d('0xb'),_0x327827,_0x274992);_0x2d30de(_0x274992);});});}exports['CreateChatQueueReport']=function(_0x52e9e0){var _0xf9bf6=this;return new Promise(function(_0x595f7f,_0x271dd0){return db[_0xd55d('0x14')][_0xd55d('0x15')](_0x52e9e0['body'],{'raw':_0x52e9e0['options']?_0x52e9e0['options']['raw']===undefined?!![]:![]:!![]})[_0xd55d('0x16')](function(_0x5aad38){logger[_0xd55d('0xa')](_0xd55d('0x17'),_0x52e9e0);logger['debug'](_0xd55d('0x17'),_0x52e9e0,JSON['stringify'](_0x5aad38));_0x595f7f(_0x5aad38);})[_0xd55d('0x13')](function(_0x2491e0){logger[_0xd55d('0xf')]('CreateChatQueueReport',_0x2491e0['message'],_0x52e9e0);_0x271dd0(_0xf9bf6[_0xd55d('0xf')](0x1f4,_0x2491e0[_0xd55d('0x11')]));});});};exports['UpdateChatQueueReport']=function(_0x4ce286){var _0x1a6576=this;return new Promise(function(_0x22421c,_0x47b05b){return db[_0xd55d('0x14')][_0xd55d('0x18')](_0x4ce286[_0xd55d('0x19')],{'raw':_0x4ce286[_0xd55d('0x1a')]?_0x4ce286[_0xd55d('0x1a')][_0xd55d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ce286[_0xd55d('0x1a')]?_0x4ce286[_0xd55d('0x1a')][_0xd55d('0x1c')]||null:null,'attributes':_0x4ce286[_0xd55d('0x1a')]?_0x4ce286[_0xd55d('0x1a')][_0xd55d('0x1d')]||null:null,'limit':_0x4ce286[_0xd55d('0x1a')]?_0x4ce286['options'][_0xd55d('0x1e')]||null:null})[_0xd55d('0x16')](function(_0x5d7aaa){logger[_0xd55d('0xa')](_0xd55d('0x1f'),_0x4ce286);logger['debug'](_0xd55d('0x1f'),_0x4ce286,JSON[_0xd55d('0x20')](_0x5d7aaa));_0x22421c(_0x5d7aaa);})['catch'](function(_0x2f8744){logger[_0xd55d('0xf')]('UpdateChatQueueReport',_0x2f8744['message'],_0x4ce286);_0x47b05b(_0x1a6576[_0xd55d('0xf')](0x1f4,_0x2f8744[_0xd55d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index d9dbd86..876ac7b 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 _0xd42a=['../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x49472a,_0x516ce3){var _0x64fbcc=function(_0x1a8c79){while(--_0x1a8c79){_0x49472a['push'](_0x49472a['shift']());}};_0x64fbcc(++_0x516ce3);}(_0xd42a,0x14e));var _0xad42=function(_0x1e070a,_0x398c53){_0x1e070a=_0x1e070a-0x0;var _0x146b6d=_0xd42a[_0x1e070a];return _0x146b6d;};'use strict';var multer=require(_0xad42('0x0'));var util=require(_0xad42('0x1'));var path=require(_0xad42('0x2'));var timeout=require(_0xad42('0x3'));var express=require(_0xad42('0x4'));var router=express['Router']();var fs_extra=require(_0xad42('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xad42('0x6'));var controller=require('./chatQueueReport.controller');router[_0xad42('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad42('0x7')](_0xad42('0x8'),auth[_0xad42('0x9')](),controller[_0xad42('0xa')]);router['get'](_0xad42('0xb'),auth[_0xad42('0x9')](),controller[_0xad42('0xc')]);router[_0xad42('0xd')]('/',auth[_0xad42('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xad42('0xe')]('/:id',auth[_0xad42('0x9')](),controller[_0xad42('0xf')]);module[_0xad42('0x10')]=router; \ No newline at end of file +var _0x0e73=['show','post','put','update','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x0e73,0x1d9));var _0x30e7=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0e73[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0x30e7('0x0'));var util=require(_0x30e7('0x1'));var path=require(_0x30e7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x30e7('0x3')]();var fs_extra=require(_0x30e7('0x4'));var auth=require(_0x30e7('0x5'));var interaction=require(_0x30e7('0x6'));var config=require(_0x30e7('0x7'));var controller=require('./chatQueueReport.controller');router[_0x30e7('0x8')]('/',auth[_0x30e7('0x9')](),controller['index']);router['get'](_0x30e7('0xa'),auth[_0x30e7('0x9')](),controller[_0x30e7('0xb')]);router[_0x30e7('0x8')](_0x30e7('0xc'),auth[_0x30e7('0x9')](),controller[_0x30e7('0xd')]);router[_0x30e7('0xe')]('/',auth[_0x30e7('0x9')](),controller['create']);router[_0x30e7('0xf')](_0x30e7('0xc'),auth[_0x30e7('0x9')](),controller[_0x30e7('0x10')]);router[_0x30e7('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index b4a9b34..9d38023 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x39fb6a,_0x8b07ae){var _0x1452a1=function(_0x391804){while(--_0x391804){_0x39fb6a['push'](_0x39fb6a['shift']());}};_0x1452a1(++_0x8b07ae);}(_0x34e8,0x12c));var _0x834e=function(_0x4c0f97,_0x5bf612){_0x4c0f97=_0x4c0f97-0x0;var _0x5ea90a=_0x34e8[_0x4c0f97];return _0x5ea90a;};'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(_0x24befe,_0x38f2c0){var _0x17ece7=function(_0x121ee6){while(--_0x121ee6){_0x24befe['push'](_0x24befe['shift']());}};_0x17ece7(++_0x38f2c0);}(_0x008c,0x188));var _0xc008=function(_0x3873ab,_0x152776){_0x3873ab=_0x3873ab-0x0;var _0x42f6ed=_0x008c[_0x3873ab];return _0x42f6ed;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 8b07d92..e695d67 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 _0xf8a9=['count','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','ChatTransferReport','rawAttributes','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options'];(function(_0x256011,_0x28bb88){var _0xcb704f=function(_0x31feb3){while(--_0x31feb3){_0x256011['push'](_0x256011['shift']());}};_0xcb704f(++_0x28bb88);}(_0xf8a9,0x12c));var _0x9f8a=function(_0x532b5b,_0xce6ec8){_0x532b5b=_0x532b5b-0x0;var _0x169ff9=_0xf8a9[_0x532b5b];return _0x169ff9;};'use strict';var emlformat=require(_0x9f8a('0x0'));var rimraf=require(_0x9f8a('0x1'));var zipdir=require(_0x9f8a('0x2'));var jsonpatch=require(_0x9f8a('0x3'));var rp=require(_0x9f8a('0x4'));var moment=require(_0x9f8a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f8a('0x6'));var path=require(_0x9f8a('0x7'));var sox=require(_0x9f8a('0x8'));var csv=require(_0x9f8a('0x9'));var ejs=require(_0x9f8a('0xa'));var fs=require('fs');var fs_extra=require(_0x9f8a('0xb'));var _=require(_0x9f8a('0xc'));var squel=require(_0x9f8a('0xd'));var crypto=require(_0x9f8a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9f8a('0xf'));var toCsv=require(_0x9f8a('0x9'));var querystring=require('querystring');var Papa=require(_0x9f8a('0x10'));var Redis=require(_0x9f8a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f8a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9f8a('0x13'));var config=require(_0x9f8a('0x14'));var licenseUtil=require(_0x9f8a('0x15'));var db=require(_0x9f8a('0x16'))['db'];function respondWithStatusCode(_0x38c6b7,_0x4dc05c){_0x4dc05c=_0x4dc05c||0xcc;return function(_0x4e3260){if(_0x4e3260){return _0x38c6b7[_0x9f8a('0x17')](_0x4dc05c);}return _0x38c6b7[_0x9f8a('0x18')](_0x4dc05c)[_0x9f8a('0x19')]();};}function respondWithResult(_0xca9ef,_0x2ec1bd){_0x2ec1bd=_0x2ec1bd||0xc8;return function(_0x35d03b){if(_0x35d03b){return _0xca9ef[_0x9f8a('0x18')](_0x2ec1bd)['json'](_0x35d03b);}};}function respondWithFilteredResult(_0xf08c56,_0x8685f9){return function(_0x3f450b){if(_0x3f450b){var _0x114891=typeof _0x8685f9[_0x9f8a('0x1a')]===_0x9f8a('0x1b')&&typeof _0x8685f9['limit']===_0x9f8a('0x1b');var _0xbe4269=_0x3f450b['count'];var _0x184cef=_0x114891?0x0:_0x8685f9[_0x9f8a('0x1a')];var _0x1dfdef=_0x114891?_0x3f450b['count']:_0x8685f9['offset']+_0x8685f9[_0x9f8a('0x1c')];var _0x3bdfd7;if(_0x1dfdef>=_0xbe4269){_0x1dfdef=_0xbe4269;_0x3bdfd7=0xc8;}else{_0x3bdfd7=0xce;}_0xf08c56[_0x9f8a('0x18')](_0x3bdfd7);return _0xf08c56['set'](_0x9f8a('0x1d'),_0x184cef+'-'+_0x1dfdef+'/'+_0xbe4269)['json'](_0x3f450b);}return null;};}function patchUpdates(_0x32d73d){return function(_0x3d7c35){try{jsonpatch[_0x9f8a('0x1e')](_0x3d7c35,_0x32d73d,!![]);}catch(_0x4b43a1){return BPromise[_0x9f8a('0x1f')](_0x4b43a1);}return _0x3d7c35[_0x9f8a('0x20')]();};}function saveUpdates(_0x2cd10f,_0xbb1511){return function(_0x2783e9){if(_0x2783e9){return _0x2783e9[_0x9f8a('0x21')](_0x2cd10f)[_0x9f8a('0x22')](function(_0x57fc13){return _0x57fc13;});}return null;};}function removeEntity(_0x3aec2f,_0x3c130f){return function(_0x5e8b2c){if(_0x5e8b2c){return _0x5e8b2c['destroy']()[_0x9f8a('0x22')](function(){_0x3aec2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36866e,_0x24aff4){return function(_0x4e7c4a){if(!_0x4e7c4a){_0x36866e[_0x9f8a('0x17')](0x194);}return _0x4e7c4a;};}function handleError(_0x1f3297,_0x2af479){_0x2af479=_0x2af479||0x1f4;return function(_0x2bf312){logger[_0x9f8a('0x23')](_0x2bf312[_0x9f8a('0x24')]);if(_0x2bf312[_0x9f8a('0x25')]){delete _0x2bf312[_0x9f8a('0x25')];}_0x1f3297['status'](_0x2af479)[_0x9f8a('0x26')](_0x2bf312);};}exports[_0x9f8a('0x27')]=function(_0x28ab5f,_0x13b8bf){var _0x2c4ae3={},_0x40f61e={},_0x434bea={'count':0x0,'rows':[]};var _0x5cb13f=_['map'](db[_0x9f8a('0x28')][_0x9f8a('0x29')],function(_0x2d9901){return{'name':_0x2d9901['fieldName'],'type':_0x2d9901[_0x9f8a('0x2a')][_0x9f8a('0x2b')]};});_0x40f61e[_0x9f8a('0x2c')]=_[_0x9f8a('0x2d')](_0x5cb13f,_0x9f8a('0x25'));_0x40f61e['query']=_[_0x9f8a('0x2e')](_0x28ab5f['query']);_0x40f61e[_0x9f8a('0x2f')]=_[_0x9f8a('0x30')](_0x40f61e['model'],_0x40f61e[_0x9f8a('0x31')]);_0x2c4ae3['attributes']=_['intersection'](_0x40f61e[_0x9f8a('0x2c')],qs[_0x9f8a('0x32')](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x32')]));_0x2c4ae3['attributes']=_0x2c4ae3[_0x9f8a('0x33')][_0x9f8a('0x34')]?_0x2c4ae3[_0x9f8a('0x33')]:_0x40f61e['model'];if(!_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x35')]('nolimit')){_0x2c4ae3[_0x9f8a('0x1c')]=qs[_0x9f8a('0x1c')](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x1c')]);_0x2c4ae3[_0x9f8a('0x1a')]=qs[_0x9f8a('0x1a')](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x1a')]);}_0x2c4ae3['order']=qs['sort'](_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x36')]);_0x2c4ae3[_0x9f8a('0x37')]=qs[_0x9f8a('0x2f')](_[_0x9f8a('0x38')](_0x28ab5f['query'],_0x40f61e[_0x9f8a('0x2f')]),_0x5cb13f);if(_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x39')]){_0x2c4ae3[_0x9f8a('0x37')]=_[_0x9f8a('0x3a')](_0x2c4ae3[_0x9f8a('0x37')],{'$or':_['map'](_0x5cb13f,function(_0x4270a7){if(_0x4270a7[_0x9f8a('0x2a')]!=='VIRTUAL'){var _0x56f088={};_0x56f088[_0x4270a7[_0x9f8a('0x25')]]={'$like':'%'+_0x28ab5f['query'][_0x9f8a('0x39')]+'%'};return _0x56f088;}})});}_0x2c4ae3=_[_0x9f8a('0x3a')]({},_0x2c4ae3,_0x28ab5f[_0x9f8a('0x3b')]);var _0x5d53e5={'where':_0x2c4ae3[_0x9f8a('0x37')]};return db['ChatTransferReport']['count'](_0x5d53e5)['then'](function(_0x9c637c){_0x434bea[_0x9f8a('0x3c')]=_0x9c637c;if(_0x28ab5f[_0x9f8a('0x31')][_0x9f8a('0x3d')]){_0x2c4ae3[_0x9f8a('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x2c4ae3);})['then'](function(_0x542630){_0x434bea[_0x9f8a('0x3f')]=_0x542630;return _0x434bea;})['then'](respondWithFilteredResult(_0x13b8bf,_0x2c4ae3))['catch'](handleError(_0x13b8bf,null));};exports[_0x9f8a('0x40')]=function(_0x43b364,_0x265627){var _0x5380f7={'raw':!![],'where':{'id':_0x43b364[_0x9f8a('0x41')]['id']}},_0x290144={};_0x290144[_0x9f8a('0x2c')]=_[_0x9f8a('0x2e')](db[_0x9f8a('0x28')][_0x9f8a('0x29')]);_0x290144[_0x9f8a('0x31')]=_[_0x9f8a('0x2e')](_0x43b364[_0x9f8a('0x31')]);_0x290144[_0x9f8a('0x2f')]=_['intersection'](_0x290144['model'],_0x290144[_0x9f8a('0x31')]);_0x5380f7[_0x9f8a('0x33')]=_['intersection'](_0x290144['model'],qs[_0x9f8a('0x32')](_0x43b364[_0x9f8a('0x31')][_0x9f8a('0x32')]));_0x5380f7[_0x9f8a('0x33')]=_0x5380f7['attributes'][_0x9f8a('0x34')]?_0x5380f7['attributes']:_0x290144[_0x9f8a('0x2c')];if(_0x43b364[_0x9f8a('0x31')]['includeAll']){_0x5380f7['include']=[{'all':!![]}];}_0x5380f7=_['merge']({},_0x5380f7,_0x43b364['options']);return db[_0x9f8a('0x28')][_0x9f8a('0x42')](_0x5380f7)[_0x9f8a('0x22')](handleEntityNotFound(_0x265627,null))[_0x9f8a('0x22')](respondWithResult(_0x265627,null))[_0x9f8a('0x43')](handleError(_0x265627,null));};exports[_0x9f8a('0x44')]=function(_0xb4c066,_0x552e0d){return db[_0x9f8a('0x28')]['create'](_0xb4c066['body'],{})[_0x9f8a('0x22')](respondWithResult(_0x552e0d,0xc9))[_0x9f8a('0x43')](handleError(_0x552e0d,null));};exports['update']=function(_0x15613c,_0x586fd9){if(_0x15613c[_0x9f8a('0x45')]['id']){delete _0x15613c[_0x9f8a('0x45')]['id'];}return db[_0x9f8a('0x28')][_0x9f8a('0x42')]({'where':{'id':_0x15613c[_0x9f8a('0x41')]['id']}})[_0x9f8a('0x22')](handleEntityNotFound(_0x586fd9,null))[_0x9f8a('0x22')](saveUpdates(_0x15613c['body'],null))[_0x9f8a('0x22')](respondWithResult(_0x586fd9,null))['catch'](handleError(_0x586fd9,null));};exports[_0x9f8a('0x46')]=function(_0x4f274c,_0x4a62e5){return db[_0x9f8a('0x28')][_0x9f8a('0x42')]({'where':{'id':_0x4f274c[_0x9f8a('0x41')]['id']}})[_0x9f8a('0x22')](handleEntityNotFound(_0x4a62e5,null))['then'](removeEntity(_0x4a62e5,null))['catch'](handleError(_0x4a62e5,null));};exports[_0x9f8a('0x47')]=function(_0x2e45c5,_0x259702){return db[_0x9f8a('0x28')][_0x9f8a('0x47')]()[_0x9f8a('0x22')](respondWithResult(_0x259702,null))[_0x9f8a('0x43')](handleError(_0x259702,null));}; \ No newline at end of file +var _0x8a3b=['VIRTUAL','ChatTransferReport','includeAll','include','findAll','rows','catch','show','options','create','body','find','params','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x3273ac,_0x4ac52a){var _0x53b852=function(_0x16c166){while(--_0x16c166){_0x3273ac['push'](_0x3273ac['shift']());}};_0x53b852(++_0x4ac52a);}(_0x8a3b,0x9c));var _0xb8a3=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x8a3b[_0x37c22c];return _0x119d79;};'use strict';var emlformat=require(_0xb8a3('0x0'));var rimraf=require(_0xb8a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb8a3('0x2'));var moment=require(_0xb8a3('0x3'));var BPromise=require(_0xb8a3('0x4'));var Mustache=require(_0xb8a3('0x5'));var util=require('util');var path=require(_0xb8a3('0x6'));var sox=require(_0xb8a3('0x7'));var csv=require(_0xb8a3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8a3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb8a3('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb8a3('0x8'));var querystring=require('querystring');var Papa=require(_0xb8a3('0xb'));var Redis=require(_0xb8a3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb8a3('0xd'));var as=require(_0xb8a3('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a3('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb8a3('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf54db9,_0x652dff){_0x652dff=_0x652dff||0xcc;return function(_0x45d503){if(_0x45d503){return _0xf54db9[_0xb8a3('0x11')](_0x652dff);}return _0xf54db9[_0xb8a3('0x12')](_0x652dff)['end']();};}function respondWithResult(_0x38c4b7,_0xf2d0a5){_0xf2d0a5=_0xf2d0a5||0xc8;return function(_0x3324b8){if(_0x3324b8){return _0x38c4b7[_0xb8a3('0x12')](_0xf2d0a5)[_0xb8a3('0x13')](_0x3324b8);}};}function respondWithFilteredResult(_0x2b0902,_0x16612c){return function(_0x53a59c){if(_0x53a59c){var _0x45f89a=typeof _0x16612c[_0xb8a3('0x14')]===_0xb8a3('0x15')&&typeof _0x16612c[_0xb8a3('0x16')]==='undefined';var _0x4d4d1b=_0x53a59c[_0xb8a3('0x17')];var _0x3f57e4=_0x45f89a?0x0:_0x16612c['offset'];var _0x259480=_0x45f89a?_0x53a59c['count']:_0x16612c[_0xb8a3('0x14')]+_0x16612c['limit'];var _0x452dc1;if(_0x259480>=_0x4d4d1b){_0x259480=_0x4d4d1b;_0x452dc1=0xc8;}else{_0x452dc1=0xce;}_0x2b0902[_0xb8a3('0x12')](_0x452dc1);return _0x2b0902[_0xb8a3('0x18')](_0xb8a3('0x19'),_0x3f57e4+'-'+_0x259480+'/'+_0x4d4d1b)[_0xb8a3('0x13')](_0x53a59c);}return null;};}function patchUpdates(_0x1181e0){return function(_0x50a9bf){try{jsonpatch['apply'](_0x50a9bf,_0x1181e0,!![]);}catch(_0x2dd958){return BPromise[_0xb8a3('0x1a')](_0x2dd958);}return _0x50a9bf[_0xb8a3('0x1b')]();};}function saveUpdates(_0x4f1004,_0x488d0f){return function(_0xd6c63a){if(_0xd6c63a){return _0xd6c63a[_0xb8a3('0x1c')](_0x4f1004)[_0xb8a3('0x1d')](function(_0x31c695){return _0x31c695;});}return null;};}function removeEntity(_0x30ec43,_0x97e6c5){return function(_0x3c843a){if(_0x3c843a){return _0x3c843a[_0xb8a3('0x1e')]()[_0xb8a3('0x1d')](function(){_0x30ec43[_0xb8a3('0x12')](0xcc)[_0xb8a3('0x1f')]();});}};}function handleEntityNotFound(_0x59b017,_0x36d8f2){return function(_0x5303f7){if(!_0x5303f7){_0x59b017[_0xb8a3('0x11')](0x194);}return _0x5303f7;};}function handleError(_0x534632,_0x13921c){_0x13921c=_0x13921c||0x1f4;return function(_0x12a3de){logger[_0xb8a3('0x20')](_0x12a3de[_0xb8a3('0x21')]);if(_0x12a3de['name']){delete _0x12a3de[_0xb8a3('0x22')];}_0x534632[_0xb8a3('0x12')](_0x13921c)[_0xb8a3('0x23')](_0x12a3de);};}exports[_0xb8a3('0x24')]=function(_0x4fe95d,_0x573729){var _0x4334d0={},_0x35b7e5={},_0x4dd5b9={'count':0x0,'rows':[]};var _0x15a72c=_['map'](db['ChatTransferReport'][_0xb8a3('0x25')],function(_0x5dcddd){return{'name':_0x5dcddd[_0xb8a3('0x26')],'type':_0x5dcddd['type']['key']};});_0x35b7e5[_0xb8a3('0x27')]=_[_0xb8a3('0x28')](_0x15a72c,'name');_0x35b7e5['query']=_[_0xb8a3('0x29')](_0x4fe95d['query']);_0x35b7e5[_0xb8a3('0x2a')]=_[_0xb8a3('0x2b')](_0x35b7e5[_0xb8a3('0x27')],_0x35b7e5[_0xb8a3('0x2c')]);_0x4334d0[_0xb8a3('0x2d')]=_[_0xb8a3('0x2b')](_0x35b7e5[_0xb8a3('0x27')],qs[_0xb8a3('0x2e')](_0x4fe95d['query'][_0xb8a3('0x2e')]));_0x4334d0['attributes']=_0x4334d0[_0xb8a3('0x2d')][_0xb8a3('0x2f')]?_0x4334d0[_0xb8a3('0x2d')]:_0x35b7e5[_0xb8a3('0x27')];if(!_0x4fe95d[_0xb8a3('0x2c')][_0xb8a3('0x30')](_0xb8a3('0x31'))){_0x4334d0['limit']=qs[_0xb8a3('0x16')](_0x4fe95d['query'][_0xb8a3('0x16')]);_0x4334d0[_0xb8a3('0x14')]=qs[_0xb8a3('0x14')](_0x4fe95d[_0xb8a3('0x2c')]['offset']);}_0x4334d0[_0xb8a3('0x32')]=qs[_0xb8a3('0x33')](_0x4fe95d[_0xb8a3('0x2c')][_0xb8a3('0x33')]);_0x4334d0[_0xb8a3('0x34')]=qs['filters'](_[_0xb8a3('0x35')](_0x4fe95d[_0xb8a3('0x2c')],_0x35b7e5['filters']),_0x15a72c);if(_0x4fe95d[_0xb8a3('0x2c')][_0xb8a3('0x36')]){_0x4334d0[_0xb8a3('0x34')]=_[_0xb8a3('0x37')](_0x4334d0[_0xb8a3('0x34')],{'$or':_[_0xb8a3('0x28')](_0x15a72c,function(_0x1ccd23){if(_0x1ccd23[_0xb8a3('0x38')]!==_0xb8a3('0x39')){var _0x18f6c3={};_0x18f6c3[_0x1ccd23[_0xb8a3('0x22')]]={'$like':'%'+_0x4fe95d[_0xb8a3('0x2c')][_0xb8a3('0x36')]+'%'};return _0x18f6c3;}})});}_0x4334d0=_[_0xb8a3('0x37')]({},_0x4334d0,_0x4fe95d['options']);var _0x419365={'where':_0x4334d0[_0xb8a3('0x34')]};return db[_0xb8a3('0x3a')][_0xb8a3('0x17')](_0x419365)['then'](function(_0x2f3404){_0x4dd5b9['count']=_0x2f3404;if(_0x4fe95d['query'][_0xb8a3('0x3b')]){_0x4334d0[_0xb8a3('0x3c')]=[{'all':!![]}];}return db[_0xb8a3('0x3a')][_0xb8a3('0x3d')](_0x4334d0);})[_0xb8a3('0x1d')](function(_0xe5981d){_0x4dd5b9[_0xb8a3('0x3e')]=_0xe5981d;return _0x4dd5b9;})[_0xb8a3('0x1d')](respondWithFilteredResult(_0x573729,_0x4334d0))[_0xb8a3('0x3f')](handleError(_0x573729,null));};exports[_0xb8a3('0x40')]=function(_0x4b7bf0,_0x3cd148){var _0x58821e={'raw':!![],'where':{'id':_0x4b7bf0['params']['id']}},_0x2fe591={};_0x2fe591[_0xb8a3('0x27')]=_[_0xb8a3('0x29')](db[_0xb8a3('0x3a')][_0xb8a3('0x25')]);_0x2fe591[_0xb8a3('0x2c')]=_[_0xb8a3('0x29')](_0x4b7bf0[_0xb8a3('0x2c')]);_0x2fe591[_0xb8a3('0x2a')]=_[_0xb8a3('0x2b')](_0x2fe591[_0xb8a3('0x27')],_0x2fe591[_0xb8a3('0x2c')]);_0x58821e[_0xb8a3('0x2d')]=_[_0xb8a3('0x2b')](_0x2fe591[_0xb8a3('0x27')],qs['fields'](_0x4b7bf0['query'][_0xb8a3('0x2e')]));_0x58821e[_0xb8a3('0x2d')]=_0x58821e['attributes'][_0xb8a3('0x2f')]?_0x58821e[_0xb8a3('0x2d')]:_0x2fe591['model'];if(_0x4b7bf0[_0xb8a3('0x2c')][_0xb8a3('0x3b')]){_0x58821e[_0xb8a3('0x3c')]=[{'all':!![]}];}_0x58821e=_['merge']({},_0x58821e,_0x4b7bf0[_0xb8a3('0x41')]);return db[_0xb8a3('0x3a')]['find'](_0x58821e)['then'](handleEntityNotFound(_0x3cd148,null))[_0xb8a3('0x1d')](respondWithResult(_0x3cd148,null))['catch'](handleError(_0x3cd148,null));};exports['create']=function(_0x43126d,_0x352ca7){return db['ChatTransferReport'][_0xb8a3('0x42')](_0x43126d[_0xb8a3('0x43')],{})['then'](respondWithResult(_0x352ca7,0xc9))[_0xb8a3('0x3f')](handleError(_0x352ca7,null));};exports[_0xb8a3('0x1c')]=function(_0x5972f7,_0x2dc3d6){if(_0x5972f7[_0xb8a3('0x43')]['id']){delete _0x5972f7[_0xb8a3('0x43')]['id'];}return db[_0xb8a3('0x3a')][_0xb8a3('0x44')]({'where':{'id':_0x5972f7[_0xb8a3('0x45')]['id']}})[_0xb8a3('0x1d')](handleEntityNotFound(_0x2dc3d6,null))[_0xb8a3('0x1d')](saveUpdates(_0x5972f7[_0xb8a3('0x43')],null))[_0xb8a3('0x1d')](respondWithResult(_0x2dc3d6,null))[_0xb8a3('0x3f')](handleError(_0x2dc3d6,null));};exports['destroy']=function(_0x48e820,_0x2794d1){return db['ChatTransferReport']['find']({'where':{'id':_0x48e820['params']['id']}})[_0xb8a3('0x1d')](handleEntityNotFound(_0x2794d1,null))[_0xb8a3('0x1d')](removeEntity(_0x2794d1,null))[_0xb8a3('0x3f')](handleError(_0x2794d1,null));};exports[_0xb8a3('0x46')]=function(_0xff49f8,_0x30271b){return db[_0xb8a3('0x3a')][_0xb8a3('0x46')]()[_0xb8a3('0x1d')](respondWithResult(_0x30271b,null))[_0xb8a3('0x3f')](handleError(_0x30271b,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index ff6f53c..4b40d23 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 _0x4450=['uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x33fa7c,_0xc93c6a){var _0x53da7e=function(_0x33c922){while(--_0x33c922){_0x33fa7c['push'](_0x33fa7c['shift']());}};_0x53da7e(++_0xc93c6a);}(_0x4450,0x119));var _0x0445=function(_0x567af5,_0x12f560){_0x567af5=_0x567af5-0x0;var _0x18ecf4=_0x4450[_0x567af5];return _0x18ecf4;};'use strict';var _=require('lodash');var util=require(_0x0445('0x0'));var logger=require(_0x0445('0x1'))(_0x0445('0x2'));var moment=require(_0x0445('0x3'));var BPromise=require('bluebird');var rp=require(_0x0445('0x4'));var fs=require('fs');var path=require(_0x0445('0x5'));var rimraf=require(_0x0445('0x6'));var config=require(_0x0445('0x7'));var attributes=require(_0x0445('0x8'));module[_0x0445('0x9')]=function(_0x2fdabd,_0x2f4733){return _0x2fdabd[_0x0445('0xa')](_0x0445('0xb'),attributes,{'tableName':_0x0445('0xc'),'paranoid':![],'indexes':[{'name':_0x0445('0xd'),'fields':[_0x0445('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d7f=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x25a6a7,_0x1986cb){var _0x20cfd1=function(_0x520e35){while(--_0x520e35){_0x25a6a7['push'](_0x25a6a7['shift']());}};_0x20cfd1(++_0x1986cb);}(_0x8d7f,0x9a));var _0xf8d7=function(_0x1f4723,_0x36b8ff){_0x1f4723=_0x1f4723-0x0;var _0x530eb1=_0x8d7f[_0x1f4723];return _0x530eb1;};'use strict';var _=require(_0xf8d7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf8d7('0x1'));var BPromise=require(_0xf8d7('0x2'));var rp=require(_0xf8d7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf8d7('0x4'));var attributes=require('./chatTransferReport.attributes');module[_0xf8d7('0x5')]=function(_0x3b1e11,_0x5a761b){return _0x3b1e11[_0xf8d7('0x6')](_0xf8d7('0x7'),attributes,{'tableName':_0xf8d7('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf8d7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b42e499..0513d37 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 _0xe03e=['jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x28e4d6,_0x3084db){var _0x751d2e=function(_0x3e39d1){while(--_0x3e39d1){_0x28e4d6['push'](_0x28e4d6['shift']());}};_0x751d2e(++_0x3084db);}(_0xe03e,0x16d));var _0xee03=function(_0x2e6499,_0x468cd2){_0x2e6499=_0x2e6499-0x0;var _0xee830b=_0xe03e[_0x2e6499];return _0xee830b;};'use strict';var _=require(_0xee03('0x0'));var util=require(_0xee03('0x1'));var moment=require(_0xee03('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee03('0x3'));var db=require(_0xee03('0x4'))['db'];var utils=require(_0xee03('0x5'));var logger=require(_0xee03('0x6'))(_0xee03('0x7'));var config=require(_0xee03('0x8'));var jayson=require(_0xee03('0x9'));var client=jayson['client'][_0xee03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a082a,_0x8a99ad,_0x53197d){return new BPromise(function(_0x18cea1,_0x23df8c){return client[_0xee03('0xb')](_0x4a082a,_0x53197d)[_0xee03('0xc')](function(_0x25394b){logger[_0xee03('0xd')](_0xee03('0xe'),_0x8a99ad,_0xee03('0xf'));logger[_0xee03('0x10')](_0xee03('0x11'),_0x8a99ad,_0xee03('0xf'),JSON['stringify'](_0x25394b));if(_0x25394b['error']){if(_0x25394b[_0xee03('0x12')][_0xee03('0x13')]===0x1f4){logger[_0xee03('0x12')](_0xee03('0xe'),_0x8a99ad,_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);return _0x23df8c(_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);}logger[_0xee03('0x12')](_0xee03('0xe'),_0x8a99ad,_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);return _0x18cea1(_0x25394b[_0xee03('0x12')][_0xee03('0x14')]);}else{logger[_0xee03('0xd')](_0xee03('0xe'),_0x8a99ad,'request\x20sent');_0x18cea1(_0x25394b['result'][_0xee03('0x14')]);}})[_0xee03('0x15')](function(_0x4bf9df){logger[_0xee03('0x12')](_0xee03('0xe'),_0x8a99ad,_0x4bf9df);_0x23df8c(_0x4bf9df);});});} \ No newline at end of file +var _0xa7cc=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','lodash'];(function(_0x1935d2,_0x56905a){var _0x62f9a5=function(_0x4731ce){while(--_0x4731ce){_0x1935d2['push'](_0x1935d2['shift']());}};_0x62f9a5(++_0x56905a);}(_0xa7cc,0x117));var _0xca7c=function(_0xbf8673,_0x3c0a44){_0xbf8673=_0xbf8673-0x0;var _0x2e3921=_0xa7cc[_0xbf8673];return _0x2e3921;};'use strict';var _=require(_0xca7c('0x0'));var util=require(_0xca7c('0x1'));var moment=require('moment');var BPromise=require(_0xca7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca7c('0x3'));var db=require(_0xca7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xca7c('0x5'))(_0xca7c('0x6'));var config=require(_0xca7c('0x7'));var jayson=require(_0xca7c('0x8'));var client=jayson[_0xca7c('0x9')][_0xca7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e31f,_0x27e35e,_0x1ac0b3){return new BPromise(function(_0x1a39f2,_0x4955d5){return client[_0xca7c('0xb')](_0x52e31f,_0x1ac0b3)[_0xca7c('0xc')](function(_0x5be8fd){logger[_0xca7c('0xd')](_0xca7c('0xe'),_0x27e35e,_0xca7c('0xf'));logger[_0xca7c('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x27e35e,_0xca7c('0xf'),JSON[_0xca7c('0x11')](_0x5be8fd));if(_0x5be8fd[_0xca7c('0x12')]){if(_0x5be8fd['error']['code']===0x1f4){logger[_0xca7c('0x12')](_0xca7c('0xe'),_0x27e35e,_0x5be8fd[_0xca7c('0x12')][_0xca7c('0x13')]);return _0x4955d5(_0x5be8fd['error']['message']);}logger[_0xca7c('0x12')](_0xca7c('0xe'),_0x27e35e,_0x5be8fd[_0xca7c('0x12')][_0xca7c('0x13')]);return _0x1a39f2(_0x5be8fd[_0xca7c('0x12')]['message']);}else{logger[_0xca7c('0xd')](_0xca7c('0xe'),_0x27e35e,'request\x20sent');_0x1a39f2(_0x5be8fd['result'][_0xca7c('0x13')]);}})['catch'](function(_0xdd5460){logger[_0xca7c('0x12')](_0xca7c('0xe'),_0x27e35e,_0xdd5460);_0x4955d5(_0xdd5460);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 957e4da..f74ba9d 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 _0xad8c=['show','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5b84d9,_0x450c7e){var _0x1dbeb8=function(_0x5a404d){while(--_0x5a404d){_0x5b84d9['push'](_0x5b84d9['shift']());}};_0x1dbeb8(++_0x450c7e);}(_0xad8c,0x110));var _0xcad8=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0xad8c[_0x2bf888];return _0x3038d6;};'use strict';var multer=require('multer');var util=require(_0xcad8('0x0'));var path=require(_0xcad8('0x1'));var timeout=require(_0xcad8('0x2'));var express=require(_0xcad8('0x3'));var router=express['Router']();var fs_extra=require(_0xcad8('0x4'));var auth=require(_0xcad8('0x5'));var interaction=require(_0xcad8('0x6'));var config=require(_0xcad8('0x7'));var controller=require(_0xcad8('0x8'));router[_0xcad8('0x9')]('/',auth[_0xcad8('0xa')](),controller[_0xcad8('0xb')]);router['get'](_0xcad8('0xc'),auth[_0xcad8('0xa')](),controller[_0xcad8('0xd')]);router[_0xcad8('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcad8('0xe')]);router[_0xcad8('0xf')]('/',auth[_0xcad8('0xa')](),controller[_0xcad8('0x10')]);router[_0xcad8('0x11')](_0xcad8('0x12'),auth[_0xcad8('0xa')](),controller[_0xcad8('0x13')]);router['delete'](_0xcad8('0x12'),auth[_0xcad8('0xa')](),controller[_0xcad8('0x14')]);module[_0xcad8('0x15')]=router; \ No newline at end of file +var _0x2300=['destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete'];(function(_0x5a96ef,_0x3d30a3){var _0x501c2d=function(_0x1735b6){while(--_0x1735b6){_0x5a96ef['push'](_0x5a96ef['shift']());}};_0x501c2d(++_0x3d30a3);}(_0x2300,0xd4));var _0x0230=function(_0x1fd804,_0x1ad0b6){_0x1fd804=_0x1fd804-0x0;var _0x2df181=_0x2300[_0x1fd804];return _0x2df181;};'use strict';var multer=require('multer');var util=require(_0x0230('0x0'));var path=require(_0x0230('0x1'));var timeout=require('connect-timeout');var express=require(_0x0230('0x2'));var router=express[_0x0230('0x3')]();var fs_extra=require(_0x0230('0x4'));var auth=require(_0x0230('0x5'));var interaction=require(_0x0230('0x6'));var config=require(_0x0230('0x7'));var controller=require(_0x0230('0x8'));router[_0x0230('0x9')]('/',auth[_0x0230('0xa')](),controller[_0x0230('0xb')]);router[_0x0230('0x9')](_0x0230('0xc'),auth['isAuthenticated'](),controller[_0x0230('0xd')]);router[_0x0230('0x9')](_0x0230('0xe'),auth[_0x0230('0xa')](),controller[_0x0230('0xf')]);router['post']('/',auth[_0x0230('0xa')](),controller[_0x0230('0x10')]);router['put'](_0x0230('0xe'),auth[_0x0230('0xa')](),controller[_0x0230('0x11')]);router[_0x0230('0x12')](_0x0230('0xe'),auth[_0x0230('0xa')](),controller[_0x0230('0x13')]);module[_0x0230('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 526bde0..344f795 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 _0x9233=['bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x9233,0xd1));var _0x3923=function(_0xd81b7d,_0x3561e0){_0xd81b7d=_0xd81b7d-0x0;var _0x3358a1=_0x9233[_0xd81b7d];return _0x3358a1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x3923('0x0'));module[_0x3923('0x1')]={'name':{'type':Sequelize[_0x3923('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x3923('0x2')],'allowNull':![],'unique':_0x3923('0x3')},'description':{'type':Sequelize[_0x3923('0x2')]},'mapKey':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x4')},'key':{'type':Sequelize[_0x3923('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3923('0x2')],'allowNull':![],'defaultValue':_0x3923('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3923('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3923('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3923('0x2')]},'animation':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3923('0x9')](_0x3923('0xa'),'squared'),'defaultValue':_0x3923('0xa')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0xb')},'start_chat_button':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0xd')},'header_offline':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3923('0xf')]},'closingQuestion':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0x12')},'placeholderMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x13')},'closingMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x14')},'closingMessageButton':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xd')},'skipMessageButton':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x15')},'ratingType':{'type':Sequelize[_0x3923('0x9')]('star',_0x3923('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3923('0x17')]({'items':[{'type':_0x3923('0x18'),'variable':null,'config':{'placeholder':_0x3923('0x19'),'type':_0x3923('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x3923('0x18'),'props':{'title':_0x3923('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3923('0x4'),'type':_0x3923('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3923('0x1b')](_0x3923('0x1c'))?JSON[_0x3923('0x1d')](this[_0x3923('0x1b')](_0x3923('0x1c'))):{};},'set':function(_0x45a4d8){return this[_0x3923('0x1e')](_0x3923('0x1c'),JSON['stringify'](_0x45a4d8));}},'offlineForm':{'type':Sequelize[_0x3923('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3923('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3923('0x4')},'variable':null},{'type':_0x3923('0x1f'),'config':{'placeholder':_0x3923('0x20')},'props':{'title':_0x3923('0x20'),'helpText':_0x3923('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x3923('0x1b')](_0x3923('0x22'))?JSON[_0x3923('0x1d')](this[_0x3923('0x1b')](_0x3923('0x22'))):{};},'set':function(_0x5dba75){return this[_0x3923('0x1e')](_0x3923('0x22'),JSON[_0x3923('0x17')](_0x5dba75));}},'token':{'type':Sequelize[_0x3923('0x2')],'defaultValue':function(){return rs[_0x3923('0x23')]();}},'autoclose':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3923('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3923('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x3923('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x26')},'skipUnmanaged':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x27')},'sendUnmanaged':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3923('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3923('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3923('0xf')],'defaultValue':function(){return _0x3923('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3923('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x29')},'verticalAlignment':{'type':Sequelize[_0x3923('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x2a')},'messagesAlignment':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x3923('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3923('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3923('0x2')],'allowNull':![],'defaultValue':_0x3923('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3923('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3923('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3923('0x2')],'defaultValue':_0x3923('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3923('0x7')],'comment':_0x3923('0x2e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xfa8389){if(!_0xfa8389)this[_0x3923('0x1e')](_0x3923('0x2f'),null);this[_0x3923('0x1e')](_0x3923('0x30'),_0xfa8389);}},'vidaooEscalation':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3923('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3923('0x2')],'defaultValue':function(){return _0x3923('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x3923('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3923('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3923('0xf')]}}; \ No newline at end of file +var _0xcb34=['name','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','setDataValue','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','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','exports','STRING','email','#011F6A','#ffffff','INTEGER','ENUM','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','thumb','star','stringify','input'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xcb34,0xa7));var _0x4cb3=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xcb34[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require(_0x4cb3('0x0'));var rs=require(_0x4cb3('0x1'));module[_0x4cb3('0x2')]={'name':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x4')},'mapKeyOffline':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x4')},'key':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![],'defaultValue':_0x4cb3('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![],'defaultValue':_0x4cb3('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4cb3('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![],'defaultValue':_0x4cb3('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x4cb3('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4cb3('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x4cb3('0x8')]('rounded',_0x4cb3('0x9')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x4cb3('0xa')},'start_chat_button':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0xc')},'download_transcript':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x4cb3('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4cb3('0xf')]},'closingQuestion':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x12')},'closingMessage':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x4cb3('0x14')},'skipMessageButton':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x4cb3('0x8')]('star',_0x4cb3('0x15')),'defaultValue':_0x4cb3('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x4cb3('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x4cb3('0x17')]({'items':[{'type':_0x4cb3('0x18'),'variable':null,'config':{'placeholder':_0x4cb3('0x19'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x4cb3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4cb3('0x4'),'type':_0x4cb3('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x4cb3('0x1a')](_0x4cb3('0x1b'))?JSON['parse'](this[_0x4cb3('0x1a')](_0x4cb3('0x1b'))):{};},'set':function(_0x1a0f21){return this['setDataValue']('onlineForm',JSON[_0x4cb3('0x17')](_0x1a0f21));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x4cb3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4cb3('0x4'),'type':_0x4cb3('0x4')},'variable':null},{'type':_0x4cb3('0x1c'),'config':{'placeholder':_0x4cb3('0x1d')},'props':{'title':'Comments','helpText':_0x4cb3('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x4cb3('0x1a')]('offlineForm')?JSON[_0x4cb3('0x1f')](this[_0x4cb3('0x1a')](_0x4cb3('0x20'))):{};},'set':function(_0xa0595a){return this[_0x4cb3('0x21')](_0x4cb3('0x20'),JSON['stringify'](_0xa0595a));}},'token':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4cb3('0x3')]},'forwardOffline':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x4cb3('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x4cb3('0x22')},'waitingMessage':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x4cb3('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x25')},'sendUnmanaged':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x4cb3('0xf')],'defaultValue':function(){return _0x4cb3('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4cb3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x29')},'defaultTitle':{'type':Sequelize[_0x4cb3('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![],'defaultValue':_0x4cb3('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4cb3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4cb3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':_0x4cb3('0x2b')},'systemAvatar':{'type':Sequelize[_0x4cb3('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4cb3('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![],'comment':_0x4cb3('0x2c'),'set':function(_0x1eb7ab){if(!_0x1eb7ab)this['setDataValue'](_0x4cb3('0x2d'),null);this['setDataValue']('mandatoryDisposition',_0x1eb7ab);}},'vidaooEscalation':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x4cb3('0x3')]},'vidaooTopic':{'type':Sequelize[_0x4cb3('0x3')],'allowNull':![],'defaultValue':_0x4cb3('0x2e')},'vidaooNote':{'type':Sequelize[_0x4cb3('0x3')],'defaultValue':function(){return _0x4cb3('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x4cb3('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x4cb3('0xd')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x4cb3('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index d6a1fe5..ff7913a 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 _0x6da1=['ValidationError','no\x20available\x20attributes','createdAt','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','interval','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','ifTime','readFileSync','server/files/chat/iframe.ejs','3.9.0','origin','replace','x-real-ip','connection','remoteAddress','verticalAlignment','textColor','textButtonColor','backgroundColor','addApplications','sequelize','Transaction','findAndCountAll','stack','finally','getApplications','chatProactiveAction','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','User','util','path','ejs','querystring','html-to-text','ioredis','../../components/parsers/qs','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','URL','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','http','client','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','customerIp','cf-connecting-ip','x-forwarded-for','split','lastName','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','type','stringify','Pause','mandatoryDispositionPause','map','ChatWebsite','key','query','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','filter','include','rows','show','params','keys','intersection','length','includeAll','find','create','body','address','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','testWildcardValidity','describe','ChatWebsiteId','getDispositions','findOne','Disposition','rawAttributes','nolimit','options','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','isNil','server/files/images/logos/','download','existsSync','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','timezone','chat','from','From\x20is\x20mandatory','mapKey','isEmpty','CmContact','No\x20available\x20attributes','updatedAt','CompanyId','ListId','includes','List','DESC','ChatApplication','Applications','Interval','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','Contacts','defaults','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify'];(function(_0x5d26d1,_0x1d8e4b){var _0x2d5c7e=function(_0x26a55c){while(--_0x26a55c){_0x5d26d1['push'](_0x5d26d1['shift']());}};_0x2d5c7e(++_0x1d8e4b);}(_0x6da1,0x18d));var _0x16da=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0x6da1[_0x15af0f];return _0x2bd1cb;};'use strict';var Mustache=require('mustache');var util=require(_0x16da('0x0'));var path=require(_0x16da('0x1'));var ejs=require(_0x16da('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x16da('0x3'));var htmlToText=require(_0x16da('0x4'));var Redis=require(_0x16da('0x5'));var jayson=require('jayson/promise');var qs=require(_0x16da('0x6'));var logger=require('../../config/logger')('api');var config=require(_0x16da('0x7'));var APIBadRequestError=require(_0x16da('0x8'))['APIBadRequestError'];var APINotFoundError=require(_0x16da('0x8'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x16da('0x8'))[_0x16da('0x9')];var APIHandleError=require(_0x16da('0x8'))[_0x16da('0xa')];var APIConflictError=require(_0x16da('0x8'))[_0x16da('0xb')];var wildcardUtils=require(_0x16da('0xc'));var URL=require('url')[_0x16da('0xd')];var db=require(_0x16da('0xe'))['db'];config[_0x16da('0xf')]=_['defaults'](config['redis'],{'host':_0x16da('0x10'),'port':0x18eb});var socket=require(_0x16da('0x11'))(new Redis(config[_0x16da('0xf')]));require(_0x16da('0x12'))[_0x16da('0x13')](socket);var client=jayson['client'][_0x16da('0x14')]({'port':0x232c});var client9002=jayson[_0x16da('0x15')][_0x16da('0x14')]({'port':0x232a});var client9003=jayson[_0x16da('0x15')]['http']({'port':0x232b});var client9001=jayson[_0x16da('0x15')][_0x16da('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x41fed9,_0x377865,_0xc739b0,_0x39ca3a){return new Promise(function(_0x4759cd,_0xd12eca){var _0x400394=_0x39ca3a||client;return _0x400394['request'](_0x41fed9,_0xc739b0)[_0x16da('0x16')](function(_0x5d957e){logger[_0x16da('0x17')](_0x16da('0x18'),_0x377865,_0x16da('0x19'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x377865,_0x16da('0x19'),JSON['stringify'](_0x5d957e));if(_0x5d957e[_0x16da('0x1a')]){if(_0x5d957e[_0x16da('0x1a')][_0x16da('0x1b')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x377865,_0x5d957e[_0x16da('0x1a')][_0x16da('0x1c')]);return _0xd12eca(_0x5d957e[_0x16da('0x1a')][_0x16da('0x1c')]);}logger[_0x16da('0x1a')](_0x16da('0x18'),_0x377865,_0x5d957e['error'][_0x16da('0x1c')]);return _0x4759cd(_0x5d957e[_0x16da('0x1a')][_0x16da('0x1c')]);}else{logger[_0x16da('0x17')](_0x16da('0x18'),_0x377865,_0x16da('0x19'));_0x4759cd(_0x5d957e[_0x16da('0x1d')][_0x16da('0x1c')]);}})[_0x16da('0x1e')](function(_0x3a4e75){logger['error'](_0x16da('0x18'),_0x377865,_0x3a4e75);_0xd12eca(_0x3a4e75);});});}function respondWithStatusCode(_0xb4cad4,_0xfe2ba4){_0xfe2ba4=_0xfe2ba4||0xcc;return function(_0x303969){if(_0x303969){return _0xb4cad4[_0x16da('0x1f')](_0xfe2ba4);}return _0xb4cad4[_0x16da('0x20')](_0xfe2ba4)[_0x16da('0x21')]();};}function respondWithResult(_0x42c688,_0x2065e4){_0x2065e4=_0x2065e4||0xc8;return function(_0x43ef9f){if(_0x43ef9f){return _0x42c688['status'](_0x2065e4)[_0x16da('0x22')](_0x43ef9f);}};}function respondWithFilteredResult(_0x3bd516,_0xa0806a){return function(_0x2c14cf){if(_0x2c14cf){var _0x3168c9=typeof _0xa0806a[_0x16da('0x23')]===_0x16da('0x24')&&typeof _0xa0806a['limit']===_0x16da('0x24');var _0x20c6a1=_0x2c14cf[_0x16da('0x25')];var _0x146366=_0x3168c9?0x0:_0xa0806a[_0x16da('0x23')];var _0x57d32b=_0x3168c9?_0x2c14cf['count']:_0xa0806a[_0x16da('0x23')]+_0xa0806a[_0x16da('0x26')];var _0x2371a7;if(_0x57d32b>=_0x20c6a1){_0x57d32b=_0x20c6a1;_0x2371a7=0xc8;}else{_0x2371a7=0xce;}_0x3bd516[_0x16da('0x20')](_0x2371a7);return _0x3bd516[_0x16da('0x27')](_0x16da('0x28'),_0x146366+'-'+_0x57d32b+'/'+_0x20c6a1)[_0x16da('0x22')](_0x2c14cf);}return null;};}function saveUpdates(_0x1d8cd7){return function(_0x5dd0df){if(_0x5dd0df){return _0x5dd0df[_0x16da('0x29')](_0x1d8cd7)[_0x16da('0x16')](function(_0x3439b7){return _0x3439b7;});}return null;};}function removeEntity(_0x28f2ae){return function(_0x7d0c61){if(_0x7d0c61){return _0x7d0c61[_0x16da('0x2a')]()[_0x16da('0x16')](function(){var _0x596bde=_0x7d0c61[_0x16da('0x2b')]({'plain':!![]});var _0xff33c1=_0x16da('0x2c');return db[_0x16da('0x2d')]['destroy']({'where':{'type':_0xff33c1,'resourceId':_0x596bde['id']}})['then'](function(){return _0x7d0c61;});})[_0x16da('0x16')](function(){_0x28f2ae[_0x16da('0x20')](0xcc)[_0x16da('0x21')]();});}};}function handleEntityNotFound(_0x5eb29e){return function(_0x1d8e8a){if(!_0x1d8e8a){_0x5eb29e[_0x16da('0x1f')](0x194);}return _0x1d8e8a;};}function handleError(_0x5b23fc,_0x4dc9cf){_0x4dc9cf=_0x4dc9cf||0x1f4;return function(_0x4e1579){logger[_0x16da('0x1a')](_0x4e1579['stack']);if(_0x4e1579['name']){delete _0x4e1579[_0x16da('0x2e')];}_0x5b23fc[_0x16da('0x20')](_0x4dc9cf)[_0x16da('0x2f')](_0x4e1579);};}function createInteractionObject(_0xc0a2eb,_0x88bfb4,_0x477c69,_0x305717){var _0x38f32e=require(_0x16da('0x30'));var _0x35118c=new _0x38f32e();var _0x480afb=_0x35118c[_0x16da('0x31')](_0x477c69['user-agent'])['getResult']();var _0x20bd1f=_0x88bfb4[_0x16da('0x32')];if(_0x477c69[_0x16da('0x33')]){_0x20bd1f=_0x477c69['cf-connecting-ip'];}else if(_0x477c69[_0x16da('0x34')]){_0x20bd1f=_['first'](_0x477c69[_0x16da('0x34')][_0x16da('0x35')](','));}return{'ContactId':_0x305717['id'],'ChatWebsiteId':_0xc0a2eb,'from':(_0x305717['firstName']||'')+'\x20'+(_0x305717[_0x16da('0x36')]||''),'customerIp':_0x20bd1f,'customerPort':_0x477c69['x-real-port']?_0x477c69['x-real-port']:null,'referer':_0x88bfb4[_0x16da('0x37')],'browserName':_0x480afb['browser'][_0x16da('0x2e')]&&_0x480afb[_0x16da('0x38')][_0x16da('0x39')]?util[_0x16da('0x3a')](_0x16da('0x3b'),_0x480afb[_0x16da('0x38')]['name'],_0x480afb[_0x16da('0x38')]['version']):_0x16da('0x3c'),'browserVersion':_0x480afb['browser'][_0x16da('0x39')]||_0x16da('0x3c'),'osName':util['format'](_0x16da('0x3b'),_0x480afb['os'][_0x16da('0x2e')],_0x480afb['os'][_0x16da('0x39')]),'osVersion':_0x480afb['os']['version'],'deviceModel':_0x480afb[_0x16da('0x3d')]['model']&&_0x480afb[_0x16da('0x3d')]['vendor']?util[_0x16da('0x3a')]('%s\x20%s\x20%s',_0x480afb[_0x16da('0x3d')][_0x16da('0x3e')],_0x480afb[_0x16da('0x3d')][_0x16da('0x3f')],_0x480afb[_0x16da('0x3d')][_0x16da('0x40')]):null,'deviceVendor':_0x480afb['device'][_0x16da('0x3f')],'deviceType':_0x480afb[_0x16da('0x3d')][_0x16da('0x40')],'formData':JSON[_0x16da('0x41')](_0x88bfb4)};}exports['index']=function(_0x19c8f4,_0x39fe72){var _0x277202={'include':[{'model':db[_0x16da('0x42')],'as':_0x16da('0x43')}]},_0x163118={},_0x1eb8b9={'count':0x0,'rows':[]};var _0x248b7a=_[_0x16da('0x44')](db[_0x16da('0x45')]['rawAttributes'],function(_0x342c4a){return{'name':_0x342c4a['fieldName'],'type':_0x342c4a['type'][_0x16da('0x46')]};});_0x163118['model']=_[_0x16da('0x44')](_0x248b7a,'name');_0x163118[_0x16da('0x47')]=_['keys'](_0x19c8f4[_0x16da('0x47')]);_0x163118[_0x16da('0x48')]=_['intersection'](_0x163118['model'],_0x163118[_0x16da('0x47')]);_0x277202[_0x16da('0x49')]=_['intersection'](_0x163118['model'],qs['fields'](_0x19c8f4[_0x16da('0x47')][_0x16da('0x4a')]));_0x277202[_0x16da('0x49')]=_0x277202[_0x16da('0x49')]['length']?_0x277202[_0x16da('0x49')]:_0x163118[_0x16da('0x3e')];if(!_0x19c8f4[_0x16da('0x47')][_0x16da('0x4b')]('nolimit')){_0x277202[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x19c8f4[_0x16da('0x47')]['limit']);_0x277202[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x19c8f4[_0x16da('0x47')][_0x16da('0x23')]);}_0x277202[_0x16da('0x4c')]=qs[_0x16da('0x4d')](_0x19c8f4[_0x16da('0x47')][_0x16da('0x4d')]);_0x277202[_0x16da('0x4e')]=qs['filters'](_[_0x16da('0x4f')](_0x19c8f4[_0x16da('0x47')],_0x163118[_0x16da('0x48')]),_0x248b7a);if(_0x19c8f4[_0x16da('0x47')]['filter']){_0x277202['where']=_[_0x16da('0x50')](_0x277202[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x248b7a,function(_0x243f24){if(_0x243f24[_0x16da('0x40')]!=='VIRTUAL'){var _0x4bc72b={};_0x4bc72b[_0x243f24[_0x16da('0x2e')]]={'$like':'%'+_0x19c8f4['query'][_0x16da('0x51')]+'%'};return _0x4bc72b;}})});}_0x277202=_[_0x16da('0x50')]({},_0x277202,_0x19c8f4['options']);var _0x1de632={'where':_0x277202[_0x16da('0x4e')]};return db[_0x16da('0x45')][_0x16da('0x25')](_0x1de632)[_0x16da('0x16')](function(_0x45b4ae){_0x1eb8b9[_0x16da('0x25')]=_0x45b4ae;if(_0x19c8f4[_0x16da('0x47')]['includeAll']){_0x277202[_0x16da('0x52')]=[{'all':!![]}];}return db[_0x16da('0x45')]['findAll'](_0x277202);})['then'](function(_0x4bd52f){_0x1eb8b9[_0x16da('0x53')]=_0x4bd52f;return _0x1eb8b9;})[_0x16da('0x16')](respondWithFilteredResult(_0x39fe72,_0x277202))['catch'](handleError(_0x39fe72,null));};exports[_0x16da('0x54')]=function(_0x343ef1,_0x1bcaee){var _0x2a69a8={'raw':![],'where':{'id':_0x343ef1[_0x16da('0x55')]['id']},'include':[{'model':db[_0x16da('0x42')],'as':_0x16da('0x43')}]},_0x1a36ec={};_0x1a36ec['model']=_[_0x16da('0x56')](db[_0x16da('0x45')]['rawAttributes']);_0x1a36ec['query']=_[_0x16da('0x56')](_0x343ef1[_0x16da('0x47')]);_0x1a36ec[_0x16da('0x48')]=_[_0x16da('0x57')](_0x1a36ec[_0x16da('0x3e')],_0x1a36ec[_0x16da('0x47')]);_0x2a69a8['attributes']=_[_0x16da('0x57')](_0x1a36ec['model'],qs[_0x16da('0x4a')](_0x343ef1[_0x16da('0x47')][_0x16da('0x4a')]));_0x2a69a8[_0x16da('0x49')]=_0x2a69a8['attributes'][_0x16da('0x58')]?_0x2a69a8[_0x16da('0x49')]:_0x1a36ec[_0x16da('0x3e')];if(_0x343ef1['query'][_0x16da('0x59')]){_0x2a69a8[_0x16da('0x52')]=[{'all':!![]}];}_0x2a69a8=_['merge']({},_0x2a69a8,_0x343ef1['options']);return db['ChatWebsite'][_0x16da('0x5a')](_0x2a69a8)[_0x16da('0x16')](handleEntityNotFound(_0x1bcaee,null))[_0x16da('0x16')](respondWithResult(_0x1bcaee,null))[_0x16da('0x1e')](handleError(_0x1bcaee,null));};exports[_0x16da('0x5b')]=function(_0x1d913b,_0x29579e){if(!wildcardUtils['testWildcardValidity'](_0x1d913b[_0x16da('0x5c')][_0x16da('0x5d')])){return handleError(_0x29579e,null)(new APIBadRequestError('\x22'+_0x1d913b['body'][_0x16da('0x5d')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}return db[_0x16da('0x45')][_0x16da('0x5b')](_0x1d913b[_0x16da('0x5c')],{})[_0x16da('0x16')](function(_0x45a782){var _0xa21751=_0x1d913b[_0x16da('0x5e')][_0x16da('0x2b')]({'plain':!![]});if(!_0xa21751)throw new Error(_0x16da('0x5f'));if(_0xa21751[_0x16da('0x60')]==='user'){var _0x3de327=_0x45a782['get']({'plain':!![]});var _0x49194f='ChatWebsites';return db['UserProfileSection'][_0x16da('0x5a')]({'where':{'name':_0x49194f,'userProfileId':_0xa21751[_0x16da('0x61')]},'raw':!![]})['then'](function(_0x54369e){if(_0x54369e&&_0x54369e[_0x16da('0x62')]===0x0){return db['UserProfileResource'][_0x16da('0x5b')]({'name':_0x3de327[_0x16da('0x2e')],'resourceId':_0x3de327['id'],'type':_0x54369e[_0x16da('0x2e')],'sectionId':_0x54369e['id']},{})['then'](function(){return _0x45a782;});}else{return _0x45a782;}})[_0x16da('0x1e')](function(_0x2945c5){logger[_0x16da('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2945c5);throw _0x2945c5;});}return _0x45a782;})[_0x16da('0x16')](respondWithResult(_0x29579e,0xc9))[_0x16da('0x1e')](handleError(_0x29579e,null));};exports[_0x16da('0x29')]=function(_0x20039b,_0x48310e){if(!wildcardUtils[_0x16da('0x63')](_0x20039b[_0x16da('0x5c')][_0x16da('0x5d')])){return handleError(_0x48310e,null)(new APIBadRequestError('\x22'+_0x20039b[_0x16da('0x5c')][_0x16da('0x5d')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x20039b[_0x16da('0x5c')]['id']){delete _0x20039b[_0x16da('0x5c')]['id'];}return db[_0x16da('0x45')]['find']({'where':{'id':_0x20039b['params']['id']},'include':[{'model':db[_0x16da('0x42')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x48310e,null))[_0x16da('0x16')](saveUpdates(_0x20039b[_0x16da('0x5c')],null))[_0x16da('0x16')](respondWithResult(_0x48310e,null))['catch'](handleError(_0x48310e,null));};exports[_0x16da('0x2a')]=function(_0x2ff3a6,_0x48c715){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x2ff3a6[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x48c715,null))[_0x16da('0x16')](removeEntity(_0x48c715,null))[_0x16da('0x1e')](handleError(_0x48c715,null));};exports[_0x16da('0x64')]=function(_0x5907c1,_0x3ac739){return db[_0x16da('0x45')][_0x16da('0x64')]()[_0x16da('0x16')](respondWithResult(_0x3ac739,null))[_0x16da('0x1e')](handleError(_0x3ac739,null));};exports['addDisposition']=function(_0x1c2954,_0x5eeebc){if(_0x1c2954[_0x16da('0x5c')]['id']){delete _0x1c2954[_0x16da('0x5c')]['id'];}return db[_0x16da('0x45')]['find']({'where':{'id':_0x1c2954['params']['id']}})['then'](handleEntityNotFound(_0x5eeebc,null))['then'](function(_0x3bff64){if(_0x3bff64){_0x1c2954['body'][_0x16da('0x65')]=_0x3bff64['id'];return db['Disposition'][_0x16da('0x5b')](_0x1c2954[_0x16da('0x5c')]);}})[_0x16da('0x16')](respondWithResult(_0x5eeebc,null))[_0x16da('0x1e')](handleError(_0x5eeebc,null));};exports[_0x16da('0x66')]=function(_0x341a82,_0x5d45e8){var _0x432b9a={'raw':![],'where':{}};var _0x1f3463={};var _0x371070={'count':0x0,'rows':[]};return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x341a82[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5d45e8,null))[_0x16da('0x16')](function(_0x3d67c5){if(_0x3d67c5){_0x1f3463['model']=_[_0x16da('0x56')](db[_0x16da('0x68')][_0x16da('0x69')]);_0x1f3463[_0x16da('0x47')]=_[_0x16da('0x56')](_0x341a82['query']);_0x1f3463[_0x16da('0x48')]=_['intersection'](_0x1f3463[_0x16da('0x3e')],_0x1f3463[_0x16da('0x47')]);_0x432b9a[_0x16da('0x49')]=_['intersection'](_0x1f3463[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x341a82[_0x16da('0x47')][_0x16da('0x4a')]));_0x432b9a[_0x16da('0x49')]=_0x432b9a[_0x16da('0x49')][_0x16da('0x58')]?_0x432b9a[_0x16da('0x49')]:_0x1f3463[_0x16da('0x3e')];if(!_0x341a82[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x432b9a[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x341a82['query'][_0x16da('0x26')]);_0x432b9a[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x341a82[_0x16da('0x47')]['offset']);}_0x432b9a[_0x16da('0x4c')]=qs[_0x16da('0x4d')](_0x341a82[_0x16da('0x47')][_0x16da('0x4d')]);_0x432b9a[_0x16da('0x4e')]=qs[_0x16da('0x48')](_['pick'](_0x341a82[_0x16da('0x47')],_0x1f3463[_0x16da('0x48')]));_0x432b9a[_0x16da('0x4e')][_0x16da('0x65')]=_0x3d67c5['id'];if(_0x341a82[_0x16da('0x47')][_0x16da('0x51')]){_0x432b9a[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x432b9a['where'],{'$or':_['map'](_0x432b9a[_0x16da('0x49')],function(_0x3e88df){var _0x2e1aa4={};_0x2e1aa4[_0x3e88df]={'$like':'%'+_0x341a82[_0x16da('0x47')][_0x16da('0x51')]+'%'};return _0x2e1aa4;})});}_0x432b9a=_[_0x16da('0x50')]({},_0x432b9a,_0x341a82[_0x16da('0x6b')]);return db[_0x16da('0x68')][_0x16da('0x25')]({'where':_0x432b9a['where']})[_0x16da('0x16')](function(_0x43c9f3){_0x371070[_0x16da('0x25')]=_0x43c9f3;if(_0x341a82['query'][_0x16da('0x59')]){_0x432b9a[_0x16da('0x52')]=[{'all':!![]}];}return db[_0x16da('0x68')]['findAll'](_0x432b9a);})[_0x16da('0x16')](function(_0x39c53d){_0x371070['rows']=_0x39c53d;return _0x371070;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x5d45e8,_0x432b9a))['catch'](handleError(_0x5d45e8,null));};exports[_0x16da('0x6c')]=function(_0x4ba7ed,_0x1ee568){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x4ba7ed['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x1ee568,null))[_0x16da('0x16')](function(_0x654cd0){if(_0x654cd0){return _0x654cd0['removeDispositions'](_0x4ba7ed[_0x16da('0x47')][_0x16da('0x6d')]);}})['then'](respondWithStatusCode(_0x1ee568,null))[_0x16da('0x1e')](handleError(_0x1ee568,null));};exports[_0x16da('0x6e')]=function(_0x2e442b,_0x5e91cf){if(_0x2e442b[_0x16da('0x5c')]['id']){delete _0x2e442b['body']['id'];}return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x2e442b[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5e91cf,null))[_0x16da('0x16')](function(_0x1a114c){if(_0x1a114c){_0x2e442b['body'][_0x16da('0x65')]=_0x1a114c['id'];return db['CannedAnswer']['create'](_0x2e442b[_0x16da('0x5c')]);}})[_0x16da('0x16')](respondWithResult(_0x5e91cf,null))['catch'](handleError(_0x5e91cf,null));};exports[_0x16da('0x6f')]=function(_0x2f63d2,_0x4d7fb7){var _0x3a6dad={'raw':![],'where':{}};var _0x518341={};var _0x1d4d6d={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2f63d2['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x4d7fb7,null))[_0x16da('0x16')](function(_0x218b21){if(_0x218b21){_0x518341[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0x70')][_0x16da('0x69')]);_0x518341[_0x16da('0x47')]=_[_0x16da('0x56')](_0x2f63d2[_0x16da('0x47')]);_0x518341[_0x16da('0x48')]=_[_0x16da('0x57')](_0x518341[_0x16da('0x3e')],_0x518341['query']);_0x3a6dad[_0x16da('0x49')]=_[_0x16da('0x57')](_0x518341[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x2f63d2[_0x16da('0x47')][_0x16da('0x4a')]));_0x3a6dad[_0x16da('0x49')]=_0x3a6dad[_0x16da('0x49')]['length']?_0x3a6dad['attributes']:_0x518341['model'];if(!_0x2f63d2[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x3a6dad['limit']=qs[_0x16da('0x26')](_0x2f63d2[_0x16da('0x47')][_0x16da('0x26')]);_0x3a6dad[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x2f63d2[_0x16da('0x47')][_0x16da('0x23')]);}_0x3a6dad[_0x16da('0x4c')]=qs['sort'](_0x2f63d2[_0x16da('0x47')][_0x16da('0x4d')]);_0x3a6dad[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x2f63d2[_0x16da('0x47')],_0x518341[_0x16da('0x48')]));_0x3a6dad[_0x16da('0x4e')][_0x16da('0x65')]=_0x218b21['id'];if(_0x2f63d2[_0x16da('0x47')][_0x16da('0x51')]){_0x3a6dad[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x3a6dad[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x3a6dad[_0x16da('0x49')],function(_0x2e22d7){var _0x81f112={};_0x81f112[_0x2e22d7]={'$like':'%'+_0x2f63d2['query'][_0x16da('0x51')]+'%'};return _0x81f112;})});}_0x3a6dad=_[_0x16da('0x50')]({},_0x3a6dad,_0x2f63d2[_0x16da('0x6b')]);return db[_0x16da('0x70')][_0x16da('0x25')]({'where':_0x3a6dad[_0x16da('0x4e')]})[_0x16da('0x16')](function(_0x452b18){_0x1d4d6d[_0x16da('0x25')]=_0x452b18;if(_0x2f63d2[_0x16da('0x47')][_0x16da('0x59')]){_0x3a6dad['include']=[{'all':!![]}];}return db[_0x16da('0x70')][_0x16da('0x71')](_0x3a6dad);})['then'](function(_0x3be066){_0x1d4d6d['rows']=_0x3be066;return _0x1d4d6d;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x4d7fb7,_0x3a6dad))[_0x16da('0x1e')](handleError(_0x4d7fb7,null));};exports['removeAnswers']=function(_0x4ae70d,_0x4616c0){return db['ChatWebsite']['find']({'where':{'id':_0x4ae70d[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x4616c0,null))['then'](function(_0x1dcc2b){if(_0x1dcc2b){return _0x1dcc2b['removeAnswers'](_0x4ae70d[_0x16da('0x47')][_0x16da('0x6d')]);}})[_0x16da('0x16')](respondWithStatusCode(_0x4616c0,null))['catch'](handleError(_0x4616c0,null));};exports[_0x16da('0x72')]=function(_0x4c82df,_0x1784c6){_0x4c82df[_0x16da('0x5c')][_0x16da('0x73')]=_0x4c82df['file'][_0x16da('0x74')];return db[_0x16da('0x45')]['find']({'where':{'id':_0x4c82df[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x1784c6,null))[_0x16da('0x16')](saveUpdates(_0x4c82df['body'],null))[_0x16da('0x16')](respondWithResult(_0x1784c6,null))[_0x16da('0x1e')](handleError(_0x1784c6,null));};exports[_0x16da('0x75')]=function(_0x31511d,_0x5f2993){_0x31511d['body'][_0x16da('0x76')]=_0x31511d[_0x16da('0x77')][_0x16da('0x74')];return db[_0x16da('0x45')]['find']({'where':{'id':_0x31511d['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5f2993,null))['then'](saveUpdates(_0x31511d[_0x16da('0x5c')],null))['then'](respondWithResult(_0x5f2993,null))[_0x16da('0x1e')](handleError(_0x5f2993,null));};exports[_0x16da('0x78')]=function(_0x5d4a61,_0x1b10a7){_0x5d4a61[_0x16da('0x5c')]['customerAvatar']=_0x5d4a61[_0x16da('0x77')][_0x16da('0x74')];return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x5d4a61[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x1b10a7,null))['then'](saveUpdates(_0x5d4a61[_0x16da('0x5c')],null))[_0x16da('0x16')](respondWithResult(_0x1b10a7,null))[_0x16da('0x1e')](handleError(_0x1b10a7,null));};exports[_0x16da('0x79')]=function(_0x4e11e5,_0x3a6db4){_0x4e11e5[_0x16da('0x5c')][_0x16da('0x7a')]=_0x4e11e5['file'][_0x16da('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x4e11e5[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x3a6db4,null))[_0x16da('0x16')](saveUpdates(_0x4e11e5[_0x16da('0x5c')],null))[_0x16da('0x16')](respondWithResult(_0x3a6db4,null))[_0x16da('0x1e')](handleError(_0x3a6db4,null));};exports[_0x16da('0x7b')]=function(_0x31921f,_0x324b54){var _0x44d46e=path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/logos/default_logo.svg');var _0x6b36ff={'where':{'id':_0x31921f['params']['id']},'attributes':['id',_0x16da('0x73')],'raw':!![]};var _0x3b94de=![];return require(_0x16da('0x7e'))['getLicense']()[_0x16da('0x16')](function(_0x39ccf2){if(_0x39ccf2){_0x3b94de=_0x39ccf2[_0x16da('0x7f')];}})['then'](function(){return db[_0x16da('0x45')][_0x16da('0x5a')](_0x6b36ff);})[_0x16da('0x16')](handleEntityNotFound(_0x324b54,null))[_0x16da('0x16')](function(_0x30fc4c){if(_0x30fc4c){if(!_[_0x16da('0x80')](_0x30fc4c[_0x16da('0x73')])){if(fs['existsSync'](path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x81'),_0x30fc4c[_0x16da('0x73')]))&&_0x3b94de){_0x44d46e=path[_0x16da('0x7c')](config['root'],'server/files/images/logos/',_0x30fc4c['sitepic']);}}return _0x324b54[_0x16da('0x82')](_0x44d46e);}})[_0x16da('0x1e')](handleError(_0x324b54,null));};exports['getAvatar']=function(_0xb9d511,_0x46779e){var _0x1c4a60=path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/avatars/default_avatar.png');var _0x2f4c70={'where':{'id':_0xb9d511[_0x16da('0x55')]['id']},'attributes':['id',_0x16da('0x76')],'raw':!![]};return db[_0x16da('0x45')][_0x16da('0x5a')](_0x2f4c70)[_0x16da('0x16')](handleEntityNotFound(_0x46779e,null))['then'](function(_0x10c14e){if(_0x10c14e){if(!_[_0x16da('0x80')](_0x10c14e[_0x16da('0x76')])){if(fs[_0x16da('0x83')](path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x10c14e[_0x16da('0x76')]))){_0x1c4a60=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x10c14e[_0x16da('0x76')]);}}return _0x46779e[_0x16da('0x82')](_0x1c4a60);}})['catch'](handleError(_0x46779e,null));};exports[_0x16da('0x85')]=function(_0x1fa3c2,_0x5c8658){var _0x30de1f=path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/avatars/customer_avatar.png');var _0x234c9e={'where':{'id':_0x1fa3c2[_0x16da('0x55')]['id']},'attributes':['id','customerAvatar',_0x16da('0x86')],'raw':!![]};return db[_0x16da('0x45')]['find'](_0x234c9e)[_0x16da('0x16')](handleEntityNotFound(_0x5c8658,null))[_0x16da('0x16')](function(_0x216061){if(_0x216061){if(!_[_0x16da('0x80')](_0x216061[_0x16da('0x87')])){if(fs[_0x16da('0x83')](path[_0x16da('0x7c')](config[_0x16da('0x7d')],'server/files/images/avatars/',_0x216061[_0x16da('0x87')]))&&_0x216061['showCustomerAvatar']){_0x30de1f=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x216061['customerAvatar']);}}return _0x5c8658[_0x16da('0x82')](_0x30de1f);}})[_0x16da('0x1e')](handleError(_0x5c8658,null));};exports[_0x16da('0x88')]=function(_0xc29fea,_0xb169e4){var _0x540991=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x89'));var _0x12b220={'where':{'id':_0xc29fea[_0x16da('0x55')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x16da('0x45')][_0x16da('0x5a')](_0x12b220)[_0x16da('0x16')](handleEntityNotFound(_0xb169e4,null))['then'](function(_0x1b2176){if(_0x1b2176){if(!_[_0x16da('0x80')](_0x1b2176['systemAvatar'])){if(fs['existsSync'](path[_0x16da('0x7c')](config['root'],_0x16da('0x84'),_0x1b2176['systemAvatar']))){_0x540991=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x84'),_0x1b2176[_0x16da('0x7a')]);}}return _0xb169e4['download'](_0x540991);}})[_0x16da('0x1e')](handleError(_0xb169e4,null));};function checkWebsiteInterval(_0x6b883f){var _0x7b129d=_0x6b883f['Interval'];if(!_0x7b129d){return Promise['resolve'](_0x6b883f);}var _0x23150e=_0x6b883f[_0x16da('0x8a')]||undefined;return _0x7b129d['ifTime'](_0x23150e)['then'](function(_0x5a239f){if(!_0x5a239f){throw new APIOutOfIntervalError();}return _0x6b883f;});}exports['notify']=function(_0x37cf88,_0x2a5c28){var _0x24bd55={'body':_0x37cf88[_0x16da('0x5c')],'channel':_0x16da('0x8b')};var _0x378795=[];var _0x467a50=[];var _0x23477f={};var _0x3d3314=![];if(_0x37cf88[_0x16da('0x5c')]['id']){delete _0x37cf88[_0x16da('0x5c')]['id'];}if(_[_0x16da('0x80')](_0x37cf88[_0x16da('0x5c')][_0x16da('0x8c')])){throw new APIBadRequestError(_0x16da('0x8d'));}if(_['isNil'](_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0x16da('0x8f')](_0x37cf88[_0x16da('0x5c')][_0x16da('0x5c')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x35ee4d=_0x37cf88['body']['customerIp']&&_0x37cf88[_0x16da('0x5c')][_0x16da('0x37')];return db[_0x16da('0x90')][_0x16da('0x64')]()['then'](function(_0x1686ab){if(!_0x1686ab){throw new Error(_0x16da('0x91'));}_0x378795=Object['keys'](_0x1686ab)[_0x16da('0x51')](function(_0xceea8){return!['createdAt',_0x16da('0x92')]['includes'](_0xceea8);});_0x467a50=Object[_0x16da('0x56')](_0x1686ab)[_0x16da('0x51')](function(_0x1be2e5){return!['createdAt','updatedAt',_0x16da('0x93'),_0x16da('0x94')][_0x16da('0x95')](_0x1be2e5);});if(!_['includes'](_0x467a50,_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x467a50[_0x16da('0x7c')](',\x20'));}_0x23477f[_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')]]=_0x37cf88[_0x16da('0x5c')][_0x16da('0x8c')];})['then'](function(){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x37cf88[_0x16da('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x16da('0x96'),'include':[{'model':db[_0x16da('0x90')],'as':'Contacts','where':_0x23477f,'limit':0x1,'order':[[_0x16da('0x92'),_0x16da('0x97')]]}]},{'model':db[_0x16da('0x98')],'as':_0x16da('0x99')},{'model':db[_0x16da('0x9a')],'as':_0x16da('0x9a'),'include':[{'model':db[_0x16da('0x9a')],'as':_0x16da('0x9b'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x2cd608){if(!_0x2cd608){throw new APINotFoundError(util[_0x16da('0x3a')](_0x16da('0x9c'),_0x37cf88[_0x16da('0x55')]['id']));}if(_0x35ee4d){return checkWebsiteInterval(_0x2cd608);}return _0x2cd608;})[_0x16da('0x16')](function(_0x27673e){_0x24bd55[_0x16da('0x9d')]=_0x27673e;_0x24bd55[_0x16da('0x9e')]=_[_0x16da('0x9f')](_0x27673e[_0x16da('0x99')],[_0x16da('0xa0')],[_0x16da('0xa1')]);if(_0x24bd55[_0x16da('0x9d')]['Applications']){delete _0x24bd55['account'][_0x16da('0x99')];}_0x24bd55['list']=_0x27673e[_0x16da('0x96')]||{'id':_0x27673e[_0x16da('0x94')]};if(_0x24bd55[_0x16da('0xa2')]&&_0x24bd55[_0x16da('0xa2')][_0x16da('0xa3')][_0x16da('0x58')]){return _0x24bd55['list']['Contacts'][0x0];}var _0x47eaf5=_[_0x16da('0xa4')](_0x37cf88[_0x16da('0x5c')],{'firstName':_0x37cf88[_0x16da('0x5c')][_0x16da('0x8c')],'ListId':_0x27673e[_0x16da('0x94')]});_0x47eaf5[_0x37cf88[_0x16da('0x5c')][_0x16da('0x8e')]]=_0x37cf88['body'][_0x16da('0x8c')];return db[_0x16da('0x90')][_0x16da('0x5b')](_0x47eaf5,{'fields':_0x378795,'raw':!![]});})[_0x16da('0x16')](function(_0x2b0778){_0x24bd55[_0x16da('0xa5')]=_0x2b0778;var _0x44cbbc=createInteractionObject(_0x37cf88[_0x16da('0x55')]['id'],_0x37cf88[_0x16da('0x5c')],_0x37cf88[_0x16da('0xa6')],_0x2b0778);var _0x5b5ee1={'ChatWebsiteId':_0x37cf88['params']['id']};if(_0x37cf88['body'][_0x16da('0xa7')]){_0x5b5ee1[_0x16da('0xa7')]=_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')];_0x5b5ee1[_0x16da('0xa8')]=![];return db[_0x16da('0xa9')]['find']({'where':_0x5b5ee1})[_0x16da('0x16')](function(_0x150be7){var _0x2b0a70=_0x37cf88[_0x16da('0x5c')][_0x16da('0x32')]&&_0x37cf88[_0x16da('0x5c')][_0x16da('0x37')];if(_0x150be7){_0x3d3314=!![];return _0x150be7;}else if(!_0x2b0a70&&_0x150be7&&_0x150be7[_0x16da('0xa8')]){throw new APIConflictError(_0x16da('0xaa'));}_0x44cbbc['threadId']=_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')];_0x44cbbc[_0x16da('0xab')]=_0x37cf88[_0x16da('0x5c')]['externalUrl'];return db['ChatInteraction'][_0x16da('0x5b')](_0x44cbbc);});}_0x5b5ee1[_0x16da('0xac')]=_0x2b0778['id'];if(_0x37cf88['body'][_0x16da('0xad')]&&_0x37cf88[_0x16da('0x5c')][_0x16da('0xad')]['id']){_0x5b5ee1['id']=_0x37cf88[_0x16da('0x5c')][_0x16da('0xad')]['id'];return db[_0x16da('0xa9')][_0x16da('0x5a')]({'where':_0x5b5ee1})['then'](function(_0x38659e){var _0x2f0bb9=_0x37cf88[_0x16da('0x5c')][_0x16da('0x32')]&&_0x37cf88[_0x16da('0x5c')]['referer'];if(!_0x2f0bb9&&_0x38659e&&_0x38659e['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x38659e){_0x3d3314=!![];return _0x38659e;}else{return db['ChatInteraction'][_0x16da('0x5b')](_0x44cbbc);}});}return db['ChatInteraction'][_0x16da('0x5b')](_0x44cbbc);})[_0x16da('0x16')](function(_0x17b9c5){if(!_0x3d3314){return _0x17b9c5;}var _0x31a5ec={'from':(_0x24bd55['contact']['firstName']||'')+'\x20'+(_0x24bd55['contact'][_0x16da('0x36')]||'')};if(_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')]&&_0x37cf88['body'][_0x16da('0xae')]&&_0x37cf88[_0x16da('0x5c')][_0x16da('0xa7')]!=_0x37cf88['body']['messageId']){_0x31a5ec[_0x16da('0xa7')]=_0x37cf88[_0x16da('0x5c')][_0x16da('0xae')];}return _0x17b9c5[_0x16da('0x29')](_0x31a5ec);})[_0x16da('0x16')](function(_0x207862){_0x24bd55[_0x16da('0xad')]=_0x207862[_0x16da('0x2b')]({'plain':!![]});_0x24bd55[_0x16da('0xad')][_0x16da('0xaf')]=!_0x3d3314;if(_0x24bd55[_0x16da('0xad')][_0x16da('0xaf')]){if(_0x24bd55[_0x16da('0x9d')][_0x16da('0xb0')]){_0x24bd55[_0x16da('0x9e')][_0x16da('0xb1')]({'id':0x0,'priority':_0x24bd55[_0x16da('0x9e')][_0x16da('0x58')]+0x1,'app':_0x16da('0xb2'),'appdata':_0x16da('0xb3'),'interval':_0x16da('0xb4')});}}return db[_0x16da('0xb5')][_0x16da('0x5b')]({'body':_0x37cf88['body'][_0x16da('0x5c')],'ChatWebsiteId':_0x37cf88['params']['id'],'ChatInteractionId':_0x207862['id'],'direction':'in','ContactId':_0x24bd55[_0x16da('0xa5')]['id'],'AttachmentId':_0x37cf88[_0x16da('0x5c')]['AttachmentId']});})[_0x16da('0x16')](function(_0x5cae74){_0x24bd55['message']=_0x5cae74;if(!_0x24bd55['interaction'][_0x16da('0xb6')]){return;}return db['User'][_0x16da('0x5a')]({'attributes':['id',_0x16da('0x2e')],'where':{'id':_0x24bd55[_0x16da('0xad')][_0x16da('0xb6')]}});})[_0x16da('0x16')](function(_0x332e55){if(_0x332e55){_0x24bd55[_0x16da('0x9e')][_0x16da('0xb7')]({'id':0x0,'priority':0x0,'app':_0x16da('0xb8'),'appdata':_0x332e55['name']+','+(_0x24bd55['account'][_0x16da('0xb9')]||0xa),'interval':_0x16da('0xb4')});_0x24bd55[_0x16da('0xba')]=!![];}if(!_0x24bd55[_0x16da('0xad')]['queueId']){return;}return db[_0x16da('0xbb')][_0x16da('0x5a')]({'attributes':['id',_0x16da('0x2e')],'where':{'id':_0x24bd55['interaction'][_0x16da('0xbc')]}});})['then'](function(_0x17e770){if(_0x17e770){_0x24bd55[_0x16da('0x9e')][_0x16da('0xb7')]({'id':0x0,'priority':0x1,'app':_0x16da('0xbd'),'appdata':_0x17e770[_0x16da('0x2e')]+','+(_0x24bd55[_0x16da('0x9d')][_0x16da('0xbe')]||0x12c),'interval':_0x16da('0xb4')});}return respondWithRpcPromise(_0x16da('0xbf'),_0x16da('0xc0'),_0x24bd55);})[_0x16da('0x16')](function(_0x323726){respondWithRpcPromise(_0x16da('0xc1'),_0x16da('0xc1'),{'event':_0x16da('0xc2'),'message':_0x323726},client9002);return _0x323726;})['then'](respondWithResult(_0x2a5c28,null))[_0x16da('0x1e')](APIHandleError(_0x2a5c28));};exports['offline']=function(_0x1a9083,_0x3621b5){var _0x212f8e,_0x59b0a9,_0x1094b9;var _0x5927a8=[];var _0x730b5b={};var _0x530d09=_0x1a9083['files']||[];var _0x4660a0=[];var _0x184688;return db[_0x16da('0x90')]['describe']()['then'](function(_0x1920c8){if(!_0x1920c8){throw new db['Sequelize'][(_0x16da('0xc3'))](_0x16da('0xc4'));}_0x5927a8=_['difference'](_['keys'](_0x1920c8),[_0x16da('0xc5'),_0x16da('0x92'),_0x16da('0x93'),'ListId']);if(_0x1a9083[_0x16da('0x5c')]['id']){delete _0x1a9083[_0x16da('0x5c')]['id'];}if(_[_0x16da('0x80')](_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')])){throw _0x3621b5[_0x16da('0x20')](0x1f4)[_0x16da('0x2f')](new db[(_0x16da('0xc6'))][(_0x16da('0xc3'))](_0x16da('0xc7')));}if(_[_0x16da('0x80')](_0x1a9083['body'][_0x16da('0x5c')])||_0x1a9083['body']['body']===''){throw _0x3621b5[_0x16da('0x20')](0x1f4)[_0x16da('0x2f')](new db['Sequelize'][(_0x16da('0xc3'))](_0x16da('0xc8')));}if(_[_0x16da('0x80')](_0x1a9083[_0x16da('0x5c')][_0x16da('0xc9')])){throw _0x3621b5[_0x16da('0x20')](0x1f4)['send'](new db[(_0x16da('0xc6'))]['ValidationError'](_0x16da('0xca')+_0x5927a8));}if(!_[_0x16da('0x95')](_0x5927a8,_0x1a9083[_0x16da('0x5c')]['mapKeyOffline'])){throw _0x3621b5['status'](0x1f4)[_0x16da('0x2f')](new db[(_0x16da('0xc6'))][(_0x16da('0xc3'))](_0x16da('0xcb')+_0x5927a8));}_0x730b5b[_0x1a9083[_0x16da('0x5c')]['mapKeyOffline']]=_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')];})[_0x16da('0x16')](function(){return db[_0x16da('0x45')][_0x16da('0x5a')]({'where':{'id':_0x1a9083[_0x16da('0x55')]['id']},'include':[{'model':db[_0x16da('0xcc')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x16da('0x16')](handleEntityNotFound(_0x3621b5,null))[_0x16da('0x16')](function(_0x2ebce1){if(_0x2ebce1&&_0x2ebce1['List']){_0x59b0a9=_0x2ebce1;var _0x22d9be=_[_0x16da('0xa4')](_0x1a9083[_0x16da('0x5c')],{'firstName':_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')],'phone':_0x1a9083[_0x16da('0x5c')][_0x16da('0x8c')],'ListId':_0x2ebce1[_0x16da('0x94')]});_0x22d9be[_0x1a9083[_0x16da('0x5c')][_0x16da('0xc9')]]=_0x1a9083['body'][_0x16da('0x8c')];return db[_0x16da('0x90')][_0x16da('0xcd')]({'where':_0x730b5b,'defaults':_0x22d9be});}})[_0x16da('0xce')](function(_0x17db2b){if(_0x17db2b){_0x1094b9=_0x17db2b;var _0x3208bf=fs['readFileSync'](path[_0x16da('0x7c')](config['root'],_0x16da('0xcf')),_0x16da('0xd0'));var _0x303934=ejs[_0x16da('0xd1')](_0x3208bf,{'body':_['toPairs'](_0x1a9083[_0x16da('0x5c')][_0x16da('0x5c')]),'bodyTitle':_0x59b0a9[_0x16da('0xd2')]});return db[_0x16da('0xd3')][_0x16da('0x5b')]({'body':_0x303934,'plainBody':htmlToText['fromString'](_0x303934),'ContactId':_0x17db2b['id'],'ChatWebsiteId':_0x59b0a9['id']});}})[_0x16da('0x16')](function(_0x1801cb){_0x184688=_0x1801cb;if(_0x530d09[_0x16da('0x58')]){var _0x1ab4e6=_0x530d09[_0x16da('0x44')](function(_0x26d2df){return{'name':_0x26d2df[_0x16da('0xd4')],'basename':_0x26d2df['filename'],'type':_0x26d2df[_0x16da('0xd5')],'ChatOfflineMessageId':_0x1801cb['id']};});_0x4660a0=_0x1ab4e6[_0x16da('0x44')](_0x1442e5=>{var _0x2b2267={'filename':_0x1442e5[_0x16da('0x2e')],'path':path['join'](config[_0x16da('0x7d')],_0x16da('0xd6'),_0x16da('0xd7'),_0x16da('0xd8'),_0x16da('0xd9'),_0x1442e5[_0x16da('0xda')])};return _0x2b2267;});if(!_0x59b0a9[_0x16da('0xdb')]){return db['sequelize'][_0x16da('0xdc')](function(_0xfda2a2){return db[_0x16da('0xdd')][_0x16da('0xde')](_0x1ab4e6,{'transaction':_0xfda2a2});});}}})[_0x16da('0x16')](function(){if(_0x184688){_0x212f8e=_0x184688;return db[_0x16da('0xdf')][_0x16da('0x67')]({'where':{'service':!![]},'include':[{'model':db[_0x16da('0xe0')],'as':_0x16da('0xe1'),'raw':!![],'include':[{'model':db[_0x16da('0xe2')],'as':_0x16da('0xe2'),'raw':!![]}]}]});}})[_0x16da('0x16')](function(_0x211df3){if(_0x211df3&&_0x211df3[_0x16da('0xe1')]&&_0x59b0a9['forwardOffline']&&_0x59b0a9[_0x16da('0xe3')]){var _0x4fb7fb=_0x211df3[_0x16da('0xe4')]();return respondWithRpcPromise(_0x16da('0xe5'),'sendMail',{'account':_0x4fb7fb,'message':{'from':util[_0x16da('0x3a')](_0x16da('0xe6'),_0x211df3[_0x16da('0x2e')],_0x211df3[_0x16da('0xe7')]||_0x211df3[_0x16da('0xe1')]['user']),'to':_0x59b0a9[_0x16da('0xe3')],'subject':_0x59b0a9[_0x16da('0xe8')],'html':_0x212f8e[_0x16da('0x5c')],'attachments':_0x4660a0}},client9003)[_0x16da('0x16')](function(){return _0x212f8e;})[_0x16da('0x1e')](function(_0x445a4f){logger[_0x16da('0x1a')](_0x445a4f);});}})[_0x16da('0x16')](function(){if(_0x59b0a9&&_0x59b0a9['openNewInteraction']&&_0x59b0a9[_0x16da('0xe9')]){var _0x494a90=[];if(_0x530d09[_0x16da('0x58')]){_0x494a90=_0x530d09['map'](function(_0x5b3a84){return{'name':_0x5b3a84[_0x16da('0xd4')],'basename':_0x5b3a84[_0x16da('0x74')],'type':_0x5b3a84[_0x16da('0xd5')],'ChatOfflineMessageId':_0x184688['id']};});}var _0x1b5b46;if(!_[_0x16da('0x80')](_0x59b0a9[_0x16da('0xea')])){var _0x4cbc1e=_['map'](_0x1a9083['body'],function(_0x25fc59){return _0x25fc59;});var _0x57527a=_['toPairsIn'](_0x4cbc1e)[0x0];var _0x4c456b=_[_0x16da('0xeb')](_0x57527a,function(_0x55e26c){return _0x55e26c;});_0x1b5b46=_0x4c456b[0x1][_0x59b0a9[_0x16da('0xea')]];}var _0x2356b5={'from':_0x1094b9[_0x16da('0xe7')],'firstName':_0x1094b9['firstName'],'lastName':_0x1094b9['lastName'],'mapKey':_0x16da('0xe7'),'message':{'from':_0x1094b9[_0x16da('0xe7')],'to':_0x59b0a9[_0x16da('0xdf')]['email'],'cc':'','subject':_[_0x16da('0x80')](_0x1b5b46)?_0x59b0a9[_0x16da('0xe8')]:_0x1b5b46,'messageId':'','sentAt':new Date(),'attach':_0x494a90[_0x16da('0x58')],'attachments':_0x494a90,'originChannel':_0x16da('0xec'),'ChatWebsiteId':_0x59b0a9['id'],'ChatOfflineMessageId':_0x212f8e['id'],'originTo':_0x59b0a9[_0x16da('0xdf')]['email']},'body':_0x212f8e[_0x16da('0x5c')]};var _0x4ecaed={'account':{'id':_0x59b0a9['MailAccountId']},'body':_0x2356b5,'log':_0x16da('0xed')};return respondWithRpcPromise(_0x16da('0xed'),'notifyMail',_0x4ecaed,client9001)[_0x16da('0x16')](function(){return _0x212f8e;})[_0x16da('0x1e')](function(_0xf87b1c){logger['error'](_0xf87b1c);});}return;})[_0x16da('0x16')](function(){if(_0x212f8e){return _0x212f8e;}})[_0x16da('0x16')](respondWithResult(_0x3621b5,null))[_0x16da('0x1e')](function(){for(var _0x10d143 of _0x530d09){var _0x36270c=path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0xd6'),_0x16da('0xd7'),_0x16da('0xd8'),'offline-chat',_0x10d143[_0x16da('0x74')]);fs_extra['remove'](_0x36270c)[_0x16da('0x1e')](function(_0x1a2eb1){logger[_0x16da('0x1a')](_0x16da('0xee'),_0x36270c,_0x1a2eb1);});}});};exports['addInteraction']=function(_0x562f8b,_0x3fea51){return db[_0x16da('0xa9')][_0x16da('0x5a')]({'where':{'id':_0x562f8b[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x3fea51,null))['then'](function(_0x573500){if(_0x573500){return _0x573500[_0x16da('0xef')](_0x562f8b[_0x16da('0x5c')][_0x16da('0x6d')],_['omit'](_0x562f8b[_0x16da('0x5c')],[_0x16da('0x6d'),'id'])||{});}})[_0x16da('0x16')](respondWithResult(_0x3fea51,null))[_0x16da('0x1e')](handleError(_0x3fea51,null));};exports[_0x16da('0xf0')]=function(_0x2b8fec,_0x51eec7){var _0x507c99={'raw':![],'where':{}};var _0xaadc19={};var _0x247f29={'count':0x0,'rows':[]};return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x2b8fec['params']['id']}})['then'](handleEntityNotFound(_0x51eec7,null))[_0x16da('0x16')](function(_0x1cd15d){if(_0x1cd15d){_0xaadc19[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0xa9')][_0x16da('0x69')]);_0xaadc19[_0x16da('0x47')]=_['keys'](_0x2b8fec[_0x16da('0x47')]);_0xaadc19[_0x16da('0x48')]=_[_0x16da('0x57')](_0xaadc19[_0x16da('0x3e')],_0xaadc19[_0x16da('0x47')]);_0x507c99[_0x16da('0x49')]=_[_0x16da('0x57')](_0xaadc19[_0x16da('0x3e')],qs['fields'](_0x2b8fec[_0x16da('0x47')][_0x16da('0x4a')]));_0x507c99['attributes']=_0x507c99[_0x16da('0x49')][_0x16da('0x58')]?_0x507c99[_0x16da('0x49')]:_0xaadc19['model'];if(!_0x2b8fec[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x507c99[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x2b8fec[_0x16da('0x47')][_0x16da('0x26')]);_0x507c99['offset']=qs[_0x16da('0x23')](_0x2b8fec[_0x16da('0x47')]['offset']);}_0x507c99[_0x16da('0x4c')]=qs['sort'](_0x2b8fec[_0x16da('0x47')]['sort']);_0x507c99[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x2b8fec[_0x16da('0x47')],_0xaadc19[_0x16da('0x48')]));_0x507c99[_0x16da('0x4e')]['ChatWebsiteId']=_0x1cd15d['id'];if(_0x2b8fec['query']['filter']){_0x507c99[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x507c99[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x507c99[_0x16da('0x49')],function(_0x573d96){var _0x3507de={};_0x3507de[_0x573d96]={'$like':'%'+_0x2b8fec[_0x16da('0x47')][_0x16da('0x51')]+'%'};return _0x3507de;})});}_0x507c99=_[_0x16da('0x50')]({},_0x507c99,_0x2b8fec[_0x16da('0x6b')]);return db[_0x16da('0xa9')][_0x16da('0x25')]({'where':_0x507c99[_0x16da('0x4e')]})['then'](function(_0x49602f){_0x247f29[_0x16da('0x25')]=_0x49602f;if(_0x2b8fec['query'][_0x16da('0x59')]){_0x507c99['include']=[{'model':db[_0x16da('0x90')],'as':_0x16da('0xf1'),'required':![]},{'model':db['User'],'as':_0x16da('0xf2'),'attributes':[_0x16da('0x2e'),_0x16da('0xf3'),_0x16da('0xf4')],'required':![]},{'model':db[_0x16da('0xf5')],'as':_0x16da('0xf6'),'attributes':['id','name',_0x16da('0xf7')],'where':_0x2b8fec[_0x16da('0x47')][_0x16da('0xf8')]?{'id':_0x2b8fec[_0x16da('0x47')]['tag']}:undefined,'required':_0x2b8fec[_0x16da('0x47')][_0x16da('0xf8')]?!![]:![]}];}return db[_0x16da('0xa9')][_0x16da('0x71')](_0x507c99);})[_0x16da('0x16')](function(_0x3db9bd){_0x247f29['rows']=_0x3db9bd;return _0x247f29;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x51eec7,_0x507c99))[_0x16da('0x1e')](handleError(_0x51eec7,null));};exports[_0x16da('0xf9')]=function(_0xc793a7,_0x556acb){var _0x49cbc8=0x0;var _0x2b6583=0x0;var _0x2ba770=![];var _0xb55041;var _0x30e468;return db[_0x16da('0x45')]['find']({'where':{'id':_0xc793a7[_0x16da('0x55')]['id']},'include':[{'model':db['Interval'],'as':_0x16da('0x9a'),'include':[{'model':db[_0x16da('0x9a')],'as':'Intervals','attributes':['id',_0x16da('0xfa')]}]}]})[_0x16da('0x16')](handleEntityNotFound(_0x556acb,null))['then'](function(_0x386ce6){if(_0x386ce6){_0xb55041=_0x386ce6;return _0x386ce6[_0x16da('0xfb')]({'raw':!![]});}})['then'](function(_0x3175c4){if(_0xb55041){if(_0x3175c4){_0x30e468=_0x3175c4;}}return require(_0x16da('0x7e'))[_0x16da('0xfc')]();})[_0x16da('0x16')](function(_0x3c9aa5){if(_0x3c9aa5){_0x2b6583=_0x3c9aa5[_0x16da('0xfd')];_0x2ba770=_0x3c9aa5[_0x16da('0x7f')];}})[_0x16da('0x16')](function(){return db[_0x16da('0xa9')][_0x16da('0x25')]({'where':{'closed':![]}});})[_0x16da('0x16')](function(_0x53a80b){_0x49cbc8=_0x53a80b;if(_0x2b6583&&_0x53a80b>_0x2b6583){return db[_0x16da('0xfe')][_0x16da('0x67')]({'where':{'id':0x1}})[_0x16da('0x16')](function(_0xe0c81d){if(_0xe0c81d){_0xe0c81d['increment'](_0x16da('0xff'));}});}})[_0x16da('0x16')](function(){var _0x5c9a94=_0xb55041[_0x16da('0x9a')];var _0x48f312=_0xb55041[_0x16da('0x8a')]||undefined;return _0x5c9a94?_0x5c9a94[_0x16da('0x100')](_0x48f312):!![];})['then'](function(_0x5ca2b5){var _0x432b87=fs[_0x16da('0x101')](path[_0x16da('0x7c')](config[_0x16da('0x7d')],_0x16da('0x102')),_0x16da('0xd0'));var _0x148f8e=_0x16da('0x103');var _0x2309cb=![];try{const _0x5f24f3=new URL(_0xb55041[_0x16da('0x5d')]);_0xb55041[_0x16da('0x5d')]=_0x5f24f3[_0x16da('0x104')];}catch(_0x3bf89b){}var _0x2af174;if(_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]){_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]=_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')][_0x16da('0x105')](/\/$/,'');_0x2af174=wildcardUtils['testWebsiteWithWildcard'](_0xb55041[_0x16da('0x5d')],_0xc793a7['headers'][_0x16da('0x37')]);}else{_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]=_0xb55041['address'];_0x2af174=!![];}var _0x2cc33d={'chatVersion':_0x148f8e,'chatWebsiteAddressOrigin':_0x2af174?_0xc793a7[_0x16da('0xa6')]['referer']:_0xb55041[_0x16da('0x5d')],'remote':_0xb55041['remote'],'query':querystring[_0x16da('0x41')](_[_0x16da('0x50')](_0xb55041[_0x16da('0x2b')]({'plain':!![]}),{'customerIp':_0xc793a7[_0x16da('0xa6')]['x-forwarded-for']||_0xc793a7[_0x16da('0xa6')][_0x16da('0x106')]||_0xc793a7[_0x16da('0x107')][_0x16da('0x108')]||_0xc793a7['ip'],'referer':_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')],'openedInteractions':_0x49cbc8,'maxInteractions':_0x2b6583,'virtual':_0x2ba770[_0x16da('0xfd')],'online':_0x5ca2b5,'custom':_0x2ba770,'address':_0x2af174?_0xc793a7[_0x16da('0xa6')][_0x16da('0x37')]:null}))[_0x16da('0x105')](/'/g,'\x5c\x27')};_0x556acb['send'](ejs[_0x16da('0xd1')](Mustache[_0x16da('0xd1')](_0x432b87,_0x2cc33d),{'proactiveActions':_0x30e468,'alignment':_0xb55041['alignment'],'verticalAlignment':_0xb55041[_0x16da('0x109')],'div_color':_0xb55041['color'],'labelText':_0xb55041['labelText'],'text_color':_0xb55041[_0x16da('0x10a')],'text_button_color':_0xb55041[_0x16da('0x10b')],'button_color':_0xb55041['color_button'],'background_color':_0xb55041[_0x16da('0x10c')],'hideWhenOffline':_0xb55041['hideWhenOffline'],'intervalId':_0xb55041['IntervalId'],'isDevelopment':_0x2309cb,'chatVersion':_0x148f8e}));})[_0x16da('0x1e')](handleError(_0x556acb,null));};exports[_0x16da('0x10d')]=function(_0x36b59f,_0x5c6f79){var _0xa9c85b=_0x36b59f[_0x16da('0x55')]['id'];var _0xeeb14a=_0x36b59f[_0x16da('0x5c')];var _0x5484bb=0xc8;var _0x15b144=null;return db[_0x16da('0x10e')][_0x16da('0xdc')]({'isolationLevel':db[_0x16da('0x10e')][_0x16da('0x10f')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x26c40c){return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0xa9c85b},'transaction':_0x26c40c})[_0x16da('0x16')](function(_0x470a39){if(_0x470a39){return db[_0x16da('0x98')][_0x16da('0x2a')]({'where':{'ChatWebsiteId':_0xa9c85b},'transaction':_0x26c40c})['then'](function(){var _0x7a8770=_[_0x16da('0x44')](_0xeeb14a,function(_0x5b8ebe){_0x5b8ebe[_0x16da('0x65')]=_0xa9c85b;return _0x5b8ebe;});return db[_0x16da('0x98')]['bulkCreate'](_0x7a8770,{'transaction':_0x26c40c});});}else{_0x5484bb=0x194;_0x15b144=[];}});})[_0x16da('0x16')](function(){if(_0x5484bb!==0x194){return db[_0x16da('0x98')][_0x16da('0x110')]({'where':{'ChatWebsiteId':_0xa9c85b},'order':_0x16da('0xa0')})[_0x16da('0x16')](function(_0x53b11c){_0x15b144=_0x53b11c;});}})[_0x16da('0x1e')](function(_0x44dec6){_0x5484bb=0x1f4;logger['error'](_0x44dec6[_0x16da('0x111')]);if(_0x44dec6['name']){delete _0x44dec6[_0x16da('0x2e')];}_0x15b144=_0x44dec6;})[_0x16da('0x112')](function(){if(_0x15b144===null){_0x5c6f79[_0x16da('0x1f')](_0x5484bb);}else{if(_0x5484bb===0x1f4){_0x5c6f79['status'](_0x5484bb)[_0x16da('0x2f')](_0x15b144);}else{_0x5c6f79[_0x16da('0x20')](_0x5484bb)[_0x16da('0x22')](_0x15b144);}}});};exports[_0x16da('0x113')]=function(_0x5d574d,_0x3f6391){var _0xdfd4d8={};var _0x47d0a1={};var _0x1efa72;var _0x5666ed;return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x5d574d[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x3f6391,null))['then'](function(_0x5ed086){if(_0x5ed086){_0x1efa72=_0x5ed086;_0x47d0a1[_0x16da('0x3e')]=_[_0x16da('0x56')](db['ChatApplication']['rawAttributes']);_0x47d0a1['query']=_[_0x16da('0x56')](_0x5d574d[_0x16da('0x47')]);_0x47d0a1[_0x16da('0x48')]=_[_0x16da('0x57')](_0x47d0a1[_0x16da('0x3e')],_0x47d0a1[_0x16da('0x47')]);_0xdfd4d8[_0x16da('0x49')]=_[_0x16da('0x57')](_0x47d0a1['model'],qs[_0x16da('0x4a')](_0x5d574d[_0x16da('0x47')][_0x16da('0x4a')]));_0xdfd4d8[_0x16da('0x49')]=_0xdfd4d8[_0x16da('0x49')]['length']?_0xdfd4d8[_0x16da('0x49')]:_0x47d0a1['model'];_0xdfd4d8['order']=qs[_0x16da('0x4d')](_0x5d574d[_0x16da('0x47')][_0x16da('0x4d')]);_0xdfd4d8['where']=qs['filters'](_[_0x16da('0x4f')](_0x5d574d[_0x16da('0x47')],_0x47d0a1[_0x16da('0x48')]));if(_0x5d574d[_0x16da('0x47')][_0x16da('0x51')]){_0xdfd4d8[_0x16da('0x4e')]=_[_0x16da('0x50')](_0xdfd4d8[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0xdfd4d8['attributes'],function(_0x4ba57b){var _0x5c5f33={};_0x5c5f33[_0x4ba57b]={'$like':'%'+_0x5d574d[_0x16da('0x47')]['filter']+'%'};return _0x5c5f33;})});}_0xdfd4d8=_['merge']({},_0xdfd4d8,_0x5d574d['options']);return _0x1efa72[_0x16da('0x113')](_0xdfd4d8);}})['then'](function(_0x1a0e89){if(_0x1a0e89){_0x5666ed=_0x1a0e89[_0x16da('0x58')];if(!_0x5d574d[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0xdfd4d8['limit']=qs[_0x16da('0x26')](_0x5d574d[_0x16da('0x47')][_0x16da('0x26')]);_0xdfd4d8[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x5d574d[_0x16da('0x47')][_0x16da('0x23')]);}return _0x1efa72['getApplications'](_0xdfd4d8);}})[_0x16da('0x16')](function(_0x2f0952){if(_0x2f0952){return _0x2f0952?{'count':_0x5666ed,'rows':_0x2f0952}:null;}})[_0x16da('0x16')](respondWithResult(_0x3f6391,null))[_0x16da('0x1e')](handleError(_0x3f6391,null));};exports['addProactiveActions']=function(_0x5548cf,_0x42f2a3){return db[_0x16da('0x114')][_0x16da('0x5a')]({'where':{'id':_0x5548cf[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x42f2a3,null))[_0x16da('0x16')](function(_0x53f3d7){if(_0x53f3d7){return _0x53f3d7[_0x16da('0x115')](_0x5548cf['body']['ids'],_[_0x16da('0x116')](_0x5548cf[_0x16da('0x5c')],[_0x16da('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x42f2a3,null))[_0x16da('0x1e')](handleError(_0x42f2a3,null));};exports['getProactiveActions']=function(_0x1b75c1,_0x303d8f){var _0x5b4f8d={};var _0x44eac3={};var _0x13ca56;var _0x53232b;return db['ChatWebsite'][_0x16da('0x67')]({'where':{'id':_0x1b75c1[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x303d8f,null))[_0x16da('0x16')](function(_0x287c52){if(_0x287c52){_0x13ca56=_0x287c52;_0x44eac3[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0x117')][_0x16da('0x69')]);_0x44eac3[_0x16da('0x47')]=_[_0x16da('0x56')](_0x1b75c1[_0x16da('0x47')]);_0x44eac3[_0x16da('0x48')]=_[_0x16da('0x57')](_0x44eac3[_0x16da('0x3e')],_0x44eac3[_0x16da('0x47')]);_0x5b4f8d[_0x16da('0x49')]=_['intersection'](_0x44eac3[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x1b75c1[_0x16da('0x47')][_0x16da('0x4a')]));_0x5b4f8d['attributes']=_0x5b4f8d[_0x16da('0x49')][_0x16da('0x58')]?_0x5b4f8d[_0x16da('0x49')]:_0x44eac3['model'];_0x5b4f8d['order']=qs['sort'](_0x1b75c1[_0x16da('0x47')][_0x16da('0x4d')]);_0x5b4f8d[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x1b75c1['query'],_0x44eac3['filters']));if(_0x1b75c1['query'][_0x16da('0x51')]){_0x5b4f8d[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x5b4f8d[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x5b4f8d[_0x16da('0x49')],function(_0x49a468){var _0x54c619={};_0x54c619[_0x49a468]={'$like':'%'+_0x1b75c1[_0x16da('0x47')][_0x16da('0x51')]+'%'};return _0x54c619;})});}_0x5b4f8d=_[_0x16da('0x50')]({},_0x5b4f8d,_0x1b75c1['options']);return _0x13ca56['getProactiveActions'](_0x5b4f8d);}})[_0x16da('0x16')](function(_0x252093){if(_0x252093){_0x53232b=_0x252093[_0x16da('0x58')];if(!_0x1b75c1[_0x16da('0x47')]['hasOwnProperty'](_0x16da('0x6a'))){_0x5b4f8d[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x1b75c1['query'][_0x16da('0x26')]);_0x5b4f8d[_0x16da('0x23')]=qs['offset'](_0x1b75c1[_0x16da('0x47')]['offset']);}return _0x13ca56['getProactiveActions'](_0x5b4f8d);}})['then'](function(_0x2fb8f7){if(_0x2fb8f7){return _0x2fb8f7?{'count':_0x53232b,'rows':_0x2fb8f7}:null;}})[_0x16da('0x16')](respondWithResult(_0x303d8f,null))[_0x16da('0x1e')](handleError(_0x303d8f,null));};exports[_0x16da('0x118')]=function(_0x1e1212,_0xc86d7c){var _0x9edd52=_0x1e1212[_0x16da('0x47')][_0x16da('0x119')]===_0x16da('0x11a')?_0x16da('0x11b'):'onlineForm';return db[_0x16da('0x45')][_0x16da('0x5a')]({'attributes':['id',_0x9edd52],'where':{'id':_0x1e1212['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0xc86d7c,null))['then'](function(_0x416b9c){if(_0x416b9c){var _0x5baf74=_0x416b9c[_0x9edd52];var _0x2c7765=_0x5baf74&&_0x5baf74[_0x16da('0x11c')]?_0x5baf74[_0x16da('0x11c')]:[];_0xc86d7c[_0x16da('0x2f')]({'fromKey':_['isNil'](_0x5baf74[_0x16da('0x11d')])?undefined:_0x5baf74['fromKey'],'count':_0x2c7765[_0x16da('0x58')],'rows':_0x2c7765});}})[_0x16da('0x1e')](handleError(_0xc86d7c,null));};exports[_0x16da('0x11e')]=function(_0x1afbf4,_0x416b15){var _0x38276f={'raw':![],'where':{}};var _0x2525ed={};var _0xd8ecab={'count':0x0,'rows':[]};return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x1afbf4[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x416b15,null))[_0x16da('0x16')](function(_0x16f970){if(_0x16f970){_0x2525ed[_0x16da('0x3e')]=_[_0x16da('0x56')](db['ChatOfflineMessage']['rawAttributes']);_0x2525ed[_0x16da('0x47')]=_[_0x16da('0x56')](_0x1afbf4[_0x16da('0x47')]);_0x2525ed[_0x16da('0x48')]=_[_0x16da('0x57')](_0x2525ed[_0x16da('0x3e')],_0x2525ed[_0x16da('0x47')]);_0x38276f[_0x16da('0x49')]=_['intersection'](_0x2525ed['model'],qs['fields'](_0x1afbf4[_0x16da('0x47')]['fields']));_0x38276f[_0x16da('0x49')]=_0x38276f[_0x16da('0x49')][_0x16da('0x58')]?_0x38276f['attributes']:_0x2525ed[_0x16da('0x3e')];if(!_0x1afbf4[_0x16da('0x47')]['hasOwnProperty'](_0x16da('0x6a'))){_0x38276f[_0x16da('0x26')]=qs[_0x16da('0x26')](_0x1afbf4[_0x16da('0x47')][_0x16da('0x26')]);_0x38276f['offset']=qs[_0x16da('0x23')](_0x1afbf4['query'][_0x16da('0x23')]);}_0x38276f[_0x16da('0x4c')]=qs[_0x16da('0x4d')](_0x1afbf4['query'][_0x16da('0x4d')]);_0x38276f[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x1afbf4[_0x16da('0x47')],_0x2525ed[_0x16da('0x48')]));_0x38276f[_0x16da('0x4e')][_0x16da('0x65')]=_0x16f970['id'];if(_0x1afbf4[_0x16da('0x47')][_0x16da('0x51')]){_0x38276f[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x38276f[_0x16da('0x4e')],{'$or':_[_0x16da('0x44')](_0x38276f[_0x16da('0x49')],function(_0x1021f1){var _0x503f66={};_0x503f66[_0x1021f1]={'$like':'%'+_0x1afbf4[_0x16da('0x47')]['filter']+'%'};return _0x503f66;})});}_0x38276f=_[_0x16da('0x50')]({},_0x38276f,_0x1afbf4[_0x16da('0x6b')]);return db[_0x16da('0xd3')][_0x16da('0x25')]({'where':_0x38276f[_0x16da('0x4e')]})[_0x16da('0x16')](function(_0x4d4f38){_0xd8ecab[_0x16da('0x25')]=_0x4d4f38;if(_0x1afbf4['query'][_0x16da('0x59')]){_0x38276f[_0x16da('0x52')]=[{'all':!![]}];}else{_0x38276f[_0x16da('0x52')]=[{'model':db[_0x16da('0x90')],'as':_0x16da('0xf1'),'required':![]},{'model':db[_0x16da('0xdd')],'as':_0x16da('0x11f'),'required':![]}];}return db[_0x16da('0xd3')][_0x16da('0x71')](_0x38276f);})[_0x16da('0x16')](function(_0x5bdab3){_0xd8ecab['rows']=_0x5bdab3;return _0xd8ecab;});}})[_0x16da('0x16')](respondWithFilteredResult(_0x416b15,_0x38276f))[_0x16da('0x1e')](handleError(_0x416b15,null));};exports[_0x16da('0x120')]=function(_0x194288,_0x5bcd44){return db['ChatWebsite'][_0x16da('0x5a')]({'where':{'id':_0x194288[_0x16da('0x55')]['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x5bcd44,null))[_0x16da('0x16')](function(_0x281167){if(_0x281167){return _0x281167['addAgents'](_0x194288['body']['ids'],_[_0x16da('0x116')](_0x194288[_0x16da('0x5c')],[_0x16da('0x6d'),'id'])||{})[_0x16da('0xce')](function(_0xe48bd9){for(var _0xf1aeda=0x0;_0xf1aeda<_0x194288[_0x16da('0x5c')][_0x16da('0x6d')][_0x16da('0x58')];_0xf1aeda+=0x1){socket[_0x16da('0x121')](_0x16da('0x122'),{'UserId':Number(_0x194288['body'][_0x16da('0x6d')][_0xf1aeda]),'ChatWebsiteId':Number(_0x194288[_0x16da('0x55')]['id'])});}return _0xe48bd9;});}})[_0x16da('0x16')](respondWithResult(_0x5bcd44,null))['catch'](handleError(_0x5bcd44,null));};exports['removeAgents']=function(_0x565654,_0x500c30){return db['ChatWebsite'][_0x16da('0x5a')]({'where':{'id':_0x565654['params']['id']}})[_0x16da('0x16')](handleEntityNotFound(_0x500c30,null))[_0x16da('0x16')](function(_0x497703){if(_0x497703){return _0x497703[_0x16da('0x123')](_0x565654[_0x16da('0x47')][_0x16da('0x6d')])[_0x16da('0x16')](function(){if(_[_0x16da('0x124')](_0x565654[_0x16da('0x47')][_0x16da('0x6d')])){for(var _0x3fb7f1=0x0;_0x3fb7f1<_0x565654['query'][_0x16da('0x6d')][_0x16da('0x58')];_0x3fb7f1+=0x1){socket[_0x16da('0x121')](_0x16da('0x125'),{'UserId':Number(_0x565654['query'][_0x16da('0x6d')][_0x3fb7f1]),'ChatWebsiteId':Number(_0x565654[_0x16da('0x55')]['id'])});}}else{socket['emit'](_0x16da('0x125'),{'UserId':Number(_0x565654['query'][_0x16da('0x6d')]),'ChatWebsiteId':Number(_0x565654[_0x16da('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x500c30,null))[_0x16da('0x1e')](handleError(_0x500c30,null));};exports[_0x16da('0x126')]=function(_0x1ed05b,_0x4fbd6a){var _0x562639={};var _0x3e3ce7={};var _0x28ac45;var _0x222a65;return db[_0x16da('0x45')][_0x16da('0x67')]({'where':{'id':_0x1ed05b[_0x16da('0x55')]['id']}})['then'](handleEntityNotFound(_0x4fbd6a,null))[_0x16da('0x16')](function(_0x4ae95a){if(_0x4ae95a){_0x28ac45=_0x4ae95a;_0x3e3ce7[_0x16da('0x3e')]=_[_0x16da('0x56')](db[_0x16da('0x127')][_0x16da('0x69')]);_0x3e3ce7[_0x16da('0x47')]=_[_0x16da('0x56')](_0x1ed05b[_0x16da('0x47')]);_0x3e3ce7[_0x16da('0x48')]=_[_0x16da('0x57')](_0x3e3ce7[_0x16da('0x3e')],_0x3e3ce7[_0x16da('0x47')]);_0x562639[_0x16da('0x49')]=_[_0x16da('0x57')](_0x3e3ce7[_0x16da('0x3e')],qs[_0x16da('0x4a')](_0x1ed05b[_0x16da('0x47')][_0x16da('0x4a')]));_0x562639[_0x16da('0x49')]=_0x562639['attributes'][_0x16da('0x58')]?_0x562639[_0x16da('0x49')]:_0x3e3ce7['model'];_0x562639[_0x16da('0x4c')]=qs['sort'](_0x1ed05b[_0x16da('0x47')][_0x16da('0x4d')]);_0x562639[_0x16da('0x4e')]=qs[_0x16da('0x48')](_[_0x16da('0x4f')](_0x1ed05b[_0x16da('0x47')],_0x3e3ce7['filters']));if(_0x1ed05b[_0x16da('0x47')][_0x16da('0x51')]){_0x562639[_0x16da('0x4e')]=_[_0x16da('0x50')](_0x562639['where'],{'$or':_[_0x16da('0x44')](_0x562639['attributes'],function(_0x41e1fa){var _0x694133={};_0x694133[_0x41e1fa]={'$like':'%'+_0x1ed05b[_0x16da('0x47')]['filter']+'%'};return _0x694133;})});}_0x562639=_[_0x16da('0x50')]({},_0x562639,_0x1ed05b[_0x16da('0x6b')]);return _0x28ac45[_0x16da('0x126')](_0x562639);}})[_0x16da('0x16')](function(_0x2eaae0){if(_0x2eaae0){_0x222a65=_0x2eaae0[_0x16da('0x58')];if(!_0x1ed05b[_0x16da('0x47')][_0x16da('0x4b')](_0x16da('0x6a'))){_0x562639['limit']=qs[_0x16da('0x26')](_0x1ed05b[_0x16da('0x47')][_0x16da('0x26')]);_0x562639[_0x16da('0x23')]=qs[_0x16da('0x23')](_0x1ed05b[_0x16da('0x47')][_0x16da('0x23')]);}return _0x28ac45[_0x16da('0x126')](_0x562639);}})[_0x16da('0x16')](function(_0x4a80b4){if(_0x4a80b4){return _0x4a80b4?{'count':_0x222a65,'rows':_0x4a80b4}:null;}})[_0x16da('0x16')](respondWithResult(_0x4fbd6a,null))['catch'](handleError(_0x4fbd6a,null));}; \ No newline at end of file +var _0x2fd8=['then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','count','limit','set','Content-Range','update','destroy','get','UserProfileResource','name','send','setUA','customerIp','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','include','findAll','rows','show','params','length','merge','options','find','testWildcardValidity','body','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','address','describe','ChatWebsiteId','Disposition','create','getDispositions','findOne','rawAttributes','includeAll','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','from','From\x20is\x20mandatory','mapKey','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','updatedAt','includes','createdAt','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','List','Contacts','DESC','ChatApplication','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','priority','list','contact','headers','threadId','closed','externalUrl','ContactId','interaction','ChatInteraction','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','applications','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queue','waitForTheAssignedQueue','Start','startRouting','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','omit','getInteractions','User','Owner','fullname','Tag','Tags','tag','getSnippet','interval','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','replace','testWebsiteWithWildcard','remote','x-real-ip','connection','remoteAddress','alignment','color','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','getFields','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','lodash','querystring','html-to-text','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APIOutOfIntervalError','handleError','APIConflictError','url','URL','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','request'];(function(_0xa978d9,_0x21203d){var _0x5bf53c=function(_0x38ae21){while(--_0x38ae21){_0xa978d9['push'](_0xa978d9['shift']());}};_0x5bf53c(++_0x21203d);}(_0x2fd8,0x111));var _0x82fd=function(_0x29d096,_0x4f3bf9){_0x29d096=_0x29d096-0x0;var _0x469bb8=_0x2fd8[_0x29d096];return _0x469bb8;};'use strict';var Mustache=require(_0x82fd('0x0'));var util=require(_0x82fd('0x1'));var path=require('path');var ejs=require(_0x82fd('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82fd('0x3'));var querystring=require(_0x82fd('0x4'));var htmlToText=require(_0x82fd('0x5'));var Redis=require('ioredis');var jayson=require(_0x82fd('0x6'));var qs=require(_0x82fd('0x7'));var logger=require(_0x82fd('0x8'))(_0x82fd('0x9'));var config=require(_0x82fd('0xa'));var APIBadRequestError=require(_0x82fd('0xb'))[_0x82fd('0xc')];var APINotFoundError=require(_0x82fd('0xb'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x82fd('0xb'))[_0x82fd('0xd')];var APIHandleError=require(_0x82fd('0xb'))[_0x82fd('0xe')];var APIConflictError=require(_0x82fd('0xb'))[_0x82fd('0xf')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x82fd('0x10'))[_0x82fd('0x11')];var db=require(_0x82fd('0x12'))['db'];config[_0x82fd('0x13')]=_[_0x82fd('0x14')](config[_0x82fd('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x82fd('0x15'))(new Redis(config['redis']));require(_0x82fd('0x16'))[_0x82fd('0x17')](socket);var client=jayson[_0x82fd('0x18')][_0x82fd('0x19')]({'port':0x232c});var client9002=jayson[_0x82fd('0x18')][_0x82fd('0x19')]({'port':0x232a});var client9003=jayson['client'][_0x82fd('0x19')]({'port':0x232b});var client9001=jayson[_0x82fd('0x18')][_0x82fd('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x30de91,_0x21d9ef,_0x502d6b,_0x4d48a0){return new Promise(function(_0x220113,_0xb10881){var _0x5743ed=_0x4d48a0||client;return _0x5743ed[_0x82fd('0x1a')](_0x30de91,_0x502d6b)[_0x82fd('0x1b')](function(_0x4b0390){logger[_0x82fd('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x21d9ef,'request\x20sent');logger[_0x82fd('0x1d')](_0x82fd('0x1e'),_0x21d9ef,_0x82fd('0x1f'),JSON['stringify'](_0x4b0390));if(_0x4b0390['error']){if(_0x4b0390[_0x82fd('0x20')]['code']===0x1f4){logger[_0x82fd('0x20')](_0x82fd('0x21'),_0x21d9ef,_0x4b0390[_0x82fd('0x20')][_0x82fd('0x22')]);return _0xb10881(_0x4b0390[_0x82fd('0x20')]['message']);}logger[_0x82fd('0x20')](_0x82fd('0x21'),_0x21d9ef,_0x4b0390[_0x82fd('0x20')]['message']);return _0x220113(_0x4b0390[_0x82fd('0x20')][_0x82fd('0x22')]);}else{logger['info'](_0x82fd('0x21'),_0x21d9ef,_0x82fd('0x1f'));_0x220113(_0x4b0390[_0x82fd('0x23')][_0x82fd('0x22')]);}})[_0x82fd('0x24')](function(_0x46d995){logger[_0x82fd('0x20')](_0x82fd('0x21'),_0x21d9ef,_0x46d995);_0xb10881(_0x46d995);});});}function respondWithStatusCode(_0x753d42,_0x5a7524){_0x5a7524=_0x5a7524||0xcc;return function(_0xb06967){if(_0xb06967){return _0x753d42[_0x82fd('0x25')](_0x5a7524);}return _0x753d42[_0x82fd('0x26')](_0x5a7524)[_0x82fd('0x27')]();};}function respondWithResult(_0x13f52b,_0x15ce1e){_0x15ce1e=_0x15ce1e||0xc8;return function(_0x230944){if(_0x230944){return _0x13f52b['status'](_0x15ce1e)[_0x82fd('0x28')](_0x230944);}};}function respondWithFilteredResult(_0x5af228,_0x18599f){return function(_0x8d272d){if(_0x8d272d){var _0x15dc69=typeof _0x18599f[_0x82fd('0x29')]==='undefined'&&typeof _0x18599f['limit']==='undefined';var _0x7abfeb=_0x8d272d[_0x82fd('0x2a')];var _0x954d3c=_0x15dc69?0x0:_0x18599f[_0x82fd('0x29')];var _0x1bfd1a=_0x15dc69?_0x8d272d[_0x82fd('0x2a')]:_0x18599f[_0x82fd('0x29')]+_0x18599f[_0x82fd('0x2b')];var _0x51e6a0;if(_0x1bfd1a>=_0x7abfeb){_0x1bfd1a=_0x7abfeb;_0x51e6a0=0xc8;}else{_0x51e6a0=0xce;}_0x5af228[_0x82fd('0x26')](_0x51e6a0);return _0x5af228[_0x82fd('0x2c')](_0x82fd('0x2d'),_0x954d3c+'-'+_0x1bfd1a+'/'+_0x7abfeb)['json'](_0x8d272d);}return null;};}function saveUpdates(_0x4481fc){return function(_0xa8a540){if(_0xa8a540){return _0xa8a540[_0x82fd('0x2e')](_0x4481fc)['then'](function(_0x59c3cd){return _0x59c3cd;});}return null;};}function removeEntity(_0x16e5e7){return function(_0x33fe53){if(_0x33fe53){return _0x33fe53[_0x82fd('0x2f')]()[_0x82fd('0x1b')](function(){var _0x392513=_0x33fe53[_0x82fd('0x30')]({'plain':!![]});var _0x356a73='ChatWebsites';return db[_0x82fd('0x31')][_0x82fd('0x2f')]({'where':{'type':_0x356a73,'resourceId':_0x392513['id']}})[_0x82fd('0x1b')](function(){return _0x33fe53;});})[_0x82fd('0x1b')](function(){_0x16e5e7[_0x82fd('0x26')](0xcc)[_0x82fd('0x27')]();});}};}function handleEntityNotFound(_0x3dffac){return function(_0x45f3a4){if(!_0x45f3a4){_0x3dffac['sendStatus'](0x194);}return _0x45f3a4;};}function handleError(_0x263272,_0x382384){_0x382384=_0x382384||0x1f4;return function(_0x47f853){logger[_0x82fd('0x20')](_0x47f853['stack']);if(_0x47f853[_0x82fd('0x32')]){delete _0x47f853[_0x82fd('0x32')];}_0x263272[_0x82fd('0x26')](_0x382384)[_0x82fd('0x33')](_0x47f853);};}function createInteractionObject(_0x6c1172,_0x5de7dd,_0x27d798,_0x221e95){var _0x36f4af=require('user-agent-parser');var _0x46ec67=new _0x36f4af();var _0x2b563b=_0x46ec67[_0x82fd('0x34')](_0x27d798['user-agent'])['getResult']();var _0x1bde7c=_0x5de7dd[_0x82fd('0x35')];if(_0x27d798['cf-connecting-ip']){_0x1bde7c=_0x27d798['cf-connecting-ip'];}else if(_0x27d798['x-forwarded-for']){_0x1bde7c=_['first'](_0x27d798[_0x82fd('0x36')][_0x82fd('0x37')](','));}return{'ContactId':_0x221e95['id'],'ChatWebsiteId':_0x6c1172,'from':(_0x221e95['firstName']||'')+'\x20'+(_0x221e95[_0x82fd('0x38')]||''),'customerIp':_0x1bde7c,'customerPort':_0x27d798[_0x82fd('0x39')]?_0x27d798[_0x82fd('0x39')]:null,'referer':_0x5de7dd[_0x82fd('0x3a')],'browserName':_0x2b563b[_0x82fd('0x3b')][_0x82fd('0x32')]&&_0x2b563b['browser'][_0x82fd('0x3c')]?util[_0x82fd('0x3d')](_0x82fd('0x3e'),_0x2b563b[_0x82fd('0x3b')][_0x82fd('0x32')],_0x2b563b[_0x82fd('0x3b')][_0x82fd('0x3c')]):_0x82fd('0x3f'),'browserVersion':_0x2b563b['browser']['version']||'unknown','osName':util[_0x82fd('0x3d')]('%s\x20%s',_0x2b563b['os'][_0x82fd('0x32')],_0x2b563b['os']['version']),'osVersion':_0x2b563b['os'][_0x82fd('0x3c')],'deviceModel':_0x2b563b[_0x82fd('0x40')][_0x82fd('0x41')]&&_0x2b563b[_0x82fd('0x40')][_0x82fd('0x42')]?util['format'](_0x82fd('0x43'),_0x2b563b[_0x82fd('0x40')]['model'],_0x2b563b[_0x82fd('0x40')][_0x82fd('0x42')],_0x2b563b[_0x82fd('0x40')][_0x82fd('0x44')]):null,'deviceVendor':_0x2b563b[_0x82fd('0x40')][_0x82fd('0x42')],'deviceType':_0x2b563b[_0x82fd('0x40')]['type'],'formData':JSON[_0x82fd('0x45')](_0x5de7dd)};}exports[_0x82fd('0x46')]=function(_0x564fbd,_0x1dbb1c){var _0x40a9ea={'include':[{'model':db[_0x82fd('0x47')],'as':_0x82fd('0x48')}]},_0x51244f={},_0x524d68={'count':0x0,'rows':[]};var _0x25b7d1=_[_0x82fd('0x49')](db[_0x82fd('0x4a')]['rawAttributes'],function(_0x5bb8b0){return{'name':_0x5bb8b0[_0x82fd('0x4b')],'type':_0x5bb8b0[_0x82fd('0x44')]['key']};});_0x51244f[_0x82fd('0x41')]=_['map'](_0x25b7d1,_0x82fd('0x32'));_0x51244f['query']=_[_0x82fd('0x4c')](_0x564fbd[_0x82fd('0x4d')]);_0x51244f['filters']=_[_0x82fd('0x4e')](_0x51244f[_0x82fd('0x41')],_0x51244f[_0x82fd('0x4d')]);_0x40a9ea[_0x82fd('0x4f')]=_['intersection'](_0x51244f[_0x82fd('0x41')],qs[_0x82fd('0x50')](_0x564fbd['query'][_0x82fd('0x50')]));_0x40a9ea[_0x82fd('0x4f')]=_0x40a9ea[_0x82fd('0x4f')]['length']?_0x40a9ea[_0x82fd('0x4f')]:_0x51244f[_0x82fd('0x41')];if(!_0x564fbd['query'][_0x82fd('0x51')](_0x82fd('0x52'))){_0x40a9ea['limit']=qs[_0x82fd('0x2b')](_0x564fbd['query'][_0x82fd('0x2b')]);_0x40a9ea[_0x82fd('0x29')]=qs[_0x82fd('0x29')](_0x564fbd['query'][_0x82fd('0x29')]);}_0x40a9ea[_0x82fd('0x53')]=qs[_0x82fd('0x54')](_0x564fbd['query']['sort']);_0x40a9ea[_0x82fd('0x55')]=qs[_0x82fd('0x56')](_[_0x82fd('0x57')](_0x564fbd[_0x82fd('0x4d')],_0x51244f['filters']),_0x25b7d1);if(_0x564fbd[_0x82fd('0x4d')][_0x82fd('0x58')]){_0x40a9ea[_0x82fd('0x55')]=_['merge'](_0x40a9ea[_0x82fd('0x55')],{'$or':_['map'](_0x25b7d1,function(_0x131a14){if(_0x131a14['type']!==_0x82fd('0x59')){var _0x4be9d7={};_0x4be9d7[_0x131a14[_0x82fd('0x32')]]={'$like':'%'+_0x564fbd[_0x82fd('0x4d')]['filter']+'%'};return _0x4be9d7;}})});}_0x40a9ea=_['merge']({},_0x40a9ea,_0x564fbd['options']);var _0x41528c={'where':_0x40a9ea[_0x82fd('0x55')]};return db[_0x82fd('0x4a')][_0x82fd('0x2a')](_0x41528c)[_0x82fd('0x1b')](function(_0x4b3e41){_0x524d68[_0x82fd('0x2a')]=_0x4b3e41;if(_0x564fbd[_0x82fd('0x4d')]['includeAll']){_0x40a9ea[_0x82fd('0x5a')]=[{'all':!![]}];}return db['ChatWebsite'][_0x82fd('0x5b')](_0x40a9ea);})[_0x82fd('0x1b')](function(_0x450160){_0x524d68[_0x82fd('0x5c')]=_0x450160;return _0x524d68;})['then'](respondWithFilteredResult(_0x1dbb1c,_0x40a9ea))[_0x82fd('0x24')](handleError(_0x1dbb1c,null));};exports[_0x82fd('0x5d')]=function(_0x367458,_0x138f5b){var _0x4840b4={'raw':![],'where':{'id':_0x367458[_0x82fd('0x5e')]['id']},'include':[{'model':db[_0x82fd('0x47')],'as':_0x82fd('0x48')}]},_0x2a4afa={};_0x2a4afa[_0x82fd('0x41')]=_[_0x82fd('0x4c')](db[_0x82fd('0x4a')]['rawAttributes']);_0x2a4afa[_0x82fd('0x4d')]=_[_0x82fd('0x4c')](_0x367458[_0x82fd('0x4d')]);_0x2a4afa['filters']=_[_0x82fd('0x4e')](_0x2a4afa[_0x82fd('0x41')],_0x2a4afa[_0x82fd('0x4d')]);_0x4840b4[_0x82fd('0x4f')]=_[_0x82fd('0x4e')](_0x2a4afa[_0x82fd('0x41')],qs[_0x82fd('0x50')](_0x367458[_0x82fd('0x4d')][_0x82fd('0x50')]));_0x4840b4[_0x82fd('0x4f')]=_0x4840b4[_0x82fd('0x4f')][_0x82fd('0x5f')]?_0x4840b4['attributes']:_0x2a4afa[_0x82fd('0x41')];if(_0x367458['query']['includeAll']){_0x4840b4['include']=[{'all':!![]}];}_0x4840b4=_[_0x82fd('0x60')]({},_0x4840b4,_0x367458[_0x82fd('0x61')]);return db[_0x82fd('0x4a')][_0x82fd('0x62')](_0x4840b4)[_0x82fd('0x1b')](handleEntityNotFound(_0x138f5b,null))[_0x82fd('0x1b')](respondWithResult(_0x138f5b,null))[_0x82fd('0x24')](handleError(_0x138f5b,null));};exports['create']=function(_0x2f8d62,_0x4308){if(!wildcardUtils[_0x82fd('0x63')](_0x2f8d62[_0x82fd('0x64')]['address'])){return handleError(_0x4308,null)(new APIBadRequestError('\x22'+_0x2f8d62[_0x82fd('0x64')]['address']+_0x82fd('0x65')));}return db[_0x82fd('0x4a')]['create'](_0x2f8d62['body'],{})['then'](function(_0x5f4105){var _0x3c5af6=_0x2f8d62['user'][_0x82fd('0x30')]({'plain':!![]});if(!_0x3c5af6)throw new Error(_0x82fd('0x66'));if(_0x3c5af6['role']==='user'){var _0x307622=_0x5f4105[_0x82fd('0x30')]({'plain':!![]});var _0x7ae699=_0x82fd('0x67');return db['UserProfileSection'][_0x82fd('0x62')]({'where':{'name':_0x7ae699,'userProfileId':_0x3c5af6[_0x82fd('0x68')]},'raw':!![]})['then'](function(_0x51d698){if(_0x51d698&&_0x51d698[_0x82fd('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x307622[_0x82fd('0x32')],'resourceId':_0x307622['id'],'type':_0x51d698[_0x82fd('0x32')],'sectionId':_0x51d698['id']},{})[_0x82fd('0x1b')](function(){return _0x5f4105;});}else{return _0x5f4105;}})[_0x82fd('0x24')](function(_0x983889){logger['error'](_0x82fd('0x6a'),_0x983889);throw _0x983889;});}return _0x5f4105;})[_0x82fd('0x1b')](respondWithResult(_0x4308,0xc9))[_0x82fd('0x24')](handleError(_0x4308,null));};exports[_0x82fd('0x2e')]=function(_0x50271e,_0x29ff25){if(!wildcardUtils[_0x82fd('0x63')](_0x50271e[_0x82fd('0x64')][_0x82fd('0x6b')])){return handleError(_0x29ff25,null)(new APIBadRequestError('\x22'+_0x50271e['body'][_0x82fd('0x6b')]+'\x22\x20is\x20not\x20a\x20valid\x20website\x20domain'));}if(_0x50271e[_0x82fd('0x64')]['id']){delete _0x50271e[_0x82fd('0x64')]['id'];}return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x50271e[_0x82fd('0x5e')]['id']},'include':[{'model':db[_0x82fd('0x47')],'as':_0x82fd('0x48')}]})[_0x82fd('0x1b')](handleEntityNotFound(_0x29ff25,null))[_0x82fd('0x1b')](saveUpdates(_0x50271e['body'],null))[_0x82fd('0x1b')](respondWithResult(_0x29ff25,null))[_0x82fd('0x24')](handleError(_0x29ff25,null));};exports[_0x82fd('0x2f')]=function(_0x4ffb2c,_0x5497ee){return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x4ffb2c[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x5497ee,null))[_0x82fd('0x1b')](removeEntity(_0x5497ee,null))[_0x82fd('0x24')](handleError(_0x5497ee,null));};exports[_0x82fd('0x6c')]=function(_0x3b0ddf,_0xc52771){return db[_0x82fd('0x4a')][_0x82fd('0x6c')]()[_0x82fd('0x1b')](respondWithResult(_0xc52771,null))[_0x82fd('0x24')](handleError(_0xc52771,null));};exports['addDisposition']=function(_0x16c62c,_0x102538){if(_0x16c62c[_0x82fd('0x64')]['id']){delete _0x16c62c[_0x82fd('0x64')]['id'];}return db['ChatWebsite'][_0x82fd('0x62')]({'where':{'id':_0x16c62c[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x102538,null))['then'](function(_0x307437){if(_0x307437){_0x16c62c[_0x82fd('0x64')][_0x82fd('0x6d')]=_0x307437['id'];return db[_0x82fd('0x6e')][_0x82fd('0x6f')](_0x16c62c[_0x82fd('0x64')]);}})['then'](respondWithResult(_0x102538,null))['catch'](handleError(_0x102538,null));};exports[_0x82fd('0x70')]=function(_0x271f3f,_0x5809fb){var _0x513b79={'raw':![],'where':{}};var _0x1753f5={};var _0x544894={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x82fd('0x71')]({'where':{'id':_0x271f3f['params']['id']}})['then'](handleEntityNotFound(_0x5809fb,null))[_0x82fd('0x1b')](function(_0xd1dcc2){if(_0xd1dcc2){_0x1753f5[_0x82fd('0x41')]=_['keys'](db[_0x82fd('0x6e')][_0x82fd('0x72')]);_0x1753f5['query']=_[_0x82fd('0x4c')](_0x271f3f['query']);_0x1753f5['filters']=_[_0x82fd('0x4e')](_0x1753f5[_0x82fd('0x41')],_0x1753f5['query']);_0x513b79['attributes']=_['intersection'](_0x1753f5[_0x82fd('0x41')],qs[_0x82fd('0x50')](_0x271f3f[_0x82fd('0x4d')][_0x82fd('0x50')]));_0x513b79[_0x82fd('0x4f')]=_0x513b79['attributes'][_0x82fd('0x5f')]?_0x513b79[_0x82fd('0x4f')]:_0x1753f5['model'];if(!_0x271f3f[_0x82fd('0x4d')][_0x82fd('0x51')](_0x82fd('0x52'))){_0x513b79['limit']=qs['limit'](_0x271f3f['query']['limit']);_0x513b79[_0x82fd('0x29')]=qs['offset'](_0x271f3f[_0x82fd('0x4d')][_0x82fd('0x29')]);}_0x513b79[_0x82fd('0x53')]=qs[_0x82fd('0x54')](_0x271f3f[_0x82fd('0x4d')][_0x82fd('0x54')]);_0x513b79[_0x82fd('0x55')]=qs[_0x82fd('0x56')](_['pick'](_0x271f3f[_0x82fd('0x4d')],_0x1753f5[_0x82fd('0x56')]));_0x513b79['where'][_0x82fd('0x6d')]=_0xd1dcc2['id'];if(_0x271f3f[_0x82fd('0x4d')][_0x82fd('0x58')]){_0x513b79[_0x82fd('0x55')]=_['merge'](_0x513b79[_0x82fd('0x55')],{'$or':_['map'](_0x513b79[_0x82fd('0x4f')],function(_0xebfc77){var _0x33b58d={};_0x33b58d[_0xebfc77]={'$like':'%'+_0x271f3f['query'][_0x82fd('0x58')]+'%'};return _0x33b58d;})});}_0x513b79=_['merge']({},_0x513b79,_0x271f3f[_0x82fd('0x61')]);return db['Disposition'][_0x82fd('0x2a')]({'where':_0x513b79['where']})[_0x82fd('0x1b')](function(_0xf508a4){_0x544894[_0x82fd('0x2a')]=_0xf508a4;if(_0x271f3f[_0x82fd('0x4d')][_0x82fd('0x73')]){_0x513b79[_0x82fd('0x5a')]=[{'all':!![]}];}return db[_0x82fd('0x6e')]['findAll'](_0x513b79);})[_0x82fd('0x1b')](function(_0x2c6a6f){_0x544894['rows']=_0x2c6a6f;return _0x544894;});}})['then'](respondWithFilteredResult(_0x5809fb,_0x513b79))[_0x82fd('0x24')](handleError(_0x5809fb,null));};exports['removeDispositions']=function(_0x36028e,_0xe8dd9e){return db['ChatWebsite'][_0x82fd('0x62')]({'where':{'id':_0x36028e[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0xe8dd9e,null))['then'](function(_0x26896b){if(_0x26896b){return _0x26896b[_0x82fd('0x74')](_0x36028e['query']['ids']);}})[_0x82fd('0x1b')](respondWithStatusCode(_0xe8dd9e,null))[_0x82fd('0x24')](handleError(_0xe8dd9e,null));};exports['addAnswer']=function(_0x3fa3f7,_0x33f27f){if(_0x3fa3f7[_0x82fd('0x64')]['id']){delete _0x3fa3f7['body']['id'];}return db[_0x82fd('0x4a')]['find']({'where':{'id':_0x3fa3f7[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x33f27f,null))[_0x82fd('0x1b')](function(_0x36dc1e){if(_0x36dc1e){_0x3fa3f7[_0x82fd('0x64')][_0x82fd('0x6d')]=_0x36dc1e['id'];return db[_0x82fd('0x75')][_0x82fd('0x6f')](_0x3fa3f7[_0x82fd('0x64')]);}})[_0x82fd('0x1b')](respondWithResult(_0x33f27f,null))[_0x82fd('0x24')](handleError(_0x33f27f,null));};exports[_0x82fd('0x76')]=function(_0x39c777,_0x2b9f6f){var _0x3989fa={'raw':![],'where':{}};var _0x51a87f={};var _0x2eb407={'count':0x0,'rows':[]};return db[_0x82fd('0x4a')][_0x82fd('0x71')]({'where':{'id':_0x39c777[_0x82fd('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2b9f6f,null))[_0x82fd('0x1b')](function(_0x23ac9d){if(_0x23ac9d){_0x51a87f[_0x82fd('0x41')]=_['keys'](db['CannedAnswer'][_0x82fd('0x72')]);_0x51a87f[_0x82fd('0x4d')]=_[_0x82fd('0x4c')](_0x39c777['query']);_0x51a87f[_0x82fd('0x56')]=_[_0x82fd('0x4e')](_0x51a87f[_0x82fd('0x41')],_0x51a87f[_0x82fd('0x4d')]);_0x3989fa['attributes']=_[_0x82fd('0x4e')](_0x51a87f[_0x82fd('0x41')],qs['fields'](_0x39c777[_0x82fd('0x4d')][_0x82fd('0x50')]));_0x3989fa[_0x82fd('0x4f')]=_0x3989fa[_0x82fd('0x4f')][_0x82fd('0x5f')]?_0x3989fa[_0x82fd('0x4f')]:_0x51a87f[_0x82fd('0x41')];if(!_0x39c777[_0x82fd('0x4d')][_0x82fd('0x51')](_0x82fd('0x52'))){_0x3989fa['limit']=qs['limit'](_0x39c777[_0x82fd('0x4d')]['limit']);_0x3989fa[_0x82fd('0x29')]=qs['offset'](_0x39c777[_0x82fd('0x4d')][_0x82fd('0x29')]);}_0x3989fa['order']=qs[_0x82fd('0x54')](_0x39c777['query'][_0x82fd('0x54')]);_0x3989fa[_0x82fd('0x55')]=qs[_0x82fd('0x56')](_[_0x82fd('0x57')](_0x39c777[_0x82fd('0x4d')],_0x51a87f[_0x82fd('0x56')]));_0x3989fa[_0x82fd('0x55')][_0x82fd('0x6d')]=_0x23ac9d['id'];if(_0x39c777[_0x82fd('0x4d')][_0x82fd('0x58')]){_0x3989fa[_0x82fd('0x55')]=_['merge'](_0x3989fa[_0x82fd('0x55')],{'$or':_['map'](_0x3989fa[_0x82fd('0x4f')],function(_0x3df4dd){var _0x4f041c={};_0x4f041c[_0x3df4dd]={'$like':'%'+_0x39c777[_0x82fd('0x4d')]['filter']+'%'};return _0x4f041c;})});}_0x3989fa=_[_0x82fd('0x60')]({},_0x3989fa,_0x39c777[_0x82fd('0x61')]);return db['CannedAnswer'][_0x82fd('0x2a')]({'where':_0x3989fa[_0x82fd('0x55')]})[_0x82fd('0x1b')](function(_0x106c70){_0x2eb407[_0x82fd('0x2a')]=_0x106c70;if(_0x39c777['query'][_0x82fd('0x73')]){_0x3989fa[_0x82fd('0x5a')]=[{'all':!![]}];}return db[_0x82fd('0x75')][_0x82fd('0x5b')](_0x3989fa);})[_0x82fd('0x1b')](function(_0x4dfe1c){_0x2eb407[_0x82fd('0x5c')]=_0x4dfe1c;return _0x2eb407;});}})[_0x82fd('0x1b')](respondWithFilteredResult(_0x2b9f6f,_0x3989fa))[_0x82fd('0x24')](handleError(_0x2b9f6f,null));};exports[_0x82fd('0x77')]=function(_0x57ae7e,_0x4c6cff){return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x57ae7e[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x4c6cff,null))[_0x82fd('0x1b')](function(_0x297c5c){if(_0x297c5c){return _0x297c5c[_0x82fd('0x77')](_0x57ae7e[_0x82fd('0x4d')][_0x82fd('0x78')]);}})[_0x82fd('0x1b')](respondWithStatusCode(_0x4c6cff,null))[_0x82fd('0x24')](handleError(_0x4c6cff,null));};exports[_0x82fd('0x79')]=function(_0x2b4f8f,_0x564b1d){_0x2b4f8f[_0x82fd('0x64')][_0x82fd('0x7a')]=_0x2b4f8f['file'][_0x82fd('0x7b')];return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x2b4f8f[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x564b1d,null))['then'](saveUpdates(_0x2b4f8f['body'],null))[_0x82fd('0x1b')](respondWithResult(_0x564b1d,null))[_0x82fd('0x24')](handleError(_0x564b1d,null));};exports[_0x82fd('0x7c')]=function(_0x7b653d,_0xe77b41){_0x7b653d['body'][_0x82fd('0x7d')]=_0x7b653d['file'][_0x82fd('0x7b')];return db['ChatWebsite'][_0x82fd('0x62')]({'where':{'id':_0x7b653d['params']['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0xe77b41,null))[_0x82fd('0x1b')](saveUpdates(_0x7b653d[_0x82fd('0x64')],null))[_0x82fd('0x1b')](respondWithResult(_0xe77b41,null))[_0x82fd('0x24')](handleError(_0xe77b41,null));};exports[_0x82fd('0x7e')]=function(_0x4e9419,_0x1005e1){_0x4e9419[_0x82fd('0x64')][_0x82fd('0x7f')]=_0x4e9419['file'][_0x82fd('0x7b')];return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x4e9419[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x1005e1,null))[_0x82fd('0x1b')](saveUpdates(_0x4e9419['body'],null))['then'](respondWithResult(_0x1005e1,null))['catch'](handleError(_0x1005e1,null));};exports['addSystemAvatar']=function(_0x1d0ef8,_0x1afa11){_0x1d0ef8[_0x82fd('0x64')][_0x82fd('0x80')]=_0x1d0ef8['file'][_0x82fd('0x7b')];return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x1d0ef8[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x1afa11,null))[_0x82fd('0x1b')](saveUpdates(_0x1d0ef8[_0x82fd('0x64')],null))[_0x82fd('0x1b')](respondWithResult(_0x1afa11,null))['catch'](handleError(_0x1afa11,null));};exports[_0x82fd('0x81')]=function(_0x5049a6,_0x39b24f){var _0x341875=path[_0x82fd('0x82')](config['root'],_0x82fd('0x83'));var _0x197ab3={'where':{'id':_0x5049a6[_0x82fd('0x5e')]['id']},'attributes':['id',_0x82fd('0x7a')],'raw':!![]};var _0x5e1297=![];return require(_0x82fd('0x84'))[_0x82fd('0x85')]()[_0x82fd('0x1b')](function(_0x4dd6e9){if(_0x4dd6e9){_0x5e1297=_0x4dd6e9[_0x82fd('0x86')];}})['then'](function(){return db[_0x82fd('0x4a')][_0x82fd('0x62')](_0x197ab3);})[_0x82fd('0x1b')](handleEntityNotFound(_0x39b24f,null))[_0x82fd('0x1b')](function(_0x247e90){if(_0x247e90){if(!_[_0x82fd('0x87')](_0x247e90[_0x82fd('0x7a')])){if(fs[_0x82fd('0x88')](path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x8a'),_0x247e90[_0x82fd('0x7a')]))&&_0x5e1297){_0x341875=path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x8a'),_0x247e90[_0x82fd('0x7a')]);}}return _0x39b24f['download'](_0x341875);}})[_0x82fd('0x24')](handleError(_0x39b24f,null));};exports[_0x82fd('0x8b')]=function(_0x1a8242,_0x5846be){var _0x2ef6e9=path[_0x82fd('0x82')](config[_0x82fd('0x89')],'server/files/images/avatars/default_avatar.png');var _0x4ff401={'where':{'id':_0x1a8242['params']['id']},'attributes':['id',_0x82fd('0x7d')],'raw':!![]};return db[_0x82fd('0x4a')][_0x82fd('0x62')](_0x4ff401)['then'](handleEntityNotFound(_0x5846be,null))['then'](function(_0x47000a){if(_0x47000a){if(!_[_0x82fd('0x87')](_0x47000a[_0x82fd('0x7d')])){if(fs['existsSync'](path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x8c'),_0x47000a['agentAvatar']))){_0x2ef6e9=path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x8c'),_0x47000a[_0x82fd('0x7d')]);}}return _0x5846be['download'](_0x2ef6e9);}})['catch'](handleError(_0x5846be,null));};exports[_0x82fd('0x8d')]=function(_0x3ef1b4,_0x2870cb){var _0x145df7=path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x8e'));var _0x118b0f={'where':{'id':_0x3ef1b4['params']['id']},'attributes':['id','customerAvatar',_0x82fd('0x8f')],'raw':!![]};return db[_0x82fd('0x4a')][_0x82fd('0x62')](_0x118b0f)[_0x82fd('0x1b')](handleEntityNotFound(_0x2870cb,null))['then'](function(_0x529c26){if(_0x529c26){if(!_['isNil'](_0x529c26[_0x82fd('0x7f')])){if(fs[_0x82fd('0x88')](path[_0x82fd('0x82')](config['root'],_0x82fd('0x8c'),_0x529c26['customerAvatar']))&&_0x529c26[_0x82fd('0x8f')]){_0x145df7=path['join'](config['root'],_0x82fd('0x8c'),_0x529c26[_0x82fd('0x7f')]);}}return _0x2870cb[_0x82fd('0x90')](_0x145df7);}})[_0x82fd('0x24')](handleError(_0x2870cb,null));};exports['getSystemAvatar']=function(_0x57a2a0,_0x5dde69){var _0x17013c=path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x91'));var _0x3db05a={'where':{'id':_0x57a2a0[_0x82fd('0x5e')]['id']},'attributes':['id',_0x82fd('0x80')],'raw':!![]};return db['ChatWebsite'][_0x82fd('0x62')](_0x3db05a)[_0x82fd('0x1b')](handleEntityNotFound(_0x5dde69,null))[_0x82fd('0x1b')](function(_0x34a776){if(_0x34a776){if(!_[_0x82fd('0x87')](_0x34a776[_0x82fd('0x80')])){if(fs[_0x82fd('0x88')](path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x8c'),_0x34a776[_0x82fd('0x80')]))){_0x17013c=path['join'](config['root'],_0x82fd('0x8c'),_0x34a776['systemAvatar']);}}return _0x5dde69[_0x82fd('0x90')](_0x17013c);}})[_0x82fd('0x24')](handleError(_0x5dde69,null));};function checkWebsiteInterval(_0x2db774){var _0x1d07bc=_0x2db774[_0x82fd('0x92')];if(!_0x1d07bc){return Promise[_0x82fd('0x93')](_0x2db774);}var _0x21b3bb=_0x2db774[_0x82fd('0x94')]||undefined;return _0x1d07bc[_0x82fd('0x95')](_0x21b3bb)[_0x82fd('0x1b')](function(_0x4806a9){if(!_0x4806a9){throw new APIOutOfIntervalError();}return _0x2db774;});}exports['notify']=function(_0x2dda58,_0x9d8bf5){var _0x38f327={'body':_0x2dda58[_0x82fd('0x64')],'channel':'chat'};var _0x2e1a66=[];var _0xbf89f2=[];var _0x4a8e86={};var _0x5d24f2=![];if(_0x2dda58['body']['id']){delete _0x2dda58[_0x82fd('0x64')]['id'];}if(_[_0x82fd('0x87')](_0x2dda58[_0x82fd('0x64')][_0x82fd('0x96')])){throw new APIBadRequestError(_0x82fd('0x97'));}if(_[_0x82fd('0x87')](_0x2dda58['body'][_0x82fd('0x98')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x2dda58['body'][_0x82fd('0x64')])){throw new APIBadRequestError(_0x82fd('0x99'));}var _0x2eccd7=_0x2dda58['body'][_0x82fd('0x35')]&&_0x2dda58[_0x82fd('0x64')][_0x82fd('0x3a')];return db[_0x82fd('0x9a')][_0x82fd('0x6c')]()['then'](function(_0x30c104){if(!_0x30c104){throw new Error(_0x82fd('0x9b'));}_0x2e1a66=Object['keys'](_0x30c104)[_0x82fd('0x58')](function(_0x170e39){return!['createdAt',_0x82fd('0x9c')][_0x82fd('0x9d')](_0x170e39);});_0xbf89f2=Object[_0x82fd('0x4c')](_0x30c104)[_0x82fd('0x58')](function(_0x27b2c0){return![_0x82fd('0x9e'),_0x82fd('0x9c'),'CompanyId',_0x82fd('0x9f')][_0x82fd('0x9d')](_0x27b2c0);});if(!_[_0x82fd('0x9d')](_0xbf89f2,_0x2dda58[_0x82fd('0x64')][_0x82fd('0x98')])){throw new APIBadRequestError(_0x82fd('0xa0')+_0xbf89f2[_0x82fd('0x82')](',\x20'));}_0x4a8e86[_0x2dda58[_0x82fd('0x64')][_0x82fd('0x98')]]=_0x2dda58[_0x82fd('0x64')][_0x82fd('0x96')];})[_0x82fd('0x1b')](function(){return db[_0x82fd('0x4a')]['find']({'where':{'id':_0x2dda58['params']['id']},'include':[{'model':db['CmList'],'as':_0x82fd('0xa1'),'include':[{'model':db[_0x82fd('0x9a')],'as':_0x82fd('0xa2'),'where':_0x4a8e86,'limit':0x1,'order':[[_0x82fd('0x9c'),_0x82fd('0xa3')]]}]},{'model':db[_0x82fd('0xa4')],'as':_0x82fd('0xa5')},{'model':db[_0x82fd('0x92')],'as':_0x82fd('0x92'),'include':[{'model':db['Interval'],'as':_0x82fd('0xa6'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x34bc6e){if(!_0x34bc6e){throw new APINotFoundError(util[_0x82fd('0x3d')](_0x82fd('0xa7'),_0x2dda58[_0x82fd('0x5e')]['id']));}if(_0x2eccd7){return checkWebsiteInterval(_0x34bc6e);}return _0x34bc6e;})[_0x82fd('0x1b')](function(_0x5e6720){_0x38f327[_0x82fd('0xa8')]=_0x5e6720;_0x38f327['applications']=_[_0x82fd('0xa9')](_0x5e6720[_0x82fd('0xa5')],[_0x82fd('0xaa')],['asc']);if(_0x38f327[_0x82fd('0xa8')][_0x82fd('0xa5')]){delete _0x38f327[_0x82fd('0xa8')]['Applications'];}_0x38f327[_0x82fd('0xab')]=_0x5e6720['List']||{'id':_0x5e6720[_0x82fd('0x9f')]};if(_0x38f327[_0x82fd('0xab')]&&_0x38f327[_0x82fd('0xab')]['Contacts'][_0x82fd('0x5f')]){return _0x38f327[_0x82fd('0xab')][_0x82fd('0xa2')][0x0];}var _0x1ed583=_[_0x82fd('0x14')](_0x2dda58[_0x82fd('0x64')],{'firstName':_0x2dda58[_0x82fd('0x64')][_0x82fd('0x96')],'ListId':_0x5e6720[_0x82fd('0x9f')]});_0x1ed583[_0x2dda58[_0x82fd('0x64')][_0x82fd('0x98')]]=_0x2dda58[_0x82fd('0x64')][_0x82fd('0x96')];return db[_0x82fd('0x9a')]['create'](_0x1ed583,{'fields':_0x2e1a66,'raw':!![]});})[_0x82fd('0x1b')](function(_0x3afda8){_0x38f327[_0x82fd('0xac')]=_0x3afda8;var _0x20dbe3=createInteractionObject(_0x2dda58[_0x82fd('0x5e')]['id'],_0x2dda58[_0x82fd('0x64')],_0x2dda58[_0x82fd('0xad')],_0x3afda8);var _0x231714={'ChatWebsiteId':_0x2dda58[_0x82fd('0x5e')]['id']};if(_0x2dda58[_0x82fd('0x64')][_0x82fd('0xae')]){_0x231714[_0x82fd('0xae')]=_0x2dda58[_0x82fd('0x64')]['threadId'];_0x231714[_0x82fd('0xaf')]=![];return db['ChatInteraction'][_0x82fd('0x62')]({'where':_0x231714})[_0x82fd('0x1b')](function(_0x10c9ac){var _0x34d15d=_0x2dda58[_0x82fd('0x64')][_0x82fd('0x35')]&&_0x2dda58[_0x82fd('0x64')]['referer'];if(_0x10c9ac){_0x5d24f2=!![];return _0x10c9ac;}else if(!_0x34d15d&&_0x10c9ac&&_0x10c9ac[_0x82fd('0xaf')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}_0x20dbe3[_0x82fd('0xae')]=_0x2dda58[_0x82fd('0x64')][_0x82fd('0xae')];_0x20dbe3[_0x82fd('0xb0')]=_0x2dda58[_0x82fd('0x64')][_0x82fd('0xb0')];return db['ChatInteraction'][_0x82fd('0x6f')](_0x20dbe3);});}_0x231714[_0x82fd('0xb1')]=_0x3afda8['id'];if(_0x2dda58[_0x82fd('0x64')][_0x82fd('0xb2')]&&_0x2dda58['body']['interaction']['id']){_0x231714['id']=_0x2dda58[_0x82fd('0x64')]['interaction']['id'];return db[_0x82fd('0xb3')][_0x82fd('0x62')]({'where':_0x231714})[_0x82fd('0x1b')](function(_0x262602){var _0x3c1e38=_0x2dda58[_0x82fd('0x64')][_0x82fd('0x35')]&&_0x2dda58[_0x82fd('0x64')][_0x82fd('0x3a')];if(!_0x3c1e38&&_0x262602&&_0x262602['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x262602){_0x5d24f2=!![];return _0x262602;}else{return db[_0x82fd('0xb3')]['create'](_0x20dbe3);}});}return db[_0x82fd('0xb3')][_0x82fd('0x6f')](_0x20dbe3);})['then'](function(_0x4f6b9d){if(!_0x5d24f2){return _0x4f6b9d;}var _0x1e5271={'from':(_0x38f327[_0x82fd('0xac')]['firstName']||'')+'\x20'+(_0x38f327[_0x82fd('0xac')]['lastName']||'')};if(_0x2dda58['body'][_0x82fd('0xae')]&&_0x2dda58[_0x82fd('0x64')][_0x82fd('0xb4')]&&_0x2dda58['body'][_0x82fd('0xae')]!=_0x2dda58[_0x82fd('0x64')][_0x82fd('0xb4')]){_0x1e5271[_0x82fd('0xae')]=_0x2dda58[_0x82fd('0x64')][_0x82fd('0xb4')];}return _0x4f6b9d[_0x82fd('0x2e')](_0x1e5271);})[_0x82fd('0x1b')](function(_0x229ce5){_0x38f327[_0x82fd('0xb2')]=_0x229ce5['get']({'plain':!![]});_0x38f327[_0x82fd('0xb2')][_0x82fd('0xb5')]=!_0x5d24f2;if(_0x38f327[_0x82fd('0xb2')][_0x82fd('0xb5')]){if(_0x38f327['account']['autoclose']){_0x38f327['applications'][_0x82fd('0xb6')]({'id':0x0,'priority':_0x38f327['applications'][_0x82fd('0x5f')]+0x1,'app':_0x82fd('0xb7'),'appdata':_0x82fd('0xb8'),'interval':_0x82fd('0xb9')});}}return db[_0x82fd('0xba')][_0x82fd('0x6f')]({'body':_0x2dda58[_0x82fd('0x64')][_0x82fd('0x64')],'ChatWebsiteId':_0x2dda58[_0x82fd('0x5e')]['id'],'ChatInteractionId':_0x229ce5['id'],'direction':'in','ContactId':_0x38f327[_0x82fd('0xac')]['id'],'AttachmentId':_0x2dda58[_0x82fd('0x64')][_0x82fd('0xbb')]});})[_0x82fd('0x1b')](function(_0x4a4374){_0x38f327['message']=_0x4a4374;if(!_0x38f327['interaction'][_0x82fd('0xbc')]){return;}return db['User'][_0x82fd('0x62')]({'attributes':['id',_0x82fd('0x32')],'where':{'id':_0x38f327[_0x82fd('0xb2')][_0x82fd('0xbc')]}});})[_0x82fd('0x1b')](function(_0x46b2a3){if(_0x46b2a3){_0x38f327[_0x82fd('0xbd')][_0x82fd('0xbe')]({'id':0x0,'priority':0x0,'app':_0x82fd('0xbf'),'appdata':_0x46b2a3['name']+','+(_0x38f327['account'][_0x82fd('0xc0')]||0xa),'interval':'*,*,*,*'});_0x38f327[_0x82fd('0xc1')]=!![];}if(!_0x38f327['interaction']['queueId']){return;}return db['ChatQueue'][_0x82fd('0x62')]({'attributes':['id','name'],'where':{'id':_0x38f327['interaction']['queueId']}});})[_0x82fd('0x1b')](function(_0x3958b7){if(_0x3958b7){_0x38f327[_0x82fd('0xbd')]['unshift']({'id':0x0,'priority':0x1,'app':_0x82fd('0xc2'),'appdata':_0x3958b7['name']+','+(_0x38f327[_0x82fd('0xa8')][_0x82fd('0xc3')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x82fd('0xc4'),_0x82fd('0xc5'),_0x38f327);})[_0x82fd('0x1b')](function(_0x5ead03){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x5ead03},client9002);return _0x5ead03;})[_0x82fd('0x1b')](respondWithResult(_0x9d8bf5,null))[_0x82fd('0x24')](APIHandleError(_0x9d8bf5));};exports[_0x82fd('0xc6')]=function(_0x427170,_0x43a62d){var _0x9e0c50,_0x49722d,_0x3e5548;var _0x375ae1=[];var _0x54620b={};var _0x59d927=_0x427170['files']||[];var _0xaa2272=[];var _0x450fdb;return db['CmContact']['describe']()[_0x82fd('0x1b')](function(_0x2887f0){if(!_0x2887f0){throw new db[(_0x82fd('0xc7'))][(_0x82fd('0xc8'))](_0x82fd('0xc9'));}_0x375ae1=_[_0x82fd('0xca')](_[_0x82fd('0x4c')](_0x2887f0),[_0x82fd('0x9e'),'updatedAt',_0x82fd('0xcb'),_0x82fd('0x9f')]);if(_0x427170[_0x82fd('0x64')]['id']){delete _0x427170['body']['id'];}if(_[_0x82fd('0x87')](_0x427170[_0x82fd('0x64')][_0x82fd('0x96')])){throw _0x43a62d[_0x82fd('0x26')](0x1f4)[_0x82fd('0x33')](new db['Sequelize'][(_0x82fd('0xc8'))]('from\x20is\x20mandatory'));}if(_[_0x82fd('0x87')](_0x427170[_0x82fd('0x64')][_0x82fd('0x64')])||_0x427170[_0x82fd('0x64')][_0x82fd('0x64')]===''){throw _0x43a62d[_0x82fd('0x26')](0x1f4)[_0x82fd('0x33')](new db[(_0x82fd('0xc7'))][(_0x82fd('0xc8'))](_0x82fd('0xcc')));}if(_[_0x82fd('0x87')](_0x427170['body'][_0x82fd('0xcd')])){throw _0x43a62d[_0x82fd('0x26')](0x1f4)[_0x82fd('0x33')](new db[(_0x82fd('0xc7'))][(_0x82fd('0xc8'))](_0x82fd('0xce')+_0x375ae1));}if(!_['includes'](_0x375ae1,_0x427170['body'][_0x82fd('0xcd')])){throw _0x43a62d[_0x82fd('0x26')](0x1f4)[_0x82fd('0x33')](new db[(_0x82fd('0xc7'))][(_0x82fd('0xc8'))](_0x82fd('0xcf')+_0x375ae1));}_0x54620b[_0x427170[_0x82fd('0x64')][_0x82fd('0xcd')]]=_0x427170[_0x82fd('0x64')][_0x82fd('0x96')];})[_0x82fd('0x1b')](function(){return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x427170['params']['id']},'include':[{'model':db[_0x82fd('0xd0')],'as':_0x82fd('0xa1')},{'model':db[_0x82fd('0xd1')],'as':_0x82fd('0xd1')}]});})[_0x82fd('0x1b')](handleEntityNotFound(_0x43a62d,null))[_0x82fd('0x1b')](function(_0x346fb0){if(_0x346fb0&&_0x346fb0[_0x82fd('0xa1')]){_0x49722d=_0x346fb0;var _0x14d680=_['defaults'](_0x427170[_0x82fd('0x64')],{'firstName':_0x427170[_0x82fd('0x64')][_0x82fd('0x96')],'phone':_0x427170['body'][_0x82fd('0x96')],'ListId':_0x346fb0[_0x82fd('0x9f')]});_0x14d680[_0x427170[_0x82fd('0x64')][_0x82fd('0xcd')]]=_0x427170[_0x82fd('0x64')][_0x82fd('0x96')];return db[_0x82fd('0x9a')]['findOrCreate']({'where':_0x54620b,'defaults':_0x14d680});}})[_0x82fd('0xd2')](function(_0x4bbb4c){if(_0x4bbb4c){_0x3e5548=_0x4bbb4c;var _0x1f6e5c=fs[_0x82fd('0xd3')](path[_0x82fd('0x82')](config['root'],_0x82fd('0xd4')),_0x82fd('0xd5'));var _0x1108ab=ejs[_0x82fd('0xd6')](_0x1f6e5c,{'body':_[_0x82fd('0xd7')](_0x427170[_0x82fd('0x64')][_0x82fd('0x64')]),'bodyTitle':_0x49722d[_0x82fd('0xd8')]});return db['ChatOfflineMessage'][_0x82fd('0x6f')]({'body':_0x1108ab,'plainBody':htmlToText[_0x82fd('0xd9')](_0x1108ab),'ContactId':_0x4bbb4c['id'],'ChatWebsiteId':_0x49722d['id']});}})['then'](function(_0x269995){_0x450fdb=_0x269995;if(_0x59d927[_0x82fd('0x5f')]){var _0xa5bcb0=_0x59d927[_0x82fd('0x49')](function(_0x310a7b){return{'name':_0x310a7b[_0x82fd('0xda')],'basename':_0x310a7b[_0x82fd('0x7b')],'type':_0x310a7b[_0x82fd('0xdb')],'ChatOfflineMessageId':_0x269995['id']};});_0xaa2272=_0xa5bcb0[_0x82fd('0x49')](_0x5ab904=>{var _0xc0aba6={'filename':_0x5ab904[_0x82fd('0x32')],'path':path[_0x82fd('0x82')](config['root'],_0x82fd('0xdc'),_0x82fd('0xdd'),_0x82fd('0xde'),_0x82fd('0xdf'),_0x5ab904[_0x82fd('0xe0')])};return _0xc0aba6;});if(!_0x49722d[_0x82fd('0xe1')]){return db[_0x82fd('0xe2')][_0x82fd('0xe3')](function(_0x27ecf6){return db[_0x82fd('0xe4')]['bulkCreate'](_0xa5bcb0,{'transaction':_0x27ecf6});});}}})['then'](function(){if(_0x450fdb){_0x9e0c50=_0x450fdb;return db['MailAccount'][_0x82fd('0x71')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x82fd('0xe5'),'raw':!![],'include':[{'model':db[_0x82fd('0xe6')],'as':_0x82fd('0xe6'),'raw':!![]}]}]});}})[_0x82fd('0x1b')](function(_0x48f560){if(_0x48f560&&_0x48f560[_0x82fd('0xe5')]&&_0x49722d[_0x82fd('0xe7')]&&_0x49722d['forwardOfflineAddress']){var _0x383a41=_0x48f560[_0x82fd('0xe8')]();return respondWithRpcPromise(_0x82fd('0xe9'),_0x82fd('0xea'),{'account':_0x383a41,'message':{'from':util[_0x82fd('0x3d')](_0x82fd('0xeb'),_0x48f560['name'],_0x48f560[_0x82fd('0xec')]||_0x48f560[_0x82fd('0xe5')]['user']),'to':_0x49722d[_0x82fd('0xed')],'subject':_0x49722d[_0x82fd('0xee')],'html':_0x9e0c50[_0x82fd('0x64')],'attachments':_0xaa2272}},client9003)['then'](function(){return _0x9e0c50;})[_0x82fd('0x24')](function(_0x3be800){logger['error'](_0x3be800);});}})['then'](function(){if(_0x49722d&&_0x49722d[_0x82fd('0xe1')]&&_0x49722d[_0x82fd('0xef')]){var _0x2815bf=[];if(_0x59d927[_0x82fd('0x5f')]){_0x2815bf=_0x59d927[_0x82fd('0x49')](function(_0x358b63){return{'name':_0x358b63[_0x82fd('0xda')],'basename':_0x358b63[_0x82fd('0x7b')],'type':_0x358b63['mimetype'],'ChatOfflineMessageId':_0x450fdb['id']};});}var _0x191ba0;if(!_[_0x82fd('0x87')](_0x49722d['subjectOffline'])){var _0x10d696=_[_0x82fd('0x49')](_0x427170[_0x82fd('0x64')],function(_0x2e6a6a){return _0x2e6a6a;});var _0x490233=_[_0x82fd('0xf0')](_0x10d696)[0x0];var _0x3a8ab7=_[_0x82fd('0xf1')](_0x490233,function(_0x542418){return _0x542418;});_0x191ba0=_0x3a8ab7[0x1][_0x49722d[_0x82fd('0xf2')]];}var _0x23c1bd={'from':_0x3e5548[_0x82fd('0xec')],'firstName':_0x3e5548['firstName'],'lastName':_0x3e5548['lastName'],'mapKey':_0x82fd('0xec'),'message':{'from':_0x3e5548['email'],'to':_0x49722d[_0x82fd('0xd1')]['email'],'cc':'','subject':_['isNil'](_0x191ba0)?_0x49722d[_0x82fd('0xee')]:_0x191ba0,'messageId':'','sentAt':new Date(),'attach':_0x2815bf[_0x82fd('0x5f')],'attachments':_0x2815bf,'originChannel':_0x82fd('0xf3'),'ChatWebsiteId':_0x49722d['id'],'ChatOfflineMessageId':_0x9e0c50['id'],'originTo':_0x49722d[_0x82fd('0xd1')]['email']},'body':_0x9e0c50[_0x82fd('0x64')]};var _0x15b9cb={'account':{'id':_0x49722d['MailAccountId']},'body':_0x23c1bd,'log':_0x82fd('0xf4')};return respondWithRpcPromise(_0x82fd('0xf4'),_0x82fd('0xf5'),_0x15b9cb,client9001)['then'](function(){return _0x9e0c50;})[_0x82fd('0x24')](function(_0x411052){logger[_0x82fd('0x20')](_0x411052);});}return;})[_0x82fd('0x1b')](function(){if(_0x9e0c50){return _0x9e0c50;}})[_0x82fd('0x1b')](respondWithResult(_0x43a62d,null))['catch'](function(){for(var _0x2f70b7 of _0x59d927){var _0x2d84df=path[_0x82fd('0x82')](config[_0x82fd('0x89')],'server','files',_0x82fd('0xde'),_0x82fd('0xdf'),_0x2f70b7[_0x82fd('0x7b')]);fs_extra['remove'](_0x2d84df)[_0x82fd('0x24')](function(_0x5ac9fe){logger[_0x82fd('0x20')]('Could\x20not\x20remove\x20attachment\x20file',_0x2d84df,_0x5ac9fe);});}});};exports['addInteraction']=function(_0x282c08,_0x27965a){return db[_0x82fd('0xb3')][_0x82fd('0x62')]({'where':{'id':_0x282c08[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x27965a,null))[_0x82fd('0x1b')](function(_0x103004){if(_0x103004){return _0x103004['addInteraction'](_0x282c08['body'][_0x82fd('0x78')],_[_0x82fd('0xf6')](_0x282c08['body'],[_0x82fd('0x78'),'id'])||{});}})['then'](respondWithResult(_0x27965a,null))[_0x82fd('0x24')](handleError(_0x27965a,null));};exports[_0x82fd('0xf7')]=function(_0x209eff,_0x56cdef){var _0x53d744={'raw':![],'where':{}};var _0x2935b1={};var _0x5db040={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x82fd('0x71')]({'where':{'id':_0x209eff[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x56cdef,null))[_0x82fd('0x1b')](function(_0x44cb2d){if(_0x44cb2d){_0x2935b1['model']=_['keys'](db[_0x82fd('0xb3')][_0x82fd('0x72')]);_0x2935b1['query']=_[_0x82fd('0x4c')](_0x209eff[_0x82fd('0x4d')]);_0x2935b1['filters']=_[_0x82fd('0x4e')](_0x2935b1['model'],_0x2935b1[_0x82fd('0x4d')]);_0x53d744[_0x82fd('0x4f')]=_[_0x82fd('0x4e')](_0x2935b1[_0x82fd('0x41')],qs[_0x82fd('0x50')](_0x209eff[_0x82fd('0x4d')]['fields']));_0x53d744['attributes']=_0x53d744[_0x82fd('0x4f')][_0x82fd('0x5f')]?_0x53d744[_0x82fd('0x4f')]:_0x2935b1['model'];if(!_0x209eff['query'][_0x82fd('0x51')](_0x82fd('0x52'))){_0x53d744[_0x82fd('0x2b')]=qs[_0x82fd('0x2b')](_0x209eff[_0x82fd('0x4d')][_0x82fd('0x2b')]);_0x53d744[_0x82fd('0x29')]=qs[_0x82fd('0x29')](_0x209eff[_0x82fd('0x4d')][_0x82fd('0x29')]);}_0x53d744[_0x82fd('0x53')]=qs[_0x82fd('0x54')](_0x209eff[_0x82fd('0x4d')][_0x82fd('0x54')]);_0x53d744[_0x82fd('0x55')]=qs['filters'](_['pick'](_0x209eff[_0x82fd('0x4d')],_0x2935b1[_0x82fd('0x56')]));_0x53d744[_0x82fd('0x55')][_0x82fd('0x6d')]=_0x44cb2d['id'];if(_0x209eff['query'][_0x82fd('0x58')]){_0x53d744[_0x82fd('0x55')]=_[_0x82fd('0x60')](_0x53d744[_0x82fd('0x55')],{'$or':_[_0x82fd('0x49')](_0x53d744['attributes'],function(_0x343f70){var _0x3cdac2={};_0x3cdac2[_0x343f70]={'$like':'%'+_0x209eff[_0x82fd('0x4d')]['filter']+'%'};return _0x3cdac2;})});}_0x53d744=_[_0x82fd('0x60')]({},_0x53d744,_0x209eff[_0x82fd('0x61')]);return db[_0x82fd('0xb3')][_0x82fd('0x2a')]({'where':_0x53d744[_0x82fd('0x55')]})[_0x82fd('0x1b')](function(_0x33b980){_0x5db040[_0x82fd('0x2a')]=_0x33b980;if(_0x209eff[_0x82fd('0x4d')][_0x82fd('0x73')]){_0x53d744[_0x82fd('0x5a')]=[{'model':db[_0x82fd('0x9a')],'as':'Contact','required':![]},{'model':db[_0x82fd('0xf8')],'as':_0x82fd('0xf9'),'attributes':['name',_0x82fd('0xfa'),'internal'],'required':![]},{'model':db[_0x82fd('0xfb')],'as':_0x82fd('0xfc'),'attributes':['id',_0x82fd('0x32'),'color'],'where':_0x209eff[_0x82fd('0x4d')][_0x82fd('0xfd')]?{'id':_0x209eff[_0x82fd('0x4d')]['tag']}:undefined,'required':_0x209eff[_0x82fd('0x4d')][_0x82fd('0xfd')]?!![]:![]}];}return db[_0x82fd('0xb3')][_0x82fd('0x5b')](_0x53d744);})[_0x82fd('0x1b')](function(_0x35ad72){_0x5db040[_0x82fd('0x5c')]=_0x35ad72;return _0x5db040;});}})[_0x82fd('0x1b')](respondWithFilteredResult(_0x56cdef,_0x53d744))['catch'](handleError(_0x56cdef,null));};exports[_0x82fd('0xfe')]=function(_0x439405,_0x50d9d6){var _0x121607=0x0;var _0x35b47e=0x0;var _0x42fcb4=![];var _0x29edfd;var _0x49586a;return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x439405[_0x82fd('0x5e')]['id']},'include':[{'model':db[_0x82fd('0x92')],'as':_0x82fd('0x92'),'include':[{'model':db[_0x82fd('0x92')],'as':_0x82fd('0xa6'),'attributes':['id',_0x82fd('0xff')]}]}]})['then'](handleEntityNotFound(_0x50d9d6,null))[_0x82fd('0x1b')](function(_0xe6569b){if(_0xe6569b){_0x29edfd=_0xe6569b;return _0xe6569b['getProactiveActions']({'raw':!![]});}})[_0x82fd('0x1b')](function(_0x37f4c2){if(_0x29edfd){if(_0x37f4c2){_0x49586a=_0x37f4c2;}}return require(_0x82fd('0x84'))['getLicense']();})[_0x82fd('0x1b')](function(_0x12fa06){if(_0x12fa06){_0x35b47e=_0x12fa06[_0x82fd('0x100')];_0x42fcb4=_0x12fa06[_0x82fd('0x86')];}})[_0x82fd('0x1b')](function(){return db[_0x82fd('0xb3')][_0x82fd('0x2a')]({'where':{'closed':![]}});})[_0x82fd('0x1b')](function(_0x5cb6eb){_0x121607=_0x5cb6eb;if(_0x35b47e&&_0x5cb6eb>_0x35b47e){return db[_0x82fd('0x101')][_0x82fd('0x71')]({'where':{'id':0x1}})[_0x82fd('0x1b')](function(_0x93fe30){if(_0x93fe30){_0x93fe30[_0x82fd('0x102')](_0x82fd('0x103'));}});}})[_0x82fd('0x1b')](function(){var _0x50803f=_0x29edfd[_0x82fd('0x92')];var _0x2f17f1=_0x29edfd[_0x82fd('0x94')]||undefined;return _0x50803f?_0x50803f[_0x82fd('0x95')](_0x2f17f1):!![];})[_0x82fd('0x1b')](function(_0x155675){var _0x1ead3b=fs['readFileSync'](path[_0x82fd('0x82')](config[_0x82fd('0x89')],_0x82fd('0x104')),_0x82fd('0xd5'));var _0x15d949=_0x82fd('0x105');var _0xd95fb1=![];try{const _0x15e78b=new URL(_0x29edfd[_0x82fd('0x6b')]);_0x29edfd['address']=_0x15e78b[_0x82fd('0x106')];}catch(_0x31470a){}var _0x25cdeb;if(_0x439405[_0x82fd('0xad')]['referer']){_0x439405[_0x82fd('0xad')][_0x82fd('0x3a')]=_0x439405[_0x82fd('0xad')][_0x82fd('0x3a')][_0x82fd('0x107')](/\/$/,'');_0x25cdeb=wildcardUtils[_0x82fd('0x108')](_0x29edfd[_0x82fd('0x6b')],_0x439405[_0x82fd('0xad')][_0x82fd('0x3a')]);}else{_0x439405[_0x82fd('0xad')]['referer']=_0x29edfd['address'];_0x25cdeb=!![];}var _0x341c06={'chatVersion':_0x15d949,'chatWebsiteAddressOrigin':_0x25cdeb?_0x439405[_0x82fd('0xad')]['referer']:_0x29edfd[_0x82fd('0x6b')],'remote':_0x29edfd[_0x82fd('0x109')],'query':querystring[_0x82fd('0x45')](_[_0x82fd('0x60')](_0x29edfd['get']({'plain':!![]}),{'customerIp':_0x439405[_0x82fd('0xad')][_0x82fd('0x36')]||_0x439405[_0x82fd('0xad')][_0x82fd('0x10a')]||_0x439405[_0x82fd('0x10b')][_0x82fd('0x10c')]||_0x439405['ip'],'referer':_0x439405[_0x82fd('0xad')][_0x82fd('0x3a')],'openedInteractions':_0x121607,'maxInteractions':_0x35b47e,'virtual':_0x42fcb4['virtual'],'online':_0x155675,'custom':_0x42fcb4,'address':_0x25cdeb?_0x439405[_0x82fd('0xad')][_0x82fd('0x3a')]:null}))[_0x82fd('0x107')](/'/g,'\x5c\x27')};_0x50d9d6['send'](ejs[_0x82fd('0xd6')](Mustache[_0x82fd('0xd6')](_0x1ead3b,_0x341c06),{'proactiveActions':_0x49586a,'alignment':_0x29edfd[_0x82fd('0x10d')],'verticalAlignment':_0x29edfd['verticalAlignment'],'div_color':_0x29edfd[_0x82fd('0x10e')],'labelText':_0x29edfd['labelText'],'text_color':_0x29edfd['textColor'],'text_button_color':_0x29edfd['textButtonColor'],'button_color':_0x29edfd['color_button'],'background_color':_0x29edfd['backgroundColor'],'hideWhenOffline':_0x29edfd[_0x82fd('0x10f')],'intervalId':_0x29edfd[_0x82fd('0x110')],'isDevelopment':_0xd95fb1,'chatVersion':_0x15d949}));})[_0x82fd('0x24')](handleError(_0x50d9d6,null));};exports[_0x82fd('0x111')]=function(_0xc11171,_0x1b08a4){var _0x456c78=_0xc11171[_0x82fd('0x5e')]['id'];var _0x22ca1b=_0xc11171[_0x82fd('0x64')];var _0x2d8c6d=0xc8;var _0x45fb9f=null;return db[_0x82fd('0xe2')][_0x82fd('0xe3')]({'isolationLevel':db[_0x82fd('0xe2')][_0x82fd('0x112')][_0x82fd('0x113')][_0x82fd('0x114')]},function(_0x5b1eeb){return db[_0x82fd('0x4a')]['findOne']({'where':{'id':_0x456c78},'transaction':_0x5b1eeb})[_0x82fd('0x1b')](function(_0x4c32c7){if(_0x4c32c7){return db[_0x82fd('0xa4')]['destroy']({'where':{'ChatWebsiteId':_0x456c78},'transaction':_0x5b1eeb})['then'](function(){var _0x7e6bd=_[_0x82fd('0x49')](_0x22ca1b,function(_0x3131e3){_0x3131e3[_0x82fd('0x6d')]=_0x456c78;return _0x3131e3;});return db['ChatApplication'][_0x82fd('0x115')](_0x7e6bd,{'transaction':_0x5b1eeb});});}else{_0x2d8c6d=0x194;_0x45fb9f=[];}});})[_0x82fd('0x1b')](function(){if(_0x2d8c6d!==0x194){return db['ChatApplication'][_0x82fd('0x116')]({'where':{'ChatWebsiteId':_0x456c78},'order':'priority'})[_0x82fd('0x1b')](function(_0x3c06d2){_0x45fb9f=_0x3c06d2;});}})[_0x82fd('0x24')](function(_0x198b9b){_0x2d8c6d=0x1f4;logger['error'](_0x198b9b[_0x82fd('0x117')]);if(_0x198b9b[_0x82fd('0x32')]){delete _0x198b9b[_0x82fd('0x32')];}_0x45fb9f=_0x198b9b;})[_0x82fd('0x118')](function(){if(_0x45fb9f===null){_0x1b08a4[_0x82fd('0x25')](_0x2d8c6d);}else{if(_0x2d8c6d===0x1f4){_0x1b08a4[_0x82fd('0x26')](_0x2d8c6d)['send'](_0x45fb9f);}else{_0x1b08a4[_0x82fd('0x26')](_0x2d8c6d)[_0x82fd('0x28')](_0x45fb9f);}}});};exports[_0x82fd('0x119')]=function(_0x4d0ffc,_0x540c30){var _0x2a25f5={};var _0x2c3bdb={};var _0x4cf2f8;var _0x3afdd4;return db[_0x82fd('0x4a')][_0x82fd('0x71')]({'where':{'id':_0x4d0ffc[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x540c30,null))[_0x82fd('0x1b')](function(_0x43a25){if(_0x43a25){_0x4cf2f8=_0x43a25;_0x2c3bdb[_0x82fd('0x41')]=_['keys'](db[_0x82fd('0xa4')]['rawAttributes']);_0x2c3bdb['query']=_[_0x82fd('0x4c')](_0x4d0ffc['query']);_0x2c3bdb[_0x82fd('0x56')]=_['intersection'](_0x2c3bdb[_0x82fd('0x41')],_0x2c3bdb['query']);_0x2a25f5[_0x82fd('0x4f')]=_['intersection'](_0x2c3bdb[_0x82fd('0x41')],qs[_0x82fd('0x50')](_0x4d0ffc[_0x82fd('0x4d')][_0x82fd('0x50')]));_0x2a25f5['attributes']=_0x2a25f5['attributes'][_0x82fd('0x5f')]?_0x2a25f5['attributes']:_0x2c3bdb[_0x82fd('0x41')];_0x2a25f5[_0x82fd('0x53')]=qs[_0x82fd('0x54')](_0x4d0ffc[_0x82fd('0x4d')]['sort']);_0x2a25f5['where']=qs['filters'](_[_0x82fd('0x57')](_0x4d0ffc[_0x82fd('0x4d')],_0x2c3bdb['filters']));if(_0x4d0ffc[_0x82fd('0x4d')][_0x82fd('0x58')]){_0x2a25f5['where']=_[_0x82fd('0x60')](_0x2a25f5[_0x82fd('0x55')],{'$or':_[_0x82fd('0x49')](_0x2a25f5[_0x82fd('0x4f')],function(_0x1f1405){var _0x1bd53e={};_0x1bd53e[_0x1f1405]={'$like':'%'+_0x4d0ffc['query'][_0x82fd('0x58')]+'%'};return _0x1bd53e;})});}_0x2a25f5=_[_0x82fd('0x60')]({},_0x2a25f5,_0x4d0ffc[_0x82fd('0x61')]);return _0x4cf2f8[_0x82fd('0x119')](_0x2a25f5);}})['then'](function(_0x21bfbe){if(_0x21bfbe){_0x3afdd4=_0x21bfbe[_0x82fd('0x5f')];if(!_0x4d0ffc['query'][_0x82fd('0x51')](_0x82fd('0x52'))){_0x2a25f5[_0x82fd('0x2b')]=qs[_0x82fd('0x2b')](_0x4d0ffc[_0x82fd('0x4d')][_0x82fd('0x2b')]);_0x2a25f5[_0x82fd('0x29')]=qs[_0x82fd('0x29')](_0x4d0ffc[_0x82fd('0x4d')]['offset']);}return _0x4cf2f8[_0x82fd('0x119')](_0x2a25f5);}})['then'](function(_0x59c9a3){if(_0x59c9a3){return _0x59c9a3?{'count':_0x3afdd4,'rows':_0x59c9a3}:null;}})[_0x82fd('0x1b')](respondWithResult(_0x540c30,null))['catch'](handleError(_0x540c30,null));};exports[_0x82fd('0x11a')]=function(_0x2a0fa9,_0x2f2266){return db[_0x82fd('0x11b')][_0x82fd('0x62')]({'where':{'id':_0x2a0fa9['params']['id']}})['then'](handleEntityNotFound(_0x2f2266,null))[_0x82fd('0x1b')](function(_0xf0db80){if(_0xf0db80){return _0xf0db80[_0x82fd('0x11a')](_0x2a0fa9[_0x82fd('0x64')][_0x82fd('0x78')],_['omit'](_0x2a0fa9[_0x82fd('0x64')],[_0x82fd('0x78'),'id'])||{});}})[_0x82fd('0x1b')](respondWithResult(_0x2f2266,null))[_0x82fd('0x24')](handleError(_0x2f2266,null));};exports[_0x82fd('0x11c')]=function(_0x5177f3,_0x324fb0){var _0x462ee3={};var _0x27372a={};var _0x22215b;var _0x493eb7;return db[_0x82fd('0x4a')][_0x82fd('0x71')]({'where':{'id':_0x5177f3[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x324fb0,null))[_0x82fd('0x1b')](function(_0x470698){if(_0x470698){_0x22215b=_0x470698;_0x27372a[_0x82fd('0x41')]=_[_0x82fd('0x4c')](db['ChatProactiveAction'][_0x82fd('0x72')]);_0x27372a[_0x82fd('0x4d')]=_[_0x82fd('0x4c')](_0x5177f3['query']);_0x27372a[_0x82fd('0x56')]=_[_0x82fd('0x4e')](_0x27372a[_0x82fd('0x41')],_0x27372a['query']);_0x462ee3[_0x82fd('0x4f')]=_['intersection'](_0x27372a['model'],qs[_0x82fd('0x50')](_0x5177f3['query'][_0x82fd('0x50')]));_0x462ee3[_0x82fd('0x4f')]=_0x462ee3[_0x82fd('0x4f')][_0x82fd('0x5f')]?_0x462ee3[_0x82fd('0x4f')]:_0x27372a[_0x82fd('0x41')];_0x462ee3['order']=qs['sort'](_0x5177f3[_0x82fd('0x4d')][_0x82fd('0x54')]);_0x462ee3[_0x82fd('0x55')]=qs[_0x82fd('0x56')](_[_0x82fd('0x57')](_0x5177f3[_0x82fd('0x4d')],_0x27372a['filters']));if(_0x5177f3[_0x82fd('0x4d')]['filter']){_0x462ee3['where']=_[_0x82fd('0x60')](_0x462ee3[_0x82fd('0x55')],{'$or':_[_0x82fd('0x49')](_0x462ee3[_0x82fd('0x4f')],function(_0x51d74d){var _0x2ae7cc={};_0x2ae7cc[_0x51d74d]={'$like':'%'+_0x5177f3['query'][_0x82fd('0x58')]+'%'};return _0x2ae7cc;})});}_0x462ee3=_[_0x82fd('0x60')]({},_0x462ee3,_0x5177f3[_0x82fd('0x61')]);return _0x22215b['getProactiveActions'](_0x462ee3);}})[_0x82fd('0x1b')](function(_0x17c034){if(_0x17c034){_0x493eb7=_0x17c034['length'];if(!_0x5177f3[_0x82fd('0x4d')][_0x82fd('0x51')]('nolimit')){_0x462ee3[_0x82fd('0x2b')]=qs[_0x82fd('0x2b')](_0x5177f3[_0x82fd('0x4d')][_0x82fd('0x2b')]);_0x462ee3[_0x82fd('0x29')]=qs['offset'](_0x5177f3[_0x82fd('0x4d')][_0x82fd('0x29')]);}return _0x22215b[_0x82fd('0x11c')](_0x462ee3);}})[_0x82fd('0x1b')](function(_0x52c651){if(_0x52c651){return _0x52c651?{'count':_0x493eb7,'rows':_0x52c651}:null;}})[_0x82fd('0x1b')](respondWithResult(_0x324fb0,null))[_0x82fd('0x24')](handleError(_0x324fb0,null));};exports[_0x82fd('0x11d')]=function(_0x20a9a9,_0x30e5fd){var _0x5180b2=_0x20a9a9[_0x82fd('0x4d')]['online']===_0x82fd('0x11e')?_0x82fd('0x11f'):'onlineForm';return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'attributes':['id',_0x5180b2],'where':{'id':_0x20a9a9[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x30e5fd,null))[_0x82fd('0x1b')](function(_0x4f5820){if(_0x4f5820){var _0x4ece25=_0x4f5820[_0x5180b2];var _0x4ac71b=_0x4ece25&&_0x4ece25[_0x82fd('0x120')]?_0x4ece25[_0x82fd('0x120')]:[];_0x30e5fd['send']({'fromKey':_[_0x82fd('0x87')](_0x4ece25[_0x82fd('0x121')])?undefined:_0x4ece25[_0x82fd('0x121')],'count':_0x4ac71b[_0x82fd('0x5f')],'rows':_0x4ac71b});}})['catch'](handleError(_0x30e5fd,null));};exports[_0x82fd('0x122')]=function(_0x40e3bf,_0x528381){var _0x2deca4={'raw':![],'where':{}};var _0x5849e2={};var _0x13bd7a={'count':0x0,'rows':[]};return db[_0x82fd('0x4a')][_0x82fd('0x71')]({'where':{'id':_0x40e3bf['params']['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x528381,null))['then'](function(_0x201be0){if(_0x201be0){_0x5849e2[_0x82fd('0x41')]=_[_0x82fd('0x4c')](db[_0x82fd('0x123')][_0x82fd('0x72')]);_0x5849e2[_0x82fd('0x4d')]=_[_0x82fd('0x4c')](_0x40e3bf['query']);_0x5849e2[_0x82fd('0x56')]=_['intersection'](_0x5849e2['model'],_0x5849e2[_0x82fd('0x4d')]);_0x2deca4[_0x82fd('0x4f')]=_[_0x82fd('0x4e')](_0x5849e2['model'],qs['fields'](_0x40e3bf[_0x82fd('0x4d')][_0x82fd('0x50')]));_0x2deca4[_0x82fd('0x4f')]=_0x2deca4['attributes'][_0x82fd('0x5f')]?_0x2deca4[_0x82fd('0x4f')]:_0x5849e2[_0x82fd('0x41')];if(!_0x40e3bf[_0x82fd('0x4d')][_0x82fd('0x51')]('nolimit')){_0x2deca4['limit']=qs['limit'](_0x40e3bf[_0x82fd('0x4d')][_0x82fd('0x2b')]);_0x2deca4[_0x82fd('0x29')]=qs[_0x82fd('0x29')](_0x40e3bf[_0x82fd('0x4d')]['offset']);}_0x2deca4[_0x82fd('0x53')]=qs[_0x82fd('0x54')](_0x40e3bf[_0x82fd('0x4d')]['sort']);_0x2deca4[_0x82fd('0x55')]=qs['filters'](_[_0x82fd('0x57')](_0x40e3bf['query'],_0x5849e2[_0x82fd('0x56')]));_0x2deca4[_0x82fd('0x55')][_0x82fd('0x6d')]=_0x201be0['id'];if(_0x40e3bf['query'][_0x82fd('0x58')]){_0x2deca4['where']=_['merge'](_0x2deca4[_0x82fd('0x55')],{'$or':_[_0x82fd('0x49')](_0x2deca4['attributes'],function(_0x11c513){var _0x2bf527={};_0x2bf527[_0x11c513]={'$like':'%'+_0x40e3bf[_0x82fd('0x4d')][_0x82fd('0x58')]+'%'};return _0x2bf527;})});}_0x2deca4=_[_0x82fd('0x60')]({},_0x2deca4,_0x40e3bf[_0x82fd('0x61')]);return db['ChatOfflineMessage'][_0x82fd('0x2a')]({'where':_0x2deca4[_0x82fd('0x55')]})[_0x82fd('0x1b')](function(_0x4b7570){_0x13bd7a['count']=_0x4b7570;if(_0x40e3bf[_0x82fd('0x4d')][_0x82fd('0x73')]){_0x2deca4[_0x82fd('0x5a')]=[{'all':!![]}];}else{_0x2deca4[_0x82fd('0x5a')]=[{'model':db['CmContact'],'as':_0x82fd('0x124'),'required':![]},{'model':db[_0x82fd('0xe4')],'as':_0x82fd('0x125'),'required':![]}];}return db[_0x82fd('0x123')][_0x82fd('0x5b')](_0x2deca4);})[_0x82fd('0x1b')](function(_0x2657e3){_0x13bd7a['rows']=_0x2657e3;return _0x13bd7a;});}})[_0x82fd('0x1b')](respondWithFilteredResult(_0x528381,_0x2deca4))[_0x82fd('0x24')](handleError(_0x528381,null));};exports['addAgents']=function(_0x2ca4a9,_0xf4a519){return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x2ca4a9[_0x82fd('0x5e')]['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0xf4a519,null))[_0x82fd('0x1b')](function(_0x34502d){if(_0x34502d){return _0x34502d['addAgents'](_0x2ca4a9[_0x82fd('0x64')][_0x82fd('0x78')],_[_0x82fd('0xf6')](_0x2ca4a9[_0x82fd('0x64')],['ids','id'])||{})[_0x82fd('0xd2')](function(_0x3aca11){for(var _0x42b1fc=0x0;_0x42b1fc<_0x2ca4a9[_0x82fd('0x64')][_0x82fd('0x78')][_0x82fd('0x5f')];_0x42b1fc+=0x1){socket[_0x82fd('0x126')](_0x82fd('0x127'),{'UserId':Number(_0x2ca4a9[_0x82fd('0x64')]['ids'][_0x42b1fc]),'ChatWebsiteId':Number(_0x2ca4a9[_0x82fd('0x5e')]['id'])});}return _0x3aca11;});}})[_0x82fd('0x1b')](respondWithResult(_0xf4a519,null))[_0x82fd('0x24')](handleError(_0xf4a519,null));};exports[_0x82fd('0x128')]=function(_0x197ba9,_0x2335fd){return db[_0x82fd('0x4a')][_0x82fd('0x62')]({'where':{'id':_0x197ba9['params']['id']}})[_0x82fd('0x1b')](handleEntityNotFound(_0x2335fd,null))[_0x82fd('0x1b')](function(_0x1e0969){if(_0x1e0969){return _0x1e0969['removeAgents'](_0x197ba9[_0x82fd('0x4d')][_0x82fd('0x78')])[_0x82fd('0x1b')](function(){if(_[_0x82fd('0x129')](_0x197ba9[_0x82fd('0x4d')]['ids'])){for(var _0x4c6061=0x0;_0x4c6061<_0x197ba9[_0x82fd('0x4d')][_0x82fd('0x78')][_0x82fd('0x5f')];_0x4c6061+=0x1){socket[_0x82fd('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x197ba9[_0x82fd('0x4d')][_0x82fd('0x78')][_0x4c6061]),'ChatWebsiteId':Number(_0x197ba9[_0x82fd('0x5e')]['id'])});}}else{socket[_0x82fd('0x126')](_0x82fd('0x12a'),{'UserId':Number(_0x197ba9[_0x82fd('0x4d')][_0x82fd('0x78')]),'ChatWebsiteId':Number(_0x197ba9[_0x82fd('0x5e')]['id'])});}});}})[_0x82fd('0x1b')](respondWithStatusCode(_0x2335fd,null))[_0x82fd('0x24')](handleError(_0x2335fd,null));};exports[_0x82fd('0x12b')]=function(_0x1a2cbf,_0x1ce2f0){var _0x51ea94={};var _0x2dcb02={};var _0x919ba5;var _0x4818ec;return db[_0x82fd('0x4a')][_0x82fd('0x71')]({'where':{'id':_0x1a2cbf[_0x82fd('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1ce2f0,null))['then'](function(_0x68b0e){if(_0x68b0e){_0x919ba5=_0x68b0e;_0x2dcb02[_0x82fd('0x41')]=_[_0x82fd('0x4c')](db[_0x82fd('0xf8')]['rawAttributes']);_0x2dcb02[_0x82fd('0x4d')]=_[_0x82fd('0x4c')](_0x1a2cbf['query']);_0x2dcb02[_0x82fd('0x56')]=_['intersection'](_0x2dcb02['model'],_0x2dcb02[_0x82fd('0x4d')]);_0x51ea94['attributes']=_['intersection'](_0x2dcb02[_0x82fd('0x41')],qs[_0x82fd('0x50')](_0x1a2cbf[_0x82fd('0x4d')][_0x82fd('0x50')]));_0x51ea94[_0x82fd('0x4f')]=_0x51ea94[_0x82fd('0x4f')][_0x82fd('0x5f')]?_0x51ea94[_0x82fd('0x4f')]:_0x2dcb02['model'];_0x51ea94[_0x82fd('0x53')]=qs['sort'](_0x1a2cbf[_0x82fd('0x4d')][_0x82fd('0x54')]);_0x51ea94['where']=qs[_0x82fd('0x56')](_[_0x82fd('0x57')](_0x1a2cbf[_0x82fd('0x4d')],_0x2dcb02[_0x82fd('0x56')]));if(_0x1a2cbf[_0x82fd('0x4d')]['filter']){_0x51ea94[_0x82fd('0x55')]=_['merge'](_0x51ea94['where'],{'$or':_['map'](_0x51ea94[_0x82fd('0x4f')],function(_0x286875){var _0x4d034c={};_0x4d034c[_0x286875]={'$like':'%'+_0x1a2cbf['query']['filter']+'%'};return _0x4d034c;})});}_0x51ea94=_[_0x82fd('0x60')]({},_0x51ea94,_0x1a2cbf[_0x82fd('0x61')]);return _0x919ba5['getAgents'](_0x51ea94);}})[_0x82fd('0x1b')](function(_0x8b12){if(_0x8b12){_0x4818ec=_0x8b12[_0x82fd('0x5f')];if(!_0x1a2cbf['query'][_0x82fd('0x51')]('nolimit')){_0x51ea94['limit']=qs['limit'](_0x1a2cbf[_0x82fd('0x4d')][_0x82fd('0x2b')]);_0x51ea94['offset']=qs[_0x82fd('0x29')](_0x1a2cbf['query']['offset']);}return _0x919ba5[_0x82fd('0x12b')](_0x51ea94);}})[_0x82fd('0x1b')](function(_0x376a50){if(_0x376a50){return _0x376a50?{'count':_0x4818ec,'rows':_0x376a50}:null;}})['then'](respondWithResult(_0x1ce2f0,null))['catch'](handleError(_0x1ce2f0,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 37f190f..fe27f94 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 _0x723e=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x2d6d48,_0xd948d7){var _0x4283ba=function(_0x3264b4){while(--_0x3264b4){_0x2d6d48['push'](_0x2d6d48['shift']());}};_0x4283ba(++_0xd948d7);}(_0x723e,0x179));var _0xe723=function(_0x16295e,_0x4a9b05){_0x16295e=_0x16295e-0x0;var _0x2d9e54=_0x723e[_0x16295e];return _0x2d9e54;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0xe723('0x0'))['db'][_0xe723('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe723('0x2')](0x0);var events={'afterCreate':_0xe723('0x3'),'afterUpdate':_0xe723('0x4'),'afterDestroy':_0xe723('0x5')};function emitEvent(_0x39e35c){return function(_0x1da20f,_0x8f78b2,_0x10aa61){ChatWebsiteEvents['emit'](_0x39e35c+':'+_0x1da20f['id'],_0x1da20f);ChatWebsiteEvents[_0xe723('0x6')](_0x39e35c,_0x1da20f);_0x10aa61(null);};}for(var e in events){if(events[_0xe723('0x7')](e)){var event=events[e];ChatWebsite[_0xe723('0x8')](e,emitEvent(event));}}module[_0xe723('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x4f5d=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x35f2fa,_0x4ea583){var _0x302f25=function(_0xfe035a){while(--_0xfe035a){_0x35f2fa['push'](_0x35f2fa['shift']());}};_0x302f25(++_0x4ea583);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4f5d[_0x18ab2a];return _0x16dcee;};'use strict';var EventEmitter=require(_0xd4f5('0x0'));var ChatWebsite=require(_0xd4f5('0x1'))['db'][_0xd4f5('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd4f5('0x3')](0x0);var events={'afterCreate':_0xd4f5('0x4'),'afterUpdate':_0xd4f5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x45f512){return function(_0x468609,_0xf61335,_0x3956d8){ChatWebsiteEvents[_0xd4f5('0x6')](_0x45f512+':'+_0x468609['id'],_0x468609);ChatWebsiteEvents[_0xd4f5('0x6')](_0x45f512,_0x468609);_0x3956d8(null);};}for(var e in events){if(events[_0xd4f5('0x7')](e)){var event=events[e];ChatWebsite[_0xd4f5('0x8')](e,emitEvent(event));}}module[_0xd4f5('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b1a7a32..8deed78 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 _0xe106=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xe106,0x1ed));var _0x6e10=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0xe106[_0x36d25e];return _0x4b95b8;};'use strict';var _=require('lodash');var util=require(_0x6e10('0x0'));var logger=require(_0x6e10('0x1'))(_0x6e10('0x2'));var moment=require(_0x6e10('0x3'));var BPromise=require(_0x6e10('0x4'));var rp=require(_0x6e10('0x5'));var fs=require('fs');var path=require(_0x6e10('0x6'));var rimraf=require('rimraf');var config=require(_0x6e10('0x7'));var attributes=require(_0x6e10('0x8'));module[_0x6e10('0x9')]=function(_0x200c81,_0x29cbd3){return _0x200c81[_0x6e10('0xa')](_0x6e10('0xb'),attributes,{'tableName':_0x6e10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7ff=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','util','api','moment'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xd7ff,0x15c));var _0xfd7f=function(_0x3e634a,_0x290e38){_0x3e634a=_0x3e634a-0x0;var _0x72c28d=_0xd7ff[_0x3e634a];return _0x72c28d;};'use strict';var _=require('lodash');var util=require(_0xfd7f('0x0'));var logger=require('../../config/logger')(_0xfd7f('0x1'));var moment=require(_0xfd7f('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd7f('0x3'));var fs=require('fs');var path=require(_0xfd7f('0x4'));var rimraf=require(_0xfd7f('0x5'));var config=require(_0xfd7f('0x6'));var attributes=require(_0xfd7f('0x7'));module['exports']=function(_0x48d854,_0x27fefe){return _0x48d854[_0xfd7f('0x8')]('ChatWebsite',attributes,{'tableName':'chat_websites','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 9119e84..c7b0603 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 _0xe4df=['socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x1cf532,_0x4cacf2){var _0x506a32=function(_0x16dfd9){while(--_0x16dfd9){_0x1cf532['push'](_0x1cf532['shift']());}};_0x506a32(++_0x4cacf2);}(_0xe4df,0x85));var _0xfe4d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe4df[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfe4d('0x0'));var BPromise=require(_0xfe4d('0x1'));var rs=require(_0xfe4d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe4d('0x3'))['db'];var utils=require(_0xfe4d('0x4'));var logger=require(_0xfe4d('0x5'))('rpc');var config=require(_0xfe4d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe4d('0x7')][_0xfe4d('0x8')]({'port':0x232a});config[_0xfe4d('0x9')]=_[_0xfe4d('0xa')](config[_0xfe4d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfe4d('0xb'))(new Redis(config[_0xfe4d('0x9')]));require(_0xfe4d('0xc'))[_0xfe4d('0xd')](socket);function respondWithRpcPromise(_0x5df4fd,_0x324a7d,_0x3076f3){return new BPromise(function(_0x4adb33,_0x2fd73e){return client[_0xfe4d('0xe')](_0x5df4fd,_0x3076f3)[_0xfe4d('0xf')](function(_0x81d5c1){logger['info'](_0xfe4d('0x10'),_0x324a7d,_0xfe4d('0x11'));logger[_0xfe4d('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x324a7d,_0xfe4d('0x11'),JSON[_0xfe4d('0x13')](_0x81d5c1));if(_0x81d5c1['error']){if(_0x81d5c1[_0xfe4d('0x14')]['code']===0x1f4){logger[_0xfe4d('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x324a7d,_0x81d5c1[_0xfe4d('0x14')]['message']);return _0x2fd73e(_0x81d5c1[_0xfe4d('0x14')][_0xfe4d('0x15')]);}logger[_0xfe4d('0x14')](_0xfe4d('0x10'),_0x324a7d,_0x81d5c1[_0xfe4d('0x14')][_0xfe4d('0x15')]);return _0x4adb33(_0x81d5c1['error'][_0xfe4d('0x15')]);}else{logger[_0xfe4d('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x324a7d,'request\x20sent');_0x4adb33(_0x81d5c1['result'][_0xfe4d('0x15')]);}})[_0xfe4d('0x17')](function(_0x297ff2){logger['error'](_0xfe4d('0x10'),_0x324a7d,_0x297ff2);_0x2fd73e(_0x297ff2);});});} \ No newline at end of file +var _0x587d=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3f85c1,_0x567fb0){var _0x5ce2ca=function(_0x3a79cd){while(--_0x3a79cd){_0x3f85c1['push'](_0x3f85c1['shift']());}};_0x5ce2ca(++_0x567fb0);}(_0x587d,0xd9));var _0xd587=function(_0x4d8eb2,_0xd781bb){_0x4d8eb2=_0x4d8eb2-0x0;var _0x9aed9c=_0x587d[_0x4d8eb2];return _0x9aed9c;};'use strict';var _=require(_0xd587('0x0'));var util=require(_0xd587('0x1'));var moment=require(_0xd587('0x2'));var BPromise=require(_0xd587('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd587('0x4'));var db=require(_0xd587('0x5'))['db'];var utils=require(_0xd587('0x6'));var logger=require(_0xd587('0x7'))('rpc');var config=require(_0xd587('0x8'));var jayson=require(_0xd587('0x9'));var client=jayson[_0xd587('0xa')][_0xd587('0xb')]({'port':0x232a});config[_0xd587('0xc')]=_[_0xd587('0xd')](config[_0xd587('0xc')],{'host':_0xd587('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd587('0xc')]));require(_0xd587('0xf'))[_0xd587('0x10')](socket);function respondWithRpcPromise(_0xa51784,_0x534e55,_0x2d036c){return new BPromise(function(_0x3696d5,_0x282f79){return client[_0xd587('0x11')](_0xa51784,_0x2d036c)[_0xd587('0x12')](function(_0x2f6dd3){logger[_0xd587('0x13')](_0xd587('0x14'),_0x534e55,_0xd587('0x15'));logger['debug'](_0xd587('0x16'),_0x534e55,_0xd587('0x15'),JSON[_0xd587('0x17')](_0x2f6dd3));if(_0x2f6dd3['error']){if(_0x2f6dd3[_0xd587('0x18')][_0xd587('0x19')]===0x1f4){logger[_0xd587('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x534e55,_0x2f6dd3[_0xd587('0x18')]['message']);return _0x282f79(_0x2f6dd3[_0xd587('0x18')][_0xd587('0x1a')]);}logger['error'](_0xd587('0x14'),_0x534e55,_0x2f6dd3[_0xd587('0x18')][_0xd587('0x1a')]);return _0x3696d5(_0x2f6dd3[_0xd587('0x18')][_0xd587('0x1a')]);}else{logger['info'](_0xd587('0x14'),_0x534e55,_0xd587('0x15'));_0x3696d5(_0x2f6dd3[_0xd587('0x1b')]['message']);}})['catch'](function(_0x117b46){logger['error'](_0xd587('0x14'),_0x534e55,_0x117b46);_0x282f79(_0x117b46);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index b3e2ed9..add20ac 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 _0xd679=['length','chatWebsite:','./chatWebsite.events','save','update','emit','removeListener','register'];(function(_0x202909,_0x4d9939){var _0x433325=function(_0xa7059c){while(--_0xa7059c){_0x202909['push'](_0x202909['shift']());}};_0x433325(++_0x4d9939);}(_0xd679,0x10a));var _0x9d67=function(_0x17a448,_0x5c3ee4){_0x17a448=_0x17a448-0x0;var _0x1a078c=_0xd679[_0x17a448];return _0x1a078c;};'use strict';var ChatWebsiteEvents=require(_0x9d67('0x0'));var events=[_0x9d67('0x1'),'remove',_0x9d67('0x2')];function createListener(_0x506121,_0x349b0e){return function(_0x423077){_0x349b0e[_0x9d67('0x3')](_0x506121,_0x423077);};}function removeListener(_0x41f1a2,_0x7f2fa0){return function(){ChatWebsiteEvents[_0x9d67('0x4')](_0x41f1a2,_0x7f2fa0);};}exports[_0x9d67('0x5')]=function(_0x2c8105){for(var _0x164d0a=0x0,_0x542505=events[_0x9d67('0x6')];_0x164d0a<_0x542505;_0x164d0a++){var _0x4b5a30=events[_0x164d0a];var _0x592a57=createListener(_0x9d67('0x7')+_0x4b5a30,_0x2c8105);ChatWebsiteEvents['on'](_0x4b5a30,_0x592a57);}}; \ No newline at end of file +var _0xc457=['length','save','emit','removeListener','register'];(function(_0x57e094,_0x53ab92){var _0x1444b0=function(_0x12bf23){while(--_0x12bf23){_0x57e094['push'](_0x57e094['shift']());}};_0x1444b0(++_0x53ab92);}(_0xc457,0x15f));var _0x7c45=function(_0x4cdbb7,_0xe9aa65){_0x4cdbb7=_0x4cdbb7-0x0;var _0xca6d40=_0xc457[_0x4cdbb7];return _0xca6d40;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x7c45('0x0'),'remove','update'];function createListener(_0x555b71,_0x15cecc){return function(_0x4dd6b8){_0x15cecc[_0x7c45('0x1')](_0x555b71,_0x4dd6b8);};}function removeListener(_0x56324e,_0x2c4e34){return function(){ChatWebsiteEvents[_0x7c45('0x2')](_0x56324e,_0x2c4e34);};}exports[_0x7c45('0x3')]=function(_0x55df02){for(var _0xe2e5ae=0x0,_0x183278=events[_0x7c45('0x4')];_0xe2e5ae<_0x183278;_0xe2e5ae++){var _0x1178ba=events[_0xe2e5ae];var _0xd0f5a7=createListener('chatWebsite:'+_0x1178ba,_0x55df02);ChatWebsiteEvents['on'](_0x1178ba,_0xd0f5a7);}}; \ 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 ea61964..cc563f8 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 _0x949d=['test','exports','../../../utils/misc','escapeRegExp','url','URL','replace','localhost'];(function(_0x45be0d,_0x7a2b0a){var _0x72a7b7=function(_0x526a3c){while(--_0x526a3c){_0x45be0d['push'](_0x45be0d['shift']());}};_0x72a7b7(++_0x7a2b0a);}(_0x949d,0x162));var _0xd949=function(_0x3d7e1a,_0x4e1990){_0x3d7e1a=_0x3d7e1a-0x0;var _0x4cb731=_0x949d[_0x3d7e1a];return _0x4cb731;};var escapeRegExp=require(_0xd949('0x0'))[_0xd949('0x1')];var URL=require(_0xd949('0x2'))[_0xd949('0x3')];function testWildcardValidity(_0x59c4ae){let _0x5c5854=!![];try{new URL(_0x59c4ae[_0xd949('0x4')]('*',_0xd949('0x5')));}catch(_0x596628){_0x5c5854=![];}return _0x5c5854&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xd949('0x6')](_0x59c4ae);}function testWebsiteWithWildcard(_0x312499,_0x5d1579){let _0x3d2be5;const _0x416d5e=escapeRegExp(_0x312499)[_0xd949('0x4')]('\x5c*','([\x5cw]+)');try{new URL(_0x312499[_0xd949('0x4')]('\x5c*',_0xd949('0x5')));_0x3d2be5=new RegExp(_0x416d5e)['test'](_0x5d1579);}catch(_0x58e185){_0x3d2be5=![];}return _0x3d2be5;}module[_0xd949('0x7')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0xb4e6=['localhost','exports','../../../utils/misc','url','URL','replace'];(function(_0x4dd666,_0x155533){var _0x42693b=function(_0x185471){while(--_0x185471){_0x4dd666['push'](_0x4dd666['shift']());}};_0x42693b(++_0x155533);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0xb4e6[_0x531d15];return _0x271a18;};var escapeRegExp=require(_0x6b4e('0x0'))['escapeRegExp'];var URL=require(_0x6b4e('0x1'))[_0x6b4e('0x2')];function testWildcardValidity(_0x365912){let _0x25ffcb=!![];try{new URL(_0x365912[_0x6b4e('0x3')]('*',_0x6b4e('0x4')));}catch(_0x1929b8){_0x25ffcb=![];}return _0x25ffcb&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x365912);}function testWebsiteWithWildcard(_0x40da90,_0x1edf06){let _0x1f67a2;const _0x49de51=escapeRegExp(_0x40da90)[_0x6b4e('0x3')]('\x5c*','([\x5cw]+)');try{new URL(_0x40da90['replace']('\x5c*',_0x6b4e('0x4')));_0x1f67a2=new RegExp(_0x49de51)['test'](_0x1edf06);}catch(_0x53a71f){_0x1f67a2=![];}return _0x1f67a2;}module[_0x6b4e('0x5')]={'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 edf48de..3da4331 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 _0x4403=['getOfflineMessages','/:id/users','post','create','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','/:id/avatar','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','update','delete','removeDispositions','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages'];(function(_0x25b24a,_0x1c0163){var _0x224e68=function(_0x1fc9d2){while(--_0x1fc9d2){_0x25b24a['push'](_0x25b24a['shift']());}};_0x224e68(++_0x1c0163);}(_0x4403,0xb8));var _0x3440=function(_0x1ee128,_0x3ecc30){_0x1ee128=_0x1ee128-0x0;var _0x5c5ea9=_0x4403[_0x1ee128];return _0x5c5ea9;};'use strict';var multer=require(_0x3440('0x0'));var util=require(_0x3440('0x1'));var path=require(_0x3440('0x2'));var timeout=require('connect-timeout');var express=require(_0x3440('0x3'));var router=express[_0x3440('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3440('0x5'));var interaction=require(_0x3440('0x6'));var config=require(_0x3440('0x7'));var controller=require(_0x3440('0x8'));router[_0x3440('0x9')]('/',auth[_0x3440('0xa')](),controller['index']);router[_0x3440('0x9')](_0x3440('0xb'),auth[_0x3440('0xa')](),controller[_0x3440('0xc')]);router[_0x3440('0x9')](_0x3440('0xd'),auth[_0x3440('0xa')](),controller[_0x3440('0xe')]);router[_0x3440('0x9')](_0x3440('0xf'),auth[_0x3440('0xa')](),controller[_0x3440('0x10')]);router['get']('/:id/canned_answers',auth[_0x3440('0xa')](),controller[_0x3440('0x11')]);router['get'](_0x3440('0x12'),controller[_0x3440('0x13')]);router[_0x3440('0x9')]('/:id/avatar',controller[_0x3440('0x14')]);router[_0x3440('0x9')](_0x3440('0x15'),controller[_0x3440('0x16')]);router[_0x3440('0x9')]('/:id/system_avatar',controller[_0x3440('0x17')]);router['get'](_0x3440('0x18'),auth[_0x3440('0xa')](),controller[_0x3440('0x19')]);router[_0x3440('0x9')]('/:id/snippet',controller[_0x3440('0x1a')]);router['get'](_0x3440('0x1b'),auth['isAuthenticated'](),controller['getApplications']);router[_0x3440('0x9')](_0x3440('0x1c'),auth['isAuthenticated'](),controller[_0x3440('0x1d')]);router[_0x3440('0x9')](_0x3440('0x1e'),controller['getFields']);router[_0x3440('0x9')](_0x3440('0x1f'),auth[_0x3440('0xa')](),controller[_0x3440('0x20')]);router[_0x3440('0x9')](_0x3440('0x21'),auth[_0x3440('0xa')](),controller['getAgents']);router[_0x3440('0x22')]('/',auth[_0x3440('0xa')](),controller[_0x3440('0x23')]);router['post'](_0x3440('0xf'),auth[_0x3440('0xa')](),controller['addDisposition']);router['post'](_0x3440('0x24'),auth[_0x3440('0xa')](),controller[_0x3440('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53d40c,_0x137dd3,_0x53c26b){_0x53c26b(null,path[_0x3440('0x26')](config[_0x3440('0x27')],_0x3440('0x28')));},'filename':function(_0x3f43a6,_0x43c15a,_0x219428){_0x219428(null,util[_0x3440('0x29')](_0x3440('0x2a'),Date[_0x3440('0x2b')](),_0x43c15a[_0x3440('0x2c')]));}})});router[_0x3440('0x22')](_0x3440('0x12'),upload[_0x3440('0x2d')](_0x3440('0x2e')),controller[_0x3440('0x2f')]);var upload=multer({'storage':multer[_0x3440('0x30')]({'destination':function(_0xb5927d,_0x9ebba6,_0x261839){_0x261839(null,path[_0x3440('0x26')](config['root'],_0x3440('0x31')));},'filename':function(_0x3a0509,_0x4e31fb,_0x1a2c67){_0x1a2c67(null,util['format'](_0x3440('0x2a'),Date[_0x3440('0x2b')](),_0x4e31fb[_0x3440('0x2c')]));}})});router[_0x3440('0x22')](_0x3440('0x32'),upload[_0x3440('0x2d')](_0x3440('0x2e')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52813d,_0x3646b5,_0x29f3fa){_0x29f3fa(null,path[_0x3440('0x26')](config['root'],_0x3440('0x31')));},'filename':function(_0x5f2c87,_0x160176,_0x195c8c){_0x195c8c(null,util[_0x3440('0x29')](_0x3440('0x2a'),Date[_0x3440('0x2b')](),_0x160176[_0x3440('0x2c')]));}})});router[_0x3440('0x22')]('/:id/customer_avatar',upload[_0x3440('0x2d')](_0x3440('0x2e')),controller[_0x3440('0x33')]);var upload=multer({'storage':multer[_0x3440('0x30')]({'destination':function(_0x5d411e,_0x355487,_0x35ecf3){_0x35ecf3(null,path[_0x3440('0x26')](config[_0x3440('0x27')],_0x3440('0x31')));},'filename':function(_0x34e296,_0x49af0d,_0x1230be){_0x1230be(null,util[_0x3440('0x29')]('%s-%s',Date[_0x3440('0x2b')](),_0x49af0d[_0x3440('0x2c')]));}})});router[_0x3440('0x22')](_0x3440('0x34'),upload[_0x3440('0x2d')](_0x3440('0x2e')),controller['addSystemAvatar']);router['post'](_0x3440('0x35'),controller[_0x3440('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x3440('0x30')]({'destination':function(_0x122aaa,_0x34fa7c,_0x4f9946){const _0x38bc78=path[_0x3440('0x26')](config[_0x3440('0x27')],_0x3440('0x37'),_0x3440('0x38'),_0x3440('0x39'));fs_extra[_0x3440('0x3a')](_0x38bc78,function(){_0x4f9946(null,_0x38bc78);});},'filename':function(_0x4e7c7d,_0x3c8b8c,_0x256e1c){const _0x53c733=_0x3c8b8c[_0x3440('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2cee10=path[_0x3440('0x3b')](_0x53c733);const _0x176b44=Date['now']()+'-'+_0x53c733[_0x3440('0x3c')](_0x2cee10,'')+_0x2cee10;_0x256e1c(null,_0x176b44);}})});router[_0x3440('0x22')](_0x3440('0x3d'),offlineUploadMulter[_0x3440('0x3e')](),controller[_0x3440('0x3f')]);router[_0x3440('0x22')](_0x3440('0x18'),auth['isAuthenticated'](),controller[_0x3440('0x40')]);router[_0x3440('0x22')](_0x3440('0x1b'),auth[_0x3440('0xa')](),controller['addApplications']);router['post'](_0x3440('0x1c'),auth[_0x3440('0xa')](),controller[_0x3440('0x41')]);router[_0x3440('0x22')](_0x3440('0x21'),auth[_0x3440('0xa')](),controller[_0x3440('0x42')]);router['put'](_0x3440('0xd'),auth[_0x3440('0xa')](),controller[_0x3440('0x43')]);router[_0x3440('0x44')](_0x3440('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x3440('0x44')]('/:id/dispositions',auth[_0x3440('0xa')](),controller[_0x3440('0x45')]);router[_0x3440('0x44')](_0x3440('0x24'),auth[_0x3440('0xa')](),controller['removeAnswers']);router[_0x3440('0x44')](_0x3440('0x21'),auth[_0x3440('0xa')](),controller[_0x3440('0x46')]);module[_0x3440('0x47')]=router; \ No newline at end of file +var _0xbe43=['../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','addSystemAvatar','server/files','attachments','replace','extname','/:id/offline','any','offline','/:id/interactions','addAgents','put','update','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2dbe16,_0x13655b){var _0x3eb827=function(_0x3b3c87){while(--_0x3b3c87){_0x2dbe16['push'](_0x2dbe16['shift']());}};_0x3eb827(++_0x13655b);}(_0xbe43,0x81));var _0x3be4=function(_0x372967,_0x25161b){_0x372967=_0x372967-0x0;var _0x210e66=_0xbe43[_0x372967];return _0x210e66;};'use strict';var multer=require(_0x3be4('0x0'));var util=require(_0x3be4('0x1'));var path=require(_0x3be4('0x2'));var timeout=require(_0x3be4('0x3'));var express=require(_0x3be4('0x4'));var router=express[_0x3be4('0x5')]();var fs_extra=require(_0x3be4('0x6'));var auth=require(_0x3be4('0x7'));var interaction=require(_0x3be4('0x8'));var config=require(_0x3be4('0x9'));var controller=require(_0x3be4('0xa'));router[_0x3be4('0xb')]('/',auth[_0x3be4('0xc')](),controller[_0x3be4('0xd')]);router[_0x3be4('0xb')](_0x3be4('0xe'),auth[_0x3be4('0xc')](),controller['describe']);router[_0x3be4('0xb')](_0x3be4('0xf'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x10')]);router[_0x3be4('0xb')](_0x3be4('0x11'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x12')]);router[_0x3be4('0xb')](_0x3be4('0x13'),auth[_0x3be4('0xc')](),controller['getAnswers']);router[_0x3be4('0xb')](_0x3be4('0x14'),controller[_0x3be4('0x15')]);router[_0x3be4('0xb')](_0x3be4('0x16'),controller['getAvatar']);router[_0x3be4('0xb')](_0x3be4('0x17'),controller['getCustomerAvatar']);router['get'](_0x3be4('0x18'),controller[_0x3be4('0x19')]);router[_0x3be4('0xb')]('/:id/interactions',auth[_0x3be4('0xc')](),controller[_0x3be4('0x1a')]);router[_0x3be4('0xb')]('/:id/snippet',controller['getSnippet']);router[_0x3be4('0xb')](_0x3be4('0x1b'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x1c')]);router['get'](_0x3be4('0x1d'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x1e')]);router[_0x3be4('0xb')](_0x3be4('0x1f'),controller[_0x3be4('0x20')]);router[_0x3be4('0xb')](_0x3be4('0x21'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x22')]);router[_0x3be4('0xb')](_0x3be4('0x23'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x24')]);router[_0x3be4('0x25')]('/',auth['isAuthenticated'](),controller[_0x3be4('0x26')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3be4('0x27')]);router[_0x3be4('0x25')](_0x3be4('0x13'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x28')]);var upload=multer({'storage':multer[_0x3be4('0x29')]({'destination':function(_0x3bc1c3,_0x454ca2,_0x104f35){_0x104f35(null,path[_0x3be4('0x2a')](config[_0x3be4('0x2b')],'server/files/images/logos/'));},'filename':function(_0x504853,_0x2bad69,_0x2559e6){_0x2559e6(null,util[_0x3be4('0x2c')]('%s-%s',Date[_0x3be4('0x2d')](),_0x2bad69[_0x3be4('0x2e')]));}})});router[_0x3be4('0x25')]('/:id/logo',upload[_0x3be4('0x2f')](_0x3be4('0x30')),controller[_0x3be4('0x31')]);var upload=multer({'storage':multer[_0x3be4('0x29')]({'destination':function(_0x4bdf4c,_0x344784,_0x46cb65){_0x46cb65(null,path[_0x3be4('0x2a')](config['root'],_0x3be4('0x32')));},'filename':function(_0x4561de,_0x403852,_0x18b55d){_0x18b55d(null,util[_0x3be4('0x2c')](_0x3be4('0x33'),Date[_0x3be4('0x2d')](),_0x403852[_0x3be4('0x2e')]));}})});router[_0x3be4('0x25')](_0x3be4('0x16'),upload[_0x3be4('0x2f')](_0x3be4('0x30')),controller[_0x3be4('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d542d,_0xd36b0b,_0x3e6427){_0x3e6427(null,path[_0x3be4('0x2a')](config['root'],_0x3be4('0x32')));},'filename':function(_0x1b3d0e,_0x55bd44,_0x227111){_0x227111(null,util[_0x3be4('0x2c')](_0x3be4('0x33'),Date[_0x3be4('0x2d')](),_0x55bd44[_0x3be4('0x2e')]));}})});router[_0x3be4('0x25')](_0x3be4('0x17'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2127a9,_0x4972d2,_0xb06484){_0xb06484(null,path[_0x3be4('0x2a')](config['root'],_0x3be4('0x32')));},'filename':function(_0xd8839,_0x139229,_0x5882c6){_0x5882c6(null,util[_0x3be4('0x2c')](_0x3be4('0x33'),Date['now'](),_0x139229[_0x3be4('0x2e')]));}})});router['post'](_0x3be4('0x18'),upload['single']('file'),controller[_0x3be4('0x35')]);router[_0x3be4('0x25')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x41e2da,_0x529f9d,_0x42837d){const _0x5acbfa=path[_0x3be4('0x2a')](config['root'],_0x3be4('0x36'),_0x3be4('0x37'),'offline-chat');fs_extra['ensureDir'](_0x5acbfa,function(){_0x42837d(null,_0x5acbfa);});},'filename':function(_0x201a0a,_0x3b1a1d,_0xaf2186){const _0x576656=_0x3b1a1d[_0x3be4('0x2e')][_0x3be4('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x8df178=path[_0x3be4('0x39')](_0x576656);const _0x18c17b=Date[_0x3be4('0x2d')]()+'-'+_0x576656['replace'](_0x8df178,'')+_0x8df178;_0xaf2186(null,_0x18c17b);}})});router[_0x3be4('0x25')](_0x3be4('0x3a'),offlineUploadMulter[_0x3be4('0x3b')](),controller[_0x3be4('0x3c')]);router[_0x3be4('0x25')](_0x3be4('0x3d'),auth[_0x3be4('0xc')](),controller['addInteraction']);router['post'](_0x3be4('0x1b'),auth['isAuthenticated'](),controller['addApplications']);router[_0x3be4('0x25')](_0x3be4('0x1d'),auth[_0x3be4('0xc')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x3be4('0xc')](),controller[_0x3be4('0x3e')]);router[_0x3be4('0x3f')](_0x3be4('0xf'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x40')]);router[_0x3be4('0x41')]('/:id',auth[_0x3be4('0xc')](),controller['destroy']);router[_0x3be4('0x41')](_0x3be4('0x11'),auth[_0x3be4('0xc')](),controller[_0x3be4('0x42')]);router[_0x3be4('0x41')]('/:id/canned_answers',auth[_0x3be4('0xc')](),controller['removeAnswers']);router[_0x3be4('0x41')]('/:id/users',auth['isAuthenticated'](),controller[_0x3be4('0x43')]);module[_0x3be4('0x44')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index f52cffa..fc641e5 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 _0x0069=['app','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','Router','production'];(function(_0x3c4024,_0x1fb7c9){var _0x20f126=function(_0x572d54){while(--_0x572d54){_0x3c4024['push'](_0x3c4024['shift']());}};_0x20f126(++_0x1fb7c9);}(_0x0069,0x15c));var _0x9006=function(_0x1fd4d7,_0x2feafd){_0x1fd4d7=_0x1fd4d7-0x0;var _0x7efe8a=_0x0069[_0x1fd4d7];return _0x7efe8a;};var beaverLogger=require(_0x9006('0x0'));var express=require(_0x9006('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x9006('0x2')]();var isProduction=config['env']===_0x9006('0x3')||![];function clientSideLogs(_0x5e8e68,_0x6ac838,_0x5674d4){var _0x518ecc=_0x5e8e68[_0x9006('0x4')]['get'](_0x9006('0x5'));if(!_0x518ecc){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x9006('0x6')]({'uri':_0x9006('0x7'),'logger':_0x518ecc,'enableCors':!isProduction})(_0x5e8e68,_0x6ac838,_0x5674d4);}router[_0x9006('0x8')](auth[_0x9006('0x9')](),clientSideLogs);module[_0x9006('0xa')]=router; \ No newline at end of file +var _0x7a3d=['exports','express','../components/auth/service','production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs'];(function(_0x4815f1,_0x328b76){var _0x365f5a=function(_0x50c9f5){while(--_0x50c9f5){_0x4815f1['push'](_0x4815f1['shift']());}};_0x365f5a(++_0x328b76);}(_0x7a3d,0x109));var _0xd7a3=function(_0xb94114,_0x46b145){_0xb94114=_0xb94114-0x0;var _0x3ee471=_0x7a3d[_0xb94114];return _0x3ee471;};var beaverLogger=require('beaver-logger/server');var express=require(_0xd7a3('0x0'));var auth=require(_0xd7a3('0x1'));var config=require('../config/environment');var router=express['Router']();var isProduction=config['env']===_0xd7a3('0x2')||![];function clientSideLogs(_0x3a984b,_0x41688a,_0x5b8eef){var _0x4fa5c4=_0x3a984b['app'][_0xd7a3('0x3')](_0xd7a3('0x4'));if(!_0x4fa5c4){throw new Error(_0xd7a3('0x5'));}return beaverLogger['expressEndpoint']({'uri':_0xd7a3('0x6'),'logger':_0x4fa5c4,'enableCors':!isProduction})(_0x3a984b,_0x41688a,_0x5b8eef);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xd7a3('0x7')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index b278a88..22384ac 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 _0x6227=['AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM'];(function(_0x480f2c,_0x54f1c0){var _0x3a990a=function(_0x5373f7){while(--_0x5373f7){_0x480f2c['push'](_0x480f2c['shift']());}};_0x3a990a(++_0x54f1c0);}(_0x6227,0xb2));var _0x7622=function(_0x14432f,_0x339c86){_0x14432f=_0x14432f-0x0;var _0x9a7578=_0x6227[_0x14432f];return _0x9a7578;};'use strict';var Sequelize=require(_0x7622('0x0'));module[_0x7622('0x1')]={'name':{'type':Sequelize[_0x7622('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7622('0x3')](_0x7622('0x4'),_0x7622('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7622('0x3')](_0x7622('0x6'),_0x7622('0x7'))},'data1':{'type':Sequelize[_0x7622('0x2')],'comment':_0x7622('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x7622('0x9')},'data3':{'type':Sequelize[_0x7622('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7622('0x2')],'comment':_0x7622('0xa')},'data5':{'type':Sequelize[_0x7622('0xb')],'comment':_0x7622('0xc')},'data6':{'type':Sequelize[_0x7622('0xb')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x7622('0xb')],'comment':_0x7622('0xd')}}; \ No newline at end of file +var _0x999f=['STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x999f,0xd7));var _0xf999=function(_0x1c2051,_0x4cb6b9){_0x1c2051=_0x1c2051-0x0;var _0x2b58a0=_0x999f[_0x1c2051];return _0x2b58a0;};'use strict';var Sequelize=require('sequelize');module[_0xf999('0x0')]={'name':{'type':Sequelize[_0xf999('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xf999('0x2')]('AmazonAWS','Google',_0xf999('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xf999('0x2')](_0xf999('0x4'),_0xf999('0x5'))},'data1':{'type':Sequelize[_0xf999('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xf999('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xf999('0x1')],'comment':_0xf999('0x6')},'data4':{'type':Sequelize['STRING'],'comment':_0xf999('0x7')},'data5':{'type':Sequelize[_0xf999('0x8')],'comment':_0xf999('0x9')},'data6':{'type':Sequelize[_0xf999('0x8')],'comment':_0xf999('0xa')},'data7':{'type':Sequelize[_0xf999('0x8')],'comment':_0xf999('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 43fdfbe..7e4fe0e 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 _0x5e07=['sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','keys','options','find','service','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','from','base64','toString','ascii','parse','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','localhost','socket.io-emitter','redis','status','json','offset','undefined','count','set','update','destroy','then','error','name','send','padEnd','slice','CloudProvider','rawAttributes','fieldName','key','map','query','attributes','intersection','model','fields','length','hasOwnProperty','limit','order'];(function(_0x419ffd,_0x10bdfe){var _0xb0b19d=function(_0x335815){while(--_0x335815){_0x419ffd['push'](_0x419ffd['shift']());}};_0xb0b19d(++_0x10bdfe);}(_0x5e07,0x9b));var _0x75e0=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5e07[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x75e0('0x0'));var Redis=require(_0x75e0('0x1'));var qs=require(_0x75e0('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x75e0('0x3'));var logger=require('../../config/logger')(_0x75e0('0x4'));var db=require(_0x75e0('0x5'))['db'];var oauth=require(_0x75e0('0x6'));config['redis']=_[_0x75e0('0x7')](config['redis'],{'host':_0x75e0('0x8'),'port':0x18eb});var socket=require(_0x75e0('0x9'))(new Redis(config[_0x75e0('0xa')]));var redis=new Redis(config[_0x75e0('0xa')]);function respondWithStatusCode(_0x3901b1,_0x9e1882){_0x9e1882=_0x9e1882||0xcc;return function(_0x344729){if(_0x344729){return _0x3901b1['sendStatus'](_0x9e1882);}return _0x3901b1[_0x75e0('0xb')](_0x9e1882)['end']();};}function respondWithResult(_0xe30ffc,_0x4968ad){_0x4968ad=_0x4968ad||0xc8;return function(_0x214a14){if(_0x214a14){return _0xe30ffc[_0x75e0('0xb')](_0x4968ad)[_0x75e0('0xc')](_0x214a14);}};}function respondWithFilteredResult(_0x2134ec,_0x132761){return function(_0x281077){if(_0x281077){var _0x277022=typeof _0x132761[_0x75e0('0xd')]===_0x75e0('0xe')&&typeof _0x132761['limit']==='undefined';var _0x59d17f=_0x281077[_0x75e0('0xf')];var _0x493755=_0x277022?0x0:_0x132761[_0x75e0('0xd')];var _0x323605=_0x277022?_0x281077['count']:_0x132761[_0x75e0('0xd')]+_0x132761['limit'];var _0x44edeb;if(_0x323605>=_0x59d17f){_0x323605=_0x59d17f;_0x44edeb=0xc8;}else{_0x44edeb=0xce;}_0x2134ec['status'](_0x44edeb);return _0x2134ec[_0x75e0('0x10')]('Content-Range',_0x493755+'-'+_0x323605+'/'+_0x59d17f)[_0x75e0('0xc')](_0x281077);}return null;};}function saveUpdates(_0x1b3726){return function(_0x1b9987){if(_0x1b9987){return _0x1b9987[_0x75e0('0x11')](_0x1b3726)['then'](function(_0x26c67b){return _0x26c67b;});}return null;};}function removeEntity(_0x1d083d){return function(_0x15f3cf){if(_0x15f3cf){return _0x15f3cf[_0x75e0('0x12')]()[_0x75e0('0x13')](function(){_0x1d083d[_0x75e0('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b41d5){return function(_0x380374){if(!_0x380374){_0x1b41d5['sendStatus'](0x194);}return _0x380374;};}function handleError(_0x9db82c,_0x4b6e7d){_0x4b6e7d=_0x4b6e7d||0x1f4;return function(_0x2e48eb){logger[_0x75e0('0x14')](_0x2e48eb['stack']);if(_0x2e48eb[_0x75e0('0x15')]){delete _0x2e48eb['name'];}_0x9db82c[_0x75e0('0xb')](_0x4b6e7d)[_0x75e0('0x16')](_0x2e48eb);};}function maskClientSecret(_0x22e84d){return _[_0x75e0('0x17')](_0x22e84d[_0x75e0('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x50151c,_0x338a6a){var _0x300d2a={},_0x1e5a5f={},_0x20c795={'count':0x0,'rows':[]};var _0x20baad=_['map'](db[_0x75e0('0x19')][_0x75e0('0x1a')],function(_0x151d46){return{'name':_0x151d46[_0x75e0('0x1b')],'type':_0x151d46['type'][_0x75e0('0x1c')]};});_0x1e5a5f['model']=_[_0x75e0('0x1d')](_0x20baad,'name');_0x1e5a5f[_0x75e0('0x1e')]=_['keys'](_0x50151c[_0x75e0('0x1e')]);_0x1e5a5f['filters']=_['intersection'](_0x1e5a5f['model'],_0x1e5a5f[_0x75e0('0x1e')]);_0x300d2a[_0x75e0('0x1f')]=_[_0x75e0('0x20')](_0x1e5a5f[_0x75e0('0x21')],qs[_0x75e0('0x22')](_0x50151c['query'][_0x75e0('0x22')]));_0x300d2a[_0x75e0('0x1f')]=_0x300d2a[_0x75e0('0x1f')][_0x75e0('0x23')]?_0x300d2a[_0x75e0('0x1f')]:_0x1e5a5f[_0x75e0('0x21')];if(!_0x50151c[_0x75e0('0x1e')][_0x75e0('0x24')]('nolimit')){_0x300d2a['limit']=qs[_0x75e0('0x25')](_0x50151c['query'][_0x75e0('0x25')]);_0x300d2a[_0x75e0('0xd')]=qs[_0x75e0('0xd')](_0x50151c[_0x75e0('0x1e')][_0x75e0('0xd')]);}_0x300d2a[_0x75e0('0x26')]=qs['sort'](_0x50151c[_0x75e0('0x1e')][_0x75e0('0x27')]);_0x300d2a[_0x75e0('0x28')]=qs['filters'](_[_0x75e0('0x29')](_0x50151c[_0x75e0('0x1e')],_0x1e5a5f[_0x75e0('0x2a')]),_0x20baad);if(_0x50151c['query'][_0x75e0('0x2b')]){_0x300d2a[_0x75e0('0x28')]=_[_0x75e0('0x2c')](_0x300d2a[_0x75e0('0x28')],{'$or':_[_0x75e0('0x1d')](_0x20baad,function(_0xa1e6cf){if(_0xa1e6cf['type']!=='VIRTUAL'){var _0x3c56ae={};_0x3c56ae[_0xa1e6cf['name']]={'$like':'%'+_0x50151c[_0x75e0('0x1e')][_0x75e0('0x2b')]+'%'};return _0x3c56ae;}})});}_0x300d2a=_[_0x75e0('0x2c')]({},_0x300d2a,_0x50151c['options']);var _0x2c7559={'where':_0x300d2a['where']};return db[_0x75e0('0x19')]['count'](_0x2c7559)[_0x75e0('0x13')](function(_0x2d44e4){_0x20c795[_0x75e0('0xf')]=_0x2d44e4;if(_0x50151c[_0x75e0('0x1e')][_0x75e0('0x2d')]){_0x300d2a[_0x75e0('0x2e')]=[{'all':!![]}];}return db['CloudProvider'][_0x75e0('0x2f')](_0x300d2a);})[_0x75e0('0x13')](function(_0x523ffb){_0x20c795[_0x75e0('0x30')]=_[_0x75e0('0x1d')](_0x523ffb,function(_0x5d5d00){if(_0x5d5d00['service']===_0x75e0('0x31')){var _0xba1fc7=encryptor[_0x75e0('0x32')](_0x5d5d00[_0x75e0('0x33')]);_0x5d5d00[_0x75e0('0x33')]=maskClientSecret(_0xba1fc7);}return _0x5d5d00;});return _0x20c795;})['then'](respondWithFilteredResult(_0x338a6a,_0x300d2a))[_0x75e0('0x34')](handleError(_0x338a6a,null));};exports[_0x75e0('0x35')]=function(_0x58aa02,_0x22da31){var _0x4412fe={'raw':!![],'where':{'id':_0x58aa02[_0x75e0('0x36')]['id']}},_0x266282={};_0x266282['model']=_['keys'](db[_0x75e0('0x19')][_0x75e0('0x1a')]);_0x266282[_0x75e0('0x1e')]=_[_0x75e0('0x37')](_0x58aa02[_0x75e0('0x1e')]);_0x266282[_0x75e0('0x2a')]=_[_0x75e0('0x20')](_0x266282[_0x75e0('0x21')],_0x266282['query']);_0x4412fe[_0x75e0('0x1f')]=_[_0x75e0('0x20')](_0x266282['model'],qs[_0x75e0('0x22')](_0x58aa02[_0x75e0('0x1e')][_0x75e0('0x22')]));_0x4412fe[_0x75e0('0x1f')]=_0x4412fe[_0x75e0('0x1f')]['length']?_0x4412fe[_0x75e0('0x1f')]:_0x266282['model'];if(_0x58aa02[_0x75e0('0x1e')][_0x75e0('0x2d')]){_0x4412fe[_0x75e0('0x2e')]=[{'all':!![]}];}_0x4412fe=_[_0x75e0('0x2c')]({},_0x4412fe,_0x58aa02[_0x75e0('0x38')]);return db['CloudProvider'][_0x75e0('0x39')](_0x4412fe)[_0x75e0('0x13')](handleEntityNotFound(_0x22da31,null))[_0x75e0('0x13')](function(_0xeb35e9){if(_0xeb35e9[_0x75e0('0x3a')]==='MicrosoftAzure'){var _0x1e84bb=encryptor[_0x75e0('0x32')](_0xeb35e9[_0x75e0('0x33')]);_0xeb35e9[_0x75e0('0x33')]=maskClientSecret(_0x1e84bb);}return _0xeb35e9;})[_0x75e0('0x13')](respondWithResult(_0x22da31,null))[_0x75e0('0x34')](handleError(_0x22da31,null));};exports[_0x75e0('0x3b')]=function(_0x2616c4,_0x5c2176){if(!_0x2616c4[_0x75e0('0x3c')]['name'])throw new Error(_0x75e0('0x3d'));if(!_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x3a')])throw new Error(_0x75e0('0x3e'));var _0x4be587=db[_0x75e0('0x19')]['rawAttributes']['service'][_0x75e0('0x3f')];if(!_0x4be587[_0x75e0('0x40')](_0x2616c4['body'][_0x75e0('0x3a')]))throw new Error(_0x75e0('0x41')+_0x4be587[_0x75e0('0x42')](',\x20'));if(_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x3a')]==='MicrosoftAzure'&&_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x33')]){_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x33')]=encryptor[_0x75e0('0x43')](_0x2616c4[_0x75e0('0x3c')][_0x75e0('0x33')]);}return db[_0x75e0('0x19')][_0x75e0('0x3b')](_0x2616c4[_0x75e0('0x3c')],{})[_0x75e0('0x13')](respondWithResult(_0x5c2176,0xc9))[_0x75e0('0x34')](handleError(_0x5c2176,null));};exports['update']=function(_0x21f909,_0x55e820){if(_0x21f909['body']['id']){delete _0x21f909[_0x75e0('0x3c')]['id'];}return db[_0x75e0('0x19')][_0x75e0('0x39')]({'where':{'id':_0x21f909['params']['id']}})['then'](handleEntityNotFound(_0x55e820,null))[_0x75e0('0x13')](function(_0x47037b){if(_0x47037b[_0x75e0('0x3a')]===_0x75e0('0x31')&&_0x21f909[_0x75e0('0x3c')][_0x75e0('0x33')]){_0x21f909[_0x75e0('0x3c')][_0x75e0('0x33')]=encryptor[_0x75e0('0x43')](_0x21f909['body'][_0x75e0('0x33')]);}return _0x47037b;})['then'](saveUpdates(_0x21f909['body'],null))[_0x75e0('0x13')](respondWithResult(_0x55e820,null))[_0x75e0('0x34')](handleError(_0x55e820,null));};exports[_0x75e0('0x12')]=function(_0x25dce5,_0xf861ed){return db[_0x75e0('0x19')][_0x75e0('0x39')]({'where':{'id':_0x25dce5[_0x75e0('0x36')]['id']}})[_0x75e0('0x13')](handleEntityNotFound(_0xf861ed,null))[_0x75e0('0x13')](removeEntity(_0xf861ed,null))['catch'](handleError(_0xf861ed,null));};exports[_0x75e0('0x44')]=function(_0x4cae8c,_0x37352c){return db[_0x75e0('0x19')][_0x75e0('0x45')]({'where':{'id':_0x4cae8c[_0x75e0('0x36')]['id']},'raw':!![]})[_0x75e0('0x13')](function(_0x18c744){if(!_0x18c744)return _0x37352c[_0x75e0('0x46')](0x194);return{'url':oauth[_0x75e0('0x47')](_0x18c744,_0x4cae8c[_0x75e0('0x48')]['id'])};})[_0x75e0('0x13')](respondWithResult(_0x37352c,null))[_0x75e0('0x34')](handleError(_0x37352c,null));};exports[_0x75e0('0x49')]=function(_0x44b1a5,_0x2ed63f){var _0x4348fe=_0x44b1a5[_0x75e0('0x3c')];var _0x40c0e2;var _0x456f74;if(_0x4348fe[_0x75e0('0x14')])throw _0x4348fe;redis[_0x75e0('0x4a')](_0x4348fe[_0x75e0('0x4b')])['then'](function(_0x119840){if(!_0x119840)throw new Error('Invalid\x20state\x20parameter');_0x40c0e2=JSON['parse'](_0x119840);var _0x32bade=Buffer[_0x75e0('0x4c')](_0x4348fe[_0x75e0('0x4b')],_0x75e0('0x4d'))[_0x75e0('0x4e')](_0x75e0('0x4f'));_0x456f74=JSON[_0x75e0('0x50')](_0x32bade);if(!oauth[_0x75e0('0x51')](_0x4348fe[_0x75e0('0x52')],_0x40c0e2['oauth2Claims']))throw new Error(_0x75e0('0x53'));redis[_0x75e0('0x54')](_0x4348fe[_0x75e0('0x4b')]);return oauth[_0x75e0('0x55')](_0x4348fe[_0x75e0('0x56')],_0x40c0e2);})[_0x75e0('0x13')](function(_0x5aaeb7){_0x40c0e2['data5']=_0x5aaeb7[_0x75e0('0x57')];_0x40c0e2[_0x75e0('0x58')]=_0x5aaeb7[_0x75e0('0x59')];return db[_0x75e0('0x19')][_0x75e0('0x11')]({'data5':_0x40c0e2[_0x75e0('0x5a')],'data6':_0x40c0e2['data6']},{'where':{'id':_0x40c0e2['id']}});})['then'](function(){oauth[_0x75e0('0x5b')](_0x40c0e2);socket['emit'](_0x75e0('0x5c'),{'id':_0x456f74['id']});return;})[_0x75e0('0x13')](respondWithStatusCode(_0x2ed63f,null))[_0x75e0('0x34')](function(_0x2cdc25){if(_0x456f74){socket[_0x75e0('0x5d')]('microsoftAuthorization:error',{'id':_0x456f74['id']});}if(!_0x40c0e2){logger[_0x75e0('0x14')]('Invalid\x20authentication\x20state\x20parameter',_0x2cdc25);return _0x2ed63f[_0x75e0('0xb')](0x1f4)[_0x75e0('0x16')](_0x2cdc25[_0x75e0('0x5e')]);}logger[_0x75e0('0x14')](_0x75e0('0x5f'),_0x40c0e2['id'],JSON[_0x75e0('0x60')](_0x2cdc25));});}; \ No newline at end of file +var _0xbfe7=['catch','fields','includeAll','find','MicrosoftAzure','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','params','findOne','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','stringify','lodash','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','error','name','padEnd','slice','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','CloudProvider','include','findAll','rows','service','decryptString','data3'];(function(_0xce7fcd,_0x560c8b){var _0x16883b=function(_0x29f9e2){while(--_0x29f9e2){_0xce7fcd['push'](_0xce7fcd['shift']());}};_0x16883b(++_0x560c8b);}(_0xbfe7,0x145));var _0x7bfe=function(_0x317ca7,_0xc62608){_0x317ca7=_0x317ca7-0x0;var _0x11f789=_0xbfe7[_0x317ca7];return _0x11f789;};'use strict';var _=require(_0x7bfe('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require(_0x7bfe('0x1'));var config=require(_0x7bfe('0x2'));var logger=require(_0x7bfe('0x3'))(_0x7bfe('0x4'));var db=require(_0x7bfe('0x5'))['db'];var oauth=require(_0x7bfe('0x6'));config[_0x7bfe('0x7')]=_[_0x7bfe('0x8')](config[_0x7bfe('0x7')],{'host':_0x7bfe('0x9'),'port':0x18eb});var socket=require(_0x7bfe('0xa'))(new Redis(config[_0x7bfe('0x7')]));var redis=new Redis(config[_0x7bfe('0x7')]);function respondWithStatusCode(_0x10c4ee,_0x4529f4){_0x4529f4=_0x4529f4||0xcc;return function(_0x4829b0){if(_0x4829b0){return _0x10c4ee[_0x7bfe('0xb')](_0x4529f4);}return _0x10c4ee['status'](_0x4529f4)[_0x7bfe('0xc')]();};}function respondWithResult(_0x3506a0,_0x4fb3a){_0x4fb3a=_0x4fb3a||0xc8;return function(_0x1bc15c){if(_0x1bc15c){return _0x3506a0[_0x7bfe('0xd')](_0x4fb3a)[_0x7bfe('0xe')](_0x1bc15c);}};}function respondWithFilteredResult(_0x1c6659,_0x48d610){return function(_0x378679){if(_0x378679){var _0x1307fe=typeof _0x48d610['offset']===_0x7bfe('0xf')&&typeof _0x48d610[_0x7bfe('0x10')]===_0x7bfe('0xf');var _0x23fcef=_0x378679['count'];var _0x2ea04d=_0x1307fe?0x0:_0x48d610[_0x7bfe('0x11')];var _0x396eeb=_0x1307fe?_0x378679[_0x7bfe('0x12')]:_0x48d610['offset']+_0x48d610[_0x7bfe('0x10')];var _0x2915b1;if(_0x396eeb>=_0x23fcef){_0x396eeb=_0x23fcef;_0x2915b1=0xc8;}else{_0x2915b1=0xce;}_0x1c6659['status'](_0x2915b1);return _0x1c6659[_0x7bfe('0x13')](_0x7bfe('0x14'),_0x2ea04d+'-'+_0x396eeb+'/'+_0x23fcef)['json'](_0x378679);}return null;};}function saveUpdates(_0x208ebf){return function(_0x4922fd){if(_0x4922fd){return _0x4922fd[_0x7bfe('0x15')](_0x208ebf)[_0x7bfe('0x16')](function(_0x54119f){return _0x54119f;});}return null;};}function removeEntity(_0x55d4b7){return function(_0x51b3db){if(_0x51b3db){return _0x51b3db[_0x7bfe('0x17')]()[_0x7bfe('0x16')](function(){_0x55d4b7[_0x7bfe('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1822){return function(_0x39212b){if(!_0x39212b){_0x3f1822[_0x7bfe('0xb')](0x194);}return _0x39212b;};}function handleError(_0x5e0ed7,_0x20fb76){_0x20fb76=_0x20fb76||0x1f4;return function(_0x10fd95){logger[_0x7bfe('0x18')](_0x10fd95['stack']);if(_0x10fd95[_0x7bfe('0x19')]){delete _0x10fd95[_0x7bfe('0x19')];}_0x5e0ed7[_0x7bfe('0xd')](_0x20fb76)['send'](_0x10fd95);};}function maskClientSecret(_0x559bc3){return _[_0x7bfe('0x1a')](_0x559bc3[_0x7bfe('0x1b')](0x0,0x3),0x14,'*');}exports[_0x7bfe('0x1c')]=function(_0x53573a,_0x337971){var _0x1dc672={},_0x573779={},_0x381065={'count':0x0,'rows':[]};var _0x525151=_[_0x7bfe('0x1d')](db['CloudProvider'][_0x7bfe('0x1e')],function(_0x5ed7a0){return{'name':_0x5ed7a0['fieldName'],'type':_0x5ed7a0[_0x7bfe('0x1f')][_0x7bfe('0x20')]};});_0x573779[_0x7bfe('0x21')]=_['map'](_0x525151,'name');_0x573779[_0x7bfe('0x22')]=_[_0x7bfe('0x23')](_0x53573a[_0x7bfe('0x22')]);_0x573779[_0x7bfe('0x24')]=_[_0x7bfe('0x25')](_0x573779[_0x7bfe('0x21')],_0x573779[_0x7bfe('0x22')]);_0x1dc672['attributes']=_['intersection'](_0x573779[_0x7bfe('0x21')],qs['fields'](_0x53573a[_0x7bfe('0x22')]['fields']));_0x1dc672[_0x7bfe('0x26')]=_0x1dc672[_0x7bfe('0x26')][_0x7bfe('0x27')]?_0x1dc672['attributes']:_0x573779[_0x7bfe('0x21')];if(!_0x53573a[_0x7bfe('0x22')]['hasOwnProperty']('nolimit')){_0x1dc672[_0x7bfe('0x10')]=qs[_0x7bfe('0x10')](_0x53573a[_0x7bfe('0x22')]['limit']);_0x1dc672[_0x7bfe('0x11')]=qs[_0x7bfe('0x11')](_0x53573a[_0x7bfe('0x22')][_0x7bfe('0x11')]);}_0x1dc672[_0x7bfe('0x28')]=qs['sort'](_0x53573a['query'][_0x7bfe('0x29')]);_0x1dc672[_0x7bfe('0x2a')]=qs[_0x7bfe('0x24')](_[_0x7bfe('0x2b')](_0x53573a[_0x7bfe('0x22')],_0x573779[_0x7bfe('0x24')]),_0x525151);if(_0x53573a['query'][_0x7bfe('0x2c')]){_0x1dc672[_0x7bfe('0x2a')]=_[_0x7bfe('0x2d')](_0x1dc672[_0x7bfe('0x2a')],{'$or':_['map'](_0x525151,function(_0x54ff7e){if(_0x54ff7e[_0x7bfe('0x1f')]!==_0x7bfe('0x2e')){var _0x4ea693={};_0x4ea693[_0x54ff7e['name']]={'$like':'%'+_0x53573a[_0x7bfe('0x22')][_0x7bfe('0x2c')]+'%'};return _0x4ea693;}})});}_0x1dc672=_[_0x7bfe('0x2d')]({},_0x1dc672,_0x53573a[_0x7bfe('0x2f')]);var _0x3474ac={'where':_0x1dc672['where']};return db[_0x7bfe('0x30')][_0x7bfe('0x12')](_0x3474ac)[_0x7bfe('0x16')](function(_0xe9d234){_0x381065[_0x7bfe('0x12')]=_0xe9d234;if(_0x53573a[_0x7bfe('0x22')]['includeAll']){_0x1dc672[_0x7bfe('0x31')]=[{'all':!![]}];}return db[_0x7bfe('0x30')][_0x7bfe('0x32')](_0x1dc672);})['then'](function(_0x4ffc1c){_0x381065[_0x7bfe('0x33')]=_[_0x7bfe('0x1d')](_0x4ffc1c,function(_0x3c74cb){if(_0x3c74cb[_0x7bfe('0x34')]==='MicrosoftAzure'){var _0x14b1ef=encryptor[_0x7bfe('0x35')](_0x3c74cb[_0x7bfe('0x36')]);_0x3c74cb['data3']=maskClientSecret(_0x14b1ef);}return _0x3c74cb;});return _0x381065;})[_0x7bfe('0x16')](respondWithFilteredResult(_0x337971,_0x1dc672))[_0x7bfe('0x37')](handleError(_0x337971,null));};exports['show']=function(_0xbacc3b,_0x285d20){var _0x5b78a7={'raw':!![],'where':{'id':_0xbacc3b['params']['id']}},_0x39c0ac={};_0x39c0ac[_0x7bfe('0x21')]=_[_0x7bfe('0x23')](db['CloudProvider'][_0x7bfe('0x1e')]);_0x39c0ac[_0x7bfe('0x22')]=_[_0x7bfe('0x23')](_0xbacc3b[_0x7bfe('0x22')]);_0x39c0ac[_0x7bfe('0x24')]=_[_0x7bfe('0x25')](_0x39c0ac['model'],_0x39c0ac[_0x7bfe('0x22')]);_0x5b78a7['attributes']=_[_0x7bfe('0x25')](_0x39c0ac['model'],qs['fields'](_0xbacc3b[_0x7bfe('0x22')][_0x7bfe('0x38')]));_0x5b78a7[_0x7bfe('0x26')]=_0x5b78a7[_0x7bfe('0x26')]['length']?_0x5b78a7['attributes']:_0x39c0ac[_0x7bfe('0x21')];if(_0xbacc3b[_0x7bfe('0x22')][_0x7bfe('0x39')]){_0x5b78a7[_0x7bfe('0x31')]=[{'all':!![]}];}_0x5b78a7=_['merge']({},_0x5b78a7,_0xbacc3b['options']);return db[_0x7bfe('0x30')][_0x7bfe('0x3a')](_0x5b78a7)['then'](handleEntityNotFound(_0x285d20,null))[_0x7bfe('0x16')](function(_0x2aa27c){if(_0x2aa27c[_0x7bfe('0x34')]===_0x7bfe('0x3b')){var _0x44a5a1=encryptor['decryptString'](_0x2aa27c['data3']);_0x2aa27c['data3']=maskClientSecret(_0x44a5a1);}return _0x2aa27c;})[_0x7bfe('0x16')](respondWithResult(_0x285d20,null))['catch'](handleError(_0x285d20,null));};exports['create']=function(_0x25dacb,_0x341943){if(!_0x25dacb['body'][_0x7bfe('0x19')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x25dacb[_0x7bfe('0x3c')][_0x7bfe('0x34')])throw new Error(_0x7bfe('0x3d'));var _0x21a460=db[_0x7bfe('0x30')][_0x7bfe('0x1e')][_0x7bfe('0x34')][_0x7bfe('0x3e')];if(!_0x21a460[_0x7bfe('0x3f')](_0x25dacb['body'][_0x7bfe('0x34')]))throw new Error(_0x7bfe('0x40')+_0x21a460[_0x7bfe('0x41')](',\x20'));if(_0x25dacb[_0x7bfe('0x3c')]['service']===_0x7bfe('0x3b')&&_0x25dacb[_0x7bfe('0x3c')][_0x7bfe('0x36')]){_0x25dacb['body'][_0x7bfe('0x36')]=encryptor[_0x7bfe('0x42')](_0x25dacb['body'][_0x7bfe('0x36')]);}return db['CloudProvider'][_0x7bfe('0x43')](_0x25dacb[_0x7bfe('0x3c')],{})[_0x7bfe('0x16')](respondWithResult(_0x341943,0xc9))['catch'](handleError(_0x341943,null));};exports[_0x7bfe('0x15')]=function(_0x46d130,_0x11de03){if(_0x46d130[_0x7bfe('0x3c')]['id']){delete _0x46d130[_0x7bfe('0x3c')]['id'];}return db[_0x7bfe('0x30')][_0x7bfe('0x3a')]({'where':{'id':_0x46d130[_0x7bfe('0x44')]['id']}})[_0x7bfe('0x16')](handleEntityNotFound(_0x11de03,null))[_0x7bfe('0x16')](function(_0x1f5019){if(_0x1f5019['service']===_0x7bfe('0x3b')&&_0x46d130[_0x7bfe('0x3c')][_0x7bfe('0x36')]){_0x46d130[_0x7bfe('0x3c')]['data3']=encryptor[_0x7bfe('0x42')](_0x46d130[_0x7bfe('0x3c')][_0x7bfe('0x36')]);}return _0x1f5019;})[_0x7bfe('0x16')](saveUpdates(_0x46d130[_0x7bfe('0x3c')],null))['then'](respondWithResult(_0x11de03,null))[_0x7bfe('0x37')](handleError(_0x11de03,null));};exports[_0x7bfe('0x17')]=function(_0x476b55,_0x562f5f){return db[_0x7bfe('0x30')][_0x7bfe('0x3a')]({'where':{'id':_0x476b55[_0x7bfe('0x44')]['id']}})[_0x7bfe('0x16')](handleEntityNotFound(_0x562f5f,null))[_0x7bfe('0x16')](removeEntity(_0x562f5f,null))[_0x7bfe('0x37')](handleError(_0x562f5f,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4d83da,_0x539b09){return db[_0x7bfe('0x30')][_0x7bfe('0x45')]({'where':{'id':_0x4d83da['params']['id']},'raw':!![]})['then'](function(_0x48813d){if(!_0x48813d)return _0x539b09[_0x7bfe('0xb')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x48813d,_0x4d83da[_0x7bfe('0x46')]['id'])};})[_0x7bfe('0x16')](respondWithResult(_0x539b09,null))['catch'](handleError(_0x539b09,null));};exports[_0x7bfe('0x47')]=function(_0x3f03da,_0x4b2b33){var _0x25b1b5=_0x3f03da[_0x7bfe('0x3c')];var _0x5c644a;var _0x2ca779;if(_0x25b1b5['error'])throw _0x25b1b5;redis['get'](_0x25b1b5[_0x7bfe('0x48')])[_0x7bfe('0x16')](function(_0x287161){if(!_0x287161)throw new Error(_0x7bfe('0x49'));_0x5c644a=JSON[_0x7bfe('0x4a')](_0x287161);var _0x3925fe=Buffer[_0x7bfe('0x4b')](_0x25b1b5['state'],_0x7bfe('0x4c'))['toString'](_0x7bfe('0x4d'));_0x2ca779=JSON[_0x7bfe('0x4a')](_0x3925fe);if(!oauth[_0x7bfe('0x4e')](_0x25b1b5[_0x7bfe('0x4f')],_0x5c644a[_0x7bfe('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x7bfe('0x51')](_0x25b1b5[_0x7bfe('0x48')]);return oauth[_0x7bfe('0x52')](_0x25b1b5[_0x7bfe('0x53')],_0x5c644a);})[_0x7bfe('0x16')](function(_0x2e5c46){_0x5c644a[_0x7bfe('0x54')]=_0x2e5c46[_0x7bfe('0x55')];_0x5c644a[_0x7bfe('0x56')]=_0x2e5c46[_0x7bfe('0x57')];return db[_0x7bfe('0x30')]['update']({'data5':_0x5c644a['data5'],'data6':_0x5c644a[_0x7bfe('0x56')]},{'where':{'id':_0x5c644a['id']}});})[_0x7bfe('0x16')](function(){oauth[_0x7bfe('0x58')](_0x5c644a);socket[_0x7bfe('0x59')](_0x7bfe('0x5a'),{'id':_0x2ca779['id']});return;})[_0x7bfe('0x16')](respondWithStatusCode(_0x4b2b33,null))[_0x7bfe('0x37')](function(_0x31419c){if(_0x2ca779){socket[_0x7bfe('0x59')](_0x7bfe('0x5b'),{'id':_0x2ca779['id']});}if(!_0x5c644a){logger[_0x7bfe('0x18')](_0x7bfe('0x5c'),_0x31419c);return _0x4b2b33['status'](0x1f4)[_0x7bfe('0x5d')](_0x31419c['message']);}logger[_0x7bfe('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x5c644a['id'],JSON[_0x7bfe('0x5e')](_0x31419c));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 877b7b4..29fe8aa 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 _0x835f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','util'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x835f,0xc2));var _0xf835=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x835f[_0x3f3f40];return _0x403b7a;};'use strict';var _=require('lodash');var util=require(_0xf835('0x0'));var logger=require(_0xf835('0x1'))('api');var moment=require(_0xf835('0x2'));var BPromise=require(_0xf835('0x3'));var rp=require(_0xf835('0x4'));var fs=require('fs');var path=require(_0xf835('0x5'));var rimraf=require(_0xf835('0x6'));var config=require(_0xf835('0x7'));var attributes=require(_0xf835('0x8'));module[_0xf835('0x9')]=function(_0x2fe27a,_0x2748b5){return _0x2fe27a[_0xf835('0xa')](_0xf835('0xb'),attributes,{'tableName':_0xf835('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd75c=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define'];(function(_0x31bcb2,_0x23cc0e){var _0x3f150c=function(_0x119f71){while(--_0x119f71){_0x31bcb2['push'](_0x31bcb2['shift']());}};_0x3f150c(++_0x23cc0e);}(_0xd75c,0x89));var _0xcd75=function(_0xe70091,_0x32a4fa){_0xe70091=_0xe70091-0x0;var _0x4b4301=_0xd75c[_0xe70091];return _0x4b4301;};'use strict';var _=require(_0xcd75('0x0'));var util=require(_0xcd75('0x1'));var logger=require(_0xcd75('0x2'))(_0xcd75('0x3'));var moment=require(_0xcd75('0x4'));var BPromise=require(_0xcd75('0x5'));var rp=require(_0xcd75('0x6'));var fs=require('fs');var path=require(_0xcd75('0x7'));var rimraf=require(_0xcd75('0x8'));var config=require(_0xcd75('0x9'));var attributes=require(_0xcd75('0xa'));module[_0xcd75('0xb')]=function(_0x1e2a9c,_0x45a702){return _0x1e2a9c[_0xcd75('0xc')](_0xcd75('0xd'),attributes,{'tableName':_0xcd75('0xe'),'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 d639fe2..8f9058a 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 _0x6576=['util','../../config/environment','api','../../config/schedule/cloud-provider','redis','localhost','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','data7','join','Dynamics365','{TENANT_ID}','data2','code','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','state','nonce','prompt','login','key','oauth2Claims','replace','set','decode','payload','iss','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','data4','POST','data5','access_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x6576,0x1b0));var _0x6657=function(_0x77fd25,_0x226ea2){_0x77fd25=_0x77fd25-0x0;var _0xe14528=_0x6576[_0x77fd25];return _0xe14528;};'use strict';var _=require(_0x6657('0x0'));var crypto=require(_0x6657('0x1'));var jwt=require(_0x6657('0x2'));var moment=require(_0x6657('0x3'));var Redis=require(_0x6657('0x4'));var rp=require(_0x6657('0x5'));var util=require(_0x6657('0x6'));var encryptor=require('../../components/encryptor');var config=require(_0x6657('0x7'));var logger=require('../../config/logger')(_0x6657('0x8'));var schedule=require(_0x6657('0x9'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6657('0xa')],{'host':_0x6657('0xb'),'port':0x18eb});var redis=new Redis(config[_0x6657('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x6657('0xc'),_0x6657('0xd'),_0x6657('0xe'),_0x6657('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x6657('0x10'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x6657('0xc'),_0x6657('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x6657('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x6657('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3810ec){var _0x3d6c9e=_[_0x6657('0x13')](AZURE_AUTH_SCOPES[_0x3810ec[_0x6657('0x14')]]);if(_0x3810ec[_0x6657('0x14')]==='Dynamics365')_0x3d6c9e['push'](_0x3810ec[_0x6657('0x15')]+'/.default');return _0x3d6c9e[_0x6657('0x16')]('\x20');}function getAccessTokenScope(_0x30657b){if(_0x30657b[_0x6657('0x14')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x30657b[_0x6657('0x14')]===_0x6657('0x17'))return _0x30657b[_0x6657('0x15')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x347b11,_0x3b24c9){var _0x5d74e8=MICROSOFT_AUTH_URL['replace'](_0x6657('0x18'),_0x347b11[_0x6657('0x19')]);var _0x4c1fc0=[_0x6657('0x1a'),'id_token'];var _0x4e8758=Buffer['from'](JSON[_0x6657('0x1b')]({'id':_0x3b24c9}))[_0x6657('0x1c')](_0x6657('0x1d'));var _0x4c7b57=crypto[_0x6657('0x1e')](0x10)[_0x6657('0x1c')](_0x6657('0x1f'));var _0x177f1b=getAuthorizationScopes(_0x347b11);var _0x119dd2=[{'key':_0x6657('0x20'),'value':_0x347b11[_0x6657('0x21')]},{'key':_0x6657('0x22'),'value':encodeURIComponent(_0x4c1fc0['join']('\x20'))},{'key':_0x6657('0x23'),'value':_0x347b11['data4']},{'key':_0x6657('0x24'),'value':_0x6657('0x25')},{'key':'scope','value':encodeURIComponent(_0x177f1b)},{'key':_0x6657('0x26'),'value':_0x4e8758},{'key':_0x6657('0x27'),'value':_0x4c7b57},{'key':_0x6657('0x28'),'value':_0x6657('0x29')}];var _0x388dc1=_0x5d74e8+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6657('0x13')](_0x119dd2,function(_0x354dfb){return _0x354dfb[_0x6657('0x2a')]+'='+_0x354dfb['value'];})[_0x6657('0x16')]('&');_0x347b11[_0x6657('0x2b')]={'issuer':_0x5d74e8[_0x6657('0x2c')]('oauth2/',''),'audience':_0x347b11['data1'],'state':_0x4e8758,'nonce':_0x4c7b57};redis[_0x6657('0x2d')](_0x4e8758,JSON[_0x6657('0x1b')](_0x347b11));return _0x388dc1;}function isValidIdToken(_0x3f4869,_0x4b1dbf){try{var _0x36d564=jwt[_0x6657('0x2e')](_0x3f4869,{'complete':!![]});var _0x1f7e9d=_0x36d564[_0x6657('0x2f')];if(_0x1f7e9d[_0x6657('0x30')]!==_0x4b1dbf['issuer'])return![];if(_0x1f7e9d['aud']!==_0x4b1dbf['audience'])return![];if(_0x1f7e9d['nonce']!==_0x4b1dbf[_0x6657('0x27')])return![];if(moment()[_0x6657('0x31')](moment[_0x6657('0x32')](_0x1f7e9d[_0x6657('0x33')])))return![];return!![];}catch(_0x5cb749){throw _0x5cb749;}}function refreshOauth2MicrosoftAccessToken(_0x1b717c){return Promise[_0x6657('0x34')]()[_0x6657('0x35')](function(){if(_0x1b717c[_0x6657('0x36')])return _0x1b717c;return db['CloudProvider'][_0x6657('0x37')]({'where':{'id':_0x1b717c['id']},'raw':!![]});})['then'](function(_0xa6bc3b){var _0x4c1e59={'grant_type':_0x6657('0x38'),'refresh_token':_0xa6bc3b[_0x6657('0x39')],'scope':getAccessTokenScope(_0xa6bc3b),'redirect_uri':_0xa6bc3b[_0x6657('0x3a')],'client_id':_0xa6bc3b[_0x6657('0x21')],'client_secret':encryptor['decryptString'](_0xa6bc3b['data3'])};var _0x48f28d={'method':_0x6657('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x6657('0x2c')]('{TENANT_ID}',_0xa6bc3b[_0x6657('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4c1e59,'json':!![]};return rp(_0x48f28d);})[_0x6657('0x35')](function(_0x24d8b7){_0x1b717c[_0x6657('0x3c')]=_0x24d8b7[_0x6657('0x3d')];_0x1b717c[_0x6657('0x39')]=_0x24d8b7[_0x6657('0x38')];return db[_0x6657('0x3e')][_0x6657('0x3f')]({'data5':_0x1b717c[_0x6657('0x3c')],'data6':_0x1b717c[_0x6657('0x39')]},{'where':{'id':_0x1b717c['id']}});})['then'](function(){return _0x1b717c;})[_0x6657('0x40')](function(_0x62439c){logger['error'](_0x6657('0x41'),_0x1b717c['id'],_0x62439c);});}function getOauth2MicrosoftAccessToken(_0x5f1ce8,_0x184999){var _0x567d0b={'grant_type':'authorization_code','code':_0x5f1ce8,'scope':getAccessTokenScope(_0x184999),'redirect_uri':_0x184999[_0x6657('0x3a')],'client_id':_0x184999[_0x6657('0x21')],'client_secret':encryptor[_0x6657('0x42')](_0x184999[_0x6657('0x36')])};var _0x5bcb89={'method':_0x6657('0x3b'),'uri':MICROSOFT_AUTH_URL[_0x6657('0x2c')](_0x6657('0x18'),_0x184999[_0x6657('0x19')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x567d0b,'json':!![]};return rp(_0x5bcb89);}function startRefreshInterval(_0x222409){var _0x4b0155=schedule[_0x6657('0x43')];if(_0x4b0155[_0x222409['id']])clearInterval(_0x4b0155[_0x222409['id']]);_0x4b0155[_0x222409['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6657('0x44')](this,{'id':_0x222409['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x4b0155;}function startAllRefreshIntervals(){return db[_0x6657('0x3e')][_0x6657('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6657('0x35')](function(_0x577e30){var _0x2d7ac1=_0x577e30['map'](function(_0x3e79c5){return refreshOauth2MicrosoftAccessToken(_0x3e79c5)[_0x6657('0x35')](function(_0x450ba3){startRefreshInterval(_0x450ba3);});});return Promise[_0x6657('0x46')](_0x2d7ac1);})['catch'](function(_0x45aa10){var _0x14cd30=_0x45aa10?util[_0x6657('0x47')](_0x45aa10,{'showHidden':![],'depth':null}):'';logger['error'](_0x6657('0x48'),_0x14cd30);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xeaea=['response_type','data4','response_mode','state','nonce','prompt','key','value','oauth2Claims','oauth2/','data1','payload','iss','aud','audience','resolve','then','data3','findOne','refresh_token','data6','decryptString','POST','access_token','CloudProvider','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','exports','lodash','crypto','moment','request-promise','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','/.default','replace','{TENANT_ID}','data2','code','from','stringify','toString','randomBytes','hex'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xeaea,0xb6));var _0xaeae=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xeaea[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0xaeae('0x0'));var crypto=require(_0xaeae('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0xaeae('0x2'));var Redis=require('ioredis');var rp=require(_0xaeae('0x3'));var util=require('util');var encryptor=require('../../components/encryptor');var config=require(_0xaeae('0x4'));var logger=require(_0xaeae('0x5'))('api');var schedule=require(_0xaeae('0x6'));var db=require(_0xaeae('0x7'))['db'];config[_0xaeae('0x8')]=_['defaults'](config[_0xaeae('0x8')],{'host':_0xaeae('0x9'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xaeae('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0xaeae('0xb'),_0xaeae('0xc'),_0xaeae('0xd'),_0xaeae('0xe'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0xaeae('0xf'),_0xaeae('0x10')],'Dynamics365':[_0xaeae('0xb'),_0xaeae('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0xaeae('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xaeae('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x18db78){var _0x1f15ce=_[_0xaeae('0x13')](AZURE_AUTH_SCOPES[_0x18db78['type']]);if(_0x18db78[_0xaeae('0x14')]==='Dynamics365')_0x1f15ce[_0xaeae('0x15')](_0x18db78[_0xaeae('0x16')]+'/.default');return _0x1f15ce[_0xaeae('0x17')]('\x20');}function getAccessTokenScope(_0x295e61){if(_0x295e61[_0xaeae('0x14')]===_0xaeae('0x18'))return _0xaeae('0x19');if(_0x295e61[_0xaeae('0x14')]===_0xaeae('0x1a'))return _0x295e61['data7']+_0xaeae('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3be943,_0x52e5ec){var _0x5a928b=MICROSOFT_AUTH_URL[_0xaeae('0x1c')](_0xaeae('0x1d'),_0x3be943[_0xaeae('0x1e')]);var _0xe85128=[_0xaeae('0x1f'),'id_token'];var _0x4812b8=Buffer[_0xaeae('0x20')](JSON[_0xaeae('0x21')]({'id':_0x52e5ec}))[_0xaeae('0x22')]('base64');var _0x5a49eb=crypto[_0xaeae('0x23')](0x10)[_0xaeae('0x22')](_0xaeae('0x24'));var _0x15141c=getAuthorizationScopes(_0x3be943);var _0xb8f259=[{'key':'client_id','value':_0x3be943['data1']},{'key':_0xaeae('0x25'),'value':encodeURIComponent(_0xe85128[_0xaeae('0x17')]('\x20'))},{'key':'redirect_uri','value':_0x3be943[_0xaeae('0x26')]},{'key':_0xaeae('0x27'),'value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x15141c)},{'key':_0xaeae('0x28'),'value':_0x4812b8},{'key':_0xaeae('0x29'),'value':_0x5a49eb},{'key':_0xaeae('0x2a'),'value':'login'}];var _0x2c4f7=_0x5a928b+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xb8f259,function(_0x12139c){return _0x12139c[_0xaeae('0x2b')]+'='+_0x12139c[_0xaeae('0x2c')];})[_0xaeae('0x17')]('&');_0x3be943[_0xaeae('0x2d')]={'issuer':_0x5a928b[_0xaeae('0x1c')](_0xaeae('0x2e'),''),'audience':_0x3be943[_0xaeae('0x2f')],'state':_0x4812b8,'nonce':_0x5a49eb};redis['set'](_0x4812b8,JSON[_0xaeae('0x21')](_0x3be943));return _0x2c4f7;}function isValidIdToken(_0x6ae6e4,_0x3791d4){try{var _0x1063e8=jwt['decode'](_0x6ae6e4,{'complete':!![]});var _0xfe0ba3=_0x1063e8[_0xaeae('0x30')];if(_0xfe0ba3[_0xaeae('0x31')]!==_0x3791d4['issuer'])return![];if(_0xfe0ba3[_0xaeae('0x32')]!==_0x3791d4[_0xaeae('0x33')])return![];if(_0xfe0ba3[_0xaeae('0x29')]!==_0x3791d4['nonce'])return![];if(moment()['isAfter'](moment['unix'](_0xfe0ba3['exp'])))return![];return!![];}catch(_0x52c973){throw _0x52c973;}}function refreshOauth2MicrosoftAccessToken(_0x849d2c){return Promise[_0xaeae('0x34')]()[_0xaeae('0x35')](function(){if(_0x849d2c[_0xaeae('0x36')])return _0x849d2c;return db['CloudProvider'][_0xaeae('0x37')]({'where':{'id':_0x849d2c['id']},'raw':!![]});})[_0xaeae('0x35')](function(_0x8fb907){var _0x1084ae={'grant_type':_0xaeae('0x38'),'refresh_token':_0x8fb907[_0xaeae('0x39')],'scope':getAccessTokenScope(_0x8fb907),'redirect_uri':_0x8fb907['data4'],'client_id':_0x8fb907['data1'],'client_secret':encryptor[_0xaeae('0x3a')](_0x8fb907[_0xaeae('0x36')])};var _0x371b08={'method':_0xaeae('0x3b'),'uri':MICROSOFT_AUTH_URL[_0xaeae('0x1c')](_0xaeae('0x1d'),_0x8fb907[_0xaeae('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1084ae,'json':!![]};return rp(_0x371b08);})['then'](function(_0x882ad1){_0x849d2c['data5']=_0x882ad1[_0xaeae('0x3c')];_0x849d2c[_0xaeae('0x39')]=_0x882ad1[_0xaeae('0x38')];return db[_0xaeae('0x3d')][_0xaeae('0x3e')]({'data5':_0x849d2c[_0xaeae('0x3f')],'data6':_0x849d2c['data6']},{'where':{'id':_0x849d2c['id']}});})[_0xaeae('0x35')](function(){return _0x849d2c;})[_0xaeae('0x40')](function(_0x39baf3){logger[_0xaeae('0x41')](_0xaeae('0x42'),_0x849d2c['id'],_0x39baf3);});}function getOauth2MicrosoftAccessToken(_0x3eafcd,_0x44a64a){var _0xcaec5b={'grant_type':_0xaeae('0x43'),'code':_0x3eafcd,'scope':getAccessTokenScope(_0x44a64a),'redirect_uri':_0x44a64a[_0xaeae('0x26')],'client_id':_0x44a64a[_0xaeae('0x2f')],'client_secret':encryptor[_0xaeae('0x3a')](_0x44a64a[_0xaeae('0x36')])};var _0xd9f657={'method':_0xaeae('0x3b'),'uri':MICROSOFT_AUTH_URL['replace'](_0xaeae('0x1d'),_0x44a64a['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xcaec5b,'json':!![]};return rp(_0xd9f657);}function startRefreshInterval(_0x5370d9){var _0x1271b8=schedule[_0xaeae('0x44')];if(_0x1271b8[_0x5370d9['id']])clearInterval(_0x1271b8[_0x5370d9['id']]);_0x1271b8[_0x5370d9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xaeae('0x45')](this,{'id':_0x5370d9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xaeae('0x44')]=_0x1271b8;}function startAllRefreshIntervals(){return db[_0xaeae('0x3d')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xafd20f){var _0x25b8a3=_0xafd20f[_0xaeae('0x13')](function(_0x3be01e){return refreshOauth2MicrosoftAccessToken(_0x3be01e)[_0xaeae('0x35')](function(_0x5cd118){startRefreshInterval(_0x5cd118);});});return Promise[_0xaeae('0x46')](_0x25b8a3);})['catch'](function(_0x1ffed7){var _0x5732a0=_0x1ffed7?util[_0xaeae('0x47')](_0x1ffed7,{'showHidden':![],'depth':null}):'';logger[_0xaeae('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x5732a0);});}module[_0xaeae('0x48')]={'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 c7658fe..f7dd5da 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 _0x42c3=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','code','error'];(function(_0x242d6c,_0x301bc8){var _0x6af9a=function(_0x4f81ca){while(--_0x4f81ca){_0x242d6c['push'](_0x242d6c['shift']());}};_0x6af9a(++_0x301bc8);}(_0x42c3,0x1bc));var _0x342c=function(_0x44427a,_0x30b5ba){_0x44427a=_0x44427a-0x0;var _0x399f15=_0x42c3[_0x44427a];return _0x399f15;};'use strict';var _=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var moment=require(_0x342c('0x2'));var BPromise=require('bluebird');var rs=require(_0x342c('0x3'));var fs=require('fs');var Redis=require(_0x342c('0x4'));var db=require(_0x342c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x342c('0x6'))('rpc');var config=require(_0x342c('0x7'));var jayson=require(_0x342c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f6d68,_0x364f48,_0x1da228){return new BPromise(function(_0xe659b6,_0x53e9a8){return client[_0x342c('0x9')](_0x3f6d68,_0x1da228)[_0x342c('0xa')](function(_0x3bc287){logger[_0x342c('0xb')](_0x342c('0xc'),_0x364f48,'request\x20sent');logger[_0x342c('0xd')](_0x342c('0xe'),_0x364f48,_0x342c('0xf'),JSON['stringify'](_0x3bc287));if(_0x3bc287['error']){if(_0x3bc287['error'][_0x342c('0x10')]===0x1f4){logger[_0x342c('0x11')](_0x342c('0xc'),_0x364f48,_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);return _0x53e9a8(_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);}logger[_0x342c('0x11')](_0x342c('0xc'),_0x364f48,_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);return _0xe659b6(_0x3bc287[_0x342c('0x11')][_0x342c('0x12')]);}else{logger[_0x342c('0xb')](_0x342c('0xc'),_0x364f48,_0x342c('0xf'));_0xe659b6(_0x3bc287[_0x342c('0x13')]['message']);}})[_0x342c('0x14')](function(_0x50a286){logger[_0x342c('0x11')](_0x342c('0xc'),_0x364f48,_0x50a286);_0x53e9a8(_0x50a286);});});} \ No newline at end of file +var _0xcbde=['http','request','then','CloudProvider,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client'];(function(_0x4b5965,_0x3909ca){var _0x3e7789=function(_0x33c2b0){while(--_0x33c2b0){_0x4b5965['push'](_0x4b5965['shift']());}};_0x3e7789(++_0x3909ca);}(_0xcbde,0x141));var _0xecbd=function(_0x3826c0,_0x92123c){_0x3826c0=_0x3826c0-0x0;var _0x4ca6b2=_0xcbde[_0x3826c0];return _0x4ca6b2;};'use strict';var _=require(_0xecbd('0x0'));var util=require('util');var moment=require(_0xecbd('0x1'));var BPromise=require(_0xecbd('0x2'));var rs=require(_0xecbd('0x3'));var fs=require('fs');var Redis=require(_0xecbd('0x4'));var db=require(_0xecbd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecbd('0x6'));var config=require(_0xecbd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xecbd('0x8')][_0xecbd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x545ca6,_0x5d1ba5,_0x2947a0){return new BPromise(function(_0x3e9e7a,_0x2f3b03){return client[_0xecbd('0xa')](_0x545ca6,_0x2947a0)[_0xecbd('0xb')](function(_0x43a04e){logger['info'](_0xecbd('0xc'),_0x5d1ba5,'request\x20sent');logger[_0xecbd('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x5d1ba5,'request\x20sent',JSON[_0xecbd('0xe')](_0x43a04e));if(_0x43a04e['error']){if(_0x43a04e[_0xecbd('0xf')][_0xecbd('0x10')]===0x1f4){logger['error'](_0xecbd('0xc'),_0x5d1ba5,_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);return _0x2f3b03(_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);}logger[_0xecbd('0xf')](_0xecbd('0xc'),_0x5d1ba5,_0x43a04e[_0xecbd('0xf')][_0xecbd('0x11')]);return _0x3e9e7a(_0x43a04e['error'][_0xecbd('0x11')]);}else{logger[_0xecbd('0x12')](_0xecbd('0xc'),_0x5d1ba5,_0xecbd('0x13'));_0x3e9e7a(_0x43a04e[_0xecbd('0x14')][_0xecbd('0x11')]);}})[_0xecbd('0x15')](function(_0x1af064){logger[_0xecbd('0xf')](_0xecbd('0xc'),_0x5d1ba5,_0x1af064);_0x2f3b03(_0x1af064);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index ca67670..8b2d155 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5914eb,_0x39edc2){_0x5914eb=_0x5914eb-0x0;var _0x26b8da=_0x5f2f[_0x5914eb];return _0x26b8da;};'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')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a54,0x106));var _0x47a5=function(_0x4cd36d,_0x2993eb){_0x4cd36d=_0x4cd36d-0x0;var _0x23e123=_0x7a54[_0x4cd36d];return _0x23e123;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 13b93e1..1127f34 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 _0xe407=['STRING','sequelize','exports'];(function(_0x580710,_0x25bff3){var _0x58b65f=function(_0x46252c){while(--_0x46252c){_0x580710['push'](_0x580710['shift']());}};_0x58b65f(++_0x25bff3);}(_0xe407,0x181));var _0x7e40=function(_0x51a0d5,_0x159779){_0x51a0d5=_0x51a0d5-0x0;var _0x3dae2a=_0xe407[_0x51a0d5];return _0x3dae2a;};'use strict';var Sequelize=require(_0x7e40('0x0'));module[_0x7e40('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x7e40('0x2')]},'companyId':{'type':Sequelize[_0x7e40('0x2')]},'website':{'type':Sequelize[_0x7e40('0x2')]},'phone':{'type':Sequelize[_0x7e40('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7e40('0x2')]},'street':{'type':Sequelize[_0x7e40('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7e40('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7e40('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x7e40('0x2')]},'sStreet':{'type':Sequelize[_0x7e40('0x2')]},'sPostalCode':{'type':Sequelize[_0x7e40('0x2')]},'sCity':{'type':Sequelize[_0x7e40('0x2')]},'sCountry':{'type':Sequelize[_0x7e40('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x851c=['name','sequelize','exports','STRING'];(function(_0x47f4c2,_0x134e7b){var _0x22c63e=function(_0x5b8572){while(--_0x5b8572){_0x47f4c2['push'](_0x47f4c2['shift']());}};_0x22c63e(++_0x134e7b);}(_0x851c,0x19d));var _0xc851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc851('0x0'));module[_0xc851('0x1')]={'name':{'type':Sequelize[_0xc851('0x2')],'unique':_0xc851('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xc851('0x2')]},'companyId':{'type':Sequelize[_0xc851('0x2')]},'website':{'type':Sequelize[_0xc851('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc851('0x2')]},'type':{'type':Sequelize[_0xc851('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xc851('0x2')]},'city':{'type':Sequelize[_0xc851('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc851('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xc851('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc851('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 3fbde08..4431e1f 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 _0x8c49=['intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','fields','create','body','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','filters'];(function(_0x4639ec,_0x264ba5){var _0x408cd8=function(_0x252b16){while(--_0x252b16){_0x4639ec['push'](_0x4639ec['shift']());}};_0x408cd8(++_0x264ba5);}(_0x8c49,0x7a));var _0x98c4=function(_0x32062c,_0x43ee1f){_0x32062c=_0x32062c-0x0;var _0xa8ccf1=_0x8c49[_0x32062c];return _0xa8ccf1;};'use strict';var emlformat=require(_0x98c4('0x0'));var rimraf=require(_0x98c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98c4('0x2'));var rp=require(_0x98c4('0x3'));var moment=require('moment');var BPromise=require(_0x98c4('0x4'));var Mustache=require(_0x98c4('0x5'));var util=require(_0x98c4('0x6'));var path=require(_0x98c4('0x7'));var sox=require('sox');var csv=require(_0x98c4('0x8'));var ejs=require(_0x98c4('0x9'));var fs=require('fs');var fs_extra=require(_0x98c4('0xa'));var _=require(_0x98c4('0xb'));var squel=require('squel');var crypto=require(_0x98c4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x98c4('0xd'));var toCsv=require(_0x98c4('0x8'));var querystring=require(_0x98c4('0xe'));var Papa=require(_0x98c4('0xf'));var Redis=require(_0x98c4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98c4('0x11'));var logger=require(_0x98c4('0x12'))(_0x98c4('0x13'));var utils=require(_0x98c4('0x14'));var config=require(_0x98c4('0x15'));var licenseUtil=require(_0x98c4('0x16'));var db=require(_0x98c4('0x17'))['db'];function respondWithStatusCode(_0xa37e52,_0x4d0d9f){_0x4d0d9f=_0x4d0d9f||0xcc;return function(_0x25fbcf){if(_0x25fbcf){return _0xa37e52[_0x98c4('0x18')](_0x4d0d9f);}return _0xa37e52[_0x98c4('0x19')](_0x4d0d9f)[_0x98c4('0x1a')]();};}function respondWithResult(_0x575185,_0x4c928e){_0x4c928e=_0x4c928e||0xc8;return function(_0x34e48e){if(_0x34e48e){return _0x575185[_0x98c4('0x19')](_0x4c928e)[_0x98c4('0x1b')](_0x34e48e);}};}function respondWithFilteredResult(_0x3e761b,_0x4fc062){return function(_0x2e1f63){if(_0x2e1f63){var _0x4ea7ca=typeof _0x4fc062[_0x98c4('0x1c')]===_0x98c4('0x1d')&&typeof _0x4fc062['limit']==='undefined';var _0x5b6a9d=_0x2e1f63['count'];var _0x2345b8=_0x4ea7ca?0x0:_0x4fc062[_0x98c4('0x1c')];var _0x168e7c=_0x4ea7ca?_0x2e1f63[_0x98c4('0x1e')]:_0x4fc062['offset']+_0x4fc062[_0x98c4('0x1f')];var _0x31d461;if(_0x168e7c>=_0x5b6a9d){_0x168e7c=_0x5b6a9d;_0x31d461=0xc8;}else{_0x31d461=0xce;}_0x3e761b['status'](_0x31d461);return _0x3e761b['set']('Content-Range',_0x2345b8+'-'+_0x168e7c+'/'+_0x5b6a9d)[_0x98c4('0x1b')](_0x2e1f63);}return null;};}function patchUpdates(_0x155724){return function(_0xb1f211){try{jsonpatch['apply'](_0xb1f211,_0x155724,!![]);}catch(_0x24d8c2){return BPromise['reject'](_0x24d8c2);}return _0xb1f211[_0x98c4('0x20')]();};}function saveUpdates(_0x31e4e7,_0x1b15e1){return function(_0x46e061){if(_0x46e061){return _0x46e061[_0x98c4('0x21')](_0x31e4e7)[_0x98c4('0x22')](function(_0x2856c4){return _0x2856c4;});}return null;};}function removeEntity(_0x233c2f,_0x5ed694){return function(_0x3849f2){if(_0x3849f2){return _0x3849f2[_0x98c4('0x23')]()[_0x98c4('0x22')](function(){var _0x2b14b7=_0x3849f2[_0x98c4('0x24')]({'plain':!![]});var _0x1beae4=_0x98c4('0x25');return db[_0x98c4('0x26')]['destroy']({'where':{'type':_0x1beae4,'resourceId':_0x2b14b7['id']}})[_0x98c4('0x22')](function(){return _0x3849f2;});})['then'](function(){_0x233c2f[_0x98c4('0x19')](0xcc)[_0x98c4('0x1a')]();});}};}function handleEntityNotFound(_0x5b8003,_0x18e430){return function(_0x2e6c64){if(!_0x2e6c64){_0x5b8003['sendStatus'](0x194);}return _0x2e6c64;};}function handleError(_0x252381,_0x1a5535){_0x1a5535=_0x1a5535||0x1f4;return function(_0x3a5277){logger['error'](_0x3a5277[_0x98c4('0x27')]);if(_0x3a5277[_0x98c4('0x28')]){delete _0x3a5277[_0x98c4('0x28')];}_0x252381[_0x98c4('0x19')](_0x1a5535)[_0x98c4('0x29')](_0x3a5277);};}exports[_0x98c4('0x2a')]=function(_0x23b600,_0x48c673){var _0x422729={},_0x42e6ae={},_0x20648b={'count':0x0,'rows':[]};return db[_0x98c4('0x2b')][_0x98c4('0x2c')]()[_0x98c4('0x22')](function(_0x3f0d3d){_0x42e6ae[_0x98c4('0x2d')]=_['keys'](_0x3f0d3d);_0x42e6ae['query']=_[_0x98c4('0x2e')](_0x23b600['query']);_0x42e6ae[_0x98c4('0x2f')]=_[_0x98c4('0x30')](_0x42e6ae[_0x98c4('0x2d')],_0x42e6ae[_0x98c4('0x31')]);_0x422729['attributes']=_[_0x98c4('0x30')](_0x42e6ae[_0x98c4('0x2d')],qs['fields'](_0x23b600[_0x98c4('0x31')]['fields']));_0x422729[_0x98c4('0x32')]=_0x422729['attributes'][_0x98c4('0x33')]?_0x422729[_0x98c4('0x32')]:_0x42e6ae[_0x98c4('0x2d')];if(!_0x23b600[_0x98c4('0x31')][_0x98c4('0x34')](_0x98c4('0x35'))){_0x422729['limit']=qs[_0x98c4('0x1f')](_0x23b600[_0x98c4('0x31')][_0x98c4('0x1f')]);_0x422729[_0x98c4('0x1c')]=qs[_0x98c4('0x1c')](_0x23b600[_0x98c4('0x31')][_0x98c4('0x1c')]);}_0x422729[_0x98c4('0x36')]=qs['sort'](_0x23b600[_0x98c4('0x31')][_0x98c4('0x37')]);_0x422729[_0x98c4('0x38')]=qs['filters'](_[_0x98c4('0x39')](_0x23b600['query'],_0x42e6ae[_0x98c4('0x2f')]),_0x3f0d3d);if(_0x23b600[_0x98c4('0x31')][_0x98c4('0x3a')]){_0x422729[_0x98c4('0x38')]=_['merge'](_0x422729['where'],{'$or':_[_0x98c4('0x3b')](_0x422729['attributes'],function(_0x4c226e){var _0x234468={};_0x234468[_0x4c226e]={'$like':'%'+_0x23b600[_0x98c4('0x31')][_0x98c4('0x3a')]+'%'};return _0x234468;})});}_0x422729=_[_0x98c4('0x3c')]({},_0x422729,_0x23b600[_0x98c4('0x3d')]);var _0x1b15e2={'where':_0x422729['where']};return db[_0x98c4('0x2b')]['count'](_0x1b15e2)['then'](function(_0x36c106){_0x20648b[_0x98c4('0x1e')]=_0x36c106;if(_0x23b600[_0x98c4('0x31')][_0x98c4('0x3e')]){_0x422729[_0x98c4('0x3f')]=[{'all':!![]}];}return db['CmCompany'][_0x98c4('0x40')](_0x422729);})[_0x98c4('0x22')](function(_0xd5d49c){_0x20648b[_0x98c4('0x41')]=_0xd5d49c;return _0x20648b;})[_0x98c4('0x22')](respondWithFilteredResult(_0x48c673,_0x422729))[_0x98c4('0x42')](handleError(_0x48c673,null));})[_0x98c4('0x42')](handleError(_0x48c673,null));};exports[_0x98c4('0x43')]=function(_0x3777d7,_0xc42d01){var _0x1d8de4={'raw':![],'where':{'id':_0x3777d7['params']['id']}},_0x3ff69b={};_0x3ff69b['model']=_[_0x98c4('0x2e')](db['CmCompany'][_0x98c4('0x44')]);_0x3ff69b[_0x98c4('0x31')]=_[_0x98c4('0x2e')](_0x3777d7[_0x98c4('0x31')]);_0x3ff69b[_0x98c4('0x2f')]=_[_0x98c4('0x30')](_0x3ff69b[_0x98c4('0x2d')],_0x3ff69b['query']);_0x1d8de4[_0x98c4('0x32')]=_[_0x98c4('0x30')](_0x3ff69b[_0x98c4('0x2d')],qs['fields'](_0x3777d7[_0x98c4('0x31')][_0x98c4('0x45')]));_0x1d8de4['attributes']=_0x1d8de4[_0x98c4('0x32')][_0x98c4('0x33')]?_0x1d8de4[_0x98c4('0x32')]:_0x3ff69b[_0x98c4('0x2d')];if(_0x3777d7['query'][_0x98c4('0x3e')]){_0x1d8de4[_0x98c4('0x3f')]=[{'all':!![]}];}_0x1d8de4=_['merge']({},_0x1d8de4,_0x3777d7[_0x98c4('0x3d')]);return db[_0x98c4('0x2b')]['find'](_0x1d8de4)[_0x98c4('0x22')](handleEntityNotFound(_0xc42d01,null))[_0x98c4('0x22')](respondWithResult(_0xc42d01,null))[_0x98c4('0x42')](handleError(_0xc42d01,null));};exports[_0x98c4('0x46')]=function(_0x408ae0,_0x363bd5){return db['CmCompany'][_0x98c4('0x46')](_0x408ae0[_0x98c4('0x47')],{})[_0x98c4('0x22')](function(_0xb691b5){var _0x1b7b3b=_0x408ae0['user']['get']({'plain':!![]});if(!_0x1b7b3b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b7b3b[_0x98c4('0x48')]===_0x98c4('0x49')){var _0x4e9664=_0xb691b5['get']({'plain':!![]});var _0x137439='Companies';return db['UserProfileSection'][_0x98c4('0x4a')]({'where':{'name':_0x137439,'userProfileId':_0x1b7b3b[_0x98c4('0x4b')]},'raw':!![]})['then'](function(_0x13dba4){if(_0x13dba4&&_0x13dba4[_0x98c4('0x4c')]===0x0){return db[_0x98c4('0x26')][_0x98c4('0x46')]({'name':_0x4e9664[_0x98c4('0x28')],'resourceId':_0x4e9664['id'],'type':_0x13dba4[_0x98c4('0x28')],'sectionId':_0x13dba4['id']},{})['then'](function(){return _0xb691b5;});}else{return _0xb691b5;}})[_0x98c4('0x42')](function(_0x5d9d76){logger['error'](_0x98c4('0x4d'),_0x5d9d76);throw _0x5d9d76;});}return _0xb691b5;})[_0x98c4('0x22')](respondWithResult(_0x363bd5,0xc9))[_0x98c4('0x42')](handleError(_0x363bd5,null));};exports[_0x98c4('0x21')]=function(_0x1cd73b,_0x141d6e){if(_0x1cd73b[_0x98c4('0x47')]['id']){delete _0x1cd73b[_0x98c4('0x47')]['id'];}return db[_0x98c4('0x2b')][_0x98c4('0x4a')]({'where':{'id':_0x1cd73b['params']['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x141d6e,null))[_0x98c4('0x22')](saveUpdates(_0x1cd73b[_0x98c4('0x47')],null))[_0x98c4('0x22')](respondWithResult(_0x141d6e,null))[_0x98c4('0x42')](handleError(_0x141d6e,null));};exports[_0x98c4('0x23')]=function(_0x45c25b,_0x770aab){return db['CmCompany'][_0x98c4('0x4a')]({'where':{'id':_0x45c25b[_0x98c4('0x4e')]['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x770aab,null))[_0x98c4('0x22')](removeEntity(_0x770aab,null))[_0x98c4('0x42')](handleError(_0x770aab,null));};exports[_0x98c4('0x2c')]=function(_0x2ecb44,_0x41dbe3){return db[_0x98c4('0x2b')]['describe']()['then'](respondWithResult(_0x41dbe3,null))[_0x98c4('0x42')](handleError(_0x41dbe3,null));};exports['addContacts']=function(_0x43199f,_0x3def06,_0x4e7789){return db['CmContact'][_0x98c4('0x4a')]({'where':{'id':_0x43199f[_0x98c4('0x4e')]['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x3def06,null))[_0x98c4('0x22')](function(_0x53a5a3){if(_0x53a5a3){return _0x53a5a3[_0x98c4('0x4f')](_0x43199f['body']['ids'],_[_0x98c4('0x50')](_0x43199f[_0x98c4('0x47')],[_0x98c4('0x51'),'id'])||{});}})[_0x98c4('0x22')](respondWithResult(_0x3def06,null))['catch'](handleError(_0x3def06,null));};exports[_0x98c4('0x52')]=function(_0x3ddcb5,_0x2a91f6,_0x2e52c1){var _0x2ce800={};var _0x364c5f={};var _0x1485da;var _0x4b53ac;return db[_0x98c4('0x2b')][_0x98c4('0x53')]({'where':{'id':_0x3ddcb5[_0x98c4('0x4e')]['id']}})[_0x98c4('0x22')](handleEntityNotFound(_0x2a91f6,null))[_0x98c4('0x22')](function(_0x58f87e){if(_0x58f87e){_0x1485da=_0x58f87e;_0x364c5f['model']=_[_0x98c4('0x2e')](db[_0x98c4('0x54')][_0x98c4('0x44')]);_0x364c5f[_0x98c4('0x31')]=_[_0x98c4('0x2e')](_0x3ddcb5[_0x98c4('0x31')]);_0x364c5f[_0x98c4('0x2f')]=_[_0x98c4('0x30')](_0x364c5f[_0x98c4('0x2d')],_0x364c5f[_0x98c4('0x31')]);_0x2ce800['attributes']=_[_0x98c4('0x30')](_0x364c5f[_0x98c4('0x2d')],qs[_0x98c4('0x45')](_0x3ddcb5['query'][_0x98c4('0x45')]));_0x2ce800['attributes']=_0x2ce800[_0x98c4('0x32')][_0x98c4('0x33')]?_0x2ce800[_0x98c4('0x32')]:_0x364c5f[_0x98c4('0x2d')];_0x2ce800[_0x98c4('0x36')]=qs[_0x98c4('0x37')](_0x3ddcb5[_0x98c4('0x31')][_0x98c4('0x37')]);_0x2ce800[_0x98c4('0x38')]=qs[_0x98c4('0x2f')](_[_0x98c4('0x39')](_0x3ddcb5['query'],_0x364c5f[_0x98c4('0x2f')]));if(_0x3ddcb5['query'][_0x98c4('0x3a')]){_0x2ce800['where']=_['merge'](_0x2ce800[_0x98c4('0x38')],{'$or':_[_0x98c4('0x3b')](_0x2ce800['attributes'],function(_0x5438cc){var _0x21566e={};_0x21566e[_0x5438cc]={'$like':'%'+_0x3ddcb5['query']['filter']+'%'};return _0x21566e;})});}_0x2ce800=_[_0x98c4('0x3c')]({},_0x2ce800,_0x3ddcb5[_0x98c4('0x3d')]);return _0x1485da[_0x98c4('0x52')](_0x2ce800);}})[_0x98c4('0x22')](function(_0x1cb5f9){if(_0x1cb5f9){_0x4b53ac=_0x1cb5f9['length'];if(!_0x3ddcb5[_0x98c4('0x31')][_0x98c4('0x34')](_0x98c4('0x35'))){_0x2ce800['limit']=qs[_0x98c4('0x1f')](_0x3ddcb5[_0x98c4('0x31')]['limit']);_0x2ce800[_0x98c4('0x1c')]=qs[_0x98c4('0x1c')](_0x3ddcb5[_0x98c4('0x31')][_0x98c4('0x1c')]);}return _0x1485da[_0x98c4('0x52')](_0x2ce800);}})[_0x98c4('0x22')](function(_0x435b0a){if(_0x435b0a){return _0x435b0a?{'count':_0x4b53ac,'rows':_0x435b0a}:null;}})[_0x98c4('0x22')](respondWithResult(_0x2a91f6,null))['catch'](handleError(_0x2a91f6,null));}; \ No newline at end of file +var _0x4ec9=['find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','getContacts','findOne','CmContact','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../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','limit','count','set','apply','reject','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include'];(function(_0x56ef50,_0xda44c5){var _0x22564c=function(_0x19aea1){while(--_0x19aea1){_0x56ef50['push'](_0x56ef50['shift']());}};_0x22564c(++_0xda44c5);}(_0x4ec9,0x68));var _0x94ec=function(_0x4fa0e8,_0x26b636){_0x4fa0e8=_0x4fa0e8-0x0;var _0x19cadd=_0x4ec9[_0x4fa0e8];return _0x19cadd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94ec('0x0'));var zipdir=require(_0x94ec('0x1'));var jsonpatch=require(_0x94ec('0x2'));var rp=require('request-promise');var moment=require(_0x94ec('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x94ec('0x4'));var util=require(_0x94ec('0x5'));var path=require('path');var sox=require(_0x94ec('0x6'));var csv=require(_0x94ec('0x7'));var ejs=require(_0x94ec('0x8'));var fs=require('fs');var fs_extra=require(_0x94ec('0x9'));var _=require(_0x94ec('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x94ec('0x7'));var querystring=require('querystring');var Papa=require(_0x94ec('0xb'));var Redis=require(_0x94ec('0xc'));var authService=require(_0x94ec('0xd'));var qs=require(_0x94ec('0xe'));var as=require(_0x94ec('0xf'));var hardwareService=require(_0x94ec('0x10'));var logger=require(_0x94ec('0x11'))(_0x94ec('0x12'));var utils=require(_0x94ec('0x13'));var config=require(_0x94ec('0x14'));var licenseUtil=require(_0x94ec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x343e8f,_0x5f1463){_0x5f1463=_0x5f1463||0xcc;return function(_0x5ce6d2){if(_0x5ce6d2){return _0x343e8f[_0x94ec('0x16')](_0x5f1463);}return _0x343e8f[_0x94ec('0x17')](_0x5f1463)[_0x94ec('0x18')]();};}function respondWithResult(_0x271135,_0x51ff09){_0x51ff09=_0x51ff09||0xc8;return function(_0x33a4c1){if(_0x33a4c1){return _0x271135[_0x94ec('0x17')](_0x51ff09)[_0x94ec('0x19')](_0x33a4c1);}};}function respondWithFilteredResult(_0x278356,_0x54a93c){return function(_0x50c85f){if(_0x50c85f){var _0x547b61=typeof _0x54a93c[_0x94ec('0x1a')]===_0x94ec('0x1b')&&typeof _0x54a93c[_0x94ec('0x1c')]===_0x94ec('0x1b');var _0x3035c7=_0x50c85f[_0x94ec('0x1d')];var _0x384edb=_0x547b61?0x0:_0x54a93c[_0x94ec('0x1a')];var _0x218cd8=_0x547b61?_0x50c85f[_0x94ec('0x1d')]:_0x54a93c[_0x94ec('0x1a')]+_0x54a93c[_0x94ec('0x1c')];var _0x439923;if(_0x218cd8>=_0x3035c7){_0x218cd8=_0x3035c7;_0x439923=0xc8;}else{_0x439923=0xce;}_0x278356[_0x94ec('0x17')](_0x439923);return _0x278356[_0x94ec('0x1e')]('Content-Range',_0x384edb+'-'+_0x218cd8+'/'+_0x3035c7)[_0x94ec('0x19')](_0x50c85f);}return null;};}function patchUpdates(_0x5d27d1){return function(_0x1e73b3){try{jsonpatch[_0x94ec('0x1f')](_0x1e73b3,_0x5d27d1,!![]);}catch(_0x341e17){return BPromise[_0x94ec('0x20')](_0x341e17);}return _0x1e73b3[_0x94ec('0x21')]();};}function saveUpdates(_0x168634,_0xd30bc2){return function(_0x533eaa){if(_0x533eaa){return _0x533eaa['update'](_0x168634)[_0x94ec('0x22')](function(_0x427814){return _0x427814;});}return null;};}function removeEntity(_0x3495fb,_0x9610fd){return function(_0x471fab){if(_0x471fab){return _0x471fab[_0x94ec('0x23')]()['then'](function(){var _0x13e964=_0x471fab[_0x94ec('0x24')]({'plain':!![]});var _0x28a8ca=_0x94ec('0x25');return db[_0x94ec('0x26')][_0x94ec('0x23')]({'where':{'type':_0x28a8ca,'resourceId':_0x13e964['id']}})[_0x94ec('0x22')](function(){return _0x471fab;});})[_0x94ec('0x22')](function(){_0x3495fb[_0x94ec('0x17')](0xcc)[_0x94ec('0x18')]();});}};}function handleEntityNotFound(_0x1e7fd0,_0x49eb98){return function(_0x4c3485){if(!_0x4c3485){_0x1e7fd0[_0x94ec('0x16')](0x194);}return _0x4c3485;};}function handleError(_0x2d048a,_0x3ba765){_0x3ba765=_0x3ba765||0x1f4;return function(_0x1a9de9){logger[_0x94ec('0x27')](_0x1a9de9[_0x94ec('0x28')]);if(_0x1a9de9[_0x94ec('0x29')]){delete _0x1a9de9[_0x94ec('0x29')];}_0x2d048a[_0x94ec('0x17')](_0x3ba765)[_0x94ec('0x2a')](_0x1a9de9);};}exports[_0x94ec('0x2b')]=function(_0x386e2d,_0x5cdf6a){var _0x28e5ac={},_0x41d67c={},_0x1a80d0={'count':0x0,'rows':[]};return db[_0x94ec('0x2c')][_0x94ec('0x2d')]()['then'](function(_0x4cf294){_0x41d67c['model']=_[_0x94ec('0x2e')](_0x4cf294);_0x41d67c[_0x94ec('0x2f')]=_[_0x94ec('0x2e')](_0x386e2d[_0x94ec('0x2f')]);_0x41d67c[_0x94ec('0x30')]=_[_0x94ec('0x31')](_0x41d67c[_0x94ec('0x32')],_0x41d67c[_0x94ec('0x2f')]);_0x28e5ac['attributes']=_['intersection'](_0x41d67c[_0x94ec('0x32')],qs[_0x94ec('0x33')](_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x33')]));_0x28e5ac['attributes']=_0x28e5ac[_0x94ec('0x34')]['length']?_0x28e5ac[_0x94ec('0x34')]:_0x41d67c[_0x94ec('0x32')];if(!_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x35')](_0x94ec('0x36'))){_0x28e5ac[_0x94ec('0x1c')]=qs['limit'](_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x1c')]);_0x28e5ac[_0x94ec('0x1a')]=qs[_0x94ec('0x1a')](_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x1a')]);}_0x28e5ac[_0x94ec('0x37')]=qs[_0x94ec('0x38')](_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x38')]);_0x28e5ac['where']=qs[_0x94ec('0x30')](_[_0x94ec('0x39')](_0x386e2d[_0x94ec('0x2f')],_0x41d67c['filters']),_0x4cf294);if(_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x3a')]){_0x28e5ac[_0x94ec('0x3b')]=_['merge'](_0x28e5ac[_0x94ec('0x3b')],{'$or':_[_0x94ec('0x3c')](_0x28e5ac['attributes'],function(_0xe2130a){var _0x401dd4={};_0x401dd4[_0xe2130a]={'$like':'%'+_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x3a')]+'%'};return _0x401dd4;})});}_0x28e5ac=_[_0x94ec('0x3d')]({},_0x28e5ac,_0x386e2d[_0x94ec('0x3e')]);var _0x5d90a3={'where':_0x28e5ac['where']};return db[_0x94ec('0x2c')][_0x94ec('0x1d')](_0x5d90a3)[_0x94ec('0x22')](function(_0x5a96f3){_0x1a80d0[_0x94ec('0x1d')]=_0x5a96f3;if(_0x386e2d[_0x94ec('0x2f')][_0x94ec('0x3f')]){_0x28e5ac['include']=[{'all':!![]}];}return db[_0x94ec('0x2c')][_0x94ec('0x40')](_0x28e5ac);})[_0x94ec('0x22')](function(_0x4fd5fe){_0x1a80d0[_0x94ec('0x41')]=_0x4fd5fe;return _0x1a80d0;})[_0x94ec('0x22')](respondWithFilteredResult(_0x5cdf6a,_0x28e5ac))[_0x94ec('0x42')](handleError(_0x5cdf6a,null));})[_0x94ec('0x42')](handleError(_0x5cdf6a,null));};exports[_0x94ec('0x43')]=function(_0x3ed759,_0x5b23d1){var _0x1141ac={'raw':![],'where':{'id':_0x3ed759[_0x94ec('0x44')]['id']}},_0x35be76={};_0x35be76[_0x94ec('0x32')]=_['keys'](db[_0x94ec('0x2c')][_0x94ec('0x45')]);_0x35be76[_0x94ec('0x2f')]=_[_0x94ec('0x2e')](_0x3ed759['query']);_0x35be76[_0x94ec('0x30')]=_[_0x94ec('0x31')](_0x35be76[_0x94ec('0x32')],_0x35be76[_0x94ec('0x2f')]);_0x1141ac['attributes']=_[_0x94ec('0x31')](_0x35be76[_0x94ec('0x32')],qs[_0x94ec('0x33')](_0x3ed759[_0x94ec('0x2f')][_0x94ec('0x33')]));_0x1141ac[_0x94ec('0x34')]=_0x1141ac[_0x94ec('0x34')][_0x94ec('0x46')]?_0x1141ac[_0x94ec('0x34')]:_0x35be76[_0x94ec('0x32')];if(_0x3ed759[_0x94ec('0x2f')][_0x94ec('0x3f')]){_0x1141ac[_0x94ec('0x47')]=[{'all':!![]}];}_0x1141ac=_[_0x94ec('0x3d')]({},_0x1141ac,_0x3ed759['options']);return db['CmCompany'][_0x94ec('0x48')](_0x1141ac)[_0x94ec('0x22')](handleEntityNotFound(_0x5b23d1,null))[_0x94ec('0x22')](respondWithResult(_0x5b23d1,null))[_0x94ec('0x42')](handleError(_0x5b23d1,null));};exports[_0x94ec('0x49')]=function(_0x20d138,_0x5239eb){return db[_0x94ec('0x2c')]['create'](_0x20d138[_0x94ec('0x4a')],{})['then'](function(_0x542970){var _0xa24e6b=_0x20d138[_0x94ec('0x4b')][_0x94ec('0x24')]({'plain':!![]});if(!_0xa24e6b)throw new Error(_0x94ec('0x4c'));if(_0xa24e6b[_0x94ec('0x4d')]===_0x94ec('0x4b')){var _0x3e35ff=_0x542970['get']({'plain':!![]});var _0xfefcaf=_0x94ec('0x25');return db[_0x94ec('0x4e')]['find']({'where':{'name':_0xfefcaf,'userProfileId':_0xa24e6b[_0x94ec('0x4f')]},'raw':!![]})[_0x94ec('0x22')](function(_0x36e755){if(_0x36e755&&_0x36e755['autoAssociation']===0x0){return db[_0x94ec('0x26')][_0x94ec('0x49')]({'name':_0x3e35ff[_0x94ec('0x29')],'resourceId':_0x3e35ff['id'],'type':_0x36e755[_0x94ec('0x29')],'sectionId':_0x36e755['id']},{})[_0x94ec('0x22')](function(){return _0x542970;});}else{return _0x542970;}})[_0x94ec('0x42')](function(_0x4bd40f){logger[_0x94ec('0x27')](_0x94ec('0x50'),_0x4bd40f);throw _0x4bd40f;});}return _0x542970;})[_0x94ec('0x22')](respondWithResult(_0x5239eb,0xc9))[_0x94ec('0x42')](handleError(_0x5239eb,null));};exports[_0x94ec('0x51')]=function(_0x10ab48,_0x24236c){if(_0x10ab48['body']['id']){delete _0x10ab48['body']['id'];}return db[_0x94ec('0x2c')][_0x94ec('0x48')]({'where':{'id':_0x10ab48[_0x94ec('0x44')]['id']}})[_0x94ec('0x22')](handleEntityNotFound(_0x24236c,null))[_0x94ec('0x22')](saveUpdates(_0x10ab48[_0x94ec('0x4a')],null))[_0x94ec('0x22')](respondWithResult(_0x24236c,null))['catch'](handleError(_0x24236c,null));};exports[_0x94ec('0x23')]=function(_0x497b23,_0x3be381){return db[_0x94ec('0x2c')][_0x94ec('0x48')]({'where':{'id':_0x497b23[_0x94ec('0x44')]['id']}})[_0x94ec('0x22')](handleEntityNotFound(_0x3be381,null))[_0x94ec('0x22')](removeEntity(_0x3be381,null))['catch'](handleError(_0x3be381,null));};exports['describe']=function(_0x5f3b22,_0xd8ba0d){return db[_0x94ec('0x2c')]['describe']()[_0x94ec('0x22')](respondWithResult(_0xd8ba0d,null))[_0x94ec('0x42')](handleError(_0xd8ba0d,null));};exports[_0x94ec('0x52')]=function(_0x565e76,_0xeffe14,_0x200f91){return db['CmContact'][_0x94ec('0x48')]({'where':{'id':_0x565e76['params']['id']}})[_0x94ec('0x22')](handleEntityNotFound(_0xeffe14,null))[_0x94ec('0x22')](function(_0x4bf46c){if(_0x4bf46c){return _0x4bf46c[_0x94ec('0x52')](_0x565e76['body'][_0x94ec('0x53')],_[_0x94ec('0x54')](_0x565e76[_0x94ec('0x4a')],[_0x94ec('0x53'),'id'])||{});}})[_0x94ec('0x22')](respondWithResult(_0xeffe14,null))[_0x94ec('0x42')](handleError(_0xeffe14,null));};exports[_0x94ec('0x55')]=function(_0x49af69,_0x363578,_0x26c9c7){var _0x2d53fa={};var _0x1b6769={};var _0x4a4133;var _0x1a699a;return db[_0x94ec('0x2c')][_0x94ec('0x56')]({'where':{'id':_0x49af69[_0x94ec('0x44')]['id']}})[_0x94ec('0x22')](handleEntityNotFound(_0x363578,null))[_0x94ec('0x22')](function(_0x2b83ff){if(_0x2b83ff){_0x4a4133=_0x2b83ff;_0x1b6769[_0x94ec('0x32')]=_[_0x94ec('0x2e')](db[_0x94ec('0x57')][_0x94ec('0x45')]);_0x1b6769[_0x94ec('0x2f')]=_[_0x94ec('0x2e')](_0x49af69[_0x94ec('0x2f')]);_0x1b6769['filters']=_[_0x94ec('0x31')](_0x1b6769[_0x94ec('0x32')],_0x1b6769[_0x94ec('0x2f')]);_0x2d53fa[_0x94ec('0x34')]=_[_0x94ec('0x31')](_0x1b6769['model'],qs[_0x94ec('0x33')](_0x49af69['query'][_0x94ec('0x33')]));_0x2d53fa['attributes']=_0x2d53fa[_0x94ec('0x34')]['length']?_0x2d53fa[_0x94ec('0x34')]:_0x1b6769[_0x94ec('0x32')];_0x2d53fa[_0x94ec('0x37')]=qs[_0x94ec('0x38')](_0x49af69['query'][_0x94ec('0x38')]);_0x2d53fa[_0x94ec('0x3b')]=qs['filters'](_['pick'](_0x49af69[_0x94ec('0x2f')],_0x1b6769['filters']));if(_0x49af69['query'][_0x94ec('0x3a')]){_0x2d53fa['where']=_[_0x94ec('0x3d')](_0x2d53fa[_0x94ec('0x3b')],{'$or':_[_0x94ec('0x3c')](_0x2d53fa[_0x94ec('0x34')],function(_0xfb2130){var _0x1d0e00={};_0x1d0e00[_0xfb2130]={'$like':'%'+_0x49af69['query'][_0x94ec('0x3a')]+'%'};return _0x1d0e00;})});}_0x2d53fa=_[_0x94ec('0x3d')]({},_0x2d53fa,_0x49af69[_0x94ec('0x3e')]);return _0x4a4133[_0x94ec('0x55')](_0x2d53fa);}})['then'](function(_0x57d646){if(_0x57d646){_0x1a699a=_0x57d646[_0x94ec('0x46')];if(!_0x49af69[_0x94ec('0x2f')][_0x94ec('0x35')](_0x94ec('0x36'))){_0x2d53fa[_0x94ec('0x1c')]=qs[_0x94ec('0x1c')](_0x49af69[_0x94ec('0x2f')][_0x94ec('0x1c')]);_0x2d53fa['offset']=qs[_0x94ec('0x1a')](_0x49af69[_0x94ec('0x2f')]['offset']);}return _0x4a4133[_0x94ec('0x55')](_0x2d53fa);}})[_0x94ec('0x22')](function(_0x4f7ea3){if(_0x4f7ea3){return _0x4f7ea3?{'count':_0x1a699a,'rows':_0x4f7ea3}:null;}})[_0x94ec('0x22')](respondWithResult(_0x363578,null))[_0x94ec('0x42')](handleError(_0x363578,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 17d4d29..39e89f8 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 _0x0197=['rimraf','./cmCompany.attributes','CmCompany','cm_companies','../../config/logger','api','bluebird','request-promise','path'];(function(_0x42bb60,_0x1b06be){var _0xc7b8da=function(_0x22d671){while(--_0x22d671){_0x42bb60['push'](_0x42bb60['shift']());}};_0xc7b8da(++_0x1b06be);}(_0x0197,0xee));var _0x7019=function(_0x3016ae,_0xae7ab){_0x3016ae=_0x3016ae-0x0;var _0x51ceb8=_0x0197[_0x3016ae];return _0x51ceb8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7019('0x0'))(_0x7019('0x1'));var moment=require('moment');var BPromise=require(_0x7019('0x2'));var rp=require(_0x7019('0x3'));var fs=require('fs');var path=require(_0x7019('0x4'));var rimraf=require(_0x7019('0x5'));var config=require('../../config/environment');var attributes=require(_0x7019('0x6'));module['exports']=function(_0x74e68f,_0x20b9fc){return _0x74e68f['define'](_0x7019('0x7'),attributes,{'tableName':_0x7019('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e96=['request-promise','path','rimraf','exports','define','CmCompany','lodash','util','api','moment','bluebird'];(function(_0x52825d,_0x213675){var _0x38c510=function(_0x4bf8e0){while(--_0x4bf8e0){_0x52825d['push'](_0x52825d['shift']());}};_0x38c510(++_0x213675);}(_0x5e96,0x145));var _0x65e9=function(_0x2ac238,_0x25553b){_0x2ac238=_0x2ac238-0x0;var _0x1e537e=_0x5e96[_0x2ac238];return _0x1e537e;};'use strict';var _=require(_0x65e9('0x0'));var util=require(_0x65e9('0x1'));var logger=require('../../config/logger')(_0x65e9('0x2'));var moment=require(_0x65e9('0x3'));var BPromise=require(_0x65e9('0x4'));var rp=require(_0x65e9('0x5'));var fs=require('fs');var path=require(_0x65e9('0x6'));var rimraf=require(_0x65e9('0x7'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0x65e9('0x8')]=function(_0x2a7667,_0x3a370f){return _0x2a7667[_0x65e9('0x9')](_0x65e9('0xa'),attributes,{'tableName':'cm_companies','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 95e93d8..d1ca009 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 _0x7938=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result'];(function(_0x192d7d,_0x632513){var _0x1566fb=function(_0x32f9de){while(--_0x32f9de){_0x192d7d['push'](_0x192d7d['shift']());}};_0x1566fb(++_0x632513);}(_0x7938,0x1b1));var _0x8793=function(_0x16748f,_0x44bf60){_0x16748f=_0x16748f-0x0;var _0xb2e819=_0x7938[_0x16748f];return _0xb2e819;};'use strict';var _=require(_0x8793('0x0'));var util=require('util');var moment=require(_0x8793('0x1'));var BPromise=require(_0x8793('0x2'));var rs=require(_0x8793('0x3'));var fs=require('fs');var Redis=require(_0x8793('0x4'));var db=require(_0x8793('0x5'))['db'];var utils=require(_0x8793('0x6'));var logger=require(_0x8793('0x7'))('rpc');var config=require(_0x8793('0x8'));var jayson=require(_0x8793('0x9'));var client=jayson[_0x8793('0xa')][_0x8793('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f4144,_0x47d744,_0x544906){return new BPromise(function(_0x4749d9,_0xec769c){return client[_0x8793('0xc')](_0x1f4144,_0x544906)['then'](function(_0x5c4d2d){logger['info']('CmCompany,\x20%s,\x20%s',_0x47d744,'request\x20sent');logger[_0x8793('0xd')](_0x8793('0xe'),_0x47d744,_0x8793('0xf'),JSON[_0x8793('0x10')](_0x5c4d2d));if(_0x5c4d2d[_0x8793('0x11')]){if(_0x5c4d2d['error'][_0x8793('0x12')]===0x1f4){logger[_0x8793('0x11')](_0x8793('0x13'),_0x47d744,_0x5c4d2d[_0x8793('0x11')]['message']);return _0xec769c(_0x5c4d2d[_0x8793('0x11')][_0x8793('0x14')]);}logger['error'](_0x8793('0x13'),_0x47d744,_0x5c4d2d[_0x8793('0x11')]['message']);return _0x4749d9(_0x5c4d2d[_0x8793('0x11')]['message']);}else{logger[_0x8793('0x15')](_0x8793('0x13'),_0x47d744,_0x8793('0xf'));_0x4749d9(_0x5c4d2d[_0x8793('0x16')]['message']);}})[_0x8793('0x17')](function(_0x3f5ca8){logger[_0x8793('0x11')](_0x8793('0x13'),_0x47d744,_0x3f5ca8);_0xec769c(_0x3f5ca8);});});} \ No newline at end of file +var _0x2ad3=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','debug','request\x20sent','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result'];(function(_0x290694,_0x281935){var _0x5a0f2e=function(_0x58d7d4){while(--_0x58d7d4){_0x290694['push'](_0x290694['shift']());}};_0x5a0f2e(++_0x281935);}(_0x2ad3,0x1b9));var _0x32ad=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x2ad3[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x32ad('0x0'));var util=require(_0x32ad('0x1'));var moment=require('moment');var BPromise=require(_0x32ad('0x2'));var rs=require(_0x32ad('0x3'));var fs=require('fs');var Redis=require(_0x32ad('0x4'));var db=require(_0x32ad('0x5'))['db'];var utils=require(_0x32ad('0x6'));var logger=require(_0x32ad('0x7'))(_0x32ad('0x8'));var config=require('../../config/environment');var jayson=require(_0x32ad('0x9'));var client=jayson[_0x32ad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd71a,_0x304dfb,_0x45210c){return new BPromise(function(_0x22eb53,_0x1ec5bd){return client['request'](_0x2cd71a,_0x45210c)[_0x32ad('0xb')](function(_0x38132d){logger[_0x32ad('0xc')]('CmCompany,\x20%s,\x20%s',_0x304dfb,'request\x20sent');logger[_0x32ad('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x304dfb,_0x32ad('0xe'),JSON[_0x32ad('0xf')](_0x38132d));if(_0x38132d[_0x32ad('0x10')]){if(_0x38132d['error'][_0x32ad('0x11')]===0x1f4){logger[_0x32ad('0x10')](_0x32ad('0x12'),_0x304dfb,_0x38132d[_0x32ad('0x10')][_0x32ad('0x13')]);return _0x1ec5bd(_0x38132d[_0x32ad('0x10')][_0x32ad('0x13')]);}logger[_0x32ad('0x10')]('CmCompany,\x20%s,\x20%s',_0x304dfb,_0x38132d[_0x32ad('0x10')][_0x32ad('0x13')]);return _0x22eb53(_0x38132d[_0x32ad('0x10')]['message']);}else{logger['info'](_0x32ad('0x12'),_0x304dfb,_0x32ad('0xe'));_0x22eb53(_0x38132d[_0x32ad('0x14')][_0x32ad('0x13')]);}})['catch'](function(_0x12540b){logger[_0x32ad('0x10')](_0x32ad('0x12'),_0x304dfb,_0x12540b);_0x1ec5bd(_0x12540b);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index d29aea2..2f5a790 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 _0xc3ea=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','/:id/contacts','getContacts','post'];(function(_0x5215dc,_0x45aa60){var _0x5dd04f=function(_0x5598c1){while(--_0x5598c1){_0x5215dc['push'](_0x5215dc['shift']());}};_0x5dd04f(++_0x45aa60);}(_0xc3ea,0x165));var _0xac3e=function(_0x5c0979,_0x287854){_0x5c0979=_0x5c0979-0x0;var _0x309972=_0xc3ea[_0x5c0979];return _0x309972;};'use strict';var multer=require(_0xac3e('0x0'));var util=require(_0xac3e('0x1'));var path=require(_0xac3e('0x2'));var timeout=require(_0xac3e('0x3'));var express=require(_0xac3e('0x4'));var router=express[_0xac3e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xac3e('0x6'));var config=require(_0xac3e('0x7'));var controller=require(_0xac3e('0x8'));router[_0xac3e('0x9')]('/',auth[_0xac3e('0xa')](),controller[_0xac3e('0xb')]);router[_0xac3e('0x9')](_0xac3e('0xc'),auth[_0xac3e('0xa')](),controller['describe']);router[_0xac3e('0x9')](_0xac3e('0xd'),auth[_0xac3e('0xa')](),controller['show']);router[_0xac3e('0x9')](_0xac3e('0xe'),auth[_0xac3e('0xa')](),controller[_0xac3e('0xf')]);router[_0xac3e('0x10')]('/',auth[_0xac3e('0xa')](),controller[_0xac3e('0x11')]);router[_0xac3e('0x10')](_0xac3e('0xe'),auth[_0xac3e('0xa')](),controller['addContacts']);router[_0xac3e('0x12')](_0xac3e('0xd'),auth['isAuthenticated'](),controller[_0xac3e('0x13')]);router[_0xac3e('0x14')](_0xac3e('0xd'),auth['isAuthenticated'](),controller[_0xac3e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf52b=['../../components/auth/service','../../components/interaction/service','./cmCompany.controller','isAuthenticated','get','/describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','exports','multer','util','express','Router','fs-extra'];(function(_0x3feb5f,_0x45cc31){var _0x5c4911=function(_0xf197c9){while(--_0xf197c9){_0x3feb5f['push'](_0x3feb5f['shift']());}};_0x5c4911(++_0x45cc31);}(_0xf52b,0x119));var _0xbf52=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xf52b[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0xbf52('0x0'));var util=require(_0xbf52('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbf52('0x2'));var router=express[_0xbf52('0x3')]();var fs_extra=require(_0xbf52('0x4'));var auth=require(_0xbf52('0x5'));var interaction=require(_0xbf52('0x6'));var config=require('../../config/environment');var controller=require(_0xbf52('0x7'));router['get']('/',auth[_0xbf52('0x8')](),controller['index']);router[_0xbf52('0x9')](_0xbf52('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbf52('0xb'),auth[_0xbf52('0x8')](),controller[_0xbf52('0xc')]);router[_0xbf52('0x9')](_0xbf52('0xd'),auth[_0xbf52('0x8')](),controller[_0xbf52('0xe')]);router[_0xbf52('0xf')]('/',auth[_0xbf52('0x8')](),controller[_0xbf52('0x10')]);router['post'](_0xbf52('0xd'),auth[_0xbf52('0x8')](),controller[_0xbf52('0x11')]);router[_0xbf52('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xbf52('0x13')]);router[_0xbf52('0x14')](_0xbf52('0xb'),auth[_0xbf52('0x8')](),controller['destroy']);module[_0xbf52('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 648d9fa..37f0ec5 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 _0x75fc=['STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize'];(function(_0x74745d,_0x177606){var _0x174ab3=function(_0x1c94e9){while(--_0x1c94e9){_0x74745d['push'](_0x74745d['shift']());}};_0x174ab3(++_0x177606);}(_0x75fc,0x10f));var _0xc75f=function(_0x12a827,_0x39ea76){_0x12a827=_0x12a827-0x0;var _0xb54beb=_0x75fc[_0x12a827];return _0xb54beb;};'use strict';var _=require(_0xc75f('0x0'));var Sequelize=require(_0xc75f('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xc75f('0x2')]},'street':{'type':Sequelize[_0xc75f('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc75f('0x2')]},'country':{'type':Sequelize[_0xc75f('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc75f('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xc75f('0x2')]},'fax':{'type':Sequelize[_0xc75f('0x2')]},'email':{'type':Sequelize[_0xc75f('0x2')]},'url':{'type':Sequelize[_0xc75f('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xc75f('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xc75f('0x2')]},'teams':{'type':Sequelize[_0xc75f('0x2')]},'viber':{'type':Sequelize[_0xc75f('0x2')]},'line':{'type':Sequelize[_0xc75f('0x2')]},'wechat':{'type':Sequelize[_0xc75f('0x2')]},'telegram':{'type':Sequelize[_0xc75f('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc75f('0x4')](0x2)[_0xc75f('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xc75f('0x6')]},'dialTimezone':{'type':Sequelize[_0xc75f('0x2')]},'utcOffset':{'type':Sequelize[_0xc75f('0x4')]}}; \ No newline at end of file +var _0x3f9d=['exports','STRING','INTEGER','DATE','NOW','lodash','sequelize'];(function(_0x282dca,_0x1aa4d2){var _0x307f61=function(_0x340830){while(--_0x340830){_0x282dca['push'](_0x282dca['shift']());}};_0x307f61(++_0x1aa4d2);}(_0x3f9d,0x101));var _0xd3f9=function(_0x4cb03b,_0x47d402){_0x4cb03b=_0x4cb03b-0x0;var _0x132ba4=_0x3f9d[_0x4cb03b];return _0x132ba4;};'use strict';var _=require(_0xd3f9('0x0'));var Sequelize=require(_0xd3f9('0x1'));module[_0xd3f9('0x2')]={'firstName':{'type':Sequelize[_0xd3f9('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd3f9('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd3f9('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xd3f9('0x3')]},'mobile':{'type':Sequelize[_0xd3f9('0x3')]},'fax':{'type':Sequelize[_0xd3f9('0x3')]},'email':{'type':Sequelize[_0xd3f9('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xd3f9('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xd3f9('0x3')]},'skype':{'type':Sequelize[_0xd3f9('0x3')]},'teams':{'type':Sequelize[_0xd3f9('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xd3f9('0x3')]},'telegram':{'type':Sequelize[_0xd3f9('0x3')]},'UserId':{'type':Sequelize[_0xd3f9('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd3f9('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd3f9('0x5')],'defaultValue':Sequelize[_0xd3f9('0x6')]},'dialTimezone':{'type':Sequelize[_0xd3f9('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a853762..491a368 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 _0xdd98=['./cmContact.socket','register','status','json','offset','undefined','limit','count','destroy','end','sendStatus','error','stack','name','index','describe','getOptions','query','user','then','CmContact','find','params','catch','tags','keys','length','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','alias','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','isArray','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','where','push','findOrCreate','spread','contact','show','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','ListId','$and','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','toParam','text','phone','CmHopper','getTags','model','rawAttributes','intersection','attributes','fields','sort','filters','pick','filter','options','hasOwnProperty','setTags','findOne','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','description','PHONE','item','ItemType.OrderBy','bulkCreate','getAdditionalPhones','`ItemType`.OrderBy','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','nolimit','order','ContactId','includeAll','rows','getHopperHistories','CmHopperHistory','include','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','split','Incorrect\x20binding\x20parameters\x20passed!','firstName','No\x20firstName\x20column\x20specified','file','filename','chmodSync','child_process','fork','../../components/import/cm/csv','socket_timestamp','File\x20uploaded\x20correctly!','pid','send','upload','parse','meta','User','agent','No\x20phone\x20column\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','message','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','UserId','key','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','path','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x458dad,_0x573c0b){var _0x534d3a=function(_0x5889af){while(--_0x5889af){_0x458dad['push'](_0x458dad['shift']());}};_0x534d3a(++_0x573c0b);}(_0xdd98,0xf1));var _0x8dd9=function(_0x2ceade,_0xa7ebfd){_0x2ceade=_0x2ceade-0x0;var _0x3354b7=_0xdd98[_0x2ceade];return _0x3354b7;};'use strict';var moment=require(_0x8dd9('0x0'));var BPromise=require(_0x8dd9('0x1'));var util=require('util');var path=require(_0x8dd9('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8dd9('0x3'));var Papa=require('papaparse');var Redis=require(_0x8dd9('0x4'));var contacts=require(_0x8dd9('0x5'));var qs=require(_0x8dd9('0x6'));var logger=require(_0x8dd9('0x7'))(_0x8dd9('0x8'));var config=require(_0x8dd9('0x9'));var shared=require(_0x8dd9('0xa'));var db=require(_0x8dd9('0xb'))['db'];config[_0x8dd9('0xc')]=_[_0x8dd9('0xd')](config[_0x8dd9('0xc')],{'host':_0x8dd9('0xe'),'port':0x18eb});var socket=require(_0x8dd9('0xf'))(new Redis(config[_0x8dd9('0xc')]));require(_0x8dd9('0x10'))[_0x8dd9('0x11')](socket);function respondWithResult(_0x1406cd,_0xa5c086){_0xa5c086=_0xa5c086||0xc8;return function(_0x5f41cd){if(_0x5f41cd){return _0x1406cd[_0x8dd9('0x12')](_0xa5c086)[_0x8dd9('0x13')](_0x5f41cd);}};}function respondWithFilteredResult(_0x375ec7,_0xcb4e85){return function(_0x29b166){if(_0x29b166){var _0x33f965=typeof _0xcb4e85[_0x8dd9('0x14')]===_0x8dd9('0x15')&&typeof _0xcb4e85[_0x8dd9('0x16')]===_0x8dd9('0x15');var _0x167d7b=_0x29b166[_0x8dd9('0x17')];var _0x9dc07c=_0x33f965?0x0:_0xcb4e85[_0x8dd9('0x14')];var _0x3e8c11=_0x33f965?_0x29b166[_0x8dd9('0x17')]:_0xcb4e85['offset']+_0xcb4e85[_0x8dd9('0x16')];var _0x24a9ed;if(_0x3e8c11>=_0x167d7b){_0x3e8c11=_0x167d7b;_0x24a9ed=0xc8;}else{_0x24a9ed=0xce;}_0x375ec7[_0x8dd9('0x12')](_0x24a9ed);return _0x375ec7['set']('Content-Range',_0x9dc07c+'-'+_0x3e8c11+'/'+_0x167d7b)['json'](_0x29b166);}return null;};}function saveUpdates(_0x329f5b){return function(_0x3cef28){if(_0x3cef28){return _0x3cef28['update'](_0x329f5b)['then'](function(_0x3694f6){return _0x3694f6;});}return null;};}function removeEntity(_0x2fd8dc){return function(_0x2e7f90){if(_0x2e7f90){return _0x2e7f90[_0x8dd9('0x18')]()['then'](function(){_0x2fd8dc[_0x8dd9('0x12')](0xcc)[_0x8dd9('0x19')]();});}};}function handleEntityNotFound(_0x31e6b3){return function(_0x3ff16){if(!_0x3ff16){_0x31e6b3[_0x8dd9('0x1a')](0x194);}return _0x3ff16;};}function handleError(_0x32f0fb,_0x4167e1){_0x4167e1=_0x4167e1||0x1f4;return function(_0x429366){logger[_0x8dd9('0x1b')](_0x429366[_0x8dd9('0x1c')]);if(_0x429366['name']){delete _0x429366[_0x8dd9('0x1d')];}_0x32f0fb[_0x8dd9('0x12')](_0x4167e1)['send'](_0x429366);};}exports[_0x8dd9('0x1e')]=function(_0x30d25c,_0x245b41){var _0x240fbf={};return contacts[_0x8dd9('0x1f')]()['then'](function(_0x55986f){_0x240fbf=qs[_0x8dd9('0x20')](_0x55986f,_0x30d25c);return contacts['findAll'](_0x30d25c[_0x8dd9('0x21')],_0x30d25c[_0x8dd9('0x22')],_0x240fbf,_0x55986f);})[_0x8dd9('0x23')](respondWithFilteredResult(_0x245b41,_0x240fbf))['catch'](handleError(_0x245b41,null));};exports[_0x8dd9('0x18')]=function(_0x196a30,_0x49f688){return db[_0x8dd9('0x24')][_0x8dd9('0x25')]({'where':{'id':_0x196a30[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x49f688,null))['then'](removeEntity(_0x49f688,null))[_0x8dd9('0x27')](handleError(_0x49f688,null));};exports[_0x8dd9('0x1f')]=function(_0x3ff030,_0x25a9dd){return db[_0x8dd9('0x24')][_0x8dd9('0x1f')]()[_0x8dd9('0x23')](function(_0x42fac3){delete _0x42fac3[_0x8dd9('0x28')];for(var _0x559be9=0x0;_0x559be90x0){return new Promise(function(_0xa6b0db){var _0x4ee146=[];for(var _0x1a79cd=0x0;_0x1a79cd<_0x43d8d7[_0x8dd9('0x2a')];_0x1a79cd++){_0x4ee146[_0x8dd9('0x5d')](insertAdditionalPhones(_0x43d8d7[_0x1a79cd][_0x8dd9('0x60')],_0x43d8d7[_0x1a79cd][_0x8dd9('0x59')]));}Promise['all'](_0x4ee146)[_0x8dd9('0x23')](function(){_0xa6b0db(0x1);});})[_0x8dd9('0x23')](function(){return{'success':_0xd6192c,'failure':_0x188ce6,'duplicates':_0x1d308a};});}else{return{'success':_0xd6192c,'failure':_0x188ce6,'duplicates':_0x1d308a};}}})['then'](respondWithResult(_0x31fb98,0xc9))[_0x8dd9('0x27')](handleError(_0x31fb98,null));};exports[_0x8dd9('0x61')]=function(_0x58df42,_0x53f0f1){var _0x2edeaf;return db[_0x8dd9('0x24')][_0x8dd9('0x1f')]()[_0x8dd9('0x23')](function(_0x3db6ba){return db[_0x8dd9('0x24')][_0x8dd9('0x25')]({'where':{'id':_0x58df42[_0x8dd9('0x26')]['id']},'include':[{'model':db[_0x8dd9('0x62')],'as':_0x8dd9('0x63'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0x64')],'required':_0x58df42[_0x8dd9('0x21')][_0x8dd9('0x65')]?!![]:![]},{'model':db[_0x8dd9('0x4a')],'as':_0x8dd9('0x66'),'where':{'CmContactId':_0x58df42[_0x8dd9('0x26')]['id']},'required':![],'include':[{'model':db[_0x8dd9('0x67')],'as':_0x8dd9('0x68')}]}],'order':[db[_0x8dd9('0x69')][_0x8dd9('0x6a')](_0x8dd9('0x6b'))],'attributes':_[_0x8dd9('0x29')](_0x3db6ba)});})[_0x8dd9('0x23')](function(_0xe08ea1){if(!_[_0x8dd9('0x55')](_0xe08ea1)){_0x2edeaf=_0xe08ea1[_0x8dd9('0x3a')]({'plain':!![]});var _0x23ba38={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xe08ea1&&_0xe08ea1[_0x8dd9('0x6c')]){if(_0xe08ea1['ListId']){_0x23ba38[_0x8dd9('0x5c')][_0x8dd9('0x6d')]['push']({'ListId':{'$ne':_0xe08ea1['ListId']}});}}return db[_0x8dd9('0x30')][_0x8dd9('0x31')](_0x23ba38);}})[_0x8dd9('0x23')](function(_0x3b0be8){if(!_[_0x8dd9('0x55')](_0x3b0be8)){return _['omit'](_0x2edeaf,_[_0x8dd9('0x6e')](_0x3b0be8,function(_0x2f3457){return util[_0x8dd9('0x6f')](_0x8dd9('0x70'),_0x2f3457['id']);}));}})['then'](handleEntityNotFound(_0x53f0f1,null))['then'](respondWithResult(_0x53f0f1,null))[_0x8dd9('0x27')](handleError(_0x53f0f1,null));};exports[_0x8dd9('0x43')]=function(_0x19c817,_0x2038a3){var _0x2e29b0;if(_0x19c817[_0x8dd9('0x39')]['id']){delete _0x19c817[_0x8dd9('0x39')]['id'];}if(!_[_0x8dd9('0x55')](_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x56')])){var _0x460cf9=_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x56')];if(!_[_0x8dd9('0x55')](shared[_0x8dd9('0x57')][_0x460cf9]))_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x58')]=shared[_0x8dd9('0x57')][_0x460cf9][_0x8dd9('0x58')];}return db[_0x8dd9('0x24')][_0x8dd9('0x25')]({'where':{'id':_0x19c817[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x2038a3,null))['then'](saveUpdates(_0x19c817['body'],null))[_0x8dd9('0x23')](function(_0xee09a7){_0x2e29b0=_0xee09a7;var _0x5c7f2b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xee09a7&&_0xee09a7['ListId']){if(_0xee09a7[_0x8dd9('0x6c')]){_0x5c7f2b[_0x8dd9('0x5c')][_0x8dd9('0x6d')][_0x8dd9('0x5d')]({'ListId':{'$ne':_0xee09a7[_0x8dd9('0x6c')]}});}}return db[_0x8dd9('0x30')][_0x8dd9('0x31')](_0x5c7f2b);})[_0x8dd9('0x23')](function(_0x29712a){if(_0x29712a){return _[_0x8dd9('0x71')](_[_0x8dd9('0x72')](_0x19c817[_0x8dd9('0x39')],function(_0x1f832f,_0x51505b){return _[_0x8dd9('0x2b')](_0x51505b,_0x8dd9('0x2c'));}),_[_0x8dd9('0x6e')](_0x29712a,function(_0x5a12b4){return util[_0x8dd9('0x6f')]('cf_%d',_0x5a12b4['id']);}));}})[_0x8dd9('0x23')](function(_0x245547){if(_0x245547&&!_[_0x8dd9('0x73')](_0x245547)){var _0x66afbe=squel[_0x8dd9('0x43')]()[_0x8dd9('0x74')](_0x8dd9('0x75'))[_0x8dd9('0x76')](_0x245547)[_0x8dd9('0x5c')]('id\x20=\x20?',_0x19c817[_0x8dd9('0x26')]['id'])[_0x8dd9('0x77')]();return db['sequelize'][_0x8dd9('0x21')](_0x66afbe[_0x8dd9('0x78')],{'replacements':_0x66afbe['values']});}})[_0x8dd9('0x23')](function(){if(_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x79')]&&_0x2e29b0){return db[_0x8dd9('0x7a')][_0x8dd9('0x43')]({'phone':_0x19c817[_0x8dd9('0x39')][_0x8dd9('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x2e29b0['id']}});}})[_0x8dd9('0x23')](function(){return _0x2e29b0;})[_0x8dd9('0x23')](respondWithResult(_0x2038a3,null))[_0x8dd9('0x27')](handleError(_0x2038a3,null));};exports[_0x8dd9('0x7b')]=function(_0x1fbc51,_0x1480d4){var _0x1416e0={};var _0x29fccd={};var _0x12f70a;var _0xce5f3d;return db[_0x8dd9('0x24')]['findOne']({'where':{'id':_0x1fbc51[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x1480d4,null))[_0x8dd9('0x23')](function(_0x443079){if(_0x443079){_0x12f70a=_0x443079;_0x29fccd[_0x8dd9('0x7c')]=_[_0x8dd9('0x29')](db['Tag'][_0x8dd9('0x7d')]);_0x29fccd[_0x8dd9('0x21')]=_['keys'](_0x1fbc51[_0x8dd9('0x21')]);_0x29fccd['filters']=_[_0x8dd9('0x7e')](_0x29fccd[_0x8dd9('0x7c')],_0x29fccd['query']);_0x1416e0[_0x8dd9('0x7f')]=_['intersection'](_0x29fccd[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x1416e0['attributes']=_0x1416e0[_0x8dd9('0x7f')][_0x8dd9('0x2a')]?_0x1416e0[_0x8dd9('0x7f')]:_0x29fccd[_0x8dd9('0x7c')];_0x1416e0['order']=qs[_0x8dd9('0x81')](_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x81')]);_0x1416e0[_0x8dd9('0x5c')]=qs[_0x8dd9('0x82')](_[_0x8dd9('0x83')](_0x1fbc51[_0x8dd9('0x21')],_0x29fccd[_0x8dd9('0x82')]));if(_0x1fbc51['query'][_0x8dd9('0x84')]){_0x1416e0['where']=_[_0x8dd9('0x38')](_0x1416e0['where'],{'$or':_[_0x8dd9('0x6e')](_0x1416e0['attributes'],function(_0x44173e){var _0x13563c={};_0x13563c[_0x44173e]={'$like':'%'+_0x1fbc51['query'][_0x8dd9('0x84')]+'%'};return _0x13563c;})});}_0x1416e0=_[_0x8dd9('0x38')]({},_0x1416e0,_0x1fbc51[_0x8dd9('0x85')]);return _0x12f70a['getTags'](_0x1416e0);}})['then'](function(_0x38d4b4){if(_0x38d4b4){_0xce5f3d=_0x38d4b4[_0x8dd9('0x2a')];if(!_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x86')]('nolimit')){_0x1416e0[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x1fbc51[_0x8dd9('0x21')][_0x8dd9('0x16')]);_0x1416e0[_0x8dd9('0x14')]=qs[_0x8dd9('0x14')](_0x1fbc51['query'][_0x8dd9('0x14')]);}return _0x12f70a[_0x8dd9('0x7b')](_0x1416e0);}})[_0x8dd9('0x23')](function(_0x345a80){if(_0x345a80){return _0x345a80?{'count':_0xce5f3d,'rows':_0x345a80}:null;}})[_0x8dd9('0x23')](respondWithResult(_0x1480d4,null))['catch'](handleError(_0x1480d4,null));};exports[_0x8dd9('0x87')]=function(_0x1653c1,_0x147d2e){if(_0x1653c1['body']['id']){delete _0x1653c1[_0x8dd9('0x39')]['id'];}return db[_0x8dd9('0x24')][_0x8dd9('0x88')]({'where':{'id':_0x1653c1['params']['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x147d2e,null))['then'](function(_0x31349b){if(_0x31349b){return _0x31349b['setTags'](_0x1653c1[_0x8dd9('0x39')][_0x8dd9('0x89')]||[]);}return null;})['then'](respondWithResult(_0x147d2e,null))[_0x8dd9('0x27')](handleError(_0x147d2e,null));};exports[_0x8dd9('0x8a')]=function(_0x1c8e5b,_0x2b6820){var _0x304804=[];_0x304804[_0x8dd9('0x5d')](addAdditionalPhones(_0x1c8e5b['body']));Promise[_0x8dd9('0x8b')](_0x304804)[_0x8dd9('0x23')](function(){_0x304804=[];_0x304804['push'](deleteCmHopperPhones(_0x1c8e5b[_0x8dd9('0x39')]['id']));_0x304804[_0x8dd9('0x5d')](addCmHopperPhones(_0x1c8e5b[_0x8dd9('0x39')]['id']));Promise[_0x8dd9('0x8b')](_0x304804)['then'](function(){return[0x1];})[_0x8dd9('0x23')](respondWithResult(_0x2b6820,null));});};function addAdditionalPhones(_0x1e7dc8){var _0x4a56eb;return new Promise(function(_0x40c88a){return db[_0x8dd9('0x4a')][_0x8dd9('0x18')]({'where':{'CmContactId':_0x1e7dc8['id']}})[_0x8dd9('0x23')](function(){db['ContactItemType'][_0x8dd9('0x31')]({'raw':!![],'attributes':['id',_0x8dd9('0x8c')]})[_0x8dd9('0x23')](function(_0x29a6ed){var _0x3fb52f=[];for(var _0x49102b=0x0;_0x49102b<_0x1e7dc8[_0x8dd9('0x8d')]['length'];_0x49102b++){var _0x4dcba1=_0x1e7dc8[_0x8dd9('0x8e')]?_[_0x8dd9('0x55')](_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b])?'':_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b]:_0x1e7dc8['items'][_0x49102b][_0x8dd9('0x8f')]?_0x1e7dc8['items'][_0x49102b]['ItemTypeId']:'';var _0x3e1c96=_[_0x8dd9('0x55')](_0x1e7dc8['items'][_0x49102b][_0x8dd9('0x90')])?'':_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b]['description'];var _0x3008bd=_0x4dcba1+':'+_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b][_0x8dd9('0x79')]+'§'+_0x3e1c96;if(_[_0x8dd9('0x55')](_0x4a56eb))_0x4a56eb=_0x3008bd;else _0x4a56eb+=';'+_0x3008bd;var _0x3606e0=null;var _0x109e04=null;if(_0x1e7dc8[_0x8dd9('0x8e')]){if(!_['isNil'](_0x1e7dc8['item_types'][_0x49102b])){_0x109e04=_['find'](_0x29a6ed,function(_0x3a10e6){return _0x3a10e6['id']===_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b];});if(!_[_0x8dd9('0x55')](_0x109e04)){_0x3606e0=_0x109e04[_0x8dd9('0x8c')];}}}else{if(!_[_0x8dd9('0x55')](_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b])){_0x109e04=_[_0x8dd9('0x25')](_0x29a6ed,function(_0x1aa514){return _0x1aa514['id']===_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b][_0x8dd9('0x8f')];});if(!_['isNil'](_0x109e04)){_0x3606e0=_0x49102b;}}}if(_['isNil'](_0x3606e0)){_0x3606e0=0x64;}_0x3fb52f[_0x8dd9('0x5d')](addAdditionalPhone(_0x1e7dc8['id'],_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b]['phone'],_0x1e7dc8[_0x8dd9('0x8e')]?_[_0x8dd9('0x55')](_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b])?null:_0x1e7dc8[_0x8dd9('0x8e')][_0x49102b]:_0x1e7dc8[_0x8dd9('0x8d')][_0x49102b][_0x8dd9('0x8f')]?_0x1e7dc8['items'][_0x49102b]['ItemTypeId']:null,_0x3606e0,_0x3e1c96));}Promise[_0x8dd9('0x8b')](_0x3fb52f)['then'](function(){db[_0x8dd9('0x24')][_0x8dd9('0x43')]({'AdditionalPhones':_0x4a56eb},{'where':{'id':_0x1e7dc8['id']}})[_0x8dd9('0x23')](function(){_0x40c88a(0x1);});});});});});}function addAdditionalPhone(_0x8609c9,_0x446744,_0x39604e,_0x54f367,_0xbde497){return db[_0x8dd9('0x4a')][_0x8dd9('0x25')]({'where':{'CmContactId':_0x8609c9,'item':_0x446744}})['then'](function(_0x21ed76){if(_0x21ed76)logger['info']('contact\x20phone\x20exists',_0x21ed76);else{db[_0x8dd9('0x4a')]['create']({'CmContactId':_0x8609c9,'item':_0x446744,'ItemTypeId':_0x39604e,'OrderBy':_0x54f367,'ItemClass':_0x8dd9('0x91'),'description':_0xbde497});}});}function deleteCmHopperPhones(_0x19e246){return new Promise(function(_0x23f194){return db[_0x8dd9('0x7a')][_0x8dd9('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e246}})[_0x8dd9('0x23')](function(_0x59b8df){db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':{'$in':_[_0x8dd9('0x6e')](_0x59b8df,'id')}}});})[_0x8dd9('0x23')](function(){_0x23f194(0x1);});});}function addCmHopperPhones(_0x20925c){return new Promise(function(_0x30cf27){return db['CmHopper'][_0x8dd9('0x31')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x20925c}})[_0x8dd9('0x23')](function(_0x2689e8){var _0x999251=[];_[_0x8dd9('0x6e')](_0x2689e8,function(_0x4c267c){_0x999251[_0x8dd9('0x5d')](createCmHopperPhone(_0x20925c,_0x4c267c['id']));});Promise[_0x8dd9('0x8b')](_0x999251)[_0x8dd9('0x23')](function(){_0x30cf27(0x1);});});});}function createCmHopperPhone(_0x3570bb,_0x210853){return new Promise(function(_0x27b217){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0x8dd9('0x92'),'OrderBy'],'where':{'CmContactId':_0x3570bb,'ItemClass':_0x8dd9('0x91')},'include':[{'model':db[_0x8dd9('0x67')],'attributes':[_0x8dd9('0x8c')],'as':_0x8dd9('0x68')}],'order':['OrderBy',db[_0x8dd9('0x69')][_0x8dd9('0x6a')]('`ItemType`.OrderBy')]})['then'](function(_0x46cfe8){var _0x205e3c=0x1;var _0x44f0b4=_[_0x8dd9('0x6e')](_0x46cfe8,function(_0x490580){_0x490580['CmHopperId']=_0x210853;_0x490580[_0x8dd9('0x79')]=_0x490580[_0x8dd9('0x92')];_0x490580[_0x8dd9('0x8c')]=_0x205e3c;delete _0x490580[_0x8dd9('0x93')];_0x205e3c=_0x205e3c+0x1;return _0x490580;});return db['CmHopperAdditionalPhone'][_0x8dd9('0x94')](_0x44f0b4,{});})[_0x8dd9('0x23')](function(){_0x27b217(0x1);});});}function insertAdditionalPhones(_0x10c2aa,_0x3040ee){return new Promise(function(_0x17c463){var _0x4ca331=[];for(var _0x1f60e4=0x0;_0x1f60e4<_0x3040ee[_0x8dd9('0x2a')];_0x1f60e4++){var _0x456eb2=_0x3040ee[_0x1f60e4];_0x4ca331[_0x8dd9('0x5d')](parseContactItemType(_0x456eb2));}Promise[_0x8dd9('0x8b')](_0x4ca331)[_0x8dd9('0x23')](function(){var _0x556fb7={'id':_0x10c2aa['id'],'items':_0x3040ee};return addAdditionalPhones(_0x556fb7)[_0x8dd9('0x23')](function(){return addCmHopperPhones(_0x10c2aa['id']);});})[_0x8dd9('0x23')](function(){_0x17c463(_0x10c2aa);});});}function parseContactItemType(_0x46562a){return new Promise(function(_0x428e4){if(_0x46562a[_0x8dd9('0x86')](_0x8dd9('0x8f'))){_0x428e4(_0x46562a);}else{return db['ContactItemType'][_0x8dd9('0x25')]({'where':{'name':_0x46562a[_0x8dd9('0x68')]}})['then'](function(_0x77c63c){if(_[_0x8dd9('0x55')](_0x77c63c))_0x46562a[_0x8dd9('0x8f')]=null;else _0x46562a[_0x8dd9('0x8f')]=_0x77c63c['id'];_0x428e4(_0x46562a);});}});}exports[_0x8dd9('0x95')]=function(_0x244594,_0x52b917){return db[_0x8dd9('0x4a')][_0x8dd9('0x31')]({'raw':!![],'where':{'CmContactId':_0x244594[_0x8dd9('0x26')]['id'],'ItemClass':_0x8dd9('0x91')},'include':[{'model':db[_0x8dd9('0x67')],'as':_0x8dd9('0x68')}],'order':[[_0x8dd9('0x8c')],[db[_0x8dd9('0x69')][_0x8dd9('0x6a')](_0x8dd9('0x96'))]]})[_0x8dd9('0x23')](function(_0x5e198e){return _0x5e198e;})[_0x8dd9('0x23')](respondWithResult(_0x52b917,null))['catch'](handleError(_0x52b917,null));};exports['duplicateAdditionalPhones']=function(_0x575cf1,_0x2c54e1){return db[_0x8dd9('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x575cf1['body']['fromContactId']}})[_0x8dd9('0x23')](function(_0x2dbdde){var _0x4f336f=_['map'](_0x2dbdde,function(_0x285628){_0x285628[_0x8dd9('0x97')]=_0x575cf1['body'][_0x8dd9('0x98')];return _0x285628;});return db[_0x8dd9('0x4a')][_0x8dd9('0x94')](_0x4f336f,{});})['then'](function(){return addCmHopperPhones(_0x575cf1[_0x8dd9('0x39')][_0x8dd9('0x98')]);})[_0x8dd9('0x23')](function(){return['ok'];})['then'](respondWithResult(_0x2c54e1,null))['catch'](handleError(_0x2c54e1,null));};exports[_0x8dd9('0x99')]=function(_0x128cbd,_0x44ad92){var _0x4b1bc9=[];_0x4b1bc9[_0x8dd9('0x5d')](createCmHopperPhone(_0x128cbd[_0x8dd9('0x39')]['id'],_0x128cbd['body'][_0x8dd9('0x9a')]));Promise['all'](_0x4b1bc9)['then'](function(){return[0x1];})[_0x8dd9('0x23')](respondWithResult(_0x44ad92,null));};exports[_0x8dd9('0x9b')]=function(_0x230f3e,_0x1eaee1){var _0x1ad8b8={'raw':![],'where':{}};var _0x3773fc={};var _0x5a77f2={'count':0x0,'rows':[]};return db[_0x8dd9('0x24')][_0x8dd9('0x88')]({'where':{'id':_0x230f3e[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x1eaee1,null))[_0x8dd9('0x23')](function(_0x1d0b6e){if(_0x1d0b6e){_0x3773fc[_0x8dd9('0x7c')]=_['keys'](db['CmHopper'][_0x8dd9('0x7d')]);_0x3773fc[_0x8dd9('0x21')]=_['keys'](_0x230f3e[_0x8dd9('0x21')]);_0x3773fc[_0x8dd9('0x82')]=_[_0x8dd9('0x7e')](_0x3773fc['model'],_0x3773fc[_0x8dd9('0x21')]);_0x1ad8b8[_0x8dd9('0x7f')]=_['intersection'](_0x3773fc[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x1ad8b8['attributes']=_0x1ad8b8[_0x8dd9('0x7f')][_0x8dd9('0x2a')]?_0x1ad8b8[_0x8dd9('0x7f')]:_0x3773fc[_0x8dd9('0x7c')];if(!_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x86')](_0x8dd9('0x9c'))){_0x1ad8b8[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x230f3e['query'][_0x8dd9('0x16')]);_0x1ad8b8['offset']=qs[_0x8dd9('0x14')](_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x14')]);}_0x1ad8b8[_0x8dd9('0x9d')]=qs[_0x8dd9('0x81')](_0x230f3e['query'][_0x8dd9('0x81')]);_0x1ad8b8[_0x8dd9('0x5c')]=qs['filters'](_[_0x8dd9('0x83')](_0x230f3e['query'],_0x3773fc[_0x8dd9('0x82')]));_0x1ad8b8[_0x8dd9('0x5c')][_0x8dd9('0x9e')]=_0x1d0b6e['id'];if(_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x84')]){_0x1ad8b8[_0x8dd9('0x5c')]=_[_0x8dd9('0x38')](_0x1ad8b8[_0x8dd9('0x5c')],{'$or':_[_0x8dd9('0x6e')](_0x1ad8b8['attributes'],function(_0x1777e8){var _0x55ea15={};_0x55ea15[_0x1777e8]={'$like':'%'+_0x230f3e[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x55ea15;})});}_0x1ad8b8=_[_0x8dd9('0x38')]({},_0x1ad8b8,_0x230f3e[_0x8dd9('0x85')]);return db['CmHopper'][_0x8dd9('0x17')]({'where':_0x1ad8b8[_0x8dd9('0x5c')]})[_0x8dd9('0x23')](function(_0x32d47e){_0x5a77f2['count']=_0x32d47e;if(_0x230f3e['query'][_0x8dd9('0x9f')]){_0x1ad8b8['include']=[{'all':!![]}];}return db[_0x8dd9('0x7a')][_0x8dd9('0x31')](_0x1ad8b8);})[_0x8dd9('0x23')](function(_0x1d66c2){_0x5a77f2[_0x8dd9('0xa0')]=_0x1d66c2;return _0x5a77f2;});}})[_0x8dd9('0x23')](respondWithFilteredResult(_0x1eaee1,_0x1ad8b8))[_0x8dd9('0x27')](handleError(_0x1eaee1,null));};exports[_0x8dd9('0xa1')]=function(_0x45b887,_0x129cc0){var _0x188f2e={'raw':!![],'where':{}};var _0xd98a56={};var _0x35542a={'count':0x0,'rows':[]};return db[_0x8dd9('0x24')][_0x8dd9('0x88')]({'where':{'id':_0x45b887['params']['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x129cc0,null))[_0x8dd9('0x23')](function(_0x255c6d){if(_0x255c6d){_0xd98a56['model']=_[_0x8dd9('0x29')](db['CmHopperHistory'][_0x8dd9('0x7d')]);_0xd98a56[_0x8dd9('0x21')]=_[_0x8dd9('0x29')](_0x45b887['query']);_0xd98a56[_0x8dd9('0x82')]=_[_0x8dd9('0x7e')](_0xd98a56[_0x8dd9('0x7c')],_0xd98a56[_0x8dd9('0x21')]);_0x188f2e[_0x8dd9('0x7f')]=_[_0x8dd9('0x7e')](_0xd98a56[_0x8dd9('0x7c')],qs['fields'](_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x188f2e[_0x8dd9('0x7f')]=_0x188f2e['attributes'][_0x8dd9('0x2a')]?_0x188f2e['attributes']:_0xd98a56[_0x8dd9('0x7c')];if(!_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x86')](_0x8dd9('0x9c'))){_0x188f2e[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x16')]);_0x188f2e[_0x8dd9('0x14')]=qs[_0x8dd9('0x14')](_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x14')]);}_0x188f2e['order']=qs[_0x8dd9('0x81')](_0x45b887[_0x8dd9('0x21')]['sort']);_0x188f2e[_0x8dd9('0x5c')]=qs[_0x8dd9('0x82')](_['pick'](_0x45b887['query'],_0xd98a56['filters']));_0x188f2e[_0x8dd9('0x5c')][_0x8dd9('0x9e')]=_0x255c6d['id'];if(_0x45b887[_0x8dd9('0x21')]['filter']){_0x188f2e[_0x8dd9('0x5c')]=_[_0x8dd9('0x38')](_0x188f2e[_0x8dd9('0x5c')],{'$or':_[_0x8dd9('0x6e')](_0x188f2e[_0x8dd9('0x7f')],function(_0x342d77){var _0x43ce80={};_0x43ce80[_0x342d77]={'$like':'%'+_0x45b887[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x43ce80;})});}_0x188f2e=_[_0x8dd9('0x38')]({},_0x188f2e,_0x45b887[_0x8dd9('0x85')]);return db[_0x8dd9('0xa2')][_0x8dd9('0x17')]({'where':_0x188f2e[_0x8dd9('0x5c')]})[_0x8dd9('0x23')](function(_0xbce542){_0x35542a['count']=_0xbce542;if(_0x45b887['query']['includeAll']){_0x188f2e[_0x8dd9('0xa3')]=[{'all':!![]}];}return db[_0x8dd9('0xa2')][_0x8dd9('0x31')](_0x188f2e);})[_0x8dd9('0x23')](function(_0x5f5c75){_0x35542a['rows']=_0x5f5c75;return _0x35542a;});}})[_0x8dd9('0x23')](respondWithFilteredResult(_0x129cc0,_0x188f2e))[_0x8dd9('0x27')](handleError(_0x129cc0,null));};exports[_0x8dd9('0xa4')]=function(_0x3d1935,_0x279228){var _0x2281fd={'raw':!![],'where':{}};var _0x276680={};var _0x14988d={'count':0x0,'rows':[]};return db['CmContact'][_0x8dd9('0x88')]({'where':{'id':_0x3d1935[_0x8dd9('0x26')]['id']}})[_0x8dd9('0x23')](handleEntityNotFound(_0x279228,null))[_0x8dd9('0x23')](function(_0x25f69e){if(_0x25f69e){_0x276680[_0x8dd9('0x7c')]=_[_0x8dd9('0x29')](db[_0x8dd9('0x4b')][_0x8dd9('0x7d')]);_0x276680[_0x8dd9('0x21')]=_[_0x8dd9('0x29')](_0x3d1935[_0x8dd9('0x21')]);_0x276680['filters']=_['intersection'](_0x276680[_0x8dd9('0x7c')],_0x276680[_0x8dd9('0x21')]);_0x2281fd[_0x8dd9('0x7f')]=_[_0x8dd9('0x7e')](_0x276680[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x80')]));_0x2281fd[_0x8dd9('0x7f')]=_0x2281fd[_0x8dd9('0x7f')]['length']?_0x2281fd[_0x8dd9('0x7f')]:_0x276680[_0x8dd9('0x7c')];if(!_0x3d1935[_0x8dd9('0x21')]['hasOwnProperty'](_0x8dd9('0x9c'))){_0x2281fd[_0x8dd9('0x16')]=qs[_0x8dd9('0x16')](_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x16')]);_0x2281fd[_0x8dd9('0x14')]=qs[_0x8dd9('0x14')](_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x14')]);}_0x2281fd[_0x8dd9('0x9d')]=qs[_0x8dd9('0x81')](_0x3d1935[_0x8dd9('0x21')]['sort']);_0x2281fd[_0x8dd9('0x5c')]=qs['filters'](_[_0x8dd9('0x83')](_0x3d1935[_0x8dd9('0x21')],_0x276680[_0x8dd9('0x82')]));_0x2281fd[_0x8dd9('0x5c')]['ContactId']=_0x25f69e['id'];if(_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x84')]){_0x2281fd['where']=_[_0x8dd9('0x38')](_0x2281fd['where'],{'$or':_[_0x8dd9('0x6e')](_0x2281fd[_0x8dd9('0x7f')],function(_0x517b6b){var _0x297820={};_0x297820[_0x517b6b]={'$like':'%'+_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x297820;})});}_0x2281fd=_[_0x8dd9('0x38')]({},_0x2281fd,_0x3d1935['options']);return db[_0x8dd9('0x4b')][_0x8dd9('0x17')]({'where':_0x2281fd[_0x8dd9('0x5c')]})['then'](function(_0x40e945){_0x14988d[_0x8dd9('0x17')]=_0x40e945;if(_0x3d1935[_0x8dd9('0x21')][_0x8dd9('0x9f')]){_0x2281fd[_0x8dd9('0xa3')]=[{'all':!![]}];}return db[_0x8dd9('0x4b')]['findAll'](_0x2281fd);})['then'](function(_0x4b3d7e){_0x14988d[_0x8dd9('0xa0')]=_0x4b3d7e;return _0x14988d;});}})['then'](respondWithFilteredResult(_0x279228,_0x2281fd))['catch'](handleError(_0x279228,null));};exports[_0x8dd9('0xa5')]=function(_0x1ae130,_0x7b6ec7){var _0x2af857={'raw':!![],'where':{}};var _0x3735a7={};var _0x4753ea={'count':0x0,'rows':[]};return db['CmContact'][_0x8dd9('0x88')]({'where':{'id':_0x1ae130[_0x8dd9('0x26')]['id']}})['then'](handleEntityNotFound(_0x7b6ec7,null))[_0x8dd9('0x23')](function(_0xfb02f8){if(_0xfb02f8){_0x3735a7[_0x8dd9('0x7c')]=_[_0x8dd9('0x29')](db[_0x8dd9('0x51')]['rawAttributes']);_0x3735a7['query']=_['keys'](_0x1ae130['query']);_0x3735a7[_0x8dd9('0x82')]=_['intersection'](_0x3735a7['model'],_0x3735a7['query']);_0x2af857['attributes']=_[_0x8dd9('0x7e')](_0x3735a7[_0x8dd9('0x7c')],qs[_0x8dd9('0x80')](_0x1ae130[_0x8dd9('0x21')]['fields']));_0x2af857[_0x8dd9('0x7f')]=_0x2af857[_0x8dd9('0x7f')][_0x8dd9('0x2a')]?_0x2af857[_0x8dd9('0x7f')]:_0x3735a7[_0x8dd9('0x7c')];if(!_0x1ae130[_0x8dd9('0x21')][_0x8dd9('0x86')](_0x8dd9('0x9c'))){_0x2af857['limit']=qs['limit'](_0x1ae130[_0x8dd9('0x21')]['limit']);_0x2af857['offset']=qs[_0x8dd9('0x14')](_0x1ae130['query'][_0x8dd9('0x14')]);}_0x2af857['order']=qs['sort'](_0x1ae130['query'][_0x8dd9('0x81')]);_0x2af857[_0x8dd9('0x5c')]=qs[_0x8dd9('0x82')](_[_0x8dd9('0x83')](_0x1ae130['query'],_0x3735a7[_0x8dd9('0x82')]));_0x2af857[_0x8dd9('0x5c')][_0x8dd9('0x9e')]=_0xfb02f8['id'];if(_0x1ae130[_0x8dd9('0x21')][_0x8dd9('0x84')]){_0x2af857[_0x8dd9('0x5c')]=_['merge'](_0x2af857['where'],{'$or':_[_0x8dd9('0x6e')](_0x2af857[_0x8dd9('0x7f')],function(_0x33f08e){var _0x14c21e={};_0x14c21e[_0x33f08e]={'$like':'%'+_0x1ae130[_0x8dd9('0x21')][_0x8dd9('0x84')]+'%'};return _0x14c21e;})});}_0x2af857=_[_0x8dd9('0x38')]({},_0x2af857,_0x1ae130[_0x8dd9('0x85')]);return db[_0x8dd9('0x51')][_0x8dd9('0x17')]({'where':_0x2af857[_0x8dd9('0x5c')]})['then'](function(_0x1d3123){_0x4753ea['count']=_0x1d3123;if(_0x1ae130['query'][_0x8dd9('0x9f')]){_0x2af857[_0x8dd9('0xa3')]=[{'all':!![]}];}return db[_0x8dd9('0x51')][_0x8dd9('0x31')](_0x2af857);})['then'](function(_0x19a050){_0x4753ea['rows']=_0x19a050;return _0x4753ea;});}})[_0x8dd9('0x23')](respondWithFilteredResult(_0x7b6ec7,_0x2af857))[_0x8dd9('0x27')](handleError(_0x7b6ec7,null));};exports['uploadCsv']=function(_0x115175,_0x2f1d15){try{if(!_0x115175['body'][_0x8dd9('0x6c')]){throw new Error(_0x8dd9('0xa6'));}if(!_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa7')]){throw new Error(_0x8dd9('0xa8'));}if(!_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa9')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x115175[_0x8dd9('0x39')]['socket_timestamp']){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x25cced=_0x115175['body']['binding_keys']['split'](',');var _0x11c29e=_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa9')][_0x8dd9('0xaa')](',');if(!_0x25cced['length']||!_0x11c29e[_0x8dd9('0x2a')]||_0x25cced['length']!==_0x11c29e[_0x8dd9('0x2a')]){throw new Error(_0x8dd9('0xab'));}_0x115175[_0x8dd9('0x39')]['fields']=_['zipObject'](_0x25cced,_0x11c29e);if(!_0x115175[_0x8dd9('0x39')][_0x8dd9('0x80')][_0x8dd9('0x79')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x115175['body']['fields'][_0x8dd9('0xac')]){throw new Error(_0x8dd9('0xad'));}var _0x26e27b=path[_0x8dd9('0x3c')](config['root'],'server/files/tmp',_0x115175[_0x8dd9('0xae')][_0x8dd9('0xaf')]);fs[_0x8dd9('0xb0')](_0x26e27b,parseInt('0777',0x8));var _0x341886=require(_0x8dd9('0xb1'))[_0x8dd9('0xb2')](path[_0x8dd9('0x3c')](__dirname,_0x8dd9('0xb3')),[_0x26e27b,_0x115175['body']['binding_keys'],_0x115175[_0x8dd9('0x39')][_0x8dd9('0xa9')],_0x115175[_0x8dd9('0x39')][_0x8dd9('0x6c')],_0x115175[_0x8dd9('0x39')]['CompanyId'],_0x115175[_0x8dd9('0x39')][_0x8dd9('0x5b')],_0x115175[_0x8dd9('0x39')][_0x8dd9('0xb4')]]);return _0x2f1d15['status'](0xc8)[_0x8dd9('0x13')]({'message':_0x8dd9('0xb5'),'pid':_0x341886[_0x8dd9('0xb6')]});}catch(_0x26d37b){return _0x2f1d15[_0x8dd9('0x12')](0x1f4)[_0x8dd9('0xb7')](_0x26d37b);}};exports[_0x8dd9('0xb8')]=function(_0x127d7c,_0x52b002){var _0x59a1fe=fs['createReadStream'](_0x127d7c[_0x8dd9('0xae')]['path']);Papa[_0x8dd9('0xb9')](_0x59a1fe,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x300467){return _0x52b002[_0x8dd9('0x12')](0xc8)['json']({'file':_0x127d7c[_0x8dd9('0xae')],'fields':_0x300467[_0x8dd9('0xba')][_0x8dd9('0x80')]});}});};exports['import']=function(_0x44a1fe,_0x2037ef){return db[_0x8dd9('0xbb')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x8dd9('0xbc')}})[_0x8dd9('0x23')](function(_0x5f54b8){var _0x156bd9=![];if(!_0x44a1fe[_0x8dd9('0x39')][_0x8dd9('0x6c')]){throw new Error(_0x8dd9('0xa6'));}if(!_0x44a1fe[_0x8dd9('0x39')]['binding'][_0x8dd9('0x79')]){throw new Error(_0x8dd9('0xbd'));}if(!_0x44a1fe['body'][_0x8dd9('0xbe')]['firstName']){throw new Error(_0x8dd9('0xad'));}if(!_0x44a1fe[_0x8dd9('0x39')]['socket_timestamp']){throw new Error(_0x8dd9('0xbf'));}var _0x13732a=require(_0x8dd9('0xb1'))[_0x8dd9('0xb2')](path[_0x8dd9('0x3c')](__dirname,_0x8dd9('0xc0')),[_0x44a1fe['params']['id'],JSON[_0x8dd9('0xc1')](_0x44a1fe['body']),JSON[_0x8dd9('0xc1')](_0x5f54b8)]);_0x13732a['on']('message',function(){_0x156bd9=!![];return _0x2037ef[_0x8dd9('0x12')](0xc8)[_0x8dd9('0x13')]({'message':_0x8dd9('0xc2'),'pid':_0x13732a[_0x8dd9('0xb6')]});});_0x13732a['on'](_0x8dd9('0xc3'),function(_0x2e8d29){if(_0x2e8d29&&!_0x156bd9){return _0x2037ef[_0x8dd9('0x12')](0x1f4)[_0x8dd9('0x13')]({'message':_0x8dd9('0xc4'),'pid':_0x13732a[_0x8dd9('0xb6')]});}});})[_0x8dd9('0x27')](handleError(_0x2037ef,null));};exports[_0x8dd9('0xc5')]=function(_0x99ac51,_0x3d57bf){return db[_0x8dd9('0xbb')][_0x8dd9('0x31')]({'raw':!![],'attributes':['id'],'where':{'role':_0x8dd9('0xbc')}})['then'](function(_0x2a779f){var _0x4f383a=![];if(!_0x99ac51[_0x8dd9('0x39')][_0x8dd9('0x6c')]){throw new Error('No\x20ListId\x20specified');}if(!_0x99ac51[_0x8dd9('0x39')]['binding']['phone']){throw new Error(_0x8dd9('0xbd'));}if(!_0x99ac51[_0x8dd9('0x39')]['binding']['firstName']){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x99ac51[_0x8dd9('0x39')]['socket_timestamp']){throw new Error(_0x8dd9('0xbf'));}var _0x59a35d=require(_0x8dd9('0xb1'))[_0x8dd9('0xb2')](path[_0x8dd9('0x3c')](__dirname,_0x8dd9('0xc6')),[_0x99ac51[_0x8dd9('0x26')]['id'],JSON[_0x8dd9('0xc1')](_0x99ac51['body']),JSON[_0x8dd9('0xc1')](_0x2a779f)]);_0x59a35d['on'](_0x8dd9('0xc7'),function(){_0x4f383a=!![];return _0x3d57bf[_0x8dd9('0x12')](0xc8)[_0x8dd9('0x13')]({'message':_0x8dd9('0xc2'),'pid':_0x59a35d[_0x8dd9('0xb6')]});});_0x59a35d['on'](_0x8dd9('0xc3'),function(_0x4e34c6){if(_0x4e34c6&&!_0x4f383a){return _0x3d57bf['status'](0x1f4)['json']({'message':_0x8dd9('0xc4'),'pid':_0x59a35d['pid']});}});})[_0x8dd9('0x27')](handleError(_0x3d57bf,null));};exports[_0x8dd9('0xc8')]=function(_0x4892d5,_0x251866){var _0x26d8ae=[_0x8dd9('0xc9'),_0x8dd9('0xca'),_0x8dd9('0xcb'),_0x8dd9('0xcc'),_0x8dd9('0xcd'),_0x8dd9('0xce'),_0x8dd9('0xcf')];var _0x1b86b8={'offset':0x0,'order':qs['sort'](_0x8dd9('0xd0'))},_0x1289df={'count':0x0,'rows':[]};Promise[_0x8dd9('0xd1')]()[_0x8dd9('0x23')](function(){if(_0x4892d5[_0x8dd9('0x21')]['channel']){if(!_[_0x8dd9('0xd2')](_0x26d8ae,_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0xd3')][_0x8dd9('0xd4')]())){throw new Error('Invalid\x20channel');}_0x26d8ae=[_0x4892d5[_0x8dd9('0x21')]['channel'][_0x8dd9('0xd4')]()];}if(_0x4892d5[_0x8dd9('0x21')]['range']){try{var _0x18b757=JSON[_0x8dd9('0xb9')](_0x4892d5['query'][_0x8dd9('0xd5')]);if(!moment(_0x18b757['from'])[_0x8dd9('0xd6')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x18b757['to'])[_0x8dd9('0xd6')]()){throw new Error(_0x8dd9('0xd7'));}}catch(_0x27557a){throw new Error(_0x8dd9('0xd8'));}}if(!_0x4892d5[_0x8dd9('0x21')]['hasOwnProperty']('nolimit')){_0x1b86b8[_0x8dd9('0x16')]=qs['limit'](_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0x16')]||0xa);_0x1b86b8[_0x8dd9('0x14')]=qs['offset'](_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0x14')]);}var _0x401b75=_0x26d8ae[_0x8dd9('0x6e')](function(_0x156d47){if(_0x156d47==='voice'){var _0x35d952={'attributes':['id',_0x8dd9('0xd9'),_0x8dd9('0x33'),_0x8dd9('0xda'),_0x8dd9('0xdb'),_0x8dd9('0xdc'),_0x8dd9('0xdd'),_0x8dd9('0xde'),_0x8dd9('0xdf'),_0x8dd9('0xe0'),_0x8dd9('0xe1'),_0x8dd9('0xe2'),_0x8dd9('0xe3'),_0x8dd9('0xe4'),'UserId'],'where':{'ContactId':_0x4892d5[_0x8dd9('0x26')]['id']},'include':[{'model':db[_0x8dd9('0xbb')],'as':_0x8dd9('0xbb'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0xe5'),'alias']}],'order':[[_0x8dd9('0xe1'),_0x8dd9('0xe6')]]};if(_0x4892d5['query'][_0x8dd9('0xd5')]){_0x35d952[_0x8dd9('0x5c')][_0x8dd9('0xe1')]={'$gte':_0x18b757[_0x8dd9('0x3e')],'$lte':_0x18b757['to']};}return db['VoiceCallReport'][_0x8dd9('0xe7')](_0x35d952)[_0x8dd9('0x23')](function(_0x1a7e94){_0x1289df[_0x8dd9('0x17')]+=_0x1a7e94[_0x8dd9('0x17')];return _[_0x8dd9('0x6e')](_0x1a7e94[_0x8dd9('0xa0')],function(_0x29d7ba){var _0x288f5c=_0x29d7ba[_0x8dd9('0x3a')]({'plain':!![]});_0x288f5c[_0x8dd9('0xd3')]=_0x156d47;if(_0x288f5c[_0x8dd9('0xbb')]){_0x288f5c[_0x8dd9('0xbb')]={'id':_0x288f5c[_0x8dd9('0xbb')]['id'],'name':_0x288f5c['User'][_0x8dd9('0x1d')],'fullname':_0x288f5c['User'][_0x8dd9('0xe5')],'alias':_0x288f5c['User']['alias']};}return _0x288f5c;});});}else{var _0x367e1a=_[_0x8dd9('0xe8')](_0x156d47)+(_0x156d47==='chat'?_0x8dd9('0xe9'):_0x8dd9('0xea'));var _0x552339={'attributes':['id','closed',_0x8dd9('0xeb'),_0x8dd9('0xe1'),_0x8dd9('0xe0'),_0x8dd9('0xec'),_0x8dd9('0xed'),'thirdDisposition',_0x8dd9('0xee'),_0x367e1a+'Id'],'where':{'ContactId':_0x4892d5[_0x8dd9('0x26')]['id']},'include':[{'model':db[_0x367e1a],'as':_0x8dd9('0xea'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0xef')]},{'model':db[_0x8dd9('0xbb')],'as':_0x8dd9('0xf0'),'attributes':['id','name',_0x8dd9('0xe5')]},{'model':db[_0x8dd9('0x62')],'as':_0x8dd9('0x63'),'attributes':['id',_0x8dd9('0x1d'),_0x8dd9('0x64')],'through':{'attributes':[]}}],'order':[['createdAt',_0x8dd9('0xe6')]]};if(_0x4892d5[_0x8dd9('0x21')][_0x8dd9('0xd5')]){_0x552339[_0x8dd9('0x5c')][_0x8dd9('0xe1')]={'$gte':_0x18b757['from'],'$lte':_0x18b757['to']};}switch(_0x156d47){case _0x8dd9('0xca'):_0x552339[_0x8dd9('0x7f')][_0x8dd9('0x5d')](_0x8dd9('0xf1'),_0x8dd9('0xf2'),'customerPort',_0x8dd9('0xf3'),_0x8dd9('0xf4'),_0x8dd9('0xf5'),_0x8dd9('0xf6'),_0x8dd9('0xf7'),_0x8dd9('0xf8'));break;case _0x8dd9('0xc9'):_0x552339['attributes'][_0x8dd9('0x5d')](_0x8dd9('0xf9'),_0x8dd9('0xfa'));break;case _0x8dd9('0xcc'):_0x552339[_0x8dd9('0x7f')]['push']('externalUrl',_0x8dd9('0xfb'));break;}return db[_['startCase'](_0x156d47)+_0x8dd9('0xfc')][_0x8dd9('0xe7')](_0x552339)[_0x8dd9('0x23')](function(_0x5ba8ea){_0x1289df[_0x8dd9('0x17')]+=_0x5ba8ea[_0x8dd9('0x17')];return _[_0x8dd9('0x6e')](_0x5ba8ea['rows'],function(_0x38a3cb){var _0x2f2c08=_0x38a3cb['get']({'plain':!![]});_0x2f2c08[_0x8dd9('0xd3')]=_0x156d47;if(_0x2f2c08[_0x8dd9('0xf0')]){_0x2f2c08[_0x8dd9('0xf0')]={'id':_0x2f2c08[_0x8dd9('0xf0')]['id'],'name':_0x2f2c08['Owner'][_0x8dd9('0x1d')],'fullname':_0x2f2c08[_0x8dd9('0xf0')][_0x8dd9('0xe5')]};}return _0x2f2c08;});});}});return Promise[_0x8dd9('0x8b')](_0x401b75);})['then'](function(_0x403d33){return _(_0x403d33)[_0x8dd9('0xfd')]()['sortBy']('createdAt')[_0x8dd9('0xfe')]()[_0x8dd9('0xff')]();})[_0x8dd9('0x23')](function(_0x5060a5){_0x1289df[_0x8dd9('0xa0')]=_0x1b86b8[_0x8dd9('0x16')]?_0x5060a5[_0x8dd9('0x100')](_0x1b86b8[_0x8dd9('0x14')],_0x1b86b8[_0x8dd9('0x14')]+_0x1b86b8['limit']):_0x5060a5;return _0x1289df;})[_0x8dd9('0x23')](respondWithFilteredResult(_0x251866,_0x1b86b8))[_0x8dd9('0x27')](handleError(_0x251866,null));}; \ No newline at end of file +var _0xc1a5=['osName','ratingMessage','ratingType','subject','substatus','Interaction','flatten','reverse','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','api','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','json','then','end','error','name','send','index','describe','getOptions','findAll','user','destroy','CmContact','params','catch','tags','keys','length','startsWith','cf_','displayName','query','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','columnName','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','bulkCreate','duplicates','where','ListId','findOrCreate','spread','hasOwnProperty','additionalPhones','contact','show','find','Tag','Tags','tag','ContactItemType','sequelize','literal','Phones.OrderBy','CmCustomField','map','push','omit','pickBy','format','table','setFields','toParam','text','phone','CmHopper','getTags','findOne','rawAttributes','filters','intersection','model','attributes','fields','sort','pick','filter','options','nolimit','setTags','ids','setAdditionalPhones','all','items','item_types','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','ItemType.OrderBy','fromContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','include','rows','getHopperHistories','includeAll','getHopperFinals','CmHopperFinal','order','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','chmodSync','0777','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','parse','import','agent','No\x20ListId\x20specified','binding','No\x20phone\x20column\x20specified','child_process','fork','../../components/import/cm/csv2','stringify','message','exit','importUpdates','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','chat','fax','voice','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','source','destination','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','User','fullname','DESC','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','Owner','color','customerIp','customerPort'];(function(_0x20908d,_0x527263){var _0x34a94c=function(_0x5a36ba){while(--_0x5a36ba){_0x20908d['push'](_0x20908d['shift']());}};_0x34a94c(++_0x527263);}(_0xc1a5,0xfa));var _0x5c1a=function(_0x4ab4fc,_0xa2c112){_0x4ab4fc=_0x4ab4fc-0x0;var _0x385734=_0xc1a5[_0x4ab4fc];return _0x385734;};'use strict';var moment=require(_0x5c1a('0x0'));var BPromise=require(_0x5c1a('0x1'));var util=require(_0x5c1a('0x2'));var path=require(_0x5c1a('0x3'));var fs=require('fs');var _=require(_0x5c1a('0x4'));var squel=require(_0x5c1a('0x5'));var Papa=require(_0x5c1a('0x6'));var Redis=require(_0x5c1a('0x7'));var contacts=require(_0x5c1a('0x8'));var qs=require(_0x5c1a('0x9'));var logger=require('../../config/logger')(_0x5c1a('0xa'));var config=require('../../config/environment');var shared=require(_0x5c1a('0xb'));var db=require(_0x5c1a('0xc'))['db'];config['redis']=_['defaults'](config[_0x5c1a('0xd')],{'host':_0x5c1a('0xe'),'port':0x18eb});var socket=require(_0x5c1a('0xf'))(new Redis(config[_0x5c1a('0xd')]));require(_0x5c1a('0x10'))[_0x5c1a('0x11')](socket);function respondWithResult(_0x15afe9,_0x2458e5){_0x2458e5=_0x2458e5||0xc8;return function(_0x40ebb3){if(_0x40ebb3){return _0x15afe9[_0x5c1a('0x12')](_0x2458e5)['json'](_0x40ebb3);}};}function respondWithFilteredResult(_0x3bbaa9,_0x5cea3b){return function(_0x5cd96c){if(_0x5cd96c){var _0xf372e0=typeof _0x5cea3b[_0x5c1a('0x13')]===_0x5c1a('0x14')&&typeof _0x5cea3b[_0x5c1a('0x15')]===_0x5c1a('0x14');var _0x2fd8b5=_0x5cd96c['count'];var _0x4ceb7d=_0xf372e0?0x0:_0x5cea3b[_0x5c1a('0x13')];var _0x28a0b6=_0xf372e0?_0x5cd96c[_0x5c1a('0x16')]:_0x5cea3b[_0x5c1a('0x13')]+_0x5cea3b[_0x5c1a('0x15')];var _0x373036;if(_0x28a0b6>=_0x2fd8b5){_0x28a0b6=_0x2fd8b5;_0x373036=0xc8;}else{_0x373036=0xce;}_0x3bbaa9[_0x5c1a('0x12')](_0x373036);return _0x3bbaa9['set'](_0x5c1a('0x17'),_0x4ceb7d+'-'+_0x28a0b6+'/'+_0x2fd8b5)[_0x5c1a('0x18')](_0x5cd96c);}return null;};}function saveUpdates(_0x3f5b34){return function(_0x4f5d86){if(_0x4f5d86){return _0x4f5d86['update'](_0x3f5b34)[_0x5c1a('0x19')](function(_0x5e5c25){return _0x5e5c25;});}return null;};}function removeEntity(_0x3059c1){return function(_0x4b9ff5){if(_0x4b9ff5){return _0x4b9ff5['destroy']()[_0x5c1a('0x19')](function(){_0x3059c1['status'](0xcc)[_0x5c1a('0x1a')]();});}};}function handleEntityNotFound(_0x17b08e){return function(_0x43efd3){if(!_0x43efd3){_0x17b08e['sendStatus'](0x194);}return _0x43efd3;};}function handleError(_0x4f8617,_0x3893bb){_0x3893bb=_0x3893bb||0x1f4;return function(_0x5ebcf4){logger[_0x5c1a('0x1b')](_0x5ebcf4['stack']);if(_0x5ebcf4[_0x5c1a('0x1c')]){delete _0x5ebcf4['name'];}_0x4f8617[_0x5c1a('0x12')](_0x3893bb)[_0x5c1a('0x1d')](_0x5ebcf4);};}exports[_0x5c1a('0x1e')]=function(_0x35c577,_0x17b309){var _0x29cfc8={};return contacts[_0x5c1a('0x1f')]()['then'](function(_0x401413){_0x29cfc8=qs[_0x5c1a('0x20')](_0x401413,_0x35c577);return contacts[_0x5c1a('0x21')](_0x35c577['query'],_0x35c577[_0x5c1a('0x22')],_0x29cfc8,_0x401413);})[_0x5c1a('0x19')](respondWithFilteredResult(_0x17b309,_0x29cfc8))['catch'](handleError(_0x17b309,null));};exports[_0x5c1a('0x23')]=function(_0x56ae6b,_0x587d0e){return db[_0x5c1a('0x24')]['find']({'where':{'id':_0x56ae6b[_0x5c1a('0x25')]['id']}})['then'](handleEntityNotFound(_0x587d0e,null))[_0x5c1a('0x19')](removeEntity(_0x587d0e,null))[_0x5c1a('0x26')](handleError(_0x587d0e,null));};exports[_0x5c1a('0x1f')]=function(_0x288acc,_0x2976c0){return db['CmContact'][_0x5c1a('0x1f')]()[_0x5c1a('0x19')](function(_0x577d6a){delete _0x577d6a[_0x5c1a('0x27')];for(var _0x25ae0b=0x0;_0x25ae0b0x0){return new Promise(function(_0x7d75c1){var _0x5fa85e=[];for(var _0x36b7c8=0x0;_0x36b7c8<_0x46fd78[_0x5c1a('0x29')];_0x36b7c8++){_0x5fa85e['push'](insertAdditionalPhones(_0x46fd78[_0x36b7c8][_0x5c1a('0x60')],_0x46fd78[_0x36b7c8][_0x5c1a('0x5f')]));}Promise['all'](_0x5fa85e)[_0x5c1a('0x19')](function(){_0x7d75c1(0x1);});})[_0x5c1a('0x19')](function(){return{'success':_0x404e58,'failure':_0x419b9f,'duplicates':_0x4e06d0};});}else{return{'success':_0x404e58,'failure':_0x419b9f,'duplicates':_0x4e06d0};}}})[_0x5c1a('0x19')](respondWithResult(_0x58d3ee,0xc9))[_0x5c1a('0x26')](handleError(_0x58d3ee,null));};exports[_0x5c1a('0x61')]=function(_0x331b8e,_0x1897fe){var _0xe8daab;return db[_0x5c1a('0x24')]['describe']()[_0x5c1a('0x19')](function(_0x5f43b8){return db[_0x5c1a('0x24')][_0x5c1a('0x62')]({'where':{'id':_0x331b8e[_0x5c1a('0x25')]['id']},'include':[{'model':db[_0x5c1a('0x63')],'as':_0x5c1a('0x64'),'attributes':['id',_0x5c1a('0x1c'),'color'],'required':_0x331b8e[_0x5c1a('0x2d')][_0x5c1a('0x65')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x331b8e[_0x5c1a('0x25')]['id']},'required':![],'include':[{'model':db[_0x5c1a('0x66')],'as':'ItemType'}]}],'order':[db[_0x5c1a('0x67')][_0x5c1a('0x68')](_0x5c1a('0x69'))],'attributes':_['keys'](_0x5f43b8)});})[_0x5c1a('0x19')](function(_0x570e81){if(!_[_0x5c1a('0x54')](_0x570e81)){_0xe8daab=_0x570e81[_0x5c1a('0x39')]({'plain':!![]});var _0x19c3c5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x570e81&&_0x570e81['ListId']){if(_0x570e81[_0x5c1a('0x5b')]){_0x19c3c5['where']['$and']['push']({'ListId':{'$ne':_0x570e81[_0x5c1a('0x5b')]}});}}return db[_0x5c1a('0x6a')][_0x5c1a('0x21')](_0x19c3c5);}})['then'](function(_0x37d469){if(!_[_0x5c1a('0x54')](_0x37d469)){return _['omit'](_0xe8daab,_[_0x5c1a('0x6b')](_0x37d469,function(_0x471acb){return util['format']('cf_%d',_0x471acb['id']);}));}})[_0x5c1a('0x19')](handleEntityNotFound(_0x1897fe,null))[_0x5c1a('0x19')](respondWithResult(_0x1897fe,null))[_0x5c1a('0x26')](handleError(_0x1897fe,null));};exports[_0x5c1a('0x41')]=function(_0x53969a,_0x58522a){var _0x2e625e;if(_0x53969a[_0x5c1a('0x37')]['id']){delete _0x53969a['body']['id'];}if(!_[_0x5c1a('0x54')](_0x53969a[_0x5c1a('0x37')]['dialTimezone'])){var _0x3d4d61=_0x53969a[_0x5c1a('0x37')][_0x5c1a('0x55')];if(!_['isNil'](shared[_0x5c1a('0x56')][_0x3d4d61]))_0x53969a[_0x5c1a('0x37')]['utcOffset']=shared[_0x5c1a('0x56')][_0x3d4d61]['utcOffset'];}return db[_0x5c1a('0x24')][_0x5c1a('0x62')]({'where':{'id':_0x53969a[_0x5c1a('0x25')]['id']}})[_0x5c1a('0x19')](handleEntityNotFound(_0x58522a,null))[_0x5c1a('0x19')](saveUpdates(_0x53969a[_0x5c1a('0x37')],null))['then'](function(_0x33fa54){_0x2e625e=_0x33fa54;var _0x90f69e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x33fa54&&_0x33fa54[_0x5c1a('0x5b')]){if(_0x33fa54[_0x5c1a('0x5b')]){_0x90f69e[_0x5c1a('0x5a')]['$and'][_0x5c1a('0x6c')]({'ListId':{'$ne':_0x33fa54[_0x5c1a('0x5b')]}});}}return db[_0x5c1a('0x6a')]['findAll'](_0x90f69e);})[_0x5c1a('0x19')](function(_0x320da8){if(_0x320da8){return _[_0x5c1a('0x6d')](_[_0x5c1a('0x6e')](_0x53969a[_0x5c1a('0x37')],function(_0x1fd7a3,_0x137b96){return _[_0x5c1a('0x2a')](_0x137b96,_0x5c1a('0x2b'));}),_[_0x5c1a('0x6b')](_0x320da8,function(_0x2b9646){return util[_0x5c1a('0x6f')]('cf_%d',_0x2b9646['id']);}));}})[_0x5c1a('0x19')](function(_0x1ffbc1){if(_0x1ffbc1&&!_['isEmpty'](_0x1ffbc1)){var _0x5b3cd4=squel[_0x5c1a('0x41')]()[_0x5c1a('0x70')]('cm_contacts')[_0x5c1a('0x71')](_0x1ffbc1)[_0x5c1a('0x5a')]('id\x20=\x20?',_0x53969a['params']['id'])[_0x5c1a('0x72')]();return db[_0x5c1a('0x67')][_0x5c1a('0x2d')](_0x5b3cd4[_0x5c1a('0x73')],{'replacements':_0x5b3cd4['values']});}})[_0x5c1a('0x19')](function(){if(_0x53969a[_0x5c1a('0x37')][_0x5c1a('0x74')]&&_0x2e625e){return db[_0x5c1a('0x75')][_0x5c1a('0x41')]({'phone':_0x53969a[_0x5c1a('0x37')][_0x5c1a('0x74')],'OrderBy':0x0},{'where':{'ContactId':_0x2e625e['id']}});}})[_0x5c1a('0x19')](function(){return _0x2e625e;})[_0x5c1a('0x19')](respondWithResult(_0x58522a,null))[_0x5c1a('0x26')](handleError(_0x58522a,null));};exports[_0x5c1a('0x76')]=function(_0x22c550,_0x52b8ba){var _0x2296a1={};var _0x1a614d={};var _0x2e97f6;var _0x5c08f0;return db[_0x5c1a('0x24')][_0x5c1a('0x77')]({'where':{'id':_0x22c550[_0x5c1a('0x25')]['id']}})[_0x5c1a('0x19')](handleEntityNotFound(_0x52b8ba,null))[_0x5c1a('0x19')](function(_0x1efc78){if(_0x1efc78){_0x2e97f6=_0x1efc78;_0x1a614d['model']=_[_0x5c1a('0x28')](db[_0x5c1a('0x63')][_0x5c1a('0x78')]);_0x1a614d[_0x5c1a('0x2d')]=_['keys'](_0x22c550[_0x5c1a('0x2d')]);_0x1a614d[_0x5c1a('0x79')]=_[_0x5c1a('0x7a')](_0x1a614d[_0x5c1a('0x7b')],_0x1a614d[_0x5c1a('0x2d')]);_0x2296a1[_0x5c1a('0x7c')]=_[_0x5c1a('0x7a')](_0x1a614d[_0x5c1a('0x7b')],qs[_0x5c1a('0x7d')](_0x22c550['query'][_0x5c1a('0x7d')]));_0x2296a1[_0x5c1a('0x7c')]=_0x2296a1['attributes'][_0x5c1a('0x29')]?_0x2296a1['attributes']:_0x1a614d[_0x5c1a('0x7b')];_0x2296a1['order']=qs[_0x5c1a('0x7e')](_0x22c550['query'][_0x5c1a('0x7e')]);_0x2296a1[_0x5c1a('0x5a')]=qs[_0x5c1a('0x79')](_[_0x5c1a('0x7f')](_0x22c550[_0x5c1a('0x2d')],_0x1a614d[_0x5c1a('0x79')]));if(_0x22c550[_0x5c1a('0x2d')]['filter']){_0x2296a1[_0x5c1a('0x5a')]=_[_0x5c1a('0x36')](_0x2296a1[_0x5c1a('0x5a')],{'$or':_[_0x5c1a('0x6b')](_0x2296a1[_0x5c1a('0x7c')],function(_0x2fdf73){var _0x96f396={};_0x96f396[_0x2fdf73]={'$like':'%'+_0x22c550[_0x5c1a('0x2d')][_0x5c1a('0x80')]+'%'};return _0x96f396;})});}_0x2296a1=_[_0x5c1a('0x36')]({},_0x2296a1,_0x22c550[_0x5c1a('0x81')]);return _0x2e97f6[_0x5c1a('0x76')](_0x2296a1);}})[_0x5c1a('0x19')](function(_0x3eb9a8){if(_0x3eb9a8){_0x5c08f0=_0x3eb9a8[_0x5c1a('0x29')];if(!_0x22c550[_0x5c1a('0x2d')][_0x5c1a('0x5e')](_0x5c1a('0x82'))){_0x2296a1['limit']=qs['limit'](_0x22c550[_0x5c1a('0x2d')]['limit']);_0x2296a1['offset']=qs['offset'](_0x22c550[_0x5c1a('0x2d')][_0x5c1a('0x13')]);}return _0x2e97f6[_0x5c1a('0x76')](_0x2296a1);}})['then'](function(_0x197f98){if(_0x197f98){return _0x197f98?{'count':_0x5c08f0,'rows':_0x197f98}:null;}})[_0x5c1a('0x19')](respondWithResult(_0x52b8ba,null))[_0x5c1a('0x26')](handleError(_0x52b8ba,null));};exports[_0x5c1a('0x83')]=function(_0x4d58da,_0x1a3a55){if(_0x4d58da[_0x5c1a('0x37')]['id']){delete _0x4d58da[_0x5c1a('0x37')]['id'];}return db[_0x5c1a('0x24')][_0x5c1a('0x77')]({'where':{'id':_0x4d58da[_0x5c1a('0x25')]['id']}})[_0x5c1a('0x19')](handleEntityNotFound(_0x1a3a55,null))[_0x5c1a('0x19')](function(_0x1a3ca3){if(_0x1a3ca3){return _0x1a3ca3[_0x5c1a('0x83')](_0x4d58da[_0x5c1a('0x37')][_0x5c1a('0x84')]||[]);}return null;})[_0x5c1a('0x19')](respondWithResult(_0x1a3a55,null))[_0x5c1a('0x26')](handleError(_0x1a3a55,null));};exports[_0x5c1a('0x85')]=function(_0x66eec4,_0x5064df){var _0x1f1151=[];_0x1f1151[_0x5c1a('0x6c')](addAdditionalPhones(_0x66eec4['body']));Promise[_0x5c1a('0x86')](_0x1f1151)[_0x5c1a('0x19')](function(){_0x1f1151=[];_0x1f1151[_0x5c1a('0x6c')](deleteCmHopperPhones(_0x66eec4[_0x5c1a('0x37')]['id']));_0x1f1151[_0x5c1a('0x6c')](addCmHopperPhones(_0x66eec4[_0x5c1a('0x37')]['id']));Promise['all'](_0x1f1151)[_0x5c1a('0x19')](function(){return[0x1];})['then'](respondWithResult(_0x5064df,null));});};function addAdditionalPhones(_0x41e58f){var _0x47a77f;return new Promise(function(_0x4e259f){return db['CmContactHasItem'][_0x5c1a('0x23')]({'where':{'CmContactId':_0x41e58f['id']}})[_0x5c1a('0x19')](function(){db['ContactItemType']['findAll']({'raw':!![],'attributes':['id','OrderBy']})[_0x5c1a('0x19')](function(_0x4e0c42){var _0xd6257f=[];for(var _0x288bf6=0x0;_0x288bf6<_0x41e58f[_0x5c1a('0x87')][_0x5c1a('0x29')];_0x288bf6++){var _0x1b2eaf=_0x41e58f[_0x5c1a('0x88')]?_[_0x5c1a('0x54')](_0x41e58f[_0x5c1a('0x88')][_0x288bf6])?'':_0x41e58f[_0x5c1a('0x88')][_0x288bf6]:_0x41e58f['items'][_0x288bf6][_0x5c1a('0x89')]?_0x41e58f[_0x5c1a('0x87')][_0x288bf6]['ItemTypeId']:'';var _0x52e869=_[_0x5c1a('0x54')](_0x41e58f['items'][_0x288bf6][_0x5c1a('0x8a')])?'':_0x41e58f[_0x5c1a('0x87')][_0x288bf6]['description'];var _0x15eba7=_0x1b2eaf+':'+_0x41e58f[_0x5c1a('0x87')][_0x288bf6][_0x5c1a('0x74')]+'§'+_0x52e869;if(_['isNil'](_0x47a77f))_0x47a77f=_0x15eba7;else _0x47a77f+=';'+_0x15eba7;var _0x87dc4f=null;var _0x4d8bf2=null;if(_0x41e58f[_0x5c1a('0x88')]){if(!_[_0x5c1a('0x54')](_0x41e58f[_0x5c1a('0x88')][_0x288bf6])){_0x4d8bf2=_['find'](_0x4e0c42,function(_0x3b6a2d){return _0x3b6a2d['id']===_0x41e58f['item_types'][_0x288bf6];});if(!_[_0x5c1a('0x54')](_0x4d8bf2)){_0x87dc4f=_0x4d8bf2[_0x5c1a('0x8b')];}}}else{if(!_[_0x5c1a('0x54')](_0x41e58f['items'][_0x288bf6])){_0x4d8bf2=_[_0x5c1a('0x62')](_0x4e0c42,function(_0x1c870e){return _0x1c870e['id']===_0x41e58f[_0x5c1a('0x87')][_0x288bf6]['ItemTypeId'];});if(!_[_0x5c1a('0x54')](_0x4d8bf2)){_0x87dc4f=_0x288bf6;}}}if(_[_0x5c1a('0x54')](_0x87dc4f)){_0x87dc4f=0x64;}_0xd6257f[_0x5c1a('0x6c')](addAdditionalPhone(_0x41e58f['id'],_0x41e58f[_0x5c1a('0x87')][_0x288bf6][_0x5c1a('0x74')],_0x41e58f['item_types']?_['isNil'](_0x41e58f[_0x5c1a('0x88')][_0x288bf6])?null:_0x41e58f[_0x5c1a('0x88')][_0x288bf6]:_0x41e58f[_0x5c1a('0x87')][_0x288bf6][_0x5c1a('0x89')]?_0x41e58f[_0x5c1a('0x87')][_0x288bf6]['ItemTypeId']:null,_0x87dc4f,_0x52e869));}Promise[_0x5c1a('0x86')](_0xd6257f)[_0x5c1a('0x19')](function(){db['CmContact'][_0x5c1a('0x41')]({'AdditionalPhones':_0x47a77f},{'where':{'id':_0x41e58f['id']}})[_0x5c1a('0x19')](function(){_0x4e259f(0x1);});});});});});}function addAdditionalPhone(_0x3714ba,_0x5d5942,_0x3e72e8,_0x463869,_0x52ea06){return db[_0x5c1a('0x4a')][_0x5c1a('0x62')]({'where':{'CmContactId':_0x3714ba,'item':_0x5d5942}})[_0x5c1a('0x19')](function(_0x51f1e3){if(_0x51f1e3)logger[_0x5c1a('0x32')](_0x5c1a('0x8c'),_0x51f1e3);else{db[_0x5c1a('0x4a')]['create']({'CmContactId':_0x3714ba,'item':_0x5d5942,'ItemTypeId':_0x3e72e8,'OrderBy':_0x463869,'ItemClass':_0x5c1a('0x8d'),'description':_0x52ea06});}});}function deleteCmHopperPhones(_0x20cb0f){return new Promise(function(_0x131049){return db['CmHopper'][_0x5c1a('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x20cb0f}})[_0x5c1a('0x19')](function(_0x5a3eae){db[_0x5c1a('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x5c1a('0x6b')](_0x5a3eae,'id')}}});})[_0x5c1a('0x19')](function(){_0x131049(0x1);});});}function addCmHopperPhones(_0xdd24e){return new Promise(function(_0x140c9d){return db[_0x5c1a('0x75')][_0x5c1a('0x21')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xdd24e}})['then'](function(_0xb33643){var _0x1e9f1f=[];_[_0x5c1a('0x6b')](_0xb33643,function(_0x1966b4){_0x1e9f1f[_0x5c1a('0x6c')](createCmHopperPhone(_0xdd24e,_0x1966b4['id']));});Promise[_0x5c1a('0x86')](_0x1e9f1f)['then'](function(){_0x140c9d(0x1);});});});}function createCmHopperPhone(_0x3e1e05,_0x464fdf){return new Promise(function(_0x2ac130){db[_0x5c1a('0x4a')][_0x5c1a('0x21')]({'raw':!![],'attributes':[_0x5c1a('0x8f'),_0x5c1a('0x8b')],'where':{'CmContactId':_0x3e1e05,'ItemClass':_0x5c1a('0x8d')},'include':[{'model':db[_0x5c1a('0x66')],'attributes':[_0x5c1a('0x8b')],'as':_0x5c1a('0x90')}],'order':[_0x5c1a('0x8b'),db[_0x5c1a('0x67')][_0x5c1a('0x68')](_0x5c1a('0x91'))]})['then'](function(_0x4986ad){var _0x1a0b5f=0x1;var _0x15e789=_[_0x5c1a('0x6b')](_0x4986ad,function(_0x4de423){_0x4de423['CmHopperId']=_0x464fdf;_0x4de423[_0x5c1a('0x74')]=_0x4de423[_0x5c1a('0x8f')];_0x4de423['OrderBy']=_0x1a0b5f;delete _0x4de423[_0x5c1a('0x92')];_0x1a0b5f=_0x1a0b5f+0x1;return _0x4de423;});return db[_0x5c1a('0x8e')][_0x5c1a('0x58')](_0x15e789,{});})[_0x5c1a('0x19')](function(){_0x2ac130(0x1);});});}function insertAdditionalPhones(_0x4e6fa9,_0x4f8ad9){return new Promise(function(_0xc9c9a9){var _0x4f54ba=[];for(var _0x3ed55e=0x0;_0x3ed55e<_0x4f8ad9[_0x5c1a('0x29')];_0x3ed55e++){var _0x17bc8f=_0x4f8ad9[_0x3ed55e];_0x4f54ba[_0x5c1a('0x6c')](parseContactItemType(_0x17bc8f));}Promise[_0x5c1a('0x86')](_0x4f54ba)['then'](function(){var _0xc87769={'id':_0x4e6fa9['id'],'items':_0x4f8ad9};return addAdditionalPhones(_0xc87769)['then'](function(){return addCmHopperPhones(_0x4e6fa9['id']);});})[_0x5c1a('0x19')](function(){_0xc9c9a9(_0x4e6fa9);});});}function parseContactItemType(_0x206d71){return new Promise(function(_0x46eeb8){if(_0x206d71[_0x5c1a('0x5e')](_0x5c1a('0x89'))){_0x46eeb8(_0x206d71);}else{return db['ContactItemType'][_0x5c1a('0x62')]({'where':{'name':_0x206d71[_0x5c1a('0x90')]}})[_0x5c1a('0x19')](function(_0x3db565){if(_[_0x5c1a('0x54')](_0x3db565))_0x206d71[_0x5c1a('0x89')]=null;else _0x206d71[_0x5c1a('0x89')]=_0x3db565['id'];_0x46eeb8(_0x206d71);});}});}exports['getAdditionalPhones']=function(_0x3f5dd0,_0x2f8b3b){return db[_0x5c1a('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3f5dd0[_0x5c1a('0x25')]['id'],'ItemClass':_0x5c1a('0x8d')},'include':[{'model':db[_0x5c1a('0x66')],'as':_0x5c1a('0x90')}],'order':[[_0x5c1a('0x8b')],[db[_0x5c1a('0x67')][_0x5c1a('0x68')](_0x5c1a('0x91'))]]})[_0x5c1a('0x19')](function(_0x53ddcf){return _0x53ddcf;})[_0x5c1a('0x19')](respondWithResult(_0x2f8b3b,null))['catch'](handleError(_0x2f8b3b,null));};exports['duplicateAdditionalPhones']=function(_0x1f8872,_0x27cebf){return db[_0x5c1a('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x1f8872[_0x5c1a('0x37')][_0x5c1a('0x93')]}})[_0x5c1a('0x19')](function(_0x3d268a){var _0x53f40b=_[_0x5c1a('0x6b')](_0x3d268a,function(_0x37a270){_0x37a270['CmContactId']=_0x1f8872['body']['toContactId'];return _0x37a270;});return db[_0x5c1a('0x4a')][_0x5c1a('0x58')](_0x53f40b,{});})[_0x5c1a('0x19')](function(){return addCmHopperPhones(_0x1f8872[_0x5c1a('0x37')]['toContactId']);})[_0x5c1a('0x19')](function(){return['ok'];})[_0x5c1a('0x19')](respondWithResult(_0x27cebf,null))[_0x5c1a('0x26')](handleError(_0x27cebf,null));};exports[_0x5c1a('0x94')]=function(_0x373bf4,_0x59723e){var _0x28db14=[];_0x28db14['push'](createCmHopperPhone(_0x373bf4[_0x5c1a('0x37')]['id'],_0x373bf4[_0x5c1a('0x37')][_0x5c1a('0x95')]));Promise['all'](_0x28db14)['then'](function(){return[0x1];})[_0x5c1a('0x19')](respondWithResult(_0x59723e,null));};exports[_0x5c1a('0x96')]=function(_0x1cbb0f,_0xdeefc8){var _0x5cb085={'raw':![],'where':{}};var _0x37013f={};var _0x8c7229={'count':0x0,'rows':[]};return db[_0x5c1a('0x24')][_0x5c1a('0x77')]({'where':{'id':_0x1cbb0f[_0x5c1a('0x25')]['id']}})[_0x5c1a('0x19')](handleEntityNotFound(_0xdeefc8,null))[_0x5c1a('0x19')](function(_0x5aa92b){if(_0x5aa92b){_0x37013f[_0x5c1a('0x7b')]=_[_0x5c1a('0x28')](db[_0x5c1a('0x75')][_0x5c1a('0x78')]);_0x37013f[_0x5c1a('0x2d')]=_[_0x5c1a('0x28')](_0x1cbb0f[_0x5c1a('0x2d')]);_0x37013f[_0x5c1a('0x79')]=_[_0x5c1a('0x7a')](_0x37013f[_0x5c1a('0x7b')],_0x37013f['query']);_0x5cb085['attributes']=_['intersection'](_0x37013f['model'],qs[_0x5c1a('0x7d')](_0x1cbb0f[_0x5c1a('0x2d')][_0x5c1a('0x7d')]));_0x5cb085[_0x5c1a('0x7c')]=_0x5cb085[_0x5c1a('0x7c')][_0x5c1a('0x29')]?_0x5cb085[_0x5c1a('0x7c')]:_0x37013f[_0x5c1a('0x7b')];if(!_0x1cbb0f[_0x5c1a('0x2d')][_0x5c1a('0x5e')](_0x5c1a('0x82'))){_0x5cb085['limit']=qs['limit'](_0x1cbb0f[_0x5c1a('0x2d')][_0x5c1a('0x15')]);_0x5cb085['offset']=qs[_0x5c1a('0x13')](_0x1cbb0f['query']['offset']);}_0x5cb085['order']=qs[_0x5c1a('0x7e')](_0x1cbb0f[_0x5c1a('0x2d')][_0x5c1a('0x7e')]);_0x5cb085[_0x5c1a('0x5a')]=qs[_0x5c1a('0x79')](_['pick'](_0x1cbb0f[_0x5c1a('0x2d')],_0x37013f[_0x5c1a('0x79')]));_0x5cb085[_0x5c1a('0x5a')][_0x5c1a('0x97')]=_0x5aa92b['id'];if(_0x1cbb0f[_0x5c1a('0x2d')]['filter']){_0x5cb085[_0x5c1a('0x5a')]=_[_0x5c1a('0x36')](_0x5cb085['where'],{'$or':_['map'](_0x5cb085['attributes'],function(_0x3dd198){var _0x5e6e36={};_0x5e6e36[_0x3dd198]={'$like':'%'+_0x1cbb0f[_0x5c1a('0x2d')][_0x5c1a('0x80')]+'%'};return _0x5e6e36;})});}_0x5cb085=_[_0x5c1a('0x36')]({},_0x5cb085,_0x1cbb0f['options']);return db[_0x5c1a('0x75')][_0x5c1a('0x16')]({'where':_0x5cb085[_0x5c1a('0x5a')]})['then'](function(_0x2d5900){_0x8c7229[_0x5c1a('0x16')]=_0x2d5900;if(_0x1cbb0f[_0x5c1a('0x2d')]['includeAll']){_0x5cb085[_0x5c1a('0x98')]=[{'all':!![]}];}return db[_0x5c1a('0x75')][_0x5c1a('0x21')](_0x5cb085);})[_0x5c1a('0x19')](function(_0x5a21a7){_0x8c7229[_0x5c1a('0x99')]=_0x5a21a7;return _0x8c7229;});}})[_0x5c1a('0x19')](respondWithFilteredResult(_0xdeefc8,_0x5cb085))[_0x5c1a('0x26')](handleError(_0xdeefc8,null));};exports[_0x5c1a('0x9a')]=function(_0x6706d,_0x2a8ba5){var _0x15beb3={'raw':!![],'where':{}};var _0xf57c4e={};var _0x3bd3e9={'count':0x0,'rows':[]};return db[_0x5c1a('0x24')][_0x5c1a('0x77')]({'where':{'id':_0x6706d[_0x5c1a('0x25')]['id']}})[_0x5c1a('0x19')](handleEntityNotFound(_0x2a8ba5,null))[_0x5c1a('0x19')](function(_0x37c60c){if(_0x37c60c){_0xf57c4e[_0x5c1a('0x7b')]=_[_0x5c1a('0x28')](db[_0x5c1a('0x4b')][_0x5c1a('0x78')]);_0xf57c4e[_0x5c1a('0x2d')]=_[_0x5c1a('0x28')](_0x6706d[_0x5c1a('0x2d')]);_0xf57c4e[_0x5c1a('0x79')]=_[_0x5c1a('0x7a')](_0xf57c4e['model'],_0xf57c4e[_0x5c1a('0x2d')]);_0x15beb3[_0x5c1a('0x7c')]=_[_0x5c1a('0x7a')](_0xf57c4e[_0x5c1a('0x7b')],qs[_0x5c1a('0x7d')](_0x6706d[_0x5c1a('0x2d')]['fields']));_0x15beb3[_0x5c1a('0x7c')]=_0x15beb3['attributes']['length']?_0x15beb3[_0x5c1a('0x7c')]:_0xf57c4e['model'];if(!_0x6706d['query'][_0x5c1a('0x5e')](_0x5c1a('0x82'))){_0x15beb3['limit']=qs[_0x5c1a('0x15')](_0x6706d[_0x5c1a('0x2d')]['limit']);_0x15beb3['offset']=qs[_0x5c1a('0x13')](_0x6706d[_0x5c1a('0x2d')][_0x5c1a('0x13')]);}_0x15beb3['order']=qs[_0x5c1a('0x7e')](_0x6706d['query'][_0x5c1a('0x7e')]);_0x15beb3[_0x5c1a('0x5a')]=qs[_0x5c1a('0x79')](_[_0x5c1a('0x7f')](_0x6706d[_0x5c1a('0x2d')],_0xf57c4e[_0x5c1a('0x79')]));_0x15beb3[_0x5c1a('0x5a')][_0x5c1a('0x97')]=_0x37c60c['id'];if(_0x6706d['query']['filter']){_0x15beb3[_0x5c1a('0x5a')]=_[_0x5c1a('0x36')](_0x15beb3[_0x5c1a('0x5a')],{'$or':_[_0x5c1a('0x6b')](_0x15beb3[_0x5c1a('0x7c')],function(_0x393aa9){var _0x5176a2={};_0x5176a2[_0x393aa9]={'$like':'%'+_0x6706d[_0x5c1a('0x2d')]['filter']+'%'};return _0x5176a2;})});}_0x15beb3=_['merge']({},_0x15beb3,_0x6706d[_0x5c1a('0x81')]);return db['CmHopperHistory'][_0x5c1a('0x16')]({'where':_0x15beb3['where']})[_0x5c1a('0x19')](function(_0x4d4e66){_0x3bd3e9[_0x5c1a('0x16')]=_0x4d4e66;if(_0x6706d[_0x5c1a('0x2d')][_0x5c1a('0x9b')]){_0x15beb3[_0x5c1a('0x98')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5c1a('0x21')](_0x15beb3);})[_0x5c1a('0x19')](function(_0x300af6){_0x3bd3e9[_0x5c1a('0x99')]=_0x300af6;return _0x3bd3e9;});}})[_0x5c1a('0x19')](respondWithFilteredResult(_0x2a8ba5,_0x15beb3))[_0x5c1a('0x26')](handleError(_0x2a8ba5,null));};exports[_0x5c1a('0x9c')]=function(_0x1f4a86,_0x2acaa2){var _0x4aa8ad={'raw':!![],'where':{}};var _0x265627={};var _0x1dc4fa={'count':0x0,'rows':[]};return db[_0x5c1a('0x24')]['findOne']({'where':{'id':_0x1f4a86[_0x5c1a('0x25')]['id']}})[_0x5c1a('0x19')](handleEntityNotFound(_0x2acaa2,null))['then'](function(_0x3ad3d7){if(_0x3ad3d7){_0x265627[_0x5c1a('0x7b')]=_[_0x5c1a('0x28')](db[_0x5c1a('0x9d')][_0x5c1a('0x78')]);_0x265627[_0x5c1a('0x2d')]=_[_0x5c1a('0x28')](_0x1f4a86[_0x5c1a('0x2d')]);_0x265627[_0x5c1a('0x79')]=_[_0x5c1a('0x7a')](_0x265627['model'],_0x265627[_0x5c1a('0x2d')]);_0x4aa8ad['attributes']=_[_0x5c1a('0x7a')](_0x265627[_0x5c1a('0x7b')],qs[_0x5c1a('0x7d')](_0x1f4a86['query']['fields']));_0x4aa8ad[_0x5c1a('0x7c')]=_0x4aa8ad[_0x5c1a('0x7c')][_0x5c1a('0x29')]?_0x4aa8ad[_0x5c1a('0x7c')]:_0x265627['model'];if(!_0x1f4a86[_0x5c1a('0x2d')]['hasOwnProperty']('nolimit')){_0x4aa8ad[_0x5c1a('0x15')]=qs[_0x5c1a('0x15')](_0x1f4a86[_0x5c1a('0x2d')][_0x5c1a('0x15')]);_0x4aa8ad[_0x5c1a('0x13')]=qs['offset'](_0x1f4a86[_0x5c1a('0x2d')]['offset']);}_0x4aa8ad[_0x5c1a('0x9e')]=qs[_0x5c1a('0x7e')](_0x1f4a86['query'][_0x5c1a('0x7e')]);_0x4aa8ad[_0x5c1a('0x5a')]=qs['filters'](_['pick'](_0x1f4a86[_0x5c1a('0x2d')],_0x265627[_0x5c1a('0x79')]));_0x4aa8ad[_0x5c1a('0x5a')]['ContactId']=_0x3ad3d7['id'];if(_0x1f4a86[_0x5c1a('0x2d')][_0x5c1a('0x80')]){_0x4aa8ad[_0x5c1a('0x5a')]=_[_0x5c1a('0x36')](_0x4aa8ad[_0x5c1a('0x5a')],{'$or':_[_0x5c1a('0x6b')](_0x4aa8ad[_0x5c1a('0x7c')],function(_0xfd89d){var _0xada935={};_0xada935[_0xfd89d]={'$like':'%'+_0x1f4a86['query'][_0x5c1a('0x80')]+'%'};return _0xada935;})});}_0x4aa8ad=_[_0x5c1a('0x36')]({},_0x4aa8ad,_0x1f4a86[_0x5c1a('0x81')]);return db['CmHopperFinal']['count']({'where':_0x4aa8ad['where']})[_0x5c1a('0x19')](function(_0x238984){_0x1dc4fa[_0x5c1a('0x16')]=_0x238984;if(_0x1f4a86[_0x5c1a('0x2d')][_0x5c1a('0x9b')]){_0x4aa8ad[_0x5c1a('0x98')]=[{'all':!![]}];}return db[_0x5c1a('0x9d')]['findAll'](_0x4aa8ad);})['then'](function(_0x464ac9){_0x1dc4fa[_0x5c1a('0x99')]=_0x464ac9;return _0x1dc4fa;});}})[_0x5c1a('0x19')](respondWithFilteredResult(_0x2acaa2,_0x4aa8ad))[_0x5c1a('0x26')](handleError(_0x2acaa2,null));};exports['getJscriptySessions']=function(_0x4e4080,_0x10e6d6){var _0x5bfa45={'raw':!![],'where':{}};var _0x139718={};var _0x4a8343={'count':0x0,'rows':[]};return db[_0x5c1a('0x24')][_0x5c1a('0x77')]({'where':{'id':_0x4e4080[_0x5c1a('0x25')]['id']}})[_0x5c1a('0x19')](handleEntityNotFound(_0x10e6d6,null))[_0x5c1a('0x19')](function(_0x20c159){if(_0x20c159){_0x139718[_0x5c1a('0x7b')]=_[_0x5c1a('0x28')](db[_0x5c1a('0x50')]['rawAttributes']);_0x139718[_0x5c1a('0x2d')]=_[_0x5c1a('0x28')](_0x4e4080[_0x5c1a('0x2d')]);_0x139718[_0x5c1a('0x79')]=_['intersection'](_0x139718[_0x5c1a('0x7b')],_0x139718[_0x5c1a('0x2d')]);_0x5bfa45[_0x5c1a('0x7c')]=_[_0x5c1a('0x7a')](_0x139718['model'],qs[_0x5c1a('0x7d')](_0x4e4080[_0x5c1a('0x2d')][_0x5c1a('0x7d')]));_0x5bfa45[_0x5c1a('0x7c')]=_0x5bfa45[_0x5c1a('0x7c')][_0x5c1a('0x29')]?_0x5bfa45[_0x5c1a('0x7c')]:_0x139718[_0x5c1a('0x7b')];if(!_0x4e4080[_0x5c1a('0x2d')][_0x5c1a('0x5e')]('nolimit')){_0x5bfa45[_0x5c1a('0x15')]=qs[_0x5c1a('0x15')](_0x4e4080[_0x5c1a('0x2d')][_0x5c1a('0x15')]);_0x5bfa45[_0x5c1a('0x13')]=qs['offset'](_0x4e4080[_0x5c1a('0x2d')]['offset']);}_0x5bfa45[_0x5c1a('0x9e')]=qs[_0x5c1a('0x7e')](_0x4e4080[_0x5c1a('0x2d')][_0x5c1a('0x7e')]);_0x5bfa45[_0x5c1a('0x5a')]=qs[_0x5c1a('0x79')](_[_0x5c1a('0x7f')](_0x4e4080[_0x5c1a('0x2d')],_0x139718[_0x5c1a('0x79')]));_0x5bfa45[_0x5c1a('0x5a')][_0x5c1a('0x97')]=_0x20c159['id'];if(_0x4e4080[_0x5c1a('0x2d')][_0x5c1a('0x80')]){_0x5bfa45['where']=_[_0x5c1a('0x36')](_0x5bfa45[_0x5c1a('0x5a')],{'$or':_[_0x5c1a('0x6b')](_0x5bfa45[_0x5c1a('0x7c')],function(_0x25c81d){var _0x268275={};_0x268275[_0x25c81d]={'$like':'%'+_0x4e4080[_0x5c1a('0x2d')]['filter']+'%'};return _0x268275;})});}_0x5bfa45=_[_0x5c1a('0x36')]({},_0x5bfa45,_0x4e4080[_0x5c1a('0x81')]);return db[_0x5c1a('0x50')][_0x5c1a('0x16')]({'where':_0x5bfa45[_0x5c1a('0x5a')]})['then'](function(_0x13705d){_0x4a8343[_0x5c1a('0x16')]=_0x13705d;if(_0x4e4080[_0x5c1a('0x2d')][_0x5c1a('0x9b')]){_0x5bfa45[_0x5c1a('0x98')]=[{'all':!![]}];}return db[_0x5c1a('0x50')][_0x5c1a('0x21')](_0x5bfa45);})[_0x5c1a('0x19')](function(_0x594f06){_0x4a8343['rows']=_0x594f06;return _0x4a8343;});}})['then'](respondWithFilteredResult(_0x10e6d6,_0x5bfa45))[_0x5c1a('0x26')](handleError(_0x10e6d6,null));};exports['uploadCsv']=function(_0x24d785,_0x476300){try{if(!_0x24d785[_0x5c1a('0x37')][_0x5c1a('0x5b')]){throw new Error('No\x20ListId\x20specified');}if(!_0x24d785[_0x5c1a('0x37')]['binding_keys']){throw new Error(_0x5c1a('0x9f'));}if(!_0x24d785[_0x5c1a('0x37')]['binding_values']){throw new Error(_0x5c1a('0xa0'));}if(!_0x24d785['body'][_0x5c1a('0xa1')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3b59cf=_0x24d785[_0x5c1a('0x37')][_0x5c1a('0xa2')][_0x5c1a('0xa3')](',');var _0x157328=_0x24d785['body']['binding_values'][_0x5c1a('0xa3')](',');if(!_0x3b59cf[_0x5c1a('0x29')]||!_0x157328[_0x5c1a('0x29')]||_0x3b59cf[_0x5c1a('0x29')]!==_0x157328[_0x5c1a('0x29')]){throw new Error(_0x5c1a('0xa4'));}_0x24d785[_0x5c1a('0x37')][_0x5c1a('0x7d')]=_[_0x5c1a('0xa5')](_0x3b59cf,_0x157328);if(!_0x24d785[_0x5c1a('0x37')]['fields']['phone']){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x24d785[_0x5c1a('0x37')][_0x5c1a('0x7d')][_0x5c1a('0xa6')]){throw new Error(_0x5c1a('0xa7'));}var _0x39c826=path[_0x5c1a('0x3b')](config[_0x5c1a('0xa8')],_0x5c1a('0xa9'),_0x24d785[_0x5c1a('0xaa')]['filename']);fs[_0x5c1a('0xab')](_0x39c826,parseInt(_0x5c1a('0xac'),0x8));var _0x27eaf9=require('child_process')['fork'](path[_0x5c1a('0x3b')](__dirname,_0x5c1a('0xad')),[_0x39c826,_0x24d785[_0x5c1a('0x37')][_0x5c1a('0xa2')],_0x24d785[_0x5c1a('0x37')]['binding_values'],_0x24d785[_0x5c1a('0x37')][_0x5c1a('0x5b')],_0x24d785[_0x5c1a('0x37')][_0x5c1a('0xae')],_0x24d785[_0x5c1a('0x37')][_0x5c1a('0x59')],_0x24d785[_0x5c1a('0x37')][_0x5c1a('0xa1')]]);return _0x476300['status'](0xc8)[_0x5c1a('0x18')]({'message':_0x5c1a('0xaf'),'pid':_0x27eaf9[_0x5c1a('0xb0')]});}catch(_0x53c5a7){return _0x476300[_0x5c1a('0x12')](0x1f4)[_0x5c1a('0x1d')](_0x53c5a7);}};exports['upload']=function(_0x439a39,_0x4c8f92){var _0x2135ee=fs['createReadStream'](_0x439a39['file'][_0x5c1a('0x3')]);Papa[_0x5c1a('0xb1')](_0x2135ee,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3089ef){return _0x4c8f92[_0x5c1a('0x12')](0xc8)[_0x5c1a('0x18')]({'file':_0x439a39[_0x5c1a('0xaa')],'fields':_0x3089ef['meta'][_0x5c1a('0x7d')]});}});};exports[_0x5c1a('0xb2')]=function(_0x511b36,_0x424734){return db['User'][_0x5c1a('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5c1a('0xb3')}})[_0x5c1a('0x19')](function(_0xe83715){var _0x2534c4=![];if(!_0x511b36[_0x5c1a('0x37')]['ListId']){throw new Error(_0x5c1a('0xb4'));}if(!_0x511b36[_0x5c1a('0x37')][_0x5c1a('0xb5')][_0x5c1a('0x74')]){throw new Error(_0x5c1a('0xb6'));}if(!_0x511b36[_0x5c1a('0x37')]['binding'][_0x5c1a('0xa6')]){throw new Error(_0x5c1a('0xa7'));}if(!_0x511b36[_0x5c1a('0x37')][_0x5c1a('0xa1')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0xa789e6=require(_0x5c1a('0xb7'))[_0x5c1a('0xb8')](path['join'](__dirname,_0x5c1a('0xb9')),[_0x511b36[_0x5c1a('0x25')]['id'],JSON[_0x5c1a('0xba')](_0x511b36[_0x5c1a('0x37')]),JSON[_0x5c1a('0xba')](_0xe83715)]);_0xa789e6['on'](_0x5c1a('0xbb'),function(){_0x2534c4=!![];return _0x424734[_0x5c1a('0x12')](0xc8)[_0x5c1a('0x18')]({'message':'start\x20child\x20process\x20correctly!','pid':_0xa789e6[_0x5c1a('0xb0')]});});_0xa789e6['on'](_0x5c1a('0xbc'),function(_0x494df4){if(_0x494df4&&!_0x2534c4){return _0x424734[_0x5c1a('0x12')](0x1f4)[_0x5c1a('0x18')]({'message':'error\x20child\x20process','pid':_0xa789e6[_0x5c1a('0xb0')]});}});})['catch'](handleError(_0x424734,null));};exports[_0x5c1a('0xbd')]=function(_0x384f85,_0x4c26de){return db['User'][_0x5c1a('0x21')]({'raw':!![],'attributes':['id'],'where':{'role':_0x5c1a('0xb3')}})[_0x5c1a('0x19')](function(_0x30c7ec){var _0x47e270=![];if(!_0x384f85[_0x5c1a('0x37')][_0x5c1a('0x5b')]){throw new Error('No\x20ListId\x20specified');}if(!_0x384f85['body'][_0x5c1a('0xb5')][_0x5c1a('0x74')]){throw new Error(_0x5c1a('0xb6'));}if(!_0x384f85[_0x5c1a('0x37')][_0x5c1a('0xb5')][_0x5c1a('0xa6')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x384f85['body'][_0x5c1a('0xa1')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x135c04=require('child_process')[_0x5c1a('0xb8')](path[_0x5c1a('0x3b')](__dirname,_0x5c1a('0xbe')),[_0x384f85['params']['id'],JSON['stringify'](_0x384f85['body']),JSON[_0x5c1a('0xba')](_0x30c7ec)]);_0x135c04['on'](_0x5c1a('0xbb'),function(){_0x47e270=!![];return _0x4c26de[_0x5c1a('0x12')](0xc8)[_0x5c1a('0x18')]({'message':_0x5c1a('0xbf'),'pid':_0x135c04[_0x5c1a('0xb0')]});});_0x135c04['on'](_0x5c1a('0xbc'),function(_0x45b203){if(_0x45b203&&!_0x47e270){return _0x4c26de[_0x5c1a('0x12')](0x1f4)['json']({'message':_0x5c1a('0xc0'),'pid':_0x135c04['pid']});}});})[_0x5c1a('0x26')](handleError(_0x4c26de,null));};exports[_0x5c1a('0xc1')]=function(_0x5bd5ed,_0x17292d){var _0x7b31e4=[_0x5c1a('0xc2'),_0x5c1a('0xc3'),'sms','openchannel',_0x5c1a('0xc4'),'whatsapp',_0x5c1a('0xc5')];var _0x251cf6={'offset':0x0,'order':qs['sort']('-createdAt')},_0x459c79={'count':0x0,'rows':[]};Promise[_0x5c1a('0xc6')]()[_0x5c1a('0x19')](function(){if(_0x5bd5ed['query'][_0x5c1a('0xc7')]){if(!_[_0x5c1a('0xc8')](_0x7b31e4,_0x5bd5ed[_0x5c1a('0x2d')][_0x5c1a('0xc7')]['toLowerCase']())){throw new Error(_0x5c1a('0xc9'));}_0x7b31e4=[_0x5bd5ed['query']['channel'][_0x5c1a('0xca')]()];}if(_0x5bd5ed[_0x5c1a('0x2d')][_0x5c1a('0xcb')]){try{var _0x461e5e=JSON[_0x5c1a('0xb1')](_0x5bd5ed[_0x5c1a('0x2d')]['range']);if(!moment(_0x461e5e[_0x5c1a('0x38')])[_0x5c1a('0xcc')]()){throw new Error(_0x5c1a('0xcd'));}if(!moment(_0x461e5e['to'])[_0x5c1a('0xcc')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x3bb8f7){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x5bd5ed['query']['hasOwnProperty'](_0x5c1a('0x82'))){_0x251cf6[_0x5c1a('0x15')]=qs[_0x5c1a('0x15')](_0x5bd5ed[_0x5c1a('0x2d')][_0x5c1a('0x15')]||0xa);_0x251cf6[_0x5c1a('0x13')]=qs[_0x5c1a('0x13')](_0x5bd5ed['query'][_0x5c1a('0x13')]);}var _0x4ad3bf=_0x7b31e4['map'](function(_0x3dd6d9){if(_0x3dd6d9===_0x5c1a('0xc5')){var _0x5d6e4e={'attributes':['id','uniqueid','type',_0x5c1a('0xce'),_0x5c1a('0xcf'),'callerid',_0x5c1a('0xd0'),_0x5c1a('0xd1'),_0x5c1a('0xd2'),_0x5c1a('0xd3'),_0x5c1a('0xd4'),_0x5c1a('0xd5'),_0x5c1a('0xd6'),_0x5c1a('0xd7'),_0x5c1a('0xd8')],'where':{'ContactId':_0x5bd5ed[_0x5c1a('0x25')]['id']},'include':[{'model':db[_0x5c1a('0xd9')],'as':_0x5c1a('0xd9'),'attributes':['id',_0x5c1a('0x1c'),_0x5c1a('0xda'),'alias']}],'order':[[_0x5c1a('0xd4'),_0x5c1a('0xdb')]]};if(_0x5bd5ed[_0x5c1a('0x2d')][_0x5c1a('0xcb')]){_0x5d6e4e[_0x5c1a('0x5a')][_0x5c1a('0xd4')]={'$gte':_0x461e5e[_0x5c1a('0x38')],'$lte':_0x461e5e['to']};}return db['VoiceCallReport'][_0x5c1a('0xdc')](_0x5d6e4e)['then'](function(_0x4cd728){_0x459c79[_0x5c1a('0x16')]+=_0x4cd728['count'];return _['map'](_0x4cd728[_0x5c1a('0x99')],function(_0xe173d0){var _0x367fe1=_0xe173d0[_0x5c1a('0x39')]({'plain':!![]});_0x367fe1[_0x5c1a('0xc7')]=_0x3dd6d9;if(_0x367fe1[_0x5c1a('0xd9')]){_0x367fe1[_0x5c1a('0xd9')]={'id':_0x367fe1[_0x5c1a('0xd9')]['id'],'name':_0x367fe1[_0x5c1a('0xd9')][_0x5c1a('0x1c')],'fullname':_0x367fe1[_0x5c1a('0xd9')][_0x5c1a('0xda')],'alias':_0x367fe1['User'][_0x5c1a('0x2e')]};}return _0x367fe1;});});}else{var _0x3c2e0a=_['startCase'](_0x3dd6d9)+(_0x3dd6d9===_0x5c1a('0xc3')?_0x5c1a('0xdd'):_0x5c1a('0xde'));var _0x4c7420={'attributes':['id',_0x5c1a('0xdf'),_0x5c1a('0xe0'),'createdAt',_0x5c1a('0xd3'),_0x5c1a('0xe1'),_0x5c1a('0xe2'),_0x5c1a('0xe3'),_0x5c1a('0xd8'),_0x3c2e0a+'Id'],'where':{'ContactId':_0x5bd5ed[_0x5c1a('0x25')]['id']},'include':[{'model':db[_0x3c2e0a],'as':_0x5c1a('0xde'),'attributes':['id',_0x5c1a('0x1c'),'key']},{'model':db['User'],'as':_0x5c1a('0xe4'),'attributes':['id','name',_0x5c1a('0xda')]},{'model':db[_0x5c1a('0x63')],'as':'Tags','attributes':['id',_0x5c1a('0x1c'),_0x5c1a('0xe5')],'through':{'attributes':[]}}],'order':[[_0x5c1a('0xd4'),_0x5c1a('0xdb')]]};if(_0x5bd5ed[_0x5c1a('0x2d')][_0x5c1a('0xcb')]){_0x4c7420['where']['createdAt']={'$gte':_0x461e5e[_0x5c1a('0x38')],'$lte':_0x461e5e['to']};}switch(_0x3dd6d9){case _0x5c1a('0xc3'):_0x4c7420[_0x5c1a('0x7c')][_0x5c1a('0x6c')]('browserName',_0x5c1a('0xe6'),_0x5c1a('0xe7'),'deviceModel',_0x5c1a('0xe8'),_0x5c1a('0xe9'),_0x5c1a('0xea'),'ratingValue','referer');break;case _0x5c1a('0xc2'):_0x4c7420['attributes']['push'](_0x5c1a('0xeb'),_0x5c1a('0xec'));break;case'openchannel':_0x4c7420[_0x5c1a('0x7c')]['push']('externalUrl','threadId');break;}return db[_['startCase'](_0x3dd6d9)+_0x5c1a('0xed')][_0x5c1a('0xdc')](_0x4c7420)[_0x5c1a('0x19')](function(_0x3274f0){_0x459c79[_0x5c1a('0x16')]+=_0x3274f0[_0x5c1a('0x16')];return _['map'](_0x3274f0[_0x5c1a('0x99')],function(_0x1a60fa){var _0xbaa9a8=_0x1a60fa['get']({'plain':!![]});_0xbaa9a8[_0x5c1a('0xc7')]=_0x3dd6d9;if(_0xbaa9a8['Owner']){_0xbaa9a8[_0x5c1a('0xe4')]={'id':_0xbaa9a8[_0x5c1a('0xe4')]['id'],'name':_0xbaa9a8[_0x5c1a('0xe4')][_0x5c1a('0x1c')],'fullname':_0xbaa9a8[_0x5c1a('0xe4')][_0x5c1a('0xda')]};}return _0xbaa9a8;});});}});return Promise[_0x5c1a('0x86')](_0x4ad3bf);})[_0x5c1a('0x19')](function(_0x33332f){return _(_0x33332f)[_0x5c1a('0xee')]()['sortBy'](_0x5c1a('0xd4'))[_0x5c1a('0xef')]()['value']();})[_0x5c1a('0x19')](function(_0x2d588c){_0x459c79['rows']=_0x251cf6['limit']?_0x2d588c[_0x5c1a('0xf0')](_0x251cf6[_0x5c1a('0x13')],_0x251cf6[_0x5c1a('0x13')]+_0x251cf6[_0x5c1a('0x15')]):_0x2d588c;return _0x459c79;})[_0x5c1a('0x19')](respondWithFilteredResult(_0x17292d,_0x251cf6))['catch'](handleError(_0x17292d,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 4f642aa..7cbafdf 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 _0x8757=['update','emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x1d2650,_0x3a9d00){var _0x5a4b9f=function(_0x1a87aa){while(--_0x1a87aa){_0x1d2650['push'](_0x1d2650['shift']());}};_0x5a4b9f(++_0x3a9d00);}(_0x8757,0x79));var _0x7875=function(_0x544ca2,_0x18bda5){_0x544ca2=_0x544ca2-0x0;var _0x15fac2=_0x8757[_0x544ca2];return _0x15fac2;};'use strict';var EventEmitter=require(_0x7875('0x0'));var CmContact=require(_0x7875('0x1'))['db'][_0x7875('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7875('0x3')](0x0);var events={'afterCreate':_0x7875('0x4'),'afterUpdate':_0x7875('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4ef115){return function(_0x1709aa,_0xe9ebd5,_0x23f927){CmContactEvents['emit'](_0x4ef115+':'+_0x1709aa['id'],_0x1709aa);CmContactEvents[_0x7875('0x6')](_0x4ef115,_0x1709aa);_0x23f927(null);};}for(var e in events){if(events[_0x7875('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x7875('0x8')]=CmContactEvents; \ No newline at end of file +var _0x9aee=['save','update','remove','emit','exports','events','../../mysqldb','CmContact','setMaxListeners'];(function(_0xadaf59,_0x52a79e){var _0x59d3c3=function(_0x3c4cd2){while(--_0x3c4cd2){_0xadaf59['push'](_0xadaf59['shift']());}};_0x59d3c3(++_0x52a79e);}(_0x9aee,0x71));var _0xe9ae=function(_0x24cc35,_0x21b4e6){_0x24cc35=_0x24cc35-0x0;var _0x440e29=_0x9aee[_0x24cc35];return _0x440e29;};'use strict';var EventEmitter=require(_0xe9ae('0x0'));var CmContact=require(_0xe9ae('0x1'))['db'][_0xe9ae('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe9ae('0x3')](0x0);var events={'afterCreate':_0xe9ae('0x4'),'afterUpdate':_0xe9ae('0x5'),'afterDestroy':_0xe9ae('0x6')};function emitEvent(_0x13c2f9){return function(_0xb9c1b3,_0x5016ae,_0x526dd9){CmContactEvents['emit'](_0x13c2f9+':'+_0xb9c1b3['id'],_0xb9c1b3);CmContactEvents[_0xe9ae('0x7')](_0x13c2f9,_0xb9c1b3);_0x526dd9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xe9ae('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 2950aca..a9214e7 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 _0x4be8=['request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','fax','utf8mb4_unicode_ci','models','error','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','add','minutes','format','then','ret','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','cmContact','Campaign','\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','findAll','dialCheckDuplicateType','Lists','length','get','always','onlyIfOpen','outbound','CmList','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','info','lodash','util','../../config/logger','api','moment'];(function(_0x455607,_0x41665f){var _0x25631a=function(_0x177e17){while(--_0x177e17){_0x455607['push'](_0x455607['shift']());}};_0x25631a(++_0x41665f);}(_0x4be8,0x14a));var _0x84be=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x4be8[_0xa8883];return _0x479426;};'use strict';var _=require(_0x84be('0x0'));var util=require(_0x84be('0x1'));var logger=require(_0x84be('0x2'))(_0x84be('0x3'));var moment=require(_0x84be('0x4'));var BPromise=require('bluebird');var rp=require(_0x84be('0x5'));var fs=require('fs');var path=require(_0x84be('0x6'));var rimraf=require(_0x84be('0x7'));var config=require(_0x84be('0x8'));var shared=require('../../config/environment/shared');var attributes=require(_0x84be('0x9'));module[_0x84be('0xa')]=function(_0x4ce5de,_0x4020eb){return _0x4ce5de[_0x84be('0xb')](_0x84be('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':[_0x84be('0xd')]},{'name':_0x84be('0xe'),'fields':[_0x84be('0xf'),_0x84be('0x10'),'phone',_0x84be('0x11'),_0x84be('0x12'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':'utf8mb4','collate':_0x84be('0x13'),'hooks':{'afterCreate':function(_0xf1058c,_0x4a5685,_0x18548c){var _0x47b632=_0x4ce5de[_0x84be('0x14')];var _0x5b769e=_0xf1058c['get']({'plain':!![]});function _0x302570(){return function(_0x1de5be){logger[_0x84be('0x15')]('cmContact',_0x84be('0x16'),util[_0x84be('0x17')](_0x1de5be,{'showHidden':![],'depth':null}));};}function _0x2131c4(_0x35e0d0,_0xd3d5ad){var _0x33c83b=_0xd3d5ad[_0x84be('0x18')]?_0xd3d5ad[_0x84be('0x18')]:moment()['format'](_0x84be('0x19'));return new BPromise(function(_0x2ebf0c,_0x20b55a){if(_[_0x84be('0x1a')](_0xd3d5ad[_0x84be('0x1b')])){_0x2ebf0c({'ret':_0x33c83b});}else{_0x47b632['VoiceQueue'][_0x84be('0x1c')]({'where':{'id':_0x35e0d0['id']}})['then'](function(_0x5675c0){if(!_[_0x84be('0x1a')](_0x5675c0)){var _0x1baae7=_0x5675c0[_0x84be('0x1b')];if(!_[_0x84be('0x1a')](_0x1baae7)){var _0x299737=shared[_0x84be('0x1d')];var _0x260c30=_0x299737[_0x1baae7];var _0x4735a7=_0x299737[_0xd3d5ad[_0x84be('0x1b')]];if(!_['isNil'](_0x260c30)&&!_[_0x84be('0x1a')](_0x4735a7)){var _0x174fbd=_0x260c30['utcOffset']-_0x4735a7[_0x84be('0x1e')];_0x33c83b=_0xd3d5ad['scheduledat']?_0xd3d5ad[_0x84be('0x18')]:moment();var _0x47506e=moment(_0x33c83b)[_0x84be('0x1f')](_0x174fbd,_0x84be('0x20'));_0x2ebf0c({'ret':_0x47506e[_0x84be('0x21')](_0x84be('0x19'))});}else _0x2ebf0c({'ret':_0x33c83b});}else _0x2ebf0c({'ret':_0x33c83b});}else{_0x2ebf0c({'ret':_0x33c83b});}});}});return 0xa;}var _0x180b96=function(_0x2622d5){return new BPromise(function(_0x29bb06,_0xfab21e){_0x2131c4(_0x2622d5,_0x5b769e)[_0x84be('0x22')](function(_0xc29dc8){_0x5b769e[_0x84be('0x18')]=_0xc29dc8[_0x84be('0x23')];_0x47b632[_0x84be('0x24')][_0x84be('0x1c')]({'where':{'phone':_0x5b769e[_0x84be('0xd')],'VoiceQueueId':_0x2622d5['id']}})[_0x84be('0x22')](function(_0xc34edc){if(!_[_0x84be('0x1a')](_0xc34edc)){throw new Error(_0x84be('0x25')+_0x5b769e[_0x84be('0xd')]+_0x84be('0x26')+_0x2622d5['id']);}return _0x47b632[_0x84be('0x24')][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e[_0x84be('0x29')]:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()['format'](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e['callbackUniqueid']?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'VoiceQueueId':_0x2622d5['id']});})[_0x84be('0x2b')](function(_0xf913bb){_0xfab21e(_0xf913bb);});});});};var _0x2c0068=function(_0x262380){return new BPromise(function(_0x41eb18,_0x1d711d){_0x2131c4(_0x262380,_0x5b769e)[_0x84be('0x22')](function(_0x5698a7){_0x5b769e[_0x84be('0x18')]=_0x5698a7[_0x84be('0x23')];_0x47b632[_0x84be('0x24')][_0x84be('0x1c')]({'where':{'phone':_0x5b769e['phone'],'VoiceQueueId':_0x262380['id']}})[_0x84be('0x22')](function(_0x41cfe5){if(!_['isNil'](_0x41cfe5)){throw new Error(_0x84be('0x25')+_0x5b769e[_0x84be('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x262380['id']);}return _0x47b632[_0x84be('0x2c')][_0x84be('0x1c')]({'where':{'calleridnum':_0x5b769e[_0x84be('0xd')],'VoiceQueueId':_0x262380['id']}});})['then'](function(_0x491945){if(!_[_0x84be('0x1a')](_0x491945)){throw new Error(_0x84be('0x2d')+_0x5b769e['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x262380['id']);}return _0x47b632['CmHopper']['create']({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e['priority']?_0x5b769e[_0x84be('0x29')]:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e['callbackUniqueid']:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'VoiceQueueId':_0x262380['id']});})[_0x84be('0x2b')](function(_0x508b82){_0x1d711d(_0x508b82);});});});};function _0x2b97b3(){return function(_0x3b9c4b){logger[_0x84be('0x15')](_0x84be('0x2e'),'afterCreate',util[_0x84be('0x17')](_0x3b9c4b,{'showHidden':![],'depth':null}));};}function _0x4dec7b(_0x3f31b2,_0x449f4b){var _0x154c8c=_0x449f4b[_0x84be('0x18')]?_0x449f4b[_0x84be('0x18')]:moment()[_0x84be('0x21')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x2139d6,_0xfc9215){if(_[_0x84be('0x1a')](_0x449f4b[_0x84be('0x1b')])){_0x2139d6({'ret':_0x154c8c});}else{_0x47b632[_0x84be('0x2f')]['findOne']({'where':{'id':_0x3f31b2['id']}})[_0x84be('0x22')](function(_0x1b5a5f){if(!_['isNil'](_0x1b5a5f)){var _0x426bd1=_0x1b5a5f[_0x84be('0x1b')];if(!_[_0x84be('0x1a')](_0x426bd1)){var _0x2b9c20=shared['timezones'];var _0x4c77ae=_0x2b9c20[_0x426bd1];var _0x16d192=_0x2b9c20[_0x449f4b[_0x84be('0x1b')]];if(!_['isNil'](_0x4c77ae)&&!_[_0x84be('0x1a')](_0x16d192)){var _0x2b3ac9=_0x4c77ae['utcOffset']-_0x16d192[_0x84be('0x1e')];_0x154c8c=_0x449f4b['scheduledat']?_0x449f4b[_0x84be('0x18')]:moment();var _0x236c68=moment(_0x154c8c)[_0x84be('0x1f')](_0x2b3ac9,_0x84be('0x20'));_0x2139d6({'ret':_0x236c68[_0x84be('0x21')](_0x84be('0x19'))});}else _0x2139d6({'ret':_0x154c8c});}else _0x2139d6({'ret':_0x154c8c});}else{_0x2139d6({'ret':_0x154c8c});}});}});return 0xa;}var _0x4426a5=function(_0x1e6849){return new BPromise(function(_0x3d2597,_0x15b062){_0x4dec7b(_0x1e6849,_0x5b769e)['then'](function(_0x1b406c){_0x5b769e[_0x84be('0x18')]=_0x1b406c[_0x84be('0x23')];_0x47b632[_0x84be('0x24')][_0x84be('0x1c')]({'where':{'phone':_0x5b769e[_0x84be('0xd')],'CampaignId':_0x1e6849['id']}})[_0x84be('0x22')](function(_0x302b5c){if(!_[_0x84be('0x1a')](_0x302b5c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x5b769e[_0x84be('0xd')]+_0x84be('0x30')+_0x1e6849['id']);}return _0x47b632[_0x84be('0x24')][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e['priority']:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e['callbackUniqueid']?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'CampaignId':_0x1e6849['id']});})['catch'](function(_0x41b135){_0x15b062(_0x41b135);});});});};var _0x2b6881=function(_0x481eeb){return new BPromise(function(_0x49cc44,_0x5ebd0b){_0x4dec7b(_0x481eeb,_0x5b769e)['then'](function(_0x4d8013){_0x5b769e[_0x84be('0x18')]=_0x4d8013[_0x84be('0x23')];_0x47b632['CmHopper']['findOne']({'where':{'phone':_0x5b769e[_0x84be('0xd')],'CampaignId':_0x481eeb['id']}})[_0x84be('0x22')](function(_0x112537){if(!_[_0x84be('0x1a')](_0x112537)){throw new Error(_0x84be('0x25')+_0x5b769e[_0x84be('0xd')]+_0x84be('0x31')+_0x481eeb['id']);}return _0x47b632[_0x84be('0x2c')][_0x84be('0x1c')]({'where':{'calleridnum':_0x5b769e[_0x84be('0xd')],'CampaignId':_0x481eeb['id']}});})['then'](function(_0x4f87a6){if(!_['isNil'](_0x4f87a6)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x5b769e[_0x84be('0xd')]+_0x84be('0x32')+_0x481eeb['id']);}return _0x47b632[_0x84be('0x24')]['create']({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e['priority']:0x2,'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()['format'](_0x84be('0x19')),'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e['callbackUniqueid']?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'CampaignId':_0x481eeb['id']});})[_0x84be('0x2b')](function(_0x2e1261){_0x5ebd0b(_0x2e1261);});});});};if(_0x5b769e[_0x84be('0x28')]){_0x47b632['VoiceQueue'][_0x84be('0x33')]({'where':{'type':'outbound'},'attributes':['id',_0x84be('0x34'),'dialTimezone'],'include':[{'model':_0x47b632['CmList'],'as':_0x84be('0x35'),'where':{'id':_0x5b769e['ListId']}}]})['then'](function(_0x1e758c){if(_0x1e758c){var _0x215863=[];for(var _0x7ed041=0x0,_0x46b219;_0x7ed041<_0x1e758c[_0x84be('0x36')];_0x7ed041+=0x1){_0x46b219=_0x1e758c[_0x7ed041][_0x84be('0x37')]({'plain':!![]});switch(_0x46b219[_0x84be('0x34')]){case _0x84be('0x38'):_0x2c0068(_0x46b219)[_0x84be('0x2b')](_0x302570());break;case _0x84be('0x39'):_0x180b96(_0x46b219)[_0x84be('0x2b')](_0x302570());break;default:_0x4dec7b(_0x46b219,_0x5b769e)[_0x84be('0x22')](function(_0xbc1e99){_0x5b769e['scheduledat']=_0xbc1e99[_0x84be('0x23')];_0x47b632[_0x84be('0x24')]['create']({'phone':_0x5b769e['phone'],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'scheduledat':_0x5b769e['scheduledat']?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e[_0x84be('0x29')]:0x2,'callback':_0x5b769e[_0x84be('0x2a')]?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e['callbackUniqueid']:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'VoiceQueueId':_0x46b219['id']})['catch'](_0x302570());});}}}})[_0x84be('0x22')](function(){return _0x47b632['VoiceQueue'][_0x84be('0x33')]({'where':{'type':_0x84be('0x3a')},'attributes':['id'],'include':[{'model':_0x47b632[_0x84be('0x3b')],'as':_0x84be('0x3c'),'where':{'id':_0x5b769e['ListId']}}]})[_0x84be('0x22')](function(_0x1fedbd){if(_0x1fedbd){var _0x1694e0=[];for(var _0x118b7d=0x0,_0x50694a;_0x118b7d<_0x1fedbd[_0x84be('0x36')];_0x118b7d+=0x1){_0x50694a=_0x1fedbd[_0x118b7d][_0x84be('0x37')]({'plain':!![]});_0x47b632[_0x84be('0x3d')][_0x84be('0x27')]({'phone':_0x5b769e['phone'],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e['ListId'],'VoiceQueueId':_0x50694a['id']})['catch'](function(_0x32d83b){logger[_0x84be('0x15')](_0x84be('0x3e'),'afterCreate',_0x32d83b[_0x84be('0x3f')]);});}}});})[_0x84be('0x22')](function(){return _0x47b632[_0x84be('0x2f')]['findAll']({'attributes':['id','dialCheckDuplicateType',_0x84be('0x1b')],'include':[{'model':_0x47b632['CmList'],'as':_0x84be('0x35'),'where':{'id':_0x5b769e[_0x84be('0x28')]}}]})[_0x84be('0x22')](function(_0x14610f){if(_0x14610f){var _0xeb1d84=[];for(var _0x37598b=0x0,_0x36cf73;_0x37598b<_0x14610f[_0x84be('0x36')];_0x37598b+=0x1){_0x36cf73=_0x14610f[_0x37598b]['get']({'plain':!![]});switch(_0x36cf73['dialCheckDuplicateType']){case _0x84be('0x38'):_0x2b6881(_0x36cf73)[_0x84be('0x2b')](_0x2b97b3());break;case _0x84be('0x39'):_0x4426a5(_0x36cf73)[_0x84be('0x2b')](_0x2b97b3());break;default:_0x47b632[_0x84be('0x24')][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'scheduledat':_0x5b769e[_0x84be('0x18')]?_0x5b769e[_0x84be('0x18')]:moment()[_0x84be('0x21')](_0x84be('0x19')),'priority':_0x5b769e[_0x84be('0x29')]?_0x5b769e['priority']:0x2,'callback':_0x5b769e['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x5b769e[_0x84be('0x2a')]?_0x5b769e[_0x84be('0x2a')]:undefined,'callbackat':_0x5b769e[_0x84be('0x2a')]?moment()[_0x84be('0x21')](_0x84be('0x19')):undefined,'CampaignId':_0x36cf73['id']})[_0x84be('0x2b')](_0x2b97b3());}}}});})[_0x84be('0x22')](function(){return _0x47b632['Campaign'][_0x84be('0x33')]({'attributes':['id'],'include':[{'model':_0x47b632[_0x84be('0x3b')],'as':'BlackLists','where':{'id':_0x5b769e['ListId']}}]})[_0x84be('0x22')](function(_0x28acaf){if(_0x28acaf){var _0x39c326=[];for(var _0x1abb79=0x0,_0x207f42;_0x1abb79<_0x28acaf[_0x84be('0x36')];_0x1abb79+=0x1){_0x207f42=_0x28acaf[_0x1abb79]['get']({'plain':!![]});_0x47b632['CmHopperBlack'][_0x84be('0x27')]({'phone':_0x5b769e[_0x84be('0xd')],'ContactId':_0x5b769e['id'],'ListId':_0x5b769e[_0x84be('0x28')],'CampaignId':_0x207f42['id']})[_0x84be('0x2b')](function(_0x41947e){logger['error'](_0x84be('0x3e'),'afterCreate',_0x41947e['message']);});}}});})['then'](function(){_0x18548c();})[_0x84be('0x2b')](function(_0x3bcd48){logger[_0x84be('0x15')]('cmContact,\x20%s,\x20%s',_0x84be('0x16'),_0x3bcd48[_0x84be('0x3f')]);_0x18548c(_0x3bcd48);});}else{_0x18548c(new Error(_0x84be('0x40')));}},'afterDestroy':function(_0x209742,_0x3b960f,_0x5751ff){var _0x2509bc=_0x4ce5de[_0x84be('0x14')];var _0x394810=_0x209742[_0x84be('0x37')]({'plain':!![]});return _0x2509bc[_0x84be('0x24')][_0x84be('0x33')]({'raw':!![],'where':{'ListId':_0x394810['ListId'],'ContactId':_0x394810['id']}})[_0x84be('0x22')](function(_0x2e9e98){if(!_[_0x84be('0x41')](_0x2e9e98)){var _0x5406d9=[];for(var _0x4dc254=0x0;_0x4dc254<_0x2e9e98[_0x84be('0x36')];_0x4dc254+=0x1){var _0x5da94f=_0x2509bc[_0x84be('0x24')]['destroy']({'where':{'ListId':_0x2e9e98[_0x4dc254]['ListId'],'ContactId':_0x2e9e98[_0x4dc254]['ContactId'],'VoiceQueueId':_0x2e9e98[_0x4dc254]['VoiceQueueId'],'CampaignId':_0x2e9e98[_0x4dc254]['CampaignId']}});_0x5406d9['push'](_0x5da94f);}return BPromise['all'](_0x5406d9);}})[_0x84be('0x22')](function(_0x4d3188){logger[_0x84be('0x42')]('[CmContact][afterDestroy][Succesfull]',util[_0x84be('0x17')](_0x4d3188,{'showHidden':![],'depth':null}));_0x5751ff();})[_0x84be('0x2b')](function(_0x11c363){logger[_0x84be('0x15')]('[CmContact][afterDestroy][Error]',util[_0x84be('0x17')](_0x11c363,{'showHidden':![],'depth':null}));_0x5751ff(_0x11c363);});}}});}; \ No newline at end of file +var _0xdacb=['Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','ListId','findAll','outbound','CmList','always','onlyIfOpen','BlackLists','length','CmHopperBlack','message','dialCheckDuplicateType','Lists','get','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','destroy','ContactId','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','email','FULLTEXT','utf8mb4','models','error','cmContact','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','utcOffset','add','minutes','ret','CmHopper','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','catch','afterCreate'];(function(_0x25d69e,_0x5639a9){var _0x52f50e=function(_0x55f56a){while(--_0x55f56a){_0x25d69e['push'](_0x25d69e['shift']());}};_0x52f50e(++_0x5639a9);}(_0xdacb,0xaf));var _0xbdac=function(_0x2c273d,_0x275fa6){_0x2c273d=_0x2c273d-0x0;var _0x5afc84=_0xdacb[_0x2c273d];return _0x5afc84;};'use strict';var _=require('lodash');var util=require(_0xbdac('0x0'));var logger=require(_0xbdac('0x1'))('api');var moment=require(_0xbdac('0x2'));var BPromise=require(_0xbdac('0x3'));var rp=require(_0xbdac('0x4'));var fs=require('fs');var path=require(_0xbdac('0x5'));var rimraf=require(_0xbdac('0x6'));var config=require(_0xbdac('0x7'));var shared=require(_0xbdac('0x8'));var attributes=require(_0xbdac('0x9'));module[_0xbdac('0xa')]=function(_0x17ac3e,_0x4e0e34){return _0x17ac3e[_0xbdac('0xb')](_0xbdac('0xc'),attributes,{'tableName':_0xbdac('0xd'),'paranoid':!![],'indexes':[{'name':_0xbdac('0xe'),'fields':['phone']},{'name':_0xbdac('0xf'),'fields':[_0xbdac('0x10'),_0xbdac('0x11'),_0xbdac('0xe'),_0xbdac('0x12'),'fax',_0xbdac('0x13')],'type':_0xbdac('0x14')}],'timestamps':!![],'charset':_0xbdac('0x15'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x1b23e6,_0x248281,_0x3d3803){var _0x4953da=_0x17ac3e[_0xbdac('0x16')];var _0x2da755=_0x1b23e6['get']({'plain':!![]});function _0x737348(){return function(_0xeb51df){logger[_0xbdac('0x17')](_0xbdac('0x18'),'afterCreate',util[_0xbdac('0x19')](_0xeb51df,{'showHidden':![],'depth':null}));};}function _0x574293(_0x6d9f55,_0x18c6dc){var _0x144ce1=_0x18c6dc[_0xbdac('0x1a')]?_0x18c6dc[_0xbdac('0x1a')]:moment()[_0xbdac('0x1b')](_0xbdac('0x1c'));return new BPromise(function(_0x338224,_0x5dc73d){if(_[_0xbdac('0x1d')](_0x18c6dc['dialTimezone'])){_0x338224({'ret':_0x144ce1});}else{_0x4953da[_0xbdac('0x1e')][_0xbdac('0x1f')]({'where':{'id':_0x6d9f55['id']}})[_0xbdac('0x20')](function(_0x4b5190){if(!_[_0xbdac('0x1d')](_0x4b5190)){var _0x21e919=_0x4b5190[_0xbdac('0x21')];if(!_[_0xbdac('0x1d')](_0x21e919)){var _0x3da94a=shared[_0xbdac('0x22')];var _0x2d0602=_0x3da94a[_0x21e919];var _0x22990a=_0x3da94a[_0x18c6dc['dialTimezone']];if(!_[_0xbdac('0x1d')](_0x2d0602)&&!_['isNil'](_0x22990a)){var _0x1de247=_0x2d0602['utcOffset']-_0x22990a[_0xbdac('0x23')];_0x144ce1=_0x18c6dc['scheduledat']?_0x18c6dc[_0xbdac('0x1a')]:moment();var _0x46e7b4=moment(_0x144ce1)[_0xbdac('0x24')](_0x1de247,_0xbdac('0x25'));_0x338224({'ret':_0x46e7b4[_0xbdac('0x1b')](_0xbdac('0x1c'))});}else _0x338224({'ret':_0x144ce1});}else _0x338224({'ret':_0x144ce1});}else{_0x338224({'ret':_0x144ce1});}});}});return 0xa;}var _0x574390=function(_0x425b29){return new BPromise(function(_0x1dc05b,_0x4f1bb6){_0x574293(_0x425b29,_0x2da755)[_0xbdac('0x20')](function(_0x4d5a63){_0x2da755[_0xbdac('0x1a')]=_0x4d5a63[_0xbdac('0x26')];_0x4953da[_0xbdac('0x27')][_0xbdac('0x1f')]({'where':{'phone':_0x2da755['phone'],'VoiceQueueId':_0x425b29['id']}})[_0xbdac('0x20')](function(_0x266927){if(!_['isNil'](_0x266927)){throw new Error(_0xbdac('0x28')+_0x2da755[_0xbdac('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x425b29['id']);}return _0x4953da[_0xbdac('0x27')][_0xbdac('0x29')]({'phone':_0x2da755[_0xbdac('0xe')],'ContactId':_0x2da755['id'],'ListId':_0x2da755['ListId'],'priority':_0x2da755[_0xbdac('0x2a')]?_0x2da755[_0xbdac('0x2a')]:0x2,'scheduledat':_0x2da755[_0xbdac('0x1a')]?_0x2da755['scheduledat']:moment()[_0xbdac('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2da755[_0xbdac('0x2b')]?!![]:![],'callbackuniqueid':_0x2da755['callbackUniqueid']?_0x2da755[_0xbdac('0x2b')]:undefined,'callbackat':_0x2da755[_0xbdac('0x2b')]?moment()[_0xbdac('0x1b')](_0xbdac('0x1c')):undefined,'VoiceQueueId':_0x425b29['id']});})['catch'](function(_0x37b009){_0x4f1bb6(_0x37b009);});});});};var _0x3094cd=function(_0x2a1650){return new BPromise(function(_0x6fe085,_0x1c9a41){_0x574293(_0x2a1650,_0x2da755)[_0xbdac('0x20')](function(_0x5bde96){_0x2da755[_0xbdac('0x1a')]=_0x5bde96[_0xbdac('0x26')];_0x4953da[_0xbdac('0x27')][_0xbdac('0x1f')]({'where':{'phone':_0x2da755[_0xbdac('0xe')],'VoiceQueueId':_0x2a1650['id']}})[_0xbdac('0x20')](function(_0x55ba35){if(!_['isNil'](_0x55ba35)){throw new Error(_0xbdac('0x28')+_0x2da755[_0xbdac('0xe')]+_0xbdac('0x2c')+_0x2a1650['id']);}return _0x4953da[_0xbdac('0x2d')][_0xbdac('0x1f')]({'where':{'calleridnum':_0x2da755[_0xbdac('0xe')],'VoiceQueueId':_0x2a1650['id']}});})[_0xbdac('0x20')](function(_0x14b1d3){if(!_['isNil'](_0x14b1d3)){throw new Error(_0xbdac('0x2e')+_0x2da755[_0xbdac('0xe')]+_0xbdac('0x2f')+_0x2a1650['id']);}return _0x4953da[_0xbdac('0x27')][_0xbdac('0x29')]({'phone':_0x2da755[_0xbdac('0xe')],'ContactId':_0x2da755['id'],'ListId':_0x2da755['ListId'],'priority':_0x2da755[_0xbdac('0x2a')]?_0x2da755[_0xbdac('0x2a')]:0x2,'scheduledat':_0x2da755[_0xbdac('0x1a')]?_0x2da755[_0xbdac('0x1a')]:moment()[_0xbdac('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2da755[_0xbdac('0x2b')]?!![]:![],'callbackuniqueid':_0x2da755[_0xbdac('0x2b')]?_0x2da755[_0xbdac('0x2b')]:undefined,'callbackat':_0x2da755[_0xbdac('0x2b')]?moment()[_0xbdac('0x1b')](_0xbdac('0x1c')):undefined,'VoiceQueueId':_0x2a1650['id']});})[_0xbdac('0x30')](function(_0x5ea4ed){_0x1c9a41(_0x5ea4ed);});});});};function _0x219e01(){return function(_0x5c1b8e){logger[_0xbdac('0x17')](_0xbdac('0x18'),_0xbdac('0x31'),util[_0xbdac('0x19')](_0x5c1b8e,{'showHidden':![],'depth':null}));};}function _0x362008(_0x5da850,_0x4c1ce3){var _0x5e4531=_0x4c1ce3[_0xbdac('0x1a')]?_0x4c1ce3['scheduledat']:moment()[_0xbdac('0x1b')](_0xbdac('0x1c'));return new BPromise(function(_0x47d32e,_0x4b704e){if(_[_0xbdac('0x1d')](_0x4c1ce3['dialTimezone'])){_0x47d32e({'ret':_0x5e4531});}else{_0x4953da[_0xbdac('0x32')]['findOne']({'where':{'id':_0x5da850['id']}})[_0xbdac('0x20')](function(_0x329449){if(!_['isNil'](_0x329449)){var _0x2edf40=_0x329449[_0xbdac('0x21')];if(!_[_0xbdac('0x1d')](_0x2edf40)){var _0x5d157e=shared['timezones'];var _0x2737ad=_0x5d157e[_0x2edf40];var _0x1fc5b9=_0x5d157e[_0x4c1ce3[_0xbdac('0x21')]];if(!_[_0xbdac('0x1d')](_0x2737ad)&&!_[_0xbdac('0x1d')](_0x1fc5b9)){var _0x180fae=_0x2737ad[_0xbdac('0x23')]-_0x1fc5b9[_0xbdac('0x23')];_0x5e4531=_0x4c1ce3[_0xbdac('0x1a')]?_0x4c1ce3[_0xbdac('0x1a')]:moment();var _0x4f2eda=moment(_0x5e4531)[_0xbdac('0x24')](_0x180fae,_0xbdac('0x25'));_0x47d32e({'ret':_0x4f2eda['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x47d32e({'ret':_0x5e4531});}else _0x47d32e({'ret':_0x5e4531});}else{_0x47d32e({'ret':_0x5e4531});}});}});return 0xa;}var _0x316d7c=function(_0x4268c8){return new BPromise(function(_0x11dba5,_0x4d2389){_0x362008(_0x4268c8,_0x2da755)[_0xbdac('0x20')](function(_0x3f0777){_0x2da755[_0xbdac('0x1a')]=_0x3f0777[_0xbdac('0x26')];_0x4953da[_0xbdac('0x27')][_0xbdac('0x1f')]({'where':{'phone':_0x2da755[_0xbdac('0xe')],'CampaignId':_0x4268c8['id']}})['then'](function(_0x14e4dd){if(!_[_0xbdac('0x1d')](_0x14e4dd)){throw new Error(_0xbdac('0x28')+_0x2da755[_0xbdac('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x4268c8['id']);}return _0x4953da[_0xbdac('0x27')]['create']({'phone':_0x2da755['phone'],'ContactId':_0x2da755['id'],'ListId':_0x2da755['ListId'],'priority':_0x2da755[_0xbdac('0x2a')]?_0x2da755['priority']:0x2,'scheduledat':_0x2da755[_0xbdac('0x1a')]?_0x2da755[_0xbdac('0x1a')]:moment()[_0xbdac('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2da755[_0xbdac('0x2b')]?!![]:![],'callbackuniqueid':_0x2da755[_0xbdac('0x2b')]?_0x2da755[_0xbdac('0x2b')]:undefined,'callbackat':_0x2da755[_0xbdac('0x2b')]?moment()[_0xbdac('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4268c8['id']});})[_0xbdac('0x30')](function(_0x46cb67){_0x4d2389(_0x46cb67);});});});};var _0x2da34b=function(_0x5c9e8f){return new BPromise(function(_0x768c07,_0x3684ec){_0x362008(_0x5c9e8f,_0x2da755)[_0xbdac('0x20')](function(_0x10a517){_0x2da755[_0xbdac('0x1a')]=_0x10a517[_0xbdac('0x26')];_0x4953da[_0xbdac('0x27')][_0xbdac('0x1f')]({'where':{'phone':_0x2da755[_0xbdac('0xe')],'CampaignId':_0x5c9e8f['id']}})[_0xbdac('0x20')](function(_0x18d69b){if(!_[_0xbdac('0x1d')](_0x18d69b)){throw new Error('cmContact,\x20afterCreate\x20'+_0x2da755['phone']+_0xbdac('0x33')+_0x5c9e8f['id']);}return _0x4953da[_0xbdac('0x2d')][_0xbdac('0x1f')]({'where':{'calleridnum':_0x2da755['phone'],'CampaignId':_0x5c9e8f['id']}});})[_0xbdac('0x20')](function(_0x5923ed){if(!_[_0xbdac('0x1d')](_0x5923ed)){throw new Error(_0xbdac('0x2e')+_0x2da755['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x5c9e8f['id']);}return _0x4953da[_0xbdac('0x27')]['create']({'phone':_0x2da755[_0xbdac('0xe')],'ContactId':_0x2da755['id'],'ListId':_0x2da755[_0xbdac('0x34')],'priority':_0x2da755['priority']?_0x2da755[_0xbdac('0x2a')]:0x2,'scheduledat':_0x2da755[_0xbdac('0x1a')]?_0x2da755['scheduledat']:moment()['format'](_0xbdac('0x1c')),'callback':_0x2da755[_0xbdac('0x2b')]?!![]:![],'callbackuniqueid':_0x2da755['callbackUniqueid']?_0x2da755[_0xbdac('0x2b')]:undefined,'callbackat':_0x2da755[_0xbdac('0x2b')]?moment()[_0xbdac('0x1b')](_0xbdac('0x1c')):undefined,'CampaignId':_0x5c9e8f['id']});})['catch'](function(_0x1fe633){_0x3684ec(_0x1fe633);});});});};if(_0x2da755[_0xbdac('0x34')]){_0x4953da[_0xbdac('0x1e')][_0xbdac('0x35')]({'where':{'type':_0xbdac('0x36')},'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x4953da[_0xbdac('0x37')],'as':'Lists','where':{'id':_0x2da755[_0xbdac('0x34')]}}]})[_0xbdac('0x20')](function(_0x4bd422){if(_0x4bd422){var _0x45c2f5=[];for(var _0x8d8874=0x0,_0x186dbb;_0x8d8874<_0x4bd422['length'];_0x8d8874+=0x1){_0x186dbb=_0x4bd422[_0x8d8874]['get']({'plain':!![]});switch(_0x186dbb['dialCheckDuplicateType']){case _0xbdac('0x38'):_0x3094cd(_0x186dbb)[_0xbdac('0x30')](_0x737348());break;case _0xbdac('0x39'):_0x574390(_0x186dbb)[_0xbdac('0x30')](_0x737348());break;default:_0x362008(_0x186dbb,_0x2da755)[_0xbdac('0x20')](function(_0x3c3f70){_0x2da755['scheduledat']=_0x3c3f70[_0xbdac('0x26')];_0x4953da[_0xbdac('0x27')][_0xbdac('0x29')]({'phone':_0x2da755[_0xbdac('0xe')],'ContactId':_0x2da755['id'],'ListId':_0x2da755[_0xbdac('0x34')],'scheduledat':_0x2da755['scheduledat']?_0x2da755[_0xbdac('0x1a')]:moment()[_0xbdac('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2da755[_0xbdac('0x2a')]?_0x2da755['priority']:0x2,'callback':_0x2da755['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2da755[_0xbdac('0x2b')]?_0x2da755['callbackUniqueid']:undefined,'callbackat':_0x2da755[_0xbdac('0x2b')]?moment()[_0xbdac('0x1b')](_0xbdac('0x1c')):undefined,'VoiceQueueId':_0x186dbb['id']})['catch'](_0x737348());});}}}})['then'](function(){return _0x4953da['VoiceQueue'][_0xbdac('0x35')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x4953da[_0xbdac('0x37')],'as':_0xbdac('0x3a'),'where':{'id':_0x2da755['ListId']}}]})[_0xbdac('0x20')](function(_0x5995cd){if(_0x5995cd){var _0x2ddc69=[];for(var _0x4fa1eb=0x0,_0x4c969c;_0x4fa1eb<_0x5995cd[_0xbdac('0x3b')];_0x4fa1eb+=0x1){_0x4c969c=_0x5995cd[_0x4fa1eb]['get']({'plain':!![]});_0x4953da[_0xbdac('0x3c')]['create']({'phone':_0x2da755['phone'],'ContactId':_0x2da755['id'],'ListId':_0x2da755[_0xbdac('0x34')],'VoiceQueueId':_0x4c969c['id']})['catch'](function(_0x1c1c62){logger[_0xbdac('0x17')]('cmContact,\x20%s,\x20%s',_0xbdac('0x31'),_0x1c1c62[_0xbdac('0x3d')]);});}}});})[_0xbdac('0x20')](function(){return _0x4953da[_0xbdac('0x32')][_0xbdac('0x35')]({'attributes':['id',_0xbdac('0x3e'),_0xbdac('0x21')],'include':[{'model':_0x4953da[_0xbdac('0x37')],'as':_0xbdac('0x3f'),'where':{'id':_0x2da755[_0xbdac('0x34')]}}]})[_0xbdac('0x20')](function(_0x3797a0){if(_0x3797a0){var _0x5bae76=[];for(var _0x3f0d11=0x0,_0x1eb4a2;_0x3f0d11<_0x3797a0['length'];_0x3f0d11+=0x1){_0x1eb4a2=_0x3797a0[_0x3f0d11][_0xbdac('0x40')]({'plain':!![]});switch(_0x1eb4a2[_0xbdac('0x3e')]){case _0xbdac('0x38'):_0x2da34b(_0x1eb4a2)[_0xbdac('0x30')](_0x219e01());break;case'onlyIfOpen':_0x316d7c(_0x1eb4a2)[_0xbdac('0x30')](_0x219e01());break;default:_0x4953da[_0xbdac('0x27')]['create']({'phone':_0x2da755['phone'],'ContactId':_0x2da755['id'],'ListId':_0x2da755[_0xbdac('0x34')],'scheduledat':_0x2da755['scheduledat']?_0x2da755[_0xbdac('0x1a')]:moment()[_0xbdac('0x1b')](_0xbdac('0x1c')),'priority':_0x2da755[_0xbdac('0x2a')]?_0x2da755[_0xbdac('0x2a')]:0x2,'callback':_0x2da755['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2da755['callbackUniqueid']?_0x2da755[_0xbdac('0x2b')]:undefined,'callbackat':_0x2da755[_0xbdac('0x2b')]?moment()['format'](_0xbdac('0x1c')):undefined,'CampaignId':_0x1eb4a2['id']})['catch'](_0x219e01());}}}});})[_0xbdac('0x20')](function(){return _0x4953da['Campaign'][_0xbdac('0x35')]({'attributes':['id'],'include':[{'model':_0x4953da[_0xbdac('0x37')],'as':_0xbdac('0x3a'),'where':{'id':_0x2da755['ListId']}}]})['then'](function(_0xb9ec44){if(_0xb9ec44){var _0x776c15=[];for(var _0x12622c=0x0,_0xba27b3;_0x12622c<_0xb9ec44[_0xbdac('0x3b')];_0x12622c+=0x1){_0xba27b3=_0xb9ec44[_0x12622c][_0xbdac('0x40')]({'plain':!![]});_0x4953da[_0xbdac('0x3c')][_0xbdac('0x29')]({'phone':_0x2da755['phone'],'ContactId':_0x2da755['id'],'ListId':_0x2da755['ListId'],'CampaignId':_0xba27b3['id']})[_0xbdac('0x30')](function(_0x330a40){logger[_0xbdac('0x17')](_0xbdac('0x41'),_0xbdac('0x31'),_0x330a40[_0xbdac('0x3d')]);});}}});})[_0xbdac('0x20')](function(){_0x3d3803();})['catch'](function(_0x7778ea){logger[_0xbdac('0x17')]('cmContact,\x20%s,\x20%s',_0xbdac('0x31'),_0x7778ea[_0xbdac('0x3d')]);_0x3d3803(_0x7778ea);});}else{_0x3d3803(new Error(_0xbdac('0x42')));}},'afterDestroy':function(_0x59f933,_0x308fe1,_0x32a5e7){var _0x378fdd=_0x17ac3e[_0xbdac('0x16')];var _0x23b5bf=_0x59f933[_0xbdac('0x40')]({'plain':!![]});return _0x378fdd['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x23b5bf[_0xbdac('0x34')],'ContactId':_0x23b5bf['id']}})[_0xbdac('0x20')](function(_0x1f2036){if(!_[_0xbdac('0x43')](_0x1f2036)){var _0x42f58b=[];for(var _0x4b0807=0x0;_0x4b0807<_0x1f2036[_0xbdac('0x3b')];_0x4b0807+=0x1){var _0x1385d6=_0x378fdd[_0xbdac('0x27')][_0xbdac('0x44')]({'where':{'ListId':_0x1f2036[_0x4b0807][_0xbdac('0x34')],'ContactId':_0x1f2036[_0x4b0807][_0xbdac('0x45')],'VoiceQueueId':_0x1f2036[_0x4b0807]['VoiceQueueId'],'CampaignId':_0x1f2036[_0x4b0807][_0xbdac('0x46')]}});_0x42f58b[_0xbdac('0x47')](_0x1385d6);}return BPromise[_0xbdac('0x48')](_0x42f58b);}})[_0xbdac('0x20')](function(_0x452232){logger[_0xbdac('0x49')](_0xbdac('0x4a'),util[_0xbdac('0x19')](_0x452232,{'showHidden':![],'depth':null}));_0x32a5e7();})[_0xbdac('0x30')](function(_0x37ba86){logger['error']('[CmContact][afterDestroy][Error]',util[_0xbdac('0x19')](_0x37ba86,{'showHidden':![],'depth':null}));_0x32a5e7(_0x37ba86);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 189121e..2d944ed 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 _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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 squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\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(_0x23502b,_0x4373f3){var _0x4539d3=function(_0x233dcb){while(--_0x233dcb){_0x23502b['push'](_0x23502b['shift']());}};_0x4539d3(++_0x4373f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 07ce2aa..4b634ae 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 _0x279d=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0x53f90c,_0x4d47bb){var _0x869887=function(_0x13aaa7){while(--_0x13aaa7){_0x53f90c['push'](_0x53f90c['shift']());}};_0x869887(++_0x4d47bb);}(_0x279d,0x1d8));var _0xd279=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x279d[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0xd279('0x0'));module[_0xd279('0x1')]={'CmContactId':{'type':Sequelize[_0xd279('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xd279('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xd279('0x4')},'OrderBy':{'type':Sequelize[_0xd279('0x2')],'defaultValue':null},'description':{'type':Sequelize['STRING'],'defaultValue':null}}; \ No newline at end of file +var _0x7980=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x2c15dd,_0x1d9094){var _0x258461=function(_0x365277){while(--_0x365277){_0x2c15dd['push'](_0x2c15dd['shift']());}};_0x258461(++_0x1d9094);}(_0x7980,0xab));var _0x0798=function(_0x591fd0,_0x4b0980){_0x591fd0=_0x591fd0-0x0;var _0x1dd034=_0x7980[_0x591fd0];return _0x1dd034;};'use strict';var Sequelize=require(_0x0798('0x0'));module[_0x0798('0x1')]={'CmContactId':{'type':Sequelize[_0x0798('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x0798('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0798('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x0798('0x4')},'OrderBy':{'type':Sequelize[_0x0798('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0798('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 bfebada..2018469 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 _0x0fa0=['querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','offset','undefined','limit','count','status','Content-Range','apply','update','then','destroy','get','CmContactHasItems','UserProfileResource','end','error','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','include','findAll','rows','catch','params','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x500fc1,_0x215ca7){var _0x4162c2=function(_0x499a6e){while(--_0x499a6e){_0x500fc1['push'](_0x500fc1['shift']());}};_0x4162c2(++_0x215ca7);}(_0x0fa0,0x89));var _0x00fa=function(_0x5181f7,_0xd27a){_0x5181f7=_0x5181f7-0x0;var _0x42c35e=_0x0fa0[_0x5181f7];return _0x42c35e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x00fa('0x0'));var rp=require(_0x00fa('0x1'));var moment=require(_0x00fa('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x00fa('0x3'));var util=require(_0x00fa('0x4'));var path=require(_0x00fa('0x5'));var sox=require('sox');var csv=require(_0x00fa('0x6'));var ejs=require(_0x00fa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00fa('0x8'));var squel=require(_0x00fa('0x9'));var crypto=require(_0x00fa('0xa'));var jsforce=require(_0x00fa('0xb'));var deskjs=require(_0x00fa('0xc'));var toCsv=require(_0x00fa('0x6'));var querystring=require(_0x00fa('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x00fa('0xe'));var qs=require(_0x00fa('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00fa('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x00fa('0x11'));var licenseUtil=require(_0x00fa('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f24a2,_0x21e26e){_0x21e26e=_0x21e26e||0xcc;return function(_0x4dbc16){if(_0x4dbc16){return _0x5f24a2[_0x00fa('0x13')](_0x21e26e);}return _0x5f24a2['status'](_0x21e26e)['end']();};}function respondWithResult(_0x55879b,_0x63925f){_0x63925f=_0x63925f||0xc8;return function(_0x3dc641){if(_0x3dc641){return _0x55879b['status'](_0x63925f)['json'](_0x3dc641);}};}function respondWithFilteredResult(_0x267804,_0x5332b3){return function(_0x230f45){if(_0x230f45){var _0xf7c405=typeof _0x5332b3[_0x00fa('0x14')]===_0x00fa('0x15')&&typeof _0x5332b3[_0x00fa('0x16')]===_0x00fa('0x15');var _0x58051e=_0x230f45[_0x00fa('0x17')];var _0x2184c2=_0xf7c405?0x0:_0x5332b3[_0x00fa('0x14')];var _0x437220=_0xf7c405?_0x230f45[_0x00fa('0x17')]:_0x5332b3[_0x00fa('0x14')]+_0x5332b3[_0x00fa('0x16')];var _0x19f00f;if(_0x437220>=_0x58051e){_0x437220=_0x58051e;_0x19f00f=0xc8;}else{_0x19f00f=0xce;}_0x267804[_0x00fa('0x18')](_0x19f00f);return _0x267804['set'](_0x00fa('0x19'),_0x2184c2+'-'+_0x437220+'/'+_0x58051e)['json'](_0x230f45);}return null;};}function patchUpdates(_0x272790){return function(_0x544b06){try{jsonpatch[_0x00fa('0x1a')](_0x544b06,_0x272790,!![]);}catch(_0x558cce){return BPromise['reject'](_0x558cce);}return _0x544b06['save']();};}function saveUpdates(_0x4ba81e,_0x1b3b04){return function(_0x26bbbd){if(_0x26bbbd){return _0x26bbbd[_0x00fa('0x1b')](_0x4ba81e)[_0x00fa('0x1c')](function(_0x2a8243){return _0x2a8243;});}return null;};}function removeEntity(_0x5b0b49,_0x53a6d9){return function(_0x9d6536){if(_0x9d6536){return _0x9d6536[_0x00fa('0x1d')]()[_0x00fa('0x1c')](function(){var _0x37bfc2=_0x9d6536[_0x00fa('0x1e')]({'plain':!![]});var _0x53947=_0x00fa('0x1f');return db[_0x00fa('0x20')][_0x00fa('0x1d')]({'where':{'type':_0x53947,'resourceId':_0x37bfc2['id']}})[_0x00fa('0x1c')](function(){return _0x9d6536;});})[_0x00fa('0x1c')](function(){_0x5b0b49[_0x00fa('0x18')](0xcc)[_0x00fa('0x21')]();});}};}function handleEntityNotFound(_0x584843,_0x5720db){return function(_0x1f908e){if(!_0x1f908e){_0x584843['sendStatus'](0x194);}return _0x1f908e;};}function handleError(_0x51193c,_0xd58633){_0xd58633=_0xd58633||0x1f4;return function(_0x22fb3f){logger[_0x00fa('0x22')](_0x22fb3f[_0x00fa('0x23')]);if(_0x22fb3f[_0x00fa('0x24')]){delete _0x22fb3f['name'];}_0x51193c['status'](_0xd58633)['send'](_0x22fb3f);};}exports[_0x00fa('0x25')]=function(_0x732c29,_0x512a68){var _0x258106={},_0x4fe230={},_0x3709e4={'count':0x0,'rows':[]};var _0x4d6ed7=_[_0x00fa('0x26')](db[_0x00fa('0x27')][_0x00fa('0x28')],function(_0x1b0a0e){return{'name':_0x1b0a0e[_0x00fa('0x29')],'type':_0x1b0a0e[_0x00fa('0x2a')][_0x00fa('0x2b')]};});_0x4fe230[_0x00fa('0x2c')]=_['map'](_0x4d6ed7,_0x00fa('0x24'));_0x4fe230[_0x00fa('0x2d')]=_[_0x00fa('0x2e')](_0x732c29[_0x00fa('0x2d')]);_0x4fe230[_0x00fa('0x2f')]=_['intersection'](_0x4fe230[_0x00fa('0x2c')],_0x4fe230[_0x00fa('0x2d')]);_0x258106[_0x00fa('0x30')]=_[_0x00fa('0x31')](_0x4fe230['model'],qs[_0x00fa('0x32')](_0x732c29[_0x00fa('0x2d')][_0x00fa('0x32')]));_0x258106[_0x00fa('0x30')]=_0x258106['attributes']['length']?_0x258106[_0x00fa('0x30')]:_0x4fe230[_0x00fa('0x2c')];if(!_0x732c29[_0x00fa('0x2d')][_0x00fa('0x33')](_0x00fa('0x34'))){_0x258106[_0x00fa('0x16')]=qs[_0x00fa('0x16')](_0x732c29[_0x00fa('0x2d')][_0x00fa('0x16')]);_0x258106[_0x00fa('0x14')]=qs[_0x00fa('0x14')](_0x732c29[_0x00fa('0x2d')][_0x00fa('0x14')]);}_0x258106[_0x00fa('0x35')]=qs[_0x00fa('0x36')](_0x732c29[_0x00fa('0x2d')]['sort']);_0x258106['where']=qs[_0x00fa('0x2f')](_['pick'](_0x732c29[_0x00fa('0x2d')],_0x4fe230[_0x00fa('0x2f')]),_0x4d6ed7);if(_0x732c29[_0x00fa('0x2d')]['filter']){_0x258106[_0x00fa('0x37')]=_['merge'](_0x258106[_0x00fa('0x37')],{'$or':_[_0x00fa('0x26')](_0x4d6ed7,function(_0x1c9501){if(_0x1c9501[_0x00fa('0x2a')]!==_0x00fa('0x38')){var _0x21e048={};_0x21e048[_0x1c9501['name']]={'$like':'%'+_0x732c29[_0x00fa('0x2d')][_0x00fa('0x39')]+'%'};return _0x21e048;}})});}_0x258106=_['merge']({},_0x258106,_0x732c29['options']);var _0x183ad8={'where':_0x258106['where']};return db['CmContactHasItem'][_0x00fa('0x17')](_0x183ad8)[_0x00fa('0x1c')](function(_0xf4b846){_0x3709e4[_0x00fa('0x17')]=_0xf4b846;if(_0x732c29['query']['includeAll']){_0x258106[_0x00fa('0x3a')]=[{'all':!![]}];}return db[_0x00fa('0x27')][_0x00fa('0x3b')](_0x258106);})[_0x00fa('0x1c')](function(_0x5420de){_0x3709e4[_0x00fa('0x3c')]=_0x5420de;return _0x3709e4;})[_0x00fa('0x1c')](respondWithFilteredResult(_0x512a68,_0x258106))[_0x00fa('0x3d')](handleError(_0x512a68,null));};exports['show']=function(_0x7c2a80,_0x2826fa){var _0x179d15={'raw':!![],'where':{'id':_0x7c2a80[_0x00fa('0x3e')]['id']}},_0x1e3c4f={};_0x1e3c4f[_0x00fa('0x2c')]=_[_0x00fa('0x2e')](db[_0x00fa('0x27')][_0x00fa('0x28')]);_0x1e3c4f['query']=_['keys'](_0x7c2a80[_0x00fa('0x2d')]);_0x1e3c4f[_0x00fa('0x2f')]=_[_0x00fa('0x31')](_0x1e3c4f[_0x00fa('0x2c')],_0x1e3c4f[_0x00fa('0x2d')]);_0x179d15[_0x00fa('0x30')]=_[_0x00fa('0x31')](_0x1e3c4f['model'],qs['fields'](_0x7c2a80[_0x00fa('0x2d')][_0x00fa('0x32')]));_0x179d15[_0x00fa('0x30')]=_0x179d15[_0x00fa('0x30')][_0x00fa('0x3f')]?_0x179d15[_0x00fa('0x30')]:_0x1e3c4f[_0x00fa('0x2c')];if(_0x7c2a80[_0x00fa('0x2d')][_0x00fa('0x40')]){_0x179d15[_0x00fa('0x3a')]=[{'all':!![]}];}_0x179d15=_[_0x00fa('0x41')]({},_0x179d15,_0x7c2a80[_0x00fa('0x42')]);return db[_0x00fa('0x27')][_0x00fa('0x43')](_0x179d15)[_0x00fa('0x1c')](handleEntityNotFound(_0x2826fa,null))[_0x00fa('0x1c')](respondWithResult(_0x2826fa,null))[_0x00fa('0x3d')](handleError(_0x2826fa,null));};exports[_0x00fa('0x44')]=function(_0x18fc08,_0x2826ee){return db[_0x00fa('0x27')][_0x00fa('0x44')](_0x18fc08[_0x00fa('0x45')],{})[_0x00fa('0x1c')](function(_0x27fb7c){var _0x5a5066=_0x18fc08[_0x00fa('0x46')][_0x00fa('0x1e')]({'plain':!![]});if(!_0x5a5066)throw new Error(_0x00fa('0x47'));if(_0x5a5066[_0x00fa('0x48')]===_0x00fa('0x46')){var _0x2b558d=_0x27fb7c[_0x00fa('0x1e')]({'plain':!![]});var _0x3ecfd0=_0x00fa('0x1f');return db['UserProfileSection'][_0x00fa('0x43')]({'where':{'name':_0x3ecfd0,'userProfileId':_0x5a5066[_0x00fa('0x49')]},'raw':!![]})[_0x00fa('0x1c')](function(_0x20fab0){if(_0x20fab0&&_0x20fab0['autoAssociation']===0x0){return db[_0x00fa('0x20')]['create']({'name':_0x2b558d[_0x00fa('0x24')],'resourceId':_0x2b558d['id'],'type':_0x20fab0['name'],'sectionId':_0x20fab0['id']},{})[_0x00fa('0x1c')](function(){return _0x27fb7c;});}else{return _0x27fb7c;}})['catch'](function(_0x37c8a8){logger[_0x00fa('0x22')](_0x00fa('0x4a'),_0x37c8a8);throw _0x37c8a8;});}return _0x27fb7c;})[_0x00fa('0x1c')](respondWithResult(_0x2826ee,0xc9))['catch'](handleError(_0x2826ee,null));};exports[_0x00fa('0x1b')]=function(_0x4583bd,_0x46e859){if(_0x4583bd[_0x00fa('0x45')]['id']){delete _0x4583bd[_0x00fa('0x45')]['id'];}return db[_0x00fa('0x27')][_0x00fa('0x43')]({'where':{'id':_0x4583bd['params']['id']}})[_0x00fa('0x1c')](handleEntityNotFound(_0x46e859,null))['then'](saveUpdates(_0x4583bd[_0x00fa('0x45')],null))[_0x00fa('0x1c')](respondWithResult(_0x46e859,null))[_0x00fa('0x3d')](handleError(_0x46e859,null));};exports[_0x00fa('0x1d')]=function(_0x28fa98,_0x483b76){return db[_0x00fa('0x27')][_0x00fa('0x43')]({'where':{'id':_0x28fa98[_0x00fa('0x3e')]['id']}})[_0x00fa('0x1c')](handleEntityNotFound(_0x483b76,null))[_0x00fa('0x1c')](removeEntity(_0x483b76,null))[_0x00fa('0x3d')](handleError(_0x483b76,null));}; \ No newline at end of file +var _0xcff3=['VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../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','limit','count','Content-Range','apply','reject','save','update','then','get','CmContactHasItems','UserProfileResource','destroy','error','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0xcff3,0x1bd));var _0x3cff=function(_0x5a636f,_0x3fec2b){_0x5a636f=_0x5a636f-0x0;var _0x6a8cfb=_0xcff3[_0x5a636f];return _0x6a8cfb;};'use strict';var emlformat=require(_0x3cff('0x0'));var rimraf=require(_0x3cff('0x1'));var zipdir=require(_0x3cff('0x2'));var jsonpatch=require(_0x3cff('0x3'));var rp=require('request-promise');var moment=require(_0x3cff('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3cff('0x5'));var path=require(_0x3cff('0x6'));var sox=require(_0x3cff('0x7'));var csv=require(_0x3cff('0x8'));var ejs=require(_0x3cff('0x9'));var fs=require('fs');var fs_extra=require(_0x3cff('0xa'));var _=require(_0x3cff('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3cff('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3cff('0x8'));var querystring=require('querystring');var Papa=require(_0x3cff('0xd'));var Redis=require(_0x3cff('0xe'));var authService=require(_0x3cff('0xf'));var qs=require(_0x3cff('0x10'));var as=require(_0x3cff('0x11'));var hardwareService=require(_0x3cff('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3cff('0x13'));var config=require(_0x3cff('0x14'));var licenseUtil=require(_0x3cff('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x493aee,_0x50dc4d){_0x50dc4d=_0x50dc4d||0xcc;return function(_0x14a027){if(_0x14a027){return _0x493aee[_0x3cff('0x16')](_0x50dc4d);}return _0x493aee[_0x3cff('0x17')](_0x50dc4d)[_0x3cff('0x18')]();};}function respondWithResult(_0x2289f3,_0x38eb80){_0x38eb80=_0x38eb80||0xc8;return function(_0x5c0393){if(_0x5c0393){return _0x2289f3['status'](_0x38eb80)[_0x3cff('0x19')](_0x5c0393);}};}function respondWithFilteredResult(_0x834019,_0x213e22){return function(_0x3d19bd){if(_0x3d19bd){var _0x2c7334=typeof _0x213e22[_0x3cff('0x1a')]===_0x3cff('0x1b')&&typeof _0x213e22[_0x3cff('0x1c')]===_0x3cff('0x1b');var _0x3a3270=_0x3d19bd[_0x3cff('0x1d')];var _0xdf8a56=_0x2c7334?0x0:_0x213e22[_0x3cff('0x1a')];var _0x144c03=_0x2c7334?_0x3d19bd[_0x3cff('0x1d')]:_0x213e22['offset']+_0x213e22[_0x3cff('0x1c')];var _0x5ec07d;if(_0x144c03>=_0x3a3270){_0x144c03=_0x3a3270;_0x5ec07d=0xc8;}else{_0x5ec07d=0xce;}_0x834019['status'](_0x5ec07d);return _0x834019['set'](_0x3cff('0x1e'),_0xdf8a56+'-'+_0x144c03+'/'+_0x3a3270)['json'](_0x3d19bd);}return null;};}function patchUpdates(_0x5f3766){return function(_0x1d01b6){try{jsonpatch[_0x3cff('0x1f')](_0x1d01b6,_0x5f3766,!![]);}catch(_0x5bdacb){return BPromise[_0x3cff('0x20')](_0x5bdacb);}return _0x1d01b6[_0x3cff('0x21')]();};}function saveUpdates(_0xf435d6,_0x4f6c3e){return function(_0x4609ee){if(_0x4609ee){return _0x4609ee[_0x3cff('0x22')](_0xf435d6)[_0x3cff('0x23')](function(_0x3c84c5){return _0x3c84c5;});}return null;};}function removeEntity(_0x33bf98,_0x266217){return function(_0x2f672d){if(_0x2f672d){return _0x2f672d['destroy']()[_0x3cff('0x23')](function(){var _0x5370c5=_0x2f672d[_0x3cff('0x24')]({'plain':!![]});var _0x11f3c0=_0x3cff('0x25');return db[_0x3cff('0x26')][_0x3cff('0x27')]({'where':{'type':_0x11f3c0,'resourceId':_0x5370c5['id']}})[_0x3cff('0x23')](function(){return _0x2f672d;});})[_0x3cff('0x23')](function(){_0x33bf98[_0x3cff('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fbe18,_0x312167){return function(_0x4d5fd2){if(!_0x4d5fd2){_0x4fbe18[_0x3cff('0x16')](0x194);}return _0x4d5fd2;};}function handleError(_0xd42b55,_0x297e5a){_0x297e5a=_0x297e5a||0x1f4;return function(_0x31f497){logger[_0x3cff('0x28')](_0x31f497[_0x3cff('0x29')]);if(_0x31f497[_0x3cff('0x2a')]){delete _0x31f497[_0x3cff('0x2a')];}_0xd42b55[_0x3cff('0x17')](_0x297e5a)[_0x3cff('0x2b')](_0x31f497);};}exports[_0x3cff('0x2c')]=function(_0x481bf3,_0x3b66a3){var _0x2296ed={},_0x251a08={},_0x18d55b={'count':0x0,'rows':[]};var _0x152880=_[_0x3cff('0x2d')](db[_0x3cff('0x2e')][_0x3cff('0x2f')],function(_0x2c6f30){return{'name':_0x2c6f30[_0x3cff('0x30')],'type':_0x2c6f30[_0x3cff('0x31')][_0x3cff('0x32')]};});_0x251a08[_0x3cff('0x33')]=_[_0x3cff('0x2d')](_0x152880,_0x3cff('0x2a'));_0x251a08[_0x3cff('0x34')]=_[_0x3cff('0x35')](_0x481bf3[_0x3cff('0x34')]);_0x251a08[_0x3cff('0x36')]=_['intersection'](_0x251a08[_0x3cff('0x33')],_0x251a08['query']);_0x2296ed[_0x3cff('0x37')]=_[_0x3cff('0x38')](_0x251a08[_0x3cff('0x33')],qs[_0x3cff('0x39')](_0x481bf3[_0x3cff('0x34')][_0x3cff('0x39')]));_0x2296ed[_0x3cff('0x37')]=_0x2296ed[_0x3cff('0x37')][_0x3cff('0x3a')]?_0x2296ed[_0x3cff('0x37')]:_0x251a08['model'];if(!_0x481bf3[_0x3cff('0x34')][_0x3cff('0x3b')](_0x3cff('0x3c'))){_0x2296ed[_0x3cff('0x1c')]=qs[_0x3cff('0x1c')](_0x481bf3[_0x3cff('0x34')][_0x3cff('0x1c')]);_0x2296ed[_0x3cff('0x1a')]=qs[_0x3cff('0x1a')](_0x481bf3[_0x3cff('0x34')][_0x3cff('0x1a')]);}_0x2296ed[_0x3cff('0x3d')]=qs['sort'](_0x481bf3['query'][_0x3cff('0x3e')]);_0x2296ed[_0x3cff('0x3f')]=qs[_0x3cff('0x36')](_[_0x3cff('0x40')](_0x481bf3[_0x3cff('0x34')],_0x251a08[_0x3cff('0x36')]),_0x152880);if(_0x481bf3[_0x3cff('0x34')]['filter']){_0x2296ed[_0x3cff('0x3f')]=_['merge'](_0x2296ed[_0x3cff('0x3f')],{'$or':_[_0x3cff('0x2d')](_0x152880,function(_0x3fcdbc){if(_0x3fcdbc[_0x3cff('0x31')]!==_0x3cff('0x41')){var _0x337a37={};_0x337a37[_0x3fcdbc[_0x3cff('0x2a')]]={'$like':'%'+_0x481bf3[_0x3cff('0x34')][_0x3cff('0x42')]+'%'};return _0x337a37;}})});}_0x2296ed=_[_0x3cff('0x43')]({},_0x2296ed,_0x481bf3[_0x3cff('0x44')]);var _0x5da783={'where':_0x2296ed[_0x3cff('0x3f')]};return db[_0x3cff('0x2e')][_0x3cff('0x1d')](_0x5da783)[_0x3cff('0x23')](function(_0x1e0e60){_0x18d55b[_0x3cff('0x1d')]=_0x1e0e60;if(_0x481bf3[_0x3cff('0x34')]['includeAll']){_0x2296ed[_0x3cff('0x45')]=[{'all':!![]}];}return db[_0x3cff('0x2e')][_0x3cff('0x46')](_0x2296ed);})[_0x3cff('0x23')](function(_0x7885f3){_0x18d55b[_0x3cff('0x47')]=_0x7885f3;return _0x18d55b;})[_0x3cff('0x23')](respondWithFilteredResult(_0x3b66a3,_0x2296ed))[_0x3cff('0x48')](handleError(_0x3b66a3,null));};exports[_0x3cff('0x49')]=function(_0x7576c2,_0x5bc801){var _0x55b726={'raw':!![],'where':{'id':_0x7576c2[_0x3cff('0x4a')]['id']}},_0x4b94b9={};_0x4b94b9['model']=_[_0x3cff('0x35')](db['CmContactHasItem']['rawAttributes']);_0x4b94b9['query']=_[_0x3cff('0x35')](_0x7576c2['query']);_0x4b94b9[_0x3cff('0x36')]=_[_0x3cff('0x38')](_0x4b94b9[_0x3cff('0x33')],_0x4b94b9[_0x3cff('0x34')]);_0x55b726[_0x3cff('0x37')]=_['intersection'](_0x4b94b9[_0x3cff('0x33')],qs[_0x3cff('0x39')](_0x7576c2['query'][_0x3cff('0x39')]));_0x55b726[_0x3cff('0x37')]=_0x55b726[_0x3cff('0x37')][_0x3cff('0x3a')]?_0x55b726[_0x3cff('0x37')]:_0x4b94b9[_0x3cff('0x33')];if(_0x7576c2[_0x3cff('0x34')][_0x3cff('0x4b')]){_0x55b726['include']=[{'all':!![]}];}_0x55b726=_['merge']({},_0x55b726,_0x7576c2[_0x3cff('0x44')]);return db[_0x3cff('0x2e')][_0x3cff('0x4c')](_0x55b726)[_0x3cff('0x23')](handleEntityNotFound(_0x5bc801,null))['then'](respondWithResult(_0x5bc801,null))[_0x3cff('0x48')](handleError(_0x5bc801,null));};exports[_0x3cff('0x4d')]=function(_0x25d537,_0x5b36b7){return db[_0x3cff('0x2e')][_0x3cff('0x4d')](_0x25d537['body'],{})['then'](function(_0x28da2d){var _0x2ad5c1=_0x25d537[_0x3cff('0x4e')][_0x3cff('0x24')]({'plain':!![]});if(!_0x2ad5c1)throw new Error(_0x3cff('0x4f'));if(_0x2ad5c1['role']===_0x3cff('0x4e')){var _0x2206f7=_0x28da2d[_0x3cff('0x24')]({'plain':!![]});var _0x5ed828='CmContactHasItems';return db[_0x3cff('0x50')][_0x3cff('0x4c')]({'where':{'name':_0x5ed828,'userProfileId':_0x2ad5c1[_0x3cff('0x51')]},'raw':!![]})[_0x3cff('0x23')](function(_0x5aad01){if(_0x5aad01&&_0x5aad01[_0x3cff('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x2206f7[_0x3cff('0x2a')],'resourceId':_0x2206f7['id'],'type':_0x5aad01[_0x3cff('0x2a')],'sectionId':_0x5aad01['id']},{})['then'](function(){return _0x28da2d;});}else{return _0x28da2d;}})[_0x3cff('0x48')](function(_0x1a8edb){logger[_0x3cff('0x28')](_0x3cff('0x53'),_0x1a8edb);throw _0x1a8edb;});}return _0x28da2d;})[_0x3cff('0x23')](respondWithResult(_0x5b36b7,0xc9))[_0x3cff('0x48')](handleError(_0x5b36b7,null));};exports['update']=function(_0x4b60b0,_0x386dac){if(_0x4b60b0[_0x3cff('0x54')]['id']){delete _0x4b60b0[_0x3cff('0x54')]['id'];}return db[_0x3cff('0x2e')][_0x3cff('0x4c')]({'where':{'id':_0x4b60b0['params']['id']}})[_0x3cff('0x23')](handleEntityNotFound(_0x386dac,null))[_0x3cff('0x23')](saveUpdates(_0x4b60b0['body'],null))[_0x3cff('0x23')](respondWithResult(_0x386dac,null))[_0x3cff('0x48')](handleError(_0x386dac,null));};exports[_0x3cff('0x27')]=function(_0x230ea0,_0x5f128b){return db[_0x3cff('0x2e')]['find']({'where':{'id':_0x230ea0[_0x3cff('0x4a')]['id']}})[_0x3cff('0x23')](handleEntityNotFound(_0x5f128b,null))[_0x3cff('0x23')](removeEntity(_0x5f128b,null))[_0x3cff('0x48')](handleError(_0x5f128b,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 02e6d73..98a36a5 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 _0x9aab=['rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1bfae6,_0x323af8){var _0x2d8c3b=function(_0x272ec2){while(--_0x272ec2){_0x1bfae6['push'](_0x1bfae6['shift']());}};_0x2d8c3b(++_0x323af8);}(_0x9aab,0x103));var _0xb9aa=function(_0x54fe18,_0x4d9d89){_0x54fe18=_0x54fe18-0x0;var _0xdbde89=_0x9aab[_0x54fe18];return _0xdbde89;};'use strict';var _=require(_0xb9aa('0x0'));var util=require(_0xb9aa('0x1'));var logger=require(_0xb9aa('0x2'))(_0xb9aa('0x3'));var moment=require('moment');var BPromise=require(_0xb9aa('0x4'));var rp=require(_0xb9aa('0x5'));var fs=require('fs');var path=require(_0xb9aa('0x6'));var rimraf=require(_0xb9aa('0x7'));var config=require(_0xb9aa('0x8'));var attributes=require(_0xb9aa('0x9'));module[_0xb9aa('0xa')]=function(_0x1fc9cb,_0x1fcf04){return _0x1fc9cb[_0xb9aa('0xb')](_0xb9aa('0xc'),attributes,{'tableName':_0xb9aa('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6f3=['rimraf','../../config/environment','./cmContactHasItem.attributes','cm_contact_has_items','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf6f3,0xee));var _0x3f6f=function(_0x322548,_0x3e7823){_0x322548=_0x322548-0x0;var _0x5b1df6=_0xf6f3[_0x322548];return _0x5b1df6;};'use strict';var _=require('lodash');var util=require(_0x3f6f('0x0'));var logger=require(_0x3f6f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3f6f('0x2'));var rp=require(_0x3f6f('0x3'));var fs=require('fs');var path=require(_0x3f6f('0x4'));var rimraf=require(_0x3f6f('0x5'));var config=require(_0x3f6f('0x6'));var attributes=require(_0x3f6f('0x7'));module['exports']=function(_0x3446e6,_0x58046e){return _0x3446e6['define']('CmContactHasItem',attributes,{'tableName':_0x3f6f('0x8'),'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 6e077ea..a1ddc2a 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 _0x7c2f=['result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message'];(function(_0x1d3cbe,_0x5a1aca){var _0x178bea=function(_0x4339a4){while(--_0x4339a4){_0x1d3cbe['push'](_0x1d3cbe['shift']());}};_0x178bea(++_0x5a1aca);}(_0x7c2f,0x12d));var _0xf7c2=function(_0x2d75b5,_0x4f2d0b){_0x2d75b5=_0x2d75b5-0x0;var _0x2a4fc1=_0x7c2f[_0x2d75b5];return _0x2a4fc1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf7c2('0x0'));var BPromise=require(_0xf7c2('0x1'));var rs=require(_0xf7c2('0x2'));var fs=require('fs');var Redis=require(_0xf7c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf7c2('0x4'));var logger=require(_0xf7c2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7c2('0x6')][_0xf7c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfe0ad5,_0x36289e,_0x60001b){return new BPromise(function(_0x11bfdc,_0x386a01){return client[_0xf7c2('0x8')](_0xfe0ad5,_0x60001b)[_0xf7c2('0x9')](function(_0x2109bd){logger[_0xf7c2('0xa')]('CmContactHasItem,\x20%s,\x20%s',_0x36289e,_0xf7c2('0xb'));logger[_0xf7c2('0xc')](_0xf7c2('0xd'),_0x36289e,_0xf7c2('0xb'),JSON[_0xf7c2('0xe')](_0x2109bd));if(_0x2109bd[_0xf7c2('0xf')]){if(_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x10')]===0x1f4){logger[_0xf7c2('0xf')](_0xf7c2('0x11'),_0x36289e,_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x12')]);return _0x386a01(_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x12')]);}logger[_0xf7c2('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x36289e,_0x2109bd['error'][_0xf7c2('0x12')]);return _0x11bfdc(_0x2109bd[_0xf7c2('0xf')][_0xf7c2('0x12')]);}else{logger[_0xf7c2('0xa')](_0xf7c2('0x11'),_0x36289e,'request\x20sent');_0x11bfdc(_0x2109bd[_0xf7c2('0x13')]['message']);}})['catch'](function(_0x387087){logger['error'](_0xf7c2('0x11'),_0x36289e,_0x387087);_0x386a01(_0x387087);});});} \ No newline at end of file +var _0x2769=['lodash','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','then','CmContactHasItem,\x20%s,\x20%s','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0x2769,0x1d4));var _0x9276=function(_0x3ecd69,_0x38156d){_0x3ecd69=_0x3ecd69-0x0;var _0x211b0e=_0x2769[_0x3ecd69];return _0x211b0e;};'use strict';var _=require(_0x9276('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9276('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9276('0x2'))(_0x9276('0x3'));var config=require('../../config/environment');var jayson=require(_0x9276('0x4'));var client=jayson[_0x9276('0x5')][_0x9276('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3fd939,_0x197f41,_0x46f465){return new BPromise(function(_0x200131,_0x45396a){return client[_0x9276('0x7')](_0x3fd939,_0x46f465)[_0x9276('0x8')](function(_0x276cf8){logger['info'](_0x9276('0x9'),_0x197f41,'request\x20sent');logger[_0x9276('0xa')](_0x9276('0xb'),_0x197f41,_0x9276('0xc'),JSON[_0x9276('0xd')](_0x276cf8));if(_0x276cf8[_0x9276('0xe')]){if(_0x276cf8['error']['code']===0x1f4){logger['error'](_0x9276('0x9'),_0x197f41,_0x276cf8[_0x9276('0xe')][_0x9276('0xf')]);return _0x45396a(_0x276cf8['error']['message']);}logger[_0x9276('0xe')](_0x9276('0x9'),_0x197f41,_0x276cf8[_0x9276('0xe')][_0x9276('0xf')]);return _0x200131(_0x276cf8[_0x9276('0xe')][_0x9276('0xf')]);}else{logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x197f41,_0x9276('0xc'));_0x200131(_0x276cf8[_0x9276('0x10')]['message']);}})[_0x9276('0x11')](function(_0xd6679e){logger[_0x9276('0xe')](_0x9276('0x9'),_0x197f41,_0xd6679e);_0x45396a(_0xd6679e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index bed112c..f3f87ed 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 _0x670c=['./cmContactHasItem.controller','get','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../config/environment'];(function(_0x58e4d6,_0x1d5502){var _0x1e22d3=function(_0x365d7b){while(--_0x365d7b){_0x58e4d6['push'](_0x58e4d6['shift']());}};_0x1e22d3(++_0x1d5502);}(_0x670c,0x12c));var _0xc670=function(_0x120b6e,_0x1bb1d5){_0x120b6e=_0x120b6e-0x0;var _0x2050a4=_0x670c[_0x120b6e];return _0x2050a4;};'use strict';var multer=require(_0xc670('0x0'));var util=require(_0xc670('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc670('0x2'));var router=express[_0xc670('0x3')]();var fs_extra=require(_0xc670('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc670('0x5'));var controller=require(_0xc670('0x6'));router[_0xc670('0x7')]('/',auth['isAuthenticated'](),controller[_0xc670('0x8')]);router[_0xc670('0x7')](_0xc670('0x9'),auth[_0xc670('0xa')](),controller[_0xc670('0xb')]);router[_0xc670('0xc')]('/',auth[_0xc670('0xa')](),controller['create']);router[_0xc670('0xd')](_0xc670('0x9'),auth[_0xc670('0xa')](),controller[_0xc670('0xe')]);router[_0xc670('0xf')](_0xc670('0x9'),auth[_0xc670('0xa')](),controller[_0xc670('0x10')]);module[_0xc670('0x11')]=router; \ No newline at end of file +var _0x17fd=['delete','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0x1e8233,_0x3555a6){var _0x841eb4=function(_0x556b40){while(--_0x556b40){_0x1e8233['push'](_0x1e8233['shift']());}};_0x841eb4(++_0x3555a6);}(_0x17fd,0x78));var _0xd17f=function(_0x52daca,_0x34cf60){_0x52daca=_0x52daca-0x0;var _0xdea1df=_0x17fd[_0x52daca];return _0xdea1df;};'use strict';var multer=require(_0xd17f('0x0'));var util=require(_0xd17f('0x1'));var path=require(_0xd17f('0x2'));var timeout=require(_0xd17f('0x3'));var express=require(_0xd17f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd17f('0x5'));var config=require(_0xd17f('0x6'));var controller=require(_0xd17f('0x7'));router['get']('/',auth[_0xd17f('0x8')](),controller[_0xd17f('0x9')]);router[_0xd17f('0xa')](_0xd17f('0xb'),auth[_0xd17f('0x8')](),controller['show']);router[_0xd17f('0xc')]('/',auth[_0xd17f('0x8')](),controller[_0xd17f('0xd')]);router[_0xd17f('0xe')](_0xd17f('0xb'),auth[_0xd17f('0x8')](),controller[_0xd17f('0xf')]);router[_0xd17f('0x10')](_0xd17f('0xb'),auth[_0xd17f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 88ae41f..0711081 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 _0x1ef0=['STRING','name','TEXT','long','type','select','values','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','alias'];(function(_0x40b4da,_0x1df84d){var _0x5c2f04=function(_0x121bdd){while(--_0x121bdd){_0x40b4da['push'](_0x40b4da['shift']());}};_0x5c2f04(++_0x1df84d);}(_0x1ef0,0x10b));var _0x01ef=function(_0x589fb1,_0x5d8fb5){_0x589fb1=_0x589fb1-0x0;var _0x12195c=_0x1ef0[_0x589fb1];return _0x12195c;};'use strict';var Sequelize=require(_0x01ef('0x0'));var _=require(_0x01ef('0x1'));module[_0x01ef('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xe3e877){return this[_0x01ef('0x3')](_0x01ef('0x4'));}},'alias':{'type':Sequelize[_0x01ef('0x5')],'allowNull':![],'set':function(_0x3cf999){this['setDataValue'](_0x01ef('0x4'),_0x3cf999?_0x3cf999:this[_0x01ef('0x3')](_0x01ef('0x6')));}},'type':{'type':Sequelize[_0x01ef('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x01ef('0x7')](_0x01ef('0x8')),'get':function(){if(this[_0x01ef('0x3')](_0x01ef('0x9'))===_0x01ef('0xa')){return JSON['parse'](this[_0x01ef('0x3')](_0x01ef('0xb')));}else{return this['getDataValue'](_0x01ef('0xb'));}},'set':function(_0x573834){if(Array['isArray'](_0x573834)){this[_0x01ef('0xc')](_0x01ef('0xb'),JSON[_0x01ef('0xd')](_0x573834));}else{this['setDataValue'](_0x01ef('0xb'),_0x573834);}}},'required':{'type':Sequelize[_0x01ef('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x01ef('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x01ef('0xf')](_0x01ef('0x10'))}}; \ No newline at end of file +var _0x5352=['STRING','setDataValue','getDataValue','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','exports','VIRTUAL','alias'];(function(_0x523fc3,_0x4c9a19){var _0x59b2fe=function(_0x2efb72){while(--_0x2efb72){_0x523fc3['push'](_0x523fc3['shift']());}};_0x59b2fe(++_0x4c9a19);}(_0x5352,0x11d));var _0x2535=function(_0x10ac1c,_0x1e6143){_0x10ac1c=_0x10ac1c-0x0;var _0x8ecd64=_0x5352[_0x10ac1c];return _0x8ecd64;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x2535('0x0')]={'name':{'type':Sequelize[_0x2535('0x1')],'get':function(_0x5f3e77){return this['getDataValue'](_0x2535('0x2'));}},'alias':{'type':Sequelize[_0x2535('0x3')],'allowNull':![],'set':function(_0x263dff){this[_0x2535('0x4')](_0x2535('0x2'),_0x263dff?_0x263dff:this[_0x2535('0x5')]('name'));}},'type':{'type':Sequelize[_0x2535('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x2535('0x6')](_0x2535('0x7')),'get':function(){if(this['getDataValue'](_0x2535('0x8'))===_0x2535('0x9')){return JSON[_0x2535('0xa')](this[_0x2535('0x5')](_0x2535('0xb')));}else{return this['getDataValue'](_0x2535('0xb'));}},'set':function(_0x15f8ac){if(Array[_0x2535('0xc')](_0x15f8ac)){this[_0x2535('0x4')](_0x2535('0xb'),JSON[_0x2535('0xd')](_0x15f8ac));}else{this['setDataValue'](_0x2535('0xb'),_0x15f8ac);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x2535('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2535('0xf')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index b807c44..6f467e0 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 _0x070a=['name','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','show','keys','length','find','catch','body','params','create','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','json','reject','save','then','sendStatus','stack'];(function(_0x5495a0,_0x217a9e){var _0x5d0871=function(_0x4738d6){while(--_0x4738d6){_0x5495a0['push'](_0x5495a0['shift']());}};_0x5d0871(++_0x217a9e);}(_0x070a,0x79));var _0xa070=function(_0x1e9475,_0x13cf56){_0x1e9475=_0x1e9475-0x0;var _0x48d33f=_0x070a[_0x1e9475];return _0x48d33f;};'use strict';var emlformat=require(_0xa070('0x0'));var rimraf=require(_0xa070('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa070('0x2'));var rp=require(_0xa070('0x3'));var moment=require(_0xa070('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa070('0x5'));var util=require(_0xa070('0x6'));var path=require(_0xa070('0x7'));var sox=require(_0xa070('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa070('0x9'));var _=require('lodash');var squel=require(_0xa070('0xa'));var crypto=require(_0xa070('0xb'));var jsforce=require(_0xa070('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa070('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa070('0xe'));var authService=require(_0xa070('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa070('0x10'));var logger=require(_0xa070('0x11'))(_0xa070('0x12'));var utils=require(_0xa070('0x13'));var config=require(_0xa070('0x14'));var licenseUtil=require(_0xa070('0x15'));var db=require(_0xa070('0x16'))['db'];function respondWithStatusCode(_0x556d69,_0x56482d){_0x56482d=_0x56482d||0xcc;return function(_0x246e1c){if(_0x246e1c){return _0x556d69['sendStatus'](_0x56482d);}return _0x556d69[_0xa070('0x17')](_0x56482d)[_0xa070('0x18')]();};}function respondWithResult(_0x4b7c29,_0x3de8ce){_0x3de8ce=_0x3de8ce||0xc8;return function(_0x39b399){if(_0x39b399){return _0x4b7c29['status'](_0x3de8ce)['json'](_0x39b399);}};}function respondWithFilteredResult(_0x1545bf,_0x44d2fa){return function(_0x40578a){if(_0x40578a){var _0x35e829=typeof _0x44d2fa[_0xa070('0x19')]===_0xa070('0x1a')&&typeof _0x44d2fa['limit']==='undefined';var _0x1df3f7=_0x40578a[_0xa070('0x1b')];var _0x3bc25d=_0x35e829?0x0:_0x44d2fa[_0xa070('0x19')];var _0x11e9d9=_0x35e829?_0x40578a[_0xa070('0x1b')]:_0x44d2fa[_0xa070('0x19')]+_0x44d2fa['limit'];var _0x1bad4b;if(_0x11e9d9>=_0x1df3f7){_0x11e9d9=_0x1df3f7;_0x1bad4b=0xc8;}else{_0x1bad4b=0xce;}_0x1545bf['status'](_0x1bad4b);return _0x1545bf[_0xa070('0x1c')]('Content-Range',_0x3bc25d+'-'+_0x11e9d9+'/'+_0x1df3f7)[_0xa070('0x1d')](_0x40578a);}return null;};}function patchUpdates(_0x1b7647){return function(_0x278cfe){try{jsonpatch['apply'](_0x278cfe,_0x1b7647,!![]);}catch(_0x22d749){return BPromise[_0xa070('0x1e')](_0x22d749);}return _0x278cfe[_0xa070('0x1f')]();};}function saveUpdates(_0x4b826b,_0x1f202c){return function(_0x1a8f18){if(_0x1a8f18){return _0x1a8f18['update'](_0x4b826b)[_0xa070('0x20')](function(_0x109900){return _0x109900;});}return null;};}function removeEntity(_0x4cb321,_0x499d77){return function(_0x3be719){if(_0x3be719){return _0x3be719['destroy']()[_0xa070('0x20')](function(){_0x4cb321[_0xa070('0x17')](0xcc)[_0xa070('0x18')]();});}};}function handleEntityNotFound(_0x4af00c,_0x227b43){return function(_0x6c7e55){if(!_0x6c7e55){_0x4af00c[_0xa070('0x21')](0x194);}return _0x6c7e55;};}function handleError(_0x46658f,_0x310f1c){_0x310f1c=_0x310f1c||0x1f4;return function(_0x1e8092){logger['error'](_0x1e8092[_0xa070('0x22')]);if(_0x1e8092['name']){delete _0x1e8092[_0xa070('0x23')];}_0x46658f[_0xa070('0x17')](_0x310f1c)['send'](_0x1e8092);};}exports[_0xa070('0x24')]=function(_0x918952,_0x383cc8){var _0x38357d={},_0x3346dd={},_0x1718be={'count':0x0,'rows':[]};var _0x119150=_[_0xa070('0x25')](db[_0xa070('0x26')][_0xa070('0x27')],function(_0x71ad79){return{'name':_0x71ad79[_0xa070('0x28')],'type':_0x71ad79[_0xa070('0x29')][_0xa070('0x2a')]};});_0x3346dd[_0xa070('0x2b')]=_['differenceBy'](_['map'](_0x119150,_0xa070('0x23')),[_0xa070('0x23')]);_0x3346dd['query']=_['keys'](_0x918952[_0xa070('0x2c')]);_0x3346dd['filters']=_[_0xa070('0x2d')](_0x3346dd[_0xa070('0x2b')],_0x3346dd[_0xa070('0x2c')]);_0x38357d[_0xa070('0x2e')]=_['intersection'](_0x3346dd[_0xa070('0x2b')],qs[_0xa070('0x2f')](_0x918952['query'][_0xa070('0x2f')]));_0x38357d[_0xa070('0x2e')]=_0x38357d[_0xa070('0x2e')]['length']?_0x38357d[_0xa070('0x2e')]:_0x3346dd[_0xa070('0x2b')];if(!_0x918952['query'][_0xa070('0x30')]('nolimit')){_0x38357d[_0xa070('0x31')]=qs[_0xa070('0x31')](_0x918952[_0xa070('0x2c')][_0xa070('0x31')]);_0x38357d['offset']=qs[_0xa070('0x19')](_0x918952['query']['offset']);}_0x38357d['order']=qs[_0xa070('0x32')](_0x918952[_0xa070('0x2c')][_0xa070('0x32')]);_0x38357d[_0xa070('0x33')]=qs[_0xa070('0x34')](_['pick'](_0x918952[_0xa070('0x2c')],_0x3346dd['filters']),_0x119150);if(_0x918952['query'][_0xa070('0x35')]){_0x38357d[_0xa070('0x33')]=_[_0xa070('0x36')](_0x38357d[_0xa070('0x33')],{'$or':_[_0xa070('0x25')](_0x119150,function(_0x59748e){if(_0x59748e['type']!=='VIRTUAL'){var _0x5b8a66={};_0x5b8a66[_0x59748e[_0xa070('0x23')]]={'$like':'%'+_0x918952[_0xa070('0x2c')][_0xa070('0x35')]+'%'};return _0x5b8a66;}})});}_0x38357d=_[_0xa070('0x36')]({},_0x38357d,_0x918952[_0xa070('0x37')]);var _0x4e5994={'where':_0x38357d['where']};return db['CmCustomField'][_0xa070('0x1b')](_0x4e5994)[_0xa070('0x20')](function(_0x55257b){_0x1718be[_0xa070('0x1b')]=_0x55257b;if(_0x918952['query'][_0xa070('0x38')]){_0x38357d[_0xa070('0x39')]=[{'all':!![]}];}return db[_0xa070('0x26')][_0xa070('0x3a')](_0x38357d);})[_0xa070('0x20')](function(_0x469271){_0x1718be[_0xa070('0x3b')]=_0x469271;return _0x1718be;})[_0xa070('0x20')](respondWithFilteredResult(_0x383cc8,_0x38357d))['catch'](handleError(_0x383cc8,null));};exports[_0xa070('0x3c')]=function(_0x3fbbf3,_0xc1e5b5){var _0x30cf19={'raw':!![],'where':{'id':_0x3fbbf3['params']['id']}},_0x53f9f1={};_0x53f9f1[_0xa070('0x2b')]=_[_0xa070('0x3d')](db['CmCustomField'][_0xa070('0x27')]);_0x53f9f1['query']=_[_0xa070('0x3d')](_0x3fbbf3[_0xa070('0x2c')]);_0x53f9f1[_0xa070('0x34')]=_[_0xa070('0x2d')](_0x53f9f1['model'],_0x53f9f1['query']);_0x30cf19['attributes']=_[_0xa070('0x2d')](_0x53f9f1['model'],qs[_0xa070('0x2f')](_0x3fbbf3[_0xa070('0x2c')][_0xa070('0x2f')]));_0x30cf19['attributes']=_0x30cf19['attributes'][_0xa070('0x3e')]?_0x30cf19[_0xa070('0x2e')]:_0x53f9f1['model'];if(_0x3fbbf3['query'][_0xa070('0x38')]){_0x30cf19[_0xa070('0x39')]=[{'all':!![]}];}_0x30cf19=_[_0xa070('0x36')]({},_0x30cf19,_0x3fbbf3[_0xa070('0x37')]);return db[_0xa070('0x26')][_0xa070('0x3f')](_0x30cf19)[_0xa070('0x20')](handleEntityNotFound(_0xc1e5b5,null))[_0xa070('0x20')](respondWithResult(_0xc1e5b5,null))[_0xa070('0x40')](handleError(_0xc1e5b5,null));};exports['update']=function(_0x2dba6c,_0x51a466){if(_0x2dba6c[_0xa070('0x41')]['id']){delete _0x2dba6c[_0xa070('0x41')]['id'];}return db[_0xa070('0x26')][_0xa070('0x3f')]({'where':{'id':_0x2dba6c[_0xa070('0x42')]['id']}})[_0xa070('0x20')](handleEntityNotFound(_0x51a466,null))[_0xa070('0x20')](saveUpdates(_0x2dba6c[_0xa070('0x41')],null))[_0xa070('0x20')](respondWithResult(_0x51a466,null))['catch'](handleError(_0x51a466,null));};exports['destroy']=function(_0x4d7f36,_0x4cfcef){return db['CmCustomField'][_0xa070('0x3f')]({'where':{'id':_0x4d7f36[_0xa070('0x42')]['id']}})[_0xa070('0x20')](handleEntityNotFound(_0x4cfcef,null))['then'](removeEntity(_0x4cfcef,null))['catch'](handleError(_0x4cfcef,null));};exports[_0xa070('0x43')]=function(_0x1da4be,_0x1f4bbe){var _0xc50446;return db['sequelize']['transaction'](function(_0x3b21a7){return db[_0xa070('0x26')]['create'](_0x1da4be[_0xa070('0x41')],{'transaction':_0x3b21a7})['then'](function(_0x3a1d96){_0xc50446=_0x3a1d96;var _0x2c297c={'type':db[_0xa070('0x44')][_0xa070('0x45')],'transaction':_0x3b21a7};switch(_0x1da4be[_0xa070('0x41')][_0xa070('0x29')]){case _0xa070('0x46'):_0x2c297c['type']=db[_0xa070('0x44')][_0xa070('0x45')];break;case _0xa070('0x47'):_0x2c297c['type']=db['Sequelize']['INTEGER'];break;case _0xa070('0x48'):_0x2c297c[_0xa070('0x29')]=db[_0xa070('0x44')][_0xa070('0x49')];_0x2c297c[_0xa070('0x4a')]=![];break;default:}return db[_0xa070('0x4b')][_0xa070('0x4c')]['addColumn'](_0xa070('0x4d'),util['format']('cf_%d',_0xc50446['id']),_0x2c297c);})[_0xa070('0x20')](function(){return _0xc50446;});})[_0xa070('0x20')](respondWithResult(_0x1f4bbe,0xc9))[_0xa070('0x40')](handleError(_0x1f4bbe,null));}; \ No newline at end of file +var _0xe0ef=['key','model','differenceBy','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','options','CmCustomField','includeAll','include','findAll','catch','show','params','keys','update','body','find','destroy','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','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','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','save','then','sendStatus','error','stack','name','index','rawAttributes','fieldName'];(function(_0x2203ac,_0x5ef46f){var _0xd0c2d9=function(_0x4b2ceb){while(--_0x4b2ceb){_0x2203ac['push'](_0x2203ac['shift']());}};_0xd0c2d9(++_0x5ef46f);}(_0xe0ef,0x183));var _0xfe0e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe0ef[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0xfe0e('0x0'));var rimraf=require(_0xfe0e('0x1'));var zipdir=require(_0xfe0e('0x2'));var jsonpatch=require(_0xfe0e('0x3'));var rp=require('request-promise');var moment=require(_0xfe0e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfe0e('0x5'));var util=require(_0xfe0e('0x6'));var path=require(_0xfe0e('0x7'));var sox=require(_0xfe0e('0x8'));var csv=require('to-csv');var ejs=require(_0xfe0e('0x9'));var fs=require('fs');var fs_extra=require(_0xfe0e('0xa'));var _=require('lodash');var squel=require(_0xfe0e('0xb'));var crypto=require(_0xfe0e('0xc'));var jsforce=require(_0xfe0e('0xd'));var deskjs=require(_0xfe0e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xfe0e('0xf'));var Papa=require(_0xfe0e('0x10'));var Redis=require(_0xfe0e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfe0e('0x12'));var as=require(_0xfe0e('0x13'));var hardwareService=require(_0xfe0e('0x14'));var logger=require(_0xfe0e('0x15'))('api');var utils=require(_0xfe0e('0x16'));var config=require(_0xfe0e('0x17'));var licenseUtil=require(_0xfe0e('0x18'));var db=require(_0xfe0e('0x19'))['db'];function respondWithStatusCode(_0x425359,_0x2ffee8){_0x2ffee8=_0x2ffee8||0xcc;return function(_0x9b4aff){if(_0x9b4aff){return _0x425359['sendStatus'](_0x2ffee8);}return _0x425359[_0xfe0e('0x1a')](_0x2ffee8)[_0xfe0e('0x1b')]();};}function respondWithResult(_0x58c229,_0x1ef01c){_0x1ef01c=_0x1ef01c||0xc8;return function(_0x45f34d){if(_0x45f34d){return _0x58c229[_0xfe0e('0x1a')](_0x1ef01c)[_0xfe0e('0x1c')](_0x45f34d);}};}function respondWithFilteredResult(_0x566895,_0x1d9735){return function(_0x2195f0){if(_0x2195f0){var _0x25e250=typeof _0x1d9735['offset']===_0xfe0e('0x1d')&&typeof _0x1d9735[_0xfe0e('0x1e')]==='undefined';var _0x2ecf9b=_0x2195f0[_0xfe0e('0x1f')];var _0x1379b6=_0x25e250?0x0:_0x1d9735['offset'];var _0x578c13=_0x25e250?_0x2195f0[_0xfe0e('0x1f')]:_0x1d9735[_0xfe0e('0x20')]+_0x1d9735[_0xfe0e('0x1e')];var _0x248266;if(_0x578c13>=_0x2ecf9b){_0x578c13=_0x2ecf9b;_0x248266=0xc8;}else{_0x248266=0xce;}_0x566895['status'](_0x248266);return _0x566895['set'](_0xfe0e('0x21'),_0x1379b6+'-'+_0x578c13+'/'+_0x2ecf9b)[_0xfe0e('0x1c')](_0x2195f0);}return null;};}function patchUpdates(_0x40ed11){return function(_0x33308d){try{jsonpatch['apply'](_0x33308d,_0x40ed11,!![]);}catch(_0x425972){return BPromise['reject'](_0x425972);}return _0x33308d[_0xfe0e('0x22')]();};}function saveUpdates(_0x218131,_0x38dd6f){return function(_0x5c0648){if(_0x5c0648){return _0x5c0648['update'](_0x218131)[_0xfe0e('0x23')](function(_0x479bef){return _0x479bef;});}return null;};}function removeEntity(_0x24588a,_0x4fbf28){return function(_0x1a3714){if(_0x1a3714){return _0x1a3714['destroy']()[_0xfe0e('0x23')](function(){_0x24588a[_0xfe0e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x312ee1,_0x1604e0){return function(_0x46215a){if(!_0x46215a){_0x312ee1[_0xfe0e('0x24')](0x194);}return _0x46215a;};}function handleError(_0x11f4dc,_0x298672){_0x298672=_0x298672||0x1f4;return function(_0x1ba62c){logger[_0xfe0e('0x25')](_0x1ba62c[_0xfe0e('0x26')]);if(_0x1ba62c[_0xfe0e('0x27')]){delete _0x1ba62c[_0xfe0e('0x27')];}_0x11f4dc[_0xfe0e('0x1a')](_0x298672)['send'](_0x1ba62c);};}exports[_0xfe0e('0x28')]=function(_0x2ebf2f,_0x45e5e2){var _0x305561={},_0x2f1e0b={},_0x358569={'count':0x0,'rows':[]};var _0x450af6=_['map'](db['CmCustomField'][_0xfe0e('0x29')],function(_0x4a3dcc){return{'name':_0x4a3dcc[_0xfe0e('0x2a')],'type':_0x4a3dcc['type'][_0xfe0e('0x2b')]};});_0x2f1e0b[_0xfe0e('0x2c')]=_[_0xfe0e('0x2d')](_['map'](_0x450af6,_0xfe0e('0x27')),['name']);_0x2f1e0b['query']=_['keys'](_0x2ebf2f['query']);_0x2f1e0b[_0xfe0e('0x2e')]=_[_0xfe0e('0x2f')](_0x2f1e0b['model'],_0x2f1e0b[_0xfe0e('0x30')]);_0x305561[_0xfe0e('0x31')]=_[_0xfe0e('0x2f')](_0x2f1e0b[_0xfe0e('0x2c')],qs['fields'](_0x2ebf2f[_0xfe0e('0x30')][_0xfe0e('0x32')]));_0x305561[_0xfe0e('0x31')]=_0x305561['attributes'][_0xfe0e('0x33')]?_0x305561['attributes']:_0x2f1e0b[_0xfe0e('0x2c')];if(!_0x2ebf2f[_0xfe0e('0x30')][_0xfe0e('0x34')]('nolimit')){_0x305561[_0xfe0e('0x1e')]=qs[_0xfe0e('0x1e')](_0x2ebf2f[_0xfe0e('0x30')][_0xfe0e('0x1e')]);_0x305561[_0xfe0e('0x20')]=qs['offset'](_0x2ebf2f[_0xfe0e('0x30')][_0xfe0e('0x20')]);}_0x305561[_0xfe0e('0x35')]=qs[_0xfe0e('0x36')](_0x2ebf2f[_0xfe0e('0x30')]['sort']);_0x305561[_0xfe0e('0x37')]=qs['filters'](_['pick'](_0x2ebf2f[_0xfe0e('0x30')],_0x2f1e0b[_0xfe0e('0x2e')]),_0x450af6);if(_0x2ebf2f['query'][_0xfe0e('0x38')]){_0x305561[_0xfe0e('0x37')]=_[_0xfe0e('0x39')](_0x305561[_0xfe0e('0x37')],{'$or':_[_0xfe0e('0x3a')](_0x450af6,function(_0x191017){if(_0x191017[_0xfe0e('0x3b')]!=='VIRTUAL'){var _0x505a96={};_0x505a96[_0x191017[_0xfe0e('0x27')]]={'$like':'%'+_0x2ebf2f[_0xfe0e('0x30')][_0xfe0e('0x38')]+'%'};return _0x505a96;}})});}_0x305561=_[_0xfe0e('0x39')]({},_0x305561,_0x2ebf2f[_0xfe0e('0x3c')]);var _0xa009bb={'where':_0x305561[_0xfe0e('0x37')]};return db[_0xfe0e('0x3d')][_0xfe0e('0x1f')](_0xa009bb)[_0xfe0e('0x23')](function(_0x2eee82){_0x358569[_0xfe0e('0x1f')]=_0x2eee82;if(_0x2ebf2f[_0xfe0e('0x30')][_0xfe0e('0x3e')]){_0x305561[_0xfe0e('0x3f')]=[{'all':!![]}];}return db[_0xfe0e('0x3d')][_0xfe0e('0x40')](_0x305561);})[_0xfe0e('0x23')](function(_0x554abb){_0x358569['rows']=_0x554abb;return _0x358569;})[_0xfe0e('0x23')](respondWithFilteredResult(_0x45e5e2,_0x305561))[_0xfe0e('0x41')](handleError(_0x45e5e2,null));};exports[_0xfe0e('0x42')]=function(_0x10061a,_0x35d32a){var _0x3069a7={'raw':!![],'where':{'id':_0x10061a[_0xfe0e('0x43')]['id']}},_0x288ea0={};_0x288ea0['model']=_[_0xfe0e('0x44')](db[_0xfe0e('0x3d')][_0xfe0e('0x29')]);_0x288ea0[_0xfe0e('0x30')]=_[_0xfe0e('0x44')](_0x10061a['query']);_0x288ea0[_0xfe0e('0x2e')]=_[_0xfe0e('0x2f')](_0x288ea0['model'],_0x288ea0[_0xfe0e('0x30')]);_0x3069a7[_0xfe0e('0x31')]=_['intersection'](_0x288ea0[_0xfe0e('0x2c')],qs[_0xfe0e('0x32')](_0x10061a[_0xfe0e('0x30')]['fields']));_0x3069a7[_0xfe0e('0x31')]=_0x3069a7[_0xfe0e('0x31')][_0xfe0e('0x33')]?_0x3069a7[_0xfe0e('0x31')]:_0x288ea0[_0xfe0e('0x2c')];if(_0x10061a[_0xfe0e('0x30')][_0xfe0e('0x3e')]){_0x3069a7[_0xfe0e('0x3f')]=[{'all':!![]}];}_0x3069a7=_[_0xfe0e('0x39')]({},_0x3069a7,_0x10061a[_0xfe0e('0x3c')]);return db[_0xfe0e('0x3d')]['find'](_0x3069a7)[_0xfe0e('0x23')](handleEntityNotFound(_0x35d32a,null))[_0xfe0e('0x23')](respondWithResult(_0x35d32a,null))[_0xfe0e('0x41')](handleError(_0x35d32a,null));};exports[_0xfe0e('0x45')]=function(_0x48d186,_0x484d35){if(_0x48d186[_0xfe0e('0x46')]['id']){delete _0x48d186['body']['id'];}return db[_0xfe0e('0x3d')][_0xfe0e('0x47')]({'where':{'id':_0x48d186[_0xfe0e('0x43')]['id']}})[_0xfe0e('0x23')](handleEntityNotFound(_0x484d35,null))[_0xfe0e('0x23')](saveUpdates(_0x48d186[_0xfe0e('0x46')],null))['then'](respondWithResult(_0x484d35,null))[_0xfe0e('0x41')](handleError(_0x484d35,null));};exports[_0xfe0e('0x48')]=function(_0x565e61,_0x3f7266){return db[_0xfe0e('0x3d')]['find']({'where':{'id':_0x565e61[_0xfe0e('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f7266,null))[_0xfe0e('0x23')](removeEntity(_0x3f7266,null))[_0xfe0e('0x41')](handleError(_0x3f7266,null));};exports[_0xfe0e('0x49')]=function(_0x8d5d52,_0x5b13d4){var _0x20e549;return db[_0xfe0e('0x4a')][_0xfe0e('0x4b')](function(_0xaacab7){return db[_0xfe0e('0x3d')]['create'](_0x8d5d52[_0xfe0e('0x46')],{'transaction':_0xaacab7})['then'](function(_0x940d26){_0x20e549=_0x940d26;var _0x3977ce={'type':db['Sequelize'][_0xfe0e('0x4c')],'transaction':_0xaacab7};switch(_0x8d5d52[_0xfe0e('0x46')][_0xfe0e('0x3b')]){case _0xfe0e('0x4d'):_0x3977ce[_0xfe0e('0x3b')]=db[_0xfe0e('0x4e')][_0xfe0e('0x4c')];break;case _0xfe0e('0x4f'):_0x3977ce['type']=db[_0xfe0e('0x4e')][_0xfe0e('0x50')];break;case _0xfe0e('0x51'):_0x3977ce[_0xfe0e('0x3b')]=db[_0xfe0e('0x4e')][_0xfe0e('0x52')];_0x3977ce['defaultValue']=![];break;default:}return db[_0xfe0e('0x4a')]['queryInterface'][_0xfe0e('0x53')](_0xfe0e('0x54'),util['format'](_0xfe0e('0x55'),_0x20e549['id']),_0x3977ce);})['then'](function(){return _0x20e549;});})[_0xfe0e('0x23')](respondWithResult(_0x5b13d4,0xc9))[_0xfe0e('0x41')](handleError(_0x5b13d4,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 85d5c8d..b7cf3fb 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 _0x54d0=['path','rimraf','./cmCustomField.attributes','exports','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3002f8,_0x27dff2){var _0x84fd98=function(_0x5c34ce){while(--_0x5c34ce){_0x3002f8['push'](_0x3002f8['shift']());}};_0x84fd98(++_0x27dff2);}(_0x54d0,0xc0));var _0x054d=function(_0x18d50f,_0x124aff){_0x18d50f=_0x18d50f-0x0;var _0x8ce385=_0x54d0[_0x18d50f];return _0x8ce385;};'use strict';var _=require(_0x054d('0x0'));var util=require(_0x054d('0x1'));var logger=require(_0x054d('0x2'))(_0x054d('0x3'));var moment=require('moment');var BPromise=require(_0x054d('0x4'));var rp=require(_0x054d('0x5'));var fs=require('fs');var path=require(_0x054d('0x6'));var rimraf=require(_0x054d('0x7'));var config=require('../../config/environment');var attributes=require(_0x054d('0x8'));module[_0x054d('0x9')]=function(_0x4d8e2b,_0x38bc90){return _0x4d8e2b['define'](_0x054d('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5c3=['../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa5c3,0xaf));var _0x3a5c=function(_0x18dbe8,_0x277e22){_0x18dbe8=_0x18dbe8-0x0;var _0x41f86d=_0xa5c3[_0x18dbe8];return _0x41f86d;};'use strict';var _=require(_0x3a5c('0x0'));var util=require(_0x3a5c('0x1'));var logger=require(_0x3a5c('0x2'))(_0x3a5c('0x3'));var moment=require(_0x3a5c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a5c('0x5'));var rimraf=require(_0x3a5c('0x6'));var config=require(_0x3a5c('0x7'));var attributes=require(_0x3a5c('0x8'));module[_0x3a5c('0x9')]=function(_0xca3f14,_0x79e333){return _0xca3f14[_0x3a5c('0xa')](_0x3a5c('0xb'),attributes,{'tableName':_0x3a5c('0xc'),'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 6b31af8..a52ffe9 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 _0x7f3a=['request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x540e28,_0x444d6d){var _0x5011a3=function(_0x1efbe7){while(--_0x1efbe7){_0x540e28['push'](_0x540e28['shift']());}};_0x5011a3(++_0x444d6d);}(_0x7f3a,0x9d));var _0xa7f3=function(_0xff8b6d,_0x12c12c){_0xff8b6d=_0xff8b6d-0x0;var _0x94a6b3=_0x7f3a[_0xff8b6d];return _0x94a6b3;};'use strict';var _=require(_0xa7f3('0x0'));var util=require(_0xa7f3('0x1'));var moment=require(_0xa7f3('0x2'));var BPromise=require(_0xa7f3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa7f3('0x4'));var db=require(_0xa7f3('0x5'))['db'];var utils=require(_0xa7f3('0x6'));var logger=require(_0xa7f3('0x7'))(_0xa7f3('0x8'));var config=require(_0xa7f3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa7f3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d6c9c,_0x91258b,_0x57f22f){return new BPromise(function(_0x5a477e,_0x50f82d){return client[_0xa7f3('0xb')](_0x4d6c9c,_0x57f22f)[_0xa7f3('0xc')](function(_0x59d311){logger[_0xa7f3('0xd')](_0xa7f3('0xe'),_0x91258b,_0xa7f3('0xf'));logger[_0xa7f3('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x91258b,_0xa7f3('0xf'),JSON[_0xa7f3('0x11')](_0x59d311));if(_0x59d311[_0xa7f3('0x12')]){if(_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x13')]===0x1f4){logger['error'](_0xa7f3('0xe'),_0x91258b,_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x14')]);return _0x50f82d(_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x14')]);}logger['error'](_0xa7f3('0xe'),_0x91258b,_0x59d311[_0xa7f3('0x12')]['message']);return _0x5a477e(_0x59d311[_0xa7f3('0x12')][_0xa7f3('0x14')]);}else{logger[_0xa7f3('0xd')](_0xa7f3('0xe'),_0x91258b,_0xa7f3('0xf'));_0x5a477e(_0x59d311['result'][_0xa7f3('0x14')]);}})['catch'](function(_0x27278c){logger[_0xa7f3('0x12')]('CmCustomField,\x20%s,\x20%s',_0x91258b,_0x27278c);_0x50f82d(_0x27278c);});});} \ No newline at end of file +var _0xbe64=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2dfe85,_0x147f2d){var _0x10b8c2=function(_0x4d7baf){while(--_0x4d7baf){_0x2dfe85['push'](_0x2dfe85['shift']());}};_0x10b8c2(++_0x147f2d);}(_0xbe64,0x19d));var _0x4be6=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xbe64[_0x2714ec];return _0x2608e5;};'use strict';var _=require(_0x4be6('0x0'));var util=require(_0x4be6('0x1'));var moment=require(_0x4be6('0x2'));var BPromise=require('bluebird');var rs=require(_0x4be6('0x3'));var fs=require('fs');var Redis=require(_0x4be6('0x4'));var db=require(_0x4be6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4be6('0x6'))(_0x4be6('0x7'));var config=require(_0x4be6('0x8'));var jayson=require(_0x4be6('0x9'));var client=jayson['client'][_0x4be6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cfe01,_0x27aad8,_0x324b99){return new BPromise(function(_0xc72990,_0xd871f5){return client[_0x4be6('0xb')](_0x5cfe01,_0x324b99)['then'](function(_0x3550c4){logger['info'](_0x4be6('0xc'),_0x27aad8,_0x4be6('0xd'));logger['debug'](_0x4be6('0xe'),_0x27aad8,'request\x20sent',JSON[_0x4be6('0xf')](_0x3550c4));if(_0x3550c4['error']){if(_0x3550c4['error']['code']===0x1f4){logger[_0x4be6('0x10')](_0x4be6('0xc'),_0x27aad8,_0x3550c4['error'][_0x4be6('0x11')]);return _0xd871f5(_0x3550c4[_0x4be6('0x10')][_0x4be6('0x11')]);}logger[_0x4be6('0x10')](_0x4be6('0xc'),_0x27aad8,_0x3550c4[_0x4be6('0x10')][_0x4be6('0x11')]);return _0xc72990(_0x3550c4[_0x4be6('0x10')][_0x4be6('0x11')]);}else{logger['info'](_0x4be6('0xc'),_0x27aad8,'request\x20sent');_0xc72990(_0x3550c4['result'][_0x4be6('0x11')]);}})[_0x4be6('0x12')](function(_0x1e8ece){logger[_0x4be6('0x10')](_0x4be6('0xc'),_0x27aad8,_0x1e8ece);_0xd871f5(_0x1e8ece);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index d5c3c48..e8ec63c 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 _0xe4d4=['isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get'];(function(_0x2136d5,_0x4b0479){var _0x3bee2e=function(_0x119e88){while(--_0x119e88){_0x2136d5['push'](_0x2136d5['shift']());}};_0x3bee2e(++_0x4b0479);}(_0xe4d4,0x184));var _0x4e4d=function(_0x3093ac,_0x4d2dba){_0x3093ac=_0x3093ac-0x0;var _0x2a972b=_0xe4d4[_0x3093ac];return _0x2a972b;};'use strict';var multer=require(_0x4e4d('0x0'));var util=require(_0x4e4d('0x1'));var path=require(_0x4e4d('0x2'));var timeout=require(_0x4e4d('0x3'));var express=require('express');var router=express[_0x4e4d('0x4')]();var fs_extra=require(_0x4e4d('0x5'));var auth=require(_0x4e4d('0x6'));var interaction=require(_0x4e4d('0x7'));var config=require(_0x4e4d('0x8'));var controller=require(_0x4e4d('0x9'));router[_0x4e4d('0xa')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xc')]);router[_0x4e4d('0xa')](_0x4e4d('0xd'),auth[_0x4e4d('0xb')](),controller['show']);router[_0x4e4d('0xe')]('/',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0xf')]);router[_0x4e4d('0x10')]('/:id',auth[_0x4e4d('0xb')](),controller[_0x4e4d('0x11')]);router[_0x4e4d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4e4d('0x13')]);module[_0x4e4d('0x14')]=router; \ No newline at end of file +var _0x3885=['express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','connect-timeout'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x3885,0x10e));var _0x5388=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3885[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x5388('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5388('0x1'));var express=require(_0x5388('0x2'));var router=express['Router']();var fs_extra=require(_0x5388('0x3'));var auth=require(_0x5388('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5388('0x5'));var controller=require('./cmCustomField.controller');router[_0x5388('0x6')]('/',auth[_0x5388('0x7')](),controller[_0x5388('0x8')]);router[_0x5388('0x6')](_0x5388('0x9'),auth[_0x5388('0x7')](),controller[_0x5388('0xa')]);router[_0x5388('0xb')]('/',auth[_0x5388('0x7')](),controller[_0x5388('0xc')]);router['put'](_0x5388('0x9'),auth[_0x5388('0x7')](),controller['update']);router[_0x5388('0xd')](_0x5388('0x9'),auth[_0x5388('0x7')](),controller[_0x5388('0xe')]);module[_0x5388('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index e867979..edbdd95 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 _0x17d8=['format','INTEGER','STRING','UNSIGNED','contactListQueue','sequelize','exports','BOOLEAN','DATE'];(function(_0x69188b,_0x550923){var _0x3320f4=function(_0x27d05b){while(--_0x27d05b){_0x69188b['push'](_0x69188b['shift']());}};_0x3320f4(++_0x550923);}(_0x17d8,0x1d9));var _0x817d=function(_0x361fb2,_0x1a2411){_0x361fb2=_0x361fb2-0x0;var _0x219f56=_0x17d8[_0x361fb2];return _0x219f56;};'use strict';var moment=require('moment');var Sequelize=require(_0x817d('0x0'));module[_0x817d('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x817d('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x817d('0x3')],'defaultValue':moment()[_0x817d('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x817d('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x817d('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x817d('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x817d('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x817d('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x817d('0x8')},'ListId':{'type':Sequelize[_0x817d('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x817d('0x5')],'unique':_0x817d('0x8')},'CampaignId':{'type':Sequelize[_0x817d('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x817d('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x6605=['INTEGER','BOOLEAN','contactListQueue','STRING','moment','sequelize','exports','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x364604,_0x309c2e){var _0x155028=function(_0x55ab6b){while(--_0x55ab6b){_0x364604['push'](_0x364604['shift']());}};_0x155028(++_0x309c2e);}(_0x6605,0x130));var _0x5660=function(_0x5bf07e,_0x470c47){_0x5bf07e=_0x5bf07e-0x0;var _0x181787=_0x6605[_0x5bf07e];return _0x181787;};'use strict';var moment=require(_0x5660('0x0'));var Sequelize=require(_0x5660('0x1'));module[_0x5660('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5660('0x3')],'defaultValue':moment()[_0x5660('0x4')](_0x5660('0x5'))},'countbusyretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5660('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x5660('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5660('0x7')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5660('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x5660('0x8')},'UserId':{'type':Sequelize[_0x5660('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x5660('0x6')],'unique':_0x5660('0x8')},'CampaignId':{'type':Sequelize[_0x5660('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x5660('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5660('0x9')]},'recallmeNotifiedDate':{'type':Sequelize[_0x5660('0x3')],'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 b3fbdaa..760417c 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 _0x0b78=['DESC','ASC','findOne','scheduledat','recallme','LOCK','CmCompany','Company','CmList','getPreviewRecall','CmContact','UPDATE','Contact','List','VoiceQueue','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','push','utcOffset','getTimezone','timezones','moment','lodash','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','update','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$iLike','$notILike','$contains','$contained','$any','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CmHopper','includeAll','include','then','rows','params','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','state','statedesc','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','CmHopperAdditionalPhone','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','direction','prev','hopperIds','scheduledAt','literal','isEmpty','priority'];(function(_0x4361b6,_0x414635){var _0x4c6878=function(_0x54cfb6){while(--_0x54cfb6){_0x4361b6['push'](_0x4361b6['shift']());}};_0x4c6878(++_0x414635);}(_0x0b78,0x1ad));var _0x80b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0b78[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x80b7('0x0'));var _=require(_0x80b7('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x80b7('0x2'))(_0x80b7('0x3'));var shared=require('../../config/environment');var db=require(_0x80b7('0x4'))['db'];function respondWithResult(_0x4ee9b4,_0x6a187e){_0x6a187e=_0x6a187e||0xc8;return function(_0x89d4d7){if(_0x89d4d7){return _0x4ee9b4[_0x80b7('0x5')](_0x6a187e)['json'](_0x89d4d7);}};}function respondWithFilteredResult(_0x49bc7f,_0x167ddd){return function(_0x584401){if(_0x584401){var _0x5e19ef=typeof _0x167ddd[_0x80b7('0x6')]===_0x80b7('0x7')&&typeof _0x167ddd[_0x80b7('0x8')]==='undefined';var _0x74b4a8=_0x584401[_0x80b7('0x9')];var _0x374c52=_0x5e19ef?0x0:_0x167ddd['offset'];var _0x467f38=_0x5e19ef?_0x584401['count']:_0x167ddd[_0x80b7('0x6')]+_0x167ddd[_0x80b7('0x8')];var _0x3b19da;if(_0x467f38>=_0x74b4a8){_0x467f38=_0x74b4a8;_0x3b19da=0xc8;}else{_0x3b19da=0xce;}_0x49bc7f[_0x80b7('0x5')](_0x3b19da);return _0x49bc7f[_0x80b7('0xa')](_0x80b7('0xb'),_0x374c52+'-'+_0x467f38+'/'+_0x74b4a8)[_0x80b7('0xc')](_0x584401);}return null;};}function saveUpdates(_0x145241,_0x323d06){return function(_0x366e34){if(_0x366e34){return _0x366e34[_0x80b7('0xd')](_0x145241)['then'](function(_0x2c2668){return _0x2c2668;});}return null;};}function handleEntityNotFound(_0x401ad3,_0x527c5b){return function(_0x2ee168){if(!_0x2ee168){_0x401ad3[_0x80b7('0xe')](0x194);}return _0x2ee168;};}function handleError(_0x4aaa02,_0x46822c){_0x46822c=_0x46822c||0x1f4;return function(_0x3b6b13){logger[_0x80b7('0xf')](_0x3b6b13[_0x80b7('0x10')]);if(_0x3b6b13[_0x80b7('0x11')]){delete _0x3b6b13[_0x80b7('0x11')];}_0x4aaa02[_0x80b7('0x5')](_0x46822c)[_0x80b7('0x12')](_0x3b6b13);};}exports[_0x80b7('0x13')]=function(_0x34299c,_0x4c12b1){var _0x3bb691={},_0x1d62ed={},_0x205457={'count':0x0,'rows':[]};var _0x125c47=_['map'](db['CmHopper'][_0x80b7('0x14')],function(_0x1e27aa){return{'name':_0x1e27aa[_0x80b7('0x15')],'type':_0x1e27aa[_0x80b7('0x16')]['key']};});_0x1d62ed['model']=_[_0x80b7('0x17')](_0x125c47,_0x80b7('0x11'));_0x1d62ed[_0x80b7('0x18')]=_[_0x80b7('0x19')](_0x34299c['query']);_0x1d62ed[_0x80b7('0x1a')]=_['intersection'](_0x1d62ed['model'],_0x1d62ed[_0x80b7('0x18')]);_0x1d62ed[_0x80b7('0x1a')]=_[_0x80b7('0x1b')](_0x1d62ed[_0x80b7('0x1a')],[_0x80b7('0x1c'),_0x80b7('0x1d'),_0x80b7('0x1e'),_0x80b7('0x1f'),_0x80b7('0x20'),_0x80b7('0x21'),_0x80b7('0x22'),_0x80b7('0x23'),_0x80b7('0x24'),_0x80b7('0x25'),_0x80b7('0x26'),'$in',_0x80b7('0x27'),_0x80b7('0x28'),'$notLike',_0x80b7('0x29'),_0x80b7('0x2a'),_0x80b7('0x28'),'$overlap',_0x80b7('0x2b'),_0x80b7('0x2c'),_0x80b7('0x2d')]);_0x3bb691[_0x80b7('0x2e')]=_[_0x80b7('0x2f')](_0x1d62ed[_0x80b7('0x30')],qs[_0x80b7('0x31')](_0x34299c[_0x80b7('0x18')][_0x80b7('0x31')]));_0x3bb691[_0x80b7('0x2e')]=_0x3bb691[_0x80b7('0x2e')][_0x80b7('0x32')]?_0x3bb691[_0x80b7('0x2e')]:_0x1d62ed['model'];if(!_0x34299c['query'][_0x80b7('0x33')](_0x80b7('0x34'))){_0x3bb691['limit']=qs['limit'](_0x34299c[_0x80b7('0x18')][_0x80b7('0x8')]);_0x3bb691[_0x80b7('0x6')]=qs[_0x80b7('0x6')](_0x34299c[_0x80b7('0x18')][_0x80b7('0x6')]);}_0x3bb691['order']=qs[_0x80b7('0x35')](_0x34299c[_0x80b7('0x18')][_0x80b7('0x35')]);_0x3bb691[_0x80b7('0x36')]=qs['filters'](_[_0x80b7('0x37')](_0x34299c[_0x80b7('0x18')],_0x1d62ed['filters']),_0x125c47);if(_0x34299c[_0x80b7('0x18')][_0x80b7('0x38')]){_0x3bb691[_0x80b7('0x36')]=_[_0x80b7('0x39')](_0x3bb691[_0x80b7('0x36')],{'$or':_[_0x80b7('0x17')](_0x125c47,function(_0x3ff3f9){if(_0x3ff3f9[_0x80b7('0x16')]!=='VIRTUAL'){var _0x5743fa={};_0x5743fa[_0x3ff3f9['name']]={'$like':'%'+_0x34299c[_0x80b7('0x18')][_0x80b7('0x38')]+'%'};return _0x5743fa;}})});}_0x3bb691=_[_0x80b7('0x39')]({},_0x3bb691,_0x34299c[_0x80b7('0x3a')]);var _0x462eb0={'where':_0x3bb691[_0x80b7('0x36')]};return db[_0x80b7('0x3b')][_0x80b7('0x9')](_0x462eb0)['then'](function(_0x2a34eb){_0x205457[_0x80b7('0x9')]=_0x2a34eb;if(_0x34299c[_0x80b7('0x18')][_0x80b7('0x3c')]){_0x3bb691[_0x80b7('0x3d')]=[{'all':!![]}];}return db[_0x80b7('0x3b')]['findAll'](_0x3bb691);})[_0x80b7('0x3e')](function(_0x53f51c){_0x205457[_0x80b7('0x3f')]=_0x53f51c;return _0x205457;})[_0x80b7('0x3e')](respondWithFilteredResult(_0x4c12b1,_0x3bb691))['catch'](handleError(_0x4c12b1,null));};exports['show']=function(_0x823c32,_0x5e21eb){var _0x5c91d8={'raw':!![],'where':{'id':_0x823c32[_0x80b7('0x40')]['id']}},_0x295ca6={};_0x295ca6['model']=_[_0x80b7('0x19')](db[_0x80b7('0x3b')]['rawAttributes']);_0x295ca6['query']=_[_0x80b7('0x19')](_0x823c32[_0x80b7('0x18')]);_0x295ca6[_0x80b7('0x1a')]=_[_0x80b7('0x2f')](_0x295ca6[_0x80b7('0x30')],_0x295ca6[_0x80b7('0x18')]);_0x5c91d8['attributes']=_[_0x80b7('0x2f')](_0x295ca6[_0x80b7('0x30')],qs[_0x80b7('0x31')](_0x823c32[_0x80b7('0x18')]['fields']));_0x5c91d8[_0x80b7('0x2e')]=_0x5c91d8['attributes'][_0x80b7('0x32')]?_0x5c91d8[_0x80b7('0x2e')]:_0x295ca6[_0x80b7('0x30')];if(_0x823c32[_0x80b7('0x18')][_0x80b7('0x3c')]){_0x5c91d8[_0x80b7('0x3d')]=[{'all':!![]}];}_0x5c91d8=_[_0x80b7('0x39')]({},_0x5c91d8,_0x823c32[_0x80b7('0x3a')]);return db[_0x80b7('0x3b')][_0x80b7('0x41')](_0x5c91d8)[_0x80b7('0x3e')](handleEntityNotFound(_0x5e21eb,null))[_0x80b7('0x3e')](respondWithResult(_0x5e21eb,null))[_0x80b7('0x42')](handleError(_0x5e21eb,null));};exports['create']=function(_0x311142,_0x272cad){return db['CmHopper'][_0x80b7('0x43')](_0x311142['body'],{})['then'](respondWithResult(_0x272cad,0xc9))[_0x80b7('0x42')](handleError(_0x272cad,null));};exports['update']=function(_0x50ad92,_0x300bac){if(_0x50ad92[_0x80b7('0x44')]['id']){delete _0x50ad92['body']['id'];}return db[_0x80b7('0x3b')][_0x80b7('0x41')]({'where':{'id':_0x50ad92[_0x80b7('0x40')]['id']}})['then'](handleEntityNotFound(_0x300bac,null))[_0x80b7('0x3e')](saveUpdates(_0x50ad92[_0x80b7('0x44')],null))[_0x80b7('0x3e')](respondWithResult(_0x300bac,null))[_0x80b7('0x42')](handleError(_0x300bac,null));};exports['describe']=function(_0x5dcbcd,_0x5417b9){return db[_0x80b7('0x3b')][_0x80b7('0x45')]()[_0x80b7('0x3e')](respondWithResult(_0x5417b9,null))[_0x80b7('0x42')](handleError(_0x5417b9,null));};exports[_0x80b7('0x46')]=function(_0x44b23d,_0x398925){var _0x557988;var _0x4a6cb5=_0x44b23d['params']['id'];return db[_0x80b7('0x3b')][_0x80b7('0x41')]({'where':{'id':_0x44b23d[_0x80b7('0x40')]['id']}})[_0x80b7('0x3e')](handleEntityNotFound(_0x398925,null))[_0x80b7('0x3e')](function(_0x2da4a1){if(_0x2da4a1){return _0x2da4a1['destroy']()[_0x80b7('0x3e')](function(_0x36e5a5){return _0x36e5a5;});}})['then'](function(_0x12dc7b){_0x557988=_0x12dc7b;if(_0x12dc7b){if(_0x12dc7b[_0x80b7('0x47')]||_0x12dc7b[_0x80b7('0x48')]){return db[_0x12dc7b['VoiceQueueId']?'VoiceQueue':_0x80b7('0x49')][_0x80b7('0x41')]({'where':{'id':_0x12dc7b[_0x80b7('0x47')]?_0x12dc7b[_0x80b7('0x47')]:_0x12dc7b[_0x80b7('0x48')]},'attributes':['id',_0x80b7('0x11')],'raw':!![]});}}})['then'](function(_0x1b81a2){var _0x270386={};if(_0x1b81a2){_[_0x80b7('0x39')](_0x270386,_[_0x80b7('0x4a')](_0x557988[_0x80b7('0x4b')],['createdAt','updatedAt','id']));_0x270386[_0x80b7('0x4c')]=0x15;_0x270386[_0x80b7('0x4d')]=_0x80b7('0x4e');_0x270386['campaign']=_0x1b81a2[_0x80b7('0x11')];_0x270386['membername']=_0x44b23d[_0x80b7('0x4f')][_0x80b7('0x11')];_0x270386[_0x80b7('0x50')]=_0x44b23d[_0x80b7('0x4f')]['id'];_0x270386[_0x80b7('0x4e')]=!![];_0x270386[_0x80b7('0x51')]=moment()[_0x80b7('0x52')](_0x80b7('0x53'));_0x270386[_0x80b7('0x54')]=_0x557988[_0x80b7('0x55')];_0x270386[_0x80b7('0x56')]=_0x557988[_0x80b7('0x47')]?_0x80b7('0x57'):_0x80b7('0x58');return db['CmContact'][_0x80b7('0x41')]({'where':{'id':_0x270386[_0x80b7('0x59')]},'attributes':[_0x80b7('0x5a'),_0x80b7('0x5b')]})[_0x80b7('0x3e')](function(_0x1c009a){if(!_[_0x80b7('0x5c')](_0x398925)&&!_['isNil'](_0x1c009a[_0x80b7('0x5a')])){_0x270386[_0x80b7('0x5d')]=_0x1c009a[_0x80b7('0x5a')];if(!_[_0x80b7('0x5c')](_0x1c009a['lastName'])){_0x270386[_0x80b7('0x5d')]+='\x20'+_0x1c009a[_0x80b7('0x5b')];}}})['finally'](function(){return db[_0x80b7('0x5e')][_0x80b7('0x43')](_0x270386);});}})['then'](function(_0x1a21f4){return db[_0x80b7('0x5f')]['destroy']({'where':{'CmHopperId':_0x4a6cb5}});})['then'](function(){return _0x398925[_0x80b7('0x5')](0xcc)['end']();})[_0x80b7('0x42')](handleError(_0x398925,null));};exports[_0x80b7('0x60')]=function(_0x57d361,_0x1ec5ee){var _0x151939=[];return db['CmContact'][_0x80b7('0x45')]()[_0x80b7('0x3e')](function(_0xb36861){_0x151939=_[_0x80b7('0x19')](_0xb36861);return _0x57d361[_0x80b7('0x4f')][_0x80b7('0x61')]({'where':{'type':_0x80b7('0x62'),'dialActive':!![],'dialMethod':_0x80b7('0x63')},'attributes':['id',_0x80b7('0x64'),'dialPreviewAutoRecallMe'],'raw':!![]});})['then'](function(_0x6d7c1e){if(_0x6d7c1e&&_0x6d7c1e['length']){return db[_0x80b7('0x65')][_0x80b7('0x66')](function(_0x25fc84){var _0x599f17={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x80b7('0x52')](_0x80b7('0x53'))},'VoiceQueueId':{'$in':_['map'](_0x6d7c1e,'id')},'$or':[{'UserId':null},{'UserId':_0x57d361[_0x80b7('0x4f')]['id']}]};var _0x43511d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x6d7c1e)[_0x80b7('0x38')]([_0x80b7('0x67'),0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x57d361[_0x80b7('0x4f')]['id']}]};var _0x6fff0c={'$or':[_0x599f17,_0x43511d]};var _0x1b56a9=[];if(_0x57d361['body']['direction']&&_0x57d361[_0x80b7('0x44')][_0x80b7('0x68')]===_0x80b7('0x69')){if(!_['isEmpty'](_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')])){_0x6fff0c['id']={'$in':_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')]};}_0x1b56a9=[['priority','ASC'],[_0x80b7('0x6b'),_0x6d7c1e[0x0][_0x80b7('0x64')]==='ASC'?'DESC':'ASC'],db['sequelize'][_0x80b7('0x6c')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x80b7('0x6d')](_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')])){_0x6fff0c['id']={'$notIn':_0x57d361[_0x80b7('0x44')][_0x80b7('0x6a')]};}_0x1b56a9=[[_0x80b7('0x6e'),_0x80b7('0x6f')],[_0x80b7('0x6b'),_0x6d7c1e[0x0][_0x80b7('0x64')]],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x80b7('0x70')]];}return db[_0x80b7('0x3b')][_0x80b7('0x71')]({'attributes':['id',_0x80b7('0x72'),'phone',_0x80b7('0x73')],'where':_0x6fff0c,'order':_0x1b56a9,'transaction':_0x25fc84,'lock':_0x25fc84[_0x80b7('0x74')]['UPDATE'],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x151939,'include':[{'model':db[_0x80b7('0x75')],'as':_0x80b7('0x76'),'attributes':['id','name']}]},{'model':db[_0x80b7('0x77')],'as':'List','attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name','dialActive']}]})['then'](function(_0x3c1e8e){if(_0x3c1e8e){return _0x3c1e8e['update']({'UserId':_0x57d361[_0x80b7('0x4f')]['id']},{'transaction':_0x25fc84});}});});}})['then'](handleEntityNotFound(_0x1ec5ee,null))[_0x80b7('0x3e')](respondWithResult(_0x1ec5ee,null))[_0x80b7('0x42')](handleError(_0x1ec5ee,null));};exports[_0x80b7('0x78')]=function(_0x485b5e,_0x22083b,_0x37e1c8){var _0x482cfc=[];var _0x190c5a=_0x485b5e[_0x80b7('0x40')]['id'];var _0x5ac51b=_0x485b5e[_0x80b7('0x4f')]['id'];return db[_0x80b7('0x79')][_0x80b7('0x45')]()['then'](function(_0x7a4ddb){_0x482cfc=_['keys'](_0x7a4ddb);return db['sequelize']['transaction'](function(_0x30987d){const _0x531232={'id':_0x190c5a};return db['CmHopper'][_0x80b7('0x71')]({'attributes':['id',_0x80b7('0x72'),_0x80b7('0x73')],'where':_0x531232,'transaction':_0x30987d,'lock':_0x30987d[_0x80b7('0x74')][_0x80b7('0x7a')],'include':[{'model':db[_0x80b7('0x79')],'as':_0x80b7('0x7b'),'attributes':_0x482cfc,'include':[{'model':db[_0x80b7('0x75')],'as':_0x80b7('0x76'),'attributes':['id',_0x80b7('0x11')]}]},{'model':db[_0x80b7('0x77')],'as':_0x80b7('0x7c'),'attributes':['id','name']},{'model':db[_0x80b7('0x7d')],'as':_0x80b7('0x7e'),'attributes':['id',_0x80b7('0x11'),'dialActive']}]})[_0x80b7('0x3e')](function(_0x207335){if(_0x207335){return _0x207335[_0x80b7('0xd')]({'UserId':_0x5ac51b},{'transaction':_0x30987d});}});});})[_0x80b7('0x3e')](handleEntityNotFound(_0x22083b,null))[_0x80b7('0x3e')](respondWithResult(_0x22083b,null))[_0x80b7('0x42')](handleError(_0x22083b,null));};exports[_0x80b7('0x7f')]=function(_0x34aa0f,_0x53ebf4){return _0x34aa0f[_0x80b7('0x4f')][_0x80b7('0x61')]({'where':{'type':_0x80b7('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0xb22b8b){if(_0xb22b8b&&_0xb22b8b[_0x80b7('0x32')]){return db[_0x80b7('0x3b')][_0x80b7('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x80b7('0x53'))},'VoiceQueueId':{'$in':_[_0x80b7('0x17')](_0xb22b8b,'id')},'$or':[{'UserId':null},{'UserId':_0x34aa0f[_0x80b7('0x4f')]['id']}]}});}return 0x0;})[_0x80b7('0x3e')](function(_0x4c7e27){if(!_[_0x80b7('0x5c')](_0x4c7e27)&&_[_0x80b7('0x80')](_0x4c7e27)){return _0x53ebf4[_0x80b7('0x5')](0xc8)['json']({'contacts':_0x4c7e27});}else{logger[_0x80b7('0xf')](_0x80b7('0x81'),_0x80b7('0x7f'),0x194,_0x80b7('0x82'));_0x53ebf4[_0x80b7('0xe')](0x194);}})[_0x80b7('0x42')](handleError(_0x53ebf4,null));};exports['getTimezones']=function(_0x1a13e2,_0x13524c){var _0x29aade=shared['timezones'];var _0x2396f3=[];_[_0x80b7('0x17')](_0x29aade,function(_0x130acc){_0x2396f3[_0x80b7('0x83')]({'id':_0x130acc[_0x80b7('0x11')],'name':_0x130acc['name'],'utcOffset':_0x130acc[_0x80b7('0x84')]});});return _0x13524c[_0x80b7('0x5')](0xc8)['json']({'tz':_0x2396f3});};exports[_0x80b7('0x85')]=function(_0x5440e4,_0x2fc6e8){var _0x58d164=shared[_0x80b7('0x86')];var _0x2d09a3={};if(!_['isNil'](_0x58d164[_0x5440e4[_0x80b7('0x44')]['id']]))_0x2d09a3=_0x58d164[_0x5440e4[_0x80b7('0x44')]['id']];return _0x2fc6e8[_0x80b7('0x5')](0xc8)[_0x80b7('0xc')](_0x2d09a3);}; \ No newline at end of file +var _0xed95=['phone','queue','CmContact','firstName','lastName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','List','dialActive','update','getPreviewRecall','Queue','getOpenContacts','isNil','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','sendStatus','error','name','send','index','map','CmHopper','fieldName','keys','query','filters','intersection','concat','$and','$or','$lt','$lte','$ne','$between','$notBetween','$in','$like','$notLike','$iLike','$overlap','$contains','$contained','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','then','includeAll','include','findAll','rows','params','model','rawAttributes','options','find','catch','create','body','describe','destroy','CampaignId','VoiceQueueId','VoiceQueue','Campaign','merge','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x20483d,_0x5eb15f){var _0x113e8d=function(_0x496fab){while(--_0x496fab){_0x20483d['push'](_0x20483d['shift']());}};_0x113e8d(++_0x5eb15f);}(_0xed95,0xb9));var _0x5ed9=function(_0x1724a0,_0x25c4d4){_0x1724a0=_0x1724a0-0x0;var _0x46fd4e=_0xed95[_0x1724a0];return _0x46fd4e;};'use strict';var moment=require(_0x5ed9('0x0'));var _=require(_0x5ed9('0x1'));var qs=require(_0x5ed9('0x2'));var logger=require(_0x5ed9('0x3'))(_0x5ed9('0x4'));var shared=require(_0x5ed9('0x5'));var db=require(_0x5ed9('0x6'))['db'];function respondWithResult(_0x3e2272,_0x2a28e9){_0x2a28e9=_0x2a28e9||0xc8;return function(_0x7b84d6){if(_0x7b84d6){return _0x3e2272[_0x5ed9('0x7')](_0x2a28e9)[_0x5ed9('0x8')](_0x7b84d6);}};}function respondWithFilteredResult(_0x52a57d,_0x48efa8){return function(_0x2612a8){if(_0x2612a8){var _0x217c71=typeof _0x48efa8[_0x5ed9('0x9')]===_0x5ed9('0xa')&&typeof _0x48efa8[_0x5ed9('0xb')]===_0x5ed9('0xa');var _0x5b48b1=_0x2612a8['count'];var _0x3cbaf0=_0x217c71?0x0:_0x48efa8[_0x5ed9('0x9')];var _0x46fc84=_0x217c71?_0x2612a8[_0x5ed9('0xc')]:_0x48efa8['offset']+_0x48efa8['limit'];var _0x28e087;if(_0x46fc84>=_0x5b48b1){_0x46fc84=_0x5b48b1;_0x28e087=0xc8;}else{_0x28e087=0xce;}_0x52a57d[_0x5ed9('0x7')](_0x28e087);return _0x52a57d[_0x5ed9('0xd')](_0x5ed9('0xe'),_0x3cbaf0+'-'+_0x46fc84+'/'+_0x5b48b1)['json'](_0x2612a8);}return null;};}function saveUpdates(_0x217a53,_0x110d83){return function(_0x246f80){if(_0x246f80){return _0x246f80['update'](_0x217a53)['then'](function(_0x3de296){return _0x3de296;});}return null;};}function handleEntityNotFound(_0x28587e,_0x5e952c){return function(_0x2cfd87){if(!_0x2cfd87){_0x28587e[_0x5ed9('0xf')](0x194);}return _0x2cfd87;};}function handleError(_0x59bace,_0x57692b){_0x57692b=_0x57692b||0x1f4;return function(_0x1d2d60){logger[_0x5ed9('0x10')](_0x1d2d60['stack']);if(_0x1d2d60[_0x5ed9('0x11')]){delete _0x1d2d60[_0x5ed9('0x11')];}_0x59bace['status'](_0x57692b)[_0x5ed9('0x12')](_0x1d2d60);};}exports[_0x5ed9('0x13')]=function(_0x54a570,_0x49fe37){var _0x5a3ac1={},_0x510ffe={},_0x3f65df={'count':0x0,'rows':[]};var _0x409a26=_[_0x5ed9('0x14')](db[_0x5ed9('0x15')]['rawAttributes'],function(_0x120a60){return{'name':_0x120a60[_0x5ed9('0x16')],'type':_0x120a60['type']['key']};});_0x510ffe['model']=_[_0x5ed9('0x14')](_0x409a26,_0x5ed9('0x11'));_0x510ffe['query']=_[_0x5ed9('0x17')](_0x54a570[_0x5ed9('0x18')]);_0x510ffe[_0x5ed9('0x19')]=_[_0x5ed9('0x1a')](_0x510ffe['model'],_0x510ffe[_0x5ed9('0x18')]);_0x510ffe[_0x5ed9('0x19')]=_[_0x5ed9('0x1b')](_0x510ffe[_0x5ed9('0x19')],[_0x5ed9('0x1c'),_0x5ed9('0x1d'),'$gt','$gte',_0x5ed9('0x1e'),_0x5ed9('0x1f'),_0x5ed9('0x20'),'$eq','$not',_0x5ed9('0x21'),_0x5ed9('0x22'),_0x5ed9('0x23'),'$notIn',_0x5ed9('0x24'),_0x5ed9('0x25'),_0x5ed9('0x26'),'$notILike',_0x5ed9('0x24'),_0x5ed9('0x27'),_0x5ed9('0x28'),_0x5ed9('0x29'),'$any']);_0x5a3ac1['attributes']=_[_0x5ed9('0x1a')](_0x510ffe['model'],qs[_0x5ed9('0x2a')](_0x54a570[_0x5ed9('0x18')][_0x5ed9('0x2a')]));_0x5a3ac1[_0x5ed9('0x2b')]=_0x5a3ac1[_0x5ed9('0x2b')][_0x5ed9('0x2c')]?_0x5a3ac1[_0x5ed9('0x2b')]:_0x510ffe['model'];if(!_0x54a570['query']['hasOwnProperty'](_0x5ed9('0x2d'))){_0x5a3ac1[_0x5ed9('0xb')]=qs[_0x5ed9('0xb')](_0x54a570['query'][_0x5ed9('0xb')]);_0x5a3ac1['offset']=qs[_0x5ed9('0x9')](_0x54a570[_0x5ed9('0x18')][_0x5ed9('0x9')]);}_0x5a3ac1[_0x5ed9('0x2e')]=qs[_0x5ed9('0x2f')](_0x54a570[_0x5ed9('0x18')]['sort']);_0x5a3ac1[_0x5ed9('0x30')]=qs[_0x5ed9('0x19')](_[_0x5ed9('0x31')](_0x54a570['query'],_0x510ffe['filters']),_0x409a26);if(_0x54a570[_0x5ed9('0x18')][_0x5ed9('0x32')]){_0x5a3ac1['where']=_['merge'](_0x5a3ac1[_0x5ed9('0x30')],{'$or':_[_0x5ed9('0x14')](_0x409a26,function(_0x13cac8){if(_0x13cac8[_0x5ed9('0x33')]!==_0x5ed9('0x34')){var _0x355899={};_0x355899[_0x13cac8[_0x5ed9('0x11')]]={'$like':'%'+_0x54a570[_0x5ed9('0x18')]['filter']+'%'};return _0x355899;}})});}_0x5a3ac1=_['merge']({},_0x5a3ac1,_0x54a570['options']);var _0x4699a0={'where':_0x5a3ac1[_0x5ed9('0x30')]};return db['CmHopper'][_0x5ed9('0xc')](_0x4699a0)[_0x5ed9('0x35')](function(_0x4407d2){_0x3f65df[_0x5ed9('0xc')]=_0x4407d2;if(_0x54a570['query'][_0x5ed9('0x36')]){_0x5a3ac1[_0x5ed9('0x37')]=[{'all':!![]}];}return db[_0x5ed9('0x15')][_0x5ed9('0x38')](_0x5a3ac1);})[_0x5ed9('0x35')](function(_0x5d01fe){_0x3f65df[_0x5ed9('0x39')]=_0x5d01fe;return _0x3f65df;})[_0x5ed9('0x35')](respondWithFilteredResult(_0x49fe37,_0x5a3ac1))['catch'](handleError(_0x49fe37,null));};exports['show']=function(_0x1ac6b7,_0x52c7ca){var _0x4fedbe={'raw':!![],'where':{'id':_0x1ac6b7[_0x5ed9('0x3a')]['id']}},_0x5a9287={};_0x5a9287[_0x5ed9('0x3b')]=_['keys'](db['CmHopper'][_0x5ed9('0x3c')]);_0x5a9287[_0x5ed9('0x18')]=_[_0x5ed9('0x17')](_0x1ac6b7[_0x5ed9('0x18')]);_0x5a9287[_0x5ed9('0x19')]=_[_0x5ed9('0x1a')](_0x5a9287[_0x5ed9('0x3b')],_0x5a9287[_0x5ed9('0x18')]);_0x4fedbe[_0x5ed9('0x2b')]=_[_0x5ed9('0x1a')](_0x5a9287[_0x5ed9('0x3b')],qs[_0x5ed9('0x2a')](_0x1ac6b7[_0x5ed9('0x18')][_0x5ed9('0x2a')]));_0x4fedbe['attributes']=_0x4fedbe[_0x5ed9('0x2b')][_0x5ed9('0x2c')]?_0x4fedbe[_0x5ed9('0x2b')]:_0x5a9287[_0x5ed9('0x3b')];if(_0x1ac6b7[_0x5ed9('0x18')]['includeAll']){_0x4fedbe[_0x5ed9('0x37')]=[{'all':!![]}];}_0x4fedbe=_['merge']({},_0x4fedbe,_0x1ac6b7[_0x5ed9('0x3d')]);return db[_0x5ed9('0x15')][_0x5ed9('0x3e')](_0x4fedbe)[_0x5ed9('0x35')](handleEntityNotFound(_0x52c7ca,null))[_0x5ed9('0x35')](respondWithResult(_0x52c7ca,null))[_0x5ed9('0x3f')](handleError(_0x52c7ca,null));};exports[_0x5ed9('0x40')]=function(_0x53c64f,_0x5e717b){return db[_0x5ed9('0x15')][_0x5ed9('0x40')](_0x53c64f['body'],{})[_0x5ed9('0x35')](respondWithResult(_0x5e717b,0xc9))[_0x5ed9('0x3f')](handleError(_0x5e717b,null));};exports['update']=function(_0x53a601,_0x23ea4b){if(_0x53a601[_0x5ed9('0x41')]['id']){delete _0x53a601['body']['id'];}return db[_0x5ed9('0x15')][_0x5ed9('0x3e')]({'where':{'id':_0x53a601[_0x5ed9('0x3a')]['id']}})[_0x5ed9('0x35')](handleEntityNotFound(_0x23ea4b,null))[_0x5ed9('0x35')](saveUpdates(_0x53a601[_0x5ed9('0x41')],null))[_0x5ed9('0x35')](respondWithResult(_0x23ea4b,null))[_0x5ed9('0x3f')](handleError(_0x23ea4b,null));};exports[_0x5ed9('0x42')]=function(_0x2620f0,_0x4422dd){return db[_0x5ed9('0x15')][_0x5ed9('0x42')]()['then'](respondWithResult(_0x4422dd,null))[_0x5ed9('0x3f')](handleError(_0x4422dd,null));};exports[_0x5ed9('0x43')]=function(_0x134b29,_0x5e6515){var _0xb50921;var _0x4e65ed=_0x134b29[_0x5ed9('0x3a')]['id'];return db[_0x5ed9('0x15')][_0x5ed9('0x3e')]({'where':{'id':_0x134b29[_0x5ed9('0x3a')]['id']}})[_0x5ed9('0x35')](handleEntityNotFound(_0x5e6515,null))[_0x5ed9('0x35')](function(_0x17c434){if(_0x17c434){return _0x17c434[_0x5ed9('0x43')]()[_0x5ed9('0x35')](function(_0x2ec8c2){return _0x2ec8c2;});}})[_0x5ed9('0x35')](function(_0x345bff){_0xb50921=_0x345bff;if(_0x345bff){if(_0x345bff['VoiceQueueId']||_0x345bff[_0x5ed9('0x44')]){return db[_0x345bff[_0x5ed9('0x45')]?_0x5ed9('0x46'):_0x5ed9('0x47')][_0x5ed9('0x3e')]({'where':{'id':_0x345bff['VoiceQueueId']?_0x345bff['VoiceQueueId']:_0x345bff['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x44a1ee){var _0x1bb8b8={};if(_0x44a1ee){_[_0x5ed9('0x48')](_0x1bb8b8,_[_0x5ed9('0x49')](_0xb50921[_0x5ed9('0x4a')],[_0x5ed9('0x4b'),_0x5ed9('0x4c'),'id']));_0x1bb8b8[_0x5ed9('0x4d')]=0x15;_0x1bb8b8[_0x5ed9('0x4e')]=_0x5ed9('0x4f');_0x1bb8b8[_0x5ed9('0x50')]=_0x44a1ee[_0x5ed9('0x11')];_0x1bb8b8[_0x5ed9('0x51')]=_0x134b29[_0x5ed9('0x52')]['name'];_0x1bb8b8[_0x5ed9('0x53')]=_0x134b29[_0x5ed9('0x52')]['id'];_0x1bb8b8[_0x5ed9('0x4f')]=!![];_0x1bb8b8[_0x5ed9('0x54')]=moment()[_0x5ed9('0x55')](_0x5ed9('0x56'));_0x1bb8b8['calleridnum']=_0xb50921[_0x5ed9('0x57')];_0x1bb8b8['campaigntype']=_0xb50921['VoiceQueueId']?_0x5ed9('0x58'):'ivr';return db[_0x5ed9('0x59')][_0x5ed9('0x3e')]({'where':{'id':_0x1bb8b8['ContactId']},'attributes':[_0x5ed9('0x5a'),_0x5ed9('0x5b')]})[_0x5ed9('0x35')](function(_0x1c0321){if(!_['isNil'](_0x5e6515)&&!_['isNil'](_0x1c0321['firstName'])){_0x1bb8b8[_0x5ed9('0x5c')]=_0x1c0321[_0x5ed9('0x5a')];if(!_['isNil'](_0x1c0321[_0x5ed9('0x5b')])){_0x1bb8b8[_0x5ed9('0x5c')]+='\x20'+_0x1c0321['lastName'];}}})[_0x5ed9('0x5d')](function(){return db[_0x5ed9('0x5e')]['create'](_0x1bb8b8);});}})[_0x5ed9('0x35')](function(_0x3ce6ab){return db[_0x5ed9('0x5f')]['destroy']({'where':{'CmHopperId':_0x4e65ed}});})[_0x5ed9('0x35')](function(){return _0x5e6515[_0x5ed9('0x7')](0xcc)[_0x5ed9('0x60')]();})[_0x5ed9('0x3f')](handleError(_0x5e6515,null));};exports[_0x5ed9('0x61')]=function(_0x10340f,_0x21be65){var _0xe72d99=[];return db['CmContact'][_0x5ed9('0x42')]()[_0x5ed9('0x35')](function(_0x2b36d){_0xe72d99=_[_0x5ed9('0x17')](_0x2b36d);return _0x10340f[_0x5ed9('0x52')][_0x5ed9('0x62')]({'where':{'type':_0x5ed9('0x63'),'dialActive':!![],'dialMethod':_0x5ed9('0x64')},'attributes':['id',_0x5ed9('0x65'),_0x5ed9('0x66')],'raw':!![]});})[_0x5ed9('0x35')](function(_0x3b6d17){if(_0x3b6d17&&_0x3b6d17[_0x5ed9('0x2c')]){return db[_0x5ed9('0x67')][_0x5ed9('0x68')](function(_0x3d51b6){var _0x4b08b1={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5ed9('0x55')](_0x5ed9('0x56'))},'VoiceQueueId':{'$in':_['map'](_0x3b6d17,'id')},'$or':[{'UserId':null},{'UserId':_0x10340f[_0x5ed9('0x52')]['id']}]};var _0x97ab7e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3b6d17)[_0x5ed9('0x32')]([_0x5ed9('0x66'),0x0])[_0x5ed9('0x14')]('id')[_0x5ed9('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x10340f[_0x5ed9('0x52')]['id']}]};var _0xe56a17={'$or':[_0x4b08b1,_0x97ab7e]};var _0x54b343=[];if(_0x10340f[_0x5ed9('0x41')]['direction']&&_0x10340f['body'][_0x5ed9('0x6a')]===_0x5ed9('0x6b')){if(!_[_0x5ed9('0x6c')](_0x10340f['body'][_0x5ed9('0x6d')])){_0xe56a17['id']={'$in':_0x10340f[_0x5ed9('0x41')][_0x5ed9('0x6d')]};}_0x54b343=[[_0x5ed9('0x6e'),_0x5ed9('0x6f')],[_0x5ed9('0x70'),_0x3b6d17[0x0][_0x5ed9('0x65')]==='ASC'?'DESC':'ASC'],db[_0x5ed9('0x67')][_0x5ed9('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x5ed9('0x72')]];}else{if(!_[_0x5ed9('0x6c')](_0x10340f[_0x5ed9('0x41')][_0x5ed9('0x6d')])){_0xe56a17['id']={'$notIn':_0x10340f[_0x5ed9('0x41')][_0x5ed9('0x6d')]};}_0x54b343=[[_0x5ed9('0x6e'),_0x5ed9('0x72')],[_0x5ed9('0x70'),_0x3b6d17[0x0][_0x5ed9('0x65')]],db['sequelize'][_0x5ed9('0x71')](_0x5ed9('0x73')),['id',_0x5ed9('0x6f')]];}return db[_0x5ed9('0x15')][_0x5ed9('0x74')]({'attributes':['id',_0x5ed9('0x75'),_0x5ed9('0x57'),_0x5ed9('0x76')],'where':_0xe56a17,'order':_0x54b343,'transaction':_0x3d51b6,'lock':_0x3d51b6[_0x5ed9('0x77')][_0x5ed9('0x78')],'include':[{'model':db[_0x5ed9('0x59')],'as':_0x5ed9('0x79'),'attributes':_0xe72d99,'include':[{'model':db[_0x5ed9('0x7a')],'as':'Company','attributes':['id',_0x5ed9('0x11')]}]},{'model':db['CmList'],'as':_0x5ed9('0x7b'),'attributes':['id',_0x5ed9('0x11')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x5ed9('0x7c')]}]})[_0x5ed9('0x35')](function(_0x13560f){if(_0x13560f){return _0x13560f[_0x5ed9('0x7d')]({'UserId':_0x10340f[_0x5ed9('0x52')]['id']},{'transaction':_0x3d51b6});}});});}})['then'](handleEntityNotFound(_0x21be65,null))['then'](respondWithResult(_0x21be65,null))[_0x5ed9('0x3f')](handleError(_0x21be65,null));};exports[_0x5ed9('0x7e')]=function(_0x2aaa14,_0x64f4b7,_0x55821c){var _0x5bf1c0=[];var _0xbe0e06=_0x2aaa14['params']['id'];var _0x5f46f4=_0x2aaa14[_0x5ed9('0x52')]['id'];return db[_0x5ed9('0x59')][_0x5ed9('0x42')]()['then'](function(_0x24487f){_0x5bf1c0=_[_0x5ed9('0x17')](_0x24487f);return db['sequelize'][_0x5ed9('0x68')](function(_0x18e7a1){const _0x34362c={'id':_0xbe0e06};return db[_0x5ed9('0x15')]['findOne']({'attributes':['id',_0x5ed9('0x75'),'recallme'],'where':_0x34362c,'transaction':_0x18e7a1,'lock':_0x18e7a1[_0x5ed9('0x77')][_0x5ed9('0x78')],'include':[{'model':db[_0x5ed9('0x59')],'as':_0x5ed9('0x79'),'attributes':_0x5bf1c0,'include':[{'model':db[_0x5ed9('0x7a')],'as':'Company','attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x5ed9('0x11')]},{'model':db[_0x5ed9('0x46')],'as':_0x5ed9('0x7f'),'attributes':['id',_0x5ed9('0x11'),'dialActive']}]})[_0x5ed9('0x35')](function(_0x45cf95){if(_0x45cf95){return _0x45cf95['update']({'UserId':_0x5f46f4},{'transaction':_0x18e7a1});}});});})[_0x5ed9('0x35')](handleEntityNotFound(_0x64f4b7,null))[_0x5ed9('0x35')](respondWithResult(_0x64f4b7,null))[_0x5ed9('0x3f')](handleError(_0x64f4b7,null));};exports[_0x5ed9('0x80')]=function(_0x20a579,_0x533866){return _0x20a579[_0x5ed9('0x52')][_0x5ed9('0x62')]({'where':{'type':_0x5ed9('0x63'),'dialActive':!![],'dialMethod':_0x5ed9('0x64')},'attributes':['id'],'raw':!![]})[_0x5ed9('0x35')](function(_0x24d9fe){if(_0x24d9fe&&_0x24d9fe[_0x5ed9('0x2c')]){return db['CmHopper'][_0x5ed9('0xc')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5ed9('0x55')](_0x5ed9('0x56'))},'VoiceQueueId':{'$in':_[_0x5ed9('0x14')](_0x24d9fe,'id')},'$or':[{'UserId':null},{'UserId':_0x20a579[_0x5ed9('0x52')]['id']}]}});}return 0x0;})[_0x5ed9('0x35')](function(_0x565405){if(!_[_0x5ed9('0x81')](_0x565405)&&_[_0x5ed9('0x82')](_0x565405)){return _0x533866[_0x5ed9('0x7')](0xc8)[_0x5ed9('0x8')]({'contacts':_0x565405});}else{logger['error'](_0x5ed9('0x83'),'getOpenContacts',0x194,_0x5ed9('0x84'));_0x533866[_0x5ed9('0xf')](0x194);}})[_0x5ed9('0x3f')](handleError(_0x533866,null));};exports[_0x5ed9('0x85')]=function(_0x3b474e,_0x5db252){var _0x37b98a=shared[_0x5ed9('0x86')];var _0x682d7c=[];_[_0x5ed9('0x14')](_0x37b98a,function(_0x50d590){_0x682d7c[_0x5ed9('0x87')]({'id':_0x50d590[_0x5ed9('0x11')],'name':_0x50d590[_0x5ed9('0x11')],'utcOffset':_0x50d590['utcOffset']});});return _0x5db252[_0x5ed9('0x7')](0xc8)[_0x5ed9('0x8')]({'tz':_0x682d7c});};exports['getTimezone']=function(_0x1ea31e,_0x2d8868){var _0x2164f1=shared['timezones'];var _0x1bbb1a={};if(!_[_0x5ed9('0x81')](_0x2164f1[_0x1ea31e[_0x5ed9('0x41')]['id']]))_0x1bbb1a=_0x2164f1[_0x1ea31e[_0x5ed9('0x41')]['id']];return _0x2d8868[_0x5ed9('0x7')](0xc8)[_0x5ed9('0x8')](_0x1bbb1a);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 146c57f..f6526f0 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 _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ce479,_0x64fc6a){var _0x3d142f=function(_0x40f4a5){while(--_0x40f4a5){_0x4ce479['push'](_0x4ce479['shift']());}};_0x3d142f(++_0x64fc6a);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xfdbd[_0xf2662b];return _0x257dc7;};'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'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['define','CmHopper','cm_hopper','scheduledat','priority','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xda19,0xd5));var _0x9da1=function(_0x98eab9,_0x1f2132){_0x98eab9=_0x98eab9-0x0;var _0x238daa=_0xda19[_0x98eab9];return _0x238daa;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0x9da1('0xc'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 5b0a09c..19b548d 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 _0xbba0=['transaction','order','UPDATE','keys','User','Agent','voicePause','length','UserId','push','update','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','sequelize','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','describe','LOCK','GetContactByPhone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','\x20MINUTE','name','CmList','List','NOW()','util','moment','bluebird','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','findAll','raw','options','where','attributes','limit','map','model','include','then','catch','error','message','ShowCmHopper','find','info','CreateCmHopper','create','body','debug','UpdateCmHopper','stringify','active','DestroyCmHopper','destroy','GetContactDialer','CmContact'];(function(_0x1ea015,_0x5e416a){var _0x5ed37f=function(_0x50fae6){while(--_0x50fae6){_0x1ea015['push'](_0x1ea015['shift']());}};_0x5ed37f(++_0x5e416a);}(_0xbba0,0x7a));var _0x0bba=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xbba0[_0x173441];return _0x2423a8;};'use strict';var _=require('lodash');var util=require(_0x0bba('0x0'));var moment=require(_0x0bba('0x1'));var BPromise=require(_0x0bba('0x2'));var db=require(_0x0bba('0x3'))['db'];var logger=require(_0x0bba('0x4'))('rpc');exports[_0x0bba('0x5')]=function(_0x373397){var _0xf168f8=this;return new Promise(function(_0x4b9b57,_0x41aae9){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'raw':_0x373397['options']?_0x373397['options'][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x373397[_0x0bba('0x9')]?_0x373397['options'][_0x0bba('0xa')]||null:null,'attributes':_0x373397['options']?_0x373397[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x373397[_0x0bba('0x9')]?_0x373397['options'][_0x0bba('0xc')]||null:null,'include':_0x373397['options']?_0x373397[_0x0bba('0x9')]['include']?_[_0x0bba('0xd')](_0x373397[_0x0bba('0x9')]['include'],function(_0x2acd65){return{'model':db[_0x2acd65[_0x0bba('0xe')]],'as':_0x2acd65['as'],'attributes':_0x2acd65[_0x0bba('0xb')],'include':_0x2acd65[_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x2acd65[_0x0bba('0xf')],function(_0x5e9b12){return{'model':db[_0x5e9b12['model']],'as':_0x5e9b12['as'],'attributes':_0x5e9b12[_0x0bba('0xb')],'include':_0x5e9b12[_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x5e9b12[_0x0bba('0xf')],function(_0x14c9f5){return{'model':db[_0x14c9f5['model']],'as':_0x14c9f5['as'],'attributes':_0x14c9f5[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0bba('0x10')](function(_0x59b75a){logger['info']('GetCmHopper',_0x373397);logger['debug'](_0x0bba('0x5'),_0x373397,JSON['stringify'](_0x59b75a));_0x4b9b57(_0x59b75a);})[_0x0bba('0x11')](function(_0x1a4b53){logger[_0x0bba('0x12')]('GetCmHopper',_0x1a4b53[_0x0bba('0x13')],_0x373397);_0x41aae9(_0xf168f8['error'](0x1f4,_0x1a4b53[_0x0bba('0x13')]));});});};exports[_0x0bba('0x14')]=function(_0x5f541a){var _0x4a5c65=this;return new Promise(function(_0x5138cd,_0x46cd87){return db[_0x0bba('0x6')][_0x0bba('0x15')]({'raw':_0x5f541a['options']?_0x5f541a[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x5f541a[_0x0bba('0x9')]?_0x5f541a[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x5f541a[_0x0bba('0x9')]?_0x5f541a[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'include':_0x5f541a[_0x0bba('0x9')]?_0x5f541a[_0x0bba('0x9')][_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x5f541a['options'][_0x0bba('0xf')],function(_0x54fb27){return{'model':db[_0x54fb27[_0x0bba('0xe')]],'as':_0x54fb27['as'],'attributes':_0x54fb27[_0x0bba('0xb')],'include':_0x54fb27[_0x0bba('0xf')]?_['map'](_0x54fb27[_0x0bba('0xf')],function(_0x41a44d){return{'model':db[_0x41a44d[_0x0bba('0xe')]],'as':_0x41a44d['as'],'attributes':_0x41a44d[_0x0bba('0xb')],'include':_0x41a44d[_0x0bba('0xf')]?_['map'](_0x41a44d[_0x0bba('0xf')],function(_0x133edc){return{'model':db[_0x133edc[_0x0bba('0xe')]],'as':_0x133edc['as'],'attributes':_0x133edc[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0bba('0x10')](function(_0x2a7473){logger[_0x0bba('0x16')]('ShowCmHopper',_0x5f541a);logger['debug'](_0x0bba('0x14'),_0x5f541a,JSON['stringify'](_0x2a7473));_0x5138cd(_0x2a7473);})[_0x0bba('0x11')](function(_0x57f20d){logger[_0x0bba('0x12')]('ShowCmHopper',_0x57f20d[_0x0bba('0x13')],_0x5f541a);_0x46cd87(_0x4a5c65[_0x0bba('0x12')](0x1f4,_0x57f20d[_0x0bba('0x13')]));});});};exports[_0x0bba('0x17')]=function(_0x1fe086){var _0x51b87f=this;return new Promise(function(_0x3a8494,_0x508e26){return db[_0x0bba('0x6')][_0x0bba('0x18')](_0x1fe086[_0x0bba('0x19')],{'raw':_0x1fe086[_0x0bba('0x9')]?_0x1fe086[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![]})[_0x0bba('0x10')](function(_0x19a56e){logger['info'](_0x0bba('0x17'),_0x1fe086);logger[_0x0bba('0x1a')]('CreateCmHopper',_0x1fe086,JSON['stringify'](_0x19a56e));_0x3a8494(_0x19a56e);})[_0x0bba('0x11')](function(_0x1c4a04){logger['error'](_0x0bba('0x17'),_0x1c4a04[_0x0bba('0x13')],_0x1fe086);_0x508e26(_0x51b87f['error'](0x1f4,_0x1c4a04[_0x0bba('0x13')]));});});};exports[_0x0bba('0x1b')]=function(_0x46bfac){var _0xc9dfe6=this;return new Promise(function(_0x488e6e,_0x42691f){return db[_0x0bba('0x6')]['update'](_0x46bfac[_0x0bba('0x19')],{'raw':_0x46bfac[_0x0bba('0x9')]?_0x46bfac[_0x0bba('0x9')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46bfac[_0x0bba('0x9')]?_0x46bfac[_0x0bba('0x9')]['where']||null:null,'attributes':_0x46bfac[_0x0bba('0x9')]?_0x46bfac[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x46bfac['options']?_0x46bfac['options'][_0x0bba('0xc')]||null:null})[_0x0bba('0x10')](function(_0x2be602){logger[_0x0bba('0x16')](_0x0bba('0x1b'),_0x46bfac);logger[_0x0bba('0x16')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x0bba('0x1c')](_0x46bfac['options'][_0x0bba('0xa')]),_0x46bfac[_0x0bba('0x19')][_0x0bba('0x1d')]);logger['debug'](_0x0bba('0x1b'),_0x46bfac,JSON['stringify'](_0x2be602));_0x488e6e(_0x2be602);})['catch'](function(_0x4ef694){logger[_0x0bba('0x12')]('UpdateCmHopper',_0x4ef694[_0x0bba('0x13')],_0x46bfac);_0x42691f(_0xc9dfe6[_0x0bba('0x12')](0x1f4,_0x4ef694[_0x0bba('0x13')]));});});};exports[_0x0bba('0x1e')]=function(_0x24e7b7){var _0x24a64d=this;return new Promise(function(_0x54d58e,_0x2b48f8){return db[_0x0bba('0x6')][_0x0bba('0x1f')]({'where':_0x24e7b7['options']?_0x24e7b7[_0x0bba('0x9')][_0x0bba('0xa')]||null:null})['then'](function(_0x129847){logger['info'](_0x0bba('0x1e'),_0x24e7b7);logger[_0x0bba('0x1a')](_0x0bba('0x1e'),_0x24e7b7,JSON[_0x0bba('0x1c')](_0x129847));_0x54d58e(_0x129847);})[_0x0bba('0x11')](function(_0x3ed6af){logger[_0x0bba('0x12')](_0x0bba('0x1e'),_0x3ed6af['message'],_0x24e7b7);_0x2b48f8(_0x24a64d[_0x0bba('0x12')](0x1f4,_0x3ed6af[_0x0bba('0x13')]));});});};exports[_0x0bba('0x20')]=function(_0x2e3b68){var _0x19d636=this;return new Promise(function(_0x57b7d8,_0x4ef9ab){return db[_0x0bba('0x21')]['describe']()['then'](function(_0x15aa0d){return db['sequelize'][_0x0bba('0x22')](function(_0x7d7047){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'where':_0x2e3b68[_0x0bba('0x9')]?_0x2e3b68[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x2e3b68['options']?_0x2e3b68[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x2e3b68[_0x0bba('0x9')]?_0x2e3b68[_0x0bba('0x9')]['limit']||null:null,'order':_0x2e3b68['options']?_0x2e3b68['options'][_0x0bba('0x23')]||null:null,'transaction':_0x7d7047,'lock':_0x7d7047['LOCK'][_0x0bba('0x24')],'include':[{'model':db[_0x0bba('0x21')],'as':'Contact','attributes':_[_0x0bba('0x25')](_0x15aa0d)},{'model':db[_0x0bba('0x26')],'as':_0x0bba('0x27'),'attributes':['id','name',_0x0bba('0x28')]}]})[_0x0bba('0x10')](function(_0x5a7300){var _0x45b060=[];var _0x23c455=[];for(var _0x5960b1=0x0;_0x5960b1<_0x5a7300[_0x0bba('0x29')];_0x5960b1+=0x1){var _0x469e66=_0x5a7300[_0x5960b1][_0x0bba('0x2a')];if(_0x469e66===null){_0x45b060[_0x0bba('0x2b')](_0x5a7300[_0x5960b1][_0x0bba('0x2c')](_0x2e3b68[_0x0bba('0x19')],{'transaction':_0x7d7047}));}else if(!_0x23c455[_0x0bba('0x2d')](_0x469e66)){_0x23c455[_0x0bba('0x2b')](_0x469e66);_0x45b060[_0x0bba('0x2b')](_0x5a7300[_0x5960b1]['update'](_0x2e3b68['body'],{'transaction':_0x7d7047}));}}return BPromise[_0x0bba('0x2e')](_0x45b060);});})[_0x0bba('0x10')](function(_0x18517){logger['info'](_0x0bba('0x20'),_0x2e3b68);if(_0x18517[_0x0bba('0x29')]>0x0){logger[_0x0bba('0x16')](_0x0bba('0x2f'),_0x18517[0x0][_0x0bba('0x30')]['id'],_0x18517[0x0][_0x0bba('0x30')][_0x0bba('0x31')],_0x18517[0x0][_0x0bba('0x30')][_0x0bba('0x1d')]);}logger[_0x0bba('0x1a')]('GetContactDialer',_0x2e3b68,JSON['stringify'](_0x18517));_0x57b7d8(_0x18517);})['catch'](function(_0x48b88c){logger[_0x0bba('0x12')]('GetContactDialer',_0x48b88c[_0x0bba('0x13')],_0x2e3b68);_0x4ef9ab(_0x19d636[_0x0bba('0x12')](0x1f4,_0x48b88c[_0x0bba('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x431367){var _0x11b36d=this;return new Promise(function(_0x382fc3,_0x312ef3){return db['sequelize'][_0x0bba('0x22')](function(_0x5450e5){return db[_0x0bba('0x32')][_0x0bba('0x18')](_0x431367['body'],{'raw':_0x431367[_0x0bba('0x9')]?_0x431367[_0x0bba('0x9')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5450e5})[_0x0bba('0x10')](function(){logger[_0x0bba('0x16')]('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x431367[_0x0bba('0x9')][_0x0bba('0xa')]),_0x431367['options'][_0x0bba('0xa')]['active']);return db[_0x0bba('0x6')][_0x0bba('0x1f')]({'where':_0x431367[_0x0bba('0x9')]?_0x431367[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'transaction':_0x5450e5});});})['then'](function(_0x2d30dc){logger[_0x0bba('0x16')](_0x0bba('0x33'),_0x431367);logger[_0x0bba('0x1a')](_0x0bba('0x33'),_0x431367,JSON[_0x0bba('0x1c')](_0x2d30dc));_0x382fc3(_0x2d30dc);})[_0x0bba('0x11')](function(_0x3d75f9){logger[_0x0bba('0x12')](_0x0bba('0x33'),_0x3d75f9[_0x0bba('0x13')],_0x431367);_0x312ef3(_0x11b36d[_0x0bba('0x12')](0x1f4,_0x3d75f9[_0x0bba('0x13')]));});});};exports[_0x0bba('0x34')]=function(_0x2ca2bd){var _0x2f4a12=this;return new Promise(function(_0x3eae90,_0x25439d){return db['CmHopper'][_0x0bba('0x7')]({'raw':_0x2ca2bd[_0x0bba('0x9')]?_0x2ca2bd[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x2ca2bd['options']?_0x2ca2bd[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':[[db[_0x0bba('0x35')]['fn'](_0x0bba('0x36'),db[_0x0bba('0x35')]['fn']('IF',db[_0x0bba('0x35')]['literal'](_0x0bba('0x37')+util[_0x0bba('0x38')](_0x0bba('0x39'),moment()['format'](_0x0bba('0x3a')))+'\x20,\x201,\x20null'))),_0x0bba('0x3b')]]})[_0x0bba('0x10')](function(_0x50fda9){logger[_0x0bba('0x16')](_0x0bba('0x34'),_0x2ca2bd);logger['debug'](_0x0bba('0x34'),_0x2ca2bd,JSON[_0x0bba('0x1c')](_0x50fda9));_0x3eae90(_0x50fda9);})['catch'](function(_0x30b72e){logger['error'](_0x0bba('0x34'),_0x30b72e[_0x0bba('0x13')],_0x2ca2bd);_0x25439d(_0x2f4a12[_0x0bba('0x12')](0x1f4,_0x30b72e[_0x0bba('0x13')]));});});};exports[_0x0bba('0x3c')]=function(_0x7025ff){var _0x5474bb=this;return new Promise(function(_0x2aa825,_0xacd93e){return db[_0x0bba('0x21')][_0x0bba('0x3d')]()[_0x0bba('0x10')](function(){return db[_0x0bba('0x35')][_0x0bba('0x22')](function(_0x501599){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'where':_0x7025ff[_0x0bba('0x9')]?_0x7025ff[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x7025ff[_0x0bba('0x9')]?_0x7025ff[_0x0bba('0x9')]['attributes']||null:null,'limit':0x1,'order':_0x7025ff[_0x0bba('0x9')]?_0x7025ff['options'][_0x0bba('0x23')]||null:null,'group':db[_0x0bba('0x6')][_0x0bba('0x2a')],'transaction':_0x501599,'lock':_0x501599[_0x0bba('0x3e')][_0x0bba('0x24')],'include':_0x7025ff['options']?_0x7025ff[_0x0bba('0x9')]['include']?_['map'](_0x7025ff[_0x0bba('0x9')][_0x0bba('0xf')],function(_0x1c3e8b){return{'model':db[_0x1c3e8b['model']],'as':_0x1c3e8b['as'],'attributes':_0x1c3e8b['attributes'],'include':_0x1c3e8b[_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x1c3e8b[_0x0bba('0xf')],function(_0x47a795){return{'model':db[_0x47a795[_0x0bba('0xe')]],'as':_0x47a795['as'],'attributes':_0x47a795[_0x0bba('0xb')],'include':_0x47a795[_0x0bba('0xf')]?_['map'](_0x47a795['include'],function(_0x31c8fa){return{'model':db[_0x31c8fa['model']],'as':_0x31c8fa['as'],'attributes':_0x31c8fa[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe57caf){var _0x1d8172=[];for(var _0x389e6d=0x0;_0x389e6d<_0xe57caf['length'];_0x389e6d+=0x1){_0x1d8172['push'](_0xe57caf[_0x389e6d][_0x0bba('0x2c')](_0x7025ff[_0x0bba('0x19')],{'transaction':_0x501599}));}return BPromise['all'](_0x1d8172);});})['then'](function(_0x16e808){logger[_0x0bba('0x16')](_0x0bba('0x3c'),_0x7025ff);logger[_0x0bba('0x1a')](_0x0bba('0x3c'),_0x7025ff,JSON[_0x0bba('0x1c')](_0x16e808));_0x2aa825(_0x16e808);})[_0x0bba('0x11')](function(_0x3841b1){logger[_0x0bba('0x12')](_0x0bba('0x3c'),_0x3841b1[_0x0bba('0x13')],_0x7025ff);_0xacd93e(_0x5474bb[_0x0bba('0x12')](0x1f4,_0x3841b1[_0x0bba('0x13')]));});});});};exports['GetCmHopperPreview']=function(_0x57bfd3){var _0x269bdc=this;return new Promise(function(_0x11d9fb,_0x3e006d){db['CmContact'][_0x0bba('0x3d')]()['then'](function(_0x4c596d){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'raw':_0x57bfd3[_0x0bba('0x9')]?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0x8')]===undefined?!![]:![]:!![],'where':_0x57bfd3[_0x0bba('0x9')]?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xa')]||null:null,'attributes':_0x57bfd3['options']?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xb')]||null:null,'limit':_0x57bfd3[_0x0bba('0x9')]?_0x57bfd3['options'][_0x0bba('0xc')]||null:null,'include':_0x57bfd3['options']?_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xf')]?_[_0x0bba('0xd')](_0x57bfd3[_0x0bba('0x9')][_0x0bba('0xf')],function(_0x568745){return{'model':db[_0x568745[_0x0bba('0xe')]],'as':_0x568745['as'],'attributes':_0x568745['as']==='Contact'?_[_0x0bba('0x25')](_0x4c596d):_0x568745[_0x0bba('0xb')],'include':_0x568745[_0x0bba('0xf')]?_['map'](_0x568745[_0x0bba('0xf')],function(_0x23aec8){return{'model':db[_0x23aec8[_0x0bba('0xe')]],'as':_0x23aec8['as'],'attributes':_0x23aec8[_0x0bba('0xb')],'include':_0x23aec8['include']?_['map'](_0x23aec8['include'],function(_0x3a4c43){return{'model':db[_0x3a4c43['model']],'as':_0x3a4c43['as'],'attributes':_0x3a4c43[_0x0bba('0xb')]};}):[]};}):[]};}):[]:[]})[_0x0bba('0x10')](function(_0x1616de){logger[_0x0bba('0x16')](_0x0bba('0x5'),_0x57bfd3);logger[_0x0bba('0x1a')](_0x0bba('0x5'),_0x57bfd3,JSON['stringify'](_0x1616de));_0x11d9fb(_0x1616de);})[_0x0bba('0x11')](function(_0x526d75){logger[_0x0bba('0x12')]('GetCmHopper',_0x526d75[_0x0bba('0x13')],_0x57bfd3);_0x3e006d(_0x269bdc[_0x0bba('0x12')](0x1f4,_0x526d75[_0x0bba('0x13')]));});});});};exports[_0x0bba('0x3f')]=function(_0x514a2f){var _0x370110=this;return new Promise(function(_0x228af9,_0x1760e0){return db[_0x0bba('0x21')]['findOne']({'raw':!![],'where':{'phone':_0x514a2f[_0x0bba('0x9')][_0x0bba('0xa')]['phone']},'attributes':['id',_0x0bba('0x40')],'order':[['id',_0x0bba('0x41')]]})[_0x0bba('0x10')](function(_0x300796){logger[_0x0bba('0x16')](_0x0bba('0x42'),_0x514a2f);logger[_0x0bba('0x1a')](_0x0bba('0x42'),_0x514a2f,JSON[_0x0bba('0x1c')](_0x300796));_0x228af9(_0x300796);})[_0x0bba('0x11')](function(_0x3d10ad){logger[_0x0bba('0x12')]('getContactByPhone',_0x3d10ad[_0x0bba('0x13')],_0x514a2f);_0x1760e0(_0x370110[_0x0bba('0x12')](0x1f4,_0x3d10ad[_0x0bba('0x13')]));});});};exports[_0x0bba('0x43')]=function(_0x26a063){var _0x399c3e=this;return new Promise(function(_0x3fa69f,_0x1a1c3b){return db[_0x0bba('0x35')][_0x0bba('0x22')](function(_0x3783b0){var _0x18de26=_0x26a063[_0x0bba('0x9')]&&_0x26a063[_0x0bba('0x9')][_0x0bba('0xa')]?_0x26a063[_0x0bba('0x9')][_0x0bba('0xa')]:{};return db['CmHopper'][_0x0bba('0x2c')](_0x26a063['body'],{'where':_0x18de26,'transaction':_0x3783b0})[_0x0bba('0x10')](function(_0x34b3f9){logger[_0x0bba('0x16')]('ResetActiveCalls',_0x26a063);logger[_0x0bba('0x1a')](_0x0bba('0x43'),_0x26a063,JSON[_0x0bba('0x1c')](_0x34b3f9));_0x3fa69f(_0x34b3f9);})[_0x0bba('0x11')](function(_0x4039a7){logger[_0x0bba('0x12')](_0x0bba('0x43'),_0x4039a7[_0x0bba('0x13')],_0x26a063);_0x1a1c3b(_0x399c3e['error'](0x1f4,_0x4039a7[_0x0bba('0x13')]));});});});};exports[_0x0bba('0x44')]=function(_0x5a765d){var _0x36a10b=this;var _0x42134f=_0x5a765d['body']['where'][_0x0bba('0x45')];var _0x668ea8=_0x5a765d[_0x0bba('0x19')][_0x0bba('0xa')][_0x0bba('0x46')];var _0x28af12=_0x5a765d['body'][_0x0bba('0xa')][_0x0bba('0x47')];return new Promise(function(_0x27a848,_0xf039f6){return db[_0x0bba('0x6')][_0x0bba('0x7')]({'where':{'voiceQueueId':{'$in':_0x42134f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x0bba('0x48')]('NOW()\x20+\x20INTERVAL\x20'+_0x668ea8+_0x0bba('0x49')),'$gt':db[_0x0bba('0x35')][_0x0bba('0x48')]('NOW()')}},'UserId':{'$in':_0x28af12}},'include':[{'model':db[_0x0bba('0x21')],'as':'Contact'},{'model':db['User'],'as':_0x0bba('0x27'),'attributes':['id',_0x0bba('0x4a'),_0x0bba('0x28')]},{'model':db[_0x0bba('0x4b')],'as':_0x0bba('0x4c')}]})[_0x0bba('0x10')](function(_0xdbeeeb){if(_0xdbeeeb['length']>0x0){return db[_0x0bba('0x35')][_0x0bba('0x22')](function(_0x38b483){return db['CmHopper'][_0x0bba('0x2c')]({'recallmeNotifiedDate':db[_0x0bba('0x35')][_0x0bba('0x48')](_0x0bba('0x4d'))},{'where':{'id':{'$in':_[_0x0bba('0xd')](_0xdbeeeb,'id')}},'transaction':_0x38b483})[_0x0bba('0x10')](function(){_0x27a848(_0xdbeeeb);})[_0x0bba('0x11')](function(_0x15e79f){logger[_0x0bba('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x15e79f[_0x0bba('0x13')],_0x5a765d);_0xf039f6(_0x36a10b['error'](0x1f4,_0x15e79f[_0x0bba('0x13')]));});})[_0x0bba('0x11')](function(_0x8971ff){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x8971ff['message'],_0x5a765d);_0xf039f6(_0x36a10b['error'](0x1f4,_0x8971ff[_0x0bba('0x13')]));});}else{_0x27a848(_0xdbeeeb);}});});}; \ No newline at end of file +var _0x1c76=['dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','List','lodash','util','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','then','info','debug','stringify','catch','error','message','ShowCmHopper','find','raw','CreateCmHopper','create','body','update','UpdateCmHopper','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','order','CmContact','Contact','keys','User','Agent','name','voicePause','length','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','UserId','all','GetContactRecallMe','GetContactByPhone','findOne','phone'];(function(_0x6e3a96,_0xdd3dd4){var _0x1f57cb=function(_0x4f9aaa){while(--_0x4f9aaa){_0x6e3a96['push'](_0x6e3a96['shift']());}};_0x1f57cb(++_0xdd3dd4);}(_0x1c76,0x1d9));var _0x61c7=function(_0x1590b4,_0xa4b999){_0x1590b4=_0x1590b4-0x0;var _0x461a1a=_0x1c76[_0x1590b4];return _0x461a1a;};'use strict';var _=require(_0x61c7('0x0'));var util=require(_0x61c7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var db=require(_0x61c7('0x2'))['db'];var logger=require(_0x61c7('0x3'))(_0x61c7('0x4'));exports[_0x61c7('0x5')]=function(_0x3c3514){var _0x10713a=this;return new Promise(function(_0x2a71db,_0x2d92ba){return db[_0x61c7('0x6')][_0x61c7('0x7')]({'raw':_0x3c3514[_0x61c7('0x8')]?_0x3c3514['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c3514[_0x61c7('0x8')]?_0x3c3514[_0x61c7('0x8')][_0x61c7('0x9')]||null:null,'attributes':_0x3c3514['options']?_0x3c3514[_0x61c7('0x8')][_0x61c7('0xa')]||null:null,'limit':_0x3c3514[_0x61c7('0x8')]?_0x3c3514[_0x61c7('0x8')][_0x61c7('0xb')]||null:null,'include':_0x3c3514[_0x61c7('0x8')]?_0x3c3514[_0x61c7('0x8')][_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x3c3514[_0x61c7('0x8')]['include'],function(_0x559187){return{'model':db[_0x559187[_0x61c7('0xe')]],'as':_0x559187['as'],'attributes':_0x559187[_0x61c7('0xa')],'include':_0x559187[_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x559187[_0x61c7('0xc')],function(_0x529cfb){return{'model':db[_0x529cfb['model']],'as':_0x529cfb['as'],'attributes':_0x529cfb['attributes'],'include':_0x529cfb[_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x529cfb[_0x61c7('0xc')],function(_0x5a0b86){return{'model':db[_0x5a0b86[_0x61c7('0xe')]],'as':_0x5a0b86['as'],'attributes':_0x5a0b86[_0x61c7('0xa')]};}):[]};}):[]};}):[]:[]})[_0x61c7('0xf')](function(_0x5c4641){logger[_0x61c7('0x10')]('GetCmHopper',_0x3c3514);logger[_0x61c7('0x11')](_0x61c7('0x5'),_0x3c3514,JSON[_0x61c7('0x12')](_0x5c4641));_0x2a71db(_0x5c4641);})[_0x61c7('0x13')](function(_0x10d7f3){logger[_0x61c7('0x14')](_0x61c7('0x5'),_0x10d7f3[_0x61c7('0x15')],_0x3c3514);_0x2d92ba(_0x10713a[_0x61c7('0x14')](0x1f4,_0x10d7f3[_0x61c7('0x15')]));});});};exports[_0x61c7('0x16')]=function(_0x30d634){var _0x1d1797=this;return new Promise(function(_0xf8e475,_0x4410e2){return db[_0x61c7('0x6')][_0x61c7('0x17')]({'raw':_0x30d634[_0x61c7('0x8')]?_0x30d634[_0x61c7('0x8')][_0x61c7('0x18')]===undefined?!![]:![]:!![],'where':_0x30d634[_0x61c7('0x8')]?_0x30d634['options'][_0x61c7('0x9')]||null:null,'attributes':_0x30d634[_0x61c7('0x8')]?_0x30d634[_0x61c7('0x8')]['attributes']||null:null,'include':_0x30d634[_0x61c7('0x8')]?_0x30d634[_0x61c7('0x8')][_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x30d634[_0x61c7('0x8')]['include'],function(_0x1160bc){return{'model':db[_0x1160bc['model']],'as':_0x1160bc['as'],'attributes':_0x1160bc[_0x61c7('0xa')],'include':_0x1160bc[_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x1160bc[_0x61c7('0xc')],function(_0xad9c27){return{'model':db[_0xad9c27[_0x61c7('0xe')]],'as':_0xad9c27['as'],'attributes':_0xad9c27[_0x61c7('0xa')],'include':_0xad9c27[_0x61c7('0xc')]?_[_0x61c7('0xd')](_0xad9c27[_0x61c7('0xc')],function(_0x437651){return{'model':db[_0x437651[_0x61c7('0xe')]],'as':_0x437651['as'],'attributes':_0x437651['attributes']};}):[]};}):[]};}):[]:[]})[_0x61c7('0xf')](function(_0x2491c0){logger[_0x61c7('0x10')](_0x61c7('0x16'),_0x30d634);logger['debug']('ShowCmHopper',_0x30d634,JSON[_0x61c7('0x12')](_0x2491c0));_0xf8e475(_0x2491c0);})['catch'](function(_0x2ccd55){logger[_0x61c7('0x14')]('ShowCmHopper',_0x2ccd55[_0x61c7('0x15')],_0x30d634);_0x4410e2(_0x1d1797[_0x61c7('0x14')](0x1f4,_0x2ccd55[_0x61c7('0x15')]));});});};exports[_0x61c7('0x19')]=function(_0x30acc7){var _0x104a77=this;return new Promise(function(_0x41ec13,_0xefee9c){return db[_0x61c7('0x6')][_0x61c7('0x1a')](_0x30acc7[_0x61c7('0x1b')],{'raw':_0x30acc7['options']?_0x30acc7[_0x61c7('0x8')][_0x61c7('0x18')]===undefined?!![]:![]:!![]})[_0x61c7('0xf')](function(_0xf3220d){logger[_0x61c7('0x10')](_0x61c7('0x19'),_0x30acc7);logger[_0x61c7('0x11')](_0x61c7('0x19'),_0x30acc7,JSON[_0x61c7('0x12')](_0xf3220d));_0x41ec13(_0xf3220d);})['catch'](function(_0x2979bc){logger['error']('CreateCmHopper',_0x2979bc['message'],_0x30acc7);_0xefee9c(_0x104a77[_0x61c7('0x14')](0x1f4,_0x2979bc[_0x61c7('0x15')]));});});};exports['UpdateCmHopper']=function(_0x311e0e){var _0x54e5fe=this;return new Promise(function(_0x5c194e,_0x5806f4){return db[_0x61c7('0x6')][_0x61c7('0x1c')](_0x311e0e[_0x61c7('0x1b')],{'raw':_0x311e0e[_0x61c7('0x8')]?_0x311e0e['options'][_0x61c7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x311e0e[_0x61c7('0x8')]?_0x311e0e[_0x61c7('0x8')][_0x61c7('0x9')]||null:null,'attributes':_0x311e0e[_0x61c7('0x8')]?_0x311e0e[_0x61c7('0x8')][_0x61c7('0xa')]||null:null,'limit':_0x311e0e[_0x61c7('0x8')]?_0x311e0e[_0x61c7('0x8')][_0x61c7('0xb')]||null:null})[_0x61c7('0xf')](function(_0x2690a6){logger[_0x61c7('0x10')](_0x61c7('0x1d'),_0x311e0e);logger[_0x61c7('0x10')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x311e0e['options'][_0x61c7('0x9')]),_0x311e0e[_0x61c7('0x1b')][_0x61c7('0x1e')]);logger[_0x61c7('0x11')](_0x61c7('0x1d'),_0x311e0e,JSON[_0x61c7('0x12')](_0x2690a6));_0x5c194e(_0x2690a6);})[_0x61c7('0x13')](function(_0x365358){logger[_0x61c7('0x14')](_0x61c7('0x1d'),_0x365358[_0x61c7('0x15')],_0x311e0e);_0x5806f4(_0x54e5fe['error'](0x1f4,_0x365358['message']));});});};exports[_0x61c7('0x1f')]=function(_0x21c311){var _0x204481=this;return new Promise(function(_0x15427b,_0x18253b){return db[_0x61c7('0x6')][_0x61c7('0x20')]({'where':_0x21c311[_0x61c7('0x8')]?_0x21c311['options'][_0x61c7('0x9')]||null:null})[_0x61c7('0xf')](function(_0x3920cf){logger['info'](_0x61c7('0x1f'),_0x21c311);logger['debug']('DestroyCmHopper',_0x21c311,JSON[_0x61c7('0x12')](_0x3920cf));_0x15427b(_0x3920cf);})[_0x61c7('0x13')](function(_0x5ef1d2){logger[_0x61c7('0x14')]('DestroyCmHopper',_0x5ef1d2[_0x61c7('0x15')],_0x21c311);_0x18253b(_0x204481[_0x61c7('0x14')](0x1f4,_0x5ef1d2[_0x61c7('0x15')]));});});};exports[_0x61c7('0x21')]=function(_0x266e45){var _0x51b689=this;return new Promise(function(_0x2d980f,_0x480751){return db['CmContact'][_0x61c7('0x22')]()[_0x61c7('0xf')](function(_0x688133){return db[_0x61c7('0x23')][_0x61c7('0x24')](function(_0x2350d4){return db[_0x61c7('0x6')][_0x61c7('0x7')]({'where':_0x266e45['options']?_0x266e45[_0x61c7('0x8')][_0x61c7('0x9')]||null:null,'attributes':_0x266e45[_0x61c7('0x8')]?_0x266e45[_0x61c7('0x8')][_0x61c7('0xa')]||null:null,'limit':_0x266e45[_0x61c7('0x8')]?_0x266e45[_0x61c7('0x8')][_0x61c7('0xb')]||null:null,'order':_0x266e45['options']?_0x266e45[_0x61c7('0x8')][_0x61c7('0x25')]||null:null,'transaction':_0x2350d4,'lock':_0x2350d4['LOCK']['UPDATE'],'include':[{'model':db[_0x61c7('0x26')],'as':_0x61c7('0x27'),'attributes':_[_0x61c7('0x28')](_0x688133)},{'model':db[_0x61c7('0x29')],'as':_0x61c7('0x2a'),'attributes':['id',_0x61c7('0x2b'),_0x61c7('0x2c')]}]})['then'](function(_0x54143c){var _0x52727f=[];var _0x545b19=[];for(var _0x13a31f=0x0;_0x13a31f<_0x54143c[_0x61c7('0x2d')];_0x13a31f+=0x1){var _0x3039a6=_0x54143c[_0x13a31f]['UserId'];if(_0x3039a6===null){_0x52727f[_0x61c7('0x2e')](_0x54143c[_0x13a31f][_0x61c7('0x1c')](_0x266e45['body'],{'transaction':_0x2350d4}));}else if(!_0x545b19[_0x61c7('0x2f')](_0x3039a6)){_0x545b19[_0x61c7('0x2e')](_0x3039a6);_0x52727f['push'](_0x54143c[_0x13a31f][_0x61c7('0x1c')](_0x266e45[_0x61c7('0x1b')],{'transaction':_0x2350d4}));}}return BPromise['all'](_0x52727f);});})[_0x61c7('0xf')](function(_0x3cb95f){logger[_0x61c7('0x10')](_0x61c7('0x21'),_0x266e45);if(_0x3cb95f['length']>0x0){logger['info'](_0x61c7('0x30'),_0x3cb95f[0x0][_0x61c7('0x31')]['id'],_0x3cb95f[0x0][_0x61c7('0x31')]['ContactId'],_0x3cb95f[0x0]['dataValues']['active']);}logger[_0x61c7('0x11')](_0x61c7('0x21'),_0x266e45,JSON[_0x61c7('0x12')](_0x3cb95f));_0x2d980f(_0x3cb95f);})[_0x61c7('0x13')](function(_0x2a7808){logger['error'](_0x61c7('0x21'),_0x2a7808['message'],_0x266e45);_0x480751(_0x51b689[_0x61c7('0x14')](0x1f4,_0x2a7808['message']));});});});};exports[_0x61c7('0x32')]=function(_0xb703ee){var _0x4e4d50=this;return new Promise(function(_0x3df3d8,_0x1574ad){return db[_0x61c7('0x23')][_0x61c7('0x24')](function(_0x2f3fc8){return db[_0x61c7('0x33')][_0x61c7('0x1a')](_0xb703ee[_0x61c7('0x1b')],{'raw':_0xb703ee[_0x61c7('0x8')]?_0xb703ee[_0x61c7('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0x2f3fc8})[_0x61c7('0xf')](function(){logger[_0x61c7('0x10')](_0x61c7('0x34'),JSON[_0x61c7('0x12')](_0xb703ee[_0x61c7('0x8')][_0x61c7('0x9')]),_0xb703ee[_0x61c7('0x8')][_0x61c7('0x9')]['active']);return db[_0x61c7('0x6')]['destroy']({'where':_0xb703ee[_0x61c7('0x8')]?_0xb703ee['options'][_0x61c7('0x9')]||null:null,'transaction':_0x2f3fc8});});})[_0x61c7('0xf')](function(_0x1ae8d2){logger[_0x61c7('0x10')](_0x61c7('0x32'),_0xb703ee);logger['debug'](_0x61c7('0x32'),_0xb703ee,JSON[_0x61c7('0x12')](_0x1ae8d2));_0x3df3d8(_0x1ae8d2);})['catch'](function(_0x5346b4){logger[_0x61c7('0x14')](_0x61c7('0x32'),_0x5346b4[_0x61c7('0x15')],_0xb703ee);_0x1574ad(_0x4e4d50[_0x61c7('0x14')](0x1f4,_0x5346b4[_0x61c7('0x15')]));});});};exports[_0x61c7('0x35')]=function(_0x13b3c1){var _0x4f3d79=this;return new Promise(function(_0x284f9e,_0x404a71){return db[_0x61c7('0x6')]['findAll']({'raw':_0x13b3c1['options']?_0x13b3c1[_0x61c7('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x13b3c1[_0x61c7('0x8')]?_0x13b3c1[_0x61c7('0x8')][_0x61c7('0x9')]||null:null,'attributes':[[db[_0x61c7('0x23')]['fn'](_0x61c7('0x36'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x61c7('0x37')+util['format'](_0x61c7('0x38'),moment()[_0x61c7('0x39')](_0x61c7('0x3a')))+'\x20,\x201,\x20null'))),_0x61c7('0x3b')]]})[_0x61c7('0xf')](function(_0x37ce82){logger['info'](_0x61c7('0x35'),_0x13b3c1);logger['debug']('CountReScheduled',_0x13b3c1,JSON['stringify'](_0x37ce82));_0x284f9e(_0x37ce82);})['catch'](function(_0x30235d){logger[_0x61c7('0x14')](_0x61c7('0x35'),_0x30235d[_0x61c7('0x15')],_0x13b3c1);_0x404a71(_0x4f3d79[_0x61c7('0x14')](0x1f4,_0x30235d[_0x61c7('0x15')]));});});};exports['GetContactRecallMe']=function(_0x4650fe){var _0x458e2d=this;return new Promise(function(_0x5e1602,_0x372d32){return db[_0x61c7('0x26')]['describe']()['then'](function(){return db[_0x61c7('0x23')]['transaction'](function(_0x13374a){return db[_0x61c7('0x6')][_0x61c7('0x7')]({'where':_0x4650fe[_0x61c7('0x8')]?_0x4650fe[_0x61c7('0x8')][_0x61c7('0x9')]||null:null,'attributes':_0x4650fe[_0x61c7('0x8')]?_0x4650fe[_0x61c7('0x8')][_0x61c7('0xa')]||null:null,'limit':0x1,'order':_0x4650fe[_0x61c7('0x8')]?_0x4650fe[_0x61c7('0x8')][_0x61c7('0x25')]||null:null,'group':db[_0x61c7('0x6')][_0x61c7('0x3c')],'transaction':_0x13374a,'lock':_0x13374a['LOCK']['UPDATE'],'include':_0x4650fe[_0x61c7('0x8')]?_0x4650fe[_0x61c7('0x8')][_0x61c7('0xc')]?_['map'](_0x4650fe['options']['include'],function(_0x1fbb5b){return{'model':db[_0x1fbb5b[_0x61c7('0xe')]],'as':_0x1fbb5b['as'],'attributes':_0x1fbb5b[_0x61c7('0xa')],'include':_0x1fbb5b[_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x1fbb5b[_0x61c7('0xc')],function(_0x56aac0){return{'model':db[_0x56aac0[_0x61c7('0xe')]],'as':_0x56aac0['as'],'attributes':_0x56aac0[_0x61c7('0xa')],'include':_0x56aac0[_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x56aac0[_0x61c7('0xc')],function(_0x2a49ce){return{'model':db[_0x2a49ce[_0x61c7('0xe')]],'as':_0x2a49ce['as'],'attributes':_0x2a49ce[_0x61c7('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39922b){var _0x1ef0b3=[];for(var _0x3744b9=0x0;_0x3744b9<_0x39922b[_0x61c7('0x2d')];_0x3744b9+=0x1){_0x1ef0b3[_0x61c7('0x2e')](_0x39922b[_0x3744b9][_0x61c7('0x1c')](_0x4650fe['body'],{'transaction':_0x13374a}));}return BPromise[_0x61c7('0x3d')](_0x1ef0b3);});})[_0x61c7('0xf')](function(_0x19aeb5){logger[_0x61c7('0x10')](_0x61c7('0x3e'),_0x4650fe);logger[_0x61c7('0x11')](_0x61c7('0x3e'),_0x4650fe,JSON[_0x61c7('0x12')](_0x19aeb5));_0x5e1602(_0x19aeb5);})[_0x61c7('0x13')](function(_0x390b53){logger[_0x61c7('0x14')](_0x61c7('0x3e'),_0x390b53[_0x61c7('0x15')],_0x4650fe);_0x372d32(_0x458e2d[_0x61c7('0x14')](0x1f4,_0x390b53[_0x61c7('0x15')]));});});});};exports['GetCmHopperPreview']=function(_0x493bb8){var _0x4e981f=this;return new Promise(function(_0x1726bb,_0xbceb50){db['CmContact'][_0x61c7('0x22')]()[_0x61c7('0xf')](function(_0xb42f2f){return db[_0x61c7('0x6')][_0x61c7('0x7')]({'raw':_0x493bb8[_0x61c7('0x8')]?_0x493bb8[_0x61c7('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x493bb8[_0x61c7('0x8')]?_0x493bb8['options'][_0x61c7('0x9')]||null:null,'attributes':_0x493bb8[_0x61c7('0x8')]?_0x493bb8[_0x61c7('0x8')]['attributes']||null:null,'limit':_0x493bb8['options']?_0x493bb8['options'][_0x61c7('0xb')]||null:null,'include':_0x493bb8[_0x61c7('0x8')]?_0x493bb8[_0x61c7('0x8')][_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x493bb8['options'][_0x61c7('0xc')],function(_0x4eacb7){return{'model':db[_0x4eacb7[_0x61c7('0xe')]],'as':_0x4eacb7['as'],'attributes':_0x4eacb7['as']===_0x61c7('0x27')?_[_0x61c7('0x28')](_0xb42f2f):_0x4eacb7[_0x61c7('0xa')],'include':_0x4eacb7[_0x61c7('0xc')]?_['map'](_0x4eacb7[_0x61c7('0xc')],function(_0x5270f0){return{'model':db[_0x5270f0[_0x61c7('0xe')]],'as':_0x5270f0['as'],'attributes':_0x5270f0[_0x61c7('0xa')],'include':_0x5270f0[_0x61c7('0xc')]?_[_0x61c7('0xd')](_0x5270f0['include'],function(_0x4233ba){return{'model':db[_0x4233ba[_0x61c7('0xe')]],'as':_0x4233ba['as'],'attributes':_0x4233ba[_0x61c7('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d42ae){logger[_0x61c7('0x10')]('GetCmHopper',_0x493bb8);logger['debug'](_0x61c7('0x5'),_0x493bb8,JSON[_0x61c7('0x12')](_0x5d42ae));_0x1726bb(_0x5d42ae);})[_0x61c7('0x13')](function(_0x4456b8){logger[_0x61c7('0x14')]('GetCmHopper',_0x4456b8[_0x61c7('0x15')],_0x493bb8);_0xbceb50(_0x4e981f[_0x61c7('0x14')](0x1f4,_0x4456b8[_0x61c7('0x15')]));});});});};exports[_0x61c7('0x3f')]=function(_0x7d8e7a){var _0x327161=this;return new Promise(function(_0x169e4b,_0x3f8f7e){return db['CmContact'][_0x61c7('0x40')]({'raw':!![],'where':{'phone':_0x7d8e7a[_0x61c7('0x8')][_0x61c7('0x9')][_0x61c7('0x41')]},'attributes':['id',_0x61c7('0x42')],'order':[['id',_0x61c7('0x43')]]})[_0x61c7('0xf')](function(_0x5a970d){logger[_0x61c7('0x10')](_0x61c7('0x44'),_0x7d8e7a);logger[_0x61c7('0x11')]('getContactByPhone',_0x7d8e7a,JSON[_0x61c7('0x12')](_0x5a970d));_0x169e4b(_0x5a970d);})[_0x61c7('0x13')](function(_0x5d7109){logger[_0x61c7('0x14')](_0x61c7('0x44'),_0x5d7109[_0x61c7('0x15')],_0x7d8e7a);_0x3f8f7e(_0x327161['error'](0x1f4,_0x5d7109['message']));});});};exports[_0x61c7('0x45')]=function(_0x42d1df){var _0x2d7dbf=this;return new Promise(function(_0x2d1707,_0x8040ab){return db[_0x61c7('0x23')][_0x61c7('0x24')](function(_0x1b2188){var _0x1b8660=_0x42d1df[_0x61c7('0x8')]&&_0x42d1df[_0x61c7('0x8')]['where']?_0x42d1df['options'][_0x61c7('0x9')]:{};return db[_0x61c7('0x6')][_0x61c7('0x1c')](_0x42d1df[_0x61c7('0x1b')],{'where':_0x1b8660,'transaction':_0x1b2188})[_0x61c7('0xf')](function(_0x1bb389){logger[_0x61c7('0x10')]('ResetActiveCalls',_0x42d1df);logger[_0x61c7('0x11')]('ResetActiveCalls',_0x42d1df,JSON[_0x61c7('0x12')](_0x1bb389));_0x2d1707(_0x1bb389);})['catch'](function(_0x10d747){logger[_0x61c7('0x14')](_0x61c7('0x45'),_0x10d747['message'],_0x42d1df);_0x8040ab(_0x2d7dbf[_0x61c7('0x14')](0x1f4,_0x10d747[_0x61c7('0x15')]));});});});};exports[_0x61c7('0x46')]=function(_0x2a5c41){var _0x538edc=this;var _0x28c50e=_0x2a5c41[_0x61c7('0x1b')][_0x61c7('0x9')]['voiceQueueIds'];var _0x28c8c0=_0x2a5c41[_0x61c7('0x1b')]['where']['interval'];var _0x569010=_0x2a5c41[_0x61c7('0x1b')][_0x61c7('0x9')]['availableAgentsIds'];return new Promise(function(_0x3b0cc9,_0x4fe46b){return db[_0x61c7('0x6')][_0x61c7('0x7')]({'where':{'voiceQueueId':{'$in':_0x28c50e},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x61c7('0x47')](_0x61c7('0x48')+_0x28c8c0+_0x61c7('0x49')),'$gt':db[_0x61c7('0x23')][_0x61c7('0x47')](_0x61c7('0x4a'))}},'UserId':{'$in':_0x569010}},'include':[{'model':db[_0x61c7('0x26')],'as':'Contact'},{'model':db[_0x61c7('0x29')],'as':_0x61c7('0x2a'),'attributes':['id','name',_0x61c7('0x2c')]},{'model':db[_0x61c7('0x4b')],'as':_0x61c7('0x4c')}]})['then'](function(_0x1c4a00){if(_0x1c4a00[_0x61c7('0x2d')]>0x0){return db[_0x61c7('0x23')]['transaction'](function(_0x4f0e1a){return db['CmHopper'][_0x61c7('0x1c')]({'recallmeNotifiedDate':db[_0x61c7('0x23')][_0x61c7('0x47')](_0x61c7('0x4a'))},{'where':{'id':{'$in':_[_0x61c7('0xd')](_0x1c4a00,'id')}},'transaction':_0x4f0e1a})['then'](function(){_0x3b0cc9(_0x1c4a00);})[_0x61c7('0x13')](function(_0x296b03){logger['error'](_0x61c7('0x46'),_0x296b03['message'],_0x2a5c41);_0x4fe46b(_0x538edc[_0x61c7('0x14')](0x1f4,_0x296b03['message']));});})[_0x61c7('0x13')](function(_0x5416bf){logger[_0x61c7('0x14')](_0x61c7('0x46'),_0x5416bf[_0x61c7('0x15')],_0x2a5c41);_0x4fe46b(_0x538edc['error'](0x1f4,_0x5416bf[_0x61c7('0x15')]));});}else{_0x3b0cc9(_0x1c4a00);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 380cfe1..1d5ed93 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 _0xed25=['post','create','/preview','/timezone','getTimezone','put','update','delete','destroy','exports','Router','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall'];(function(_0x1f4e09,_0x1fc591){var _0x10deec=function(_0x5c1fb9){while(--_0x5c1fb9){_0x1f4e09['push'](_0x1f4e09['shift']());}};_0x10deec(++_0x1fc591);}(_0xed25,0x1cc));var _0x5ed2=function(_0xa1ae5c,_0x44beef){_0xa1ae5c=_0xa1ae5c-0x0;var _0x4573c1=_0xed25[_0xa1ae5c];return _0x4573c1;};'use strict';var express=require('express');var router=express[_0x5ed2('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5ed2('0x1'));router[_0x5ed2('0x2')]('/',auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x4')]);router[_0x5ed2('0x2')](_0x5ed2('0x5'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x6')]);router[_0x5ed2('0x2')](_0x5ed2('0x7'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x8')]);router['get'](_0x5ed2('0x9'),auth['isAuthenticated'](),controller[_0x5ed2('0xa')]);router[_0x5ed2('0x2')](_0x5ed2('0xb'),auth['isAuthenticated'](),controller[_0x5ed2('0xc')]);router['get'](_0x5ed2('0xd'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0xe')]);router[_0x5ed2('0xf')]('/',auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x10')]);router[_0x5ed2('0xf')](_0x5ed2('0x11'),auth[_0x5ed2('0x3')](),controller['getPreview']);router[_0x5ed2('0xf')](_0x5ed2('0x12'),auth[_0x5ed2('0x3')](),controller[_0x5ed2('0x13')]);router[_0x5ed2('0x14')](_0x5ed2('0xb'),auth['isAuthenticated'](),controller[_0x5ed2('0x15')]);router[_0x5ed2('0x16')](_0x5ed2('0xb'),auth['isAuthenticated'](),controller[_0x5ed2('0x17')]);module[_0x5ed2('0x18')]=router; \ No newline at end of file +var _0xf358=['/timezones','getTimezones','show','getPreviewRecall','post','create','/preview','/timezone','getTimezone','/:id','update','destroy','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','/describe','describe','get','/opencontacts','getOpenContacts'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0xf358,0x75));var _0x8f35=function(_0x227a11,_0x59c020){_0x227a11=_0x227a11-0x0;var _0x491055=_0xf358[_0x227a11];return _0x491055;};'use strict';var express=require('express');var router=express[_0x8f35('0x0')]();var auth=require(_0x8f35('0x1'));var controller=require(_0x8f35('0x2'));router['get']('/',auth[_0x8f35('0x3')](),controller['index']);router['get'](_0x8f35('0x4'),auth[_0x8f35('0x3')](),controller[_0x8f35('0x5')]);router[_0x8f35('0x6')](_0x8f35('0x7'),auth[_0x8f35('0x3')](),controller[_0x8f35('0x8')]);router['get'](_0x8f35('0x9'),auth[_0x8f35('0x3')](),controller[_0x8f35('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8f35('0xb')]);router[_0x8f35('0x6')]('/:id/previewrecall',auth[_0x8f35('0x3')](),controller[_0x8f35('0xc')]);router[_0x8f35('0xd')]('/',auth[_0x8f35('0x3')](),controller[_0x8f35('0xe')]);router['post'](_0x8f35('0xf'),auth['isAuthenticated'](),controller['getPreview']);router[_0x8f35('0xd')](_0x8f35('0x10'),auth['isAuthenticated'](),controller[_0x8f35('0x11')]);router['put'](_0x8f35('0x12'),auth[_0x8f35('0x3')](),controller[_0x8f35('0x13')]);router['delete'](_0x8f35('0x12'),auth[_0x8f35('0x3')](),controller[_0x8f35('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 9549f37..15ec1f1 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 _0x50fc=['moment','sequelize','exports','INTEGER','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x11b212,_0x504409){var _0x156a68=function(_0x576bfd){while(--_0x576bfd){_0x11b212['push'](_0x11b212['shift']());}};_0x156a68(++_0x504409);}(_0x50fc,0x1d1));var _0xc50f=function(_0x1d9bc1,_0x52f0a6){_0x1d9bc1=_0x1d9bc1-0x0;var _0x540128=_0x50fc[_0x1d9bc1];return _0x540128;};'use strict';var moment=require(_0xc50f('0x0'));var Sequelize=require(_0xc50f('0x1'));module[_0xc50f('0x2')]={'CmHopperId':{'type':Sequelize[_0xc50f('0x3')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xc50f('0x4'))},'countbusyretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc50f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x796f=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','DATE','format'];(function(_0x388e6c,_0x3785c7){var _0x1d1bb7=function(_0x38dd85){while(--_0x38dd85){_0x388e6c['push'](_0x388e6c['shift']());}};_0x1d1bb7(++_0x3785c7);}(_0x796f,0xeb));var _0xf796=function(_0x3dcc23,_0xd0e196){_0x3dcc23=_0x3dcc23-0x0;var _0x10f2a9=_0x796f[_0x3dcc23];return _0x10f2a9;};'use strict';var moment=require(_0xf796('0x0'));var Sequelize=require(_0xf796('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xf796('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xf796('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xf796('0x3')],'defaultValue':moment()[_0xf796('0x4')](_0xf796('0x5'))},'countbusyretry':{'type':Sequelize[_0xf796('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf796('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf796('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf796('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf796('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf796('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 1494d98..4bf9910 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 _0xed90=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','CmHopperAdditionalPhones','error','stack','name','map','CmHopperAdditionalPhone','fieldName','type','key','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed90,0x11b));var _0x0ed9=function(_0x54b27f,_0x11a3a9){_0x54b27f=_0x54b27f-0x0;var _0x279111=_0xed90[_0x54b27f];return _0x279111;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ed9('0x0'));var zipdir=require(_0x0ed9('0x1'));var jsonpatch=require(_0x0ed9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0ed9('0x3'));var Mustache=require('mustache');var util=require(_0x0ed9('0x4'));var path=require(_0x0ed9('0x5'));var sox=require(_0x0ed9('0x6'));var csv=require(_0x0ed9('0x7'));var ejs=require(_0x0ed9('0x8'));var fs=require('fs');var fs_extra=require(_0x0ed9('0x9'));var _=require(_0x0ed9('0xa'));var squel=require(_0x0ed9('0xb'));var crypto=require(_0x0ed9('0xc'));var jsforce=require(_0x0ed9('0xd'));var deskjs=require(_0x0ed9('0xe'));var toCsv=require(_0x0ed9('0x7'));var querystring=require('querystring');var Papa=require(_0x0ed9('0xf'));var Redis=require(_0x0ed9('0x10'));var authService=require(_0x0ed9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0ed9('0x12'));var hardwareService=require(_0x0ed9('0x13'));var logger=require(_0x0ed9('0x14'))(_0x0ed9('0x15'));var utils=require(_0x0ed9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0ed9('0x17'));var db=require(_0x0ed9('0x18'))['db'];function respondWithStatusCode(_0x26584a,_0x366bd4){_0x366bd4=_0x366bd4||0xcc;return function(_0x5d8779){if(_0x5d8779){return _0x26584a[_0x0ed9('0x19')](_0x366bd4);}return _0x26584a[_0x0ed9('0x1a')](_0x366bd4)[_0x0ed9('0x1b')]();};}function respondWithResult(_0xe900b8,_0x17a804){_0x17a804=_0x17a804||0xc8;return function(_0x3cd091){if(_0x3cd091){return _0xe900b8[_0x0ed9('0x1a')](_0x17a804)[_0x0ed9('0x1c')](_0x3cd091);}};}function respondWithFilteredResult(_0x4cc996,_0x29144d){return function(_0x19349d){if(_0x19349d){var _0x190eca=typeof _0x29144d[_0x0ed9('0x1d')]===_0x0ed9('0x1e')&&typeof _0x29144d[_0x0ed9('0x1f')]===_0x0ed9('0x1e');var _0x39707b=_0x19349d[_0x0ed9('0x20')];var _0x30d210=_0x190eca?0x0:_0x29144d[_0x0ed9('0x1d')];var _0x361364=_0x190eca?_0x19349d[_0x0ed9('0x20')]:_0x29144d[_0x0ed9('0x1d')]+_0x29144d[_0x0ed9('0x1f')];var _0x152e0d;if(_0x361364>=_0x39707b){_0x361364=_0x39707b;_0x152e0d=0xc8;}else{_0x152e0d=0xce;}_0x4cc996[_0x0ed9('0x1a')](_0x152e0d);return _0x4cc996[_0x0ed9('0x21')]('Content-Range',_0x30d210+'-'+_0x361364+'/'+_0x39707b)[_0x0ed9('0x1c')](_0x19349d);}return null;};}function patchUpdates(_0x30d078){return function(_0x55279d){try{jsonpatch[_0x0ed9('0x22')](_0x55279d,_0x30d078,!![]);}catch(_0x429703){return BPromise[_0x0ed9('0x23')](_0x429703);}return _0x55279d['save']();};}function saveUpdates(_0x3f7757,_0x350150){return function(_0x4510cc){if(_0x4510cc){return _0x4510cc[_0x0ed9('0x24')](_0x3f7757)[_0x0ed9('0x25')](function(_0x5a4037){return _0x5a4037;});}return null;};}function removeEntity(_0x576442,_0x5f400c){return function(_0x242f59){if(_0x242f59){return _0x242f59[_0x0ed9('0x26')]()[_0x0ed9('0x25')](function(){var _0x41d7ca=_0x242f59['get']({'plain':!![]});var _0x1de81a=_0x0ed9('0x27');return db['UserProfileResource'][_0x0ed9('0x26')]({'where':{'type':_0x1de81a,'resourceId':_0x41d7ca['id']}})[_0x0ed9('0x25')](function(){return _0x242f59;});})[_0x0ed9('0x25')](function(){_0x576442['status'](0xcc)[_0x0ed9('0x1b')]();});}};}function handleEntityNotFound(_0x1b7b3e,_0x12bace){return function(_0x121330){if(!_0x121330){_0x1b7b3e[_0x0ed9('0x19')](0x194);}return _0x121330;};}function handleError(_0x5dd819,_0x112082){_0x112082=_0x112082||0x1f4;return function(_0x29da1e){logger[_0x0ed9('0x28')](_0x29da1e[_0x0ed9('0x29')]);if(_0x29da1e[_0x0ed9('0x2a')]){delete _0x29da1e[_0x0ed9('0x2a')];}_0x5dd819[_0x0ed9('0x1a')](_0x112082)['send'](_0x29da1e);};}exports['index']=function(_0x1bbdd2,_0x59fc79){var _0x206156={},_0x47b1d2={},_0x11a2c9={'count':0x0,'rows':[]};var _0x3bf7f2=_[_0x0ed9('0x2b')](db[_0x0ed9('0x2c')]['rawAttributes'],function(_0x1554b0){return{'name':_0x1554b0[_0x0ed9('0x2d')],'type':_0x1554b0[_0x0ed9('0x2e')][_0x0ed9('0x2f')]};});_0x47b1d2[_0x0ed9('0x30')]=_[_0x0ed9('0x2b')](_0x3bf7f2,_0x0ed9('0x2a'));_0x47b1d2['query']=_['keys'](_0x1bbdd2[_0x0ed9('0x31')]);_0x47b1d2['filters']=_[_0x0ed9('0x32')](_0x47b1d2['model'],_0x47b1d2['query']);_0x206156[_0x0ed9('0x33')]=_['intersection'](_0x47b1d2['model'],qs[_0x0ed9('0x34')](_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x34')]));_0x206156[_0x0ed9('0x33')]=_0x206156['attributes'][_0x0ed9('0x35')]?_0x206156[_0x0ed9('0x33')]:_0x47b1d2[_0x0ed9('0x30')];if(!_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x36')](_0x0ed9('0x37'))){_0x206156[_0x0ed9('0x1f')]=qs['limit'](_0x1bbdd2['query'][_0x0ed9('0x1f')]);_0x206156[_0x0ed9('0x1d')]=qs['offset'](_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x1d')]);}_0x206156['order']=qs['sort'](_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x38')]);_0x206156[_0x0ed9('0x39')]=qs[_0x0ed9('0x3a')](_[_0x0ed9('0x3b')](_0x1bbdd2[_0x0ed9('0x31')],_0x47b1d2['filters']),_0x3bf7f2);if(_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x3c')]){_0x206156['where']=_[_0x0ed9('0x3d')](_0x206156['where'],{'$or':_[_0x0ed9('0x2b')](_0x3bf7f2,function(_0x22097a){if(_0x22097a[_0x0ed9('0x2e')]!==_0x0ed9('0x3e')){var _0x55ede2={};_0x55ede2[_0x22097a[_0x0ed9('0x2a')]]={'$like':'%'+_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x3c')]+'%'};return _0x55ede2;}})});}_0x206156=_[_0x0ed9('0x3d')]({},_0x206156,_0x1bbdd2['options']);var _0xdc5b15={'where':_0x206156[_0x0ed9('0x39')]};return db[_0x0ed9('0x2c')][_0x0ed9('0x20')](_0xdc5b15)[_0x0ed9('0x25')](function(_0x326bb3){_0x11a2c9['count']=_0x326bb3;if(_0x1bbdd2[_0x0ed9('0x31')][_0x0ed9('0x3f')]){_0x206156[_0x0ed9('0x40')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x0ed9('0x41')](_0x206156);})['then'](function(_0x4de173){_0x11a2c9[_0x0ed9('0x42')]=_0x4de173;return _0x11a2c9;})['then'](respondWithFilteredResult(_0x59fc79,_0x206156))[_0x0ed9('0x43')](handleError(_0x59fc79,null));};exports[_0x0ed9('0x44')]=function(_0x522968,_0x445cb3){var _0x3b4331={'raw':!![],'where':{'id':_0x522968[_0x0ed9('0x45')]['id']}},_0x476742={};_0x476742[_0x0ed9('0x30')]=_[_0x0ed9('0x46')](db[_0x0ed9('0x2c')]['rawAttributes']);_0x476742[_0x0ed9('0x31')]=_['keys'](_0x522968[_0x0ed9('0x31')]);_0x476742[_0x0ed9('0x3a')]=_[_0x0ed9('0x32')](_0x476742['model'],_0x476742[_0x0ed9('0x31')]);_0x3b4331[_0x0ed9('0x33')]=_[_0x0ed9('0x32')](_0x476742[_0x0ed9('0x30')],qs['fields'](_0x522968[_0x0ed9('0x31')][_0x0ed9('0x34')]));_0x3b4331[_0x0ed9('0x33')]=_0x3b4331[_0x0ed9('0x33')]['length']?_0x3b4331[_0x0ed9('0x33')]:_0x476742[_0x0ed9('0x30')];if(_0x522968[_0x0ed9('0x31')][_0x0ed9('0x3f')]){_0x3b4331[_0x0ed9('0x40')]=[{'all':!![]}];}_0x3b4331=_['merge']({},_0x3b4331,_0x522968['options']);return db['CmHopperAdditionalPhone']['find'](_0x3b4331)[_0x0ed9('0x25')](handleEntityNotFound(_0x445cb3,null))['then'](respondWithResult(_0x445cb3,null))['catch'](handleError(_0x445cb3,null));};exports[_0x0ed9('0x47')]=function(_0x65cd1d,_0x13f0e4){return db[_0x0ed9('0x2c')][_0x0ed9('0x47')](_0x65cd1d[_0x0ed9('0x48')],{})[_0x0ed9('0x25')](function(_0x1692ee){var _0x185fa1=_0x65cd1d[_0x0ed9('0x49')]['get']({'plain':!![]});if(!_0x185fa1)throw new Error(_0x0ed9('0x4a'));if(_0x185fa1[_0x0ed9('0x4b')]===_0x0ed9('0x49')){var _0x4a821b=_0x1692ee[_0x0ed9('0x4c')]({'plain':!![]});var _0x46bea4=_0x0ed9('0x27');return db[_0x0ed9('0x4d')][_0x0ed9('0x4e')]({'where':{'name':_0x46bea4,'userProfileId':_0x185fa1[_0x0ed9('0x4f')]},'raw':!![]})['then'](function(_0x2567e5){if(_0x2567e5&&_0x2567e5[_0x0ed9('0x50')]===0x0){return db[_0x0ed9('0x51')][_0x0ed9('0x47')]({'name':_0x4a821b[_0x0ed9('0x2a')],'resourceId':_0x4a821b['id'],'type':_0x2567e5[_0x0ed9('0x2a')],'sectionId':_0x2567e5['id']},{})[_0x0ed9('0x25')](function(){return _0x1692ee;});}else{return _0x1692ee;}})['catch'](function(_0x28c78b){logger['error'](_0x0ed9('0x52'),_0x28c78b);throw _0x28c78b;});}return _0x1692ee;})[_0x0ed9('0x25')](respondWithResult(_0x13f0e4,0xc9))[_0x0ed9('0x43')](handleError(_0x13f0e4,null));};exports[_0x0ed9('0x24')]=function(_0x31f767,_0x1ee3f5){if(_0x31f767[_0x0ed9('0x48')]['id']){delete _0x31f767['body']['id'];}return db[_0x0ed9('0x2c')]['find']({'where':{'id':_0x31f767[_0x0ed9('0x45')]['id']}})[_0x0ed9('0x25')](handleEntityNotFound(_0x1ee3f5,null))[_0x0ed9('0x25')](saveUpdates(_0x31f767['body'],null))[_0x0ed9('0x25')](respondWithResult(_0x1ee3f5,null))[_0x0ed9('0x43')](handleError(_0x1ee3f5,null));};exports[_0x0ed9('0x26')]=function(_0x372626,_0x3fedde){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x372626[_0x0ed9('0x45')]['id']}})[_0x0ed9('0x25')](handleEntityNotFound(_0x3fedde,null))[_0x0ed9('0x25')](removeEntity(_0x3fedde,null))[_0x0ed9('0x43')](handleError(_0x3fedde,null));}; \ No newline at end of file +var _0xd18d=['intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','CmHopperAdditionalPhone','includeAll','include','findAll','rows','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','get','destroy','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x1f2446,_0x405cfc){var _0x468bfa=function(_0x98b89e){while(--_0x98b89e){_0x1f2446['push'](_0x1f2446['shift']());}};_0x468bfa(++_0x405cfc);}(_0xd18d,0x1b4));var _0xdd18=function(_0x33deaf,_0x5c43b5){_0x33deaf=_0x33deaf-0x0;var _0x3f1076=_0xd18d[_0x33deaf];return _0x3f1076;};'use strict';var emlformat=require(_0xdd18('0x0'));var rimraf=require(_0xdd18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd18('0x2'));var rp=require('request-promise');var moment=require(_0xdd18('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdd18('0x4'));var util=require(_0xdd18('0x5'));var path=require('path');var sox=require(_0xdd18('0x6'));var csv=require('to-csv');var ejs=require(_0xdd18('0x7'));var fs=require('fs');var fs_extra=require(_0xdd18('0x8'));var _=require(_0xdd18('0x9'));var squel=require(_0xdd18('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd18('0xb'));var deskjs=require(_0xdd18('0xc'));var toCsv=require(_0xdd18('0xd'));var querystring=require(_0xdd18('0xe'));var Papa=require(_0xdd18('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd18('0x10'));var as=require(_0xdd18('0x11'));var hardwareService=require(_0xdd18('0x12'));var logger=require(_0xdd18('0x13'))('api');var utils=require(_0xdd18('0x14'));var config=require(_0xdd18('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd18('0x16'))['db'];function respondWithStatusCode(_0x3217dd,_0x2a676e){_0x2a676e=_0x2a676e||0xcc;return function(_0x2972fd){if(_0x2972fd){return _0x3217dd[_0xdd18('0x17')](_0x2a676e);}return _0x3217dd['status'](_0x2a676e)[_0xdd18('0x18')]();};}function respondWithResult(_0x12ec16,_0x1b9175){_0x1b9175=_0x1b9175||0xc8;return function(_0x44cd1b){if(_0x44cd1b){return _0x12ec16[_0xdd18('0x19')](_0x1b9175)[_0xdd18('0x1a')](_0x44cd1b);}};}function respondWithFilteredResult(_0x330c95,_0x163111){return function(_0x219bb5){if(_0x219bb5){var _0x198ed6=typeof _0x163111['offset']===_0xdd18('0x1b')&&typeof _0x163111[_0xdd18('0x1c')]==='undefined';var _0x12d05b=_0x219bb5[_0xdd18('0x1d')];var _0x296eb8=_0x198ed6?0x0:_0x163111['offset'];var _0x54243a=_0x198ed6?_0x219bb5[_0xdd18('0x1d')]:_0x163111[_0xdd18('0x1e')]+_0x163111[_0xdd18('0x1c')];var _0x54229c;if(_0x54243a>=_0x12d05b){_0x54243a=_0x12d05b;_0x54229c=0xc8;}else{_0x54229c=0xce;}_0x330c95['status'](_0x54229c);return _0x330c95[_0xdd18('0x1f')](_0xdd18('0x20'),_0x296eb8+'-'+_0x54243a+'/'+_0x12d05b)[_0xdd18('0x1a')](_0x219bb5);}return null;};}function patchUpdates(_0x3a05d8){return function(_0x32b60c){try{jsonpatch[_0xdd18('0x21')](_0x32b60c,_0x3a05d8,!![]);}catch(_0x16da58){return BPromise[_0xdd18('0x22')](_0x16da58);}return _0x32b60c['save']();};}function saveUpdates(_0x4629d4,_0x194866){return function(_0x3f9e08){if(_0x3f9e08){return _0x3f9e08[_0xdd18('0x23')](_0x4629d4)['then'](function(_0x6a23f4){return _0x6a23f4;});}return null;};}function removeEntity(_0x43a0d9,_0x4005a3){return function(_0xd222ab){if(_0xd222ab){return _0xd222ab['destroy']()[_0xdd18('0x24')](function(){var _0x4b9a95=_0xd222ab[_0xdd18('0x25')]({'plain':!![]});var _0x10e5b4='CmHopperAdditionalPhones';return db['UserProfileResource'][_0xdd18('0x26')]({'where':{'type':_0x10e5b4,'resourceId':_0x4b9a95['id']}})[_0xdd18('0x24')](function(){return _0xd222ab;});})[_0xdd18('0x24')](function(){_0x43a0d9[_0xdd18('0x19')](0xcc)[_0xdd18('0x18')]();});}};}function handleEntityNotFound(_0x4f6f25,_0x5a8a7c){return function(_0x246254){if(!_0x246254){_0x4f6f25['sendStatus'](0x194);}return _0x246254;};}function handleError(_0x462c67,_0x43f54e){_0x43f54e=_0x43f54e||0x1f4;return function(_0x41167e){logger['error'](_0x41167e['stack']);if(_0x41167e[_0xdd18('0x27')]){delete _0x41167e['name'];}_0x462c67['status'](_0x43f54e)['send'](_0x41167e);};}exports[_0xdd18('0x28')]=function(_0x2c69d1,_0x58660e){var _0x2d6b28={},_0x9d66ae={},_0xe62447={'count':0x0,'rows':[]};var _0x4a467d=_[_0xdd18('0x29')](db['CmHopperAdditionalPhone'][_0xdd18('0x2a')],function(_0x26d470){return{'name':_0x26d470[_0xdd18('0x2b')],'type':_0x26d470[_0xdd18('0x2c')][_0xdd18('0x2d')]};});_0x9d66ae[_0xdd18('0x2e')]=_['map'](_0x4a467d,_0xdd18('0x27'));_0x9d66ae[_0xdd18('0x2f')]=_[_0xdd18('0x30')](_0x2c69d1[_0xdd18('0x2f')]);_0x9d66ae[_0xdd18('0x31')]=_[_0xdd18('0x32')](_0x9d66ae[_0xdd18('0x2e')],_0x9d66ae[_0xdd18('0x2f')]);_0x2d6b28[_0xdd18('0x33')]=_[_0xdd18('0x32')](_0x9d66ae[_0xdd18('0x2e')],qs[_0xdd18('0x34')](_0x2c69d1[_0xdd18('0x2f')]['fields']));_0x2d6b28['attributes']=_0x2d6b28[_0xdd18('0x33')][_0xdd18('0x35')]?_0x2d6b28[_0xdd18('0x33')]:_0x9d66ae[_0xdd18('0x2e')];if(!_0x2c69d1[_0xdd18('0x2f')][_0xdd18('0x36')](_0xdd18('0x37'))){_0x2d6b28[_0xdd18('0x1c')]=qs[_0xdd18('0x1c')](_0x2c69d1[_0xdd18('0x2f')]['limit']);_0x2d6b28['offset']=qs[_0xdd18('0x1e')](_0x2c69d1['query'][_0xdd18('0x1e')]);}_0x2d6b28['order']=qs[_0xdd18('0x38')](_0x2c69d1[_0xdd18('0x2f')][_0xdd18('0x38')]);_0x2d6b28[_0xdd18('0x39')]=qs[_0xdd18('0x31')](_[_0xdd18('0x3a')](_0x2c69d1['query'],_0x9d66ae[_0xdd18('0x31')]),_0x4a467d);if(_0x2c69d1[_0xdd18('0x2f')][_0xdd18('0x3b')]){_0x2d6b28[_0xdd18('0x39')]=_[_0xdd18('0x3c')](_0x2d6b28[_0xdd18('0x39')],{'$or':_[_0xdd18('0x29')](_0x4a467d,function(_0x8c166d){if(_0x8c166d['type']!==_0xdd18('0x3d')){var _0x119f7e={};_0x119f7e[_0x8c166d[_0xdd18('0x27')]]={'$like':'%'+_0x2c69d1[_0xdd18('0x2f')][_0xdd18('0x3b')]+'%'};return _0x119f7e;}})});}_0x2d6b28=_[_0xdd18('0x3c')]({},_0x2d6b28,_0x2c69d1['options']);var _0x4dc7fb={'where':_0x2d6b28[_0xdd18('0x39')]};return db[_0xdd18('0x3e')][_0xdd18('0x1d')](_0x4dc7fb)[_0xdd18('0x24')](function(_0x447689){_0xe62447[_0xdd18('0x1d')]=_0x447689;if(_0x2c69d1[_0xdd18('0x2f')][_0xdd18('0x3f')]){_0x2d6b28[_0xdd18('0x40')]=[{'all':!![]}];}return db[_0xdd18('0x3e')][_0xdd18('0x41')](_0x2d6b28);})[_0xdd18('0x24')](function(_0x33de62){_0xe62447[_0xdd18('0x42')]=_0x33de62;return _0xe62447;})[_0xdd18('0x24')](respondWithFilteredResult(_0x58660e,_0x2d6b28))['catch'](handleError(_0x58660e,null));};exports['show']=function(_0x212da7,_0x170147){var _0x4789f4={'raw':!![],'where':{'id':_0x212da7['params']['id']}},_0x4dd3fb={};_0x4dd3fb[_0xdd18('0x2e')]=_[_0xdd18('0x30')](db[_0xdd18('0x3e')][_0xdd18('0x2a')]);_0x4dd3fb[_0xdd18('0x2f')]=_[_0xdd18('0x30')](_0x212da7[_0xdd18('0x2f')]);_0x4dd3fb['filters']=_[_0xdd18('0x32')](_0x4dd3fb[_0xdd18('0x2e')],_0x4dd3fb[_0xdd18('0x2f')]);_0x4789f4['attributes']=_[_0xdd18('0x32')](_0x4dd3fb[_0xdd18('0x2e')],qs[_0xdd18('0x34')](_0x212da7[_0xdd18('0x2f')][_0xdd18('0x34')]));_0x4789f4[_0xdd18('0x33')]=_0x4789f4[_0xdd18('0x33')][_0xdd18('0x35')]?_0x4789f4[_0xdd18('0x33')]:_0x4dd3fb['model'];if(_0x212da7[_0xdd18('0x2f')]['includeAll']){_0x4789f4['include']=[{'all':!![]}];}_0x4789f4=_[_0xdd18('0x3c')]({},_0x4789f4,_0x212da7[_0xdd18('0x43')]);return db[_0xdd18('0x3e')][_0xdd18('0x44')](_0x4789f4)[_0xdd18('0x24')](handleEntityNotFound(_0x170147,null))[_0xdd18('0x24')](respondWithResult(_0x170147,null))[_0xdd18('0x45')](handleError(_0x170147,null));};exports[_0xdd18('0x46')]=function(_0x4a9762,_0x25e95f){return db['CmHopperAdditionalPhone'][_0xdd18('0x46')](_0x4a9762['body'],{})[_0xdd18('0x24')](function(_0x577e6f){var _0x472120=_0x4a9762['user'][_0xdd18('0x25')]({'plain':!![]});if(!_0x472120)throw new Error(_0xdd18('0x47'));if(_0x472120[_0xdd18('0x48')]==='user'){var _0xc489ad=_0x577e6f['get']({'plain':!![]});var _0x392b67=_0xdd18('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x392b67,'userProfileId':_0x472120[_0xdd18('0x4a')]},'raw':!![]})['then'](function(_0x20a7fb){if(_0x20a7fb&&_0x20a7fb[_0xdd18('0x4b')]===0x0){return db[_0xdd18('0x4c')][_0xdd18('0x46')]({'name':_0xc489ad[_0xdd18('0x27')],'resourceId':_0xc489ad['id'],'type':_0x20a7fb['name'],'sectionId':_0x20a7fb['id']},{})[_0xdd18('0x24')](function(){return _0x577e6f;});}else{return _0x577e6f;}})[_0xdd18('0x45')](function(_0x5651a1){logger[_0xdd18('0x4d')](_0xdd18('0x4e'),_0x5651a1);throw _0x5651a1;});}return _0x577e6f;})[_0xdd18('0x24')](respondWithResult(_0x25e95f,0xc9))[_0xdd18('0x45')](handleError(_0x25e95f,null));};exports[_0xdd18('0x23')]=function(_0x3b7ff4,_0x698e7a){if(_0x3b7ff4[_0xdd18('0x4f')]['id']){delete _0x3b7ff4[_0xdd18('0x4f')]['id'];}return db['CmHopperAdditionalPhone'][_0xdd18('0x44')]({'where':{'id':_0x3b7ff4[_0xdd18('0x50')]['id']}})['then'](handleEntityNotFound(_0x698e7a,null))[_0xdd18('0x24')](saveUpdates(_0x3b7ff4['body'],null))[_0xdd18('0x24')](respondWithResult(_0x698e7a,null))[_0xdd18('0x45')](handleError(_0x698e7a,null));};exports[_0xdd18('0x26')]=function(_0x2ea5df,_0x3878a8){return db[_0xdd18('0x3e')][_0xdd18('0x44')]({'where':{'id':_0x2ea5df[_0xdd18('0x50')]['id']}})[_0xdd18('0x24')](handleEntityNotFound(_0x3878a8,null))[_0xdd18('0x24')](removeEntity(_0x3878a8,null))[_0xdd18('0x45')](handleError(_0x3878a8,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index d3da4d4..d43dd96 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 _0x028a=['exports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./cmHopperAdditionalPhone.attributes'];(function(_0x419715,_0x221336){var _0x274fbd=function(_0x5119b0){while(--_0x5119b0){_0x419715['push'](_0x419715['shift']());}};_0x274fbd(++_0x221336);}(_0x028a,0xfd));var _0xa028=function(_0x24b62c,_0x46def1){_0x24b62c=_0x24b62c-0x0;var _0x27fe6c=_0x028a[_0x24b62c];return _0x27fe6c;};'use strict';var _=require(_0xa028('0x0'));var util=require(_0xa028('0x1'));var logger=require(_0xa028('0x2'))('api');var moment=require(_0xa028('0x3'));var BPromise=require(_0xa028('0x4'));var rp=require(_0xa028('0x5'));var fs=require('fs');var path=require(_0xa028('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa028('0x7'));module[_0xa028('0x8')]=function(_0x2805a9,_0x540dd4){return _0x2805a9['define']('CmHopperAdditionalPhone',attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15c0=['api','moment','bluebird','path','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x15c0,0x77));var _0x015c=function(_0x1b0165,_0x33a8c0){_0x1b0165=_0x1b0165-0x0;var _0x80ea5c=_0x15c0[_0x1b0165];return _0x80ea5c;};'use strict';var _=require(_0x015c('0x0'));var util=require('util');var logger=require(_0x015c('0x1'))(_0x015c('0x2'));var moment=require(_0x015c('0x3'));var BPromise=require(_0x015c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x015c('0x5'));var rimraf=require('rimraf');var config=require(_0x015c('0x6'));var attributes=require(_0x015c('0x7'));module[_0x015c('0x8')]=function(_0x2171ba,_0xd92dae){return _0x2171ba['define'](_0x015c('0x9'),attributes,{'tableName':_0x015c('0xa'),'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 9b7871f..289e146 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 _0xbcdd=['ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','entity','dialGlobalMaxRetry','ASC','countcongestionretry','countmachineretry','SwapAdditionalPhones','waitTime','duration','isNil','scheduledat','minutes','add','phone','countagentrejectretry','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId'];(function(_0x14477e,_0x44d4da){var _0x5d4a05=function(_0x5e0fa3){while(--_0x5e0fa3){_0x14477e['push'](_0x14477e['shift']());}};_0x5d4a05(++_0x44d4da);}(_0xbcdd,0x142));var _0xdbcd=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xbcdd[_0x31991b];return _0x307304;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdbcd('0x0'));var BPromise=require(_0xdbcd('0x1'));var rs=require(_0xdbcd('0x2'));var fs=require('fs');var Redis=require(_0xdbcd('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbcd('0x4'));var logger=require('../../config/logger')(_0xdbcd('0x5'));var config=require(_0xdbcd('0x6'));var jayson=require(_0xdbcd('0x7'));var client=jayson[_0xdbcd('0x8')][_0xdbcd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d3dbc,_0x31fe53,_0x52c39c){return new BPromise(function(_0x10295e,_0x11a189){return client['request'](_0x5d3dbc,_0x52c39c)[_0xdbcd('0xa')](function(_0x163c49){logger[_0xdbcd('0xb')](_0xdbcd('0xc'),_0x31fe53,'request\x20sent');logger[_0xdbcd('0xd')](_0xdbcd('0xe'),_0x31fe53,_0xdbcd('0xf'),JSON[_0xdbcd('0x10')](_0x163c49));if(_0x163c49[_0xdbcd('0x11')]){if(_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x12')]===0x1f4){logger['error'](_0xdbcd('0xc'),_0x31fe53,_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x13')]);return _0x11a189(_0x163c49[_0xdbcd('0x11')]['message']);}logger[_0xdbcd('0x11')](_0xdbcd('0xc'),_0x31fe53,_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x13')]);return _0x10295e(_0x163c49[_0xdbcd('0x11')][_0xdbcd('0x13')]);}else{logger['info'](_0xdbcd('0xc'),_0x31fe53,_0xdbcd('0xf'));_0x10295e(_0x163c49['result'][_0xdbcd('0x13')]);}})[_0xdbcd('0x14')](function(_0x5ecb2a){logger[_0xdbcd('0x11')](_0xdbcd('0xc'),_0x31fe53,_0x5ecb2a);_0x11a189(_0x5ecb2a);});});}exports[_0xdbcd('0x15')]=function(_0x3cdc73){var _0x5a3e50=this;return new Promise(function(_0x2cc016,_0x39b471){return db[_0xdbcd('0x16')][_0xdbcd('0x17')]({'raw':!![],'where':{'ContactId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x19')],'ListId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x1a')],'VoiceQueueId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x1b')]===undefined?null:_0x3cdc73['body'][_0xdbcd('0x1b')],'CampaignId':_0x3cdc73[_0xdbcd('0x18')][_0xdbcd('0x1c')]===undefined?null:_0x3cdc73['body'][_0xdbcd('0x1c')]}})[_0xdbcd('0xa')](function(_0x29b39b){if(_0x29b39b!=null){return db[_0xdbcd('0x1d')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x29b39b['id'],'OrderBy':{'$gt':_0x29b39b[_0xdbcd('0x1e')]}},'order':[['OrderBy','ASC']]})[_0xdbcd('0xa')](function(_0x63494f){var _0x32d3c7=0x0;if(_0x63494f){if(_0x63494f[_0xdbcd('0x1f')]+_0x63494f['countcongestionretry']+_0x63494f[_0xdbcd('0x20')]+_0x63494f[_0xdbcd('0x21')]+_0x63494f[_0xdbcd('0x22')]+_0x63494f[_0xdbcd('0x23')]+_0x63494f['countmachineretry']+_0x63494f['countagentrejectretry']<_0x3cdc73[_0xdbcd('0x24')][_0xdbcd('0x25')])_0x32d3c7=0x1;_0x2cc016({'additional':_0x32d3c7});}else{return db['CmHopperAdditionalPhone'][_0xdbcd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x29b39b['id']},'order':[[_0xdbcd('0x1e'),_0xdbcd('0x26')]]})['then'](function(_0x263385){var _0xe13d63=0x0;if(_0x263385){if(_0x263385[_0xdbcd('0x1f')]+_0x263385[_0xdbcd('0x27')]+_0x263385[_0xdbcd('0x20')]+_0x263385[_0xdbcd('0x21')]+_0x263385[_0xdbcd('0x22')]+_0x263385['countabandonedretry']+_0x263385[_0xdbcd('0x28')]+_0x263385['countagentrejectretry']<_0x3cdc73[_0xdbcd('0x24')][_0xdbcd('0x25')])_0xe13d63=0x1;_0x2cc016({'additional':_0xe13d63});}else{_0x2cc016({'additional':0x0});}})['catch'](function(_0x3170d2){logger[_0xdbcd('0x11')](_0xdbcd('0x15'),_0x3170d2[_0xdbcd('0x13')]);_0x39b471(_0x5a3e50[_0xdbcd('0x11')](0x1f4,_0x3170d2[_0xdbcd('0x13')]));});}})[_0xdbcd('0x14')](function(_0x4533ed){logger[_0xdbcd('0x11')]('VerifyAdditionalPhones',_0x4533ed['message']);_0x39b471(_0x5a3e50['error'](0x1f4,_0x4533ed[_0xdbcd('0x13')]));});}else _0x2cc016({'additional':0x0});});});};exports[_0xdbcd('0x29')]=function(_0x29a0e5){var _0x2f64a3=this;return new Promise(function(_0x4b38a8,_0x13f219){return db[_0xdbcd('0x16')][_0xdbcd('0x17')]({'raw':!![],'where':{'ContactId':_0x29a0e5[_0xdbcd('0x18')]['ContactId'],'ListId':_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1a')],'VoiceQueueId':_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1b')]===undefined?null:_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1b')],'CampaignId':_0x29a0e5['body'][_0xdbcd('0x1c')]===undefined?null:_0x29a0e5[_0xdbcd('0x18')][_0xdbcd('0x1c')]}})[_0xdbcd('0xa')](function(_0x2397c5){if(_0x2397c5!=null){return db['CmHopperAdditionalPhone'][_0xdbcd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x2397c5['id'],'OrderBy':{'$gte':_0x2397c5['OrderBy']}},'order':[['OrderBy',_0xdbcd('0x26')]]})['then'](function(_0x52a6ea){if(_0x52a6ea)return activateAdditionalPhone(_0x2397c5,_0x29a0e5[_0xdbcd('0x18')],_0x52a6ea,_0x29a0e5['duration'],_0x29a0e5[_0xdbcd('0x2a')])[_0xdbcd('0xa')](function(_0xb1c547){_0x4b38a8(_0xb1c547);});else{return db[_0xdbcd('0x1d')][_0xdbcd('0x17')]({'raw':!![],'where':{'CmHopperId':_0x2397c5['id']},'order':[[_0xdbcd('0x1e'),_0xdbcd('0x26')]]})[_0xdbcd('0xa')](function(_0x288931){if(_0x288931)return activateAdditionalPhone(_0x2397c5,_0x29a0e5['body'],_0x288931,_0x29a0e5[_0xdbcd('0x2b')],_0x29a0e5[_0xdbcd('0x2a')])[_0xdbcd('0xa')](function(_0x2c44ec){_0x4b38a8(_0x2c44ec);});else{_0x4b38a8({'id':_0x2397c5['id'],'phone':''});}})[_0xdbcd('0x14')](function(_0x5bbdd7){logger[_0xdbcd('0x11')](_0xdbcd('0x15'),_0x5bbdd7['message']);_0x13f219(_0x2f64a3[_0xdbcd('0x11')](0x1f4,_0x5bbdd7[_0xdbcd('0x13')]));});}})[_0xdbcd('0x14')](function(_0x30985a){logger[_0xdbcd('0x11')](_0xdbcd('0x15'),_0x30985a['message']);_0x13f219(_0x2f64a3['error'](0x1f4,_0x30985a[_0xdbcd('0x13')]));});}else _0x4b38a8(0x1);});});};function activateAdditionalPhone(_0x810e24,_0x52f5bd,_0x30606e,_0x29d157,_0x3b24dc){return new Promise(function(_0x31563a,_0x2217ad){var _0x43836b;if(_[_0xdbcd('0x2c')](_0x30606e['scheduledat'])){_0x30606e[_0xdbcd('0x2d')]=moment();}if(moment()>moment(_0x30606e[_0xdbcd('0x2d')])){_0x43836b=moment()['add'](_0x3b24dc||0x3,_0xdbcd('0x2e'));}else{if(_0x30606e[_0xdbcd('0x1e')]==0x0){_0x43836b=moment(_0x30606e[_0xdbcd('0x2d')]);}else{_0x43836b=moment()[_0xdbcd('0x2f')](_0x3b24dc||0x3,_0xdbcd('0x2e'));}}if(_[_0xdbcd('0x2c')](_0x43836b)){_0x43836b=moment()[_0xdbcd('0x2f')](_0x3b24dc||0x3,_0xdbcd('0x2e'));}var _0x173bea={'phone':_0x810e24[_0xdbcd('0x30')],'active':0x0,'OrderBy':_[_0xdbcd('0x2c')](_0x810e24['OrderBy'])?0x0:_0x810e24[_0xdbcd('0x1e')],'scheduledat':moment()[_0xdbcd('0x2f')](_0x29d157||0x1,_0xdbcd('0x2e')),'countbusyretry':_0x52f5bd['countbusyretry'],'countcongestionretry':_0x52f5bd[_0xdbcd('0x27')],'countnoanswerretry':_0x52f5bd[_0xdbcd('0x20')],'countnosuchnumberretry':_0x52f5bd[_0xdbcd('0x21')],'countdropretry':_0x52f5bd[_0xdbcd('0x22')],'countabandonedretry':_0x52f5bd[_0xdbcd('0x23')],'countmachineretry':_0x52f5bd['countmachineretry'],'countagentrejectretry':_0x52f5bd[_0xdbcd('0x31')],'createdAt':_0x52f5bd[_0xdbcd('0x32')],'updatedAt':_0x52f5bd[_0xdbcd('0x33')]};var _0x4d6390={'CmHopperId':_0x810e24['id'],'phone':_0x30606e[_0xdbcd('0x30')],'active':0x0,'OrderBy':_[_0xdbcd('0x2c')](_0x30606e[_0xdbcd('0x1e')])?0x0:_0x30606e[_0xdbcd('0x1e')],'scheduledat':_0x43836b,'countbusyretry':_0x30606e[_0xdbcd('0x1f')],'countcongestionretry':_0x30606e[_0xdbcd('0x27')],'countnoanswerretry':_0x30606e[_0xdbcd('0x20')],'countnosuchnumberretry':_0x30606e[_0xdbcd('0x21')],'countdropretry':_0x30606e['countdropretry'],'countabandonedretry':_0x30606e[_0xdbcd('0x23')],'countmachineretry':_0x30606e[_0xdbcd('0x28')],'countagentrejectretry':_0x30606e[_0xdbcd('0x31')],'createdAt':_0x30606e['createdAt'],'updatedAt':_0x30606e[_0xdbcd('0x33')]};return db[_0xdbcd('0x34')][_0xdbcd('0x35')](function(_0x59599a){return db[_0xdbcd('0x1d')]['update'](_0x173bea,{'where':{'id':_0x30606e['id']}},{'transaction':_0x59599a})[_0xdbcd('0xa')](function(){return db[_0xdbcd('0x16')][_0xdbcd('0x36')](_0x4d6390,{'where':{'id':_0x810e24['id']}},{'transaction':_0x59599a});});})['then'](function(_0x46bbaa){_0x31563a({'id':_0x810e24['id'],'phone':_0x30606e[_0xdbcd('0x30')]});})[_0xdbcd('0x14')](function(_0x1baea2){logger[_0xdbcd('0x11')](_0xdbcd('0x37'),_0x1baea2[_0xdbcd('0x13')]);_0x2217ad({'error':_0x1baea2[_0xdbcd('0x13')]});});});}exports[_0xdbcd('0x38')]=function(_0x1bf451){var _0x417525=this;return new Promise(function(_0x1e92a0,_0x2ec6c2){return db[_0xdbcd('0x16')][_0xdbcd('0x36')](_0x1bf451[_0xdbcd('0x18')][_0xdbcd('0x39')],{'where':{'id':_0x1bf451[_0xdbcd('0x18')]['id']}})[_0xdbcd('0xa')](function(_0x30d584){_0x1e92a0(_0x30d584);})['catch'](function(_0x3e0dbe){logger[_0xdbcd('0x11')](_0xdbcd('0x38'),_0x3e0dbe[_0xdbcd('0x13')]);_0x2ec6c2(_0x417525[_0xdbcd('0x11')](0x1f4,_0x3e0dbe['message']));});});}; \ No newline at end of file +var _0x50fe=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','SwapAdditionalPhones','duration','waitTime','scheduledat','add','minutes','isNil','phone','countnoanswerretry','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry'];(function(_0x442632,_0x3b8163){var _0x2bbbf2=function(_0x5959ac){while(--_0x5959ac){_0x442632['push'](_0x442632['shift']());}};_0x2bbbf2(++_0x3b8163);}(_0x50fe,0x17b));var _0xe50f=function(_0x71fc21,_0x2f08ba){_0x71fc21=_0x71fc21-0x0;var _0x21903c=_0x50fe[_0x71fc21];return _0x21903c;};'use strict';var _=require('lodash');var util=require(_0xe50f('0x0'));var moment=require(_0xe50f('0x1'));var BPromise=require(_0xe50f('0x2'));var rs=require(_0xe50f('0x3'));var fs=require('fs');var Redis=require(_0xe50f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe50f('0x5'));var logger=require('../../config/logger')(_0xe50f('0x6'));var config=require(_0xe50f('0x7'));var jayson=require(_0xe50f('0x8'));var client=jayson['client'][_0xe50f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5163dc,_0x4e6fb5,_0x1e866b){return new BPromise(function(_0x25203f,_0x282d61){return client[_0xe50f('0xa')](_0x5163dc,_0x1e866b)[_0xe50f('0xb')](function(_0x4f8c5e){logger[_0xe50f('0xc')](_0xe50f('0xd'),_0x4e6fb5,_0xe50f('0xe'));logger[_0xe50f('0xf')](_0xe50f('0x10'),_0x4e6fb5,_0xe50f('0xe'),JSON['stringify'](_0x4f8c5e));if(_0x4f8c5e[_0xe50f('0x11')]){if(_0x4f8c5e['error'][_0xe50f('0x12')]===0x1f4){logger[_0xe50f('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4e6fb5,_0x4f8c5e['error']['message']);return _0x282d61(_0x4f8c5e[_0xe50f('0x11')]['message']);}logger[_0xe50f('0x11')](_0xe50f('0xd'),_0x4e6fb5,_0x4f8c5e[_0xe50f('0x11')][_0xe50f('0x13')]);return _0x25203f(_0x4f8c5e[_0xe50f('0x11')]['message']);}else{logger['info'](_0xe50f('0xd'),_0x4e6fb5,'request\x20sent');_0x25203f(_0x4f8c5e[_0xe50f('0x14')][_0xe50f('0x13')]);}})[_0xe50f('0x15')](function(_0x55d874){logger['error'](_0xe50f('0xd'),_0x4e6fb5,_0x55d874);_0x282d61(_0x55d874);});});}exports[_0xe50f('0x16')]=function(_0x24c6fd){var _0x4818bc=this;return new Promise(function(_0x3d50b7,_0x1f9fc5){return db[_0xe50f('0x17')][_0xe50f('0x18')]({'raw':!![],'where':{'ContactId':_0x24c6fd['body'][_0xe50f('0x19')],'ListId':_0x24c6fd[_0xe50f('0x1a')][_0xe50f('0x1b')],'VoiceQueueId':_0x24c6fd['body'][_0xe50f('0x1c')]===undefined?null:_0x24c6fd['body'][_0xe50f('0x1c')],'CampaignId':_0x24c6fd[_0xe50f('0x1a')]['CampaignId']===undefined?null:_0x24c6fd['body'][_0xe50f('0x1d')]}})[_0xe50f('0xb')](function(_0x2ab2dd){if(_0x2ab2dd!=null){return db[_0xe50f('0x1e')][_0xe50f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2ab2dd['id'],'OrderBy':{'$gt':_0x2ab2dd[_0xe50f('0x1f')]}},'order':[['OrderBy','ASC']]})[_0xe50f('0xb')](function(_0x4adeae){var _0xaee9d1=0x0;if(_0x4adeae){if(_0x4adeae[_0xe50f('0x20')]+_0x4adeae[_0xe50f('0x21')]+_0x4adeae['countnoanswerretry']+_0x4adeae[_0xe50f('0x22')]+_0x4adeae[_0xe50f('0x23')]+_0x4adeae[_0xe50f('0x24')]+_0x4adeae[_0xe50f('0x25')]+_0x4adeae[_0xe50f('0x26')]<_0x24c6fd[_0xe50f('0x27')][_0xe50f('0x28')])_0xaee9d1=0x1;_0x3d50b7({'additional':_0xaee9d1});}else{return db[_0xe50f('0x1e')][_0xe50f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2ab2dd['id']},'order':[['OrderBy',_0xe50f('0x29')]]})[_0xe50f('0xb')](function(_0x5a6c9a){var _0xb6a028=0x0;if(_0x5a6c9a){if(_0x5a6c9a[_0xe50f('0x20')]+_0x5a6c9a[_0xe50f('0x21')]+_0x5a6c9a['countnoanswerretry']+_0x5a6c9a[_0xe50f('0x22')]+_0x5a6c9a[_0xe50f('0x23')]+_0x5a6c9a['countabandonedretry']+_0x5a6c9a[_0xe50f('0x25')]+_0x5a6c9a[_0xe50f('0x26')]<_0x24c6fd['entity'][_0xe50f('0x28')])_0xb6a028=0x1;_0x3d50b7({'additional':_0xb6a028});}else{_0x3d50b7({'additional':0x0});}})[_0xe50f('0x15')](function(_0x59fab6){logger[_0xe50f('0x11')]('VerifyAdditionalPhones',_0x59fab6[_0xe50f('0x13')]);_0x1f9fc5(_0x4818bc[_0xe50f('0x11')](0x1f4,_0x59fab6[_0xe50f('0x13')]));});}})[_0xe50f('0x15')](function(_0x3dc844){logger[_0xe50f('0x11')](_0xe50f('0x16'),_0x3dc844['message']);_0x1f9fc5(_0x4818bc[_0xe50f('0x11')](0x1f4,_0x3dc844['message']));});}else _0x3d50b7({'additional':0x0});});});};exports[_0xe50f('0x2a')]=function(_0x4ae357){var _0x409516=this;return new Promise(function(_0x321e41,_0x32318e){return db[_0xe50f('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x4ae357[_0xe50f('0x1a')][_0xe50f('0x19')],'ListId':_0x4ae357[_0xe50f('0x1a')][_0xe50f('0x1b')],'VoiceQueueId':_0x4ae357['body'][_0xe50f('0x1c')]===undefined?null:_0x4ae357[_0xe50f('0x1a')][_0xe50f('0x1c')],'CampaignId':_0x4ae357[_0xe50f('0x1a')][_0xe50f('0x1d')]===undefined?null:_0x4ae357[_0xe50f('0x1a')][_0xe50f('0x1d')]}})[_0xe50f('0xb')](function(_0x5a3887){if(_0x5a3887!=null){return db[_0xe50f('0x1e')][_0xe50f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5a3887['id'],'OrderBy':{'$gte':_0x5a3887[_0xe50f('0x1f')]}},'order':[['OrderBy',_0xe50f('0x29')]]})['then'](function(_0x5366a0){if(_0x5366a0)return activateAdditionalPhone(_0x5a3887,_0x4ae357[_0xe50f('0x1a')],_0x5366a0,_0x4ae357[_0xe50f('0x2b')],_0x4ae357[_0xe50f('0x2c')])[_0xe50f('0xb')](function(_0x402ed8){_0x321e41(_0x402ed8);});else{return db['CmHopperAdditionalPhone'][_0xe50f('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5a3887['id']},'order':[[_0xe50f('0x1f'),_0xe50f('0x29')]]})[_0xe50f('0xb')](function(_0x257355){if(_0x257355)return activateAdditionalPhone(_0x5a3887,_0x4ae357[_0xe50f('0x1a')],_0x257355,_0x4ae357[_0xe50f('0x2b')],_0x4ae357['waitTime'])[_0xe50f('0xb')](function(_0x4602f0){_0x321e41(_0x4602f0);});else{_0x321e41({'id':_0x5a3887['id'],'phone':''});}})['catch'](function(_0x2050d3){logger[_0xe50f('0x11')](_0xe50f('0x16'),_0x2050d3[_0xe50f('0x13')]);_0x32318e(_0x409516[_0xe50f('0x11')](0x1f4,_0x2050d3[_0xe50f('0x13')]));});}})['catch'](function(_0x2e1c5f){logger[_0xe50f('0x11')](_0xe50f('0x16'),_0x2e1c5f[_0xe50f('0x13')]);_0x32318e(_0x409516[_0xe50f('0x11')](0x1f4,_0x2e1c5f['message']));});}else _0x321e41(0x1);});});};function activateAdditionalPhone(_0x1332bf,_0xea1efd,_0x4509f3,_0x491574,_0x424181){return new Promise(function(_0x4700a5,_0x15ba8a){var _0x599b2f;if(_['isNil'](_0x4509f3[_0xe50f('0x2d')])){_0x4509f3[_0xe50f('0x2d')]=moment();}if(moment()>moment(_0x4509f3[_0xe50f('0x2d')])){_0x599b2f=moment()[_0xe50f('0x2e')](_0x424181||0x3,_0xe50f('0x2f'));}else{if(_0x4509f3['OrderBy']==0x0){_0x599b2f=moment(_0x4509f3['scheduledat']);}else{_0x599b2f=moment()['add'](_0x424181||0x3,'minutes');}}if(_[_0xe50f('0x30')](_0x599b2f)){_0x599b2f=moment()[_0xe50f('0x2e')](_0x424181||0x3,_0xe50f('0x2f'));}var _0x1f3480={'phone':_0x1332bf[_0xe50f('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x1332bf['OrderBy'])?0x0:_0x1332bf[_0xe50f('0x1f')],'scheduledat':moment()['add'](_0x491574||0x1,'minutes'),'countbusyretry':_0xea1efd['countbusyretry'],'countcongestionretry':_0xea1efd[_0xe50f('0x21')],'countnoanswerretry':_0xea1efd[_0xe50f('0x32')],'countnosuchnumberretry':_0xea1efd['countnosuchnumberretry'],'countdropretry':_0xea1efd[_0xe50f('0x23')],'countabandonedretry':_0xea1efd[_0xe50f('0x24')],'countmachineretry':_0xea1efd[_0xe50f('0x25')],'countagentrejectretry':_0xea1efd[_0xe50f('0x26')],'createdAt':_0xea1efd[_0xe50f('0x33')],'updatedAt':_0xea1efd[_0xe50f('0x34')]};var _0x1ead92={'CmHopperId':_0x1332bf['id'],'phone':_0x4509f3[_0xe50f('0x31')],'active':0x0,'OrderBy':_[_0xe50f('0x30')](_0x4509f3[_0xe50f('0x1f')])?0x0:_0x4509f3['OrderBy'],'scheduledat':_0x599b2f,'countbusyretry':_0x4509f3[_0xe50f('0x20')],'countcongestionretry':_0x4509f3[_0xe50f('0x21')],'countnoanswerretry':_0x4509f3[_0xe50f('0x32')],'countnosuchnumberretry':_0x4509f3[_0xe50f('0x22')],'countdropretry':_0x4509f3[_0xe50f('0x23')],'countabandonedretry':_0x4509f3[_0xe50f('0x24')],'countmachineretry':_0x4509f3[_0xe50f('0x25')],'countagentrejectretry':_0x4509f3[_0xe50f('0x26')],'createdAt':_0x4509f3[_0xe50f('0x33')],'updatedAt':_0x4509f3[_0xe50f('0x34')]};return db[_0xe50f('0x35')][_0xe50f('0x36')](function(_0x3057ff){return db[_0xe50f('0x1e')][_0xe50f('0x37')](_0x1f3480,{'where':{'id':_0x4509f3['id']}},{'transaction':_0x3057ff})[_0xe50f('0xb')](function(){return db[_0xe50f('0x17')][_0xe50f('0x37')](_0x1ead92,{'where':{'id':_0x1332bf['id']}},{'transaction':_0x3057ff});});})[_0xe50f('0xb')](function(_0x594709){_0x4700a5({'id':_0x1332bf['id'],'phone':_0x4509f3[_0xe50f('0x31')]});})[_0xe50f('0x15')](function(_0x4d8795){logger[_0xe50f('0x11')](_0xe50f('0x38'),_0x4d8795[_0xe50f('0x13')]);_0x15ba8a({'error':_0x4d8795[_0xe50f('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x136731){var _0x3cfef5=this;return new Promise(function(_0x448d3d,_0x3c6a9b){return db[_0xe50f('0x17')]['update'](_0x136731[_0xe50f('0x1a')][_0xe50f('0x39')],{'where':{'id':_0x136731[_0xe50f('0x1a')]['id']}})[_0xe50f('0xb')](function(_0x218fc4){_0x448d3d(_0x218fc4);})[_0xe50f('0x15')](function(_0x4861ab){logger[_0xe50f('0x11')](_0xe50f('0x3a'),_0x4861ab['message']);_0x3c6a9b(_0x3cfef5[_0xe50f('0x11')](0x1f4,_0x4861ab['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index a899106..4eaf912 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 _0x790c=['isAuthenticated','index','/:id','create','put','update','delete','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2ee80e,_0x1123ff){var _0x2c1e41=function(_0x597e6a){while(--_0x597e6a){_0x2ee80e['push'](_0x2ee80e['shift']());}};_0x2c1e41(++_0x1123ff);}(_0x790c,0x106));var _0xc790=function(_0x2cbb74,_0x241c10){_0x2cbb74=_0x2cbb74-0x0;var _0xa6d18=_0x790c[_0x2cbb74];return _0xa6d18;};'use strict';var multer=require(_0xc790('0x0'));var util=require(_0xc790('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc790('0x2')]();var fs_extra=require(_0xc790('0x3'));var auth=require(_0xc790('0x4'));var interaction=require(_0xc790('0x5'));var config=require(_0xc790('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xc790('0x7')]('/',auth[_0xc790('0x8')](),controller[_0xc790('0x9')]);router['get'](_0xc790('0xa'),auth[_0xc790('0x8')](),controller['show']);router['post']('/',auth[_0xc790('0x8')](),controller[_0xc790('0xb')]);router[_0xc790('0xc')](_0xc790('0xa'),auth[_0xc790('0x8')](),controller[_0xc790('0xd')]);router[_0xc790('0xe')](_0xc790('0xa'),auth[_0xc790('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbae9=['isAuthenticated','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','show'];(function(_0x1d0770,_0x4711d4){var _0x5bc7fa=function(_0x2ce7a8){while(--_0x2ce7a8){_0x1d0770['push'](_0x1d0770['shift']());}};_0x5bc7fa(++_0x4711d4);}(_0xbae9,0x197));var _0x9bae=function(_0x5ad220,_0x27407e){_0x5ad220=_0x5ad220-0x0;var _0xdec77d=_0xbae9[_0x5ad220];return _0xdec77d;};'use strict';var multer=require(_0x9bae('0x0'));var util=require('util');var path=require(_0x9bae('0x1'));var timeout=require(_0x9bae('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9bae('0x3'));var auth=require(_0x9bae('0x4'));var interaction=require(_0x9bae('0x5'));var config=require(_0x9bae('0x6'));var controller=require(_0x9bae('0x7'));router[_0x9bae('0x8')]('/',auth['isAuthenticated'](),controller[_0x9bae('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9bae('0xa')]);router['post']('/',auth[_0x9bae('0xb')](),controller[_0x9bae('0xc')]);router[_0x9bae('0xd')]('/:id',auth[_0x9bae('0xb')](),controller[_0x9bae('0xe')]);router[_0x9bae('0xf')](_0x9bae('0x10'),auth[_0x9bae('0xb')](),controller[_0x9bae('0x11')]);module[_0x9bae('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9a72790..6305f47 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 _0x25fa=['moment','exports','STRING','contactListQueue','INTEGER'];(function(_0x41eb72,_0x2eebb7){var _0x4803a6=function(_0x13f70b){while(--_0x13f70b){_0x41eb72['push'](_0x41eb72['shift']());}};_0x4803a6(++_0x2eebb7);}(_0x25fa,0x109));var _0xa25f=function(_0x365852,_0x5f15eb){_0x365852=_0x365852-0x0;var _0x34dc81=_0x25fa[_0x365852];return _0x34dc81;};'use strict';var moment=require(_0xa25f('0x0'));var Sequelize=require('sequelize');module[_0xa25f('0x1')]={'phone':{'type':Sequelize[_0xa25f('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa25f('0x3')},'ListId':{'type':Sequelize[_0xa25f('0x4')],'unique':_0xa25f('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x2014=['sequelize','exports','INTEGER','contactListQueue','moment'];(function(_0x468dad,_0x322380){var _0x2a004e=function(_0x362c27){while(--_0x362c27){_0x468dad['push'](_0x468dad['shift']());}};_0x2a004e(++_0x322380);}(_0x2014,0x103));var _0x4201=function(_0x59d3d7,_0x1631f5){_0x59d3d7=_0x59d3d7-0x0;var _0x2ade5c=_0x2014[_0x59d3d7];return _0x2ade5c;};'use strict';var moment=require(_0x4201('0x0'));var Sequelize=require(_0x4201('0x1'));module[_0x4201('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4201('0x3')],'unique':_0x4201('0x4')},'ListId':{'type':Sequelize[_0x4201('0x3')],'unique':_0x4201('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x4201('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 9b576e2..cb8f21c 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 _0xa204=['CmHopperBlack','key','name','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','rows','catch','show','params','keys','rawAttributes','intersection','options','find','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','send','index','map'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa204,0xbc));var _0x4a20=function(_0x5c7525,_0x39490f){_0x5c7525=_0x5c7525-0x0;var _0x2e2ec8=_0xa204[_0x5c7525];return _0x2e2ec8;};'use strict';var emlformat=require(_0x4a20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a20('0x1'));var jsonpatch=require(_0x4a20('0x2'));var rp=require(_0x4a20('0x3'));var moment=require(_0x4a20('0x4'));var BPromise=require(_0x4a20('0x5'));var Mustache=require(_0x4a20('0x6'));var util=require(_0x4a20('0x7'));var path=require(_0x4a20('0x8'));var sox=require(_0x4a20('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a20('0xa'));var _=require(_0x4a20('0xb'));var squel=require(_0x4a20('0xc'));var crypto=require(_0x4a20('0xd'));var jsforce=require(_0x4a20('0xe'));var deskjs=require(_0x4a20('0xf'));var toCsv=require(_0x4a20('0x10'));var querystring=require(_0x4a20('0x11'));var Papa=require(_0x4a20('0x12'));var Redis=require(_0x4a20('0x13'));var authService=require(_0x4a20('0x14'));var qs=require(_0x4a20('0x15'));var as=require(_0x4a20('0x16'));var hardwareService=require(_0x4a20('0x17'));var logger=require('../../config/logger')(_0x4a20('0x18'));var utils=require(_0x4a20('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4a20('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5006eb,_0x1e1cc){_0x1e1cc=_0x1e1cc||0xcc;return function(_0x254677){if(_0x254677){return _0x5006eb[_0x4a20('0x1b')](_0x1e1cc);}return _0x5006eb[_0x4a20('0x1c')](_0x1e1cc)['end']();};}function respondWithResult(_0x16351b,_0x47af77){_0x47af77=_0x47af77||0xc8;return function(_0x5010d4){if(_0x5010d4){return _0x16351b[_0x4a20('0x1c')](_0x47af77)[_0x4a20('0x1d')](_0x5010d4);}};}function respondWithFilteredResult(_0x4a7689,_0x48ad36){return function(_0x294233){if(_0x294233){var _0x3605f2=typeof _0x48ad36[_0x4a20('0x1e')]===_0x4a20('0x1f')&&typeof _0x48ad36[_0x4a20('0x20')]===_0x4a20('0x1f');var _0x54d55b=_0x294233[_0x4a20('0x21')];var _0xeab4ad=_0x3605f2?0x0:_0x48ad36[_0x4a20('0x1e')];var _0x31562c=_0x3605f2?_0x294233[_0x4a20('0x21')]:_0x48ad36[_0x4a20('0x1e')]+_0x48ad36[_0x4a20('0x20')];var _0xb10d0;if(_0x31562c>=_0x54d55b){_0x31562c=_0x54d55b;_0xb10d0=0xc8;}else{_0xb10d0=0xce;}_0x4a7689[_0x4a20('0x1c')](_0xb10d0);return _0x4a7689[_0x4a20('0x22')](_0x4a20('0x23'),_0xeab4ad+'-'+_0x31562c+'/'+_0x54d55b)[_0x4a20('0x1d')](_0x294233);}return null;};}function patchUpdates(_0x309745){return function(_0x33cc83){try{jsonpatch[_0x4a20('0x24')](_0x33cc83,_0x309745,!![]);}catch(_0x294fad){return BPromise[_0x4a20('0x25')](_0x294fad);}return _0x33cc83[_0x4a20('0x26')]();};}function saveUpdates(_0x133bea,_0x496ef9){return function(_0x2db357){if(_0x2db357){return _0x2db357['update'](_0x133bea)[_0x4a20('0x27')](function(_0x32ad7a){return _0x32ad7a;});}return null;};}function removeEntity(_0x2c73cd,_0x40226d){return function(_0x3ab52e){if(_0x3ab52e){return _0x3ab52e[_0x4a20('0x28')]()[_0x4a20('0x27')](function(){_0x2c73cd[_0x4a20('0x1c')](0xcc)[_0x4a20('0x29')]();});}};}function handleEntityNotFound(_0xe2ae48,_0x50cca0){return function(_0xe7e235){if(!_0xe7e235){_0xe2ae48[_0x4a20('0x1b')](0x194);}return _0xe7e235;};}function handleError(_0x463e10,_0x327197){_0x327197=_0x327197||0x1f4;return function(_0x2fe0c3){logger[_0x4a20('0x2a')](_0x2fe0c3['stack']);if(_0x2fe0c3['name']){delete _0x2fe0c3['name'];}_0x463e10[_0x4a20('0x1c')](_0x327197)[_0x4a20('0x2b')](_0x2fe0c3);};}exports[_0x4a20('0x2c')]=function(_0x50bb40,_0xaff454){var _0x26a502={},_0x234018={},_0x4d8894={'count':0x0,'rows':[]};var _0x4c23ec=_[_0x4a20('0x2d')](db[_0x4a20('0x2e')]['rawAttributes'],function(_0x245ba6){return{'name':_0x245ba6['fieldName'],'type':_0x245ba6['type'][_0x4a20('0x2f')]};});_0x234018['model']=_[_0x4a20('0x2d')](_0x4c23ec,_0x4a20('0x30'));_0x234018[_0x4a20('0x31')]=_['keys'](_0x50bb40[_0x4a20('0x31')]);_0x234018['filters']=_['intersection'](_0x234018[_0x4a20('0x32')],_0x234018[_0x4a20('0x31')]);_0x26a502['attributes']=_['intersection'](_0x234018[_0x4a20('0x32')],qs[_0x4a20('0x33')](_0x50bb40[_0x4a20('0x31')]['fields']));_0x26a502[_0x4a20('0x34')]=_0x26a502[_0x4a20('0x34')][_0x4a20('0x35')]?_0x26a502['attributes']:_0x234018[_0x4a20('0x32')];if(!_0x50bb40[_0x4a20('0x31')][_0x4a20('0x36')](_0x4a20('0x37'))){_0x26a502[_0x4a20('0x20')]=qs['limit'](_0x50bb40[_0x4a20('0x31')]['limit']);_0x26a502['offset']=qs['offset'](_0x50bb40[_0x4a20('0x31')][_0x4a20('0x1e')]);}_0x26a502[_0x4a20('0x38')]=qs['sort'](_0x50bb40[_0x4a20('0x31')][_0x4a20('0x39')]);_0x26a502[_0x4a20('0x3a')]=qs[_0x4a20('0x3b')](_['pick'](_0x50bb40[_0x4a20('0x31')],_0x234018['filters']),_0x4c23ec);if(_0x50bb40['query'][_0x4a20('0x3c')]){_0x26a502[_0x4a20('0x3a')]=_[_0x4a20('0x3d')](_0x26a502['where'],{'$or':_[_0x4a20('0x2d')](_0x4c23ec,function(_0x3c80d2){if(_0x3c80d2[_0x4a20('0x3e')]!==_0x4a20('0x3f')){var _0x2ba952={};_0x2ba952[_0x3c80d2['name']]={'$like':'%'+_0x50bb40[_0x4a20('0x31')][_0x4a20('0x3c')]+'%'};return _0x2ba952;}})});}_0x26a502=_['merge']({},_0x26a502,_0x50bb40['options']);var _0x59ed57={'where':_0x26a502['where']};return db[_0x4a20('0x2e')][_0x4a20('0x21')](_0x59ed57)[_0x4a20('0x27')](function(_0x3861c0){_0x4d8894['count']=_0x3861c0;if(_0x50bb40[_0x4a20('0x31')][_0x4a20('0x40')]){_0x26a502[_0x4a20('0x41')]=[{'all':!![]}];}return db[_0x4a20('0x2e')]['findAll'](_0x26a502);})[_0x4a20('0x27')](function(_0x25f0e8){_0x4d8894[_0x4a20('0x42')]=_0x25f0e8;return _0x4d8894;})[_0x4a20('0x27')](respondWithFilteredResult(_0xaff454,_0x26a502))[_0x4a20('0x43')](handleError(_0xaff454,null));};exports[_0x4a20('0x44')]=function(_0x24ebdc,_0x17a8cd){var _0xd81598={'raw':!![],'where':{'id':_0x24ebdc[_0x4a20('0x45')]['id']}},_0x1aacec={};_0x1aacec['model']=_[_0x4a20('0x46')](db[_0x4a20('0x2e')][_0x4a20('0x47')]);_0x1aacec['query']=_['keys'](_0x24ebdc[_0x4a20('0x31')]);_0x1aacec[_0x4a20('0x3b')]=_[_0x4a20('0x48')](_0x1aacec[_0x4a20('0x32')],_0x1aacec['query']);_0xd81598[_0x4a20('0x34')]=_[_0x4a20('0x48')](_0x1aacec[_0x4a20('0x32')],qs[_0x4a20('0x33')](_0x24ebdc[_0x4a20('0x31')][_0x4a20('0x33')]));_0xd81598[_0x4a20('0x34')]=_0xd81598[_0x4a20('0x34')]['length']?_0xd81598['attributes']:_0x1aacec['model'];if(_0x24ebdc[_0x4a20('0x31')][_0x4a20('0x40')]){_0xd81598[_0x4a20('0x41')]=[{'all':!![]}];}_0xd81598=_[_0x4a20('0x3d')]({},_0xd81598,_0x24ebdc[_0x4a20('0x49')]);return db[_0x4a20('0x2e')][_0x4a20('0x4a')](_0xd81598)[_0x4a20('0x27')](handleEntityNotFound(_0x17a8cd,null))[_0x4a20('0x27')](respondWithResult(_0x17a8cd,null))[_0x4a20('0x43')](handleError(_0x17a8cd,null));};exports[_0x4a20('0x4b')]=function(_0x463508,_0x4b46a2){if(_0x463508[_0x4a20('0x4c')]['id']){delete _0x463508[_0x4a20('0x4c')]['id'];}return db['CmHopperBlack'][_0x4a20('0x4a')]({'where':{'id':_0x463508[_0x4a20('0x45')]['id']}})[_0x4a20('0x27')](handleEntityNotFound(_0x4b46a2,null))['then'](saveUpdates(_0x463508[_0x4a20('0x4c')],null))[_0x4a20('0x27')](respondWithResult(_0x4b46a2,null))[_0x4a20('0x43')](handleError(_0x4b46a2,null));};exports[_0x4a20('0x28')]=function(_0x3eaf86,_0x25e96f){return db[_0x4a20('0x2e')][_0x4a20('0x4a')]({'where':{'id':_0x3eaf86['params']['id']}})[_0x4a20('0x27')](handleEntityNotFound(_0x25e96f,null))[_0x4a20('0x27')](removeEntity(_0x25e96f,null))[_0x4a20('0x43')](handleError(_0x25e96f,null));};exports[_0x4a20('0x4d')]=function(_0xfbcdf7,_0x1c5b33){return db[_0x4a20('0x2e')]['describe']()[_0x4a20('0x27')](respondWithResult(_0x1c5b33,null))[_0x4a20('0x43')](handleError(_0x1c5b33,null));}; \ No newline at end of file +var _0x0079=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CmHopperBlack','includeAll','rows','params','include','options','find','catch','body','describe','eml-format'];(function(_0x5a2436,_0x11375a){var _0x2d8468=function(_0x5b77b9){while(--_0x5b77b9){_0x5a2436['push'](_0x5a2436['shift']());}};_0x2d8468(++_0x11375a);}(_0x0079,0x16c));var _0x9007=function(_0x3afbae,_0x5535c3){_0x3afbae=_0x3afbae-0x0;var _0x126d86=_0x0079[_0x3afbae];return _0x126d86;};'use strict';var emlformat=require(_0x9007('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9007('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9007('0x2'));var moment=require(_0x9007('0x3'));var BPromise=require(_0x9007('0x4'));var Mustache=require(_0x9007('0x5'));var util=require(_0x9007('0x6'));var path=require(_0x9007('0x7'));var sox=require(_0x9007('0x8'));var csv=require('to-csv');var ejs=require(_0x9007('0x9'));var fs=require('fs');var fs_extra=require(_0x9007('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9007('0xb'));var deskjs=require(_0x9007('0xc'));var toCsv=require(_0x9007('0xd'));var querystring=require(_0x9007('0xe'));var Papa=require(_0x9007('0xf'));var Redis=require('ioredis');var authService=require(_0x9007('0x10'));var qs=require(_0x9007('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9007('0x12'));var logger=require(_0x9007('0x13'))(_0x9007('0x14'));var utils=require(_0x9007('0x15'));var config=require(_0x9007('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9007('0x17'))['db'];function respondWithStatusCode(_0x44a4d3,_0x1845d8){_0x1845d8=_0x1845d8||0xcc;return function(_0x569e6c){if(_0x569e6c){return _0x44a4d3[_0x9007('0x18')](_0x1845d8);}return _0x44a4d3[_0x9007('0x19')](_0x1845d8)[_0x9007('0x1a')]();};}function respondWithResult(_0x4fdf42,_0x697589){_0x697589=_0x697589||0xc8;return function(_0x17e13f){if(_0x17e13f){return _0x4fdf42[_0x9007('0x19')](_0x697589)['json'](_0x17e13f);}};}function respondWithFilteredResult(_0x2afbdc,_0x2d318b){return function(_0x1ffcb0){if(_0x1ffcb0){var _0x3f74bd=typeof _0x2d318b[_0x9007('0x1b')]==='undefined'&&typeof _0x2d318b[_0x9007('0x1c')]===_0x9007('0x1d');var _0x2f8e19=_0x1ffcb0[_0x9007('0x1e')];var _0x4a0dcb=_0x3f74bd?0x0:_0x2d318b[_0x9007('0x1b')];var _0x1af394=_0x3f74bd?_0x1ffcb0[_0x9007('0x1e')]:_0x2d318b['offset']+_0x2d318b[_0x9007('0x1c')];var _0xbfae2e;if(_0x1af394>=_0x2f8e19){_0x1af394=_0x2f8e19;_0xbfae2e=0xc8;}else{_0xbfae2e=0xce;}_0x2afbdc[_0x9007('0x19')](_0xbfae2e);return _0x2afbdc[_0x9007('0x1f')](_0x9007('0x20'),_0x4a0dcb+'-'+_0x1af394+'/'+_0x2f8e19)[_0x9007('0x21')](_0x1ffcb0);}return null;};}function patchUpdates(_0x152827){return function(_0x3d1b0e){try{jsonpatch['apply'](_0x3d1b0e,_0x152827,!![]);}catch(_0x1ebf10){return BPromise['reject'](_0x1ebf10);}return _0x3d1b0e[_0x9007('0x22')]();};}function saveUpdates(_0x14fb85,_0x3f28e9){return function(_0x35c60c){if(_0x35c60c){return _0x35c60c[_0x9007('0x23')](_0x14fb85)[_0x9007('0x24')](function(_0x3f576c){return _0x3f576c;});}return null;};}function removeEntity(_0x39a88d,_0x231fe7){return function(_0x3b3938){if(_0x3b3938){return _0x3b3938['destroy']()[_0x9007('0x24')](function(){_0x39a88d[_0x9007('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32dcf4,_0x13417a){return function(_0x192040){if(!_0x192040){_0x32dcf4[_0x9007('0x18')](0x194);}return _0x192040;};}function handleError(_0x26048d,_0x1577fd){_0x1577fd=_0x1577fd||0x1f4;return function(_0x4f42e2){logger[_0x9007('0x25')](_0x4f42e2[_0x9007('0x26')]);if(_0x4f42e2[_0x9007('0x27')]){delete _0x4f42e2['name'];}_0x26048d['status'](_0x1577fd)[_0x9007('0x28')](_0x4f42e2);};}exports[_0x9007('0x29')]=function(_0x345a9d,_0x1b946c){var _0x1fbef6={},_0x227d24={},_0x29712a={'count':0x0,'rows':[]};var _0x2b0171=_[_0x9007('0x2a')](db['CmHopperBlack'][_0x9007('0x2b')],function(_0x554326){return{'name':_0x554326[_0x9007('0x2c')],'type':_0x554326[_0x9007('0x2d')][_0x9007('0x2e')]};});_0x227d24[_0x9007('0x2f')]=_['map'](_0x2b0171,_0x9007('0x27'));_0x227d24['query']=_[_0x9007('0x30')](_0x345a9d[_0x9007('0x31')]);_0x227d24[_0x9007('0x32')]=_[_0x9007('0x33')](_0x227d24[_0x9007('0x2f')],_0x227d24[_0x9007('0x31')]);_0x1fbef6['attributes']=_[_0x9007('0x33')](_0x227d24[_0x9007('0x2f')],qs['fields'](_0x345a9d[_0x9007('0x31')][_0x9007('0x34')]));_0x1fbef6[_0x9007('0x35')]=_0x1fbef6['attributes'][_0x9007('0x36')]?_0x1fbef6[_0x9007('0x35')]:_0x227d24['model'];if(!_0x345a9d['query'][_0x9007('0x37')](_0x9007('0x38'))){_0x1fbef6[_0x9007('0x1c')]=qs[_0x9007('0x1c')](_0x345a9d[_0x9007('0x31')][_0x9007('0x1c')]);_0x1fbef6[_0x9007('0x1b')]=qs[_0x9007('0x1b')](_0x345a9d[_0x9007('0x31')][_0x9007('0x1b')]);}_0x1fbef6[_0x9007('0x39')]=qs[_0x9007('0x3a')](_0x345a9d[_0x9007('0x31')][_0x9007('0x3a')]);_0x1fbef6[_0x9007('0x3b')]=qs[_0x9007('0x32')](_[_0x9007('0x3c')](_0x345a9d['query'],_0x227d24[_0x9007('0x32')]),_0x2b0171);if(_0x345a9d[_0x9007('0x31')][_0x9007('0x3d')]){_0x1fbef6[_0x9007('0x3b')]=_[_0x9007('0x3e')](_0x1fbef6['where'],{'$or':_[_0x9007('0x2a')](_0x2b0171,function(_0xfec923){if(_0xfec923[_0x9007('0x2d')]!=='VIRTUAL'){var _0x5d2d3f={};_0x5d2d3f[_0xfec923[_0x9007('0x27')]]={'$like':'%'+_0x345a9d[_0x9007('0x31')]['filter']+'%'};return _0x5d2d3f;}})});}_0x1fbef6=_[_0x9007('0x3e')]({},_0x1fbef6,_0x345a9d['options']);var _0xa468c4={'where':_0x1fbef6['where']};return db[_0x9007('0x3f')][_0x9007('0x1e')](_0xa468c4)['then'](function(_0x17f5f8){_0x29712a[_0x9007('0x1e')]=_0x17f5f8;if(_0x345a9d['query'][_0x9007('0x40')]){_0x1fbef6['include']=[{'all':!![]}];}return db[_0x9007('0x3f')]['findAll'](_0x1fbef6);})[_0x9007('0x24')](function(_0x52f970){_0x29712a[_0x9007('0x41')]=_0x52f970;return _0x29712a;})['then'](respondWithFilteredResult(_0x1b946c,_0x1fbef6))['catch'](handleError(_0x1b946c,null));};exports['show']=function(_0x1f0f52,_0x52fd09){var _0x40204d={'raw':!![],'where':{'id':_0x1f0f52[_0x9007('0x42')]['id']}},_0x4062c9={};_0x4062c9[_0x9007('0x2f')]=_[_0x9007('0x30')](db[_0x9007('0x3f')][_0x9007('0x2b')]);_0x4062c9[_0x9007('0x31')]=_[_0x9007('0x30')](_0x1f0f52[_0x9007('0x31')]);_0x4062c9[_0x9007('0x32')]=_[_0x9007('0x33')](_0x4062c9[_0x9007('0x2f')],_0x4062c9[_0x9007('0x31')]);_0x40204d[_0x9007('0x35')]=_[_0x9007('0x33')](_0x4062c9['model'],qs['fields'](_0x1f0f52[_0x9007('0x31')][_0x9007('0x34')]));_0x40204d[_0x9007('0x35')]=_0x40204d[_0x9007('0x35')][_0x9007('0x36')]?_0x40204d[_0x9007('0x35')]:_0x4062c9['model'];if(_0x1f0f52[_0x9007('0x31')][_0x9007('0x40')]){_0x40204d[_0x9007('0x43')]=[{'all':!![]}];}_0x40204d=_[_0x9007('0x3e')]({},_0x40204d,_0x1f0f52[_0x9007('0x44')]);return db['CmHopperBlack'][_0x9007('0x45')](_0x40204d)[_0x9007('0x24')](handleEntityNotFound(_0x52fd09,null))['then'](respondWithResult(_0x52fd09,null))[_0x9007('0x46')](handleError(_0x52fd09,null));};exports[_0x9007('0x23')]=function(_0x4acc3f,_0x10f3fe){if(_0x4acc3f[_0x9007('0x47')]['id']){delete _0x4acc3f[_0x9007('0x47')]['id'];}return db[_0x9007('0x3f')][_0x9007('0x45')]({'where':{'id':_0x4acc3f['params']['id']}})[_0x9007('0x24')](handleEntityNotFound(_0x10f3fe,null))['then'](saveUpdates(_0x4acc3f[_0x9007('0x47')],null))['then'](respondWithResult(_0x10f3fe,null))[_0x9007('0x46')](handleError(_0x10f3fe,null));};exports['destroy']=function(_0x470e67,_0xba5d67){return db[_0x9007('0x3f')][_0x9007('0x45')]({'where':{'id':_0x470e67[_0x9007('0x42')]['id']}})['then'](handleEntityNotFound(_0xba5d67,null))[_0x9007('0x24')](removeEntity(_0xba5d67,null))['catch'](handleError(_0xba5d67,null));};exports[_0x9007('0x48')]=function(_0x5b0d6a,_0x48c0c4){return db['CmHopperBlack'][_0x9007('0x48')]()['then'](respondWithResult(_0x48c0c4,null))[_0x9007('0x46')](handleError(_0x48c0c4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4abed1c..7b680d3 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 _0x5c0b=['api','bluebird','path','rimraf','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x5c0b,0x76));var _0xb5c0=function(_0x18bb48,_0x3898d6){_0x18bb48=_0x18bb48-0x0;var _0x4d6c2b=_0x5c0b[_0x18bb48];return _0x4d6c2b;};'use strict';var _=require(_0xb5c0('0x0'));var util=require(_0xb5c0('0x1'));var logger=require(_0xb5c0('0x2'))(_0xb5c0('0x3'));var moment=require('moment');var BPromise=require(_0xb5c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb5c0('0x5'));var rimraf=require(_0xb5c0('0x6'));var config=require('../../config/environment');var attributes=require(_0xb5c0('0x7'));module[_0xb5c0('0x8')]=function(_0x4b9689,_0x26dc18){return _0x4b9689['define'](_0xb5c0('0x9'),attributes,{'tableName':_0xb5c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8a6=['request-promise','path','../../config/environment','./cmHopperBlack.attributes','cm_hopper_black','lodash','util','../../config/logger','api','bluebird'];(function(_0x449ab2,_0x1b67a9){var _0x10def9=function(_0x2f9480){while(--_0x2f9480){_0x449ab2['push'](_0x449ab2['shift']());}};_0x10def9(++_0x1b67a9);}(_0xb8a6,0x14f));var _0x6b8a=function(_0xc30e99,_0x3ae617){_0xc30e99=_0xc30e99-0x0;var _0x501833=_0xb8a6[_0xc30e99];return _0x501833;};'use strict';var _=require(_0x6b8a('0x0'));var util=require(_0x6b8a('0x1'));var logger=require(_0x6b8a('0x2'))(_0x6b8a('0x3'));var moment=require('moment');var BPromise=require(_0x6b8a('0x4'));var rp=require(_0x6b8a('0x5'));var fs=require('fs');var path=require(_0x6b8a('0x6'));var rimraf=require('rimraf');var config=require(_0x6b8a('0x7'));var attributes=require(_0x6b8a('0x8'));module['exports']=function(_0x412b46,_0x870c00){return _0x412b46['define']('CmHopperBlack',attributes,{'tableName':_0x6b8a('0x9'),'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 dd6091a..88d6914 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 _0xec36=['GetCmHopperBlack','stringify','catch','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','code','error','CmHopperBlack,\x20%s,\x20%s','message','CmHopperBlack','findAll','options','where','attributes','limit','map','include','model','then'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xec36,0x17a));var _0x6ec3=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xec36[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6ec3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6ec3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ec3('0x2'));var db=require(_0x6ec3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ec3('0x4'))(_0x6ec3('0x5'));var config=require(_0x6ec3('0x6'));var jayson=require(_0x6ec3('0x7'));var client=jayson[_0x6ec3('0x8')][_0x6ec3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47748a,_0x22daf4,_0x2ce12b){return new BPromise(function(_0x3bfc56,_0x2672c9){return client[_0x6ec3('0xa')](_0x47748a,_0x2ce12b)['then'](function(_0xa12bda){logger[_0x6ec3('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x22daf4,_0x6ec3('0xc'));logger[_0x6ec3('0xd')](_0x6ec3('0xe'),_0x22daf4,_0x6ec3('0xc'),JSON['stringify'](_0xa12bda));if(_0xa12bda['error']){if(_0xa12bda['error'][_0x6ec3('0xf')]===0x1f4){logger[_0x6ec3('0x10')](_0x6ec3('0x11'),_0x22daf4,_0xa12bda[_0x6ec3('0x10')]['message']);return _0x2672c9(_0xa12bda['error'][_0x6ec3('0x12')]);}logger[_0x6ec3('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x22daf4,_0xa12bda['error']['message']);return _0x3bfc56(_0xa12bda[_0x6ec3('0x10')][_0x6ec3('0x12')]);}else{logger['info'](_0x6ec3('0x11'),_0x22daf4,'request\x20sent');_0x3bfc56(_0xa12bda['result'][_0x6ec3('0x12')]);}})['catch'](function(_0xb72495){logger[_0x6ec3('0x10')](_0x6ec3('0x11'),_0x22daf4,_0xb72495);_0x2672c9(_0xb72495);});});}exports['GetCmHopperBlack']=function(_0x59208f){var _0x1b282d=this;return new Promise(function(_0x54c11d,_0x3d7721){return db[_0x6ec3('0x13')][_0x6ec3('0x14')]({'raw':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x16')]||null:null,'attributes':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x17')]||null:null,'limit':_0x59208f[_0x6ec3('0x15')]?_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x18')]||null:null,'include':_0x59208f[_0x6ec3('0x15')]?_0x59208f['options']['include']?_[_0x6ec3('0x19')](_0x59208f[_0x6ec3('0x15')][_0x6ec3('0x1a')],function(_0x3ff888){return{'model':db[_0x3ff888[_0x6ec3('0x1b')]],'as':_0x3ff888['as'],'attributes':_0x3ff888[_0x6ec3('0x17')],'include':_0x3ff888[_0x6ec3('0x1a')]?_[_0x6ec3('0x19')](_0x3ff888[_0x6ec3('0x1a')],function(_0x1f2e7d){return{'model':db[_0x1f2e7d[_0x6ec3('0x1b')]],'as':_0x1f2e7d['as'],'attributes':_0x1f2e7d[_0x6ec3('0x17')],'include':_0x1f2e7d[_0x6ec3('0x1a')]?_['map'](_0x1f2e7d[_0x6ec3('0x1a')],function(_0x3d5a0c){return{'model':db[_0x3d5a0c[_0x6ec3('0x1b')]],'as':_0x3d5a0c['as'],'attributes':_0x3d5a0c['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ec3('0x1c')](function(_0x2b490c){logger[_0x6ec3('0xb')](_0x6ec3('0x1d'),_0x59208f);logger['debug']('GetCmHopperBlack',_0x59208f,JSON[_0x6ec3('0x1e')](_0x2b490c));_0x54c11d(_0x2b490c);})[_0x6ec3('0x1f')](function(_0x41b452){logger['error'](_0x6ec3('0x1d'),_0x41b452[_0x6ec3('0x12')],_0x59208f);_0x3d7721(_0x1b282d['error'](0x1f4,_0x41b452[_0x6ec3('0x12')]));});});};exports[_0x6ec3('0x20')]=function(_0xada988){var _0x5405d4=this;return new Promise(function(_0x287c4c,_0x273e2f){return db[_0x6ec3('0x13')][_0x6ec3('0x21')](_0xada988[_0x6ec3('0x22')],{'raw':_0xada988[_0x6ec3('0x15')]?_0xada988[_0x6ec3('0x15')][_0x6ec3('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xada988[_0x6ec3('0x15')]?_0xada988[_0x6ec3('0x15')][_0x6ec3('0x16')]||null:null,'attributes':_0xada988['options']?_0xada988[_0x6ec3('0x15')][_0x6ec3('0x17')]||null:null,'limit':_0xada988[_0x6ec3('0x15')]?_0xada988['options'][_0x6ec3('0x18')]||null:null})[_0x6ec3('0x1c')](function(_0x1a2973){logger[_0x6ec3('0xb')](_0x6ec3('0x20'),_0xada988);logger['debug'](_0x6ec3('0x20'),_0xada988,JSON[_0x6ec3('0x1e')](_0x1a2973));_0x287c4c(_0x1a2973);})[_0x6ec3('0x1f')](function(_0x40189b){logger[_0x6ec3('0x10')](_0x6ec3('0x20'),_0x40189b[_0x6ec3('0x12')],_0xada988);_0x273e2f(_0x5405d4[_0x6ec3('0x10')](0x1f4,_0x40189b[_0x6ec3('0x12')]));});});};exports[_0x6ec3('0x24')]=function(_0x5976fe){var _0x5a6920=this;return new Promise(function(_0x2f3708,_0x44f03a){return db[_0x6ec3('0x13')]['destroy']({'where':_0x5976fe[_0x6ec3('0x15')]?_0x5976fe[_0x6ec3('0x15')][_0x6ec3('0x16')]||null:null})[_0x6ec3('0x1c')](function(_0x2b9e9b){logger[_0x6ec3('0xb')](_0x6ec3('0x24'),_0x5976fe);logger[_0x6ec3('0xd')](_0x6ec3('0x24'),_0x5976fe,JSON[_0x6ec3('0x1e')](_0x2b9e9b));_0x2f3708(_0x2b9e9b);})[_0x6ec3('0x1f')](function(_0x554788){logger['error'](_0x6ec3('0x24'),_0x554788[_0x6ec3('0x12')],_0x5976fe);_0x44f03a(_0x5a6920[_0x6ec3('0x10')](0x1f4,_0x554788[_0x6ec3('0x12')]));});});}; \ No newline at end of file +var _0xab28=['rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x4b6f97,_0xfb599b){var _0xbdccb7=function(_0x5cb93d){while(--_0x5cb93d){_0x4b6f97['push'](_0x4b6f97['shift']());}};_0xbdccb7(++_0xfb599b);}(_0xab28,0xfd));var _0x8ab2=function(_0x33711e,_0x57999f){_0x33711e=_0x33711e-0x0;var _0x5816e3=_0xab28[_0x33711e];return _0x5816e3;};'use strict';var _=require(_0x8ab2('0x0'));var util=require(_0x8ab2('0x1'));var moment=require(_0x8ab2('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ab2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8ab2('0x4'));var logger=require(_0x8ab2('0x5'))(_0x8ab2('0x6'));var config=require(_0x8ab2('0x7'));var jayson=require(_0x8ab2('0x8'));var client=jayson[_0x8ab2('0x9')][_0x8ab2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ecc2d,_0x56353a,_0x3df6bb){return new BPromise(function(_0x355387,_0x11f800){return client['request'](_0x2ecc2d,_0x3df6bb)[_0x8ab2('0xb')](function(_0x5131a2){logger[_0x8ab2('0xc')](_0x8ab2('0xd'),_0x56353a,_0x8ab2('0xe'));logger[_0x8ab2('0xf')](_0x8ab2('0x10'),_0x56353a,_0x8ab2('0xe'),JSON[_0x8ab2('0x11')](_0x5131a2));if(_0x5131a2[_0x8ab2('0x12')]){if(_0x5131a2[_0x8ab2('0x12')]['code']===0x1f4){logger[_0x8ab2('0x12')](_0x8ab2('0xd'),_0x56353a,_0x5131a2['error'][_0x8ab2('0x13')]);return _0x11f800(_0x5131a2[_0x8ab2('0x12')][_0x8ab2('0x13')]);}logger[_0x8ab2('0x12')](_0x8ab2('0xd'),_0x56353a,_0x5131a2[_0x8ab2('0x12')][_0x8ab2('0x13')]);return _0x355387(_0x5131a2[_0x8ab2('0x12')][_0x8ab2('0x13')]);}else{logger['info'](_0x8ab2('0xd'),_0x56353a,'request\x20sent');_0x355387(_0x5131a2[_0x8ab2('0x14')][_0x8ab2('0x13')]);}})[_0x8ab2('0x15')](function(_0x55f657){logger[_0x8ab2('0x12')](_0x8ab2('0xd'),_0x56353a,_0x55f657);_0x11f800(_0x55f657);});});}exports[_0x8ab2('0x16')]=function(_0x4e1166){var _0x435068=this;return new Promise(function(_0x50b966,_0x31aa96){return db[_0x8ab2('0x17')][_0x8ab2('0x18')]({'raw':_0x4e1166[_0x8ab2('0x19')]?_0x4e1166[_0x8ab2('0x19')][_0x8ab2('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e1166[_0x8ab2('0x19')]?_0x4e1166[_0x8ab2('0x19')][_0x8ab2('0x1b')]||null:null,'attributes':_0x4e1166['options']?_0x4e1166['options'][_0x8ab2('0x1c')]||null:null,'limit':_0x4e1166['options']?_0x4e1166['options'][_0x8ab2('0x1d')]||null:null,'include':_0x4e1166[_0x8ab2('0x19')]?_0x4e1166[_0x8ab2('0x19')][_0x8ab2('0x1e')]?_['map'](_0x4e1166['options']['include'],function(_0x212e5e){return{'model':db[_0x212e5e[_0x8ab2('0x1f')]],'as':_0x212e5e['as'],'attributes':_0x212e5e[_0x8ab2('0x1c')],'include':_0x212e5e['include']?_[_0x8ab2('0x20')](_0x212e5e[_0x8ab2('0x1e')],function(_0x45f2b6){return{'model':db[_0x45f2b6[_0x8ab2('0x1f')]],'as':_0x45f2b6['as'],'attributes':_0x45f2b6['attributes'],'include':_0x45f2b6[_0x8ab2('0x1e')]?_['map'](_0x45f2b6['include'],function(_0x509dea){return{'model':db[_0x509dea[_0x8ab2('0x1f')]],'as':_0x509dea['as'],'attributes':_0x509dea[_0x8ab2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8ab2('0xb')](function(_0x11da35){logger['info']('GetCmHopperBlack',_0x4e1166);logger[_0x8ab2('0xf')](_0x8ab2('0x16'),_0x4e1166,JSON[_0x8ab2('0x11')](_0x11da35));_0x50b966(_0x11da35);})[_0x8ab2('0x15')](function(_0x53210d){logger['error'](_0x8ab2('0x16'),_0x53210d[_0x8ab2('0x13')],_0x4e1166);_0x31aa96(_0x435068[_0x8ab2('0x12')](0x1f4,_0x53210d[_0x8ab2('0x13')]));});});};exports[_0x8ab2('0x21')]=function(_0x59056e){var _0x2683bf=this;return new Promise(function(_0x3e53ce,_0x1ca3d2){return db[_0x8ab2('0x17')][_0x8ab2('0x22')](_0x59056e[_0x8ab2('0x23')],{'raw':_0x59056e['options']?_0x59056e[_0x8ab2('0x19')][_0x8ab2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59056e[_0x8ab2('0x19')]?_0x59056e[_0x8ab2('0x19')][_0x8ab2('0x1b')]||null:null,'attributes':_0x59056e[_0x8ab2('0x19')]?_0x59056e[_0x8ab2('0x19')][_0x8ab2('0x1c')]||null:null,'limit':_0x59056e['options']?_0x59056e['options'][_0x8ab2('0x1d')]||null:null})['then'](function(_0xf67cfd){logger['info'](_0x8ab2('0x21'),_0x59056e);logger[_0x8ab2('0xf')](_0x8ab2('0x21'),_0x59056e,JSON[_0x8ab2('0x11')](_0xf67cfd));_0x3e53ce(_0xf67cfd);})['catch'](function(_0x59626f){logger[_0x8ab2('0x12')](_0x8ab2('0x21'),_0x59626f['message'],_0x59056e);_0x1ca3d2(_0x2683bf['error'](0x1f4,_0x59626f[_0x8ab2('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x2c81d2){var _0x1c1f24=this;return new Promise(function(_0xbc420e,_0xf8071c){return db[_0x8ab2('0x17')]['destroy']({'where':_0x2c81d2[_0x8ab2('0x19')]?_0x2c81d2[_0x8ab2('0x19')]['where']||null:null})[_0x8ab2('0xb')](function(_0x4f8f1c){logger[_0x8ab2('0xc')](_0x8ab2('0x24'),_0x2c81d2);logger[_0x8ab2('0xf')](_0x8ab2('0x24'),_0x2c81d2,JSON[_0x8ab2('0x11')](_0x4f8f1c));_0xbc420e(_0x4f8f1c);})[_0x8ab2('0x15')](function(_0x3594a2){logger[_0x8ab2('0x12')]('DestroyCmHopperBlack',_0x3594a2[_0x8ab2('0x13')],_0x2c81d2);_0xf8071c(_0x1c1f24['error'](0x1f4,_0x3594a2[_0x8ab2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 183dba6..758d9a1 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 _0x0424=['isAuthenticated','index','/describe','/:id','show','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','./cmHopperBlack.controller','get'];(function(_0x4947e3,_0x21f2ee){var _0x1911e5=function(_0x193c1b){while(--_0x193c1b){_0x4947e3['push'](_0x4947e3['shift']());}};_0x1911e5(++_0x21f2ee);}(_0x0424,0x159));var _0x4042=function(_0x4ded50,_0x4a6af3){_0x4ded50=_0x4ded50-0x0;var _0xa92135=_0x0424[_0x4ded50];return _0xa92135;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4042('0x0'));var timeout=require(_0x4042('0x1'));var express=require(_0x4042('0x2'));var router=express[_0x4042('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4042('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4042('0x5'));router[_0x4042('0x6')]('/',auth[_0x4042('0x7')](),controller[_0x4042('0x8')]);router[_0x4042('0x6')](_0x4042('0x9'),auth[_0x4042('0x7')](),controller['describe']);router['get'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xb')]);router['put'](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xc')]);router[_0x4042('0xd')](_0x4042('0xa'),auth[_0x4042('0x7')](),controller[_0x4042('0xe')]);module[_0x4042('0xf')]=router; \ No newline at end of file +var _0xf61e=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','isAuthenticated','describe','show','put'];(function(_0xd69ad0,_0x3fdda3){var _0x7be14b=function(_0x2391c6){while(--_0x2391c6){_0xd69ad0['push'](_0xd69ad0['shift']());}};_0x7be14b(++_0x3fdda3);}(_0xf61e,0x191));var _0xef61=function(_0x571c59,_0x975a8){_0x571c59=_0x571c59-0x0;var _0x21201b=_0xf61e[_0x571c59];return _0x21201b;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0x10')](_0xef61('0x11'),auth[_0xef61('0xd')](),controller[_0xef61('0x12')]);router[_0xef61('0x13')](_0xef61('0x11'),auth[_0xef61('0xd')](),controller[_0xef61('0x14')]);module[_0xef61('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 363c68f..d4902db 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 _0x35e6=['getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x35e6,0x72));var _0x635e=function(_0x15bc80,_0x90158a){_0x15bc80=_0x15bc80-0x0;var _0x46b3e7=_0x35e6[_0x15bc80];return _0x46b3e7;};'use strict';var Sequelize=require(_0x635e('0x0'));var moment=require(_0x635e('0x1'));module[_0x635e('0x2')]={'state':{'type':Sequelize[_0x635e('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x635e('0x4')]},'scheduledat':{'type':Sequelize[_0x635e('0x5')]},'countbusyretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x635e('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x635e('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x635e('0x4')]},'starttime':{'type':Sequelize[_0x635e('0x5')]},'responsetime':{'type':Sequelize[_0x635e('0x5')]},'answertime':{'type':Sequelize[_0x635e('0x5')]},'droptime':{'type':Sequelize[_0x635e('0x5')]},'endtime':{'type':Sequelize[_0x635e('0x5')]},'ringtime':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x635e('0x4')]},'campaign':{'type':Sequelize[_0x635e('0x4')]},'campaigntype':{'type':Sequelize[_0x635e('0x4')]},'membername':{'type':Sequelize[_0x635e('0x4')]},'reason':{'type':Sequelize[_0x635e('0x4')]},'disposition':{'type':Sequelize[_0x635e('0x4')]},'secondDisposition':{'type':Sequelize[_0x635e('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x635e('0x5')],'set':function(_0x4b6d14){var _0x1be9ab=this[_0x635e('0x6')](_0x635e('0x7'));if(_0x1be9ab&&_0x4b6d14){this[_0x635e('0x8')]('followuptime',moment(_0x4b6d14)[_0x635e('0x9')](moment(_0x1be9ab),_0x635e('0xa')));}}},'amd':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x635e('0x5')]},'callback':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x635e('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x635e('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x635e('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x635e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x746b=['diff','seconds','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x3a46e3,_0x744ee6){var _0x58798f=function(_0x39dd3e){while(--_0x39dd3e){_0x3a46e3['push'](_0x3a46e3['shift']());}};_0x58798f(++_0x744ee6);}(_0x746b,0x143));var _0xb746=function(_0x27e20a,_0x5df398){_0x27e20a=_0x27e20a-0x0;var _0x2e930c=_0x746b[_0x27e20a];return _0x2e930c;};'use strict';var Sequelize=require(_0xb746('0x0'));var moment=require('moment');module[_0xb746('0x1')]={'state':{'type':Sequelize[_0xb746('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb746('0x3')]},'scheduledat':{'type':Sequelize[_0xb746('0x4')]},'countbusyretry':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb746('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xb746('0x3')]},'originatecalleridname':{'type':Sequelize[_0xb746('0x3')]},'calleridnum':{'type':Sequelize[_0xb746('0x3')]},'calleridname':{'type':Sequelize[_0xb746('0x3')]},'starttime':{'type':Sequelize[_0xb746('0x4')]},'responsetime':{'type':Sequelize[_0xb746('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb746('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb746('0x3')]},'reason':{'type':Sequelize[_0xb746('0x3')]},'disposition':{'type':Sequelize[_0xb746('0x3')]},'secondDisposition':{'type':Sequelize[_0xb746('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb746('0x3')]},'dispositionat':{'type':Sequelize[_0xb746('0x4')],'set':function(_0x4891ca){var _0x28086c=this[_0xb746('0x5')]('endtime');if(_0x28086c&&_0x4891ca){this[_0xb746('0x6')]('followuptime',moment(_0x4891ca)[_0xb746('0x7')](moment(_0x28086c),_0xb746('0x8')));}}},'amd':{'type':Sequelize[_0xb746('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb746('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb746('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xb746('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb746('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb746('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb746('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb746('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb746('0x2')],'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 cb1d1ae..592c732 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 _0x4975=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','CmHopperFinal','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','phone','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','select'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x4975,0x86));var _0x5497=function(_0x567199,_0x2f80a5){_0x567199=_0x567199-0x0;var _0xc41788=_0x4975[_0x567199];return _0xc41788;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['CmHopperFinal'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['describe']()[_0x5497('0x24')](respondWithResult(_0x466287,null))[_0x5497('0x40')](handleError(_0x466287,null));};exports[_0x5497('0x23')]=function(_0x52a189,_0x3e4da2){if(_0x52a189['body'][_0x5497('0x46')]){delete _0x52a189[_0x5497('0x47')][_0x5497('0x46')];}return db['CmHopperFinal'][_0x5497('0x44')]({'where':{'uniqueid':_0x52a189[_0x5497('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e4da2,null))[_0x5497('0x24')](saveUpdates(_0x52a189['body'],null))[_0x5497('0x24')](respondWithResult(_0x3e4da2,null))['catch'](handleError(_0x3e4da2,null));};exports[_0x5497('0x48')]=function(_0x400860,_0x26fd9f,_0xf07541){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x400860[_0x5497('0x42')]['id']},'attributes':[[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize'][_0x5497('0x4d')]('`state`\x20=\x208,\x201,\x20null'))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x50')))),_0x5497('0x51')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x52')))),_0x5497('0x53')],[db['sequelize']['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x56')))),_0x5497('0x57')]]})[_0x5497('0x24')](handleEntityNotFound(_0x26fd9f,null))[_0x5497('0x24')](respondWithResult(_0x26fd9f,null))[_0x5497('0x40')](handleError(_0x26fd9f,null));};exports[_0x5497('0x58')]=function(_0x573f93,_0x18b30c,_0x3b0350){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'CampaignId':_0x573f93['params']['id']},'attributes':[[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x59')))),_0x5497('0x5a')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x5b')))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5497('0x51')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5497('0x53')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x56')))),_0x5497('0x57')]]})['then'](handleEntityNotFound(_0x18b30c,null))[_0x5497('0x24')](respondWithResult(_0x18b30c,null))[_0x5497('0x40')](handleError(_0x18b30c,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){return db[_0x5497('0x5d')][_0x5497('0x44')]({'where':{'id':_0x4ef195['params']['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x24')](function(_0x21c715){var _0x286af8;if(_0x21c715){_0x286af8=squel['insert']()[_0x5497('0x5e')](_0x5497('0x5f'))[_0x5497('0x60')](['phone',_0x5497('0x61'),_0x5497('0x62'),'ListId',_0x5497('0x63'),_0x5497('0x64'),_0x5497('0x65')],squel['select']()['field'](_0x5497('0x66'),_0x5497('0x67'))[_0x5497('0x68')](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x6d'),_0x5497('0x63'))[_0x5497('0x68')]('NOW()',_0x5497('0x64'))[_0x5497('0x68')]('NOW()',_0x5497('0x65'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4ef195[_0x5497('0x47')][_0x5497('0x73')]['toString']())[_0x5497('0x37')](_0x5497('0x74'))[_0x5497('0x37')](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x67'))['from'](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195[_0x5497('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5497('0x76'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id']['toString']())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x286af8);}return[];})[_0x5497('0x24')](respondWithResult(_0x5794ff,null))[_0x5497('0x40')](handleError(_0x5794ff,null));};exports[_0x5497('0x79')]=function(_0x4c41c4,_0x1515f1,_0x4118ec){return db[_0x5497('0x7a')][_0x5497('0x44')]({'where':{'id':_0x4c41c4[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x1515f1,null))['then'](function(_0x1ef7fc){var _0x5903b7;if(_0x1ef7fc){_0x5903b7=squel[_0x5497('0x7b')]()[_0x5497('0x5e')](_0x5497('0x5f'))['fromQuery'](['phone',_0x5497('0x61'),_0x5497('0x62'),_0x5497('0x6c'),_0x5497('0x7c'),_0x5497('0x64'),_0x5497('0x65')],squel[_0x5497('0x7d')]()[_0x5497('0x68')]('ANY_VALUE(calleridnum)','phone')['field'](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x7e'),_0x5497('0x7c'))[_0x5497('0x68')](_0x5497('0x69'),'createdAt')['field']('NOW()','updatedAt')['from'](_0x5497('0x6f'))['where'](_0x5497('0x7f'),_0x4c41c4['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4c41c4[_0x5497('0x47')][_0x5497('0x73')][_0x5497('0x71')]())['where'](_0x5497('0x74'))['where'](_0x5497('0x75'),squel[_0x5497('0x7d')]()[_0x5497('0x68')](_0x5497('0x67'))[_0x5497('0x6e')](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]()))['where'](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x76'))['from'](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x5903b7);}return[];})[_0x5497('0x24')](respondWithResult(_0x1515f1,null))[_0x5497('0x40')](handleError(_0x1515f1,null));};exports['checkContactHopper']=function(_0x37c17e,_0x163b5b,_0x3a31be){return db[_0x5497('0x80')][_0x5497('0x81')]({'where':{'VoiceQueueId':_0x37c17e['body'][_0x5497('0x63')],'CampaignId':_0x37c17e[_0x5497('0x47')]['CampaignId'],'ContactId':_0x37c17e['body'][_0x5497('0x62')]}})[_0x5497('0x24')](handleEntityNotFound(_0x163b5b,null))[_0x5497('0x24')](function(_0x14f693){if(_0x14f693){return _0x14f693;}return null;})[_0x5497('0x24')](respondWithResult(_0x163b5b,null))['catch'](handleError(_0x163b5b,null));}; \ No newline at end of file +var _0x1261=['attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','describe','catch','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','cm_hopper','fromQuery','phone','scheduledAt','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','VoiceQueueId','from','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','ListId','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','checkContactHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','CmHopperFinal','model','map','name','keys','query','intersection'];(function(_0x21924b,_0x11111c){var _0x54689c=function(_0x3537d2){while(--_0x3537d2){_0x21924b['push'](_0x21924b['shift']());}};_0x54689c(++_0x11111c);}(_0x1261,0x144));var _0x1126=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x1261[_0x516927];return _0x30749b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['CmHopperFinal'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['CmHopperFinal']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')]()['then'](respondWithResult(_0x5111d3,null))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports[_0x1126('0x24')]=function(_0x518e0a,_0x3e4eeb){if(_0x518e0a[_0x1126('0x44')][_0x1126('0x45')]){delete _0x518e0a['body'][_0x1126('0x45')];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'uniqueid':_0x518e0a[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x3e4eeb,null))[_0x1126('0x25')](saveUpdates(_0x518e0a[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0x3e4eeb,null))['catch'](handleError(_0x3e4eeb,null));};exports[_0x1126('0x46')]=function(_0x5a2287,_0x40168e,_0x2ad118){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x5a2287[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4a')))),_0x1126('0x4b')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x4e')))),_0x1126('0x4f')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x1126('0x50')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x1126('0x51')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),_0x1126('0x53')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')]['literal'](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x25')](respondWithResult(_0x40168e,null))[_0x1126('0x43')](handleError(_0x40168e,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0xcc1a95,_0x315386,_0x5e0ea1){return db[_0x1126('0x29')]['findAll']({'raw':![],'where':{'CampaignId':_0xcc1a95[_0x1126('0x3f')]['id']},'attributes':[[db[_0x1126('0x47')]['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x1126('0x4b')],[db['sequelize']['fn']('COUNT',db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x56')))),_0x1126('0x57')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x4c')))),_0x1126('0x4d')],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x4e')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x58')))),'dropContacts'],[db[_0x1126('0x47')]['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x59')))),_0x1126('0x51')],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db[_0x1126('0x47')][_0x1126('0x49')](_0x1126('0x52')))),'reCallContacts'],[db['sequelize']['fn'](_0x1126('0x48'),db[_0x1126('0x47')]['fn']('IF',db['sequelize'][_0x1126('0x49')](_0x1126('0x54')))),_0x1126('0x55')]]})[_0x1126('0x25')](handleEntityNotFound(_0x315386,null))[_0x1126('0x25')](respondWithResult(_0x315386,null))[_0x1126('0x43')](handleError(_0x315386,null));};exports[_0x1126('0x5a')]=function(_0x247f12,_0xd20fbe,_0x3d5e15){return db[_0x1126('0x5b')][_0x1126('0x41')]({'where':{'id':_0x247f12[_0x1126('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd20fbe,null))[_0x1126('0x25')](function(_0x274343){var _0x2b61ae;if(_0x274343){_0x2b61ae=squel['insert']()['into'](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),'ContactId','ListId','VoiceQueueId',_0x1126('0x60'),_0x1126('0x61')],squel[_0x1126('0x62')]()[_0x1126('0x63')]('ANY_VALUE(calleridnum)',_0x1126('0x5e'))['field'](_0x1126('0x64'),_0x1126('0x5f'))[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),'ListId')[_0x1126('0x63')]('ANY_VALUE(VoiceQueueId)',_0x1126('0x68'))[_0x1126('0x63')]('NOW()',_0x1126('0x60'))[_0x1126('0x63')]('NOW()',_0x1126('0x61'))[_0x1126('0x69')]('cm_hopper_final')['where'](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())['where']('state\x20=\x20?',_0x247f12['body'][_0x1126('0x6c')]['toString']())['where'](_0x1126('0x6d'))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()['field'](_0x1126('0x5e'))[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12['params']['id'][_0x1126('0x6b')]()))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x6a'),_0x247f12[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')](_0x1126('0x71')))[_0x1126('0x72')](_0x1126('0x66')))[_0x1126('0x6b')]();return db[_0x1126('0x47')][_0x1126('0x2e')](_0x2b61ae);}return[];})['then'](respondWithResult(_0xd20fbe,null))[_0x1126('0x43')](handleError(_0xd20fbe,null));};exports[_0x1126('0x73')]=function(_0x33cccf,_0x1483f4,_0x3be5bf){return db['Campaign'][_0x1126('0x41')]({'where':{'id':_0x33cccf['params']['id']}})['then'](handleEntityNotFound(_0x1483f4,null))[_0x1126('0x25')](function(_0x2b1884){var _0x55f366;if(_0x2b1884){_0x55f366=squel['insert']()[_0x1126('0x74')](_0x1126('0x5c'))[_0x1126('0x5d')]([_0x1126('0x5e'),_0x1126('0x5f'),_0x1126('0x66'),_0x1126('0x75'),_0x1126('0x76'),_0x1126('0x60'),'updatedAt'],squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x77'),_0x1126('0x5e'))[_0x1126('0x63')](_0x1126('0x64'),'scheduledAt')[_0x1126('0x63')](_0x1126('0x65'),_0x1126('0x66'))[_0x1126('0x63')](_0x1126('0x67'),_0x1126('0x75'))[_0x1126('0x63')](_0x1126('0x78'),_0x1126('0x76'))[_0x1126('0x63')]('NOW()','createdAt')[_0x1126('0x63')]('NOW()',_0x1126('0x61'))['from'](_0x1126('0x70'))['where'](_0x1126('0x79'),_0x33cccf['params']['id']['toString']())['where'](_0x1126('0x7a'),_0x33cccf[_0x1126('0x44')]['state']['toString']())[_0x1126('0x37')](_0x1126('0x6d'))[_0x1126('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x1126('0x63')]('phone')[_0x1126('0x69')](_0x1126('0x5c'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id']['toString']()))['where'](_0x1126('0x6e'),squel[_0x1126('0x62')]()[_0x1126('0x63')](_0x1126('0x6f'))[_0x1126('0x69')](_0x1126('0x70'))[_0x1126('0x37')](_0x1126('0x79'),_0x33cccf[_0x1126('0x3f')]['id'][_0x1126('0x6b')]())[_0x1126('0x37')]('state\x20=\x204'))[_0x1126('0x72')]('ContactId'))[_0x1126('0x6b')]();return db['sequelize'][_0x1126('0x2e')](_0x55f366);}return[];})[_0x1126('0x25')](respondWithResult(_0x1483f4,null))[_0x1126('0x43')](handleError(_0x1483f4,null));};exports[_0x1126('0x7b')]=function(_0x59c04b,_0x429183,_0x834360){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x59c04b[_0x1126('0x44')][_0x1126('0x68')],'CampaignId':_0x59c04b[_0x1126('0x44')]['CampaignId'],'ContactId':_0x59c04b[_0x1126('0x44')]['ContactId']}})[_0x1126('0x25')](handleEntityNotFound(_0x429183,null))[_0x1126('0x25')](function(_0x4d6bb2){if(_0x4d6bb2){return _0x4d6bb2;}return null;})[_0x1126('0x25')](respondWithResult(_0x429183,null))[_0x1126('0x43')](handleError(_0x429183,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9c89437..0b40c2d 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 _0xd2ae=['uniqueid','lodash','api','moment','path','../../config/environment','exports','define','calleridnum'];(function(_0x3364c3,_0x3a00c6){var _0x352ff4=function(_0x499b1c){while(--_0x499b1c){_0x3364c3['push'](_0x3364c3['shift']());}};_0x352ff4(++_0x3a00c6);}(_0xd2ae,0x1f0));var _0xed2a=function(_0x544601,_0x5bda3d){_0x544601=_0x544601-0x0;var _0x4e1f79=_0xd2ae[_0x544601];return _0x4e1f79;};'use strict';var _=require(_0xed2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xed2a('0x1'));var moment=require(_0xed2a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xed2a('0x3'));var rimraf=require('rimraf');var config=require(_0xed2a('0x4'));var attributes=require('./cmHopperFinal.attributes');module[_0xed2a('0x5')]=function(_0x47943d,_0x93f31a){return _0x47943d[_0xed2a('0x6')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xed2a('0x7')]},{'name':_0xed2a('0x8'),'fields':[_0xed2a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1726=['bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment'];(function(_0xbb1b4d,_0xa342cd){var _0x466b5a=function(_0x46d4ba){while(--_0x46d4ba){_0xbb1b4d['push'](_0xbb1b4d['shift']());}};_0x466b5a(++_0xa342cd);}(_0x1726,0x1dc));var _0x6172=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0x1726[_0x585ee5];return _0x470808;};'use strict';var _=require(_0x6172('0x0'));var util=require(_0x6172('0x1'));var logger=require('../../config/logger')(_0x6172('0x2'));var moment=require(_0x6172('0x3'));var BPromise=require(_0x6172('0x4'));var rp=require(_0x6172('0x5'));var fs=require('fs');var path=require(_0x6172('0x6'));var rimraf=require('rimraf');var config=require(_0x6172('0x7'));var attributes=require(_0x6172('0x8'));module[_0x6172('0x9')]=function(_0x42da6c,_0x235d34){return _0x42da6c[_0x6172('0xa')](_0x6172('0xb'),attributes,{'tableName':_0x6172('0xc'),'paranoid':![],'indexes':[{'name':_0x6172('0xd'),'fields':[_0x6172('0xd')]},{'name':_0x6172('0xe'),'fields':[_0x6172('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 1eef443..4129faa 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 _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(_0x14ae18,_0x25f0ba){var _0x388f40=function(_0x18e83a){while(--_0x18e83a){_0x14ae18['push'](_0x14ae18['shift']());}};_0x388f40(++_0x25f0ba);}(_0x7a54,0x106));var _0x47a5=function(_0x4eadd1,_0x472475){_0x4eadd1=_0x4eadd1-0x0;var _0x26936c=_0x7a54[_0x4eadd1];return _0x26936c;};'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 +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(_0x857219,_0x385b98){var _0xba109e=function(_0x250ec1){while(--_0x250ec1){_0x857219['push'](_0x857219['shift']());}};_0xba109e(++_0x385b98);}(_0x7a54,0x106));var _0x47a5=function(_0x2a1c64,_0x43e27c){_0x2a1c64=_0x2a1c64-0x0;var _0x382299=_0x7a54[_0x2a1c64];return _0x382299;};'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 72035b0..b291f98 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 _0xdea1=['./cmHopperFinal.controller','isAuthenticated','index','get','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','put','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0xdea1,0x82));var _0x1dea=function(_0x2eff09,_0x4b6bb9){_0x2eff09=_0x2eff09-0x0;var _0x13efa5=_0xdea1[_0x2eff09];return _0x13efa5;};'use strict';var multer=require(_0x1dea('0x0'));var util=require(_0x1dea('0x1'));var path=require(_0x1dea('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1dea('0x3')]();var fs_extra=require(_0x1dea('0x4'));var auth=require(_0x1dea('0x5'));var interaction=require(_0x1dea('0x6'));var config=require(_0x1dea('0x7'));var controller=require(_0x1dea('0x8'));router['get']('/',auth[_0x1dea('0x9')](),controller[_0x1dea('0xa')]);router[_0x1dea('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x1dea('0xc')]);router[_0x1dea('0xb')](_0x1dea('0xd'),auth['isAuthenticated'](),controller[_0x1dea('0xe')]);router[_0x1dea('0xb')](_0x1dea('0xf'),auth[_0x1dea('0x9')](),controller[_0x1dea('0x10')]);router[_0x1dea('0xb')](_0x1dea('0x11'),auth[_0x1dea('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x1dea('0x12')](_0x1dea('0x13'),auth[_0x1dea('0x9')](),controller[_0x1dea('0x14')]);router[_0x1dea('0x12')](_0x1dea('0x15'),auth[_0x1dea('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth[_0x1dea('0x9')](),controller['checkContactHopper']);router[_0x1dea('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x359e=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4730bd,_0x1e9541){var _0x1b2849=function(_0x1fc5a8){while(--_0x1fc5a8){_0x4730bd['push'](_0x4730bd['shift']());}};_0x1b2849(++_0x1e9541);}(_0x359e,0xda));var _0xe359=function(_0x3a8267,_0xc6e696){_0x3a8267=_0x3a8267-0x0;var _0x543101=_0x359e[_0x3a8267];return _0x543101;};'use strict';var multer=require(_0xe359('0x0'));var util=require('util');var path=require(_0xe359('0x1'));var timeout=require(_0xe359('0x2'));var express=require(_0xe359('0x3'));var router=express[_0xe359('0x4')]();var fs_extra=require(_0xe359('0x5'));var auth=require(_0xe359('0x6'));var interaction=require(_0xe359('0x7'));var config=require(_0xe359('0x8'));var controller=require('./cmHopperFinal.controller');router[_0xe359('0x9')]('/',auth['isAuthenticated'](),controller[_0xe359('0xa')]);router[_0xe359('0x9')](_0xe359('0xb'),auth[_0xe359('0xc')](),controller[_0xe359('0xd')]);router[_0xe359('0x9')](_0xe359('0xe'),auth[_0xe359('0xc')](),controller[_0xe359('0xf')]);router[_0xe359('0x9')](_0xe359('0x10'),auth[_0xe359('0xc')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xe359('0x9')](_0xe359('0x11'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xe359('0x12')](_0xe359('0x13'),auth[_0xe359('0xc')](),controller[_0xe359('0x14')]);router[_0xe359('0x12')]('/voice/campaign/moveContacts/:id',auth[_0xe359('0xc')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xe359('0x12')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xe359('0x15')]);router[_0xe359('0x16')]('/:id',auth[_0xe359('0xc')](),controller[_0xe359('0x17')]);module[_0xe359('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 2e3c653..27a3cf5 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 _0xd92a=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x20714a,_0x7de591){var _0x15e877=function(_0x3f9f8d){while(--_0x3f9f8d){_0x20714a['push'](_0x20714a['shift']());}};_0x15e877(++_0x7de591);}(_0xd92a,0x1bc));var _0xad92=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd92a[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');module[_0xad92('0x0')]={'state':{'type':Sequelize[_0xad92('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xad92('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xad92('0x2')]},'originatecalleridname':{'type':Sequelize[_0xad92('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xad92('0x2')]},'starttime':{'type':Sequelize[_0xad92('0x3')]},'responsetime':{'type':Sequelize[_0xad92('0x3')]},'answertime':{'type':Sequelize[_0xad92('0x3')]},'droptime':{'type':Sequelize[_0xad92('0x3')]},'endtime':{'type':Sequelize[_0xad92('0x3')]},'ringtime':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xad92('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xad92('0x2')]},'membername':{'type':Sequelize[_0xad92('0x2')]},'reason':{'type':Sequelize[_0xad92('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xad92('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xad92('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xad92('0x3')]},'recallme':{'type':Sequelize[_0xad92('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xad92('0x3')]},'edited':{'type':Sequelize[_0xad92('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xad92('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xad92('0x2')]}}; \ No newline at end of file +var _0x336e=['BOOLEAN','INTEGER','DATE','STRING'];(function(_0x2fdb4f,_0x50a851){var _0x4fa592=function(_0x37b118){while(--_0x37b118){_0x2fdb4f['push'](_0x2fdb4f['shift']());}};_0x4fa592(++_0x50a851);}(_0x336e,0xad));var _0xe336=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x336e[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xe336('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe336('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe336('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xe336('0x2')]},'originatecalleridname':{'type':Sequelize[_0xe336('0x2')]},'calleridnum':{'type':Sequelize[_0xe336('0x2')]},'calleridname':{'type':Sequelize[_0xe336('0x2')]},'starttime':{'type':Sequelize[_0xe336('0x1')]},'responsetime':{'type':Sequelize[_0xe336('0x1')]},'answertime':{'type':Sequelize[_0xe336('0x1')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe336('0x2')]},'campaign':{'type':Sequelize[_0xe336('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe336('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xe336('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe336('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe336('0x1')]},'recallme':{'type':Sequelize[_0xe336('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe336('0x1')]},'edited':{'type':Sequelize[_0xe336('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe336('0x0')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe336('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 540de65..1cb5998 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 _0xba54=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','CmHopperHistory','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','include','findAll','params','rawAttributes','options','find','create','body','catch','describe','uniqueid','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xba54,0xcb));var _0x4ba5=function(_0x5fe792,_0x2d84b3){_0x5fe792=_0x5fe792-0x0;var _0x40a880=_0xba54[_0x5fe792];return _0x40a880;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4ba5('0x0'));var zipdir=require(_0x4ba5('0x1'));var jsonpatch=require(_0x4ba5('0x2'));var rp=require('request-promise');var moment=require(_0x4ba5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4ba5('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4ba5('0x5'));var csv=require('to-csv');var ejs=require(_0x4ba5('0x6'));var fs=require('fs');var fs_extra=require(_0x4ba5('0x7'));var _=require(_0x4ba5('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ba5('0x9'));var deskjs=require(_0x4ba5('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4ba5('0xb'));var Papa=require(_0x4ba5('0xc'));var Redis=require(_0x4ba5('0xd'));var authService=require(_0x4ba5('0xe'));var qs=require(_0x4ba5('0xf'));var as=require(_0x4ba5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ba5('0x11'))(_0x4ba5('0x12'));var utils=require(_0x4ba5('0x13'));var config=require(_0x4ba5('0x14'));var licenseUtil=require(_0x4ba5('0x15'));var db=require(_0x4ba5('0x16'))['db'];function respondWithStatusCode(_0x5be40b,_0x4c8c77){_0x4c8c77=_0x4c8c77||0xcc;return function(_0x55993c){if(_0x55993c){return _0x5be40b[_0x4ba5('0x17')](_0x4c8c77);}return _0x5be40b[_0x4ba5('0x18')](_0x4c8c77)[_0x4ba5('0x19')]();};}function respondWithResult(_0x25b8fd,_0x5f0b4e){_0x5f0b4e=_0x5f0b4e||0xc8;return function(_0x2f4f98){if(_0x2f4f98){return _0x25b8fd[_0x4ba5('0x18')](_0x5f0b4e)['json'](_0x2f4f98);}};}function respondWithFilteredResult(_0x1fa6c8,_0x1c986d){return function(_0x852aac){if(_0x852aac){var _0x91b7a0=typeof _0x1c986d['offset']===_0x4ba5('0x1a')&&typeof _0x1c986d['limit']===_0x4ba5('0x1a');var _0x30859a=_0x852aac[_0x4ba5('0x1b')];var _0x321c51=_0x91b7a0?0x0:_0x1c986d[_0x4ba5('0x1c')];var _0x4d4cb7=_0x91b7a0?_0x852aac[_0x4ba5('0x1b')]:_0x1c986d[_0x4ba5('0x1c')]+_0x1c986d[_0x4ba5('0x1d')];var _0x5256eb;if(_0x4d4cb7>=_0x30859a){_0x4d4cb7=_0x30859a;_0x5256eb=0xc8;}else{_0x5256eb=0xce;}_0x1fa6c8[_0x4ba5('0x18')](_0x5256eb);return _0x1fa6c8[_0x4ba5('0x1e')](_0x4ba5('0x1f'),_0x321c51+'-'+_0x4d4cb7+'/'+_0x30859a)[_0x4ba5('0x20')](_0x852aac);}return null;};}function patchUpdates(_0x143509){return function(_0x1665f7){try{jsonpatch[_0x4ba5('0x21')](_0x1665f7,_0x143509,!![]);}catch(_0x1e4cf5){return BPromise['reject'](_0x1e4cf5);}return _0x1665f7[_0x4ba5('0x22')]();};}function saveUpdates(_0x3afcbe,_0x2f751c){return function(_0x10d154){if(_0x10d154){return _0x10d154[_0x4ba5('0x23')](_0x3afcbe)[_0x4ba5('0x24')](function(_0x367d46){return _0x367d46;});}return null;};}function removeEntity(_0x43bccf,_0x53ded5){return function(_0x217ebc){if(_0x217ebc){return _0x217ebc[_0x4ba5('0x25')]()['then'](function(){_0x43bccf[_0x4ba5('0x18')](0xcc)[_0x4ba5('0x19')]();});}};}function handleEntityNotFound(_0x2e1f2b,_0x2bdc32){return function(_0x29420f){if(!_0x29420f){_0x2e1f2b[_0x4ba5('0x17')](0x194);}return _0x29420f;};}function handleError(_0x26c98b,_0x4858ac){_0x4858ac=_0x4858ac||0x1f4;return function(_0x4413bb){logger['error'](_0x4413bb[_0x4ba5('0x26')]);if(_0x4413bb[_0x4ba5('0x27')]){delete _0x4413bb[_0x4ba5('0x27')];}_0x26c98b[_0x4ba5('0x18')](_0x4858ac)[_0x4ba5('0x28')](_0x4413bb);};}exports[_0x4ba5('0x29')]=function(_0x43a391,_0x21be3e){var _0x4192b2={},_0x508e1c={},_0x45a689={'count':0x0,'rows':[]};var _0x427d0a=_[_0x4ba5('0x2a')](db[_0x4ba5('0x2b')]['rawAttributes'],function(_0x5700cc){return{'name':_0x5700cc['fieldName'],'type':_0x5700cc['type'][_0x4ba5('0x2c')]};});_0x508e1c[_0x4ba5('0x2d')]=_[_0x4ba5('0x2a')](_0x427d0a,'name');_0x508e1c[_0x4ba5('0x2e')]=_[_0x4ba5('0x2f')](_0x43a391[_0x4ba5('0x2e')]);_0x508e1c[_0x4ba5('0x30')]=_[_0x4ba5('0x31')](_0x508e1c[_0x4ba5('0x2d')],_0x508e1c[_0x4ba5('0x2e')]);_0x4192b2[_0x4ba5('0x32')]=_[_0x4ba5('0x31')](_0x508e1c['model'],qs[_0x4ba5('0x33')](_0x43a391['query']['fields']));_0x4192b2['attributes']=_0x4192b2[_0x4ba5('0x32')][_0x4ba5('0x34')]?_0x4192b2[_0x4ba5('0x32')]:_0x508e1c[_0x4ba5('0x2d')];if(!_0x43a391[_0x4ba5('0x2e')][_0x4ba5('0x35')](_0x4ba5('0x36'))){_0x4192b2[_0x4ba5('0x1d')]=qs[_0x4ba5('0x1d')](_0x43a391[_0x4ba5('0x2e')]['limit']);_0x4192b2[_0x4ba5('0x1c')]=qs['offset'](_0x43a391[_0x4ba5('0x2e')]['offset']);}_0x4192b2['order']=qs[_0x4ba5('0x37')](_0x43a391[_0x4ba5('0x2e')]['sort']);_0x4192b2[_0x4ba5('0x38')]=qs[_0x4ba5('0x30')](_[_0x4ba5('0x39')](_0x43a391[_0x4ba5('0x2e')],_0x508e1c[_0x4ba5('0x30')]),_0x427d0a);if(_0x43a391['query'][_0x4ba5('0x3a')]){_0x4192b2[_0x4ba5('0x38')]=_[_0x4ba5('0x3b')](_0x4192b2['where'],{'$or':_['map'](_0x427d0a,function(_0x508843){if(_0x508843[_0x4ba5('0x3c')]!=='VIRTUAL'){var _0x517f20={};_0x517f20[_0x508843[_0x4ba5('0x27')]]={'$like':'%'+_0x43a391['query'][_0x4ba5('0x3a')]+'%'};return _0x517f20;}})});}_0x4192b2=_[_0x4ba5('0x3b')]({},_0x4192b2,_0x43a391['options']);var _0x1a1576={'where':_0x4192b2[_0x4ba5('0x38')]};return db[_0x4ba5('0x2b')]['count'](_0x1a1576)['then'](function(_0x1ca3f5){_0x45a689['count']=_0x1ca3f5;if(_0x43a391['query']['includeAll']){_0x4192b2[_0x4ba5('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4ba5('0x3e')](_0x4192b2);})[_0x4ba5('0x24')](function(_0x495b61){_0x45a689['rows']=_0x495b61;return _0x45a689;})['then'](respondWithFilteredResult(_0x21be3e,_0x4192b2))['catch'](handleError(_0x21be3e,null));};exports['show']=function(_0x29431c,_0x56deae){var _0x1b7f23={'raw':!![],'where':{'id':_0x29431c[_0x4ba5('0x3f')]['id']}},_0x141a18={};_0x141a18[_0x4ba5('0x2d')]=_[_0x4ba5('0x2f')](db[_0x4ba5('0x2b')][_0x4ba5('0x40')]);_0x141a18[_0x4ba5('0x2e')]=_[_0x4ba5('0x2f')](_0x29431c['query']);_0x141a18['filters']=_[_0x4ba5('0x31')](_0x141a18[_0x4ba5('0x2d')],_0x141a18[_0x4ba5('0x2e')]);_0x1b7f23[_0x4ba5('0x32')]=_[_0x4ba5('0x31')](_0x141a18['model'],qs[_0x4ba5('0x33')](_0x29431c[_0x4ba5('0x2e')][_0x4ba5('0x33')]));_0x1b7f23['attributes']=_0x1b7f23[_0x4ba5('0x32')][_0x4ba5('0x34')]?_0x1b7f23['attributes']:_0x141a18[_0x4ba5('0x2d')];if(_0x29431c[_0x4ba5('0x2e')]['includeAll']){_0x1b7f23[_0x4ba5('0x3d')]=[{'all':!![]}];}_0x1b7f23=_[_0x4ba5('0x3b')]({},_0x1b7f23,_0x29431c[_0x4ba5('0x41')]);return db[_0x4ba5('0x2b')][_0x4ba5('0x42')](_0x1b7f23)[_0x4ba5('0x24')](handleEntityNotFound(_0x56deae,null))['then'](respondWithResult(_0x56deae,null))['catch'](handleError(_0x56deae,null));};exports[_0x4ba5('0x43')]=function(_0x33111c,_0x1c7d7d){return db['CmHopperHistory'][_0x4ba5('0x43')](_0x33111c[_0x4ba5('0x44')],{})[_0x4ba5('0x24')](respondWithResult(_0x1c7d7d,0xc9))[_0x4ba5('0x45')](handleError(_0x1c7d7d,null));};exports['describe']=function(_0x17731d,_0x313745){return db[_0x4ba5('0x2b')][_0x4ba5('0x46')]()[_0x4ba5('0x24')](respondWithResult(_0x313745,null))['catch'](handleError(_0x313745,null));};exports[_0x4ba5('0x23')]=function(_0x5c0fab,_0x5117b4){if(_0x5c0fab[_0x4ba5('0x44')]['uniqueid']){delete _0x5c0fab[_0x4ba5('0x44')][_0x4ba5('0x47')];}return db['CmHopperHistory'][_0x4ba5('0x42')]({'where':{'uniqueid':_0x5c0fab[_0x4ba5('0x3f')]['id']}})[_0x4ba5('0x24')](handleEntityNotFound(_0x5117b4,null))[_0x4ba5('0x24')](saveUpdates(_0x5c0fab[_0x4ba5('0x44')],null))[_0x4ba5('0x24')](respondWithResult(_0x5117b4,null))[_0x4ba5('0x45')](handleError(_0x5117b4,null));}; \ No newline at end of file +var _0x8ba3=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x106f3e,_0x3b1c9b){var _0x1f8ac8=function(_0x688c98){while(--_0x688c98){_0x106f3e['push'](_0x106f3e['shift']());}};_0x1f8ac8(++_0x3b1c9b);}(_0x8ba3,0xb7));var _0x38ba=function(_0x6bab02,_0x383b22){_0x6bab02=_0x6bab02-0x0;var _0x169670=_0x8ba3[_0x6bab02];return _0x169670;};'use strict';var emlformat=require(_0x38ba('0x0'));var rimraf=require(_0x38ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ba('0x2'));var rp=require(_0x38ba('0x3'));var moment=require('moment');var BPromise=require(_0x38ba('0x4'));var Mustache=require(_0x38ba('0x5'));var util=require(_0x38ba('0x6'));var path=require('path');var sox=require(_0x38ba('0x7'));var csv=require(_0x38ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x38ba('0x9'));var _=require('lodash');var squel=require(_0x38ba('0xa'));var crypto=require(_0x38ba('0xb'));var jsforce=require(_0x38ba('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x38ba('0xd'));var Papa=require('papaparse');var Redis=require(_0x38ba('0xe'));var authService=require(_0x38ba('0xf'));var qs=require(_0x38ba('0x10'));var as=require(_0x38ba('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x38ba('0x12'));var utils=require(_0x38ba('0x13'));var config=require(_0x38ba('0x14'));var licenseUtil=require(_0x38ba('0x15'));var db=require(_0x38ba('0x16'))['db'];function respondWithStatusCode(_0x14cd1d,_0x57bf99){_0x57bf99=_0x57bf99||0xcc;return function(_0x10c542){if(_0x10c542){return _0x14cd1d[_0x38ba('0x17')](_0x57bf99);}return _0x14cd1d[_0x38ba('0x18')](_0x57bf99)[_0x38ba('0x19')]();};}function respondWithResult(_0x5398f6,_0x1ca8c9){_0x1ca8c9=_0x1ca8c9||0xc8;return function(_0x4ae25c){if(_0x4ae25c){return _0x5398f6['status'](_0x1ca8c9)[_0x38ba('0x1a')](_0x4ae25c);}};}function respondWithFilteredResult(_0x26100a,_0x4b2eb1){return function(_0x4f9788){if(_0x4f9788){var _0x3d95eb=typeof _0x4b2eb1[_0x38ba('0x1b')]===_0x38ba('0x1c')&&typeof _0x4b2eb1[_0x38ba('0x1d')]===_0x38ba('0x1c');var _0x66f997=_0x4f9788[_0x38ba('0x1e')];var _0x6f4363=_0x3d95eb?0x0:_0x4b2eb1['offset'];var _0x323e8b=_0x3d95eb?_0x4f9788[_0x38ba('0x1e')]:_0x4b2eb1[_0x38ba('0x1b')]+_0x4b2eb1['limit'];var _0x1a8015;if(_0x323e8b>=_0x66f997){_0x323e8b=_0x66f997;_0x1a8015=0xc8;}else{_0x1a8015=0xce;}_0x26100a[_0x38ba('0x18')](_0x1a8015);return _0x26100a[_0x38ba('0x1f')](_0x38ba('0x20'),_0x6f4363+'-'+_0x323e8b+'/'+_0x66f997)[_0x38ba('0x1a')](_0x4f9788);}return null;};}function patchUpdates(_0x1d5862){return function(_0x4f75f7){try{jsonpatch[_0x38ba('0x21')](_0x4f75f7,_0x1d5862,!![]);}catch(_0x5c0477){return BPromise[_0x38ba('0x22')](_0x5c0477);}return _0x4f75f7[_0x38ba('0x23')]();};}function saveUpdates(_0x3a7b3b,_0x2c769f){return function(_0xace22){if(_0xace22){return _0xace22[_0x38ba('0x24')](_0x3a7b3b)[_0x38ba('0x25')](function(_0x50a97b){return _0x50a97b;});}return null;};}function removeEntity(_0x2fbc8a,_0x1f5e90){return function(_0x3946e8){if(_0x3946e8){return _0x3946e8['destroy']()[_0x38ba('0x25')](function(){_0x2fbc8a[_0x38ba('0x18')](0xcc)[_0x38ba('0x19')]();});}};}function handleEntityNotFound(_0x46e208,_0x56b3e9){return function(_0x51b7cc){if(!_0x51b7cc){_0x46e208[_0x38ba('0x17')](0x194);}return _0x51b7cc;};}function handleError(_0x36cccd,_0x4ba3d6){_0x4ba3d6=_0x4ba3d6||0x1f4;return function(_0x24e187){logger[_0x38ba('0x26')](_0x24e187[_0x38ba('0x27')]);if(_0x24e187['name']){delete _0x24e187[_0x38ba('0x28')];}_0x36cccd[_0x38ba('0x18')](_0x4ba3d6)[_0x38ba('0x29')](_0x24e187);};}exports[_0x38ba('0x2a')]=function(_0x46f8a2,_0x52f9d3){var _0x3fa493={},_0xc3eba4={},_0x25de14={'count':0x0,'rows':[]};var _0x15dea0=_[_0x38ba('0x2b')](db['CmHopperHistory'][_0x38ba('0x2c')],function(_0x23903c){return{'name':_0x23903c[_0x38ba('0x2d')],'type':_0x23903c[_0x38ba('0x2e')][_0x38ba('0x2f')]};});_0xc3eba4[_0x38ba('0x30')]=_['map'](_0x15dea0,_0x38ba('0x28'));_0xc3eba4['query']=_[_0x38ba('0x31')](_0x46f8a2['query']);_0xc3eba4['filters']=_[_0x38ba('0x32')](_0xc3eba4['model'],_0xc3eba4[_0x38ba('0x33')]);_0x3fa493[_0x38ba('0x34')]=_[_0x38ba('0x32')](_0xc3eba4[_0x38ba('0x30')],qs[_0x38ba('0x35')](_0x46f8a2[_0x38ba('0x33')][_0x38ba('0x35')]));_0x3fa493[_0x38ba('0x34')]=_0x3fa493[_0x38ba('0x34')][_0x38ba('0x36')]?_0x3fa493[_0x38ba('0x34')]:_0xc3eba4[_0x38ba('0x30')];if(!_0x46f8a2[_0x38ba('0x33')][_0x38ba('0x37')]('nolimit')){_0x3fa493['limit']=qs[_0x38ba('0x1d')](_0x46f8a2[_0x38ba('0x33')][_0x38ba('0x1d')]);_0x3fa493[_0x38ba('0x1b')]=qs[_0x38ba('0x1b')](_0x46f8a2['query']['offset']);}_0x3fa493[_0x38ba('0x38')]=qs[_0x38ba('0x39')](_0x46f8a2[_0x38ba('0x33')][_0x38ba('0x39')]);_0x3fa493[_0x38ba('0x3a')]=qs[_0x38ba('0x3b')](_[_0x38ba('0x3c')](_0x46f8a2[_0x38ba('0x33')],_0xc3eba4[_0x38ba('0x3b')]),_0x15dea0);if(_0x46f8a2[_0x38ba('0x33')][_0x38ba('0x3d')]){_0x3fa493[_0x38ba('0x3a')]=_['merge'](_0x3fa493[_0x38ba('0x3a')],{'$or':_[_0x38ba('0x2b')](_0x15dea0,function(_0x3ba59f){if(_0x3ba59f[_0x38ba('0x2e')]!==_0x38ba('0x3e')){var _0x148595={};_0x148595[_0x3ba59f['name']]={'$like':'%'+_0x46f8a2[_0x38ba('0x33')][_0x38ba('0x3d')]+'%'};return _0x148595;}})});}_0x3fa493=_['merge']({},_0x3fa493,_0x46f8a2[_0x38ba('0x3f')]);var _0x36bfce={'where':_0x3fa493[_0x38ba('0x3a')]};return db[_0x38ba('0x40')]['count'](_0x36bfce)[_0x38ba('0x25')](function(_0x374965){_0x25de14[_0x38ba('0x1e')]=_0x374965;if(_0x46f8a2[_0x38ba('0x33')][_0x38ba('0x41')]){_0x3fa493[_0x38ba('0x42')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x38ba('0x43')](_0x3fa493);})['then'](function(_0x567dcb){_0x25de14['rows']=_0x567dcb;return _0x25de14;})[_0x38ba('0x25')](respondWithFilteredResult(_0x52f9d3,_0x3fa493))[_0x38ba('0x44')](handleError(_0x52f9d3,null));};exports[_0x38ba('0x45')]=function(_0x4a512b,_0x30b63a){var _0x4b583d={'raw':!![],'where':{'id':_0x4a512b[_0x38ba('0x46')]['id']}},_0x4c20dd={};_0x4c20dd['model']=_[_0x38ba('0x31')](db[_0x38ba('0x40')][_0x38ba('0x2c')]);_0x4c20dd[_0x38ba('0x33')]=_[_0x38ba('0x31')](_0x4a512b['query']);_0x4c20dd[_0x38ba('0x3b')]=_[_0x38ba('0x32')](_0x4c20dd[_0x38ba('0x30')],_0x4c20dd[_0x38ba('0x33')]);_0x4b583d[_0x38ba('0x34')]=_[_0x38ba('0x32')](_0x4c20dd['model'],qs[_0x38ba('0x35')](_0x4a512b[_0x38ba('0x33')]['fields']));_0x4b583d['attributes']=_0x4b583d[_0x38ba('0x34')][_0x38ba('0x36')]?_0x4b583d[_0x38ba('0x34')]:_0x4c20dd[_0x38ba('0x30')];if(_0x4a512b[_0x38ba('0x33')][_0x38ba('0x41')]){_0x4b583d[_0x38ba('0x42')]=[{'all':!![]}];}_0x4b583d=_['merge']({},_0x4b583d,_0x4a512b[_0x38ba('0x3f')]);return db['CmHopperHistory'][_0x38ba('0x47')](_0x4b583d)['then'](handleEntityNotFound(_0x30b63a,null))[_0x38ba('0x25')](respondWithResult(_0x30b63a,null))['catch'](handleError(_0x30b63a,null));};exports['create']=function(_0x5c8c14,_0x3fcae9){return db['CmHopperHistory']['create'](_0x5c8c14[_0x38ba('0x48')],{})[_0x38ba('0x25')](respondWithResult(_0x3fcae9,0xc9))[_0x38ba('0x44')](handleError(_0x3fcae9,null));};exports[_0x38ba('0x49')]=function(_0x21d9f7,_0x5644b9){return db['CmHopperHistory'][_0x38ba('0x49')]()['then'](respondWithResult(_0x5644b9,null))[_0x38ba('0x44')](handleError(_0x5644b9,null));};exports['update']=function(_0x503ee2,_0x1085c7){if(_0x503ee2['body']['uniqueid']){delete _0x503ee2[_0x38ba('0x48')]['uniqueid'];}return db[_0x38ba('0x40')][_0x38ba('0x47')]({'where':{'uniqueid':_0x503ee2[_0x38ba('0x46')]['id']}})[_0x38ba('0x25')](handleEntityNotFound(_0x1085c7,null))[_0x38ba('0x25')](saveUpdates(_0x503ee2[_0x38ba('0x48')],null))['then'](respondWithResult(_0x1085c7,null))['catch'](handleError(_0x1085c7,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 7b869c8..5a2c331 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 _0xb458=['define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes'];(function(_0x4f502e,_0x47f025){var _0x40d608=function(_0x59bcb6){while(--_0x59bcb6){_0x4f502e['push'](_0x4f502e['shift']());}};_0x40d608(++_0x47f025);}(_0xb458,0x94));var _0x8b45=function(_0x3ae4cc,_0x1cd059){_0x3ae4cc=_0x3ae4cc-0x0;var _0x102b82=_0xb458[_0x3ae4cc];return _0x102b82;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b45('0x4'));var rimraf=require(_0x8b45('0x5'));var config=require(_0x8b45('0x6'));var attributes=require(_0x8b45('0x7'));module['exports']=function(_0xfe8757,_0xd23b88){return _0xfe8757[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x8b45('0xb'),'fields':[_0x8b45('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa456=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa456,0x142));var _0x6a45=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa456[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));module[_0x6a45('0x9')]=function(_0x14da6b,_0x4dfbfa){return _0x14da6b[_0x6a45('0xa')](_0x6a45('0xb'),attributes,{'tableName':_0x6a45('0xc'),'paranoid':![],'indexes':[{'name':_0x6a45('0xd'),'fields':[_0x6a45('0xd')]},{'name':'uniqueid','fields':[_0x6a45('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 20da369..ee99d1c 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 _0xe3c9=['then','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','CmHopperHistory','options','raw','CreateCmHopperHistory','debug','AvgHandleTime','findAll','where','COUNT','sequelize','col','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime'];(function(_0x5aadac,_0x15dd83){var _0x3c7e21=function(_0x20a135){while(--_0x20a135){_0x5aadac['push'](_0x5aadac['shift']());}};_0x3c7e21(++_0x15dd83);}(_0xe3c9,0x1ad));var _0x9e3c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe3c9[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require(_0x9e3c('0x0'));var moment=require('moment');var BPromise=require(_0x9e3c('0x1'));var rs=require(_0x9e3c('0x2'));var fs=require('fs');var Redis=require(_0x9e3c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e3c('0x4'));var logger=require(_0x9e3c('0x5'))(_0x9e3c('0x6'));var config=require(_0x9e3c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9e3c('0x8')][_0x9e3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5347cb,_0x1437a0,_0x335e99){return new BPromise(function(_0x59a631,_0x3cc670){return client[_0x9e3c('0xa')](_0x5347cb,_0x335e99)['then'](function(_0x1bd026){logger[_0x9e3c('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x1437a0,_0x9e3c('0xc'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1437a0,_0x9e3c('0xc'),JSON[_0x9e3c('0xd')](_0x1bd026));if(_0x1bd026['error']){if(_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0xf')]===0x1f4){logger[_0x9e3c('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1437a0,_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);return _0x3cc670(_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x1437a0,_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);return _0x59a631(_0x1bd026[_0x9e3c('0xe')][_0x9e3c('0x10')]);}else{logger[_0x9e3c('0xb')](_0x9e3c('0x11'),_0x1437a0,'request\x20sent');_0x59a631(_0x1bd026[_0x9e3c('0x12')][_0x9e3c('0x10')]);}})['catch'](function(_0x55bcad){logger['error'](_0x9e3c('0x11'),_0x1437a0,_0x55bcad);_0x3cc670(_0x55bcad);});});}exports['CreateCmHopperHistory']=function(_0x2943fe){var _0x47da45=this;return new Promise(function(_0x3ac32b,_0x488a47){return db[_0x9e3c('0x13')]['create'](_0x2943fe['body'],{'raw':_0x2943fe[_0x9e3c('0x14')]?_0x2943fe[_0x9e3c('0x14')][_0x9e3c('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x433711){logger[_0x9e3c('0xb')](_0x9e3c('0x16'),_0x2943fe);logger[_0x9e3c('0x17')](_0x9e3c('0x16'),_0x2943fe,JSON[_0x9e3c('0xd')](_0x433711));_0x3ac32b(_0x433711);})['catch'](function(_0x2ad1b){logger[_0x9e3c('0xe')]('CreateCmHopperHistory',_0x2ad1b[_0x9e3c('0x10')],_0x2943fe);_0x488a47(_0x47da45[_0x9e3c('0xe')](0x1f4,_0x2ad1b[_0x9e3c('0x10')]));});});};exports[_0x9e3c('0x18')]=function(_0x134bfd){var _0x38499a=this;return new Promise(function(_0x3a6c45,_0x1035e0){return db[_0x9e3c('0x13')][_0x9e3c('0x19')]({'raw':_0x134bfd[_0x9e3c('0x14')]?_0x134bfd[_0x9e3c('0x14')][_0x9e3c('0x15')]===undefined?!![]:![]:!![],'where':_0x134bfd[_0x9e3c('0x14')]?_0x134bfd[_0x9e3c('0x14')][_0x9e3c('0x1a')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')][_0x9e3c('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')]['literal'](_0x9e3c('0x1e')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x20')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x9e3c('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x21')))),_0x9e3c('0x22')],[db[_0x9e3c('0x1c')]['fn']('AVG',db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x23')))),_0x9e3c('0x24')],[db['sequelize']['fn'](_0x9e3c('0x25'),db[_0x9e3c('0x1c')]['fn']('IF',db['sequelize'][_0x9e3c('0x1f')](_0x9e3c('0x26')))),_0x9e3c('0x27')]]})[_0x9e3c('0x28')](function(_0x3821c0){logger[_0x9e3c('0xb')]('AvgHandleTime',_0x134bfd);logger[_0x9e3c('0x17')]('AvgHandleTime',_0x134bfd,JSON['stringify'](_0x3821c0));_0x3a6c45(_0x3821c0);})[_0x9e3c('0x29')](function(_0xa1b62e){logger[_0x9e3c('0xe')]('AvgHandleTime',_0xa1b62e[_0x9e3c('0x10')],_0x134bfd);_0x1035e0(_0x38499a[_0x9e3c('0xe')](0x1f4,_0xa1b62e['message']));});});};exports[_0x9e3c('0x2a')]=function(_0x452e7e){var _0x1f908f=this;return new Promise(function(_0x18c6ce,_0x147ef0){return db[_0x9e3c('0x13')]['findAll']({'raw':_0x452e7e[_0x9e3c('0x14')]?_0x452e7e[_0x9e3c('0x14')][_0x9e3c('0x15')]===undefined?!![]:![]:!![],'where':_0x452e7e['options']?_0x452e7e[_0x9e3c('0x14')][_0x9e3c('0x1a')]||null:null,'attributes':[[_0x9e3c('0x2b'),_0x9e3c('0x2c')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x2d')))),_0x9e3c('0x2e')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x2f')))),_0x9e3c('0x30')],[db['sequelize']['fn']('COUNT',db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x1e')))),'outboundAnswerCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x31')))),_0x9e3c('0x32')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x33')))),'outboundCongestionCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9e3c('0x34')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db['sequelize'][_0x9e3c('0x1f')](_0x9e3c('0x35')))),_0x9e3c('0x36')],[db[_0x9e3c('0x1c')]['fn']('COUNT',db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x37')))),'outboundUnknownCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x38')))),'outboundBlacklistCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x39')))),'outboundOriginateFailureCallsDay'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')]['literal'](_0x9e3c('0x3a')))),_0x9e3c('0x3b')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x3c')))),_0x9e3c('0x3d')],[db[_0x9e3c('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9e3c('0x1c')][_0x9e3c('0x1f')](_0x9e3c('0x3e')))),_0x9e3c('0x3b')],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db[_0x9e3c('0x1c')]['fn']('IF',db['sequelize'][_0x9e3c('0x1f')](_0x9e3c('0x3f')))),_0x9e3c('0x40')]],'group':[_0x9e3c('0x2b')]})['then'](function(_0x540879){logger[_0x9e3c('0xb')](_0x9e3c('0x2a'),_0x452e7e);logger[_0x9e3c('0x17')](_0x9e3c('0x2a'),_0x452e7e,JSON[_0x9e3c('0xd')](_0x540879));_0x18c6ce(_0x540879);})['catch'](function(_0x169f1c){logger[_0x9e3c('0xe')]('GetVoiceQueueHopperHistory',_0x169f1c[_0x9e3c('0x10')],_0x452e7e);_0x147ef0(_0x1f908f[_0x9e3c('0xe')](0x1f4,_0x169f1c[_0x9e3c('0x10')]));});});};exports[_0x9e3c('0x41')]=function(_0xf1efa3){var _0x32cf83=this;return new Promise(function(_0x3dbc4c,_0x4a69cd){return db['CmHopperHistory'][_0x9e3c('0x19')]({'raw':_0xf1efa3[_0x9e3c('0x14')]?_0xf1efa3['options']['raw']===undefined?!![]:![]:!![],'where':_0xf1efa3[_0x9e3c('0x14')]?_0xf1efa3[_0x9e3c('0x14')][_0x9e3c('0x1a')]||null:null,'attributes':[['campaign',_0x9e3c('0x2c')],[db[_0x9e3c('0x1c')]['fn']('COUNT',db[_0x9e3c('0x1c')][_0x9e3c('0x1d')]('id')),'ivrTotalCallsDays'],[db[_0x9e3c('0x1c')]['fn'](_0x9e3c('0x1b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9e3c('0x1e')))),_0x9e3c('0x42')]],'group':[_0x9e3c('0x2b')]})['then'](function(_0x17ee6d){logger['info'](_0x9e3c('0x41'),_0xf1efa3);logger[_0x9e3c('0x17')]('GetCampaignHopperHistory',_0xf1efa3,JSON[_0x9e3c('0xd')](_0x17ee6d));_0x3dbc4c(_0x17ee6d);})['catch'](function(_0x1cd7c5){logger['error']('GetCampaignHopperHistory',_0x1cd7c5[_0x9e3c('0x10')],_0xf1efa3);_0x4a69cd(_0x32cf83[_0x9e3c('0xe')](0x1f4,_0x1cd7c5[_0x9e3c('0x10')]));});});}; \ No newline at end of file +var _0x5bc5=['`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','raw','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateCmHopperHistory','create','options','catch','CmHopperHistory','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x5bc5,0xb2));var _0x55bc=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x5bc5[_0x3cba93];return _0x4a2991;};'use strict';var _=require(_0x55bc('0x0'));var util=require(_0x55bc('0x1'));var moment=require(_0x55bc('0x2'));var BPromise=require(_0x55bc('0x3'));var rs=require(_0x55bc('0x4'));var fs=require('fs');var Redis=require(_0x55bc('0x5'));var db=require(_0x55bc('0x6'))['db'];var utils=require(_0x55bc('0x7'));var logger=require(_0x55bc('0x8'))(_0x55bc('0x9'));var config=require(_0x55bc('0xa'));var jayson=require(_0x55bc('0xb'));var client=jayson[_0x55bc('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d78d6,_0x5719c9,_0x2a612b){return new BPromise(function(_0x38839e,_0x4d0610){return client[_0x55bc('0xd')](_0x4d78d6,_0x2a612b)[_0x55bc('0xe')](function(_0xc535ac){logger[_0x55bc('0xf')](_0x55bc('0x10'),_0x5719c9,_0x55bc('0x11'));logger[_0x55bc('0x12')](_0x55bc('0x13'),_0x5719c9,'request\x20sent',JSON[_0x55bc('0x14')](_0xc535ac));if(_0xc535ac[_0x55bc('0x15')]){if(_0xc535ac[_0x55bc('0x15')]['code']===0x1f4){logger[_0x55bc('0x15')]('CmHopperHistory,\x20%s,\x20%s',_0x5719c9,_0xc535ac[_0x55bc('0x15')][_0x55bc('0x16')]);return _0x4d0610(_0xc535ac[_0x55bc('0x15')]['message']);}logger[_0x55bc('0x15')]('CmHopperHistory,\x20%s,\x20%s',_0x5719c9,_0xc535ac[_0x55bc('0x15')][_0x55bc('0x16')]);return _0x38839e(_0xc535ac[_0x55bc('0x15')]['message']);}else{logger[_0x55bc('0xf')](_0x55bc('0x10'),_0x5719c9,'request\x20sent');_0x38839e(_0xc535ac['result'][_0x55bc('0x16')]);}})['catch'](function(_0x482eea){logger[_0x55bc('0x15')](_0x55bc('0x10'),_0x5719c9,_0x482eea);_0x4d0610(_0x482eea);});});}exports[_0x55bc('0x17')]=function(_0x4e1764){var _0xed8b9e=this;return new Promise(function(_0x10f68f,_0x247abd){return db['CmHopperHistory'][_0x55bc('0x18')](_0x4e1764['body'],{'raw':_0x4e1764[_0x55bc('0x19')]?_0x4e1764['options']['raw']===undefined?!![]:![]:!![]})[_0x55bc('0xe')](function(_0x390af6){logger[_0x55bc('0xf')]('CreateCmHopperHistory',_0x4e1764);logger['debug']('CreateCmHopperHistory',_0x4e1764,JSON[_0x55bc('0x14')](_0x390af6));_0x10f68f(_0x390af6);})[_0x55bc('0x1a')](function(_0x4da0b8){logger['error'](_0x55bc('0x17'),_0x4da0b8[_0x55bc('0x16')],_0x4e1764);_0x247abd(_0xed8b9e[_0x55bc('0x15')](0x1f4,_0x4da0b8[_0x55bc('0x16')]));});});};exports['AvgHandleTime']=function(_0x21a3be){var _0x4f65cd=this;return new Promise(function(_0x540d89,_0x3e6254){return db[_0x55bc('0x1b')][_0x55bc('0x1c')]({'raw':_0x21a3be[_0x55bc('0x19')]?_0x21a3be[_0x55bc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x21a3be[_0x55bc('0x19')]?_0x21a3be[_0x55bc('0x19')][_0x55bc('0x1d')]||null:null,'attributes':[[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['col']('id')),_0x55bc('0x20')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x22')))),_0x55bc('0x23')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')]['literal'](_0x55bc('0x24')))),_0x55bc('0x25')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db['sequelize'][_0x55bc('0x21')](_0x55bc('0x26')))),_0x55bc('0x27')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x28'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x28'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x2a')))),_0x55bc('0x2b')]]})['then'](function(_0x29976c){logger[_0x55bc('0xf')]('AvgHandleTime',_0x21a3be);logger[_0x55bc('0x12')](_0x55bc('0x2c'),_0x21a3be,JSON[_0x55bc('0x14')](_0x29976c));_0x540d89(_0x29976c);})[_0x55bc('0x1a')](function(_0x22e333){logger['error']('AvgHandleTime',_0x22e333[_0x55bc('0x16')],_0x21a3be);_0x3e6254(_0x4f65cd[_0x55bc('0x15')](0x1f4,_0x22e333[_0x55bc('0x16')]));});});};exports[_0x55bc('0x2d')]=function(_0xc034d9){var _0x3320db=this;return new Promise(function(_0x42977b,_0x38d0f9){return db['CmHopperHistory'][_0x55bc('0x1c')]({'raw':_0xc034d9[_0x55bc('0x19')]?_0xc034d9[_0x55bc('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xc034d9['options']?_0xc034d9[_0x55bc('0x19')][_0x55bc('0x1d')]||null:null,'attributes':[[_0x55bc('0x2e'),_0x55bc('0x2f')],[db['sequelize']['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x30')))),_0x55bc('0x31')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db['sequelize']['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x32')))),_0x55bc('0x33')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')]['literal'](_0x55bc('0x22')))),_0x55bc('0x34')],[db['sequelize']['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x35')))),_0x55bc('0x36')],[db[_0x55bc('0x1e')]['fn']('COUNT',db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')]('`state`\x20=\x208,\x201,\x20null'))),_0x55bc('0x37')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db['sequelize'][_0x55bc('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0x55bc('0x1e')]['fn']('COUNT',db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x38')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0x55bc('0x39')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db['sequelize'][_0x55bc('0x21')](_0x55bc('0x3a')))),_0x55bc('0x3b')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db['sequelize']['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x3c')))),_0x55bc('0x3d')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db['sequelize'][_0x55bc('0x21')](_0x55bc('0x3e')))),_0x55bc('0x3f')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')][_0x55bc('0x21')](_0x55bc('0x40')))),_0x55bc('0x41')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db[_0x55bc('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x55bc('0x3f')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db['sequelize']['fn']('IF',db[_0x55bc('0x1e')]['literal'](_0x55bc('0x42')))),'outboundReCallsDay']],'group':[_0x55bc('0x2e')]})['then'](function(_0x1ba9f3){logger[_0x55bc('0xf')](_0x55bc('0x2d'),_0xc034d9);logger['debug'](_0x55bc('0x2d'),_0xc034d9,JSON[_0x55bc('0x14')](_0x1ba9f3));_0x42977b(_0x1ba9f3);})[_0x55bc('0x1a')](function(_0x38c402){logger[_0x55bc('0x15')]('GetVoiceQueueHopperHistory',_0x38c402[_0x55bc('0x16')],_0xc034d9);_0x38d0f9(_0x3320db['error'](0x1f4,_0x38c402[_0x55bc('0x16')]));});});};exports[_0x55bc('0x43')]=function(_0x2d6f82){var _0x21cc1c=this;return new Promise(function(_0x44edf0,_0x137887){return db[_0x55bc('0x1b')][_0x55bc('0x1c')]({'raw':_0x2d6f82[_0x55bc('0x19')]?_0x2d6f82[_0x55bc('0x19')][_0x55bc('0x44')]===undefined?!![]:![]:!![],'where':_0x2d6f82[_0x55bc('0x19')]?_0x2d6f82[_0x55bc('0x19')][_0x55bc('0x1d')]||null:null,'attributes':[[_0x55bc('0x2e'),'name'],[db[_0x55bc('0x1e')]['fn']('COUNT',db[_0x55bc('0x1e')][_0x55bc('0x45')]('id')),_0x55bc('0x46')],[db[_0x55bc('0x1e')]['fn'](_0x55bc('0x1f'),db[_0x55bc('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x55bc('0x22')))),_0x55bc('0x47')]],'group':[_0x55bc('0x2e')]})['then'](function(_0x266b11){logger[_0x55bc('0xf')]('GetCampaignHopperHistory',_0x2d6f82);logger[_0x55bc('0x12')](_0x55bc('0x43'),_0x2d6f82,JSON['stringify'](_0x266b11));_0x44edf0(_0x266b11);})[_0x55bc('0x1a')](function(_0x1b481a){logger[_0x55bc('0x15')]('GetCampaignHopperHistory',_0x1b481a[_0x55bc('0x16')],_0x2d6f82);_0x137887(_0x21cc1c[_0x55bc('0x15')](0x1f4,_0x1b481a[_0x55bc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f4fb259..508d4e5 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 _0x76df=['get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x25e415,_0x3276ed){var _0x1c37dc=function(_0x2f2381){while(--_0x2f2381){_0x25e415['push'](_0x25e415['shift']());}};_0x1c37dc(++_0x3276ed);}(_0x76df,0x8a));var _0xf76d=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x76df[_0x2e914];return _0x936e45;};'use strict';var multer=require(_0xf76d('0x0'));var util=require('util');var path=require(_0xf76d('0x1'));var timeout=require(_0xf76d('0x2'));var express=require('express');var router=express[_0xf76d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf76d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf76d('0x5'));var controller=require('./cmHopperHistory.controller');router[_0xf76d('0x6')]('/',auth[_0xf76d('0x7')](),controller[_0xf76d('0x8')]);router[_0xf76d('0x6')](_0xf76d('0x9'),auth[_0xf76d('0x7')](),controller['describe']);router['get'](_0xf76d('0xa'),auth['isAuthenticated'](),controller[_0xf76d('0xb')]);router['post']('/',auth[_0xf76d('0x7')](),controller[_0xf76d('0xc')]);router[_0xf76d('0xd')](_0xf76d('0xa'),auth['isAuthenticated'](),controller[_0xf76d('0xe')]);module[_0xf76d('0xf')]=router; \ No newline at end of file +var _0x55ce=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get'];(function(_0x9dd37c,_0x3e255e){var _0x2a522c=function(_0x2ce2ca){while(--_0x2ce2ca){_0x9dd37c['push'](_0x9dd37c['shift']());}};_0x2a522c(++_0x3e255e);}(_0x55ce,0x13b));var _0xe55c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x55ce[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xe55c('0x0'));var util=require(_0xe55c('0x1'));var path=require(_0xe55c('0x2'));var timeout=require(_0xe55c('0x3'));var express=require(_0xe55c('0x4'));var router=express[_0xe55c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe55c('0x6'));var controller=require('./cmHopperHistory.controller');router[_0xe55c('0x7')]('/',auth[_0xe55c('0x8')](),controller[_0xe55c('0x9')]);router[_0xe55c('0x7')](_0xe55c('0xa'),auth[_0xe55c('0x8')](),controller[_0xe55c('0xb')]);router['get']('/:id',auth[_0xe55c('0x8')](),controller[_0xe55c('0xc')]);router[_0xe55c('0xd')]('/',auth[_0xe55c('0x8')](),controller[_0xe55c('0xe')]);router[_0xe55c('0xf')](_0xe55c('0x10'),auth[_0xe55c('0x8')](),controller[_0xe55c('0x11')]);module[_0xe55c('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 38bbc51..3cbefd6 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 _0x33c5=['exports','STRING'];(function(_0x25193d,_0x59611e){var _0x3d08f9=function(_0x502e65){while(--_0x502e65){_0x25193d['push'](_0x25193d['shift']());}};_0x3d08f9(++_0x59611e);}(_0x33c5,0xe6));var _0x533c=function(_0x26425a,_0x1b4d6f){_0x26425a=_0x26425a-0x0;var _0x12802a=_0x33c5[_0x26425a];return _0x12802a;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x533c('0x1')]},'dialPrefix':{'type':Sequelize[_0x533c('0x1')]}}; \ No newline at end of file +var _0xeb5d=['exports','STRING','name'];(function(_0x15d1d7,_0xa99bdc){var _0x425b16=function(_0x525b6a){while(--_0x525b6a){_0x15d1d7['push'](_0x15d1d7['shift']());}};_0x425b16(++_0xa99bdc);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xeb5d[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0xdeb5('0x0')]={'name':{'type':Sequelize[_0xdeb5('0x1')],'unique':_0xdeb5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdeb5('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 33ef89f..3d78d6f 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 _0xbabd=['name','send','index','map','CmList','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','pick','filter','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','message','CmCustomField','CustomFields','concat','format','raw','getContacts','OrderBy','alias','from','cm_contacts','c.deletedAt\x20is\x20null','distinct','c.cf_','customField_','field','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','select','description','ItemTypeId\x20=\x20?','description_additionalPhone_','each','toString','now','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','mustache','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./cmList.socket','register','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','end','error','stack'];(function(_0x550d3b,_0x1657d2){var _0x540430=function(_0x5d705){while(--_0x5d705){_0x550d3b['push'](_0x550d3b['shift']());}};_0x540430(++_0x1657d2);}(_0xbabd,0x118));var _0xdbab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbabd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdbab('0x0'));var jsonpatch=require(_0xdbab('0x1'));var rp=require(_0xdbab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbab('0x3'));var util=require(_0xdbab('0x4'));var path=require(_0xdbab('0x5'));var sox=require(_0xdbab('0x6'));var csv=require(_0xdbab('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbab('0x8'));var _=require(_0xdbab('0x9'));var squel=require(_0xdbab('0xa'));var crypto=require(_0xdbab('0xb'));var jsforce=require(_0xdbab('0xc'));var deskjs=require(_0xdbab('0xd'));var toCsv=require(_0xdbab('0x7'));var querystring=require(_0xdbab('0xe'));var Papa=require(_0xdbab('0xf'));var Redis=require(_0xdbab('0x10'));var authService=require(_0xdbab('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdbab('0x12'));var hardwareService=require(_0xdbab('0x13'));var logger=require(_0xdbab('0x14'))(_0xdbab('0x15'));var utils=require(_0xdbab('0x16'));var config=require(_0xdbab('0x17'));var licenseUtil=require(_0xdbab('0x18'));var db=require(_0xdbab('0x19'))['db'];var csv_results;config[_0xdbab('0x1a')]=_['defaults'](config[_0xdbab('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdbab('0x1b'))[_0xdbab('0x1c')](socket);function respondWithStatusCode(_0x2a9395,_0x56dc21){_0x56dc21=_0x56dc21||0xcc;return function(_0x3f2983){if(_0x3f2983){return _0x2a9395[_0xdbab('0x1d')](_0x56dc21);}return _0x2a9395[_0xdbab('0x1e')](_0x56dc21)['end']();};}function respondWithResult(_0x50f0af,_0x4377d6){_0x4377d6=_0x4377d6||0xc8;return function(_0x50171f){if(_0x50171f){return _0x50f0af[_0xdbab('0x1e')](_0x4377d6)['json'](_0x50171f);}};}function respondWithFilteredResult(_0x2fb72e,_0x574a31){return function(_0x17e139){if(_0x17e139){var _0x35bf46=typeof _0x574a31['offset']==='undefined'&&typeof _0x574a31[_0xdbab('0x1f')]===_0xdbab('0x20');var _0xe51e97=_0x17e139[_0xdbab('0x21')];var _0x1b9b18=_0x35bf46?0x0:_0x574a31['offset'];var _0x5670aa=_0x35bf46?_0x17e139[_0xdbab('0x21')]:_0x574a31[_0xdbab('0x22')]+_0x574a31[_0xdbab('0x1f')];var _0x330a70;if(_0x5670aa>=_0xe51e97){_0x5670aa=_0xe51e97;_0x330a70=0xc8;}else{_0x330a70=0xce;}_0x2fb72e['status'](_0x330a70);return _0x2fb72e[_0xdbab('0x23')](_0xdbab('0x24'),_0x1b9b18+'-'+_0x5670aa+'/'+_0xe51e97)[_0xdbab('0x25')](_0x17e139);}return null;};}function patchUpdates(_0xc964a0){return function(_0x289970){try{jsonpatch[_0xdbab('0x26')](_0x289970,_0xc964a0,!![]);}catch(_0x39a3cd){return BPromise[_0xdbab('0x27')](_0x39a3cd);}return _0x289970[_0xdbab('0x28')]();};}function saveUpdates(_0x2e7bf5,_0x513cb0){return function(_0x32e0c0){if(_0x32e0c0){return _0x32e0c0[_0xdbab('0x29')](_0x2e7bf5)[_0xdbab('0x2a')](function(_0x22f25f){return _0x22f25f;});}return null;};}function removeEntity(_0x15f017,_0x4372bb){return function(_0x4fe1ae){if(_0x4fe1ae){return _0x4fe1ae['destroy']()[_0xdbab('0x2a')](function(){var _0x2d6b11=_0x4fe1ae[_0xdbab('0x2b')]({'plain':!![]});var _0x33fa94=_0xdbab('0x2c');return db[_0xdbab('0x2d')][_0xdbab('0x2e')]({'where':{'type':_0x33fa94,'resourceId':_0x2d6b11['id']}})[_0xdbab('0x2a')](function(){return _0x4fe1ae;});})[_0xdbab('0x2a')](function(){_0x15f017[_0xdbab('0x1e')](0xcc)[_0xdbab('0x2f')]();});}};}function handleEntityNotFound(_0x59a6b9,_0xea76c7){return function(_0x5ceb72){if(!_0x5ceb72){_0x59a6b9[_0xdbab('0x1d')](0x194);}return _0x5ceb72;};}function handleError(_0xddc673,_0x273dad){_0x273dad=_0x273dad||0x1f4;return function(_0x521b95){logger[_0xdbab('0x30')](_0x521b95[_0xdbab('0x31')]);if(_0x521b95[_0xdbab('0x32')]){delete _0x521b95['name'];}_0xddc673[_0xdbab('0x1e')](_0x273dad)[_0xdbab('0x33')](_0x521b95);};}exports[_0xdbab('0x34')]=function(_0x4879b3,_0x3f3cfe){var _0x4d1765={},_0x12d05d={},_0x3f9982={'count':0x0,'rows':[]};var _0x3247d6=_[_0xdbab('0x35')](db[_0xdbab('0x36')][_0xdbab('0x37')],function(_0xa0e7a9){return{'name':_0xa0e7a9[_0xdbab('0x38')],'type':_0xa0e7a9['type'][_0xdbab('0x39')]};});_0x12d05d[_0xdbab('0x3a')]=_[_0xdbab('0x35')](_0x3247d6,_0xdbab('0x32'));_0x12d05d[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x4879b3[_0xdbab('0x3b')]);_0x12d05d[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x12d05d[_0xdbab('0x3a')],_0x12d05d[_0xdbab('0x3b')]);_0x4d1765[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x12d05d[_0xdbab('0x3a')],qs[_0xdbab('0x40')](_0x4879b3[_0xdbab('0x3b')][_0xdbab('0x40')]));_0x4d1765[_0xdbab('0x3f')]=_0x4d1765[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x4d1765[_0xdbab('0x3f')]:_0x12d05d[_0xdbab('0x3a')];if(!_0x4879b3[_0xdbab('0x3b')][_0xdbab('0x42')](_0xdbab('0x43'))){_0x4d1765[_0xdbab('0x1f')]=qs[_0xdbab('0x1f')](_0x4879b3[_0xdbab('0x3b')]['limit']);_0x4d1765[_0xdbab('0x22')]=qs['offset'](_0x4879b3[_0xdbab('0x3b')]['offset']);}_0x4d1765[_0xdbab('0x44')]=qs['sort'](_0x4879b3['query'][_0xdbab('0x45')]);_0x4d1765[_0xdbab('0x46')]=qs['filters'](_['pick'](_0x4879b3[_0xdbab('0x3b')],_0x12d05d[_0xdbab('0x3d')]),_0x3247d6);if(_0x4879b3['query']['filter']){_0x4d1765[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x4d1765[_0xdbab('0x46')],{'$or':_['map'](_0x3247d6,function(_0x523512){if(_0x523512[_0xdbab('0x48')]!==_0xdbab('0x49')){var _0x4ffa66={};_0x4ffa66[_0x523512['name']]={'$like':'%'+_0x4879b3[_0xdbab('0x3b')]['filter']+'%'};return _0x4ffa66;}})});}_0x4d1765=_[_0xdbab('0x47')]({},_0x4d1765,_0x4879b3[_0xdbab('0x4a')]);var _0x1a5dce={'where':_0x4d1765[_0xdbab('0x46')]};return db[_0xdbab('0x36')][_0xdbab('0x21')](_0x1a5dce)[_0xdbab('0x2a')](function(_0xb615fc){_0x3f9982[_0xdbab('0x21')]=_0xb615fc;if(_0x4879b3[_0xdbab('0x3b')][_0xdbab('0x4b')]){_0x4d1765[_0xdbab('0x4c')]=[{'all':!![]}];}return db[_0xdbab('0x36')]['findAll'](_0x4d1765);})[_0xdbab('0x2a')](function(_0x2622c0){_0x3f9982[_0xdbab('0x4d')]=_0x2622c0;return _0x3f9982;})['then'](respondWithFilteredResult(_0x3f3cfe,_0x4d1765))[_0xdbab('0x4e')](handleError(_0x3f3cfe,null));};exports[_0xdbab('0x4f')]=function(_0x30c2bb,_0x5cd990){var _0x46ba24={'raw':![],'where':{'id':_0x30c2bb[_0xdbab('0x50')]['id']}},_0x5a7c9f={};_0x5a7c9f[_0xdbab('0x3a')]=_[_0xdbab('0x3c')](db[_0xdbab('0x36')][_0xdbab('0x37')]);_0x5a7c9f[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x30c2bb[_0xdbab('0x3b')]);_0x5a7c9f[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x5a7c9f['model'],_0x5a7c9f[_0xdbab('0x3b')]);_0x46ba24[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x5a7c9f[_0xdbab('0x3a')],qs['fields'](_0x30c2bb['query']['fields']));_0x46ba24[_0xdbab('0x3f')]=_0x46ba24[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x46ba24[_0xdbab('0x3f')]:_0x5a7c9f[_0xdbab('0x3a')];if(_0x30c2bb[_0xdbab('0x3b')]['includeAll']){_0x46ba24[_0xdbab('0x4c')]=[{'all':!![]}];}_0x46ba24=_[_0xdbab('0x47')]({},_0x46ba24,_0x30c2bb[_0xdbab('0x4a')]);return db[_0xdbab('0x36')][_0xdbab('0x51')](_0x46ba24)['then'](handleEntityNotFound(_0x5cd990,null))[_0xdbab('0x2a')](respondWithResult(_0x5cd990,null))[_0xdbab('0x4e')](handleError(_0x5cd990,null));};exports[_0xdbab('0x52')]=function(_0x4c78a2,_0x3ec9f6){return db['CmList']['create'](_0x4c78a2[_0xdbab('0x53')],{})[_0xdbab('0x2a')](function(_0xd7c770){var _0x374a00=_0x4c78a2[_0xdbab('0x54')]['get']({'plain':!![]});if(!_0x374a00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x374a00['role']===_0xdbab('0x54')){var _0x1898b5=_0xd7c770['get']({'plain':!![]});var _0x30272f=_0xdbab('0x2c');return db['UserProfileSection'][_0xdbab('0x51')]({'where':{'name':_0x30272f,'userProfileId':_0x374a00[_0xdbab('0x55')]},'raw':!![]})['then'](function(_0x2cd776){if(_0x2cd776&&_0x2cd776[_0xdbab('0x56')]===0x0){return db[_0xdbab('0x2d')][_0xdbab('0x52')]({'name':_0x1898b5[_0xdbab('0x32')],'resourceId':_0x1898b5['id'],'type':_0x2cd776[_0xdbab('0x32')],'sectionId':_0x2cd776['id']},{})[_0xdbab('0x2a')](function(){return _0xd7c770;});}else{return _0xd7c770;}})[_0xdbab('0x4e')](function(_0x5914a8){logger[_0xdbab('0x30')](_0xdbab('0x57'),_0x5914a8);throw _0x5914a8;});}return _0xd7c770;})[_0xdbab('0x2a')](respondWithResult(_0x3ec9f6,0xc9))[_0xdbab('0x4e')](handleError(_0x3ec9f6,null));};exports['update']=function(_0x396a2a,_0x6c0cfa){if(_0x396a2a['body']['id']){delete _0x396a2a[_0xdbab('0x53')]['id'];}return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x396a2a[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x6c0cfa,null))['then'](saveUpdates(_0x396a2a['body'],null))[_0xdbab('0x2a')](respondWithResult(_0x6c0cfa,null))[_0xdbab('0x4e')](handleError(_0x6c0cfa,null));};exports[_0xdbab('0x2e')]=function(_0x16a309,_0x3de137){return db['CmList']['find']({'where':{'id':_0x16a309['params']['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x3de137,null))[_0xdbab('0x2a')](removeEntity(_0x3de137,null))[_0xdbab('0x4e')](handleError(_0x3de137,null));};exports[_0xdbab('0x58')]=function(_0x5cd8f3,_0x190902){return db[_0xdbab('0x36')][_0xdbab('0x58')]()[_0xdbab('0x2a')](respondWithResult(_0x190902,null))[_0xdbab('0x4e')](handleError(_0x190902,null));};exports[_0xdbab('0x59')]=function(_0x286596,_0x570d98,_0x31aadd){if(_0x286596[_0xdbab('0x53')]['id']){delete _0x286596[_0xdbab('0x53')]['id'];}return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x286596[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x570d98,null))[_0xdbab('0x2a')](function(_0xe0520c){if(_0xe0520c){_0x286596[_0xdbab('0x53')][_0xdbab('0x5a')]=_0xe0520c['id'];return db[_0xdbab('0x5b')][_0xdbab('0x52')](_0x286596[_0xdbab('0x53')]);}})['then'](respondWithResult(_0x570d98,null))['catch'](handleError(_0x570d98,null));};exports[_0xdbab('0x5c')]=function(_0x212d78,_0x123b37,_0x14864c){var _0x1fb348={'raw':![],'where':{}};var _0x26b92d={};var _0x38c892={'count':0x0,'rows':[]};return db['CmList'][_0xdbab('0x5d')]({'where':{'id':_0x212d78[_0xdbab('0x50')]['id']}})['then'](handleEntityNotFound(_0x123b37,null))[_0xdbab('0x2a')](function(_0x493f25){if(_0x493f25){_0x26b92d[_0xdbab('0x3a')]=_['keys'](db[_0xdbab('0x5b')]['rawAttributes']);_0x26b92d['query']=_[_0xdbab('0x3c')](_0x212d78[_0xdbab('0x3b')]);_0x26b92d[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x26b92d[_0xdbab('0x3a')],_0x26b92d['query']);_0x1fb348['attributes']=_[_0xdbab('0x3e')](_0x26b92d[_0xdbab('0x3a')],qs[_0xdbab('0x40')](_0x212d78['query'][_0xdbab('0x40')]));_0x1fb348[_0xdbab('0x3f')]=_0x1fb348[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x1fb348[_0xdbab('0x3f')]:_0x26b92d[_0xdbab('0x3a')];if(!_0x212d78['query']['hasOwnProperty']('nolimit')){_0x1fb348['limit']=qs[_0xdbab('0x1f')](_0x212d78[_0xdbab('0x3b')]['limit']);_0x1fb348[_0xdbab('0x22')]=qs[_0xdbab('0x22')](_0x212d78[_0xdbab('0x3b')][_0xdbab('0x22')]);}_0x1fb348[_0xdbab('0x44')]=qs[_0xdbab('0x45')](_0x212d78[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x1fb348['where']=qs[_0xdbab('0x3d')](_[_0xdbab('0x5e')](_0x212d78[_0xdbab('0x3b')],_0x26b92d[_0xdbab('0x3d')]));_0x1fb348[_0xdbab('0x46')][_0xdbab('0x5a')]=_0x493f25['id'];if(_0x212d78[_0xdbab('0x3b')][_0xdbab('0x5f')]){_0x1fb348[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x1fb348['where'],{'$or':_[_0xdbab('0x35')](_0x1fb348[_0xdbab('0x3f')],function(_0x5e3f2d){var _0x49cce9={};_0x49cce9[_0x5e3f2d]={'$like':'%'+_0x212d78[_0xdbab('0x3b')]['filter']+'%'};return _0x49cce9;})});}_0x1fb348=_[_0xdbab('0x47')]({},_0x1fb348,_0x212d78[_0xdbab('0x4a')]);return db[_0xdbab('0x5b')]['count']({'where':_0x1fb348[_0xdbab('0x46')]})['then'](function(_0x35dfed){_0x38c892[_0xdbab('0x21')]=_0x35dfed;if(_0x212d78[_0xdbab('0x3b')][_0xdbab('0x4b')]){_0x1fb348[_0xdbab('0x4c')]=[{'all':!![]}];}return db[_0xdbab('0x5b')][_0xdbab('0x60')](_0x1fb348);})[_0xdbab('0x2a')](function(_0x222df9){_0x38c892[_0xdbab('0x4d')]=_0x222df9;return _0x38c892;});}})[_0xdbab('0x2a')](respondWithFilteredResult(_0x123b37,_0x1fb348))[_0xdbab('0x4e')](handleError(_0x123b37,null));};exports[_0xdbab('0x61')]=function(_0x1f39f2,_0x41fff1,_0x5b3b6d){return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x1f39f2[_0xdbab('0x50')]['id']}})['then'](handleEntityNotFound(_0x41fff1,null))[_0xdbab('0x2a')](function(_0x544196){if(_0x544196){return _0x544196[_0xdbab('0x61')](_0x1f39f2[_0xdbab('0x3b')][_0xdbab('0x62')]);}})[_0xdbab('0x2a')](respondWithStatusCode(_0x41fff1,null))[_0xdbab('0x4e')](handleError(_0x41fff1,null));};exports[_0xdbab('0x63')]=function(_0x33f158,_0x32f47b,_0x2e6425){return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x33f158[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x32f47b,null))['then'](function(_0x23ab59){if(_0x23ab59){var _0x3ca41b=[];var _0xec1c10={'success':[],'errors':[]};return db[_0xdbab('0x64')]['describe']()[_0xdbab('0x2a')](function(_0x2db742){if(_0x33f158['body'][_0xdbab('0x65')]&&_[_0xdbab('0x66')](_0x33f158[_0xdbab('0x53')]['tags'])){if(_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')][_0xdbab('0x41')]){_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')]=_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')][_0xdbab('0x67')](';')+';';}else{_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')]=null;}}else{_0x33f158[_0xdbab('0x53')][_0xdbab('0x65')]=null;}if(_0x33f158[_0xdbab('0x53')]&&_['isArray'](_0x33f158[_0xdbab('0x53')])){for(var _0x2e945f=0x0;_0x2e945f<_0x33f158['body'][_0xdbab('0x41')];_0x2e945f+=0x1){_0x33f158[_0xdbab('0x53')][_0x2e945f][_0xdbab('0x5a')]=_0x33f158[_0xdbab('0x50')]['id'];_0x3ca41b[_0xdbab('0x68')](_0x33f158['body'][_0x2e945f]);}return BPromise['each'](_0x3ca41b,function(_0x546388){return db[_0xdbab('0x64')]['create'](_[_0xdbab('0x69')](_0x546388,['ids','id'])||{},{'fields':_['keys'](_0x2db742),'raw':!![]})[_0xdbab('0x2a')](function(_0x4a9b29){_0xec1c10[_0xdbab('0x6a')][_0xdbab('0x68')](_0x4a9b29[_0xdbab('0x6b')]);})[_0xdbab('0x4e')](function(_0x399f2b){_0xec1c10['errors'][_0xdbab('0x68')]({'data':_0x546388,'error':_0x399f2b[_0xdbab('0x6c')]});});})['then'](function(_0x23b52){return _0xec1c10;})['catch'](function(_0x3dee68){return _0x3dee68;});}else{_0x32f47b[_0xdbab('0x1e')](0x190)['json']({'message':'Malformed\x20request\x20syntax'});}});}})[_0xdbab('0x2a')](respondWithResult(_0x32f47b,null))[_0xdbab('0x4e')](handleError(_0x32f47b,null));};exports['getContacts']=function(_0x878742,_0xf28f0d,_0x1c4acf){var _0xd58775;return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x878742[_0xdbab('0x50')]['id']},'include':[{'model':db[_0xdbab('0x6d')],'as':_0xdbab('0x6e')}]})['then'](handleEntityNotFound(_0xf28f0d,null))[_0xdbab('0x2a')](function(_0x2f3a22){if(_0x2f3a22){_0xd58775=_0x2f3a22;return db[_0xdbab('0x64')][_0xdbab('0x37')];}})[_0xdbab('0x2a')](function(_0x573db6){if(_0x573db6){var _0x362842={};var _0x3ef049={};_0x3ef049['model']=_[_0xdbab('0x6f')](_[_0xdbab('0x3c')](_0x573db6),_[_0xdbab('0x35')](_0xd58775[_0xdbab('0x6e')],function(_0x42b4a5){return util[_0xdbab('0x70')]('cf_%d',_0x42b4a5['id']);}));_0x3ef049[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x878742[_0xdbab('0x3b')]);_0x3ef049[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x3ef049['model'],_0x3ef049['query']);_0x362842[_0xdbab('0x3f')]=_['intersection'](_0x3ef049['model'],qs[_0xdbab('0x40')](_0x878742['query'][_0xdbab('0x40')]));_0x362842[_0xdbab('0x3f')]=_0x362842[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x362842[_0xdbab('0x3f')]:_0x3ef049['model'];if(!_0x878742[_0xdbab('0x3b')][_0xdbab('0x42')](_0xdbab('0x43'))){_0x362842[_0xdbab('0x1f')]=qs['limit'](_0x878742[_0xdbab('0x3b')]['limit']);_0x362842[_0xdbab('0x22')]=qs['offset'](_0x878742[_0xdbab('0x3b')][_0xdbab('0x22')]);}_0x362842[_0xdbab('0x44')]=qs['sort'](_0x878742[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x362842['where']=qs['filters'](_[_0xdbab('0x5e')](_0x878742[_0xdbab('0x3b')],_0x3ef049['filters']));_0x362842[_0xdbab('0x71')]=!![];if(_0x878742[_0xdbab('0x3b')][_0xdbab('0x5f')]){_0x362842[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x362842[_0xdbab('0x46')],{'$or':_['map'](_0x362842['attributes'],function(_0x422776){var _0x35ba07={};_0x35ba07[_0x422776]={'$like':'%'+_0x878742[_0xdbab('0x3b')][_0xdbab('0x5f')]+'%'};return _0x35ba07;})});}_0x362842=_[_0xdbab('0x47')]({},_0x362842,_0x878742[_0xdbab('0x4a')]);return _0xd58775[_0xdbab('0x72')](_0x362842);}})[_0xdbab('0x2a')](respondWithResult(_0xf28f0d,null))[_0xdbab('0x4e')](handleError(_0xf28f0d,null));};exports['getContactsCsv']=function(_0x1a6b07,_0x511db5,_0xff00b6){var _0x415fa9;var _0x1058f8;var _0x24c9bc;var _0x520491=_0x1a6b07[_0xdbab('0x50')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0xdbab('0x32')],'raw':!![],'order':[_0xdbab('0x73')]})[_0xdbab('0x2a')](function(_0xa55bac){_0x415fa9=_0xa55bac;var _0x18c4ca=_['keys'](db[_0xdbab('0x64')][_0xdbab('0x37')]);return db[_0xdbab('0x6d')][_0xdbab('0x60')]({'raw':!![],'attributes':['id',_0xdbab('0x74')]})[_0xdbab('0x2a')](function(_0x4cca66){_0x1058f8=_0x4cca66;var _0x5010bb=squel['select']()['fields'](_0x18c4ca)[_0xdbab('0x75')](_0xdbab('0x76'),'c')[_0xdbab('0x46')]('c.ListId\x20=\x20?',_0x520491)['where'](_0xdbab('0x77'))[_0xdbab('0x78')]();for(var _0x89e842=0x0;_0x89e842<_0x1058f8[_0xdbab('0x41')];_0x89e842++){_0x5010bb['field'](_0xdbab('0x79')+_0x1058f8[_0x89e842]['id'],_0xdbab('0x7a')+_0x1058f8[_0x89e842][_0xdbab('0x74')]);}for(var _0x89e842=0x0;_0x89e842<_0x415fa9[_0xdbab('0x41')];_0x89e842++){_0x5010bb[_0xdbab('0x7b')](squel['select']()[_0xdbab('0x7b')](_0xdbab('0x7c'))[_0xdbab('0x75')](_0xdbab('0x7d'))[_0xdbab('0x46')]('ItemTypeId\x20=\x20?',_0x415fa9[_0x89e842]['id'])[_0xdbab('0x46')](_0xdbab('0x7e')),_0xdbab('0x7f')+_0x415fa9[_0x89e842][_0xdbab('0x32')]);_0x5010bb[_0xdbab('0x7b')](squel[_0xdbab('0x80')]()['field'](_0xdbab('0x81'))[_0xdbab('0x75')](_0xdbab('0x7d'))[_0xdbab('0x46')](_0xdbab('0x82'),_0x415fa9[_0x89e842]['id'])[_0xdbab('0x46')](_0xdbab('0x7e')),_0xdbab('0x83')+_0x415fa9[_0x89e842][_0xdbab('0x32')]);}var _0x1aed31=[];_0x1aed31[_0xdbab('0x68')](_0x5010bb['toString']());BPromise[_0xdbab('0x84')](_0x1aed31,handleQuery)[_0xdbab('0x2a')](function(_0x3fd099){handleQuery(_0x5010bb[_0xdbab('0x85')]());var _0x39bf91=csv_results[0x0];if(!_['isEmpty'](_0x39bf91)){var _0x5431ce=toCsv(_0x39bf91);var _0x5e73ad=Date[_0xdbab('0x86')]();fs['writeFileSync'](util[_0xdbab('0x70')](_0xdbab('0x87'),_0x520491,_0x5e73ad),_0x5431ce);_0x511db5['setHeader'](_0xdbab('0x88'),'attachment;\x20filename='+util[_0xdbab('0x70')](_0xdbab('0x89'),_0x520491,_0x5e73ad));_0x511db5['setHeader'](_0xdbab('0x8a'),_0xdbab('0x8b'));return _0x511db5[_0xdbab('0x8c')](util[_0xdbab('0x70')](_0xdbab('0x87'),_0x520491,_0x5e73ad));}else{return _0x511db5[_0xdbab('0x1d')](0xcc);}});});});};exports[_0xdbab('0x8d')]=function(_0x47c1ba,_0x1cec08,_0x24fefa){var _0x5c2e16;delete _0x47c1ba['body']['id'];return db[_0xdbab('0x36')][_0xdbab('0x5d')]({'where':{'id':_0x47c1ba[_0xdbab('0x50')]['id']}})['then'](handleEntityNotFound(_0x1cec08,null))['then'](function(_0x3bf52a){if(_0x3bf52a){return db[_0xdbab('0x8e')]['transaction'](function(_0x48db67){return db[_0xdbab('0x6d')][_0xdbab('0x52')](_0x47c1ba[_0xdbab('0x53')],{'transaction':_0x48db67})[_0xdbab('0x2a')](function(_0x311ba5){_0x5c2e16=_0x311ba5;return _0x3bf52a[_0xdbab('0x8f')](_0x311ba5,{'transaction':_0x48db67});})[_0xdbab('0x2a')](function(){var _0x3cdf6d={'type':db[_0xdbab('0x90')][_0xdbab('0x91')],'transaction':_0x48db67};switch(_0x47c1ba['body'][_0xdbab('0x48')]){case _0xdbab('0x92'):_0x3cdf6d[_0xdbab('0x48')]=db['Sequelize'][_0xdbab('0x91')];break;case _0xdbab('0x93'):_0x3cdf6d[_0xdbab('0x48')]=db['Sequelize'][_0xdbab('0x94')];break;case'switch':_0x3cdf6d[_0xdbab('0x48')]=db[_0xdbab('0x90')][_0xdbab('0x95')];_0x3cdf6d[_0xdbab('0x96')]=![];break;default:}return db[_0xdbab('0x8e')][_0xdbab('0x97')][_0xdbab('0x98')]('cm_contacts',util[_0xdbab('0x70')](_0xdbab('0x99'),_0x5c2e16['id']),_0x3cdf6d);})[_0xdbab('0x2a')](function(){return _0x5c2e16;});});}})[_0xdbab('0x2a')](respondWithResult(_0x1cec08,null))[_0xdbab('0x4e')](handleError(_0x1cec08,null));};exports[_0xdbab('0x9a')]=function(_0x43ced2,_0x5cfb6d,_0x4413f6){var _0x54360f={};var _0x398434={};var _0x1f9d73;var _0xc41b8d;return db[_0xdbab('0x36')]['findOne']({'where':{'id':_0x43ced2[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x5cfb6d,null))[_0xdbab('0x2a')](function(_0x39336f){if(_0x39336f){_0x1f9d73=_0x39336f;_0x398434[_0xdbab('0x3a')]=_[_0xdbab('0x3c')](db[_0xdbab('0x6d')][_0xdbab('0x37')]);_0x398434[_0xdbab('0x3b')]=_['keys'](_0x43ced2[_0xdbab('0x3b')]);_0x398434[_0xdbab('0x3d')]=_[_0xdbab('0x3e')](_0x398434['model'],_0x398434[_0xdbab('0x3b')]);_0x54360f[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x398434[_0xdbab('0x3a')],qs['fields'](_0x43ced2[_0xdbab('0x3b')][_0xdbab('0x40')]));_0x54360f[_0xdbab('0x3f')]=_0x54360f[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x54360f['attributes']:_0x398434[_0xdbab('0x3a')];_0x54360f[_0xdbab('0x44')]=qs[_0xdbab('0x45')](_0x43ced2[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x54360f['where']=qs[_0xdbab('0x3d')](_[_0xdbab('0x5e')](_0x43ced2[_0xdbab('0x3b')],_0x398434['filters']));_0x54360f['where']=_[_0xdbab('0x47')](_0x54360f[_0xdbab('0x46')],{'$or':[{'ListId':_0x39336f['id']},{'ListId':null}]});if(_0x43ced2[_0xdbab('0x3b')]['filter']){_0x54360f[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x54360f[_0xdbab('0x46')],{'$or':_['map'](_0x54360f['attributes'],function(_0x1544c7){var _0x41afda={};_0x41afda[_0x1544c7]={'$like':'%'+_0x43ced2['query'][_0xdbab('0x5f')]+'%'};return _0x41afda;})});}_0x54360f=_[_0xdbab('0x47')]({},_0x54360f,_0x43ced2[_0xdbab('0x4a')]);return db[_0xdbab('0x6d')][_0xdbab('0x9b')](_0x54360f);}})['then'](respondWithResult(_0x5cfb6d,null))[_0xdbab('0x4e')](handleError(_0x5cfb6d,null));};exports[_0xdbab('0x9c')]=function(_0x9b510c,_0x34cfb3){return db[_0xdbab('0x6d')][_0xdbab('0x9b')]({'where':{'ListId':null}})[_0xdbab('0x2a')](handleEntityNotFound(_0x34cfb3,null))[_0xdbab('0x2a')](function(_0x1ba089){return _0x1ba089;})[_0xdbab('0x2a')](respondWithResult(_0x34cfb3,null))[_0xdbab('0x4e')](handleError(_0x34cfb3,null));};exports[_0xdbab('0x9d')]=function(_0xcbde4a,_0x2b11fa,_0x30902d){return db['CmList'][_0xdbab('0x51')]({'where':{'id':_0xcbde4a['params']['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x2b11fa,null))['then'](function(_0x13368c){if(_0x13368c){return _0x13368c[_0xdbab('0x9d')](_0xcbde4a['body'][_0xdbab('0x62')],_[_0xdbab('0x69')](_0xcbde4a[_0xdbab('0x53')],[_0xdbab('0x62'),'id'])||{})[_0xdbab('0x9e')](function(_0x286032){for(var _0x2d20b2=0x0;_0x2d20b2<_0xcbde4a[_0xdbab('0x53')][_0xdbab('0x62')][_0xdbab('0x41')];_0x2d20b2+=0x1){socket[_0xdbab('0x9f')](_0xdbab('0xa0'),{'UserId':Number(_0xcbde4a[_0xdbab('0x53')][_0xdbab('0x62')][_0x2d20b2]),'CmListId':Number(_0xcbde4a['params']['id'])});}return _0x286032;});}})[_0xdbab('0x2a')](respondWithResult(_0x2b11fa,null))[_0xdbab('0x4e')](handleError(_0x2b11fa,null));};exports[_0xdbab('0xa1')]=function(_0x460cb2,_0x5c05d7,_0x574f8c){return db[_0xdbab('0x36')][_0xdbab('0x51')]({'where':{'id':_0x460cb2[_0xdbab('0x50')]['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x5c05d7,null))[_0xdbab('0x2a')](function(_0x52657e){if(_0x52657e){return _0x52657e[_0xdbab('0xa1')](_0x460cb2['query'][_0xdbab('0x62')])['then'](function(){if(_[_0xdbab('0x66')](_0x460cb2[_0xdbab('0x3b')][_0xdbab('0x62')])){for(var _0x572783=0x0;_0x572783<_0x460cb2['query']['ids'][_0xdbab('0x41')];_0x572783+=0x1){socket['emit'](_0xdbab('0xa2'),{'UserId':Number(_0x460cb2['query'][_0xdbab('0x62')][_0x572783]),'CmListId':Number(_0x460cb2[_0xdbab('0x50')]['id'])});}}else{socket['emit'](_0xdbab('0xa2'),{'UserId':Number(_0x460cb2[_0xdbab('0x3b')][_0xdbab('0x62')]),'CmListId':Number(_0x460cb2[_0xdbab('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c05d7,null))['catch'](handleError(_0x5c05d7,null));};exports[_0xdbab('0xa3')]=function(_0x4b27d1,_0x28f75a,_0x4ea975){var _0x4b8323={};var _0x2a107c={};var _0x49ff77;var _0x61b8bc;return db['CmList'][_0xdbab('0x5d')]({'where':{'id':_0x4b27d1['params']['id']}})[_0xdbab('0x2a')](handleEntityNotFound(_0x28f75a,null))['then'](function(_0x257497){if(_0x257497){_0x49ff77=_0x257497;_0x2a107c[_0xdbab('0x3a')]=_[_0xdbab('0x3c')](db[_0xdbab('0xa4')]['rawAttributes']);_0x2a107c[_0xdbab('0x3b')]=_[_0xdbab('0x3c')](_0x4b27d1[_0xdbab('0x3b')]);_0x2a107c['filters']=_[_0xdbab('0x3e')](_0x2a107c[_0xdbab('0x3a')],_0x2a107c[_0xdbab('0x3b')]);_0x4b8323[_0xdbab('0x3f')]=_[_0xdbab('0x3e')](_0x2a107c[_0xdbab('0x3a')],qs['fields'](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x40')]));_0x4b8323[_0xdbab('0x3f')]=_0x4b8323[_0xdbab('0x3f')][_0xdbab('0x41')]?_0x4b8323['attributes']:_0x2a107c[_0xdbab('0x3a')];_0x4b8323[_0xdbab('0x44')]=qs[_0xdbab('0x45')](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x45')]);_0x4b8323['where']=qs[_0xdbab('0x3d')](_[_0xdbab('0x5e')](_0x4b27d1[_0xdbab('0x3b')],_0x2a107c[_0xdbab('0x3d')]));if(_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x5f')]){_0x4b8323[_0xdbab('0x46')]=_[_0xdbab('0x47')](_0x4b8323['where'],{'$or':_[_0xdbab('0x35')](_0x4b8323[_0xdbab('0x3f')],function(_0x4f573d){var _0x39a2ba={};_0x39a2ba[_0x4f573d]={'$like':'%'+_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x5f')]+'%'};return _0x39a2ba;})});}_0x4b8323=_[_0xdbab('0x47')]({},_0x4b8323,_0x4b27d1[_0xdbab('0x4a')]);return _0x49ff77['getAgents'](_0x4b8323);}})[_0xdbab('0x2a')](function(_0x376124){if(_0x376124){_0x61b8bc=_0x376124[_0xdbab('0x41')];if(!_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x42')](_0xdbab('0x43'))){_0x4b8323['limit']=qs[_0xdbab('0x1f')](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x1f')]);_0x4b8323[_0xdbab('0x22')]=qs[_0xdbab('0x22')](_0x4b27d1[_0xdbab('0x3b')][_0xdbab('0x22')]);}return _0x49ff77['getAgents'](_0x4b8323);}})[_0xdbab('0x2a')](function(_0x3e2f25){if(_0x3e2f25){return _0x3e2f25?{'count':_0x61b8bc,'rows':_0x3e2f25}:null;}})[_0xdbab('0x2a')](respondWithResult(_0x28f75a,null))[_0xdbab('0x4e')](handleError(_0x28f75a,null));};function handleQuery(_0x354b59){logger['info'](_0x354b59);return db['sequelize']['query'](_0x354b59)[_0xdbab('0x9e')](function(_0x1397e7){csv_results['push'](_0x1397e7);})[_0xdbab('0x4e')](function(_0x10d618){logger[_0xdbab('0x30')](_0x10d618[_0xdbab('0x6c')]);});} \ No newline at end of file +var _0x8e4a=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CmList','includeAll','include','findAll','rows','show','params','length','options','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','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','each','omit','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','ContactItemType','OrderBy','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','now','writeFileSync','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','addCustomFields','Sequelize','TEXT','number','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','emit','removeAgents','userCmList:remove','getAgents','User','info','spread','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','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','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','Lists','UserProfileResource','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes'];(function(_0xac3a5b,_0x59b23a){var _0x5c0184=function(_0x5781be){while(--_0x5781be){_0xac3a5b['push'](_0xac3a5b['shift']());}};_0x5c0184(++_0x59b23a);}(_0x8e4a,0x113));var _0xa8e4=function(_0x1154ef,_0x4f51d9){_0x1154ef=_0x1154ef-0x0;var _0x186b9d=_0x8e4a[_0x1154ef];return _0x186b9d;};'use strict';var emlformat=require(_0xa8e4('0x0'));var rimraf=require(_0xa8e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa8e4('0x2'));var rp=require('request-promise');var moment=require(_0xa8e4('0x3'));var BPromise=require(_0xa8e4('0x4'));var Mustache=require(_0xa8e4('0x5'));var util=require(_0xa8e4('0x6'));var path=require(_0xa8e4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa8e4('0x8'));var fs=require('fs');var fs_extra=require(_0xa8e4('0x9'));var _=require(_0xa8e4('0xa'));var squel=require(_0xa8e4('0xb'));var crypto=require(_0xa8e4('0xc'));var jsforce=require(_0xa8e4('0xd'));var deskjs=require(_0xa8e4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa8e4('0xf'));var Papa=require(_0xa8e4('0x10'));var Redis=require(_0xa8e4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa8e4('0x12'));var as=require(_0xa8e4('0x13'));var hardwareService=require(_0xa8e4('0x14'));var logger=require(_0xa8e4('0x15'))(_0xa8e4('0x16'));var utils=require(_0xa8e4('0x17'));var config=require(_0xa8e4('0x18'));var licenseUtil=require(_0xa8e4('0x19'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xa8e4('0x1a')]=_[_0xa8e4('0x1b')](config['redis'],{'host':_0xa8e4('0x1c'),'port':0x18eb});var socket=require(_0xa8e4('0x1d'))(new Redis(config[_0xa8e4('0x1a')]));require(_0xa8e4('0x1e'))[_0xa8e4('0x1f')](socket);function respondWithStatusCode(_0xc5467e,_0x454096){_0x454096=_0x454096||0xcc;return function(_0x2c09f7){if(_0x2c09f7){return _0xc5467e[_0xa8e4('0x20')](_0x454096);}return _0xc5467e['status'](_0x454096)['end']();};}function respondWithResult(_0x15ad7b,_0x42acc3){_0x42acc3=_0x42acc3||0xc8;return function(_0x31f94e){if(_0x31f94e){return _0x15ad7b[_0xa8e4('0x21')](_0x42acc3)[_0xa8e4('0x22')](_0x31f94e);}};}function respondWithFilteredResult(_0x2394d3,_0x15ff67){return function(_0x3bcbda){if(_0x3bcbda){var _0x51fadc=typeof _0x15ff67[_0xa8e4('0x23')]==='undefined'&&typeof _0x15ff67['limit']===_0xa8e4('0x24');var _0x232b56=_0x3bcbda[_0xa8e4('0x25')];var _0x20ad1e=_0x51fadc?0x0:_0x15ff67[_0xa8e4('0x23')];var _0x27f4e2=_0x51fadc?_0x3bcbda[_0xa8e4('0x25')]:_0x15ff67[_0xa8e4('0x23')]+_0x15ff67[_0xa8e4('0x26')];var _0x13f900;if(_0x27f4e2>=_0x232b56){_0x27f4e2=_0x232b56;_0x13f900=0xc8;}else{_0x13f900=0xce;}_0x2394d3[_0xa8e4('0x21')](_0x13f900);return _0x2394d3['set'](_0xa8e4('0x27'),_0x20ad1e+'-'+_0x27f4e2+'/'+_0x232b56)[_0xa8e4('0x22')](_0x3bcbda);}return null;};}function patchUpdates(_0x5b6e63){return function(_0x22d865){try{jsonpatch[_0xa8e4('0x28')](_0x22d865,_0x5b6e63,!![]);}catch(_0x35c0bf){return BPromise[_0xa8e4('0x29')](_0x35c0bf);}return _0x22d865[_0xa8e4('0x2a')]();};}function saveUpdates(_0x4770a1,_0x743f34){return function(_0x46e51e){if(_0x46e51e){return _0x46e51e[_0xa8e4('0x2b')](_0x4770a1)[_0xa8e4('0x2c')](function(_0x138c14){return _0x138c14;});}return null;};}function removeEntity(_0x11c998,_0x20a03b){return function(_0x303815){if(_0x303815){return _0x303815['destroy']()[_0xa8e4('0x2c')](function(){var _0xc5d56b=_0x303815[_0xa8e4('0x2d')]({'plain':!![]});var _0x3bd6b3=_0xa8e4('0x2e');return db[_0xa8e4('0x2f')][_0xa8e4('0x30')]({'where':{'type':_0x3bd6b3,'resourceId':_0xc5d56b['id']}})[_0xa8e4('0x2c')](function(){return _0x303815;});})[_0xa8e4('0x2c')](function(){_0x11c998[_0xa8e4('0x21')](0xcc)[_0xa8e4('0x31')]();});}};}function handleEntityNotFound(_0x6eff9,_0x5c0842){return function(_0x31f737){if(!_0x31f737){_0x6eff9['sendStatus'](0x194);}return _0x31f737;};}function handleError(_0x5b39a4,_0x3db8fc){_0x3db8fc=_0x3db8fc||0x1f4;return function(_0xd28ec2){logger[_0xa8e4('0x32')](_0xd28ec2[_0xa8e4('0x33')]);if(_0xd28ec2[_0xa8e4('0x34')]){delete _0xd28ec2[_0xa8e4('0x34')];}_0x5b39a4[_0xa8e4('0x21')](_0x3db8fc)[_0xa8e4('0x35')](_0xd28ec2);};}exports[_0xa8e4('0x36')]=function(_0x495a1a,_0x5a96e4){var _0x315f3d={},_0x5d2e1d={},_0x46d8a0={'count':0x0,'rows':[]};var _0x2a2b33=_[_0xa8e4('0x37')](db['CmList'][_0xa8e4('0x38')],function(_0x57f28d){return{'name':_0x57f28d[_0xa8e4('0x39')],'type':_0x57f28d[_0xa8e4('0x3a')]['key']};});_0x5d2e1d[_0xa8e4('0x3b')]=_[_0xa8e4('0x37')](_0x2a2b33,'name');_0x5d2e1d['query']=_[_0xa8e4('0x3c')](_0x495a1a[_0xa8e4('0x3d')]);_0x5d2e1d[_0xa8e4('0x3e')]=_[_0xa8e4('0x3f')](_0x5d2e1d[_0xa8e4('0x3b')],_0x5d2e1d[_0xa8e4('0x3d')]);_0x315f3d[_0xa8e4('0x40')]=_[_0xa8e4('0x3f')](_0x5d2e1d['model'],qs[_0xa8e4('0x41')](_0x495a1a['query'][_0xa8e4('0x41')]));_0x315f3d[_0xa8e4('0x40')]=_0x315f3d[_0xa8e4('0x40')]['length']?_0x315f3d[_0xa8e4('0x40')]:_0x5d2e1d[_0xa8e4('0x3b')];if(!_0x495a1a[_0xa8e4('0x3d')][_0xa8e4('0x42')](_0xa8e4('0x43'))){_0x315f3d[_0xa8e4('0x26')]=qs[_0xa8e4('0x26')](_0x495a1a[_0xa8e4('0x3d')][_0xa8e4('0x26')]);_0x315f3d[_0xa8e4('0x23')]=qs['offset'](_0x495a1a[_0xa8e4('0x3d')][_0xa8e4('0x23')]);}_0x315f3d[_0xa8e4('0x44')]=qs[_0xa8e4('0x45')](_0x495a1a['query'][_0xa8e4('0x45')]);_0x315f3d[_0xa8e4('0x46')]=qs[_0xa8e4('0x3e')](_[_0xa8e4('0x47')](_0x495a1a['query'],_0x5d2e1d[_0xa8e4('0x3e')]),_0x2a2b33);if(_0x495a1a[_0xa8e4('0x3d')][_0xa8e4('0x48')]){_0x315f3d[_0xa8e4('0x46')]=_[_0xa8e4('0x49')](_0x315f3d[_0xa8e4('0x46')],{'$or':_[_0xa8e4('0x37')](_0x2a2b33,function(_0x2776b2){if(_0x2776b2['type']!=='VIRTUAL'){var _0x5d4c1f={};_0x5d4c1f[_0x2776b2[_0xa8e4('0x34')]]={'$like':'%'+_0x495a1a[_0xa8e4('0x3d')][_0xa8e4('0x48')]+'%'};return _0x5d4c1f;}})});}_0x315f3d=_[_0xa8e4('0x49')]({},_0x315f3d,_0x495a1a['options']);var _0x1a014a={'where':_0x315f3d[_0xa8e4('0x46')]};return db[_0xa8e4('0x4a')][_0xa8e4('0x25')](_0x1a014a)[_0xa8e4('0x2c')](function(_0x5f223c){_0x46d8a0[_0xa8e4('0x25')]=_0x5f223c;if(_0x495a1a[_0xa8e4('0x3d')][_0xa8e4('0x4b')]){_0x315f3d[_0xa8e4('0x4c')]=[{'all':!![]}];}return db[_0xa8e4('0x4a')][_0xa8e4('0x4d')](_0x315f3d);})['then'](function(_0x19b270){_0x46d8a0[_0xa8e4('0x4e')]=_0x19b270;return _0x46d8a0;})[_0xa8e4('0x2c')](respondWithFilteredResult(_0x5a96e4,_0x315f3d))['catch'](handleError(_0x5a96e4,null));};exports[_0xa8e4('0x4f')]=function(_0x119781,_0x2f45f5){var _0x3163be={'raw':![],'where':{'id':_0x119781[_0xa8e4('0x50')]['id']}},_0x638ed9={};_0x638ed9[_0xa8e4('0x3b')]=_[_0xa8e4('0x3c')](db['CmList']['rawAttributes']);_0x638ed9['query']=_[_0xa8e4('0x3c')](_0x119781[_0xa8e4('0x3d')]);_0x638ed9[_0xa8e4('0x3e')]=_[_0xa8e4('0x3f')](_0x638ed9['model'],_0x638ed9[_0xa8e4('0x3d')]);_0x3163be[_0xa8e4('0x40')]=_[_0xa8e4('0x3f')](_0x638ed9[_0xa8e4('0x3b')],qs[_0xa8e4('0x41')](_0x119781['query'][_0xa8e4('0x41')]));_0x3163be[_0xa8e4('0x40')]=_0x3163be[_0xa8e4('0x40')][_0xa8e4('0x51')]?_0x3163be[_0xa8e4('0x40')]:_0x638ed9[_0xa8e4('0x3b')];if(_0x119781[_0xa8e4('0x3d')][_0xa8e4('0x4b')]){_0x3163be[_0xa8e4('0x4c')]=[{'all':!![]}];}_0x3163be=_['merge']({},_0x3163be,_0x119781[_0xa8e4('0x52')]);return db[_0xa8e4('0x4a')][_0xa8e4('0x53')](_0x3163be)[_0xa8e4('0x2c')](handleEntityNotFound(_0x2f45f5,null))[_0xa8e4('0x2c')](respondWithResult(_0x2f45f5,null))[_0xa8e4('0x54')](handleError(_0x2f45f5,null));};exports[_0xa8e4('0x55')]=function(_0x3c7921,_0x4a22c2){return db[_0xa8e4('0x4a')][_0xa8e4('0x55')](_0x3c7921[_0xa8e4('0x56')],{})[_0xa8e4('0x2c')](function(_0x1c3900){var _0x264ffd=_0x3c7921[_0xa8e4('0x57')][_0xa8e4('0x2d')]({'plain':!![]});if(!_0x264ffd)throw new Error(_0xa8e4('0x58'));if(_0x264ffd[_0xa8e4('0x59')]===_0xa8e4('0x57')){var _0xd57a5=_0x1c3900[_0xa8e4('0x2d')]({'plain':!![]});var _0x2c48f5='Lists';return db[_0xa8e4('0x5a')]['find']({'where':{'name':_0x2c48f5,'userProfileId':_0x264ffd[_0xa8e4('0x5b')]},'raw':!![]})[_0xa8e4('0x2c')](function(_0x20b756){if(_0x20b756&&_0x20b756[_0xa8e4('0x5c')]===0x0){return db['UserProfileResource'][_0xa8e4('0x55')]({'name':_0xd57a5[_0xa8e4('0x34')],'resourceId':_0xd57a5['id'],'type':_0x20b756[_0xa8e4('0x34')],'sectionId':_0x20b756['id']},{})[_0xa8e4('0x2c')](function(){return _0x1c3900;});}else{return _0x1c3900;}})[_0xa8e4('0x54')](function(_0x7d66b0){logger[_0xa8e4('0x32')](_0xa8e4('0x5d'),_0x7d66b0);throw _0x7d66b0;});}return _0x1c3900;})['then'](respondWithResult(_0x4a22c2,0xc9))[_0xa8e4('0x54')](handleError(_0x4a22c2,null));};exports['update']=function(_0x3df0be,_0x55b281){if(_0x3df0be[_0xa8e4('0x56')]['id']){delete _0x3df0be['body']['id'];}return db[_0xa8e4('0x4a')][_0xa8e4('0x53')]({'where':{'id':_0x3df0be['params']['id']}})['then'](handleEntityNotFound(_0x55b281,null))['then'](saveUpdates(_0x3df0be[_0xa8e4('0x56')],null))[_0xa8e4('0x2c')](respondWithResult(_0x55b281,null))['catch'](handleError(_0x55b281,null));};exports[_0xa8e4('0x30')]=function(_0x4993c4,_0x218a4b){return db[_0xa8e4('0x4a')]['find']({'where':{'id':_0x4993c4[_0xa8e4('0x50')]['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x218a4b,null))[_0xa8e4('0x2c')](removeEntity(_0x218a4b,null))[_0xa8e4('0x54')](handleError(_0x218a4b,null));};exports[_0xa8e4('0x5e')]=function(_0x9e7f2a,_0xc2d493){return db['CmList'][_0xa8e4('0x5e')]()[_0xa8e4('0x2c')](respondWithResult(_0xc2d493,null))['catch'](handleError(_0xc2d493,null));};exports[_0xa8e4('0x5f')]=function(_0x1e4a3a,_0x241f9c,_0x114a9d){if(_0x1e4a3a[_0xa8e4('0x56')]['id']){delete _0x1e4a3a[_0xa8e4('0x56')]['id'];}return db[_0xa8e4('0x4a')][_0xa8e4('0x53')]({'where':{'id':_0x1e4a3a[_0xa8e4('0x50')]['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x241f9c,null))[_0xa8e4('0x2c')](function(_0x27c87f){if(_0x27c87f){_0x1e4a3a[_0xa8e4('0x56')][_0xa8e4('0x60')]=_0x27c87f['id'];return db[_0xa8e4('0x61')][_0xa8e4('0x55')](_0x1e4a3a[_0xa8e4('0x56')]);}})['then'](respondWithResult(_0x241f9c,null))['catch'](handleError(_0x241f9c,null));};exports[_0xa8e4('0x62')]=function(_0x39f3ac,_0x10eb44,_0xc38b7c){var _0x551530={'raw':![],'where':{}};var _0x41bd53={};var _0x17e4c2={'count':0x0,'rows':[]};return db[_0xa8e4('0x4a')][_0xa8e4('0x63')]({'where':{'id':_0x39f3ac[_0xa8e4('0x50')]['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x10eb44,null))[_0xa8e4('0x2c')](function(_0x38d99a){if(_0x38d99a){_0x41bd53[_0xa8e4('0x3b')]=_[_0xa8e4('0x3c')](db[_0xa8e4('0x61')]['rawAttributes']);_0x41bd53[_0xa8e4('0x3d')]=_['keys'](_0x39f3ac[_0xa8e4('0x3d')]);_0x41bd53[_0xa8e4('0x3e')]=_['intersection'](_0x41bd53[_0xa8e4('0x3b')],_0x41bd53[_0xa8e4('0x3d')]);_0x551530[_0xa8e4('0x40')]=_[_0xa8e4('0x3f')](_0x41bd53['model'],qs[_0xa8e4('0x41')](_0x39f3ac[_0xa8e4('0x3d')][_0xa8e4('0x41')]));_0x551530[_0xa8e4('0x40')]=_0x551530[_0xa8e4('0x40')]['length']?_0x551530[_0xa8e4('0x40')]:_0x41bd53[_0xa8e4('0x3b')];if(!_0x39f3ac[_0xa8e4('0x3d')]['hasOwnProperty'](_0xa8e4('0x43'))){_0x551530[_0xa8e4('0x26')]=qs['limit'](_0x39f3ac[_0xa8e4('0x3d')][_0xa8e4('0x26')]);_0x551530[_0xa8e4('0x23')]=qs['offset'](_0x39f3ac[_0xa8e4('0x3d')][_0xa8e4('0x23')]);}_0x551530[_0xa8e4('0x44')]=qs['sort'](_0x39f3ac[_0xa8e4('0x3d')]['sort']);_0x551530[_0xa8e4('0x46')]=qs[_0xa8e4('0x3e')](_[_0xa8e4('0x47')](_0x39f3ac[_0xa8e4('0x3d')],_0x41bd53[_0xa8e4('0x3e')]));_0x551530[_0xa8e4('0x46')][_0xa8e4('0x60')]=_0x38d99a['id'];if(_0x39f3ac[_0xa8e4('0x3d')][_0xa8e4('0x48')]){_0x551530[_0xa8e4('0x46')]=_[_0xa8e4('0x49')](_0x551530[_0xa8e4('0x46')],{'$or':_[_0xa8e4('0x37')](_0x551530['attributes'],function(_0x32dcda){var _0x144185={};_0x144185[_0x32dcda]={'$like':'%'+_0x39f3ac[_0xa8e4('0x3d')][_0xa8e4('0x48')]+'%'};return _0x144185;})});}_0x551530=_['merge']({},_0x551530,_0x39f3ac[_0xa8e4('0x52')]);return db[_0xa8e4('0x61')][_0xa8e4('0x25')]({'where':_0x551530[_0xa8e4('0x46')]})[_0xa8e4('0x2c')](function(_0x5b7f30){_0x17e4c2['count']=_0x5b7f30;if(_0x39f3ac[_0xa8e4('0x3d')][_0xa8e4('0x4b')]){_0x551530['include']=[{'all':!![]}];}return db[_0xa8e4('0x61')][_0xa8e4('0x4d')](_0x551530);})[_0xa8e4('0x2c')](function(_0x5d3d4f){_0x17e4c2[_0xa8e4('0x4e')]=_0x5d3d4f;return _0x17e4c2;});}})[_0xa8e4('0x2c')](respondWithFilteredResult(_0x10eb44,_0x551530))[_0xa8e4('0x54')](handleError(_0x10eb44,null));};exports['removeDispositions']=function(_0x11400a,_0x293522,_0x344083){return db['CmList'][_0xa8e4('0x53')]({'where':{'id':_0x11400a[_0xa8e4('0x50')]['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x293522,null))[_0xa8e4('0x2c')](function(_0x3a1d74){if(_0x3a1d74){return _0x3a1d74[_0xa8e4('0x64')](_0x11400a[_0xa8e4('0x3d')][_0xa8e4('0x65')]);}})[_0xa8e4('0x2c')](respondWithStatusCode(_0x293522,null))[_0xa8e4('0x54')](handleError(_0x293522,null));};exports[_0xa8e4('0x66')]=function(_0x5cf4c1,_0x3107f2,_0x59fce4){return db[_0xa8e4('0x4a')][_0xa8e4('0x53')]({'where':{'id':_0x5cf4c1[_0xa8e4('0x50')]['id']}})['then'](handleEntityNotFound(_0x3107f2,null))[_0xa8e4('0x2c')](function(_0x2e9c86){if(_0x2e9c86){var _0x28e915=[];var _0xc030e6={'success':[],'errors':[]};return db[_0xa8e4('0x67')]['describe']()['then'](function(_0x46b377){if(_0x5cf4c1[_0xa8e4('0x56')][_0xa8e4('0x68')]&&_['isArray'](_0x5cf4c1[_0xa8e4('0x56')][_0xa8e4('0x68')])){if(_0x5cf4c1['body']['tags']['length']){_0x5cf4c1[_0xa8e4('0x56')][_0xa8e4('0x68')]=_0x5cf4c1[_0xa8e4('0x56')]['tags'][_0xa8e4('0x69')](';')+';';}else{_0x5cf4c1[_0xa8e4('0x56')][_0xa8e4('0x68')]=null;}}else{_0x5cf4c1[_0xa8e4('0x56')][_0xa8e4('0x68')]=null;}if(_0x5cf4c1[_0xa8e4('0x56')]&&_[_0xa8e4('0x6a')](_0x5cf4c1[_0xa8e4('0x56')])){for(var _0x33c644=0x0;_0x33c644<_0x5cf4c1[_0xa8e4('0x56')][_0xa8e4('0x51')];_0x33c644+=0x1){_0x5cf4c1[_0xa8e4('0x56')][_0x33c644][_0xa8e4('0x60')]=_0x5cf4c1[_0xa8e4('0x50')]['id'];_0x28e915['push'](_0x5cf4c1[_0xa8e4('0x56')][_0x33c644]);}return BPromise[_0xa8e4('0x6b')](_0x28e915,function(_0x376942){return db[_0xa8e4('0x67')][_0xa8e4('0x55')](_[_0xa8e4('0x6c')](_0x376942,[_0xa8e4('0x65'),'id'])||{},{'fields':_[_0xa8e4('0x3c')](_0x46b377),'raw':!![]})[_0xa8e4('0x2c')](function(_0x4e8aad){_0xc030e6[_0xa8e4('0x6d')][_0xa8e4('0x6e')](_0x4e8aad[_0xa8e4('0x6f')]);})[_0xa8e4('0x54')](function(_0x90f703){_0xc030e6[_0xa8e4('0x70')][_0xa8e4('0x6e')]({'data':_0x376942,'error':_0x90f703[_0xa8e4('0x71')]});});})['then'](function(_0x11883d){return _0xc030e6;})[_0xa8e4('0x54')](function(_0x870083){return _0x870083;});}else{_0x3107f2[_0xa8e4('0x21')](0x190)[_0xa8e4('0x22')]({'message':_0xa8e4('0x72')});}});}})[_0xa8e4('0x2c')](respondWithResult(_0x3107f2,null))['catch'](handleError(_0x3107f2,null));};exports[_0xa8e4('0x73')]=function(_0x32cd83,_0x24dfe2,_0x164792){var _0x5f4955;return db[_0xa8e4('0x4a')][_0xa8e4('0x53')]({'where':{'id':_0x32cd83['params']['id']},'include':[{'model':db[_0xa8e4('0x74')],'as':_0xa8e4('0x75')}]})[_0xa8e4('0x2c')](handleEntityNotFound(_0x24dfe2,null))[_0xa8e4('0x2c')](function(_0x28ec0b){if(_0x28ec0b){_0x5f4955=_0x28ec0b;return db[_0xa8e4('0x67')][_0xa8e4('0x38')];}})['then'](function(_0x5970f5){if(_0x5970f5){var _0x9e7d7f={};var _0x386985={};_0x386985[_0xa8e4('0x3b')]=_[_0xa8e4('0x76')](_[_0xa8e4('0x3c')](_0x5970f5),_[_0xa8e4('0x37')](_0x5f4955[_0xa8e4('0x75')],function(_0x57c3c9){return util[_0xa8e4('0x77')](_0xa8e4('0x78'),_0x57c3c9['id']);}));_0x386985[_0xa8e4('0x3d')]=_[_0xa8e4('0x3c')](_0x32cd83[_0xa8e4('0x3d')]);_0x386985[_0xa8e4('0x3e')]=_[_0xa8e4('0x3f')](_0x386985[_0xa8e4('0x3b')],_0x386985[_0xa8e4('0x3d')]);_0x9e7d7f[_0xa8e4('0x40')]=_[_0xa8e4('0x3f')](_0x386985[_0xa8e4('0x3b')],qs[_0xa8e4('0x41')](_0x32cd83[_0xa8e4('0x3d')]['fields']));_0x9e7d7f[_0xa8e4('0x40')]=_0x9e7d7f['attributes'][_0xa8e4('0x51')]?_0x9e7d7f['attributes']:_0x386985['model'];if(!_0x32cd83[_0xa8e4('0x3d')]['hasOwnProperty'](_0xa8e4('0x43'))){_0x9e7d7f[_0xa8e4('0x26')]=qs['limit'](_0x32cd83[_0xa8e4('0x3d')][_0xa8e4('0x26')]);_0x9e7d7f[_0xa8e4('0x23')]=qs[_0xa8e4('0x23')](_0x32cd83['query'][_0xa8e4('0x23')]);}_0x9e7d7f[_0xa8e4('0x44')]=qs[_0xa8e4('0x45')](_0x32cd83[_0xa8e4('0x3d')][_0xa8e4('0x45')]);_0x9e7d7f['where']=qs[_0xa8e4('0x3e')](_[_0xa8e4('0x47')](_0x32cd83[_0xa8e4('0x3d')],_0x386985['filters']));_0x9e7d7f['raw']=!![];if(_0x32cd83[_0xa8e4('0x3d')][_0xa8e4('0x48')]){_0x9e7d7f[_0xa8e4('0x46')]=_[_0xa8e4('0x49')](_0x9e7d7f[_0xa8e4('0x46')],{'$or':_[_0xa8e4('0x37')](_0x9e7d7f[_0xa8e4('0x40')],function(_0x2110b7){var _0x2904e5={};_0x2904e5[_0x2110b7]={'$like':'%'+_0x32cd83[_0xa8e4('0x3d')]['filter']+'%'};return _0x2904e5;})});}_0x9e7d7f=_[_0xa8e4('0x49')]({},_0x9e7d7f,_0x32cd83[_0xa8e4('0x52')]);return _0x5f4955['getContacts'](_0x9e7d7f);}})[_0xa8e4('0x2c')](respondWithResult(_0x24dfe2,null))['catch'](handleError(_0x24dfe2,null));};exports[_0xa8e4('0x79')]=function(_0xfbf4a1,_0x472b5f,_0x195014){var _0x3af77f;var _0x5b0eea;var _0x373167;var _0x1ba737=_0xfbf4a1[_0xa8e4('0x50')]['id'];csv_results=[];return db[_0xa8e4('0x7a')]['findAll']({'attributes':['id','name'],'raw':!![],'order':[_0xa8e4('0x7b')]})[_0xa8e4('0x2c')](function(_0xc57481){_0x3af77f=_0xc57481;var _0x162c43=_[_0xa8e4('0x3c')](db[_0xa8e4('0x67')][_0xa8e4('0x38')]);return db[_0xa8e4('0x74')][_0xa8e4('0x4d')]({'raw':!![],'attributes':['id','alias']})[_0xa8e4('0x2c')](function(_0x1515b8){_0x5b0eea=_0x1515b8;var _0x5975e5=squel[_0xa8e4('0x7c')]()[_0xa8e4('0x41')](_0x162c43)[_0xa8e4('0x7d')](_0xa8e4('0x7e'),'c')[_0xa8e4('0x46')](_0xa8e4('0x7f'),_0x1ba737)[_0xa8e4('0x46')](_0xa8e4('0x80'))[_0xa8e4('0x81')]();for(var _0x4a2e08=0x0;_0x4a2e08<_0x5b0eea[_0xa8e4('0x51')];_0x4a2e08++){_0x5975e5[_0xa8e4('0x82')]('c.cf_'+_0x5b0eea[_0x4a2e08]['id'],'customField_'+_0x5b0eea[_0x4a2e08]['alias']);}for(var _0x4a2e08=0x0;_0x4a2e08<_0x3af77f['length'];_0x4a2e08++){_0x5975e5[_0xa8e4('0x82')](squel[_0xa8e4('0x7c')]()[_0xa8e4('0x82')](_0xa8e4('0x83'))[_0xa8e4('0x7d')](_0xa8e4('0x84'))['where'](_0xa8e4('0x85'),_0x3af77f[_0x4a2e08]['id'])['where'](_0xa8e4('0x86')),_0xa8e4('0x87')+_0x3af77f[_0x4a2e08][_0xa8e4('0x34')]);_0x5975e5[_0xa8e4('0x82')](squel[_0xa8e4('0x7c')]()[_0xa8e4('0x82')](_0xa8e4('0x88'))['from']('cm_contact_has_items')['where']('ItemTypeId\x20=\x20?',_0x3af77f[_0x4a2e08]['id'])[_0xa8e4('0x46')](_0xa8e4('0x86')),_0xa8e4('0x89')+_0x3af77f[_0x4a2e08][_0xa8e4('0x34')]);}var _0x47bc0b=[];_0x47bc0b[_0xa8e4('0x6e')](_0x5975e5[_0xa8e4('0x8a')]());BPromise['each'](_0x47bc0b,handleQuery)[_0xa8e4('0x2c')](function(_0xdcf4ec){handleQuery(_0x5975e5[_0xa8e4('0x8a')]());var _0x53c8d8=csv_results[0x0];if(!_['isEmpty'](_0x53c8d8)){var _0x11ccae=toCsv(_0x53c8d8);var _0x1aebf4=Date[_0xa8e4('0x8b')]();fs[_0xa8e4('0x8c')](util[_0xa8e4('0x77')]('/tmp/list_%d_%s.csv',_0x1ba737,_0x1aebf4),_0x11ccae);_0x472b5f['setHeader']('Content-disposition',_0xa8e4('0x8d')+util[_0xa8e4('0x77')](_0xa8e4('0x8e'),_0x1ba737,_0x1aebf4));_0x472b5f[_0xa8e4('0x8f')](_0xa8e4('0x90'),_0xa8e4('0x91'));return _0x472b5f[_0xa8e4('0x92')](util[_0xa8e4('0x77')](_0xa8e4('0x93'),_0x1ba737,_0x1aebf4));}else{return _0x472b5f['sendStatus'](0xcc);}});});});};exports[_0xa8e4('0x94')]=function(_0x2ac525,_0x2182a4,_0x4a74ab){var _0x544456;delete _0x2ac525[_0xa8e4('0x56')]['id'];return db['CmList'][_0xa8e4('0x63')]({'where':{'id':_0x2ac525[_0xa8e4('0x50')]['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x2182a4,null))[_0xa8e4('0x2c')](function(_0x4b2a93){if(_0x4b2a93){return db['sequelize']['transaction'](function(_0x2f2cea){return db[_0xa8e4('0x74')][_0xa8e4('0x55')](_0x2ac525[_0xa8e4('0x56')],{'transaction':_0x2f2cea})['then'](function(_0x5631ed){_0x544456=_0x5631ed;return _0x4b2a93[_0xa8e4('0x95')](_0x5631ed,{'transaction':_0x2f2cea});})['then'](function(){var _0x239e28={'type':db[_0xa8e4('0x96')][_0xa8e4('0x97')],'transaction':_0x2f2cea};switch(_0x2ac525[_0xa8e4('0x56')][_0xa8e4('0x3a')]){case'text':_0x239e28[_0xa8e4('0x3a')]=db[_0xa8e4('0x96')][_0xa8e4('0x97')];break;case _0xa8e4('0x98'):_0x239e28[_0xa8e4('0x3a')]=db[_0xa8e4('0x96')]['INTEGER'];break;case _0xa8e4('0x99'):_0x239e28[_0xa8e4('0x3a')]=db[_0xa8e4('0x96')][_0xa8e4('0x9a')];_0x239e28[_0xa8e4('0x9b')]=![];break;default:}return db[_0xa8e4('0x9c')][_0xa8e4('0x9d')][_0xa8e4('0x9e')](_0xa8e4('0x7e'),util[_0xa8e4('0x77')](_0xa8e4('0x9f'),_0x544456['id']),_0x239e28);})[_0xa8e4('0x2c')](function(){return _0x544456;});});}})[_0xa8e4('0x2c')](respondWithResult(_0x2182a4,null))['catch'](handleError(_0x2182a4,null));};exports[_0xa8e4('0xa0')]=function(_0x238c4f,_0x521bce,_0x19e891){var _0x2d3b42={};var _0x47da50={};var _0x5162a4;var _0x329a91;return db['CmList']['findOne']({'where':{'id':_0x238c4f['params']['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x521bce,null))[_0xa8e4('0x2c')](function(_0xd2bc86){if(_0xd2bc86){_0x5162a4=_0xd2bc86;_0x47da50[_0xa8e4('0x3b')]=_[_0xa8e4('0x3c')](db[_0xa8e4('0x74')][_0xa8e4('0x38')]);_0x47da50['query']=_['keys'](_0x238c4f['query']);_0x47da50[_0xa8e4('0x3e')]=_[_0xa8e4('0x3f')](_0x47da50[_0xa8e4('0x3b')],_0x47da50[_0xa8e4('0x3d')]);_0x2d3b42[_0xa8e4('0x40')]=_['intersection'](_0x47da50['model'],qs['fields'](_0x238c4f[_0xa8e4('0x3d')][_0xa8e4('0x41')]));_0x2d3b42[_0xa8e4('0x40')]=_0x2d3b42[_0xa8e4('0x40')][_0xa8e4('0x51')]?_0x2d3b42[_0xa8e4('0x40')]:_0x47da50[_0xa8e4('0x3b')];_0x2d3b42[_0xa8e4('0x44')]=qs[_0xa8e4('0x45')](_0x238c4f['query'][_0xa8e4('0x45')]);_0x2d3b42[_0xa8e4('0x46')]=qs[_0xa8e4('0x3e')](_[_0xa8e4('0x47')](_0x238c4f[_0xa8e4('0x3d')],_0x47da50[_0xa8e4('0x3e')]));_0x2d3b42[_0xa8e4('0x46')]=_[_0xa8e4('0x49')](_0x2d3b42['where'],{'$or':[{'ListId':_0xd2bc86['id']},{'ListId':null}]});if(_0x238c4f['query']['filter']){_0x2d3b42['where']=_[_0xa8e4('0x49')](_0x2d3b42['where'],{'$or':_[_0xa8e4('0x37')](_0x2d3b42['attributes'],function(_0x148d3e){var _0x28f2d8={};_0x28f2d8[_0x148d3e]={'$like':'%'+_0x238c4f[_0xa8e4('0x3d')][_0xa8e4('0x48')]+'%'};return _0x28f2d8;})});}_0x2d3b42=_[_0xa8e4('0x49')]({},_0x2d3b42,_0x238c4f[_0xa8e4('0x52')]);return db[_0xa8e4('0x74')][_0xa8e4('0xa1')](_0x2d3b42);}})[_0xa8e4('0x2c')](respondWithResult(_0x521bce,null))[_0xa8e4('0x54')](handleError(_0x521bce,null));};exports['getGlobalCustomFields']=function(_0x328013,_0x1d336d){return db[_0xa8e4('0x74')]['findAndCountAll']({'where':{'ListId':null}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x1d336d,null))[_0xa8e4('0x2c')](function(_0x20031f){return _0x20031f;})['then'](respondWithResult(_0x1d336d,null))[_0xa8e4('0x54')](handleError(_0x1d336d,null));};exports[_0xa8e4('0xa2')]=function(_0x531c7b,_0x467e5a,_0x532b8e){return db[_0xa8e4('0x4a')][_0xa8e4('0x53')]({'where':{'id':_0x531c7b[_0xa8e4('0x50')]['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0x467e5a,null))[_0xa8e4('0x2c')](function(_0x36330b){if(_0x36330b){return _0x36330b[_0xa8e4('0xa2')](_0x531c7b[_0xa8e4('0x56')]['ids'],_[_0xa8e4('0x6c')](_0x531c7b[_0xa8e4('0x56')],[_0xa8e4('0x65'),'id'])||{})['spread'](function(_0x34b852){for(var _0x36a2f1=0x0;_0x36a2f1<_0x531c7b['body'][_0xa8e4('0x65')][_0xa8e4('0x51')];_0x36a2f1+=0x1){socket[_0xa8e4('0xa3')]('userCmList:save',{'UserId':Number(_0x531c7b[_0xa8e4('0x56')]['ids'][_0x36a2f1]),'CmListId':Number(_0x531c7b[_0xa8e4('0x50')]['id'])});}return _0x34b852;});}})[_0xa8e4('0x2c')](respondWithResult(_0x467e5a,null))[_0xa8e4('0x54')](handleError(_0x467e5a,null));};exports[_0xa8e4('0xa4')]=function(_0x1bd1ef,_0xd1f221,_0x54b245){return db[_0xa8e4('0x4a')][_0xa8e4('0x53')]({'where':{'id':_0x1bd1ef['params']['id']}})[_0xa8e4('0x2c')](handleEntityNotFound(_0xd1f221,null))[_0xa8e4('0x2c')](function(_0x22d272){if(_0x22d272){return _0x22d272['removeAgents'](_0x1bd1ef[_0xa8e4('0x3d')][_0xa8e4('0x65')])['then'](function(){if(_[_0xa8e4('0x6a')](_0x1bd1ef[_0xa8e4('0x3d')][_0xa8e4('0x65')])){for(var _0x37056a=0x0;_0x37056a<_0x1bd1ef[_0xa8e4('0x3d')][_0xa8e4('0x65')][_0xa8e4('0x51')];_0x37056a+=0x1){socket[_0xa8e4('0xa3')](_0xa8e4('0xa5'),{'UserId':Number(_0x1bd1ef[_0xa8e4('0x3d')][_0xa8e4('0x65')][_0x37056a]),'CmListId':Number(_0x1bd1ef['params']['id'])});}}else{socket['emit'](_0xa8e4('0xa5'),{'UserId':Number(_0x1bd1ef['query'][_0xa8e4('0x65')]),'CmListId':Number(_0x1bd1ef[_0xa8e4('0x50')]['id'])});}});}})[_0xa8e4('0x2c')](respondWithStatusCode(_0xd1f221,null))[_0xa8e4('0x54')](handleError(_0xd1f221,null));};exports[_0xa8e4('0xa6')]=function(_0x293fb7,_0x92ad37,_0x6e6580){var _0x1e6857={};var _0x241299={};var _0x56776d;var _0x522841;return db[_0xa8e4('0x4a')]['findOne']({'where':{'id':_0x293fb7[_0xa8e4('0x50')]['id']}})['then'](handleEntityNotFound(_0x92ad37,null))[_0xa8e4('0x2c')](function(_0x14f5d1){if(_0x14f5d1){_0x56776d=_0x14f5d1;_0x241299['model']=_['keys'](db[_0xa8e4('0xa7')][_0xa8e4('0x38')]);_0x241299['query']=_['keys'](_0x293fb7[_0xa8e4('0x3d')]);_0x241299['filters']=_['intersection'](_0x241299[_0xa8e4('0x3b')],_0x241299[_0xa8e4('0x3d')]);_0x1e6857[_0xa8e4('0x40')]=_[_0xa8e4('0x3f')](_0x241299[_0xa8e4('0x3b')],qs[_0xa8e4('0x41')](_0x293fb7[_0xa8e4('0x3d')][_0xa8e4('0x41')]));_0x1e6857[_0xa8e4('0x40')]=_0x1e6857[_0xa8e4('0x40')]['length']?_0x1e6857[_0xa8e4('0x40')]:_0x241299[_0xa8e4('0x3b')];_0x1e6857['order']=qs[_0xa8e4('0x45')](_0x293fb7['query']['sort']);_0x1e6857[_0xa8e4('0x46')]=qs[_0xa8e4('0x3e')](_[_0xa8e4('0x47')](_0x293fb7[_0xa8e4('0x3d')],_0x241299['filters']));if(_0x293fb7[_0xa8e4('0x3d')][_0xa8e4('0x48')]){_0x1e6857[_0xa8e4('0x46')]=_[_0xa8e4('0x49')](_0x1e6857[_0xa8e4('0x46')],{'$or':_['map'](_0x1e6857[_0xa8e4('0x40')],function(_0x2b80bb){var _0x243eba={};_0x243eba[_0x2b80bb]={'$like':'%'+_0x293fb7[_0xa8e4('0x3d')][_0xa8e4('0x48')]+'%'};return _0x243eba;})});}_0x1e6857=_[_0xa8e4('0x49')]({},_0x1e6857,_0x293fb7[_0xa8e4('0x52')]);return _0x56776d[_0xa8e4('0xa6')](_0x1e6857);}})[_0xa8e4('0x2c')](function(_0x1f2545){if(_0x1f2545){_0x522841=_0x1f2545['length'];if(!_0x293fb7[_0xa8e4('0x3d')][_0xa8e4('0x42')](_0xa8e4('0x43'))){_0x1e6857[_0xa8e4('0x26')]=qs[_0xa8e4('0x26')](_0x293fb7[_0xa8e4('0x3d')][_0xa8e4('0x26')]);_0x1e6857[_0xa8e4('0x23')]=qs[_0xa8e4('0x23')](_0x293fb7['query'][_0xa8e4('0x23')]);}return _0x56776d[_0xa8e4('0xa6')](_0x1e6857);}})[_0xa8e4('0x2c')](function(_0x43978a){if(_0x43978a){return _0x43978a?{'count':_0x522841,'rows':_0x43978a}:null;}})[_0xa8e4('0x2c')](respondWithResult(_0x92ad37,null))[_0xa8e4('0x54')](handleError(_0x92ad37,null));};function handleQuery(_0x16733e){logger[_0xa8e4('0xa8')](_0x16733e);return db['sequelize'][_0xa8e4('0x3d')](_0x16733e)[_0xa8e4('0xa9')](function(_0x4f1a28){csv_results[_0xa8e4('0x6e')](_0x4f1a28);})[_0xa8e4('0x54')](function(_0x14d99c){logger[_0xa8e4('0x32')](_0x14d99c[_0xa8e4('0x71')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index c6e6133..5f6f43c 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 _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x5fc3,0xa8));var _0x35fc=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x5fc3[_0x336376];return _0x1d2a8e;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x2f1753,_0x458f6d){var _0x56a164=function(_0x1e36dd){while(--_0x1e36dd){_0x2f1753['push'](_0x2f1753['shift']());}};_0x56a164(++_0x458f6d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 d9678e9..31707a1 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 _0x878f=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x878f,0x173));var _0xf878=function(_0x4ff69c,_0x5069a6){_0x4ff69c=_0x4ff69c-0x0;var _0x26c499=_0x878f[_0x4ff69c];return _0x26c499;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var BPromise=require(_0xf878('0x4'));var rp=require(_0xf878('0x5'));var fs=require('fs');var path=require(_0xf878('0x6'));var rimraf=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var attributes=require(_0xf878('0x9'));module[_0xf878('0xa')]=function(_0x4bc9aa,_0x4ac8d8){return _0x4bc9aa[_0xf878('0xb')](_0xf878('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd28=['rimraf','./cmList.attributes','exports','define','util','../../config/logger','moment','request-promise','path'];(function(_0x241858,_0x2ea379){var _0x4c0761=function(_0x63f6fd){while(--_0x63f6fd){_0x241858['push'](_0x241858['shift']());}};_0x4c0761(++_0x2ea379);}(_0xfd28,0x148));var _0x8fd2=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0xfd28[_0x30182f];return _0x5207db;};'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 diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 0238828..fce9bbf 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 _0xfd57=['defaults','localhost','socket.io-emitter','./cmList.socket','then','info','CmList,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis'];(function(_0x5c8d20,_0x49078d){var _0xe4b028=function(_0x7e534){while(--_0x7e534){_0x5c8d20['push'](_0x5c8d20['shift']());}};_0xe4b028(++_0x49078d);}(_0xfd57,0xe6));var _0x7fd5=function(_0x2d58f6,_0x1408ec){_0x2d58f6=_0x2d58f6-0x0;var _0x31a7a2=_0xfd57[_0x2d58f6];return _0x31a7a2;};'use strict';var _=require('lodash');var util=require(_0x7fd5('0x0'));var moment=require(_0x7fd5('0x1'));var BPromise=require(_0x7fd5('0x2'));var rs=require(_0x7fd5('0x3'));var fs=require('fs');var Redis=require(_0x7fd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7fd5('0x5'));var logger=require('../../config/logger')(_0x7fd5('0x6'));var config=require('../../config/environment');var jayson=require(_0x7fd5('0x7'));var client=jayson[_0x7fd5('0x8')]['http']({'port':0x232a});config[_0x7fd5('0x9')]=_[_0x7fd5('0xa')](config[_0x7fd5('0x9')],{'host':_0x7fd5('0xb'),'port':0x18eb});var socket=require(_0x7fd5('0xc'))(new Redis(config['redis']));require(_0x7fd5('0xd'))['register'](socket);function respondWithRpcPromise(_0x3fef89,_0x1ec3dd,_0x3926cc){return new BPromise(function(_0x34b99b,_0x448393){return client['request'](_0x3fef89,_0x3926cc)[_0x7fd5('0xe')](function(_0x16c1ae){logger[_0x7fd5('0xf')](_0x7fd5('0x10'),_0x1ec3dd,_0x7fd5('0x11'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x1ec3dd,'request\x20sent',JSON[_0x7fd5('0x12')](_0x16c1ae));if(_0x16c1ae[_0x7fd5('0x13')]){if(_0x16c1ae['error'][_0x7fd5('0x14')]===0x1f4){logger['error'](_0x7fd5('0x10'),_0x1ec3dd,_0x16c1ae[_0x7fd5('0x13')][_0x7fd5('0x15')]);return _0x448393(_0x16c1ae[_0x7fd5('0x13')]['message']);}logger[_0x7fd5('0x13')](_0x7fd5('0x10'),_0x1ec3dd,_0x16c1ae[_0x7fd5('0x13')][_0x7fd5('0x15')]);return _0x34b99b(_0x16c1ae[_0x7fd5('0x13')]['message']);}else{logger['info'](_0x7fd5('0x10'),_0x1ec3dd,_0x7fd5('0x11'));_0x34b99b(_0x16c1ae[_0x7fd5('0x16')][_0x7fd5('0x15')]);}})[_0x7fd5('0x17')](function(_0x35a0e9){logger['error']('CmList,\x20%s,\x20%s',_0x1ec3dd,_0x35a0e9);_0x448393(_0x35a0e9);});});} \ No newline at end of file +var _0x13bb=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','then','CmList,\x20%s,\x20%s'];(function(_0x2c8534,_0x18d56b){var _0x58a2c6=function(_0xcbd162){while(--_0xcbd162){_0x2c8534['push'](_0x2c8534['shift']());}};_0x58a2c6(++_0x18d56b);}(_0x13bb,0x1e3));var _0xb13b=function(_0x486e56,_0x39eff8){_0x486e56=_0x486e56-0x0;var _0x489279=_0x13bb[_0x486e56];return _0x489279;};'use strict';var _=require(_0xb13b('0x0'));var util=require(_0xb13b('0x1'));var moment=require('moment');var BPromise=require(_0xb13b('0x2'));var rs=require(_0xb13b('0x3'));var fs=require('fs');var Redis=require(_0xb13b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb13b('0x5'))(_0xb13b('0x6'));var config=require(_0xb13b('0x7'));var jayson=require(_0xb13b('0x8'));var client=jayson['client'][_0xb13b('0x9')]({'port':0x232a});config[_0xb13b('0xa')]=_[_0xb13b('0xb')](config[_0xb13b('0xa')],{'host':_0xb13b('0xc'),'port':0x18eb});var socket=require(_0xb13b('0xd'))(new Redis(config[_0xb13b('0xa')]));require(_0xb13b('0xe'))['register'](socket);function respondWithRpcPromise(_0x46d423,_0x885cdb,_0x4df6f5){return new BPromise(function(_0x5eec6c,_0x1fb6af){return client['request'](_0x46d423,_0x4df6f5)[_0xb13b('0xf')](function(_0x28a985){logger['info'](_0xb13b('0x10'),_0x885cdb,_0xb13b('0x11'));logger[_0xb13b('0x12')](_0xb13b('0x13'),_0x885cdb,_0xb13b('0x11'),JSON['stringify'](_0x28a985));if(_0x28a985[_0xb13b('0x14')]){if(_0x28a985[_0xb13b('0x14')]['code']===0x1f4){logger['error'](_0xb13b('0x10'),_0x885cdb,_0x28a985[_0xb13b('0x14')][_0xb13b('0x15')]);return _0x1fb6af(_0x28a985[_0xb13b('0x14')]['message']);}logger[_0xb13b('0x14')](_0xb13b('0x10'),_0x885cdb,_0x28a985[_0xb13b('0x14')]['message']);return _0x5eec6c(_0x28a985[_0xb13b('0x14')]['message']);}else{logger[_0xb13b('0x16')](_0xb13b('0x10'),_0x885cdb,_0xb13b('0x11'));_0x5eec6c(_0x28a985[_0xb13b('0x17')][_0xb13b('0x15')]);}})[_0xb13b('0x18')](function(_0x15e26e){logger[_0xb13b('0x14')](_0xb13b('0x10'),_0x885cdb,_0x15e26e);_0x1fb6af(_0x15e26e);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 5b6e45d..7fa169f 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 _0x070b=['cmList:','./cmList.events','emit','removeListener'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x070b,0x1bd));var _0xb070=function(_0x5af8f8,_0x51110d){_0x5af8f8=_0x5af8f8-0x0;var _0xd900f7=_0x070b[_0x5af8f8];return _0xd900f7;};'use strict';var CmListEvents=require(_0xb070('0x0'));var events=['save','remove','update'];function createListener(_0x2934b3,_0x269215){return function(_0x5166f5){_0x269215[_0xb070('0x1')](_0x2934b3,_0x5166f5);};}function removeListener(_0x16a436,_0x2fb6c0){return function(){CmListEvents[_0xb070('0x2')](_0x16a436,_0x2fb6c0);};}exports['register']=function(_0x2680c2){for(var _0x5eb312=0x0,_0x589915=events['length'];_0x5eb312<_0x589915;_0x5eb312++){var _0x3d1453=events[_0x5eb312];var _0x1f49b0=createListener(_0xb070('0x3')+_0x3d1453,_0x2680c2);CmListEvents['on'](_0x3d1453,_0x1f49b0);}}; \ No newline at end of file +var _0xd3dd=['removeListener','length','./cmList.events','save','update'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0xd3dd,0x1ba));var _0xdd3d=function(_0xa2b6e2,_0x25629d){_0xa2b6e2=_0xa2b6e2-0x0;var _0x43594a=_0xd3dd[_0xa2b6e2];return _0x43594a;};'use strict';var CmListEvents=require(_0xdd3d('0x0'));var events=[_0xdd3d('0x1'),'remove',_0xdd3d('0x2')];function createListener(_0x5153bf,_0x28622e){return function(_0x4b3e32){_0x28622e['emit'](_0x5153bf,_0x4b3e32);};}function removeListener(_0x5489e1,_0x440546){return function(){CmListEvents[_0xdd3d('0x3')](_0x5489e1,_0x440546);};}exports['register']=function(_0x306e7b){for(var _0x46d378=0x0,_0x5c2235=events[_0xdd3d('0x4')];_0x46d378<_0x5c2235;_0x46d378++){var _0x3a6a1f=events[_0x46d378];var _0x173f6c=createListener('cmList:'+_0x3a6a1f,_0x306e7b);CmListEvents['on'](_0x3a6a1f,_0x173f6c);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 1cc2d55..f5d4b1e 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 _0x0844=['/:id/fields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','./cmList.controller','get','index','isAuthenticated','describe','/global_fields','getGlobalCustomFields','show','getDispositions','/:id/contacts','getContactsCsv'];(function(_0x18c618,_0x484959){var _0x4c1381=function(_0x53e849){while(--_0x53e849){_0x18c618['push'](_0x18c618['shift']());}};_0x4c1381(++_0x484959);}(_0x0844,0xc1));var _0x4084=function(_0x38b0ab,_0x2b7d14){_0x38b0ab=_0x38b0ab-0x0;var _0x51c38d=_0x0844[_0x38b0ab];return _0x51c38d;};'use strict';var multer=require(_0x4084('0x0'));var util=require(_0x4084('0x1'));var path=require(_0x4084('0x2'));var timeout=require(_0x4084('0x3'));var express=require(_0x4084('0x4'));var router=express['Router']();var fs_extra=require(_0x4084('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4084('0x6'));router[_0x4084('0x7')]('/',auth['isAuthenticated'](),controller[_0x4084('0x8')]);router[_0x4084('0x7')]('/describe',auth[_0x4084('0x9')](),controller[_0x4084('0xa')]);router[_0x4084('0x7')](_0x4084('0xb'),auth[_0x4084('0x9')](),controller[_0x4084('0xc')]);router[_0x4084('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4084('0xd')]);router['get']('/:id/dispositions',auth[_0x4084('0x9')](),controller[_0x4084('0xe')]);router['get'](_0x4084('0xf'),auth[_0x4084('0x9')](),controller['getContacts']);router['get']('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x4084('0x10')]);router['get'](_0x4084('0x11'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x4084('0x7')](_0x4084('0x12'),auth[_0x4084('0x9')](),controller[_0x4084('0x13')]);router[_0x4084('0x14')]('/',auth[_0x4084('0x9')](),controller[_0x4084('0x15')]);router[_0x4084('0x14')](_0x4084('0x16'),auth[_0x4084('0x9')](),controller[_0x4084('0x17')]);router['post']('/:id/contacts',auth[_0x4084('0x9')](),controller[_0x4084('0x18')]);router[_0x4084('0x14')](_0x4084('0x11'),auth['isAuthenticated'](),controller[_0x4084('0x19')]);router[_0x4084('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x4084('0x1a')]);router[_0x4084('0x1b')](_0x4084('0x1c'),auth['isAuthenticated'](),controller[_0x4084('0x1d')]);router['delete']('/:id',auth[_0x4084('0x9')](),controller[_0x4084('0x1e')]);router[_0x4084('0x1f')](_0x4084('0x16'),auth[_0x4084('0x9')](),controller[_0x4084('0x20')]);router[_0x4084('0x1f')](_0x4084('0x12'),auth[_0x4084('0x9')](),controller[_0x4084('0x21')]);module[_0x4084('0x22')]=router; \ No newline at end of file +var _0x88e9=['/:id/fields','getCustomFields','/:id/users','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv'];(function(_0x2d6141,_0x189922){var _0xbc02da=function(_0x1d7ddb){while(--_0x1d7ddb){_0x2d6141['push'](_0x2d6141['shift']());}};_0xbc02da(++_0x189922);}(_0x88e9,0x141));var _0x988e=function(_0x593eca,_0x5733e7){_0x593eca=_0x593eca-0x0;var _0x5aa415=_0x88e9[_0x593eca];return _0x5aa415;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x988e('0x0'));var timeout=require(_0x988e('0x1'));var express=require(_0x988e('0x2'));var router=express[_0x988e('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x988e('0x4'));var config=require(_0x988e('0x5'));var controller=require(_0x988e('0x6'));router[_0x988e('0x7')]('/',auth[_0x988e('0x8')](),controller['index']);router['get'](_0x988e('0x9'),auth[_0x988e('0x8')](),controller[_0x988e('0xa')]);router[_0x988e('0x7')](_0x988e('0xb'),auth[_0x988e('0x8')](),controller[_0x988e('0xc')]);router[_0x988e('0x7')](_0x988e('0xd'),auth[_0x988e('0x8')](),controller[_0x988e('0xe')]);router[_0x988e('0x7')](_0x988e('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x988e('0x7')](_0x988e('0x10'),auth[_0x988e('0x8')](),controller['getContacts']);router[_0x988e('0x7')](_0x988e('0x11'),auth['isAuthenticated'](),controller[_0x988e('0x12')]);router[_0x988e('0x7')](_0x988e('0x13'),auth['isAuthenticated'](),controller[_0x988e('0x14')]);router[_0x988e('0x7')](_0x988e('0x15'),auth[_0x988e('0x8')](),controller['getAgents']);router[_0x988e('0x16')]('/',auth[_0x988e('0x8')](),controller['create']);router['post'](_0x988e('0xf'),auth['isAuthenticated'](),controller[_0x988e('0x17')]);router[_0x988e('0x16')](_0x988e('0x10'),auth[_0x988e('0x8')](),controller[_0x988e('0x18')]);router['post'](_0x988e('0x13'),auth[_0x988e('0x8')](),controller[_0x988e('0x19')]);router[_0x988e('0x16')](_0x988e('0x15'),auth[_0x988e('0x8')](),controller[_0x988e('0x1a')]);router[_0x988e('0x1b')](_0x988e('0xd'),auth[_0x988e('0x8')](),controller[_0x988e('0x1c')]);router[_0x988e('0x1d')](_0x988e('0xd'),auth['isAuthenticated'](),controller[_0x988e('0x1e')]);router[_0x988e('0x1d')](_0x988e('0xf'),auth[_0x988e('0x8')](),controller[_0x988e('0x1f')]);router[_0x988e('0x1d')](_0x988e('0x15'),auth[_0x988e('0x8')](),controller[_0x988e('0x20')]);module[_0x988e('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index a9b70e7..c9a9a0a 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 _0x56f9=['VIRTUAL','STRING','sequelize','exports'];(function(_0x152e53,_0xf6761e){var _0x37a703=function(_0x553962){while(--_0x553962){_0x152e53['push'](_0x152e53['shift']());}};_0x37a703(++_0xf6761e);}(_0x56f9,0x10a));var _0x956f=function(_0xb2133b,_0x277c58){_0xb2133b=_0xb2133b-0x0;var _0x257df6=_0x56f9[_0xb2133b];return _0x257df6;};'use strict';var Sequelize=require(_0x956f('0x0'));module[_0x956f('0x1')]={'name':{'type':Sequelize[_0x956f('0x2')],'get':function(_0x10a5ab){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x956f('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x956f('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x956f('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x42f3=['VIRTUAL','field','STRING','sequelize','exports'];(function(_0x28258a,_0x22f398){var _0x4e968e=function(_0xda8c73){while(--_0xda8c73){_0x28258a['push'](_0x28258a['shift']());}};_0x4e968e(++_0x22f398);}(_0x42f3,0x1a2));var _0x342f=function(_0x5c6ceb,_0x4ed099){_0x5c6ceb=_0x5c6ceb-0x0;var _0x28821b=_0x42f3[_0x5c6ceb];return _0x28821b;};'use strict';var Sequelize=require(_0x342f('0x0'));module[_0x342f('0x1')]={'name':{'type':Sequelize[_0x342f('0x2')],'get':function(_0x5dde8f){return this['getDataValue'](_0x342f('0x3'));}},'field':{'type':Sequelize[_0x342f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x342f('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 2272879..1d6504e 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(_0x49d1f7,_0x442482){var _0x56b11c=function(_0x45c15e){while(--_0x45c15e){_0x49d1f7['push'](_0x49d1f7['shift']());}};_0x56b11c(++_0x442482);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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(_0x524a45,_0xc5493a){var _0x5bd1d4=function(_0x5f56ef){while(--_0x5f56ef){_0x524a45['push'](_0x524a45['shift']());}};_0x5bd1d4(++_0xc5493a);}(_0x7a54,0x106));var _0x47a5=function(_0xce3844,_0x35966a){_0xce3844=_0xce3844-0x0;var _0x5a2cc7=_0x7a54[_0xce3844];return _0x5a2cc7;};'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 be34db3..dea577f 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 _0x024f=['path','./condition.attributes','exports','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3f503c,_0x212ce4){var _0x1e9eae=function(_0x137c35){while(--_0x137c35){_0x3f503c['push'](_0x3f503c['shift']());}};_0x1e9eae(++_0x212ce4);}(_0x024f,0x16d));var _0xf024=function(_0x262548,_0x43479b){_0x262548=_0x262548-0x0;var _0x495d88=_0x024f[_0x262548];return _0x495d88;};'use strict';var _=require(_0xf024('0x0'));var util=require(_0xf024('0x1'));var logger=require(_0xf024('0x2'))(_0xf024('0x3'));var moment=require(_0xf024('0x4'));var BPromise=require(_0xf024('0x5'));var rp=require(_0xf024('0x6'));var fs=require('fs');var path=require(_0xf024('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf024('0x8'));module[_0xf024('0x9')]=function(_0x31f341,_0x2ed270){return _0x31f341['define'](_0xf024('0xa'),attributes,{'tableName':_0xf024('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcac2=['rimraf','../../config/environment','./condition.attributes','define','tools_conditions','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3a05a6,_0x5a2916){var _0x55a922=function(_0x333dd2){while(--_0x333dd2){_0x3a05a6['push'](_0x3a05a6['shift']());}};_0x55a922(++_0x5a2916);}(_0xcac2,0x16d));var _0x2cac=function(_0x1d7d16,_0x141a09){_0x1d7d16=_0x1d7d16-0x0;var _0x1f7da4=_0xcac2[_0x1d7d16];return _0x1f7da4;};'use strict';var _=require(_0x2cac('0x0'));var util=require(_0x2cac('0x1'));var logger=require(_0x2cac('0x2'))('api');var moment=require(_0x2cac('0x3'));var BPromise=require(_0x2cac('0x4'));var rp=require(_0x2cac('0x5'));var fs=require('fs');var path=require(_0x2cac('0x6'));var rimraf=require(_0x2cac('0x7'));var config=require(_0x2cac('0x8'));var attributes=require(_0x2cac('0x9'));module['exports']=function(_0x27df6a,_0x3b7ea5){return _0x27df6a[_0x2cac('0xa')]('Condition',attributes,{'tableName':_0x2cac('0xb'),'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 c47da0a..ffc192c 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 _0xf49a=['result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3ff4a3,_0xa5bfa6){var _0x38676f=function(_0x3ab2b1){while(--_0x3ab2b1){_0x3ff4a3['push'](_0x3ff4a3['shift']());}};_0x38676f(++_0xa5bfa6);}(_0xf49a,0x1f0));var _0xaf49=function(_0x4694a0,_0x35b97f){_0x4694a0=_0x4694a0-0x0;var _0x38a2dc=_0xf49a[_0x4694a0];return _0x38a2dc;};'use strict';var _=require('lodash');var util=require(_0xaf49('0x0'));var moment=require('moment');var BPromise=require(_0xaf49('0x1'));var rs=require(_0xaf49('0x2'));var fs=require('fs');var Redis=require(_0xaf49('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf49('0x4'));var logger=require(_0xaf49('0x5'))(_0xaf49('0x6'));var config=require('../../config/environment');var jayson=require(_0xaf49('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x125384,_0x22c468,_0x3ba11c){return new BPromise(function(_0x3c889c,_0x54be90){return client['request'](_0x125384,_0x3ba11c)[_0xaf49('0x8')](function(_0xd6ffe4){logger[_0xaf49('0x9')](_0xaf49('0xa'),_0x22c468,_0xaf49('0xb'));logger[_0xaf49('0xc')](_0xaf49('0xd'),_0x22c468,_0xaf49('0xb'),JSON['stringify'](_0xd6ffe4));if(_0xd6ffe4[_0xaf49('0xe')]){if(_0xd6ffe4['error'][_0xaf49('0xf')]===0x1f4){logger[_0xaf49('0xe')]('Condition,\x20%s,\x20%s',_0x22c468,_0xd6ffe4[_0xaf49('0xe')][_0xaf49('0x10')]);return _0x54be90(_0xd6ffe4[_0xaf49('0xe')][_0xaf49('0x10')]);}logger['error'](_0xaf49('0xa'),_0x22c468,_0xd6ffe4['error']['message']);return _0x3c889c(_0xd6ffe4[_0xaf49('0xe')]['message']);}else{logger[_0xaf49('0x9')](_0xaf49('0xa'),_0x22c468,_0xaf49('0xb'));_0x3c889c(_0xd6ffe4[_0xaf49('0x11')][_0xaf49('0x10')]);}})[_0xaf49('0x12')](function(_0x1cc6fd){logger['error'](_0xaf49('0xa'),_0x22c468,_0x1cc6fd);_0x54be90(_0x1cc6fd);});});} \ No newline at end of file +var _0x4c70=['Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','debug'];(function(_0x172ed7,_0x3d08fd){var _0xfa8f61=function(_0xe07a21){while(--_0xe07a21){_0x172ed7['push'](_0x172ed7['shift']());}};_0xfa8f61(++_0x3d08fd);}(_0x4c70,0x11c));var _0x04c7=function(_0x68b90b,_0xb8b06a){_0x68b90b=_0x68b90b-0x0;var _0x5220ec=_0x4c70[_0x68b90b];return _0x5220ec;};'use strict';var _=require(_0x04c7('0x0'));var util=require(_0x04c7('0x1'));var moment=require(_0x04c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x04c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x04c7('0x4'));var logger=require(_0x04c7('0x5'))('rpc');var config=require(_0x04c7('0x6'));var jayson=require(_0x04c7('0x7'));var client=jayson[_0x04c7('0x8')][_0x04c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41ed5f,_0x268738,_0x347bcf){return new BPromise(function(_0x389010,_0x43c0d8){return client[_0x04c7('0xa')](_0x41ed5f,_0x347bcf)[_0x04c7('0xb')](function(_0x360c1b){logger[_0x04c7('0xc')](_0x04c7('0xd'),_0x268738,'request\x20sent');logger[_0x04c7('0xe')](_0x04c7('0xf'),_0x268738,_0x04c7('0x10'),JSON[_0x04c7('0x11')](_0x360c1b));if(_0x360c1b[_0x04c7('0x12')]){if(_0x360c1b[_0x04c7('0x12')][_0x04c7('0x13')]===0x1f4){logger['error'](_0x04c7('0xd'),_0x268738,_0x360c1b[_0x04c7('0x12')][_0x04c7('0x14')]);return _0x43c0d8(_0x360c1b[_0x04c7('0x12')]['message']);}logger[_0x04c7('0x12')](_0x04c7('0xd'),_0x268738,_0x360c1b['error']['message']);return _0x389010(_0x360c1b['error'][_0x04c7('0x14')]);}else{logger[_0x04c7('0xc')](_0x04c7('0xd'),_0x268738,_0x04c7('0x10'));_0x389010(_0x360c1b[_0x04c7('0x15')][_0x04c7('0x14')]);}})[_0x04c7('0x16')](function(_0x26bce5){logger[_0x04c7('0x12')](_0x04c7('0xd'),_0x268738,_0x26bce5);_0x43c0d8(_0x26bce5);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 20697bd..27746e1 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 _0x1ebb=['update','delete','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./condition.controller','put','/:id'];(function(_0x2eac4f,_0x5173f9){var _0x58f73b=function(_0x529f28){while(--_0x529f28){_0x2eac4f['push'](_0x2eac4f['shift']());}};_0x58f73b(++_0x5173f9);}(_0x1ebb,0x75));var _0xb1eb=function(_0x5bfae8,_0x471a61){_0x5bfae8=_0x5bfae8-0x0;var _0x51dd7b=_0x1ebb[_0x5bfae8];return _0x51dd7b;};'use strict';var multer=require('multer');var util=require(_0xb1eb('0x0'));var path=require(_0xb1eb('0x1'));var timeout=require(_0xb1eb('0x2'));var express=require(_0xb1eb('0x3'));var router=express[_0xb1eb('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb1eb('0x5'));var controller=require(_0xb1eb('0x6'));router[_0xb1eb('0x7')](_0xb1eb('0x8'),auth['isAuthenticated'](),controller[_0xb1eb('0x9')]);router[_0xb1eb('0xa')](_0xb1eb('0x8'),auth[_0xb1eb('0xb')](),controller[_0xb1eb('0xc')]);module[_0xb1eb('0xd')]=router; \ No newline at end of file +var _0xaf10=['update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id'];(function(_0x521b9e,_0x57c611){var _0x4d5275=function(_0x33de8a){while(--_0x33de8a){_0x521b9e['push'](_0x521b9e['shift']());}};_0x4d5275(++_0x57c611);}(_0xaf10,0x94));var _0x0af1=function(_0x36690b,_0x12e879){_0x36690b=_0x36690b-0x0;var _0x45d7dd=_0xaf10[_0x36690b];return _0x45d7dd;};'use strict';var multer=require(_0x0af1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0af1('0x1'));var express=require(_0x0af1('0x2'));var router=express[_0x0af1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0af1('0x4'));var interaction=require(_0x0af1('0x5'));var config=require(_0x0af1('0x6'));var controller=require('./condition.controller');router['put'](_0x0af1('0x7'),auth['isAuthenticated'](),controller[_0x0af1('0x8')]);router[_0x0af1('0x9')](_0x0af1('0x7'),auth['isAuthenticated'](),controller[_0x0af1('0xa')]);module[_0x0af1('0xb')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index d25a681..dc192c3 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 _0xa0f7=['name','INTEGER','STRING'];(function(_0x1247a8,_0x16755c){var _0x2daeaf=function(_0x28db82){while(--_0x28db82){_0x1247a8['push'](_0x1247a8['shift']());}};_0x2daeaf(++_0x16755c);}(_0xa0f7,0xba));var _0x7a0f=function(_0x4bbbb7,_0x331854){_0x4bbbb7=_0x4bbbb7-0x0;var _0x1c8926=_0xa0f7[_0x4bbbb7];return _0x1c8926;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7a0f('0x0')},'OrderBy':{'type':Sequelize[_0x7a0f('0x1')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x7a0f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x3a04=['exports','STRING','name','INTEGER','sequelize'];(function(_0xe6f1a1,_0x5c2fe7){var _0x3304bd=function(_0x36e633){while(--_0x36e633){_0xe6f1a1['push'](_0xe6f1a1['shift']());}};_0x3304bd(++_0x5c2fe7);}(_0x3a04,0x15d));var _0x43a0=function(_0x10e988,_0x272453){_0x10e988=_0x10e988-0x0;var _0x37ed93=_0x3a04[_0x10e988];return _0x37ed93;};'use strict';var Sequelize=require(_0x43a0('0x0'));module[_0x43a0('0x1')]={'name':{'type':Sequelize[_0x43a0('0x2')],'allowNull':![],'unique':_0x43a0('0x3')},'OrderBy':{'type':Sequelize[_0x43a0('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x43a0('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 ce63746..4c6f199 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 _0x5fdc=['destroy','get','ContactItemTypes','error','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','catch','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then'];(function(_0x31e945,_0x42fa0c){var _0x5a110e=function(_0x15e817){while(--_0x15e817){_0x31e945['push'](_0x31e945['shift']());}};_0x5a110e(++_0x42fa0c);}(_0x5fdc,0x127));var _0xc5fd=function(_0x1eccf3,_0x21d021){_0x1eccf3=_0x1eccf3-0x0;var _0x442a61=_0x5fdc[_0x1eccf3];return _0x442a61;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558939,_0x1b1b2b){_0x1b1b2b=_0x1b1b2b||0xcc;return function(_0x1bc6d1){if(_0x1bc6d1){return _0x558939[_0xc5fd('0x19')](_0x1b1b2b);}return _0x558939[_0xc5fd('0x1a')](_0x1b1b2b)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x40b0f8,_0x27447e){_0x27447e=_0x27447e||0xc8;return function(_0xa7a954){if(_0xa7a954){return _0x40b0f8['status'](_0x27447e)[_0xc5fd('0x1c')](_0xa7a954);}};}function respondWithFilteredResult(_0x103c3d,_0x2221da){return function(_0x3404e0){if(_0x3404e0){var _0x4d3636=typeof _0x2221da['offset']==='undefined'&&typeof _0x2221da['limit']==='undefined';var _0x35a9d0=_0x3404e0[_0xc5fd('0x1d')];var _0x27f611=_0x4d3636?0x0:_0x2221da[_0xc5fd('0x1e')];var _0x2ee392=_0x4d3636?_0x3404e0[_0xc5fd('0x1d')]:_0x2221da[_0xc5fd('0x1e')]+_0x2221da['limit'];var _0xb7bab1;if(_0x2ee392>=_0x35a9d0){_0x2ee392=_0x35a9d0;_0xb7bab1=0xc8;}else{_0xb7bab1=0xce;}_0x103c3d[_0xc5fd('0x1a')](_0xb7bab1);return _0x103c3d[_0xc5fd('0x1f')](_0xc5fd('0x20'),_0x27f611+'-'+_0x2ee392+'/'+_0x35a9d0)[_0xc5fd('0x1c')](_0x3404e0);}return null;};}function patchUpdates(_0x48024e){return function(_0x3966a2){try{jsonpatch[_0xc5fd('0x21')](_0x3966a2,_0x48024e,!![]);}catch(_0x18048e){return BPromise[_0xc5fd('0x22')](_0x18048e);}return _0x3966a2['save']();};}function saveUpdates(_0x4c85d5,_0x13cc42){return function(_0x2ab935){if(_0x2ab935){return _0x2ab935[_0xc5fd('0x23')](_0x4c85d5)[_0xc5fd('0x24')](function(_0x334401){return _0x334401;});}return null;};}function removeEntity(_0x311952,_0x56d473){return function(_0x1a3f21){if(_0x1a3f21){return _0x1a3f21[_0xc5fd('0x25')]()[_0xc5fd('0x24')](function(){var _0x18c9c7=_0x1a3f21[_0xc5fd('0x26')]({'plain':!![]});var _0x4020af=_0xc5fd('0x27');return db['UserProfileResource'][_0xc5fd('0x25')]({'where':{'type':_0x4020af,'resourceId':_0x18c9c7['id']}})['then'](function(){return _0x1a3f21;});})[_0xc5fd('0x24')](function(){_0x311952[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x2bee22,_0x5cafd3){return function(_0x176313){if(!_0x176313){_0x2bee22[_0xc5fd('0x19')](0x194);}return _0x176313;};}function handleError(_0x19c4a0,_0x42cbf0){_0x42cbf0=_0x42cbf0||0x1f4;return function(_0x19df33){logger[_0xc5fd('0x28')](_0x19df33['stack']);if(_0x19df33[_0xc5fd('0x29')]){delete _0x19df33['name'];}_0x19c4a0['status'](_0x42cbf0)[_0xc5fd('0x2a')](_0x19df33);};}exports[_0xc5fd('0x2b')]=function(_0x39b21a,_0x38db1d){var _0x7693c4={},_0x85fa81={},_0x2a891d={'count':0x0,'rows':[]};var _0x321eea=_['map'](db[_0xc5fd('0x2c')][_0xc5fd('0x2d')],function(_0x6bb14d){return{'name':_0x6bb14d[_0xc5fd('0x2e')],'type':_0x6bb14d[_0xc5fd('0x2f')][_0xc5fd('0x30')]};});_0x85fa81[_0xc5fd('0x31')]=_[_0xc5fd('0x32')](_0x321eea,_0xc5fd('0x29'));_0x85fa81[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x39b21a[_0xc5fd('0x33')]);_0x85fa81['filters']=_[_0xc5fd('0x35')](_0x85fa81[_0xc5fd('0x31')],_0x85fa81[_0xc5fd('0x33')]);_0x7693c4[_0xc5fd('0x36')]=_[_0xc5fd('0x35')](_0x85fa81[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x37')]));_0x7693c4['attributes']=_0x7693c4[_0xc5fd('0x36')][_0xc5fd('0x38')]?_0x7693c4[_0xc5fd('0x36')]:_0x85fa81[_0xc5fd('0x31')];if(!_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x39')](_0xc5fd('0x3a'))){_0x7693c4['limit']=qs[_0xc5fd('0x3b')](_0x39b21a[_0xc5fd('0x33')]['limit']);_0x7693c4[_0xc5fd('0x1e')]=qs['offset'](_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x1e')]);}_0x7693c4[_0xc5fd('0x3c')]=qs['sort'](_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x3d')]);_0x7693c4['where']=qs[_0xc5fd('0x3e')](_[_0xc5fd('0x3f')](_0x39b21a[_0xc5fd('0x33')],_0x85fa81[_0xc5fd('0x3e')]),_0x321eea);if(_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x40')]){_0x7693c4['where']=_[_0xc5fd('0x41')](_0x7693c4[_0xc5fd('0x42')],{'$or':_[_0xc5fd('0x32')](_0x321eea,function(_0x2a368e){if(_0x2a368e['type']!=='VIRTUAL'){var _0x47fe66={};_0x47fe66[_0x2a368e[_0xc5fd('0x29')]]={'$like':'%'+_0x39b21a[_0xc5fd('0x33')][_0xc5fd('0x40')]+'%'};return _0x47fe66;}})});}_0x7693c4=_[_0xc5fd('0x41')]({},_0x7693c4,_0x39b21a[_0xc5fd('0x43')]);var _0x33514d={'where':_0x7693c4[_0xc5fd('0x42')]};return db[_0xc5fd('0x2c')][_0xc5fd('0x1d')](_0x33514d)['then'](function(_0x5a2199){_0x2a891d[_0xc5fd('0x1d')]=_0x5a2199;if(_0x39b21a['query'][_0xc5fd('0x44')]){_0x7693c4[_0xc5fd('0x45')]=[{'all':!![]}];}return db[_0xc5fd('0x2c')]['findAll'](_0x7693c4);})[_0xc5fd('0x24')](function(_0x350753){_0x2a891d['rows']=_0x350753;return _0x2a891d;})[_0xc5fd('0x24')](respondWithFilteredResult(_0x38db1d,_0x7693c4))[_0xc5fd('0x46')](handleError(_0x38db1d,null));};exports['show']=function(_0x3e57da,_0x48c8d4){var _0x1297a1={'raw':!![],'where':{'id':_0x3e57da['params']['id']}},_0x17ce12={};_0x17ce12[_0xc5fd('0x31')]=_[_0xc5fd('0x34')](db[_0xc5fd('0x2c')]['rawAttributes']);_0x17ce12[_0xc5fd('0x33')]=_[_0xc5fd('0x34')](_0x3e57da['query']);_0x17ce12['filters']=_[_0xc5fd('0x35')](_0x17ce12['model'],_0x17ce12['query']);_0x1297a1['attributes']=_[_0xc5fd('0x35')](_0x17ce12[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x3e57da[_0xc5fd('0x33')][_0xc5fd('0x37')]));_0x1297a1[_0xc5fd('0x36')]=_0x1297a1['attributes']['length']?_0x1297a1['attributes']:_0x17ce12[_0xc5fd('0x31')];if(_0x3e57da[_0xc5fd('0x33')][_0xc5fd('0x44')]){_0x1297a1['include']=[{'all':!![]}];}_0x1297a1=_[_0xc5fd('0x41')]({},_0x1297a1,_0x3e57da['options']);return db[_0xc5fd('0x2c')][_0xc5fd('0x47')](_0x1297a1)[_0xc5fd('0x24')](handleEntityNotFound(_0x48c8d4,null))[_0xc5fd('0x24')](respondWithResult(_0x48c8d4,null))[_0xc5fd('0x46')](handleError(_0x48c8d4,null));};exports[_0xc5fd('0x48')]=function(_0x54d86c,_0x6b2f77){return db[_0xc5fd('0x2c')]['create'](_0x54d86c['body'],{})[_0xc5fd('0x24')](function(_0x4eb26b){var _0x5723cb=_0x54d86c[_0xc5fd('0x49')][_0xc5fd('0x26')]({'plain':!![]});if(!_0x5723cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5723cb[_0xc5fd('0x4a')]===_0xc5fd('0x49')){var _0x5c49e7=_0x4eb26b[_0xc5fd('0x26')]({'plain':!![]});var _0x346718=_0xc5fd('0x27');return db[_0xc5fd('0x4b')][_0xc5fd('0x47')]({'where':{'name':_0x346718,'userProfileId':_0x5723cb[_0xc5fd('0x4c')]},'raw':!![]})[_0xc5fd('0x24')](function(_0x26bae0){if(_0x26bae0&&_0x26bae0[_0xc5fd('0x4d')]===0x0){return db[_0xc5fd('0x4e')][_0xc5fd('0x48')]({'name':_0x5c49e7['name'],'resourceId':_0x5c49e7['id'],'type':_0x26bae0[_0xc5fd('0x29')],'sectionId':_0x26bae0['id']},{})[_0xc5fd('0x24')](function(){return _0x4eb26b;});}else{return _0x4eb26b;}})[_0xc5fd('0x46')](function(_0x4989ce){logger[_0xc5fd('0x28')](_0xc5fd('0x4f'),_0x4989ce);throw _0x4989ce;});}return _0x4eb26b;})[_0xc5fd('0x24')](respondWithResult(_0x6b2f77,0xc9))[_0xc5fd('0x46')](handleError(_0x6b2f77,null));};exports['update']=function(_0xcbd63b,_0x5b5ecd){if(_0xcbd63b['body']['id']){delete _0xcbd63b[_0xc5fd('0x50')]['id'];}return db[_0xc5fd('0x2c')][_0xc5fd('0x47')]({'where':{'id':_0xcbd63b[_0xc5fd('0x51')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x5b5ecd,null))['then'](saveUpdates(_0xcbd63b['body'],null))[_0xc5fd('0x24')](respondWithResult(_0x5b5ecd,null))[_0xc5fd('0x46')](handleError(_0x5b5ecd,null));};exports['destroy']=function(_0x4e9495,_0x50e0c7){return db[_0xc5fd('0x2c')]['find']({'where':{'id':_0x4e9495[_0xc5fd('0x51')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x50e0c7,null))[_0xc5fd('0x24')](db[_0xc5fd('0x52')][_0xc5fd('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4e9495[_0xc5fd('0x51')]['id']}}))[_0xc5fd('0x24')](removeEntity(_0x50e0c7,null))['catch'](handleError(_0x50e0c7,null));}; \ No newline at end of file +var _0x5f2f=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','ContactItemType','includeAll','catch','show','params','length','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','CmContactHasItem','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','get','ContactItemTypes','UserProfileResource','destroy','stack','name','index','map'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4331ad,_0x5b92ef){_0x4331ad=_0x4331ad-0x0;var _0x5d0f04=_0x5f2f[_0x4331ad];return _0x5d0f04;};'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(){var _0x5f1124=_0x287ad5[_0xf5f2('0x25')]({'plain':!![]});var _0x13da6f=_0xf5f2('0x26');return db[_0xf5f2('0x27')][_0xf5f2('0x28')]({'where':{'type':_0x13da6f,'resourceId':_0x5f1124['id']}})[_0xf5f2('0x24')](function(){return _0x287ad5;});})[_0xf5f2('0x24')](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa2602,_0x102449){return function(_0x375ca8){if(!_0x375ca8){_0xaa2602[_0xf5f2('0x18')](0x194);}return _0x375ca8;};}function handleError(_0x198c73,_0x477604){_0x477604=_0x477604||0x1f4;return function(_0x5b6672){logger['error'](_0x5b6672[_0xf5f2('0x29')]);if(_0x5b6672[_0xf5f2('0x2a')]){delete _0x5b6672[_0xf5f2('0x2a')];}_0x198c73['status'](_0x477604)['send'](_0x5b6672);};}exports[_0xf5f2('0x2b')]=function(_0x50b8a2,_0x17394a){var _0x153924={},_0x1b381e={},_0x54c0c8={'count':0x0,'rows':[]};var _0x52e959=_[_0xf5f2('0x2c')](db['ContactItemType'][_0xf5f2('0x2d')],function(_0x58a4df){return{'name':_0x58a4df[_0xf5f2('0x2e')],'type':_0x58a4df[_0xf5f2('0x2f')][_0xf5f2('0x30')]};});_0x1b381e[_0xf5f2('0x31')]=_[_0xf5f2('0x2c')](_0x52e959,_0xf5f2('0x2a'));_0x1b381e[_0xf5f2('0x32')]=_[_0xf5f2('0x33')](_0x50b8a2['query']);_0x1b381e[_0xf5f2('0x34')]=_[_0xf5f2('0x35')](_0x1b381e[_0xf5f2('0x31')],_0x1b381e[_0xf5f2('0x32')]);_0x153924[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x1b381e[_0xf5f2('0x31')],qs['fields'](_0x50b8a2[_0xf5f2('0x32')][_0xf5f2('0x37')]));_0x153924['attributes']=_0x153924[_0xf5f2('0x36')]['length']?_0x153924[_0xf5f2('0x36')]:_0x1b381e[_0xf5f2('0x31')];if(!_0x50b8a2[_0xf5f2('0x32')][_0xf5f2('0x38')]('nolimit')){_0x153924['limit']=qs[_0xf5f2('0x1d')](_0x50b8a2[_0xf5f2('0x32')][_0xf5f2('0x1d')]);_0x153924['offset']=qs[_0xf5f2('0x1b')](_0x50b8a2['query'][_0xf5f2('0x1b')]);}_0x153924['order']=qs[_0xf5f2('0x39')](_0x50b8a2[_0xf5f2('0x32')]['sort']);_0x153924[_0xf5f2('0x3a')]=qs[_0xf5f2('0x34')](_[_0xf5f2('0x3b')](_0x50b8a2[_0xf5f2('0x32')],_0x1b381e['filters']),_0x52e959);if(_0x50b8a2['query'][_0xf5f2('0x3c')]){_0x153924[_0xf5f2('0x3a')]=_[_0xf5f2('0x3d')](_0x153924[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2c')](_0x52e959,function(_0xe62b57){if(_0xe62b57[_0xf5f2('0x2f')]!=='VIRTUAL'){var _0x110fe5={};_0x110fe5[_0xe62b57[_0xf5f2('0x2a')]]={'$like':'%'+_0x50b8a2['query'][_0xf5f2('0x3c')]+'%'};return _0x110fe5;}})});}_0x153924=_[_0xf5f2('0x3d')]({},_0x153924,_0x50b8a2[_0xf5f2('0x3e')]);var _0x85b6d0={'where':_0x153924[_0xf5f2('0x3a')]};return db[_0xf5f2('0x3f')][_0xf5f2('0x1e')](_0x85b6d0)[_0xf5f2('0x24')](function(_0x574f24){_0x54c0c8[_0xf5f2('0x1e')]=_0x574f24;if(_0x50b8a2[_0xf5f2('0x32')][_0xf5f2('0x40')]){_0x153924['include']=[{'all':!![]}];}return db['ContactItemType']['findAll'](_0x153924);})[_0xf5f2('0x24')](function(_0x2ad13c){_0x54c0c8['rows']=_0x2ad13c;return _0x54c0c8;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x17394a,_0x153924))[_0xf5f2('0x41')](handleError(_0x17394a,null));};exports[_0xf5f2('0x42')]=function(_0x31f86c,_0x354c34){var _0x2b3b1c={'raw':!![],'where':{'id':_0x31f86c[_0xf5f2('0x43')]['id']}},_0x1a6ec1={};_0x1a6ec1[_0xf5f2('0x31')]=_[_0xf5f2('0x33')](db[_0xf5f2('0x3f')][_0xf5f2('0x2d')]);_0x1a6ec1[_0xf5f2('0x32')]=_[_0xf5f2('0x33')](_0x31f86c['query']);_0x1a6ec1[_0xf5f2('0x34')]=_['intersection'](_0x1a6ec1[_0xf5f2('0x31')],_0x1a6ec1[_0xf5f2('0x32')]);_0x2b3b1c[_0xf5f2('0x36')]=_[_0xf5f2('0x35')](_0x1a6ec1[_0xf5f2('0x31')],qs[_0xf5f2('0x37')](_0x31f86c['query'][_0xf5f2('0x37')]));_0x2b3b1c[_0xf5f2('0x36')]=_0x2b3b1c[_0xf5f2('0x36')][_0xf5f2('0x44')]?_0x2b3b1c[_0xf5f2('0x36')]:_0x1a6ec1[_0xf5f2('0x31')];if(_0x31f86c[_0xf5f2('0x32')][_0xf5f2('0x40')]){_0x2b3b1c['include']=[{'all':!![]}];}_0x2b3b1c=_[_0xf5f2('0x3d')]({},_0x2b3b1c,_0x31f86c[_0xf5f2('0x3e')]);return db[_0xf5f2('0x3f')]['find'](_0x2b3b1c)[_0xf5f2('0x24')](handleEntityNotFound(_0x354c34,null))[_0xf5f2('0x24')](respondWithResult(_0x354c34,null))[_0xf5f2('0x41')](handleError(_0x354c34,null));};exports['create']=function(_0x57a7cb,_0x7bb942){return db[_0xf5f2('0x3f')]['create'](_0x57a7cb[_0xf5f2('0x45')],{})['then'](function(_0x740321){var _0x497eb8=_0x57a7cb[_0xf5f2('0x46')]['get']({'plain':!![]});if(!_0x497eb8)throw new Error(_0xf5f2('0x47'));if(_0x497eb8[_0xf5f2('0x48')]===_0xf5f2('0x46')){var _0x11a083=_0x740321['get']({'plain':!![]});var _0x3154c1=_0xf5f2('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x3154c1,'userProfileId':_0x497eb8[_0xf5f2('0x49')]},'raw':!![]})[_0xf5f2('0x24')](function(_0x57782c){if(_0x57782c&&_0x57782c[_0xf5f2('0x4a')]===0x0){return db[_0xf5f2('0x27')][_0xf5f2('0x4b')]({'name':_0x11a083[_0xf5f2('0x2a')],'resourceId':_0x11a083['id'],'type':_0x57782c['name'],'sectionId':_0x57782c['id']},{})['then'](function(){return _0x740321;});}else{return _0x740321;}})[_0xf5f2('0x41')](function(_0xa3cc67){logger['error'](_0xf5f2('0x4c'),_0xa3cc67);throw _0xa3cc67;});}return _0x740321;})[_0xf5f2('0x24')](respondWithResult(_0x7bb942,0xc9))[_0xf5f2('0x41')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x4d')]=function(_0x2b038e,_0x73c9f1){if(_0x2b038e[_0xf5f2('0x45')]['id']){delete _0x2b038e['body']['id'];}return db['ContactItemType'][_0xf5f2('0x4e')]({'where':{'id':_0x2b038e[_0xf5f2('0x43')]['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x73c9f1,null))[_0xf5f2('0x24')](saveUpdates(_0x2b038e[_0xf5f2('0x45')],null))['then'](respondWithResult(_0x73c9f1,null))[_0xf5f2('0x41')](handleError(_0x73c9f1,null));};exports[_0xf5f2('0x28')]=function(_0x18b124,_0x519c24){return db[_0xf5f2('0x3f')]['find']({'where':{'id':_0x18b124[_0xf5f2('0x43')]['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x519c24,null))[_0xf5f2('0x24')](db[_0xf5f2('0x4f')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x18b124['params']['id']}}))[_0xf5f2('0x24')](removeEntity(_0x519c24,null))['catch'](handleError(_0x519c24,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 3099b58..d94d1c0 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 _0x90e7=['request-promise','path','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x46439c,_0x2fa662){var _0x5a6eae=function(_0x61fa9a){while(--_0x61fa9a){_0x46439c['push'](_0x46439c['shift']());}};_0x5a6eae(++_0x2fa662);}(_0x90e7,0x14a));var _0x790e=function(_0x1319a0,_0x893f48){_0x1319a0=_0x1319a0-0x0;var _0x5c86e4=_0x90e7[_0x1319a0];return _0x5c86e4;};'use strict';var _=require(_0x790e('0x0'));var util=require(_0x790e('0x1'));var logger=require(_0x790e('0x2'))(_0x790e('0x3'));var moment=require(_0x790e('0x4'));var BPromise=require(_0x790e('0x5'));var rp=require(_0x790e('0x6'));var fs=require('fs');var path=require(_0x790e('0x7'));var rimraf=require('rimraf');var config=require(_0x790e('0x8'));var attributes=require(_0x790e('0x9'));module[_0x790e('0xa')]=function(_0x250c6a,_0x1b3a8b){return _0x250c6a[_0x790e('0xb')](_0x790e('0xc'),attributes,{'tableName':_0x790e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa799=['path','rimraf','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','bluebird','request-promise'];(function(_0xe80458,_0x5b168f){var _0x25f4ba=function(_0x5753d5){while(--_0x5753d5){_0xe80458['push'](_0xe80458['shift']());}};_0x25f4ba(++_0x5b168f);}(_0xa799,0x1cf));var _0x9a79=function(_0x1fd7f2,_0x4ad5ec){_0x1fd7f2=_0x1fd7f2-0x0;var _0x4bea8b=_0xa799[_0x1fd7f2];return _0x4bea8b;};'use strict';var _=require('lodash');var util=require(_0x9a79('0x0'));var logger=require(_0x9a79('0x1'))(_0x9a79('0x2'));var moment=require('moment');var BPromise=require(_0x9a79('0x3'));var rp=require(_0x9a79('0x4'));var fs=require('fs');var path=require(_0x9a79('0x5'));var rimraf=require(_0x9a79('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a79('0x7'));module[_0x9a79('0x8')]=function(_0x497948,_0x1e07a1){return _0x497948[_0x9a79('0x9')](_0x9a79('0xa'),attributes,{'tableName':_0x9a79('0xb'),'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 68cfab4..a2b9ed0 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 _0x5228=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x5228,0xcc));var _0x8522=function(_0x5f414a,_0x58572e){_0x5f414a=_0x5f414a-0x0;var _0x38688d=_0x5228[_0x5f414a];return _0x38688d;};'use strict';var _=require(_0x8522('0x0'));var util=require(_0x8522('0x1'));var moment=require(_0x8522('0x2'));var BPromise=require(_0x8522('0x3'));var rs=require(_0x8522('0x4'));var fs=require('fs');var Redis=require(_0x8522('0x5'));var db=require(_0x8522('0x6'))['db'];var utils=require(_0x8522('0x7'));var logger=require('../../config/logger')(_0x8522('0x8'));var config=require(_0x8522('0x9'));var jayson=require(_0x8522('0xa'));var client=jayson[_0x8522('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cb4fb,_0x2dc5c2,_0x3a2d74){return new BPromise(function(_0x589b0a,_0x1ee542){return client[_0x8522('0xc')](_0x3cb4fb,_0x3a2d74)[_0x8522('0xd')](function(_0x41e8b2){logger[_0x8522('0xe')](_0x8522('0xf'),_0x2dc5c2,_0x8522('0x10'));logger[_0x8522('0x11')](_0x8522('0x12'),_0x2dc5c2,'request\x20sent',JSON[_0x8522('0x13')](_0x41e8b2));if(_0x41e8b2[_0x8522('0x14')]){if(_0x41e8b2[_0x8522('0x14')][_0x8522('0x15')]===0x1f4){logger[_0x8522('0x14')]('ContactItemType,\x20%s,\x20%s',_0x2dc5c2,_0x41e8b2[_0x8522('0x14')]['message']);return _0x1ee542(_0x41e8b2[_0x8522('0x14')]['message']);}logger['error']('ContactItemType,\x20%s,\x20%s',_0x2dc5c2,_0x41e8b2[_0x8522('0x14')][_0x8522('0x16')]);return _0x589b0a(_0x41e8b2[_0x8522('0x14')][_0x8522('0x16')]);}else{logger[_0x8522('0xe')]('ContactItemType,\x20%s,\x20%s',_0x2dc5c2,'request\x20sent');_0x589b0a(_0x41e8b2[_0x8522('0x17')]['message']);}})[_0x8522('0x18')](function(_0x1e8d83){logger['error'](_0x8522('0xf'),_0x2dc5c2,_0x1e8d83);_0x1ee542(_0x1e8d83);});});} \ No newline at end of file +var _0x3d09=['info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x42f087,_0x55123b){var _0x11a7f1=function(_0x35198){while(--_0x35198){_0x42f087['push'](_0x42f087['shift']());}};_0x11a7f1(++_0x55123b);}(_0x3d09,0x8c));var _0x93d0=function(_0x1aecf9,_0x79221f){_0x1aecf9=_0x1aecf9-0x0;var _0x626323=_0x3d09[_0x1aecf9];return _0x626323;};'use strict';var _=require(_0x93d0('0x0'));var util=require('util');var moment=require(_0x93d0('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93d0('0x2'));var db=require(_0x93d0('0x3'))['db'];var utils=require(_0x93d0('0x4'));var logger=require(_0x93d0('0x5'))(_0x93d0('0x6'));var config=require(_0x93d0('0x7'));var jayson=require(_0x93d0('0x8'));var client=jayson[_0x93d0('0x9')][_0x93d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e68f2,_0x33f55f,_0xd9caea){return new BPromise(function(_0x5998e5,_0x2c5898){return client['request'](_0x5e68f2,_0xd9caea)[_0x93d0('0xb')](function(_0x560a28){logger[_0x93d0('0xc')](_0x93d0('0xd'),_0x33f55f,_0x93d0('0xe'));logger['debug'](_0x93d0('0xf'),_0x33f55f,_0x93d0('0xe'),JSON[_0x93d0('0x10')](_0x560a28));if(_0x560a28[_0x93d0('0x11')]){if(_0x560a28[_0x93d0('0x11')]['code']===0x1f4){logger['error'](_0x93d0('0xd'),_0x33f55f,_0x560a28['error'][_0x93d0('0x12')]);return _0x2c5898(_0x560a28[_0x93d0('0x11')][_0x93d0('0x12')]);}logger[_0x93d0('0x11')](_0x93d0('0xd'),_0x33f55f,_0x560a28[_0x93d0('0x11')][_0x93d0('0x12')]);return _0x5998e5(_0x560a28[_0x93d0('0x11')]['message']);}else{logger[_0x93d0('0xc')](_0x93d0('0xd'),_0x33f55f,_0x93d0('0xe'));_0x5998e5(_0x560a28['result'][_0x93d0('0x12')]);}})['catch'](function(_0x1645b7){logger[_0x93d0('0x11')](_0x93d0('0xd'),_0x33f55f,_0x1645b7);_0x2c5898(_0x1645b7);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ffd9914..c17e847 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 _0xb370=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','isAuthenticated','get','/:id','show','post','update','delete','destroy','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb370,0x10e));var _0x0b37=function(_0x1e29b9,_0x2144a3){_0x1e29b9=_0x1e29b9-0x0;var _0x2e3cfd=_0xb370[_0x1e29b9];return _0x2e3cfd;};'use strict';var multer=require(_0x0b37('0x0'));var util=require('util');var path=require(_0x0b37('0x1'));var timeout=require(_0x0b37('0x2'));var express=require(_0x0b37('0x3'));var router=express['Router']();var fs_extra=require(_0x0b37('0x4'));var auth=require(_0x0b37('0x5'));var interaction=require(_0x0b37('0x6'));var config=require(_0x0b37('0x7'));var controller=require(_0x0b37('0x8'));router['get']('/',auth[_0x0b37('0x9')](),controller['index']);router[_0x0b37('0xa')](_0x0b37('0xb'),auth[_0x0b37('0x9')](),controller[_0x0b37('0xc')]);router[_0x0b37('0xd')]('/',auth[_0x0b37('0x9')](),controller['create']);router['put'](_0x0b37('0xb'),auth[_0x0b37('0x9')](),controller[_0x0b37('0xe')]);router[_0x0b37('0xf')](_0x0b37('0xb'),auth[_0x0b37('0x9')](),controller[_0x0b37('0x10')]);module[_0x0b37('0x11')]=router; \ No newline at end of file +var _0x205a=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports'];(function(_0x4637ea,_0x2589ee){var _0x1e6e1e=function(_0x1ee10a){while(--_0x1ee10a){_0x4637ea['push'](_0x4637ea['shift']());}};_0x1e6e1e(++_0x2589ee);}(_0x205a,0xbe));var _0xa205=function(_0x357cc9,_0x4aba29){_0x357cc9=_0x357cc9-0x0;var _0x41977a=_0x205a[_0x357cc9];return _0x41977a;};'use strict';var multer=require(_0xa205('0x0'));var util=require(_0xa205('0x1'));var path=require(_0xa205('0x2'));var timeout=require(_0xa205('0x3'));var express=require(_0xa205('0x4'));var router=express[_0xa205('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa205('0x6'));var config=require(_0xa205('0x7'));var controller=require(_0xa205('0x8'));router[_0xa205('0x9')]('/',auth[_0xa205('0xa')](),controller[_0xa205('0xb')]);router[_0xa205('0x9')](_0xa205('0xc'),auth[_0xa205('0xa')](),controller[_0xa205('0xd')]);router[_0xa205('0xe')]('/',auth[_0xa205('0xa')](),controller[_0xa205('0xf')]);router['put'](_0xa205('0xc'),auth[_0xa205('0xa')](),controller[_0xa205('0x10')]);router[_0xa205('0x11')](_0xa205('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa205('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 94c492e..2e69ef1 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 _0xe706=['STRING','sequelize','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe706,0xa3));var _0x6e70=function(_0x155924,_0x2a5368){_0x155924=_0x155924-0x0;var _0x262e4b=_0xe706[_0x155924];return _0x262e4b;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index feacfa0..c83db9a 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 _0x2124=['params','length','include','find','catch','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','iframe','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','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChatWebsites','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','DashboardItem','getItems','pick','filter','hasOwnProperty','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','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','defaults','redis','localhost','socket.io-emitter','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','sendStatus','name','send','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','order','sort','where','VIRTUAL','merge','includeAll','findAll','rows','show'];(function(_0x531a0a,_0x22c3be){var _0x27cc5f=function(_0x14f389){while(--_0x14f389){_0x531a0a['push'](_0x531a0a['shift']());}};_0x27cc5f(++_0x22c3be);}(_0x2124,0xc0));var _0x4212=function(_0xba9507,_0x16a681){_0xba9507=_0xba9507-0x0;var _0x29a14f=_0x2124[_0xba9507];return _0x29a14f;};'use strict';var emlformat=require(_0x4212('0x0'));var rimraf=require(_0x4212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4212('0x2'));var rp=require(_0x4212('0x3'));var moment=require(_0x4212('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4212('0x5'));var util=require(_0x4212('0x6'));var path=require('path');var sox=require(_0x4212('0x7'));var csv=require(_0x4212('0x8'));var ejs=require(_0x4212('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4212('0xa'));var squel=require(_0x4212('0xb'));var crypto=require(_0x4212('0xc'));var jsforce=require(_0x4212('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4212('0x8'));var querystring=require(_0x4212('0xe'));var Papa=require(_0x4212('0xf'));var Redis=require('ioredis');var authService=require(_0x4212('0x10'));var qs=require(_0x4212('0x11'));var as=require(_0x4212('0x12'));var hardwareService=require(_0x4212('0x13'));var logger=require(_0x4212('0x14'))(_0x4212('0x15'));var utils=require(_0x4212('0x16'));var config=require(_0x4212('0x17'));var licenseUtil=require(_0x4212('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4212('0x19')](config[_0x4212('0x1a')],{'host':_0x4212('0x1b'),'port':0x18eb});var socket=require(_0x4212('0x1c'))(new Redis(config['redis']));require('./dashboard.socket')[_0x4212('0x1d')](socket);function respondWithStatusCode(_0x3f7dbb,_0x5f2583){_0x5f2583=_0x5f2583||0xcc;return function(_0x4f39cc){if(_0x4f39cc){return _0x3f7dbb['sendStatus'](_0x5f2583);}return _0x3f7dbb['status'](_0x5f2583)['end']();};}function respondWithResult(_0x6817c3,_0x512db4){_0x512db4=_0x512db4||0xc8;return function(_0x3e2a25){if(_0x3e2a25){return _0x6817c3[_0x4212('0x1e')](_0x512db4)[_0x4212('0x1f')](_0x3e2a25);}};}function respondWithFilteredResult(_0x35cff2,_0x183558){return function(_0x397039){if(_0x397039){var _0x29e538=typeof _0x183558[_0x4212('0x20')]===_0x4212('0x21')&&typeof _0x183558['limit']===_0x4212('0x21');var _0x272a24=_0x397039[_0x4212('0x22')];var _0x5d3241=_0x29e538?0x0:_0x183558['offset'];var _0x4b729d=_0x29e538?_0x397039[_0x4212('0x22')]:_0x183558[_0x4212('0x20')]+_0x183558[_0x4212('0x23')];var _0x423571;if(_0x4b729d>=_0x272a24){_0x4b729d=_0x272a24;_0x423571=0xc8;}else{_0x423571=0xce;}_0x35cff2[_0x4212('0x1e')](_0x423571);return _0x35cff2[_0x4212('0x24')](_0x4212('0x25'),_0x5d3241+'-'+_0x4b729d+'/'+_0x272a24)[_0x4212('0x1f')](_0x397039);}return null;};}function patchUpdates(_0x35439f){return function(_0x37bfbd){try{jsonpatch[_0x4212('0x26')](_0x37bfbd,_0x35439f,!![]);}catch(_0x369f3a){return BPromise[_0x4212('0x27')](_0x369f3a);}return _0x37bfbd[_0x4212('0x28')]();};}function saveUpdates(_0x3eca8a,_0xf6ba89){return function(_0x348af2){if(_0x348af2){return _0x348af2[_0x4212('0x29')](_0x3eca8a)[_0x4212('0x2a')](function(_0x2b98d0){return _0x2b98d0;});}return null;};}function removeEntity(_0x5b242c,_0x905b0b){return function(_0x5f4bda){if(_0x5f4bda){return _0x5f4bda[_0x4212('0x2b')]()[_0x4212('0x2a')](function(){var _0xa697fa=_0x5f4bda[_0x4212('0x2c')]({'plain':!![]});var _0x244fe8=_0x4212('0x2d');return db[_0x4212('0x2e')][_0x4212('0x2b')]({'where':{'type':_0x244fe8,'resourceId':_0xa697fa['id']}})['then'](function(){return _0x5f4bda;});})[_0x4212('0x2a')](function(){_0x5b242c['status'](0xcc)[_0x4212('0x2f')]();});}};}function handleEntityNotFound(_0x5c4287,_0x4ebb66){return function(_0x2d992f){if(!_0x2d992f){_0x5c4287[_0x4212('0x30')](0x194);}return _0x2d992f;};}function handleError(_0x4456d7,_0x45001d){_0x45001d=_0x45001d||0x1f4;return function(_0x285272){logger['error'](_0x285272['stack']);if(_0x285272[_0x4212('0x31')]){delete _0x285272[_0x4212('0x31')];}_0x4456d7[_0x4212('0x1e')](_0x45001d)[_0x4212('0x32')](_0x285272);};}exports['index']=function(_0x5ef4eb,_0x5ba596){var _0x228c84={},_0x46c6e2={},_0x47cecb={'count':0x0,'rows':[]};var _0x132df0=_[_0x4212('0x33')](db[_0x4212('0x34')][_0x4212('0x35')],function(_0x891b36){return{'name':_0x891b36['fieldName'],'type':_0x891b36[_0x4212('0x36')][_0x4212('0x37')]};});_0x46c6e2[_0x4212('0x38')]=_[_0x4212('0x33')](_0x132df0,_0x4212('0x31'));_0x46c6e2[_0x4212('0x39')]=_[_0x4212('0x3a')](_0x5ef4eb[_0x4212('0x39')]);_0x46c6e2[_0x4212('0x3b')]=_[_0x4212('0x3c')](_0x46c6e2['model'],_0x46c6e2[_0x4212('0x39')]);_0x228c84['attributes']=_[_0x4212('0x3c')](_0x46c6e2[_0x4212('0x38')],qs[_0x4212('0x3d')](_0x5ef4eb[_0x4212('0x39')][_0x4212('0x3d')]));_0x228c84[_0x4212('0x3e')]=_0x228c84[_0x4212('0x3e')]['length']?_0x228c84[_0x4212('0x3e')]:_0x46c6e2[_0x4212('0x38')];if(!_0x5ef4eb[_0x4212('0x39')]['hasOwnProperty']('nolimit')){_0x228c84['limit']=qs[_0x4212('0x23')](_0x5ef4eb[_0x4212('0x39')]['limit']);_0x228c84[_0x4212('0x20')]=qs[_0x4212('0x20')](_0x5ef4eb[_0x4212('0x39')]['offset']);}_0x228c84[_0x4212('0x3f')]=qs[_0x4212('0x40')](_0x5ef4eb[_0x4212('0x39')][_0x4212('0x40')]);_0x228c84[_0x4212('0x41')]=qs[_0x4212('0x3b')](_['pick'](_0x5ef4eb['query'],_0x46c6e2[_0x4212('0x3b')]),_0x132df0);if(_0x5ef4eb['query']['filter']){_0x228c84['where']=_['merge'](_0x228c84[_0x4212('0x41')],{'$or':_[_0x4212('0x33')](_0x132df0,function(_0x3637aa){if(_0x3637aa[_0x4212('0x36')]!==_0x4212('0x42')){var _0x283c36={};_0x283c36[_0x3637aa[_0x4212('0x31')]]={'$like':'%'+_0x5ef4eb['query']['filter']+'%'};return _0x283c36;}})});}_0x228c84=_[_0x4212('0x43')]({},_0x228c84,_0x5ef4eb['options']);var _0x53e4fd={'where':_0x228c84[_0x4212('0x41')]};return db['Dashboard'][_0x4212('0x22')](_0x53e4fd)[_0x4212('0x2a')](function(_0x140a8a){_0x47cecb[_0x4212('0x22')]=_0x140a8a;if(_0x5ef4eb['query'][_0x4212('0x44')]){_0x228c84['include']=[{'all':!![]}];}return db[_0x4212('0x34')][_0x4212('0x45')](_0x228c84);})['then'](function(_0x22e8f2){_0x47cecb[_0x4212('0x46')]=_0x22e8f2;return _0x47cecb;})[_0x4212('0x2a')](respondWithFilteredResult(_0x5ba596,_0x228c84))['catch'](handleError(_0x5ba596,null));};exports[_0x4212('0x47')]=function(_0xc523ff,_0x5bc595){var _0x4a1c71={'raw':![],'where':{'id':_0xc523ff[_0x4212('0x48')]['id']}},_0x200852={};_0x200852[_0x4212('0x38')]=_[_0x4212('0x3a')](db[_0x4212('0x34')][_0x4212('0x35')]);_0x200852[_0x4212('0x39')]=_[_0x4212('0x3a')](_0xc523ff['query']);_0x200852[_0x4212('0x3b')]=_[_0x4212('0x3c')](_0x200852[_0x4212('0x38')],_0x200852[_0x4212('0x39')]);_0x4a1c71[_0x4212('0x3e')]=_['intersection'](_0x200852[_0x4212('0x38')],qs[_0x4212('0x3d')](_0xc523ff[_0x4212('0x39')][_0x4212('0x3d')]));_0x4a1c71[_0x4212('0x3e')]=_0x4a1c71[_0x4212('0x3e')][_0x4212('0x49')]?_0x4a1c71['attributes']:_0x200852[_0x4212('0x38')];if(_0xc523ff[_0x4212('0x39')][_0x4212('0x44')]){_0x4a1c71[_0x4212('0x4a')]=[{'all':!![]}];}_0x4a1c71=_['merge']({},_0x4a1c71,_0xc523ff['options']);return db[_0x4212('0x34')][_0x4212('0x4b')](_0x4a1c71)['then'](handleEntityNotFound(_0x5bc595,null))['then'](respondWithResult(_0x5bc595,null))[_0x4212('0x4c')](handleError(_0x5bc595,null));};exports['create']=function(_0x49c979,_0x179f57){return db['Dashboard'][_0x4212('0x4d')](_0x49c979[_0x4212('0x4e')],{})[_0x4212('0x2a')](function(_0x527056){var _0x21fe4e=_0x49c979[_0x4212('0x4f')]['get']({'plain':!![]});if(!_0x21fe4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21fe4e[_0x4212('0x50')]===_0x4212('0x4f')){var _0x5ea092=_0x527056['get']({'plain':!![]});var _0x40e0d9='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x40e0d9,'userProfileId':_0x21fe4e['userProfileId']},'raw':!![]})['then'](function(_0x4fd082){if(_0x4fd082&&_0x4fd082[_0x4212('0x51')]===0x0){return db[_0x4212('0x2e')][_0x4212('0x4d')]({'name':_0x5ea092[_0x4212('0x31')],'resourceId':_0x5ea092['id'],'type':_0x4fd082['name'],'sectionId':_0x4fd082['id']},{})[_0x4212('0x2a')](function(){return _0x527056;});}else{return _0x527056;}})[_0x4212('0x4c')](function(_0x3347a4){logger['error'](_0x4212('0x52'),_0x3347a4);throw _0x3347a4;});}return _0x527056;})[_0x4212('0x2a')](respondWithResult(_0x179f57,0xc9))[_0x4212('0x4c')](handleError(_0x179f57,null));};exports[_0x4212('0x53')]=function(_0x50eed4,_0x59cff8){var _0x114435={'where':{'id':_0x50eed4[_0x4212('0x48')]['id']}},_0x11e842={};_0x11e842['model']=_[_0x4212('0x3a')](db['Dashboard']['rawAttributes']);_0x114435[_0x4212('0x3e')]=_[_0x4212('0x3c')](_0x11e842[_0x4212('0x38')],qs[_0x4212('0x3d')](_0x50eed4[_0x4212('0x39')][_0x4212('0x3d')]));_0x114435[_0x4212('0x3e')]=_0x114435[_0x4212('0x3e')][_0x4212('0x49')]?_0x114435[_0x4212('0x3e')]:_0x11e842[_0x4212('0x38')];if(_0x50eed4['query'][_0x4212('0x44')]){_0x114435[_0x4212('0x4a')]=[{'all':!![]}];}_0x114435=_['merge']({},_0x114435,_0x50eed4['options']);return db[_0x4212('0x34')][_0x4212('0x4b')](_0x114435)['then'](handleEntityNotFound(_0x59cff8,null))[_0x4212('0x2a')](function(_0x30fc4d){if(_0x30fc4d){var _0x38f79b=_0x30fc4d[_0x4212('0x2c')]({'plain':!![]});_0x38f79b=qs['omit'](_0x38f79b,['id','createdAt',_0x4212('0x54')]);_0x50eed4[_0x4212('0x4e')]=_[_0x4212('0x55')](_0x50eed4[_0x4212('0x4e')],['id',_0x4212('0x56'),_0x4212('0x54')]);return db[_0x4212('0x34')][_0x4212('0x4d')](_[_0x4212('0x43')](_0x38f79b,_0x50eed4[_0x4212('0x4e')]),{'include':_0x50eed4[_0x4212('0x39')][_0x4212('0x44')]?[{'all':!![]}]:undefined})[_0x4212('0x2a')](function(_0x48e3db){var _0x321891=_0x50eed4[_0x4212('0x4f')][_0x4212('0x2c')]({'plain':!![]});if(!_0x321891)throw new Error(_0x4212('0x57'));if(_0x321891[_0x4212('0x50')]===_0x4212('0x4f')){var _0x5ba68c=_0x48e3db['get']({'plain':!![]});var _0x3c5842=_0x4212('0x2d');return db[_0x4212('0x58')][_0x4212('0x4b')]({'where':{'name':_0x3c5842,'userProfileId':_0x321891[_0x4212('0x59')]},'raw':!![]})['then'](function(_0x171c96){if(_0x171c96&&_0x171c96[_0x4212('0x51')]===0x0){return db['UserProfileResource'][_0x4212('0x4d')]({'name':_0x5ba68c[_0x4212('0x31')],'resourceId':_0x5ba68c['id'],'type':_0x171c96[_0x4212('0x31')],'sectionId':_0x171c96['id']},{})[_0x4212('0x2a')](function(){return _0x48e3db;});}else{return _0x48e3db;}})[_0x4212('0x4c')](function(_0x4c0321){logger[_0x4212('0x5a')](_0x4212('0x52'),_0x4c0321);throw _0x4c0321;});}return _0x48e3db;});}})[_0x4212('0x2a')](respondWithResult(_0x59cff8,0xc9))['catch'](handleError(_0x59cff8,null));};exports[_0x4212('0x29')]=function(_0x30a3fa,_0x33eff4){if(_0x30a3fa[_0x4212('0x4e')]['id']){delete _0x30a3fa[_0x4212('0x4e')]['id'];}return db[_0x4212('0x34')]['find']({'where':{'id':_0x30a3fa[_0x4212('0x48')]['id']}})[_0x4212('0x2a')](handleEntityNotFound(_0x33eff4,null))['then'](saveUpdates(_0x30a3fa['body'],null))[_0x4212('0x2a')](respondWithResult(_0x33eff4,null))['catch'](handleError(_0x33eff4,null));};exports[_0x4212('0x2b')]=function(_0x213759,_0x488379){return db['Dashboard'][_0x4212('0x4b')]({'where':{'id':_0x213759[_0x4212('0x48')]['id']}})[_0x4212('0x2a')](handleEntityNotFound(_0x488379,null))['then'](removeEntity(_0x488379,null))[_0x4212('0x4c')](handleError(_0x488379,null));};function widgetAttributes(_0x1a9c4d){try{switch(_0x1a9c4d[_0x4212('0x36')]){case _0x4212('0x5b'):return[{'name':_0x4212('0x5c'),'value':_0x1a9c4d[_0x4212('0x5c')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0][_0x4212('0x5e')]:undefined)||_0x4212('0x5f')}];case _0x4212('0x60'):return[{'name':_0x4212('0x61'),'value':_0x1a9c4d[_0x4212('0x61')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d['attrs'][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0][_0x4212('0x5e')]:undefined)||''}];case'clock':return[{'name':_0x4212('0x62'),'value':_0x1a9c4d[_0x4212('0x62')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['value']:undefined)||_0x4212('0x63')},{'name':'attrTimezone','value':_0x1a9c4d[_0x4212('0x64')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d['attrs'][0x1]?_0x1a9c4d['attrs'][0x1]['value']:undefined)||_0x4212('0x65')},{'name':_0x4212('0x66'),'value':_0x1a9c4d[_0x4212('0x66')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x2]?_0x1a9c4d[_0x4212('0x5d')][0x2][_0x4212('0x5e')]:undefined)||0xc}];case _0x4212('0x67'):return[{'name':_0x4212('0x68'),'value':_0x1a9c4d[_0x4212('0x68')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0][_0x4212('0x5e')]:undefined)||_0x4212('0x69')},{'name':_0x4212('0x6a'),'value':_0x1a9c4d[_0x4212('0x6a')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x1]?_0x1a9c4d[_0x4212('0x5d')][0x1][_0x4212('0x5e')]:undefined)||[]},{'name':_0x4212('0x66'),'value':_0x1a9c4d[_0x4212('0x66')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x2]?_0x1a9c4d[_0x4212('0x5d')][0x2][_0x4212('0x5e')]:undefined)||0x14},{'name':_0x4212('0x6b'),'value':_0x1a9c4d[_0x4212('0x6b')]||(_0x1a9c4d['attrs']&&_0x1a9c4d['attrs'][0x3]?_0x1a9c4d[_0x4212('0x5d')][0x3][_0x4212('0x5e')]:undefined)||_0x4212('0x6c')},{'name':_0x4212('0x6d'),'value':_0x1a9c4d[_0x4212('0x6d')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x4]?_0x1a9c4d[_0x4212('0x5d')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x1a9c4d[_0x4212('0x6e')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x5]?_0x1a9c4d[_0x4212('0x5d')][0x5][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x6f'),'value':_0x1a9c4d[_0x4212('0x6f')]||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x6]?_0x1a9c4d[_0x4212('0x5d')][0x6][_0x4212('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1a9c4d[_0x4212('0x70')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x7]?_0x1a9c4d[_0x4212('0x5d')][0x7]['value']:undefined)||''},{'name':_0x4212('0x71'),'value':_0x1a9c4d[_0x4212('0x71')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x8]?_0x1a9c4d[_0x4212('0x5d')][0x8][_0x4212('0x5e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1a9c4d['attrChatWebsites']||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x9]?_0x1a9c4d[_0x4212('0x5d')][0x9][_0x4212('0x5e')]:undefined)||''}];case _0x4212('0x72'):case _0x4212('0x73'):return[{'name':_0x4212('0x74'),'value':_0x1a9c4d[_0x4212('0x74')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['value']:undefined)||_0x4212('0x69')},{'name':_0x4212('0x75'),'value':_0x1a9c4d[_0x4212('0x75')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x1]?_0x1a9c4d['attrs'][0x1][_0x4212('0x5e')]:undefined)||null},{'name':_0x4212('0x76'),'value':_0x1a9c4d[_0x4212('0x76')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x2]?_0x1a9c4d[_0x4212('0x5d')][0x2][_0x4212('0x5e')]:undefined)||null},{'name':_0x4212('0x6a'),'value':_0x1a9c4d[_0x4212('0x6a')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d['attrs'][0x3]?_0x1a9c4d[_0x4212('0x5d')][0x3][_0x4212('0x5e')]:undefined)||[]},{'name':_0x4212('0x6b'),'value':_0x1a9c4d[_0x4212('0x6b')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x4]?_0x1a9c4d[_0x4212('0x5d')][0x4][_0x4212('0x5e')]:undefined)||_0x4212('0x6c')},{'name':_0x4212('0x6d'),'value':_0x1a9c4d[_0x4212('0x6d')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x5]?_0x1a9c4d['attrs'][0x5][_0x4212('0x5e')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1a9c4d[_0x4212('0x6e')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x6]?_0x1a9c4d['attrs'][0x6][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x6f'),'value':_0x1a9c4d['attrSmsAccounts']||(_0x1a9c4d['attrs']&&_0x1a9c4d['attrs'][0x7]?_0x1a9c4d[_0x4212('0x5d')][0x7][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x70'),'value':_0x1a9c4d[_0x4212('0x70')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x8]?_0x1a9c4d[_0x4212('0x5d')][0x8][_0x4212('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1a9c4d[_0x4212('0x71')]||(_0x1a9c4d['attrs']&&_0x1a9c4d['attrs'][0x9]?_0x1a9c4d['attrs'][0x9][_0x4212('0x5e')]:undefined)||''},{'name':_0x4212('0x77'),'value':_0x1a9c4d[_0x4212('0x77')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0xa]?_0x1a9c4d['attrs'][0xa]['value']:undefined)||''}];case _0x4212('0x78'):return[{'name':_0x4212('0x79'),'type':_0x1a9c4d[_0x4212('0x7a')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['type']:undefined)||null,'value':_0x1a9c4d['attrReport']||(_0x1a9c4d['attrs']&&_0x1a9c4d[_0x4212('0x5d')][0x0]?_0x1a9c4d[_0x4212('0x5d')][0x0]['value']:undefined)||null},{'name':_0x4212('0x7b'),'value':_0x1a9c4d[_0x4212('0x7b')]||(_0x1a9c4d[_0x4212('0x5d')]&&_0x1a9c4d[_0x4212('0x5d')][0x1]?_0x1a9c4d[_0x4212('0x5d')][0x1][_0x4212('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x71f2bc){logger[_0x4212('0x5a')](_0x4212('0x7c'),JSON['stringify'](_0x71f2bc));return[];}}exports['addItem']=function(_0x469175,_0x5a4b47,_0x400c3f){if(_0x469175[_0x4212('0x4e')]['id']){delete _0x469175[_0x4212('0x4e')]['id'];}return db[_0x4212('0x34')][_0x4212('0x4b')]({'where':{'id':_0x469175[_0x4212('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a4b47,null))[_0x4212('0x2a')](function(_0x113e85){if(_0x113e85){_0x469175['body'][_0x4212('0x7d')]=_0x113e85['id'];_0x469175[_0x4212('0x4e')][_0x4212('0x5d')]=widgetAttributes(_0x469175[_0x4212('0x4e')]);return db[_0x4212('0x7e')][_0x4212('0x4d')](_0x469175[_0x4212('0x4e')]);}})[_0x4212('0x2a')](respondWithResult(_0x5a4b47,null))['catch'](handleError(_0x5a4b47,null));};exports[_0x4212('0x7f')]=function(_0x3bea00,_0x2f040c,_0x40f33e){var _0x2b2cc0={};var _0x587d54={};var _0x51a8ee;var _0x16139b;return db[_0x4212('0x34')]['findOne']({'where':{'id':_0x3bea00[_0x4212('0x48')]['id']}})[_0x4212('0x2a')](handleEntityNotFound(_0x2f040c,null))[_0x4212('0x2a')](function(_0x4a57c0){if(_0x4a57c0){_0x51a8ee=_0x4a57c0;_0x587d54[_0x4212('0x38')]=_[_0x4212('0x3a')](db[_0x4212('0x7e')][_0x4212('0x35')]);_0x587d54[_0x4212('0x39')]=_['keys'](_0x3bea00[_0x4212('0x39')]);_0x587d54[_0x4212('0x3b')]=_['intersection'](_0x587d54[_0x4212('0x38')],_0x587d54[_0x4212('0x39')]);_0x2b2cc0[_0x4212('0x3e')]=_[_0x4212('0x3c')](_0x587d54['model'],qs[_0x4212('0x3d')](_0x3bea00[_0x4212('0x39')][_0x4212('0x3d')]));_0x2b2cc0[_0x4212('0x3e')]=_0x2b2cc0['attributes']['length']?_0x2b2cc0[_0x4212('0x3e')]:_0x587d54[_0x4212('0x38')];_0x2b2cc0[_0x4212('0x3f')]=qs[_0x4212('0x40')](_0x3bea00[_0x4212('0x39')][_0x4212('0x40')]);_0x2b2cc0[_0x4212('0x41')]=qs[_0x4212('0x3b')](_[_0x4212('0x80')](_0x3bea00[_0x4212('0x39')],_0x587d54['filters']));if(_0x3bea00[_0x4212('0x39')][_0x4212('0x81')]){_0x2b2cc0[_0x4212('0x41')]=_[_0x4212('0x43')](_0x2b2cc0[_0x4212('0x41')],{'$or':_[_0x4212('0x33')](_0x2b2cc0[_0x4212('0x3e')],function(_0x4a2542){var _0x2ec9b3={};_0x2ec9b3[_0x4a2542]={'$like':'%'+_0x3bea00[_0x4212('0x39')][_0x4212('0x81')]+'%'};return _0x2ec9b3;})});}_0x2b2cc0=_['merge']({},_0x2b2cc0,_0x3bea00['options']);return _0x51a8ee[_0x4212('0x7f')](_0x2b2cc0);}})[_0x4212('0x2a')](function(_0x283fc8){if(_0x283fc8){_0x16139b=_0x283fc8[_0x4212('0x49')];if(!_0x3bea00['query'][_0x4212('0x82')](_0x4212('0x83'))){_0x2b2cc0[_0x4212('0x23')]=qs[_0x4212('0x23')](_0x3bea00[_0x4212('0x39')]['limit']);_0x2b2cc0[_0x4212('0x20')]=qs[_0x4212('0x20')](_0x3bea00[_0x4212('0x39')][_0x4212('0x20')]);}return _0x51a8ee['getItems'](_0x2b2cc0);}})[_0x4212('0x2a')](function(_0x5bde88){if(_0x5bde88){return _0x5bde88?{'count':_0x16139b,'rows':_0x5bde88}:null;}})['then'](respondWithResult(_0x2f040c,null))[_0x4212('0x4c')](handleError(_0x2f040c,null));}; \ No newline at end of file +var _0xef4c=['multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','stringify','addItem','getItems','findOne','DashboardItem','filter','hasOwnProperty','nolimit','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','Dashboard','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','role','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xef4c,0x19d));var _0xcef4=function(_0x4b81ff,_0x44aadb){_0x4b81ff=_0x4b81ff-0x0;var _0x13330a=_0xef4c[_0x4b81ff];return _0x13330a;};'use strict';var emlformat=require(_0xcef4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcef4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcef4('0x2'));var Mustache=require(_0xcef4('0x3'));var util=require(_0xcef4('0x4'));var path=require(_0xcef4('0x5'));var sox=require(_0xcef4('0x6'));var csv=require(_0xcef4('0x7'));var ejs=require(_0xcef4('0x8'));var fs=require('fs');var fs_extra=require(_0xcef4('0x9'));var _=require(_0xcef4('0xa'));var squel=require('squel');var crypto=require(_0xcef4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcef4('0xc'));var toCsv=require(_0xcef4('0x7'));var querystring=require(_0xcef4('0xd'));var Papa=require(_0xcef4('0xe'));var Redis=require('ioredis');var authService=require(_0xcef4('0xf'));var qs=require(_0xcef4('0x10'));var as=require(_0xcef4('0x11'));var hardwareService=require(_0xcef4('0x12'));var logger=require(_0xcef4('0x13'))(_0xcef4('0x14'));var utils=require('../../config/utils');var config=require(_0xcef4('0x15'));var licenseUtil=require(_0xcef4('0x16'));var db=require(_0xcef4('0x17'))['db'];config[_0xcef4('0x18')]=_[_0xcef4('0x19')](config[_0xcef4('0x18')],{'host':_0xcef4('0x1a'),'port':0x18eb});var socket=require(_0xcef4('0x1b'))(new Redis(config[_0xcef4('0x18')]));require(_0xcef4('0x1c'))[_0xcef4('0x1d')](socket);function respondWithStatusCode(_0x11fdd5,_0x5119b9){_0x5119b9=_0x5119b9||0xcc;return function(_0x148330){if(_0x148330){return _0x11fdd5[_0xcef4('0x1e')](_0x5119b9);}return _0x11fdd5[_0xcef4('0x1f')](_0x5119b9)[_0xcef4('0x20')]();};}function respondWithResult(_0x8c6d40,_0x317c9d){_0x317c9d=_0x317c9d||0xc8;return function(_0x1a180e){if(_0x1a180e){return _0x8c6d40[_0xcef4('0x1f')](_0x317c9d)['json'](_0x1a180e);}};}function respondWithFilteredResult(_0x44395a,_0x4711f1){return function(_0x4e6c14){if(_0x4e6c14){var _0xd7bf68=typeof _0x4711f1[_0xcef4('0x21')]===_0xcef4('0x22')&&typeof _0x4711f1[_0xcef4('0x23')]===_0xcef4('0x22');var _0x4d55b7=_0x4e6c14[_0xcef4('0x24')];var _0x20f71c=_0xd7bf68?0x0:_0x4711f1[_0xcef4('0x21')];var _0x49f4b9=_0xd7bf68?_0x4e6c14[_0xcef4('0x24')]:_0x4711f1[_0xcef4('0x21')]+_0x4711f1[_0xcef4('0x23')];var _0xb2e824;if(_0x49f4b9>=_0x4d55b7){_0x49f4b9=_0x4d55b7;_0xb2e824=0xc8;}else{_0xb2e824=0xce;}_0x44395a[_0xcef4('0x1f')](_0xb2e824);return _0x44395a[_0xcef4('0x25')](_0xcef4('0x26'),_0x20f71c+'-'+_0x49f4b9+'/'+_0x4d55b7)[_0xcef4('0x27')](_0x4e6c14);}return null;};}function patchUpdates(_0x1ebb13){return function(_0x135a38){try{jsonpatch['apply'](_0x135a38,_0x1ebb13,!![]);}catch(_0x178a5f){return BPromise[_0xcef4('0x28')](_0x178a5f);}return _0x135a38[_0xcef4('0x29')]();};}function saveUpdates(_0x50d757,_0xb324c2){return function(_0x47c9b5){if(_0x47c9b5){return _0x47c9b5[_0xcef4('0x2a')](_0x50d757)['then'](function(_0x3bab5b){return _0x3bab5b;});}return null;};}function removeEntity(_0x43c598,_0x7dbb4){return function(_0x474a9a){if(_0x474a9a){return _0x474a9a[_0xcef4('0x2b')]()[_0xcef4('0x2c')](function(){var _0x3db91d=_0x474a9a[_0xcef4('0x2d')]({'plain':!![]});var _0x49e50a='CustomDashboards';return db[_0xcef4('0x2e')][_0xcef4('0x2b')]({'where':{'type':_0x49e50a,'resourceId':_0x3db91d['id']}})[_0xcef4('0x2c')](function(){return _0x474a9a;});})[_0xcef4('0x2c')](function(){_0x43c598[_0xcef4('0x1f')](0xcc)[_0xcef4('0x20')]();});}};}function handleEntityNotFound(_0x4f8379,_0xbce83d){return function(_0x41bb1c){if(!_0x41bb1c){_0x4f8379[_0xcef4('0x1e')](0x194);}return _0x41bb1c;};}function handleError(_0x4fe681,_0x57d811){_0x57d811=_0x57d811||0x1f4;return function(_0x5bd0f1){logger[_0xcef4('0x2f')](_0x5bd0f1[_0xcef4('0x30')]);if(_0x5bd0f1[_0xcef4('0x31')]){delete _0x5bd0f1[_0xcef4('0x31')];}_0x4fe681[_0xcef4('0x1f')](_0x57d811)[_0xcef4('0x32')](_0x5bd0f1);};}exports[_0xcef4('0x33')]=function(_0x12bc07,_0x1c5c21){var _0x20ccb3={},_0x413f6e={},_0x3f34b3={'count':0x0,'rows':[]};var _0xec3ace=_['map'](db[_0xcef4('0x34')]['rawAttributes'],function(_0x2cd023){return{'name':_0x2cd023[_0xcef4('0x35')],'type':_0x2cd023[_0xcef4('0x36')][_0xcef4('0x37')]};});_0x413f6e[_0xcef4('0x38')]=_[_0xcef4('0x39')](_0xec3ace,_0xcef4('0x31'));_0x413f6e['query']=_[_0xcef4('0x3a')](_0x12bc07[_0xcef4('0x3b')]);_0x413f6e[_0xcef4('0x3c')]=_[_0xcef4('0x3d')](_0x413f6e['model'],_0x413f6e[_0xcef4('0x3b')]);_0x20ccb3['attributes']=_[_0xcef4('0x3d')](_0x413f6e['model'],qs[_0xcef4('0x3e')](_0x12bc07['query'][_0xcef4('0x3e')]));_0x20ccb3[_0xcef4('0x3f')]=_0x20ccb3[_0xcef4('0x3f')][_0xcef4('0x40')]?_0x20ccb3[_0xcef4('0x3f')]:_0x413f6e[_0xcef4('0x38')];if(!_0x12bc07[_0xcef4('0x3b')]['hasOwnProperty']('nolimit')){_0x20ccb3[_0xcef4('0x23')]=qs[_0xcef4('0x23')](_0x12bc07[_0xcef4('0x3b')]['limit']);_0x20ccb3[_0xcef4('0x21')]=qs[_0xcef4('0x21')](_0x12bc07[_0xcef4('0x3b')]['offset']);}_0x20ccb3[_0xcef4('0x41')]=qs[_0xcef4('0x42')](_0x12bc07['query'][_0xcef4('0x42')]);_0x20ccb3[_0xcef4('0x43')]=qs['filters'](_[_0xcef4('0x44')](_0x12bc07[_0xcef4('0x3b')],_0x413f6e[_0xcef4('0x3c')]),_0xec3ace);if(_0x12bc07[_0xcef4('0x3b')]['filter']){_0x20ccb3[_0xcef4('0x43')]=_[_0xcef4('0x45')](_0x20ccb3['where'],{'$or':_['map'](_0xec3ace,function(_0x168473){if(_0x168473['type']!=='VIRTUAL'){var _0x4eb600={};_0x4eb600[_0x168473['name']]={'$like':'%'+_0x12bc07[_0xcef4('0x3b')]['filter']+'%'};return _0x4eb600;}})});}_0x20ccb3=_['merge']({},_0x20ccb3,_0x12bc07[_0xcef4('0x46')]);var _0x391009={'where':_0x20ccb3[_0xcef4('0x43')]};return db[_0xcef4('0x34')][_0xcef4('0x24')](_0x391009)['then'](function(_0x1e725e){_0x3f34b3['count']=_0x1e725e;if(_0x12bc07[_0xcef4('0x3b')]['includeAll']){_0x20ccb3[_0xcef4('0x47')]=[{'all':!![]}];}return db[_0xcef4('0x34')][_0xcef4('0x48')](_0x20ccb3);})[_0xcef4('0x2c')](function(_0x498a94){_0x3f34b3[_0xcef4('0x49')]=_0x498a94;return _0x3f34b3;})[_0xcef4('0x2c')](respondWithFilteredResult(_0x1c5c21,_0x20ccb3))[_0xcef4('0x4a')](handleError(_0x1c5c21,null));};exports['show']=function(_0x2e1c8f,_0x492ba7){var _0x5257f3={'raw':![],'where':{'id':_0x2e1c8f[_0xcef4('0x4b')]['id']}},_0x1926a5={};_0x1926a5[_0xcef4('0x38')]=_['keys'](db[_0xcef4('0x34')][_0xcef4('0x4c')]);_0x1926a5[_0xcef4('0x3b')]=_['keys'](_0x2e1c8f[_0xcef4('0x3b')]);_0x1926a5[_0xcef4('0x3c')]=_[_0xcef4('0x3d')](_0x1926a5['model'],_0x1926a5[_0xcef4('0x3b')]);_0x5257f3[_0xcef4('0x3f')]=_[_0xcef4('0x3d')](_0x1926a5[_0xcef4('0x38')],qs['fields'](_0x2e1c8f['query']['fields']));_0x5257f3[_0xcef4('0x3f')]=_0x5257f3[_0xcef4('0x3f')][_0xcef4('0x40')]?_0x5257f3[_0xcef4('0x3f')]:_0x1926a5[_0xcef4('0x38')];if(_0x2e1c8f[_0xcef4('0x3b')]['includeAll']){_0x5257f3[_0xcef4('0x47')]=[{'all':!![]}];}_0x5257f3=_[_0xcef4('0x45')]({},_0x5257f3,_0x2e1c8f[_0xcef4('0x46')]);return db['Dashboard'][_0xcef4('0x4d')](_0x5257f3)[_0xcef4('0x2c')](handleEntityNotFound(_0x492ba7,null))[_0xcef4('0x2c')](respondWithResult(_0x492ba7,null))[_0xcef4('0x4a')](handleError(_0x492ba7,null));};exports[_0xcef4('0x4e')]=function(_0x45dba4,_0x3ad11b){return db[_0xcef4('0x34')][_0xcef4('0x4e')](_0x45dba4[_0xcef4('0x4f')],{})[_0xcef4('0x2c')](function(_0x5cb4a5){var _0x295e89=_0x45dba4[_0xcef4('0x50')][_0xcef4('0x2d')]({'plain':!![]});if(!_0x295e89)throw new Error(_0xcef4('0x51'));if(_0x295e89['role']===_0xcef4('0x50')){var _0x4b8d02=_0x5cb4a5[_0xcef4('0x2d')]({'plain':!![]});var _0x51b821=_0xcef4('0x52');return db[_0xcef4('0x53')][_0xcef4('0x4d')]({'where':{'name':_0x51b821,'userProfileId':_0x295e89[_0xcef4('0x54')]},'raw':!![]})[_0xcef4('0x2c')](function(_0x5232f5){if(_0x5232f5&&_0x5232f5[_0xcef4('0x55')]===0x0){return db[_0xcef4('0x2e')]['create']({'name':_0x4b8d02[_0xcef4('0x31')],'resourceId':_0x4b8d02['id'],'type':_0x5232f5[_0xcef4('0x31')],'sectionId':_0x5232f5['id']},{})[_0xcef4('0x2c')](function(){return _0x5cb4a5;});}else{return _0x5cb4a5;}})[_0xcef4('0x4a')](function(_0x3421ea){logger[_0xcef4('0x2f')](_0xcef4('0x56'),_0x3421ea);throw _0x3421ea;});}return _0x5cb4a5;})[_0xcef4('0x2c')](respondWithResult(_0x3ad11b,0xc9))['catch'](handleError(_0x3ad11b,null));};exports[_0xcef4('0x57')]=function(_0x3a0d7f,_0xb399ea){var _0x3a4d96={'where':{'id':_0x3a0d7f[_0xcef4('0x4b')]['id']}},_0x49ae06={};_0x49ae06[_0xcef4('0x38')]=_[_0xcef4('0x3a')](db[_0xcef4('0x34')]['rawAttributes']);_0x3a4d96['attributes']=_[_0xcef4('0x3d')](_0x49ae06[_0xcef4('0x38')],qs[_0xcef4('0x3e')](_0x3a0d7f[_0xcef4('0x3b')][_0xcef4('0x3e')]));_0x3a4d96[_0xcef4('0x3f')]=_0x3a4d96['attributes'][_0xcef4('0x40')]?_0x3a4d96[_0xcef4('0x3f')]:_0x49ae06[_0xcef4('0x38')];if(_0x3a0d7f['query'][_0xcef4('0x58')]){_0x3a4d96['include']=[{'all':!![]}];}_0x3a4d96=_['merge']({},_0x3a4d96,_0x3a0d7f[_0xcef4('0x46')]);return db[_0xcef4('0x34')][_0xcef4('0x4d')](_0x3a4d96)['then'](handleEntityNotFound(_0xb399ea,null))[_0xcef4('0x2c')](function(_0x520ea8){if(_0x520ea8){var _0x22a7aa=_0x520ea8[_0xcef4('0x2d')]({'plain':!![]});_0x22a7aa=qs[_0xcef4('0x59')](_0x22a7aa,['id',_0xcef4('0x5a'),_0xcef4('0x5b')]);_0x3a0d7f[_0xcef4('0x4f')]=_[_0xcef4('0x59')](_0x3a0d7f[_0xcef4('0x4f')],['id',_0xcef4('0x5a'),_0xcef4('0x5b')]);return db[_0xcef4('0x34')][_0xcef4('0x4e')](_[_0xcef4('0x45')](_0x22a7aa,_0x3a0d7f[_0xcef4('0x4f')]),{'include':_0x3a0d7f['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x41bc18){var _0xefe3b8=_0x3a0d7f[_0xcef4('0x50')]['get']({'plain':!![]});if(!_0xefe3b8)throw new Error(_0xcef4('0x51'));if(_0xefe3b8[_0xcef4('0x5c')]===_0xcef4('0x50')){var _0x24bc43=_0x41bc18[_0xcef4('0x2d')]({'plain':!![]});var _0x416897=_0xcef4('0x52');return db['UserProfileSection'][_0xcef4('0x4d')]({'where':{'name':_0x416897,'userProfileId':_0xefe3b8['userProfileId']},'raw':!![]})['then'](function(_0xae7d17){if(_0xae7d17&&_0xae7d17[_0xcef4('0x55')]===0x0){return db[_0xcef4('0x2e')]['create']({'name':_0x24bc43[_0xcef4('0x31')],'resourceId':_0x24bc43['id'],'type':_0xae7d17[_0xcef4('0x31')],'sectionId':_0xae7d17['id']},{})['then'](function(){return _0x41bc18;});}else{return _0x41bc18;}})[_0xcef4('0x4a')](function(_0x4947f0){logger[_0xcef4('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4947f0);throw _0x4947f0;});}return _0x41bc18;});}})[_0xcef4('0x2c')](respondWithResult(_0xb399ea,0xc9))[_0xcef4('0x4a')](handleError(_0xb399ea,null));};exports[_0xcef4('0x2a')]=function(_0x360f9b,_0xab17af){if(_0x360f9b[_0xcef4('0x4f')]['id']){delete _0x360f9b[_0xcef4('0x4f')]['id'];}return db['Dashboard'][_0xcef4('0x4d')]({'where':{'id':_0x360f9b[_0xcef4('0x4b')]['id']}})[_0xcef4('0x2c')](handleEntityNotFound(_0xab17af,null))[_0xcef4('0x2c')](saveUpdates(_0x360f9b[_0xcef4('0x4f')],null))[_0xcef4('0x2c')](respondWithResult(_0xab17af,null))[_0xcef4('0x4a')](handleError(_0xab17af,null));};exports[_0xcef4('0x2b')]=function(_0x104734,_0x572b46){return db[_0xcef4('0x34')][_0xcef4('0x4d')]({'where':{'id':_0x104734['params']['id']}})[_0xcef4('0x2c')](handleEntityNotFound(_0x572b46,null))[_0xcef4('0x2c')](removeEntity(_0x572b46,null))[_0xcef4('0x4a')](handleError(_0x572b46,null));};function widgetAttributes(_0x84f60e){try{switch(_0x84f60e[_0xcef4('0x36')]){case _0xcef4('0x5d'):return[{'name':_0xcef4('0x5e'),'value':_0x84f60e[_0xcef4('0x5e')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x0]?_0x84f60e[_0xcef4('0x5f')][0x0]['value']:undefined)||_0xcef4('0x60')}];case _0xcef4('0x61'):return[{'name':_0xcef4('0x62'),'value':_0x84f60e[_0xcef4('0x62')]||(_0x84f60e['attrs']&&_0x84f60e[_0xcef4('0x5f')][0x0]?_0x84f60e[_0xcef4('0x5f')][0x0][_0xcef4('0x63')]:undefined)||''}];case'clock':return[{'name':_0xcef4('0x64'),'value':_0x84f60e[_0xcef4('0x64')]||(_0x84f60e['attrs']&&_0x84f60e[_0xcef4('0x5f')][0x0]?_0x84f60e[_0xcef4('0x5f')][0x0][_0xcef4('0x63')]:undefined)||'HH:mm:ss'},{'name':_0xcef4('0x65'),'value':_0x84f60e[_0xcef4('0x65')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x1]?_0x84f60e[_0xcef4('0x5f')][0x1][_0xcef4('0x63')]:undefined)||'0.00'},{'name':_0xcef4('0x66'),'value':_0x84f60e['attrFontSize']||(_0x84f60e['attrs']&&_0x84f60e[_0xcef4('0x5f')][0x2]?_0x84f60e[_0xcef4('0x5f')][0x2][_0xcef4('0x63')]:undefined)||0xc}];case _0xcef4('0x67'):return[{'name':_0xcef4('0x68'),'value':_0x84f60e[_0xcef4('0x68')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x0]?_0x84f60e[_0xcef4('0x5f')][0x0][_0xcef4('0x63')]:undefined)||_0xcef4('0x69')},{'name':_0xcef4('0x6a'),'value':_0x84f60e[_0xcef4('0x6a')]||(_0x84f60e['attrs']&&_0x84f60e[_0xcef4('0x5f')][0x1]?_0x84f60e[_0xcef4('0x5f')][0x1]['value']:undefined)||[]},{'name':_0xcef4('0x66'),'value':_0x84f60e[_0xcef4('0x66')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x2]?_0x84f60e[_0xcef4('0x5f')][0x2][_0xcef4('0x63')]:undefined)||0x14},{'name':_0xcef4('0x6b'),'value':_0x84f60e[_0xcef4('0x6b')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x3]?_0x84f60e[_0xcef4('0x5f')][0x3]['value']:undefined)||_0xcef4('0x6c')},{'name':_0xcef4('0x6d'),'value':_0x84f60e[_0xcef4('0x6d')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x4]?_0x84f60e[_0xcef4('0x5f')][0x4][_0xcef4('0x63')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x84f60e[_0xcef4('0x6e')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x5]?_0x84f60e[_0xcef4('0x5f')][0x5]['value']:undefined)||''},{'name':_0xcef4('0x6f'),'value':_0x84f60e[_0xcef4('0x6f')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x6]?_0x84f60e[_0xcef4('0x5f')][0x6][_0xcef4('0x63')]:undefined)||''},{'name':_0xcef4('0x70'),'value':_0x84f60e[_0xcef4('0x70')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x7]?_0x84f60e['attrs'][0x7]['value']:undefined)||''},{'name':_0xcef4('0x71'),'value':_0x84f60e[_0xcef4('0x71')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e['attrs'][0x8]?_0x84f60e['attrs'][0x8]['value']:undefined)||''},{'name':_0xcef4('0x72'),'value':_0x84f60e[_0xcef4('0x72')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x9]?_0x84f60e[_0xcef4('0x5f')][0x9][_0xcef4('0x63')]:undefined)||''}];case _0xcef4('0x73'):case _0xcef4('0x74'):return[{'name':'attrSerie1','value':_0x84f60e[_0xcef4('0x75')]||(_0x84f60e['attrs']&&_0x84f60e[_0xcef4('0x5f')][0x0]?_0x84f60e[_0xcef4('0x5f')][0x0]['value']:undefined)||'total'},{'name':_0xcef4('0x76'),'value':_0x84f60e[_0xcef4('0x76')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e['attrs'][0x1]?_0x84f60e[_0xcef4('0x5f')][0x1][_0xcef4('0x63')]:undefined)||null},{'name':'attrSerie3','value':_0x84f60e[_0xcef4('0x77')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e['attrs'][0x2]?_0x84f60e['attrs'][0x2][_0xcef4('0x63')]:undefined)||null},{'name':_0xcef4('0x6a'),'value':_0x84f60e[_0xcef4('0x6a')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e['attrs'][0x3]?_0x84f60e[_0xcef4('0x5f')][0x3]['value']:undefined)||[]},{'name':_0xcef4('0x6b'),'value':_0x84f60e[_0xcef4('0x6b')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x4]?_0x84f60e[_0xcef4('0x5f')][0x4][_0xcef4('0x63')]:undefined)||_0xcef4('0x6c')},{'name':_0xcef4('0x6d'),'value':_0x84f60e['attrEmailAccounts']||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e['attrs'][0x5]?_0x84f60e[_0xcef4('0x5f')][0x5]['value']:undefined)||''},{'name':_0xcef4('0x6e'),'value':_0x84f60e[_0xcef4('0x6e')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e['attrs'][0x6]?_0x84f60e[_0xcef4('0x5f')][0x6][_0xcef4('0x63')]:undefined)||''},{'name':_0xcef4('0x6f'),'value':_0x84f60e[_0xcef4('0x6f')]||(_0x84f60e['attrs']&&_0x84f60e[_0xcef4('0x5f')][0x7]?_0x84f60e[_0xcef4('0x5f')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x84f60e[_0xcef4('0x70')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x8]?_0x84f60e['attrs'][0x8][_0xcef4('0x63')]:undefined)||''},{'name':_0xcef4('0x71'),'value':_0x84f60e[_0xcef4('0x71')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x9]?_0x84f60e[_0xcef4('0x5f')][0x9]['value']:undefined)||''},{'name':_0xcef4('0x72'),'value':_0x84f60e[_0xcef4('0x72')]||(_0x84f60e['attrs']&&_0x84f60e['attrs'][0xa]?_0x84f60e[_0xcef4('0x5f')][0xa][_0xcef4('0x63')]:undefined)||''}];case _0xcef4('0x78'):return[{'name':'attrReport','type':_0x84f60e[_0xcef4('0x79')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e['attrs'][0x0]?_0x84f60e[_0xcef4('0x5f')][0x0][_0xcef4('0x36')]:undefined)||null,'value':_0x84f60e[_0xcef4('0x7a')]||(_0x84f60e['attrs']&&_0x84f60e['attrs'][0x0]?_0x84f60e[_0xcef4('0x5f')][0x0][_0xcef4('0x63')]:undefined)||null},{'name':_0xcef4('0x7b'),'value':_0x84f60e[_0xcef4('0x7b')]||(_0x84f60e[_0xcef4('0x5f')]&&_0x84f60e[_0xcef4('0x5f')][0x1]?_0x84f60e['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x30b43){logger['error']('widgetAttributes:\x20%s',JSON[_0xcef4('0x7c')](_0x30b43));return[];}}exports[_0xcef4('0x7d')]=function(_0x453fcf,_0x348f3e,_0x154823){if(_0x453fcf['body']['id']){delete _0x453fcf[_0xcef4('0x4f')]['id'];}return db[_0xcef4('0x34')][_0xcef4('0x4d')]({'where':{'id':_0x453fcf[_0xcef4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x348f3e,null))['then'](function(_0x4251e7){if(_0x4251e7){_0x453fcf[_0xcef4('0x4f')]['DashboardId']=_0x4251e7['id'];_0x453fcf[_0xcef4('0x4f')][_0xcef4('0x5f')]=widgetAttributes(_0x453fcf[_0xcef4('0x4f')]);return db['DashboardItem'][_0xcef4('0x4e')](_0x453fcf[_0xcef4('0x4f')]);}})[_0xcef4('0x2c')](respondWithResult(_0x348f3e,null))['catch'](handleError(_0x348f3e,null));};exports[_0xcef4('0x7e')]=function(_0x1dba2f,_0x2c7fc1,_0x48febf){var _0x13d7a0={};var _0x1ecbfb={};var _0x3bad76;var _0x37facf;return db[_0xcef4('0x34')][_0xcef4('0x7f')]({'where':{'id':_0x1dba2f[_0xcef4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c7fc1,null))[_0xcef4('0x2c')](function(_0x24ff4a){if(_0x24ff4a){_0x3bad76=_0x24ff4a;_0x1ecbfb[_0xcef4('0x38')]=_[_0xcef4('0x3a')](db[_0xcef4('0x80')][_0xcef4('0x4c')]);_0x1ecbfb[_0xcef4('0x3b')]=_['keys'](_0x1dba2f[_0xcef4('0x3b')]);_0x1ecbfb[_0xcef4('0x3c')]=_[_0xcef4('0x3d')](_0x1ecbfb['model'],_0x1ecbfb['query']);_0x13d7a0[_0xcef4('0x3f')]=_[_0xcef4('0x3d')](_0x1ecbfb[_0xcef4('0x38')],qs[_0xcef4('0x3e')](_0x1dba2f['query'][_0xcef4('0x3e')]));_0x13d7a0['attributes']=_0x13d7a0[_0xcef4('0x3f')][_0xcef4('0x40')]?_0x13d7a0[_0xcef4('0x3f')]:_0x1ecbfb[_0xcef4('0x38')];_0x13d7a0[_0xcef4('0x41')]=qs['sort'](_0x1dba2f[_0xcef4('0x3b')][_0xcef4('0x42')]);_0x13d7a0[_0xcef4('0x43')]=qs[_0xcef4('0x3c')](_[_0xcef4('0x44')](_0x1dba2f[_0xcef4('0x3b')],_0x1ecbfb[_0xcef4('0x3c')]));if(_0x1dba2f[_0xcef4('0x3b')][_0xcef4('0x81')]){_0x13d7a0[_0xcef4('0x43')]=_[_0xcef4('0x45')](_0x13d7a0[_0xcef4('0x43')],{'$or':_[_0xcef4('0x39')](_0x13d7a0[_0xcef4('0x3f')],function(_0x3df242){var _0x4ac011={};_0x4ac011[_0x3df242]={'$like':'%'+_0x1dba2f[_0xcef4('0x3b')][_0xcef4('0x81')]+'%'};return _0x4ac011;})});}_0x13d7a0=_[_0xcef4('0x45')]({},_0x13d7a0,_0x1dba2f[_0xcef4('0x46')]);return _0x3bad76[_0xcef4('0x7e')](_0x13d7a0);}})[_0xcef4('0x2c')](function(_0x162e3b){if(_0x162e3b){_0x37facf=_0x162e3b[_0xcef4('0x40')];if(!_0x1dba2f[_0xcef4('0x3b')][_0xcef4('0x82')](_0xcef4('0x83'))){_0x13d7a0['limit']=qs[_0xcef4('0x23')](_0x1dba2f[_0xcef4('0x3b')][_0xcef4('0x23')]);_0x13d7a0[_0xcef4('0x21')]=qs[_0xcef4('0x21')](_0x1dba2f[_0xcef4('0x3b')][_0xcef4('0x21')]);}return _0x3bad76['getItems'](_0x13d7a0);}})[_0xcef4('0x2c')](function(_0x59366c){if(_0x59366c){return _0x59366c?{'count':_0x37facf,'rows':_0x59366c}:null;}})[_0xcef4('0x2c')](respondWithResult(_0x2c7fc1,null))[_0xcef4('0x4a')](handleError(_0x2c7fc1,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 72cffed..43d9da9 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 _0x6fcd=['setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x127c7e,_0x470192){var _0x45f955=function(_0x26dcea){while(--_0x26dcea){_0x127c7e['push'](_0x127c7e['shift']());}};_0x45f955(++_0x470192);}(_0x6fcd,0x19b));var _0xd6fc=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x6fcd[_0x565ed7];return _0x183ad7;};'use strict';var EventEmitter=require(_0xd6fc('0x0'));var Dashboard=require(_0xd6fc('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xd6fc('0x2')](0x0);var events={'afterCreate':_0xd6fc('0x3'),'afterUpdate':_0xd6fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2725d0){return function(_0x78ea60,_0x27b602,_0x418485){DashboardEvents['emit'](_0x2725d0+':'+_0x78ea60['id'],_0x78ea60);DashboardEvents[_0xd6fc('0x5')](_0x2725d0,_0x78ea60);_0x418485(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd6fc('0x6')]=DashboardEvents; \ No newline at end of file +var _0x74f7=['emit','hasOwnProperty','hook','Dashboard','setMaxListeners','save'];(function(_0x1db831,_0x42b7b5){var _0x39ba56=function(_0x2c2dd3){while(--_0x2c2dd3){_0x1db831['push'](_0x1db831['shift']());}};_0x39ba56(++_0x42b7b5);}(_0x74f7,0xbd));var _0x774f=function(_0x24abca,_0x30c84c){_0x24abca=_0x24abca-0x0;var _0xd691d3=_0x74f7[_0x24abca];return _0xd691d3;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0x774f('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x774f('0x1')](0x0);var events={'afterCreate':_0x774f('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4bd40a){return function(_0x3e996f,_0x232bc1,_0x12dac3){DashboardEvents[_0x774f('0x3')](_0x4bd40a+':'+_0x3e996f['id'],_0x3e996f);DashboardEvents[_0x774f('0x3')](_0x4bd40a,_0x3e996f);_0x12dac3(null);};}for(var e in events){if(events[_0x774f('0x4')](e)){var event=events[e];Dashboard[_0x774f('0x5')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 643fc7a..9cc8b62 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 _0x4457=['dashboards','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard'];(function(_0x1493b9,_0x4eb7db){var _0x11514f=function(_0x45409a){while(--_0x45409a){_0x1493b9['push'](_0x1493b9['shift']());}};_0x11514f(++_0x4eb7db);}(_0x4457,0xe1));var _0x7445=function(_0x2977fa,_0x1bef01){_0x2977fa=_0x2977fa-0x0;var _0x2a489f=_0x4457[_0x2977fa];return _0x2a489f;};'use strict';var _=require(_0x7445('0x0'));var util=require(_0x7445('0x1'));var logger=require(_0x7445('0x2'))(_0x7445('0x3'));var moment=require(_0x7445('0x4'));var BPromise=require(_0x7445('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7445('0x6'));var rimraf=require(_0x7445('0x7'));var config=require(_0x7445('0x8'));var attributes=require(_0x7445('0x9'));module[_0x7445('0xa')]=function(_0x168d39,_0x359792){return _0x168d39[_0x7445('0xb')](_0x7445('0xc'),attributes,{'tableName':_0x7445('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea15=['../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1e5e17,_0x159cb9){var _0xa8227d=function(_0xe0515a){while(--_0xe0515a){_0x1e5e17['push'](_0x1e5e17['shift']());}};_0xa8227d(++_0x159cb9);}(_0xea15,0x18c));var _0x5ea1=function(_0x542368,_0x4f7aa9){_0x542368=_0x542368-0x0;var _0x28836f=_0xea15[_0x542368];return _0x28836f;};'use strict';var _=require(_0x5ea1('0x0'));var util=require(_0x5ea1('0x1'));var logger=require(_0x5ea1('0x2'))(_0x5ea1('0x3'));var moment=require(_0x5ea1('0x4'));var BPromise=require(_0x5ea1('0x5'));var rp=require(_0x5ea1('0x6'));var fs=require('fs');var path=require(_0x5ea1('0x7'));var rimraf=require(_0x5ea1('0x8'));var config=require(_0x5ea1('0x9'));var attributes=require(_0x5ea1('0xa'));module[_0x5ea1('0xb')]=function(_0x306088,_0x5b09c6){return _0x306088[_0x5ea1('0xc')](_0x5ea1('0xd'),attributes,{'tableName':_0x5ea1('0xe'),'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 3da6879..d8b802d 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 _0xa945=['info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then'];(function(_0x577f8c,_0x5386f1){var _0x5c28fd=function(_0x40592f){while(--_0x40592f){_0x577f8c['push'](_0x577f8c['shift']());}};_0x5c28fd(++_0x5386f1);}(_0xa945,0xfd));var _0x5a94=function(_0x88d72b,_0x161055){_0x88d72b=_0x88d72b-0x0;var _0x15a298=_0xa945[_0x88d72b];return _0x15a298;};'use strict';var _=require(_0x5a94('0x0'));var util=require('util');var moment=require(_0x5a94('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a94('0x2'));var fs=require('fs');var Redis=require(_0x5a94('0x3'));var db=require(_0x5a94('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a94('0x5'))(_0x5a94('0x6'));var config=require(_0x5a94('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5a94('0x8')][_0x5a94('0x9')]({'port':0x232a});config[_0x5a94('0xa')]=_[_0x5a94('0xb')](config[_0x5a94('0xa')],{'host':_0x5a94('0xc'),'port':0x18eb});var socket=require(_0x5a94('0xd'))(new Redis(config['redis']));require(_0x5a94('0xe'))['register'](socket);function respondWithRpcPromise(_0x7be798,_0x26d08a,_0x8247a4){return new BPromise(function(_0xd7b1ea,_0x4a94d1){return client[_0x5a94('0xf')](_0x7be798,_0x8247a4)[_0x5a94('0x10')](function(_0x220252){logger[_0x5a94('0x11')](_0x5a94('0x12'),_0x26d08a,'request\x20sent');logger[_0x5a94('0x13')](_0x5a94('0x14'),_0x26d08a,_0x5a94('0x15'),JSON['stringify'](_0x220252));if(_0x220252['error']){if(_0x220252['error'][_0x5a94('0x16')]===0x1f4){logger['error'](_0x5a94('0x12'),_0x26d08a,_0x220252[_0x5a94('0x17')][_0x5a94('0x18')]);return _0x4a94d1(_0x220252[_0x5a94('0x17')]['message']);}logger[_0x5a94('0x17')](_0x5a94('0x12'),_0x26d08a,_0x220252[_0x5a94('0x17')]['message']);return _0xd7b1ea(_0x220252[_0x5a94('0x17')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x26d08a,_0x5a94('0x15'));_0xd7b1ea(_0x220252[_0x5a94('0x19')][_0x5a94('0x18')]);}})[_0x5a94('0x1a')](function(_0x564c11){logger[_0x5a94('0x17')](_0x5a94('0x12'),_0x26d08a,_0x564c11);_0x4a94d1(_0x564c11);});});} \ No newline at end of file +var _0x3f31=['Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','defaults','redis','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x3f31,0x134));var _0x13f3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3f31[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x13f3('0x0'));var moment=require('moment');var BPromise=require(_0x13f3('0x1'));var rs=require(_0x13f3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13f3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x13f3('0x4'))('rpc');var config=require(_0x13f3('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x13f3('0x6')]({'port':0x232a});config['redis']=_[_0x13f3('0x7')](config[_0x13f3('0x8')],{'host':_0x13f3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13f3('0x8')]));require(_0x13f3('0xa'))[_0x13f3('0xb')](socket);function respondWithRpcPromise(_0x2b1f93,_0x381958,_0x1ce5e4){return new BPromise(function(_0x520557,_0x18704c){return client[_0x13f3('0xc')](_0x2b1f93,_0x1ce5e4)[_0x13f3('0xd')](function(_0x14ea8a){logger[_0x13f3('0xe')](_0x13f3('0xf'),_0x381958,'request\x20sent');logger[_0x13f3('0x10')](_0x13f3('0x11'),_0x381958,_0x13f3('0x12'),JSON[_0x13f3('0x13')](_0x14ea8a));if(_0x14ea8a[_0x13f3('0x14')]){if(_0x14ea8a[_0x13f3('0x14')][_0x13f3('0x15')]===0x1f4){logger[_0x13f3('0x14')](_0x13f3('0xf'),_0x381958,_0x14ea8a[_0x13f3('0x14')][_0x13f3('0x16')]);return _0x18704c(_0x14ea8a['error']['message']);}logger[_0x13f3('0x14')](_0x13f3('0xf'),_0x381958,_0x14ea8a[_0x13f3('0x14')][_0x13f3('0x16')]);return _0x520557(_0x14ea8a[_0x13f3('0x14')][_0x13f3('0x16')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x381958,_0x13f3('0x12'));_0x520557(_0x14ea8a[_0x13f3('0x17')][_0x13f3('0x16')]);}})[_0x13f3('0x18')](function(_0x3fa6c4){logger[_0x13f3('0x14')]('Dashboard,\x20%s,\x20%s',_0x381958,_0x3fa6c4);_0x18704c(_0x3fa6c4);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5060ffb..fed8449 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 _0xb51a=['save','remove','update','emit','removeListener','register','length','dashboard:'];(function(_0x4a1488,_0xad4189){var _0xbb51b2=function(_0xadd212){while(--_0xadd212){_0x4a1488['push'](_0x4a1488['shift']());}};_0xbb51b2(++_0xad4189);}(_0xb51a,0x1a8));var _0xab51=function(_0x3a5297,_0x17d53e){_0x3a5297=_0x3a5297-0x0;var _0x2737ca=_0xb51a[_0x3a5297];return _0x2737ca;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xab51('0x0'),_0xab51('0x1'),_0xab51('0x2')];function createListener(_0x5ca83a,_0x1be89a){return function(_0x40e4a7){_0x1be89a[_0xab51('0x3')](_0x5ca83a,_0x40e4a7);};}function removeListener(_0x56dd2c,_0x397a6d){return function(){DashboardEvents[_0xab51('0x4')](_0x56dd2c,_0x397a6d);};}exports[_0xab51('0x5')]=function(_0x5c418e){for(var _0x42a5bc=0x0,_0x4dc09a=events[_0xab51('0x6')];_0x42a5bc<_0x4dc09a;_0x42a5bc++){var _0x58bda4=events[_0x42a5bc];var _0x3e54e7=createListener(_0xab51('0x7')+_0x58bda4,_0x5c418e);DashboardEvents['on'](_0x58bda4,_0x3e54e7);}}; \ No newline at end of file +var _0x9d14=['./dashboard.events','save','update','emit','removeListener','register','length','dashboard:'];(function(_0x2b3470,_0x5b5cbe){var _0x4b3e78=function(_0x1cafa4){while(--_0x1cafa4){_0x2b3470['push'](_0x2b3470['shift']());}};_0x4b3e78(++_0x5b5cbe);}(_0x9d14,0x170));var _0x49d1=function(_0x245b23,_0x58e295){_0x245b23=_0x245b23-0x0;var _0x3282b8=_0x9d14[_0x245b23];return _0x3282b8;};'use strict';var DashboardEvents=require(_0x49d1('0x0'));var events=[_0x49d1('0x1'),'remove',_0x49d1('0x2')];function createListener(_0x469603,_0x13a684){return function(_0x27e5b2){_0x13a684[_0x49d1('0x3')](_0x469603,_0x27e5b2);};}function removeListener(_0x1fa289,_0x156aff){return function(){DashboardEvents[_0x49d1('0x4')](_0x1fa289,_0x156aff);};}exports[_0x49d1('0x5')]=function(_0x2fca76){for(var _0x59fe45=0x0,_0x413a1b=events[_0x49d1('0x6')];_0x59fe45<_0x413a1b;_0x59fe45++){var _0x1e139d=events[_0x59fe45];var _0x20c195=createListener(_0x49d1('0x7')+_0x1e139d,_0x2fca76);DashboardEvents['on'](_0x1e139d,_0x20c195);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 9a31474..176edb4 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 _0xd9c3=['../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','/:id','show','get','/:id/items','getItems','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x514244,_0x3d5e2c){var _0xdcd1f6=function(_0x36a417){while(--_0x36a417){_0x514244['push'](_0x514244['shift']());}};_0xdcd1f6(++_0x3d5e2c);}(_0xd9c3,0x8f));var _0x3d9c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xd9c3[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x3d9c('0x0'));var util=require(_0x3d9c('0x1'));var path=require(_0x3d9c('0x2'));var timeout=require(_0x3d9c('0x3'));var express=require('express');var router=express[_0x3d9c('0x4')]();var fs_extra=require(_0x3d9c('0x5'));var auth=require(_0x3d9c('0x6'));var interaction=require(_0x3d9c('0x7'));var config=require(_0x3d9c('0x8'));var controller=require(_0x3d9c('0x9'));router['get']('/',auth[_0x3d9c('0xa')](),controller[_0x3d9c('0xb')]);router['get'](_0x3d9c('0xc'),auth[_0x3d9c('0xa')](),controller[_0x3d9c('0xd')]);router[_0x3d9c('0xe')](_0x3d9c('0xf'),auth['isAuthenticated'](),controller[_0x3d9c('0x10')]);router[_0x3d9c('0x11')]('/',auth[_0x3d9c('0xa')](),controller['create']);router['post'](_0x3d9c('0x12'),auth[_0x3d9c('0xa')](),controller[_0x3d9c('0x13')]);router[_0x3d9c('0x11')](_0x3d9c('0xf'),auth[_0x3d9c('0xa')](),controller['addItem']);router[_0x3d9c('0x14')](_0x3d9c('0xc'),auth[_0x3d9c('0xa')](),controller[_0x3d9c('0x15')]);router[_0x3d9c('0x16')](_0x3d9c('0xc'),auth['isAuthenticated'](),controller[_0x3d9c('0x17')]);module[_0x3d9c('0x18')]=router; \ No newline at end of file +var _0x4e22=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create','clone','addItem','update','delete','destroy','exports','multer'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x4e22,0x113));var _0x24e2=function(_0x6cb90a,_0x47bc85){_0x6cb90a=_0x6cb90a-0x0;var _0x16d357=_0x4e22[_0x6cb90a];return _0x16d357;};'use strict';var multer=require(_0x24e2('0x0'));var util=require(_0x24e2('0x1'));var path=require(_0x24e2('0x2'));var timeout=require(_0x24e2('0x3'));var express=require(_0x24e2('0x4'));var router=express[_0x24e2('0x5')]();var fs_extra=require(_0x24e2('0x6'));var auth=require(_0x24e2('0x7'));var interaction=require(_0x24e2('0x8'));var config=require('../../config/environment');var controller=require('./dashboard.controller');router[_0x24e2('0x9')]('/',auth[_0x24e2('0xa')](),controller[_0x24e2('0xb')]);router[_0x24e2('0x9')](_0x24e2('0xc'),auth[_0x24e2('0xa')](),controller['show']);router[_0x24e2('0x9')](_0x24e2('0xd'),auth[_0x24e2('0xa')](),controller[_0x24e2('0xe')]);router[_0x24e2('0xf')]('/',auth[_0x24e2('0xa')](),controller[_0x24e2('0x10')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x24e2('0x11')]);router[_0x24e2('0xf')](_0x24e2('0xd'),auth['isAuthenticated'](),controller[_0x24e2('0x12')]);router['put'](_0x24e2('0xc'),auth[_0x24e2('0xa')](),controller[_0x24e2('0x13')]);router[_0x24e2('0x14')](_0x24e2('0xc'),auth[_0x24e2('0xa')](),controller[_0x24e2('0x15')]);module[_0x24e2('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 0e048fd..bf80ff6 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 _0x90b1=['#2196f3','sequelize','squel','lodash','STRING','TEXT','long','parse','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x395d09,_0x5c8be5){var _0x30316a=function(_0xf2bb50){while(--_0xf2bb50){_0x395d09['push'](_0x395d09['shift']());}};_0x30316a(++_0x5c8be5);}(_0x90b1,0x1bb));var _0x190b=function(_0x5473da,_0x49396c){_0x5473da=_0x5473da-0x0;var _0x3b0928=_0x90b1[_0x5473da];return _0x3b0928;};'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 +var _0x5fc3=['squel','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0x5fc3[_0x47df54];return _0x261b87;};'use strict';var Sequelize=require(_0x35fc('0x0'));var squel=require(_0x35fc('0x1'));var _=require('lodash');module[_0x35fc('0x2')]={'title':{'type':Sequelize[_0x35fc('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x35fc('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x35fc('0x4')](_0x35fc('0x5')),'get':function(){try{return JSON['parse'](this[_0x35fc('0x6')](_0x35fc('0x7')));}catch(_0x186a06){return[];}},'set':function(_0x5b85ad){try{this['setDataValue'](_0x35fc('0x7'),JSON['stringify'](_0x5b85ad));}catch(_0x16e153){this[_0x35fc('0x8')](_0x35fc('0x7'),JSON[_0x35fc('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x35fc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x35fc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x35fc('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x35fc('0x3')],'allowNull':![],'defaultValue':_0x35fc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x35fc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x35fc('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 e91fdfa..00ffd96 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 _0x524e=['attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','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','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','stack','name','send','params','model','DashboardItem','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','type','iframe'];(function(_0x21cc56,_0x1ce4f1){var _0x5a8ce3=function(_0x1fb110){while(--_0x1fb110){_0x21cc56['push'](_0x21cc56['shift']());}};_0x5a8ce3(++_0x1ce4f1);}(_0x524e,0x15e));var _0xe524=function(_0x2c76be,_0x21ccd6){_0x2c76be=_0x2c76be-0x0;var _0x149bb3=_0x524e[_0x2c76be];return _0x149bb3;};'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'];config['redis']=_['defaults'](config[_0xe524('0x1c')],{'host':_0xe524('0x1d'),'port':0x18eb});var socket=require(_0xe524('0x1e'))(new Redis(config[_0xe524('0x1c')]));require(_0xe524('0x1f'))['register'](socket);function respondWithStatusCode(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xcc;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x20')](_0x51e9fe);}return _0x12ff75['status'](_0x51e9fe)[_0xe524('0x21')]();};}function respondWithResult(_0x488fce,_0x109795){_0x109795=_0x109795||0xc8;return function(_0x538754){if(_0x538754){return _0x488fce[_0xe524('0x22')](_0x109795)['json'](_0x538754);}};}function respondWithFilteredResult(_0x5c8736,_0x5a5c0d){return function(_0x3a4027){if(_0x3a4027){var _0x4f1dfb=typeof _0x5a5c0d[_0xe524('0x23')]===_0xe524('0x24')&&typeof _0x5a5c0d[_0xe524('0x25')]===_0xe524('0x24');var _0x5d7b17=_0x3a4027[_0xe524('0x26')];var _0x3ccb3f=_0x4f1dfb?0x0:_0x5a5c0d['offset'];var _0x467c2a=_0x4f1dfb?_0x3a4027[_0xe524('0x26')]:_0x5a5c0d[_0xe524('0x23')]+_0x5a5c0d[_0xe524('0x25')];var _0x1c4194;if(_0x467c2a>=_0x5d7b17){_0x467c2a=_0x5d7b17;_0x1c4194=0xc8;}else{_0x1c4194=0xce;}_0x5c8736[_0xe524('0x22')](_0x1c4194);return _0x5c8736[_0xe524('0x27')](_0xe524('0x28'),_0x3ccb3f+'-'+_0x467c2a+'/'+_0x5d7b17)[_0xe524('0x29')](_0x3a4027);}return null;};}function patchUpdates(_0x5c4d21){return function(_0x7d1f92){try{jsonpatch['apply'](_0x7d1f92,_0x5c4d21,!![]);}catch(_0x577d1f){return BPromise[_0xe524('0x2a')](_0x577d1f);}return _0x7d1f92[_0xe524('0x2b')]();};}function saveUpdates(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x2c')](_0x1ad106)['then'](function(_0x17e245){return _0x17e245;});}return null;};}function removeEntity(_0xcf5db,_0xd62772){return function(_0x3cd922){if(_0x3cd922){return _0x3cd922[_0xe524('0x2d')]()[_0xe524('0x2e')](function(){_0xcf5db[_0xe524('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58a896,_0x283f18){return function(_0x45abad){if(!_0x45abad){_0x58a896[_0xe524('0x20')](0x194);}return _0x45abad;};}function handleError(_0x109a96,_0x359c8b){_0x359c8b=_0x359c8b||0x1f4;return function(_0x5405e4){logger['error'](_0x5405e4[_0xe524('0x2f')]);if(_0x5405e4[_0xe524('0x30')]){delete _0x5405e4[_0xe524('0x30')];}_0x109a96[_0xe524('0x22')](_0x359c8b)[_0xe524('0x31')](_0x5405e4);};}exports['show']=function(_0x365a1f,_0x9a7e98){var _0x4a4e15={'raw':![],'where':{'id':_0x365a1f[_0xe524('0x32')]['id']}},_0x5b7ded={};_0x5b7ded[_0xe524('0x33')]=_['keys'](db[_0xe524('0x34')]['rawAttributes']);_0x5b7ded[_0xe524('0x35')]=_['keys'](_0x365a1f[_0xe524('0x35')]);_0x5b7ded[_0xe524('0x36')]=_[_0xe524('0x37')](_0x5b7ded['model'],_0x5b7ded[_0xe524('0x35')]);_0x4a4e15['attributes']=_[_0xe524('0x37')](_0x5b7ded[_0xe524('0x33')],qs[_0xe524('0x38')](_0x365a1f['query'][_0xe524('0x38')]));_0x4a4e15[_0xe524('0x39')]=_0x4a4e15['attributes'][_0xe524('0x3a')]?_0x4a4e15[_0xe524('0x39')]:_0x5b7ded[_0xe524('0x33')];if(_0x365a1f[_0xe524('0x35')]['includeAll']){_0x4a4e15[_0xe524('0x3b')]=[{'all':!![]}];}_0x4a4e15=_[_0xe524('0x3c')]({},_0x4a4e15,_0x365a1f[_0xe524('0x3d')]);return db[_0xe524('0x34')][_0xe524('0x3e')](_0x4a4e15)[_0xe524('0x2e')](handleEntityNotFound(_0x9a7e98,null))[_0xe524('0x2e')](respondWithResult(_0x9a7e98,null))[_0xe524('0x3f')](handleError(_0x9a7e98,null));};exports['destroy']=function(_0x150a9f,_0x56f371){return db[_0xe524('0x34')][_0xe524('0x3e')]({'where':{'id':_0x150a9f['params']['id']}})[_0xe524('0x2e')](handleEntityNotFound(_0x56f371,null))['then'](removeEntity(_0x56f371,null))[_0xe524('0x3f')](handleError(_0x56f371,null));};function widgetAttributes(_0x41af26){try{switch(_0x41af26[_0xe524('0x40')]){case _0xe524('0x41'):return[{'name':_0xe524('0x42'),'value':_0x41af26[_0xe524('0x42')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0][_0xe524('0x44')]:undefined)||_0xe524('0x45')}];case _0xe524('0x46'):return[{'name':_0xe524('0x47'),'value':_0x41af26[_0xe524('0x47')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26[_0xe524('0x43')][0x0]['value']:undefined)||''}];case _0xe524('0x48'):return[{'name':_0xe524('0x49'),'value':_0x41af26[_0xe524('0x49')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0][_0xe524('0x44')]:undefined)||_0xe524('0x4a')},{'name':_0xe524('0x4b'),'value':_0x41af26[_0xe524('0x4b')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1]['value']:undefined)||_0xe524('0x4c')},{'name':_0xe524('0x4d'),'value':_0x41af26[_0xe524('0x4d')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x2]?_0x41af26[_0xe524('0x43')][0x2]['value']:undefined)||0xc}];case _0xe524('0x4e'):return[{'name':_0xe524('0x4f'),'value':_0x41af26[_0xe524('0x4f')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0]['value']:undefined)||_0xe524('0x50')},{'name':_0xe524('0x51'),'value':_0x41af26['attrVoiceQueues']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1][_0xe524('0x44')]:undefined)||[]},{'name':'attrFontSize','value':_0x41af26['attrFontSize']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x2]?_0x41af26['attrs'][0x2][_0xe524('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x41af26[_0xe524('0x52')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x3]?_0x41af26[_0xe524('0x43')][0x3][_0xe524('0x44')]:undefined)||_0xe524('0x53')},{'name':_0xe524('0x54'),'value':_0x41af26[_0xe524('0x54')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x4]?_0x41af26[_0xe524('0x43')][0x4][_0xe524('0x44')]:undefined)||''},{'name':_0xe524('0x55'),'value':_0x41af26[_0xe524('0x55')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26['attrs'][0x5]?_0x41af26[_0xe524('0x43')][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x41af26[_0xe524('0x56')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x6]?_0x41af26[_0xe524('0x43')][0x6]['value']:undefined)||''},{'name':_0xe524('0x57'),'value':_0x41af26['attrOpenchannelAccounts']||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x7]?_0x41af26[_0xe524('0x43')][0x7][_0xe524('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x41af26['attrWhatsappAccounts']||(_0x41af26['attrs']&&_0x41af26['attrs'][0x8]?_0x41af26['attrs'][0x8]['value']:undefined)||''},{'name':_0xe524('0x58'),'value':_0x41af26[_0xe524('0x58')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x9]?_0x41af26[_0xe524('0x43')][0x9][_0xe524('0x44')]:undefined)||''}];case _0xe524('0x59'):case _0xe524('0x5a'):return[{'name':'attrSerie1','value':_0x41af26[_0xe524('0x5b')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26['attrs'][0x0][_0xe524('0x44')]:undefined)||'total'},{'name':_0xe524('0x5c'),'value':_0x41af26[_0xe524('0x5c')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1][_0xe524('0x44')]:undefined)||null},{'name':_0xe524('0x5d'),'value':_0x41af26[_0xe524('0x5d')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x2]?_0x41af26[_0xe524('0x43')][0x2][_0xe524('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x41af26['attrVoiceQueues']||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x3]?_0x41af26[_0xe524('0x43')][0x3][_0xe524('0x44')]:undefined)||[]},{'name':_0xe524('0x52'),'value':_0x41af26[_0xe524('0x52')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x4]?_0x41af26[_0xe524('0x43')][0x4][_0xe524('0x44')]:undefined)||_0xe524('0x53')},{'name':_0xe524('0x54'),'value':_0x41af26['attrEmailAccounts']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x5]?_0x41af26['attrs'][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x41af26['attrFaxAccounts']||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x6]?_0x41af26[_0xe524('0x43')][0x6][_0xe524('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x41af26[_0xe524('0x56')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0x7]?_0x41af26[_0xe524('0x43')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x41af26['attrOpenchannelAccounts']||(_0x41af26[_0xe524('0x43')]&&_0x41af26['attrs'][0x8]?_0x41af26[_0xe524('0x43')][0x8][_0xe524('0x44')]:undefined)||''},{'name':_0xe524('0x5e'),'value':_0x41af26[_0xe524('0x5e')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26['attrs'][0x9]?_0x41af26['attrs'][0x9][_0xe524('0x44')]:undefined)||''},{'name':_0xe524('0x58'),'value':_0x41af26[_0xe524('0x58')]||(_0x41af26[_0xe524('0x43')]&&_0x41af26[_0xe524('0x43')][0xa]?_0x41af26[_0xe524('0x43')][0xa]['value']:undefined)||''}];case _0xe524('0x5f'):return[{'name':_0xe524('0x60'),'type':_0x41af26[_0xe524('0x61')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26[_0xe524('0x43')][0x0][_0xe524('0x40')]:undefined)||null,'value':_0x41af26['attrReport']||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x0]?_0x41af26[_0xe524('0x43')][0x0][_0xe524('0x44')]:undefined)||null},{'name':_0xe524('0x62'),'value':_0x41af26[_0xe524('0x62')]||(_0x41af26['attrs']&&_0x41af26[_0xe524('0x43')][0x1]?_0x41af26[_0xe524('0x43')][0x1][_0xe524('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x21a625){logger[_0xe524('0x63')](_0xe524('0x64'),JSON[_0xe524('0x65')](_0x21a625));return[];}}exports[_0xe524('0x66')]=function(_0x27c55c,_0x7e5992){if(_0x27c55c[_0xe524('0x67')]){_0x27c55c['body'][_0xe524('0x43')]=widgetAttributes(_0x27c55c[_0xe524('0x67')]);}return db[_0xe524('0x34')][_0xe524('0x66')](_0x27c55c[_0xe524('0x67')],{})['then'](respondWithResult(_0x7e5992,0xc9))[_0xe524('0x3f')](handleError(_0x7e5992,null));};exports[_0xe524('0x2c')]=function(_0x2ea4c9,_0x32d11a){if(_0x2ea4c9[_0xe524('0x67')]['id']){delete _0x2ea4c9[_0xe524('0x67')]['id'];}_0x2ea4c9[_0xe524('0x67')]['attrs']=widgetAttributes(_0x2ea4c9[_0xe524('0x67')]);return db[_0xe524('0x34')][_0xe524('0x3e')]({'where':{'id':_0x2ea4c9[_0xe524('0x32')]['id']}})['then'](handleEntityNotFound(_0x32d11a,null))[_0xe524('0x2e')](saveUpdates(_0x2ea4c9['body'],null))[_0xe524('0x2e')](respondWithResult(_0x32d11a,null))[_0xe524('0x3f')](handleError(_0x32d11a,null));}; \ No newline at end of file +var _0x23f4=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','options','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0x23f4,0x1ee));var _0x423f=function(_0x25a04a,_0x406d16){_0x25a04a=_0x25a04a-0x0;var _0x476b6b=_0x23f4[_0x25a04a];return _0x476b6b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];config[_0x423f('0x16')]=_[_0x423f('0x17')](config['redis'],{'host':_0x423f('0x18'),'port':0x18eb});var socket=require(_0x423f('0x19'))(new Redis(config[_0x423f('0x16')]));require(_0x423f('0x1a'))[_0x423f('0x1b')](socket);function respondWithStatusCode(_0x3b531d,_0x1f6423){_0x1f6423=_0x1f6423||0xcc;return function(_0x21d804){if(_0x21d804){return _0x3b531d[_0x423f('0x1c')](_0x1f6423);}return _0x3b531d[_0x423f('0x1d')](_0x1f6423)[_0x423f('0x1e')]();};}function respondWithResult(_0x276be1,_0x14cba9){_0x14cba9=_0x14cba9||0xc8;return function(_0x1fef4d){if(_0x1fef4d){return _0x276be1[_0x423f('0x1d')](_0x14cba9)[_0x423f('0x1f')](_0x1fef4d);}};}function respondWithFilteredResult(_0x3fd56d,_0x34e968){return function(_0x26b6d1){if(_0x26b6d1){var _0x5424e6=typeof _0x34e968[_0x423f('0x20')]==='undefined'&&typeof _0x34e968['limit']===_0x423f('0x21');var _0x4956e0=_0x26b6d1[_0x423f('0x22')];var _0xd7b80e=_0x5424e6?0x0:_0x34e968['offset'];var _0x45b46d=_0x5424e6?_0x26b6d1[_0x423f('0x22')]:_0x34e968['offset']+_0x34e968[_0x423f('0x23')];var _0x2ebe74;if(_0x45b46d>=_0x4956e0){_0x45b46d=_0x4956e0;_0x2ebe74=0xc8;}else{_0x2ebe74=0xce;}_0x3fd56d['status'](_0x2ebe74);return _0x3fd56d[_0x423f('0x24')](_0x423f('0x25'),_0xd7b80e+'-'+_0x45b46d+'/'+_0x4956e0)['json'](_0x26b6d1);}return null;};}function patchUpdates(_0x54f47){return function(_0x5ec3a8){try{jsonpatch[_0x423f('0x26')](_0x5ec3a8,_0x54f47,!![]);}catch(_0x3c942e){return BPromise[_0x423f('0x27')](_0x3c942e);}return _0x5ec3a8[_0x423f('0x28')]();};}function saveUpdates(_0xb82e8d,_0x39e72d){return function(_0x14ef6c){if(_0x14ef6c){return _0x14ef6c[_0x423f('0x29')](_0xb82e8d)[_0x423f('0x2a')](function(_0x36f57f){return _0x36f57f;});}return null;};}function removeEntity(_0x45889f,_0x199196){return function(_0xb91ed8){if(_0xb91ed8){return _0xb91ed8[_0x423f('0x2b')]()['then'](function(){_0x45889f[_0x423f('0x1d')](0xcc)[_0x423f('0x1e')]();});}};}function handleEntityNotFound(_0x1b347a,_0x593f9d){return function(_0x4fc44d){if(!_0x4fc44d){_0x1b347a[_0x423f('0x1c')](0x194);}return _0x4fc44d;};}function handleError(_0x496c25,_0x323c61){_0x323c61=_0x323c61||0x1f4;return function(_0x4c2f21){logger['error'](_0x4c2f21[_0x423f('0x2c')]);if(_0x4c2f21[_0x423f('0x2d')]){delete _0x4c2f21['name'];}_0x496c25[_0x423f('0x1d')](_0x323c61)[_0x423f('0x2e')](_0x4c2f21);};}exports[_0x423f('0x2f')]=function(_0x1da775,_0x518c1e){var _0x6dcc7a={'raw':![],'where':{'id':_0x1da775[_0x423f('0x30')]['id']}},_0x332bbc={};_0x332bbc[_0x423f('0x31')]=_['keys'](db[_0x423f('0x32')][_0x423f('0x33')]);_0x332bbc[_0x423f('0x34')]=_[_0x423f('0x35')](_0x1da775[_0x423f('0x34')]);_0x332bbc[_0x423f('0x36')]=_[_0x423f('0x37')](_0x332bbc[_0x423f('0x31')],_0x332bbc[_0x423f('0x34')]);_0x6dcc7a[_0x423f('0x38')]=_['intersection'](_0x332bbc[_0x423f('0x31')],qs[_0x423f('0x39')](_0x1da775[_0x423f('0x34')]['fields']));_0x6dcc7a[_0x423f('0x38')]=_0x6dcc7a['attributes'][_0x423f('0x3a')]?_0x6dcc7a[_0x423f('0x38')]:_0x332bbc[_0x423f('0x31')];if(_0x1da775[_0x423f('0x34')][_0x423f('0x3b')]){_0x6dcc7a['include']=[{'all':!![]}];}_0x6dcc7a=_['merge']({},_0x6dcc7a,_0x1da775[_0x423f('0x3c')]);return db[_0x423f('0x32')][_0x423f('0x3d')](_0x6dcc7a)[_0x423f('0x2a')](handleEntityNotFound(_0x518c1e,null))[_0x423f('0x2a')](respondWithResult(_0x518c1e,null))[_0x423f('0x3e')](handleError(_0x518c1e,null));};exports[_0x423f('0x2b')]=function(_0x183665,_0xd99eb0){return db[_0x423f('0x32')][_0x423f('0x3d')]({'where':{'id':_0x183665[_0x423f('0x30')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0xd99eb0,null))['then'](removeEntity(_0xd99eb0,null))['catch'](handleError(_0xd99eb0,null));};function widgetAttributes(_0x382f91){try{switch(_0x382f91[_0x423f('0x3f')]){case _0x423f('0x40'):return[{'name':_0x423f('0x41'),'value':_0x382f91[_0x423f('0x41')]||(_0x382f91['attrs']&&_0x382f91[_0x423f('0x42')][0x0]?_0x382f91[_0x423f('0x42')][0x0][_0x423f('0x43')]:undefined)||_0x423f('0x44')}];case _0x423f('0x45'):return[{'name':_0x423f('0x46'),'value':_0x382f91[_0x423f('0x46')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x0]?_0x382f91[_0x423f('0x42')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x423f('0x47'),'value':_0x382f91[_0x423f('0x47')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x0]?_0x382f91[_0x423f('0x42')][0x0][_0x423f('0x43')]:undefined)||'HH:mm:ss'},{'name':_0x423f('0x48'),'value':_0x382f91[_0x423f('0x48')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x1]?_0x382f91[_0x423f('0x42')][0x1][_0x423f('0x43')]:undefined)||_0x423f('0x49')},{'name':_0x423f('0x4a'),'value':_0x382f91['attrFontSize']||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x2]?_0x382f91[_0x423f('0x42')][0x2][_0x423f('0x43')]:undefined)||0xc}];case _0x423f('0x4b'):return[{'name':_0x423f('0x4c'),'value':_0x382f91[_0x423f('0x4c')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x0]?_0x382f91['attrs'][0x0][_0x423f('0x43')]:undefined)||'total'},{'name':_0x423f('0x4d'),'value':_0x382f91[_0x423f('0x4d')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x1]?_0x382f91[_0x423f('0x42')][0x1][_0x423f('0x43')]:undefined)||[]},{'name':_0x423f('0x4a'),'value':_0x382f91[_0x423f('0x4a')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x2]?_0x382f91[_0x423f('0x42')][0x2][_0x423f('0x43')]:undefined)||0x14},{'name':_0x423f('0x4e'),'value':_0x382f91[_0x423f('0x4e')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x3]?_0x382f91[_0x423f('0x42')][0x3][_0x423f('0x43')]:undefined)||_0x423f('0x4f')},{'name':_0x423f('0x50'),'value':_0x382f91['attrEmailAccounts']||(_0x382f91[_0x423f('0x42')]&&_0x382f91['attrs'][0x4]?_0x382f91[_0x423f('0x42')][0x4][_0x423f('0x43')]:undefined)||''},{'name':_0x423f('0x51'),'value':_0x382f91[_0x423f('0x51')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x5]?_0x382f91[_0x423f('0x42')][0x5][_0x423f('0x43')]:undefined)||''},{'name':_0x423f('0x52'),'value':_0x382f91[_0x423f('0x52')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x6]?_0x382f91['attrs'][0x6][_0x423f('0x43')]:undefined)||''},{'name':_0x423f('0x53'),'value':_0x382f91['attrOpenchannelAccounts']||(_0x382f91[_0x423f('0x42')]&&_0x382f91['attrs'][0x7]?_0x382f91[_0x423f('0x42')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x382f91[_0x423f('0x54')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x8]?_0x382f91[_0x423f('0x42')][0x8]['value']:undefined)||''},{'name':_0x423f('0x55'),'value':_0x382f91['attrChatWebsites']||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x9]?_0x382f91[_0x423f('0x42')][0x9][_0x423f('0x43')]:undefined)||''}];case _0x423f('0x56'):case _0x423f('0x57'):return[{'name':_0x423f('0x58'),'value':_0x382f91[_0x423f('0x58')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91['attrs'][0x0]?_0x382f91[_0x423f('0x42')][0x0][_0x423f('0x43')]:undefined)||'total'},{'name':_0x423f('0x59'),'value':_0x382f91['attrSerie2']||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x1]?_0x382f91[_0x423f('0x42')][0x1][_0x423f('0x43')]:undefined)||null},{'name':_0x423f('0x5a'),'value':_0x382f91[_0x423f('0x5a')]||(_0x382f91['attrs']&&_0x382f91['attrs'][0x2]?_0x382f91[_0x423f('0x42')][0x2][_0x423f('0x43')]:undefined)||null},{'name':_0x423f('0x4d'),'value':_0x382f91[_0x423f('0x4d')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x3]?_0x382f91[_0x423f('0x42')][0x3][_0x423f('0x43')]:undefined)||[]},{'name':_0x423f('0x4e'),'value':_0x382f91['attrChannel']||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x4]?_0x382f91['attrs'][0x4][_0x423f('0x43')]:undefined)||'voice'},{'name':_0x423f('0x50'),'value':_0x382f91[_0x423f('0x50')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91['attrs'][0x5]?_0x382f91['attrs'][0x5][_0x423f('0x43')]:undefined)||''},{'name':_0x423f('0x51'),'value':_0x382f91[_0x423f('0x51')]||(_0x382f91['attrs']&&_0x382f91[_0x423f('0x42')][0x6]?_0x382f91[_0x423f('0x42')][0x6][_0x423f('0x43')]:undefined)||''},{'name':_0x423f('0x52'),'value':_0x382f91[_0x423f('0x52')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x7]?_0x382f91['attrs'][0x7][_0x423f('0x43')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x382f91[_0x423f('0x53')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x8]?_0x382f91[_0x423f('0x42')][0x8]['value']:undefined)||''},{'name':_0x423f('0x54'),'value':_0x382f91[_0x423f('0x54')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91['attrs'][0x9]?_0x382f91[_0x423f('0x42')][0x9][_0x423f('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0x382f91[_0x423f('0x55')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91['attrs'][0xa]?_0x382f91['attrs'][0xa]['value']:undefined)||''}];case _0x423f('0x5b'):return[{'name':_0x423f('0x5c'),'type':_0x382f91[_0x423f('0x5d')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91['attrs'][0x0]?_0x382f91['attrs'][0x0][_0x423f('0x3f')]:undefined)||null,'value':_0x382f91[_0x423f('0x5c')]||(_0x382f91['attrs']&&_0x382f91[_0x423f('0x42')][0x0]?_0x382f91[_0x423f('0x42')][0x0][_0x423f('0x43')]:undefined)||null},{'name':_0x423f('0x5e'),'value':_0x382f91[_0x423f('0x5e')]||(_0x382f91[_0x423f('0x42')]&&_0x382f91[_0x423f('0x42')][0x1]?_0x382f91['attrs'][0x1][_0x423f('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x228224){logger['error'](_0x423f('0x5f'),JSON[_0x423f('0x60')](_0x228224));return[];}}exports[_0x423f('0x61')]=function(_0x5ce420,_0x334204){if(_0x5ce420[_0x423f('0x62')]){_0x5ce420[_0x423f('0x62')][_0x423f('0x42')]=widgetAttributes(_0x5ce420[_0x423f('0x62')]);}return db[_0x423f('0x32')][_0x423f('0x61')](_0x5ce420[_0x423f('0x62')],{})[_0x423f('0x2a')](respondWithResult(_0x334204,0xc9))['catch'](handleError(_0x334204,null));};exports[_0x423f('0x29')]=function(_0x12c3e4,_0x25e123){if(_0x12c3e4[_0x423f('0x62')]['id']){delete _0x12c3e4['body']['id'];}_0x12c3e4[_0x423f('0x62')][_0x423f('0x42')]=widgetAttributes(_0x12c3e4[_0x423f('0x62')]);return db[_0x423f('0x32')][_0x423f('0x3d')]({'where':{'id':_0x12c3e4[_0x423f('0x30')]['id']}})[_0x423f('0x2a')](handleEntityNotFound(_0x25e123,null))['then'](saveUpdates(_0x12c3e4[_0x423f('0x62')],null))[_0x423f('0x2a')](respondWithResult(_0x25e123,null))[_0x423f('0x3e')](handleError(_0x25e123,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index cf5e233..d7b2774 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 _0x1147=['hasOwnProperty','exports','events','DashboardItem','setMaxListeners','save','update','remove','emit'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x1147,0xf5));var _0x7114=function(_0xfa6bec,_0x1f9577){_0xfa6bec=_0xfa6bec-0x0;var _0x391fde=_0x1147[_0xfa6bec];return _0x391fde;};'use strict';var EventEmitter=require(_0x7114('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x7114('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7114('0x2')](0x0);var events={'afterCreate':_0x7114('0x3'),'afterUpdate':_0x7114('0x4'),'afterDestroy':_0x7114('0x5')};function emitEvent(_0x32e902){return function(_0x45c112,_0x1bdc17,_0x167c93){DashboardItemEvents[_0x7114('0x6')](_0x32e902+':'+_0x45c112['id'],_0x45c112);DashboardItemEvents['emit'](_0x32e902,_0x45c112);_0x167c93(null);};}for(var e in events){if(events[_0x7114('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x7114('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x2175=['../../mysqldb','setMaxListeners','remove','emit','hook','events'];(function(_0x2bf4db,_0x137b0e){var _0x5a648d=function(_0x1d18cb){while(--_0x1d18cb){_0x2bf4db['push'](_0x2bf4db['shift']());}};_0x5a648d(++_0x137b0e);}(_0x2175,0xa7));var _0x5217=function(_0x2f20ad,_0x20259b){_0x2f20ad=_0x2f20ad-0x0;var _0x12a065=_0x2175[_0x2f20ad];return _0x12a065;};'use strict';var EventEmitter=require(_0x5217('0x0'));var DashboardItem=require(_0x5217('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5217('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5217('0x3')};function emitEvent(_0x2b3f1e){return function(_0x1c9d91,_0xf3493a,_0x55ada2){DashboardItemEvents[_0x5217('0x4')](_0x2b3f1e+':'+_0x1c9d91['id'],_0x1c9d91);DashboardItemEvents[_0x5217('0x4')](_0x2b3f1e,_0x1c9d91);_0x55ada2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x5217('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index bb72e48..ea527ba 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 _0x3792=['define','DashboardItem','dashboard_items','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x492b1c,_0x58840e){var _0xfd2d4c=function(_0x468aa){while(--_0x468aa){_0x492b1c['push'](_0x492b1c['shift']());}};_0xfd2d4c(++_0x58840e);}(_0x3792,0x9f));var _0x2379=function(_0x20780a,_0x5dbfc1){_0x20780a=_0x20780a-0x0;var _0x24fd38=_0x3792[_0x20780a];return _0x24fd38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2379('0x0'))(_0x2379('0x1'));var moment=require(_0x2379('0x2'));var BPromise=require(_0x2379('0x3'));var rp=require(_0x2379('0x4'));var fs=require('fs');var path=require(_0x2379('0x5'));var rimraf=require(_0x2379('0x6'));var config=require(_0x2379('0x7'));var attributes=require(_0x2379('0x8'));module[_0x2379('0x9')]=function(_0x46f846,_0x1c600c){return _0x46f846[_0x2379('0xa')](_0x2379('0xb'),attributes,{'tableName':_0x2379('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x921f=['../../config/environment','./dashboardItem.attributes','define','DashboardItem','dashboard_items','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x208d75,_0x92d742){var _0x382d27=function(_0x3aaba3){while(--_0x3aaba3){_0x208d75['push'](_0x208d75['shift']());}};_0x382d27(++_0x92d742);}(_0x921f,0x186));var _0xf921=function(_0x1cfc4d,_0x1e391f){_0x1cfc4d=_0x1cfc4d-0x0;var _0xfcc875=_0x921f[_0x1cfc4d];return _0xfcc875;};'use strict';var _=require('lodash');var util=require(_0xf921('0x0'));var logger=require(_0xf921('0x1'))('api');var moment=require(_0xf921('0x2'));var BPromise=require(_0xf921('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf921('0x4'));var rimraf=require(_0xf921('0x5'));var config=require(_0xf921('0x6'));var attributes=require(_0xf921('0x7'));module['exports']=function(_0x32a96e,_0x5385a3){return _0x32a96e[_0xf921('0x8')](_0xf921('0x9'),attributes,{'tableName':_0xf921('0xa'),'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 060ea14..c0c3083 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 _0x78d2=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x84c44d,_0x3d577b){var _0x1abb29=function(_0xc6d1f8){while(--_0xc6d1f8){_0x84c44d['push'](_0x84c44d['shift']());}};_0x1abb29(++_0x3d577b);}(_0x78d2,0xf4));var _0x278d=function(_0xf5bda0,_0x2589e1){_0xf5bda0=_0xf5bda0-0x0;var _0x5303cb=_0x78d2[_0xf5bda0];return _0x5303cb;};'use strict';var _=require(_0x278d('0x0'));var util=require(_0x278d('0x1'));var moment=require(_0x278d('0x2'));var BPromise=require(_0x278d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x278d('0x4'));var db=require(_0x278d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x278d('0x6'));var config=require(_0x278d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x278d('0x8')]['http']({'port':0x232a});config[_0x278d('0x9')]=_[_0x278d('0xa')](config[_0x278d('0x9')],{'host':_0x278d('0xb'),'port':0x18eb});var socket=require(_0x278d('0xc'))(new Redis(config[_0x278d('0x9')]));require(_0x278d('0xd'))[_0x278d('0xe')](socket);function respondWithRpcPromise(_0x456acd,_0x59dd57,_0x1b6759){return new BPromise(function(_0xf84d2,_0x1e7c35){return client[_0x278d('0xf')](_0x456acd,_0x1b6759)[_0x278d('0x10')](function(_0x565132){logger['info'](_0x278d('0x11'),_0x59dd57,'request\x20sent');logger['debug'](_0x278d('0x12'),_0x59dd57,_0x278d('0x13'),JSON[_0x278d('0x14')](_0x565132));if(_0x565132[_0x278d('0x15')]){if(_0x565132[_0x278d('0x15')][_0x278d('0x16')]===0x1f4){logger[_0x278d('0x15')](_0x278d('0x11'),_0x59dd57,_0x565132[_0x278d('0x15')][_0x278d('0x17')]);return _0x1e7c35(_0x565132[_0x278d('0x15')]['message']);}logger[_0x278d('0x15')](_0x278d('0x11'),_0x59dd57,_0x565132[_0x278d('0x15')][_0x278d('0x17')]);return _0xf84d2(_0x565132['error'][_0x278d('0x17')]);}else{logger[_0x278d('0x18')](_0x278d('0x11'),_0x59dd57,_0x278d('0x13'));_0xf84d2(_0x565132[_0x278d('0x19')][_0x278d('0x17')]);}})[_0x278d('0x1a')](function(_0x3b6a87){logger[_0x278d('0x15')](_0x278d('0x11'),_0x59dd57,_0x3b6a87);_0x1e7c35(_0x3b6a87);});});} \ No newline at end of file +var _0x82fe=['request\x20sent','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','request','then','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x285eb3,_0x3b782e){var _0x2ba487=function(_0x58bea7){while(--_0x58bea7){_0x285eb3['push'](_0x285eb3['shift']());}};_0x2ba487(++_0x3b782e);}(_0x82fe,0x6f));var _0xe82f=function(_0x102470,_0x199a01){_0x102470=_0x102470-0x0;var _0x558eaa=_0x82fe[_0x102470];return _0x558eaa;};'use strict';var _=require(_0xe82f('0x0'));var util=require(_0xe82f('0x1'));var moment=require(_0xe82f('0x2'));var BPromise=require(_0xe82f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe82f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe82f('0x5'));var config=require(_0xe82f('0x6'));var jayson=require(_0xe82f('0x7'));var client=jayson[_0xe82f('0x8')]['http']({'port':0x232a});config['redis']=_[_0xe82f('0x9')](config[_0xe82f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe82f('0xb'))(new Redis(config[_0xe82f('0xa')]));require(_0xe82f('0xc'))[_0xe82f('0xd')](socket);function respondWithRpcPromise(_0x4b18aa,_0x152fdf,_0x5c69fa){return new BPromise(function(_0x13da82,_0x536903){return client[_0xe82f('0xe')](_0x4b18aa,_0x5c69fa)[_0xe82f('0xf')](function(_0xfb0ade){logger[_0xe82f('0x10')]('DashboardItem,\x20%s,\x20%s',_0x152fdf,'request\x20sent');logger[_0xe82f('0x11')](_0xe82f('0x12'),_0x152fdf,_0xe82f('0x13'),JSON[_0xe82f('0x14')](_0xfb0ade));if(_0xfb0ade[_0xe82f('0x15')]){if(_0xfb0ade[_0xe82f('0x15')]['code']===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x152fdf,_0xfb0ade['error']['message']);return _0x536903(_0xfb0ade[_0xe82f('0x15')]['message']);}logger[_0xe82f('0x15')](_0xe82f('0x16'),_0x152fdf,_0xfb0ade[_0xe82f('0x15')]['message']);return _0x13da82(_0xfb0ade[_0xe82f('0x15')][_0xe82f('0x17')]);}else{logger[_0xe82f('0x10')]('DashboardItem,\x20%s,\x20%s',_0x152fdf,_0xe82f('0x13'));_0x13da82(_0xfb0ade[_0xe82f('0x18')]['message']);}})[_0xe82f('0x19')](function(_0x424055){logger['error'](_0xe82f('0x16'),_0x152fdf,_0x424055);_0x536903(_0x424055);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index e710fe3..6c17173 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 _0x5d34=['removeListener','register','length','dashboardItem:','./dashboardItem.events','save','emit'];(function(_0x54c5e6,_0x42b44a){var _0x44be7d=function(_0x37fc4e){while(--_0x37fc4e){_0x54c5e6['push'](_0x54c5e6['shift']());}};_0x44be7d(++_0x42b44a);}(_0x5d34,0xd6));var _0x45d3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d34[_0x122ef9];return _0x42fba0;};'use strict';var DashboardItemEvents=require(_0x45d3('0x0'));var events=[_0x45d3('0x1'),'remove','update'];function createListener(_0x255f76,_0x4c885e){return function(_0x1155ac){_0x4c885e[_0x45d3('0x2')](_0x255f76,_0x1155ac);};}function removeListener(_0x47051c,_0x206b99){return function(){DashboardItemEvents[_0x45d3('0x3')](_0x47051c,_0x206b99);};}exports[_0x45d3('0x4')]=function(_0x41d003){for(var _0x2af9e3=0x0,_0x1666bf=events[_0x45d3('0x5')];_0x2af9e3<_0x1666bf;_0x2af9e3++){var _0x3c3cf8=events[_0x2af9e3];var _0x30652c=createListener(_0x45d3('0x6')+_0x3c3cf8,_0x41d003);DashboardItemEvents['on'](_0x3c3cf8,_0x30652c);}}; \ No newline at end of file +var _0xf308=['./dashboardItem.events','removeListener','register','length','dashboardItem:'];(function(_0x1526e3,_0x4fcb46){var _0x52a98e=function(_0x58e1fc){while(--_0x58e1fc){_0x1526e3['push'](_0x1526e3['shift']());}};_0x52a98e(++_0x4fcb46);}(_0xf308,0x1a4));var _0x8f30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf308[_0x20a584];return _0x4b41a8;};'use strict';var DashboardItemEvents=require(_0x8f30('0x0'));var events=['save','remove','update'];function createListener(_0x269727,_0x1faef2){return function(_0x5aaf9){_0x1faef2['emit'](_0x269727,_0x5aaf9);};}function removeListener(_0x2caea7,_0x537183){return function(){DashboardItemEvents[_0x8f30('0x1')](_0x2caea7,_0x537183);};}exports[_0x8f30('0x2')]=function(_0x7fffd5){for(var _0x36614a=0x0,_0x42df5b=events[_0x8f30('0x3')];_0x36614a<_0x42df5b;_0x36614a++){var _0x47bcb9=events[_0x36614a];var _0xedb3df=createListener(_0x8f30('0x4')+_0x47bcb9,_0x7fffd5);DashboardItemEvents['on'](_0x47bcb9,_0xedb3df);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 6fc2de3..7653707 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 _0x19b5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x19b5,0x11d));var _0x519b=function(_0x3ffaf8,_0x29266e){_0x3ffaf8=_0x3ffaf8-0x0;var _0xf200b6=_0x19b5[_0x3ffaf8];return _0xf200b6;};'use strict';var multer=require(_0x519b('0x0'));var util=require('util');var path=require(_0x519b('0x1'));var timeout=require(_0x519b('0x2'));var express=require(_0x519b('0x3'));var router=express[_0x519b('0x4')]();var fs_extra=require(_0x519b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x519b('0x6'));var config=require(_0x519b('0x7'));var controller=require(_0x519b('0x8'));router[_0x519b('0x9')]('/:id',auth[_0x519b('0xa')](),controller[_0x519b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x519b('0xc')](_0x519b('0xd'),auth[_0x519b('0xa')](),controller[_0x519b('0xe')]);router[_0x519b('0xf')](_0x519b('0xd'),auth[_0x519b('0xa')](),controller[_0x519b('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6918=['post','create','put','isAuthenticated','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x6918,0x1bd));var _0x8691=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6918[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x8691('0x0'));var path=require(_0x8691('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8691('0x2')]();var fs_extra=require(_0x8691('0x3'));var auth=require(_0x8691('0x4'));var interaction=require(_0x8691('0x5'));var config=require(_0x8691('0x6'));var controller=require(_0x8691('0x7'));router[_0x8691('0x8')](_0x8691('0x9'),auth['isAuthenticated'](),controller[_0x8691('0xa')]);router[_0x8691('0xb')]('/',auth['isAuthenticated'](),controller[_0x8691('0xc')]);router[_0x8691('0xd')]('/:id',auth[_0x8691('0xe')](),controller[_0x8691('0xf')]);router[_0x8691('0x10')](_0x8691('0x9'),auth[_0x8691('0xe')](),controller[_0x8691('0x11')]);module[_0x8691('0x12')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 0ac170e..3da3a64 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 _0x552e=['first','second','third','exports','STRING'];(function(_0x379ab0,_0x261bc1){var _0x3ff12d=function(_0x2f9f5c){while(--_0x2f9f5c){_0x379ab0['push'](_0x379ab0['shift']());}};_0x3ff12d(++_0x261bc1);}(_0x552e,0x1a7));var _0xe552=function(_0x2eee48,_0x29b8ea){_0x2eee48=_0x2eee48-0x0;var _0xb99463=_0x552e[_0x2eee48];return _0xb99463;};'use strict';var Sequelize=require('sequelize');module[_0xe552('0x0')]={'name':{'type':Sequelize[_0xe552('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xe552('0x2'),_0xe552('0x3'),_0xe552('0x4')),'allowNull':![],'defaultValue':_0xe552('0x2')},'description':{'type':Sequelize[_0xe552('0x1')]}}; \ No newline at end of file +var _0xf1d1=['ENUM','first','third','sequelize','exports','STRING'];(function(_0x22563a,_0x347993){var _0x5a028e=function(_0x1d9229){while(--_0x1d9229){_0x22563a['push'](_0x22563a['shift']());}};_0x5a028e(++_0x347993);}(_0xf1d1,0x111));var _0x1f1d=function(_0x2ec39e,_0x3ee3be){_0x2ec39e=_0x2ec39e-0x0;var _0x5f1b27=_0xf1d1[_0x2ec39e];return _0x5f1b27;};'use strict';var Sequelize=require(_0x1f1d('0x0'));module[_0x1f1d('0x1')]={'name':{'type':Sequelize[_0x1f1d('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x1f1d('0x3')](_0x1f1d('0x4'),'second',_0x1f1d('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x1f1d('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d19167f..3b138a8 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 _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x287591,_0x18897d){var _0x366699=function(_0x1acd41){while(--_0x1acd41){_0x287591['push'](_0x287591['shift']());}};_0x366699(++_0x18897d);}(_0xe14b,0x93));var _0xbe14=function(_0x276e2a,_0x1544e1){_0x276e2a=_0x276e2a-0x0;var _0x4f9f3f=_0xe14b[_0x276e2a];return _0x4f9f3f;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['Disposition'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));}; \ No newline at end of file +var _0x060c=['offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','Disposition','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','../../mysqldb','sendStatus','end','status','json'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x060c,0x1e4));var _0xc060=function(_0x2f79c8,_0x338536){_0x2f79c8=_0x2f79c8-0x0;var _0x536c86=_0x060c[_0x2f79c8];return _0x536c86;};'use strict';var emlformat=require(_0xc060('0x0'));var rimraf=require(_0xc060('0x1'));var zipdir=require(_0xc060('0x2'));var jsonpatch=require(_0xc060('0x3'));var rp=require('request-promise');var moment=require(_0xc060('0x4'));var BPromise=require(_0xc060('0x5'));var Mustache=require(_0xc060('0x6'));var util=require(_0xc060('0x7'));var path=require(_0xc060('0x8'));var sox=require(_0xc060('0x9'));var csv=require(_0xc060('0xa'));var ejs=require(_0xc060('0xb'));var fs=require('fs');var fs_extra=require(_0xc060('0xc'));var _=require(_0xc060('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc060('0xe'));var deskjs=require(_0xc060('0xf'));var toCsv=require(_0xc060('0xa'));var querystring=require(_0xc060('0x10'));var Papa=require(_0xc060('0x11'));var Redis=require(_0xc060('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc060('0x13'));var as=require(_0xc060('0x14'));var hardwareService=require(_0xc060('0x15'));var logger=require(_0xc060('0x16'))(_0xc060('0x17'));var utils=require(_0xc060('0x18'));var config=require(_0xc060('0x19'));var licenseUtil=require(_0xc060('0x1a'));var db=require(_0xc060('0x1b'))['db'];function respondWithStatusCode(_0x4d9a1d,_0x57ebbb){_0x57ebbb=_0x57ebbb||0xcc;return function(_0x228a85){if(_0x228a85){return _0x4d9a1d[_0xc060('0x1c')](_0x57ebbb);}return _0x4d9a1d['status'](_0x57ebbb)[_0xc060('0x1d')]();};}function respondWithResult(_0x2038d5,_0x1ef45e){_0x1ef45e=_0x1ef45e||0xc8;return function(_0xd3c41){if(_0xd3c41){return _0x2038d5[_0xc060('0x1e')](_0x1ef45e)[_0xc060('0x1f')](_0xd3c41);}};}function respondWithFilteredResult(_0x43ebd0,_0x536a12){return function(_0x166048){if(_0x166048){var _0x54a8d6=typeof _0x536a12[_0xc060('0x20')]===_0xc060('0x21')&&typeof _0x536a12['limit']==='undefined';var _0x14aee2=_0x166048[_0xc060('0x22')];var _0x37c277=_0x54a8d6?0x0:_0x536a12[_0xc060('0x20')];var _0x2ec271=_0x54a8d6?_0x166048['count']:_0x536a12[_0xc060('0x20')]+_0x536a12['limit'];var _0x2d809c;if(_0x2ec271>=_0x14aee2){_0x2ec271=_0x14aee2;_0x2d809c=0xc8;}else{_0x2d809c=0xce;}_0x43ebd0[_0xc060('0x1e')](_0x2d809c);return _0x43ebd0[_0xc060('0x23')](_0xc060('0x24'),_0x37c277+'-'+_0x2ec271+'/'+_0x14aee2)[_0xc060('0x1f')](_0x166048);}return null;};}function patchUpdates(_0x177fc6){return function(_0x5a9f7a){try{jsonpatch[_0xc060('0x25')](_0x5a9f7a,_0x177fc6,!![]);}catch(_0xfdc98c){return BPromise['reject'](_0xfdc98c);}return _0x5a9f7a[_0xc060('0x26')]();};}function saveUpdates(_0x4eb877,_0x3133d6){return function(_0x24821e){if(_0x24821e){return _0x24821e[_0xc060('0x27')](_0x4eb877)[_0xc060('0x28')](function(_0x595787){return _0x595787;});}return null;};}function removeEntity(_0x39610e,_0x2a4b41){return function(_0x4cb99c){if(_0x4cb99c){return _0x4cb99c[_0xc060('0x29')]()[_0xc060('0x28')](function(){var _0x28fdbc=_0x4cb99c[_0xc060('0x2a')]({'plain':!![]});var _0x2f5350='Dispositions';return db['UserProfileResource'][_0xc060('0x29')]({'where':{'type':_0x2f5350,'resourceId':_0x28fdbc['id']}})[_0xc060('0x28')](function(){return _0x4cb99c;});})['then'](function(){_0x39610e[_0xc060('0x1e')](0xcc)[_0xc060('0x1d')]();});}};}function handleEntityNotFound(_0x91a134,_0x3e81d6){return function(_0x429721){if(!_0x429721){_0x91a134[_0xc060('0x1c')](0x194);}return _0x429721;};}function handleError(_0x2413e7,_0x44d65d){_0x44d65d=_0x44d65d||0x1f4;return function(_0x33e579){logger[_0xc060('0x2b')](_0x33e579['stack']);if(_0x33e579['name']){delete _0x33e579[_0xc060('0x2c')];}_0x2413e7[_0xc060('0x1e')](_0x44d65d)[_0xc060('0x2d')](_0x33e579);};}exports['index']=function(_0x4e1469,_0x3f1910){var _0x447f27={},_0x1bbc02={},_0x269176={'count':0x0,'rows':[]};var _0x172e44=_[_0xc060('0x2e')](db['Disposition'][_0xc060('0x2f')],function(_0x1aa7c5){return{'name':_0x1aa7c5[_0xc060('0x30')],'type':_0x1aa7c5[_0xc060('0x31')][_0xc060('0x32')]};});_0x1bbc02[_0xc060('0x33')]=_[_0xc060('0x2e')](_0x172e44,_0xc060('0x2c'));_0x1bbc02[_0xc060('0x34')]=_[_0xc060('0x35')](_0x4e1469['query']);_0x1bbc02[_0xc060('0x36')]=_[_0xc060('0x37')](_0x1bbc02[_0xc060('0x33')],_0x1bbc02[_0xc060('0x34')]);_0x447f27[_0xc060('0x38')]=_[_0xc060('0x37')](_0x1bbc02['model'],qs[_0xc060('0x39')](_0x4e1469[_0xc060('0x34')]['fields']));_0x447f27[_0xc060('0x38')]=_0x447f27[_0xc060('0x38')]['length']?_0x447f27['attributes']:_0x1bbc02[_0xc060('0x33')];if(!_0x4e1469[_0xc060('0x34')][_0xc060('0x3a')](_0xc060('0x3b'))){_0x447f27[_0xc060('0x3c')]=qs['limit'](_0x4e1469['query'][_0xc060('0x3c')]);_0x447f27[_0xc060('0x20')]=qs['offset'](_0x4e1469[_0xc060('0x34')][_0xc060('0x20')]);}_0x447f27[_0xc060('0x3d')]=qs[_0xc060('0x3e')](_0x4e1469[_0xc060('0x34')]['sort']);_0x447f27[_0xc060('0x3f')]=qs[_0xc060('0x36')](_['pick'](_0x4e1469[_0xc060('0x34')],_0x1bbc02[_0xc060('0x36')]),_0x172e44);if(_0x4e1469[_0xc060('0x34')][_0xc060('0x40')]){_0x447f27[_0xc060('0x3f')]=_['merge'](_0x447f27[_0xc060('0x3f')],{'$or':_[_0xc060('0x2e')](_0x172e44,function(_0x5df2af){if(_0x5df2af[_0xc060('0x31')]!==_0xc060('0x41')){var _0x5a94af={};_0x5a94af[_0x5df2af[_0xc060('0x2c')]]={'$like':'%'+_0x4e1469[_0xc060('0x34')][_0xc060('0x40')]+'%'};return _0x5a94af;}})});}_0x447f27=_[_0xc060('0x42')]({},_0x447f27,_0x4e1469[_0xc060('0x43')]);var _0x20d320={'where':_0x447f27[_0xc060('0x3f')]};return db['Disposition']['count'](_0x20d320)[_0xc060('0x28')](function(_0x26cb9f){_0x269176[_0xc060('0x22')]=_0x26cb9f;if(_0x4e1469['query'][_0xc060('0x44')]){_0x447f27['include']=[{'all':!![]}];}return db[_0xc060('0x45')][_0xc060('0x46')](_0x447f27);})[_0xc060('0x28')](function(_0x3c7284){_0x269176[_0xc060('0x47')]=_0x3c7284;return _0x269176;})[_0xc060('0x28')](respondWithFilteredResult(_0x3f1910,_0x447f27))[_0xc060('0x48')](handleError(_0x3f1910,null));};exports[_0xc060('0x49')]=function(_0x18e1b8,_0x3cca05){var _0x3eef6b={'raw':!![],'where':{'id':_0x18e1b8[_0xc060('0x4a')]['id']}},_0x942120={};_0x942120[_0xc060('0x33')]=_[_0xc060('0x35')](db['Disposition'][_0xc060('0x2f')]);_0x942120[_0xc060('0x34')]=_[_0xc060('0x35')](_0x18e1b8['query']);_0x942120[_0xc060('0x36')]=_['intersection'](_0x942120[_0xc060('0x33')],_0x942120[_0xc060('0x34')]);_0x3eef6b[_0xc060('0x38')]=_[_0xc060('0x37')](_0x942120['model'],qs[_0xc060('0x39')](_0x18e1b8[_0xc060('0x34')][_0xc060('0x39')]));_0x3eef6b['attributes']=_0x3eef6b[_0xc060('0x38')]['length']?_0x3eef6b[_0xc060('0x38')]:_0x942120[_0xc060('0x33')];if(_0x18e1b8[_0xc060('0x34')]['includeAll']){_0x3eef6b[_0xc060('0x4b')]=[{'all':!![]}];}_0x3eef6b=_['merge']({},_0x3eef6b,_0x18e1b8[_0xc060('0x43')]);return db[_0xc060('0x45')][_0xc060('0x4c')](_0x3eef6b)['then'](handleEntityNotFound(_0x3cca05,null))[_0xc060('0x28')](respondWithResult(_0x3cca05,null))[_0xc060('0x48')](handleError(_0x3cca05,null));};exports[_0xc060('0x4d')]=function(_0x3164de,_0x58806f){return db[_0xc060('0x45')][_0xc060('0x4d')](_0x3164de[_0xc060('0x4e')],{})[_0xc060('0x28')](function(_0x3fbe7a){var _0x14d573=_0x3164de['user'][_0xc060('0x2a')]({'plain':!![]});if(!_0x14d573)throw new Error(_0xc060('0x4f'));if(_0x14d573[_0xc060('0x50')]===_0xc060('0x51')){var _0x372399=_0x3fbe7a[_0xc060('0x2a')]({'plain':!![]});var _0x1b3952='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x1b3952,'userProfileId':_0x14d573[_0xc060('0x52')]},'raw':!![]})[_0xc060('0x28')](function(_0x422397){if(_0x422397&&_0x422397[_0xc060('0x53')]===0x0){return db[_0xc060('0x54')][_0xc060('0x4d')]({'name':_0x372399['name'],'resourceId':_0x372399['id'],'type':_0x422397[_0xc060('0x2c')],'sectionId':_0x422397['id']},{})[_0xc060('0x28')](function(){return _0x3fbe7a;});}else{return _0x3fbe7a;}})[_0xc060('0x48')](function(_0x3720b2){logger[_0xc060('0x2b')](_0xc060('0x55'),_0x3720b2);throw _0x3720b2;});}return _0x3fbe7a;})[_0xc060('0x28')](respondWithResult(_0x58806f,0xc9))[_0xc060('0x48')](handleError(_0x58806f,null));};exports[_0xc060('0x27')]=function(_0xe262ad,_0x25d8bb){if(_0xe262ad[_0xc060('0x4e')]['id']){delete _0xe262ad[_0xc060('0x4e')]['id'];}return db['Disposition'][_0xc060('0x4c')]({'where':{'id':_0xe262ad[_0xc060('0x4a')]['id']}})['then'](handleEntityNotFound(_0x25d8bb,null))[_0xc060('0x28')](saveUpdates(_0xe262ad[_0xc060('0x4e')],null))[_0xc060('0x28')](respondWithResult(_0x25d8bb,null))[_0xc060('0x48')](handleError(_0x25d8bb,null));};exports[_0xc060('0x29')]=function(_0x2d42c8,_0x3f6902){return db['Disposition'][_0xc060('0x4c')]({'where':{'id':_0x2d42c8[_0xc060('0x4a')]['id']}})[_0xc060('0x28')](handleEntityNotFound(_0x3f6902,null))[_0xc060('0x28')](removeEntity(_0x3f6902,null))[_0xc060('0x48')](handleError(_0x3f6902,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 233603e..7fa1e5a 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 _0xffe3=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffe3,0x1a8));var _0x3ffe=function(_0x1d38fb,_0xffa094){_0x1d38fb=_0x1d38fb-0x0;var _0x262398=_0xffe3[_0x1d38fb];return _0x262398;};'use strict';var _=require(_0x3ffe('0x0'));var util=require(_0x3ffe('0x1'));var logger=require(_0x3ffe('0x2'))(_0x3ffe('0x3'));var moment=require(_0x3ffe('0x4'));var BPromise=require(_0x3ffe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3ffe('0x6'));var config=require(_0x3ffe('0x7'));var attributes=require(_0x3ffe('0x8'));module[_0x3ffe('0x9')]=function(_0x28ff6,_0xdaa374){return _0x28ff6[_0x3ffe('0xa')]('Disposition',attributes,{'tableName':_0x3ffe('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x3ffe('0xc')]},{'unique':!![],'name':_0x3ffe('0xd'),'fields':[_0x3ffe('0xe'),_0x3ffe('0xf')]},{'unique':!![],'name':_0x3ffe('0x10'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x11')]},{'unique':!![],'name':_0x3ffe('0x12'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x13')]},{'unique':!![],'name':_0x3ffe('0x14'),'fields':[_0x3ffe('0xe'),'FaxAccountId']},{'unique':!![],'name':_0x3ffe('0x15'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x16')]},{'unique':!![],'name':_0x3ffe('0x17'),'fields':[_0x3ffe('0xe'),_0x3ffe('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcfbf=['name_whatsapp','WhatsappAccountId','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','ListId','name_chat','name_mail','name','name_sms','SmsAccountId','FaxAccountId','name_openchannel'];(function(_0x5afbd5,_0x48a693){var _0x298511=function(_0x2f4262){while(--_0x2f4262){_0x5afbd5['push'](_0x5afbd5['shift']());}};_0x298511(++_0x48a693);}(_0xcfbf,0x152));var _0xfcfb=function(_0x5dedd6,_0x22f74c){_0x5dedd6=_0x5dedd6-0x0;var _0x424ac2=_0xcfbf[_0x5dedd6];return _0x424ac2;};'use strict';var _=require(_0xfcfb('0x0'));var util=require(_0xfcfb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfcfb('0x2'));var BPromise=require('bluebird');var rp=require(_0xfcfb('0x3'));var fs=require('fs');var path=require(_0xfcfb('0x4'));var rimraf=require(_0xfcfb('0x5'));var config=require(_0xfcfb('0x6'));var attributes=require(_0xfcfb('0x7'));module[_0xfcfb('0x8')]=function(_0x11a37c,_0x3be8b0){return _0x11a37c['define'](_0xfcfb('0x9'),attributes,{'tableName':_0xfcfb('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0xfcfb('0xb')]},{'unique':!![],'name':_0xfcfb('0xc'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0xfcfb('0xd'),'fields':[_0xfcfb('0xe'),'MailAccountId']},{'unique':!![],'name':_0xfcfb('0xf'),'fields':['name',_0xfcfb('0x10')]},{'unique':!![],'name':'name_fax','fields':[_0xfcfb('0xe'),_0xfcfb('0x11')]},{'unique':!![],'name':_0xfcfb('0x12'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0xfcfb('0x13'),'fields':['name',_0xfcfb('0x14')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 862bbeb..7287058 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(_0x10d212,_0x464c8c){var _0x288d1f=function(_0x2a42e9){while(--_0x2a42e9){_0x10d212['push'](_0x10d212['shift']());}};_0x288d1f(++_0x464c8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x73f9be,_0x574df9){var _0x2dfa2a=function(_0x7eaef){while(--_0x7eaef){_0x73f9be['push'](_0x73f9be['shift']());}};_0x2dfa2a(++_0x574df9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 6b33c92..f6e45c5 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 _0x8f5d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','show','post','put','/:id','delete','destroy','exports','multer','util'];(function(_0x50c4ee,_0x2cc4e3){var _0x172545=function(_0x341e3d){while(--_0x341e3d){_0x50c4ee['push'](_0x50c4ee['shift']());}};_0x172545(++_0x2cc4e3);}(_0x8f5d,0xc6));var _0xd8f5=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x8f5d[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0xd8f5('0x0'));var util=require(_0xd8f5('0x1'));var path=require(_0xd8f5('0x2'));var timeout=require(_0xd8f5('0x3'));var express=require(_0xd8f5('0x4'));var router=express[_0xd8f5('0x5')]();var fs_extra=require(_0xd8f5('0x6'));var auth=require(_0xd8f5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd8f5('0x8'));var controller=require(_0xd8f5('0x9'));router['get']('/',auth[_0xd8f5('0xa')](),controller[_0xd8f5('0xb')]);router[_0xd8f5('0xc')]('/:id',auth[_0xd8f5('0xa')](),controller[_0xd8f5('0xd')]);router[_0xd8f5('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd8f5('0xf')](_0xd8f5('0x10'),auth[_0xd8f5('0xa')](),controller['update']);router[_0xd8f5('0x11')](_0xd8f5('0x10'),auth[_0xd8f5('0xa')](),controller[_0xd8f5('0x12')]);module[_0xd8f5('0x13')]=router; \ No newline at end of file +var _0x1ee4=['update','delete','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x1ee4,0x16c));var _0x41ee=function(_0x46970f,_0x192f59){_0x46970f=_0x46970f-0x0;var _0x1ae344=_0x1ee4[_0x46970f];return _0x1ae344;};'use strict';var multer=require(_0x41ee('0x0'));var util=require(_0x41ee('0x1'));var path=require(_0x41ee('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x41ee('0x3'));var auth=require(_0x41ee('0x4'));var interaction=require(_0x41ee('0x5'));var config=require(_0x41ee('0x6'));var controller=require(_0x41ee('0x7'));router[_0x41ee('0x8')]('/',auth[_0x41ee('0x9')](),controller[_0x41ee('0xa')]);router[_0x41ee('0x8')]('/:id',auth[_0x41ee('0x9')](),controller[_0x41ee('0xb')]);router[_0x41ee('0xc')]('/',auth[_0x41ee('0x9')](),controller[_0x41ee('0xd')]);router[_0x41ee('0xe')](_0x41ee('0xf'),auth[_0x41ee('0x9')](),controller[_0x41ee('0x10')]);router[_0x41ee('0x11')](_0x41ee('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x41ee('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index b49413b..a1d0b50 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 _0x8819=['2400','4800','9600','12000','14400','v17,v27,v29','SIP','DADHI','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','mandatoryDispositionPauseId','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x8819,0x94));var _0x9881=function(_0x1babac,_0x436e22){_0x1babac=_0x1babac-0x0;var _0x16c7cd=_0x8819[_0x1babac];return _0x16c7cd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9881('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9881('0x0')]},'ecm':{'type':Sequelize[_0x9881('0x1')](_0x9881('0x2'),'no'),'defaultValue':_0x9881('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x9881('0x3')},'localstationid':{'type':Sequelize[_0x9881('0x0')],'unique':_0x9881('0x4')},'minrate':{'type':Sequelize[_0x9881('0x1')](_0x9881('0x5'),_0x9881('0x6'),'7200',_0x9881('0x7'),'12000','14400'),'defaultValue':_0x9881('0x6')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x9881('0x6'),'7200',_0x9881('0x7'),_0x9881('0x8'),_0x9881('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x9881('0x0')],'defaultValue':_0x9881('0xa')},'gateway':{'type':Sequelize[_0x9881('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9881('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x9881('0x1')](_0x9881('0xb'),'IAX',_0x9881('0xc'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9881('0xd');}},'notificationSound':{'type':Sequelize[_0x9881('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9881('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9881('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9881('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9881('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9881('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9881('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9881('0xf')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x280ea2){if(!_0x280ea2)this['setDataValue'](_0x9881('0x10'),null);this['setDataValue']('mandatoryDisposition',_0x280ea2);}}}; \ No newline at end of file +var _0x3914=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','9600','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3914,0xeb));var _0x4391=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x3914[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require(_0x4391('0x0'));module[_0x4391('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4391('0x2')]},'ecm':{'type':Sequelize[_0x4391('0x3')]('yes','no'),'defaultValue':_0x4391('0x4')},'headerinfo':{'type':Sequelize[_0x4391('0x2')],'defaultValue':_0x4391('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x4391('0x6')},'minrate':{'type':Sequelize[_0x4391('0x3')]('2400',_0x4391('0x7'),'7200',_0x4391('0x8'),'12000',_0x4391('0x9')),'defaultValue':_0x4391('0x7')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x4391('0x7'),_0x4391('0xa'),_0x4391('0x8'),'12000',_0x4391('0x9')),'defaultValue':_0x4391('0x9')},'modem':{'type':Sequelize[_0x4391('0x2')],'defaultValue':_0x4391('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4391('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4391('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4391('0x3')](_0x4391('0xd'),_0x4391('0xe'),_0x4391('0xf'),_0x4391('0x10')),'defaultValue':_0x4391('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4391('0x11')],'defaultValue':function(){return _0x4391('0x12');}},'notificationSound':{'type':Sequelize[_0x4391('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4391('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4391('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4391('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4391('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4391('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4391('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x4391('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x4391('0x13')],'defaultValue':![],'comment':_0x4391('0x15'),'set':function(_0x19924d){if(!_0x19924d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x4391('0x16')]('mandatoryDisposition',_0x19924d);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index ed3bc9d..a0af501 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 _0xd2bf=['removeAnswers','addInteraction','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','context','exten','localstationid','priority','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','modem','FAXOPT(','Wait','/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','addAccountApplications','VoiceExtension','updateAccountApplications','omit','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','Send\x20Fax\x20failed','out','Messages','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','FaxAccounts','UserProfileResource','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','FaxAccount','includeAll','rows','show','params','Pause','length','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','FaxAccountId','findAll','ids','CannedAnswer','getAnswers'];(function(_0x5ec82b,_0x27298e){var _0x3ae72e=function(_0x381749){while(--_0x381749){_0x5ec82b['push'](_0x5ec82b['shift']());}};_0x3ae72e(++_0x27298e);}(_0xd2bf,0x112));var _0xfd2b=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0xd2bf[_0x2bbc07];return _0x6879e4;};'use strict';var emlformat=require(_0xfd2b('0x0'));var rimraf=require(_0xfd2b('0x1'));var zipdir=require(_0xfd2b('0x2'));var jsonpatch=require(_0xfd2b('0x3'));var rp=require(_0xfd2b('0x4'));var moment=require('moment');var BPromise=require(_0xfd2b('0x5'));var Mustache=require(_0xfd2b('0x6'));var util=require('util');var path=require('path');var sox=require(_0xfd2b('0x7'));var csv=require(_0xfd2b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd2b('0x9'));var _=require(_0xfd2b('0xa'));var squel=require(_0xfd2b('0xb'));var crypto=require(_0xfd2b('0xc'));var jsforce=require(_0xfd2b('0xd'));var deskjs=require(_0xfd2b('0xe'));var toCsv=require(_0xfd2b('0x8'));var querystring=require('querystring');var Papa=require(_0xfd2b('0xf'));var Redis=require('ioredis');var authService=require(_0xfd2b('0x10'));var qs=require(_0xfd2b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd2b('0x12'));var logger=require(_0xfd2b('0x13'))('api');var utils=require(_0xfd2b('0x14'));var config=require(_0xfd2b('0x15'));var licenseUtil=require(_0xfd2b('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xfd2b('0x17')](config[_0xfd2b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xfd2b('0x19'))(new Redis(config['redis']));require(_0xfd2b('0x1a'))[_0xfd2b('0x1b')](socket);var jayson=require(_0xfd2b('0x1c'));var client=jayson['client'][_0xfd2b('0x1d')]({'port':0x232c});var client9002=jayson[_0xfd2b('0x1e')][_0xfd2b('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4afb46,_0x8f551,_0x5d2621,_0x4b7113){return new BPromise(function(_0x1cd580,_0x25ca33){var _0x5c1188=_0x4b7113||client;return _0x5c1188[_0xfd2b('0x1f')](_0x4afb46,_0x5d2621)['then'](function(_0x19eca0){logger[_0xfd2b('0x20')]('FaxAccount,\x20%s,\x20%s',_0x8f551,_0xfd2b('0x21'));logger[_0xfd2b('0x22')](_0xfd2b('0x23'),_0x8f551,_0xfd2b('0x21'),JSON[_0xfd2b('0x24')](_0x19eca0));if(_0x19eca0[_0xfd2b('0x25')]){if(_0x19eca0[_0xfd2b('0x25')][_0xfd2b('0x26')]===0x1f4){logger[_0xfd2b('0x25')](_0xfd2b('0x27'),_0x8f551,_0x19eca0[_0xfd2b('0x25')]['message']);return _0x25ca33(_0x19eca0['error'][_0xfd2b('0x28')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x8f551,_0x19eca0[_0xfd2b('0x25')]['message']);return _0x1cd580(_0x19eca0[_0xfd2b('0x25')][_0xfd2b('0x28')]);}else{logger[_0xfd2b('0x20')](_0xfd2b('0x27'),_0x8f551,'request\x20sent');_0x1cd580(_0x19eca0[_0xfd2b('0x29')][_0xfd2b('0x28')]);}})['catch'](function(_0x5302e4){logger[_0xfd2b('0x25')]('FaxAccount,\x20%s,\x20%s',_0x8f551,_0x5302e4);_0x25ca33(_0x5302e4);});});}function respondWithStatusCode(_0x556780,_0x3ce2fe){_0x3ce2fe=_0x3ce2fe||0xcc;return function(_0x480acd){if(_0x480acd){return _0x556780[_0xfd2b('0x2a')](_0x3ce2fe);}return _0x556780[_0xfd2b('0x2b')](_0x3ce2fe)[_0xfd2b('0x2c')]();};}function respondWithResult(_0x1200c7,_0x588fd6){_0x588fd6=_0x588fd6||0xc8;return function(_0x404013){if(_0x404013){return _0x1200c7[_0xfd2b('0x2b')](_0x588fd6)[_0xfd2b('0x2d')](_0x404013);}};}function respondWithFilteredResult(_0x3b8e3e,_0x223d89){return function(_0x30b8e6){if(_0x30b8e6){var _0x3e57dd=typeof _0x223d89[_0xfd2b('0x2e')]===_0xfd2b('0x2f')&&typeof _0x223d89[_0xfd2b('0x30')]==='undefined';var _0x5b24e8=_0x30b8e6['count'];var _0x165a0b=_0x3e57dd?0x0:_0x223d89[_0xfd2b('0x2e')];var _0x39af72=_0x3e57dd?_0x30b8e6[_0xfd2b('0x31')]:_0x223d89['offset']+_0x223d89['limit'];var _0xeeced0;if(_0x39af72>=_0x5b24e8){_0x39af72=_0x5b24e8;_0xeeced0=0xc8;}else{_0xeeced0=0xce;}_0x3b8e3e[_0xfd2b('0x2b')](_0xeeced0);return _0x3b8e3e['set'](_0xfd2b('0x32'),_0x165a0b+'-'+_0x39af72+'/'+_0x5b24e8)[_0xfd2b('0x2d')](_0x30b8e6);}return null;};}function patchUpdates(_0x284ab1){return function(_0x5f49cd){try{jsonpatch['apply'](_0x5f49cd,_0x284ab1,!![]);}catch(_0x6cefaf){return BPromise[_0xfd2b('0x33')](_0x6cefaf);}return _0x5f49cd[_0xfd2b('0x34')]();};}function saveUpdates(_0x189056,_0x325018){return function(_0x4d0baa){if(_0x4d0baa){return _0x4d0baa[_0xfd2b('0x35')](_0x189056)[_0xfd2b('0x36')](function(_0x2161e6){return _0x2161e6;});}return null;};}function removeEntity(_0xcd2941,_0x44de0b){return function(_0x41a98b){if(_0x41a98b){return _0x41a98b[_0xfd2b('0x37')]()['then'](function(){var _0x50e95a=_0x41a98b[_0xfd2b('0x38')]({'plain':!![]});var _0x1de939=_0xfd2b('0x39');return db[_0xfd2b('0x3a')][_0xfd2b('0x37')]({'where':{'type':_0x1de939,'resourceId':_0x50e95a['id']}})[_0xfd2b('0x36')](function(){return _0x41a98b;});})[_0xfd2b('0x36')](function(){_0xcd2941['status'](0xcc)[_0xfd2b('0x2c')]();});}};}function handleEntityNotFound(_0xeed19d,_0x569799){return function(_0x11eba5){if(!_0x11eba5){_0xeed19d[_0xfd2b('0x2a')](0x194);}return _0x11eba5;};}function handleError(_0x1ba31c,_0x58e813){_0x58e813=_0x58e813||0x1f4;return function(_0x235c0f){logger[_0xfd2b('0x25')](_0x235c0f['stack']);if(_0x235c0f[_0xfd2b('0x3b')]){delete _0x235c0f[_0xfd2b('0x3b')];}_0x1ba31c[_0xfd2b('0x2b')](_0x58e813)[_0xfd2b('0x3c')](_0x235c0f);};}exports[_0xfd2b('0x3d')]=function(_0x4b8797,_0x38bbdc){var _0x416c1f={'include':[{'model':db['Pause'],'as':_0xfd2b('0x3e')}]},_0x5c902d={},_0x580d7a={'count':0x0,'rows':[]};var _0x1b1242=_['map'](db['FaxAccount'][_0xfd2b('0x3f')],function(_0x57563f){return{'name':_0x57563f[_0xfd2b('0x40')],'type':_0x57563f['type'][_0xfd2b('0x41')]};});_0x5c902d[_0xfd2b('0x42')]=_['map'](_0x1b1242,_0xfd2b('0x3b'));_0x5c902d[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x4b8797[_0xfd2b('0x43')]);_0x5c902d[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x5c902d[_0xfd2b('0x42')],_0x5c902d[_0xfd2b('0x43')]);_0x416c1f[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x5c902d[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x4b8797['query'][_0xfd2b('0x48')]));_0x416c1f[_0xfd2b('0x47')]=_0x416c1f[_0xfd2b('0x47')]['length']?_0x416c1f['attributes']:_0x5c902d[_0xfd2b('0x42')];if(!_0x4b8797[_0xfd2b('0x43')]['hasOwnProperty'](_0xfd2b('0x49'))){_0x416c1f[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x4b8797[_0xfd2b('0x43')]['limit']);_0x416c1f[_0xfd2b('0x2e')]=qs['offset'](_0x4b8797[_0xfd2b('0x43')]['offset']);}_0x416c1f[_0xfd2b('0x4a')]=qs[_0xfd2b('0x4b')](_0x4b8797[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x416c1f[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x4b8797[_0xfd2b('0x43')],_0x5c902d[_0xfd2b('0x45')]),_0x1b1242);if(_0x4b8797[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x416c1f['where']=_[_0xfd2b('0x4f')](_0x416c1f[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x1b1242,function(_0x283f6d){if(_0x283f6d['type']!==_0xfd2b('0x51')){var _0x2a65c5={};_0x2a65c5[_0x283f6d[_0xfd2b('0x3b')]]={'$like':'%'+_0x4b8797[_0xfd2b('0x43')]['filter']+'%'};return _0x2a65c5;}})});}_0x416c1f=_[_0xfd2b('0x4f')]({},_0x416c1f,_0x4b8797[_0xfd2b('0x52')]);var _0x21bf3b={'where':_0x416c1f['where']};return db[_0xfd2b('0x53')][_0xfd2b('0x31')](_0x21bf3b)[_0xfd2b('0x36')](function(_0x7fed13){_0x580d7a[_0xfd2b('0x31')]=_0x7fed13;if(_0x4b8797[_0xfd2b('0x43')][_0xfd2b('0x54')]){_0x416c1f['include']=[{'all':!![]}];}return db[_0xfd2b('0x53')]['findAll'](_0x416c1f);})[_0xfd2b('0x36')](function(_0x157bc7){_0x580d7a[_0xfd2b('0x55')]=_0x157bc7;return _0x580d7a;})[_0xfd2b('0x36')](respondWithFilteredResult(_0x38bbdc,_0x416c1f))['catch'](handleError(_0x38bbdc,null));};exports[_0xfd2b('0x56')]=function(_0x29dfc2,_0x3e4bd4){var _0x4962b6={'raw':![],'where':{'id':_0x29dfc2[_0xfd2b('0x57')]['id']},'include':[{'model':db[_0xfd2b('0x58')],'as':_0xfd2b('0x3e')}]},_0x158127={};_0x158127[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x53')][_0xfd2b('0x3f')]);_0x158127[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x29dfc2[_0xfd2b('0x43')]);_0x158127['filters']=_['intersection'](_0x158127[_0xfd2b('0x42')],_0x158127['query']);_0x4962b6['attributes']=_[_0xfd2b('0x46')](_0x158127[_0xfd2b('0x42')],qs['fields'](_0x29dfc2[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x4962b6[_0xfd2b('0x47')]=_0x4962b6['attributes'][_0xfd2b('0x59')]?_0x4962b6[_0xfd2b('0x47')]:_0x158127['model'];if(_0x29dfc2['query']['includeAll']){_0x4962b6[_0xfd2b('0x5a')]=[{'all':!![]}];}_0x4962b6=_[_0xfd2b('0x4f')]({},_0x4962b6,_0x29dfc2[_0xfd2b('0x52')]);return db[_0xfd2b('0x53')]['find'](_0x4962b6)[_0xfd2b('0x36')](handleEntityNotFound(_0x3e4bd4,null))[_0xfd2b('0x36')](respondWithResult(_0x3e4bd4,null))[_0xfd2b('0x5b')](handleError(_0x3e4bd4,null));};exports[_0xfd2b('0x5c')]=function(_0x58555f,_0x18f6bc){return db[_0xfd2b('0x53')][_0xfd2b('0x5c')](_0x58555f[_0xfd2b('0x5d')],{})[_0xfd2b('0x36')](function(_0x386ed9){var _0xb487b4=_0x58555f[_0xfd2b('0x5e')][_0xfd2b('0x38')]({'plain':!![]});if(!_0xb487b4)throw new Error(_0xfd2b('0x5f'));if(_0xb487b4[_0xfd2b('0x60')]==='user'){var _0x5aa528=_0x386ed9[_0xfd2b('0x38')]({'plain':!![]});var _0x5eaaa2=_0xfd2b('0x39');return db[_0xfd2b('0x61')][_0xfd2b('0x62')]({'where':{'name':_0x5eaaa2,'userProfileId':_0xb487b4['userProfileId']},'raw':!![]})['then'](function(_0xe0c630){if(_0xe0c630&&_0xe0c630[_0xfd2b('0x63')]===0x0){return db['UserProfileResource'][_0xfd2b('0x5c')]({'name':_0x5aa528[_0xfd2b('0x3b')],'resourceId':_0x5aa528['id'],'type':_0xe0c630[_0xfd2b('0x3b')],'sectionId':_0xe0c630['id']},{})['then'](function(){return _0x386ed9;});}else{return _0x386ed9;}})[_0xfd2b('0x5b')](function(_0x3f8e2c){logger['error'](_0xfd2b('0x64'),_0x3f8e2c);throw _0x3f8e2c;});}return _0x386ed9;})[_0xfd2b('0x36')](respondWithResult(_0x18f6bc,0xc9))[_0xfd2b('0x5b')](handleError(_0x18f6bc,null));};exports[_0xfd2b('0x35')]=function(_0x19fa0a,_0x5499f1){if(_0x19fa0a['body']['id']){delete _0x19fa0a[_0xfd2b('0x5d')]['id'];}return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x19fa0a[_0xfd2b('0x57')]['id']},'include':[{'model':db[_0xfd2b('0x58')],'as':_0xfd2b('0x3e')}]})['then'](handleEntityNotFound(_0x5499f1,null))[_0xfd2b('0x36')](saveUpdates(_0x19fa0a['body'],null))[_0xfd2b('0x36')](respondWithResult(_0x5499f1,null))['catch'](handleError(_0x5499f1,null));};exports['destroy']=function(_0x264d58,_0x31d7a0){return db[_0xfd2b('0x53')]['find']({'where':{'id':_0x264d58[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x31d7a0,null))[_0xfd2b('0x36')](removeEntity(_0x31d7a0,null))[_0xfd2b('0x5b')](handleError(_0x31d7a0,null));};exports[_0xfd2b('0x65')]=function(_0x551163,_0x35abc3){return db[_0xfd2b('0x53')]['describe']()[_0xfd2b('0x36')](respondWithResult(_0x35abc3,null))[_0xfd2b('0x5b')](handleError(_0x35abc3,null));};exports[_0xfd2b('0x66')]=function(_0x55b515,_0x44bf93,_0x4f8f09){if(_0x55b515[_0xfd2b('0x5d')]['id']){delete _0x55b515['body']['id'];}return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x55b515[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x44bf93,null))['then'](function(_0x520951){if(_0x520951){_0x55b515[_0xfd2b('0x5d')]['FaxAccountId']=_0x520951['id'];return db[_0xfd2b('0x67')][_0xfd2b('0x5c')](_0x55b515['body']);}})['then'](respondWithResult(_0x44bf93,null))['catch'](handleError(_0x44bf93,null));};exports[_0xfd2b('0x68')]=function(_0x27a867,_0x25a911,_0x74d145){var _0x4a70df={'raw':![],'where':{}};var _0x56aa82={};var _0xa47be={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x27a867[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x25a911,null))[_0xfd2b('0x36')](function(_0x4a470e){if(_0x4a470e){_0x56aa82[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x67')][_0xfd2b('0x3f')]);_0x56aa82[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x27a867[_0xfd2b('0x43')]);_0x56aa82[_0xfd2b('0x45')]=_['intersection'](_0x56aa82['model'],_0x56aa82[_0xfd2b('0x43')]);_0x4a70df[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x56aa82[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x4a70df['attributes']=_0x4a70df[_0xfd2b('0x47')][_0xfd2b('0x59')]?_0x4a70df[_0xfd2b('0x47')]:_0x56aa82['model'];if(!_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x6a')]('nolimit')){_0x4a70df[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x4a70df[_0xfd2b('0x2e')]=qs['offset'](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}_0x4a70df[_0xfd2b('0x4a')]=qs[_0xfd2b('0x4b')](_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x4a70df[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x27a867[_0xfd2b('0x43')],_0x56aa82[_0xfd2b('0x45')]));_0x4a70df['where'][_0xfd2b('0x6b')]=_0x4a470e['id'];if(_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x4a70df[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x4a70df[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x4a70df[_0xfd2b('0x47')],function(_0x57c0c5){var _0x23b387={};_0x23b387[_0x57c0c5]={'$like':'%'+_0x27a867['query'][_0xfd2b('0x4e')]+'%'};return _0x23b387;})});}_0x4a70df=_[_0xfd2b('0x4f')]({},_0x4a70df,_0x27a867[_0xfd2b('0x52')]);return db[_0xfd2b('0x67')][_0xfd2b('0x31')]({'where':_0x4a70df[_0xfd2b('0x4c')]})[_0xfd2b('0x36')](function(_0xbfd8cc){_0xa47be[_0xfd2b('0x31')]=_0xbfd8cc;if(_0x27a867[_0xfd2b('0x43')][_0xfd2b('0x54')]){_0x4a70df[_0xfd2b('0x5a')]=[{'all':!![]}];}return db[_0xfd2b('0x67')][_0xfd2b('0x6c')](_0x4a70df);})[_0xfd2b('0x36')](function(_0x4764d3){_0xa47be[_0xfd2b('0x55')]=_0x4764d3;return _0xa47be;});}})[_0xfd2b('0x36')](respondWithFilteredResult(_0x25a911,_0x4a70df))[_0xfd2b('0x5b')](handleError(_0x25a911,null));};exports['removeDispositions']=function(_0x485a94,_0x355202,_0x557445){return db[_0xfd2b('0x53')]['find']({'where':{'id':_0x485a94[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x355202,null))[_0xfd2b('0x36')](function(_0x4cd396){if(_0x4cd396){return _0x4cd396['removeDispositions'](_0x485a94[_0xfd2b('0x43')][_0xfd2b('0x6d')]);}})['then'](respondWithStatusCode(_0x355202,null))[_0xfd2b('0x5b')](handleError(_0x355202,null));};exports['addAnswer']=function(_0x28e68d,_0x49c423,_0x2f0993){if(_0x28e68d[_0xfd2b('0x5d')]['id']){delete _0x28e68d[_0xfd2b('0x5d')]['id'];}return db['FaxAccount'][_0xfd2b('0x62')]({'where':{'id':_0x28e68d[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x49c423,null))[_0xfd2b('0x36')](function(_0xd79bd){if(_0xd79bd){_0x28e68d['body']['FaxAccountId']=_0xd79bd['id'];return db[_0xfd2b('0x6e')][_0xfd2b('0x5c')](_0x28e68d[_0xfd2b('0x5d')]);}})[_0xfd2b('0x36')](respondWithResult(_0x49c423,null))[_0xfd2b('0x5b')](handleError(_0x49c423,null));};exports[_0xfd2b('0x6f')]=function(_0x4c2b52,_0x14f867,_0x36b059){var _0x2045b5={'raw':![],'where':{}};var _0x580489={};var _0x21152e={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x4c2b52[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x14f867,null))[_0xfd2b('0x36')](function(_0x96bd7){if(_0x96bd7){_0x580489[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x6e')][_0xfd2b('0x3f')]);_0x580489[_0xfd2b('0x43')]=_['keys'](_0x4c2b52[_0xfd2b('0x43')]);_0x580489[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x580489[_0xfd2b('0x42')],_0x580489[_0xfd2b('0x43')]);_0x2045b5['attributes']=_[_0xfd2b('0x46')](_0x580489[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x2045b5[_0xfd2b('0x47')]=_0x2045b5[_0xfd2b('0x47')][_0xfd2b('0x59')]?_0x2045b5[_0xfd2b('0x47')]:_0x580489[_0xfd2b('0x42')];if(!_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x6a')]('nolimit')){_0x2045b5[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x2045b5[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x4c2b52[_0xfd2b('0x43')]['offset']);}_0x2045b5['order']=qs['sort'](_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x2045b5[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x4c2b52[_0xfd2b('0x43')],_0x580489[_0xfd2b('0x45')]));_0x2045b5[_0xfd2b('0x4c')][_0xfd2b('0x6b')]=_0x96bd7['id'];if(_0x4c2b52['query'][_0xfd2b('0x4e')]){_0x2045b5[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x2045b5['where'],{'$or':_['map'](_0x2045b5[_0xfd2b('0x47')],function(_0x119f7c){var _0xc1834b={};_0xc1834b[_0x119f7c]={'$like':'%'+_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x4e')]+'%'};return _0xc1834b;})});}_0x2045b5=_[_0xfd2b('0x4f')]({},_0x2045b5,_0x4c2b52['options']);return db[_0xfd2b('0x6e')][_0xfd2b('0x31')]({'where':_0x2045b5[_0xfd2b('0x4c')]})[_0xfd2b('0x36')](function(_0x54662c){_0x21152e[_0xfd2b('0x31')]=_0x54662c;if(_0x4c2b52[_0xfd2b('0x43')][_0xfd2b('0x54')]){_0x2045b5['include']=[{'all':!![]}];}return db[_0xfd2b('0x6e')]['findAll'](_0x2045b5);})['then'](function(_0x5cfde3){_0x21152e[_0xfd2b('0x55')]=_0x5cfde3;return _0x21152e;});}})['then'](respondWithFilteredResult(_0x14f867,_0x2045b5))[_0xfd2b('0x5b')](handleError(_0x14f867,null));};exports[_0xfd2b('0x70')]=function(_0x4c55f3,_0x47c694,_0x5de472){return db[_0xfd2b('0x53')]['find']({'where':{'id':_0x4c55f3[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x47c694,null))['then'](function(_0x202cce){if(_0x202cce){return _0x202cce[_0xfd2b('0x70')](_0x4c55f3[_0xfd2b('0x43')][_0xfd2b('0x6d')]);}})[_0xfd2b('0x36')](respondWithStatusCode(_0x47c694,null))[_0xfd2b('0x5b')](handleError(_0x47c694,null));};exports[_0xfd2b('0x71')]=function(_0x5f1071,_0x305e9f,_0x53d467){return db[_0xfd2b('0x72')][_0xfd2b('0x62')]({'where':{'id':_0x5f1071[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x305e9f,null))['then'](function(_0x4c507c){if(_0x4c507c){return _0x4c507c['addInteraction'](_0x5f1071[_0xfd2b('0x5d')][_0xfd2b('0x6d')],_['omit'](_0x5f1071[_0xfd2b('0x5d')],['ids','id'])||{});}})[_0xfd2b('0x36')](respondWithResult(_0x305e9f,null))[_0xfd2b('0x5b')](handleError(_0x305e9f,null));};exports['getInteractions']=function(_0x1d7f6b,_0x30ac90,_0x54d85f){var _0x49d369={'raw':![],'where':{}};var _0x511fed={};var _0x51ef98={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x1d7f6b[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x30ac90,null))['then'](function(_0x396f4d){if(_0x396f4d){_0x511fed[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x72')]['rawAttributes']);_0x511fed[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x1d7f6b[_0xfd2b('0x43')]);_0x511fed[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x511fed[_0xfd2b('0x42')],_0x511fed[_0xfd2b('0x43')]);_0x49d369[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x511fed[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x1d7f6b['query'][_0xfd2b('0x48')]));_0x49d369['attributes']=_0x49d369[_0xfd2b('0x47')]['length']?_0x49d369[_0xfd2b('0x47')]:_0x511fed[_0xfd2b('0x42')];if(!_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x6a')]('nolimit')){_0x49d369[_0xfd2b('0x30')]=qs[_0xfd2b('0x30')](_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x49d369[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}_0x49d369[_0xfd2b('0x4a')]=qs['sort'](_0x1d7f6b[_0xfd2b('0x43')]['sort']);_0x49d369[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_['pick'](_0x1d7f6b[_0xfd2b('0x43')],_0x511fed['filters']));_0x49d369[_0xfd2b('0x4c')]['FaxAccountId']=_0x396f4d['id'];if(_0x1d7f6b[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x49d369[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x49d369[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x49d369[_0xfd2b('0x47')],function(_0x4fb364){var _0x14bb3e={};_0x14bb3e[_0x4fb364]={'$like':'%'+_0x1d7f6b[_0xfd2b('0x43')]['filter']+'%'};return _0x14bb3e;})});}_0x49d369=_['merge']({},_0x49d369,_0x1d7f6b[_0xfd2b('0x52')]);return db[_0xfd2b('0x72')][_0xfd2b('0x31')]({'where':_0x49d369['where']})[_0xfd2b('0x36')](function(_0x234549){_0x51ef98[_0xfd2b('0x31')]=_0x234549;if(_0x1d7f6b['query'][_0xfd2b('0x54')]){_0x49d369['include']=[{'model':db[_0xfd2b('0x73')],'as':_0xfd2b('0x74'),'required':![]},{'model':db[_0xfd2b('0x75')],'as':_0xfd2b('0x76'),'attributes':['name',_0xfd2b('0x77'),_0xfd2b('0x78')],'required':![]},{'model':db[_0xfd2b('0x79')],'as':_0xfd2b('0x7a'),'attributes':['id',_0xfd2b('0x3b'),_0xfd2b('0x7b')],'where':_0x1d7f6b['query'][_0xfd2b('0x7c')]?{'id':_0x1d7f6b['query'][_0xfd2b('0x7c')]}:undefined,'required':_0x1d7f6b[_0xfd2b('0x43')]['tag']?!![]:![]}];}return db[_0xfd2b('0x72')][_0xfd2b('0x6c')](_0x49d369);})[_0xfd2b('0x36')](function(_0x16c275){_0x51ef98[_0xfd2b('0x55')]=_0x16c275;return _0x51ef98;});}})[_0xfd2b('0x36')](respondWithFilteredResult(_0x30ac90,_0x49d369))[_0xfd2b('0x5b')](handleError(_0x30ac90,null));};exports[_0xfd2b('0x7d')]=function(_0x2b672e,_0x198ad5){var _0x23b3fa=_0x2b672e[_0xfd2b('0x57')]['id'];var _0x54da2f=_0x2b672e['body'];var _0x583b73=0xc8;var _0x20378c=null;return db[_0xfd2b('0x7e')][_0xfd2b('0x7f')]({'isolationLevel':db['sequelize'][_0xfd2b('0x80')]['ISOLATION_LEVELS'][_0xfd2b('0x81')]},function(_0x5863b8){return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x23b3fa},'transaction':_0x5863b8})[_0xfd2b('0x36')](function(_0xaac154){if(_0xaac154){return db[_0xfd2b('0x82')][_0xfd2b('0x37')]({'where':{'FaxAccountId':_0x23b3fa},'transaction':_0x5863b8})[_0xfd2b('0x36')](function(){var _0x25d66c=_[_0xfd2b('0x50')](_0x54da2f,function(_0x548a96){_0x548a96['FaxAccountId']=_0x23b3fa;return _0x548a96;});return db['FaxApplication'][_0xfd2b('0x83')](_0x25d66c,{'transaction':_0x5863b8});});}else{_0x583b73=0x194;_0x20378c=[];}});})[_0xfd2b('0x36')](function(){if(_0x583b73!==0x194){return db[_0xfd2b('0x82')][_0xfd2b('0x84')]({'where':{'FaxAccountId':_0x23b3fa},'order':'priority'})['then'](function(_0x4ecdaf){_0x20378c=_0x4ecdaf;});}})[_0xfd2b('0x5b')](function(_0x1d5e3e){_0x583b73=0x1f4;logger[_0xfd2b('0x25')](_0x1d5e3e[_0xfd2b('0x85')]);if(_0x1d5e3e['name']){delete _0x1d5e3e[_0xfd2b('0x3b')];}_0x20378c=_0x1d5e3e;})[_0xfd2b('0x86')](function(){if(_0x20378c===null){_0x198ad5[_0xfd2b('0x2a')](_0x583b73);}else{if(_0x583b73===0x1f4){_0x198ad5[_0xfd2b('0x2b')](_0x583b73)[_0xfd2b('0x3c')](_0x20378c);}else{_0x198ad5[_0xfd2b('0x2b')](_0x583b73)[_0xfd2b('0x2d')](_0x20378c);}}});};exports[_0xfd2b('0x87')]=function(_0x41b208,_0x41c069,_0x287fb6){var _0x4c0b94={};var _0x1f0291={};var _0x3ebd66;var _0x3d634a;return db[_0xfd2b('0x53')][_0xfd2b('0x69')]({'where':{'id':_0x41b208[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x41c069,null))[_0xfd2b('0x36')](function(_0x4f5cf2){if(_0x4f5cf2){_0x3ebd66=_0x4f5cf2;_0x1f0291[_0xfd2b('0x42')]=_[_0xfd2b('0x44')](db[_0xfd2b('0x82')]['rawAttributes']);_0x1f0291[_0xfd2b('0x43')]=_['keys'](_0x41b208[_0xfd2b('0x43')]);_0x1f0291[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x1f0291[_0xfd2b('0x42')],_0x1f0291[_0xfd2b('0x43')]);_0x4c0b94[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x1f0291['model'],qs[_0xfd2b('0x48')](_0x41b208['query']['fields']));_0x4c0b94[_0xfd2b('0x47')]=_0x4c0b94[_0xfd2b('0x47')]['length']?_0x4c0b94['attributes']:_0x1f0291[_0xfd2b('0x42')];_0x4c0b94['order']=qs[_0xfd2b('0x4b')](_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x4c0b94[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_['pick'](_0x41b208['query'],_0x1f0291[_0xfd2b('0x45')]));if(_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x4c0b94[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x4c0b94['where'],{'$or':_[_0xfd2b('0x50')](_0x4c0b94['attributes'],function(_0x4be42a){var _0x9109b7={};_0x9109b7[_0x4be42a]={'$like':'%'+_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x4e')]+'%'};return _0x9109b7;})});}_0x4c0b94=_['merge']({},_0x4c0b94,_0x41b208[_0xfd2b('0x52')]);return _0x3ebd66['getApplications'](_0x4c0b94);}})['then'](function(_0x233169){if(_0x233169){_0x3d634a=_0x233169[_0xfd2b('0x59')];if(!_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x6a')](_0xfd2b('0x49'))){_0x4c0b94[_0xfd2b('0x30')]=qs['limit'](_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x4c0b94[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x41b208[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}return _0x3ebd66['getApplications'](_0x4c0b94);}})[_0xfd2b('0x36')](function(_0x2a982f){if(_0x2a982f){return _0x2a982f?{'count':_0x3d634a,'rows':_0x2a982f}:null;}})[_0xfd2b('0x36')](respondWithResult(_0x41c069,null))[_0xfd2b('0x5b')](handleError(_0x41c069,null));};function Extension(_0x5b75b6,_0xf2a81d,_0xb290a7,_0x2786c4){this[_0xfd2b('0x88')]='from-voip-provider';this[_0xfd2b('0x89')]=_0x5b75b6[_0xfd2b('0x8a')];this['app']=_0x2786c4;this['type']='system';this['description']='Fax\x20Extension';this['FaxAccountId']=_0x5b75b6['id'];this[_0xfd2b('0x8b')]=_0xf2a81d;this[_0xfd2b('0x8c')]=_0xb290a7;}function createExtensionsReciveFax(_0x292101){var _0x44df46=0x1;var _0x53fa31=[];_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,'','Answer'));_0x44df46+=0x1;_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,_0xfd2b('0x8e'),_0xfd2b('0x8f')));_0x44df46+=0x1;for(var _0x47dfb5 in _0x292101){if(_0x292101['hasOwnProperty'](_0x47dfb5)&&(_0x47dfb5==='ecm'||_0x47dfb5===_0xfd2b('0x8a')||_0x47dfb5===_0xfd2b('0x90')||_0x47dfb5===_0xfd2b('0x91')||_0x47dfb5===_0xfd2b('0x92')||_0x47dfb5==='maxrate'||_0x47dfb5==='minrate'||_0x47dfb5===_0xfd2b('0x93')||_0x47dfb5==='t38timeout')){_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,_0xfd2b('0x94')+_0x47dfb5+')='+_0x292101[_0x47dfb5],'Set'));_0x44df46+=0x1;}}_0x53fa31['push'](new Extension(_0x292101,_0x44df46,'6',_0xfd2b('0x95')));_0x44df46+=0x1;_0x53fa31[_0xfd2b('0x8d')](new Extension(_0x292101,_0x44df46,_0xfd2b('0x96'),_0xfd2b('0x97')));_0x44df46=0x0;return _0x53fa31;}exports[_0xfd2b('0x98')]=function(_0x15b843,_0x41631d,_0x132df1){var _0xcf9daf;return db[_0xfd2b('0x7e')][_0xfd2b('0x7f')](function(_0x4a7383){return db['FaxAccount'][_0xfd2b('0x5c')](_0x15b843[_0xfd2b('0x5d')],{'transaction':_0x4a7383})['then'](function(_0x5c2a6f){_0xcf9daf=_0x5c2a6f[_0xfd2b('0x38')]({'plain':!![]});return db[_0xfd2b('0x99')][_0xfd2b('0x83')](createExtensionsReciveFax(_0xcf9daf),{'transaction':_0x4a7383});});})[_0xfd2b('0x36')](function(){return _0xcf9daf;})[_0xfd2b('0x36')](respondWithResult(_0x41631d,null))[_0xfd2b('0x5b')](handleError(_0x41631d,null));};exports[_0xfd2b('0x9a')]=function(_0x12af9c,_0x44761e,_0xb728ee){var _0x587c57;return db[_0xfd2b('0x7e')][_0xfd2b('0x7f')](function(_0x3893a6){return db[_0xfd2b('0x53')][_0xfd2b('0x35')](_0x12af9c[_0xfd2b('0x5d')],{'where':{'id':_0x12af9c[_0xfd2b('0x5d')]['id']},'transaction':_0x3893a6})['then'](function(_0x379ae8){return db[_0xfd2b('0x99')][_0xfd2b('0x37')]({'where':{'FaxAccountId':_0x12af9c['body']['id']},'transaction':_0x3893a6})['then'](function(_0x51e620){return db['VoiceExtension'][_0xfd2b('0x83')](createExtensionsReciveFax(_[_0xfd2b('0x9b')](_0x12af9c[_0xfd2b('0x5d')],[_0xfd2b('0x9c'),'key',_0xfd2b('0x9d'),_0xfd2b('0x9e'),_0xfd2b('0x9f'),_0xfd2b('0xa0')])),{'transaction':_0x3893a6});});});})[_0xfd2b('0x36')](function(){return db['FaxAccount'][_0xfd2b('0xa1')](_0x12af9c[_0xfd2b('0x5d')]['id']);})[_0xfd2b('0x36')](respondWithResult(_0x44761e,null))[_0xfd2b('0x5b')](handleError(_0x44761e,null));};exports['getMessages']=function(_0x320fe6,_0x2e8384,_0x4d930d){var _0x3eba27={'raw':!![],'where':{}};var _0x33619f={};var _0x1d19a7={'count':0x0,'rows':[]};return db[_0xfd2b('0x53')]['findOne']({'where':{'id':_0x320fe6[_0xfd2b('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e8384,null))[_0xfd2b('0x36')](function(_0x296375){if(_0x296375){_0x33619f['model']=_[_0xfd2b('0x44')](db[_0xfd2b('0xa2')][_0xfd2b('0x3f')]);_0x33619f['query']=_[_0xfd2b('0x44')](_0x320fe6[_0xfd2b('0x43')]);_0x33619f[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x33619f[_0xfd2b('0x42')],_0x33619f[_0xfd2b('0x43')]);_0x3eba27[_0xfd2b('0x47')]=_[_0xfd2b('0x46')](_0x33619f['model'],qs[_0xfd2b('0x48')](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x48')]));_0x3eba27[_0xfd2b('0x47')]=_0x3eba27['attributes'][_0xfd2b('0x59')]?_0x3eba27['attributes']:_0x33619f['model'];if(!_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x6a')](_0xfd2b('0x49'))){_0x3eba27[_0xfd2b('0x30')]=qs['limit'](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x3eba27[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}_0x3eba27[_0xfd2b('0x4a')]=qs[_0xfd2b('0x4b')](_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x4b')]);_0x3eba27[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x320fe6[_0xfd2b('0x43')],_0x33619f[_0xfd2b('0x45')]));_0x3eba27['where'][_0xfd2b('0x6b')]=_0x296375['id'];if(_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x3eba27[_0xfd2b('0x4c')]=_['merge'](_0x3eba27[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x3eba27[_0xfd2b('0x47')],function(_0x3d01db){var _0x51f231={};_0x51f231[_0x3d01db]={'$like':'%'+_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0x4e')]+'%'};return _0x51f231;})});}if(_0x320fe6[_0xfd2b('0x43')][_0xfd2b('0xa3')]){var _0x1a26a7=_0x320fe6[_0xfd2b('0x43')]['$gte'][_0xfd2b('0xa4')](',');var _0x1474d7={};_0x1474d7[_0x1a26a7[0x0]]={'$gte':moment(_0x1a26a7[0x1])[_0xfd2b('0xa5')](_0xfd2b('0xa6'))};_0x3eba27[_0xfd2b('0x4c')]=_['merge'](_0x3eba27[_0xfd2b('0x4c')],_0x1474d7);}_0x3eba27=_['merge']({},_0x3eba27,_0x320fe6[_0xfd2b('0x52')]);return db[_0xfd2b('0xa2')][_0xfd2b('0x31')]({'where':_0x3eba27[_0xfd2b('0x4c')]})[_0xfd2b('0x36')](function(_0x12e4ac){_0x1d19a7[_0xfd2b('0x31')]=_0x12e4ac;if(_0x320fe6['query']['includeAll']){_0x3eba27['include']=[{'all':!![]}];}return db[_0xfd2b('0xa2')]['findAll'](_0x3eba27);})['then'](function(_0x4a3d27){_0x1d19a7[_0xfd2b('0x55')]=_0x4a3d27;return _0x1d19a7;});}})[_0xfd2b('0x36')](respondWithFilteredResult(_0x2e8384,_0x3eba27))['catch'](handleError(_0x2e8384,null));};exports['send']=function(_0x1e0cab,_0xbdf52b,_0x3e78df){var _0x4404cf,_0x11ccf5={},_0x160407;if(_0x1e0cab['body']['to']){_0x160407=_0x1e0cab['body']['to'][0x0];}return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x1e0cab[_0xfd2b('0x57')]['id']},'include':[{'model':db[_0xfd2b('0xa7')],'as':_0xfd2b('0xa8'),'include':[{'model':db['CmContact'],'as':_0xfd2b('0xa9'),'where':{'fax':_0x160407},'limit':0x1,'order':[[_0xfd2b('0x9e'),'DESC']]}]}]})[_0xfd2b('0x36')](handleEntityNotFound(_0xbdf52b,null))[_0xfd2b('0x36')](function(_0x3cbc3f){_0x4404cf=_0x3cbc3f;if(_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')]&&_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')]['length']){for(var _0x40ec74=0x0;_0x40ec74<_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][_0xfd2b('0x59')];_0x40ec74+=0x1){_0x1e0cab['body'][_0xfd2b('0xaa')][_0x40ec74]={'filename':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][_0x40ec74][_0xfd2b('0x3b')],'id':_0x1e0cab['body'][_0xfd2b('0xaa')][_0x40ec74]['id'],'path':path[_0xfd2b('0xab')](config['root'],_0xfd2b('0xac'),_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][_0x40ec74][_0xfd2b('0xad')])};}}return respondWithRpcPromise(_0xfd2b('0xae'),_0xfd2b('0xae'),{'FaxAccountId':_['isNil'](_0x1e0cab[_0xfd2b('0x57')]['id'])?undefined:_0x1e0cab['params']['id'],'path':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0][_0xfd2b('0xb0')])?undefined:_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0][_0xfd2b('0xb0')],'fax':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0])?undefined:_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0]},client9002);})[_0xfd2b('0x36')](function(){if(_0x4404cf){if(_['isNil'](_0x1e0cab['body'][_0xfd2b('0xb1')])){_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xb1')]=util[_0xfd2b('0xa5')]('\x22%s\x22\x20<%s>',_0x4404cf[_0xfd2b('0x3b')],_0x4404cf[_0xfd2b('0xb2')]);}if(_0x4404cf[_0xfd2b('0xa8')]){if(_0x4404cf[_0xfd2b('0xa8')]['Contacts']['length']){return _0x4404cf[_0xfd2b('0xa8')][_0xfd2b('0xa9')][0x0];}else{return db[_0xfd2b('0x73')][_0xfd2b('0x5c')](_[_0xfd2b('0x17')](_0x1e0cab[_0xfd2b('0x5d')],{'firstName':_0x1e0cab['body']['to'][0x0],'phone':_0x1e0cab['body']['to'][0x0],'fax':_0x1e0cab['body']['to'][0x0],'ListId':_0x4404cf['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xfd2b('0xb3'));}})[_0xfd2b('0x36')](function(_0x4ee5c9){if(_0x4ee5c9){return db['FaxInteraction'][_0xfd2b('0x62')]({'where':{'ContactId':_0x4ee5c9['id'],'closed':![],'FaxAccountId':_0x4404cf['id']}})[_0xfd2b('0x36')](function(_0x130506){if(_0x130506){return[_0x130506,![]];}return db['FaxInteraction'][_0xfd2b('0x5c')]({'UserId':_0x1e0cab[_0xfd2b('0x5e')]['id'],'ContactId':_0x4ee5c9['id'],'FaxAccountId':_0x4404cf['id'],'fax':_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0],'firstMsgDirection':_0xfd2b('0xb4'),'Messages':[_[_0xfd2b('0x4f')](_0x1e0cab[_0xfd2b('0x5d')],{'read':![],'body':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0]['filename'],'FaxAccountId':_0x4404cf['id'],'UserId':_0x1e0cab[_0xfd2b('0x5e')]['id'],'ContactId':_0x4ee5c9['id'],'AttachmentId':_0x1e0cab[_0xfd2b('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xfd2b('0xa2')],'as':_0xfd2b('0xb5')}]})[_0xfd2b('0x36')](function(_0xf741a3){return[_0xf741a3,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfd2b('0xb6')](function(_0x48930e,_0x2f72ce){if(_0x2f72ce){return _0x48930e;}return db[_0xfd2b('0xa2')]['create']({'direction':'out','read':![],'body':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0][_0xfd2b('0xb7')],'FaxAccountId':_0x4404cf['id'],'FaxInteractionId':_0x48930e['id'],'UserId':_0x1e0cab['user']['id'],'ContactId':_0x48930e[_0xfd2b('0xb8')],'AttachmentId':_0x1e0cab[_0xfd2b('0x5d')]['attachments'][0x0]['id']})[_0xfd2b('0x36')](function(_0x3b0303){_0x48930e[_0xfd2b('0xb9')][_0xfd2b('0xb5')]=[];_0x48930e['dataValues'][_0xfd2b('0xb5')][_0xfd2b('0x8d')](_0x3b0303[_0xfd2b('0xb9')]);return _0x48930e;});})[_0xfd2b('0x36')](function(_0x5e4fe6){respondWithRpcPromise(_0xfd2b('0xba'),_0xfd2b('0xba'),{'FaxAccountId':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x57')]['id'])?undefined:_0x1e0cab[_0xfd2b('0x57')]['id'],'path':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')]['attachments'][0x0]['path'])?undefined:_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0]['path'],'fax':_[_0xfd2b('0xaf')](_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0])?undefined:_0x1e0cab[_0xfd2b('0x5d')]['to'][0x0],'AttachmentId':_0x1e0cab[_0xfd2b('0x5d')][_0xfd2b('0xaa')][0x0]['id']},client9002)[_0xfd2b('0x36')](function(_0x2a9383){logger[_0xfd2b('0x20')](_0xfd2b('0xbb'),_0x2a9383);})['catch'](function(_0x4414b8){logger[_0xfd2b('0x20')](_0xfd2b('0xbb'),_0x4414b8);});return _0x5e4fe6;})['then'](respondWithResult(_0xbdf52b,null))[_0xfd2b('0x5b')](handleError(_0xbdf52b,null));};exports[_0xfd2b('0xbc')]=function(_0x230b44,_0x5c787f,_0x22cd14){return db['FaxAccount'][_0xfd2b('0x62')]({'where':{'id':_0x230b44[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x5c787f,null))[_0xfd2b('0x36')](function(_0x39d6de){if(_0x39d6de){return _0x39d6de[_0xfd2b('0xbc')](_0x230b44[_0xfd2b('0x5d')][_0xfd2b('0x6d')],_[_0xfd2b('0x9b')](_0x230b44[_0xfd2b('0x5d')],[_0xfd2b('0x6d'),'id'])||{})[_0xfd2b('0xb6')](function(_0x34bdd5){for(var _0xf2ba25=0x0;_0xf2ba25<_0x230b44[_0xfd2b('0x5d')][_0xfd2b('0x6d')][_0xfd2b('0x59')];_0xf2ba25+=0x1){socket[_0xfd2b('0xbd')](_0xfd2b('0xbe'),{'UserId':Number(_0x230b44['body'][_0xfd2b('0x6d')][_0xf2ba25]),'FaxAccountId':Number(_0x230b44[_0xfd2b('0x57')]['id'])});}return _0x34bdd5;});}})[_0xfd2b('0x36')](respondWithResult(_0x5c787f,null))[_0xfd2b('0x5b')](handleError(_0x5c787f,null));};exports[_0xfd2b('0xbf')]=function(_0x2134e9,_0x287aa9,_0x1bda49){return db[_0xfd2b('0x53')][_0xfd2b('0x62')]({'where':{'id':_0x2134e9[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x287aa9,null))[_0xfd2b('0x36')](function(_0x14915f){if(_0x14915f){return _0x14915f[_0xfd2b('0xbf')](_0x2134e9[_0xfd2b('0x43')][_0xfd2b('0x6d')])[_0xfd2b('0x36')](function(){if(_['isArray'](_0x2134e9['query'][_0xfd2b('0x6d')])){for(var _0x248c93=0x0;_0x248c93<_0x2134e9[_0xfd2b('0x43')][_0xfd2b('0x6d')][_0xfd2b('0x59')];_0x248c93+=0x1){socket[_0xfd2b('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x2134e9['query'][_0xfd2b('0x6d')][_0x248c93]),'FaxAccountId':Number(_0x2134e9[_0xfd2b('0x57')]['id'])});}}else{socket[_0xfd2b('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x2134e9[_0xfd2b('0x43')][_0xfd2b('0x6d')]),'FaxAccountId':Number(_0x2134e9[_0xfd2b('0x57')]['id'])});}});}})[_0xfd2b('0x36')](respondWithStatusCode(_0x287aa9,null))[_0xfd2b('0x5b')](handleError(_0x287aa9,null));};exports['getAgents']=function(_0x2d86fa,_0x1eb25d,_0x1cec76){var _0x130a95={};var _0x69dc08={};var _0x1516e0;var _0x269320;return db[_0xfd2b('0x53')]['findOne']({'where':{'id':_0x2d86fa[_0xfd2b('0x57')]['id']}})[_0xfd2b('0x36')](handleEntityNotFound(_0x1eb25d,null))[_0xfd2b('0x36')](function(_0x40e0c7){if(_0x40e0c7){_0x1516e0=_0x40e0c7;_0x69dc08[_0xfd2b('0x42')]=_['keys'](db[_0xfd2b('0x75')]['rawAttributes']);_0x69dc08[_0xfd2b('0x43')]=_[_0xfd2b('0x44')](_0x2d86fa['query']);_0x69dc08[_0xfd2b('0x45')]=_[_0xfd2b('0x46')](_0x69dc08[_0xfd2b('0x42')],_0x69dc08[_0xfd2b('0x43')]);_0x130a95['attributes']=_[_0xfd2b('0x46')](_0x69dc08[_0xfd2b('0x42')],qs[_0xfd2b('0x48')](_0x2d86fa['query'][_0xfd2b('0x48')]));_0x130a95[_0xfd2b('0x47')]=_0x130a95[_0xfd2b('0x47')][_0xfd2b('0x59')]?_0x130a95[_0xfd2b('0x47')]:_0x69dc08[_0xfd2b('0x42')];_0x130a95[_0xfd2b('0x4a')]=qs['sort'](_0x2d86fa['query'][_0xfd2b('0x4b')]);_0x130a95[_0xfd2b('0x4c')]=qs[_0xfd2b('0x45')](_[_0xfd2b('0x4d')](_0x2d86fa[_0xfd2b('0x43')],_0x69dc08[_0xfd2b('0x45')]));if(_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x4e')]){_0x130a95[_0xfd2b('0x4c')]=_[_0xfd2b('0x4f')](_0x130a95[_0xfd2b('0x4c')],{'$or':_[_0xfd2b('0x50')](_0x130a95[_0xfd2b('0x47')],function(_0x4b4bdd){var _0x98d894={};_0x98d894[_0x4b4bdd]={'$like':'%'+_0x2d86fa['query'][_0xfd2b('0x4e')]+'%'};return _0x98d894;})});}_0x130a95=_[_0xfd2b('0x4f')]({},_0x130a95,_0x2d86fa['options']);return _0x1516e0['getAgents'](_0x130a95);}})[_0xfd2b('0x36')](function(_0x17e88c){if(_0x17e88c){_0x269320=_0x17e88c[_0xfd2b('0x59')];if(!_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x6a')](_0xfd2b('0x49'))){_0x130a95[_0xfd2b('0x30')]=qs['limit'](_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x30')]);_0x130a95[_0xfd2b('0x2e')]=qs[_0xfd2b('0x2e')](_0x2d86fa[_0xfd2b('0x43')][_0xfd2b('0x2e')]);}return _0x1516e0[_0xfd2b('0xc0')](_0x130a95);}})[_0xfd2b('0x36')](function(_0x3d595e){if(_0x3d595e){return _0x3d595e?{'count':_0x269320,'rows':_0x3d595e}:null;}})[_0xfd2b('0x36')](respondWithResult(_0x1eb25d,null))[_0xfd2b('0x5b')](handleError(_0x1eb25d,null));}; \ No newline at end of file +var _0x1f37=['headerinfo','t38timeout','FAXOPT(','/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','addAccountApplications','sequelize','bulkCreate','VoiceExtension','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List','Contacts','ListId','List\x20not\x20found','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','offset','Content-Range','json','apply','reject','save','update','then','get','FaxAccounts','UserProfileResource','destroy','end','stack','name','send','index','Pause','map','FaxAccount','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','params','length','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','addDisposition','FaxAccountId','Disposition','getDispositions','keys','sort','findAll','removeDispositions','ids','CannedAnswer','hasOwnProperty','addInteraction','omit','findOne','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','READ_COMMITTED','FaxApplication','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect'];(function(_0x488072,_0x151405){var _0x4b62c7=function(_0x3eca29){while(--_0x3eca29){_0x488072['push'](_0x488072['shift']());}};_0x4b62c7(++_0x151405);}(_0x1f37,0x1b7));var _0x71f3=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x1f37[_0x311c35];return _0x5cc50c;};'use strict';var emlformat=require(_0x71f3('0x0'));var rimraf=require(_0x71f3('0x1'));var zipdir=require(_0x71f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x71f3('0x3'));var moment=require(_0x71f3('0x4'));var BPromise=require(_0x71f3('0x5'));var Mustache=require(_0x71f3('0x6'));var util=require(_0x71f3('0x7'));var path=require(_0x71f3('0x8'));var sox=require(_0x71f3('0x9'));var csv=require(_0x71f3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71f3('0xb'));var _=require('lodash');var squel=require(_0x71f3('0xc'));var crypto=require(_0x71f3('0xd'));var jsforce=require(_0x71f3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x71f3('0xa'));var querystring=require(_0x71f3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x71f3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x71f3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x71f3('0x12'))(_0x71f3('0x13'));var utils=require('../../config/utils');var config=require(_0x71f3('0x14'));var licenseUtil=require(_0x71f3('0x15'));var db=require('../../mysqldb')['db'];config[_0x71f3('0x16')]=_['defaults'](config[_0x71f3('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x71f3('0x17'))(new Redis(config[_0x71f3('0x16')]));require(_0x71f3('0x18'))[_0x71f3('0x19')](socket);var jayson=require(_0x71f3('0x1a'));var client=jayson['client'][_0x71f3('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x71f3('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3a470c,_0x5f510a,_0x21e9ad,_0x4bdc7c){return new BPromise(function(_0x4405f6,_0x8dcdde){var _0xfe4a60=_0x4bdc7c||client;return _0xfe4a60[_0x71f3('0x1c')](_0x3a470c,_0x21e9ad)['then'](function(_0x18dcf4){logger[_0x71f3('0x1d')](_0x71f3('0x1e'),_0x5f510a,_0x71f3('0x1f'));logger[_0x71f3('0x20')](_0x71f3('0x21'),_0x5f510a,_0x71f3('0x1f'),JSON[_0x71f3('0x22')](_0x18dcf4));if(_0x18dcf4[_0x71f3('0x23')]){if(_0x18dcf4[_0x71f3('0x23')][_0x71f3('0x24')]===0x1f4){logger[_0x71f3('0x23')](_0x71f3('0x1e'),_0x5f510a,_0x18dcf4['error'][_0x71f3('0x25')]);return _0x8dcdde(_0x18dcf4[_0x71f3('0x23')]['message']);}logger[_0x71f3('0x23')](_0x71f3('0x1e'),_0x5f510a,_0x18dcf4[_0x71f3('0x23')]['message']);return _0x4405f6(_0x18dcf4[_0x71f3('0x23')][_0x71f3('0x25')]);}else{logger[_0x71f3('0x1d')]('FaxAccount,\x20%s,\x20%s',_0x5f510a,_0x71f3('0x1f'));_0x4405f6(_0x18dcf4[_0x71f3('0x26')][_0x71f3('0x25')]);}})[_0x71f3('0x27')](function(_0x5b76c4){logger['error'](_0x71f3('0x1e'),_0x5f510a,_0x5b76c4);_0x8dcdde(_0x5b76c4);});});}function respondWithStatusCode(_0x540154,_0x4838b3){_0x4838b3=_0x4838b3||0xcc;return function(_0x372633){if(_0x372633){return _0x540154[_0x71f3('0x28')](_0x4838b3);}return _0x540154[_0x71f3('0x29')](_0x4838b3)['end']();};}function respondWithResult(_0x473a1b,_0x14fae3){_0x14fae3=_0x14fae3||0xc8;return function(_0x11b308){if(_0x11b308){return _0x473a1b[_0x71f3('0x29')](_0x14fae3)['json'](_0x11b308);}};}function respondWithFilteredResult(_0x23f8a8,_0x2dde01){return function(_0x4670b7){if(_0x4670b7){var _0x203d33=typeof _0x2dde01['offset']===_0x71f3('0x2a')&&typeof _0x2dde01[_0x71f3('0x2b')]==='undefined';var _0x54400c=_0x4670b7['count'];var _0x521def=_0x203d33?0x0:_0x2dde01[_0x71f3('0x2c')];var _0x30b236=_0x203d33?_0x4670b7['count']:_0x2dde01['offset']+_0x2dde01[_0x71f3('0x2b')];var _0x2ec5bf;if(_0x30b236>=_0x54400c){_0x30b236=_0x54400c;_0x2ec5bf=0xc8;}else{_0x2ec5bf=0xce;}_0x23f8a8[_0x71f3('0x29')](_0x2ec5bf);return _0x23f8a8['set'](_0x71f3('0x2d'),_0x521def+'-'+_0x30b236+'/'+_0x54400c)[_0x71f3('0x2e')](_0x4670b7);}return null;};}function patchUpdates(_0x15b049){return function(_0x371d73){try{jsonpatch[_0x71f3('0x2f')](_0x371d73,_0x15b049,!![]);}catch(_0x4f5057){return BPromise[_0x71f3('0x30')](_0x4f5057);}return _0x371d73[_0x71f3('0x31')]();};}function saveUpdates(_0x333408,_0x5697ca){return function(_0x2e81fd){if(_0x2e81fd){return _0x2e81fd[_0x71f3('0x32')](_0x333408)['then'](function(_0x2d51d7){return _0x2d51d7;});}return null;};}function removeEntity(_0x495586,_0x444ed5){return function(_0x115a2d){if(_0x115a2d){return _0x115a2d['destroy']()[_0x71f3('0x33')](function(){var _0x19e95f=_0x115a2d[_0x71f3('0x34')]({'plain':!![]});var _0x55e277=_0x71f3('0x35');return db[_0x71f3('0x36')][_0x71f3('0x37')]({'where':{'type':_0x55e277,'resourceId':_0x19e95f['id']}})[_0x71f3('0x33')](function(){return _0x115a2d;});})[_0x71f3('0x33')](function(){_0x495586['status'](0xcc)[_0x71f3('0x38')]();});}};}function handleEntityNotFound(_0x21b987,_0x3083df){return function(_0x61375e){if(!_0x61375e){_0x21b987[_0x71f3('0x28')](0x194);}return _0x61375e;};}function handleError(_0x4a1d4b,_0x14c5f1){_0x14c5f1=_0x14c5f1||0x1f4;return function(_0x21c3fc){logger[_0x71f3('0x23')](_0x21c3fc[_0x71f3('0x39')]);if(_0x21c3fc[_0x71f3('0x3a')]){delete _0x21c3fc['name'];}_0x4a1d4b['status'](_0x14c5f1)[_0x71f3('0x3b')](_0x21c3fc);};}exports[_0x71f3('0x3c')]=function(_0x329713,_0x5c13fb){var _0x249897={'include':[{'model':db[_0x71f3('0x3d')],'as':'mandatoryDispositionPause'}]},_0x5a4477={},_0x40db03={'count':0x0,'rows':[]};var _0x4f6b7b=_[_0x71f3('0x3e')](db[_0x71f3('0x3f')][_0x71f3('0x40')],function(_0x3fa633){return{'name':_0x3fa633['fieldName'],'type':_0x3fa633[_0x71f3('0x41')][_0x71f3('0x42')]};});_0x5a4477[_0x71f3('0x43')]=_[_0x71f3('0x3e')](_0x4f6b7b,_0x71f3('0x3a'));_0x5a4477['query']=_['keys'](_0x329713[_0x71f3('0x44')]);_0x5a4477[_0x71f3('0x45')]=_[_0x71f3('0x46')](_0x5a4477[_0x71f3('0x43')],_0x5a4477[_0x71f3('0x44')]);_0x249897['attributes']=_[_0x71f3('0x46')](_0x5a4477[_0x71f3('0x43')],qs[_0x71f3('0x47')](_0x329713[_0x71f3('0x44')][_0x71f3('0x47')]));_0x249897['attributes']=_0x249897[_0x71f3('0x48')]['length']?_0x249897['attributes']:_0x5a4477['model'];if(!_0x329713['query']['hasOwnProperty'](_0x71f3('0x49'))){_0x249897[_0x71f3('0x2b')]=qs[_0x71f3('0x2b')](_0x329713[_0x71f3('0x44')][_0x71f3('0x2b')]);_0x249897[_0x71f3('0x2c')]=qs['offset'](_0x329713[_0x71f3('0x44')][_0x71f3('0x2c')]);}_0x249897[_0x71f3('0x4a')]=qs['sort'](_0x329713[_0x71f3('0x44')]['sort']);_0x249897[_0x71f3('0x4b')]=qs[_0x71f3('0x45')](_[_0x71f3('0x4c')](_0x329713['query'],_0x5a4477[_0x71f3('0x45')]),_0x4f6b7b);if(_0x329713[_0x71f3('0x44')][_0x71f3('0x4d')]){_0x249897[_0x71f3('0x4b')]=_[_0x71f3('0x4e')](_0x249897[_0x71f3('0x4b')],{'$or':_['map'](_0x4f6b7b,function(_0x1d769a){if(_0x1d769a[_0x71f3('0x41')]!==_0x71f3('0x4f')){var _0x14992e={};_0x14992e[_0x1d769a['name']]={'$like':'%'+_0x329713['query'][_0x71f3('0x4d')]+'%'};return _0x14992e;}})});}_0x249897=_['merge']({},_0x249897,_0x329713[_0x71f3('0x50')]);var _0x2e38cf={'where':_0x249897['where']};return db[_0x71f3('0x3f')][_0x71f3('0x51')](_0x2e38cf)['then'](function(_0x105cc4){_0x40db03['count']=_0x105cc4;if(_0x329713[_0x71f3('0x44')][_0x71f3('0x52')]){_0x249897[_0x71f3('0x53')]=[{'all':!![]}];}return db[_0x71f3('0x3f')]['findAll'](_0x249897);})[_0x71f3('0x33')](function(_0x3d5f71){_0x40db03[_0x71f3('0x54')]=_0x3d5f71;return _0x40db03;})['then'](respondWithFilteredResult(_0x5c13fb,_0x249897))[_0x71f3('0x27')](handleError(_0x5c13fb,null));};exports['show']=function(_0x152903,_0x34cb81){var _0x2f2680={'raw':![],'where':{'id':_0x152903[_0x71f3('0x55')]['id']},'include':[{'model':db[_0x71f3('0x3d')],'as':'mandatoryDispositionPause'}]},_0x536203={};_0x536203[_0x71f3('0x43')]=_['keys'](db[_0x71f3('0x3f')][_0x71f3('0x40')]);_0x536203[_0x71f3('0x44')]=_['keys'](_0x152903[_0x71f3('0x44')]);_0x536203['filters']=_[_0x71f3('0x46')](_0x536203['model'],_0x536203[_0x71f3('0x44')]);_0x2f2680[_0x71f3('0x48')]=_['intersection'](_0x536203[_0x71f3('0x43')],qs[_0x71f3('0x47')](_0x152903[_0x71f3('0x44')][_0x71f3('0x47')]));_0x2f2680[_0x71f3('0x48')]=_0x2f2680['attributes'][_0x71f3('0x56')]?_0x2f2680[_0x71f3('0x48')]:_0x536203[_0x71f3('0x43')];if(_0x152903[_0x71f3('0x44')]['includeAll']){_0x2f2680['include']=[{'all':!![]}];}_0x2f2680=_[_0x71f3('0x4e')]({},_0x2f2680,_0x152903[_0x71f3('0x50')]);return db[_0x71f3('0x3f')][_0x71f3('0x57')](_0x2f2680)[_0x71f3('0x33')](handleEntityNotFound(_0x34cb81,null))[_0x71f3('0x33')](respondWithResult(_0x34cb81,null))[_0x71f3('0x27')](handleError(_0x34cb81,null));};exports[_0x71f3('0x58')]=function(_0xb81781,_0x1f5583){return db[_0x71f3('0x3f')][_0x71f3('0x58')](_0xb81781[_0x71f3('0x59')],{})[_0x71f3('0x33')](function(_0x3e0741){var _0x319a2b=_0xb81781[_0x71f3('0x5a')][_0x71f3('0x34')]({'plain':!![]});if(!_0x319a2b)throw new Error(_0x71f3('0x5b'));if(_0x319a2b[_0x71f3('0x5c')]===_0x71f3('0x5a')){var _0x5630bd=_0x3e0741['get']({'plain':!![]});var _0x508685=_0x71f3('0x35');return db[_0x71f3('0x5d')][_0x71f3('0x57')]({'where':{'name':_0x508685,'userProfileId':_0x319a2b[_0x71f3('0x5e')]},'raw':!![]})['then'](function(_0x3f9bd9){if(_0x3f9bd9&&_0x3f9bd9[_0x71f3('0x5f')]===0x0){return db[_0x71f3('0x36')][_0x71f3('0x58')]({'name':_0x5630bd[_0x71f3('0x3a')],'resourceId':_0x5630bd['id'],'type':_0x3f9bd9[_0x71f3('0x3a')],'sectionId':_0x3f9bd9['id']},{})[_0x71f3('0x33')](function(){return _0x3e0741;});}else{return _0x3e0741;}})[_0x71f3('0x27')](function(_0x6b6078){logger[_0x71f3('0x23')](_0x71f3('0x60'),_0x6b6078);throw _0x6b6078;});}return _0x3e0741;})[_0x71f3('0x33')](respondWithResult(_0x1f5583,0xc9))['catch'](handleError(_0x1f5583,null));};exports[_0x71f3('0x32')]=function(_0x2c643c,_0x285654){if(_0x2c643c['body']['id']){delete _0x2c643c[_0x71f3('0x59')]['id'];}return db['FaxAccount'][_0x71f3('0x57')]({'where':{'id':_0x2c643c['params']['id']},'include':[{'model':db[_0x71f3('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x71f3('0x33')](handleEntityNotFound(_0x285654,null))[_0x71f3('0x33')](saveUpdates(_0x2c643c[_0x71f3('0x59')],null))[_0x71f3('0x33')](respondWithResult(_0x285654,null))[_0x71f3('0x27')](handleError(_0x285654,null));};exports[_0x71f3('0x37')]=function(_0x13bfe1,_0x169748){return db[_0x71f3('0x3f')]['find']({'where':{'id':_0x13bfe1[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x169748,null))['then'](removeEntity(_0x169748,null))['catch'](handleError(_0x169748,null));};exports[_0x71f3('0x61')]=function(_0x1e88c5,_0x460d4d){return db[_0x71f3('0x3f')][_0x71f3('0x61')]()['then'](respondWithResult(_0x460d4d,null))[_0x71f3('0x27')](handleError(_0x460d4d,null));};exports[_0x71f3('0x62')]=function(_0x2a781a,_0x3b6920,_0xbdf0fc){if(_0x2a781a[_0x71f3('0x59')]['id']){delete _0x2a781a[_0x71f3('0x59')]['id'];}return db['FaxAccount'][_0x71f3('0x57')]({'where':{'id':_0x2a781a[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x3b6920,null))[_0x71f3('0x33')](function(_0xc94da3){if(_0xc94da3){_0x2a781a[_0x71f3('0x59')][_0x71f3('0x63')]=_0xc94da3['id'];return db[_0x71f3('0x64')][_0x71f3('0x58')](_0x2a781a[_0x71f3('0x59')]);}})[_0x71f3('0x33')](respondWithResult(_0x3b6920,null))[_0x71f3('0x27')](handleError(_0x3b6920,null));};exports[_0x71f3('0x65')]=function(_0x11fa4e,_0x5b0a87,_0x5a0414){var _0xbff14e={'raw':![],'where':{}};var _0x2bb0bb={};var _0x47d78e={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x11fa4e[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x5b0a87,null))[_0x71f3('0x33')](function(_0x56b5e0){if(_0x56b5e0){_0x2bb0bb[_0x71f3('0x43')]=_[_0x71f3('0x66')](db['Disposition'][_0x71f3('0x40')]);_0x2bb0bb[_0x71f3('0x44')]=_['keys'](_0x11fa4e[_0x71f3('0x44')]);_0x2bb0bb[_0x71f3('0x45')]=_[_0x71f3('0x46')](_0x2bb0bb['model'],_0x2bb0bb['query']);_0xbff14e[_0x71f3('0x48')]=_[_0x71f3('0x46')](_0x2bb0bb['model'],qs[_0x71f3('0x47')](_0x11fa4e['query']['fields']));_0xbff14e[_0x71f3('0x48')]=_0xbff14e[_0x71f3('0x48')][_0x71f3('0x56')]?_0xbff14e[_0x71f3('0x48')]:_0x2bb0bb[_0x71f3('0x43')];if(!_0x11fa4e['query']['hasOwnProperty'](_0x71f3('0x49'))){_0xbff14e[_0x71f3('0x2b')]=qs[_0x71f3('0x2b')](_0x11fa4e[_0x71f3('0x44')][_0x71f3('0x2b')]);_0xbff14e[_0x71f3('0x2c')]=qs[_0x71f3('0x2c')](_0x11fa4e[_0x71f3('0x44')][_0x71f3('0x2c')]);}_0xbff14e[_0x71f3('0x4a')]=qs[_0x71f3('0x67')](_0x11fa4e[_0x71f3('0x44')][_0x71f3('0x67')]);_0xbff14e[_0x71f3('0x4b')]=qs['filters'](_['pick'](_0x11fa4e[_0x71f3('0x44')],_0x2bb0bb['filters']));_0xbff14e[_0x71f3('0x4b')][_0x71f3('0x63')]=_0x56b5e0['id'];if(_0x11fa4e[_0x71f3('0x44')][_0x71f3('0x4d')]){_0xbff14e[_0x71f3('0x4b')]=_[_0x71f3('0x4e')](_0xbff14e[_0x71f3('0x4b')],{'$or':_[_0x71f3('0x3e')](_0xbff14e[_0x71f3('0x48')],function(_0x5c40e4){var _0x28b16b={};_0x28b16b[_0x5c40e4]={'$like':'%'+_0x11fa4e['query'][_0x71f3('0x4d')]+'%'};return _0x28b16b;})});}_0xbff14e=_[_0x71f3('0x4e')]({},_0xbff14e,_0x11fa4e['options']);return db[_0x71f3('0x64')][_0x71f3('0x51')]({'where':_0xbff14e['where']})['then'](function(_0xf0bc7a){_0x47d78e[_0x71f3('0x51')]=_0xf0bc7a;if(_0x11fa4e[_0x71f3('0x44')][_0x71f3('0x52')]){_0xbff14e['include']=[{'all':!![]}];}return db['Disposition'][_0x71f3('0x68')](_0xbff14e);})['then'](function(_0x409bf8){_0x47d78e[_0x71f3('0x54')]=_0x409bf8;return _0x47d78e;});}})[_0x71f3('0x33')](respondWithFilteredResult(_0x5b0a87,_0xbff14e))[_0x71f3('0x27')](handleError(_0x5b0a87,null));};exports['removeDispositions']=function(_0x4bb108,_0x1d1983,_0x49c118){return db[_0x71f3('0x3f')][_0x71f3('0x57')]({'where':{'id':_0x4bb108[_0x71f3('0x55')]['id']}})['then'](handleEntityNotFound(_0x1d1983,null))[_0x71f3('0x33')](function(_0x2bee76){if(_0x2bee76){return _0x2bee76[_0x71f3('0x69')](_0x4bb108[_0x71f3('0x44')][_0x71f3('0x6a')]);}})['then'](respondWithStatusCode(_0x1d1983,null))[_0x71f3('0x27')](handleError(_0x1d1983,null));};exports['addAnswer']=function(_0x84dfea,_0x41cd95,_0x2e3266){if(_0x84dfea[_0x71f3('0x59')]['id']){delete _0x84dfea[_0x71f3('0x59')]['id'];}return db[_0x71f3('0x3f')][_0x71f3('0x57')]({'where':{'id':_0x84dfea['params']['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x41cd95,null))[_0x71f3('0x33')](function(_0x5f2c5e){if(_0x5f2c5e){_0x84dfea['body'][_0x71f3('0x63')]=_0x5f2c5e['id'];return db[_0x71f3('0x6b')][_0x71f3('0x58')](_0x84dfea[_0x71f3('0x59')]);}})[_0x71f3('0x33')](respondWithResult(_0x41cd95,null))[_0x71f3('0x27')](handleError(_0x41cd95,null));};exports['getAnswers']=function(_0x3b3d43,_0x345ee6,_0x4484f3){var _0x26d096={'raw':![],'where':{}};var _0xc9d204={};var _0x3206ce={'count':0x0,'rows':[]};return db[_0x71f3('0x3f')]['findOne']({'where':{'id':_0x3b3d43[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x345ee6,null))[_0x71f3('0x33')](function(_0x5c335d){if(_0x5c335d){_0xc9d204['model']=_[_0x71f3('0x66')](db['CannedAnswer'][_0x71f3('0x40')]);_0xc9d204[_0x71f3('0x44')]=_['keys'](_0x3b3d43[_0x71f3('0x44')]);_0xc9d204[_0x71f3('0x45')]=_[_0x71f3('0x46')](_0xc9d204[_0x71f3('0x43')],_0xc9d204['query']);_0x26d096[_0x71f3('0x48')]=_['intersection'](_0xc9d204['model'],qs[_0x71f3('0x47')](_0x3b3d43[_0x71f3('0x44')][_0x71f3('0x47')]));_0x26d096[_0x71f3('0x48')]=_0x26d096[_0x71f3('0x48')][_0x71f3('0x56')]?_0x26d096[_0x71f3('0x48')]:_0xc9d204[_0x71f3('0x43')];if(!_0x3b3d43[_0x71f3('0x44')][_0x71f3('0x6c')](_0x71f3('0x49'))){_0x26d096[_0x71f3('0x2b')]=qs[_0x71f3('0x2b')](_0x3b3d43[_0x71f3('0x44')][_0x71f3('0x2b')]);_0x26d096[_0x71f3('0x2c')]=qs[_0x71f3('0x2c')](_0x3b3d43[_0x71f3('0x44')][_0x71f3('0x2c')]);}_0x26d096[_0x71f3('0x4a')]=qs[_0x71f3('0x67')](_0x3b3d43['query']['sort']);_0x26d096[_0x71f3('0x4b')]=qs[_0x71f3('0x45')](_[_0x71f3('0x4c')](_0x3b3d43[_0x71f3('0x44')],_0xc9d204[_0x71f3('0x45')]));_0x26d096[_0x71f3('0x4b')]['FaxAccountId']=_0x5c335d['id'];if(_0x3b3d43[_0x71f3('0x44')][_0x71f3('0x4d')]){_0x26d096[_0x71f3('0x4b')]=_[_0x71f3('0x4e')](_0x26d096[_0x71f3('0x4b')],{'$or':_[_0x71f3('0x3e')](_0x26d096[_0x71f3('0x48')],function(_0x2fa396){var _0x446135={};_0x446135[_0x2fa396]={'$like':'%'+_0x3b3d43[_0x71f3('0x44')][_0x71f3('0x4d')]+'%'};return _0x446135;})});}_0x26d096=_['merge']({},_0x26d096,_0x3b3d43['options']);return db['CannedAnswer']['count']({'where':_0x26d096[_0x71f3('0x4b')]})[_0x71f3('0x33')](function(_0x37c286){_0x3206ce['count']=_0x37c286;if(_0x3b3d43[_0x71f3('0x44')]['includeAll']){_0x26d096['include']=[{'all':!![]}];}return db[_0x71f3('0x6b')][_0x71f3('0x68')](_0x26d096);})[_0x71f3('0x33')](function(_0x51ef3c){_0x3206ce[_0x71f3('0x54')]=_0x51ef3c;return _0x3206ce;});}})['then'](respondWithFilteredResult(_0x345ee6,_0x26d096))['catch'](handleError(_0x345ee6,null));};exports['removeAnswers']=function(_0xf6a2af,_0x5a35e1,_0x400877){return db[_0x71f3('0x3f')]['find']({'where':{'id':_0xf6a2af[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x5a35e1,null))['then'](function(_0x50b277){if(_0x50b277){return _0x50b277['removeAnswers'](_0xf6a2af[_0x71f3('0x44')][_0x71f3('0x6a')]);}})[_0x71f3('0x33')](respondWithStatusCode(_0x5a35e1,null))[_0x71f3('0x27')](handleError(_0x5a35e1,null));};exports[_0x71f3('0x6d')]=function(_0xac526e,_0x2cd59a,_0x3b8f02){return db['FaxInteraction']['find']({'where':{'id':_0xac526e[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x2cd59a,null))[_0x71f3('0x33')](function(_0xb0e990){if(_0xb0e990){return _0xb0e990[_0x71f3('0x6d')](_0xac526e[_0x71f3('0x59')][_0x71f3('0x6a')],_[_0x71f3('0x6e')](_0xac526e[_0x71f3('0x59')],[_0x71f3('0x6a'),'id'])||{});}})[_0x71f3('0x33')](respondWithResult(_0x2cd59a,null))[_0x71f3('0x27')](handleError(_0x2cd59a,null));};exports['getInteractions']=function(_0xf2c7ba,_0x59a83c,_0x548d94){var _0x222fed={'raw':![],'where':{}};var _0x34c367={};var _0x2de1e8={'count':0x0,'rows':[]};return db[_0x71f3('0x3f')][_0x71f3('0x6f')]({'where':{'id':_0xf2c7ba['params']['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x59a83c,null))[_0x71f3('0x33')](function(_0x4d2684){if(_0x4d2684){_0x34c367[_0x71f3('0x43')]=_[_0x71f3('0x66')](db[_0x71f3('0x70')][_0x71f3('0x40')]);_0x34c367['query']=_['keys'](_0xf2c7ba[_0x71f3('0x44')]);_0x34c367[_0x71f3('0x45')]=_['intersection'](_0x34c367['model'],_0x34c367[_0x71f3('0x44')]);_0x222fed[_0x71f3('0x48')]=_[_0x71f3('0x46')](_0x34c367[_0x71f3('0x43')],qs[_0x71f3('0x47')](_0xf2c7ba[_0x71f3('0x44')][_0x71f3('0x47')]));_0x222fed[_0x71f3('0x48')]=_0x222fed[_0x71f3('0x48')][_0x71f3('0x56')]?_0x222fed[_0x71f3('0x48')]:_0x34c367[_0x71f3('0x43')];if(!_0xf2c7ba['query'][_0x71f3('0x6c')]('nolimit')){_0x222fed[_0x71f3('0x2b')]=qs[_0x71f3('0x2b')](_0xf2c7ba[_0x71f3('0x44')][_0x71f3('0x2b')]);_0x222fed[_0x71f3('0x2c')]=qs['offset'](_0xf2c7ba[_0x71f3('0x44')][_0x71f3('0x2c')]);}_0x222fed[_0x71f3('0x4a')]=qs[_0x71f3('0x67')](_0xf2c7ba[_0x71f3('0x44')][_0x71f3('0x67')]);_0x222fed[_0x71f3('0x4b')]=qs[_0x71f3('0x45')](_[_0x71f3('0x4c')](_0xf2c7ba['query'],_0x34c367[_0x71f3('0x45')]));_0x222fed[_0x71f3('0x4b')][_0x71f3('0x63')]=_0x4d2684['id'];if(_0xf2c7ba['query'][_0x71f3('0x4d')]){_0x222fed[_0x71f3('0x4b')]=_['merge'](_0x222fed[_0x71f3('0x4b')],{'$or':_['map'](_0x222fed[_0x71f3('0x48')],function(_0x18dee2){var _0x5bce2d={};_0x5bce2d[_0x18dee2]={'$like':'%'+_0xf2c7ba['query'][_0x71f3('0x4d')]+'%'};return _0x5bce2d;})});}_0x222fed=_[_0x71f3('0x4e')]({},_0x222fed,_0xf2c7ba['options']);return db[_0x71f3('0x70')][_0x71f3('0x51')]({'where':_0x222fed[_0x71f3('0x4b')]})['then'](function(_0x127e26){_0x2de1e8[_0x71f3('0x51')]=_0x127e26;if(_0xf2c7ba[_0x71f3('0x44')][_0x71f3('0x52')]){_0x222fed['include']=[{'model':db[_0x71f3('0x71')],'as':_0x71f3('0x72'),'required':![]},{'model':db[_0x71f3('0x73')],'as':_0x71f3('0x74'),'attributes':['name',_0x71f3('0x75'),_0x71f3('0x76')],'required':![]},{'model':db[_0x71f3('0x77')],'as':_0x71f3('0x78'),'attributes':['id','name',_0x71f3('0x79')],'where':_0xf2c7ba[_0x71f3('0x44')]['tag']?{'id':_0xf2c7ba[_0x71f3('0x44')][_0x71f3('0x7a')]}:undefined,'required':_0xf2c7ba['query'][_0x71f3('0x7a')]?!![]:![]}];}return db[_0x71f3('0x70')][_0x71f3('0x68')](_0x222fed);})[_0x71f3('0x33')](function(_0x2d2abb){_0x2de1e8[_0x71f3('0x54')]=_0x2d2abb;return _0x2de1e8;});}})[_0x71f3('0x33')](respondWithFilteredResult(_0x59a83c,_0x222fed))['catch'](handleError(_0x59a83c,null));};exports[_0x71f3('0x7b')]=function(_0x1095f0,_0xbc680f){var _0x212ee9=_0x1095f0[_0x71f3('0x55')]['id'];var _0x539bb3=_0x1095f0['body'];var _0x3b0e3f=0xc8;var _0x2762d0=null;return db['sequelize'][_0x71f3('0x7c')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0x71f3('0x7d')]},function(_0x5e7416){return db[_0x71f3('0x3f')][_0x71f3('0x6f')]({'where':{'id':_0x212ee9},'transaction':_0x5e7416})[_0x71f3('0x33')](function(_0x8797af){if(_0x8797af){return db['FaxApplication'][_0x71f3('0x37')]({'where':{'FaxAccountId':_0x212ee9},'transaction':_0x5e7416})[_0x71f3('0x33')](function(){var _0x5449fb=_['map'](_0x539bb3,function(_0x3c5997){_0x3c5997['FaxAccountId']=_0x212ee9;return _0x3c5997;});return db[_0x71f3('0x7e')]['bulkCreate'](_0x5449fb,{'transaction':_0x5e7416});});}else{_0x3b0e3f=0x194;_0x2762d0=[];}});})['then'](function(){if(_0x3b0e3f!==0x194){return db[_0x71f3('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x212ee9},'order':'priority'})['then'](function(_0x4e75ea){_0x2762d0=_0x4e75ea;});}})[_0x71f3('0x27')](function(_0x594eca){_0x3b0e3f=0x1f4;logger[_0x71f3('0x23')](_0x594eca['stack']);if(_0x594eca[_0x71f3('0x3a')]){delete _0x594eca[_0x71f3('0x3a')];}_0x2762d0=_0x594eca;})[_0x71f3('0x7f')](function(){if(_0x2762d0===null){_0xbc680f[_0x71f3('0x28')](_0x3b0e3f);}else{if(_0x3b0e3f===0x1f4){_0xbc680f['status'](_0x3b0e3f)['send'](_0x2762d0);}else{_0xbc680f[_0x71f3('0x29')](_0x3b0e3f)[_0x71f3('0x2e')](_0x2762d0);}}});};exports['getApplications']=function(_0x352fb4,_0xd13c10,_0x42e7a5){var _0x5b0d33={};var _0x3ea707={};var _0x2f5edd;var _0x1e5df7;return db[_0x71f3('0x3f')][_0x71f3('0x6f')]({'where':{'id':_0x352fb4['params']['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0xd13c10,null))[_0x71f3('0x33')](function(_0x263fa2){if(_0x263fa2){_0x2f5edd=_0x263fa2;_0x3ea707[_0x71f3('0x43')]=_[_0x71f3('0x66')](db[_0x71f3('0x7e')][_0x71f3('0x40')]);_0x3ea707[_0x71f3('0x44')]=_[_0x71f3('0x66')](_0x352fb4[_0x71f3('0x44')]);_0x3ea707[_0x71f3('0x45')]=_['intersection'](_0x3ea707[_0x71f3('0x43')],_0x3ea707['query']);_0x5b0d33[_0x71f3('0x48')]=_['intersection'](_0x3ea707[_0x71f3('0x43')],qs['fields'](_0x352fb4[_0x71f3('0x44')][_0x71f3('0x47')]));_0x5b0d33[_0x71f3('0x48')]=_0x5b0d33[_0x71f3('0x48')][_0x71f3('0x56')]?_0x5b0d33['attributes']:_0x3ea707[_0x71f3('0x43')];_0x5b0d33[_0x71f3('0x4a')]=qs[_0x71f3('0x67')](_0x352fb4[_0x71f3('0x44')][_0x71f3('0x67')]);_0x5b0d33[_0x71f3('0x4b')]=qs[_0x71f3('0x45')](_['pick'](_0x352fb4['query'],_0x3ea707[_0x71f3('0x45')]));if(_0x352fb4[_0x71f3('0x44')][_0x71f3('0x4d')]){_0x5b0d33[_0x71f3('0x4b')]=_['merge'](_0x5b0d33[_0x71f3('0x4b')],{'$or':_['map'](_0x5b0d33[_0x71f3('0x48')],function(_0x2f053c){var _0x42901e={};_0x42901e[_0x2f053c]={'$like':'%'+_0x352fb4[_0x71f3('0x44')]['filter']+'%'};return _0x42901e;})});}_0x5b0d33=_[_0x71f3('0x4e')]({},_0x5b0d33,_0x352fb4['options']);return _0x2f5edd['getApplications'](_0x5b0d33);}})['then'](function(_0x8649e3){if(_0x8649e3){_0x1e5df7=_0x8649e3[_0x71f3('0x56')];if(!_0x352fb4[_0x71f3('0x44')][_0x71f3('0x6c')]('nolimit')){_0x5b0d33['limit']=qs[_0x71f3('0x2b')](_0x352fb4['query']['limit']);_0x5b0d33[_0x71f3('0x2c')]=qs[_0x71f3('0x2c')](_0x352fb4['query'][_0x71f3('0x2c')]);}return _0x2f5edd[_0x71f3('0x80')](_0x5b0d33);}})['then'](function(_0x2b2843){if(_0x2b2843){return _0x2b2843?{'count':_0x1e5df7,'rows':_0x2b2843}:null;}})['then'](respondWithResult(_0xd13c10,null))[_0x71f3('0x27')](handleError(_0xd13c10,null));};function Extension(_0x2a1f11,_0x440abe,_0x889e53,_0x25060d){this[_0x71f3('0x81')]=_0x71f3('0x82');this[_0x71f3('0x83')]=_0x2a1f11[_0x71f3('0x84')];this[_0x71f3('0x85')]=_0x25060d;this['type']=_0x71f3('0x86');this[_0x71f3('0x87')]=_0x71f3('0x88');this['FaxAccountId']=_0x2a1f11['id'];this[_0x71f3('0x89')]=_0x440abe;this[_0x71f3('0x8a')]=_0x889e53;}function createExtensionsReciveFax(_0x10526b){var _0x36a0ac=0x1;var _0x117aef=[];_0x117aef[_0x71f3('0x8b')](new Extension(_0x10526b,_0x36a0ac,'',_0x71f3('0x8c')));_0x36a0ac+=0x1;_0x117aef[_0x71f3('0x8b')](new Extension(_0x10526b,_0x36a0ac,_0x71f3('0x8d'),_0x71f3('0x8e')));_0x36a0ac+=0x1;for(var _0x1443b2 in _0x10526b){if(_0x10526b['hasOwnProperty'](_0x1443b2)&&(_0x1443b2===_0x71f3('0x8f')||_0x1443b2===_0x71f3('0x84')||_0x1443b2===_0x71f3('0x90')||_0x1443b2===_0x71f3('0x91')||_0x1443b2===_0x71f3('0x92')||_0x1443b2==='maxrate'||_0x1443b2==='minrate'||_0x1443b2==='modem'||_0x1443b2===_0x71f3('0x93'))){_0x117aef[_0x71f3('0x8b')](new Extension(_0x10526b,_0x36a0ac,_0x71f3('0x94')+_0x1443b2+')='+_0x10526b[_0x1443b2],_0x71f3('0x8e')));_0x36a0ac+=0x1;}}_0x117aef['push'](new Extension(_0x10526b,_0x36a0ac,'6','Wait'));_0x36a0ac+=0x1;_0x117aef[_0x71f3('0x8b')](new Extension(_0x10526b,_0x36a0ac,_0x71f3('0x95'),_0x71f3('0x96')));_0x36a0ac=0x0;return _0x117aef;}exports[_0x71f3('0x97')]=function(_0x421bb5,_0x5c845e,_0x4180ca){var _0x3055bf;return db[_0x71f3('0x98')][_0x71f3('0x7c')](function(_0x51a56c){return db['FaxAccount'][_0x71f3('0x58')](_0x421bb5['body'],{'transaction':_0x51a56c})[_0x71f3('0x33')](function(_0x195e3b){_0x3055bf=_0x195e3b[_0x71f3('0x34')]({'plain':!![]});return db['VoiceExtension'][_0x71f3('0x99')](createExtensionsReciveFax(_0x3055bf),{'transaction':_0x51a56c});});})[_0x71f3('0x33')](function(){return _0x3055bf;})[_0x71f3('0x33')](respondWithResult(_0x5c845e,null))[_0x71f3('0x27')](handleError(_0x5c845e,null));};exports['updateAccountApplications']=function(_0x586133,_0x11fcc7,_0x46ac05){var _0x155cd0;return db[_0x71f3('0x98')]['transaction'](function(_0x268769){return db[_0x71f3('0x3f')]['update'](_0x586133[_0x71f3('0x59')],{'where':{'id':_0x586133[_0x71f3('0x59')]['id']},'transaction':_0x268769})[_0x71f3('0x33')](function(_0x4fe877){return db[_0x71f3('0x9a')]['destroy']({'where':{'FaxAccountId':_0x586133['body']['id']},'transaction':_0x268769})[_0x71f3('0x33')](function(_0x51759d){return db[_0x71f3('0x9a')][_0x71f3('0x99')](createExtensionsReciveFax(_[_0x71f3('0x6e')](_0x586133[_0x71f3('0x59')],[_0x71f3('0x9b'),_0x71f3('0x42'),_0x71f3('0x9c'),_0x71f3('0x9d'),_0x71f3('0x9e'),'ListId'])),{'transaction':_0x268769});});});})[_0x71f3('0x33')](function(){return db[_0x71f3('0x3f')][_0x71f3('0x9f')](_0x586133[_0x71f3('0x59')]['id']);})[_0x71f3('0x33')](respondWithResult(_0x11fcc7,null))[_0x71f3('0x27')](handleError(_0x11fcc7,null));};exports[_0x71f3('0xa0')]=function(_0x36fce0,_0x5dbe77,_0xa07b45){var _0x10abac={'raw':!![],'where':{}};var _0x442479={};var _0x50f810={'count':0x0,'rows':[]};return db['FaxAccount'][_0x71f3('0x6f')]({'where':{'id':_0x36fce0[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x5dbe77,null))[_0x71f3('0x33')](function(_0x59ac30){if(_0x59ac30){_0x442479[_0x71f3('0x43')]=_[_0x71f3('0x66')](db[_0x71f3('0xa1')]['rawAttributes']);_0x442479['query']=_['keys'](_0x36fce0[_0x71f3('0x44')]);_0x442479['filters']=_[_0x71f3('0x46')](_0x442479['model'],_0x442479['query']);_0x10abac[_0x71f3('0x48')]=_[_0x71f3('0x46')](_0x442479[_0x71f3('0x43')],qs[_0x71f3('0x47')](_0x36fce0[_0x71f3('0x44')][_0x71f3('0x47')]));_0x10abac[_0x71f3('0x48')]=_0x10abac['attributes'][_0x71f3('0x56')]?_0x10abac['attributes']:_0x442479[_0x71f3('0x43')];if(!_0x36fce0[_0x71f3('0x44')]['hasOwnProperty']('nolimit')){_0x10abac[_0x71f3('0x2b')]=qs[_0x71f3('0x2b')](_0x36fce0['query'][_0x71f3('0x2b')]);_0x10abac[_0x71f3('0x2c')]=qs[_0x71f3('0x2c')](_0x36fce0[_0x71f3('0x44')][_0x71f3('0x2c')]);}_0x10abac[_0x71f3('0x4a')]=qs[_0x71f3('0x67')](_0x36fce0['query']['sort']);_0x10abac[_0x71f3('0x4b')]=qs[_0x71f3('0x45')](_[_0x71f3('0x4c')](_0x36fce0[_0x71f3('0x44')],_0x442479['filters']));_0x10abac[_0x71f3('0x4b')][_0x71f3('0x63')]=_0x59ac30['id'];if(_0x36fce0[_0x71f3('0x44')][_0x71f3('0x4d')]){_0x10abac['where']=_[_0x71f3('0x4e')](_0x10abac[_0x71f3('0x4b')],{'$or':_[_0x71f3('0x3e')](_0x10abac['attributes'],function(_0x3489f4){var _0x4e5e73={};_0x4e5e73[_0x3489f4]={'$like':'%'+_0x36fce0[_0x71f3('0x44')][_0x71f3('0x4d')]+'%'};return _0x4e5e73;})});}if(_0x36fce0[_0x71f3('0x44')][_0x71f3('0xa2')]){var _0x14b756=_0x36fce0[_0x71f3('0x44')]['$gte'][_0x71f3('0xa3')](',');var _0x121262={};_0x121262[_0x14b756[0x0]]={'$gte':moment(_0x14b756[0x1])['format'](_0x71f3('0xa4'))};_0x10abac[_0x71f3('0x4b')]=_[_0x71f3('0x4e')](_0x10abac[_0x71f3('0x4b')],_0x121262);}_0x10abac=_['merge']({},_0x10abac,_0x36fce0[_0x71f3('0x50')]);return db[_0x71f3('0xa1')][_0x71f3('0x51')]({'where':_0x10abac[_0x71f3('0x4b')]})['then'](function(_0x551ee5){_0x50f810[_0x71f3('0x51')]=_0x551ee5;if(_0x36fce0[_0x71f3('0x44')][_0x71f3('0x52')]){_0x10abac[_0x71f3('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0x71f3('0x68')](_0x10abac);})[_0x71f3('0x33')](function(_0x232a4f){_0x50f810[_0x71f3('0x54')]=_0x232a4f;return _0x50f810;});}})[_0x71f3('0x33')](respondWithFilteredResult(_0x5dbe77,_0x10abac))[_0x71f3('0x27')](handleError(_0x5dbe77,null));};exports[_0x71f3('0x3b')]=function(_0x12867b,_0x2c6174,_0x3b87ff){var _0x381920,_0x46a945={},_0x548d42;if(_0x12867b['body']['to']){_0x548d42=_0x12867b['body']['to'][0x0];}return db[_0x71f3('0x3f')]['find']({'where':{'id':_0x12867b[_0x71f3('0x55')]['id']},'include':[{'model':db[_0x71f3('0xa5')],'as':'List','include':[{'model':db[_0x71f3('0x71')],'as':'Contacts','where':{'fax':_0x548d42},'limit':0x1,'order':[[_0x71f3('0x9d'),_0x71f3('0xa6')]]}]}]})['then'](handleEntityNotFound(_0x2c6174,null))['then'](function(_0x4717c1){_0x381920=_0x4717c1;if(_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')]&&_0x12867b[_0x71f3('0x59')]['attachments'][_0x71f3('0x56')]){for(var _0x2b7c1c=0x0;_0x2b7c1c<_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][_0x71f3('0x56')];_0x2b7c1c+=0x1){_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][_0x2b7c1c]={'filename':_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][_0x2b7c1c][_0x71f3('0x3a')],'id':_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][_0x2b7c1c]['id'],'path':path['join'](config[_0x71f3('0xa8')],_0x71f3('0xa9'),_0x12867b['body'][_0x71f3('0xa7')][_0x2b7c1c][_0x71f3('0xaa')])};}}return respondWithRpcPromise(_0x71f3('0xab'),_0x71f3('0xab'),{'FaxAccountId':_[_0x71f3('0xac')](_0x12867b[_0x71f3('0x55')]['id'])?undefined:_0x12867b[_0x71f3('0x55')]['id'],'path':_[_0x71f3('0xac')](_0x12867b['body']['attachments'][0x0][_0x71f3('0x8')])?undefined:_0x12867b['body'][_0x71f3('0xa7')][0x0][_0x71f3('0x8')],'fax':_[_0x71f3('0xac')](_0x12867b[_0x71f3('0x59')]['to'][0x0])?undefined:_0x12867b[_0x71f3('0x59')]['to'][0x0]},client9002);})[_0x71f3('0x33')](function(){if(_0x381920){if(_[_0x71f3('0xac')](_0x12867b['body']['from'])){_0x12867b[_0x71f3('0x59')][_0x71f3('0xad')]=util[_0x71f3('0xae')](_0x71f3('0xaf'),_0x381920['name'],_0x381920[_0x71f3('0xb0')]);}if(_0x381920[_0x71f3('0xb1')]){if(_0x381920[_0x71f3('0xb1')][_0x71f3('0xb2')][_0x71f3('0x56')]){return _0x381920[_0x71f3('0xb1')][_0x71f3('0xb2')][0x0];}else{return db[_0x71f3('0x71')]['create'](_['defaults'](_0x12867b['body'],{'firstName':_0x12867b[_0x71f3('0x59')]['to'][0x0],'phone':_0x12867b[_0x71f3('0x59')]['to'][0x0],'fax':_0x12867b[_0x71f3('0x59')]['to'][0x0],'ListId':_0x381920[_0x71f3('0xb3')]}));}}else{throw new Error(_0x71f3('0xb4'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x71f3('0x33')](function(_0x56fc58){if(_0x56fc58){return db[_0x71f3('0x70')]['find']({'where':{'ContactId':_0x56fc58['id'],'closed':![],'FaxAccountId':_0x381920['id']}})['then'](function(_0x35780e){if(_0x35780e){return[_0x35780e,![]];}return db[_0x71f3('0x70')]['create']({'UserId':_0x12867b['user']['id'],'ContactId':_0x56fc58['id'],'FaxAccountId':_0x381920['id'],'fax':_0x12867b[_0x71f3('0x59')]['to'][0x0],'firstMsgDirection':_0x71f3('0xb5'),'Messages':[_[_0x71f3('0x4e')](_0x12867b[_0x71f3('0x59')],{'read':![],'body':_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][0x0][_0x71f3('0xb6')],'FaxAccountId':_0x381920['id'],'UserId':_0x12867b[_0x71f3('0x5a')]['id'],'ContactId':_0x56fc58['id'],'AttachmentId':_0x12867b['body'][_0x71f3('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x71f3('0xa1')],'as':_0x71f3('0xb7')}]})[_0x71f3('0x33')](function(_0x25a337){return[_0x25a337,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x71f3('0xb8')](function(_0xbfb321,_0xae79e4){if(_0xae79e4){return _0xbfb321;}return db[_0x71f3('0xa1')]['create']({'direction':_0x71f3('0xb5'),'read':![],'body':_0x12867b['body'][_0x71f3('0xa7')][0x0][_0x71f3('0xb6')],'FaxAccountId':_0x381920['id'],'FaxInteractionId':_0xbfb321['id'],'UserId':_0x12867b[_0x71f3('0x5a')]['id'],'ContactId':_0xbfb321[_0x71f3('0xb9')],'AttachmentId':_0x12867b['body'][_0x71f3('0xa7')][0x0]['id']})[_0x71f3('0x33')](function(_0x1e43e4){_0xbfb321[_0x71f3('0xba')][_0x71f3('0xb7')]=[];_0xbfb321[_0x71f3('0xba')][_0x71f3('0xb7')]['push'](_0x1e43e4[_0x71f3('0xba')]);return _0xbfb321;});})[_0x71f3('0x33')](function(_0x8346f0){respondWithRpcPromise(_0x71f3('0xbb'),_0x71f3('0xbb'),{'FaxAccountId':_[_0x71f3('0xac')](_0x12867b[_0x71f3('0x55')]['id'])?undefined:_0x12867b[_0x71f3('0x55')]['id'],'path':_[_0x71f3('0xac')](_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][0x0][_0x71f3('0x8')])?undefined:_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][0x0][_0x71f3('0x8')],'fax':_[_0x71f3('0xac')](_0x12867b[_0x71f3('0x59')]['to'][0x0])?undefined:_0x12867b[_0x71f3('0x59')]['to'][0x0],'AttachmentId':_0x12867b[_0x71f3('0x59')][_0x71f3('0xa7')][0x0]['id']},client9002)['then'](function(_0x35630f){logger[_0x71f3('0x1d')](_0x71f3('0xbc'),_0x35630f);})['catch'](function(_0x2c93ef){logger[_0x71f3('0x1d')](_0x71f3('0xbc'),_0x2c93ef);});return _0x8346f0;})[_0x71f3('0x33')](respondWithResult(_0x2c6174,null))[_0x71f3('0x27')](handleError(_0x2c6174,null));};exports[_0x71f3('0xbd')]=function(_0x32fd9a,_0x4cc1ee,_0x551707){return db[_0x71f3('0x3f')][_0x71f3('0x57')]({'where':{'id':_0x32fd9a[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x4cc1ee,null))[_0x71f3('0x33')](function(_0xeb9252){if(_0xeb9252){return _0xeb9252[_0x71f3('0xbd')](_0x32fd9a[_0x71f3('0x59')]['ids'],_[_0x71f3('0x6e')](_0x32fd9a[_0x71f3('0x59')],[_0x71f3('0x6a'),'id'])||{})[_0x71f3('0xb8')](function(_0x3b12fb){for(var _0x2ff944=0x0;_0x2ff944<_0x32fd9a[_0x71f3('0x59')][_0x71f3('0x6a')][_0x71f3('0x56')];_0x2ff944+=0x1){socket[_0x71f3('0xbe')]('userFaxAccount:save',{'UserId':Number(_0x32fd9a[_0x71f3('0x59')][_0x71f3('0x6a')][_0x2ff944]),'FaxAccountId':Number(_0x32fd9a[_0x71f3('0x55')]['id'])});}return _0x3b12fb;});}})['then'](respondWithResult(_0x4cc1ee,null))[_0x71f3('0x27')](handleError(_0x4cc1ee,null));};exports[_0x71f3('0xbf')]=function(_0x5883a6,_0x1623a5,_0xd74c17){return db[_0x71f3('0x3f')][_0x71f3('0x57')]({'where':{'id':_0x5883a6['params']['id']}})['then'](handleEntityNotFound(_0x1623a5,null))[_0x71f3('0x33')](function(_0x55ed0d){if(_0x55ed0d){return _0x55ed0d['removeAgents'](_0x5883a6[_0x71f3('0x44')][_0x71f3('0x6a')])['then'](function(){if(_[_0x71f3('0xc0')](_0x5883a6[_0x71f3('0x44')][_0x71f3('0x6a')])){for(var _0x4920f1=0x0;_0x4920f1<_0x5883a6[_0x71f3('0x44')][_0x71f3('0x6a')][_0x71f3('0x56')];_0x4920f1+=0x1){socket[_0x71f3('0xbe')](_0x71f3('0xc1'),{'UserId':Number(_0x5883a6[_0x71f3('0x44')]['ids'][_0x4920f1]),'FaxAccountId':Number(_0x5883a6[_0x71f3('0x55')]['id'])});}}else{socket[_0x71f3('0xbe')](_0x71f3('0xc1'),{'UserId':Number(_0x5883a6[_0x71f3('0x44')][_0x71f3('0x6a')]),'FaxAccountId':Number(_0x5883a6[_0x71f3('0x55')]['id'])});}});}})[_0x71f3('0x33')](respondWithStatusCode(_0x1623a5,null))[_0x71f3('0x27')](handleError(_0x1623a5,null));};exports['getAgents']=function(_0x489de5,_0x29b8cc,_0x2799cb){var _0x157a6c={};var _0x57b641={};var _0x19899a;var _0x5c4cf5;return db[_0x71f3('0x3f')][_0x71f3('0x6f')]({'where':{'id':_0x489de5[_0x71f3('0x55')]['id']}})[_0x71f3('0x33')](handleEntityNotFound(_0x29b8cc,null))[_0x71f3('0x33')](function(_0x6e9433){if(_0x6e9433){_0x19899a=_0x6e9433;_0x57b641[_0x71f3('0x43')]=_[_0x71f3('0x66')](db[_0x71f3('0x73')][_0x71f3('0x40')]);_0x57b641[_0x71f3('0x44')]=_[_0x71f3('0x66')](_0x489de5[_0x71f3('0x44')]);_0x57b641[_0x71f3('0x45')]=_[_0x71f3('0x46')](_0x57b641[_0x71f3('0x43')],_0x57b641[_0x71f3('0x44')]);_0x157a6c[_0x71f3('0x48')]=_['intersection'](_0x57b641[_0x71f3('0x43')],qs['fields'](_0x489de5[_0x71f3('0x44')][_0x71f3('0x47')]));_0x157a6c[_0x71f3('0x48')]=_0x157a6c[_0x71f3('0x48')][_0x71f3('0x56')]?_0x157a6c['attributes']:_0x57b641['model'];_0x157a6c[_0x71f3('0x4a')]=qs['sort'](_0x489de5[_0x71f3('0x44')][_0x71f3('0x67')]);_0x157a6c['where']=qs[_0x71f3('0x45')](_[_0x71f3('0x4c')](_0x489de5[_0x71f3('0x44')],_0x57b641[_0x71f3('0x45')]));if(_0x489de5['query'][_0x71f3('0x4d')]){_0x157a6c[_0x71f3('0x4b')]=_[_0x71f3('0x4e')](_0x157a6c[_0x71f3('0x4b')],{'$or':_['map'](_0x157a6c['attributes'],function(_0x26cbbc){var _0x437ec6={};_0x437ec6[_0x26cbbc]={'$like':'%'+_0x489de5[_0x71f3('0x44')]['filter']+'%'};return _0x437ec6;})});}_0x157a6c=_[_0x71f3('0x4e')]({},_0x157a6c,_0x489de5[_0x71f3('0x50')]);return _0x19899a[_0x71f3('0xc2')](_0x157a6c);}})['then'](function(_0x4500bc){if(_0x4500bc){_0x5c4cf5=_0x4500bc['length'];if(!_0x489de5[_0x71f3('0x44')]['hasOwnProperty']('nolimit')){_0x157a6c[_0x71f3('0x2b')]=qs[_0x71f3('0x2b')](_0x489de5[_0x71f3('0x44')]['limit']);_0x157a6c['offset']=qs[_0x71f3('0x2c')](_0x489de5[_0x71f3('0x44')][_0x71f3('0x2c')]);}return _0x19899a[_0x71f3('0xc2')](_0x157a6c);}})['then'](function(_0x1630f3){if(_0x1630f3){return _0x1630f3?{'count':_0x5c4cf5,'rows':_0x1630f3}:null;}})[_0x71f3('0x33')](respondWithResult(_0x29b8cc,null))['catch'](handleError(_0x29b8cc,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b86bf36..da001a3 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 _0xe7ed=['remove','emit','hasOwnProperty','hook','exports','FaxAccount','setMaxListeners','save','update'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xe7ed,0x15b));var _0xde7e=function(_0x360b23,_0x5c6352){_0x360b23=_0x360b23-0x0;var _0x3b8fda=_0xe7ed[_0x360b23];return _0x3b8fda;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0xde7e('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xde7e('0x1')](0x0);var events={'afterCreate':_0xde7e('0x2'),'afterUpdate':_0xde7e('0x3'),'afterDestroy':_0xde7e('0x4')};function emitEvent(_0x11b5ee){return function(_0x25db68,_0xe69177,_0x1e61b5){FaxAccountEvents[_0xde7e('0x5')](_0x11b5ee+':'+_0x25db68['id'],_0x25db68);FaxAccountEvents[_0xde7e('0x5')](_0x11b5ee,_0x25db68);_0x1e61b5(null);};}for(var e in events){if(events[_0xde7e('0x6')](e)){var event=events[e];FaxAccount[_0xde7e('0x7')](e,emitEvent(event));}}module[_0xde7e('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xb7e7=['exports','events','../../mysqldb','emit','hasOwnProperty','hook'];(function(_0x3187ae,_0x2f035e){var _0x2daf10=function(_0x3e230a){while(--_0x3e230a){_0x3187ae['push'](_0x3187ae['shift']());}};_0x2daf10(++_0x2f035e);}(_0xb7e7,0x109));var _0x7b7e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xb7e7[_0x376b45];return _0x2341b3;};'use strict';var EventEmitter=require(_0x7b7e('0x0'));var FaxAccount=require(_0x7b7e('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31267a){return function(_0x1088cc,_0x14ee26,_0x72338a){FaxAccountEvents[_0x7b7e('0x2')](_0x31267a+':'+_0x1088cc['id'],_0x1088cc);FaxAccountEvents[_0x7b7e('0x2')](_0x31267a,_0x1088cc);_0x72338a(null);};}for(var e in events){if(events[_0x7b7e('0x3')](e)){var event=events[e];FaxAccount[_0x7b7e('0x4')](e,emitEvent(event));}}module[_0x7b7e('0x5')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 61a1efb..26d35ae 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 _0x306a=['lodash','util','api','moment','bluebird','path','rimraf','exports','define','FaxAccount','fax_accounts'];(function(_0xa9750,_0x1472fe){var _0x587bd0=function(_0x419267){while(--_0x419267){_0xa9750['push'](_0xa9750['shift']());}};_0x587bd0(++_0x1472fe);}(_0x306a,0x1c3));var _0xa306=function(_0x2f6d16,_0x516c0c){_0x2f6d16=_0x2f6d16-0x0;var _0xf706a=_0x306a[_0x2f6d16];return _0xf706a;};'use strict';var _=require(_0xa306('0x0'));var util=require(_0xa306('0x1'));var logger=require('../../config/logger')(_0xa306('0x2'));var moment=require(_0xa306('0x3'));var BPromise=require(_0xa306('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa306('0x5'));var rimraf=require(_0xa306('0x6'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0xa306('0x7')]=function(_0x36b8d1,_0xd88763){return _0x36b8d1[_0xa306('0x8')](_0xa306('0x9'),attributes,{'tableName':_0xa306('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x69f1=['../../config/environment','./faxAccount.attributes','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x2f94e2,_0xd9ae9){var _0x5f3670=function(_0x45e285){while(--_0x45e285){_0x2f94e2['push'](_0x2f94e2['shift']());}};_0x5f3670(++_0xd9ae9);}(_0x69f1,0x1a7));var _0x169f=function(_0x172ff1,_0x5624f1){_0x172ff1=_0x172ff1-0x0;var _0x3d6e9c=_0x69f1[_0x172ff1];return _0x3d6e9c;};'use strict';var _=require(_0x169f('0x0'));var util=require(_0x169f('0x1'));var logger=require(_0x169f('0x2'))(_0x169f('0x3'));var moment=require(_0x169f('0x4'));var BPromise=require(_0x169f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x169f('0x6'));var rimraf=require('rimraf');var config=require(_0x169f('0x7'));var attributes=require(_0x169f('0x8'));module['exports']=function(_0x70d448,_0x34b2a5){return _0x70d448['define']('FaxAccount',attributes,{'tableName':_0x169f('0x9'),'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 51020eb..3519f13 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 _0xf26d=['push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','queueId','FaxQueue','waitForTheAssignedQueue','Start','startRouting','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','Sequelize','ValidationError','difference','keys','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','get','applications','Applications','list','orderBy','asc','account','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose'];(function(_0x3029f6,_0x2cedd6){var _0xbf8840=function(_0x37466a){while(--_0x37466a){_0x3029f6['push'](_0x3029f6['shift']());}};_0xbf8840(++_0x2cedd6);}(_0xf26d,0x131));var _0xdf26=function(_0x797e40,_0x49a4d5){_0x797e40=_0x797e40-0x0;var _0x3c5bfc=_0xf26d[_0x797e40];return _0x3c5bfc;};'use strict';var _=require(_0xdf26('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdf26('0x1'));var rs=require(_0xdf26('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf26('0x3'))['db'];var utils=require(_0xdf26('0x4'));var logger=require(_0xdf26('0x5'))('rpc');var config=require(_0xdf26('0x6'));var jayson=require(_0xdf26('0x7'));var client=jayson[_0xdf26('0x8')]['http']({'port':0x232c});config['redis']=_[_0xdf26('0x9')](config[_0xdf26('0xa')],{'host':_0xdf26('0xb'),'port':0x18eb});var socket=require(_0xdf26('0xc'))(new Redis(config[_0xdf26('0xa')]));require(_0xdf26('0xd'))[_0xdf26('0xe')](socket);function respondWithRpcPromise(_0x19e0e4,_0xd2e63f,_0x1cb572){return new BPromise(function(_0x2301d0,_0x7473fa){return client[_0xdf26('0xf')](_0x19e0e4,_0x1cb572)[_0xdf26('0x10')](function(_0x257e6f){logger[_0xdf26('0x11')](_0xdf26('0x12'),_0xd2e63f,_0xdf26('0x13'));logger[_0xdf26('0x14')](_0xdf26('0x15'),_0xd2e63f,_0xdf26('0x13'),JSON['stringify'](_0x257e6f));if(_0x257e6f[_0xdf26('0x16')]){if(_0x257e6f[_0xdf26('0x16')][_0xdf26('0x17')]===0x1f4){logger[_0xdf26('0x16')]('FaxAccount,\x20%s,\x20%s',_0xd2e63f,_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);return _0x7473fa(_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);}logger['error'](_0xdf26('0x12'),_0xd2e63f,_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);return _0x2301d0(_0x257e6f[_0xdf26('0x16')][_0xdf26('0x18')]);}else{logger[_0xdf26('0x11')](_0xdf26('0x12'),_0xd2e63f,_0xdf26('0x13'));_0x2301d0(_0x257e6f[_0xdf26('0x19')]['message']);}})[_0xdf26('0x1a')](function(_0x3dafa2){logger['error'](_0xdf26('0x12'),_0xd2e63f,_0x3dafa2);_0x7473fa(_0x3dafa2);});});}exports[_0xdf26('0x1b')]=function(_0x1b5fd8){var _0x3075fc=this;return new Promise(function(_0x2b4f2a,_0x27abe3){return db[_0xdf26('0x1c')][_0xdf26('0x1d')]({'raw':_0x1b5fd8['options']?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x1f')]===undefined?!![]:![]:!![],'where':_0x1b5fd8['options']?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x20')]||null:null,'attributes':_0x1b5fd8[_0xdf26('0x1e')]?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x21')]||null:null,'limit':_0x1b5fd8[_0xdf26('0x1e')]?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x22')]||null:null,'include':_0x1b5fd8[_0xdf26('0x1e')]?_0x1b5fd8[_0xdf26('0x1e')][_0xdf26('0x23')]?_[_0xdf26('0x24')](_0x1b5fd8[_0xdf26('0x1e')]['include'],function(_0x1efb8b){return{'model':db[_0x1efb8b['model']],'as':_0x1efb8b['as'],'attributes':_0x1efb8b[_0xdf26('0x21')],'include':_0x1efb8b[_0xdf26('0x23')]?_['map'](_0x1efb8b[_0xdf26('0x23')],function(_0x3a2107){return{'model':db[_0x3a2107[_0xdf26('0x25')]],'as':_0x3a2107['as'],'attributes':_0x3a2107[_0xdf26('0x21')],'include':_0x3a2107[_0xdf26('0x23')]?_[_0xdf26('0x24')](_0x3a2107[_0xdf26('0x23')],function(_0x465848){return{'model':db[_0x465848[_0xdf26('0x25')]],'as':_0x465848['as'],'attributes':_0x465848['attributes']};}):[]};}):[]};}):[]:[]})[_0xdf26('0x10')](function(_0xeee33){logger['info']('GetFaxAccount',_0x1b5fd8);logger[_0xdf26('0x14')](_0xdf26('0x1b'),_0x1b5fd8,JSON[_0xdf26('0x26')](_0xeee33));_0x2b4f2a(_0xeee33);})[_0xdf26('0x1a')](function(_0x33a49e){logger[_0xdf26('0x16')]('GetFaxAccount',_0x33a49e['message'],_0x1b5fd8);_0x27abe3(_0x3075fc[_0xdf26('0x16')](0x1f4,_0x33a49e[_0xdf26('0x18')]));});});};exports[_0xdf26('0x27')]=function(_0x1024e3,_0x3debf1,_0x457b3c){var _0x4be833=this;return new Promise(function(_0x49dccc,_0x274640){var _0x241897={'body':_0x1024e3[_0xdf26('0x28')],'channel':_0xdf26('0x29')};var _0x5819a2=[];var _0x2cbadb=[];var _0x17405b={};return db['CmContact']['describe']()[_0xdf26('0x10')](function(_0x371a6a){if(!_0x371a6a){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))]('no\x20available\x20attributes');}_0x5819a2=_[_0xdf26('0x2c')](_[_0xdf26('0x2d')](_0x371a6a),[_0xdf26('0x2e'),'updatedAt']);_0x2cbadb=_[_0xdf26('0x2c')](_[_0xdf26('0x2d')](_0x371a6a),[_0xdf26('0x2e'),'updatedAt',_0xdf26('0x2f'),_0xdf26('0x30')]);if(_0x1024e3[_0xdf26('0x28')]['id']){delete _0x1024e3[_0xdf26('0x28')]['id'];}if(_['isNil'](_0x1024e3[_0xdf26('0x28')][_0xdf26('0x31')])){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))](_0xdf26('0x32'));}if(_[_0xdf26('0x33')](_0x1024e3['body'][_0xdf26('0x28')])||_0x1024e3[_0xdf26('0x28')][_0xdf26('0x28')]===''){throw new db[(_0xdf26('0x2a'))]['ValidationError'](_0xdf26('0x34'));}if(_['isNil'](_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')])){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cbadb);}if(!_['includes'](_0x2cbadb,_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')])){throw new db[(_0xdf26('0x2a'))][(_0xdf26('0x2b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cbadb);}_0x17405b[_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')]]=_0x1024e3[_0xdf26('0x28')][_0xdf26('0x31')];})[_0xdf26('0x10')](function(){return db[_0xdf26('0x1c')][_0xdf26('0x36')]({'where':{'id':_0x1024e3['account']['id']},'include':[{'model':db[_0xdf26('0x37')],'as':_0xdf26('0x38'),'include':[{'model':db[_0xdf26('0x39')],'as':_0xdf26('0x3a'),'where':_0x17405b,'limit':0x1,'order':[['updatedAt',_0xdf26('0x3b')]]}]},{'model':db[_0xdf26('0x3c')],'as':'Applications'}]});})[_0xdf26('0x10')](function(_0x46d58b){if(_0x46d58b&&_0x46d58b[_0xdf26('0x38')]){var _0x43c5ce=_0x46d58b[_0xdf26('0x3d')]({'plain':!![]});_0x241897['account']=_0x43c5ce;_0x241897[_0xdf26('0x3e')]=_0x43c5ce[_0xdf26('0x3f')];_0x241897[_0xdf26('0x40')]=_0x43c5ce[_0xdf26('0x38')];_0x241897[_0xdf26('0x3e')]=_[_0xdf26('0x41')](_0x241897[_0xdf26('0x3e')],['priority'],[_0xdf26('0x42')]);if(_0x241897['account'][_0xdf26('0x3f')]){delete _0x241897[_0xdf26('0x43')][_0xdf26('0x3f')];}if(_0x241897[_0xdf26('0x43')]['List']&&_0x241897['account'][_0xdf26('0x38')]['Contacts'][_0xdf26('0x44')]){return _0x241897[_0xdf26('0x43')]['List'][_0xdf26('0x3a')][0x0];}var _0xdfed45=_[_0xdf26('0x9')](_0x1024e3[_0xdf26('0x28')],{'firstName':_0x1024e3[_0xdf26('0x28')]['from'],'ListId':_0x43c5ce[_0xdf26('0x30')]});_0xdfed45[_0x1024e3[_0xdf26('0x28')][_0xdf26('0x35')]]=_0x1024e3['body']['from'];return db['CmContact'][_0xdf26('0x45')](_0xdfed45,{'fields':_0x5819a2,'raw':!![]});}})[_0xdf26('0x10')](function(_0x41243d){_0x241897[_0xdf26('0x46')]=_0x41243d;if(_0x41243d){var _0x4790b5={'ContactId':_0x41243d['id'],'FaxAccountId':_0x1024e3[_0xdf26('0x43')]['id'],'fax':_0x41243d[_0xdf26('0x29')]};return db[_0xdf26('0x47')][_0xdf26('0x36')]({'where':{'ContactId':_0x41243d['id'],'closed':![],'FaxAccountId':_0x1024e3[_0xdf26('0x43')]['id']}})[_0xdf26('0x10')](function(_0x402045){if(_0x402045){return[_0x402045,![]];}return db['FaxInteraction'][_0xdf26('0x45')](_0x4790b5)[_0xdf26('0x10')](function(_0x363b8b){return[_0x363b8b,!![]];});});}else{throw new Error(_0xdf26('0x48'));}})[_0xdf26('0x49')](function(_0x426beb,_0x13cf6e){var _0x42d1d0=_0x426beb[_0xdf26('0x3d')]({'plain':!![]});if(_0x13cf6e){if(_0x241897['account'][_0xdf26('0x4a')]){_0x241897[_0xdf26('0x3e')][_0xdf26('0x4b')]({'id':0x0,'priority':_0x241897[_0xdf26('0x3e')][_0xdf26('0x44')]+0x1,'app':_0xdf26('0x4c'),'appdata':_0xdf26('0x4d'),'interval':_0xdf26('0x4e')});}_0x42d1d0[_0xdf26('0x4f')]=!![];}else{_0x42d1d0['created']=![];}_0x241897[_0xdf26('0x50')]=_0x42d1d0;return db[_0xdf26('0x51')][_0xdf26('0x45')]({'body':_0x1024e3[_0xdf26('0x28')][_0xdf26('0x28')],'FaxAccountId':_0x1024e3[_0xdf26('0x43')]['id'],'FaxInteractionId':_0x426beb['id'],'direction':'in','ContactId':_0x426beb[_0xdf26('0x52')],'AttachmentId':_0x1024e3['body'][_0xdf26('0x53')]});})[_0xdf26('0x10')](function(_0x143ba0){_0x241897[_0xdf26('0x18')]=_0x143ba0;if(!_0x241897[_0xdf26('0x50')][_0xdf26('0x54')])return;return db[_0xdf26('0x55')][_0xdf26('0x36')]({'attributes':['id','name'],'where':{'id':_0x241897[_0xdf26('0x50')][_0xdf26('0x54')]}});})[_0xdf26('0x10')](function(_0x72b94e){if(_0x72b94e){_0x241897[_0xdf26('0x3e')][_0xdf26('0x56')]({'id':0x0,'priority':0x0,'app':_0xdf26('0x57'),'appdata':_0x72b94e[_0xdf26('0x58')]+','+(_0x241897[_0xdf26('0x43')][_0xdf26('0x59')]||0xa),'interval':_0xdf26('0x4e')});}if(!_0x241897[_0xdf26('0x50')][_0xdf26('0x5a')])return;return db[_0xdf26('0x5b')][_0xdf26('0x36')]({'attributes':['id',_0xdf26('0x58')],'where':{'id':_0x241897['interaction'][_0xdf26('0x5a')]}});})[_0xdf26('0x10')](function(_0x20275f){if(_0x20275f){_0x241897[_0xdf26('0x3e')][_0xdf26('0x56')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x20275f[_0xdf26('0x58')]+','+(_0x241897[_0xdf26('0x43')][_0xdf26('0x5c')]||0x12c),'interval':_0xdf26('0x4e')});}return respondWithRpcPromise(_0xdf26('0x5d'),_0xdf26('0x5e'),_0x241897);})[_0xdf26('0x10')](function(_0x330ebf){_0x49dccc(_0x330ebf);})[_0xdf26('0x1a')](function(_0x401635){_0x274640(_0x4be833[_0xdf26('0x16')](0x1f4,_0x401635['message']));});});}; \ No newline at end of file +var _0x95a6=['find','CmList','List','Contacts','DESC','FaxApplication','get','account','applications','Applications','list','orderBy','priority','asc','length','defaults','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','queueId','FaxQueue','queue','startRouting','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','socket.io-emitter','redis','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','limit','map','include','model','attributes','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey'];(function(_0x27b2b1,_0x23466d){var _0x44640e=function(_0x4e9adc){while(--_0x4e9adc){_0x27b2b1['push'](_0x27b2b1['shift']());}};_0x44640e(++_0x23466d);}(_0x95a6,0x13c));var _0x695a=function(_0x5d0a9a,_0x23792e){_0x5d0a9a=_0x5d0a9a-0x0;var _0x340ada=_0x95a6[_0x5d0a9a];return _0x340ada;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var moment=require('moment');var BPromise=require(_0x695a('0x2'));var rs=require(_0x695a('0x3'));var fs=require('fs');var Redis=require(_0x695a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x695a('0x5'))(_0x695a('0x6'));var config=require('../../config/environment');var jayson=require(_0x695a('0x7'));var client=jayson['client'][_0x695a('0x8')]({'port':0x232c});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x695a('0x9'))(new Redis(config[_0x695a('0xa')]));require(_0x695a('0xb'))[_0x695a('0xc')](socket);function respondWithRpcPromise(_0xbb81a5,_0x2e47a5,_0x5e09d1){return new BPromise(function(_0x4fca11,_0x15c113){return client[_0x695a('0xd')](_0xbb81a5,_0x5e09d1)[_0x695a('0xe')](function(_0x2b9f3f){logger[_0x695a('0xf')](_0x695a('0x10'),_0x2e47a5,_0x695a('0x11'));logger[_0x695a('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2e47a5,'request\x20sent',JSON[_0x695a('0x13')](_0x2b9f3f));if(_0x2b9f3f[_0x695a('0x14')]){if(_0x2b9f3f[_0x695a('0x14')][_0x695a('0x15')]===0x1f4){logger[_0x695a('0x14')](_0x695a('0x10'),_0x2e47a5,_0x2b9f3f[_0x695a('0x14')][_0x695a('0x16')]);return _0x15c113(_0x2b9f3f[_0x695a('0x14')]['message']);}logger['error'](_0x695a('0x10'),_0x2e47a5,_0x2b9f3f[_0x695a('0x14')][_0x695a('0x16')]);return _0x4fca11(_0x2b9f3f[_0x695a('0x14')]['message']);}else{logger[_0x695a('0xf')]('FaxAccount,\x20%s,\x20%s',_0x2e47a5,_0x695a('0x11'));_0x4fca11(_0x2b9f3f[_0x695a('0x17')]['message']);}})[_0x695a('0x18')](function(_0x2af595){logger[_0x695a('0x14')]('FaxAccount,\x20%s,\x20%s',_0x2e47a5,_0x2af595);_0x15c113(_0x2af595);});});}exports[_0x695a('0x19')]=function(_0x346828){var _0xd26442=this;return new Promise(function(_0x1b6435,_0x1d0efc){return db[_0x695a('0x1a')][_0x695a('0x1b')]({'raw':_0x346828[_0x695a('0x1c')]?_0x346828[_0x695a('0x1c')][_0x695a('0x1d')]===undefined?!![]:![]:!![],'where':_0x346828[_0x695a('0x1c')]?_0x346828[_0x695a('0x1c')]['where']||null:null,'attributes':_0x346828[_0x695a('0x1c')]?_0x346828[_0x695a('0x1c')]['attributes']||null:null,'limit':_0x346828[_0x695a('0x1c')]?_0x346828[_0x695a('0x1c')][_0x695a('0x1e')]||null:null,'include':_0x346828[_0x695a('0x1c')]?_0x346828[_0x695a('0x1c')]['include']?_[_0x695a('0x1f')](_0x346828[_0x695a('0x1c')][_0x695a('0x20')],function(_0x2ce238){return{'model':db[_0x2ce238[_0x695a('0x21')]],'as':_0x2ce238['as'],'attributes':_0x2ce238[_0x695a('0x22')],'include':_0x2ce238[_0x695a('0x20')]?_[_0x695a('0x1f')](_0x2ce238['include'],function(_0x3508dc){return{'model':db[_0x3508dc[_0x695a('0x21')]],'as':_0x3508dc['as'],'attributes':_0x3508dc['attributes'],'include':_0x3508dc[_0x695a('0x20')]?_[_0x695a('0x1f')](_0x3508dc[_0x695a('0x20')],function(_0x587261){return{'model':db[_0x587261[_0x695a('0x21')]],'as':_0x587261['as'],'attributes':_0x587261[_0x695a('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e0c83){logger[_0x695a('0xf')](_0x695a('0x19'),_0x346828);logger[_0x695a('0x12')](_0x695a('0x19'),_0x346828,JSON[_0x695a('0x13')](_0x3e0c83));_0x1b6435(_0x3e0c83);})[_0x695a('0x18')](function(_0x43d3a1){logger[_0x695a('0x14')](_0x695a('0x19'),_0x43d3a1[_0x695a('0x16')],_0x346828);_0x1d0efc(_0xd26442[_0x695a('0x14')](0x1f4,_0x43d3a1['message']));});});};exports['NotifyFaxAccount']=function(_0xf67f0,_0xd6ed0f,_0x5cafcb){var _0x3d1e11=this;return new Promise(function(_0x55df3f,_0xce6ed4){var _0xd60d30={'body':_0xf67f0['body'],'channel':'fax'};var _0x2d0a09=[];var _0x39d4d9=[];var _0x40c29d={};return db[_0x695a('0x23')]['describe']()[_0x695a('0xe')](function(_0xadfd2e){if(!_0xadfd2e){throw new db[(_0x695a('0x24'))][(_0x695a('0x25'))](_0x695a('0x26'));}_0x2d0a09=_[_0x695a('0x27')](_[_0x695a('0x28')](_0xadfd2e),[_0x695a('0x29'),_0x695a('0x2a')]);_0x39d4d9=_[_0x695a('0x27')](_[_0x695a('0x28')](_0xadfd2e),['createdAt',_0x695a('0x2a'),_0x695a('0x2b'),'ListId']);if(_0xf67f0[_0x695a('0x2c')]['id']){delete _0xf67f0['body']['id'];}if(_[_0x695a('0x2d')](_0xf67f0[_0x695a('0x2c')][_0x695a('0x2e')])){throw new db[(_0x695a('0x24'))][(_0x695a('0x25'))](_0x695a('0x2f'));}if(_[_0x695a('0x2d')](_0xf67f0[_0x695a('0x2c')]['body'])||_0xf67f0['body'][_0x695a('0x2c')]===''){throw new db[(_0x695a('0x24'))]['ValidationError'](_0x695a('0x30'));}if(_[_0x695a('0x2d')](_0xf67f0[_0x695a('0x2c')]['mapKey'])){throw new db[(_0x695a('0x24'))][(_0x695a('0x25'))](_0x695a('0x31')+_0x39d4d9);}if(!_[_0x695a('0x32')](_0x39d4d9,_0xf67f0['body'][_0x695a('0x33')])){throw new db['Sequelize'][(_0x695a('0x25'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39d4d9);}_0x40c29d[_0xf67f0[_0x695a('0x2c')]['mapKey']]=_0xf67f0[_0x695a('0x2c')][_0x695a('0x2e')];})[_0x695a('0xe')](function(){return db[_0x695a('0x1a')][_0x695a('0x34')]({'where':{'id':_0xf67f0['account']['id']},'include':[{'model':db[_0x695a('0x35')],'as':_0x695a('0x36'),'include':[{'model':db[_0x695a('0x23')],'as':_0x695a('0x37'),'where':_0x40c29d,'limit':0x1,'order':[[_0x695a('0x2a'),_0x695a('0x38')]]}]},{'model':db[_0x695a('0x39')],'as':'Applications'}]});})['then'](function(_0x21f778){if(_0x21f778&&_0x21f778['List']){var _0x1cebe1=_0x21f778[_0x695a('0x3a')]({'plain':!![]});_0xd60d30[_0x695a('0x3b')]=_0x1cebe1;_0xd60d30[_0x695a('0x3c')]=_0x1cebe1[_0x695a('0x3d')];_0xd60d30[_0x695a('0x3e')]=_0x1cebe1[_0x695a('0x36')];_0xd60d30[_0x695a('0x3c')]=_[_0x695a('0x3f')](_0xd60d30['applications'],[_0x695a('0x40')],[_0x695a('0x41')]);if(_0xd60d30[_0x695a('0x3b')]['Applications']){delete _0xd60d30['account'][_0x695a('0x3d')];}if(_0xd60d30[_0x695a('0x3b')][_0x695a('0x36')]&&_0xd60d30[_0x695a('0x3b')][_0x695a('0x36')][_0x695a('0x37')][_0x695a('0x42')]){return _0xd60d30[_0x695a('0x3b')]['List'][_0x695a('0x37')][0x0];}var _0x4a7996=_[_0x695a('0x43')](_0xf67f0[_0x695a('0x2c')],{'firstName':_0xf67f0[_0x695a('0x2c')][_0x695a('0x2e')],'ListId':_0x1cebe1[_0x695a('0x44')]});_0x4a7996[_0xf67f0['body'][_0x695a('0x33')]]=_0xf67f0[_0x695a('0x2c')][_0x695a('0x2e')];return db[_0x695a('0x23')][_0x695a('0x45')](_0x4a7996,{'fields':_0x2d0a09,'raw':!![]});}})[_0x695a('0xe')](function(_0x4ed560){_0xd60d30[_0x695a('0x46')]=_0x4ed560;if(_0x4ed560){var _0x502b13={'ContactId':_0x4ed560['id'],'FaxAccountId':_0xf67f0['account']['id'],'fax':_0x4ed560['fax']};return db['FaxInteraction'][_0x695a('0x34')]({'where':{'ContactId':_0x4ed560['id'],'closed':![],'FaxAccountId':_0xf67f0[_0x695a('0x3b')]['id']}})[_0x695a('0xe')](function(_0x3fb68a){if(_0x3fb68a){return[_0x3fb68a,![]];}return db[_0x695a('0x47')][_0x695a('0x45')](_0x502b13)[_0x695a('0xe')](function(_0x73acd6){return[_0x73acd6,!![]];});});}else{throw new Error(_0x695a('0x48'));}})['spread'](function(_0x3f904f,_0x4e078a){var _0x34a598=_0x3f904f[_0x695a('0x3a')]({'plain':!![]});if(_0x4e078a){if(_0xd60d30[_0x695a('0x3b')][_0x695a('0x49')]){_0xd60d30[_0x695a('0x3c')][_0x695a('0x4a')]({'id':0x0,'priority':_0xd60d30['applications'][_0x695a('0x42')]+0x1,'app':_0x695a('0x4b'),'appdata':_0x695a('0x4c'),'interval':_0x695a('0x4d')});}_0x34a598[_0x695a('0x4e')]=!![];}else{_0x34a598[_0x695a('0x4e')]=![];}_0xd60d30[_0x695a('0x4f')]=_0x34a598;return db[_0x695a('0x50')][_0x695a('0x45')]({'body':_0xf67f0['body'][_0x695a('0x2c')],'FaxAccountId':_0xf67f0[_0x695a('0x3b')]['id'],'FaxInteractionId':_0x3f904f['id'],'direction':'in','ContactId':_0x3f904f[_0x695a('0x51')],'AttachmentId':_0xf67f0[_0x695a('0x2c')][_0x695a('0x52')]});})['then'](function(_0x2bb2b5){_0xd60d30[_0x695a('0x16')]=_0x2bb2b5;if(!_0xd60d30[_0x695a('0x4f')][_0x695a('0x53')])return;return db[_0x695a('0x54')]['find']({'attributes':['id',_0x695a('0x55')],'where':{'id':_0xd60d30[_0x695a('0x4f')][_0x695a('0x53')]}});})[_0x695a('0xe')](function(_0x5bc0a7){if(_0x5bc0a7){_0xd60d30[_0x695a('0x3c')][_0x695a('0x56')]({'id':0x0,'priority':0x0,'app':_0x695a('0x57'),'appdata':_0x5bc0a7[_0x695a('0x55')]+','+(_0xd60d30[_0x695a('0x3b')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0xd60d30[_0x695a('0x4f')][_0x695a('0x58')])return;return db[_0x695a('0x59')]['find']({'attributes':['id','name'],'where':{'id':_0xd60d30[_0x695a('0x4f')]['queueId']}});})[_0x695a('0xe')](function(_0x395fd4){if(_0x395fd4){_0xd60d30[_0x695a('0x3c')][_0x695a('0x56')]({'id':0x0,'priority':0x1,'app':_0x695a('0x5a'),'appdata':_0x395fd4[_0x695a('0x55')]+','+(_0xd60d30[_0x695a('0x3b')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x695a('0x5b'),_0xd60d30);})['then'](function(_0x584192){_0x55df3f(_0x584192);})[_0x695a('0x18')](function(_0x1dee8b){_0xce6ed4(_0x3d1e11[_0x695a('0x14')](0x1f4,_0x1dee8b[_0x695a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 179c51c..22b4fce 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 _0x6a58=['remove','emit','removeListener','register','length','save'];(function(_0x484d75,_0x29089d){var _0x4cfd22=function(_0x3cf399){while(--_0x3cf399){_0x484d75['push'](_0x484d75['shift']());}};_0x4cfd22(++_0x29089d);}(_0x6a58,0x18b));var _0x86a5=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x6a58[_0x236d24];return _0x1574cf;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x86a5('0x0'),_0x86a5('0x1'),'update'];function createListener(_0x59505c,_0x2a6eab){return function(_0x19123d){_0x2a6eab[_0x86a5('0x2')](_0x59505c,_0x19123d);};}function removeListener(_0x2c0612,_0x14946a){return function(){FaxAccountEvents[_0x86a5('0x3')](_0x2c0612,_0x14946a);};}exports[_0x86a5('0x4')]=function(_0x135549){for(var _0x53ba11=0x0,_0x5d9108=events[_0x86a5('0x5')];_0x53ba11<_0x5d9108;_0x53ba11++){var _0x239a21=events[_0x53ba11];var _0x24e911=createListener('faxAccount:'+_0x239a21,_0x135549);FaxAccountEvents['on'](_0x239a21,_0x24e911);}}; \ No newline at end of file +var _0x9108=['remove','removeListener','register','length','faxAccount:','./faxAccount.events','save'];(function(_0x1daf4b,_0x135cef){var _0x223165=function(_0x28adc4){while(--_0x28adc4){_0x1daf4b['push'](_0x1daf4b['shift']());}};_0x223165(++_0x135cef);}(_0x9108,0x1be));var _0x8910=function(_0x584f63,_0x5e708e){_0x584f63=_0x584f63-0x0;var _0x1a3e9b=_0x9108[_0x584f63];return _0x1a3e9b;};'use strict';var FaxAccountEvents=require(_0x8910('0x0'));var events=[_0x8910('0x1'),_0x8910('0x2'),'update'];function createListener(_0x538286,_0xa19cea){return function(_0x3fd905){_0xa19cea['emit'](_0x538286,_0x3fd905);};}function removeListener(_0x111a10,_0x1b4470){return function(){FaxAccountEvents[_0x8910('0x3')](_0x111a10,_0x1b4470);};}exports[_0x8910('0x4')]=function(_0x1296ed){for(var _0xe544a2=0x0,_0x277894=events[_0x8910('0x5')];_0xe544a2<_0x277894;_0xe544a2++){var _0x59cc98=events[_0xe544a2];var _0x30e3c6=createListener(_0x8910('0x6')+_0x59cc98,_0x1296ed);FaxAccountEvents['on'](_0x59cc98,_0x30e3c6);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index ad2e9e0..60b2841 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 _0x58a1=['removeAnswers','removeAgents','exports','path','connect-timeout','express','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','send','addAgents','put','update','delete','destroy','removeDispositions'];(function(_0x50d80b,_0x221be4){var _0x3a8af5=function(_0x57f8e7){while(--_0x57f8e7){_0x50d80b['push'](_0x50d80b['shift']());}};_0x3a8af5(++_0x221be4);}(_0x58a1,0xbc));var _0x158a=function(_0x21125f,_0x8079f8){_0x21125f=_0x21125f-0x0;var _0x2f421d=_0x58a1[_0x21125f];return _0x2f421d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x158a('0x0'));var timeout=require(_0x158a('0x1'));var express=require(_0x158a('0x2'));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(_0x158a('0x3'));var controller=require('./faxAccount.controller');router[_0x158a('0x4')]('/',auth[_0x158a('0x5')](),controller['index']);router['get'](_0x158a('0x6'),auth[_0x158a('0x5')](),controller[_0x158a('0x7')]);router[_0x158a('0x4')](_0x158a('0x8'),auth[_0x158a('0x5')](),controller['show']);router[_0x158a('0x4')](_0x158a('0x9'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x158a('0xa'),auth['isAuthenticated'](),controller[_0x158a('0xb')]);router[_0x158a('0x4')](_0x158a('0xc'),auth[_0x158a('0x5')](),controller[_0x158a('0xd')]);router['get'](_0x158a('0xe'),auth[_0x158a('0x5')](),controller['getApplications']);router[_0x158a('0x4')](_0x158a('0xf'),auth[_0x158a('0x5')](),controller[_0x158a('0x10')]);router[_0x158a('0x4')](_0x158a('0x11'),auth[_0x158a('0x5')](),controller[_0x158a('0x12')]);router[_0x158a('0x13')]('/',auth[_0x158a('0x5')](),controller[_0x158a('0x14')]);router[_0x158a('0x13')](_0x158a('0x9'),auth[_0x158a('0x5')](),controller[_0x158a('0x15')]);router['post'](_0x158a('0xa'),auth['isAuthenticated'](),controller[_0x158a('0x16')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0x158a('0x13')](_0x158a('0xe'),auth[_0x158a('0x5')](),controller[_0x158a('0x17')]);router[_0x158a('0x13')](_0x158a('0x18'),auth[_0x158a('0x5')](),controller[_0x158a('0x19')]);router[_0x158a('0x13')](_0x158a('0x1a'),auth[_0x158a('0x5')](),controller['updateAccountApplications']);router[_0x158a('0x13')]('/:id/send',auth[_0x158a('0x5')](),controller[_0x158a('0x1b')]);router[_0x158a('0x13')](_0x158a('0x11'),auth[_0x158a('0x5')](),controller[_0x158a('0x1c')]);router[_0x158a('0x1d')](_0x158a('0x8'),auth[_0x158a('0x5')](),controller[_0x158a('0x1e')]);router[_0x158a('0x1f')](_0x158a('0x8'),auth[_0x158a('0x5')](),controller[_0x158a('0x20')]);router[_0x158a('0x1f')]('/:id/dispositions',auth[_0x158a('0x5')](),controller[_0x158a('0x21')]);router[_0x158a('0x1f')](_0x158a('0xa'),auth[_0x158a('0x5')](),controller[_0x158a('0x22')]);router['delete'](_0x158a('0x11'),auth[_0x158a('0x5')](),controller[_0x158a('0x23')]);module[_0x158a('0x24')]=router; \ No newline at end of file +var _0x9bc8=['/:id/applications','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id/users','put','update','delete','destroy','/:id/canned_answers','removeAnswers','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getAnswers','getApplications','/:id/messages','getMessages','post','create','/:id/dispositions','addAnswer','/:id/interactions'];(function(_0x408447,_0x37d8a8){var _0x3ad30d=function(_0x1eb85c){while(--_0x1eb85c){_0x408447['push'](_0x408447['shift']());}};_0x3ad30d(++_0x37d8a8);}(_0x9bc8,0x81));var _0x89bc=function(_0x17a464,_0x4084f4){_0x17a464=_0x17a464-0x0;var _0x343d5a=_0x9bc8[_0x17a464];return _0x343d5a;};'use strict';var multer=require(_0x89bc('0x0'));var util=require(_0x89bc('0x1'));var path=require('path');var timeout=require(_0x89bc('0x2'));var express=require('express');var router=express[_0x89bc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x89bc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x89bc('0x5'));var controller=require(_0x89bc('0x6'));router[_0x89bc('0x7')]('/',auth[_0x89bc('0x8')](),controller[_0x89bc('0x9')]);router[_0x89bc('0x7')](_0x89bc('0xa'),auth[_0x89bc('0x8')](),controller[_0x89bc('0xb')]);router[_0x89bc('0x7')](_0x89bc('0xc'),auth[_0x89bc('0x8')](),controller[_0x89bc('0xd')]);router[_0x89bc('0x7')]('/:id/dispositions',auth[_0x89bc('0x8')](),controller['getDispositions']);router[_0x89bc('0x7')]('/:id/canned_answers',auth[_0x89bc('0x8')](),controller[_0x89bc('0xe')]);router['get']('/:id/interactions',auth[_0x89bc('0x8')](),controller['getInteractions']);router[_0x89bc('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x89bc('0xf')]);router[_0x89bc('0x7')](_0x89bc('0x10'),auth[_0x89bc('0x8')](),controller[_0x89bc('0x11')]);router[_0x89bc('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x89bc('0x12')]('/',auth[_0x89bc('0x8')](),controller[_0x89bc('0x13')]);router[_0x89bc('0x12')](_0x89bc('0x14'),auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x89bc('0x15')]);router[_0x89bc('0x12')](_0x89bc('0x16'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x89bc('0x17'),auth[_0x89bc('0x8')](),controller[_0x89bc('0x18')]);router['post']('/addaccountapplications',auth[_0x89bc('0x8')](),controller[_0x89bc('0x19')]);router['post'](_0x89bc('0x1a'),auth['isAuthenticated'](),controller[_0x89bc('0x1b')]);router[_0x89bc('0x12')](_0x89bc('0x1c'),auth[_0x89bc('0x8')](),controller[_0x89bc('0x1d')]);router[_0x89bc('0x12')](_0x89bc('0x1e'),auth[_0x89bc('0x8')](),controller['addAgents']);router[_0x89bc('0x1f')](_0x89bc('0xc'),auth[_0x89bc('0x8')](),controller[_0x89bc('0x20')]);router[_0x89bc('0x21')](_0x89bc('0xc'),auth[_0x89bc('0x8')](),controller[_0x89bc('0x22')]);router['delete'](_0x89bc('0x14'),auth[_0x89bc('0x8')](),controller['removeDispositions']);router[_0x89bc('0x21')](_0x89bc('0x23'),auth[_0x89bc('0x8')](),controller[_0x89bc('0x24')]);router[_0x89bc('0x21')]('/:id/users',auth[_0x89bc('0x8')](),controller['removeAgents']);module[_0x89bc('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 783cc74..67c9f64 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 _0xc735=['noop','TEXT','*,*,*,*','sequelize','exports','STRING'];(function(_0x57f29e,_0x352c43){var _0x5a66f4=function(_0x2fb252){while(--_0x2fb252){_0x57f29e['push'](_0x57f29e['shift']());}};_0x5a66f4(++_0x352c43);}(_0xc735,0x8d));var _0x5c73=function(_0x444d5a,_0x5d95d1){_0x444d5a=_0x444d5a-0x0;var _0xf6b58f=_0xc735[_0x444d5a];return _0xf6b58f;};'use strict';var Sequelize=require(_0x5c73('0x0'));module[_0x5c73('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5c73('0x2')],'allowNull':![],'defaultValue':_0x5c73('0x3')},'appdata':{'type':Sequelize[_0x5c73('0x4')]()},'description':{'type':Sequelize[_0x5c73('0x2')]},'interval':{'type':Sequelize[_0x5c73('0x2')],'defaultValue':_0x5c73('0x5')}}; \ No newline at end of file +var _0x323c=['noop','TEXT','*,*,*,*','sequelize','STRING'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x323c,0x99));var _0xc323=function(_0xb7368b,_0xf11033){_0xb7368b=_0xb7368b-0x0;var _0x37d43b=_0x323c[_0xb7368b];return _0x37d43b;};'use strict';var Sequelize=require(_0xc323('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc323('0x1')],'allowNull':![],'defaultValue':_0xc323('0x2')},'appdata':{'type':Sequelize[_0xc323('0x3')]()},'description':{'type':Sequelize[_0xc323('0x1')]},'interval':{'type':Sequelize[_0xc323('0x1')],'defaultValue':_0xc323('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 6ae3aa4..ee2b754 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 _0xd885=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','offset','set','json','apply','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','length','nolimit','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis'];(function(_0x2b3c9d,_0x1c8c0c){var _0x4b8037=function(_0x225327){while(--_0x225327){_0x2b3c9d['push'](_0x2b3c9d['shift']());}};_0x4b8037(++_0x1c8c0c);}(_0xd885,0x118));var _0x5d88=function(_0x31bace,_0x570dd4){_0x31bace=_0x31bace-0x0;var _0x261cba=_0xd885[_0x31bace];return _0x261cba;};'use strict';var emlformat=require(_0x5d88('0x0'));var rimraf=require(_0x5d88('0x1'));var zipdir=require(_0x5d88('0x2'));var jsonpatch=require(_0x5d88('0x3'));var rp=require(_0x5d88('0x4'));var moment=require(_0x5d88('0x5'));var BPromise=require(_0x5d88('0x6'));var Mustache=require('mustache');var util=require(_0x5d88('0x7'));var path=require(_0x5d88('0x8'));var sox=require(_0x5d88('0x9'));var csv=require(_0x5d88('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d88('0xb'));var _=require('lodash');var squel=require(_0x5d88('0xc'));var crypto=require('crypto');var jsforce=require(_0x5d88('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5d88('0xa'));var querystring=require('querystring');var Papa=require(_0x5d88('0xe'));var Redis=require(_0x5d88('0xf'));var authService=require(_0x5d88('0x10'));var qs=require(_0x5d88('0x11'));var as=require(_0x5d88('0x12'));var hardwareService=require(_0x5d88('0x13'));var logger=require(_0x5d88('0x14'))(_0x5d88('0x15'));var utils=require(_0x5d88('0x16'));var config=require(_0x5d88('0x17'));var licenseUtil=require(_0x5d88('0x18'));var db=require(_0x5d88('0x19'))['db'];function respondWithStatusCode(_0x534f84,_0x4a0c84){_0x4a0c84=_0x4a0c84||0xcc;return function(_0x5281af){if(_0x5281af){return _0x534f84['sendStatus'](_0x4a0c84);}return _0x534f84[_0x5d88('0x1a')](_0x4a0c84)[_0x5d88('0x1b')]();};}function respondWithResult(_0x26d0c1,_0x1f037c){_0x1f037c=_0x1f037c||0xc8;return function(_0x14e0ca){if(_0x14e0ca){return _0x26d0c1[_0x5d88('0x1a')](_0x1f037c)['json'](_0x14e0ca);}};}function respondWithFilteredResult(_0x3ca087,_0x4992c4){return function(_0x54b186){if(_0x54b186){var _0x52ebef=typeof _0x4992c4['offset']==='undefined'&&typeof _0x4992c4[_0x5d88('0x1c')]==='undefined';var _0x22d4b=_0x54b186['count'];var _0x3fbe55=_0x52ebef?0x0:_0x4992c4['offset'];var _0x27f528=_0x52ebef?_0x54b186['count']:_0x4992c4[_0x5d88('0x1d')]+_0x4992c4[_0x5d88('0x1c')];var _0x1181cd;if(_0x27f528>=_0x22d4b){_0x27f528=_0x22d4b;_0x1181cd=0xc8;}else{_0x1181cd=0xce;}_0x3ca087[_0x5d88('0x1a')](_0x1181cd);return _0x3ca087[_0x5d88('0x1e')]('Content-Range',_0x3fbe55+'-'+_0x27f528+'/'+_0x22d4b)[_0x5d88('0x1f')](_0x54b186);}return null;};}function patchUpdates(_0x135828){return function(_0x34b522){try{jsonpatch[_0x5d88('0x20')](_0x34b522,_0x135828,!![]);}catch(_0x5689cd){return BPromise['reject'](_0x5689cd);}return _0x34b522[_0x5d88('0x21')]();};}function saveUpdates(_0x289e8e,_0x3c95a1){return function(_0x4d831c){if(_0x4d831c){return _0x4d831c[_0x5d88('0x22')](_0x289e8e)[_0x5d88('0x23')](function(_0x5f1586){return _0x5f1586;});}return null;};}function removeEntity(_0x406825,_0x201933){return function(_0x346224){if(_0x346224){return _0x346224[_0x5d88('0x24')]()[_0x5d88('0x23')](function(){_0x406825[_0x5d88('0x1a')](0xcc)[_0x5d88('0x1b')]();});}};}function handleEntityNotFound(_0x55e5e5,_0x11b6e2){return function(_0x17c5a6){if(!_0x17c5a6){_0x55e5e5['sendStatus'](0x194);}return _0x17c5a6;};}function handleError(_0x103629,_0x343a34){_0x343a34=_0x343a34||0x1f4;return function(_0x423ec3){logger[_0x5d88('0x25')](_0x423ec3[_0x5d88('0x26')]);if(_0x423ec3[_0x5d88('0x27')]){delete _0x423ec3[_0x5d88('0x27')];}_0x103629['status'](_0x343a34)[_0x5d88('0x28')](_0x423ec3);};}exports[_0x5d88('0x29')]=function(_0x4d912f,_0x5462cc){var _0x296556={},_0x5adcb3={},_0x46a0b5={'count':0x0,'rows':[]};var _0x53cf69=_[_0x5d88('0x2a')](db[_0x5d88('0x2b')][_0x5d88('0x2c')],function(_0x5ceab6){return{'name':_0x5ceab6[_0x5d88('0x2d')],'type':_0x5ceab6[_0x5d88('0x2e')][_0x5d88('0x2f')]};});_0x5adcb3[_0x5d88('0x30')]=_['map'](_0x53cf69,_0x5d88('0x27'));_0x5adcb3[_0x5d88('0x31')]=_['keys'](_0x4d912f[_0x5d88('0x31')]);_0x5adcb3[_0x5d88('0x32')]=_['intersection'](_0x5adcb3[_0x5d88('0x30')],_0x5adcb3['query']);_0x296556[_0x5d88('0x33')]=_[_0x5d88('0x34')](_0x5adcb3[_0x5d88('0x30')],qs['fields'](_0x4d912f['query']['fields']));_0x296556['attributes']=_0x296556['attributes'][_0x5d88('0x35')]?_0x296556[_0x5d88('0x33')]:_0x5adcb3[_0x5d88('0x30')];if(!_0x4d912f[_0x5d88('0x31')]['hasOwnProperty'](_0x5d88('0x36'))){_0x296556[_0x5d88('0x1c')]=qs[_0x5d88('0x1c')](_0x4d912f[_0x5d88('0x31')][_0x5d88('0x1c')]);_0x296556[_0x5d88('0x1d')]=qs[_0x5d88('0x1d')](_0x4d912f[_0x5d88('0x31')][_0x5d88('0x1d')]);}_0x296556['order']=qs['sort'](_0x4d912f[_0x5d88('0x31')]['sort']);_0x296556[_0x5d88('0x37')]=qs[_0x5d88('0x32')](_[_0x5d88('0x38')](_0x4d912f['query'],_0x5adcb3['filters']),_0x53cf69);if(_0x4d912f[_0x5d88('0x31')]['filter']){_0x296556[_0x5d88('0x37')]=_[_0x5d88('0x39')](_0x296556[_0x5d88('0x37')],{'$or':_[_0x5d88('0x2a')](_0x53cf69,function(_0x12c773){if(_0x12c773['type']!==_0x5d88('0x3a')){var _0x1a3ecc={};_0x1a3ecc[_0x12c773[_0x5d88('0x27')]]={'$like':'%'+_0x4d912f[_0x5d88('0x31')][_0x5d88('0x3b')]+'%'};return _0x1a3ecc;}})});}_0x296556=_['merge']({},_0x296556,_0x4d912f[_0x5d88('0x3c')]);var _0x3c4a60={'where':_0x296556[_0x5d88('0x37')]};return db[_0x5d88('0x2b')][_0x5d88('0x3d')](_0x3c4a60)[_0x5d88('0x23')](function(_0x5e8809){_0x46a0b5[_0x5d88('0x3d')]=_0x5e8809;if(_0x4d912f[_0x5d88('0x31')][_0x5d88('0x3e')]){_0x296556[_0x5d88('0x3f')]=[{'all':!![]}];}return db[_0x5d88('0x2b')][_0x5d88('0x40')](_0x296556);})[_0x5d88('0x23')](function(_0x7d9deb){_0x46a0b5[_0x5d88('0x41')]=_0x7d9deb;return _0x46a0b5;})[_0x5d88('0x23')](respondWithFilteredResult(_0x5462cc,_0x296556))[_0x5d88('0x42')](handleError(_0x5462cc,null));};exports[_0x5d88('0x43')]=function(_0x52c412,_0x19fc74){var _0x58e2ee={'raw':!![],'where':{'id':_0x52c412[_0x5d88('0x44')]['id']}},_0x5b2072={};_0x5b2072[_0x5d88('0x30')]=_['keys'](db['FaxApplication'][_0x5d88('0x2c')]);_0x5b2072[_0x5d88('0x31')]=_[_0x5d88('0x45')](_0x52c412['query']);_0x5b2072[_0x5d88('0x32')]=_['intersection'](_0x5b2072[_0x5d88('0x30')],_0x5b2072['query']);_0x58e2ee[_0x5d88('0x33')]=_['intersection'](_0x5b2072[_0x5d88('0x30')],qs[_0x5d88('0x46')](_0x52c412[_0x5d88('0x31')][_0x5d88('0x46')]));_0x58e2ee[_0x5d88('0x33')]=_0x58e2ee['attributes']['length']?_0x58e2ee[_0x5d88('0x33')]:_0x5b2072[_0x5d88('0x30')];if(_0x52c412[_0x5d88('0x31')][_0x5d88('0x3e')]){_0x58e2ee[_0x5d88('0x3f')]=[{'all':!![]}];}_0x58e2ee=_[_0x5d88('0x39')]({},_0x58e2ee,_0x52c412[_0x5d88('0x3c')]);return db[_0x5d88('0x2b')][_0x5d88('0x47')](_0x58e2ee)[_0x5d88('0x23')](handleEntityNotFound(_0x19fc74,null))[_0x5d88('0x23')](respondWithResult(_0x19fc74,null))[_0x5d88('0x42')](handleError(_0x19fc74,null));};exports[_0x5d88('0x48')]=function(_0x13082c,_0x79f4c4){return db[_0x5d88('0x2b')]['create'](_0x13082c[_0x5d88('0x49')],{})[_0x5d88('0x23')](respondWithResult(_0x79f4c4,0xc9))[_0x5d88('0x42')](handleError(_0x79f4c4,null));};exports[_0x5d88('0x22')]=function(_0xd48783,_0x49900d){if(_0xd48783['body']['id']){delete _0xd48783[_0x5d88('0x49')]['id'];}return db[_0x5d88('0x2b')]['find']({'where':{'id':_0xd48783['params']['id']}})[_0x5d88('0x23')](handleEntityNotFound(_0x49900d,null))[_0x5d88('0x23')](saveUpdates(_0xd48783['body'],null))[_0x5d88('0x23')](respondWithResult(_0x49900d,null))['catch'](handleError(_0x49900d,null));};exports[_0x5d88('0x24')]=function(_0x110cdd,_0x5d6b8b){return db[_0x5d88('0x2b')][_0x5d88('0x47')]({'where':{'id':_0x110cdd[_0x5d88('0x44')]['id']}})[_0x5d88('0x23')](handleEntityNotFound(_0x5d6b8b,null))[_0x5d88('0x23')](removeEntity(_0x5d6b8b,null))[_0x5d88('0x42')](handleError(_0x5d6b8b,null));}; \ No newline at end of file +var _0xd315=['fieldName','type','key','model','query','keys','filters','intersection','attributes','limit','sort','where','filter','merge','VIRTUAL','options','FaxApplication','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','length','include','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map'];(function(_0x25e739,_0xa2fb7){var _0x409e54=function(_0x3db4ee){while(--_0x3db4ee){_0x25e739['push'](_0x25e739['shift']());}};_0x409e54(++_0xa2fb7);}(_0xd315,0xb6));var _0x5d31=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd315[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5d31('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d31('0x1'));var jsonpatch=require(_0x5d31('0x2'));var rp=require(_0x5d31('0x3'));var moment=require(_0x5d31('0x4'));var BPromise=require(_0x5d31('0x5'));var Mustache=require('mustache');var util=require(_0x5d31('0x6'));var path=require(_0x5d31('0x7'));var sox=require(_0x5d31('0x8'));var csv=require(_0x5d31('0x9'));var ejs=require(_0x5d31('0xa'));var fs=require('fs');var fs_extra=require(_0x5d31('0xb'));var _=require('lodash');var squel=require(_0x5d31('0xc'));var crypto=require(_0x5d31('0xd'));var jsforce=require(_0x5d31('0xe'));var deskjs=require(_0x5d31('0xf'));var toCsv=require(_0x5d31('0x9'));var querystring=require(_0x5d31('0x10'));var Papa=require(_0x5d31('0x11'));var Redis=require(_0x5d31('0x12'));var authService=require(_0x5d31('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d31('0x14'));var hardwareService=require(_0x5d31('0x15'));var logger=require(_0x5d31('0x16'))(_0x5d31('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5d31('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bc6fd,_0x24bf6b){_0x24bf6b=_0x24bf6b||0xcc;return function(_0x27b881){if(_0x27b881){return _0x5bc6fd[_0x5d31('0x19')](_0x24bf6b);}return _0x5bc6fd[_0x5d31('0x1a')](_0x24bf6b)[_0x5d31('0x1b')]();};}function respondWithResult(_0x4ccb04,_0x19e61b){_0x19e61b=_0x19e61b||0xc8;return function(_0x40642b){if(_0x40642b){return _0x4ccb04[_0x5d31('0x1a')](_0x19e61b)['json'](_0x40642b);}};}function respondWithFilteredResult(_0x1fc520,_0x13ec4c){return function(_0x27bf53){if(_0x27bf53){var _0x2f4459=typeof _0x13ec4c[_0x5d31('0x1c')]===_0x5d31('0x1d')&&typeof _0x13ec4c['limit']==='undefined';var _0x2ca6fa=_0x27bf53[_0x5d31('0x1e')];var _0x3dc542=_0x2f4459?0x0:_0x13ec4c['offset'];var _0x70fbca=_0x2f4459?_0x27bf53[_0x5d31('0x1e')]:_0x13ec4c['offset']+_0x13ec4c['limit'];var _0x1e1040;if(_0x70fbca>=_0x2ca6fa){_0x70fbca=_0x2ca6fa;_0x1e1040=0xc8;}else{_0x1e1040=0xce;}_0x1fc520[_0x5d31('0x1a')](_0x1e1040);return _0x1fc520[_0x5d31('0x1f')](_0x5d31('0x20'),_0x3dc542+'-'+_0x70fbca+'/'+_0x2ca6fa)[_0x5d31('0x21')](_0x27bf53);}return null;};}function patchUpdates(_0x1775ad){return function(_0x468abd){try{jsonpatch[_0x5d31('0x22')](_0x468abd,_0x1775ad,!![]);}catch(_0x7c5fe2){return BPromise[_0x5d31('0x23')](_0x7c5fe2);}return _0x468abd[_0x5d31('0x24')]();};}function saveUpdates(_0x3c5f0b,_0xa90a7){return function(_0x342e23){if(_0x342e23){return _0x342e23[_0x5d31('0x25')](_0x3c5f0b)['then'](function(_0x1824d6){return _0x1824d6;});}return null;};}function removeEntity(_0x779d18,_0x140f4c){return function(_0x1c7781){if(_0x1c7781){return _0x1c7781[_0x5d31('0x26')]()[_0x5d31('0x27')](function(){_0x779d18[_0x5d31('0x1a')](0xcc)[_0x5d31('0x1b')]();});}};}function handleEntityNotFound(_0x2fa1cc,_0x2cd503){return function(_0x2a5926){if(!_0x2a5926){_0x2fa1cc[_0x5d31('0x19')](0x194);}return _0x2a5926;};}function handleError(_0x14d1b0,_0xe44ace){_0xe44ace=_0xe44ace||0x1f4;return function(_0x51e0f2){logger[_0x5d31('0x28')](_0x51e0f2[_0x5d31('0x29')]);if(_0x51e0f2['name']){delete _0x51e0f2[_0x5d31('0x2a')];}_0x14d1b0['status'](_0xe44ace)[_0x5d31('0x2b')](_0x51e0f2);};}exports[_0x5d31('0x2c')]=function(_0x814227,_0x2b8dc8){var _0x6839ea={},_0x3e54b9={},_0x3cd79c={'count':0x0,'rows':[]};var _0x1ebc8a=_[_0x5d31('0x2d')](db['FaxApplication']['rawAttributes'],function(_0xf9c035){return{'name':_0xf9c035[_0x5d31('0x2e')],'type':_0xf9c035[_0x5d31('0x2f')][_0x5d31('0x30')]};});_0x3e54b9[_0x5d31('0x31')]=_['map'](_0x1ebc8a,_0x5d31('0x2a'));_0x3e54b9[_0x5d31('0x32')]=_[_0x5d31('0x33')](_0x814227[_0x5d31('0x32')]);_0x3e54b9[_0x5d31('0x34')]=_[_0x5d31('0x35')](_0x3e54b9[_0x5d31('0x31')],_0x3e54b9[_0x5d31('0x32')]);_0x6839ea[_0x5d31('0x36')]=_[_0x5d31('0x35')](_0x3e54b9[_0x5d31('0x31')],qs['fields'](_0x814227[_0x5d31('0x32')]['fields']));_0x6839ea[_0x5d31('0x36')]=_0x6839ea[_0x5d31('0x36')]['length']?_0x6839ea[_0x5d31('0x36')]:_0x3e54b9['model'];if(!_0x814227[_0x5d31('0x32')]['hasOwnProperty']('nolimit')){_0x6839ea[_0x5d31('0x37')]=qs[_0x5d31('0x37')](_0x814227[_0x5d31('0x32')][_0x5d31('0x37')]);_0x6839ea[_0x5d31('0x1c')]=qs[_0x5d31('0x1c')](_0x814227[_0x5d31('0x32')]['offset']);}_0x6839ea['order']=qs['sort'](_0x814227[_0x5d31('0x32')][_0x5d31('0x38')]);_0x6839ea[_0x5d31('0x39')]=qs['filters'](_['pick'](_0x814227[_0x5d31('0x32')],_0x3e54b9['filters']),_0x1ebc8a);if(_0x814227['query'][_0x5d31('0x3a')]){_0x6839ea[_0x5d31('0x39')]=_[_0x5d31('0x3b')](_0x6839ea[_0x5d31('0x39')],{'$or':_[_0x5d31('0x2d')](_0x1ebc8a,function(_0x2ae29b){if(_0x2ae29b[_0x5d31('0x2f')]!==_0x5d31('0x3c')){var _0x45713e={};_0x45713e[_0x2ae29b[_0x5d31('0x2a')]]={'$like':'%'+_0x814227['query'][_0x5d31('0x3a')]+'%'};return _0x45713e;}})});}_0x6839ea=_[_0x5d31('0x3b')]({},_0x6839ea,_0x814227[_0x5d31('0x3d')]);var _0x5bbbe0={'where':_0x6839ea[_0x5d31('0x39')]};return db[_0x5d31('0x3e')][_0x5d31('0x1e')](_0x5bbbe0)[_0x5d31('0x27')](function(_0x222758){_0x3cd79c[_0x5d31('0x1e')]=_0x222758;if(_0x814227[_0x5d31('0x32')][_0x5d31('0x3f')]){_0x6839ea['include']=[{'all':!![]}];}return db[_0x5d31('0x3e')][_0x5d31('0x40')](_0x6839ea);})['then'](function(_0x52d784){_0x3cd79c[_0x5d31('0x41')]=_0x52d784;return _0x3cd79c;})[_0x5d31('0x27')](respondWithFilteredResult(_0x2b8dc8,_0x6839ea))[_0x5d31('0x42')](handleError(_0x2b8dc8,null));};exports[_0x5d31('0x43')]=function(_0x589621,_0x156b95){var _0x2c2135={'raw':!![],'where':{'id':_0x589621[_0x5d31('0x44')]['id']}},_0x2ae605={};_0x2ae605[_0x5d31('0x31')]=_[_0x5d31('0x33')](db[_0x5d31('0x3e')][_0x5d31('0x45')]);_0x2ae605[_0x5d31('0x32')]=_[_0x5d31('0x33')](_0x589621[_0x5d31('0x32')]);_0x2ae605[_0x5d31('0x34')]=_[_0x5d31('0x35')](_0x2ae605[_0x5d31('0x31')],_0x2ae605[_0x5d31('0x32')]);_0x2c2135[_0x5d31('0x36')]=_[_0x5d31('0x35')](_0x2ae605[_0x5d31('0x31')],qs[_0x5d31('0x46')](_0x589621[_0x5d31('0x32')][_0x5d31('0x46')]));_0x2c2135[_0x5d31('0x36')]=_0x2c2135['attributes'][_0x5d31('0x47')]?_0x2c2135[_0x5d31('0x36')]:_0x2ae605[_0x5d31('0x31')];if(_0x589621[_0x5d31('0x32')][_0x5d31('0x3f')]){_0x2c2135[_0x5d31('0x48')]=[{'all':!![]}];}_0x2c2135=_[_0x5d31('0x3b')]({},_0x2c2135,_0x589621[_0x5d31('0x3d')]);return db[_0x5d31('0x3e')]['find'](_0x2c2135)[_0x5d31('0x27')](handleEntityNotFound(_0x156b95,null))[_0x5d31('0x27')](respondWithResult(_0x156b95,null))[_0x5d31('0x42')](handleError(_0x156b95,null));};exports[_0x5d31('0x49')]=function(_0x14a9f7,_0x3dc718){return db[_0x5d31('0x3e')][_0x5d31('0x49')](_0x14a9f7[_0x5d31('0x4a')],{})[_0x5d31('0x27')](respondWithResult(_0x3dc718,0xc9))[_0x5d31('0x42')](handleError(_0x3dc718,null));};exports[_0x5d31('0x25')]=function(_0x402d63,_0x3d1b33){if(_0x402d63[_0x5d31('0x4a')]['id']){delete _0x402d63[_0x5d31('0x4a')]['id'];}return db[_0x5d31('0x3e')][_0x5d31('0x4b')]({'where':{'id':_0x402d63['params']['id']}})[_0x5d31('0x27')](handleEntityNotFound(_0x3d1b33,null))[_0x5d31('0x27')](saveUpdates(_0x402d63[_0x5d31('0x4a')],null))[_0x5d31('0x27')](respondWithResult(_0x3d1b33,null))['catch'](handleError(_0x3d1b33,null));};exports[_0x5d31('0x26')]=function(_0x48691e,_0x163e8b){return db[_0x5d31('0x3e')][_0x5d31('0x4b')]({'where':{'id':_0x48691e['params']['id']}})['then'](handleEntityNotFound(_0x163e8b,null))[_0x5d31('0x27')](removeEntity(_0x163e8b,null))['catch'](handleError(_0x163e8b,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index dee9b50..8f982b1 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 _0x19c5=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x19c5,0x7c));var _0x519c=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x19c5[_0x2f9467];return _0x39894c;};'use strict';var _=require(_0x519c('0x0'));var util=require(_0x519c('0x1'));var logger=require(_0x519c('0x2'))(_0x519c('0x3'));var moment=require(_0x519c('0x4'));var BPromise=require(_0x519c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x519c('0x6'));var rimraf=require(_0x519c('0x7'));var config=require(_0x519c('0x8'));var attributes=require('./faxApplication.attributes');module[_0x519c('0x9')]=function(_0x3d1444,_0x35e1e3){return _0x3d1444['define'](_0x519c('0xa'),attributes,{'tableName':_0x519c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x519c('0xc'),'collate':_0x519c('0xd')});}; \ No newline at end of file +var _0x7372=['api','moment','request-promise','path','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x32e779,_0x1c2596){var _0x47d7b3=function(_0x37c2d8){while(--_0x37c2d8){_0x32e779['push'](_0x32e779['shift']());}};_0x47d7b3(++_0x1c2596);}(_0x7372,0x191));var _0x2737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7372[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2737('0x0'));var logger=require(_0x2737('0x1'))(_0x2737('0x2'));var moment=require(_0x2737('0x3'));var BPromise=require('bluebird');var rp=require(_0x2737('0x4'));var fs=require('fs');var path=require(_0x2737('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2737('0x6'));module[_0x2737('0x7')]=function(_0x2f11fe,_0x457e2f){return _0x2f11fe[_0x2737('0x8')](_0x2737('0x9'),attributes,{'tableName':_0x2737('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2737('0xb'),'collate':_0x2737('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 65b8849..190daf9 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 _0xf3c2=['client','http','request','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','limit','then','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x9b6f48,_0x583963){var _0x96a18d=function(_0x5c37c3){while(--_0x5c37c3){_0x9b6f48['push'](_0x9b6f48['shift']());}};_0x96a18d(++_0x583963);}(_0xf3c2,0x14c));var _0x2f3c=function(_0x35f0fb,_0x26ef29){_0x35f0fb=_0x35f0fb-0x0;var _0x1a76b4=_0xf3c2[_0x35f0fb];return _0x1a76b4;};'use strict';var _=require(_0x2f3c('0x0'));var util=require('util');var moment=require(_0x2f3c('0x1'));var BPromise=require(_0x2f3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f3c('0x3'));var db=require(_0x2f3c('0x4'))['db'];var utils=require(_0x2f3c('0x5'));var logger=require(_0x2f3c('0x6'))(_0x2f3c('0x7'));var config=require(_0x2f3c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2f3c('0x9')][_0x2f3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e415e,_0x8dbfd5,_0x5f00be){return new BPromise(function(_0x1f7126,_0x59fc66){return client[_0x2f3c('0xb')](_0x3e415e,_0x5f00be)['then'](function(_0x38a3cc){logger[_0x2f3c('0xc')](_0x2f3c('0xd'),_0x8dbfd5,_0x2f3c('0xe'));logger[_0x2f3c('0xf')](_0x2f3c('0x10'),_0x8dbfd5,_0x2f3c('0xe'),JSON[_0x2f3c('0x11')](_0x38a3cc));if(_0x38a3cc[_0x2f3c('0x12')]){if(_0x38a3cc['error'][_0x2f3c('0x13')]===0x1f4){logger[_0x2f3c('0x12')](_0x2f3c('0xd'),_0x8dbfd5,_0x38a3cc[_0x2f3c('0x12')][_0x2f3c('0x14')]);return _0x59fc66(_0x38a3cc[_0x2f3c('0x12')]['message']);}logger[_0x2f3c('0x12')](_0x2f3c('0xd'),_0x8dbfd5,_0x38a3cc[_0x2f3c('0x12')][_0x2f3c('0x14')]);return _0x1f7126(_0x38a3cc[_0x2f3c('0x12')][_0x2f3c('0x14')]);}else{logger[_0x2f3c('0xc')](_0x2f3c('0xd'),_0x8dbfd5,_0x2f3c('0xe'));_0x1f7126(_0x38a3cc[_0x2f3c('0x15')][_0x2f3c('0x14')]);}})['catch'](function(_0x2635f4){logger[_0x2f3c('0x12')](_0x2f3c('0xd'),_0x8dbfd5,_0x2635f4);_0x59fc66(_0x2635f4);});});}exports[_0x2f3c('0x16')]=function(_0x548686){var _0x102c4d=this;return new Promise(function(_0x42f85e,_0x20e50b){return db[_0x2f3c('0x17')]['update'](_0x548686[_0x2f3c('0x18')],{'raw':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')][_0x2f3c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')][_0x2f3c('0x1b')]||null:null,'attributes':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')]['attributes']||null:null,'limit':_0x548686[_0x2f3c('0x19')]?_0x548686[_0x2f3c('0x19')][_0x2f3c('0x1c')]||null:null})[_0x2f3c('0x1d')](function(_0x4a8076){logger['info'](_0x2f3c('0x16'),_0x548686);logger[_0x2f3c('0xf')](_0x2f3c('0x16'),_0x548686,JSON[_0x2f3c('0x11')](_0x4a8076));_0x42f85e(_0x4a8076);})[_0x2f3c('0x1e')](function(_0x29ceb0){logger[_0x2f3c('0x12')](_0x2f3c('0x16'),_0x29ceb0[_0x2f3c('0x14')],_0x548686);_0x20e50b(_0x102c4d['error'](0x1f4,_0x29ceb0[_0x2f3c('0x14')]));});});}; \ No newline at end of file +var _0xe332=['util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateFaxApplication','FaxApplication','update','body','options','where','limit','debug','catch','lodash'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xe332,0x143));var _0x2e33=function(_0x5d508d,_0x517349){_0x5d508d=_0x5d508d-0x0;var _0x41c8ae=_0xe332[_0x5d508d];return _0x41c8ae;};'use strict';var _=require(_0x2e33('0x0'));var util=require(_0x2e33('0x1'));var moment=require('moment');var BPromise=require(_0x2e33('0x2'));var rs=require(_0x2e33('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e33('0x4'))(_0x2e33('0x5'));var config=require(_0x2e33('0x6'));var jayson=require(_0x2e33('0x7'));var client=jayson[_0x2e33('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd5ca,_0x4db60a,_0x4707e4){return new BPromise(function(_0xef2da,_0x10a972){return client[_0x2e33('0x9')](_0x4fd5ca,_0x4707e4)[_0x2e33('0xa')](function(_0x124aac){logger[_0x2e33('0xb')](_0x2e33('0xc'),_0x4db60a,_0x2e33('0xd'));logger['debug'](_0x2e33('0xe'),_0x4db60a,_0x2e33('0xd'),JSON[_0x2e33('0xf')](_0x124aac));if(_0x124aac['error']){if(_0x124aac['error']['code']===0x1f4){logger[_0x2e33('0x10')]('FaxApplication,\x20%s,\x20%s',_0x4db60a,_0x124aac[_0x2e33('0x10')][_0x2e33('0x11')]);return _0x10a972(_0x124aac[_0x2e33('0x10')][_0x2e33('0x11')]);}logger[_0x2e33('0x10')](_0x2e33('0xc'),_0x4db60a,_0x124aac[_0x2e33('0x10')][_0x2e33('0x11')]);return _0xef2da(_0x124aac[_0x2e33('0x10')]['message']);}else{logger[_0x2e33('0xb')]('FaxApplication,\x20%s,\x20%s',_0x4db60a,_0x2e33('0xd'));_0xef2da(_0x124aac['result'][_0x2e33('0x11')]);}})['catch'](function(_0x33d6e0){logger[_0x2e33('0x10')](_0x2e33('0xc'),_0x4db60a,_0x33d6e0);_0x10a972(_0x33d6e0);});});}exports[_0x2e33('0x12')]=function(_0xdcb5e4){var _0x4d406d=this;return new Promise(function(_0x2294bb,_0x3c7743){return db[_0x2e33('0x13')][_0x2e33('0x14')](_0xdcb5e4[_0x2e33('0x15')],{'raw':_0xdcb5e4[_0x2e33('0x16')]?_0xdcb5e4[_0x2e33('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdcb5e4['options']?_0xdcb5e4[_0x2e33('0x16')][_0x2e33('0x17')]||null:null,'attributes':_0xdcb5e4['options']?_0xdcb5e4[_0x2e33('0x16')]['attributes']||null:null,'limit':_0xdcb5e4[_0x2e33('0x16')]?_0xdcb5e4[_0x2e33('0x16')][_0x2e33('0x18')]||null:null})[_0x2e33('0xa')](function(_0x215703){logger['info'](_0x2e33('0x12'),_0xdcb5e4);logger[_0x2e33('0x19')](_0x2e33('0x12'),_0xdcb5e4,JSON[_0x2e33('0xf')](_0x215703));_0x2294bb(_0x215703);})[_0x2e33('0x1a')](function(_0x3655ce){logger[_0x2e33('0x10')](_0x2e33('0x12'),_0x3655ce[_0x2e33('0x11')],_0xdcb5e4);_0x3c7743(_0x4d406d[_0x2e33('0x10')](0x1f4,_0x3655ce[_0x2e33('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 3049673..2f50474 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 _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x80ed,0x11c));var _0xd80e=function(_0x44b992,_0x1504ba){_0x44b992=_0x44b992-0x0;var _0x46ea63=_0x80ed[_0x44b992];return _0x46ea63;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router; \ No newline at end of file +var _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x10bb94,_0x1969fa){var _0x2819a1=function(_0x191c90){while(--_0x191c90){_0x10bb94['push'](_0x10bb94['shift']());}};_0x2819a1(++_0x1969fa);}(_0x4213,0x77));var _0x3421=function(_0x93787,_0x2d8513){_0x93787=_0x93787-0x0;var _0x49e18e=_0x4213[_0x93787];return _0x49e18e;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 1b14681..f1e817c 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 _0x3d04=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x2077be,_0x26136a){var _0x198bbf=function(_0x2fd7e3){while(--_0x2fd7e3){_0x2077be['push'](_0x2077be['shift']());}};_0x198bbf(++_0x26136a);}(_0x3d04,0xbe));var _0x43d0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3d04[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x43d0('0x0'));module[_0x43d0('0x1')]={'closed':{'type':Sequelize[_0x43d0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x43d0('0x3')]},'disposition':{'type':Sequelize[_0x43d0('0x4')]},'secondDisposition':{'type':Sequelize[_0x43d0('0x4')]},'thirdDisposition':{'type':Sequelize[_0x43d0('0x4')]},'note':{'type':Sequelize[_0x43d0('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x43d0('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x43d0('0x5')]('in',_0x43d0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x43d0('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x93e9=['STRING','ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x1b8569,_0x5145b4){var _0x1ad549=function(_0x2bbad){while(--_0x2bbad){_0x1b8569['push'](_0x1b8569['shift']());}};_0x1ad549(++_0x5145b4);}(_0x93e9,0xcc));var _0x993e=function(_0x230eb2,_0x397082){_0x230eb2=_0x230eb2-0x0;var _0x1c2e79=_0x93e9[_0x230eb2];return _0x1c2e79;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'closed':{'type':Sequelize[_0x993e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x993e('0x3')]},'disposition':{'type':Sequelize[_0x993e('0x4')]},'secondDisposition':{'type':Sequelize[_0x993e('0x4')]},'thirdDisposition':{'type':Sequelize[_0x993e('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x993e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x993e('0x5')]('in',_0x993e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x993e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x993e('0x5')]('in',_0x993e('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x993e('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 20b0870..f976969 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 _0xe429=['includeAll','findAll','rows','setTags','spread','color','emit','removeTags','download','unix','toString','root','server','files','tmp','join','push','Attachment','createdAt','get','mkdirSync','Messages','basename','createReadStream','resolve','log','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','send','index','type','getOptions','fax','query','user','catch','show','model','keys','FaxInteraction','attributes','intersection','fields','length','include','merge','options','find','create','body','params','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','rawAttributes','filters','order','sort','where','FaxInteractionId','filter','map','$gte','split','format'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe429,0x7d));var _0x9e42=function(_0x12e9e3,_0x260383){_0x12e9e3=_0x12e9e3-0x0;var _0x3ada04=_0xe429[_0x12e9e3];return _0x3ada04;};'use strict';var rimraf=require(_0x9e42('0x0'));var zipdir=require(_0x9e42('0x1'));var moment=require(_0x9e42('0x2'));var BPromise=require('bluebird');var util=require(_0x9e42('0x3'));var path=require(_0x9e42('0x4'));var fs=require('fs');var _=require(_0x9e42('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var logger=require(_0x9e42('0x6'))(_0x9e42('0x7'));var config=require(_0x9e42('0x8'));var db=require(_0x9e42('0x9'))['db'];config[_0x9e42('0xa')]=_[_0x9e42('0xb')](config[_0x9e42('0xa')],{'host':_0x9e42('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e42('0xa')]));require(_0x9e42('0xd'))[_0x9e42('0xe')](socket);function respondWithStatusCode(_0x455cc0,_0x530141){_0x530141=_0x530141||0xcc;return function(_0x1639c0){if(_0x1639c0){return _0x455cc0[_0x9e42('0xf')](_0x530141);}return _0x455cc0[_0x9e42('0x10')](_0x530141)[_0x9e42('0x11')]();};}function respondWithResult(_0x2900a1,_0x2966b2){_0x2966b2=_0x2966b2||0xc8;return function(_0x3d3244){if(_0x3d3244){return _0x2900a1[_0x9e42('0x10')](_0x2966b2)[_0x9e42('0x12')](_0x3d3244);}};}function respondWithFilteredResult(_0x3ee667,_0x26a144){return function(_0x23f8ec){if(_0x23f8ec){var _0x3f63c6=typeof _0x26a144[_0x9e42('0x13')]===_0x9e42('0x14')&&typeof _0x26a144[_0x9e42('0x15')]===_0x9e42('0x14');var _0x4f2748=_0x23f8ec[_0x9e42('0x16')];var _0x24d2e2=_0x3f63c6?0x0:_0x26a144[_0x9e42('0x13')];var _0x2d5dbf=_0x3f63c6?_0x23f8ec[_0x9e42('0x16')]:_0x26a144[_0x9e42('0x13')]+_0x26a144[_0x9e42('0x15')];var _0x4e8125;if(_0x2d5dbf>=_0x4f2748){_0x2d5dbf=_0x4f2748;_0x4e8125=0xc8;}else{_0x4e8125=0xce;}_0x3ee667[_0x9e42('0x10')](_0x4e8125);return _0x3ee667[_0x9e42('0x17')]('Content-Range',_0x24d2e2+'-'+_0x2d5dbf+'/'+_0x4f2748)[_0x9e42('0x12')](_0x23f8ec);}return null;};}function saveUpdates(_0x1cf5ec){return function(_0x7d5291){if(_0x7d5291){return _0x7d5291[_0x9e42('0x18')](_0x1cf5ec)[_0x9e42('0x19')](function(_0x30008f){return _0x30008f;});}return null;};}function removeEntity(_0xe38413){return function(_0x379ef9){if(_0x379ef9){return _0x379ef9[_0x9e42('0x1a')]()[_0x9e42('0x19')](function(){_0xe38413[_0x9e42('0x10')](0xcc)[_0x9e42('0x11')]();});}};}function handleEntityNotFound(_0x58a0a2){return function(_0x10ef08){if(!_0x10ef08){_0x58a0a2['sendStatus'](0x194);}return _0x10ef08;};}function handleError(_0x2c838f,_0x589bc5){_0x589bc5=_0x589bc5||0x1f4;return function(_0x544c37){logger[_0x9e42('0x1b')](_0x544c37[_0x9e42('0x1c')]);if(_0x544c37['name']){delete _0x544c37[_0x9e42('0x1d')];}_0x2c838f[_0x9e42('0x10')](_0x589bc5)[_0x9e42('0x1e')](_0x544c37);};}exports[_0x9e42('0x1f')]=function(_0x2e05b8,_0x5b44f7){var _0x1d195b={};var _0x12b663=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x4beffd){return{'name':_0x4beffd['fieldName'],'type':_0x4beffd[_0x9e42('0x20')]['key']};});_0x1d195b=qs[_0x9e42('0x21')](_0x12b663,_0x2e05b8);return interaction['findAll'](_0x9e42('0x22'),_0x2e05b8[_0x9e42('0x23')],_0x2e05b8[_0x9e42('0x24')],_0x1d195b,_0x12b663)[_0x9e42('0x19')](respondWithFilteredResult(_0x5b44f7,_0x1d195b))[_0x9e42('0x25')](handleError(_0x5b44f7,null));};exports[_0x9e42('0x26')]=function(_0x196193,_0x2d17e0){var _0x18fd13={'raw':![],'where':{'id':_0x196193['params']['id']}},_0x8a2572={};_0x8a2572[_0x9e42('0x27')]=_[_0x9e42('0x28')](db[_0x9e42('0x29')]['rawAttributes']);_0x8a2572[_0x9e42('0x23')]=_[_0x9e42('0x28')](_0x196193[_0x9e42('0x23')]);_0x8a2572['filters']=_['intersection'](_0x8a2572[_0x9e42('0x27')],_0x8a2572['query']);_0x18fd13[_0x9e42('0x2a')]=_[_0x9e42('0x2b')](_0x8a2572[_0x9e42('0x27')],qs[_0x9e42('0x2c')](_0x196193['query']['fields']));_0x18fd13['attributes']=_0x18fd13['attributes'][_0x9e42('0x2d')]?_0x18fd13[_0x9e42('0x2a')]:_0x8a2572[_0x9e42('0x27')];if(_0x196193[_0x9e42('0x23')]['includeAll']){_0x18fd13[_0x9e42('0x2e')]=[{'all':!![]}];}_0x18fd13=_[_0x9e42('0x2f')]({},_0x18fd13,_0x196193[_0x9e42('0x30')]);return db[_0x9e42('0x29')][_0x9e42('0x31')](_0x18fd13)[_0x9e42('0x19')](handleEntityNotFound(_0x2d17e0,null))['then'](respondWithResult(_0x2d17e0,null))['catch'](handleError(_0x2d17e0,null));};exports[_0x9e42('0x32')]=function(_0x35b5f6,_0x4df9c8){return db['FaxInteraction']['create'](_0x35b5f6[_0x9e42('0x33')],{})[_0x9e42('0x19')](respondWithResult(_0x4df9c8,0xc9))[_0x9e42('0x25')](handleError(_0x4df9c8,null));};exports[_0x9e42('0x18')]=function(_0x1f2f8d,_0x246510){if(_0x1f2f8d[_0x9e42('0x33')]['id']){delete _0x1f2f8d[_0x9e42('0x33')]['id'];}return db[_0x9e42('0x29')]['find']({'where':{'id':_0x1f2f8d[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x246510,null))[_0x9e42('0x19')](saveUpdates(_0x1f2f8d[_0x9e42('0x33')],null))[_0x9e42('0x19')](respondWithResult(_0x246510,null))[_0x9e42('0x25')](handleError(_0x246510,null));};exports[_0x9e42('0x1a')]=function(_0x24927b,_0xeb4675){return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0x24927b['params']['id']}})['then'](handleEntityNotFound(_0xeb4675,null))[_0x9e42('0x19')](removeEntity(_0xeb4675,null))['catch'](handleError(_0xeb4675,null));};exports[_0x9e42('0x35')]=function(_0x3b2b55,_0x384f28){return db[_0x9e42('0x29')][_0x9e42('0x35')]()[_0x9e42('0x19')](respondWithResult(_0x384f28,null))[_0x9e42('0x25')](handleError(_0x384f28,null));};exports[_0x9e42('0x36')]=function(_0x1f76c8,_0x125803){return db[_0x9e42('0x37')][_0x9e42('0x31')]({'where':{'id':_0x1f76c8[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x125803,null))[_0x9e42('0x19')](function(_0x2ec8dd){if(_0x2ec8dd){return _0x2ec8dd[_0x9e42('0x36')](_0x1f76c8[_0x9e42('0x33')]['ids'],_[_0x9e42('0x38')](_0x1f76c8[_0x9e42('0x33')],[_0x9e42('0x39'),'id'])||{});}})['then'](respondWithResult(_0x125803,null))[_0x9e42('0x25')](handleError(_0x125803,null));};exports[_0x9e42('0x3a')]=function(_0x35d9f5,_0x253262){var _0x43aae3={'raw':![],'where':{}};var _0x385f84={};var _0x3b3e73={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x9e42('0x3b')]({'where':{'id':_0x35d9f5['params']['id']}})['then'](handleEntityNotFound(_0x253262,null))[_0x9e42('0x19')](function(_0x136c7e){if(_0x136c7e){_0x385f84[_0x9e42('0x27')]=_[_0x9e42('0x28')](db[_0x9e42('0x37')][_0x9e42('0x3c')]);_0x385f84['query']=_[_0x9e42('0x28')](_0x35d9f5[_0x9e42('0x23')]);_0x385f84[_0x9e42('0x3d')]=_['intersection'](_0x385f84[_0x9e42('0x27')],_0x385f84[_0x9e42('0x23')]);_0x43aae3[_0x9e42('0x2a')]=_['intersection'](_0x385f84['model'],qs['fields'](_0x35d9f5['query']['fields']));_0x43aae3[_0x9e42('0x2a')]=_0x43aae3['attributes'][_0x9e42('0x2d')]?_0x43aae3[_0x9e42('0x2a')]:_0x385f84[_0x9e42('0x27')];if(!_0x35d9f5[_0x9e42('0x23')]['hasOwnProperty']('nolimit')){_0x43aae3[_0x9e42('0x15')]=qs[_0x9e42('0x15')](_0x35d9f5['query'][_0x9e42('0x15')]);_0x43aae3[_0x9e42('0x13')]=qs['offset'](_0x35d9f5[_0x9e42('0x23')]['offset']);}_0x43aae3[_0x9e42('0x3e')]=qs[_0x9e42('0x3f')](_0x35d9f5[_0x9e42('0x23')]['sort']);_0x43aae3['where']=qs[_0x9e42('0x3d')](_['pick'](_0x35d9f5[_0x9e42('0x23')],_0x385f84['filters']));_0x43aae3[_0x9e42('0x40')][_0x9e42('0x41')]=_0x136c7e['id'];if(_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x42')]){_0x43aae3[_0x9e42('0x40')]=_[_0x9e42('0x2f')](_0x43aae3[_0x9e42('0x40')],{'$or':_[_0x9e42('0x43')](_0x43aae3[_0x9e42('0x2a')],function(_0x1414c7){var _0x3c4e20={};_0x3c4e20[_0x1414c7]={'$like':'%'+_0x35d9f5['query'][_0x9e42('0x42')]+'%'};return _0x3c4e20;})});}if(_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x44')]){var _0x2a6a40=_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x44')][_0x9e42('0x45')](',');var _0x40f63f={};_0x40f63f[_0x2a6a40[0x0]]={'$gte':moment(_0x2a6a40[0x1])[_0x9e42('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x43aae3[_0x9e42('0x40')]=_[_0x9e42('0x2f')](_0x43aae3[_0x9e42('0x40')],_0x40f63f);}_0x43aae3=_[_0x9e42('0x2f')]({},_0x43aae3,_0x35d9f5[_0x9e42('0x30')]);return db[_0x9e42('0x37')][_0x9e42('0x16')]({'where':_0x43aae3['where']})[_0x9e42('0x19')](function(_0x109d8d){_0x3b3e73[_0x9e42('0x16')]=_0x109d8d;if(_0x35d9f5[_0x9e42('0x23')][_0x9e42('0x47')]){_0x43aae3[_0x9e42('0x2e')]=[{'all':!![]}];}return db[_0x9e42('0x37')][_0x9e42('0x48')](_0x43aae3);})['then'](function(_0x312b4f){_0x3b3e73[_0x9e42('0x49')]=_0x312b4f;return _0x3b3e73;});}})['then'](respondWithFilteredResult(_0x253262,_0x43aae3))['catch'](handleError(_0x253262,null));};exports['addTags']=function(_0x3141c6,_0x2258d2){return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0x3141c6[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x2258d2,null))['then'](function(_0xa859a0){if(_0xa859a0){return _0xa859a0[_0x9e42('0x4a')](_0x3141c6['body']['ids'],_['omit'](_0x3141c6[_0x9e42('0x33')],['ids','id'])||{})[_0x9e42('0x4b')](function(){return db['Tag'][_0x9e42('0x48')]({'attributes':['id',_0x9e42('0x1d'),_0x9e42('0x4c')],'where':{'id':_0x3141c6[_0x9e42('0x33')][_0x9e42('0x39')]}});})[_0x9e42('0x19')](function(_0x5e23c7){socket[_0x9e42('0x4d')]('faxInteractionTags:save',{'id':Number(_0x3141c6['params']['id']),'tags':_0x5e23c7||[]});return{'id':Number(_0x3141c6['params']['id']),'tags':_0x5e23c7||[]};});}})[_0x9e42('0x19')](respondWithResult(_0x2258d2,null))[_0x9e42('0x25')](handleError(_0x2258d2,null));};exports[_0x9e42('0x4e')]=function(_0xa7a756,_0x3d6410){return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0xa7a756[_0x9e42('0x34')]['id']}})[_0x9e42('0x19')](handleEntityNotFound(_0x3d6410,null))[_0x9e42('0x19')](function(_0x1ade19){if(_0x1ade19){return _0x1ade19[_0x9e42('0x4e')](_0xa7a756[_0x9e42('0x23')][_0x9e42('0x39')]);}})['then'](respondWithStatusCode(_0x3d6410,null))[_0x9e42('0x25')](handleError(_0x3d6410,null));};exports[_0x9e42('0x4f')]=function(_0x570fd9,_0x2dad87){var _0x407e61=moment()[_0x9e42('0x50')]()[_0x9e42('0x51')]();var _0x3de3ea=path['join'](config[_0x9e42('0x52')],_0x9e42('0x53'),_0x9e42('0x54'),_0x9e42('0x55'));var _0x29ba2f=path[_0x9e42('0x56')](config[_0x9e42('0x52')],_0x9e42('0x53'),'files','attachments');var _0x356610=path['join'](_0x3de3ea,_0x407e61);var _0x1bb775=util[_0x9e42('0x46')]('transcript-%d-%s.zip',_0x570fd9[_0x9e42('0x34')]['id'],_0x407e61);var _0x1ab8f4=path['join'](_0x3de3ea,_0x1bb775);var _0x259d3c=[];_0x259d3c[_0x9e42('0x57')]({'model':db[_0x9e42('0x58')],'as':_0x9e42('0x58'),'raw':!![]});var _0x113846=[{'model':db[_0x9e42('0x37')],'as':'Messages','attributes':['id',_0x9e42('0x33'),_0x9e42('0x59')],'include':_0x259d3c}];return db['FaxInteraction'][_0x9e42('0x31')]({'where':{'id':_0x570fd9[_0x9e42('0x34')]['id']},'include':_0x113846})[_0x9e42('0x19')](handleEntityNotFound(_0x2dad87,null))[_0x9e42('0x19')](function(_0x340c3a){if(_0x340c3a&&_0x340c3a['Messages']){var _0x129d95=_0x340c3a[_0x9e42('0x5a')]({'plain':!![]});fs[_0x9e42('0x5b')](_0x356610);for(var _0x1a3784=0x0;_0x1a3784<_0x129d95[_0x9e42('0x5c')][_0x9e42('0x2d')];_0x1a3784++){var _0x45db80=_0x129d95['Messages'][_0x1a3784]['Attachment'];if(_0x45db80){var _0xab2434=path['join'](_0x29ba2f,_0x45db80[_0x9e42('0x5d')]);if(fs['existsSync'](_0xab2434)){fs[_0x9e42('0x5e')](_0xab2434)['pipe'](fs['createWriteStream'](path[_0x9e42('0x56')](_0x356610,_0x45db80['basename'])));}}}return BPromise[_0x9e42('0x5f')]()['then'](function(){return new BPromise(function(_0x34d345,_0x396e0d){zipdir(_0x356610,{'saveTo':_0x1ab8f4},function(_0xb16e3d,_0x27fa6d){if(_0xb16e3d)return _0x396e0d(_0xb16e3d);return _0x34d345(_0x27fa6d);});})[_0x9e42('0x19')](function(){return new BPromise(function(_0x2b1eb0,_0xa7359c){rimraf(_0x356610,function(_0x5e8622){if(_0x5e8622)_0xa7359c(_0x5e8622);return _0x2b1eb0();});});})[_0x9e42('0x19')](function(){return _0x2dad87['download'](_0x1ab8f4,_0x1bb775,function(_0x1119f8){if(_0x1119f8){console[_0x9e42('0x60')]('err',_0x1119f8);}else{fs[_0x9e42('0x61')](_0x1ab8f4);}});});});}else{return _0x2dad87[_0x9e42('0xf')](0xc8);}})['catch'](handleError(_0x2dad87,null));}; \ No newline at end of file +var _0xb9bc=['download','err','unlinkSync','rimraf','zip-dir','util','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','count','set','json','update','then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','fax','query','catch','model','intersection','fields','attributes','length','includeAll','include','merge','options','create','body','find','params','describe','addMessage','FaxMessage','ids','omit','getMessages','keys','filters','hasOwnProperty','nolimit','offset','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','unix','toString','join','root','tmp','files','attachments','push','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','resolve'];(function(_0x12f3b3,_0x31a429){var _0xd8cd5b=function(_0x5e6444){while(--_0x5e6444){_0x12f3b3['push'](_0x12f3b3['shift']());}};_0xd8cd5b(++_0x31a429);}(_0xb9bc,0x197));var _0xcb9b=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0xb9bc[_0x502953];return _0x2fa32d;};'use strict';var rimraf=require(_0xcb9b('0x0'));var zipdir=require(_0xcb9b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xcb9b('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var Redis=require(_0xcb9b('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0xcb9b('0x4'));var logger=require('../../config/logger')('api');var config=require(_0xcb9b('0x5'));var db=require(_0xcb9b('0x6'))['db'];config[_0xcb9b('0x7')]=_[_0xcb9b('0x8')](config[_0xcb9b('0x7')],{'host':_0xcb9b('0x9'),'port':0x18eb});var socket=require(_0xcb9b('0xa'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xcb9b('0xb')](socket);function respondWithStatusCode(_0x2fa10b,_0x18e111){_0x18e111=_0x18e111||0xcc;return function(_0x5bde24){if(_0x5bde24){return _0x2fa10b[_0xcb9b('0xc')](_0x18e111);}return _0x2fa10b[_0xcb9b('0xd')](_0x18e111)[_0xcb9b('0xe')]();};}function respondWithResult(_0x6829fe,_0x109341){_0x109341=_0x109341||0xc8;return function(_0x3c6040){if(_0x3c6040){return _0x6829fe[_0xcb9b('0xd')](_0x109341)['json'](_0x3c6040);}};}function respondWithFilteredResult(_0x12095b,_0x53fd12){return function(_0x530b58){if(_0x530b58){var _0xd9631a=typeof _0x53fd12['offset']===_0xcb9b('0xf')&&typeof _0x53fd12[_0xcb9b('0x10')]===_0xcb9b('0xf');var _0x57716a=_0x530b58[_0xcb9b('0x11')];var _0x265c3f=_0xd9631a?0x0:_0x53fd12['offset'];var _0x39fb01=_0xd9631a?_0x530b58[_0xcb9b('0x11')]:_0x53fd12['offset']+_0x53fd12[_0xcb9b('0x10')];var _0x5d2a9e;if(_0x39fb01>=_0x57716a){_0x39fb01=_0x57716a;_0x5d2a9e=0xc8;}else{_0x5d2a9e=0xce;}_0x12095b[_0xcb9b('0xd')](_0x5d2a9e);return _0x12095b[_0xcb9b('0x12')]('Content-Range',_0x265c3f+'-'+_0x39fb01+'/'+_0x57716a)[_0xcb9b('0x13')](_0x530b58);}return null;};}function saveUpdates(_0x2a52ea){return function(_0x232ea2){if(_0x232ea2){return _0x232ea2[_0xcb9b('0x14')](_0x2a52ea)[_0xcb9b('0x15')](function(_0xe6255c){return _0xe6255c;});}return null;};}function removeEntity(_0x140013){return function(_0x10ff73){if(_0x10ff73){return _0x10ff73[_0xcb9b('0x16')]()['then'](function(){_0x140013['status'](0xcc)[_0xcb9b('0xe')]();});}};}function handleEntityNotFound(_0x24a727){return function(_0x2b2e0b){if(!_0x2b2e0b){_0x24a727[_0xcb9b('0xc')](0x194);}return _0x2b2e0b;};}function handleError(_0x44a951,_0x43738e){_0x43738e=_0x43738e||0x1f4;return function(_0x41097d){logger[_0xcb9b('0x17')](_0x41097d[_0xcb9b('0x18')]);if(_0x41097d[_0xcb9b('0x19')]){delete _0x41097d[_0xcb9b('0x19')];}_0x44a951['status'](_0x43738e)[_0xcb9b('0x1a')](_0x41097d);};}exports[_0xcb9b('0x1b')]=function(_0x15e369,_0x30b138){var _0x957d77={};var _0xba3bd9=_[_0xcb9b('0x1c')](db[_0xcb9b('0x1d')][_0xcb9b('0x1e')],function(_0x110f2b){return{'name':_0x110f2b[_0xcb9b('0x1f')],'type':_0x110f2b[_0xcb9b('0x20')][_0xcb9b('0x21')]};});_0x957d77=qs[_0xcb9b('0x22')](_0xba3bd9,_0x15e369);return interaction['findAll'](_0xcb9b('0x23'),_0x15e369[_0xcb9b('0x24')],_0x15e369['user'],_0x957d77,_0xba3bd9)[_0xcb9b('0x15')](respondWithFilteredResult(_0x30b138,_0x957d77))[_0xcb9b('0x25')](handleError(_0x30b138,null));};exports['show']=function(_0x90ddc4,_0x503b0c){var _0x28bfc9={'raw':![],'where':{'id':_0x90ddc4['params']['id']}},_0x3632ae={};_0x3632ae[_0xcb9b('0x26')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x3632ae[_0xcb9b('0x24')]=_['keys'](_0x90ddc4['query']);_0x3632ae['filters']=_['intersection'](_0x3632ae[_0xcb9b('0x26')],_0x3632ae[_0xcb9b('0x24')]);_0x28bfc9['attributes']=_[_0xcb9b('0x27')](_0x3632ae[_0xcb9b('0x26')],qs['fields'](_0x90ddc4[_0xcb9b('0x24')][_0xcb9b('0x28')]));_0x28bfc9[_0xcb9b('0x29')]=_0x28bfc9['attributes'][_0xcb9b('0x2a')]?_0x28bfc9[_0xcb9b('0x29')]:_0x3632ae['model'];if(_0x90ddc4[_0xcb9b('0x24')][_0xcb9b('0x2b')]){_0x28bfc9[_0xcb9b('0x2c')]=[{'all':!![]}];}_0x28bfc9=_[_0xcb9b('0x2d')]({},_0x28bfc9,_0x90ddc4[_0xcb9b('0x2e')]);return db['FaxInteraction']['find'](_0x28bfc9)[_0xcb9b('0x15')](handleEntityNotFound(_0x503b0c,null))['then'](respondWithResult(_0x503b0c,null))[_0xcb9b('0x25')](handleError(_0x503b0c,null));};exports[_0xcb9b('0x2f')]=function(_0x4b7c14,_0x141c35){return db[_0xcb9b('0x1d')][_0xcb9b('0x2f')](_0x4b7c14[_0xcb9b('0x30')],{})[_0xcb9b('0x15')](respondWithResult(_0x141c35,0xc9))[_0xcb9b('0x25')](handleError(_0x141c35,null));};exports[_0xcb9b('0x14')]=function(_0x2d7308,_0x23498e){if(_0x2d7308[_0xcb9b('0x30')]['id']){delete _0x2d7308[_0xcb9b('0x30')]['id'];}return db[_0xcb9b('0x1d')][_0xcb9b('0x31')]({'where':{'id':_0x2d7308[_0xcb9b('0x32')]['id']}})[_0xcb9b('0x15')](handleEntityNotFound(_0x23498e,null))['then'](saveUpdates(_0x2d7308[_0xcb9b('0x30')],null))[_0xcb9b('0x15')](respondWithResult(_0x23498e,null))[_0xcb9b('0x25')](handleError(_0x23498e,null));};exports[_0xcb9b('0x16')]=function(_0x2f8fcd,_0x45601a){return db['FaxInteraction'][_0xcb9b('0x31')]({'where':{'id':_0x2f8fcd[_0xcb9b('0x32')]['id']}})[_0xcb9b('0x15')](handleEntityNotFound(_0x45601a,null))[_0xcb9b('0x15')](removeEntity(_0x45601a,null))['catch'](handleError(_0x45601a,null));};exports[_0xcb9b('0x33')]=function(_0x4db17a,_0x14e98a){return db['FaxInteraction']['describe']()[_0xcb9b('0x15')](respondWithResult(_0x14e98a,null))[_0xcb9b('0x25')](handleError(_0x14e98a,null));};exports[_0xcb9b('0x34')]=function(_0x4fb8f9,_0x107ee1){return db[_0xcb9b('0x35')][_0xcb9b('0x31')]({'where':{'id':_0x4fb8f9[_0xcb9b('0x32')]['id']}})[_0xcb9b('0x15')](handleEntityNotFound(_0x107ee1,null))['then'](function(_0x3a17bc){if(_0x3a17bc){return _0x3a17bc[_0xcb9b('0x34')](_0x4fb8f9[_0xcb9b('0x30')][_0xcb9b('0x36')],_[_0xcb9b('0x37')](_0x4fb8f9['body'],['ids','id'])||{});}})[_0xcb9b('0x15')](respondWithResult(_0x107ee1,null))[_0xcb9b('0x25')](handleError(_0x107ee1,null));};exports[_0xcb9b('0x38')]=function(_0x5b8cdc,_0x48a436){var _0x232a49={'raw':![],'where':{}};var _0x2b07c9={};var _0x1b3a99={'count':0x0,'rows':[]};return db[_0xcb9b('0x1d')]['findOne']({'where':{'id':_0x5b8cdc['params']['id']}})['then'](handleEntityNotFound(_0x48a436,null))[_0xcb9b('0x15')](function(_0x13056f){if(_0x13056f){_0x2b07c9[_0xcb9b('0x26')]=_[_0xcb9b('0x39')](db[_0xcb9b('0x35')][_0xcb9b('0x1e')]);_0x2b07c9['query']=_[_0xcb9b('0x39')](_0x5b8cdc[_0xcb9b('0x24')]);_0x2b07c9[_0xcb9b('0x3a')]=_[_0xcb9b('0x27')](_0x2b07c9[_0xcb9b('0x26')],_0x2b07c9['query']);_0x232a49['attributes']=_[_0xcb9b('0x27')](_0x2b07c9[_0xcb9b('0x26')],qs[_0xcb9b('0x28')](_0x5b8cdc[_0xcb9b('0x24')][_0xcb9b('0x28')]));_0x232a49[_0xcb9b('0x29')]=_0x232a49[_0xcb9b('0x29')]['length']?_0x232a49[_0xcb9b('0x29')]:_0x2b07c9[_0xcb9b('0x26')];if(!_0x5b8cdc[_0xcb9b('0x24')][_0xcb9b('0x3b')](_0xcb9b('0x3c'))){_0x232a49[_0xcb9b('0x10')]=qs[_0xcb9b('0x10')](_0x5b8cdc[_0xcb9b('0x24')]['limit']);_0x232a49[_0xcb9b('0x3d')]=qs[_0xcb9b('0x3d')](_0x5b8cdc[_0xcb9b('0x24')]['offset']);}_0x232a49[_0xcb9b('0x3e')]=qs[_0xcb9b('0x3f')](_0x5b8cdc['query'][_0xcb9b('0x3f')]);_0x232a49[_0xcb9b('0x40')]=qs[_0xcb9b('0x3a')](_['pick'](_0x5b8cdc[_0xcb9b('0x24')],_0x2b07c9['filters']));_0x232a49[_0xcb9b('0x40')][_0xcb9b('0x41')]=_0x13056f['id'];if(_0x5b8cdc[_0xcb9b('0x24')][_0xcb9b('0x42')]){_0x232a49[_0xcb9b('0x40')]=_[_0xcb9b('0x2d')](_0x232a49['where'],{'$or':_[_0xcb9b('0x1c')](_0x232a49[_0xcb9b('0x29')],function(_0x247e3c){var _0x617f78={};_0x617f78[_0x247e3c]={'$like':'%'+_0x5b8cdc[_0xcb9b('0x24')][_0xcb9b('0x42')]+'%'};return _0x617f78;})});}if(_0x5b8cdc[_0xcb9b('0x24')][_0xcb9b('0x43')]){var _0x14d1da=_0x5b8cdc[_0xcb9b('0x24')]['$gte'][_0xcb9b('0x44')](',');var _0x327476={};_0x327476[_0x14d1da[0x0]]={'$gte':moment(_0x14d1da[0x1])[_0xcb9b('0x45')](_0xcb9b('0x46'))};_0x232a49[_0xcb9b('0x40')]=_[_0xcb9b('0x2d')](_0x232a49[_0xcb9b('0x40')],_0x327476);}_0x232a49=_[_0xcb9b('0x2d')]({},_0x232a49,_0x5b8cdc[_0xcb9b('0x2e')]);return db[_0xcb9b('0x35')][_0xcb9b('0x11')]({'where':_0x232a49[_0xcb9b('0x40')]})['then'](function(_0x2b6f09){_0x1b3a99['count']=_0x2b6f09;if(_0x5b8cdc[_0xcb9b('0x24')][_0xcb9b('0x2b')]){_0x232a49['include']=[{'all':!![]}];}return db[_0xcb9b('0x35')][_0xcb9b('0x47')](_0x232a49);})['then'](function(_0x1dce1a){_0x1b3a99[_0xcb9b('0x48')]=_0x1dce1a;return _0x1b3a99;});}})[_0xcb9b('0x15')](respondWithFilteredResult(_0x48a436,_0x232a49))[_0xcb9b('0x25')](handleError(_0x48a436,null));};exports[_0xcb9b('0x49')]=function(_0x172768,_0x2b13bc){return db[_0xcb9b('0x1d')][_0xcb9b('0x31')]({'where':{'id':_0x172768[_0xcb9b('0x32')]['id']}})[_0xcb9b('0x15')](handleEntityNotFound(_0x2b13bc,null))[_0xcb9b('0x15')](function(_0x3829e2){if(_0x3829e2){return _0x3829e2[_0xcb9b('0x4a')](_0x172768[_0xcb9b('0x30')][_0xcb9b('0x36')],_[_0xcb9b('0x37')](_0x172768[_0xcb9b('0x30')],[_0xcb9b('0x36'),'id'])||{})[_0xcb9b('0x4b')](function(){return db[_0xcb9b('0x4c')][_0xcb9b('0x47')]({'attributes':['id',_0xcb9b('0x19'),_0xcb9b('0x4d')],'where':{'id':_0x172768['body']['ids']}});})[_0xcb9b('0x15')](function(_0x1e42aa){socket[_0xcb9b('0x4e')](_0xcb9b('0x4f'),{'id':Number(_0x172768[_0xcb9b('0x32')]['id']),'tags':_0x1e42aa||[]});return{'id':Number(_0x172768[_0xcb9b('0x32')]['id']),'tags':_0x1e42aa||[]};});}})['then'](respondWithResult(_0x2b13bc,null))[_0xcb9b('0x25')](handleError(_0x2b13bc,null));};exports[_0xcb9b('0x50')]=function(_0x7ed531,_0x1596f3){return db[_0xcb9b('0x1d')][_0xcb9b('0x31')]({'where':{'id':_0x7ed531['params']['id']}})['then'](handleEntityNotFound(_0x1596f3,null))[_0xcb9b('0x15')](function(_0xc50126){if(_0xc50126){return _0xc50126[_0xcb9b('0x50')](_0x7ed531[_0xcb9b('0x24')][_0xcb9b('0x36')]);}})[_0xcb9b('0x15')](respondWithStatusCode(_0x1596f3,null))['catch'](handleError(_0x1596f3,null));};exports['download']=function(_0x3acd09,_0x1f1346){var _0x57dc20=moment()[_0xcb9b('0x51')]()[_0xcb9b('0x52')]();var _0x1a9646=path[_0xcb9b('0x53')](config[_0xcb9b('0x54')],'server','files',_0xcb9b('0x55'));var _0x598a24=path['join'](config['root'],'server',_0xcb9b('0x56'),_0xcb9b('0x57'));var _0x8a5e27=path[_0xcb9b('0x53')](_0x1a9646,_0x57dc20);var _0x2be47f=util['format']('transcript-%d-%s.zip',_0x3acd09[_0xcb9b('0x32')]['id'],_0x57dc20);var _0x47ea5c=path[_0xcb9b('0x53')](_0x1a9646,_0x2be47f);var _0x201ffb=[];_0x201ffb[_0xcb9b('0x58')]({'model':db[_0xcb9b('0x59')],'as':_0xcb9b('0x59'),'raw':!![]});var _0x2fa965=[{'model':db['FaxMessage'],'as':_0xcb9b('0x5a'),'attributes':['id',_0xcb9b('0x30'),_0xcb9b('0x5b')],'include':_0x201ffb}];return db[_0xcb9b('0x1d')]['find']({'where':{'id':_0x3acd09[_0xcb9b('0x32')]['id']},'include':_0x2fa965})[_0xcb9b('0x15')](handleEntityNotFound(_0x1f1346,null))[_0xcb9b('0x15')](function(_0x2b50f9){if(_0x2b50f9&&_0x2b50f9[_0xcb9b('0x5a')]){var _0x2971cc=_0x2b50f9[_0xcb9b('0x5c')]({'plain':!![]});fs[_0xcb9b('0x5d')](_0x8a5e27);for(var _0x31d981=0x0;_0x31d981<_0x2971cc[_0xcb9b('0x5a')][_0xcb9b('0x2a')];_0x31d981++){var _0x1910b1=_0x2971cc[_0xcb9b('0x5a')][_0x31d981][_0xcb9b('0x59')];if(_0x1910b1){var _0x493f23=path[_0xcb9b('0x53')](_0x598a24,_0x1910b1[_0xcb9b('0x5e')]);if(fs['existsSync'](_0x493f23)){fs[_0xcb9b('0x5f')](_0x493f23)[_0xcb9b('0x60')](fs['createWriteStream'](path['join'](_0x8a5e27,_0x1910b1['basename'])));}}}return BPromise[_0xcb9b('0x61')]()[_0xcb9b('0x15')](function(){return new BPromise(function(_0x1594c7,_0x1ec517){zipdir(_0x8a5e27,{'saveTo':_0x47ea5c},function(_0x59143e,_0x1890de){if(_0x59143e)return _0x1ec517(_0x59143e);return _0x1594c7(_0x1890de);});})[_0xcb9b('0x15')](function(){return new BPromise(function(_0x30f24f,_0x4820f9){rimraf(_0x8a5e27,function(_0xd4403a){if(_0xd4403a)_0x4820f9(_0xd4403a);return _0x30f24f();});});})[_0xcb9b('0x15')](function(){return _0x1f1346[_0xcb9b('0x62')](_0x47ea5c,_0x2be47f,function(_0x353c75){if(_0x353c75){console['log'](_0xcb9b('0x63'),_0x353c75);}else{fs[_0xcb9b('0x64')](_0x47ea5c);}});});});}else{return _0x1f1346['sendStatus'](0xc8);}})[_0xcb9b('0x25')](handleError(_0x1f1346,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 0419659..1a3f24a 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 _0x00d3=['findAll','setDataValue','unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','remove','then','Users','map'];(function(_0xbbc1b,_0x4667c7){var _0x49de02=function(_0x115f1c){while(--_0x115f1c){_0xbbc1b['push'](_0xbbc1b['shift']());}};_0x49de02(++_0x4667c7);}(_0x00d3,0x106));var _0x300d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00d3[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x300d('0x0'));var FaxInteraction=require(_0x300d('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x300d('0x1'))['db'][_0x300d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x300d('0x3'),'afterUpdate':'update','afterDestroy':_0x300d('0x4')};function emitEvent(_0x1da4a7){return function(_0x495bc8,_0x4cbae8,_0x26fbd1){_0x495bc8['getUsers']({'attributes':['id'],'raw':!![]})[_0x300d('0x5')](function(_0x4fbfe9){_0x495bc8['setDataValue'](_0x300d('0x6'),_0x4fbfe9[_0x300d('0x7')](function(_0x4e35af){return{'id':_0x4e35af['id']};}));return FaxMessage[_0x300d('0x8')]({'where':{'FaxInteractionId':_0x495bc8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x300d('0x5')](function(_0xbfe5a2){_0x495bc8[_0x300d('0x9')](_0x300d('0xa'),_0xbfe5a2[_0x300d('0xb')]);FaxInteractionEvents['emit'](_0x1da4a7+':'+_0x495bc8['id'],_0x495bc8);FaxInteractionEvents['emit'](_0x1da4a7,_0x495bc8);_0x26fbd1(null);})['catch'](_0x26fbd1(null));};}for(var e in events){if(events[_0x300d('0xc')](e)){var event=events[e];FaxInteraction[_0x300d('0xd')](e,emitEvent(event));}}module[_0x300d('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0xcf4a=['events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','catch','hasOwnProperty','hook'];(function(_0x36c551,_0x1fa198){var _0x988e08=function(_0x362d0c){while(--_0x362d0c){_0x36c551['push'](_0x36c551['shift']());}};_0x988e08(++_0x1fa198);}(_0xcf4a,0x1b3));var _0xacf4=function(_0x372d83,_0x4ea7c8){_0x372d83=_0x372d83-0x0;var _0x3c28d9=_0xcf4a[_0x372d83];return _0x3c28d9;};'use strict';var EventEmitter=require(_0xacf4('0x0'));var FaxInteraction=require(_0xacf4('0x1'))['db'][_0xacf4('0x2')];var FaxMessage=require(_0xacf4('0x1'))['db'][_0xacf4('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xacf4('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xacf4('0x5'),'afterDestroy':_0xacf4('0x6')};function emitEvent(_0x5181f7){return function(_0x3fe5fe,_0x2cb04d,_0x17fd5f){_0x3fe5fe[_0xacf4('0x7')]({'attributes':['id'],'raw':!![]})[_0xacf4('0x8')](function(_0x24089c){_0x3fe5fe[_0xacf4('0x9')](_0xacf4('0xa'),_0x24089c[_0xacf4('0xb')](function(_0x4d8a09){return{'id':_0x4d8a09['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x3fe5fe['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4fa2d5){_0x3fe5fe[_0xacf4('0x9')]('unreadMessages',_0x4fa2d5['length']);FaxInteractionEvents['emit'](_0x5181f7+':'+_0x3fe5fe['id'],_0x3fe5fe);FaxInteractionEvents['emit'](_0x5181f7,_0x3fe5fe);_0x17fd5f(null);})[_0xacf4('0xc')](_0x17fd5f(null));};}for(var e in events){if(events[_0xacf4('0xd')](e)){var event=events[e];FaxInteraction[_0xacf4('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index c9ca8bc..ec5e08d 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 _0x69a0=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x10eb59,_0x3f9bc4){var _0x3f0cff=function(_0x2198d6){while(--_0x2198d6){_0x10eb59['push'](_0x10eb59['shift']());}};_0x3f0cff(++_0x3f9bc4);}(_0x69a0,0x181));var _0x069a=function(_0x32ebee,_0xf5e41b){_0x32ebee=_0x32ebee-0x0;var _0x394447=_0x69a0[_0x32ebee];return _0x394447;};'use strict';var _=require(_0x069a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x069a('0x1'));var BPromise=require(_0x069a('0x2'));var rp=require(_0x069a('0x3'));var fs=require('fs');var path=require(_0x069a('0x4'));var rimraf=require(_0x069a('0x5'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x069a('0x6')]=function(_0x276163,_0x15b82e){return _0x276163['define'](_0x069a('0x7'),attributes,{'tableName':_0x069a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x415ac3,_0x4a61e2,_0xd3cb95){if(_0x415ac3[_0x069a('0x9')](_0x069a('0xa'))){_0x415ac3[_0x069a('0xb')]=moment()[_0x069a('0xc')](_0x069a('0xd'));}_0xd3cb95(null,_0x415ac3);}}});}; \ No newline at end of file +var _0xe944=['exports','define','FaxInteraction','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','request-promise','../../config/environment','./faxInteraction.attributes'];(function(_0xa7429c,_0x3f6c95){var _0x57aacc=function(_0x276abe){while(--_0x276abe){_0xa7429c['push'](_0xa7429c['shift']());}};_0x57aacc(++_0x3f6c95);}(_0xe944,0x174));var _0x4e94=function(_0x2b6eb8,_0x1b1712){_0x2b6eb8=_0x2b6eb8-0x0;var _0x4325a2=_0xe944[_0x2b6eb8];return _0x4325a2;};'use strict';var _=require(_0x4e94('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4e94('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4e94('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4e94('0x3'));var attributes=require(_0x4e94('0x4'));module[_0x4e94('0x5')]=function(_0xbb43ae,_0x4d00e5){return _0xbb43ae[_0x4e94('0x6')](_0x4e94('0x7'),attributes,{'tableName':_0x4e94('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32bb46,_0x5a5823,_0x43d946){if(_0x32bb46['changed'](_0x4e94('0x9'))){_0x32bb46[_0x4e94('0xa')]=moment()[_0x4e94('0xb')](_0x4e94('0xc'));}_0x43d946(null,_0x32bb46);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 2c05713..1f53ec7 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 _0xb0aa=['./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateFaxInteraction','update','body','options','raw','attributes','debug','AddTagsToFaxInteraction','FaxInteraction','find','where','ids','spread','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0xaf25ae,_0x2001c1){var _0x49732d=function(_0x5b764d){while(--_0x5b764d){_0xaf25ae['push'](_0xaf25ae['shift']());}};_0x49732d(++_0x2001c1);}(_0xb0aa,0xb7));var _0xab0a=function(_0x2d6b62,_0xf37655){_0x2d6b62=_0x2d6b62-0x0;var _0x3dba7c=_0xb0aa[_0x2d6b62];return _0x3dba7c;};'use strict';var _=require(_0xab0a('0x0'));var util=require('util');var moment=require(_0xab0a('0x1'));var BPromise=require('bluebird');var rs=require(_0xab0a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab0a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab0a('0x4'))('rpc');var config=require(_0xab0a('0x5'));var jayson=require(_0xab0a('0x6'));var client=jayson[_0xab0a('0x7')][_0xab0a('0x8')]({'port':0x232a});config[_0xab0a('0x9')]=_['defaults'](config[_0xab0a('0x9')],{'host':_0xab0a('0xa'),'port':0x18eb});var socket=require(_0xab0a('0xb'))(new Redis(config[_0xab0a('0x9')]));require(_0xab0a('0xc'))[_0xab0a('0xd')](socket);function respondWithRpcPromise(_0x5bdd92,_0x3a0192,_0x1d5e76){return new BPromise(function(_0x377c81,_0x3e539e){return client[_0xab0a('0xe')](_0x5bdd92,_0x1d5e76)[_0xab0a('0xf')](function(_0x181d7f){logger[_0xab0a('0x10')](_0xab0a('0x11'),_0x3a0192,_0xab0a('0x12'));logger['debug'](_0xab0a('0x13'),_0x3a0192,_0xab0a('0x12'),JSON[_0xab0a('0x14')](_0x181d7f));if(_0x181d7f['error']){if(_0x181d7f[_0xab0a('0x15')]['code']===0x1f4){logger[_0xab0a('0x15')](_0xab0a('0x11'),_0x3a0192,_0x181d7f[_0xab0a('0x15')][_0xab0a('0x16')]);return _0x3e539e(_0x181d7f[_0xab0a('0x15')][_0xab0a('0x16')]);}logger['error'](_0xab0a('0x11'),_0x3a0192,_0x181d7f['error'][_0xab0a('0x16')]);return _0x377c81(_0x181d7f[_0xab0a('0x15')][_0xab0a('0x16')]);}else{logger[_0xab0a('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x3a0192,_0xab0a('0x12'));_0x377c81(_0x181d7f[_0xab0a('0x17')][_0xab0a('0x16')]);}})[_0xab0a('0x18')](function(_0x392e20){logger[_0xab0a('0x15')](_0xab0a('0x11'),_0x3a0192,_0x392e20);_0x3e539e(_0x392e20);});});}exports[_0xab0a('0x19')]=function(_0x566dee){var _0x4a3d59=this;return new Promise(function(_0x399472,_0x23b846){return db['FaxInteraction'][_0xab0a('0x1a')](_0x566dee[_0xab0a('0x1b')],{'raw':_0x566dee[_0xab0a('0x1c')]?_0x566dee['options'][_0xab0a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x566dee[_0xab0a('0x1c')]?_0x566dee['options']['where']||null:null,'attributes':_0x566dee[_0xab0a('0x1c')]?_0x566dee['options'][_0xab0a('0x1e')]||null:null,'limit':_0x566dee[_0xab0a('0x1c')]?_0x566dee[_0xab0a('0x1c')]['limit']||null:null})[_0xab0a('0xf')](function(_0x36bb7a){logger[_0xab0a('0x10')](_0xab0a('0x19'),_0x566dee);logger[_0xab0a('0x1f')](_0xab0a('0x19'),_0x566dee,JSON['stringify'](_0x36bb7a));_0x399472(_0x36bb7a);})[_0xab0a('0x18')](function(_0xc8b041){logger[_0xab0a('0x15')](_0xab0a('0x19'),_0xc8b041[_0xab0a('0x16')],_0x566dee);_0x23b846(_0x4a3d59['error'](0x1f4,_0xc8b041['message']));});});};exports[_0xab0a('0x20')]=function(_0x1349bc){return new Promise(function(_0x1e79d1,_0x2d7dd8){return db[_0xab0a('0x21')][_0xab0a('0x22')]({'where':_0x1349bc['options']?_0x1349bc['options'][_0xab0a('0x23')]||null:null})['then'](function(_0x2c5cfd){if(_0x2c5cfd){return _0x2c5cfd['addTags'](_0x1349bc[_0xab0a('0x1b')][_0xab0a('0x24')],_['omit'](_0x1349bc[_0xab0a('0x1b')],[_0xab0a('0x24'),'id'])||{});}})[_0xab0a('0x25')](function(_0x2c39e4){logger[_0xab0a('0x10')](_0xab0a('0x26'),_0x1349bc);logger[_0xab0a('0x1f')]('AddTags',_0x1349bc,JSON['stringify'](_0x2c39e4));_0x1e79d1(_0x2c39e4);})[_0xab0a('0x18')](function(_0xa240a4){logger[_0xab0a('0x15')](_0xab0a('0x26'),_0xa240a4[_0xab0a('0x16')],_0x1349bc);_0x2d7dd8(_this[_0xab0a('0x15')](0x1f4,_0xa240a4[_0xab0a('0x16')]));});});}; \ No newline at end of file +var _0x2c43=['../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','limit','then','debug','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xf78bea,_0x1afb22){var _0x1bdd09=function(_0x25a8ec){while(--_0x25a8ec){_0xf78bea['push'](_0xf78bea['shift']());}};_0x1bdd09(++_0x1afb22);}(_0x2c43,0x16b));var _0x32c4=function(_0x22ee52,_0x724643){_0x22ee52=_0x22ee52-0x0;var _0x54a704=_0x2c43[_0x22ee52];return _0x54a704;};'use strict';var _=require(_0x32c4('0x0'));var util=require(_0x32c4('0x1'));var moment=require(_0x32c4('0x2'));var BPromise=require(_0x32c4('0x3'));var rs=require(_0x32c4('0x4'));var fs=require('fs');var Redis=require(_0x32c4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x32c4('0x6'))(_0x32c4('0x7'));var config=require(_0x32c4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x32c4('0x9')][_0x32c4('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x32c4('0xb'),'port':0x18eb});var socket=require(_0x32c4('0xc'))(new Redis(config[_0x32c4('0xd')]));require(_0x32c4('0xe'))[_0x32c4('0xf')](socket);function respondWithRpcPromise(_0x5a6c4f,_0x545d2b,_0x2f9b89){return new BPromise(function(_0x264b09,_0x3b6b2e){return client[_0x32c4('0x10')](_0x5a6c4f,_0x2f9b89)['then'](function(_0x5940a5){logger[_0x32c4('0x11')](_0x32c4('0x12'),_0x545d2b,_0x32c4('0x13'));logger['debug'](_0x32c4('0x14'),_0x545d2b,_0x32c4('0x13'),JSON['stringify'](_0x5940a5));if(_0x5940a5[_0x32c4('0x15')]){if(_0x5940a5[_0x32c4('0x15')][_0x32c4('0x16')]===0x1f4){logger[_0x32c4('0x15')](_0x32c4('0x12'),_0x545d2b,_0x5940a5[_0x32c4('0x15')][_0x32c4('0x17')]);return _0x3b6b2e(_0x5940a5['error']['message']);}logger[_0x32c4('0x15')](_0x32c4('0x12'),_0x545d2b,_0x5940a5[_0x32c4('0x15')]['message']);return _0x264b09(_0x5940a5['error'][_0x32c4('0x17')]);}else{logger[_0x32c4('0x11')](_0x32c4('0x12'),_0x545d2b,_0x32c4('0x13'));_0x264b09(_0x5940a5[_0x32c4('0x18')]['message']);}})[_0x32c4('0x19')](function(_0x26f0f1){logger[_0x32c4('0x15')](_0x32c4('0x12'),_0x545d2b,_0x26f0f1);_0x3b6b2e(_0x26f0f1);});});}exports[_0x32c4('0x1a')]=function(_0x395584){var _0x457d74=this;return new Promise(function(_0x113fab,_0x27b381){return db[_0x32c4('0x1b')][_0x32c4('0x1c')](_0x395584[_0x32c4('0x1d')],{'raw':_0x395584[_0x32c4('0x1e')]?_0x395584[_0x32c4('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x395584[_0x32c4('0x1e')]?_0x395584['options'][_0x32c4('0x1f')]||null:null,'attributes':_0x395584['options']?_0x395584[_0x32c4('0x1e')]['attributes']||null:null,'limit':_0x395584['options']?_0x395584[_0x32c4('0x1e')][_0x32c4('0x20')]||null:null})[_0x32c4('0x21')](function(_0x55eb9f){logger['info'](_0x32c4('0x1a'),_0x395584);logger[_0x32c4('0x22')](_0x32c4('0x1a'),_0x395584,JSON['stringify'](_0x55eb9f));_0x113fab(_0x55eb9f);})[_0x32c4('0x19')](function(_0x22516f){logger[_0x32c4('0x15')](_0x32c4('0x1a'),_0x22516f[_0x32c4('0x17')],_0x395584);_0x27b381(_0x457d74[_0x32c4('0x15')](0x1f4,_0x22516f[_0x32c4('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x7cf64a){return new Promise(function(_0xc5cb1f,_0x310ed9){return db[_0x32c4('0x1b')]['find']({'where':_0x7cf64a[_0x32c4('0x1e')]?_0x7cf64a['options'][_0x32c4('0x1f')]||null:null})[_0x32c4('0x21')](function(_0xa592de){if(_0xa592de){return _0xa592de[_0x32c4('0x23')](_0x7cf64a['body'][_0x32c4('0x24')],_[_0x32c4('0x25')](_0x7cf64a[_0x32c4('0x1d')],[_0x32c4('0x24'),'id'])||{});}})[_0x32c4('0x26')](function(_0x1979df){logger[_0x32c4('0x11')](_0x32c4('0x27'),_0x7cf64a);logger[_0x32c4('0x22')](_0x32c4('0x27'),_0x7cf64a,JSON[_0x32c4('0x28')](_0x1979df));_0xc5cb1f(_0x1979df);})[_0x32c4('0x19')](function(_0x4a9b9e){logger[_0x32c4('0x15')](_0x32c4('0x27'),_0x4a9b9e['message'],_0x7cf64a);_0x310ed9(_this[_0x32c4('0x15')](0x1f4,_0x4a9b9e[_0x32c4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 62e4463..b9c341b 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 _0x4c2a=['update','removeListener','register','length','faxInteraction:','save','remove'];(function(_0x410856,_0x1968b0){var _0x498745=function(_0x4138b4){while(--_0x4138b4){_0x410856['push'](_0x410856['shift']());}};_0x498745(++_0x1968b0);}(_0x4c2a,0x1cc));var _0xa4c2=function(_0x50e703,_0x127370){_0x50e703=_0x50e703-0x0;var _0xf1840c=_0x4c2a[_0x50e703];return _0xf1840c;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xa4c2('0x0'),_0xa4c2('0x1'),_0xa4c2('0x2')];function createListener(_0x3ea4c0,_0x3815ab){return function(_0x4c7c45){_0x3815ab['emit'](_0x3ea4c0,_0x4c7c45);};}function removeListener(_0xb6eb90,_0x2d8cf7){return function(){FaxInteractionEvents[_0xa4c2('0x3')](_0xb6eb90,_0x2d8cf7);};}exports[_0xa4c2('0x4')]=function(_0x17ded6){for(var _0xe9f74c=0x0,_0x37313c=events[_0xa4c2('0x5')];_0xe9f74c<_0x37313c;_0xe9f74c++){var _0x201679=events[_0xe9f74c];var _0x341c14=createListener(_0xa4c2('0x6')+_0x201679,_0x17ded6);FaxInteractionEvents['on'](_0x201679,_0x341c14);}}; \ No newline at end of file +var _0x7404=['save','remove','update','emit','removeListener','register','faxInteraction:','./faxInteraction.events'];(function(_0x5c33bf,_0x4a1b18){var _0x101e3e=function(_0x350b43){while(--_0x350b43){_0x5c33bf['push'](_0x5c33bf['shift']());}};_0x101e3e(++_0x4a1b18);}(_0x7404,0x15f));var _0x4740=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x7404[_0x1facfa];return _0x9ec701;};'use strict';var FaxInteractionEvents=require(_0x4740('0x0'));var events=[_0x4740('0x1'),_0x4740('0x2'),_0x4740('0x3')];function createListener(_0x466b99,_0x207417){return function(_0x504cbe){_0x207417[_0x4740('0x4')](_0x466b99,_0x504cbe);};}function removeListener(_0x35b834,_0xb6b3f){return function(){FaxInteractionEvents[_0x4740('0x5')](_0x35b834,_0xb6b3f);};}exports[_0x4740('0x6')]=function(_0xb8fbb0){for(var _0x1c85ed=0x0,_0x3b3c14=events['length'];_0x1c85ed<_0x3b3c14;_0x1c85ed++){var _0x232306=events[_0x1c85ed];var _0x2a5f3c=createListener(_0x4740('0x7')+_0x232306,_0xb8fbb0);FaxInteractionEvents['on'](_0x232306,_0x2a5f3c);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 55b7495..a11ee88 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 _0xffa6=['/:id/messages','/:id/tags','tracked','fax','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','getMessages','/:id/download','download','post','create'];(function(_0x40ddca,_0x374da5){var _0x38064b=function(_0x1118e3){while(--_0x1118e3){_0x40ddca['push'](_0x40ddca['shift']());}};_0x38064b(++_0x374da5);}(_0xffa6,0x1a5));var _0x6ffa=function(_0x4dea3b,_0x1c30d3){_0x4dea3b=_0x4dea3b-0x0;var _0x55d7ae=_0xffa6[_0x4dea3b];return _0x55d7ae;};'use strict';var multer=require(_0x6ffa('0x0'));var util=require(_0x6ffa('0x1'));var path=require(_0x6ffa('0x2'));var timeout=require(_0x6ffa('0x3'));var express=require(_0x6ffa('0x4'));var router=express[_0x6ffa('0x5')]();var fs_extra=require(_0x6ffa('0x6'));var auth=require(_0x6ffa('0x7'));var interaction=require(_0x6ffa('0x8'));var config=require(_0x6ffa('0x9'));var controller=require(_0x6ffa('0xa'));router[_0x6ffa('0xb')]('/',auth[_0x6ffa('0xc')](),controller[_0x6ffa('0xd')]);router['get'](_0x6ffa('0xe'),auth[_0x6ffa('0xc')](),controller['describe']);router[_0x6ffa('0xb')](_0x6ffa('0xf'),auth[_0x6ffa('0xc')](),controller['show']);router[_0x6ffa('0xb')]('/:id/messages',auth[_0x6ffa('0xc')](),controller[_0x6ffa('0x10')]);router['get'](_0x6ffa('0x11'),auth['isAuthenticated'](),controller[_0x6ffa('0x12')]);router[_0x6ffa('0x13')]('/',auth[_0x6ffa('0xc')](),controller[_0x6ffa('0x14')]);router[_0x6ffa('0x13')](_0x6ffa('0x15'),auth[_0x6ffa('0xc')](),controller['addMessage']);router[_0x6ffa('0x13')](_0x6ffa('0x16'),auth[_0x6ffa('0xc')](),interaction[_0x6ffa('0x17')](_0x6ffa('0x18'),'faxinteraction:addtags'),controller[_0x6ffa('0x19')]);router[_0x6ffa('0x1a')](_0x6ffa('0xf'),auth['isAuthenticated'](),interaction[_0x6ffa('0x17')](_0x6ffa('0x18'),_0x6ffa('0x1b')),controller[_0x6ffa('0x1c')]);router[_0x6ffa('0x1d')](_0x6ffa('0xf'),auth['isAuthenticated'](),interaction[_0x6ffa('0x17')]('fax',_0x6ffa('0x1e')),controller[_0x6ffa('0x1f')]);router[_0x6ffa('0x1d')](_0x6ffa('0x16'),auth[_0x6ffa('0xc')](),controller[_0x6ffa('0x20')]);module[_0x6ffa('0x21')]=router; \ No newline at end of file +var _0x2c8e=['addTags','put','faxinteraction:update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax'];(function(_0x5ef581,_0x4df63f){var _0x42a042=function(_0x57c1e2){while(--_0x57c1e2){_0x5ef581['push'](_0x5ef581['shift']());}};_0x42a042(++_0x4df63f);}(_0x2c8e,0x1a7));var _0xe2c8=function(_0x22f50a,_0x293bae){_0x22f50a=_0x22f50a-0x0;var _0xc90790=_0x2c8e[_0x22f50a];return _0xc90790;};'use strict';var multer=require(_0xe2c8('0x0'));var util=require(_0xe2c8('0x1'));var path=require(_0xe2c8('0x2'));var timeout=require(_0xe2c8('0x3'));var express=require(_0xe2c8('0x4'));var router=express[_0xe2c8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe2c8('0x6'));var interaction=require(_0xe2c8('0x7'));var config=require(_0xe2c8('0x8'));var controller=require(_0xe2c8('0x9'));router['get']('/',auth[_0xe2c8('0xa')](),controller[_0xe2c8('0xb')]);router[_0xe2c8('0xc')](_0xe2c8('0xd'),auth[_0xe2c8('0xa')](),controller['describe']);router[_0xe2c8('0xc')](_0xe2c8('0xe'),auth[_0xe2c8('0xa')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xe2c8('0xf')]);router[_0xe2c8('0xc')](_0xe2c8('0x10'),auth[_0xe2c8('0xa')](),controller[_0xe2c8('0x11')]);router[_0xe2c8('0x12')]('/',auth['isAuthenticated'](),controller[_0xe2c8('0x13')]);router[_0xe2c8('0x12')](_0xe2c8('0x14'),auth[_0xe2c8('0xa')](),controller[_0xe2c8('0x15')]);router[_0xe2c8('0x12')](_0xe2c8('0x16'),auth[_0xe2c8('0xa')](),interaction[_0xe2c8('0x17')](_0xe2c8('0x18'),'faxinteraction:addtags'),controller[_0xe2c8('0x19')]);router[_0xe2c8('0x1a')]('/:id',auth[_0xe2c8('0xa')](),interaction[_0xe2c8('0x17')](_0xe2c8('0x18'),_0xe2c8('0x1b')),controller['update']);router[_0xe2c8('0x1c')]('/:id',auth[_0xe2c8('0xa')](),interaction[_0xe2c8('0x17')]('fax',_0xe2c8('0x1d')),controller['destroy']);router[_0xe2c8('0x1c')](_0xe2c8('0x16'),auth[_0xe2c8('0xa')](),controller[_0xe2c8('0x1e')]);module[_0xe2c8('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index fdbf350..c92595a 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 _0x5d70=['TEXT','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d70,0x8d));var _0x05d7=function(_0x326960,_0x11bca7){_0x326960=_0x326960-0x0;var _0x3151f6=_0x5d70[_0x326960];return _0x3151f6;};'use strict';var Sequelize=require(_0x05d7('0x0'));module[_0x05d7('0x1')]={'body':{'type':Sequelize['TEXT'](_0x05d7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x05d7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x05d7('0x4')]('in',_0x05d7('0x5')),'defaultValue':_0x05d7('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x05d7('0x6')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xf1e1=['BOOLEAN','out','DATE','sequelize','TEXT'];(function(_0x53edc4,_0x222116){var _0xa1bc29=function(_0x1d9a87){while(--_0x1d9a87){_0x53edc4['push'](_0x53edc4['shift']());}};_0xa1bc29(++_0x222116);}(_0xf1e1,0x102));var _0x1f1e=function(_0x5a558e,_0x2c0473){_0x5a558e=_0x5a558e-0x0;var _0x44eb26=_0xf1e1[_0x5a558e];return _0x44eb26;};'use strict';var Sequelize=require(_0x1f1e('0x0'));module['exports']={'body':{'type':Sequelize[_0x1f1e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1f1e('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1f1e('0x3')),'defaultValue':_0x1f1e('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1f1e('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1f1e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 2f9c868..3228fd2 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 _0xda6e=['api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','jayson/promise','http','client','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxMessage','findAll','rows','show','params','keys','body','find','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','email','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x315319,_0x947606){var _0x13e947=function(_0x120c6a){while(--_0x120c6a){_0x315319['push'](_0x315319['shift']());}};_0x13e947(++_0x947606);}(_0xda6e,0x111));var _0xeda6=function(_0x5ef863,_0x455ead){_0x5ef863=_0x5ef863-0x0;var _0x1381c9=_0xda6e[_0x5ef863];return _0x1381c9;};'use strict';var emlformat=require(_0xeda6('0x0'));var rimraf=require(_0xeda6('0x1'));var zipdir=require(_0xeda6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeda6('0x3'));var BPromise=require(_0xeda6('0x4'));var Mustache=require('mustache');var util=require(_0xeda6('0x5'));var path=require('path');var sox=require(_0xeda6('0x6'));var csv=require('to-csv');var ejs=require(_0xeda6('0x7'));var fs=require('fs');var fs_extra=require(_0xeda6('0x8'));var _=require('lodash');var squel=require(_0xeda6('0x9'));var crypto=require('crypto');var jsforce=require(_0xeda6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xeda6('0xb'));var querystring=require(_0xeda6('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeda6('0xd'));var as=require(_0xeda6('0xe'));var hardwareService=require(_0xeda6('0xf'));var logger=require(_0xeda6('0x10'))(_0xeda6('0x11'));var utils=require(_0xeda6('0x12'));var config=require(_0xeda6('0x13'));var licenseUtil=require(_0xeda6('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xeda6('0x15')](config[_0xeda6('0x16')],{'host':_0xeda6('0x17'),'port':0x18eb});var socket=require(_0xeda6('0x18'))(new Redis(config[_0xeda6('0x16')]));require('./faxMessage.socket')['register'](socket);var jayson=require(_0xeda6('0x19'));var client=jayson['client'][_0xeda6('0x1a')]({'port':0x232c});var client9002=jayson[_0xeda6('0x1b')][_0xeda6('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x49c666,_0x3470a6,_0x3d9424,_0x1d4887){return new BPromise(function(_0x2d8390,_0x20fb27){var _0xee2001=_0x1d4887||client;return _0xee2001[_0xeda6('0x1c')](_0x49c666,_0x3d9424)[_0xeda6('0x1d')](function(_0x5b5697){logger[_0xeda6('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x3470a6,_0xeda6('0x1f'));logger[_0xeda6('0x20')](_0xeda6('0x21'),_0x3470a6,_0xeda6('0x1f'),JSON[_0xeda6('0x22')](_0x5b5697));if(_0x5b5697[_0xeda6('0x23')]){if(_0x5b5697[_0xeda6('0x23')][_0xeda6('0x24')]===0x1f4){logger[_0xeda6('0x23')](_0xeda6('0x25'),_0x3470a6,_0x5b5697[_0xeda6('0x23')][_0xeda6('0x26')]);return _0x20fb27(_0x5b5697['error'][_0xeda6('0x26')]);}logger['error'](_0xeda6('0x25'),_0x3470a6,_0x5b5697[_0xeda6('0x23')][_0xeda6('0x26')]);return _0x2d8390(_0x5b5697[_0xeda6('0x23')][_0xeda6('0x26')]);}else{logger[_0xeda6('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x3470a6,_0xeda6('0x1f'));_0x2d8390(_0x5b5697['result'][_0xeda6('0x26')]);}})[_0xeda6('0x27')](function(_0x5019d8){logger[_0xeda6('0x23')](_0xeda6('0x25'),_0x3470a6,_0x5019d8);_0x20fb27(_0x5019d8);});});}function respondWithStatusCode(_0x2cde2c,_0x455c73){_0x455c73=_0x455c73||0xcc;return function(_0x280303){if(_0x280303){return _0x2cde2c[_0xeda6('0x28')](_0x455c73);}return _0x2cde2c[_0xeda6('0x29')](_0x455c73)[_0xeda6('0x2a')]();};}function respondWithResult(_0x3d63da,_0x3dfdb1){_0x3dfdb1=_0x3dfdb1||0xc8;return function(_0x11db30){if(_0x11db30){return _0x3d63da['status'](_0x3dfdb1)[_0xeda6('0x2b')](_0x11db30);}};}function respondWithFilteredResult(_0x1d31e4,_0x54b29d){return function(_0x5c161f){if(_0x5c161f){var _0x58e1e7=typeof _0x54b29d[_0xeda6('0x2c')]===_0xeda6('0x2d')&&typeof _0x54b29d[_0xeda6('0x2e')]===_0xeda6('0x2d');var _0x210b3a=_0x5c161f['count'];var _0x1a2dcf=_0x58e1e7?0x0:_0x54b29d[_0xeda6('0x2c')];var _0x55e548=_0x58e1e7?_0x5c161f[_0xeda6('0x2f')]:_0x54b29d[_0xeda6('0x2c')]+_0x54b29d['limit'];var _0x4009de;if(_0x55e548>=_0x210b3a){_0x55e548=_0x210b3a;_0x4009de=0xc8;}else{_0x4009de=0xce;}_0x1d31e4[_0xeda6('0x29')](_0x4009de);return _0x1d31e4[_0xeda6('0x30')](_0xeda6('0x31'),_0x1a2dcf+'-'+_0x55e548+'/'+_0x210b3a)[_0xeda6('0x2b')](_0x5c161f);}return null;};}function patchUpdates(_0x252f08){return function(_0x3af72e){try{jsonpatch[_0xeda6('0x32')](_0x3af72e,_0x252f08,!![]);}catch(_0x244866){return BPromise[_0xeda6('0x33')](_0x244866);}return _0x3af72e[_0xeda6('0x34')]();};}function saveUpdates(_0x52b8d4,_0x2c7ecb){return function(_0x17799f){if(_0x17799f){return _0x17799f[_0xeda6('0x35')](_0x52b8d4)['then'](function(_0xa35bbe){return _0xa35bbe;});}return null;};}function removeEntity(_0x2626e3,_0x53899d){return function(_0x52e97e){if(_0x52e97e){return _0x52e97e[_0xeda6('0x36')]()[_0xeda6('0x1d')](function(){_0x2626e3[_0xeda6('0x29')](0xcc)[_0xeda6('0x2a')]();});}};}function handleEntityNotFound(_0x25b22a,_0x16f9e1){return function(_0x2944ad){if(!_0x2944ad){_0x25b22a['sendStatus'](0x194);}return _0x2944ad;};}function handleError(_0x8a0a80,_0x4220b5){_0x4220b5=_0x4220b5||0x1f4;return function(_0x39f9a6){logger[_0xeda6('0x23')](_0x39f9a6[_0xeda6('0x37')]);if(_0x39f9a6[_0xeda6('0x38')]){delete _0x39f9a6[_0xeda6('0x38')];}_0x8a0a80[_0xeda6('0x29')](_0x4220b5)['send'](_0x39f9a6);};}exports[_0xeda6('0x39')]=function(_0x22e2cc,_0x517d67){var _0x1015be={},_0x39b4f7={},_0x4656de={'count':0x0,'rows':[]};var _0x23fe63=_[_0xeda6('0x3a')](db['FaxMessage'][_0xeda6('0x3b')],function(_0x20ab6d){return{'name':_0x20ab6d[_0xeda6('0x3c')],'type':_0x20ab6d['type']['key']};});_0x39b4f7[_0xeda6('0x3d')]=_[_0xeda6('0x3a')](_0x23fe63,'name');_0x39b4f7['query']=_['keys'](_0x22e2cc[_0xeda6('0x3e')]);_0x39b4f7[_0xeda6('0x3f')]=_['intersection'](_0x39b4f7[_0xeda6('0x3d')],_0x39b4f7[_0xeda6('0x3e')]);_0x1015be[_0xeda6('0x40')]=_[_0xeda6('0x41')](_0x39b4f7[_0xeda6('0x3d')],qs[_0xeda6('0x42')](_0x22e2cc['query'][_0xeda6('0x42')]));_0x1015be[_0xeda6('0x40')]=_0x1015be[_0xeda6('0x40')][_0xeda6('0x43')]?_0x1015be[_0xeda6('0x40')]:_0x39b4f7[_0xeda6('0x3d')];if(!_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x44')](_0xeda6('0x45'))){_0x1015be[_0xeda6('0x2e')]=qs[_0xeda6('0x2e')](_0x22e2cc[_0xeda6('0x3e')]['limit']);_0x1015be[_0xeda6('0x2c')]=qs[_0xeda6('0x2c')](_0x22e2cc['query'][_0xeda6('0x2c')]);}_0x1015be['order']=qs['sort'](_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x46')]);_0x1015be[_0xeda6('0x47')]=qs[_0xeda6('0x3f')](_[_0xeda6('0x48')](_0x22e2cc[_0xeda6('0x3e')],_0x39b4f7[_0xeda6('0x3f')]),_0x23fe63);if(_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x49')]){_0x1015be[_0xeda6('0x47')]=_[_0xeda6('0x4a')](_0x1015be['where'],{'$or':_[_0xeda6('0x3a')](_0x23fe63,function(_0x1c0fc2){if(_0x1c0fc2['type']!==_0xeda6('0x4b')){var _0x579c33={};_0x579c33[_0x1c0fc2[_0xeda6('0x38')]]={'$like':'%'+_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x49')]+'%'};return _0x579c33;}})});}_0x1015be=_['merge']({},_0x1015be,_0x22e2cc[_0xeda6('0x4c')]);var _0xb8cdab={'where':_0x1015be['where']};return db['FaxMessage'][_0xeda6('0x2f')](_0xb8cdab)[_0xeda6('0x1d')](function(_0x5c6c7d){_0x4656de[_0xeda6('0x2f')]=_0x5c6c7d;if(_0x22e2cc[_0xeda6('0x3e')][_0xeda6('0x4d')]){_0x1015be[_0xeda6('0x4e')]=[{'all':!![]}];}return db[_0xeda6('0x4f')][_0xeda6('0x50')](_0x1015be);})['then'](function(_0x57469c){_0x4656de[_0xeda6('0x51')]=_0x57469c;return _0x4656de;})[_0xeda6('0x1d')](respondWithFilteredResult(_0x517d67,_0x1015be))[_0xeda6('0x27')](handleError(_0x517d67,null));};exports[_0xeda6('0x52')]=function(_0x5a4cb9,_0x1c0afa){var _0x2e7320={'raw':!![],'where':{'id':_0x5a4cb9[_0xeda6('0x53')]['id']}},_0x40d527={};_0x40d527[_0xeda6('0x3d')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x40d527['query']=_[_0xeda6('0x54')](_0x5a4cb9['query']);_0x40d527[_0xeda6('0x3f')]=_[_0xeda6('0x41')](_0x40d527[_0xeda6('0x3d')],_0x40d527[_0xeda6('0x3e')]);_0x2e7320[_0xeda6('0x40')]=_[_0xeda6('0x41')](_0x40d527[_0xeda6('0x3d')],qs[_0xeda6('0x42')](_0x5a4cb9[_0xeda6('0x3e')]['fields']));_0x2e7320['attributes']=_0x2e7320['attributes'][_0xeda6('0x43')]?_0x2e7320[_0xeda6('0x40')]:_0x40d527[_0xeda6('0x3d')];if(_0x5a4cb9['query'][_0xeda6('0x4d')]){_0x2e7320['include']=[{'all':!![]}];}_0x2e7320=_[_0xeda6('0x4a')]({},_0x2e7320,_0x5a4cb9[_0xeda6('0x4c')]);return db[_0xeda6('0x4f')]['find'](_0x2e7320)['then'](handleEntityNotFound(_0x1c0afa,null))[_0xeda6('0x1d')](respondWithResult(_0x1c0afa,null))[_0xeda6('0x27')](handleError(_0x1c0afa,null));};exports[_0xeda6('0x35')]=function(_0x16b9e2,_0x5774ec){if(_0x16b9e2[_0xeda6('0x55')]['id']){delete _0x16b9e2[_0xeda6('0x55')]['id'];}return db['FaxMessage'][_0xeda6('0x56')]({'where':{'id':_0x16b9e2['params']['id']}})[_0xeda6('0x1d')](handleEntityNotFound(_0x5774ec,null))['then'](saveUpdates(_0x16b9e2[_0xeda6('0x55')],null))[_0xeda6('0x1d')](respondWithResult(_0x5774ec,null))['catch'](handleError(_0x5774ec,null));};exports[_0xeda6('0x36')]=function(_0x4f4ec3,_0x435589){return db['FaxMessage'][_0xeda6('0x56')]({'where':{'id':_0x4f4ec3[_0xeda6('0x53')]['id']}})[_0xeda6('0x1d')](handleEntityNotFound(_0x435589,null))[_0xeda6('0x1d')](removeEntity(_0x435589,null))[_0xeda6('0x27')](handleError(_0x435589,null));};exports[_0xeda6('0x57')]=function(_0x5eff5b,_0x4c1e64){return db[_0xeda6('0x4f')]['describe']()[_0xeda6('0x1d')](respondWithResult(_0x4c1e64,null))[_0xeda6('0x27')](handleError(_0x4c1e64,null));};var interaction_log=require('../../config/logger')(_0xeda6('0x58'));exports[_0xeda6('0x59')]=function(_0x430fcb,_0x26af33,_0x3d8437){var _0x480bb0={'agent':{},'channel':_0xeda6('0x5a')};if(_0x430fcb[_0xeda6('0x55')]['id']){delete _0x430fcb[_0xeda6('0x55')]['id'];}_0x430fcb['body'][_0xeda6('0x5b')]=!![];_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5c')]=moment()[_0xeda6('0x5d')](_0xeda6('0x5e'));_0x430fcb['body'][_0xeda6('0x5f')]=_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5f')]||_0x430fcb[_0xeda6('0x60')]['id'];_0x480bb0[_0xeda6('0x61')]['id']=_0x430fcb['body']['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x430fcb[_0xeda6('0x53')]['id'],'UserId':null}})[_0xeda6('0x1d')](handleEntityNotFound(_0x26af33,null))['then'](saveUpdates(_0x430fcb[_0xeda6('0x55')],null))[_0xeda6('0x1d')](function(_0x5ab09e){if(_0x5ab09e){_0x480bb0['message']=_0x5ab09e[_0xeda6('0x62')]({'plain':!![]});return db[_0xeda6('0x63')][_0xeda6('0x56')]({'where':{'id':_0x5ab09e[_0xeda6('0x64')]}});}return null;})[_0xeda6('0x1d')](handleEntityNotFound(_0x26af33,null))['then'](function(_0x4d944e){if(_0x4d944e){return _0x4d944e['update']({'UserId':_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5f')],'read1stAt':_[_0xeda6('0x65')](_0x4d944e[_0xeda6('0x66')])?moment()[_0xeda6('0x5d')](_0xeda6('0x5e')):undefined});}return null;})[_0xeda6('0x1d')](function(_0x2623b0){if(_0x2623b0){_0x480bb0[_0xeda6('0x67')]=_0x2623b0[_0xeda6('0x62')]({'plain':!![]});interaction_log[_0xeda6('0x1e')](_0xeda6('0x68'),_0x430fcb['user']['id'],_0x430fcb[_0xeda6('0x60')]['name'],_0x430fcb[_0xeda6('0x60')]['role'],_0x480bb0[_0xeda6('0x67')]['id'],_0x430fcb[_0xeda6('0x55')]?JSON[_0xeda6('0x22')](_0x430fcb['body']):'null');return respondWithRpcPromise(_0xeda6('0x69'),_0xeda6('0x6a'),_0x480bb0);}return null;})[_0xeda6('0x1d')](function(_0x2b4f55){var _0x3ae376=_0xeda6('0x6b')+_0x2b4f55['message'][_0xeda6('0x6c')];return db[_0xeda6('0x6d')][_0xeda6('0x3e')](_0x3ae376,{'type':db[_0xeda6('0x6e')][_0xeda6('0x6f')][_0xeda6('0x70')],'raw':!![]})[_0xeda6('0x1d')](function(_0xd82b29){return _0xd82b29;});})['then'](function(_0x5e7d16){if(_0x5e7d16){_0x480bb0['message'][_0xeda6('0x71')]=_0x5e7d16[0x0];if(!_0x430fcb[_0xeda6('0x55')]['UserId'])return;return db[_0xeda6('0x72')][_0xeda6('0x56')]({'where':{'id':_0x430fcb[_0xeda6('0x55')][_0xeda6('0x5f')],'role':_0xeda6('0x61')},'attributes':['id',_0xeda6('0x38'),_0xeda6('0x73'),'email',_0xeda6('0x74')],'raw':!![]});}return null;})[_0xeda6('0x1d')](function(_0x262dac){if(!_0x262dac)return null;_0x480bb0[_0xeda6('0x26')]['agent']=_0x262dac;return _0x480bb0;})[_0xeda6('0x1d')](function(_0x1e7100){if(_0x1e7100){if(_0x430fcb[_0xeda6('0x55')][_0xeda6('0x75')]){_0x480bb0[_0xeda6('0x26')][_0xeda6('0x76')]=util[_0xeda6('0x5d')](_0xeda6('0x77'),_0x430fcb[_0xeda6('0x60')]['name']);_0x480bb0[_0xeda6('0x26')][_0xeda6('0x78')]=_0x480bb0['channel'];_0x480bb0[_0xeda6('0x26')][_0xeda6('0x79')]=_0x480bb0[_0xeda6('0x78')];_0x480bb0[_0xeda6('0x26')][_0xeda6('0x7a')]=_0xeda6('0x59');return respondWithRpcPromise(_0xeda6('0x7b'),_0xeda6('0x7b'),{'event':_0xeda6('0x7c'),'message':_0x480bb0[_0xeda6('0x26')]},client9002)[_0xeda6('0x1d')](function(){return _0x480bb0;});}return _0x480bb0;}return null;})[_0xeda6('0x1d')](respondWithResult(_0x26af33,null))[_0xeda6('0x27')](handleError(_0x26af33,null));};var interaction_log=require(_0xeda6('0x10'))(_0xeda6('0x58'));exports[_0xeda6('0x33')]=function(_0x1e15e9,_0x4fc4f2,_0x4f6f2d){var _0xd47a63={'agent':{},'channel':_0xeda6('0x5a')};if(_0x1e15e9['body']['id']){delete _0x1e15e9[_0xeda6('0x55')]['id'];}_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')]=_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')]||_0x1e15e9['user']['id'];_0xd47a63['agent']['id']=_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')];return db['FaxMessage'][_0xeda6('0x56')]({'where':{'id':_0x1e15e9[_0xeda6('0x53')]['id'],'UserId':null}})[_0xeda6('0x1d')](handleEntityNotFound(_0x4fc4f2,null))[_0xeda6('0x1d')](function(_0xda3db4){if(_0xda3db4){_0xd47a63[_0xeda6('0x26')]=_0xda3db4[_0xeda6('0x62')]({'plain':!![]});return db[_0xeda6('0x63')][_0xeda6('0x56')]({'where':{'id':_0xda3db4[_0xeda6('0x64')]}});}return null;})[_0xeda6('0x1d')](handleEntityNotFound(_0x4fc4f2,null))[_0xeda6('0x1d')](function(_0x2f81e5){if(_0x2f81e5){_0xd47a63[_0xeda6('0x67')]=_0x2f81e5[_0xeda6('0x62')]({'plain':!![]});interaction_log[_0xeda6('0x1e')](_0xeda6('0x7d'),_0x1e15e9[_0xeda6('0x60')]['id'],_0x1e15e9[_0xeda6('0x60')]['name'],_0x1e15e9[_0xeda6('0x60')][_0xeda6('0x7e')],_0xd47a63['interaction']['id'],_0x1e15e9['body']?JSON['stringify'](_0x1e15e9['body']):_0xeda6('0x7f'));return respondWithRpcPromise('RejectMessage',_0xeda6('0x80'),_0xd47a63);}return null;})[_0xeda6('0x1d')](function(_0x5b4772){var _0xf6a90c=_0xeda6('0x6b')+_0x5b4772[_0xeda6('0x26')]['ContactId'];return db[_0xeda6('0x6d')]['query'](_0xf6a90c,{'type':db['Sequelize'][_0xeda6('0x6f')][_0xeda6('0x70')],'raw':!![]})[_0xeda6('0x1d')](function(_0x17f327){return _0x17f327;});})[_0xeda6('0x1d')](function(_0x168166){if(_0x168166){_0xd47a63['message'][_0xeda6('0x71')]=_0x168166[0x0];if(!_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')])return;return db[_0xeda6('0x72')][_0xeda6('0x56')]({'where':{'id':_0x1e15e9[_0xeda6('0x55')][_0xeda6('0x5f')],'role':_0xeda6('0x61')},'attributes':['id',_0xeda6('0x38'),_0xeda6('0x73'),_0xeda6('0x81'),_0xeda6('0x74')],'raw':!![]});}return null;})[_0xeda6('0x1d')](function(_0x1ba26e){if(!_0x1ba26e)return null;_0xd47a63[_0xeda6('0x26')]['agent']=_0x1ba26e;return _0xd47a63;})[_0xeda6('0x1d')](function(_0xb93089){if(_0xb93089){_0xb93089['message']['interface']=util[_0xeda6('0x5d')](_0xeda6('0x77'),_0x1e15e9[_0xeda6('0x60')][_0xeda6('0x38')]);_0xb93089[_0xeda6('0x26')]['channel']=_0xd47a63[_0xeda6('0x78')];_0xb93089[_0xeda6('0x26')][_0xeda6('0x79')]=_0xd47a63['channel'];_0xb93089[_0xeda6('0x26')]['event']=_0xeda6('0x33');respondWithRpcPromise(_0xeda6('0x7b'),_0xeda6('0x7b'),{'event':_0xeda6('0x82'),'message':_0xb93089[_0xeda6('0x26')]},client9002);return _0xd47a63;}return null;})['then'](respondWithResult(_0x4fc4f2,null))[_0xeda6('0x27')](handleError(_0x4fc4f2,null));};exports[_0xeda6('0x83')]=function(_0x1e9c57,_0x4eb3d5){var _0x14908c;return db[_0xeda6('0x4f')]['create'](_0x1e9c57[_0xeda6('0x55')],{})[_0xeda6('0x1d')](function(_0x10660f){_0x14908c=_0x10660f;return db[_0xeda6('0x84')][_0xeda6('0x85')]({'where':{'id':_0x14908c[_0xeda6('0x6c')]}});})[_0xeda6('0x1d')](function(_0x3497dc){if(_['isNil'](_0x3497dc)){return;}else{_0x14908c['fax']=_0x3497dc['fax'];return db[_0xeda6('0x86')]['findOne']({'where':{'id':_0x14908c[_0xeda6('0x87')]}});}})[_0xeda6('0x1d')](function(_0x1288dd){return respondWithRpcPromise(_0xeda6('0x88'),'SendFax',{'FaxAccountId':_[_0xeda6('0x65')](_0x1e9c57[_0xeda6('0x55')])?undefined:_0x1e9c57[_0xeda6('0x55')]['FaxAccountId'],'path':_['isNil'](_0x1288dd)?undefined:util['format'](_0xeda6('0x89'),_0x1288dd[_0xeda6('0x8a')]),'fax':_['isNil'](_0x14908c['fax'])?undefined:_0x14908c['fax'],'AttachmentId':_0x14908c['AttachmentId']},client9002);})[_0xeda6('0x1d')](respondWithResult(_0x4eb3d5,0xc9))[_0xeda6('0x27')](handleError(_0x4eb3d5,null));};exports[_0xeda6('0x8b')]=function(_0x2ede2e,_0x7283e1){var _0x1d9af7=path[_0xeda6('0x8c')](config[_0xeda6('0x8d')],_0xeda6('0x8e'),_0xeda6('0x8f'),_0xeda6('0x90'));return db[_0xeda6('0x4f')][_0xeda6('0x56')]({'where':{'id':_0x2ede2e['params']['id']},'include':[{'model':db[_0xeda6('0x86')],'as':'Attachment'}]})[_0xeda6('0x1d')](handleEntityNotFound(_0x7283e1,null))['then'](function(_0x53de09){if(_0x53de09){return _0x7283e1[_0xeda6('0x8b')](path[_0xeda6('0x8c')](_0x1d9af7,_0x53de09['Attachment']['basename']));}})[_0xeda6('0x27')](handleError(_0x7283e1,null));}; \ No newline at end of file +var _0x86bf=['files','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','status','json','offset','undefined','count','limit','Content-Range','apply','reject','destroy','end','sendStatus','stack','name','index','FaxMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','update','body','params','describe','../../config/logger','fax-interactions','read','readAt','format','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','RejectMessage','ContactId','Sequelize','contact','interface','create','CmContact','findOne','fax','Attachment','SendFax','FaxAccountId','basename','AttachmentId','download','join','root','server'];(function(_0x2c0697,_0x15c276){var _0x4068d5=function(_0x19d47e){while(--_0x19d47e){_0x2c0697['push'](_0x2c0697['shift']());}};_0x4068d5(++_0x15c276);}(_0x86bf,0x93));var _0xf86b=function(_0x586c14,_0x203b1f){_0x586c14=_0x586c14-0x0;var _0x214886=_0x86bf[_0x586c14];return _0x214886;};'use strict';var emlformat=require(_0xf86b('0x0'));var rimraf=require(_0xf86b('0x1'));var zipdir=require(_0xf86b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf86b('0x3'));var Mustache=require(_0xf86b('0x4'));var util=require(_0xf86b('0x5'));var path=require('path');var sox=require(_0xf86b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf86b('0x7'));var _=require(_0xf86b('0x8'));var squel=require(_0xf86b('0x9'));var crypto=require(_0xf86b('0xa'));var jsforce=require(_0xf86b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf86b('0xc'));var querystring=require(_0xf86b('0xd'));var Papa=require(_0xf86b('0xe'));var Redis=require(_0xf86b('0xf'));var authService=require(_0xf86b('0x10'));var qs=require(_0xf86b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf86b('0x12'));var utils=require(_0xf86b('0x13'));var config=require(_0xf86b('0x14'));var licenseUtil=require(_0xf86b('0x15'));var db=require(_0xf86b('0x16'))['db'];config[_0xf86b('0x17')]=_[_0xf86b('0x18')](config['redis'],{'host':_0xf86b('0x19'),'port':0x18eb});var socket=require(_0xf86b('0x1a'))(new Redis(config[_0xf86b('0x17')]));require(_0xf86b('0x1b'))['register'](socket);var jayson=require(_0xf86b('0x1c'));var client=jayson[_0xf86b('0x1d')][_0xf86b('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xf86b('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x30988b,_0x2fe530,_0xac4a2a,_0x44c13b){return new BPromise(function(_0x20905b,_0x3bc7d7){var _0xe3fba7=_0x44c13b||client;return _0xe3fba7[_0xf86b('0x1f')](_0x30988b,_0xac4a2a)[_0xf86b('0x20')](function(_0x26036f){logger['info'](_0xf86b('0x21'),_0x2fe530,'request\x20sent');logger[_0xf86b('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2fe530,_0xf86b('0x23'),JSON['stringify'](_0x26036f));if(_0x26036f[_0xf86b('0x24')]){if(_0x26036f[_0xf86b('0x24')][_0xf86b('0x25')]===0x1f4){logger['error'](_0xf86b('0x21'),_0x2fe530,_0x26036f['error'][_0xf86b('0x26')]);return _0x3bc7d7(_0x26036f[_0xf86b('0x24')][_0xf86b('0x26')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x2fe530,_0x26036f[_0xf86b('0x24')][_0xf86b('0x26')]);return _0x20905b(_0x26036f[_0xf86b('0x24')][_0xf86b('0x26')]);}else{logger[_0xf86b('0x27')](_0xf86b('0x21'),_0x2fe530,'request\x20sent');_0x20905b(_0x26036f['result'][_0xf86b('0x26')]);}})[_0xf86b('0x28')](function(_0x526da7){logger[_0xf86b('0x24')](_0xf86b('0x21'),_0x2fe530,_0x526da7);_0x3bc7d7(_0x526da7);});});}function respondWithStatusCode(_0x39b6cd,_0x4ba6a6){_0x4ba6a6=_0x4ba6a6||0xcc;return function(_0x486156){if(_0x486156){return _0x39b6cd['sendStatus'](_0x4ba6a6);}return _0x39b6cd[_0xf86b('0x29')](_0x4ba6a6)['end']();};}function respondWithResult(_0x43241a,_0x586064){_0x586064=_0x586064||0xc8;return function(_0x1ed392){if(_0x1ed392){return _0x43241a[_0xf86b('0x29')](_0x586064)[_0xf86b('0x2a')](_0x1ed392);}};}function respondWithFilteredResult(_0x5d4dcd,_0x53bec2){return function(_0x25fc56){if(_0x25fc56){var _0x22e5e9=typeof _0x53bec2[_0xf86b('0x2b')]===_0xf86b('0x2c')&&typeof _0x53bec2['limit']==='undefined';var _0xa008dd=_0x25fc56[_0xf86b('0x2d')];var _0x164107=_0x22e5e9?0x0:_0x53bec2['offset'];var _0x1b553e=_0x22e5e9?_0x25fc56[_0xf86b('0x2d')]:_0x53bec2[_0xf86b('0x2b')]+_0x53bec2[_0xf86b('0x2e')];var _0xb1fd4;if(_0x1b553e>=_0xa008dd){_0x1b553e=_0xa008dd;_0xb1fd4=0xc8;}else{_0xb1fd4=0xce;}_0x5d4dcd[_0xf86b('0x29')](_0xb1fd4);return _0x5d4dcd['set'](_0xf86b('0x2f'),_0x164107+'-'+_0x1b553e+'/'+_0xa008dd)[_0xf86b('0x2a')](_0x25fc56);}return null;};}function patchUpdates(_0x5bb618){return function(_0x5da2d2){try{jsonpatch[_0xf86b('0x30')](_0x5da2d2,_0x5bb618,!![]);}catch(_0x3a7490){return BPromise[_0xf86b('0x31')](_0x3a7490);}return _0x5da2d2['save']();};}function saveUpdates(_0x8c32a5,_0x5a7f6e){return function(_0x585c7b){if(_0x585c7b){return _0x585c7b['update'](_0x8c32a5)[_0xf86b('0x20')](function(_0x317081){return _0x317081;});}return null;};}function removeEntity(_0xbc042f,_0xff3f8f){return function(_0x39cdd0){if(_0x39cdd0){return _0x39cdd0[_0xf86b('0x32')]()[_0xf86b('0x20')](function(){_0xbc042f['status'](0xcc)[_0xf86b('0x33')]();});}};}function handleEntityNotFound(_0x40190e,_0x28535e){return function(_0x4f2ebf){if(!_0x4f2ebf){_0x40190e[_0xf86b('0x34')](0x194);}return _0x4f2ebf;};}function handleError(_0x1e2bca,_0xa3f8ec){_0xa3f8ec=_0xa3f8ec||0x1f4;return function(_0x34ae3c){logger[_0xf86b('0x24')](_0x34ae3c[_0xf86b('0x35')]);if(_0x34ae3c['name']){delete _0x34ae3c[_0xf86b('0x36')];}_0x1e2bca[_0xf86b('0x29')](_0xa3f8ec)['send'](_0x34ae3c);};}exports[_0xf86b('0x37')]=function(_0x613ff3,_0x248e75){var _0x1e1ba5={},_0x10713c={},_0x246244={'count':0x0,'rows':[]};var _0x5bc220=_['map'](db[_0xf86b('0x38')][_0xf86b('0x39')],function(_0x1f599a){return{'name':_0x1f599a[_0xf86b('0x3a')],'type':_0x1f599a[_0xf86b('0x3b')][_0xf86b('0x3c')]};});_0x10713c[_0xf86b('0x3d')]=_[_0xf86b('0x3e')](_0x5bc220,_0xf86b('0x36'));_0x10713c[_0xf86b('0x3f')]=_[_0xf86b('0x40')](_0x613ff3['query']);_0x10713c[_0xf86b('0x41')]=_[_0xf86b('0x42')](_0x10713c['model'],_0x10713c[_0xf86b('0x3f')]);_0x1e1ba5[_0xf86b('0x43')]=_[_0xf86b('0x42')](_0x10713c[_0xf86b('0x3d')],qs[_0xf86b('0x44')](_0x613ff3[_0xf86b('0x3f')][_0xf86b('0x44')]));_0x1e1ba5[_0xf86b('0x43')]=_0x1e1ba5[_0xf86b('0x43')][_0xf86b('0x45')]?_0x1e1ba5['attributes']:_0x10713c[_0xf86b('0x3d')];if(!_0x613ff3[_0xf86b('0x3f')][_0xf86b('0x46')](_0xf86b('0x47'))){_0x1e1ba5[_0xf86b('0x2e')]=qs[_0xf86b('0x2e')](_0x613ff3[_0xf86b('0x3f')][_0xf86b('0x2e')]);_0x1e1ba5[_0xf86b('0x2b')]=qs[_0xf86b('0x2b')](_0x613ff3[_0xf86b('0x3f')][_0xf86b('0x2b')]);}_0x1e1ba5[_0xf86b('0x48')]=qs[_0xf86b('0x49')](_0x613ff3[_0xf86b('0x3f')]['sort']);_0x1e1ba5[_0xf86b('0x4a')]=qs[_0xf86b('0x41')](_[_0xf86b('0x4b')](_0x613ff3[_0xf86b('0x3f')],_0x10713c['filters']),_0x5bc220);if(_0x613ff3['query'][_0xf86b('0x4c')]){_0x1e1ba5[_0xf86b('0x4a')]=_[_0xf86b('0x4d')](_0x1e1ba5[_0xf86b('0x4a')],{'$or':_[_0xf86b('0x3e')](_0x5bc220,function(_0x473a55){if(_0x473a55[_0xf86b('0x3b')]!==_0xf86b('0x4e')){var _0x3d52e7={};_0x3d52e7[_0x473a55[_0xf86b('0x36')]]={'$like':'%'+_0x613ff3[_0xf86b('0x3f')][_0xf86b('0x4c')]+'%'};return _0x3d52e7;}})});}_0x1e1ba5=_[_0xf86b('0x4d')]({},_0x1e1ba5,_0x613ff3[_0xf86b('0x4f')]);var _0x1a3de7={'where':_0x1e1ba5[_0xf86b('0x4a')]};return db['FaxMessage'][_0xf86b('0x2d')](_0x1a3de7)[_0xf86b('0x20')](function(_0x3e9800){_0x246244['count']=_0x3e9800;if(_0x613ff3[_0xf86b('0x3f')][_0xf86b('0x50')]){_0x1e1ba5[_0xf86b('0x51')]=[{'all':!![]}];}return db['FaxMessage'][_0xf86b('0x52')](_0x1e1ba5);})['then'](function(_0x2f6639){_0x246244[_0xf86b('0x53')]=_0x2f6639;return _0x246244;})[_0xf86b('0x20')](respondWithFilteredResult(_0x248e75,_0x1e1ba5))[_0xf86b('0x28')](handleError(_0x248e75,null));};exports[_0xf86b('0x54')]=function(_0x45bb22,_0x126b7a){var _0x27266e={'raw':!![],'where':{'id':_0x45bb22['params']['id']}},_0x48da50={};_0x48da50[_0xf86b('0x3d')]=_[_0xf86b('0x40')](db['FaxMessage'][_0xf86b('0x39')]);_0x48da50['query']=_['keys'](_0x45bb22[_0xf86b('0x3f')]);_0x48da50[_0xf86b('0x41')]=_[_0xf86b('0x42')](_0x48da50[_0xf86b('0x3d')],_0x48da50['query']);_0x27266e[_0xf86b('0x43')]=_['intersection'](_0x48da50[_0xf86b('0x3d')],qs[_0xf86b('0x44')](_0x45bb22['query'][_0xf86b('0x44')]));_0x27266e[_0xf86b('0x43')]=_0x27266e[_0xf86b('0x43')]['length']?_0x27266e['attributes']:_0x48da50['model'];if(_0x45bb22[_0xf86b('0x3f')][_0xf86b('0x50')]){_0x27266e[_0xf86b('0x51')]=[{'all':!![]}];}_0x27266e=_['merge']({},_0x27266e,_0x45bb22[_0xf86b('0x4f')]);return db[_0xf86b('0x38')][_0xf86b('0x55')](_0x27266e)[_0xf86b('0x20')](handleEntityNotFound(_0x126b7a,null))['then'](respondWithResult(_0x126b7a,null))[_0xf86b('0x28')](handleError(_0x126b7a,null));};exports[_0xf86b('0x56')]=function(_0x1e2df4,_0x5c3b0b){if(_0x1e2df4[_0xf86b('0x57')]['id']){delete _0x1e2df4[_0xf86b('0x57')]['id'];}return db[_0xf86b('0x38')][_0xf86b('0x55')]({'where':{'id':_0x1e2df4['params']['id']}})[_0xf86b('0x20')](handleEntityNotFound(_0x5c3b0b,null))[_0xf86b('0x20')](saveUpdates(_0x1e2df4[_0xf86b('0x57')],null))['then'](respondWithResult(_0x5c3b0b,null))[_0xf86b('0x28')](handleError(_0x5c3b0b,null));};exports[_0xf86b('0x32')]=function(_0x43441d,_0x2b7afc){return db['FaxMessage'][_0xf86b('0x55')]({'where':{'id':_0x43441d[_0xf86b('0x58')]['id']}})[_0xf86b('0x20')](handleEntityNotFound(_0x2b7afc,null))['then'](removeEntity(_0x2b7afc,null))[_0xf86b('0x28')](handleError(_0x2b7afc,null));};exports[_0xf86b('0x59')]=function(_0x465da1,_0x5de77f){return db[_0xf86b('0x38')][_0xf86b('0x59')]()[_0xf86b('0x20')](respondWithResult(_0x5de77f,null))['catch'](handleError(_0x5de77f,null));};var interaction_log=require(_0xf86b('0x5a'))(_0xf86b('0x5b'));exports['accept']=function(_0x4ec486,_0x2e63ab,_0x28d640){var _0x3bcce4={'agent':{},'channel':'fax'};if(_0x4ec486[_0xf86b('0x57')]['id']){delete _0x4ec486[_0xf86b('0x57')]['id'];}_0x4ec486[_0xf86b('0x57')][_0xf86b('0x5c')]=!![];_0x4ec486[_0xf86b('0x57')][_0xf86b('0x5d')]=moment()[_0xf86b('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ec486[_0xf86b('0x57')][_0xf86b('0x5f')]=_0x4ec486[_0xf86b('0x57')][_0xf86b('0x5f')]||_0x4ec486[_0xf86b('0x60')]['id'];_0x3bcce4[_0xf86b('0x61')]['id']=_0x4ec486[_0xf86b('0x57')][_0xf86b('0x5f')];return db[_0xf86b('0x38')]['find']({'where':{'id':_0x4ec486[_0xf86b('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e63ab,null))[_0xf86b('0x20')](saveUpdates(_0x4ec486[_0xf86b('0x57')],null))['then'](function(_0x1086e4){if(_0x1086e4){_0x3bcce4[_0xf86b('0x26')]=_0x1086e4[_0xf86b('0x62')]({'plain':!![]});return db[_0xf86b('0x63')][_0xf86b('0x55')]({'where':{'id':_0x1086e4[_0xf86b('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x2e63ab,null))['then'](function(_0x45096c){if(_0x45096c){return _0x45096c[_0xf86b('0x56')]({'UserId':_0x4ec486[_0xf86b('0x57')][_0xf86b('0x5f')],'read1stAt':_[_0xf86b('0x65')](_0x45096c[_0xf86b('0x66')])?moment()['format'](_0xf86b('0x67')):undefined});}return null;})[_0xf86b('0x20')](function(_0x23ddca){if(_0x23ddca){_0x3bcce4['interaction']=_0x23ddca[_0xf86b('0x62')]({'plain':!![]});interaction_log[_0xf86b('0x27')](_0xf86b('0x68'),_0x4ec486[_0xf86b('0x60')]['id'],_0x4ec486[_0xf86b('0x60')][_0xf86b('0x36')],_0x4ec486[_0xf86b('0x60')][_0xf86b('0x69')],_0x3bcce4['interaction']['id'],_0x4ec486[_0xf86b('0x57')]?JSON['stringify'](_0x4ec486[_0xf86b('0x57')]):'null');return respondWithRpcPromise(_0xf86b('0x6a'),_0xf86b('0x6b'),_0x3bcce4);}return null;})[_0xf86b('0x20')](function(_0x2f703f){var _0x43d3fd=_0xf86b('0x6c')+_0x2f703f[_0xf86b('0x26')]['ContactId'];return db[_0xf86b('0x6d')][_0xf86b('0x3f')](_0x43d3fd,{'type':db['Sequelize'][_0xf86b('0x6e')][_0xf86b('0x6f')],'raw':!![]})[_0xf86b('0x20')](function(_0x2f6fa6){return _0x2f6fa6;});})[_0xf86b('0x20')](function(_0xda615a){if(_0xda615a){_0x3bcce4[_0xf86b('0x26')]['contact']=_0xda615a[0x0];if(!_0x4ec486[_0xf86b('0x57')][_0xf86b('0x5f')])return;return db[_0xf86b('0x70')][_0xf86b('0x55')]({'where':{'id':_0x4ec486[_0xf86b('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0xf86b('0x36'),_0xf86b('0x71'),_0xf86b('0x72'),_0xf86b('0x73')],'raw':!![]});}return null;})['then'](function(_0x4f19d4){if(!_0x4f19d4)return null;_0x3bcce4[_0xf86b('0x26')]['agent']=_0x4f19d4;return _0x3bcce4;})[_0xf86b('0x20')](function(_0x3d8ae4){if(_0x3d8ae4){if(_0x4ec486[_0xf86b('0x57')][_0xf86b('0x74')]){_0x3bcce4[_0xf86b('0x26')]['interface']=util[_0xf86b('0x5e')](_0xf86b('0x75'),_0x4ec486['user']['name']);_0x3bcce4[_0xf86b('0x26')][_0xf86b('0x76')]=_0x3bcce4[_0xf86b('0x76')];_0x3bcce4[_0xf86b('0x26')][_0xf86b('0x77')]=_0x3bcce4[_0xf86b('0x76')];_0x3bcce4[_0xf86b('0x26')][_0xf86b('0x78')]=_0xf86b('0x79');return respondWithRpcPromise(_0xf86b('0x7a'),_0xf86b('0x7a'),{'event':_0xf86b('0x7b'),'message':_0x3bcce4[_0xf86b('0x26')]},client9002)[_0xf86b('0x20')](function(){return _0x3bcce4;});}return _0x3bcce4;}return null;})['then'](respondWithResult(_0x2e63ab,null))[_0xf86b('0x28')](handleError(_0x2e63ab,null));};var interaction_log=require(_0xf86b('0x5a'))(_0xf86b('0x5b'));exports[_0xf86b('0x31')]=function(_0x4c59a2,_0x143b65,_0xad53ae){var _0x5d3e2e={'agent':{},'channel':'fax'};if(_0x4c59a2[_0xf86b('0x57')]['id']){delete _0x4c59a2[_0xf86b('0x57')]['id'];}_0x4c59a2[_0xf86b('0x57')]['UserId']=_0x4c59a2[_0xf86b('0x57')]['UserId']||_0x4c59a2['user']['id'];_0x5d3e2e[_0xf86b('0x61')]['id']=_0x4c59a2[_0xf86b('0x57')][_0xf86b('0x5f')];return db['FaxMessage'][_0xf86b('0x55')]({'where':{'id':_0x4c59a2[_0xf86b('0x58')]['id'],'UserId':null}})[_0xf86b('0x20')](handleEntityNotFound(_0x143b65,null))[_0xf86b('0x20')](function(_0x18ce64){if(_0x18ce64){_0x5d3e2e[_0xf86b('0x26')]=_0x18ce64[_0xf86b('0x62')]({'plain':!![]});return db['FaxInteraction'][_0xf86b('0x55')]({'where':{'id':_0x18ce64[_0xf86b('0x64')]}});}return null;})[_0xf86b('0x20')](handleEntityNotFound(_0x143b65,null))['then'](function(_0x39cf3c){if(_0x39cf3c){_0x5d3e2e['interaction']=_0x39cf3c[_0xf86b('0x62')]({'plain':!![]});interaction_log['info'](_0xf86b('0x7c'),_0x4c59a2[_0xf86b('0x60')]['id'],_0x4c59a2[_0xf86b('0x60')][_0xf86b('0x36')],_0x4c59a2['user']['role'],_0x5d3e2e[_0xf86b('0x7d')]['id'],_0x4c59a2[_0xf86b('0x57')]?JSON[_0xf86b('0x7e')](_0x4c59a2[_0xf86b('0x57')]):'null');return respondWithRpcPromise(_0xf86b('0x7f'),'rejectMessage',_0x5d3e2e);}return null;})['then'](function(_0x4c7b27){var _0x571295=_0xf86b('0x6c')+_0x4c7b27[_0xf86b('0x26')][_0xf86b('0x80')];return db[_0xf86b('0x6d')][_0xf86b('0x3f')](_0x571295,{'type':db[_0xf86b('0x81')][_0xf86b('0x6e')][_0xf86b('0x6f')],'raw':!![]})['then'](function(_0xb1c0ed){return _0xb1c0ed;});})['then'](function(_0x843f23){if(_0x843f23){_0x5d3e2e[_0xf86b('0x26')][_0xf86b('0x82')]=_0x843f23[0x0];if(!_0x4c59a2[_0xf86b('0x57')][_0xf86b('0x5f')])return;return db[_0xf86b('0x70')][_0xf86b('0x55')]({'where':{'id':_0x4c59a2['body'][_0xf86b('0x5f')],'role':'agent'},'attributes':['id',_0xf86b('0x36'),_0xf86b('0x71'),_0xf86b('0x72'),_0xf86b('0x73')],'raw':!![]});}return null;})[_0xf86b('0x20')](function(_0x458566){if(!_0x458566)return null;_0x5d3e2e[_0xf86b('0x26')][_0xf86b('0x61')]=_0x458566;return _0x5d3e2e;})[_0xf86b('0x20')](function(_0x2e5ab7){if(_0x2e5ab7){_0x2e5ab7[_0xf86b('0x26')][_0xf86b('0x83')]=util['format'](_0xf86b('0x75'),_0x4c59a2['user'][_0xf86b('0x36')]);_0x2e5ab7[_0xf86b('0x26')][_0xf86b('0x76')]=_0x5d3e2e['channel'];_0x2e5ab7['message'][_0xf86b('0x77')]=_0x5d3e2e['channel'];_0x2e5ab7[_0xf86b('0x26')]['event']='reject';respondWithRpcPromise(_0xf86b('0x7a'),_0xf86b('0x7a'),{'event':'rejectmessage','message':_0x2e5ab7[_0xf86b('0x26')]},client9002);return _0x5d3e2e;}return null;})[_0xf86b('0x20')](respondWithResult(_0x143b65,null))[_0xf86b('0x28')](handleError(_0x143b65,null));};exports[_0xf86b('0x84')]=function(_0x360179,_0x5a6e95){var _0x118aea;return db[_0xf86b('0x38')][_0xf86b('0x84')](_0x360179['body'],{})['then'](function(_0x121f11){_0x118aea=_0x121f11;return db[_0xf86b('0x85')][_0xf86b('0x86')]({'where':{'id':_0x118aea['ContactId']}});})['then'](function(_0x1ecfc8){if(_['isNil'](_0x1ecfc8)){return;}else{_0x118aea[_0xf86b('0x87')]=_0x1ecfc8[_0xf86b('0x87')];return db[_0xf86b('0x88')][_0xf86b('0x86')]({'where':{'id':_0x118aea['AttachmentId']}});}})[_0xf86b('0x20')](function(_0x9ed56d){return respondWithRpcPromise(_0xf86b('0x89'),'SendFax',{'FaxAccountId':_[_0xf86b('0x65')](_0x360179['body'])?undefined:_0x360179[_0xf86b('0x57')][_0xf86b('0x8a')],'path':_[_0xf86b('0x65')](_0x9ed56d)?undefined:util[_0xf86b('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0x9ed56d[_0xf86b('0x8b')]),'fax':_[_0xf86b('0x65')](_0x118aea[_0xf86b('0x87')])?undefined:_0x118aea[_0xf86b('0x87')],'AttachmentId':_0x118aea[_0xf86b('0x8c')]},client9002);})[_0xf86b('0x20')](respondWithResult(_0x5a6e95,0xc9))[_0xf86b('0x28')](handleError(_0x5a6e95,null));};exports[_0xf86b('0x8d')]=function(_0x517b04,_0x4e1139){var _0x1b2d80=path[_0xf86b('0x8e')](config[_0xf86b('0x8f')],_0xf86b('0x90'),_0xf86b('0x91'),'attachments');return db[_0xf86b('0x38')]['find']({'where':{'id':_0x517b04[_0xf86b('0x58')]['id']},'include':[{'model':db['Attachment'],'as':_0xf86b('0x88')}]})[_0xf86b('0x20')](handleEntityNotFound(_0x4e1139,null))[_0xf86b('0x20')](function(_0x392084){if(_0x392084){return _0x4e1139[_0xf86b('0x8d')](path[_0xf86b('0x8e')](_0x1b2d80,_0x392084[_0xf86b('0x88')][_0xf86b('0x8b')]));}})['catch'](handleError(_0x4e1139,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index d5ee6c0..bd7b48b 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 _0xb931=['remove','emit','hasOwnProperty','hook','exports','FaxMessage','update'];(function(_0x52ab0a,_0xf641d5){var _0x1d2cab=function(_0x47d5a1){while(--_0x47d5a1){_0x52ab0a['push'](_0x52ab0a['shift']());}};_0x1d2cab(++_0xf641d5);}(_0xb931,0x155));var _0x1b93=function(_0xc5afe0,_0x211e91){_0xc5afe0=_0xc5afe0-0x0;var _0x24de40=_0xb931[_0xc5afe0];return _0x24de40;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x1b93('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b93('0x1'),'afterDestroy':_0x1b93('0x2')};function emitEvent(_0x2d11a5){return function(_0x42a943,_0x1c8b77,_0xa36141){FaxMessageEvents[_0x1b93('0x3')](_0x2d11a5+':'+_0x42a943['id'],_0x42a943);FaxMessageEvents[_0x1b93('0x3')](_0x2d11a5,_0x42a943);_0xa36141(null);};}for(var e in events){if(events[_0x1b93('0x4')](e)){var event=events[e];FaxMessage[_0x1b93('0x5')](e,emitEvent(event));}}module[_0x1b93('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0xe1d7=['update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x458b17,_0xe5d8e2){var _0x57f19a=function(_0x26831f){while(--_0x26831f){_0x458b17['push'](_0x458b17['shift']());}};_0x57f19a(++_0xe5d8e2);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0xfe3bc5,_0x2c8bad){_0xfe3bc5=_0xfe3bc5-0x0;var _0x46686a=_0xe1d7[_0xfe3bc5];return _0x46686a;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x7e1d('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e1d('0x1'),'afterDestroy':_0x7e1d('0x2')};function emitEvent(_0x416747){return function(_0x57e913,_0x347f78,_0x882bec){FaxMessageEvents[_0x7e1d('0x3')](_0x416747+':'+_0x57e913['id'],_0x57e913);FaxMessageEvents[_0x7e1d('0x3')](_0x416747,_0x57e913);_0x882bec(null);};}for(var e in events){if(events[_0x7e1d('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x7e1d('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 692b8af..7f8419e 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 _0x05ca=['FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./faxMessage.attributes','define','FaxMessage','fax_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x05ca,0x77));var _0xa05c=function(_0x52a054,_0x3c7619){_0x52a054=_0x52a054-0x0;var _0x285c58=_0x05ca[_0x52a054];return _0x285c58;};'use strict';var _=require(_0xa05c('0x0'));var util=require(_0xa05c('0x1'));var logger=require(_0xa05c('0x2'))('api');var moment=require(_0xa05c('0x3'));var BPromise=require(_0xa05c('0x4'));var rp=require(_0xa05c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa05c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa05c('0x7'));module['exports']=function(_0x417e8c,_0x26d5b6){return _0x417e8c[_0xa05c('0x8')](_0xa05c('0x9'),attributes,{'tableName':_0xa05c('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0xa05c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f5130,_0x23bac9,_0x375376){var _0x4523a4=_0x417e8c[_0xa05c('0xc')];var _0x98bc7c=_0x2f5130[_0xa05c('0xd')]({'plain':!![]});if(_0x98bc7c[_0xa05c('0xe')]['toLowerCase']()==='in'||_0x98bc7c['direction'][_0xa05c('0xf')]()==='out'&&!_0x98bc7c[_0xa05c('0x10')]&&!_[_0xa05c('0x11')](_0x98bc7c[_0xa05c('0x12')])){_0x4523a4[_0xa05c('0x13')][_0xa05c('0x14')]({'where':{'id':_0x98bc7c[_0xa05c('0x15')]}})[_0xa05c('0x16')](function(_0x268f14){if(_0x268f14){_0x268f14[_0xa05c('0x17')]({'lastMsgAt':_0x98bc7c[_0xa05c('0x18')],'lastMsgDirection':_0x98bc7c[_0xa05c('0xe')][_0xa05c('0xf')]()});}})[_0xa05c('0x19')](function(_0x5a771d){console['error'](_0x5a771d);});}_0x375376();}},'charset':_0xa05c('0x1a'),'collate':_0xa05c('0x1b')});}; \ No newline at end of file +var _0xf0fd=['define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','moment','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0x54ad18,_0x472c20){var _0x38bb91=function(_0x32439a){while(--_0x32439a){_0x54ad18['push'](_0x54ad18['shift']());}};_0x38bb91(++_0x472c20);}(_0xf0fd,0x14b));var _0xdf0f=function(_0x4bcb7f,_0x2b90cc){_0x4bcb7f=_0x4bcb7f-0x0;var _0x25f177=_0xf0fd[_0x4bcb7f];return _0x25f177;};'use strict';var _=require(_0xdf0f('0x0'));var util=require('util');var logger=require(_0xdf0f('0x1'))('api');var moment=require(_0xdf0f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdf0f('0x3'));var config=require(_0xdf0f('0x4'));var attributes=require(_0xdf0f('0x5'));module[_0xdf0f('0x6')]=function(_0xd8e4e5,_0x34de1f){return _0xd8e4e5[_0xdf0f('0x7')](_0xdf0f('0x8'),attributes,{'tableName':_0xdf0f('0x9'),'paranoid':![],'indexes':[{'name':_0xdf0f('0xa'),'fields':[_0xdf0f('0xb')],'type':_0xdf0f('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x192d02,_0x39bd13,_0x2a81ad){var _0x4c3630=_0xd8e4e5['models'];var _0xa6d914=_0x192d02[_0xdf0f('0xd')]({'plain':!![]});if(_0xa6d914[_0xdf0f('0xe')][_0xdf0f('0xf')]()==='in'||_0xa6d914[_0xdf0f('0xe')]['toLowerCase']()==='out'&&!_0xa6d914[_0xdf0f('0x10')]&&!_[_0xdf0f('0x11')](_0xa6d914['UserId'])){_0x4c3630[_0xdf0f('0x12')][_0xdf0f('0x13')]({'where':{'id':_0xa6d914[_0xdf0f('0x14')]}})[_0xdf0f('0x15')](function(_0x1441ae){if(_0x1441ae){_0x1441ae[_0xdf0f('0x16')]({'lastMsgAt':_0xa6d914['createdAt'],'lastMsgDirection':_0xa6d914['direction'][_0xdf0f('0xf')]()});}})[_0xdf0f('0x17')](function(_0x2fbafb){console[_0xdf0f('0x18')](_0x2fbafb);});}_0x2a81ad();}},'charset':'utf8mb4','collate':_0xdf0f('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index b2890c8..a87c373 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 _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x3f2639,_0x46917f){var _0x406475=function(_0x86d57){while(--_0x86d57){_0x3f2639['push'](_0x3f2639['shift']());}};_0x406475(++_0x46917f);}(_0x9f62,0x154));var _0x29f6=function(_0x1c839d,_0x35e8b0){_0x1c839d=_0x1c839d-0x0;var _0x2d2815=_0x9f62[_0x1c839d];return _0x2d2815;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});}; \ No newline at end of file +var _0x4b84=['CreateFaxMessage','FaxMessage','create','body','options','raw','stringify','UpdateFaxMessage','attributes','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','debug','error','message','FaxMessage,\x20%s,\x20%s','result'];(function(_0x42bf1b,_0x33a9a1){var _0x3412d9=function(_0x3dd9d8){while(--_0x3dd9d8){_0x42bf1b['push'](_0x42bf1b['shift']());}};_0x3412d9(++_0x33a9a1);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3b76f7,_0x566c53){_0x3b76f7=_0x3b76f7-0x0;var _0x43984e=_0x4b84[_0x3b76f7];return _0x43984e;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});config['redis']=_[_0x44b8('0x7')](config['redis'],{'host':_0x44b8('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x44b8('0x9'))[_0x44b8('0xa')](socket);function respondWithRpcPromise(_0x30ebc3,_0x48a371,_0xc650ec){return new BPromise(function(_0x2cc74b,_0x4315f6){return client[_0x44b8('0xb')](_0x30ebc3,_0xc650ec)[_0x44b8('0xc')](function(_0x37e471){logger[_0x44b8('0xd')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'));logger[_0x44b8('0xf')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x48a371,_0x44b8('0xe'),JSON['stringify'](_0x37e471));if(_0x37e471[_0x44b8('0x10')]){if(_0x37e471[_0x44b8('0x10')]['code']===0x1f4){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error'][_0x44b8('0x11')]);return _0x4315f6(_0x37e471[_0x44b8('0x10')][_0x44b8('0x11')]);}logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x37e471['error']['message']);return _0x2cc74b(_0x37e471[_0x44b8('0x10')]['message']);}else{logger[_0x44b8('0xd')](_0x44b8('0x12'),_0x48a371,'request\x20sent');_0x2cc74b(_0x37e471[_0x44b8('0x13')][_0x44b8('0x11')]);}})['catch'](function(_0x89bc30){logger[_0x44b8('0x10')]('FaxMessage,\x20%s,\x20%s',_0x48a371,_0x89bc30);_0x4315f6(_0x89bc30);});});}exports[_0x44b8('0x14')]=function(_0x8b4301){var _0xebfe79=this;return new Promise(function(_0x235bdc,_0x102ef9){return db[_0x44b8('0x15')][_0x44b8('0x16')](_0x8b4301[_0x44b8('0x17')],{'raw':_0x8b4301[_0x44b8('0x18')]?_0x8b4301[_0x44b8('0x18')][_0x44b8('0x19')]===undefined?!![]:![]:!![]})[_0x44b8('0xc')](function(_0x48327e){logger[_0x44b8('0xd')](_0x44b8('0x14'),_0x8b4301);logger[_0x44b8('0xf')](_0x44b8('0x14'),_0x8b4301,JSON[_0x44b8('0x1a')](_0x48327e));_0x235bdc(_0x48327e);})['catch'](function(_0x402497){logger['error'](_0x44b8('0x14'),_0x402497[_0x44b8('0x11')],_0x8b4301);_0x102ef9(_0xebfe79[_0x44b8('0x10')](0x1f4,_0x402497[_0x44b8('0x11')]));});});};exports[_0x44b8('0x1b')]=function(_0x59acbc){var _0x474f01=this;return new Promise(function(_0x502acf,_0x41d673){return db[_0x44b8('0x15')]['update'](_0x59acbc[_0x44b8('0x17')],{'raw':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59acbc[_0x44b8('0x18')]?_0x59acbc[_0x44b8('0x18')]['where']||null:null,'attributes':_0x59acbc[_0x44b8('0x18')]?_0x59acbc['options'][_0x44b8('0x1c')]||null:null,'limit':_0x59acbc['options']?_0x59acbc['options']['limit']||null:null})[_0x44b8('0xc')](function(_0x29b18d){logger[_0x44b8('0xd')](_0x44b8('0x1b'),_0x59acbc);logger[_0x44b8('0xf')](_0x44b8('0x1b'),_0x59acbc,JSON[_0x44b8('0x1a')](_0x29b18d));_0x502acf(_0x29b18d);})[_0x44b8('0x1d')](function(_0xd1d320){logger[_0x44b8('0x10')](_0x44b8('0x1b'),_0xd1d320[_0x44b8('0x11')],_0x59acbc);_0x41d673(_0x474f01[_0x44b8('0x10')](0x1f4,_0xd1d320['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d40a1f2..49530e6 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 _0x6e62=['removeListener','save','remove','update','emit'];(function(_0x384ed9,_0x549286){var _0x11825f=function(_0x539b21){while(--_0x539b21){_0x384ed9['push'](_0x384ed9['shift']());}};_0x11825f(++_0x549286);}(_0x6e62,0xab));var _0x26e6=function(_0x4b7aab,_0x15c40a){_0x4b7aab=_0x4b7aab-0x0;var _0x3fb70b=_0x6e62[_0x4b7aab];return _0x3fb70b;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x26e6('0x0'),_0x26e6('0x1'),_0x26e6('0x2')];function createListener(_0x57798b,_0x520d09){return function(_0x63db16){_0x520d09[_0x26e6('0x3')](_0x57798b,_0x63db16);};}function removeListener(_0x439bd2,_0x4c61ed){return function(){FaxMessageEvents[_0x26e6('0x4')](_0x439bd2,_0x4c61ed);};}exports['register']=function(_0x2f2512){for(var _0x5aeb79=0x0,_0x28ec6a=events['length'];_0x5aeb79<_0x28ec6a;_0x5aeb79++){var _0x5b541e=events[_0x5aeb79];var _0x204ced=createListener('faxMessage:'+_0x5b541e,_0x2f2512);FaxMessageEvents['on'](_0x5b541e,_0x204ced);}}; \ No newline at end of file +var _0x66fb=['update','emit','length','faxMessage:','./faxMessage.events','save','remove'];(function(_0x2acc2c,_0x5becd2){var _0x384c95=function(_0x1aece0){while(--_0x1aece0){_0x2acc2c['push'](_0x2acc2c['shift']());}};_0x384c95(++_0x5becd2);}(_0x66fb,0x1ee));var _0xb66f=function(_0x516e7b,_0x263143){_0x516e7b=_0x516e7b-0x0;var _0x34cdee=_0x66fb[_0x516e7b];return _0x34cdee;};'use strict';var FaxMessageEvents=require(_0xb66f('0x0'));var events=[_0xb66f('0x1'),_0xb66f('0x2'),_0xb66f('0x3')];function createListener(_0x67cc71,_0x2fd1c6){return function(_0x24d4e1){_0x2fd1c6[_0xb66f('0x4')](_0x67cc71,_0x24d4e1);};}function removeListener(_0x447f97,_0x14cb5a){return function(){FaxMessageEvents['removeListener'](_0x447f97,_0x14cb5a);};}exports['register']=function(_0x2a0563){for(var _0x15bf0f=0x0,_0x3120af=events[_0xb66f('0x5')];_0x15bf0f<_0x3120af;_0x15bf0f++){var _0x3b93c4=events[_0x15bf0f];var _0x3725c0=createListener(_0xb66f('0x6')+_0x3b93c4,_0x2a0563);FaxMessageEvents['on'](_0x3b93c4,_0x3725c0);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index bea354d..0fed33a 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 _0xfe57=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','show','download','faxmessage:create','create','put','/:id','update','/:id/reject','reject','destroy','exports','multer','util','express'];(function(_0x5b740b,_0x381833){var _0x6f8f4e=function(_0x86d068){while(--_0x86d068){_0x5b740b['push'](_0x5b740b['shift']());}};_0x6f8f4e(++_0x381833);}(_0xfe57,0x195));var _0x7fe5=function(_0x8ae98b,_0x155f88){_0x8ae98b=_0x8ae98b-0x0;var _0xc30bd4=_0xfe57[_0x8ae98b];return _0xc30bd4;};'use strict';var multer=require(_0x7fe5('0x0'));var util=require(_0x7fe5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7fe5('0x2'));var router=express[_0x7fe5('0x3')]();var fs_extra=require(_0x7fe5('0x4'));var auth=require(_0x7fe5('0x5'));var interaction=require(_0x7fe5('0x6'));var config=require(_0x7fe5('0x7'));var controller=require(_0x7fe5('0x8'));router[_0x7fe5('0x9')]('/',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xb')]);router[_0x7fe5('0x9')](_0x7fe5('0xc'),auth[_0x7fe5('0xa')](),controller['describe']);router[_0x7fe5('0x9')]('/:id',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xd')]);router['get']('/:id/download',auth[_0x7fe5('0xa')](),controller[_0x7fe5('0xe')]);router['post']('/',auth[_0x7fe5('0xa')](),interaction['tracked']('fax',_0x7fe5('0xf')),controller[_0x7fe5('0x10')]);router[_0x7fe5('0x11')](_0x7fe5('0x12'),auth['isAuthenticated'](),controller[_0x7fe5('0x13')]);router[_0x7fe5('0x11')]('/:id/accept',auth[_0x7fe5('0xa')](),controller['accept']);router[_0x7fe5('0x11')](_0x7fe5('0x14'),auth['isAuthenticated'](),controller[_0x7fe5('0x15')]);router['delete'](_0x7fe5('0x12'),auth[_0x7fe5('0xa')](),controller[_0x7fe5('0x16')]);module[_0x7fe5('0x17')]=router; \ No newline at end of file +var _0x579c=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3dcac2,_0x1a3cc1){var _0x32fe0a=function(_0xf689b9){while(--_0xf689b9){_0x3dcac2['push'](_0x3dcac2['shift']());}};_0x32fe0a(++_0x1a3cc1);}(_0x579c,0xda));var _0xc579=function(_0x3dd6cc,_0x203488){_0x3dd6cc=_0x3dd6cc-0x0;var _0x45c035=_0x579c[_0x3dd6cc];return _0x45c035;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/describe',auth[_0xc579('0xa')](),controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth['isAuthenticated'](),controller[_0xc579('0x10')]);router[_0xc579('0x11')]('/',auth[_0xc579('0xa')](),interaction[_0xc579('0x12')](_0xc579('0x13'),_0xc579('0x14')),controller[_0xc579('0x15')]);router[_0xc579('0x16')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x17')]);router['put'](_0xc579('0x18'),auth['isAuthenticated'](),controller[_0xc579('0x19')]);router['put'](_0xc579('0x1a'),auth['isAuthenticated'](),controller[_0xc579('0x1b')]);router['delete'](_0xc579('0xd'),auth[_0xc579('0xa')](),controller['destroy']);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 2bcb857..eec1043 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 _0xf6ff=['ENUM','beepall','INTEGER','sequelize','exports','name','STRING'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0xf6ff,0x11b));var _0xff6f=function(_0x5d3ab1,_0x3d0c4f){_0x5d3ab1=_0x5d3ab1-0x0;var _0x181a99=_0xf6ff[_0x5d3ab1];return _0x181a99;};'use strict';var Sequelize=require(_0xff6f('0x0'));module[_0xff6f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xff6f('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xff6f('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xff6f('0x4')]('rrmemory',_0xff6f('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xff6f('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9a0a=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x3e505c,_0x475aaf){var _0x5c6b70=function(_0x22810c){while(--_0x22810c){_0x3e505c['push'](_0x3e505c['shift']());}};_0x5c6b70(++_0x475aaf);}(_0x9a0a,0x7c));var _0xa9a0=function(_0x303580,_0x1e856d){_0x303580=_0x303580-0x0;var _0x4776a9=_0x9a0a[_0x303580];return _0x4776a9;};'use strict';var Sequelize=require(_0xa9a0('0x0'));module[_0xa9a0('0x1')]={'name':{'type':Sequelize[_0xa9a0('0x2')],'unique':_0xa9a0('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa9a0('0x2')]},'timeout':{'type':Sequelize[_0xa9a0('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa9a0('0x5')](_0xa9a0('0x6'),_0xa9a0('0x7'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa9a0('0x4')],'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 ac00b90..9e001b3 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 _0x6050=['pick','getTeams','nolimit','addTeams','ids','online','voicePause','interface','flatMap','Agents','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','isArray','getAgents','order','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','hasOwnProperty','sort','FaxQueueId','filter','User','agent','faxPause','updatedAt','createdAt','map','format','%s/%s','findOne','Team'];(function(_0x422a5f,_0x590c7a){var _0x4b3202=function(_0x2e4b88){while(--_0x2e4b88){_0x422a5f['push'](_0x422a5f['shift']());}};_0x4b3202(++_0x590c7a);}(_0x6050,0x196));var _0x0605=function(_0x5c0f72,_0xa0f850){_0x5c0f72=_0x5c0f72-0x0;var _0x435d56=_0x6050[_0x5c0f72];return _0x435d56;};'use strict';var BPromise=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var _=require(_0x0605('0x2'));var squel=require(_0x0605('0x3'));var Redis=require(_0x0605('0x4'));var qs=require(_0x0605('0x5'));var logger=require('../../config/logger')(_0x0605('0x6'));var config=require(_0x0605('0x7'));var db=require(_0x0605('0x8'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0605('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0x0605('0xa')](socket);function respondWithStatusCode(_0x11b8b5,_0xa08eca){_0xa08eca=_0xa08eca||0xcc;return function(_0x5bb96){if(_0x5bb96){return _0x11b8b5[_0x0605('0xb')](_0xa08eca);}return _0x11b8b5['status'](_0xa08eca)[_0x0605('0xc')]();};}function respondWithResult(_0x23dc2b,_0xe54b22){_0xe54b22=_0xe54b22||0xc8;return function(_0x2c5e23){if(_0x2c5e23){return _0x23dc2b[_0x0605('0xd')](_0xe54b22)[_0x0605('0xe')](_0x2c5e23);}};}function respondWithFilteredResult(_0x4385d3,_0x4af103){return function(_0x1e8014){if(_0x1e8014){var _0x434e62=typeof _0x4af103[_0x0605('0xf')]===_0x0605('0x10')&&typeof _0x4af103[_0x0605('0x11')]===_0x0605('0x10');var _0x22c011=_0x1e8014[_0x0605('0x12')];var _0x169a70=_0x434e62?0x0:_0x4af103[_0x0605('0xf')];var _0x1b944f=_0x434e62?_0x1e8014['count']:_0x4af103[_0x0605('0xf')]+_0x4af103[_0x0605('0x11')];var _0x4993ab;if(_0x1b944f>=_0x22c011){_0x1b944f=_0x22c011;_0x4993ab=0xc8;}else{_0x4993ab=0xce;}_0x4385d3['status'](_0x4993ab);return _0x4385d3['set'](_0x0605('0x13'),_0x169a70+'-'+_0x1b944f+'/'+_0x22c011)[_0x0605('0xe')](_0x1e8014);}return null;};}function saveUpdates(_0xa83443){return function(_0x2d46ef){if(_0x2d46ef){return _0x2d46ef[_0x0605('0x14')](_0xa83443)[_0x0605('0x15')](function(_0x2b7b5a){return _0x2b7b5a;});}return null;};}function removeEntity(_0x1d57ba){return function(_0x193520){if(_0x193520){return _0x193520[_0x0605('0x16')]()[_0x0605('0x15')](function(){var _0x2fa77e=_0x193520[_0x0605('0x17')]({'plain':!![]});var _0x103952='FaxQueues';return db[_0x0605('0x18')][_0x0605('0x16')]({'where':{'type':_0x103952,'resourceId':_0x2fa77e['id']}})[_0x0605('0x15')](function(){return _0x193520;});})[_0x0605('0x15')](function(){_0x1d57ba[_0x0605('0xd')](0xcc)[_0x0605('0xc')]();});}};}function handleEntityNotFound(_0x379211){return function(_0x2c90ed){if(!_0x2c90ed){_0x379211[_0x0605('0xb')](0x194);}return _0x2c90ed;};}function handleError(_0x5b0d44,_0xc334b8){_0xc334b8=_0xc334b8||0x1f4;return function(_0x4fe293){logger[_0x0605('0x19')](_0x4fe293[_0x0605('0x1a')]);if(_0x4fe293[_0x0605('0x1b')]){delete _0x4fe293[_0x0605('0x1b')];}_0x5b0d44[_0x0605('0xd')](_0xc334b8)[_0x0605('0x1c')](_0x4fe293);};}exports[_0x0605('0x1d')]=function(_0x1ae3db,_0x234231){var _0x2896d7={};var _0x9f2833={'count':0x0,'rows':[]};var _0x1c3722=_['map'](db[_0x0605('0x1e')][_0x0605('0x1f')],function(_0x4b1e0c){return{'name':_0x4b1e0c['fieldName'],'type':_0x4b1e0c['type'][_0x0605('0x20')]};});_0x2896d7=qs[_0x0605('0x21')](_0x1c3722,_0x1ae3db);var _0x4163cd={'where':_0x2896d7[_0x0605('0x22')]};return db[_0x0605('0x1e')][_0x0605('0x12')](_0x4163cd)['then'](function(_0x34f25d){_0x9f2833['count']=_0x34f25d;_0x2896d7[_0x0605('0x23')]=qs[_0x0605('0x23')](_0x1ae3db[_0x0605('0x24')]);return db[_0x0605('0x1e')][_0x0605('0x25')](_0x2896d7);})[_0x0605('0x15')](function(_0x56dd1a){_0x9f2833[_0x0605('0x26')]=_0x56dd1a;return _0x9f2833;})[_0x0605('0x15')](respondWithFilteredResult(_0x234231,_0x2896d7))[_0x0605('0x27')](handleError(_0x234231,null));};exports[_0x0605('0x28')]=function(_0x25d397,_0x39e9b7){var _0x2db998={'raw':!![],'where':{'id':_0x25d397[_0x0605('0x29')]['id']}},_0x362551={};_0x362551[_0x0605('0x2a')]=_[_0x0605('0x2b')](db[_0x0605('0x1e')][_0x0605('0x1f')]);_0x362551[_0x0605('0x24')]=_[_0x0605('0x2b')](_0x25d397[_0x0605('0x24')]);_0x362551[_0x0605('0x2c')]=_[_0x0605('0x2d')](_0x362551[_0x0605('0x2a')],_0x362551[_0x0605('0x24')]);_0x2db998[_0x0605('0x2e')]=_[_0x0605('0x2d')](_0x362551[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x25d397[_0x0605('0x24')][_0x0605('0x2f')]));_0x2db998[_0x0605('0x2e')]=_0x2db998['attributes'][_0x0605('0x30')]?_0x2db998[_0x0605('0x2e')]:_0x362551['model'];if(_0x25d397[_0x0605('0x24')][_0x0605('0x31')]){_0x2db998['include']=[{'all':!![]}];}_0x2db998=_[_0x0605('0x32')]({},_0x2db998,_0x25d397[_0x0605('0x33')]);return db[_0x0605('0x1e')][_0x0605('0x34')](_0x2db998)[_0x0605('0x15')](handleEntityNotFound(_0x39e9b7,null))[_0x0605('0x15')](respondWithResult(_0x39e9b7,null))['catch'](handleError(_0x39e9b7,null));};exports['create']=function(_0x216f82,_0x18f7f2){return db[_0x0605('0x1e')]['create'](_0x216f82[_0x0605('0x35')],{})['then'](function(_0xbb1eeb){var _0x1e98f6=_0x216f82[_0x0605('0x36')][_0x0605('0x17')]({'plain':!![]});if(!_0x1e98f6)throw new Error(_0x0605('0x37'));if(_0x1e98f6[_0x0605('0x38')]===_0x0605('0x36')){var _0x24e5af=_0xbb1eeb[_0x0605('0x17')]({'plain':!![]});var _0x3fd533='FaxQueues';return db[_0x0605('0x39')]['find']({'where':{'name':_0x3fd533,'userProfileId':_0x1e98f6[_0x0605('0x3a')]},'raw':!![]})[_0x0605('0x15')](function(_0x45787e){if(_0x45787e&&_0x45787e['autoAssociation']===0x0){return db['UserProfileResource'][_0x0605('0x3b')]({'name':_0x24e5af['name'],'resourceId':_0x24e5af['id'],'type':_0x45787e[_0x0605('0x1b')],'sectionId':_0x45787e['id']},{})[_0x0605('0x15')](function(){return _0xbb1eeb;});}else{return _0xbb1eeb;}})[_0x0605('0x27')](function(_0x3de34a){logger[_0x0605('0x19')](_0x0605('0x3c'),_0x3de34a);throw _0x3de34a;});}return _0xbb1eeb;})[_0x0605('0x15')](respondWithResult(_0x18f7f2,0xc9))[_0x0605('0x27')](handleError(_0x18f7f2,null));};exports[_0x0605('0x14')]=function(_0x10bb36,_0x18d3ce){if(_0x10bb36[_0x0605('0x35')]['id']){delete _0x10bb36[_0x0605('0x35')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x10bb36[_0x0605('0x29')]['id']}})['then'](handleEntityNotFound(_0x18d3ce,null))[_0x0605('0x15')](saveUpdates(_0x10bb36[_0x0605('0x35')],null))['then'](respondWithResult(_0x18d3ce,null))[_0x0605('0x27')](handleError(_0x18d3ce,null));};exports[_0x0605('0x16')]=function(_0x5057a6,_0x36ab0e){return db[_0x0605('0x1e')]['find']({'where':{'id':_0x5057a6[_0x0605('0x29')]['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x36ab0e,null))['then'](removeEntity(_0x36ab0e,null))[_0x0605('0x27')](handleError(_0x36ab0e,null));};exports['describe']=function(_0x5df8d1,_0x1fa208){return db[_0x0605('0x1e')][_0x0605('0x3d')]()[_0x0605('0x15')](respondWithResult(_0x1fa208,null))[_0x0605('0x27')](handleError(_0x1fa208,null));};exports[_0x0605('0x3e')]=function(_0x3d7cfc,_0x232c93){var _0x56190c={'raw':!![],'where':{}},_0x337f79={},_0x415b31;return db[_0x0605('0x1e')]['findOne']({'where':{'id':_0x3d7cfc[_0x0605('0x29')]['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x232c93,null))[_0x0605('0x15')](function(_0x3a1624){if(_0x3a1624){_0x415b31=_0x3a1624[_0x0605('0x17')]({'plain':!![]});_0x337f79[_0x0605('0x2a')]=_[_0x0605('0x2b')](db[_0x0605('0x3f')][_0x0605('0x1f')]);_0x337f79['query']=_[_0x0605('0x2b')](_0x3d7cfc[_0x0605('0x24')]);_0x337f79[_0x0605('0x2c')]=_[_0x0605('0x2d')](_0x337f79[_0x0605('0x2a')],_0x337f79[_0x0605('0x24')]);_0x56190c[_0x0605('0x2e')]=_[_0x0605('0x2d')](_0x337f79[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x3d7cfc['query']['fields']));_0x56190c['attributes']=_0x56190c[_0x0605('0x2e')][_0x0605('0x30')]?_0x56190c[_0x0605('0x2e')]:_0x337f79[_0x0605('0x2a')];if(!_0x3d7cfc[_0x0605('0x24')][_0x0605('0x40')]('nolimit')){_0x56190c[_0x0605('0x11')]=qs[_0x0605('0x11')](_0x3d7cfc[_0x0605('0x24')][_0x0605('0x11')]);_0x56190c['offset']=qs[_0x0605('0xf')](_0x3d7cfc[_0x0605('0x24')][_0x0605('0xf')]);}_0x56190c['order']=qs['sort'](_0x3d7cfc[_0x0605('0x24')][_0x0605('0x41')]);_0x56190c[_0x0605('0x22')]=qs['filters'](_['pick'](_0x3d7cfc[_0x0605('0x24')],_0x337f79['filters']));_0x56190c[_0x0605('0x22')][_0x0605('0x42')]=_0x3a1624['id'];if(_0x3d7cfc[_0x0605('0x24')][_0x0605('0x43')]){_0x56190c[_0x0605('0x22')]=_[_0x0605('0x32')](_0x56190c[_0x0605('0x22')],{'$or':_['map'](_0x56190c[_0x0605('0x2e')],function(_0x510e63){var _0x40dd01={};_0x40dd01[_0x510e63]={'$like':'%'+_0x3d7cfc['query'][_0x0605('0x43')]+'%'};return _0x40dd01;})});}_0x56190c=_[_0x0605('0x32')]({},_0x56190c,_0x3d7cfc[_0x0605('0x33')]);return db[_0x0605('0x3f')]['findAll'](_0x56190c);}})['then'](function(_0x418d20){if(_0x418d20){return db[_0x0605('0x44')]['findAndCountAll']({'where':{'id':_['map'](_0x418d20,'UserId'),'role':_0x0605('0x45')},'attributes':['id',_0x0605('0x1b'),_0x0605('0x46'),_0x0605('0x47'),_0x0605('0x48')]});}})[_0x0605('0x15')](function(_0x491ff2){if(_0x491ff2){return{'count':_0x491ff2[_0x0605('0x12')],'rows':_[_0x0605('0x49')](_0x491ff2[_0x0605('0x26')],function(_0x31fda0){return{'membername':_0x31fda0[_0x0605('0x1b')],'UserId':_0x31fda0['id'],'queue_name':_0x415b31[_0x0605('0x1b')],'FaxQueueId':_0x415b31['id'],'interface':util[_0x0605('0x4a')](_0x0605('0x4b'),'SIP',_0x31fda0['name']),'penalty':0x0,'paused':_0x31fda0['faxPause'],'createdAt':_0x31fda0[_0x0605('0x48')],'updatedAt':_0x31fda0[_0x0605('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0605('0x15')](respondWithFilteredResult(_0x232c93,_0x56190c))['catch'](handleError(_0x232c93,null));};exports['getTeams']=function(_0x36fb25,_0x2227c9){var _0x8ae474={};var _0x3cfbb7={};var _0x14cc4c;var _0x437c90;return db[_0x0605('0x1e')][_0x0605('0x4c')]({'where':{'id':_0x36fb25[_0x0605('0x29')]['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x2227c9,null))[_0x0605('0x15')](function(_0xa2b60){if(_0xa2b60){_0x14cc4c=_0xa2b60;_0x3cfbb7['model']=_[_0x0605('0x2b')](db[_0x0605('0x4d')][_0x0605('0x1f')]);_0x3cfbb7[_0x0605('0x24')]=_[_0x0605('0x2b')](_0x36fb25[_0x0605('0x24')]);_0x3cfbb7['filters']=_[_0x0605('0x2d')](_0x3cfbb7['model'],_0x3cfbb7['query']);_0x8ae474[_0x0605('0x2e')]=_[_0x0605('0x2d')](_0x3cfbb7[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x36fb25[_0x0605('0x24')][_0x0605('0x2f')]));_0x8ae474[_0x0605('0x2e')]=_0x8ae474[_0x0605('0x2e')][_0x0605('0x30')]?_0x8ae474[_0x0605('0x2e')]:_0x3cfbb7['model'];_0x8ae474['order']=qs['sort'](_0x36fb25['query']['sort']);_0x8ae474[_0x0605('0x22')]=qs[_0x0605('0x2c')](_[_0x0605('0x4e')](_0x36fb25['query'],_0x3cfbb7[_0x0605('0x2c')]));if(_0x36fb25[_0x0605('0x24')][_0x0605('0x43')]){_0x8ae474[_0x0605('0x22')]=_[_0x0605('0x32')](_0x8ae474[_0x0605('0x22')],{'$or':_['map'](_0x8ae474[_0x0605('0x2e')],function(_0x41cae9){var _0x38e202={};_0x38e202[_0x41cae9]={'$like':'%'+_0x36fb25['query']['filter']+'%'};return _0x38e202;})});}_0x8ae474=_['merge']({},_0x8ae474,_0x36fb25[_0x0605('0x33')]);return _0x14cc4c[_0x0605('0x4f')](_0x8ae474);}})[_0x0605('0x15')](function(_0x542607){if(_0x542607){_0x437c90=_0x542607['length'];if(!_0x36fb25['query'][_0x0605('0x40')](_0x0605('0x50'))){_0x8ae474['limit']=qs[_0x0605('0x11')](_0x36fb25[_0x0605('0x24')][_0x0605('0x11')]);_0x8ae474[_0x0605('0xf')]=qs[_0x0605('0xf')](_0x36fb25[_0x0605('0x24')][_0x0605('0xf')]);}return _0x14cc4c[_0x0605('0x4f')](_0x8ae474);}})[_0x0605('0x15')](function(_0x1dbed6){if(_0x1dbed6){return _0x1dbed6?{'count':_0x437c90,'rows':_0x1dbed6}:null;}})[_0x0605('0x15')](respondWithResult(_0x2227c9,null))[_0x0605('0x27')](handleError(_0x2227c9,null));};exports[_0x0605('0x51')]=function(_0x4b1f58,_0x47e20b){var _0x1d500c=_0x4b1f58[_0x0605('0x35')][_0x0605('0x52')];return db['Team']['findAll']({'where':{'id':_0x1d500c},'attributes':['id'],'include':[{'model':db[_0x0605('0x44')],'as':'Agents','attributes':['id','name',_0x0605('0x53'),_0x0605('0x54'),_0x0605('0x55')],'raw':!![]}]})['then'](function(_0x5963c9){if(_0x5963c9){var _0x54e147=_[_0x0605('0x56')](_0x5963c9,function(_0x499892){var _0x8b4ffe=_0x499892[_0x0605('0x17')]({'plain':!![]});return _0x8b4ffe[_0x0605('0x57')];});return db[_0x0605('0x1e')][_0x0605('0x34')]({'where':{'id':_0x4b1f58[_0x0605('0x29')]['id']}})[_0x0605('0x15')](function(_0x1f6ae8){return db['sequelize']['transaction'](function(_0x37512f){return _0x1f6ae8[_0x0605('0x51')](_0x1d500c,{'transaction':_0x37512f})['then'](function(){return BPromise[_0x0605('0x58')](_0x54e147,function(_0x5b29a5){return db[_0x0605('0x3f')][_0x0605('0x59')]({'where':{'UserId':_0x5b29a5['id'],'FaxQueueId':_0x4b1f58['params']['id']},'transaction':_0x37512f});});})[_0x0605('0x15')](function(){_0x54e147['forEach'](function(_0x45caba){socket[_0x0605('0x5a')](_0x0605('0x5b'),{'UserId':_0x45caba['id'],'FaxQueueId':_0x1f6ae8['id']});});});});});}})[_0x0605('0x15')](respondWithStatusCode(_0x47e20b,null))['catch'](handleError(_0x47e20b,null));};exports[_0x0605('0x5c')]=function(_0x4189ba,_0x54b8e2){return db[_0x0605('0x4d')][_0x0605('0x25')]({'where':{'id':_0x4189ba[_0x0605('0x24')][_0x0605('0x52')]},'attributes':['id'],'include':[{'model':db[_0x0605('0x44')],'as':_0x0605('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x54b8e2,null))['then'](function(_0x3f005a){var _0x1f441f=_[_0x0605('0x49')](_0x3f005a,'id');var _0x4302fb=[];var _0x4de957=[];var _0x9d49a=squel[_0x0605('0x5d')]();_0x9d49a[_0x0605('0x5e')](_0x0605('0x5f'))[_0x0605('0x60')](_0x0605('0x61'),'tq')[_0x0605('0x62')]('user_has_teams','ut',_0x0605('0x63'))[_0x0605('0x22')](_0x0605('0x64'),_0x4189ba[_0x0605('0x29')]['id']);for(var _0x4c49ac=0x0;_0x4c49ac<_0x3f005a['length'];_0x4c49ac+=0x1){let _0x1c08db=_0x3f005a[_0x4c49ac];for(var _0xc3baaa=0x0;_0xc3baaa<_0x1c08db['Agents'][_0x0605('0x30')];_0xc3baaa+=0x1){let _0x503568=_0x1c08db['Agents'][_0xc3baaa];var _0x23e12b=_0x9d49a[_0x0605('0x65')]();_0x23e12b[_0x0605('0x22')]('ut.UserId\x20=\x20?',_0x503568['id']);_0x4de957[_0x0605('0x66')](db[_0x0605('0x67')][_0x0605('0x24')](_0x23e12b[_0x0605('0x68')](),{'type':db[_0x0605('0x67')][_0x0605('0x69')][_0x0605('0x6a')]})[_0x0605('0x15')](function(_0x292178){if(_0x292178[_0x0605('0x30')]===0x1){return _0x503568['id'];}else{var _0x342c2b=_[_0x0605('0x6b')](_[_0x0605('0x49')](_0x292178,_0x0605('0x6c')),function(_0x1e14cc){return _[_0x0605('0x6d')](_0x1f441f,_0x1e14cc);});if(_0x342c2b){return _0x503568['id'];}}}));}}return BPromise['all'](_0x4de957)[_0x0605('0x15')](function(_0x106da4){_0x4302fb=_(_0x4302fb)[_0x0605('0x6e')](_0x106da4)[_0x0605('0x6f')]()[_0x0605('0x70')]();return db['FaxQueue'][_0x0605('0x34')]({'where':{'id':_0x4189ba[_0x0605('0x29')]['id']}})[_0x0605('0x15')](function(_0x5b7e88){return db[_0x0605('0x67')]['transaction'](function(_0xe02b78){return _0x5b7e88['removeTeams'](_0x4189ba['query'][_0x0605('0x52')],{'transaction':_0xe02b78})['then'](function(){if(!_['isEmpty'](_0x4302fb)){return _0x5b7e88[_0x0605('0x71')](_0x4302fb,{'transaction':_0xe02b78});}})[_0x0605('0x15')](function(){_0x4302fb[_0x0605('0x72')](function(_0x1a1e63){socket[_0x0605('0x5a')](_0x0605('0x73'),{'UserId':_0x1a1e63,'FaxQueueId':_0x5b7e88['id']});});});});});});})[_0x0605('0x15')](respondWithStatusCode(_0x54b8e2,null))['catch'](handleError(_0x54b8e2,null));};exports[_0x0605('0x74')]=function(_0xe989d1,_0x3ff76d){return db['FaxQueue'][_0x0605('0x34')]({'where':{'id':_0xe989d1['params']['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x3ff76d,null))[_0x0605('0x15')](function(_0x58278d){if(_0x58278d){return _0x58278d[_0x0605('0x74')](_0xe989d1['body']['ids'],_[_0x0605('0x75')](_0xe989d1[_0x0605('0x35')],[_0x0605('0x52'),'id'])||{})['spread'](function(_0x428f06){for(var _0x2e47d5=0x0;_0x2e47d5<_0xe989d1[_0x0605('0x35')][_0x0605('0x52')][_0x0605('0x30')];_0x2e47d5+=0x1){socket[_0x0605('0x5a')](_0x0605('0x5b'),{'UserId':Number(_0xe989d1[_0x0605('0x35')][_0x0605('0x52')][_0x2e47d5]),'FaxQueueId':Number(_0xe989d1[_0x0605('0x29')]['id'])});}return _0x428f06;});}})['then'](respondWithResult(_0x3ff76d,null))[_0x0605('0x27')](handleError(_0x3ff76d,null));};exports[_0x0605('0x71')]=function(_0xb75eda,_0x23a6ef){return db[_0x0605('0x1e')]['find']({'where':{'id':_0xb75eda[_0x0605('0x29')]['id']}})['then'](handleEntityNotFound(_0x23a6ef,null))[_0x0605('0x15')](function(_0x10e19e){if(_0x10e19e){return _0x10e19e['removeAgents'](_0xb75eda[_0x0605('0x24')][_0x0605('0x52')])[_0x0605('0x15')](function(){if(_[_0x0605('0x76')](_0xb75eda[_0x0605('0x24')][_0x0605('0x52')])){for(var _0x40449c=0x0;_0x40449c<_0xb75eda[_0x0605('0x24')]['ids'][_0x0605('0x30')];_0x40449c+=0x1){socket['emit'](_0x0605('0x73'),{'UserId':Number(_0xb75eda[_0x0605('0x24')][_0x0605('0x52')][_0x40449c]),'FaxQueueId':Number(_0xb75eda[_0x0605('0x29')]['id'])});}}else{socket[_0x0605('0x5a')]('userFaxQueue:remove',{'UserId':Number(_0xb75eda[_0x0605('0x24')][_0x0605('0x52')]),'FaxQueueId':Number(_0xb75eda[_0x0605('0x29')]['id'])});}});}})[_0x0605('0x15')](respondWithStatusCode(_0x23a6ef,null))[_0x0605('0x27')](handleError(_0x23a6ef,null));};exports[_0x0605('0x77')]=function(_0x5dd9f3,_0x403cd4){var _0x3ca4ff={};var _0x39e179={};var _0x26a089;var _0xfbe941;return db[_0x0605('0x1e')][_0x0605('0x4c')]({'where':{'id':_0x5dd9f3['params']['id']}})[_0x0605('0x15')](handleEntityNotFound(_0x403cd4,null))['then'](function(_0x139d90){if(_0x139d90){_0x26a089=_0x139d90;_0x39e179[_0x0605('0x2a')]=_['keys'](db[_0x0605('0x44')][_0x0605('0x1f')]);_0x39e179[_0x0605('0x24')]=_[_0x0605('0x2b')](_0x5dd9f3[_0x0605('0x24')]);_0x39e179[_0x0605('0x2c')]=_['intersection'](_0x39e179['model'],_0x39e179[_0x0605('0x24')]);_0x3ca4ff['attributes']=_[_0x0605('0x2d')](_0x39e179[_0x0605('0x2a')],qs[_0x0605('0x2f')](_0x5dd9f3[_0x0605('0x24')][_0x0605('0x2f')]));_0x3ca4ff[_0x0605('0x2e')]=_0x3ca4ff[_0x0605('0x2e')][_0x0605('0x30')]?_0x3ca4ff[_0x0605('0x2e')]:_0x39e179[_0x0605('0x2a')];_0x3ca4ff[_0x0605('0x78')]=qs[_0x0605('0x41')](_0x5dd9f3[_0x0605('0x24')][_0x0605('0x41')]);_0x3ca4ff[_0x0605('0x22')]=qs[_0x0605('0x2c')](_[_0x0605('0x4e')](_0x5dd9f3[_0x0605('0x24')],_0x39e179[_0x0605('0x2c')]));if(_0x5dd9f3['query'][_0x0605('0x43')]){_0x3ca4ff['where']=_[_0x0605('0x32')](_0x3ca4ff[_0x0605('0x22')],{'$or':_['map'](_0x3ca4ff[_0x0605('0x2e')],function(_0x1a1750){var _0x7e1946={};_0x7e1946[_0x1a1750]={'$like':'%'+_0x5dd9f3[_0x0605('0x24')][_0x0605('0x43')]+'%'};return _0x7e1946;})});}_0x3ca4ff=_[_0x0605('0x32')]({},_0x3ca4ff,_0x5dd9f3[_0x0605('0x33')]);return _0x26a089['getAgents'](_0x3ca4ff);}})[_0x0605('0x15')](function(_0x2f0cb5){if(_0x2f0cb5){_0xfbe941=_0x2f0cb5['length'];if(!_0x5dd9f3['query'][_0x0605('0x40')]('nolimit')){_0x3ca4ff[_0x0605('0x11')]=qs['limit'](_0x5dd9f3[_0x0605('0x24')][_0x0605('0x11')]);_0x3ca4ff['offset']=qs['offset'](_0x5dd9f3['query'][_0x0605('0xf')]);}return _0x26a089['getAgents'](_0x3ca4ff);}})[_0x0605('0x15')](function(_0x5c3dba){if(_0x5c3dba){return _0x5c3dba?{'count':_0xfbe941,'rows':_0x5c3dba}:null;}})[_0x0605('0x15')](respondWithResult(_0x403cd4,null))[_0x0605('0x27')](handleError(_0x403cd4,null));}; \ No newline at end of file +var _0xafc4=['Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','getOptions','include','findAll','rows','catch','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserFaxQueue','nolimit','order','sort','where','pick','FaxQueueId','filter','merge','options','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','hasOwnProperty','addTeams','ids','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x1a5cd7,_0x3811e9){var _0x399402=function(_0x2b388c){while(--_0x2b388c){_0x1a5cd7['push'](_0x1a5cd7['shift']());}};_0x399402(++_0x3811e9);}(_0xafc4,0x69));var _0x4afc=function(_0x1a7ee7,_0x428b16){_0x1a7ee7=_0x1a7ee7-0x0;var _0x3a4d4d=_0xafc4[_0x1a7ee7];return _0x3a4d4d;};'use strict';var BPromise=require(_0x4afc('0x0'));var util=require('util');var _=require(_0x4afc('0x1'));var squel=require('squel');var Redis=require(_0x4afc('0x2'));var qs=require(_0x4afc('0x3'));var logger=require(_0x4afc('0x4'))(_0x4afc('0x5'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x4afc('0x6')](config[_0x4afc('0x7')],{'host':_0x4afc('0x8'),'port':0x18eb});var socket=require(_0x4afc('0x9'))(new Redis(config[_0x4afc('0x7')]));require(_0x4afc('0xa'))['register'](socket);function respondWithStatusCode(_0x31e165,_0x1c740c){_0x1c740c=_0x1c740c||0xcc;return function(_0x134aad){if(_0x134aad){return _0x31e165[_0x4afc('0xb')](_0x1c740c);}return _0x31e165[_0x4afc('0xc')](_0x1c740c)[_0x4afc('0xd')]();};}function respondWithResult(_0x5542ec,_0x5c523b){_0x5c523b=_0x5c523b||0xc8;return function(_0x7f127f){if(_0x7f127f){return _0x5542ec['status'](_0x5c523b)[_0x4afc('0xe')](_0x7f127f);}};}function respondWithFilteredResult(_0x225793,_0x49b56f){return function(_0x38b322){if(_0x38b322){var _0x3fb54a=typeof _0x49b56f[_0x4afc('0xf')]===_0x4afc('0x10')&&typeof _0x49b56f[_0x4afc('0x11')]===_0x4afc('0x10');var _0x1ad8fd=_0x38b322[_0x4afc('0x12')];var _0x5effb4=_0x3fb54a?0x0:_0x49b56f[_0x4afc('0xf')];var _0x429fd8=_0x3fb54a?_0x38b322[_0x4afc('0x12')]:_0x49b56f[_0x4afc('0xf')]+_0x49b56f['limit'];var _0x4e32e8;if(_0x429fd8>=_0x1ad8fd){_0x429fd8=_0x1ad8fd;_0x4e32e8=0xc8;}else{_0x4e32e8=0xce;}_0x225793[_0x4afc('0xc')](_0x4e32e8);return _0x225793['set'](_0x4afc('0x13'),_0x5effb4+'-'+_0x429fd8+'/'+_0x1ad8fd)[_0x4afc('0xe')](_0x38b322);}return null;};}function saveUpdates(_0x2b928b){return function(_0x31eec4){if(_0x31eec4){return _0x31eec4[_0x4afc('0x14')](_0x2b928b)[_0x4afc('0x15')](function(_0x22f809){return _0x22f809;});}return null;};}function removeEntity(_0x3ad418){return function(_0x16365f){if(_0x16365f){return _0x16365f[_0x4afc('0x16')]()[_0x4afc('0x15')](function(){var _0x543f0c=_0x16365f[_0x4afc('0x17')]({'plain':!![]});var _0x25603b=_0x4afc('0x18');return db[_0x4afc('0x19')]['destroy']({'where':{'type':_0x25603b,'resourceId':_0x543f0c['id']}})[_0x4afc('0x15')](function(){return _0x16365f;});})[_0x4afc('0x15')](function(){_0x3ad418[_0x4afc('0xc')](0xcc)[_0x4afc('0xd')]();});}};}function handleEntityNotFound(_0x1559b8){return function(_0x3add4c){if(!_0x3add4c){_0x1559b8[_0x4afc('0xb')](0x194);}return _0x3add4c;};}function handleError(_0x573a75,_0x5403e4){_0x5403e4=_0x5403e4||0x1f4;return function(_0x3ecf2d){logger['error'](_0x3ecf2d[_0x4afc('0x1a')]);if(_0x3ecf2d['name']){delete _0x3ecf2d[_0x4afc('0x1b')];}_0x573a75[_0x4afc('0xc')](_0x5403e4)[_0x4afc('0x1c')](_0x3ecf2d);};}exports[_0x4afc('0x1d')]=function(_0x86dbd4,_0x28a86c){var _0x40a0db={};var _0x383a71={'count':0x0,'rows':[]};var _0x2bb837=_[_0x4afc('0x1e')](db[_0x4afc('0x1f')][_0x4afc('0x20')],function(_0x35f5b3){return{'name':_0x35f5b3['fieldName'],'type':_0x35f5b3[_0x4afc('0x21')][_0x4afc('0x22')]};});_0x40a0db=qs[_0x4afc('0x23')](_0x2bb837,_0x86dbd4);var _0x4e254d={'where':_0x40a0db['where']};return db['FaxQueue'][_0x4afc('0x12')](_0x4e254d)[_0x4afc('0x15')](function(_0x5e4747){_0x383a71[_0x4afc('0x12')]=_0x5e4747;_0x40a0db[_0x4afc('0x24')]=qs['include'](_0x86dbd4['query']);return db['FaxQueue'][_0x4afc('0x25')](_0x40a0db);})[_0x4afc('0x15')](function(_0x17a43d){_0x383a71[_0x4afc('0x26')]=_0x17a43d;return _0x383a71;})[_0x4afc('0x15')](respondWithFilteredResult(_0x28a86c,_0x40a0db))[_0x4afc('0x27')](handleError(_0x28a86c,null));};exports['show']=function(_0x290391,_0x3d1693){var _0x1ba6b5={'raw':!![],'where':{'id':_0x290391[_0x4afc('0x28')]['id']}},_0x2f178c={};_0x2f178c[_0x4afc('0x29')]=_[_0x4afc('0x2a')](db[_0x4afc('0x1f')]['rawAttributes']);_0x2f178c[_0x4afc('0x2b')]=_['keys'](_0x290391['query']);_0x2f178c[_0x4afc('0x2c')]=_[_0x4afc('0x2d')](_0x2f178c[_0x4afc('0x29')],_0x2f178c[_0x4afc('0x2b')]);_0x1ba6b5[_0x4afc('0x2e')]=_[_0x4afc('0x2d')](_0x2f178c['model'],qs[_0x4afc('0x2f')](_0x290391[_0x4afc('0x2b')][_0x4afc('0x2f')]));_0x1ba6b5[_0x4afc('0x2e')]=_0x1ba6b5[_0x4afc('0x2e')][_0x4afc('0x30')]?_0x1ba6b5['attributes']:_0x2f178c[_0x4afc('0x29')];if(_0x290391[_0x4afc('0x2b')][_0x4afc('0x31')]){_0x1ba6b5[_0x4afc('0x24')]=[{'all':!![]}];}_0x1ba6b5=_['merge']({},_0x1ba6b5,_0x290391['options']);return db[_0x4afc('0x1f')][_0x4afc('0x32')](_0x1ba6b5)[_0x4afc('0x15')](handleEntityNotFound(_0x3d1693,null))['then'](respondWithResult(_0x3d1693,null))['catch'](handleError(_0x3d1693,null));};exports[_0x4afc('0x33')]=function(_0x4a06cf,_0x5947bb){return db[_0x4afc('0x1f')][_0x4afc('0x33')](_0x4a06cf[_0x4afc('0x34')],{})[_0x4afc('0x15')](function(_0x395bc6){var _0x4420fb=_0x4a06cf[_0x4afc('0x35')][_0x4afc('0x17')]({'plain':!![]});if(!_0x4420fb)throw new Error(_0x4afc('0x36'));if(_0x4420fb[_0x4afc('0x37')]===_0x4afc('0x35')){var _0x3ef2aa=_0x395bc6[_0x4afc('0x17')]({'plain':!![]});var _0x40dca5=_0x4afc('0x18');return db['UserProfileSection'][_0x4afc('0x32')]({'where':{'name':_0x40dca5,'userProfileId':_0x4420fb[_0x4afc('0x38')]},'raw':!![]})[_0x4afc('0x15')](function(_0xe6db12){if(_0xe6db12&&_0xe6db12[_0x4afc('0x39')]===0x0){return db[_0x4afc('0x19')][_0x4afc('0x33')]({'name':_0x3ef2aa['name'],'resourceId':_0x3ef2aa['id'],'type':_0xe6db12['name'],'sectionId':_0xe6db12['id']},{})['then'](function(){return _0x395bc6;});}else{return _0x395bc6;}})[_0x4afc('0x27')](function(_0x105c03){logger['error'](_0x4afc('0x3a'),_0x105c03);throw _0x105c03;});}return _0x395bc6;})[_0x4afc('0x15')](respondWithResult(_0x5947bb,0xc9))[_0x4afc('0x27')](handleError(_0x5947bb,null));};exports[_0x4afc('0x14')]=function(_0x545109,_0x12b5db){if(_0x545109[_0x4afc('0x34')]['id']){delete _0x545109[_0x4afc('0x34')]['id'];}return db[_0x4afc('0x1f')][_0x4afc('0x32')]({'where':{'id':_0x545109[_0x4afc('0x28')]['id']}})['then'](handleEntityNotFound(_0x12b5db,null))[_0x4afc('0x15')](saveUpdates(_0x545109['body'],null))[_0x4afc('0x15')](respondWithResult(_0x12b5db,null))[_0x4afc('0x27')](handleError(_0x12b5db,null));};exports[_0x4afc('0x16')]=function(_0x5878eb,_0x57acad){return db[_0x4afc('0x1f')][_0x4afc('0x32')]({'where':{'id':_0x5878eb[_0x4afc('0x28')]['id']}})[_0x4afc('0x15')](handleEntityNotFound(_0x57acad,null))[_0x4afc('0x15')](removeEntity(_0x57acad,null))[_0x4afc('0x27')](handleError(_0x57acad,null));};exports[_0x4afc('0x3b')]=function(_0x3db440,_0x4c86f3){return db[_0x4afc('0x1f')][_0x4afc('0x3b')]()['then'](respondWithResult(_0x4c86f3,null))[_0x4afc('0x27')](handleError(_0x4c86f3,null));};exports['getMembers']=function(_0x20a2d3,_0x24a731){var _0x16c6c4={'raw':!![],'where':{}},_0x5e0ebd={},_0xd0f517;return db[_0x4afc('0x1f')][_0x4afc('0x3c')]({'where':{'id':_0x20a2d3[_0x4afc('0x28')]['id']}})[_0x4afc('0x15')](handleEntityNotFound(_0x24a731,null))[_0x4afc('0x15')](function(_0x5d9d90){if(_0x5d9d90){_0xd0f517=_0x5d9d90['get']({'plain':!![]});_0x5e0ebd['model']=_[_0x4afc('0x2a')](db[_0x4afc('0x3d')][_0x4afc('0x20')]);_0x5e0ebd[_0x4afc('0x2b')]=_[_0x4afc('0x2a')](_0x20a2d3[_0x4afc('0x2b')]);_0x5e0ebd[_0x4afc('0x2c')]=_[_0x4afc('0x2d')](_0x5e0ebd[_0x4afc('0x29')],_0x5e0ebd[_0x4afc('0x2b')]);_0x16c6c4['attributes']=_[_0x4afc('0x2d')](_0x5e0ebd['model'],qs['fields'](_0x20a2d3[_0x4afc('0x2b')]['fields']));_0x16c6c4[_0x4afc('0x2e')]=_0x16c6c4[_0x4afc('0x2e')][_0x4afc('0x30')]?_0x16c6c4[_0x4afc('0x2e')]:_0x5e0ebd['model'];if(!_0x20a2d3[_0x4afc('0x2b')]['hasOwnProperty'](_0x4afc('0x3e'))){_0x16c6c4[_0x4afc('0x11')]=qs[_0x4afc('0x11')](_0x20a2d3[_0x4afc('0x2b')][_0x4afc('0x11')]);_0x16c6c4[_0x4afc('0xf')]=qs[_0x4afc('0xf')](_0x20a2d3[_0x4afc('0x2b')][_0x4afc('0xf')]);}_0x16c6c4[_0x4afc('0x3f')]=qs[_0x4afc('0x40')](_0x20a2d3[_0x4afc('0x2b')]['sort']);_0x16c6c4[_0x4afc('0x41')]=qs[_0x4afc('0x2c')](_[_0x4afc('0x42')](_0x20a2d3[_0x4afc('0x2b')],_0x5e0ebd[_0x4afc('0x2c')]));_0x16c6c4[_0x4afc('0x41')][_0x4afc('0x43')]=_0x5d9d90['id'];if(_0x20a2d3[_0x4afc('0x2b')][_0x4afc('0x44')]){_0x16c6c4[_0x4afc('0x41')]=_[_0x4afc('0x45')](_0x16c6c4[_0x4afc('0x41')],{'$or':_[_0x4afc('0x1e')](_0x16c6c4['attributes'],function(_0x2abf25){var _0x549ee4={};_0x549ee4[_0x2abf25]={'$like':'%'+_0x20a2d3[_0x4afc('0x2b')][_0x4afc('0x44')]+'%'};return _0x549ee4;})});}_0x16c6c4=_[_0x4afc('0x45')]({},_0x16c6c4,_0x20a2d3[_0x4afc('0x46')]);return db['UserFaxQueue']['findAll'](_0x16c6c4);}})[_0x4afc('0x15')](function(_0x2f9790){if(_0x2f9790){return db['User'][_0x4afc('0x47')]({'where':{'id':_[_0x4afc('0x1e')](_0x2f9790,_0x4afc('0x48')),'role':_0x4afc('0x49')},'attributes':['id',_0x4afc('0x1b'),_0x4afc('0x4a'),_0x4afc('0x4b'),_0x4afc('0x4c')]});}})[_0x4afc('0x15')](function(_0x3369a8){if(_0x3369a8){return{'count':_0x3369a8[_0x4afc('0x12')],'rows':_[_0x4afc('0x1e')](_0x3369a8[_0x4afc('0x26')],function(_0x441f0a){return{'membername':_0x441f0a['name'],'UserId':_0x441f0a['id'],'queue_name':_0xd0f517[_0x4afc('0x1b')],'FaxQueueId':_0xd0f517['id'],'interface':util[_0x4afc('0x4d')](_0x4afc('0x4e'),_0x4afc('0x4f'),_0x441f0a[_0x4afc('0x1b')]),'penalty':0x0,'paused':_0x441f0a[_0x4afc('0x4a')],'createdAt':_0x441f0a[_0x4afc('0x4c')],'updatedAt':_0x441f0a['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4afc('0x15')](respondWithFilteredResult(_0x24a731,_0x16c6c4))[_0x4afc('0x27')](handleError(_0x24a731,null));};exports['getTeams']=function(_0x4b3439,_0x32a3d7){var _0x1f40d3={};var _0x2d7066={};var _0x389040;var _0x258fed;return db[_0x4afc('0x1f')][_0x4afc('0x3c')]({'where':{'id':_0x4b3439[_0x4afc('0x28')]['id']}})[_0x4afc('0x15')](handleEntityNotFound(_0x32a3d7,null))[_0x4afc('0x15')](function(_0x5f28b0){if(_0x5f28b0){_0x389040=_0x5f28b0;_0x2d7066['model']=_[_0x4afc('0x2a')](db[_0x4afc('0x50')]['rawAttributes']);_0x2d7066[_0x4afc('0x2b')]=_[_0x4afc('0x2a')](_0x4b3439['query']);_0x2d7066['filters']=_[_0x4afc('0x2d')](_0x2d7066[_0x4afc('0x29')],_0x2d7066[_0x4afc('0x2b')]);_0x1f40d3['attributes']=_[_0x4afc('0x2d')](_0x2d7066['model'],qs['fields'](_0x4b3439[_0x4afc('0x2b')][_0x4afc('0x2f')]));_0x1f40d3[_0x4afc('0x2e')]=_0x1f40d3[_0x4afc('0x2e')][_0x4afc('0x30')]?_0x1f40d3[_0x4afc('0x2e')]:_0x2d7066[_0x4afc('0x29')];_0x1f40d3[_0x4afc('0x3f')]=qs[_0x4afc('0x40')](_0x4b3439['query'][_0x4afc('0x40')]);_0x1f40d3[_0x4afc('0x41')]=qs[_0x4afc('0x2c')](_['pick'](_0x4b3439['query'],_0x2d7066['filters']));if(_0x4b3439[_0x4afc('0x2b')][_0x4afc('0x44')]){_0x1f40d3[_0x4afc('0x41')]=_['merge'](_0x1f40d3[_0x4afc('0x41')],{'$or':_['map'](_0x1f40d3['attributes'],function(_0x54625e){var _0x299849={};_0x299849[_0x54625e]={'$like':'%'+_0x4b3439[_0x4afc('0x2b')][_0x4afc('0x44')]+'%'};return _0x299849;})});}_0x1f40d3=_['merge']({},_0x1f40d3,_0x4b3439[_0x4afc('0x46')]);return _0x389040[_0x4afc('0x51')](_0x1f40d3);}})[_0x4afc('0x15')](function(_0x5e3e9b){if(_0x5e3e9b){_0x258fed=_0x5e3e9b[_0x4afc('0x30')];if(!_0x4b3439[_0x4afc('0x2b')][_0x4afc('0x52')](_0x4afc('0x3e'))){_0x1f40d3[_0x4afc('0x11')]=qs['limit'](_0x4b3439['query'][_0x4afc('0x11')]);_0x1f40d3[_0x4afc('0xf')]=qs[_0x4afc('0xf')](_0x4b3439['query'][_0x4afc('0xf')]);}return _0x389040[_0x4afc('0x51')](_0x1f40d3);}})[_0x4afc('0x15')](function(_0x306a45){if(_0x306a45){return _0x306a45?{'count':_0x258fed,'rows':_0x306a45}:null;}})[_0x4afc('0x15')](respondWithResult(_0x32a3d7,null))['catch'](handleError(_0x32a3d7,null));};exports[_0x4afc('0x53')]=function(_0x8ba1da,_0x517efb){var _0x1179c0=_0x8ba1da[_0x4afc('0x34')][_0x4afc('0x54')];return db['Team'][_0x4afc('0x25')]({'where':{'id':_0x1179c0},'attributes':['id'],'include':[{'model':db[_0x4afc('0x55')],'as':_0x4afc('0x56'),'attributes':['id',_0x4afc('0x1b'),_0x4afc('0x57'),_0x4afc('0x58'),_0x4afc('0x59')],'raw':!![]}]})[_0x4afc('0x15')](function(_0x4c7f92){if(_0x4c7f92){var _0x457b2c=_['flatMap'](_0x4c7f92,function(_0x5a0a78){var _0x2e0f15=_0x5a0a78[_0x4afc('0x17')]({'plain':!![]});return _0x2e0f15[_0x4afc('0x56')];});return db['FaxQueue']['find']({'where':{'id':_0x8ba1da[_0x4afc('0x28')]['id']}})[_0x4afc('0x15')](function(_0xa3f8b7){return db[_0x4afc('0x5a')][_0x4afc('0x5b')](function(_0x264f65){return _0xa3f8b7[_0x4afc('0x53')](_0x1179c0,{'transaction':_0x264f65})[_0x4afc('0x15')](function(){return BPromise[_0x4afc('0x5c')](_0x457b2c,function(_0x396cb5){return db[_0x4afc('0x3d')][_0x4afc('0x5d')]({'where':{'UserId':_0x396cb5['id'],'FaxQueueId':_0x8ba1da[_0x4afc('0x28')]['id']},'transaction':_0x264f65});});})[_0x4afc('0x15')](function(){_0x457b2c[_0x4afc('0x5e')](function(_0x16cf27){socket['emit'](_0x4afc('0x5f'),{'UserId':_0x16cf27['id'],'FaxQueueId':_0xa3f8b7['id']});});});});});}})[_0x4afc('0x15')](respondWithStatusCode(_0x517efb,null))[_0x4afc('0x27')](handleError(_0x517efb,null));};exports[_0x4afc('0x60')]=function(_0x19c06a,_0x2477c7){return db[_0x4afc('0x50')][_0x4afc('0x25')]({'where':{'id':_0x19c06a[_0x4afc('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4afc('0x55')],'as':_0x4afc('0x56'),'attributes':['id'],'raw':!![]}]})[_0x4afc('0x15')](handleEntityNotFound(_0x2477c7,null))[_0x4afc('0x15')](function(_0x4b5bd2){var _0x1e7e24=_[_0x4afc('0x1e')](_0x4b5bd2,'id');var _0x4ce81a=[];var _0x4956b2=[];var _0x46fe52=squel[_0x4afc('0x61')]();_0x46fe52[_0x4afc('0x62')](_0x4afc('0x63'))[_0x4afc('0x64')](_0x4afc('0x65'),'tq')['join'](_0x4afc('0x66'),'ut',_0x4afc('0x67'))['where'](_0x4afc('0x68'),_0x19c06a[_0x4afc('0x28')]['id']);for(var _0x1aeb84=0x0;_0x1aeb84<_0x4b5bd2['length'];_0x1aeb84+=0x1){let _0x1c3d20=_0x4b5bd2[_0x1aeb84];for(var _0x3478aa=0x0;_0x3478aa<_0x1c3d20[_0x4afc('0x56')][_0x4afc('0x30')];_0x3478aa+=0x1){let _0x4a6f77=_0x1c3d20[_0x4afc('0x56')][_0x3478aa];var _0x29297c=_0x46fe52['clone']();_0x29297c[_0x4afc('0x41')](_0x4afc('0x69'),_0x4a6f77['id']);_0x4956b2[_0x4afc('0x6a')](db['sequelize']['query'](_0x29297c[_0x4afc('0x6b')](),{'type':db[_0x4afc('0x5a')][_0x4afc('0x6c')][_0x4afc('0x6d')]})[_0x4afc('0x15')](function(_0xe82342){if(_0xe82342[_0x4afc('0x30')]===0x1){return _0x4a6f77['id'];}else{var _0x1949c6=_[_0x4afc('0x6e')](_[_0x4afc('0x1e')](_0xe82342,_0x4afc('0x6f')),function(_0x6d81f2){return _[_0x4afc('0x70')](_0x1e7e24,_0x6d81f2);});if(_0x1949c6){return _0x4a6f77['id'];}}}));}}return BPromise[_0x4afc('0x71')](_0x4956b2)[_0x4afc('0x15')](function(_0x143340){_0x4ce81a=_(_0x4ce81a)['union'](_0x143340)[_0x4afc('0x72')]()[_0x4afc('0x73')]();return db['FaxQueue'][_0x4afc('0x32')]({'where':{'id':_0x19c06a['params']['id']}})['then'](function(_0x6ac9ae){return db['sequelize']['transaction'](function(_0x2a1efe){return _0x6ac9ae['removeTeams'](_0x19c06a[_0x4afc('0x2b')]['ids'],{'transaction':_0x2a1efe})[_0x4afc('0x15')](function(){if(!_[_0x4afc('0x74')](_0x4ce81a)){return _0x6ac9ae[_0x4afc('0x75')](_0x4ce81a,{'transaction':_0x2a1efe});}})[_0x4afc('0x15')](function(){_0x4ce81a[_0x4afc('0x5e')](function(_0x4fb4a4){socket[_0x4afc('0x76')](_0x4afc('0x77'),{'UserId':_0x4fb4a4,'FaxQueueId':_0x6ac9ae['id']});});});});});});})['then'](respondWithStatusCode(_0x2477c7,null))['catch'](handleError(_0x2477c7,null));};exports[_0x4afc('0x78')]=function(_0x1b6b80,_0x373e9c){return db[_0x4afc('0x1f')][_0x4afc('0x32')]({'where':{'id':_0x1b6b80['params']['id']}})[_0x4afc('0x15')](handleEntityNotFound(_0x373e9c,null))[_0x4afc('0x15')](function(_0x2516e4){if(_0x2516e4){return _0x2516e4[_0x4afc('0x78')](_0x1b6b80['body'][_0x4afc('0x54')],_['omit'](_0x1b6b80[_0x4afc('0x34')],[_0x4afc('0x54'),'id'])||{})[_0x4afc('0x79')](function(_0x39167b){for(var _0xa580ad=0x0;_0xa580ad<_0x1b6b80[_0x4afc('0x34')][_0x4afc('0x54')][_0x4afc('0x30')];_0xa580ad+=0x1){socket[_0x4afc('0x76')](_0x4afc('0x5f'),{'UserId':Number(_0x1b6b80[_0x4afc('0x34')]['ids'][_0xa580ad]),'FaxQueueId':Number(_0x1b6b80[_0x4afc('0x28')]['id'])});}return _0x39167b;});}})['then'](respondWithResult(_0x373e9c,null))[_0x4afc('0x27')](handleError(_0x373e9c,null));};exports['removeAgents']=function(_0x50198d,_0x681c5e){return db['FaxQueue']['find']({'where':{'id':_0x50198d[_0x4afc('0x28')]['id']}})['then'](handleEntityNotFound(_0x681c5e,null))[_0x4afc('0x15')](function(_0x24bf53){if(_0x24bf53){return _0x24bf53['removeAgents'](_0x50198d[_0x4afc('0x2b')][_0x4afc('0x54')])['then'](function(){if(_[_0x4afc('0x7a')](_0x50198d[_0x4afc('0x2b')][_0x4afc('0x54')])){for(var _0x4c900a=0x0;_0x4c900a<_0x50198d[_0x4afc('0x2b')][_0x4afc('0x54')][_0x4afc('0x30')];_0x4c900a+=0x1){socket[_0x4afc('0x76')](_0x4afc('0x77'),{'UserId':Number(_0x50198d[_0x4afc('0x2b')]['ids'][_0x4c900a]),'FaxQueueId':Number(_0x50198d['params']['id'])});}}else{socket[_0x4afc('0x76')](_0x4afc('0x77'),{'UserId':Number(_0x50198d['query'][_0x4afc('0x54')]),'FaxQueueId':Number(_0x50198d[_0x4afc('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x681c5e,null))[_0x4afc('0x27')](handleError(_0x681c5e,null));};exports[_0x4afc('0x7b')]=function(_0x276793,_0x36b359){var _0x2585b3={};var _0x4b1bbc={};var _0x413579;var _0x241587;return db[_0x4afc('0x1f')][_0x4afc('0x3c')]({'where':{'id':_0x276793[_0x4afc('0x28')]['id']}})['then'](handleEntityNotFound(_0x36b359,null))[_0x4afc('0x15')](function(_0x37f9ea){if(_0x37f9ea){_0x413579=_0x37f9ea;_0x4b1bbc[_0x4afc('0x29')]=_['keys'](db[_0x4afc('0x55')][_0x4afc('0x20')]);_0x4b1bbc['query']=_['keys'](_0x276793['query']);_0x4b1bbc[_0x4afc('0x2c')]=_[_0x4afc('0x2d')](_0x4b1bbc['model'],_0x4b1bbc[_0x4afc('0x2b')]);_0x2585b3[_0x4afc('0x2e')]=_['intersection'](_0x4b1bbc[_0x4afc('0x29')],qs[_0x4afc('0x2f')](_0x276793[_0x4afc('0x2b')][_0x4afc('0x2f')]));_0x2585b3[_0x4afc('0x2e')]=_0x2585b3[_0x4afc('0x2e')][_0x4afc('0x30')]?_0x2585b3[_0x4afc('0x2e')]:_0x4b1bbc[_0x4afc('0x29')];_0x2585b3['order']=qs[_0x4afc('0x40')](_0x276793[_0x4afc('0x2b')][_0x4afc('0x40')]);_0x2585b3[_0x4afc('0x41')]=qs['filters'](_[_0x4afc('0x42')](_0x276793[_0x4afc('0x2b')],_0x4b1bbc['filters']));if(_0x276793['query']['filter']){_0x2585b3[_0x4afc('0x41')]=_[_0x4afc('0x45')](_0x2585b3[_0x4afc('0x41')],{'$or':_['map'](_0x2585b3[_0x4afc('0x2e')],function(_0x1015f3){var _0x35e7c1={};_0x35e7c1[_0x1015f3]={'$like':'%'+_0x276793['query'][_0x4afc('0x44')]+'%'};return _0x35e7c1;})});}_0x2585b3=_['merge']({},_0x2585b3,_0x276793['options']);return _0x413579[_0x4afc('0x7b')](_0x2585b3);}})[_0x4afc('0x15')](function(_0x373160){if(_0x373160){_0x241587=_0x373160['length'];if(!_0x276793[_0x4afc('0x2b')][_0x4afc('0x52')](_0x4afc('0x3e'))){_0x2585b3[_0x4afc('0x11')]=qs[_0x4afc('0x11')](_0x276793[_0x4afc('0x2b')][_0x4afc('0x11')]);_0x2585b3[_0x4afc('0xf')]=qs[_0x4afc('0xf')](_0x276793['query']['offset']);}return _0x413579[_0x4afc('0x7b')](_0x2585b3);}})[_0x4afc('0x15')](function(_0x9748d5){if(_0x9748d5){return _0x9748d5?{'count':_0x241587,'rows':_0x9748d5}:null;}})[_0x4afc('0x15')](respondWithResult(_0x36b359,null))['catch'](handleError(_0x36b359,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index e38d5c4..aa58dc4 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 _0xaf41=['hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','save','update','remove','emit'];(function(_0xbad79b,_0x16123f){var _0x35c37a=function(_0x27e047){while(--_0x27e047){_0xbad79b['push'](_0xbad79b['shift']());}};_0x35c37a(++_0x16123f);}(_0xaf41,0x66));var _0x1af4=function(_0x5483a8,_0x199d60){_0x5483a8=_0x5483a8-0x0;var _0x390aa5=_0xaf41[_0x5483a8];return _0x390aa5;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x1af4('0x0'))['db'][_0x1af4('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1af4('0x2'),'afterUpdate':_0x1af4('0x3'),'afterDestroy':_0x1af4('0x4')};function emitEvent(_0x37164a){return function(_0xc5748c,_0x222db0,_0x149c72){FaxQueueEvents['emit'](_0x37164a+':'+_0xc5748c['id'],_0xc5748c);FaxQueueEvents[_0x1af4('0x5')](_0x37164a,_0xc5748c);_0x149c72(null);};}for(var e in events){if(events[_0x1af4('0x6')](e)){var event=events[e];FaxQueue[_0x1af4('0x7')](e,emitEvent(event));}}module[_0x1af4('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0x0212=['remove','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x0212,0x11b));var _0x2021=function(_0x4d9b61,_0x5ce947){_0x4d9b61=_0x4d9b61-0x0;var _0x215476=_0x0212[_0x4d9b61];return _0x215476;};'use strict';var EventEmitter=require(_0x2021('0x0'));var FaxQueue=require(_0x2021('0x1'))['db'][_0x2021('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2021('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2021('0x4')};function emitEvent(_0x98c617){return function(_0x3c32b0,_0x58a5e,_0x6c0c2){FaxQueueEvents['emit'](_0x98c617+':'+_0x3c32b0['id'],_0x3c32b0);FaxQueueEvents['emit'](_0x98c617,_0x3c32b0);_0x6c0c2(null);};}for(var e in events){if(events[_0x2021('0x5')](e)){var event=events[e];FaxQueue[_0x2021('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 3fe4821..6c85e99 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 _0x8cbb=['bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','util','../../config/logger','api','moment'];(function(_0x190877,_0x5871c8){var _0x190fd4=function(_0x496c90){while(--_0x496c90){_0x190877['push'](_0x190877['shift']());}};_0x190fd4(++_0x5871c8);}(_0x8cbb,0xbf));var _0xb8cb=function(_0xfd5b35,_0xd8fdd8){_0xfd5b35=_0xfd5b35-0x0;var _0x86ae7e=_0x8cbb[_0xfd5b35];return _0x86ae7e;};'use strict';var _=require(_0xb8cb('0x0'));var util=require(_0xb8cb('0x1'));var logger=require(_0xb8cb('0x2'))(_0xb8cb('0x3'));var moment=require(_0xb8cb('0x4'));var BPromise=require(_0xb8cb('0x5'));var rp=require(_0xb8cb('0x6'));var fs=require('fs');var path=require(_0xb8cb('0x7'));var rimraf=require(_0xb8cb('0x8'));var config=require(_0xb8cb('0x9'));var attributes=require(_0xb8cb('0xa'));module[_0xb8cb('0xb')]=function(_0x5dab5e,_0x44276a){return _0x5dab5e[_0xb8cb('0xc')]('FaxQueue',attributes,{'tableName':_0xb8cb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e6a=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x25fc41,_0x250864){var _0x1371d1=function(_0x8ab2e3){while(--_0x8ab2e3){_0x25fc41['push'](_0x25fc41['shift']());}};_0x1371d1(++_0x250864);}(_0x7e6a,0x13a));var _0xa7e6=function(_0x192bca,_0x4426ba){_0x192bca=_0x192bca-0x0;var _0x5b46c2=_0x7e6a[_0x192bca];return _0x5b46c2;};'use strict';var _=require(_0xa7e6('0x0'));var util=require(_0xa7e6('0x1'));var logger=require(_0xa7e6('0x2'))(_0xa7e6('0x3'));var moment=require(_0xa7e6('0x4'));var BPromise=require(_0xa7e6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa7e6('0x6'));var config=require(_0xa7e6('0x7'));var attributes=require(_0xa7e6('0x8'));module[_0xa7e6('0x9')]=function(_0x1bc107,_0x2e40f9){return _0x1bc107[_0xa7e6('0xa')](_0xa7e6('0xb'),attributes,{'tableName':_0xa7e6('0xc'),'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 0351a8b..d33f0e1 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 _0x9b8b=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxQueue','findAll','options','raw','attributes','limit','include','map','model','find','where','ShowFaxQueue'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0x9b8b,0xa4));var _0xb9b8=function(_0x28087d,_0x2665af){_0x28087d=_0x28087d-0x0;var _0x5bd30b=_0x9b8b[_0x28087d];return _0x5bd30b;};'use strict';var _=require('lodash');var util=require(_0xb9b8('0x0'));var moment=require('moment');var BPromise=require(_0xb9b8('0x1'));var rs=require(_0xb9b8('0x2'));var fs=require('fs');var Redis=require(_0xb9b8('0x3'));var db=require(_0xb9b8('0x4'))['db'];var utils=require(_0xb9b8('0x5'));var logger=require(_0xb9b8('0x6'))(_0xb9b8('0x7'));var config=require(_0xb9b8('0x8'));var jayson=require(_0xb9b8('0x9'));var client=jayson[_0xb9b8('0xa')][_0xb9b8('0xb')]({'port':0x232a});config['redis']=_[_0xb9b8('0xc')](config[_0xb9b8('0xd')],{'host':_0xb9b8('0xe'),'port':0x18eb});var socket=require(_0xb9b8('0xf'))(new Redis(config[_0xb9b8('0xd')]));require(_0xb9b8('0x10'))['register'](socket);function respondWithRpcPromise(_0x1160ec,_0x105799,_0x2f2621){return new BPromise(function(_0x56956b,_0x2484f2){return client[_0xb9b8('0x11')](_0x1160ec,_0x2f2621)[_0xb9b8('0x12')](function(_0x5d9774){logger[_0xb9b8('0x13')](_0xb9b8('0x14'),_0x105799,_0xb9b8('0x15'));logger[_0xb9b8('0x16')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x105799,'request\x20sent',JSON[_0xb9b8('0x17')](_0x5d9774));if(_0x5d9774[_0xb9b8('0x18')]){if(_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x19')]===0x1f4){logger[_0xb9b8('0x18')](_0xb9b8('0x14'),_0x105799,_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x1a')]);return _0x2484f2(_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x1a')]);}logger[_0xb9b8('0x18')]('FaxQueue,\x20%s,\x20%s',_0x105799,_0x5d9774['error'][_0xb9b8('0x1a')]);return _0x56956b(_0x5d9774[_0xb9b8('0x18')][_0xb9b8('0x1a')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x105799,_0xb9b8('0x15'));_0x56956b(_0x5d9774[_0xb9b8('0x1b')][_0xb9b8('0x1a')]);}})[_0xb9b8('0x1c')](function(_0x5951c0){logger[_0xb9b8('0x18')]('FaxQueue,\x20%s,\x20%s',_0x105799,_0x5951c0);_0x2484f2(_0x5951c0);});});}exports[_0xb9b8('0x1d')]=function(_0x172759){var _0x1ccca7=this;return new Promise(function(_0x1d247b,_0x47fdb0){return db['FaxQueue'][_0xb9b8('0x1e')]({'raw':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x20')]===undefined?!![]:![]:!![],'where':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')]['where']||null:null,'attributes':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x21')]||null:null,'limit':_0x172759['options']?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x22')]||null:null,'include':_0x172759[_0xb9b8('0x1f')]?_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x23')]?_[_0xb9b8('0x24')](_0x172759[_0xb9b8('0x1f')][_0xb9b8('0x23')],function(_0x18876c){return{'model':db[_0x18876c[_0xb9b8('0x25')]],'as':_0x18876c['as'],'attributes':_0x18876c[_0xb9b8('0x21')],'include':_0x18876c['include']?_[_0xb9b8('0x24')](_0x18876c[_0xb9b8('0x23')],function(_0x3fa323){return{'model':db[_0x3fa323[_0xb9b8('0x25')]],'as':_0x3fa323['as'],'attributes':_0x3fa323[_0xb9b8('0x21')],'include':_0x3fa323[_0xb9b8('0x23')]?_['map'](_0x3fa323[_0xb9b8('0x23')],function(_0x4968ff){return{'model':db[_0x4968ff[_0xb9b8('0x25')]],'as':_0x4968ff['as'],'attributes':_0x4968ff['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b75d){logger[_0xb9b8('0x13')](_0xb9b8('0x1d'),_0x172759);logger[_0xb9b8('0x16')](_0xb9b8('0x1d'),_0x172759,JSON['stringify'](_0x59b75d));_0x1d247b(_0x59b75d);})[_0xb9b8('0x1c')](function(_0x480fb9){logger[_0xb9b8('0x18')]('GetFaxQueue',_0x480fb9['message'],_0x172759);_0x47fdb0(_0x1ccca7[_0xb9b8('0x18')](0x1f4,_0x480fb9[_0xb9b8('0x1a')]));});});};exports['ShowFaxQueue']=function(_0x1e7a71){var _0x273ba6=this;return new Promise(function(_0xf848ce,_0x4760dc){return db['FaxQueue'][_0xb9b8('0x26')]({'raw':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x20')]===undefined?!![]:![]:!![],'where':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71['options'][_0xb9b8('0x27')]||null:null,'attributes':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x21')]||null:null,'include':_0x1e7a71[_0xb9b8('0x1f')]?_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x23')]?_[_0xb9b8('0x24')](_0x1e7a71[_0xb9b8('0x1f')][_0xb9b8('0x23')],function(_0x5ab7b7){return{'model':db[_0x5ab7b7[_0xb9b8('0x25')]],'as':_0x5ab7b7['as'],'attributes':_0x5ab7b7[_0xb9b8('0x21')],'include':_0x5ab7b7['include']?_['map'](_0x5ab7b7[_0xb9b8('0x23')],function(_0x3a3813){return{'model':db[_0x3a3813[_0xb9b8('0x25')]],'as':_0x3a3813['as'],'attributes':_0x3a3813[_0xb9b8('0x21')],'include':_0x3a3813['include']?_[_0xb9b8('0x24')](_0x3a3813[_0xb9b8('0x23')],function(_0x1cc3dd){return{'model':db[_0x1cc3dd[_0xb9b8('0x25')]],'as':_0x1cc3dd['as'],'attributes':_0x1cc3dd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9b8('0x12')](function(_0x25f2fe){logger['info']('ShowFaxQueue',_0x1e7a71);logger['debug'](_0xb9b8('0x28'),_0x1e7a71,JSON[_0xb9b8('0x17')](_0x25f2fe));_0xf848ce(_0x25f2fe);})[_0xb9b8('0x1c')](function(_0x4914fb){logger[_0xb9b8('0x18')]('ShowFaxQueue',_0x4914fb['message'],_0x1e7a71);_0x4760dc(_0x273ba6[_0xb9b8('0x18')](0x1f4,_0x4914fb['message']));});});}; \ No newline at end of file +var _0x0ec4=['request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','where','attributes','limit','include','model','map','debug','GetFaxQueue','catch','ShowFaxQueue','FaxQueue','find','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s'];(function(_0x2f0c51,_0x58d7c){var _0x40803b=function(_0x3b855e){while(--_0x3b855e){_0x2f0c51['push'](_0x2f0c51['shift']());}};_0x40803b(++_0x58d7c);}(_0x0ec4,0x16e));var _0x40ec=function(_0x4d7d40,_0xb7b2a8){_0x4d7d40=_0x4d7d40-0x0;var _0xfac4c4=_0x0ec4[_0x4d7d40];return _0xfac4c4;};'use strict';var _=require(_0x40ec('0x0'));var util=require('util');var moment=require(_0x40ec('0x1'));var BPromise=require(_0x40ec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40ec('0x3'));var db=require(_0x40ec('0x4'))['db'];var utils=require(_0x40ec('0x5'));var logger=require(_0x40ec('0x6'))(_0x40ec('0x7'));var config=require(_0x40ec('0x8'));var jayson=require(_0x40ec('0x9'));var client=jayson[_0x40ec('0xa')][_0x40ec('0xb')]({'port':0x232a});config[_0x40ec('0xc')]=_[_0x40ec('0xd')](config['redis'],{'host':_0x40ec('0xe'),'port':0x18eb});var socket=require(_0x40ec('0xf'))(new Redis(config['redis']));require(_0x40ec('0x10'))[_0x40ec('0x11')](socket);function respondWithRpcPromise(_0x117e9a,_0x420c18,_0x34dbe1){return new BPromise(function(_0x489372,_0x479113){return client['request'](_0x117e9a,_0x34dbe1)[_0x40ec('0x12')](function(_0x3dc052){logger[_0x40ec('0x13')](_0x40ec('0x14'),_0x420c18,_0x40ec('0x15'));logger['debug'](_0x40ec('0x16'),_0x420c18,_0x40ec('0x15'),JSON[_0x40ec('0x17')](_0x3dc052));if(_0x3dc052[_0x40ec('0x18')]){if(_0x3dc052[_0x40ec('0x18')][_0x40ec('0x19')]===0x1f4){logger['error'](_0x40ec('0x14'),_0x420c18,_0x3dc052[_0x40ec('0x18')][_0x40ec('0x1a')]);return _0x479113(_0x3dc052[_0x40ec('0x18')][_0x40ec('0x1a')]);}logger[_0x40ec('0x18')](_0x40ec('0x14'),_0x420c18,_0x3dc052[_0x40ec('0x18')][_0x40ec('0x1a')]);return _0x489372(_0x3dc052[_0x40ec('0x18')][_0x40ec('0x1a')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x420c18,_0x40ec('0x15'));_0x489372(_0x3dc052[_0x40ec('0x1b')][_0x40ec('0x1a')]);}})['catch'](function(_0x50642f){logger[_0x40ec('0x18')](_0x40ec('0x14'),_0x420c18,_0x50642f);_0x479113(_0x50642f);});});}exports['GetFaxQueue']=function(_0x5cc4a5){var _0x17ef58=this;return new Promise(function(_0x553cf4,_0x20971e){return db['FaxQueue'][_0x40ec('0x1c')]({'raw':_0x5cc4a5[_0x40ec('0x1d')]?_0x5cc4a5[_0x40ec('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5cc4a5[_0x40ec('0x1d')]?_0x5cc4a5[_0x40ec('0x1d')][_0x40ec('0x1e')]||null:null,'attributes':_0x5cc4a5[_0x40ec('0x1d')]?_0x5cc4a5[_0x40ec('0x1d')][_0x40ec('0x1f')]||null:null,'limit':_0x5cc4a5[_0x40ec('0x1d')]?_0x5cc4a5[_0x40ec('0x1d')][_0x40ec('0x20')]||null:null,'include':_0x5cc4a5['options']?_0x5cc4a5['options'][_0x40ec('0x21')]?_['map'](_0x5cc4a5[_0x40ec('0x1d')]['include'],function(_0x607c2e){return{'model':db[_0x607c2e[_0x40ec('0x22')]],'as':_0x607c2e['as'],'attributes':_0x607c2e['attributes'],'include':_0x607c2e[_0x40ec('0x21')]?_['map'](_0x607c2e[_0x40ec('0x21')],function(_0x2c90b0){return{'model':db[_0x2c90b0[_0x40ec('0x22')]],'as':_0x2c90b0['as'],'attributes':_0x2c90b0[_0x40ec('0x1f')],'include':_0x2c90b0[_0x40ec('0x21')]?_[_0x40ec('0x23')](_0x2c90b0[_0x40ec('0x21')],function(_0x3f9140){return{'model':db[_0x3f9140[_0x40ec('0x22')]],'as':_0x3f9140['as'],'attributes':_0x3f9140[_0x40ec('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xeadf40){logger[_0x40ec('0x13')]('GetFaxQueue',_0x5cc4a5);logger[_0x40ec('0x24')](_0x40ec('0x25'),_0x5cc4a5,JSON['stringify'](_0xeadf40));_0x553cf4(_0xeadf40);})[_0x40ec('0x26')](function(_0x4a4a5c){logger[_0x40ec('0x18')](_0x40ec('0x25'),_0x4a4a5c[_0x40ec('0x1a')],_0x5cc4a5);_0x20971e(_0x17ef58[_0x40ec('0x18')](0x1f4,_0x4a4a5c[_0x40ec('0x1a')]));});});};exports[_0x40ec('0x27')]=function(_0x1d46b4){var _0x4bab18=this;return new Promise(function(_0x1edad4,_0x867f0e){return db[_0x40ec('0x28')][_0x40ec('0x29')]({'raw':_0x1d46b4['options']?_0x1d46b4[_0x40ec('0x1d')][_0x40ec('0x2a')]===undefined?!![]:![]:!![],'where':_0x1d46b4[_0x40ec('0x1d')]?_0x1d46b4['options']['where']||null:null,'attributes':_0x1d46b4[_0x40ec('0x1d')]?_0x1d46b4[_0x40ec('0x1d')]['attributes']||null:null,'include':_0x1d46b4[_0x40ec('0x1d')]?_0x1d46b4[_0x40ec('0x1d')][_0x40ec('0x21')]?_[_0x40ec('0x23')](_0x1d46b4[_0x40ec('0x1d')][_0x40ec('0x21')],function(_0x16f2cf){return{'model':db[_0x16f2cf[_0x40ec('0x22')]],'as':_0x16f2cf['as'],'attributes':_0x16f2cf[_0x40ec('0x1f')],'include':_0x16f2cf[_0x40ec('0x21')]?_[_0x40ec('0x23')](_0x16f2cf[_0x40ec('0x21')],function(_0x2b7f80){return{'model':db[_0x2b7f80[_0x40ec('0x22')]],'as':_0x2b7f80['as'],'attributes':_0x2b7f80[_0x40ec('0x1f')],'include':_0x2b7f80[_0x40ec('0x21')]?_[_0x40ec('0x23')](_0x2b7f80[_0x40ec('0x21')],function(_0x1cf8be){return{'model':db[_0x1cf8be['model']],'as':_0x1cf8be['as'],'attributes':_0x1cf8be[_0x40ec('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x40ec('0x12')](function(_0x4b1f89){logger[_0x40ec('0x13')]('ShowFaxQueue',_0x1d46b4);logger[_0x40ec('0x24')](_0x40ec('0x27'),_0x1d46b4,JSON[_0x40ec('0x17')](_0x4b1f89));_0x1edad4(_0x4b1f89);})['catch'](function(_0x24b5d0){logger['error'](_0x40ec('0x27'),_0x24b5d0[_0x40ec('0x1a')],_0x1d46b4);_0x867f0e(_0x4bab18['error'](0x1f4,_0x24b5d0[_0x40ec('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 48c487d..f50c66e 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 _0x5109=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x2787ba,_0x21b7c2){var _0x46e5ec=function(_0x32529f){while(--_0x32529f){_0x2787ba['push'](_0x2787ba['shift']());}};_0x46e5ec(++_0x21b7c2);}(_0x5109,0xb8));var _0x9510=function(_0x4ae689,_0x2b8c25){_0x4ae689=_0x4ae689-0x0;var _0x61137b=_0x5109[_0x4ae689];return _0x61137b;};'use strict';var FaxQueueEvents=require(_0x9510('0x0'));var events=[_0x9510('0x1'),_0x9510('0x2'),_0x9510('0x3')];function createListener(_0x302e55,_0x570950){return function(_0x96f1b6){_0x570950[_0x9510('0x4')](_0x302e55,_0x96f1b6);};}function removeListener(_0xf0adac,_0x31c003){return function(){FaxQueueEvents[_0x9510('0x5')](_0xf0adac,_0x31c003);};}exports[_0x9510('0x6')]=function(_0x240d1a){for(var _0x156535=0x0,_0x59099a=events[_0x9510('0x7')];_0x156535<_0x59099a;_0x156535++){var _0x15341e=events[_0x156535];var _0x37a5f3=createListener(_0x9510('0x8')+_0x15341e,_0x240d1a);FaxQueueEvents['on'](_0x15341e,_0x37a5f3);}}; \ No newline at end of file +var _0xb7f0=['save','remove','update','emit','removeListener','register','faxQueue:','./faxQueue.events'];(function(_0x90334d,_0x3ec517){var _0x42c8cf=function(_0x28520a){while(--_0x28520a){_0x90334d['push'](_0x90334d['shift']());}};_0x42c8cf(++_0x3ec517);}(_0xb7f0,0x1c7));var _0x0b7f=function(_0x4a010b,_0x3523b3){_0x4a010b=_0x4a010b-0x0;var _0xe0b19b=_0xb7f0[_0x4a010b];return _0xe0b19b;};'use strict';var FaxQueueEvents=require(_0x0b7f('0x0'));var events=[_0x0b7f('0x1'),_0x0b7f('0x2'),_0x0b7f('0x3')];function createListener(_0x171ae7,_0x4c531b){return function(_0x3203b8){_0x4c531b[_0x0b7f('0x4')](_0x171ae7,_0x3203b8);};}function removeListener(_0x3cff7b,_0x38d9c4){return function(){FaxQueueEvents[_0x0b7f('0x5')](_0x3cff7b,_0x38d9c4);};}exports[_0x0b7f('0x6')]=function(_0x5c8414){for(var _0x4b8226=0x0,_0x40ca13=events['length'];_0x4b8226<_0x40ca13;_0x4b8226++){var _0x47f10c=events[_0x4b8226];var _0x5aea3e=createListener(_0x0b7f('0x7')+_0x47f10c,_0x5c8414);FaxQueueEvents['on'](_0x47f10c,_0x5aea3e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 489c6fe..f977e77 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 _0xa751=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getAgents','post','/:id/users','addAgents','put','/:id','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','Router'];(function(_0x28c6a2,_0x5e2df3){var _0x278cc0=function(_0x50bc21){while(--_0x50bc21){_0x28c6a2['push'](_0x28c6a2['shift']());}};_0x278cc0(++_0x5e2df3);}(_0xa751,0x175));var _0x1a75=function(_0x185d3d,_0x2592fc){_0x185d3d=_0x185d3d-0x0;var _0x6e6b97=_0xa751[_0x185d3d];return _0x6e6b97;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a75('0x5'));var interaction=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var controller=require('./faxQueue.controller');router[_0x1a75('0x8')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xa')]);router[_0x1a75('0x8')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a75('0xd')]);router[_0x1a75('0x8')](_0x1a75('0xe'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xf')]);router[_0x1a75('0x8')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['getTeams']);router['get']('/:id/users',auth[_0x1a75('0x9')](),controller[_0x1a75('0x11')]);router[_0x1a75('0x12')]('/',auth[_0x1a75('0x9')](),controller['create']);router['post'](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['addTeams']);router[_0x1a75('0x12')](_0x1a75('0x13'),auth['isAuthenticated'](),controller[_0x1a75('0x14')]);router[_0x1a75('0x15')](_0x1a75('0x16'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1a75('0x16'),auth[_0x1a75('0x9')](),controller[_0x1a75('0x17')]);router[_0x1a75('0x18')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['removeTeams']);router[_0x1a75('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x1a75('0x19')]);module[_0x1a75('0x1a')]=router; \ No newline at end of file +var _0x5f6f=['get','isAuthenticated','index','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller'];(function(_0x293fc7,_0x298189){var _0x2ffb18=function(_0x1d5ed0){while(--_0x1d5ed0){_0x293fc7['push'](_0x293fc7['shift']());}};_0x2ffb18(++_0x298189);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x5f6f[_0x2555d0];return _0x3bb486;};'use strict';var multer=require(_0xf5f6('0x0'));var util=require(_0xf5f6('0x1'));var path=require(_0xf5f6('0x2'));var timeout=require(_0xf5f6('0x3'));var express=require(_0xf5f6('0x4'));var router=express['Router']();var fs_extra=require(_0xf5f6('0x5'));var auth=require(_0xf5f6('0x6'));var interaction=require(_0xf5f6('0x7'));var config=require('../../config/environment');var controller=require(_0xf5f6('0x8'));router[_0xf5f6('0x9')]('/',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xb')]);router['get']('/describe',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xc')]);router[_0xf5f6('0x9')](_0xf5f6('0xd'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xe')]);router['get']('/:id/members',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0xf')]);router['get'](_0xf5f6('0x10'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x11')]);router[_0xf5f6('0x9')](_0xf5f6('0x12'),auth['isAuthenticated'](),controller[_0xf5f6('0x13')]);router['post']('/',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x14')]);router[_0xf5f6('0x15')](_0xf5f6('0x10'),auth['isAuthenticated'](),controller[_0xf5f6('0x16')]);router[_0xf5f6('0x15')](_0xf5f6('0x12'),auth[_0xf5f6('0xa')](),controller['addAgents']);router[_0xf5f6('0x17')](_0xf5f6('0xd'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x18')]);router['delete']('/:id',auth[_0xf5f6('0xa')](),controller['destroy']);router[_0xf5f6('0x19')]('/:id/teams',auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x1a')]);router[_0xf5f6('0x19')](_0xf5f6('0x12'),auth[_0xf5f6('0xa')](),controller[_0xf5f6('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index e78e313..0f54ae1 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 _0xd54a=['exports','STRING','DATE','moment'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0xd54a,0x1df));var _0xad54=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xd54a[_0x255d5b];return _0x3e141a;};'use strict';var moment=require(_0xad54('0x0'));var Sequelize=require('sequelize');module[_0xad54('0x1')]={'uniqueid':{'type':Sequelize[_0xad54('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xad54('0x3')]},'leaveAt':{'type':Sequelize[_0xad54('0x3')]},'acceptAt':{'type':Sequelize[_0xad54('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xad54('0x2')]}}; \ No newline at end of file +var _0x8307=['STRING','DATE','sequelize','exports'];(function(_0x528038,_0x5a5b73){var _0x2296ce=function(_0x29c683){while(--_0x29c683){_0x528038['push'](_0x528038['shift']());}};_0x2296ce(++_0x5a5b73);}(_0x8307,0xca));var _0x7830=function(_0x10f059,_0xb56fdd){_0x10f059=_0x10f059-0x0;var _0x4ab4ed=_0x8307[_0x10f059];return _0x4ab4ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x7830('0x0'));module[_0x7830('0x1')]={'uniqueid':{'type':Sequelize[_0x7830('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7830('0x2')]},'joinAt':{'type':Sequelize[_0x7830('0x3')]},'leaveAt':{'type':Sequelize[_0x7830('0x3')]},'acceptAt':{'type':Sequelize[_0x7830('0x3')]},'exitAt':{'type':Sequelize[_0x7830('0x3')]},'reason':{'type':Sequelize[_0x7830('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4c3a596..ef976d1 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 _0x37dc=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','stack','name','send','map','FaxQueueReport','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x2473de,_0xc1ddaa){var _0x32f0f5=function(_0x2d5399){while(--_0x2d5399){_0x2473de['push'](_0x2473de['shift']());}};_0x32f0f5(++_0xc1ddaa);}(_0x37dc,0x1e9));var _0xc37d=function(_0x2a7110,_0x5ce63e){_0x2a7110=_0x2a7110-0x0;var _0x2652bf=_0x37dc[_0x2a7110];return _0x2652bf;};'use strict';var emlformat=require(_0xc37d('0x0'));var rimraf=require(_0xc37d('0x1'));var zipdir=require(_0xc37d('0x2'));var jsonpatch=require(_0xc37d('0x3'));var rp=require('request-promise');var moment=require(_0xc37d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc37d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc37d('0x6'));var fs=require('fs');var fs_extra=require(_0xc37d('0x7'));var _=require(_0xc37d('0x8'));var squel=require(_0xc37d('0x9'));var crypto=require(_0xc37d('0xa'));var jsforce=require(_0xc37d('0xb'));var deskjs=require(_0xc37d('0xc'));var toCsv=require(_0xc37d('0xd'));var querystring=require(_0xc37d('0xe'));var Papa=require('papaparse');var Redis=require(_0xc37d('0xf'));var authService=require(_0xc37d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc37d('0x11'));var hardwareService=require(_0xc37d('0x12'));var logger=require('../../config/logger')(_0xc37d('0x13'));var utils=require(_0xc37d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc37d('0x15'));var db=require(_0xc37d('0x16'))['db'];function respondWithStatusCode(_0x429e7c,_0x28611c){_0x28611c=_0x28611c||0xcc;return function(_0x345666){if(_0x345666){return _0x429e7c[_0xc37d('0x17')](_0x28611c);}return _0x429e7c[_0xc37d('0x18')](_0x28611c)[_0xc37d('0x19')]();};}function respondWithResult(_0x9da0c,_0x39aab8){_0x39aab8=_0x39aab8||0xc8;return function(_0x183c8a){if(_0x183c8a){return _0x9da0c[_0xc37d('0x18')](_0x39aab8)['json'](_0x183c8a);}};}function respondWithFilteredResult(_0x547047,_0x2e44ea){return function(_0x5bca59){if(_0x5bca59){var _0x5c90e3=typeof _0x2e44ea[_0xc37d('0x1a')]===_0xc37d('0x1b')&&typeof _0x2e44ea['limit']===_0xc37d('0x1b');var _0x4adec0=_0x5bca59['count'];var _0xcd23a5=_0x5c90e3?0x0:_0x2e44ea[_0xc37d('0x1a')];var _0xfefa40=_0x5c90e3?_0x5bca59[_0xc37d('0x1c')]:_0x2e44ea[_0xc37d('0x1a')]+_0x2e44ea[_0xc37d('0x1d')];var _0x59d7cb;if(_0xfefa40>=_0x4adec0){_0xfefa40=_0x4adec0;_0x59d7cb=0xc8;}else{_0x59d7cb=0xce;}_0x547047['status'](_0x59d7cb);return _0x547047[_0xc37d('0x1e')](_0xc37d('0x1f'),_0xcd23a5+'-'+_0xfefa40+'/'+_0x4adec0)[_0xc37d('0x20')](_0x5bca59);}return null;};}function patchUpdates(_0x526ae1){return function(_0x369cf6){try{jsonpatch[_0xc37d('0x21')](_0x369cf6,_0x526ae1,!![]);}catch(_0x55ffb2){return BPromise[_0xc37d('0x22')](_0x55ffb2);}return _0x369cf6['save']();};}function saveUpdates(_0x219840,_0x3db21b){return function(_0x1c1e3a){if(_0x1c1e3a){return _0x1c1e3a[_0xc37d('0x23')](_0x219840)[_0xc37d('0x24')](function(_0x2f48d5){return _0x2f48d5;});}return null;};}function removeEntity(_0x120378,_0x1ab504){return function(_0x2c90df){if(_0x2c90df){return _0x2c90df['destroy']()[_0xc37d('0x24')](function(){_0x120378[_0xc37d('0x18')](0xcc)[_0xc37d('0x19')]();});}};}function handleEntityNotFound(_0x5c1dd7,_0x19fe41){return function(_0x5a4f5b){if(!_0x5a4f5b){_0x5c1dd7['sendStatus'](0x194);}return _0x5a4f5b;};}function handleError(_0x3abbaa,_0x1d8870){_0x1d8870=_0x1d8870||0x1f4;return function(_0x459f13){logger[_0xc37d('0x25')](_0x459f13[_0xc37d('0x26')]);if(_0x459f13['name']){delete _0x459f13[_0xc37d('0x27')];}_0x3abbaa['status'](_0x1d8870)[_0xc37d('0x28')](_0x459f13);};}exports['index']=function(_0x1f69fb,_0x3cdc2d){var _0x1d116a={},_0x26be2a={},_0x1c151d={'count':0x0,'rows':[]};var _0x2e24e7=_[_0xc37d('0x29')](db[_0xc37d('0x2a')]['rawAttributes'],function(_0x146831){return{'name':_0x146831['fieldName'],'type':_0x146831['type'][_0xc37d('0x2b')]};});_0x26be2a[_0xc37d('0x2c')]=_[_0xc37d('0x29')](_0x2e24e7,_0xc37d('0x27'));_0x26be2a[_0xc37d('0x2d')]=_[_0xc37d('0x2e')](_0x1f69fb[_0xc37d('0x2d')]);_0x26be2a[_0xc37d('0x2f')]=_[_0xc37d('0x30')](_0x26be2a['model'],_0x26be2a['query']);_0x1d116a[_0xc37d('0x31')]=_[_0xc37d('0x30')](_0x26be2a[_0xc37d('0x2c')],qs['fields'](_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x32')]));_0x1d116a[_0xc37d('0x31')]=_0x1d116a['attributes'][_0xc37d('0x33')]?_0x1d116a[_0xc37d('0x31')]:_0x26be2a[_0xc37d('0x2c')];if(!_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x34')]('nolimit')){_0x1d116a['limit']=qs[_0xc37d('0x1d')](_0x1f69fb['query'][_0xc37d('0x1d')]);_0x1d116a[_0xc37d('0x1a')]=qs[_0xc37d('0x1a')](_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x1a')]);}_0x1d116a['order']=qs['sort'](_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x35')]);_0x1d116a[_0xc37d('0x36')]=qs['filters'](_[_0xc37d('0x37')](_0x1f69fb[_0xc37d('0x2d')],_0x26be2a[_0xc37d('0x2f')]),_0x2e24e7);if(_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x38')]){_0x1d116a[_0xc37d('0x36')]=_[_0xc37d('0x39')](_0x1d116a['where'],{'$or':_['map'](_0x2e24e7,function(_0x318020){if(_0x318020[_0xc37d('0x3a')]!==_0xc37d('0x3b')){var _0x503b7e={};_0x503b7e[_0x318020['name']]={'$like':'%'+_0x1f69fb[_0xc37d('0x2d')]['filter']+'%'};return _0x503b7e;}})});}_0x1d116a=_['merge']({},_0x1d116a,_0x1f69fb[_0xc37d('0x3c')]);var _0x5428a2={'where':_0x1d116a[_0xc37d('0x36')]};return db['FaxQueueReport'][_0xc37d('0x1c')](_0x5428a2)[_0xc37d('0x24')](function(_0x88ed5d){_0x1c151d[_0xc37d('0x1c')]=_0x88ed5d;if(_0x1f69fb[_0xc37d('0x2d')][_0xc37d('0x3d')]){_0x1d116a['include']=[{'all':!![]}];}return db[_0xc37d('0x2a')][_0xc37d('0x3e')](_0x1d116a);})[_0xc37d('0x24')](function(_0x5151f9){_0x1c151d[_0xc37d('0x3f')]=_0x5151f9;return _0x1c151d;})[_0xc37d('0x24')](respondWithFilteredResult(_0x3cdc2d,_0x1d116a))[_0xc37d('0x40')](handleError(_0x3cdc2d,null));};exports['show']=function(_0x5675fb,_0xdea30e){var _0x31c27d={'raw':!![],'where':{'id':_0x5675fb[_0xc37d('0x41')]['id']}},_0x578163={};_0x578163[_0xc37d('0x2c')]=_['keys'](db['FaxQueueReport'][_0xc37d('0x42')]);_0x578163['query']=_[_0xc37d('0x2e')](_0x5675fb[_0xc37d('0x2d')]);_0x578163['filters']=_[_0xc37d('0x30')](_0x578163[_0xc37d('0x2c')],_0x578163['query']);_0x31c27d['attributes']=_[_0xc37d('0x30')](_0x578163[_0xc37d('0x2c')],qs[_0xc37d('0x32')](_0x5675fb[_0xc37d('0x2d')][_0xc37d('0x32')]));_0x31c27d[_0xc37d('0x31')]=_0x31c27d[_0xc37d('0x31')][_0xc37d('0x33')]?_0x31c27d[_0xc37d('0x31')]:_0x578163[_0xc37d('0x2c')];if(_0x5675fb[_0xc37d('0x2d')][_0xc37d('0x3d')]){_0x31c27d[_0xc37d('0x43')]=[{'all':!![]}];}_0x31c27d=_[_0xc37d('0x39')]({},_0x31c27d,_0x5675fb[_0xc37d('0x3c')]);return db[_0xc37d('0x2a')][_0xc37d('0x44')](_0x31c27d)[_0xc37d('0x24')](handleEntityNotFound(_0xdea30e,null))['then'](respondWithResult(_0xdea30e,null))[_0xc37d('0x40')](handleError(_0xdea30e,null));};exports[_0xc37d('0x45')]=function(_0x201554,_0x30dad2){return db[_0xc37d('0x2a')][_0xc37d('0x45')](_0x201554['body'],{})[_0xc37d('0x24')](respondWithResult(_0x30dad2,0xc9))[_0xc37d('0x40')](handleError(_0x30dad2,null));};exports['update']=function(_0x4b2ced,_0x840116){if(_0x4b2ced['body']['id']){delete _0x4b2ced[_0xc37d('0x46')]['id'];}return db[_0xc37d('0x2a')]['find']({'where':{'id':_0x4b2ced[_0xc37d('0x41')]['id']}})[_0xc37d('0x24')](handleEntityNotFound(_0x840116,null))[_0xc37d('0x24')](saveUpdates(_0x4b2ced['body'],null))[_0xc37d('0x24')](respondWithResult(_0x840116,null))[_0xc37d('0x40')](handleError(_0x840116,null));};exports['destroy']=function(_0x242e03,_0xe183d7){return db[_0xc37d('0x2a')][_0xc37d('0x44')]({'where':{'id':_0x242e03[_0xc37d('0x41')]['id']}})[_0xc37d('0x24')](handleEntityNotFound(_0xe183d7,null))['then'](removeEntity(_0xe183d7,null))[_0xc37d('0x40')](handleError(_0xe183d7,null));};exports[_0xc37d('0x47')]=function(_0x5af40f,_0x40bd79){return db[_0xc37d('0x2a')][_0xc37d('0x47')]()[_0xc37d('0x24')](respondWithResult(_0x40bd79,null))[_0xc37d('0x40')](handleError(_0x40bd79,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','FaxQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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['FaxQueueReport'][_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/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 95d1df6..2fa4778 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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x46c140,_0x20d524){var _0x12122e=function(_0x491bfd){while(--_0x491bfd){_0x46c140['push'](_0x46c140['shift']());}};_0x12122e(++_0x20d524);}(_0xe14b,0x93));var _0xbe14=function(_0x3af3b6,_0x4ad29e){_0x3af3b6=_0x3af3b6-0x0;var _0x1a5ad2=_0xe14b[_0x3af3b6];return _0x1a5ad2;};'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 +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0xd71aa,_0x384ead){var _0x3f0ee1=function(_0x4a053d){while(--_0x4a053d){_0xd71aa['push'](_0xd71aa['shift']());}};_0x3f0ee1(++_0x384ead);}(_0x326f,0xd1));var _0xf326=function(_0x5efb40,_0x3287f8){_0x5efb40=_0x5efb40-0x0;var _0x298e61=_0x326f[_0x5efb40];return _0x298e61;};'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/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 6d37b38..fc1702c 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 _0x9aab=['rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','options','then','CreateFaxQueueReport','UpdateFaxQueueReport','update','body','raw','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x26172c,_0x3da4b5){var _0xb99a81=function(_0x299355){while(--_0x299355){_0x26172c['push'](_0x26172c['shift']());}};_0xb99a81(++_0x3da4b5);}(_0x9aab,0x7a));var _0xb9aa=function(_0x4e128d,_0x4e149e){_0x4e128d=_0x4e128d-0x0;var _0x241615=_0x9aab[_0x4e128d];return _0x241615;};'use strict';var _=require(_0xb9aa('0x0'));var util=require('util');var moment=require(_0xb9aa('0x1'));var BPromise=require(_0xb9aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9aa('0x3'));var db=require(_0xb9aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9aa('0x5'))(_0xb9aa('0x6'));var config=require(_0xb9aa('0x7'));var jayson=require(_0xb9aa('0x8'));var client=jayson[_0xb9aa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4709d9,_0x545394,_0xedfb23){return new BPromise(function(_0x2cfa05,_0x2bc5a6){return client[_0xb9aa('0xa')](_0x4709d9,_0xedfb23)['then'](function(_0x356ce6){logger[_0xb9aa('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x545394,_0xb9aa('0xc'));logger[_0xb9aa('0xd')](_0xb9aa('0xe'),_0x545394,_0xb9aa('0xc'),JSON[_0xb9aa('0xf')](_0x356ce6));if(_0x356ce6[_0xb9aa('0x10')]){if(_0x356ce6[_0xb9aa('0x10')][_0xb9aa('0x11')]===0x1f4){logger[_0xb9aa('0x10')](_0xb9aa('0x12'),_0x545394,_0x356ce6[_0xb9aa('0x10')][_0xb9aa('0x13')]);return _0x2bc5a6(_0x356ce6['error'][_0xb9aa('0x13')]);}logger[_0xb9aa('0x10')](_0xb9aa('0x12'),_0x545394,_0x356ce6['error'][_0xb9aa('0x13')]);return _0x2cfa05(_0x356ce6[_0xb9aa('0x10')][_0xb9aa('0x13')]);}else{logger[_0xb9aa('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x545394,'request\x20sent');_0x2cfa05(_0x356ce6[_0xb9aa('0x14')][_0xb9aa('0x13')]);}})[_0xb9aa('0x15')](function(_0x4eec3b){logger[_0xb9aa('0x10')](_0xb9aa('0x12'),_0x545394,_0x4eec3b);_0x2bc5a6(_0x4eec3b);});});}exports['CreateFaxQueueReport']=function(_0x510572){var _0x5c217d=this;return new Promise(function(_0x2a1c42,_0x380fd1){return db[_0xb9aa('0x16')]['create'](_0x510572['body'],{'raw':_0x510572[_0xb9aa('0x17')]?_0x510572['options']['raw']===undefined?!![]:![]:!![]})[_0xb9aa('0x18')](function(_0x350d46){logger['info'](_0xb9aa('0x19'),_0x510572);logger[_0xb9aa('0xd')](_0xb9aa('0x19'),_0x510572,JSON[_0xb9aa('0xf')](_0x350d46));_0x2a1c42(_0x350d46);})['catch'](function(_0x1e768a){logger['error']('CreateFaxQueueReport',_0x1e768a[_0xb9aa('0x13')],_0x510572);_0x380fd1(_0x5c217d[_0xb9aa('0x10')](0x1f4,_0x1e768a['message']));});});};exports[_0xb9aa('0x1a')]=function(_0x170355){var _0xabf7b9=this;return new Promise(function(_0x17e5cd,_0x2f257b){return db[_0xb9aa('0x16')][_0xb9aa('0x1b')](_0x170355[_0xb9aa('0x1c')],{'raw':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')][_0xb9aa('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')]['where']||null:null,'attributes':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')][_0xb9aa('0x1e')]||null:null,'limit':_0x170355[_0xb9aa('0x17')]?_0x170355[_0xb9aa('0x17')][_0xb9aa('0x1f')]||null:null})[_0xb9aa('0x18')](function(_0x46806e){logger[_0xb9aa('0xb')](_0xb9aa('0x1a'),_0x170355);logger['debug'](_0xb9aa('0x1a'),_0x170355,JSON[_0xb9aa('0xf')](_0x46806e));_0x17e5cd(_0x46806e);})[_0xb9aa('0x15')](function(_0x4cd8f){logger[_0xb9aa('0x10')](_0xb9aa('0x1a'),_0x4cd8f[_0xb9aa('0x13')],_0x170355);_0x2f257b(_0xabf7b9[_0xb9aa('0x10')](0x1f4,_0x4cd8f[_0xb9aa('0x13')]));});});}; \ No newline at end of file +var _0xa81c=['request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateFaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','FaxQueueReport','where','attributes','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s'];(function(_0x279968,_0x1574f7){var _0x5902c3=function(_0x527980){while(--_0x527980){_0x279968['push'](_0x279968['shift']());}};_0x5902c3(++_0x1574f7);}(_0xa81c,0x11c));var _0xca81=function(_0x223aa7,_0xcb8557){_0x223aa7=_0x223aa7-0x0;var _0x512571=_0xa81c[_0x223aa7];return _0x512571;};'use strict';var _=require(_0xca81('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xca81('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca81('0x2'));var db=require(_0xca81('0x3'))['db'];var utils=require(_0xca81('0x4'));var logger=require(_0xca81('0x5'))(_0xca81('0x6'));var config=require(_0xca81('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xca81('0x8')][_0xca81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29ddaf,_0x30cff7,_0x22d665){return new BPromise(function(_0x94fb21,_0x5c27cd){return client[_0xca81('0xa')](_0x29ddaf,_0x22d665)['then'](function(_0xa0ef7b){logger[_0xca81('0xb')](_0xca81('0xc'),_0x30cff7,_0xca81('0xd'));logger[_0xca81('0xe')](_0xca81('0xf'),_0x30cff7,_0xca81('0xd'),JSON[_0xca81('0x10')](_0xa0ef7b));if(_0xa0ef7b['error']){if(_0xa0ef7b['error'][_0xca81('0x11')]===0x1f4){logger[_0xca81('0x12')](_0xca81('0xc'),_0x30cff7,_0xa0ef7b[_0xca81('0x12')][_0xca81('0x13')]);return _0x5c27cd(_0xa0ef7b[_0xca81('0x12')][_0xca81('0x13')]);}logger[_0xca81('0x12')](_0xca81('0xc'),_0x30cff7,_0xa0ef7b[_0xca81('0x12')][_0xca81('0x13')]);return _0x94fb21(_0xa0ef7b['error']['message']);}else{logger[_0xca81('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x30cff7,_0xca81('0xd'));_0x94fb21(_0xa0ef7b[_0xca81('0x14')][_0xca81('0x13')]);}})[_0xca81('0x15')](function(_0x2391f4){logger[_0xca81('0x12')](_0xca81('0xc'),_0x30cff7,_0x2391f4);_0x5c27cd(_0x2391f4);});});}exports[_0xca81('0x16')]=function(_0x55572c){var _0x3f689e=this;return new Promise(function(_0x235f15,_0x371420){return db['FaxQueueReport'][_0xca81('0x17')](_0x55572c[_0xca81('0x18')],{'raw':_0x55572c[_0xca81('0x19')]?_0x55572c['options'][_0xca81('0x1a')]===undefined?!![]:![]:!![]})[_0xca81('0x1b')](function(_0x53a374){logger[_0xca81('0xb')](_0xca81('0x16'),_0x55572c);logger['debug']('CreateFaxQueueReport',_0x55572c,JSON[_0xca81('0x10')](_0x53a374));_0x235f15(_0x53a374);})[_0xca81('0x15')](function(_0x3597f2){logger[_0xca81('0x12')](_0xca81('0x16'),_0x3597f2[_0xca81('0x13')],_0x55572c);_0x371420(_0x3f689e['error'](0x1f4,_0x3597f2[_0xca81('0x13')]));});});};exports[_0xca81('0x1c')]=function(_0x27840f){var _0x4e1cd8=this;return new Promise(function(_0x1af692,_0x59684f){return db[_0xca81('0x1d')]['update'](_0x27840f['body'],{'raw':_0x27840f[_0xca81('0x19')]?_0x27840f[_0xca81('0x19')][_0xca81('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27840f[_0xca81('0x19')]?_0x27840f[_0xca81('0x19')][_0xca81('0x1e')]||null:null,'attributes':_0x27840f['options']?_0x27840f['options'][_0xca81('0x1f')]||null:null,'limit':_0x27840f[_0xca81('0x19')]?_0x27840f[_0xca81('0x19')][_0xca81('0x20')]||null:null})[_0xca81('0x1b')](function(_0x44795d){logger['info'](_0xca81('0x1c'),_0x27840f);logger[_0xca81('0xe')](_0xca81('0x1c'),_0x27840f,JSON['stringify'](_0x44795d));_0x1af692(_0x44795d);})[_0xca81('0x15')](function(_0x2d80f2){logger['error']('UpdateFaxQueueReport',_0x2d80f2['message'],_0x27840f);_0x59684f(_0x4e1cd8['error'](0x1f4,_0x2d80f2['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index bd065c5..15bb542 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 _0xc746=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x1842bb,_0x41250a){var _0xe81b30=function(_0xd43d81){while(--_0xd43d81){_0x1842bb['push'](_0x1842bb['shift']());}};_0xe81b30(++_0x41250a);}(_0xc746,0xd1));var _0x6c74=function(_0x37de02,_0x361205){_0x37de02=_0x37de02-0x0;var _0x8717fa=_0xc746[_0x37de02];return _0x8717fa;};'use strict';var multer=require(_0x6c74('0x0'));var util=require(_0x6c74('0x1'));var path=require(_0x6c74('0x2'));var timeout=require(_0x6c74('0x3'));var express=require(_0x6c74('0x4'));var router=express[_0x6c74('0x5')]();var fs_extra=require(_0x6c74('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6c74('0x7'));var config=require(_0x6c74('0x8'));var controller=require(_0x6c74('0x9'));router[_0x6c74('0xa')]('/',auth[_0x6c74('0xb')](),controller[_0x6c74('0xc')]);router[_0x6c74('0xa')](_0x6c74('0xd'),auth[_0x6c74('0xb')](),controller[_0x6c74('0xe')]);router['get'](_0x6c74('0xf'),auth[_0x6c74('0xb')](),controller[_0x6c74('0x10')]);router[_0x6c74('0x11')]('/',auth[_0x6c74('0xb')](),controller[_0x6c74('0x12')]);router[_0x6c74('0x13')](_0x6c74('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x6c74('0x14')](_0x6c74('0xf'),auth[_0x6c74('0xb')](),controller[_0x6c74('0x15')]);module[_0x6c74('0x16')]=router; \ No newline at end of file +var _0x4f6b=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','multer'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x4f6b,0xc7));var _0xb4f6=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x4f6b[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0xb4f6('0x0'));var util=require(_0xb4f6('0x1'));var path=require(_0xb4f6('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4f6('0x3'));var router=express[_0xb4f6('0x4')]();var fs_extra=require(_0xb4f6('0x5'));var auth=require(_0xb4f6('0x6'));var interaction=require(_0xb4f6('0x7'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0xb4f6('0x8')]('/',auth[_0xb4f6('0x9')](),controller[_0xb4f6('0xa')]);router[_0xb4f6('0x8')](_0xb4f6('0xb'),auth[_0xb4f6('0x9')](),controller[_0xb4f6('0xc')]);router['get'](_0xb4f6('0xd'),auth['isAuthenticated'](),controller[_0xb4f6('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb4f6('0xf')]);router[_0xb4f6('0x10')]('/:id',auth[_0xb4f6('0x9')](),controller[_0xb4f6('0x11')]);router[_0xb4f6('0x12')](_0xb4f6('0xd'),auth['isAuthenticated'](),controller[_0xb4f6('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 56007bc..3519ac1 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x29f1d1,_0x10a240){var _0x8fce6d=function(_0x280618){while(--_0x280618){_0x29f1d1['push'](_0x29f1d1['shift']());}};_0x8fce6d(++_0x10a240);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x2341ab,_0x326a6c){var _0x54533e=function(_0x413273){while(--_0x413273){_0x2341ab['push'](_0x2341ab['shift']());}};_0x54533e(++_0x326a6c);}(_0x34e8,0x12c));var _0x834e=function(_0x2dda65,_0x477a07){_0x2dda65=_0x2dda65-0x0;var _0x46504c=_0x34e8[_0x2dda65];return _0x46504c;};'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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 22255c0..ab34b1b 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 _0xe2ed=['options','FaxTransferReport','find','create','catch','body','params','describe','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','include','findAll','rows','show'];(function(_0x423e42,_0x2f632b){var _0x12e752=function(_0x23d7df){while(--_0x23d7df){_0x423e42['push'](_0x423e42['shift']());}};_0x12e752(++_0x2f632b);}(_0xe2ed,0xdd));var _0xde2e=function(_0x504532,_0x353435){_0x504532=_0x504532-0x0;var _0x5bc639=_0xe2ed[_0x504532];return _0x5bc639;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde2e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde2e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xde2e('0x2'));var Mustache=require(_0xde2e('0x3'));var util=require(_0xde2e('0x4'));var path=require(_0xde2e('0x5'));var sox=require(_0xde2e('0x6'));var csv=require(_0xde2e('0x7'));var ejs=require(_0xde2e('0x8'));var fs=require('fs');var fs_extra=require(_0xde2e('0x9'));var _=require(_0xde2e('0xa'));var squel=require('squel');var crypto=require(_0xde2e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xde2e('0xc'));var toCsv=require(_0xde2e('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xde2e('0xd'));var authService=require(_0xde2e('0xe'));var qs=require(_0xde2e('0xf'));var as=require(_0xde2e('0x10'));var hardwareService=require(_0xde2e('0x11'));var logger=require('../../config/logger')(_0xde2e('0x12'));var utils=require('../../config/utils');var config=require(_0xde2e('0x13'));var licenseUtil=require(_0xde2e('0x14'));var db=require(_0xde2e('0x15'))['db'];function respondWithStatusCode(_0x14ae12,_0x2fd99e){_0x2fd99e=_0x2fd99e||0xcc;return function(_0x212bf5){if(_0x212bf5){return _0x14ae12[_0xde2e('0x16')](_0x2fd99e);}return _0x14ae12[_0xde2e('0x17')](_0x2fd99e)[_0xde2e('0x18')]();};}function respondWithResult(_0x4b460a,_0x48b6e3){_0x48b6e3=_0x48b6e3||0xc8;return function(_0x17f26e){if(_0x17f26e){return _0x4b460a[_0xde2e('0x17')](_0x48b6e3)[_0xde2e('0x19')](_0x17f26e);}};}function respondWithFilteredResult(_0x206fb8,_0x4615ab){return function(_0x507664){if(_0x507664){var _0x22533f=typeof _0x4615ab['offset']===_0xde2e('0x1a')&&typeof _0x4615ab[_0xde2e('0x1b')]===_0xde2e('0x1a');var _0x27333d=_0x507664['count'];var _0x3469e5=_0x22533f?0x0:_0x4615ab[_0xde2e('0x1c')];var _0x5d5ad2=_0x22533f?_0x507664[_0xde2e('0x1d')]:_0x4615ab[_0xde2e('0x1c')]+_0x4615ab[_0xde2e('0x1b')];var _0x33aa7c;if(_0x5d5ad2>=_0x27333d){_0x5d5ad2=_0x27333d;_0x33aa7c=0xc8;}else{_0x33aa7c=0xce;}_0x206fb8[_0xde2e('0x17')](_0x33aa7c);return _0x206fb8['set'](_0xde2e('0x1e'),_0x3469e5+'-'+_0x5d5ad2+'/'+_0x27333d)[_0xde2e('0x19')](_0x507664);}return null;};}function patchUpdates(_0x3157c8){return function(_0x564490){try{jsonpatch[_0xde2e('0x1f')](_0x564490,_0x3157c8,!![]);}catch(_0x5d4b86){return BPromise[_0xde2e('0x20')](_0x5d4b86);}return _0x564490[_0xde2e('0x21')]();};}function saveUpdates(_0x392db8,_0x1c9b98){return function(_0x35b21f){if(_0x35b21f){return _0x35b21f[_0xde2e('0x22')](_0x392db8)[_0xde2e('0x23')](function(_0x21593a){return _0x21593a;});}return null;};}function removeEntity(_0x338d53,_0xdbcb0d){return function(_0x392027){if(_0x392027){return _0x392027[_0xde2e('0x24')]()[_0xde2e('0x23')](function(){_0x338d53['status'](0xcc)[_0xde2e('0x18')]();});}};}function handleEntityNotFound(_0x4f9289,_0x47e7eb){return function(_0x178efc){if(!_0x178efc){_0x4f9289[_0xde2e('0x16')](0x194);}return _0x178efc;};}function handleError(_0x198447,_0x457e1d){_0x457e1d=_0x457e1d||0x1f4;return function(_0x3c320c){logger[_0xde2e('0x25')](_0x3c320c[_0xde2e('0x26')]);if(_0x3c320c[_0xde2e('0x27')]){delete _0x3c320c[_0xde2e('0x27')];}_0x198447[_0xde2e('0x17')](_0x457e1d)[_0xde2e('0x28')](_0x3c320c);};}exports[_0xde2e('0x29')]=function(_0x1de86c,_0x5cce2a){var _0x4c7194={},_0x16f1aa={},_0x51ad30={'count':0x0,'rows':[]};var _0x2b6c17=_[_0xde2e('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x36454b){return{'name':_0x36454b[_0xde2e('0x2b')],'type':_0x36454b[_0xde2e('0x2c')]['key']};});_0x16f1aa[_0xde2e('0x2d')]=_[_0xde2e('0x2a')](_0x2b6c17,'name');_0x16f1aa[_0xde2e('0x2e')]=_[_0xde2e('0x2f')](_0x1de86c[_0xde2e('0x2e')]);_0x16f1aa['filters']=_[_0xde2e('0x30')](_0x16f1aa[_0xde2e('0x2d')],_0x16f1aa['query']);_0x4c7194[_0xde2e('0x31')]=_[_0xde2e('0x30')](_0x16f1aa[_0xde2e('0x2d')],qs[_0xde2e('0x32')](_0x1de86c[_0xde2e('0x2e')]['fields']));_0x4c7194[_0xde2e('0x31')]=_0x4c7194['attributes'][_0xde2e('0x33')]?_0x4c7194[_0xde2e('0x31')]:_0x16f1aa['model'];if(!_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x34')](_0xde2e('0x35'))){_0x4c7194[_0xde2e('0x1b')]=qs[_0xde2e('0x1b')](_0x1de86c[_0xde2e('0x2e')]['limit']);_0x4c7194[_0xde2e('0x1c')]=qs[_0xde2e('0x1c')](_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x1c')]);}_0x4c7194['order']=qs['sort'](_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x36')]);_0x4c7194['where']=qs[_0xde2e('0x37')](_['pick'](_0x1de86c[_0xde2e('0x2e')],_0x16f1aa[_0xde2e('0x37')]),_0x2b6c17);if(_0x1de86c['query'][_0xde2e('0x38')]){_0x4c7194[_0xde2e('0x39')]=_[_0xde2e('0x3a')](_0x4c7194['where'],{'$or':_[_0xde2e('0x2a')](_0x2b6c17,function(_0x53a14e){if(_0x53a14e[_0xde2e('0x2c')]!=='VIRTUAL'){var _0x4548ba={};_0x4548ba[_0x53a14e[_0xde2e('0x27')]]={'$like':'%'+_0x1de86c[_0xde2e('0x2e')][_0xde2e('0x38')]+'%'};return _0x4548ba;}})});}_0x4c7194=_[_0xde2e('0x3a')]({},_0x4c7194,_0x1de86c['options']);var _0x342ba0={'where':_0x4c7194[_0xde2e('0x39')]};return db['FaxTransferReport']['count'](_0x342ba0)[_0xde2e('0x23')](function(_0x14fef8){_0x51ad30[_0xde2e('0x1d')]=_0x14fef8;if(_0x1de86c[_0xde2e('0x2e')]['includeAll']){_0x4c7194[_0xde2e('0x3b')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xde2e('0x3c')](_0x4c7194);})[_0xde2e('0x23')](function(_0x2c123c){_0x51ad30[_0xde2e('0x3d')]=_0x2c123c;return _0x51ad30;})[_0xde2e('0x23')](respondWithFilteredResult(_0x5cce2a,_0x4c7194))['catch'](handleError(_0x5cce2a,null));};exports[_0xde2e('0x3e')]=function(_0x328e04,_0x28c6ae){var _0x1934ef={'raw':!![],'where':{'id':_0x328e04['params']['id']}},_0x1c71c1={};_0x1c71c1[_0xde2e('0x2d')]=_[_0xde2e('0x2f')](db['FaxTransferReport']['rawAttributes']);_0x1c71c1['query']=_[_0xde2e('0x2f')](_0x328e04[_0xde2e('0x2e')]);_0x1c71c1[_0xde2e('0x37')]=_['intersection'](_0x1c71c1[_0xde2e('0x2d')],_0x1c71c1[_0xde2e('0x2e')]);_0x1934ef[_0xde2e('0x31')]=_[_0xde2e('0x30')](_0x1c71c1[_0xde2e('0x2d')],qs[_0xde2e('0x32')](_0x328e04[_0xde2e('0x2e')]['fields']));_0x1934ef[_0xde2e('0x31')]=_0x1934ef['attributes'][_0xde2e('0x33')]?_0x1934ef['attributes']:_0x1c71c1[_0xde2e('0x2d')];if(_0x328e04[_0xde2e('0x2e')]['includeAll']){_0x1934ef[_0xde2e('0x3b')]=[{'all':!![]}];}_0x1934ef=_['merge']({},_0x1934ef,_0x328e04[_0xde2e('0x3f')]);return db[_0xde2e('0x40')][_0xde2e('0x41')](_0x1934ef)[_0xde2e('0x23')](handleEntityNotFound(_0x28c6ae,null))[_0xde2e('0x23')](respondWithResult(_0x28c6ae,null))['catch'](handleError(_0x28c6ae,null));};exports[_0xde2e('0x42')]=function(_0x2cb24e,_0x1c40ae){return db[_0xde2e('0x40')]['create'](_0x2cb24e['body'],{})[_0xde2e('0x23')](respondWithResult(_0x1c40ae,0xc9))[_0xde2e('0x43')](handleError(_0x1c40ae,null));};exports[_0xde2e('0x22')]=function(_0x31c475,_0x501272){if(_0x31c475[_0xde2e('0x44')]['id']){delete _0x31c475[_0xde2e('0x44')]['id'];}return db[_0xde2e('0x40')]['find']({'where':{'id':_0x31c475[_0xde2e('0x45')]['id']}})[_0xde2e('0x23')](handleEntityNotFound(_0x501272,null))[_0xde2e('0x23')](saveUpdates(_0x31c475[_0xde2e('0x44')],null))['then'](respondWithResult(_0x501272,null))[_0xde2e('0x43')](handleError(_0x501272,null));};exports['destroy']=function(_0x4d4da7,_0x25207e){return db['FaxTransferReport'][_0xde2e('0x41')]({'where':{'id':_0x4d4da7[_0xde2e('0x45')]['id']}})[_0xde2e('0x23')](handleEntityNotFound(_0x25207e,null))[_0xde2e('0x23')](removeEntity(_0x25207e,null))['catch'](handleError(_0x25207e,null));};exports['describe']=function(_0x4bb3cb,_0x36707c){return db[_0xde2e('0x40')][_0xde2e('0x46')]()[_0xde2e('0x23')](respondWithResult(_0x36707c,null))[_0xde2e('0x43')](handleError(_0x36707c,null));}; \ No newline at end of file +var _0xb504=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','FaxTransferReport','include','rows','show','params','includeAll','options','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','limit','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb504,0x118));var _0x4b50=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb504[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x4b50('0x0'));var rimraf=require(_0x4b50('0x1'));var zipdir=require(_0x4b50('0x2'));var jsonpatch=require(_0x4b50('0x3'));var rp=require(_0x4b50('0x4'));var moment=require(_0x4b50('0x5'));var BPromise=require(_0x4b50('0x6'));var Mustache=require(_0x4b50('0x7'));var util=require('util');var path=require(_0x4b50('0x8'));var sox=require(_0x4b50('0x9'));var csv=require(_0x4b50('0xa'));var ejs=require(_0x4b50('0xb'));var fs=require('fs');var fs_extra=require(_0x4b50('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4b50('0xd'));var jsforce=require(_0x4b50('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4b50('0xa'));var querystring=require(_0x4b50('0xf'));var Papa=require(_0x4b50('0x10'));var Redis=require(_0x4b50('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4b50('0x12'));var as=require(_0x4b50('0x13'));var hardwareService=require(_0x4b50('0x14'));var logger=require('../../config/logger')(_0x4b50('0x15'));var utils=require(_0x4b50('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b50('0x17'))['db'];function respondWithStatusCode(_0x311046,_0x1c46e5){_0x1c46e5=_0x1c46e5||0xcc;return function(_0x551202){if(_0x551202){return _0x311046['sendStatus'](_0x1c46e5);}return _0x311046[_0x4b50('0x18')](_0x1c46e5)[_0x4b50('0x19')]();};}function respondWithResult(_0x17a340,_0x30158a){_0x30158a=_0x30158a||0xc8;return function(_0x48a1ce){if(_0x48a1ce){return _0x17a340[_0x4b50('0x18')](_0x30158a)[_0x4b50('0x1a')](_0x48a1ce);}};}function respondWithFilteredResult(_0x100f62,_0x5b6e20){return function(_0x201b0d){if(_0x201b0d){var _0x90692f=typeof _0x5b6e20[_0x4b50('0x1b')]==='undefined'&&typeof _0x5b6e20['limit']===_0x4b50('0x1c');var _0x3423d0=_0x201b0d[_0x4b50('0x1d')];var _0x5a4938=_0x90692f?0x0:_0x5b6e20[_0x4b50('0x1b')];var _0x512c34=_0x90692f?_0x201b0d[_0x4b50('0x1d')]:_0x5b6e20[_0x4b50('0x1b')]+_0x5b6e20[_0x4b50('0x1e')];var _0x28f540;if(_0x512c34>=_0x3423d0){_0x512c34=_0x3423d0;_0x28f540=0xc8;}else{_0x28f540=0xce;}_0x100f62['status'](_0x28f540);return _0x100f62[_0x4b50('0x1f')](_0x4b50('0x20'),_0x5a4938+'-'+_0x512c34+'/'+_0x3423d0)[_0x4b50('0x1a')](_0x201b0d);}return null;};}function patchUpdates(_0x4b89ac){return function(_0x339793){try{jsonpatch[_0x4b50('0x21')](_0x339793,_0x4b89ac,!![]);}catch(_0x198e08){return BPromise[_0x4b50('0x22')](_0x198e08);}return _0x339793[_0x4b50('0x23')]();};}function saveUpdates(_0x19f068,_0x2922bf){return function(_0x39d784){if(_0x39d784){return _0x39d784[_0x4b50('0x24')](_0x19f068)[_0x4b50('0x25')](function(_0x1e52ad){return _0x1e52ad;});}return null;};}function removeEntity(_0x235cec,_0x490f0d){return function(_0x122b4c){if(_0x122b4c){return _0x122b4c[_0x4b50('0x26')]()[_0x4b50('0x25')](function(){_0x235cec['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x334349,_0x52e171){return function(_0x2278b9){if(!_0x2278b9){_0x334349[_0x4b50('0x27')](0x194);}return _0x2278b9;};}function handleError(_0x1b380d,_0x319973){_0x319973=_0x319973||0x1f4;return function(_0x419da1){logger[_0x4b50('0x28')](_0x419da1[_0x4b50('0x29')]);if(_0x419da1[_0x4b50('0x2a')]){delete _0x419da1[_0x4b50('0x2a')];}_0x1b380d[_0x4b50('0x18')](_0x319973)[_0x4b50('0x2b')](_0x419da1);};}exports[_0x4b50('0x2c')]=function(_0x5abe94,_0x1ca4fa){var _0x174fe7={},_0x3b24bf={},_0x513822={'count':0x0,'rows':[]};var _0x469d79=_[_0x4b50('0x2d')](db['FaxTransferReport'][_0x4b50('0x2e')],function(_0x3591b9){return{'name':_0x3591b9[_0x4b50('0x2f')],'type':_0x3591b9[_0x4b50('0x30')][_0x4b50('0x31')]};});_0x3b24bf[_0x4b50('0x32')]=_[_0x4b50('0x2d')](_0x469d79,_0x4b50('0x2a'));_0x3b24bf['query']=_[_0x4b50('0x33')](_0x5abe94[_0x4b50('0x34')]);_0x3b24bf[_0x4b50('0x35')]=_[_0x4b50('0x36')](_0x3b24bf[_0x4b50('0x32')],_0x3b24bf[_0x4b50('0x34')]);_0x174fe7[_0x4b50('0x37')]=_[_0x4b50('0x36')](_0x3b24bf['model'],qs[_0x4b50('0x38')](_0x5abe94['query']['fields']));_0x174fe7['attributes']=_0x174fe7[_0x4b50('0x37')][_0x4b50('0x39')]?_0x174fe7[_0x4b50('0x37')]:_0x3b24bf[_0x4b50('0x32')];if(!_0x5abe94[_0x4b50('0x34')][_0x4b50('0x3a')](_0x4b50('0x3b'))){_0x174fe7['limit']=qs['limit'](_0x5abe94[_0x4b50('0x34')]['limit']);_0x174fe7['offset']=qs[_0x4b50('0x1b')](_0x5abe94[_0x4b50('0x34')][_0x4b50('0x1b')]);}_0x174fe7[_0x4b50('0x3c')]=qs[_0x4b50('0x3d')](_0x5abe94[_0x4b50('0x34')][_0x4b50('0x3d')]);_0x174fe7[_0x4b50('0x3e')]=qs['filters'](_[_0x4b50('0x3f')](_0x5abe94[_0x4b50('0x34')],_0x3b24bf[_0x4b50('0x35')]),_0x469d79);if(_0x5abe94[_0x4b50('0x34')][_0x4b50('0x40')]){_0x174fe7['where']=_['merge'](_0x174fe7[_0x4b50('0x3e')],{'$or':_[_0x4b50('0x2d')](_0x469d79,function(_0x10a548){if(_0x10a548[_0x4b50('0x30')]!=='VIRTUAL'){var _0xfb4055={};_0xfb4055[_0x10a548['name']]={'$like':'%'+_0x5abe94[_0x4b50('0x34')][_0x4b50('0x40')]+'%'};return _0xfb4055;}})});}_0x174fe7=_[_0x4b50('0x41')]({},_0x174fe7,_0x5abe94['options']);var _0x5c9734={'where':_0x174fe7['where']};return db[_0x4b50('0x42')][_0x4b50('0x1d')](_0x5c9734)[_0x4b50('0x25')](function(_0x50985e){_0x513822[_0x4b50('0x1d')]=_0x50985e;if(_0x5abe94['query']['includeAll']){_0x174fe7[_0x4b50('0x43')]=[{'all':!![]}];}return db[_0x4b50('0x42')]['findAll'](_0x174fe7);})[_0x4b50('0x25')](function(_0x2df66e){_0x513822[_0x4b50('0x44')]=_0x2df66e;return _0x513822;})[_0x4b50('0x25')](respondWithFilteredResult(_0x1ca4fa,_0x174fe7))['catch'](handleError(_0x1ca4fa,null));};exports[_0x4b50('0x45')]=function(_0x5cfcd3,_0x475fae){var _0x11b37e={'raw':!![],'where':{'id':_0x5cfcd3[_0x4b50('0x46')]['id']}},_0x21293b={};_0x21293b[_0x4b50('0x32')]=_['keys'](db[_0x4b50('0x42')][_0x4b50('0x2e')]);_0x21293b['query']=_['keys'](_0x5cfcd3['query']);_0x21293b[_0x4b50('0x35')]=_[_0x4b50('0x36')](_0x21293b[_0x4b50('0x32')],_0x21293b[_0x4b50('0x34')]);_0x11b37e[_0x4b50('0x37')]=_[_0x4b50('0x36')](_0x21293b[_0x4b50('0x32')],qs[_0x4b50('0x38')](_0x5cfcd3[_0x4b50('0x34')]['fields']));_0x11b37e[_0x4b50('0x37')]=_0x11b37e[_0x4b50('0x37')]['length']?_0x11b37e[_0x4b50('0x37')]:_0x21293b[_0x4b50('0x32')];if(_0x5cfcd3['query'][_0x4b50('0x47')]){_0x11b37e['include']=[{'all':!![]}];}_0x11b37e=_[_0x4b50('0x41')]({},_0x11b37e,_0x5cfcd3[_0x4b50('0x48')]);return db['FaxTransferReport']['find'](_0x11b37e)[_0x4b50('0x25')](handleEntityNotFound(_0x475fae,null))[_0x4b50('0x25')](respondWithResult(_0x475fae,null))[_0x4b50('0x49')](handleError(_0x475fae,null));};exports[_0x4b50('0x4a')]=function(_0x468733,_0x44c62c){return db['FaxTransferReport']['create'](_0x468733[_0x4b50('0x4b')],{})[_0x4b50('0x25')](respondWithResult(_0x44c62c,0xc9))[_0x4b50('0x49')](handleError(_0x44c62c,null));};exports[_0x4b50('0x24')]=function(_0xcfbb23,_0xa4e0c5){if(_0xcfbb23[_0x4b50('0x4b')]['id']){delete _0xcfbb23[_0x4b50('0x4b')]['id'];}return db['FaxTransferReport'][_0x4b50('0x4c')]({'where':{'id':_0xcfbb23[_0x4b50('0x46')]['id']}})[_0x4b50('0x25')](handleEntityNotFound(_0xa4e0c5,null))[_0x4b50('0x25')](saveUpdates(_0xcfbb23['body'],null))['then'](respondWithResult(_0xa4e0c5,null))[_0x4b50('0x49')](handleError(_0xa4e0c5,null));};exports[_0x4b50('0x26')]=function(_0x2751d4,_0x3a2bef){return db['FaxTransferReport'][_0x4b50('0x4c')]({'where':{'id':_0x2751d4['params']['id']}})['then'](handleEntityNotFound(_0x3a2bef,null))[_0x4b50('0x25')](removeEntity(_0x3a2bef,null))[_0x4b50('0x49')](handleError(_0x3a2bef,null));};exports[_0x4b50('0x4d')]=function(_0x1227cb,_0x4a03ba){return db[_0x4b50('0x42')][_0x4b50('0x4d')]()['then'](respondWithResult(_0x4a03ba,null))[_0x4b50('0x49')](handleError(_0x4a03ba,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 5fc2944..2ad810d 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 _0x0701=['api','moment','bluebird','request-promise','path','rimraf','exports','define','FaxTransferReport','uniqueid','lodash','util'];(function(_0xe72729,_0x503951){var _0x3f679b=function(_0x58939f){while(--_0x58939f){_0xe72729['push'](_0xe72729['shift']());}};_0x3f679b(++_0x503951);}(_0x0701,0x166));var _0x1070=function(_0x55f8dc,_0x11cef7){_0x55f8dc=_0x55f8dc-0x0;var _0x2daf10=_0x0701[_0x55f8dc];return _0x2daf10;};'use strict';var _=require(_0x1070('0x0'));var util=require(_0x1070('0x1'));var logger=require('../../config/logger')(_0x1070('0x2'));var moment=require(_0x1070('0x3'));var BPromise=require(_0x1070('0x4'));var rp=require(_0x1070('0x5'));var fs=require('fs');var path=require(_0x1070('0x6'));var rimraf=require(_0x1070('0x7'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x1070('0x8')]=function(_0x59c2e2,_0x5c7b9f){return _0x59c2e2[_0x1070('0x9')](_0x1070('0xa'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x1070('0xb'),'fields':[_0x1070('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa7fa=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','lodash'];(function(_0x5ad794,_0x330eb1){var _0x58d45e=function(_0x28c899){while(--_0x28c899){_0x5ad794['push'](_0x5ad794['shift']());}};_0x58d45e(++_0x330eb1);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa7f('0x1'));var moment=require(_0xaa7f('0x2'));var BPromise=require(_0xaa7f('0x3'));var rp=require(_0xaa7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa7f('0x5'));var config=require(_0xaa7f('0x6'));var attributes=require(_0xaa7f('0x7'));module[_0xaa7f('0x8')]=function(_0x48e98f,_0xf79d63){return _0x48e98f['define']('FaxTransferReport',attributes,{'tableName':_0xaa7f('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaa7f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 066df8c..28b7cff 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 _0xa16d=['FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xa16d,0x14b));var _0xda16=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0xa16d[_0x163f58];return _0x472ed9;};'use strict';var _=require(_0xda16('0x0'));var util=require(_0xda16('0x1'));var moment=require('moment');var BPromise=require(_0xda16('0x2'));var rs=require(_0xda16('0x3'));var fs=require('fs');var Redis=require(_0xda16('0x4'));var db=require(_0xda16('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda16('0x6'))(_0xda16('0x7'));var config=require(_0xda16('0x8'));var jayson=require(_0xda16('0x9'));var client=jayson[_0xda16('0xa')][_0xda16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c9aec,_0x3dea68,_0x1b7047){return new BPromise(function(_0x3bea32,_0x161370){return client[_0xda16('0xc')](_0x2c9aec,_0x1b7047)[_0xda16('0xd')](function(_0x1b1602){logger['info'](_0xda16('0xe'),_0x3dea68,_0xda16('0xf'));logger[_0xda16('0x10')](_0xda16('0x11'),_0x3dea68,'request\x20sent',JSON['stringify'](_0x1b1602));if(_0x1b1602[_0xda16('0x12')]){if(_0x1b1602[_0xda16('0x12')][_0xda16('0x13')]===0x1f4){logger['error'](_0xda16('0xe'),_0x3dea68,_0x1b1602[_0xda16('0x12')]['message']);return _0x161370(_0x1b1602['error'][_0xda16('0x14')]);}logger[_0xda16('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x3dea68,_0x1b1602[_0xda16('0x12')][_0xda16('0x14')]);return _0x3bea32(_0x1b1602[_0xda16('0x12')]['message']);}else{logger[_0xda16('0x15')]('FaxTransferReport,\x20%s,\x20%s',_0x3dea68,_0xda16('0xf'));_0x3bea32(_0x1b1602[_0xda16('0x16')][_0xda16('0x14')]);}})['catch'](function(_0x24184c){logger[_0xda16('0x12')](_0xda16('0xe'),_0x3dea68,_0x24184c);_0x161370(_0x24184c);});});} \ No newline at end of file +var _0x3bc2=['jayson/promise','http','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x51750a,_0x31cd6c){var _0x203c41=function(_0xc54aee){while(--_0xc54aee){_0x51750a['push'](_0x51750a['shift']());}};_0x203c41(++_0x31cd6c);}(_0x3bc2,0x9f));var _0x23bc=function(_0x1d7fdb,_0xdbcc3a){_0x1d7fdb=_0x1d7fdb-0x0;var _0x2f3106=_0x3bc2[_0x1d7fdb];return _0x2f3106;};'use strict';var _=require(_0x23bc('0x0'));var util=require(_0x23bc('0x1'));var moment=require(_0x23bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x23bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x23bc('0x4'))['db'];var utils=require(_0x23bc('0x5'));var logger=require(_0x23bc('0x6'))(_0x23bc('0x7'));var config=require(_0x23bc('0x8'));var jayson=require(_0x23bc('0x9'));var client=jayson['client'][_0x23bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xebecfa,_0x3e7f68,_0x419fc0){return new BPromise(function(_0x454295,_0x110b33){return client['request'](_0xebecfa,_0x419fc0)['then'](function(_0x517dbb){logger[_0x23bc('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x3e7f68,_0x23bc('0xc'));logger[_0x23bc('0xd')](_0x23bc('0xe'),_0x3e7f68,_0x23bc('0xc'),JSON[_0x23bc('0xf')](_0x517dbb));if(_0x517dbb[_0x23bc('0x10')]){if(_0x517dbb['error']['code']===0x1f4){logger[_0x23bc('0x10')](_0x23bc('0x11'),_0x3e7f68,_0x517dbb[_0x23bc('0x10')][_0x23bc('0x12')]);return _0x110b33(_0x517dbb[_0x23bc('0x10')][_0x23bc('0x12')]);}logger['error'](_0x23bc('0x11'),_0x3e7f68,_0x517dbb[_0x23bc('0x10')][_0x23bc('0x12')]);return _0x454295(_0x517dbb['error'][_0x23bc('0x12')]);}else{logger[_0x23bc('0xb')](_0x23bc('0x11'),_0x3e7f68,'request\x20sent');_0x454295(_0x517dbb[_0x23bc('0x13')][_0x23bc('0x12')]);}})[_0x23bc('0x14')](function(_0x74fc3f){logger['error'](_0x23bc('0x11'),_0x3e7f68,_0x74fc3f);_0x110b33(_0x74fc3f);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d23acfb..35978ec 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 _0x94b1=['../../config/environment','./faxTransferReport.controller','get','index','/:id','show','post','isAuthenticated','create','update','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x57597b,_0x36d862){var _0x30ec4d=function(_0x1bf0f9){while(--_0x1bf0f9){_0x57597b['push'](_0x57597b['shift']());}};_0x30ec4d(++_0x36d862);}(_0x94b1,0x186));var _0x194b=function(_0x4ad203,_0x1fa807){_0x4ad203=_0x4ad203-0x0;var _0x5516b5=_0x94b1[_0x4ad203];return _0x5516b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x194b('0x0'));var timeout=require(_0x194b('0x1'));var express=require(_0x194b('0x2'));var router=express[_0x194b('0x3')]();var fs_extra=require(_0x194b('0x4'));var auth=require(_0x194b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x194b('0x6'));var controller=require(_0x194b('0x7'));router[_0x194b('0x8')]('/',auth['isAuthenticated'](),controller[_0x194b('0x9')]);router[_0x194b('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x194b('0x8')](_0x194b('0xa'),auth['isAuthenticated'](),controller[_0x194b('0xb')]);router[_0x194b('0xc')]('/',auth[_0x194b('0xd')](),controller[_0x194b('0xe')]);router['put'](_0x194b('0xa'),auth['isAuthenticated'](),controller[_0x194b('0xf')]);router[_0x194b('0x10')]('/:id',auth[_0x194b('0xd')](),controller[_0x194b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2784=['../../config/environment','get','isAuthenticated','describe','/:id','show','post','put','delete','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x5cf1a1,_0x1ab924){var _0x52cbcc=function(_0xdc1230){while(--_0xdc1230){_0x5cf1a1['push'](_0x5cf1a1['shift']());}};_0x52cbcc(++_0x1ab924);}(_0x2784,0x1bd));var _0x4278=function(_0x518277,_0x799d48){_0x518277=_0x518277-0x0;var _0x5e666f=_0x2784[_0x518277];return _0x5e666f;};'use strict';var multer=require(_0x4278('0x0'));var util=require('util');var path=require(_0x4278('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4278('0x2')]();var fs_extra=require(_0x4278('0x3'));var auth=require(_0x4278('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4278('0x5'));var controller=require('./faxTransferReport.controller');router[_0x4278('0x6')]('/',auth[_0x4278('0x7')](),controller['index']);router[_0x4278('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x4278('0x8')]);router[_0x4278('0x6')](_0x4278('0x9'),auth[_0x4278('0x7')](),controller[_0x4278('0xa')]);router[_0x4278('0xb')]('/',auth[_0x4278('0x7')](),controller['create']);router[_0x4278('0xc')](_0x4278('0x9'),auth[_0x4278('0x7')](),controller['update']);router[_0x4278('0xd')]('/:id',auth[_0x4278('0x7')](),controller['destroy']);module[_0x4278('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 7789603..3f0040f 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 _0x903f=['isAuthenticated','get','/:id/fields','getFields','post','create','/:id/configurations','put','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','index','/:id'];(function(_0x1cf9d3,_0x4d4716){var _0x479ebc=function(_0xc4524d){while(--_0xc4524d){_0x1cf9d3['push'](_0x1cf9d3['shift']());}};_0x479ebc(++_0x4d4716);}(_0x903f,0x1c2));var _0xf903=function(_0x5cc533,_0x21101a){_0x5cc533=_0x5cc533-0x0;var _0x2e4fac=_0x903f[_0x5cc533];return _0x2e4fac;};'use strict';var multer=require('multer');var util=require(_0xf903('0x0'));var path=require(_0xf903('0x1'));var timeout=require('connect-timeout');var express=require(_0xf903('0x2'));var router=express[_0xf903('0x3')]();var fs_extra=require(_0xf903('0x4'));var auth=require(_0xf903('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf903('0x6'));var controller=require(_0xf903('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf903('0x8')]);router['get'](_0xf903('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xf903('0xa')](),controller['getConfigurations']);router[_0xf903('0xb')](_0xf903('0xc'),auth['isAuthenticated'](),controller[_0xf903('0xd')]);router[_0xf903('0xe')]('/',auth[_0xf903('0xa')](),controller[_0xf903('0xf')]);router[_0xf903('0xe')](_0xf903('0x10'),auth[_0xf903('0xa')](),controller['addConfiguration']);router[_0xf903('0x11')](_0xf903('0x9'),auth[_0xf903('0xa')](),controller[_0xf903('0x12')]);router['delete'](_0xf903('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xf903('0x13')]=router; \ No newline at end of file +var _0x9ff6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','update','delete','destroy','exports','multer'];(function(_0x503ffd,_0x8ecde){var _0x160437=function(_0x2d45dd){while(--_0x2d45dd){_0x503ffd['push'](_0x503ffd['shift']());}};_0x160437(++_0x8ecde);}(_0x9ff6,0x144));var _0x69ff=function(_0x33fab6,_0x532a04){_0x33fab6=_0x33fab6-0x0;var _0x314e60=_0x9ff6[_0x33fab6];return _0x314e60;};'use strict';var multer=require(_0x69ff('0x0'));var util=require(_0x69ff('0x1'));var path=require(_0x69ff('0x2'));var timeout=require(_0x69ff('0x3'));var express=require(_0x69ff('0x4'));var router=express[_0x69ff('0x5')]();var fs_extra=require(_0x69ff('0x6'));var auth=require(_0x69ff('0x7'));var interaction=require(_0x69ff('0x8'));var config=require(_0x69ff('0x9'));var controller=require(_0x69ff('0xa'));router[_0x69ff('0xb')]('/',auth[_0x69ff('0xc')](),controller[_0x69ff('0xd')]);router[_0x69ff('0xb')](_0x69ff('0xe'),auth[_0x69ff('0xc')](),controller[_0x69ff('0xf')]);router[_0x69ff('0xb')](_0x69ff('0x10'),auth['isAuthenticated'](),controller[_0x69ff('0x11')]);router[_0x69ff('0xb')](_0x69ff('0x12'),auth[_0x69ff('0xc')](),controller[_0x69ff('0x13')]);router[_0x69ff('0x14')]('/',auth[_0x69ff('0xc')](),controller['create']);router[_0x69ff('0x14')](_0x69ff('0x10'),auth[_0x69ff('0xc')](),controller['addConfiguration']);router['put'](_0x69ff('0xe'),auth['isAuthenticated'](),controller[_0x69ff('0x15')]);router[_0x69ff('0x16')](_0x69ff('0xe'),auth[_0x69ff('0xc')](),controller[_0x69ff('0x17')]);module[_0x69ff('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 5f9c094..fe7fbe4 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 _0xe107=['STRING','ENUM','integrationTab','newTab','exports'];(function(_0x310832,_0xe72c7e){var _0x103f74=function(_0x4a217c){while(--_0x4a217c){_0x310832['push'](_0x310832['shift']());}};_0x103f74(++_0xe72c7e);}(_0xe107,0x17b));var _0x7e10=function(_0xd5377e,_0x46b1ee){_0xd5377e=_0xd5377e-0x0;var _0x4dd167=_0xe107[_0xd5377e];return _0x4dd167;};'use strict';var Sequelize=require('sequelize');module[_0x7e10('0x0')]={'name':{'type':Sequelize[_0x7e10('0x1')]},'description':{'type':Sequelize[_0x7e10('0x1')]},'username':{'type':Sequelize[_0x7e10('0x1')]},'remoteUri':{'type':Sequelize[_0x7e10('0x1')]},'authType':{'type':Sequelize[_0x7e10('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x7e10('0x1')]},'consumerKey':{'type':Sequelize[_0x7e10('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x7e10('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7e10('0x2')](_0x7e10('0x3'),_0x7e10('0x4')),'defaultValue':_0x7e10('0x3')}}; \ No newline at end of file +var _0xcae3=['sequelize','STRING','ENUM','integrationTab'];(function(_0x2b09de,_0x4ab03d){var _0xe4b849=function(_0xcc1e3c){while(--_0xcc1e3c){_0x2b09de['push'](_0x2b09de['shift']());}};_0xe4b849(++_0x4ab03d);}(_0xcae3,0x1c8));var _0x3cae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xcae3[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x3cae('0x0'));module['exports']={'name':{'type':Sequelize[_0x3cae('0x1')]},'description':{'type':Sequelize[_0x3cae('0x1')]},'username':{'type':Sequelize[_0x3cae('0x1')]},'remoteUri':{'type':Sequelize[_0x3cae('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x3cae('0x1')]},'consumerSecret':{'type':Sequelize[_0x3cae('0x1')]},'token':{'type':Sequelize[_0x3cae('0x1')]},'tokenSecret':{'type':Sequelize[_0x3cae('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3cae('0x2')](_0x3cae('0x3'),'newTab'),'defaultValue':_0x3cae('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 91f4f29..0c1f5d5 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 _0xe867=['format','%s/custom_fields','basic','headers','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','then','destroy','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','DeskAccount','show','params','include','find','catch','create','body','getConfigurations','findOne','AccountId','getSubjects','channel','getDescriptions','DeskConfiguration','Subjects','DeskField','Descriptions','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xe867,0xef));var _0x7e86=function(_0x34e562,_0x133f9b){_0x34e562=_0x34e562-0x0;var _0x1d586c=_0xe867[_0x34e562];return _0x1d586c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e86('0x0'));var zipdir=require(_0x7e86('0x1'));var jsonpatch=require(_0x7e86('0x2'));var rp=require(_0x7e86('0x3'));var moment=require(_0x7e86('0x4'));var BPromise=require(_0x7e86('0x5'));var Mustache=require(_0x7e86('0x6'));var util=require('util');var path=require(_0x7e86('0x7'));var sox=require(_0x7e86('0x8'));var csv=require(_0x7e86('0x9'));var ejs=require(_0x7e86('0xa'));var fs=require('fs');var fs_extra=require(_0x7e86('0xb'));var _=require(_0x7e86('0xc'));var squel=require(_0x7e86('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7e86('0xe'));var toCsv=require(_0x7e86('0x9'));var querystring=require(_0x7e86('0xf'));var Papa=require(_0x7e86('0x10'));var Redis=require(_0x7e86('0x11'));var authService=require(_0x7e86('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e86('0x13'));var logger=require(_0x7e86('0x14'))('api');var utils=require(_0x7e86('0x15'));var config=require(_0x7e86('0x16'));var licenseUtil=require(_0x7e86('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x7e86('0x18'));function respondWithStatusCode(_0x2463e5,_0x5c62c7){_0x5c62c7=_0x5c62c7||0xcc;return function(_0x1af5c6){if(_0x1af5c6){return _0x2463e5[_0x7e86('0x19')](_0x5c62c7);}return _0x2463e5[_0x7e86('0x1a')](_0x5c62c7)[_0x7e86('0x1b')]();};}function respondWithResult(_0x4691c3,_0x3d6e60){_0x3d6e60=_0x3d6e60||0xc8;return function(_0x2f6b10){if(_0x2f6b10){return _0x4691c3['status'](_0x3d6e60)['json'](_0x2f6b10);}};}function respondWithFilteredResult(_0x59fb9a,_0x1ee11f){return function(_0x1e93a0){if(_0x1e93a0){var _0x24b636=typeof _0x1ee11f[_0x7e86('0x1c')]===_0x7e86('0x1d')&&typeof _0x1ee11f['limit']===_0x7e86('0x1d');var _0x40a6a7=_0x1e93a0['count'];var _0x782f8b=_0x24b636?0x0:_0x1ee11f[_0x7e86('0x1c')];var _0x559f4a=_0x24b636?_0x1e93a0[_0x7e86('0x1e')]:_0x1ee11f[_0x7e86('0x1c')]+_0x1ee11f[_0x7e86('0x1f')];var _0x189b63;if(_0x559f4a>=_0x40a6a7){_0x559f4a=_0x40a6a7;_0x189b63=0xc8;}else{_0x189b63=0xce;}_0x59fb9a[_0x7e86('0x1a')](_0x189b63);return _0x59fb9a[_0x7e86('0x20')]('Content-Range',_0x782f8b+'-'+_0x559f4a+'/'+_0x40a6a7)[_0x7e86('0x21')](_0x1e93a0);}return null;};}function patchUpdates(_0x411f87){return function(_0x5ebeed){try{jsonpatch[_0x7e86('0x22')](_0x5ebeed,_0x411f87,!![]);}catch(_0xc0629b){return BPromise[_0x7e86('0x23')](_0xc0629b);}return _0x5ebeed['save']();};}function saveUpdates(_0x216545,_0x2048c9){return function(_0x472cfb){if(_0x472cfb){return _0x472cfb['update'](_0x216545)[_0x7e86('0x24')](function(_0x2135b4){return _0x2135b4;});}return null;};}function removeEntity(_0x385168,_0x5bea7e){return function(_0x36257e){if(_0x36257e){return _0x36257e[_0x7e86('0x25')]()[_0x7e86('0x24')](function(){_0x385168[_0x7e86('0x1a')](0xcc)[_0x7e86('0x1b')]();});}};}function handleEntityNotFound(_0x44788e,_0x10491b){return function(_0x25762b){if(!_0x25762b){_0x44788e[_0x7e86('0x19')](0x194);}return _0x25762b;};}function handleError(_0x4416ee,_0x94ab6d){_0x94ab6d=_0x94ab6d||0x1f4;return function(_0x2ee515){logger['error'](_0x2ee515['stack']);if(_0x2ee515[_0x7e86('0x26')]){delete _0x2ee515['name'];}_0x4416ee['status'](_0x94ab6d)[_0x7e86('0x27')](_0x2ee515);};}exports['index']=function(_0xf84de9,_0x39def6){var _0x409607={},_0x37c59d={},_0x239b07={'count':0x0,'rows':[]};var _0x3378ae=_[_0x7e86('0x28')](db['DeskAccount'][_0x7e86('0x29')],function(_0x722ebe){return{'name':_0x722ebe[_0x7e86('0x2a')],'type':_0x722ebe[_0x7e86('0x2b')]['key']};});_0x37c59d[_0x7e86('0x2c')]=_['map'](_0x3378ae,_0x7e86('0x26'));_0x37c59d[_0x7e86('0x2d')]=_[_0x7e86('0x2e')](_0xf84de9[_0x7e86('0x2d')]);_0x37c59d[_0x7e86('0x2f')]=_[_0x7e86('0x30')](_0x37c59d[_0x7e86('0x2c')],_0x37c59d[_0x7e86('0x2d')]);_0x409607[_0x7e86('0x31')]=_[_0x7e86('0x30')](_0x37c59d[_0x7e86('0x2c')],qs[_0x7e86('0x32')](_0xf84de9[_0x7e86('0x2d')][_0x7e86('0x32')]));_0x409607['attributes']=_0x409607['attributes'][_0x7e86('0x33')]?_0x409607[_0x7e86('0x31')]:_0x37c59d[_0x7e86('0x2c')];if(!_0xf84de9[_0x7e86('0x2d')][_0x7e86('0x34')](_0x7e86('0x35'))){_0x409607[_0x7e86('0x1f')]=qs['limit'](_0xf84de9['query']['limit']);_0x409607[_0x7e86('0x1c')]=qs[_0x7e86('0x1c')](_0xf84de9[_0x7e86('0x2d')]['offset']);}_0x409607['order']=qs['sort'](_0xf84de9[_0x7e86('0x2d')][_0x7e86('0x36')]);_0x409607[_0x7e86('0x37')]=qs[_0x7e86('0x2f')](_[_0x7e86('0x38')](_0xf84de9[_0x7e86('0x2d')],_0x37c59d[_0x7e86('0x2f')]),_0x3378ae);if(_0xf84de9['query'][_0x7e86('0x39')]){_0x409607[_0x7e86('0x37')]=_[_0x7e86('0x3a')](_0x409607[_0x7e86('0x37')],{'$or':_[_0x7e86('0x28')](_0x3378ae,function(_0x329857){if(_0x329857[_0x7e86('0x2b')]!=='VIRTUAL'){var _0x4a475c={};_0x4a475c[_0x329857[_0x7e86('0x26')]]={'$like':'%'+_0xf84de9['query'][_0x7e86('0x39')]+'%'};return _0x4a475c;}})});}_0x409607=_['merge']({},_0x409607,_0xf84de9[_0x7e86('0x3b')]);var _0x5c60b6={'where':_0x409607[_0x7e86('0x37')]};return db['DeskAccount'][_0x7e86('0x1e')](_0x5c60b6)[_0x7e86('0x24')](function(_0x4787f9){_0x239b07[_0x7e86('0x1e')]=_0x4787f9;if(_0xf84de9['query'][_0x7e86('0x3c')]){_0x409607['include']=[{'all':!![]}];}return db[_0x7e86('0x3d')]['findAll'](_0x409607);})[_0x7e86('0x24')](function(_0x259b51){_0x239b07['rows']=_0x259b51;return _0x239b07;})[_0x7e86('0x24')](respondWithFilteredResult(_0x39def6,_0x409607))['catch'](handleError(_0x39def6,null));};exports[_0x7e86('0x3e')]=function(_0x1c9067,_0x5ba938){var _0x530205={'raw':![],'where':{'id':_0x1c9067[_0x7e86('0x3f')]['id']}},_0xf37284={};_0xf37284[_0x7e86('0x2c')]=_['keys'](db[_0x7e86('0x3d')]['rawAttributes']);_0xf37284[_0x7e86('0x2d')]=_['keys'](_0x1c9067[_0x7e86('0x2d')]);_0xf37284[_0x7e86('0x2f')]=_['intersection'](_0xf37284[_0x7e86('0x2c')],_0xf37284[_0x7e86('0x2d')]);_0x530205[_0x7e86('0x31')]=_['intersection'](_0xf37284[_0x7e86('0x2c')],qs[_0x7e86('0x32')](_0x1c9067[_0x7e86('0x2d')]['fields']));_0x530205[_0x7e86('0x31')]=_0x530205[_0x7e86('0x31')][_0x7e86('0x33')]?_0x530205[_0x7e86('0x31')]:_0xf37284['model'];if(_0x1c9067[_0x7e86('0x2d')]['includeAll']){_0x530205[_0x7e86('0x40')]=[{'all':!![]}];}_0x530205=_[_0x7e86('0x3a')]({},_0x530205,_0x1c9067['options']);return db['DeskAccount'][_0x7e86('0x41')](_0x530205)['then'](handleEntityNotFound(_0x5ba938,null))['then'](respondWithResult(_0x5ba938,null))[_0x7e86('0x42')](handleError(_0x5ba938,null));};exports[_0x7e86('0x43')]=function(_0x11b4ac,_0x976e5e){return db[_0x7e86('0x3d')][_0x7e86('0x43')](_0x11b4ac['body'],{})[_0x7e86('0x24')](respondWithResult(_0x976e5e,0xc9))[_0x7e86('0x42')](handleError(_0x976e5e,null));};exports['update']=function(_0x52321c,_0x319dc9){if(_0x52321c[_0x7e86('0x44')]['id']){delete _0x52321c[_0x7e86('0x44')]['id'];}return db[_0x7e86('0x3d')][_0x7e86('0x41')]({'where':{'id':_0x52321c[_0x7e86('0x3f')]['id']}})[_0x7e86('0x24')](handleEntityNotFound(_0x319dc9,null))[_0x7e86('0x24')](saveUpdates(_0x52321c[_0x7e86('0x44')],null))[_0x7e86('0x24')](respondWithResult(_0x319dc9,null))[_0x7e86('0x42')](handleError(_0x319dc9,null));};exports[_0x7e86('0x25')]=function(_0x45546c,_0x3ff8a3){return db['DeskAccount'][_0x7e86('0x41')]({'where':{'id':_0x45546c[_0x7e86('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3ff8a3,null))[_0x7e86('0x24')](removeEntity(_0x3ff8a3,null))[_0x7e86('0x42')](handleError(_0x3ff8a3,null));};exports[_0x7e86('0x45')]=function(_0x3e53f2,_0x23cabf,_0xecdf5a){var _0xa17bd1={};var _0x544080={};var _0x2f87d6;var _0x5cd29f;return db[_0x7e86('0x3d')][_0x7e86('0x46')]({'where':{'id':_0x3e53f2[_0x7e86('0x3f')]['id']}})[_0x7e86('0x24')](handleEntityNotFound(_0x23cabf,null))[_0x7e86('0x24')](function(_0x76ec6e){if(_0x76ec6e){_0x2f87d6=_0x76ec6e;_0x544080[_0x7e86('0x2c')]=_['keys'](db['DeskConfiguration'][_0x7e86('0x29')]);_0x544080['query']=_[_0x7e86('0x2e')](_0x3e53f2['query']);_0x544080[_0x7e86('0x2f')]=_[_0x7e86('0x30')](_0x544080[_0x7e86('0x2c')],_0x544080[_0x7e86('0x2d')]);_0xa17bd1['attributes']=_[_0x7e86('0x30')](_0x544080[_0x7e86('0x2c')],qs['fields'](_0x3e53f2[_0x7e86('0x2d')][_0x7e86('0x32')]));_0xa17bd1[_0x7e86('0x31')]=_0xa17bd1[_0x7e86('0x31')]['length']?_0xa17bd1['attributes']:_0x544080[_0x7e86('0x2c')];_0xa17bd1['order']=qs[_0x7e86('0x36')](_0x3e53f2[_0x7e86('0x2d')][_0x7e86('0x36')]);_0xa17bd1[_0x7e86('0x37')]=qs[_0x7e86('0x2f')](_[_0x7e86('0x38')](_0x3e53f2[_0x7e86('0x2d')],_0x544080[_0x7e86('0x2f')]));if(_0x3e53f2[_0x7e86('0x2d')][_0x7e86('0x39')]){_0xa17bd1[_0x7e86('0x37')]=_[_0x7e86('0x3a')](_0xa17bd1[_0x7e86('0x37')],{'$or':_[_0x7e86('0x28')](_0xa17bd1['attributes'],function(_0x270f64){var _0x5a42ba={};_0x5a42ba[_0x270f64]={'$like':'%'+_0x3e53f2[_0x7e86('0x2d')]['filter']+'%'};return _0x5a42ba;})});}_0xa17bd1=_['merge']({},_0xa17bd1,_0x3e53f2['options']);return _0x2f87d6['getConfigurations'](_0xa17bd1);}})[_0x7e86('0x24')](function(_0x500fe7){if(_0x500fe7){_0x5cd29f=_0x500fe7['length'];if(!_0x3e53f2['query'][_0x7e86('0x34')](_0x7e86('0x35'))){_0xa17bd1[_0x7e86('0x1f')]=qs['limit'](_0x3e53f2['query']['limit']);_0xa17bd1['offset']=qs[_0x7e86('0x1c')](_0x3e53f2['query'][_0x7e86('0x1c')]);}return _0x2f87d6[_0x7e86('0x45')](_0xa17bd1);}})[_0x7e86('0x24')](function(_0x493b82){if(_0x493b82){return _0x493b82?{'count':_0x5cd29f,'rows':_0x493b82}:null;}})['then'](respondWithResult(_0x23cabf,null))[_0x7e86('0x42')](handleError(_0x23cabf,null));};exports['addConfiguration']=function(_0x480b73,_0x2e0e09,_0x2d831b){if(_0x480b73[_0x7e86('0x44')]['id']){delete _0x480b73[_0x7e86('0x44')]['id'];}return db[_0x7e86('0x3d')][_0x7e86('0x46')]({'where':{'id':_0x480b73[_0x7e86('0x3f')]['id']}})[_0x7e86('0x24')](handleEntityNotFound(_0x2e0e09,null))[_0x7e86('0x24')](function(_0x48eab6){if(_0x48eab6){_0x480b73[_0x7e86('0x44')][_0x7e86('0x47')]=_0x48eab6['id'];_0x480b73['body']['Subjects']=integrations[_0x7e86('0x48')](_0x480b73[_0x7e86('0x44')][_0x7e86('0x49')],_0x480b73[_0x7e86('0x44')][_0x7e86('0x2b')]);_0x480b73['body']['Descriptions']=integrations[_0x7e86('0x4a')](_0x480b73['body'][_0x7e86('0x49')],_0x480b73[_0x7e86('0x44')][_0x7e86('0x2b')]);return db[_0x7e86('0x4b')][_0x7e86('0x43')](_0x480b73[_0x7e86('0x44')],{'include':[{'model':db['DeskField'],'as':_0x7e86('0x4c')},{'model':db[_0x7e86('0x4d')],'as':_0x7e86('0x4e')}]});}return null;})[_0x7e86('0x24')](respondWithResult(_0x2e0e09,null))['catch'](handleError(_0x2e0e09,null));};exports['getFields']=function(_0x119838,_0x6005a9,_0x59f476){var _0x21cba6=[{'name':_0x7e86('0x4f'),'label':_0x7e86('0x4f'),'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 _0xac54ec='';return db[_0x7e86('0x3d')]['findOne']({'where':{'id':_0x119838[_0x7e86('0x3f')]['id']},'attributes':['id',_0x7e86('0x50'),_0x7e86('0x51'),_0x7e86('0x52'),_0x7e86('0x53'),_0x7e86('0x54'),_0x7e86('0x55'),_0x7e86('0x56'),_0x7e86('0x57')]})['then'](handleEntityNotFound(_0x6005a9,null))[_0x7e86('0x24')](function(_0xff2905){if(_0xff2905){_0xac54ec=_0xff2905[_0x7e86('0x50')];var _0x269c50=_0xac54ec[_0x7e86('0x58')](-0x1);if(_0x269c50==='/'){_0xac54ec=_0xac54ec['substring'](0x0,_0xac54ec[_0x7e86('0x59')](_0x269c50));}var _0x5459f3={'method':_0x7e86('0x5a'),'uri':util[_0x7e86('0x5b')](_0x7e86('0x5c'),_0xac54ec),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0xff2905['authType']===_0x7e86('0x5d')){_0x5459f3[_0x7e86('0x5e')]['Authorization']=util[_0x7e86('0x5b')](_0x7e86('0x5f'),new Buffer(util[_0x7e86('0x5b')](_0x7e86('0x60'),_0xff2905[_0x7e86('0x52')],_0xff2905[_0x7e86('0x53')]))[_0x7e86('0x61')](_0x7e86('0x62')));}return rp(_0x5459f3)['then'](function(_0x1b55c2){return _0x21cba6[_0x7e86('0x63')](_[_0x7e86('0x28')](_0x1b55c2[_0x7e86('0x64')][_0x7e86('0x65')],function(_0x411b85){return{'id':_0x411b85[_0x7e86('0x26')],'name':_0x411b85[_0x7e86('0x26')],'type':_0x411b85[_0x7e86('0x2b')],'active':_0x411b85['active'],'label':_0x411b85[_0x7e86('0x66')],'custom':!![]};}));});}})['then'](function(_0x2b4220){return{'count':_0x2b4220[_0x7e86('0x33')],'rows':_0x2b4220};})[_0x7e86('0x24')](respondWithResult(_0x6005a9,null))[_0x7e86('0x42')](function(_0x3dc165){var _0x4209e1=_0x119838['query']['test']?0x1f4:_0x3dc165[_0x7e86('0x67')]||0x1f4;logger[_0x7e86('0x68')](_0x7e86('0x69'),_0x7e86('0x6a'),_0x4209e1,JSON[_0x7e86('0x6b')](_0x3dc165));delete _0x3dc165[_0x7e86('0x26')];if(_0x4209e1===0x191){_0x4209e1=0x190;}_0x6005a9[_0x7e86('0x1a')](_0x4209e1)[_0x7e86('0x27')](_0x119838['query'][_0x7e86('0x6c')]?{'message':_0x7e86('0x6d'),'statusCode':_0x3dc165[_0x7e86('0x67')]}:_0x3dc165);});}; \ No newline at end of file +var _0xcb18=['index','map','DeskAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','pick','filter','where','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','getConfigurations','DeskConfiguration','rawAttributes','keys','order','sort','hasOwnProperty','AccountId','channel','Descriptions','getDescriptions','Subjects','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','base64','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','then','error','stack','name'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xcb18,0x12d));var _0x8cb1=function(_0xfb2708,_0x436493){_0xfb2708=_0xfb2708-0x0;var _0x55b55d=_0xcb18[_0xfb2708];return _0x55b55d;};'use strict';var emlformat=require(_0x8cb1('0x0'));var rimraf=require(_0x8cb1('0x1'));var zipdir=require(_0x8cb1('0x2'));var jsonpatch=require(_0x8cb1('0x3'));var rp=require(_0x8cb1('0x4'));var moment=require('moment');var BPromise=require(_0x8cb1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8cb1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8cb1('0x7'));var fs=require('fs');var fs_extra=require(_0x8cb1('0x8'));var _=require(_0x8cb1('0x9'));var squel=require(_0x8cb1('0xa'));var crypto=require(_0x8cb1('0xb'));var jsforce=require(_0x8cb1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8cb1('0xd'));var querystring=require(_0x8cb1('0xe'));var Papa=require('papaparse');var Redis=require(_0x8cb1('0xf'));var authService=require(_0x8cb1('0x10'));var qs=require(_0x8cb1('0x11'));var as=require(_0x8cb1('0x12'));var hardwareService=require(_0x8cb1('0x13'));var logger=require(_0x8cb1('0x14'))(_0x8cb1('0x15'));var utils=require(_0x8cb1('0x16'));var config=require(_0x8cb1('0x17'));var licenseUtil=require(_0x8cb1('0x18'));var db=require(_0x8cb1('0x19'))['db'];var integrations=require(_0x8cb1('0x1a'));function respondWithStatusCode(_0x20c3bf,_0xfe201e){_0xfe201e=_0xfe201e||0xcc;return function(_0x1cea11){if(_0x1cea11){return _0x20c3bf[_0x8cb1('0x1b')](_0xfe201e);}return _0x20c3bf[_0x8cb1('0x1c')](_0xfe201e)[_0x8cb1('0x1d')]();};}function respondWithResult(_0x149cde,_0x48a14b){_0x48a14b=_0x48a14b||0xc8;return function(_0x4c89fc){if(_0x4c89fc){return _0x149cde[_0x8cb1('0x1c')](_0x48a14b)[_0x8cb1('0x1e')](_0x4c89fc);}};}function respondWithFilteredResult(_0x254fd6,_0x190215){return function(_0x4f9922){if(_0x4f9922){var _0x3607d0=typeof _0x190215['offset']===_0x8cb1('0x1f')&&typeof _0x190215[_0x8cb1('0x20')]===_0x8cb1('0x1f');var _0xc0d134=_0x4f9922[_0x8cb1('0x21')];var _0x4d7a88=_0x3607d0?0x0:_0x190215[_0x8cb1('0x22')];var _0x109601=_0x3607d0?_0x4f9922[_0x8cb1('0x21')]:_0x190215[_0x8cb1('0x22')]+_0x190215[_0x8cb1('0x20')];var _0x4c8255;if(_0x109601>=_0xc0d134){_0x109601=_0xc0d134;_0x4c8255=0xc8;}else{_0x4c8255=0xce;}_0x254fd6[_0x8cb1('0x1c')](_0x4c8255);return _0x254fd6[_0x8cb1('0x23')](_0x8cb1('0x24'),_0x4d7a88+'-'+_0x109601+'/'+_0xc0d134)[_0x8cb1('0x1e')](_0x4f9922);}return null;};}function patchUpdates(_0x4031d0){return function(_0x28bcde){try{jsonpatch['apply'](_0x28bcde,_0x4031d0,!![]);}catch(_0x484c4d){return BPromise[_0x8cb1('0x25')](_0x484c4d);}return _0x28bcde['save']();};}function saveUpdates(_0x25690a,_0x8971df){return function(_0xbfdaf8){if(_0xbfdaf8){return _0xbfdaf8[_0x8cb1('0x26')](_0x25690a)['then'](function(_0x280742){return _0x280742;});}return null;};}function removeEntity(_0xeac7b6,_0x50adce){return function(_0x21946b){if(_0x21946b){return _0x21946b[_0x8cb1('0x27')]()[_0x8cb1('0x28')](function(){_0xeac7b6[_0x8cb1('0x1c')](0xcc)[_0x8cb1('0x1d')]();});}};}function handleEntityNotFound(_0x37fdad,_0xac5038){return function(_0x1cefc8){if(!_0x1cefc8){_0x37fdad['sendStatus'](0x194);}return _0x1cefc8;};}function handleError(_0xa8ec7f,_0x563ef3){_0x563ef3=_0x563ef3||0x1f4;return function(_0x82f47f){logger[_0x8cb1('0x29')](_0x82f47f[_0x8cb1('0x2a')]);if(_0x82f47f[_0x8cb1('0x2b')]){delete _0x82f47f[_0x8cb1('0x2b')];}_0xa8ec7f[_0x8cb1('0x1c')](_0x563ef3)['send'](_0x82f47f);};}exports[_0x8cb1('0x2c')]=function(_0x347d40,_0x101cc3){var _0x57e330={},_0x51631c={},_0x36e5a2={'count':0x0,'rows':[]};var _0x5347eb=_[_0x8cb1('0x2d')](db[_0x8cb1('0x2e')]['rawAttributes'],function(_0x1ca370){return{'name':_0x1ca370[_0x8cb1('0x2f')],'type':_0x1ca370[_0x8cb1('0x30')][_0x8cb1('0x31')]};});_0x51631c[_0x8cb1('0x32')]=_[_0x8cb1('0x2d')](_0x5347eb,_0x8cb1('0x2b'));_0x51631c['query']=_['keys'](_0x347d40[_0x8cb1('0x33')]);_0x51631c[_0x8cb1('0x34')]=_[_0x8cb1('0x35')](_0x51631c[_0x8cb1('0x32')],_0x51631c['query']);_0x57e330['attributes']=_[_0x8cb1('0x35')](_0x51631c['model'],qs[_0x8cb1('0x36')](_0x347d40['query']['fields']));_0x57e330[_0x8cb1('0x37')]=_0x57e330[_0x8cb1('0x37')][_0x8cb1('0x38')]?_0x57e330['attributes']:_0x51631c[_0x8cb1('0x32')];if(!_0x347d40[_0x8cb1('0x33')]['hasOwnProperty'](_0x8cb1('0x39'))){_0x57e330[_0x8cb1('0x20')]=qs[_0x8cb1('0x20')](_0x347d40[_0x8cb1('0x33')][_0x8cb1('0x20')]);_0x57e330['offset']=qs[_0x8cb1('0x22')](_0x347d40[_0x8cb1('0x33')][_0x8cb1('0x22')]);}_0x57e330['order']=qs['sort'](_0x347d40['query']['sort']);_0x57e330['where']=qs['filters'](_[_0x8cb1('0x3a')](_0x347d40[_0x8cb1('0x33')],_0x51631c[_0x8cb1('0x34')]),_0x5347eb);if(_0x347d40[_0x8cb1('0x33')][_0x8cb1('0x3b')]){_0x57e330[_0x8cb1('0x3c')]=_['merge'](_0x57e330['where'],{'$or':_[_0x8cb1('0x2d')](_0x5347eb,function(_0x18588b){if(_0x18588b[_0x8cb1('0x30')]!=='VIRTUAL'){var _0x4d53a1={};_0x4d53a1[_0x18588b[_0x8cb1('0x2b')]]={'$like':'%'+_0x347d40['query'][_0x8cb1('0x3b')]+'%'};return _0x4d53a1;}})});}_0x57e330=_[_0x8cb1('0x3d')]({},_0x57e330,_0x347d40[_0x8cb1('0x3e')]);var _0x4b8cf5={'where':_0x57e330[_0x8cb1('0x3c')]};return db[_0x8cb1('0x2e')][_0x8cb1('0x21')](_0x4b8cf5)['then'](function(_0xd1a992){_0x36e5a2[_0x8cb1('0x21')]=_0xd1a992;if(_0x347d40[_0x8cb1('0x33')][_0x8cb1('0x3f')]){_0x57e330['include']=[{'all':!![]}];}return db[_0x8cb1('0x2e')][_0x8cb1('0x40')](_0x57e330);})[_0x8cb1('0x28')](function(_0xc5330){_0x36e5a2[_0x8cb1('0x41')]=_0xc5330;return _0x36e5a2;})['then'](respondWithFilteredResult(_0x101cc3,_0x57e330))['catch'](handleError(_0x101cc3,null));};exports[_0x8cb1('0x42')]=function(_0x46dd0c,_0x1e1da2){var _0xbf90d6={'raw':![],'where':{'id':_0x46dd0c[_0x8cb1('0x43')]['id']}},_0x5f295c={};_0x5f295c[_0x8cb1('0x32')]=_['keys'](db[_0x8cb1('0x2e')]['rawAttributes']);_0x5f295c[_0x8cb1('0x33')]=_['keys'](_0x46dd0c['query']);_0x5f295c['filters']=_[_0x8cb1('0x35')](_0x5f295c[_0x8cb1('0x32')],_0x5f295c[_0x8cb1('0x33')]);_0xbf90d6[_0x8cb1('0x37')]=_[_0x8cb1('0x35')](_0x5f295c[_0x8cb1('0x32')],qs[_0x8cb1('0x36')](_0x46dd0c['query'][_0x8cb1('0x36')]));_0xbf90d6[_0x8cb1('0x37')]=_0xbf90d6[_0x8cb1('0x37')][_0x8cb1('0x38')]?_0xbf90d6[_0x8cb1('0x37')]:_0x5f295c[_0x8cb1('0x32')];if(_0x46dd0c[_0x8cb1('0x33')][_0x8cb1('0x3f')]){_0xbf90d6[_0x8cb1('0x44')]=[{'all':!![]}];}_0xbf90d6=_['merge']({},_0xbf90d6,_0x46dd0c[_0x8cb1('0x3e')]);return db[_0x8cb1('0x2e')][_0x8cb1('0x45')](_0xbf90d6)[_0x8cb1('0x28')](handleEntityNotFound(_0x1e1da2,null))[_0x8cb1('0x28')](respondWithResult(_0x1e1da2,null))[_0x8cb1('0x46')](handleError(_0x1e1da2,null));};exports[_0x8cb1('0x47')]=function(_0x12ed40,_0x5c99d6){return db[_0x8cb1('0x2e')][_0x8cb1('0x47')](_0x12ed40[_0x8cb1('0x48')],{})[_0x8cb1('0x28')](respondWithResult(_0x5c99d6,0xc9))[_0x8cb1('0x46')](handleError(_0x5c99d6,null));};exports['update']=function(_0x32dead,_0x479655){if(_0x32dead[_0x8cb1('0x48')]['id']){delete _0x32dead[_0x8cb1('0x48')]['id'];}return db[_0x8cb1('0x2e')]['find']({'where':{'id':_0x32dead[_0x8cb1('0x43')]['id']}})[_0x8cb1('0x28')](handleEntityNotFound(_0x479655,null))[_0x8cb1('0x28')](saveUpdates(_0x32dead[_0x8cb1('0x48')],null))['then'](respondWithResult(_0x479655,null))[_0x8cb1('0x46')](handleError(_0x479655,null));};exports[_0x8cb1('0x27')]=function(_0x5e2eb5,_0x60f097){return db[_0x8cb1('0x2e')][_0x8cb1('0x45')]({'where':{'id':_0x5e2eb5[_0x8cb1('0x43')]['id']}})['then'](handleEntityNotFound(_0x60f097,null))['then'](removeEntity(_0x60f097,null))[_0x8cb1('0x46')](handleError(_0x60f097,null));};exports[_0x8cb1('0x49')]=function(_0x3305dc,_0x54d2f4,_0x170ec4){var _0x482f08={};var _0x3a0bb0={};var _0x1e212e;var _0x34276c;return db[_0x8cb1('0x2e')]['findOne']({'where':{'id':_0x3305dc['params']['id']}})['then'](handleEntityNotFound(_0x54d2f4,null))[_0x8cb1('0x28')](function(_0x5bba4f){if(_0x5bba4f){_0x1e212e=_0x5bba4f;_0x3a0bb0['model']=_['keys'](db[_0x8cb1('0x4a')][_0x8cb1('0x4b')]);_0x3a0bb0['query']=_[_0x8cb1('0x4c')](_0x3305dc[_0x8cb1('0x33')]);_0x3a0bb0['filters']=_[_0x8cb1('0x35')](_0x3a0bb0['model'],_0x3a0bb0[_0x8cb1('0x33')]);_0x482f08[_0x8cb1('0x37')]=_['intersection'](_0x3a0bb0[_0x8cb1('0x32')],qs['fields'](_0x3305dc[_0x8cb1('0x33')][_0x8cb1('0x36')]));_0x482f08[_0x8cb1('0x37')]=_0x482f08['attributes']['length']?_0x482f08['attributes']:_0x3a0bb0[_0x8cb1('0x32')];_0x482f08[_0x8cb1('0x4d')]=qs[_0x8cb1('0x4e')](_0x3305dc[_0x8cb1('0x33')][_0x8cb1('0x4e')]);_0x482f08[_0x8cb1('0x3c')]=qs[_0x8cb1('0x34')](_['pick'](_0x3305dc[_0x8cb1('0x33')],_0x3a0bb0['filters']));if(_0x3305dc[_0x8cb1('0x33')]['filter']){_0x482f08[_0x8cb1('0x3c')]=_[_0x8cb1('0x3d')](_0x482f08[_0x8cb1('0x3c')],{'$or':_[_0x8cb1('0x2d')](_0x482f08[_0x8cb1('0x37')],function(_0x27fa3b){var _0x47084a={};_0x47084a[_0x27fa3b]={'$like':'%'+_0x3305dc['query'][_0x8cb1('0x3b')]+'%'};return _0x47084a;})});}_0x482f08=_['merge']({},_0x482f08,_0x3305dc['options']);return _0x1e212e[_0x8cb1('0x49')](_0x482f08);}})['then'](function(_0x387eef){if(_0x387eef){_0x34276c=_0x387eef[_0x8cb1('0x38')];if(!_0x3305dc['query'][_0x8cb1('0x4f')](_0x8cb1('0x39'))){_0x482f08[_0x8cb1('0x20')]=qs[_0x8cb1('0x20')](_0x3305dc[_0x8cb1('0x33')][_0x8cb1('0x20')]);_0x482f08['offset']=qs['offset'](_0x3305dc[_0x8cb1('0x33')][_0x8cb1('0x22')]);}return _0x1e212e[_0x8cb1('0x49')](_0x482f08);}})[_0x8cb1('0x28')](function(_0x15c3b0){if(_0x15c3b0){return _0x15c3b0?{'count':_0x34276c,'rows':_0x15c3b0}:null;}})[_0x8cb1('0x28')](respondWithResult(_0x54d2f4,null))['catch'](handleError(_0x54d2f4,null));};exports['addConfiguration']=function(_0x4e30f2,_0x4c6964,_0x37f828){if(_0x4e30f2['body']['id']){delete _0x4e30f2[_0x8cb1('0x48')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x4e30f2[_0x8cb1('0x43')]['id']}})[_0x8cb1('0x28')](handleEntityNotFound(_0x4c6964,null))[_0x8cb1('0x28')](function(_0x2a0167){if(_0x2a0167){_0x4e30f2[_0x8cb1('0x48')][_0x8cb1('0x50')]=_0x2a0167['id'];_0x4e30f2[_0x8cb1('0x48')]['Subjects']=integrations['getSubjects'](_0x4e30f2[_0x8cb1('0x48')][_0x8cb1('0x51')],_0x4e30f2[_0x8cb1('0x48')]['type']);_0x4e30f2['body'][_0x8cb1('0x52')]=integrations[_0x8cb1('0x53')](_0x4e30f2[_0x8cb1('0x48')]['channel'],_0x4e30f2[_0x8cb1('0x48')][_0x8cb1('0x30')]);return db[_0x8cb1('0x4a')][_0x8cb1('0x47')](_0x4e30f2[_0x8cb1('0x48')],{'include':[{'model':db['DeskField'],'as':_0x8cb1('0x54')},{'model':db['DeskField'],'as':_0x8cb1('0x52')}]});}return null;})[_0x8cb1('0x28')](respondWithResult(_0x4c6964,null))[_0x8cb1('0x46')](handleError(_0x4c6964,null));};exports[_0x8cb1('0x55')]=function(_0x13892e,_0x555f36,_0x138e61){var _0x26952f=[{'name':'priority','label':_0x8cb1('0x56'),'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 _0x4fb1e1='';return db[_0x8cb1('0x2e')]['findOne']({'where':{'id':_0x13892e[_0x8cb1('0x43')]['id']},'attributes':['id',_0x8cb1('0x57'),_0x8cb1('0x58'),_0x8cb1('0x59'),_0x8cb1('0x5a'),_0x8cb1('0x5b'),_0x8cb1('0x5c'),_0x8cb1('0x5d'),_0x8cb1('0x5e')]})[_0x8cb1('0x28')](handleEntityNotFound(_0x555f36,null))[_0x8cb1('0x28')](function(_0x36d541){if(_0x36d541){_0x4fb1e1=_0x36d541[_0x8cb1('0x57')];var _0x51de32=_0x4fb1e1['slice'](-0x1);if(_0x51de32==='/'){_0x4fb1e1=_0x4fb1e1[_0x8cb1('0x5f')](0x0,_0x4fb1e1[_0x8cb1('0x60')](_0x51de32));}var _0x18a4c6={'method':'GET','uri':util[_0x8cb1('0x61')](_0x8cb1('0x62'),_0x4fb1e1),'headers':{'Content-Type':_0x8cb1('0x63'),'Accept':'application/json'},'json':!![]};if(_0x36d541[_0x8cb1('0x58')]===_0x8cb1('0x64')){_0x18a4c6[_0x8cb1('0x65')][_0x8cb1('0x66')]=util[_0x8cb1('0x61')]('Basic\x20%s',new Buffer(util[_0x8cb1('0x61')](_0x8cb1('0x67'),_0x36d541[_0x8cb1('0x59')],_0x36d541[_0x8cb1('0x5a')]))[_0x8cb1('0x68')](_0x8cb1('0x69')));}return rp(_0x18a4c6)['then'](function(_0x4daeec){return _0x26952f['concat'](_[_0x8cb1('0x2d')](_0x4daeec[_0x8cb1('0x6a')][_0x8cb1('0x6b')],function(_0x55827e){return{'id':_0x55827e[_0x8cb1('0x2b')],'name':_0x55827e[_0x8cb1('0x2b')],'type':_0x55827e[_0x8cb1('0x30')],'active':_0x55827e['active'],'label':_0x55827e[_0x8cb1('0x6c')],'custom':!![]};}));});}})[_0x8cb1('0x28')](function(_0x48cf97){return{'count':_0x48cf97[_0x8cb1('0x38')],'rows':_0x48cf97};})[_0x8cb1('0x28')](respondWithResult(_0x555f36,null))[_0x8cb1('0x46')](function(_0x2cb71a){var _0x1cd304=_0x13892e[_0x8cb1('0x33')][_0x8cb1('0x6d')]?0x1f4:_0x2cb71a['statusCode']||0x1f4;logger[_0x8cb1('0x29')](_0x8cb1('0x6e'),_0x8cb1('0x55'),_0x1cd304,JSON[_0x8cb1('0x6f')](_0x2cb71a));delete _0x2cb71a[_0x8cb1('0x2b')];if(_0x1cd304===0x191){_0x1cd304=0x190;}_0x555f36[_0x8cb1('0x1c')](_0x1cd304)[_0x8cb1('0x70')](_0x13892e[_0x8cb1('0x33')][_0x8cb1('0x6d')]?{'message':_0x8cb1('0x71'),'statusCode':_0x2cb71a[_0x8cb1('0x72')]}:_0x2cb71a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e02cc29..c5d21a6 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 _0x7fb1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x7fb1,0xa7));var _0x17fb=function(_0x2493c3,_0x419613){_0x2493c3=_0x2493c3-0x0;var _0x5bd06a=_0x7fb1[_0x2493c3];return _0x5bd06a;};'use strict';var _=require(_0x17fb('0x0'));var util=require('util');var logger=require(_0x17fb('0x1'))('api');var moment=require(_0x17fb('0x2'));var BPromise=require(_0x17fb('0x3'));var rp=require(_0x17fb('0x4'));var fs=require('fs');var path=require(_0x17fb('0x5'));var rimraf=require(_0x17fb('0x6'));var config=require(_0x17fb('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x17fb('0x8'));module[_0x17fb('0x9')]=function(_0x28961c,_0x2e5aed){return _0x28961c[_0x17fb('0xa')](_0x17fb('0xb'),attributes,{'tableName':_0x17fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd795=['bluebird','request-promise','path','rimraf','exports','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api'];(function(_0x41355f,_0xecbc5){var _0x42329a=function(_0x376150){while(--_0x376150){_0x41355f['push'](_0x41355f['shift']());}};_0x42329a(++_0xecbc5);}(_0xd795,0x193));var _0x5d79=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xd795[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x5d79('0x0'));var util=require(_0x5d79('0x1'));var logger=require(_0x5d79('0x2'))(_0x5d79('0x3'));var moment=require('moment');var BPromise=require(_0x5d79('0x4'));var rp=require(_0x5d79('0x5'));var fs=require('fs');var path=require(_0x5d79('0x6'));var rimraf=require(_0x5d79('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5d79('0x8')]=function(_0x5cdca8,_0xd4abf2){return _0x5cdca8['define'](_0x5d79('0x9'),attributes,{'tableName':_0x5d79('0xa'),'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 cf47c8c..f7c4609 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 _0x728a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','map','model','include','attributes','ShowDeskAccount','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x728a,0xd3));var _0xa728=function(_0x33afe9,_0x529051){_0x33afe9=_0x33afe9-0x0;var _0x244e9a=_0x728a[_0x33afe9];return _0x244e9a;};'use strict';var _=require(_0xa728('0x0'));var util=require('util');var moment=require(_0xa728('0x1'));var BPromise=require(_0xa728('0x2'));var rs=require(_0xa728('0x3'));var fs=require('fs');var Redis=require(_0xa728('0x4'));var db=require(_0xa728('0x5'))['db'];var utils=require(_0xa728('0x6'));var logger=require('../../config/logger')(_0xa728('0x7'));var config=require(_0xa728('0x8'));var jayson=require(_0xa728('0x9'));var client=jayson[_0xa728('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd258c1,_0x3e962f,_0x177c4e){return new BPromise(function(_0x4f7ccd,_0x586f50){return client[_0xa728('0xb')](_0xd258c1,_0x177c4e)[_0xa728('0xc')](function(_0x17f2cc){logger[_0xa728('0xd')]('DeskAccount,\x20%s,\x20%s',_0x3e962f,'request\x20sent');logger[_0xa728('0xe')](_0xa728('0xf'),_0x3e962f,_0xa728('0x10'),JSON[_0xa728('0x11')](_0x17f2cc));if(_0x17f2cc[_0xa728('0x12')]){if(_0x17f2cc['error'][_0xa728('0x13')]===0x1f4){logger[_0xa728('0x12')]('DeskAccount,\x20%s,\x20%s',_0x3e962f,_0x17f2cc[_0xa728('0x12')][_0xa728('0x14')]);return _0x586f50(_0x17f2cc['error'][_0xa728('0x14')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x3e962f,_0x17f2cc['error'][_0xa728('0x14')]);return _0x4f7ccd(_0x17f2cc[_0xa728('0x12')][_0xa728('0x14')]);}else{logger[_0xa728('0xd')](_0xa728('0x15'),_0x3e962f,_0xa728('0x10'));_0x4f7ccd(_0x17f2cc[_0xa728('0x16')][_0xa728('0x14')]);}})[_0xa728('0x17')](function(_0x15a1de){logger[_0xa728('0x12')](_0xa728('0x15'),_0x3e962f,_0x15a1de);_0x586f50(_0x15a1de);});});}exports[_0xa728('0x18')]=function(_0x47e28b){var _0x10e5c9=this;return new Promise(function(_0x30133,_0x17ebb4){return db[_0xa728('0x19')][_0xa728('0x1a')]({'raw':_0x47e28b[_0xa728('0x1b')]?_0x47e28b[_0xa728('0x1b')][_0xa728('0x1c')]===undefined?!![]:![]:!![],'where':_0x47e28b[_0xa728('0x1b')]?_0x47e28b['options'][_0xa728('0x1d')]||null:null,'attributes':_0x47e28b['options']?_0x47e28b[_0xa728('0x1b')]['attributes']||null:null,'limit':_0x47e28b['options']?_0x47e28b[_0xa728('0x1b')][_0xa728('0x1e')]||null:null,'include':_0x47e28b[_0xa728('0x1b')]?_0x47e28b[_0xa728('0x1b')]['include']?_[_0xa728('0x1f')](_0x47e28b[_0xa728('0x1b')]['include'],function(_0x3bcc08){return{'model':db[_0x3bcc08[_0xa728('0x20')]],'as':_0x3bcc08['as'],'attributes':_0x3bcc08['attributes'],'include':_0x3bcc08[_0xa728('0x21')]?_[_0xa728('0x1f')](_0x3bcc08[_0xa728('0x21')],function(_0x5533af){return{'model':db[_0x5533af['model']],'as':_0x5533af['as'],'attributes':_0x5533af[_0xa728('0x22')],'include':_0x5533af[_0xa728('0x21')]?_[_0xa728('0x1f')](_0x5533af[_0xa728('0x21')],function(_0x1378be){return{'model':db[_0x1378be[_0xa728('0x20')]],'as':_0x1378be['as'],'attributes':_0x1378be['attributes']};}):[]};}):[]};}):[]:[]})[_0xa728('0xc')](function(_0x2fdcb3){logger[_0xa728('0xd')](_0xa728('0x18'),_0x47e28b);logger['debug'](_0xa728('0x18'),_0x47e28b,JSON[_0xa728('0x11')](_0x2fdcb3));_0x30133(_0x2fdcb3);})[_0xa728('0x17')](function(_0x5aacec){logger['error'](_0xa728('0x18'),_0x5aacec[_0xa728('0x14')],_0x47e28b);_0x17ebb4(_0x10e5c9['error'](0x1f4,_0x5aacec['message']));});});};exports[_0xa728('0x23')]=function(_0x5f1e8b){var _0x555677=this;return new Promise(function(_0x190d18,_0x1bc7fa){return db[_0xa728('0x19')]['find']({'raw':_0x5f1e8b['options']?_0x5f1e8b['options']['raw']===undefined?!![]:![]:!![],'where':_0x5f1e8b[_0xa728('0x1b')]?_0x5f1e8b['options']['where']||null:null,'attributes':_0x5f1e8b[_0xa728('0x1b')]?_0x5f1e8b[_0xa728('0x1b')]['attributes']||null:null,'include':_0x5f1e8b[_0xa728('0x1b')]?_0x5f1e8b['options']['include']?_[_0xa728('0x1f')](_0x5f1e8b[_0xa728('0x1b')]['include'],function(_0x576df1){return{'model':db[_0x576df1[_0xa728('0x20')]],'as':_0x576df1['as'],'attributes':_0x576df1[_0xa728('0x22')],'include':_0x576df1[_0xa728('0x21')]?_['map'](_0x576df1[_0xa728('0x21')],function(_0x3d27d0){return{'model':db[_0x3d27d0[_0xa728('0x20')]],'as':_0x3d27d0['as'],'attributes':_0x3d27d0[_0xa728('0x22')],'include':_0x3d27d0[_0xa728('0x21')]?_[_0xa728('0x1f')](_0x3d27d0[_0xa728('0x21')],function(_0x44df85){return{'model':db[_0x44df85[_0xa728('0x20')]],'as':_0x44df85['as'],'attributes':_0x44df85[_0xa728('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa728('0xc')](function(_0x222b3d){logger[_0xa728('0xd')](_0xa728('0x23'),_0x5f1e8b);logger[_0xa728('0xe')](_0xa728('0x23'),_0x5f1e8b,JSON['stringify'](_0x222b3d));_0x190d18(_0x222b3d);})['catch'](function(_0x4428de){logger['error'](_0xa728('0x23'),_0x4428de['message'],_0x5f1e8b);_0x1bc7fa(_0x555677[_0xa728('0x12')](0x1f4,_0x4428de[_0xa728('0x14')]));});});}; \ No newline at end of file +var _0xe98c=['../../config/environment','jayson/promise','client','http','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowDeskAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x131e11,_0x2c2c22){var _0x34bfba=function(_0x14dcef){while(--_0x14dcef){_0x131e11['push'](_0x131e11['shift']());}};_0x34bfba(++_0x2c2c22);}(_0xe98c,0x1e2));var _0xce98=function(_0x329549,_0x52e1fc){_0x329549=_0x329549-0x0;var _0x15c094=_0xe98c[_0x329549];return _0x15c094;};'use strict';var _=require(_0xce98('0x0'));var util=require(_0xce98('0x1'));var moment=require(_0xce98('0x2'));var BPromise=require(_0xce98('0x3'));var rs=require(_0xce98('0x4'));var fs=require('fs');var Redis=require(_0xce98('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce98('0x6'));var logger=require('../../config/logger')(_0xce98('0x7'));var config=require(_0xce98('0x8'));var jayson=require(_0xce98('0x9'));var client=jayson[_0xce98('0xa')][_0xce98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc67136,_0x128503,_0x523f8e){return new BPromise(function(_0x18d27b,_0x316af3){return client['request'](_0xc67136,_0x523f8e)['then'](function(_0x429953){logger['info'](_0xce98('0xc'),_0x128503,_0xce98('0xd'));logger[_0xce98('0xe')](_0xce98('0xf'),_0x128503,_0xce98('0xd'),JSON['stringify'](_0x429953));if(_0x429953[_0xce98('0x10')]){if(_0x429953['error']['code']===0x1f4){logger[_0xce98('0x10')]('DeskAccount,\x20%s,\x20%s',_0x128503,_0x429953[_0xce98('0x10')][_0xce98('0x11')]);return _0x316af3(_0x429953['error']['message']);}logger['error'](_0xce98('0xc'),_0x128503,_0x429953['error'][_0xce98('0x11')]);return _0x18d27b(_0x429953[_0xce98('0x10')][_0xce98('0x11')]);}else{logger[_0xce98('0x12')](_0xce98('0xc'),_0x128503,_0xce98('0xd'));_0x18d27b(_0x429953[_0xce98('0x13')]['message']);}})[_0xce98('0x14')](function(_0x1228b2){logger['error']('DeskAccount,\x20%s,\x20%s',_0x128503,_0x1228b2);_0x316af3(_0x1228b2);});});}exports[_0xce98('0x15')]=function(_0x562da9){var _0x47dafb=this;return new Promise(function(_0x384354,_0x2d8ca8){return db[_0xce98('0x16')][_0xce98('0x17')]({'raw':_0x562da9[_0xce98('0x18')]?_0x562da9[_0xce98('0x18')][_0xce98('0x19')]===undefined?!![]:![]:!![],'where':_0x562da9[_0xce98('0x18')]?_0x562da9[_0xce98('0x18')][_0xce98('0x1a')]||null:null,'attributes':_0x562da9[_0xce98('0x18')]?_0x562da9[_0xce98('0x18')][_0xce98('0x1b')]||null:null,'limit':_0x562da9[_0xce98('0x18')]?_0x562da9[_0xce98('0x18')][_0xce98('0x1c')]||null:null,'include':_0x562da9['options']?_0x562da9['options'][_0xce98('0x1d')]?_[_0xce98('0x1e')](_0x562da9[_0xce98('0x18')][_0xce98('0x1d')],function(_0x584e56){return{'model':db[_0x584e56[_0xce98('0x1f')]],'as':_0x584e56['as'],'attributes':_0x584e56[_0xce98('0x1b')],'include':_0x584e56[_0xce98('0x1d')]?_[_0xce98('0x1e')](_0x584e56[_0xce98('0x1d')],function(_0x58faeb){return{'model':db[_0x58faeb[_0xce98('0x1f')]],'as':_0x58faeb['as'],'attributes':_0x58faeb[_0xce98('0x1b')],'include':_0x58faeb[_0xce98('0x1d')]?_[_0xce98('0x1e')](_0x58faeb[_0xce98('0x1d')],function(_0x4428c4){return{'model':db[_0x4428c4['model']],'as':_0x4428c4['as'],'attributes':_0x4428c4[_0xce98('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xce98('0x20')](function(_0x48f254){logger[_0xce98('0x12')]('GetDeskAccount',_0x562da9);logger['debug'](_0xce98('0x15'),_0x562da9,JSON['stringify'](_0x48f254));_0x384354(_0x48f254);})[_0xce98('0x14')](function(_0x2f4f6d){logger['error'](_0xce98('0x15'),_0x2f4f6d[_0xce98('0x11')],_0x562da9);_0x2d8ca8(_0x47dafb['error'](0x1f4,_0x2f4f6d[_0xce98('0x11')]));});});};exports[_0xce98('0x21')]=function(_0x4dc690){var _0x5cbe2e=this;return new Promise(function(_0x3448a5,_0x5a0468){return db[_0xce98('0x16')]['find']({'raw':_0x4dc690[_0xce98('0x18')]?_0x4dc690[_0xce98('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4dc690['options']?_0x4dc690['options']['where']||null:null,'attributes':_0x4dc690[_0xce98('0x18')]?_0x4dc690['options'][_0xce98('0x1b')]||null:null,'include':_0x4dc690['options']?_0x4dc690['options'][_0xce98('0x1d')]?_[_0xce98('0x1e')](_0x4dc690[_0xce98('0x18')]['include'],function(_0x6b593e){return{'model':db[_0x6b593e[_0xce98('0x1f')]],'as':_0x6b593e['as'],'attributes':_0x6b593e[_0xce98('0x1b')],'include':_0x6b593e[_0xce98('0x1d')]?_[_0xce98('0x1e')](_0x6b593e[_0xce98('0x1d')],function(_0x38f435){return{'model':db[_0x38f435[_0xce98('0x1f')]],'as':_0x38f435['as'],'attributes':_0x38f435[_0xce98('0x1b')],'include':_0x38f435[_0xce98('0x1d')]?_['map'](_0x38f435[_0xce98('0x1d')],function(_0x2af57c){return{'model':db[_0x2af57c[_0xce98('0x1f')]],'as':_0x2af57c['as'],'attributes':_0x2af57c[_0xce98('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xce98('0x20')](function(_0x478516){logger[_0xce98('0x12')](_0xce98('0x21'),_0x4dc690);logger[_0xce98('0xe')]('ShowDeskAccount',_0x4dc690,JSON[_0xce98('0x22')](_0x478516));_0x3448a5(_0x478516);})[_0xce98('0x14')](function(_0xd44059){logger[_0xce98('0x10')](_0xce98('0x21'),_0xd44059[_0xce98('0x11')],_0x4dc690);_0x5a0468(_0x5cbe2e[_0xce98('0x10')](0x1f4,_0xd44059[_0xce98('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 552a795..0191a79 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 _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(_0x487ee4,_0x3d3e66){var _0x3b0877=function(_0x5fba36){while(--_0x5fba36){_0x487ee4['push'](_0x487ee4['shift']());}};_0x3b0877(++_0x3d3e66);}(_0x55ca,0x126));var _0xa55c=function(_0x4c4683,_0x241657){_0x4c4683=_0x4c4683-0x0;var _0x78ee7e=_0x55ca[_0x4c4683];return _0x78ee7e;};'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 +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(_0x40e95c,_0x23111c){var _0x4af391=function(_0x247487){while(--_0x247487){_0x40e95c['push'](_0x40e95c['shift']());}};_0x4af391(++_0x23111c);}(_0x34e8,0x12c));var _0x834e=function(_0x3bec3d,_0x12e335){_0x3bec3d=_0x3bec3d-0x0;var _0x13b32a=_0x34e8[_0x3bec3d];return _0x13b32a;};'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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 0abfd1d..6e2703c 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 _0x498f=['sequelize','STRING'];(function(_0x19d458,_0x234919){var _0x29b429=function(_0x141e83){while(--_0x141e83){_0x19d458['push'](_0x19d458['shift']());}};_0x29b429(++_0x234919);}(_0x498f,0x17c));var _0xf498=function(_0x593f4b,_0x56be0d){_0x593f4b=_0x593f4b-0x0;var _0xb5efae=_0x498f[_0x593f4b];return _0xb5efae;};'use strict';var Sequelize=require(_0xf498('0x0'));module['exports']={'name':{'type':Sequelize[_0xf498('0x1')]},'description':{'type':Sequelize[_0xf498('0x1')]}}; \ No newline at end of file +var _0x7c45=['STRING','exports'];(function(_0x1927c5,_0x544a26){var _0x3104fe=function(_0x442bc3){while(--_0x442bc3){_0x1927c5['push'](_0x1927c5['shift']());}};_0x3104fe(++_0x544a26);}(_0x7c45,0xb7));var _0x57c4=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x7c45[_0x11c573];return _0x6b72de;};'use strict';var Sequelize=require('sequelize');module[_0x57c4('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x57c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 5228985..a50a5a2 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 _0x7742=['apply','reject','save','update','then','error','stack','name','send','index','DeskConfiguration','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','findOne','getFields','nolimit','getSubjects','DeskField','pick','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7742,0x1e1));var _0x2774=function(_0x153885,_0x462059){_0x153885=_0x153885-0x0;var _0x1d6583=_0x7742[_0x153885];return _0x1d6583;};'use strict';var emlformat=require(_0x2774('0x0'));var rimraf=require(_0x2774('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2774('0x2'));var moment=require(_0x2774('0x3'));var BPromise=require(_0x2774('0x4'));var Mustache=require(_0x2774('0x5'));var util=require(_0x2774('0x6'));var path=require(_0x2774('0x7'));var sox=require(_0x2774('0x8'));var csv=require(_0x2774('0x9'));var ejs=require(_0x2774('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2774('0xb'));var squel=require(_0x2774('0xc'));var crypto=require(_0x2774('0xd'));var jsforce=require(_0x2774('0xe'));var deskjs=require(_0x2774('0xf'));var toCsv=require(_0x2774('0x9'));var querystring=require('querystring');var Papa=require(_0x2774('0x10'));var Redis=require(_0x2774('0x11'));var authService=require(_0x2774('0x12'));var qs=require(_0x2774('0x13'));var as=require(_0x2774('0x14'));var hardwareService=require(_0x2774('0x15'));var logger=require(_0x2774('0x16'))(_0x2774('0x17'));var utils=require(_0x2774('0x18'));var config=require(_0x2774('0x19'));var licenseUtil=require(_0x2774('0x1a'));var db=require(_0x2774('0x1b'))['db'];function respondWithStatusCode(_0x560efa,_0x15143e){_0x15143e=_0x15143e||0xcc;return function(_0x52e639){if(_0x52e639){return _0x560efa[_0x2774('0x1c')](_0x15143e);}return _0x560efa[_0x2774('0x1d')](_0x15143e)[_0x2774('0x1e')]();};}function respondWithResult(_0x2f696d,_0x2df93f){_0x2df93f=_0x2df93f||0xc8;return function(_0x10db22){if(_0x10db22){return _0x2f696d[_0x2774('0x1d')](_0x2df93f)['json'](_0x10db22);}};}function respondWithFilteredResult(_0xa2547f,_0x549cad){return function(_0x518906){if(_0x518906){var _0x2bb534=typeof _0x549cad[_0x2774('0x1f')]===_0x2774('0x20')&&typeof _0x549cad[_0x2774('0x21')]==='undefined';var _0x57c832=_0x518906[_0x2774('0x22')];var _0x3ac181=_0x2bb534?0x0:_0x549cad['offset'];var _0x58c820=_0x2bb534?_0x518906[_0x2774('0x22')]:_0x549cad[_0x2774('0x1f')]+_0x549cad['limit'];var _0x4ec5f8;if(_0x58c820>=_0x57c832){_0x58c820=_0x57c832;_0x4ec5f8=0xc8;}else{_0x4ec5f8=0xce;}_0xa2547f[_0x2774('0x1d')](_0x4ec5f8);return _0xa2547f['set']('Content-Range',_0x3ac181+'-'+_0x58c820+'/'+_0x57c832)['json'](_0x518906);}return null;};}function patchUpdates(_0x462d33){return function(_0x5a3eb1){try{jsonpatch[_0x2774('0x23')](_0x5a3eb1,_0x462d33,!![]);}catch(_0x52aa6f){return BPromise[_0x2774('0x24')](_0x52aa6f);}return _0x5a3eb1[_0x2774('0x25')]();};}function saveUpdates(_0x5b1e2e,_0x483e33){return function(_0x2a4dec){if(_0x2a4dec){return _0x2a4dec[_0x2774('0x26')](_0x5b1e2e)[_0x2774('0x27')](function(_0x2042f2){return _0x2042f2;});}return null;};}function removeEntity(_0xc827be,_0x21ffff){return function(_0x6e648a){if(_0x6e648a){return _0x6e648a['destroy']()[_0x2774('0x27')](function(){_0xc827be[_0x2774('0x1d')](0xcc)[_0x2774('0x1e')]();});}};}function handleEntityNotFound(_0xc55edc,_0xbb32fa){return function(_0x53ef64){if(!_0x53ef64){_0xc55edc[_0x2774('0x1c')](0x194);}return _0x53ef64;};}function handleError(_0x4be79c,_0x343710){_0x343710=_0x343710||0x1f4;return function(_0x381098){logger[_0x2774('0x28')](_0x381098[_0x2774('0x29')]);if(_0x381098[_0x2774('0x2a')]){delete _0x381098[_0x2774('0x2a')];}_0x4be79c[_0x2774('0x1d')](_0x343710)[_0x2774('0x2b')](_0x381098);};}exports[_0x2774('0x2c')]=function(_0x1f5694,_0x16ab79){var _0x2ef223={},_0x123e3c={},_0x364633={'count':0x0,'rows':[]};var _0x562263=_['map'](db[_0x2774('0x2d')]['rawAttributes'],function(_0x1737f6){return{'name':_0x1737f6['fieldName'],'type':_0x1737f6[_0x2774('0x2e')][_0x2774('0x2f')]};});_0x123e3c[_0x2774('0x30')]=_['map'](_0x562263,_0x2774('0x2a'));_0x123e3c[_0x2774('0x31')]=_['keys'](_0x1f5694['query']);_0x123e3c[_0x2774('0x32')]=_[_0x2774('0x33')](_0x123e3c[_0x2774('0x30')],_0x123e3c[_0x2774('0x31')]);_0x2ef223[_0x2774('0x34')]=_[_0x2774('0x33')](_0x123e3c['model'],qs[_0x2774('0x35')](_0x1f5694['query']['fields']));_0x2ef223['attributes']=_0x2ef223['attributes'][_0x2774('0x36')]?_0x2ef223[_0x2774('0x34')]:_0x123e3c[_0x2774('0x30')];if(!_0x1f5694[_0x2774('0x31')][_0x2774('0x37')]('nolimit')){_0x2ef223[_0x2774('0x21')]=qs[_0x2774('0x21')](_0x1f5694[_0x2774('0x31')][_0x2774('0x21')]);_0x2ef223[_0x2774('0x1f')]=qs[_0x2774('0x1f')](_0x1f5694[_0x2774('0x31')][_0x2774('0x1f')]);}_0x2ef223[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x1f5694[_0x2774('0x31')]['sort']);_0x2ef223['where']=qs[_0x2774('0x32')](_['pick'](_0x1f5694['query'],_0x123e3c[_0x2774('0x32')]),_0x562263);if(_0x1f5694['query'][_0x2774('0x3a')]){_0x2ef223[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x2ef223[_0x2774('0x3b')],{'$or':_[_0x2774('0x3d')](_0x562263,function(_0x49df0d){if(_0x49df0d[_0x2774('0x2e')]!==_0x2774('0x3e')){var _0x50b0de={};_0x50b0de[_0x49df0d[_0x2774('0x2a')]]={'$like':'%'+_0x1f5694[_0x2774('0x31')][_0x2774('0x3a')]+'%'};return _0x50b0de;}})});}_0x2ef223=_['merge']({},_0x2ef223,_0x1f5694[_0x2774('0x3f')]);var _0x2ebb3c={'where':_0x2ef223[_0x2774('0x3b')]};return db['DeskConfiguration']['count'](_0x2ebb3c)['then'](function(_0x305d74){_0x364633[_0x2774('0x22')]=_0x305d74;if(_0x1f5694[_0x2774('0x31')][_0x2774('0x40')]){_0x2ef223['include']=[{'all':!![]}];}return db[_0x2774('0x2d')][_0x2774('0x41')](_0x2ef223);})[_0x2774('0x27')](function(_0x46b718){_0x364633[_0x2774('0x42')]=_0x46b718;return _0x364633;})[_0x2774('0x27')](respondWithFilteredResult(_0x16ab79,_0x2ef223))[_0x2774('0x43')](handleError(_0x16ab79,null));};exports[_0x2774('0x44')]=function(_0x52cc21,_0x1e9d40){var _0x1753d7={'raw':![],'where':{'id':_0x52cc21[_0x2774('0x45')]['id']}},_0x15f0e1={};_0x15f0e1[_0x2774('0x30')]=_[_0x2774('0x46')](db['DeskConfiguration'][_0x2774('0x47')]);_0x15f0e1[_0x2774('0x31')]=_[_0x2774('0x46')](_0x52cc21['query']);_0x15f0e1['filters']=_[_0x2774('0x33')](_0x15f0e1[_0x2774('0x30')],_0x15f0e1[_0x2774('0x31')]);_0x1753d7[_0x2774('0x34')]=_['intersection'](_0x15f0e1['model'],qs['fields'](_0x52cc21[_0x2774('0x31')][_0x2774('0x35')]));_0x1753d7['attributes']=_0x1753d7[_0x2774('0x34')][_0x2774('0x36')]?_0x1753d7[_0x2774('0x34')]:_0x15f0e1[_0x2774('0x30')];if(_0x52cc21[_0x2774('0x31')][_0x2774('0x40')]){_0x1753d7[_0x2774('0x48')]=[{'all':!![]}];}_0x1753d7=_[_0x2774('0x3c')]({},_0x1753d7,_0x52cc21[_0x2774('0x3f')]);return db[_0x2774('0x2d')][_0x2774('0x49')](_0x1753d7)['then'](handleEntityNotFound(_0x1e9d40,null))['then'](respondWithResult(_0x1e9d40,null))[_0x2774('0x43')](handleError(_0x1e9d40,null));};exports['create']=function(_0x5aaa1b,_0x446d87){return db[_0x2774('0x2d')][_0x2774('0x4a')](_0x5aaa1b[_0x2774('0x4b')],{})[_0x2774('0x27')](respondWithResult(_0x446d87,0xc9))[_0x2774('0x43')](handleError(_0x446d87,null));};exports[_0x2774('0x26')]=function(_0x20631d,_0x2e10f6){if(_0x20631d[_0x2774('0x4b')]['id']){delete _0x20631d[_0x2774('0x4b')]['id'];}return db[_0x2774('0x2d')]['find']({'where':{'id':_0x20631d[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x2e10f6,null))[_0x2774('0x27')](saveUpdates(_0x20631d[_0x2774('0x4b')],null))['then'](respondWithResult(_0x2e10f6,null))[_0x2774('0x43')](handleError(_0x2e10f6,null));};exports['destroy']=function(_0x1ae6a7,_0x1d7220){return db[_0x2774('0x2d')][_0x2774('0x49')]({'where':{'id':_0x1ae6a7[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x1d7220,null))['then'](removeEntity(_0x1d7220,null))['catch'](handleError(_0x1d7220,null));};exports['getFields']=function(_0x49c494,_0x451504,_0x5dd332){var _0x395b5f={};var _0x264c78={};var _0x176c79;var _0x488358;return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x49c494[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x451504,null))['then'](function(_0x36f921){if(_0x36f921){_0x176c79=_0x36f921;_0x264c78[_0x2774('0x30')]=_[_0x2774('0x46')](db['DeskField']['rawAttributes']);_0x264c78[_0x2774('0x31')]=_[_0x2774('0x46')](_0x49c494[_0x2774('0x31')]);_0x264c78['filters']=_['intersection'](_0x264c78[_0x2774('0x30')],_0x264c78[_0x2774('0x31')]);_0x395b5f['attributes']=_['intersection'](_0x264c78[_0x2774('0x30')],qs[_0x2774('0x35')](_0x49c494['query']['fields']));_0x395b5f[_0x2774('0x34')]=_0x395b5f[_0x2774('0x34')][_0x2774('0x36')]?_0x395b5f['attributes']:_0x264c78['model'];_0x395b5f[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x49c494[_0x2774('0x31')][_0x2774('0x39')]);_0x395b5f[_0x2774('0x3b')]=qs[_0x2774('0x32')](_['pick'](_0x49c494[_0x2774('0x31')],_0x264c78[_0x2774('0x32')]));if(_0x49c494[_0x2774('0x31')][_0x2774('0x3a')]){_0x395b5f[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x395b5f[_0x2774('0x3b')],{'$or':_[_0x2774('0x3d')](_0x395b5f['attributes'],function(_0x55edeb){var _0x4fd02d={};_0x4fd02d[_0x55edeb]={'$like':'%'+_0x49c494[_0x2774('0x31')]['filter']+'%'};return _0x4fd02d;})});}_0x395b5f=_['merge']({},_0x395b5f,_0x49c494[_0x2774('0x3f')]);return _0x176c79[_0x2774('0x4d')](_0x395b5f);}})[_0x2774('0x27')](function(_0x1c058d){if(_0x1c058d){_0x488358=_0x1c058d[_0x2774('0x36')];if(!_0x49c494[_0x2774('0x31')][_0x2774('0x37')](_0x2774('0x4e'))){_0x395b5f[_0x2774('0x21')]=qs[_0x2774('0x21')](_0x49c494[_0x2774('0x31')][_0x2774('0x21')]);_0x395b5f[_0x2774('0x1f')]=qs[_0x2774('0x1f')](_0x49c494['query'][_0x2774('0x1f')]);}return _0x176c79[_0x2774('0x4d')](_0x395b5f);}})['then'](function(_0x483eff){if(_0x483eff){return _0x483eff?{'count':_0x488358,'rows':_0x483eff}:null;}})[_0x2774('0x27')](respondWithResult(_0x451504,null))[_0x2774('0x43')](handleError(_0x451504,null));};exports[_0x2774('0x4f')]=function(_0x3ee2a0,_0x31918d,_0x128dd7){var _0x466ad9={};var _0x2496c1={};var _0x2a8827;var _0x1cfc21;return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x3ee2a0[_0x2774('0x45')]['id']}})['then'](handleEntityNotFound(_0x31918d,null))[_0x2774('0x27')](function(_0x1d622d){if(_0x1d622d){_0x2a8827=_0x1d622d;_0x2496c1[_0x2774('0x30')]=_[_0x2774('0x46')](db[_0x2774('0x50')][_0x2774('0x47')]);_0x2496c1[_0x2774('0x31')]=_[_0x2774('0x46')](_0x3ee2a0['query']);_0x2496c1['filters']=_[_0x2774('0x33')](_0x2496c1[_0x2774('0x30')],_0x2496c1[_0x2774('0x31')]);_0x466ad9[_0x2774('0x34')]=_[_0x2774('0x33')](_0x2496c1['model'],qs[_0x2774('0x35')](_0x3ee2a0[_0x2774('0x31')][_0x2774('0x35')]));_0x466ad9[_0x2774('0x34')]=_0x466ad9[_0x2774('0x34')][_0x2774('0x36')]?_0x466ad9[_0x2774('0x34')]:_0x2496c1[_0x2774('0x30')];_0x466ad9[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x3ee2a0[_0x2774('0x31')][_0x2774('0x39')]);_0x466ad9[_0x2774('0x3b')]=qs[_0x2774('0x32')](_[_0x2774('0x51')](_0x3ee2a0[_0x2774('0x31')],_0x2496c1[_0x2774('0x32')]));if(_0x3ee2a0['query'][_0x2774('0x3a')]){_0x466ad9[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x466ad9[_0x2774('0x3b')],{'$or':_['map'](_0x466ad9[_0x2774('0x34')],function(_0x383986){var _0x562de9={};_0x562de9[_0x383986]={'$like':'%'+_0x3ee2a0[_0x2774('0x31')][_0x2774('0x3a')]+'%'};return _0x562de9;})});}_0x466ad9=_[_0x2774('0x3c')]({},_0x466ad9,_0x3ee2a0[_0x2774('0x3f')]);return _0x2a8827[_0x2774('0x4f')](_0x466ad9);}})['then'](function(_0x4a3a06){if(_0x4a3a06){_0x1cfc21=_0x4a3a06[_0x2774('0x36')];if(!_0x3ee2a0['query']['hasOwnProperty']('nolimit')){_0x466ad9['limit']=qs['limit'](_0x3ee2a0['query'][_0x2774('0x21')]);_0x466ad9[_0x2774('0x1f')]=qs['offset'](_0x3ee2a0[_0x2774('0x31')][_0x2774('0x1f')]);}return _0x2a8827['getSubjects'](_0x466ad9);}})[_0x2774('0x27')](function(_0x37d249){if(_0x37d249){return _0x37d249?{'count':_0x1cfc21,'rows':_0x37d249}:null;}})[_0x2774('0x27')](respondWithResult(_0x31918d,null))[_0x2774('0x43')](handleError(_0x31918d,null));};exports[_0x2774('0x52')]=function(_0x1bf80b,_0x143c91,_0x53461d){var _0x4c0d71={};var _0x337c4c={};var _0x5cdea3;var _0x20fa4f;return db[_0x2774('0x2d')]['findOne']({'where':{'id':_0x1bf80b[_0x2774('0x45')]['id']}})['then'](handleEntityNotFound(_0x143c91,null))[_0x2774('0x27')](function(_0x30243e){if(_0x30243e){_0x5cdea3=_0x30243e;_0x337c4c[_0x2774('0x30')]=_['keys'](db[_0x2774('0x50')][_0x2774('0x47')]);_0x337c4c['query']=_[_0x2774('0x46')](_0x1bf80b[_0x2774('0x31')]);_0x337c4c[_0x2774('0x32')]=_['intersection'](_0x337c4c[_0x2774('0x30')],_0x337c4c[_0x2774('0x31')]);_0x4c0d71[_0x2774('0x34')]=_[_0x2774('0x33')](_0x337c4c[_0x2774('0x30')],qs['fields'](_0x1bf80b[_0x2774('0x31')][_0x2774('0x35')]));_0x4c0d71[_0x2774('0x34')]=_0x4c0d71[_0x2774('0x34')][_0x2774('0x36')]?_0x4c0d71['attributes']:_0x337c4c['model'];_0x4c0d71[_0x2774('0x38')]=qs[_0x2774('0x39')](_0x1bf80b[_0x2774('0x31')][_0x2774('0x39')]);_0x4c0d71[_0x2774('0x3b')]=qs['filters'](_[_0x2774('0x51')](_0x1bf80b[_0x2774('0x31')],_0x337c4c['filters']));if(_0x1bf80b[_0x2774('0x31')][_0x2774('0x3a')]){_0x4c0d71[_0x2774('0x3b')]=_[_0x2774('0x3c')](_0x4c0d71['where'],{'$or':_[_0x2774('0x3d')](_0x4c0d71['attributes'],function(_0x30e070){var _0x15ec76={};_0x15ec76[_0x30e070]={'$like':'%'+_0x1bf80b[_0x2774('0x31')][_0x2774('0x3a')]+'%'};return _0x15ec76;})});}_0x4c0d71=_[_0x2774('0x3c')]({},_0x4c0d71,_0x1bf80b['options']);return _0x5cdea3[_0x2774('0x52')](_0x4c0d71);}})[_0x2774('0x27')](function(_0xea9bcf){if(_0xea9bcf){_0x20fa4f=_0xea9bcf[_0x2774('0x36')];if(!_0x1bf80b[_0x2774('0x31')]['hasOwnProperty'](_0x2774('0x4e'))){_0x4c0d71['limit']=qs['limit'](_0x1bf80b[_0x2774('0x31')][_0x2774('0x21')]);_0x4c0d71['offset']=qs[_0x2774('0x1f')](_0x1bf80b[_0x2774('0x31')]['offset']);}return _0x5cdea3[_0x2774('0x52')](_0x4c0d71);}})[_0x2774('0x27')](function(_0x1f979f){if(_0x1f979f){return _0x1f979f?{'count':_0x20fa4f,'rows':_0x1f979f}:null;}})['then'](respondWithResult(_0x143c91,null))['catch'](handleError(_0x143c91,null));};exports[_0x2774('0x53')]=function(_0x33ba74,_0x45ad27,_0x57a10c){var _0x181a1b={};var _0x4ebbcf={};var _0x55f0c2;var _0x46fb5a;return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x33ba74['params']['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x45ad27,null))['then'](function(_0x1f590b){if(_0x1f590b){_0x55f0c2=_0x1f590b;_0x4ebbcf[_0x2774('0x30')]=_[_0x2774('0x46')](db[_0x2774('0x54')]['rawAttributes']);_0x4ebbcf[_0x2774('0x31')]=_['keys'](_0x33ba74[_0x2774('0x31')]);_0x4ebbcf[_0x2774('0x32')]=_['intersection'](_0x4ebbcf[_0x2774('0x30')],_0x4ebbcf[_0x2774('0x31')]);_0x181a1b[_0x2774('0x34')]=_[_0x2774('0x33')](_0x4ebbcf[_0x2774('0x30')],qs[_0x2774('0x35')](_0x33ba74[_0x2774('0x31')][_0x2774('0x35')]));_0x181a1b['attributes']=_0x181a1b[_0x2774('0x34')][_0x2774('0x36')]?_0x181a1b[_0x2774('0x34')]:_0x4ebbcf[_0x2774('0x30')];_0x181a1b[_0x2774('0x38')]=qs['sort'](_0x33ba74[_0x2774('0x31')][_0x2774('0x39')]);_0x181a1b[_0x2774('0x3b')]=qs[_0x2774('0x32')](_[_0x2774('0x51')](_0x33ba74['query'],_0x4ebbcf[_0x2774('0x32')]));if(_0x33ba74[_0x2774('0x31')][_0x2774('0x3a')]){_0x181a1b[_0x2774('0x3b')]=_['merge'](_0x181a1b[_0x2774('0x3b')],{'$or':_[_0x2774('0x3d')](_0x181a1b[_0x2774('0x34')],function(_0x44e844){var _0x44c744={};_0x44c744[_0x44e844]={'$like':'%'+_0x33ba74['query'][_0x2774('0x3a')]+'%'};return _0x44c744;})});}_0x181a1b=_['merge']({},_0x181a1b,_0x33ba74[_0x2774('0x3f')]);return _0x55f0c2[_0x2774('0x53')](_0x181a1b);}})[_0x2774('0x27')](function(_0x295c63){if(_0x295c63){_0x46fb5a=_0x295c63['length'];if(!_0x33ba74['query'][_0x2774('0x37')](_0x2774('0x4e'))){_0x181a1b['limit']=qs[_0x2774('0x21')](_0x33ba74[_0x2774('0x31')]['limit']);_0x181a1b['offset']=qs[_0x2774('0x1f')](_0x33ba74['query'][_0x2774('0x1f')]);}return _0x55f0c2['getTags'](_0x181a1b);}})[_0x2774('0x27')](function(_0x1b40b6){if(_0x1b40b6){return _0x1b40b6?{'count':_0x46fb5a,'rows':_0x1b40b6}:null;}})[_0x2774('0x27')](respondWithResult(_0x45ad27,null))['catch'](handleError(_0x45ad27,null));};exports[_0x2774('0x55')]=function(_0x1d6311,_0x19d4dd,_0x39a895){if(_0x1d6311[_0x2774('0x4b')]['id']){delete _0x1d6311[_0x2774('0x4b')]['id'];}return db[_0x2774('0x2d')][_0x2774('0x4c')]({'where':{'id':_0x1d6311[_0x2774('0x45')]['id']}})[_0x2774('0x27')](handleEntityNotFound(_0x19d4dd,null))[_0x2774('0x27')](function(_0x61efee){if(_0x61efee){return _0x61efee[_0x2774('0x55')](_0x1d6311[_0x2774('0x4b')]['ids']||[]);}return null;})[_0x2774('0x27')](respondWithResult(_0x19d4dd,null))['catch'](handleError(_0x19d4dd,null));}; \ No newline at end of file +var _0xd381=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','stack','name','map','DeskConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','hasOwnProperty','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x32527c,_0x24a93f){var _0x1270c7=function(_0x56c709){while(--_0x56c709){_0x32527c['push'](_0x32527c['shift']());}};_0x1270c7(++_0x24a93f);}(_0xd381,0x193));var _0x1d38=function(_0x97c6ea,_0x4cffce){_0x97c6ea=_0x97c6ea-0x0;var _0x2d7f50=_0xd381[_0x97c6ea];return _0x2d7f50;};'use strict';var emlformat=require(_0x1d38('0x0'));var rimraf=require(_0x1d38('0x1'));var zipdir=require(_0x1d38('0x2'));var jsonpatch=require(_0x1d38('0x3'));var rp=require(_0x1d38('0x4'));var moment=require('moment');var BPromise=require(_0x1d38('0x5'));var Mustache=require(_0x1d38('0x6'));var util=require('util');var path=require(_0x1d38('0x7'));var sox=require(_0x1d38('0x8'));var csv=require(_0x1d38('0x9'));var ejs=require(_0x1d38('0xa'));var fs=require('fs');var fs_extra=require(_0x1d38('0xb'));var _=require(_0x1d38('0xc'));var squel=require('squel');var crypto=require(_0x1d38('0xd'));var jsforce=require(_0x1d38('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1d38('0x9'));var querystring=require(_0x1d38('0xf'));var Papa=require(_0x1d38('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1d38('0x11'));var as=require(_0x1d38('0x12'));var hardwareService=require(_0x1d38('0x13'));var logger=require(_0x1d38('0x14'))(_0x1d38('0x15'));var utils=require('../../config/utils');var config=require(_0x1d38('0x16'));var licenseUtil=require(_0x1d38('0x17'));var db=require(_0x1d38('0x18'))['db'];function respondWithStatusCode(_0x3e50b5,_0x28fa6c){_0x28fa6c=_0x28fa6c||0xcc;return function(_0x87ce51){if(_0x87ce51){return _0x3e50b5[_0x1d38('0x19')](_0x28fa6c);}return _0x3e50b5[_0x1d38('0x1a')](_0x28fa6c)[_0x1d38('0x1b')]();};}function respondWithResult(_0x13cf3f,_0x46bda1){_0x46bda1=_0x46bda1||0xc8;return function(_0x2927c6){if(_0x2927c6){return _0x13cf3f['status'](_0x46bda1)[_0x1d38('0x1c')](_0x2927c6);}};}function respondWithFilteredResult(_0x497869,_0x3fb2c0){return function(_0x22fc1e){if(_0x22fc1e){var _0x129a45=typeof _0x3fb2c0[_0x1d38('0x1d')]===_0x1d38('0x1e')&&typeof _0x3fb2c0[_0x1d38('0x1f')]===_0x1d38('0x1e');var _0x4b355f=_0x22fc1e[_0x1d38('0x20')];var _0x32455a=_0x129a45?0x0:_0x3fb2c0[_0x1d38('0x1d')];var _0x4313e3=_0x129a45?_0x22fc1e[_0x1d38('0x20')]:_0x3fb2c0['offset']+_0x3fb2c0[_0x1d38('0x1f')];var _0x47225b;if(_0x4313e3>=_0x4b355f){_0x4313e3=_0x4b355f;_0x47225b=0xc8;}else{_0x47225b=0xce;}_0x497869[_0x1d38('0x1a')](_0x47225b);return _0x497869['set'](_0x1d38('0x21'),_0x32455a+'-'+_0x4313e3+'/'+_0x4b355f)[_0x1d38('0x1c')](_0x22fc1e);}return null;};}function patchUpdates(_0x335673){return function(_0x6f0d99){try{jsonpatch[_0x1d38('0x22')](_0x6f0d99,_0x335673,!![]);}catch(_0x4218aa){return BPromise['reject'](_0x4218aa);}return _0x6f0d99['save']();};}function saveUpdates(_0x2e9f41,_0x297462){return function(_0x2916b8){if(_0x2916b8){return _0x2916b8[_0x1d38('0x23')](_0x2e9f41)[_0x1d38('0x24')](function(_0x35685d){return _0x35685d;});}return null;};}function removeEntity(_0x270cd7,_0x2c4734){return function(_0x497d03){if(_0x497d03){return _0x497d03[_0x1d38('0x25')]()[_0x1d38('0x24')](function(){_0x270cd7[_0x1d38('0x1a')](0xcc)[_0x1d38('0x1b')]();});}};}function handleEntityNotFound(_0x265a96,_0x56e1f2){return function(_0x48f50f){if(!_0x48f50f){_0x265a96[_0x1d38('0x19')](0x194);}return _0x48f50f;};}function handleError(_0x555410,_0x9806a3){_0x9806a3=_0x9806a3||0x1f4;return function(_0x1f57e6){logger[_0x1d38('0x26')](_0x1f57e6[_0x1d38('0x27')]);if(_0x1f57e6[_0x1d38('0x28')]){delete _0x1f57e6[_0x1d38('0x28')];}_0x555410[_0x1d38('0x1a')](_0x9806a3)['send'](_0x1f57e6);};}exports['index']=function(_0x393713,_0x2424b1){var _0x4d4003={},_0x2c60b2={},_0x5b407c={'count':0x0,'rows':[]};var _0x5d201d=_[_0x1d38('0x29')](db[_0x1d38('0x2a')][_0x1d38('0x2b')],function(_0x455c77){return{'name':_0x455c77[_0x1d38('0x2c')],'type':_0x455c77['type'][_0x1d38('0x2d')]};});_0x2c60b2[_0x1d38('0x2e')]=_['map'](_0x5d201d,_0x1d38('0x28'));_0x2c60b2[_0x1d38('0x2f')]=_[_0x1d38('0x30')](_0x393713['query']);_0x2c60b2['filters']=_['intersection'](_0x2c60b2[_0x1d38('0x2e')],_0x2c60b2['query']);_0x4d4003['attributes']=_[_0x1d38('0x31')](_0x2c60b2['model'],qs[_0x1d38('0x32')](_0x393713[_0x1d38('0x2f')]['fields']));_0x4d4003[_0x1d38('0x33')]=_0x4d4003[_0x1d38('0x33')][_0x1d38('0x34')]?_0x4d4003[_0x1d38('0x33')]:_0x2c60b2[_0x1d38('0x2e')];if(!_0x393713[_0x1d38('0x2f')]['hasOwnProperty'](_0x1d38('0x35'))){_0x4d4003[_0x1d38('0x1f')]=qs[_0x1d38('0x1f')](_0x393713[_0x1d38('0x2f')][_0x1d38('0x1f')]);_0x4d4003['offset']=qs[_0x1d38('0x1d')](_0x393713['query'][_0x1d38('0x1d')]);}_0x4d4003[_0x1d38('0x36')]=qs[_0x1d38('0x37')](_0x393713[_0x1d38('0x2f')][_0x1d38('0x37')]);_0x4d4003['where']=qs[_0x1d38('0x38')](_[_0x1d38('0x39')](_0x393713[_0x1d38('0x2f')],_0x2c60b2['filters']),_0x5d201d);if(_0x393713[_0x1d38('0x2f')]['filter']){_0x4d4003[_0x1d38('0x3a')]=_[_0x1d38('0x3b')](_0x4d4003[_0x1d38('0x3a')],{'$or':_[_0x1d38('0x29')](_0x5d201d,function(_0x8d3701){if(_0x8d3701[_0x1d38('0x3c')]!==_0x1d38('0x3d')){var _0x2a6ae7={};_0x2a6ae7[_0x8d3701[_0x1d38('0x28')]]={'$like':'%'+_0x393713['query'][_0x1d38('0x3e')]+'%'};return _0x2a6ae7;}})});}_0x4d4003=_['merge']({},_0x4d4003,_0x393713[_0x1d38('0x3f')]);var _0x1486c2={'where':_0x4d4003['where']};return db[_0x1d38('0x2a')][_0x1d38('0x20')](_0x1486c2)[_0x1d38('0x24')](function(_0x81eb9d){_0x5b407c['count']=_0x81eb9d;if(_0x393713[_0x1d38('0x2f')][_0x1d38('0x40')]){_0x4d4003[_0x1d38('0x41')]=[{'all':!![]}];}return db[_0x1d38('0x2a')][_0x1d38('0x42')](_0x4d4003);})['then'](function(_0x50fc53){_0x5b407c['rows']=_0x50fc53;return _0x5b407c;})[_0x1d38('0x24')](respondWithFilteredResult(_0x2424b1,_0x4d4003))[_0x1d38('0x43')](handleError(_0x2424b1,null));};exports[_0x1d38('0x44')]=function(_0xa9142e,_0x12371c){var _0x7711a5={'raw':![],'where':{'id':_0xa9142e[_0x1d38('0x45')]['id']}},_0x46a77b={};_0x46a77b[_0x1d38('0x2e')]=_[_0x1d38('0x30')](db[_0x1d38('0x2a')][_0x1d38('0x2b')]);_0x46a77b[_0x1d38('0x2f')]=_['keys'](_0xa9142e[_0x1d38('0x2f')]);_0x46a77b[_0x1d38('0x38')]=_['intersection'](_0x46a77b[_0x1d38('0x2e')],_0x46a77b[_0x1d38('0x2f')]);_0x7711a5['attributes']=_['intersection'](_0x46a77b[_0x1d38('0x2e')],qs['fields'](_0xa9142e[_0x1d38('0x2f')]['fields']));_0x7711a5[_0x1d38('0x33')]=_0x7711a5[_0x1d38('0x33')][_0x1d38('0x34')]?_0x7711a5[_0x1d38('0x33')]:_0x46a77b['model'];if(_0xa9142e['query'][_0x1d38('0x40')]){_0x7711a5['include']=[{'all':!![]}];}_0x7711a5=_[_0x1d38('0x3b')]({},_0x7711a5,_0xa9142e[_0x1d38('0x3f')]);return db['DeskConfiguration'][_0x1d38('0x46')](_0x7711a5)[_0x1d38('0x24')](handleEntityNotFound(_0x12371c,null))[_0x1d38('0x24')](respondWithResult(_0x12371c,null))[_0x1d38('0x43')](handleError(_0x12371c,null));};exports[_0x1d38('0x47')]=function(_0xa3eb42,_0x2cd841){return db[_0x1d38('0x2a')]['create'](_0xa3eb42['body'],{})['then'](respondWithResult(_0x2cd841,0xc9))[_0x1d38('0x43')](handleError(_0x2cd841,null));};exports['update']=function(_0x4e515f,_0x541128){if(_0x4e515f[_0x1d38('0x48')]['id']){delete _0x4e515f[_0x1d38('0x48')]['id'];}return db[_0x1d38('0x2a')][_0x1d38('0x46')]({'where':{'id':_0x4e515f[_0x1d38('0x45')]['id']}})[_0x1d38('0x24')](handleEntityNotFound(_0x541128,null))[_0x1d38('0x24')](saveUpdates(_0x4e515f[_0x1d38('0x48')],null))[_0x1d38('0x24')](respondWithResult(_0x541128,null))[_0x1d38('0x43')](handleError(_0x541128,null));};exports[_0x1d38('0x25')]=function(_0x4ebed7,_0x8ff8c9){return db[_0x1d38('0x2a')][_0x1d38('0x46')]({'where':{'id':_0x4ebed7[_0x1d38('0x45')]['id']}})['then'](handleEntityNotFound(_0x8ff8c9,null))[_0x1d38('0x24')](removeEntity(_0x8ff8c9,null))['catch'](handleError(_0x8ff8c9,null));};exports[_0x1d38('0x49')]=function(_0x19b8b0,_0xa8fcea,_0xe57328){var _0x2db94a={};var _0x9f9f4e={};var _0x2be629;var _0x5b4c61;return db[_0x1d38('0x2a')][_0x1d38('0x4a')]({'where':{'id':_0x19b8b0[_0x1d38('0x45')]['id']}})[_0x1d38('0x24')](handleEntityNotFound(_0xa8fcea,null))[_0x1d38('0x24')](function(_0x18aeca){if(_0x18aeca){_0x2be629=_0x18aeca;_0x9f9f4e[_0x1d38('0x2e')]=_['keys'](db[_0x1d38('0x4b')][_0x1d38('0x2b')]);_0x9f9f4e['query']=_[_0x1d38('0x30')](_0x19b8b0[_0x1d38('0x2f')]);_0x9f9f4e[_0x1d38('0x38')]=_['intersection'](_0x9f9f4e[_0x1d38('0x2e')],_0x9f9f4e[_0x1d38('0x2f')]);_0x2db94a['attributes']=_[_0x1d38('0x31')](_0x9f9f4e['model'],qs[_0x1d38('0x32')](_0x19b8b0[_0x1d38('0x2f')][_0x1d38('0x32')]));_0x2db94a['attributes']=_0x2db94a[_0x1d38('0x33')]['length']?_0x2db94a['attributes']:_0x9f9f4e['model'];_0x2db94a['order']=qs['sort'](_0x19b8b0[_0x1d38('0x2f')][_0x1d38('0x37')]);_0x2db94a[_0x1d38('0x3a')]=qs['filters'](_[_0x1d38('0x39')](_0x19b8b0['query'],_0x9f9f4e['filters']));if(_0x19b8b0[_0x1d38('0x2f')]['filter']){_0x2db94a[_0x1d38('0x3a')]=_[_0x1d38('0x3b')](_0x2db94a[_0x1d38('0x3a')],{'$or':_[_0x1d38('0x29')](_0x2db94a[_0x1d38('0x33')],function(_0x377dc5){var _0xfd817d={};_0xfd817d[_0x377dc5]={'$like':'%'+_0x19b8b0[_0x1d38('0x2f')][_0x1d38('0x3e')]+'%'};return _0xfd817d;})});}_0x2db94a=_[_0x1d38('0x3b')]({},_0x2db94a,_0x19b8b0[_0x1d38('0x3f')]);return _0x2be629[_0x1d38('0x49')](_0x2db94a);}})[_0x1d38('0x24')](function(_0x58d6b5){if(_0x58d6b5){_0x5b4c61=_0x58d6b5[_0x1d38('0x34')];if(!_0x19b8b0[_0x1d38('0x2f')]['hasOwnProperty'](_0x1d38('0x35'))){_0x2db94a[_0x1d38('0x1f')]=qs[_0x1d38('0x1f')](_0x19b8b0[_0x1d38('0x2f')][_0x1d38('0x1f')]);_0x2db94a[_0x1d38('0x1d')]=qs[_0x1d38('0x1d')](_0x19b8b0['query']['offset']);}return _0x2be629['getFields'](_0x2db94a);}})[_0x1d38('0x24')](function(_0x2da43d){if(_0x2da43d){return _0x2da43d?{'count':_0x5b4c61,'rows':_0x2da43d}:null;}})[_0x1d38('0x24')](respondWithResult(_0xa8fcea,null))[_0x1d38('0x43')](handleError(_0xa8fcea,null));};exports[_0x1d38('0x4c')]=function(_0x3fccbd,_0x3b5e27,_0xb88f8f){var _0x1eefe7={};var _0xb1aff4={};var _0x22df5f;var _0x4190c3;return db[_0x1d38('0x2a')][_0x1d38('0x4a')]({'where':{'id':_0x3fccbd['params']['id']}})[_0x1d38('0x24')](handleEntityNotFound(_0x3b5e27,null))[_0x1d38('0x24')](function(_0x3be62d){if(_0x3be62d){_0x22df5f=_0x3be62d;_0xb1aff4[_0x1d38('0x2e')]=_[_0x1d38('0x30')](db[_0x1d38('0x4b')][_0x1d38('0x2b')]);_0xb1aff4[_0x1d38('0x2f')]=_[_0x1d38('0x30')](_0x3fccbd[_0x1d38('0x2f')]);_0xb1aff4[_0x1d38('0x38')]=_[_0x1d38('0x31')](_0xb1aff4[_0x1d38('0x2e')],_0xb1aff4['query']);_0x1eefe7[_0x1d38('0x33')]=_['intersection'](_0xb1aff4[_0x1d38('0x2e')],qs['fields'](_0x3fccbd[_0x1d38('0x2f')]['fields']));_0x1eefe7['attributes']=_0x1eefe7[_0x1d38('0x33')]['length']?_0x1eefe7[_0x1d38('0x33')]:_0xb1aff4['model'];_0x1eefe7[_0x1d38('0x36')]=qs[_0x1d38('0x37')](_0x3fccbd[_0x1d38('0x2f')][_0x1d38('0x37')]);_0x1eefe7[_0x1d38('0x3a')]=qs[_0x1d38('0x38')](_[_0x1d38('0x39')](_0x3fccbd[_0x1d38('0x2f')],_0xb1aff4[_0x1d38('0x38')]));if(_0x3fccbd[_0x1d38('0x2f')][_0x1d38('0x3e')]){_0x1eefe7['where']=_[_0x1d38('0x3b')](_0x1eefe7[_0x1d38('0x3a')],{'$or':_['map'](_0x1eefe7[_0x1d38('0x33')],function(_0x50bcc9){var _0x36429d={};_0x36429d[_0x50bcc9]={'$like':'%'+_0x3fccbd[_0x1d38('0x2f')][_0x1d38('0x3e')]+'%'};return _0x36429d;})});}_0x1eefe7=_[_0x1d38('0x3b')]({},_0x1eefe7,_0x3fccbd[_0x1d38('0x3f')]);return _0x22df5f[_0x1d38('0x4c')](_0x1eefe7);}})[_0x1d38('0x24')](function(_0x321b9a){if(_0x321b9a){_0x4190c3=_0x321b9a[_0x1d38('0x34')];if(!_0x3fccbd[_0x1d38('0x2f')]['hasOwnProperty']('nolimit')){_0x1eefe7[_0x1d38('0x1f')]=qs['limit'](_0x3fccbd[_0x1d38('0x2f')][_0x1d38('0x1f')]);_0x1eefe7[_0x1d38('0x1d')]=qs[_0x1d38('0x1d')](_0x3fccbd['query'][_0x1d38('0x1d')]);}return _0x22df5f[_0x1d38('0x4c')](_0x1eefe7);}})[_0x1d38('0x24')](function(_0x2720a9){if(_0x2720a9){return _0x2720a9?{'count':_0x4190c3,'rows':_0x2720a9}:null;}})[_0x1d38('0x24')](respondWithResult(_0x3b5e27,null))[_0x1d38('0x43')](handleError(_0x3b5e27,null));};exports[_0x1d38('0x4d')]=function(_0x36f90c,_0x4d140a,_0x28c461){var _0x1ebbd4={};var _0x56073d={};var _0x43aa50;var _0x7b585f;return db[_0x1d38('0x2a')][_0x1d38('0x4a')]({'where':{'id':_0x36f90c[_0x1d38('0x45')]['id']}})[_0x1d38('0x24')](handleEntityNotFound(_0x4d140a,null))[_0x1d38('0x24')](function(_0x39489c){if(_0x39489c){_0x43aa50=_0x39489c;_0x56073d['model']=_[_0x1d38('0x30')](db[_0x1d38('0x4b')][_0x1d38('0x2b')]);_0x56073d['query']=_['keys'](_0x36f90c[_0x1d38('0x2f')]);_0x56073d[_0x1d38('0x38')]=_[_0x1d38('0x31')](_0x56073d[_0x1d38('0x2e')],_0x56073d[_0x1d38('0x2f')]);_0x1ebbd4[_0x1d38('0x33')]=_['intersection'](_0x56073d[_0x1d38('0x2e')],qs[_0x1d38('0x32')](_0x36f90c[_0x1d38('0x2f')][_0x1d38('0x32')]));_0x1ebbd4[_0x1d38('0x33')]=_0x1ebbd4[_0x1d38('0x33')]['length']?_0x1ebbd4[_0x1d38('0x33')]:_0x56073d[_0x1d38('0x2e')];_0x1ebbd4[_0x1d38('0x36')]=qs['sort'](_0x36f90c[_0x1d38('0x2f')][_0x1d38('0x37')]);_0x1ebbd4[_0x1d38('0x3a')]=qs['filters'](_[_0x1d38('0x39')](_0x36f90c[_0x1d38('0x2f')],_0x56073d[_0x1d38('0x38')]));if(_0x36f90c[_0x1d38('0x2f')][_0x1d38('0x3e')]){_0x1ebbd4[_0x1d38('0x3a')]=_[_0x1d38('0x3b')](_0x1ebbd4['where'],{'$or':_['map'](_0x1ebbd4[_0x1d38('0x33')],function(_0x5d510a){var _0x5c9876={};_0x5c9876[_0x5d510a]={'$like':'%'+_0x36f90c[_0x1d38('0x2f')][_0x1d38('0x3e')]+'%'};return _0x5c9876;})});}_0x1ebbd4=_[_0x1d38('0x3b')]({},_0x1ebbd4,_0x36f90c['options']);return _0x43aa50[_0x1d38('0x4d')](_0x1ebbd4);}})[_0x1d38('0x24')](function(_0x3382b9){if(_0x3382b9){_0x7b585f=_0x3382b9[_0x1d38('0x34')];if(!_0x36f90c[_0x1d38('0x2f')][_0x1d38('0x4e')]('nolimit')){_0x1ebbd4[_0x1d38('0x1f')]=qs[_0x1d38('0x1f')](_0x36f90c[_0x1d38('0x2f')][_0x1d38('0x1f')]);_0x1ebbd4[_0x1d38('0x1d')]=qs[_0x1d38('0x1d')](_0x36f90c[_0x1d38('0x2f')][_0x1d38('0x1d')]);}return _0x43aa50['getDescriptions'](_0x1ebbd4);}})[_0x1d38('0x24')](function(_0x1fed29){if(_0x1fed29){return _0x1fed29?{'count':_0x7b585f,'rows':_0x1fed29}:null;}})['then'](respondWithResult(_0x4d140a,null))['catch'](handleError(_0x4d140a,null));};exports[_0x1d38('0x4f')]=function(_0x3a0b9a,_0x43fe97,_0x4ddc50){var _0x911e81={};var _0x1e5a22={};var _0x2e35ab;var _0x380c27;return db[_0x1d38('0x2a')]['findOne']({'where':{'id':_0x3a0b9a['params']['id']}})['then'](handleEntityNotFound(_0x43fe97,null))[_0x1d38('0x24')](function(_0x5be9b4){if(_0x5be9b4){_0x2e35ab=_0x5be9b4;_0x1e5a22[_0x1d38('0x2e')]=_[_0x1d38('0x30')](db['Tag'][_0x1d38('0x2b')]);_0x1e5a22['query']=_['keys'](_0x3a0b9a['query']);_0x1e5a22[_0x1d38('0x38')]=_['intersection'](_0x1e5a22[_0x1d38('0x2e')],_0x1e5a22[_0x1d38('0x2f')]);_0x911e81['attributes']=_['intersection'](_0x1e5a22[_0x1d38('0x2e')],qs['fields'](_0x3a0b9a[_0x1d38('0x2f')]['fields']));_0x911e81['attributes']=_0x911e81[_0x1d38('0x33')]['length']?_0x911e81['attributes']:_0x1e5a22[_0x1d38('0x2e')];_0x911e81['order']=qs[_0x1d38('0x37')](_0x3a0b9a['query']['sort']);_0x911e81[_0x1d38('0x3a')]=qs[_0x1d38('0x38')](_['pick'](_0x3a0b9a['query'],_0x1e5a22['filters']));if(_0x3a0b9a[_0x1d38('0x2f')][_0x1d38('0x3e')]){_0x911e81['where']=_[_0x1d38('0x3b')](_0x911e81[_0x1d38('0x3a')],{'$or':_['map'](_0x911e81['attributes'],function(_0x5a9c7a){var _0x273c13={};_0x273c13[_0x5a9c7a]={'$like':'%'+_0x3a0b9a['query'][_0x1d38('0x3e')]+'%'};return _0x273c13;})});}_0x911e81=_[_0x1d38('0x3b')]({},_0x911e81,_0x3a0b9a['options']);return _0x2e35ab[_0x1d38('0x4f')](_0x911e81);}})[_0x1d38('0x24')](function(_0x564ac1){if(_0x564ac1){_0x380c27=_0x564ac1['length'];if(!_0x3a0b9a[_0x1d38('0x2f')][_0x1d38('0x4e')](_0x1d38('0x35'))){_0x911e81[_0x1d38('0x1f')]=qs['limit'](_0x3a0b9a[_0x1d38('0x2f')][_0x1d38('0x1f')]);_0x911e81[_0x1d38('0x1d')]=qs['offset'](_0x3a0b9a[_0x1d38('0x2f')][_0x1d38('0x1d')]);}return _0x2e35ab[_0x1d38('0x4f')](_0x911e81);}})[_0x1d38('0x24')](function(_0x2bc901){if(_0x2bc901){return _0x2bc901?{'count':_0x380c27,'rows':_0x2bc901}:null;}})[_0x1d38('0x24')](respondWithResult(_0x43fe97,null))[_0x1d38('0x43')](handleError(_0x43fe97,null));};exports[_0x1d38('0x50')]=function(_0xb5e030,_0x4e61d4,_0xe11e47){if(_0xb5e030[_0x1d38('0x48')]['id']){delete _0xb5e030[_0x1d38('0x48')]['id'];}return db[_0x1d38('0x2a')][_0x1d38('0x4a')]({'where':{'id':_0xb5e030[_0x1d38('0x45')]['id']}})[_0x1d38('0x24')](handleEntityNotFound(_0x4e61d4,null))[_0x1d38('0x24')](function(_0x1f8125){if(_0x1f8125){return _0x1f8125[_0x1d38('0x50')](_0xb5e030[_0x1d38('0x48')][_0x1d38('0x51')]||[]);}return null;})[_0x1d38('0x24')](respondWithResult(_0x4e61d4,null))[_0x1d38('0x43')](handleError(_0x4e61d4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 2accb3a..0c157ee 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 _0x0326=['int_desk_configurations','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x40c0ad,_0x24771c){var _0x354d97=function(_0x1e58bb){while(--_0x1e58bb){_0x40c0ad['push'](_0x40c0ad['shift']());}};_0x354d97(++_0x24771c);}(_0x0326,0x115));var _0x6032=function(_0x58c9fd,_0x34100c){_0x58c9fd=_0x58c9fd-0x0;var _0x4284f9=_0x0326[_0x58c9fd];return _0x4284f9;};'use strict';var _=require(_0x6032('0x0'));var util=require(_0x6032('0x1'));var logger=require(_0x6032('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6032('0x3'));var rp=require(_0x6032('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6032('0x5'));var config=require(_0x6032('0x6'));var attributes=require(_0x6032('0x7'));module[_0x6032('0x8')]=function(_0xefe798,_0xf8769b){return _0xefe798[_0x6032('0x9')](_0x6032('0xa'),attributes,{'tableName':_0x6032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a93=['DeskConfiguration','int_desk_configurations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x23a0a3,_0x273cfb){var _0x54cf56=function(_0x4d60ae){while(--_0x4d60ae){_0x23a0a3['push'](_0x23a0a3['shift']());}};_0x54cf56(++_0x273cfb);}(_0x6a93,0x188));var _0x36a9=function(_0x5c347a,_0x262914){_0x5c347a=_0x5c347a-0x0;var _0x42f045=_0x6a93[_0x5c347a];return _0x42f045;};'use strict';var _=require(_0x36a9('0x0'));var util=require('util');var logger=require(_0x36a9('0x1'))('api');var moment=require(_0x36a9('0x2'));var BPromise=require(_0x36a9('0x3'));var rp=require(_0x36a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x36a9('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x36a9('0x6')]=function(_0x3e1544,_0x109065){return _0x3e1544[_0x36a9('0x7')](_0x36a9('0x8'),attributes,{'tableName':_0x36a9('0x9'),'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 a745f3d..5b785a4 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 _0xb8cb=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb8cb,0xd9));var _0xbb8c=function(_0x30655d,_0x18fe25){_0x30655d=_0x30655d-0x0;var _0x1efa56=_0xb8cb[_0x30655d];return _0x1efa56;};'use strict';var _=require(_0xbb8c('0x0'));var util=require(_0xbb8c('0x1'));var moment=require(_0xbb8c('0x2'));var BPromise=require(_0xbb8c('0x3'));var rs=require(_0xbb8c('0x4'));var fs=require('fs');var Redis=require(_0xbb8c('0x5'));var db=require(_0xbb8c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb8c('0x7'))(_0xbb8c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb8c('0x9')][_0xbb8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb759,_0x497956,_0x31224b){return new BPromise(function(_0x3eda24,_0x11d365){return client[_0xbb8c('0xb')](_0x3eb759,_0x31224b)[_0xbb8c('0xc')](function(_0x2a9791){logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));logger[_0xbb8c('0x10')](_0xbb8c('0x11'),_0x497956,_0xbb8c('0xf'),JSON['stringify'](_0x2a9791));if(_0x2a9791[_0xbb8c('0x12')]){if(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x13')]===0x1f4){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791['error'][_0xbb8c('0x14')]);return _0x11d365(_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);}logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x2a9791[_0xbb8c('0x12')][_0xbb8c('0x14')]);return _0x3eda24(_0x2a9791['error'][_0xbb8c('0x14')]);}else{logger[_0xbb8c('0xd')](_0xbb8c('0xe'),_0x497956,_0xbb8c('0xf'));_0x3eda24(_0x2a9791[_0xbb8c('0x15')][_0xbb8c('0x14')]);}})[_0xbb8c('0x16')](function(_0x3988cf){logger[_0xbb8c('0x12')](_0xbb8c('0xe'),_0x497956,_0x3988cf);_0x11d365(_0x3988cf);});});} \ No newline at end of file +var _0xb749=['error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xb749,0xac));var _0x9b74=function(_0x1d18eb,_0x44511f){_0x1d18eb=_0x1d18eb-0x0;var _0x1112e1=_0xb749[_0x1d18eb];return _0x1112e1;};'use strict';var _=require(_0x9b74('0x0'));var util=require('util');var moment=require(_0x9b74('0x1'));var BPromise=require(_0x9b74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b74('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b74('0x4'));var logger=require(_0x9b74('0x5'))(_0x9b74('0x6'));var config=require(_0x9b74('0x7'));var jayson=require(_0x9b74('0x8'));var client=jayson[_0x9b74('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24da1a,_0x4ed115,_0x373f65){return new BPromise(function(_0xe9f28d,_0x3e1920){return client[_0x9b74('0xa')](_0x24da1a,_0x373f65)[_0x9b74('0xb')](function(_0x516ddb){logger[_0x9b74('0xc')](_0x9b74('0xd'),_0x4ed115,'request\x20sent');logger[_0x9b74('0xe')](_0x9b74('0xf'),_0x4ed115,_0x9b74('0x10'),JSON['stringify'](_0x516ddb));if(_0x516ddb[_0x9b74('0x11')]){if(_0x516ddb[_0x9b74('0x11')][_0x9b74('0x12')]===0x1f4){logger[_0x9b74('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4ed115,_0x516ddb['error'][_0x9b74('0x13')]);return _0x3e1920(_0x516ddb[_0x9b74('0x11')][_0x9b74('0x13')]);}logger[_0x9b74('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4ed115,_0x516ddb[_0x9b74('0x11')][_0x9b74('0x13')]);return _0xe9f28d(_0x516ddb[_0x9b74('0x11')][_0x9b74('0x13')]);}else{logger[_0x9b74('0xc')](_0x9b74('0xd'),_0x4ed115,'request\x20sent');_0xe9f28d(_0x516ddb['result'][_0x9b74('0x13')]);}})[_0x9b74('0x14')](function(_0x307a85){logger[_0x9b74('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4ed115,_0x307a85);_0x3e1920(_0x307a85);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 5241fc7..62f6482 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 _0xda28=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xda28,0xfd));var _0x8da2=function(_0x31a331,_0x352ae8){_0x31a331=_0x31a331-0x0;var _0x4f3407=_0xda28[_0x31a331];return _0x4f3407;};'use strict';var multer=require(_0x8da2('0x0'));var util=require(_0x8da2('0x1'));var path=require(_0x8da2('0x2'));var timeout=require(_0x8da2('0x3'));var express=require(_0x8da2('0x4'));var router=express['Router']();var fs_extra=require(_0x8da2('0x5'));var auth=require(_0x8da2('0x6'));var interaction=require(_0x8da2('0x7'));var config=require(_0x8da2('0x8'));var controller=require(_0x8da2('0x9'));router[_0x8da2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xb')]);router['get'](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['show']);router[_0x8da2('0xe')]('/',auth['isAuthenticated'](),controller[_0x8da2('0xf')]);router[_0x8da2('0x10')](_0x8da2('0xc'),auth[_0x8da2('0xd')](),controller['update']);router[_0x8da2('0x11')]('/:id',auth[_0x8da2('0xd')](),controller[_0x8da2('0x12')]);module[_0x8da2('0x13')]=router; \ No newline at end of file +var _0x5ae9=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util'];(function(_0x3ecc23,_0x4f64c8){var _0x49e057=function(_0xd76311){while(--_0xd76311){_0x3ecc23['push'](_0x3ecc23['shift']());}};_0x49e057(++_0x4f64c8);}(_0x5ae9,0x1de));var _0x95ae=function(_0x263a8a,_0x5c088d){_0x263a8a=_0x263a8a-0x0;var _0x226a79=_0x5ae9[_0x263a8a];return _0x226a79;};'use strict';var multer=require(_0x95ae('0x0'));var util=require(_0x95ae('0x1'));var path=require(_0x95ae('0x2'));var timeout=require(_0x95ae('0x3'));var express=require(_0x95ae('0x4'));var router=express[_0x95ae('0x5')]();var fs_extra=require(_0x95ae('0x6'));var auth=require(_0x95ae('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x95ae('0x8'));var controller=require(_0x95ae('0x9'));router[_0x95ae('0xa')]('/',auth[_0x95ae('0xb')](),controller[_0x95ae('0xc')]);router[_0x95ae('0xa')](_0x95ae('0xd'),auth['isAuthenticated'](),controller[_0x95ae('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x95ae('0xf')]);router[_0x95ae('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x95ae('0x11')]);router['delete']('/:id',auth[_0x95ae('0xb')](),controller[_0x95ae('0x12')]);module[_0x95ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 01a503f..bb5f7df 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 _0xefa7=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x264970,_0x6fa19){var _0x55a8bf=function(_0x3c4244){while(--_0x3c4244){_0x264970['push'](_0x264970['shift']());}};_0x55a8bf(++_0x6fa19);}(_0xefa7,0x169));var _0x7efa=function(_0x5c1ace,_0x585e77){_0x5c1ace=_0x5c1ace-0x0;var _0x5d9a0a=_0xefa7[_0x5c1ace];return _0x5d9a0a;};'use strict';var Sequelize=require(_0x7efa('0x0'));module[_0x7efa('0x1')]={'type':{'type':Sequelize[_0x7efa('0x2')](_0x7efa('0x3'),_0x7efa('0x4'),_0x7efa('0x5'),_0x7efa('0x6'),_0x7efa('0x7')),'defaultValue':_0x7efa('0x3')},'content':{'type':Sequelize[_0x7efa('0x8')]},'key':{'type':Sequelize[_0x7efa('0x8')]},'keyType':{'type':Sequelize[_0x7efa('0x2')](_0x7efa('0x3'),'variable',_0x7efa('0x5'))},'keyContent':{'type':Sequelize[_0x7efa('0x8')]},'idField':{'type':Sequelize[_0x7efa('0x8')]},'nameField':{'type':Sequelize[_0x7efa('0x8')]},'customField':{'type':Sequelize[_0x7efa('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7efa('0x8')]}}; \ No newline at end of file +var _0x85e7=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x139b63,_0x389ca8){var _0x2493f2=function(_0x137a08){while(--_0x137a08){_0x139b63['push'](_0x139b63['shift']());}};_0x2493f2(++_0x389ca8);}(_0x85e7,0x1a4));var _0x785e=function(_0x19b307,_0x3c0c8a){_0x19b307=_0x19b307-0x0;var _0x4a6659=_0x85e7[_0x19b307];return _0x4a6659;};'use strict';var Sequelize=require(_0x785e('0x0'));module[_0x785e('0x1')]={'type':{'type':Sequelize[_0x785e('0x2')](_0x785e('0x3'),_0x785e('0x4'),_0x785e('0x5'),_0x785e('0x6'),_0x785e('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x785e('0x8')]},'key':{'type':Sequelize[_0x785e('0x8')]},'keyType':{'type':Sequelize[_0x785e('0x2')]('string',_0x785e('0x4'),_0x785e('0x5'))},'keyContent':{'type':Sequelize[_0x785e('0x8')]},'idField':{'type':Sequelize[_0x785e('0x8')]},'nameField':{'type':Sequelize[_0x785e('0x8')]},'customField':{'type':Sequelize[_0x785e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x785e('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index c5fdfc8..45da74e 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 _0xfdfc=['index','rawAttributes','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','DeskField','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','stack','name','send'];(function(_0xbc9deb,_0x10a431){var _0xc2ca35=function(_0x109f9c){while(--_0x109f9c){_0xbc9deb['push'](_0xbc9deb['shift']());}};_0xc2ca35(++_0x10a431);}(_0xfdfc,0x6c));var _0xcfdf=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xfdfc[_0x5f0089];return _0x193892;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcfdf('0x0'));var rp=require(_0xcfdf('0x1'));var moment=require(_0xcfdf('0x2'));var BPromise=require(_0xcfdf('0x3'));var Mustache=require(_0xcfdf('0x4'));var util=require('util');var path=require(_0xcfdf('0x5'));var sox=require(_0xcfdf('0x6'));var csv=require(_0xcfdf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcfdf('0x8'));var _=require(_0xcfdf('0x9'));var squel=require(_0xcfdf('0xa'));var crypto=require(_0xcfdf('0xb'));var jsforce=require(_0xcfdf('0xc'));var deskjs=require(_0xcfdf('0xd'));var toCsv=require(_0xcfdf('0x7'));var querystring=require(_0xcfdf('0xe'));var Papa=require('papaparse');var Redis=require(_0xcfdf('0xf'));var authService=require(_0xcfdf('0x10'));var qs=require(_0xcfdf('0x11'));var as=require(_0xcfdf('0x12'));var hardwareService=require(_0xcfdf('0x13'));var logger=require('../../config/logger')(_0xcfdf('0x14'));var utils=require(_0xcfdf('0x15'));var config=require(_0xcfdf('0x16'));var licenseUtil=require(_0xcfdf('0x17'));var db=require(_0xcfdf('0x18'))['db'];function respondWithStatusCode(_0x5521de,_0x63bc98){_0x63bc98=_0x63bc98||0xcc;return function(_0x1fe97d){if(_0x1fe97d){return _0x5521de[_0xcfdf('0x19')](_0x63bc98);}return _0x5521de[_0xcfdf('0x1a')](_0x63bc98)[_0xcfdf('0x1b')]();};}function respondWithResult(_0x3d4795,_0x50d47a){_0x50d47a=_0x50d47a||0xc8;return function(_0x56acc1){if(_0x56acc1){return _0x3d4795['status'](_0x50d47a)[_0xcfdf('0x1c')](_0x56acc1);}};}function respondWithFilteredResult(_0x30a38d,_0x4e2b99){return function(_0x1a4170){if(_0x1a4170){var _0x47b3b0=typeof _0x4e2b99[_0xcfdf('0x1d')]===_0xcfdf('0x1e')&&typeof _0x4e2b99[_0xcfdf('0x1f')]==='undefined';var _0x18b252=_0x1a4170['count'];var _0x161b62=_0x47b3b0?0x0:_0x4e2b99['offset'];var _0x373a39=_0x47b3b0?_0x1a4170[_0xcfdf('0x20')]:_0x4e2b99[_0xcfdf('0x1d')]+_0x4e2b99[_0xcfdf('0x1f')];var _0x30f2cf;if(_0x373a39>=_0x18b252){_0x373a39=_0x18b252;_0x30f2cf=0xc8;}else{_0x30f2cf=0xce;}_0x30a38d['status'](_0x30f2cf);return _0x30a38d[_0xcfdf('0x21')](_0xcfdf('0x22'),_0x161b62+'-'+_0x373a39+'/'+_0x18b252)['json'](_0x1a4170);}return null;};}function patchUpdates(_0x28782b){return function(_0x48813e){try{jsonpatch['apply'](_0x48813e,_0x28782b,!![]);}catch(_0x1af681){return BPromise[_0xcfdf('0x23')](_0x1af681);}return _0x48813e['save']();};}function saveUpdates(_0x38a0e3,_0xc3e068){return function(_0x1e901d){if(_0x1e901d){return _0x1e901d[_0xcfdf('0x24')](_0x38a0e3)['then'](function(_0x4f8cea){return _0x4f8cea;});}return null;};}function removeEntity(_0x14685f,_0x5a90ba){return function(_0x1a20a8){if(_0x1a20a8){return _0x1a20a8[_0xcfdf('0x25')]()[_0xcfdf('0x26')](function(){_0x14685f[_0xcfdf('0x1a')](0xcc)[_0xcfdf('0x1b')]();});}};}function handleEntityNotFound(_0x1b1872,_0x1fe1cf){return function(_0x2f7af2){if(!_0x2f7af2){_0x1b1872[_0xcfdf('0x19')](0x194);}return _0x2f7af2;};}function handleError(_0x16c627,_0x4a12cf){_0x4a12cf=_0x4a12cf||0x1f4;return function(_0x3dda28){logger['error'](_0x3dda28[_0xcfdf('0x27')]);if(_0x3dda28['name']){delete _0x3dda28[_0xcfdf('0x28')];}_0x16c627['status'](_0x4a12cf)[_0xcfdf('0x29')](_0x3dda28);};}exports[_0xcfdf('0x2a')]=function(_0x12f8f7,_0x14f967){var _0x22da8b={},_0x57f5d1={},_0x5474f7={'count':0x0,'rows':[]};var _0x2870b5=_['map'](db['DeskField'][_0xcfdf('0x2b')],function(_0xaeb1a0){return{'name':_0xaeb1a0['fieldName'],'type':_0xaeb1a0[_0xcfdf('0x2c')][_0xcfdf('0x2d')]};});_0x57f5d1[_0xcfdf('0x2e')]=_[_0xcfdf('0x2f')](_0x2870b5,_0xcfdf('0x28'));_0x57f5d1[_0xcfdf('0x30')]=_['keys'](_0x12f8f7[_0xcfdf('0x30')]);_0x57f5d1['filters']=_[_0xcfdf('0x31')](_0x57f5d1[_0xcfdf('0x2e')],_0x57f5d1[_0xcfdf('0x30')]);_0x22da8b['attributes']=_[_0xcfdf('0x31')](_0x57f5d1[_0xcfdf('0x2e')],qs[_0xcfdf('0x32')](_0x12f8f7[_0xcfdf('0x30')]['fields']));_0x22da8b[_0xcfdf('0x33')]=_0x22da8b[_0xcfdf('0x33')][_0xcfdf('0x34')]?_0x22da8b[_0xcfdf('0x33')]:_0x57f5d1[_0xcfdf('0x2e')];if(!_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x35')]('nolimit')){_0x22da8b[_0xcfdf('0x1f')]=qs[_0xcfdf('0x1f')](_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x1f')]);_0x22da8b[_0xcfdf('0x1d')]=qs[_0xcfdf('0x1d')](_0x12f8f7['query']['offset']);}_0x22da8b[_0xcfdf('0x36')]=qs[_0xcfdf('0x37')](_0x12f8f7['query'][_0xcfdf('0x37')]);_0x22da8b[_0xcfdf('0x38')]=qs[_0xcfdf('0x39')](_[_0xcfdf('0x3a')](_0x12f8f7[_0xcfdf('0x30')],_0x57f5d1[_0xcfdf('0x39')]),_0x2870b5);if(_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x3b')]){_0x22da8b[_0xcfdf('0x38')]=_[_0xcfdf('0x3c')](_0x22da8b[_0xcfdf('0x38')],{'$or':_[_0xcfdf('0x2f')](_0x2870b5,function(_0x4dc435){if(_0x4dc435[_0xcfdf('0x2c')]!==_0xcfdf('0x3d')){var _0xa194e={};_0xa194e[_0x4dc435[_0xcfdf('0x28')]]={'$like':'%'+_0x12f8f7[_0xcfdf('0x30')][_0xcfdf('0x3b')]+'%'};return _0xa194e;}})});}_0x22da8b=_[_0xcfdf('0x3c')]({},_0x22da8b,_0x12f8f7['options']);var _0x44e90f={'where':_0x22da8b['where']};return db[_0xcfdf('0x3e')][_0xcfdf('0x20')](_0x44e90f)[_0xcfdf('0x26')](function(_0x57666f){_0x5474f7[_0xcfdf('0x20')]=_0x57666f;if(_0x12f8f7['query'][_0xcfdf('0x3f')]){_0x22da8b[_0xcfdf('0x40')]=[{'all':!![]}];}return db[_0xcfdf('0x3e')][_0xcfdf('0x41')](_0x22da8b);})[_0xcfdf('0x26')](function(_0x414a4d){_0x5474f7[_0xcfdf('0x42')]=_0x414a4d;return _0x5474f7;})[_0xcfdf('0x26')](respondWithFilteredResult(_0x14f967,_0x22da8b))[_0xcfdf('0x43')](handleError(_0x14f967,null));};exports[_0xcfdf('0x44')]=function(_0x4eaee4,_0x12a6bf){var _0x315081={'raw':!![],'where':{'id':_0x4eaee4[_0xcfdf('0x45')]['id']}},_0x1df4fb={};_0x1df4fb[_0xcfdf('0x2e')]=_['keys'](db[_0xcfdf('0x3e')][_0xcfdf('0x2b')]);_0x1df4fb[_0xcfdf('0x30')]=_[_0xcfdf('0x46')](_0x4eaee4[_0xcfdf('0x30')]);_0x1df4fb[_0xcfdf('0x39')]=_[_0xcfdf('0x31')](_0x1df4fb['model'],_0x1df4fb[_0xcfdf('0x30')]);_0x315081[_0xcfdf('0x33')]=_[_0xcfdf('0x31')](_0x1df4fb[_0xcfdf('0x2e')],qs['fields'](_0x4eaee4[_0xcfdf('0x30')]['fields']));_0x315081[_0xcfdf('0x33')]=_0x315081[_0xcfdf('0x33')][_0xcfdf('0x34')]?_0x315081[_0xcfdf('0x33')]:_0x1df4fb[_0xcfdf('0x2e')];if(_0x4eaee4[_0xcfdf('0x30')]['includeAll']){_0x315081[_0xcfdf('0x40')]=[{'all':!![]}];}_0x315081=_['merge']({},_0x315081,_0x4eaee4[_0xcfdf('0x47')]);return db[_0xcfdf('0x3e')][_0xcfdf('0x48')](_0x315081)['then'](handleEntityNotFound(_0x12a6bf,null))[_0xcfdf('0x26')](respondWithResult(_0x12a6bf,null))[_0xcfdf('0x43')](handleError(_0x12a6bf,null));};exports[_0xcfdf('0x49')]=function(_0x15d853,_0x20eafa){return db[_0xcfdf('0x3e')][_0xcfdf('0x49')](_0x15d853[_0xcfdf('0x4a')],{})['then'](respondWithResult(_0x20eafa,0xc9))[_0xcfdf('0x43')](handleError(_0x20eafa,null));};exports[_0xcfdf('0x24')]=function(_0x955cca,_0x5615a0){if(_0x955cca[_0xcfdf('0x4a')]['id']){delete _0x955cca[_0xcfdf('0x4a')]['id'];}return db[_0xcfdf('0x3e')]['find']({'where':{'id':_0x955cca[_0xcfdf('0x45')]['id']}})['then'](handleEntityNotFound(_0x5615a0,null))['then'](saveUpdates(_0x955cca[_0xcfdf('0x4a')],null))[_0xcfdf('0x26')](respondWithResult(_0x5615a0,null))[_0xcfdf('0x43')](handleError(_0x5615a0,null));};exports[_0xcfdf('0x25')]=function(_0x1068a6,_0x484f02){return db['DeskField']['find']({'where':{'id':_0x1068a6['params']['id']}})[_0xcfdf('0x26')](handleEntityNotFound(_0x484f02,null))[_0xcfdf('0x26')](removeEntity(_0x484f02,null))['catch'](handleError(_0x484f02,null));}; \ No newline at end of file +var _0xf6fa=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','Content-Range','apply','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0xdc5686,_0x1801fa){var _0x55e1f1=function(_0x50b3c6){while(--_0x50b3c6){_0xdc5686['push'](_0xdc5686['shift']());}};_0x55e1f1(++_0x1801fa);}(_0xf6fa,0x87));var _0xaf6f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf6fa[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf6f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf6f('0x1'));var rp=require(_0xaf6f('0x2'));var moment=require(_0xaf6f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaf6f('0x4'));var path=require(_0xaf6f('0x5'));var sox=require(_0xaf6f('0x6'));var csv=require(_0xaf6f('0x7'));var ejs=require(_0xaf6f('0x8'));var fs=require('fs');var fs_extra=require(_0xaf6f('0x9'));var _=require(_0xaf6f('0xa'));var squel=require(_0xaf6f('0xb'));var crypto=require(_0xaf6f('0xc'));var jsforce=require(_0xaf6f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaf6f('0x7'));var querystring=require(_0xaf6f('0xe'));var Papa=require(_0xaf6f('0xf'));var Redis=require(_0xaf6f('0x10'));var authService=require(_0xaf6f('0x11'));var qs=require(_0xaf6f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaf6f('0x13'));var logger=require(_0xaf6f('0x14'))(_0xaf6f('0x15'));var utils=require(_0xaf6f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaf6f('0x17'))['db'];function respondWithStatusCode(_0x33230c,_0x35ebb5){_0x35ebb5=_0x35ebb5||0xcc;return function(_0x4fca18){if(_0x4fca18){return _0x33230c['sendStatus'](_0x35ebb5);}return _0x33230c['status'](_0x35ebb5)['end']();};}function respondWithResult(_0x4073cc,_0x2116ef){_0x2116ef=_0x2116ef||0xc8;return function(_0x527445){if(_0x527445){return _0x4073cc[_0xaf6f('0x18')](_0x2116ef)[_0xaf6f('0x19')](_0x527445);}};}function respondWithFilteredResult(_0x4480e7,_0x326218){return function(_0x5d50d8){if(_0x5d50d8){var _0x16c681=typeof _0x326218[_0xaf6f('0x1a')]===_0xaf6f('0x1b')&&typeof _0x326218['limit']===_0xaf6f('0x1b');var _0x24e054=_0x5d50d8[_0xaf6f('0x1c')];var _0xdcd3b7=_0x16c681?0x0:_0x326218[_0xaf6f('0x1a')];var _0x1fc57a=_0x16c681?_0x5d50d8[_0xaf6f('0x1c')]:_0x326218[_0xaf6f('0x1a')]+_0x326218['limit'];var _0x14577a;if(_0x1fc57a>=_0x24e054){_0x1fc57a=_0x24e054;_0x14577a=0xc8;}else{_0x14577a=0xce;}_0x4480e7[_0xaf6f('0x18')](_0x14577a);return _0x4480e7['set'](_0xaf6f('0x1d'),_0xdcd3b7+'-'+_0x1fc57a+'/'+_0x24e054)[_0xaf6f('0x19')](_0x5d50d8);}return null;};}function patchUpdates(_0x32f1a7){return function(_0x9ea48d){try{jsonpatch[_0xaf6f('0x1e')](_0x9ea48d,_0x32f1a7,!![]);}catch(_0x314ae1){return BPromise['reject'](_0x314ae1);}return _0x9ea48d['save']();};}function saveUpdates(_0x3effef,_0x276b33){return function(_0x146561){if(_0x146561){return _0x146561[_0xaf6f('0x1f')](_0x3effef)[_0xaf6f('0x20')](function(_0x3fcb5f){return _0x3fcb5f;});}return null;};}function removeEntity(_0x14f96c,_0x154166){return function(_0x4bd1f7){if(_0x4bd1f7){return _0x4bd1f7[_0xaf6f('0x21')]()[_0xaf6f('0x20')](function(){_0x14f96c[_0xaf6f('0x18')](0xcc)[_0xaf6f('0x22')]();});}};}function handleEntityNotFound(_0x3a68d2,_0x14b03b){return function(_0x225832){if(!_0x225832){_0x3a68d2[_0xaf6f('0x23')](0x194);}return _0x225832;};}function handleError(_0x151f06,_0x11109e){_0x11109e=_0x11109e||0x1f4;return function(_0x48e3a7){logger[_0xaf6f('0x24')](_0x48e3a7[_0xaf6f('0x25')]);if(_0x48e3a7[_0xaf6f('0x26')]){delete _0x48e3a7['name'];}_0x151f06[_0xaf6f('0x18')](_0x11109e)[_0xaf6f('0x27')](_0x48e3a7);};}exports[_0xaf6f('0x28')]=function(_0x4be3ca,_0x288bc8){var _0x4799d9={},_0x755f70={},_0x316362={'count':0x0,'rows':[]};var _0x4bd046=_[_0xaf6f('0x29')](db[_0xaf6f('0x2a')][_0xaf6f('0x2b')],function(_0x546460){return{'name':_0x546460[_0xaf6f('0x2c')],'type':_0x546460[_0xaf6f('0x2d')][_0xaf6f('0x2e')]};});_0x755f70[_0xaf6f('0x2f')]=_['map'](_0x4bd046,'name');_0x755f70[_0xaf6f('0x30')]=_[_0xaf6f('0x31')](_0x4be3ca[_0xaf6f('0x30')]);_0x755f70['filters']=_[_0xaf6f('0x32')](_0x755f70[_0xaf6f('0x2f')],_0x755f70['query']);_0x4799d9['attributes']=_[_0xaf6f('0x32')](_0x755f70[_0xaf6f('0x2f')],qs[_0xaf6f('0x33')](_0x4be3ca['query'][_0xaf6f('0x33')]));_0x4799d9['attributes']=_0x4799d9[_0xaf6f('0x34')][_0xaf6f('0x35')]?_0x4799d9[_0xaf6f('0x34')]:_0x755f70[_0xaf6f('0x2f')];if(!_0x4be3ca[_0xaf6f('0x30')][_0xaf6f('0x36')]('nolimit')){_0x4799d9[_0xaf6f('0x37')]=qs['limit'](_0x4be3ca[_0xaf6f('0x30')][_0xaf6f('0x37')]);_0x4799d9[_0xaf6f('0x1a')]=qs[_0xaf6f('0x1a')](_0x4be3ca[_0xaf6f('0x30')]['offset']);}_0x4799d9['order']=qs[_0xaf6f('0x38')](_0x4be3ca[_0xaf6f('0x30')][_0xaf6f('0x38')]);_0x4799d9[_0xaf6f('0x39')]=qs[_0xaf6f('0x3a')](_[_0xaf6f('0x3b')](_0x4be3ca[_0xaf6f('0x30')],_0x755f70[_0xaf6f('0x3a')]),_0x4bd046);if(_0x4be3ca['query'][_0xaf6f('0x3c')]){_0x4799d9[_0xaf6f('0x39')]=_[_0xaf6f('0x3d')](_0x4799d9[_0xaf6f('0x39')],{'$or':_[_0xaf6f('0x29')](_0x4bd046,function(_0x45447b){if(_0x45447b['type']!==_0xaf6f('0x3e')){var _0x1e3504={};_0x1e3504[_0x45447b[_0xaf6f('0x26')]]={'$like':'%'+_0x4be3ca['query']['filter']+'%'};return _0x1e3504;}})});}_0x4799d9=_[_0xaf6f('0x3d')]({},_0x4799d9,_0x4be3ca[_0xaf6f('0x3f')]);var _0x34ca13={'where':_0x4799d9[_0xaf6f('0x39')]};return db[_0xaf6f('0x2a')][_0xaf6f('0x1c')](_0x34ca13)[_0xaf6f('0x20')](function(_0x48e6d6){_0x316362[_0xaf6f('0x1c')]=_0x48e6d6;if(_0x4be3ca[_0xaf6f('0x30')][_0xaf6f('0x40')]){_0x4799d9[_0xaf6f('0x41')]=[{'all':!![]}];}return db[_0xaf6f('0x2a')][_0xaf6f('0x42')](_0x4799d9);})[_0xaf6f('0x20')](function(_0x4f5afc){_0x316362[_0xaf6f('0x43')]=_0x4f5afc;return _0x316362;})[_0xaf6f('0x20')](respondWithFilteredResult(_0x288bc8,_0x4799d9))[_0xaf6f('0x44')](handleError(_0x288bc8,null));};exports[_0xaf6f('0x45')]=function(_0x115e20,_0x1b7013){var _0x4cd81c={'raw':!![],'where':{'id':_0x115e20[_0xaf6f('0x46')]['id']}},_0x14859c={};_0x14859c['model']=_[_0xaf6f('0x31')](db[_0xaf6f('0x2a')][_0xaf6f('0x2b')]);_0x14859c[_0xaf6f('0x30')]=_[_0xaf6f('0x31')](_0x115e20['query']);_0x14859c[_0xaf6f('0x3a')]=_[_0xaf6f('0x32')](_0x14859c[_0xaf6f('0x2f')],_0x14859c[_0xaf6f('0x30')]);_0x4cd81c[_0xaf6f('0x34')]=_[_0xaf6f('0x32')](_0x14859c['model'],qs[_0xaf6f('0x33')](_0x115e20['query'][_0xaf6f('0x33')]));_0x4cd81c[_0xaf6f('0x34')]=_0x4cd81c[_0xaf6f('0x34')][_0xaf6f('0x35')]?_0x4cd81c[_0xaf6f('0x34')]:_0x14859c[_0xaf6f('0x2f')];if(_0x115e20['query']['includeAll']){_0x4cd81c[_0xaf6f('0x41')]=[{'all':!![]}];}_0x4cd81c=_[_0xaf6f('0x3d')]({},_0x4cd81c,_0x115e20[_0xaf6f('0x3f')]);return db[_0xaf6f('0x2a')][_0xaf6f('0x47')](_0x4cd81c)[_0xaf6f('0x20')](handleEntityNotFound(_0x1b7013,null))[_0xaf6f('0x20')](respondWithResult(_0x1b7013,null))['catch'](handleError(_0x1b7013,null));};exports[_0xaf6f('0x48')]=function(_0x57c95c,_0x382091){return db[_0xaf6f('0x2a')]['create'](_0x57c95c['body'],{})[_0xaf6f('0x20')](respondWithResult(_0x382091,0xc9))['catch'](handleError(_0x382091,null));};exports[_0xaf6f('0x1f')]=function(_0x17da70,_0x1f075a){if(_0x17da70[_0xaf6f('0x49')]['id']){delete _0x17da70['body']['id'];}return db[_0xaf6f('0x2a')][_0xaf6f('0x47')]({'where':{'id':_0x17da70[_0xaf6f('0x46')]['id']}})[_0xaf6f('0x20')](handleEntityNotFound(_0x1f075a,null))[_0xaf6f('0x20')](saveUpdates(_0x17da70[_0xaf6f('0x49')],null))[_0xaf6f('0x20')](respondWithResult(_0x1f075a,null))['catch'](handleError(_0x1f075a,null));};exports[_0xaf6f('0x21')]=function(_0x38ca6d,_0xa91a6c){return db[_0xaf6f('0x2a')][_0xaf6f('0x47')]({'where':{'id':_0x38ca6d[_0xaf6f('0x46')]['id']}})[_0xaf6f('0x20')](handleEntityNotFound(_0xa91a6c,null))[_0xaf6f('0x20')](removeEntity(_0xa91a6c,null))[_0xaf6f('0x44')](handleError(_0xa91a6c,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index b66af9a..85f9a5b 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 _0x38a3=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x38a3,0x11e));var _0x338a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x38a3[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x338a('0x0'));var util=require(_0x338a('0x1'));var logger=require(_0x338a('0x2'))(_0x338a('0x3'));var moment=require(_0x338a('0x4'));var BPromise=require(_0x338a('0x5'));var rp=require(_0x338a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x338a('0x7'));var config=require(_0x338a('0x8'));var attributes=require(_0x338a('0x9'));module[_0x338a('0xa')]=function(_0x5eb282,_0x3f1676){return _0x5eb282[_0x338a('0xb')](_0x338a('0xc'),attributes,{'tableName':_0x338a('0xd'),'paranoid':![],'indexes':[{'name':_0x338a('0xe'),'fields':['idField',_0x338a('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e3c=['exports','define','DeskField','desk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x516f5a,_0x345383){var _0x5c253e=function(_0x4910c){while(--_0x4910c){_0x516f5a['push'](_0x516f5a['shift']());}};_0x5c253e(++_0x345383);}(_0x0e3c,0x16e));var _0xc0e3=function(_0x4d9c5c,_0x13a932){_0x4d9c5c=_0x4d9c5c-0x0;var _0x2ac641=_0x0e3c[_0x4d9c5c];return _0x2ac641;};'use strict';var _=require(_0xc0e3('0x0'));var util=require('util');var logger=require(_0xc0e3('0x1'))(_0xc0e3('0x2'));var moment=require(_0xc0e3('0x3'));var BPromise=require('bluebird');var rp=require(_0xc0e3('0x4'));var fs=require('fs');var path=require(_0xc0e3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xc0e3('0x6')]=function(_0x5e2138,_0x2eb254){return _0x5e2138[_0xc0e3('0x7')](_0xc0e3('0x8'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xc0e3('0x9'),'fields':[_0xc0e3('0xa'),_0xc0e3('0xb')],'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 599d294..333ee1a 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 _0x47c0=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x47c0,0x9a));var _0x047c=function(_0x5dee77,_0x4bec32){_0x5dee77=_0x5dee77-0x0;var _0x37356a=_0x47c0[_0x5dee77];return _0x37356a;};'use strict';var _=require(_0x047c('0x0'));var util=require('util');var moment=require(_0x047c('0x1'));var BPromise=require(_0x047c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x047c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x047c('0x4'));var logger=require(_0x047c('0x5'))(_0x047c('0x6'));var config=require(_0x047c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x047c('0x8')][_0x047c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eb14f,_0x22da08,_0x58eacc){return new BPromise(function(_0x18168b,_0x28c7e9){return client[_0x047c('0xa')](_0x2eb14f,_0x58eacc)[_0x047c('0xb')](function(_0x35f293){logger[_0x047c('0xc')]('DeskField,\x20%s,\x20%s',_0x22da08,_0x047c('0xd'));logger['debug'](_0x047c('0xe'),_0x22da08,_0x047c('0xd'),JSON[_0x047c('0xf')](_0x35f293));if(_0x35f293[_0x047c('0x10')]){if(_0x35f293['error'][_0x047c('0x11')]===0x1f4){logger[_0x047c('0x10')](_0x047c('0x12'),_0x22da08,_0x35f293[_0x047c('0x10')][_0x047c('0x13')]);return _0x28c7e9(_0x35f293[_0x047c('0x10')][_0x047c('0x13')]);}logger[_0x047c('0x10')](_0x047c('0x12'),_0x22da08,_0x35f293[_0x047c('0x10')]['message']);return _0x18168b(_0x35f293['error'][_0x047c('0x13')]);}else{logger[_0x047c('0xc')](_0x047c('0x12'),_0x22da08,'request\x20sent');_0x18168b(_0x35f293['result'][_0x047c('0x13')]);}})[_0x047c('0x14')](function(_0x2b23aa){logger['error'](_0x047c('0x12'),_0x22da08,_0x2b23aa);_0x28c7e9(_0x2b23aa);});});} \ No newline at end of file +var _0x7ade=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7ade,0xf7));var _0xe7ad=function(_0x2f5fae,_0x555535){_0x2f5fae=_0x2f5fae-0x0;var _0x3eb6b8=_0x7ade[_0x2f5fae];return _0x3eb6b8;};'use strict';var _=require(_0xe7ad('0x0'));var util=require(_0xe7ad('0x1'));var moment=require(_0xe7ad('0x2'));var BPromise=require(_0xe7ad('0x3'));var rs=require(_0xe7ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7ad('0x5'))['db'];var utils=require(_0xe7ad('0x6'));var logger=require('../../config/logger')(_0xe7ad('0x7'));var config=require(_0xe7ad('0x8'));var jayson=require(_0xe7ad('0x9'));var client=jayson[_0xe7ad('0xa')][_0xe7ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43ea4d,_0x2929a1,_0x2149f8){return new BPromise(function(_0x21b7ca,_0x465b5b){return client[_0xe7ad('0xc')](_0x43ea4d,_0x2149f8)[_0xe7ad('0xd')](function(_0x45d8cf){logger[_0xe7ad('0xe')](_0xe7ad('0xf'),_0x2929a1,_0xe7ad('0x10'));logger[_0xe7ad('0x11')](_0xe7ad('0x12'),_0x2929a1,_0xe7ad('0x10'),JSON[_0xe7ad('0x13')](_0x45d8cf));if(_0x45d8cf[_0xe7ad('0x14')]){if(_0x45d8cf[_0xe7ad('0x14')][_0xe7ad('0x15')]===0x1f4){logger[_0xe7ad('0x14')](_0xe7ad('0xf'),_0x2929a1,_0x45d8cf[_0xe7ad('0x14')][_0xe7ad('0x16')]);return _0x465b5b(_0x45d8cf['error']['message']);}logger['error'](_0xe7ad('0xf'),_0x2929a1,_0x45d8cf[_0xe7ad('0x14')][_0xe7ad('0x16')]);return _0x21b7ca(_0x45d8cf[_0xe7ad('0x14')][_0xe7ad('0x16')]);}else{logger['info'](_0xe7ad('0xf'),_0x2929a1,'request\x20sent');_0x21b7ca(_0x45d8cf[_0xe7ad('0x17')][_0xe7ad('0x16')]);}})[_0xe7ad('0x18')](function(_0x14c959){logger[_0xe7ad('0x14')]('DeskField,\x20%s,\x20%s',_0x2929a1,_0x14c959);_0x465b5b(_0x14c959);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index fe6b987..202c75d 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 _0x4ad5=['getFields','create','post','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields'];(function(_0x3d536f,_0x58cedd){var _0x277ee8=function(_0x4df154){while(--_0x4df154){_0x3d536f['push'](_0x3d536f['shift']());}};_0x277ee8(++_0x58cedd);}(_0x4ad5,0x18e));var _0x54ad=function(_0x31f4cc,_0x22ddd3){_0x31f4cc=_0x31f4cc-0x0;var _0x43ad5d=_0x4ad5[_0x31f4cc];return _0x43ad5d;};'use strict';var multer=require('multer');var util=require(_0x54ad('0x0'));var path=require(_0x54ad('0x1'));var timeout=require(_0x54ad('0x2'));var express=require('express');var router=express[_0x54ad('0x3')]();var fs_extra=require(_0x54ad('0x4'));var auth=require(_0x54ad('0x5'));var interaction=require(_0x54ad('0x6'));var config=require(_0x54ad('0x7'));var controller=require(_0x54ad('0x8'));router[_0x54ad('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x54ad('0x9')](_0x54ad('0xa'),auth['isAuthenticated'](),controller[_0x54ad('0xb')]);router[_0x54ad('0x9')](_0x54ad('0xc'),auth[_0x54ad('0xd')](),controller[_0x54ad('0xe')]);router[_0x54ad('0x9')](_0x54ad('0xf'),auth[_0x54ad('0xd')](),controller[_0x54ad('0x10')]);router['post']('/',auth[_0x54ad('0xd')](),controller[_0x54ad('0x11')]);router[_0x54ad('0x12')](_0x54ad('0xc'),auth[_0x54ad('0xd')](),controller['addConfiguration']);router['put'](_0x54ad('0xa'),auth['isAuthenticated'](),controller[_0x54ad('0x13')]);router[_0x54ad('0x14')](_0x54ad('0xa'),auth['isAuthenticated'](),controller[_0x54ad('0x15')]);module[_0x54ad('0x16')]=router; \ No newline at end of file +var _0x021c=['/:id/configurations','/:id/fields','getFields','create','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x337749,_0x198b2){var _0x206454=function(_0x216cef){while(--_0x216cef){_0x337749['push'](_0x337749['shift']());}};_0x206454(++_0x198b2);}(_0x021c,0x143));var _0xc021=function(_0x5b1394,_0x17f08d){_0x5b1394=_0x5b1394-0x0;var _0x483150=_0x021c[_0x5b1394];return _0x483150;};'use strict';var multer=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var path=require(_0xc021('0x2'));var timeout=require(_0xc021('0x3'));var express=require(_0xc021('0x4'));var router=express[_0xc021('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc021('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc021('0x7'));var controller=require('./intDynamics365Account.controller');router[_0xc021('0x8')]('/',auth[_0xc021('0x9')](),controller[_0xc021('0xa')]);router['get'](_0xc021('0xb'),auth[_0xc021('0x9')](),controller[_0xc021('0xc')]);router[_0xc021('0x8')](_0xc021('0xd'),auth[_0xc021('0x9')](),controller['getConfigurations']);router['get'](_0xc021('0xe'),auth[_0xc021('0x9')](),controller[_0xc021('0xf')]);router['post']('/',auth[_0xc021('0x9')](),controller[_0xc021('0x10')]);router[_0xc021('0x11')](_0xc021('0xd'),auth[_0xc021('0x9')](),controller['addConfiguration']);router['put'](_0xc021('0xb'),auth[_0xc021('0x9')](),controller[_0xc021('0x12')]);router[_0xc021('0x13')](_0xc021('0xb'),auth[_0xc021('0x9')](),controller['destroy']);module[_0xc021('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 4ed49dd..32745f5 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 _0x50d0=['STRING','BOOLEAN','sequelize'];(function(_0x57e309,_0x1b7f1f){var _0x5aa5c2=function(_0x274fcb){while(--_0x274fcb){_0x57e309['push'](_0x57e309['shift']());}};_0x5aa5c2(++_0x1b7f1f);}(_0x50d0,0x101));var _0x050d=function(_0x2c7c27,_0x945979){_0x2c7c27=_0x2c7c27-0x0;var _0x38a3ce=_0x50d0[_0x2c7c27];return _0x38a3ce;};'use strict';var Sequelize=require(_0x050d('0x0'));module['exports']={'name':{'type':Sequelize[_0x050d('0x1')]},'username':{'type':Sequelize[_0x050d('0x1')]},'password':{'type':Sequelize[_0x050d('0x1')]},'remoteUri':{'type':Sequelize[_0x050d('0x1')]},'tenantId':{'type':Sequelize[_0x050d('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x050d('0x1')]},'serverUrl':{'type':Sequelize[_0x050d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x050d('0x1')]},'modernAuthentication':{'type':Sequelize[_0x050d('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb5bb=['STRING','sequelize','exports'];(function(_0x3e5332,_0x10d398){var _0x17744f=function(_0x2a0e4e){while(--_0x2a0e4e){_0x3e5332['push'](_0x3e5332['shift']());}};_0x17744f(++_0x10d398);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x21b699,_0x4d8635){_0x21b699=_0x21b699-0x0;var _0x1051b0=_0xb5bb[_0x21b699];return _0x1051b0;};'use strict';var Sequelize=require(_0xbb5b('0x0'));module[_0xbb5b('0x1')]={'name':{'type':Sequelize[_0xbb5b('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xbb5b('0x2')]},'remoteUri':{'type':Sequelize[_0xbb5b('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'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 564f4c1..8f72649 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 _0xd878=['contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','tenantId','clientSecret','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','password','GET','4.0','MetadataId','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','offset','undefined','limit','count','status','set','json','then','destroy','end','sendStatus','error','stack','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','intersection','includeAll','find','create','body','params','getConfigurations','findOne','sort','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','Incident','customerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xd878,0x118));var _0x8d87=function(_0xd4fd50,_0x40f63a){_0xd4fd50=_0xd4fd50-0x0;var _0x1efda2=_0xd878[_0xd4fd50];return _0x1efda2;};'use strict';var rp=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var _=require(_0x8d87('0x2'));var qs=require(_0x8d87('0x3'));var logger=require(_0x8d87('0x4'))(_0x8d87('0x5'));var db=require(_0x8d87('0x6'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithResult(_0x4e8e8d,_0x508913){_0x508913=_0x508913||0xc8;return function(_0x39829a){if(_0x39829a){return _0x4e8e8d['status'](_0x508913)['json'](_0x39829a);}};}function respondWithFilteredResult(_0x456998,_0x1b504e){return function(_0xcb4dae){if(_0xcb4dae){var _0x1eba92=typeof _0x1b504e[_0x8d87('0x7')]===_0x8d87('0x8')&&typeof _0x1b504e[_0x8d87('0x9')]===_0x8d87('0x8');var _0xf6aa49=_0xcb4dae['count'];var _0x207ac3=_0x1eba92?0x0:_0x1b504e['offset'];var _0x562e77=_0x1eba92?_0xcb4dae[_0x8d87('0xa')]:_0x1b504e[_0x8d87('0x7')]+_0x1b504e[_0x8d87('0x9')];var _0x10bb8f;if(_0x562e77>=_0xf6aa49){_0x562e77=_0xf6aa49;_0x10bb8f=0xc8;}else{_0x10bb8f=0xce;}_0x456998[_0x8d87('0xb')](_0x10bb8f);return _0x456998[_0x8d87('0xc')]('Content-Range',_0x207ac3+'-'+_0x562e77+'/'+_0xf6aa49)[_0x8d87('0xd')](_0xcb4dae);}return null;};}function saveUpdates(_0x5f0962){return function(_0xbe2fa0){if(_0xbe2fa0){return _0xbe2fa0['update'](_0x5f0962)[_0x8d87('0xe')](function(_0x98b85f){return _0x98b85f;});}return null;};}function removeEntity(_0x33c197){return function(_0x5703c3){if(_0x5703c3){return _0x5703c3[_0x8d87('0xf')]()[_0x8d87('0xe')](function(){_0x33c197[_0x8d87('0xb')](0xcc)[_0x8d87('0x10')]();});}};}function handleEntityNotFound(_0x5954d3){return function(_0x1d6695){if(!_0x1d6695){_0x5954d3[_0x8d87('0x11')](0x194);}return _0x1d6695;};}function handleError(_0x262833,_0x21d1dc){_0x21d1dc=_0x21d1dc||0x1f4;return function(_0x520df5){logger[_0x8d87('0x12')](_0x520df5[_0x8d87('0x13')]);if(_0x520df5['name']){delete _0x520df5['name'];}_0x262833[_0x8d87('0xb')](_0x21d1dc)[_0x8d87('0x14')](_0x520df5);};}exports[_0x8d87('0x15')]=function(_0x4fc4c6,_0x4380e1){var _0x3a3678={},_0x13df00={},_0xde0183={'count':0x0,'rows':[]};var _0x1e9555=_[_0x8d87('0x16')](db[_0x8d87('0x17')][_0x8d87('0x18')],function(_0x374ee1){return{'name':_0x374ee1[_0x8d87('0x19')],'type':_0x374ee1[_0x8d87('0x1a')][_0x8d87('0x1b')]};});_0x13df00[_0x8d87('0x1c')]=_[_0x8d87('0x16')](_0x1e9555,_0x8d87('0x1d'));_0x13df00[_0x8d87('0x1e')]=_[_0x8d87('0x1f')](_0x4fc4c6[_0x8d87('0x1e')]);_0x13df00[_0x8d87('0x20')]=_['intersection'](_0x13df00[_0x8d87('0x1c')],_0x13df00[_0x8d87('0x1e')]);_0x3a3678[_0x8d87('0x21')]=_['intersection'](_0x13df00[_0x8d87('0x1c')],qs[_0x8d87('0x22')](_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x22')]));_0x3a3678[_0x8d87('0x21')]=_0x3a3678[_0x8d87('0x21')][_0x8d87('0x23')]?_0x3a3678[_0x8d87('0x21')]:_0x13df00[_0x8d87('0x1c')];if(!_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x24')](_0x8d87('0x25'))){_0x3a3678[_0x8d87('0x9')]=qs[_0x8d87('0x9')](_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x9')]);_0x3a3678[_0x8d87('0x7')]=qs[_0x8d87('0x7')](_0x4fc4c6[_0x8d87('0x1e')][_0x8d87('0x7')]);}_0x3a3678[_0x8d87('0x26')]=qs['sort'](_0x4fc4c6['query']['sort']);_0x3a3678[_0x8d87('0x27')]=qs[_0x8d87('0x20')](_[_0x8d87('0x28')](_0x4fc4c6[_0x8d87('0x1e')],_0x13df00['filters']),_0x1e9555);if(_0x4fc4c6[_0x8d87('0x1e')]['filter']){_0x3a3678['where']=_[_0x8d87('0x29')](_0x3a3678[_0x8d87('0x27')],{'$or':_[_0x8d87('0x16')](_0x1e9555,function(_0x1bf154){if(_0x1bf154[_0x8d87('0x1a')]!==_0x8d87('0x2a')){var _0x3701de={};_0x3701de[_0x1bf154[_0x8d87('0x1d')]]={'$like':'%'+_0x4fc4c6['query'][_0x8d87('0x2b')]+'%'};return _0x3701de;}})});}_0x3a3678=_[_0x8d87('0x29')]({},_0x3a3678,_0x4fc4c6[_0x8d87('0x2c')]);var _0x41fc95={'where':_0x3a3678['where']};return db[_0x8d87('0x17')][_0x8d87('0xa')](_0x41fc95)['then'](function(_0x51ccd3){_0xde0183[_0x8d87('0xa')]=_0x51ccd3;if(_0x4fc4c6[_0x8d87('0x1e')]['includeAll']){_0x3a3678[_0x8d87('0x2d')]=[{'all':!![]}];}return db[_0x8d87('0x17')]['findAll'](_0x3a3678);})[_0x8d87('0xe')](function(_0x448c5d){_0xde0183[_0x8d87('0x2e')]=_0x448c5d;return _0xde0183;})['then'](respondWithFilteredResult(_0x4380e1,_0x3a3678))[_0x8d87('0x2f')](handleError(_0x4380e1,null));};exports['show']=function(_0x7f5d73,_0x157647){var _0x19fe1f={'raw':![],'where':{'id':_0x7f5d73['params']['id']}},_0x30460a={};_0x30460a[_0x8d87('0x1c')]=_[_0x8d87('0x1f')](db['Dynamics365Account']['rawAttributes']);_0x30460a['query']=_['keys'](_0x7f5d73[_0x8d87('0x1e')]);_0x30460a[_0x8d87('0x20')]=_[_0x8d87('0x30')](_0x30460a['model'],_0x30460a[_0x8d87('0x1e')]);_0x19fe1f[_0x8d87('0x21')]=_['intersection'](_0x30460a['model'],qs[_0x8d87('0x22')](_0x7f5d73[_0x8d87('0x1e')]['fields']));_0x19fe1f[_0x8d87('0x21')]=_0x19fe1f[_0x8d87('0x21')][_0x8d87('0x23')]?_0x19fe1f['attributes']:_0x30460a[_0x8d87('0x1c')];if(_0x7f5d73[_0x8d87('0x1e')][_0x8d87('0x31')]){_0x19fe1f[_0x8d87('0x2d')]=[{'all':!![]}];}_0x19fe1f=_[_0x8d87('0x29')]({},_0x19fe1f,_0x7f5d73[_0x8d87('0x2c')]);return db[_0x8d87('0x17')][_0x8d87('0x32')](_0x19fe1f)['then'](handleEntityNotFound(_0x157647,null))[_0x8d87('0xe')](respondWithResult(_0x157647,null))[_0x8d87('0x2f')](handleError(_0x157647,null));};exports[_0x8d87('0x33')]=function(_0x2bbd46,_0x3b5e8e){return db[_0x8d87('0x17')][_0x8d87('0x33')](_0x2bbd46[_0x8d87('0x34')],{})[_0x8d87('0xe')](respondWithResult(_0x3b5e8e,0xc9))[_0x8d87('0x2f')](handleError(_0x3b5e8e,null));};exports['update']=function(_0x4419a9,_0x1877fe){if(_0x4419a9[_0x8d87('0x34')]['id']){delete _0x4419a9[_0x8d87('0x34')]['id'];}return db[_0x8d87('0x17')][_0x8d87('0x32')]({'where':{'id':_0x4419a9[_0x8d87('0x35')]['id']}})[_0x8d87('0xe')](handleEntityNotFound(_0x1877fe,null))[_0x8d87('0xe')](saveUpdates(_0x4419a9[_0x8d87('0x34')],null))[_0x8d87('0xe')](respondWithResult(_0x1877fe,null))['catch'](handleError(_0x1877fe,null));};exports[_0x8d87('0xf')]=function(_0x53319e,_0x42f4b6){return db[_0x8d87('0x17')][_0x8d87('0x32')]({'where':{'id':_0x53319e['params']['id']}})[_0x8d87('0xe')](handleEntityNotFound(_0x42f4b6,null))[_0x8d87('0xe')](removeEntity(_0x42f4b6,null))['catch'](handleError(_0x42f4b6,null));};exports[_0x8d87('0x36')]=function(_0x322e63,_0x495905){var _0x17d9d6={};var _0x14b5d5={};var _0x1a8d16;var _0x28a297;return db[_0x8d87('0x17')][_0x8d87('0x37')]({'where':{'id':_0x322e63[_0x8d87('0x35')]['id']}})[_0x8d87('0xe')](handleEntityNotFound(_0x495905,null))[_0x8d87('0xe')](function(_0x4b73bd){if(_0x4b73bd){_0x1a8d16=_0x4b73bd;_0x14b5d5[_0x8d87('0x1c')]=_[_0x8d87('0x1f')](db['Dynamics365Configuration'][_0x8d87('0x18')]);_0x14b5d5[_0x8d87('0x1e')]=_[_0x8d87('0x1f')](_0x322e63[_0x8d87('0x1e')]);_0x14b5d5[_0x8d87('0x20')]=_['intersection'](_0x14b5d5[_0x8d87('0x1c')],_0x14b5d5[_0x8d87('0x1e')]);_0x17d9d6[_0x8d87('0x21')]=_['intersection'](_0x14b5d5[_0x8d87('0x1c')],qs[_0x8d87('0x22')](_0x322e63['query'][_0x8d87('0x22')]));_0x17d9d6[_0x8d87('0x21')]=_0x17d9d6['attributes']['length']?_0x17d9d6[_0x8d87('0x21')]:_0x14b5d5[_0x8d87('0x1c')];_0x17d9d6[_0x8d87('0x26')]=qs[_0x8d87('0x38')](_0x322e63[_0x8d87('0x1e')][_0x8d87('0x38')]);_0x17d9d6[_0x8d87('0x27')]=qs['filters'](_['pick'](_0x322e63[_0x8d87('0x1e')],_0x14b5d5['filters']));if(_0x322e63[_0x8d87('0x1e')][_0x8d87('0x2b')]){_0x17d9d6[_0x8d87('0x27')]=_[_0x8d87('0x29')](_0x17d9d6[_0x8d87('0x27')],{'$or':_[_0x8d87('0x16')](_0x17d9d6[_0x8d87('0x21')],function(_0x5649ca){var _0x4fd82f={};_0x4fd82f[_0x5649ca]={'$like':'%'+_0x322e63[_0x8d87('0x1e')]['filter']+'%'};return _0x4fd82f;})});}_0x17d9d6=_['merge']({},_0x17d9d6,_0x322e63['options']);return _0x1a8d16[_0x8d87('0x36')](_0x17d9d6);}})[_0x8d87('0xe')](function(_0x4c9124){if(_0x4c9124){_0x28a297=_0x4c9124['length'];if(!_0x322e63[_0x8d87('0x1e')][_0x8d87('0x24')]('nolimit')){_0x17d9d6['limit']=qs[_0x8d87('0x9')](_0x322e63[_0x8d87('0x1e')]['limit']);_0x17d9d6[_0x8d87('0x7')]=qs[_0x8d87('0x7')](_0x322e63[_0x8d87('0x1e')][_0x8d87('0x7')]);}return _0x1a8d16[_0x8d87('0x36')](_0x17d9d6);}})[_0x8d87('0xe')](function(_0x3e6a79){if(_0x3e6a79){return _0x3e6a79?{'count':_0x28a297,'rows':_0x3e6a79}:null;}})[_0x8d87('0xe')](respondWithResult(_0x495905,null))[_0x8d87('0x2f')](handleError(_0x495905,null));};exports['addConfiguration']=function(_0x2d8f83,_0x6b6975){if(_0x2d8f83['body']['id']){delete _0x2d8f83[_0x8d87('0x34')]['id'];}return db[_0x8d87('0x17')][_0x8d87('0x37')]({'where':{'id':_0x2d8f83['params']['id']}})['then'](handleEntityNotFound(_0x6b6975,null))['then'](function(_0x16ed3f){if(_0x16ed3f){_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x39')]=_0x16ed3f['id'];_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x3a')]=integrations[_0x8d87('0x3b')](_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x3c')],_0x2d8f83['body']['type']);_0x2d8f83['body']['Descriptions']=integrations[_0x8d87('0x3d')](_0x2d8f83[_0x8d87('0x34')][_0x8d87('0x3c')],_0x2d8f83['body'][_0x8d87('0x1a')]);return db[_0x8d87('0x3e')][_0x8d87('0x33')](_0x2d8f83[_0x8d87('0x34')],{'include':[{'model':db[_0x8d87('0x3f')],'as':_0x8d87('0x3a')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x8d87('0xe')](respondWithResult(_0x6b6975,null))[_0x8d87('0x2f')](handleError(_0x6b6975,null));};function sanitizeRemoteUri(_0x5549f4){var _0x5da096=_0x5549f4[_0x8d87('0x40')](-0x1);if(_0x5da096==='/')return _0x5549f4[_0x8d87('0x41')](0x0,_0x5549f4[_0x8d87('0x42')](_0x5da096));return _0x5549f4;}function getWebApiUrl(_0x5e3cac){return util[_0x8d87('0x43')](_0x8d87('0x44'),_0x5e3cac);}exports[_0x8d87('0x45')]=function(_0x5e04c0,_0x2e09ca){var _0x452540=_0x5e04c0[_0x8d87('0x1e')]['ticketType'];var _0x115fde=_0x452540==='incident'?_0x8d87('0x46'):'PhoneCall';var _0x2431ae='';var _0x317c24='';var _0x1ede24='';var _0x5eb411='';var _0xb4624='';var _0x8e043d='';var _0xc8186='';var _0x50198b='';var _0x1dc39b=['title','description',_0x8d87('0x47'),'ownerid',_0x8d87('0x48'),'subject',_0x8d87('0x49'),_0x8d87('0x4a'),_0x8d87('0x4b'),'phonecall_activity_parties'];var _0x196a63=[_0x8d87('0x4c'),_0x8d87('0x4d'),_0x8d87('0x4e'),_0x8d87('0x4f'),_0x8d87('0x50'),_0x8d87('0x51'),_0x8d87('0x52'),_0x8d87('0x53'),_0x8d87('0x54'),'createdbyexternalpartyyominame',_0x8d87('0x55'),'createdbyyominame',_0x8d87('0x56'),'createdonbehalfbyname',_0x8d87('0x57'),'customeridname',_0x8d87('0x58'),_0x8d87('0x59'),'emailaddress',_0x8d87('0x5a'),'entityimage_timestamp',_0x8d87('0x5b'),_0x8d87('0x5c'),_0x8d87('0x5d'),'firstresponsebykpiidname',_0x8d87('0x5e'),_0x8d87('0x5f'),_0x8d87('0x60'),_0x8d87('0x61'),_0x8d87('0x62'),_0x8d87('0x63'),'modifiedbyexternalpartyname',_0x8d87('0x64'),_0x8d87('0x65'),_0x8d87('0x66'),_0x8d87('0x67'),'modifiedonbehalfbyname',_0x8d87('0x68'),_0x8d87('0x69'),'msdyn_iotalertname',_0x8d87('0x6a'),_0x8d87('0x6b'),_0x8d87('0x6c'),_0x8d87('0x6d'),'owneridtype',_0x8d87('0x6e'),_0x8d87('0x6f'),'primarycontactidname',_0x8d87('0x70'),_0x8d87('0x71'),'productidname',_0x8d87('0x72'),_0x8d87('0x73'),_0x8d87('0x74'),_0x8d87('0x75'),_0x8d87('0x76'),_0x8d87('0x77'),_0x8d87('0x78'),'slainvokedidname','slaname','socialprofileidname','statecode','statuscode',_0x8d87('0x79'),_0x8d87('0x7a'),'timezoneruleversionnumber',_0x8d87('0x7b'),_0x8d87('0x7c'),_0x8d87('0x7d'),_0x8d87('0x7e')];var _0xa2903e=_0x1dc39b[_0x8d87('0x7f')](_0x196a63);return db['Dynamics365Account']['findOne']({'where':{'id':_0x5e04c0[_0x8d87('0x35')]['id']},'attributes':['id',_0x8d87('0x80'),'password','remoteUri',_0x8d87('0x81'),'clientId',_0x8d87('0x82'),'modernAuthentication'],'include':[{'model':db[_0x8d87('0x83')],'as':_0x8d87('0x83'),'attributes':['id',_0x8d87('0x84'),_0x8d87('0x85')]}]})[_0x8d87('0xe')](handleEntityNotFound(_0x2e09ca,null))[_0x8d87('0xe')](function(_0x4e670b){if(_0x4e670b){if(_0x4e670b['modernAuthentication']){_0x4e670b[_0x8d87('0x86')]=_0x4e670b[_0x8d87('0x83')][_0x8d87('0x84')];_0x50198b=sanitizeRemoteUri(_0x4e670b['CloudProvider'][_0x8d87('0x85')]);_0xc8186=getWebApiUrl(_0x50198b);return _0x4e670b;}_0x50198b=sanitizeRemoteUri(_0x4e670b['remoteUri']);_0xc8186=getWebApiUrl(_0x50198b);var _0x17dc0a={'method':_0x8d87('0x87'),'uri':_0x8d87('0x88')+_0x4e670b[_0x8d87('0x81')]+_0x8d87('0x89'),'form':{'client_id':_0x4e670b['clientId'],'resource':_0x50198b,'username':_0x4e670b[_0x8d87('0x80')],'password':_0x4e670b[_0x8d87('0x8a')],'grant_type':_0x8d87('0x8a'),'client_secret':_0x4e670b[_0x8d87('0x82')]},'json':!![]};return rp(_0x17dc0a);}})[_0x8d87('0xe')](function(_0x16263a){_0x8e043d=_0x16263a['access_token'];var _0x2af99e={'method':_0x8d87('0x8b'),'uri':encodeURI(_0xc8186+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x115fde+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x8e043d,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x2af99e);})[_0x8d87('0xe')](function(_0x1fda71){var _0x187362=_0x1fda71['value'][0x0];var _0x1ca6a2=_0x187362[_0x8d87('0x8d')];var _0x2e1c70={'method':_0x8d87('0x8b'),'uri':_0xc8186+'EntityDefinitions('+_0x1ca6a2+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x8d87('0x8e')+_0x8e043d,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x2e1c70);})[_0x8d87('0xe')](function(_0x55cf73){_0x2431ae=_0x55cf73;_0x317c24=_0x2431ae[_0x8d87('0x8f')];_0x317c24=_[_0x8d87('0x90')](_0x317c24,function(_0x2ff357){return!_0xa2903e[_0x8d87('0x91')](_0x2ff357['LogicalName']);});var _0x491c2d=[];var _0x2fb840=[];_0x317c24[_0x8d87('0x92')](function(_0x58aa26){if(_0x58aa26['@odata.type']){var _0x28f48f=_0x58aa26[_0x8d87('0x93')][_0x8d87('0x41')](_0x58aa26[_0x8d87('0x93')]['lastIndexOf']('.')+0x1);if(_0x28f48f==='PicklistAttributeMetadata'){_0x491c2d[_0x8d87('0x94')](getSelectList(_0xc8186,_0x452540,_0x2fb840,_0x2431ae[_0x8d87('0x8d')],_0x58aa26['MetadataId'],_0x8e043d));}}});return Promise[_0x8d87('0x95')](_0x491c2d);})[_0x8d87('0xe')](function(_0x3479fb){_0x1ede24=_0x3479fb[0x0];var _0x136806=[];var _0x2ae3ec=[];_0x317c24[_0x8d87('0x92')](function(_0xe02677){if(!_[_0x8d87('0x96')](_0xe02677[_0x8d87('0x93')])){var _0x22b034=_0xe02677[_0x8d87('0x93')]['substring'](_0xe02677[_0x8d87('0x93')][_0x8d87('0x42')]('.')+0x1);if(_0x22b034===_0x8d87('0x97')){_0x136806[_0x8d87('0x94')](getBooleanList(_0xc8186,_0x452540,_0x2ae3ec,_0x2431ae['MetadataId'],_0xe02677[_0x8d87('0x8d')],_0x8e043d));}}});return Promise['all'](_0x136806);})[_0x8d87('0xe')](function(_0x2cd8e9){_0x5eb411=_0x2cd8e9[0x0];var _0x27e72f=[];var _0x1c64bf=[];_0x317c24[_0x8d87('0x92')](function(_0xe2702c){if(_0xe2702c[_0x8d87('0x93')]){var _0x5b1faa=_0xe2702c[_0x8d87('0x93')][_0x8d87('0x41')](_0xe2702c['@odata.type'][_0x8d87('0x42')]('.')+0x1);if(_0x5b1faa===_0x8d87('0x98')||_0x5b1faa===_0x8d87('0x99')||_0x5b1faa===_0x8d87('0x9a')||_0x5b1faa===_0x8d87('0x9b')||_0x5b1faa===_0x8d87('0x9c')||_0x5b1faa===_0x8d87('0x9d')||_0x5b1faa===_0x8d87('0x9e')||_0x5b1faa===_0x8d87('0x9f')||_0x5b1faa===_0x8d87('0xa0')||_0x5b1faa===_0x8d87('0xa1')){_0x27e72f[_0x8d87('0x94')](getInputList(_0xc8186,_0x452540,_0x5b1faa,_0x1c64bf,_0x2431ae[_0x8d87('0x8d')],_0xe2702c[_0x8d87('0x8d')],_0x8e043d));}}});return Promise[_0x8d87('0x95')](_0x27e72f);})[_0x8d87('0xe')](function(_0x2a7d3f){_0xb4624=_0x2a7d3f[0x0];var _0x9faaec=_0x1ede24[_0x8d87('0x7f')](_0x5eb411)['concat'](_0xb4624);var _0x285c45={'count':_0x9faaec['length'],'rows':_0x9faaec};return _0x285c45;})[_0x8d87('0xe')](respondWithResult(_0x2e09ca,null))[_0x8d87('0x2f')](function(_0x47eb01){var _0x1b09fc=_0x5e04c0[_0x8d87('0x1e')][_0x8d87('0xa2')]?0x1f4:_0x47eb01[_0x8d87('0xa3')]||0x1f4;logger['error'](_0x47eb01[_0x8d87('0x13')]);delete _0x47eb01[_0x8d87('0x1d')];if(_0x1b09fc===0x191){_0x1b09fc=0x190;}_0x2e09ca[_0x8d87('0xb')](_0x1b09fc)[_0x8d87('0x14')](_0x5e04c0[_0x8d87('0x1e')][_0x8d87('0xa2')]?{'message':_0x8d87('0xa4'),'statusCode':_0x47eb01['statusCode']}:_0x47eb01);});};function getSelectList(_0x10eb82,_0x120be5,_0x1157df,_0xa58e93,_0x475a31,_0xa0ff47){var _0x132cfb={'method':_0x8d87('0x8b'),'uri':_0x10eb82+_0x8d87('0xa5')+_0xa58e93+_0x8d87('0xa6')+_0x475a31+_0x8d87('0xa7')+_0x8d87('0xa8'),'headers':{'Authorization':_0x8d87('0x8e')+_0xa0ff47,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x132cfb)[_0x8d87('0xe')](function(_0x4e132e){var _0x37fef7=[];var _0xca4a7b=_0x4e132e[_0x8d87('0xa9')]['Options'];_0xca4a7b['forEach'](function(_0x88296f){_0x37fef7[_0x8d87('0x94')]({'name':_0x88296f[_0x8d87('0xaa')]['UserLocalizedLabel'][_0x8d87('0xaa')],'value':String(_0x88296f[_0x8d87('0xab')])});});var _0x12ad31={'id':_0x120be5+'_'+_0x4e132e[_0x8d87('0xac')],'name':_0x4e132e[_0x8d87('0xad')][_0x8d87('0xae')][_0x8d87('0xaa')],'custom':![],'options':_0x37fef7};_0x1157df[_0x8d87('0x94')](_0x12ad31);return _0x1157df;});}function getBooleanList(_0x431931,_0x535490,_0x22c1cb,_0x4f0092,_0x48b3ee,_0x409eed){var _0x42afda={'method':_0x8d87('0x8b'),'uri':_0x431931+_0x8d87('0xa5')+_0x4f0092+_0x8d87('0xa6')+_0x48b3ee+_0x8d87('0xaf'),'headers':{'Authorization':_0x8d87('0x8e')+_0x409eed,'If-None-Match':null,'OData-Version':_0x8d87('0x8c')},'json':!![]};return rp(_0x42afda)[_0x8d87('0xe')](function(_0x17da06){var _0x5b78d8=[];_0x5b78d8[_0x8d87('0x94')]({'name':_0x17da06[_0x8d87('0xa9')][_0x8d87('0xb0')]['Label'][_0x8d87('0xae')][_0x8d87('0xaa')],'value':'true'},{'name':_0x17da06['OptionSet'][_0x8d87('0xb1')][_0x8d87('0xaa')]['UserLocalizedLabel'][_0x8d87('0xaa')],'value':_0x8d87('0xb2')});var _0x39b0c9={'id':_0x535490+'_'+_0x17da06[_0x8d87('0xac')],'name':_0x17da06[_0x8d87('0xad')][_0x8d87('0xae')]['Label'],'custom':![],'options':_0x5b78d8};_0x22c1cb[_0x8d87('0x94')](_0x39b0c9);return _0x22c1cb;});}function getInputList(_0x17995c,_0x32e155,_0x535031,_0x17681d,_0xb72c91,_0x1a66dd,_0x54696b){var _0x1e1a82={'method':_0x8d87('0x8b'),'uri':_0x17995c+'EntityDefinitions('+_0xb72c91+_0x8d87('0xa6')+_0x1a66dd+_0x8d87('0xb3')+_0x535031+_0x8d87('0xb4'),'headers':{'Authorization':_0x8d87('0x8e')+_0x54696b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1e1a82)[_0x8d87('0xe')](function(_0x48d0fa){var _0x14f436={'id':_0x32e155+'_'+_0x48d0fa['LogicalName'],'name':_0x48d0fa['DisplayName'][_0x8d87('0xae')]?_0x48d0fa[_0x8d87('0xad')][_0x8d87('0xae')][_0x8d87('0xaa')]:_0x48d0fa[_0x8d87('0xac')],'custom':![],'options':[]};_0x17681d[_0x8d87('0x94')](_0x14f436);return _0x17681d;});} \ No newline at end of file +var _0xa0e4=['BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','error','test','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','true','false','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','end','sendStatus','stack','name','send','index','Dynamics365Account','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','https://login.microsoftonline.com/','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil'];(function(_0x1d2c4c,_0x32b64e){var _0x2d3277=function(_0xc31e6b){while(--_0xc31e6b){_0x1d2c4c['push'](_0x1d2c4c['shift']());}};_0x2d3277(++_0x32b64e);}(_0xa0e4,0x1a3));var _0x4a0e=function(_0x3055ab,_0x4d1f74){_0x3055ab=_0x3055ab-0x0;var _0x31d336=_0xa0e4[_0x3055ab];return _0x31d336;};'use strict';var rp=require(_0x4a0e('0x0'));var util=require(_0x4a0e('0x1'));var _=require(_0x4a0e('0x2'));var qs=require(_0x4a0e('0x3'));var logger=require(_0x4a0e('0x4'))(_0x4a0e('0x5'));var db=require(_0x4a0e('0x6'))['db'];var integrations=require(_0x4a0e('0x7'));function respondWithResult(_0x30589e,_0xa8c970){_0xa8c970=_0xa8c970||0xc8;return function(_0x359237){if(_0x359237){return _0x30589e[_0x4a0e('0x8')](_0xa8c970)[_0x4a0e('0x9')](_0x359237);}};}function respondWithFilteredResult(_0x3b3d6d,_0x2c7c10){return function(_0x56c186){if(_0x56c186){var _0x307414=typeof _0x2c7c10[_0x4a0e('0xa')]===_0x4a0e('0xb')&&typeof _0x2c7c10[_0x4a0e('0xc')]===_0x4a0e('0xb');var _0x22316c=_0x56c186['count'];var _0x1ef84a=_0x307414?0x0:_0x2c7c10[_0x4a0e('0xa')];var _0x34ce15=_0x307414?_0x56c186[_0x4a0e('0xd')]:_0x2c7c10[_0x4a0e('0xa')]+_0x2c7c10[_0x4a0e('0xc')];var _0x498fff;if(_0x34ce15>=_0x22316c){_0x34ce15=_0x22316c;_0x498fff=0xc8;}else{_0x498fff=0xce;}_0x3b3d6d[_0x4a0e('0x8')](_0x498fff);return _0x3b3d6d[_0x4a0e('0xe')](_0x4a0e('0xf'),_0x1ef84a+'-'+_0x34ce15+'/'+_0x22316c)[_0x4a0e('0x9')](_0x56c186);}return null;};}function saveUpdates(_0x59f8fd){return function(_0x4fa34e){if(_0x4fa34e){return _0x4fa34e[_0x4a0e('0x10')](_0x59f8fd)['then'](function(_0x27c52e){return _0x27c52e;});}return null;};}function removeEntity(_0x1145d1){return function(_0x1dfdc3){if(_0x1dfdc3){return _0x1dfdc3[_0x4a0e('0x11')]()[_0x4a0e('0x12')](function(){_0x1145d1[_0x4a0e('0x8')](0xcc)[_0x4a0e('0x13')]();});}};}function handleEntityNotFound(_0x286c99){return function(_0x4ba600){if(!_0x4ba600){_0x286c99[_0x4a0e('0x14')](0x194);}return _0x4ba600;};}function handleError(_0x261e55,_0x502f55){_0x502f55=_0x502f55||0x1f4;return function(_0x3572c6){logger['error'](_0x3572c6[_0x4a0e('0x15')]);if(_0x3572c6[_0x4a0e('0x16')]){delete _0x3572c6[_0x4a0e('0x16')];}_0x261e55[_0x4a0e('0x8')](_0x502f55)[_0x4a0e('0x17')](_0x3572c6);};}exports[_0x4a0e('0x18')]=function(_0x3941bd,_0x4492ab){var _0x2b957f={},_0x6b0cea={},_0x4cefb6={'count':0x0,'rows':[]};var _0x4ab171=_['map'](db[_0x4a0e('0x19')]['rawAttributes'],function(_0x2df4f6){return{'name':_0x2df4f6[_0x4a0e('0x1a')],'type':_0x2df4f6[_0x4a0e('0x1b')][_0x4a0e('0x1c')]};});_0x6b0cea[_0x4a0e('0x1d')]=_[_0x4a0e('0x1e')](_0x4ab171,_0x4a0e('0x16'));_0x6b0cea[_0x4a0e('0x1f')]=_['keys'](_0x3941bd[_0x4a0e('0x1f')]);_0x6b0cea['filters']=_[_0x4a0e('0x20')](_0x6b0cea[_0x4a0e('0x1d')],_0x6b0cea[_0x4a0e('0x1f')]);_0x2b957f[_0x4a0e('0x21')]=_[_0x4a0e('0x20')](_0x6b0cea['model'],qs[_0x4a0e('0x22')](_0x3941bd[_0x4a0e('0x1f')][_0x4a0e('0x22')]));_0x2b957f[_0x4a0e('0x21')]=_0x2b957f[_0x4a0e('0x21')][_0x4a0e('0x23')]?_0x2b957f[_0x4a0e('0x21')]:_0x6b0cea[_0x4a0e('0x1d')];if(!_0x3941bd[_0x4a0e('0x1f')][_0x4a0e('0x24')](_0x4a0e('0x25'))){_0x2b957f[_0x4a0e('0xc')]=qs[_0x4a0e('0xc')](_0x3941bd[_0x4a0e('0x1f')][_0x4a0e('0xc')]);_0x2b957f[_0x4a0e('0xa')]=qs['offset'](_0x3941bd[_0x4a0e('0x1f')][_0x4a0e('0xa')]);}_0x2b957f[_0x4a0e('0x26')]=qs[_0x4a0e('0x27')](_0x3941bd[_0x4a0e('0x1f')][_0x4a0e('0x27')]);_0x2b957f['where']=qs[_0x4a0e('0x28')](_[_0x4a0e('0x29')](_0x3941bd[_0x4a0e('0x1f')],_0x6b0cea['filters']),_0x4ab171);if(_0x3941bd[_0x4a0e('0x1f')]['filter']){_0x2b957f[_0x4a0e('0x2a')]=_[_0x4a0e('0x2b')](_0x2b957f['where'],{'$or':_[_0x4a0e('0x1e')](_0x4ab171,function(_0x418a1c){if(_0x418a1c[_0x4a0e('0x1b')]!==_0x4a0e('0x2c')){var _0x1aa47a={};_0x1aa47a[_0x418a1c['name']]={'$like':'%'+_0x3941bd[_0x4a0e('0x1f')][_0x4a0e('0x2d')]+'%'};return _0x1aa47a;}})});}_0x2b957f=_[_0x4a0e('0x2b')]({},_0x2b957f,_0x3941bd[_0x4a0e('0x2e')]);var _0x212aa5={'where':_0x2b957f[_0x4a0e('0x2a')]};return db[_0x4a0e('0x19')]['count'](_0x212aa5)[_0x4a0e('0x12')](function(_0x1aa064){_0x4cefb6[_0x4a0e('0xd')]=_0x1aa064;if(_0x3941bd[_0x4a0e('0x1f')]['includeAll']){_0x2b957f[_0x4a0e('0x2f')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x4a0e('0x30')](_0x2b957f);})[_0x4a0e('0x12')](function(_0x12824e){_0x4cefb6[_0x4a0e('0x31')]=_0x12824e;return _0x4cefb6;})[_0x4a0e('0x12')](respondWithFilteredResult(_0x4492ab,_0x2b957f))[_0x4a0e('0x32')](handleError(_0x4492ab,null));};exports[_0x4a0e('0x33')]=function(_0x4bcd7a,_0x51124c){var _0x2890ec={'raw':![],'where':{'id':_0x4bcd7a[_0x4a0e('0x34')]['id']}},_0x7316b7={};_0x7316b7[_0x4a0e('0x1d')]=_['keys'](db['Dynamics365Account'][_0x4a0e('0x35')]);_0x7316b7['query']=_[_0x4a0e('0x36')](_0x4bcd7a[_0x4a0e('0x1f')]);_0x7316b7[_0x4a0e('0x28')]=_['intersection'](_0x7316b7[_0x4a0e('0x1d')],_0x7316b7['query']);_0x2890ec['attributes']=_[_0x4a0e('0x20')](_0x7316b7[_0x4a0e('0x1d')],qs['fields'](_0x4bcd7a[_0x4a0e('0x1f')][_0x4a0e('0x22')]));_0x2890ec[_0x4a0e('0x21')]=_0x2890ec[_0x4a0e('0x21')][_0x4a0e('0x23')]?_0x2890ec[_0x4a0e('0x21')]:_0x7316b7[_0x4a0e('0x1d')];if(_0x4bcd7a[_0x4a0e('0x1f')]['includeAll']){_0x2890ec[_0x4a0e('0x2f')]=[{'all':!![]}];}_0x2890ec=_['merge']({},_0x2890ec,_0x4bcd7a['options']);return db[_0x4a0e('0x19')][_0x4a0e('0x37')](_0x2890ec)[_0x4a0e('0x12')](handleEntityNotFound(_0x51124c,null))[_0x4a0e('0x12')](respondWithResult(_0x51124c,null))[_0x4a0e('0x32')](handleError(_0x51124c,null));};exports[_0x4a0e('0x38')]=function(_0xf69502,_0x397f3e){return db[_0x4a0e('0x19')][_0x4a0e('0x38')](_0xf69502['body'],{})[_0x4a0e('0x12')](respondWithResult(_0x397f3e,0xc9))[_0x4a0e('0x32')](handleError(_0x397f3e,null));};exports[_0x4a0e('0x10')]=function(_0x534060,_0x69ef63){if(_0x534060[_0x4a0e('0x39')]['id']){delete _0x534060[_0x4a0e('0x39')]['id'];}return db[_0x4a0e('0x19')][_0x4a0e('0x37')]({'where':{'id':_0x534060[_0x4a0e('0x34')]['id']}})['then'](handleEntityNotFound(_0x69ef63,null))[_0x4a0e('0x12')](saveUpdates(_0x534060[_0x4a0e('0x39')],null))[_0x4a0e('0x12')](respondWithResult(_0x69ef63,null))['catch'](handleError(_0x69ef63,null));};exports['destroy']=function(_0x27226d,_0x189e2f){return db[_0x4a0e('0x19')][_0x4a0e('0x37')]({'where':{'id':_0x27226d[_0x4a0e('0x34')]['id']}})[_0x4a0e('0x12')](handleEntityNotFound(_0x189e2f,null))['then'](removeEntity(_0x189e2f,null))[_0x4a0e('0x32')](handleError(_0x189e2f,null));};exports[_0x4a0e('0x3a')]=function(_0x4b1604,_0x5c2db3){var _0x400e3f={};var _0x2feee8={};var _0x2892d8;var _0x2fb597;return db['Dynamics365Account'][_0x4a0e('0x3b')]({'where':{'id':_0x4b1604['params']['id']}})[_0x4a0e('0x12')](handleEntityNotFound(_0x5c2db3,null))[_0x4a0e('0x12')](function(_0x480ae9){if(_0x480ae9){_0x2892d8=_0x480ae9;_0x2feee8['model']=_[_0x4a0e('0x36')](db['Dynamics365Configuration'][_0x4a0e('0x35')]);_0x2feee8[_0x4a0e('0x1f')]=_[_0x4a0e('0x36')](_0x4b1604[_0x4a0e('0x1f')]);_0x2feee8[_0x4a0e('0x28')]=_[_0x4a0e('0x20')](_0x2feee8[_0x4a0e('0x1d')],_0x2feee8[_0x4a0e('0x1f')]);_0x400e3f[_0x4a0e('0x21')]=_[_0x4a0e('0x20')](_0x2feee8[_0x4a0e('0x1d')],qs[_0x4a0e('0x22')](_0x4b1604[_0x4a0e('0x1f')][_0x4a0e('0x22')]));_0x400e3f[_0x4a0e('0x21')]=_0x400e3f[_0x4a0e('0x21')][_0x4a0e('0x23')]?_0x400e3f[_0x4a0e('0x21')]:_0x2feee8[_0x4a0e('0x1d')];_0x400e3f[_0x4a0e('0x26')]=qs[_0x4a0e('0x27')](_0x4b1604[_0x4a0e('0x1f')][_0x4a0e('0x27')]);_0x400e3f[_0x4a0e('0x2a')]=qs[_0x4a0e('0x28')](_['pick'](_0x4b1604[_0x4a0e('0x1f')],_0x2feee8[_0x4a0e('0x28')]));if(_0x4b1604[_0x4a0e('0x1f')][_0x4a0e('0x2d')]){_0x400e3f[_0x4a0e('0x2a')]=_[_0x4a0e('0x2b')](_0x400e3f[_0x4a0e('0x2a')],{'$or':_[_0x4a0e('0x1e')](_0x400e3f[_0x4a0e('0x21')],function(_0xbb99e3){var _0x5c17fb={};_0x5c17fb[_0xbb99e3]={'$like':'%'+_0x4b1604[_0x4a0e('0x1f')][_0x4a0e('0x2d')]+'%'};return _0x5c17fb;})});}_0x400e3f=_[_0x4a0e('0x2b')]({},_0x400e3f,_0x4b1604[_0x4a0e('0x2e')]);return _0x2892d8[_0x4a0e('0x3a')](_0x400e3f);}})['then'](function(_0x4781b6){if(_0x4781b6){_0x2fb597=_0x4781b6[_0x4a0e('0x23')];if(!_0x4b1604[_0x4a0e('0x1f')][_0x4a0e('0x24')](_0x4a0e('0x25'))){_0x400e3f[_0x4a0e('0xc')]=qs[_0x4a0e('0xc')](_0x4b1604[_0x4a0e('0x1f')]['limit']);_0x400e3f['offset']=qs[_0x4a0e('0xa')](_0x4b1604['query'][_0x4a0e('0xa')]);}return _0x2892d8[_0x4a0e('0x3a')](_0x400e3f);}})[_0x4a0e('0x12')](function(_0x47b86f){if(_0x47b86f){return _0x47b86f?{'count':_0x2fb597,'rows':_0x47b86f}:null;}})[_0x4a0e('0x12')](respondWithResult(_0x5c2db3,null))[_0x4a0e('0x32')](handleError(_0x5c2db3,null));};exports[_0x4a0e('0x3c')]=function(_0x2e7ce0,_0x46695a){if(_0x2e7ce0[_0x4a0e('0x39')]['id']){delete _0x2e7ce0[_0x4a0e('0x39')]['id'];}return db[_0x4a0e('0x19')][_0x4a0e('0x3b')]({'where':{'id':_0x2e7ce0[_0x4a0e('0x34')]['id']}})[_0x4a0e('0x12')](handleEntityNotFound(_0x46695a,null))[_0x4a0e('0x12')](function(_0x4f3a5c){if(_0x4f3a5c){_0x2e7ce0[_0x4a0e('0x39')]['AccountId']=_0x4f3a5c['id'];_0x2e7ce0['body'][_0x4a0e('0x3d')]=integrations[_0x4a0e('0x3e')](_0x2e7ce0[_0x4a0e('0x39')][_0x4a0e('0x3f')],_0x2e7ce0[_0x4a0e('0x39')][_0x4a0e('0x1b')]);_0x2e7ce0[_0x4a0e('0x39')]['Descriptions']=integrations[_0x4a0e('0x40')](_0x2e7ce0[_0x4a0e('0x39')][_0x4a0e('0x3f')],_0x2e7ce0[_0x4a0e('0x39')][_0x4a0e('0x1b')]);return db[_0x4a0e('0x41')][_0x4a0e('0x38')](_0x2e7ce0[_0x4a0e('0x39')],{'include':[{'model':db[_0x4a0e('0x42')],'as':_0x4a0e('0x3d')},{'model':db['Dynamics365Field'],'as':_0x4a0e('0x43')}]});}return null;})['then'](respondWithResult(_0x46695a,null))[_0x4a0e('0x32')](handleError(_0x46695a,null));};function sanitizeRemoteUri(_0x2c3522){var _0xa825b=_0x2c3522['slice'](-0x1);if(_0xa825b==='/')return _0x2c3522[_0x4a0e('0x44')](0x0,_0x2c3522[_0x4a0e('0x45')](_0xa825b));return _0x2c3522;}function getWebApiUrl(_0x41704d){return util['format'](_0x4a0e('0x46'),_0x41704d);}exports[_0x4a0e('0x47')]=function(_0x64ac90,_0x71ea58){var _0x2fe490=_0x64ac90['query'][_0x4a0e('0x48')];var _0x1806a5=_0x2fe490==='incident'?_0x4a0e('0x49'):'PhoneCall';var _0x584d42='';var _0x110853='';var _0x71607d='';var _0x926707='';var _0xa5e1ca='';var _0xb61e08='';var _0x59ff27='';var _0x3338e1='';var _0x4fa16a=[_0x4a0e('0x4a'),_0x4a0e('0x4b'),_0x4a0e('0x4c'),_0x4a0e('0x4d'),_0x4a0e('0x4e'),_0x4a0e('0x4f'),_0x4a0e('0x50'),_0x4a0e('0x51'),_0x4a0e('0x52'),_0x4a0e('0x53')];var _0x57b317=[_0x4a0e('0x54'),_0x4a0e('0x55'),_0x4a0e('0x56'),_0x4a0e('0x57'),_0x4a0e('0x58'),_0x4a0e('0x59'),_0x4a0e('0x5a'),_0x4a0e('0x5b'),'createdbyexternalpartyname',_0x4a0e('0x5c'),_0x4a0e('0x5d'),'createdbyyominame',_0x4a0e('0x5e'),'createdonbehalfbyname',_0x4a0e('0x5f'),_0x4a0e('0x60'),'customeridtype','customeridyominame',_0x4a0e('0x61'),_0x4a0e('0x62'),_0x4a0e('0x63'),'entityimage_url','escalatedon',_0x4a0e('0x64'),_0x4a0e('0x65'),_0x4a0e('0x66'),_0x4a0e('0x67'),_0x4a0e('0x68'),'kbarticleidname',_0x4a0e('0x69'),_0x4a0e('0x6a'),'modifiedbyexternalpartyname',_0x4a0e('0x6b'),'modifiedbyname',_0x4a0e('0x6c'),_0x4a0e('0x6d'),_0x4a0e('0x6e'),_0x4a0e('0x6f'),_0x4a0e('0x70'),_0x4a0e('0x71'),_0x4a0e('0x72'),_0x4a0e('0x73'),_0x4a0e('0x74'),_0x4a0e('0x75'),_0x4a0e('0x76'),_0x4a0e('0x77'),_0x4a0e('0x78'),_0x4a0e('0x79'),_0x4a0e('0x7a'),_0x4a0e('0x7b'),_0x4a0e('0x7c'),_0x4a0e('0x7d'),_0x4a0e('0x7e'),_0x4a0e('0x7f'),_0x4a0e('0x80'),_0x4a0e('0x81'),_0x4a0e('0x82'),_0x4a0e('0x83'),_0x4a0e('0x84'),'slaname',_0x4a0e('0x85'),_0x4a0e('0x86'),_0x4a0e('0x87'),_0x4a0e('0x88'),'ticketnumber',_0x4a0e('0x89'),'transactioncurrencyidname',_0x4a0e('0x8a'),_0x4a0e('0x8b'),_0x4a0e('0x8c')];var _0x1d4e9c=_0x4fa16a[_0x4a0e('0x8d')](_0x57b317);return db[_0x4a0e('0x19')][_0x4a0e('0x3b')]({'where':{'id':_0x64ac90[_0x4a0e('0x34')]['id']},'attributes':['id',_0x4a0e('0x8e'),'password','remoteUri',_0x4a0e('0x8f'),_0x4a0e('0x90'),_0x4a0e('0x91'),_0x4a0e('0x92')],'include':[{'model':db[_0x4a0e('0x93')],'as':'CloudProvider','attributes':['id',_0x4a0e('0x94'),_0x4a0e('0x95')]}]})[_0x4a0e('0x12')](handleEntityNotFound(_0x71ea58,null))[_0x4a0e('0x12')](function(_0x2cbd39){if(_0x2cbd39){if(_0x2cbd39[_0x4a0e('0x92')]){_0x2cbd39[_0x4a0e('0x96')]=_0x2cbd39[_0x4a0e('0x93')]['data5'];_0x3338e1=sanitizeRemoteUri(_0x2cbd39[_0x4a0e('0x93')]['data7']);_0x59ff27=getWebApiUrl(_0x3338e1);return _0x2cbd39;}_0x3338e1=sanitizeRemoteUri(_0x2cbd39['remoteUri']);_0x59ff27=getWebApiUrl(_0x3338e1);var _0x5c1b8d={'method':'POST','uri':_0x4a0e('0x97')+_0x2cbd39[_0x4a0e('0x8f')]+_0x4a0e('0x98'),'form':{'client_id':_0x2cbd39[_0x4a0e('0x90')],'resource':_0x3338e1,'username':_0x2cbd39['username'],'password':_0x2cbd39[_0x4a0e('0x99')],'grant_type':_0x4a0e('0x99'),'client_secret':_0x2cbd39[_0x4a0e('0x91')]},'json':!![]};return rp(_0x5c1b8d);}})[_0x4a0e('0x12')](function(_0x1531ef){_0xb61e08=_0x1531ef[_0x4a0e('0x96')];var _0x481b77={'method':_0x4a0e('0x9a'),'uri':encodeURI(_0x59ff27+_0x4a0e('0x9b')+_0x1806a5+'\x27'),'headers':{'Authorization':_0x4a0e('0x9c')+_0xb61e08,'If-None-Match':null,'OData-Version':_0x4a0e('0x9d')},'json':!![]};return rp(_0x481b77);})[_0x4a0e('0x12')](function(_0x2479f0){var _0x12c5cc=_0x2479f0[_0x4a0e('0x9e')][0x0];var _0x35a8ce=_0x12c5cc[_0x4a0e('0x9f')];var _0x5ed19b={'method':_0x4a0e('0x9a'),'uri':_0x59ff27+'EntityDefinitions('+_0x35a8ce+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x4a0e('0x9c')+_0xb61e08,'If-None-Match':null,'OData-Version':_0x4a0e('0x9d')},'json':!![]};return rp(_0x5ed19b);})[_0x4a0e('0x12')](function(_0x240939){_0x584d42=_0x240939;_0x110853=_0x584d42[_0x4a0e('0xa0')];_0x110853=_['remove'](_0x110853,function(_0x2a437a){return!_0x1d4e9c[_0x4a0e('0xa1')](_0x2a437a[_0x4a0e('0xa2')]);});var _0x15b450=[];var _0x540668=[];_0x110853[_0x4a0e('0xa3')](function(_0xc28610){if(_0xc28610[_0x4a0e('0xa4')]){var _0x2bd2b0=_0xc28610[_0x4a0e('0xa4')][_0x4a0e('0x44')](_0xc28610[_0x4a0e('0xa4')]['lastIndexOf']('.')+0x1);if(_0x2bd2b0===_0x4a0e('0xa5')){_0x15b450[_0x4a0e('0xa6')](getSelectList(_0x59ff27,_0x2fe490,_0x540668,_0x584d42[_0x4a0e('0x9f')],_0xc28610[_0x4a0e('0x9f')],_0xb61e08));}}});return Promise[_0x4a0e('0xa7')](_0x15b450);})['then'](function(_0x384cc5){_0x71607d=_0x384cc5[0x0];var _0x26068f=[];var _0x49137b=[];_0x110853[_0x4a0e('0xa3')](function(_0x5c6a02){if(!_[_0x4a0e('0xa8')](_0x5c6a02[_0x4a0e('0xa4')])){var _0x30a813=_0x5c6a02[_0x4a0e('0xa4')][_0x4a0e('0x44')](_0x5c6a02[_0x4a0e('0xa4')]['lastIndexOf']('.')+0x1);if(_0x30a813===_0x4a0e('0xa9')){_0x26068f['push'](getBooleanList(_0x59ff27,_0x2fe490,_0x49137b,_0x584d42['MetadataId'],_0x5c6a02[_0x4a0e('0x9f')],_0xb61e08));}}});return Promise[_0x4a0e('0xa7')](_0x26068f);})[_0x4a0e('0x12')](function(_0xff3d5){_0x926707=_0xff3d5[0x0];var _0x5637df=[];var _0x553f7d=[];_0x110853[_0x4a0e('0xa3')](function(_0x3dea1b){if(_0x3dea1b[_0x4a0e('0xa4')]){var _0x4d602d=_0x3dea1b[_0x4a0e('0xa4')]['substring'](_0x3dea1b['@odata.type'][_0x4a0e('0x45')]('.')+0x1);if(_0x4d602d===_0x4a0e('0xaa')||_0x4d602d===_0x4a0e('0xab')||_0x4d602d===_0x4a0e('0xac')||_0x4d602d===_0x4a0e('0xad')||_0x4d602d===_0x4a0e('0xae')||_0x4d602d===_0x4a0e('0xaf')||_0x4d602d==='StatusAttributeMetadata'||_0x4d602d===_0x4a0e('0xb0')||_0x4d602d===_0x4a0e('0xb1')||_0x4d602d===_0x4a0e('0xb2')){_0x5637df['push'](getInputList(_0x59ff27,_0x2fe490,_0x4d602d,_0x553f7d,_0x584d42[_0x4a0e('0x9f')],_0x3dea1b[_0x4a0e('0x9f')],_0xb61e08));}}});return Promise[_0x4a0e('0xa7')](_0x5637df);})['then'](function(_0x5d7a6d){_0xa5e1ca=_0x5d7a6d[0x0];var _0x40694c=_0x71607d[_0x4a0e('0x8d')](_0x926707)[_0x4a0e('0x8d')](_0xa5e1ca);var _0x3009d2={'count':_0x40694c['length'],'rows':_0x40694c};return _0x3009d2;})[_0x4a0e('0x12')](respondWithResult(_0x71ea58,null))[_0x4a0e('0x32')](function(_0x14283d){var _0x24a7f7=_0x64ac90[_0x4a0e('0x1f')]['test']?0x1f4:_0x14283d[_0x4a0e('0xb3')]||0x1f4;logger[_0x4a0e('0xb4')](_0x14283d[_0x4a0e('0x15')]);delete _0x14283d['name'];if(_0x24a7f7===0x191){_0x24a7f7=0x190;}_0x71ea58[_0x4a0e('0x8')](_0x24a7f7)[_0x4a0e('0x17')](_0x64ac90[_0x4a0e('0x1f')][_0x4a0e('0xb5')]?{'message':_0x4a0e('0xb6'),'statusCode':_0x14283d[_0x4a0e('0xb3')]}:_0x14283d);});};function getSelectList(_0xd353a1,_0xd6b6ac,_0x3acb06,_0x494cee,_0x15b599,_0x2c5869){var _0x3c47bb={'method':_0x4a0e('0x9a'),'uri':_0xd353a1+_0x4a0e('0xb7')+_0x494cee+_0x4a0e('0xb8')+_0x15b599+_0x4a0e('0xb9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x2c5869,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3c47bb)[_0x4a0e('0x12')](function(_0x3fd42a){var _0x23da97=[];var _0x4d4014=_0x3fd42a[_0x4a0e('0xba')][_0x4a0e('0xbb')];_0x4d4014[_0x4a0e('0xa3')](function(_0x563c1e){_0x23da97[_0x4a0e('0xa6')]({'name':_0x563c1e[_0x4a0e('0xbc')]['UserLocalizedLabel'][_0x4a0e('0xbc')],'value':String(_0x563c1e['Value'])});});var _0x2533f8={'id':_0xd6b6ac+'_'+_0x3fd42a['LogicalName'],'name':_0x3fd42a[_0x4a0e('0xbd')]['UserLocalizedLabel'][_0x4a0e('0xbc')],'custom':![],'options':_0x23da97};_0x3acb06[_0x4a0e('0xa6')](_0x2533f8);return _0x3acb06;});}function getBooleanList(_0x288ae8,_0x21c7f2,_0x583843,_0x1555e1,_0x42c716,_0x3f91c7){var _0x12a51e={'method':_0x4a0e('0x9a'),'uri':_0x288ae8+_0x4a0e('0xb7')+_0x1555e1+_0x4a0e('0xb8')+_0x42c716+_0x4a0e('0xbe'),'headers':{'Authorization':_0x4a0e('0x9c')+_0x3f91c7,'If-None-Match':null,'OData-Version':_0x4a0e('0x9d')},'json':!![]};return rp(_0x12a51e)[_0x4a0e('0x12')](function(_0x4dfde5){var _0x4d7250=[];_0x4d7250[_0x4a0e('0xa6')]({'name':_0x4dfde5[_0x4a0e('0xba')][_0x4a0e('0xbf')][_0x4a0e('0xbc')][_0x4a0e('0xc0')][_0x4a0e('0xbc')],'value':_0x4a0e('0xc1')},{'name':_0x4dfde5[_0x4a0e('0xba')]['FalseOption']['Label']['UserLocalizedLabel']['Label'],'value':_0x4a0e('0xc2')});var _0x10a0b0={'id':_0x21c7f2+'_'+_0x4dfde5[_0x4a0e('0xa2')],'name':_0x4dfde5['DisplayName'][_0x4a0e('0xc0')][_0x4a0e('0xbc')],'custom':![],'options':_0x4d7250};_0x583843['push'](_0x10a0b0);return _0x583843;});}function getInputList(_0x455aa6,_0x3acf8a,_0x5533c2,_0x383b5f,_0x3d27a4,_0x145a86,_0x2b099e){var _0xd2a900={'method':_0x4a0e('0x9a'),'uri':_0x455aa6+_0x4a0e('0xb7')+_0x3d27a4+_0x4a0e('0xb8')+_0x145a86+')/Microsoft.Dynamics.CRM.'+_0x5533c2+_0x4a0e('0xc3'),'headers':{'Authorization':_0x4a0e('0x9c')+_0x2b099e,'If-None-Match':null,'OData-Version':_0x4a0e('0x9d')},'json':!![]};return rp(_0xd2a900)[_0x4a0e('0x12')](function(_0x1e9567){var _0x2b8112={'id':_0x3acf8a+'_'+_0x1e9567['LogicalName'],'name':_0x1e9567[_0x4a0e('0xbd')][_0x4a0e('0xc0')]?_0x1e9567['DisplayName'][_0x4a0e('0xc0')][_0x4a0e('0xbc')]:_0x1e9567[_0x4a0e('0xa2')],'custom':![],'options':[]};_0x383b5f[_0x4a0e('0xa6')](_0x2b8112);return _0x383b5f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 45faa9e..836bff6 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_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 logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x4a0444,_0x51caf0){var _0x26eac4=function(_0x368bd0){while(--_0x368bd0){_0x4a0444['push'](_0x4a0444['shift']());}};_0x26eac4(++_0x51caf0);}(_0x757a,0xde));var _0xa757=function(_0x2c4796,_0x461141){_0x2c4796=_0x2c4796-0x0;var _0xa26450=_0x757a[_0x2c4796];return _0xa26450;};'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'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'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 f4238b6..018b3c9 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 _0x9a85=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','info','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','debug','catch','ShowDynamics365Account','then'];(function(_0x3f3696,_0x5f2351){var _0x29214d=function(_0x594cc3){while(--_0x594cc3){_0x3f3696['push'](_0x3f3696['shift']());}};_0x29214d(++_0x5f2351);}(_0x9a85,0xf6));var _0x59a8=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0x9a85[_0x2a2166];return _0x3bcf50;};'use strict';var _=require(_0x59a8('0x0'));var util=require(_0x59a8('0x1'));var moment=require(_0x59a8('0x2'));var BPromise=require(_0x59a8('0x3'));var rs=require(_0x59a8('0x4'));var fs=require('fs');var Redis=require(_0x59a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x59a8('0x6'));var logger=require(_0x59a8('0x7'))(_0x59a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x59a8('0x9'));var client=jayson['client'][_0x59a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fc8a1,_0x181325,_0x3b3af7){return new BPromise(function(_0x1916ca,_0x35bf42){return client[_0x59a8('0xb')](_0x3fc8a1,_0x3b3af7)['then'](function(_0x5345c2){logger['info'](_0x59a8('0xc'),_0x181325,_0x59a8('0xd'));logger['debug'](_0x59a8('0xe'),_0x181325,_0x59a8('0xd'),JSON['stringify'](_0x5345c2));if(_0x5345c2[_0x59a8('0xf')]){if(_0x5345c2[_0x59a8('0xf')][_0x59a8('0x10')]===0x1f4){logger[_0x59a8('0xf')]('Dynamics365Account,\x20%s,\x20%s',_0x181325,_0x5345c2[_0x59a8('0xf')]['message']);return _0x35bf42(_0x5345c2[_0x59a8('0xf')]['message']);}logger[_0x59a8('0xf')](_0x59a8('0xc'),_0x181325,_0x5345c2[_0x59a8('0xf')]['message']);return _0x1916ca(_0x5345c2['error'][_0x59a8('0x11')]);}else{logger[_0x59a8('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x181325,_0x59a8('0xd'));_0x1916ca(_0x5345c2['result'][_0x59a8('0x11')]);}})['catch'](function(_0x130086){logger[_0x59a8('0xf')](_0x59a8('0xc'),_0x181325,_0x130086);_0x35bf42(_0x130086);});});}exports['GetDynamics365Account']=function(_0x98347a){var _0x5b4246=this;return new Promise(function(_0x161cda,_0x5e3975){return db[_0x59a8('0x13')][_0x59a8('0x14')]({'raw':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x16')]===undefined?!![]:![]:!![],'where':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x17')]||null:null,'attributes':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x18')]||null:null,'limit':_0x98347a[_0x59a8('0x15')]?_0x98347a['options'][_0x59a8('0x19')]||null:null,'include':_0x98347a[_0x59a8('0x15')]?_0x98347a[_0x59a8('0x15')][_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0x98347a['options']['include'],function(_0xd5eda8){return{'model':db[_0xd5eda8[_0x59a8('0x1c')]],'as':_0xd5eda8['as'],'attributes':_0xd5eda8[_0x59a8('0x18')],'include':_0xd5eda8[_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0xd5eda8[_0x59a8('0x1a')],function(_0x591955){return{'model':db[_0x591955[_0x59a8('0x1c')]],'as':_0x591955['as'],'attributes':_0x591955[_0x59a8('0x18')],'include':_0x591955['include']?_[_0x59a8('0x1b')](_0x591955[_0x59a8('0x1a')],function(_0x3f0104){return{'model':db[_0x3f0104[_0x59a8('0x1c')]],'as':_0x3f0104['as'],'attributes':_0x3f0104[_0x59a8('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fefda){logger[_0x59a8('0x12')](_0x59a8('0x1d'),_0x98347a);logger[_0x59a8('0x1e')](_0x59a8('0x1d'),_0x98347a,JSON['stringify'](_0x4fefda));_0x161cda(_0x4fefda);})[_0x59a8('0x1f')](function(_0x13bd94){logger[_0x59a8('0xf')](_0x59a8('0x1d'),_0x13bd94[_0x59a8('0x11')],_0x98347a);_0x5e3975(_0x5b4246[_0x59a8('0xf')](0x1f4,_0x13bd94[_0x59a8('0x11')]));});});};exports[_0x59a8('0x20')]=function(_0x2840e6){var _0x9a5d7=this;return new Promise(function(_0x40463f,_0x2c8c18){return db[_0x59a8('0x13')]['find']({'raw':_0x2840e6[_0x59a8('0x15')]?_0x2840e6[_0x59a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2840e6[_0x59a8('0x15')]?_0x2840e6[_0x59a8('0x15')][_0x59a8('0x17')]||null:null,'attributes':_0x2840e6['options']?_0x2840e6[_0x59a8('0x15')]['attributes']||null:null,'include':_0x2840e6[_0x59a8('0x15')]?_0x2840e6[_0x59a8('0x15')][_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0x2840e6[_0x59a8('0x15')]['include'],function(_0xdfe223){return{'model':db[_0xdfe223[_0x59a8('0x1c')]],'as':_0xdfe223['as'],'attributes':_0xdfe223[_0x59a8('0x18')],'include':_0xdfe223[_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0xdfe223[_0x59a8('0x1a')],function(_0x5a53b6){return{'model':db[_0x5a53b6[_0x59a8('0x1c')]],'as':_0x5a53b6['as'],'attributes':_0x5a53b6['attributes'],'include':_0x5a53b6[_0x59a8('0x1a')]?_[_0x59a8('0x1b')](_0x5a53b6[_0x59a8('0x1a')],function(_0xe89a75){return{'model':db[_0xe89a75[_0x59a8('0x1c')]],'as':_0xe89a75['as'],'attributes':_0xe89a75['attributes']};}):[]};}):[]};}):[]:[]})[_0x59a8('0x21')](function(_0x5c7caf){logger['info'](_0x59a8('0x20'),_0x2840e6);logger['debug'](_0x59a8('0x20'),_0x2840e6,JSON[_0x59a8('0x22')](_0x5c7caf));_0x40463f(_0x5c7caf);})[_0x59a8('0x1f')](function(_0x47e2e0){logger[_0x59a8('0xf')]('ShowDynamics365Account',_0x47e2e0[_0x59a8('0x11')],_0x2840e6);_0x2c8c18(_0x9a5d7[_0x59a8('0xf')](0x1f4,_0x47e2e0['message']));});});}; \ No newline at end of file +var _0x88e3=['where','limit','include','map','model','attributes','ShowDynamics365Account','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x88e3,0x1c7));var _0x388e=function(_0x416a0a,_0x24f91f){_0x416a0a=_0x416a0a-0x0;var _0x574c9f=_0x88e3[_0x416a0a];return _0x574c9f;};'use strict';var _=require(_0x388e('0x0'));var util=require('util');var moment=require(_0x388e('0x1'));var BPromise=require(_0x388e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x388e('0x3'));var db=require(_0x388e('0x4'))['db'];var utils=require(_0x388e('0x5'));var logger=require('../../config/logger')(_0x388e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x388e('0x7')][_0x388e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17cdb8,_0xa53815,_0x9342f0){return new BPromise(function(_0x3fb1cc,_0x575507){return client['request'](_0x17cdb8,_0x9342f0)[_0x388e('0x9')](function(_0x4176e0){logger[_0x388e('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0xa53815,'request\x20sent');logger[_0x388e('0xb')](_0x388e('0xc'),_0xa53815,_0x388e('0xd'),JSON[_0x388e('0xe')](_0x4176e0));if(_0x4176e0[_0x388e('0xf')]){if(_0x4176e0[_0x388e('0xf')][_0x388e('0x10')]===0x1f4){logger[_0x388e('0xf')](_0x388e('0x11'),_0xa53815,_0x4176e0[_0x388e('0xf')][_0x388e('0x12')]);return _0x575507(_0x4176e0[_0x388e('0xf')]['message']);}logger[_0x388e('0xf')](_0x388e('0x11'),_0xa53815,_0x4176e0[_0x388e('0xf')][_0x388e('0x12')]);return _0x3fb1cc(_0x4176e0[_0x388e('0xf')][_0x388e('0x12')]);}else{logger[_0x388e('0xa')](_0x388e('0x11'),_0xa53815,_0x388e('0xd'));_0x3fb1cc(_0x4176e0[_0x388e('0x13')]['message']);}})[_0x388e('0x14')](function(_0x24e9f5){logger[_0x388e('0xf')](_0x388e('0x11'),_0xa53815,_0x24e9f5);_0x575507(_0x24e9f5);});});}exports[_0x388e('0x15')]=function(_0x178bff){var _0xf2913e=this;return new Promise(function(_0x5b99b7,_0x494946){return db[_0x388e('0x16')]['findAll']({'raw':_0x178bff[_0x388e('0x17')]?_0x178bff[_0x388e('0x17')][_0x388e('0x18')]===undefined?!![]:![]:!![],'where':_0x178bff[_0x388e('0x17')]?_0x178bff[_0x388e('0x17')][_0x388e('0x19')]||null:null,'attributes':_0x178bff[_0x388e('0x17')]?_0x178bff[_0x388e('0x17')]['attributes']||null:null,'limit':_0x178bff['options']?_0x178bff[_0x388e('0x17')][_0x388e('0x1a')]||null:null,'include':_0x178bff[_0x388e('0x17')]?_0x178bff[_0x388e('0x17')][_0x388e('0x1b')]?_[_0x388e('0x1c')](_0x178bff[_0x388e('0x17')][_0x388e('0x1b')],function(_0xf0726){return{'model':db[_0xf0726[_0x388e('0x1d')]],'as':_0xf0726['as'],'attributes':_0xf0726[_0x388e('0x1e')],'include':_0xf0726[_0x388e('0x1b')]?_[_0x388e('0x1c')](_0xf0726[_0x388e('0x1b')],function(_0x1b375e){return{'model':db[_0x1b375e['model']],'as':_0x1b375e['as'],'attributes':_0x1b375e['attributes'],'include':_0x1b375e['include']?_['map'](_0x1b375e['include'],function(_0x34d27f){return{'model':db[_0x34d27f[_0x388e('0x1d')]],'as':_0x34d27f['as'],'attributes':_0x34d27f[_0x388e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1741c5){logger[_0x388e('0xa')]('GetDynamics365Account',_0x178bff);logger[_0x388e('0xb')]('GetDynamics365Account',_0x178bff,JSON[_0x388e('0xe')](_0x1741c5));_0x5b99b7(_0x1741c5);})[_0x388e('0x14')](function(_0x23b9ec){logger['error'](_0x388e('0x15'),_0x23b9ec[_0x388e('0x12')],_0x178bff);_0x494946(_0xf2913e['error'](0x1f4,_0x23b9ec['message']));});});};exports[_0x388e('0x1f')]=function(_0x275924){var _0x412b08=this;return new Promise(function(_0x17523f,_0x538398){return db[_0x388e('0x16')]['find']({'raw':_0x275924[_0x388e('0x17')]?_0x275924['options']['raw']===undefined?!![]:![]:!![],'where':_0x275924['options']?_0x275924['options'][_0x388e('0x19')]||null:null,'attributes':_0x275924[_0x388e('0x17')]?_0x275924[_0x388e('0x17')][_0x388e('0x1e')]||null:null,'include':_0x275924[_0x388e('0x17')]?_0x275924['options'][_0x388e('0x1b')]?_[_0x388e('0x1c')](_0x275924[_0x388e('0x17')][_0x388e('0x1b')],function(_0x335291){return{'model':db[_0x335291[_0x388e('0x1d')]],'as':_0x335291['as'],'attributes':_0x335291[_0x388e('0x1e')],'include':_0x335291[_0x388e('0x1b')]?_['map'](_0x335291[_0x388e('0x1b')],function(_0x54d581){return{'model':db[_0x54d581[_0x388e('0x1d')]],'as':_0x54d581['as'],'attributes':_0x54d581[_0x388e('0x1e')],'include':_0x54d581[_0x388e('0x1b')]?_['map'](_0x54d581['include'],function(_0x444792){return{'model':db[_0x444792[_0x388e('0x1d')]],'as':_0x444792['as'],'attributes':_0x444792[_0x388e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x388e('0x9')](function(_0x5aba75){logger['info'](_0x388e('0x1f'),_0x275924);logger[_0x388e('0xb')](_0x388e('0x1f'),_0x275924,JSON[_0x388e('0xe')](_0x5aba75));_0x17523f(_0x5aba75);})[_0x388e('0x14')](function(_0x14ed97){logger['error'](_0x388e('0x1f'),_0x14ed97['message'],_0x275924);_0x538398(_0x412b08[_0x388e('0xf')](0x1f4,_0x14ed97[_0x388e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 278a075..a3b347a 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 _0x3de3=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4f0b3e,_0x412401){var _0x5da95b=function(_0x570485){while(--_0x570485){_0x4f0b3e['push'](_0x4f0b3e['shift']());}};_0x5da95b(++_0x412401);}(_0x3de3,0x1ce));var _0x33de=function(_0x3c1464,_0x5464dd){_0x3c1464=_0x3c1464-0x0;var _0x8f5247=_0x3de3[_0x3c1464];return _0x8f5247;};'use strict';var multer=require(_0x33de('0x0'));var util=require('util');var path=require(_0x33de('0x1'));var timeout=require(_0x33de('0x2'));var express=require('express');var router=express[_0x33de('0x3')]();var fs_extra=require(_0x33de('0x4'));var auth=require(_0x33de('0x5'));var interaction=require(_0x33de('0x6'));var config=require('../../config/environment');var controller=require(_0x33de('0x7'));router[_0x33de('0x8')]('/',auth['isAuthenticated'](),controller[_0x33de('0x9')]);router['get'](_0x33de('0xa'),auth[_0x33de('0xb')](),controller[_0x33de('0xc')]);router['get'](_0x33de('0xd'),auth[_0x33de('0xb')](),controller[_0x33de('0xe')]);router['get'](_0x33de('0xf'),auth[_0x33de('0xb')](),controller[_0x33de('0x10')]);router[_0x33de('0x8')](_0x33de('0x11'),auth[_0x33de('0xb')](),controller[_0x33de('0x12')]);router[_0x33de('0x13')]('/',auth[_0x33de('0xb')](),controller[_0x33de('0x14')]);router[_0x33de('0x15')]('/:id',auth[_0x33de('0xb')](),controller[_0x33de('0x16')]);router['delete']('/:id',auth[_0x33de('0xb')](),controller[_0x33de('0x17')]);module[_0x33de('0x18')]=router; \ No newline at end of file +var _0x57ef=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','update'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x57ef,0xdb));var _0xf57e=function(_0x381016,_0x238bef){_0x381016=_0x381016-0x0;var _0x1d26ff=_0x57ef[_0x381016];return _0x1d26ff;};'use strict';var multer=require('multer');var util=require(_0xf57e('0x0'));var path=require(_0xf57e('0x1'));var timeout=require(_0xf57e('0x2'));var express=require(_0xf57e('0x3'));var router=express[_0xf57e('0x4')]();var fs_extra=require(_0xf57e('0x5'));var auth=require(_0xf57e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf57e('0x7'));var controller=require(_0xf57e('0x8'));router[_0xf57e('0x9')]('/',auth[_0xf57e('0xa')](),controller[_0xf57e('0xb')]);router[_0xf57e('0x9')](_0xf57e('0xc'),auth[_0xf57e('0xa')](),controller['show']);router[_0xf57e('0x9')](_0xf57e('0xd'),auth[_0xf57e('0xa')](),controller[_0xf57e('0xe')]);router[_0xf57e('0x9')]('/:id/subjects',auth[_0xf57e('0xa')](),controller[_0xf57e('0xf')]);router['get'](_0xf57e('0x10'),auth[_0xf57e('0xa')](),controller[_0xf57e('0x11')]);router[_0xf57e('0x12')]('/',auth[_0xf57e('0xa')](),controller[_0xf57e('0x13')]);router['put'](_0xf57e('0xc'),auth[_0xf57e('0xa')](),controller[_0xf57e('0x14')]);router[_0xf57e('0x15')](_0xf57e('0xc'),auth[_0xf57e('0xa')](),controller[_0xf57e('0x16')]);module[_0xf57e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index b2edda1..de895fd 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 _0xbcb0=['nothing','BOOLEAN','sequelize','exports','STRING','incident','phonecall','ENUM','contact'];(function(_0x1279e0,_0x30599f){var _0x211a2b=function(_0x32f0c6){while(--_0x32f0c6){_0x1279e0['push'](_0x1279e0['shift']());}};_0x211a2b(++_0x30599f);}(_0xbcb0,0x80));var _0x0bcb=function(_0x1ca4f8,_0x5591b6){_0x1ca4f8=_0x1ca4f8-0x0;var _0x48f1af=_0xbcb0[_0x1ca4f8];return _0x48f1af;};'use strict';var Sequelize=require(_0x0bcb('0x0'));module[_0x0bcb('0x1')]={'name':{'type':Sequelize[_0x0bcb('0x2')]},'description':{'type':Sequelize[_0x0bcb('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x0bcb('0x3'),_0x0bcb('0x4')),'defaultValue':_0x0bcb('0x3')},'moduleCreate':{'type':Sequelize[_0x0bcb('0x5')](_0x0bcb('0x6'),_0x0bcb('0x7')),'defaultValue':_0x0bcb('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x0bcb('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x0bcb('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3856=['nothing','BOOLEAN','exports','STRING','ENUM','phonecall','incident','contact'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x3856,0xf2));var _0x6385=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x3856[_0xc8db6b];return _0x12cb81;};'use strict';var Sequelize=require('sequelize');module[_0x6385('0x0')]={'name':{'type':Sequelize[_0x6385('0x1')]},'description':{'type':Sequelize[_0x6385('0x1')]},'ticketType':{'type':Sequelize[_0x6385('0x2')]('incident',_0x6385('0x3')),'defaultValue':_0x6385('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0x6385('0x5'),_0x6385('0x6')),'defaultValue':_0x6385('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x6385('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x6385('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 9dfe429..54acd78 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 _0xf766=['fields','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','rows','keys','intersection','length','find','create','body','catch','params','getFields','findOne','Dynamics365Field','order','filter','getSubjects','getDescriptions','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','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','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','query','filters','model','attributes'];(function(_0x2b94b4,_0x8f878){var _0x41b774=function(_0x80cfc5){while(--_0x80cfc5){_0x2b94b4['push'](_0x2b94b4['shift']());}};_0x41b774(++_0x8f878);}(_0xf766,0x1b5));var _0x6f76=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0xf766[_0x254d9f];return _0x1eedb9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6f76('0x0'));var moment=require(_0x6f76('0x1'));var BPromise=require(_0x6f76('0x2'));var Mustache=require(_0x6f76('0x3'));var util=require(_0x6f76('0x4'));var path=require('path');var sox=require(_0x6f76('0x5'));var csv=require(_0x6f76('0x6'));var ejs=require(_0x6f76('0x7'));var fs=require('fs');var fs_extra=require(_0x6f76('0x8'));var _=require(_0x6f76('0x9'));var squel=require(_0x6f76('0xa'));var crypto=require(_0x6f76('0xb'));var jsforce=require(_0x6f76('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f76('0x6'));var querystring=require('querystring');var Papa=require(_0x6f76('0xd'));var Redis=require(_0x6f76('0xe'));var authService=require(_0x6f76('0xf'));var qs=require(_0x6f76('0x10'));var as=require(_0x6f76('0x11'));var hardwareService=require(_0x6f76('0x12'));var logger=require(_0x6f76('0x13'))(_0x6f76('0x14'));var utils=require(_0x6f76('0x15'));var config=require(_0x6f76('0x16'));var licenseUtil=require(_0x6f76('0x17'));var db=require(_0x6f76('0x18'))['db'];function respondWithStatusCode(_0x4f541a,_0x7b1af6){_0x7b1af6=_0x7b1af6||0xcc;return function(_0x3b9b5f){if(_0x3b9b5f){return _0x4f541a['sendStatus'](_0x7b1af6);}return _0x4f541a['status'](_0x7b1af6)[_0x6f76('0x19')]();};}function respondWithResult(_0x2f0a55,_0x2d3a05){_0x2d3a05=_0x2d3a05||0xc8;return function(_0x4b0da1){if(_0x4b0da1){return _0x2f0a55[_0x6f76('0x1a')](_0x2d3a05)[_0x6f76('0x1b')](_0x4b0da1);}};}function respondWithFilteredResult(_0x21af50,_0x342ff9){return function(_0x2206cc){if(_0x2206cc){var _0x2746e9=typeof _0x342ff9[_0x6f76('0x1c')]===_0x6f76('0x1d')&&typeof _0x342ff9['limit']===_0x6f76('0x1d');var _0x383b7d=_0x2206cc[_0x6f76('0x1e')];var _0x5205e9=_0x2746e9?0x0:_0x342ff9[_0x6f76('0x1c')];var _0x4211ad=_0x2746e9?_0x2206cc[_0x6f76('0x1e')]:_0x342ff9[_0x6f76('0x1c')]+_0x342ff9[_0x6f76('0x1f')];var _0x287c95;if(_0x4211ad>=_0x383b7d){_0x4211ad=_0x383b7d;_0x287c95=0xc8;}else{_0x287c95=0xce;}_0x21af50[_0x6f76('0x1a')](_0x287c95);return _0x21af50[_0x6f76('0x20')]('Content-Range',_0x5205e9+'-'+_0x4211ad+'/'+_0x383b7d)['json'](_0x2206cc);}return null;};}function patchUpdates(_0x9668c9){return function(_0x421e4d){try{jsonpatch[_0x6f76('0x21')](_0x421e4d,_0x9668c9,!![]);}catch(_0xe9c7e7){return BPromise[_0x6f76('0x22')](_0xe9c7e7);}return _0x421e4d[_0x6f76('0x23')]();};}function saveUpdates(_0x576989,_0x5909d0){return function(_0x271774){if(_0x271774){return _0x271774[_0x6f76('0x24')](_0x576989)[_0x6f76('0x25')](function(_0x5c0d06){return _0x5c0d06;});}return null;};}function removeEntity(_0xfbefff,_0x27b5a7){return function(_0x32b30f){if(_0x32b30f){return _0x32b30f[_0x6f76('0x26')]()[_0x6f76('0x25')](function(){_0xfbefff[_0x6f76('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51fce6,_0x1c1aae){return function(_0x30711d){if(!_0x30711d){_0x51fce6[_0x6f76('0x27')](0x194);}return _0x30711d;};}function handleError(_0xbfc750,_0x26063e){_0x26063e=_0x26063e||0x1f4;return function(_0x46d488){logger[_0x6f76('0x28')](_0x46d488[_0x6f76('0x29')]);if(_0x46d488[_0x6f76('0x2a')]){delete _0x46d488['name'];}_0xbfc750[_0x6f76('0x1a')](_0x26063e)[_0x6f76('0x2b')](_0x46d488);};}exports[_0x6f76('0x2c')]=function(_0x4aecdd,_0x421842){var _0x266159={},_0x41a588={},_0x5bc0c5={'count':0x0,'rows':[]};var _0x59ceb0=_[_0x6f76('0x2d')](db[_0x6f76('0x2e')][_0x6f76('0x2f')],function(_0x48153b){return{'name':_0x48153b[_0x6f76('0x30')],'type':_0x48153b[_0x6f76('0x31')][_0x6f76('0x32')]};});_0x41a588['model']=_['map'](_0x59ceb0,_0x6f76('0x2a'));_0x41a588[_0x6f76('0x33')]=_['keys'](_0x4aecdd[_0x6f76('0x33')]);_0x41a588[_0x6f76('0x34')]=_['intersection'](_0x41a588[_0x6f76('0x35')],_0x41a588['query']);_0x266159[_0x6f76('0x36')]=_['intersection'](_0x41a588[_0x6f76('0x35')],qs['fields'](_0x4aecdd['query'][_0x6f76('0x37')]));_0x266159[_0x6f76('0x36')]=_0x266159['attributes']['length']?_0x266159[_0x6f76('0x36')]:_0x41a588[_0x6f76('0x35')];if(!_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x38')](_0x6f76('0x39'))){_0x266159[_0x6f76('0x1f')]=qs['limit'](_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x1f')]);_0x266159['offset']=qs['offset'](_0x4aecdd['query'][_0x6f76('0x1c')]);}_0x266159['order']=qs[_0x6f76('0x3a')](_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x3a')]);_0x266159[_0x6f76('0x3b')]=qs[_0x6f76('0x34')](_[_0x6f76('0x3c')](_0x4aecdd[_0x6f76('0x33')],_0x41a588[_0x6f76('0x34')]),_0x59ceb0);if(_0x4aecdd[_0x6f76('0x33')]['filter']){_0x266159['where']=_[_0x6f76('0x3d')](_0x266159[_0x6f76('0x3b')],{'$or':_[_0x6f76('0x2d')](_0x59ceb0,function(_0x333025){if(_0x333025['type']!=='VIRTUAL'){var _0x1bab50={};_0x1bab50[_0x333025[_0x6f76('0x2a')]]={'$like':'%'+_0x4aecdd[_0x6f76('0x33')]['filter']+'%'};return _0x1bab50;}})});}_0x266159=_['merge']({},_0x266159,_0x4aecdd[_0x6f76('0x3e')]);var _0x1826ac={'where':_0x266159[_0x6f76('0x3b')]};return db[_0x6f76('0x2e')][_0x6f76('0x1e')](_0x1826ac)[_0x6f76('0x25')](function(_0x3def68){_0x5bc0c5[_0x6f76('0x1e')]=_0x3def68;if(_0x4aecdd[_0x6f76('0x33')][_0x6f76('0x3f')]){_0x266159[_0x6f76('0x40')]=[{'all':!![]}];}return db[_0x6f76('0x2e')][_0x6f76('0x41')](_0x266159);})[_0x6f76('0x25')](function(_0x41af46){_0x5bc0c5[_0x6f76('0x42')]=_0x41af46;return _0x5bc0c5;})['then'](respondWithFilteredResult(_0x421842,_0x266159))['catch'](handleError(_0x421842,null));};exports['show']=function(_0x1aa8d9,_0x3d9744){var _0x2dc269={'raw':![],'where':{'id':_0x1aa8d9['params']['id']}},_0x2791c7={};_0x2791c7[_0x6f76('0x35')]=_['keys'](db[_0x6f76('0x2e')]['rawAttributes']);_0x2791c7['query']=_[_0x6f76('0x43')](_0x1aa8d9['query']);_0x2791c7[_0x6f76('0x34')]=_[_0x6f76('0x44')](_0x2791c7[_0x6f76('0x35')],_0x2791c7[_0x6f76('0x33')]);_0x2dc269[_0x6f76('0x36')]=_[_0x6f76('0x44')](_0x2791c7['model'],qs['fields'](_0x1aa8d9[_0x6f76('0x33')][_0x6f76('0x37')]));_0x2dc269[_0x6f76('0x36')]=_0x2dc269['attributes'][_0x6f76('0x45')]?_0x2dc269['attributes']:_0x2791c7['model'];if(_0x1aa8d9[_0x6f76('0x33')][_0x6f76('0x3f')]){_0x2dc269[_0x6f76('0x40')]=[{'all':!![]}];}_0x2dc269=_['merge']({},_0x2dc269,_0x1aa8d9['options']);return db['Dynamics365Configuration'][_0x6f76('0x46')](_0x2dc269)['then'](handleEntityNotFound(_0x3d9744,null))[_0x6f76('0x25')](respondWithResult(_0x3d9744,null))['catch'](handleError(_0x3d9744,null));};exports[_0x6f76('0x47')]=function(_0x419db7,_0x6164ee){return db[_0x6f76('0x2e')][_0x6f76('0x47')](_0x419db7[_0x6f76('0x48')],{})[_0x6f76('0x25')](respondWithResult(_0x6164ee,0xc9))[_0x6f76('0x49')](handleError(_0x6164ee,null));};exports[_0x6f76('0x24')]=function(_0x3ba92b,_0x40df0e){if(_0x3ba92b[_0x6f76('0x48')]['id']){delete _0x3ba92b[_0x6f76('0x48')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0x3ba92b[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x40df0e,null))['then'](saveUpdates(_0x3ba92b[_0x6f76('0x48')],null))['then'](respondWithResult(_0x40df0e,null))[_0x6f76('0x49')](handleError(_0x40df0e,null));};exports[_0x6f76('0x26')]=function(_0x3c35df,_0x2dec04){return db[_0x6f76('0x2e')][_0x6f76('0x46')]({'where':{'id':_0x3c35df[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x2dec04,null))[_0x6f76('0x25')](removeEntity(_0x2dec04,null))['catch'](handleError(_0x2dec04,null));};exports[_0x6f76('0x4b')]=function(_0xd3c19a,_0x19fe0b,_0x22b067){var _0x550698={};var _0x1dcc4e={};var _0x72f5cc;var _0x5df481;return db[_0x6f76('0x2e')][_0x6f76('0x4c')]({'where':{'id':_0xd3c19a[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x19fe0b,null))['then'](function(_0x4423cf){if(_0x4423cf){_0x72f5cc=_0x4423cf;_0x1dcc4e[_0x6f76('0x35')]=_[_0x6f76('0x43')](db[_0x6f76('0x4d')][_0x6f76('0x2f')]);_0x1dcc4e[_0x6f76('0x33')]=_[_0x6f76('0x43')](_0xd3c19a[_0x6f76('0x33')]);_0x1dcc4e[_0x6f76('0x34')]=_['intersection'](_0x1dcc4e[_0x6f76('0x35')],_0x1dcc4e[_0x6f76('0x33')]);_0x550698['attributes']=_[_0x6f76('0x44')](_0x1dcc4e[_0x6f76('0x35')],qs[_0x6f76('0x37')](_0xd3c19a[_0x6f76('0x33')]['fields']));_0x550698['attributes']=_0x550698['attributes'][_0x6f76('0x45')]?_0x550698[_0x6f76('0x36')]:_0x1dcc4e[_0x6f76('0x35')];_0x550698[_0x6f76('0x4e')]=qs[_0x6f76('0x3a')](_0xd3c19a[_0x6f76('0x33')][_0x6f76('0x3a')]);_0x550698[_0x6f76('0x3b')]=qs['filters'](_[_0x6f76('0x3c')](_0xd3c19a['query'],_0x1dcc4e[_0x6f76('0x34')]));if(_0xd3c19a[_0x6f76('0x33')][_0x6f76('0x4f')]){_0x550698[_0x6f76('0x3b')]=_[_0x6f76('0x3d')](_0x550698[_0x6f76('0x3b')],{'$or':_[_0x6f76('0x2d')](_0x550698['attributes'],function(_0x49ebfc){var _0x22cc05={};_0x22cc05[_0x49ebfc]={'$like':'%'+_0xd3c19a[_0x6f76('0x33')]['filter']+'%'};return _0x22cc05;})});}_0x550698=_['merge']({},_0x550698,_0xd3c19a[_0x6f76('0x3e')]);return _0x72f5cc[_0x6f76('0x4b')](_0x550698);}})['then'](function(_0x2d2e19){if(_0x2d2e19){_0x5df481=_0x2d2e19[_0x6f76('0x45')];if(!_0xd3c19a['query'][_0x6f76('0x38')](_0x6f76('0x39'))){_0x550698[_0x6f76('0x1f')]=qs[_0x6f76('0x1f')](_0xd3c19a[_0x6f76('0x33')]['limit']);_0x550698[_0x6f76('0x1c')]=qs['offset'](_0xd3c19a[_0x6f76('0x33')][_0x6f76('0x1c')]);}return _0x72f5cc['getFields'](_0x550698);}})['then'](function(_0x28a9ad){if(_0x28a9ad){return _0x28a9ad?{'count':_0x5df481,'rows':_0x28a9ad}:null;}})['then'](respondWithResult(_0x19fe0b,null))[_0x6f76('0x49')](handleError(_0x19fe0b,null));};exports['getSubjects']=function(_0x458712,_0x4988f2,_0x9af2ed){var _0x1a8052={};var _0x45a8b7={};var _0x51eb4e;var _0x3f6284;return db[_0x6f76('0x2e')][_0x6f76('0x4c')]({'where':{'id':_0x458712[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x4988f2,null))['then'](function(_0x2ec3db){if(_0x2ec3db){_0x51eb4e=_0x2ec3db;_0x45a8b7[_0x6f76('0x35')]=_[_0x6f76('0x43')](db['Dynamics365Field'][_0x6f76('0x2f')]);_0x45a8b7[_0x6f76('0x33')]=_[_0x6f76('0x43')](_0x458712[_0x6f76('0x33')]);_0x45a8b7[_0x6f76('0x34')]=_[_0x6f76('0x44')](_0x45a8b7[_0x6f76('0x35')],_0x45a8b7[_0x6f76('0x33')]);_0x1a8052[_0x6f76('0x36')]=_['intersection'](_0x45a8b7[_0x6f76('0x35')],qs[_0x6f76('0x37')](_0x458712[_0x6f76('0x33')]['fields']));_0x1a8052[_0x6f76('0x36')]=_0x1a8052['attributes'][_0x6f76('0x45')]?_0x1a8052[_0x6f76('0x36')]:_0x45a8b7[_0x6f76('0x35')];_0x1a8052[_0x6f76('0x4e')]=qs[_0x6f76('0x3a')](_0x458712[_0x6f76('0x33')]['sort']);_0x1a8052[_0x6f76('0x3b')]=qs['filters'](_[_0x6f76('0x3c')](_0x458712[_0x6f76('0x33')],_0x45a8b7[_0x6f76('0x34')]));if(_0x458712['query'][_0x6f76('0x4f')]){_0x1a8052[_0x6f76('0x3b')]=_[_0x6f76('0x3d')](_0x1a8052[_0x6f76('0x3b')],{'$or':_['map'](_0x1a8052[_0x6f76('0x36')],function(_0x3cf160){var _0x470b2d={};_0x470b2d[_0x3cf160]={'$like':'%'+_0x458712[_0x6f76('0x33')]['filter']+'%'};return _0x470b2d;})});}_0x1a8052=_[_0x6f76('0x3d')]({},_0x1a8052,_0x458712[_0x6f76('0x3e')]);return _0x51eb4e[_0x6f76('0x50')](_0x1a8052);}})[_0x6f76('0x25')](function(_0x24ffa2){if(_0x24ffa2){_0x3f6284=_0x24ffa2['length'];if(!_0x458712[_0x6f76('0x33')]['hasOwnProperty'](_0x6f76('0x39'))){_0x1a8052[_0x6f76('0x1f')]=qs['limit'](_0x458712[_0x6f76('0x33')][_0x6f76('0x1f')]);_0x1a8052[_0x6f76('0x1c')]=qs['offset'](_0x458712[_0x6f76('0x33')][_0x6f76('0x1c')]);}return _0x51eb4e[_0x6f76('0x50')](_0x1a8052);}})[_0x6f76('0x25')](function(_0x54ab1f){if(_0x54ab1f){return _0x54ab1f?{'count':_0x3f6284,'rows':_0x54ab1f}:null;}})[_0x6f76('0x25')](respondWithResult(_0x4988f2,null))[_0x6f76('0x49')](handleError(_0x4988f2,null));};exports[_0x6f76('0x51')]=function(_0x563cf8,_0x41456c,_0x445bbe){var _0x470d4a={};var _0x1b0063={};var _0x1464bb;var _0x4c9c40;return db[_0x6f76('0x2e')][_0x6f76('0x4c')]({'where':{'id':_0x563cf8[_0x6f76('0x4a')]['id']}})[_0x6f76('0x25')](handleEntityNotFound(_0x41456c,null))[_0x6f76('0x25')](function(_0x3e2b2c){if(_0x3e2b2c){_0x1464bb=_0x3e2b2c;_0x1b0063[_0x6f76('0x35')]=_[_0x6f76('0x43')](db['Dynamics365Field'][_0x6f76('0x2f')]);_0x1b0063[_0x6f76('0x33')]=_[_0x6f76('0x43')](_0x563cf8[_0x6f76('0x33')]);_0x1b0063[_0x6f76('0x34')]=_['intersection'](_0x1b0063[_0x6f76('0x35')],_0x1b0063[_0x6f76('0x33')]);_0x470d4a[_0x6f76('0x36')]=_[_0x6f76('0x44')](_0x1b0063[_0x6f76('0x35')],qs[_0x6f76('0x37')](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x37')]));_0x470d4a[_0x6f76('0x36')]=_0x470d4a['attributes']['length']?_0x470d4a[_0x6f76('0x36')]:_0x1b0063[_0x6f76('0x35')];_0x470d4a[_0x6f76('0x4e')]=qs['sort'](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x3a')]);_0x470d4a[_0x6f76('0x3b')]=qs[_0x6f76('0x34')](_[_0x6f76('0x3c')](_0x563cf8[_0x6f76('0x33')],_0x1b0063[_0x6f76('0x34')]));if(_0x563cf8[_0x6f76('0x33')]['filter']){_0x470d4a[_0x6f76('0x3b')]=_[_0x6f76('0x3d')](_0x470d4a['where'],{'$or':_[_0x6f76('0x2d')](_0x470d4a['attributes'],function(_0x3800fc){var _0x519ad7={};_0x519ad7[_0x3800fc]={'$like':'%'+_0x563cf8[_0x6f76('0x33')][_0x6f76('0x4f')]+'%'};return _0x519ad7;})});}_0x470d4a=_[_0x6f76('0x3d')]({},_0x470d4a,_0x563cf8[_0x6f76('0x3e')]);return _0x1464bb[_0x6f76('0x51')](_0x470d4a);}})[_0x6f76('0x25')](function(_0x420df3){if(_0x420df3){_0x4c9c40=_0x420df3[_0x6f76('0x45')];if(!_0x563cf8[_0x6f76('0x33')][_0x6f76('0x38')]('nolimit')){_0x470d4a[_0x6f76('0x1f')]=qs['limit'](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x1f')]);_0x470d4a[_0x6f76('0x1c')]=qs[_0x6f76('0x1c')](_0x563cf8[_0x6f76('0x33')][_0x6f76('0x1c')]);}return _0x1464bb[_0x6f76('0x51')](_0x470d4a);}})[_0x6f76('0x25')](function(_0x302b01){if(_0x302b01){return _0x302b01?{'count':_0x4c9c40,'rows':_0x302b01}:null;}})[_0x6f76('0x25')](respondWithResult(_0x41456c,null))[_0x6f76('0x49')](handleError(_0x41456c,null));}; \ No newline at end of file +var _0xb932=['fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','findOne','Dynamics365Field','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','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','../../mysqldb','end','status','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','key','model','keys','query','filters','intersection','attributes'];(function(_0x52e64,_0x6ba4e8){var _0x282b80=function(_0xc11939){while(--_0xc11939){_0x52e64['push'](_0x52e64['shift']());}};_0x282b80(++_0x6ba4e8);}(_0xb932,0x1bd));var _0x2b93=function(_0x30c65b,_0x5420ad){_0x30c65b=_0x30c65b-0x0;var _0x2f8bf1=_0xb932[_0x30c65b];return _0x2f8bf1;};'use strict';var emlformat=require(_0x2b93('0x0'));var rimraf=require(_0x2b93('0x1'));var zipdir=require(_0x2b93('0x2'));var jsonpatch=require(_0x2b93('0x3'));var rp=require(_0x2b93('0x4'));var moment=require(_0x2b93('0x5'));var BPromise=require(_0x2b93('0x6'));var Mustache=require(_0x2b93('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2b93('0x8'));var ejs=require(_0x2b93('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b93('0xa'));var squel=require(_0x2b93('0xb'));var crypto=require(_0x2b93('0xc'));var jsforce=require(_0x2b93('0xd'));var deskjs=require(_0x2b93('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2b93('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2b93('0x10'));var qs=require(_0x2b93('0x11'));var as=require(_0x2b93('0x12'));var hardwareService=require(_0x2b93('0x13'));var logger=require(_0x2b93('0x14'))(_0x2b93('0x15'));var utils=require(_0x2b93('0x16'));var config=require(_0x2b93('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2b93('0x18'))['db'];function respondWithStatusCode(_0x1e1a9e,_0xaecffe){_0xaecffe=_0xaecffe||0xcc;return function(_0xa5a7d1){if(_0xa5a7d1){return _0x1e1a9e['sendStatus'](_0xaecffe);}return _0x1e1a9e['status'](_0xaecffe)[_0x2b93('0x19')]();};}function respondWithResult(_0x2c3795,_0x59258d){_0x59258d=_0x59258d||0xc8;return function(_0x4db0f4){if(_0x4db0f4){return _0x2c3795[_0x2b93('0x1a')](_0x59258d)[_0x2b93('0x1b')](_0x4db0f4);}};}function respondWithFilteredResult(_0x536587,_0x324a06){return function(_0x4061f2){if(_0x4061f2){var _0x4dffed=typeof _0x324a06[_0x2b93('0x1c')]===_0x2b93('0x1d')&&typeof _0x324a06['limit']===_0x2b93('0x1d');var _0x94939a=_0x4061f2['count'];var _0xbdc379=_0x4dffed?0x0:_0x324a06[_0x2b93('0x1c')];var _0xe72c75=_0x4dffed?_0x4061f2[_0x2b93('0x1e')]:_0x324a06[_0x2b93('0x1c')]+_0x324a06['limit'];var _0xa58fbe;if(_0xe72c75>=_0x94939a){_0xe72c75=_0x94939a;_0xa58fbe=0xc8;}else{_0xa58fbe=0xce;}_0x536587[_0x2b93('0x1a')](_0xa58fbe);return _0x536587[_0x2b93('0x1f')]('Content-Range',_0xbdc379+'-'+_0xe72c75+'/'+_0x94939a)[_0x2b93('0x1b')](_0x4061f2);}return null;};}function patchUpdates(_0x2b6bb3){return function(_0x2f25d9){try{jsonpatch[_0x2b93('0x20')](_0x2f25d9,_0x2b6bb3,!![]);}catch(_0x34143d){return BPromise[_0x2b93('0x21')](_0x34143d);}return _0x2f25d9[_0x2b93('0x22')]();};}function saveUpdates(_0x3f51c1,_0x24619f){return function(_0x4bb52d){if(_0x4bb52d){return _0x4bb52d[_0x2b93('0x23')](_0x3f51c1)[_0x2b93('0x24')](function(_0x4674f6){return _0x4674f6;});}return null;};}function removeEntity(_0x56d5c6,_0x519b47){return function(_0x30ea05){if(_0x30ea05){return _0x30ea05[_0x2b93('0x25')]()['then'](function(){_0x56d5c6[_0x2b93('0x1a')](0xcc)[_0x2b93('0x19')]();});}};}function handleEntityNotFound(_0x5b05df,_0x522dd8){return function(_0xb6a74){if(!_0xb6a74){_0x5b05df[_0x2b93('0x26')](0x194);}return _0xb6a74;};}function handleError(_0x4382a4,_0x345cb6){_0x345cb6=_0x345cb6||0x1f4;return function(_0x113461){logger[_0x2b93('0x27')](_0x113461[_0x2b93('0x28')]);if(_0x113461[_0x2b93('0x29')]){delete _0x113461['name'];}_0x4382a4[_0x2b93('0x1a')](_0x345cb6)[_0x2b93('0x2a')](_0x113461);};}exports[_0x2b93('0x2b')]=function(_0x4e5d2c,_0x13bc4c){var _0x5dd501={},_0x27b3c7={},_0x2accde={'count':0x0,'rows':[]};var _0x5b1098=_[_0x2b93('0x2c')](db[_0x2b93('0x2d')]['rawAttributes'],function(_0x4e46d7){return{'name':_0x4e46d7['fieldName'],'type':_0x4e46d7['type'][_0x2b93('0x2e')]};});_0x27b3c7[_0x2b93('0x2f')]=_[_0x2b93('0x2c')](_0x5b1098,'name');_0x27b3c7['query']=_[_0x2b93('0x30')](_0x4e5d2c[_0x2b93('0x31')]);_0x27b3c7[_0x2b93('0x32')]=_[_0x2b93('0x33')](_0x27b3c7[_0x2b93('0x2f')],_0x27b3c7[_0x2b93('0x31')]);_0x5dd501[_0x2b93('0x34')]=_[_0x2b93('0x33')](_0x27b3c7[_0x2b93('0x2f')],qs[_0x2b93('0x35')](_0x4e5d2c[_0x2b93('0x31')][_0x2b93('0x35')]));_0x5dd501['attributes']=_0x5dd501[_0x2b93('0x34')][_0x2b93('0x36')]?_0x5dd501['attributes']:_0x27b3c7[_0x2b93('0x2f')];if(!_0x4e5d2c[_0x2b93('0x31')][_0x2b93('0x37')]('nolimit')){_0x5dd501['limit']=qs['limit'](_0x4e5d2c[_0x2b93('0x31')][_0x2b93('0x38')]);_0x5dd501['offset']=qs[_0x2b93('0x1c')](_0x4e5d2c[_0x2b93('0x31')][_0x2b93('0x1c')]);}_0x5dd501[_0x2b93('0x39')]=qs[_0x2b93('0x3a')](_0x4e5d2c['query'][_0x2b93('0x3a')]);_0x5dd501[_0x2b93('0x3b')]=qs['filters'](_[_0x2b93('0x3c')](_0x4e5d2c[_0x2b93('0x31')],_0x27b3c7[_0x2b93('0x32')]),_0x5b1098);if(_0x4e5d2c[_0x2b93('0x31')][_0x2b93('0x3d')]){_0x5dd501['where']=_[_0x2b93('0x3e')](_0x5dd501[_0x2b93('0x3b')],{'$or':_['map'](_0x5b1098,function(_0x263799){if(_0x263799[_0x2b93('0x3f')]!==_0x2b93('0x40')){var _0x38d0be={};_0x38d0be[_0x263799[_0x2b93('0x29')]]={'$like':'%'+_0x4e5d2c[_0x2b93('0x31')]['filter']+'%'};return _0x38d0be;}})});}_0x5dd501=_[_0x2b93('0x3e')]({},_0x5dd501,_0x4e5d2c[_0x2b93('0x41')]);var _0x5bca7b={'where':_0x5dd501[_0x2b93('0x3b')]};return db[_0x2b93('0x2d')][_0x2b93('0x1e')](_0x5bca7b)[_0x2b93('0x24')](function(_0x22eb98){_0x2accde[_0x2b93('0x1e')]=_0x22eb98;if(_0x4e5d2c['query'][_0x2b93('0x42')]){_0x5dd501[_0x2b93('0x43')]=[{'all':!![]}];}return db[_0x2b93('0x2d')][_0x2b93('0x44')](_0x5dd501);})[_0x2b93('0x24')](function(_0x455179){_0x2accde[_0x2b93('0x45')]=_0x455179;return _0x2accde;})['then'](respondWithFilteredResult(_0x13bc4c,_0x5dd501))[_0x2b93('0x46')](handleError(_0x13bc4c,null));};exports[_0x2b93('0x47')]=function(_0x5a062d,_0x5a23dc){var _0x3d4508={'raw':![],'where':{'id':_0x5a062d['params']['id']}},_0x4fa65c={};_0x4fa65c[_0x2b93('0x2f')]=_[_0x2b93('0x30')](db[_0x2b93('0x2d')][_0x2b93('0x48')]);_0x4fa65c[_0x2b93('0x31')]=_[_0x2b93('0x30')](_0x5a062d['query']);_0x4fa65c[_0x2b93('0x32')]=_[_0x2b93('0x33')](_0x4fa65c[_0x2b93('0x2f')],_0x4fa65c[_0x2b93('0x31')]);_0x3d4508[_0x2b93('0x34')]=_[_0x2b93('0x33')](_0x4fa65c[_0x2b93('0x2f')],qs[_0x2b93('0x35')](_0x5a062d['query']['fields']));_0x3d4508[_0x2b93('0x34')]=_0x3d4508[_0x2b93('0x34')][_0x2b93('0x36')]?_0x3d4508[_0x2b93('0x34')]:_0x4fa65c[_0x2b93('0x2f')];if(_0x5a062d[_0x2b93('0x31')]['includeAll']){_0x3d4508[_0x2b93('0x43')]=[{'all':!![]}];}_0x3d4508=_[_0x2b93('0x3e')]({},_0x3d4508,_0x5a062d['options']);return db[_0x2b93('0x2d')][_0x2b93('0x49')](_0x3d4508)[_0x2b93('0x24')](handleEntityNotFound(_0x5a23dc,null))[_0x2b93('0x24')](respondWithResult(_0x5a23dc,null))[_0x2b93('0x46')](handleError(_0x5a23dc,null));};exports[_0x2b93('0x4a')]=function(_0x1236e4,_0xad38ae){return db['Dynamics365Configuration'][_0x2b93('0x4a')](_0x1236e4['body'],{})[_0x2b93('0x24')](respondWithResult(_0xad38ae,0xc9))[_0x2b93('0x46')](handleError(_0xad38ae,null));};exports[_0x2b93('0x23')]=function(_0x18977a,_0x57d7bc){if(_0x18977a['body']['id']){delete _0x18977a[_0x2b93('0x4b')]['id'];}return db[_0x2b93('0x2d')][_0x2b93('0x49')]({'where':{'id':_0x18977a[_0x2b93('0x4c')]['id']}})[_0x2b93('0x24')](handleEntityNotFound(_0x57d7bc,null))['then'](saveUpdates(_0x18977a[_0x2b93('0x4b')],null))[_0x2b93('0x24')](respondWithResult(_0x57d7bc,null))[_0x2b93('0x46')](handleError(_0x57d7bc,null));};exports[_0x2b93('0x25')]=function(_0x1c1ef1,_0x35079a){return db['Dynamics365Configuration'][_0x2b93('0x49')]({'where':{'id':_0x1c1ef1['params']['id']}})[_0x2b93('0x24')](handleEntityNotFound(_0x35079a,null))[_0x2b93('0x24')](removeEntity(_0x35079a,null))[_0x2b93('0x46')](handleError(_0x35079a,null));};exports['getFields']=function(_0x3a1398,_0x2652e3,_0x1febf3){var _0x5a2446={};var _0x91f13c={};var _0x24548c;var _0x299b38;return db[_0x2b93('0x2d')][_0x2b93('0x4d')]({'where':{'id':_0x3a1398[_0x2b93('0x4c')]['id']}})[_0x2b93('0x24')](handleEntityNotFound(_0x2652e3,null))['then'](function(_0x3c7685){if(_0x3c7685){_0x24548c=_0x3c7685;_0x91f13c[_0x2b93('0x2f')]=_[_0x2b93('0x30')](db[_0x2b93('0x4e')][_0x2b93('0x48')]);_0x91f13c[_0x2b93('0x31')]=_[_0x2b93('0x30')](_0x3a1398[_0x2b93('0x31')]);_0x91f13c['filters']=_[_0x2b93('0x33')](_0x91f13c[_0x2b93('0x2f')],_0x91f13c[_0x2b93('0x31')]);_0x5a2446[_0x2b93('0x34')]=_[_0x2b93('0x33')](_0x91f13c[_0x2b93('0x2f')],qs[_0x2b93('0x35')](_0x3a1398[_0x2b93('0x31')][_0x2b93('0x35')]));_0x5a2446['attributes']=_0x5a2446[_0x2b93('0x34')]['length']?_0x5a2446[_0x2b93('0x34')]:_0x91f13c[_0x2b93('0x2f')];_0x5a2446['order']=qs[_0x2b93('0x3a')](_0x3a1398['query']['sort']);_0x5a2446[_0x2b93('0x3b')]=qs[_0x2b93('0x32')](_[_0x2b93('0x3c')](_0x3a1398['query'],_0x91f13c[_0x2b93('0x32')]));if(_0x3a1398[_0x2b93('0x31')][_0x2b93('0x3d')]){_0x5a2446[_0x2b93('0x3b')]=_['merge'](_0x5a2446[_0x2b93('0x3b')],{'$or':_['map'](_0x5a2446[_0x2b93('0x34')],function(_0x1de31c){var _0x8d1f47={};_0x8d1f47[_0x1de31c]={'$like':'%'+_0x3a1398[_0x2b93('0x31')][_0x2b93('0x3d')]+'%'};return _0x8d1f47;})});}_0x5a2446=_[_0x2b93('0x3e')]({},_0x5a2446,_0x3a1398[_0x2b93('0x41')]);return _0x24548c[_0x2b93('0x4f')](_0x5a2446);}})[_0x2b93('0x24')](function(_0x150e42){if(_0x150e42){_0x299b38=_0x150e42[_0x2b93('0x36')];if(!_0x3a1398[_0x2b93('0x31')][_0x2b93('0x37')](_0x2b93('0x50'))){_0x5a2446['limit']=qs[_0x2b93('0x38')](_0x3a1398[_0x2b93('0x31')][_0x2b93('0x38')]);_0x5a2446[_0x2b93('0x1c')]=qs[_0x2b93('0x1c')](_0x3a1398[_0x2b93('0x31')][_0x2b93('0x1c')]);}return _0x24548c[_0x2b93('0x4f')](_0x5a2446);}})[_0x2b93('0x24')](function(_0x335450){if(_0x335450){return _0x335450?{'count':_0x299b38,'rows':_0x335450}:null;}})[_0x2b93('0x24')](respondWithResult(_0x2652e3,null))['catch'](handleError(_0x2652e3,null));};exports[_0x2b93('0x51')]=function(_0x45fc07,_0xe09c5f,_0x32ca86){var _0x38818c={};var _0xcc19cd={};var _0x12d5b0;var _0x3b8907;return db[_0x2b93('0x2d')][_0x2b93('0x4d')]({'where':{'id':_0x45fc07['params']['id']}})['then'](handleEntityNotFound(_0xe09c5f,null))[_0x2b93('0x24')](function(_0x71fe3b){if(_0x71fe3b){_0x12d5b0=_0x71fe3b;_0xcc19cd['model']=_['keys'](db['Dynamics365Field']['rawAttributes']);_0xcc19cd['query']=_[_0x2b93('0x30')](_0x45fc07[_0x2b93('0x31')]);_0xcc19cd['filters']=_[_0x2b93('0x33')](_0xcc19cd[_0x2b93('0x2f')],_0xcc19cd[_0x2b93('0x31')]);_0x38818c[_0x2b93('0x34')]=_[_0x2b93('0x33')](_0xcc19cd[_0x2b93('0x2f')],qs[_0x2b93('0x35')](_0x45fc07[_0x2b93('0x31')][_0x2b93('0x35')]));_0x38818c[_0x2b93('0x34')]=_0x38818c[_0x2b93('0x34')][_0x2b93('0x36')]?_0x38818c[_0x2b93('0x34')]:_0xcc19cd[_0x2b93('0x2f')];_0x38818c[_0x2b93('0x39')]=qs[_0x2b93('0x3a')](_0x45fc07[_0x2b93('0x31')][_0x2b93('0x3a')]);_0x38818c[_0x2b93('0x3b')]=qs[_0x2b93('0x32')](_[_0x2b93('0x3c')](_0x45fc07[_0x2b93('0x31')],_0xcc19cd['filters']));if(_0x45fc07['query']['filter']){_0x38818c[_0x2b93('0x3b')]=_[_0x2b93('0x3e')](_0x38818c['where'],{'$or':_['map'](_0x38818c[_0x2b93('0x34')],function(_0x1d8fb3){var _0x5bdfe9={};_0x5bdfe9[_0x1d8fb3]={'$like':'%'+_0x45fc07['query'][_0x2b93('0x3d')]+'%'};return _0x5bdfe9;})});}_0x38818c=_['merge']({},_0x38818c,_0x45fc07[_0x2b93('0x41')]);return _0x12d5b0[_0x2b93('0x51')](_0x38818c);}})['then'](function(_0x2e74b7){if(_0x2e74b7){_0x3b8907=_0x2e74b7[_0x2b93('0x36')];if(!_0x45fc07[_0x2b93('0x31')][_0x2b93('0x37')](_0x2b93('0x50'))){_0x38818c['limit']=qs[_0x2b93('0x38')](_0x45fc07[_0x2b93('0x31')]['limit']);_0x38818c[_0x2b93('0x1c')]=qs[_0x2b93('0x1c')](_0x45fc07['query'][_0x2b93('0x1c')]);}return _0x12d5b0[_0x2b93('0x51')](_0x38818c);}})['then'](function(_0x45812d){if(_0x45812d){return _0x45812d?{'count':_0x3b8907,'rows':_0x45812d}:null;}})[_0x2b93('0x24')](respondWithResult(_0xe09c5f,null))['catch'](handleError(_0xe09c5f,null));};exports['getDescriptions']=function(_0x4dd2df,_0x414fb1,_0xe6c982){var _0x4df72e={};var _0x5663c0={};var _0xf6c6ed;var _0x289ea5;return db[_0x2b93('0x2d')][_0x2b93('0x4d')]({'where':{'id':_0x4dd2df[_0x2b93('0x4c')]['id']}})['then'](handleEntityNotFound(_0x414fb1,null))[_0x2b93('0x24')](function(_0x26204f){if(_0x26204f){_0xf6c6ed=_0x26204f;_0x5663c0[_0x2b93('0x2f')]=_[_0x2b93('0x30')](db[_0x2b93('0x4e')]['rawAttributes']);_0x5663c0[_0x2b93('0x31')]=_[_0x2b93('0x30')](_0x4dd2df['query']);_0x5663c0[_0x2b93('0x32')]=_[_0x2b93('0x33')](_0x5663c0[_0x2b93('0x2f')],_0x5663c0[_0x2b93('0x31')]);_0x4df72e['attributes']=_['intersection'](_0x5663c0['model'],qs['fields'](_0x4dd2df[_0x2b93('0x31')][_0x2b93('0x35')]));_0x4df72e[_0x2b93('0x34')]=_0x4df72e[_0x2b93('0x34')][_0x2b93('0x36')]?_0x4df72e[_0x2b93('0x34')]:_0x5663c0[_0x2b93('0x2f')];_0x4df72e['order']=qs[_0x2b93('0x3a')](_0x4dd2df[_0x2b93('0x31')][_0x2b93('0x3a')]);_0x4df72e[_0x2b93('0x3b')]=qs[_0x2b93('0x32')](_[_0x2b93('0x3c')](_0x4dd2df[_0x2b93('0x31')],_0x5663c0['filters']));if(_0x4dd2df[_0x2b93('0x31')][_0x2b93('0x3d')]){_0x4df72e['where']=_['merge'](_0x4df72e[_0x2b93('0x3b')],{'$or':_['map'](_0x4df72e[_0x2b93('0x34')],function(_0xf4334a){var _0x47db95={};_0x47db95[_0xf4334a]={'$like':'%'+_0x4dd2df[_0x2b93('0x31')][_0x2b93('0x3d')]+'%'};return _0x47db95;})});}_0x4df72e=_['merge']({},_0x4df72e,_0x4dd2df[_0x2b93('0x41')]);return _0xf6c6ed[_0x2b93('0x52')](_0x4df72e);}})[_0x2b93('0x24')](function(_0x2c134f){if(_0x2c134f){_0x289ea5=_0x2c134f[_0x2b93('0x36')];if(!_0x4dd2df[_0x2b93('0x31')][_0x2b93('0x37')](_0x2b93('0x50'))){_0x4df72e[_0x2b93('0x38')]=qs['limit'](_0x4dd2df[_0x2b93('0x31')][_0x2b93('0x38')]);_0x4df72e[_0x2b93('0x1c')]=qs[_0x2b93('0x1c')](_0x4dd2df['query'][_0x2b93('0x1c')]);}return _0xf6c6ed[_0x2b93('0x52')](_0x4df72e);}})[_0x2b93('0x24')](function(_0x304ccc){if(_0x304ccc){return _0x304ccc?{'count':_0x289ea5,'rows':_0x304ccc}:null;}})[_0x2b93('0x24')](respondWithResult(_0x414fb1,null))['catch'](handleError(_0x414fb1,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index bc137c1..f57ef7b 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0xe554e5,_0x138712){var _0x3cb94b=function(_0x10dfc1){while(--_0x10dfc1){_0xe554e5['push'](_0xe554e5['shift']());}};_0x3cb94b(++_0x138712);}(_0x9f62,0x154));var _0x29f6=function(_0x2c0806,_0x5b832d){_0x2c0806=_0x2c0806-0x0;var _0x379aca=_0x9f62[_0x2c0806];return _0x379aca;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x646def,_0x4a9670){var _0x36e8be=function(_0x31a2b1){while(--_0x31a2b1){_0x646def['push'](_0x646def['shift']());}};_0x36e8be(++_0x4a9670);}(_0xedd9,0xfc));var _0x9edd=function(_0x4fe528,_0x75d312){_0x4fe528=_0x4fe528-0x0;var _0x37ceb3=_0xedd9[_0x4fe528];return _0x37ceb3;};'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':'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 690e72c..87212b9 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 _0x2263=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0x2263,0xa7));var _0x3226=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x2263[_0x3eb4a9];return _0x48dbad;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var moment=require('moment');var BPromise=require(_0x3226('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3226('0x3'));var db=require(_0x3226('0x4'))['db'];var utils=require(_0x3226('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x3226('0x6'));var client=jayson['client'][_0x3226('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x430663,_0x5dd0cd,_0x443b09){return new BPromise(function(_0x4636cc,_0x2d491d){return client[_0x3226('0x8')](_0x430663,_0x443b09)[_0x3226('0x9')](function(_0x5d290b){logger[_0x3226('0xa')](_0x3226('0xb'),_0x5dd0cd,_0x3226('0xc'));logger[_0x3226('0xd')](_0x3226('0xe'),_0x5dd0cd,_0x3226('0xc'),JSON[_0x3226('0xf')](_0x5d290b));if(_0x5d290b[_0x3226('0x10')]){if(_0x5d290b['error']['code']===0x1f4){logger[_0x3226('0x10')](_0x3226('0xb'),_0x5dd0cd,_0x5d290b[_0x3226('0x10')][_0x3226('0x11')]);return _0x2d491d(_0x5d290b[_0x3226('0x10')][_0x3226('0x11')]);}logger[_0x3226('0x10')](_0x3226('0xb'),_0x5dd0cd,_0x5d290b[_0x3226('0x10')][_0x3226('0x11')]);return _0x4636cc(_0x5d290b[_0x3226('0x10')]['message']);}else{logger[_0x3226('0xa')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5dd0cd,_0x3226('0xc'));_0x4636cc(_0x5d290b['result']['message']);}})['catch'](function(_0x3c64db){logger['error'](_0x3226('0xb'),_0x5dd0cd,_0x3c64db);_0x2d491d(_0x3c64db);});});} \ No newline at end of file +var _0xc1a0=['../../config/environment','jayson/promise','client','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x3814b1,_0x2baf39){var _0xac1211=function(_0x2503ef){while(--_0x2503ef){_0x3814b1['push'](_0x3814b1['shift']());}};_0xac1211(++_0x2baf39);}(_0xc1a0,0x1c5));var _0x0c1a=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0xc1a0[_0x1cd674];return _0x27928f;};'use strict';var _=require('lodash');var util=require(_0x0c1a('0x0'));var moment=require(_0x0c1a('0x1'));var BPromise=require(_0x0c1a('0x2'));var rs=require(_0x0c1a('0x3'));var fs=require('fs');var Redis=require(_0x0c1a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0c1a('0x5'))(_0x0c1a('0x6'));var config=require(_0x0c1a('0x7'));var jayson=require(_0x0c1a('0x8'));var client=jayson[_0x0c1a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2526d6,_0x56a027,_0x621680){return new BPromise(function(_0x35e972,_0x21320b){return client[_0x0c1a('0xa')](_0x2526d6,_0x621680)['then'](function(_0x529137){logger['info'](_0x0c1a('0xb'),_0x56a027,_0x0c1a('0xc'));logger[_0x0c1a('0xd')](_0x0c1a('0xe'),_0x56a027,_0x0c1a('0xc'),JSON[_0x0c1a('0xf')](_0x529137));if(_0x529137[_0x0c1a('0x10')]){if(_0x529137[_0x0c1a('0x10')][_0x0c1a('0x11')]===0x1f4){logger[_0x0c1a('0x10')](_0x0c1a('0xb'),_0x56a027,_0x529137[_0x0c1a('0x10')][_0x0c1a('0x12')]);return _0x21320b(_0x529137[_0x0c1a('0x10')][_0x0c1a('0x12')]);}logger[_0x0c1a('0x10')](_0x0c1a('0xb'),_0x56a027,_0x529137[_0x0c1a('0x10')][_0x0c1a('0x12')]);return _0x35e972(_0x529137[_0x0c1a('0x10')][_0x0c1a('0x12')]);}else{logger[_0x0c1a('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x56a027,'request\x20sent');_0x35e972(_0x529137['result'][_0x0c1a('0x12')]);}})['catch'](function(_0x29267d){logger['error'](_0x0c1a('0xb'),_0x56a027,_0x29267d);_0x21320b(_0x29267d);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 510dcf6..b1d9d48 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 _0xd60d=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0xd60d,0x104));var _0xdd60=function(_0x584be7,_0x213c84){_0x584be7=_0x584be7-0x0;var _0x3deeff=_0xd60d[_0x584be7];return _0x3deeff;};'use strict';var multer=require(_0xdd60('0x0'));var util=require('util');var path=require(_0xdd60('0x1'));var timeout=require(_0xdd60('0x2'));var express=require(_0xdd60('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdd60('0x4'));var interaction=require(_0xdd60('0x5'));var config=require(_0xdd60('0x6'));var controller=require('./intDynamics365Field.controller');router[_0xdd60('0x7')]('/',auth[_0xdd60('0x8')](),controller[_0xdd60('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdd60('0xa')]);router[_0xdd60('0xb')]('/',auth[_0xdd60('0x8')](),controller[_0xdd60('0xc')]);router[_0xdd60('0xd')]('/:id',auth[_0xdd60('0x8')](),controller[_0xdd60('0xe')]);router[_0xdd60('0xf')]('/:id',auth[_0xdd60('0x8')](),controller[_0xdd60('0x10')]);module[_0xdd60('0x11')]=router; \ No newline at end of file +var _0x4160=['../../config/environment','./intDynamics365Field.controller','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(_0x208803,_0x2f942b){var _0x5c77e0=function(_0x1ba8ff){while(--_0x1ba8ff){_0x208803['push'](_0x208803['shift']());}};_0x5c77e0(++_0x2f942b);}(_0x4160,0x189));var _0x0416=function(_0x372d63,_0x290b40){_0x372d63=_0x372d63-0x0;var _0x271e79=_0x4160[_0x372d63];return _0x271e79;};'use strict';var multer=require(_0x0416('0x0'));var util=require(_0x0416('0x1'));var path=require(_0x0416('0x2'));var timeout=require(_0x0416('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0416('0x4'));var auth=require(_0x0416('0x5'));var interaction=require(_0x0416('0x6'));var config=require(_0x0416('0x7'));var controller=require(_0x0416('0x8'));router[_0x0416('0x9')]('/',auth[_0x0416('0xa')](),controller[_0x0416('0xb')]);router[_0x0416('0x9')](_0x0416('0xc'),auth[_0x0416('0xa')](),controller[_0x0416('0xd')]);router[_0x0416('0xe')]('/',auth['isAuthenticated'](),controller[_0x0416('0xf')]);router[_0x0416('0x10')](_0x0416('0xc'),auth[_0x0416('0xa')](),controller['update']);router[_0x0416('0x11')]('/:id',auth[_0x0416('0xa')](),controller[_0x0416('0x12')]);module[_0x0416('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 51027e3..624047f 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 _0xee8e=['customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x400fd9,_0x405eb4){var _0x440eff=function(_0x3a38a9){while(--_0x3a38a9){_0x400fd9['push'](_0x400fd9['shift']());}};_0x440eff(++_0x405eb4);}(_0xee8e,0x83));var _0xeee8=function(_0x2e4aa8,_0x17fbae){_0x2e4aa8=_0x2e4aa8-0x0;var _0x3052b9=_0xee8e[_0x2e4aa8];return _0x3052b9;};'use strict';var Sequelize=require('sequelize');module[_0xeee8('0x0')]={'type':{'type':Sequelize[_0xeee8('0x1')](_0xeee8('0x2'),_0xeee8('0x3'),_0xeee8('0x4'),_0xeee8('0x5'),_0xeee8('0x6')),'defaultValue':_0xeee8('0x2')},'content':{'type':Sequelize[_0xeee8('0x7')]},'key':{'type':Sequelize[_0xeee8('0x7')]},'keyType':{'type':Sequelize[_0xeee8('0x1')](_0xeee8('0x2'),_0xeee8('0x3'),_0xeee8('0x4'))},'keyContent':{'type':Sequelize[_0xeee8('0x7')]},'idField':{'type':Sequelize[_0xeee8('0x7')]},'nameField':{'type':Sequelize[_0xeee8('0x7')]},'customField':{'type':Sequelize[_0xeee8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeee8('0x7')]}}; \ No newline at end of file +var _0xa931=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x5bd337,_0x537448){var _0x287f5f=function(_0x6cecde){while(--_0x6cecde){_0x5bd337['push'](_0x5bd337['shift']());}};_0x287f5f(++_0x537448);}(_0xa931,0x6a));var _0x1a93=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa931[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0x1a93('0x0')]={'type':{'type':Sequelize[_0x1a93('0x1')](_0x1a93('0x2'),_0x1a93('0x3'),_0x1a93('0x4'),_0x1a93('0x5'),_0x1a93('0x6')),'defaultValue':_0x1a93('0x2')},'content':{'type':Sequelize[_0x1a93('0x7')]},'key':{'type':Sequelize[_0x1a93('0x7')]},'keyType':{'type':Sequelize[_0x1a93('0x1')]('string',_0x1a93('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x1a93('0x7')]},'idField':{'type':Sequelize[_0x1a93('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1a93('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1a93('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 243ce10..dbb6f86 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 _0xa1bb=['name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','set','reject','save','update','then','sendStatus','error','stack'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0xa1bb,0x6e));var _0xba1b=function(_0x24fb83,_0x18caba){_0x24fb83=_0x24fb83-0x0;var _0x445a66=_0xa1bb[_0x24fb83];return _0x445a66;};'use strict';var emlformat=require(_0xba1b('0x0'));var rimraf=require(_0xba1b('0x1'));var zipdir=require(_0xba1b('0x2'));var jsonpatch=require(_0xba1b('0x3'));var rp=require(_0xba1b('0x4'));var moment=require(_0xba1b('0x5'));var BPromise=require(_0xba1b('0x6'));var Mustache=require(_0xba1b('0x7'));var util=require(_0xba1b('0x8'));var path=require(_0xba1b('0x9'));var sox=require(_0xba1b('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba1b('0xb'));var squel=require(_0xba1b('0xc'));var crypto=require(_0xba1b('0xd'));var jsforce=require(_0xba1b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xba1b('0xf'));var querystring=require(_0xba1b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba1b('0x11'));var qs=require(_0xba1b('0x12'));var as=require(_0xba1b('0x13'));var hardwareService=require(_0xba1b('0x14'));var logger=require(_0xba1b('0x15'))(_0xba1b('0x16'));var utils=require('../../config/utils');var config=require(_0xba1b('0x17'));var licenseUtil=require(_0xba1b('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb00f68,_0x115341){_0x115341=_0x115341||0xcc;return function(_0x5a8485){if(_0x5a8485){return _0xb00f68['sendStatus'](_0x115341);}return _0xb00f68[_0xba1b('0x19')](_0x115341)[_0xba1b('0x1a')]();};}function respondWithResult(_0x3549a4,_0x475f15){_0x475f15=_0x475f15||0xc8;return function(_0x1ccb8d){if(_0x1ccb8d){return _0x3549a4[_0xba1b('0x19')](_0x475f15)[_0xba1b('0x1b')](_0x1ccb8d);}};}function respondWithFilteredResult(_0x161fe9,_0x1e396c){return function(_0x22f9ee){if(_0x22f9ee){var _0x2cf04c=typeof _0x1e396c['offset']==='undefined'&&typeof _0x1e396c[_0xba1b('0x1c')]===_0xba1b('0x1d');var _0x3ceb27=_0x22f9ee[_0xba1b('0x1e')];var _0x23df63=_0x2cf04c?0x0:_0x1e396c[_0xba1b('0x1f')];var _0x3de127=_0x2cf04c?_0x22f9ee[_0xba1b('0x1e')]:_0x1e396c['offset']+_0x1e396c[_0xba1b('0x1c')];var _0x4395bb;if(_0x3de127>=_0x3ceb27){_0x3de127=_0x3ceb27;_0x4395bb=0xc8;}else{_0x4395bb=0xce;}_0x161fe9[_0xba1b('0x19')](_0x4395bb);return _0x161fe9[_0xba1b('0x20')]('Content-Range',_0x23df63+'-'+_0x3de127+'/'+_0x3ceb27)[_0xba1b('0x1b')](_0x22f9ee);}return null;};}function patchUpdates(_0x2b8d91){return function(_0x783e99){try{jsonpatch['apply'](_0x783e99,_0x2b8d91,!![]);}catch(_0x2aed82){return BPromise[_0xba1b('0x21')](_0x2aed82);}return _0x783e99[_0xba1b('0x22')]();};}function saveUpdates(_0x43705d,_0x2bbf83){return function(_0x2ede49){if(_0x2ede49){return _0x2ede49[_0xba1b('0x23')](_0x43705d)[_0xba1b('0x24')](function(_0xe6b271){return _0xe6b271;});}return null;};}function removeEntity(_0xdc73fe,_0x1f5838){return function(_0xda5ec){if(_0xda5ec){return _0xda5ec['destroy']()[_0xba1b('0x24')](function(){_0xdc73fe[_0xba1b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13efd1,_0x14744d){return function(_0x1a9a1a){if(!_0x1a9a1a){_0x13efd1[_0xba1b('0x25')](0x194);}return _0x1a9a1a;};}function handleError(_0x4700f1,_0x3b6f7e){_0x3b6f7e=_0x3b6f7e||0x1f4;return function(_0x1541e4){logger[_0xba1b('0x26')](_0x1541e4[_0xba1b('0x27')]);if(_0x1541e4[_0xba1b('0x28')]){delete _0x1541e4[_0xba1b('0x28')];}_0x4700f1[_0xba1b('0x19')](_0x3b6f7e)[_0xba1b('0x29')](_0x1541e4);};}exports[_0xba1b('0x2a')]=function(_0x3914bd,_0xa5a362){var _0x1e392b={},_0x501658={},_0x379050={'count':0x0,'rows':[]};var _0x4440f9=_[_0xba1b('0x2b')](db[_0xba1b('0x2c')][_0xba1b('0x2d')],function(_0x181611){return{'name':_0x181611[_0xba1b('0x2e')],'type':_0x181611[_0xba1b('0x2f')][_0xba1b('0x30')]};});_0x501658[_0xba1b('0x31')]=_[_0xba1b('0x2b')](_0x4440f9,_0xba1b('0x28'));_0x501658[_0xba1b('0x32')]=_[_0xba1b('0x33')](_0x3914bd[_0xba1b('0x32')]);_0x501658['filters']=_[_0xba1b('0x34')](_0x501658[_0xba1b('0x31')],_0x501658['query']);_0x1e392b[_0xba1b('0x35')]=_['intersection'](_0x501658['model'],qs[_0xba1b('0x36')](_0x3914bd[_0xba1b('0x32')]['fields']));_0x1e392b[_0xba1b('0x35')]=_0x1e392b[_0xba1b('0x35')][_0xba1b('0x37')]?_0x1e392b[_0xba1b('0x35')]:_0x501658[_0xba1b('0x31')];if(!_0x3914bd['query'][_0xba1b('0x38')](_0xba1b('0x39'))){_0x1e392b[_0xba1b('0x1c')]=qs[_0xba1b('0x1c')](_0x3914bd['query'][_0xba1b('0x1c')]);_0x1e392b[_0xba1b('0x1f')]=qs[_0xba1b('0x1f')](_0x3914bd['query'][_0xba1b('0x1f')]);}_0x1e392b[_0xba1b('0x3a')]=qs[_0xba1b('0x3b')](_0x3914bd['query'][_0xba1b('0x3b')]);_0x1e392b['where']=qs[_0xba1b('0x3c')](_['pick'](_0x3914bd[_0xba1b('0x32')],_0x501658[_0xba1b('0x3c')]),_0x4440f9);if(_0x3914bd[_0xba1b('0x32')][_0xba1b('0x3d')]){_0x1e392b[_0xba1b('0x3e')]=_[_0xba1b('0x3f')](_0x1e392b[_0xba1b('0x3e')],{'$or':_['map'](_0x4440f9,function(_0x47b69f){if(_0x47b69f[_0xba1b('0x2f')]!==_0xba1b('0x40')){var _0x511658={};_0x511658[_0x47b69f[_0xba1b('0x28')]]={'$like':'%'+_0x3914bd[_0xba1b('0x32')]['filter']+'%'};return _0x511658;}})});}_0x1e392b=_[_0xba1b('0x3f')]({},_0x1e392b,_0x3914bd[_0xba1b('0x41')]);var _0x4afeab={'where':_0x1e392b[_0xba1b('0x3e')]};return db[_0xba1b('0x2c')]['count'](_0x4afeab)[_0xba1b('0x24')](function(_0x2c342c){_0x379050['count']=_0x2c342c;if(_0x3914bd['query'][_0xba1b('0x42')]){_0x1e392b['include']=[{'all':!![]}];}return db[_0xba1b('0x2c')]['findAll'](_0x1e392b);})[_0xba1b('0x24')](function(_0x5db5b4){_0x379050[_0xba1b('0x43')]=_0x5db5b4;return _0x379050;})[_0xba1b('0x24')](respondWithFilteredResult(_0xa5a362,_0x1e392b))['catch'](handleError(_0xa5a362,null));};exports[_0xba1b('0x44')]=function(_0x46218f,_0x1081e0){var _0x1a4126={'raw':!![],'where':{'id':_0x46218f[_0xba1b('0x45')]['id']}},_0x4fa3bd={};_0x4fa3bd['model']=_[_0xba1b('0x33')](db['Dynamics365Field']['rawAttributes']);_0x4fa3bd['query']=_['keys'](_0x46218f[_0xba1b('0x32')]);_0x4fa3bd['filters']=_[_0xba1b('0x34')](_0x4fa3bd[_0xba1b('0x31')],_0x4fa3bd[_0xba1b('0x32')]);_0x1a4126[_0xba1b('0x35')]=_[_0xba1b('0x34')](_0x4fa3bd[_0xba1b('0x31')],qs['fields'](_0x46218f[_0xba1b('0x32')][_0xba1b('0x36')]));_0x1a4126[_0xba1b('0x35')]=_0x1a4126[_0xba1b('0x35')][_0xba1b('0x37')]?_0x1a4126[_0xba1b('0x35')]:_0x4fa3bd['model'];if(_0x46218f[_0xba1b('0x32')][_0xba1b('0x42')]){_0x1a4126['include']=[{'all':!![]}];}_0x1a4126=_[_0xba1b('0x3f')]({},_0x1a4126,_0x46218f['options']);return db[_0xba1b('0x2c')]['find'](_0x1a4126)['then'](handleEntityNotFound(_0x1081e0,null))[_0xba1b('0x24')](respondWithResult(_0x1081e0,null))[_0xba1b('0x46')](handleError(_0x1081e0,null));};exports['create']=function(_0x129ff2,_0xd8462a){return db[_0xba1b('0x2c')][_0xba1b('0x47')](_0x129ff2['body'],{})[_0xba1b('0x24')](respondWithResult(_0xd8462a,0xc9))[_0xba1b('0x46')](handleError(_0xd8462a,null));};exports[_0xba1b('0x23')]=function(_0x58b294,_0x2590a6){if(_0x58b294[_0xba1b('0x48')]['id']){delete _0x58b294['body']['id'];}return db[_0xba1b('0x2c')][_0xba1b('0x49')]({'where':{'id':_0x58b294[_0xba1b('0x45')]['id']}})['then'](handleEntityNotFound(_0x2590a6,null))['then'](saveUpdates(_0x58b294[_0xba1b('0x48')],null))[_0xba1b('0x24')](respondWithResult(_0x2590a6,null))[_0xba1b('0x46')](handleError(_0x2590a6,null));};exports[_0xba1b('0x4a')]=function(_0x59038f,_0x5c41b2){return db['Dynamics365Field'][_0xba1b('0x49')]({'where':{'id':_0x59038f[_0xba1b('0x45')]['id']}})[_0xba1b('0x24')](handleEntityNotFound(_0x5c41b2,null))[_0xba1b('0x24')](removeEntity(_0x5c41b2,null))['catch'](handleError(_0x5c41b2,null));}; \ No newline at end of file +var _0xc876=['order','sort','pick','filter','where','merge','type','VIRTUAL','count','rows','catch','show','includeAll','include','options','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','then','destroy','end','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xc876,0x9e));var _0x6c87=function(_0x4e10d1,_0x4d8bb0){_0x4e10d1=_0x4e10d1-0x0;var _0x1d16fe=_0xc876[_0x4e10d1];return _0x1d16fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c87('0x0'));var zipdir=require(_0x6c87('0x1'));var jsonpatch=require(_0x6c87('0x2'));var rp=require(_0x6c87('0x3'));var moment=require('moment');var BPromise=require(_0x6c87('0x4'));var Mustache=require(_0x6c87('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6c87('0x6'));var csv=require(_0x6c87('0x7'));var ejs=require(_0x6c87('0x8'));var fs=require('fs');var fs_extra=require(_0x6c87('0x9'));var _=require(_0x6c87('0xa'));var squel=require('squel');var crypto=require(_0x6c87('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6c87('0x7'));var querystring=require('querystring');var Papa=require(_0x6c87('0xc'));var Redis=require('ioredis');var authService=require(_0x6c87('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x6c87('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6c87('0xf'));var utils=require('../../config/utils');var config=require(_0x6c87('0x10'));var licenseUtil=require(_0x6c87('0x11'));var db=require(_0x6c87('0x12'))['db'];function respondWithStatusCode(_0x26e927,_0x42c8b0){_0x42c8b0=_0x42c8b0||0xcc;return function(_0x3b7ced){if(_0x3b7ced){return _0x26e927[_0x6c87('0x13')](_0x42c8b0);}return _0x26e927[_0x6c87('0x14')](_0x42c8b0)['end']();};}function respondWithResult(_0x3c8301,_0x18c1c2){_0x18c1c2=_0x18c1c2||0xc8;return function(_0x41fb2d){if(_0x41fb2d){return _0x3c8301[_0x6c87('0x14')](_0x18c1c2)[_0x6c87('0x15')](_0x41fb2d);}};}function respondWithFilteredResult(_0x3a50ed,_0x538519){return function(_0x8a5553){if(_0x8a5553){var _0x5a9819=typeof _0x538519[_0x6c87('0x16')]===_0x6c87('0x17')&&typeof _0x538519[_0x6c87('0x18')]==='undefined';var _0x340b0e=_0x8a5553['count'];var _0x115971=_0x5a9819?0x0:_0x538519['offset'];var _0x4fc69f=_0x5a9819?_0x8a5553['count']:_0x538519[_0x6c87('0x16')]+_0x538519[_0x6c87('0x18')];var _0x38a2e9;if(_0x4fc69f>=_0x340b0e){_0x4fc69f=_0x340b0e;_0x38a2e9=0xc8;}else{_0x38a2e9=0xce;}_0x3a50ed[_0x6c87('0x14')](_0x38a2e9);return _0x3a50ed[_0x6c87('0x19')](_0x6c87('0x1a'),_0x115971+'-'+_0x4fc69f+'/'+_0x340b0e)['json'](_0x8a5553);}return null;};}function patchUpdates(_0x34b381){return function(_0x6b2af3){try{jsonpatch['apply'](_0x6b2af3,_0x34b381,!![]);}catch(_0x3491bb){return BPromise['reject'](_0x3491bb);}return _0x6b2af3[_0x6c87('0x1b')]();};}function saveUpdates(_0x3d5445,_0xcab46e){return function(_0x75862a){if(_0x75862a){return _0x75862a['update'](_0x3d5445)[_0x6c87('0x1c')](function(_0x5e22a3){return _0x5e22a3;});}return null;};}function removeEntity(_0x47f415,_0x112e37){return function(_0x534801){if(_0x534801){return _0x534801[_0x6c87('0x1d')]()[_0x6c87('0x1c')](function(){_0x47f415[_0x6c87('0x14')](0xcc)[_0x6c87('0x1e')]();});}};}function handleEntityNotFound(_0x1235c1,_0x4f0ff1){return function(_0x280c53){if(!_0x280c53){_0x1235c1[_0x6c87('0x13')](0x194);}return _0x280c53;};}function handleError(_0x27a03b,_0x28b725){_0x28b725=_0x28b725||0x1f4;return function(_0x51c7ea){logger['error'](_0x51c7ea['stack']);if(_0x51c7ea[_0x6c87('0x1f')]){delete _0x51c7ea[_0x6c87('0x1f')];}_0x27a03b[_0x6c87('0x14')](_0x28b725)[_0x6c87('0x20')](_0x51c7ea);};}exports[_0x6c87('0x21')]=function(_0x25b2b9,_0x5ed3ae){var _0x5757a3={},_0x35ff9a={},_0x17411c={'count':0x0,'rows':[]};var _0x74c64f=_[_0x6c87('0x22')](db[_0x6c87('0x23')][_0x6c87('0x24')],function(_0x232f01){return{'name':_0x232f01[_0x6c87('0x25')],'type':_0x232f01['type'][_0x6c87('0x26')]};});_0x35ff9a[_0x6c87('0x27')]=_['map'](_0x74c64f,_0x6c87('0x1f'));_0x35ff9a[_0x6c87('0x28')]=_[_0x6c87('0x29')](_0x25b2b9['query']);_0x35ff9a[_0x6c87('0x2a')]=_[_0x6c87('0x2b')](_0x35ff9a[_0x6c87('0x27')],_0x35ff9a[_0x6c87('0x28')]);_0x5757a3[_0x6c87('0x2c')]=_[_0x6c87('0x2b')](_0x35ff9a[_0x6c87('0x27')],qs['fields'](_0x25b2b9['query'][_0x6c87('0x2d')]));_0x5757a3[_0x6c87('0x2c')]=_0x5757a3[_0x6c87('0x2c')][_0x6c87('0x2e')]?_0x5757a3[_0x6c87('0x2c')]:_0x35ff9a[_0x6c87('0x27')];if(!_0x25b2b9['query'][_0x6c87('0x2f')](_0x6c87('0x30'))){_0x5757a3[_0x6c87('0x18')]=qs[_0x6c87('0x18')](_0x25b2b9[_0x6c87('0x28')][_0x6c87('0x18')]);_0x5757a3['offset']=qs[_0x6c87('0x16')](_0x25b2b9['query'][_0x6c87('0x16')]);}_0x5757a3[_0x6c87('0x31')]=qs[_0x6c87('0x32')](_0x25b2b9['query'][_0x6c87('0x32')]);_0x5757a3['where']=qs[_0x6c87('0x2a')](_[_0x6c87('0x33')](_0x25b2b9[_0x6c87('0x28')],_0x35ff9a[_0x6c87('0x2a')]),_0x74c64f);if(_0x25b2b9[_0x6c87('0x28')][_0x6c87('0x34')]){_0x5757a3[_0x6c87('0x35')]=_[_0x6c87('0x36')](_0x5757a3['where'],{'$or':_[_0x6c87('0x22')](_0x74c64f,function(_0x53fa1a){if(_0x53fa1a[_0x6c87('0x37')]!==_0x6c87('0x38')){var _0x266296={};_0x266296[_0x53fa1a[_0x6c87('0x1f')]]={'$like':'%'+_0x25b2b9[_0x6c87('0x28')]['filter']+'%'};return _0x266296;}})});}_0x5757a3=_[_0x6c87('0x36')]({},_0x5757a3,_0x25b2b9['options']);var _0x17365a={'where':_0x5757a3[_0x6c87('0x35')]};return db[_0x6c87('0x23')][_0x6c87('0x39')](_0x17365a)['then'](function(_0x5ecd9f){_0x17411c[_0x6c87('0x39')]=_0x5ecd9f;if(_0x25b2b9[_0x6c87('0x28')]['includeAll']){_0x5757a3['include']=[{'all':!![]}];}return db[_0x6c87('0x23')]['findAll'](_0x5757a3);})[_0x6c87('0x1c')](function(_0x232955){_0x17411c[_0x6c87('0x3a')]=_0x232955;return _0x17411c;})['then'](respondWithFilteredResult(_0x5ed3ae,_0x5757a3))[_0x6c87('0x3b')](handleError(_0x5ed3ae,null));};exports[_0x6c87('0x3c')]=function(_0x4611f7,_0x1418ee){var _0x231293={'raw':!![],'where':{'id':_0x4611f7['params']['id']}},_0xa8dc63={};_0xa8dc63['model']=_[_0x6c87('0x29')](db[_0x6c87('0x23')]['rawAttributes']);_0xa8dc63[_0x6c87('0x28')]=_[_0x6c87('0x29')](_0x4611f7[_0x6c87('0x28')]);_0xa8dc63[_0x6c87('0x2a')]=_[_0x6c87('0x2b')](_0xa8dc63[_0x6c87('0x27')],_0xa8dc63[_0x6c87('0x28')]);_0x231293['attributes']=_[_0x6c87('0x2b')](_0xa8dc63[_0x6c87('0x27')],qs[_0x6c87('0x2d')](_0x4611f7[_0x6c87('0x28')][_0x6c87('0x2d')]));_0x231293['attributes']=_0x231293[_0x6c87('0x2c')]['length']?_0x231293[_0x6c87('0x2c')]:_0xa8dc63['model'];if(_0x4611f7['query'][_0x6c87('0x3d')]){_0x231293[_0x6c87('0x3e')]=[{'all':!![]}];}_0x231293=_[_0x6c87('0x36')]({},_0x231293,_0x4611f7[_0x6c87('0x3f')]);return db[_0x6c87('0x23')][_0x6c87('0x40')](_0x231293)[_0x6c87('0x1c')](handleEntityNotFound(_0x1418ee,null))[_0x6c87('0x1c')](respondWithResult(_0x1418ee,null))[_0x6c87('0x3b')](handleError(_0x1418ee,null));};exports[_0x6c87('0x41')]=function(_0xa607f8,_0x5785df){return db[_0x6c87('0x23')][_0x6c87('0x41')](_0xa607f8[_0x6c87('0x42')],{})[_0x6c87('0x1c')](respondWithResult(_0x5785df,0xc9))[_0x6c87('0x3b')](handleError(_0x5785df,null));};exports[_0x6c87('0x43')]=function(_0xedd559,_0x1afd08){if(_0xedd559[_0x6c87('0x42')]['id']){delete _0xedd559[_0x6c87('0x42')]['id'];}return db[_0x6c87('0x23')][_0x6c87('0x40')]({'where':{'id':_0xedd559['params']['id']}})[_0x6c87('0x1c')](handleEntityNotFound(_0x1afd08,null))['then'](saveUpdates(_0xedd559['body'],null))[_0x6c87('0x1c')](respondWithResult(_0x1afd08,null))['catch'](handleError(_0x1afd08,null));};exports[_0x6c87('0x1d')]=function(_0x1c412d,_0x4f6a54){return db['Dynamics365Field'][_0x6c87('0x40')]({'where':{'id':_0x1c412d[_0x6c87('0x44')]['id']}})[_0x6c87('0x1c')](handleEntityNotFound(_0x4f6a54,null))[_0x6c87('0x1c')](removeEntity(_0x4f6a54,null))[_0x6c87('0x3b')](handleError(_0x4f6a54,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1227f18..4a891bc 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 _0xb7cb=['rimraf','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise'];(function(_0x323ade,_0x12a9a2){var _0x2abef0=function(_0x27db57){while(--_0x27db57){_0x323ade['push'](_0x323ade['shift']());}};_0x2abef0(++_0x12a9a2);}(_0xb7cb,0x14d));var _0xbb7c=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0xb7cb[_0x4e0026];return _0x3f8ee7;};'use strict';var _=require(_0xbb7c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbb7c('0x1'));var moment=require(_0xbb7c('0x2'));var BPromise=require(_0xbb7c('0x3'));var rp=require(_0xbb7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb7c('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb7c('0x6'));module[_0xbb7c('0x7')]=function(_0x3db094,_0x2caeab){return _0x3db094[_0xbb7c('0x8')]('Dynamics365Field',attributes,{'tableName':_0xbb7c('0x9'),'paranoid':![],'indexes':[{'name':_0xbb7c('0xa'),'fields':[_0xbb7c('0xb'),_0xbb7c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5791=['request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x5791,0x18f));var _0x1579=function(_0xde681d,_0x320776){_0xde681d=_0xde681d-0x0;var _0x58db6e=_0x5791[_0xde681d];return _0x58db6e;};'use strict';var _=require(_0x1579('0x0'));var util=require(_0x1579('0x1'));var logger=require(_0x1579('0x2'))(_0x1579('0x3'));var moment=require(_0x1579('0x4'));var BPromise=require(_0x1579('0x5'));var rp=require(_0x1579('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1579('0x7'));var config=require(_0x1579('0x8'));var attributes=require(_0x1579('0x9'));module[_0x1579('0xa')]=function(_0x1961de,_0x53a167){return _0x1961de[_0x1579('0xb')]('Dynamics365Field',attributes,{'tableName':_0x1579('0xc'),'paranoid':![],'indexes':[{'name':_0x1579('0xd'),'fields':['idField',_0x1579('0xe')],'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 add2d83..b3d1063 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 _0x0b3d=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','randomstring'];(function(_0x4232dc,_0x49c320){var _0x2f90b3=function(_0x38fc8d){while(--_0x38fc8d){_0x4232dc['push'](_0x4232dc['shift']());}};_0x2f90b3(++_0x49c320);}(_0x0b3d,0x122));var _0xd0b3=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0x0b3d[_0x5418ad];return _0x2cae56;};'use strict';var _=require(_0xd0b3('0x0'));var util=require(_0xd0b3('0x1'));var moment=require(_0xd0b3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0b3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0b3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0b3('0x5'))('rpc');var config=require(_0xd0b3('0x6'));var jayson=require(_0xd0b3('0x7'));var client=jayson[_0xd0b3('0x8')][_0xd0b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b8863,_0x1d0741,_0x2094b2){return new BPromise(function(_0x46d1bd,_0x4a2143){return client[_0xd0b3('0xa')](_0x1b8863,_0x2094b2)['then'](function(_0x43a97f){logger['info'](_0xd0b3('0xb'),_0x1d0741,'request\x20sent');logger[_0xd0b3('0xc')](_0xd0b3('0xd'),_0x1d0741,'request\x20sent',JSON[_0xd0b3('0xe')](_0x43a97f));if(_0x43a97f['error']){if(_0x43a97f[_0xd0b3('0xf')][_0xd0b3('0x10')]===0x1f4){logger[_0xd0b3('0xf')](_0xd0b3('0xb'),_0x1d0741,_0x43a97f[_0xd0b3('0xf')]['message']);return _0x4a2143(_0x43a97f[_0xd0b3('0xf')][_0xd0b3('0x11')]);}logger[_0xd0b3('0xf')](_0xd0b3('0xb'),_0x1d0741,_0x43a97f['error'][_0xd0b3('0x11')]);return _0x46d1bd(_0x43a97f[_0xd0b3('0xf')][_0xd0b3('0x11')]);}else{logger[_0xd0b3('0x12')](_0xd0b3('0xb'),_0x1d0741,_0xd0b3('0x13'));_0x46d1bd(_0x43a97f['result'][_0xd0b3('0x11')]);}})[_0xd0b3('0x14')](function(_0x4cf190){logger[_0xd0b3('0xf')](_0xd0b3('0xb'),_0x1d0741,_0x4cf190);_0x4a2143(_0x4cf190);});});} \ No newline at end of file +var _0x63a3=['client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x8e03ff,_0x1bc54c){var _0x298c23=function(_0x4e94bb){while(--_0x4e94bb){_0x8e03ff['push'](_0x8e03ff['shift']());}};_0x298c23(++_0x1bc54c);}(_0x63a3,0x12b));var _0x363a=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x63a3[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require('lodash');var util=require(_0x363a('0x0'));var moment=require('moment');var BPromise=require(_0x363a('0x1'));var rs=require(_0x363a('0x2'));var fs=require('fs');var Redis=require(_0x363a('0x3'));var db=require(_0x363a('0x4'))['db'];var utils=require(_0x363a('0x5'));var logger=require(_0x363a('0x6'))('rpc');var config=require(_0x363a('0x7'));var jayson=require(_0x363a('0x8'));var client=jayson[_0x363a('0x9')][_0x363a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2195,_0x1f2cab,_0x3aca8c){return new BPromise(function(_0x476378,_0x5eabca){return client[_0x363a('0xb')](_0x3a2195,_0x3aca8c)[_0x363a('0xc')](function(_0xa223cf){logger[_0x363a('0xd')](_0x363a('0xe'),_0x1f2cab,_0x363a('0xf'));logger[_0x363a('0x10')](_0x363a('0x11'),_0x1f2cab,_0x363a('0xf'),JSON[_0x363a('0x12')](_0xa223cf));if(_0xa223cf[_0x363a('0x13')]){if(_0xa223cf[_0x363a('0x13')]['code']===0x1f4){logger[_0x363a('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x1f2cab,_0xa223cf['error'][_0x363a('0x14')]);return _0x5eabca(_0xa223cf[_0x363a('0x13')][_0x363a('0x14')]);}logger[_0x363a('0x13')](_0x363a('0xe'),_0x1f2cab,_0xa223cf[_0x363a('0x13')][_0x363a('0x14')]);return _0x476378(_0xa223cf['error'][_0x363a('0x14')]);}else{logger['info'](_0x363a('0xe'),_0x1f2cab,_0x363a('0xf'));_0x476378(_0xa223cf[_0x363a('0x15')]['message']);}})['catch'](function(_0x23f32e){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x1f2cab,_0x23f32e);_0x5eabca(_0x23f32e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 9f31219..3f28959 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 _0xaeb3=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/configurations','addConfiguration','update'];(function(_0x55f73a,_0xc9b344){var _0x54c371=function(_0x1443b0){while(--_0x1443b0){_0x55f73a['push'](_0x55f73a['shift']());}};_0x54c371(++_0xc9b344);}(_0xaeb3,0x1cd));var _0x3aeb=function(_0x27657c,_0x36813e){_0x27657c=_0x27657c-0x0;var _0x12324a=_0xaeb3[_0x27657c];return _0x12324a;};'use strict';var multer=require(_0x3aeb('0x0'));var util=require(_0x3aeb('0x1'));var path=require(_0x3aeb('0x2'));var timeout=require(_0x3aeb('0x3'));var express=require(_0x3aeb('0x4'));var router=express[_0x3aeb('0x5')]();var fs_extra=require(_0x3aeb('0x6'));var auth=require(_0x3aeb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3aeb('0x8'));router[_0x3aeb('0x9')]('/',auth[_0x3aeb('0xa')](),controller[_0x3aeb('0xb')]);router['get'](_0x3aeb('0xc'),auth[_0x3aeb('0xa')](),controller[_0x3aeb('0xd')]);router[_0x3aeb('0x9')]('/:id/configurations',auth[_0x3aeb('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x3aeb('0xa')](),controller['getFields']);router[_0x3aeb('0xe')]('/',auth[_0x3aeb('0xa')](),controller[_0x3aeb('0xf')]);router['post'](_0x3aeb('0x10'),auth[_0x3aeb('0xa')](),controller[_0x3aeb('0x11')]);router['put']('/:id',auth[_0x3aeb('0xa')](),controller[_0x3aeb('0x12')]);router['delete'](_0x3aeb('0xc'),auth[_0x3aeb('0xa')](),controller[_0x3aeb('0x13')]);module['exports']=router; \ No newline at end of file +var _0x7e4b=['put','delete','destroy','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x1dfff1,_0x586313){var _0x56098c=function(_0x3086b5){while(--_0x3086b5){_0x1dfff1['push'](_0x1dfff1['shift']());}};_0x56098c(++_0x586313);}(_0x7e4b,0x100));var _0xb7e4=function(_0x5f50d2,_0x5b3d2c){_0x5f50d2=_0x5f50d2-0x0;var _0x2fcd25=_0x7e4b[_0x5f50d2];return _0x2fcd25;};'use strict';var multer=require(_0xb7e4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb7e4('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xb7e4('0x2'));var interaction=require(_0xb7e4('0x3'));var config=require(_0xb7e4('0x4'));var controller=require(_0xb7e4('0x5'));router[_0xb7e4('0x6')]('/',auth[_0xb7e4('0x7')](),controller[_0xb7e4('0x8')]);router[_0xb7e4('0x6')](_0xb7e4('0x9'),auth[_0xb7e4('0x7')](),controller[_0xb7e4('0xa')]);router[_0xb7e4('0x6')](_0xb7e4('0xb'),auth[_0xb7e4('0x7')](),controller[_0xb7e4('0xc')]);router[_0xb7e4('0x6')](_0xb7e4('0xd'),auth[_0xb7e4('0x7')](),controller[_0xb7e4('0xe')]);router[_0xb7e4('0xf')]('/',auth[_0xb7e4('0x7')](),controller[_0xb7e4('0x10')]);router[_0xb7e4('0xf')](_0xb7e4('0xb'),auth[_0xb7e4('0x7')](),controller['addConfiguration']);router[_0xb7e4('0x11')](_0xb7e4('0x9'),auth[_0xb7e4('0x7')](),controller['update']);router[_0xb7e4('0x12')](_0xb7e4('0x9'),auth[_0xb7e4('0x7')](),controller[_0xb7e4('0x13')]);module[_0xb7e4('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 0f16c6f..bca07bc 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 _0xb44a=['STRING'];(function(_0x49b076,_0x4fb74e){var _0xa3609=function(_0x474e71){while(--_0x474e71){_0x49b076['push'](_0x49b076['shift']());}};_0xa3609(++_0x4fb74e);}(_0xb44a,0x1c2));var _0xab44=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0xb44a[_0x3ab0ac];return _0x1f743d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xab44('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xab44('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xab44('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xab44('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x4888=['exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4888,0x198));var _0x8488=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x4888[_0x176317];return _0xef2759;};'use strict';var Sequelize=require('sequelize');module[_0x8488('0x0')]={'name':{'type':Sequelize[_0x8488('0x1')]},'description':{'type':Sequelize[_0x8488('0x1')]},'username':{'type':Sequelize[_0x8488('0x1')],'unique':_0x8488('0x2')},'apiKey':{'type':Sequelize[_0x8488('0x1')]},'remoteUri':{'type':Sequelize[_0x8488('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x8488('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index ff63997..e29b6d6 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 _0xb16f=['body','getConfigurations','nolimit','findOne','AccountId','Subjects','type','Descriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','%s:X','base64','priority','group','source','ticket_type','company','default','custom_text','label','choices','capitalize','test','statusCode','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','crypto','desk.js','to-csv','../../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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','index','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create'];(function(_0x109d91,_0x37b324){var _0x4fd53d=function(_0xf74bd6){while(--_0xf74bd6){_0x109d91['push'](_0x109d91['shift']());}};_0x4fd53d(++_0x37b324);}(_0xb16f,0xf6));var _0xfb16=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0xb16f[_0x4ca288];return _0x2362c1;};'use strict';var emlformat=require(_0xfb16('0x0'));var rimraf=require(_0xfb16('0x1'));var zipdir=require(_0xfb16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfb16('0x3'));var moment=require(_0xfb16('0x4'));var BPromise=require(_0xfb16('0x5'));var Mustache=require(_0xfb16('0x6'));var util=require('util');var path=require(_0xfb16('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb16('0x8'));var squel=require('squel');var crypto=require(_0xfb16('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfb16('0xa'));var toCsv=require(_0xfb16('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb16('0xc'));var qs=require(_0xfb16('0xd'));var as=require(_0xfb16('0xe'));var hardwareService=require(_0xfb16('0xf'));var logger=require(_0xfb16('0x10'))(_0xfb16('0x11'));var utils=require(_0xfb16('0x12'));var config=require(_0xfb16('0x13'));var licenseUtil=require(_0xfb16('0x14'));var db=require(_0xfb16('0x15'))['db'];var integrations=require(_0xfb16('0x16'));function respondWithStatusCode(_0x4f3a00,_0xd6eeee){_0xd6eeee=_0xd6eeee||0xcc;return function(_0x59ee42){if(_0x59ee42){return _0x4f3a00['sendStatus'](_0xd6eeee);}return _0x4f3a00[_0xfb16('0x17')](_0xd6eeee)[_0xfb16('0x18')]();};}function respondWithResult(_0x4cdc87,_0x507bcc){_0x507bcc=_0x507bcc||0xc8;return function(_0x321489){if(_0x321489){return _0x4cdc87[_0xfb16('0x17')](_0x507bcc)[_0xfb16('0x19')](_0x321489);}};}function respondWithFilteredResult(_0x1643cc,_0x28cb87){return function(_0xcf5a5){if(_0xcf5a5){var _0x11a5d0=typeof _0x28cb87[_0xfb16('0x1a')]===_0xfb16('0x1b')&&typeof _0x28cb87[_0xfb16('0x1c')]===_0xfb16('0x1b');var _0x394d5e=_0xcf5a5[_0xfb16('0x1d')];var _0x14d05e=_0x11a5d0?0x0:_0x28cb87['offset'];var _0x2b28ea=_0x11a5d0?_0xcf5a5[_0xfb16('0x1d')]:_0x28cb87[_0xfb16('0x1a')]+_0x28cb87['limit'];var _0x5e1ffd;if(_0x2b28ea>=_0x394d5e){_0x2b28ea=_0x394d5e;_0x5e1ffd=0xc8;}else{_0x5e1ffd=0xce;}_0x1643cc[_0xfb16('0x17')](_0x5e1ffd);return _0x1643cc[_0xfb16('0x1e')](_0xfb16('0x1f'),_0x14d05e+'-'+_0x2b28ea+'/'+_0x394d5e)['json'](_0xcf5a5);}return null;};}function patchUpdates(_0x193162){return function(_0x32f13f){try{jsonpatch[_0xfb16('0x20')](_0x32f13f,_0x193162,!![]);}catch(_0x509e70){return BPromise['reject'](_0x509e70);}return _0x32f13f['save']();};}function saveUpdates(_0x27203c,_0x354ef4){return function(_0x39ec10){if(_0x39ec10){return _0x39ec10[_0xfb16('0x21')](_0x27203c)['then'](function(_0x5814e9){return _0x5814e9;});}return null;};}function removeEntity(_0x8ef26c,_0x2aea90){return function(_0x2c1fa3){if(_0x2c1fa3){return _0x2c1fa3[_0xfb16('0x22')]()[_0xfb16('0x23')](function(){_0x8ef26c[_0xfb16('0x17')](0xcc)[_0xfb16('0x18')]();});}};}function handleEntityNotFound(_0x239633,_0x1335a3){return function(_0x360df5){if(!_0x360df5){_0x239633[_0xfb16('0x24')](0x194);}return _0x360df5;};}function handleError(_0x4c194a,_0x1ca17b){_0x1ca17b=_0x1ca17b||0x1f4;return function(_0x15f0e4){logger[_0xfb16('0x25')](_0x15f0e4[_0xfb16('0x26')]);if(_0x15f0e4[_0xfb16('0x27')]){delete _0x15f0e4['name'];}_0x4c194a[_0xfb16('0x17')](_0x1ca17b)['send'](_0x15f0e4);};}exports[_0xfb16('0x28')]=function(_0x21822b,_0xe1a799){var _0x1a92ce={},_0x19fb63={},_0x49d03e={'count':0x0,'rows':[]};var _0x1386d2=_['map'](db['FreshdeskAccount']['rawAttributes'],function(_0x29ebd8){return{'name':_0x29ebd8['fieldName'],'type':_0x29ebd8['type']['key']};});_0x19fb63[_0xfb16('0x29')]=_[_0xfb16('0x2a')](_0x1386d2,_0xfb16('0x27'));_0x19fb63[_0xfb16('0x2b')]=_[_0xfb16('0x2c')](_0x21822b[_0xfb16('0x2b')]);_0x19fb63[_0xfb16('0x2d')]=_[_0xfb16('0x2e')](_0x19fb63['model'],_0x19fb63[_0xfb16('0x2b')]);_0x1a92ce[_0xfb16('0x2f')]=_[_0xfb16('0x2e')](_0x19fb63['model'],qs[_0xfb16('0x30')](_0x21822b[_0xfb16('0x2b')][_0xfb16('0x30')]));_0x1a92ce[_0xfb16('0x2f')]=_0x1a92ce['attributes'][_0xfb16('0x31')]?_0x1a92ce['attributes']:_0x19fb63[_0xfb16('0x29')];if(!_0x21822b[_0xfb16('0x2b')][_0xfb16('0x32')]('nolimit')){_0x1a92ce[_0xfb16('0x1c')]=qs[_0xfb16('0x1c')](_0x21822b[_0xfb16('0x2b')][_0xfb16('0x1c')]);_0x1a92ce['offset']=qs['offset'](_0x21822b[_0xfb16('0x2b')]['offset']);}_0x1a92ce[_0xfb16('0x33')]=qs[_0xfb16('0x34')](_0x21822b[_0xfb16('0x2b')][_0xfb16('0x34')]);_0x1a92ce['where']=qs[_0xfb16('0x2d')](_['pick'](_0x21822b[_0xfb16('0x2b')],_0x19fb63[_0xfb16('0x2d')]),_0x1386d2);if(_0x21822b[_0xfb16('0x2b')][_0xfb16('0x35')]){_0x1a92ce['where']=_[_0xfb16('0x36')](_0x1a92ce[_0xfb16('0x37')],{'$or':_['map'](_0x1386d2,function(_0x294ad0){if(_0x294ad0['type']!==_0xfb16('0x38')){var _0x2c2965={};_0x2c2965[_0x294ad0[_0xfb16('0x27')]]={'$like':'%'+_0x21822b[_0xfb16('0x2b')][_0xfb16('0x35')]+'%'};return _0x2c2965;}})});}_0x1a92ce=_[_0xfb16('0x36')]({},_0x1a92ce,_0x21822b[_0xfb16('0x39')]);var _0x59df93={'where':_0x1a92ce['where']};return db[_0xfb16('0x3a')]['count'](_0x59df93)[_0xfb16('0x23')](function(_0x1336cd){_0x49d03e[_0xfb16('0x1d')]=_0x1336cd;if(_0x21822b['query']['includeAll']){_0x1a92ce[_0xfb16('0x3b')]=[{'all':!![]}];}return db[_0xfb16('0x3a')][_0xfb16('0x3c')](_0x1a92ce);})['then'](function(_0x16d9a9){_0x49d03e[_0xfb16('0x3d')]=_0x16d9a9;return _0x49d03e;})[_0xfb16('0x23')](respondWithFilteredResult(_0xe1a799,_0x1a92ce))[_0xfb16('0x3e')](handleError(_0xe1a799,null));};exports[_0xfb16('0x3f')]=function(_0x37266a,_0x554c5b){var _0x223045={'raw':![],'where':{'id':_0x37266a[_0xfb16('0x40')]['id']}},_0x2807bc={};_0x2807bc['model']=_['keys'](db[_0xfb16('0x3a')][_0xfb16('0x41')]);_0x2807bc['query']=_[_0xfb16('0x2c')](_0x37266a['query']);_0x2807bc[_0xfb16('0x2d')]=_['intersection'](_0x2807bc[_0xfb16('0x29')],_0x2807bc['query']);_0x223045['attributes']=_[_0xfb16('0x2e')](_0x2807bc[_0xfb16('0x29')],qs[_0xfb16('0x30')](_0x37266a['query']['fields']));_0x223045[_0xfb16('0x2f')]=_0x223045[_0xfb16('0x2f')][_0xfb16('0x31')]?_0x223045[_0xfb16('0x2f')]:_0x2807bc[_0xfb16('0x29')];if(_0x37266a[_0xfb16('0x2b')][_0xfb16('0x42')]){_0x223045['include']=[{'all':!![]}];}_0x223045=_['merge']({},_0x223045,_0x37266a[_0xfb16('0x39')]);return db[_0xfb16('0x3a')][_0xfb16('0x43')](_0x223045)[_0xfb16('0x23')](handleEntityNotFound(_0x554c5b,null))['then'](respondWithResult(_0x554c5b,null))[_0xfb16('0x3e')](handleError(_0x554c5b,null));};exports[_0xfb16('0x44')]=function(_0x44a792,_0x2413ce){return db['FreshdeskAccount'][_0xfb16('0x44')](_0x44a792[_0xfb16('0x45')],{})[_0xfb16('0x23')](respondWithResult(_0x2413ce,0xc9))[_0xfb16('0x3e')](handleError(_0x2413ce,null));};exports[_0xfb16('0x21')]=function(_0x3820d6,_0x1f0c12){if(_0x3820d6[_0xfb16('0x45')]['id']){delete _0x3820d6[_0xfb16('0x45')]['id'];}return db[_0xfb16('0x3a')][_0xfb16('0x43')]({'where':{'id':_0x3820d6[_0xfb16('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f0c12,null))[_0xfb16('0x23')](saveUpdates(_0x3820d6[_0xfb16('0x45')],null))['then'](respondWithResult(_0x1f0c12,null))[_0xfb16('0x3e')](handleError(_0x1f0c12,null));};exports[_0xfb16('0x22')]=function(_0x3ac1f9,_0x3eee2c){return db[_0xfb16('0x3a')][_0xfb16('0x43')]({'where':{'id':_0x3ac1f9[_0xfb16('0x40')]['id']}})[_0xfb16('0x23')](handleEntityNotFound(_0x3eee2c,null))[_0xfb16('0x23')](removeEntity(_0x3eee2c,null))[_0xfb16('0x3e')](handleError(_0x3eee2c,null));};exports[_0xfb16('0x46')]=function(_0x260076,_0x5b286b,_0x46d242){var _0x2ee526={};var _0x197ff2={};var _0x50e398;var _0x401721;return db[_0xfb16('0x3a')]['findOne']({'where':{'id':_0x260076[_0xfb16('0x40')]['id']}})[_0xfb16('0x23')](handleEntityNotFound(_0x5b286b,null))[_0xfb16('0x23')](function(_0x2da37b){if(_0x2da37b){_0x50e398=_0x2da37b;_0x197ff2[_0xfb16('0x29')]=_[_0xfb16('0x2c')](db['FreshdeskConfiguration'][_0xfb16('0x41')]);_0x197ff2[_0xfb16('0x2b')]=_['keys'](_0x260076[_0xfb16('0x2b')]);_0x197ff2[_0xfb16('0x2d')]=_['intersection'](_0x197ff2[_0xfb16('0x29')],_0x197ff2['query']);_0x2ee526[_0xfb16('0x2f')]=_['intersection'](_0x197ff2[_0xfb16('0x29')],qs[_0xfb16('0x30')](_0x260076[_0xfb16('0x2b')]['fields']));_0x2ee526[_0xfb16('0x2f')]=_0x2ee526[_0xfb16('0x2f')][_0xfb16('0x31')]?_0x2ee526[_0xfb16('0x2f')]:_0x197ff2['model'];_0x2ee526[_0xfb16('0x33')]=qs[_0xfb16('0x34')](_0x260076[_0xfb16('0x2b')][_0xfb16('0x34')]);_0x2ee526['where']=qs[_0xfb16('0x2d')](_['pick'](_0x260076[_0xfb16('0x2b')],_0x197ff2[_0xfb16('0x2d')]));if(_0x260076[_0xfb16('0x2b')][_0xfb16('0x35')]){_0x2ee526[_0xfb16('0x37')]=_[_0xfb16('0x36')](_0x2ee526['where'],{'$or':_[_0xfb16('0x2a')](_0x2ee526['attributes'],function(_0x236da9){var _0x300349={};_0x300349[_0x236da9]={'$like':'%'+_0x260076[_0xfb16('0x2b')][_0xfb16('0x35')]+'%'};return _0x300349;})});}_0x2ee526=_[_0xfb16('0x36')]({},_0x2ee526,_0x260076['options']);return _0x50e398[_0xfb16('0x46')](_0x2ee526);}})['then'](function(_0x4e5fe7){if(_0x4e5fe7){_0x401721=_0x4e5fe7[_0xfb16('0x31')];if(!_0x260076[_0xfb16('0x2b')][_0xfb16('0x32')](_0xfb16('0x47'))){_0x2ee526[_0xfb16('0x1c')]=qs[_0xfb16('0x1c')](_0x260076[_0xfb16('0x2b')][_0xfb16('0x1c')]);_0x2ee526['offset']=qs[_0xfb16('0x1a')](_0x260076['query'][_0xfb16('0x1a')]);}return _0x50e398[_0xfb16('0x46')](_0x2ee526);}})[_0xfb16('0x23')](function(_0x5c0316){if(_0x5c0316){return _0x5c0316?{'count':_0x401721,'rows':_0x5c0316}:null;}})[_0xfb16('0x23')](respondWithResult(_0x5b286b,null))[_0xfb16('0x3e')](handleError(_0x5b286b,null));};exports['addConfiguration']=function(_0x406f0b,_0x217663,_0x5f3cdf){if(_0x406f0b[_0xfb16('0x45')]['id']){delete _0x406f0b['body']['id'];}return db[_0xfb16('0x3a')][_0xfb16('0x48')]({'where':{'id':_0x406f0b['params']['id']}})['then'](handleEntityNotFound(_0x217663,null))[_0xfb16('0x23')](function(_0x4ecdd8){if(_0x4ecdd8){_0x406f0b[_0xfb16('0x45')][_0xfb16('0x49')]=_0x4ecdd8['id'];_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4a')]=integrations['getSubjects'](_0x406f0b[_0xfb16('0x45')]['channel'],_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4b')]);_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4c')]=integrations['getDescriptions'](_0x406f0b['body'][_0xfb16('0x4d')],_0x406f0b[_0xfb16('0x45')][_0xfb16('0x4b')]);return db[_0xfb16('0x4e')]['create'](_0x406f0b[_0xfb16('0x45')],{'include':[{'model':db[_0xfb16('0x4f')],'as':_0xfb16('0x4a')},{'model':db[_0xfb16('0x4f')],'as':_0xfb16('0x4c')}]});}return null;})[_0xfb16('0x23')](respondWithResult(_0x217663,null))['catch'](handleError(_0x217663,null));};exports[_0xfb16('0x50')]=function(_0x1b23e5,_0x3f2642,_0x22aa84){var _0x5e2707='';return db[_0xfb16('0x3a')][_0xfb16('0x48')]({'where':{'id':_0x1b23e5[_0xfb16('0x40')]['id']},'attributes':['id','remoteUri',_0xfb16('0x51')]})[_0xfb16('0x23')](handleEntityNotFound(_0x3f2642,null))[_0xfb16('0x23')](function(_0x16bb2d){if(_0x16bb2d){_0x5e2707=_0x16bb2d[_0xfb16('0x52')];var _0xbb96cd=_0x5e2707[_0xfb16('0x53')](-0x1);if(_0xbb96cd==='/'){_0x5e2707=_0x5e2707[_0xfb16('0x54')](0x0,_0x5e2707[_0xfb16('0x55')](_0xbb96cd));}return rp({'method':_0xfb16('0x56'),'uri':util['format'](_0xfb16('0x57'),_0x5e2707,_0xfb16('0x58')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0xfb16('0x59'),_0x16bb2d['apiKey']))['toString'](_0xfb16('0x5a')))},'json':!![]});}})[_0xfb16('0x23')](function(_0x150b61){if(_0x150b61){var _0x430199=['requester','subject','agent','description',_0xfb16('0x17'),_0xfb16('0x5b'),_0xfb16('0x5c'),_0xfb16('0x5d'),_0xfb16('0x5e'),_0xfb16('0x5c'),_0xfb16('0x5f')];_['remove'](_0x150b61,function(_0x53da0a){return _0x430199['includes'](_0x53da0a[_0xfb16('0x27')])||!_0x53da0a[_0xfb16('0x60')]&&_0x53da0a['type']!==_0xfb16('0x61')&&_0x53da0a[_0xfb16('0x4b')]!=='custom_dropdown';});return{'count':_0x150b61['length'],'rows':_[_0xfb16('0x2a')](_0x150b61,function(_0x28ff0b){return{'id':_0x28ff0b[_0xfb16('0x27')],'name':_0x28ff0b[_0xfb16('0x62')],'custom':!_0x28ff0b[_0xfb16('0x60')],'options':_0x28ff0b['choices']?_[_0xfb16('0x2a')](_0x28ff0b[_0xfb16('0x63')],function(_0x56f037){return{'name':_[_0xfb16('0x64')](_0x56f037),'value':_0x56f037};}):[]};})};}})[_0xfb16('0x23')](respondWithResult(_0x3f2642,null))[_0xfb16('0x3e')](function(_0x322d42){var _0x1c0ce3=_0x1b23e5[_0xfb16('0x2b')][_0xfb16('0x65')]?0x1f4:_0x322d42[_0xfb16('0x66')]||0x1f4;logger[_0xfb16('0x25')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1c0ce3,JSON['stringify'](_0x322d42));delete _0x322d42[_0xfb16('0x27')];if(_0x1c0ce3===0x191){_0x1c0ce3=0x190;}_0x3f2642['status'](_0x1c0ce3)[_0xfb16('0x67')](_0x1b23e5[_0xfb16('0x2b')]['test']?{'message':_0xfb16('0x68'),'statusCode':_0x322d42[_0xfb16('0x66')]}:_0x322d42);});}; \ No newline at end of file +var _0xd1f1=['subject','agent','description','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','pick','filter','addConfiguration','AccountId','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester'];(function(_0x50c50b,_0x3a6fb3){var _0x423c29=function(_0x223cf6){while(--_0x223cf6){_0x50c50b['push'](_0x50c50b['shift']());}};_0x423c29(++_0x3a6fb3);}(_0xd1f1,0x84));var _0x1d1f=function(_0x5b7b22,_0x5bc479){_0x5b7b22=_0x5b7b22-0x0;var _0x53dc9d=_0xd1f1[_0x5b7b22];return _0x53dc9d;};'use strict';var emlformat=require(_0x1d1f('0x0'));var rimraf=require(_0x1d1f('0x1'));var zipdir=require(_0x1d1f('0x2'));var jsonpatch=require(_0x1d1f('0x3'));var rp=require(_0x1d1f('0x4'));var moment=require('moment');var BPromise=require(_0x1d1f('0x5'));var Mustache=require(_0x1d1f('0x6'));var util=require(_0x1d1f('0x7'));var path=require('path');var sox=require(_0x1d1f('0x8'));var csv=require(_0x1d1f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d1f('0xa'));var _=require('lodash');var squel=require(_0x1d1f('0xb'));var crypto=require(_0x1d1f('0xc'));var jsforce=require(_0x1d1f('0xd'));var deskjs=require(_0x1d1f('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d1f('0xf'));var authService=require(_0x1d1f('0x10'));var qs=require(_0x1d1f('0x11'));var as=require(_0x1d1f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d1f('0x13'))(_0x1d1f('0x14'));var utils=require(_0x1d1f('0x15'));var config=require(_0x1d1f('0x16'));var licenseUtil=require(_0x1d1f('0x17'));var db=require(_0x1d1f('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c92c1,_0x48e2c0){_0x48e2c0=_0x48e2c0||0xcc;return function(_0x3e6316){if(_0x3e6316){return _0x4c92c1[_0x1d1f('0x19')](_0x48e2c0);}return _0x4c92c1[_0x1d1f('0x1a')](_0x48e2c0)[_0x1d1f('0x1b')]();};}function respondWithResult(_0x43e323,_0x465f20){_0x465f20=_0x465f20||0xc8;return function(_0x2dbbe6){if(_0x2dbbe6){return _0x43e323[_0x1d1f('0x1a')](_0x465f20)[_0x1d1f('0x1c')](_0x2dbbe6);}};}function respondWithFilteredResult(_0x37af18,_0x2ec931){return function(_0x397f74){if(_0x397f74){var _0x1d4c4d=typeof _0x2ec931['offset']===_0x1d1f('0x1d')&&typeof _0x2ec931[_0x1d1f('0x1e')]===_0x1d1f('0x1d');var _0x184ef3=_0x397f74[_0x1d1f('0x1f')];var _0x37a8e8=_0x1d4c4d?0x0:_0x2ec931[_0x1d1f('0x20')];var _0x308fdb=_0x1d4c4d?_0x397f74[_0x1d1f('0x1f')]:_0x2ec931[_0x1d1f('0x20')]+_0x2ec931[_0x1d1f('0x1e')];var _0x22b68d;if(_0x308fdb>=_0x184ef3){_0x308fdb=_0x184ef3;_0x22b68d=0xc8;}else{_0x22b68d=0xce;}_0x37af18[_0x1d1f('0x1a')](_0x22b68d);return _0x37af18[_0x1d1f('0x21')](_0x1d1f('0x22'),_0x37a8e8+'-'+_0x308fdb+'/'+_0x184ef3)[_0x1d1f('0x1c')](_0x397f74);}return null;};}function patchUpdates(_0x2dac03){return function(_0x16d0bd){try{jsonpatch[_0x1d1f('0x23')](_0x16d0bd,_0x2dac03,!![]);}catch(_0x542821){return BPromise[_0x1d1f('0x24')](_0x542821);}return _0x16d0bd[_0x1d1f('0x25')]();};}function saveUpdates(_0x4f1947,_0x18f05b){return function(_0x450f32){if(_0x450f32){return _0x450f32[_0x1d1f('0x26')](_0x4f1947)[_0x1d1f('0x27')](function(_0xbd591a){return _0xbd591a;});}return null;};}function removeEntity(_0x45cd59,_0x5aae81){return function(_0xbaa0cd){if(_0xbaa0cd){return _0xbaa0cd[_0x1d1f('0x28')]()[_0x1d1f('0x27')](function(){_0x45cd59[_0x1d1f('0x1a')](0xcc)[_0x1d1f('0x1b')]();});}};}function handleEntityNotFound(_0x571ad3,_0x43a03a){return function(_0x293b54){if(!_0x293b54){_0x571ad3['sendStatus'](0x194);}return _0x293b54;};}function handleError(_0x4ec531,_0x4030b0){_0x4030b0=_0x4030b0||0x1f4;return function(_0x1af624){logger[_0x1d1f('0x29')](_0x1af624[_0x1d1f('0x2a')]);if(_0x1af624['name']){delete _0x1af624['name'];}_0x4ec531[_0x1d1f('0x1a')](_0x4030b0)[_0x1d1f('0x2b')](_0x1af624);};}exports[_0x1d1f('0x2c')]=function(_0x1dcac6,_0x285c98){var _0x44e3c1={},_0x5efc5c={},_0x559f20={'count':0x0,'rows':[]};var _0x4a2c75=_[_0x1d1f('0x2d')](db[_0x1d1f('0x2e')][_0x1d1f('0x2f')],function(_0x4dcdd2){return{'name':_0x4dcdd2[_0x1d1f('0x30')],'type':_0x4dcdd2[_0x1d1f('0x31')]['key']};});_0x5efc5c[_0x1d1f('0x32')]=_[_0x1d1f('0x2d')](_0x4a2c75,_0x1d1f('0x33'));_0x5efc5c[_0x1d1f('0x34')]=_[_0x1d1f('0x35')](_0x1dcac6[_0x1d1f('0x34')]);_0x5efc5c[_0x1d1f('0x36')]=_[_0x1d1f('0x37')](_0x5efc5c[_0x1d1f('0x32')],_0x5efc5c[_0x1d1f('0x34')]);_0x44e3c1[_0x1d1f('0x38')]=_[_0x1d1f('0x37')](_0x5efc5c[_0x1d1f('0x32')],qs[_0x1d1f('0x39')](_0x1dcac6[_0x1d1f('0x34')][_0x1d1f('0x39')]));_0x44e3c1[_0x1d1f('0x38')]=_0x44e3c1[_0x1d1f('0x38')][_0x1d1f('0x3a')]?_0x44e3c1[_0x1d1f('0x38')]:_0x5efc5c[_0x1d1f('0x32')];if(!_0x1dcac6[_0x1d1f('0x34')][_0x1d1f('0x3b')]('nolimit')){_0x44e3c1[_0x1d1f('0x1e')]=qs[_0x1d1f('0x1e')](_0x1dcac6[_0x1d1f('0x34')][_0x1d1f('0x1e')]);_0x44e3c1['offset']=qs['offset'](_0x1dcac6[_0x1d1f('0x34')][_0x1d1f('0x20')]);}_0x44e3c1[_0x1d1f('0x3c')]=qs[_0x1d1f('0x3d')](_0x1dcac6[_0x1d1f('0x34')][_0x1d1f('0x3d')]);_0x44e3c1['where']=qs[_0x1d1f('0x36')](_['pick'](_0x1dcac6['query'],_0x5efc5c[_0x1d1f('0x36')]),_0x4a2c75);if(_0x1dcac6[_0x1d1f('0x34')]['filter']){_0x44e3c1[_0x1d1f('0x3e')]=_[_0x1d1f('0x3f')](_0x44e3c1[_0x1d1f('0x3e')],{'$or':_['map'](_0x4a2c75,function(_0x114bf7){if(_0x114bf7['type']!==_0x1d1f('0x40')){var _0x55c16e={};_0x55c16e[_0x114bf7[_0x1d1f('0x33')]]={'$like':'%'+_0x1dcac6[_0x1d1f('0x34')]['filter']+'%'};return _0x55c16e;}})});}_0x44e3c1=_[_0x1d1f('0x3f')]({},_0x44e3c1,_0x1dcac6[_0x1d1f('0x41')]);var _0x46b3aa={'where':_0x44e3c1[_0x1d1f('0x3e')]};return db[_0x1d1f('0x2e')][_0x1d1f('0x1f')](_0x46b3aa)[_0x1d1f('0x27')](function(_0x4e9a2b){_0x559f20[_0x1d1f('0x1f')]=_0x4e9a2b;if(_0x1dcac6[_0x1d1f('0x34')][_0x1d1f('0x42')]){_0x44e3c1['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x1d1f('0x43')](_0x44e3c1);})[_0x1d1f('0x27')](function(_0x27b502){_0x559f20['rows']=_0x27b502;return _0x559f20;})[_0x1d1f('0x27')](respondWithFilteredResult(_0x285c98,_0x44e3c1))[_0x1d1f('0x44')](handleError(_0x285c98,null));};exports[_0x1d1f('0x45')]=function(_0x4a11a7,_0x366511){var _0x208c9c={'raw':![],'where':{'id':_0x4a11a7[_0x1d1f('0x46')]['id']}},_0xc64a={};_0xc64a[_0x1d1f('0x32')]=_[_0x1d1f('0x35')](db[_0x1d1f('0x2e')][_0x1d1f('0x2f')]);_0xc64a[_0x1d1f('0x34')]=_[_0x1d1f('0x35')](_0x4a11a7[_0x1d1f('0x34')]);_0xc64a[_0x1d1f('0x36')]=_[_0x1d1f('0x37')](_0xc64a[_0x1d1f('0x32')],_0xc64a[_0x1d1f('0x34')]);_0x208c9c['attributes']=_[_0x1d1f('0x37')](_0xc64a[_0x1d1f('0x32')],qs['fields'](_0x4a11a7[_0x1d1f('0x34')][_0x1d1f('0x39')]));_0x208c9c['attributes']=_0x208c9c[_0x1d1f('0x38')][_0x1d1f('0x3a')]?_0x208c9c[_0x1d1f('0x38')]:_0xc64a[_0x1d1f('0x32')];if(_0x4a11a7[_0x1d1f('0x34')][_0x1d1f('0x42')]){_0x208c9c[_0x1d1f('0x47')]=[{'all':!![]}];}_0x208c9c=_[_0x1d1f('0x3f')]({},_0x208c9c,_0x4a11a7[_0x1d1f('0x41')]);return db['FreshdeskAccount'][_0x1d1f('0x48')](_0x208c9c)['then'](handleEntityNotFound(_0x366511,null))['then'](respondWithResult(_0x366511,null))[_0x1d1f('0x44')](handleError(_0x366511,null));};exports['create']=function(_0x51ccee,_0x3bcb5d){return db[_0x1d1f('0x2e')][_0x1d1f('0x49')](_0x51ccee[_0x1d1f('0x4a')],{})['then'](respondWithResult(_0x3bcb5d,0xc9))[_0x1d1f('0x44')](handleError(_0x3bcb5d,null));};exports['update']=function(_0x44a2db,_0x2f8af1){if(_0x44a2db['body']['id']){delete _0x44a2db[_0x1d1f('0x4a')]['id'];}return db[_0x1d1f('0x2e')][_0x1d1f('0x48')]({'where':{'id':_0x44a2db[_0x1d1f('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f8af1,null))[_0x1d1f('0x27')](saveUpdates(_0x44a2db[_0x1d1f('0x4a')],null))[_0x1d1f('0x27')](respondWithResult(_0x2f8af1,null))[_0x1d1f('0x44')](handleError(_0x2f8af1,null));};exports[_0x1d1f('0x28')]=function(_0x5cb6e2,_0x246068){return db[_0x1d1f('0x2e')][_0x1d1f('0x48')]({'where':{'id':_0x5cb6e2[_0x1d1f('0x46')]['id']}})[_0x1d1f('0x27')](handleEntityNotFound(_0x246068,null))['then'](removeEntity(_0x246068,null))[_0x1d1f('0x44')](handleError(_0x246068,null));};exports[_0x1d1f('0x4b')]=function(_0x8fff2d,_0x430ef4,_0x1ea0d1){var _0x39fd17={};var _0x24ad15={};var _0x454af6;var _0x53c86c;return db[_0x1d1f('0x2e')][_0x1d1f('0x4c')]({'where':{'id':_0x8fff2d['params']['id']}})[_0x1d1f('0x27')](handleEntityNotFound(_0x430ef4,null))[_0x1d1f('0x27')](function(_0x2199d2){if(_0x2199d2){_0x454af6=_0x2199d2;_0x24ad15[_0x1d1f('0x32')]=_[_0x1d1f('0x35')](db[_0x1d1f('0x4d')][_0x1d1f('0x2f')]);_0x24ad15[_0x1d1f('0x34')]=_[_0x1d1f('0x35')](_0x8fff2d['query']);_0x24ad15[_0x1d1f('0x36')]=_[_0x1d1f('0x37')](_0x24ad15[_0x1d1f('0x32')],_0x24ad15[_0x1d1f('0x34')]);_0x39fd17[_0x1d1f('0x38')]=_[_0x1d1f('0x37')](_0x24ad15[_0x1d1f('0x32')],qs[_0x1d1f('0x39')](_0x8fff2d[_0x1d1f('0x34')][_0x1d1f('0x39')]));_0x39fd17[_0x1d1f('0x38')]=_0x39fd17[_0x1d1f('0x38')][_0x1d1f('0x3a')]?_0x39fd17['attributes']:_0x24ad15[_0x1d1f('0x32')];_0x39fd17['order']=qs[_0x1d1f('0x3d')](_0x8fff2d['query'][_0x1d1f('0x3d')]);_0x39fd17[_0x1d1f('0x3e')]=qs[_0x1d1f('0x36')](_[_0x1d1f('0x4e')](_0x8fff2d['query'],_0x24ad15[_0x1d1f('0x36')]));if(_0x8fff2d[_0x1d1f('0x34')][_0x1d1f('0x4f')]){_0x39fd17[_0x1d1f('0x3e')]=_[_0x1d1f('0x3f')](_0x39fd17[_0x1d1f('0x3e')],{'$or':_[_0x1d1f('0x2d')](_0x39fd17[_0x1d1f('0x38')],function(_0x54f9cc){var _0x1ba309={};_0x1ba309[_0x54f9cc]={'$like':'%'+_0x8fff2d[_0x1d1f('0x34')][_0x1d1f('0x4f')]+'%'};return _0x1ba309;})});}_0x39fd17=_['merge']({},_0x39fd17,_0x8fff2d['options']);return _0x454af6[_0x1d1f('0x4b')](_0x39fd17);}})[_0x1d1f('0x27')](function(_0x1c5cdf){if(_0x1c5cdf){_0x53c86c=_0x1c5cdf[_0x1d1f('0x3a')];if(!_0x8fff2d[_0x1d1f('0x34')][_0x1d1f('0x3b')]('nolimit')){_0x39fd17[_0x1d1f('0x1e')]=qs[_0x1d1f('0x1e')](_0x8fff2d[_0x1d1f('0x34')]['limit']);_0x39fd17[_0x1d1f('0x20')]=qs['offset'](_0x8fff2d['query'][_0x1d1f('0x20')]);}return _0x454af6[_0x1d1f('0x4b')](_0x39fd17);}})[_0x1d1f('0x27')](function(_0x3d13c5){if(_0x3d13c5){return _0x3d13c5?{'count':_0x53c86c,'rows':_0x3d13c5}:null;}})['then'](respondWithResult(_0x430ef4,null))[_0x1d1f('0x44')](handleError(_0x430ef4,null));};exports[_0x1d1f('0x50')]=function(_0x5cfc5e,_0x431c8e,_0x4b3725){if(_0x5cfc5e[_0x1d1f('0x4a')]['id']){delete _0x5cfc5e[_0x1d1f('0x4a')]['id'];}return db[_0x1d1f('0x2e')][_0x1d1f('0x4c')]({'where':{'id':_0x5cfc5e[_0x1d1f('0x46')]['id']}})[_0x1d1f('0x27')](handleEntityNotFound(_0x431c8e,null))[_0x1d1f('0x27')](function(_0x2406f5){if(_0x2406f5){_0x5cfc5e[_0x1d1f('0x4a')][_0x1d1f('0x51')]=_0x2406f5['id'];_0x5cfc5e[_0x1d1f('0x4a')]['Subjects']=integrations['getSubjects'](_0x5cfc5e[_0x1d1f('0x4a')][_0x1d1f('0x52')],_0x5cfc5e['body'][_0x1d1f('0x31')]);_0x5cfc5e[_0x1d1f('0x4a')][_0x1d1f('0x53')]=integrations[_0x1d1f('0x54')](_0x5cfc5e['body'][_0x1d1f('0x52')],_0x5cfc5e[_0x1d1f('0x4a')][_0x1d1f('0x31')]);return db[_0x1d1f('0x4d')][_0x1d1f('0x49')](_0x5cfc5e[_0x1d1f('0x4a')],{'include':[{'model':db[_0x1d1f('0x55')],'as':'Subjects'},{'model':db[_0x1d1f('0x55')],'as':_0x1d1f('0x53')}]});}return null;})[_0x1d1f('0x27')](respondWithResult(_0x431c8e,null))[_0x1d1f('0x44')](handleError(_0x431c8e,null));};exports['getFields']=function(_0x5b400f,_0x94d836,_0x3a15d3){var _0xc79235='';return db[_0x1d1f('0x2e')][_0x1d1f('0x4c')]({'where':{'id':_0x5b400f[_0x1d1f('0x46')]['id']},'attributes':['id',_0x1d1f('0x56'),_0x1d1f('0x57')]})[_0x1d1f('0x27')](handleEntityNotFound(_0x94d836,null))[_0x1d1f('0x27')](function(_0x268daa){if(_0x268daa){_0xc79235=_0x268daa['remoteUri'];var _0x5a8fa3=_0xc79235[_0x1d1f('0x58')](-0x1);if(_0x5a8fa3==='/'){_0xc79235=_0xc79235[_0x1d1f('0x59')](0x0,_0xc79235[_0x1d1f('0x5a')](_0x5a8fa3));}return rp({'method':_0x1d1f('0x5b'),'uri':util['format'](_0x1d1f('0x5c'),_0xc79235,_0x1d1f('0x5d')),'headers':{'Authorization':util[_0x1d1f('0x5e')](_0x1d1f('0x5f'),new Buffer(util['format'](_0x1d1f('0x60'),_0x268daa[_0x1d1f('0x57')]))[_0x1d1f('0x61')](_0x1d1f('0x62')))},'json':!![]});}})[_0x1d1f('0x27')](function(_0x1d3483){if(_0x1d3483){var _0x416ce4=[_0x1d1f('0x63'),_0x1d1f('0x64'),_0x1d1f('0x65'),_0x1d1f('0x66'),_0x1d1f('0x1a'),'priority','group','source',_0x1d1f('0x67'),'group',_0x1d1f('0x68')];_['remove'](_0x1d3483,function(_0x4a0076){return _0x416ce4[_0x1d1f('0x69')](_0x4a0076[_0x1d1f('0x33')])||!_0x4a0076[_0x1d1f('0x6a')]&&_0x4a0076[_0x1d1f('0x31')]!==_0x1d1f('0x6b')&&_0x4a0076[_0x1d1f('0x31')]!==_0x1d1f('0x6c');});return{'count':_0x1d3483[_0x1d1f('0x3a')],'rows':_[_0x1d1f('0x2d')](_0x1d3483,function(_0x3c90e1){return{'id':_0x3c90e1['name'],'name':_0x3c90e1[_0x1d1f('0x6d')],'custom':!_0x3c90e1[_0x1d1f('0x6a')],'options':_0x3c90e1['choices']?_['map'](_0x3c90e1[_0x1d1f('0x6e')],function(_0xf546a7){return{'name':_[_0x1d1f('0x6f')](_0xf546a7),'value':_0xf546a7};}):[]};})};}})[_0x1d1f('0x27')](respondWithResult(_0x94d836,null))[_0x1d1f('0x44')](function(_0x2565db){var _0x3b0765=_0x5b400f[_0x1d1f('0x34')][_0x1d1f('0x70')]?0x1f4:_0x2565db[_0x1d1f('0x71')]||0x1f4;logger[_0x1d1f('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x1d1f('0x72'),_0x3b0765,JSON[_0x1d1f('0x73')](_0x2565db));delete _0x2565db['name'];if(_0x3b0765===0x191){_0x3b0765=0x190;}_0x94d836[_0x1d1f('0x1a')](_0x3b0765)[_0x1d1f('0x2b')](_0x5b400f['query'][_0x1d1f('0x70')]?{'message':'Wrong\x20credentials','statusCode':_0x2565db[_0x1d1f('0x71')]}:_0x2565db);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0fdd247..010840f 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 _0x8d77=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash'];(function(_0x225f50,_0x48a77d){var _0x19d003=function(_0x58965d){while(--_0x58965d){_0x225f50['push'](_0x225f50['shift']());}};_0x19d003(++_0x48a77d);}(_0x8d77,0xdc));var _0x78d7=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x8d77[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x78d7('0x0'));var util=require(_0x78d7('0x1'));var logger=require(_0x78d7('0x2'))(_0x78d7('0x3'));var moment=require(_0x78d7('0x4'));var BPromise=require(_0x78d7('0x5'));var rp=require(_0x78d7('0x6'));var fs=require('fs');var path=require(_0x78d7('0x7'));var rimraf=require('rimraf');var config=require(_0x78d7('0x8'));var attributes=require(_0x78d7('0x9'));var integrations=require(_0x78d7('0xa'));module['exports']=function(_0x249045,_0x55ae4a){return _0x249045['define'](_0x78d7('0xb'),attributes,{'tableName':_0x78d7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc4a=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xbc4a,0x89));var _0xabc4=function(_0x1a1ea5,_0x48475a){_0x1a1ea5=_0x1a1ea5-0x0;var _0xed49a=_0xbc4a[_0x1a1ea5];return _0xed49a;};'use strict';var _=require(_0xabc4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xabc4('0x1'));var moment=require(_0xabc4('0x2'));var BPromise=require(_0xabc4('0x3'));var rp=require(_0xabc4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xabc4('0x5'));var attributes=require(_0xabc4('0x6'));var integrations=require(_0xabc4('0x7'));module[_0xabc4('0x8')]=function(_0x3fbafb,_0x12760a){return _0x3fbafb[_0xabc4('0x9')](_0xabc4('0xa'),attributes,{'tableName':'int_freshdesk_accounts','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 e0108df..a53f063 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 _0xb3dd=['ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','catch'];(function(_0x51cc2e,_0x4b967f){var _0x1aae31=function(_0x3fd51d){while(--_0x3fd51d){_0x51cc2e['push'](_0x51cc2e['shift']());}};_0x1aae31(++_0x4b967f);}(_0xb3dd,0xce));var _0xdb3d=function(_0x273e58,_0x22273d){_0x273e58=_0x273e58-0x0;var _0x5eab8f=_0xb3dd[_0x273e58];return _0x5eab8f;};'use strict';var _=require(_0xdb3d('0x0'));var util=require(_0xdb3d('0x1'));var moment=require('moment');var BPromise=require(_0xdb3d('0x2'));var rs=require(_0xdb3d('0x3'));var fs=require('fs');var Redis=require(_0xdb3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb3d('0x5'));var logger=require('../../config/logger')(_0xdb3d('0x6'));var config=require('../../config/environment');var jayson=require(_0xdb3d('0x7'));var client=jayson['client'][_0xdb3d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f8760,_0x5ac328,_0x42b7fa){return new BPromise(function(_0x384fe2,_0x22c04e){return client[_0xdb3d('0x9')](_0x3f8760,_0x42b7fa)[_0xdb3d('0xa')](function(_0x261294){logger[_0xdb3d('0xb')](_0xdb3d('0xc'),_0x5ac328,'request\x20sent');logger['debug'](_0xdb3d('0xd'),_0x5ac328,_0xdb3d('0xe'),JSON[_0xdb3d('0xf')](_0x261294));if(_0x261294[_0xdb3d('0x10')]){if(_0x261294['error'][_0xdb3d('0x11')]===0x1f4){logger[_0xdb3d('0x10')](_0xdb3d('0xc'),_0x5ac328,_0x261294[_0xdb3d('0x10')][_0xdb3d('0x12')]);return _0x22c04e(_0x261294['error']['message']);}logger[_0xdb3d('0x10')](_0xdb3d('0xc'),_0x5ac328,_0x261294[_0xdb3d('0x10')][_0xdb3d('0x12')]);return _0x384fe2(_0x261294['error'][_0xdb3d('0x12')]);}else{logger[_0xdb3d('0xb')](_0xdb3d('0xc'),_0x5ac328,_0xdb3d('0xe'));_0x384fe2(_0x261294['result'][_0xdb3d('0x12')]);}})['catch'](function(_0x2cc87e){logger['error'](_0xdb3d('0xc'),_0x5ac328,_0x2cc87e);_0x22c04e(_0x2cc87e);});});}exports[_0xdb3d('0x13')]=function(_0x115ad6){var _0x4d80b0=this;return new Promise(function(_0x187bb1,_0x5bf464){return db[_0xdb3d('0x14')][_0xdb3d('0x15')]({'raw':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x17')]===undefined?!![]:![]:!![],'where':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x18')]||null:null,'attributes':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')]['attributes']||null:null,'limit':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6['options'][_0xdb3d('0x19')]||null:null,'include':_0x115ad6[_0xdb3d('0x16')]?_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x115ad6[_0xdb3d('0x16')][_0xdb3d('0x1a')],function(_0x19a479){return{'model':db[_0x19a479[_0xdb3d('0x1c')]],'as':_0x19a479['as'],'attributes':_0x19a479[_0xdb3d('0x1d')],'include':_0x19a479[_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x19a479[_0xdb3d('0x1a')],function(_0x5813c0){return{'model':db[_0x5813c0[_0xdb3d('0x1c')]],'as':_0x5813c0['as'],'attributes':_0x5813c0[_0xdb3d('0x1d')],'include':_0x5813c0[_0xdb3d('0x1a')]?_['map'](_0x5813c0['include'],function(_0x48eee9){return{'model':db[_0x48eee9[_0xdb3d('0x1c')]],'as':_0x48eee9['as'],'attributes':_0x48eee9['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a89d3){logger[_0xdb3d('0xb')]('GetFreshdeskAccount',_0x115ad6);logger[_0xdb3d('0x1e')](_0xdb3d('0x13'),_0x115ad6,JSON[_0xdb3d('0xf')](_0x3a89d3));_0x187bb1(_0x3a89d3);})[_0xdb3d('0x1f')](function(_0x2cfbbd){logger[_0xdb3d('0x10')](_0xdb3d('0x13'),_0x2cfbbd[_0xdb3d('0x12')],_0x115ad6);_0x5bf464(_0x4d80b0[_0xdb3d('0x10')](0x1f4,_0x2cfbbd[_0xdb3d('0x12')]));});});};exports[_0xdb3d('0x20')]=function(_0x2f600e){var _0x46d32c=this;return new Promise(function(_0x245b9e,_0x11825f){return db[_0xdb3d('0x14')][_0xdb3d('0x21')]({'raw':_0x2f600e[_0xdb3d('0x16')]?_0x2f600e[_0xdb3d('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2f600e['options']?_0x2f600e[_0xdb3d('0x16')][_0xdb3d('0x18')]||null:null,'attributes':_0x2f600e[_0xdb3d('0x16')]?_0x2f600e[_0xdb3d('0x16')][_0xdb3d('0x1d')]||null:null,'include':_0x2f600e[_0xdb3d('0x16')]?_0x2f600e['options'][_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x2f600e['options'][_0xdb3d('0x1a')],function(_0x362967){return{'model':db[_0x362967['model']],'as':_0x362967['as'],'attributes':_0x362967[_0xdb3d('0x1d')],'include':_0x362967[_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x362967[_0xdb3d('0x1a')],function(_0x4ae51f){return{'model':db[_0x4ae51f[_0xdb3d('0x1c')]],'as':_0x4ae51f['as'],'attributes':_0x4ae51f['attributes'],'include':_0x4ae51f[_0xdb3d('0x1a')]?_[_0xdb3d('0x1b')](_0x4ae51f[_0xdb3d('0x1a')],function(_0x28c33d){return{'model':db[_0x28c33d[_0xdb3d('0x1c')]],'as':_0x28c33d['as'],'attributes':_0x28c33d[_0xdb3d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdb3d('0xa')](function(_0x585eb2){logger['info']('ShowFreshdeskAccount',_0x2f600e);logger[_0xdb3d('0x1e')](_0xdb3d('0x20'),_0x2f600e,JSON['stringify'](_0x585eb2));_0x245b9e(_0x585eb2);})[_0xdb3d('0x1f')](function(_0x253d65){logger[_0xdb3d('0x10')](_0xdb3d('0x20'),_0x253d65['message'],_0x2f600e);_0x11825f(_0x46d32c['error'](0x1f4,_0x253d65[_0xdb3d('0x12')]));});});}; \ No newline at end of file +var _0x7b68=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','include','model','map','ShowFreshdeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e8e69,_0x4ad9d8){var _0x44667f=function(_0x444987){while(--_0x444987){_0x1e8e69['push'](_0x1e8e69['shift']());}};_0x44667f(++_0x4ad9d8);}(_0x7b68,0x1e7));var _0x87b6=function(_0x4d8419,_0x310d02){_0x4d8419=_0x4d8419-0x0;var _0x17e249=_0x7b68[_0x4d8419];return _0x17e249;};'use strict';var _=require(_0x87b6('0x0'));var util=require(_0x87b6('0x1'));var moment=require(_0x87b6('0x2'));var BPromise=require(_0x87b6('0x3'));var rs=require(_0x87b6('0x4'));var fs=require('fs');var Redis=require(_0x87b6('0x5'));var db=require(_0x87b6('0x6'))['db'];var utils=require(_0x87b6('0x7'));var logger=require(_0x87b6('0x8'))(_0x87b6('0x9'));var config=require('../../config/environment');var jayson=require(_0x87b6('0xa'));var client=jayson[_0x87b6('0xb')][_0x87b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a7f4e,_0x33ceb5,_0x1446d7){return new BPromise(function(_0xab98ac,_0x38e12e){return client[_0x87b6('0xd')](_0x2a7f4e,_0x1446d7)[_0x87b6('0xe')](function(_0x59baf5){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x33ceb5,_0x87b6('0xf'));logger[_0x87b6('0x10')](_0x87b6('0x11'),_0x33ceb5,_0x87b6('0xf'),JSON[_0x87b6('0x12')](_0x59baf5));if(_0x59baf5[_0x87b6('0x13')]){if(_0x59baf5[_0x87b6('0x13')][_0x87b6('0x14')]===0x1f4){logger[_0x87b6('0x13')](_0x87b6('0x15'),_0x33ceb5,_0x59baf5[_0x87b6('0x13')]['message']);return _0x38e12e(_0x59baf5['error'][_0x87b6('0x16')]);}logger[_0x87b6('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x33ceb5,_0x59baf5[_0x87b6('0x13')]['message']);return _0xab98ac(_0x59baf5[_0x87b6('0x13')][_0x87b6('0x16')]);}else{logger[_0x87b6('0x17')](_0x87b6('0x15'),_0x33ceb5,_0x87b6('0xf'));_0xab98ac(_0x59baf5[_0x87b6('0x18')][_0x87b6('0x16')]);}})[_0x87b6('0x19')](function(_0x2bba3b){logger[_0x87b6('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x33ceb5,_0x2bba3b);_0x38e12e(_0x2bba3b);});});}exports[_0x87b6('0x1a')]=function(_0x497213){var _0x54e271=this;return new Promise(function(_0x253aa1,_0x550826){return db[_0x87b6('0x1b')][_0x87b6('0x1c')]({'raw':_0x497213['options']?_0x497213[_0x87b6('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x497213[_0x87b6('0x1d')]?_0x497213[_0x87b6('0x1d')][_0x87b6('0x1e')]||null:null,'attributes':_0x497213[_0x87b6('0x1d')]?_0x497213[_0x87b6('0x1d')][_0x87b6('0x1f')]||null:null,'limit':_0x497213['options']?_0x497213[_0x87b6('0x1d')]['limit']||null:null,'include':_0x497213[_0x87b6('0x1d')]?_0x497213['options'][_0x87b6('0x20')]?_['map'](_0x497213['options'][_0x87b6('0x20')],function(_0x17f471){return{'model':db[_0x17f471[_0x87b6('0x21')]],'as':_0x17f471['as'],'attributes':_0x17f471[_0x87b6('0x1f')],'include':_0x17f471[_0x87b6('0x20')]?_[_0x87b6('0x22')](_0x17f471[_0x87b6('0x20')],function(_0x2df688){return{'model':db[_0x2df688[_0x87b6('0x21')]],'as':_0x2df688['as'],'attributes':_0x2df688['attributes'],'include':_0x2df688['include']?_['map'](_0x2df688['include'],function(_0x465c1e){return{'model':db[_0x465c1e[_0x87b6('0x21')]],'as':_0x465c1e['as'],'attributes':_0x465c1e[_0x87b6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x87b6('0xe')](function(_0x41ca02){logger[_0x87b6('0x17')]('GetFreshdeskAccount',_0x497213);logger[_0x87b6('0x10')](_0x87b6('0x1a'),_0x497213,JSON[_0x87b6('0x12')](_0x41ca02));_0x253aa1(_0x41ca02);})[_0x87b6('0x19')](function(_0xc14819){logger[_0x87b6('0x13')](_0x87b6('0x1a'),_0xc14819[_0x87b6('0x16')],_0x497213);_0x550826(_0x54e271[_0x87b6('0x13')](0x1f4,_0xc14819[_0x87b6('0x16')]));});});};exports[_0x87b6('0x23')]=function(_0x2ed49c){var _0x5cfc0d=this;return new Promise(function(_0x5e63d1,_0x33f162){return db[_0x87b6('0x1b')][_0x87b6('0x24')]({'raw':_0x2ed49c['options']?_0x2ed49c[_0x87b6('0x1d')][_0x87b6('0x25')]===undefined?!![]:![]:!![],'where':_0x2ed49c[_0x87b6('0x1d')]?_0x2ed49c[_0x87b6('0x1d')][_0x87b6('0x1e')]||null:null,'attributes':_0x2ed49c[_0x87b6('0x1d')]?_0x2ed49c['options'][_0x87b6('0x1f')]||null:null,'include':_0x2ed49c['options']?_0x2ed49c[_0x87b6('0x1d')][_0x87b6('0x20')]?_[_0x87b6('0x22')](_0x2ed49c[_0x87b6('0x1d')][_0x87b6('0x20')],function(_0x187d85){return{'model':db[_0x187d85[_0x87b6('0x21')]],'as':_0x187d85['as'],'attributes':_0x187d85['attributes'],'include':_0x187d85[_0x87b6('0x20')]?_[_0x87b6('0x22')](_0x187d85[_0x87b6('0x20')],function(_0x59b02f){return{'model':db[_0x59b02f['model']],'as':_0x59b02f['as'],'attributes':_0x59b02f[_0x87b6('0x1f')],'include':_0x59b02f[_0x87b6('0x20')]?_['map'](_0x59b02f[_0x87b6('0x20')],function(_0x2e0e8a){return{'model':db[_0x2e0e8a['model']],'as':_0x2e0e8a['as'],'attributes':_0x2e0e8a[_0x87b6('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x87b6('0xe')](function(_0x2c9a3d){logger['info'](_0x87b6('0x23'),_0x2ed49c);logger['debug'](_0x87b6('0x23'),_0x2ed49c,JSON[_0x87b6('0x12')](_0x2c9a3d));_0x5e63d1(_0x2c9a3d);})[_0x87b6('0x19')](function(_0x594b24){logger[_0x87b6('0x13')]('ShowFreshdeskAccount',_0x594b24[_0x87b6('0x16')],_0x2ed49c);_0x33f162(_0x5cfc0d[_0x87b6('0x13')](0x1f4,_0x594b24[_0x87b6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index b12b5ea..d23c4bd 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 _0x2c5d=['/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','show'];(function(_0x40123a,_0x1f8a5b){var _0x5f1511=function(_0x914091){while(--_0x914091){_0x40123a['push'](_0x40123a['shift']());}};_0x5f1511(++_0x1f8a5b);}(_0x2c5d,0x15b));var _0xd2c5=function(_0x53329d,_0xcd480d){_0x53329d=_0x53329d-0x0;var _0xf81ddd=_0x2c5d[_0x53329d];return _0xf81ddd;};'use strict';var multer=require('multer');var util=require(_0xd2c5('0x0'));var path=require(_0xd2c5('0x1'));var timeout=require('connect-timeout');var express=require(_0xd2c5('0x2'));var router=express[_0xd2c5('0x3')]();var fs_extra=require(_0xd2c5('0x4'));var auth=require(_0xd2c5('0x5'));var interaction=require(_0xd2c5('0x6'));var config=require(_0xd2c5('0x7'));var controller=require(_0xd2c5('0x8'));router[_0xd2c5('0x9')]('/',auth['isAuthenticated'](),controller[_0xd2c5('0xa')]);router[_0xd2c5('0x9')](_0xd2c5('0xb'),auth['isAuthenticated'](),controller[_0xd2c5('0xc')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xd2c5('0x9')](_0xd2c5('0xd'),auth[_0xd2c5('0xe')](),controller[_0xd2c5('0xf')]);router[_0xd2c5('0x9')](_0xd2c5('0x10'),auth['isAuthenticated'](),controller[_0xd2c5('0x11')]);router[_0xd2c5('0x9')]('/:id/tags',auth[_0xd2c5('0xe')](),controller['getTags']);router[_0xd2c5('0x12')]('/',auth['isAuthenticated'](),controller[_0xd2c5('0x13')]);router[_0xd2c5('0x12')](_0xd2c5('0x14'),auth[_0xd2c5('0xe')](),controller[_0xd2c5('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xd2c5('0xb'),auth['isAuthenticated'](),controller[_0xd2c5('0x16')]);module[_0xd2c5('0x17')]=router; \ No newline at end of file +var _0x94a8=['./intFreshdeskConfiguration.controller','isAuthenticated','index','show','get','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../config/environment'];(function(_0x3e2452,_0x477868){var _0x5be07=function(_0x203c72){while(--_0x203c72){_0x3e2452['push'](_0x3e2452['shift']());}};_0x5be07(++_0x477868);}(_0x94a8,0x78));var _0x894a=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x94a8[_0x334841];return _0x5beb4b;};'use strict';var multer=require(_0x894a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x894a('0x1'));var router=express[_0x894a('0x2')]();var fs_extra=require(_0x894a('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x894a('0x4'));var controller=require(_0x894a('0x5'));router['get']('/',auth[_0x894a('0x6')](),controller[_0x894a('0x7')]);router['get']('/:id',auth[_0x894a('0x6')](),controller[_0x894a('0x8')]);router[_0x894a('0x9')]('/:id/fields',auth[_0x894a('0x6')](),controller[_0x894a('0xa')]);router['get'](_0x894a('0xb'),auth[_0x894a('0x6')](),controller[_0x894a('0xc')]);router[_0x894a('0x9')](_0x894a('0xd'),auth['isAuthenticated'](),controller[_0x894a('0xe')]);router['get'](_0x894a('0xf'),auth[_0x894a('0x6')](),controller[_0x894a('0x10')]);router[_0x894a('0x11')]('/',auth[_0x894a('0x6')](),controller[_0x894a('0x12')]);router[_0x894a('0x11')]('/:id/tags',auth[_0x894a('0x6')](),controller['setTags']);router[_0x894a('0x13')](_0x894a('0x14'),auth[_0x894a('0x6')](),controller[_0x894a('0x15')]);router[_0x894a('0x16')]('/:id',auth[_0x894a('0x6')](),controller[_0x894a('0x17')]);module[_0x894a('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 4db4b81..789a3b0 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 _0x55de=['STRING','exports'];(function(_0x329c16,_0x23a5e1){var _0x54d505=function(_0x24b047){while(--_0x24b047){_0x329c16['push'](_0x329c16['shift']());}};_0x54d505(++_0x23a5e1);}(_0x55de,0x1b1));var _0xe55d=function(_0x2290ae,_0xbbbf35){_0x2290ae=_0x2290ae-0x0;var _0x38bdd0=_0x55de[_0x2290ae];return _0x38bdd0;};'use strict';var Sequelize=require('sequelize');module[_0xe55d('0x0')]={'name':{'type':Sequelize[_0xe55d('0x1')]},'description':{'type':Sequelize[_0xe55d('0x1')]}}; \ No newline at end of file +var _0xf426=['sequelize','exports','STRING'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xf426,0xd5));var _0x6f42=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xf426[_0x3c59fc];return _0x2b78d4;};'use strict';var Sequelize=require(_0x6f42('0x0'));module[_0x6f42('0x1')]={'name':{'type':Sequelize[_0x6f42('0x2')]},'description':{'type':Sequelize[_0x6f42('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index cc316a6..5aebb13 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 _0x9068=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','type','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','destroy','params','getFields','findOne','FreshdeskField','sort','hasOwnProperty','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x1007b3,_0x344f7f){var _0x7cf215=function(_0x5e25a0){while(--_0x5e25a0){_0x1007b3['push'](_0x1007b3['shift']());}};_0x7cf215(++_0x344f7f);}(_0x9068,0x98));var _0x8906=function(_0x37aea3,_0x54352a){_0x37aea3=_0x37aea3-0x0;var _0x14637c=_0x9068[_0x37aea3];return _0x14637c;};'use strict';var emlformat=require(_0x8906('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8906('0x1'));var jsonpatch=require(_0x8906('0x2'));var rp=require('request-promise');var moment=require(_0x8906('0x3'));var BPromise=require(_0x8906('0x4'));var Mustache=require(_0x8906('0x5'));var util=require(_0x8906('0x6'));var path=require(_0x8906('0x7'));var sox=require(_0x8906('0x8'));var csv=require(_0x8906('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8906('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8906('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8906('0x9'));var querystring=require(_0x8906('0xc'));var Papa=require(_0x8906('0xd'));var Redis=require(_0x8906('0xe'));var authService=require(_0x8906('0xf'));var qs=require(_0x8906('0x10'));var as=require(_0x8906('0x11'));var hardwareService=require(_0x8906('0x12'));var logger=require(_0x8906('0x13'))(_0x8906('0x14'));var utils=require(_0x8906('0x15'));var config=require(_0x8906('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8906('0x17'))['db'];function respondWithStatusCode(_0x3cff76,_0x377d20){_0x377d20=_0x377d20||0xcc;return function(_0xa7633d){if(_0xa7633d){return _0x3cff76[_0x8906('0x18')](_0x377d20);}return _0x3cff76[_0x8906('0x19')](_0x377d20)[_0x8906('0x1a')]();};}function respondWithResult(_0x23fe28,_0x26c8f3){_0x26c8f3=_0x26c8f3||0xc8;return function(_0x215a02){if(_0x215a02){return _0x23fe28[_0x8906('0x19')](_0x26c8f3)[_0x8906('0x1b')](_0x215a02);}};}function respondWithFilteredResult(_0x149a36,_0x2e2fd6){return function(_0x2390e1){if(_0x2390e1){var _0x242073=typeof _0x2e2fd6['offset']===_0x8906('0x1c')&&typeof _0x2e2fd6[_0x8906('0x1d')]==='undefined';var _0x29b48a=_0x2390e1[_0x8906('0x1e')];var _0x4f4f81=_0x242073?0x0:_0x2e2fd6['offset'];var _0x44401f=_0x242073?_0x2390e1['count']:_0x2e2fd6[_0x8906('0x1f')]+_0x2e2fd6['limit'];var _0x437348;if(_0x44401f>=_0x29b48a){_0x44401f=_0x29b48a;_0x437348=0xc8;}else{_0x437348=0xce;}_0x149a36[_0x8906('0x19')](_0x437348);return _0x149a36[_0x8906('0x20')](_0x8906('0x21'),_0x4f4f81+'-'+_0x44401f+'/'+_0x29b48a)['json'](_0x2390e1);}return null;};}function patchUpdates(_0xdbb385){return function(_0xd754b){try{jsonpatch[_0x8906('0x22')](_0xd754b,_0xdbb385,!![]);}catch(_0x45dd19){return BPromise[_0x8906('0x23')](_0x45dd19);}return _0xd754b[_0x8906('0x24')]();};}function saveUpdates(_0x2e5ee1,_0x5be9c5){return function(_0x5196c2){if(_0x5196c2){return _0x5196c2[_0x8906('0x25')](_0x2e5ee1)['then'](function(_0x318cd4){return _0x318cd4;});}return null;};}function removeEntity(_0xaffa9d,_0x3a0b84){return function(_0x43a0d7){if(_0x43a0d7){return _0x43a0d7['destroy']()[_0x8906('0x26')](function(){_0xaffa9d['status'](0xcc)[_0x8906('0x1a')]();});}};}function handleEntityNotFound(_0x157559,_0x1239e6){return function(_0x2f3d60){if(!_0x2f3d60){_0x157559['sendStatus'](0x194);}return _0x2f3d60;};}function handleError(_0x20ad5e,_0x4b3a54){_0x4b3a54=_0x4b3a54||0x1f4;return function(_0x1dee7a){logger[_0x8906('0x27')](_0x1dee7a[_0x8906('0x28')]);if(_0x1dee7a[_0x8906('0x29')]){delete _0x1dee7a['name'];}_0x20ad5e['status'](_0x4b3a54)[_0x8906('0x2a')](_0x1dee7a);};}exports[_0x8906('0x2b')]=function(_0x46733e,_0xb78f4){var _0x592b5f={},_0x1013d3={},_0x356bba={'count':0x0,'rows':[]};var _0x2618ae=_[_0x8906('0x2c')](db[_0x8906('0x2d')][_0x8906('0x2e')],function(_0x523647){return{'name':_0x523647['fieldName'],'type':_0x523647[_0x8906('0x2f')]['key']};});_0x1013d3['model']=_['map'](_0x2618ae,_0x8906('0x29'));_0x1013d3['query']=_[_0x8906('0x30')](_0x46733e['query']);_0x1013d3[_0x8906('0x31')]=_[_0x8906('0x32')](_0x1013d3[_0x8906('0x33')],_0x1013d3[_0x8906('0x34')]);_0x592b5f['attributes']=_[_0x8906('0x32')](_0x1013d3['model'],qs[_0x8906('0x35')](_0x46733e['query'][_0x8906('0x35')]));_0x592b5f[_0x8906('0x36')]=_0x592b5f['attributes'][_0x8906('0x37')]?_0x592b5f['attributes']:_0x1013d3[_0x8906('0x33')];if(!_0x46733e[_0x8906('0x34')]['hasOwnProperty'](_0x8906('0x38'))){_0x592b5f[_0x8906('0x1d')]=qs[_0x8906('0x1d')](_0x46733e[_0x8906('0x34')][_0x8906('0x1d')]);_0x592b5f[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x46733e['query']['offset']);}_0x592b5f[_0x8906('0x39')]=qs['sort'](_0x46733e[_0x8906('0x34')]['sort']);_0x592b5f[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x46733e[_0x8906('0x34')],_0x1013d3[_0x8906('0x31')]),_0x2618ae);if(_0x46733e[_0x8906('0x34')][_0x8906('0x3c')]){_0x592b5f['where']=_['merge'](_0x592b5f[_0x8906('0x3a')],{'$or':_[_0x8906('0x2c')](_0x2618ae,function(_0x46b031){if(_0x46b031[_0x8906('0x2f')]!=='VIRTUAL'){var _0x50e482={};_0x50e482[_0x46b031['name']]={'$like':'%'+_0x46733e[_0x8906('0x34')][_0x8906('0x3c')]+'%'};return _0x50e482;}})});}_0x592b5f=_[_0x8906('0x3d')]({},_0x592b5f,_0x46733e[_0x8906('0x3e')]);var _0x56ea8a={'where':_0x592b5f[_0x8906('0x3a')]};return db[_0x8906('0x2d')]['count'](_0x56ea8a)[_0x8906('0x26')](function(_0x47d7cf){_0x356bba[_0x8906('0x1e')]=_0x47d7cf;if(_0x46733e[_0x8906('0x34')]['includeAll']){_0x592b5f[_0x8906('0x3f')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x8906('0x40')](_0x592b5f);})[_0x8906('0x26')](function(_0x5b78c5){_0x356bba[_0x8906('0x41')]=_0x5b78c5;return _0x356bba;})['then'](respondWithFilteredResult(_0xb78f4,_0x592b5f))[_0x8906('0x42')](handleError(_0xb78f4,null));};exports[_0x8906('0x43')]=function(_0x2ec6b5,_0xab063e){var _0x8ee29b={'raw':![],'where':{'id':_0x2ec6b5['params']['id']}},_0x3d72d2={};_0x3d72d2[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x2d')]['rawAttributes']);_0x3d72d2[_0x8906('0x34')]=_[_0x8906('0x30')](_0x2ec6b5[_0x8906('0x34')]);_0x3d72d2[_0x8906('0x31')]=_[_0x8906('0x32')](_0x3d72d2[_0x8906('0x33')],_0x3d72d2[_0x8906('0x34')]);_0x8ee29b[_0x8906('0x36')]=_[_0x8906('0x32')](_0x3d72d2['model'],qs['fields'](_0x2ec6b5[_0x8906('0x34')]['fields']));_0x8ee29b[_0x8906('0x36')]=_0x8ee29b['attributes'][_0x8906('0x37')]?_0x8ee29b[_0x8906('0x36')]:_0x3d72d2[_0x8906('0x33')];if(_0x2ec6b5[_0x8906('0x34')][_0x8906('0x44')]){_0x8ee29b[_0x8906('0x3f')]=[{'all':!![]}];}_0x8ee29b=_[_0x8906('0x3d')]({},_0x8ee29b,_0x2ec6b5[_0x8906('0x3e')]);return db[_0x8906('0x2d')][_0x8906('0x45')](_0x8ee29b)['then'](handleEntityNotFound(_0xab063e,null))[_0x8906('0x26')](respondWithResult(_0xab063e,null))[_0x8906('0x42')](handleError(_0xab063e,null));};exports[_0x8906('0x46')]=function(_0x2de5ca,_0xfa8393){return db[_0x8906('0x2d')][_0x8906('0x46')](_0x2de5ca[_0x8906('0x47')],{})[_0x8906('0x26')](respondWithResult(_0xfa8393,0xc9))[_0x8906('0x42')](handleError(_0xfa8393,null));};exports[_0x8906('0x25')]=function(_0x4e3df6,_0x20b6cd){if(_0x4e3df6['body']['id']){delete _0x4e3df6[_0x8906('0x47')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x4e3df6['params']['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x20b6cd,null))[_0x8906('0x26')](saveUpdates(_0x4e3df6[_0x8906('0x47')],null))['then'](respondWithResult(_0x20b6cd,null))[_0x8906('0x42')](handleError(_0x20b6cd,null));};exports[_0x8906('0x48')]=function(_0x5d09bf,_0x447474){return db[_0x8906('0x2d')][_0x8906('0x45')]({'where':{'id':_0x5d09bf[_0x8906('0x49')]['id']}})['then'](handleEntityNotFound(_0x447474,null))[_0x8906('0x26')](removeEntity(_0x447474,null))[_0x8906('0x42')](handleError(_0x447474,null));};exports[_0x8906('0x4a')]=function(_0x4ee10b,_0x2e0b4,_0x2319ab){var _0x59a3d4={};var _0x510471={};var _0x5de2c2;var _0x35521c;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x4ee10b[_0x8906('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e0b4,null))['then'](function(_0x265c92){if(_0x265c92){_0x5de2c2=_0x265c92;_0x510471[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x4c')][_0x8906('0x2e')]);_0x510471[_0x8906('0x34')]=_[_0x8906('0x30')](_0x4ee10b[_0x8906('0x34')]);_0x510471[_0x8906('0x31')]=_[_0x8906('0x32')](_0x510471['model'],_0x510471['query']);_0x59a3d4[_0x8906('0x36')]=_[_0x8906('0x32')](_0x510471['model'],qs['fields'](_0x4ee10b[_0x8906('0x34')][_0x8906('0x35')]));_0x59a3d4[_0x8906('0x36')]=_0x59a3d4['attributes'][_0x8906('0x37')]?_0x59a3d4[_0x8906('0x36')]:_0x510471[_0x8906('0x33')];_0x59a3d4['order']=qs[_0x8906('0x4d')](_0x4ee10b['query'][_0x8906('0x4d')]);_0x59a3d4[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x4ee10b['query'],_0x510471[_0x8906('0x31')]));if(_0x4ee10b[_0x8906('0x34')][_0x8906('0x3c')]){_0x59a3d4['where']=_[_0x8906('0x3d')](_0x59a3d4[_0x8906('0x3a')],{'$or':_['map'](_0x59a3d4[_0x8906('0x36')],function(_0x56d0b9){var _0x372f0a={};_0x372f0a[_0x56d0b9]={'$like':'%'+_0x4ee10b['query']['filter']+'%'};return _0x372f0a;})});}_0x59a3d4=_[_0x8906('0x3d')]({},_0x59a3d4,_0x4ee10b[_0x8906('0x3e')]);return _0x5de2c2[_0x8906('0x4a')](_0x59a3d4);}})['then'](function(_0x23cf16){if(_0x23cf16){_0x35521c=_0x23cf16[_0x8906('0x37')];if(!_0x4ee10b[_0x8906('0x34')][_0x8906('0x4e')](_0x8906('0x38'))){_0x59a3d4[_0x8906('0x1d')]=qs[_0x8906('0x1d')](_0x4ee10b[_0x8906('0x34')][_0x8906('0x1d')]);_0x59a3d4['offset']=qs['offset'](_0x4ee10b[_0x8906('0x34')][_0x8906('0x1f')]);}return _0x5de2c2[_0x8906('0x4a')](_0x59a3d4);}})[_0x8906('0x26')](function(_0x3f7db7){if(_0x3f7db7){return _0x3f7db7?{'count':_0x35521c,'rows':_0x3f7db7}:null;}})[_0x8906('0x26')](respondWithResult(_0x2e0b4,null))[_0x8906('0x42')](handleError(_0x2e0b4,null));};exports['getSubjects']=function(_0x2e9937,_0x368d13,_0x56f9ea){var _0x4c406f={};var _0x45f6c1={};var _0x17c3e3;var _0x91d0dc;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x2e9937[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x368d13,null))[_0x8906('0x26')](function(_0x3812d1){if(_0x3812d1){_0x17c3e3=_0x3812d1;_0x45f6c1['model']=_[_0x8906('0x30')](db[_0x8906('0x4c')][_0x8906('0x2e')]);_0x45f6c1[_0x8906('0x34')]=_[_0x8906('0x30')](_0x2e9937['query']);_0x45f6c1[_0x8906('0x31')]=_[_0x8906('0x32')](_0x45f6c1[_0x8906('0x33')],_0x45f6c1[_0x8906('0x34')]);_0x4c406f[_0x8906('0x36')]=_[_0x8906('0x32')](_0x45f6c1[_0x8906('0x33')],qs['fields'](_0x2e9937[_0x8906('0x34')][_0x8906('0x35')]));_0x4c406f[_0x8906('0x36')]=_0x4c406f[_0x8906('0x36')][_0x8906('0x37')]?_0x4c406f[_0x8906('0x36')]:_0x45f6c1[_0x8906('0x33')];_0x4c406f['order']=qs[_0x8906('0x4d')](_0x2e9937['query'][_0x8906('0x4d')]);_0x4c406f['where']=qs['filters'](_[_0x8906('0x3b')](_0x2e9937[_0x8906('0x34')],_0x45f6c1[_0x8906('0x31')]));if(_0x2e9937[_0x8906('0x34')]['filter']){_0x4c406f[_0x8906('0x3a')]=_['merge'](_0x4c406f[_0x8906('0x3a')],{'$or':_['map'](_0x4c406f['attributes'],function(_0x9a5a2a){var _0x172ddb={};_0x172ddb[_0x9a5a2a]={'$like':'%'+_0x2e9937['query'][_0x8906('0x3c')]+'%'};return _0x172ddb;})});}_0x4c406f=_[_0x8906('0x3d')]({},_0x4c406f,_0x2e9937[_0x8906('0x3e')]);return _0x17c3e3['getSubjects'](_0x4c406f);}})[_0x8906('0x26')](function(_0x39fc7a){if(_0x39fc7a){_0x91d0dc=_0x39fc7a[_0x8906('0x37')];if(!_0x2e9937['query']['hasOwnProperty'](_0x8906('0x38'))){_0x4c406f[_0x8906('0x1d')]=qs[_0x8906('0x1d')](_0x2e9937[_0x8906('0x34')][_0x8906('0x1d')]);_0x4c406f[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x2e9937[_0x8906('0x34')][_0x8906('0x1f')]);}return _0x17c3e3['getSubjects'](_0x4c406f);}})[_0x8906('0x26')](function(_0x7305d0){if(_0x7305d0){return _0x7305d0?{'count':_0x91d0dc,'rows':_0x7305d0}:null;}})[_0x8906('0x26')](respondWithResult(_0x368d13,null))[_0x8906('0x42')](handleError(_0x368d13,null));};exports[_0x8906('0x4f')]=function(_0x4f87f2,_0x4571e5,_0x2fb342){var _0x38a519={};var _0x36b6b1={};var _0x5f1c5c;var _0x10a6e4;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x4f87f2[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x4571e5,null))[_0x8906('0x26')](function(_0x41740a){if(_0x41740a){_0x5f1c5c=_0x41740a;_0x36b6b1[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x4c')]['rawAttributes']);_0x36b6b1['query']=_[_0x8906('0x30')](_0x4f87f2[_0x8906('0x34')]);_0x36b6b1[_0x8906('0x31')]=_[_0x8906('0x32')](_0x36b6b1[_0x8906('0x33')],_0x36b6b1[_0x8906('0x34')]);_0x38a519['attributes']=_[_0x8906('0x32')](_0x36b6b1[_0x8906('0x33')],qs[_0x8906('0x35')](_0x4f87f2[_0x8906('0x34')][_0x8906('0x35')]));_0x38a519[_0x8906('0x36')]=_0x38a519['attributes']['length']?_0x38a519['attributes']:_0x36b6b1['model'];_0x38a519[_0x8906('0x39')]=qs[_0x8906('0x4d')](_0x4f87f2[_0x8906('0x34')][_0x8906('0x4d')]);_0x38a519[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x4f87f2[_0x8906('0x34')],_0x36b6b1[_0x8906('0x31')]));if(_0x4f87f2[_0x8906('0x34')]['filter']){_0x38a519[_0x8906('0x3a')]=_['merge'](_0x38a519[_0x8906('0x3a')],{'$or':_['map'](_0x38a519[_0x8906('0x36')],function(_0x1c7280){var _0x5f0df8={};_0x5f0df8[_0x1c7280]={'$like':'%'+_0x4f87f2[_0x8906('0x34')][_0x8906('0x3c')]+'%'};return _0x5f0df8;})});}_0x38a519=_['merge']({},_0x38a519,_0x4f87f2[_0x8906('0x3e')]);return _0x5f1c5c[_0x8906('0x4f')](_0x38a519);}})['then'](function(_0x5a52df){if(_0x5a52df){_0x10a6e4=_0x5a52df['length'];if(!_0x4f87f2[_0x8906('0x34')][_0x8906('0x4e')]('nolimit')){_0x38a519[_0x8906('0x1d')]=qs['limit'](_0x4f87f2[_0x8906('0x34')][_0x8906('0x1d')]);_0x38a519[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x4f87f2[_0x8906('0x34')]['offset']);}return _0x5f1c5c['getDescriptions'](_0x38a519);}})['then'](function(_0x58eae2){if(_0x58eae2){return _0x58eae2?{'count':_0x10a6e4,'rows':_0x58eae2}:null;}})[_0x8906('0x26')](respondWithResult(_0x4571e5,null))[_0x8906('0x42')](handleError(_0x4571e5,null));};exports[_0x8906('0x50')]=function(_0x50a129,_0x1794da,_0x25c03a){var _0x593e37={};var _0x2cb530={};var _0x874086;var _0xa04664;return db['FreshdeskConfiguration'][_0x8906('0x4b')]({'where':{'id':_0x50a129[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x1794da,null))[_0x8906('0x26')](function(_0x41aa28){if(_0x41aa28){_0x874086=_0x41aa28;_0x2cb530[_0x8906('0x33')]=_[_0x8906('0x30')](db[_0x8906('0x51')][_0x8906('0x2e')]);_0x2cb530[_0x8906('0x34')]=_['keys'](_0x50a129[_0x8906('0x34')]);_0x2cb530[_0x8906('0x31')]=_['intersection'](_0x2cb530['model'],_0x2cb530[_0x8906('0x34')]);_0x593e37[_0x8906('0x36')]=_['intersection'](_0x2cb530[_0x8906('0x33')],qs[_0x8906('0x35')](_0x50a129[_0x8906('0x34')]['fields']));_0x593e37['attributes']=_0x593e37[_0x8906('0x36')]['length']?_0x593e37[_0x8906('0x36')]:_0x2cb530[_0x8906('0x33')];_0x593e37['order']=qs[_0x8906('0x4d')](_0x50a129['query']['sort']);_0x593e37[_0x8906('0x3a')]=qs[_0x8906('0x31')](_[_0x8906('0x3b')](_0x50a129['query'],_0x2cb530[_0x8906('0x31')]));if(_0x50a129[_0x8906('0x34')][_0x8906('0x3c')]){_0x593e37[_0x8906('0x3a')]=_[_0x8906('0x3d')](_0x593e37[_0x8906('0x3a')],{'$or':_[_0x8906('0x2c')](_0x593e37['attributes'],function(_0x1c7f23){var _0x1f67a3={};_0x1f67a3[_0x1c7f23]={'$like':'%'+_0x50a129[_0x8906('0x34')][_0x8906('0x3c')]+'%'};return _0x1f67a3;})});}_0x593e37=_['merge']({},_0x593e37,_0x50a129[_0x8906('0x3e')]);return _0x874086[_0x8906('0x50')](_0x593e37);}})[_0x8906('0x26')](function(_0x3a67c5){if(_0x3a67c5){_0xa04664=_0x3a67c5[_0x8906('0x37')];if(!_0x50a129[_0x8906('0x34')][_0x8906('0x4e')](_0x8906('0x38'))){_0x593e37['limit']=qs[_0x8906('0x1d')](_0x50a129['query']['limit']);_0x593e37[_0x8906('0x1f')]=qs[_0x8906('0x1f')](_0x50a129[_0x8906('0x34')][_0x8906('0x1f')]);}return _0x874086[_0x8906('0x50')](_0x593e37);}})['then'](function(_0x42fd3a){if(_0x42fd3a){return _0x42fd3a?{'count':_0xa04664,'rows':_0x42fd3a}:null;}})[_0x8906('0x26')](respondWithResult(_0x1794da,null))[_0x8906('0x42')](handleError(_0x1794da,null));};exports['setTags']=function(_0x3a70d1,_0x19fd51,_0xa1c20){if(_0x3a70d1[_0x8906('0x47')]['id']){delete _0x3a70d1[_0x8906('0x47')]['id'];}return db[_0x8906('0x2d')][_0x8906('0x4b')]({'where':{'id':_0x3a70d1[_0x8906('0x49')]['id']}})[_0x8906('0x26')](handleEntityNotFound(_0x19fd51,null))[_0x8906('0x26')](function(_0x94cdec){if(_0x94cdec){return _0x94cdec[_0x8906('0x52')](_0x3a70d1[_0x8906('0x47')][_0x8906('0x53')]||[]);}return null;})['then'](respondWithResult(_0x19fd51,null))[_0x8906('0x42')](handleError(_0x19fd51,null));}; \ No newline at end of file +var _0xe9b3=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','name','fieldName','type','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','FreshdeskConfiguration','then','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','FreshdeskField','sort','pick','options','getFields','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x4372d3,_0x14cc0e){var _0x355dc0=function(_0x10e7b2){while(--_0x10e7b2){_0x4372d3['push'](_0x4372d3['shift']());}};_0x355dc0(++_0x14cc0e);}(_0xe9b3,0x89));var _0x3e9b=function(_0x1bc89d,_0x449f53){_0x1bc89d=_0x1bc89d-0x0;var _0x13c6ec=_0xe9b3[_0x1bc89d];return _0x13c6ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e9b('0x0'));var zipdir=require(_0x3e9b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e9b('0x2'));var moment=require(_0x3e9b('0x3'));var BPromise=require(_0x3e9b('0x4'));var Mustache=require(_0x3e9b('0x5'));var util=require('util');var path=require(_0x3e9b('0x6'));var sox=require('sox');var csv=require(_0x3e9b('0x7'));var ejs=require(_0x3e9b('0x8'));var fs=require('fs');var fs_extra=require(_0x3e9b('0x9'));var _=require(_0x3e9b('0xa'));var squel=require(_0x3e9b('0xb'));var crypto=require('crypto');var jsforce=require(_0x3e9b('0xc'));var deskjs=require(_0x3e9b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3e9b('0xe'));var Redis=require(_0x3e9b('0xf'));var authService=require(_0x3e9b('0x10'));var qs=require(_0x3e9b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e9b('0x12'));var logger=require(_0x3e9b('0x13'))('api');var utils=require(_0x3e9b('0x14'));var config=require(_0x3e9b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e9b('0x16'))['db'];function respondWithStatusCode(_0x25d062,_0x20fc60){_0x20fc60=_0x20fc60||0xcc;return function(_0x581c73){if(_0x581c73){return _0x25d062[_0x3e9b('0x17')](_0x20fc60);}return _0x25d062[_0x3e9b('0x18')](_0x20fc60)[_0x3e9b('0x19')]();};}function respondWithResult(_0x4cc56e,_0x272db5){_0x272db5=_0x272db5||0xc8;return function(_0x1e6cc4){if(_0x1e6cc4){return _0x4cc56e[_0x3e9b('0x18')](_0x272db5)[_0x3e9b('0x1a')](_0x1e6cc4);}};}function respondWithFilteredResult(_0x32ff49,_0x14ef58){return function(_0x4e5869){if(_0x4e5869){var _0x3b2bed=typeof _0x14ef58[_0x3e9b('0x1b')]===_0x3e9b('0x1c')&&typeof _0x14ef58[_0x3e9b('0x1d')]==='undefined';var _0x5d6183=_0x4e5869['count'];var _0x281167=_0x3b2bed?0x0:_0x14ef58['offset'];var _0x44f7ad=_0x3b2bed?_0x4e5869[_0x3e9b('0x1e')]:_0x14ef58[_0x3e9b('0x1b')]+_0x14ef58[_0x3e9b('0x1d')];var _0x38d130;if(_0x44f7ad>=_0x5d6183){_0x44f7ad=_0x5d6183;_0x38d130=0xc8;}else{_0x38d130=0xce;}_0x32ff49['status'](_0x38d130);return _0x32ff49[_0x3e9b('0x1f')](_0x3e9b('0x20'),_0x281167+'-'+_0x44f7ad+'/'+_0x5d6183)[_0x3e9b('0x1a')](_0x4e5869);}return null;};}function patchUpdates(_0x1f1f3f){return function(_0x179d91){try{jsonpatch[_0x3e9b('0x21')](_0x179d91,_0x1f1f3f,!![]);}catch(_0x56be67){return BPromise[_0x3e9b('0x22')](_0x56be67);}return _0x179d91[_0x3e9b('0x23')]();};}function saveUpdates(_0x439635,_0x47bf97){return function(_0x5b1461){if(_0x5b1461){return _0x5b1461['update'](_0x439635)['then'](function(_0x26ebd0){return _0x26ebd0;});}return null;};}function removeEntity(_0x4c09f6,_0x11f3c0){return function(_0x18accd){if(_0x18accd){return _0x18accd[_0x3e9b('0x24')]()['then'](function(){_0x4c09f6[_0x3e9b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f217e,_0x2b1f4f){return function(_0x5e06a0){if(!_0x5e06a0){_0x5f217e[_0x3e9b('0x17')](0x194);}return _0x5e06a0;};}function handleError(_0x5978f9,_0x36929d){_0x36929d=_0x36929d||0x1f4;return function(_0x260d1e){logger[_0x3e9b('0x25')](_0x260d1e['stack']);if(_0x260d1e[_0x3e9b('0x26')]){delete _0x260d1e[_0x3e9b('0x26')];}_0x5978f9[_0x3e9b('0x18')](_0x36929d)['send'](_0x260d1e);};}exports['index']=function(_0x58001b,_0x2ec0ce){var _0x59664b={},_0x3a9af0={},_0xaec26b={'count':0x0,'rows':[]};var _0x5c1c4b=_['map'](db['FreshdeskConfiguration']['rawAttributes'],function(_0x3e2a61){return{'name':_0x3e2a61[_0x3e9b('0x27')],'type':_0x3e2a61[_0x3e9b('0x28')]['key']};});_0x3a9af0[_0x3e9b('0x29')]=_[_0x3e9b('0x2a')](_0x5c1c4b,_0x3e9b('0x26'));_0x3a9af0['query']=_[_0x3e9b('0x2b')](_0x58001b['query']);_0x3a9af0['filters']=_[_0x3e9b('0x2c')](_0x3a9af0['model'],_0x3a9af0[_0x3e9b('0x2d')]);_0x59664b[_0x3e9b('0x2e')]=_['intersection'](_0x3a9af0[_0x3e9b('0x29')],qs[_0x3e9b('0x2f')](_0x58001b[_0x3e9b('0x2d')][_0x3e9b('0x2f')]));_0x59664b[_0x3e9b('0x2e')]=_0x59664b[_0x3e9b('0x2e')][_0x3e9b('0x30')]?_0x59664b[_0x3e9b('0x2e')]:_0x3a9af0[_0x3e9b('0x29')];if(!_0x58001b[_0x3e9b('0x2d')][_0x3e9b('0x31')](_0x3e9b('0x32'))){_0x59664b[_0x3e9b('0x1d')]=qs['limit'](_0x58001b[_0x3e9b('0x2d')][_0x3e9b('0x1d')]);_0x59664b[_0x3e9b('0x1b')]=qs[_0x3e9b('0x1b')](_0x58001b[_0x3e9b('0x2d')]['offset']);}_0x59664b[_0x3e9b('0x33')]=qs['sort'](_0x58001b[_0x3e9b('0x2d')]['sort']);_0x59664b[_0x3e9b('0x34')]=qs[_0x3e9b('0x35')](_['pick'](_0x58001b[_0x3e9b('0x2d')],_0x3a9af0[_0x3e9b('0x35')]),_0x5c1c4b);if(_0x58001b[_0x3e9b('0x2d')][_0x3e9b('0x36')]){_0x59664b['where']=_[_0x3e9b('0x37')](_0x59664b['where'],{'$or':_[_0x3e9b('0x2a')](_0x5c1c4b,function(_0x1cfa53){if(_0x1cfa53[_0x3e9b('0x28')]!==_0x3e9b('0x38')){var _0x583d67={};_0x583d67[_0x1cfa53[_0x3e9b('0x26')]]={'$like':'%'+_0x58001b[_0x3e9b('0x2d')][_0x3e9b('0x36')]+'%'};return _0x583d67;}})});}_0x59664b=_[_0x3e9b('0x37')]({},_0x59664b,_0x58001b['options']);var _0x429457={'where':_0x59664b[_0x3e9b('0x34')]};return db[_0x3e9b('0x39')][_0x3e9b('0x1e')](_0x429457)[_0x3e9b('0x3a')](function(_0x477a65){_0xaec26b[_0x3e9b('0x1e')]=_0x477a65;if(_0x58001b['query'][_0x3e9b('0x3b')]){_0x59664b[_0x3e9b('0x3c')]=[{'all':!![]}];}return db[_0x3e9b('0x39')]['findAll'](_0x59664b);})[_0x3e9b('0x3a')](function(_0x51e81d){_0xaec26b[_0x3e9b('0x3d')]=_0x51e81d;return _0xaec26b;})['then'](respondWithFilteredResult(_0x2ec0ce,_0x59664b))[_0x3e9b('0x3e')](handleError(_0x2ec0ce,null));};exports[_0x3e9b('0x3f')]=function(_0x385095,_0x3422c5){var _0x1ded85={'raw':![],'where':{'id':_0x385095[_0x3e9b('0x40')]['id']}},_0x477907={};_0x477907[_0x3e9b('0x29')]=_['keys'](db[_0x3e9b('0x39')][_0x3e9b('0x41')]);_0x477907[_0x3e9b('0x2d')]=_[_0x3e9b('0x2b')](_0x385095[_0x3e9b('0x2d')]);_0x477907['filters']=_['intersection'](_0x477907[_0x3e9b('0x29')],_0x477907[_0x3e9b('0x2d')]);_0x1ded85[_0x3e9b('0x2e')]=_[_0x3e9b('0x2c')](_0x477907['model'],qs[_0x3e9b('0x2f')](_0x385095[_0x3e9b('0x2d')][_0x3e9b('0x2f')]));_0x1ded85[_0x3e9b('0x2e')]=_0x1ded85[_0x3e9b('0x2e')]['length']?_0x1ded85[_0x3e9b('0x2e')]:_0x477907[_0x3e9b('0x29')];if(_0x385095[_0x3e9b('0x2d')][_0x3e9b('0x3b')]){_0x1ded85[_0x3e9b('0x3c')]=[{'all':!![]}];}_0x1ded85=_[_0x3e9b('0x37')]({},_0x1ded85,_0x385095['options']);return db[_0x3e9b('0x39')][_0x3e9b('0x42')](_0x1ded85)['then'](handleEntityNotFound(_0x3422c5,null))[_0x3e9b('0x3a')](respondWithResult(_0x3422c5,null))['catch'](handleError(_0x3422c5,null));};exports[_0x3e9b('0x43')]=function(_0x387758,_0x3fe680){return db[_0x3e9b('0x39')][_0x3e9b('0x43')](_0x387758[_0x3e9b('0x44')],{})[_0x3e9b('0x3a')](respondWithResult(_0x3fe680,0xc9))['catch'](handleError(_0x3fe680,null));};exports[_0x3e9b('0x45')]=function(_0x5c9f36,_0x21c6df){if(_0x5c9f36['body']['id']){delete _0x5c9f36[_0x3e9b('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x3e9b('0x42')]({'where':{'id':_0x5c9f36[_0x3e9b('0x40')]['id']}})[_0x3e9b('0x3a')](handleEntityNotFound(_0x21c6df,null))['then'](saveUpdates(_0x5c9f36[_0x3e9b('0x44')],null))['then'](respondWithResult(_0x21c6df,null))[_0x3e9b('0x3e')](handleError(_0x21c6df,null));};exports[_0x3e9b('0x24')]=function(_0x26da86,_0x162a4e){return db[_0x3e9b('0x39')][_0x3e9b('0x42')]({'where':{'id':_0x26da86[_0x3e9b('0x40')]['id']}})[_0x3e9b('0x3a')](handleEntityNotFound(_0x162a4e,null))['then'](removeEntity(_0x162a4e,null))[_0x3e9b('0x3e')](handleError(_0x162a4e,null));};exports['getFields']=function(_0x4631e4,_0x535c1b,_0x4d8e1b){var _0x35c464={};var _0x4bc8cf={};var _0x4ec18d;var _0x5b529f;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4631e4[_0x3e9b('0x40')]['id']}})['then'](handleEntityNotFound(_0x535c1b,null))[_0x3e9b('0x3a')](function(_0x3fab7f){if(_0x3fab7f){_0x4ec18d=_0x3fab7f;_0x4bc8cf[_0x3e9b('0x29')]=_['keys'](db[_0x3e9b('0x46')][_0x3e9b('0x41')]);_0x4bc8cf[_0x3e9b('0x2d')]=_['keys'](_0x4631e4[_0x3e9b('0x2d')]);_0x4bc8cf[_0x3e9b('0x35')]=_[_0x3e9b('0x2c')](_0x4bc8cf[_0x3e9b('0x29')],_0x4bc8cf[_0x3e9b('0x2d')]);_0x35c464['attributes']=_['intersection'](_0x4bc8cf['model'],qs[_0x3e9b('0x2f')](_0x4631e4['query'][_0x3e9b('0x2f')]));_0x35c464[_0x3e9b('0x2e')]=_0x35c464['attributes'][_0x3e9b('0x30')]?_0x35c464['attributes']:_0x4bc8cf['model'];_0x35c464[_0x3e9b('0x33')]=qs[_0x3e9b('0x47')](_0x4631e4[_0x3e9b('0x2d')]['sort']);_0x35c464[_0x3e9b('0x34')]=qs[_0x3e9b('0x35')](_[_0x3e9b('0x48')](_0x4631e4[_0x3e9b('0x2d')],_0x4bc8cf['filters']));if(_0x4631e4[_0x3e9b('0x2d')]['filter']){_0x35c464[_0x3e9b('0x34')]=_[_0x3e9b('0x37')](_0x35c464[_0x3e9b('0x34')],{'$or':_[_0x3e9b('0x2a')](_0x35c464[_0x3e9b('0x2e')],function(_0x386fe0){var _0xb3300={};_0xb3300[_0x386fe0]={'$like':'%'+_0x4631e4[_0x3e9b('0x2d')][_0x3e9b('0x36')]+'%'};return _0xb3300;})});}_0x35c464=_['merge']({},_0x35c464,_0x4631e4[_0x3e9b('0x49')]);return _0x4ec18d['getFields'](_0x35c464);}})[_0x3e9b('0x3a')](function(_0x1db565){if(_0x1db565){_0x5b529f=_0x1db565[_0x3e9b('0x30')];if(!_0x4631e4[_0x3e9b('0x2d')][_0x3e9b('0x31')]('nolimit')){_0x35c464[_0x3e9b('0x1d')]=qs['limit'](_0x4631e4[_0x3e9b('0x2d')]['limit']);_0x35c464['offset']=qs[_0x3e9b('0x1b')](_0x4631e4[_0x3e9b('0x2d')][_0x3e9b('0x1b')]);}return _0x4ec18d[_0x3e9b('0x4a')](_0x35c464);}})[_0x3e9b('0x3a')](function(_0x5eaa01){if(_0x5eaa01){return _0x5eaa01?{'count':_0x5b529f,'rows':_0x5eaa01}:null;}})['then'](respondWithResult(_0x535c1b,null))[_0x3e9b('0x3e')](handleError(_0x535c1b,null));};exports[_0x3e9b('0x4b')]=function(_0x339ead,_0x368f27,_0x50e362){var _0x5df74c={};var _0x4498d2={};var _0x1bdc43;var _0x58476b;return db[_0x3e9b('0x39')]['findOne']({'where':{'id':_0x339ead['params']['id']}})[_0x3e9b('0x3a')](handleEntityNotFound(_0x368f27,null))[_0x3e9b('0x3a')](function(_0x56737b){if(_0x56737b){_0x1bdc43=_0x56737b;_0x4498d2['model']=_[_0x3e9b('0x2b')](db[_0x3e9b('0x46')][_0x3e9b('0x41')]);_0x4498d2[_0x3e9b('0x2d')]=_[_0x3e9b('0x2b')](_0x339ead['query']);_0x4498d2[_0x3e9b('0x35')]=_[_0x3e9b('0x2c')](_0x4498d2[_0x3e9b('0x29')],_0x4498d2[_0x3e9b('0x2d')]);_0x5df74c['attributes']=_[_0x3e9b('0x2c')](_0x4498d2['model'],qs['fields'](_0x339ead[_0x3e9b('0x2d')][_0x3e9b('0x2f')]));_0x5df74c[_0x3e9b('0x2e')]=_0x5df74c[_0x3e9b('0x2e')]['length']?_0x5df74c[_0x3e9b('0x2e')]:_0x4498d2['model'];_0x5df74c[_0x3e9b('0x33')]=qs[_0x3e9b('0x47')](_0x339ead[_0x3e9b('0x2d')][_0x3e9b('0x47')]);_0x5df74c[_0x3e9b('0x34')]=qs[_0x3e9b('0x35')](_['pick'](_0x339ead[_0x3e9b('0x2d')],_0x4498d2[_0x3e9b('0x35')]));if(_0x339ead[_0x3e9b('0x2d')][_0x3e9b('0x36')]){_0x5df74c[_0x3e9b('0x34')]=_[_0x3e9b('0x37')](_0x5df74c[_0x3e9b('0x34')],{'$or':_[_0x3e9b('0x2a')](_0x5df74c[_0x3e9b('0x2e')],function(_0x5975fd){var _0x58fd98={};_0x58fd98[_0x5975fd]={'$like':'%'+_0x339ead[_0x3e9b('0x2d')][_0x3e9b('0x36')]+'%'};return _0x58fd98;})});}_0x5df74c=_[_0x3e9b('0x37')]({},_0x5df74c,_0x339ead['options']);return _0x1bdc43[_0x3e9b('0x4b')](_0x5df74c);}})['then'](function(_0x275afb){if(_0x275afb){_0x58476b=_0x275afb['length'];if(!_0x339ead[_0x3e9b('0x2d')]['hasOwnProperty']('nolimit')){_0x5df74c[_0x3e9b('0x1d')]=qs[_0x3e9b('0x1d')](_0x339ead['query'][_0x3e9b('0x1d')]);_0x5df74c[_0x3e9b('0x1b')]=qs[_0x3e9b('0x1b')](_0x339ead[_0x3e9b('0x2d')][_0x3e9b('0x1b')]);}return _0x1bdc43['getSubjects'](_0x5df74c);}})[_0x3e9b('0x3a')](function(_0x4c0572){if(_0x4c0572){return _0x4c0572?{'count':_0x58476b,'rows':_0x4c0572}:null;}})[_0x3e9b('0x3a')](respondWithResult(_0x368f27,null))[_0x3e9b('0x3e')](handleError(_0x368f27,null));};exports[_0x3e9b('0x4c')]=function(_0x16c4cd,_0x1aecd,_0x13f5f0){var _0x2a9b71={};var _0x1fdb0a={};var _0x16052b;var _0x272059;return db[_0x3e9b('0x39')][_0x3e9b('0x4d')]({'where':{'id':_0x16c4cd[_0x3e9b('0x40')]['id']}})[_0x3e9b('0x3a')](handleEntityNotFound(_0x1aecd,null))[_0x3e9b('0x3a')](function(_0x16105c){if(_0x16105c){_0x16052b=_0x16105c;_0x1fdb0a['model']=_['keys'](db[_0x3e9b('0x46')]['rawAttributes']);_0x1fdb0a[_0x3e9b('0x2d')]=_[_0x3e9b('0x2b')](_0x16c4cd[_0x3e9b('0x2d')]);_0x1fdb0a[_0x3e9b('0x35')]=_[_0x3e9b('0x2c')](_0x1fdb0a['model'],_0x1fdb0a[_0x3e9b('0x2d')]);_0x2a9b71[_0x3e9b('0x2e')]=_[_0x3e9b('0x2c')](_0x1fdb0a[_0x3e9b('0x29')],qs[_0x3e9b('0x2f')](_0x16c4cd['query'][_0x3e9b('0x2f')]));_0x2a9b71[_0x3e9b('0x2e')]=_0x2a9b71[_0x3e9b('0x2e')][_0x3e9b('0x30')]?_0x2a9b71[_0x3e9b('0x2e')]:_0x1fdb0a['model'];_0x2a9b71[_0x3e9b('0x33')]=qs['sort'](_0x16c4cd['query'][_0x3e9b('0x47')]);_0x2a9b71[_0x3e9b('0x34')]=qs[_0x3e9b('0x35')](_[_0x3e9b('0x48')](_0x16c4cd['query'],_0x1fdb0a['filters']));if(_0x16c4cd['query'][_0x3e9b('0x36')]){_0x2a9b71['where']=_[_0x3e9b('0x37')](_0x2a9b71[_0x3e9b('0x34')],{'$or':_[_0x3e9b('0x2a')](_0x2a9b71[_0x3e9b('0x2e')],function(_0x20a871){var _0x1d5ad3={};_0x1d5ad3[_0x20a871]={'$like':'%'+_0x16c4cd[_0x3e9b('0x2d')]['filter']+'%'};return _0x1d5ad3;})});}_0x2a9b71=_[_0x3e9b('0x37')]({},_0x2a9b71,_0x16c4cd[_0x3e9b('0x49')]);return _0x16052b['getDescriptions'](_0x2a9b71);}})[_0x3e9b('0x3a')](function(_0x1f5ad6){if(_0x1f5ad6){_0x272059=_0x1f5ad6[_0x3e9b('0x30')];if(!_0x16c4cd[_0x3e9b('0x2d')][_0x3e9b('0x31')](_0x3e9b('0x32'))){_0x2a9b71[_0x3e9b('0x1d')]=qs['limit'](_0x16c4cd[_0x3e9b('0x2d')]['limit']);_0x2a9b71[_0x3e9b('0x1b')]=qs['offset'](_0x16c4cd[_0x3e9b('0x2d')][_0x3e9b('0x1b')]);}return _0x16052b['getDescriptions'](_0x2a9b71);}})[_0x3e9b('0x3a')](function(_0x4b6479){if(_0x4b6479){return _0x4b6479?{'count':_0x272059,'rows':_0x4b6479}:null;}})['then'](respondWithResult(_0x1aecd,null))[_0x3e9b('0x3e')](handleError(_0x1aecd,null));};exports[_0x3e9b('0x4e')]=function(_0x326e98,_0x59cdff,_0x45a2a0){var _0x433a7c={};var _0x15aa8f={};var _0x20e381;var _0x475f7f;return db[_0x3e9b('0x39')]['findOne']({'where':{'id':_0x326e98[_0x3e9b('0x40')]['id']}})['then'](handleEntityNotFound(_0x59cdff,null))[_0x3e9b('0x3a')](function(_0x4d3895){if(_0x4d3895){_0x20e381=_0x4d3895;_0x15aa8f[_0x3e9b('0x29')]=_[_0x3e9b('0x2b')](db[_0x3e9b('0x4f')]['rawAttributes']);_0x15aa8f[_0x3e9b('0x2d')]=_[_0x3e9b('0x2b')](_0x326e98[_0x3e9b('0x2d')]);_0x15aa8f['filters']=_[_0x3e9b('0x2c')](_0x15aa8f[_0x3e9b('0x29')],_0x15aa8f[_0x3e9b('0x2d')]);_0x433a7c[_0x3e9b('0x2e')]=_[_0x3e9b('0x2c')](_0x15aa8f[_0x3e9b('0x29')],qs[_0x3e9b('0x2f')](_0x326e98['query'][_0x3e9b('0x2f')]));_0x433a7c[_0x3e9b('0x2e')]=_0x433a7c['attributes'][_0x3e9b('0x30')]?_0x433a7c[_0x3e9b('0x2e')]:_0x15aa8f[_0x3e9b('0x29')];_0x433a7c[_0x3e9b('0x33')]=qs[_0x3e9b('0x47')](_0x326e98[_0x3e9b('0x2d')][_0x3e9b('0x47')]);_0x433a7c[_0x3e9b('0x34')]=qs['filters'](_[_0x3e9b('0x48')](_0x326e98[_0x3e9b('0x2d')],_0x15aa8f[_0x3e9b('0x35')]));if(_0x326e98[_0x3e9b('0x2d')]['filter']){_0x433a7c['where']=_['merge'](_0x433a7c[_0x3e9b('0x34')],{'$or':_['map'](_0x433a7c[_0x3e9b('0x2e')],function(_0x3965ad){var _0x3b31a4={};_0x3b31a4[_0x3965ad]={'$like':'%'+_0x326e98[_0x3e9b('0x2d')]['filter']+'%'};return _0x3b31a4;})});}_0x433a7c=_[_0x3e9b('0x37')]({},_0x433a7c,_0x326e98[_0x3e9b('0x49')]);return _0x20e381[_0x3e9b('0x4e')](_0x433a7c);}})['then'](function(_0x5a232e){if(_0x5a232e){_0x475f7f=_0x5a232e[_0x3e9b('0x30')];if(!_0x326e98[_0x3e9b('0x2d')]['hasOwnProperty'](_0x3e9b('0x32'))){_0x433a7c['limit']=qs[_0x3e9b('0x1d')](_0x326e98[_0x3e9b('0x2d')][_0x3e9b('0x1d')]);_0x433a7c[_0x3e9b('0x1b')]=qs[_0x3e9b('0x1b')](_0x326e98[_0x3e9b('0x2d')]['offset']);}return _0x20e381[_0x3e9b('0x4e')](_0x433a7c);}})['then'](function(_0x3c3bd9){if(_0x3c3bd9){return _0x3c3bd9?{'count':_0x475f7f,'rows':_0x3c3bd9}:null;}})[_0x3e9b('0x3a')](respondWithResult(_0x59cdff,null))[_0x3e9b('0x3e')](handleError(_0x59cdff,null));};exports[_0x3e9b('0x50')]=function(_0x50909b,_0x56ff2f,_0x147176){if(_0x50909b[_0x3e9b('0x44')]['id']){delete _0x50909b['body']['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x50909b[_0x3e9b('0x40')]['id']}})['then'](handleEntityNotFound(_0x56ff2f,null))['then'](function(_0x82e969){if(_0x82e969){return _0x82e969['setTags'](_0x50909b[_0x3e9b('0x44')]['ids']||[]);}return null;})[_0x3e9b('0x3a')](respondWithResult(_0x56ff2f,null))[_0x3e9b('0x3e')](handleError(_0x56ff2f,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2bb8caa..520f3e6 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 _0x8cc9=['../../config/environment','define','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2872a6,_0x51417b){var _0x5763a5=function(_0x1add4e){while(--_0x1add4e){_0x2872a6['push'](_0x2872a6['shift']());}};_0x5763a5(++_0x51417b);}(_0x8cc9,0x93));var _0x98cc=function(_0x20a79d,_0x3b7db7){_0x20a79d=_0x20a79d-0x0;var _0x7df9f=_0x8cc9[_0x20a79d];return _0x7df9f;};'use strict';var _=require(_0x98cc('0x0'));var util=require(_0x98cc('0x1'));var logger=require(_0x98cc('0x2'))('api');var moment=require(_0x98cc('0x3'));var BPromise=require(_0x98cc('0x4'));var rp=require(_0x98cc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98cc('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x42b123,_0x410e76){return _0x42b123[_0x98cc('0x7')]('FreshdeskConfiguration',attributes,{'tableName':_0x98cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc59d=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x19eddf,_0x3b50cf){var _0x1c10f6=function(_0x171010){while(--_0x171010){_0x19eddf['push'](_0x19eddf['shift']());}};_0x1c10f6(++_0x3b50cf);}(_0xc59d,0xe6));var _0xdc59=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc59d[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0xdc59('0x0'));var logger=require(_0xdc59('0x1'))(_0xdc59('0x2'));var moment=require(_0xdc59('0x3'));var BPromise=require(_0xdc59('0x4'));var rp=require(_0xdc59('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc59('0x6'));var config=require(_0xdc59('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xdc59('0x8')]=function(_0x3dbafa,_0xace16a){return _0x3dbafa[_0xdc59('0x9')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','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 2ab2286..3bc456f 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 _0x8832=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring'];(function(_0x21f959,_0x42fdbc){var _0x210421=function(_0x58bc9d){while(--_0x58bc9d){_0x21f959['push'](_0x21f959['shift']());}};_0x210421(++_0x42fdbc);}(_0x8832,0xed));var _0x2883=function(_0xfa05d7,_0x33c1f2){_0xfa05d7=_0xfa05d7-0x0;var _0x25560d=_0x8832[_0xfa05d7];return _0x25560d;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rs=require(_0x2883('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2883('0x5'))['db'];var utils=require(_0x2883('0x6'));var logger=require('../../config/logger')(_0x2883('0x7'));var config=require(_0x2883('0x8'));var jayson=require(_0x2883('0x9'));var client=jayson['client'][_0x2883('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348fd6,_0x3784f6,_0x3e9677){return new BPromise(function(_0x55246b,_0x2f4c4f){return client[_0x2883('0xb')](_0x348fd6,_0x3e9677)[_0x2883('0xc')](function(_0x2084ca){logger[_0x2883('0xd')](_0x2883('0xe'),_0x3784f6,'request\x20sent');logger[_0x2883('0xf')](_0x2883('0x10'),_0x3784f6,_0x2883('0x11'),JSON[_0x2883('0x12')](_0x2084ca));if(_0x2084ca[_0x2883('0x13')]){if(_0x2084ca[_0x2883('0x13')][_0x2883('0x14')]===0x1f4){logger[_0x2883('0x13')](_0x2883('0xe'),_0x3784f6,_0x2084ca[_0x2883('0x13')][_0x2883('0x15')]);return _0x2f4c4f(_0x2084ca['error'][_0x2883('0x15')]);}logger[_0x2883('0x13')](_0x2883('0xe'),_0x3784f6,_0x2084ca[_0x2883('0x13')][_0x2883('0x15')]);return _0x55246b(_0x2084ca['error'][_0x2883('0x15')]);}else{logger['info'](_0x2883('0xe'),_0x3784f6,_0x2883('0x11'));_0x55246b(_0x2084ca['result'][_0x2883('0x15')]);}})['catch'](function(_0x31ffb2){logger[_0x2883('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3784f6,_0x31ffb2);_0x2f4c4f(_0x31ffb2);});});} \ No newline at end of file +var _0xf5fb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0xfcc655,_0xb0c31){var _0x1c7b22=function(_0x24a324){while(--_0x24a324){_0xfcc655['push'](_0xfcc655['shift']());}};_0x1c7b22(++_0xb0c31);}(_0xf5fb,0x11d));var _0xbf5f=function(_0x2a35be,_0xf6e375){_0x2a35be=_0x2a35be-0x0;var _0x4ebc40=_0xf5fb[_0x2a35be];return _0x4ebc40;};'use strict';var _=require(_0xbf5f('0x0'));var util=require(_0xbf5f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbf5f('0x2'));var fs=require('fs');var Redis=require(_0xbf5f('0x3'));var db=require(_0xbf5f('0x4'))['db'];var utils=require(_0xbf5f('0x5'));var logger=require(_0xbf5f('0x6'))('rpc');var config=require(_0xbf5f('0x7'));var jayson=require(_0xbf5f('0x8'));var client=jayson[_0xbf5f('0x9')][_0xbf5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3beaf3,_0x28d3d0,_0x402733){return new BPromise(function(_0x2a6539,_0x1336f1){return client[_0xbf5f('0xb')](_0x3beaf3,_0x402733)[_0xbf5f('0xc')](function(_0x5c68b4){logger[_0xbf5f('0xd')](_0xbf5f('0xe'),_0x28d3d0,_0xbf5f('0xf'));logger[_0xbf5f('0x10')](_0xbf5f('0x11'),_0x28d3d0,_0xbf5f('0xf'),JSON[_0xbf5f('0x12')](_0x5c68b4));if(_0x5c68b4[_0xbf5f('0x13')]){if(_0x5c68b4['error'][_0xbf5f('0x14')]===0x1f4){logger[_0xbf5f('0x13')](_0xbf5f('0xe'),_0x28d3d0,_0x5c68b4[_0xbf5f('0x13')][_0xbf5f('0x15')]);return _0x1336f1(_0x5c68b4[_0xbf5f('0x13')]['message']);}logger['error'](_0xbf5f('0xe'),_0x28d3d0,_0x5c68b4['error'][_0xbf5f('0x15')]);return _0x2a6539(_0x5c68b4['error'][_0xbf5f('0x15')]);}else{logger[_0xbf5f('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x28d3d0,'request\x20sent');_0x2a6539(_0x5c68b4[_0xbf5f('0x16')][_0xbf5f('0x15')]);}})[_0xbf5f('0x17')](function(_0x4fe910){logger[_0xbf5f('0x13')](_0xbf5f('0xe'),_0x28d3d0,_0x4fe910);_0x1336f1(_0x4fe910);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index f454784..9bde4e1 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 _0xbaa8=['get','isAuthenticated','index','show','post','put','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xbaa8,0x129));var _0x8baa=function(_0x42662d,_0x1c8732){_0x42662d=_0x42662d-0x0;var _0xef5ae3=_0xbaa8[_0x42662d];return _0xef5ae3;};'use strict';var multer=require(_0x8baa('0x0'));var util=require(_0x8baa('0x1'));var path=require(_0x8baa('0x2'));var timeout=require('connect-timeout');var express=require(_0x8baa('0x3'));var router=express[_0x8baa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8baa('0x5'));var interaction=require(_0x8baa('0x6'));var config=require(_0x8baa('0x7'));var controller=require(_0x8baa('0x8'));router[_0x8baa('0x9')]('/',auth[_0x8baa('0xa')](),controller[_0x8baa('0xb')]);router[_0x8baa('0x9')]('/:id',auth[_0x8baa('0xa')](),controller[_0x8baa('0xc')]);router[_0x8baa('0xd')]('/',auth[_0x8baa('0xa')](),controller['create']);router[_0x8baa('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x8baa('0xf'),auth[_0x8baa('0xa')](),controller[_0x8baa('0x10')]);module[_0x8baa('0x11')]=router; \ No newline at end of file +var _0x1d31=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0xe1f268,_0x2150ab){var _0x572864=function(_0x4727b0){while(--_0x4727b0){_0xe1f268['push'](_0xe1f268['shift']());}};_0x572864(++_0x2150ab);}(_0x1d31,0xa2));var _0x11d3=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x1d31[_0x7791d5];return _0x5ce288;};'use strict';var multer=require(_0x11d3('0x0'));var util=require(_0x11d3('0x1'));var path=require(_0x11d3('0x2'));var timeout=require('connect-timeout');var express=require(_0x11d3('0x3'));var router=express['Router']();var fs_extra=require(_0x11d3('0x4'));var auth=require(_0x11d3('0x5'));var interaction=require(_0x11d3('0x6'));var config=require(_0x11d3('0x7'));var controller=require(_0x11d3('0x8'));router['get']('/',auth[_0x11d3('0x9')](),controller[_0x11d3('0xa')]);router['get'](_0x11d3('0xb'),auth[_0x11d3('0x9')](),controller[_0x11d3('0xc')]);router[_0x11d3('0xd')]('/',auth[_0x11d3('0x9')](),controller[_0x11d3('0xe')]);router[_0x11d3('0xf')]('/:id',auth[_0x11d3('0x9')](),controller[_0x11d3('0x10')]);router['delete']('/:id',auth[_0x11d3('0x9')](),controller[_0x11d3('0x11')]);module[_0x11d3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index c452d8a..1a370d0 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 _0x4021=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x43bd80,_0x289cc6){var _0x4de12c=function(_0x15f614){while(--_0x15f614){_0x43bd80['push'](_0x43bd80['shift']());}};_0x4de12c(++_0x289cc6);}(_0x4021,0x14f));var _0x1402=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0x4021[_0x5c6022];return _0x4ab5af;};'use strict';var Sequelize=require(_0x1402('0x0'));module[_0x1402('0x1')]={'type':{'type':Sequelize[_0x1402('0x2')]('string',_0x1402('0x3'),_0x1402('0x4'),_0x1402('0x5'),_0x1402('0x6')),'defaultValue':_0x1402('0x7')},'content':{'type':Sequelize[_0x1402('0x8')]},'key':{'type':Sequelize[_0x1402('0x8')]},'keyType':{'type':Sequelize[_0x1402('0x2')](_0x1402('0x7'),_0x1402('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1402('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1402('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1402('0x8')]}}; \ No newline at end of file +var _0xe8cd=['STRING','ENUM','string','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','picklist'];(function(_0x3c3fcb,_0x90363e){var _0x3efb0a=function(_0x18e9df){while(--_0x18e9df){_0x3c3fcb['push'](_0x3c3fcb['shift']());}};_0x3efb0a(++_0x90363e);}(_0xe8cd,0x112));var _0xde8c=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xe8cd[_0x2136d5];return _0x3bee2e;};'use strict';var Sequelize=require(_0xde8c('0x0'));module[_0xde8c('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xde8c('0x2'),_0xde8c('0x3'),_0xde8c('0x4'),_0xde8c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xde8c('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xde8c('0x7')](_0xde8c('0x8'),'variable',_0xde8c('0x3'))},'keyContent':{'type':Sequelize[_0xde8c('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xde8c('0x6')]},'customField':{'type':Sequelize[_0xde8c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xde8c('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 37f3646..b0e29c0 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 _0x00b3=['hasOwnProperty','nolimit','order','sort','where','filters','pick','map','VIRTUAL','filter','options','FreshdeskField','includeAll','include','findAll','rows','show','merge','find','create','body','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','json','reject','save','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length'];(function(_0x377e08,_0x2eb9b3){var _0x3e43f8=function(_0x76207d){while(--_0x76207d){_0x377e08['push'](_0x377e08['shift']());}};_0x3e43f8(++_0x2eb9b3);}(_0x00b3,0x17a));var _0x300b=function(_0x4c4c6f,_0x237541){_0x4c4c6f=_0x4c4c6f-0x0;var _0x315f91=_0x00b3[_0x4c4c6f];return _0x315f91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x300b('0x0'));var zipdir=require(_0x300b('0x1'));var jsonpatch=require(_0x300b('0x2'));var rp=require(_0x300b('0x3'));var moment=require('moment');var BPromise=require(_0x300b('0x4'));var Mustache=require('mustache');var util=require(_0x300b('0x5'));var path=require('path');var sox=require(_0x300b('0x6'));var csv=require(_0x300b('0x7'));var ejs=require(_0x300b('0x8'));var fs=require('fs');var fs_extra=require(_0x300b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x300b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x300b('0x7'));var querystring=require(_0x300b('0xb'));var Papa=require(_0x300b('0xc'));var Redis=require('ioredis');var authService=require(_0x300b('0xd'));var qs=require(_0x300b('0xe'));var as=require(_0x300b('0xf'));var hardwareService=require(_0x300b('0x10'));var logger=require('../../config/logger')(_0x300b('0x11'));var utils=require(_0x300b('0x12'));var config=require(_0x300b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x300b('0x14'))['db'];function respondWithStatusCode(_0xea95bb,_0x138efb){_0x138efb=_0x138efb||0xcc;return function(_0x40c03b){if(_0x40c03b){return _0xea95bb[_0x300b('0x15')](_0x138efb);}return _0xea95bb[_0x300b('0x16')](_0x138efb)[_0x300b('0x17')]();};}function respondWithResult(_0x10bb41,_0x58746b){_0x58746b=_0x58746b||0xc8;return function(_0x54c3ee){if(_0x54c3ee){return _0x10bb41['status'](_0x58746b)['json'](_0x54c3ee);}};}function respondWithFilteredResult(_0x44e61b,_0x26c0e5){return function(_0xfb49f){if(_0xfb49f){var _0xd252fa=typeof _0x26c0e5['offset']==='undefined'&&typeof _0x26c0e5[_0x300b('0x18')]===_0x300b('0x19');var _0x2fed99=_0xfb49f[_0x300b('0x1a')];var _0x4d2024=_0xd252fa?0x0:_0x26c0e5[_0x300b('0x1b')];var _0x2a7d96=_0xd252fa?_0xfb49f[_0x300b('0x1a')]:_0x26c0e5['offset']+_0x26c0e5[_0x300b('0x18')];var _0x10174b;if(_0x2a7d96>=_0x2fed99){_0x2a7d96=_0x2fed99;_0x10174b=0xc8;}else{_0x10174b=0xce;}_0x44e61b[_0x300b('0x16')](_0x10174b);return _0x44e61b[_0x300b('0x1c')]('Content-Range',_0x4d2024+'-'+_0x2a7d96+'/'+_0x2fed99)[_0x300b('0x1d')](_0xfb49f);}return null;};}function patchUpdates(_0x16bfc6){return function(_0x971d15){try{jsonpatch['apply'](_0x971d15,_0x16bfc6,!![]);}catch(_0xe05542){return BPromise[_0x300b('0x1e')](_0xe05542);}return _0x971d15[_0x300b('0x1f')]();};}function saveUpdates(_0x502c5f,_0x26913f){return function(_0x5b14ed){if(_0x5b14ed){return _0x5b14ed['update'](_0x502c5f)[_0x300b('0x20')](function(_0xad0fb){return _0xad0fb;});}return null;};}function removeEntity(_0x28bc0a,_0x3ea40b){return function(_0x3219aa){if(_0x3219aa){return _0x3219aa[_0x300b('0x21')]()[_0x300b('0x20')](function(){_0x28bc0a[_0x300b('0x16')](0xcc)[_0x300b('0x17')]();});}};}function handleEntityNotFound(_0x544658,_0x3d62b1){return function(_0x152048){if(!_0x152048){_0x544658[_0x300b('0x15')](0x194);}return _0x152048;};}function handleError(_0x43c480,_0x4cce77){_0x4cce77=_0x4cce77||0x1f4;return function(_0x4f50b0){logger['error'](_0x4f50b0[_0x300b('0x22')]);if(_0x4f50b0['name']){delete _0x4f50b0[_0x300b('0x23')];}_0x43c480[_0x300b('0x16')](_0x4cce77)[_0x300b('0x24')](_0x4f50b0);};}exports[_0x300b('0x25')]=function(_0x2d2ea7,_0x10ed6b){var _0x165f56={},_0x159b63={},_0x1cdc8b={'count':0x0,'rows':[]};var _0x3210cd=_['map'](db['FreshdeskField'][_0x300b('0x26')],function(_0x2a7604){return{'name':_0x2a7604[_0x300b('0x27')],'type':_0x2a7604[_0x300b('0x28')]['key']};});_0x159b63[_0x300b('0x29')]=_['map'](_0x3210cd,'name');_0x159b63['query']=_[_0x300b('0x2a')](_0x2d2ea7[_0x300b('0x2b')]);_0x159b63['filters']=_[_0x300b('0x2c')](_0x159b63[_0x300b('0x29')],_0x159b63['query']);_0x165f56[_0x300b('0x2d')]=_['intersection'](_0x159b63[_0x300b('0x29')],qs[_0x300b('0x2e')](_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x2e')]));_0x165f56[_0x300b('0x2d')]=_0x165f56[_0x300b('0x2d')][_0x300b('0x2f')]?_0x165f56['attributes']:_0x159b63[_0x300b('0x29')];if(!_0x2d2ea7['query'][_0x300b('0x30')](_0x300b('0x31'))){_0x165f56['limit']=qs[_0x300b('0x18')](_0x2d2ea7[_0x300b('0x2b')]['limit']);_0x165f56[_0x300b('0x1b')]=qs[_0x300b('0x1b')](_0x2d2ea7[_0x300b('0x2b')]['offset']);}_0x165f56[_0x300b('0x32')]=qs[_0x300b('0x33')](_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x33')]);_0x165f56[_0x300b('0x34')]=qs[_0x300b('0x35')](_[_0x300b('0x36')](_0x2d2ea7['query'],_0x159b63[_0x300b('0x35')]),_0x3210cd);if(_0x2d2ea7[_0x300b('0x2b')]['filter']){_0x165f56[_0x300b('0x34')]=_['merge'](_0x165f56['where'],{'$or':_[_0x300b('0x37')](_0x3210cd,function(_0x393017){if(_0x393017[_0x300b('0x28')]!==_0x300b('0x38')){var _0xa9c0bf={};_0xa9c0bf[_0x393017['name']]={'$like':'%'+_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x39')]+'%'};return _0xa9c0bf;}})});}_0x165f56=_['merge']({},_0x165f56,_0x2d2ea7[_0x300b('0x3a')]);var _0x479561={'where':_0x165f56[_0x300b('0x34')]};return db[_0x300b('0x3b')][_0x300b('0x1a')](_0x479561)[_0x300b('0x20')](function(_0x40b715){_0x1cdc8b[_0x300b('0x1a')]=_0x40b715;if(_0x2d2ea7[_0x300b('0x2b')][_0x300b('0x3c')]){_0x165f56[_0x300b('0x3d')]=[{'all':!![]}];}return db[_0x300b('0x3b')][_0x300b('0x3e')](_0x165f56);})['then'](function(_0x4ee1d0){_0x1cdc8b[_0x300b('0x3f')]=_0x4ee1d0;return _0x1cdc8b;})['then'](respondWithFilteredResult(_0x10ed6b,_0x165f56))['catch'](handleError(_0x10ed6b,null));};exports[_0x300b('0x40')]=function(_0x24cb83,_0x61fc72){var _0x5ef864={'raw':!![],'where':{'id':_0x24cb83['params']['id']}},_0x7aa03a={};_0x7aa03a['model']=_[_0x300b('0x2a')](db[_0x300b('0x3b')]['rawAttributes']);_0x7aa03a[_0x300b('0x2b')]=_[_0x300b('0x2a')](_0x24cb83['query']);_0x7aa03a[_0x300b('0x35')]=_[_0x300b('0x2c')](_0x7aa03a['model'],_0x7aa03a[_0x300b('0x2b')]);_0x5ef864[_0x300b('0x2d')]=_[_0x300b('0x2c')](_0x7aa03a[_0x300b('0x29')],qs[_0x300b('0x2e')](_0x24cb83[_0x300b('0x2b')][_0x300b('0x2e')]));_0x5ef864[_0x300b('0x2d')]=_0x5ef864['attributes']['length']?_0x5ef864[_0x300b('0x2d')]:_0x7aa03a['model'];if(_0x24cb83['query'][_0x300b('0x3c')]){_0x5ef864[_0x300b('0x3d')]=[{'all':!![]}];}_0x5ef864=_[_0x300b('0x41')]({},_0x5ef864,_0x24cb83[_0x300b('0x3a')]);return db[_0x300b('0x3b')][_0x300b('0x42')](_0x5ef864)['then'](handleEntityNotFound(_0x61fc72,null))[_0x300b('0x20')](respondWithResult(_0x61fc72,null))['catch'](handleError(_0x61fc72,null));};exports['create']=function(_0x3b6ed2,_0x44d1b4){return db['FreshdeskField'][_0x300b('0x43')](_0x3b6ed2[_0x300b('0x44')],{})[_0x300b('0x20')](respondWithResult(_0x44d1b4,0xc9))[_0x300b('0x45')](handleError(_0x44d1b4,null));};exports['update']=function(_0x389256,_0x43eef6){if(_0x389256['body']['id']){delete _0x389256[_0x300b('0x44')]['id'];}return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x389256['params']['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x43eef6,null))[_0x300b('0x20')](saveUpdates(_0x389256[_0x300b('0x44')],null))[_0x300b('0x20')](respondWithResult(_0x43eef6,null))[_0x300b('0x45')](handleError(_0x43eef6,null));};exports[_0x300b('0x21')]=function(_0x418ac3,_0x3dd25c){return db[_0x300b('0x3b')][_0x300b('0x42')]({'where':{'id':_0x418ac3[_0x300b('0x46')]['id']}})[_0x300b('0x20')](handleEntityNotFound(_0x3dd25c,null))[_0x300b('0x20')](removeEntity(_0x3dd25c,null))['catch'](handleError(_0x3dd25c,null));}; \ No newline at end of file +var _0x7fce=['merge','VIRTUAL','includeAll','include','FreshdeskField','findAll','show','params','options','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','model','keys','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','pick','filter'];(function(_0x93ee28,_0x1a5f0c){var _0x3b65be=function(_0x440aa3){while(--_0x440aa3){_0x93ee28['push'](_0x93ee28['shift']());}};_0x3b65be(++_0x1a5f0c);}(_0x7fce,0xdc));var _0xe7fc=function(_0x4cf04d,_0x31151c){_0x4cf04d=_0x4cf04d-0x0;var _0x4acd3f=_0x7fce[_0x4cf04d];return _0x4acd3f;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243600,_0x59da2e){_0x59da2e=_0x59da2e||0xcc;return function(_0x38512a){if(_0x38512a){return _0x243600['sendStatus'](_0x59da2e);}return _0x243600['status'](_0x59da2e)[_0xe7fc('0x15')]();};}function respondWithResult(_0x14fcbf,_0x235692){_0x235692=_0x235692||0xc8;return function(_0x307f58){if(_0x307f58){return _0x14fcbf[_0xe7fc('0x16')](_0x235692)['json'](_0x307f58);}};}function respondWithFilteredResult(_0x272cd5,_0x5ce83f){return function(_0x4da73b){if(_0x4da73b){var _0x1302e5=typeof _0x5ce83f[_0xe7fc('0x17')]===_0xe7fc('0x18')&&typeof _0x5ce83f[_0xe7fc('0x19')]==='undefined';var _0x552429=_0x4da73b['count'];var _0x4aa4f0=_0x1302e5?0x0:_0x5ce83f['offset'];var _0x490a99=_0x1302e5?_0x4da73b[_0xe7fc('0x1a')]:_0x5ce83f['offset']+_0x5ce83f[_0xe7fc('0x19')];var _0xb43fde;if(_0x490a99>=_0x552429){_0x490a99=_0x552429;_0xb43fde=0xc8;}else{_0xb43fde=0xce;}_0x272cd5[_0xe7fc('0x16')](_0xb43fde);return _0x272cd5[_0xe7fc('0x1b')](_0xe7fc('0x1c'),_0x4aa4f0+'-'+_0x490a99+'/'+_0x552429)[_0xe7fc('0x1d')](_0x4da73b);}return null;};}function patchUpdates(_0x329051){return function(_0x763103){try{jsonpatch['apply'](_0x763103,_0x329051,!![]);}catch(_0x39c75a){return BPromise[_0xe7fc('0x1e')](_0x39c75a);}return _0x763103['save']();};}function saveUpdates(_0x587dee,_0x35bb53){return function(_0x3c31e7){if(_0x3c31e7){return _0x3c31e7[_0xe7fc('0x1f')](_0x587dee)[_0xe7fc('0x20')](function(_0x26977a){return _0x26977a;});}return null;};}function removeEntity(_0x11c5a3,_0x3f850f){return function(_0x1731b6){if(_0x1731b6){return _0x1731b6[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){_0x11c5a3[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x15')]();});}};}function handleEntityNotFound(_0x12ebdd,_0x5255b7){return function(_0x2d9e77){if(!_0x2d9e77){_0x12ebdd[_0xe7fc('0x22')](0x194);}return _0x2d9e77;};}function handleError(_0x416464,_0x3be1fd){_0x3be1fd=_0x3be1fd||0x1f4;return function(_0x2249ed){logger[_0xe7fc('0x23')](_0x2249ed['stack']);if(_0x2249ed[_0xe7fc('0x24')]){delete _0x2249ed[_0xe7fc('0x24')];}_0x416464[_0xe7fc('0x16')](_0x3be1fd)[_0xe7fc('0x25')](_0x2249ed);};}exports[_0xe7fc('0x26')]=function(_0x4416b5,_0x383ca6){var _0x4da084={},_0x36a68b={},_0x2a08a4={'count':0x0,'rows':[]};var _0x512518=_[_0xe7fc('0x27')](db['FreshdeskField'][_0xe7fc('0x28')],function(_0x27255a){return{'name':_0x27255a['fieldName'],'type':_0x27255a[_0xe7fc('0x29')]['key']};});_0x36a68b[_0xe7fc('0x2a')]=_[_0xe7fc('0x27')](_0x512518,_0xe7fc('0x24'));_0x36a68b['query']=_[_0xe7fc('0x2b')](_0x4416b5['query']);_0x36a68b[_0xe7fc('0x2c')]=_[_0xe7fc('0x2d')](_0x36a68b['model'],_0x36a68b['query']);_0x4da084['attributes']=_['intersection'](_0x36a68b[_0xe7fc('0x2a')],qs[_0xe7fc('0x2e')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x2e')]));_0x4da084[_0xe7fc('0x30')]=_0x4da084[_0xe7fc('0x30')][_0xe7fc('0x31')]?_0x4da084[_0xe7fc('0x30')]:_0x36a68b[_0xe7fc('0x2a')];if(!_0x4416b5[_0xe7fc('0x2f')]['hasOwnProperty'](_0xe7fc('0x32'))){_0x4da084[_0xe7fc('0x19')]=qs[_0xe7fc('0x19')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x19')]);_0x4da084['offset']=qs[_0xe7fc('0x17')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x17')]);}_0x4da084[_0xe7fc('0x33')]=qs[_0xe7fc('0x34')](_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x34')]);_0x4da084[_0xe7fc('0x35')]=qs[_0xe7fc('0x2c')](_[_0xe7fc('0x36')](_0x4416b5[_0xe7fc('0x2f')],_0x36a68b[_0xe7fc('0x2c')]),_0x512518);if(_0x4416b5['query'][_0xe7fc('0x37')]){_0x4da084[_0xe7fc('0x35')]=_[_0xe7fc('0x38')](_0x4da084[_0xe7fc('0x35')],{'$or':_[_0xe7fc('0x27')](_0x512518,function(_0x4ed2e4){if(_0x4ed2e4[_0xe7fc('0x29')]!==_0xe7fc('0x39')){var _0x112bb9={};_0x112bb9[_0x4ed2e4[_0xe7fc('0x24')]]={'$like':'%'+_0x4416b5[_0xe7fc('0x2f')][_0xe7fc('0x37')]+'%'};return _0x112bb9;}})});}_0x4da084=_['merge']({},_0x4da084,_0x4416b5['options']);var _0x582053={'where':_0x4da084['where']};return db['FreshdeskField'][_0xe7fc('0x1a')](_0x582053)[_0xe7fc('0x20')](function(_0x4cc33f){_0x2a08a4[_0xe7fc('0x1a')]=_0x4cc33f;if(_0x4416b5['query'][_0xe7fc('0x3a')]){_0x4da084[_0xe7fc('0x3b')]=[{'all':!![]}];}return db[_0xe7fc('0x3c')][_0xe7fc('0x3d')](_0x4da084);})[_0xe7fc('0x20')](function(_0x3e35c7){_0x2a08a4['rows']=_0x3e35c7;return _0x2a08a4;})[_0xe7fc('0x20')](respondWithFilteredResult(_0x383ca6,_0x4da084))['catch'](handleError(_0x383ca6,null));};exports[_0xe7fc('0x3e')]=function(_0x381bb4,_0x533f26){var _0x636368={'raw':!![],'where':{'id':_0x381bb4[_0xe7fc('0x3f')]['id']}},_0x3ce7ad={};_0x3ce7ad[_0xe7fc('0x2a')]=_[_0xe7fc('0x2b')](db[_0xe7fc('0x3c')][_0xe7fc('0x28')]);_0x3ce7ad[_0xe7fc('0x2f')]=_[_0xe7fc('0x2b')](_0x381bb4[_0xe7fc('0x2f')]);_0x3ce7ad[_0xe7fc('0x2c')]=_[_0xe7fc('0x2d')](_0x3ce7ad[_0xe7fc('0x2a')],_0x3ce7ad[_0xe7fc('0x2f')]);_0x636368[_0xe7fc('0x30')]=_[_0xe7fc('0x2d')](_0x3ce7ad[_0xe7fc('0x2a')],qs['fields'](_0x381bb4[_0xe7fc('0x2f')][_0xe7fc('0x2e')]));_0x636368[_0xe7fc('0x30')]=_0x636368['attributes'][_0xe7fc('0x31')]?_0x636368[_0xe7fc('0x30')]:_0x3ce7ad[_0xe7fc('0x2a')];if(_0x381bb4[_0xe7fc('0x2f')][_0xe7fc('0x3a')]){_0x636368['include']=[{'all':!![]}];}_0x636368=_['merge']({},_0x636368,_0x381bb4[_0xe7fc('0x40')]);return db[_0xe7fc('0x3c')][_0xe7fc('0x41')](_0x636368)[_0xe7fc('0x20')](handleEntityNotFound(_0x533f26,null))[_0xe7fc('0x20')](respondWithResult(_0x533f26,null))['catch'](handleError(_0x533f26,null));};exports[_0xe7fc('0x42')]=function(_0x2dd594,_0x2807ff){return db[_0xe7fc('0x3c')][_0xe7fc('0x42')](_0x2dd594[_0xe7fc('0x43')],{})[_0xe7fc('0x20')](respondWithResult(_0x2807ff,0xc9))[_0xe7fc('0x44')](handleError(_0x2807ff,null));};exports[_0xe7fc('0x1f')]=function(_0x45edbf,_0x533f31){if(_0x45edbf[_0xe7fc('0x43')]['id']){delete _0x45edbf['body']['id'];}return db[_0xe7fc('0x3c')][_0xe7fc('0x41')]({'where':{'id':_0x45edbf[_0xe7fc('0x3f')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x533f31,null))[_0xe7fc('0x20')](saveUpdates(_0x45edbf[_0xe7fc('0x43')],null))[_0xe7fc('0x20')](respondWithResult(_0x533f31,null))[_0xe7fc('0x44')](handleError(_0x533f31,null));};exports[_0xe7fc('0x21')]=function(_0x535afb,_0x63a8bf){return db[_0xe7fc('0x3c')][_0xe7fc('0x41')]({'where':{'id':_0x535afb[_0xe7fc('0x3f')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x63a8bf,null))[_0xe7fc('0x20')](removeEntity(_0x63a8bf,null))['catch'](handleError(_0x63a8bf,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index dd9ed1b..d5a4ad3 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 _0x7f90=['exports','define','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','moment','path','rimraf','./intFreshdeskField.attributes'];(function(_0x4f0837,_0x2ef53b){var _0x30abc4=function(_0xbe1347){while(--_0xbe1347){_0x4f0837['push'](_0x4f0837['shift']());}};_0x30abc4(++_0x2ef53b);}(_0x7f90,0xf4));var _0x07f9=function(_0x232719,_0x37a326){_0x232719=_0x232719-0x0;var _0x21ee88=_0x7f90[_0x232719];return _0x21ee88;};'use strict';var _=require(_0x07f9('0x0'));var util=require(_0x07f9('0x1'));var logger=require(_0x07f9('0x2'))(_0x07f9('0x3'));var moment=require(_0x07f9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07f9('0x5'));var rimraf=require(_0x07f9('0x6'));var config=require('../../config/environment');var attributes=require(_0x07f9('0x7'));module[_0x07f9('0x8')]=function(_0x46f86e,_0x449544){return _0x46f86e[_0x07f9('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x07f9('0xa'),'fields':[_0x07f9('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ec2=['bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x575584,_0x149395){var _0x120d12=function(_0x32c3f6){while(--_0x32c3f6){_0x575584['push'](_0x575584['shift']());}};_0x120d12(++_0x149395);}(_0x7ec2,0x15c));var _0x27ec=function(_0x4a2202,_0x3dfb2a){_0x4a2202=_0x4a2202-0x0;var _0x3d0bc9=_0x7ec2[_0x4a2202];return _0x3d0bc9;};'use strict';var _=require(_0x27ec('0x0'));var util=require(_0x27ec('0x1'));var logger=require(_0x27ec('0x2'))('api');var moment=require(_0x27ec('0x3'));var BPromise=require(_0x27ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27ec('0x5'));var rimraf=require(_0x27ec('0x6'));var config=require(_0x27ec('0x7'));var attributes=require(_0x27ec('0x8'));module[_0x27ec('0x9')]=function(_0x2f5fcb,_0x2ac546){return _0x2f5fcb[_0x27ec('0xa')](_0x27ec('0xb'),attributes,{'tableName':_0x27ec('0xc'),'paranoid':![],'indexes':[{'name':_0x27ec('0xd'),'fields':[_0x27ec('0xe'),_0x27ec('0xf')],'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 6eff16f..7925684 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 _0xf87a=['client','http','request','debug','request\x20sent','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x152a69,_0x45a510){var _0x9f8e78=function(_0x1051b4){while(--_0x1051b4){_0x152a69['push'](_0x152a69['shift']());}};_0x9f8e78(++_0x45a510);}(_0xf87a,0x124));var _0xaf87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf87a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xaf87('0x0'));var util=require(_0xaf87('0x1'));var moment=require(_0xaf87('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf87('0x3'));var fs=require('fs');var Redis=require(_0xaf87('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaf87('0x5'))('rpc');var config=require(_0xaf87('0x6'));var jayson=require(_0xaf87('0x7'));var client=jayson[_0xaf87('0x8')][_0xaf87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f87e1,_0x57c478,_0x3bb837){return new BPromise(function(_0x3b5ba0,_0x532bed){return client[_0xaf87('0xa')](_0x4f87e1,_0x3bb837)['then'](function(_0x2dec68){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x57c478,'request\x20sent');logger[_0xaf87('0xb')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x57c478,_0xaf87('0xc'),JSON[_0xaf87('0xd')](_0x2dec68));if(_0x2dec68[_0xaf87('0xe')]){if(_0x2dec68[_0xaf87('0xe')][_0xaf87('0xf')]===0x1f4){logger[_0xaf87('0xe')](_0xaf87('0x10'),_0x57c478,_0x2dec68[_0xaf87('0xe')][_0xaf87('0x11')]);return _0x532bed(_0x2dec68[_0xaf87('0xe')][_0xaf87('0x11')]);}logger[_0xaf87('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x57c478,_0x2dec68['error'][_0xaf87('0x11')]);return _0x3b5ba0(_0x2dec68['error'][_0xaf87('0x11')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x57c478,_0xaf87('0xc'));_0x3b5ba0(_0x2dec68[_0xaf87('0x12')][_0xaf87('0x11')]);}})[_0xaf87('0x13')](function(_0x5e8d15){logger[_0xaf87('0xe')](_0xaf87('0x10'),_0x57c478,_0x5e8d15);_0x532bed(_0x5e8d15);});});} \ No newline at end of file +var _0xbc11=['../../config/environment','jayson/promise','client','http','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xbc11,0x185));var _0x1bc1=function(_0x5774de,_0x4122b7){_0x5774de=_0x5774de-0x0;var _0x568394=_0xbc11[_0x5774de];return _0x568394;};'use strict';var _=require(_0x1bc1('0x0'));var util=require(_0x1bc1('0x1'));var moment=require(_0x1bc1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bc1('0x3'));var db=require(_0x1bc1('0x4'))['db'];var utils=require(_0x1bc1('0x5'));var logger=require(_0x1bc1('0x6'))('rpc');var config=require(_0x1bc1('0x7'));var jayson=require(_0x1bc1('0x8'));var client=jayson[_0x1bc1('0x9')][_0x1bc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9f4347,_0x334f80,_0x1af27b){return new BPromise(function(_0x12309b,_0x28fb63){return client['request'](_0x9f4347,_0x1af27b)[_0x1bc1('0xb')](function(_0x210616){logger[_0x1bc1('0xc')](_0x1bc1('0xd'),_0x334f80,_0x1bc1('0xe'));logger[_0x1bc1('0xf')](_0x1bc1('0x10'),_0x334f80,_0x1bc1('0xe'),JSON[_0x1bc1('0x11')](_0x210616));if(_0x210616[_0x1bc1('0x12')]){if(_0x210616[_0x1bc1('0x12')]['code']===0x1f4){logger['error'](_0x1bc1('0xd'),_0x334f80,_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);return _0x28fb63(_0x210616['error'][_0x1bc1('0x13')]);}logger[_0x1bc1('0x12')](_0x1bc1('0xd'),_0x334f80,_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);return _0x12309b(_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);}else{logger[_0x1bc1('0xc')](_0x1bc1('0xd'),_0x334f80,_0x1bc1('0xe'));_0x12309b(_0x210616[_0x1bc1('0x14')][_0x1bc1('0x13')]);}})[_0x1bc1('0x15')](function(_0x4293ff){logger[_0x1bc1('0x12')](_0x1bc1('0xd'),_0x334f80,_0x4293ff);_0x28fb63(_0x4293ff);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 0b5d5fa..5552cf8 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 _0x0fd9=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x141310,_0x4fb243){var _0x4680ae=function(_0x215303){while(--_0x215303){_0x141310['push'](_0x141310['shift']());}};_0x4680ae(++_0x4fb243);}(_0x0fd9,0xa3));var _0x90fd=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0x0fd9[_0x5a7112];return _0x3147f7;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),controller[_0x90fd('0x10')]);router[_0x90fd('0xf')]('/:id/configurations',auth[_0x90fd('0x9')](),controller[_0x90fd('0x11')]);router['put'](_0x90fd('0xa'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x12')]);router['delete'](_0x90fd('0xa'),auth['isAuthenticated'](),controller[_0x90fd('0x13')]);module[_0x90fd('0x14')]=router; \ No newline at end of file +var _0x5423=['create','post','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x1858cd,_0x11e91c){var _0x4487be=function(_0x5d4f0e){while(--_0x5d4f0e){_0x1858cd['push'](_0x1858cd['shift']());}};_0x4487be(++_0x11e91c);}(_0x5423,0xe3));var _0x3542=function(_0x4139d6,_0x590668){_0x4139d6=_0x4139d6-0x0;var _0x32d579=_0x5423[_0x4139d6];return _0x32d579;};'use strict';var multer=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var path=require('path');var timeout=require(_0x3542('0x2'));var express=require(_0x3542('0x3'));var router=express['Router']();var fs_extra=require(_0x3542('0x4'));var auth=require(_0x3542('0x5'));var interaction=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x3542('0x8')]('/',auth[_0x3542('0x9')](),controller[_0x3542('0xa')]);router[_0x3542('0x8')](_0x3542('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x3542('0x8')](_0x3542('0xc'),auth['isAuthenticated'](),controller[_0x3542('0xd')]);router[_0x3542('0x8')]('/:id/fields',auth[_0x3542('0x9')](),controller[_0x3542('0xe')]);router['post']('/',auth[_0x3542('0x9')](),controller[_0x3542('0xf')]);router[_0x3542('0x10')](_0x3542('0xc'),auth[_0x3542('0x9')](),controller[_0x3542('0x11')]);router[_0x3542('0x12')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller[_0x3542('0x13')]);router[_0x3542('0x14')](_0x3542('0xb'),auth[_0x3542('0x9')](),controller['destroy']);module[_0x3542('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 774af23..0a532e2 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 _0x2542=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x2542,0x169));var _0x2254=function(_0x1d4c20,_0x1961e0){_0x1d4c20=_0x1d4c20-0x0;var _0x16e804=_0x2542[_0x1d4c20];return _0x16e804;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')]},'description':{'type':Sequelize[_0x2254('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2254('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2254('0x2')],'unique':_0x2254('0x4')},'serverUrl':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb016=['remoteUri','sequelize','exports','STRING'];(function(_0x51cc1d,_0xaa88ae){var _0x2eb9f2=function(_0x1ca525){while(--_0x1ca525){_0x51cc1d['push'](_0x51cc1d['shift']());}};_0x2eb9f2(++_0xaa88ae);}(_0xb016,0x159));var _0x6b01=function(_0x18b520,_0x8535f1){_0x18b520=_0x18b520-0x0;var _0x2e204d=_0xb016[_0x18b520];return _0x2e204d;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'serverUrl':{'type':Sequelize[_0x6b01('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 e76a80e..c31d250 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 _0xb5a7=['undefined','count','limit','Content-Range','json','save','update','then','destroy','end','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','username','remoteUri','slice','lastIndexOf','format','%s%s','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset'];(function(_0x3f6bcf,_0x531e79){var _0x1c5350=function(_0x282fc5){while(--_0x282fc5){_0x3f6bcf['push'](_0x3f6bcf['shift']());}};_0x1c5350(++_0x531e79);}(_0xb5a7,0xaf));var _0x7b5a=function(_0x48ccd8,_0xe98f1e){_0x48ccd8=_0x48ccd8-0x0;var _0x55923f=_0xb5a7[_0x48ccd8];return _0x55923f;};'use strict';var emlformat=require(_0x7b5a('0x0'));var rimraf=require(_0x7b5a('0x1'));var zipdir=require(_0x7b5a('0x2'));var jsonpatch=require(_0x7b5a('0x3'));var rp=require(_0x7b5a('0x4'));var moment=require(_0x7b5a('0x5'));var BPromise=require(_0x7b5a('0x6'));var Mustache=require(_0x7b5a('0x7'));var util=require(_0x7b5a('0x8'));var path=require(_0x7b5a('0x9'));var sox=require(_0x7b5a('0xa'));var csv=require(_0x7b5a('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b5a('0xc'));var _=require(_0x7b5a('0xd'));var squel=require(_0x7b5a('0xe'));var crypto=require(_0x7b5a('0xf'));var jsforce=require(_0x7b5a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7b5a('0xb'));var querystring=require(_0x7b5a('0x11'));var Papa=require('papaparse');var Redis=require(_0x7b5a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7b5a('0x13'));var as=require(_0x7b5a('0x14'));var hardwareService=require(_0x7b5a('0x15'));var logger=require(_0x7b5a('0x16'))(_0x7b5a('0x17'));var utils=require(_0x7b5a('0x18'));var config=require(_0x7b5a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b5a('0x1a'))['db'];var integrations=require(_0x7b5a('0x1b'));function respondWithStatusCode(_0x4446d1,_0x45c3d3){_0x45c3d3=_0x45c3d3||0xcc;return function(_0x479597){if(_0x479597){return _0x4446d1[_0x7b5a('0x1c')](_0x45c3d3);}return _0x4446d1[_0x7b5a('0x1d')](_0x45c3d3)['end']();};}function respondWithResult(_0x31fd4e,_0x2ee705){_0x2ee705=_0x2ee705||0xc8;return function(_0x1a01f7){if(_0x1a01f7){return _0x31fd4e['status'](_0x2ee705)['json'](_0x1a01f7);}};}function respondWithFilteredResult(_0x179dc5,_0x1ed3fa){return function(_0xe6f43){if(_0xe6f43){var _0x279c4b=typeof _0x1ed3fa[_0x7b5a('0x1e')]===_0x7b5a('0x1f')&&typeof _0x1ed3fa['limit']===_0x7b5a('0x1f');var _0xf0b3f6=_0xe6f43[_0x7b5a('0x20')];var _0x397f83=_0x279c4b?0x0:_0x1ed3fa['offset'];var _0x58d986=_0x279c4b?_0xe6f43[_0x7b5a('0x20')]:_0x1ed3fa[_0x7b5a('0x1e')]+_0x1ed3fa[_0x7b5a('0x21')];var _0x70b651;if(_0x58d986>=_0xf0b3f6){_0x58d986=_0xf0b3f6;_0x70b651=0xc8;}else{_0x70b651=0xce;}_0x179dc5[_0x7b5a('0x1d')](_0x70b651);return _0x179dc5['set'](_0x7b5a('0x22'),_0x397f83+'-'+_0x58d986+'/'+_0xf0b3f6)[_0x7b5a('0x23')](_0xe6f43);}return null;};}function patchUpdates(_0x449d16){return function(_0x42e185){try{jsonpatch['apply'](_0x42e185,_0x449d16,!![]);}catch(_0x14b829){return BPromise['reject'](_0x14b829);}return _0x42e185[_0x7b5a('0x24')]();};}function saveUpdates(_0x408760,_0xd04883){return function(_0x2ffcd5){if(_0x2ffcd5){return _0x2ffcd5[_0x7b5a('0x25')](_0x408760)[_0x7b5a('0x26')](function(_0x12e90d){return _0x12e90d;});}return null;};}function removeEntity(_0x2aa8ff,_0x425ee6){return function(_0xf05dbe){if(_0xf05dbe){return _0xf05dbe[_0x7b5a('0x27')]()['then'](function(){_0x2aa8ff[_0x7b5a('0x1d')](0xcc)[_0x7b5a('0x28')]();});}};}function handleEntityNotFound(_0x3287e7,_0x3f3e7c){return function(_0xa52561){if(!_0xa52561){_0x3287e7[_0x7b5a('0x1c')](0x194);}return _0xa52561;};}function handleError(_0x36a345,_0x3d2591){_0x3d2591=_0x3d2591||0x1f4;return function(_0x55cc1e){logger['error'](_0x55cc1e[_0x7b5a('0x29')]);if(_0x55cc1e[_0x7b5a('0x2a')]){delete _0x55cc1e[_0x7b5a('0x2a')];}_0x36a345[_0x7b5a('0x1d')](_0x3d2591)[_0x7b5a('0x2b')](_0x55cc1e);};}exports[_0x7b5a('0x2c')]=function(_0x218cb7,_0x839e85){var _0x4ec52e={},_0x21ea4e={},_0x3a3710={'count':0x0,'rows':[]};var _0x3cde98=_[_0x7b5a('0x2d')](db[_0x7b5a('0x2e')][_0x7b5a('0x2f')],function(_0x47cda8){return{'name':_0x47cda8[_0x7b5a('0x30')],'type':_0x47cda8[_0x7b5a('0x31')]['key']};});_0x21ea4e['model']=_[_0x7b5a('0x2d')](_0x3cde98,'name');_0x21ea4e['query']=_[_0x7b5a('0x32')](_0x218cb7['query']);_0x21ea4e[_0x7b5a('0x33')]=_[_0x7b5a('0x34')](_0x21ea4e[_0x7b5a('0x35')],_0x21ea4e[_0x7b5a('0x36')]);_0x4ec52e[_0x7b5a('0x37')]=_['intersection'](_0x21ea4e[_0x7b5a('0x35')],qs[_0x7b5a('0x38')](_0x218cb7['query'][_0x7b5a('0x38')]));_0x4ec52e[_0x7b5a('0x37')]=_0x4ec52e[_0x7b5a('0x37')][_0x7b5a('0x39')]?_0x4ec52e[_0x7b5a('0x37')]:_0x21ea4e[_0x7b5a('0x35')];if(!_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x3a')](_0x7b5a('0x3b'))){_0x4ec52e[_0x7b5a('0x21')]=qs[_0x7b5a('0x21')](_0x218cb7['query'][_0x7b5a('0x21')]);_0x4ec52e[_0x7b5a('0x1e')]=qs[_0x7b5a('0x1e')](_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x1e')]);}_0x4ec52e['order']=qs[_0x7b5a('0x3c')](_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x3c')]);_0x4ec52e['where']=qs['filters'](_['pick'](_0x218cb7[_0x7b5a('0x36')],_0x21ea4e[_0x7b5a('0x33')]),_0x3cde98);if(_0x218cb7[_0x7b5a('0x36')][_0x7b5a('0x3d')]){_0x4ec52e[_0x7b5a('0x3e')]=_['merge'](_0x4ec52e['where'],{'$or':_[_0x7b5a('0x2d')](_0x3cde98,function(_0x35e6c6){if(_0x35e6c6[_0x7b5a('0x31')]!==_0x7b5a('0x3f')){var _0xe30881={};_0xe30881[_0x35e6c6[_0x7b5a('0x2a')]]={'$like':'%'+_0x218cb7['query'][_0x7b5a('0x3d')]+'%'};return _0xe30881;}})});}_0x4ec52e=_[_0x7b5a('0x40')]({},_0x4ec52e,_0x218cb7[_0x7b5a('0x41')]);var _0x2204cb={'where':_0x4ec52e['where']};return db[_0x7b5a('0x2e')][_0x7b5a('0x20')](_0x2204cb)[_0x7b5a('0x26')](function(_0x38b278){_0x3a3710[_0x7b5a('0x20')]=_0x38b278;if(_0x218cb7[_0x7b5a('0x36')]['includeAll']){_0x4ec52e[_0x7b5a('0x42')]=[{'all':!![]}];}return db[_0x7b5a('0x2e')][_0x7b5a('0x43')](_0x4ec52e);})[_0x7b5a('0x26')](function(_0x1eaa72){_0x3a3710[_0x7b5a('0x44')]=_0x1eaa72;return _0x3a3710;})[_0x7b5a('0x26')](respondWithFilteredResult(_0x839e85,_0x4ec52e))[_0x7b5a('0x45')](handleError(_0x839e85,null));};exports[_0x7b5a('0x46')]=function(_0x1025ce,_0x463646){var _0x3e364b={'raw':![],'where':{'id':_0x1025ce[_0x7b5a('0x47')]['id']}},_0x3fa03e={};_0x3fa03e['model']=_[_0x7b5a('0x32')](db['FreshsalesAccount'][_0x7b5a('0x2f')]);_0x3fa03e['query']=_[_0x7b5a('0x32')](_0x1025ce[_0x7b5a('0x36')]);_0x3fa03e[_0x7b5a('0x33')]=_[_0x7b5a('0x34')](_0x3fa03e['model'],_0x3fa03e[_0x7b5a('0x36')]);_0x3e364b[_0x7b5a('0x37')]=_[_0x7b5a('0x34')](_0x3fa03e[_0x7b5a('0x35')],qs[_0x7b5a('0x38')](_0x1025ce[_0x7b5a('0x36')][_0x7b5a('0x38')]));_0x3e364b[_0x7b5a('0x37')]=_0x3e364b[_0x7b5a('0x37')][_0x7b5a('0x39')]?_0x3e364b[_0x7b5a('0x37')]:_0x3fa03e[_0x7b5a('0x35')];if(_0x1025ce['query'][_0x7b5a('0x48')]){_0x3e364b[_0x7b5a('0x42')]=[{'all':!![]}];}_0x3e364b=_[_0x7b5a('0x40')]({},_0x3e364b,_0x1025ce[_0x7b5a('0x41')]);return db['FreshsalesAccount'][_0x7b5a('0x49')](_0x3e364b)[_0x7b5a('0x26')](handleEntityNotFound(_0x463646,null))['then'](respondWithResult(_0x463646,null))[_0x7b5a('0x45')](handleError(_0x463646,null));};exports[_0x7b5a('0x4a')]=function(_0x1bae9c,_0x431b85){return db[_0x7b5a('0x2e')][_0x7b5a('0x4a')](_0x1bae9c[_0x7b5a('0x4b')],{})['then'](respondWithResult(_0x431b85,0xc9))[_0x7b5a('0x45')](handleError(_0x431b85,null));};exports[_0x7b5a('0x25')]=function(_0x3adf99,_0x3b9c7c){if(_0x3adf99[_0x7b5a('0x4b')]['id']){delete _0x3adf99[_0x7b5a('0x4b')]['id'];}return db[_0x7b5a('0x2e')]['find']({'where':{'id':_0x3adf99[_0x7b5a('0x47')]['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0x3b9c7c,null))['then'](saveUpdates(_0x3adf99[_0x7b5a('0x4b')],null))['then'](respondWithResult(_0x3b9c7c,null))[_0x7b5a('0x45')](handleError(_0x3b9c7c,null));};exports[_0x7b5a('0x27')]=function(_0x4abc7c,_0x163c21){return db[_0x7b5a('0x2e')][_0x7b5a('0x49')]({'where':{'id':_0x4abc7c['params']['id']}})['then'](handleEntityNotFound(_0x163c21,null))[_0x7b5a('0x26')](removeEntity(_0x163c21,null))[_0x7b5a('0x45')](handleError(_0x163c21,null));};exports[_0x7b5a('0x4c')]=function(_0x2ecd02,_0x31e713,_0x596b95){var _0x4a31ff={};var _0x1eba45={};var _0x578d89;var _0x14479b;return db[_0x7b5a('0x2e')][_0x7b5a('0x4d')]({'where':{'id':_0x2ecd02['params']['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0x31e713,null))[_0x7b5a('0x26')](function(_0x4bc115){if(_0x4bc115){_0x578d89=_0x4bc115;_0x1eba45[_0x7b5a('0x35')]=_[_0x7b5a('0x32')](db['FreshsalesConfiguration'][_0x7b5a('0x2f')]);_0x1eba45['query']=_[_0x7b5a('0x32')](_0x2ecd02[_0x7b5a('0x36')]);_0x1eba45[_0x7b5a('0x33')]=_[_0x7b5a('0x34')](_0x1eba45[_0x7b5a('0x35')],_0x1eba45[_0x7b5a('0x36')]);_0x4a31ff[_0x7b5a('0x37')]=_['intersection'](_0x1eba45['model'],qs['fields'](_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x38')]));_0x4a31ff['attributes']=_0x4a31ff[_0x7b5a('0x37')][_0x7b5a('0x39')]?_0x4a31ff[_0x7b5a('0x37')]:_0x1eba45[_0x7b5a('0x35')];_0x4a31ff[_0x7b5a('0x4e')]=qs[_0x7b5a('0x3c')](_0x2ecd02['query'][_0x7b5a('0x3c')]);_0x4a31ff[_0x7b5a('0x3e')]=qs[_0x7b5a('0x33')](_[_0x7b5a('0x4f')](_0x2ecd02[_0x7b5a('0x36')],_0x1eba45[_0x7b5a('0x33')]));if(_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x3d')]){_0x4a31ff['where']=_['merge'](_0x4a31ff[_0x7b5a('0x3e')],{'$or':_[_0x7b5a('0x2d')](_0x4a31ff[_0x7b5a('0x37')],function(_0x1ec921){var _0x2669e4={};_0x2669e4[_0x1ec921]={'$like':'%'+_0x2ecd02['query'][_0x7b5a('0x3d')]+'%'};return _0x2669e4;})});}_0x4a31ff=_[_0x7b5a('0x40')]({},_0x4a31ff,_0x2ecd02[_0x7b5a('0x41')]);return _0x578d89[_0x7b5a('0x4c')](_0x4a31ff);}})[_0x7b5a('0x26')](function(_0x542583){if(_0x542583){_0x14479b=_0x542583[_0x7b5a('0x39')];if(!_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x3a')]('nolimit')){_0x4a31ff[_0x7b5a('0x21')]=qs[_0x7b5a('0x21')](_0x2ecd02[_0x7b5a('0x36')]['limit']);_0x4a31ff[_0x7b5a('0x1e')]=qs[_0x7b5a('0x1e')](_0x2ecd02[_0x7b5a('0x36')][_0x7b5a('0x1e')]);}return _0x578d89[_0x7b5a('0x4c')](_0x4a31ff);}})[_0x7b5a('0x26')](function(_0x258ca7){if(_0x258ca7){return _0x258ca7?{'count':_0x14479b,'rows':_0x258ca7}:null;}})[_0x7b5a('0x26')](respondWithResult(_0x31e713,null))[_0x7b5a('0x45')](handleError(_0x31e713,null));};exports[_0x7b5a('0x50')]=function(_0x49e1bb,_0x50c08e,_0x51f089){if(_0x49e1bb[_0x7b5a('0x4b')]['id']){delete _0x49e1bb[_0x7b5a('0x4b')]['id'];}return db[_0x7b5a('0x2e')]['findOne']({'where':{'id':_0x49e1bb[_0x7b5a('0x47')]['id']}})[_0x7b5a('0x26')](handleEntityNotFound(_0x50c08e,null))[_0x7b5a('0x26')](function(_0x1f5a16){if(_0x1f5a16){_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x51')]=_0x1f5a16['id'];_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x52')]=integrations[_0x7b5a('0x53')](_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x54')],_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x31')]);_0x49e1bb['body'][_0x7b5a('0x55')]=integrations['getDescriptions'](_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x54')],_0x49e1bb[_0x7b5a('0x4b')][_0x7b5a('0x31')]);return db['FreshsalesConfiguration'][_0x7b5a('0x4a')](_0x49e1bb['body'],{'include':[{'model':db[_0x7b5a('0x56')],'as':_0x7b5a('0x52')},{'model':db[_0x7b5a('0x56')],'as':_0x7b5a('0x55')}]});}return null;})[_0x7b5a('0x26')](respondWithResult(_0x50c08e,null))[_0x7b5a('0x45')](handleError(_0x50c08e,null));};exports['getFields']=function(_0x44e6d5,_0x2dac80,_0x76b727){var _0x304e26='';var _0x345a2c='';return db['FreshsalesAccount'][_0x7b5a('0x4d')]({'where':{'id':_0x44e6d5[_0x7b5a('0x47')]['id']},'attributes':['id',_0x7b5a('0x57'),_0x7b5a('0x58'),'apiKey']})[_0x7b5a('0x26')](handleEntityNotFound(_0x2dac80,null))['then'](function(_0x174a54){if(_0x174a54){_0x345a2c=_0x174a54[_0x7b5a('0x57')];_0x304e26=_0x174a54[_0x7b5a('0x58')];var _0x5a0f75=_0x174a54[_0x7b5a('0x58')][_0x7b5a('0x59')](-0x1);if(_0x5a0f75==='/'){_0x304e26=_0x304e26['substring'](0x0,_0x304e26[_0x7b5a('0x5a')](_0x5a0f75));}return rp({'method':'GET','uri':util[_0x7b5a('0x5b')](_0x7b5a('0x5c'),_0x304e26,'/api/selector/owners'),'headers':{'Authorization':_0x7b5a('0x5d')+_0x174a54[_0x7b5a('0x5e')]},'json':!![]});}})[_0x7b5a('0x26')](function(_0x3bfb18){if(_0x3bfb18){var _0x982b5b=_0x3bfb18[_0x7b5a('0x5f')];var _0x1a7c2c=![];var _0x3f7813=null;for(_0x3f7813=0x0;_0x3f7813<_0x982b5b[_0x7b5a('0x39')];_0x3f7813++){if(_0x982b5b[_0x3f7813][_0x7b5a('0x60')]===_0x345a2c){_0x1a7c2c=!![];}}if(_0x1a7c2c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x7b5a('0x61')});}}})[_0x7b5a('0x26')](respondWithResult(_0x2dac80,null))[_0x7b5a('0x45')](function(_0x1cfa0e){var _0x5f5618=_0x44e6d5['query']['test']?0x1f4:_0x1cfa0e[_0x7b5a('0x62')]||0x1f4;logger['error'](_0x7b5a('0x63'),_0x7b5a('0x64'),_0x5f5618,JSON[_0x7b5a('0x65')](_0x1cfa0e));delete _0x1cfa0e[_0x7b5a('0x2a')];if(_0x5f5618===0x191){_0x5f5618=0x190;}_0x2dac80['status'](_0x5f5618)[_0x7b5a('0x2b')](_0x44e6d5[_0x7b5a('0x36')][_0x7b5a('0x66')]?{'message':'Wrong\x20credentials','statusCode':_0x1cfa0e[_0x7b5a('0x62')]}:_0x1cfa0e);});}; \ No newline at end of file +var _0x219b=['reject','update','then','end','error','stack','name','map','FreshsalesAccount','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','options','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','slice','GET','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0xbdc5fa,_0x26e850){var _0x512a71=function(_0x541574){while(--_0x541574){_0xbdc5fa['push'](_0xbdc5fa['shift']());}};_0x512a71(++_0x26e850);}(_0x219b,0x1c5));var _0xb219=function(_0x2c24f0,_0x367860){_0x2c24f0=_0x2c24f0-0x0;var _0x11badf=_0x219b[_0x2c24f0];return _0x11badf;};'use strict';var emlformat=require(_0xb219('0x0'));var rimraf=require(_0xb219('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb219('0x2'));var rp=require(_0xb219('0x3'));var moment=require('moment');var BPromise=require(_0xb219('0x4'));var Mustache=require('mustache');var util=require(_0xb219('0x5'));var path=require(_0xb219('0x6'));var sox=require('sox');var csv=require(_0xb219('0x7'));var ejs=require(_0xb219('0x8'));var fs=require('fs');var fs_extra=require(_0xb219('0x9'));var _=require(_0xb219('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb219('0x7'));var querystring=require(_0xb219('0xb'));var Papa=require('papaparse');var Redis=require(_0xb219('0xc'));var authService=require(_0xb219('0xd'));var qs=require(_0xb219('0xe'));var as=require(_0xb219('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb219('0x10'))(_0xb219('0x11'));var utils=require(_0xb219('0x12'));var config=require(_0xb219('0x13'));var licenseUtil=require(_0xb219('0x14'));var db=require(_0xb219('0x15'))['db'];var integrations=require(_0xb219('0x16'));function respondWithStatusCode(_0x5c28c5,_0x5330db){_0x5330db=_0x5330db||0xcc;return function(_0x4c9eee){if(_0x4c9eee){return _0x5c28c5[_0xb219('0x17')](_0x5330db);}return _0x5c28c5[_0xb219('0x18')](_0x5330db)['end']();};}function respondWithResult(_0x438b58,_0xaaf0d9){_0xaaf0d9=_0xaaf0d9||0xc8;return function(_0x3d7afa){if(_0x3d7afa){return _0x438b58[_0xb219('0x18')](_0xaaf0d9)['json'](_0x3d7afa);}};}function respondWithFilteredResult(_0x3786f4,_0xc08ba7){return function(_0x1ef000){if(_0x1ef000){var _0x218db4=typeof _0xc08ba7[_0xb219('0x19')]==='undefined'&&typeof _0xc08ba7[_0xb219('0x1a')]===_0xb219('0x1b');var _0x24d2cb=_0x1ef000[_0xb219('0x1c')];var _0x597ea7=_0x218db4?0x0:_0xc08ba7[_0xb219('0x19')];var _0x489da9=_0x218db4?_0x1ef000[_0xb219('0x1c')]:_0xc08ba7[_0xb219('0x19')]+_0xc08ba7[_0xb219('0x1a')];var _0x4aaf3c;if(_0x489da9>=_0x24d2cb){_0x489da9=_0x24d2cb;_0x4aaf3c=0xc8;}else{_0x4aaf3c=0xce;}_0x3786f4[_0xb219('0x18')](_0x4aaf3c);return _0x3786f4[_0xb219('0x1d')](_0xb219('0x1e'),_0x597ea7+'-'+_0x489da9+'/'+_0x24d2cb)['json'](_0x1ef000);}return null;};}function patchUpdates(_0x4f841d){return function(_0xd2fa9d){try{jsonpatch[_0xb219('0x1f')](_0xd2fa9d,_0x4f841d,!![]);}catch(_0x9de83f){return BPromise[_0xb219('0x20')](_0x9de83f);}return _0xd2fa9d['save']();};}function saveUpdates(_0x3740d9,_0x3c3dab){return function(_0xd3acb9){if(_0xd3acb9){return _0xd3acb9[_0xb219('0x21')](_0x3740d9)['then'](function(_0x309013){return _0x309013;});}return null;};}function removeEntity(_0x4659c5,_0x37859e){return function(_0xb6dc1c){if(_0xb6dc1c){return _0xb6dc1c['destroy']()[_0xb219('0x22')](function(){_0x4659c5[_0xb219('0x18')](0xcc)[_0xb219('0x23')]();});}};}function handleEntityNotFound(_0x1a63bd,_0x234eea){return function(_0x12ae80){if(!_0x12ae80){_0x1a63bd[_0xb219('0x17')](0x194);}return _0x12ae80;};}function handleError(_0x2c8983,_0x11bb8f){_0x11bb8f=_0x11bb8f||0x1f4;return function(_0x2de490){logger[_0xb219('0x24')](_0x2de490[_0xb219('0x25')]);if(_0x2de490[_0xb219('0x26')]){delete _0x2de490[_0xb219('0x26')];}_0x2c8983[_0xb219('0x18')](_0x11bb8f)['send'](_0x2de490);};}exports['index']=function(_0x1e131f,_0xc44ffb){var _0x348f29={},_0x2733d3={},_0x34ee5e={'count':0x0,'rows':[]};var _0xba00d9=_[_0xb219('0x27')](db[_0xb219('0x28')][_0xb219('0x29')],function(_0xd30ebc){return{'name':_0xd30ebc['fieldName'],'type':_0xd30ebc[_0xb219('0x2a')]['key']};});_0x2733d3[_0xb219('0x2b')]=_['map'](_0xba00d9,_0xb219('0x26'));_0x2733d3[_0xb219('0x2c')]=_[_0xb219('0x2d')](_0x1e131f[_0xb219('0x2c')]);_0x2733d3['filters']=_[_0xb219('0x2e')](_0x2733d3[_0xb219('0x2b')],_0x2733d3[_0xb219('0x2c')]);_0x348f29[_0xb219('0x2f')]=_[_0xb219('0x2e')](_0x2733d3[_0xb219('0x2b')],qs['fields'](_0x1e131f[_0xb219('0x2c')][_0xb219('0x30')]));_0x348f29[_0xb219('0x2f')]=_0x348f29[_0xb219('0x2f')][_0xb219('0x31')]?_0x348f29[_0xb219('0x2f')]:_0x2733d3['model'];if(!_0x1e131f['query'][_0xb219('0x32')](_0xb219('0x33'))){_0x348f29[_0xb219('0x1a')]=qs['limit'](_0x1e131f['query'][_0xb219('0x1a')]);_0x348f29['offset']=qs[_0xb219('0x19')](_0x1e131f['query']['offset']);}_0x348f29[_0xb219('0x34')]=qs['sort'](_0x1e131f['query'][_0xb219('0x35')]);_0x348f29['where']=qs[_0xb219('0x36')](_[_0xb219('0x37')](_0x1e131f[_0xb219('0x2c')],_0x2733d3[_0xb219('0x36')]),_0xba00d9);if(_0x1e131f[_0xb219('0x2c')]['filter']){_0x348f29['where']=_[_0xb219('0x38')](_0x348f29[_0xb219('0x39')],{'$or':_[_0xb219('0x27')](_0xba00d9,function(_0x1c3ef4){if(_0x1c3ef4[_0xb219('0x2a')]!==_0xb219('0x3a')){var _0x582f9c={};_0x582f9c[_0x1c3ef4[_0xb219('0x26')]]={'$like':'%'+_0x1e131f['query'][_0xb219('0x3b')]+'%'};return _0x582f9c;}})});}_0x348f29=_[_0xb219('0x38')]({},_0x348f29,_0x1e131f['options']);var _0x471e02={'where':_0x348f29[_0xb219('0x39')]};return db['FreshsalesAccount']['count'](_0x471e02)['then'](function(_0x1b0dda){_0x34ee5e[_0xb219('0x1c')]=_0x1b0dda;if(_0x1e131f[_0xb219('0x2c')][_0xb219('0x3c')]){_0x348f29[_0xb219('0x3d')]=[{'all':!![]}];}return db[_0xb219('0x28')][_0xb219('0x3e')](_0x348f29);})['then'](function(_0x1fe83c){_0x34ee5e[_0xb219('0x3f')]=_0x1fe83c;return _0x34ee5e;})['then'](respondWithFilteredResult(_0xc44ffb,_0x348f29))['catch'](handleError(_0xc44ffb,null));};exports[_0xb219('0x40')]=function(_0x1b745e,_0x9845fa){var _0x4cedc7={'raw':![],'where':{'id':_0x1b745e[_0xb219('0x41')]['id']}},_0x8a72f7={};_0x8a72f7[_0xb219('0x2b')]=_[_0xb219('0x2d')](db[_0xb219('0x28')]['rawAttributes']);_0x8a72f7[_0xb219('0x2c')]=_['keys'](_0x1b745e[_0xb219('0x2c')]);_0x8a72f7[_0xb219('0x36')]=_[_0xb219('0x2e')](_0x8a72f7[_0xb219('0x2b')],_0x8a72f7[_0xb219('0x2c')]);_0x4cedc7['attributes']=_['intersection'](_0x8a72f7[_0xb219('0x2b')],qs[_0xb219('0x30')](_0x1b745e[_0xb219('0x2c')][_0xb219('0x30')]));_0x4cedc7[_0xb219('0x2f')]=_0x4cedc7[_0xb219('0x2f')][_0xb219('0x31')]?_0x4cedc7[_0xb219('0x2f')]:_0x8a72f7[_0xb219('0x2b')];if(_0x1b745e['query'][_0xb219('0x3c')]){_0x4cedc7[_0xb219('0x3d')]=[{'all':!![]}];}_0x4cedc7=_[_0xb219('0x38')]({},_0x4cedc7,_0x1b745e['options']);return db[_0xb219('0x28')]['find'](_0x4cedc7)[_0xb219('0x22')](handleEntityNotFound(_0x9845fa,null))['then'](respondWithResult(_0x9845fa,null))[_0xb219('0x42')](handleError(_0x9845fa,null));};exports['create']=function(_0x53bd2a,_0x17a361){return db[_0xb219('0x28')][_0xb219('0x43')](_0x53bd2a[_0xb219('0x44')],{})['then'](respondWithResult(_0x17a361,0xc9))[_0xb219('0x42')](handleError(_0x17a361,null));};exports[_0xb219('0x21')]=function(_0x484bfb,_0x55b08b){if(_0x484bfb[_0xb219('0x44')]['id']){delete _0x484bfb[_0xb219('0x44')]['id'];}return db[_0xb219('0x28')]['find']({'where':{'id':_0x484bfb[_0xb219('0x41')]['id']}})[_0xb219('0x22')](handleEntityNotFound(_0x55b08b,null))[_0xb219('0x22')](saveUpdates(_0x484bfb['body'],null))[_0xb219('0x22')](respondWithResult(_0x55b08b,null))['catch'](handleError(_0x55b08b,null));};exports['destroy']=function(_0x180f4c,_0x4ccb3c){return db['FreshsalesAccount'][_0xb219('0x45')]({'where':{'id':_0x180f4c['params']['id']}})[_0xb219('0x22')](handleEntityNotFound(_0x4ccb3c,null))[_0xb219('0x22')](removeEntity(_0x4ccb3c,null))[_0xb219('0x42')](handleError(_0x4ccb3c,null));};exports[_0xb219('0x46')]=function(_0x90db2,_0x4c4876,_0x1a129e){var _0x206544={};var _0x5814e2={};var _0x1ac1d5;var _0x3fe4b9;return db[_0xb219('0x28')]['findOne']({'where':{'id':_0x90db2[_0xb219('0x41')]['id']}})[_0xb219('0x22')](handleEntityNotFound(_0x4c4876,null))[_0xb219('0x22')](function(_0x552c62){if(_0x552c62){_0x1ac1d5=_0x552c62;_0x5814e2['model']=_[_0xb219('0x2d')](db['FreshsalesConfiguration']['rawAttributes']);_0x5814e2['query']=_[_0xb219('0x2d')](_0x90db2[_0xb219('0x2c')]);_0x5814e2[_0xb219('0x36')]=_[_0xb219('0x2e')](_0x5814e2[_0xb219('0x2b')],_0x5814e2[_0xb219('0x2c')]);_0x206544[_0xb219('0x2f')]=_[_0xb219('0x2e')](_0x5814e2['model'],qs['fields'](_0x90db2[_0xb219('0x2c')][_0xb219('0x30')]));_0x206544[_0xb219('0x2f')]=_0x206544[_0xb219('0x2f')][_0xb219('0x31')]?_0x206544[_0xb219('0x2f')]:_0x5814e2[_0xb219('0x2b')];_0x206544[_0xb219('0x34')]=qs[_0xb219('0x35')](_0x90db2['query']['sort']);_0x206544[_0xb219('0x39')]=qs[_0xb219('0x36')](_['pick'](_0x90db2[_0xb219('0x2c')],_0x5814e2[_0xb219('0x36')]));if(_0x90db2['query'][_0xb219('0x3b')]){_0x206544[_0xb219('0x39')]=_[_0xb219('0x38')](_0x206544['where'],{'$or':_[_0xb219('0x27')](_0x206544[_0xb219('0x2f')],function(_0x3178ef){var _0x2bd1ff={};_0x2bd1ff[_0x3178ef]={'$like':'%'+_0x90db2[_0xb219('0x2c')][_0xb219('0x3b')]+'%'};return _0x2bd1ff;})});}_0x206544=_[_0xb219('0x38')]({},_0x206544,_0x90db2[_0xb219('0x47')]);return _0x1ac1d5[_0xb219('0x46')](_0x206544);}})[_0xb219('0x22')](function(_0x28b4fb){if(_0x28b4fb){_0x3fe4b9=_0x28b4fb[_0xb219('0x31')];if(!_0x90db2[_0xb219('0x2c')][_0xb219('0x32')](_0xb219('0x33'))){_0x206544['limit']=qs[_0xb219('0x1a')](_0x90db2['query'][_0xb219('0x1a')]);_0x206544[_0xb219('0x19')]=qs[_0xb219('0x19')](_0x90db2[_0xb219('0x2c')][_0xb219('0x19')]);}return _0x1ac1d5[_0xb219('0x46')](_0x206544);}})[_0xb219('0x22')](function(_0x23d044){if(_0x23d044){return _0x23d044?{'count':_0x3fe4b9,'rows':_0x23d044}:null;}})[_0xb219('0x22')](respondWithResult(_0x4c4876,null))[_0xb219('0x42')](handleError(_0x4c4876,null));};exports[_0xb219('0x48')]=function(_0x5fdd7a,_0x80c4bf,_0x192bbc){if(_0x5fdd7a['body']['id']){delete _0x5fdd7a[_0xb219('0x44')]['id'];}return db[_0xb219('0x28')][_0xb219('0x49')]({'where':{'id':_0x5fdd7a[_0xb219('0x41')]['id']}})['then'](handleEntityNotFound(_0x80c4bf,null))[_0xb219('0x22')](function(_0x45b71b){if(_0x45b71b){_0x5fdd7a[_0xb219('0x44')]['AccountId']=_0x45b71b['id'];_0x5fdd7a[_0xb219('0x44')][_0xb219('0x4a')]=integrations[_0xb219('0x4b')](_0x5fdd7a[_0xb219('0x44')][_0xb219('0x4c')],_0x5fdd7a[_0xb219('0x44')]['type']);_0x5fdd7a['body'][_0xb219('0x4d')]=integrations['getDescriptions'](_0x5fdd7a[_0xb219('0x44')]['channel'],_0x5fdd7a[_0xb219('0x44')][_0xb219('0x2a')]);return db[_0xb219('0x4e')]['create'](_0x5fdd7a['body'],{'include':[{'model':db[_0xb219('0x4f')],'as':_0xb219('0x4a')},{'model':db[_0xb219('0x4f')],'as':_0xb219('0x4d')}]});}return null;})[_0xb219('0x22')](respondWithResult(_0x80c4bf,null))[_0xb219('0x42')](handleError(_0x80c4bf,null));};exports[_0xb219('0x50')]=function(_0x28230e,_0x24deb,_0x4415d5){var _0x1d0433='';var _0x113464='';return db[_0xb219('0x28')]['findOne']({'where':{'id':_0x28230e[_0xb219('0x41')]['id']},'attributes':['id',_0xb219('0x51'),_0xb219('0x52'),'apiKey']})[_0xb219('0x22')](handleEntityNotFound(_0x24deb,null))[_0xb219('0x22')](function(_0x533da8){if(_0x533da8){_0x113464=_0x533da8[_0xb219('0x51')];_0x1d0433=_0x533da8['remoteUri'];var _0x548a26=_0x533da8[_0xb219('0x52')][_0xb219('0x53')](-0x1);if(_0x548a26==='/'){_0x1d0433=_0x1d0433['substring'](0x0,_0x1d0433['lastIndexOf'](_0x548a26));}return rp({'method':_0xb219('0x54'),'uri':util['format'](_0xb219('0x55'),_0x1d0433,_0xb219('0x56')),'headers':{'Authorization':_0xb219('0x57')+_0x533da8[_0xb219('0x58')]},'json':!![]});}})['then'](function(_0x44293c){if(_0x44293c){var _0x2fcd70=_0x44293c[_0xb219('0x59')];var _0x1b1ff8=![];var _0x3f1827=null;for(_0x3f1827=0x0;_0x3f1827<_0x2fcd70[_0xb219('0x31')];_0x3f1827++){if(_0x2fcd70[_0x3f1827][_0xb219('0x5a')]===_0x113464){_0x1b1ff8=!![];}}if(_0x1b1ff8){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xb219('0x5b')});}}})['then'](respondWithResult(_0x24deb,null))[_0xb219('0x42')](function(_0x12dfd8){var _0x3fbb23=_0x28230e[_0xb219('0x2c')][_0xb219('0x5c')]?0x1f4:_0x12dfd8[_0xb219('0x5d')]||0x1f4;logger[_0xb219('0x24')](_0xb219('0x5e'),_0xb219('0x50'),_0x3fbb23,JSON[_0xb219('0x5f')](_0x12dfd8));delete _0x12dfd8[_0xb219('0x26')];if(_0x3fbb23===0x191){_0x3fbb23=0x190;}_0x24deb[_0xb219('0x18')](_0x3fbb23)[_0xb219('0x60')](_0x28230e['query'][_0xb219('0x5c')]?{'message':'Wrong\x20credentials','statusCode':_0x12dfd8[_0xb219('0x5d')]}:_0x12dfd8);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index aa821c2..26ded2e 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 _0x1a37=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define','FreshsalesAccount','lodash','util'];(function(_0x28be72,_0x2b83af){var _0x46c5da=function(_0x312911){while(--_0x312911){_0x28be72['push'](_0x28be72['shift']());}};_0x46c5da(++_0x2b83af);}(_0x1a37,0xb4));var _0x71a3=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x1a37[_0x3de8a4];return _0x4635cf;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var logger=require(_0x71a3('0x2'))(_0x71a3('0x3'));var moment=require(_0x71a3('0x4'));var BPromise=require(_0x71a3('0x5'));var rp=require(_0x71a3('0x6'));var fs=require('fs');var path=require(_0x71a3('0x7'));var rimraf=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x71a3('0xa'));module['exports']=function(_0xd09f7,_0x45050a){return _0xd09f7[_0x71a3('0xb')](_0x71a3('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c60=['exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','bluebird','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x25ae8d,_0x224fc5){var _0x5d7526=function(_0x8664af){while(--_0x8664af){_0x25ae8d['push'](_0x25ae8d['shift']());}};_0x5d7526(++_0x224fc5);}(_0x4c60,0xc1));var _0x04c6=function(_0x5e943e,_0x17541e){_0x5e943e=_0x5e943e-0x0;var _0x1c0402=_0x4c60[_0x5e943e];return _0x1c0402;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var logger=require(_0x04c6('0x2'))(_0x04c6('0x3'));var moment=require('moment');var BPromise=require(_0x04c6('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(_0x04c6('0x5'));var integrations=require(_0x04c6('0x6'));module[_0x04c6('0x7')]=function(_0x12bd5d,_0x2b9041){return _0x12bd5d[_0x04c6('0x8')](_0x04c6('0x9'),attributes,{'tableName':'int_freshsales_accounts','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 150ca60..6f6bc40 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 _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0x35e7b3,_0x19d486){var _0x5d5fe7=function(_0x5a4ad3){while(--_0x5a4ad3){_0x35e7b3['push'](_0x35e7b3['shift']());}};_0x5d5fe7(++_0x19d486);}(_0x0598,0x92));var _0x8059=function(_0x143a8d,_0x1822c6){_0x143a8d=_0x143a8d-0x0;var _0x567986=_0x0598[_0x143a8d];return _0x567986;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file +var _0x0a6b=['find','map','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','then','debug','stringify','catch','ShowFreshsalesAccount'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x2f260e,_0x239e29){_0x2f260e=_0x2f260e-0x0;var _0x5e9222=_0x0a6b[_0x2f260e];return _0x5e9222;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb0a6('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb0a6('0x2'))['db'];var utils=require(_0xb0a6('0x3'));var logger=require(_0xb0a6('0x4'))('rpc');var config=require(_0xb0a6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb0a6('0x6')][_0xb0a6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d2d,_0x11cd5b,_0x24515c){return new BPromise(function(_0x2a8516,_0x530c05){return client['request'](_0x5e2d2d,_0x24515c)['then'](function(_0x2ded05){logger[_0xb0a6('0x8')](_0xb0a6('0x9'),_0x11cd5b,_0xb0a6('0xa'));logger['debug'](_0xb0a6('0xb'),_0x11cd5b,_0xb0a6('0xa'),JSON['stringify'](_0x2ded05));if(_0x2ded05[_0xb0a6('0xc')]){if(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xd')]===0x1f4){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);return _0x530c05(_0x2ded05[_0xb0a6('0xc')][_0xb0a6('0xe')]);}logger[_0xb0a6('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0x2ded05[_0xb0a6('0xc')]['message']);return _0x2a8516(_0x2ded05[_0xb0a6('0xc')]['message']);}else{logger[_0xb0a6('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0x11cd5b,_0xb0a6('0xa'));_0x2a8516(_0x2ded05[_0xb0a6('0xf')][_0xb0a6('0xe')]);}})['catch'](function(_0x56b594){logger[_0xb0a6('0xc')](_0xb0a6('0x9'),_0x11cd5b,_0x56b594);_0x530c05(_0x56b594);});});}exports[_0xb0a6('0x10')]=function(_0x18f994){var _0x10f504=this;return new Promise(function(_0x13a1c8,_0x567dd5){return db[_0xb0a6('0x11')][_0xb0a6('0x12')]({'raw':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x15')]||null:null,'attributes':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'limit':_0x18f994[_0xb0a6('0x13')]?_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x17')]||null:null,'include':_0x18f994[_0xb0a6('0x13')]?_0x18f994['options'][_0xb0a6('0x18')]?_['map'](_0x18f994[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4997df){return{'model':db[_0x4997df['model']],'as':_0x4997df['as'],'attributes':_0x4997df[_0xb0a6('0x16')],'include':_0x4997df[_0xb0a6('0x18')]?_['map'](_0x4997df[_0xb0a6('0x18')],function(_0x24574a){return{'model':db[_0x24574a[_0xb0a6('0x19')]],'as':_0x24574a['as'],'attributes':_0x24574a[_0xb0a6('0x16')],'include':_0x24574a['include']?_['map'](_0x24574a[_0xb0a6('0x18')],function(_0x1e9947){return{'model':db[_0x1e9947[_0xb0a6('0x19')]],'as':_0x1e9947['as'],'attributes':_0x1e9947['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x3347ac){logger[_0xb0a6('0x8')](_0xb0a6('0x10'),_0x18f994);logger[_0xb0a6('0x1b')](_0xb0a6('0x10'),_0x18f994,JSON[_0xb0a6('0x1c')](_0x3347ac));_0x13a1c8(_0x3347ac);})[_0xb0a6('0x1d')](function(_0x4255b9){logger['error'](_0xb0a6('0x10'),_0x4255b9[_0xb0a6('0xe')],_0x18f994);_0x567dd5(_0x10f504[_0xb0a6('0xc')](0x1f4,_0x4255b9['message']));});});};exports[_0xb0a6('0x1e')]=function(_0x582fc2){var _0x131e46=this;return new Promise(function(_0x309a91,_0x114f91){return db[_0xb0a6('0x11')][_0xb0a6('0x1f')]({'raw':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x14')]===undefined?!![]:![]:!![],'where':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')]['where']||null:null,'attributes':_0x582fc2['options']?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x16')]||null:null,'include':_0x582fc2[_0xb0a6('0x13')]?_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x582fc2[_0xb0a6('0x13')][_0xb0a6('0x18')],function(_0x4b0479){return{'model':db[_0x4b0479[_0xb0a6('0x19')]],'as':_0x4b0479['as'],'attributes':_0x4b0479[_0xb0a6('0x16')],'include':_0x4b0479['include']?_[_0xb0a6('0x20')](_0x4b0479[_0xb0a6('0x18')],function(_0x52e397){return{'model':db[_0x52e397['model']],'as':_0x52e397['as'],'attributes':_0x52e397[_0xb0a6('0x16')],'include':_0x52e397[_0xb0a6('0x18')]?_[_0xb0a6('0x20')](_0x52e397[_0xb0a6('0x18')],function(_0x4310ae){return{'model':db[_0x4310ae[_0xb0a6('0x19')]],'as':_0x4310ae['as'],'attributes':_0x4310ae['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x1a')](function(_0x5c280e){logger[_0xb0a6('0x8')](_0xb0a6('0x1e'),_0x582fc2);logger['debug']('ShowFreshsalesAccount',_0x582fc2,JSON['stringify'](_0x5c280e));_0x309a91(_0x5c280e);})[_0xb0a6('0x1d')](function(_0xd484f){logger[_0xb0a6('0xc')](_0xb0a6('0x1e'),_0xd484f[_0xb0a6('0xe')],_0x582fc2);_0x114f91(_0x131e46['error'](0x1f4,_0xd484f[_0xb0a6('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 485431f..bf58b5c 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 _0xa6b8=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xa6b8,0x134));var _0x8a6b=function(_0xb359ca,_0x5c3e1a){_0xb359ca=_0xb359ca-0x0;var _0x5ba75f=_0xa6b8[_0xb359ca];return _0x5ba75f;};'use strict';var multer=require(_0x8a6b('0x0'));var util=require(_0x8a6b('0x1'));var path=require('path');var timeout=require(_0x8a6b('0x2'));var express=require(_0x8a6b('0x3'));var router=express[_0x8a6b('0x4')]();var fs_extra=require(_0x8a6b('0x5'));var auth=require(_0x8a6b('0x6'));var interaction=require(_0x8a6b('0x7'));var config=require(_0x8a6b('0x8'));var controller=require(_0x8a6b('0x9'));router[_0x8a6b('0xa')]('/',auth[_0x8a6b('0xb')](),controller[_0x8a6b('0xc')]);router['get'](_0x8a6b('0xd'),auth['isAuthenticated'](),controller[_0x8a6b('0xe')]);router['get'](_0x8a6b('0xf'),auth[_0x8a6b('0xb')](),controller[_0x8a6b('0x10')]);router[_0x8a6b('0xa')](_0x8a6b('0x11'),auth[_0x8a6b('0xb')](),controller[_0x8a6b('0x12')]);router[_0x8a6b('0xa')]('/:id/fields',auth[_0x8a6b('0xb')](),controller['getFields']);router['post']('/',auth[_0x8a6b('0xb')](),controller[_0x8a6b('0x13')]);router[_0x8a6b('0x14')]('/:id',auth[_0x8a6b('0xb')](),controller['update']);router[_0x8a6b('0x15')](_0x8a6b('0xd'),auth[_0x8a6b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x09b5=['/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','/:id/subjects'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x09b5,0x1d8));var _0x509b=function(_0x329f83,_0x15aeac){_0x329f83=_0x329f83-0x0;var _0x5c9cdc=_0x09b5[_0x329f83];return _0x5c9cdc;};'use strict';var multer=require('multer');var util=require(_0x509b('0x0'));var path=require(_0x509b('0x1'));var timeout=require(_0x509b('0x2'));var express=require(_0x509b('0x3'));var router=express['Router']();var fs_extra=require(_0x509b('0x4'));var auth=require(_0x509b('0x5'));var interaction=require(_0x509b('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x509b('0x7')](),controller[_0x509b('0x8')]);router[_0x509b('0x9')](_0x509b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x509b('0x9')](_0x509b('0xb'),auth[_0x509b('0x7')](),controller['getSubjects']);router['get'](_0x509b('0xc'),auth[_0x509b('0x7')](),controller[_0x509b('0xd')]);router[_0x509b('0x9')](_0x509b('0xe'),auth[_0x509b('0x7')](),controller[_0x509b('0xf')]);router[_0x509b('0x10')]('/',auth[_0x509b('0x7')](),controller[_0x509b('0x11')]);router[_0x509b('0x12')](_0x509b('0xa'),auth['isAuthenticated'](),controller[_0x509b('0x13')]);router[_0x509b('0x14')](_0x509b('0xa'),auth[_0x509b('0x7')](),controller[_0x509b('0x15')]);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 1026fb3..e39def5 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 _0xb844=['STRING'];(function(_0x194914,_0x44f87b){var _0x122e0d=function(_0x321dd5){while(--_0x321dd5){_0x194914['push'](_0x194914['shift']());}};_0x122e0d(++_0x44f87b);}(_0xb844,0x136));var _0x4b84=function(_0x5aed19,_0x24d8a7){_0x5aed19=_0x5aed19-0x0;var _0x311ecd=_0xb844[_0x5aed19];return _0x311ecd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4b84('0x0')]}}; \ No newline at end of file +var _0xd552=['STRING'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0xd552,0xdc));var _0x2d55=function(_0x37417f,_0x3d7161){_0x37417f=_0x37417f-0x0;var _0x467c89=_0xd552[_0x37417f];return _0x467c89;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2d55('0x0')]},'description':{'type':Sequelize[_0x2d55('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 6757784..b1a1073 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 _0xc7e4=['order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','catch','create','body','find','destroy','getSubjects','findOne','options','hasOwnProperty','getDescriptions','FreshsalesField','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','nolimit'];(function(_0x251fde,_0x384469){var _0x350af6=function(_0x15a6a3){while(--_0x15a6a3){_0x251fde['push'](_0x251fde['shift']());}};_0x350af6(++_0x384469);}(_0xc7e4,0x1b2));var _0x4c7e=function(_0x5f0a85,_0x517151){_0x5f0a85=_0x5f0a85-0x0;var _0x3ccda7=_0xc7e4[_0x5f0a85];return _0x3ccda7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c7e('0x0'));var zipdir=require(_0x4c7e('0x1'));var jsonpatch=require(_0x4c7e('0x2'));var rp=require(_0x4c7e('0x3'));var moment=require(_0x4c7e('0x4'));var BPromise=require(_0x4c7e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4c7e('0x6'));var sox=require('sox');var csv=require(_0x4c7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c7e('0x8'));var _=require(_0x4c7e('0x9'));var squel=require('squel');var crypto=require(_0x4c7e('0xa'));var jsforce=require(_0x4c7e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4c7e('0x7'));var querystring=require('querystring');var Papa=require(_0x4c7e('0xc'));var Redis=require(_0x4c7e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4c7e('0xe'));var as=require(_0x4c7e('0xf'));var hardwareService=require(_0x4c7e('0x10'));var logger=require(_0x4c7e('0x11'))(_0x4c7e('0x12'));var utils=require(_0x4c7e('0x13'));var config=require(_0x4c7e('0x14'));var licenseUtil=require(_0x4c7e('0x15'));var db=require(_0x4c7e('0x16'))['db'];function respondWithStatusCode(_0xd8f722,_0x5326f3){_0x5326f3=_0x5326f3||0xcc;return function(_0x21116a){if(_0x21116a){return _0xd8f722[_0x4c7e('0x17')](_0x5326f3);}return _0xd8f722[_0x4c7e('0x18')](_0x5326f3)['end']();};}function respondWithResult(_0x367200,_0x49ba2a){_0x49ba2a=_0x49ba2a||0xc8;return function(_0x32138e){if(_0x32138e){return _0x367200[_0x4c7e('0x18')](_0x49ba2a)['json'](_0x32138e);}};}function respondWithFilteredResult(_0x559902,_0x5912d5){return function(_0x56d728){if(_0x56d728){var _0x2f2da1=typeof _0x5912d5[_0x4c7e('0x19')]===_0x4c7e('0x1a')&&typeof _0x5912d5[_0x4c7e('0x1b')]===_0x4c7e('0x1a');var _0x55ed89=_0x56d728[_0x4c7e('0x1c')];var _0x5571da=_0x2f2da1?0x0:_0x5912d5[_0x4c7e('0x19')];var _0x15753e=_0x2f2da1?_0x56d728[_0x4c7e('0x1c')]:_0x5912d5[_0x4c7e('0x19')]+_0x5912d5[_0x4c7e('0x1b')];var _0x432633;if(_0x15753e>=_0x55ed89){_0x15753e=_0x55ed89;_0x432633=0xc8;}else{_0x432633=0xce;}_0x559902[_0x4c7e('0x18')](_0x432633);return _0x559902[_0x4c7e('0x1d')](_0x4c7e('0x1e'),_0x5571da+'-'+_0x15753e+'/'+_0x55ed89)[_0x4c7e('0x1f')](_0x56d728);}return null;};}function patchUpdates(_0x521c85){return function(_0x4b09a9){try{jsonpatch[_0x4c7e('0x20')](_0x4b09a9,_0x521c85,!![]);}catch(_0x191c3f){return BPromise[_0x4c7e('0x21')](_0x191c3f);}return _0x4b09a9[_0x4c7e('0x22')]();};}function saveUpdates(_0x18dcf6,_0x5b77b3){return function(_0x14bf86){if(_0x14bf86){return _0x14bf86[_0x4c7e('0x23')](_0x18dcf6)['then'](function(_0x302ae9){return _0x302ae9;});}return null;};}function removeEntity(_0x270d9c,_0x1b0199){return function(_0x2ac5bb){if(_0x2ac5bb){return _0x2ac5bb['destroy']()[_0x4c7e('0x24')](function(){_0x270d9c[_0x4c7e('0x18')](0xcc)[_0x4c7e('0x25')]();});}};}function handleEntityNotFound(_0x106a9f,_0xbce75e){return function(_0x333f5d){if(!_0x333f5d){_0x106a9f['sendStatus'](0x194);}return _0x333f5d;};}function handleError(_0x2fda76,_0x1dbf38){_0x1dbf38=_0x1dbf38||0x1f4;return function(_0x2ef280){logger[_0x4c7e('0x26')](_0x2ef280[_0x4c7e('0x27')]);if(_0x2ef280['name']){delete _0x2ef280[_0x4c7e('0x28')];}_0x2fda76[_0x4c7e('0x18')](_0x1dbf38)[_0x4c7e('0x29')](_0x2ef280);};}exports[_0x4c7e('0x2a')]=function(_0x3f0a95,_0x268aa7){var _0x269985={},_0x2d2b62={},_0x5b0bc5={'count':0x0,'rows':[]};var _0x176c49=_[_0x4c7e('0x2b')](db[_0x4c7e('0x2c')][_0x4c7e('0x2d')],function(_0x2eff0b){return{'name':_0x2eff0b[_0x4c7e('0x2e')],'type':_0x2eff0b[_0x4c7e('0x2f')][_0x4c7e('0x30')]};});_0x2d2b62[_0x4c7e('0x31')]=_['map'](_0x176c49,_0x4c7e('0x28'));_0x2d2b62['query']=_[_0x4c7e('0x32')](_0x3f0a95['query']);_0x2d2b62[_0x4c7e('0x33')]=_[_0x4c7e('0x34')](_0x2d2b62[_0x4c7e('0x31')],_0x2d2b62[_0x4c7e('0x35')]);_0x269985['attributes']=_[_0x4c7e('0x34')](_0x2d2b62[_0x4c7e('0x31')],qs[_0x4c7e('0x36')](_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x36')]));_0x269985['attributes']=_0x269985[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x269985[_0x4c7e('0x37')]:_0x2d2b62[_0x4c7e('0x31')];if(!_0x3f0a95[_0x4c7e('0x35')]['hasOwnProperty'](_0x4c7e('0x39'))){_0x269985[_0x4c7e('0x1b')]=qs[_0x4c7e('0x1b')](_0x3f0a95['query']['limit']);_0x269985['offset']=qs['offset'](_0x3f0a95['query'][_0x4c7e('0x19')]);}_0x269985[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x3b')]);_0x269985[_0x4c7e('0x3c')]=qs[_0x4c7e('0x33')](_[_0x4c7e('0x3d')](_0x3f0a95['query'],_0x2d2b62[_0x4c7e('0x33')]),_0x176c49);if(_0x3f0a95[_0x4c7e('0x35')]['filter']){_0x269985[_0x4c7e('0x3c')]=_[_0x4c7e('0x3e')](_0x269985[_0x4c7e('0x3c')],{'$or':_['map'](_0x176c49,function(_0xa83a24){if(_0xa83a24[_0x4c7e('0x2f')]!==_0x4c7e('0x3f')){var _0x2405fc={};_0x2405fc[_0xa83a24[_0x4c7e('0x28')]]={'$like':'%'+_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x40')]+'%'};return _0x2405fc;}})});}_0x269985=_[_0x4c7e('0x3e')]({},_0x269985,_0x3f0a95['options']);var _0x3be4c5={'where':_0x269985['where']};return db[_0x4c7e('0x2c')][_0x4c7e('0x1c')](_0x3be4c5)[_0x4c7e('0x24')](function(_0x35d384){_0x5b0bc5[_0x4c7e('0x1c')]=_0x35d384;if(_0x3f0a95[_0x4c7e('0x35')][_0x4c7e('0x41')]){_0x269985[_0x4c7e('0x42')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x269985);})[_0x4c7e('0x24')](function(_0x9854ec){_0x5b0bc5[_0x4c7e('0x43')]=_0x9854ec;return _0x5b0bc5;})[_0x4c7e('0x24')](respondWithFilteredResult(_0x268aa7,_0x269985))['catch'](handleError(_0x268aa7,null));};exports[_0x4c7e('0x44')]=function(_0x3a7250,_0x3f3647){var _0x167484={'raw':![],'where':{'id':_0x3a7250[_0x4c7e('0x45')]['id']}},_0x4272bc={};_0x4272bc['model']=_[_0x4c7e('0x32')](db['FreshsalesConfiguration']['rawAttributes']);_0x4272bc[_0x4c7e('0x35')]=_[_0x4c7e('0x32')](_0x3a7250[_0x4c7e('0x35')]);_0x4272bc[_0x4c7e('0x33')]=_['intersection'](_0x4272bc[_0x4c7e('0x31')],_0x4272bc['query']);_0x167484[_0x4c7e('0x37')]=_[_0x4c7e('0x34')](_0x4272bc['model'],qs[_0x4c7e('0x36')](_0x3a7250[_0x4c7e('0x35')][_0x4c7e('0x36')]));_0x167484[_0x4c7e('0x37')]=_0x167484[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x167484[_0x4c7e('0x37')]:_0x4272bc[_0x4c7e('0x31')];if(_0x3a7250['query'][_0x4c7e('0x41')]){_0x167484[_0x4c7e('0x42')]=[{'all':!![]}];}_0x167484=_[_0x4c7e('0x3e')]({},_0x167484,_0x3a7250['options']);return db['FreshsalesConfiguration']['find'](_0x167484)[_0x4c7e('0x24')](handleEntityNotFound(_0x3f3647,null))['then'](respondWithResult(_0x3f3647,null))[_0x4c7e('0x46')](handleError(_0x3f3647,null));};exports[_0x4c7e('0x47')]=function(_0x41bd95,_0x337b77){return db[_0x4c7e('0x2c')][_0x4c7e('0x47')](_0x41bd95[_0x4c7e('0x48')],{})[_0x4c7e('0x24')](respondWithResult(_0x337b77,0xc9))[_0x4c7e('0x46')](handleError(_0x337b77,null));};exports[_0x4c7e('0x23')]=function(_0x555854,_0x3132a0){if(_0x555854[_0x4c7e('0x48')]['id']){delete _0x555854['body']['id'];}return db[_0x4c7e('0x2c')][_0x4c7e('0x49')]({'where':{'id':_0x555854['params']['id']}})[_0x4c7e('0x24')](handleEntityNotFound(_0x3132a0,null))['then'](saveUpdates(_0x555854[_0x4c7e('0x48')],null))[_0x4c7e('0x24')](respondWithResult(_0x3132a0,null))[_0x4c7e('0x46')](handleError(_0x3132a0,null));};exports[_0x4c7e('0x4a')]=function(_0x1c6aa0,_0x1032f2){return db[_0x4c7e('0x2c')]['find']({'where':{'id':_0x1c6aa0['params']['id']}})[_0x4c7e('0x24')](handleEntityNotFound(_0x1032f2,null))[_0x4c7e('0x24')](removeEntity(_0x1032f2,null))['catch'](handleError(_0x1032f2,null));};exports[_0x4c7e('0x4b')]=function(_0x36bd73,_0x303c40,_0x535775){var _0x22789c={};var _0x389246={};var _0x28f0ea;var _0x11941f;return db['FreshsalesConfiguration'][_0x4c7e('0x4c')]({'where':{'id':_0x36bd73[_0x4c7e('0x45')]['id']}})[_0x4c7e('0x24')](handleEntityNotFound(_0x303c40,null))[_0x4c7e('0x24')](function(_0x590134){if(_0x590134){_0x28f0ea=_0x590134;_0x389246[_0x4c7e('0x31')]=_[_0x4c7e('0x32')](db['FreshsalesField'][_0x4c7e('0x2d')]);_0x389246['query']=_[_0x4c7e('0x32')](_0x36bd73[_0x4c7e('0x35')]);_0x389246[_0x4c7e('0x33')]=_[_0x4c7e('0x34')](_0x389246[_0x4c7e('0x31')],_0x389246[_0x4c7e('0x35')]);_0x22789c[_0x4c7e('0x37')]=_['intersection'](_0x389246[_0x4c7e('0x31')],qs[_0x4c7e('0x36')](_0x36bd73[_0x4c7e('0x35')]['fields']));_0x22789c['attributes']=_0x22789c[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x22789c[_0x4c7e('0x37')]:_0x389246[_0x4c7e('0x31')];_0x22789c[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x36bd73[_0x4c7e('0x35')][_0x4c7e('0x3b')]);_0x22789c[_0x4c7e('0x3c')]=qs[_0x4c7e('0x33')](_[_0x4c7e('0x3d')](_0x36bd73['query'],_0x389246[_0x4c7e('0x33')]));if(_0x36bd73[_0x4c7e('0x35')][_0x4c7e('0x40')]){_0x22789c[_0x4c7e('0x3c')]=_['merge'](_0x22789c[_0x4c7e('0x3c')],{'$or':_[_0x4c7e('0x2b')](_0x22789c[_0x4c7e('0x37')],function(_0x53ce68){var _0x470c3e={};_0x470c3e[_0x53ce68]={'$like':'%'+_0x36bd73['query'][_0x4c7e('0x40')]+'%'};return _0x470c3e;})});}_0x22789c=_[_0x4c7e('0x3e')]({},_0x22789c,_0x36bd73[_0x4c7e('0x4d')]);return _0x28f0ea[_0x4c7e('0x4b')](_0x22789c);}})[_0x4c7e('0x24')](function(_0x43e937){if(_0x43e937){_0x11941f=_0x43e937[_0x4c7e('0x38')];if(!_0x36bd73['query'][_0x4c7e('0x4e')](_0x4c7e('0x39'))){_0x22789c['limit']=qs['limit'](_0x36bd73[_0x4c7e('0x35')][_0x4c7e('0x1b')]);_0x22789c[_0x4c7e('0x19')]=qs['offset'](_0x36bd73[_0x4c7e('0x35')]['offset']);}return _0x28f0ea[_0x4c7e('0x4b')](_0x22789c);}})[_0x4c7e('0x24')](function(_0x9ffa54){if(_0x9ffa54){return _0x9ffa54?{'count':_0x11941f,'rows':_0x9ffa54}:null;}})[_0x4c7e('0x24')](respondWithResult(_0x303c40,null))[_0x4c7e('0x46')](handleError(_0x303c40,null));};exports[_0x4c7e('0x4f')]=function(_0x9532dd,_0x2a5dfb,_0x1ce589){var _0x19c191={};var _0x2a705e={};var _0x5d70a2;var _0x192565;return db[_0x4c7e('0x2c')][_0x4c7e('0x4c')]({'where':{'id':_0x9532dd[_0x4c7e('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a5dfb,null))[_0x4c7e('0x24')](function(_0x1720c6){if(_0x1720c6){_0x5d70a2=_0x1720c6;_0x2a705e[_0x4c7e('0x31')]=_[_0x4c7e('0x32')](db[_0x4c7e('0x50')][_0x4c7e('0x2d')]);_0x2a705e[_0x4c7e('0x35')]=_[_0x4c7e('0x32')](_0x9532dd[_0x4c7e('0x35')]);_0x2a705e[_0x4c7e('0x33')]=_['intersection'](_0x2a705e[_0x4c7e('0x31')],_0x2a705e['query']);_0x19c191[_0x4c7e('0x37')]=_[_0x4c7e('0x34')](_0x2a705e['model'],qs[_0x4c7e('0x36')](_0x9532dd[_0x4c7e('0x35')]['fields']));_0x19c191[_0x4c7e('0x37')]=_0x19c191['attributes'][_0x4c7e('0x38')]?_0x19c191[_0x4c7e('0x37')]:_0x2a705e[_0x4c7e('0x31')];_0x19c191[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x3b')]);_0x19c191[_0x4c7e('0x3c')]=qs['filters'](_[_0x4c7e('0x3d')](_0x9532dd[_0x4c7e('0x35')],_0x2a705e[_0x4c7e('0x33')]));if(_0x9532dd['query'][_0x4c7e('0x40')]){_0x19c191[_0x4c7e('0x3c')]=_['merge'](_0x19c191['where'],{'$or':_[_0x4c7e('0x2b')](_0x19c191['attributes'],function(_0x317213){var _0x3d1f67={};_0x3d1f67[_0x317213]={'$like':'%'+_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x40')]+'%'};return _0x3d1f67;})});}_0x19c191=_['merge']({},_0x19c191,_0x9532dd[_0x4c7e('0x4d')]);return _0x5d70a2[_0x4c7e('0x4f')](_0x19c191);}})['then'](function(_0x457709){if(_0x457709){_0x192565=_0x457709[_0x4c7e('0x38')];if(!_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x4e')](_0x4c7e('0x39'))){_0x19c191[_0x4c7e('0x1b')]=qs[_0x4c7e('0x1b')](_0x9532dd['query'][_0x4c7e('0x1b')]);_0x19c191[_0x4c7e('0x19')]=qs[_0x4c7e('0x19')](_0x9532dd[_0x4c7e('0x35')][_0x4c7e('0x19')]);}return _0x5d70a2['getDescriptions'](_0x19c191);}})[_0x4c7e('0x24')](function(_0x4a997f){if(_0x4a997f){return _0x4a997f?{'count':_0x192565,'rows':_0x4a997f}:null;}})[_0x4c7e('0x24')](respondWithResult(_0x2a5dfb,null))[_0x4c7e('0x46')](handleError(_0x2a5dfb,null));};exports['getFields']=function(_0x3e7bcb,_0x4983bf,_0x5a3ef8){var _0x1a14c9={};var _0x2dc692={};var _0x2f71a2;var _0x2bf27e;return db[_0x4c7e('0x2c')]['findOne']({'where':{'id':_0x3e7bcb['params']['id']}})['then'](handleEntityNotFound(_0x4983bf,null))['then'](function(_0x594207){if(_0x594207){_0x2f71a2=_0x594207;_0x2dc692['model']=_[_0x4c7e('0x32')](db[_0x4c7e('0x50')][_0x4c7e('0x2d')]);_0x2dc692[_0x4c7e('0x35')]=_[_0x4c7e('0x32')](_0x3e7bcb[_0x4c7e('0x35')]);_0x2dc692[_0x4c7e('0x33')]=_[_0x4c7e('0x34')](_0x2dc692[_0x4c7e('0x31')],_0x2dc692[_0x4c7e('0x35')]);_0x1a14c9[_0x4c7e('0x37')]=_['intersection'](_0x2dc692[_0x4c7e('0x31')],qs[_0x4c7e('0x36')](_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x36')]));_0x1a14c9['attributes']=_0x1a14c9[_0x4c7e('0x37')][_0x4c7e('0x38')]?_0x1a14c9[_0x4c7e('0x37')]:_0x2dc692['model'];_0x1a14c9[_0x4c7e('0x3a')]=qs[_0x4c7e('0x3b')](_0x3e7bcb['query'][_0x4c7e('0x3b')]);_0x1a14c9[_0x4c7e('0x3c')]=qs['filters'](_[_0x4c7e('0x3d')](_0x3e7bcb[_0x4c7e('0x35')],_0x2dc692[_0x4c7e('0x33')]));if(_0x3e7bcb['query'][_0x4c7e('0x40')]){_0x1a14c9[_0x4c7e('0x3c')]=_[_0x4c7e('0x3e')](_0x1a14c9[_0x4c7e('0x3c')],{'$or':_[_0x4c7e('0x2b')](_0x1a14c9[_0x4c7e('0x37')],function(_0x20eec2){var _0x4a30f0={};_0x4a30f0[_0x20eec2]={'$like':'%'+_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x40')]+'%'};return _0x4a30f0;})});}_0x1a14c9=_[_0x4c7e('0x3e')]({},_0x1a14c9,_0x3e7bcb['options']);return _0x2f71a2['getFields'](_0x1a14c9);}})[_0x4c7e('0x24')](function(_0x6bb11){if(_0x6bb11){_0x2bf27e=_0x6bb11['length'];if(!_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x4e')]('nolimit')){_0x1a14c9[_0x4c7e('0x1b')]=qs[_0x4c7e('0x1b')](_0x3e7bcb['query'][_0x4c7e('0x1b')]);_0x1a14c9[_0x4c7e('0x19')]=qs['offset'](_0x3e7bcb[_0x4c7e('0x35')][_0x4c7e('0x19')]);}return _0x2f71a2[_0x4c7e('0x51')](_0x1a14c9);}})['then'](function(_0x165caf){if(_0x165caf){return _0x165caf?{'count':_0x2bf27e,'rows':_0x165caf}:null;}})['then'](respondWithResult(_0x4983bf,null))['catch'](handleError(_0x4983bf,null));}; \ No newline at end of file +var _0xd90d=['fields','length','order','sort','pick','filter','where','merge','type','VIRTUAL','options','FreshsalesConfiguration','includeAll','include','findAll','show','params','keys','find','catch','create','body','getSubjects','findOne','FreshsalesField','hasOwnProperty','nolimit','getDescriptions','getFields','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes'];(function(_0x1b51ea,_0x394fd9){var _0x18bbdc=function(_0x45b83f){while(--_0x45b83f){_0x1b51ea['push'](_0x1b51ea['shift']());}};_0x18bbdc(++_0x394fd9);}(_0xd90d,0x165));var _0xdd90=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd90d[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xdd90('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdd90('0x1'));var rp=require('request-promise');var moment=require(_0xdd90('0x2'));var BPromise=require(_0xdd90('0x3'));var Mustache=require(_0xdd90('0x4'));var util=require(_0xdd90('0x5'));var path=require(_0xdd90('0x6'));var sox=require(_0xdd90('0x7'));var csv=require('to-csv');var ejs=require(_0xdd90('0x8'));var fs=require('fs');var fs_extra=require(_0xdd90('0x9'));var _=require(_0xdd90('0xa'));var squel=require(_0xdd90('0xb'));var crypto=require(_0xdd90('0xc'));var jsforce=require(_0xdd90('0xd'));var deskjs=require(_0xdd90('0xe'));var toCsv=require(_0xdd90('0xf'));var querystring=require('querystring');var Papa=require(_0xdd90('0x10'));var Redis=require(_0xdd90('0x11'));var authService=require(_0xdd90('0x12'));var qs=require(_0xdd90('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd90('0x14'));var logger=require(_0xdd90('0x15'))('api');var utils=require(_0xdd90('0x16'));var config=require(_0xdd90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd90('0x18'))['db'];function respondWithStatusCode(_0x42efce,_0x4ca7fa){_0x4ca7fa=_0x4ca7fa||0xcc;return function(_0x35369d){if(_0x35369d){return _0x42efce[_0xdd90('0x19')](_0x4ca7fa);}return _0x42efce[_0xdd90('0x1a')](_0x4ca7fa)[_0xdd90('0x1b')]();};}function respondWithResult(_0x4ea8dc,_0x40fe7d){_0x40fe7d=_0x40fe7d||0xc8;return function(_0x376d1e){if(_0x376d1e){return _0x4ea8dc[_0xdd90('0x1a')](_0x40fe7d)[_0xdd90('0x1c')](_0x376d1e);}};}function respondWithFilteredResult(_0xc7b932,_0x49035f){return function(_0x4252da){if(_0x4252da){var _0x5e6c0d=typeof _0x49035f['offset']===_0xdd90('0x1d')&&typeof _0x49035f[_0xdd90('0x1e')]===_0xdd90('0x1d');var _0x1265c2=_0x4252da[_0xdd90('0x1f')];var _0x2ab8b4=_0x5e6c0d?0x0:_0x49035f[_0xdd90('0x20')];var _0x1b329c=_0x5e6c0d?_0x4252da[_0xdd90('0x1f')]:_0x49035f[_0xdd90('0x20')]+_0x49035f[_0xdd90('0x1e')];var _0x15adad;if(_0x1b329c>=_0x1265c2){_0x1b329c=_0x1265c2;_0x15adad=0xc8;}else{_0x15adad=0xce;}_0xc7b932[_0xdd90('0x1a')](_0x15adad);return _0xc7b932[_0xdd90('0x21')](_0xdd90('0x22'),_0x2ab8b4+'-'+_0x1b329c+'/'+_0x1265c2)['json'](_0x4252da);}return null;};}function patchUpdates(_0x49f53c){return function(_0x2c2234){try{jsonpatch[_0xdd90('0x23')](_0x2c2234,_0x49f53c,!![]);}catch(_0x8627fd){return BPromise['reject'](_0x8627fd);}return _0x2c2234[_0xdd90('0x24')]();};}function saveUpdates(_0x21b365,_0x4ddcff){return function(_0x181b87){if(_0x181b87){return _0x181b87[_0xdd90('0x25')](_0x21b365)[_0xdd90('0x26')](function(_0x47c59f){return _0x47c59f;});}return null;};}function removeEntity(_0x1d684d,_0xee22d0){return function(_0xc6db4d){if(_0xc6db4d){return _0xc6db4d[_0xdd90('0x27')]()[_0xdd90('0x26')](function(){_0x1d684d[_0xdd90('0x1a')](0xcc)[_0xdd90('0x1b')]();});}};}function handleEntityNotFound(_0x288042,_0x5e2786){return function(_0x2244a4){if(!_0x2244a4){_0x288042['sendStatus'](0x194);}return _0x2244a4;};}function handleError(_0x3161d7,_0x125770){_0x125770=_0x125770||0x1f4;return function(_0x13596e){logger['error'](_0x13596e[_0xdd90('0x28')]);if(_0x13596e['name']){delete _0x13596e[_0xdd90('0x29')];}_0x3161d7['status'](_0x125770)[_0xdd90('0x2a')](_0x13596e);};}exports[_0xdd90('0x2b')]=function(_0x23df41,_0xa18bae){var _0xcda189={},_0xfd499f={},_0x3b28ce={'count':0x0,'rows':[]};var _0x382ad8=_[_0xdd90('0x2c')](db['FreshsalesConfiguration'][_0xdd90('0x2d')],function(_0xbce9b0){return{'name':_0xbce9b0[_0xdd90('0x2e')],'type':_0xbce9b0['type'][_0xdd90('0x2f')]};});_0xfd499f['model']=_['map'](_0x382ad8,'name');_0xfd499f[_0xdd90('0x30')]=_['keys'](_0x23df41[_0xdd90('0x30')]);_0xfd499f[_0xdd90('0x31')]=_[_0xdd90('0x32')](_0xfd499f[_0xdd90('0x33')],_0xfd499f[_0xdd90('0x30')]);_0xcda189[_0xdd90('0x34')]=_[_0xdd90('0x32')](_0xfd499f[_0xdd90('0x33')],qs[_0xdd90('0x35')](_0x23df41[_0xdd90('0x30')][_0xdd90('0x35')]));_0xcda189[_0xdd90('0x34')]=_0xcda189[_0xdd90('0x34')][_0xdd90('0x36')]?_0xcda189['attributes']:_0xfd499f['model'];if(!_0x23df41[_0xdd90('0x30')]['hasOwnProperty']('nolimit')){_0xcda189['limit']=qs[_0xdd90('0x1e')](_0x23df41[_0xdd90('0x30')][_0xdd90('0x1e')]);_0xcda189['offset']=qs[_0xdd90('0x20')](_0x23df41[_0xdd90('0x30')]['offset']);}_0xcda189[_0xdd90('0x37')]=qs['sort'](_0x23df41[_0xdd90('0x30')][_0xdd90('0x38')]);_0xcda189['where']=qs['filters'](_[_0xdd90('0x39')](_0x23df41[_0xdd90('0x30')],_0xfd499f[_0xdd90('0x31')]),_0x382ad8);if(_0x23df41[_0xdd90('0x30')][_0xdd90('0x3a')]){_0xcda189[_0xdd90('0x3b')]=_[_0xdd90('0x3c')](_0xcda189[_0xdd90('0x3b')],{'$or':_[_0xdd90('0x2c')](_0x382ad8,function(_0x4ed71a){if(_0x4ed71a[_0xdd90('0x3d')]!==_0xdd90('0x3e')){var _0x119e82={};_0x119e82[_0x4ed71a[_0xdd90('0x29')]]={'$like':'%'+_0x23df41['query'][_0xdd90('0x3a')]+'%'};return _0x119e82;}})});}_0xcda189=_[_0xdd90('0x3c')]({},_0xcda189,_0x23df41[_0xdd90('0x3f')]);var _0x1174ca={'where':_0xcda189[_0xdd90('0x3b')]};return db[_0xdd90('0x40')][_0xdd90('0x1f')](_0x1174ca)['then'](function(_0x15e79c){_0x3b28ce['count']=_0x15e79c;if(_0x23df41[_0xdd90('0x30')][_0xdd90('0x41')]){_0xcda189[_0xdd90('0x42')]=[{'all':!![]}];}return db[_0xdd90('0x40')][_0xdd90('0x43')](_0xcda189);})[_0xdd90('0x26')](function(_0x14df13){_0x3b28ce['rows']=_0x14df13;return _0x3b28ce;})[_0xdd90('0x26')](respondWithFilteredResult(_0xa18bae,_0xcda189))['catch'](handleError(_0xa18bae,null));};exports[_0xdd90('0x44')]=function(_0x1e7edb,_0x389e9b){var _0x5a46bf={'raw':![],'where':{'id':_0x1e7edb[_0xdd90('0x45')]['id']}},_0x505123={};_0x505123[_0xdd90('0x33')]=_[_0xdd90('0x46')](db[_0xdd90('0x40')][_0xdd90('0x2d')]);_0x505123[_0xdd90('0x30')]=_[_0xdd90('0x46')](_0x1e7edb[_0xdd90('0x30')]);_0x505123['filters']=_[_0xdd90('0x32')](_0x505123[_0xdd90('0x33')],_0x505123[_0xdd90('0x30')]);_0x5a46bf['attributes']=_[_0xdd90('0x32')](_0x505123['model'],qs[_0xdd90('0x35')](_0x1e7edb['query'][_0xdd90('0x35')]));_0x5a46bf['attributes']=_0x5a46bf['attributes'][_0xdd90('0x36')]?_0x5a46bf['attributes']:_0x505123['model'];if(_0x1e7edb[_0xdd90('0x30')][_0xdd90('0x41')]){_0x5a46bf[_0xdd90('0x42')]=[{'all':!![]}];}_0x5a46bf=_[_0xdd90('0x3c')]({},_0x5a46bf,_0x1e7edb['options']);return db[_0xdd90('0x40')][_0xdd90('0x47')](_0x5a46bf)['then'](handleEntityNotFound(_0x389e9b,null))[_0xdd90('0x26')](respondWithResult(_0x389e9b,null))[_0xdd90('0x48')](handleError(_0x389e9b,null));};exports[_0xdd90('0x49')]=function(_0x3c439d,_0x4af7a2){return db[_0xdd90('0x40')][_0xdd90('0x49')](_0x3c439d[_0xdd90('0x4a')],{})[_0xdd90('0x26')](respondWithResult(_0x4af7a2,0xc9))[_0xdd90('0x48')](handleError(_0x4af7a2,null));};exports[_0xdd90('0x25')]=function(_0x3bbf8f,_0x598f69){if(_0x3bbf8f['body']['id']){delete _0x3bbf8f[_0xdd90('0x4a')]['id'];}return db[_0xdd90('0x40')]['find']({'where':{'id':_0x3bbf8f['params']['id']}})[_0xdd90('0x26')](handleEntityNotFound(_0x598f69,null))['then'](saveUpdates(_0x3bbf8f[_0xdd90('0x4a')],null))[_0xdd90('0x26')](respondWithResult(_0x598f69,null))['catch'](handleError(_0x598f69,null));};exports[_0xdd90('0x27')]=function(_0x4fcd36,_0x18636f){return db['FreshsalesConfiguration'][_0xdd90('0x47')]({'where':{'id':_0x4fcd36['params']['id']}})[_0xdd90('0x26')](handleEntityNotFound(_0x18636f,null))[_0xdd90('0x26')](removeEntity(_0x18636f,null))['catch'](handleError(_0x18636f,null));};exports[_0xdd90('0x4b')]=function(_0x1836d2,_0x59092e,_0x57acf8){var _0x3c0ed7={};var _0x32b3c8={};var _0x3f2348;var _0x1bd4da;return db[_0xdd90('0x40')][_0xdd90('0x4c')]({'where':{'id':_0x1836d2[_0xdd90('0x45')]['id']}})[_0xdd90('0x26')](handleEntityNotFound(_0x59092e,null))[_0xdd90('0x26')](function(_0x60f0e5){if(_0x60f0e5){_0x3f2348=_0x60f0e5;_0x32b3c8['model']=_['keys'](db[_0xdd90('0x4d')][_0xdd90('0x2d')]);_0x32b3c8[_0xdd90('0x30')]=_['keys'](_0x1836d2[_0xdd90('0x30')]);_0x32b3c8['filters']=_[_0xdd90('0x32')](_0x32b3c8[_0xdd90('0x33')],_0x32b3c8[_0xdd90('0x30')]);_0x3c0ed7[_0xdd90('0x34')]=_[_0xdd90('0x32')](_0x32b3c8[_0xdd90('0x33')],qs[_0xdd90('0x35')](_0x1836d2[_0xdd90('0x30')][_0xdd90('0x35')]));_0x3c0ed7['attributes']=_0x3c0ed7[_0xdd90('0x34')][_0xdd90('0x36')]?_0x3c0ed7[_0xdd90('0x34')]:_0x32b3c8[_0xdd90('0x33')];_0x3c0ed7[_0xdd90('0x37')]=qs[_0xdd90('0x38')](_0x1836d2[_0xdd90('0x30')]['sort']);_0x3c0ed7[_0xdd90('0x3b')]=qs[_0xdd90('0x31')](_[_0xdd90('0x39')](_0x1836d2[_0xdd90('0x30')],_0x32b3c8[_0xdd90('0x31')]));if(_0x1836d2[_0xdd90('0x30')]['filter']){_0x3c0ed7[_0xdd90('0x3b')]=_['merge'](_0x3c0ed7[_0xdd90('0x3b')],{'$or':_['map'](_0x3c0ed7[_0xdd90('0x34')],function(_0x671179){var _0x189fee={};_0x189fee[_0x671179]={'$like':'%'+_0x1836d2[_0xdd90('0x30')][_0xdd90('0x3a')]+'%'};return _0x189fee;})});}_0x3c0ed7=_[_0xdd90('0x3c')]({},_0x3c0ed7,_0x1836d2[_0xdd90('0x3f')]);return _0x3f2348[_0xdd90('0x4b')](_0x3c0ed7);}})[_0xdd90('0x26')](function(_0x4d402c){if(_0x4d402c){_0x1bd4da=_0x4d402c['length'];if(!_0x1836d2[_0xdd90('0x30')][_0xdd90('0x4e')](_0xdd90('0x4f'))){_0x3c0ed7['limit']=qs[_0xdd90('0x1e')](_0x1836d2['query']['limit']);_0x3c0ed7[_0xdd90('0x20')]=qs[_0xdd90('0x20')](_0x1836d2[_0xdd90('0x30')]['offset']);}return _0x3f2348[_0xdd90('0x4b')](_0x3c0ed7);}})[_0xdd90('0x26')](function(_0x1e0e4c){if(_0x1e0e4c){return _0x1e0e4c?{'count':_0x1bd4da,'rows':_0x1e0e4c}:null;}})[_0xdd90('0x26')](respondWithResult(_0x59092e,null))['catch'](handleError(_0x59092e,null));};exports[_0xdd90('0x50')]=function(_0x401e73,_0x5a8fdb,_0x742deb){var _0x2df0a8={};var _0x45e164={};var _0x34648c;var _0x4db9d9;return db['FreshsalesConfiguration'][_0xdd90('0x4c')]({'where':{'id':_0x401e73[_0xdd90('0x45')]['id']}})[_0xdd90('0x26')](handleEntityNotFound(_0x5a8fdb,null))[_0xdd90('0x26')](function(_0x4e5c30){if(_0x4e5c30){_0x34648c=_0x4e5c30;_0x45e164['model']=_[_0xdd90('0x46')](db[_0xdd90('0x4d')][_0xdd90('0x2d')]);_0x45e164[_0xdd90('0x30')]=_[_0xdd90('0x46')](_0x401e73['query']);_0x45e164[_0xdd90('0x31')]=_[_0xdd90('0x32')](_0x45e164[_0xdd90('0x33')],_0x45e164['query']);_0x2df0a8[_0xdd90('0x34')]=_[_0xdd90('0x32')](_0x45e164[_0xdd90('0x33')],qs['fields'](_0x401e73['query'][_0xdd90('0x35')]));_0x2df0a8['attributes']=_0x2df0a8[_0xdd90('0x34')][_0xdd90('0x36')]?_0x2df0a8[_0xdd90('0x34')]:_0x45e164['model'];_0x2df0a8[_0xdd90('0x37')]=qs[_0xdd90('0x38')](_0x401e73['query'][_0xdd90('0x38')]);_0x2df0a8[_0xdd90('0x3b')]=qs[_0xdd90('0x31')](_[_0xdd90('0x39')](_0x401e73[_0xdd90('0x30')],_0x45e164[_0xdd90('0x31')]));if(_0x401e73[_0xdd90('0x30')][_0xdd90('0x3a')]){_0x2df0a8[_0xdd90('0x3b')]=_['merge'](_0x2df0a8[_0xdd90('0x3b')],{'$or':_[_0xdd90('0x2c')](_0x2df0a8[_0xdd90('0x34')],function(_0x310043){var _0x698854={};_0x698854[_0x310043]={'$like':'%'+_0x401e73[_0xdd90('0x30')][_0xdd90('0x3a')]+'%'};return _0x698854;})});}_0x2df0a8=_[_0xdd90('0x3c')]({},_0x2df0a8,_0x401e73[_0xdd90('0x3f')]);return _0x34648c[_0xdd90('0x50')](_0x2df0a8);}})[_0xdd90('0x26')](function(_0x27c11c){if(_0x27c11c){_0x4db9d9=_0x27c11c['length'];if(!_0x401e73[_0xdd90('0x30')]['hasOwnProperty'](_0xdd90('0x4f'))){_0x2df0a8[_0xdd90('0x1e')]=qs[_0xdd90('0x1e')](_0x401e73[_0xdd90('0x30')]['limit']);_0x2df0a8['offset']=qs[_0xdd90('0x20')](_0x401e73['query']['offset']);}return _0x34648c[_0xdd90('0x50')](_0x2df0a8);}})[_0xdd90('0x26')](function(_0x588ed4){if(_0x588ed4){return _0x588ed4?{'count':_0x4db9d9,'rows':_0x588ed4}:null;}})[_0xdd90('0x26')](respondWithResult(_0x5a8fdb,null))[_0xdd90('0x48')](handleError(_0x5a8fdb,null));};exports[_0xdd90('0x51')]=function(_0x2039fc,_0x248340,_0x3d74f7){var _0x4812bf={};var _0x156af4={};var _0x40da01;var _0x247cdb;return db[_0xdd90('0x40')][_0xdd90('0x4c')]({'where':{'id':_0x2039fc[_0xdd90('0x45')]['id']}})[_0xdd90('0x26')](handleEntityNotFound(_0x248340,null))[_0xdd90('0x26')](function(_0x4dd534){if(_0x4dd534){_0x40da01=_0x4dd534;_0x156af4[_0xdd90('0x33')]=_[_0xdd90('0x46')](db[_0xdd90('0x4d')][_0xdd90('0x2d')]);_0x156af4[_0xdd90('0x30')]=_[_0xdd90('0x46')](_0x2039fc['query']);_0x156af4[_0xdd90('0x31')]=_['intersection'](_0x156af4['model'],_0x156af4[_0xdd90('0x30')]);_0x4812bf[_0xdd90('0x34')]=_[_0xdd90('0x32')](_0x156af4[_0xdd90('0x33')],qs[_0xdd90('0x35')](_0x2039fc[_0xdd90('0x30')][_0xdd90('0x35')]));_0x4812bf['attributes']=_0x4812bf[_0xdd90('0x34')][_0xdd90('0x36')]?_0x4812bf['attributes']:_0x156af4['model'];_0x4812bf['order']=qs['sort'](_0x2039fc[_0xdd90('0x30')][_0xdd90('0x38')]);_0x4812bf[_0xdd90('0x3b')]=qs[_0xdd90('0x31')](_[_0xdd90('0x39')](_0x2039fc[_0xdd90('0x30')],_0x156af4[_0xdd90('0x31')]));if(_0x2039fc[_0xdd90('0x30')][_0xdd90('0x3a')]){_0x4812bf[_0xdd90('0x3b')]=_[_0xdd90('0x3c')](_0x4812bf['where'],{'$or':_[_0xdd90('0x2c')](_0x4812bf[_0xdd90('0x34')],function(_0x98227a){var _0x355ee8={};_0x355ee8[_0x98227a]={'$like':'%'+_0x2039fc[_0xdd90('0x30')][_0xdd90('0x3a')]+'%'};return _0x355ee8;})});}_0x4812bf=_[_0xdd90('0x3c')]({},_0x4812bf,_0x2039fc['options']);return _0x40da01[_0xdd90('0x51')](_0x4812bf);}})[_0xdd90('0x26')](function(_0x48aa72){if(_0x48aa72){_0x247cdb=_0x48aa72[_0xdd90('0x36')];if(!_0x2039fc[_0xdd90('0x30')][_0xdd90('0x4e')](_0xdd90('0x4f'))){_0x4812bf[_0xdd90('0x1e')]=qs[_0xdd90('0x1e')](_0x2039fc['query']['limit']);_0x4812bf['offset']=qs[_0xdd90('0x20')](_0x2039fc[_0xdd90('0x30')][_0xdd90('0x20')]);}return _0x40da01[_0xdd90('0x51')](_0x4812bf);}})[_0xdd90('0x26')](function(_0x2f86cb){if(_0x2f86cb){return _0x2f86cb?{'count':_0x247cdb,'rows':_0x2f86cb}:null;}})[_0xdd90('0x26')](respondWithResult(_0x248340,null))['catch'](handleError(_0x248340,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 3790a0a..6c61d5c 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 _0x0723=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api'];(function(_0x10e2cd,_0x10cbfd){var _0x149683=function(_0x47b1a5){while(--_0x47b1a5){_0x10e2cd['push'](_0x10e2cd['shift']());}};_0x149683(++_0x10cbfd);}(_0x0723,0x1d8));var _0x3072=function(_0x30121e,_0x240c86){_0x30121e=_0x30121e-0x0;var _0x4ba328=_0x0723[_0x30121e];return _0x4ba328;};'use strict';var _=require(_0x3072('0x0'));var util=require(_0x3072('0x1'));var logger=require(_0x3072('0x2'))(_0x3072('0x3'));var moment=require(_0x3072('0x4'));var BPromise=require(_0x3072('0x5'));var rp=require(_0x3072('0x6'));var fs=require('fs');var path=require(_0x3072('0x7'));var rimraf=require(_0x3072('0x8'));var config=require(_0x3072('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x3072('0xa')]=function(_0x4acbd3,_0x1a0408){return _0x4acbd3[_0x3072('0xb')](_0x3072('0xc'),attributes,{'tableName':_0x3072('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1341=['FreshsalesConfiguration','lodash','api','moment','bluebird','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x66b470,_0x3a5fb3){var _0x60849d=function(_0x59c8ab){while(--_0x59c8ab){_0x66b470['push'](_0x66b470['shift']());}};_0x60849d(++_0x3a5fb3);}(_0x1341,0xbe));var _0x1134=function(_0x176068,_0x9e2b4e){_0x176068=_0x176068-0x0;var _0x2ef693=_0x1341[_0x176068];return _0x2ef693;};'use strict';var _=require(_0x1134('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1134('0x1'));var moment=require(_0x1134('0x2'));var BPromise=require(_0x1134('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1134('0x4'));var attributes=require(_0x1134('0x5'));module[_0x1134('0x6')]=function(_0x1b4aac,_0x4341ed){return _0x1b4aac[_0x1134('0x7')](_0x1134('0x8'),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 eafb68f..91c7412 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 _0x0c44=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x3c47bf,_0x5befe2){var _0x539960=function(_0x43aa56){while(--_0x43aa56){_0x3c47bf['push'](_0x3c47bf['shift']());}};_0x539960(++_0x5befe2);}(_0x0c44,0xa5));var _0x40c4=function(_0x150cdb,_0x4ee053){_0x150cdb=_0x150cdb-0x0;var _0xf802b1=_0x0c44[_0x150cdb];return _0xf802b1;};'use strict';var _=require(_0x40c4('0x0'));var util=require(_0x40c4('0x1'));var moment=require('moment');var BPromise=require(_0x40c4('0x2'));var rs=require(_0x40c4('0x3'));var fs=require('fs');var Redis=require(_0x40c4('0x4'));var db=require(_0x40c4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x40c4('0x6'))(_0x40c4('0x7'));var config=require(_0x40c4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x40c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12ca18,_0x529159,_0x441682){return new BPromise(function(_0x5cc352,_0x2e2e88){return client[_0x40c4('0xa')](_0x12ca18,_0x441682)['then'](function(_0x2178fe){logger[_0x40c4('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x529159,'request\x20sent');logger['debug'](_0x40c4('0xc'),_0x529159,_0x40c4('0xd'),JSON[_0x40c4('0xe')](_0x2178fe));if(_0x2178fe[_0x40c4('0xf')]){if(_0x2178fe[_0x40c4('0xf')][_0x40c4('0x10')]===0x1f4){logger[_0x40c4('0xf')](_0x40c4('0x11'),_0x529159,_0x2178fe[_0x40c4('0xf')][_0x40c4('0x12')]);return _0x2e2e88(_0x2178fe[_0x40c4('0xf')][_0x40c4('0x12')]);}logger[_0x40c4('0xf')](_0x40c4('0x11'),_0x529159,_0x2178fe[_0x40c4('0xf')][_0x40c4('0x12')]);return _0x5cc352(_0x2178fe['error'][_0x40c4('0x12')]);}else{logger[_0x40c4('0xb')](_0x40c4('0x11'),_0x529159,_0x40c4('0xd'));_0x5cc352(_0x2178fe[_0x40c4('0x13')][_0x40c4('0x12')]);}})[_0x40c4('0x14')](function(_0x354fa8){logger[_0x40c4('0xf')](_0x40c4('0x11'),_0x529159,_0x354fa8);_0x2e2e88(_0x354fa8);});});} \ No newline at end of file +var _0xd5a4=['code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5a4,0x12f));var _0x4d5a=function(_0x4a6068,_0x376135){_0x4a6068=_0x4a6068-0x0;var _0x49ede8=_0xd5a4[_0x4a6068];return _0x49ede8;};'use strict';var _=require(_0x4d5a('0x0'));var util=require(_0x4d5a('0x1'));var moment=require(_0x4d5a('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d5a('0x3'));var fs=require('fs');var Redis=require(_0x4d5a('0x4'));var db=require(_0x4d5a('0x5'))['db'];var utils=require(_0x4d5a('0x6'));var logger=require('../../config/logger')(_0x4d5a('0x7'));var config=require('../../config/environment');var jayson=require(_0x4d5a('0x8'));var client=jayson[_0x4d5a('0x9')][_0x4d5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x177af5,_0x2b369b,_0x3ca0f3){return new BPromise(function(_0x12adad,_0x3d6da4){return client[_0x4d5a('0xb')](_0x177af5,_0x3ca0f3)[_0x4d5a('0xc')](function(_0x19cc6a){logger['info'](_0x4d5a('0xd'),_0x2b369b,_0x4d5a('0xe'));logger[_0x4d5a('0xf')](_0x4d5a('0x10'),_0x2b369b,'request\x20sent',JSON[_0x4d5a('0x11')](_0x19cc6a));if(_0x19cc6a[_0x4d5a('0x12')]){if(_0x19cc6a[_0x4d5a('0x12')][_0x4d5a('0x13')]===0x1f4){logger[_0x4d5a('0x12')](_0x4d5a('0xd'),_0x2b369b,_0x19cc6a[_0x4d5a('0x12')][_0x4d5a('0x14')]);return _0x3d6da4(_0x19cc6a[_0x4d5a('0x12')][_0x4d5a('0x14')]);}logger['error'](_0x4d5a('0xd'),_0x2b369b,_0x19cc6a['error'][_0x4d5a('0x14')]);return _0x12adad(_0x19cc6a[_0x4d5a('0x12')][_0x4d5a('0x14')]);}else{logger[_0x4d5a('0x15')](_0x4d5a('0xd'),_0x2b369b,_0x4d5a('0xe'));_0x12adad(_0x19cc6a['result'][_0x4d5a('0x14')]);}})[_0x4d5a('0x16')](function(_0x395dbb){logger[_0x4d5a('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2b369b,_0x395dbb);_0x3d6da4(_0x395dbb);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 8243a36..2a9303d 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 _0x54ef=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','show','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x25ba43,_0x3dc763){var _0x4291d5=function(_0x789032){while(--_0x789032){_0x25ba43['push'](_0x25ba43['shift']());}};_0x4291d5(++_0x3dc763);}(_0x54ef,0x112));var _0xf54e=function(_0x436dda,_0x4f4dff){_0x436dda=_0x436dda-0x0;var _0x4e09f3=_0x54ef[_0x436dda];return _0x4e09f3;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var fs_extra=require(_0xf54e('0x5'));var auth=require(_0xf54e('0x6'));var interaction=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var controller=require(_0xf54e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xf54e('0xa')]);router[_0xf54e('0xb')](_0xf54e('0xc'),auth['isAuthenticated'](),controller[_0xf54e('0xd')]);router['post']('/',auth[_0xf54e('0xe')](),controller[_0xf54e('0xf')]);router['put'](_0xf54e('0xc'),auth[_0xf54e('0xe')](),controller[_0xf54e('0x10')]);router[_0xf54e('0x11')]('/:id',auth[_0xf54e('0xe')](),controller[_0xf54e('0x12')]);module[_0xf54e('0x13')]=router; \ No newline at end of file +var _0xe1f0=['destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','create','update','delete'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x23c8e6,_0x403b50){_0x23c8e6=_0x23c8e6-0x0;var _0x8b72d4=_0xe1f0[_0x23c8e6];return _0x8b72d4;};'use strict';var multer=require('multer');var util=require(_0x0e1f('0x0'));var path=require(_0x0e1f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0e1f('0x2'));var router=express[_0x0e1f('0x3')]();var fs_extra=require(_0x0e1f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0e1f('0x5'));var config=require(_0x0e1f('0x6'));var controller=require(_0x0e1f('0x7'));router['get']('/',auth[_0x0e1f('0x8')](),controller['index']);router[_0x0e1f('0x9')](_0x0e1f('0xa'),auth[_0x0e1f('0x8')](),controller['show']);router['post']('/',auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xb')]);router['put'](_0x0e1f('0xa'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xc')]);router[_0x0e1f('0xd')](_0x0e1f('0xa'),auth[_0x0e1f('0x8')](),controller[_0x0e1f('0xe')]);module[_0x0e1f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index ec42194..ecd4c9e 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 _0x0bae=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x0bae,0xe2));var _0xe0ba=function(_0x3727d3,_0x1bf55c){_0x3727d3=_0x3727d3-0x0;var _0x5a42e0=_0x0bae[_0x3727d3];return _0x5a42e0;};'use strict';var Sequelize=require(_0xe0ba('0x0'));module[_0xe0ba('0x1')]={'type':{'type':Sequelize[_0xe0ba('0x2')](_0xe0ba('0x3'),_0xe0ba('0x4'),_0xe0ba('0x5'),_0xe0ba('0x6'),_0xe0ba('0x7')),'defaultValue':_0xe0ba('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe0ba('0x8')]},'keyType':{'type':Sequelize[_0xe0ba('0x2')](_0xe0ba('0x3'),_0xe0ba('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xe0ba('0x8')]},'idField':{'type':Sequelize[_0xe0ba('0x8')]},'nameField':{'type':Sequelize[_0xe0ba('0x8')]},'customField':{'type':Sequelize[_0xe0ba('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa860=['BOOLEAN','sequelize','exports','ENUM','string','variable','STRING'];(function(_0x122898,_0xe3a772){var _0x1c5b4a=function(_0x48b8b1){while(--_0x48b8b1){_0x122898['push'](_0x122898['shift']());}};_0x1c5b4a(++_0xe3a772);}(_0xa860,0x1d6));var _0x0a86=function(_0x13d580,_0x469a32){_0x13d580=_0x13d580-0x0;var _0x12ed5e=_0xa860[_0x13d580];return _0x12ed5e;};'use strict';var Sequelize=require(_0x0a86('0x0'));module[_0x0a86('0x1')]={'type':{'type':Sequelize[_0x0a86('0x2')](_0x0a86('0x3'),_0x0a86('0x4'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0a86('0x5')]},'key':{'type':Sequelize[_0x0a86('0x5')]},'keyType':{'type':Sequelize[_0x0a86('0x2')](_0x0a86('0x3'),_0x0a86('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0a86('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0a86('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0a86('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 7a430e0..b9e3543 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 _0x2c5a=['Content-Range','apply','reject','save','then','destroy','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','pick','filter','type','VIRTUAL','merge','options','where','includeAll','include','rows','catch','params','create','body','find','zip-dir','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c5a,0x1d7));var _0xa2c5=function(_0x57536d,_0x3cd82d){_0x57536d=_0x57536d-0x0;var _0x10b3e7=_0x2c5a[_0x57536d];return _0x10b3e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa2c5('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2c5('0x1'));var moment=require(_0xa2c5('0x2'));var BPromise=require(_0xa2c5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa2c5('0x4'));var sox=require(_0xa2c5('0x5'));var csv=require(_0xa2c5('0x6'));var ejs=require(_0xa2c5('0x7'));var fs=require('fs');var fs_extra=require(_0xa2c5('0x8'));var _=require(_0xa2c5('0x9'));var squel=require(_0xa2c5('0xa'));var crypto=require('crypto');var jsforce=require(_0xa2c5('0xb'));var deskjs=require(_0xa2c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa2c5('0xd'));var Papa=require(_0xa2c5('0xe'));var Redis=require(_0xa2c5('0xf'));var authService=require(_0xa2c5('0x10'));var qs=require(_0xa2c5('0x11'));var as=require(_0xa2c5('0x12'));var hardwareService=require(_0xa2c5('0x13'));var logger=require(_0xa2c5('0x14'))('api');var utils=require(_0xa2c5('0x15'));var config=require(_0xa2c5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa2c5('0x17'))['db'];function respondWithStatusCode(_0x10b9b4,_0x27815e){_0x27815e=_0x27815e||0xcc;return function(_0xa75507){if(_0xa75507){return _0x10b9b4[_0xa2c5('0x18')](_0x27815e);}return _0x10b9b4[_0xa2c5('0x19')](_0x27815e)[_0xa2c5('0x1a')]();};}function respondWithResult(_0x4197c1,_0x28093b){_0x28093b=_0x28093b||0xc8;return function(_0x46041e){if(_0x46041e){return _0x4197c1['status'](_0x28093b)[_0xa2c5('0x1b')](_0x46041e);}};}function respondWithFilteredResult(_0x16b330,_0x30822d){return function(_0x29591c){if(_0x29591c){var _0x2ef449=typeof _0x30822d[_0xa2c5('0x1c')]===_0xa2c5('0x1d')&&typeof _0x30822d[_0xa2c5('0x1e')]===_0xa2c5('0x1d');var _0x4a81d4=_0x29591c[_0xa2c5('0x1f')];var _0x3fec1d=_0x2ef449?0x0:_0x30822d['offset'];var _0x3d7eba=_0x2ef449?_0x29591c[_0xa2c5('0x1f')]:_0x30822d[_0xa2c5('0x1c')]+_0x30822d[_0xa2c5('0x1e')];var _0x11bd40;if(_0x3d7eba>=_0x4a81d4){_0x3d7eba=_0x4a81d4;_0x11bd40=0xc8;}else{_0x11bd40=0xce;}_0x16b330[_0xa2c5('0x19')](_0x11bd40);return _0x16b330[_0xa2c5('0x20')](_0xa2c5('0x21'),_0x3fec1d+'-'+_0x3d7eba+'/'+_0x4a81d4)[_0xa2c5('0x1b')](_0x29591c);}return null;};}function patchUpdates(_0x56baae){return function(_0x51d810){try{jsonpatch[_0xa2c5('0x22')](_0x51d810,_0x56baae,!![]);}catch(_0x2e34eb){return BPromise[_0xa2c5('0x23')](_0x2e34eb);}return _0x51d810[_0xa2c5('0x24')]();};}function saveUpdates(_0xc6ec90,_0x39a78d){return function(_0x3282ac){if(_0x3282ac){return _0x3282ac['update'](_0xc6ec90)[_0xa2c5('0x25')](function(_0x38e899){return _0x38e899;});}return null;};}function removeEntity(_0x4e8b85,_0x3214fd){return function(_0x5cca53){if(_0x5cca53){return _0x5cca53[_0xa2c5('0x26')]()[_0xa2c5('0x25')](function(){_0x4e8b85[_0xa2c5('0x19')](0xcc)[_0xa2c5('0x1a')]();});}};}function handleEntityNotFound(_0x326bfd,_0x57a7df){return function(_0x13f4aa){if(!_0x13f4aa){_0x326bfd['sendStatus'](0x194);}return _0x13f4aa;};}function handleError(_0x1f3738,_0xc460c5){_0xc460c5=_0xc460c5||0x1f4;return function(_0x8398c9){logger['error'](_0x8398c9[_0xa2c5('0x27')]);if(_0x8398c9[_0xa2c5('0x28')]){delete _0x8398c9[_0xa2c5('0x28')];}_0x1f3738['status'](_0xc460c5)[_0xa2c5('0x29')](_0x8398c9);};}exports['index']=function(_0x4a2d45,_0x576a19){var _0x54225f={},_0x76bfe4={},_0x457a77={'count':0x0,'rows':[]};var _0x58851e=_[_0xa2c5('0x2a')](db[_0xa2c5('0x2b')][_0xa2c5('0x2c')],function(_0xb9e253){return{'name':_0xb9e253[_0xa2c5('0x2d')],'type':_0xb9e253['type'][_0xa2c5('0x2e')]};});_0x76bfe4[_0xa2c5('0x2f')]=_[_0xa2c5('0x2a')](_0x58851e,_0xa2c5('0x28'));_0x76bfe4['query']=_[_0xa2c5('0x30')](_0x4a2d45['query']);_0x76bfe4[_0xa2c5('0x31')]=_[_0xa2c5('0x32')](_0x76bfe4[_0xa2c5('0x2f')],_0x76bfe4[_0xa2c5('0x33')]);_0x54225f[_0xa2c5('0x34')]=_[_0xa2c5('0x32')](_0x76bfe4[_0xa2c5('0x2f')],qs[_0xa2c5('0x35')](_0x4a2d45[_0xa2c5('0x33')]['fields']));_0x54225f[_0xa2c5('0x34')]=_0x54225f[_0xa2c5('0x34')]['length']?_0x54225f[_0xa2c5('0x34')]:_0x76bfe4[_0xa2c5('0x2f')];if(!_0x4a2d45[_0xa2c5('0x33')]['hasOwnProperty'](_0xa2c5('0x36'))){_0x54225f['limit']=qs[_0xa2c5('0x1e')](_0x4a2d45['query'][_0xa2c5('0x1e')]);_0x54225f['offset']=qs[_0xa2c5('0x1c')](_0x4a2d45['query'][_0xa2c5('0x1c')]);}_0x54225f[_0xa2c5('0x37')]=qs[_0xa2c5('0x38')](_0x4a2d45[_0xa2c5('0x33')][_0xa2c5('0x38')]);_0x54225f['where']=qs[_0xa2c5('0x31')](_[_0xa2c5('0x39')](_0x4a2d45[_0xa2c5('0x33')],_0x76bfe4[_0xa2c5('0x31')]),_0x58851e);if(_0x4a2d45[_0xa2c5('0x33')][_0xa2c5('0x3a')]){_0x54225f['where']=_['merge'](_0x54225f['where'],{'$or':_[_0xa2c5('0x2a')](_0x58851e,function(_0x20a10f){if(_0x20a10f[_0xa2c5('0x3b')]!==_0xa2c5('0x3c')){var _0x411a3c={};_0x411a3c[_0x20a10f[_0xa2c5('0x28')]]={'$like':'%'+_0x4a2d45[_0xa2c5('0x33')]['filter']+'%'};return _0x411a3c;}})});}_0x54225f=_[_0xa2c5('0x3d')]({},_0x54225f,_0x4a2d45[_0xa2c5('0x3e')]);var _0x1aa712={'where':_0x54225f[_0xa2c5('0x3f')]};return db[_0xa2c5('0x2b')][_0xa2c5('0x1f')](_0x1aa712)[_0xa2c5('0x25')](function(_0x952df3){_0x457a77[_0xa2c5('0x1f')]=_0x952df3;if(_0x4a2d45[_0xa2c5('0x33')][_0xa2c5('0x40')]){_0x54225f[_0xa2c5('0x41')]=[{'all':!![]}];}return db[_0xa2c5('0x2b')]['findAll'](_0x54225f);})['then'](function(_0x594e1a){_0x457a77[_0xa2c5('0x42')]=_0x594e1a;return _0x457a77;})[_0xa2c5('0x25')](respondWithFilteredResult(_0x576a19,_0x54225f))[_0xa2c5('0x43')](handleError(_0x576a19,null));};exports['show']=function(_0x32818b,_0x2ac98d){var _0x1bf14f={'raw':!![],'where':{'id':_0x32818b[_0xa2c5('0x44')]['id']}},_0x26ad74={};_0x26ad74['model']=_['keys'](db[_0xa2c5('0x2b')][_0xa2c5('0x2c')]);_0x26ad74[_0xa2c5('0x33')]=_[_0xa2c5('0x30')](_0x32818b['query']);_0x26ad74[_0xa2c5('0x31')]=_[_0xa2c5('0x32')](_0x26ad74[_0xa2c5('0x2f')],_0x26ad74[_0xa2c5('0x33')]);_0x1bf14f[_0xa2c5('0x34')]=_[_0xa2c5('0x32')](_0x26ad74[_0xa2c5('0x2f')],qs[_0xa2c5('0x35')](_0x32818b[_0xa2c5('0x33')]['fields']));_0x1bf14f['attributes']=_0x1bf14f[_0xa2c5('0x34')]['length']?_0x1bf14f[_0xa2c5('0x34')]:_0x26ad74['model'];if(_0x32818b[_0xa2c5('0x33')][_0xa2c5('0x40')]){_0x1bf14f[_0xa2c5('0x41')]=[{'all':!![]}];}_0x1bf14f=_['merge']({},_0x1bf14f,_0x32818b[_0xa2c5('0x3e')]);return db[_0xa2c5('0x2b')]['find'](_0x1bf14f)[_0xa2c5('0x25')](handleEntityNotFound(_0x2ac98d,null))[_0xa2c5('0x25')](respondWithResult(_0x2ac98d,null))[_0xa2c5('0x43')](handleError(_0x2ac98d,null));};exports[_0xa2c5('0x45')]=function(_0x452b86,_0x243193){return db[_0xa2c5('0x2b')]['create'](_0x452b86[_0xa2c5('0x46')],{})[_0xa2c5('0x25')](respondWithResult(_0x243193,0xc9))['catch'](handleError(_0x243193,null));};exports['update']=function(_0x141924,_0x5035d9){if(_0x141924[_0xa2c5('0x46')]['id']){delete _0x141924[_0xa2c5('0x46')]['id'];}return db[_0xa2c5('0x2b')][_0xa2c5('0x47')]({'where':{'id':_0x141924[_0xa2c5('0x44')]['id']}})[_0xa2c5('0x25')](handleEntityNotFound(_0x5035d9,null))[_0xa2c5('0x25')](saveUpdates(_0x141924['body'],null))[_0xa2c5('0x25')](respondWithResult(_0x5035d9,null))['catch'](handleError(_0x5035d9,null));};exports[_0xa2c5('0x26')]=function(_0x5d153f,_0x50e44f){return db[_0xa2c5('0x2b')][_0xa2c5('0x47')]({'where':{'id':_0x5d153f[_0xa2c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x50e44f,null))[_0xa2c5('0x25')](removeEntity(_0x50e44f,null))['catch'](handleError(_0x50e44f,null));}; \ No newline at end of file +var _0xbc7d=['../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','options','create','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xbc7d,0xcb));var _0xdbc7=function(_0x44ca6e,_0x5e2c91){_0x44ca6e=_0x44ca6e-0x0;var _0x2edab2=_0xbc7d[_0x44ca6e];return _0x2edab2;};'use strict';var emlformat=require(_0xdbc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbc7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbc7('0x2'));var moment=require(_0xdbc7('0x3'));var BPromise=require(_0xdbc7('0x4'));var Mustache=require(_0xdbc7('0x5'));var util=require('util');var path=require(_0xdbc7('0x6'));var sox=require('sox');var csv=require(_0xdbc7('0x7'));var ejs=require(_0xdbc7('0x8'));var fs=require('fs');var fs_extra=require(_0xdbc7('0x9'));var _=require('lodash');var squel=require(_0xdbc7('0xa'));var crypto=require(_0xdbc7('0xb'));var jsforce=require(_0xdbc7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdbc7('0xd'));var authService=require(_0xdbc7('0xe'));var qs=require(_0xdbc7('0xf'));var as=require(_0xdbc7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbc7('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xdbc7('0x12'));var licenseUtil=require(_0xdbc7('0x13'));var db=require(_0xdbc7('0x14'))['db'];function respondWithStatusCode(_0x1a52aa,_0x59786a){_0x59786a=_0x59786a||0xcc;return function(_0x3ee7fb){if(_0x3ee7fb){return _0x1a52aa[_0xdbc7('0x15')](_0x59786a);}return _0x1a52aa[_0xdbc7('0x16')](_0x59786a)[_0xdbc7('0x17')]();};}function respondWithResult(_0x2dc48e,_0x31d2b5){_0x31d2b5=_0x31d2b5||0xc8;return function(_0x138c5f){if(_0x138c5f){return _0x2dc48e[_0xdbc7('0x16')](_0x31d2b5)[_0xdbc7('0x18')](_0x138c5f);}};}function respondWithFilteredResult(_0x193a50,_0x44595b){return function(_0x34838a){if(_0x34838a){var _0x337a53=typeof _0x44595b[_0xdbc7('0x19')]===_0xdbc7('0x1a')&&typeof _0x44595b['limit']==='undefined';var _0x21b3f8=_0x34838a[_0xdbc7('0x1b')];var _0x5824d3=_0x337a53?0x0:_0x44595b[_0xdbc7('0x19')];var _0x30a8=_0x337a53?_0x34838a[_0xdbc7('0x1b')]:_0x44595b[_0xdbc7('0x19')]+_0x44595b[_0xdbc7('0x1c')];var _0x1eaec2;if(_0x30a8>=_0x21b3f8){_0x30a8=_0x21b3f8;_0x1eaec2=0xc8;}else{_0x1eaec2=0xce;}_0x193a50[_0xdbc7('0x16')](_0x1eaec2);return _0x193a50[_0xdbc7('0x1d')](_0xdbc7('0x1e'),_0x5824d3+'-'+_0x30a8+'/'+_0x21b3f8)[_0xdbc7('0x18')](_0x34838a);}return null;};}function patchUpdates(_0x346fd9){return function(_0x4b7324){try{jsonpatch[_0xdbc7('0x1f')](_0x4b7324,_0x346fd9,!![]);}catch(_0x489695){return BPromise[_0xdbc7('0x20')](_0x489695);}return _0x4b7324[_0xdbc7('0x21')]();};}function saveUpdates(_0x5faea0,_0x1e19b7){return function(_0x41787c){if(_0x41787c){return _0x41787c[_0xdbc7('0x22')](_0x5faea0)[_0xdbc7('0x23')](function(_0x4d61c3){return _0x4d61c3;});}return null;};}function removeEntity(_0x50e689,_0x4f19fa){return function(_0x28dd06){if(_0x28dd06){return _0x28dd06[_0xdbc7('0x24')]()[_0xdbc7('0x23')](function(){_0x50e689[_0xdbc7('0x16')](0xcc)[_0xdbc7('0x17')]();});}};}function handleEntityNotFound(_0x307d71,_0x5c9041){return function(_0x2802b0){if(!_0x2802b0){_0x307d71[_0xdbc7('0x15')](0x194);}return _0x2802b0;};}function handleError(_0x36844b,_0x5c555d){_0x5c555d=_0x5c555d||0x1f4;return function(_0x40961d){logger[_0xdbc7('0x25')](_0x40961d[_0xdbc7('0x26')]);if(_0x40961d['name']){delete _0x40961d[_0xdbc7('0x27')];}_0x36844b[_0xdbc7('0x16')](_0x5c555d)[_0xdbc7('0x28')](_0x40961d);};}exports[_0xdbc7('0x29')]=function(_0x2c47f7,_0x19b8bc){var _0x5789f7={},_0x116170={},_0xb22e41={'count':0x0,'rows':[]};var _0x15788d=_['map'](db[_0xdbc7('0x2a')][_0xdbc7('0x2b')],function(_0x238b4d){return{'name':_0x238b4d[_0xdbc7('0x2c')],'type':_0x238b4d['type']['key']};});_0x116170[_0xdbc7('0x2d')]=_[_0xdbc7('0x2e')](_0x15788d,'name');_0x116170[_0xdbc7('0x2f')]=_[_0xdbc7('0x30')](_0x2c47f7[_0xdbc7('0x2f')]);_0x116170[_0xdbc7('0x31')]=_['intersection'](_0x116170[_0xdbc7('0x2d')],_0x116170[_0xdbc7('0x2f')]);_0x5789f7[_0xdbc7('0x32')]=_[_0xdbc7('0x33')](_0x116170[_0xdbc7('0x2d')],qs[_0xdbc7('0x34')](_0x2c47f7[_0xdbc7('0x2f')][_0xdbc7('0x34')]));_0x5789f7['attributes']=_0x5789f7[_0xdbc7('0x32')][_0xdbc7('0x35')]?_0x5789f7[_0xdbc7('0x32')]:_0x116170[_0xdbc7('0x2d')];if(!_0x2c47f7[_0xdbc7('0x2f')][_0xdbc7('0x36')](_0xdbc7('0x37'))){_0x5789f7[_0xdbc7('0x1c')]=qs[_0xdbc7('0x1c')](_0x2c47f7[_0xdbc7('0x2f')][_0xdbc7('0x1c')]);_0x5789f7['offset']=qs[_0xdbc7('0x19')](_0x2c47f7[_0xdbc7('0x2f')][_0xdbc7('0x19')]);}_0x5789f7[_0xdbc7('0x38')]=qs[_0xdbc7('0x39')](_0x2c47f7[_0xdbc7('0x2f')]['sort']);_0x5789f7[_0xdbc7('0x3a')]=qs[_0xdbc7('0x31')](_[_0xdbc7('0x3b')](_0x2c47f7[_0xdbc7('0x2f')],_0x116170[_0xdbc7('0x31')]),_0x15788d);if(_0x2c47f7[_0xdbc7('0x2f')]['filter']){_0x5789f7[_0xdbc7('0x3a')]=_[_0xdbc7('0x3c')](_0x5789f7[_0xdbc7('0x3a')],{'$or':_['map'](_0x15788d,function(_0x3bf48d){if(_0x3bf48d[_0xdbc7('0x3d')]!==_0xdbc7('0x3e')){var _0x2be0c0={};_0x2be0c0[_0x3bf48d[_0xdbc7('0x27')]]={'$like':'%'+_0x2c47f7[_0xdbc7('0x2f')][_0xdbc7('0x3f')]+'%'};return _0x2be0c0;}})});}_0x5789f7=_[_0xdbc7('0x3c')]({},_0x5789f7,_0x2c47f7['options']);var _0x42bbd7={'where':_0x5789f7[_0xdbc7('0x3a')]};return db[_0xdbc7('0x2a')][_0xdbc7('0x1b')](_0x42bbd7)[_0xdbc7('0x23')](function(_0x5c2fab){_0xb22e41[_0xdbc7('0x1b')]=_0x5c2fab;if(_0x2c47f7[_0xdbc7('0x2f')][_0xdbc7('0x40')]){_0x5789f7['include']=[{'all':!![]}];}return db[_0xdbc7('0x2a')][_0xdbc7('0x41')](_0x5789f7);})[_0xdbc7('0x23')](function(_0x1991da){_0xb22e41[_0xdbc7('0x42')]=_0x1991da;return _0xb22e41;})[_0xdbc7('0x23')](respondWithFilteredResult(_0x19b8bc,_0x5789f7))[_0xdbc7('0x43')](handleError(_0x19b8bc,null));};exports[_0xdbc7('0x44')]=function(_0x5ec36b,_0x2ba758){var _0x4dd499={'raw':!![],'where':{'id':_0x5ec36b[_0xdbc7('0x45')]['id']}},_0x183386={};_0x183386[_0xdbc7('0x2d')]=_['keys'](db[_0xdbc7('0x2a')][_0xdbc7('0x2b')]);_0x183386[_0xdbc7('0x2f')]=_[_0xdbc7('0x30')](_0x5ec36b[_0xdbc7('0x2f')]);_0x183386[_0xdbc7('0x31')]=_['intersection'](_0x183386[_0xdbc7('0x2d')],_0x183386[_0xdbc7('0x2f')]);_0x4dd499[_0xdbc7('0x32')]=_[_0xdbc7('0x33')](_0x183386[_0xdbc7('0x2d')],qs[_0xdbc7('0x34')](_0x5ec36b[_0xdbc7('0x2f')][_0xdbc7('0x34')]));_0x4dd499[_0xdbc7('0x32')]=_0x4dd499[_0xdbc7('0x32')][_0xdbc7('0x35')]?_0x4dd499[_0xdbc7('0x32')]:_0x183386[_0xdbc7('0x2d')];if(_0x5ec36b[_0xdbc7('0x2f')][_0xdbc7('0x40')]){_0x4dd499['include']=[{'all':!![]}];}_0x4dd499=_[_0xdbc7('0x3c')]({},_0x4dd499,_0x5ec36b[_0xdbc7('0x46')]);return db[_0xdbc7('0x2a')]['find'](_0x4dd499)['then'](handleEntityNotFound(_0x2ba758,null))[_0xdbc7('0x23')](respondWithResult(_0x2ba758,null))['catch'](handleError(_0x2ba758,null));};exports[_0xdbc7('0x47')]=function(_0x148b37,_0x54cb7e){return db[_0xdbc7('0x2a')][_0xdbc7('0x47')](_0x148b37['body'],{})[_0xdbc7('0x23')](respondWithResult(_0x54cb7e,0xc9))[_0xdbc7('0x43')](handleError(_0x54cb7e,null));};exports[_0xdbc7('0x22')]=function(_0x3ad78e,_0xee0b5f){if(_0x3ad78e['body']['id']){delete _0x3ad78e['body']['id'];}return db[_0xdbc7('0x2a')][_0xdbc7('0x48')]({'where':{'id':_0x3ad78e['params']['id']}})['then'](handleEntityNotFound(_0xee0b5f,null))[_0xdbc7('0x23')](saveUpdates(_0x3ad78e['body'],null))['then'](respondWithResult(_0xee0b5f,null))['catch'](handleError(_0xee0b5f,null));};exports[_0xdbc7('0x24')]=function(_0x3fa73b,_0x53fa9f){return db[_0xdbc7('0x2a')][_0xdbc7('0x48')]({'where':{'id':_0x3fa73b[_0xdbc7('0x45')]['id']}})['then'](handleEntityNotFound(_0x53fa9f,null))[_0xdbc7('0x23')](removeEntity(_0x53fa9f,null))[_0xdbc7('0x43')](handleError(_0x53fa9f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 19cb50f..fd6e4bf 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 _0x2ff5=['../../config/environment','exports','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x548c92,_0x1131c2){var _0xb70b16=function(_0x5f328a){while(--_0x5f328a){_0x548c92['push'](_0x548c92['shift']());}};_0xb70b16(++_0x1131c2);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x4eaa87,_0x51d135){_0x4eaa87=_0x4eaa87-0x0;var _0x104466=_0x2ff5[_0x4eaa87];return _0x104466;};'use strict';var _=require('lodash');var util=require(_0x52ff('0x0'));var logger=require(_0x52ff('0x1'))('api');var moment=require(_0x52ff('0x2'));var BPromise=require(_0x52ff('0x3'));var rp=require(_0x52ff('0x4'));var fs=require('fs');var path=require(_0x52ff('0x5'));var rimraf=require(_0x52ff('0x6'));var config=require(_0x52ff('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0x52ff('0x8')]=function(_0x285f60,_0x26906c){return _0x285f60['define'](_0x52ff('0x9'),attributes,{'tableName':_0x52ff('0xa'),'paranoid':![],'indexes':[{'name':_0x52ff('0xb'),'fields':[_0x52ff('0xc'),_0x52ff('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9666=['lodash','util','../../config/logger','api','bluebird','request-promise','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField','FieldId'];(function(_0x2718e6,_0x2e2e6d){var _0x21a493=function(_0x125c6d){while(--_0x125c6d){_0x2718e6['push'](_0x2718e6['shift']());}};_0x21a493(++_0x2e2e6d);}(_0x9666,0x17a));var _0x6966=function(_0x36d092,_0x4feec6){_0x36d092=_0x36d092-0x0;var _0x52c59c=_0x9666[_0x36d092];return _0x52c59c;};'use strict';var _=require(_0x6966('0x0'));var util=require(_0x6966('0x1'));var logger=require(_0x6966('0x2'))(_0x6966('0x3'));var moment=require('moment');var BPromise=require(_0x6966('0x4'));var rp=require(_0x6966('0x5'));var fs=require('fs');var path=require(_0x6966('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6966('0x7'));module[_0x6966('0x8')]=function(_0x7194a6,_0x17198b){return _0x7194a6[_0x6966('0x9')](_0x6966('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x6966('0xb'),'fields':[_0x6966('0xc'),_0x6966('0xd')],'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 671a5ee..d7f5994 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0xf494,0x1c6));var _0x4f49=function(_0x256d13,_0x26aad7){_0x256d13=_0x256d13-0x0;var _0x5ac292=_0xf494[_0x256d13];return _0x5ac292;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file +var _0x33af=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2dc1a0,_0x29cf94){var _0x3d7e3d=function(_0x25b5d9){while(--_0x25b5d9){_0x2dc1a0['push'](_0x2dc1a0['shift']());}};_0x3d7e3d(++_0x29cf94);}(_0x33af,0xec));var _0xf33a=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0x33af[_0x113a6c];return _0x1ac632;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 719586b..9342f24 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 _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(_0x1e0b51,_0x510d35){var _0x2494cf=function(_0x51577f){while(--_0x51577f){_0x1e0b51['push'](_0x1e0b51['shift']());}};_0x2494cf(++_0x510d35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 +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(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 0f39750..fa6692d 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 _0xef0f=['sequelize','STRING','ENUM','integrationTab','newTab'];(function(_0xdbd4f7,_0x4e3bdd){var _0x5c3f9d=function(_0xa7a35a){while(--_0xa7a35a){_0xdbd4f7['push'](_0xdbd4f7['shift']());}};_0x5c3f9d(++_0x4e3bdd);}(_0xef0f,0x168));var _0xfef0=function(_0x2c87d0,_0x59f96f){_0x2c87d0=_0x2c87d0-0x0;var _0x322321=_0xef0f[_0x2c87d0];return _0x322321;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0xfef0('0x1')]},'password':{'type':Sequelize[_0xfef0('0x1')]},'clientId':{'type':Sequelize[_0xfef0('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xfef0('0x1')]},'serverUrl':{'type':Sequelize[_0xfef0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfef0('0x2')](_0xfef0('0x3'),_0xfef0('0x4')),'defaultValue':_0xfef0('0x3')}}; \ No newline at end of file +var _0xb6ff=['exports','STRING','username','integrationTab','newTab','sequelize'];(function(_0x500277,_0x1b0c80){var _0x9d4ff6=function(_0x5e08b0){while(--_0x5e08b0){_0x500277['push'](_0x500277['shift']());}};_0x9d4ff6(++_0x1b0c80);}(_0xb6ff,0x185));var _0xfb6f=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xb6ff[_0x32d457];return _0x338386;};'use strict';var Sequelize=require(_0xfb6f('0x0'));module[_0xfb6f('0x1')]={'name':{'type':Sequelize[_0xfb6f('0x2')]},'description':{'type':Sequelize[_0xfb6f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xfb6f('0x3')},'remoteUri':{'type':Sequelize[_0xfb6f('0x2')]},'password':{'type':Sequelize[_0xfb6f('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xfb6f('0x2')]},'securityToken':{'type':Sequelize[_0xfb6f('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfb6f('0x4'),_0xfb6f('0x5')),'defaultValue':_0xfb6f('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 3add722..b89cd1b 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 _0xbfc6=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','order','pick','filter','merge','where','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','getConfigurations','SalesforceConfiguration','sort','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','type','getDescriptions','channel','SalesforceField','Descriptions','getFields','Task','findOne','clientId','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','clientSecret','login','isNil','ticketType','sobject','describe','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','phone','remove','includes','custom','picklistValues','label','value','True','true','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xbfc6,0x1e0));var _0x6bfc=function(_0x19cb88,_0x16936f){_0x19cb88=_0x19cb88-0x0;var _0x42d4de=_0xbfc6[_0x19cb88];return _0x42d4de;};'use strict';var emlformat=require(_0x6bfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6bfc('0x1'));var BPromise=require(_0x6bfc('0x2'));var Mustache=require(_0x6bfc('0x3'));var util=require('util');var path=require(_0x6bfc('0x4'));var sox=require(_0x6bfc('0x5'));var csv=require(_0x6bfc('0x6'));var ejs=require(_0x6bfc('0x7'));var fs=require('fs');var fs_extra=require(_0x6bfc('0x8'));var _=require(_0x6bfc('0x9'));var squel=require(_0x6bfc('0xa'));var crypto=require(_0x6bfc('0xb'));var jsforce=require(_0x6bfc('0xc'));var deskjs=require(_0x6bfc('0xd'));var toCsv=require(_0x6bfc('0x6'));var querystring=require(_0x6bfc('0xe'));var Papa=require(_0x6bfc('0xf'));var Redis=require('ioredis');var authService=require(_0x6bfc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6bfc('0x11'));var hardwareService=require(_0x6bfc('0x12'));var logger=require('../../config/logger')(_0x6bfc('0x13'));var utils=require(_0x6bfc('0x14'));var config=require(_0x6bfc('0x15'));var licenseUtil=require(_0x6bfc('0x16'));var db=require(_0x6bfc('0x17'))['db'];var integrations=require(_0x6bfc('0x18'));function respondWithStatusCode(_0x38e008,_0x3cb656){_0x3cb656=_0x3cb656||0xcc;return function(_0x201742){if(_0x201742){return _0x38e008[_0x6bfc('0x19')](_0x3cb656);}return _0x38e008['status'](_0x3cb656)[_0x6bfc('0x1a')]();};}function respondWithResult(_0x555395,_0xe5b57f){_0xe5b57f=_0xe5b57f||0xc8;return function(_0x3efbb){if(_0x3efbb){return _0x555395[_0x6bfc('0x1b')](_0xe5b57f)[_0x6bfc('0x1c')](_0x3efbb);}};}function respondWithFilteredResult(_0x573f93,_0x21f512){return function(_0x3134af){if(_0x3134af){var _0x576754=typeof _0x21f512[_0x6bfc('0x1d')]==='undefined'&&typeof _0x21f512[_0x6bfc('0x1e')]===_0x6bfc('0x1f');var _0x3d8b7f=_0x3134af[_0x6bfc('0x20')];var _0x1d191b=_0x576754?0x0:_0x21f512[_0x6bfc('0x1d')];var _0x42d0fb=_0x576754?_0x3134af[_0x6bfc('0x20')]:_0x21f512['offset']+_0x21f512['limit'];var _0x21fb37;if(_0x42d0fb>=_0x3d8b7f){_0x42d0fb=_0x3d8b7f;_0x21fb37=0xc8;}else{_0x21fb37=0xce;}_0x573f93[_0x6bfc('0x1b')](_0x21fb37);return _0x573f93[_0x6bfc('0x21')](_0x6bfc('0x22'),_0x1d191b+'-'+_0x42d0fb+'/'+_0x3d8b7f)[_0x6bfc('0x1c')](_0x3134af);}return null;};}function patchUpdates(_0x42a6a2){return function(_0x349083){try{jsonpatch[_0x6bfc('0x23')](_0x349083,_0x42a6a2,!![]);}catch(_0x5b9a00){return BPromise[_0x6bfc('0x24')](_0x5b9a00);}return _0x349083[_0x6bfc('0x25')]();};}function saveUpdates(_0x4150c4,_0x2adba4){return function(_0xba7605){if(_0xba7605){return _0xba7605[_0x6bfc('0x26')](_0x4150c4)[_0x6bfc('0x27')](function(_0x13e084){return _0x13e084;});}return null;};}function removeEntity(_0x209b12,_0x10d7dc){return function(_0x24236e){if(_0x24236e){return _0x24236e[_0x6bfc('0x28')]()[_0x6bfc('0x27')](function(){_0x209b12[_0x6bfc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x590cd8,_0x115e4){return function(_0x50fb25){if(!_0x50fb25){_0x590cd8[_0x6bfc('0x19')](0x194);}return _0x50fb25;};}function handleError(_0xcbf1aa,_0x4b267d){_0x4b267d=_0x4b267d||0x1f4;return function(_0x599839){logger[_0x6bfc('0x29')](_0x599839[_0x6bfc('0x2a')]);if(_0x599839['name']){delete _0x599839[_0x6bfc('0x2b')];}_0xcbf1aa[_0x6bfc('0x1b')](_0x4b267d)[_0x6bfc('0x2c')](_0x599839);};}exports[_0x6bfc('0x2d')]=function(_0x40c635,_0xbbcf94){var _0x222828={},_0x13bc1d={},_0x197ea7={'count':0x0,'rows':[]};var _0x3a1945=_[_0x6bfc('0x2e')](db[_0x6bfc('0x2f')][_0x6bfc('0x30')],function(_0xc0f9a2){return{'name':_0xc0f9a2[_0x6bfc('0x31')],'type':_0xc0f9a2['type'][_0x6bfc('0x32')]};});_0x13bc1d[_0x6bfc('0x33')]=_[_0x6bfc('0x2e')](_0x3a1945,_0x6bfc('0x2b'));_0x13bc1d[_0x6bfc('0x34')]=_[_0x6bfc('0x35')](_0x40c635['query']);_0x13bc1d[_0x6bfc('0x36')]=_[_0x6bfc('0x37')](_0x13bc1d[_0x6bfc('0x33')],_0x13bc1d[_0x6bfc('0x34')]);_0x222828[_0x6bfc('0x38')]=_[_0x6bfc('0x37')](_0x13bc1d['model'],qs['fields'](_0x40c635[_0x6bfc('0x34')]['fields']));_0x222828[_0x6bfc('0x38')]=_0x222828['attributes'][_0x6bfc('0x39')]?_0x222828['attributes']:_0x13bc1d[_0x6bfc('0x33')];if(!_0x40c635[_0x6bfc('0x34')]['hasOwnProperty']('nolimit')){_0x222828[_0x6bfc('0x1e')]=qs['limit'](_0x40c635[_0x6bfc('0x34')][_0x6bfc('0x1e')]);_0x222828[_0x6bfc('0x1d')]=qs[_0x6bfc('0x1d')](_0x40c635['query'][_0x6bfc('0x1d')]);}_0x222828[_0x6bfc('0x3a')]=qs['sort'](_0x40c635[_0x6bfc('0x34')]['sort']);_0x222828['where']=qs[_0x6bfc('0x36')](_[_0x6bfc('0x3b')](_0x40c635['query'],_0x13bc1d[_0x6bfc('0x36')]),_0x3a1945);if(_0x40c635[_0x6bfc('0x34')][_0x6bfc('0x3c')]){_0x222828['where']=_[_0x6bfc('0x3d')](_0x222828[_0x6bfc('0x3e')],{'$or':_[_0x6bfc('0x2e')](_0x3a1945,function(_0x590c44){if(_0x590c44['type']!=='VIRTUAL'){var _0x1ce407={};_0x1ce407[_0x590c44['name']]={'$like':'%'+_0x40c635[_0x6bfc('0x34')]['filter']+'%'};return _0x1ce407;}})});}_0x222828=_[_0x6bfc('0x3d')]({},_0x222828,_0x40c635[_0x6bfc('0x3f')]);var _0x16cde2={'where':_0x222828['where']};return db[_0x6bfc('0x2f')][_0x6bfc('0x20')](_0x16cde2)['then'](function(_0x5ff4d){_0x197ea7[_0x6bfc('0x20')]=_0x5ff4d;if(_0x40c635[_0x6bfc('0x34')]['includeAll']){_0x222828['include']=[{'all':!![]}];}return db[_0x6bfc('0x2f')][_0x6bfc('0x40')](_0x222828);})['then'](function(_0x127ba3){_0x197ea7[_0x6bfc('0x41')]=_0x127ba3;return _0x197ea7;})['then'](respondWithFilteredResult(_0xbbcf94,_0x222828))[_0x6bfc('0x42')](handleError(_0xbbcf94,null));};exports[_0x6bfc('0x43')]=function(_0x214892,_0x5af3e1){var _0x3a9231={'raw':![],'where':{'id':_0x214892[_0x6bfc('0x44')]['id']}},_0x4a7d97={};_0x4a7d97['model']=_['keys'](db['SalesforceAccount'][_0x6bfc('0x30')]);_0x4a7d97[_0x6bfc('0x34')]=_[_0x6bfc('0x35')](_0x214892[_0x6bfc('0x34')]);_0x4a7d97[_0x6bfc('0x36')]=_[_0x6bfc('0x37')](_0x4a7d97[_0x6bfc('0x33')],_0x4a7d97['query']);_0x3a9231['attributes']=_['intersection'](_0x4a7d97[_0x6bfc('0x33')],qs[_0x6bfc('0x45')](_0x214892['query'][_0x6bfc('0x45')]));_0x3a9231[_0x6bfc('0x38')]=_0x3a9231[_0x6bfc('0x38')][_0x6bfc('0x39')]?_0x3a9231[_0x6bfc('0x38')]:_0x4a7d97['model'];if(_0x214892[_0x6bfc('0x34')][_0x6bfc('0x46')]){_0x3a9231[_0x6bfc('0x47')]=[{'all':!![]}];}_0x3a9231=_['merge']({},_0x3a9231,_0x214892[_0x6bfc('0x3f')]);return db[_0x6bfc('0x2f')][_0x6bfc('0x48')](_0x3a9231)[_0x6bfc('0x27')](handleEntityNotFound(_0x5af3e1,null))['then'](respondWithResult(_0x5af3e1,null))[_0x6bfc('0x42')](handleError(_0x5af3e1,null));};exports[_0x6bfc('0x49')]=function(_0x5bf1af,_0x509a31){return db['SalesforceAccount'][_0x6bfc('0x49')](_0x5bf1af['body'],{})[_0x6bfc('0x27')](respondWithResult(_0x509a31,0xc9))[_0x6bfc('0x42')](handleError(_0x509a31,null));};exports['update']=function(_0x4eac89,_0x432c80){if(_0x4eac89['body']['id']){delete _0x4eac89[_0x6bfc('0x4a')]['id'];}return db[_0x6bfc('0x2f')]['find']({'where':{'id':_0x4eac89[_0x6bfc('0x44')]['id']}})[_0x6bfc('0x27')](handleEntityNotFound(_0x432c80,null))['then'](saveUpdates(_0x4eac89['body'],null))[_0x6bfc('0x27')](respondWithResult(_0x432c80,null))[_0x6bfc('0x42')](handleError(_0x432c80,null));};exports[_0x6bfc('0x28')]=function(_0x4af048,_0x7d91c0){return db[_0x6bfc('0x2f')]['find']({'where':{'id':_0x4af048[_0x6bfc('0x44')]['id']}})[_0x6bfc('0x27')](handleEntityNotFound(_0x7d91c0,null))[_0x6bfc('0x27')](removeEntity(_0x7d91c0,null))['catch'](handleError(_0x7d91c0,null));};exports[_0x6bfc('0x4b')]=function(_0x26e585,_0x46bcc4,_0x1e01a9){var _0x4af4c6={};var _0x15b809={};var _0x578200;var _0x13ea8f;return db[_0x6bfc('0x2f')]['findOne']({'where':{'id':_0x26e585['params']['id']}})['then'](handleEntityNotFound(_0x46bcc4,null))[_0x6bfc('0x27')](function(_0x349f79){if(_0x349f79){_0x578200=_0x349f79;_0x15b809[_0x6bfc('0x33')]=_['keys'](db[_0x6bfc('0x4c')][_0x6bfc('0x30')]);_0x15b809[_0x6bfc('0x34')]=_[_0x6bfc('0x35')](_0x26e585[_0x6bfc('0x34')]);_0x15b809[_0x6bfc('0x36')]=_[_0x6bfc('0x37')](_0x15b809[_0x6bfc('0x33')],_0x15b809['query']);_0x4af4c6[_0x6bfc('0x38')]=_[_0x6bfc('0x37')](_0x15b809[_0x6bfc('0x33')],qs['fields'](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x45')]));_0x4af4c6[_0x6bfc('0x38')]=_0x4af4c6[_0x6bfc('0x38')][_0x6bfc('0x39')]?_0x4af4c6[_0x6bfc('0x38')]:_0x15b809[_0x6bfc('0x33')];_0x4af4c6[_0x6bfc('0x3a')]=qs[_0x6bfc('0x4d')](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x4d')]);_0x4af4c6[_0x6bfc('0x3e')]=qs[_0x6bfc('0x36')](_['pick'](_0x26e585[_0x6bfc('0x34')],_0x15b809[_0x6bfc('0x36')]));if(_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x3c')]){_0x4af4c6['where']=_[_0x6bfc('0x3d')](_0x4af4c6[_0x6bfc('0x3e')],{'$or':_['map'](_0x4af4c6[_0x6bfc('0x38')],function(_0x47f2be){var _0x29be49={};_0x29be49[_0x47f2be]={'$like':'%'+_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x3c')]+'%'};return _0x29be49;})});}_0x4af4c6=_[_0x6bfc('0x3d')]({},_0x4af4c6,_0x26e585['options']);return _0x578200[_0x6bfc('0x4b')](_0x4af4c6);}})['then'](function(_0x467dc3){if(_0x467dc3){_0x13ea8f=_0x467dc3[_0x6bfc('0x39')];if(!_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x4e')]('nolimit')){_0x4af4c6[_0x6bfc('0x1e')]=qs[_0x6bfc('0x1e')](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x1e')]);_0x4af4c6[_0x6bfc('0x1d')]=qs[_0x6bfc('0x1d')](_0x26e585[_0x6bfc('0x34')][_0x6bfc('0x1d')]);}return _0x578200[_0x6bfc('0x4b')](_0x4af4c6);}})[_0x6bfc('0x27')](function(_0x5cb55a){if(_0x5cb55a){return _0x5cb55a?{'count':_0x13ea8f,'rows':_0x5cb55a}:null;}})['then'](respondWithResult(_0x46bcc4,null))['catch'](handleError(_0x46bcc4,null));};exports[_0x6bfc('0x4f')]=function(_0x1d6901,_0x4f977a,_0x12a3ff){if(_0x1d6901[_0x6bfc('0x4a')]['id']){delete _0x1d6901['body']['id'];}return db[_0x6bfc('0x2f')]['findOne']({'where':{'id':_0x1d6901['params']['id']}})['then'](handleEntityNotFound(_0x4f977a,null))['then'](function(_0x105f96){if(_0x105f96){_0x1d6901['body'][_0x6bfc('0x50')]=_0x105f96['id'];_0x1d6901[_0x6bfc('0x4a')][_0x6bfc('0x51')]=integrations[_0x6bfc('0x52')](_0x1d6901[_0x6bfc('0x4a')]['channel'],_0x1d6901[_0x6bfc('0x4a')][_0x6bfc('0x53')]);_0x1d6901['body']['Descriptions']=integrations[_0x6bfc('0x54')](_0x1d6901[_0x6bfc('0x4a')][_0x6bfc('0x55')],_0x1d6901['body'][_0x6bfc('0x53')]);return db[_0x6bfc('0x4c')]['create'](_0x1d6901[_0x6bfc('0x4a')],{'include':[{'model':db[_0x6bfc('0x56')],'as':_0x6bfc('0x51')},{'model':db['SalesforceField'],'as':_0x6bfc('0x57')}]});}return null;})[_0x6bfc('0x27')](respondWithResult(_0x4f977a,null))[_0x6bfc('0x42')](handleError(_0x4f977a,null));};exports[_0x6bfc('0x58')]=function(_0x23e5ad,_0x1b0776,_0x22d2e0){var _0x32e3d6;var _0x1773f1='';var _0xb879a0=_0x6bfc('0x59');return db[_0x6bfc('0x2f')][_0x6bfc('0x5a')]({'where':{'id':_0x23e5ad[_0x6bfc('0x44')]['id']},'attributes':['id','remoteUri',_0x6bfc('0x5b'),'clientSecret',_0x6bfc('0x5c'),_0x6bfc('0x5d'),_0x6bfc('0x5e')]})[_0x6bfc('0x27')](handleEntityNotFound(_0x1b0776,null))[_0x6bfc('0x27')](function(_0x45c88a){if(_0x45c88a){_0x1773f1=_0x45c88a[_0x6bfc('0x5f')];var _0x587c14=_0x1773f1[_0x6bfc('0x60')](-0x1);if(_0x587c14==='/'){_0x1773f1=_0x1773f1[_0x6bfc('0x61')](0x0,_0x1773f1[_0x6bfc('0x62')](_0x587c14));}_0x32e3d6=new jsforce[(_0x6bfc('0x63'))]({'oauth2':{'loginUrl':_0x1773f1,'clientId':_0x45c88a[_0x6bfc('0x5b')],'clientSecret':_0x45c88a[_0x6bfc('0x64')]}});return _0x32e3d6[_0x6bfc('0x65')](_0x45c88a['username'],_0x45c88a[_0x6bfc('0x5d')]['concat'](_0x45c88a[_0x6bfc('0x5e')]));}})[_0x6bfc('0x27')](function(_0x344921){if(_0x344921){if(!_[_0x6bfc('0x66')](_0x23e5ad[_0x6bfc('0x34')][_0x6bfc('0x67')])){_0xb879a0=_0x23e5ad[_0x6bfc('0x34')][_0x6bfc('0x67')];}return _0x32e3d6[_0x6bfc('0x68')](_0xb879a0)[_0x6bfc('0x69')]();}})[_0x6bfc('0x27')](function(_0x123603){var _0x42542e=['OwnerId','ActivityDate',_0x6bfc('0x6a'),_0x6bfc('0x6b'),_0x6bfc('0x6c'),_0x6bfc('0x6d')];var _0x4297a8=['string',_0x6bfc('0x6e'),_0x6bfc('0x6f'),_0x6bfc('0x70'),_0x6bfc('0x71'),'textarea',_0x6bfc('0x72')];if(_0x123603){_[_0x6bfc('0x73')](_0x123603[_0x6bfc('0x45')],function(_0x35dc35){return _0x42542e[_0x6bfc('0x74')](_0x35dc35[_0x6bfc('0x2b')])||!_0x4297a8[_0x6bfc('0x74')](_0x35dc35[_0x6bfc('0x53')]);});return{'count':_0x123603['fields'][_0x6bfc('0x39')],'rows':_[_0x6bfc('0x2e')](_0x123603[_0x6bfc('0x45')],function(_0x2ad7bf){return{'id':_0x2ad7bf[_0x6bfc('0x2b')],'name':_0x2ad7bf['label'],'custom':_0x2ad7bf[_0x6bfc('0x75')],'options':_0x2ad7bf['picklistValues'][_0x6bfc('0x39')]>0x0?_[_0x6bfc('0x2e')](_0x2ad7bf[_0x6bfc('0x76')],function(_0x2a17ca){return{'name':_0x2a17ca[_0x6bfc('0x77')],'value':_0x2a17ca[_0x6bfc('0x78')]};}):_0x2ad7bf['type']=='boolean'?[{'name':_0x6bfc('0x79'),'value':_0x6bfc('0x7a')},{'name':'False','value':'false'}]:[]};})};}})[_0x6bfc('0x27')](respondWithResult(_0x1b0776,null))['catch'](function(_0x20a6f4){var _0xfd4b79=_0x23e5ad[_0x6bfc('0x34')][_0x6bfc('0x7b')]?0x1f4:_0x20a6f4[_0x6bfc('0x7c')]||0x1f4;logger['error'](_0x6bfc('0x7d'),_0x6bfc('0x58'),_0xfd4b79,JSON[_0x6bfc('0x7e')](_0x20a6f4));delete _0x20a6f4[_0x6bfc('0x2b')];if(_0xfd4b79===0x191){_0xfd4b79=0x190;}_0x1b0776[_0x6bfc('0x1b')](_0xfd4b79)['send'](_0x23e5ad[_0x6bfc('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x20a6f4[_0x6bfc('0x7c')]}:_0x20a6f4);});}; \ No newline at end of file +var _0x44cc=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','params','keys','includeAll','create','body','destroy','find','getConfigurations','findOne','SalesforceConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','login','isNil','ticketType','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','int','picklist','boolean','phone','remove','includes','label','picklistValues','value','True','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5e3e14,_0x3e1e9e){var _0x25f527=function(_0x3aa192){while(--_0x3aa192){_0x5e3e14['push'](_0x5e3e14['shift']());}};_0x25f527(++_0x3e1e9e);}(_0x44cc,0x67));var _0xc44c=function(_0x2a8348,_0x2a03c7){_0x2a8348=_0x2a8348-0x0;var _0x44b4aa=_0x44cc[_0x2a8348];return _0x44b4aa;};'use strict';var emlformat=require(_0xc44c('0x0'));var rimraf=require(_0xc44c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc44c('0x2'));var rp=require(_0xc44c('0x3'));var moment=require('moment');var BPromise=require(_0xc44c('0x4'));var Mustache=require(_0xc44c('0x5'));var util=require(_0xc44c('0x6'));var path=require(_0xc44c('0x7'));var sox=require('sox');var csv=require(_0xc44c('0x8'));var ejs=require(_0xc44c('0x9'));var fs=require('fs');var fs_extra=require(_0xc44c('0xa'));var _=require(_0xc44c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc44c('0x8'));var querystring=require(_0xc44c('0xc'));var Papa=require(_0xc44c('0xd'));var Redis=require(_0xc44c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc44c('0xf'));var as=require(_0xc44c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc44c('0x11'));var utils=require(_0xc44c('0x12'));var config=require(_0xc44c('0x13'));var licenseUtil=require(_0xc44c('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1739ff,_0x355365){_0x355365=_0x355365||0xcc;return function(_0x29efdb){if(_0x29efdb){return _0x1739ff[_0xc44c('0x15')](_0x355365);}return _0x1739ff[_0xc44c('0x16')](_0x355365)[_0xc44c('0x17')]();};}function respondWithResult(_0x5da2f1,_0x2f9354){_0x2f9354=_0x2f9354||0xc8;return function(_0x3a11b1){if(_0x3a11b1){return _0x5da2f1['status'](_0x2f9354)[_0xc44c('0x18')](_0x3a11b1);}};}function respondWithFilteredResult(_0x1d382b,_0x5c66de){return function(_0x29504f){if(_0x29504f){var _0x3e4824=typeof _0x5c66de[_0xc44c('0x19')]==='undefined'&&typeof _0x5c66de['limit']===_0xc44c('0x1a');var _0x106060=_0x29504f[_0xc44c('0x1b')];var _0xfbc17b=_0x3e4824?0x0:_0x5c66de[_0xc44c('0x19')];var _0x5905b7=_0x3e4824?_0x29504f[_0xc44c('0x1b')]:_0x5c66de['offset']+_0x5c66de[_0xc44c('0x1c')];var _0x4f28d1;if(_0x5905b7>=_0x106060){_0x5905b7=_0x106060;_0x4f28d1=0xc8;}else{_0x4f28d1=0xce;}_0x1d382b['status'](_0x4f28d1);return _0x1d382b[_0xc44c('0x1d')](_0xc44c('0x1e'),_0xfbc17b+'-'+_0x5905b7+'/'+_0x106060)[_0xc44c('0x18')](_0x29504f);}return null;};}function patchUpdates(_0x140221){return function(_0x2dc6fa){try{jsonpatch[_0xc44c('0x1f')](_0x2dc6fa,_0x140221,!![]);}catch(_0xa86967){return BPromise[_0xc44c('0x20')](_0xa86967);}return _0x2dc6fa[_0xc44c('0x21')]();};}function saveUpdates(_0x2af802,_0x163825){return function(_0x30ffd1){if(_0x30ffd1){return _0x30ffd1[_0xc44c('0x22')](_0x2af802)[_0xc44c('0x23')](function(_0x23be9b){return _0x23be9b;});}return null;};}function removeEntity(_0x74a200,_0x59eb6f){return function(_0xd551e6){if(_0xd551e6){return _0xd551e6['destroy']()[_0xc44c('0x23')](function(){_0x74a200['status'](0xcc)[_0xc44c('0x17')]();});}};}function handleEntityNotFound(_0x25ade5,_0x1d22e4){return function(_0x206ff9){if(!_0x206ff9){_0x25ade5['sendStatus'](0x194);}return _0x206ff9;};}function handleError(_0xc1fe90,_0x2bfa59){_0x2bfa59=_0x2bfa59||0x1f4;return function(_0x46f2ed){logger[_0xc44c('0x24')](_0x46f2ed[_0xc44c('0x25')]);if(_0x46f2ed[_0xc44c('0x26')]){delete _0x46f2ed[_0xc44c('0x26')];}_0xc1fe90[_0xc44c('0x16')](_0x2bfa59)[_0xc44c('0x27')](_0x46f2ed);};}exports[_0xc44c('0x28')]=function(_0x2b17a2,_0x546df5){var _0xa7967d={},_0x9076b5={},_0x454585={'count':0x0,'rows':[]};var _0x20bc32=_[_0xc44c('0x29')](db[_0xc44c('0x2a')][_0xc44c('0x2b')],function(_0x33e02a){return{'name':_0x33e02a[_0xc44c('0x2c')],'type':_0x33e02a[_0xc44c('0x2d')]['key']};});_0x9076b5['model']=_[_0xc44c('0x29')](_0x20bc32,_0xc44c('0x26'));_0x9076b5[_0xc44c('0x2e')]=_['keys'](_0x2b17a2[_0xc44c('0x2e')]);_0x9076b5['filters']=_[_0xc44c('0x2f')](_0x9076b5[_0xc44c('0x30')],_0x9076b5['query']);_0xa7967d[_0xc44c('0x31')]=_[_0xc44c('0x2f')](_0x9076b5[_0xc44c('0x30')],qs[_0xc44c('0x32')](_0x2b17a2[_0xc44c('0x2e')][_0xc44c('0x32')]));_0xa7967d[_0xc44c('0x31')]=_0xa7967d[_0xc44c('0x31')][_0xc44c('0x33')]?_0xa7967d[_0xc44c('0x31')]:_0x9076b5[_0xc44c('0x30')];if(!_0x2b17a2[_0xc44c('0x2e')]['hasOwnProperty'](_0xc44c('0x34'))){_0xa7967d['limit']=qs[_0xc44c('0x1c')](_0x2b17a2['query']['limit']);_0xa7967d[_0xc44c('0x19')]=qs[_0xc44c('0x19')](_0x2b17a2['query']['offset']);}_0xa7967d['order']=qs[_0xc44c('0x35')](_0x2b17a2[_0xc44c('0x2e')][_0xc44c('0x35')]);_0xa7967d[_0xc44c('0x36')]=qs[_0xc44c('0x37')](_[_0xc44c('0x38')](_0x2b17a2[_0xc44c('0x2e')],_0x9076b5['filters']),_0x20bc32);if(_0x2b17a2[_0xc44c('0x2e')][_0xc44c('0x39')]){_0xa7967d[_0xc44c('0x36')]=_[_0xc44c('0x3a')](_0xa7967d[_0xc44c('0x36')],{'$or':_[_0xc44c('0x29')](_0x20bc32,function(_0x13b8ce){if(_0x13b8ce[_0xc44c('0x2d')]!=='VIRTUAL'){var _0x51be3b={};_0x51be3b[_0x13b8ce[_0xc44c('0x26')]]={'$like':'%'+_0x2b17a2[_0xc44c('0x2e')][_0xc44c('0x39')]+'%'};return _0x51be3b;}})});}_0xa7967d=_[_0xc44c('0x3a')]({},_0xa7967d,_0x2b17a2[_0xc44c('0x3b')]);var _0x510f09={'where':_0xa7967d[_0xc44c('0x36')]};return db[_0xc44c('0x2a')][_0xc44c('0x1b')](_0x510f09)[_0xc44c('0x23')](function(_0x43e878){_0x454585[_0xc44c('0x1b')]=_0x43e878;if(_0x2b17a2['query']['includeAll']){_0xa7967d[_0xc44c('0x3c')]=[{'all':!![]}];}return db[_0xc44c('0x2a')][_0xc44c('0x3d')](_0xa7967d);})[_0xc44c('0x23')](function(_0x53424d){_0x454585[_0xc44c('0x3e')]=_0x53424d;return _0x454585;})[_0xc44c('0x23')](respondWithFilteredResult(_0x546df5,_0xa7967d))[_0xc44c('0x3f')](handleError(_0x546df5,null));};exports['show']=function(_0x30fa62,_0x543710){var _0xbcadd0={'raw':![],'where':{'id':_0x30fa62[_0xc44c('0x40')]['id']}},_0x551dfc={};_0x551dfc['model']=_['keys'](db[_0xc44c('0x2a')][_0xc44c('0x2b')]);_0x551dfc[_0xc44c('0x2e')]=_[_0xc44c('0x41')](_0x30fa62[_0xc44c('0x2e')]);_0x551dfc[_0xc44c('0x37')]=_['intersection'](_0x551dfc['model'],_0x551dfc[_0xc44c('0x2e')]);_0xbcadd0[_0xc44c('0x31')]=_[_0xc44c('0x2f')](_0x551dfc[_0xc44c('0x30')],qs['fields'](_0x30fa62[_0xc44c('0x2e')][_0xc44c('0x32')]));_0xbcadd0['attributes']=_0xbcadd0['attributes'][_0xc44c('0x33')]?_0xbcadd0[_0xc44c('0x31')]:_0x551dfc[_0xc44c('0x30')];if(_0x30fa62[_0xc44c('0x2e')][_0xc44c('0x42')]){_0xbcadd0[_0xc44c('0x3c')]=[{'all':!![]}];}_0xbcadd0=_[_0xc44c('0x3a')]({},_0xbcadd0,_0x30fa62[_0xc44c('0x3b')]);return db[_0xc44c('0x2a')]['find'](_0xbcadd0)[_0xc44c('0x23')](handleEntityNotFound(_0x543710,null))[_0xc44c('0x23')](respondWithResult(_0x543710,null))[_0xc44c('0x3f')](handleError(_0x543710,null));};exports[_0xc44c('0x43')]=function(_0x446563,_0x3e492b){return db[_0xc44c('0x2a')][_0xc44c('0x43')](_0x446563[_0xc44c('0x44')],{})['then'](respondWithResult(_0x3e492b,0xc9))['catch'](handleError(_0x3e492b,null));};exports[_0xc44c('0x22')]=function(_0x1166ab,_0x456c95){if(_0x1166ab[_0xc44c('0x44')]['id']){delete _0x1166ab[_0xc44c('0x44')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x1166ab[_0xc44c('0x40')]['id']}})['then'](handleEntityNotFound(_0x456c95,null))[_0xc44c('0x23')](saveUpdates(_0x1166ab['body'],null))[_0xc44c('0x23')](respondWithResult(_0x456c95,null))['catch'](handleError(_0x456c95,null));};exports[_0xc44c('0x45')]=function(_0x58dd1f,_0x5f27a3){return db['SalesforceAccount'][_0xc44c('0x46')]({'where':{'id':_0x58dd1f[_0xc44c('0x40')]['id']}})[_0xc44c('0x23')](handleEntityNotFound(_0x5f27a3,null))[_0xc44c('0x23')](removeEntity(_0x5f27a3,null))[_0xc44c('0x3f')](handleError(_0x5f27a3,null));};exports[_0xc44c('0x47')]=function(_0x276c0b,_0x33834b,_0x110cb7){var _0x192796={};var _0x15a295={};var _0x14665d;var _0x322b75;return db[_0xc44c('0x2a')][_0xc44c('0x48')]({'where':{'id':_0x276c0b[_0xc44c('0x40')]['id']}})[_0xc44c('0x23')](handleEntityNotFound(_0x33834b,null))['then'](function(_0x22f177){if(_0x22f177){_0x14665d=_0x22f177;_0x15a295[_0xc44c('0x30')]=_[_0xc44c('0x41')](db[_0xc44c('0x49')][_0xc44c('0x2b')]);_0x15a295[_0xc44c('0x2e')]=_[_0xc44c('0x41')](_0x276c0b[_0xc44c('0x2e')]);_0x15a295[_0xc44c('0x37')]=_[_0xc44c('0x2f')](_0x15a295[_0xc44c('0x30')],_0x15a295[_0xc44c('0x2e')]);_0x192796[_0xc44c('0x31')]=_[_0xc44c('0x2f')](_0x15a295[_0xc44c('0x30')],qs[_0xc44c('0x32')](_0x276c0b[_0xc44c('0x2e')][_0xc44c('0x32')]));_0x192796['attributes']=_0x192796[_0xc44c('0x31')][_0xc44c('0x33')]?_0x192796[_0xc44c('0x31')]:_0x15a295[_0xc44c('0x30')];_0x192796[_0xc44c('0x4a')]=qs[_0xc44c('0x35')](_0x276c0b[_0xc44c('0x2e')][_0xc44c('0x35')]);_0x192796[_0xc44c('0x36')]=qs[_0xc44c('0x37')](_[_0xc44c('0x38')](_0x276c0b[_0xc44c('0x2e')],_0x15a295[_0xc44c('0x37')]));if(_0x276c0b['query'][_0xc44c('0x39')]){_0x192796[_0xc44c('0x36')]=_[_0xc44c('0x3a')](_0x192796[_0xc44c('0x36')],{'$or':_[_0xc44c('0x29')](_0x192796[_0xc44c('0x31')],function(_0x6de8ac){var _0x5b9e49={};_0x5b9e49[_0x6de8ac]={'$like':'%'+_0x276c0b[_0xc44c('0x2e')]['filter']+'%'};return _0x5b9e49;})});}_0x192796=_[_0xc44c('0x3a')]({},_0x192796,_0x276c0b[_0xc44c('0x3b')]);return _0x14665d[_0xc44c('0x47')](_0x192796);}})[_0xc44c('0x23')](function(_0x18b469){if(_0x18b469){_0x322b75=_0x18b469['length'];if(!_0x276c0b[_0xc44c('0x2e')][_0xc44c('0x4b')](_0xc44c('0x34'))){_0x192796['limit']=qs['limit'](_0x276c0b[_0xc44c('0x2e')][_0xc44c('0x1c')]);_0x192796[_0xc44c('0x19')]=qs['offset'](_0x276c0b[_0xc44c('0x2e')]['offset']);}return _0x14665d[_0xc44c('0x47')](_0x192796);}})['then'](function(_0x54357b){if(_0x54357b){return _0x54357b?{'count':_0x322b75,'rows':_0x54357b}:null;}})['then'](respondWithResult(_0x33834b,null))['catch'](handleError(_0x33834b,null));};exports[_0xc44c('0x4c')]=function(_0x46b530,_0x242156,_0x49513b){if(_0x46b530[_0xc44c('0x44')]['id']){delete _0x46b530['body']['id'];}return db[_0xc44c('0x2a')][_0xc44c('0x48')]({'where':{'id':_0x46b530[_0xc44c('0x40')]['id']}})[_0xc44c('0x23')](handleEntityNotFound(_0x242156,null))[_0xc44c('0x23')](function(_0x6796b5){if(_0x6796b5){_0x46b530[_0xc44c('0x44')][_0xc44c('0x4d')]=_0x6796b5['id'];_0x46b530[_0xc44c('0x44')][_0xc44c('0x4e')]=integrations[_0xc44c('0x4f')](_0x46b530[_0xc44c('0x44')][_0xc44c('0x50')],_0x46b530[_0xc44c('0x44')][_0xc44c('0x2d')]);_0x46b530[_0xc44c('0x44')]['Descriptions']=integrations[_0xc44c('0x51')](_0x46b530[_0xc44c('0x44')][_0xc44c('0x50')],_0x46b530[_0xc44c('0x44')]['type']);return db[_0xc44c('0x49')]['create'](_0x46b530[_0xc44c('0x44')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xc44c('0x52')],'as':_0xc44c('0x53')}]});}return null;})[_0xc44c('0x23')](respondWithResult(_0x242156,null))[_0xc44c('0x3f')](handleError(_0x242156,null));};exports[_0xc44c('0x54')]=function(_0x2089a1,_0x55d584,_0x53b0ec){var _0x4296fe;var _0x2289cb='';var _0x5ed974=_0xc44c('0x55');return db[_0xc44c('0x2a')]['findOne']({'where':{'id':_0x2089a1['params']['id']},'attributes':['id',_0xc44c('0x56'),_0xc44c('0x57'),_0xc44c('0x58'),_0xc44c('0x59'),_0xc44c('0x5a'),_0xc44c('0x5b')]})[_0xc44c('0x23')](handleEntityNotFound(_0x55d584,null))[_0xc44c('0x23')](function(_0x69ec62){if(_0x69ec62){_0x2289cb=_0x69ec62['remoteUri'];var _0x318a88=_0x2289cb[_0xc44c('0x5c')](-0x1);if(_0x318a88==='/'){_0x2289cb=_0x2289cb[_0xc44c('0x5d')](0x0,_0x2289cb[_0xc44c('0x5e')](_0x318a88));}_0x4296fe=new jsforce[(_0xc44c('0x5f'))]({'oauth2':{'loginUrl':_0x2289cb,'clientId':_0x69ec62[_0xc44c('0x57')],'clientSecret':_0x69ec62[_0xc44c('0x58')]}});return _0x4296fe[_0xc44c('0x60')](_0x69ec62['username'],_0x69ec62[_0xc44c('0x5a')]['concat'](_0x69ec62['securityToken']));}})[_0xc44c('0x23')](function(_0xc6c721){if(_0xc6c721){if(!_[_0xc44c('0x61')](_0x2089a1[_0xc44c('0x2e')][_0xc44c('0x62')])){_0x5ed974=_0x2089a1[_0xc44c('0x2e')][_0xc44c('0x62')];}return _0x4296fe['sobject'](_0x5ed974)[_0xc44c('0x63')]();}})[_0xc44c('0x23')](function(_0x8395df){var _0x3c86b8=[_0xc44c('0x64'),_0xc44c('0x65'),'IsReminderSet',_0xc44c('0x66'),_0xc44c('0x67'),_0xc44c('0x68')];var _0x589715=['string',_0xc44c('0x69'),_0xc44c('0x6a'),_0xc44c('0x6b'),'email','textarea',_0xc44c('0x6c')];if(_0x8395df){_[_0xc44c('0x6d')](_0x8395df[_0xc44c('0x32')],function(_0x1a4cb2){return _0x3c86b8['includes'](_0x1a4cb2[_0xc44c('0x26')])||!_0x589715[_0xc44c('0x6e')](_0x1a4cb2[_0xc44c('0x2d')]);});return{'count':_0x8395df[_0xc44c('0x32')][_0xc44c('0x33')],'rows':_[_0xc44c('0x29')](_0x8395df[_0xc44c('0x32')],function(_0x2454d7){return{'id':_0x2454d7['name'],'name':_0x2454d7[_0xc44c('0x6f')],'custom':_0x2454d7['custom'],'options':_0x2454d7[_0xc44c('0x70')]['length']>0x0?_[_0xc44c('0x29')](_0x2454d7['picklistValues'],function(_0x5959f8){return{'name':_0x5959f8['label'],'value':_0x5959f8[_0xc44c('0x71')]};}):_0x2454d7[_0xc44c('0x2d')]==_0xc44c('0x6b')?[{'name':_0xc44c('0x72'),'value':'true'},{'name':_0xc44c('0x73'),'value':'false'}]:[]};})};}})[_0xc44c('0x23')](respondWithResult(_0x55d584,null))[_0xc44c('0x3f')](function(_0x5adf87){var _0x4f42f6=_0x2089a1[_0xc44c('0x2e')][_0xc44c('0x74')]?0x1f4:_0x5adf87[_0xc44c('0x75')]||0x1f4;logger[_0xc44c('0x24')](_0xc44c('0x76'),_0xc44c('0x54'),_0x4f42f6,JSON['stringify'](_0x5adf87));delete _0x5adf87[_0xc44c('0x26')];if(_0x4f42f6===0x191){_0x4f42f6=0x190;}_0x55d584[_0xc44c('0x16')](_0x4f42f6)['send'](_0x2089a1[_0xc44c('0x2e')]['test']?{'message':_0xc44c('0x77'),'statusCode':_0x5adf87[_0xc44c('0x75')]}:_0x5adf87);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 1ad7de3..0ecdc89 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 _0x2bc1=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x4c3e36,_0x4be9f3){var _0x3136b4=function(_0x4916b8){while(--_0x4916b8){_0x4c3e36['push'](_0x4c3e36['shift']());}};_0x3136b4(++_0x4be9f3);}(_0x2bc1,0x11e));var _0x12bc=function(_0x27ef17,_0x5194a8){_0x27ef17=_0x27ef17-0x0;var _0x4e9e24=_0x2bc1[_0x27ef17];return _0x4e9e24;};'use strict';var _=require('lodash');var util=require(_0x12bc('0x0'));var logger=require(_0x12bc('0x1'))('api');var moment=require(_0x12bc('0x2'));var BPromise=require('bluebird');var rp=require(_0x12bc('0x3'));var fs=require('fs');var path=require(_0x12bc('0x4'));var rimraf=require(_0x12bc('0x5'));var config=require(_0x12bc('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x12bc('0x7')]=function(_0x28b14e,_0x31f56e){return _0x28b14e[_0x12bc('0x8')](_0x12bc('0x9'),attributes,{'tableName':_0x12bc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18e0=['define','SalesforceAccount','util','api','moment','bluebird','path','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x49508f,_0x172399){var _0x1787ef=function(_0x1a9f45){while(--_0x1a9f45){_0x49508f['push'](_0x49508f['shift']());}};_0x1787ef(++_0x172399);}(_0x18e0,0xa2));var _0x018e=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x18e0[_0x5f309e];return _0x487b5e;};'use strict';var _=require('lodash');var util=require(_0x018e('0x0'));var logger=require('../../config/logger')(_0x018e('0x1'));var moment=require(_0x018e('0x2'));var BPromise=require(_0x018e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x018e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x018e('0x5'));var integrations=require(_0x018e('0x6'));module[_0x018e('0x7')]=function(_0x50450b,_0x5b6638){return _0x50450b[_0x018e('0x8')](_0x018e('0x9'),attributes,{'tableName':'int_salesforce_accounts','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 b648b87..6f1e531 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 _0x444a=['attributes','limit','include','model','map','stringify','catch','ShowSalesforceAccount','find','where','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','SalesforceAccount','findAll','options','raw'];(function(_0x290801,_0x47db09){var _0x59ebd3=function(_0x158a74){while(--_0x158a74){_0x290801['push'](_0x290801['shift']());}};_0x59ebd3(++_0x47db09);}(_0x444a,0x1a1));var _0xa444=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x444a[_0x58e469];return _0x4c01c5;};'use strict';var _=require(_0xa444('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa444('0x1'));var rs=require(_0xa444('0x2'));var fs=require('fs');var Redis=require(_0xa444('0x3'));var db=require(_0xa444('0x4'))['db'];var utils=require(_0xa444('0x5'));var logger=require('../../config/logger')(_0xa444('0x6'));var config=require(_0xa444('0x7'));var jayson=require(_0xa444('0x8'));var client=jayson[_0xa444('0x9')][_0xa444('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e3ab2,_0x2253f7,_0x593382){return new BPromise(function(_0x4190ff,_0x4ef8f5){return client[_0xa444('0xb')](_0x3e3ab2,_0x593382)[_0xa444('0xc')](function(_0x320003){logger[_0xa444('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x2253f7,_0xa444('0xe'));logger[_0xa444('0xf')](_0xa444('0x10'),_0x2253f7,_0xa444('0xe'),JSON['stringify'](_0x320003));if(_0x320003[_0xa444('0x11')]){if(_0x320003['error'][_0xa444('0x12')]===0x1f4){logger[_0xa444('0x11')](_0xa444('0x13'),_0x2253f7,_0x320003['error']['message']);return _0x4ef8f5(_0x320003[_0xa444('0x11')]['message']);}logger[_0xa444('0x11')](_0xa444('0x13'),_0x2253f7,_0x320003[_0xa444('0x11')][_0xa444('0x14')]);return _0x4190ff(_0x320003['error']['message']);}else{logger[_0xa444('0xd')](_0xa444('0x13'),_0x2253f7,_0xa444('0xe'));_0x4190ff(_0x320003[_0xa444('0x15')][_0xa444('0x14')]);}})['catch'](function(_0x1036c5){logger[_0xa444('0x11')](_0xa444('0x13'),_0x2253f7,_0x1036c5);_0x4ef8f5(_0x1036c5);});});}exports[_0xa444('0x16')]=function(_0x54e9f1){var _0x3e02b7=this;return new Promise(function(_0x10672a,_0x35db0d){return db[_0xa444('0x17')][_0xa444('0x18')]({'raw':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1a')]===undefined?!![]:![]:!![],'where':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')]['where']||null:null,'attributes':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1b')]||null:null,'limit':_0x54e9f1['options']?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1c')]||null:null,'include':_0x54e9f1[_0xa444('0x19')]?_0x54e9f1[_0xa444('0x19')][_0xa444('0x1d')]?_['map'](_0x54e9f1[_0xa444('0x19')][_0xa444('0x1d')],function(_0x55af1a){return{'model':db[_0x55af1a['model']],'as':_0x55af1a['as'],'attributes':_0x55af1a[_0xa444('0x1b')],'include':_0x55af1a['include']?_['map'](_0x55af1a[_0xa444('0x1d')],function(_0x98ffa4){return{'model':db[_0x98ffa4[_0xa444('0x1e')]],'as':_0x98ffa4['as'],'attributes':_0x98ffa4[_0xa444('0x1b')],'include':_0x98ffa4[_0xa444('0x1d')]?_[_0xa444('0x1f')](_0x98ffa4['include'],function(_0x2ac298){return{'model':db[_0x2ac298[_0xa444('0x1e')]],'as':_0x2ac298['as'],'attributes':_0x2ac298['attributes']};}):[]};}):[]};}):[]:[]})[_0xa444('0xc')](function(_0x6dcc28){logger['info'](_0xa444('0x16'),_0x54e9f1);logger['debug'](_0xa444('0x16'),_0x54e9f1,JSON[_0xa444('0x20')](_0x6dcc28));_0x10672a(_0x6dcc28);})[_0xa444('0x21')](function(_0x4d0605){logger[_0xa444('0x11')](_0xa444('0x16'),_0x4d0605[_0xa444('0x14')],_0x54e9f1);_0x35db0d(_0x3e02b7[_0xa444('0x11')](0x1f4,_0x4d0605[_0xa444('0x14')]));});});};exports[_0xa444('0x22')]=function(_0x4e0ee3){var _0x58c043=this;return new Promise(function(_0x94173b,_0x10230a){return db[_0xa444('0x17')][_0xa444('0x23')]({'raw':_0x4e0ee3['options']?_0x4e0ee3[_0xa444('0x19')][_0xa444('0x1a')]===undefined?!![]:![]:!![],'where':_0x4e0ee3[_0xa444('0x19')]?_0x4e0ee3[_0xa444('0x19')][_0xa444('0x24')]||null:null,'attributes':_0x4e0ee3['options']?_0x4e0ee3[_0xa444('0x19')][_0xa444('0x1b')]||null:null,'include':_0x4e0ee3[_0xa444('0x19')]?_0x4e0ee3['options'][_0xa444('0x1d')]?_['map'](_0x4e0ee3[_0xa444('0x19')]['include'],function(_0x22b29a){return{'model':db[_0x22b29a['model']],'as':_0x22b29a['as'],'attributes':_0x22b29a['attributes'],'include':_0x22b29a[_0xa444('0x1d')]?_[_0xa444('0x1f')](_0x22b29a[_0xa444('0x1d')],function(_0x262d33){return{'model':db[_0x262d33['model']],'as':_0x262d33['as'],'attributes':_0x262d33[_0xa444('0x1b')],'include':_0x262d33[_0xa444('0x1d')]?_[_0xa444('0x1f')](_0x262d33['include'],function(_0x3365eb){return{'model':db[_0x3365eb[_0xa444('0x1e')]],'as':_0x3365eb['as'],'attributes':_0x3365eb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40d4fb){logger[_0xa444('0xd')](_0xa444('0x22'),_0x4e0ee3);logger[_0xa444('0xf')](_0xa444('0x22'),_0x4e0ee3,JSON[_0xa444('0x20')](_0x40d4fb));_0x94173b(_0x40d4fb);})[_0xa444('0x21')](function(_0x4aa5a8){logger[_0xa444('0x11')](_0xa444('0x22'),_0x4aa5a8[_0xa444('0x14')],_0x4e0ee3);_0x10230a(_0x58c043[_0xa444('0x11')](0x1f4,_0x4aa5a8['message']));});});}; \ No newline at end of file +var _0xce47=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','find','lodash','moment'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xce47,0x17f));var _0x7ce4=function(_0x412691,_0x1eddbd){_0x412691=_0x412691-0x0;var _0x1e2221=_0xce47[_0x412691];return _0x1e2221;};'use strict';var _=require(_0x7ce4('0x0'));var util=require('util');var moment=require(_0x7ce4('0x1'));var BPromise=require(_0x7ce4('0x2'));var rs=require(_0x7ce4('0x3'));var fs=require('fs');var Redis=require(_0x7ce4('0x4'));var db=require(_0x7ce4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ce4('0x6'))('rpc');var config=require(_0x7ce4('0x7'));var jayson=require(_0x7ce4('0x8'));var client=jayson[_0x7ce4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd4cb22,_0x4d699a,_0x39e342){return new BPromise(function(_0x485fe4,_0x58013b){return client['request'](_0xd4cb22,_0x39e342)[_0x7ce4('0xa')](function(_0x4e664a){logger[_0x7ce4('0xb')](_0x7ce4('0xc'),_0x4d699a,'request\x20sent');logger[_0x7ce4('0xd')](_0x7ce4('0xe'),_0x4d699a,_0x7ce4('0xf'),JSON['stringify'](_0x4e664a));if(_0x4e664a[_0x7ce4('0x10')]){if(_0x4e664a['error'][_0x7ce4('0x11')]===0x1f4){logger[_0x7ce4('0x10')](_0x7ce4('0xc'),_0x4d699a,_0x4e664a[_0x7ce4('0x10')][_0x7ce4('0x12')]);return _0x58013b(_0x4e664a[_0x7ce4('0x10')][_0x7ce4('0x12')]);}logger[_0x7ce4('0x10')](_0x7ce4('0xc'),_0x4d699a,_0x4e664a[_0x7ce4('0x10')]['message']);return _0x485fe4(_0x4e664a[_0x7ce4('0x10')][_0x7ce4('0x12')]);}else{logger['info'](_0x7ce4('0xc'),_0x4d699a,_0x7ce4('0xf'));_0x485fe4(_0x4e664a[_0x7ce4('0x13')][_0x7ce4('0x12')]);}})[_0x7ce4('0x14')](function(_0xc97d97){logger[_0x7ce4('0x10')](_0x7ce4('0xc'),_0x4d699a,_0xc97d97);_0x58013b(_0xc97d97);});});}exports[_0x7ce4('0x15')]=function(_0x2a64a3){var _0x482c23=this;return new Promise(function(_0xbcc55b,_0x505134){return db[_0x7ce4('0x16')][_0x7ce4('0x17')]({'raw':_0x2a64a3['options']?_0x2a64a3[_0x7ce4('0x18')][_0x7ce4('0x19')]===undefined?!![]:![]:!![],'where':_0x2a64a3['options']?_0x2a64a3[_0x7ce4('0x18')][_0x7ce4('0x1a')]||null:null,'attributes':_0x2a64a3[_0x7ce4('0x18')]?_0x2a64a3[_0x7ce4('0x18')][_0x7ce4('0x1b')]||null:null,'limit':_0x2a64a3['options']?_0x2a64a3[_0x7ce4('0x18')][_0x7ce4('0x1c')]||null:null,'include':_0x2a64a3['options']?_0x2a64a3[_0x7ce4('0x18')][_0x7ce4('0x1d')]?_['map'](_0x2a64a3[_0x7ce4('0x18')][_0x7ce4('0x1d')],function(_0xb5e654){return{'model':db[_0xb5e654['model']],'as':_0xb5e654['as'],'attributes':_0xb5e654[_0x7ce4('0x1b')],'include':_0xb5e654[_0x7ce4('0x1d')]?_[_0x7ce4('0x1e')](_0xb5e654['include'],function(_0x15570a){return{'model':db[_0x15570a[_0x7ce4('0x1f')]],'as':_0x15570a['as'],'attributes':_0x15570a['attributes'],'include':_0x15570a[_0x7ce4('0x1d')]?_['map'](_0x15570a['include'],function(_0x587a2b){return{'model':db[_0x587a2b[_0x7ce4('0x1f')]],'as':_0x587a2b['as'],'attributes':_0x587a2b[_0x7ce4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dd2de){logger['info'](_0x7ce4('0x15'),_0x2a64a3);logger[_0x7ce4('0xd')](_0x7ce4('0x15'),_0x2a64a3,JSON[_0x7ce4('0x20')](_0x2dd2de));_0xbcc55b(_0x2dd2de);})['catch'](function(_0x376177){logger[_0x7ce4('0x10')](_0x7ce4('0x15'),_0x376177[_0x7ce4('0x12')],_0x2a64a3);_0x505134(_0x482c23[_0x7ce4('0x10')](0x1f4,_0x376177[_0x7ce4('0x12')]));});});};exports[_0x7ce4('0x21')]=function(_0x2cb8bf){var _0x222f11=this;return new Promise(function(_0x2db32c,_0x3f313e){return db[_0x7ce4('0x16')][_0x7ce4('0x22')]({'raw':_0x2cb8bf[_0x7ce4('0x18')]?_0x2cb8bf[_0x7ce4('0x18')][_0x7ce4('0x19')]===undefined?!![]:![]:!![],'where':_0x2cb8bf[_0x7ce4('0x18')]?_0x2cb8bf['options'][_0x7ce4('0x1a')]||null:null,'attributes':_0x2cb8bf['options']?_0x2cb8bf[_0x7ce4('0x18')][_0x7ce4('0x1b')]||null:null,'include':_0x2cb8bf[_0x7ce4('0x18')]?_0x2cb8bf['options'][_0x7ce4('0x1d')]?_[_0x7ce4('0x1e')](_0x2cb8bf[_0x7ce4('0x18')]['include'],function(_0x8aedb3){return{'model':db[_0x8aedb3['model']],'as':_0x8aedb3['as'],'attributes':_0x8aedb3[_0x7ce4('0x1b')],'include':_0x8aedb3['include']?_['map'](_0x8aedb3[_0x7ce4('0x1d')],function(_0x1b0f01){return{'model':db[_0x1b0f01[_0x7ce4('0x1f')]],'as':_0x1b0f01['as'],'attributes':_0x1b0f01['attributes'],'include':_0x1b0f01[_0x7ce4('0x1d')]?_[_0x7ce4('0x1e')](_0x1b0f01['include'],function(_0x551e93){return{'model':db[_0x551e93['model']],'as':_0x551e93['as'],'attributes':_0x551e93[_0x7ce4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c02a1){logger[_0x7ce4('0xb')]('ShowSalesforceAccount',_0x2cb8bf);logger['debug']('ShowSalesforceAccount',_0x2cb8bf,JSON[_0x7ce4('0x20')](_0x1c02a1));_0x2db32c(_0x1c02a1);})[_0x7ce4('0x14')](function(_0x421ec9){logger['error'](_0x7ce4('0x21'),_0x421ec9['message'],_0x2cb8bf);_0x3f313e(_0x222f11['error'](0x1f4,_0x421ec9[_0x7ce4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 26913ff..109861d 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 _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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdb28,0x106));var _0x8db2=function(_0x43f33c,_0x5d106f){_0x43f33c=_0x43f33c-0x0;var _0x4bd35c=_0xdb28[_0x43f33c];return _0x4bd35c;};'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 +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(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xdb28,0x106));var _0x8db2=function(_0x162c81,_0x139a43){_0x162c81=_0x162c81-0x0;var _0x21cf42=_0xdb28[_0x162c81];return _0x21cf42;};'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 e45775b..a447abf 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 _0xd988=['Case','contact','lead','contact_lead','nothing','account','sequelize','exports','STRING','ENUM','Task'];(function(_0x5c424d,_0x495a5c){var _0x19d803=function(_0x3d1ba5){while(--_0x3d1ba5){_0x5c424d['push'](_0x5c424d['shift']());}};_0x19d803(++_0x495a5c);}(_0xd988,0x1d4));var _0x8d98=function(_0xb7dfe4,_0x26d5b6){_0xb7dfe4=_0xb7dfe4-0x0;var _0x5b16af=_0xd988[_0xb7dfe4];return _0x5b16af;};'use strict';var Sequelize=require(_0x8d98('0x0'));module[_0x8d98('0x1')]={'name':{'type':Sequelize[_0x8d98('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x8d98('0x3')](_0x8d98('0x4'),_0x8d98('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x8d98('0x3')]('contact_lead',_0x8d98('0x6'),_0x8d98('0x7'),'account_contact_lead','account'),'defaultValue':_0x8d98('0x8')},'moduleCreate':{'type':Sequelize[_0x8d98('0x3')](_0x8d98('0x9'),_0x8d98('0x6'),_0x8d98('0x7'),_0x8d98('0xa')),'defaultValue':_0x8d98('0x7')},'leadId':{'type':Sequelize[_0x8d98('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x8d98('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x8d98('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x8d98('0x2')]}}; \ No newline at end of file +var _0x52e3=['STRING','ENUM','Task','Case','contact','lead','account','sequelize','exports'];(function(_0x99b4e1,_0x30611b){var _0x24e4e4=function(_0xcf5f67){while(--_0xcf5f67){_0x99b4e1['push'](_0x99b4e1['shift']());}};_0x24e4e4(++_0x30611b);}(_0x52e3,0x1ae));var _0x352e=function(_0x4ddf7d,_0x3fcab2){_0x4ddf7d=_0x4ddf7d-0x0;var _0x3cd6d5=_0x52e3[_0x4ddf7d];return _0x3cd6d5;};'use strict';var Sequelize=require(_0x352e('0x0'));module[_0x352e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x352e('0x2')]},'ticketType':{'type':Sequelize[_0x352e('0x3')](_0x352e('0x4'),_0x352e('0x5')),'defaultValue':_0x352e('0x4')},'moduleSearch':{'type':Sequelize[_0x352e('0x3')]('contact_lead',_0x352e('0x6'),_0x352e('0x7'),'account_contact_lead',_0x352e('0x8')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x352e('0x3')]('nothing',_0x352e('0x6'),_0x352e('0x7'),'account'),'defaultValue':_0x352e('0x7')},'leadId':{'type':Sequelize[_0x352e('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x352e('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x352e('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x352e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index c99f579..bc7279d 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 _0x2831=['fields','length','hasOwnProperty','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getFields','sort','nolimit','getSubjects','order','findOne','SalesforceField','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes'];(function(_0x3c8b02,_0x2d7906){var _0x436d48=function(_0x189968){while(--_0x189968){_0x3c8b02['push'](_0x3c8b02['shift']());}};_0x436d48(++_0x2d7906);}(_0x2831,0x1ee));var _0x1283=function(_0x1d0b2e,_0x1a6a14){_0x1d0b2e=_0x1d0b2e-0x0;var _0x58e36c=_0x2831[_0x1d0b2e];return _0x58e36c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1283('0x0'));var zipdir=require(_0x1283('0x1'));var jsonpatch=require(_0x1283('0x2'));var rp=require('request-promise');var moment=require(_0x1283('0x3'));var BPromise=require(_0x1283('0x4'));var Mustache=require(_0x1283('0x5'));var util=require(_0x1283('0x6'));var path=require(_0x1283('0x7'));var sox=require(_0x1283('0x8'));var csv=require(_0x1283('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1283('0xa'));var _=require('lodash');var squel=require(_0x1283('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1283('0xc'));var toCsv=require(_0x1283('0x9'));var querystring=require(_0x1283('0xd'));var Papa=require(_0x1283('0xe'));var Redis=require(_0x1283('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1283('0x10'));var logger=require('../../config/logger')(_0x1283('0x11'));var utils=require(_0x1283('0x12'));var config=require(_0x1283('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1283('0x14'))['db'];function respondWithStatusCode(_0x21f6dd,_0x2667be){_0x2667be=_0x2667be||0xcc;return function(_0x20074c){if(_0x20074c){return _0x21f6dd['sendStatus'](_0x2667be);}return _0x21f6dd[_0x1283('0x15')](_0x2667be)[_0x1283('0x16')]();};}function respondWithResult(_0x43a3ab,_0xb45b2c){_0xb45b2c=_0xb45b2c||0xc8;return function(_0x135c8e){if(_0x135c8e){return _0x43a3ab[_0x1283('0x15')](_0xb45b2c)[_0x1283('0x17')](_0x135c8e);}};}function respondWithFilteredResult(_0x3a4582,_0x1ed12d){return function(_0x23d41e){if(_0x23d41e){var _0xa89652=typeof _0x1ed12d[_0x1283('0x18')]===_0x1283('0x19')&&typeof _0x1ed12d[_0x1283('0x1a')]===_0x1283('0x19');var _0x33018e=_0x23d41e['count'];var _0x14ac2a=_0xa89652?0x0:_0x1ed12d['offset'];var _0x37f753=_0xa89652?_0x23d41e[_0x1283('0x1b')]:_0x1ed12d[_0x1283('0x18')]+_0x1ed12d[_0x1283('0x1a')];var _0x15210b;if(_0x37f753>=_0x33018e){_0x37f753=_0x33018e;_0x15210b=0xc8;}else{_0x15210b=0xce;}_0x3a4582[_0x1283('0x15')](_0x15210b);return _0x3a4582[_0x1283('0x1c')](_0x1283('0x1d'),_0x14ac2a+'-'+_0x37f753+'/'+_0x33018e)[_0x1283('0x17')](_0x23d41e);}return null;};}function patchUpdates(_0x1c0370){return function(_0x180eca){try{jsonpatch['apply'](_0x180eca,_0x1c0370,!![]);}catch(_0x4893d8){return BPromise[_0x1283('0x1e')](_0x4893d8);}return _0x180eca[_0x1283('0x1f')]();};}function saveUpdates(_0x1bd5e2,_0x21f778){return function(_0x177e74){if(_0x177e74){return _0x177e74[_0x1283('0x20')](_0x1bd5e2)[_0x1283('0x21')](function(_0x239507){return _0x239507;});}return null;};}function removeEntity(_0x282fb,_0x2d6327){return function(_0x5e1665){if(_0x5e1665){return _0x5e1665[_0x1283('0x22')]()[_0x1283('0x21')](function(){_0x282fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x393aea,_0x1e6d0d){return function(_0x466974){if(!_0x466974){_0x393aea['sendStatus'](0x194);}return _0x466974;};}function handleError(_0x3e71f5,_0x4107f7){_0x4107f7=_0x4107f7||0x1f4;return function(_0x43b0fc){logger[_0x1283('0x23')](_0x43b0fc[_0x1283('0x24')]);if(_0x43b0fc[_0x1283('0x25')]){delete _0x43b0fc[_0x1283('0x25')];}_0x3e71f5[_0x1283('0x15')](_0x4107f7)[_0x1283('0x26')](_0x43b0fc);};}exports[_0x1283('0x27')]=function(_0x5bd19c,_0x40f815){var _0x21f169={},_0x16fffa={},_0x5aed66={'count':0x0,'rows':[]};var _0x4ece08=_['map'](db[_0x1283('0x28')][_0x1283('0x29')],function(_0x164254){return{'name':_0x164254[_0x1283('0x2a')],'type':_0x164254[_0x1283('0x2b')][_0x1283('0x2c')]};});_0x16fffa[_0x1283('0x2d')]=_[_0x1283('0x2e')](_0x4ece08,_0x1283('0x25'));_0x16fffa['query']=_[_0x1283('0x2f')](_0x5bd19c[_0x1283('0x30')]);_0x16fffa[_0x1283('0x31')]=_[_0x1283('0x32')](_0x16fffa[_0x1283('0x2d')],_0x16fffa['query']);_0x21f169[_0x1283('0x33')]=_['intersection'](_0x16fffa['model'],qs[_0x1283('0x34')](_0x5bd19c[_0x1283('0x30')][_0x1283('0x34')]));_0x21f169[_0x1283('0x33')]=_0x21f169[_0x1283('0x33')][_0x1283('0x35')]?_0x21f169['attributes']:_0x16fffa[_0x1283('0x2d')];if(!_0x5bd19c['query'][_0x1283('0x36')]('nolimit')){_0x21f169[_0x1283('0x1a')]=qs[_0x1283('0x1a')](_0x5bd19c['query'][_0x1283('0x1a')]);_0x21f169['offset']=qs[_0x1283('0x18')](_0x5bd19c[_0x1283('0x30')][_0x1283('0x18')]);}_0x21f169['order']=qs['sort'](_0x5bd19c[_0x1283('0x30')]['sort']);_0x21f169[_0x1283('0x37')]=qs[_0x1283('0x31')](_[_0x1283('0x38')](_0x5bd19c[_0x1283('0x30')],_0x16fffa['filters']),_0x4ece08);if(_0x5bd19c[_0x1283('0x30')][_0x1283('0x39')]){_0x21f169[_0x1283('0x37')]=_[_0x1283('0x3a')](_0x21f169[_0x1283('0x37')],{'$or':_[_0x1283('0x2e')](_0x4ece08,function(_0x4e967a){if(_0x4e967a['type']!=='VIRTUAL'){var _0x4b8d6f={};_0x4b8d6f[_0x4e967a[_0x1283('0x25')]]={'$like':'%'+_0x5bd19c[_0x1283('0x30')][_0x1283('0x39')]+'%'};return _0x4b8d6f;}})});}_0x21f169=_[_0x1283('0x3a')]({},_0x21f169,_0x5bd19c[_0x1283('0x3b')]);var _0x4b9343={'where':_0x21f169[_0x1283('0x37')]};return db[_0x1283('0x28')][_0x1283('0x1b')](_0x4b9343)[_0x1283('0x21')](function(_0x346899){_0x5aed66[_0x1283('0x1b')]=_0x346899;if(_0x5bd19c[_0x1283('0x30')][_0x1283('0x3c')]){_0x21f169['include']=[{'all':!![]}];}return db[_0x1283('0x28')][_0x1283('0x3d')](_0x21f169);})[_0x1283('0x21')](function(_0x1e8d9a){_0x5aed66[_0x1283('0x3e')]=_0x1e8d9a;return _0x5aed66;})[_0x1283('0x21')](respondWithFilteredResult(_0x40f815,_0x21f169))[_0x1283('0x3f')](handleError(_0x40f815,null));};exports[_0x1283('0x40')]=function(_0x2f8215,_0x33e1db){var _0x2d61df={'raw':![],'where':{'id':_0x2f8215[_0x1283('0x41')]['id']}},_0x2f237f={};_0x2f237f['model']=_[_0x1283('0x2f')](db['SalesforceConfiguration']['rawAttributes']);_0x2f237f[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x2f8215[_0x1283('0x30')]);_0x2f237f[_0x1283('0x31')]=_[_0x1283('0x32')](_0x2f237f[_0x1283('0x2d')],_0x2f237f['query']);_0x2d61df['attributes']=_[_0x1283('0x32')](_0x2f237f[_0x1283('0x2d')],qs[_0x1283('0x34')](_0x2f8215[_0x1283('0x30')][_0x1283('0x34')]));_0x2d61df[_0x1283('0x33')]=_0x2d61df['attributes'][_0x1283('0x35')]?_0x2d61df[_0x1283('0x33')]:_0x2f237f[_0x1283('0x2d')];if(_0x2f8215[_0x1283('0x30')][_0x1283('0x3c')]){_0x2d61df[_0x1283('0x42')]=[{'all':!![]}];}_0x2d61df=_[_0x1283('0x3a')]({},_0x2d61df,_0x2f8215[_0x1283('0x3b')]);return db['SalesforceConfiguration'][_0x1283('0x43')](_0x2d61df)[_0x1283('0x21')](handleEntityNotFound(_0x33e1db,null))[_0x1283('0x21')](respondWithResult(_0x33e1db,null))[_0x1283('0x3f')](handleError(_0x33e1db,null));};exports[_0x1283('0x44')]=function(_0x24164c,_0xe4cc40){return db[_0x1283('0x28')][_0x1283('0x44')](_0x24164c[_0x1283('0x45')],{})['then'](respondWithResult(_0xe4cc40,0xc9))[_0x1283('0x3f')](handleError(_0xe4cc40,null));};exports[_0x1283('0x20')]=function(_0x45d2a4,_0x2f0354){if(_0x45d2a4['body']['id']){delete _0x45d2a4['body']['id'];}return db[_0x1283('0x28')][_0x1283('0x43')]({'where':{'id':_0x45d2a4[_0x1283('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f0354,null))[_0x1283('0x21')](saveUpdates(_0x45d2a4[_0x1283('0x45')],null))[_0x1283('0x21')](respondWithResult(_0x2f0354,null))[_0x1283('0x3f')](handleError(_0x2f0354,null));};exports[_0x1283('0x22')]=function(_0x5306f5,_0x468498){return db[_0x1283('0x28')][_0x1283('0x43')]({'where':{'id':_0x5306f5[_0x1283('0x41')]['id']}})[_0x1283('0x21')](handleEntityNotFound(_0x468498,null))['then'](removeEntity(_0x468498,null))[_0x1283('0x3f')](handleError(_0x468498,null));};exports[_0x1283('0x46')]=function(_0x3762fb,_0x1515cc,_0x8edd75){var _0x48f167={};var _0x87e397={};var _0x53318e;var _0x416a82;return db[_0x1283('0x28')]['findOne']({'where':{'id':_0x3762fb['params']['id']}})['then'](handleEntityNotFound(_0x1515cc,null))[_0x1283('0x21')](function(_0x126ea2){if(_0x126ea2){_0x53318e=_0x126ea2;_0x87e397[_0x1283('0x2d')]=_[_0x1283('0x2f')](db['SalesforceField'][_0x1283('0x29')]);_0x87e397[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x3762fb[_0x1283('0x30')]);_0x87e397['filters']=_['intersection'](_0x87e397['model'],_0x87e397[_0x1283('0x30')]);_0x48f167[_0x1283('0x33')]=_[_0x1283('0x32')](_0x87e397[_0x1283('0x2d')],qs[_0x1283('0x34')](_0x3762fb[_0x1283('0x30')][_0x1283('0x34')]));_0x48f167[_0x1283('0x33')]=_0x48f167[_0x1283('0x33')][_0x1283('0x35')]?_0x48f167[_0x1283('0x33')]:_0x87e397[_0x1283('0x2d')];_0x48f167['order']=qs[_0x1283('0x47')](_0x3762fb[_0x1283('0x30')]['sort']);_0x48f167[_0x1283('0x37')]=qs['filters'](_[_0x1283('0x38')](_0x3762fb[_0x1283('0x30')],_0x87e397[_0x1283('0x31')]));if(_0x3762fb[_0x1283('0x30')][_0x1283('0x39')]){_0x48f167[_0x1283('0x37')]=_['merge'](_0x48f167[_0x1283('0x37')],{'$or':_[_0x1283('0x2e')](_0x48f167[_0x1283('0x33')],function(_0x5b2f58){var _0x366304={};_0x366304[_0x5b2f58]={'$like':'%'+_0x3762fb[_0x1283('0x30')][_0x1283('0x39')]+'%'};return _0x366304;})});}_0x48f167=_[_0x1283('0x3a')]({},_0x48f167,_0x3762fb[_0x1283('0x3b')]);return _0x53318e[_0x1283('0x46')](_0x48f167);}})['then'](function(_0x56f258){if(_0x56f258){_0x416a82=_0x56f258[_0x1283('0x35')];if(!_0x3762fb['query'][_0x1283('0x36')](_0x1283('0x48'))){_0x48f167[_0x1283('0x1a')]=qs[_0x1283('0x1a')](_0x3762fb[_0x1283('0x30')]['limit']);_0x48f167[_0x1283('0x18')]=qs[_0x1283('0x18')](_0x3762fb[_0x1283('0x30')][_0x1283('0x18')]);}return _0x53318e[_0x1283('0x46')](_0x48f167);}})[_0x1283('0x21')](function(_0x2ba816){if(_0x2ba816){return _0x2ba816?{'count':_0x416a82,'rows':_0x2ba816}:null;}})[_0x1283('0x21')](respondWithResult(_0x1515cc,null))[_0x1283('0x3f')](handleError(_0x1515cc,null));};exports[_0x1283('0x49')]=function(_0x17cbfe,_0x16a1c8,_0x183021){var _0x371688={};var _0x5c2cf4={};var _0x3b5a5b;var _0x33bbf3;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x17cbfe[_0x1283('0x41')]['id']}})[_0x1283('0x21')](handleEntityNotFound(_0x16a1c8,null))['then'](function(_0x409eb2){if(_0x409eb2){_0x3b5a5b=_0x409eb2;_0x5c2cf4[_0x1283('0x2d')]=_[_0x1283('0x2f')](db['SalesforceField'][_0x1283('0x29')]);_0x5c2cf4[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x17cbfe['query']);_0x5c2cf4[_0x1283('0x31')]=_[_0x1283('0x32')](_0x5c2cf4[_0x1283('0x2d')],_0x5c2cf4[_0x1283('0x30')]);_0x371688['attributes']=_['intersection'](_0x5c2cf4[_0x1283('0x2d')],qs[_0x1283('0x34')](_0x17cbfe[_0x1283('0x30')]['fields']));_0x371688[_0x1283('0x33')]=_0x371688[_0x1283('0x33')]['length']?_0x371688[_0x1283('0x33')]:_0x5c2cf4['model'];_0x371688[_0x1283('0x4a')]=qs[_0x1283('0x47')](_0x17cbfe[_0x1283('0x30')][_0x1283('0x47')]);_0x371688[_0x1283('0x37')]=qs[_0x1283('0x31')](_[_0x1283('0x38')](_0x17cbfe['query'],_0x5c2cf4[_0x1283('0x31')]));if(_0x17cbfe['query'][_0x1283('0x39')]){_0x371688['where']=_['merge'](_0x371688[_0x1283('0x37')],{'$or':_[_0x1283('0x2e')](_0x371688[_0x1283('0x33')],function(_0x4fddac){var _0x3dd932={};_0x3dd932[_0x4fddac]={'$like':'%'+_0x17cbfe['query'][_0x1283('0x39')]+'%'};return _0x3dd932;})});}_0x371688=_[_0x1283('0x3a')]({},_0x371688,_0x17cbfe[_0x1283('0x3b')]);return _0x3b5a5b[_0x1283('0x49')](_0x371688);}})[_0x1283('0x21')](function(_0x9a503b){if(_0x9a503b){_0x33bbf3=_0x9a503b[_0x1283('0x35')];if(!_0x17cbfe['query'][_0x1283('0x36')]('nolimit')){_0x371688[_0x1283('0x1a')]=qs['limit'](_0x17cbfe[_0x1283('0x30')]['limit']);_0x371688[_0x1283('0x18')]=qs[_0x1283('0x18')](_0x17cbfe['query'][_0x1283('0x18')]);}return _0x3b5a5b[_0x1283('0x49')](_0x371688);}})[_0x1283('0x21')](function(_0x3cf877){if(_0x3cf877){return _0x3cf877?{'count':_0x33bbf3,'rows':_0x3cf877}:null;}})[_0x1283('0x21')](respondWithResult(_0x16a1c8,null))[_0x1283('0x3f')](handleError(_0x16a1c8,null));};exports['getDescriptions']=function(_0x3ff036,_0x5ecec8,_0x56b3be){var _0x2dc91e={};var _0x50372e={};var _0x461956;var _0x19eb58;return db['SalesforceConfiguration'][_0x1283('0x4b')]({'where':{'id':_0x3ff036[_0x1283('0x41')]['id']}})[_0x1283('0x21')](handleEntityNotFound(_0x5ecec8,null))['then'](function(_0x5792a1){if(_0x5792a1){_0x461956=_0x5792a1;_0x50372e['model']=_[_0x1283('0x2f')](db[_0x1283('0x4c')]['rawAttributes']);_0x50372e[_0x1283('0x30')]=_[_0x1283('0x2f')](_0x3ff036[_0x1283('0x30')]);_0x50372e[_0x1283('0x31')]=_[_0x1283('0x32')](_0x50372e[_0x1283('0x2d')],_0x50372e[_0x1283('0x30')]);_0x2dc91e[_0x1283('0x33')]=_['intersection'](_0x50372e[_0x1283('0x2d')],qs['fields'](_0x3ff036[_0x1283('0x30')][_0x1283('0x34')]));_0x2dc91e[_0x1283('0x33')]=_0x2dc91e[_0x1283('0x33')][_0x1283('0x35')]?_0x2dc91e[_0x1283('0x33')]:_0x50372e[_0x1283('0x2d')];_0x2dc91e[_0x1283('0x4a')]=qs['sort'](_0x3ff036[_0x1283('0x30')]['sort']);_0x2dc91e['where']=qs[_0x1283('0x31')](_['pick'](_0x3ff036[_0x1283('0x30')],_0x50372e[_0x1283('0x31')]));if(_0x3ff036['query'][_0x1283('0x39')]){_0x2dc91e['where']=_[_0x1283('0x3a')](_0x2dc91e[_0x1283('0x37')],{'$or':_['map'](_0x2dc91e['attributes'],function(_0x3eb44e){var _0x32b56d={};_0x32b56d[_0x3eb44e]={'$like':'%'+_0x3ff036['query'][_0x1283('0x39')]+'%'};return _0x32b56d;})});}_0x2dc91e=_[_0x1283('0x3a')]({},_0x2dc91e,_0x3ff036[_0x1283('0x3b')]);return _0x461956[_0x1283('0x4d')](_0x2dc91e);}})[_0x1283('0x21')](function(_0x1524c5){if(_0x1524c5){_0x19eb58=_0x1524c5['length'];if(!_0x3ff036[_0x1283('0x30')][_0x1283('0x36')](_0x1283('0x48'))){_0x2dc91e['limit']=qs[_0x1283('0x1a')](_0x3ff036[_0x1283('0x30')][_0x1283('0x1a')]);_0x2dc91e[_0x1283('0x18')]=qs[_0x1283('0x18')](_0x3ff036[_0x1283('0x30')][_0x1283('0x18')]);}return _0x461956[_0x1283('0x4d')](_0x2dc91e);}})[_0x1283('0x21')](function(_0x4ddc38){if(_0x4ddc38){return _0x4ddc38?{'count':_0x19eb58,'rows':_0x4ddc38}:null;}})[_0x1283('0x21')](respondWithResult(_0x5ecec8,null))[_0x1283('0x3f')](handleError(_0x5ecec8,null));}; \ No newline at end of file +var _0xabe7=['index','map','SalesforceConfiguration','rawAttributes','fieldName','type','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','findOne','SalesforceField','length','nolimit','getFields','getSubjects','getDescriptions','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','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','count','limit','status','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name'];(function(_0x2fbe40,_0xde4bdb){var _0x5b25f7=function(_0x3c8856){while(--_0x3c8856){_0x2fbe40['push'](_0x2fbe40['shift']());}};_0x5b25f7(++_0xde4bdb);}(_0xabe7,0xce));var _0x7abe=function(_0x7d281c,_0x433751){_0x7d281c=_0x7d281c-0x0;var _0x1b5730=_0xabe7[_0x7d281c];return _0x1b5730;};'use strict';var emlformat=require(_0x7abe('0x0'));var rimraf=require(_0x7abe('0x1'));var zipdir=require(_0x7abe('0x2'));var jsonpatch=require(_0x7abe('0x3'));var rp=require(_0x7abe('0x4'));var moment=require(_0x7abe('0x5'));var BPromise=require(_0x7abe('0x6'));var Mustache=require(_0x7abe('0x7'));var util=require(_0x7abe('0x8'));var path=require(_0x7abe('0x9'));var sox=require(_0x7abe('0xa'));var csv=require(_0x7abe('0xb'));var ejs=require(_0x7abe('0xc'));var fs=require('fs');var fs_extra=require(_0x7abe('0xd'));var _=require(_0x7abe('0xe'));var squel=require(_0x7abe('0xf'));var crypto=require(_0x7abe('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x7abe('0x11'));var toCsv=require(_0x7abe('0xb'));var querystring=require(_0x7abe('0x12'));var Papa=require(_0x7abe('0x13'));var Redis=require(_0x7abe('0x14'));var authService=require(_0x7abe('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7abe('0x16'));var logger=require(_0x7abe('0x17'))(_0x7abe('0x18'));var utils=require(_0x7abe('0x19'));var config=require(_0x7abe('0x1a'));var licenseUtil=require(_0x7abe('0x1b'));var db=require(_0x7abe('0x1c'))['db'];function respondWithStatusCode(_0x8f19e1,_0x1ccf61){_0x1ccf61=_0x1ccf61||0xcc;return function(_0xe0cc43){if(_0xe0cc43){return _0x8f19e1['sendStatus'](_0x1ccf61);}return _0x8f19e1['status'](_0x1ccf61)['end']();};}function respondWithResult(_0x346016,_0x4d17d5){_0x4d17d5=_0x4d17d5||0xc8;return function(_0x3e6063){if(_0x3e6063){return _0x346016['status'](_0x4d17d5)[_0x7abe('0x1d')](_0x3e6063);}};}function respondWithFilteredResult(_0x5a8a4e,_0x346e13){return function(_0x355444){if(_0x355444){var _0x518766=typeof _0x346e13[_0x7abe('0x1e')]===_0x7abe('0x1f')&&typeof _0x346e13['limit']===_0x7abe('0x1f');var _0xff055a=_0x355444['count'];var _0x1f02fc=_0x518766?0x0:_0x346e13[_0x7abe('0x1e')];var _0x104f22=_0x518766?_0x355444[_0x7abe('0x20')]:_0x346e13[_0x7abe('0x1e')]+_0x346e13[_0x7abe('0x21')];var _0x3d76f5;if(_0x104f22>=_0xff055a){_0x104f22=_0xff055a;_0x3d76f5=0xc8;}else{_0x3d76f5=0xce;}_0x5a8a4e[_0x7abe('0x22')](_0x3d76f5);return _0x5a8a4e[_0x7abe('0x23')]('Content-Range',_0x1f02fc+'-'+_0x104f22+'/'+_0xff055a)[_0x7abe('0x1d')](_0x355444);}return null;};}function patchUpdates(_0xc42dc0){return function(_0x5b2d3d){try{jsonpatch[_0x7abe('0x24')](_0x5b2d3d,_0xc42dc0,!![]);}catch(_0x1f41a9){return BPromise[_0x7abe('0x25')](_0x1f41a9);}return _0x5b2d3d['save']();};}function saveUpdates(_0x510db0,_0x3519ab){return function(_0x5c6466){if(_0x5c6466){return _0x5c6466[_0x7abe('0x26')](_0x510db0)[_0x7abe('0x27')](function(_0x4c4729){return _0x4c4729;});}return null;};}function removeEntity(_0x15fbf0,_0x1d6b7a){return function(_0x437d0b){if(_0x437d0b){return _0x437d0b[_0x7abe('0x28')]()[_0x7abe('0x27')](function(){_0x15fbf0['status'](0xcc)[_0x7abe('0x29')]();});}};}function handleEntityNotFound(_0x3617e5,_0x5eafb3){return function(_0x976fbc){if(!_0x976fbc){_0x3617e5[_0x7abe('0x2a')](0x194);}return _0x976fbc;};}function handleError(_0x382d49,_0x238016){_0x238016=_0x238016||0x1f4;return function(_0x4f4b77){logger[_0x7abe('0x2b')](_0x4f4b77[_0x7abe('0x2c')]);if(_0x4f4b77[_0x7abe('0x2d')]){delete _0x4f4b77['name'];}_0x382d49[_0x7abe('0x22')](_0x238016)['send'](_0x4f4b77);};}exports[_0x7abe('0x2e')]=function(_0xf438f6,_0x3f90c3){var _0x59a45f={},_0x552162={},_0x575962={'count':0x0,'rows':[]};var _0x946a2e=_[_0x7abe('0x2f')](db[_0x7abe('0x30')][_0x7abe('0x31')],function(_0x34c3d3){return{'name':_0x34c3d3[_0x7abe('0x32')],'type':_0x34c3d3[_0x7abe('0x33')]['key']};});_0x552162['model']=_['map'](_0x946a2e,'name');_0x552162['query']=_[_0x7abe('0x34')](_0xf438f6['query']);_0x552162[_0x7abe('0x35')]=_[_0x7abe('0x36')](_0x552162[_0x7abe('0x37')],_0x552162[_0x7abe('0x38')]);_0x59a45f[_0x7abe('0x39')]=_[_0x7abe('0x36')](_0x552162[_0x7abe('0x37')],qs['fields'](_0xf438f6[_0x7abe('0x38')][_0x7abe('0x3a')]));_0x59a45f[_0x7abe('0x39')]=_0x59a45f[_0x7abe('0x39')]['length']?_0x59a45f['attributes']:_0x552162[_0x7abe('0x37')];if(!_0xf438f6[_0x7abe('0x38')][_0x7abe('0x3b')]('nolimit')){_0x59a45f[_0x7abe('0x21')]=qs['limit'](_0xf438f6[_0x7abe('0x38')][_0x7abe('0x21')]);_0x59a45f[_0x7abe('0x1e')]=qs[_0x7abe('0x1e')](_0xf438f6[_0x7abe('0x38')][_0x7abe('0x1e')]);}_0x59a45f[_0x7abe('0x3c')]=qs['sort'](_0xf438f6[_0x7abe('0x38')][_0x7abe('0x3d')]);_0x59a45f[_0x7abe('0x3e')]=qs[_0x7abe('0x35')](_[_0x7abe('0x3f')](_0xf438f6[_0x7abe('0x38')],_0x552162[_0x7abe('0x35')]),_0x946a2e);if(_0xf438f6[_0x7abe('0x38')][_0x7abe('0x40')]){_0x59a45f[_0x7abe('0x3e')]=_[_0x7abe('0x41')](_0x59a45f[_0x7abe('0x3e')],{'$or':_[_0x7abe('0x2f')](_0x946a2e,function(_0x37f9c3){if(_0x37f9c3[_0x7abe('0x33')]!=='VIRTUAL'){var _0x67a24a={};_0x67a24a[_0x37f9c3[_0x7abe('0x2d')]]={'$like':'%'+_0xf438f6[_0x7abe('0x38')]['filter']+'%'};return _0x67a24a;}})});}_0x59a45f=_[_0x7abe('0x41')]({},_0x59a45f,_0xf438f6['options']);var _0x3f5a04={'where':_0x59a45f[_0x7abe('0x3e')]};return db[_0x7abe('0x30')]['count'](_0x3f5a04)[_0x7abe('0x27')](function(_0x339543){_0x575962[_0x7abe('0x20')]=_0x339543;if(_0xf438f6[_0x7abe('0x38')][_0x7abe('0x42')]){_0x59a45f[_0x7abe('0x43')]=[{'all':!![]}];}return db[_0x7abe('0x30')][_0x7abe('0x44')](_0x59a45f);})[_0x7abe('0x27')](function(_0x54677e){_0x575962[_0x7abe('0x45')]=_0x54677e;return _0x575962;})[_0x7abe('0x27')](respondWithFilteredResult(_0x3f90c3,_0x59a45f))[_0x7abe('0x46')](handleError(_0x3f90c3,null));};exports[_0x7abe('0x47')]=function(_0x4cbc67,_0x176eb4){var _0x3cdf82={'raw':![],'where':{'id':_0x4cbc67['params']['id']}},_0x814fcf={};_0x814fcf[_0x7abe('0x37')]=_['keys'](db[_0x7abe('0x30')][_0x7abe('0x31')]);_0x814fcf[_0x7abe('0x38')]=_[_0x7abe('0x34')](_0x4cbc67[_0x7abe('0x38')]);_0x814fcf['filters']=_[_0x7abe('0x36')](_0x814fcf[_0x7abe('0x37')],_0x814fcf['query']);_0x3cdf82[_0x7abe('0x39')]=_['intersection'](_0x814fcf[_0x7abe('0x37')],qs[_0x7abe('0x3a')](_0x4cbc67[_0x7abe('0x38')][_0x7abe('0x3a')]));_0x3cdf82[_0x7abe('0x39')]=_0x3cdf82[_0x7abe('0x39')]['length']?_0x3cdf82[_0x7abe('0x39')]:_0x814fcf[_0x7abe('0x37')];if(_0x4cbc67[_0x7abe('0x38')][_0x7abe('0x42')]){_0x3cdf82[_0x7abe('0x43')]=[{'all':!![]}];}_0x3cdf82=_[_0x7abe('0x41')]({},_0x3cdf82,_0x4cbc67[_0x7abe('0x48')]);return db[_0x7abe('0x30')][_0x7abe('0x49')](_0x3cdf82)[_0x7abe('0x27')](handleEntityNotFound(_0x176eb4,null))[_0x7abe('0x27')](respondWithResult(_0x176eb4,null))[_0x7abe('0x46')](handleError(_0x176eb4,null));};exports[_0x7abe('0x4a')]=function(_0x82c244,_0x46dd74){return db[_0x7abe('0x30')][_0x7abe('0x4a')](_0x82c244[_0x7abe('0x4b')],{})[_0x7abe('0x27')](respondWithResult(_0x46dd74,0xc9))[_0x7abe('0x46')](handleError(_0x46dd74,null));};exports[_0x7abe('0x26')]=function(_0x1c1b1c,_0x10260d){if(_0x1c1b1c['body']['id']){delete _0x1c1b1c[_0x7abe('0x4b')]['id'];}return db[_0x7abe('0x30')][_0x7abe('0x49')]({'where':{'id':_0x1c1b1c[_0x7abe('0x4c')]['id']}})[_0x7abe('0x27')](handleEntityNotFound(_0x10260d,null))[_0x7abe('0x27')](saveUpdates(_0x1c1b1c[_0x7abe('0x4b')],null))[_0x7abe('0x27')](respondWithResult(_0x10260d,null))[_0x7abe('0x46')](handleError(_0x10260d,null));};exports[_0x7abe('0x28')]=function(_0x1494c7,_0x378e3b){return db['SalesforceConfiguration']['find']({'where':{'id':_0x1494c7[_0x7abe('0x4c')]['id']}})[_0x7abe('0x27')](handleEntityNotFound(_0x378e3b,null))['then'](removeEntity(_0x378e3b,null))[_0x7abe('0x46')](handleError(_0x378e3b,null));};exports['getFields']=function(_0x500129,_0x7ec978,_0xa6c27b){var _0x2a9da1={};var _0x423d8e={};var _0x349907;var _0x4a8dee;return db[_0x7abe('0x30')][_0x7abe('0x4d')]({'where':{'id':_0x500129[_0x7abe('0x4c')]['id']}})[_0x7abe('0x27')](handleEntityNotFound(_0x7ec978,null))[_0x7abe('0x27')](function(_0x5669f2){if(_0x5669f2){_0x349907=_0x5669f2;_0x423d8e[_0x7abe('0x37')]=_[_0x7abe('0x34')](db[_0x7abe('0x4e')]['rawAttributes']);_0x423d8e['query']=_[_0x7abe('0x34')](_0x500129[_0x7abe('0x38')]);_0x423d8e[_0x7abe('0x35')]=_[_0x7abe('0x36')](_0x423d8e['model'],_0x423d8e[_0x7abe('0x38')]);_0x2a9da1['attributes']=_[_0x7abe('0x36')](_0x423d8e[_0x7abe('0x37')],qs[_0x7abe('0x3a')](_0x500129['query']['fields']));_0x2a9da1[_0x7abe('0x39')]=_0x2a9da1['attributes'][_0x7abe('0x4f')]?_0x2a9da1[_0x7abe('0x39')]:_0x423d8e[_0x7abe('0x37')];_0x2a9da1[_0x7abe('0x3c')]=qs[_0x7abe('0x3d')](_0x500129['query'][_0x7abe('0x3d')]);_0x2a9da1[_0x7abe('0x3e')]=qs[_0x7abe('0x35')](_['pick'](_0x500129[_0x7abe('0x38')],_0x423d8e[_0x7abe('0x35')]));if(_0x500129['query'][_0x7abe('0x40')]){_0x2a9da1[_0x7abe('0x3e')]=_[_0x7abe('0x41')](_0x2a9da1['where'],{'$or':_[_0x7abe('0x2f')](_0x2a9da1[_0x7abe('0x39')],function(_0x5ad2b7){var _0x17b5eb={};_0x17b5eb[_0x5ad2b7]={'$like':'%'+_0x500129['query'][_0x7abe('0x40')]+'%'};return _0x17b5eb;})});}_0x2a9da1=_['merge']({},_0x2a9da1,_0x500129[_0x7abe('0x48')]);return _0x349907['getFields'](_0x2a9da1);}})[_0x7abe('0x27')](function(_0x222654){if(_0x222654){_0x4a8dee=_0x222654['length'];if(!_0x500129[_0x7abe('0x38')]['hasOwnProperty'](_0x7abe('0x50'))){_0x2a9da1['limit']=qs[_0x7abe('0x21')](_0x500129[_0x7abe('0x38')][_0x7abe('0x21')]);_0x2a9da1[_0x7abe('0x1e')]=qs[_0x7abe('0x1e')](_0x500129['query'][_0x7abe('0x1e')]);}return _0x349907[_0x7abe('0x51')](_0x2a9da1);}})[_0x7abe('0x27')](function(_0x56c2b5){if(_0x56c2b5){return _0x56c2b5?{'count':_0x4a8dee,'rows':_0x56c2b5}:null;}})[_0x7abe('0x27')](respondWithResult(_0x7ec978,null))[_0x7abe('0x46')](handleError(_0x7ec978,null));};exports[_0x7abe('0x52')]=function(_0x3519ec,_0x19d9bd,_0x4eaad6){var _0x7cd349={};var _0x4803d1={};var _0x2613d0;var _0x15891a;return db[_0x7abe('0x30')][_0x7abe('0x4d')]({'where':{'id':_0x3519ec[_0x7abe('0x4c')]['id']}})[_0x7abe('0x27')](handleEntityNotFound(_0x19d9bd,null))[_0x7abe('0x27')](function(_0x1ecf7d){if(_0x1ecf7d){_0x2613d0=_0x1ecf7d;_0x4803d1[_0x7abe('0x37')]=_[_0x7abe('0x34')](db[_0x7abe('0x4e')][_0x7abe('0x31')]);_0x4803d1[_0x7abe('0x38')]=_['keys'](_0x3519ec[_0x7abe('0x38')]);_0x4803d1['filters']=_[_0x7abe('0x36')](_0x4803d1[_0x7abe('0x37')],_0x4803d1[_0x7abe('0x38')]);_0x7cd349[_0x7abe('0x39')]=_[_0x7abe('0x36')](_0x4803d1[_0x7abe('0x37')],qs[_0x7abe('0x3a')](_0x3519ec['query'][_0x7abe('0x3a')]));_0x7cd349[_0x7abe('0x39')]=_0x7cd349[_0x7abe('0x39')][_0x7abe('0x4f')]?_0x7cd349[_0x7abe('0x39')]:_0x4803d1[_0x7abe('0x37')];_0x7cd349[_0x7abe('0x3c')]=qs[_0x7abe('0x3d')](_0x3519ec[_0x7abe('0x38')][_0x7abe('0x3d')]);_0x7cd349[_0x7abe('0x3e')]=qs[_0x7abe('0x35')](_[_0x7abe('0x3f')](_0x3519ec[_0x7abe('0x38')],_0x4803d1[_0x7abe('0x35')]));if(_0x3519ec[_0x7abe('0x38')][_0x7abe('0x40')]){_0x7cd349['where']=_[_0x7abe('0x41')](_0x7cd349[_0x7abe('0x3e')],{'$or':_[_0x7abe('0x2f')](_0x7cd349[_0x7abe('0x39')],function(_0x390960){var _0x29efcd={};_0x29efcd[_0x390960]={'$like':'%'+_0x3519ec[_0x7abe('0x38')][_0x7abe('0x40')]+'%'};return _0x29efcd;})});}_0x7cd349=_[_0x7abe('0x41')]({},_0x7cd349,_0x3519ec[_0x7abe('0x48')]);return _0x2613d0['getSubjects'](_0x7cd349);}})[_0x7abe('0x27')](function(_0x54a49b){if(_0x54a49b){_0x15891a=_0x54a49b[_0x7abe('0x4f')];if(!_0x3519ec['query'][_0x7abe('0x3b')](_0x7abe('0x50'))){_0x7cd349[_0x7abe('0x21')]=qs[_0x7abe('0x21')](_0x3519ec[_0x7abe('0x38')][_0x7abe('0x21')]);_0x7cd349[_0x7abe('0x1e')]=qs[_0x7abe('0x1e')](_0x3519ec['query'][_0x7abe('0x1e')]);}return _0x2613d0['getSubjects'](_0x7cd349);}})[_0x7abe('0x27')](function(_0x2b0dce){if(_0x2b0dce){return _0x2b0dce?{'count':_0x15891a,'rows':_0x2b0dce}:null;}})[_0x7abe('0x27')](respondWithResult(_0x19d9bd,null))[_0x7abe('0x46')](handleError(_0x19d9bd,null));};exports[_0x7abe('0x53')]=function(_0x223a81,_0x2e6aec,_0x2af3bd){var _0x36eed1={};var _0x4ad1e1={};var _0x394092;var _0x29a7ef;return db['SalesforceConfiguration'][_0x7abe('0x4d')]({'where':{'id':_0x223a81[_0x7abe('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2e6aec,null))['then'](function(_0x24cddf){if(_0x24cddf){_0x394092=_0x24cddf;_0x4ad1e1[_0x7abe('0x37')]=_[_0x7abe('0x34')](db[_0x7abe('0x4e')][_0x7abe('0x31')]);_0x4ad1e1[_0x7abe('0x38')]=_[_0x7abe('0x34')](_0x223a81[_0x7abe('0x38')]);_0x4ad1e1[_0x7abe('0x35')]=_['intersection'](_0x4ad1e1[_0x7abe('0x37')],_0x4ad1e1['query']);_0x36eed1[_0x7abe('0x39')]=_[_0x7abe('0x36')](_0x4ad1e1[_0x7abe('0x37')],qs[_0x7abe('0x3a')](_0x223a81[_0x7abe('0x38')][_0x7abe('0x3a')]));_0x36eed1[_0x7abe('0x39')]=_0x36eed1[_0x7abe('0x39')][_0x7abe('0x4f')]?_0x36eed1['attributes']:_0x4ad1e1[_0x7abe('0x37')];_0x36eed1[_0x7abe('0x3c')]=qs[_0x7abe('0x3d')](_0x223a81['query']['sort']);_0x36eed1['where']=qs['filters'](_[_0x7abe('0x3f')](_0x223a81['query'],_0x4ad1e1[_0x7abe('0x35')]));if(_0x223a81[_0x7abe('0x38')][_0x7abe('0x40')]){_0x36eed1[_0x7abe('0x3e')]=_['merge'](_0x36eed1[_0x7abe('0x3e')],{'$or':_[_0x7abe('0x2f')](_0x36eed1[_0x7abe('0x39')],function(_0x4413aa){var _0x23b5f6={};_0x23b5f6[_0x4413aa]={'$like':'%'+_0x223a81[_0x7abe('0x38')]['filter']+'%'};return _0x23b5f6;})});}_0x36eed1=_[_0x7abe('0x41')]({},_0x36eed1,_0x223a81[_0x7abe('0x48')]);return _0x394092['getDescriptions'](_0x36eed1);}})[_0x7abe('0x27')](function(_0x418ea8){if(_0x418ea8){_0x29a7ef=_0x418ea8[_0x7abe('0x4f')];if(!_0x223a81[_0x7abe('0x38')][_0x7abe('0x3b')](_0x7abe('0x50'))){_0x36eed1[_0x7abe('0x21')]=qs[_0x7abe('0x21')](_0x223a81[_0x7abe('0x38')][_0x7abe('0x21')]);_0x36eed1[_0x7abe('0x1e')]=qs[_0x7abe('0x1e')](_0x223a81[_0x7abe('0x38')][_0x7abe('0x1e')]);}return _0x394092['getDescriptions'](_0x36eed1);}})[_0x7abe('0x27')](function(_0xf8e239){if(_0xf8e239){return _0xf8e239?{'count':_0x29a7ef,'rows':_0xf8e239}:null;}})['then'](respondWithResult(_0x2e6aec,null))['catch'](handleError(_0x2e6aec,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index cff913c..c498ee5 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 _0x8e48=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x8e48,0xdc));var _0x88e4=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x8e48[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x88e4('0x0'));var util=require(_0x88e4('0x1'));var logger=require(_0x88e4('0x2'))(_0x88e4('0x3'));var moment=require(_0x88e4('0x4'));var BPromise=require(_0x88e4('0x5'));var rp=require(_0x88e4('0x6'));var fs=require('fs');var path=require(_0x88e4('0x7'));var rimraf=require('rimraf');var config=require(_0x88e4('0x8'));var attributes=require(_0x88e4('0x9'));module['exports']=function(_0x4a8cdf,_0x339adb){return _0x4a8cdf[_0x88e4('0xa')](_0x88e4('0xb'),attributes,{'tableName':_0x88e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a65=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x8a65,0x13c));var _0x58a6=function(_0x1496bc,_0x369cd5){_0x1496bc=_0x1496bc-0x0;var _0x4f8978=_0x8a65[_0x1496bc];return _0x4f8978;};'use strict';var _=require(_0x58a6('0x0'));var util=require(_0x58a6('0x1'));var logger=require(_0x58a6('0x2'))(_0x58a6('0x3'));var moment=require(_0x58a6('0x4'));var BPromise=require(_0x58a6('0x5'));var rp=require(_0x58a6('0x6'));var fs=require('fs');var path=require(_0x58a6('0x7'));var rimraf=require(_0x58a6('0x8'));var config=require(_0x58a6('0x9'));var attributes=require(_0x58a6('0xa'));module[_0x58a6('0xb')]=function(_0x3a7f78,_0x5966d6){return _0x3a7f78[_0x58a6('0xc')](_0x58a6('0xd'),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 849df9a..1898276 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 _0x0da5=['client','http','request','then','info','request\x20sent','debug','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x264ca3,_0x65b645){var _0x156d1e=function(_0x3c2990){while(--_0x3c2990){_0x264ca3['push'](_0x264ca3['shift']());}};_0x156d1e(++_0x65b645);}(_0x0da5,0x110));var _0x50da=function(_0x1d1b1c,_0x415d51){_0x1d1b1c=_0x1d1b1c-0x0;var _0x24354a=_0x0da5[_0x1d1b1c];return _0x24354a;};'use strict';var _=require('lodash');var util=require(_0x50da('0x0'));var moment=require('moment');var BPromise=require(_0x50da('0x1'));var rs=require(_0x50da('0x2'));var fs=require('fs');var Redis=require(_0x50da('0x3'));var db=require(_0x50da('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x50da('0x5'))(_0x50da('0x6'));var config=require('../../config/environment');var jayson=require(_0x50da('0x7'));var client=jayson[_0x50da('0x8')][_0x50da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x247e24,_0x3d5e0e,_0x3875d5){return new BPromise(function(_0x2d4fa4,_0x3d5eb9){return client[_0x50da('0xa')](_0x247e24,_0x3875d5)[_0x50da('0xb')](function(_0x3e8be8){logger[_0x50da('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d5e0e,_0x50da('0xd'));logger[_0x50da('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3d5e0e,_0x50da('0xd'),JSON['stringify'](_0x3e8be8));if(_0x3e8be8[_0x50da('0xf')]){if(_0x3e8be8[_0x50da('0xf')][_0x50da('0x10')]===0x1f4){logger[_0x50da('0xf')](_0x50da('0x11'),_0x3d5e0e,_0x3e8be8[_0x50da('0xf')][_0x50da('0x12')]);return _0x3d5eb9(_0x3e8be8[_0x50da('0xf')]['message']);}logger[_0x50da('0xf')](_0x50da('0x11'),_0x3d5e0e,_0x3e8be8[_0x50da('0xf')][_0x50da('0x12')]);return _0x2d4fa4(_0x3e8be8[_0x50da('0xf')][_0x50da('0x12')]);}else{logger[_0x50da('0xc')](_0x50da('0x11'),_0x3d5e0e,_0x50da('0xd'));_0x2d4fa4(_0x3e8be8['result']['message']);}})[_0x50da('0x13')](function(_0x30d363){logger[_0x50da('0xf')](_0x50da('0x11'),_0x3d5e0e,_0x30d363);_0x3d5eb9(_0x30d363);});});} \ No newline at end of file +var _0x340b=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0x340b,0xc4));var _0xb340=function(_0x2f6fe5,_0x997687){_0x2f6fe5=_0x2f6fe5-0x0;var _0x1729fc=_0x340b[_0x2f6fe5];return _0x1729fc;};'use strict';var _=require(_0xb340('0x0'));var util=require(_0xb340('0x1'));var moment=require(_0xb340('0x2'));var BPromise=require(_0xb340('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb340('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb340('0x5'));var logger=require(_0xb340('0x6'))(_0xb340('0x7'));var config=require('../../config/environment');var jayson=require(_0xb340('0x8'));var client=jayson[_0xb340('0x9')][_0xb340('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1735e0,_0x45bac8,_0x1091d4){return new BPromise(function(_0x15ef15,_0x49df47){return client[_0xb340('0xb')](_0x1735e0,_0x1091d4)[_0xb340('0xc')](function(_0x55ed9c){logger[_0xb340('0xd')](_0xb340('0xe'),_0x45bac8,_0xb340('0xf'));logger[_0xb340('0x10')](_0xb340('0x11'),_0x45bac8,_0xb340('0xf'),JSON['stringify'](_0x55ed9c));if(_0x55ed9c[_0xb340('0x12')]){if(_0x55ed9c[_0xb340('0x12')][_0xb340('0x13')]===0x1f4){logger['error'](_0xb340('0xe'),_0x45bac8,_0x55ed9c['error'][_0xb340('0x14')]);return _0x49df47(_0x55ed9c[_0xb340('0x12')][_0xb340('0x14')]);}logger['error'](_0xb340('0xe'),_0x45bac8,_0x55ed9c[_0xb340('0x12')][_0xb340('0x14')]);return _0x15ef15(_0x55ed9c[_0xb340('0x12')][_0xb340('0x14')]);}else{logger['info'](_0xb340('0xe'),_0x45bac8,'request\x20sent');_0x15ef15(_0x55ed9c[_0xb340('0x15')][_0xb340('0x14')]);}})[_0xb340('0x16')](function(_0x4ac944){logger[_0xb340('0x12')](_0xb340('0xe'),_0x45bac8,_0x4ac944);_0x49df47(_0x4ac944);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 2b436ff..f85663d 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 _0xafe6=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xafe6,0x66));var _0x6afe=function(_0x269318,_0x4a0aad){_0x269318=_0x269318-0x0;var _0x69fc85=_0xafe6[_0x269318];return _0x69fc85;};'use strict';var multer=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var path=require(_0x6afe('0x2'));var timeout=require(_0x6afe('0x3'));var express=require(_0x6afe('0x4'));var router=express['Router']();var fs_extra=require(_0x6afe('0x5'));var auth=require(_0x6afe('0x6'));var interaction=require(_0x6afe('0x7'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x6afe('0x8')]('/',auth['isAuthenticated'](),controller[_0x6afe('0x9')]);router[_0x6afe('0x8')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0xc')]);router['post']('/',auth[_0x6afe('0xb')](),controller['create']);router[_0x6afe('0xd')]('/:id',auth[_0x6afe('0xb')](),controller[_0x6afe('0xe')]);router[_0x6afe('0xf')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0x10')]);module[_0x6afe('0x11')]=router; \ No newline at end of file +var _0xc3c7=['fs-extra','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x23deec,_0x207fc0){var _0xe9659e=function(_0x2a3995){while(--_0x2a3995){_0x23deec['push'](_0x23deec['shift']());}};_0xe9659e(++_0x207fc0);}(_0xc3c7,0x13e));var _0x7c3c=function(_0x561a36,_0x4226d4){_0x561a36=_0x561a36-0x0;var _0x44353b=_0xc3c7[_0x561a36];return _0x44353b;};'use strict';var multer=require(_0x7c3c('0x0'));var util=require('util');var path=require(_0x7c3c('0x1'));var timeout=require(_0x7c3c('0x2'));var express=require(_0x7c3c('0x3'));var router=express[_0x7c3c('0x4')]();var fs_extra=require(_0x7c3c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7c3c('0x6'));var config=require('../../config/environment');var controller=require(_0x7c3c('0x7'));router[_0x7c3c('0x8')]('/',auth[_0x7c3c('0x9')](),controller['index']);router[_0x7c3c('0x8')](_0x7c3c('0xa'),auth[_0x7c3c('0x9')](),controller[_0x7c3c('0xb')]);router['post']('/',auth[_0x7c3c('0x9')](),controller[_0x7c3c('0xc')]);router[_0x7c3c('0xd')](_0x7c3c('0xa'),auth['isAuthenticated'](),controller[_0x7c3c('0xe')]);router[_0x7c3c('0xf')](_0x7c3c('0xa'),auth[_0x7c3c('0x9')](),controller['destroy']);module[_0x7c3c('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 1cb405d..83dc08b 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 _0xcb96=['customVariable','keyValue','picklist','ENUM','STRING','exports','string','variable'];(function(_0x44be9b,_0x462b1a){var _0x2ba43b=function(_0x4448b7){while(--_0x4448b7){_0x44be9b['push'](_0x44be9b['shift']());}};_0x2ba43b(++_0x462b1a);}(_0xcb96,0x13d));var _0x6cb9=function(_0x4edbc6,_0x4a4766){_0x4edbc6=_0x4edbc6-0x0;var _0x307669=_0xcb96[_0x4edbc6];return _0x307669;};'use strict';var Sequelize=require('sequelize');module[_0x6cb9('0x0')]={'type':{'type':Sequelize['ENUM'](_0x6cb9('0x1'),_0x6cb9('0x2'),_0x6cb9('0x3'),_0x6cb9('0x4'),_0x6cb9('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6cb9('0x6')](_0x6cb9('0x1'),_0x6cb9('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x6cb9('0x7')]},'idField':{'type':Sequelize[_0x6cb9('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb626=['STRING','customVariable','sequelize','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x25f14f,_0x1c90a8){var _0x35cbb3=function(_0x583c34){while(--_0x583c34){_0x25f14f['push'](_0x25f14f['shift']());}};_0x35cbb3(++_0x1c90a8);}(_0xb626,0x107));var _0x6b62=function(_0x184d67,_0x3231bb){_0x184d67=_0x184d67-0x0;var _0xc3ce7=_0xb626[_0x184d67];return _0xc3ce7;};'use strict';var Sequelize=require(_0x6b62('0x0'));module[_0x6b62('0x1')]={'type':{'type':Sequelize[_0x6b62('0x2')](_0x6b62('0x3'),_0x6b62('0x4'),'customVariable',_0x6b62('0x5'),_0x6b62('0x6')),'defaultValue':_0x6b62('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6b62('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x6b62('0x3'),_0x6b62('0x4'),_0x6b62('0x8'))},'keyContent':{'type':Sequelize[_0x6b62('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x6b62('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 96fe2a4..d9ffdaf 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 _0xdfc9=['catch','show','params','keys','attributes','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','SalesforceField','findAll','rows'];(function(_0x2a43db,_0x1c448c){var _0x2a504b=function(_0x3726a9){while(--_0x3726a9){_0x2a43db['push'](_0x2a43db['shift']());}};_0x2a504b(++_0x1c448c);}(_0xdfc9,0xf7));var _0x9dfc=function(_0x3abe58,_0x184dd9){_0x3abe58=_0x3abe58-0x0;var _0x457389=_0xdfc9[_0x3abe58];return _0x457389;};'use strict';var emlformat=require(_0x9dfc('0x0'));var rimraf=require(_0x9dfc('0x1'));var zipdir=require(_0x9dfc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9dfc('0x3'));var moment=require(_0x9dfc('0x4'));var BPromise=require(_0x9dfc('0x5'));var Mustache=require(_0x9dfc('0x6'));var util=require('util');var path=require(_0x9dfc('0x7'));var sox=require(_0x9dfc('0x8'));var csv=require('to-csv');var ejs=require(_0x9dfc('0x9'));var fs=require('fs');var fs_extra=require(_0x9dfc('0xa'));var _=require(_0x9dfc('0xb'));var squel=require(_0x9dfc('0xc'));var crypto=require(_0x9dfc('0xd'));var jsforce=require(_0x9dfc('0xe'));var deskjs=require(_0x9dfc('0xf'));var toCsv=require(_0x9dfc('0x10'));var querystring=require(_0x9dfc('0x11'));var Papa=require(_0x9dfc('0x12'));var Redis=require(_0x9dfc('0x13'));var authService=require(_0x9dfc('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9dfc('0x15'));var hardwareService=require(_0x9dfc('0x16'));var logger=require(_0x9dfc('0x17'))('api');var utils=require(_0x9dfc('0x18'));var config=require(_0x9dfc('0x19'));var licenseUtil=require(_0x9dfc('0x1a'));var db=require(_0x9dfc('0x1b'))['db'];function respondWithStatusCode(_0x5125af,_0x43d00f){_0x43d00f=_0x43d00f||0xcc;return function(_0x515b48){if(_0x515b48){return _0x5125af[_0x9dfc('0x1c')](_0x43d00f);}return _0x5125af[_0x9dfc('0x1d')](_0x43d00f)[_0x9dfc('0x1e')]();};}function respondWithResult(_0x5827a7,_0x2d3151){_0x2d3151=_0x2d3151||0xc8;return function(_0x228c71){if(_0x228c71){return _0x5827a7['status'](_0x2d3151)[_0x9dfc('0x1f')](_0x228c71);}};}function respondWithFilteredResult(_0x5ba5a0,_0x2356db){return function(_0x87a0f9){if(_0x87a0f9){var _0x13cdf5=typeof _0x2356db['offset']===_0x9dfc('0x20')&&typeof _0x2356db['limit']===_0x9dfc('0x20');var _0x53ccd6=_0x87a0f9[_0x9dfc('0x21')];var _0x553551=_0x13cdf5?0x0:_0x2356db[_0x9dfc('0x22')];var _0x30209d=_0x13cdf5?_0x87a0f9['count']:_0x2356db[_0x9dfc('0x22')]+_0x2356db['limit'];var _0x13183d;if(_0x30209d>=_0x53ccd6){_0x30209d=_0x53ccd6;_0x13183d=0xc8;}else{_0x13183d=0xce;}_0x5ba5a0[_0x9dfc('0x1d')](_0x13183d);return _0x5ba5a0[_0x9dfc('0x23')]('Content-Range',_0x553551+'-'+_0x30209d+'/'+_0x53ccd6)[_0x9dfc('0x1f')](_0x87a0f9);}return null;};}function patchUpdates(_0x55292b){return function(_0x42cabd){try{jsonpatch[_0x9dfc('0x24')](_0x42cabd,_0x55292b,!![]);}catch(_0x45a9fd){return BPromise[_0x9dfc('0x25')](_0x45a9fd);}return _0x42cabd[_0x9dfc('0x26')]();};}function saveUpdates(_0x16d14d,_0xbe256b){return function(_0x5cfaa3){if(_0x5cfaa3){return _0x5cfaa3[_0x9dfc('0x27')](_0x16d14d)[_0x9dfc('0x28')](function(_0x27839e){return _0x27839e;});}return null;};}function removeEntity(_0x254112,_0x4d702e){return function(_0x38b4a9){if(_0x38b4a9){return _0x38b4a9['destroy']()[_0x9dfc('0x28')](function(){_0x254112['status'](0xcc)[_0x9dfc('0x1e')]();});}};}function handleEntityNotFound(_0x5e8b65,_0x6d6a01){return function(_0x178d82){if(!_0x178d82){_0x5e8b65[_0x9dfc('0x1c')](0x194);}return _0x178d82;};}function handleError(_0x117e93,_0x28b478){_0x28b478=_0x28b478||0x1f4;return function(_0xf62bd2){logger[_0x9dfc('0x29')](_0xf62bd2[_0x9dfc('0x2a')]);if(_0xf62bd2['name']){delete _0xf62bd2[_0x9dfc('0x2b')];}_0x117e93['status'](_0x28b478)['send'](_0xf62bd2);};}exports[_0x9dfc('0x2c')]=function(_0x56bf8d,_0x467f9e){var _0x473a6e={},_0x21e601={},_0xf058cb={'count':0x0,'rows':[]};var _0x5c866e=_[_0x9dfc('0x2d')](db['SalesforceField'][_0x9dfc('0x2e')],function(_0x399fa4){return{'name':_0x399fa4[_0x9dfc('0x2f')],'type':_0x399fa4[_0x9dfc('0x30')][_0x9dfc('0x31')]};});_0x21e601[_0x9dfc('0x32')]=_[_0x9dfc('0x2d')](_0x5c866e,'name');_0x21e601[_0x9dfc('0x33')]=_['keys'](_0x56bf8d[_0x9dfc('0x33')]);_0x21e601[_0x9dfc('0x34')]=_[_0x9dfc('0x35')](_0x21e601[_0x9dfc('0x32')],_0x21e601['query']);_0x473a6e['attributes']=_[_0x9dfc('0x35')](_0x21e601[_0x9dfc('0x32')],qs[_0x9dfc('0x36')](_0x56bf8d[_0x9dfc('0x33')][_0x9dfc('0x36')]));_0x473a6e['attributes']=_0x473a6e['attributes'][_0x9dfc('0x37')]?_0x473a6e['attributes']:_0x21e601[_0x9dfc('0x32')];if(!_0x56bf8d['query'][_0x9dfc('0x38')](_0x9dfc('0x39'))){_0x473a6e[_0x9dfc('0x3a')]=qs[_0x9dfc('0x3a')](_0x56bf8d['query']['limit']);_0x473a6e[_0x9dfc('0x22')]=qs[_0x9dfc('0x22')](_0x56bf8d['query'][_0x9dfc('0x22')]);}_0x473a6e[_0x9dfc('0x3b')]=qs['sort'](_0x56bf8d[_0x9dfc('0x33')][_0x9dfc('0x3c')]);_0x473a6e[_0x9dfc('0x3d')]=qs['filters'](_[_0x9dfc('0x3e')](_0x56bf8d[_0x9dfc('0x33')],_0x21e601['filters']),_0x5c866e);if(_0x56bf8d[_0x9dfc('0x33')][_0x9dfc('0x3f')]){_0x473a6e[_0x9dfc('0x3d')]=_[_0x9dfc('0x40')](_0x473a6e[_0x9dfc('0x3d')],{'$or':_['map'](_0x5c866e,function(_0x56c933){if(_0x56c933[_0x9dfc('0x30')]!=='VIRTUAL'){var _0x3c1622={};_0x3c1622[_0x56c933[_0x9dfc('0x2b')]]={'$like':'%'+_0x56bf8d['query']['filter']+'%'};return _0x3c1622;}})});}_0x473a6e=_[_0x9dfc('0x40')]({},_0x473a6e,_0x56bf8d[_0x9dfc('0x41')]);var _0x4c410c={'where':_0x473a6e[_0x9dfc('0x3d')]};return db[_0x9dfc('0x42')][_0x9dfc('0x21')](_0x4c410c)[_0x9dfc('0x28')](function(_0x19ca49){_0xf058cb[_0x9dfc('0x21')]=_0x19ca49;if(_0x56bf8d['query']['includeAll']){_0x473a6e['include']=[{'all':!![]}];}return db['SalesforceField'][_0x9dfc('0x43')](_0x473a6e);})[_0x9dfc('0x28')](function(_0x5da6a4){_0xf058cb[_0x9dfc('0x44')]=_0x5da6a4;return _0xf058cb;})[_0x9dfc('0x28')](respondWithFilteredResult(_0x467f9e,_0x473a6e))[_0x9dfc('0x45')](handleError(_0x467f9e,null));};exports[_0x9dfc('0x46')]=function(_0x364056,_0xe9736f){var _0x15b7a4={'raw':!![],'where':{'id':_0x364056[_0x9dfc('0x47')]['id']}},_0x390922={};_0x390922['model']=_[_0x9dfc('0x48')](db[_0x9dfc('0x42')]['rawAttributes']);_0x390922['query']=_[_0x9dfc('0x48')](_0x364056['query']);_0x390922['filters']=_['intersection'](_0x390922[_0x9dfc('0x32')],_0x390922[_0x9dfc('0x33')]);_0x15b7a4[_0x9dfc('0x49')]=_['intersection'](_0x390922['model'],qs[_0x9dfc('0x36')](_0x364056['query'][_0x9dfc('0x36')]));_0x15b7a4[_0x9dfc('0x49')]=_0x15b7a4['attributes']['length']?_0x15b7a4[_0x9dfc('0x49')]:_0x390922['model'];if(_0x364056[_0x9dfc('0x33')][_0x9dfc('0x4a')]){_0x15b7a4[_0x9dfc('0x4b')]=[{'all':!![]}];}_0x15b7a4=_[_0x9dfc('0x40')]({},_0x15b7a4,_0x364056['options']);return db[_0x9dfc('0x42')][_0x9dfc('0x4c')](_0x15b7a4)[_0x9dfc('0x28')](handleEntityNotFound(_0xe9736f,null))[_0x9dfc('0x28')](respondWithResult(_0xe9736f,null))[_0x9dfc('0x45')](handleError(_0xe9736f,null));};exports['create']=function(_0x45c250,_0x4fec32){return db[_0x9dfc('0x42')][_0x9dfc('0x4d')](_0x45c250['body'],{})[_0x9dfc('0x28')](respondWithResult(_0x4fec32,0xc9))[_0x9dfc('0x45')](handleError(_0x4fec32,null));};exports[_0x9dfc('0x27')]=function(_0xc71657,_0xaa301c){if(_0xc71657[_0x9dfc('0x4e')]['id']){delete _0xc71657['body']['id'];}return db[_0x9dfc('0x42')][_0x9dfc('0x4c')]({'where':{'id':_0xc71657[_0x9dfc('0x47')]['id']}})[_0x9dfc('0x28')](handleEntityNotFound(_0xaa301c,null))[_0x9dfc('0x28')](saveUpdates(_0xc71657[_0x9dfc('0x4e')],null))[_0x9dfc('0x28')](respondWithResult(_0xaa301c,null))[_0x9dfc('0x45')](handleError(_0xaa301c,null));};exports['destroy']=function(_0x421b85,_0x3df7f1){return db[_0x9dfc('0x42')]['find']({'where':{'id':_0x421b85['params']['id']}})[_0x9dfc('0x28')](handleEntityNotFound(_0x3df7f1,null))[_0x9dfc('0x28')](removeEntity(_0x3df7f1,null))[_0x9dfc('0x45')](handleError(_0x3df7f1,null));}; \ No newline at end of file +var _0xc5f8=['count','offset','set','Content-Range','apply','update','then','destroy','sendStatus','error','name','send','index','SalesforceField','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','catch','show','params','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0xc5f8,0x19d));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8c5f('0x0'));var rimraf=require(_0x8c5f('0x1'));var zipdir=require(_0x8c5f('0x2'));var jsonpatch=require(_0x8c5f('0x3'));var rp=require('request-promise');var moment=require(_0x8c5f('0x4'));var BPromise=require(_0x8c5f('0x5'));var Mustache=require(_0x8c5f('0x6'));var util=require(_0x8c5f('0x7'));var path=require(_0x8c5f('0x8'));var sox=require(_0x8c5f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c5f('0xa'));var _=require(_0x8c5f('0xb'));var squel=require(_0x8c5f('0xc'));var crypto=require(_0x8c5f('0xd'));var jsforce=require(_0x8c5f('0xe'));var deskjs=require(_0x8c5f('0xf'));var toCsv=require(_0x8c5f('0x10'));var querystring=require('querystring');var Papa=require(_0x8c5f('0x11'));var Redis=require(_0x8c5f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8c5f('0x13'));var hardwareService=require(_0x8c5f('0x14'));var logger=require(_0x8c5f('0x15'))(_0x8c5f('0x16'));var utils=require(_0x8c5f('0x17'));var config=require(_0x8c5f('0x18'));var licenseUtil=require(_0x8c5f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f0934,_0x434b4c){_0x434b4c=_0x434b4c||0xcc;return function(_0x517f97){if(_0x517f97){return _0x1f0934['sendStatus'](_0x434b4c);}return _0x1f0934[_0x8c5f('0x1a')](_0x434b4c)[_0x8c5f('0x1b')]();};}function respondWithResult(_0x2c2ea7,_0x269d0b){_0x269d0b=_0x269d0b||0xc8;return function(_0x777edf){if(_0x777edf){return _0x2c2ea7[_0x8c5f('0x1a')](_0x269d0b)[_0x8c5f('0x1c')](_0x777edf);}};}function respondWithFilteredResult(_0x989049,_0x43c6f5){return function(_0x477ba6){if(_0x477ba6){var _0x403f40=typeof _0x43c6f5['offset']===_0x8c5f('0x1d')&&typeof _0x43c6f5[_0x8c5f('0x1e')]==='undefined';var _0x14f6a9=_0x477ba6[_0x8c5f('0x1f')];var _0x36dcba=_0x403f40?0x0:_0x43c6f5[_0x8c5f('0x20')];var _0x14d24f=_0x403f40?_0x477ba6[_0x8c5f('0x1f')]:_0x43c6f5[_0x8c5f('0x20')]+_0x43c6f5[_0x8c5f('0x1e')];var _0x211d96;if(_0x14d24f>=_0x14f6a9){_0x14d24f=_0x14f6a9;_0x211d96=0xc8;}else{_0x211d96=0xce;}_0x989049['status'](_0x211d96);return _0x989049[_0x8c5f('0x21')](_0x8c5f('0x22'),_0x36dcba+'-'+_0x14d24f+'/'+_0x14f6a9)[_0x8c5f('0x1c')](_0x477ba6);}return null;};}function patchUpdates(_0x4c9f8d){return function(_0x8a8a4c){try{jsonpatch[_0x8c5f('0x23')](_0x8a8a4c,_0x4c9f8d,!![]);}catch(_0x5a08d2){return BPromise['reject'](_0x5a08d2);}return _0x8a8a4c['save']();};}function saveUpdates(_0x2113e8,_0x2d392d){return function(_0x355718){if(_0x355718){return _0x355718[_0x8c5f('0x24')](_0x2113e8)[_0x8c5f('0x25')](function(_0xd070ec){return _0xd070ec;});}return null;};}function removeEntity(_0x1134b2,_0x23053b){return function(_0x5866b0){if(_0x5866b0){return _0x5866b0[_0x8c5f('0x26')]()[_0x8c5f('0x25')](function(){_0x1134b2['status'](0xcc)[_0x8c5f('0x1b')]();});}};}function handleEntityNotFound(_0x43d01b,_0x5dfceb){return function(_0x4124b7){if(!_0x4124b7){_0x43d01b[_0x8c5f('0x27')](0x194);}return _0x4124b7;};}function handleError(_0x51968c,_0x5df0de){_0x5df0de=_0x5df0de||0x1f4;return function(_0x1bda9b){logger[_0x8c5f('0x28')](_0x1bda9b['stack']);if(_0x1bda9b[_0x8c5f('0x29')]){delete _0x1bda9b[_0x8c5f('0x29')];}_0x51968c['status'](_0x5df0de)[_0x8c5f('0x2a')](_0x1bda9b);};}exports[_0x8c5f('0x2b')]=function(_0x339370,_0x505dd7){var _0x4f6714={},_0x55604a={},_0x30e71f={'count':0x0,'rows':[]};var _0x4d8715=_['map'](db[_0x8c5f('0x2c')][_0x8c5f('0x2d')],function(_0xe3e19b){return{'name':_0xe3e19b[_0x8c5f('0x2e')],'type':_0xe3e19b[_0x8c5f('0x2f')]['key']};});_0x55604a[_0x8c5f('0x30')]=_[_0x8c5f('0x31')](_0x4d8715,_0x8c5f('0x29'));_0x55604a['query']=_[_0x8c5f('0x32')](_0x339370[_0x8c5f('0x33')]);_0x55604a[_0x8c5f('0x34')]=_[_0x8c5f('0x35')](_0x55604a[_0x8c5f('0x30')],_0x55604a[_0x8c5f('0x33')]);_0x4f6714[_0x8c5f('0x36')]=_[_0x8c5f('0x35')](_0x55604a[_0x8c5f('0x30')],qs[_0x8c5f('0x37')](_0x339370[_0x8c5f('0x33')][_0x8c5f('0x37')]));_0x4f6714[_0x8c5f('0x36')]=_0x4f6714[_0x8c5f('0x36')][_0x8c5f('0x38')]?_0x4f6714[_0x8c5f('0x36')]:_0x55604a[_0x8c5f('0x30')];if(!_0x339370[_0x8c5f('0x33')][_0x8c5f('0x39')](_0x8c5f('0x3a'))){_0x4f6714[_0x8c5f('0x1e')]=qs[_0x8c5f('0x1e')](_0x339370[_0x8c5f('0x33')][_0x8c5f('0x1e')]);_0x4f6714[_0x8c5f('0x20')]=qs[_0x8c5f('0x20')](_0x339370['query'][_0x8c5f('0x20')]);}_0x4f6714[_0x8c5f('0x3b')]=qs['sort'](_0x339370[_0x8c5f('0x33')][_0x8c5f('0x3c')]);_0x4f6714[_0x8c5f('0x3d')]=qs[_0x8c5f('0x34')](_[_0x8c5f('0x3e')](_0x339370['query'],_0x55604a[_0x8c5f('0x34')]),_0x4d8715);if(_0x339370[_0x8c5f('0x33')][_0x8c5f('0x3f')]){_0x4f6714[_0x8c5f('0x3d')]=_[_0x8c5f('0x40')](_0x4f6714[_0x8c5f('0x3d')],{'$or':_['map'](_0x4d8715,function(_0x593851){if(_0x593851[_0x8c5f('0x2f')]!=='VIRTUAL'){var _0x2d0ea8={};_0x2d0ea8[_0x593851[_0x8c5f('0x29')]]={'$like':'%'+_0x339370[_0x8c5f('0x33')][_0x8c5f('0x3f')]+'%'};return _0x2d0ea8;}})});}_0x4f6714=_[_0x8c5f('0x40')]({},_0x4f6714,_0x339370[_0x8c5f('0x41')]);var _0x381fc4={'where':_0x4f6714['where']};return db[_0x8c5f('0x2c')][_0x8c5f('0x1f')](_0x381fc4)['then'](function(_0x15bef7){_0x30e71f[_0x8c5f('0x1f')]=_0x15bef7;if(_0x339370['query']['includeAll']){_0x4f6714['include']=[{'all':!![]}];}return db[_0x8c5f('0x2c')]['findAll'](_0x4f6714);})['then'](function(_0x57e492){_0x30e71f['rows']=_0x57e492;return _0x30e71f;})[_0x8c5f('0x25')](respondWithFilteredResult(_0x505dd7,_0x4f6714))[_0x8c5f('0x42')](handleError(_0x505dd7,null));};exports[_0x8c5f('0x43')]=function(_0x3d6ed3,_0x200e26){var _0x31ca26={'raw':!![],'where':{'id':_0x3d6ed3[_0x8c5f('0x44')]['id']}},_0x47f51e={};_0x47f51e[_0x8c5f('0x30')]=_[_0x8c5f('0x32')](db[_0x8c5f('0x2c')][_0x8c5f('0x2d')]);_0x47f51e['query']=_[_0x8c5f('0x32')](_0x3d6ed3[_0x8c5f('0x33')]);_0x47f51e['filters']=_[_0x8c5f('0x35')](_0x47f51e[_0x8c5f('0x30')],_0x47f51e[_0x8c5f('0x33')]);_0x31ca26[_0x8c5f('0x36')]=_[_0x8c5f('0x35')](_0x47f51e[_0x8c5f('0x30')],qs[_0x8c5f('0x37')](_0x3d6ed3[_0x8c5f('0x33')][_0x8c5f('0x37')]));_0x31ca26[_0x8c5f('0x36')]=_0x31ca26[_0x8c5f('0x36')][_0x8c5f('0x38')]?_0x31ca26['attributes']:_0x47f51e[_0x8c5f('0x30')];if(_0x3d6ed3[_0x8c5f('0x33')][_0x8c5f('0x45')]){_0x31ca26[_0x8c5f('0x46')]=[{'all':!![]}];}_0x31ca26=_[_0x8c5f('0x40')]({},_0x31ca26,_0x3d6ed3['options']);return db[_0x8c5f('0x2c')][_0x8c5f('0x47')](_0x31ca26)[_0x8c5f('0x25')](handleEntityNotFound(_0x200e26,null))[_0x8c5f('0x25')](respondWithResult(_0x200e26,null))[_0x8c5f('0x42')](handleError(_0x200e26,null));};exports[_0x8c5f('0x48')]=function(_0x1d2ee0,_0xdf1ef1){return db[_0x8c5f('0x2c')][_0x8c5f('0x48')](_0x1d2ee0[_0x8c5f('0x49')],{})[_0x8c5f('0x25')](respondWithResult(_0xdf1ef1,0xc9))[_0x8c5f('0x42')](handleError(_0xdf1ef1,null));};exports[_0x8c5f('0x24')]=function(_0x23ed56,_0x3ceacc){if(_0x23ed56[_0x8c5f('0x49')]['id']){delete _0x23ed56[_0x8c5f('0x49')]['id'];}return db[_0x8c5f('0x2c')][_0x8c5f('0x47')]({'where':{'id':_0x23ed56[_0x8c5f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3ceacc,null))[_0x8c5f('0x25')](saveUpdates(_0x23ed56['body'],null))[_0x8c5f('0x25')](respondWithResult(_0x3ceacc,null))['catch'](handleError(_0x3ceacc,null));};exports[_0x8c5f('0x26')]=function(_0x271e4f,_0x441fb2){return db[_0x8c5f('0x2c')][_0x8c5f('0x47')]({'where':{'id':_0x271e4f[_0x8c5f('0x44')]['id']}})[_0x8c5f('0x25')](handleEntityNotFound(_0x441fb2,null))['then'](removeEntity(_0x441fb2,null))['catch'](handleError(_0x441fb2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1cbf10c..a028bf6 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 _0x2256=['define','SalesforceField','int_salesforce_fields','idField','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x4dfc95,_0xd18318){var _0xacbe75=function(_0x24f83d){while(--_0x24f83d){_0x4dfc95['push'](_0x4dfc95['shift']());}};_0xacbe75(++_0xd18318);}(_0x2256,0xc4));var _0x6225=function(_0x49f36d,_0x2928ee){_0x49f36d=_0x49f36d-0x0;var _0x43bf1e=_0x2256[_0x49f36d];return _0x43bf1e;};'use strict';var _=require(_0x6225('0x0'));var util=require(_0x6225('0x1'));var logger=require('../../config/logger')(_0x6225('0x2'));var moment=require('moment');var BPromise=require(_0x6225('0x3'));var rp=require(_0x6225('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6225('0x5'));var config=require(_0x6225('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x6225('0x7')]=function(_0x15e67,_0xd78dae){return _0x15e67[_0x6225('0x8')](_0x6225('0x9'),attributes,{'tableName':_0x6225('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x6225('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7620=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','idField'];(function(_0x339eaa,_0xbc2f72){var _0x4985b6=function(_0x10e65b){while(--_0x10e65b){_0x339eaa['push'](_0x339eaa['shift']());}};_0x4985b6(++_0xbc2f72);}(_0x7620,0x8f));var _0x0762=function(_0x35228c,_0x1e6824){_0x35228c=_0x35228c-0x0;var _0x56b5c0=_0x7620[_0x35228c];return _0x56b5c0;};'use strict';var _=require(_0x0762('0x0'));var util=require(_0x0762('0x1'));var logger=require(_0x0762('0x2'))(_0x0762('0x3'));var moment=require(_0x0762('0x4'));var BPromise=require(_0x0762('0x5'));var rp=require(_0x0762('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0762('0x7'));module['exports']=function(_0x127fb8,_0x608473){return _0x127fb8['define'](_0x0762('0x8'),attributes,{'tableName':_0x0762('0x9'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x0762('0xa'),'FieldId'],'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 6f73ce7..5945db8 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 _0xb5c2=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceField,\x20%s,\x20%s','message','info','result'];(function(_0x41b8d1,_0x3cc4c3){var _0x2c87ef=function(_0xff4d3e){while(--_0xff4d3e){_0x41b8d1['push'](_0x41b8d1['shift']());}};_0x2c87ef(++_0x3cc4c3);}(_0xb5c2,0x1a5));var _0x2b5c=function(_0x28b40b,_0x57989b){_0x28b40b=_0x28b40b-0x0;var _0xcff5bf=_0xb5c2[_0x28b40b];return _0xcff5bf;};'use strict';var _=require(_0x2b5c('0x0'));var util=require(_0x2b5c('0x1'));var moment=require(_0x2b5c('0x2'));var BPromise=require(_0x2b5c('0x3'));var rs=require(_0x2b5c('0x4'));var fs=require('fs');var Redis=require(_0x2b5c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b5c('0x6'));var logger=require('../../config/logger')(_0x2b5c('0x7'));var config=require(_0x2b5c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52ac4d,_0x527013,_0xa5f5b){return new BPromise(function(_0x4aeb5e,_0x1621fd){return client[_0x2b5c('0x9')](_0x52ac4d,_0xa5f5b)['then'](function(_0x9e7692){logger['info']('SalesforceField,\x20%s,\x20%s',_0x527013,_0x2b5c('0xa'));logger[_0x2b5c('0xb')](_0x2b5c('0xc'),_0x527013,_0x2b5c('0xa'),JSON[_0x2b5c('0xd')](_0x9e7692));if(_0x9e7692[_0x2b5c('0xe')]){if(_0x9e7692[_0x2b5c('0xe')]['code']===0x1f4){logger[_0x2b5c('0xe')](_0x2b5c('0xf'),_0x527013,_0x9e7692[_0x2b5c('0xe')]['message']);return _0x1621fd(_0x9e7692[_0x2b5c('0xe')][_0x2b5c('0x10')]);}logger['error'](_0x2b5c('0xf'),_0x527013,_0x9e7692[_0x2b5c('0xe')][_0x2b5c('0x10')]);return _0x4aeb5e(_0x9e7692[_0x2b5c('0xe')]['message']);}else{logger[_0x2b5c('0x11')](_0x2b5c('0xf'),_0x527013,_0x2b5c('0xa'));_0x4aeb5e(_0x9e7692[_0x2b5c('0x12')][_0x2b5c('0x10')]);}})[_0x2b5c('0x13')](function(_0x3b18ed){logger[_0x2b5c('0xe')](_0x2b5c('0xf'),_0x527013,_0x3b18ed);_0x1621fd(_0x3b18ed);});});} \ No newline at end of file +var _0xcaf1=['bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','request','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','catch','lodash','util','moment'];(function(_0x71763d,_0x31a2f3){var _0xfe189e=function(_0x5d21df){while(--_0x5d21df){_0x71763d['push'](_0x71763d['shift']());}};_0xfe189e(++_0x31a2f3);}(_0xcaf1,0x1d8));var _0x1caf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaf1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1caf('0x0'));var util=require(_0x1caf('0x1'));var moment=require(_0x1caf('0x2'));var BPromise=require(_0x1caf('0x3'));var rs=require(_0x1caf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1caf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1caf('0x6'));var config=require('../../config/environment');var jayson=require(_0x1caf('0x7'));var client=jayson[_0x1caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56ce8b,_0x10556f,_0x409f9a){return new BPromise(function(_0xbc0cfe,_0x12d2ed){return client[_0x1caf('0x9')](_0x56ce8b,_0x409f9a)['then'](function(_0x5712f7){logger[_0x1caf('0xa')]('SalesforceField,\x20%s,\x20%s',_0x10556f,_0x1caf('0xb'));logger['debug'](_0x1caf('0xc'),_0x10556f,_0x1caf('0xb'),JSON[_0x1caf('0xd')](_0x5712f7));if(_0x5712f7[_0x1caf('0xe')]){if(_0x5712f7[_0x1caf('0xe')][_0x1caf('0xf')]===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x10556f,_0x5712f7['error']['message']);return _0x12d2ed(_0x5712f7[_0x1caf('0xe')][_0x1caf('0x10')]);}logger[_0x1caf('0xe')](_0x1caf('0x11'),_0x10556f,_0x5712f7[_0x1caf('0xe')]['message']);return _0xbc0cfe(_0x5712f7[_0x1caf('0xe')]['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x10556f,_0x1caf('0xb'));_0xbc0cfe(_0x5712f7['result'][_0x1caf('0x10')]);}})[_0x1caf('0x12')](function(_0x5bfc67){logger[_0x1caf('0xe')](_0x1caf('0x11'),_0x10556f,_0x5bfc67);_0x12d2ed(_0x5bfc67);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 062a937..8feb9af 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 _0x46b9=['getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x46b9,0x199));var _0x946b=function(_0xf6a1f2,_0x318851){_0xf6a1f2=_0xf6a1f2-0x0;var _0x501418=_0x46b9[_0xf6a1f2];return _0x501418;};'use strict';var multer=require(_0x946b('0x0'));var util=require('util');var path=require(_0x946b('0x1'));var timeout=require(_0x946b('0x2'));var express=require(_0x946b('0x3'));var router=express[_0x946b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x946b('0x5'));var interaction=require(_0x946b('0x6'));var config=require(_0x946b('0x7'));var controller=require(_0x946b('0x8'));router[_0x946b('0x9')]('/',auth[_0x946b('0xa')](),controller[_0x946b('0xb')]);router[_0x946b('0x9')](_0x946b('0xc'),auth[_0x946b('0xa')](),controller['show']);router['get'](_0x946b('0xd'),auth[_0x946b('0xa')](),controller[_0x946b('0xe')]);router[_0x946b('0x9')](_0x946b('0xf'),auth['isAuthenticated'](),controller[_0x946b('0x10')]);router[_0x946b('0x11')]('/',auth[_0x946b('0xa')](),controller[_0x946b('0x12')]);router[_0x946b('0x11')](_0x946b('0xd'),auth['isAuthenticated'](),controller[_0x946b('0x13')]);router[_0x946b('0x14')](_0x946b('0xc'),auth[_0x946b('0xa')](),controller[_0x946b('0x15')]);router[_0x946b('0x16')](_0x946b('0xc'),auth['isAuthenticated'](),controller[_0x946b('0x17')]);module[_0x946b('0x18')]=router; \ No newline at end of file +var _0xa530=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','exports','multer','util','connect-timeout','express'];(function(_0x1be6d0,_0x223671){var _0x2e8772=function(_0x2e5ff3){while(--_0x2e5ff3){_0x1be6d0['push'](_0x1be6d0['shift']());}};_0x2e8772(++_0x223671);}(_0xa530,0x7a));var _0x0a53=function(_0x206711,_0x4125b4){_0x206711=_0x206711-0x0;var _0x4fe02b=_0xa530[_0x206711];return _0x4fe02b;};'use strict';var multer=require(_0x0a53('0x0'));var util=require(_0x0a53('0x1'));var path=require('path');var timeout=require(_0x0a53('0x2'));var express=require(_0x0a53('0x3'));var router=express[_0x0a53('0x4')]();var fs_extra=require(_0x0a53('0x5'));var auth=require(_0x0a53('0x6'));var interaction=require(_0x0a53('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0x0a53('0x8')]('/',auth[_0x0a53('0x9')](),controller['index']);router[_0x0a53('0x8')](_0x0a53('0xa'),auth[_0x0a53('0x9')](),controller[_0x0a53('0xb')]);router[_0x0a53('0x8')](_0x0a53('0xc'),auth[_0x0a53('0x9')](),controller[_0x0a53('0xd')]);router['get'](_0x0a53('0xe'),auth[_0x0a53('0x9')](),controller['getFields']);router[_0x0a53('0xf')]('/',auth['isAuthenticated'](),controller[_0x0a53('0x10')]);router[_0x0a53('0xf')](_0x0a53('0xc'),auth[_0x0a53('0x9')](),controller[_0x0a53('0x11')]);router[_0x0a53('0x12')]('/:id',auth[_0x0a53('0x9')](),controller['update']);router[_0x0a53('0x13')](_0x0a53('0xa'),auth[_0x0a53('0x9')](),controller['destroy']);module[_0x0a53('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 203f44b..00298a5 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 _0x1784=['username','sequelize','exports','STRING'];(function(_0x55a45b,_0xdcc130){var _0x4b140b=function(_0x45a521){while(--_0x45a521){_0x55a45b['push'](_0x55a45b['shift']());}};_0x4b140b(++_0xdcc130);}(_0x1784,0x1e1));var _0x4178=function(_0x5de97d,_0x1141ee){_0x5de97d=_0x5de97d-0x0;var _0x2da950=_0x1784[_0x5de97d];return _0x2da950;};'use strict';var Sequelize=require(_0x4178('0x0'));module[_0x4178('0x1')]={'name':{'type':Sequelize[_0x4178('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4178('0x2')],'unique':_0x4178('0x3')},'password':{'type':Sequelize[_0x4178('0x2')]},'email':{'type':Sequelize[_0x4178('0x2')]},'remoteUri':{'type':Sequelize[_0x4178('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4178('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa60f=['sequelize','STRING','username','remoteUri'];(function(_0x13c3cb,_0x315171){var _0x28afce=function(_0x8a72f9){while(--_0x8a72f9){_0x13c3cb['push'](_0x13c3cb['shift']());}};_0x28afce(++_0x315171);}(_0xa60f,0xec));var _0xfa60=function(_0x13d668,_0x1b74c1){_0x13d668=_0x13d668-0x0;var _0x342946=_0xa60f[_0x13d668];return _0x342946;};'use strict';var Sequelize=require(_0xfa60('0x0'));module['exports']={'name':{'type':Sequelize[_0xfa60('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xfa60('0x2')},'password':{'type':Sequelize[_0xfa60('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfa60('0x1')],'unique':_0xfa60('0x3')},'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 3eb1d5a..c5374fd 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 _0x5cb9=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','ServicenowAccount','findAll','catch','params','length','merge','find','create','body','getConfigurations','ServicenowConfiguration','pick','addConfiguration','findOne','AccountId','Descriptions','getDescriptions','channel','Subjects','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','state','sys_created_by','closed_at','cmdb_ci','active','work_notes_list','business_service','sys_domain_path','rfc','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','description','calendar_duration','sys_class_name','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','problem_id','company','reassignment_count','severity','comments','sla_due','approval','comments_and_work_notes','due_date','reopen_count','upon_approval','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','forEach','internalType','push','all','log','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','error','Wrong\x20credentials','boolean','true','false','inactive','value','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index'];(function(_0x3448d8,_0x168aae){var _0x5a36bc=function(_0x1f73f8){while(--_0x1f73f8){_0x3448d8['push'](_0x3448d8['shift']());}};_0x5a36bc(++_0x168aae);}(_0x5cb9,0x136));var _0x95cb=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x5cb9[_0x2aec52];return _0x3b8835;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x95cb('0x0'));var moment=require(_0x95cb('0x1'));var BPromise=require(_0x95cb('0x2'));var Mustache=require(_0x95cb('0x3'));var util=require(_0x95cb('0x4'));var path=require(_0x95cb('0x5'));var sox=require('sox');var csv=require(_0x95cb('0x6'));var ejs=require(_0x95cb('0x7'));var fs=require('fs');var fs_extra=require(_0x95cb('0x8'));var _=require(_0x95cb('0x9'));var squel=require(_0x95cb('0xa'));var crypto=require(_0x95cb('0xb'));var jsforce=require(_0x95cb('0xc'));var deskjs=require(_0x95cb('0xd'));var toCsv=require(_0x95cb('0x6'));var querystring=require(_0x95cb('0xe'));var Papa=require(_0x95cb('0xf'));var Redis=require(_0x95cb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x95cb('0x11'));var as=require(_0x95cb('0x12'));var hardwareService=require(_0x95cb('0x13'));var logger=require(_0x95cb('0x14'))(_0x95cb('0x15'));var utils=require('../../config/utils');var config=require(_0x95cb('0x16'));var licenseUtil=require(_0x95cb('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x95cb('0x18'));function respondWithStatusCode(_0xac36a0,_0x2d2403){_0x2d2403=_0x2d2403||0xcc;return function(_0x19a399){if(_0x19a399){return _0xac36a0['sendStatus'](_0x2d2403);}return _0xac36a0[_0x95cb('0x19')](_0x2d2403)['end']();};}function respondWithResult(_0x2e5484,_0x355c6a){_0x355c6a=_0x355c6a||0xc8;return function(_0x45b70f){if(_0x45b70f){return _0x2e5484[_0x95cb('0x19')](_0x355c6a)[_0x95cb('0x1a')](_0x45b70f);}};}function respondWithFilteredResult(_0x311341,_0x59b1af){return function(_0x413ecd){if(_0x413ecd){var _0xf9dff7=typeof _0x59b1af[_0x95cb('0x1b')]===_0x95cb('0x1c')&&typeof _0x59b1af[_0x95cb('0x1d')]===_0x95cb('0x1c');var _0x2f0cc6=_0x413ecd[_0x95cb('0x1e')];var _0x414b17=_0xf9dff7?0x0:_0x59b1af['offset'];var _0x629440=_0xf9dff7?_0x413ecd['count']:_0x59b1af[_0x95cb('0x1b')]+_0x59b1af['limit'];var _0x36326f;if(_0x629440>=_0x2f0cc6){_0x629440=_0x2f0cc6;_0x36326f=0xc8;}else{_0x36326f=0xce;}_0x311341[_0x95cb('0x19')](_0x36326f);return _0x311341[_0x95cb('0x1f')]('Content-Range',_0x414b17+'-'+_0x629440+'/'+_0x2f0cc6)[_0x95cb('0x1a')](_0x413ecd);}return null;};}function patchUpdates(_0x122b39){return function(_0x48dae2){try{jsonpatch[_0x95cb('0x20')](_0x48dae2,_0x122b39,!![]);}catch(_0x3991d5){return BPromise[_0x95cb('0x21')](_0x3991d5);}return _0x48dae2[_0x95cb('0x22')]();};}function saveUpdates(_0x180f70,_0x37a14b){return function(_0x1db3c0){if(_0x1db3c0){return _0x1db3c0[_0x95cb('0x23')](_0x180f70)['then'](function(_0x489c27){return _0x489c27;});}return null;};}function removeEntity(_0x6334df,_0x245d37){return function(_0x254614){if(_0x254614){return _0x254614[_0x95cb('0x24')]()[_0x95cb('0x25')](function(){_0x6334df['status'](0xcc)[_0x95cb('0x26')]();});}};}function handleEntityNotFound(_0x3cb95a,_0x37d7bd){return function(_0x13af2d){if(!_0x13af2d){_0x3cb95a[_0x95cb('0x27')](0x194);}return _0x13af2d;};}function handleError(_0x4a7f6c,_0x78918f){_0x78918f=_0x78918f||0x1f4;return function(_0x420f71){logger['error'](_0x420f71[_0x95cb('0x28')]);if(_0x420f71[_0x95cb('0x29')]){delete _0x420f71['name'];}_0x4a7f6c[_0x95cb('0x19')](_0x78918f)[_0x95cb('0x2a')](_0x420f71);};}exports[_0x95cb('0x2b')]=function(_0x32b670,_0x1e6c81){var _0x2c206d={},_0x1ef23e={},_0x4e42b1={'count':0x0,'rows':[]};var _0x1f84e7=_['map'](db['ServicenowAccount'][_0x95cb('0x2c')],function(_0x75ad83){return{'name':_0x75ad83[_0x95cb('0x2d')],'type':_0x75ad83[_0x95cb('0x2e')][_0x95cb('0x2f')]};});_0x1ef23e[_0x95cb('0x30')]=_[_0x95cb('0x31')](_0x1f84e7,_0x95cb('0x29'));_0x1ef23e[_0x95cb('0x32')]=_[_0x95cb('0x33')](_0x32b670[_0x95cb('0x32')]);_0x1ef23e[_0x95cb('0x34')]=_[_0x95cb('0x35')](_0x1ef23e[_0x95cb('0x30')],_0x1ef23e[_0x95cb('0x32')]);_0x2c206d[_0x95cb('0x36')]=_[_0x95cb('0x35')](_0x1ef23e[_0x95cb('0x30')],qs[_0x95cb('0x37')](_0x32b670[_0x95cb('0x32')][_0x95cb('0x37')]));_0x2c206d['attributes']=_0x2c206d[_0x95cb('0x36')]['length']?_0x2c206d[_0x95cb('0x36')]:_0x1ef23e[_0x95cb('0x30')];if(!_0x32b670[_0x95cb('0x32')][_0x95cb('0x38')](_0x95cb('0x39'))){_0x2c206d[_0x95cb('0x1d')]=qs[_0x95cb('0x1d')](_0x32b670[_0x95cb('0x32')]['limit']);_0x2c206d[_0x95cb('0x1b')]=qs[_0x95cb('0x1b')](_0x32b670[_0x95cb('0x32')][_0x95cb('0x1b')]);}_0x2c206d['order']=qs['sort'](_0x32b670[_0x95cb('0x32')][_0x95cb('0x3a')]);_0x2c206d[_0x95cb('0x3b')]=qs[_0x95cb('0x34')](_['pick'](_0x32b670[_0x95cb('0x32')],_0x1ef23e['filters']),_0x1f84e7);if(_0x32b670[_0x95cb('0x32')][_0x95cb('0x3c')]){_0x2c206d['where']=_['merge'](_0x2c206d[_0x95cb('0x3b')],{'$or':_[_0x95cb('0x31')](_0x1f84e7,function(_0x328448){if(_0x328448[_0x95cb('0x2e')]!==_0x95cb('0x3d')){var _0x596626={};_0x596626[_0x328448[_0x95cb('0x29')]]={'$like':'%'+_0x32b670[_0x95cb('0x32')][_0x95cb('0x3c')]+'%'};return _0x596626;}})});}_0x2c206d=_['merge']({},_0x2c206d,_0x32b670[_0x95cb('0x3e')]);var _0x599607={'where':_0x2c206d[_0x95cb('0x3b')]};return db['ServicenowAccount']['count'](_0x599607)[_0x95cb('0x25')](function(_0x745389){_0x4e42b1[_0x95cb('0x1e')]=_0x745389;if(_0x32b670[_0x95cb('0x32')][_0x95cb('0x3f')]){_0x2c206d[_0x95cb('0x40')]=[{'all':!![]}];}return db[_0x95cb('0x41')][_0x95cb('0x42')](_0x2c206d);})[_0x95cb('0x25')](function(_0x2919e4){_0x4e42b1['rows']=_0x2919e4;return _0x4e42b1;})[_0x95cb('0x25')](respondWithFilteredResult(_0x1e6c81,_0x2c206d))[_0x95cb('0x43')](handleError(_0x1e6c81,null));};exports['show']=function(_0x2d7c13,_0xf76c8a){var _0x53cfef={'raw':![],'where':{'id':_0x2d7c13[_0x95cb('0x44')]['id']}},_0x47d756={};_0x47d756['model']=_[_0x95cb('0x33')](db[_0x95cb('0x41')]['rawAttributes']);_0x47d756[_0x95cb('0x32')]=_['keys'](_0x2d7c13[_0x95cb('0x32')]);_0x47d756[_0x95cb('0x34')]=_[_0x95cb('0x35')](_0x47d756[_0x95cb('0x30')],_0x47d756[_0x95cb('0x32')]);_0x53cfef['attributes']=_[_0x95cb('0x35')](_0x47d756[_0x95cb('0x30')],qs[_0x95cb('0x37')](_0x2d7c13[_0x95cb('0x32')][_0x95cb('0x37')]));_0x53cfef['attributes']=_0x53cfef[_0x95cb('0x36')][_0x95cb('0x45')]?_0x53cfef[_0x95cb('0x36')]:_0x47d756[_0x95cb('0x30')];if(_0x2d7c13['query'][_0x95cb('0x3f')]){_0x53cfef[_0x95cb('0x40')]=[{'all':!![]}];}_0x53cfef=_[_0x95cb('0x46')]({},_0x53cfef,_0x2d7c13[_0x95cb('0x3e')]);return db[_0x95cb('0x41')][_0x95cb('0x47')](_0x53cfef)[_0x95cb('0x25')](handleEntityNotFound(_0xf76c8a,null))[_0x95cb('0x25')](respondWithResult(_0xf76c8a,null))[_0x95cb('0x43')](handleError(_0xf76c8a,null));};exports[_0x95cb('0x48')]=function(_0x420e84,_0x1b72cf){return db[_0x95cb('0x41')][_0x95cb('0x48')](_0x420e84[_0x95cb('0x49')],{})[_0x95cb('0x25')](respondWithResult(_0x1b72cf,0xc9))['catch'](handleError(_0x1b72cf,null));};exports[_0x95cb('0x23')]=function(_0x2eb218,_0x1f7948){if(_0x2eb218[_0x95cb('0x49')]['id']){delete _0x2eb218[_0x95cb('0x49')]['id'];}return db[_0x95cb('0x41')]['find']({'where':{'id':_0x2eb218['params']['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x1f7948,null))[_0x95cb('0x25')](saveUpdates(_0x2eb218[_0x95cb('0x49')],null))[_0x95cb('0x25')](respondWithResult(_0x1f7948,null))[_0x95cb('0x43')](handleError(_0x1f7948,null));};exports['destroy']=function(_0x426f01,_0x35c04c){return db[_0x95cb('0x41')][_0x95cb('0x47')]({'where':{'id':_0x426f01[_0x95cb('0x44')]['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x35c04c,null))[_0x95cb('0x25')](removeEntity(_0x35c04c,null))[_0x95cb('0x43')](handleError(_0x35c04c,null));};exports[_0x95cb('0x4a')]=function(_0x2a1a8f,_0x552bc3,_0x398d9c){var _0x30f7e5={};var _0x3cce8e={};var _0x2ab3c2;var _0x26ba8f;return db['ServicenowAccount']['findOne']({'where':{'id':_0x2a1a8f[_0x95cb('0x44')]['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x552bc3,null))[_0x95cb('0x25')](function(_0x35cb47){if(_0x35cb47){_0x2ab3c2=_0x35cb47;_0x3cce8e[_0x95cb('0x30')]=_[_0x95cb('0x33')](db[_0x95cb('0x4b')]['rawAttributes']);_0x3cce8e[_0x95cb('0x32')]=_[_0x95cb('0x33')](_0x2a1a8f['query']);_0x3cce8e[_0x95cb('0x34')]=_['intersection'](_0x3cce8e[_0x95cb('0x30')],_0x3cce8e['query']);_0x30f7e5[_0x95cb('0x36')]=_[_0x95cb('0x35')](_0x3cce8e[_0x95cb('0x30')],qs[_0x95cb('0x37')](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x37')]));_0x30f7e5[_0x95cb('0x36')]=_0x30f7e5['attributes'][_0x95cb('0x45')]?_0x30f7e5[_0x95cb('0x36')]:_0x3cce8e[_0x95cb('0x30')];_0x30f7e5['order']=qs['sort'](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x3a')]);_0x30f7e5[_0x95cb('0x3b')]=qs[_0x95cb('0x34')](_[_0x95cb('0x4c')](_0x2a1a8f['query'],_0x3cce8e[_0x95cb('0x34')]));if(_0x2a1a8f['query'][_0x95cb('0x3c')]){_0x30f7e5[_0x95cb('0x3b')]=_['merge'](_0x30f7e5[_0x95cb('0x3b')],{'$or':_[_0x95cb('0x31')](_0x30f7e5[_0x95cb('0x36')],function(_0x49a2c4){var _0x1cd58d={};_0x1cd58d[_0x49a2c4]={'$like':'%'+_0x2a1a8f[_0x95cb('0x32')]['filter']+'%'};return _0x1cd58d;})});}_0x30f7e5=_[_0x95cb('0x46')]({},_0x30f7e5,_0x2a1a8f[_0x95cb('0x3e')]);return _0x2ab3c2[_0x95cb('0x4a')](_0x30f7e5);}})[_0x95cb('0x25')](function(_0x334ca8){if(_0x334ca8){_0x26ba8f=_0x334ca8[_0x95cb('0x45')];if(!_0x2a1a8f['query'][_0x95cb('0x38')]('nolimit')){_0x30f7e5[_0x95cb('0x1d')]=qs['limit'](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x1d')]);_0x30f7e5[_0x95cb('0x1b')]=qs[_0x95cb('0x1b')](_0x2a1a8f[_0x95cb('0x32')][_0x95cb('0x1b')]);}return _0x2ab3c2[_0x95cb('0x4a')](_0x30f7e5);}})[_0x95cb('0x25')](function(_0x2ac087){if(_0x2ac087){return _0x2ac087?{'count':_0x26ba8f,'rows':_0x2ac087}:null;}})[_0x95cb('0x25')](respondWithResult(_0x552bc3,null))['catch'](handleError(_0x552bc3,null));};exports[_0x95cb('0x4d')]=function(_0x427cb5,_0x1033df,_0x1611a8){if(_0x427cb5['body']['id']){delete _0x427cb5['body']['id'];}return db['ServicenowAccount'][_0x95cb('0x4e')]({'where':{'id':_0x427cb5[_0x95cb('0x44')]['id']}})[_0x95cb('0x25')](handleEntityNotFound(_0x1033df,null))[_0x95cb('0x25')](function(_0x1286d8){if(_0x1286d8){_0x427cb5[_0x95cb('0x49')][_0x95cb('0x4f')]=_0x1286d8['id'];_0x427cb5[_0x95cb('0x49')]['Subjects']=integrations['getSubjects'](_0x427cb5[_0x95cb('0x49')]['channel'],_0x427cb5[_0x95cb('0x49')]['type']);_0x427cb5[_0x95cb('0x49')][_0x95cb('0x50')]=integrations[_0x95cb('0x51')](_0x427cb5[_0x95cb('0x49')][_0x95cb('0x52')],_0x427cb5[_0x95cb('0x49')]['type']);return db[_0x95cb('0x4b')][_0x95cb('0x48')](_0x427cb5[_0x95cb('0x49')],{'include':[{'model':db['ServicenowField'],'as':_0x95cb('0x53')},{'model':db[_0x95cb('0x54')],'as':_0x95cb('0x50')}]});}return null;})[_0x95cb('0x25')](respondWithResult(_0x1033df,null))[_0x95cb('0x43')](handleError(_0x1033df,null));};exports[_0x95cb('0x55')]=function(_0x345d5a,_0x48b5e7,_0x4640d8){var _0x1992d5=[_0x95cb('0x56'),_0x95cb('0x57'),_0x95cb('0x58'),_0x95cb('0x59'),_0x95cb('0x5a'),_0x95cb('0x5b'),'incident_state','severity',_0x95cb('0x5c')];var _0x407f52=[_0x95cb('0x5d'),_0x95cb('0x56'),_0x95cb('0x5e'),_0x95cb('0x5f'),'upon_reject',_0x95cb('0x60'),_0x95cb('0x61'),_0x95cb('0x57'),'approval_history',_0x95cb('0x62'),_0x95cb('0x63'),_0x95cb('0x64'),_0x95cb('0x65'),_0x95cb('0x66'),'sys_created_on','sys_domain',_0x95cb('0x67'),_0x95cb('0x68'),_0x95cb('0x58'),'order','calendar_stc',_0x95cb('0x69'),_0x95cb('0x6a'),'delivery_plan','impact',_0x95cb('0x6b'),_0x95cb('0x6c'),_0x95cb('0x6d'),'priority',_0x95cb('0x6e'),_0x95cb('0x6f'),'time_worked','expected_start',_0x95cb('0x70'),_0x95cb('0x71'),_0x95cb('0x72'),_0x95cb('0x73'),_0x95cb('0x74'),_0x95cb('0x75'),_0x95cb('0x76'),_0x95cb('0x77'),_0x95cb('0x59'),_0x95cb('0x78'),_0x95cb('0x79'),_0x95cb('0x5a'),_0x95cb('0x7a'),_0x95cb('0x7b'),_0x95cb('0x7c'),'assignment_group',_0x95cb('0x7d'),'additional_assignee_list',_0x95cb('0x7e'),_0x95cb('0x7f'),'notify',_0x95cb('0x80'),'close_notes',_0x95cb('0x81'),_0x95cb('0x82'),_0x95cb('0x83'),_0x95cb('0x84'),'contact_type',_0x95cb('0x85'),_0x95cb('0x86'),'urgency',_0x95cb('0x87'),_0x95cb('0x88'),_0x95cb('0x89'),'activity_due','assigned_to',_0x95cb('0x8a'),_0x95cb('0x8b'),_0x95cb('0x8c'),_0x95cb('0x8d'),_0x95cb('0x8e'),_0x95cb('0x8f'),'sys_mod_count',_0x95cb('0x90'),'sys_tags','escalation',_0x95cb('0x91'),'correlation_id','location',_0x95cb('0x5c')];var _0x159dbc='';var _0x464276='';var _0x16f5ac=[];var _0x405ed6='';var _0x4862a2='';var _0x4a6d94=[];var _0x25fed4='';var _0x54e124='';var _0x5d5447={};var _0x5041fa='';return db['ServicenowAccount'][_0x95cb('0x4e')]({'where':{'id':_0x345d5a[_0x95cb('0x44')]['id']},'attributes':['id','username',_0x95cb('0x92'),'email',_0x95cb('0x93'),_0x95cb('0x94')]})[_0x95cb('0x25')](handleEntityNotFound(_0x48b5e7,null))[_0x95cb('0x25')](function(_0x121ad7){if(_0x121ad7){_0x5041fa=_0x121ad7[_0x95cb('0x93')];var _0x596ef3=_0x5041fa[_0x95cb('0x95')](-0x1);if(_0x596ef3==='/'){_0x5041fa=_0x5041fa[_0x95cb('0x96')](0x0,_0x5041fa[_0x95cb('0x97')](_0x596ef3));}_0x54e124=util[_0x95cb('0x98')](_0x95cb('0x99'),_0x5041fa);_0x25fed4=util[_0x95cb('0x98')](_0x95cb('0x9a'),_0x5041fa);_0x5d5447={'user':_0x121ad7['username'],'pass':_0x121ad7[_0x95cb('0x92')]};var _0x261390={'method':_0x95cb('0x9b'),'uri':_0x54e124+_0x95cb('0x9c'),'auth':_0x5d5447,'json':!![]};return rp(_0x261390);}})[_0x95cb('0x25')](function(_0xb5e7c6){if(_0xb5e7c6[_0x95cb('0x9d')]['length']>0x0){_0x159dbc=_0xb5e7c6[_0x95cb('0x9d')];}console['log']('incident\x20table\x20objects',_0x159dbc);_0x4a6d94=[];_0x464276=Object[_0x95cb('0x9e')]([],_0x159dbc);_['remove'](_0x464276,function(_0x1c4d9f){return!_0x1992d5['includes'](_0x1c4d9f['name']);});_0x464276[_0x95cb('0x9f')](function(_0x495ddf){var _0x11c385=createFieldObject(_0x25fed4,_0x5d5447,_0x495ddf[_0x95cb('0xa0')],_0x495ddf[_0x95cb('0x29')],_0x495ddf['label'],![]);_0x4a6d94[_0x95cb('0xa1')](_0x11c385);});return Promise[_0x95cb('0xa2')](_0x4a6d94);})[_0x95cb('0x25')](function(_0x2afd50){_0x16f5ac=_0x2afd50;_0x405ed6=Object[_0x95cb('0x9e')]([],_0x159dbc);console[_0x95cb('0xa3')]('TCL:\x20_object',_0x159dbc);_['remove'](_0x405ed6,function(_0x112b9d){return _0x407f52[_0x95cb('0xa4')](_0x112b9d['name']);});console[_0x95cb('0xa3')](_0x95cb('0xa5'),_0x405ed6);_0x4a6d94=[];_0x405ed6['forEach'](function(_0x21b593){var _0x9b4f41=createFieldObject(_0x25fed4,_0x5d5447,_0x21b593['internalType'],_0x21b593[_0x95cb('0x29')],_0x21b593[_0x95cb('0xa6')],!![]);_0x4a6d94[_0x95cb('0xa1')](_0x9b4f41);});return Promise[_0x95cb('0xa2')](_0x4a6d94);})[_0x95cb('0x25')](function(_0x3acff5){_0x4862a2=_0x3acff5;var _0xdca090=_0x16f5ac[_0x95cb('0xa7')](_0x4862a2);return{'count':_0xdca090[_0x95cb('0x45')],'rows':_0xdca090};})[_0x95cb('0x25')](respondWithResult(_0x48b5e7,null))['catch'](function(_0x111f6d){console[_0x95cb('0xa3')](_0x95cb('0xa8')+_0x111f6d);var _0x3b81cd=_0x345d5a[_0x95cb('0x32')]['test']?0x1f4:_0x111f6d[_0x95cb('0xa9')]||0x1f4;logger[_0x95cb('0xaa')](_0x111f6d[_0x95cb('0x28')]);delete _0x111f6d[_0x95cb('0x29')];if(_0x3b81cd===0x191){_0x3b81cd=0x190;}_0x48b5e7[_0x95cb('0x19')](_0x3b81cd)[_0x95cb('0x2a')](_0x345d5a[_0x95cb('0x32')]['test']?{'message':_0x95cb('0xab'),'statusCode':_0x111f6d[_0x95cb('0xa9')]}:_0x111f6d);});};function createFieldObject(_0x82fd25,_0x2b0950,_0xa64e9d,_0x5cecfe,_0x57e197,_0x4083fe){return new Promise(function(_0x20aa76,_0x440003){var _0x31cef8={'id':_0x5cecfe,'name':_0x57e197,'custom':_0x4083fe};if(_0xa64e9d===_0x95cb('0xac')){_0x31cef8[_0x95cb('0x3e')]=[{'name':'True','value':_0x95cb('0xad')},{'name':'False','value':_0x95cb('0xae')}];_0x20aa76(_0x31cef8);}else{var _0xf698ec={'method':_0x95cb('0x9b'),'uri':_0x82fd25+'sys_choice?sysparm_query=name=incident^element='+_0x5cecfe,'auth':_0x2b0950,'json':!![]};return rp(_0xf698ec)[_0x95cb('0x25')](function(_0x29a553){var _0x52b895=[];if(_0x29a553['result'][_0x95cb('0x45')]>0x0){_0x29a553[_0x95cb('0x9d')]['forEach'](function(_0xaba557){if(_0xaba557[_0x95cb('0xaf')]===_0x95cb('0xae')){var _0x2da0f2={'name':_0xaba557[_0x95cb('0xa6')],'value':_0xaba557[_0x95cb('0xb0')]};_0x52b895[_0x95cb('0xa1')](_0x2da0f2);}});}_0x31cef8[_0x95cb('0x3e')]=_0x52b895;if(_0x31cef8[_0x95cb('0x3e')][_0x95cb('0x45')]>0x0){_0x20aa76(_0x31cef8);}else{if(_0x4083fe==![]){_0x20aa76();}else{_0x20aa76(_0x31cef8);}}});}});} \ No newline at end of file +var _0xe7df=['show','params','keys','length','includeAll','create','body','catch','find','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ServicenowField','Subjects','made_sla','hold_reason','knowledge','subcategory','notify','severity','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','incident_state','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_tags','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','test','statusCode','stack','send','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','ServicenowAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include'];(function(_0xbd7925,_0x2d046b){var _0x213b72=function(_0x2c9784){while(--_0x2c9784){_0xbd7925['push'](_0xbd7925['shift']());}};_0x213b72(++_0x2d046b);}(_0xe7df,0x131));var _0xfe7d=function(_0x264388,_0x215668){_0x264388=_0x264388-0x0;var _0x54103f=_0xe7df[_0x264388];return _0x54103f;};'use strict';var emlformat=require(_0xfe7d('0x0'));var rimraf=require(_0xfe7d('0x1'));var zipdir=require(_0xfe7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe7d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfe7d('0x4'));var util=require('util');var path=require('path');var sox=require(_0xfe7d('0x5'));var csv=require(_0xfe7d('0x6'));var ejs=require(_0xfe7d('0x7'));var fs=require('fs');var fs_extra=require(_0xfe7d('0x8'));var _=require(_0xfe7d('0x9'));var squel=require('squel');var crypto=require(_0xfe7d('0xa'));var jsforce=require(_0xfe7d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xfe7d('0x6'));var querystring=require(_0xfe7d('0xc'));var Papa=require('papaparse');var Redis=require(_0xfe7d('0xd'));var authService=require(_0xfe7d('0xe'));var qs=require(_0xfe7d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe7d('0x10'))('api');var utils=require(_0xfe7d('0x11'));var config=require(_0xfe7d('0x12'));var licenseUtil=require(_0xfe7d('0x13'));var db=require(_0xfe7d('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4f4b6b,_0xbfd69b){_0xbfd69b=_0xbfd69b||0xcc;return function(_0x1c5c38){if(_0x1c5c38){return _0x4f4b6b[_0xfe7d('0x15')](_0xbfd69b);}return _0x4f4b6b[_0xfe7d('0x16')](_0xbfd69b)[_0xfe7d('0x17')]();};}function respondWithResult(_0x3e691a,_0x510e8f){_0x510e8f=_0x510e8f||0xc8;return function(_0x2f469a){if(_0x2f469a){return _0x3e691a[_0xfe7d('0x16')](_0x510e8f)[_0xfe7d('0x18')](_0x2f469a);}};}function respondWithFilteredResult(_0xc6c2f1,_0x3c77fb){return function(_0x232b1c){if(_0x232b1c){var _0x36846c=typeof _0x3c77fb[_0xfe7d('0x19')]===_0xfe7d('0x1a')&&typeof _0x3c77fb[_0xfe7d('0x1b')]===_0xfe7d('0x1a');var _0x3d1213=_0x232b1c[_0xfe7d('0x1c')];var _0xbe0449=_0x36846c?0x0:_0x3c77fb['offset'];var _0x3c776b=_0x36846c?_0x232b1c[_0xfe7d('0x1c')]:_0x3c77fb[_0xfe7d('0x19')]+_0x3c77fb[_0xfe7d('0x1b')];var _0x202a89;if(_0x3c776b>=_0x3d1213){_0x3c776b=_0x3d1213;_0x202a89=0xc8;}else{_0x202a89=0xce;}_0xc6c2f1[_0xfe7d('0x16')](_0x202a89);return _0xc6c2f1[_0xfe7d('0x1d')](_0xfe7d('0x1e'),_0xbe0449+'-'+_0x3c776b+'/'+_0x3d1213)['json'](_0x232b1c);}return null;};}function patchUpdates(_0x2f1fbf){return function(_0x3abb24){try{jsonpatch[_0xfe7d('0x1f')](_0x3abb24,_0x2f1fbf,!![]);}catch(_0x2dddd3){return BPromise[_0xfe7d('0x20')](_0x2dddd3);}return _0x3abb24[_0xfe7d('0x21')]();};}function saveUpdates(_0x1dc89e,_0x543b3d){return function(_0x594074){if(_0x594074){return _0x594074[_0xfe7d('0x22')](_0x1dc89e)[_0xfe7d('0x23')](function(_0x16505c){return _0x16505c;});}return null;};}function removeEntity(_0x2a5947,_0x3a74c2){return function(_0x5dee85){if(_0x5dee85){return _0x5dee85[_0xfe7d('0x24')]()[_0xfe7d('0x23')](function(){_0x2a5947['status'](0xcc)[_0xfe7d('0x17')]();});}};}function handleEntityNotFound(_0x556725,_0x519d95){return function(_0x3359d0){if(!_0x3359d0){_0x556725[_0xfe7d('0x15')](0x194);}return _0x3359d0;};}function handleError(_0x59c65b,_0x2d6612){_0x2d6612=_0x2d6612||0x1f4;return function(_0x19afa7){logger['error'](_0x19afa7['stack']);if(_0x19afa7[_0xfe7d('0x25')]){delete _0x19afa7[_0xfe7d('0x25')];}_0x59c65b[_0xfe7d('0x16')](_0x2d6612)['send'](_0x19afa7);};}exports[_0xfe7d('0x26')]=function(_0x2f80a2,_0x505180){var _0x9dd90c={},_0x57c458={},_0x595e1a={'count':0x0,'rows':[]};var _0x46be89=_[_0xfe7d('0x27')](db[_0xfe7d('0x28')][_0xfe7d('0x29')],function(_0x56f184){return{'name':_0x56f184['fieldName'],'type':_0x56f184[_0xfe7d('0x2a')][_0xfe7d('0x2b')]};});_0x57c458[_0xfe7d('0x2c')]=_[_0xfe7d('0x27')](_0x46be89,_0xfe7d('0x25'));_0x57c458[_0xfe7d('0x2d')]=_['keys'](_0x2f80a2['query']);_0x57c458[_0xfe7d('0x2e')]=_[_0xfe7d('0x2f')](_0x57c458[_0xfe7d('0x2c')],_0x57c458[_0xfe7d('0x2d')]);_0x9dd90c[_0xfe7d('0x30')]=_['intersection'](_0x57c458[_0xfe7d('0x2c')],qs[_0xfe7d('0x31')](_0x2f80a2[_0xfe7d('0x2d')][_0xfe7d('0x31')]));_0x9dd90c[_0xfe7d('0x30')]=_0x9dd90c[_0xfe7d('0x30')]['length']?_0x9dd90c[_0xfe7d('0x30')]:_0x57c458[_0xfe7d('0x2c')];if(!_0x2f80a2[_0xfe7d('0x2d')][_0xfe7d('0x32')](_0xfe7d('0x33'))){_0x9dd90c[_0xfe7d('0x1b')]=qs[_0xfe7d('0x1b')](_0x2f80a2[_0xfe7d('0x2d')]['limit']);_0x9dd90c[_0xfe7d('0x19')]=qs['offset'](_0x2f80a2[_0xfe7d('0x2d')][_0xfe7d('0x19')]);}_0x9dd90c[_0xfe7d('0x34')]=qs['sort'](_0x2f80a2[_0xfe7d('0x2d')][_0xfe7d('0x35')]);_0x9dd90c['where']=qs[_0xfe7d('0x2e')](_[_0xfe7d('0x36')](_0x2f80a2['query'],_0x57c458[_0xfe7d('0x2e')]),_0x46be89);if(_0x2f80a2['query'][_0xfe7d('0x37')]){_0x9dd90c[_0xfe7d('0x38')]=_[_0xfe7d('0x39')](_0x9dd90c[_0xfe7d('0x38')],{'$or':_[_0xfe7d('0x27')](_0x46be89,function(_0x43302c){if(_0x43302c['type']!==_0xfe7d('0x3a')){var _0x133f55={};_0x133f55[_0x43302c['name']]={'$like':'%'+_0x2f80a2[_0xfe7d('0x2d')][_0xfe7d('0x37')]+'%'};return _0x133f55;}})});}_0x9dd90c=_[_0xfe7d('0x39')]({},_0x9dd90c,_0x2f80a2[_0xfe7d('0x3b')]);var _0x410aef={'where':_0x9dd90c[_0xfe7d('0x38')]};return db[_0xfe7d('0x28')][_0xfe7d('0x1c')](_0x410aef)[_0xfe7d('0x23')](function(_0x4b2e79){_0x595e1a['count']=_0x4b2e79;if(_0x2f80a2['query']['includeAll']){_0x9dd90c[_0xfe7d('0x3c')]=[{'all':!![]}];}return db[_0xfe7d('0x28')]['findAll'](_0x9dd90c);})[_0xfe7d('0x23')](function(_0x14ee6c){_0x595e1a['rows']=_0x14ee6c;return _0x595e1a;})[_0xfe7d('0x23')](respondWithFilteredResult(_0x505180,_0x9dd90c))['catch'](handleError(_0x505180,null));};exports[_0xfe7d('0x3d')]=function(_0x519ee9,_0x101ee9){var _0x4512dd={'raw':![],'where':{'id':_0x519ee9[_0xfe7d('0x3e')]['id']}},_0x5219aa={};_0x5219aa[_0xfe7d('0x2c')]=_[_0xfe7d('0x3f')](db[_0xfe7d('0x28')][_0xfe7d('0x29')]);_0x5219aa[_0xfe7d('0x2d')]=_['keys'](_0x519ee9[_0xfe7d('0x2d')]);_0x5219aa[_0xfe7d('0x2e')]=_['intersection'](_0x5219aa[_0xfe7d('0x2c')],_0x5219aa[_0xfe7d('0x2d')]);_0x4512dd['attributes']=_[_0xfe7d('0x2f')](_0x5219aa['model'],qs[_0xfe7d('0x31')](_0x519ee9[_0xfe7d('0x2d')][_0xfe7d('0x31')]));_0x4512dd[_0xfe7d('0x30')]=_0x4512dd[_0xfe7d('0x30')][_0xfe7d('0x40')]?_0x4512dd[_0xfe7d('0x30')]:_0x5219aa[_0xfe7d('0x2c')];if(_0x519ee9[_0xfe7d('0x2d')][_0xfe7d('0x41')]){_0x4512dd['include']=[{'all':!![]}];}_0x4512dd=_[_0xfe7d('0x39')]({},_0x4512dd,_0x519ee9[_0xfe7d('0x3b')]);return db['ServicenowAccount']['find'](_0x4512dd)[_0xfe7d('0x23')](handleEntityNotFound(_0x101ee9,null))[_0xfe7d('0x23')](respondWithResult(_0x101ee9,null))['catch'](handleError(_0x101ee9,null));};exports[_0xfe7d('0x42')]=function(_0x1732de,_0x233f45){return db[_0xfe7d('0x28')]['create'](_0x1732de['body'],{})[_0xfe7d('0x23')](respondWithResult(_0x233f45,0xc9))['catch'](handleError(_0x233f45,null));};exports['update']=function(_0xc310f1,_0x4c9c1c){if(_0xc310f1[_0xfe7d('0x43')]['id']){delete _0xc310f1[_0xfe7d('0x43')]['id'];}return db[_0xfe7d('0x28')]['find']({'where':{'id':_0xc310f1[_0xfe7d('0x3e')]['id']}})[_0xfe7d('0x23')](handleEntityNotFound(_0x4c9c1c,null))['then'](saveUpdates(_0xc310f1[_0xfe7d('0x43')],null))[_0xfe7d('0x23')](respondWithResult(_0x4c9c1c,null))[_0xfe7d('0x44')](handleError(_0x4c9c1c,null));};exports[_0xfe7d('0x24')]=function(_0x59a34a,_0x460df7){return db[_0xfe7d('0x28')][_0xfe7d('0x45')]({'where':{'id':_0x59a34a[_0xfe7d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x460df7,null))[_0xfe7d('0x23')](removeEntity(_0x460df7,null))[_0xfe7d('0x44')](handleError(_0x460df7,null));};exports[_0xfe7d('0x46')]=function(_0x3672c8,_0x1902d8,_0x98d926){var _0x111261={};var _0x54038f={};var _0x4cde7a;var _0x3efb19;return db[_0xfe7d('0x28')][_0xfe7d('0x47')]({'where':{'id':_0x3672c8[_0xfe7d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1902d8,null))['then'](function(_0x3b74ae){if(_0x3b74ae){_0x4cde7a=_0x3b74ae;_0x54038f[_0xfe7d('0x2c')]=_[_0xfe7d('0x3f')](db[_0xfe7d('0x48')][_0xfe7d('0x29')]);_0x54038f[_0xfe7d('0x2d')]=_['keys'](_0x3672c8[_0xfe7d('0x2d')]);_0x54038f[_0xfe7d('0x2e')]=_['intersection'](_0x54038f[_0xfe7d('0x2c')],_0x54038f[_0xfe7d('0x2d')]);_0x111261[_0xfe7d('0x30')]=_[_0xfe7d('0x2f')](_0x54038f['model'],qs['fields'](_0x3672c8['query'][_0xfe7d('0x31')]));_0x111261['attributes']=_0x111261[_0xfe7d('0x30')][_0xfe7d('0x40')]?_0x111261[_0xfe7d('0x30')]:_0x54038f['model'];_0x111261['order']=qs[_0xfe7d('0x35')](_0x3672c8[_0xfe7d('0x2d')]['sort']);_0x111261[_0xfe7d('0x38')]=qs[_0xfe7d('0x2e')](_[_0xfe7d('0x36')](_0x3672c8[_0xfe7d('0x2d')],_0x54038f[_0xfe7d('0x2e')]));if(_0x3672c8[_0xfe7d('0x2d')][_0xfe7d('0x37')]){_0x111261['where']=_[_0xfe7d('0x39')](_0x111261[_0xfe7d('0x38')],{'$or':_[_0xfe7d('0x27')](_0x111261['attributes'],function(_0x41713a){var _0x2795e3={};_0x2795e3[_0x41713a]={'$like':'%'+_0x3672c8[_0xfe7d('0x2d')][_0xfe7d('0x37')]+'%'};return _0x2795e3;})});}_0x111261=_[_0xfe7d('0x39')]({},_0x111261,_0x3672c8['options']);return _0x4cde7a['getConfigurations'](_0x111261);}})[_0xfe7d('0x23')](function(_0x3162c7){if(_0x3162c7){_0x3efb19=_0x3162c7[_0xfe7d('0x40')];if(!_0x3672c8[_0xfe7d('0x2d')][_0xfe7d('0x32')](_0xfe7d('0x33'))){_0x111261[_0xfe7d('0x1b')]=qs[_0xfe7d('0x1b')](_0x3672c8[_0xfe7d('0x2d')][_0xfe7d('0x1b')]);_0x111261[_0xfe7d('0x19')]=qs[_0xfe7d('0x19')](_0x3672c8[_0xfe7d('0x2d')][_0xfe7d('0x19')]);}return _0x4cde7a[_0xfe7d('0x46')](_0x111261);}})[_0xfe7d('0x23')](function(_0x492919){if(_0x492919){return _0x492919?{'count':_0x3efb19,'rows':_0x492919}:null;}})[_0xfe7d('0x23')](respondWithResult(_0x1902d8,null))['catch'](handleError(_0x1902d8,null));};exports[_0xfe7d('0x49')]=function(_0x511dee,_0x150824,_0x474820){if(_0x511dee['body']['id']){delete _0x511dee[_0xfe7d('0x43')]['id'];}return db[_0xfe7d('0x28')][_0xfe7d('0x47')]({'where':{'id':_0x511dee['params']['id']}})['then'](handleEntityNotFound(_0x150824,null))['then'](function(_0x8c5e23){if(_0x8c5e23){_0x511dee[_0xfe7d('0x43')][_0xfe7d('0x4a')]=_0x8c5e23['id'];_0x511dee[_0xfe7d('0x43')]['Subjects']=integrations['getSubjects'](_0x511dee[_0xfe7d('0x43')][_0xfe7d('0x4b')],_0x511dee[_0xfe7d('0x43')][_0xfe7d('0x2a')]);_0x511dee[_0xfe7d('0x43')][_0xfe7d('0x4c')]=integrations[_0xfe7d('0x4d')](_0x511dee['body']['channel'],_0x511dee['body'][_0xfe7d('0x2a')]);return db['ServicenowConfiguration'][_0xfe7d('0x42')](_0x511dee[_0xfe7d('0x43')],{'include':[{'model':db[_0xfe7d('0x4e')],'as':_0xfe7d('0x4f')},{'model':db[_0xfe7d('0x4e')],'as':'Descriptions'}]});}return null;})[_0xfe7d('0x23')](respondWithResult(_0x150824,null))[_0xfe7d('0x44')](handleError(_0x150824,null));};exports['getFields']=function(_0x4e4127,_0x4e81e9,_0x5b58f4){var _0x47de84=[_0xfe7d('0x50'),_0xfe7d('0x51'),_0xfe7d('0x52'),_0xfe7d('0x53'),'close_code',_0xfe7d('0x54'),'incident_state',_0xfe7d('0x55'),_0xfe7d('0x56')];var _0x1fb447=[_0xfe7d('0x57'),_0xfe7d('0x50'),_0xfe7d('0x58'),_0xfe7d('0x59'),'upon_reject',_0xfe7d('0x5a'),_0xfe7d('0x5b'),_0xfe7d('0x51'),_0xfe7d('0x5c'),_0xfe7d('0x5d'),'resolved_by',_0xfe7d('0x5e'),'opened_by','user_input',_0xfe7d('0x5f'),_0xfe7d('0x60'),_0xfe7d('0x61'),_0xfe7d('0x62'),_0xfe7d('0x52'),_0xfe7d('0x34'),_0xfe7d('0x63'),_0xfe7d('0x64'),_0xfe7d('0x65'),_0xfe7d('0x66'),_0xfe7d('0x67'),'active','work_notes_list',_0xfe7d('0x68'),'priority',_0xfe7d('0x69'),_0xfe7d('0x6a'),_0xfe7d('0x6b'),_0xfe7d('0x6c'),_0xfe7d('0x6d'),_0xfe7d('0x6e'),_0xfe7d('0x6f'),'work_end',_0xfe7d('0x70'),_0xfe7d('0x71'),_0xfe7d('0x72'),_0xfe7d('0x73'),_0xfe7d('0x53'),_0xfe7d('0x74'),_0xfe7d('0x75'),'close_code',_0xfe7d('0x76'),_0xfe7d('0x77'),_0xfe7d('0x78'),_0xfe7d('0x79'),_0xfe7d('0x7a'),'additional_assignee_list','description',_0xfe7d('0x7b'),_0xfe7d('0x54'),_0xfe7d('0x7c'),_0xfe7d('0x7d'),_0xfe7d('0x7e'),_0xfe7d('0x7f'),_0xfe7d('0x80'),'sys_id',_0xfe7d('0x81'),_0xfe7d('0x82'),_0xfe7d('0x83'),'urgency',_0xfe7d('0x84'),_0xfe7d('0x85'),_0xfe7d('0x86'),_0xfe7d('0x87'),_0xfe7d('0x88'),_0xfe7d('0x55'),_0xfe7d('0x89'),_0xfe7d('0x8a'),_0xfe7d('0x8b'),'comments_and_work_notes',_0xfe7d('0x8c'),'sys_mod_count','reopen_count',_0xfe7d('0x8d'),'escalation',_0xfe7d('0x8e'),_0xfe7d('0x8f'),'location',_0xfe7d('0x56')];var _0x18d25b='';var _0x55f474='';var _0x2b5581=[];var _0x35a0d6='';var _0x285fb7='';var _0x319b92=[];var _0x4229e6='';var _0x4ade7f='';var _0x53b5cd={};var _0x3a41b4='';return db[_0xfe7d('0x28')][_0xfe7d('0x47')]({'where':{'id':_0x4e4127[_0xfe7d('0x3e')]['id']},'attributes':['id',_0xfe7d('0x90'),_0xfe7d('0x91'),_0xfe7d('0x92'),_0xfe7d('0x93'),_0xfe7d('0x94')]})[_0xfe7d('0x23')](handleEntityNotFound(_0x4e81e9,null))[_0xfe7d('0x23')](function(_0x24209b){if(_0x24209b){_0x3a41b4=_0x24209b[_0xfe7d('0x93')];var _0x3058b7=_0x3a41b4[_0xfe7d('0x95')](-0x1);if(_0x3058b7==='/'){_0x3a41b4=_0x3a41b4[_0xfe7d('0x96')](0x0,_0x3a41b4[_0xfe7d('0x97')](_0x3058b7));}_0x4ade7f=util[_0xfe7d('0x98')](_0xfe7d('0x99'),_0x3a41b4);_0x4229e6=util[_0xfe7d('0x98')](_0xfe7d('0x9a'),_0x3a41b4);_0x53b5cd={'user':_0x24209b['username'],'pass':_0x24209b[_0xfe7d('0x91')]};var _0x4e4b79={'method':_0xfe7d('0x9b'),'uri':_0x4ade7f+_0xfe7d('0x9c'),'auth':_0x53b5cd,'json':!![]};return rp(_0x4e4b79);}})[_0xfe7d('0x23')](function(_0x529824){if(_0x529824[_0xfe7d('0x9d')][_0xfe7d('0x40')]>0x0){_0x18d25b=_0x529824['result'];}console[_0xfe7d('0x9e')](_0xfe7d('0x9f'),_0x18d25b);_0x319b92=[];_0x55f474=Object[_0xfe7d('0xa0')]([],_0x18d25b);_['remove'](_0x55f474,function(_0x5bb9b0){return!_0x47de84[_0xfe7d('0xa1')](_0x5bb9b0['name']);});_0x55f474[_0xfe7d('0xa2')](function(_0x464b0a){var _0xe6127=createFieldObject(_0x4229e6,_0x53b5cd,_0x464b0a[_0xfe7d('0xa3')],_0x464b0a[_0xfe7d('0x25')],_0x464b0a['label'],![]);_0x319b92[_0xfe7d('0xa4')](_0xe6127);});return Promise[_0xfe7d('0xa5')](_0x319b92);})[_0xfe7d('0x23')](function(_0x36d3ac){_0x2b5581=_0x36d3ac;_0x35a0d6=Object['assign']([],_0x18d25b);console[_0xfe7d('0x9e')](_0xfe7d('0xa6'),_0x18d25b);_['remove'](_0x35a0d6,function(_0x4a2fc9){return _0x1fb447[_0xfe7d('0xa1')](_0x4a2fc9[_0xfe7d('0x25')]);});console[_0xfe7d('0x9e')](_0xfe7d('0xa7'),_0x35a0d6);_0x319b92=[];_0x35a0d6[_0xfe7d('0xa2')](function(_0xca88a3){var _0x15b574=createFieldObject(_0x4229e6,_0x53b5cd,_0xca88a3['internalType'],_0xca88a3[_0xfe7d('0x25')],_0xca88a3[_0xfe7d('0xa8')],!![]);_0x319b92['push'](_0x15b574);});return Promise['all'](_0x319b92);})['then'](function(_0xf8543){_0x285fb7=_0xf8543;var _0x33f733=_0x2b5581[_0xfe7d('0xa9')](_0x285fb7);return{'count':_0x33f733[_0xfe7d('0x40')],'rows':_0x33f733};})[_0xfe7d('0x23')](respondWithResult(_0x4e81e9,null))[_0xfe7d('0x44')](function(_0x4bd810){console[_0xfe7d('0x9e')](_0xfe7d('0xaa')+_0x4bd810);var _0x1b963e=_0x4e4127[_0xfe7d('0x2d')][_0xfe7d('0xab')]?0x1f4:_0x4bd810[_0xfe7d('0xac')]||0x1f4;logger['error'](_0x4bd810[_0xfe7d('0xad')]);delete _0x4bd810['name'];if(_0x1b963e===0x191){_0x1b963e=0x190;}_0x4e81e9['status'](_0x1b963e)[_0xfe7d('0xae')](_0x4e4127[_0xfe7d('0x2d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4bd810[_0xfe7d('0xac')]}:_0x4bd810);});};function createFieldObject(_0x221190,_0x4f87ba,_0x2a34d8,_0x4c8c48,_0x23f486,_0x4f38d1){return new Promise(function(_0x32ecff,_0xd98875){var _0xd0f72a={'id':_0x4c8c48,'name':_0x23f486,'custom':_0x4f38d1};if(_0x2a34d8===_0xfe7d('0xaf')){_0xd0f72a[_0xfe7d('0x3b')]=[{'name':_0xfe7d('0xb0'),'value':_0xfe7d('0xb1')},{'name':_0xfe7d('0xb2'),'value':_0xfe7d('0xb3')}];_0x32ecff(_0xd0f72a);}else{var _0x1e7946={'method':_0xfe7d('0x9b'),'uri':_0x221190+_0xfe7d('0xb4')+_0x4c8c48,'auth':_0x4f87ba,'json':!![]};return rp(_0x1e7946)['then'](function(_0x368f85){var _0xe345a=[];if(_0x368f85[_0xfe7d('0x9d')][_0xfe7d('0x40')]>0x0){_0x368f85[_0xfe7d('0x9d')]['forEach'](function(_0x47f1d6){if(_0x47f1d6[_0xfe7d('0xb5')]===_0xfe7d('0xb3')){var _0x5cc659={'name':_0x47f1d6[_0xfe7d('0xa8')],'value':_0x47f1d6[_0xfe7d('0xb6')]};_0xe345a[_0xfe7d('0xa4')](_0x5cc659);}});}_0xd0f72a[_0xfe7d('0x3b')]=_0xe345a;if(_0xd0f72a[_0xfe7d('0x3b')][_0xfe7d('0x40')]>0x0){_0x32ecff(_0xd0f72a);}else{if(_0x4f38d1==![]){_0x32ecff();}else{_0x32ecff(_0xd0f72a);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d0a127c..a39ae57 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 _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x4ec97e,_0x329017){var _0x18827a=function(_0x3db383){while(--_0x3db383){_0x4ec97e['push'](_0x4ec97e['shift']());}};_0x18827a(++_0x329017);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x21c775,_0x58205a){_0x21c775=_0x21c775-0x0;var _0x3d23c6=_0x9c5a[_0x21c775];return _0x3d23c6;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowAccount.attributes'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x187d,0x93));var _0xd187=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x187d[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd187('0x9')]=function(_0x58ee7,_0x444a60){return _0x58ee7[_0xd187('0xa')](_0xd187('0xb'),attributes,{'tableName':_0xd187('0xc'),'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 67d81d4..6f73cd1 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 _0x282b=['message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','stringify','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x509d3e,_0x5c9447){var _0x50fdf5=function(_0x4a3809){while(--_0x4a3809){_0x509d3e['push'](_0x509d3e['shift']());}};_0x50fdf5(++_0x5c9447);}(_0x282b,0x19c));var _0xb282=function(_0x1faaa0,_0x1a68eb){_0x1faaa0=_0x1faaa0-0x0;var _0x37654e=_0x282b[_0x1faaa0];return _0x37654e;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb282('0x6'));var client=jayson[_0xb282('0x7')][_0xb282('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12a398,_0x3ec557,_0x3c8b8a){return new BPromise(function(_0x1cfbe0,_0x30b7d2){return client[_0xb282('0x9')](_0x12a398,_0x3c8b8a)[_0xb282('0xa')](function(_0x43932e){logger[_0xb282('0xb')](_0xb282('0xc'),_0x3ec557,'request\x20sent');logger[_0xb282('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3ec557,_0xb282('0xe'),JSON['stringify'](_0x43932e));if(_0x43932e[_0xb282('0xf')]){if(_0x43932e['error'][_0xb282('0x10')]===0x1f4){logger[_0xb282('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x3ec557,_0x43932e['error'][_0xb282('0x11')]);return _0x30b7d2(_0x43932e[_0xb282('0xf')][_0xb282('0x11')]);}logger['error'](_0xb282('0xc'),_0x3ec557,_0x43932e[_0xb282('0xf')][_0xb282('0x11')]);return _0x1cfbe0(_0x43932e[_0xb282('0xf')][_0xb282('0x11')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3ec557,_0xb282('0xe'));_0x1cfbe0(_0x43932e[_0xb282('0x12')]['message']);}})[_0xb282('0x13')](function(_0xd630bd){logger['error'](_0xb282('0xc'),_0x3ec557,_0xd630bd);_0x30b7d2(_0xd630bd);});});}exports[_0xb282('0x14')]=function(_0x579a74){var _0x229019=this;return new Promise(function(_0x51ee2b,_0x5d1ecf){return db[_0xb282('0x15')]['findAll']({'raw':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x17')]===undefined?!![]:![]:!![],'where':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x18')]||null:null,'attributes':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x19')]||null:null,'limit':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x1a')]||null:null,'include':_0x579a74[_0xb282('0x16')]?_0x579a74[_0xb282('0x16')][_0xb282('0x1b')]?_['map'](_0x579a74['options'][_0xb282('0x1b')],function(_0x1e27d5){return{'model':db[_0x1e27d5['model']],'as':_0x1e27d5['as'],'attributes':_0x1e27d5['attributes'],'include':_0x1e27d5[_0xb282('0x1b')]?_['map'](_0x1e27d5['include'],function(_0x2176cd){return{'model':db[_0x2176cd[_0xb282('0x1c')]],'as':_0x2176cd['as'],'attributes':_0x2176cd[_0xb282('0x19')],'include':_0x2176cd[_0xb282('0x1b')]?_[_0xb282('0x1d')](_0x2176cd[_0xb282('0x1b')],function(_0x10ebea){return{'model':db[_0x10ebea[_0xb282('0x1c')]],'as':_0x10ebea['as'],'attributes':_0x10ebea['attributes']};}):[]};}):[]};}):[]:[]})[_0xb282('0xa')](function(_0x2db7cf){logger[_0xb282('0xb')](_0xb282('0x14'),_0x579a74);logger[_0xb282('0xd')](_0xb282('0x14'),_0x579a74,JSON[_0xb282('0x1e')](_0x2db7cf));_0x51ee2b(_0x2db7cf);})['catch'](function(_0x4c43cf){logger['error'](_0xb282('0x14'),_0x4c43cf[_0xb282('0x11')],_0x579a74);_0x5d1ecf(_0x229019[_0xb282('0xf')](0x1f4,_0x4c43cf[_0xb282('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x50e55a){var _0x4a80ee=this;return new Promise(function(_0x35bd9a,_0x5d00df){return db[_0xb282('0x15')][_0xb282('0x1f')]({'raw':_0x50e55a[_0xb282('0x16')]?_0x50e55a[_0xb282('0x16')][_0xb282('0x17')]===undefined?!![]:![]:!![],'where':_0x50e55a[_0xb282('0x16')]?_0x50e55a[_0xb282('0x16')][_0xb282('0x18')]||null:null,'attributes':_0x50e55a[_0xb282('0x16')]?_0x50e55a['options'][_0xb282('0x19')]||null:null,'include':_0x50e55a[_0xb282('0x16')]?_0x50e55a[_0xb282('0x16')][_0xb282('0x1b')]?_['map'](_0x50e55a[_0xb282('0x16')][_0xb282('0x1b')],function(_0x4443e2){return{'model':db[_0x4443e2['model']],'as':_0x4443e2['as'],'attributes':_0x4443e2[_0xb282('0x19')],'include':_0x4443e2[_0xb282('0x1b')]?_[_0xb282('0x1d')](_0x4443e2['include'],function(_0x16d53e){return{'model':db[_0x16d53e['model']],'as':_0x16d53e['as'],'attributes':_0x16d53e[_0xb282('0x19')],'include':_0x16d53e[_0xb282('0x1b')]?_[_0xb282('0x1d')](_0x16d53e['include'],function(_0x4337d1){return{'model':db[_0x4337d1[_0xb282('0x1c')]],'as':_0x4337d1['as'],'attributes':_0x4337d1[_0xb282('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb282('0xa')](function(_0x390c1b){logger[_0xb282('0xb')](_0xb282('0x20'),_0x50e55a);logger[_0xb282('0xd')](_0xb282('0x20'),_0x50e55a,JSON[_0xb282('0x1e')](_0x390c1b));_0x35bd9a(_0x390c1b);})[_0xb282('0x13')](function(_0x1f2fdd){logger[_0xb282('0xf')]('ShowServicenowAccount',_0x1f2fdd[_0xb282('0x11')],_0x50e55a);_0x5d00df(_0x4a80ee['error'](0x1f4,_0x1f2fdd[_0xb282('0x11')]));});});}; \ No newline at end of file +var _0x1c82=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetServicenowAccount','ShowServicenowAccount','find','lodash','util'];(function(_0x219b84,_0x2442db){var _0x117b91=function(_0x4786f4){while(--_0x4786f4){_0x219b84['push'](_0x219b84['shift']());}};_0x117b91(++_0x2442db);}(_0x1c82,0x154));var _0x21c8=function(_0x409476,_0x483b4c){_0x409476=_0x409476-0x0;var _0x1b94ca=_0x1c82[_0x409476];return _0x1b94ca;};'use strict';var _=require(_0x21c8('0x0'));var util=require(_0x21c8('0x1'));var moment=require(_0x21c8('0x2'));var BPromise=require('bluebird');var rs=require(_0x21c8('0x3'));var fs=require('fs');var Redis=require(_0x21c8('0x4'));var db=require(_0x21c8('0x5'))['db'];var utils=require(_0x21c8('0x6'));var logger=require('../../config/logger')(_0x21c8('0x7'));var config=require(_0x21c8('0x8'));var jayson=require(_0x21c8('0x9'));var client=jayson[_0x21c8('0xa')][_0x21c8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54e811,_0x3fe026,_0x2073a4){return new BPromise(function(_0x351fa7,_0x7127e0){return client[_0x21c8('0xc')](_0x54e811,_0x2073a4)[_0x21c8('0xd')](function(_0x2c2485){logger[_0x21c8('0xe')](_0x21c8('0xf'),_0x3fe026,_0x21c8('0x10'));logger[_0x21c8('0x11')](_0x21c8('0x12'),_0x3fe026,_0x21c8('0x10'),JSON[_0x21c8('0x13')](_0x2c2485));if(_0x2c2485[_0x21c8('0x14')]){if(_0x2c2485[_0x21c8('0x14')][_0x21c8('0x15')]===0x1f4){logger[_0x21c8('0x14')](_0x21c8('0xf'),_0x3fe026,_0x2c2485[_0x21c8('0x14')][_0x21c8('0x16')]);return _0x7127e0(_0x2c2485[_0x21c8('0x14')][_0x21c8('0x16')]);}logger[_0x21c8('0x14')](_0x21c8('0xf'),_0x3fe026,_0x2c2485[_0x21c8('0x14')]['message']);return _0x351fa7(_0x2c2485['error'][_0x21c8('0x16')]);}else{logger['info'](_0x21c8('0xf'),_0x3fe026,'request\x20sent');_0x351fa7(_0x2c2485[_0x21c8('0x17')]['message']);}})[_0x21c8('0x18')](function(_0x1b3aa9){logger[_0x21c8('0x14')](_0x21c8('0xf'),_0x3fe026,_0x1b3aa9);_0x7127e0(_0x1b3aa9);});});}exports['GetServicenowAccount']=function(_0x481cf3){var _0x31fd22=this;return new Promise(function(_0x2c0736,_0x22c902){return db[_0x21c8('0x19')][_0x21c8('0x1a')]({'raw':_0x481cf3['options']?_0x481cf3[_0x21c8('0x1b')][_0x21c8('0x1c')]===undefined?!![]:![]:!![],'where':_0x481cf3[_0x21c8('0x1b')]?_0x481cf3[_0x21c8('0x1b')][_0x21c8('0x1d')]||null:null,'attributes':_0x481cf3[_0x21c8('0x1b')]?_0x481cf3[_0x21c8('0x1b')][_0x21c8('0x1e')]||null:null,'limit':_0x481cf3['options']?_0x481cf3[_0x21c8('0x1b')][_0x21c8('0x1f')]||null:null,'include':_0x481cf3[_0x21c8('0x1b')]?_0x481cf3[_0x21c8('0x1b')][_0x21c8('0x20')]?_['map'](_0x481cf3[_0x21c8('0x1b')]['include'],function(_0x2f4b05){return{'model':db[_0x2f4b05['model']],'as':_0x2f4b05['as'],'attributes':_0x2f4b05[_0x21c8('0x1e')],'include':_0x2f4b05[_0x21c8('0x20')]?_[_0x21c8('0x21')](_0x2f4b05['include'],function(_0x1ede2a){return{'model':db[_0x1ede2a[_0x21c8('0x22')]],'as':_0x1ede2a['as'],'attributes':_0x1ede2a['attributes'],'include':_0x1ede2a[_0x21c8('0x20')]?_[_0x21c8('0x21')](_0x1ede2a[_0x21c8('0x20')],function(_0x1819d7){return{'model':db[_0x1819d7['model']],'as':_0x1819d7['as'],'attributes':_0x1819d7[_0x21c8('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3640db){logger[_0x21c8('0xe')](_0x21c8('0x23'),_0x481cf3);logger[_0x21c8('0x11')](_0x21c8('0x23'),_0x481cf3,JSON[_0x21c8('0x13')](_0x3640db));_0x2c0736(_0x3640db);})[_0x21c8('0x18')](function(_0x5a01e8){logger[_0x21c8('0x14')](_0x21c8('0x23'),_0x5a01e8['message'],_0x481cf3);_0x22c902(_0x31fd22[_0x21c8('0x14')](0x1f4,_0x5a01e8[_0x21c8('0x16')]));});});};exports[_0x21c8('0x24')]=function(_0x2622c9){var _0x5c0989=this;return new Promise(function(_0x57ca95,_0x7c79fd){return db[_0x21c8('0x19')][_0x21c8('0x25')]({'raw':_0x2622c9[_0x21c8('0x1b')]?_0x2622c9['options'][_0x21c8('0x1c')]===undefined?!![]:![]:!![],'where':_0x2622c9[_0x21c8('0x1b')]?_0x2622c9['options'][_0x21c8('0x1d')]||null:null,'attributes':_0x2622c9[_0x21c8('0x1b')]?_0x2622c9['options'][_0x21c8('0x1e')]||null:null,'include':_0x2622c9[_0x21c8('0x1b')]?_0x2622c9[_0x21c8('0x1b')][_0x21c8('0x20')]?_['map'](_0x2622c9[_0x21c8('0x1b')]['include'],function(_0x114a3f){return{'model':db[_0x114a3f['model']],'as':_0x114a3f['as'],'attributes':_0x114a3f[_0x21c8('0x1e')],'include':_0x114a3f[_0x21c8('0x20')]?_[_0x21c8('0x21')](_0x114a3f[_0x21c8('0x20')],function(_0x1fc929){return{'model':db[_0x1fc929[_0x21c8('0x22')]],'as':_0x1fc929['as'],'attributes':_0x1fc929[_0x21c8('0x1e')],'include':_0x1fc929[_0x21c8('0x20')]?_[_0x21c8('0x21')](_0x1fc929['include'],function(_0x1d8546){return{'model':db[_0x1d8546[_0x21c8('0x22')]],'as':_0x1d8546['as'],'attributes':_0x1d8546[_0x21c8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x21c8('0xd')](function(_0x2563ec){logger[_0x21c8('0xe')](_0x21c8('0x24'),_0x2622c9);logger['debug']('ShowServicenowAccount',_0x2622c9,JSON[_0x21c8('0x13')](_0x2563ec));_0x57ca95(_0x2563ec);})['catch'](function(_0x1b1b2e){logger[_0x21c8('0x14')]('ShowServicenowAccount',_0x1b1b2e[_0x21c8('0x16')],_0x2622c9);_0x7c79fd(_0x5c0989[_0x21c8('0x14')](0x1f4,_0x1b1b2e['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 01ae9d1..100a3a3 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 _0xd102=['get','index','/:id','isAuthenticated','show','/:id/fields','getFields','getDescriptions','post','create','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x1df780,_0x40227a){var _0x2718ea=function(_0x119a75){while(--_0x119a75){_0x1df780['push'](_0x1df780['shift']());}};_0x2718ea(++_0x40227a);}(_0xd102,0x10a));var _0x2d10=function(_0x195aed,_0x452cb6){_0x195aed=_0x195aed-0x0;var _0x272e3e=_0xd102[_0x195aed];return _0x272e3e;};'use strict';var multer=require(_0x2d10('0x0'));var util=require('util');var path=require(_0x2d10('0x1'));var timeout=require(_0x2d10('0x2'));var express=require('express');var router=express[_0x2d10('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2d10('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2d10('0x5'));var controller=require(_0x2d10('0x6'));router[_0x2d10('0x7')]('/',auth['isAuthenticated'](),controller[_0x2d10('0x8')]);router[_0x2d10('0x7')](_0x2d10('0x9'),auth[_0x2d10('0xa')](),controller[_0x2d10('0xb')]);router[_0x2d10('0x7')](_0x2d10('0xc'),auth['isAuthenticated'](),controller[_0x2d10('0xd')]);router['get']('/:id/subjects',auth[_0x2d10('0xa')](),controller['getSubjects']);router[_0x2d10('0x7')]('/:id/descriptions',auth[_0x2d10('0xa')](),controller[_0x2d10('0xe')]);router[_0x2d10('0xf')]('/',auth['isAuthenticated'](),controller[_0x2d10('0x10')]);router[_0x2d10('0x11')]('/:id',auth[_0x2d10('0xa')](),controller[_0x2d10('0x12')]);router[_0x2d10('0x13')](_0x2d10('0x9'),auth[_0x2d10('0xa')](),controller['destroy']);module[_0x2d10('0x14')]=router; \ No newline at end of file +var _0x173a=['../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x49dc69,_0x2db39a){var _0x326d0c=function(_0x529f43){while(--_0x529f43){_0x49dc69['push'](_0x49dc69['shift']());}};_0x326d0c(++_0x2db39a);}(_0x173a,0xf4));var _0xa173=function(_0x3d118a,_0x51b1c7){_0x3d118a=_0x3d118a-0x0;var _0x5c97fc=_0x173a[_0x3d118a];return _0x5c97fc;};'use strict';var multer=require(_0xa173('0x0'));var util=require(_0xa173('0x1'));var path=require(_0xa173('0x2'));var timeout=require(_0xa173('0x3'));var express=require(_0xa173('0x4'));var router=express['Router']();var fs_extra=require(_0xa173('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa173('0x6'));var config=require('../../config/environment');var controller=require(_0xa173('0x7'));router[_0xa173('0x8')]('/',auth[_0xa173('0x9')](),controller[_0xa173('0xa')]);router[_0xa173('0x8')](_0xa173('0xb'),auth[_0xa173('0x9')](),controller[_0xa173('0xc')]);router['get'](_0xa173('0xd'),auth['isAuthenticated'](),controller[_0xa173('0xe')]);router['get'](_0xa173('0xf'),auth[_0xa173('0x9')](),controller[_0xa173('0x10')]);router['get'](_0xa173('0x11'),auth[_0xa173('0x9')](),controller[_0xa173('0x12')]);router[_0xa173('0x13')]('/',auth[_0xa173('0x9')](),controller[_0xa173('0x14')]);router[_0xa173('0x15')](_0xa173('0xb'),auth[_0xa173('0x9')](),controller['update']);router[_0xa173('0x16')](_0xa173('0xb'),auth['isAuthenticated'](),controller[_0xa173('0x17')]);module[_0xa173('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d0cafcb..b9848e5 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 _0xeb1c=['sequelize','exports','STRING'];(function(_0x23b290,_0x1720f0){var _0x2b235b=function(_0x22bafc){while(--_0x22bafc){_0x23b290['push'](_0x23b290['shift']());}};_0x2b235b(++_0x1720f0);}(_0xeb1c,0xa5));var _0xceb1=function(_0x43783e,_0x1df0ee){_0x43783e=_0x43783e-0x0;var _0x3f105e=_0xeb1c[_0x43783e];return _0x3f105e;};'use strict';var Sequelize=require(_0xceb1('0x0'));module[_0xceb1('0x1')]={'name':{'type':Sequelize[_0xceb1('0x2')]},'description':{'type':Sequelize[_0xceb1('0x2')]}}; \ No newline at end of file +var _0xfc1c=['STRING','exports'];(function(_0x404f08,_0x46c8b0){var _0x5aca3a=function(_0x85cd3){while(--_0x85cd3){_0x404f08['push'](_0x404f08['shift']());}};_0x5aca3a(++_0x46c8b0);}(_0xfc1c,0x16f));var _0xcfc1=function(_0x215f9e,_0x438b14){_0x215f9e=_0x215f9e-0x0;var _0x217ce4=_0xfc1c[_0x215f9e];return _0x217ce4;};'use strict';var Sequelize=require('sequelize');module[_0xcfc1('0x0')]={'name':{'type':Sequelize[_0xcfc1('0x1')]},'description':{'type':Sequelize[_0xcfc1('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 6b1c809..0691865 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 _0xcd77=['body','params','getFields','order','pick','hasOwnProperty','getSubjects','ServicenowField','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../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','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create'];(function(_0x2f5676,_0x342013){var _0x2e5f36=function(_0x516d81){while(--_0x516d81){_0x2f5676['push'](_0x2f5676['shift']());}};_0x2e5f36(++_0x342013);}(_0xcd77,0x1ae));var _0x7cd7=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xcd77[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x7cd7('0x0'));var rimraf=require(_0x7cd7('0x1'));var zipdir=require(_0x7cd7('0x2'));var jsonpatch=require(_0x7cd7('0x3'));var rp=require(_0x7cd7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7cd7('0x5'));var util=require(_0x7cd7('0x6'));var path=require('path');var sox=require(_0x7cd7('0x7'));var csv=require('to-csv');var ejs=require(_0x7cd7('0x8'));var fs=require('fs');var fs_extra=require(_0x7cd7('0x9'));var _=require(_0x7cd7('0xa'));var squel=require(_0x7cd7('0xb'));var crypto=require('crypto');var jsforce=require(_0x7cd7('0xc'));var deskjs=require(_0x7cd7('0xd'));var toCsv=require(_0x7cd7('0xe'));var querystring=require(_0x7cd7('0xf'));var Papa=require(_0x7cd7('0x10'));var Redis=require('ioredis');var authService=require(_0x7cd7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7cd7('0x12'));var hardwareService=require(_0x7cd7('0x13'));var logger=require(_0x7cd7('0x14'))(_0x7cd7('0x15'));var utils=require(_0x7cd7('0x16'));var config=require(_0x7cd7('0x17'));var licenseUtil=require(_0x7cd7('0x18'));var db=require(_0x7cd7('0x19'))['db'];function respondWithStatusCode(_0xefc419,_0x51f948){_0x51f948=_0x51f948||0xcc;return function(_0x48b5b0){if(_0x48b5b0){return _0xefc419[_0x7cd7('0x1a')](_0x51f948);}return _0xefc419[_0x7cd7('0x1b')](_0x51f948)[_0x7cd7('0x1c')]();};}function respondWithResult(_0x38e2d7,_0x5e06b3){_0x5e06b3=_0x5e06b3||0xc8;return function(_0x212d20){if(_0x212d20){return _0x38e2d7[_0x7cd7('0x1b')](_0x5e06b3)[_0x7cd7('0x1d')](_0x212d20);}};}function respondWithFilteredResult(_0x351bed,_0x461e4c){return function(_0x1b78eb){if(_0x1b78eb){var _0x27cc61=typeof _0x461e4c[_0x7cd7('0x1e')]===_0x7cd7('0x1f')&&typeof _0x461e4c[_0x7cd7('0x20')]===_0x7cd7('0x1f');var _0x7a2b2=_0x1b78eb[_0x7cd7('0x21')];var _0x2faeb8=_0x27cc61?0x0:_0x461e4c[_0x7cd7('0x1e')];var _0x35456d=_0x27cc61?_0x1b78eb[_0x7cd7('0x21')]:_0x461e4c['offset']+_0x461e4c[_0x7cd7('0x20')];var _0x25b5d2;if(_0x35456d>=_0x7a2b2){_0x35456d=_0x7a2b2;_0x25b5d2=0xc8;}else{_0x25b5d2=0xce;}_0x351bed[_0x7cd7('0x1b')](_0x25b5d2);return _0x351bed[_0x7cd7('0x22')](_0x7cd7('0x23'),_0x2faeb8+'-'+_0x35456d+'/'+_0x7a2b2)[_0x7cd7('0x1d')](_0x1b78eb);}return null;};}function patchUpdates(_0x443aab){return function(_0x37337a){try{jsonpatch[_0x7cd7('0x24')](_0x37337a,_0x443aab,!![]);}catch(_0x4f3116){return BPromise[_0x7cd7('0x25')](_0x4f3116);}return _0x37337a[_0x7cd7('0x26')]();};}function saveUpdates(_0x2b88cf,_0x56ded4){return function(_0x3f804b){if(_0x3f804b){return _0x3f804b[_0x7cd7('0x27')](_0x2b88cf)[_0x7cd7('0x28')](function(_0x454dd4){return _0x454dd4;});}return null;};}function removeEntity(_0x2e55f2,_0x28d13b){return function(_0x5266b4){if(_0x5266b4){return _0x5266b4[_0x7cd7('0x29')]()['then'](function(){_0x2e55f2[_0x7cd7('0x1b')](0xcc)[_0x7cd7('0x1c')]();});}};}function handleEntityNotFound(_0x34c67f,_0x23b124){return function(_0x4cd4fe){if(!_0x4cd4fe){_0x34c67f[_0x7cd7('0x1a')](0x194);}return _0x4cd4fe;};}function handleError(_0x4628ee,_0x3a9548){_0x3a9548=_0x3a9548||0x1f4;return function(_0x2f521e){logger[_0x7cd7('0x2a')](_0x2f521e[_0x7cd7('0x2b')]);if(_0x2f521e[_0x7cd7('0x2c')]){delete _0x2f521e[_0x7cd7('0x2c')];}_0x4628ee['status'](_0x3a9548)[_0x7cd7('0x2d')](_0x2f521e);};}exports[_0x7cd7('0x2e')]=function(_0x39a2d2,_0x10e0d6){var _0x3cc0bc={},_0x2c9444={},_0x57c8ff={'count':0x0,'rows':[]};var _0xb5e7f=_['map'](db[_0x7cd7('0x2f')][_0x7cd7('0x30')],function(_0x27e16d){return{'name':_0x27e16d[_0x7cd7('0x31')],'type':_0x27e16d['type'][_0x7cd7('0x32')]};});_0x2c9444[_0x7cd7('0x33')]=_['map'](_0xb5e7f,_0x7cd7('0x2c'));_0x2c9444[_0x7cd7('0x34')]=_[_0x7cd7('0x35')](_0x39a2d2[_0x7cd7('0x34')]);_0x2c9444[_0x7cd7('0x36')]=_['intersection'](_0x2c9444[_0x7cd7('0x33')],_0x2c9444['query']);_0x3cc0bc[_0x7cd7('0x37')]=_[_0x7cd7('0x38')](_0x2c9444[_0x7cd7('0x33')],qs['fields'](_0x39a2d2['query'][_0x7cd7('0x39')]));_0x3cc0bc[_0x7cd7('0x37')]=_0x3cc0bc[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x3cc0bc[_0x7cd7('0x37')]:_0x2c9444[_0x7cd7('0x33')];if(!_0x39a2d2['query']['hasOwnProperty'](_0x7cd7('0x3b'))){_0x3cc0bc['limit']=qs[_0x7cd7('0x20')](_0x39a2d2['query'][_0x7cd7('0x20')]);_0x3cc0bc[_0x7cd7('0x1e')]=qs[_0x7cd7('0x1e')](_0x39a2d2[_0x7cd7('0x34')][_0x7cd7('0x1e')]);}_0x3cc0bc['order']=qs['sort'](_0x39a2d2[_0x7cd7('0x34')][_0x7cd7('0x3c')]);_0x3cc0bc[_0x7cd7('0x3d')]=qs['filters'](_['pick'](_0x39a2d2[_0x7cd7('0x34')],_0x2c9444[_0x7cd7('0x36')]),_0xb5e7f);if(_0x39a2d2['query'][_0x7cd7('0x3e')]){_0x3cc0bc[_0x7cd7('0x3d')]=_[_0x7cd7('0x3f')](_0x3cc0bc['where'],{'$or':_[_0x7cd7('0x40')](_0xb5e7f,function(_0xf9e165){if(_0xf9e165['type']!==_0x7cd7('0x41')){var _0x379141={};_0x379141[_0xf9e165[_0x7cd7('0x2c')]]={'$like':'%'+_0x39a2d2['query'][_0x7cd7('0x3e')]+'%'};return _0x379141;}})});}_0x3cc0bc=_['merge']({},_0x3cc0bc,_0x39a2d2[_0x7cd7('0x42')]);var _0x1042fa={'where':_0x3cc0bc[_0x7cd7('0x3d')]};return db[_0x7cd7('0x2f')][_0x7cd7('0x21')](_0x1042fa)[_0x7cd7('0x28')](function(_0x10d1b5){_0x57c8ff['count']=_0x10d1b5;if(_0x39a2d2[_0x7cd7('0x34')][_0x7cd7('0x43')]){_0x3cc0bc[_0x7cd7('0x44')]=[{'all':!![]}];}return db[_0x7cd7('0x2f')][_0x7cd7('0x45')](_0x3cc0bc);})[_0x7cd7('0x28')](function(_0xa35f61){_0x57c8ff['rows']=_0xa35f61;return _0x57c8ff;})[_0x7cd7('0x28')](respondWithFilteredResult(_0x10e0d6,_0x3cc0bc))['catch'](handleError(_0x10e0d6,null));};exports[_0x7cd7('0x46')]=function(_0x366e55,_0x30126e){var _0x3ac2a2={'raw':![],'where':{'id':_0x366e55['params']['id']}},_0x1ac3d3={};_0x1ac3d3[_0x7cd7('0x33')]=_[_0x7cd7('0x35')](db[_0x7cd7('0x2f')]['rawAttributes']);_0x1ac3d3[_0x7cd7('0x34')]=_[_0x7cd7('0x35')](_0x366e55[_0x7cd7('0x34')]);_0x1ac3d3[_0x7cd7('0x36')]=_['intersection'](_0x1ac3d3['model'],_0x1ac3d3[_0x7cd7('0x34')]);_0x3ac2a2['attributes']=_[_0x7cd7('0x38')](_0x1ac3d3[_0x7cd7('0x33')],qs[_0x7cd7('0x39')](_0x366e55[_0x7cd7('0x34')]['fields']));_0x3ac2a2[_0x7cd7('0x37')]=_0x3ac2a2['attributes'][_0x7cd7('0x3a')]?_0x3ac2a2[_0x7cd7('0x37')]:_0x1ac3d3[_0x7cd7('0x33')];if(_0x366e55[_0x7cd7('0x34')]['includeAll']){_0x3ac2a2['include']=[{'all':!![]}];}_0x3ac2a2=_[_0x7cd7('0x3f')]({},_0x3ac2a2,_0x366e55[_0x7cd7('0x42')]);return db['ServicenowConfiguration'][_0x7cd7('0x47')](_0x3ac2a2)[_0x7cd7('0x28')](handleEntityNotFound(_0x30126e,null))[_0x7cd7('0x28')](respondWithResult(_0x30126e,null))[_0x7cd7('0x48')](handleError(_0x30126e,null));};exports[_0x7cd7('0x49')]=function(_0x4d2795,_0x27a0e7){return db[_0x7cd7('0x2f')]['create'](_0x4d2795['body'],{})[_0x7cd7('0x28')](respondWithResult(_0x27a0e7,0xc9))[_0x7cd7('0x48')](handleError(_0x27a0e7,null));};exports[_0x7cd7('0x27')]=function(_0x388b70,_0x208384){if(_0x388b70[_0x7cd7('0x4a')]['id']){delete _0x388b70['body']['id'];}return db[_0x7cd7('0x2f')][_0x7cd7('0x47')]({'where':{'id':_0x388b70[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x208384,null))['then'](saveUpdates(_0x388b70[_0x7cd7('0x4a')],null))['then'](respondWithResult(_0x208384,null))[_0x7cd7('0x48')](handleError(_0x208384,null));};exports[_0x7cd7('0x29')]=function(_0x94b652,_0x48b35d){return db[_0x7cd7('0x2f')]['find']({'where':{'id':_0x94b652[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x48b35d,null))['then'](removeEntity(_0x48b35d,null))[_0x7cd7('0x48')](handleError(_0x48b35d,null));};exports[_0x7cd7('0x4c')]=function(_0x4cec95,_0x42a7b8,_0x3a20cf){var _0x360db8={};var _0x4e9e24={};var _0x3f5a12;var _0x2b0808;return db[_0x7cd7('0x2f')]['findOne']({'where':{'id':_0x4cec95[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x42a7b8,null))[_0x7cd7('0x28')](function(_0x470b16){if(_0x470b16){_0x3f5a12=_0x470b16;_0x4e9e24['model']=_[_0x7cd7('0x35')](db['ServicenowField']['rawAttributes']);_0x4e9e24['query']=_[_0x7cd7('0x35')](_0x4cec95[_0x7cd7('0x34')]);_0x4e9e24[_0x7cd7('0x36')]=_[_0x7cd7('0x38')](_0x4e9e24['model'],_0x4e9e24[_0x7cd7('0x34')]);_0x360db8[_0x7cd7('0x37')]=_[_0x7cd7('0x38')](_0x4e9e24[_0x7cd7('0x33')],qs['fields'](_0x4cec95[_0x7cd7('0x34')]['fields']));_0x360db8[_0x7cd7('0x37')]=_0x360db8[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x360db8[_0x7cd7('0x37')]:_0x4e9e24['model'];_0x360db8[_0x7cd7('0x4d')]=qs[_0x7cd7('0x3c')](_0x4cec95[_0x7cd7('0x34')][_0x7cd7('0x3c')]);_0x360db8[_0x7cd7('0x3d')]=qs[_0x7cd7('0x36')](_[_0x7cd7('0x4e')](_0x4cec95[_0x7cd7('0x34')],_0x4e9e24['filters']));if(_0x4cec95[_0x7cd7('0x34')][_0x7cd7('0x3e')]){_0x360db8[_0x7cd7('0x3d')]=_['merge'](_0x360db8['where'],{'$or':_[_0x7cd7('0x40')](_0x360db8[_0x7cd7('0x37')],function(_0x43afb9){var _0x3a277e={};_0x3a277e[_0x43afb9]={'$like':'%'+_0x4cec95['query']['filter']+'%'};return _0x3a277e;})});}_0x360db8=_['merge']({},_0x360db8,_0x4cec95[_0x7cd7('0x42')]);return _0x3f5a12[_0x7cd7('0x4c')](_0x360db8);}})['then'](function(_0x1cf73f){if(_0x1cf73f){_0x2b0808=_0x1cf73f[_0x7cd7('0x3a')];if(!_0x4cec95['query'][_0x7cd7('0x4f')](_0x7cd7('0x3b'))){_0x360db8[_0x7cd7('0x20')]=qs[_0x7cd7('0x20')](_0x4cec95['query']['limit']);_0x360db8[_0x7cd7('0x1e')]=qs['offset'](_0x4cec95[_0x7cd7('0x34')][_0x7cd7('0x1e')]);}return _0x3f5a12['getFields'](_0x360db8);}})[_0x7cd7('0x28')](function(_0x5705b0){if(_0x5705b0){return _0x5705b0?{'count':_0x2b0808,'rows':_0x5705b0}:null;}})[_0x7cd7('0x28')](respondWithResult(_0x42a7b8,null))[_0x7cd7('0x48')](handleError(_0x42a7b8,null));};exports[_0x7cd7('0x50')]=function(_0x347182,_0x42d5f0,_0x35c341){var _0x591d22={};var _0x5e3dee={};var _0x323ef9;var _0x481697;return db[_0x7cd7('0x2f')]['findOne']({'where':{'id':_0x347182[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x42d5f0,null))[_0x7cd7('0x28')](function(_0x3ae976){if(_0x3ae976){_0x323ef9=_0x3ae976;_0x5e3dee['model']=_[_0x7cd7('0x35')](db[_0x7cd7('0x51')][_0x7cd7('0x30')]);_0x5e3dee[_0x7cd7('0x34')]=_[_0x7cd7('0x35')](_0x347182['query']);_0x5e3dee[_0x7cd7('0x36')]=_['intersection'](_0x5e3dee[_0x7cd7('0x33')],_0x5e3dee[_0x7cd7('0x34')]);_0x591d22[_0x7cd7('0x37')]=_[_0x7cd7('0x38')](_0x5e3dee[_0x7cd7('0x33')],qs[_0x7cd7('0x39')](_0x347182[_0x7cd7('0x34')][_0x7cd7('0x39')]));_0x591d22[_0x7cd7('0x37')]=_0x591d22[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x591d22[_0x7cd7('0x37')]:_0x5e3dee[_0x7cd7('0x33')];_0x591d22[_0x7cd7('0x4d')]=qs[_0x7cd7('0x3c')](_0x347182[_0x7cd7('0x34')]['sort']);_0x591d22[_0x7cd7('0x3d')]=qs[_0x7cd7('0x36')](_[_0x7cd7('0x4e')](_0x347182[_0x7cd7('0x34')],_0x5e3dee[_0x7cd7('0x36')]));if(_0x347182[_0x7cd7('0x34')]['filter']){_0x591d22[_0x7cd7('0x3d')]=_[_0x7cd7('0x3f')](_0x591d22[_0x7cd7('0x3d')],{'$or':_['map'](_0x591d22[_0x7cd7('0x37')],function(_0x42f65a){var _0x40f417={};_0x40f417[_0x42f65a]={'$like':'%'+_0x347182['query'][_0x7cd7('0x3e')]+'%'};return _0x40f417;})});}_0x591d22=_['merge']({},_0x591d22,_0x347182[_0x7cd7('0x42')]);return _0x323ef9[_0x7cd7('0x50')](_0x591d22);}})[_0x7cd7('0x28')](function(_0x28b003){if(_0x28b003){_0x481697=_0x28b003[_0x7cd7('0x3a')];if(!_0x347182[_0x7cd7('0x34')][_0x7cd7('0x4f')](_0x7cd7('0x3b'))){_0x591d22[_0x7cd7('0x20')]=qs['limit'](_0x347182['query'][_0x7cd7('0x20')]);_0x591d22['offset']=qs[_0x7cd7('0x1e')](_0x347182['query'][_0x7cd7('0x1e')]);}return _0x323ef9[_0x7cd7('0x50')](_0x591d22);}})[_0x7cd7('0x28')](function(_0x11068a){if(_0x11068a){return _0x11068a?{'count':_0x481697,'rows':_0x11068a}:null;}})[_0x7cd7('0x28')](respondWithResult(_0x42d5f0,null))[_0x7cd7('0x48')](handleError(_0x42d5f0,null));};exports['getDescriptions']=function(_0x20881e,_0x430281,_0x3851c4){var _0x3d894b={};var _0x4f1f1e={};var _0x442ac0;var _0x4c55c3;return db[_0x7cd7('0x2f')][_0x7cd7('0x52')]({'where':{'id':_0x20881e[_0x7cd7('0x4b')]['id']}})[_0x7cd7('0x28')](handleEntityNotFound(_0x430281,null))['then'](function(_0x4d03f0){if(_0x4d03f0){_0x442ac0=_0x4d03f0;_0x4f1f1e[_0x7cd7('0x33')]=_[_0x7cd7('0x35')](db[_0x7cd7('0x51')]['rawAttributes']);_0x4f1f1e[_0x7cd7('0x34')]=_['keys'](_0x20881e[_0x7cd7('0x34')]);_0x4f1f1e[_0x7cd7('0x36')]=_['intersection'](_0x4f1f1e[_0x7cd7('0x33')],_0x4f1f1e[_0x7cd7('0x34')]);_0x3d894b['attributes']=_[_0x7cd7('0x38')](_0x4f1f1e[_0x7cd7('0x33')],qs[_0x7cd7('0x39')](_0x20881e[_0x7cd7('0x34')][_0x7cd7('0x39')]));_0x3d894b[_0x7cd7('0x37')]=_0x3d894b[_0x7cd7('0x37')][_0x7cd7('0x3a')]?_0x3d894b[_0x7cd7('0x37')]:_0x4f1f1e[_0x7cd7('0x33')];_0x3d894b[_0x7cd7('0x4d')]=qs['sort'](_0x20881e['query'][_0x7cd7('0x3c')]);_0x3d894b[_0x7cd7('0x3d')]=qs[_0x7cd7('0x36')](_[_0x7cd7('0x4e')](_0x20881e[_0x7cd7('0x34')],_0x4f1f1e[_0x7cd7('0x36')]));if(_0x20881e['query'][_0x7cd7('0x3e')]){_0x3d894b[_0x7cd7('0x3d')]=_[_0x7cd7('0x3f')](_0x3d894b[_0x7cd7('0x3d')],{'$or':_[_0x7cd7('0x40')](_0x3d894b[_0x7cd7('0x37')],function(_0x3b5a2c){var _0x21741f={};_0x21741f[_0x3b5a2c]={'$like':'%'+_0x20881e[_0x7cd7('0x34')][_0x7cd7('0x3e')]+'%'};return _0x21741f;})});}_0x3d894b=_['merge']({},_0x3d894b,_0x20881e[_0x7cd7('0x42')]);return _0x442ac0['getDescriptions'](_0x3d894b);}})['then'](function(_0x499570){if(_0x499570){_0x4c55c3=_0x499570[_0x7cd7('0x3a')];if(!_0x20881e[_0x7cd7('0x34')][_0x7cd7('0x4f')](_0x7cd7('0x3b'))){_0x3d894b[_0x7cd7('0x20')]=qs['limit'](_0x20881e[_0x7cd7('0x34')]['limit']);_0x3d894b[_0x7cd7('0x1e')]=qs[_0x7cd7('0x1e')](_0x20881e[_0x7cd7('0x34')]['offset']);}return _0x442ac0[_0x7cd7('0x53')](_0x3d894b);}})[_0x7cd7('0x28')](function(_0x5c4efd){if(_0x5c4efd){return _0x5c4efd?{'count':_0x4c55c3,'rows':_0x5c4efd}:null;}})[_0x7cd7('0x28')](respondWithResult(_0x430281,null))['catch'](handleError(_0x430281,null));}; \ No newline at end of file +var _0xdc8c=['../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','find','order','pick','getFields','getSubjects','findOne','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdc8c,0x8d));var _0xcdc8=function(_0x3d17f5,_0x248c4e){_0x3d17f5=_0x3d17f5-0x0;var _0x3a2dbf=_0xdc8c[_0x3d17f5];return _0x3a2dbf;};'use strict';var emlformat=require(_0xcdc8('0x0'));var rimraf=require(_0xcdc8('0x1'));var zipdir=require(_0xcdc8('0x2'));var jsonpatch=require(_0xcdc8('0x3'));var rp=require(_0xcdc8('0x4'));var moment=require(_0xcdc8('0x5'));var BPromise=require(_0xcdc8('0x6'));var Mustache=require(_0xcdc8('0x7'));var util=require(_0xcdc8('0x8'));var path=require(_0xcdc8('0x9'));var sox=require('sox');var csv=require(_0xcdc8('0xa'));var ejs=require(_0xcdc8('0xb'));var fs=require('fs');var fs_extra=require(_0xcdc8('0xc'));var _=require('lodash');var squel=require(_0xcdc8('0xd'));var crypto=require(_0xcdc8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcdc8('0xa'));var querystring=require('querystring');var Papa=require(_0xcdc8('0xf'));var Redis=require(_0xcdc8('0x10'));var authService=require(_0xcdc8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcdc8('0x12'));var hardwareService=require(_0xcdc8('0x13'));var logger=require(_0xcdc8('0x14'))('api');var utils=require(_0xcdc8('0x15'));var config=require(_0xcdc8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcdc8('0x17'))['db'];function respondWithStatusCode(_0x4d1b6e,_0x9dcd37){_0x9dcd37=_0x9dcd37||0xcc;return function(_0x1490a2){if(_0x1490a2){return _0x4d1b6e['sendStatus'](_0x9dcd37);}return _0x4d1b6e['status'](_0x9dcd37)[_0xcdc8('0x18')]();};}function respondWithResult(_0x745a5e,_0x547260){_0x547260=_0x547260||0xc8;return function(_0x4b9bd5){if(_0x4b9bd5){return _0x745a5e[_0xcdc8('0x19')](_0x547260)[_0xcdc8('0x1a')](_0x4b9bd5);}};}function respondWithFilteredResult(_0xc02815,_0x3ecae9){return function(_0x1c968d){if(_0x1c968d){var _0x2f0a69=typeof _0x3ecae9[_0xcdc8('0x1b')]===_0xcdc8('0x1c')&&typeof _0x3ecae9[_0xcdc8('0x1d')]===_0xcdc8('0x1c');var _0x37f3c8=_0x1c968d[_0xcdc8('0x1e')];var _0x1cacce=_0x2f0a69?0x0:_0x3ecae9[_0xcdc8('0x1b')];var _0x5bc63e=_0x2f0a69?_0x1c968d['count']:_0x3ecae9[_0xcdc8('0x1b')]+_0x3ecae9[_0xcdc8('0x1d')];var _0x515dac;if(_0x5bc63e>=_0x37f3c8){_0x5bc63e=_0x37f3c8;_0x515dac=0xc8;}else{_0x515dac=0xce;}_0xc02815[_0xcdc8('0x19')](_0x515dac);return _0xc02815[_0xcdc8('0x1f')](_0xcdc8('0x20'),_0x1cacce+'-'+_0x5bc63e+'/'+_0x37f3c8)[_0xcdc8('0x1a')](_0x1c968d);}return null;};}function patchUpdates(_0x5786af){return function(_0x1b912a){try{jsonpatch[_0xcdc8('0x21')](_0x1b912a,_0x5786af,!![]);}catch(_0x5619de){return BPromise[_0xcdc8('0x22')](_0x5619de);}return _0x1b912a[_0xcdc8('0x23')]();};}function saveUpdates(_0x43e0d8,_0x38720a){return function(_0x1adb52){if(_0x1adb52){return _0x1adb52[_0xcdc8('0x24')](_0x43e0d8)[_0xcdc8('0x25')](function(_0x27885a){return _0x27885a;});}return null;};}function removeEntity(_0x163bc0,_0x1fed8f){return function(_0x2aaf6f){if(_0x2aaf6f){return _0x2aaf6f[_0xcdc8('0x26')]()[_0xcdc8('0x25')](function(){_0x163bc0['status'](0xcc)[_0xcdc8('0x18')]();});}};}function handleEntityNotFound(_0x27b487,_0x27daf6){return function(_0x4e3ac4){if(!_0x4e3ac4){_0x27b487[_0xcdc8('0x27')](0x194);}return _0x4e3ac4;};}function handleError(_0x94c5e8,_0x19374e){_0x19374e=_0x19374e||0x1f4;return function(_0x1a19bb){logger[_0xcdc8('0x28')](_0x1a19bb['stack']);if(_0x1a19bb[_0xcdc8('0x29')]){delete _0x1a19bb[_0xcdc8('0x29')];}_0x94c5e8[_0xcdc8('0x19')](_0x19374e)['send'](_0x1a19bb);};}exports[_0xcdc8('0x2a')]=function(_0x2c13b3,_0x25fd1c){var _0x31dc73={},_0x3e8101={},_0x3d74d1={'count':0x0,'rows':[]};var _0x27f4fb=_[_0xcdc8('0x2b')](db[_0xcdc8('0x2c')][_0xcdc8('0x2d')],function(_0x15a0fb){return{'name':_0x15a0fb[_0xcdc8('0x2e')],'type':_0x15a0fb[_0xcdc8('0x2f')][_0xcdc8('0x30')]};});_0x3e8101[_0xcdc8('0x31')]=_['map'](_0x27f4fb,_0xcdc8('0x29'));_0x3e8101[_0xcdc8('0x32')]=_['keys'](_0x2c13b3[_0xcdc8('0x32')]);_0x3e8101[_0xcdc8('0x33')]=_['intersection'](_0x3e8101['model'],_0x3e8101[_0xcdc8('0x32')]);_0x31dc73[_0xcdc8('0x34')]=_[_0xcdc8('0x35')](_0x3e8101[_0xcdc8('0x31')],qs[_0xcdc8('0x36')](_0x2c13b3[_0xcdc8('0x32')][_0xcdc8('0x36')]));_0x31dc73[_0xcdc8('0x34')]=_0x31dc73[_0xcdc8('0x34')][_0xcdc8('0x37')]?_0x31dc73['attributes']:_0x3e8101[_0xcdc8('0x31')];if(!_0x2c13b3['query'][_0xcdc8('0x38')](_0xcdc8('0x39'))){_0x31dc73['limit']=qs[_0xcdc8('0x1d')](_0x2c13b3['query'][_0xcdc8('0x1d')]);_0x31dc73[_0xcdc8('0x1b')]=qs['offset'](_0x2c13b3['query'][_0xcdc8('0x1b')]);}_0x31dc73['order']=qs[_0xcdc8('0x3a')](_0x2c13b3[_0xcdc8('0x32')][_0xcdc8('0x3a')]);_0x31dc73[_0xcdc8('0x3b')]=qs[_0xcdc8('0x33')](_['pick'](_0x2c13b3[_0xcdc8('0x32')],_0x3e8101['filters']),_0x27f4fb);if(_0x2c13b3['query'][_0xcdc8('0x3c')]){_0x31dc73[_0xcdc8('0x3b')]=_[_0xcdc8('0x3d')](_0x31dc73[_0xcdc8('0x3b')],{'$or':_['map'](_0x27f4fb,function(_0x1d35c2){if(_0x1d35c2[_0xcdc8('0x2f')]!==_0xcdc8('0x3e')){var _0x113197={};_0x113197[_0x1d35c2['name']]={'$like':'%'+_0x2c13b3['query'][_0xcdc8('0x3c')]+'%'};return _0x113197;}})});}_0x31dc73=_[_0xcdc8('0x3d')]({},_0x31dc73,_0x2c13b3['options']);var _0x17e48c={'where':_0x31dc73[_0xcdc8('0x3b')]};return db[_0xcdc8('0x2c')][_0xcdc8('0x1e')](_0x17e48c)['then'](function(_0x5cd885){_0x3d74d1[_0xcdc8('0x1e')]=_0x5cd885;if(_0x2c13b3[_0xcdc8('0x32')][_0xcdc8('0x3f')]){_0x31dc73[_0xcdc8('0x40')]=[{'all':!![]}];}return db[_0xcdc8('0x2c')][_0xcdc8('0x41')](_0x31dc73);})['then'](function(_0x5883cd){_0x3d74d1[_0xcdc8('0x42')]=_0x5883cd;return _0x3d74d1;})[_0xcdc8('0x25')](respondWithFilteredResult(_0x25fd1c,_0x31dc73))[_0xcdc8('0x43')](handleError(_0x25fd1c,null));};exports[_0xcdc8('0x44')]=function(_0x52a594,_0x415378){var _0x5e0763={'raw':![],'where':{'id':_0x52a594[_0xcdc8('0x45')]['id']}},_0x4e4045={};_0x4e4045['model']=_[_0xcdc8('0x46')](db[_0xcdc8('0x2c')][_0xcdc8('0x2d')]);_0x4e4045[_0xcdc8('0x32')]=_['keys'](_0x52a594[_0xcdc8('0x32')]);_0x4e4045[_0xcdc8('0x33')]=_[_0xcdc8('0x35')](_0x4e4045[_0xcdc8('0x31')],_0x4e4045[_0xcdc8('0x32')]);_0x5e0763[_0xcdc8('0x34')]=_['intersection'](_0x4e4045['model'],qs[_0xcdc8('0x36')](_0x52a594[_0xcdc8('0x32')][_0xcdc8('0x36')]));_0x5e0763['attributes']=_0x5e0763[_0xcdc8('0x34')][_0xcdc8('0x37')]?_0x5e0763[_0xcdc8('0x34')]:_0x4e4045[_0xcdc8('0x31')];if(_0x52a594[_0xcdc8('0x32')][_0xcdc8('0x3f')]){_0x5e0763[_0xcdc8('0x40')]=[{'all':!![]}];}_0x5e0763=_[_0xcdc8('0x3d')]({},_0x5e0763,_0x52a594[_0xcdc8('0x47')]);return db['ServicenowConfiguration']['find'](_0x5e0763)[_0xcdc8('0x25')](handleEntityNotFound(_0x415378,null))[_0xcdc8('0x25')](respondWithResult(_0x415378,null))[_0xcdc8('0x43')](handleError(_0x415378,null));};exports['create']=function(_0x112bf8,_0x407ad6){return db[_0xcdc8('0x2c')][_0xcdc8('0x48')](_0x112bf8[_0xcdc8('0x49')],{})[_0xcdc8('0x25')](respondWithResult(_0x407ad6,0xc9))[_0xcdc8('0x43')](handleError(_0x407ad6,null));};exports[_0xcdc8('0x24')]=function(_0x40b6c9,_0x260c2f){if(_0x40b6c9[_0xcdc8('0x49')]['id']){delete _0x40b6c9[_0xcdc8('0x49')]['id'];}return db['ServicenowConfiguration'][_0xcdc8('0x4a')]({'where':{'id':_0x40b6c9[_0xcdc8('0x45')]['id']}})['then'](handleEntityNotFound(_0x260c2f,null))[_0xcdc8('0x25')](saveUpdates(_0x40b6c9[_0xcdc8('0x49')],null))[_0xcdc8('0x25')](respondWithResult(_0x260c2f,null))[_0xcdc8('0x43')](handleError(_0x260c2f,null));};exports[_0xcdc8('0x26')]=function(_0x4cd9c4,_0x4d719c){return db[_0xcdc8('0x2c')][_0xcdc8('0x4a')]({'where':{'id':_0x4cd9c4['params']['id']}})['then'](handleEntityNotFound(_0x4d719c,null))[_0xcdc8('0x25')](removeEntity(_0x4d719c,null))[_0xcdc8('0x43')](handleError(_0x4d719c,null));};exports['getFields']=function(_0x41d644,_0x279ca5,_0x164a1c){var _0x275fb9={};var _0x2d1e8b={};var _0x21d5ef;var _0x57eff8;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x41d644[_0xcdc8('0x45')]['id']}})[_0xcdc8('0x25')](handleEntityNotFound(_0x279ca5,null))[_0xcdc8('0x25')](function(_0x4b7a5c){if(_0x4b7a5c){_0x21d5ef=_0x4b7a5c;_0x2d1e8b[_0xcdc8('0x31')]=_[_0xcdc8('0x46')](db['ServicenowField']['rawAttributes']);_0x2d1e8b[_0xcdc8('0x32')]=_[_0xcdc8('0x46')](_0x41d644[_0xcdc8('0x32')]);_0x2d1e8b[_0xcdc8('0x33')]=_[_0xcdc8('0x35')](_0x2d1e8b['model'],_0x2d1e8b[_0xcdc8('0x32')]);_0x275fb9[_0xcdc8('0x34')]=_['intersection'](_0x2d1e8b[_0xcdc8('0x31')],qs[_0xcdc8('0x36')](_0x41d644['query'][_0xcdc8('0x36')]));_0x275fb9['attributes']=_0x275fb9[_0xcdc8('0x34')][_0xcdc8('0x37')]?_0x275fb9[_0xcdc8('0x34')]:_0x2d1e8b[_0xcdc8('0x31')];_0x275fb9[_0xcdc8('0x4b')]=qs['sort'](_0x41d644['query'][_0xcdc8('0x3a')]);_0x275fb9['where']=qs['filters'](_[_0xcdc8('0x4c')](_0x41d644[_0xcdc8('0x32')],_0x2d1e8b[_0xcdc8('0x33')]));if(_0x41d644[_0xcdc8('0x32')][_0xcdc8('0x3c')]){_0x275fb9['where']=_[_0xcdc8('0x3d')](_0x275fb9['where'],{'$or':_['map'](_0x275fb9[_0xcdc8('0x34')],function(_0x34d5b6){var _0x3325c1={};_0x3325c1[_0x34d5b6]={'$like':'%'+_0x41d644['query']['filter']+'%'};return _0x3325c1;})});}_0x275fb9=_[_0xcdc8('0x3d')]({},_0x275fb9,_0x41d644[_0xcdc8('0x47')]);return _0x21d5ef[_0xcdc8('0x4d')](_0x275fb9);}})['then'](function(_0x10f88c){if(_0x10f88c){_0x57eff8=_0x10f88c['length'];if(!_0x41d644['query'][_0xcdc8('0x38')]('nolimit')){_0x275fb9['limit']=qs['limit'](_0x41d644[_0xcdc8('0x32')][_0xcdc8('0x1d')]);_0x275fb9[_0xcdc8('0x1b')]=qs[_0xcdc8('0x1b')](_0x41d644['query'][_0xcdc8('0x1b')]);}return _0x21d5ef['getFields'](_0x275fb9);}})[_0xcdc8('0x25')](function(_0x51fe39){if(_0x51fe39){return _0x51fe39?{'count':_0x57eff8,'rows':_0x51fe39}:null;}})[_0xcdc8('0x25')](respondWithResult(_0x279ca5,null))[_0xcdc8('0x43')](handleError(_0x279ca5,null));};exports[_0xcdc8('0x4e')]=function(_0x4b5d43,_0x518dca,_0x9791ad){var _0x220683={};var _0x110eca={};var _0x3a122a;var _0x35c9c4;return db['ServicenowConfiguration'][_0xcdc8('0x4f')]({'where':{'id':_0x4b5d43[_0xcdc8('0x45')]['id']}})[_0xcdc8('0x25')](handleEntityNotFound(_0x518dca,null))['then'](function(_0x9192e0){if(_0x9192e0){_0x3a122a=_0x9192e0;_0x110eca[_0xcdc8('0x31')]=_['keys'](db[_0xcdc8('0x50')][_0xcdc8('0x2d')]);_0x110eca['query']=_[_0xcdc8('0x46')](_0x4b5d43[_0xcdc8('0x32')]);_0x110eca[_0xcdc8('0x33')]=_['intersection'](_0x110eca[_0xcdc8('0x31')],_0x110eca[_0xcdc8('0x32')]);_0x220683[_0xcdc8('0x34')]=_['intersection'](_0x110eca[_0xcdc8('0x31')],qs['fields'](_0x4b5d43[_0xcdc8('0x32')][_0xcdc8('0x36')]));_0x220683[_0xcdc8('0x34')]=_0x220683['attributes'][_0xcdc8('0x37')]?_0x220683[_0xcdc8('0x34')]:_0x110eca[_0xcdc8('0x31')];_0x220683[_0xcdc8('0x4b')]=qs['sort'](_0x4b5d43[_0xcdc8('0x32')][_0xcdc8('0x3a')]);_0x220683[_0xcdc8('0x3b')]=qs['filters'](_['pick'](_0x4b5d43[_0xcdc8('0x32')],_0x110eca[_0xcdc8('0x33')]));if(_0x4b5d43[_0xcdc8('0x32')][_0xcdc8('0x3c')]){_0x220683[_0xcdc8('0x3b')]=_[_0xcdc8('0x3d')](_0x220683[_0xcdc8('0x3b')],{'$or':_[_0xcdc8('0x2b')](_0x220683['attributes'],function(_0x43af46){var _0x245c29={};_0x245c29[_0x43af46]={'$like':'%'+_0x4b5d43['query'][_0xcdc8('0x3c')]+'%'};return _0x245c29;})});}_0x220683=_[_0xcdc8('0x3d')]({},_0x220683,_0x4b5d43[_0xcdc8('0x47')]);return _0x3a122a[_0xcdc8('0x4e')](_0x220683);}})['then'](function(_0x5f2978){if(_0x5f2978){_0x35c9c4=_0x5f2978[_0xcdc8('0x37')];if(!_0x4b5d43[_0xcdc8('0x32')][_0xcdc8('0x38')]('nolimit')){_0x220683[_0xcdc8('0x1d')]=qs[_0xcdc8('0x1d')](_0x4b5d43[_0xcdc8('0x32')][_0xcdc8('0x1d')]);_0x220683[_0xcdc8('0x1b')]=qs[_0xcdc8('0x1b')](_0x4b5d43[_0xcdc8('0x32')][_0xcdc8('0x1b')]);}return _0x3a122a[_0xcdc8('0x4e')](_0x220683);}})[_0xcdc8('0x25')](function(_0x2b9d4b){if(_0x2b9d4b){return _0x2b9d4b?{'count':_0x35c9c4,'rows':_0x2b9d4b}:null;}})[_0xcdc8('0x25')](respondWithResult(_0x518dca,null))[_0xcdc8('0x43')](handleError(_0x518dca,null));};exports['getDescriptions']=function(_0x379915,_0x45940f,_0x41f7a0){var _0x46ac45={};var _0x5b89f8={};var _0xd9df1e;var _0xec08e0;return db[_0xcdc8('0x2c')][_0xcdc8('0x4f')]({'where':{'id':_0x379915[_0xcdc8('0x45')]['id']}})[_0xcdc8('0x25')](handleEntityNotFound(_0x45940f,null))[_0xcdc8('0x25')](function(_0x124105){if(_0x124105){_0xd9df1e=_0x124105;_0x5b89f8[_0xcdc8('0x31')]=_['keys'](db[_0xcdc8('0x50')][_0xcdc8('0x2d')]);_0x5b89f8[_0xcdc8('0x32')]=_[_0xcdc8('0x46')](_0x379915[_0xcdc8('0x32')]);_0x5b89f8[_0xcdc8('0x33')]=_[_0xcdc8('0x35')](_0x5b89f8[_0xcdc8('0x31')],_0x5b89f8[_0xcdc8('0x32')]);_0x46ac45[_0xcdc8('0x34')]=_[_0xcdc8('0x35')](_0x5b89f8[_0xcdc8('0x31')],qs['fields'](_0x379915[_0xcdc8('0x32')][_0xcdc8('0x36')]));_0x46ac45[_0xcdc8('0x34')]=_0x46ac45[_0xcdc8('0x34')][_0xcdc8('0x37')]?_0x46ac45[_0xcdc8('0x34')]:_0x5b89f8[_0xcdc8('0x31')];_0x46ac45[_0xcdc8('0x4b')]=qs['sort'](_0x379915[_0xcdc8('0x32')][_0xcdc8('0x3a')]);_0x46ac45[_0xcdc8('0x3b')]=qs[_0xcdc8('0x33')](_[_0xcdc8('0x4c')](_0x379915[_0xcdc8('0x32')],_0x5b89f8[_0xcdc8('0x33')]));if(_0x379915[_0xcdc8('0x32')]['filter']){_0x46ac45[_0xcdc8('0x3b')]=_['merge'](_0x46ac45[_0xcdc8('0x3b')],{'$or':_['map'](_0x46ac45[_0xcdc8('0x34')],function(_0x2a2c3e){var _0x5ab761={};_0x5ab761[_0x2a2c3e]={'$like':'%'+_0x379915[_0xcdc8('0x32')][_0xcdc8('0x3c')]+'%'};return _0x5ab761;})});}_0x46ac45=_[_0xcdc8('0x3d')]({},_0x46ac45,_0x379915['options']);return _0xd9df1e['getDescriptions'](_0x46ac45);}})['then'](function(_0x549404){if(_0x549404){_0xec08e0=_0x549404[_0xcdc8('0x37')];if(!_0x379915['query'][_0xcdc8('0x38')](_0xcdc8('0x39'))){_0x46ac45[_0xcdc8('0x1d')]=qs[_0xcdc8('0x1d')](_0x379915[_0xcdc8('0x32')][_0xcdc8('0x1d')]);_0x46ac45[_0xcdc8('0x1b')]=qs[_0xcdc8('0x1b')](_0x379915[_0xcdc8('0x32')]['offset']);}return _0xd9df1e[_0xcdc8('0x51')](_0x46ac45);}})[_0xcdc8('0x25')](function(_0x20f335){if(_0x20f335){return _0x20f335?{'count':_0xec08e0,'rows':_0x20f335}:null;}})[_0xcdc8('0x25')](respondWithResult(_0x45940f,null))[_0xcdc8('0x43')](handleError(_0x45940f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 3fa7155..a811016 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 _0xc7a7=['moment','bluebird','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','lodash','util','../../config/logger'];(function(_0x2cf3f9,_0x4d14c6){var _0x26fb0a=function(_0xe16b7b){while(--_0xe16b7b){_0x2cf3f9['push'](_0x2cf3f9['shift']());}};_0x26fb0a(++_0x4d14c6);}(_0xc7a7,0x171));var _0x7c7a=function(_0x5d9c35,_0x52abe7){_0x5d9c35=_0x5d9c35-0x0;var _0x264022=_0xc7a7[_0x5d9c35];return _0x264022;};'use strict';var _=require(_0x7c7a('0x0'));var util=require(_0x7c7a('0x1'));var logger=require(_0x7c7a('0x2'))('api');var moment=require(_0x7c7a('0x3'));var BPromise=require(_0x7c7a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c7a('0x5'));var rimraf=require(_0x7c7a('0x6'));var config=require(_0x7c7a('0x7'));var attributes=require(_0x7c7a('0x8'));module[_0x7c7a('0x9')]=function(_0xc84abf,_0x346f96){return _0xc84abf[_0x7c7a('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x7c7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4024=['define','int_servicenow_configurations','lodash','util','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x20716f,_0x5e049a){var _0x4f2467=function(_0x2d9414){while(--_0x2d9414){_0x20716f['push'](_0x20716f['shift']());}};_0x4f2467(++_0x5e049a);}(_0x4024,0x89));var _0x4402=function(_0x2f651d,_0x7d2f88){_0x2f651d=_0x2f651d-0x0;var _0x249e3b=_0x4024[_0x2f651d];return _0x249e3b;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var logger=require('../../config/logger')(_0x4402('0x2'));var moment=require(_0x4402('0x3'));var BPromise=require('bluebird');var rp=require(_0x4402('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4402('0x5'));var config=require(_0x4402('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('ServicenowConfiguration',attributes,{'tableName':_0x4402('0x8'),'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 840c402..07ab787 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 _0x3725=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5853eb,_0x482562){var _0x1101a7=function(_0x4ee70b){while(--_0x4ee70b){_0x5853eb['push'](_0x5853eb['shift']());}};_0x1101a7(++_0x482562);}(_0x3725,0xc1));var _0x5372=function(_0x7ec12b,_0x58dd58){_0x7ec12b=_0x7ec12b-0x0;var _0x5e6ace=_0x3725[_0x7ec12b];return _0x5e6ace;};'use strict';var _=require(_0x5372('0x0'));var util=require(_0x5372('0x1'));var moment=require(_0x5372('0x2'));var BPromise=require(_0x5372('0x3'));var rs=require(_0x5372('0x4'));var fs=require('fs');var Redis=require(_0x5372('0x5'));var db=require(_0x5372('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5372('0x7'));var config=require(_0x5372('0x8'));var jayson=require(_0x5372('0x9'));var client=jayson[_0x5372('0xa')][_0x5372('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf922f,_0x25ec57,_0x393fca){return new BPromise(function(_0x30c9cd,_0xadd416){return client[_0x5372('0xc')](_0xf922f,_0x393fca)[_0x5372('0xd')](function(_0x44ab92){logger[_0x5372('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x25ec57,_0x5372('0xf'));logger[_0x5372('0x10')](_0x5372('0x11'),_0x25ec57,'request\x20sent',JSON[_0x5372('0x12')](_0x44ab92));if(_0x44ab92[_0x5372('0x13')]){if(_0x44ab92[_0x5372('0x13')][_0x5372('0x14')]===0x1f4){logger[_0x5372('0x13')](_0x5372('0x15'),_0x25ec57,_0x44ab92[_0x5372('0x13')][_0x5372('0x16')]);return _0xadd416(_0x44ab92[_0x5372('0x13')][_0x5372('0x16')]);}logger[_0x5372('0x13')](_0x5372('0x15'),_0x25ec57,_0x44ab92[_0x5372('0x13')][_0x5372('0x16')]);return _0x30c9cd(_0x44ab92[_0x5372('0x13')]['message']);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x25ec57,'request\x20sent');_0x30c9cd(_0x44ab92[_0x5372('0x17')][_0x5372('0x16')]);}})[_0x5372('0x18')](function(_0x5632d1){logger[_0x5372('0x13')](_0x5372('0x15'),_0x25ec57,_0x5632d1);_0xadd416(_0x5632d1);});});} \ No newline at end of file +var _0x884b=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0x884b,0x154));var _0xb884=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x884b[_0x4629ed];return _0x52ca04;};'use strict';var _=require(_0xb884('0x0'));var util=require(_0xb884('0x1'));var moment=require(_0xb884('0x2'));var BPromise=require('bluebird');var rs=require(_0xb884('0x3'));var fs=require('fs');var Redis=require(_0xb884('0x4'));var db=require(_0xb884('0x5'))['db'];var utils=require(_0xb884('0x6'));var logger=require(_0xb884('0x7'))(_0xb884('0x8'));var config=require(_0xb884('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb884('0xa')][_0xb884('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f7863,_0x158c8c,_0x57e163){return new BPromise(function(_0x300d05,_0x2cc6aa){return client['request'](_0x4f7863,_0x57e163)[_0xb884('0xc')](function(_0xa446a2){logger[_0xb884('0xd')](_0xb884('0xe'),_0x158c8c,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x158c8c,_0xb884('0xf'),JSON['stringify'](_0xa446a2));if(_0xa446a2['error']){if(_0xa446a2[_0xb884('0x10')][_0xb884('0x11')]===0x1f4){logger[_0xb884('0x10')](_0xb884('0xe'),_0x158c8c,_0xa446a2[_0xb884('0x10')][_0xb884('0x12')]);return _0x2cc6aa(_0xa446a2['error'][_0xb884('0x12')]);}logger['error'](_0xb884('0xe'),_0x158c8c,_0xa446a2[_0xb884('0x10')][_0xb884('0x12')]);return _0x300d05(_0xa446a2['error'][_0xb884('0x12')]);}else{logger[_0xb884('0xd')](_0xb884('0xe'),_0x158c8c,_0xb884('0xf'));_0x300d05(_0xa446a2[_0xb884('0x13')]['message']);}})[_0xb884('0x14')](function(_0x47659e){logger[_0xb884('0x10')](_0xb884('0xe'),_0x158c8c,_0x47659e);_0x2cc6aa(_0x47659e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 7e1115a..0b479b0 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 _0x0942=['delete','exports','util','path','Router','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x1eb3d6,_0x556eb4){var _0x3cc1ed=function(_0x5560f1){while(--_0x5560f1){_0x1eb3d6['push'](_0x1eb3d6['shift']());}};_0x3cc1ed(++_0x556eb4);}(_0x0942,0x198));var _0x2094=function(_0x2cad51,_0x521f37){_0x2cad51=_0x2cad51-0x0;var _0x334640=_0x0942[_0x2cad51];return _0x334640;};'use strict';var multer=require('multer');var util=require(_0x2094('0x0'));var path=require(_0x2094('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2094('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2094('0x3'));var controller=require(_0x2094('0x4'));router['get']('/',auth[_0x2094('0x5')](),controller[_0x2094('0x6')]);router[_0x2094('0x7')](_0x2094('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x2094('0x9')]('/',auth[_0x2094('0x5')](),controller[_0x2094('0xa')]);router[_0x2094('0xb')](_0x2094('0x8'),auth[_0x2094('0x5')](),controller['update']);router[_0x2094('0xc')](_0x2094('0x8'),auth[_0x2094('0x5')](),controller['destroy']);module[_0x2094('0xd')]=router; \ No newline at end of file +var _0x4419=['express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x293f48,_0x3ec1ee){var _0x90dd4b=function(_0x33451b){while(--_0x33451b){_0x293f48['push'](_0x293f48['shift']());}};_0x90dd4b(++_0x3ec1ee);}(_0x4419,0x1d0));var _0x9441=function(_0xeec0f2,_0xd330f1){_0xeec0f2=_0xeec0f2-0x0;var _0x3af8c5=_0x4419[_0xeec0f2];return _0x3af8c5;};'use strict';var multer=require(_0x9441('0x0'));var util=require(_0x9441('0x1'));var path=require(_0x9441('0x2'));var timeout=require(_0x9441('0x3'));var express=require(_0x9441('0x4'));var router=express['Router']();var fs_extra=require(_0x9441('0x5'));var auth=require(_0x9441('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9441('0x7'));var controller=require(_0x9441('0x8'));router[_0x9441('0x9')]('/',auth['isAuthenticated'](),controller[_0x9441('0xa')]);router['get'](_0x9441('0xb'),auth[_0x9441('0xc')](),controller[_0x9441('0xd')]);router['post']('/',auth[_0x9441('0xc')](),controller[_0x9441('0xe')]);router[_0x9441('0xf')]('/:id',auth[_0x9441('0xc')](),controller[_0x9441('0x10')]);router['delete'](_0x9441('0xb'),auth[_0x9441('0xc')](),controller[_0x9441('0x11')]);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 c3720fd..afb425f 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 _0xd185=['ENUM','string','variable','picklist','STRING','customVariable','sequelize'];(function(_0x327463,_0x1d120a){var _0x1d6a52=function(_0x26a2ba){while(--_0x26a2ba){_0x327463['push'](_0x327463['shift']());}};_0x1d6a52(++_0x1d120a);}(_0xd185,0x156));var _0x5d18=function(_0x33be64,_0xe13784){_0x33be64=_0x33be64-0x0;var _0x31f893=_0xd185[_0x33be64];return _0x31f893;};'use strict';var Sequelize=require(_0x5d18('0x0'));module['exports']={'type':{'type':Sequelize[_0x5d18('0x1')](_0x5d18('0x2'),_0x5d18('0x3'),'customVariable','keyValue',_0x5d18('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5d18('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5d18('0x1')](_0x5d18('0x2'),_0x5d18('0x3'),_0x5d18('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5d18('0x5')]},'nameField':{'type':Sequelize[_0x5d18('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8f23=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','string','variable'];(function(_0x27b225,_0xeab073){var _0x4b4d36=function(_0xd852c6){while(--_0xd852c6){_0x27b225['push'](_0x27b225['shift']());}};_0x4b4d36(++_0xeab073);}(_0x8f23,0x153));var _0x38f2=function(_0x2b08c3,_0x4f6639){_0x2b08c3=_0x2b08c3-0x0;var _0x41381d=_0x8f23[_0x2b08c3];return _0x41381d;};'use strict';var Sequelize=require(_0x38f2('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x38f2('0x1'),_0x38f2('0x2'),_0x38f2('0x3'),_0x38f2('0x4'),_0x38f2('0x5')),'defaultValue':_0x38f2('0x1')},'content':{'type':Sequelize[_0x38f2('0x6')]},'key':{'type':Sequelize[_0x38f2('0x6')]},'keyType':{'type':Sequelize[_0x38f2('0x7')]('string',_0x38f2('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x38f2('0x6')]},'idField':{'type':Sequelize[_0x38f2('0x6')]},'nameField':{'type':Sequelize[_0x38f2('0x6')]},'customField':{'type':Sequelize[_0x38f2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 2618fd4..fb59fcd 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 _0xf21c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','error','stack','name','send','map','ServicenowField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','include','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x50a8ca,_0x43aa15){var _0x2ef4d4=function(_0x359a8a){while(--_0x359a8a){_0x50a8ca['push'](_0x50a8ca['shift']());}};_0x2ef4d4(++_0x43aa15);}(_0xf21c,0x124));var _0xcf21=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0xf21c[_0x56e4e7];return _0x383618;};'use strict';var emlformat=require(_0xcf21('0x0'));var rimraf=require(_0xcf21('0x1'));var zipdir=require(_0xcf21('0x2'));var jsonpatch=require(_0xcf21('0x3'));var rp=require(_0xcf21('0x4'));var moment=require(_0xcf21('0x5'));var BPromise=require(_0xcf21('0x6'));var Mustache=require(_0xcf21('0x7'));var util=require(_0xcf21('0x8'));var path=require(_0xcf21('0x9'));var sox=require(_0xcf21('0xa'));var csv=require('to-csv');var ejs=require(_0xcf21('0xb'));var fs=require('fs');var fs_extra=require(_0xcf21('0xc'));var _=require(_0xcf21('0xd'));var squel=require(_0xcf21('0xe'));var crypto=require(_0xcf21('0xf'));var jsforce=require(_0xcf21('0x10'));var deskjs=require(_0xcf21('0x11'));var toCsv=require(_0xcf21('0x12'));var querystring=require(_0xcf21('0x13'));var Papa=require(_0xcf21('0x14'));var Redis=require(_0xcf21('0x15'));var authService=require(_0xcf21('0x16'));var qs=require(_0xcf21('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf21('0x18'));var logger=require(_0xcf21('0x19'))(_0xcf21('0x1a'));var utils=require(_0xcf21('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xcf21('0x1c'));var db=require(_0xcf21('0x1d'))['db'];function respondWithStatusCode(_0x44b41d,_0x18f99e){_0x18f99e=_0x18f99e||0xcc;return function(_0x49e620){if(_0x49e620){return _0x44b41d[_0xcf21('0x1e')](_0x18f99e);}return _0x44b41d[_0xcf21('0x1f')](_0x18f99e)[_0xcf21('0x20')]();};}function respondWithResult(_0x61daa3,_0x5d4c02){_0x5d4c02=_0x5d4c02||0xc8;return function(_0x3d526e){if(_0x3d526e){return _0x61daa3[_0xcf21('0x1f')](_0x5d4c02)[_0xcf21('0x21')](_0x3d526e);}};}function respondWithFilteredResult(_0x1bc3dd,_0xb6196){return function(_0x27bbcf){if(_0x27bbcf){var _0x3d2da8=typeof _0xb6196[_0xcf21('0x22')]==='undefined'&&typeof _0xb6196[_0xcf21('0x23')]===_0xcf21('0x24');var _0x5b7051=_0x27bbcf[_0xcf21('0x25')];var _0x30794e=_0x3d2da8?0x0:_0xb6196[_0xcf21('0x22')];var _0x5506d9=_0x3d2da8?_0x27bbcf['count']:_0xb6196[_0xcf21('0x22')]+_0xb6196[_0xcf21('0x23')];var _0x3f52b2;if(_0x5506d9>=_0x5b7051){_0x5506d9=_0x5b7051;_0x3f52b2=0xc8;}else{_0x3f52b2=0xce;}_0x1bc3dd[_0xcf21('0x1f')](_0x3f52b2);return _0x1bc3dd['set'](_0xcf21('0x26'),_0x30794e+'-'+_0x5506d9+'/'+_0x5b7051)['json'](_0x27bbcf);}return null;};}function patchUpdates(_0x4d2e92){return function(_0x3a42fe){try{jsonpatch[_0xcf21('0x27')](_0x3a42fe,_0x4d2e92,!![]);}catch(_0x5b1be9){return BPromise[_0xcf21('0x28')](_0x5b1be9);}return _0x3a42fe['save']();};}function saveUpdates(_0x31ffe7,_0x47da9a){return function(_0x45b87e){if(_0x45b87e){return _0x45b87e[_0xcf21('0x29')](_0x31ffe7)['then'](function(_0x4045d7){return _0x4045d7;});}return null;};}function removeEntity(_0x2abc67,_0x536211){return function(_0x56483e){if(_0x56483e){return _0x56483e['destroy']()[_0xcf21('0x2a')](function(){_0x2abc67['status'](0xcc)[_0xcf21('0x20')]();});}};}function handleEntityNotFound(_0x51d2f0,_0x78bda3){return function(_0x19d88a){if(!_0x19d88a){_0x51d2f0[_0xcf21('0x1e')](0x194);}return _0x19d88a;};}function handleError(_0x59c588,_0x4c9424){_0x4c9424=_0x4c9424||0x1f4;return function(_0x46be74){logger[_0xcf21('0x2b')](_0x46be74[_0xcf21('0x2c')]);if(_0x46be74[_0xcf21('0x2d')]){delete _0x46be74['name'];}_0x59c588[_0xcf21('0x1f')](_0x4c9424)[_0xcf21('0x2e')](_0x46be74);};}exports['index']=function(_0x5f4a51,_0x134d7b){var _0x1e438f={},_0x5046e7={},_0x5efa78={'count':0x0,'rows':[]};var _0xdb99ea=_[_0xcf21('0x2f')](db[_0xcf21('0x30')][_0xcf21('0x31')],function(_0x579d1d){return{'name':_0x579d1d[_0xcf21('0x32')],'type':_0x579d1d[_0xcf21('0x33')]['key']};});_0x5046e7[_0xcf21('0x34')]=_['map'](_0xdb99ea,_0xcf21('0x2d'));_0x5046e7[_0xcf21('0x35')]=_['keys'](_0x5f4a51[_0xcf21('0x35')]);_0x5046e7[_0xcf21('0x36')]=_[_0xcf21('0x37')](_0x5046e7[_0xcf21('0x34')],_0x5046e7[_0xcf21('0x35')]);_0x1e438f[_0xcf21('0x38')]=_[_0xcf21('0x37')](_0x5046e7[_0xcf21('0x34')],qs[_0xcf21('0x39')](_0x5f4a51['query']['fields']));_0x1e438f[_0xcf21('0x38')]=_0x1e438f[_0xcf21('0x38')][_0xcf21('0x3a')]?_0x1e438f[_0xcf21('0x38')]:_0x5046e7[_0xcf21('0x34')];if(!_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x3b')](_0xcf21('0x3c'))){_0x1e438f[_0xcf21('0x23')]=qs[_0xcf21('0x23')](_0x5f4a51['query'][_0xcf21('0x23')]);_0x1e438f[_0xcf21('0x22')]=qs[_0xcf21('0x22')](_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x22')]);}_0x1e438f[_0xcf21('0x3d')]=qs[_0xcf21('0x3e')](_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x3e')]);_0x1e438f[_0xcf21('0x3f')]=qs[_0xcf21('0x36')](_[_0xcf21('0x40')](_0x5f4a51[_0xcf21('0x35')],_0x5046e7[_0xcf21('0x36')]),_0xdb99ea);if(_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x41')]){_0x1e438f[_0xcf21('0x3f')]=_[_0xcf21('0x42')](_0x1e438f[_0xcf21('0x3f')],{'$or':_[_0xcf21('0x2f')](_0xdb99ea,function(_0x1f15d6){if(_0x1f15d6[_0xcf21('0x33')]!==_0xcf21('0x43')){var _0xc9233d={};_0xc9233d[_0x1f15d6[_0xcf21('0x2d')]]={'$like':'%'+_0x5f4a51['query'][_0xcf21('0x41')]+'%'};return _0xc9233d;}})});}_0x1e438f=_['merge']({},_0x1e438f,_0x5f4a51[_0xcf21('0x44')]);var _0x42285f={'where':_0x1e438f[_0xcf21('0x3f')]};return db[_0xcf21('0x30')]['count'](_0x42285f)[_0xcf21('0x2a')](function(_0x49ce2f){_0x5efa78['count']=_0x49ce2f;if(_0x5f4a51[_0xcf21('0x35')][_0xcf21('0x45')]){_0x1e438f['include']=[{'all':!![]}];}return db[_0xcf21('0x30')][_0xcf21('0x46')](_0x1e438f);})[_0xcf21('0x2a')](function(_0x5424cd){_0x5efa78[_0xcf21('0x47')]=_0x5424cd;return _0x5efa78;})[_0xcf21('0x2a')](respondWithFilteredResult(_0x134d7b,_0x1e438f))['catch'](handleError(_0x134d7b,null));};exports['show']=function(_0x1b9e0a,_0x4f7ec3){var _0x3cb366={'raw':!![],'where':{'id':_0x1b9e0a[_0xcf21('0x48')]['id']}},_0x4106cd={};_0x4106cd[_0xcf21('0x34')]=_[_0xcf21('0x49')](db['ServicenowField'][_0xcf21('0x31')]);_0x4106cd[_0xcf21('0x35')]=_[_0xcf21('0x49')](_0x1b9e0a[_0xcf21('0x35')]);_0x4106cd[_0xcf21('0x36')]=_[_0xcf21('0x37')](_0x4106cd['model'],_0x4106cd[_0xcf21('0x35')]);_0x3cb366[_0xcf21('0x38')]=_[_0xcf21('0x37')](_0x4106cd[_0xcf21('0x34')],qs[_0xcf21('0x39')](_0x1b9e0a[_0xcf21('0x35')][_0xcf21('0x39')]));_0x3cb366[_0xcf21('0x38')]=_0x3cb366[_0xcf21('0x38')][_0xcf21('0x3a')]?_0x3cb366[_0xcf21('0x38')]:_0x4106cd['model'];if(_0x1b9e0a[_0xcf21('0x35')]['includeAll']){_0x3cb366[_0xcf21('0x4a')]=[{'all':!![]}];}_0x3cb366=_[_0xcf21('0x42')]({},_0x3cb366,_0x1b9e0a[_0xcf21('0x44')]);return db[_0xcf21('0x30')][_0xcf21('0x4b')](_0x3cb366)[_0xcf21('0x2a')](handleEntityNotFound(_0x4f7ec3,null))[_0xcf21('0x2a')](respondWithResult(_0x4f7ec3,null))[_0xcf21('0x4c')](handleError(_0x4f7ec3,null));};exports[_0xcf21('0x4d')]=function(_0x368ec6,_0x183a6e){return db[_0xcf21('0x30')]['create'](_0x368ec6[_0xcf21('0x4e')],{})[_0xcf21('0x2a')](respondWithResult(_0x183a6e,0xc9))['catch'](handleError(_0x183a6e,null));};exports[_0xcf21('0x29')]=function(_0xc52d9f,_0xb3941f){if(_0xc52d9f[_0xcf21('0x4e')]['id']){delete _0xc52d9f[_0xcf21('0x4e')]['id'];}return db[_0xcf21('0x30')][_0xcf21('0x4b')]({'where':{'id':_0xc52d9f[_0xcf21('0x48')]['id']}})['then'](handleEntityNotFound(_0xb3941f,null))[_0xcf21('0x2a')](saveUpdates(_0xc52d9f['body'],null))[_0xcf21('0x2a')](respondWithResult(_0xb3941f,null))[_0xcf21('0x4c')](handleError(_0xb3941f,null));};exports[_0xcf21('0x4f')]=function(_0x4ffcc7,_0x359c47){return db['ServicenowField']['find']({'where':{'id':_0x4ffcc7[_0xcf21('0x48')]['id']}})[_0xcf21('0x2a')](handleEntityNotFound(_0x359c47,null))[_0xcf21('0x2a')](removeEntity(_0x359c47,null))[_0xcf21('0x4c')](handleError(_0x359c47,null));}; \ No newline at end of file +var _0xa1e5=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','merge','VIRTUAL','ServicenowField','includeAll','findAll','catch','show','params','keys','include','options','create','body','find','destroy','eml-format','zip-dir'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xa1e5,0xdf));var _0x5a1e=function(_0x14f769,_0x58d016){_0x14f769=_0x14f769-0x0;var _0x267421=_0xa1e5[_0x14f769];return _0x267421;};'use strict';var emlformat=require(_0x5a1e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a1e('0x1'));var jsonpatch=require(_0x5a1e('0x2'));var rp=require(_0x5a1e('0x3'));var moment=require(_0x5a1e('0x4'));var BPromise=require(_0x5a1e('0x5'));var Mustache=require(_0x5a1e('0x6'));var util=require('util');var path=require(_0x5a1e('0x7'));var sox=require(_0x5a1e('0x8'));var csv=require('to-csv');var ejs=require(_0x5a1e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5a1e('0xa'));var crypto=require(_0x5a1e('0xb'));var jsforce=require(_0x5a1e('0xc'));var deskjs=require(_0x5a1e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5a1e('0xe'));var Papa=require(_0x5a1e('0xf'));var Redis=require(_0x5a1e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5a1e('0x11'));var as=require(_0x5a1e('0x12'));var hardwareService=require(_0x5a1e('0x13'));var logger=require('../../config/logger')(_0x5a1e('0x14'));var utils=require('../../config/utils');var config=require(_0x5a1e('0x15'));var licenseUtil=require(_0x5a1e('0x16'));var db=require(_0x5a1e('0x17'))['db'];function respondWithStatusCode(_0x212f3c,_0x379323){_0x379323=_0x379323||0xcc;return function(_0x4184c2){if(_0x4184c2){return _0x212f3c[_0x5a1e('0x18')](_0x379323);}return _0x212f3c[_0x5a1e('0x19')](_0x379323)['end']();};}function respondWithResult(_0x285d13,_0x4add82){_0x4add82=_0x4add82||0xc8;return function(_0x4e3948){if(_0x4e3948){return _0x285d13[_0x5a1e('0x19')](_0x4add82)[_0x5a1e('0x1a')](_0x4e3948);}};}function respondWithFilteredResult(_0x22635c,_0x4d3f6f){return function(_0x3f2a38){if(_0x3f2a38){var _0x53ef0c=typeof _0x4d3f6f[_0x5a1e('0x1b')]===_0x5a1e('0x1c')&&typeof _0x4d3f6f['limit']===_0x5a1e('0x1c');var _0x4f835b=_0x3f2a38[_0x5a1e('0x1d')];var _0x3e4916=_0x53ef0c?0x0:_0x4d3f6f[_0x5a1e('0x1b')];var _0x117f9d=_0x53ef0c?_0x3f2a38[_0x5a1e('0x1d')]:_0x4d3f6f[_0x5a1e('0x1b')]+_0x4d3f6f['limit'];var _0x2fce2b;if(_0x117f9d>=_0x4f835b){_0x117f9d=_0x4f835b;_0x2fce2b=0xc8;}else{_0x2fce2b=0xce;}_0x22635c[_0x5a1e('0x19')](_0x2fce2b);return _0x22635c[_0x5a1e('0x1e')](_0x5a1e('0x1f'),_0x3e4916+'-'+_0x117f9d+'/'+_0x4f835b)[_0x5a1e('0x1a')](_0x3f2a38);}return null;};}function patchUpdates(_0x460b84){return function(_0x3572c2){try{jsonpatch[_0x5a1e('0x20')](_0x3572c2,_0x460b84,!![]);}catch(_0x21474a){return BPromise[_0x5a1e('0x21')](_0x21474a);}return _0x3572c2[_0x5a1e('0x22')]();};}function saveUpdates(_0x5ef655,_0x54feb0){return function(_0x45cae3){if(_0x45cae3){return _0x45cae3[_0x5a1e('0x23')](_0x5ef655)[_0x5a1e('0x24')](function(_0x22c6c1){return _0x22c6c1;});}return null;};}function removeEntity(_0x55a626,_0x358170){return function(_0xce2e49){if(_0xce2e49){return _0xce2e49['destroy']()[_0x5a1e('0x24')](function(){_0x55a626['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x209b47,_0x5860ac){return function(_0x389b0b){if(!_0x389b0b){_0x209b47[_0x5a1e('0x18')](0x194);}return _0x389b0b;};}function handleError(_0x46b72e,_0x72eb90){_0x72eb90=_0x72eb90||0x1f4;return function(_0xe04680){logger[_0x5a1e('0x25')](_0xe04680['stack']);if(_0xe04680[_0x5a1e('0x26')]){delete _0xe04680[_0x5a1e('0x26')];}_0x46b72e[_0x5a1e('0x19')](_0x72eb90)[_0x5a1e('0x27')](_0xe04680);};}exports[_0x5a1e('0x28')]=function(_0x40ba15,_0x170d56){var _0x34cf07={},_0x55cc83={},_0xefad15={'count':0x0,'rows':[]};var _0x288655=_['map'](db['ServicenowField'][_0x5a1e('0x29')],function(_0x399466){return{'name':_0x399466['fieldName'],'type':_0x399466[_0x5a1e('0x2a')][_0x5a1e('0x2b')]};});_0x55cc83[_0x5a1e('0x2c')]=_[_0x5a1e('0x2d')](_0x288655,_0x5a1e('0x26'));_0x55cc83[_0x5a1e('0x2e')]=_['keys'](_0x40ba15['query']);_0x55cc83['filters']=_[_0x5a1e('0x2f')](_0x55cc83[_0x5a1e('0x2c')],_0x55cc83[_0x5a1e('0x2e')]);_0x34cf07[_0x5a1e('0x30')]=_['intersection'](_0x55cc83[_0x5a1e('0x2c')],qs['fields'](_0x40ba15['query'][_0x5a1e('0x31')]));_0x34cf07['attributes']=_0x34cf07[_0x5a1e('0x30')][_0x5a1e('0x32')]?_0x34cf07['attributes']:_0x55cc83[_0x5a1e('0x2c')];if(!_0x40ba15[_0x5a1e('0x2e')][_0x5a1e('0x33')](_0x5a1e('0x34'))){_0x34cf07[_0x5a1e('0x35')]=qs[_0x5a1e('0x35')](_0x40ba15[_0x5a1e('0x2e')]['limit']);_0x34cf07[_0x5a1e('0x1b')]=qs[_0x5a1e('0x1b')](_0x40ba15[_0x5a1e('0x2e')]['offset']);}_0x34cf07[_0x5a1e('0x36')]=qs[_0x5a1e('0x37')](_0x40ba15[_0x5a1e('0x2e')][_0x5a1e('0x37')]);_0x34cf07['where']=qs['filters'](_[_0x5a1e('0x38')](_0x40ba15['query'],_0x55cc83[_0x5a1e('0x39')]),_0x288655);if(_0x40ba15['query'][_0x5a1e('0x3a')]){_0x34cf07[_0x5a1e('0x3b')]=_[_0x5a1e('0x3c')](_0x34cf07['where'],{'$or':_[_0x5a1e('0x2d')](_0x288655,function(_0x46aab9){if(_0x46aab9[_0x5a1e('0x2a')]!==_0x5a1e('0x3d')){var _0x19922a={};_0x19922a[_0x46aab9[_0x5a1e('0x26')]]={'$like':'%'+_0x40ba15[_0x5a1e('0x2e')]['filter']+'%'};return _0x19922a;}})});}_0x34cf07=_['merge']({},_0x34cf07,_0x40ba15['options']);var _0x3440d8={'where':_0x34cf07[_0x5a1e('0x3b')]};return db[_0x5a1e('0x3e')][_0x5a1e('0x1d')](_0x3440d8)[_0x5a1e('0x24')](function(_0x121c92){_0xefad15[_0x5a1e('0x1d')]=_0x121c92;if(_0x40ba15['query'][_0x5a1e('0x3f')]){_0x34cf07['include']=[{'all':!![]}];}return db['ServicenowField'][_0x5a1e('0x40')](_0x34cf07);})[_0x5a1e('0x24')](function(_0x37b861){_0xefad15['rows']=_0x37b861;return _0xefad15;})[_0x5a1e('0x24')](respondWithFilteredResult(_0x170d56,_0x34cf07))[_0x5a1e('0x41')](handleError(_0x170d56,null));};exports[_0x5a1e('0x42')]=function(_0x2fa9cc,_0x8dd507){var _0x468d91={'raw':!![],'where':{'id':_0x2fa9cc[_0x5a1e('0x43')]['id']}},_0x21867c={};_0x21867c[_0x5a1e('0x2c')]=_[_0x5a1e('0x44')](db[_0x5a1e('0x3e')][_0x5a1e('0x29')]);_0x21867c['query']=_[_0x5a1e('0x44')](_0x2fa9cc[_0x5a1e('0x2e')]);_0x21867c[_0x5a1e('0x39')]=_[_0x5a1e('0x2f')](_0x21867c['model'],_0x21867c['query']);_0x468d91['attributes']=_[_0x5a1e('0x2f')](_0x21867c[_0x5a1e('0x2c')],qs[_0x5a1e('0x31')](_0x2fa9cc[_0x5a1e('0x2e')]['fields']));_0x468d91[_0x5a1e('0x30')]=_0x468d91[_0x5a1e('0x30')][_0x5a1e('0x32')]?_0x468d91[_0x5a1e('0x30')]:_0x21867c[_0x5a1e('0x2c')];if(_0x2fa9cc[_0x5a1e('0x2e')][_0x5a1e('0x3f')]){_0x468d91[_0x5a1e('0x45')]=[{'all':!![]}];}_0x468d91=_[_0x5a1e('0x3c')]({},_0x468d91,_0x2fa9cc[_0x5a1e('0x46')]);return db['ServicenowField']['find'](_0x468d91)['then'](handleEntityNotFound(_0x8dd507,null))[_0x5a1e('0x24')](respondWithResult(_0x8dd507,null))[_0x5a1e('0x41')](handleError(_0x8dd507,null));};exports[_0x5a1e('0x47')]=function(_0x1c23aa,_0x3bd36e){return db['ServicenowField'][_0x5a1e('0x47')](_0x1c23aa['body'],{})['then'](respondWithResult(_0x3bd36e,0xc9))[_0x5a1e('0x41')](handleError(_0x3bd36e,null));};exports[_0x5a1e('0x23')]=function(_0x4e4c3e,_0x20114b){if(_0x4e4c3e[_0x5a1e('0x48')]['id']){delete _0x4e4c3e['body']['id'];}return db[_0x5a1e('0x3e')][_0x5a1e('0x49')]({'where':{'id':_0x4e4c3e['params']['id']}})['then'](handleEntityNotFound(_0x20114b,null))[_0x5a1e('0x24')](saveUpdates(_0x4e4c3e[_0x5a1e('0x48')],null))[_0x5a1e('0x24')](respondWithResult(_0x20114b,null))['catch'](handleError(_0x20114b,null));};exports[_0x5a1e('0x4a')]=function(_0x1edde8,_0x4f24c5){return db[_0x5a1e('0x3e')][_0x5a1e('0x49')]({'where':{'id':_0x1edde8[_0x5a1e('0x43')]['id']}})[_0x5a1e('0x24')](handleEntityNotFound(_0x4f24c5,null))['then'](removeEntity(_0x4f24c5,null))[_0x5a1e('0x41')](handleError(_0x4f24c5,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 6954e22..8ef0076 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 _0xf16d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','idField','FieldId'];(function(_0x508926,_0xa05b4f){var _0x49ab00=function(_0x360b74){while(--_0x360b74){_0x508926['push'](_0x508926['shift']());}};_0x49ab00(++_0xa05b4f);}(_0xf16d,0x118));var _0xdf16=function(_0x4bcc90,_0x6e93e){_0x4bcc90=_0x4bcc90-0x0;var _0x610b02=_0xf16d[_0x4bcc90];return _0x610b02;};'use strict';var _=require('lodash');var util=require(_0xdf16('0x0'));var logger=require(_0xdf16('0x1'))(_0xdf16('0x2'));var moment=require(_0xdf16('0x3'));var BPromise=require(_0xdf16('0x4'));var rp=require(_0xdf16('0x5'));var fs=require('fs');var path=require(_0xdf16('0x6'));var rimraf=require(_0xdf16('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf16('0x8'));module[_0xdf16('0x9')]=function(_0x5e9893,_0x193826){return _0x5e9893[_0xdf16('0xa')](_0xdf16('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xdf16('0xc'),_0xdf16('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7ab=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','lodash','util'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xf7ab,0x8d));var _0xbf7a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf7ab[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xbf7a('0x0'));var util=require(_0xbf7a('0x1'));var logger=require('../../config/logger')(_0xbf7a('0x2'));var moment=require(_0xbf7a('0x3'));var BPromise=require('bluebird');var rp=require(_0xbf7a('0x4'));var fs=require('fs');var path=require(_0xbf7a('0x5'));var rimraf=require(_0xbf7a('0x6'));var config=require(_0xbf7a('0x7'));var attributes=require('./intServicenowField.attributes');module[_0xbf7a('0x8')]=function(_0x27b493,_0x369f7e){return _0x27b493[_0xbf7a('0x9')](_0xbf7a('0xa'),attributes,{'tableName':_0xbf7a('0xb'),'paranoid':![],'indexes':[{'name':_0xbf7a('0xc'),'fields':['idField','FieldId'],'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 f04fb21..e03fa6f 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x38bc46,_0x220502){var _0x34c225=function(_0x4fa88f){while(--_0x4fa88f){_0x38bc46['push'](_0x38bc46['shift']());}};_0x34c225(++_0x220502);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2b4451,_0x85a280){_0x2b4451=_0x2b4451-0x0;var _0x4c12a8=_0xb43b[_0x2b4451];return _0x4c12a8;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x58ed4e,_0x3431de){var _0xa15bc4=function(_0x3af7a6){while(--_0x3af7a6){_0x58ed4e['push'](_0x58ed4e['shift']());}};_0xa15bc4(++_0x3431de);}(_0xf4eb,0xec));var _0xbf4e=function(_0x42b502,_0x587e4d){_0x42b502=_0x42b502-0x0;var _0x5304c6=_0xf4eb[_0x42b502];return _0x5304c6;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index de36acb..7b7c69c 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(_0x3672ff,_0x2c2af3){var _0x570de8=function(_0x288ef2){while(--_0x288ef2){_0x3672ff['push'](_0x3672ff['shift']());}};_0x570de8(++_0x2c2af3);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x3e3e63,_0x4d6ba1){var _0x45c3eb=function(_0x3269b1){while(--_0x3269b1){_0x3e3e63['push'](_0x3e3e63['shift']());}};_0x45c3eb(++_0x4d6ba1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index de923a5..685cfca 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(_0x285617,_0x15eede){var _0x567b99=function(_0xd570e1){while(--_0xd570e1){_0x285617['push'](_0x285617['shift']());}};_0x567b99(++_0x15eede);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x3a9b7e,_0xc31881){var _0x153ce8=function(_0x1e85c6){while(--_0x1e85c6){_0x3a9b7e['push'](_0x3a9b7e['shift']());}};_0x153ce8(++_0xc31881);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 cfdd258..7c3f3ab 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 _0x3ef0=['params','find','create','body','update','findOne','SugarcrmConfiguration','order','getConfigurations','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','created_by','description','date_start','duration_hours','duration_minutes','parent_type','parent_name','direction','username','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','stringify','Calls','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','destroy','then','error','stack','index','map','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','rows','catch','show'];(function(_0x1cfbba,_0x4e7a29){var _0x4bc171=function(_0x449afb){while(--_0x449afb){_0x1cfbba['push'](_0x1cfbba['shift']());}};_0x4bc171(++_0x4e7a29);}(_0x3ef0,0x19a));var _0x03ef=function(_0x30b27c,_0x1c4f6e){_0x30b27c=_0x30b27c-0x0;var _0xd8512c=_0x3ef0[_0x30b27c];return _0xd8512c;};'use strict';var emlformat=require(_0x03ef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03ef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03ef('0x2'));var moment=require('moment');var BPromise=require(_0x03ef('0x3'));var Mustache=require(_0x03ef('0x4'));var util=require(_0x03ef('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x03ef('0x6'));var ejs=require(_0x03ef('0x7'));var fs=require('fs');var fs_extra=require(_0x03ef('0x8'));var _=require('lodash');var squel=require(_0x03ef('0x9'));var crypto=require(_0x03ef('0xa'));var jsforce=require(_0x03ef('0xb'));var deskjs=require(_0x03ef('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03ef('0xd'));var Redis=require(_0x03ef('0xe'));var authService=require(_0x03ef('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x03ef('0x10'));var hardwareService=require(_0x03ef('0x11'));var logger=require('../../config/logger')(_0x03ef('0x12'));var utils=require(_0x03ef('0x13'));var config=require(_0x03ef('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ef('0x15'))['db'];var integrations=require(_0x03ef('0x16'));function respondWithStatusCode(_0x390cc2,_0x1e138e){_0x1e138e=_0x1e138e||0xcc;return function(_0x459f67){if(_0x459f67){return _0x390cc2[_0x03ef('0x17')](_0x1e138e);}return _0x390cc2[_0x03ef('0x18')](_0x1e138e)[_0x03ef('0x19')]();};}function respondWithResult(_0x1702a0,_0x3390ae){_0x3390ae=_0x3390ae||0xc8;return function(_0x336f72){if(_0x336f72){return _0x1702a0['status'](_0x3390ae)['json'](_0x336f72);}};}function respondWithFilteredResult(_0x16282b,_0x17b6ec){return function(_0x1a0113){if(_0x1a0113){var _0x2f6a35=typeof _0x17b6ec[_0x03ef('0x1a')]==='undefined'&&typeof _0x17b6ec['limit']===_0x03ef('0x1b');var _0x1f412c=_0x1a0113['count'];var _0x4a4e96=_0x2f6a35?0x0:_0x17b6ec[_0x03ef('0x1a')];var _0xa3ba09=_0x2f6a35?_0x1a0113[_0x03ef('0x1c')]:_0x17b6ec[_0x03ef('0x1a')]+_0x17b6ec[_0x03ef('0x1d')];var _0x5ee333;if(_0xa3ba09>=_0x1f412c){_0xa3ba09=_0x1f412c;_0x5ee333=0xc8;}else{_0x5ee333=0xce;}_0x16282b[_0x03ef('0x18')](_0x5ee333);return _0x16282b[_0x03ef('0x1e')]('Content-Range',_0x4a4e96+'-'+_0xa3ba09+'/'+_0x1f412c)[_0x03ef('0x1f')](_0x1a0113);}return null;};}function patchUpdates(_0x39f693){return function(_0x3459bc){try{jsonpatch[_0x03ef('0x20')](_0x3459bc,_0x39f693,!![]);}catch(_0x3c156d){return BPromise['reject'](_0x3c156d);}return _0x3459bc['save']();};}function saveUpdates(_0x41d7d7,_0x5d56e1){return function(_0x11073e){if(_0x11073e){return _0x11073e['update'](_0x41d7d7)['then'](function(_0x13b033){return _0x13b033;});}return null;};}function removeEntity(_0x27ac0d,_0x5efaf0){return function(_0x5f0084){if(_0x5f0084){return _0x5f0084[_0x03ef('0x21')]()[_0x03ef('0x22')](function(){_0x27ac0d['status'](0xcc)[_0x03ef('0x19')]();});}};}function handleEntityNotFound(_0x4d3908,_0x2a4c7f){return function(_0x54b217){if(!_0x54b217){_0x4d3908[_0x03ef('0x17')](0x194);}return _0x54b217;};}function handleError(_0x3dd14f,_0x31fd6f){_0x31fd6f=_0x31fd6f||0x1f4;return function(_0x3684e0){logger[_0x03ef('0x23')](_0x3684e0[_0x03ef('0x24')]);if(_0x3684e0['name']){delete _0x3684e0['name'];}_0x3dd14f[_0x03ef('0x18')](_0x31fd6f)['send'](_0x3684e0);};}exports[_0x03ef('0x25')]=function(_0x2b77cd,_0x391f82){var _0x4d9e6a={},_0x627997={},_0x732b3a={'count':0x0,'rows':[]};var _0x301caa=_[_0x03ef('0x26')](db['SugarcrmAccount'][_0x03ef('0x27')],function(_0x2cd00c){return{'name':_0x2cd00c[_0x03ef('0x28')],'type':_0x2cd00c[_0x03ef('0x29')]['key']};});_0x627997[_0x03ef('0x2a')]=_[_0x03ef('0x26')](_0x301caa,_0x03ef('0x2b'));_0x627997['query']=_[_0x03ef('0x2c')](_0x2b77cd[_0x03ef('0x2d')]);_0x627997[_0x03ef('0x2e')]=_[_0x03ef('0x2f')](_0x627997[_0x03ef('0x2a')],_0x627997['query']);_0x4d9e6a[_0x03ef('0x30')]=_[_0x03ef('0x2f')](_0x627997[_0x03ef('0x2a')],qs[_0x03ef('0x31')](_0x2b77cd[_0x03ef('0x2d')]['fields']));_0x4d9e6a[_0x03ef('0x30')]=_0x4d9e6a[_0x03ef('0x30')][_0x03ef('0x32')]?_0x4d9e6a[_0x03ef('0x30')]:_0x627997[_0x03ef('0x2a')];if(!_0x2b77cd['query']['hasOwnProperty'](_0x03ef('0x33'))){_0x4d9e6a[_0x03ef('0x1d')]=qs['limit'](_0x2b77cd[_0x03ef('0x2d')]['limit']);_0x4d9e6a[_0x03ef('0x1a')]=qs[_0x03ef('0x1a')](_0x2b77cd['query'][_0x03ef('0x1a')]);}_0x4d9e6a['order']=qs[_0x03ef('0x34')](_0x2b77cd[_0x03ef('0x2d')]['sort']);_0x4d9e6a['where']=qs[_0x03ef('0x2e')](_[_0x03ef('0x35')](_0x2b77cd['query'],_0x627997[_0x03ef('0x2e')]),_0x301caa);if(_0x2b77cd[_0x03ef('0x2d')][_0x03ef('0x36')]){_0x4d9e6a[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x4d9e6a[_0x03ef('0x37')],{'$or':_[_0x03ef('0x26')](_0x301caa,function(_0x3ca8e3){if(_0x3ca8e3['type']!==_0x03ef('0x39')){var _0x657c99={};_0x657c99[_0x3ca8e3[_0x03ef('0x2b')]]={'$like':'%'+_0x2b77cd['query'][_0x03ef('0x36')]+'%'};return _0x657c99;}})});}_0x4d9e6a=_[_0x03ef('0x38')]({},_0x4d9e6a,_0x2b77cd[_0x03ef('0x3a')]);var _0x318900={'where':_0x4d9e6a['where']};return db[_0x03ef('0x3b')][_0x03ef('0x1c')](_0x318900)[_0x03ef('0x22')](function(_0x5f8cb2){_0x732b3a['count']=_0x5f8cb2;if(_0x2b77cd[_0x03ef('0x2d')][_0x03ef('0x3c')]){_0x4d9e6a[_0x03ef('0x3d')]=[{'all':!![]}];}return db[_0x03ef('0x3b')][_0x03ef('0x3e')](_0x4d9e6a);})[_0x03ef('0x22')](function(_0x349e17){_0x732b3a[_0x03ef('0x3f')]=_0x349e17;return _0x732b3a;})[_0x03ef('0x22')](respondWithFilteredResult(_0x391f82,_0x4d9e6a))[_0x03ef('0x40')](handleError(_0x391f82,null));};exports[_0x03ef('0x41')]=function(_0x134200,_0x1a6ba6){var _0x8f7f42={'raw':![],'where':{'id':_0x134200[_0x03ef('0x42')]['id']}},_0x3b3638={};_0x3b3638[_0x03ef('0x2a')]=_[_0x03ef('0x2c')](db[_0x03ef('0x3b')][_0x03ef('0x27')]);_0x3b3638[_0x03ef('0x2d')]=_[_0x03ef('0x2c')](_0x134200['query']);_0x3b3638[_0x03ef('0x2e')]=_[_0x03ef('0x2f')](_0x3b3638[_0x03ef('0x2a')],_0x3b3638[_0x03ef('0x2d')]);_0x8f7f42[_0x03ef('0x30')]=_[_0x03ef('0x2f')](_0x3b3638[_0x03ef('0x2a')],qs[_0x03ef('0x31')](_0x134200[_0x03ef('0x2d')][_0x03ef('0x31')]));_0x8f7f42[_0x03ef('0x30')]=_0x8f7f42[_0x03ef('0x30')]['length']?_0x8f7f42[_0x03ef('0x30')]:_0x3b3638[_0x03ef('0x2a')];if(_0x134200['query'][_0x03ef('0x3c')]){_0x8f7f42[_0x03ef('0x3d')]=[{'all':!![]}];}_0x8f7f42=_['merge']({},_0x8f7f42,_0x134200[_0x03ef('0x3a')]);return db[_0x03ef('0x3b')][_0x03ef('0x43')](_0x8f7f42)['then'](handleEntityNotFound(_0x1a6ba6,null))[_0x03ef('0x22')](respondWithResult(_0x1a6ba6,null))[_0x03ef('0x40')](handleError(_0x1a6ba6,null));};exports['create']=function(_0x535607,_0x251ca9){return db[_0x03ef('0x3b')][_0x03ef('0x44')](_0x535607[_0x03ef('0x45')],{})[_0x03ef('0x22')](respondWithResult(_0x251ca9,0xc9))[_0x03ef('0x40')](handleError(_0x251ca9,null));};exports[_0x03ef('0x46')]=function(_0x2e3145,_0xdaf61d){if(_0x2e3145['body']['id']){delete _0x2e3145[_0x03ef('0x45')]['id'];}return db['SugarcrmAccount'][_0x03ef('0x43')]({'where':{'id':_0x2e3145[_0x03ef('0x42')]['id']}})['then'](handleEntityNotFound(_0xdaf61d,null))[_0x03ef('0x22')](saveUpdates(_0x2e3145[_0x03ef('0x45')],null))[_0x03ef('0x22')](respondWithResult(_0xdaf61d,null))[_0x03ef('0x40')](handleError(_0xdaf61d,null));};exports[_0x03ef('0x21')]=function(_0x4a052d,_0x1b7e2f){return db[_0x03ef('0x3b')]['find']({'where':{'id':_0x4a052d[_0x03ef('0x42')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x1b7e2f,null))['then'](removeEntity(_0x1b7e2f,null))[_0x03ef('0x40')](handleError(_0x1b7e2f,null));};exports['getConfigurations']=function(_0x48361c,_0xf4ed23,_0x1d6df5){var _0x5a0c23={};var _0x4a1d9b={};var _0x1eda74;var _0x5a5533;return db[_0x03ef('0x3b')][_0x03ef('0x47')]({'where':{'id':_0x48361c[_0x03ef('0x42')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0xf4ed23,null))[_0x03ef('0x22')](function(_0x492b1d){if(_0x492b1d){_0x1eda74=_0x492b1d;_0x4a1d9b[_0x03ef('0x2a')]=_['keys'](db[_0x03ef('0x48')][_0x03ef('0x27')]);_0x4a1d9b[_0x03ef('0x2d')]=_[_0x03ef('0x2c')](_0x48361c[_0x03ef('0x2d')]);_0x4a1d9b[_0x03ef('0x2e')]=_[_0x03ef('0x2f')](_0x4a1d9b[_0x03ef('0x2a')],_0x4a1d9b[_0x03ef('0x2d')]);_0x5a0c23['attributes']=_['intersection'](_0x4a1d9b[_0x03ef('0x2a')],qs[_0x03ef('0x31')](_0x48361c[_0x03ef('0x2d')][_0x03ef('0x31')]));_0x5a0c23['attributes']=_0x5a0c23[_0x03ef('0x30')][_0x03ef('0x32')]?_0x5a0c23[_0x03ef('0x30')]:_0x4a1d9b[_0x03ef('0x2a')];_0x5a0c23[_0x03ef('0x49')]=qs[_0x03ef('0x34')](_0x48361c['query'][_0x03ef('0x34')]);_0x5a0c23[_0x03ef('0x37')]=qs[_0x03ef('0x2e')](_['pick'](_0x48361c[_0x03ef('0x2d')],_0x4a1d9b[_0x03ef('0x2e')]));if(_0x48361c[_0x03ef('0x2d')][_0x03ef('0x36')]){_0x5a0c23[_0x03ef('0x37')]=_[_0x03ef('0x38')](_0x5a0c23['where'],{'$or':_[_0x03ef('0x26')](_0x5a0c23[_0x03ef('0x30')],function(_0x4dad13){var _0x111e0d={};_0x111e0d[_0x4dad13]={'$like':'%'+_0x48361c[_0x03ef('0x2d')][_0x03ef('0x36')]+'%'};return _0x111e0d;})});}_0x5a0c23=_[_0x03ef('0x38')]({},_0x5a0c23,_0x48361c['options']);return _0x1eda74[_0x03ef('0x4a')](_0x5a0c23);}})[_0x03ef('0x22')](function(_0x376d60){if(_0x376d60){_0x5a5533=_0x376d60[_0x03ef('0x32')];if(!_0x48361c[_0x03ef('0x2d')][_0x03ef('0x4b')](_0x03ef('0x33'))){_0x5a0c23[_0x03ef('0x1d')]=qs[_0x03ef('0x1d')](_0x48361c[_0x03ef('0x2d')][_0x03ef('0x1d')]);_0x5a0c23['offset']=qs[_0x03ef('0x1a')](_0x48361c[_0x03ef('0x2d')][_0x03ef('0x1a')]);}return _0x1eda74[_0x03ef('0x4a')](_0x5a0c23);}})[_0x03ef('0x22')](function(_0x222f85){if(_0x222f85){return _0x222f85?{'count':_0x5a5533,'rows':_0x222f85}:null;}})[_0x03ef('0x22')](respondWithResult(_0xf4ed23,null))[_0x03ef('0x40')](handleError(_0xf4ed23,null));};exports[_0x03ef('0x4c')]=function(_0x6193f1,_0x5d9059,_0x365c2a){if(_0x6193f1[_0x03ef('0x45')]['id']){delete _0x6193f1[_0x03ef('0x45')]['id'];}return db[_0x03ef('0x3b')][_0x03ef('0x47')]({'where':{'id':_0x6193f1[_0x03ef('0x42')]['id']}})[_0x03ef('0x22')](handleEntityNotFound(_0x5d9059,null))[_0x03ef('0x22')](function(_0x39f3fd){if(_0x39f3fd){_0x6193f1[_0x03ef('0x45')]['AccountId']=_0x39f3fd['id'];_0x6193f1[_0x03ef('0x45')][_0x03ef('0x4d')]=integrations[_0x03ef('0x4e')](_0x6193f1[_0x03ef('0x45')][_0x03ef('0x4f')],_0x6193f1[_0x03ef('0x45')][_0x03ef('0x29')]);_0x6193f1[_0x03ef('0x45')][_0x03ef('0x50')]=integrations[_0x03ef('0x51')](_0x6193f1[_0x03ef('0x45')][_0x03ef('0x4f')],_0x6193f1['body'][_0x03ef('0x29')]);return db[_0x03ef('0x48')][_0x03ef('0x44')](_0x6193f1[_0x03ef('0x45')],{'include':[{'model':db[_0x03ef('0x52')],'as':_0x03ef('0x4d')},{'model':db[_0x03ef('0x52')],'as':_0x03ef('0x50')}]});}return null;})[_0x03ef('0x22')](respondWithResult(_0x5d9059,null))[_0x03ef('0x40')](handleError(_0x5d9059,null));};exports['getFields']=function(_0x340422,_0x5295e9,_0x4a1ec5){var _0x2f836e='';var _0x3de14a=['id',_0x03ef('0x2b'),'assigned_user_id',_0x03ef('0x53'),_0x03ef('0x54'),_0x03ef('0x55'),_0x03ef('0x56'),_0x03ef('0x57'),'parent_id',_0x03ef('0x58'),_0x03ef('0x59'),_0x03ef('0x5a')];return db[_0x03ef('0x3b')][_0x03ef('0x47')]({'where':{'id':_0x340422[_0x03ef('0x42')]['id']},'attributes':['id',_0x03ef('0x5b'),'password',_0x03ef('0x5c')]})[_0x03ef('0x22')](handleEntityNotFound(_0x5295e9,null))['then'](function(_0x4fa38f){if(_0x4fa38f){_0x2f836e=_0x4fa38f[_0x03ef('0x5c')];var _0x2f34f2=_0x2f836e['slice'](-0x1);if(_0x2f34f2==='/'){_0x2f836e=_0x2f836e[_0x03ef('0x5d')](0x0,_0x2f836e[_0x03ef('0x5e')](_0x2f34f2));}return rp({'method':_0x03ef('0x5f'),'uri':util[_0x03ef('0x60')](_0x03ef('0x61'),_0x2f836e,_0x03ef('0x62')),'json':!![],'form':{'method':_0x03ef('0x63'),'input_type':_0x03ef('0x64'),'response_type':_0x03ef('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4fa38f['username'],'password':_0x4fa38f[_0x03ef('0x65')],'encryption':_0x03ef('0x66')},'application':_0x03ef('0x67')})}});}})['then'](function(_0x12513){if(_0x12513&&_0x12513[_0x03ef('0x2b')]!==_0x03ef('0x68')&&_0x12513['name']!==_0x03ef('0x69')){return rp({'method':'POST','uri':util[_0x03ef('0x60')](_0x03ef('0x61'),_0x2f836e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x03ef('0x6a'),'input_type':'JSON','response_type':_0x03ef('0x64'),'rest_data':JSON[_0x03ef('0x6b')]({'session':_0x12513['id'],'module_name':_0x03ef('0x6c')})}})[_0x03ef('0x22')](function(_0x4f7dd5){if(_0x4f7dd5){var _0x228196=_['values'](_0x4f7dd5['module_fields']);_['remove'](_0x228196,function(_0x2f5307){return _0x3de14a[_0x03ef('0x6d')](_0x2f5307[_0x03ef('0x2b')]);});return{'count':_0x228196[_0x03ef('0x32')],'rows':_[_0x03ef('0x26')](_0x228196,function(_0x29912f){return{'id':_0x29912f[_0x03ef('0x2b')],'name':_0x29912f[_0x03ef('0x6e')],'custom':_[_0x03ef('0x6f')](_0x29912f['name'],'_c')?!![]:![],'options':_0x29912f['options']?_['map'](_['values'](_0x29912f['options']),function(_0x2ef0de){return{'name':_0x2ef0de[_0x03ef('0x70')],'value':_0x2ef0de[_0x03ef('0x2b')]};}):[]};})};}})[_0x03ef('0x22')](respondWithResult(_0x5295e9,null))[_0x03ef('0x40')](function(_0x7fdf2e){var _0x5934a1=_0x340422[_0x03ef('0x2d')][_0x03ef('0x71')]?0x1f4:_0x7fdf2e[_0x03ef('0x72')]||0x1f4;logger[_0x03ef('0x23')](_0x03ef('0x73'),_0x03ef('0x74'),_0x5934a1,JSON[_0x03ef('0x6b')](_0x7fdf2e));delete _0x7fdf2e[_0x03ef('0x2b')];if(_0x5934a1===0x191){_0x5934a1=0x190;}_0x5295e9[_0x03ef('0x18')](_0x5934a1)[_0x03ef('0x75')](_0x340422[_0x03ef('0x2d')][_0x03ef('0x71')]?{'message':_0x03ef('0x76'),'statusCode':_0x7fdf2e['statusCode']}:_0x7fdf2e);});}else{var _0x23eab9=0x1f4;_0x5295e9[_0x03ef('0x18')](_0x23eab9)[_0x03ef('0x75')]({'message':_0x03ef('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xabb6=['crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne','SugarcrmConfiguration','getConfigurations','Subjects','getDescriptions','channel','SugarcrmField','created_by','date_start','duration_hours','parent_type','username','password','remoteUri','slice','substring','POST','format','login','JSON','stringify','PLAIN','Password\x20Expired','%s%s','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel'];(function(_0xcdc4a2,_0x3996d3){var _0x31c30f=function(_0x2044de){while(--_0x2044de){_0xcdc4a2['push'](_0xcdc4a2['shift']());}};_0x31c30f(++_0x3996d3);}(_0xabb6,0x151));var _0x6abb=function(_0x2402ab,_0x110d5a){_0x2402ab=_0x2402ab-0x0;var _0x1c7a9e=_0xabb6[_0x2402ab];return _0x1c7a9e;};'use strict';var emlformat=require(_0x6abb('0x0'));var rimraf=require(_0x6abb('0x1'));var zipdir=require(_0x6abb('0x2'));var jsonpatch=require(_0x6abb('0x3'));var rp=require(_0x6abb('0x4'));var moment=require('moment');var BPromise=require(_0x6abb('0x5'));var Mustache=require('mustache');var util=require(_0x6abb('0x6'));var path=require('path');var sox=require(_0x6abb('0x7'));var csv=require(_0x6abb('0x8'));var ejs=require(_0x6abb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6abb('0xa'));var crypto=require(_0x6abb('0xb'));var jsforce=require(_0x6abb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6abb('0x8'));var querystring=require(_0x6abb('0xd'));var Papa=require('papaparse');var Redis=require(_0x6abb('0xe'));var authService=require(_0x6abb('0xf'));var qs=require(_0x6abb('0x10'));var as=require(_0x6abb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6abb('0x12'));var utils=require(_0x6abb('0x13'));var config=require(_0x6abb('0x14'));var licenseUtil=require(_0x6abb('0x15'));var db=require(_0x6abb('0x16'))['db'];var integrations=require(_0x6abb('0x17'));function respondWithStatusCode(_0x4a4a9f,_0x44d840){_0x44d840=_0x44d840||0xcc;return function(_0x236dca){if(_0x236dca){return _0x4a4a9f['sendStatus'](_0x44d840);}return _0x4a4a9f[_0x6abb('0x18')](_0x44d840)[_0x6abb('0x19')]();};}function respondWithResult(_0x367ab7,_0x471c23){_0x471c23=_0x471c23||0xc8;return function(_0x191d4b){if(_0x191d4b){return _0x367ab7[_0x6abb('0x18')](_0x471c23)[_0x6abb('0x1a')](_0x191d4b);}};}function respondWithFilteredResult(_0x240c16,_0x36acd2){return function(_0x543094){if(_0x543094){var _0x348f58=typeof _0x36acd2['offset']===_0x6abb('0x1b')&&typeof _0x36acd2[_0x6abb('0x1c')]===_0x6abb('0x1b');var _0x40ef3c=_0x543094[_0x6abb('0x1d')];var _0x3a8d6c=_0x348f58?0x0:_0x36acd2[_0x6abb('0x1e')];var _0x5065e4=_0x348f58?_0x543094[_0x6abb('0x1d')]:_0x36acd2[_0x6abb('0x1e')]+_0x36acd2['limit'];var _0xc59fd3;if(_0x5065e4>=_0x40ef3c){_0x5065e4=_0x40ef3c;_0xc59fd3=0xc8;}else{_0xc59fd3=0xce;}_0x240c16['status'](_0xc59fd3);return _0x240c16[_0x6abb('0x1f')]('Content-Range',_0x3a8d6c+'-'+_0x5065e4+'/'+_0x40ef3c)[_0x6abb('0x1a')](_0x543094);}return null;};}function patchUpdates(_0x257deb){return function(_0x22b748){try{jsonpatch[_0x6abb('0x20')](_0x22b748,_0x257deb,!![]);}catch(_0x127c5f){return BPromise[_0x6abb('0x21')](_0x127c5f);}return _0x22b748[_0x6abb('0x22')]();};}function saveUpdates(_0x2d71a6,_0x1efd00){return function(_0x3f6260){if(_0x3f6260){return _0x3f6260[_0x6abb('0x23')](_0x2d71a6)[_0x6abb('0x24')](function(_0x3bf75f){return _0x3bf75f;});}return null;};}function removeEntity(_0x233d57,_0x50b08f){return function(_0x41480c){if(_0x41480c){return _0x41480c[_0x6abb('0x25')]()['then'](function(){_0x233d57[_0x6abb('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0062,_0x456a46){return function(_0x20c0ab){if(!_0x20c0ab){_0x4e0062[_0x6abb('0x26')](0x194);}return _0x20c0ab;};}function handleError(_0x9d9ec4,_0x2d7c79){_0x2d7c79=_0x2d7c79||0x1f4;return function(_0x5b9cb2){logger[_0x6abb('0x27')](_0x5b9cb2[_0x6abb('0x28')]);if(_0x5b9cb2['name']){delete _0x5b9cb2[_0x6abb('0x29')];}_0x9d9ec4['status'](_0x2d7c79)[_0x6abb('0x2a')](_0x5b9cb2);};}exports[_0x6abb('0x2b')]=function(_0x334308,_0x5ad943){var _0x5c80ca={},_0x591e07={},_0x3c7798={'count':0x0,'rows':[]};var _0x52414d=_[_0x6abb('0x2c')](db[_0x6abb('0x2d')][_0x6abb('0x2e')],function(_0x512745){return{'name':_0x512745[_0x6abb('0x2f')],'type':_0x512745[_0x6abb('0x30')][_0x6abb('0x31')]};});_0x591e07[_0x6abb('0x32')]=_[_0x6abb('0x2c')](_0x52414d,_0x6abb('0x29'));_0x591e07[_0x6abb('0x33')]=_['keys'](_0x334308[_0x6abb('0x33')]);_0x591e07[_0x6abb('0x34')]=_['intersection'](_0x591e07[_0x6abb('0x32')],_0x591e07['query']);_0x5c80ca['attributes']=_[_0x6abb('0x35')](_0x591e07[_0x6abb('0x32')],qs['fields'](_0x334308[_0x6abb('0x33')][_0x6abb('0x36')]));_0x5c80ca[_0x6abb('0x37')]=_0x5c80ca[_0x6abb('0x37')][_0x6abb('0x38')]?_0x5c80ca['attributes']:_0x591e07[_0x6abb('0x32')];if(!_0x334308[_0x6abb('0x33')][_0x6abb('0x39')](_0x6abb('0x3a'))){_0x5c80ca[_0x6abb('0x1c')]=qs[_0x6abb('0x1c')](_0x334308['query'][_0x6abb('0x1c')]);_0x5c80ca[_0x6abb('0x1e')]=qs['offset'](_0x334308[_0x6abb('0x33')][_0x6abb('0x1e')]);}_0x5c80ca[_0x6abb('0x3b')]=qs[_0x6abb('0x3c')](_0x334308['query']['sort']);_0x5c80ca[_0x6abb('0x3d')]=qs[_0x6abb('0x34')](_[_0x6abb('0x3e')](_0x334308[_0x6abb('0x33')],_0x591e07[_0x6abb('0x34')]),_0x52414d);if(_0x334308[_0x6abb('0x33')][_0x6abb('0x3f')]){_0x5c80ca[_0x6abb('0x3d')]=_[_0x6abb('0x40')](_0x5c80ca['where'],{'$or':_[_0x6abb('0x2c')](_0x52414d,function(_0x5c9dd9){if(_0x5c9dd9[_0x6abb('0x30')]!==_0x6abb('0x41')){var _0x21b300={};_0x21b300[_0x5c9dd9['name']]={'$like':'%'+_0x334308['query'][_0x6abb('0x3f')]+'%'};return _0x21b300;}})});}_0x5c80ca=_[_0x6abb('0x40')]({},_0x5c80ca,_0x334308[_0x6abb('0x42')]);var _0x2d3bc4={'where':_0x5c80ca[_0x6abb('0x3d')]};return db[_0x6abb('0x2d')]['count'](_0x2d3bc4)[_0x6abb('0x24')](function(_0x3a08cd){_0x3c7798[_0x6abb('0x1d')]=_0x3a08cd;if(_0x334308[_0x6abb('0x33')][_0x6abb('0x43')]){_0x5c80ca[_0x6abb('0x44')]=[{'all':!![]}];}return db[_0x6abb('0x2d')][_0x6abb('0x45')](_0x5c80ca);})['then'](function(_0x3a90e4){_0x3c7798[_0x6abb('0x46')]=_0x3a90e4;return _0x3c7798;})[_0x6abb('0x24')](respondWithFilteredResult(_0x5ad943,_0x5c80ca))[_0x6abb('0x47')](handleError(_0x5ad943,null));};exports[_0x6abb('0x48')]=function(_0x27fd87,_0x3446fe){var _0x43567d={'raw':![],'where':{'id':_0x27fd87[_0x6abb('0x49')]['id']}},_0x1dc061={};_0x1dc061['model']=_[_0x6abb('0x4a')](db[_0x6abb('0x2d')][_0x6abb('0x2e')]);_0x1dc061[_0x6abb('0x33')]=_[_0x6abb('0x4a')](_0x27fd87['query']);_0x1dc061[_0x6abb('0x34')]=_['intersection'](_0x1dc061['model'],_0x1dc061[_0x6abb('0x33')]);_0x43567d[_0x6abb('0x37')]=_[_0x6abb('0x35')](_0x1dc061[_0x6abb('0x32')],qs[_0x6abb('0x36')](_0x27fd87[_0x6abb('0x33')][_0x6abb('0x36')]));_0x43567d[_0x6abb('0x37')]=_0x43567d['attributes'][_0x6abb('0x38')]?_0x43567d[_0x6abb('0x37')]:_0x1dc061['model'];if(_0x27fd87[_0x6abb('0x33')][_0x6abb('0x43')]){_0x43567d['include']=[{'all':!![]}];}_0x43567d=_[_0x6abb('0x40')]({},_0x43567d,_0x27fd87[_0x6abb('0x42')]);return db[_0x6abb('0x2d')][_0x6abb('0x4b')](_0x43567d)['then'](handleEntityNotFound(_0x3446fe,null))[_0x6abb('0x24')](respondWithResult(_0x3446fe,null))[_0x6abb('0x47')](handleError(_0x3446fe,null));};exports[_0x6abb('0x4c')]=function(_0x100299,_0x2648f4){return db['SugarcrmAccount'][_0x6abb('0x4c')](_0x100299[_0x6abb('0x4d')],{})['then'](respondWithResult(_0x2648f4,0xc9))[_0x6abb('0x47')](handleError(_0x2648f4,null));};exports['update']=function(_0x1871cf,_0x4dfcdf){if(_0x1871cf['body']['id']){delete _0x1871cf[_0x6abb('0x4d')]['id'];}return db['SugarcrmAccount'][_0x6abb('0x4b')]({'where':{'id':_0x1871cf[_0x6abb('0x49')]['id']}})['then'](handleEntityNotFound(_0x4dfcdf,null))[_0x6abb('0x24')](saveUpdates(_0x1871cf[_0x6abb('0x4d')],null))[_0x6abb('0x24')](respondWithResult(_0x4dfcdf,null))[_0x6abb('0x47')](handleError(_0x4dfcdf,null));};exports[_0x6abb('0x25')]=function(_0x304e99,_0x1b94b7){return db[_0x6abb('0x2d')][_0x6abb('0x4b')]({'where':{'id':_0x304e99[_0x6abb('0x49')]['id']}})['then'](handleEntityNotFound(_0x1b94b7,null))[_0x6abb('0x24')](removeEntity(_0x1b94b7,null))[_0x6abb('0x47')](handleError(_0x1b94b7,null));};exports['getConfigurations']=function(_0x2d0023,_0x196249,_0x3b3fca){var _0x3d7816={};var _0x50c13a={};var _0x38cf41;var _0x3358d6;return db[_0x6abb('0x2d')][_0x6abb('0x4e')]({'where':{'id':_0x2d0023['params']['id']}})[_0x6abb('0x24')](handleEntityNotFound(_0x196249,null))[_0x6abb('0x24')](function(_0x33c138){if(_0x33c138){_0x38cf41=_0x33c138;_0x50c13a[_0x6abb('0x32')]=_[_0x6abb('0x4a')](db[_0x6abb('0x4f')][_0x6abb('0x2e')]);_0x50c13a[_0x6abb('0x33')]=_[_0x6abb('0x4a')](_0x2d0023['query']);_0x50c13a[_0x6abb('0x34')]=_[_0x6abb('0x35')](_0x50c13a[_0x6abb('0x32')],_0x50c13a[_0x6abb('0x33')]);_0x3d7816[_0x6abb('0x37')]=_[_0x6abb('0x35')](_0x50c13a[_0x6abb('0x32')],qs[_0x6abb('0x36')](_0x2d0023['query']['fields']));_0x3d7816[_0x6abb('0x37')]=_0x3d7816[_0x6abb('0x37')][_0x6abb('0x38')]?_0x3d7816[_0x6abb('0x37')]:_0x50c13a['model'];_0x3d7816['order']=qs[_0x6abb('0x3c')](_0x2d0023[_0x6abb('0x33')][_0x6abb('0x3c')]);_0x3d7816[_0x6abb('0x3d')]=qs[_0x6abb('0x34')](_[_0x6abb('0x3e')](_0x2d0023[_0x6abb('0x33')],_0x50c13a[_0x6abb('0x34')]));if(_0x2d0023[_0x6abb('0x33')][_0x6abb('0x3f')]){_0x3d7816[_0x6abb('0x3d')]=_[_0x6abb('0x40')](_0x3d7816['where'],{'$or':_[_0x6abb('0x2c')](_0x3d7816[_0x6abb('0x37')],function(_0x5a0a5d){var _0x15745c={};_0x15745c[_0x5a0a5d]={'$like':'%'+_0x2d0023['query'][_0x6abb('0x3f')]+'%'};return _0x15745c;})});}_0x3d7816=_[_0x6abb('0x40')]({},_0x3d7816,_0x2d0023['options']);return _0x38cf41[_0x6abb('0x50')](_0x3d7816);}})[_0x6abb('0x24')](function(_0x745d5e){if(_0x745d5e){_0x3358d6=_0x745d5e[_0x6abb('0x38')];if(!_0x2d0023['query'][_0x6abb('0x39')](_0x6abb('0x3a'))){_0x3d7816[_0x6abb('0x1c')]=qs[_0x6abb('0x1c')](_0x2d0023[_0x6abb('0x33')][_0x6abb('0x1c')]);_0x3d7816[_0x6abb('0x1e')]=qs[_0x6abb('0x1e')](_0x2d0023[_0x6abb('0x33')][_0x6abb('0x1e')]);}return _0x38cf41[_0x6abb('0x50')](_0x3d7816);}})[_0x6abb('0x24')](function(_0x307ab2){if(_0x307ab2){return _0x307ab2?{'count':_0x3358d6,'rows':_0x307ab2}:null;}})[_0x6abb('0x24')](respondWithResult(_0x196249,null))[_0x6abb('0x47')](handleError(_0x196249,null));};exports['addConfiguration']=function(_0x115a00,_0x468e53,_0x44e0e9){if(_0x115a00[_0x6abb('0x4d')]['id']){delete _0x115a00['body']['id'];}return db[_0x6abb('0x2d')][_0x6abb('0x4e')]({'where':{'id':_0x115a00[_0x6abb('0x49')]['id']}})['then'](handleEntityNotFound(_0x468e53,null))['then'](function(_0x5f057a){if(_0x5f057a){_0x115a00[_0x6abb('0x4d')]['AccountId']=_0x5f057a['id'];_0x115a00[_0x6abb('0x4d')][_0x6abb('0x51')]=integrations['getSubjects'](_0x115a00[_0x6abb('0x4d')]['channel'],_0x115a00[_0x6abb('0x4d')][_0x6abb('0x30')]);_0x115a00[_0x6abb('0x4d')]['Descriptions']=integrations[_0x6abb('0x52')](_0x115a00[_0x6abb('0x4d')][_0x6abb('0x53')],_0x115a00[_0x6abb('0x4d')][_0x6abb('0x30')]);return db['SugarcrmConfiguration'][_0x6abb('0x4c')](_0x115a00[_0x6abb('0x4d')],{'include':[{'model':db[_0x6abb('0x54')],'as':'Subjects'},{'model':db[_0x6abb('0x54')],'as':'Descriptions'}]});}return null;})[_0x6abb('0x24')](respondWithResult(_0x468e53,null))['catch'](handleError(_0x468e53,null));};exports['getFields']=function(_0x2837f6,_0x260ce1,_0x443f1e){var _0x4cfbd6='';var _0x3aff05=['id',_0x6abb('0x29'),'assigned_user_id',_0x6abb('0x55'),'description',_0x6abb('0x56'),_0x6abb('0x57'),'duration_minutes','parent_id',_0x6abb('0x58'),'parent_name','direction'];return db['SugarcrmAccount'][_0x6abb('0x4e')]({'where':{'id':_0x2837f6[_0x6abb('0x49')]['id']},'attributes':['id',_0x6abb('0x59'),_0x6abb('0x5a'),_0x6abb('0x5b')]})['then'](handleEntityNotFound(_0x260ce1,null))[_0x6abb('0x24')](function(_0x359a0c){if(_0x359a0c){_0x4cfbd6=_0x359a0c[_0x6abb('0x5b')];var _0x5c6d0a=_0x4cfbd6[_0x6abb('0x5c')](-0x1);if(_0x5c6d0a==='/'){_0x4cfbd6=_0x4cfbd6[_0x6abb('0x5d')](0x0,_0x4cfbd6['lastIndexOf'](_0x5c6d0a));}return rp({'method':_0x6abb('0x5e'),'uri':util[_0x6abb('0x5f')]('%s%s',_0x4cfbd6,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x6abb('0x60'),'input_type':_0x6abb('0x61'),'response_type':_0x6abb('0x61'),'rest_data':JSON[_0x6abb('0x62')]({'user_auth':{'user_name':_0x359a0c[_0x6abb('0x59')],'password':_0x359a0c[_0x6abb('0x5a')],'encryption':_0x6abb('0x63')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x6abb('0x24')](function(_0x58bcdc){if(_0x58bcdc&&_0x58bcdc[_0x6abb('0x29')]!=='Invalid\x20Login'&&_0x58bcdc[_0x6abb('0x29')]!==_0x6abb('0x64')){return rp({'method':_0x6abb('0x5e'),'uri':util['format'](_0x6abb('0x65'),_0x4cfbd6,_0x6abb('0x66')),'json':!![],'form':{'method':_0x6abb('0x67'),'input_type':_0x6abb('0x61'),'response_type':_0x6abb('0x61'),'rest_data':JSON[_0x6abb('0x62')]({'session':_0x58bcdc['id'],'module_name':_0x6abb('0x68')})}})[_0x6abb('0x24')](function(_0x39d141){if(_0x39d141){var _0x2443cc=_[_0x6abb('0x69')](_0x39d141[_0x6abb('0x6a')]);_[_0x6abb('0x6b')](_0x2443cc,function(_0x48e794){return _0x3aff05[_0x6abb('0x6c')](_0x48e794['name']);});return{'count':_0x2443cc[_0x6abb('0x38')],'rows':_['map'](_0x2443cc,function(_0xdaedc6){return{'id':_0xdaedc6[_0x6abb('0x29')],'name':_0xdaedc6[_0x6abb('0x6d')],'custom':_[_0x6abb('0x6e')](_0xdaedc6[_0x6abb('0x29')],'_c')?!![]:![],'options':_0xdaedc6['options']?_[_0x6abb('0x2c')](_[_0x6abb('0x69')](_0xdaedc6[_0x6abb('0x42')]),function(_0x4ddb24){return{'name':_0x4ddb24['value'],'value':_0x4ddb24[_0x6abb('0x29')]};}):[]};})};}})[_0x6abb('0x24')](respondWithResult(_0x260ce1,null))[_0x6abb('0x47')](function(_0x33d7cb){var _0x3dfa0f=_0x2837f6['query'][_0x6abb('0x6f')]?0x1f4:_0x33d7cb[_0x6abb('0x70')]||0x1f4;logger[_0x6abb('0x27')](_0x6abb('0x71'),_0x6abb('0x72'),_0x3dfa0f,JSON[_0x6abb('0x62')](_0x33d7cb));delete _0x33d7cb[_0x6abb('0x29')];if(_0x3dfa0f===0x191){_0x3dfa0f=0x190;}_0x260ce1[_0x6abb('0x18')](_0x3dfa0f)['send'](_0x2837f6[_0x6abb('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x33d7cb[_0x6abb('0x70')]}:_0x33d7cb);});}else{var _0x41568a=0x1f4;_0x260ce1[_0x6abb('0x18')](_0x41568a)[_0x6abb('0x2a')]({'message':_0x6abb('0x73'),'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 07b142b..93cb02a 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 _0x7605=['define','SugarcrmAccount','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x37ca17,_0x11378a){var _0x266db7=function(_0x3f7c3b){while(--_0x3f7c3b){_0x37ca17['push'](_0x37ca17['shift']());}};_0x266db7(++_0x11378a);}(_0x7605,0xc2));var _0x5760=function(_0x23bebe,_0x4290c){_0x23bebe=_0x23bebe-0x0;var _0x18502f=_0x7605[_0x23bebe];return _0x18502f;};'use strict';var _=require('lodash');var util=require(_0x5760('0x0'));var logger=require(_0x5760('0x1'))(_0x5760('0x2'));var moment=require('moment');var BPromise=require(_0x5760('0x3'));var rp=require(_0x5760('0x4'));var fs=require('fs');var path=require(_0x5760('0x5'));var rimraf=require('rimraf');var config=require(_0x5760('0x6'));var attributes=require(_0x5760('0x7'));var integrations=require(_0x5760('0x8'));module[_0x5760('0x9')]=function(_0x5052ad,_0x564ef5){return _0x5052ad[_0x5760('0xa')](_0x5760('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6174=['bluebird','request-promise','exports','SugarcrmAccount','util','../../config/logger','moment'];(function(_0x572fdd,_0x3aaa57){var _0x15905c=function(_0x4e4970){while(--_0x4e4970){_0x572fdd['push'](_0x572fdd['shift']());}};_0x15905c(++_0x3aaa57);}(_0x6174,0x1af));var _0x4617=function(_0x63423a,_0x1a3c4e){_0x63423a=_0x63423a-0x0;var _0x83538b=_0x6174[_0x63423a];return _0x83538b;};'use strict';var _=require('lodash');var util=require(_0x4617('0x0'));var logger=require(_0x4617('0x1'))('api');var moment=require(_0x4617('0x2'));var BPromise=require(_0x4617('0x3'));var rp=require(_0x4617('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4617('0x5')]=function(_0x32e0d0,_0x533572){return _0x32e0d0['define'](_0x4617('0x6'),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 61618f4..7d768ca 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 _0x30b8=['info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options','raw','attributes','limit','include','model','map','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x30b8,0x9e));var _0x830b=function(_0x3cafea,_0x3ffede){_0x3cafea=_0x3cafea-0x0;var _0xd4d7c4=_0x30b8[_0x3cafea];return _0xd4d7c4;};'use strict';var _=require(_0x830b('0x0'));var util=require(_0x830b('0x1'));var moment=require(_0x830b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x830b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x830b('0x4'));var logger=require(_0x830b('0x5'))(_0x830b('0x6'));var config=require(_0x830b('0x7'));var jayson=require(_0x830b('0x8'));var client=jayson['client'][_0x830b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43cf8a,_0x30e563,_0x51beb0){return new BPromise(function(_0x3e190c,_0x1dd4f){return client[_0x830b('0xa')](_0x43cf8a,_0x51beb0)[_0x830b('0xb')](function(_0x21e693){logger[_0x830b('0xc')](_0x830b('0xd'),_0x30e563,_0x830b('0xe'));logger[_0x830b('0xf')](_0x830b('0x10'),_0x30e563,_0x830b('0xe'),JSON[_0x830b('0x11')](_0x21e693));if(_0x21e693[_0x830b('0x12')]){if(_0x21e693[_0x830b('0x12')][_0x830b('0x13')]===0x1f4){logger[_0x830b('0x12')](_0x830b('0xd'),_0x30e563,_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);return _0x1dd4f(_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);}logger[_0x830b('0x12')](_0x830b('0xd'),_0x30e563,_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);return _0x3e190c(_0x21e693[_0x830b('0x12')][_0x830b('0x14')]);}else{logger[_0x830b('0xc')](_0x830b('0xd'),_0x30e563,_0x830b('0xe'));_0x3e190c(_0x21e693[_0x830b('0x15')][_0x830b('0x14')]);}})['catch'](function(_0x5a16bf){logger[_0x830b('0x12')](_0x830b('0xd'),_0x30e563,_0x5a16bf);_0x1dd4f(_0x5a16bf);});});}exports['GetSugarcrmAccount']=function(_0x4cf749){var _0x71c50c=this;return new Promise(function(_0x5a882a,_0x49b6f3){return db['SugarcrmAccount'][_0x830b('0x16')]({'raw':_0x4cf749[_0x830b('0x17')]?_0x4cf749['options'][_0x830b('0x18')]===undefined?!![]:![]:!![],'where':_0x4cf749['options']?_0x4cf749[_0x830b('0x17')]['where']||null:null,'attributes':_0x4cf749[_0x830b('0x17')]?_0x4cf749[_0x830b('0x17')][_0x830b('0x19')]||null:null,'limit':_0x4cf749[_0x830b('0x17')]?_0x4cf749[_0x830b('0x17')][_0x830b('0x1a')]||null:null,'include':_0x4cf749[_0x830b('0x17')]?_0x4cf749['options'][_0x830b('0x1b')]?_['map'](_0x4cf749[_0x830b('0x17')][_0x830b('0x1b')],function(_0x22bc98){return{'model':db[_0x22bc98[_0x830b('0x1c')]],'as':_0x22bc98['as'],'attributes':_0x22bc98['attributes'],'include':_0x22bc98[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x22bc98['include'],function(_0x1d2c85){return{'model':db[_0x1d2c85['model']],'as':_0x1d2c85['as'],'attributes':_0x1d2c85[_0x830b('0x19')],'include':_0x1d2c85[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x1d2c85[_0x830b('0x1b')],function(_0x5a620b){return{'model':db[_0x5a620b[_0x830b('0x1c')]],'as':_0x5a620b['as'],'attributes':_0x5a620b[_0x830b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49e5e7){logger[_0x830b('0xc')]('GetSugarcrmAccount',_0x4cf749);logger[_0x830b('0xf')](_0x830b('0x1e'),_0x4cf749,JSON[_0x830b('0x11')](_0x49e5e7));_0x5a882a(_0x49e5e7);})['catch'](function(_0x21ebd2){logger[_0x830b('0x12')](_0x830b('0x1e'),_0x21ebd2['message'],_0x4cf749);_0x49b6f3(_0x71c50c['error'](0x1f4,_0x21ebd2[_0x830b('0x14')]));});});};exports[_0x830b('0x1f')]=function(_0x20d044){var _0x56c19a=this;return new Promise(function(_0x26cc9b,_0x2fce13){return db[_0x830b('0x20')]['find']({'raw':_0x20d044[_0x830b('0x17')]?_0x20d044[_0x830b('0x17')][_0x830b('0x18')]===undefined?!![]:![]:!![],'where':_0x20d044['options']?_0x20d044['options']['where']||null:null,'attributes':_0x20d044['options']?_0x20d044[_0x830b('0x17')][_0x830b('0x19')]||null:null,'include':_0x20d044[_0x830b('0x17')]?_0x20d044[_0x830b('0x17')]['include']?_[_0x830b('0x1d')](_0x20d044['options'][_0x830b('0x1b')],function(_0x6a648c){return{'model':db[_0x6a648c['model']],'as':_0x6a648c['as'],'attributes':_0x6a648c[_0x830b('0x19')],'include':_0x6a648c[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x6a648c[_0x830b('0x1b')],function(_0x4d5438){return{'model':db[_0x4d5438['model']],'as':_0x4d5438['as'],'attributes':_0x4d5438[_0x830b('0x19')],'include':_0x4d5438[_0x830b('0x1b')]?_[_0x830b('0x1d')](_0x4d5438[_0x830b('0x1b')],function(_0x36c9ba){return{'model':db[_0x36c9ba[_0x830b('0x1c')]],'as':_0x36c9ba['as'],'attributes':_0x36c9ba[_0x830b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x830b('0xb')](function(_0x272984){logger['info'](_0x830b('0x1f'),_0x20d044);logger[_0x830b('0xf')](_0x830b('0x1f'),_0x20d044,JSON[_0x830b('0x11')](_0x272984));_0x26cc9b(_0x272984);})[_0x830b('0x21')](function(_0x5201dd){logger['error']('ShowSugarcrmAccount',_0x5201dd['message'],_0x20d044);_0x2fce13(_0x56c19a[_0x830b('0x12')](0x1f4,_0x5201dd[_0x830b('0x14')]));});});}; \ No newline at end of file +var _0x26fd=['code','message','result','catch','SugarcrmAccount','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x85d56d,_0x37f5c1){var _0x51f613=function(_0x4927df){while(--_0x4927df){_0x85d56d['push'](_0x85d56d['shift']());}};_0x51f613(++_0x37f5c1);}(_0x26fd,0x7c));var _0xd26f=function(_0x4c9f70,_0x53990b){_0x4c9f70=_0x4c9f70-0x0;var _0x3b1dd9=_0x26fd[_0x4c9f70];return _0x3b1dd9;};'use strict';var _=require(_0xd26f('0x0'));var util=require(_0xd26f('0x1'));var moment=require(_0xd26f('0x2'));var BPromise=require(_0xd26f('0x3'));var rs=require(_0xd26f('0x4'));var fs=require('fs');var Redis=require(_0xd26f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd26f('0x6'));var logger=require('../../config/logger')(_0xd26f('0x7'));var config=require(_0xd26f('0x8'));var jayson=require(_0xd26f('0x9'));var client=jayson['client'][_0xd26f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2070,_0x29825f,_0x5acadf){return new BPromise(function(_0x40ea49,_0x3a9233){return client[_0xd26f('0xb')](_0x3e2070,_0x5acadf)[_0xd26f('0xc')](function(_0x781b25){logger[_0xd26f('0xd')](_0xd26f('0xe'),_0x29825f,_0xd26f('0xf'));logger[_0xd26f('0x10')](_0xd26f('0x11'),_0x29825f,_0xd26f('0xf'),JSON[_0xd26f('0x12')](_0x781b25));if(_0x781b25[_0xd26f('0x13')]){if(_0x781b25['error'][_0xd26f('0x14')]===0x1f4){logger[_0xd26f('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x29825f,_0x781b25['error'][_0xd26f('0x15')]);return _0x3a9233(_0x781b25[_0xd26f('0x13')]['message']);}logger[_0xd26f('0x13')](_0xd26f('0xe'),_0x29825f,_0x781b25[_0xd26f('0x13')][_0xd26f('0x15')]);return _0x40ea49(_0x781b25[_0xd26f('0x13')]['message']);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x29825f,_0xd26f('0xf'));_0x40ea49(_0x781b25[_0xd26f('0x16')]['message']);}})[_0xd26f('0x17')](function(_0xfbdbbb){logger[_0xd26f('0x13')](_0xd26f('0xe'),_0x29825f,_0xfbdbbb);_0x3a9233(_0xfbdbbb);});});}exports['GetSugarcrmAccount']=function(_0x158ffb){var _0x4f702d=this;return new Promise(function(_0x45a8c2,_0x57f363){return db[_0xd26f('0x18')]['findAll']({'raw':_0x158ffb[_0xd26f('0x19')]?_0x158ffb[_0xd26f('0x19')][_0xd26f('0x1a')]===undefined?!![]:![]:!![],'where':_0x158ffb[_0xd26f('0x19')]?_0x158ffb['options'][_0xd26f('0x1b')]||null:null,'attributes':_0x158ffb[_0xd26f('0x19')]?_0x158ffb[_0xd26f('0x19')][_0xd26f('0x1c')]||null:null,'limit':_0x158ffb['options']?_0x158ffb['options'][_0xd26f('0x1d')]||null:null,'include':_0x158ffb[_0xd26f('0x19')]?_0x158ffb[_0xd26f('0x19')][_0xd26f('0x1e')]?_[_0xd26f('0x1f')](_0x158ffb[_0xd26f('0x19')][_0xd26f('0x1e')],function(_0xd14d4){return{'model':db[_0xd14d4['model']],'as':_0xd14d4['as'],'attributes':_0xd14d4['attributes'],'include':_0xd14d4[_0xd26f('0x1e')]?_[_0xd26f('0x1f')](_0xd14d4['include'],function(_0x226f8f){return{'model':db[_0x226f8f[_0xd26f('0x20')]],'as':_0x226f8f['as'],'attributes':_0x226f8f[_0xd26f('0x1c')],'include':_0x226f8f[_0xd26f('0x1e')]?_[_0xd26f('0x1f')](_0x226f8f['include'],function(_0x241787){return{'model':db[_0x241787['model']],'as':_0x241787['as'],'attributes':_0x241787['attributes']};}):[]};}):[]};}):[]:[]})[_0xd26f('0xc')](function(_0xf7a249){logger['info'](_0xd26f('0x21'),_0x158ffb);logger[_0xd26f('0x10')](_0xd26f('0x21'),_0x158ffb,JSON[_0xd26f('0x12')](_0xf7a249));_0x45a8c2(_0xf7a249);})[_0xd26f('0x17')](function(_0x33d409){logger[_0xd26f('0x13')](_0xd26f('0x21'),_0x33d409[_0xd26f('0x15')],_0x158ffb);_0x57f363(_0x4f702d[_0xd26f('0x13')](0x1f4,_0x33d409['message']));});});};exports[_0xd26f('0x22')]=function(_0xfdb1f3){var _0x3dbdda=this;return new Promise(function(_0x2c0131,_0x291fa3){return db[_0xd26f('0x18')][_0xd26f('0x23')]({'raw':_0xfdb1f3[_0xd26f('0x19')]?_0xfdb1f3['options'][_0xd26f('0x1a')]===undefined?!![]:![]:!![],'where':_0xfdb1f3[_0xd26f('0x19')]?_0xfdb1f3[_0xd26f('0x19')][_0xd26f('0x1b')]||null:null,'attributes':_0xfdb1f3[_0xd26f('0x19')]?_0xfdb1f3['options'][_0xd26f('0x1c')]||null:null,'include':_0xfdb1f3[_0xd26f('0x19')]?_0xfdb1f3[_0xd26f('0x19')][_0xd26f('0x1e')]?_[_0xd26f('0x1f')](_0xfdb1f3[_0xd26f('0x19')]['include'],function(_0x1b14cb){return{'model':db[_0x1b14cb[_0xd26f('0x20')]],'as':_0x1b14cb['as'],'attributes':_0x1b14cb[_0xd26f('0x1c')],'include':_0x1b14cb[_0xd26f('0x1e')]?_['map'](_0x1b14cb[_0xd26f('0x1e')],function(_0x19241d){return{'model':db[_0x19241d[_0xd26f('0x20')]],'as':_0x19241d['as'],'attributes':_0x19241d[_0xd26f('0x1c')],'include':_0x19241d[_0xd26f('0x1e')]?_[_0xd26f('0x1f')](_0x19241d['include'],function(_0x39f1cd){return{'model':db[_0x39f1cd['model']],'as':_0x39f1cd['as'],'attributes':_0x39f1cd[_0xd26f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfadcc4){logger[_0xd26f('0xd')](_0xd26f('0x22'),_0xfdb1f3);logger[_0xd26f('0x10')]('ShowSugarcrmAccount',_0xfdb1f3,JSON[_0xd26f('0x12')](_0xfadcc4));_0x2c0131(_0xfadcc4);})[_0xd26f('0x17')](function(_0x350e5d){logger[_0xd26f('0x13')]('ShowSugarcrmAccount',_0x350e5d[_0xd26f('0x15')],_0xfdb1f3);_0x291fa3(_0x3dbdda[_0xd26f('0x13')](0x1f4,_0x350e5d['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index f2b30e2..af07307 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 _0x0607=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','put','update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3b72ab,_0x306780){var _0x1c0e3c=function(_0x448cf6){while(--_0x448cf6){_0x3b72ab['push'](_0x3b72ab['shift']());}};_0x1c0e3c(++_0x306780);}(_0x0607,0xe7));var _0x7060=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0607[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7060('0x0'));var express=require(_0x7060('0x1'));var router=express[_0x7060('0x2')]();var fs_extra=require(_0x7060('0x3'));var auth=require(_0x7060('0x4'));var interaction=require(_0x7060('0x5'));var config=require(_0x7060('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x7060('0x7')]('/',auth[_0x7060('0x8')](),controller[_0x7060('0x9')]);router[_0x7060('0x7')](_0x7060('0xa'),auth[_0x7060('0x8')](),controller[_0x7060('0xb')]);router[_0x7060('0x7')](_0x7060('0xc'),auth[_0x7060('0x8')](),controller['getFields']);router[_0x7060('0x7')](_0x7060('0xd'),auth[_0x7060('0x8')](),controller[_0x7060('0xe')]);router[_0x7060('0x7')](_0x7060('0xf'),auth[_0x7060('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x7060('0x8')](),controller['create']);router[_0x7060('0x10')](_0x7060('0xa'),auth[_0x7060('0x8')](),controller[_0x7060('0x11')]);router[_0x7060('0x12')](_0x7060('0xa'),auth[_0x7060('0x8')](),controller['destroy']);module[_0x7060('0x13')]=router; \ No newline at end of file +var _0xe608=['getFields','/:id/subjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','show'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe608,0x1cd));var _0x8e60=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0xe608[_0x3c6b7d];return _0x1d3ed2;};'use strict';var multer=require(_0x8e60('0x0'));var util=require(_0x8e60('0x1'));var path=require(_0x8e60('0x2'));var timeout=require(_0x8e60('0x3'));var express=require('express');var router=express[_0x8e60('0x4')]();var fs_extra=require(_0x8e60('0x5'));var auth=require(_0x8e60('0x6'));var interaction=require(_0x8e60('0x7'));var config=require(_0x8e60('0x8'));var controller=require(_0x8e60('0x9'));router['get']('/',auth[_0x8e60('0xa')](),controller[_0x8e60('0xb')]);router[_0x8e60('0xc')]('/:id',auth[_0x8e60('0xa')](),controller[_0x8e60('0xd')]);router[_0x8e60('0xc')]('/:id/fields',auth[_0x8e60('0xa')](),controller[_0x8e60('0xe')]);router[_0x8e60('0xc')](_0x8e60('0xf'),auth[_0x8e60('0xa')](),controller['getSubjects']);router[_0x8e60('0xc')]('/:id/descriptions',auth[_0x8e60('0xa')](),controller[_0x8e60('0x10')]);router[_0x8e60('0x11')]('/',auth[_0x8e60('0xa')](),controller[_0x8e60('0x12')]);router[_0x8e60('0x13')](_0x8e60('0x14'),auth['isAuthenticated'](),controller[_0x8e60('0x15')]);router[_0x8e60('0x16')](_0x8e60('0x14'),auth[_0x8e60('0xa')](),controller[_0x8e60('0x17')]);module[_0x8e60('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index d6508c7..c3b2c1b 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 _0x138b=['STRING','sequelize'];(function(_0x4f8a14,_0x41bb12){var _0x1627d7=function(_0x357866){while(--_0x357866){_0x4f8a14['push'](_0x4f8a14['shift']());}};_0x1627d7(++_0x41bb12);}(_0x138b,0x65));var _0xb138=function(_0xa16fa5,_0x39ed8a){_0xa16fa5=_0xa16fa5-0x0;var _0x44e544=_0x138b[_0xa16fa5];return _0x44e544;};'use strict';var Sequelize=require(_0xb138('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb138('0x1')]}}; \ No newline at end of file +var _0x4a7d=['sequelize','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4a7d,0xf9));var _0xd4a7=function(_0x43caf0,_0x5825e4){_0x43caf0=_0x43caf0-0x0;var _0x16cc04=_0x4a7d[_0x43caf0];return _0x16cc04;};'use strict';var Sequelize=require(_0xd4a7('0x0'));module[_0xd4a7('0x1')]={'name':{'type':Sequelize[_0xd4a7('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e0b6603..f98b79c 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 _0x8d2b=['SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','length','create','body','find','getFields','findOne','order','nolimit','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','request-promise','mustache','util','sox','ejs','lodash','squel','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x8d2b,0x10a));var _0xb8d2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8d2b[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xb8d2('0x0'));var rimraf=require(_0xb8d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb8d2('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb8d2('0x3'));var util=require(_0xb8d2('0x4'));var path=require('path');var sox=require(_0xb8d2('0x5'));var csv=require('to-csv');var ejs=require(_0xb8d2('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb8d2('0x7'));var squel=require(_0xb8d2('0x8'));var crypto=require('crypto');var jsforce=require(_0xb8d2('0x9'));var deskjs=require(_0xb8d2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb8d2('0xb'));var Papa=require('papaparse');var Redis=require(_0xb8d2('0xc'));var authService=require(_0xb8d2('0xd'));var qs=require(_0xb8d2('0xe'));var as=require(_0xb8d2('0xf'));var hardwareService=require(_0xb8d2('0x10'));var logger=require(_0xb8d2('0x11'))(_0xb8d2('0x12'));var utils=require(_0xb8d2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb8d2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ad3ff,_0x366af2){_0x366af2=_0x366af2||0xcc;return function(_0x18b1be){if(_0x18b1be){return _0x4ad3ff[_0xb8d2('0x15')](_0x366af2);}return _0x4ad3ff[_0xb8d2('0x16')](_0x366af2)[_0xb8d2('0x17')]();};}function respondWithResult(_0x45aef0,_0x307939){_0x307939=_0x307939||0xc8;return function(_0x7899c7){if(_0x7899c7){return _0x45aef0[_0xb8d2('0x16')](_0x307939)[_0xb8d2('0x18')](_0x7899c7);}};}function respondWithFilteredResult(_0x5f4fb0,_0x5cc281){return function(_0x18cc72){if(_0x18cc72){var _0x151130=typeof _0x5cc281[_0xb8d2('0x19')]===_0xb8d2('0x1a')&&typeof _0x5cc281['limit']===_0xb8d2('0x1a');var _0x41e5a5=_0x18cc72[_0xb8d2('0x1b')];var _0x2de715=_0x151130?0x0:_0x5cc281[_0xb8d2('0x19')];var _0x18a9aa=_0x151130?_0x18cc72[_0xb8d2('0x1b')]:_0x5cc281[_0xb8d2('0x19')]+_0x5cc281[_0xb8d2('0x1c')];var _0x4d65a9;if(_0x18a9aa>=_0x41e5a5){_0x18a9aa=_0x41e5a5;_0x4d65a9=0xc8;}else{_0x4d65a9=0xce;}_0x5f4fb0[_0xb8d2('0x16')](_0x4d65a9);return _0x5f4fb0[_0xb8d2('0x1d')](_0xb8d2('0x1e'),_0x2de715+'-'+_0x18a9aa+'/'+_0x41e5a5)['json'](_0x18cc72);}return null;};}function patchUpdates(_0x1fba04){return function(_0x59d44e){try{jsonpatch[_0xb8d2('0x1f')](_0x59d44e,_0x1fba04,!![]);}catch(_0x5cb956){return BPromise[_0xb8d2('0x20')](_0x5cb956);}return _0x59d44e[_0xb8d2('0x21')]();};}function saveUpdates(_0x5dcd31,_0x233600){return function(_0x41e363){if(_0x41e363){return _0x41e363[_0xb8d2('0x22')](_0x5dcd31)[_0xb8d2('0x23')](function(_0x685e8a){return _0x685e8a;});}return null;};}function removeEntity(_0x527be0,_0x27de43){return function(_0x5d4408){if(_0x5d4408){return _0x5d4408[_0xb8d2('0x24')]()['then'](function(){_0x527be0['status'](0xcc)[_0xb8d2('0x17')]();});}};}function handleEntityNotFound(_0x315b64,_0x264bfc){return function(_0x1897c9){if(!_0x1897c9){_0x315b64[_0xb8d2('0x15')](0x194);}return _0x1897c9;};}function handleError(_0x2ca9c4,_0x9b1763){_0x9b1763=_0x9b1763||0x1f4;return function(_0xc22ee8){logger[_0xb8d2('0x25')](_0xc22ee8[_0xb8d2('0x26')]);if(_0xc22ee8[_0xb8d2('0x27')]){delete _0xc22ee8[_0xb8d2('0x27')];}_0x2ca9c4[_0xb8d2('0x16')](_0x9b1763)[_0xb8d2('0x28')](_0xc22ee8);};}exports['index']=function(_0x146cc5,_0x26a061){var _0x3a8343={},_0x4b0ed5={},_0x5ea953={'count':0x0,'rows':[]};var _0x457655=_[_0xb8d2('0x29')](db[_0xb8d2('0x2a')][_0xb8d2('0x2b')],function(_0x3b784e){return{'name':_0x3b784e[_0xb8d2('0x2c')],'type':_0x3b784e[_0xb8d2('0x2d')]['key']};});_0x4b0ed5[_0xb8d2('0x2e')]=_[_0xb8d2('0x29')](_0x457655,_0xb8d2('0x27'));_0x4b0ed5[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x146cc5[_0xb8d2('0x2f')]);_0x4b0ed5[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0x4b0ed5['model'],_0x4b0ed5[_0xb8d2('0x2f')]);_0x3a8343[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0x4b0ed5['model'],qs[_0xb8d2('0x34')](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x34')]));_0x3a8343[_0xb8d2('0x33')]=_0x3a8343[_0xb8d2('0x33')]['length']?_0x3a8343[_0xb8d2('0x33')]:_0x4b0ed5[_0xb8d2('0x2e')];if(!_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x35')]('nolimit')){_0x3a8343[_0xb8d2('0x1c')]=qs[_0xb8d2('0x1c')](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x1c')]);_0x3a8343[_0xb8d2('0x19')]=qs[_0xb8d2('0x19')](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x19')]);}_0x3a8343['order']=qs['sort'](_0x146cc5[_0xb8d2('0x2f')][_0xb8d2('0x36')]);_0x3a8343[_0xb8d2('0x37')]=qs[_0xb8d2('0x31')](_[_0xb8d2('0x38')](_0x146cc5[_0xb8d2('0x2f')],_0x4b0ed5[_0xb8d2('0x31')]),_0x457655);if(_0x146cc5['query']['filter']){_0x3a8343['where']=_[_0xb8d2('0x39')](_0x3a8343[_0xb8d2('0x37')],{'$or':_[_0xb8d2('0x29')](_0x457655,function(_0x28d317){if(_0x28d317[_0xb8d2('0x2d')]!=='VIRTUAL'){var _0x28113e={};_0x28113e[_0x28d317[_0xb8d2('0x27')]]={'$like':'%'+_0x146cc5['query'][_0xb8d2('0x3a')]+'%'};return _0x28113e;}})});}_0x3a8343=_['merge']({},_0x3a8343,_0x146cc5[_0xb8d2('0x3b')]);var _0x63b77e={'where':_0x3a8343['where']};return db['SugarcrmConfiguration'][_0xb8d2('0x1b')](_0x63b77e)[_0xb8d2('0x23')](function(_0x2b0657){_0x5ea953[_0xb8d2('0x1b')]=_0x2b0657;if(_0x146cc5['query']['includeAll']){_0x3a8343[_0xb8d2('0x3c')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xb8d2('0x3d')](_0x3a8343);})[_0xb8d2('0x23')](function(_0x2180b6){_0x5ea953[_0xb8d2('0x3e')]=_0x2180b6;return _0x5ea953;})[_0xb8d2('0x23')](respondWithFilteredResult(_0x26a061,_0x3a8343))[_0xb8d2('0x3f')](handleError(_0x26a061,null));};exports[_0xb8d2('0x40')]=function(_0x30836b,_0x92b757){var _0x51f9a0={'raw':![],'where':{'id':_0x30836b[_0xb8d2('0x41')]['id']}},_0x10ecda={};_0x10ecda[_0xb8d2('0x2e')]=_['keys'](db[_0xb8d2('0x2a')][_0xb8d2('0x2b')]);_0x10ecda[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x30836b[_0xb8d2('0x2f')]);_0x10ecda[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0x10ecda[_0xb8d2('0x2e')],_0x10ecda[_0xb8d2('0x2f')]);_0x51f9a0[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0x10ecda[_0xb8d2('0x2e')],qs['fields'](_0x30836b[_0xb8d2('0x2f')][_0xb8d2('0x34')]));_0x51f9a0[_0xb8d2('0x33')]=_0x51f9a0[_0xb8d2('0x33')][_0xb8d2('0x42')]?_0x51f9a0[_0xb8d2('0x33')]:_0x10ecda[_0xb8d2('0x2e')];if(_0x30836b[_0xb8d2('0x2f')]['includeAll']){_0x51f9a0[_0xb8d2('0x3c')]=[{'all':!![]}];}_0x51f9a0=_[_0xb8d2('0x39')]({},_0x51f9a0,_0x30836b[_0xb8d2('0x3b')]);return db['SugarcrmConfiguration']['find'](_0x51f9a0)[_0xb8d2('0x23')](handleEntityNotFound(_0x92b757,null))[_0xb8d2('0x23')](respondWithResult(_0x92b757,null))[_0xb8d2('0x3f')](handleError(_0x92b757,null));};exports[_0xb8d2('0x43')]=function(_0x4bc7aa,_0x3fe1ab){return db['SugarcrmConfiguration'][_0xb8d2('0x43')](_0x4bc7aa['body'],{})['then'](respondWithResult(_0x3fe1ab,0xc9))[_0xb8d2('0x3f')](handleError(_0x3fe1ab,null));};exports[_0xb8d2('0x22')]=function(_0x296154,_0x511c46){if(_0x296154[_0xb8d2('0x44')]['id']){delete _0x296154[_0xb8d2('0x44')]['id'];}return db[_0xb8d2('0x2a')][_0xb8d2('0x45')]({'where':{'id':_0x296154[_0xb8d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x511c46,null))[_0xb8d2('0x23')](saveUpdates(_0x296154[_0xb8d2('0x44')],null))[_0xb8d2('0x23')](respondWithResult(_0x511c46,null))[_0xb8d2('0x3f')](handleError(_0x511c46,null));};exports['destroy']=function(_0x597ff5,_0x9f174b){return db['SugarcrmConfiguration'][_0xb8d2('0x45')]({'where':{'id':_0x597ff5[_0xb8d2('0x41')]['id']}})[_0xb8d2('0x23')](handleEntityNotFound(_0x9f174b,null))[_0xb8d2('0x23')](removeEntity(_0x9f174b,null))['catch'](handleError(_0x9f174b,null));};exports[_0xb8d2('0x46')]=function(_0x11a25b,_0x1fe419,_0x3e5e25){var _0x185acb={};var _0x4cf613={};var _0x5024ae;var _0x787be;return db[_0xb8d2('0x2a')][_0xb8d2('0x47')]({'where':{'id':_0x11a25b[_0xb8d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x1fe419,null))[_0xb8d2('0x23')](function(_0x5b0fcd){if(_0x5b0fcd){_0x5024ae=_0x5b0fcd;_0x4cf613['model']=_[_0xb8d2('0x30')](db['SugarcrmField'][_0xb8d2('0x2b')]);_0x4cf613[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x11a25b[_0xb8d2('0x2f')]);_0x4cf613[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0x4cf613[_0xb8d2('0x2e')],_0x4cf613[_0xb8d2('0x2f')]);_0x185acb[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0x4cf613['model'],qs[_0xb8d2('0x34')](_0x11a25b['query']['fields']));_0x185acb['attributes']=_0x185acb['attributes'][_0xb8d2('0x42')]?_0x185acb[_0xb8d2('0x33')]:_0x4cf613[_0xb8d2('0x2e')];_0x185acb[_0xb8d2('0x48')]=qs[_0xb8d2('0x36')](_0x11a25b[_0xb8d2('0x2f')]['sort']);_0x185acb[_0xb8d2('0x37')]=qs['filters'](_[_0xb8d2('0x38')](_0x11a25b[_0xb8d2('0x2f')],_0x4cf613[_0xb8d2('0x31')]));if(_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x3a')]){_0x185acb['where']=_[_0xb8d2('0x39')](_0x185acb[_0xb8d2('0x37')],{'$or':_[_0xb8d2('0x29')](_0x185acb[_0xb8d2('0x33')],function(_0x5f21b2){var _0x462ca8={};_0x462ca8[_0x5f21b2]={'$like':'%'+_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x3a')]+'%'};return _0x462ca8;})});}_0x185acb=_[_0xb8d2('0x39')]({},_0x185acb,_0x11a25b[_0xb8d2('0x3b')]);return _0x5024ae[_0xb8d2('0x46')](_0x185acb);}})[_0xb8d2('0x23')](function(_0x1cac04){if(_0x1cac04){_0x787be=_0x1cac04[_0xb8d2('0x42')];if(!_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x35')](_0xb8d2('0x49'))){_0x185acb['limit']=qs[_0xb8d2('0x1c')](_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x1c')]);_0x185acb['offset']=qs[_0xb8d2('0x19')](_0x11a25b[_0xb8d2('0x2f')][_0xb8d2('0x19')]);}return _0x5024ae[_0xb8d2('0x46')](_0x185acb);}})[_0xb8d2('0x23')](function(_0x43ff26){if(_0x43ff26){return _0x43ff26?{'count':_0x787be,'rows':_0x43ff26}:null;}})[_0xb8d2('0x23')](respondWithResult(_0x1fe419,null))[_0xb8d2('0x3f')](handleError(_0x1fe419,null));};exports[_0xb8d2('0x4a')]=function(_0x58d6d8,_0x1feb4e,_0x35d9d3){var _0x53d5d1={};var _0xd7dda9={};var _0x4db539;var _0xe8c594;return db[_0xb8d2('0x2a')][_0xb8d2('0x47')]({'where':{'id':_0x58d6d8[_0xb8d2('0x41')]['id']}})['then'](handleEntityNotFound(_0x1feb4e,null))['then'](function(_0xce0aa0){if(_0xce0aa0){_0x4db539=_0xce0aa0;_0xd7dda9['model']=_[_0xb8d2('0x30')](db[_0xb8d2('0x4b')][_0xb8d2('0x2b')]);_0xd7dda9[_0xb8d2('0x2f')]=_[_0xb8d2('0x30')](_0x58d6d8[_0xb8d2('0x2f')]);_0xd7dda9[_0xb8d2('0x31')]=_[_0xb8d2('0x32')](_0xd7dda9[_0xb8d2('0x2e')],_0xd7dda9[_0xb8d2('0x2f')]);_0x53d5d1[_0xb8d2('0x33')]=_[_0xb8d2('0x32')](_0xd7dda9['model'],qs[_0xb8d2('0x34')](_0x58d6d8[_0xb8d2('0x2f')][_0xb8d2('0x34')]));_0x53d5d1['attributes']=_0x53d5d1['attributes'][_0xb8d2('0x42')]?_0x53d5d1[_0xb8d2('0x33')]:_0xd7dda9[_0xb8d2('0x2e')];_0x53d5d1['order']=qs[_0xb8d2('0x36')](_0x58d6d8[_0xb8d2('0x2f')]['sort']);_0x53d5d1[_0xb8d2('0x37')]=qs[_0xb8d2('0x31')](_[_0xb8d2('0x38')](_0x58d6d8[_0xb8d2('0x2f')],_0xd7dda9[_0xb8d2('0x31')]));if(_0x58d6d8[_0xb8d2('0x2f')]['filter']){_0x53d5d1[_0xb8d2('0x37')]=_[_0xb8d2('0x39')](_0x53d5d1[_0xb8d2('0x37')],{'$or':_['map'](_0x53d5d1[_0xb8d2('0x33')],function(_0x4300a9){var _0x911cd4={};_0x911cd4[_0x4300a9]={'$like':'%'+_0x58d6d8['query'][_0xb8d2('0x3a')]+'%'};return _0x911cd4;})});}_0x53d5d1=_['merge']({},_0x53d5d1,_0x58d6d8[_0xb8d2('0x3b')]);return _0x4db539[_0xb8d2('0x4a')](_0x53d5d1);}})[_0xb8d2('0x23')](function(_0xda577d){if(_0xda577d){_0xe8c594=_0xda577d['length'];if(!_0x58d6d8['query'][_0xb8d2('0x35')]('nolimit')){_0x53d5d1['limit']=qs[_0xb8d2('0x1c')](_0x58d6d8['query'][_0xb8d2('0x1c')]);_0x53d5d1['offset']=qs[_0xb8d2('0x19')](_0x58d6d8[_0xb8d2('0x2f')][_0xb8d2('0x19')]);}return _0x4db539[_0xb8d2('0x4a')](_0x53d5d1);}})[_0xb8d2('0x23')](function(_0x121b8a){if(_0x121b8a){return _0x121b8a?{'count':_0xe8c594,'rows':_0x121b8a}:null;}})[_0xb8d2('0x23')](respondWithResult(_0x1feb4e,null))[_0xb8d2('0x3f')](handleError(_0x1feb4e,null));};exports[_0xb8d2('0x4c')]=function(_0x2558ba,_0x4f7497,_0x1b7c54){var _0x52084b={};var _0x42b089={};var _0x192aab;var _0x55d2d1;return db[_0xb8d2('0x2a')][_0xb8d2('0x47')]({'where':{'id':_0x2558ba[_0xb8d2('0x41')]['id']}})[_0xb8d2('0x23')](handleEntityNotFound(_0x4f7497,null))[_0xb8d2('0x23')](function(_0x221cfe){if(_0x221cfe){_0x192aab=_0x221cfe;_0x42b089[_0xb8d2('0x2e')]=_[_0xb8d2('0x30')](db['SugarcrmField'][_0xb8d2('0x2b')]);_0x42b089['query']=_[_0xb8d2('0x30')](_0x2558ba[_0xb8d2('0x2f')]);_0x42b089[_0xb8d2('0x31')]=_['intersection'](_0x42b089[_0xb8d2('0x2e')],_0x42b089['query']);_0x52084b['attributes']=_[_0xb8d2('0x32')](_0x42b089[_0xb8d2('0x2e')],qs[_0xb8d2('0x34')](_0x2558ba['query'][_0xb8d2('0x34')]));_0x52084b[_0xb8d2('0x33')]=_0x52084b[_0xb8d2('0x33')]['length']?_0x52084b['attributes']:_0x42b089['model'];_0x52084b['order']=qs[_0xb8d2('0x36')](_0x2558ba['query'][_0xb8d2('0x36')]);_0x52084b['where']=qs[_0xb8d2('0x31')](_[_0xb8d2('0x38')](_0x2558ba['query'],_0x42b089[_0xb8d2('0x31')]));if(_0x2558ba[_0xb8d2('0x2f')][_0xb8d2('0x3a')]){_0x52084b[_0xb8d2('0x37')]=_[_0xb8d2('0x39')](_0x52084b[_0xb8d2('0x37')],{'$or':_['map'](_0x52084b[_0xb8d2('0x33')],function(_0x1fd1bb){var _0x114750={};_0x114750[_0x1fd1bb]={'$like':'%'+_0x2558ba[_0xb8d2('0x2f')]['filter']+'%'};return _0x114750;})});}_0x52084b=_['merge']({},_0x52084b,_0x2558ba[_0xb8d2('0x3b')]);return _0x192aab[_0xb8d2('0x4c')](_0x52084b);}})[_0xb8d2('0x23')](function(_0x3a3138){if(_0x3a3138){_0x55d2d1=_0x3a3138[_0xb8d2('0x42')];if(!_0x2558ba[_0xb8d2('0x2f')][_0xb8d2('0x35')]('nolimit')){_0x52084b[_0xb8d2('0x1c')]=qs[_0xb8d2('0x1c')](_0x2558ba[_0xb8d2('0x2f')][_0xb8d2('0x1c')]);_0x52084b['offset']=qs[_0xb8d2('0x19')](_0x2558ba['query']['offset']);}return _0x192aab['getDescriptions'](_0x52084b);}})[_0xb8d2('0x23')](function(_0x207ed5){if(_0x207ed5){return _0x207ed5?{'count':_0x55d2d1,'rows':_0x207ed5}:null;}})[_0xb8d2('0x23')](respondWithResult(_0x4f7497,null))[_0xb8d2('0x3f')](handleError(_0x4f7497,null));}; \ No newline at end of file +var _0x00b1=['ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','index','SugarcrmConfiguration','rawAttributes','fieldName','type','map','query','filters','model','attributes','intersection','fields','length','nolimit','order','filter','where','merge','VIRTUAL','name','options','count','includeAll','include','rows','catch','params','keys','find','create','body','getFields','findOne','SugarcrmField','sort','pick','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x00b1,0x18d));var _0x100b=function(_0x1bba53,_0x4dcf8f){_0x1bba53=_0x1bba53-0x0;var _0x51b35b=_0x00b1[_0x1bba53];return _0x51b35b;};'use strict';var emlformat=require(_0x100b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x100b('0x1'));var jsonpatch=require(_0x100b('0x2'));var rp=require(_0x100b('0x3'));var moment=require(_0x100b('0x4'));var BPromise=require(_0x100b('0x5'));var Mustache=require(_0x100b('0x6'));var util=require(_0x100b('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x100b('0x8'));var fs=require('fs');var fs_extra=require(_0x100b('0x9'));var _=require(_0x100b('0xa'));var squel=require('squel');var crypto=require(_0x100b('0xb'));var jsforce=require(_0x100b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x100b('0xd'));var querystring=require(_0x100b('0xe'));var Papa=require(_0x100b('0xf'));var Redis=require(_0x100b('0x10'));var authService=require(_0x100b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x100b('0x12'));var hardwareService=require(_0x100b('0x13'));var logger=require(_0x100b('0x14'))('api');var utils=require(_0x100b('0x15'));var config=require(_0x100b('0x16'));var licenseUtil=require(_0x100b('0x17'));var db=require(_0x100b('0x18'))['db'];function respondWithStatusCode(_0x2778a0,_0x503911){_0x503911=_0x503911||0xcc;return function(_0x1afb0f){if(_0x1afb0f){return _0x2778a0[_0x100b('0x19')](_0x503911);}return _0x2778a0['status'](_0x503911)['end']();};}function respondWithResult(_0x37c798,_0x3340a6){_0x3340a6=_0x3340a6||0xc8;return function(_0x479787){if(_0x479787){return _0x37c798[_0x100b('0x1a')](_0x3340a6)['json'](_0x479787);}};}function respondWithFilteredResult(_0x3c6176,_0x584816){return function(_0x2d5af5){if(_0x2d5af5){var _0x4f6946=typeof _0x584816[_0x100b('0x1b')]===_0x100b('0x1c')&&typeof _0x584816[_0x100b('0x1d')]==='undefined';var _0xad8d6f=_0x2d5af5['count'];var _0x4ec43d=_0x4f6946?0x0:_0x584816[_0x100b('0x1b')];var _0x46f196=_0x4f6946?_0x2d5af5['count']:_0x584816[_0x100b('0x1b')]+_0x584816['limit'];var _0x10fcc6;if(_0x46f196>=_0xad8d6f){_0x46f196=_0xad8d6f;_0x10fcc6=0xc8;}else{_0x10fcc6=0xce;}_0x3c6176[_0x100b('0x1a')](_0x10fcc6);return _0x3c6176[_0x100b('0x1e')](_0x100b('0x1f'),_0x4ec43d+'-'+_0x46f196+'/'+_0xad8d6f)[_0x100b('0x20')](_0x2d5af5);}return null;};}function patchUpdates(_0x1584f1){return function(_0x3dcab0){try{jsonpatch[_0x100b('0x21')](_0x3dcab0,_0x1584f1,!![]);}catch(_0x320f99){return BPromise[_0x100b('0x22')](_0x320f99);}return _0x3dcab0[_0x100b('0x23')]();};}function saveUpdates(_0x3737ba,_0x46db9f){return function(_0x2ed190){if(_0x2ed190){return _0x2ed190[_0x100b('0x24')](_0x3737ba)[_0x100b('0x25')](function(_0x39eac4){return _0x39eac4;});}return null;};}function removeEntity(_0x11d4be,_0x303af8){return function(_0x25ae89){if(_0x25ae89){return _0x25ae89[_0x100b('0x26')]()[_0x100b('0x25')](function(){_0x11d4be[_0x100b('0x1a')](0xcc)[_0x100b('0x27')]();});}};}function handleEntityNotFound(_0x332b07,_0x306d48){return function(_0x3f2d36){if(!_0x3f2d36){_0x332b07[_0x100b('0x19')](0x194);}return _0x3f2d36;};}function handleError(_0x124026,_0xe6839b){_0xe6839b=_0xe6839b||0x1f4;return function(_0x1ad7d7){logger[_0x100b('0x28')](_0x1ad7d7[_0x100b('0x29')]);if(_0x1ad7d7['name']){delete _0x1ad7d7['name'];}_0x124026[_0x100b('0x1a')](_0xe6839b)['send'](_0x1ad7d7);};}exports[_0x100b('0x2a')]=function(_0x298d95,_0x887b71){var _0x280371={},_0x4838a8={},_0xd2ef54={'count':0x0,'rows':[]};var _0x551093=_['map'](db[_0x100b('0x2b')][_0x100b('0x2c')],function(_0x81e560){return{'name':_0x81e560[_0x100b('0x2d')],'type':_0x81e560[_0x100b('0x2e')]['key']};});_0x4838a8['model']=_[_0x100b('0x2f')](_0x551093,'name');_0x4838a8[_0x100b('0x30')]=_['keys'](_0x298d95[_0x100b('0x30')]);_0x4838a8[_0x100b('0x31')]=_['intersection'](_0x4838a8[_0x100b('0x32')],_0x4838a8[_0x100b('0x30')]);_0x280371[_0x100b('0x33')]=_[_0x100b('0x34')](_0x4838a8[_0x100b('0x32')],qs[_0x100b('0x35')](_0x298d95['query'][_0x100b('0x35')]));_0x280371[_0x100b('0x33')]=_0x280371['attributes'][_0x100b('0x36')]?_0x280371[_0x100b('0x33')]:_0x4838a8['model'];if(!_0x298d95['query']['hasOwnProperty'](_0x100b('0x37'))){_0x280371[_0x100b('0x1d')]=qs['limit'](_0x298d95['query'][_0x100b('0x1d')]);_0x280371['offset']=qs[_0x100b('0x1b')](_0x298d95[_0x100b('0x30')][_0x100b('0x1b')]);}_0x280371[_0x100b('0x38')]=qs['sort'](_0x298d95[_0x100b('0x30')]['sort']);_0x280371['where']=qs[_0x100b('0x31')](_['pick'](_0x298d95[_0x100b('0x30')],_0x4838a8['filters']),_0x551093);if(_0x298d95[_0x100b('0x30')][_0x100b('0x39')]){_0x280371[_0x100b('0x3a')]=_[_0x100b('0x3b')](_0x280371[_0x100b('0x3a')],{'$or':_[_0x100b('0x2f')](_0x551093,function(_0x50071b){if(_0x50071b[_0x100b('0x2e')]!==_0x100b('0x3c')){var _0x54c535={};_0x54c535[_0x50071b[_0x100b('0x3d')]]={'$like':'%'+_0x298d95[_0x100b('0x30')][_0x100b('0x39')]+'%'};return _0x54c535;}})});}_0x280371=_[_0x100b('0x3b')]({},_0x280371,_0x298d95[_0x100b('0x3e')]);var _0x146cf5={'where':_0x280371[_0x100b('0x3a')]};return db[_0x100b('0x2b')]['count'](_0x146cf5)[_0x100b('0x25')](function(_0x4cf581){_0xd2ef54[_0x100b('0x3f')]=_0x4cf581;if(_0x298d95[_0x100b('0x30')][_0x100b('0x40')]){_0x280371[_0x100b('0x41')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x280371);})[_0x100b('0x25')](function(_0x3586da){_0xd2ef54[_0x100b('0x42')]=_0x3586da;return _0xd2ef54;})['then'](respondWithFilteredResult(_0x887b71,_0x280371))[_0x100b('0x43')](handleError(_0x887b71,null));};exports['show']=function(_0x30686f,_0x36e45f){var _0x5398eb={'raw':![],'where':{'id':_0x30686f[_0x100b('0x44')]['id']}},_0x15b34e={};_0x15b34e[_0x100b('0x32')]=_[_0x100b('0x45')](db[_0x100b('0x2b')][_0x100b('0x2c')]);_0x15b34e[_0x100b('0x30')]=_[_0x100b('0x45')](_0x30686f['query']);_0x15b34e[_0x100b('0x31')]=_[_0x100b('0x34')](_0x15b34e['model'],_0x15b34e[_0x100b('0x30')]);_0x5398eb['attributes']=_[_0x100b('0x34')](_0x15b34e[_0x100b('0x32')],qs[_0x100b('0x35')](_0x30686f[_0x100b('0x30')][_0x100b('0x35')]));_0x5398eb['attributes']=_0x5398eb[_0x100b('0x33')][_0x100b('0x36')]?_0x5398eb['attributes']:_0x15b34e['model'];if(_0x30686f['query'][_0x100b('0x40')]){_0x5398eb[_0x100b('0x41')]=[{'all':!![]}];}_0x5398eb=_[_0x100b('0x3b')]({},_0x5398eb,_0x30686f[_0x100b('0x3e')]);return db[_0x100b('0x2b')][_0x100b('0x46')](_0x5398eb)['then'](handleEntityNotFound(_0x36e45f,null))[_0x100b('0x25')](respondWithResult(_0x36e45f,null))['catch'](handleError(_0x36e45f,null));};exports['create']=function(_0x197f9d,_0x533f5d){return db['SugarcrmConfiguration'][_0x100b('0x47')](_0x197f9d[_0x100b('0x48')],{})['then'](respondWithResult(_0x533f5d,0xc9))[_0x100b('0x43')](handleError(_0x533f5d,null));};exports[_0x100b('0x24')]=function(_0x43cd7f,_0x4bb57d){if(_0x43cd7f[_0x100b('0x48')]['id']){delete _0x43cd7f[_0x100b('0x48')]['id'];}return db[_0x100b('0x2b')]['find']({'where':{'id':_0x43cd7f['params']['id']}})[_0x100b('0x25')](handleEntityNotFound(_0x4bb57d,null))[_0x100b('0x25')](saveUpdates(_0x43cd7f[_0x100b('0x48')],null))['then'](respondWithResult(_0x4bb57d,null))[_0x100b('0x43')](handleError(_0x4bb57d,null));};exports['destroy']=function(_0x22431d,_0x21ddda){return db['SugarcrmConfiguration'][_0x100b('0x46')]({'where':{'id':_0x22431d[_0x100b('0x44')]['id']}})[_0x100b('0x25')](handleEntityNotFound(_0x21ddda,null))[_0x100b('0x25')](removeEntity(_0x21ddda,null))[_0x100b('0x43')](handleError(_0x21ddda,null));};exports[_0x100b('0x49')]=function(_0x7a1d47,_0x53a0e0,_0x2020cd){var _0x3a4c7d={};var _0x55d5bb={};var _0x131026;var _0x3560ea;return db[_0x100b('0x2b')][_0x100b('0x4a')]({'where':{'id':_0x7a1d47[_0x100b('0x44')]['id']}})[_0x100b('0x25')](handleEntityNotFound(_0x53a0e0,null))['then'](function(_0x2003fa){if(_0x2003fa){_0x131026=_0x2003fa;_0x55d5bb[_0x100b('0x32')]=_['keys'](db[_0x100b('0x4b')][_0x100b('0x2c')]);_0x55d5bb['query']=_['keys'](_0x7a1d47[_0x100b('0x30')]);_0x55d5bb[_0x100b('0x31')]=_['intersection'](_0x55d5bb['model'],_0x55d5bb[_0x100b('0x30')]);_0x3a4c7d[_0x100b('0x33')]=_[_0x100b('0x34')](_0x55d5bb[_0x100b('0x32')],qs[_0x100b('0x35')](_0x7a1d47[_0x100b('0x30')][_0x100b('0x35')]));_0x3a4c7d[_0x100b('0x33')]=_0x3a4c7d[_0x100b('0x33')]['length']?_0x3a4c7d['attributes']:_0x55d5bb[_0x100b('0x32')];_0x3a4c7d['order']=qs[_0x100b('0x4c')](_0x7a1d47[_0x100b('0x30')][_0x100b('0x4c')]);_0x3a4c7d[_0x100b('0x3a')]=qs[_0x100b('0x31')](_[_0x100b('0x4d')](_0x7a1d47[_0x100b('0x30')],_0x55d5bb[_0x100b('0x31')]));if(_0x7a1d47[_0x100b('0x30')]['filter']){_0x3a4c7d['where']=_[_0x100b('0x3b')](_0x3a4c7d[_0x100b('0x3a')],{'$or':_[_0x100b('0x2f')](_0x3a4c7d['attributes'],function(_0x61430f){var _0x15691f={};_0x15691f[_0x61430f]={'$like':'%'+_0x7a1d47['query'][_0x100b('0x39')]+'%'};return _0x15691f;})});}_0x3a4c7d=_[_0x100b('0x3b')]({},_0x3a4c7d,_0x7a1d47['options']);return _0x131026[_0x100b('0x49')](_0x3a4c7d);}})[_0x100b('0x25')](function(_0x163988){if(_0x163988){_0x3560ea=_0x163988['length'];if(!_0x7a1d47[_0x100b('0x30')][_0x100b('0x4e')](_0x100b('0x37'))){_0x3a4c7d[_0x100b('0x1d')]=qs[_0x100b('0x1d')](_0x7a1d47[_0x100b('0x30')][_0x100b('0x1d')]);_0x3a4c7d[_0x100b('0x1b')]=qs['offset'](_0x7a1d47[_0x100b('0x30')][_0x100b('0x1b')]);}return _0x131026[_0x100b('0x49')](_0x3a4c7d);}})['then'](function(_0xba71d1){if(_0xba71d1){return _0xba71d1?{'count':_0x3560ea,'rows':_0xba71d1}:null;}})[_0x100b('0x25')](respondWithResult(_0x53a0e0,null))['catch'](handleError(_0x53a0e0,null));};exports[_0x100b('0x4f')]=function(_0x48845d,_0x5aaaa9,_0x5a17ac){var _0x61cfec={};var _0x488d38={};var _0x3cb414;var _0x3763c8;return db[_0x100b('0x2b')][_0x100b('0x4a')]({'where':{'id':_0x48845d[_0x100b('0x44')]['id']}})['then'](handleEntityNotFound(_0x5aaaa9,null))[_0x100b('0x25')](function(_0xbe66f2){if(_0xbe66f2){_0x3cb414=_0xbe66f2;_0x488d38[_0x100b('0x32')]=_['keys'](db[_0x100b('0x4b')][_0x100b('0x2c')]);_0x488d38[_0x100b('0x30')]=_[_0x100b('0x45')](_0x48845d[_0x100b('0x30')]);_0x488d38['filters']=_[_0x100b('0x34')](_0x488d38['model'],_0x488d38[_0x100b('0x30')]);_0x61cfec['attributes']=_[_0x100b('0x34')](_0x488d38[_0x100b('0x32')],qs[_0x100b('0x35')](_0x48845d[_0x100b('0x30')][_0x100b('0x35')]));_0x61cfec[_0x100b('0x33')]=_0x61cfec[_0x100b('0x33')][_0x100b('0x36')]?_0x61cfec[_0x100b('0x33')]:_0x488d38[_0x100b('0x32')];_0x61cfec['order']=qs[_0x100b('0x4c')](_0x48845d[_0x100b('0x30')][_0x100b('0x4c')]);_0x61cfec['where']=qs[_0x100b('0x31')](_[_0x100b('0x4d')](_0x48845d[_0x100b('0x30')],_0x488d38['filters']));if(_0x48845d[_0x100b('0x30')][_0x100b('0x39')]){_0x61cfec[_0x100b('0x3a')]=_['merge'](_0x61cfec['where'],{'$or':_[_0x100b('0x2f')](_0x61cfec['attributes'],function(_0x49a1a9){var _0x2e93d3={};_0x2e93d3[_0x49a1a9]={'$like':'%'+_0x48845d['query'][_0x100b('0x39')]+'%'};return _0x2e93d3;})});}_0x61cfec=_[_0x100b('0x3b')]({},_0x61cfec,_0x48845d[_0x100b('0x3e')]);return _0x3cb414[_0x100b('0x4f')](_0x61cfec);}})[_0x100b('0x25')](function(_0x254d8a){if(_0x254d8a){_0x3763c8=_0x254d8a[_0x100b('0x36')];if(!_0x48845d['query'][_0x100b('0x4e')](_0x100b('0x37'))){_0x61cfec[_0x100b('0x1d')]=qs[_0x100b('0x1d')](_0x48845d[_0x100b('0x30')]['limit']);_0x61cfec['offset']=qs['offset'](_0x48845d[_0x100b('0x30')][_0x100b('0x1b')]);}return _0x3cb414[_0x100b('0x4f')](_0x61cfec);}})[_0x100b('0x25')](function(_0x2b95e8){if(_0x2b95e8){return _0x2b95e8?{'count':_0x3763c8,'rows':_0x2b95e8}:null;}})[_0x100b('0x25')](respondWithResult(_0x5aaaa9,null))[_0x100b('0x43')](handleError(_0x5aaaa9,null));};exports[_0x100b('0x50')]=function(_0x4bfb6c,_0x4f74fc,_0x80f836){var _0x5882aa={};var _0x383976={};var _0x1cfb39;var _0x40c324;return db[_0x100b('0x2b')][_0x100b('0x4a')]({'where':{'id':_0x4bfb6c[_0x100b('0x44')]['id']}})[_0x100b('0x25')](handleEntityNotFound(_0x4f74fc,null))[_0x100b('0x25')](function(_0x285d59){if(_0x285d59){_0x1cfb39=_0x285d59;_0x383976[_0x100b('0x32')]=_['keys'](db['SugarcrmField'][_0x100b('0x2c')]);_0x383976[_0x100b('0x30')]=_[_0x100b('0x45')](_0x4bfb6c[_0x100b('0x30')]);_0x383976[_0x100b('0x31')]=_[_0x100b('0x34')](_0x383976[_0x100b('0x32')],_0x383976[_0x100b('0x30')]);_0x5882aa[_0x100b('0x33')]=_[_0x100b('0x34')](_0x383976['model'],qs[_0x100b('0x35')](_0x4bfb6c[_0x100b('0x30')][_0x100b('0x35')]));_0x5882aa['attributes']=_0x5882aa['attributes'][_0x100b('0x36')]?_0x5882aa[_0x100b('0x33')]:_0x383976['model'];_0x5882aa[_0x100b('0x38')]=qs[_0x100b('0x4c')](_0x4bfb6c[_0x100b('0x30')][_0x100b('0x4c')]);_0x5882aa[_0x100b('0x3a')]=qs[_0x100b('0x31')](_[_0x100b('0x4d')](_0x4bfb6c[_0x100b('0x30')],_0x383976[_0x100b('0x31')]));if(_0x4bfb6c[_0x100b('0x30')][_0x100b('0x39')]){_0x5882aa[_0x100b('0x3a')]=_[_0x100b('0x3b')](_0x5882aa[_0x100b('0x3a')],{'$or':_[_0x100b('0x2f')](_0x5882aa[_0x100b('0x33')],function(_0x4a9839){var _0x527f93={};_0x527f93[_0x4a9839]={'$like':'%'+_0x4bfb6c[_0x100b('0x30')]['filter']+'%'};return _0x527f93;})});}_0x5882aa=_[_0x100b('0x3b')]({},_0x5882aa,_0x4bfb6c['options']);return _0x1cfb39[_0x100b('0x50')](_0x5882aa);}})[_0x100b('0x25')](function(_0x41ee74){if(_0x41ee74){_0x40c324=_0x41ee74[_0x100b('0x36')];if(!_0x4bfb6c[_0x100b('0x30')][_0x100b('0x4e')](_0x100b('0x37'))){_0x5882aa[_0x100b('0x1d')]=qs[_0x100b('0x1d')](_0x4bfb6c['query'][_0x100b('0x1d')]);_0x5882aa[_0x100b('0x1b')]=qs[_0x100b('0x1b')](_0x4bfb6c[_0x100b('0x30')][_0x100b('0x1b')]);}return _0x1cfb39[_0x100b('0x50')](_0x5882aa);}})[_0x100b('0x25')](function(_0x31fa63){if(_0x31fa63){return _0x31fa63?{'count':_0x40c324,'rows':_0x31fa63}:null;}})['then'](respondWithResult(_0x4f74fc,null))['catch'](handleError(_0x4f74fc,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 88cde34..a96e9e2 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 _0x73fd=['exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x3a1dec,_0x1f943f){var _0x60ede0=function(_0x285fd5){while(--_0x285fd5){_0x3a1dec['push'](_0x3a1dec['shift']());}};_0x60ede0(++_0x1f943f);}(_0x73fd,0x1dc));var _0xd73f=function(_0x6465b0,_0x45653a){_0x6465b0=_0x6465b0-0x0;var _0x4884fe=_0x73fd[_0x6465b0];return _0x4884fe;};'use strict';var _=require(_0xd73f('0x0'));var util=require(_0xd73f('0x1'));var logger=require(_0xd73f('0x2'))(_0xd73f('0x3'));var moment=require('moment');var BPromise=require(_0xd73f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd73f('0x5'));var config=require(_0xd73f('0x6'));var attributes=require(_0xd73f('0x7'));module[_0xd73f('0x8')]=function(_0x41937e,_0x55a538){return _0x41937e[_0xd73f('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0xd73f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77f7=['path','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x252a7d,_0x4a85f0){var _0x393041=function(_0x15429e){while(--_0x15429e){_0x252a7d['push'](_0x252a7d['shift']());}};_0x393041(++_0x4a85f0);}(_0x77f7,0x17a));var _0x777f=function(_0x571da8,_0x17e50b){_0x571da8=_0x571da8-0x0;var _0x58047b=_0x77f7[_0x571da8];return _0x58047b;};'use strict';var _=require(_0x777f('0x0'));var util=require(_0x777f('0x1'));var logger=require(_0x777f('0x2'))(_0x777f('0x3'));var moment=require(_0x777f('0x4'));var BPromise=require(_0x777f('0x5'));var rp=require(_0x777f('0x6'));var fs=require('fs');var path=require(_0x777f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x777f('0x8')]=function(_0xd2aa85,_0x390334){return _0xd2aa85[_0x777f('0x9')](_0x777f('0xa'),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 d15883a..33b57c1 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 _0x2a86=['code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x44731a,_0x3417bb){var _0x5541bd=function(_0x26d125){while(--_0x26d125){_0x44731a['push'](_0x44731a['shift']());}};_0x5541bd(++_0x3417bb);}(_0x2a86,0x1b9));var _0x62a8=function(_0x4a15fa,_0x51b92d){_0x4a15fa=_0x4a15fa-0x0;var _0x365444=_0x2a86[_0x4a15fa];return _0x365444;};'use strict';var _=require(_0x62a8('0x0'));var util=require(_0x62a8('0x1'));var moment=require(_0x62a8('0x2'));var BPromise=require(_0x62a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62a8('0x4'));var db=require(_0x62a8('0x5'))['db'];var utils=require(_0x62a8('0x6'));var logger=require(_0x62a8('0x7'))(_0x62a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x62a8('0x9'));var client=jayson[_0x62a8('0xa')][_0x62a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c197a,_0x330eb3,_0x2634b2){return new BPromise(function(_0x5b19e0,_0x781579){return client['request'](_0x1c197a,_0x2634b2)[_0x62a8('0xc')](function(_0x3d188c){logger[_0x62a8('0xd')](_0x62a8('0xe'),_0x330eb3,'request\x20sent');logger[_0x62a8('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x330eb3,_0x62a8('0x10'),JSON[_0x62a8('0x11')](_0x3d188c));if(_0x3d188c[_0x62a8('0x12')]){if(_0x3d188c[_0x62a8('0x12')][_0x62a8('0x13')]===0x1f4){logger['error'](_0x62a8('0xe'),_0x330eb3,_0x3d188c['error'][_0x62a8('0x14')]);return _0x781579(_0x3d188c[_0x62a8('0x12')][_0x62a8('0x14')]);}logger[_0x62a8('0x12')](_0x62a8('0xe'),_0x330eb3,_0x3d188c['error']['message']);return _0x5b19e0(_0x3d188c['error'][_0x62a8('0x14')]);}else{logger[_0x62a8('0xd')](_0x62a8('0xe'),_0x330eb3,_0x62a8('0x10'));_0x5b19e0(_0x3d188c[_0x62a8('0x15')][_0x62a8('0x14')]);}})[_0x62a8('0x16')](function(_0x41adc2){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x330eb3,_0x41adc2);_0x781579(_0x41adc2);});});} \ No newline at end of file +var _0x95d9=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird'];(function(_0x1403ac,_0x532100){var _0x368514=function(_0x39b27d){while(--_0x39b27d){_0x1403ac['push'](_0x1403ac['shift']());}};_0x368514(++_0x532100);}(_0x95d9,0xec));var _0x995d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x95d9[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x995d('0x0'));var util=require(_0x995d('0x1'));var moment=require(_0x995d('0x2'));var BPromise=require(_0x995d('0x3'));var rs=require(_0x995d('0x4'));var fs=require('fs');var Redis=require(_0x995d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x995d('0x6'))(_0x995d('0x7'));var config=require(_0x995d('0x8'));var jayson=require(_0x995d('0x9'));var client=jayson['client'][_0x995d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d1e10,_0xb71ed2,_0x1cbea0){return new BPromise(function(_0x129d3a,_0x38eb85){return client[_0x995d('0xb')](_0x3d1e10,_0x1cbea0)['then'](function(_0x1ea22c){logger['info'](_0x995d('0xc'),_0xb71ed2,'request\x20sent');logger['debug'](_0x995d('0xd'),_0xb71ed2,_0x995d('0xe'),JSON[_0x995d('0xf')](_0x1ea22c));if(_0x1ea22c[_0x995d('0x10')]){if(_0x1ea22c[_0x995d('0x10')][_0x995d('0x11')]===0x1f4){logger[_0x995d('0x10')](_0x995d('0xc'),_0xb71ed2,_0x1ea22c[_0x995d('0x10')]['message']);return _0x38eb85(_0x1ea22c[_0x995d('0x10')]['message']);}logger[_0x995d('0x10')](_0x995d('0xc'),_0xb71ed2,_0x1ea22c[_0x995d('0x10')][_0x995d('0x12')]);return _0x129d3a(_0x1ea22c['error'][_0x995d('0x12')]);}else{logger[_0x995d('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xb71ed2,_0x995d('0xe'));_0x129d3a(_0x1ea22c['result'][_0x995d('0x12')]);}})['catch'](function(_0x3e03c3){logger[_0x995d('0x10')](_0x995d('0xc'),_0xb71ed2,_0x3e03c3);_0x38eb85(_0x3e03c3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 8775fd6..d0f649d 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 _0x4625=['connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','create','put','delete','exports','multer','util','path'];(function(_0x3b2395,_0x1cf2c1){var _0x2e6751=function(_0x4ea274){while(--_0x4ea274){_0x3b2395['push'](_0x3b2395['shift']());}};_0x2e6751(++_0x1cf2c1);}(_0x4625,0x1b7));var _0x5462=function(_0x338b71,_0x467075){_0x338b71=_0x338b71-0x0;var _0x43636d=_0x4625[_0x338b71];return _0x43636d;};'use strict';var multer=require(_0x5462('0x0'));var util=require(_0x5462('0x1'));var path=require(_0x5462('0x2'));var timeout=require(_0x5462('0x3'));var express=require(_0x5462('0x4'));var router=express[_0x5462('0x5')]();var fs_extra=require(_0x5462('0x6'));var auth=require(_0x5462('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x5462('0x8')]('/',auth[_0x5462('0x9')](),controller[_0x5462('0xa')]);router[_0x5462('0x8')](_0x5462('0xb'),auth[_0x5462('0x9')](),controller[_0x5462('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5462('0xd')]);router[_0x5462('0xe')](_0x5462('0xb'),auth[_0x5462('0x9')](),controller['update']);router[_0x5462('0xf')](_0x5462('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5462('0x10')]=router; \ No newline at end of file +var _0x3b8b=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x3b8b,0x1cc));var _0xb3b8=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x3b8b[_0x152aa1];return _0x1bc01a;};'use strict';var multer=require(_0xb3b8('0x0'));var util=require(_0xb3b8('0x1'));var path=require(_0xb3b8('0x2'));var timeout=require(_0xb3b8('0x3'));var express=require(_0xb3b8('0x4'));var router=express[_0xb3b8('0x5')]();var fs_extra=require(_0xb3b8('0x6'));var auth=require(_0xb3b8('0x7'));var interaction=require(_0xb3b8('0x8'));var config=require(_0xb3b8('0x9'));var controller=require(_0xb3b8('0xa'));router[_0xb3b8('0xb')]('/',auth[_0xb3b8('0xc')](),controller[_0xb3b8('0xd')]);router[_0xb3b8('0xb')](_0xb3b8('0xe'),auth[_0xb3b8('0xc')](),controller[_0xb3b8('0xf')]);router['post']('/',auth[_0xb3b8('0xc')](),controller['create']);router[_0xb3b8('0x10')](_0xb3b8('0xe'),auth[_0xb3b8('0xc')](),controller[_0xb3b8('0x11')]);router['delete'](_0xb3b8('0xe'),auth[_0xb3b8('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 68fcee4..587eaa0 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 _0x8260=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','exports'];(function(_0x147fb8,_0x33299a){var _0x2d8e96=function(_0x4bc50d){while(--_0x4bc50d){_0x147fb8['push'](_0x147fb8['shift']());}};_0x2d8e96(++_0x33299a);}(_0x8260,0x1ca));var _0x0826=function(_0x16e690,_0x5d4683){_0x16e690=_0x16e690-0x0;var _0x3beb56=_0x8260[_0x16e690];return _0x3beb56;};'use strict';var Sequelize=require('sequelize');module[_0x0826('0x0')]={'type':{'type':Sequelize[_0x0826('0x1')](_0x0826('0x2'),_0x0826('0x3'),'customVariable',_0x0826('0x4'),_0x0826('0x5')),'defaultValue':_0x0826('0x2')},'content':{'type':Sequelize[_0x0826('0x6')]},'key':{'type':Sequelize[_0x0826('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0826('0x3'),_0x0826('0x7'))},'keyContent':{'type':Sequelize[_0x0826('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0826('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0826('0x6')]}}; \ No newline at end of file +var _0x9b0c=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x9b0c,0x1c3));var _0xc9b0=function(_0x2affd2,_0x58bce0){_0x2affd2=_0x2affd2-0x0;var _0x177bba=_0x9b0c[_0x2affd2];return _0x177bba;};'use strict';var Sequelize=require(_0xc9b0('0x0'));module[_0xc9b0('0x1')]={'type':{'type':Sequelize[_0xc9b0('0x2')](_0xc9b0('0x3'),_0xc9b0('0x4'),_0xc9b0('0x5'),'keyValue',_0xc9b0('0x6')),'defaultValue':_0xc9b0('0x3')},'content':{'type':Sequelize[_0xc9b0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc9b0('0x2')]('string',_0xc9b0('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xc9b0('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xc9b0('0x7')]},'customField':{'type':Sequelize[_0xc9b0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc9b0('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 2201a99..8f4aa6a 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 _0xc84f=['end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','rows','catch','show','include','merge','find','create','body','params','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x1346fb,_0x441ea6){var _0x4a5f43=function(_0x5198ec){while(--_0x5198ec){_0x1346fb['push'](_0x1346fb['shift']());}};_0x4a5f43(++_0x441ea6);}(_0xc84f,0x79));var _0xfc84=function(_0x4cfc83,_0x571129){_0x4cfc83=_0x4cfc83-0x0;var _0x63d66d=_0xc84f[_0x4cfc83];return _0x63d66d;};'use strict';var emlformat=require(_0xfc84('0x0'));var rimraf=require(_0xfc84('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc84('0x2'));var rp=require(_0xfc84('0x3'));var moment=require(_0xfc84('0x4'));var BPromise=require(_0xfc84('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfc84('0x6'));var sox=require('sox');var csv=require(_0xfc84('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfc84('0x8'));var squel=require('squel');var crypto=require(_0xfc84('0x9'));var jsforce=require(_0xfc84('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfc84('0x7'));var querystring=require('querystring');var Papa=require(_0xfc84('0xb'));var Redis=require(_0xfc84('0xc'));var authService=require(_0xfc84('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xfc84('0xe'));var hardwareService=require(_0xfc84('0xf'));var logger=require(_0xfc84('0x10'))(_0xfc84('0x11'));var utils=require(_0xfc84('0x12'));var config=require(_0xfc84('0x13'));var licenseUtil=require(_0xfc84('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bc29f,_0x4acd16){_0x4acd16=_0x4acd16||0xcc;return function(_0x9a7cb5){if(_0x9a7cb5){return _0x3bc29f[_0xfc84('0x15')](_0x4acd16);}return _0x3bc29f[_0xfc84('0x16')](_0x4acd16)[_0xfc84('0x17')]();};}function respondWithResult(_0x366f1c,_0x3942a1){_0x3942a1=_0x3942a1||0xc8;return function(_0x1a43d2){if(_0x1a43d2){return _0x366f1c[_0xfc84('0x16')](_0x3942a1)['json'](_0x1a43d2);}};}function respondWithFilteredResult(_0xf5856f,_0x2b9ce7){return function(_0x475954){if(_0x475954){var _0x4cdff9=typeof _0x2b9ce7['offset']===_0xfc84('0x18')&&typeof _0x2b9ce7['limit']==='undefined';var _0x154779=_0x475954[_0xfc84('0x19')];var _0x40d6d0=_0x4cdff9?0x0:_0x2b9ce7[_0xfc84('0x1a')];var _0x4b5012=_0x4cdff9?_0x475954[_0xfc84('0x19')]:_0x2b9ce7[_0xfc84('0x1a')]+_0x2b9ce7[_0xfc84('0x1b')];var _0x564662;if(_0x4b5012>=_0x154779){_0x4b5012=_0x154779;_0x564662=0xc8;}else{_0x564662=0xce;}_0xf5856f[_0xfc84('0x16')](_0x564662);return _0xf5856f[_0xfc84('0x1c')](_0xfc84('0x1d'),_0x40d6d0+'-'+_0x4b5012+'/'+_0x154779)[_0xfc84('0x1e')](_0x475954);}return null;};}function patchUpdates(_0x58b7c5){return function(_0x1a5f9f){try{jsonpatch[_0xfc84('0x1f')](_0x1a5f9f,_0x58b7c5,!![]);}catch(_0x3db791){return BPromise[_0xfc84('0x20')](_0x3db791);}return _0x1a5f9f[_0xfc84('0x21')]();};}function saveUpdates(_0x320084,_0x15cee2){return function(_0x1b1541){if(_0x1b1541){return _0x1b1541[_0xfc84('0x22')](_0x320084)['then'](function(_0x31251f){return _0x31251f;});}return null;};}function removeEntity(_0x412571,_0xb4e3bd){return function(_0x401332){if(_0x401332){return _0x401332['destroy']()[_0xfc84('0x23')](function(){_0x412571[_0xfc84('0x16')](0xcc)[_0xfc84('0x17')]();});}};}function handleEntityNotFound(_0x10313b,_0x550dfc){return function(_0x4a7d50){if(!_0x4a7d50){_0x10313b[_0xfc84('0x15')](0x194);}return _0x4a7d50;};}function handleError(_0x221a35,_0x3d8a0c){_0x3d8a0c=_0x3d8a0c||0x1f4;return function(_0x393839){logger[_0xfc84('0x24')](_0x393839[_0xfc84('0x25')]);if(_0x393839[_0xfc84('0x26')]){delete _0x393839[_0xfc84('0x26')];}_0x221a35[_0xfc84('0x16')](_0x3d8a0c)['send'](_0x393839);};}exports[_0xfc84('0x27')]=function(_0x50cea1,_0x2efa91){var _0x11f9fc={},_0x2bbb99={},_0x396f31={'count':0x0,'rows':[]};var _0x11c070=_['map'](db[_0xfc84('0x28')][_0xfc84('0x29')],function(_0x350f22){return{'name':_0x350f22[_0xfc84('0x2a')],'type':_0x350f22[_0xfc84('0x2b')][_0xfc84('0x2c')]};});_0x2bbb99[_0xfc84('0x2d')]=_['map'](_0x11c070,_0xfc84('0x26'));_0x2bbb99[_0xfc84('0x2e')]=_[_0xfc84('0x2f')](_0x50cea1[_0xfc84('0x2e')]);_0x2bbb99[_0xfc84('0x30')]=_[_0xfc84('0x31')](_0x2bbb99[_0xfc84('0x2d')],_0x2bbb99[_0xfc84('0x2e')]);_0x11f9fc[_0xfc84('0x32')]=_[_0xfc84('0x31')](_0x2bbb99[_0xfc84('0x2d')],qs[_0xfc84('0x33')](_0x50cea1[_0xfc84('0x2e')]['fields']));_0x11f9fc['attributes']=_0x11f9fc[_0xfc84('0x32')][_0xfc84('0x34')]?_0x11f9fc['attributes']:_0x2bbb99[_0xfc84('0x2d')];if(!_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x35')](_0xfc84('0x36'))){_0x11f9fc[_0xfc84('0x1b')]=qs['limit'](_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x1b')]);_0x11f9fc['offset']=qs[_0xfc84('0x1a')](_0x50cea1['query'][_0xfc84('0x1a')]);}_0x11f9fc[_0xfc84('0x37')]=qs['sort'](_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x38')]);_0x11f9fc[_0xfc84('0x39')]=qs['filters'](_[_0xfc84('0x3a')](_0x50cea1[_0xfc84('0x2e')],_0x2bbb99[_0xfc84('0x30')]),_0x11c070);if(_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x3b')]){_0x11f9fc[_0xfc84('0x39')]=_['merge'](_0x11f9fc['where'],{'$or':_['map'](_0x11c070,function(_0x172c41){if(_0x172c41['type']!=='VIRTUAL'){var _0x4438a7={};_0x4438a7[_0x172c41['name']]={'$like':'%'+_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x3b')]+'%'};return _0x4438a7;}})});}_0x11f9fc=_['merge']({},_0x11f9fc,_0x50cea1[_0xfc84('0x3c')]);var _0x2b5bf4={'where':_0x11f9fc[_0xfc84('0x39')]};return db[_0xfc84('0x28')][_0xfc84('0x19')](_0x2b5bf4)[_0xfc84('0x23')](function(_0xf6a503){_0x396f31[_0xfc84('0x19')]=_0xf6a503;if(_0x50cea1[_0xfc84('0x2e')][_0xfc84('0x3d')]){_0x11f9fc['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x11f9fc);})[_0xfc84('0x23')](function(_0x1637ab){_0x396f31[_0xfc84('0x3e')]=_0x1637ab;return _0x396f31;})[_0xfc84('0x23')](respondWithFilteredResult(_0x2efa91,_0x11f9fc))[_0xfc84('0x3f')](handleError(_0x2efa91,null));};exports[_0xfc84('0x40')]=function(_0x476ea0,_0xa25646){var _0x5a16be={'raw':!![],'where':{'id':_0x476ea0['params']['id']}},_0x36063e={};_0x36063e[_0xfc84('0x2d')]=_[_0xfc84('0x2f')](db[_0xfc84('0x28')]['rawAttributes']);_0x36063e[_0xfc84('0x2e')]=_[_0xfc84('0x2f')](_0x476ea0[_0xfc84('0x2e')]);_0x36063e[_0xfc84('0x30')]=_['intersection'](_0x36063e['model'],_0x36063e[_0xfc84('0x2e')]);_0x5a16be[_0xfc84('0x32')]=_[_0xfc84('0x31')](_0x36063e['model'],qs[_0xfc84('0x33')](_0x476ea0[_0xfc84('0x2e')][_0xfc84('0x33')]));_0x5a16be['attributes']=_0x5a16be[_0xfc84('0x32')][_0xfc84('0x34')]?_0x5a16be[_0xfc84('0x32')]:_0x36063e[_0xfc84('0x2d')];if(_0x476ea0[_0xfc84('0x2e')][_0xfc84('0x3d')]){_0x5a16be[_0xfc84('0x41')]=[{'all':!![]}];}_0x5a16be=_[_0xfc84('0x42')]({},_0x5a16be,_0x476ea0[_0xfc84('0x3c')]);return db[_0xfc84('0x28')][_0xfc84('0x43')](_0x5a16be)[_0xfc84('0x23')](handleEntityNotFound(_0xa25646,null))[_0xfc84('0x23')](respondWithResult(_0xa25646,null))[_0xfc84('0x3f')](handleError(_0xa25646,null));};exports[_0xfc84('0x44')]=function(_0x41bc66,_0x546b24){return db['SugarcrmField'][_0xfc84('0x44')](_0x41bc66[_0xfc84('0x45')],{})[_0xfc84('0x23')](respondWithResult(_0x546b24,0xc9))[_0xfc84('0x3f')](handleError(_0x546b24,null));};exports[_0xfc84('0x22')]=function(_0x473d12,_0x350df3){if(_0x473d12[_0xfc84('0x45')]['id']){delete _0x473d12['body']['id'];}return db[_0xfc84('0x28')][_0xfc84('0x43')]({'where':{'id':_0x473d12[_0xfc84('0x46')]['id']}})['then'](handleEntityNotFound(_0x350df3,null))[_0xfc84('0x23')](saveUpdates(_0x473d12['body'],null))[_0xfc84('0x23')](respondWithResult(_0x350df3,null))['catch'](handleError(_0x350df3,null));};exports[_0xfc84('0x47')]=function(_0x38c93f,_0x26c62e){return db[_0xfc84('0x28')][_0xfc84('0x43')]({'where':{'id':_0x38c93f[_0xfc84('0x46')]['id']}})[_0xfc84('0x23')](handleEntityNotFound(_0x26c62e,null))['then'](removeEntity(_0x26c62e,null))['catch'](handleError(_0x26c62e,null));}; \ No newline at end of file +var _0xa5a6=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset','status','json','apply','reject','save','update','then','error','stack','send','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','type','VIRTUAL','include','findAll','params','keys','includeAll','options','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra'];(function(_0x193927,_0x545c88){var _0x1d21b1=function(_0x55ab7d){while(--_0x55ab7d){_0x193927['push'](_0x193927['shift']());}};_0x1d21b1(++_0x545c88);}(_0xa5a6,0x14f));var _0x6a5a=function(_0x5b5c45,_0x199467){_0x5b5c45=_0x5b5c45-0x0;var _0x2cd0dd=_0xa5a6[_0x5b5c45];return _0x2cd0dd;};'use strict';var emlformat=require(_0x6a5a('0x0'));var rimraf=require(_0x6a5a('0x1'));var zipdir=require(_0x6a5a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a5a('0x3'));var moment=require(_0x6a5a('0x4'));var BPromise=require(_0x6a5a('0x5'));var Mustache=require(_0x6a5a('0x6'));var util=require('util');var path=require(_0x6a5a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6a5a('0x8'));var fs=require('fs');var fs_extra=require(_0x6a5a('0x9'));var _=require(_0x6a5a('0xa'));var squel=require(_0x6a5a('0xb'));var crypto=require(_0x6a5a('0xc'));var jsforce=require(_0x6a5a('0xd'));var deskjs=require(_0x6a5a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6a5a('0xf'));var Redis=require(_0x6a5a('0x10'));var authService=require(_0x6a5a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6a5a('0x12'));var hardwareService=require(_0x6a5a('0x13'));var logger=require('../../config/logger')(_0x6a5a('0x14'));var utils=require(_0x6a5a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6a5a('0x16'));var db=require(_0x6a5a('0x17'))['db'];function respondWithStatusCode(_0x518e5d,_0x170f69){_0x170f69=_0x170f69||0xcc;return function(_0x45baf6){if(_0x45baf6){return _0x518e5d[_0x6a5a('0x18')](_0x170f69);}return _0x518e5d['status'](_0x170f69)[_0x6a5a('0x19')]();};}function respondWithResult(_0x3d603f,_0x3a00bb){_0x3a00bb=_0x3a00bb||0xc8;return function(_0xa3cd11){if(_0xa3cd11){return _0x3d603f['status'](_0x3a00bb)['json'](_0xa3cd11);}};}function respondWithFilteredResult(_0x55c68b,_0x197dbf){return function(_0x9ee5b0){if(_0x9ee5b0){var _0x4d28f6=typeof _0x197dbf['offset']===_0x6a5a('0x1a')&&typeof _0x197dbf[_0x6a5a('0x1b')]===_0x6a5a('0x1a');var _0x10c6d4=_0x9ee5b0[_0x6a5a('0x1c')];var _0x3a8cc8=_0x4d28f6?0x0:_0x197dbf[_0x6a5a('0x1d')];var _0x30d9dc=_0x4d28f6?_0x9ee5b0[_0x6a5a('0x1c')]:_0x197dbf[_0x6a5a('0x1d')]+_0x197dbf['limit'];var _0x283b1a;if(_0x30d9dc>=_0x10c6d4){_0x30d9dc=_0x10c6d4;_0x283b1a=0xc8;}else{_0x283b1a=0xce;}_0x55c68b[_0x6a5a('0x1e')](_0x283b1a);return _0x55c68b['set']('Content-Range',_0x3a8cc8+'-'+_0x30d9dc+'/'+_0x10c6d4)[_0x6a5a('0x1f')](_0x9ee5b0);}return null;};}function patchUpdates(_0x3fdfe7){return function(_0x286279){try{jsonpatch[_0x6a5a('0x20')](_0x286279,_0x3fdfe7,!![]);}catch(_0xb4e0c0){return BPromise[_0x6a5a('0x21')](_0xb4e0c0);}return _0x286279[_0x6a5a('0x22')]();};}function saveUpdates(_0x5198ea,_0x5e36ff){return function(_0x6709ca){if(_0x6709ca){return _0x6709ca[_0x6a5a('0x23')](_0x5198ea)[_0x6a5a('0x24')](function(_0x1c9b33){return _0x1c9b33;});}return null;};}function removeEntity(_0x268de1,_0x2b4d32){return function(_0x2c21b8){if(_0x2c21b8){return _0x2c21b8['destroy']()[_0x6a5a('0x24')](function(){_0x268de1['status'](0xcc)[_0x6a5a('0x19')]();});}};}function handleEntityNotFound(_0x20d7a9,_0x112966){return function(_0x305f2b){if(!_0x305f2b){_0x20d7a9['sendStatus'](0x194);}return _0x305f2b;};}function handleError(_0x105767,_0x5f0289){_0x5f0289=_0x5f0289||0x1f4;return function(_0x2f427c){logger[_0x6a5a('0x25')](_0x2f427c[_0x6a5a('0x26')]);if(_0x2f427c['name']){delete _0x2f427c['name'];}_0x105767['status'](_0x5f0289)[_0x6a5a('0x27')](_0x2f427c);};}exports[_0x6a5a('0x28')]=function(_0x59c5a8,_0x4d4a82){var _0x110f18={},_0xc38acf={},_0x47ec20={'count':0x0,'rows':[]};var _0x543c7d=_[_0x6a5a('0x29')](db[_0x6a5a('0x2a')][_0x6a5a('0x2b')],function(_0x5be4fe){return{'name':_0x5be4fe[_0x6a5a('0x2c')],'type':_0x5be4fe['type'][_0x6a5a('0x2d')]};});_0xc38acf[_0x6a5a('0x2e')]=_[_0x6a5a('0x29')](_0x543c7d,'name');_0xc38acf['query']=_['keys'](_0x59c5a8[_0x6a5a('0x2f')]);_0xc38acf[_0x6a5a('0x30')]=_[_0x6a5a('0x31')](_0xc38acf[_0x6a5a('0x2e')],_0xc38acf[_0x6a5a('0x2f')]);_0x110f18[_0x6a5a('0x32')]=_[_0x6a5a('0x31')](_0xc38acf[_0x6a5a('0x2e')],qs[_0x6a5a('0x33')](_0x59c5a8[_0x6a5a('0x2f')][_0x6a5a('0x33')]));_0x110f18[_0x6a5a('0x32')]=_0x110f18[_0x6a5a('0x32')][_0x6a5a('0x34')]?_0x110f18[_0x6a5a('0x32')]:_0xc38acf[_0x6a5a('0x2e')];if(!_0x59c5a8[_0x6a5a('0x2f')]['hasOwnProperty'](_0x6a5a('0x35'))){_0x110f18[_0x6a5a('0x1b')]=qs['limit'](_0x59c5a8[_0x6a5a('0x2f')][_0x6a5a('0x1b')]);_0x110f18[_0x6a5a('0x1d')]=qs['offset'](_0x59c5a8['query']['offset']);}_0x110f18['order']=qs[_0x6a5a('0x36')](_0x59c5a8[_0x6a5a('0x2f')][_0x6a5a('0x36')]);_0x110f18[_0x6a5a('0x37')]=qs[_0x6a5a('0x30')](_['pick'](_0x59c5a8[_0x6a5a('0x2f')],_0xc38acf[_0x6a5a('0x30')]),_0x543c7d);if(_0x59c5a8['query']['filter']){_0x110f18[_0x6a5a('0x37')]=_[_0x6a5a('0x38')](_0x110f18['where'],{'$or':_['map'](_0x543c7d,function(_0x1bf270){if(_0x1bf270[_0x6a5a('0x39')]!==_0x6a5a('0x3a')){var _0x5a9433={};_0x5a9433[_0x1bf270['name']]={'$like':'%'+_0x59c5a8[_0x6a5a('0x2f')]['filter']+'%'};return _0x5a9433;}})});}_0x110f18=_['merge']({},_0x110f18,_0x59c5a8['options']);var _0x56f0b2={'where':_0x110f18[_0x6a5a('0x37')]};return db[_0x6a5a('0x2a')][_0x6a5a('0x1c')](_0x56f0b2)[_0x6a5a('0x24')](function(_0x121412){_0x47ec20[_0x6a5a('0x1c')]=_0x121412;if(_0x59c5a8[_0x6a5a('0x2f')]['includeAll']){_0x110f18[_0x6a5a('0x3b')]=[{'all':!![]}];}return db[_0x6a5a('0x2a')][_0x6a5a('0x3c')](_0x110f18);})[_0x6a5a('0x24')](function(_0x11f96a){_0x47ec20['rows']=_0x11f96a;return _0x47ec20;})[_0x6a5a('0x24')](respondWithFilteredResult(_0x4d4a82,_0x110f18))['catch'](handleError(_0x4d4a82,null));};exports['show']=function(_0x2e8d14,_0x1f7c25){var _0x25a1df={'raw':!![],'where':{'id':_0x2e8d14[_0x6a5a('0x3d')]['id']}},_0x154fdf={};_0x154fdf[_0x6a5a('0x2e')]=_[_0x6a5a('0x3e')](db[_0x6a5a('0x2a')][_0x6a5a('0x2b')]);_0x154fdf[_0x6a5a('0x2f')]=_[_0x6a5a('0x3e')](_0x2e8d14[_0x6a5a('0x2f')]);_0x154fdf['filters']=_[_0x6a5a('0x31')](_0x154fdf['model'],_0x154fdf[_0x6a5a('0x2f')]);_0x25a1df[_0x6a5a('0x32')]=_['intersection'](_0x154fdf['model'],qs[_0x6a5a('0x33')](_0x2e8d14[_0x6a5a('0x2f')][_0x6a5a('0x33')]));_0x25a1df[_0x6a5a('0x32')]=_0x25a1df['attributes'][_0x6a5a('0x34')]?_0x25a1df[_0x6a5a('0x32')]:_0x154fdf[_0x6a5a('0x2e')];if(_0x2e8d14[_0x6a5a('0x2f')][_0x6a5a('0x3f')]){_0x25a1df['include']=[{'all':!![]}];}_0x25a1df=_[_0x6a5a('0x38')]({},_0x25a1df,_0x2e8d14[_0x6a5a('0x40')]);return db[_0x6a5a('0x2a')]['find'](_0x25a1df)[_0x6a5a('0x24')](handleEntityNotFound(_0x1f7c25,null))['then'](respondWithResult(_0x1f7c25,null))[_0x6a5a('0x41')](handleError(_0x1f7c25,null));};exports['create']=function(_0x3925e4,_0x33ed03){return db[_0x6a5a('0x2a')][_0x6a5a('0x42')](_0x3925e4[_0x6a5a('0x43')],{})['then'](respondWithResult(_0x33ed03,0xc9))[_0x6a5a('0x41')](handleError(_0x33ed03,null));};exports[_0x6a5a('0x23')]=function(_0x5727fe,_0x1ac45f){if(_0x5727fe['body']['id']){delete _0x5727fe[_0x6a5a('0x43')]['id'];}return db[_0x6a5a('0x2a')][_0x6a5a('0x44')]({'where':{'id':_0x5727fe['params']['id']}})['then'](handleEntityNotFound(_0x1ac45f,null))[_0x6a5a('0x24')](saveUpdates(_0x5727fe[_0x6a5a('0x43')],null))['then'](respondWithResult(_0x1ac45f,null))[_0x6a5a('0x41')](handleError(_0x1ac45f,null));};exports['destroy']=function(_0x4c1df9,_0x474d08){return db['SugarcrmField']['find']({'where':{'id':_0x4c1df9[_0x6a5a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x474d08,null))[_0x6a5a('0x24')](removeEntity(_0x474d08,null))[_0x6a5a('0x41')](handleError(_0x474d08,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index d4f17ea..9cacaa0 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 _0x2af4=['FieldId','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','define','SugarcrmField','sugarcrm_unique_index','idField'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x2af4,0xf3));var _0x42af=function(_0x51bf37,_0x4345b7){_0x51bf37=_0x51bf37-0x0;var _0x153758=_0x2af4[_0x51bf37];return _0x153758;};'use strict';var _=require(_0x42af('0x0'));var util=require('util');var logger=require(_0x42af('0x1'))('api');var moment=require('moment');var BPromise=require(_0x42af('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42af('0x3'));var rimraf=require(_0x42af('0x4'));var config=require(_0x42af('0x5'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x981502,_0x296d4c){return _0x981502[_0x42af('0x6')](_0x42af('0x7'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x42af('0x8'),'fields':[_0x42af('0x9'),_0x42af('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa0d3=['./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5e61fe,_0x4ec70b){var _0x13ff2b=function(_0x300006){while(--_0x300006){_0x5e61fe['push'](_0x5e61fe['shift']());}};_0x13ff2b(++_0x4ec70b);}(_0xa0d3,0x181));var _0x3a0d=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0xa0d3[_0x38987f];return _0x4cb697;};'use strict';var _=require(_0x3a0d('0x0'));var util=require(_0x3a0d('0x1'));var logger=require(_0x3a0d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3a0d('0x3'));var rp=require(_0x3a0d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a0d('0x5'));var config=require(_0x3a0d('0x6'));var attributes=require(_0x3a0d('0x7'));module[_0x3a0d('0x8')]=function(_0xd4f115,_0x32caaa){return _0xd4f115[_0x3a0d('0x9')](_0x3a0d('0xa'),attributes,{'tableName':_0x3a0d('0xb'),'paranoid':![],'indexes':[{'name':_0x3a0d('0xc'),'fields':['idField',_0x3a0d('0xd')],'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 a69a336..63e5d22 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 _0xf9ef=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x960205,_0x54f13e){var _0x12135d=function(_0x5518c7){while(--_0x5518c7){_0x960205['push'](_0x960205['shift']());}};_0x12135d(++_0x54f13e);}(_0xf9ef,0x157));var _0xff9e=function(_0x574c32,_0x4a083b){_0x574c32=_0x574c32-0x0;var _0x1ad6c2=_0xf9ef[_0x574c32];return _0x1ad6c2;};'use strict';var _=require(_0xff9e('0x0'));var util=require(_0xff9e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff9e('0x2'));var db=require(_0xff9e('0x3'))['db'];var utils=require(_0xff9e('0x4'));var logger=require(_0xff9e('0x5'))(_0xff9e('0x6'));var config=require(_0xff9e('0x7'));var jayson=require(_0xff9e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5cb61f,_0x2859f9,_0x224d9e){return new BPromise(function(_0x59fbc3,_0x54f7c2){return client[_0xff9e('0x9')](_0x5cb61f,_0x224d9e)[_0xff9e('0xa')](function(_0x4c54a8){logger[_0xff9e('0xb')](_0xff9e('0xc'),_0x2859f9,_0xff9e('0xd'));logger[_0xff9e('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2859f9,'request\x20sent',JSON['stringify'](_0x4c54a8));if(_0x4c54a8['error']){if(_0x4c54a8[_0xff9e('0xf')][_0xff9e('0x10')]===0x1f4){logger[_0xff9e('0xf')](_0xff9e('0xc'),_0x2859f9,_0x4c54a8[_0xff9e('0xf')]['message']);return _0x54f7c2(_0x4c54a8['error']['message']);}logger[_0xff9e('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x2859f9,_0x4c54a8[_0xff9e('0xf')][_0xff9e('0x11')]);return _0x59fbc3(_0x4c54a8[_0xff9e('0xf')][_0xff9e('0x11')]);}else{logger[_0xff9e('0xb')](_0xff9e('0xc'),_0x2859f9,_0xff9e('0xd'));_0x59fbc3(_0x4c54a8['result'][_0xff9e('0x11')]);}})[_0xff9e('0x12')](function(_0x4162a8){logger[_0xff9e('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x2859f9,_0x4162a8);_0x54f7c2(_0x4162a8);});});} \ No newline at end of file +var _0x0721=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x1059dc,_0x4f3e5a){var _0x3e8bab=function(_0xed9f52){while(--_0xed9f52){_0x1059dc['push'](_0x1059dc['shift']());}};_0x3e8bab(++_0x4f3e5a);}(_0x0721,0x17b));var _0x1072=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x0721[_0x2a8c21];return _0x5f3061;};'use strict';var _=require(_0x1072('0x0'));var util=require('util');var moment=require(_0x1072('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1072('0x2'));var db=require(_0x1072('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1072('0x4'))(_0x1072('0x5'));var config=require(_0x1072('0x6'));var jayson=require(_0x1072('0x7'));var client=jayson[_0x1072('0x8')][_0x1072('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412ad2,_0x5f19d8,_0x24a681){return new BPromise(function(_0x1c9310,_0x1cb07c){return client[_0x1072('0xa')](_0x412ad2,_0x24a681)[_0x1072('0xb')](function(_0x5d4e77){logger[_0x1072('0xc')](_0x1072('0xd'),_0x5f19d8,'request\x20sent');logger['debug'](_0x1072('0xe'),_0x5f19d8,_0x1072('0xf'),JSON[_0x1072('0x10')](_0x5d4e77));if(_0x5d4e77[_0x1072('0x11')]){if(_0x5d4e77['error']['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x5f19d8,_0x5d4e77[_0x1072('0x11')]['message']);return _0x1cb07c(_0x5d4e77[_0x1072('0x11')][_0x1072('0x12')]);}logger[_0x1072('0x11')](_0x1072('0xd'),_0x5f19d8,_0x5d4e77[_0x1072('0x11')][_0x1072('0x12')]);return _0x1c9310(_0x5d4e77['error'][_0x1072('0x12')]);}else{logger[_0x1072('0xc')](_0x1072('0xd'),_0x5f19d8,_0x1072('0xf'));_0x1c9310(_0x5d4e77['result']['message']);}})[_0x1072('0x13')](function(_0x4e63c7){logger['error'](_0x1072('0xd'),_0x5f19d8,_0x4e63c7);_0x1cb07c(_0x4e63c7);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 15af6e7..6b1edc2 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 _0x9ca8=['/:id/fields','post','create','addConfiguration','put','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations'];(function(_0x401866,_0x3c1d7b){var _0x80decf=function(_0x1b1364){while(--_0x1b1364){_0x401866['push'](_0x401866['shift']());}};_0x80decf(++_0x3c1d7b);}(_0x9ca8,0x123));var _0x89ca=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x9ca8[_0x2b8077];return _0x308091;};'use strict';var multer=require('multer');var util=require(_0x89ca('0x0'));var path=require('path');var timeout=require(_0x89ca('0x1'));var express=require(_0x89ca('0x2'));var router=express[_0x89ca('0x3')]();var fs_extra=require(_0x89ca('0x4'));var auth=require(_0x89ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x89ca('0x6'));var controller=require(_0x89ca('0x7'));router[_0x89ca('0x8')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xa')]);router[_0x89ca('0x8')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller['show']);router['get'](_0x89ca('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x89ca('0x8')](_0x89ca('0xd'),auth[_0x89ca('0x9')](),controller['getFields']);router[_0x89ca('0xe')]('/',auth[_0x89ca('0x9')](),controller[_0x89ca('0xf')]);router[_0x89ca('0xe')](_0x89ca('0xc'),auth[_0x89ca('0x9')](),controller[_0x89ca('0x10')]);router[_0x89ca('0x11')](_0x89ca('0xb'),auth[_0x89ca('0x9')](),controller['update']);router['delete'](_0x89ca('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x89ca('0x12')]=router; \ No newline at end of file +var _0xb07f=['./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4749ee,_0x460c92){var _0x34c8e5=function(_0x4e7cb4){while(--_0x4e7cb4){_0x4749ee['push'](_0x4749ee['shift']());}};_0x34c8e5(++_0x460c92);}(_0xb07f,0x109));var _0xfb07=function(_0x33d598,_0x1ad580){_0x33d598=_0x33d598-0x0;var _0x4dcfcc=_0xb07f[_0x33d598];return _0x4dcfcc;};'use strict';var multer=require(_0xfb07('0x0'));var util=require(_0xfb07('0x1'));var path=require(_0xfb07('0x2'));var timeout=require(_0xfb07('0x3'));var express=require(_0xfb07('0x4'));var router=express[_0xfb07('0x5')]();var fs_extra=require(_0xfb07('0x6'));var auth=require(_0xfb07('0x7'));var interaction=require(_0xfb07('0x8'));var config=require(_0xfb07('0x9'));var controller=require(_0xfb07('0xa'));router['get']('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0xc')]);router[_0xfb07('0xd')](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0xf')]);router[_0xfb07('0xd')](_0xfb07('0x10'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x11')]);router[_0xfb07('0xd')](_0xfb07('0x12'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0x13')]);router['post'](_0xfb07('0x10'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x14')]);router[_0xfb07('0x15')](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x16')]);router['delete'](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x17')]);module[_0xfb07('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index c10fd5a..460b305 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 _0xae45=['sequelize','STRING','HelpDesk'];(function(_0x2de447,_0x864592){var _0x527b48=function(_0x128943){while(--_0x128943){_0x2de447['push'](_0x2de447['shift']());}};_0x527b48(++_0x864592);}(_0xae45,0x129));var _0x5ae4=function(_0x395f9c,_0x1f6aa0){_0x395f9c=_0x395f9c-0x0;var _0x296560=_0xae45[_0x395f9c];return _0x296560;};'use strict';var Sequelize=require(_0x5ae4('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![],'defaultValue':_0x5ae4('0x2')},'remoteUri':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5ae4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x56b9=['STRING'];(function(_0x3c4e81,_0x114f0c){var _0x3396b5=function(_0x54759d){while(--_0x54759d){_0x3c4e81['push'](_0x3c4e81['shift']());}};_0x3396b5(++_0x114f0c);}(_0x56b9,0x115));var _0x956b=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0x56b9[_0xf84870];return _0x4541a4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x956b('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x956b('0x0')]},'username':{'type':Sequelize[_0x956b('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x956b('0x0')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x956b('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x956b('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 71b1da5..62755db 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 _0xd7d5=['Content-Range','apply','reject','then','destroy','error','stack','name','map','VtigerAccount','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','update','getConfigurations','findOne','VtigerConfiguration','order','nolimit','addConfiguration','Subjects','channel','Descriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','autogenerated','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','mustache','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count'];(function(_0x373afe,_0x4841f3){var _0x4decea=function(_0x441ed5){while(--_0x441ed5){_0x373afe['push'](_0x373afe['shift']());}};_0x4decea(++_0x4841f3);}(_0xd7d5,0xd0));var _0x5d7d=function(_0x2c1e97,_0x219c89){_0x2c1e97=_0x2c1e97-0x0;var _0x5ce32e=_0xd7d5[_0x2c1e97];return _0x5ce32e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5d7d('0x0'));var jsonpatch=require(_0x5d7d('0x1'));var rp=require(_0x5d7d('0x2'));var moment=require(_0x5d7d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5d7d('0x4'));var util=require('util');var path=require('path');var sox=require(_0x5d7d('0x5'));var csv=require(_0x5d7d('0x6'));var ejs=require(_0x5d7d('0x7'));var fs=require('fs');var fs_extra=require(_0x5d7d('0x8'));var _=require(_0x5d7d('0x9'));var squel=require(_0x5d7d('0xa'));var crypto=require(_0x5d7d('0xb'));var jsforce=require(_0x5d7d('0xc'));var deskjs=require(_0x5d7d('0xd'));var toCsv=require(_0x5d7d('0x6'));var querystring=require(_0x5d7d('0xe'));var Papa=require(_0x5d7d('0xf'));var Redis=require(_0x5d7d('0x10'));var authService=require(_0x5d7d('0x11'));var qs=require(_0x5d7d('0x12'));var as=require(_0x5d7d('0x13'));var hardwareService=require(_0x5d7d('0x14'));var logger=require(_0x5d7d('0x15'))(_0x5d7d('0x16'));var utils=require(_0x5d7d('0x17'));var config=require(_0x5d7d('0x18'));var licenseUtil=require(_0x5d7d('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5d7d('0x1a'));function respondWithStatusCode(_0x27984a,_0x3dc629){_0x3dc629=_0x3dc629||0xcc;return function(_0x182cd3){if(_0x182cd3){return _0x27984a[_0x5d7d('0x1b')](_0x3dc629);}return _0x27984a[_0x5d7d('0x1c')](_0x3dc629)[_0x5d7d('0x1d')]();};}function respondWithResult(_0x2bb71d,_0x298789){_0x298789=_0x298789||0xc8;return function(_0x304c1a){if(_0x304c1a){return _0x2bb71d[_0x5d7d('0x1c')](_0x298789)[_0x5d7d('0x1e')](_0x304c1a);}};}function respondWithFilteredResult(_0x5090d9,_0x4a0b11){return function(_0x525a5a){if(_0x525a5a){var _0x2bf3d0=typeof _0x4a0b11[_0x5d7d('0x1f')]===_0x5d7d('0x20')&&typeof _0x4a0b11['limit']===_0x5d7d('0x20');var _0x595b47=_0x525a5a[_0x5d7d('0x21')];var _0x48f5c7=_0x2bf3d0?0x0:_0x4a0b11[_0x5d7d('0x1f')];var _0x3fb18b=_0x2bf3d0?_0x525a5a[_0x5d7d('0x21')]:_0x4a0b11[_0x5d7d('0x1f')]+_0x4a0b11['limit'];var _0x563096;if(_0x3fb18b>=_0x595b47){_0x3fb18b=_0x595b47;_0x563096=0xc8;}else{_0x563096=0xce;}_0x5090d9['status'](_0x563096);return _0x5090d9['set'](_0x5d7d('0x22'),_0x48f5c7+'-'+_0x3fb18b+'/'+_0x595b47)[_0x5d7d('0x1e')](_0x525a5a);}return null;};}function patchUpdates(_0x472616){return function(_0x49dd61){try{jsonpatch[_0x5d7d('0x23')](_0x49dd61,_0x472616,!![]);}catch(_0x8cb9ca){return BPromise[_0x5d7d('0x24')](_0x8cb9ca);}return _0x49dd61['save']();};}function saveUpdates(_0x331d10,_0x4e1c55){return function(_0x4c8157){if(_0x4c8157){return _0x4c8157['update'](_0x331d10)[_0x5d7d('0x25')](function(_0x39a71d){return _0x39a71d;});}return null;};}function removeEntity(_0x2ec537,_0x295e38){return function(_0x5c18c5){if(_0x5c18c5){return _0x5c18c5[_0x5d7d('0x26')]()[_0x5d7d('0x25')](function(){_0x2ec537[_0x5d7d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43df4c,_0x43b3fb){return function(_0x461d0a){if(!_0x461d0a){_0x43df4c['sendStatus'](0x194);}return _0x461d0a;};}function handleError(_0x4a865b,_0x2df5fd){_0x2df5fd=_0x2df5fd||0x1f4;return function(_0x217c38){logger[_0x5d7d('0x27')](_0x217c38[_0x5d7d('0x28')]);if(_0x217c38[_0x5d7d('0x29')]){delete _0x217c38[_0x5d7d('0x29')];}_0x4a865b[_0x5d7d('0x1c')](_0x2df5fd)['send'](_0x217c38);};}exports['index']=function(_0x59dadf,_0x342559){var _0x376363={},_0x45246b={},_0x35ce66={'count':0x0,'rows':[]};var _0x1c4c2e=_[_0x5d7d('0x2a')](db[_0x5d7d('0x2b')]['rawAttributes'],function(_0x55e143){return{'name':_0x55e143['fieldName'],'type':_0x55e143[_0x5d7d('0x2c')][_0x5d7d('0x2d')]};});_0x45246b[_0x5d7d('0x2e')]=_[_0x5d7d('0x2a')](_0x1c4c2e,'name');_0x45246b[_0x5d7d('0x2f')]=_[_0x5d7d('0x30')](_0x59dadf[_0x5d7d('0x2f')]);_0x45246b[_0x5d7d('0x31')]=_[_0x5d7d('0x32')](_0x45246b[_0x5d7d('0x2e')],_0x45246b['query']);_0x376363[_0x5d7d('0x33')]=_['intersection'](_0x45246b['model'],qs[_0x5d7d('0x34')](_0x59dadf[_0x5d7d('0x2f')]['fields']));_0x376363[_0x5d7d('0x33')]=_0x376363[_0x5d7d('0x33')]['length']?_0x376363['attributes']:_0x45246b[_0x5d7d('0x2e')];if(!_0x59dadf['query'][_0x5d7d('0x35')]('nolimit')){_0x376363[_0x5d7d('0x36')]=qs[_0x5d7d('0x36')](_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x36')]);_0x376363[_0x5d7d('0x1f')]=qs[_0x5d7d('0x1f')](_0x59dadf['query'][_0x5d7d('0x1f')]);}_0x376363['order']=qs[_0x5d7d('0x37')](_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x37')]);_0x376363[_0x5d7d('0x38')]=qs[_0x5d7d('0x31')](_[_0x5d7d('0x39')](_0x59dadf[_0x5d7d('0x2f')],_0x45246b[_0x5d7d('0x31')]),_0x1c4c2e);if(_0x59dadf['query'][_0x5d7d('0x3a')]){_0x376363[_0x5d7d('0x38')]=_[_0x5d7d('0x3b')](_0x376363[_0x5d7d('0x38')],{'$or':_['map'](_0x1c4c2e,function(_0x32ae05){if(_0x32ae05[_0x5d7d('0x2c')]!==_0x5d7d('0x3c')){var _0x590c24={};_0x590c24[_0x32ae05[_0x5d7d('0x29')]]={'$like':'%'+_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x3a')]+'%'};return _0x590c24;}})});}_0x376363=_['merge']({},_0x376363,_0x59dadf[_0x5d7d('0x3d')]);var _0x122d96={'where':_0x376363[_0x5d7d('0x38')]};return db[_0x5d7d('0x2b')][_0x5d7d('0x21')](_0x122d96)['then'](function(_0x1b5760){_0x35ce66[_0x5d7d('0x21')]=_0x1b5760;if(_0x59dadf[_0x5d7d('0x2f')][_0x5d7d('0x3e')]){_0x376363[_0x5d7d('0x3f')]=[{'all':!![]}];}return db[_0x5d7d('0x2b')][_0x5d7d('0x40')](_0x376363);})[_0x5d7d('0x25')](function(_0x2107c7){_0x35ce66[_0x5d7d('0x41')]=_0x2107c7;return _0x35ce66;})[_0x5d7d('0x25')](respondWithFilteredResult(_0x342559,_0x376363))['catch'](handleError(_0x342559,null));};exports['show']=function(_0x4cb9fb,_0x3aaea2){var _0x25c909={'raw':![],'where':{'id':_0x4cb9fb[_0x5d7d('0x42')]['id']}},_0x9a08c8={};_0x9a08c8[_0x5d7d('0x2e')]=_['keys'](db[_0x5d7d('0x2b')][_0x5d7d('0x43')]);_0x9a08c8['query']=_[_0x5d7d('0x30')](_0x4cb9fb[_0x5d7d('0x2f')]);_0x9a08c8[_0x5d7d('0x31')]=_['intersection'](_0x9a08c8['model'],_0x9a08c8[_0x5d7d('0x2f')]);_0x25c909['attributes']=_[_0x5d7d('0x32')](_0x9a08c8[_0x5d7d('0x2e')],qs['fields'](_0x4cb9fb[_0x5d7d('0x2f')]['fields']));_0x25c909[_0x5d7d('0x33')]=_0x25c909['attributes'][_0x5d7d('0x44')]?_0x25c909['attributes']:_0x9a08c8[_0x5d7d('0x2e')];if(_0x4cb9fb[_0x5d7d('0x2f')][_0x5d7d('0x3e')]){_0x25c909[_0x5d7d('0x3f')]=[{'all':!![]}];}_0x25c909=_[_0x5d7d('0x3b')]({},_0x25c909,_0x4cb9fb[_0x5d7d('0x3d')]);return db[_0x5d7d('0x2b')][_0x5d7d('0x45')](_0x25c909)[_0x5d7d('0x25')](handleEntityNotFound(_0x3aaea2,null))[_0x5d7d('0x25')](respondWithResult(_0x3aaea2,null))[_0x5d7d('0x46')](handleError(_0x3aaea2,null));};exports[_0x5d7d('0x47')]=function(_0x5369f5,_0x52ee9c){return db['VtigerAccount'][_0x5d7d('0x47')](_0x5369f5[_0x5d7d('0x48')],{})['then'](respondWithResult(_0x52ee9c,0xc9))['catch'](handleError(_0x52ee9c,null));};exports[_0x5d7d('0x49')]=function(_0x1ea90a,_0x2931ae){if(_0x1ea90a['body']['id']){delete _0x1ea90a[_0x5d7d('0x48')]['id'];}return db['VtigerAccount'][_0x5d7d('0x45')]({'where':{'id':_0x1ea90a[_0x5d7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2931ae,null))[_0x5d7d('0x25')](saveUpdates(_0x1ea90a[_0x5d7d('0x48')],null))[_0x5d7d('0x25')](respondWithResult(_0x2931ae,null))['catch'](handleError(_0x2931ae,null));};exports[_0x5d7d('0x26')]=function(_0x44041e,_0x37124c){return db[_0x5d7d('0x2b')]['find']({'where':{'id':_0x44041e[_0x5d7d('0x42')]['id']}})['then'](handleEntityNotFound(_0x37124c,null))[_0x5d7d('0x25')](removeEntity(_0x37124c,null))[_0x5d7d('0x46')](handleError(_0x37124c,null));};exports[_0x5d7d('0x4a')]=function(_0x413330,_0x102904,_0x188482){var _0x36c186={};var _0x490985={};var _0x135fe7;var _0x762789;return db[_0x5d7d('0x2b')][_0x5d7d('0x4b')]({'where':{'id':_0x413330[_0x5d7d('0x42')]['id']}})[_0x5d7d('0x25')](handleEntityNotFound(_0x102904,null))[_0x5d7d('0x25')](function(_0x461ae4){if(_0x461ae4){_0x135fe7=_0x461ae4;_0x490985[_0x5d7d('0x2e')]=_[_0x5d7d('0x30')](db[_0x5d7d('0x4c')][_0x5d7d('0x43')]);_0x490985[_0x5d7d('0x2f')]=_[_0x5d7d('0x30')](_0x413330[_0x5d7d('0x2f')]);_0x490985[_0x5d7d('0x31')]=_[_0x5d7d('0x32')](_0x490985[_0x5d7d('0x2e')],_0x490985[_0x5d7d('0x2f')]);_0x36c186[_0x5d7d('0x33')]=_[_0x5d7d('0x32')](_0x490985[_0x5d7d('0x2e')],qs[_0x5d7d('0x34')](_0x413330['query'][_0x5d7d('0x34')]));_0x36c186[_0x5d7d('0x33')]=_0x36c186[_0x5d7d('0x33')]['length']?_0x36c186[_0x5d7d('0x33')]:_0x490985['model'];_0x36c186[_0x5d7d('0x4d')]=qs['sort'](_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x37')]);_0x36c186[_0x5d7d('0x38')]=qs[_0x5d7d('0x31')](_[_0x5d7d('0x39')](_0x413330[_0x5d7d('0x2f')],_0x490985['filters']));if(_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x3a')]){_0x36c186[_0x5d7d('0x38')]=_[_0x5d7d('0x3b')](_0x36c186['where'],{'$or':_[_0x5d7d('0x2a')](_0x36c186[_0x5d7d('0x33')],function(_0xcd9b45){var _0x4e58e5={};_0x4e58e5[_0xcd9b45]={'$like':'%'+_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x3a')]+'%'};return _0x4e58e5;})});}_0x36c186=_[_0x5d7d('0x3b')]({},_0x36c186,_0x413330['options']);return _0x135fe7[_0x5d7d('0x4a')](_0x36c186);}})[_0x5d7d('0x25')](function(_0x275cf8){if(_0x275cf8){_0x762789=_0x275cf8[_0x5d7d('0x44')];if(!_0x413330['query'][_0x5d7d('0x35')](_0x5d7d('0x4e'))){_0x36c186[_0x5d7d('0x36')]=qs[_0x5d7d('0x36')](_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x36')]);_0x36c186[_0x5d7d('0x1f')]=qs['offset'](_0x413330[_0x5d7d('0x2f')][_0x5d7d('0x1f')]);}return _0x135fe7[_0x5d7d('0x4a')](_0x36c186);}})['then'](function(_0x151ce9){if(_0x151ce9){return _0x151ce9?{'count':_0x762789,'rows':_0x151ce9}:null;}})[_0x5d7d('0x25')](respondWithResult(_0x102904,null))[_0x5d7d('0x46')](handleError(_0x102904,null));};exports[_0x5d7d('0x4f')]=function(_0x5563fb,_0x2c6fc0,_0x287875){if(_0x5563fb[_0x5d7d('0x48')]['id']){delete _0x5563fb['body']['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x5563fb['params']['id']}})[_0x5d7d('0x25')](handleEntityNotFound(_0x2c6fc0,null))[_0x5d7d('0x25')](function(_0x4ab786){if(_0x4ab786){_0x5563fb[_0x5d7d('0x48')]['AccountId']=_0x4ab786['id'];_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x50')]=integrations['getSubjects'](_0x5563fb['body'][_0x5d7d('0x51')],_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x2c')]);_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x52')]=integrations['getDescriptions'](_0x5563fb['body'][_0x5d7d('0x51')],_0x5563fb[_0x5d7d('0x48')][_0x5d7d('0x2c')]);return db['VtigerConfiguration'][_0x5d7d('0x47')](_0x5563fb[_0x5d7d('0x48')],{'include':[{'model':db[_0x5d7d('0x53')],'as':'Subjects'},{'model':db[_0x5d7d('0x53')],'as':_0x5d7d('0x52')}]});}return null;})[_0x5d7d('0x25')](respondWithResult(_0x2c6fc0,null))[_0x5d7d('0x46')](handleError(_0x2c6fc0,null));};var md5=require(_0x5d7d('0x54'));exports[_0x5d7d('0x55')]=function(_0x2d7b58,_0x5a8bd5,_0x7e316f){var _0x2562f4=null;var _0x184c65=null;var _0x1e85c6=null;var _0x5002ec=null;var _0x28a1cd='';return db[_0x5d7d('0x2b')][_0x5d7d('0x4b')]({'where':{'id':_0x2d7b58[_0x5d7d('0x42')]['id']},'attributes':['id',_0x5d7d('0x29'),_0x5d7d('0x56'),_0x5d7d('0x57'),_0x5d7d('0x58'),_0x5d7d('0x59'),_0x5d7d('0x5a'),'accessKey']})['then'](handleEntityNotFound(_0x5a8bd5,null))[_0x5d7d('0x25')](function(_0x101397){if(_0x101397){_0x2562f4=_0x101397[_0x5d7d('0x56')];_0x184c65=_0x101397[_0x5d7d('0x5b')];_0x1e85c6=_0x101397[_0x5d7d('0x58')];_0x28a1cd=_0x101397[_0x5d7d('0x59')];var _0xa0427a=_0x28a1cd[_0x5d7d('0x5c')](-0x1);if(_0xa0427a==='/'){_0x28a1cd=_0x28a1cd['substring'](0x0,_0x28a1cd[_0x5d7d('0x5d')](_0xa0427a));}_0x5002ec=util['format'](_0x5d7d('0x5e'),_0x28a1cd);var _0x37b187={'method':_0x5d7d('0x5f'),'uri':_0x5002ec,'qs':{'operation':_0x5d7d('0x60'),'username':_0x101397[_0x5d7d('0x56')]},'json':!![]};return rp(_0x37b187);}})[_0x5d7d('0x25')](function(_0x436443){if(_0x436443[_0x5d7d('0x61')]){var _0x287c7b={'method':_0x5d7d('0x62'),'uri':_0x5002ec,'form':{'operation':_0x5d7d('0x63'),'username':_0x2562f4,'accessKey':md5(_0x436443[_0x5d7d('0x64')][_0x5d7d('0x65')]+_0x184c65)},'json':!![]};return rp(_0x287c7b);}})['then'](function(_0x5dc6dd){if(_0x5dc6dd['success']){var _0x1bc1a4={'method':_0x5d7d('0x5f'),'uri':_0x5002ec,'qs':{'operation':_0x5d7d('0x66'),'username':_0x2562f4,'sessionName':_0x5dc6dd[_0x5d7d('0x64')]['sessionName'],'elementType':_0x1e85c6},'json':!![]};return rp(_0x1bc1a4);}})[_0x5d7d('0x25')](function(_0x23b1bb){if(_0x23b1bb[_0x5d7d('0x61')]){var _0x4fee64=[_0x5d7d('0x67'),'reference',_0x5d7d('0x68')];_[_0x5d7d('0x69')](_0x23b1bb[_0x5d7d('0x64')][_0x5d7d('0x34')],function(_0x314ebf){return _0x4fee64[_0x5d7d('0x6a')](_0x314ebf['type'][_0x5d7d('0x29')]);});_['remove'](_0x23b1bb[_0x5d7d('0x64')]['fields'],function(_0x18f63a){return _0x18f63a[_0x5d7d('0x6b')]===_0x5d7d('0x6c');});return{'count':_0x23b1bb[_0x5d7d('0x64')]['fields']['length'],'rows':_['map'](_0x23b1bb[_0x5d7d('0x64')]['fields'],function(_0x4be29a){return{'id':_0x4be29a['name'],'name':_0x4be29a[_0x5d7d('0x6d')],'custom':_[_0x5d7d('0x6e')](_0x4be29a[_0x5d7d('0x29')],_0x5d7d('0x6f'))?!![]:![],'options':_0x4be29a['type']['name']===_0x5d7d('0x70')&&_0x4be29a[_0x5d7d('0x2c')]['picklistValues'][_0x5d7d('0x44')]>0x0?_[_0x5d7d('0x2a')](_0x4be29a[_0x5d7d('0x2c')]['picklistValues'],function(_0x539a85){return{'name':_0x539a85[_0x5d7d('0x6d')],'value':_0x539a85[_0x5d7d('0x71')]};}):[]};})};}})[_0x5d7d('0x25')](respondWithResult(_0x5a8bd5,null))[_0x5d7d('0x46')](function(_0x129641){console['log'](_0x5d7d('0x72')+_0x129641);var _0x38700c=_0x2d7b58[_0x5d7d('0x2f')]['test']?0x1f4:_0x129641[_0x5d7d('0x73')]||0x1f4;logger[_0x5d7d('0x27')](_0x5d7d('0x74'),'getFields',_0x38700c,JSON[_0x5d7d('0x75')](_0x129641));delete _0x129641[_0x5d7d('0x29')];if(_0x38700c===0x191){_0x38700c=0x190;}_0x5a8bd5['status'](_0x38700c)[_0x5d7d('0x76')](_0x2d7b58[_0x5d7d('0x2f')][_0x5d7d('0x77')]?{'message':_0x5d7d('0x78'),'statusCode':_0x129641[_0x5d7d('0x73')]}:_0x129641);});}; \ No newline at end of file +var _0xc12a=['options','includeAll','include','findAll','show','params','rawAttributes','intersection','length','find','create','body','catch','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','username','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','result','success','describe','sessionName','autogenerated','reference','owner','remove','includes','label','startsWith','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','VtigerAccount','fieldName','type','key','keys','filters','model','attributes','query','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter'];(function(_0x508c33,_0x1e3b14){var _0x5a2392=function(_0x736336){while(--_0x736336){_0x508c33['push'](_0x508c33['shift']());}};_0x5a2392(++_0x1e3b14);}(_0xc12a,0x18f));var _0xac12=function(_0x136116,_0xb1856e){_0x136116=_0x136116-0x0;var _0x204c6b=_0xc12a[_0x136116];return _0x204c6b;};'use strict';var emlformat=require(_0xac12('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xac12('0x1'));var rp=require('request-promise');var moment=require(_0xac12('0x2'));var BPromise=require(_0xac12('0x3'));var Mustache=require('mustache');var util=require(_0xac12('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xac12('0x5'));var ejs=require(_0xac12('0x6'));var fs=require('fs');var fs_extra=require(_0xac12('0x7'));var _=require(_0xac12('0x8'));var squel=require(_0xac12('0x9'));var crypto=require(_0xac12('0xa'));var jsforce=require(_0xac12('0xb'));var deskjs=require(_0xac12('0xc'));var toCsv=require(_0xac12('0x5'));var querystring=require('querystring');var Papa=require(_0xac12('0xd'));var Redis=require('ioredis');var authService=require(_0xac12('0xe'));var qs=require(_0xac12('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac12('0x10'));var logger=require(_0xac12('0x11'))(_0xac12('0x12'));var utils=require(_0xac12('0x13'));var config=require(_0xac12('0x14'));var licenseUtil=require(_0xac12('0x15'));var db=require(_0xac12('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x7c2ede,_0x4ec067){_0x4ec067=_0x4ec067||0xcc;return function(_0x4798a3){if(_0x4798a3){return _0x7c2ede[_0xac12('0x17')](_0x4ec067);}return _0x7c2ede['status'](_0x4ec067)[_0xac12('0x18')]();};}function respondWithResult(_0x5f542d,_0xe27811){_0xe27811=_0xe27811||0xc8;return function(_0x11ede1){if(_0x11ede1){return _0x5f542d[_0xac12('0x19')](_0xe27811)[_0xac12('0x1a')](_0x11ede1);}};}function respondWithFilteredResult(_0x2f1460,_0x263304){return function(_0x2909fd){if(_0x2909fd){var _0x11a0ab=typeof _0x263304[_0xac12('0x1b')]==='undefined'&&typeof _0x263304['limit']===_0xac12('0x1c');var _0x2bb304=_0x2909fd[_0xac12('0x1d')];var _0x3d5a7e=_0x11a0ab?0x0:_0x263304[_0xac12('0x1b')];var _0x35e8cc=_0x11a0ab?_0x2909fd[_0xac12('0x1d')]:_0x263304['offset']+_0x263304[_0xac12('0x1e')];var _0xbe86f8;if(_0x35e8cc>=_0x2bb304){_0x35e8cc=_0x2bb304;_0xbe86f8=0xc8;}else{_0xbe86f8=0xce;}_0x2f1460[_0xac12('0x19')](_0xbe86f8);return _0x2f1460[_0xac12('0x1f')](_0xac12('0x20'),_0x3d5a7e+'-'+_0x35e8cc+'/'+_0x2bb304)[_0xac12('0x1a')](_0x2909fd);}return null;};}function patchUpdates(_0x126631){return function(_0x2f9060){try{jsonpatch['apply'](_0x2f9060,_0x126631,!![]);}catch(_0x2178cb){return BPromise[_0xac12('0x21')](_0x2178cb);}return _0x2f9060[_0xac12('0x22')]();};}function saveUpdates(_0x3bbc4c,_0x3e0bba){return function(_0x24edde){if(_0x24edde){return _0x24edde[_0xac12('0x23')](_0x3bbc4c)[_0xac12('0x24')](function(_0x4f555f){return _0x4f555f;});}return null;};}function removeEntity(_0xa1a5f6,_0x16c38a){return function(_0xcb3ea6){if(_0xcb3ea6){return _0xcb3ea6[_0xac12('0x25')]()[_0xac12('0x24')](function(){_0xa1a5f6[_0xac12('0x19')](0xcc)[_0xac12('0x18')]();});}};}function handleEntityNotFound(_0x109dbc,_0x12709f){return function(_0x1db1c6){if(!_0x1db1c6){_0x109dbc[_0xac12('0x17')](0x194);}return _0x1db1c6;};}function handleError(_0x5a8a9f,_0x49e3ac){_0x49e3ac=_0x49e3ac||0x1f4;return function(_0x116fa5){logger[_0xac12('0x26')](_0x116fa5[_0xac12('0x27')]);if(_0x116fa5['name']){delete _0x116fa5[_0xac12('0x28')];}_0x5a8a9f[_0xac12('0x19')](_0x49e3ac)['send'](_0x116fa5);};}exports[_0xac12('0x29')]=function(_0x13b460,_0x201122){var _0x3056ad={},_0x5374f6={},_0x53fa4a={'count':0x0,'rows':[]};var _0x260f94=_[_0xac12('0x2a')](db[_0xac12('0x2b')]['rawAttributes'],function(_0x25fe1f){return{'name':_0x25fe1f[_0xac12('0x2c')],'type':_0x25fe1f[_0xac12('0x2d')][_0xac12('0x2e')]};});_0x5374f6['model']=_['map'](_0x260f94,_0xac12('0x28'));_0x5374f6['query']=_[_0xac12('0x2f')](_0x13b460['query']);_0x5374f6[_0xac12('0x30')]=_['intersection'](_0x5374f6[_0xac12('0x31')],_0x5374f6['query']);_0x3056ad[_0xac12('0x32')]=_['intersection'](_0x5374f6[_0xac12('0x31')],qs['fields'](_0x13b460[_0xac12('0x33')][_0xac12('0x34')]));_0x3056ad[_0xac12('0x32')]=_0x3056ad[_0xac12('0x32')]['length']?_0x3056ad[_0xac12('0x32')]:_0x5374f6['model'];if(!_0x13b460['query'][_0xac12('0x35')](_0xac12('0x36'))){_0x3056ad[_0xac12('0x1e')]=qs['limit'](_0x13b460[_0xac12('0x33')][_0xac12('0x1e')]);_0x3056ad[_0xac12('0x1b')]=qs['offset'](_0x13b460[_0xac12('0x33')]['offset']);}_0x3056ad[_0xac12('0x37')]=qs[_0xac12('0x38')](_0x13b460['query']['sort']);_0x3056ad[_0xac12('0x39')]=qs['filters'](_[_0xac12('0x3a')](_0x13b460[_0xac12('0x33')],_0x5374f6[_0xac12('0x30')]),_0x260f94);if(_0x13b460[_0xac12('0x33')]['filter']){_0x3056ad[_0xac12('0x39')]=_[_0xac12('0x3b')](_0x3056ad['where'],{'$or':_[_0xac12('0x2a')](_0x260f94,function(_0x50a998){if(_0x50a998[_0xac12('0x2d')]!=='VIRTUAL'){var _0x298b82={};_0x298b82[_0x50a998['name']]={'$like':'%'+_0x13b460[_0xac12('0x33')][_0xac12('0x3c')]+'%'};return _0x298b82;}})});}_0x3056ad=_[_0xac12('0x3b')]({},_0x3056ad,_0x13b460[_0xac12('0x3d')]);var _0x382bdb={'where':_0x3056ad['where']};return db[_0xac12('0x2b')][_0xac12('0x1d')](_0x382bdb)['then'](function(_0x349c5e){_0x53fa4a[_0xac12('0x1d')]=_0x349c5e;if(_0x13b460[_0xac12('0x33')][_0xac12('0x3e')]){_0x3056ad[_0xac12('0x3f')]=[{'all':!![]}];}return db[_0xac12('0x2b')][_0xac12('0x40')](_0x3056ad);})[_0xac12('0x24')](function(_0x22fa43){_0x53fa4a['rows']=_0x22fa43;return _0x53fa4a;})[_0xac12('0x24')](respondWithFilteredResult(_0x201122,_0x3056ad))['catch'](handleError(_0x201122,null));};exports[_0xac12('0x41')]=function(_0x11ff14,_0x16fa1c){var _0x461878={'raw':![],'where':{'id':_0x11ff14[_0xac12('0x42')]['id']}},_0x175f98={};_0x175f98[_0xac12('0x31')]=_[_0xac12('0x2f')](db[_0xac12('0x2b')][_0xac12('0x43')]);_0x175f98[_0xac12('0x33')]=_[_0xac12('0x2f')](_0x11ff14[_0xac12('0x33')]);_0x175f98[_0xac12('0x30')]=_[_0xac12('0x44')](_0x175f98[_0xac12('0x31')],_0x175f98[_0xac12('0x33')]);_0x461878['attributes']=_[_0xac12('0x44')](_0x175f98[_0xac12('0x31')],qs['fields'](_0x11ff14[_0xac12('0x33')][_0xac12('0x34')]));_0x461878[_0xac12('0x32')]=_0x461878[_0xac12('0x32')][_0xac12('0x45')]?_0x461878[_0xac12('0x32')]:_0x175f98[_0xac12('0x31')];if(_0x11ff14[_0xac12('0x33')]['includeAll']){_0x461878[_0xac12('0x3f')]=[{'all':!![]}];}_0x461878=_['merge']({},_0x461878,_0x11ff14['options']);return db[_0xac12('0x2b')][_0xac12('0x46')](_0x461878)['then'](handleEntityNotFound(_0x16fa1c,null))[_0xac12('0x24')](respondWithResult(_0x16fa1c,null))['catch'](handleError(_0x16fa1c,null));};exports[_0xac12('0x47')]=function(_0x1dc50d,_0x1ba08d){return db[_0xac12('0x2b')]['create'](_0x1dc50d[_0xac12('0x48')],{})[_0xac12('0x24')](respondWithResult(_0x1ba08d,0xc9))[_0xac12('0x49')](handleError(_0x1ba08d,null));};exports[_0xac12('0x23')]=function(_0x2a3f7e,_0x3ad3c9){if(_0x2a3f7e['body']['id']){delete _0x2a3f7e['body']['id'];}return db[_0xac12('0x2b')]['find']({'where':{'id':_0x2a3f7e['params']['id']}})[_0xac12('0x24')](handleEntityNotFound(_0x3ad3c9,null))[_0xac12('0x24')](saveUpdates(_0x2a3f7e[_0xac12('0x48')],null))['then'](respondWithResult(_0x3ad3c9,null))[_0xac12('0x49')](handleError(_0x3ad3c9,null));};exports[_0xac12('0x25')]=function(_0x5bfaf2,_0x14d14e){return db[_0xac12('0x2b')]['find']({'where':{'id':_0x5bfaf2['params']['id']}})['then'](handleEntityNotFound(_0x14d14e,null))[_0xac12('0x24')](removeEntity(_0x14d14e,null))['catch'](handleError(_0x14d14e,null));};exports[_0xac12('0x4a')]=function(_0x1119ad,_0x4eeb50,_0x4754e3){var _0x7b1df3={};var _0x185145={};var _0x442da5;var _0x210f01;return db[_0xac12('0x2b')][_0xac12('0x4b')]({'where':{'id':_0x1119ad[_0xac12('0x42')]['id']}})[_0xac12('0x24')](handleEntityNotFound(_0x4eeb50,null))['then'](function(_0x27c693){if(_0x27c693){_0x442da5=_0x27c693;_0x185145[_0xac12('0x31')]=_['keys'](db[_0xac12('0x4c')][_0xac12('0x43')]);_0x185145['query']=_[_0xac12('0x2f')](_0x1119ad[_0xac12('0x33')]);_0x185145[_0xac12('0x30')]=_['intersection'](_0x185145[_0xac12('0x31')],_0x185145[_0xac12('0x33')]);_0x7b1df3['attributes']=_[_0xac12('0x44')](_0x185145['model'],qs[_0xac12('0x34')](_0x1119ad[_0xac12('0x33')][_0xac12('0x34')]));_0x7b1df3['attributes']=_0x7b1df3[_0xac12('0x32')][_0xac12('0x45')]?_0x7b1df3['attributes']:_0x185145[_0xac12('0x31')];_0x7b1df3[_0xac12('0x37')]=qs[_0xac12('0x38')](_0x1119ad[_0xac12('0x33')]['sort']);_0x7b1df3[_0xac12('0x39')]=qs[_0xac12('0x30')](_[_0xac12('0x3a')](_0x1119ad[_0xac12('0x33')],_0x185145[_0xac12('0x30')]));if(_0x1119ad[_0xac12('0x33')][_0xac12('0x3c')]){_0x7b1df3[_0xac12('0x39')]=_[_0xac12('0x3b')](_0x7b1df3[_0xac12('0x39')],{'$or':_[_0xac12('0x2a')](_0x7b1df3[_0xac12('0x32')],function(_0x5eb157){var _0x53e84b={};_0x53e84b[_0x5eb157]={'$like':'%'+_0x1119ad['query'][_0xac12('0x3c')]+'%'};return _0x53e84b;})});}_0x7b1df3=_[_0xac12('0x3b')]({},_0x7b1df3,_0x1119ad['options']);return _0x442da5['getConfigurations'](_0x7b1df3);}})[_0xac12('0x24')](function(_0x301187){if(_0x301187){_0x210f01=_0x301187[_0xac12('0x45')];if(!_0x1119ad[_0xac12('0x33')][_0xac12('0x35')](_0xac12('0x36'))){_0x7b1df3[_0xac12('0x1e')]=qs[_0xac12('0x1e')](_0x1119ad[_0xac12('0x33')][_0xac12('0x1e')]);_0x7b1df3[_0xac12('0x1b')]=qs[_0xac12('0x1b')](_0x1119ad[_0xac12('0x33')]['offset']);}return _0x442da5[_0xac12('0x4a')](_0x7b1df3);}})['then'](function(_0x1c9e00){if(_0x1c9e00){return _0x1c9e00?{'count':_0x210f01,'rows':_0x1c9e00}:null;}})[_0xac12('0x24')](respondWithResult(_0x4eeb50,null))[_0xac12('0x49')](handleError(_0x4eeb50,null));};exports[_0xac12('0x4d')]=function(_0x4b6f04,_0x172510,_0x3409f3){if(_0x4b6f04[_0xac12('0x48')]['id']){delete _0x4b6f04['body']['id'];}return db[_0xac12('0x2b')][_0xac12('0x4b')]({'where':{'id':_0x4b6f04['params']['id']}})[_0xac12('0x24')](handleEntityNotFound(_0x172510,null))[_0xac12('0x24')](function(_0x49c68d){if(_0x49c68d){_0x4b6f04[_0xac12('0x48')][_0xac12('0x4e')]=_0x49c68d['id'];_0x4b6f04[_0xac12('0x48')][_0xac12('0x4f')]=integrations[_0xac12('0x50')](_0x4b6f04[_0xac12('0x48')][_0xac12('0x51')],_0x4b6f04[_0xac12('0x48')][_0xac12('0x2d')]);_0x4b6f04['body'][_0xac12('0x52')]=integrations[_0xac12('0x53')](_0x4b6f04[_0xac12('0x48')]['channel'],_0x4b6f04['body'][_0xac12('0x2d')]);return db[_0xac12('0x4c')][_0xac12('0x47')](_0x4b6f04[_0xac12('0x48')],{'include':[{'model':db['VtigerField'],'as':_0xac12('0x4f')},{'model':db[_0xac12('0x54')],'as':_0xac12('0x52')}]});}return null;})[_0xac12('0x24')](respondWithResult(_0x172510,null))['catch'](handleError(_0x172510,null));};var md5=require('md5');exports['getFields']=function(_0x5c12e4,_0x1c5d9b,_0xdcf81){var _0x3d2069=null;var _0x53c214=null;var _0x192edd=null;var _0x2fd629=null;var _0x25fe93='';return db['VtigerAccount'][_0xac12('0x4b')]({'where':{'id':_0x5c12e4[_0xac12('0x42')]['id']},'attributes':['id',_0xac12('0x28'),_0xac12('0x55'),'description',_0xac12('0x56'),_0xac12('0x57'),'serverUrl',_0xac12('0x58')]})[_0xac12('0x24')](handleEntityNotFound(_0x1c5d9b,null))[_0xac12('0x24')](function(_0x52f300){if(_0x52f300){_0x3d2069=_0x52f300['username'];_0x53c214=_0x52f300[_0xac12('0x58')];_0x192edd=_0x52f300[_0xac12('0x56')];_0x25fe93=_0x52f300[_0xac12('0x57')];var _0x1b324a=_0x25fe93[_0xac12('0x59')](-0x1);if(_0x1b324a==='/'){_0x25fe93=_0x25fe93[_0xac12('0x5a')](0x0,_0x25fe93[_0xac12('0x5b')](_0x1b324a));}_0x2fd629=util['format'](_0xac12('0x5c'),_0x25fe93);var _0x22936c={'method':_0xac12('0x5d'),'uri':_0x2fd629,'qs':{'operation':_0xac12('0x5e'),'username':_0x52f300[_0xac12('0x55')]},'json':!![]};return rp(_0x22936c);}})[_0xac12('0x24')](function(_0x32860e){if(_0x32860e['success']){var _0x3bce56={'method':'POST','uri':_0x2fd629,'form':{'operation':'login','username':_0x3d2069,'accessKey':md5(_0x32860e[_0xac12('0x5f')]['token']+_0x53c214)},'json':!![]};return rp(_0x3bce56);}})['then'](function(_0x424eda){if(_0x424eda[_0xac12('0x60')]){var _0x35839f={'method':_0xac12('0x5d'),'uri':_0x2fd629,'qs':{'operation':_0xac12('0x61'),'username':_0x3d2069,'sessionName':_0x424eda[_0xac12('0x5f')][_0xac12('0x62')],'elementType':_0x192edd},'json':!![]};return rp(_0x35839f);}})[_0xac12('0x24')](function(_0x178da1){if(_0x178da1['success']){var _0x4b82a4=[_0xac12('0x63'),_0xac12('0x64'),_0xac12('0x65')];_[_0xac12('0x66')](_0x178da1[_0xac12('0x5f')]['fields'],function(_0x40f72f){return _0x4b82a4[_0xac12('0x67')](_0x40f72f[_0xac12('0x2d')][_0xac12('0x28')]);});_[_0xac12('0x66')](_0x178da1[_0xac12('0x5f')][_0xac12('0x34')],function(_0x4ba8aa){return _0x4ba8aa['editable']==='false';});return{'count':_0x178da1[_0xac12('0x5f')][_0xac12('0x34')][_0xac12('0x45')],'rows':_[_0xac12('0x2a')](_0x178da1['result'][_0xac12('0x34')],function(_0x15bcc4){return{'id':_0x15bcc4[_0xac12('0x28')],'name':_0x15bcc4[_0xac12('0x68')],'custom':_[_0xac12('0x69')](_0x15bcc4['name'],'cf_')?!![]:![],'options':_0x15bcc4[_0xac12('0x2d')][_0xac12('0x28')]===_0xac12('0x6a')&&_0x15bcc4[_0xac12('0x2d')][_0xac12('0x6b')][_0xac12('0x45')]>0x0?_[_0xac12('0x2a')](_0x15bcc4[_0xac12('0x2d')]['picklistValues'],function(_0xcebdd7){return{'name':_0xcebdd7['label'],'value':_0xcebdd7['value']};}):[]};})};}})[_0xac12('0x24')](respondWithResult(_0x1c5d9b,null))[_0xac12('0x49')](function(_0x469ffa){console[_0xac12('0x6c')](_0xac12('0x6d')+_0x469ffa);var _0x16670e=_0x5c12e4[_0xac12('0x33')][_0xac12('0x6e')]?0x1f4:_0x469ffa[_0xac12('0x6f')]||0x1f4;logger[_0xac12('0x26')](_0xac12('0x70'),_0xac12('0x71'),_0x16670e,JSON[_0xac12('0x72')](_0x469ffa));delete _0x469ffa['name'];if(_0x16670e===0x191){_0x16670e=0x190;}_0x1c5d9b[_0xac12('0x19')](_0x16670e)['send'](_0x5c12e4[_0xac12('0x33')][_0xac12('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x469ffa[_0xac12('0x6f')]}:_0x469ffa);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 1b7fe85..e5b39b4 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 _0x14d8=['define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','../../components/integrations/configuration','exports'];(function(_0x3a9427,_0x27078f){var _0x2f8840=function(_0x546dbf){while(--_0x546dbf){_0x3a9427['push'](_0x3a9427['shift']());}};_0x2f8840(++_0x27078f);}(_0x14d8,0x87));var _0x814d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x14d8[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x814d('0x0'));var util=require(_0x814d('0x1'));var logger=require(_0x814d('0x2'))(_0x814d('0x3'));var moment=require(_0x814d('0x4'));var BPromise=require(_0x814d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x814d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x814d('0x7'));module[_0x814d('0x8')]=function(_0x105932,_0x52e4c5){return _0x105932[_0x814d('0x9')](_0x814d('0xa'),attributes,{'tableName':_0x814d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6e6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash'];(function(_0x1641b1,_0x198255){var _0x2b6b9c=function(_0x1cd5d4){while(--_0x1cd5d4){_0x1641b1['push'](_0x1641b1['shift']());}};_0x2b6b9c(++_0x198255);}(_0xa6e6,0xb5));var _0x6a6e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa6e6[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x6a6e('0x0'));var util=require(_0x6a6e('0x1'));var logger=require('../../config/logger')(_0x6a6e('0x2'));var moment=require(_0x6a6e('0x3'));var BPromise=require(_0x6a6e('0x4'));var rp=require(_0x6a6e('0x5'));var fs=require('fs');var path=require(_0x6a6e('0x6'));var rimraf=require(_0x6a6e('0x7'));var config=require(_0x6a6e('0x8'));var attributes=require(_0x6a6e('0x9'));var integrations=require(_0x6a6e('0xa'));module[_0x6a6e('0xb')]=function(_0x48e12b,_0x30fe46){return _0x48e12b[_0x6a6e('0xc')](_0x6a6e('0xd'),attributes,{'tableName':'int_vtiger_accounts','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 34536ef..3b7a86c 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 _0x91a7=['VtigerAccount,\x20%s,\x20%s','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','ShowVtigerAccount','VtigerAccount','find','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','message'];(function(_0x4a3553,_0x12e68f){var _0x569d42=function(_0x28860d){while(--_0x28860d){_0x4a3553['push'](_0x4a3553['shift']());}};_0x569d42(++_0x12e68f);}(_0x91a7,0xe7));var _0x791a=function(_0x502985,_0x2c995b){_0x502985=_0x502985-0x0;var _0x5b5499=_0x91a7[_0x502985];return _0x5b5499;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var moment=require(_0x791a('0x1'));var BPromise=require(_0x791a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x791a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x791a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x791a('0x5'));var jayson=require(_0x791a('0x6'));var client=jayson['client'][_0x791a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5db6db,_0x33baac,_0x159e24){return new BPromise(function(_0x5aa10a,_0x1a32b4){return client[_0x791a('0x8')](_0x5db6db,_0x159e24)[_0x791a('0x9')](function(_0x80ff65){logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));logger[_0x791a('0xc')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'),JSON[_0x791a('0xd')](_0x80ff65));if(_0x80ff65[_0x791a('0xe')]){if(_0x80ff65[_0x791a('0xe')][_0x791a('0xf')]===0x1f4){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x1a32b4(_0x80ff65[_0x791a('0xe')]['message']);}logger[_0x791a('0xe')](_0x791a('0x11'),_0x33baac,_0x80ff65['error'][_0x791a('0x10')]);return _0x5aa10a(_0x80ff65[_0x791a('0xe')][_0x791a('0x10')]);}else{logger[_0x791a('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x791a('0xb'));_0x5aa10a(_0x80ff65['result'][_0x791a('0x10')]);}})[_0x791a('0x12')](function(_0x49ae3e){logger[_0x791a('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x33baac,_0x49ae3e);_0x1a32b4(_0x49ae3e);});});}exports[_0x791a('0x13')]=function(_0x52941d){var _0x4a84ee=this;return new Promise(function(_0x588d00,_0x40f0d3){return db['VtigerAccount']['findAll']({'raw':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x15')]===undefined?!![]:![]:!![],'where':_0x52941d[_0x791a('0x14')]?_0x52941d['options'][_0x791a('0x16')]||null:null,'attributes':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x17')]||null:null,'limit':_0x52941d['options']?_0x52941d[_0x791a('0x14')][_0x791a('0x18')]||null:null,'include':_0x52941d[_0x791a('0x14')]?_0x52941d[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x52941d[_0x791a('0x14')][_0x791a('0x19')],function(_0x323c6a){return{'model':db[_0x323c6a[_0x791a('0x1b')]],'as':_0x323c6a['as'],'attributes':_0x323c6a[_0x791a('0x17')],'include':_0x323c6a['include']?_[_0x791a('0x1a')](_0x323c6a[_0x791a('0x19')],function(_0x380329){return{'model':db[_0x380329[_0x791a('0x1b')]],'as':_0x380329['as'],'attributes':_0x380329['attributes'],'include':_0x380329[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x380329['include'],function(_0xdfa84f){return{'model':db[_0xdfa84f[_0x791a('0x1b')]],'as':_0xdfa84f['as'],'attributes':_0xdfa84f[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29194d){logger[_0x791a('0xa')](_0x791a('0x13'),_0x52941d);logger[_0x791a('0xc')](_0x791a('0x13'),_0x52941d,JSON[_0x791a('0xd')](_0x29194d));_0x588d00(_0x29194d);})[_0x791a('0x12')](function(_0x889534){logger['error'](_0x791a('0x13'),_0x889534[_0x791a('0x10')],_0x52941d);_0x40f0d3(_0x4a84ee[_0x791a('0xe')](0x1f4,_0x889534['message']));});});};exports[_0x791a('0x1c')]=function(_0x5df656){var _0xc59f5e=this;return new Promise(function(_0x2e4ec8,_0xcde862){return db[_0x791a('0x1d')][_0x791a('0x1e')]({'raw':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x16')]||null:null,'attributes':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')]['attributes']||null:null,'include':_0x5df656[_0x791a('0x14')]?_0x5df656[_0x791a('0x14')][_0x791a('0x19')]?_[_0x791a('0x1a')](_0x5df656[_0x791a('0x14')]['include'],function(_0x305836){return{'model':db[_0x305836[_0x791a('0x1b')]],'as':_0x305836['as'],'attributes':_0x305836[_0x791a('0x17')],'include':_0x305836[_0x791a('0x19')]?_[_0x791a('0x1a')](_0x305836['include'],function(_0xd5609){return{'model':db[_0xd5609['model']],'as':_0xd5609['as'],'attributes':_0xd5609[_0x791a('0x17')],'include':_0xd5609['include']?_['map'](_0xd5609[_0x791a('0x19')],function(_0x404530){return{'model':db[_0x404530[_0x791a('0x1b')]],'as':_0x404530['as'],'attributes':_0x404530[_0x791a('0x17')]};}):[]};}):[]};}):[]:[]})[_0x791a('0x9')](function(_0x3f46be){logger[_0x791a('0xa')]('ShowVtigerAccount',_0x5df656);logger[_0x791a('0xc')]('ShowVtigerAccount',_0x5df656,JSON[_0x791a('0xd')](_0x3f46be));_0x2e4ec8(_0x3f46be);})['catch'](function(_0x25e8cc){logger[_0x791a('0xe')]('ShowVtigerAccount',_0x25e8cc[_0x791a('0x10')],_0x5df656);_0xcde862(_0xc59f5e[_0x791a('0xe')](0x1f4,_0x25e8cc['message']));});});}; \ No newline at end of file +var _0x97c1=['error','message','result','catch','VtigerAccount','findAll','options','raw','attributes','limit','include','map','model','then','GetVtigerAccount','debug','find','where','ShowVtigerAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47f839,_0x54ddca){var _0x2cd6ef=function(_0x49352e){while(--_0x49352e){_0x47f839['push'](_0x47f839['shift']());}};_0x2cd6ef(++_0x54ddca);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var moment=require('moment');var BPromise=require(_0x197c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x197c('0x3'))['db'];var utils=require(_0x197c('0x4'));var logger=require(_0x197c('0x5'))(_0x197c('0x6'));var config=require(_0x197c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x197c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x60fab2,_0xfcee35){return new BPromise(function(_0x5cf5cb,_0x5d42c5){return client[_0x197c('0x9')](_0x437214,_0xfcee35)['then'](function(_0x339fab){logger[_0x197c('0xa')](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));logger['debug'](_0x197c('0xd'),_0x60fab2,_0x197c('0xc'),JSON[_0x197c('0xe')](_0x339fab));if(_0x339fab[_0x197c('0xf')]){if(_0x339fab[_0x197c('0xf')]['code']===0x1f4){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5d42c5(_0x339fab['error'][_0x197c('0x10')]);}logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x339fab[_0x197c('0xf')][_0x197c('0x10')]);return _0x5cf5cb(_0x339fab[_0x197c('0xf')]['message']);}else{logger['info'](_0x197c('0xb'),_0x60fab2,_0x197c('0xc'));_0x5cf5cb(_0x339fab[_0x197c('0x11')][_0x197c('0x10')]);}})[_0x197c('0x12')](function(_0x7e302f){logger[_0x197c('0xf')](_0x197c('0xb'),_0x60fab2,_0x7e302f);_0x5d42c5(_0x7e302f);});});}exports['GetVtigerAccount']=function(_0x372311){var _0x47aaa9=this;return new Promise(function(_0x50ac52,_0x1725d9){return db[_0x197c('0x13')][_0x197c('0x14')]({'raw':_0x372311[_0x197c('0x15')]?_0x372311['options'][_0x197c('0x16')]===undefined?!![]:![]:!![],'where':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')]['where']||null:null,'attributes':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x17')]||null:null,'limit':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x18')]||null:null,'include':_0x372311[_0x197c('0x15')]?_0x372311[_0x197c('0x15')][_0x197c('0x19')]?_[_0x197c('0x1a')](_0x372311[_0x197c('0x15')][_0x197c('0x19')],function(_0x174942){return{'model':db[_0x174942[_0x197c('0x1b')]],'as':_0x174942['as'],'attributes':_0x174942[_0x197c('0x17')],'include':_0x174942[_0x197c('0x19')]?_['map'](_0x174942[_0x197c('0x19')],function(_0x2911dd){return{'model':db[_0x2911dd[_0x197c('0x1b')]],'as':_0x2911dd['as'],'attributes':_0x2911dd['attributes'],'include':_0x2911dd[_0x197c('0x19')]?_[_0x197c('0x1a')](_0x2911dd['include'],function(_0x5e7bc9){return{'model':db[_0x5e7bc9[_0x197c('0x1b')]],'as':_0x5e7bc9['as'],'attributes':_0x5e7bc9['attributes']};}):[]};}):[]};}):[]:[]})[_0x197c('0x1c')](function(_0x14b0aa){logger[_0x197c('0xa')](_0x197c('0x1d'),_0x372311);logger[_0x197c('0x1e')](_0x197c('0x1d'),_0x372311,JSON[_0x197c('0xe')](_0x14b0aa));_0x50ac52(_0x14b0aa);})[_0x197c('0x12')](function(_0x4422d1){logger['error']('GetVtigerAccount',_0x4422d1['message'],_0x372311);_0x1725d9(_0x47aaa9['error'](0x1f4,_0x4422d1[_0x197c('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x252cde){var _0x35dbf3=this;return new Promise(function(_0x58bc60,_0x422ac6){return db['VtigerAccount'][_0x197c('0x1f')]({'raw':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')][_0x197c('0x16')]===undefined?!![]:![]:!![],'where':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')][_0x197c('0x20')]||null:null,'attributes':_0x252cde[_0x197c('0x15')]?_0x252cde[_0x197c('0x15')]['attributes']||null:null,'include':_0x252cde['options']?_0x252cde[_0x197c('0x15')][_0x197c('0x19')]?_[_0x197c('0x1a')](_0x252cde[_0x197c('0x15')][_0x197c('0x19')],function(_0x1cb7e8){return{'model':db[_0x1cb7e8[_0x197c('0x1b')]],'as':_0x1cb7e8['as'],'attributes':_0x1cb7e8['attributes'],'include':_0x1cb7e8['include']?_[_0x197c('0x1a')](_0x1cb7e8[_0x197c('0x19')],function(_0x4d085b){return{'model':db[_0x4d085b['model']],'as':_0x4d085b['as'],'attributes':_0x4d085b[_0x197c('0x17')],'include':_0x4d085b[_0x197c('0x19')]?_[_0x197c('0x1a')](_0x4d085b[_0x197c('0x19')],function(_0x45095c){return{'model':db[_0x45095c[_0x197c('0x1b')]],'as':_0x45095c['as'],'attributes':_0x45095c[_0x197c('0x17')]};}):[]};}):[]};}):[]:[]})[_0x197c('0x1c')](function(_0x44ce68){logger['info'](_0x197c('0x21'),_0x252cde);logger[_0x197c('0x1e')](_0x197c('0x21'),_0x252cde,JSON[_0x197c('0xe')](_0x44ce68));_0x58bc60(_0x44ce68);})[_0x197c('0x12')](function(_0x151e2f){logger['error'](_0x197c('0x21'),_0x151e2f[_0x197c('0x10')],_0x252cde);_0x422ac6(_0x35dbf3[_0x197c('0xf')](0x1f4,_0x151e2f['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f40b069..17b2395 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 _0x4af0=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x51c70f,_0x27ed11){var _0x38adc8=function(_0x84f046){while(--_0x84f046){_0x51c70f['push'](_0x51c70f['shift']());}};_0x38adc8(++_0x27ed11);}(_0x4af0,0xad));var _0x04af=function(_0x28ae25,_0xe28f5){_0x28ae25=_0x28ae25-0x0;var _0x225012=_0x4af0[_0x28ae25];return _0x225012;};'use strict';var multer=require(_0x04af('0x0'));var util=require(_0x04af('0x1'));var path=require(_0x04af('0x2'));var timeout=require(_0x04af('0x3'));var express=require('express');var router=express[_0x04af('0x4')]();var fs_extra=require(_0x04af('0x5'));var auth=require(_0x04af('0x6'));var interaction=require(_0x04af('0x7'));var config=require(_0x04af('0x8'));var controller=require(_0x04af('0x9'));router[_0x04af('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x04af('0xa')](_0x04af('0xb'),auth[_0x04af('0xc')](),controller[_0x04af('0xd')]);router[_0x04af('0xa')](_0x04af('0xe'),auth[_0x04af('0xc')](),controller[_0x04af('0xf')]);router[_0x04af('0xa')](_0x04af('0x10'),auth[_0x04af('0xc')](),controller[_0x04af('0x11')]);router[_0x04af('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0x04af('0x12')]('/',auth[_0x04af('0xc')](),controller[_0x04af('0x13')]);router[_0x04af('0x14')](_0x04af('0xb'),auth[_0x04af('0xc')](),controller[_0x04af('0x15')]);router[_0x04af('0x16')](_0x04af('0xb'),auth[_0x04af('0xc')](),controller[_0x04af('0x17')]);module[_0x04af('0x18')]=router; \ No newline at end of file +var _0x0f42=['../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x0f42,0x1da));var _0x20f4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0f42[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x20f4('0x0'));var path=require(_0x20f4('0x1'));var timeout=require(_0x20f4('0x2'));var express=require(_0x20f4('0x3'));var router=express[_0x20f4('0x4')]();var fs_extra=require(_0x20f4('0x5'));var auth=require(_0x20f4('0x6'));var interaction=require(_0x20f4('0x7'));var config=require('../../config/environment');var controller=require(_0x20f4('0x8'));router[_0x20f4('0x9')]('/',auth[_0x20f4('0xa')](),controller[_0x20f4('0xb')]);router[_0x20f4('0x9')](_0x20f4('0xc'),auth[_0x20f4('0xa')](),controller[_0x20f4('0xd')]);router[_0x20f4('0x9')](_0x20f4('0xe'),auth['isAuthenticated'](),controller[_0x20f4('0xf')]);router[_0x20f4('0x9')](_0x20f4('0x10'),auth[_0x20f4('0xa')](),controller['getSubjects']);router[_0x20f4('0x9')]('/:id/descriptions',auth[_0x20f4('0xa')](),controller[_0x20f4('0x11')]);router[_0x20f4('0x12')]('/',auth[_0x20f4('0xa')](),controller[_0x20f4('0x13')]);router[_0x20f4('0x14')](_0x20f4('0xc'),auth[_0x20f4('0xa')](),controller['update']);router[_0x20f4('0x15')](_0x20f4('0xc'),auth[_0x20f4('0xa')](),controller[_0x20f4('0x16')]);module[_0x20f4('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 3e729c6..39b427e 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 _0x3fd7=['exports','sequelize'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x3fd7,0x9f));var _0x73fd=function(_0x1bd6c8,_0x4b786b){_0x1bd6c8=_0x1bd6c8-0x0;var _0x5378fc=_0x3fd7[_0x1bd6c8];return _0x5378fc;};'use strict';var Sequelize=require(_0x73fd('0x0'));module[_0x73fd('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7714=['exports','STRING','sequelize'];(function(_0x53fea8,_0x10d51b){var _0x3c121d=function(_0x257db5){while(--_0x257db5){_0x53fea8['push'](_0x53fea8['shift']());}};_0x3c121d(++_0x10d51b);}(_0x7714,0x1b5));var _0x4771=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x7714[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0x4771('0x0'));module[_0x4771('0x1')]={'name':{'type':Sequelize[_0x4771('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 9682298..21e6ad5 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 _0xcb67=['pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','params','getFields','findOne','VtigerField','nolimit','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','squel','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','end','status','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x2c9b79,_0x7cf58b){var _0x265032=function(_0x188a92){while(--_0x188a92){_0x2c9b79['push'](_0x2c9b79['shift']());}};_0x265032(++_0x7cf58b);}(_0xcb67,0x15f));var _0x7cb6=function(_0x4c321c,_0x3e9da0){_0x4c321c=_0x4c321c-0x0;var _0x25accb=_0xcb67[_0x4c321c];return _0x25accb;};'use strict';var emlformat=require(_0x7cb6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7cb6('0x1'));var rp=require(_0x7cb6('0x2'));var moment=require(_0x7cb6('0x3'));var BPromise=require(_0x7cb6('0x4'));var Mustache=require('mustache');var util=require(_0x7cb6('0x5'));var path=require('path');var sox=require(_0x7cb6('0x6'));var csv=require('to-csv');var ejs=require(_0x7cb6('0x7'));var fs=require('fs');var fs_extra=require(_0x7cb6('0x8'));var _=require('lodash');var squel=require(_0x7cb6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7cb6('0xa'));var toCsv=require(_0x7cb6('0xb'));var querystring=require(_0x7cb6('0xc'));var Papa=require(_0x7cb6('0xd'));var Redis=require(_0x7cb6('0xe'));var authService=require(_0x7cb6('0xf'));var qs=require(_0x7cb6('0x10'));var as=require(_0x7cb6('0x11'));var hardwareService=require(_0x7cb6('0x12'));var logger=require(_0x7cb6('0x13'))(_0x7cb6('0x14'));var utils=require(_0x7cb6('0x15'));var config=require(_0x7cb6('0x16'));var licenseUtil=require(_0x7cb6('0x17'));var db=require(_0x7cb6('0x18'))['db'];function respondWithStatusCode(_0x5bbd48,_0x518ed7){_0x518ed7=_0x518ed7||0xcc;return function(_0x3a2324){if(_0x3a2324){return _0x5bbd48[_0x7cb6('0x19')](_0x518ed7);}return _0x5bbd48['status'](_0x518ed7)[_0x7cb6('0x1a')]();};}function respondWithResult(_0x451822,_0x503e1f){_0x503e1f=_0x503e1f||0xc8;return function(_0x17af51){if(_0x17af51){return _0x451822[_0x7cb6('0x1b')](_0x503e1f)[_0x7cb6('0x1c')](_0x17af51);}};}function respondWithFilteredResult(_0x144811,_0x2e7bab){return function(_0x32d058){if(_0x32d058){var _0x277a1b=typeof _0x2e7bab[_0x7cb6('0x1d')]===_0x7cb6('0x1e')&&typeof _0x2e7bab['limit']==='undefined';var _0x1f9157=_0x32d058[_0x7cb6('0x1f')];var _0x5d6de9=_0x277a1b?0x0:_0x2e7bab[_0x7cb6('0x1d')];var _0x4421e6=_0x277a1b?_0x32d058['count']:_0x2e7bab[_0x7cb6('0x1d')]+_0x2e7bab[_0x7cb6('0x20')];var _0x3b872e;if(_0x4421e6>=_0x1f9157){_0x4421e6=_0x1f9157;_0x3b872e=0xc8;}else{_0x3b872e=0xce;}_0x144811['status'](_0x3b872e);return _0x144811['set'](_0x7cb6('0x21'),_0x5d6de9+'-'+_0x4421e6+'/'+_0x1f9157)[_0x7cb6('0x1c')](_0x32d058);}return null;};}function patchUpdates(_0x4f6145){return function(_0x1eeaf7){try{jsonpatch['apply'](_0x1eeaf7,_0x4f6145,!![]);}catch(_0x15dc20){return BPromise[_0x7cb6('0x22')](_0x15dc20);}return _0x1eeaf7[_0x7cb6('0x23')]();};}function saveUpdates(_0x5bef48,_0x4baec5){return function(_0x3e0bb5){if(_0x3e0bb5){return _0x3e0bb5[_0x7cb6('0x24')](_0x5bef48)[_0x7cb6('0x25')](function(_0x571b27){return _0x571b27;});}return null;};}function removeEntity(_0x155c19,_0x11d21d){return function(_0x42c179){if(_0x42c179){return _0x42c179[_0x7cb6('0x26')]()[_0x7cb6('0x25')](function(){_0x155c19['status'](0xcc)[_0x7cb6('0x1a')]();});}};}function handleEntityNotFound(_0x1ba53d,_0x4967bd){return function(_0x128f1d){if(!_0x128f1d){_0x1ba53d['sendStatus'](0x194);}return _0x128f1d;};}function handleError(_0x4429ff,_0x2cfa37){_0x2cfa37=_0x2cfa37||0x1f4;return function(_0x4a01b8){logger[_0x7cb6('0x27')](_0x4a01b8[_0x7cb6('0x28')]);if(_0x4a01b8[_0x7cb6('0x29')]){delete _0x4a01b8[_0x7cb6('0x29')];}_0x4429ff[_0x7cb6('0x1b')](_0x2cfa37)[_0x7cb6('0x2a')](_0x4a01b8);};}exports[_0x7cb6('0x2b')]=function(_0x5189d2,_0x15fbb4){var _0x4ea257={},_0x60b879={},_0xc24df0={'count':0x0,'rows':[]};var _0x2279e1=_[_0x7cb6('0x2c')](db[_0x7cb6('0x2d')]['rawAttributes'],function(_0x2bc6d1){return{'name':_0x2bc6d1['fieldName'],'type':_0x2bc6d1['type'][_0x7cb6('0x2e')]};});_0x60b879[_0x7cb6('0x2f')]=_[_0x7cb6('0x2c')](_0x2279e1,'name');_0x60b879[_0x7cb6('0x30')]=_[_0x7cb6('0x31')](_0x5189d2[_0x7cb6('0x30')]);_0x60b879[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x60b879[_0x7cb6('0x2f')],_0x60b879[_0x7cb6('0x30')]);_0x4ea257['attributes']=_[_0x7cb6('0x33')](_0x60b879[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x5189d2['query']['fields']));_0x4ea257[_0x7cb6('0x35')]=_0x4ea257[_0x7cb6('0x35')][_0x7cb6('0x36')]?_0x4ea257[_0x7cb6('0x35')]:_0x60b879[_0x7cb6('0x2f')];if(!_0x5189d2['query'][_0x7cb6('0x37')]('nolimit')){_0x4ea257[_0x7cb6('0x20')]=qs['limit'](_0x5189d2[_0x7cb6('0x30')]['limit']);_0x4ea257[_0x7cb6('0x1d')]=qs['offset'](_0x5189d2['query'][_0x7cb6('0x1d')]);}_0x4ea257[_0x7cb6('0x38')]=qs['sort'](_0x5189d2[_0x7cb6('0x30')][_0x7cb6('0x39')]);_0x4ea257[_0x7cb6('0x3a')]=qs[_0x7cb6('0x32')](_[_0x7cb6('0x3b')](_0x5189d2['query'],_0x60b879[_0x7cb6('0x32')]),_0x2279e1);if(_0x5189d2['query'][_0x7cb6('0x3c')]){_0x4ea257[_0x7cb6('0x3a')]=_[_0x7cb6('0x3d')](_0x4ea257[_0x7cb6('0x3a')],{'$or':_[_0x7cb6('0x2c')](_0x2279e1,function(_0x5696f0){if(_0x5696f0[_0x7cb6('0x3e')]!==_0x7cb6('0x3f')){var _0x4b4d83={};_0x4b4d83[_0x5696f0[_0x7cb6('0x29')]]={'$like':'%'+_0x5189d2[_0x7cb6('0x30')][_0x7cb6('0x3c')]+'%'};return _0x4b4d83;}})});}_0x4ea257=_[_0x7cb6('0x3d')]({},_0x4ea257,_0x5189d2[_0x7cb6('0x40')]);var _0x4a1b14={'where':_0x4ea257['where']};return db[_0x7cb6('0x2d')][_0x7cb6('0x1f')](_0x4a1b14)[_0x7cb6('0x25')](function(_0x1a37d4){_0xc24df0['count']=_0x1a37d4;if(_0x5189d2[_0x7cb6('0x30')][_0x7cb6('0x41')]){_0x4ea257[_0x7cb6('0x42')]=[{'all':!![]}];}return db[_0x7cb6('0x2d')][_0x7cb6('0x43')](_0x4ea257);})[_0x7cb6('0x25')](function(_0x15e616){_0xc24df0[_0x7cb6('0x44')]=_0x15e616;return _0xc24df0;})[_0x7cb6('0x25')](respondWithFilteredResult(_0x15fbb4,_0x4ea257))['catch'](handleError(_0x15fbb4,null));};exports[_0x7cb6('0x45')]=function(_0x7d90d2,_0x49721b){var _0x2d5a5d={'raw':![],'where':{'id':_0x7d90d2['params']['id']}},_0x4c7dc3={};_0x4c7dc3[_0x7cb6('0x2f')]=_[_0x7cb6('0x31')](db[_0x7cb6('0x2d')][_0x7cb6('0x46')]);_0x4c7dc3['query']=_['keys'](_0x7d90d2[_0x7cb6('0x30')]);_0x4c7dc3[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x4c7dc3[_0x7cb6('0x2f')],_0x4c7dc3[_0x7cb6('0x30')]);_0x2d5a5d[_0x7cb6('0x35')]=_['intersection'](_0x4c7dc3[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x7d90d2[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x2d5a5d[_0x7cb6('0x35')]=_0x2d5a5d[_0x7cb6('0x35')][_0x7cb6('0x36')]?_0x2d5a5d[_0x7cb6('0x35')]:_0x4c7dc3[_0x7cb6('0x2f')];if(_0x7d90d2['query'][_0x7cb6('0x41')]){_0x2d5a5d[_0x7cb6('0x42')]=[{'all':!![]}];}_0x2d5a5d=_[_0x7cb6('0x3d')]({},_0x2d5a5d,_0x7d90d2[_0x7cb6('0x40')]);return db[_0x7cb6('0x2d')][_0x7cb6('0x47')](_0x2d5a5d)[_0x7cb6('0x25')](handleEntityNotFound(_0x49721b,null))[_0x7cb6('0x25')](respondWithResult(_0x49721b,null))['catch'](handleError(_0x49721b,null));};exports[_0x7cb6('0x48')]=function(_0x53e026,_0x324264){return db[_0x7cb6('0x2d')][_0x7cb6('0x48')](_0x53e026[_0x7cb6('0x49')],{})['then'](respondWithResult(_0x324264,0xc9))[_0x7cb6('0x4a')](handleError(_0x324264,null));};exports[_0x7cb6('0x24')]=function(_0x186c91,_0x7af663){if(_0x186c91[_0x7cb6('0x49')]['id']){delete _0x186c91[_0x7cb6('0x49')]['id'];}return db[_0x7cb6('0x2d')]['find']({'where':{'id':_0x186c91[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x7af663,null))['then'](saveUpdates(_0x186c91[_0x7cb6('0x49')],null))[_0x7cb6('0x25')](respondWithResult(_0x7af663,null))[_0x7cb6('0x4a')](handleError(_0x7af663,null));};exports[_0x7cb6('0x26')]=function(_0x2391b9,_0x56dc26){return db['VtigerConfiguration'][_0x7cb6('0x47')]({'where':{'id':_0x2391b9[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x56dc26,null))[_0x7cb6('0x25')](removeEntity(_0x56dc26,null))[_0x7cb6('0x4a')](handleError(_0x56dc26,null));};exports[_0x7cb6('0x4c')]=function(_0x4dad08,_0x39c4cf,_0x1ffa0a){var _0x39f20d={};var _0x285799={};var _0x260309;var _0x4cd8c0;return db[_0x7cb6('0x2d')][_0x7cb6('0x4d')]({'where':{'id':_0x4dad08[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x39c4cf,null))[_0x7cb6('0x25')](function(_0x27e185){if(_0x27e185){_0x260309=_0x27e185;_0x285799[_0x7cb6('0x2f')]=_['keys'](db[_0x7cb6('0x4e')]['rawAttributes']);_0x285799[_0x7cb6('0x30')]=_[_0x7cb6('0x31')](_0x4dad08[_0x7cb6('0x30')]);_0x285799[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x285799[_0x7cb6('0x2f')],_0x285799[_0x7cb6('0x30')]);_0x39f20d[_0x7cb6('0x35')]=_[_0x7cb6('0x33')](_0x285799[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x4dad08[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x39f20d[_0x7cb6('0x35')]=_0x39f20d[_0x7cb6('0x35')]['length']?_0x39f20d[_0x7cb6('0x35')]:_0x285799[_0x7cb6('0x2f')];_0x39f20d['order']=qs['sort'](_0x4dad08['query'][_0x7cb6('0x39')]);_0x39f20d['where']=qs['filters'](_[_0x7cb6('0x3b')](_0x4dad08['query'],_0x285799[_0x7cb6('0x32')]));if(_0x4dad08[_0x7cb6('0x30')][_0x7cb6('0x3c')]){_0x39f20d[_0x7cb6('0x3a')]=_[_0x7cb6('0x3d')](_0x39f20d[_0x7cb6('0x3a')],{'$or':_[_0x7cb6('0x2c')](_0x39f20d['attributes'],function(_0x1ee76a){var _0x35628a={};_0x35628a[_0x1ee76a]={'$like':'%'+_0x4dad08['query']['filter']+'%'};return _0x35628a;})});}_0x39f20d=_[_0x7cb6('0x3d')]({},_0x39f20d,_0x4dad08['options']);return _0x260309[_0x7cb6('0x4c')](_0x39f20d);}})[_0x7cb6('0x25')](function(_0x12e570){if(_0x12e570){_0x4cd8c0=_0x12e570['length'];if(!_0x4dad08['query']['hasOwnProperty'](_0x7cb6('0x4f'))){_0x39f20d['limit']=qs['limit'](_0x4dad08['query'][_0x7cb6('0x20')]);_0x39f20d[_0x7cb6('0x1d')]=qs['offset'](_0x4dad08[_0x7cb6('0x30')]['offset']);}return _0x260309[_0x7cb6('0x4c')](_0x39f20d);}})[_0x7cb6('0x25')](function(_0x3f23de){if(_0x3f23de){return _0x3f23de?{'count':_0x4cd8c0,'rows':_0x3f23de}:null;}})[_0x7cb6('0x25')](respondWithResult(_0x39c4cf,null))['catch'](handleError(_0x39c4cf,null));};exports[_0x7cb6('0x50')]=function(_0x3516d3,_0x1eb0f5,_0x25dca0){var _0x53b63a={};var _0x3f4d61={};var _0x353ec6;var _0x2e0241;return db[_0x7cb6('0x2d')]['findOne']({'where':{'id':_0x3516d3[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x1eb0f5,null))[_0x7cb6('0x25')](function(_0x57be14){if(_0x57be14){_0x353ec6=_0x57be14;_0x3f4d61[_0x7cb6('0x2f')]=_[_0x7cb6('0x31')](db['VtigerField']['rawAttributes']);_0x3f4d61['query']=_['keys'](_0x3516d3['query']);_0x3f4d61[_0x7cb6('0x32')]=_[_0x7cb6('0x33')](_0x3f4d61[_0x7cb6('0x2f')],_0x3f4d61[_0x7cb6('0x30')]);_0x53b63a[_0x7cb6('0x35')]=_[_0x7cb6('0x33')](_0x3f4d61[_0x7cb6('0x2f')],qs['fields'](_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x53b63a[_0x7cb6('0x35')]=_0x53b63a[_0x7cb6('0x35')]['length']?_0x53b63a[_0x7cb6('0x35')]:_0x3f4d61['model'];_0x53b63a[_0x7cb6('0x38')]=qs['sort'](_0x3516d3[_0x7cb6('0x30')]['sort']);_0x53b63a[_0x7cb6('0x3a')]=qs[_0x7cb6('0x32')](_[_0x7cb6('0x3b')](_0x3516d3['query'],_0x3f4d61[_0x7cb6('0x32')]));if(_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x3c')]){_0x53b63a[_0x7cb6('0x3a')]=_['merge'](_0x53b63a['where'],{'$or':_[_0x7cb6('0x2c')](_0x53b63a[_0x7cb6('0x35')],function(_0x37e146){var _0x5450b5={};_0x5450b5[_0x37e146]={'$like':'%'+_0x3516d3[_0x7cb6('0x30')]['filter']+'%'};return _0x5450b5;})});}_0x53b63a=_[_0x7cb6('0x3d')]({},_0x53b63a,_0x3516d3[_0x7cb6('0x40')]);return _0x353ec6[_0x7cb6('0x50')](_0x53b63a);}})[_0x7cb6('0x25')](function(_0x4f5e7a){if(_0x4f5e7a){_0x2e0241=_0x4f5e7a[_0x7cb6('0x36')];if(!_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x37')](_0x7cb6('0x4f'))){_0x53b63a[_0x7cb6('0x20')]=qs['limit'](_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x20')]);_0x53b63a['offset']=qs[_0x7cb6('0x1d')](_0x3516d3[_0x7cb6('0x30')][_0x7cb6('0x1d')]);}return _0x353ec6['getSubjects'](_0x53b63a);}})['then'](function(_0x240619){if(_0x240619){return _0x240619?{'count':_0x2e0241,'rows':_0x240619}:null;}})[_0x7cb6('0x25')](respondWithResult(_0x1eb0f5,null))[_0x7cb6('0x4a')](handleError(_0x1eb0f5,null));};exports[_0x7cb6('0x51')]=function(_0x2fd4c0,_0x285b59,_0x119164){var _0x35b810={};var _0x5f2a3f={};var _0x60c9b9;var _0xd4f6fc;return db[_0x7cb6('0x2d')]['findOne']({'where':{'id':_0x2fd4c0[_0x7cb6('0x4b')]['id']}})[_0x7cb6('0x25')](handleEntityNotFound(_0x285b59,null))['then'](function(_0x3f76f0){if(_0x3f76f0){_0x60c9b9=_0x3f76f0;_0x5f2a3f[_0x7cb6('0x2f')]=_['keys'](db['VtigerField'][_0x7cb6('0x46')]);_0x5f2a3f[_0x7cb6('0x30')]=_[_0x7cb6('0x31')](_0x2fd4c0['query']);_0x5f2a3f[_0x7cb6('0x32')]=_['intersection'](_0x5f2a3f[_0x7cb6('0x2f')],_0x5f2a3f['query']);_0x35b810[_0x7cb6('0x35')]=_[_0x7cb6('0x33')](_0x5f2a3f[_0x7cb6('0x2f')],qs[_0x7cb6('0x34')](_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x34')]));_0x35b810[_0x7cb6('0x35')]=_0x35b810['attributes'][_0x7cb6('0x36')]?_0x35b810[_0x7cb6('0x35')]:_0x5f2a3f[_0x7cb6('0x2f')];_0x35b810[_0x7cb6('0x38')]=qs[_0x7cb6('0x39')](_0x2fd4c0['query'][_0x7cb6('0x39')]);_0x35b810[_0x7cb6('0x3a')]=qs[_0x7cb6('0x32')](_['pick'](_0x2fd4c0['query'],_0x5f2a3f[_0x7cb6('0x32')]));if(_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x3c')]){_0x35b810[_0x7cb6('0x3a')]=_[_0x7cb6('0x3d')](_0x35b810['where'],{'$or':_['map'](_0x35b810['attributes'],function(_0x5c1f17){var _0x9ba7a4={};_0x9ba7a4[_0x5c1f17]={'$like':'%'+_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x3c')]+'%'};return _0x9ba7a4;})});}_0x35b810=_[_0x7cb6('0x3d')]({},_0x35b810,_0x2fd4c0[_0x7cb6('0x40')]);return _0x60c9b9[_0x7cb6('0x51')](_0x35b810);}})['then'](function(_0x444498){if(_0x444498){_0xd4f6fc=_0x444498[_0x7cb6('0x36')];if(!_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x37')](_0x7cb6('0x4f'))){_0x35b810[_0x7cb6('0x20')]=qs[_0x7cb6('0x20')](_0x2fd4c0['query'][_0x7cb6('0x20')]);_0x35b810[_0x7cb6('0x1d')]=qs[_0x7cb6('0x1d')](_0x2fd4c0[_0x7cb6('0x30')][_0x7cb6('0x1d')]);}return _0x60c9b9[_0x7cb6('0x51')](_0x35b810);}})[_0x7cb6('0x25')](function(_0x21de37){if(_0x21de37){return _0x21de37?{'count':_0xd4f6fc,'rows':_0x21de37}:null;}})[_0x7cb6('0x25')](respondWithResult(_0x285b59,null))[_0x7cb6('0x4a')](handleError(_0x285b59,null));}; \ No newline at end of file +var _0xb48d=['nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','findOne','VtigerField','getFields','getSubjects','getDescriptions','pick','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','map','VtigerConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb48d,0x194));var _0xdb48=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xb48d[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require(_0xdb48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdb48('0x2'));var moment=require(_0xdb48('0x3'));var BPromise=require(_0xdb48('0x4'));var Mustache=require(_0xdb48('0x5'));var util=require('util');var path=require(_0xdb48('0x6'));var sox=require('sox');var csv=require(_0xdb48('0x7'));var ejs=require(_0xdb48('0x8'));var fs=require('fs');var fs_extra=require(_0xdb48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb48('0xa'));var jsforce=require(_0xdb48('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdb48('0x7'));var querystring=require(_0xdb48('0xc'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xd'));var authService=require(_0xdb48('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb48('0xf'));var logger=require(_0xdb48('0x10'))(_0xdb48('0x11'));var utils=require('../../config/utils');var config=require(_0xdb48('0x12'));var licenseUtil=require(_0xdb48('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaa4906,_0x3cbfee){_0x3cbfee=_0x3cbfee||0xcc;return function(_0x41e006){if(_0x41e006){return _0xaa4906[_0xdb48('0x14')](_0x3cbfee);}return _0xaa4906[_0xdb48('0x15')](_0x3cbfee)[_0xdb48('0x16')]();};}function respondWithResult(_0x5ebbdd,_0x43df86){_0x43df86=_0x43df86||0xc8;return function(_0x142eaf){if(_0x142eaf){return _0x5ebbdd[_0xdb48('0x15')](_0x43df86)['json'](_0x142eaf);}};}function respondWithFilteredResult(_0x28412d,_0x518dac){return function(_0x453d6b){if(_0x453d6b){var _0x3180d7=typeof _0x518dac[_0xdb48('0x17')]===_0xdb48('0x18')&&typeof _0x518dac[_0xdb48('0x19')]==='undefined';var _0x488997=_0x453d6b[_0xdb48('0x1a')];var _0x38099a=_0x3180d7?0x0:_0x518dac['offset'];var _0x3f98b0=_0x3180d7?_0x453d6b[_0xdb48('0x1a')]:_0x518dac['offset']+_0x518dac['limit'];var _0x1432a9;if(_0x3f98b0>=_0x488997){_0x3f98b0=_0x488997;_0x1432a9=0xc8;}else{_0x1432a9=0xce;}_0x28412d[_0xdb48('0x15')](_0x1432a9);return _0x28412d[_0xdb48('0x1b')]('Content-Range',_0x38099a+'-'+_0x3f98b0+'/'+_0x488997)[_0xdb48('0x1c')](_0x453d6b);}return null;};}function patchUpdates(_0x3d1b69){return function(_0x58604e){try{jsonpatch[_0xdb48('0x1d')](_0x58604e,_0x3d1b69,!![]);}catch(_0x3fb75a){return BPromise[_0xdb48('0x1e')](_0x3fb75a);}return _0x58604e[_0xdb48('0x1f')]();};}function saveUpdates(_0x3921d8,_0x5e63b3){return function(_0x2746c4){if(_0x2746c4){return _0x2746c4[_0xdb48('0x20')](_0x3921d8)[_0xdb48('0x21')](function(_0x5a33a0){return _0x5a33a0;});}return null;};}function removeEntity(_0x5aedc1,_0x52c046){return function(_0x3ad23a){if(_0x3ad23a){return _0x3ad23a[_0xdb48('0x22')]()[_0xdb48('0x21')](function(){_0x5aedc1['status'](0xcc)[_0xdb48('0x16')]();});}};}function handleEntityNotFound(_0x4d29d1,_0x3b3344){return function(_0x3a5bdd){if(!_0x3a5bdd){_0x4d29d1[_0xdb48('0x14')](0x194);}return _0x3a5bdd;};}function handleError(_0x531a2a,_0x483940){_0x483940=_0x483940||0x1f4;return function(_0x139139){logger[_0xdb48('0x23')](_0x139139[_0xdb48('0x24')]);if(_0x139139['name']){delete _0x139139[_0xdb48('0x25')];}_0x531a2a[_0xdb48('0x15')](_0x483940)['send'](_0x139139);};}exports['index']=function(_0x31edb6,_0x2cdfa4){var _0x2adb1e={},_0x2f55c6={},_0x549b18={'count':0x0,'rows':[]};var _0x58c3d1=_[_0xdb48('0x26')](db[_0xdb48('0x27')]['rawAttributes'],function(_0x43e857){return{'name':_0x43e857[_0xdb48('0x28')],'type':_0x43e857[_0xdb48('0x29')][_0xdb48('0x2a')]};});_0x2f55c6[_0xdb48('0x2b')]=_[_0xdb48('0x26')](_0x58c3d1,'name');_0x2f55c6[_0xdb48('0x2c')]=_[_0xdb48('0x2d')](_0x31edb6[_0xdb48('0x2c')]);_0x2f55c6[_0xdb48('0x2e')]=_[_0xdb48('0x2f')](_0x2f55c6[_0xdb48('0x2b')],_0x2f55c6['query']);_0x2adb1e['attributes']=_[_0xdb48('0x2f')](_0x2f55c6[_0xdb48('0x2b')],qs[_0xdb48('0x30')](_0x31edb6[_0xdb48('0x2c')][_0xdb48('0x30')]));_0x2adb1e[_0xdb48('0x31')]=_0x2adb1e[_0xdb48('0x31')][_0xdb48('0x32')]?_0x2adb1e[_0xdb48('0x31')]:_0x2f55c6['model'];if(!_0x31edb6[_0xdb48('0x2c')][_0xdb48('0x33')](_0xdb48('0x34'))){_0x2adb1e[_0xdb48('0x19')]=qs['limit'](_0x31edb6['query'][_0xdb48('0x19')]);_0x2adb1e[_0xdb48('0x17')]=qs[_0xdb48('0x17')](_0x31edb6[_0xdb48('0x2c')][_0xdb48('0x17')]);}_0x2adb1e[_0xdb48('0x35')]=qs[_0xdb48('0x36')](_0x31edb6[_0xdb48('0x2c')]['sort']);_0x2adb1e['where']=qs[_0xdb48('0x2e')](_['pick'](_0x31edb6[_0xdb48('0x2c')],_0x2f55c6[_0xdb48('0x2e')]),_0x58c3d1);if(_0x31edb6[_0xdb48('0x2c')][_0xdb48('0x37')]){_0x2adb1e[_0xdb48('0x38')]=_[_0xdb48('0x39')](_0x2adb1e[_0xdb48('0x38')],{'$or':_[_0xdb48('0x26')](_0x58c3d1,function(_0x59cf7a){if(_0x59cf7a[_0xdb48('0x29')]!==_0xdb48('0x3a')){var _0x4acc54={};_0x4acc54[_0x59cf7a[_0xdb48('0x25')]]={'$like':'%'+_0x31edb6[_0xdb48('0x2c')][_0xdb48('0x37')]+'%'};return _0x4acc54;}})});}_0x2adb1e=_[_0xdb48('0x39')]({},_0x2adb1e,_0x31edb6['options']);var _0x5661f0={'where':_0x2adb1e[_0xdb48('0x38')]};return db[_0xdb48('0x27')]['count'](_0x5661f0)['then'](function(_0x30edaf){_0x549b18[_0xdb48('0x1a')]=_0x30edaf;if(_0x31edb6[_0xdb48('0x2c')][_0xdb48('0x3b')]){_0x2adb1e['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xdb48('0x3c')](_0x2adb1e);})[_0xdb48('0x21')](function(_0x171c9e){_0x549b18[_0xdb48('0x3d')]=_0x171c9e;return _0x549b18;})[_0xdb48('0x21')](respondWithFilteredResult(_0x2cdfa4,_0x2adb1e))[_0xdb48('0x3e')](handleError(_0x2cdfa4,null));};exports[_0xdb48('0x3f')]=function(_0x128d0a,_0x3ad982){var _0x4838b8={'raw':![],'where':{'id':_0x128d0a[_0xdb48('0x40')]['id']}},_0x3accdb={};_0x3accdb['model']=_[_0xdb48('0x2d')](db['VtigerConfiguration'][_0xdb48('0x41')]);_0x3accdb['query']=_[_0xdb48('0x2d')](_0x128d0a[_0xdb48('0x2c')]);_0x3accdb[_0xdb48('0x2e')]=_[_0xdb48('0x2f')](_0x3accdb[_0xdb48('0x2b')],_0x3accdb[_0xdb48('0x2c')]);_0x4838b8[_0xdb48('0x31')]=_[_0xdb48('0x2f')](_0x3accdb[_0xdb48('0x2b')],qs[_0xdb48('0x30')](_0x128d0a[_0xdb48('0x2c')][_0xdb48('0x30')]));_0x4838b8[_0xdb48('0x31')]=_0x4838b8[_0xdb48('0x31')][_0xdb48('0x32')]?_0x4838b8[_0xdb48('0x31')]:_0x3accdb[_0xdb48('0x2b')];if(_0x128d0a[_0xdb48('0x2c')][_0xdb48('0x3b')]){_0x4838b8['include']=[{'all':!![]}];}_0x4838b8=_['merge']({},_0x4838b8,_0x128d0a[_0xdb48('0x42')]);return db[_0xdb48('0x27')][_0xdb48('0x43')](_0x4838b8)['then'](handleEntityNotFound(_0x3ad982,null))[_0xdb48('0x21')](respondWithResult(_0x3ad982,null))[_0xdb48('0x3e')](handleError(_0x3ad982,null));};exports[_0xdb48('0x44')]=function(_0x24e544,_0x31ff09){return db['VtigerConfiguration'][_0xdb48('0x44')](_0x24e544['body'],{})[_0xdb48('0x21')](respondWithResult(_0x31ff09,0xc9))[_0xdb48('0x3e')](handleError(_0x31ff09,null));};exports[_0xdb48('0x20')]=function(_0x3317ca,_0x5d0742){if(_0x3317ca[_0xdb48('0x45')]['id']){delete _0x3317ca['body']['id'];}return db[_0xdb48('0x27')][_0xdb48('0x43')]({'where':{'id':_0x3317ca[_0xdb48('0x40')]['id']}})[_0xdb48('0x21')](handleEntityNotFound(_0x5d0742,null))[_0xdb48('0x21')](saveUpdates(_0x3317ca[_0xdb48('0x45')],null))[_0xdb48('0x21')](respondWithResult(_0x5d0742,null))[_0xdb48('0x3e')](handleError(_0x5d0742,null));};exports[_0xdb48('0x22')]=function(_0x3c1669,_0x4b5cc7){return db['VtigerConfiguration'][_0xdb48('0x43')]({'where':{'id':_0x3c1669[_0xdb48('0x40')]['id']}})[_0xdb48('0x21')](handleEntityNotFound(_0x4b5cc7,null))[_0xdb48('0x21')](removeEntity(_0x4b5cc7,null))['catch'](handleError(_0x4b5cc7,null));};exports['getFields']=function(_0x57e578,_0x3d3500,_0x44296b){var _0x328381={};var _0x57a4e5={};var _0x3b6bb0;var _0x4de923;return db[_0xdb48('0x27')][_0xdb48('0x46')]({'where':{'id':_0x57e578[_0xdb48('0x40')]['id']}})['then'](handleEntityNotFound(_0x3d3500,null))['then'](function(_0x322136){if(_0x322136){_0x3b6bb0=_0x322136;_0x57a4e5[_0xdb48('0x2b')]=_[_0xdb48('0x2d')](db[_0xdb48('0x47')]['rawAttributes']);_0x57a4e5[_0xdb48('0x2c')]=_[_0xdb48('0x2d')](_0x57e578[_0xdb48('0x2c')]);_0x57a4e5[_0xdb48('0x2e')]=_[_0xdb48('0x2f')](_0x57a4e5[_0xdb48('0x2b')],_0x57a4e5[_0xdb48('0x2c')]);_0x328381['attributes']=_['intersection'](_0x57a4e5[_0xdb48('0x2b')],qs[_0xdb48('0x30')](_0x57e578[_0xdb48('0x2c')][_0xdb48('0x30')]));_0x328381['attributes']=_0x328381[_0xdb48('0x31')][_0xdb48('0x32')]?_0x328381['attributes']:_0x57a4e5['model'];_0x328381[_0xdb48('0x35')]=qs[_0xdb48('0x36')](_0x57e578['query']['sort']);_0x328381[_0xdb48('0x38')]=qs[_0xdb48('0x2e')](_['pick'](_0x57e578[_0xdb48('0x2c')],_0x57a4e5[_0xdb48('0x2e')]));if(_0x57e578[_0xdb48('0x2c')][_0xdb48('0x37')]){_0x328381[_0xdb48('0x38')]=_['merge'](_0x328381['where'],{'$or':_['map'](_0x328381[_0xdb48('0x31')],function(_0x3dda78){var _0x281792={};_0x281792[_0x3dda78]={'$like':'%'+_0x57e578['query'][_0xdb48('0x37')]+'%'};return _0x281792;})});}_0x328381=_[_0xdb48('0x39')]({},_0x328381,_0x57e578[_0xdb48('0x42')]);return _0x3b6bb0['getFields'](_0x328381);}})[_0xdb48('0x21')](function(_0x331ac7){if(_0x331ac7){_0x4de923=_0x331ac7[_0xdb48('0x32')];if(!_0x57e578[_0xdb48('0x2c')][_0xdb48('0x33')](_0xdb48('0x34'))){_0x328381[_0xdb48('0x19')]=qs['limit'](_0x57e578['query']['limit']);_0x328381[_0xdb48('0x17')]=qs[_0xdb48('0x17')](_0x57e578[_0xdb48('0x2c')]['offset']);}return _0x3b6bb0[_0xdb48('0x48')](_0x328381);}})['then'](function(_0x3e41cc){if(_0x3e41cc){return _0x3e41cc?{'count':_0x4de923,'rows':_0x3e41cc}:null;}})['then'](respondWithResult(_0x3d3500,null))[_0xdb48('0x3e')](handleError(_0x3d3500,null));};exports[_0xdb48('0x49')]=function(_0x5b804a,_0x4ff7d8,_0xe57330){var _0x4106a1={};var _0x2dc34c={};var _0xe022e1;var _0x9e7643;return db[_0xdb48('0x27')][_0xdb48('0x46')]({'where':{'id':_0x5b804a[_0xdb48('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ff7d8,null))[_0xdb48('0x21')](function(_0x2b9f50){if(_0x2b9f50){_0xe022e1=_0x2b9f50;_0x2dc34c[_0xdb48('0x2b')]=_[_0xdb48('0x2d')](db[_0xdb48('0x47')][_0xdb48('0x41')]);_0x2dc34c[_0xdb48('0x2c')]=_['keys'](_0x5b804a['query']);_0x2dc34c[_0xdb48('0x2e')]=_[_0xdb48('0x2f')](_0x2dc34c[_0xdb48('0x2b')],_0x2dc34c[_0xdb48('0x2c')]);_0x4106a1[_0xdb48('0x31')]=_[_0xdb48('0x2f')](_0x2dc34c[_0xdb48('0x2b')],qs['fields'](_0x5b804a[_0xdb48('0x2c')][_0xdb48('0x30')]));_0x4106a1['attributes']=_0x4106a1[_0xdb48('0x31')][_0xdb48('0x32')]?_0x4106a1[_0xdb48('0x31')]:_0x2dc34c[_0xdb48('0x2b')];_0x4106a1[_0xdb48('0x35')]=qs[_0xdb48('0x36')](_0x5b804a['query'][_0xdb48('0x36')]);_0x4106a1[_0xdb48('0x38')]=qs[_0xdb48('0x2e')](_['pick'](_0x5b804a[_0xdb48('0x2c')],_0x2dc34c[_0xdb48('0x2e')]));if(_0x5b804a[_0xdb48('0x2c')][_0xdb48('0x37')]){_0x4106a1[_0xdb48('0x38')]=_[_0xdb48('0x39')](_0x4106a1[_0xdb48('0x38')],{'$or':_[_0xdb48('0x26')](_0x4106a1[_0xdb48('0x31')],function(_0x43e490){var _0x75638b={};_0x75638b[_0x43e490]={'$like':'%'+_0x5b804a[_0xdb48('0x2c')][_0xdb48('0x37')]+'%'};return _0x75638b;})});}_0x4106a1=_[_0xdb48('0x39')]({},_0x4106a1,_0x5b804a['options']);return _0xe022e1[_0xdb48('0x49')](_0x4106a1);}})['then'](function(_0x4017b3){if(_0x4017b3){_0x9e7643=_0x4017b3[_0xdb48('0x32')];if(!_0x5b804a['query'][_0xdb48('0x33')](_0xdb48('0x34'))){_0x4106a1[_0xdb48('0x19')]=qs[_0xdb48('0x19')](_0x5b804a['query']['limit']);_0x4106a1[_0xdb48('0x17')]=qs['offset'](_0x5b804a[_0xdb48('0x2c')][_0xdb48('0x17')]);}return _0xe022e1[_0xdb48('0x49')](_0x4106a1);}})[_0xdb48('0x21')](function(_0x4d9e43){if(_0x4d9e43){return _0x4d9e43?{'count':_0x9e7643,'rows':_0x4d9e43}:null;}})[_0xdb48('0x21')](respondWithResult(_0x4ff7d8,null))[_0xdb48('0x3e')](handleError(_0x4ff7d8,null));};exports[_0xdb48('0x4a')]=function(_0x57a1e4,_0x199273,_0x1c1822){var _0x5b9c7a={};var _0x485712={};var _0x4287f3;var _0x5aaaca;return db[_0xdb48('0x27')][_0xdb48('0x46')]({'where':{'id':_0x57a1e4[_0xdb48('0x40')]['id']}})[_0xdb48('0x21')](handleEntityNotFound(_0x199273,null))[_0xdb48('0x21')](function(_0x231490){if(_0x231490){_0x4287f3=_0x231490;_0x485712[_0xdb48('0x2b')]=_[_0xdb48('0x2d')](db['VtigerField'][_0xdb48('0x41')]);_0x485712[_0xdb48('0x2c')]=_[_0xdb48('0x2d')](_0x57a1e4[_0xdb48('0x2c')]);_0x485712[_0xdb48('0x2e')]=_[_0xdb48('0x2f')](_0x485712['model'],_0x485712['query']);_0x5b9c7a[_0xdb48('0x31')]=_[_0xdb48('0x2f')](_0x485712[_0xdb48('0x2b')],qs[_0xdb48('0x30')](_0x57a1e4[_0xdb48('0x2c')]['fields']));_0x5b9c7a[_0xdb48('0x31')]=_0x5b9c7a[_0xdb48('0x31')]['length']?_0x5b9c7a['attributes']:_0x485712[_0xdb48('0x2b')];_0x5b9c7a[_0xdb48('0x35')]=qs[_0xdb48('0x36')](_0x57a1e4[_0xdb48('0x2c')][_0xdb48('0x36')]);_0x5b9c7a['where']=qs[_0xdb48('0x2e')](_[_0xdb48('0x4b')](_0x57a1e4[_0xdb48('0x2c')],_0x485712[_0xdb48('0x2e')]));if(_0x57a1e4['query'][_0xdb48('0x37')]){_0x5b9c7a[_0xdb48('0x38')]=_[_0xdb48('0x39')](_0x5b9c7a[_0xdb48('0x38')],{'$or':_[_0xdb48('0x26')](_0x5b9c7a['attributes'],function(_0x4125a0){var _0x1dfb9d={};_0x1dfb9d[_0x4125a0]={'$like':'%'+_0x57a1e4[_0xdb48('0x2c')][_0xdb48('0x37')]+'%'};return _0x1dfb9d;})});}_0x5b9c7a=_[_0xdb48('0x39')]({},_0x5b9c7a,_0x57a1e4[_0xdb48('0x42')]);return _0x4287f3['getDescriptions'](_0x5b9c7a);}})[_0xdb48('0x21')](function(_0x554a90){if(_0x554a90){_0x5aaaca=_0x554a90[_0xdb48('0x32')];if(!_0x57a1e4['query'][_0xdb48('0x33')](_0xdb48('0x34'))){_0x5b9c7a['limit']=qs[_0xdb48('0x19')](_0x57a1e4[_0xdb48('0x2c')][_0xdb48('0x19')]);_0x5b9c7a[_0xdb48('0x17')]=qs['offset'](_0x57a1e4[_0xdb48('0x2c')][_0xdb48('0x17')]);}return _0x4287f3[_0xdb48('0x4a')](_0x5b9c7a);}})[_0xdb48('0x21')](function(_0x3e04a5){if(_0x3e04a5){return _0x3e04a5?{'count':_0x5aaaca,'rows':_0x3e04a5}:null;}})[_0xdb48('0x21')](respondWithResult(_0x199273,null))[_0xdb48('0x3e')](handleError(_0x199273,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 1552253..3431fae 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 _0x0dc4=['request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4bc7f0,_0x7987a1){var _0x25d0e7=function(_0x5d0d35){while(--_0x5d0d35){_0x4bc7f0['push'](_0x4bc7f0['shift']());}};_0x25d0e7(++_0x7987a1);}(_0x0dc4,0xe8));var _0x40dc=function(_0x3399bb,_0x5e7c53){_0x3399bb=_0x3399bb-0x0;var _0x1afd51=_0x0dc4[_0x3399bb];return _0x1afd51;};'use strict';var _=require(_0x40dc('0x0'));var util=require(_0x40dc('0x1'));var logger=require(_0x40dc('0x2'))(_0x40dc('0x3'));var moment=require(_0x40dc('0x4'));var BPromise=require(_0x40dc('0x5'));var rp=require(_0x40dc('0x6'));var fs=require('fs');var path=require(_0x40dc('0x7'));var rimraf=require('rimraf');var config=require(_0x40dc('0x8'));var attributes=require(_0x40dc('0x9'));module[_0x40dc('0xa')]=function(_0x85ad62,_0xda53f2){return _0x85ad62[_0x40dc('0xb')](_0x40dc('0xc'),attributes,{'tableName':_0x40dc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd900=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','int_vtiger_configurations','lodash','../../config/logger'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd900,0x11c));var _0x0d90=function(_0x1c9721,_0x3f83a4){_0x1c9721=_0x1c9721-0x0;var _0x5b1a4c=_0xd900[_0x1c9721];return _0x5b1a4c;};'use strict';var _=require(_0x0d90('0x0'));var util=require('util');var logger=require(_0x0d90('0x1'))(_0x0d90('0x2'));var moment=require(_0x0d90('0x3'));var BPromise=require(_0x0d90('0x4'));var rp=require(_0x0d90('0x5'));var fs=require('fs');var path=require(_0x0d90('0x6'));var rimraf=require(_0x0d90('0x7'));var config=require(_0x0d90('0x8'));var attributes=require(_0x0d90('0x9'));module['exports']=function(_0x4cdbda,_0x52216b){return _0x4cdbda['define']('VtigerConfiguration',attributes,{'tableName':_0x0d90('0xa'),'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 1eba207..6ac7911 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 _0x5935=['request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x431ed2,_0x4f6213){var _0x168fb6=function(_0x3d63b9){while(--_0x3d63b9){_0x431ed2['push'](_0x431ed2['shift']());}};_0x168fb6(++_0x4f6213);}(_0x5935,0x13b));var _0x5593=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x5935[_0x2d89ce];return _0x3fad10;};'use strict';var _=require(_0x5593('0x0'));var util=require('util');var moment=require(_0x5593('0x1'));var BPromise=require(_0x5593('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5593('0x3'));var db=require(_0x5593('0x4'))['db'];var utils=require(_0x5593('0x5'));var logger=require(_0x5593('0x6'))(_0x5593('0x7'));var config=require(_0x5593('0x8'));var jayson=require(_0x5593('0x9'));var client=jayson[_0x5593('0xa')][_0x5593('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x579d73,_0x28540e,_0x19bb18){return new BPromise(function(_0x2ff54c,_0x543be3){return client['request'](_0x579d73,_0x19bb18)[_0x5593('0xc')](function(_0xa836d7){logger[_0x5593('0xd')](_0x5593('0xe'),_0x28540e,'request\x20sent');logger[_0x5593('0xf')](_0x5593('0x10'),_0x28540e,'request\x20sent',JSON[_0x5593('0x11')](_0xa836d7));if(_0xa836d7[_0x5593('0x12')]){if(_0xa836d7['error'][_0x5593('0x13')]===0x1f4){logger[_0x5593('0x12')](_0x5593('0xe'),_0x28540e,_0xa836d7[_0x5593('0x12')][_0x5593('0x14')]);return _0x543be3(_0xa836d7[_0x5593('0x12')][_0x5593('0x14')]);}logger[_0x5593('0x12')](_0x5593('0xe'),_0x28540e,_0xa836d7[_0x5593('0x12')]['message']);return _0x2ff54c(_0xa836d7[_0x5593('0x12')][_0x5593('0x14')]);}else{logger['info'](_0x5593('0xe'),_0x28540e,_0x5593('0x15'));_0x2ff54c(_0xa836d7[_0x5593('0x16')][_0x5593('0x14')]);}})[_0x5593('0x17')](function(_0x3ec86a){logger[_0x5593('0x12')](_0x5593('0xe'),_0x28540e,_0x3ec86a);_0x543be3(_0x3ec86a);});});} \ No newline at end of file +var _0x9ea1=['then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ea1,0x74));var _0x19ea=function(_0x3fad61,_0x14910e){_0x3fad61=_0x3fad61-0x0;var _0x4f4d5e=_0x9ea1[_0x3fad61];return _0x4f4d5e;};'use strict';var _=require(_0x19ea('0x0'));var util=require('util');var moment=require(_0x19ea('0x1'));var BPromise=require('bluebird');var rs=require(_0x19ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19ea('0x3'))['db'];var utils=require(_0x19ea('0x4'));var logger=require(_0x19ea('0x5'))(_0x19ea('0x6'));var config=require('../../config/environment');var jayson=require(_0x19ea('0x7'));var client=jayson[_0x19ea('0x8')][_0x19ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xce00f4,_0x3f7ea6,_0x6f6398){return new BPromise(function(_0x402319,_0x1eca6f){return client['request'](_0xce00f4,_0x6f6398)[_0x19ea('0xa')](function(_0xe25178){logger[_0x19ea('0xb')](_0x19ea('0xc'),_0x3f7ea6,'request\x20sent');logger[_0x19ea('0xd')](_0x19ea('0xe'),_0x3f7ea6,_0x19ea('0xf'),JSON[_0x19ea('0x10')](_0xe25178));if(_0xe25178[_0x19ea('0x11')]){if(_0xe25178[_0x19ea('0x11')][_0x19ea('0x12')]===0x1f4){logger[_0x19ea('0x11')](_0x19ea('0xc'),_0x3f7ea6,_0xe25178[_0x19ea('0x11')][_0x19ea('0x13')]);return _0x1eca6f(_0xe25178[_0x19ea('0x11')][_0x19ea('0x13')]);}logger[_0x19ea('0x11')](_0x19ea('0xc'),_0x3f7ea6,_0xe25178[_0x19ea('0x11')]['message']);return _0x402319(_0xe25178[_0x19ea('0x11')][_0x19ea('0x13')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x3f7ea6,_0x19ea('0xf'));_0x402319(_0xe25178['result'][_0x19ea('0x13')]);}})[_0x19ea('0x14')](function(_0x356fdf){logger[_0x19ea('0x11')](_0x19ea('0xc'),_0x3f7ea6,_0x356fdf);_0x1eca6f(_0x356fdf);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 12fc018..b75fb07 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 _0x53cf=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','post','create','put','delete','/:id','exports','connect-timeout','express'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x53cf,0x116));var _0xf53c=function(_0x4a3b6c,_0x4abd5d){_0x4a3b6c=_0x4a3b6c-0x0;var _0x4895d4=_0x53cf[_0x4a3b6c];return _0x4895d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf53c('0x0'));var express=require(_0xf53c('0x1'));var router=express[_0xf53c('0x2')]();var fs_extra=require(_0xf53c('0x3'));var auth=require(_0xf53c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf53c('0x5'));var controller=require('./intVtigerField.controller');router[_0xf53c('0x6')]('/',auth[_0xf53c('0x7')](),controller['index']);router[_0xf53c('0x6')]('/:id',auth[_0xf53c('0x7')](),controller['show']);router[_0xf53c('0x8')]('/',auth['isAuthenticated'](),controller[_0xf53c('0x9')]);router[_0xf53c('0xa')]('/:id',auth[_0xf53c('0x7')](),controller['update']);router[_0xf53c('0xb')](_0xf53c('0xc'),auth[_0xf53c('0x7')](),controller['destroy']);module[_0xf53c('0xd')]=router; \ No newline at end of file +var _0x39ce=['exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','delete','destroy'];(function(_0xe23c8d,_0x498b6c){var _0x45280d=function(_0x4890a5){while(--_0x4890a5){_0xe23c8d['push'](_0xe23c8d['shift']());}};_0x45280d(++_0x498b6c);}(_0x39ce,0x91));var _0xe39c=function(_0x3bfee9,_0x5adf05){_0x3bfee9=_0x3bfee9-0x0;var _0x307824=_0x39ce[_0x3bfee9];return _0x307824;};'use strict';var multer=require('multer');var util=require(_0xe39c('0x0'));var path=require('path');var timeout=require(_0xe39c('0x1'));var express=require('express');var router=express[_0xe39c('0x2')]();var fs_extra=require(_0xe39c('0x3'));var auth=require(_0xe39c('0x4'));var interaction=require(_0xe39c('0x5'));var config=require(_0xe39c('0x6'));var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe39c('0x7')]);router[_0xe39c('0x8')](_0xe39c('0x9'),auth[_0xe39c('0xa')](),controller[_0xe39c('0xb')]);router[_0xe39c('0xc')]('/',auth[_0xe39c('0xa')](),controller[_0xe39c('0xd')]);router[_0xe39c('0xe')](_0xe39c('0x9'),auth[_0xe39c('0xa')](),controller['update']);router[_0xe39c('0xf')](_0xe39c('0x9'),auth['isAuthenticated'](),controller[_0xe39c('0x10')]);module[_0xe39c('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index b74fefe..2c3eb02 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 _0x4745=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x5b0043,_0xb3ac9a){var _0x14da2d=function(_0x514e0b){while(--_0x514e0b){_0x5b0043['push'](_0x5b0043['shift']());}};_0x14da2d(++_0xb3ac9a);}(_0x4745,0x68));var _0x5474=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x4745[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x5474('0x0'));module[_0x5474('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x5474('0x2'),_0x5474('0x3'),_0x5474('0x4'),_0x5474('0x5')),'defaultValue':_0x5474('0x6')},'content':{'type':Sequelize[_0x5474('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x5474('0x6'),_0x5474('0x2'),_0x5474('0x3'))},'keyContent':{'type':Sequelize[_0x5474('0x7')]},'idField':{'type':Sequelize[_0x5474('0x7')]},'nameField':{'type':Sequelize[_0x5474('0x7')]},'customField':{'type':Sequelize[_0x5474('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5474('0x7')]}}; \ No newline at end of file +var _0x5a6a=['BOOLEAN','sequelize','exports','string','variable','keyValue','picklist','STRING','ENUM','customVariable'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5a6a,0x1cd));var _0xa5a6=function(_0x452246,_0x41cb41){_0x452246=_0x452246-0x0;var _0x1e32fc=_0x5a6a[_0x452246];return _0x1e32fc;};'use strict';var Sequelize=require(_0xa5a6('0x0'));module[_0xa5a6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa5a6('0x2'),_0xa5a6('0x3'),'customVariable',_0xa5a6('0x4'),_0xa5a6('0x5')),'defaultValue':_0xa5a6('0x2')},'content':{'type':Sequelize[_0xa5a6('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa5a6('0x7')]('string',_0xa5a6('0x3'),_0xa5a6('0x8'))},'keyContent':{'type':Sequelize[_0xa5a6('0x6')]},'idField':{'type':Sequelize[_0xa5a6('0x6')]},'nameField':{'type':Sequelize[_0xa5a6('0x6')]},'customField':{'type':Sequelize[_0xa5a6('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa5a6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index cadf7f0..fc59df2 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 _0xffca=['api','../../config/utils','../../mysqldb','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','length','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xffca,0x7f));var _0xaffc=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xffca[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0xaffc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaffc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaffc('0x2'));var BPromise=require(_0xaffc('0x3'));var Mustache=require(_0xaffc('0x4'));var util=require('util');var path=require(_0xaffc('0x5'));var sox=require(_0xaffc('0x6'));var csv=require(_0xaffc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaffc('0x8'));var _=require('lodash');var squel=require(_0xaffc('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaffc('0xa'));var toCsv=require(_0xaffc('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaffc('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xaffc('0xc'));var as=require(_0xaffc('0xd'));var hardwareService=require(_0xaffc('0xe'));var logger=require('../../config/logger')(_0xaffc('0xf'));var utils=require(_0xaffc('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaffc('0x11'))['db'];function respondWithStatusCode(_0x12238d,_0x5d496d){_0x5d496d=_0x5d496d||0xcc;return function(_0x5cef6a){if(_0x5cef6a){return _0x12238d['sendStatus'](_0x5d496d);}return _0x12238d['status'](_0x5d496d)[_0xaffc('0x12')]();};}function respondWithResult(_0x57375c,_0x349e2b){_0x349e2b=_0x349e2b||0xc8;return function(_0x3ccb85){if(_0x3ccb85){return _0x57375c[_0xaffc('0x13')](_0x349e2b)['json'](_0x3ccb85);}};}function respondWithFilteredResult(_0x42b0ca,_0x26e589){return function(_0x33f7ef){if(_0x33f7ef){var _0x1a29a4=typeof _0x26e589['offset']===_0xaffc('0x14')&&typeof _0x26e589[_0xaffc('0x15')]===_0xaffc('0x14');var _0x38cc65=_0x33f7ef[_0xaffc('0x16')];var _0x4fbcb4=_0x1a29a4?0x0:_0x26e589['offset'];var _0x590726=_0x1a29a4?_0x33f7ef[_0xaffc('0x16')]:_0x26e589[_0xaffc('0x17')]+_0x26e589[_0xaffc('0x15')];var _0x4c76b9;if(_0x590726>=_0x38cc65){_0x590726=_0x38cc65;_0x4c76b9=0xc8;}else{_0x4c76b9=0xce;}_0x42b0ca[_0xaffc('0x13')](_0x4c76b9);return _0x42b0ca[_0xaffc('0x18')](_0xaffc('0x19'),_0x4fbcb4+'-'+_0x590726+'/'+_0x38cc65)['json'](_0x33f7ef);}return null;};}function patchUpdates(_0x41b30b){return function(_0x3a40ed){try{jsonpatch[_0xaffc('0x1a')](_0x3a40ed,_0x41b30b,!![]);}catch(_0x4eaac3){return BPromise[_0xaffc('0x1b')](_0x4eaac3);}return _0x3a40ed[_0xaffc('0x1c')]();};}function saveUpdates(_0x3f0b04,_0x5759c1){return function(_0x1c6395){if(_0x1c6395){return _0x1c6395[_0xaffc('0x1d')](_0x3f0b04)['then'](function(_0x8890e9){return _0x8890e9;});}return null;};}function removeEntity(_0x3891ac,_0x5e31a1){return function(_0x534cdc){if(_0x534cdc){return _0x534cdc[_0xaffc('0x1e')]()[_0xaffc('0x1f')](function(){_0x3891ac[_0xaffc('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50098f,_0x525a51){return function(_0x380216){if(!_0x380216){_0x50098f[_0xaffc('0x20')](0x194);}return _0x380216;};}function handleError(_0x1bebe5,_0x2df5ad){_0x2df5ad=_0x2df5ad||0x1f4;return function(_0x4d2f0f){logger[_0xaffc('0x21')](_0x4d2f0f[_0xaffc('0x22')]);if(_0x4d2f0f['name']){delete _0x4d2f0f[_0xaffc('0x23')];}_0x1bebe5[_0xaffc('0x13')](_0x2df5ad)[_0xaffc('0x24')](_0x4d2f0f);};}exports[_0xaffc('0x25')]=function(_0xf57722,_0x58dc5e){var _0x2e8349={},_0x476798={},_0x9f1c1f={'count':0x0,'rows':[]};var _0x320920=_[_0xaffc('0x26')](db[_0xaffc('0x27')][_0xaffc('0x28')],function(_0x565584){return{'name':_0x565584[_0xaffc('0x29')],'type':_0x565584[_0xaffc('0x2a')][_0xaffc('0x2b')]};});_0x476798[_0xaffc('0x2c')]=_['map'](_0x320920,'name');_0x476798[_0xaffc('0x2d')]=_[_0xaffc('0x2e')](_0xf57722[_0xaffc('0x2d')]);_0x476798[_0xaffc('0x2f')]=_['intersection'](_0x476798[_0xaffc('0x2c')],_0x476798['query']);_0x2e8349['attributes']=_['intersection'](_0x476798['model'],qs[_0xaffc('0x30')](_0xf57722[_0xaffc('0x2d')][_0xaffc('0x30')]));_0x2e8349['attributes']=_0x2e8349['attributes'][_0xaffc('0x31')]?_0x2e8349[_0xaffc('0x32')]:_0x476798[_0xaffc('0x2c')];if(!_0xf57722[_0xaffc('0x2d')]['hasOwnProperty'](_0xaffc('0x33'))){_0x2e8349['limit']=qs[_0xaffc('0x15')](_0xf57722['query'][_0xaffc('0x15')]);_0x2e8349[_0xaffc('0x17')]=qs['offset'](_0xf57722[_0xaffc('0x2d')][_0xaffc('0x17')]);}_0x2e8349[_0xaffc('0x34')]=qs[_0xaffc('0x35')](_0xf57722[_0xaffc('0x2d')][_0xaffc('0x35')]);_0x2e8349[_0xaffc('0x36')]=qs['filters'](_[_0xaffc('0x37')](_0xf57722[_0xaffc('0x2d')],_0x476798[_0xaffc('0x2f')]),_0x320920);if(_0xf57722[_0xaffc('0x2d')][_0xaffc('0x38')]){_0x2e8349[_0xaffc('0x36')]=_['merge'](_0x2e8349[_0xaffc('0x36')],{'$or':_[_0xaffc('0x26')](_0x320920,function(_0x3e982b){if(_0x3e982b['type']!==_0xaffc('0x39')){var _0x833662={};_0x833662[_0x3e982b[_0xaffc('0x23')]]={'$like':'%'+_0xf57722['query']['filter']+'%'};return _0x833662;}})});}_0x2e8349=_[_0xaffc('0x3a')]({},_0x2e8349,_0xf57722[_0xaffc('0x3b')]);var _0x4327be={'where':_0x2e8349[_0xaffc('0x36')]};return db[_0xaffc('0x27')][_0xaffc('0x16')](_0x4327be)[_0xaffc('0x1f')](function(_0x4695c7){_0x9f1c1f['count']=_0x4695c7;if(_0xf57722['query'][_0xaffc('0x3c')]){_0x2e8349[_0xaffc('0x3d')]=[{'all':!![]}];}return db[_0xaffc('0x27')][_0xaffc('0x3e')](_0x2e8349);})['then'](function(_0x1b86dc){_0x9f1c1f[_0xaffc('0x3f')]=_0x1b86dc;return _0x9f1c1f;})[_0xaffc('0x1f')](respondWithFilteredResult(_0x58dc5e,_0x2e8349))['catch'](handleError(_0x58dc5e,null));};exports[_0xaffc('0x40')]=function(_0x6d17b8,_0x447f6c){var _0x2cd1f8={'raw':!![],'where':{'id':_0x6d17b8[_0xaffc('0x41')]['id']}},_0x58749d={};_0x58749d[_0xaffc('0x2c')]=_['keys'](db[_0xaffc('0x27')][_0xaffc('0x28')]);_0x58749d[_0xaffc('0x2d')]=_['keys'](_0x6d17b8[_0xaffc('0x2d')]);_0x58749d[_0xaffc('0x2f')]=_[_0xaffc('0x42')](_0x58749d[_0xaffc('0x2c')],_0x58749d[_0xaffc('0x2d')]);_0x2cd1f8[_0xaffc('0x32')]=_[_0xaffc('0x42')](_0x58749d[_0xaffc('0x2c')],qs['fields'](_0x6d17b8['query'][_0xaffc('0x30')]));_0x2cd1f8[_0xaffc('0x32')]=_0x2cd1f8[_0xaffc('0x32')][_0xaffc('0x31')]?_0x2cd1f8[_0xaffc('0x32')]:_0x58749d['model'];if(_0x6d17b8['query'][_0xaffc('0x3c')]){_0x2cd1f8['include']=[{'all':!![]}];}_0x2cd1f8=_['merge']({},_0x2cd1f8,_0x6d17b8[_0xaffc('0x3b')]);return db[_0xaffc('0x27')][_0xaffc('0x43')](_0x2cd1f8)[_0xaffc('0x1f')](handleEntityNotFound(_0x447f6c,null))[_0xaffc('0x1f')](respondWithResult(_0x447f6c,null))[_0xaffc('0x44')](handleError(_0x447f6c,null));};exports[_0xaffc('0x45')]=function(_0x5dc70d,_0x15268c){return db[_0xaffc('0x27')][_0xaffc('0x45')](_0x5dc70d[_0xaffc('0x46')],{})[_0xaffc('0x1f')](respondWithResult(_0x15268c,0xc9))['catch'](handleError(_0x15268c,null));};exports['update']=function(_0x4680b7,_0x5c06ff){if(_0x4680b7['body']['id']){delete _0x4680b7[_0xaffc('0x46')]['id'];}return db[_0xaffc('0x27')]['find']({'where':{'id':_0x4680b7[_0xaffc('0x41')]['id']}})[_0xaffc('0x1f')](handleEntityNotFound(_0x5c06ff,null))[_0xaffc('0x1f')](saveUpdates(_0x4680b7[_0xaffc('0x46')],null))[_0xaffc('0x1f')](respondWithResult(_0x5c06ff,null))['catch'](handleError(_0x5c06ff,null));};exports[_0xaffc('0x1e')]=function(_0x3952b0,_0xe5031b){return db['VtigerField'][_0xaffc('0x43')]({'where':{'id':_0x3952b0[_0xaffc('0x41')]['id']}})['then'](handleEntityNotFound(_0xe5031b,null))['then'](removeEntity(_0xe5031b,null))['catch'](handleError(_0xe5031b,null));}; \ No newline at end of file +var _0x808a=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../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','apply','reject','update','destroy','then','error','name','send','map','VtigerField','rawAttributes','fieldName','type','key'];(function(_0x1621e4,_0x488e78){var _0x22dcb8=function(_0x36186e){while(--_0x36186e){_0x1621e4['push'](_0x1621e4['shift']());}};_0x22dcb8(++_0x488e78);}(_0x808a,0x1b7));var _0xa808=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0x808a[_0x282a1f];return _0x296ea7;};'use strict';var emlformat=require(_0xa808('0x0'));var rimraf=require(_0xa808('0x1'));var zipdir=require(_0xa808('0x2'));var jsonpatch=require(_0xa808('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa808('0x4'));var path=require(_0xa808('0x5'));var sox=require(_0xa808('0x6'));var csv=require(_0xa808('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa808('0x8'));var _=require(_0xa808('0x9'));var squel=require(_0xa808('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa808('0xb'));var toCsv=require(_0xa808('0x7'));var querystring=require('querystring');var Papa=require(_0xa808('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa808('0xd'));var as=require(_0xa808('0xe'));var hardwareService=require(_0xa808('0xf'));var logger=require(_0xa808('0x10'))(_0xa808('0x11'));var utils=require(_0xa808('0x12'));var config=require(_0xa808('0x13'));var licenseUtil=require(_0xa808('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ecd86,_0x11c471){_0x11c471=_0x11c471||0xcc;return function(_0x3714fe){if(_0x3714fe){return _0x5ecd86[_0xa808('0x15')](_0x11c471);}return _0x5ecd86[_0xa808('0x16')](_0x11c471)[_0xa808('0x17')]();};}function respondWithResult(_0x58e6ab,_0x1675ee){_0x1675ee=_0x1675ee||0xc8;return function(_0xa530bb){if(_0xa530bb){return _0x58e6ab['status'](_0x1675ee)[_0xa808('0x18')](_0xa530bb);}};}function respondWithFilteredResult(_0x1b5d4c,_0x25851a){return function(_0x5ca5ba){if(_0x5ca5ba){var _0x31c948=typeof _0x25851a[_0xa808('0x19')]===_0xa808('0x1a')&&typeof _0x25851a[_0xa808('0x1b')]===_0xa808('0x1a');var _0x5aa34b=_0x5ca5ba[_0xa808('0x1c')];var _0x3b1d57=_0x31c948?0x0:_0x25851a[_0xa808('0x19')];var _0x5d4475=_0x31c948?_0x5ca5ba[_0xa808('0x1c')]:_0x25851a[_0xa808('0x19')]+_0x25851a[_0xa808('0x1b')];var _0x575bba;if(_0x5d4475>=_0x5aa34b){_0x5d4475=_0x5aa34b;_0x575bba=0xc8;}else{_0x575bba=0xce;}_0x1b5d4c[_0xa808('0x16')](_0x575bba);return _0x1b5d4c[_0xa808('0x1d')]('Content-Range',_0x3b1d57+'-'+_0x5d4475+'/'+_0x5aa34b)[_0xa808('0x18')](_0x5ca5ba);}return null;};}function patchUpdates(_0x27d505){return function(_0x507e52){try{jsonpatch[_0xa808('0x1e')](_0x507e52,_0x27d505,!![]);}catch(_0x5dcbdc){return BPromise[_0xa808('0x1f')](_0x5dcbdc);}return _0x507e52['save']();};}function saveUpdates(_0xcc3ad2,_0x52e819){return function(_0x39c313){if(_0x39c313){return _0x39c313[_0xa808('0x20')](_0xcc3ad2)['then'](function(_0x47167f){return _0x47167f;});}return null;};}function removeEntity(_0x599ca6,_0x56241e){return function(_0x461775){if(_0x461775){return _0x461775[_0xa808('0x21')]()[_0xa808('0x22')](function(){_0x599ca6['status'](0xcc)[_0xa808('0x17')]();});}};}function handleEntityNotFound(_0xdae3b2,_0x283e34){return function(_0x2b4ac4){if(!_0x2b4ac4){_0xdae3b2['sendStatus'](0x194);}return _0x2b4ac4;};}function handleError(_0x287287,_0x39cecb){_0x39cecb=_0x39cecb||0x1f4;return function(_0x5a9c5b){logger[_0xa808('0x23')](_0x5a9c5b['stack']);if(_0x5a9c5b[_0xa808('0x24')]){delete _0x5a9c5b[_0xa808('0x24')];}_0x287287[_0xa808('0x16')](_0x39cecb)[_0xa808('0x25')](_0x5a9c5b);};}exports['index']=function(_0x1f7acf,_0x2ab0cd){var _0x5804ed={},_0xf2a524={},_0x5910da={'count':0x0,'rows':[]};var _0x188e68=_[_0xa808('0x26')](db[_0xa808('0x27')][_0xa808('0x28')],function(_0x411692){return{'name':_0x411692[_0xa808('0x29')],'type':_0x411692[_0xa808('0x2a')][_0xa808('0x2b')]};});_0xf2a524[_0xa808('0x2c')]=_[_0xa808('0x26')](_0x188e68,_0xa808('0x24'));_0xf2a524[_0xa808('0x2d')]=_[_0xa808('0x2e')](_0x1f7acf[_0xa808('0x2d')]);_0xf2a524[_0xa808('0x2f')]=_[_0xa808('0x30')](_0xf2a524[_0xa808('0x2c')],_0xf2a524['query']);_0x5804ed[_0xa808('0x31')]=_[_0xa808('0x30')](_0xf2a524[_0xa808('0x2c')],qs['fields'](_0x1f7acf['query'][_0xa808('0x32')]));_0x5804ed[_0xa808('0x31')]=_0x5804ed[_0xa808('0x31')][_0xa808('0x33')]?_0x5804ed[_0xa808('0x31')]:_0xf2a524[_0xa808('0x2c')];if(!_0x1f7acf[_0xa808('0x2d')][_0xa808('0x34')](_0xa808('0x35'))){_0x5804ed[_0xa808('0x1b')]=qs[_0xa808('0x1b')](_0x1f7acf[_0xa808('0x2d')][_0xa808('0x1b')]);_0x5804ed['offset']=qs[_0xa808('0x19')](_0x1f7acf[_0xa808('0x2d')][_0xa808('0x19')]);}_0x5804ed[_0xa808('0x36')]=qs[_0xa808('0x37')](_0x1f7acf[_0xa808('0x2d')][_0xa808('0x37')]);_0x5804ed[_0xa808('0x38')]=qs['filters'](_['pick'](_0x1f7acf[_0xa808('0x2d')],_0xf2a524[_0xa808('0x2f')]),_0x188e68);if(_0x1f7acf['query'][_0xa808('0x39')]){_0x5804ed[_0xa808('0x38')]=_[_0xa808('0x3a')](_0x5804ed[_0xa808('0x38')],{'$or':_[_0xa808('0x26')](_0x188e68,function(_0x5cdebc){if(_0x5cdebc[_0xa808('0x2a')]!=='VIRTUAL'){var _0x1ece37={};_0x1ece37[_0x5cdebc[_0xa808('0x24')]]={'$like':'%'+_0x1f7acf[_0xa808('0x2d')][_0xa808('0x39')]+'%'};return _0x1ece37;}})});}_0x5804ed=_[_0xa808('0x3a')]({},_0x5804ed,_0x1f7acf[_0xa808('0x3b')]);var _0x3a6126={'where':_0x5804ed[_0xa808('0x38')]};return db[_0xa808('0x27')][_0xa808('0x1c')](_0x3a6126)[_0xa808('0x22')](function(_0x5d15f2){_0x5910da['count']=_0x5d15f2;if(_0x1f7acf[_0xa808('0x2d')][_0xa808('0x3c')]){_0x5804ed[_0xa808('0x3d')]=[{'all':!![]}];}return db[_0xa808('0x27')][_0xa808('0x3e')](_0x5804ed);})[_0xa808('0x22')](function(_0x56c595){_0x5910da['rows']=_0x56c595;return _0x5910da;})[_0xa808('0x22')](respondWithFilteredResult(_0x2ab0cd,_0x5804ed))[_0xa808('0x3f')](handleError(_0x2ab0cd,null));};exports[_0xa808('0x40')]=function(_0x2dffff,_0x57f609){var _0x1c0608={'raw':!![],'where':{'id':_0x2dffff[_0xa808('0x41')]['id']}},_0x1a8ec5={};_0x1a8ec5['model']=_[_0xa808('0x2e')](db['VtigerField'][_0xa808('0x28')]);_0x1a8ec5[_0xa808('0x2d')]=_[_0xa808('0x2e')](_0x2dffff[_0xa808('0x2d')]);_0x1a8ec5[_0xa808('0x2f')]=_[_0xa808('0x30')](_0x1a8ec5[_0xa808('0x2c')],_0x1a8ec5[_0xa808('0x2d')]);_0x1c0608['attributes']=_[_0xa808('0x30')](_0x1a8ec5['model'],qs[_0xa808('0x32')](_0x2dffff[_0xa808('0x2d')][_0xa808('0x32')]));_0x1c0608[_0xa808('0x31')]=_0x1c0608[_0xa808('0x31')][_0xa808('0x33')]?_0x1c0608[_0xa808('0x31')]:_0x1a8ec5['model'];if(_0x2dffff[_0xa808('0x2d')][_0xa808('0x3c')]){_0x1c0608[_0xa808('0x3d')]=[{'all':!![]}];}_0x1c0608=_[_0xa808('0x3a')]({},_0x1c0608,_0x2dffff[_0xa808('0x3b')]);return db[_0xa808('0x27')][_0xa808('0x42')](_0x1c0608)[_0xa808('0x22')](handleEntityNotFound(_0x57f609,null))[_0xa808('0x22')](respondWithResult(_0x57f609,null))[_0xa808('0x3f')](handleError(_0x57f609,null));};exports[_0xa808('0x43')]=function(_0x2e0ef6,_0x47fcdf){return db['VtigerField'][_0xa808('0x43')](_0x2e0ef6[_0xa808('0x44')],{})[_0xa808('0x22')](respondWithResult(_0x47fcdf,0xc9))[_0xa808('0x3f')](handleError(_0x47fcdf,null));};exports[_0xa808('0x20')]=function(_0x30ba7d,_0x4fc714){if(_0x30ba7d[_0xa808('0x44')]['id']){delete _0x30ba7d[_0xa808('0x44')]['id'];}return db[_0xa808('0x27')][_0xa808('0x42')]({'where':{'id':_0x30ba7d[_0xa808('0x41')]['id']}})[_0xa808('0x22')](handleEntityNotFound(_0x4fc714,null))[_0xa808('0x22')](saveUpdates(_0x30ba7d[_0xa808('0x44')],null))[_0xa808('0x22')](respondWithResult(_0x4fc714,null))[_0xa808('0x3f')](handleError(_0x4fc714,null));};exports[_0xa808('0x21')]=function(_0x1df7c4,_0x55e717){return db[_0xa808('0x27')][_0xa808('0x42')]({'where':{'id':_0x1df7c4[_0xa808('0x41')]['id']}})[_0xa808('0x22')](handleEntityNotFound(_0x55e717,null))['then'](removeEntity(_0x55e717,null))['catch'](handleError(_0x55e717,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e82ab19..40ab730 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 _0x432b=['int_vtiger_fields','vtiger_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField'];(function(_0x394c8a,_0x2e15fe){var _0x32ae17=function(_0x1b220e){while(--_0x1b220e){_0x394c8a['push'](_0x394c8a['shift']());}};_0x32ae17(++_0x2e15fe);}(_0x432b,0x14d));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb432('0x0'));var util=require('util');var logger=require(_0xb432('0x1'))(_0xb432('0x2'));var moment=require(_0xb432('0x3'));var BPromise=require(_0xb432('0x4'));var rp=require(_0xb432('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb432('0x6'));var config=require(_0xb432('0x7'));var attributes=require(_0xb432('0x8'));module[_0xb432('0x9')]=function(_0x3abeac,_0xdcd25c){return _0x3abeac[_0xb432('0xa')](_0xb432('0xb'),attributes,{'tableName':_0xb432('0xc'),'paranoid':![],'indexes':[{'name':_0xb432('0xd'),'fields':['idField',_0xb432('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x44f5=['api','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x362a04,_0x3d71ae){var _0x17a8b0=function(_0x37e852){while(--_0x37e852){_0x362a04['push'](_0x362a04['shift']());}};_0x17a8b0(++_0x3d71ae);}(_0x44f5,0x8d));var _0x544f=function(_0x35da75,_0x12d382){_0x35da75=_0x35da75-0x0;var _0x3a4dc0=_0x44f5[_0x35da75];return _0x3a4dc0;};'use strict';var _=require(_0x544f('0x0'));var util=require(_0x544f('0x1'));var logger=require(_0x544f('0x2'))(_0x544f('0x3'));var moment=require('moment');var BPromise=require(_0x544f('0x4'));var rp=require(_0x544f('0x5'));var fs=require('fs');var path=require(_0x544f('0x6'));var rimraf=require('rimraf');var config=require(_0x544f('0x7'));var attributes=require(_0x544f('0x8'));module[_0x544f('0x9')]=function(_0x1bd602,_0x2bc352){return _0x1bd602[_0x544f('0xa')](_0x544f('0xb'),attributes,{'tableName':_0x544f('0xc'),'paranoid':![],'indexes':[{'name':_0x544f('0xd'),'fields':[_0x544f('0xe'),_0x544f('0xf')],'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 3946e56..d48cb45 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 _0x2f45=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xcc2d2a,_0x239c5a){var _0x21e735=function(_0x398262){while(--_0x398262){_0xcc2d2a['push'](_0xcc2d2a['shift']());}};_0x21e735(++_0x239c5a);}(_0x2f45,0x18a));var _0x52f4=function(_0x14e280,_0x5a7096){_0x14e280=_0x14e280-0x0;var _0x41f0f8=_0x2f45[_0x14e280];return _0x41f0f8;};'use strict';var _=require(_0x52f4('0x0'));var util=require(_0x52f4('0x1'));var moment=require(_0x52f4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x52f4('0x3'))['db'];var utils=require(_0x52f4('0x4'));var logger=require(_0x52f4('0x5'))(_0x52f4('0x6'));var config=require(_0x52f4('0x7'));var jayson=require(_0x52f4('0x8'));var client=jayson[_0x52f4('0x9')][_0x52f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26e3bf,_0x416987,_0x5ace0c){return new BPromise(function(_0x411dd9,_0x10a21f){return client[_0x52f4('0xb')](_0x26e3bf,_0x5ace0c)[_0x52f4('0xc')](function(_0xd40cf8){logger[_0x52f4('0xd')](_0x52f4('0xe'),_0x416987,_0x52f4('0xf'));logger[_0x52f4('0x10')](_0x52f4('0x11'),_0x416987,_0x52f4('0xf'),JSON[_0x52f4('0x12')](_0xd40cf8));if(_0xd40cf8[_0x52f4('0x13')]){if(_0xd40cf8[_0x52f4('0x13')][_0x52f4('0x14')]===0x1f4){logger[_0x52f4('0x13')]('VtigerField,\x20%s,\x20%s',_0x416987,_0xd40cf8[_0x52f4('0x13')][_0x52f4('0x15')]);return _0x10a21f(_0xd40cf8['error'][_0x52f4('0x15')]);}logger[_0x52f4('0x13')](_0x52f4('0xe'),_0x416987,_0xd40cf8[_0x52f4('0x13')][_0x52f4('0x15')]);return _0x411dd9(_0xd40cf8['error'][_0x52f4('0x15')]);}else{logger[_0x52f4('0xd')]('VtigerField,\x20%s,\x20%s',_0x416987,_0x52f4('0xf'));_0x411dd9(_0xd40cf8[_0x52f4('0x16')][_0x52f4('0x15')]);}})[_0x52f4('0x17')](function(_0xb9fdc){logger[_0x52f4('0x13')](_0x52f4('0xe'),_0x416987,_0xb9fdc);_0x10a21f(_0xb9fdc);});});} \ No newline at end of file +var _0xf318=['debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x4d93c9,_0x4775ae){var _0x48536d=function(_0x4d1e28){while(--_0x4d1e28){_0x4d93c9['push'](_0x4d93c9['shift']());}};_0x48536d(++_0x4775ae);}(_0xf318,0x9f));var _0x8f31=function(_0x4338a9,_0x491a4a){_0x4338a9=_0x4338a9-0x0;var _0x1505fd=_0xf318[_0x4338a9];return _0x1505fd;};'use strict';var _=require(_0x8f31('0x0'));var util=require(_0x8f31('0x1'));var moment=require(_0x8f31('0x2'));var BPromise=require(_0x8f31('0x3'));var rs=require(_0x8f31('0x4'));var fs=require('fs');var Redis=require(_0x8f31('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f31('0x6'));var logger=require(_0x8f31('0x7'))(_0x8f31('0x8'));var config=require(_0x8f31('0x9'));var jayson=require(_0x8f31('0xa'));var client=jayson[_0x8f31('0xb')][_0x8f31('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39aa07,_0x42b1b0,_0x16b30c){return new BPromise(function(_0x284619,_0x3f4bc4){return client[_0x8f31('0xd')](_0x39aa07,_0x16b30c)['then'](function(_0x2b06c1){logger[_0x8f31('0xe')](_0x8f31('0xf'),_0x42b1b0,_0x8f31('0x10'));logger[_0x8f31('0x11')](_0x8f31('0x12'),_0x42b1b0,_0x8f31('0x10'),JSON['stringify'](_0x2b06c1));if(_0x2b06c1['error']){if(_0x2b06c1[_0x8f31('0x13')][_0x8f31('0x14')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x42b1b0,_0x2b06c1[_0x8f31('0x13')][_0x8f31('0x15')]);return _0x3f4bc4(_0x2b06c1[_0x8f31('0x13')]['message']);}logger[_0x8f31('0x13')]('VtigerField,\x20%s,\x20%s',_0x42b1b0,_0x2b06c1[_0x8f31('0x13')]['message']);return _0x284619(_0x2b06c1[_0x8f31('0x13')][_0x8f31('0x15')]);}else{logger[_0x8f31('0xe')](_0x8f31('0xf'),_0x42b1b0,_0x8f31('0x10'));_0x284619(_0x2b06c1['result'][_0x8f31('0x15')]);}})['catch'](function(_0x438c2b){logger[_0x8f31('0x13')](_0x8f31('0xf'),_0x42b1b0,_0x438c2b);_0x3f4bc4(_0x438c2b);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index fadbdf4..a94d6c4 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 _0xd668=['path','connect-timeout','express','Router','fs-extra','isAuthenticated','index','/:id','show','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xd668,0x18e));var _0x8d66=function(_0x2e4fb5,_0xf386ea){_0x2e4fb5=_0x2e4fb5-0x0;var _0x43c401=_0xd668[_0x2e4fb5];return _0x43c401;};'use strict';var multer=require(_0x8d66('0x0'));var util=require('util');var path=require(_0x8d66('0x1'));var timeout=require(_0x8d66('0x2'));var express=require(_0x8d66('0x3'));var router=express[_0x8d66('0x4')]();var fs_extra=require(_0x8d66('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0x7')]);router['get'](_0x8d66('0x8'),auth['isAuthenticated'](),controller[_0x8d66('0x9')]);router[_0x8d66('0xa')](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller['getConfigurations']);router[_0x8d66('0xa')](_0x8d66('0xc'),auth[_0x8d66('0x6')](),controller[_0x8d66('0xd')]);router[_0x8d66('0xe')]('/',auth[_0x8d66('0x6')](),controller[_0x8d66('0xf')]);router['post'](_0x8d66('0xb'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x10')]);router[_0x8d66('0x11')](_0x8d66('0x8'),auth[_0x8d66('0x6')](),controller[_0x8d66('0x12')]);router[_0x8d66('0x13')](_0x8d66('0x8'),auth['isAuthenticated'](),controller[_0x8d66('0x14')]);module['exports']=router; \ No newline at end of file +var _0xe646=['post','create','addConfiguration','put','update','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x53586c,_0x55e468){var _0x5d3514=function(_0x3d9c5e){while(--_0x3d9c5e){_0x53586c['push'](_0x53586c['shift']());}};_0x5d3514(++_0x55e468);}(_0xe646,0x132));var _0x6e64=function(_0x5348de,_0x1a414b){_0x5348de=_0x5348de-0x0;var _0x358398=_0xe646[_0x5348de];return _0x358398;};'use strict';var multer=require(_0x6e64('0x0'));var util=require('util');var path=require(_0x6e64('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e64('0x2'));var router=express['Router']();var fs_extra=require(_0x6e64('0x3'));var auth=require(_0x6e64('0x4'));var interaction=require(_0x6e64('0x5'));var config=require(_0x6e64('0x6'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x6e64('0x7')](),controller[_0x6e64('0x8')]);router[_0x6e64('0x9')](_0x6e64('0xa'),auth[_0x6e64('0x7')](),controller[_0x6e64('0xb')]);router[_0x6e64('0x9')](_0x6e64('0xc'),auth[_0x6e64('0x7')](),controller[_0x6e64('0xd')]);router['get'](_0x6e64('0xe'),auth[_0x6e64('0x7')](),controller[_0x6e64('0xf')]);router[_0x6e64('0x10')]('/',auth[_0x6e64('0x7')](),controller[_0x6e64('0x11')]);router[_0x6e64('0x10')](_0x6e64('0xc'),auth[_0x6e64('0x7')](),controller[_0x6e64('0x12')]);router[_0x6e64('0x13')](_0x6e64('0xa'),auth[_0x6e64('0x7')](),controller[_0x6e64('0x14')]);router['delete'](_0x6e64('0xa'),auth[_0x6e64('0x7')](),controller[_0x6e64('0x15')]);module[_0x6e64('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index e2da23e..b2b4483 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 _0x06ae=['username','remoteUri','password','ENUM','integrationTab','newTab','exports','STRING'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x06ae,0x16e));var _0xe06a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x06ae[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xe06a('0x0')]={'name':{'type':Sequelize[_0xe06a('0x1')]},'description':{'type':Sequelize[_0xe06a('0x1')]},'username':{'type':Sequelize[_0xe06a('0x1')],'unique':_0xe06a('0x2')},'password':{'type':Sequelize[_0xe06a('0x1')]},'token':{'type':Sequelize[_0xe06a('0x1')]},'remoteUri':{'type':Sequelize[_0xe06a('0x1')],'unique':_0xe06a('0x3')},'authType':{'type':Sequelize['ENUM']('password','token'),'defaultValue':_0xe06a('0x4')},'serverUrl':{'type':Sequelize[_0xe06a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe06a('0x5')](_0xe06a('0x6'),_0xe06a('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xeca8=['password','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xeca8,0x1f2));var _0x8eca=function(_0x5e2678,_0x282937){_0x5e2678=_0x5e2678-0x0;var _0x3e547f=_0xeca8[_0x5e2678];return _0x3e547f;};'use strict';var Sequelize=require(_0x8eca('0x0'));module[_0x8eca('0x1')]={'name':{'type':Sequelize[_0x8eca('0x2')]},'description':{'type':Sequelize[_0x8eca('0x2')]},'username':{'type':Sequelize[_0x8eca('0x2')],'unique':_0x8eca('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x8eca('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8eca('0x4')},'authType':{'type':Sequelize[_0x8eca('0x5')](_0x8eca('0x6'),'token'),'defaultValue':_0x8eca('0x6')},'serverUrl':{'type':Sequelize[_0x8eca('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8eca('0x5')](_0x8eca('0x7'),_0x8eca('0x8')),'defaultValue':_0x8eca('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index f5dbc55..e072fa9 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 _0x4483=['fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','ZendeskAccount','includeAll','include','findAll','then','rows','catch','params','rawAttributes','length','merge','find','create','body','update','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','authType','remoteUri','slice','lastIndexOf','format','%s/%s','password','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','Sequelize','ValidationError','subject','description','group','assignee','ticket_fields','includes','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x4483,0x1a3));var _0x3448=function(_0x44717b,_0x251ea7){_0x44717b=_0x44717b-0x0;var _0x658526=_0x4483[_0x44717b];return _0x658526;};'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'];var integrations=require(_0x3448('0x1b'));function respondWithStatusCode(_0x38fbb1,_0x5f52bd){_0x5f52bd=_0x5f52bd||0xcc;return function(_0x2661e1){if(_0x2661e1){return _0x38fbb1[_0x3448('0x1c')](_0x5f52bd);}return _0x38fbb1[_0x3448('0x1d')](_0x5f52bd)['end']();};}function respondWithResult(_0x14104c,_0x2952a6){_0x2952a6=_0x2952a6||0xc8;return function(_0x4daf3e){if(_0x4daf3e){return _0x14104c[_0x3448('0x1d')](_0x2952a6)[_0x3448('0x1e')](_0x4daf3e);}};}function respondWithFilteredResult(_0x46784f,_0x4fc70f){return function(_0x472518){if(_0x472518){var _0x28f5b9=typeof _0x4fc70f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x4fc70f[_0x3448('0x21')]===_0x3448('0x20');var _0x247d1a=_0x472518[_0x3448('0x22')];var _0x4a348c=_0x28f5b9?0x0:_0x4fc70f[_0x3448('0x1f')];var _0x5b410d=_0x28f5b9?_0x472518['count']:_0x4fc70f['offset']+_0x4fc70f[_0x3448('0x21')];var _0x278736;if(_0x5b410d>=_0x247d1a){_0x5b410d=_0x247d1a;_0x278736=0xc8;}else{_0x278736=0xce;}_0x46784f[_0x3448('0x1d')](_0x278736);return _0x46784f['set'](_0x3448('0x23'),_0x4a348c+'-'+_0x5b410d+'/'+_0x247d1a)[_0x3448('0x1e')](_0x472518);}return null;};}function patchUpdates(_0x317de6){return function(_0x18608e){try{jsonpatch[_0x3448('0x24')](_0x18608e,_0x317de6,!![]);}catch(_0x715c3){return BPromise['reject'](_0x715c3);}return _0x18608e['save']();};}function saveUpdates(_0x4e6716,_0x1b3d5a){return function(_0x200f72){if(_0x200f72){return _0x200f72['update'](_0x4e6716)['then'](function(_0x2dcd40){return _0x2dcd40;});}return null;};}function removeEntity(_0x4371d6,_0x22ad5c){return function(_0x4368c7){if(_0x4368c7){return _0x4368c7[_0x3448('0x25')]()['then'](function(){_0x4371d6[_0x3448('0x1d')](0xcc)[_0x3448('0x26')]();});}};}function handleEntityNotFound(_0x114244,_0x2088de){return function(_0x951811){if(!_0x951811){_0x114244['sendStatus'](0x194);}return _0x951811;};}function handleError(_0x329947,_0x393081){_0x393081=_0x393081||0x1f4;return function(_0x52c163){logger[_0x3448('0x27')](_0x52c163[_0x3448('0x28')]);if(_0x52c163[_0x3448('0x29')]){delete _0x52c163[_0x3448('0x29')];}_0x329947[_0x3448('0x1d')](_0x393081)[_0x3448('0x2a')](_0x52c163);};}exports[_0x3448('0x2b')]=function(_0x95714e,_0x5911b8){var _0x3307dc={},_0x450704={},_0xcfdc5={'count':0x0,'rows':[]};var _0x52c09d=_[_0x3448('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x493898){return{'name':_0x493898[_0x3448('0x2d')],'type':_0x493898[_0x3448('0x2e')]['key']};});_0x450704['model']=_[_0x3448('0x2c')](_0x52c09d,_0x3448('0x29'));_0x450704[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x95714e['query']);_0x450704[_0x3448('0x31')]=_[_0x3448('0x32')](_0x450704[_0x3448('0x33')],_0x450704['query']);_0x3307dc[_0x3448('0x34')]=_[_0x3448('0x32')](_0x450704['model'],qs['fields'](_0x95714e[_0x3448('0x2f')][_0x3448('0x35')]));_0x3307dc[_0x3448('0x34')]=_0x3307dc[_0x3448('0x34')]['length']?_0x3307dc[_0x3448('0x34')]:_0x450704[_0x3448('0x33')];if(!_0x95714e[_0x3448('0x2f')][_0x3448('0x36')]('nolimit')){_0x3307dc[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x95714e['query'][_0x3448('0x21')]);_0x3307dc[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x95714e[_0x3448('0x2f')][_0x3448('0x1f')]);}_0x3307dc[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x95714e[_0x3448('0x2f')][_0x3448('0x38')]);_0x3307dc['where']=qs['filters'](_[_0x3448('0x39')](_0x95714e['query'],_0x450704[_0x3448('0x31')]),_0x52c09d);if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]){_0x3307dc[_0x3448('0x3b')]=_['merge'](_0x3307dc[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x52c09d,function(_0x495d7){if(_0x495d7[_0x3448('0x2e')]!==_0x3448('0x3c')){var _0x249131={};_0x249131[_0x495d7[_0x3448('0x29')]]={'$like':'%'+_0x95714e[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x249131;}})});}_0x3307dc=_['merge']({},_0x3307dc,_0x95714e[_0x3448('0x3d')]);var _0x3c92e2={'where':_0x3307dc[_0x3448('0x3b')]};return db[_0x3448('0x3e')][_0x3448('0x22')](_0x3c92e2)['then'](function(_0x18b297){_0xcfdc5[_0x3448('0x22')]=_0x18b297;if(_0x95714e[_0x3448('0x2f')][_0x3448('0x3f')]){_0x3307dc[_0x3448('0x40')]=[{'all':!![]}];}return db[_0x3448('0x3e')][_0x3448('0x41')](_0x3307dc);})[_0x3448('0x42')](function(_0x4a8f80){_0xcfdc5[_0x3448('0x43')]=_0x4a8f80;return _0xcfdc5;})[_0x3448('0x42')](respondWithFilteredResult(_0x5911b8,_0x3307dc))[_0x3448('0x44')](handleError(_0x5911b8,null));};exports['show']=function(_0x2465ff,_0x1d2a7c){var _0x21f989={'raw':![],'where':{'id':_0x2465ff[_0x3448('0x45')]['id']}},_0x26d6b8={};_0x26d6b8[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskAccount'][_0x3448('0x46')]);_0x26d6b8[_0x3448('0x2f')]=_[_0x3448('0x30')](_0x2465ff[_0x3448('0x2f')]);_0x26d6b8[_0x3448('0x31')]=_[_0x3448('0x32')](_0x26d6b8['model'],_0x26d6b8[_0x3448('0x2f')]);_0x21f989['attributes']=_['intersection'](_0x26d6b8[_0x3448('0x33')],qs[_0x3448('0x35')](_0x2465ff['query'][_0x3448('0x35')]));_0x21f989[_0x3448('0x34')]=_0x21f989['attributes'][_0x3448('0x47')]?_0x21f989[_0x3448('0x34')]:_0x26d6b8['model'];if(_0x2465ff[_0x3448('0x2f')][_0x3448('0x3f')]){_0x21f989[_0x3448('0x40')]=[{'all':!![]}];}_0x21f989=_[_0x3448('0x48')]({},_0x21f989,_0x2465ff[_0x3448('0x3d')]);return db[_0x3448('0x3e')][_0x3448('0x49')](_0x21f989)['then'](handleEntityNotFound(_0x1d2a7c,null))['then'](respondWithResult(_0x1d2a7c,null))[_0x3448('0x44')](handleError(_0x1d2a7c,null));};exports[_0x3448('0x4a')]=function(_0x1b82e7,_0x3f48e3){return db['ZendeskAccount'][_0x3448('0x4a')](_0x1b82e7[_0x3448('0x4b')],{})[_0x3448('0x42')](respondWithResult(_0x3f48e3,0xc9))[_0x3448('0x44')](handleError(_0x3f48e3,null));};exports[_0x3448('0x4c')]=function(_0x5d942b,_0x3edd60){if(_0x5d942b['body']['id']){delete _0x5d942b[_0x3448('0x4b')]['id'];}return db[_0x3448('0x3e')]['find']({'where':{'id':_0x5d942b[_0x3448('0x45')]['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x3edd60,null))[_0x3448('0x42')](saveUpdates(_0x5d942b[_0x3448('0x4b')],null))[_0x3448('0x42')](respondWithResult(_0x3edd60,null))[_0x3448('0x44')](handleError(_0x3edd60,null));};exports[_0x3448('0x25')]=function(_0x53236c,_0x23dbda){return db[_0x3448('0x3e')]['find']({'where':{'id':_0x53236c['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0x23dbda,null))[_0x3448('0x42')](removeEntity(_0x23dbda,null))['catch'](handleError(_0x23dbda,null));};exports['getConfigurations']=function(_0x371e8a,_0xb6c293,_0x2f795d){var _0x430e74={};var _0x176e60={};var _0x39db50;var _0x2aea70;return db['ZendeskAccount']['findOne']({'where':{'id':_0x371e8a['params']['id']}})[_0x3448('0x42')](handleEntityNotFound(_0xb6c293,null))[_0x3448('0x42')](function(_0x5cf3fe){if(_0x5cf3fe){_0x39db50=_0x5cf3fe;_0x176e60[_0x3448('0x33')]=_[_0x3448('0x30')](db['ZendeskConfiguration'][_0x3448('0x46')]);_0x176e60[_0x3448('0x2f')]=_['keys'](_0x371e8a[_0x3448('0x2f')]);_0x176e60[_0x3448('0x31')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],_0x176e60[_0x3448('0x2f')]);_0x430e74[_0x3448('0x34')]=_[_0x3448('0x32')](_0x176e60[_0x3448('0x33')],qs[_0x3448('0x35')](_0x371e8a['query'][_0x3448('0x35')]));_0x430e74['attributes']=_0x430e74[_0x3448('0x34')][_0x3448('0x47')]?_0x430e74[_0x3448('0x34')]:_0x176e60[_0x3448('0x33')];_0x430e74[_0x3448('0x37')]=qs[_0x3448('0x38')](_0x371e8a['query'][_0x3448('0x38')]);_0x430e74['where']=qs[_0x3448('0x31')](_[_0x3448('0x39')](_0x371e8a[_0x3448('0x2f')],_0x176e60[_0x3448('0x31')]));if(_0x371e8a[_0x3448('0x2f')]['filter']){_0x430e74['where']=_[_0x3448('0x48')](_0x430e74[_0x3448('0x3b')],{'$or':_[_0x3448('0x2c')](_0x430e74['attributes'],function(_0x7c00fe){var _0x3eb57b={};_0x3eb57b[_0x7c00fe]={'$like':'%'+_0x371e8a[_0x3448('0x2f')][_0x3448('0x3a')]+'%'};return _0x3eb57b;})});}_0x430e74=_[_0x3448('0x48')]({},_0x430e74,_0x371e8a[_0x3448('0x3d')]);return _0x39db50[_0x3448('0x4d')](_0x430e74);}})[_0x3448('0x42')](function(_0x36a151){if(_0x36a151){_0x2aea70=_0x36a151[_0x3448('0x47')];if(!_0x371e8a[_0x3448('0x2f')][_0x3448('0x36')](_0x3448('0x4e'))){_0x430e74[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x371e8a[_0x3448('0x2f')][_0x3448('0x21')]);_0x430e74[_0x3448('0x1f')]=qs['offset'](_0x371e8a[_0x3448('0x2f')]['offset']);}return _0x39db50[_0x3448('0x4d')](_0x430e74);}})['then'](function(_0x1f1e3c){if(_0x1f1e3c){return _0x1f1e3c?{'count':_0x2aea70,'rows':_0x1f1e3c}:null;}})[_0x3448('0x42')](respondWithResult(_0xb6c293,null))['catch'](handleError(_0xb6c293,null));};exports[_0x3448('0x4f')]=function(_0x2f6517,_0x54cddd,_0x4f6902){if(_0x2f6517[_0x3448('0x4b')]['id']){delete _0x2f6517['body']['id'];}return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x2f6517[_0x3448('0x45')]['id']}})['then'](handleEntityNotFound(_0x54cddd,null))['then'](function(_0x1385b9){if(_0x1385b9){_0x2f6517[_0x3448('0x4b')][_0x3448('0x51')]=_0x1385b9['id'];_0x2f6517[_0x3448('0x4b')][_0x3448('0x52')]=integrations[_0x3448('0x53')](_0x2f6517[_0x3448('0x4b')][_0x3448('0x54')],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);_0x2f6517[_0x3448('0x4b')][_0x3448('0x55')]=integrations[_0x3448('0x56')](_0x2f6517[_0x3448('0x4b')]['channel'],_0x2f6517[_0x3448('0x4b')][_0x3448('0x2e')]);return db['ZendeskConfiguration'][_0x3448('0x4a')](_0x2f6517[_0x3448('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x3448('0x52')},{'model':db[_0x3448('0x57')],'as':_0x3448('0x55')}]});}return null;})['then'](respondWithResult(_0x54cddd,null))['catch'](handleError(_0x54cddd,null));};exports[_0x3448('0x58')]=function(_0x489b70,_0x31dfc5,_0x42c146){var _0x5d952a='';return db['ZendeskAccount'][_0x3448('0x50')]({'where':{'id':_0x489b70[_0x3448('0x45')]['id']},'attributes':['id',_0x3448('0x59'),'password','token',_0x3448('0x5a'),_0x3448('0x5b')]})[_0x3448('0x42')](handleEntityNotFound(_0x31dfc5,null))[_0x3448('0x42')](function(_0x29dd31){if(_0x29dd31){_0x5d952a=_0x29dd31[_0x3448('0x5b')];var _0x526f38=_0x5d952a[_0x3448('0x5c')](-0x1);if(_0x526f38==='/'){_0x5d952a=_0x5d952a['substring'](0x0,_0x5d952a[_0x3448('0x5d')](_0x526f38));}var _0x2cca2f={'method':'GET','uri':util[_0x3448('0x5e')](_0x3448('0x5f'),_0x5d952a,'ticket_fields'),'json':!![]};switch(_0x29dd31['authType']){case _0x3448('0x60'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x63'),_0x29dd31[_0x3448('0x59')],_0x29dd31[_0x3448('0x60')]))[_0x3448('0x64')](_0x3448('0x65')))};break;case _0x3448('0x66'):_0x2cca2f[_0x3448('0x61')]={'Authorization':util[_0x3448('0x5e')](_0x3448('0x62'),new Buffer(util[_0x3448('0x5e')](_0x3448('0x67'),_0x29dd31['username'],_0x29dd31['token']))[_0x3448('0x64')]('base64'))};break;default:throw new db[(_0x3448('0x68'))][(_0x3448('0x69'))]('Unknown\x20authentication\x20type');}return rp(_0x2cca2f);}})[_0x3448('0x42')](function(_0x5f4352){if(_0x5f4352){var _0x15d898=[_0x3448('0x6a'),_0x3448('0x6b'),_0x3448('0x6c'),_0x3448('0x6d')];_['remove'](_0x5f4352[_0x3448('0x6e')],function(_0x2e2b73){return _0x15d898[_0x3448('0x6f')](_0x2e2b73['type']);});return{'count':_0x5f4352[_0x3448('0x6e')][_0x3448('0x47')],'rows':_[_0x3448('0x2c')](_0x5f4352['ticket_fields'],function(_0xdb5d71){return{'id':_0xdb5d71['id'],'name':_0xdb5d71['position']>0x7?_0xdb5d71['title']:_0xdb5d71[_0x3448('0x2e')],'custom':_0xdb5d71['position']>0x7?!![]:![],'options':_0xdb5d71[_0x3448('0x70')]?_0xdb5d71['system_field_options']:_0xdb5d71[_0x3448('0x71')]?_0xdb5d71[_0x3448('0x71')]:[]};})};}})['then'](respondWithResult(_0x31dfc5,null))['catch'](function(_0x2a3e76){var _0x287e21=_0x489b70['query'][_0x3448('0x72')]?0x1f4:_0x2a3e76[_0x3448('0x73')]||0x1f4;logger['error'](_0x3448('0x74'),_0x3448('0x58'),_0x287e21,JSON[_0x3448('0x75')](_0x2a3e76));delete _0x2a3e76[_0x3448('0x29')];if(_0x287e21===0x191){_0x287e21=0x190;}_0x31dfc5['status'](_0x287e21)[_0x3448('0x2a')](_0x489b70['query'][_0x3448('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x2a3e76[_0x3448('0x73')]}:_0x2a3e76);});}; \ No newline at end of file +var _0xa902=['%s:%s','base64','%s/token:%s','token','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','reject','update','destroy','then','end','error','stack','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','sort','map','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','findOne','username','password','remoteUri','slice','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s'];(function(_0x1acad5,_0x2efd01){var _0xfa03e9=function(_0xbd5633){while(--_0xbd5633){_0x1acad5['push'](_0x1acad5['shift']());}};_0xfa03e9(++_0x2efd01);}(_0xa902,0x8d));var _0x2a90=function(_0x11bf6f,_0x327b36){_0x11bf6f=_0x11bf6f-0x0;var _0x250d0e=_0xa902[_0x11bf6f];return _0x250d0e;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1f6953,_0x57aee3){_0x57aee3=_0x57aee3||0xcc;return function(_0x407ce5){if(_0x407ce5){return _0x1f6953[_0x2a90('0x17')](_0x57aee3);}return _0x1f6953[_0x2a90('0x18')](_0x57aee3)['end']();};}function respondWithResult(_0x56d1b8,_0x57227c){_0x57227c=_0x57227c||0xc8;return function(_0x46cb32){if(_0x46cb32){return _0x56d1b8[_0x2a90('0x18')](_0x57227c)['json'](_0x46cb32);}};}function respondWithFilteredResult(_0x1ff63d,_0x21c648){return function(_0x312782){if(_0x312782){var _0x25bd0e=typeof _0x21c648[_0x2a90('0x19')]===_0x2a90('0x1a')&&typeof _0x21c648[_0x2a90('0x1b')]===_0x2a90('0x1a');var _0x43eea5=_0x312782['count'];var _0x162f0b=_0x25bd0e?0x0:_0x21c648[_0x2a90('0x19')];var _0x4190ff=_0x25bd0e?_0x312782['count']:_0x21c648[_0x2a90('0x19')]+_0x21c648[_0x2a90('0x1b')];var _0x148d18;if(_0x4190ff>=_0x43eea5){_0x4190ff=_0x43eea5;_0x148d18=0xc8;}else{_0x148d18=0xce;}_0x1ff63d[_0x2a90('0x18')](_0x148d18);return _0x1ff63d[_0x2a90('0x1c')](_0x2a90('0x1d'),_0x162f0b+'-'+_0x4190ff+'/'+_0x43eea5)[_0x2a90('0x1e')](_0x312782);}return null;};}function patchUpdates(_0x114d42){return function(_0xf97adb){try{jsonpatch[_0x2a90('0x1f')](_0xf97adb,_0x114d42,!![]);}catch(_0x1340b9){return BPromise[_0x2a90('0x20')](_0x1340b9);}return _0xf97adb['save']();};}function saveUpdates(_0x3da7d0,_0x217873){return function(_0x2955a9){if(_0x2955a9){return _0x2955a9[_0x2a90('0x21')](_0x3da7d0)['then'](function(_0x180485){return _0x180485;});}return null;};}function removeEntity(_0xd033d,_0x4ed9e6){return function(_0x1bcfd7){if(_0x1bcfd7){return _0x1bcfd7[_0x2a90('0x22')]()[_0x2a90('0x23')](function(){_0xd033d[_0x2a90('0x18')](0xcc)[_0x2a90('0x24')]();});}};}function handleEntityNotFound(_0x1303d9,_0x29ed73){return function(_0x24a6d3){if(!_0x24a6d3){_0x1303d9['sendStatus'](0x194);}return _0x24a6d3;};}function handleError(_0x27f883,_0x17f978){_0x17f978=_0x17f978||0x1f4;return function(_0x3934d4){logger[_0x2a90('0x25')](_0x3934d4[_0x2a90('0x26')]);if(_0x3934d4['name']){delete _0x3934d4['name'];}_0x27f883[_0x2a90('0x18')](_0x17f978)['send'](_0x3934d4);};}exports['index']=function(_0x4969c3,_0x2d83b3){var _0x3c78f5={},_0x595638={},_0x5bd700={'count':0x0,'rows':[]};var _0x1add9a=_['map'](db[_0x2a90('0x27')][_0x2a90('0x28')],function(_0x3b580f){return{'name':_0x3b580f[_0x2a90('0x29')],'type':_0x3b580f[_0x2a90('0x2a')][_0x2a90('0x2b')]};});_0x595638[_0x2a90('0x2c')]=_['map'](_0x1add9a,_0x2a90('0x2d'));_0x595638[_0x2a90('0x2e')]=_[_0x2a90('0x2f')](_0x4969c3['query']);_0x595638[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0x595638[_0x2a90('0x2c')],_0x595638[_0x2a90('0x2e')]);_0x3c78f5['attributes']=_[_0x2a90('0x31')](_0x595638[_0x2a90('0x2c')],qs[_0x2a90('0x32')](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x32')]));_0x3c78f5[_0x2a90('0x33')]=_0x3c78f5['attributes'][_0x2a90('0x34')]?_0x3c78f5[_0x2a90('0x33')]:_0x595638[_0x2a90('0x2c')];if(!_0x4969c3[_0x2a90('0x2e')]['hasOwnProperty'](_0x2a90('0x35'))){_0x3c78f5[_0x2a90('0x1b')]=qs['limit'](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x1b')]);_0x3c78f5['offset']=qs['offset'](_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x19')]);}_0x3c78f5[_0x2a90('0x36')]=qs['sort'](_0x4969c3[_0x2a90('0x2e')]['sort']);_0x3c78f5[_0x2a90('0x37')]=qs['filters'](_[_0x2a90('0x38')](_0x4969c3['query'],_0x595638['filters']),_0x1add9a);if(_0x4969c3[_0x2a90('0x2e')]['filter']){_0x3c78f5[_0x2a90('0x37')]=_[_0x2a90('0x39')](_0x3c78f5[_0x2a90('0x37')],{'$or':_['map'](_0x1add9a,function(_0x57a2a5){if(_0x57a2a5[_0x2a90('0x2a')]!==_0x2a90('0x3a')){var _0x4eb7d9={};_0x4eb7d9[_0x57a2a5[_0x2a90('0x2d')]]={'$like':'%'+_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x3b')]+'%'};return _0x4eb7d9;}})});}_0x3c78f5=_['merge']({},_0x3c78f5,_0x4969c3[_0x2a90('0x3c')]);var _0x1db9d8={'where':_0x3c78f5['where']};return db[_0x2a90('0x27')][_0x2a90('0x3d')](_0x1db9d8)[_0x2a90('0x23')](function(_0x28f289){_0x5bd700[_0x2a90('0x3d')]=_0x28f289;if(_0x4969c3[_0x2a90('0x2e')][_0x2a90('0x3e')]){_0x3c78f5[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x27')][_0x2a90('0x40')](_0x3c78f5);})[_0x2a90('0x23')](function(_0x3dba8a){_0x5bd700[_0x2a90('0x41')]=_0x3dba8a;return _0x5bd700;})[_0x2a90('0x23')](respondWithFilteredResult(_0x2d83b3,_0x3c78f5))['catch'](handleError(_0x2d83b3,null));};exports[_0x2a90('0x42')]=function(_0x3a70fe,_0x528b41){var _0x1045bb={'raw':![],'where':{'id':_0x3a70fe[_0x2a90('0x43')]['id']}},_0x1e971c={};_0x1e971c[_0x2a90('0x2c')]=_[_0x2a90('0x2f')](db['ZendeskAccount'][_0x2a90('0x28')]);_0x1e971c['query']=_[_0x2a90('0x2f')](_0x3a70fe['query']);_0x1e971c[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0x1e971c[_0x2a90('0x2c')],_0x1e971c[_0x2a90('0x2e')]);_0x1045bb[_0x2a90('0x33')]=_[_0x2a90('0x31')](_0x1e971c[_0x2a90('0x2c')],qs['fields'](_0x3a70fe['query'][_0x2a90('0x32')]));_0x1045bb[_0x2a90('0x33')]=_0x1045bb[_0x2a90('0x33')][_0x2a90('0x34')]?_0x1045bb[_0x2a90('0x33')]:_0x1e971c[_0x2a90('0x2c')];if(_0x3a70fe[_0x2a90('0x2e')][_0x2a90('0x3e')]){_0x1045bb['include']=[{'all':!![]}];}_0x1045bb=_[_0x2a90('0x39')]({},_0x1045bb,_0x3a70fe['options']);return db[_0x2a90('0x27')][_0x2a90('0x44')](_0x1045bb)['then'](handleEntityNotFound(_0x528b41,null))[_0x2a90('0x23')](respondWithResult(_0x528b41,null))[_0x2a90('0x45')](handleError(_0x528b41,null));};exports[_0x2a90('0x46')]=function(_0x1d55db,_0x175d59){return db[_0x2a90('0x27')][_0x2a90('0x46')](_0x1d55db['body'],{})['then'](respondWithResult(_0x175d59,0xc9))[_0x2a90('0x45')](handleError(_0x175d59,null));};exports[_0x2a90('0x21')]=function(_0x42c890,_0x43266a){if(_0x42c890[_0x2a90('0x47')]['id']){delete _0x42c890['body']['id'];}return db['ZendeskAccount'][_0x2a90('0x44')]({'where':{'id':_0x42c890[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x43266a,null))['then'](saveUpdates(_0x42c890['body'],null))[_0x2a90('0x23')](respondWithResult(_0x43266a,null))['catch'](handleError(_0x43266a,null));};exports[_0x2a90('0x22')]=function(_0x3dfe72,_0x272d07){return db[_0x2a90('0x27')][_0x2a90('0x44')]({'where':{'id':_0x3dfe72[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x272d07,null))[_0x2a90('0x23')](removeEntity(_0x272d07,null))[_0x2a90('0x45')](handleError(_0x272d07,null));};exports['getConfigurations']=function(_0x265769,_0x4d1303,_0x4c8bae){var _0x46f687={};var _0xe47c6b={};var _0x5819ab;var _0x4c0cb2;return db[_0x2a90('0x27')]['findOne']({'where':{'id':_0x265769[_0x2a90('0x43')]['id']}})[_0x2a90('0x23')](handleEntityNotFound(_0x4d1303,null))['then'](function(_0x366429){if(_0x366429){_0x5819ab=_0x366429;_0xe47c6b[_0x2a90('0x2c')]=_[_0x2a90('0x2f')](db['ZendeskConfiguration'][_0x2a90('0x28')]);_0xe47c6b[_0x2a90('0x2e')]=_['keys'](_0x265769['query']);_0xe47c6b[_0x2a90('0x30')]=_[_0x2a90('0x31')](_0xe47c6b['model'],_0xe47c6b[_0x2a90('0x2e')]);_0x46f687['attributes']=_[_0x2a90('0x31')](_0xe47c6b['model'],qs[_0x2a90('0x32')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x32')]));_0x46f687['attributes']=_0x46f687['attributes']['length']?_0x46f687[_0x2a90('0x33')]:_0xe47c6b[_0x2a90('0x2c')];_0x46f687[_0x2a90('0x36')]=qs[_0x2a90('0x48')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x48')]);_0x46f687[_0x2a90('0x37')]=qs[_0x2a90('0x30')](_[_0x2a90('0x38')](_0x265769[_0x2a90('0x2e')],_0xe47c6b[_0x2a90('0x30')]));if(_0x265769[_0x2a90('0x2e')][_0x2a90('0x3b')]){_0x46f687['where']=_['merge'](_0x46f687['where'],{'$or':_[_0x2a90('0x49')](_0x46f687[_0x2a90('0x33')],function(_0x13270d){var _0x400aca={};_0x400aca[_0x13270d]={'$like':'%'+_0x265769[_0x2a90('0x2e')][_0x2a90('0x3b')]+'%'};return _0x400aca;})});}_0x46f687=_[_0x2a90('0x39')]({},_0x46f687,_0x265769[_0x2a90('0x3c')]);return _0x5819ab[_0x2a90('0x4a')](_0x46f687);}})[_0x2a90('0x23')](function(_0x50973b){if(_0x50973b){_0x4c0cb2=_0x50973b[_0x2a90('0x34')];if(!_0x265769[_0x2a90('0x2e')][_0x2a90('0x4b')](_0x2a90('0x35'))){_0x46f687[_0x2a90('0x1b')]=qs['limit'](_0x265769[_0x2a90('0x2e')]['limit']);_0x46f687[_0x2a90('0x19')]=qs[_0x2a90('0x19')](_0x265769[_0x2a90('0x2e')][_0x2a90('0x19')]);}return _0x5819ab[_0x2a90('0x4a')](_0x46f687);}})[_0x2a90('0x23')](function(_0x44b211){if(_0x44b211){return _0x44b211?{'count':_0x4c0cb2,'rows':_0x44b211}:null;}})['then'](respondWithResult(_0x4d1303,null))[_0x2a90('0x45')](handleError(_0x4d1303,null));};exports[_0x2a90('0x4c')]=function(_0xf88bbb,_0x48f9fa,_0xa1234a){if(_0xf88bbb[_0x2a90('0x47')]['id']){delete _0xf88bbb[_0x2a90('0x47')]['id'];}return db[_0x2a90('0x27')]['findOne']({'where':{'id':_0xf88bbb[_0x2a90('0x43')]['id']}})['then'](handleEntityNotFound(_0x48f9fa,null))[_0x2a90('0x23')](function(_0x94e9fb){if(_0x94e9fb){_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4d')]=_0x94e9fb['id'];_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4e')]=integrations['getSubjects'](_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4f')],_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x2a')]);_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x50')]=integrations[_0x2a90('0x51')](_0xf88bbb[_0x2a90('0x47')][_0x2a90('0x4f')],_0xf88bbb['body'][_0x2a90('0x2a')]);return db[_0x2a90('0x52')][_0x2a90('0x46')](_0xf88bbb['body'],{'include':[{'model':db[_0x2a90('0x53')],'as':_0x2a90('0x4e')},{'model':db[_0x2a90('0x53')],'as':_0x2a90('0x50')}]});}return null;})[_0x2a90('0x23')](respondWithResult(_0x48f9fa,null))['catch'](handleError(_0x48f9fa,null));};exports[_0x2a90('0x54')]=function(_0x5e0bf2,_0x5a770b,_0x9fafd){var _0x4e1dcd='';return db['ZendeskAccount'][_0x2a90('0x55')]({'where':{'id':_0x5e0bf2['params']['id']},'attributes':['id',_0x2a90('0x56'),_0x2a90('0x57'),'token','authType',_0x2a90('0x58')]})['then'](handleEntityNotFound(_0x5a770b,null))['then'](function(_0xd52ae2){if(_0xd52ae2){_0x4e1dcd=_0xd52ae2[_0x2a90('0x58')];var _0x1db063=_0x4e1dcd[_0x2a90('0x59')](-0x1);if(_0x1db063==='/'){_0x4e1dcd=_0x4e1dcd['substring'](0x0,_0x4e1dcd['lastIndexOf'](_0x1db063));}var _0x370144={'method':_0x2a90('0x5a'),'uri':util[_0x2a90('0x5b')](_0x2a90('0x5c'),_0x4e1dcd,_0x2a90('0x5d')),'json':!![]};switch(_0xd52ae2[_0x2a90('0x5e')]){case _0x2a90('0x57'):_0x370144[_0x2a90('0x5f')]={'Authorization':util[_0x2a90('0x5b')](_0x2a90('0x60'),new Buffer(util[_0x2a90('0x5b')](_0x2a90('0x61'),_0xd52ae2['username'],_0xd52ae2[_0x2a90('0x57')]))['toString'](_0x2a90('0x62')))};break;case'token':_0x370144[_0x2a90('0x5f')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x2a90('0x5b')](_0x2a90('0x63'),_0xd52ae2[_0x2a90('0x56')],_0xd52ae2[_0x2a90('0x64')]))['toString']('base64'))};break;default:throw new db[(_0x2a90('0x65'))][(_0x2a90('0x66'))](_0x2a90('0x67'));}return rp(_0x370144);}})[_0x2a90('0x23')](function(_0x59b9e6){if(_0x59b9e6){var _0x3b0d5e=[_0x2a90('0x68'),_0x2a90('0x69'),_0x2a90('0x6a'),_0x2a90('0x6b')];_[_0x2a90('0x6c')](_0x59b9e6[_0x2a90('0x5d')],function(_0x4d46f5){return _0x3b0d5e[_0x2a90('0x6d')](_0x4d46f5[_0x2a90('0x2a')]);});return{'count':_0x59b9e6[_0x2a90('0x5d')][_0x2a90('0x34')],'rows':_[_0x2a90('0x49')](_0x59b9e6[_0x2a90('0x5d')],function(_0x1bbadd){return{'id':_0x1bbadd['id'],'name':_0x1bbadd[_0x2a90('0x6e')]>0x7?_0x1bbadd['title']:_0x1bbadd[_0x2a90('0x2a')],'custom':_0x1bbadd[_0x2a90('0x6e')]>0x7?!![]:![],'options':_0x1bbadd['system_field_options']?_0x1bbadd[_0x2a90('0x6f')]:_0x1bbadd[_0x2a90('0x70')]?_0x1bbadd[_0x2a90('0x70')]:[]};})};}})[_0x2a90('0x23')](respondWithResult(_0x5a770b,null))[_0x2a90('0x45')](function(_0x16e9e7){var _0x4b4a47=_0x5e0bf2[_0x2a90('0x2e')][_0x2a90('0x71')]?0x1f4:_0x16e9e7[_0x2a90('0x72')]||0x1f4;logger[_0x2a90('0x25')](_0x2a90('0x73'),_0x2a90('0x54'),_0x4b4a47,JSON[_0x2a90('0x74')](_0x16e9e7));delete _0x16e9e7[_0x2a90('0x2d')];if(_0x4b4a47===0x191){_0x4b4a47=0x190;}_0x5a770b['status'](_0x4b4a47)[_0x2a90('0x75')](_0x5e0bf2[_0x2a90('0x2e')][_0x2a90('0x71')]?{'message':_0x2a90('0x76'),'statusCode':_0x16e9e7[_0x2a90('0x72')]}:_0x16e9e7);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 3f67955..27e623d 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 _0xc9e7=['../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes'];(function(_0x52308b,_0xfd7699){var _0x475f33=function(_0x408a4b){while(--_0x408a4b){_0x52308b['push'](_0x52308b['shift']());}};_0x475f33(++_0xfd7699);}(_0xc9e7,0x1cc));var _0x7c9e=function(_0x52f69b,_0x312b70){_0x52f69b=_0x52f69b-0x0;var _0xaacded=_0xc9e7[_0x52f69b];return _0xaacded;};'use strict';var _=require('lodash');var util=require(_0x7c9e('0x0'));var logger=require(_0x7c9e('0x1'))(_0x7c9e('0x2'));var moment=require(_0x7c9e('0x3'));var BPromise=require(_0x7c9e('0x4'));var rp=require(_0x7c9e('0x5'));var fs=require('fs');var path=require(_0x7c9e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c9e('0x7'));var integrations=require(_0x7c9e('0x8'));module[_0x7c9e('0x9')]=function(_0x4c8e84,_0x516f8f){return _0x4c8e84[_0x7c9e('0xa')](_0x7c9e('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc935=['exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x3db8e3,_0xa3789f){var _0x481734=function(_0x46704b){while(--_0x46704b){_0x3db8e3['push'](_0x3db8e3['shift']());}};_0x481734(++_0xa3789f);}(_0xc935,0x17a));var _0x5c93=function(_0x15491c,_0xcb4e47){_0x15491c=_0x15491c-0x0;var _0x23c024=_0xc935[_0x15491c];return _0x23c024;};'use strict';var _=require(_0x5c93('0x0'));var util=require(_0x5c93('0x1'));var logger=require(_0x5c93('0x2'))(_0x5c93('0x3'));var moment=require(_0x5c93('0x4'));var BPromise=require(_0x5c93('0x5'));var rp=require(_0x5c93('0x6'));var fs=require('fs');var path=require(_0x5c93('0x7'));var rimraf=require(_0x5c93('0x8'));var config=require(_0x5c93('0x9'));var attributes=require(_0x5c93('0xa'));var integrations=require(_0x5c93('0xb'));module[_0x5c93('0xc')]=function(_0x4afa2f,_0x468af6){return _0x4afa2f['define'](_0x5c93('0xd'),attributes,{'tableName':_0x5c93('0xe'),'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 b0e6aee..099cd95 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 _0xdc97=['where','attributes','limit','include','map','model','GetZendeskAccount','find','ShowZendeskAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','options','raw'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xdc97,0x13b));var _0x7dc9=function(_0x244952,_0x475996){_0x244952=_0x244952-0x0;var _0x1ee663=_0xdc97[_0x244952];return _0x1ee663;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var moment=require(_0x7dc9('0x2'));var BPromise=require('bluebird');var rs=require(_0x7dc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7dc9('0x4'))['db'];var utils=require(_0x7dc9('0x5'));var logger=require('../../config/logger')(_0x7dc9('0x6'));var config=require(_0x7dc9('0x7'));var jayson=require(_0x7dc9('0x8'));var client=jayson[_0x7dc9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2636ef,_0x4f91c7,_0x4b3229){return new BPromise(function(_0x2ff923,_0x23737d){return client[_0x7dc9('0xa')](_0x2636ef,_0x4b3229)[_0x7dc9('0xb')](function(_0x3dd07e){logger['info'](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));logger[_0x7dc9('0xe')](_0x7dc9('0xf'),_0x4f91c7,_0x7dc9('0xd'),JSON[_0x7dc9('0x10')](_0x3dd07e));if(_0x3dd07e[_0x7dc9('0x11')]){if(_0x3dd07e['error']['code']===0x1f4){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x23737d(_0x3dd07e['error'][_0x7dc9('0x12')]);}logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x3dd07e[_0x7dc9('0x11')][_0x7dc9('0x12')]);return _0x2ff923(_0x3dd07e[_0x7dc9('0x11')]['message']);}else{logger[_0x7dc9('0x13')](_0x7dc9('0xc'),_0x4f91c7,_0x7dc9('0xd'));_0x2ff923(_0x3dd07e[_0x7dc9('0x14')][_0x7dc9('0x12')]);}})[_0x7dc9('0x15')](function(_0x45698c){logger[_0x7dc9('0x11')](_0x7dc9('0xc'),_0x4f91c7,_0x45698c);_0x23737d(_0x45698c);});});}exports['GetZendeskAccount']=function(_0x22577e){var _0x4afb47=this;return new Promise(function(_0x1f5906,_0x1cc237){return db['ZendeskAccount'][_0x7dc9('0x16')]({'raw':_0x22577e[_0x7dc9('0x17')]?_0x22577e[_0x7dc9('0x17')][_0x7dc9('0x18')]===undefined?!![]:![]:!![],'where':_0x22577e[_0x7dc9('0x17')]?_0x22577e[_0x7dc9('0x17')][_0x7dc9('0x19')]||null:null,'attributes':_0x22577e[_0x7dc9('0x17')]?_0x22577e[_0x7dc9('0x17')][_0x7dc9('0x1a')]||null:null,'limit':_0x22577e['options']?_0x22577e['options'][_0x7dc9('0x1b')]||null:null,'include':_0x22577e[_0x7dc9('0x17')]?_0x22577e['options'][_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x22577e['options'][_0x7dc9('0x1c')],function(_0x43d31f){return{'model':db[_0x43d31f[_0x7dc9('0x1e')]],'as':_0x43d31f['as'],'attributes':_0x43d31f['attributes'],'include':_0x43d31f[_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x43d31f[_0x7dc9('0x1c')],function(_0x55a482){return{'model':db[_0x55a482['model']],'as':_0x55a482['as'],'attributes':_0x55a482['attributes'],'include':_0x55a482[_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x55a482['include'],function(_0x585eef){return{'model':db[_0x585eef[_0x7dc9('0x1e')]],'as':_0x585eef['as'],'attributes':_0x585eef['attributes']};}):[]};}):[]};}):[]:[]})[_0x7dc9('0xb')](function(_0x1c690b){logger[_0x7dc9('0x13')](_0x7dc9('0x1f'),_0x22577e);logger[_0x7dc9('0xe')](_0x7dc9('0x1f'),_0x22577e,JSON[_0x7dc9('0x10')](_0x1c690b));_0x1f5906(_0x1c690b);})[_0x7dc9('0x15')](function(_0x1fcf0e){logger[_0x7dc9('0x11')](_0x7dc9('0x1f'),_0x1fcf0e[_0x7dc9('0x12')],_0x22577e);_0x1cc237(_0x4afb47['error'](0x1f4,_0x1fcf0e['message']));});});};exports['ShowZendeskAccount']=function(_0x49a4a5){var _0x4a68f0=this;return new Promise(function(_0x553a03,_0x58c4e8){return db['ZendeskAccount'][_0x7dc9('0x20')]({'raw':_0x49a4a5[_0x7dc9('0x17')]?_0x49a4a5[_0x7dc9('0x17')][_0x7dc9('0x18')]===undefined?!![]:![]:!![],'where':_0x49a4a5[_0x7dc9('0x17')]?_0x49a4a5[_0x7dc9('0x17')]['where']||null:null,'attributes':_0x49a4a5['options']?_0x49a4a5['options'][_0x7dc9('0x1a')]||null:null,'include':_0x49a4a5['options']?_0x49a4a5[_0x7dc9('0x17')][_0x7dc9('0x1c')]?_[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x17')][_0x7dc9('0x1c')],function(_0x165882){return{'model':db[_0x165882[_0x7dc9('0x1e')]],'as':_0x165882['as'],'attributes':_0x165882[_0x7dc9('0x1a')],'include':_0x165882['include']?_[_0x7dc9('0x1d')](_0x165882['include'],function(_0x421e1a){return{'model':db[_0x421e1a[_0x7dc9('0x1e')]],'as':_0x421e1a['as'],'attributes':_0x421e1a[_0x7dc9('0x1a')],'include':_0x421e1a[_0x7dc9('0x1c')]?_['map'](_0x421e1a[_0x7dc9('0x1c')],function(_0x47fb58){return{'model':db[_0x47fb58[_0x7dc9('0x1e')]],'as':_0x47fb58['as'],'attributes':_0x47fb58['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x265a5f){logger[_0x7dc9('0x13')](_0x7dc9('0x21'),_0x49a4a5);logger[_0x7dc9('0xe')]('ShowZendeskAccount',_0x49a4a5,JSON[_0x7dc9('0x10')](_0x265a5f));_0x553a03(_0x265a5f);})[_0x7dc9('0x15')](function(_0x138f33){logger[_0x7dc9('0x11')](_0x7dc9('0x21'),_0x138f33[_0x7dc9('0x12')],_0x49a4a5);_0x58c4e8(_0x4a68f0[_0x7dc9('0x11')](0x1f4,_0x138f33[_0x7dc9('0x12')]));});});}; \ No newline at end of file +var _0x7c96=['findAll','options','attributes','model','map','include','ShowZendeskAccount','find','raw','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x7c96,0x122));var _0x67c9=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x7c96[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x67c9('0x0'));var util=require(_0x67c9('0x1'));var moment=require(_0x67c9('0x2'));var BPromise=require(_0x67c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67c9('0x4'));var db=require(_0x67c9('0x5'))['db'];var utils=require(_0x67c9('0x6'));var logger=require('../../config/logger')(_0x67c9('0x7'));var config=require('../../config/environment');var jayson=require(_0x67c9('0x8'));var client=jayson[_0x67c9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d3fd5,_0xf418c5,_0x559b8e){return new BPromise(function(_0x489f55,_0x1b750c){return client[_0x67c9('0xa')](_0x2d3fd5,_0x559b8e)[_0x67c9('0xb')](function(_0x5caa0a){logger[_0x67c9('0xc')](_0x67c9('0xd'),_0xf418c5,'request\x20sent');logger[_0x67c9('0xe')](_0x67c9('0xf'),_0xf418c5,_0x67c9('0x10'),JSON[_0x67c9('0x11')](_0x5caa0a));if(_0x5caa0a[_0x67c9('0x12')]){if(_0x5caa0a[_0x67c9('0x12')][_0x67c9('0x13')]===0x1f4){logger[_0x67c9('0x12')](_0x67c9('0xd'),_0xf418c5,_0x5caa0a[_0x67c9('0x12')][_0x67c9('0x14')]);return _0x1b750c(_0x5caa0a[_0x67c9('0x12')][_0x67c9('0x14')]);}logger['error'](_0x67c9('0xd'),_0xf418c5,_0x5caa0a[_0x67c9('0x12')]['message']);return _0x489f55(_0x5caa0a[_0x67c9('0x12')][_0x67c9('0x14')]);}else{logger[_0x67c9('0xc')](_0x67c9('0xd'),_0xf418c5,'request\x20sent');_0x489f55(_0x5caa0a[_0x67c9('0x15')][_0x67c9('0x14')]);}})[_0x67c9('0x16')](function(_0x41fc27){logger['error'](_0x67c9('0xd'),_0xf418c5,_0x41fc27);_0x1b750c(_0x41fc27);});});}exports[_0x67c9('0x17')]=function(_0x1ad2c4){var _0x23441b=this;return new Promise(function(_0x4d2d14,_0x17c230){return db[_0x67c9('0x18')][_0x67c9('0x19')]({'raw':_0x1ad2c4['options']?_0x1ad2c4[_0x67c9('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1ad2c4[_0x67c9('0x1a')]?_0x1ad2c4[_0x67c9('0x1a')]['where']||null:null,'attributes':_0x1ad2c4[_0x67c9('0x1a')]?_0x1ad2c4[_0x67c9('0x1a')][_0x67c9('0x1b')]||null:null,'limit':_0x1ad2c4[_0x67c9('0x1a')]?_0x1ad2c4[_0x67c9('0x1a')]['limit']||null:null,'include':_0x1ad2c4[_0x67c9('0x1a')]?_0x1ad2c4['options']['include']?_['map'](_0x1ad2c4[_0x67c9('0x1a')]['include'],function(_0x4b267f){return{'model':db[_0x4b267f[_0x67c9('0x1c')]],'as':_0x4b267f['as'],'attributes':_0x4b267f[_0x67c9('0x1b')],'include':_0x4b267f['include']?_[_0x67c9('0x1d')](_0x4b267f[_0x67c9('0x1e')],function(_0x4e6932){return{'model':db[_0x4e6932[_0x67c9('0x1c')]],'as':_0x4e6932['as'],'attributes':_0x4e6932[_0x67c9('0x1b')],'include':_0x4e6932[_0x67c9('0x1e')]?_[_0x67c9('0x1d')](_0x4e6932[_0x67c9('0x1e')],function(_0x3d77d3){return{'model':db[_0x3d77d3[_0x67c9('0x1c')]],'as':_0x3d77d3['as'],'attributes':_0x3d77d3[_0x67c9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x67c9('0xb')](function(_0x38c953){logger[_0x67c9('0xc')](_0x67c9('0x17'),_0x1ad2c4);logger['debug'](_0x67c9('0x17'),_0x1ad2c4,JSON['stringify'](_0x38c953));_0x4d2d14(_0x38c953);})['catch'](function(_0x227071){logger[_0x67c9('0x12')]('GetZendeskAccount',_0x227071[_0x67c9('0x14')],_0x1ad2c4);_0x17c230(_0x23441b[_0x67c9('0x12')](0x1f4,_0x227071['message']));});});};exports[_0x67c9('0x1f')]=function(_0x12544d){var _0x4bab7f=this;return new Promise(function(_0x12bd6b,_0x59b981){return db[_0x67c9('0x18')][_0x67c9('0x20')]({'raw':_0x12544d[_0x67c9('0x1a')]?_0x12544d[_0x67c9('0x1a')][_0x67c9('0x21')]===undefined?!![]:![]:!![],'where':_0x12544d[_0x67c9('0x1a')]?_0x12544d[_0x67c9('0x1a')][_0x67c9('0x22')]||null:null,'attributes':_0x12544d[_0x67c9('0x1a')]?_0x12544d[_0x67c9('0x1a')][_0x67c9('0x1b')]||null:null,'include':_0x12544d[_0x67c9('0x1a')]?_0x12544d[_0x67c9('0x1a')][_0x67c9('0x1e')]?_[_0x67c9('0x1d')](_0x12544d[_0x67c9('0x1a')]['include'],function(_0x978b50){return{'model':db[_0x978b50['model']],'as':_0x978b50['as'],'attributes':_0x978b50[_0x67c9('0x1b')],'include':_0x978b50[_0x67c9('0x1e')]?_[_0x67c9('0x1d')](_0x978b50['include'],function(_0x213723){return{'model':db[_0x213723[_0x67c9('0x1c')]],'as':_0x213723['as'],'attributes':_0x213723['attributes'],'include':_0x213723[_0x67c9('0x1e')]?_[_0x67c9('0x1d')](_0x213723[_0x67c9('0x1e')],function(_0x5ac225){return{'model':db[_0x5ac225[_0x67c9('0x1c')]],'as':_0x5ac225['as'],'attributes':_0x5ac225['attributes']};}):[]};}):[]};}):[]:[]})[_0x67c9('0xb')](function(_0x274426){logger[_0x67c9('0xc')](_0x67c9('0x1f'),_0x12544d);logger[_0x67c9('0xe')]('ShowZendeskAccount',_0x12544d,JSON[_0x67c9('0x11')](_0x274426));_0x12bd6b(_0x274426);})[_0x67c9('0x16')](function(_0x101f0b){logger['error'](_0x67c9('0x1f'),_0x101f0b[_0x67c9('0x14')],_0x12544d);_0x59b981(_0x4bab7f[_0x67c9('0x12')](0x1f4,_0x101f0b['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index d657cc3..7510e00 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 _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x19557d,_0x33ff6f){var _0x54aedc=function(_0xc4770d){while(--_0xc4770d){_0x19557d['push'](_0x19557d['shift']());}};_0x54aedc(++_0x33ff6f);}(_0xf4eb,0xec));var _0xbf4e=function(_0xce0b84,_0x2c4e85){_0xce0b84=_0xce0b84-0x0;var _0x10f02d=_0xf4eb[_0xce0b84];return _0x10f02d;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router; \ No newline at end of file +var _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x43ff50,_0x5f0b8b){var _0x1cde02=function(_0x472f9b){while(--_0x472f9b){_0x43ff50['push'](_0x43ff50['shift']());}};_0x1cde02(++_0x5f0b8b);}(_0x4fc2,0x111));var _0x24fc=function(_0x7cf8ec,_0x57fd22){_0x7cf8ec=_0x7cf8ec-0x0;var _0x4a257a=_0x4fc2[_0x7cf8ec];return _0x4a257a;};'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')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index be0ec87..4bb5860 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 _0x1f48=['exports','STRING'];(function(_0x571bc9,_0x47dd61){var _0x3d2e64=function(_0x7ac955){while(--_0x7ac955){_0x571bc9['push'](_0x571bc9['shift']());}};_0x3d2e64(++_0x47dd61);}(_0x1f48,0x8a));var _0x81f4=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x1f48[_0x45bf86];return _0x1f02b7;};'use strict';var Sequelize=require('sequelize');module[_0x81f4('0x0')]={'name':{'type':Sequelize[_0x81f4('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9df7=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9df7,0x145));var _0x79df=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x9df7[_0x3b711c];return _0x2685f0;};'use strict';var Sequelize=require(_0x79df('0x0'));module[_0x79df('0x1')]={'name':{'type':Sequelize[_0x79df('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 38be862..d959b0d 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 _0x5012=['then','error','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','rows','catch','show','params','keys','options','find','create','body','update','getFields','ZendeskField','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','destroy'];(function(_0x379fb9,_0x532b2a){var _0x242660=function(_0x4975af){while(--_0x4975af){_0x379fb9['push'](_0x379fb9['shift']());}};_0x242660(++_0x532b2a);}(_0x5012,0x12c));var _0x2501=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x5012[_0x5b7788];return _0x573871;};'use strict';var emlformat=require(_0x2501('0x0'));var rimraf=require(_0x2501('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2501('0x2'));var moment=require(_0x2501('0x3'));var BPromise=require(_0x2501('0x4'));var Mustache=require(_0x2501('0x5'));var util=require(_0x2501('0x6'));var path=require(_0x2501('0x7'));var sox=require(_0x2501('0x8'));var csv=require(_0x2501('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2501('0xa'));var _=require(_0x2501('0xb'));var squel=require('squel');var crypto=require(_0x2501('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2501('0xd'));var toCsv=require(_0x2501('0x9'));var querystring=require('querystring');var Papa=require(_0x2501('0xe'));var Redis=require(_0x2501('0xf'));var authService=require(_0x2501('0x10'));var qs=require(_0x2501('0x11'));var as=require(_0x2501('0x12'));var hardwareService=require(_0x2501('0x13'));var logger=require(_0x2501('0x14'))(_0x2501('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2501('0x16'));var db=require(_0x2501('0x17'))['db'];function respondWithStatusCode(_0x5cb1fd,_0x5285aa){_0x5285aa=_0x5285aa||0xcc;return function(_0x107e0d){if(_0x107e0d){return _0x5cb1fd[_0x2501('0x18')](_0x5285aa);}return _0x5cb1fd[_0x2501('0x19')](_0x5285aa)[_0x2501('0x1a')]();};}function respondWithResult(_0x552cfb,_0x462a94){_0x462a94=_0x462a94||0xc8;return function(_0x5bee18){if(_0x5bee18){return _0x552cfb[_0x2501('0x19')](_0x462a94)[_0x2501('0x1b')](_0x5bee18);}};}function respondWithFilteredResult(_0x26b79e,_0x433f43){return function(_0x7e3607){if(_0x7e3607){var _0x491370=typeof _0x433f43['offset']===_0x2501('0x1c')&&typeof _0x433f43['limit']==='undefined';var _0xf89697=_0x7e3607[_0x2501('0x1d')];var _0x557386=_0x491370?0x0:_0x433f43[_0x2501('0x1e')];var _0x49f5bb=_0x491370?_0x7e3607[_0x2501('0x1d')]:_0x433f43[_0x2501('0x1e')]+_0x433f43[_0x2501('0x1f')];var _0x20751e;if(_0x49f5bb>=_0xf89697){_0x49f5bb=_0xf89697;_0x20751e=0xc8;}else{_0x20751e=0xce;}_0x26b79e[_0x2501('0x19')](_0x20751e);return _0x26b79e[_0x2501('0x20')]('Content-Range',_0x557386+'-'+_0x49f5bb+'/'+_0xf89697)[_0x2501('0x1b')](_0x7e3607);}return null;};}function patchUpdates(_0x1432f4){return function(_0x466cfb){try{jsonpatch[_0x2501('0x21')](_0x466cfb,_0x1432f4,!![]);}catch(_0x19f6eb){return BPromise['reject'](_0x19f6eb);}return _0x466cfb[_0x2501('0x22')]();};}function saveUpdates(_0x361e91,_0x53614a){return function(_0x3c36b5){if(_0x3c36b5){return _0x3c36b5['update'](_0x361e91)['then'](function(_0x4753ad){return _0x4753ad;});}return null;};}function removeEntity(_0x1c36a5,_0x2a69ef){return function(_0x6965cb){if(_0x6965cb){return _0x6965cb[_0x2501('0x23')]()[_0x2501('0x24')](function(){_0x1c36a5[_0x2501('0x19')](0xcc)[_0x2501('0x1a')]();});}};}function handleEntityNotFound(_0x3b0f8d,_0x386bf9){return function(_0x255d09){if(!_0x255d09){_0x3b0f8d[_0x2501('0x18')](0x194);}return _0x255d09;};}function handleError(_0x321c96,_0x2dc7b7){_0x2dc7b7=_0x2dc7b7||0x1f4;return function(_0x1684ab){logger[_0x2501('0x25')](_0x1684ab['stack']);if(_0x1684ab[_0x2501('0x26')]){delete _0x1684ab[_0x2501('0x26')];}_0x321c96['status'](_0x2dc7b7)[_0x2501('0x27')](_0x1684ab);};}exports[_0x2501('0x28')]=function(_0x2148fe,_0x2ead50){var _0x7650dc={},_0x260c6a={},_0x27af8a={'count':0x0,'rows':[]};var _0x3c3a86=_['map'](db[_0x2501('0x29')][_0x2501('0x2a')],function(_0x2020e){return{'name':_0x2020e[_0x2501('0x2b')],'type':_0x2020e[_0x2501('0x2c')][_0x2501('0x2d')]};});_0x260c6a['model']=_['map'](_0x3c3a86,'name');_0x260c6a[_0x2501('0x2e')]=_['keys'](_0x2148fe[_0x2501('0x2e')]);_0x260c6a[_0x2501('0x2f')]=_[_0x2501('0x30')](_0x260c6a[_0x2501('0x31')],_0x260c6a['query']);_0x7650dc[_0x2501('0x32')]=_[_0x2501('0x30')](_0x260c6a[_0x2501('0x31')],qs[_0x2501('0x33')](_0x2148fe['query']['fields']));_0x7650dc['attributes']=_0x7650dc[_0x2501('0x32')][_0x2501('0x34')]?_0x7650dc[_0x2501('0x32')]:_0x260c6a[_0x2501('0x31')];if(!_0x2148fe[_0x2501('0x2e')][_0x2501('0x35')]('nolimit')){_0x7650dc[_0x2501('0x1f')]=qs[_0x2501('0x1f')](_0x2148fe[_0x2501('0x2e')]['limit']);_0x7650dc[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x2148fe[_0x2501('0x2e')][_0x2501('0x1e')]);}_0x7650dc[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x2148fe[_0x2501('0x2e')][_0x2501('0x37')]);_0x7650dc[_0x2501('0x38')]=qs[_0x2501('0x2f')](_[_0x2501('0x39')](_0x2148fe['query'],_0x260c6a[_0x2501('0x2f')]),_0x3c3a86);if(_0x2148fe[_0x2501('0x2e')]['filter']){_0x7650dc[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x7650dc[_0x2501('0x38')],{'$or':_[_0x2501('0x3b')](_0x3c3a86,function(_0x1b20d2){if(_0x1b20d2[_0x2501('0x2c')]!==_0x2501('0x3c')){var _0x3d95ba={};_0x3d95ba[_0x1b20d2[_0x2501('0x26')]]={'$like':'%'+_0x2148fe['query'][_0x2501('0x3d')]+'%'};return _0x3d95ba;}})});}_0x7650dc=_[_0x2501('0x3a')]({},_0x7650dc,_0x2148fe['options']);var _0x5996d2={'where':_0x7650dc[_0x2501('0x38')]};return db['ZendeskConfiguration'][_0x2501('0x1d')](_0x5996d2)['then'](function(_0x45f3cb){_0x27af8a[_0x2501('0x1d')]=_0x45f3cb;if(_0x2148fe[_0x2501('0x2e')][_0x2501('0x3e')]){_0x7650dc[_0x2501('0x3f')]=[{'all':!![]}];}return db[_0x2501('0x29')]['findAll'](_0x7650dc);})['then'](function(_0x390ce1){_0x27af8a[_0x2501('0x40')]=_0x390ce1;return _0x27af8a;})['then'](respondWithFilteredResult(_0x2ead50,_0x7650dc))[_0x2501('0x41')](handleError(_0x2ead50,null));};exports[_0x2501('0x42')]=function(_0x348da6,_0x4d0e47){var _0x1b5228={'raw':![],'where':{'id':_0x348da6[_0x2501('0x43')]['id']}},_0x10e2b={};_0x10e2b[_0x2501('0x31')]=_[_0x2501('0x44')](db[_0x2501('0x29')][_0x2501('0x2a')]);_0x10e2b[_0x2501('0x2e')]=_[_0x2501('0x44')](_0x348da6[_0x2501('0x2e')]);_0x10e2b['filters']=_[_0x2501('0x30')](_0x10e2b[_0x2501('0x31')],_0x10e2b[_0x2501('0x2e')]);_0x1b5228[_0x2501('0x32')]=_[_0x2501('0x30')](_0x10e2b['model'],qs['fields'](_0x348da6['query'][_0x2501('0x33')]));_0x1b5228[_0x2501('0x32')]=_0x1b5228[_0x2501('0x32')][_0x2501('0x34')]?_0x1b5228['attributes']:_0x10e2b[_0x2501('0x31')];if(_0x348da6[_0x2501('0x2e')]['includeAll']){_0x1b5228['include']=[{'all':!![]}];}_0x1b5228=_[_0x2501('0x3a')]({},_0x1b5228,_0x348da6[_0x2501('0x45')]);return db[_0x2501('0x29')][_0x2501('0x46')](_0x1b5228)[_0x2501('0x24')](handleEntityNotFound(_0x4d0e47,null))[_0x2501('0x24')](respondWithResult(_0x4d0e47,null))[_0x2501('0x41')](handleError(_0x4d0e47,null));};exports[_0x2501('0x47')]=function(_0x5db18b,_0x4c7753){return db['ZendeskConfiguration'][_0x2501('0x47')](_0x5db18b[_0x2501('0x48')],{})[_0x2501('0x24')](respondWithResult(_0x4c7753,0xc9))['catch'](handleError(_0x4c7753,null));};exports[_0x2501('0x49')]=function(_0x519ae0,_0x5c0d99){if(_0x519ae0[_0x2501('0x48')]['id']){delete _0x519ae0[_0x2501('0x48')]['id'];}return db['ZendeskConfiguration'][_0x2501('0x46')]({'where':{'id':_0x519ae0['params']['id']}})['then'](handleEntityNotFound(_0x5c0d99,null))['then'](saveUpdates(_0x519ae0[_0x2501('0x48')],null))[_0x2501('0x24')](respondWithResult(_0x5c0d99,null))[_0x2501('0x41')](handleError(_0x5c0d99,null));};exports[_0x2501('0x23')]=function(_0x159cc9,_0x2f7ea5){return db[_0x2501('0x29')][_0x2501('0x46')]({'where':{'id':_0x159cc9['params']['id']}})['then'](handleEntityNotFound(_0x2f7ea5,null))[_0x2501('0x24')](removeEntity(_0x2f7ea5,null))[_0x2501('0x41')](handleError(_0x2f7ea5,null));};exports[_0x2501('0x4a')]=function(_0x1a2864,_0x14ef61,_0x1f184c){var _0x22ba45={};var _0x663dc6={};var _0x1b8ac1;var _0x3a2229;return db[_0x2501('0x29')]['findOne']({'where':{'id':_0x1a2864[_0x2501('0x43')]['id']}})[_0x2501('0x24')](handleEntityNotFound(_0x14ef61,null))[_0x2501('0x24')](function(_0x45ea55){if(_0x45ea55){_0x1b8ac1=_0x45ea55;_0x663dc6[_0x2501('0x31')]=_[_0x2501('0x44')](db[_0x2501('0x4b')][_0x2501('0x2a')]);_0x663dc6['query']=_[_0x2501('0x44')](_0x1a2864['query']);_0x663dc6[_0x2501('0x2f')]=_[_0x2501('0x30')](_0x663dc6[_0x2501('0x31')],_0x663dc6['query']);_0x22ba45[_0x2501('0x32')]=_[_0x2501('0x30')](_0x663dc6['model'],qs['fields'](_0x1a2864[_0x2501('0x2e')]['fields']));_0x22ba45['attributes']=_0x22ba45[_0x2501('0x32')][_0x2501('0x34')]?_0x22ba45[_0x2501('0x32')]:_0x663dc6[_0x2501('0x31')];_0x22ba45[_0x2501('0x36')]=qs['sort'](_0x1a2864['query'][_0x2501('0x37')]);_0x22ba45[_0x2501('0x38')]=qs['filters'](_[_0x2501('0x39')](_0x1a2864[_0x2501('0x2e')],_0x663dc6[_0x2501('0x2f')]));if(_0x1a2864[_0x2501('0x2e')]['filter']){_0x22ba45[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x22ba45[_0x2501('0x38')],{'$or':_[_0x2501('0x3b')](_0x22ba45['attributes'],function(_0x5f3d0f){var _0x3859c4={};_0x3859c4[_0x5f3d0f]={'$like':'%'+_0x1a2864['query'][_0x2501('0x3d')]+'%'};return _0x3859c4;})});}_0x22ba45=_['merge']({},_0x22ba45,_0x1a2864[_0x2501('0x45')]);return _0x1b8ac1['getFields'](_0x22ba45);}})[_0x2501('0x24')](function(_0x323586){if(_0x323586){_0x3a2229=_0x323586['length'];if(!_0x1a2864[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x22ba45['limit']=qs[_0x2501('0x1f')](_0x1a2864['query']['limit']);_0x22ba45[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x1a2864[_0x2501('0x2e')]['offset']);}return _0x1b8ac1['getFields'](_0x22ba45);}})[_0x2501('0x24')](function(_0x27b5e3){if(_0x27b5e3){return _0x27b5e3?{'count':_0x3a2229,'rows':_0x27b5e3}:null;}})[_0x2501('0x24')](respondWithResult(_0x14ef61,null))[_0x2501('0x41')](handleError(_0x14ef61,null));};exports[_0x2501('0x4d')]=function(_0x4244cc,_0x6d9319,_0x568381){var _0x5917fc={};var _0x1165eb={};var _0x4ebc76;var _0x251c28;return db[_0x2501('0x29')][_0x2501('0x4e')]({'where':{'id':_0x4244cc['params']['id']}})['then'](handleEntityNotFound(_0x6d9319,null))[_0x2501('0x24')](function(_0x158137){if(_0x158137){_0x4ebc76=_0x158137;_0x1165eb[_0x2501('0x31')]=_[_0x2501('0x44')](db['ZendeskField'][_0x2501('0x2a')]);_0x1165eb[_0x2501('0x2e')]=_[_0x2501('0x44')](_0x4244cc[_0x2501('0x2e')]);_0x1165eb['filters']=_[_0x2501('0x30')](_0x1165eb[_0x2501('0x31')],_0x1165eb[_0x2501('0x2e')]);_0x5917fc['attributes']=_[_0x2501('0x30')](_0x1165eb[_0x2501('0x31')],qs[_0x2501('0x33')](_0x4244cc[_0x2501('0x2e')][_0x2501('0x33')]));_0x5917fc[_0x2501('0x32')]=_0x5917fc[_0x2501('0x32')]['length']?_0x5917fc['attributes']:_0x1165eb[_0x2501('0x31')];_0x5917fc[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x4244cc['query'][_0x2501('0x37')]);_0x5917fc['where']=qs['filters'](_[_0x2501('0x39')](_0x4244cc[_0x2501('0x2e')],_0x1165eb[_0x2501('0x2f')]));if(_0x4244cc[_0x2501('0x2e')][_0x2501('0x3d')]){_0x5917fc[_0x2501('0x38')]=_['merge'](_0x5917fc[_0x2501('0x38')],{'$or':_[_0x2501('0x3b')](_0x5917fc['attributes'],function(_0x364341){var _0x2b383b={};_0x2b383b[_0x364341]={'$like':'%'+_0x4244cc[_0x2501('0x2e')]['filter']+'%'};return _0x2b383b;})});}_0x5917fc=_[_0x2501('0x3a')]({},_0x5917fc,_0x4244cc[_0x2501('0x45')]);return _0x4ebc76['getSubjects'](_0x5917fc);}})[_0x2501('0x24')](function(_0x3a9d68){if(_0x3a9d68){_0x251c28=_0x3a9d68['length'];if(!_0x4244cc[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x5917fc[_0x2501('0x1f')]=qs['limit'](_0x4244cc[_0x2501('0x2e')][_0x2501('0x1f')]);_0x5917fc[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x4244cc[_0x2501('0x2e')][_0x2501('0x1e')]);}return _0x4ebc76[_0x2501('0x4d')](_0x5917fc);}})['then'](function(_0xdb6f27){if(_0xdb6f27){return _0xdb6f27?{'count':_0x251c28,'rows':_0xdb6f27}:null;}})[_0x2501('0x24')](respondWithResult(_0x6d9319,null))['catch'](handleError(_0x6d9319,null));};exports[_0x2501('0x4f')]=function(_0x378ecf,_0x5b204b,_0x3cf46c){var _0x19ab01={};var _0x11b748={};var _0x426b0c;var _0x20d41f;return db[_0x2501('0x29')][_0x2501('0x4e')]({'where':{'id':_0x378ecf[_0x2501('0x43')]['id']}})[_0x2501('0x24')](handleEntityNotFound(_0x5b204b,null))[_0x2501('0x24')](function(_0xcf8e4f){if(_0xcf8e4f){_0x426b0c=_0xcf8e4f;_0x11b748['model']=_[_0x2501('0x44')](db['ZendeskField'][_0x2501('0x2a')]);_0x11b748[_0x2501('0x2e')]=_[_0x2501('0x44')](_0x378ecf[_0x2501('0x2e')]);_0x11b748[_0x2501('0x2f')]=_['intersection'](_0x11b748[_0x2501('0x31')],_0x11b748[_0x2501('0x2e')]);_0x19ab01[_0x2501('0x32')]=_['intersection'](_0x11b748[_0x2501('0x31')],qs[_0x2501('0x33')](_0x378ecf[_0x2501('0x2e')]['fields']));_0x19ab01[_0x2501('0x32')]=_0x19ab01[_0x2501('0x32')]['length']?_0x19ab01['attributes']:_0x11b748['model'];_0x19ab01[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x378ecf[_0x2501('0x2e')][_0x2501('0x37')]);_0x19ab01['where']=qs[_0x2501('0x2f')](_['pick'](_0x378ecf['query'],_0x11b748[_0x2501('0x2f')]));if(_0x378ecf[_0x2501('0x2e')]['filter']){_0x19ab01[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x19ab01['where'],{'$or':_[_0x2501('0x3b')](_0x19ab01[_0x2501('0x32')],function(_0x58eb55){var _0x50b08e={};_0x50b08e[_0x58eb55]={'$like':'%'+_0x378ecf[_0x2501('0x2e')][_0x2501('0x3d')]+'%'};return _0x50b08e;})});}_0x19ab01=_[_0x2501('0x3a')]({},_0x19ab01,_0x378ecf[_0x2501('0x45')]);return _0x426b0c[_0x2501('0x4f')](_0x19ab01);}})['then'](function(_0x8ff457){if(_0x8ff457){_0x20d41f=_0x8ff457[_0x2501('0x34')];if(!_0x378ecf[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x19ab01[_0x2501('0x1f')]=qs[_0x2501('0x1f')](_0x378ecf[_0x2501('0x2e')][_0x2501('0x1f')]);_0x19ab01[_0x2501('0x1e')]=qs[_0x2501('0x1e')](_0x378ecf[_0x2501('0x2e')]['offset']);}return _0x426b0c[_0x2501('0x4f')](_0x19ab01);}})[_0x2501('0x24')](function(_0xfefabf){if(_0xfefabf){return _0xfefabf?{'count':_0x20d41f,'rows':_0xfefabf}:null;}})['then'](respondWithResult(_0x5b204b,null))[_0x2501('0x41')](handleError(_0x5b204b,null));};exports[_0x2501('0x50')]=function(_0x1dc46d,_0x5c6df7,_0x27fb6e){var _0x4db39a={};var _0x330307={};var _0x1eed76;var _0x483d94;return db[_0x2501('0x29')][_0x2501('0x4e')]({'where':{'id':_0x1dc46d[_0x2501('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c6df7,null))[_0x2501('0x24')](function(_0x455555){if(_0x455555){_0x1eed76=_0x455555;_0x330307[_0x2501('0x31')]=_[_0x2501('0x44')](db[_0x2501('0x51')][_0x2501('0x2a')]);_0x330307[_0x2501('0x2e')]=_['keys'](_0x1dc46d[_0x2501('0x2e')]);_0x330307[_0x2501('0x2f')]=_[_0x2501('0x30')](_0x330307[_0x2501('0x31')],_0x330307[_0x2501('0x2e')]);_0x4db39a[_0x2501('0x32')]=_[_0x2501('0x30')](_0x330307[_0x2501('0x31')],qs[_0x2501('0x33')](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x33')]));_0x4db39a[_0x2501('0x32')]=_0x4db39a[_0x2501('0x32')][_0x2501('0x34')]?_0x4db39a['attributes']:_0x330307[_0x2501('0x31')];_0x4db39a[_0x2501('0x36')]=qs[_0x2501('0x37')](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x37')]);_0x4db39a[_0x2501('0x38')]=qs[_0x2501('0x2f')](_['pick'](_0x1dc46d['query'],_0x330307[_0x2501('0x2f')]));if(_0x1dc46d['query'][_0x2501('0x3d')]){_0x4db39a[_0x2501('0x38')]=_[_0x2501('0x3a')](_0x4db39a['where'],{'$or':_[_0x2501('0x3b')](_0x4db39a['attributes'],function(_0x158c80){var _0x24b0f9={};_0x24b0f9[_0x158c80]={'$like':'%'+_0x1dc46d['query'][_0x2501('0x3d')]+'%'};return _0x24b0f9;})});}_0x4db39a=_['merge']({},_0x4db39a,_0x1dc46d[_0x2501('0x45')]);return _0x1eed76[_0x2501('0x50')](_0x4db39a);}})[_0x2501('0x24')](function(_0x107597){if(_0x107597){_0x483d94=_0x107597[_0x2501('0x34')];if(!_0x1dc46d[_0x2501('0x2e')][_0x2501('0x35')](_0x2501('0x4c'))){_0x4db39a[_0x2501('0x1f')]=qs[_0x2501('0x1f')](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x1f')]);_0x4db39a[_0x2501('0x1e')]=qs['offset'](_0x1dc46d[_0x2501('0x2e')][_0x2501('0x1e')]);}return _0x1eed76[_0x2501('0x50')](_0x4db39a);}})['then'](function(_0x58642c){if(_0x58642c){return _0x58642c?{'count':_0x483d94,'rows':_0x58642c}:null;}})[_0x2501('0x24')](respondWithResult(_0x5c6df7,null))[_0x2501('0x41')](handleError(_0x5c6df7,null));};exports[_0x2501('0x52')]=function(_0x4fed25,_0x1c368d,_0x1efb2b){if(_0x4fed25[_0x2501('0x48')]['id']){delete _0x4fed25[_0x2501('0x48')]['id'];}return db['ZendeskConfiguration'][_0x2501('0x4e')]({'where':{'id':_0x4fed25[_0x2501('0x43')]['id']}})[_0x2501('0x24')](handleEntityNotFound(_0x1c368d,null))['then'](function(_0x356acb){if(_0x356acb){return _0x356acb[_0x2501('0x52')](_0x4fed25['body'][_0x2501('0x53')]||[]);}return null;})[_0x2501('0x24')](respondWithResult(_0x1c368d,null))[_0x2501('0x41')](handleError(_0x1c368d,null));}; \ No newline at end of file +var _0xf688=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','reject','save','update','then','destroy','end','sendStatus','stack','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','sort','where','filters','pick','filter','VIRTUAL','name','merge','options','includeAll','include','findAll','rows','catch','params','keys','fields','create','body','find','getFields','findOne','order','hasOwnProperty','nolimit','getSubjects','ZendeskField','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','papaparse'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf688,0x1dd));var _0x8f68=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf688[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8f68('0x0'));var rimraf=require(_0x8f68('0x1'));var zipdir=require(_0x8f68('0x2'));var jsonpatch=require(_0x8f68('0x3'));var rp=require(_0x8f68('0x4'));var moment=require(_0x8f68('0x5'));var BPromise=require(_0x8f68('0x6'));var Mustache=require(_0x8f68('0x7'));var util=require(_0x8f68('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8f68('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f68('0xa'));var squel=require(_0x8f68('0xb'));var crypto=require(_0x8f68('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8f68('0xd'));var toCsv=require(_0x8f68('0x9'));var querystring=require('querystring');var Papa=require(_0x8f68('0xe'));var Redis=require('ioredis');var authService=require(_0x8f68('0xf'));var qs=require(_0x8f68('0x10'));var as=require(_0x8f68('0x11'));var hardwareService=require(_0x8f68('0x12'));var logger=require(_0x8f68('0x13'))(_0x8f68('0x14'));var utils=require('../../config/utils');var config=require(_0x8f68('0x15'));var licenseUtil=require(_0x8f68('0x16'));var db=require(_0x8f68('0x17'))['db'];function respondWithStatusCode(_0x189d9a,_0x51e335){_0x51e335=_0x51e335||0xcc;return function(_0x2eb956){if(_0x2eb956){return _0x189d9a['sendStatus'](_0x51e335);}return _0x189d9a[_0x8f68('0x18')](_0x51e335)['end']();};}function respondWithResult(_0x4cc4d8,_0x20fe18){_0x20fe18=_0x20fe18||0xc8;return function(_0x29008e){if(_0x29008e){return _0x4cc4d8[_0x8f68('0x18')](_0x20fe18)['json'](_0x29008e);}};}function respondWithFilteredResult(_0xa5f0b8,_0x251e31){return function(_0xf706ea){if(_0xf706ea){var _0x3877f1=typeof _0x251e31[_0x8f68('0x19')]===_0x8f68('0x1a')&&typeof _0x251e31[_0x8f68('0x1b')]==='undefined';var _0x2f32b0=_0xf706ea['count'];var _0x409624=_0x3877f1?0x0:_0x251e31['offset'];var _0x3554b2=_0x3877f1?_0xf706ea[_0x8f68('0x1c')]:_0x251e31[_0x8f68('0x19')]+_0x251e31[_0x8f68('0x1b')];var _0x36f130;if(_0x3554b2>=_0x2f32b0){_0x3554b2=_0x2f32b0;_0x36f130=0xc8;}else{_0x36f130=0xce;}_0xa5f0b8[_0x8f68('0x18')](_0x36f130);return _0xa5f0b8['set']('Content-Range',_0x409624+'-'+_0x3554b2+'/'+_0x2f32b0)[_0x8f68('0x1d')](_0xf706ea);}return null;};}function patchUpdates(_0x5bbbaf){return function(_0x47c1e3){try{jsonpatch['apply'](_0x47c1e3,_0x5bbbaf,!![]);}catch(_0x3d0aff){return BPromise[_0x8f68('0x1e')](_0x3d0aff);}return _0x47c1e3[_0x8f68('0x1f')]();};}function saveUpdates(_0x2769bc,_0x4ea14f){return function(_0x568a31){if(_0x568a31){return _0x568a31[_0x8f68('0x20')](_0x2769bc)[_0x8f68('0x21')](function(_0x4578fe){return _0x4578fe;});}return null;};}function removeEntity(_0x2116a7,_0x31c8c9){return function(_0x1dc727){if(_0x1dc727){return _0x1dc727[_0x8f68('0x22')]()[_0x8f68('0x21')](function(){_0x2116a7[_0x8f68('0x18')](0xcc)[_0x8f68('0x23')]();});}};}function handleEntityNotFound(_0x2787da,_0x1ed170){return function(_0xd6bb0b){if(!_0xd6bb0b){_0x2787da[_0x8f68('0x24')](0x194);}return _0xd6bb0b;};}function handleError(_0x483ac2,_0x24a95a){_0x24a95a=_0x24a95a||0x1f4;return function(_0x3450f2){logger['error'](_0x3450f2[_0x8f68('0x25')]);if(_0x3450f2['name']){delete _0x3450f2['name'];}_0x483ac2['status'](_0x24a95a)[_0x8f68('0x26')](_0x3450f2);};}exports[_0x8f68('0x27')]=function(_0x34ade8,_0x22ab02){var _0x21fcc9={},_0x472029={},_0x484531={'count':0x0,'rows':[]};var _0x2dc034=_[_0x8f68('0x28')](db[_0x8f68('0x29')][_0x8f68('0x2a')],function(_0x3720f0){return{'name':_0x3720f0[_0x8f68('0x2b')],'type':_0x3720f0[_0x8f68('0x2c')][_0x8f68('0x2d')]};});_0x472029[_0x8f68('0x2e')]=_['map'](_0x2dc034,'name');_0x472029[_0x8f68('0x2f')]=_['keys'](_0x34ade8[_0x8f68('0x2f')]);_0x472029['filters']=_[_0x8f68('0x30')](_0x472029['model'],_0x472029[_0x8f68('0x2f')]);_0x21fcc9[_0x8f68('0x31')]=_[_0x8f68('0x30')](_0x472029[_0x8f68('0x2e')],qs['fields'](_0x34ade8['query']['fields']));_0x21fcc9['attributes']=_0x21fcc9[_0x8f68('0x31')][_0x8f68('0x32')]?_0x21fcc9[_0x8f68('0x31')]:_0x472029[_0x8f68('0x2e')];if(!_0x34ade8[_0x8f68('0x2f')]['hasOwnProperty']('nolimit')){_0x21fcc9[_0x8f68('0x1b')]=qs[_0x8f68('0x1b')](_0x34ade8[_0x8f68('0x2f')][_0x8f68('0x1b')]);_0x21fcc9[_0x8f68('0x19')]=qs['offset'](_0x34ade8[_0x8f68('0x2f')][_0x8f68('0x19')]);}_0x21fcc9['order']=qs[_0x8f68('0x33')](_0x34ade8[_0x8f68('0x2f')][_0x8f68('0x33')]);_0x21fcc9[_0x8f68('0x34')]=qs[_0x8f68('0x35')](_[_0x8f68('0x36')](_0x34ade8['query'],_0x472029[_0x8f68('0x35')]),_0x2dc034);if(_0x34ade8[_0x8f68('0x2f')][_0x8f68('0x37')]){_0x21fcc9[_0x8f68('0x34')]=_['merge'](_0x21fcc9[_0x8f68('0x34')],{'$or':_[_0x8f68('0x28')](_0x2dc034,function(_0x3287b6){if(_0x3287b6['type']!==_0x8f68('0x38')){var _0x59c7ba={};_0x59c7ba[_0x3287b6[_0x8f68('0x39')]]={'$like':'%'+_0x34ade8[_0x8f68('0x2f')][_0x8f68('0x37')]+'%'};return _0x59c7ba;}})});}_0x21fcc9=_[_0x8f68('0x3a')]({},_0x21fcc9,_0x34ade8[_0x8f68('0x3b')]);var _0x6c520c={'where':_0x21fcc9[_0x8f68('0x34')]};return db[_0x8f68('0x29')]['count'](_0x6c520c)[_0x8f68('0x21')](function(_0x56b737){_0x484531[_0x8f68('0x1c')]=_0x56b737;if(_0x34ade8[_0x8f68('0x2f')][_0x8f68('0x3c')]){_0x21fcc9[_0x8f68('0x3d')]=[{'all':!![]}];}return db[_0x8f68('0x29')][_0x8f68('0x3e')](_0x21fcc9);})[_0x8f68('0x21')](function(_0x4c5da2){_0x484531[_0x8f68('0x3f')]=_0x4c5da2;return _0x484531;})[_0x8f68('0x21')](respondWithFilteredResult(_0x22ab02,_0x21fcc9))[_0x8f68('0x40')](handleError(_0x22ab02,null));};exports['show']=function(_0x44a125,_0x5df365){var _0x2ed68a={'raw':![],'where':{'id':_0x44a125[_0x8f68('0x41')]['id']}},_0x45d541={};_0x45d541['model']=_[_0x8f68('0x42')](db[_0x8f68('0x29')]['rawAttributes']);_0x45d541[_0x8f68('0x2f')]=_['keys'](_0x44a125[_0x8f68('0x2f')]);_0x45d541[_0x8f68('0x35')]=_[_0x8f68('0x30')](_0x45d541[_0x8f68('0x2e')],_0x45d541[_0x8f68('0x2f')]);_0x2ed68a['attributes']=_[_0x8f68('0x30')](_0x45d541[_0x8f68('0x2e')],qs['fields'](_0x44a125[_0x8f68('0x2f')][_0x8f68('0x43')]));_0x2ed68a[_0x8f68('0x31')]=_0x2ed68a[_0x8f68('0x31')][_0x8f68('0x32')]?_0x2ed68a[_0x8f68('0x31')]:_0x45d541[_0x8f68('0x2e')];if(_0x44a125[_0x8f68('0x2f')][_0x8f68('0x3c')]){_0x2ed68a[_0x8f68('0x3d')]=[{'all':!![]}];}_0x2ed68a=_[_0x8f68('0x3a')]({},_0x2ed68a,_0x44a125[_0x8f68('0x3b')]);return db['ZendeskConfiguration']['find'](_0x2ed68a)[_0x8f68('0x21')](handleEntityNotFound(_0x5df365,null))[_0x8f68('0x21')](respondWithResult(_0x5df365,null))['catch'](handleError(_0x5df365,null));};exports[_0x8f68('0x44')]=function(_0x2b47aa,_0x3e219a){return db[_0x8f68('0x29')][_0x8f68('0x44')](_0x2b47aa['body'],{})[_0x8f68('0x21')](respondWithResult(_0x3e219a,0xc9))[_0x8f68('0x40')](handleError(_0x3e219a,null));};exports[_0x8f68('0x20')]=function(_0x416e1b,_0x45120a){if(_0x416e1b[_0x8f68('0x45')]['id']){delete _0x416e1b['body']['id'];}return db[_0x8f68('0x29')]['find']({'where':{'id':_0x416e1b['params']['id']}})[_0x8f68('0x21')](handleEntityNotFound(_0x45120a,null))['then'](saveUpdates(_0x416e1b[_0x8f68('0x45')],null))[_0x8f68('0x21')](respondWithResult(_0x45120a,null))[_0x8f68('0x40')](handleError(_0x45120a,null));};exports[_0x8f68('0x22')]=function(_0x4347ad,_0x537287){return db['ZendeskConfiguration'][_0x8f68('0x46')]({'where':{'id':_0x4347ad[_0x8f68('0x41')]['id']}})[_0x8f68('0x21')](handleEntityNotFound(_0x537287,null))[_0x8f68('0x21')](removeEntity(_0x537287,null))[_0x8f68('0x40')](handleError(_0x537287,null));};exports[_0x8f68('0x47')]=function(_0x299e3e,_0x29396d,_0x2cb024){var _0xf1d30c={};var _0x385cfe={};var _0x499c62;var _0x3e713a;return db[_0x8f68('0x29')][_0x8f68('0x48')]({'where':{'id':_0x299e3e[_0x8f68('0x41')]['id']}})[_0x8f68('0x21')](handleEntityNotFound(_0x29396d,null))[_0x8f68('0x21')](function(_0x1993af){if(_0x1993af){_0x499c62=_0x1993af;_0x385cfe[_0x8f68('0x2e')]=_[_0x8f68('0x42')](db['ZendeskField'][_0x8f68('0x2a')]);_0x385cfe[_0x8f68('0x2f')]=_[_0x8f68('0x42')](_0x299e3e[_0x8f68('0x2f')]);_0x385cfe[_0x8f68('0x35')]=_['intersection'](_0x385cfe['model'],_0x385cfe[_0x8f68('0x2f')]);_0xf1d30c['attributes']=_['intersection'](_0x385cfe[_0x8f68('0x2e')],qs['fields'](_0x299e3e[_0x8f68('0x2f')][_0x8f68('0x43')]));_0xf1d30c[_0x8f68('0x31')]=_0xf1d30c[_0x8f68('0x31')][_0x8f68('0x32')]?_0xf1d30c['attributes']:_0x385cfe[_0x8f68('0x2e')];_0xf1d30c[_0x8f68('0x49')]=qs['sort'](_0x299e3e['query'][_0x8f68('0x33')]);_0xf1d30c[_0x8f68('0x34')]=qs[_0x8f68('0x35')](_[_0x8f68('0x36')](_0x299e3e[_0x8f68('0x2f')],_0x385cfe[_0x8f68('0x35')]));if(_0x299e3e[_0x8f68('0x2f')][_0x8f68('0x37')]){_0xf1d30c[_0x8f68('0x34')]=_[_0x8f68('0x3a')](_0xf1d30c[_0x8f68('0x34')],{'$or':_[_0x8f68('0x28')](_0xf1d30c[_0x8f68('0x31')],function(_0x21d9a4){var _0x389259={};_0x389259[_0x21d9a4]={'$like':'%'+_0x299e3e[_0x8f68('0x2f')][_0x8f68('0x37')]+'%'};return _0x389259;})});}_0xf1d30c=_[_0x8f68('0x3a')]({},_0xf1d30c,_0x299e3e[_0x8f68('0x3b')]);return _0x499c62[_0x8f68('0x47')](_0xf1d30c);}})[_0x8f68('0x21')](function(_0x3dce5a){if(_0x3dce5a){_0x3e713a=_0x3dce5a[_0x8f68('0x32')];if(!_0x299e3e[_0x8f68('0x2f')][_0x8f68('0x4a')](_0x8f68('0x4b'))){_0xf1d30c[_0x8f68('0x1b')]=qs[_0x8f68('0x1b')](_0x299e3e[_0x8f68('0x2f')]['limit']);_0xf1d30c[_0x8f68('0x19')]=qs[_0x8f68('0x19')](_0x299e3e['query'][_0x8f68('0x19')]);}return _0x499c62['getFields'](_0xf1d30c);}})[_0x8f68('0x21')](function(_0x17498d){if(_0x17498d){return _0x17498d?{'count':_0x3e713a,'rows':_0x17498d}:null;}})[_0x8f68('0x21')](respondWithResult(_0x29396d,null))[_0x8f68('0x40')](handleError(_0x29396d,null));};exports[_0x8f68('0x4c')]=function(_0x1406df,_0x1b7222,_0x1d8552){var _0x3cd9e6={};var _0xf4de8d={};var _0x5306f4;var _0x56be30;return db[_0x8f68('0x29')][_0x8f68('0x48')]({'where':{'id':_0x1406df[_0x8f68('0x41')]['id']}})['then'](handleEntityNotFound(_0x1b7222,null))['then'](function(_0x1cb22c){if(_0x1cb22c){_0x5306f4=_0x1cb22c;_0xf4de8d[_0x8f68('0x2e')]=_[_0x8f68('0x42')](db[_0x8f68('0x4d')][_0x8f68('0x2a')]);_0xf4de8d[_0x8f68('0x2f')]=_['keys'](_0x1406df[_0x8f68('0x2f')]);_0xf4de8d[_0x8f68('0x35')]=_[_0x8f68('0x30')](_0xf4de8d[_0x8f68('0x2e')],_0xf4de8d['query']);_0x3cd9e6[_0x8f68('0x31')]=_[_0x8f68('0x30')](_0xf4de8d[_0x8f68('0x2e')],qs[_0x8f68('0x43')](_0x1406df[_0x8f68('0x2f')][_0x8f68('0x43')]));_0x3cd9e6[_0x8f68('0x31')]=_0x3cd9e6[_0x8f68('0x31')]['length']?_0x3cd9e6['attributes']:_0xf4de8d['model'];_0x3cd9e6['order']=qs[_0x8f68('0x33')](_0x1406df[_0x8f68('0x2f')][_0x8f68('0x33')]);_0x3cd9e6['where']=qs[_0x8f68('0x35')](_[_0x8f68('0x36')](_0x1406df[_0x8f68('0x2f')],_0xf4de8d['filters']));if(_0x1406df[_0x8f68('0x2f')]['filter']){_0x3cd9e6[_0x8f68('0x34')]=_[_0x8f68('0x3a')](_0x3cd9e6[_0x8f68('0x34')],{'$or':_[_0x8f68('0x28')](_0x3cd9e6[_0x8f68('0x31')],function(_0x126857){var _0x49819b={};_0x49819b[_0x126857]={'$like':'%'+_0x1406df[_0x8f68('0x2f')]['filter']+'%'};return _0x49819b;})});}_0x3cd9e6=_[_0x8f68('0x3a')]({},_0x3cd9e6,_0x1406df['options']);return _0x5306f4[_0x8f68('0x4c')](_0x3cd9e6);}})['then'](function(_0x441ed1){if(_0x441ed1){_0x56be30=_0x441ed1[_0x8f68('0x32')];if(!_0x1406df[_0x8f68('0x2f')][_0x8f68('0x4a')](_0x8f68('0x4b'))){_0x3cd9e6[_0x8f68('0x1b')]=qs['limit'](_0x1406df[_0x8f68('0x2f')][_0x8f68('0x1b')]);_0x3cd9e6[_0x8f68('0x19')]=qs['offset'](_0x1406df['query']['offset']);}return _0x5306f4['getSubjects'](_0x3cd9e6);}})[_0x8f68('0x21')](function(_0x23e235){if(_0x23e235){return _0x23e235?{'count':_0x56be30,'rows':_0x23e235}:null;}})[_0x8f68('0x21')](respondWithResult(_0x1b7222,null))[_0x8f68('0x40')](handleError(_0x1b7222,null));};exports[_0x8f68('0x4e')]=function(_0x2f019d,_0x6cbb4f,_0x3fa2cc){var _0x2885d7={};var _0xcabe7c={};var _0x23dbe8;var _0x4c64f5;return db[_0x8f68('0x29')][_0x8f68('0x48')]({'where':{'id':_0x2f019d['params']['id']}})[_0x8f68('0x21')](handleEntityNotFound(_0x6cbb4f,null))[_0x8f68('0x21')](function(_0x228767){if(_0x228767){_0x23dbe8=_0x228767;_0xcabe7c[_0x8f68('0x2e')]=_[_0x8f68('0x42')](db[_0x8f68('0x4d')][_0x8f68('0x2a')]);_0xcabe7c['query']=_['keys'](_0x2f019d[_0x8f68('0x2f')]);_0xcabe7c['filters']=_[_0x8f68('0x30')](_0xcabe7c['model'],_0xcabe7c[_0x8f68('0x2f')]);_0x2885d7[_0x8f68('0x31')]=_[_0x8f68('0x30')](_0xcabe7c[_0x8f68('0x2e')],qs[_0x8f68('0x43')](_0x2f019d['query']['fields']));_0x2885d7[_0x8f68('0x31')]=_0x2885d7[_0x8f68('0x31')][_0x8f68('0x32')]?_0x2885d7[_0x8f68('0x31')]:_0xcabe7c[_0x8f68('0x2e')];_0x2885d7[_0x8f68('0x49')]=qs[_0x8f68('0x33')](_0x2f019d[_0x8f68('0x2f')]['sort']);_0x2885d7['where']=qs[_0x8f68('0x35')](_[_0x8f68('0x36')](_0x2f019d['query'],_0xcabe7c[_0x8f68('0x35')]));if(_0x2f019d[_0x8f68('0x2f')][_0x8f68('0x37')]){_0x2885d7[_0x8f68('0x34')]=_[_0x8f68('0x3a')](_0x2885d7[_0x8f68('0x34')],{'$or':_[_0x8f68('0x28')](_0x2885d7[_0x8f68('0x31')],function(_0x4fabd3){var _0xa76adc={};_0xa76adc[_0x4fabd3]={'$like':'%'+_0x2f019d['query'][_0x8f68('0x37')]+'%'};return _0xa76adc;})});}_0x2885d7=_['merge']({},_0x2885d7,_0x2f019d[_0x8f68('0x3b')]);return _0x23dbe8[_0x8f68('0x4e')](_0x2885d7);}})[_0x8f68('0x21')](function(_0x1a7f50){if(_0x1a7f50){_0x4c64f5=_0x1a7f50[_0x8f68('0x32')];if(!_0x2f019d[_0x8f68('0x2f')]['hasOwnProperty'](_0x8f68('0x4b'))){_0x2885d7['limit']=qs[_0x8f68('0x1b')](_0x2f019d['query'][_0x8f68('0x1b')]);_0x2885d7['offset']=qs['offset'](_0x2f019d[_0x8f68('0x2f')][_0x8f68('0x19')]);}return _0x23dbe8[_0x8f68('0x4e')](_0x2885d7);}})['then'](function(_0x53536d){if(_0x53536d){return _0x53536d?{'count':_0x4c64f5,'rows':_0x53536d}:null;}})[_0x8f68('0x21')](respondWithResult(_0x6cbb4f,null))[_0x8f68('0x40')](handleError(_0x6cbb4f,null));};exports[_0x8f68('0x4f')]=function(_0xb8bd09,_0x5aeff1,_0x3ca832){var _0x6c3c19={};var _0x1a212a={};var _0x3eba25;var _0x6eec09;return db[_0x8f68('0x29')]['findOne']({'where':{'id':_0xb8bd09[_0x8f68('0x41')]['id']}})[_0x8f68('0x21')](handleEntityNotFound(_0x5aeff1,null))['then'](function(_0x18aeae){if(_0x18aeae){_0x3eba25=_0x18aeae;_0x1a212a[_0x8f68('0x2e')]=_['keys'](db['Tag']['rawAttributes']);_0x1a212a[_0x8f68('0x2f')]=_[_0x8f68('0x42')](_0xb8bd09[_0x8f68('0x2f')]);_0x1a212a['filters']=_['intersection'](_0x1a212a[_0x8f68('0x2e')],_0x1a212a[_0x8f68('0x2f')]);_0x6c3c19[_0x8f68('0x31')]=_[_0x8f68('0x30')](_0x1a212a[_0x8f68('0x2e')],qs[_0x8f68('0x43')](_0xb8bd09[_0x8f68('0x2f')]['fields']));_0x6c3c19[_0x8f68('0x31')]=_0x6c3c19[_0x8f68('0x31')][_0x8f68('0x32')]?_0x6c3c19[_0x8f68('0x31')]:_0x1a212a['model'];_0x6c3c19[_0x8f68('0x49')]=qs[_0x8f68('0x33')](_0xb8bd09['query'][_0x8f68('0x33')]);_0x6c3c19[_0x8f68('0x34')]=qs['filters'](_['pick'](_0xb8bd09[_0x8f68('0x2f')],_0x1a212a[_0x8f68('0x35')]));if(_0xb8bd09[_0x8f68('0x2f')]['filter']){_0x6c3c19[_0x8f68('0x34')]=_[_0x8f68('0x3a')](_0x6c3c19[_0x8f68('0x34')],{'$or':_['map'](_0x6c3c19[_0x8f68('0x31')],function(_0x2c3b4f){var _0xcdbdc7={};_0xcdbdc7[_0x2c3b4f]={'$like':'%'+_0xb8bd09[_0x8f68('0x2f')][_0x8f68('0x37')]+'%'};return _0xcdbdc7;})});}_0x6c3c19=_[_0x8f68('0x3a')]({},_0x6c3c19,_0xb8bd09[_0x8f68('0x3b')]);return _0x3eba25[_0x8f68('0x4f')](_0x6c3c19);}})['then'](function(_0x59982f){if(_0x59982f){_0x6eec09=_0x59982f[_0x8f68('0x32')];if(!_0xb8bd09['query'][_0x8f68('0x4a')](_0x8f68('0x4b'))){_0x6c3c19[_0x8f68('0x1b')]=qs[_0x8f68('0x1b')](_0xb8bd09[_0x8f68('0x2f')][_0x8f68('0x1b')]);_0x6c3c19['offset']=qs[_0x8f68('0x19')](_0xb8bd09[_0x8f68('0x2f')][_0x8f68('0x19')]);}return _0x3eba25[_0x8f68('0x4f')](_0x6c3c19);}})[_0x8f68('0x21')](function(_0x469321){if(_0x469321){return _0x469321?{'count':_0x6eec09,'rows':_0x469321}:null;}})[_0x8f68('0x21')](respondWithResult(_0x5aeff1,null))[_0x8f68('0x40')](handleError(_0x5aeff1,null));};exports[_0x8f68('0x50')]=function(_0x5edf68,_0x5b4b37,_0x200765){if(_0x5edf68[_0x8f68('0x45')]['id']){delete _0x5edf68[_0x8f68('0x45')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x5edf68['params']['id']}})[_0x8f68('0x21')](handleEntityNotFound(_0x5b4b37,null))[_0x8f68('0x21')](function(_0x8d86f5){if(_0x8d86f5){return _0x8d86f5['setTags'](_0x5edf68[_0x8f68('0x45')][_0x8f68('0x51')]||[]);}return null;})[_0x8f68('0x21')](respondWithResult(_0x5b4b37,null))[_0x8f68('0x40')](handleError(_0x5b4b37,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 4241186..75af50a 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 _0xefda=['../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','api','moment','request-promise','path','rimraf'];(function(_0x223f3c,_0x46d049){var _0x1466f7=function(_0x1d8fb9){while(--_0x1d8fb9){_0x223f3c['push'](_0x223f3c['shift']());}};_0x1466f7(++_0x46d049);}(_0xefda,0x96));var _0xaefd=function(_0x3c67e4,_0xedd28b){_0x3c67e4=_0x3c67e4-0x0;var _0x1a348b=_0xefda[_0x3c67e4];return _0x1a348b;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaefd('0x1'));var moment=require(_0xaefd('0x2'));var BPromise=require('bluebird');var rp=require(_0xaefd('0x3'));var fs=require('fs');var path=require(_0xaefd('0x4'));var rimraf=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var attributes=require(_0xaefd('0x7'));module[_0xaefd('0x8')]=function(_0x497258,_0x3677ea){return _0x497258[_0xaefd('0x9')](_0xaefd('0xa'),attributes,{'tableName':_0xaefd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef0f=['moment','request-promise','path','rimraf','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','../../config/logger','api'];(function(_0x33670a,_0x55e188){var _0x36ad1d=function(_0x3cacbb){while(--_0x3cacbb){_0x33670a['push'](_0x33670a['shift']());}};_0x36ad1d(++_0x55e188);}(_0xef0f,0x168));var _0xfef0=function(_0x14331b,_0x180782){_0x14331b=_0x14331b-0x0;var _0x4aeb58=_0xef0f[_0x14331b];return _0x4aeb58;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var logger=require(_0xfef0('0x1'))(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xfef0('0x4'));var fs=require('fs');var path=require(_0xfef0('0x5'));var rimraf=require(_0xfef0('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef0('0x7'));module[_0xfef0('0x8')]=function(_0x2697df,_0x315a8c){return _0x2697df[_0xfef0('0x9')](_0xfef0('0xa'),attributes,{'tableName':'int_zendesk_configurations','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 90f66bc..0c11d46 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 _0x522f=['request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x4a4a4a,_0x1b4057){var _0x18485e=function(_0x45676f){while(--_0x45676f){_0x4a4a4a['push'](_0x4a4a4a['shift']());}};_0x18485e(++_0x1b4057);}(_0x522f,0x183));var _0xf522=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x522f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf522('0x0'));var util=require(_0xf522('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf522('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf522('0x3'))['db'];var utils=require(_0xf522('0x4'));var logger=require('../../config/logger')(_0xf522('0x5'));var config=require(_0xf522('0x6'));var jayson=require(_0xf522('0x7'));var client=jayson[_0xf522('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x479b90,_0x55c660,_0x70292e){return new BPromise(function(_0x241f98,_0x428e8e){return client['request'](_0x479b90,_0x70292e)[_0xf522('0x9')](function(_0x207d31){logger[_0xf522('0xa')](_0xf522('0xb'),_0x55c660,_0xf522('0xc'));logger['debug'](_0xf522('0xd'),_0x55c660,_0xf522('0xc'),JSON[_0xf522('0xe')](_0x207d31));if(_0x207d31[_0xf522('0xf')]){if(_0x207d31[_0xf522('0xf')][_0xf522('0x10')]===0x1f4){logger[_0xf522('0xf')](_0xf522('0xb'),_0x55c660,_0x207d31[_0xf522('0xf')][_0xf522('0x11')]);return _0x428e8e(_0x207d31[_0xf522('0xf')]['message']);}logger[_0xf522('0xf')](_0xf522('0xb'),_0x55c660,_0x207d31[_0xf522('0xf')]['message']);return _0x241f98(_0x207d31[_0xf522('0xf')][_0xf522('0x11')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x55c660,'request\x20sent');_0x241f98(_0x207d31['result']['message']);}})[_0xf522('0x12')](function(_0x1c357f){logger['error'](_0xf522('0xb'),_0x55c660,_0x1c357f);_0x428e8e(_0x1c357f);});});} \ No newline at end of file +var _0xf022=['then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request'];(function(_0x5cd305,_0x1ea740){var _0x5b677e=function(_0xfc6c83){while(--_0xfc6c83){_0x5cd305['push'](_0x5cd305['shift']());}};_0x5b677e(++_0x1ea740);}(_0xf022,0x106));var _0x2f02=function(_0x475eac,_0x2fa495){_0x475eac=_0x475eac-0x0;var _0x4ad158=_0xf022[_0x475eac];return _0x4ad158;};'use strict';var _=require(_0x2f02('0x0'));var util=require('util');var moment=require(_0x2f02('0x1'));var BPromise=require(_0x2f02('0x2'));var rs=require(_0x2f02('0x3'));var fs=require('fs');var Redis=require(_0x2f02('0x4'));var db=require(_0x2f02('0x5'))['db'];var utils=require(_0x2f02('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f02('0x7'));var jayson=require(_0x2f02('0x8'));var client=jayson['client'][_0x2f02('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x332427,_0x14cc98,_0x3e5c80){return new BPromise(function(_0x1ef288,_0x5e6d8e){return client[_0x2f02('0xa')](_0x332427,_0x3e5c80)[_0x2f02('0xb')](function(_0x5d9622){logger[_0x2f02('0xc')](_0x2f02('0xd'),_0x14cc98,'request\x20sent');logger[_0x2f02('0xe')](_0x2f02('0xf'),_0x14cc98,_0x2f02('0x10'),JSON[_0x2f02('0x11')](_0x5d9622));if(_0x5d9622['error']){if(_0x5d9622[_0x2f02('0x12')]['code']===0x1f4){logger['error'](_0x2f02('0xd'),_0x14cc98,_0x5d9622[_0x2f02('0x12')][_0x2f02('0x13')]);return _0x5e6d8e(_0x5d9622[_0x2f02('0x12')][_0x2f02('0x13')]);}logger[_0x2f02('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x14cc98,_0x5d9622[_0x2f02('0x12')][_0x2f02('0x13')]);return _0x1ef288(_0x5d9622[_0x2f02('0x12')][_0x2f02('0x13')]);}else{logger[_0x2f02('0xc')](_0x2f02('0xd'),_0x14cc98,_0x2f02('0x10'));_0x1ef288(_0x5d9622['result'][_0x2f02('0x13')]);}})[_0x2f02('0x14')](function(_0xf79ee6){logger[_0x2f02('0x12')](_0x2f02('0xd'),_0x14cc98,_0xf79ee6);_0x5e6d8e(_0xf79ee6);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index b931b60..1551240 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 _0x8135=['isAuthenticated','show','post','create','put','/:id','util','express','Router','../../config/environment','./intZendeskField.controller','get'];(function(_0x2a43b9,_0x2aa7ea){var _0x3b6c90=function(_0x5be37f){while(--_0x5be37f){_0x2a43b9['push'](_0x2a43b9['shift']());}};_0x3b6c90(++_0x2aa7ea);}(_0x8135,0x1f2));var _0x5813=function(_0x310420,_0x435cbb){_0x310420=_0x310420-0x0;var _0x5ee909=_0x8135[_0x310420];return _0x5ee909;};'use strict';var multer=require('multer');var util=require(_0x5813('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5813('0x1'));var router=express[_0x5813('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5813('0x3'));var controller=require(_0x5813('0x4'));router[_0x5813('0x5')]('/',auth[_0x5813('0x6')](),controller['index']);router[_0x5813('0x5')]('/:id',auth[_0x5813('0x6')](),controller[_0x5813('0x7')]);router[_0x5813('0x8')]('/',auth[_0x5813('0x6')](),controller[_0x5813('0x9')]);router[_0x5813('0xa')](_0x5813('0xb'),auth[_0x5813('0x6')](),controller['update']);router['delete']('/:id',auth[_0x5813('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x63ee=['../../components/auth/service','../../config/environment','./intZendeskField.controller','get','/:id','isAuthenticated','show','create','update','delete','destroy','exports','multer','Router','fs-extra'];(function(_0x2c1686,_0x132dd9){var _0x31db0c=function(_0x4afbd3){while(--_0x4afbd3){_0x2c1686['push'](_0x2c1686['shift']());}};_0x31db0c(++_0x132dd9);}(_0x63ee,0x156));var _0xe63e=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x63ee[_0x1911ed];return _0x11edaa;};'use strict';var multer=require(_0xe63e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe63e('0x1')]();var fs_extra=require(_0xe63e('0x2'));var auth=require(_0xe63e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe63e('0x4'));var controller=require(_0xe63e('0x5'));router[_0xe63e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe63e('0x6')](_0xe63e('0x7'),auth[_0xe63e('0x8')](),controller[_0xe63e('0x9')]);router['post']('/',auth[_0xe63e('0x8')](),controller[_0xe63e('0xa')]);router['put']('/:id',auth[_0xe63e('0x8')](),controller[_0xe63e('0xb')]);router[_0xe63e('0xc')]('/:id',auth[_0xe63e('0x8')](),controller[_0xe63e('0xd')]);module[_0xe63e('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 5536bda..5cab693 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 _0xf90b=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x16f18c,_0x27b669){var _0x31fb69=function(_0x2075bf){while(--_0x2075bf){_0x16f18c['push'](_0x16f18c['shift']());}};_0x31fb69(++_0x27b669);}(_0xf90b,0x192));var _0xbf90=function(_0x276b79,_0x5317db){_0x276b79=_0x276b79-0x0;var _0x4ad802=_0xf90b[_0x276b79];return _0x4ad802;};'use strict';var Sequelize=require('sequelize');module[_0xbf90('0x0')]={'type':{'type':Sequelize[_0xbf90('0x1')](_0xbf90('0x2'),_0xbf90('0x3'),_0xbf90('0x4'),_0xbf90('0x5'),_0xbf90('0x6')),'defaultValue':_0xbf90('0x2')},'content':{'type':Sequelize[_0xbf90('0x7')]},'key':{'type':Sequelize[_0xbf90('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0xbf90('0x3'),_0xbf90('0x4'))},'keyContent':{'type':Sequelize[_0xbf90('0x7')]},'idField':{'type':Sequelize[_0xbf90('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbf90('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf145=['variable','STRING','customVariable','BOOLEAN','exports','ENUM','string'];(function(_0x5a65ff,_0x4bfe7a){var _0x146039=function(_0x382015){while(--_0x382015){_0x5a65ff['push'](_0x5a65ff['shift']());}};_0x146039(++_0x4bfe7a);}(_0xf145,0x162));var _0x5f14=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0xf145[_0x26721d];return _0x1035c5;};'use strict';var Sequelize=require('sequelize');module[_0x5f14('0x0')]={'type':{'type':Sequelize[_0x5f14('0x1')](_0x5f14('0x2'),_0x5f14('0x3'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5f14('0x4')]},'key':{'type':Sequelize[_0x5f14('0x4')]},'keyType':{'type':Sequelize[_0x5f14('0x1')](_0x5f14('0x2'),_0x5f14('0x3'),_0x5f14('0x5'))},'keyContent':{'type':Sequelize[_0x5f14('0x4')]},'idField':{'type':Sequelize[_0x5f14('0x4')]},'nameField':{'type':Sequelize[_0x5f14('0x4')]},'customField':{'type':Sequelize[_0x5f14('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 3720cbb..653e4eb 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 _0x8e7b=['keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../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','Content-Range','save','update','destroy','then','end','error','name','send','index','map','ZendeskField','rawAttributes','type','key','query'];(function(_0x43a84a,_0x6c500e){var _0x2ed43a=function(_0x8f88c3){while(--_0x8f88c3){_0x43a84a['push'](_0x43a84a['shift']());}};_0x2ed43a(++_0x6c500e);}(_0x8e7b,0xb2));var _0xb8e7=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x8e7b[_0x2235bf];return _0x4c3a64;};'use strict';var emlformat=require(_0xb8e7('0x0'));var rimraf=require(_0xb8e7('0x1'));var zipdir=require(_0xb8e7('0x2'));var jsonpatch=require(_0xb8e7('0x3'));var rp=require(_0xb8e7('0x4'));var moment=require('moment');var BPromise=require(_0xb8e7('0x5'));var Mustache=require('mustache');var util=require(_0xb8e7('0x6'));var path=require(_0xb8e7('0x7'));var sox=require(_0xb8e7('0x8'));var csv=require('to-csv');var ejs=require(_0xb8e7('0x9'));var fs=require('fs');var fs_extra=require(_0xb8e7('0xa'));var _=require(_0xb8e7('0xb'));var squel=require(_0xb8e7('0xc'));var crypto=require('crypto');var jsforce=require(_0xb8e7('0xd'));var deskjs=require(_0xb8e7('0xe'));var toCsv=require(_0xb8e7('0xf'));var querystring=require(_0xb8e7('0x10'));var Papa=require(_0xb8e7('0x11'));var Redis=require('ioredis');var authService=require(_0xb8e7('0x12'));var qs=require(_0xb8e7('0x13'));var as=require(_0xb8e7('0x14'));var hardwareService=require(_0xb8e7('0x15'));var logger=require(_0xb8e7('0x16'))(_0xb8e7('0x17'));var utils=require(_0xb8e7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb8e7('0x19'));var db=require(_0xb8e7('0x1a'))['db'];function respondWithStatusCode(_0x56dad8,_0x588657){_0x588657=_0x588657||0xcc;return function(_0x5900ea){if(_0x5900ea){return _0x56dad8[_0xb8e7('0x1b')](_0x588657);}return _0x56dad8['status'](_0x588657)['end']();};}function respondWithResult(_0x4c07b1,_0x42547c){_0x42547c=_0x42547c||0xc8;return function(_0x42be6f){if(_0x42be6f){return _0x4c07b1[_0xb8e7('0x1c')](_0x42547c)[_0xb8e7('0x1d')](_0x42be6f);}};}function respondWithFilteredResult(_0x5f1264,_0xc53048){return function(_0x41f633){if(_0x41f633){var _0x230c9e=typeof _0xc53048[_0xb8e7('0x1e')]===_0xb8e7('0x1f')&&typeof _0xc53048[_0xb8e7('0x20')]===_0xb8e7('0x1f');var _0x421aec=_0x41f633[_0xb8e7('0x21')];var _0x4f6ae7=_0x230c9e?0x0:_0xc53048[_0xb8e7('0x1e')];var _0x258716=_0x230c9e?_0x41f633[_0xb8e7('0x21')]:_0xc53048[_0xb8e7('0x1e')]+_0xc53048[_0xb8e7('0x20')];var _0x53ccc9;if(_0x258716>=_0x421aec){_0x258716=_0x421aec;_0x53ccc9=0xc8;}else{_0x53ccc9=0xce;}_0x5f1264[_0xb8e7('0x1c')](_0x53ccc9);return _0x5f1264['set'](_0xb8e7('0x22'),_0x4f6ae7+'-'+_0x258716+'/'+_0x421aec)[_0xb8e7('0x1d')](_0x41f633);}return null;};}function patchUpdates(_0x5978de){return function(_0x5e1b64){try{jsonpatch['apply'](_0x5e1b64,_0x5978de,!![]);}catch(_0x343564){return BPromise['reject'](_0x343564);}return _0x5e1b64[_0xb8e7('0x23')]();};}function saveUpdates(_0x4f02f0,_0xba2dd4){return function(_0x384a99){if(_0x384a99){return _0x384a99[_0xb8e7('0x24')](_0x4f02f0)['then'](function(_0x5e55e0){return _0x5e55e0;});}return null;};}function removeEntity(_0x99416f,_0x2289f8){return function(_0x5032ec){if(_0x5032ec){return _0x5032ec[_0xb8e7('0x25')]()[_0xb8e7('0x26')](function(){_0x99416f[_0xb8e7('0x1c')](0xcc)[_0xb8e7('0x27')]();});}};}function handleEntityNotFound(_0x517ebc,_0x1862ff){return function(_0x5a304e){if(!_0x5a304e){_0x517ebc[_0xb8e7('0x1b')](0x194);}return _0x5a304e;};}function handleError(_0x212a4d,_0x149e7e){_0x149e7e=_0x149e7e||0x1f4;return function(_0x350190){logger[_0xb8e7('0x28')](_0x350190['stack']);if(_0x350190[_0xb8e7('0x29')]){delete _0x350190[_0xb8e7('0x29')];}_0x212a4d[_0xb8e7('0x1c')](_0x149e7e)[_0xb8e7('0x2a')](_0x350190);};}exports[_0xb8e7('0x2b')]=function(_0x1384ad,_0x49cfec){var _0x4f8440={},_0xd0a4d8={},_0x558e23={'count':0x0,'rows':[]};var _0x356317=_[_0xb8e7('0x2c')](db[_0xb8e7('0x2d')][_0xb8e7('0x2e')],function(_0x34eee8){return{'name':_0x34eee8['fieldName'],'type':_0x34eee8[_0xb8e7('0x2f')][_0xb8e7('0x30')]};});_0xd0a4d8['model']=_[_0xb8e7('0x2c')](_0x356317,'name');_0xd0a4d8[_0xb8e7('0x31')]=_[_0xb8e7('0x32')](_0x1384ad[_0xb8e7('0x31')]);_0xd0a4d8[_0xb8e7('0x33')]=_[_0xb8e7('0x34')](_0xd0a4d8['model'],_0xd0a4d8[_0xb8e7('0x31')]);_0x4f8440[_0xb8e7('0x35')]=_[_0xb8e7('0x34')](_0xd0a4d8[_0xb8e7('0x36')],qs[_0xb8e7('0x37')](_0x1384ad[_0xb8e7('0x31')][_0xb8e7('0x37')]));_0x4f8440[_0xb8e7('0x35')]=_0x4f8440[_0xb8e7('0x35')]['length']?_0x4f8440[_0xb8e7('0x35')]:_0xd0a4d8[_0xb8e7('0x36')];if(!_0x1384ad[_0xb8e7('0x31')][_0xb8e7('0x38')](_0xb8e7('0x39'))){_0x4f8440[_0xb8e7('0x20')]=qs[_0xb8e7('0x20')](_0x1384ad[_0xb8e7('0x31')][_0xb8e7('0x20')]);_0x4f8440[_0xb8e7('0x1e')]=qs['offset'](_0x1384ad[_0xb8e7('0x31')]['offset']);}_0x4f8440[_0xb8e7('0x3a')]=qs['sort'](_0x1384ad[_0xb8e7('0x31')]['sort']);_0x4f8440[_0xb8e7('0x3b')]=qs[_0xb8e7('0x33')](_[_0xb8e7('0x3c')](_0x1384ad[_0xb8e7('0x31')],_0xd0a4d8['filters']),_0x356317);if(_0x1384ad['query'][_0xb8e7('0x3d')]){_0x4f8440[_0xb8e7('0x3b')]=_[_0xb8e7('0x3e')](_0x4f8440[_0xb8e7('0x3b')],{'$or':_[_0xb8e7('0x2c')](_0x356317,function(_0x37fc20){if(_0x37fc20[_0xb8e7('0x2f')]!==_0xb8e7('0x3f')){var _0x10c4bb={};_0x10c4bb[_0x37fc20['name']]={'$like':'%'+_0x1384ad['query'][_0xb8e7('0x3d')]+'%'};return _0x10c4bb;}})});}_0x4f8440=_[_0xb8e7('0x3e')]({},_0x4f8440,_0x1384ad[_0xb8e7('0x40')]);var _0x43588a={'where':_0x4f8440[_0xb8e7('0x3b')]};return db[_0xb8e7('0x2d')][_0xb8e7('0x21')](_0x43588a)['then'](function(_0x18c2fa){_0x558e23[_0xb8e7('0x21')]=_0x18c2fa;if(_0x1384ad['query'][_0xb8e7('0x41')]){_0x4f8440[_0xb8e7('0x42')]=[{'all':!![]}];}return db[_0xb8e7('0x2d')][_0xb8e7('0x43')](_0x4f8440);})[_0xb8e7('0x26')](function(_0x2d8c42){_0x558e23[_0xb8e7('0x44')]=_0x2d8c42;return _0x558e23;})['then'](respondWithFilteredResult(_0x49cfec,_0x4f8440))['catch'](handleError(_0x49cfec,null));};exports[_0xb8e7('0x45')]=function(_0x4b91dc,_0x22e388){var _0x23d629={'raw':!![],'where':{'id':_0x4b91dc[_0xb8e7('0x46')]['id']}},_0x32cfb5={};_0x32cfb5[_0xb8e7('0x36')]=_[_0xb8e7('0x32')](db[_0xb8e7('0x2d')][_0xb8e7('0x2e')]);_0x32cfb5[_0xb8e7('0x31')]=_[_0xb8e7('0x32')](_0x4b91dc[_0xb8e7('0x31')]);_0x32cfb5[_0xb8e7('0x33')]=_[_0xb8e7('0x34')](_0x32cfb5['model'],_0x32cfb5[_0xb8e7('0x31')]);_0x23d629[_0xb8e7('0x35')]=_[_0xb8e7('0x34')](_0x32cfb5[_0xb8e7('0x36')],qs[_0xb8e7('0x37')](_0x4b91dc['query'][_0xb8e7('0x37')]));_0x23d629['attributes']=_0x23d629[_0xb8e7('0x35')][_0xb8e7('0x47')]?_0x23d629[_0xb8e7('0x35')]:_0x32cfb5[_0xb8e7('0x36')];if(_0x4b91dc[_0xb8e7('0x31')][_0xb8e7('0x41')]){_0x23d629[_0xb8e7('0x42')]=[{'all':!![]}];}_0x23d629=_[_0xb8e7('0x3e')]({},_0x23d629,_0x4b91dc[_0xb8e7('0x40')]);return db[_0xb8e7('0x2d')]['find'](_0x23d629)[_0xb8e7('0x26')](handleEntityNotFound(_0x22e388,null))[_0xb8e7('0x26')](respondWithResult(_0x22e388,null))[_0xb8e7('0x48')](handleError(_0x22e388,null));};exports[_0xb8e7('0x49')]=function(_0x553f16,_0x148b3d){return db[_0xb8e7('0x2d')][_0xb8e7('0x49')](_0x553f16['body'],{})['then'](respondWithResult(_0x148b3d,0xc9))[_0xb8e7('0x48')](handleError(_0x148b3d,null));};exports[_0xb8e7('0x24')]=function(_0x54dac2,_0x48e922){if(_0x54dac2[_0xb8e7('0x4a')]['id']){delete _0x54dac2['body']['id'];}return db[_0xb8e7('0x2d')][_0xb8e7('0x4b')]({'where':{'id':_0x54dac2[_0xb8e7('0x46')]['id']}})[_0xb8e7('0x26')](handleEntityNotFound(_0x48e922,null))[_0xb8e7('0x26')](saveUpdates(_0x54dac2['body'],null))[_0xb8e7('0x26')](respondWithResult(_0x48e922,null))['catch'](handleError(_0x48e922,null));};exports[_0xb8e7('0x25')]=function(_0xa120da,_0x2a13fc){return db[_0xb8e7('0x2d')]['find']({'where':{'id':_0xa120da['params']['id']}})['then'](handleEntityNotFound(_0x2a13fc,null))[_0xb8e7('0x26')](removeEntity(_0x2a13fc,null))[_0xb8e7('0x48')](handleError(_0x2a13fc,null));}; \ No newline at end of file +var _0xb73c=['destroy','then','end','error','name','send','index','ZendeskField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set'];(function(_0x5e05c5,_0x28ead7){var _0x4f470c=function(_0x58277f){while(--_0x58277f){_0x5e05c5['push'](_0x5e05c5['shift']());}};_0x4f470c(++_0x28ead7);}(_0xb73c,0x1cd));var _0xcb73=function(_0x5530ab,_0x1424d7){_0x5530ab=_0x5530ab-0x0;var _0x3e9c4a=_0xb73c[_0x5530ab];return _0x3e9c4a;};'use strict';var emlformat=require(_0xcb73('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb73('0x1'));var jsonpatch=require(_0xcb73('0x2'));var rp=require(_0xcb73('0x3'));var moment=require(_0xcb73('0x4'));var BPromise=require(_0xcb73('0x5'));var Mustache=require(_0xcb73('0x6'));var util=require(_0xcb73('0x7'));var path=require('path');var sox=require(_0xcb73('0x8'));var csv=require(_0xcb73('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcb73('0xa'));var crypto=require(_0xcb73('0xb'));var jsforce=require(_0xcb73('0xc'));var deskjs=require(_0xcb73('0xd'));var toCsv=require(_0xcb73('0x9'));var querystring=require(_0xcb73('0xe'));var Papa=require('papaparse');var Redis=require(_0xcb73('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xcb73('0x10'));var as=require(_0xcb73('0x11'));var hardwareService=require(_0xcb73('0x12'));var logger=require(_0xcb73('0x13'))(_0xcb73('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb73('0x15'))['db'];function respondWithStatusCode(_0x2b5c6c,_0x57a641){_0x57a641=_0x57a641||0xcc;return function(_0x13b556){if(_0x13b556){return _0x2b5c6c[_0xcb73('0x16')](_0x57a641);}return _0x2b5c6c[_0xcb73('0x17')](_0x57a641)['end']();};}function respondWithResult(_0x572959,_0x3223af){_0x3223af=_0x3223af||0xc8;return function(_0x521fd5){if(_0x521fd5){return _0x572959['status'](_0x3223af)['json'](_0x521fd5);}};}function respondWithFilteredResult(_0x12b639,_0x382225){return function(_0x52c261){if(_0x52c261){var _0x378039=typeof _0x382225[_0xcb73('0x18')]===_0xcb73('0x19')&&typeof _0x382225['limit']===_0xcb73('0x19');var _0x4c2a01=_0x52c261[_0xcb73('0x1a')];var _0x58ba6d=_0x378039?0x0:_0x382225[_0xcb73('0x18')];var _0x58f64b=_0x378039?_0x52c261[_0xcb73('0x1a')]:_0x382225[_0xcb73('0x18')]+_0x382225[_0xcb73('0x1b')];var _0x3155f7;if(_0x58f64b>=_0x4c2a01){_0x58f64b=_0x4c2a01;_0x3155f7=0xc8;}else{_0x3155f7=0xce;}_0x12b639['status'](_0x3155f7);return _0x12b639[_0xcb73('0x1c')]('Content-Range',_0x58ba6d+'-'+_0x58f64b+'/'+_0x4c2a01)['json'](_0x52c261);}return null;};}function patchUpdates(_0xc8ce90){return function(_0x5b13fd){try{jsonpatch['apply'](_0x5b13fd,_0xc8ce90,!![]);}catch(_0x6f82b9){return BPromise['reject'](_0x6f82b9);}return _0x5b13fd['save']();};}function saveUpdates(_0x35b1e5,_0xf23366){return function(_0x54c6fc){if(_0x54c6fc){return _0x54c6fc['update'](_0x35b1e5)['then'](function(_0x564bad){return _0x564bad;});}return null;};}function removeEntity(_0x1aca68,_0x38e042){return function(_0x2e9f5a){if(_0x2e9f5a){return _0x2e9f5a[_0xcb73('0x1d')]()[_0xcb73('0x1e')](function(){_0x1aca68[_0xcb73('0x17')](0xcc)[_0xcb73('0x1f')]();});}};}function handleEntityNotFound(_0x66db1d,_0x10c215){return function(_0x166608){if(!_0x166608){_0x66db1d[_0xcb73('0x16')](0x194);}return _0x166608;};}function handleError(_0x5efe04,_0xc42ca){_0xc42ca=_0xc42ca||0x1f4;return function(_0x171067){logger[_0xcb73('0x20')](_0x171067['stack']);if(_0x171067[_0xcb73('0x21')]){delete _0x171067[_0xcb73('0x21')];}_0x5efe04[_0xcb73('0x17')](_0xc42ca)[_0xcb73('0x22')](_0x171067);};}exports[_0xcb73('0x23')]=function(_0x2ae37a,_0x12366f){var _0x12a610={},_0x4287d6={},_0x536600={'count':0x0,'rows':[]};var _0x4a5011=_['map'](db[_0xcb73('0x24')]['rawAttributes'],function(_0x25a62b){return{'name':_0x25a62b[_0xcb73('0x25')],'type':_0x25a62b[_0xcb73('0x26')][_0xcb73('0x27')]};});_0x4287d6[_0xcb73('0x28')]=_[_0xcb73('0x29')](_0x4a5011,'name');_0x4287d6[_0xcb73('0x2a')]=_[_0xcb73('0x2b')](_0x2ae37a[_0xcb73('0x2a')]);_0x4287d6[_0xcb73('0x2c')]=_[_0xcb73('0x2d')](_0x4287d6[_0xcb73('0x28')],_0x4287d6[_0xcb73('0x2a')]);_0x12a610[_0xcb73('0x2e')]=_[_0xcb73('0x2d')](_0x4287d6['model'],qs['fields'](_0x2ae37a[_0xcb73('0x2a')][_0xcb73('0x2f')]));_0x12a610[_0xcb73('0x2e')]=_0x12a610[_0xcb73('0x2e')][_0xcb73('0x30')]?_0x12a610[_0xcb73('0x2e')]:_0x4287d6['model'];if(!_0x2ae37a[_0xcb73('0x2a')][_0xcb73('0x31')](_0xcb73('0x32'))){_0x12a610[_0xcb73('0x1b')]=qs[_0xcb73('0x1b')](_0x2ae37a[_0xcb73('0x2a')]['limit']);_0x12a610[_0xcb73('0x18')]=qs[_0xcb73('0x18')](_0x2ae37a[_0xcb73('0x2a')]['offset']);}_0x12a610[_0xcb73('0x33')]=qs['sort'](_0x2ae37a[_0xcb73('0x2a')][_0xcb73('0x34')]);_0x12a610[_0xcb73('0x35')]=qs[_0xcb73('0x2c')](_[_0xcb73('0x36')](_0x2ae37a[_0xcb73('0x2a')],_0x4287d6['filters']),_0x4a5011);if(_0x2ae37a[_0xcb73('0x2a')]['filter']){_0x12a610[_0xcb73('0x35')]=_['merge'](_0x12a610['where'],{'$or':_[_0xcb73('0x29')](_0x4a5011,function(_0x6a6abf){if(_0x6a6abf[_0xcb73('0x26')]!==_0xcb73('0x37')){var _0xde6791={};_0xde6791[_0x6a6abf['name']]={'$like':'%'+_0x2ae37a[_0xcb73('0x2a')][_0xcb73('0x38')]+'%'};return _0xde6791;}})});}_0x12a610=_[_0xcb73('0x39')]({},_0x12a610,_0x2ae37a[_0xcb73('0x3a')]);var _0x55b970={'where':_0x12a610[_0xcb73('0x35')]};return db[_0xcb73('0x24')][_0xcb73('0x1a')](_0x55b970)[_0xcb73('0x1e')](function(_0xe56725){_0x536600[_0xcb73('0x1a')]=_0xe56725;if(_0x2ae37a[_0xcb73('0x2a')][_0xcb73('0x3b')]){_0x12a610[_0xcb73('0x3c')]=[{'all':!![]}];}return db[_0xcb73('0x24')][_0xcb73('0x3d')](_0x12a610);})[_0xcb73('0x1e')](function(_0x5dc055){_0x536600[_0xcb73('0x3e')]=_0x5dc055;return _0x536600;})[_0xcb73('0x1e')](respondWithFilteredResult(_0x12366f,_0x12a610))['catch'](handleError(_0x12366f,null));};exports[_0xcb73('0x3f')]=function(_0x49fb80,_0xfc068f){var _0x2073fa={'raw':!![],'where':{'id':_0x49fb80['params']['id']}},_0xe5601d={};_0xe5601d['model']=_[_0xcb73('0x2b')](db[_0xcb73('0x24')]['rawAttributes']);_0xe5601d['query']=_[_0xcb73('0x2b')](_0x49fb80[_0xcb73('0x2a')]);_0xe5601d[_0xcb73('0x2c')]=_[_0xcb73('0x2d')](_0xe5601d['model'],_0xe5601d[_0xcb73('0x2a')]);_0x2073fa['attributes']=_[_0xcb73('0x2d')](_0xe5601d['model'],qs[_0xcb73('0x2f')](_0x49fb80['query'][_0xcb73('0x2f')]));_0x2073fa[_0xcb73('0x2e')]=_0x2073fa['attributes'][_0xcb73('0x30')]?_0x2073fa['attributes']:_0xe5601d['model'];if(_0x49fb80['query']['includeAll']){_0x2073fa[_0xcb73('0x3c')]=[{'all':!![]}];}_0x2073fa=_[_0xcb73('0x39')]({},_0x2073fa,_0x49fb80['options']);return db[_0xcb73('0x24')][_0xcb73('0x40')](_0x2073fa)[_0xcb73('0x1e')](handleEntityNotFound(_0xfc068f,null))[_0xcb73('0x1e')](respondWithResult(_0xfc068f,null))[_0xcb73('0x41')](handleError(_0xfc068f,null));};exports['create']=function(_0x1e45d6,_0x1ca0d6){return db[_0xcb73('0x24')][_0xcb73('0x42')](_0x1e45d6[_0xcb73('0x43')],{})['then'](respondWithResult(_0x1ca0d6,0xc9))['catch'](handleError(_0x1ca0d6,null));};exports[_0xcb73('0x44')]=function(_0x228d4d,_0x1700d0){if(_0x228d4d[_0xcb73('0x43')]['id']){delete _0x228d4d[_0xcb73('0x43')]['id'];}return db[_0xcb73('0x24')][_0xcb73('0x40')]({'where':{'id':_0x228d4d[_0xcb73('0x45')]['id']}})[_0xcb73('0x1e')](handleEntityNotFound(_0x1700d0,null))[_0xcb73('0x1e')](saveUpdates(_0x228d4d[_0xcb73('0x43')],null))[_0xcb73('0x1e')](respondWithResult(_0x1700d0,null))['catch'](handleError(_0x1700d0,null));};exports[_0xcb73('0x1d')]=function(_0x123f8c,_0x1a5879){return db['ZendeskField'][_0xcb73('0x40')]({'where':{'id':_0x123f8c['params']['id']}})[_0xcb73('0x1e')](handleEntityNotFound(_0x1a5879,null))['then'](removeEntity(_0x1a5879,null))['catch'](handleError(_0x1a5879,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1b155a0..ea59651 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 _0x33d7=['zendesk_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33d7,0xc7));var _0x733d=function(_0x3ac15d,_0x3c07ba){_0x3ac15d=_0x3ac15d-0x0;var _0x131cb4=_0x33d7[_0x3ac15d];return _0x131cb4;};'use strict';var _=require(_0x733d('0x0'));var util=require('util');var logger=require(_0x733d('0x1'))('api');var moment=require(_0x733d('0x2'));var BPromise=require(_0x733d('0x3'));var rp=require(_0x733d('0x4'));var fs=require('fs');var path=require(_0x733d('0x5'));var rimraf=require('rimraf');var config=require(_0x733d('0x6'));var attributes=require(_0x733d('0x7'));module[_0x733d('0x8')]=function(_0x50574f,_0x427ebf){return _0x50574f[_0x733d('0x9')](_0x733d('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x733d('0xb'),'fields':[_0x733d('0xc'),_0x733d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ae7=['FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x302b5e,_0x564a8e){var _0x523ab7=function(_0x6aec8f){while(--_0x6aec8f){_0x302b5e['push'](_0x302b5e['shift']());}};_0x523ab7(++_0x564a8e);}(_0x0ae7,0xbc));var _0x70ae=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x0ae7[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require(_0x70ae('0x0'));var logger=require(_0x70ae('0x1'))(_0x70ae('0x2'));var moment=require(_0x70ae('0x3'));var BPromise=require(_0x70ae('0x4'));var rp=require(_0x70ae('0x5'));var fs=require('fs');var path=require(_0x70ae('0x6'));var rimraf=require(_0x70ae('0x7'));var config=require(_0x70ae('0x8'));var attributes=require(_0x70ae('0x9'));module[_0x70ae('0xa')]=function(_0x3268e4,_0x214ab6){return _0x3268e4[_0x70ae('0xb')](_0x70ae('0xc'),attributes,{'tableName':_0x70ae('0xd'),'paranoid':![],'indexes':[{'name':_0x70ae('0xe'),'fields':[_0x70ae('0xf'),_0x70ae('0x10')],'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 ba470fc..cebeb10 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 _0xf039=['ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x42d4b7,_0x5b15f7){var _0x42ad3e=function(_0x3b71db){while(--_0x3b71db){_0x42d4b7['push'](_0x42d4b7['shift']());}};_0x42ad3e(++_0x5b15f7);}(_0xf039,0xfb));var _0x9f03=function(_0x435f08,_0xc91841){_0x435f08=_0x435f08-0x0;var _0x4e40ba=_0xf039[_0x435f08];return _0x4e40ba;};'use strict';var _=require('lodash');var util=require(_0x9f03('0x0'));var moment=require(_0x9f03('0x1'));var BPromise=require(_0x9f03('0x2'));var rs=require(_0x9f03('0x3'));var fs=require('fs');var Redis=require(_0x9f03('0x4'));var db=require(_0x9f03('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f03('0x6'))('rpc');var config=require(_0x9f03('0x7'));var jayson=require(_0x9f03('0x8'));var client=jayson['client'][_0x9f03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48a503,_0x5da272,_0x1c2f91){return new BPromise(function(_0x39851c,_0x463cc0){return client[_0x9f03('0xa')](_0x48a503,_0x1c2f91)[_0x9f03('0xb')](function(_0x1c60ee){logger[_0x9f03('0xc')](_0x9f03('0xd'),_0x5da272,_0x9f03('0xe'));logger[_0x9f03('0xf')](_0x9f03('0x10'),_0x5da272,'request\x20sent',JSON['stringify'](_0x1c60ee));if(_0x1c60ee[_0x9f03('0x11')]){if(_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x12')]===0x1f4){logger[_0x9f03('0x11')](_0x9f03('0xd'),_0x5da272,_0x1c60ee['error'][_0x9f03('0x13')]);return _0x463cc0(_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x13')]);}logger['error'](_0x9f03('0xd'),_0x5da272,_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x13')]);return _0x39851c(_0x1c60ee[_0x9f03('0x11')][_0x9f03('0x13')]);}else{logger[_0x9f03('0xc')](_0x9f03('0xd'),_0x5da272,_0x9f03('0xe'));_0x39851c(_0x1c60ee[_0x9f03('0x14')][_0x9f03('0x13')]);}})[_0x9f03('0x15')](function(_0x58f67b){logger['error'](_0x9f03('0xd'),_0x5da272,_0x58f67b);_0x463cc0(_0x58f67b);});});} \ No newline at end of file +var _0x1c06=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0xee3051,_0xbe4f18){var _0x139e81=function(_0xac81c3){while(--_0xac81c3){_0xee3051['push'](_0xee3051['shift']());}};_0x139e81(++_0xbe4f18);}(_0x1c06,0xfa));var _0x61c0=function(_0x19cf1f,_0x4105e3){_0x19cf1f=_0x19cf1f-0x0;var _0x234028=_0x1c06[_0x19cf1f];return _0x234028;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x61c0('0x0'));var BPromise=require(_0x61c0('0x1'));var rs=require(_0x61c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61c0('0x3'))['db'];var utils=require(_0x61c0('0x4'));var logger=require('../../config/logger')(_0x61c0('0x5'));var config=require(_0x61c0('0x6'));var jayson=require(_0x61c0('0x7'));var client=jayson['client'][_0x61c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12befc,_0x554527,_0x1132f9){return new BPromise(function(_0x2946b9,_0x113638){return client[_0x61c0('0x9')](_0x12befc,_0x1132f9)[_0x61c0('0xa')](function(_0x12bf0e){logger[_0x61c0('0xb')](_0x61c0('0xc'),_0x554527,_0x61c0('0xd'));logger[_0x61c0('0xe')](_0x61c0('0xf'),_0x554527,'request\x20sent',JSON[_0x61c0('0x10')](_0x12bf0e));if(_0x12bf0e[_0x61c0('0x11')]){if(_0x12bf0e[_0x61c0('0x11')][_0x61c0('0x12')]===0x1f4){logger[_0x61c0('0x11')](_0x61c0('0xc'),_0x554527,_0x12bf0e[_0x61c0('0x11')][_0x61c0('0x13')]);return _0x113638(_0x12bf0e[_0x61c0('0x11')][_0x61c0('0x13')]);}logger['error'](_0x61c0('0xc'),_0x554527,_0x12bf0e['error'][_0x61c0('0x13')]);return _0x2946b9(_0x12bf0e[_0x61c0('0x11')][_0x61c0('0x13')]);}else{logger[_0x61c0('0xb')]('ZendeskField,\x20%s,\x20%s',_0x554527,_0x61c0('0xd'));_0x2946b9(_0x12bf0e[_0x61c0('0x14')][_0x61c0('0x13')]);}})[_0x61c0('0x15')](function(_0x584b59){logger[_0x61c0('0x11')](_0x61c0('0xc'),_0x554527,_0x584b59);_0x113638(_0x584b59);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 542fc73..7a37fc9 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 _0xa191=['index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xa191,0xa7));var _0x1a19=function(_0xb1e8a1,_0x7dbda3){_0xb1e8a1=_0xb1e8a1-0x0;var _0x583dd5=_0xa191[_0xb1e8a1];return _0x583dd5;};'use strict';var multer=require(_0x1a19('0x0'));var util=require(_0x1a19('0x1'));var path=require(_0x1a19('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1a19('0x3')]();var fs_extra=require(_0x1a19('0x4'));var auth=require(_0x1a19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1a19('0x6'));var controller=require(_0x1a19('0x7'));router[_0x1a19('0x8')]('/',auth['isAuthenticated'](),controller[_0x1a19('0x9')]);router[_0x1a19('0x8')](_0x1a19('0xa'),auth[_0x1a19('0xb')](),controller[_0x1a19('0xc')]);router[_0x1a19('0x8')](_0x1a19('0xd'),auth['isAuthenticated'](),controller[_0x1a19('0xe')]);router[_0x1a19('0x8')](_0x1a19('0xf'),auth[_0x1a19('0xb')](),controller[_0x1a19('0x10')]);router[_0x1a19('0x11')]('/',auth[_0x1a19('0xb')](),controller[_0x1a19('0x12')]);router[_0x1a19('0x11')](_0x1a19('0xd'),auth[_0x1a19('0xb')](),controller['addConfiguration']);router[_0x1a19('0x13')](_0x1a19('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x1a19('0x14')]('/:id',auth[_0x1a19('0xb')](),controller[_0x1a19('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf2cf=['post','addConfiguration','put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0xf2cf,0xf5));var _0xff2c=function(_0x2e6893,_0x46c7c3){_0x2e6893=_0x2e6893-0x0;var _0x1d041c=_0xf2cf[_0x2e6893];return _0x1d041c;};'use strict';var multer=require('multer');var util=require(_0xff2c('0x0'));var path=require(_0xff2c('0x1'));var timeout=require(_0xff2c('0x2'));var express=require('express');var router=express[_0xff2c('0x3')]();var fs_extra=require(_0xff2c('0x4'));var auth=require(_0xff2c('0x5'));var interaction=require(_0xff2c('0x6'));var config=require(_0xff2c('0x7'));var controller=require(_0xff2c('0x8'));router['get']('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0xa')]);router['get'](_0xff2c('0xb'),auth[_0xff2c('0x9')](),controller[_0xff2c('0xc')]);router[_0xff2c('0xd')](_0xff2c('0xe'),auth[_0xff2c('0x9')](),controller[_0xff2c('0xf')]);router['get'](_0xff2c('0x10'),auth[_0xff2c('0x9')](),controller[_0xff2c('0x11')]);router['post']('/',auth[_0xff2c('0x9')](),controller[_0xff2c('0x12')]);router[_0xff2c('0x13')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xff2c('0x14')]);router[_0xff2c('0x15')]('/:id',auth[_0xff2c('0x9')](),controller['update']);router['delete'](_0xff2c('0xb'),auth[_0xff2c('0x9')](),controller[_0xff2c('0x16')]);module[_0xff2c('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index f77caaa..bd44daf 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 _0x70e0=['STRING','sequelize','exports'];(function(_0x18f808,_0x15190d){var _0x1e7b6c=function(_0x5a91cb){while(--_0x5a91cb){_0x18f808['push'](_0x18f808['shift']());}};_0x1e7b6c(++_0x15190d);}(_0x70e0,0x17b));var _0x070e=function(_0x1fa502,_0x48ced0){_0x1fa502=_0x1fa502-0x0;var _0x19701c=_0x70e0[_0x1fa502];return _0x19701c;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}}; \ No newline at end of file +var _0xa8a8=['exports','STRING','sequelize'];(function(_0x47d3be,_0x30023f){var _0x2f85d9=function(_0x4ee341){while(--_0x4ee341){_0x47d3be['push'](_0x47d3be['shift']());}};_0x2f85d9(++_0x30023f);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4126d2,_0xff5748){_0x4126d2=_0x4126d2-0x0;var _0x458181=_0xa8a8[_0x4126d2];return _0x458181;};'use strict';var Sequelize=require(_0x8a8a('0x0'));module[_0x8a8a('0x1')]={'name':{'type':Sequelize[_0x8a8a('0x2')]},'description':{'type':Sequelize[_0x8a8a('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x8a8a('0x2')]},'clientId':{'type':Sequelize[_0x8a8a('0x2')]},'clientSecret':{'type':Sequelize[_0x8a8a('0x2')]},'serverUrl':{'type':Sequelize[_0x8a8a('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x8a8a('0x2')]},'refreshToken':{'type':Sequelize[_0x8a8a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 144093c..a6ac565 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 _0x9c36=['code','refreshToken','zoho.eu','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Start_Time','includes','api_name','system_mandatory','push','display_label','custom_field','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','statusCode','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','order','filter','merge','options','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientId'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0x9c36,0x1b6));var _0x69c3=function(_0x9df9da,_0x328324){_0x9df9da=_0x9df9da-0x0;var _0x4af4ff=_0x9c36[_0x9df9da];return _0x4af4ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x69c3('0x0'));var zipdir=require(_0x69c3('0x1'));var jsonpatch=require(_0x69c3('0x2'));var rp=require(_0x69c3('0x3'));var moment=require(_0x69c3('0x4'));var BPromise=require(_0x69c3('0x5'));var Mustache=require(_0x69c3('0x6'));var util=require(_0x69c3('0x7'));var path=require(_0x69c3('0x8'));var sox=require(_0x69c3('0x9'));var csv=require(_0x69c3('0xa'));var ejs=require(_0x69c3('0xb'));var fs=require('fs');var fs_extra=require(_0x69c3('0xc'));var _=require(_0x69c3('0xd'));var squel=require(_0x69c3('0xe'));var crypto=require(_0x69c3('0xf'));var jsforce=require(_0x69c3('0x10'));var deskjs=require(_0x69c3('0x11'));var toCsv=require(_0x69c3('0xa'));var querystring=require(_0x69c3('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x69c3('0x13'));var as=require(_0x69c3('0x14'));var hardwareService=require(_0x69c3('0x15'));var logger=require(_0x69c3('0x16'))(_0x69c3('0x17'));var utils=require(_0x69c3('0x18'));var config=require(_0x69c3('0x19'));var licenseUtil=require(_0x69c3('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x69c3('0x1b'));function respondWithStatusCode(_0x25c65f,_0x254ac8){_0x254ac8=_0x254ac8||0xcc;return function(_0x43154c){if(_0x43154c){return _0x25c65f[_0x69c3('0x1c')](_0x254ac8);}return _0x25c65f[_0x69c3('0x1d')](_0x254ac8)['end']();};}function respondWithResult(_0x2b1713,_0x23f461){_0x23f461=_0x23f461||0xc8;return function(_0x5ce3c5){if(_0x5ce3c5){return _0x2b1713[_0x69c3('0x1d')](_0x23f461)[_0x69c3('0x1e')](_0x5ce3c5);}};}function respondWithFilteredResult(_0xdb61b1,_0x5022de){return function(_0x1a583c){if(_0x1a583c){var _0x25df39=typeof _0x5022de[_0x69c3('0x1f')]===_0x69c3('0x20')&&typeof _0x5022de['limit']===_0x69c3('0x20');var _0xa36ebe=_0x1a583c['count'];var _0x24f257=_0x25df39?0x0:_0x5022de[_0x69c3('0x1f')];var _0x3bf497=_0x25df39?_0x1a583c[_0x69c3('0x21')]:_0x5022de[_0x69c3('0x1f')]+_0x5022de[_0x69c3('0x22')];var _0x1c79fd;if(_0x3bf497>=_0xa36ebe){_0x3bf497=_0xa36ebe;_0x1c79fd=0xc8;}else{_0x1c79fd=0xce;}_0xdb61b1[_0x69c3('0x1d')](_0x1c79fd);return _0xdb61b1[_0x69c3('0x23')](_0x69c3('0x24'),_0x24f257+'-'+_0x3bf497+'/'+_0xa36ebe)[_0x69c3('0x1e')](_0x1a583c);}return null;};}function patchUpdates(_0x24b2fa){return function(_0x36d7c8){try{jsonpatch[_0x69c3('0x25')](_0x36d7c8,_0x24b2fa,!![]);}catch(_0x8dd539){return BPromise[_0x69c3('0x26')](_0x8dd539);}return _0x36d7c8[_0x69c3('0x27')]();};}function saveUpdates(_0x1df419,_0x575843){return function(_0x12122e){if(_0x12122e){return _0x12122e[_0x69c3('0x28')](_0x1df419)['then'](function(_0x38ea70){return _0x38ea70;});}return null;};}function removeEntity(_0x562dab,_0x4c067a){return function(_0x22230a){if(_0x22230a){return _0x22230a[_0x69c3('0x29')]()[_0x69c3('0x2a')](function(){_0x562dab[_0x69c3('0x1d')](0xcc)[_0x69c3('0x2b')]();});}};}function handleEntityNotFound(_0x1f7991,_0x17cd43){return function(_0x5cc85b){if(!_0x5cc85b){_0x1f7991[_0x69c3('0x1c')](0x194);}return _0x5cc85b;};}function handleError(_0x3136f1,_0x3e5f6b){_0x3e5f6b=_0x3e5f6b||0x1f4;return function(_0x3e5ac0){logger['error'](_0x3e5ac0[_0x69c3('0x2c')]);if(_0x3e5ac0[_0x69c3('0x2d')]){delete _0x3e5ac0[_0x69c3('0x2d')];}_0x3136f1[_0x69c3('0x1d')](_0x3e5f6b)[_0x69c3('0x2e')](_0x3e5ac0);};}exports[_0x69c3('0x2f')]=function(_0x1f3db8,_0xb78261){var _0x209e00={},_0x2f49c2={},_0x38be4a={'count':0x0,'rows':[]};var _0x573853=_[_0x69c3('0x30')](db[_0x69c3('0x31')][_0x69c3('0x32')],function(_0x321906){return{'name':_0x321906[_0x69c3('0x33')],'type':_0x321906[_0x69c3('0x34')][_0x69c3('0x35')]};});_0x2f49c2[_0x69c3('0x36')]=_[_0x69c3('0x30')](_0x573853,_0x69c3('0x2d'));_0x2f49c2[_0x69c3('0x37')]=_[_0x69c3('0x38')](_0x1f3db8[_0x69c3('0x37')]);_0x2f49c2[_0x69c3('0x39')]=_[_0x69c3('0x3a')](_0x2f49c2[_0x69c3('0x36')],_0x2f49c2[_0x69c3('0x37')]);_0x209e00['attributes']=_[_0x69c3('0x3a')](_0x2f49c2[_0x69c3('0x36')],qs[_0x69c3('0x3b')](_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x3b')]));_0x209e00[_0x69c3('0x3c')]=_0x209e00[_0x69c3('0x3c')][_0x69c3('0x3d')]?_0x209e00[_0x69c3('0x3c')]:_0x2f49c2[_0x69c3('0x36')];if(!_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x3e')](_0x69c3('0x3f'))){_0x209e00[_0x69c3('0x22')]=qs[_0x69c3('0x22')](_0x1f3db8['query']['limit']);_0x209e00[_0x69c3('0x1f')]=qs[_0x69c3('0x1f')](_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x1f')]);}_0x209e00['order']=qs[_0x69c3('0x40')](_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x40')]);_0x209e00[_0x69c3('0x41')]=qs[_0x69c3('0x39')](_[_0x69c3('0x42')](_0x1f3db8[_0x69c3('0x37')],_0x2f49c2['filters']),_0x573853);if(_0x1f3db8['query']['filter']){_0x209e00['where']=_['merge'](_0x209e00[_0x69c3('0x41')],{'$or':_[_0x69c3('0x30')](_0x573853,function(_0x270600){if(_0x270600[_0x69c3('0x34')]!==_0x69c3('0x43')){var _0x4781c0={};_0x4781c0[_0x270600[_0x69c3('0x2d')]]={'$like':'%'+_0x1f3db8[_0x69c3('0x37')]['filter']+'%'};return _0x4781c0;}})});}_0x209e00=_['merge']({},_0x209e00,_0x1f3db8['options']);var _0x1ea313={'where':_0x209e00[_0x69c3('0x41')]};return db[_0x69c3('0x31')][_0x69c3('0x21')](_0x1ea313)['then'](function(_0x1b3102){_0x38be4a['count']=_0x1b3102;if(_0x1f3db8[_0x69c3('0x37')][_0x69c3('0x44')]){_0x209e00[_0x69c3('0x45')]=[{'all':!![]}];}return db[_0x69c3('0x31')][_0x69c3('0x46')](_0x209e00);})['then'](function(_0x34d7b4){_0x38be4a[_0x69c3('0x47')]=_0x34d7b4;return _0x38be4a;})['then'](respondWithFilteredResult(_0xb78261,_0x209e00))[_0x69c3('0x48')](handleError(_0xb78261,null));};exports[_0x69c3('0x49')]=function(_0x4f2823,_0x183866){var _0x37aa35={'raw':![],'where':{'id':_0x4f2823[_0x69c3('0x4a')]['id']}},_0x5b59c6={};_0x5b59c6[_0x69c3('0x36')]=_[_0x69c3('0x38')](db['ZohoAccount'][_0x69c3('0x32')]);_0x5b59c6['query']=_[_0x69c3('0x38')](_0x4f2823[_0x69c3('0x37')]);_0x5b59c6[_0x69c3('0x39')]=_[_0x69c3('0x3a')](_0x5b59c6[_0x69c3('0x36')],_0x5b59c6['query']);_0x37aa35['attributes']=_[_0x69c3('0x3a')](_0x5b59c6['model'],qs[_0x69c3('0x3b')](_0x4f2823[_0x69c3('0x37')][_0x69c3('0x3b')]));_0x37aa35[_0x69c3('0x3c')]=_0x37aa35[_0x69c3('0x3c')]['length']?_0x37aa35[_0x69c3('0x3c')]:_0x5b59c6['model'];if(_0x4f2823[_0x69c3('0x37')][_0x69c3('0x44')]){_0x37aa35[_0x69c3('0x45')]=[{'all':!![]}];}_0x37aa35=_['merge']({},_0x37aa35,_0x4f2823['options']);return db[_0x69c3('0x31')][_0x69c3('0x4b')](_0x37aa35)[_0x69c3('0x2a')](handleEntityNotFound(_0x183866,null))[_0x69c3('0x2a')](respondWithResult(_0x183866,null))[_0x69c3('0x48')](handleError(_0x183866,null));};exports[_0x69c3('0x4c')]=function(_0x360373,_0xbe2f2e){return db[_0x69c3('0x31')]['create'](_0x360373[_0x69c3('0x4d')],{})[_0x69c3('0x2a')](respondWithResult(_0xbe2f2e,0xc9))[_0x69c3('0x48')](handleError(_0xbe2f2e,null));};exports[_0x69c3('0x28')]=function(_0x578d03,_0x4fb2d1){if(_0x578d03[_0x69c3('0x4d')]['id']){delete _0x578d03[_0x69c3('0x4d')]['id'];}return db[_0x69c3('0x31')][_0x69c3('0x4b')]({'where':{'id':_0x578d03[_0x69c3('0x4a')]['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0x4fb2d1,null))['then'](saveUpdates(_0x578d03[_0x69c3('0x4d')],null))[_0x69c3('0x2a')](respondWithResult(_0x4fb2d1,null))[_0x69c3('0x48')](handleError(_0x4fb2d1,null));};exports[_0x69c3('0x29')]=function(_0x1a73d4,_0xe662d4){return db[_0x69c3('0x31')][_0x69c3('0x4b')]({'where':{'id':_0x1a73d4[_0x69c3('0x4a')]['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0xe662d4,null))[_0x69c3('0x2a')](removeEntity(_0xe662d4,null))[_0x69c3('0x48')](handleError(_0xe662d4,null));};exports['getConfigurations']=function(_0x39bba3,_0x5bc2d0,_0x5cdb63){var _0x1b82d3={};var _0x254ef4={};var _0x209fd5;var _0x4be2ed;return db[_0x69c3('0x31')][_0x69c3('0x4e')]({'where':{'id':_0x39bba3['params']['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0x5bc2d0,null))['then'](function(_0x2b0c9a){if(_0x2b0c9a){_0x209fd5=_0x2b0c9a;_0x254ef4[_0x69c3('0x36')]=_[_0x69c3('0x38')](db['ZohoConfiguration'][_0x69c3('0x32')]);_0x254ef4[_0x69c3('0x37')]=_[_0x69c3('0x38')](_0x39bba3[_0x69c3('0x37')]);_0x254ef4[_0x69c3('0x39')]=_[_0x69c3('0x3a')](_0x254ef4['model'],_0x254ef4[_0x69c3('0x37')]);_0x1b82d3['attributes']=_[_0x69c3('0x3a')](_0x254ef4[_0x69c3('0x36')],qs[_0x69c3('0x3b')](_0x39bba3[_0x69c3('0x37')]['fields']));_0x1b82d3[_0x69c3('0x3c')]=_0x1b82d3[_0x69c3('0x3c')][_0x69c3('0x3d')]?_0x1b82d3[_0x69c3('0x3c')]:_0x254ef4['model'];_0x1b82d3[_0x69c3('0x4f')]=qs[_0x69c3('0x40')](_0x39bba3[_0x69c3('0x37')][_0x69c3('0x40')]);_0x1b82d3[_0x69c3('0x41')]=qs[_0x69c3('0x39')](_['pick'](_0x39bba3[_0x69c3('0x37')],_0x254ef4['filters']));if(_0x39bba3[_0x69c3('0x37')][_0x69c3('0x50')]){_0x1b82d3[_0x69c3('0x41')]=_['merge'](_0x1b82d3[_0x69c3('0x41')],{'$or':_[_0x69c3('0x30')](_0x1b82d3[_0x69c3('0x3c')],function(_0x3cc004){var _0x4c8d81={};_0x4c8d81[_0x3cc004]={'$like':'%'+_0x39bba3['query'][_0x69c3('0x50')]+'%'};return _0x4c8d81;})});}_0x1b82d3=_[_0x69c3('0x51')]({},_0x1b82d3,_0x39bba3[_0x69c3('0x52')]);return _0x209fd5[_0x69c3('0x53')](_0x1b82d3);}})[_0x69c3('0x2a')](function(_0x34ea72){if(_0x34ea72){_0x4be2ed=_0x34ea72[_0x69c3('0x3d')];if(!_0x39bba3[_0x69c3('0x37')]['hasOwnProperty'](_0x69c3('0x3f'))){_0x1b82d3['limit']=qs[_0x69c3('0x22')](_0x39bba3[_0x69c3('0x37')][_0x69c3('0x22')]);_0x1b82d3[_0x69c3('0x1f')]=qs[_0x69c3('0x1f')](_0x39bba3[_0x69c3('0x37')][_0x69c3('0x1f')]);}return _0x209fd5['getConfigurations'](_0x1b82d3);}})['then'](function(_0x292cca){if(_0x292cca){return _0x292cca?{'count':_0x4be2ed,'rows':_0x292cca}:null;}})['then'](respondWithResult(_0x5bc2d0,null))['catch'](handleError(_0x5bc2d0,null));};exports[_0x69c3('0x54')]=function(_0x5839bf,_0x5f3766,_0x7c838c){if(_0x5839bf[_0x69c3('0x4d')]['id']){delete _0x5839bf['body']['id'];}return db[_0x69c3('0x31')][_0x69c3('0x4e')]({'where':{'id':_0x5839bf[_0x69c3('0x4a')]['id']}})[_0x69c3('0x2a')](handleEntityNotFound(_0x5f3766,null))[_0x69c3('0x2a')](function(_0x2fc1eb){if(_0x2fc1eb){_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x55')]=_0x2fc1eb['id'];_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x56')]=integrations[_0x69c3('0x57')](_0x5839bf['body'][_0x69c3('0x58')],_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x34')]);_0x5839bf['body'][_0x69c3('0x59')]=integrations[_0x69c3('0x5a')](_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x58')],_0x5839bf[_0x69c3('0x4d')][_0x69c3('0x34')]);return db[_0x69c3('0x5b')][_0x69c3('0x4c')](_0x5839bf[_0x69c3('0x4d')],{'include':[{'model':db[_0x69c3('0x5c')],'as':_0x69c3('0x56')},{'model':db[_0x69c3('0x5c')],'as':_0x69c3('0x59')}]});}return null;})[_0x69c3('0x2a')](respondWithResult(_0x5f3766,null))[_0x69c3('0x48')](handleError(_0x5f3766,null));};function getAccessToken(_0x333353){return new Promise(function(_0x1643b7,_0x32cff0){var _0x54be04;switch(_0x333353[_0x69c3('0x5d')]){case'US':_0x54be04=_0x69c3('0x5e');break;case'AU':_0x54be04=_0x69c3('0x5f');break;case'EU':_0x54be04=_0x69c3('0x60');break;case'IN':_0x54be04=_0x69c3('0x61');break;case'CN':_0x54be04='https://accounts.zoho.com.cn';break;default:_0x54be04=_0x69c3('0x60');break;}var _0x397afa={'method':_0x69c3('0x62'),'uri':_0x54be04+'/oauth/v2/token','qs':{'refresh_token':_0x333353['refreshToken'],'client_id':_0x333353['clientId'],'client_secret':_0x333353[_0x69c3('0x63')],'grant_type':_0x69c3('0x64')},'json':!![]};return rp(_0x397afa)['then'](function(_0x15b136){if(_0x15b136[_0x69c3('0x65')]){_0x1643b7(_0x15b136['access_token']);}else{_0x32cff0(_0x69c3('0x66'));}})['catch'](function(_0x34fad8){_0x32cff0(_0x34fad8);});});}exports[_0x69c3('0x67')]=function(_0x47d467,_0xa1059d,_0x33c041){var _0x3dbdd7,_0x1e67de,_0x26b69e,_0x1d950f,_0x240c87;return db[_0x69c3('0x31')]['findOne']({'where':{'id':_0x47d467['params']['id']},'attributes':['id',_0x69c3('0x68'),_0x69c3('0x5d'),_0x69c3('0x69'),'clientSecret','serverUrl',_0x69c3('0x6a'),_0x69c3('0x6b')]})[_0x69c3('0x2a')](handleEntityNotFound(_0xa1059d,null))[_0x69c3('0x2a')](function(_0x49ad23){_0x240c87=_0x49ad23;_0x3dbdd7=_0x240c87[_0x69c3('0x68')];_0x1e67de=_0x3dbdd7===_0x69c3('0x6c')?'eu':'com';_0x26b69e=_0x240c87[_0x69c3('0x6d')];var _0x17cfb9=_0x26b69e['slice'](-0x1);if(_0x17cfb9==='/'||_0x17cfb9==='\x5c'||_0x17cfb9===':'){_0x26b69e=_0x26b69e[_0x69c3('0x6e')](0x0,_0x26b69e[_0x69c3('0x6f')](_0x17cfb9));}if(!_0x240c87['refreshToken']){throw new Error(_0x69c3('0x70'));}return getAccessToken(_0x240c87);})[_0x69c3('0x2a')](function(_0x551051){if(_0x551051){return rp({'method':_0x69c3('0x71'),'uri':util[_0x69c3('0x72')](_0x69c3('0x73'),_0x1e67de),'qs':{'module':_0x69c3('0x74')},'headers':{'Authorization':_0x69c3('0x75')+_0x551051},'json':!![]});}})[_0x69c3('0x2a')](function(_0x56102e){if(_0x56102e){if(_0x56102e[_0x69c3('0x76')]&&_0x56102e[_0x69c3('0x76')][_0x69c3('0x77')]){throw new Error(_0x56102e[_0x69c3('0x76')][_0x69c3('0x77')][_0x69c3('0x78')]);}var _0x3b4244=[];var _0xbd8737=[];var _0x42ac3e=[_0x69c3('0x79'),_0x69c3('0x7a'),_0x69c3('0x7b'),_0x69c3('0x7c'),_0x69c3('0x7d'),'Call_Result',_0x69c3('0x7e'),'Call_Type'];_0xbd8737=_['remove'](_0x56102e['fields'],function(_0x5e82fa){return _0x42ac3e[_0x69c3('0x7f')](_0x5e82fa[_0x69c3('0x80')]);});for(var _0x2882b0=0x0;_0x2882b0<_0xbd8737['length'];_0x2882b0++){if(_0xbd8737[_0x2882b0][_0x69c3('0x81')]===![]){_0x3b4244[_0x69c3('0x82')]({'id':_0xbd8737[_0x2882b0]['id'],'name':_0xbd8737[_0x2882b0][_0x69c3('0x83')],'custom':_0xbd8737[_0x2882b0][_0x69c3('0x84')],'options':_0xbd8737[_0x2882b0]['data_type']==='picklist'&&_0xbd8737[_0x2882b0][_0x69c3('0x85')][_0x69c3('0x3d')]>-0x1?_[_0x69c3('0x30')](_0xbd8737[_0x2882b0][_0x69c3('0x85')],function(_0x5b0ba5){return{'name':_0x5b0ba5,'value':_0x5b0ba5};}):[]});}}return{'count':_0x3b4244[_0x69c3('0x3d')],'rows':_0x3b4244};}else{return{'count':0x0,'rows':[]};}})[_0x69c3('0x2a')](respondWithResult(_0xa1059d,null))[_0x69c3('0x48')](function(_0x4d6cba){var _0x4087ce=_0x47d467[_0x69c3('0x37')]['test']?0x1f4:_0x4d6cba['statusCode']||0x1f4;logger[_0x69c3('0x77')](_0x69c3('0x86'),_0x69c3('0x67'),_0x4087ce,JSON['stringify'](_0x4d6cba));delete _0x4d6cba['name'];if(_0x4087ce===0x191){_0x4087ce=0x190;}_0xa1059d[_0x69c3('0x1d')](_0x4087ce)['send'](_0x47d467[_0x69c3('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4d6cba[_0x69c3('0x87')]}:_0x4d6cba);});}; \ No newline at end of file +var _0xd4fa=['custom_field','data_type','pick_list_values','test','statusCode','stringify','send','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','rows','catch','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','serverUrl','code','host','zoho.eu','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Call_Duration','Call_Result','Call_Start_Time','remove','api_name','system_mandatory','display_label'];(function(_0x839ba5,_0x1c4d54){var _0x5babda=function(_0x271a69){while(--_0x271a69){_0x839ba5['push'](_0x839ba5['shift']());}};_0x5babda(++_0x1c4d54);}(_0xd4fa,0x1f0));var _0xad4f=function(_0x1ded0f,_0x2c82a9){_0x1ded0f=_0x1ded0f-0x0;var _0x1ad47a=_0xd4fa[_0x1ded0f];return _0x1ad47a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad4f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad4f('0x1'));var rp=require('request-promise');var moment=require(_0xad4f('0x2'));var BPromise=require(_0xad4f('0x3'));var Mustache=require('mustache');var util=require(_0xad4f('0x4'));var path=require(_0xad4f('0x5'));var sox=require(_0xad4f('0x6'));var csv=require(_0xad4f('0x7'));var ejs=require(_0xad4f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad4f('0x9'));var squel=require(_0xad4f('0xa'));var crypto=require('crypto');var jsforce=require(_0xad4f('0xb'));var deskjs=require(_0xad4f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xad4f('0xd'));var qs=require(_0xad4f('0xe'));var as=require(_0xad4f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad4f('0x10'))(_0xad4f('0x11'));var utils=require('../../config/utils');var config=require(_0xad4f('0x12'));var licenseUtil=require(_0xad4f('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xad4f('0x14'));function respondWithStatusCode(_0x3ff9bc,_0x566b0d){_0x566b0d=_0x566b0d||0xcc;return function(_0x1051d3){if(_0x1051d3){return _0x3ff9bc[_0xad4f('0x15')](_0x566b0d);}return _0x3ff9bc[_0xad4f('0x16')](_0x566b0d)[_0xad4f('0x17')]();};}function respondWithResult(_0x4c3fca,_0x2ddad8){_0x2ddad8=_0x2ddad8||0xc8;return function(_0x21193a){if(_0x21193a){return _0x4c3fca['status'](_0x2ddad8)[_0xad4f('0x18')](_0x21193a);}};}function respondWithFilteredResult(_0x75b446,_0x55508d){return function(_0x1c6eb6){if(_0x1c6eb6){var _0x913cc2=typeof _0x55508d[_0xad4f('0x19')]==='undefined'&&typeof _0x55508d['limit']===_0xad4f('0x1a');var _0x9a1104=_0x1c6eb6[_0xad4f('0x1b')];var _0x7c643f=_0x913cc2?0x0:_0x55508d[_0xad4f('0x19')];var _0x386871=_0x913cc2?_0x1c6eb6[_0xad4f('0x1b')]:_0x55508d['offset']+_0x55508d[_0xad4f('0x1c')];var _0x669cae;if(_0x386871>=_0x9a1104){_0x386871=_0x9a1104;_0x669cae=0xc8;}else{_0x669cae=0xce;}_0x75b446[_0xad4f('0x16')](_0x669cae);return _0x75b446['set'](_0xad4f('0x1d'),_0x7c643f+'-'+_0x386871+'/'+_0x9a1104)['json'](_0x1c6eb6);}return null;};}function patchUpdates(_0x2ee612){return function(_0x3b7e64){try{jsonpatch[_0xad4f('0x1e')](_0x3b7e64,_0x2ee612,!![]);}catch(_0x5ee8a3){return BPromise['reject'](_0x5ee8a3);}return _0x3b7e64[_0xad4f('0x1f')]();};}function saveUpdates(_0x22a944,_0x5f2f3b){return function(_0xec1472){if(_0xec1472){return _0xec1472[_0xad4f('0x20')](_0x22a944)['then'](function(_0x1a4a7e){return _0x1a4a7e;});}return null;};}function removeEntity(_0x347657,_0x12afae){return function(_0x3e48bd){if(_0x3e48bd){return _0x3e48bd[_0xad4f('0x21')]()[_0xad4f('0x22')](function(){_0x347657[_0xad4f('0x16')](0xcc)[_0xad4f('0x17')]();});}};}function handleEntityNotFound(_0x5db52a,_0x53e419){return function(_0x9f12ff){if(!_0x9f12ff){_0x5db52a['sendStatus'](0x194);}return _0x9f12ff;};}function handleError(_0x2c701c,_0x1bd401){_0x1bd401=_0x1bd401||0x1f4;return function(_0x3b4201){logger[_0xad4f('0x23')](_0x3b4201[_0xad4f('0x24')]);if(_0x3b4201[_0xad4f('0x25')]){delete _0x3b4201['name'];}_0x2c701c[_0xad4f('0x16')](_0x1bd401)['send'](_0x3b4201);};}exports[_0xad4f('0x26')]=function(_0x3016e7,_0x3d6de6){var _0x12c8c0={},_0x2390d9={},_0x2bf57f={'count':0x0,'rows':[]};var _0x33d052=_[_0xad4f('0x27')](db[_0xad4f('0x28')][_0xad4f('0x29')],function(_0x5443b4){return{'name':_0x5443b4[_0xad4f('0x2a')],'type':_0x5443b4['type'][_0xad4f('0x2b')]};});_0x2390d9[_0xad4f('0x2c')]=_[_0xad4f('0x27')](_0x33d052,_0xad4f('0x25'));_0x2390d9[_0xad4f('0x2d')]=_[_0xad4f('0x2e')](_0x3016e7[_0xad4f('0x2d')]);_0x2390d9['filters']=_[_0xad4f('0x2f')](_0x2390d9['model'],_0x2390d9[_0xad4f('0x2d')]);_0x12c8c0[_0xad4f('0x30')]=_[_0xad4f('0x2f')](_0x2390d9[_0xad4f('0x2c')],qs[_0xad4f('0x31')](_0x3016e7['query'][_0xad4f('0x31')]));_0x12c8c0[_0xad4f('0x30')]=_0x12c8c0[_0xad4f('0x30')][_0xad4f('0x32')]?_0x12c8c0[_0xad4f('0x30')]:_0x2390d9[_0xad4f('0x2c')];if(!_0x3016e7['query'][_0xad4f('0x33')]('nolimit')){_0x12c8c0['limit']=qs['limit'](_0x3016e7[_0xad4f('0x2d')][_0xad4f('0x1c')]);_0x12c8c0[_0xad4f('0x19')]=qs[_0xad4f('0x19')](_0x3016e7[_0xad4f('0x2d')][_0xad4f('0x19')]);}_0x12c8c0['order']=qs[_0xad4f('0x34')](_0x3016e7[_0xad4f('0x2d')][_0xad4f('0x34')]);_0x12c8c0[_0xad4f('0x35')]=qs['filters'](_['pick'](_0x3016e7['query'],_0x2390d9[_0xad4f('0x36')]),_0x33d052);if(_0x3016e7[_0xad4f('0x2d')]['filter']){_0x12c8c0[_0xad4f('0x35')]=_[_0xad4f('0x37')](_0x12c8c0[_0xad4f('0x35')],{'$or':_['map'](_0x33d052,function(_0x1e5442){if(_0x1e5442[_0xad4f('0x38')]!==_0xad4f('0x39')){var _0x3dbfa3={};_0x3dbfa3[_0x1e5442[_0xad4f('0x25')]]={'$like':'%'+_0x3016e7[_0xad4f('0x2d')][_0xad4f('0x3a')]+'%'};return _0x3dbfa3;}})});}_0x12c8c0=_[_0xad4f('0x37')]({},_0x12c8c0,_0x3016e7[_0xad4f('0x3b')]);var _0x3cb1a1={'where':_0x12c8c0[_0xad4f('0x35')]};return db[_0xad4f('0x28')][_0xad4f('0x1b')](_0x3cb1a1)[_0xad4f('0x22')](function(_0x2b93bf){_0x2bf57f[_0xad4f('0x1b')]=_0x2b93bf;if(_0x3016e7['query'][_0xad4f('0x3c')]){_0x12c8c0['include']=[{'all':!![]}];}return db[_0xad4f('0x28')]['findAll'](_0x12c8c0);})[_0xad4f('0x22')](function(_0x23b5e3){_0x2bf57f[_0xad4f('0x3d')]=_0x23b5e3;return _0x2bf57f;})[_0xad4f('0x22')](respondWithFilteredResult(_0x3d6de6,_0x12c8c0))[_0xad4f('0x3e')](handleError(_0x3d6de6,null));};exports['show']=function(_0x7f2827,_0x4d85c3){var _0x2ea303={'raw':![],'where':{'id':_0x7f2827['params']['id']}},_0x3e0bf7={};_0x3e0bf7['model']=_['keys'](db[_0xad4f('0x28')][_0xad4f('0x29')]);_0x3e0bf7[_0xad4f('0x2d')]=_['keys'](_0x7f2827[_0xad4f('0x2d')]);_0x3e0bf7[_0xad4f('0x36')]=_[_0xad4f('0x2f')](_0x3e0bf7[_0xad4f('0x2c')],_0x3e0bf7['query']);_0x2ea303[_0xad4f('0x30')]=_['intersection'](_0x3e0bf7[_0xad4f('0x2c')],qs[_0xad4f('0x31')](_0x7f2827[_0xad4f('0x2d')][_0xad4f('0x31')]));_0x2ea303[_0xad4f('0x30')]=_0x2ea303['attributes'][_0xad4f('0x32')]?_0x2ea303[_0xad4f('0x30')]:_0x3e0bf7[_0xad4f('0x2c')];if(_0x7f2827[_0xad4f('0x2d')]['includeAll']){_0x2ea303['include']=[{'all':!![]}];}_0x2ea303=_[_0xad4f('0x37')]({},_0x2ea303,_0x7f2827[_0xad4f('0x3b')]);return db[_0xad4f('0x28')][_0xad4f('0x3f')](_0x2ea303)[_0xad4f('0x22')](handleEntityNotFound(_0x4d85c3,null))[_0xad4f('0x22')](respondWithResult(_0x4d85c3,null))[_0xad4f('0x3e')](handleError(_0x4d85c3,null));};exports[_0xad4f('0x40')]=function(_0x5c0a85,_0x21b96e){return db['ZohoAccount']['create'](_0x5c0a85[_0xad4f('0x41')],{})[_0xad4f('0x22')](respondWithResult(_0x21b96e,0xc9))[_0xad4f('0x3e')](handleError(_0x21b96e,null));};exports['update']=function(_0x37bf85,_0x6b0689){if(_0x37bf85[_0xad4f('0x41')]['id']){delete _0x37bf85[_0xad4f('0x41')]['id'];}return db[_0xad4f('0x28')]['find']({'where':{'id':_0x37bf85['params']['id']}})[_0xad4f('0x22')](handleEntityNotFound(_0x6b0689,null))[_0xad4f('0x22')](saveUpdates(_0x37bf85[_0xad4f('0x41')],null))[_0xad4f('0x22')](respondWithResult(_0x6b0689,null))[_0xad4f('0x3e')](handleError(_0x6b0689,null));};exports[_0xad4f('0x21')]=function(_0x2fc3db,_0x25d135){return db[_0xad4f('0x28')]['find']({'where':{'id':_0x2fc3db[_0xad4f('0x42')]['id']}})[_0xad4f('0x22')](handleEntityNotFound(_0x25d135,null))[_0xad4f('0x22')](removeEntity(_0x25d135,null))[_0xad4f('0x3e')](handleError(_0x25d135,null));};exports[_0xad4f('0x43')]=function(_0x2abe80,_0x606e75,_0x24d89e){var _0x5c5d6={};var _0x158798={};var _0x54952b;var _0xa7d2b7;return db['ZohoAccount'][_0xad4f('0x44')]({'where':{'id':_0x2abe80[_0xad4f('0x42')]['id']}})[_0xad4f('0x22')](handleEntityNotFound(_0x606e75,null))[_0xad4f('0x22')](function(_0x5b8c05){if(_0x5b8c05){_0x54952b=_0x5b8c05;_0x158798[_0xad4f('0x2c')]=_[_0xad4f('0x2e')](db[_0xad4f('0x45')][_0xad4f('0x29')]);_0x158798['query']=_[_0xad4f('0x2e')](_0x2abe80['query']);_0x158798[_0xad4f('0x36')]=_['intersection'](_0x158798[_0xad4f('0x2c')],_0x158798[_0xad4f('0x2d')]);_0x5c5d6[_0xad4f('0x30')]=_[_0xad4f('0x2f')](_0x158798[_0xad4f('0x2c')],qs[_0xad4f('0x31')](_0x2abe80[_0xad4f('0x2d')]['fields']));_0x5c5d6[_0xad4f('0x30')]=_0x5c5d6[_0xad4f('0x30')]['length']?_0x5c5d6[_0xad4f('0x30')]:_0x158798[_0xad4f('0x2c')];_0x5c5d6['order']=qs[_0xad4f('0x34')](_0x2abe80[_0xad4f('0x2d')]['sort']);_0x5c5d6[_0xad4f('0x35')]=qs[_0xad4f('0x36')](_[_0xad4f('0x46')](_0x2abe80[_0xad4f('0x2d')],_0x158798['filters']));if(_0x2abe80[_0xad4f('0x2d')][_0xad4f('0x3a')]){_0x5c5d6[_0xad4f('0x35')]=_[_0xad4f('0x37')](_0x5c5d6[_0xad4f('0x35')],{'$or':_[_0xad4f('0x27')](_0x5c5d6[_0xad4f('0x30')],function(_0x13f438){var _0x423200={};_0x423200[_0x13f438]={'$like':'%'+_0x2abe80[_0xad4f('0x2d')]['filter']+'%'};return _0x423200;})});}_0x5c5d6=_[_0xad4f('0x37')]({},_0x5c5d6,_0x2abe80[_0xad4f('0x3b')]);return _0x54952b[_0xad4f('0x43')](_0x5c5d6);}})[_0xad4f('0x22')](function(_0xe07edb){if(_0xe07edb){_0xa7d2b7=_0xe07edb[_0xad4f('0x32')];if(!_0x2abe80[_0xad4f('0x2d')][_0xad4f('0x33')](_0xad4f('0x47'))){_0x5c5d6[_0xad4f('0x1c')]=qs[_0xad4f('0x1c')](_0x2abe80['query']['limit']);_0x5c5d6[_0xad4f('0x19')]=qs['offset'](_0x2abe80[_0xad4f('0x2d')][_0xad4f('0x19')]);}return _0x54952b['getConfigurations'](_0x5c5d6);}})[_0xad4f('0x22')](function(_0xa8f559){if(_0xa8f559){return _0xa8f559?{'count':_0xa7d2b7,'rows':_0xa8f559}:null;}})[_0xad4f('0x22')](respondWithResult(_0x606e75,null))['catch'](handleError(_0x606e75,null));};exports[_0xad4f('0x48')]=function(_0x6211bc,_0x4d4225,_0x56bc8d){if(_0x6211bc[_0xad4f('0x41')]['id']){delete _0x6211bc[_0xad4f('0x41')]['id'];}return db[_0xad4f('0x28')][_0xad4f('0x44')]({'where':{'id':_0x6211bc[_0xad4f('0x42')]['id']}})[_0xad4f('0x22')](handleEntityNotFound(_0x4d4225,null))[_0xad4f('0x22')](function(_0x4ecdf6){if(_0x4ecdf6){_0x6211bc['body'][_0xad4f('0x49')]=_0x4ecdf6['id'];_0x6211bc[_0xad4f('0x41')][_0xad4f('0x4a')]=integrations[_0xad4f('0x4b')](_0x6211bc[_0xad4f('0x41')]['channel'],_0x6211bc[_0xad4f('0x41')][_0xad4f('0x38')]);_0x6211bc[_0xad4f('0x41')][_0xad4f('0x4c')]=integrations['getDescriptions'](_0x6211bc[_0xad4f('0x41')][_0xad4f('0x4d')],_0x6211bc[_0xad4f('0x41')][_0xad4f('0x38')]);return db['ZohoConfiguration'][_0xad4f('0x40')](_0x6211bc[_0xad4f('0x41')],{'include':[{'model':db['ZohoField'],'as':_0xad4f('0x4a')},{'model':db[_0xad4f('0x4e')],'as':_0xad4f('0x4c')}]});}return null;})[_0xad4f('0x22')](respondWithResult(_0x4d4225,null))[_0xad4f('0x3e')](handleError(_0x4d4225,null));};function getAccessToken(_0x260122){return new Promise(function(_0x32f129,_0x5d480d){var _0x28d04d;switch(_0x260122[_0xad4f('0x4f')]){case'US':_0x28d04d=_0xad4f('0x50');break;case'AU':_0x28d04d='https://accounts.zoho.com.au';break;case'EU':_0x28d04d='https://accounts.zoho.eu';break;case'IN':_0x28d04d=_0xad4f('0x51');break;case'CN':_0x28d04d=_0xad4f('0x52');break;default:_0x28d04d=_0xad4f('0x53');break;}var _0x19e81b={'method':_0xad4f('0x54'),'uri':_0x28d04d+_0xad4f('0x55'),'qs':{'refresh_token':_0x260122[_0xad4f('0x56')],'client_id':_0x260122[_0xad4f('0x57')],'client_secret':_0x260122[_0xad4f('0x58')],'grant_type':_0xad4f('0x59')},'json':!![]};return rp(_0x19e81b)[_0xad4f('0x22')](function(_0x13b44c){if(_0x13b44c[_0xad4f('0x5a')]){_0x32f129(_0x13b44c['access_token']);}else{_0x5d480d('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xad4f('0x3e')](function(_0x573ee9){_0x5d480d(_0x573ee9);});});}exports[_0xad4f('0x5b')]=function(_0x2ab6a5,_0xc58150,_0x1b4956){var _0x18af0e,_0x5b2e5e,_0x56ea5a,_0x871617,_0x38f741;return db[_0xad4f('0x28')][_0xad4f('0x44')]({'where':{'id':_0x2ab6a5[_0xad4f('0x42')]['id']},'attributes':['id','host',_0xad4f('0x4f'),_0xad4f('0x57'),_0xad4f('0x58'),_0xad4f('0x5c'),_0xad4f('0x5d'),_0xad4f('0x56')]})[_0xad4f('0x22')](handleEntityNotFound(_0xc58150,null))[_0xad4f('0x22')](function(_0xeaefe9){_0x38f741=_0xeaefe9;_0x18af0e=_0x38f741[_0xad4f('0x5e')];_0x5b2e5e=_0x18af0e===_0xad4f('0x5f')?'eu':_0xad4f('0x60');_0x56ea5a=_0x38f741[_0xad4f('0x5c')];var _0x537597=_0x56ea5a['slice'](-0x1);if(_0x537597==='/'||_0x537597==='\x5c'||_0x537597===':'){_0x56ea5a=_0x56ea5a[_0xad4f('0x61')](0x0,_0x56ea5a['lastIndexOf'](_0x537597));}if(!_0x38f741[_0xad4f('0x56')]){throw new Error(_0xad4f('0x62'));}return getAccessToken(_0x38f741);})[_0xad4f('0x22')](function(_0x1165c7){if(_0x1165c7){return rp({'method':_0xad4f('0x63'),'uri':util[_0xad4f('0x64')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x5b2e5e),'qs':{'module':_0xad4f('0x65')},'headers':{'Authorization':_0xad4f('0x66')+_0x1165c7},'json':!![]});}})[_0xad4f('0x22')](function(_0x3f8c19){if(_0x3f8c19){if(_0x3f8c19[_0xad4f('0x67')]&&_0x3f8c19[_0xad4f('0x67')][_0xad4f('0x23')]){throw new Error(_0x3f8c19['response']['error'][_0xad4f('0x68')]);}var _0x285a21=[];var _0x2d963b=[];var _0xa22b32=[_0xad4f('0x69'),_0xad4f('0x6a'),'Description','WhoId',_0xad4f('0x6b'),_0xad4f('0x6c'),_0xad4f('0x6d'),'Call_Type'];_0x2d963b=_[_0xad4f('0x6e')](_0x3f8c19[_0xad4f('0x31')],function(_0x4a8d20){return _0xa22b32['includes'](_0x4a8d20[_0xad4f('0x6f')]);});for(var _0x955781=0x0;_0x955781<_0x2d963b[_0xad4f('0x32')];_0x955781++){if(_0x2d963b[_0x955781][_0xad4f('0x70')]===![]){_0x285a21['push']({'id':_0x2d963b[_0x955781]['id'],'name':_0x2d963b[_0x955781][_0xad4f('0x71')],'custom':_0x2d963b[_0x955781][_0xad4f('0x72')],'options':_0x2d963b[_0x955781][_0xad4f('0x73')]==='picklist'&&_0x2d963b[_0x955781][_0xad4f('0x74')][_0xad4f('0x32')]>-0x1?_[_0xad4f('0x27')](_0x2d963b[_0x955781]['pick_list_values'],function(_0x448e08){return{'name':_0x448e08,'value':_0x448e08};}):[]});}}return{'count':_0x285a21[_0xad4f('0x32')],'rows':_0x285a21};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0xc58150,null))[_0xad4f('0x3e')](function(_0xd591ef){var _0x5d2270=_0x2ab6a5[_0xad4f('0x2d')][_0xad4f('0x75')]?0x1f4:_0xd591ef[_0xad4f('0x76')]||0x1f4;logger[_0xad4f('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xad4f('0x5b'),_0x5d2270,JSON[_0xad4f('0x77')](_0xd591ef));delete _0xd591ef[_0xad4f('0x25')];if(_0x5d2270===0x191){_0x5d2270=0x190;}_0xc58150[_0xad4f('0x16')](_0x5d2270)[_0xad4f('0x78')](_0x2ab6a5[_0xad4f('0x2d')]['test']?{'message':_0xad4f('0x79'),'statusCode':_0xd591ef['statusCode']}:_0xd591ef);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c07025b..a58f28b 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 _0x48c6=['format','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','substring','https://accounts.zoho.com.au','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error'];(function(_0x95c1d8,_0x35762d){var _0x12f0e8=function(_0x2cb198){while(--_0x2cb198){_0x95c1d8['push'](_0x95c1d8['shift']());}};_0x12f0e8(++_0x35762d);}(_0x48c6,0x1d5));var _0x648c=function(_0xe139be,_0x49ef39){_0xe139be=_0xe139be-0x0;var _0x2053da=_0x48c6[_0xe139be];return _0x2053da;};'use strict';var _=require(_0x648c('0x0'));var util=require('util');var logger=require(_0x648c('0x1'))('api');var moment=require(_0x648c('0x2'));var BPromise=require('bluebird');var rp=require(_0x648c('0x3'));var fs=require('fs');var path=require(_0x648c('0x4'));var rimraf=require(_0x648c('0x5'));var config=require(_0x648c('0x6'));var attributes=require(_0x648c('0x7'));var integrations=require(_0x648c('0x8'));module[_0x648c('0x9')]=function(_0x4816aa,_0x327666){return _0x4816aa[_0x648c('0xa')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x350ab1,_0x3de337,_0x4a2ffc){if(_0x350ab1[_0x648c('0xb')](_0x648c('0xc'))||_0x350ab1[_0x648c('0xb')](_0x648c('0xd'))||_0x350ab1[_0x648c('0xb')](_0x648c('0xe'))||_0x350ab1[_0x648c('0xb')](_0x648c('0xf'))||_0x350ab1['changed'](_0x648c('0x10'))||_0x350ab1[_0x648c('0xb')](_0x648c('0x11'))){var _0x1b7f4c,_0x52147e;_0x1b7f4c=_0x350ab1[_0x648c('0xd')];var _0x18d105=_0x1b7f4c[_0x648c('0x12')](-0x1);if(_0x18d105==='/'||_0x18d105==='\x5c'||_0x18d105===':'){_0x1b7f4c=_0x1b7f4c['substring'](0x0,_0x1b7f4c[_0x648c('0x13')](_0x18d105));}switch(_0x350ab1[_0x648c('0xc')]){case'US':_0x52147e=_0x648c('0x14');break;case'AU':_0x52147e='https://accounts.zoho.com.au';break;case'IN':_0x52147e=_0x648c('0x15');break;case'CN':_0x52147e=_0x648c('0x16');break;default:_0x52147e=_0x648c('0x17');break;}var _0x374ed4={'method':_0x648c('0x18'),'uri':_0x52147e+_0x648c('0x19'),'form':{'grant_type':_0x648c('0x1a'),'client_id':_0x350ab1[_0x648c('0xe')],'client_secret':_0x350ab1[_0x648c('0xf')],'redirect_uri':_0x350ab1[_0x648c('0xd')],'code':_0x350ab1[_0x648c('0x10')]},'headers':{'Content-Type':_0x648c('0x1b')}};return rp(_0x374ed4)[_0x648c('0x1c')](function(_0x4437f0){var _0x181930=JSON[_0x648c('0x1d')](_0x4437f0);if(_0x181930[_0x648c('0x1e')]){_0x350ab1[_0x648c('0x1f')]=_0x181930['refresh_token'];logger[_0x648c('0x20')](util['format'](_0x648c('0x21'),_0x350ab1['name'],_0x350ab1['id']));}else{logger[_0x648c('0x22')](util[_0x648c('0x23')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x350ab1[_0x648c('0x24')],_0x350ab1['id']),util[_0x648c('0x25')](_0x181930,{'showHidden':![],'depth':null}));}return _0x4a2ffc(null,_0x3de337);})[_0x648c('0x26')](function(_0x4da4a0){logger['error'](util[_0x648c('0x23')](_0x648c('0x27'),_0x350ab1[_0x648c('0x24')],_0x350ab1['id']),util[_0x648c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4a2ffc(_0x4da4a0);});}else{return _0x4a2ffc(null,_0x3de337);}},'beforeUpdate':function(_0x49218a,_0x545455,_0x58c7ac){if(_0x49218a[_0x648c('0xb')]('zone')||_0x49218a['changed']('serverUrl')||_0x49218a[_0x648c('0xb')](_0x648c('0xe'))||_0x49218a[_0x648c('0xb')](_0x648c('0xf'))||_0x49218a[_0x648c('0xb')](_0x648c('0x10'))||_0x49218a['changed']('host')){var _0x463a39,_0x2b9c02;_0x463a39=_0x49218a[_0x648c('0xd')];var _0x534d67=_0x463a39[_0x648c('0x12')](-0x1);if(_0x534d67==='/'||_0x534d67==='\x5c'||_0x534d67===':'){_0x463a39=_0x463a39[_0x648c('0x28')](0x0,_0x463a39['lastIndexOf'](_0x534d67));}switch(_0x49218a[_0x648c('0xc')]){case'US':_0x2b9c02=_0x648c('0x14');break;case'AU':_0x2b9c02=_0x648c('0x29');break;case'IN':_0x2b9c02=_0x648c('0x15');break;case'CN':_0x2b9c02=_0x648c('0x16');break;default:_0x2b9c02='https://accounts.zoho.eu';break;}var _0x358112={'method':_0x648c('0x18'),'uri':_0x2b9c02+_0x648c('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x49218a[_0x648c('0xe')],'client_secret':_0x49218a[_0x648c('0xf')],'redirect_uri':_0x49218a[_0x648c('0xd')],'code':_0x49218a[_0x648c('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x358112)[_0x648c('0x1c')](function(_0x3a81be){var _0x18c19b=JSON['parse'](_0x3a81be);if(_0x18c19b[_0x648c('0x1e')]){_0x49218a['refreshToken']=_0x18c19b[_0x648c('0x1e')];logger[_0x648c('0x20')](util['format'](_0x648c('0x21'),_0x49218a[_0x648c('0x24')],_0x49218a['id']));}else{logger[_0x648c('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x49218a[_0x648c('0x24')],_0x49218a['id']),util['inspect'](_0x18c19b,{'showHidden':![],'depth':null}));}return _0x58c7ac(null,_0x545455);})[_0x648c('0x26')](function(_0x3af291){logger['error'](util[_0x648c('0x23')](_0x648c('0x27'),_0x49218a[_0x648c('0x24')],_0x49218a['id']),util[_0x648c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x58c7ac(_0x3af291);});}else{return _0x58c7ac(null,_0x545455);}}}});}; \ No newline at end of file +var _0x1656=['lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','slice','clientSecret','util','../../config/logger','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','host','substring'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0x1656,0x194));var _0x6165=function(_0x13b8b1,_0x42882a){_0x13b8b1=_0x13b8b1-0x0;var _0x467f68=_0x1656[_0x13b8b1];return _0x467f68;};'use strict';var _=require('lodash');var util=require(_0x6165('0x0'));var logger=require(_0x6165('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6165('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6165('0x3'));var rimraf=require('rimraf');var config=require(_0x6165('0x4'));var attributes=require(_0x6165('0x5'));var integrations=require(_0x6165('0x6'));module[_0x6165('0x7')]=function(_0x15e16f,_0x2f8cbf){return _0x15e16f[_0x6165('0x8')](_0x6165('0x9'),attributes,{'tableName':_0x6165('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ff66f,_0x12e951,_0x4fd9b0){if(_0x2ff66f['changed'](_0x6165('0xb'))||_0x2ff66f[_0x6165('0xc')](_0x6165('0xd'))||_0x2ff66f['changed']('clientId')||_0x2ff66f['changed']('clientSecret')||_0x2ff66f[_0x6165('0xc')]('code')||_0x2ff66f[_0x6165('0xc')](_0x6165('0xe'))){var _0x5813c1,_0x1683da;_0x5813c1=_0x2ff66f[_0x6165('0xd')];var _0x30746d=_0x5813c1['slice'](-0x1);if(_0x30746d==='/'||_0x30746d==='\x5c'||_0x30746d===':'){_0x5813c1=_0x5813c1[_0x6165('0xf')](0x0,_0x5813c1[_0x6165('0x10')](_0x30746d));}switch(_0x2ff66f[_0x6165('0xb')]){case'US':_0x1683da=_0x6165('0x11');break;case'AU':_0x1683da=_0x6165('0x12');break;case'IN':_0x1683da=_0x6165('0x13');break;case'CN':_0x1683da=_0x6165('0x14');break;default:_0x1683da=_0x6165('0x15');break;}var _0x136b80={'method':_0x6165('0x16'),'uri':_0x1683da+_0x6165('0x17'),'form':{'grant_type':_0x6165('0x18'),'client_id':_0x2ff66f[_0x6165('0x19')],'client_secret':_0x2ff66f['clientSecret'],'redirect_uri':_0x2ff66f['serverUrl'],'code':_0x2ff66f[_0x6165('0x1a')]},'headers':{'Content-Type':_0x6165('0x1b')}};return rp(_0x136b80)[_0x6165('0x1c')](function(_0xd5fb74){var _0x364154=JSON[_0x6165('0x1d')](_0xd5fb74);if(_0x364154[_0x6165('0x1e')]){_0x2ff66f[_0x6165('0x1f')]=_0x364154['refresh_token'];logger[_0x6165('0x20')](util[_0x6165('0x21')](_0x6165('0x22'),_0x2ff66f[_0x6165('0x23')],_0x2ff66f['id']));}else{logger[_0x6165('0x24')](util['format'](_0x6165('0x25'),_0x2ff66f[_0x6165('0x23')],_0x2ff66f['id']),util[_0x6165('0x26')](_0x364154,{'showHidden':![],'depth':null}));}return _0x4fd9b0(null,_0x12e951);})[_0x6165('0x27')](function(_0x9e78a0){logger['error'](util[_0x6165('0x21')](_0x6165('0x25'),_0x2ff66f[_0x6165('0x23')],_0x2ff66f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x4fd9b0(_0x9e78a0);});}else{return _0x4fd9b0(null,_0x12e951);}},'beforeUpdate':function(_0x5d9593,_0x3287da,_0x19e380){if(_0x5d9593['changed'](_0x6165('0xb'))||_0x5d9593[_0x6165('0xc')](_0x6165('0xd'))||_0x5d9593[_0x6165('0xc')](_0x6165('0x19'))||_0x5d9593[_0x6165('0xc')]('clientSecret')||_0x5d9593['changed'](_0x6165('0x1a'))||_0x5d9593[_0x6165('0xc')](_0x6165('0xe'))){var _0x33513d,_0x24fbeb;_0x33513d=_0x5d9593[_0x6165('0xd')];var _0x356d24=_0x33513d[_0x6165('0x28')](-0x1);if(_0x356d24==='/'||_0x356d24==='\x5c'||_0x356d24===':'){_0x33513d=_0x33513d[_0x6165('0xf')](0x0,_0x33513d['lastIndexOf'](_0x356d24));}switch(_0x5d9593[_0x6165('0xb')]){case'US':_0x24fbeb='https://accounts.zoho.com';break;case'AU':_0x24fbeb=_0x6165('0x12');break;case'IN':_0x24fbeb=_0x6165('0x13');break;case'CN':_0x24fbeb=_0x6165('0x14');break;default:_0x24fbeb=_0x6165('0x15');break;}var _0x417677={'method':_0x6165('0x16'),'uri':_0x24fbeb+_0x6165('0x17'),'form':{'grant_type':_0x6165('0x18'),'client_id':_0x5d9593[_0x6165('0x19')],'client_secret':_0x5d9593[_0x6165('0x29')],'redirect_uri':_0x5d9593['serverUrl'],'code':_0x5d9593[_0x6165('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x417677)['then'](function(_0x56330c){var _0x90d67d=JSON[_0x6165('0x1d')](_0x56330c);if(_0x90d67d[_0x6165('0x1e')]){_0x5d9593[_0x6165('0x1f')]=_0x90d67d['refresh_token'];logger[_0x6165('0x20')](util['format'](_0x6165('0x22'),_0x5d9593[_0x6165('0x23')],_0x5d9593['id']));}else{logger[_0x6165('0x24')](util['format'](_0x6165('0x25'),_0x5d9593[_0x6165('0x23')],_0x5d9593['id']),util['inspect'](_0x90d67d,{'showHidden':![],'depth':null}));}return _0x19e380(null,_0x3287da);})[_0x6165('0x27')](function(_0x30d929){logger[_0x6165('0x24')](util[_0x6165('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5d9593['name'],_0x5d9593['id']),util[_0x6165('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x19e380(_0x30d929);});}else{return _0x19e380(null,_0x3287da);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8da8150..d389f8d 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 _0x5942=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','where','attributes','limit','include','model','map','then','ShowZohoAccount','lodash'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x5942,0x16a));var _0x2594=function(_0x1fbf59,_0x2ed06a){_0x1fbf59=_0x1fbf59-0x0;var _0x5143d2=_0x5942[_0x1fbf59];return _0x5143d2;};'use strict';var _=require(_0x2594('0x0'));var util=require(_0x2594('0x1'));var moment=require(_0x2594('0x2'));var BPromise=require(_0x2594('0x3'));var rs=require(_0x2594('0x4'));var fs=require('fs');var Redis=require(_0x2594('0x5'));var db=require(_0x2594('0x6'))['db'];var utils=require(_0x2594('0x7'));var logger=require(_0x2594('0x8'))(_0x2594('0x9'));var config=require(_0x2594('0xa'));var jayson=require(_0x2594('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x381472,_0xd0ada5,_0x3d20aa){return new BPromise(function(_0x5707a0,_0x2b42d3){return client[_0x2594('0xc')](_0x381472,_0x3d20aa)['then'](function(_0x29517f){logger['info'](_0x2594('0xd'),_0xd0ada5,_0x2594('0xe'));logger[_0x2594('0xf')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xd0ada5,_0x2594('0xe'),JSON[_0x2594('0x10')](_0x29517f));if(_0x29517f[_0x2594('0x11')]){if(_0x29517f[_0x2594('0x11')]['code']===0x1f4){logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);return _0x2b42d3(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}logger[_0x2594('0x11')](_0x2594('0xd'),_0xd0ada5,_0x29517f[_0x2594('0x11')]['message']);return _0x5707a0(_0x29517f[_0x2594('0x11')][_0x2594('0x12')]);}else{logger['info'](_0x2594('0xd'),_0xd0ada5,'request\x20sent');_0x5707a0(_0x29517f[_0x2594('0x13')][_0x2594('0x12')]);}})[_0x2594('0x14')](function(_0x33b4bc){logger[_0x2594('0x11')]('ZohoAccount,\x20%s,\x20%s',_0xd0ada5,_0x33b4bc);_0x2b42d3(_0x33b4bc);});});}exports[_0x2594('0x15')]=function(_0x457beb){var _0x223099=this;return new Promise(function(_0x31f24a,_0x373533){return db[_0x2594('0x16')][_0x2594('0x17')]({'raw':_0x457beb[_0x2594('0x18')]?_0x457beb[_0x2594('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x457beb['options']?_0x457beb[_0x2594('0x18')][_0x2594('0x19')]||null:null,'attributes':_0x457beb[_0x2594('0x18')]?_0x457beb[_0x2594('0x18')][_0x2594('0x1a')]||null:null,'limit':_0x457beb[_0x2594('0x18')]?_0x457beb['options'][_0x2594('0x1b')]||null:null,'include':_0x457beb[_0x2594('0x18')]?_0x457beb[_0x2594('0x18')][_0x2594('0x1c')]?_['map'](_0x457beb[_0x2594('0x18')]['include'],function(_0x281987){return{'model':db[_0x281987['model']],'as':_0x281987['as'],'attributes':_0x281987[_0x2594('0x1a')],'include':_0x281987[_0x2594('0x1c')]?_['map'](_0x281987[_0x2594('0x1c')],function(_0x48a306){return{'model':db[_0x48a306[_0x2594('0x1d')]],'as':_0x48a306['as'],'attributes':_0x48a306[_0x2594('0x1a')],'include':_0x48a306[_0x2594('0x1c')]?_[_0x2594('0x1e')](_0x48a306[_0x2594('0x1c')],function(_0xf60655){return{'model':db[_0xf60655[_0x2594('0x1d')]],'as':_0xf60655['as'],'attributes':_0xf60655[_0x2594('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a1058){logger['info']('GetZohoAccount',_0x457beb);logger[_0x2594('0xf')](_0x2594('0x15'),_0x457beb,JSON['stringify'](_0x3a1058));_0x31f24a(_0x3a1058);})[_0x2594('0x14')](function(_0xa8ee54){logger['error'](_0x2594('0x15'),_0xa8ee54[_0x2594('0x12')],_0x457beb);_0x373533(_0x223099[_0x2594('0x11')](0x1f4,_0xa8ee54[_0x2594('0x12')]));});});};exports['ShowZohoAccount']=function(_0x43ac77){var _0x139602=this;return new Promise(function(_0x2737ea,_0x11133a){return db[_0x2594('0x16')]['find']({'raw':_0x43ac77[_0x2594('0x18')]?_0x43ac77[_0x2594('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x43ac77['options']?_0x43ac77[_0x2594('0x18')][_0x2594('0x19')]||null:null,'attributes':_0x43ac77[_0x2594('0x18')]?_0x43ac77[_0x2594('0x18')]['attributes']||null:null,'include':_0x43ac77[_0x2594('0x18')]?_0x43ac77[_0x2594('0x18')]['include']?_['map'](_0x43ac77['options']['include'],function(_0x597915){return{'model':db[_0x597915[_0x2594('0x1d')]],'as':_0x597915['as'],'attributes':_0x597915[_0x2594('0x1a')],'include':_0x597915[_0x2594('0x1c')]?_[_0x2594('0x1e')](_0x597915[_0x2594('0x1c')],function(_0x20e253){return{'model':db[_0x20e253[_0x2594('0x1d')]],'as':_0x20e253['as'],'attributes':_0x20e253[_0x2594('0x1a')],'include':_0x20e253[_0x2594('0x1c')]?_[_0x2594('0x1e')](_0x20e253[_0x2594('0x1c')],function(_0x4271fd){return{'model':db[_0x4271fd[_0x2594('0x1d')]],'as':_0x4271fd['as'],'attributes':_0x4271fd[_0x2594('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2594('0x1f')](function(_0x5b9052){logger['info'](_0x2594('0x20'),_0x43ac77);logger[_0x2594('0xf')](_0x2594('0x20'),_0x43ac77,JSON[_0x2594('0x10')](_0x5b9052));_0x2737ea(_0x5b9052);})[_0x2594('0x14')](function(_0x2e975b){logger[_0x2594('0x11')](_0x2594('0x20'),_0x2e975b[_0x2594('0x12')],_0x43ac77);_0x11133a(_0x139602['error'](0x1f4,_0x2e975b['message']));});});}; \ No newline at end of file +var _0xf0f4=['catch','GetZohoAccount','findAll','options','raw','attributes','include','map','model','ShowZohoAccount','ZohoAccount','find','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x15fc07,_0x41cc0c){var _0x3d2c0f=function(_0x2a9a17){while(--_0x2a9a17){_0x15fc07['push'](_0x15fc07['shift']());}};_0x3d2c0f(++_0x41cc0c);}(_0xf0f4,0x182));var _0x4f0f=function(_0x3504ea,_0x5c57d9){_0x3504ea=_0x3504ea-0x0;var _0x318065=_0xf0f4[_0x3504ea];return _0x318065;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f0f('0x1'));var fs=require('fs');var Redis=require(_0x4f0f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f0f('0x3'));var logger=require(_0x4f0f('0x4'))(_0x4f0f('0x5'));var config=require(_0x4f0f('0x6'));var jayson=require(_0x4f0f('0x7'));var client=jayson[_0x4f0f('0x8')][_0x4f0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47faf5,_0x39ad76,_0x1dd6bd){return new BPromise(function(_0x95b1cf,_0x5da92f){return client[_0x4f0f('0xa')](_0x47faf5,_0x1dd6bd)[_0x4f0f('0xb')](function(_0x19cecb){logger[_0x4f0f('0xc')](_0x4f0f('0xd'),_0x39ad76,_0x4f0f('0xe'));logger[_0x4f0f('0xf')](_0x4f0f('0x10'),_0x39ad76,'request\x20sent',JSON[_0x4f0f('0x11')](_0x19cecb));if(_0x19cecb[_0x4f0f('0x12')]){if(_0x19cecb[_0x4f0f('0x12')][_0x4f0f('0x13')]===0x1f4){logger[_0x4f0f('0x12')](_0x4f0f('0xd'),_0x39ad76,_0x19cecb[_0x4f0f('0x12')][_0x4f0f('0x14')]);return _0x5da92f(_0x19cecb[_0x4f0f('0x12')][_0x4f0f('0x14')]);}logger[_0x4f0f('0x12')]('ZohoAccount,\x20%s,\x20%s',_0x39ad76,_0x19cecb[_0x4f0f('0x12')][_0x4f0f('0x14')]);return _0x95b1cf(_0x19cecb[_0x4f0f('0x12')][_0x4f0f('0x14')]);}else{logger['info'](_0x4f0f('0xd'),_0x39ad76,_0x4f0f('0xe'));_0x95b1cf(_0x19cecb[_0x4f0f('0x15')][_0x4f0f('0x14')]);}})[_0x4f0f('0x16')](function(_0x5f171b){logger[_0x4f0f('0x12')](_0x4f0f('0xd'),_0x39ad76,_0x5f171b);_0x5da92f(_0x5f171b);});});}exports[_0x4f0f('0x17')]=function(_0x566049){var _0x2ca0b3=this;return new Promise(function(_0x86186f,_0x15ba1f){return db['ZohoAccount'][_0x4f0f('0x18')]({'raw':_0x566049[_0x4f0f('0x19')]?_0x566049[_0x4f0f('0x19')][_0x4f0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x566049[_0x4f0f('0x19')]?_0x566049[_0x4f0f('0x19')]['where']||null:null,'attributes':_0x566049[_0x4f0f('0x19')]?_0x566049['options'][_0x4f0f('0x1b')]||null:null,'limit':_0x566049[_0x4f0f('0x19')]?_0x566049['options']['limit']||null:null,'include':_0x566049[_0x4f0f('0x19')]?_0x566049['options'][_0x4f0f('0x1c')]?_[_0x4f0f('0x1d')](_0x566049[_0x4f0f('0x19')][_0x4f0f('0x1c')],function(_0x454720){return{'model':db[_0x454720[_0x4f0f('0x1e')]],'as':_0x454720['as'],'attributes':_0x454720['attributes'],'include':_0x454720[_0x4f0f('0x1c')]?_[_0x4f0f('0x1d')](_0x454720[_0x4f0f('0x1c')],function(_0x3bc77d){return{'model':db[_0x3bc77d[_0x4f0f('0x1e')]],'as':_0x3bc77d['as'],'attributes':_0x3bc77d[_0x4f0f('0x1b')],'include':_0x3bc77d[_0x4f0f('0x1c')]?_[_0x4f0f('0x1d')](_0x3bc77d[_0x4f0f('0x1c')],function(_0xb20be9){return{'model':db[_0xb20be9[_0x4f0f('0x1e')]],'as':_0xb20be9['as'],'attributes':_0xb20be9[_0x4f0f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f0f('0xb')](function(_0x5c13d1){logger[_0x4f0f('0xc')](_0x4f0f('0x17'),_0x566049);logger[_0x4f0f('0xf')]('GetZohoAccount',_0x566049,JSON[_0x4f0f('0x11')](_0x5c13d1));_0x86186f(_0x5c13d1);})['catch'](function(_0x449788){logger[_0x4f0f('0x12')]('GetZohoAccount',_0x449788['message'],_0x566049);_0x15ba1f(_0x2ca0b3[_0x4f0f('0x12')](0x1f4,_0x449788['message']));});});};exports[_0x4f0f('0x1f')]=function(_0x9319c0){var _0x514a2c=this;return new Promise(function(_0x3d3762,_0xf7acac){return db[_0x4f0f('0x20')][_0x4f0f('0x21')]({'raw':_0x9319c0['options']?_0x9319c0[_0x4f0f('0x19')][_0x4f0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x9319c0[_0x4f0f('0x19')]?_0x9319c0[_0x4f0f('0x19')]['where']||null:null,'attributes':_0x9319c0[_0x4f0f('0x19')]?_0x9319c0[_0x4f0f('0x19')][_0x4f0f('0x1b')]||null:null,'include':_0x9319c0['options']?_0x9319c0[_0x4f0f('0x19')][_0x4f0f('0x1c')]?_['map'](_0x9319c0[_0x4f0f('0x19')][_0x4f0f('0x1c')],function(_0x507277){return{'model':db[_0x507277[_0x4f0f('0x1e')]],'as':_0x507277['as'],'attributes':_0x507277['attributes'],'include':_0x507277[_0x4f0f('0x1c')]?_[_0x4f0f('0x1d')](_0x507277[_0x4f0f('0x1c')],function(_0xa790fa){return{'model':db[_0xa790fa[_0x4f0f('0x1e')]],'as':_0xa790fa['as'],'attributes':_0xa790fa[_0x4f0f('0x1b')],'include':_0xa790fa[_0x4f0f('0x1c')]?_[_0x4f0f('0x1d')](_0xa790fa['include'],function(_0x156d22){return{'model':db[_0x156d22[_0x4f0f('0x1e')]],'as':_0x156d22['as'],'attributes':_0x156d22[_0x4f0f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f0f('0xb')](function(_0x122d51){logger[_0x4f0f('0xc')](_0x4f0f('0x1f'),_0x9319c0);logger['debug'](_0x4f0f('0x1f'),_0x9319c0,JSON[_0x4f0f('0x11')](_0x122d51));_0x3d3762(_0x122d51);})[_0x4f0f('0x16')](function(_0x563847){logger[_0x4f0f('0x12')]('ShowZohoAccount',_0x563847[_0x4f0f('0x14')],_0x9319c0);_0xf7acac(_0x514a2c['error'](0x1f4,_0x563847[_0x4f0f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 9e20e17..ed6d678 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 _0x52b6=['../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x1373da,_0x286fce){var _0x467edc=function(_0x22a2ef){while(--_0x22a2ef){_0x1373da['push'](_0x1373da['shift']());}};_0x467edc(++_0x286fce);}(_0x52b6,0xc0));var _0x652b=function(_0x58a323,_0x5e1861){_0x58a323=_0x58a323-0x0;var _0x101356=_0x52b6[_0x58a323];return _0x101356;};'use strict';var multer=require(_0x652b('0x0'));var util=require(_0x652b('0x1'));var path=require(_0x652b('0x2'));var timeout=require('connect-timeout');var express=require(_0x652b('0x3'));var router=express[_0x652b('0x4')]();var fs_extra=require(_0x652b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x652b('0x6'));var controller=require(_0x652b('0x7'));router[_0x652b('0x8')]('/',auth['isAuthenticated'](),controller[_0x652b('0x9')]);router['get'](_0x652b('0xa'),auth[_0x652b('0xb')](),controller[_0x652b('0xc')]);router[_0x652b('0x8')]('/:id/fields',auth[_0x652b('0xb')](),controller[_0x652b('0xd')]);router[_0x652b('0x8')](_0x652b('0xe'),auth[_0x652b('0xb')](),controller[_0x652b('0xf')]);router[_0x652b('0x8')]('/:id/descriptions',auth[_0x652b('0xb')](),controller[_0x652b('0x10')]);router[_0x652b('0x11')]('/',auth['isAuthenticated'](),controller[_0x652b('0x12')]);router[_0x652b('0x13')](_0x652b('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x652b('0x14')]);module[_0x652b('0x15')]=router; \ No newline at end of file +var _0x3e1e=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','get'];(function(_0xe64b4,_0x2e1eac){var _0x27343e=function(_0x4c1ea9){while(--_0x4c1ea9){_0xe64b4['push'](_0xe64b4['shift']());}};_0x27343e(++_0x2e1eac);}(_0x3e1e,0xa6));var _0xe3e1=function(_0x2fd9f9,_0x5d0440){_0x2fd9f9=_0x2fd9f9-0x0;var _0x28eec0=_0x3e1e[_0x2fd9f9];return _0x28eec0;};'use strict';var multer=require(_0xe3e1('0x0'));var util=require('util');var path=require(_0xe3e1('0x1'));var timeout=require(_0xe3e1('0x2'));var express=require(_0xe3e1('0x3'));var router=express[_0xe3e1('0x4')]();var fs_extra=require(_0xe3e1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe3e1('0x6'));var controller=require(_0xe3e1('0x7'));router['get']('/',auth[_0xe3e1('0x8')](),controller['index']);router[_0xe3e1('0x9')](_0xe3e1('0xa'),auth[_0xe3e1('0x8')](),controller[_0xe3e1('0xb')]);router['get'](_0xe3e1('0xc'),auth[_0xe3e1('0x8')](),controller[_0xe3e1('0xd')]);router[_0xe3e1('0x9')](_0xe3e1('0xe'),auth[_0xe3e1('0x8')](),controller['getSubjects']);router[_0xe3e1('0x9')](_0xe3e1('0xf'),auth['isAuthenticated'](),controller[_0xe3e1('0x10')]);router[_0xe3e1('0x11')]('/',auth[_0xe3e1('0x8')](),controller[_0xe3e1('0x12')]);router[_0xe3e1('0x13')]('/:id',auth[_0xe3e1('0x8')](),controller['update']);router[_0xe3e1('0x14')]('/:id',auth[_0xe3e1('0x8')](),controller[_0xe3e1('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 63a2986..13ed7b6 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 _0x0d05=['ENUM','lead','nothing','contact_lead','contact','sequelize','exports','STRING'];(function(_0x42884c,_0x4dfaf7){var _0x29b205=function(_0x586265){while(--_0x586265){_0x42884c['push'](_0x42884c['shift']());}};_0x29b205(++_0x4dfaf7);}(_0x0d05,0xed));var _0x50d0=function(_0x2e5baf,_0x4b77a1){_0x2e5baf=_0x2e5baf-0x0;var _0x4c0797=_0x0d05[_0x2e5baf];return _0x4c0797;};'use strict';var Sequelize=require(_0x50d0('0x0'));module[_0x50d0('0x1')]={'name':{'type':Sequelize[_0x50d0('0x2')]},'moduleCreate':{'type':Sequelize[_0x50d0('0x3')](_0x50d0('0x4'),'contact',_0x50d0('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x50d0('0x3')](_0x50d0('0x6'),_0x50d0('0x7'),_0x50d0('0x4')),'defaultValue':_0x50d0('0x6')},'description':{'type':Sequelize[_0x50d0('0x2')]}}; \ No newline at end of file +var _0x4371=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x4371,0x8a));var _0x1437=function(_0x4f7e4f,_0xebbe5d){_0x4f7e4f=_0x4f7e4f-0x0;var _0x5ec1ed=_0x4371[_0x4f7e4f];return _0x5ec1ed;};'use strict';var Sequelize=require(_0x1437('0x0'));module[_0x1437('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x1437('0x2')](_0x1437('0x3'),_0x1437('0x4'),_0x1437('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x1437('0x4'),_0x1437('0x3')),'defaultValue':_0x1437('0x6')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 483a3e5..337da0d 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 _0x39b3=['reject','save','update','destroy','then','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','keys','find','create','body','params','getFields','findOne','ZohoField','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x47a9fc,_0x32a6ee){var _0x4a3b3b=function(_0x128066){while(--_0x128066){_0x47a9fc['push'](_0x47a9fc['shift']());}};_0x4a3b3b(++_0x32a6ee);}(_0x39b3,0x80));var _0x339b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x39b3[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x339b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x339b('0x1'));var jsonpatch=require(_0x339b('0x2'));var rp=require(_0x339b('0x3'));var moment=require('moment');var BPromise=require(_0x339b('0x4'));var Mustache=require(_0x339b('0x5'));var util=require(_0x339b('0x6'));var path=require('path');var sox=require(_0x339b('0x7'));var csv=require(_0x339b('0x8'));var ejs=require(_0x339b('0x9'));var fs=require('fs');var fs_extra=require(_0x339b('0xa'));var _=require(_0x339b('0xb'));var squel=require(_0x339b('0xc'));var crypto=require(_0x339b('0xd'));var jsforce=require(_0x339b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x339b('0x8'));var querystring=require(_0x339b('0xf'));var Papa=require(_0x339b('0x10'));var Redis=require(_0x339b('0x11'));var authService=require(_0x339b('0x12'));var qs=require(_0x339b('0x13'));var as=require(_0x339b('0x14'));var hardwareService=require(_0x339b('0x15'));var logger=require(_0x339b('0x16'))('api');var utils=require(_0x339b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x339b('0x18'));var db=require(_0x339b('0x19'))['db'];function respondWithStatusCode(_0xa58852,_0xce1f05){_0xce1f05=_0xce1f05||0xcc;return function(_0x3e5fa6){if(_0x3e5fa6){return _0xa58852[_0x339b('0x1a')](_0xce1f05);}return _0xa58852[_0x339b('0x1b')](_0xce1f05)['end']();};}function respondWithResult(_0x199712,_0x508c26){_0x508c26=_0x508c26||0xc8;return function(_0x4e0bc4){if(_0x4e0bc4){return _0x199712['status'](_0x508c26)[_0x339b('0x1c')](_0x4e0bc4);}};}function respondWithFilteredResult(_0x4f3c5e,_0x3c2ab4){return function(_0x2c1aa0){if(_0x2c1aa0){var _0x2169b5=typeof _0x3c2ab4['offset']===_0x339b('0x1d')&&typeof _0x3c2ab4[_0x339b('0x1e')]===_0x339b('0x1d');var _0x376dfa=_0x2c1aa0[_0x339b('0x1f')];var _0x238edc=_0x2169b5?0x0:_0x3c2ab4['offset'];var _0x25954f=_0x2169b5?_0x2c1aa0[_0x339b('0x1f')]:_0x3c2ab4[_0x339b('0x20')]+_0x3c2ab4[_0x339b('0x1e')];var _0x178baf;if(_0x25954f>=_0x376dfa){_0x25954f=_0x376dfa;_0x178baf=0xc8;}else{_0x178baf=0xce;}_0x4f3c5e[_0x339b('0x1b')](_0x178baf);return _0x4f3c5e[_0x339b('0x21')](_0x339b('0x22'),_0x238edc+'-'+_0x25954f+'/'+_0x376dfa)['json'](_0x2c1aa0);}return null;};}function patchUpdates(_0x15b52e){return function(_0x173496){try{jsonpatch[_0x339b('0x23')](_0x173496,_0x15b52e,!![]);}catch(_0x57394b){return BPromise[_0x339b('0x24')](_0x57394b);}return _0x173496[_0x339b('0x25')]();};}function saveUpdates(_0x13576c,_0xeaf8e0){return function(_0x43bbcf){if(_0x43bbcf){return _0x43bbcf[_0x339b('0x26')](_0x13576c)['then'](function(_0x4086be){return _0x4086be;});}return null;};}function removeEntity(_0x2cce8b,_0x1150c0){return function(_0x3b1baa){if(_0x3b1baa){return _0x3b1baa[_0x339b('0x27')]()[_0x339b('0x28')](function(){_0x2cce8b[_0x339b('0x1b')](0xcc)[_0x339b('0x29')]();});}};}function handleEntityNotFound(_0x2d4f89,_0x4ab59c){return function(_0x2dd84e){if(!_0x2dd84e){_0x2d4f89[_0x339b('0x1a')](0x194);}return _0x2dd84e;};}function handleError(_0x13774c,_0x29da27){_0x29da27=_0x29da27||0x1f4;return function(_0x45ae58){logger[_0x339b('0x2a')](_0x45ae58[_0x339b('0x2b')]);if(_0x45ae58[_0x339b('0x2c')]){delete _0x45ae58['name'];}_0x13774c[_0x339b('0x1b')](_0x29da27)[_0x339b('0x2d')](_0x45ae58);};}exports['index']=function(_0xbcbe75,_0xbf455e){var _0x39949c={},_0xdd5a84={},_0x50e74e={'count':0x0,'rows':[]};var _0x57c795=_[_0x339b('0x2e')](db['ZohoConfiguration'][_0x339b('0x2f')],function(_0x24a52b){return{'name':_0x24a52b[_0x339b('0x30')],'type':_0x24a52b['type'][_0x339b('0x31')]};});_0xdd5a84['model']=_[_0x339b('0x2e')](_0x57c795,_0x339b('0x2c'));_0xdd5a84[_0x339b('0x32')]=_['keys'](_0xbcbe75[_0x339b('0x32')]);_0xdd5a84[_0x339b('0x33')]=_['intersection'](_0xdd5a84[_0x339b('0x34')],_0xdd5a84[_0x339b('0x32')]);_0x39949c[_0x339b('0x35')]=_[_0x339b('0x36')](_0xdd5a84[_0x339b('0x34')],qs[_0x339b('0x37')](_0xbcbe75[_0x339b('0x32')]['fields']));_0x39949c[_0x339b('0x35')]=_0x39949c[_0x339b('0x35')][_0x339b('0x38')]?_0x39949c[_0x339b('0x35')]:_0xdd5a84[_0x339b('0x34')];if(!_0xbcbe75[_0x339b('0x32')][_0x339b('0x39')]('nolimit')){_0x39949c['limit']=qs[_0x339b('0x1e')](_0xbcbe75['query'][_0x339b('0x1e')]);_0x39949c[_0x339b('0x20')]=qs[_0x339b('0x20')](_0xbcbe75['query'][_0x339b('0x20')]);}_0x39949c[_0x339b('0x3a')]=qs[_0x339b('0x3b')](_0xbcbe75['query']['sort']);_0x39949c[_0x339b('0x3c')]=qs[_0x339b('0x33')](_[_0x339b('0x3d')](_0xbcbe75['query'],_0xdd5a84['filters']),_0x57c795);if(_0xbcbe75[_0x339b('0x32')][_0x339b('0x3e')]){_0x39949c[_0x339b('0x3c')]=_[_0x339b('0x3f')](_0x39949c[_0x339b('0x3c')],{'$or':_[_0x339b('0x2e')](_0x57c795,function(_0x4d5b1c){if(_0x4d5b1c['type']!=='VIRTUAL'){var _0x3c4f45={};_0x3c4f45[_0x4d5b1c[_0x339b('0x2c')]]={'$like':'%'+_0xbcbe75[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x3c4f45;}})});}_0x39949c=_[_0x339b('0x3f')]({},_0x39949c,_0xbcbe75[_0x339b('0x40')]);var _0x3ce9e1={'where':_0x39949c['where']};return db[_0x339b('0x41')][_0x339b('0x1f')](_0x3ce9e1)[_0x339b('0x28')](function(_0x475685){_0x50e74e[_0x339b('0x1f')]=_0x475685;if(_0xbcbe75[_0x339b('0x32')][_0x339b('0x42')]){_0x39949c[_0x339b('0x43')]=[{'all':!![]}];}return db[_0x339b('0x41')][_0x339b('0x44')](_0x39949c);})[_0x339b('0x28')](function(_0x509021){_0x50e74e[_0x339b('0x45')]=_0x509021;return _0x50e74e;})[_0x339b('0x28')](respondWithFilteredResult(_0xbf455e,_0x39949c))[_0x339b('0x46')](handleError(_0xbf455e,null));};exports['show']=function(_0x5dc4c4,_0x26b19e){var _0x5d179d={'raw':![],'where':{'id':_0x5dc4c4['params']['id']}},_0xc7beea={};_0xc7beea['model']=_[_0x339b('0x47')](db[_0x339b('0x41')]['rawAttributes']);_0xc7beea[_0x339b('0x32')]=_[_0x339b('0x47')](_0x5dc4c4['query']);_0xc7beea[_0x339b('0x33')]=_[_0x339b('0x36')](_0xc7beea[_0x339b('0x34')],_0xc7beea[_0x339b('0x32')]);_0x5d179d['attributes']=_[_0x339b('0x36')](_0xc7beea[_0x339b('0x34')],qs[_0x339b('0x37')](_0x5dc4c4[_0x339b('0x32')]['fields']));_0x5d179d[_0x339b('0x35')]=_0x5d179d['attributes'][_0x339b('0x38')]?_0x5d179d['attributes']:_0xc7beea[_0x339b('0x34')];if(_0x5dc4c4[_0x339b('0x32')][_0x339b('0x42')]){_0x5d179d[_0x339b('0x43')]=[{'all':!![]}];}_0x5d179d=_['merge']({},_0x5d179d,_0x5dc4c4['options']);return db['ZohoConfiguration'][_0x339b('0x48')](_0x5d179d)[_0x339b('0x28')](handleEntityNotFound(_0x26b19e,null))[_0x339b('0x28')](respondWithResult(_0x26b19e,null))[_0x339b('0x46')](handleError(_0x26b19e,null));};exports[_0x339b('0x49')]=function(_0x4a32a5,_0x53a376){return db[_0x339b('0x41')]['create'](_0x4a32a5['body'],{})['then'](respondWithResult(_0x53a376,0xc9))['catch'](handleError(_0x53a376,null));};exports[_0x339b('0x26')]=function(_0x560d38,_0x3a95ff){if(_0x560d38['body']['id']){delete _0x560d38[_0x339b('0x4a')]['id'];}return db[_0x339b('0x41')][_0x339b('0x48')]({'where':{'id':_0x560d38[_0x339b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a95ff,null))[_0x339b('0x28')](saveUpdates(_0x560d38[_0x339b('0x4a')],null))[_0x339b('0x28')](respondWithResult(_0x3a95ff,null))['catch'](handleError(_0x3a95ff,null));};exports[_0x339b('0x27')]=function(_0x9b623f,_0x5688e6){return db[_0x339b('0x41')][_0x339b('0x48')]({'where':{'id':_0x9b623f[_0x339b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5688e6,null))[_0x339b('0x28')](removeEntity(_0x5688e6,null))[_0x339b('0x46')](handleError(_0x5688e6,null));};exports[_0x339b('0x4c')]=function(_0x1cffc8,_0x1035c8,_0x2e7cf0){var _0x175dcc={};var _0x4fcc69={};var _0x26aae0;var _0x3c34e3;return db[_0x339b('0x41')][_0x339b('0x4d')]({'where':{'id':_0x1cffc8[_0x339b('0x4b')]['id']}})[_0x339b('0x28')](handleEntityNotFound(_0x1035c8,null))['then'](function(_0x16719d){if(_0x16719d){_0x26aae0=_0x16719d;_0x4fcc69['model']=_[_0x339b('0x47')](db[_0x339b('0x4e')][_0x339b('0x2f')]);_0x4fcc69['query']=_[_0x339b('0x47')](_0x1cffc8['query']);_0x4fcc69[_0x339b('0x33')]=_[_0x339b('0x36')](_0x4fcc69[_0x339b('0x34')],_0x4fcc69[_0x339b('0x32')]);_0x175dcc['attributes']=_[_0x339b('0x36')](_0x4fcc69[_0x339b('0x34')],qs['fields'](_0x1cffc8['query']['fields']));_0x175dcc[_0x339b('0x35')]=_0x175dcc[_0x339b('0x35')][_0x339b('0x38')]?_0x175dcc[_0x339b('0x35')]:_0x4fcc69['model'];_0x175dcc[_0x339b('0x3a')]=qs['sort'](_0x1cffc8[_0x339b('0x32')][_0x339b('0x3b')]);_0x175dcc['where']=qs[_0x339b('0x33')](_[_0x339b('0x3d')](_0x1cffc8[_0x339b('0x32')],_0x4fcc69[_0x339b('0x33')]));if(_0x1cffc8[_0x339b('0x32')][_0x339b('0x3e')]){_0x175dcc['where']=_['merge'](_0x175dcc['where'],{'$or':_[_0x339b('0x2e')](_0x175dcc[_0x339b('0x35')],function(_0x38c233){var _0x3c9389={};_0x3c9389[_0x38c233]={'$like':'%'+_0x1cffc8[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x3c9389;})});}_0x175dcc=_['merge']({},_0x175dcc,_0x1cffc8[_0x339b('0x40')]);return _0x26aae0[_0x339b('0x4c')](_0x175dcc);}})[_0x339b('0x28')](function(_0x403037){if(_0x403037){_0x3c34e3=_0x403037[_0x339b('0x38')];if(!_0x1cffc8[_0x339b('0x32')][_0x339b('0x39')](_0x339b('0x4f'))){_0x175dcc['limit']=qs[_0x339b('0x1e')](_0x1cffc8[_0x339b('0x32')][_0x339b('0x1e')]);_0x175dcc[_0x339b('0x20')]=qs['offset'](_0x1cffc8['query']['offset']);}return _0x26aae0['getFields'](_0x175dcc);}})[_0x339b('0x28')](function(_0x707f0a){if(_0x707f0a){return _0x707f0a?{'count':_0x3c34e3,'rows':_0x707f0a}:null;}})[_0x339b('0x28')](respondWithResult(_0x1035c8,null))[_0x339b('0x46')](handleError(_0x1035c8,null));};exports[_0x339b('0x50')]=function(_0x3b9bf8,_0x16f1c1,_0x45adba){var _0x50a47a={};var _0x231abb={};var _0x247cfc;var _0x4ee2ed;return db['ZohoConfiguration'][_0x339b('0x4d')]({'where':{'id':_0x3b9bf8[_0x339b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x16f1c1,null))[_0x339b('0x28')](function(_0x293a9c){if(_0x293a9c){_0x247cfc=_0x293a9c;_0x231abb[_0x339b('0x34')]=_[_0x339b('0x47')](db[_0x339b('0x4e')]['rawAttributes']);_0x231abb[_0x339b('0x32')]=_[_0x339b('0x47')](_0x3b9bf8[_0x339b('0x32')]);_0x231abb['filters']=_[_0x339b('0x36')](_0x231abb[_0x339b('0x34')],_0x231abb[_0x339b('0x32')]);_0x50a47a[_0x339b('0x35')]=_[_0x339b('0x36')](_0x231abb[_0x339b('0x34')],qs[_0x339b('0x37')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x37')]));_0x50a47a[_0x339b('0x35')]=_0x50a47a[_0x339b('0x35')][_0x339b('0x38')]?_0x50a47a['attributes']:_0x231abb['model'];_0x50a47a[_0x339b('0x3a')]=qs[_0x339b('0x3b')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x3b')]);_0x50a47a[_0x339b('0x3c')]=qs[_0x339b('0x33')](_[_0x339b('0x3d')](_0x3b9bf8[_0x339b('0x32')],_0x231abb[_0x339b('0x33')]));if(_0x3b9bf8['query']['filter']){_0x50a47a[_0x339b('0x3c')]=_[_0x339b('0x3f')](_0x50a47a[_0x339b('0x3c')],{'$or':_['map'](_0x50a47a['attributes'],function(_0x1587db){var _0x450fd3={};_0x450fd3[_0x1587db]={'$like':'%'+_0x3b9bf8[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x450fd3;})});}_0x50a47a=_[_0x339b('0x3f')]({},_0x50a47a,_0x3b9bf8[_0x339b('0x40')]);return _0x247cfc[_0x339b('0x50')](_0x50a47a);}})['then'](function(_0x50de3b){if(_0x50de3b){_0x4ee2ed=_0x50de3b[_0x339b('0x38')];if(!_0x3b9bf8[_0x339b('0x32')][_0x339b('0x39')](_0x339b('0x4f'))){_0x50a47a['limit']=qs[_0x339b('0x1e')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x1e')]);_0x50a47a[_0x339b('0x20')]=qs[_0x339b('0x20')](_0x3b9bf8[_0x339b('0x32')][_0x339b('0x20')]);}return _0x247cfc[_0x339b('0x50')](_0x50a47a);}})['then'](function(_0x4a0388){if(_0x4a0388){return _0x4a0388?{'count':_0x4ee2ed,'rows':_0x4a0388}:null;}})['then'](respondWithResult(_0x16f1c1,null))[_0x339b('0x46')](handleError(_0x16f1c1,null));};exports['getDescriptions']=function(_0x1840fa,_0x5c8fa2,_0x41ec2d){var _0x2c1488={};var _0x3d1493={};var _0xab856c;var _0x1a2bbb;return db[_0x339b('0x41')]['findOne']({'where':{'id':_0x1840fa[_0x339b('0x4b')]['id']}})[_0x339b('0x28')](handleEntityNotFound(_0x5c8fa2,null))['then'](function(_0x319a2e){if(_0x319a2e){_0xab856c=_0x319a2e;_0x3d1493[_0x339b('0x34')]=_[_0x339b('0x47')](db[_0x339b('0x4e')][_0x339b('0x2f')]);_0x3d1493[_0x339b('0x32')]=_[_0x339b('0x47')](_0x1840fa[_0x339b('0x32')]);_0x3d1493[_0x339b('0x33')]=_[_0x339b('0x36')](_0x3d1493[_0x339b('0x34')],_0x3d1493[_0x339b('0x32')]);_0x2c1488['attributes']=_['intersection'](_0x3d1493['model'],qs['fields'](_0x1840fa[_0x339b('0x32')]['fields']));_0x2c1488['attributes']=_0x2c1488[_0x339b('0x35')][_0x339b('0x38')]?_0x2c1488[_0x339b('0x35')]:_0x3d1493['model'];_0x2c1488[_0x339b('0x3a')]=qs[_0x339b('0x3b')](_0x1840fa[_0x339b('0x32')][_0x339b('0x3b')]);_0x2c1488[_0x339b('0x3c')]=qs['filters'](_[_0x339b('0x3d')](_0x1840fa['query'],_0x3d1493['filters']));if(_0x1840fa[_0x339b('0x32')][_0x339b('0x3e')]){_0x2c1488[_0x339b('0x3c')]=_[_0x339b('0x3f')](_0x2c1488[_0x339b('0x3c')],{'$or':_[_0x339b('0x2e')](_0x2c1488[_0x339b('0x35')],function(_0x2c475f){var _0x5f6130={};_0x5f6130[_0x2c475f]={'$like':'%'+_0x1840fa[_0x339b('0x32')][_0x339b('0x3e')]+'%'};return _0x5f6130;})});}_0x2c1488=_[_0x339b('0x3f')]({},_0x2c1488,_0x1840fa['options']);return _0xab856c[_0x339b('0x51')](_0x2c1488);}})[_0x339b('0x28')](function(_0x1db8cb){if(_0x1db8cb){_0x1a2bbb=_0x1db8cb['length'];if(!_0x1840fa[_0x339b('0x32')][_0x339b('0x39')](_0x339b('0x4f'))){_0x2c1488[_0x339b('0x1e')]=qs[_0x339b('0x1e')](_0x1840fa[_0x339b('0x32')][_0x339b('0x1e')]);_0x2c1488['offset']=qs['offset'](_0x1840fa[_0x339b('0x32')][_0x339b('0x20')]);}return _0xab856c[_0x339b('0x51')](_0x2c1488);}})[_0x339b('0x28')](function(_0x4f873a){if(_0x4f873a){return _0x4f873a?{'count':_0x1a2bbb,'rows':_0x4f873a}:null;}})[_0x339b('0x28')](respondWithResult(_0x5c8fa2,null))['catch'](handleError(_0x5c8fa2,null));}; \ No newline at end of file +var _0x2826=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','getFields','findOne','length','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x2fb5d0,_0x217946){var _0x2206f=function(_0x253513){while(--_0x253513){_0x2fb5d0['push'](_0x2fb5d0['shift']());}};_0x2206f(++_0x217946);}(_0x2826,0xdf));var _0x6282=function(_0x37a671,_0x1697f7){_0x37a671=_0x37a671-0x0;var _0x501428=_0x2826[_0x37a671];return _0x501428;};'use strict';var emlformat=require(_0x6282('0x0'));var rimraf=require(_0x6282('0x1'));var zipdir=require(_0x6282('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6282('0x3'));var BPromise=require(_0x6282('0x4'));var Mustache=require('mustache');var util=require(_0x6282('0x5'));var path=require('path');var sox=require(_0x6282('0x6'));var csv=require(_0x6282('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6282('0x8'));var _=require(_0x6282('0x9'));var squel=require(_0x6282('0xa'));var crypto=require(_0x6282('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6282('0xc'));var toCsv=require(_0x6282('0x7'));var querystring=require('querystring');var Papa=require(_0x6282('0xd'));var Redis=require(_0x6282('0xe'));var authService=require(_0x6282('0xf'));var qs=require(_0x6282('0x10'));var as=require(_0x6282('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6282('0x12'))(_0x6282('0x13'));var utils=require(_0x6282('0x14'));var config=require(_0x6282('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6282('0x16'))['db'];function respondWithStatusCode(_0x40dd60,_0x137a08){_0x137a08=_0x137a08||0xcc;return function(_0x104ebc){if(_0x104ebc){return _0x40dd60[_0x6282('0x17')](_0x137a08);}return _0x40dd60[_0x6282('0x18')](_0x137a08)[_0x6282('0x19')]();};}function respondWithResult(_0x33f9a7,_0x3839f4){_0x3839f4=_0x3839f4||0xc8;return function(_0x38b6a9){if(_0x38b6a9){return _0x33f9a7[_0x6282('0x18')](_0x3839f4)[_0x6282('0x1a')](_0x38b6a9);}};}function respondWithFilteredResult(_0x1fac95,_0x170a24){return function(_0x5dfe26){if(_0x5dfe26){var _0x132447=typeof _0x170a24['offset']===_0x6282('0x1b')&&typeof _0x170a24[_0x6282('0x1c')]===_0x6282('0x1b');var _0x4a857d=_0x5dfe26[_0x6282('0x1d')];var _0x238cd7=_0x132447?0x0:_0x170a24[_0x6282('0x1e')];var _0x34d94f=_0x132447?_0x5dfe26[_0x6282('0x1d')]:_0x170a24[_0x6282('0x1e')]+_0x170a24[_0x6282('0x1c')];var _0x296f7c;if(_0x34d94f>=_0x4a857d){_0x34d94f=_0x4a857d;_0x296f7c=0xc8;}else{_0x296f7c=0xce;}_0x1fac95[_0x6282('0x18')](_0x296f7c);return _0x1fac95[_0x6282('0x1f')](_0x6282('0x20'),_0x238cd7+'-'+_0x34d94f+'/'+_0x4a857d)[_0x6282('0x1a')](_0x5dfe26);}return null;};}function patchUpdates(_0x56db61){return function(_0x273f1d){try{jsonpatch[_0x6282('0x21')](_0x273f1d,_0x56db61,!![]);}catch(_0x3401f5){return BPromise[_0x6282('0x22')](_0x3401f5);}return _0x273f1d['save']();};}function saveUpdates(_0x54e66b,_0x5b9e89){return function(_0x4027af){if(_0x4027af){return _0x4027af['update'](_0x54e66b)[_0x6282('0x23')](function(_0x333cb6){return _0x333cb6;});}return null;};}function removeEntity(_0xbba3ec,_0x41b3a2){return function(_0x25e6c2){if(_0x25e6c2){return _0x25e6c2[_0x6282('0x24')]()[_0x6282('0x23')](function(){_0xbba3ec[_0x6282('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5716f5,_0x145b31){return function(_0x53498b){if(!_0x53498b){_0x5716f5['sendStatus'](0x194);}return _0x53498b;};}function handleError(_0x25e0d3,_0x47d978){_0x47d978=_0x47d978||0x1f4;return function(_0x3afd58){logger['error'](_0x3afd58[_0x6282('0x25')]);if(_0x3afd58[_0x6282('0x26')]){delete _0x3afd58[_0x6282('0x26')];}_0x25e0d3[_0x6282('0x18')](_0x47d978)[_0x6282('0x27')](_0x3afd58);};}exports[_0x6282('0x28')]=function(_0x15ee00,_0x4f94b2){var _0x3160fd={},_0x57127c={},_0x4b1a72={'count':0x0,'rows':[]};var _0x1f1a96=_[_0x6282('0x29')](db['ZohoConfiguration'][_0x6282('0x2a')],function(_0x51136e){return{'name':_0x51136e[_0x6282('0x2b')],'type':_0x51136e[_0x6282('0x2c')][_0x6282('0x2d')]};});_0x57127c[_0x6282('0x2e')]=_['map'](_0x1f1a96,'name');_0x57127c[_0x6282('0x2f')]=_[_0x6282('0x30')](_0x15ee00['query']);_0x57127c[_0x6282('0x31')]=_[_0x6282('0x32')](_0x57127c['model'],_0x57127c[_0x6282('0x2f')]);_0x3160fd[_0x6282('0x33')]=_[_0x6282('0x32')](_0x57127c[_0x6282('0x2e')],qs['fields'](_0x15ee00[_0x6282('0x2f')][_0x6282('0x34')]));_0x3160fd[_0x6282('0x33')]=_0x3160fd[_0x6282('0x33')]['length']?_0x3160fd[_0x6282('0x33')]:_0x57127c['model'];if(!_0x15ee00[_0x6282('0x2f')][_0x6282('0x35')](_0x6282('0x36'))){_0x3160fd[_0x6282('0x1c')]=qs[_0x6282('0x1c')](_0x15ee00['query'][_0x6282('0x1c')]);_0x3160fd['offset']=qs[_0x6282('0x1e')](_0x15ee00[_0x6282('0x2f')][_0x6282('0x1e')]);}_0x3160fd[_0x6282('0x37')]=qs[_0x6282('0x38')](_0x15ee00['query']['sort']);_0x3160fd['where']=qs[_0x6282('0x31')](_[_0x6282('0x39')](_0x15ee00[_0x6282('0x2f')],_0x57127c[_0x6282('0x31')]),_0x1f1a96);if(_0x15ee00[_0x6282('0x2f')][_0x6282('0x3a')]){_0x3160fd['where']=_[_0x6282('0x3b')](_0x3160fd[_0x6282('0x3c')],{'$or':_[_0x6282('0x29')](_0x1f1a96,function(_0x577d1d){if(_0x577d1d[_0x6282('0x2c')]!==_0x6282('0x3d')){var _0x3fda03={};_0x3fda03[_0x577d1d[_0x6282('0x26')]]={'$like':'%'+_0x15ee00['query'][_0x6282('0x3a')]+'%'};return _0x3fda03;}})});}_0x3160fd=_[_0x6282('0x3b')]({},_0x3160fd,_0x15ee00[_0x6282('0x3e')]);var _0x1df5c6={'where':_0x3160fd[_0x6282('0x3c')]};return db[_0x6282('0x3f')][_0x6282('0x1d')](_0x1df5c6)[_0x6282('0x23')](function(_0x1eb969){_0x4b1a72['count']=_0x1eb969;if(_0x15ee00[_0x6282('0x2f')][_0x6282('0x40')]){_0x3160fd[_0x6282('0x41')]=[{'all':!![]}];}return db[_0x6282('0x3f')][_0x6282('0x42')](_0x3160fd);})[_0x6282('0x23')](function(_0x437a19){_0x4b1a72[_0x6282('0x43')]=_0x437a19;return _0x4b1a72;})['then'](respondWithFilteredResult(_0x4f94b2,_0x3160fd))[_0x6282('0x44')](handleError(_0x4f94b2,null));};exports[_0x6282('0x45')]=function(_0x4acce4,_0x1772c8){var _0x469379={'raw':![],'where':{'id':_0x4acce4['params']['id']}},_0x469e02={};_0x469e02[_0x6282('0x2e')]=_[_0x6282('0x30')](db['ZohoConfiguration']['rawAttributes']);_0x469e02[_0x6282('0x2f')]=_[_0x6282('0x30')](_0x4acce4[_0x6282('0x2f')]);_0x469e02[_0x6282('0x31')]=_['intersection'](_0x469e02[_0x6282('0x2e')],_0x469e02[_0x6282('0x2f')]);_0x469379['attributes']=_['intersection'](_0x469e02[_0x6282('0x2e')],qs[_0x6282('0x34')](_0x4acce4[_0x6282('0x2f')][_0x6282('0x34')]));_0x469379['attributes']=_0x469379[_0x6282('0x33')]['length']?_0x469379[_0x6282('0x33')]:_0x469e02[_0x6282('0x2e')];if(_0x4acce4[_0x6282('0x2f')][_0x6282('0x40')]){_0x469379[_0x6282('0x41')]=[{'all':!![]}];}_0x469379=_['merge']({},_0x469379,_0x4acce4['options']);return db[_0x6282('0x3f')][_0x6282('0x46')](_0x469379)[_0x6282('0x23')](handleEntityNotFound(_0x1772c8,null))['then'](respondWithResult(_0x1772c8,null))['catch'](handleError(_0x1772c8,null));};exports[_0x6282('0x47')]=function(_0x526680,_0x285e72){return db[_0x6282('0x3f')][_0x6282('0x47')](_0x526680[_0x6282('0x48')],{})[_0x6282('0x23')](respondWithResult(_0x285e72,0xc9))[_0x6282('0x44')](handleError(_0x285e72,null));};exports[_0x6282('0x49')]=function(_0x47dbea,_0x4b523d){if(_0x47dbea['body']['id']){delete _0x47dbea[_0x6282('0x48')]['id'];}return db[_0x6282('0x3f')][_0x6282('0x46')]({'where':{'id':_0x47dbea[_0x6282('0x4a')]['id']}})[_0x6282('0x23')](handleEntityNotFound(_0x4b523d,null))[_0x6282('0x23')](saveUpdates(_0x47dbea['body'],null))['then'](respondWithResult(_0x4b523d,null))[_0x6282('0x44')](handleError(_0x4b523d,null));};exports['destroy']=function(_0x540356,_0x1936e0){return db[_0x6282('0x3f')]['find']({'where':{'id':_0x540356[_0x6282('0x4a')]['id']}})[_0x6282('0x23')](handleEntityNotFound(_0x1936e0,null))[_0x6282('0x23')](removeEntity(_0x1936e0,null))[_0x6282('0x44')](handleError(_0x1936e0,null));};exports[_0x6282('0x4b')]=function(_0x36497e,_0x57b5e4,_0xc74b64){var _0x3837f2={};var _0xbf10ac={};var _0x2445f1;var _0x26064a;return db[_0x6282('0x3f')]['findOne']({'where':{'id':_0x36497e[_0x6282('0x4a')]['id']}})[_0x6282('0x23')](handleEntityNotFound(_0x57b5e4,null))['then'](function(_0x42aad1){if(_0x42aad1){_0x2445f1=_0x42aad1;_0xbf10ac['model']=_[_0x6282('0x30')](db['ZohoField']['rawAttributes']);_0xbf10ac['query']=_[_0x6282('0x30')](_0x36497e[_0x6282('0x2f')]);_0xbf10ac['filters']=_['intersection'](_0xbf10ac[_0x6282('0x2e')],_0xbf10ac[_0x6282('0x2f')]);_0x3837f2[_0x6282('0x33')]=_[_0x6282('0x32')](_0xbf10ac[_0x6282('0x2e')],qs[_0x6282('0x34')](_0x36497e[_0x6282('0x2f')][_0x6282('0x34')]));_0x3837f2[_0x6282('0x33')]=_0x3837f2[_0x6282('0x33')]['length']?_0x3837f2[_0x6282('0x33')]:_0xbf10ac['model'];_0x3837f2[_0x6282('0x37')]=qs[_0x6282('0x38')](_0x36497e[_0x6282('0x2f')]['sort']);_0x3837f2[_0x6282('0x3c')]=qs[_0x6282('0x31')](_[_0x6282('0x39')](_0x36497e[_0x6282('0x2f')],_0xbf10ac['filters']));if(_0x36497e['query'][_0x6282('0x3a')]){_0x3837f2[_0x6282('0x3c')]=_[_0x6282('0x3b')](_0x3837f2[_0x6282('0x3c')],{'$or':_['map'](_0x3837f2[_0x6282('0x33')],function(_0x39aa34){var _0x2afb5a={};_0x2afb5a[_0x39aa34]={'$like':'%'+_0x36497e[_0x6282('0x2f')][_0x6282('0x3a')]+'%'};return _0x2afb5a;})});}_0x3837f2=_[_0x6282('0x3b')]({},_0x3837f2,_0x36497e[_0x6282('0x3e')]);return _0x2445f1['getFields'](_0x3837f2);}})[_0x6282('0x23')](function(_0x5b055e){if(_0x5b055e){_0x26064a=_0x5b055e['length'];if(!_0x36497e[_0x6282('0x2f')][_0x6282('0x35')](_0x6282('0x36'))){_0x3837f2[_0x6282('0x1c')]=qs[_0x6282('0x1c')](_0x36497e[_0x6282('0x2f')]['limit']);_0x3837f2[_0x6282('0x1e')]=qs['offset'](_0x36497e[_0x6282('0x2f')][_0x6282('0x1e')]);}return _0x2445f1[_0x6282('0x4b')](_0x3837f2);}})['then'](function(_0x392f9a){if(_0x392f9a){return _0x392f9a?{'count':_0x26064a,'rows':_0x392f9a}:null;}})['then'](respondWithResult(_0x57b5e4,null))[_0x6282('0x44')](handleError(_0x57b5e4,null));};exports['getSubjects']=function(_0x46bbfc,_0x1a4290,_0x4d6d9a){var _0x548643={};var _0x4bc88f={};var _0x1cf171;var _0x4255d8;return db[_0x6282('0x3f')][_0x6282('0x4c')]({'where':{'id':_0x46bbfc[_0x6282('0x4a')]['id']}})[_0x6282('0x23')](handleEntityNotFound(_0x1a4290,null))[_0x6282('0x23')](function(_0x4bdeb6){if(_0x4bdeb6){_0x1cf171=_0x4bdeb6;_0x4bc88f[_0x6282('0x2e')]=_[_0x6282('0x30')](db['ZohoField'][_0x6282('0x2a')]);_0x4bc88f[_0x6282('0x2f')]=_[_0x6282('0x30')](_0x46bbfc[_0x6282('0x2f')]);_0x4bc88f[_0x6282('0x31')]=_[_0x6282('0x32')](_0x4bc88f[_0x6282('0x2e')],_0x4bc88f[_0x6282('0x2f')]);_0x548643[_0x6282('0x33')]=_[_0x6282('0x32')](_0x4bc88f['model'],qs[_0x6282('0x34')](_0x46bbfc[_0x6282('0x2f')][_0x6282('0x34')]));_0x548643[_0x6282('0x33')]=_0x548643[_0x6282('0x33')][_0x6282('0x4d')]?_0x548643[_0x6282('0x33')]:_0x4bc88f[_0x6282('0x2e')];_0x548643[_0x6282('0x37')]=qs[_0x6282('0x38')](_0x46bbfc[_0x6282('0x2f')][_0x6282('0x38')]);_0x548643[_0x6282('0x3c')]=qs[_0x6282('0x31')](_[_0x6282('0x39')](_0x46bbfc[_0x6282('0x2f')],_0x4bc88f['filters']));if(_0x46bbfc[_0x6282('0x2f')][_0x6282('0x3a')]){_0x548643[_0x6282('0x3c')]=_[_0x6282('0x3b')](_0x548643[_0x6282('0x3c')],{'$or':_[_0x6282('0x29')](_0x548643[_0x6282('0x33')],function(_0x14432e){var _0x185cee={};_0x185cee[_0x14432e]={'$like':'%'+_0x46bbfc['query'][_0x6282('0x3a')]+'%'};return _0x185cee;})});}_0x548643=_[_0x6282('0x3b')]({},_0x548643,_0x46bbfc['options']);return _0x1cf171[_0x6282('0x4e')](_0x548643);}})[_0x6282('0x23')](function(_0x2049c4){if(_0x2049c4){_0x4255d8=_0x2049c4[_0x6282('0x4d')];if(!_0x46bbfc['query']['hasOwnProperty']('nolimit')){_0x548643[_0x6282('0x1c')]=qs[_0x6282('0x1c')](_0x46bbfc[_0x6282('0x2f')][_0x6282('0x1c')]);_0x548643[_0x6282('0x1e')]=qs[_0x6282('0x1e')](_0x46bbfc['query'][_0x6282('0x1e')]);}return _0x1cf171['getSubjects'](_0x548643);}})[_0x6282('0x23')](function(_0x488716){if(_0x488716){return _0x488716?{'count':_0x4255d8,'rows':_0x488716}:null;}})[_0x6282('0x23')](respondWithResult(_0x1a4290,null))[_0x6282('0x44')](handleError(_0x1a4290,null));};exports['getDescriptions']=function(_0x18d2e1,_0x19db9d,_0x2a9ed9){var _0x4dac2b={};var _0x401941={};var _0x3cf999;var _0x228d39;return db[_0x6282('0x3f')][_0x6282('0x4c')]({'where':{'id':_0x18d2e1[_0x6282('0x4a')]['id']}})[_0x6282('0x23')](handleEntityNotFound(_0x19db9d,null))['then'](function(_0x490822){if(_0x490822){_0x3cf999=_0x490822;_0x401941[_0x6282('0x2e')]=_[_0x6282('0x30')](db['ZohoField'][_0x6282('0x2a')]);_0x401941['query']=_[_0x6282('0x30')](_0x18d2e1[_0x6282('0x2f')]);_0x401941[_0x6282('0x31')]=_[_0x6282('0x32')](_0x401941[_0x6282('0x2e')],_0x401941['query']);_0x4dac2b['attributes']=_[_0x6282('0x32')](_0x401941[_0x6282('0x2e')],qs[_0x6282('0x34')](_0x18d2e1[_0x6282('0x2f')][_0x6282('0x34')]));_0x4dac2b[_0x6282('0x33')]=_0x4dac2b['attributes']['length']?_0x4dac2b['attributes']:_0x401941[_0x6282('0x2e')];_0x4dac2b[_0x6282('0x37')]=qs[_0x6282('0x38')](_0x18d2e1[_0x6282('0x2f')][_0x6282('0x38')]);_0x4dac2b['where']=qs[_0x6282('0x31')](_[_0x6282('0x39')](_0x18d2e1[_0x6282('0x2f')],_0x401941[_0x6282('0x31')]));if(_0x18d2e1[_0x6282('0x2f')][_0x6282('0x3a')]){_0x4dac2b[_0x6282('0x3c')]=_['merge'](_0x4dac2b[_0x6282('0x3c')],{'$or':_[_0x6282('0x29')](_0x4dac2b[_0x6282('0x33')],function(_0x24c390){var _0x2f378d={};_0x2f378d[_0x24c390]={'$like':'%'+_0x18d2e1['query'][_0x6282('0x3a')]+'%'};return _0x2f378d;})});}_0x4dac2b=_[_0x6282('0x3b')]({},_0x4dac2b,_0x18d2e1['options']);return _0x3cf999[_0x6282('0x4f')](_0x4dac2b);}})[_0x6282('0x23')](function(_0x5e3bbc){if(_0x5e3bbc){_0x228d39=_0x5e3bbc[_0x6282('0x4d')];if(!_0x18d2e1[_0x6282('0x2f')][_0x6282('0x35')]('nolimit')){_0x4dac2b['limit']=qs['limit'](_0x18d2e1[_0x6282('0x2f')][_0x6282('0x1c')]);_0x4dac2b[_0x6282('0x1e')]=qs[_0x6282('0x1e')](_0x18d2e1['query'][_0x6282('0x1e')]);}return _0x3cf999[_0x6282('0x4f')](_0x4dac2b);}})[_0x6282('0x23')](function(_0x1a1659){if(_0x1a1659){return _0x1a1659?{'count':_0x228d39,'rows':_0x1a1659}:null;}})[_0x6282('0x23')](respondWithResult(_0x19db9d,null))[_0x6282('0x44')](handleError(_0x19db9d,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 116c368..d1684fd 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 _0x46ff=['bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0xbe73ea,_0x54c41b){var _0x4f1a31=function(_0x1b7bfd){while(--_0x1b7bfd){_0xbe73ea['push'](_0xbe73ea['shift']());}};_0x4f1a31(++_0x54c41b);}(_0x46ff,0xa4));var _0xf46f=function(_0xe59625,_0x14ba71){_0xe59625=_0xe59625-0x0;var _0x480f98=_0x46ff[_0xe59625];return _0x480f98;};'use strict';var _=require(_0xf46f('0x0'));var util=require(_0xf46f('0x1'));var logger=require(_0xf46f('0x2'))(_0xf46f('0x3'));var moment=require('moment');var BPromise=require(_0xf46f('0x4'));var rp=require(_0xf46f('0x5'));var fs=require('fs');var path=require(_0xf46f('0x6'));var rimraf=require(_0xf46f('0x7'));var config=require(_0xf46f('0x8'));var attributes=require(_0xf46f('0x9'));module[_0xf46f('0xa')]=function(_0x3edb8c,_0x5b41ca){return _0x3edb8c[_0xf46f('0xb')](_0xf46f('0xc'),attributes,{'tableName':_0xf46f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3cc=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations'];(function(_0x37b515,_0xc1b6ec){var _0x31a8c3=function(_0xf79116){while(--_0xf79116){_0x37b515['push'](_0x37b515['shift']());}};_0x31a8c3(++_0xc1b6ec);}(_0xc3cc,0xb0));var _0xcc3c=function(_0x5332b1,_0x192941){_0x5332b1=_0x5332b1-0x0;var _0x129b49=_0xc3cc[_0x5332b1];return _0x129b49;};'use strict';var _=require(_0xcc3c('0x0'));var util=require(_0xcc3c('0x1'));var logger=require(_0xcc3c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc3c('0x3'));var fs=require('fs');var path=require(_0xcc3c('0x4'));var rimraf=require(_0xcc3c('0x5'));var config=require(_0xcc3c('0x6'));var attributes=require(_0xcc3c('0x7'));module['exports']=function(_0x2574b7,_0x4314cf){return _0x2574b7[_0xcc3c('0x8')](_0xcc3c('0x9'),attributes,{'tableName':_0xcc3c('0xa'),'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 5cc6dd2..659931d 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 _0x56c6=['bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','util','moment'];(function(_0x118f31,_0x1b936f){var _0x1094d8=function(_0x1680e7){while(--_0x1680e7){_0x118f31['push'](_0x118f31['shift']());}};_0x1094d8(++_0x1b936f);}(_0x56c6,0x1c6));var _0x656c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x56c6[_0x1e4360];return _0x31e6b4;};'use strict';var _=require('lodash');var util=require(_0x656c('0x0'));var moment=require(_0x656c('0x1'));var BPromise=require(_0x656c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x656c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x656c('0x4'));var logger=require('../../config/logger')(_0x656c('0x5'));var config=require(_0x656c('0x6'));var jayson=require(_0x656c('0x7'));var client=jayson['client'][_0x656c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd2e1f2,_0x445f26,_0x4ae844){return new BPromise(function(_0x4e3f68,_0x3dbbbf){return client['request'](_0xd2e1f2,_0x4ae844)[_0x656c('0x9')](function(_0x5393b6){logger[_0x656c('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x445f26,'request\x20sent');logger[_0x656c('0xb')](_0x656c('0xc'),_0x445f26,_0x656c('0xd'),JSON['stringify'](_0x5393b6));if(_0x5393b6[_0x656c('0xe')]){if(_0x5393b6['error'][_0x656c('0xf')]===0x1f4){logger['error'](_0x656c('0x10'),_0x445f26,_0x5393b6[_0x656c('0xe')][_0x656c('0x11')]);return _0x3dbbbf(_0x5393b6[_0x656c('0xe')][_0x656c('0x11')]);}logger[_0x656c('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x445f26,_0x5393b6[_0x656c('0xe')][_0x656c('0x11')]);return _0x4e3f68(_0x5393b6[_0x656c('0xe')]['message']);}else{logger[_0x656c('0xa')](_0x656c('0x10'),_0x445f26,_0x656c('0xd'));_0x4e3f68(_0x5393b6[_0x656c('0x12')][_0x656c('0x11')]);}})['catch'](function(_0x3a8692){logger[_0x656c('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x445f26,_0x3a8692);_0x3dbbbf(_0x3a8692);});});} \ No newline at end of file +var _0xf3dc=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','ZohoConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x40c402,_0x33a343){var _0x1e34ac=function(_0x3b1a70){while(--_0x3b1a70){_0x40c402['push'](_0x40c402['shift']());}};_0x1e34ac(++_0x33a343);}(_0xf3dc,0x6e));var _0xcf3d=function(_0x2095ed,_0x156cfb){_0x2095ed=_0x2095ed-0x0;var _0x22dbb0=_0xf3dc[_0x2095ed];return _0x22dbb0;};'use strict';var _=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var moment=require(_0xcf3d('0x2'));var BPromise=require(_0xcf3d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcf3d('0x4'));var logger=require(_0xcf3d('0x5'))(_0xcf3d('0x6'));var config=require(_0xcf3d('0x7'));var jayson=require(_0xcf3d('0x8'));var client=jayson[_0xcf3d('0x9')][_0xcf3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b7479,_0xe418d1,_0x4f512f){return new BPromise(function(_0x58f181,_0x36b2c9){return client[_0xcf3d('0xb')](_0x2b7479,_0x4f512f)[_0xcf3d('0xc')](function(_0x79ace8){logger[_0xcf3d('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0xe418d1,_0xcf3d('0xe'));logger[_0xcf3d('0xf')](_0xcf3d('0x10'),_0xe418d1,_0xcf3d('0xe'),JSON['stringify'](_0x79ace8));if(_0x79ace8[_0xcf3d('0x11')]){if(_0x79ace8[_0xcf3d('0x11')]['code']===0x1f4){logger[_0xcf3d('0x11')](_0xcf3d('0x12'),_0xe418d1,_0x79ace8['error'][_0xcf3d('0x13')]);return _0x36b2c9(_0x79ace8['error'][_0xcf3d('0x13')]);}logger['error'](_0xcf3d('0x12'),_0xe418d1,_0x79ace8[_0xcf3d('0x11')]['message']);return _0x58f181(_0x79ace8[_0xcf3d('0x11')][_0xcf3d('0x13')]);}else{logger[_0xcf3d('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0xe418d1,_0xcf3d('0xe'));_0x58f181(_0x79ace8['result']['message']);}})[_0xcf3d('0x14')](function(_0x15ab9e){logger[_0xcf3d('0x11')](_0xcf3d('0x12'),_0xe418d1,_0x15ab9e);_0x36b2c9(_0x15ab9e);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index cf12182..f3abea8 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 _0x8203=['isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','index','/:id','show','post'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x8203,0xfd));var _0x3820=function(_0x13d0c2,_0x194e1b){_0x13d0c2=_0x13d0c2-0x0;var _0x8bf2e5=_0x8203[_0x13d0c2];return _0x8bf2e5;};'use strict';var multer=require('multer');var util=require(_0x3820('0x0'));var path=require(_0x3820('0x1'));var timeout=require(_0x3820('0x2'));var express=require('express');var router=express[_0x3820('0x3')]();var fs_extra=require(_0x3820('0x4'));var auth=require(_0x3820('0x5'));var interaction=require(_0x3820('0x6'));var config=require('../../config/environment');var controller=require(_0x3820('0x7'));router[_0x3820('0x8')]('/',auth['isAuthenticated'](),controller[_0x3820('0x9')]);router[_0x3820('0x8')](_0x3820('0xa'),auth['isAuthenticated'](),controller[_0x3820('0xb')]);router[_0x3820('0xc')]('/',auth[_0x3820('0xd')](),controller['create']);router[_0x3820('0xe')]('/:id',auth[_0x3820('0xd')](),controller[_0x3820('0xf')]);router[_0x3820('0x10')](_0x3820('0xa'),auth[_0x3820('0xd')](),controller[_0x3820('0x11')]);module[_0x3820('0x12')]=router; \ No newline at end of file +var _0x1ce9=['delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x2dcf30,_0x232c89){var _0x3196ef=function(_0x59fd02){while(--_0x59fd02){_0x2dcf30['push'](_0x2dcf30['shift']());}};_0x3196ef(++_0x232c89);}(_0x1ce9,0x1a0));var _0x91ce=function(_0xaa225c,_0x66eefe){_0xaa225c=_0xaa225c-0x0;var _0x411bd3=_0x1ce9[_0xaa225c];return _0x411bd3;};'use strict';var multer=require(_0x91ce('0x0'));var util=require('util');var path=require(_0x91ce('0x1'));var timeout=require(_0x91ce('0x2'));var express=require(_0x91ce('0x3'));var router=express['Router']();var fs_extra=require(_0x91ce('0x4'));var auth=require(_0x91ce('0x5'));var interaction=require(_0x91ce('0x6'));var config=require(_0x91ce('0x7'));var controller=require(_0x91ce('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x91ce('0x9'),auth[_0x91ce('0xa')](),controller[_0x91ce('0xb')]);router[_0x91ce('0xc')]('/',auth['isAuthenticated'](),controller[_0x91ce('0xd')]);router[_0x91ce('0xe')]('/:id',auth[_0x91ce('0xa')](),controller[_0x91ce('0xf')]);router[_0x91ce('0x10')]('/:id',auth[_0x91ce('0xa')](),controller[_0x91ce('0x11')]);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 b5f36e1..bcbd771 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 _0xb2e7=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','BOOLEAN','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb2e7,0x117));var _0x7b2e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb2e7[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x7b2e('0x0'));module[_0x7b2e('0x1')]={'type':{'type':Sequelize[_0x7b2e('0x2')]('string',_0x7b2e('0x3'),_0x7b2e('0x4'),_0x7b2e('0x5'),_0x7b2e('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7b2e('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7b2e('0x2')](_0x7b2e('0x8'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x7b2e('0x7')]},'idField':{'type':Sequelize[_0x7b2e('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7b2e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7b2e('0x7')]}}; \ No newline at end of file +var _0xbf70=['string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3ce82c,_0x57a08d){var _0x15f514=function(_0x403949){while(--_0x403949){_0x3ce82c['push'](_0x3ce82c['shift']());}};_0x15f514(++_0x57a08d);}(_0xbf70,0x11d));var _0x0bf7=function(_0x4bfb7e,_0x4e45ce){_0x4bfb7e=_0x4bfb7e-0x0;var _0x1fb56b=_0xbf70[_0x4bfb7e];return _0x1fb56b;};'use strict';var Sequelize=require(_0x0bf7('0x0'));module[_0x0bf7('0x1')]={'type':{'type':Sequelize[_0x0bf7('0x2')](_0x0bf7('0x3'),'variable',_0x0bf7('0x4'),_0x0bf7('0x5'),_0x0bf7('0x6')),'defaultValue':_0x0bf7('0x3')},'content':{'type':Sequelize[_0x0bf7('0x7')]},'key':{'type':Sequelize[_0x0bf7('0x7')]},'keyType':{'type':Sequelize[_0x0bf7('0x2')](_0x0bf7('0x3'),'variable',_0x0bf7('0x4'))},'keyContent':{'type':Sequelize[_0x0bf7('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0bf7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0bf7('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index dee74cd..3ab79fa 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 _0x00ed=['order','sort','where','pick','filter','merge','options','ZohoField','includeAll','include','then','rows','catch','show','find','create','body','update','destroy','params','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit'];(function(_0x2aff6a,_0x45d18){var _0x8eb5fa=function(_0x5e9e30){while(--_0x5e9e30){_0x2aff6a['push'](_0x2aff6a['shift']());}};_0x8eb5fa(++_0x45d18);}(_0x00ed,0xe9));var _0xd00e=function(_0x54b6fe,_0x1cb0d1){_0x54b6fe=_0x54b6fe-0x0;var _0x3ce8dd=_0x00ed[_0x54b6fe];return _0x3ce8dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd00e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd00e('0x1'));var rp=require(_0xd00e('0x2'));var moment=require(_0xd00e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd00e('0x4'));var util=require(_0xd00e('0x5'));var path=require(_0xd00e('0x6'));var sox=require(_0xd00e('0x7'));var csv=require(_0xd00e('0x8'));var ejs=require(_0xd00e('0x9'));var fs=require('fs');var fs_extra=require(_0xd00e('0xa'));var _=require(_0xd00e('0xb'));var squel=require(_0xd00e('0xc'));var crypto=require(_0xd00e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd00e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd00e('0xf'));var Papa=require('papaparse');var Redis=require(_0xd00e('0x10'));var authService=require(_0xd00e('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd00e('0x12'));var logger=require(_0xd00e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd00e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd00e('0x15'))['db'];function respondWithStatusCode(_0x8cac21,_0x5ab110){_0x5ab110=_0x5ab110||0xcc;return function(_0x4254cc){if(_0x4254cc){return _0x8cac21[_0xd00e('0x16')](_0x5ab110);}return _0x8cac21[_0xd00e('0x17')](_0x5ab110)[_0xd00e('0x18')]();};}function respondWithResult(_0x4acbdb,_0x5460d2){_0x5460d2=_0x5460d2||0xc8;return function(_0x26ec0e){if(_0x26ec0e){return _0x4acbdb[_0xd00e('0x17')](_0x5460d2)[_0xd00e('0x19')](_0x26ec0e);}};}function respondWithFilteredResult(_0x46e290,_0x52edde){return function(_0x618b09){if(_0x618b09){var _0x2c3445=typeof _0x52edde[_0xd00e('0x1a')]===_0xd00e('0x1b')&&typeof _0x52edde['limit']===_0xd00e('0x1b');var _0x36c0ac=_0x618b09[_0xd00e('0x1c')];var _0x48b77b=_0x2c3445?0x0:_0x52edde[_0xd00e('0x1a')];var _0x10c96f=_0x2c3445?_0x618b09[_0xd00e('0x1c')]:_0x52edde[_0xd00e('0x1a')]+_0x52edde[_0xd00e('0x1d')];var _0x151b0f;if(_0x10c96f>=_0x36c0ac){_0x10c96f=_0x36c0ac;_0x151b0f=0xc8;}else{_0x151b0f=0xce;}_0x46e290['status'](_0x151b0f);return _0x46e290[_0xd00e('0x1e')](_0xd00e('0x1f'),_0x48b77b+'-'+_0x10c96f+'/'+_0x36c0ac)[_0xd00e('0x19')](_0x618b09);}return null;};}function patchUpdates(_0x86928a){return function(_0x4ae0c9){try{jsonpatch[_0xd00e('0x20')](_0x4ae0c9,_0x86928a,!![]);}catch(_0x36c95d){return BPromise['reject'](_0x36c95d);}return _0x4ae0c9['save']();};}function saveUpdates(_0x5e4a51,_0x550553){return function(_0x2e1983){if(_0x2e1983){return _0x2e1983['update'](_0x5e4a51)['then'](function(_0x5eb28c){return _0x5eb28c;});}return null;};}function removeEntity(_0x3be542,_0x5f0cdc){return function(_0x257270){if(_0x257270){return _0x257270['destroy']()['then'](function(){_0x3be542['status'](0xcc)[_0xd00e('0x18')]();});}};}function handleEntityNotFound(_0x4e4835,_0x389e67){return function(_0x16ea72){if(!_0x16ea72){_0x4e4835[_0xd00e('0x16')](0x194);}return _0x16ea72;};}function handleError(_0x460e52,_0x2b1669){_0x2b1669=_0x2b1669||0x1f4;return function(_0x1f326a){logger[_0xd00e('0x21')](_0x1f326a[_0xd00e('0x22')]);if(_0x1f326a[_0xd00e('0x23')]){delete _0x1f326a[_0xd00e('0x23')];}_0x460e52[_0xd00e('0x17')](_0x2b1669)[_0xd00e('0x24')](_0x1f326a);};}exports['index']=function(_0x2c0943,_0x4cf615){var _0x44c772={},_0x4936f2={},_0x1c076e={'count':0x0,'rows':[]};var _0xe3d410=_['map'](db['ZohoField'][_0xd00e('0x25')],function(_0x599d44){return{'name':_0x599d44[_0xd00e('0x26')],'type':_0x599d44[_0xd00e('0x27')][_0xd00e('0x28')]};});_0x4936f2[_0xd00e('0x29')]=_[_0xd00e('0x2a')](_0xe3d410,_0xd00e('0x23'));_0x4936f2[_0xd00e('0x2b')]=_[_0xd00e('0x2c')](_0x2c0943[_0xd00e('0x2b')]);_0x4936f2[_0xd00e('0x2d')]=_['intersection'](_0x4936f2[_0xd00e('0x29')],_0x4936f2[_0xd00e('0x2b')]);_0x44c772[_0xd00e('0x2e')]=_[_0xd00e('0x2f')](_0x4936f2['model'],qs[_0xd00e('0x30')](_0x2c0943['query']['fields']));_0x44c772[_0xd00e('0x2e')]=_0x44c772[_0xd00e('0x2e')][_0xd00e('0x31')]?_0x44c772['attributes']:_0x4936f2['model'];if(!_0x2c0943[_0xd00e('0x2b')]['hasOwnProperty'](_0xd00e('0x32'))){_0x44c772[_0xd00e('0x1d')]=qs[_0xd00e('0x1d')](_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x1d')]);_0x44c772['offset']=qs[_0xd00e('0x1a')](_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x1a')]);}_0x44c772[_0xd00e('0x33')]=qs[_0xd00e('0x34')](_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x34')]);_0x44c772[_0xd00e('0x35')]=qs[_0xd00e('0x2d')](_[_0xd00e('0x36')](_0x2c0943[_0xd00e('0x2b')],_0x4936f2['filters']),_0xe3d410);if(_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x37')]){_0x44c772[_0xd00e('0x35')]=_[_0xd00e('0x38')](_0x44c772[_0xd00e('0x35')],{'$or':_[_0xd00e('0x2a')](_0xe3d410,function(_0x37c3c0){if(_0x37c3c0[_0xd00e('0x27')]!=='VIRTUAL'){var _0x243cb7={};_0x243cb7[_0x37c3c0[_0xd00e('0x23')]]={'$like':'%'+_0x2c0943['query']['filter']+'%'};return _0x243cb7;}})});}_0x44c772=_[_0xd00e('0x38')]({},_0x44c772,_0x2c0943[_0xd00e('0x39')]);var _0x288ac5={'where':_0x44c772['where']};return db[_0xd00e('0x3a')][_0xd00e('0x1c')](_0x288ac5)['then'](function(_0x33ed9d){_0x1c076e[_0xd00e('0x1c')]=_0x33ed9d;if(_0x2c0943[_0xd00e('0x2b')][_0xd00e('0x3b')]){_0x44c772[_0xd00e('0x3c')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x44c772);})[_0xd00e('0x3d')](function(_0x104bad){_0x1c076e[_0xd00e('0x3e')]=_0x104bad;return _0x1c076e;})['then'](respondWithFilteredResult(_0x4cf615,_0x44c772))[_0xd00e('0x3f')](handleError(_0x4cf615,null));};exports[_0xd00e('0x40')]=function(_0x3d84c5,_0x4da8f4){var _0x4debd3={'raw':!![],'where':{'id':_0x3d84c5['params']['id']}},_0x1696f2={};_0x1696f2[_0xd00e('0x29')]=_[_0xd00e('0x2c')](db['ZohoField'][_0xd00e('0x25')]);_0x1696f2['query']=_[_0xd00e('0x2c')](_0x3d84c5['query']);_0x1696f2[_0xd00e('0x2d')]=_[_0xd00e('0x2f')](_0x1696f2[_0xd00e('0x29')],_0x1696f2[_0xd00e('0x2b')]);_0x4debd3['attributes']=_[_0xd00e('0x2f')](_0x1696f2['model'],qs[_0xd00e('0x30')](_0x3d84c5[_0xd00e('0x2b')][_0xd00e('0x30')]));_0x4debd3[_0xd00e('0x2e')]=_0x4debd3[_0xd00e('0x2e')][_0xd00e('0x31')]?_0x4debd3[_0xd00e('0x2e')]:_0x1696f2['model'];if(_0x3d84c5[_0xd00e('0x2b')][_0xd00e('0x3b')]){_0x4debd3[_0xd00e('0x3c')]=[{'all':!![]}];}_0x4debd3=_[_0xd00e('0x38')]({},_0x4debd3,_0x3d84c5[_0xd00e('0x39')]);return db[_0xd00e('0x3a')][_0xd00e('0x41')](_0x4debd3)[_0xd00e('0x3d')](handleEntityNotFound(_0x4da8f4,null))[_0xd00e('0x3d')](respondWithResult(_0x4da8f4,null))['catch'](handleError(_0x4da8f4,null));};exports[_0xd00e('0x42')]=function(_0x64bdf8,_0x633839){return db[_0xd00e('0x3a')]['create'](_0x64bdf8[_0xd00e('0x43')],{})['then'](respondWithResult(_0x633839,0xc9))['catch'](handleError(_0x633839,null));};exports[_0xd00e('0x44')]=function(_0xd2ed1,_0x3e05e5){if(_0xd2ed1[_0xd00e('0x43')]['id']){delete _0xd2ed1[_0xd00e('0x43')]['id'];}return db[_0xd00e('0x3a')][_0xd00e('0x41')]({'where':{'id':_0xd2ed1['params']['id']}})[_0xd00e('0x3d')](handleEntityNotFound(_0x3e05e5,null))[_0xd00e('0x3d')](saveUpdates(_0xd2ed1[_0xd00e('0x43')],null))[_0xd00e('0x3d')](respondWithResult(_0x3e05e5,null))['catch'](handleError(_0x3e05e5,null));};exports[_0xd00e('0x45')]=function(_0x5d78e7,_0x3e10bc){return db[_0xd00e('0x3a')][_0xd00e('0x41')]({'where':{'id':_0x5d78e7[_0xd00e('0x46')]['id']}})[_0xd00e('0x3d')](handleEntityNotFound(_0x3e10bc,null))[_0xd00e('0x3d')](removeEntity(_0x3e10bc,null))['catch'](handleError(_0x3e10bc,null));}; \ No newline at end of file +var _0x172c=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','nolimit','sort','where','pick','filter','merge','include','ZohoField','findAll','catch','params','intersection','length','includeAll','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5ddd36,_0xce10a0){var _0x477b73=function(_0x39d1ac){while(--_0x39d1ac){_0x5ddd36['push'](_0x5ddd36['shift']());}};_0x477b73(++_0xce10a0);}(_0x172c,0x1ad));var _0xc172=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x172c[_0x30033a];return _0x5e3518;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc172('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc172('0x1'));var rp=require(_0xc172('0x2'));var moment=require(_0xc172('0x3'));var BPromise=require(_0xc172('0x4'));var Mustache=require(_0xc172('0x5'));var util=require(_0xc172('0x6'));var path=require('path');var sox=require(_0xc172('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc172('0x8'));var _=require(_0xc172('0x9'));var squel=require(_0xc172('0xa'));var crypto=require(_0xc172('0xb'));var jsforce=require(_0xc172('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc172('0xd'));var querystring=require(_0xc172('0xe'));var Papa=require(_0xc172('0xf'));var Redis=require(_0xc172('0x10'));var authService=require(_0xc172('0x11'));var qs=require(_0xc172('0x12'));var as=require(_0xc172('0x13'));var hardwareService=require(_0xc172('0x14'));var logger=require(_0xc172('0x15'))(_0xc172('0x16'));var utils=require(_0xc172('0x17'));var config=require(_0xc172('0x18'));var licenseUtil=require(_0xc172('0x19'));var db=require(_0xc172('0x1a'))['db'];function respondWithStatusCode(_0x444fb0,_0x126406){_0x126406=_0x126406||0xcc;return function(_0x3a858f){if(_0x3a858f){return _0x444fb0['sendStatus'](_0x126406);}return _0x444fb0[_0xc172('0x1b')](_0x126406)['end']();};}function respondWithResult(_0x16ed1e,_0x54db7f){_0x54db7f=_0x54db7f||0xc8;return function(_0x195435){if(_0x195435){return _0x16ed1e['status'](_0x54db7f)[_0xc172('0x1c')](_0x195435);}};}function respondWithFilteredResult(_0x14a8a6,_0x3bf962){return function(_0x4d237c){if(_0x4d237c){var _0xe8e652=typeof _0x3bf962[_0xc172('0x1d')]===_0xc172('0x1e')&&typeof _0x3bf962[_0xc172('0x1f')]===_0xc172('0x1e');var _0x2a3caf=_0x4d237c[_0xc172('0x20')];var _0x324eef=_0xe8e652?0x0:_0x3bf962[_0xc172('0x1d')];var _0x5d8e5f=_0xe8e652?_0x4d237c['count']:_0x3bf962[_0xc172('0x1d')]+_0x3bf962['limit'];var _0x5b95df;if(_0x5d8e5f>=_0x2a3caf){_0x5d8e5f=_0x2a3caf;_0x5b95df=0xc8;}else{_0x5b95df=0xce;}_0x14a8a6['status'](_0x5b95df);return _0x14a8a6[_0xc172('0x21')](_0xc172('0x22'),_0x324eef+'-'+_0x5d8e5f+'/'+_0x2a3caf)[_0xc172('0x1c')](_0x4d237c);}return null;};}function patchUpdates(_0x292979){return function(_0x31e804){try{jsonpatch[_0xc172('0x23')](_0x31e804,_0x292979,!![]);}catch(_0x207219){return BPromise[_0xc172('0x24')](_0x207219);}return _0x31e804[_0xc172('0x25')]();};}function saveUpdates(_0x368e83,_0x61ceec){return function(_0x24eeec){if(_0x24eeec){return _0x24eeec[_0xc172('0x26')](_0x368e83)[_0xc172('0x27')](function(_0x29e25b){return _0x29e25b;});}return null;};}function removeEntity(_0x43d515,_0x1adba3){return function(_0x3fc135){if(_0x3fc135){return _0x3fc135[_0xc172('0x28')]()[_0xc172('0x27')](function(){_0x43d515[_0xc172('0x1b')](0xcc)[_0xc172('0x29')]();});}};}function handleEntityNotFound(_0x3052ba,_0x5ee658){return function(_0xa5f5fc){if(!_0xa5f5fc){_0x3052ba['sendStatus'](0x194);}return _0xa5f5fc;};}function handleError(_0x293f04,_0x394ff7){_0x394ff7=_0x394ff7||0x1f4;return function(_0x361cfb){logger[_0xc172('0x2a')](_0x361cfb['stack']);if(_0x361cfb[_0xc172('0x2b')]){delete _0x361cfb['name'];}_0x293f04[_0xc172('0x1b')](_0x394ff7)[_0xc172('0x2c')](_0x361cfb);};}exports[_0xc172('0x2d')]=function(_0x2fd2aa,_0xb6d298){var _0x1d87b2={},_0x2f917f={},_0xa15049={'count':0x0,'rows':[]};var _0x2f9485=_[_0xc172('0x2e')](db['ZohoField'][_0xc172('0x2f')],function(_0x48f16b){return{'name':_0x48f16b[_0xc172('0x30')],'type':_0x48f16b[_0xc172('0x31')][_0xc172('0x32')]};});_0x2f917f[_0xc172('0x33')]=_[_0xc172('0x2e')](_0x2f9485,_0xc172('0x2b'));_0x2f917f['query']=_[_0xc172('0x34')](_0x2fd2aa[_0xc172('0x35')]);_0x2f917f[_0xc172('0x36')]=_['intersection'](_0x2f917f[_0xc172('0x33')],_0x2f917f[_0xc172('0x35')]);_0x1d87b2[_0xc172('0x37')]=_['intersection'](_0x2f917f[_0xc172('0x33')],qs[_0xc172('0x38')](_0x2fd2aa[_0xc172('0x35')][_0xc172('0x38')]));_0x1d87b2[_0xc172('0x37')]=_0x1d87b2['attributes']['length']?_0x1d87b2[_0xc172('0x37')]:_0x2f917f[_0xc172('0x33')];if(!_0x2fd2aa[_0xc172('0x35')]['hasOwnProperty'](_0xc172('0x39'))){_0x1d87b2['limit']=qs[_0xc172('0x1f')](_0x2fd2aa['query'][_0xc172('0x1f')]);_0x1d87b2['offset']=qs[_0xc172('0x1d')](_0x2fd2aa[_0xc172('0x35')][_0xc172('0x1d')]);}_0x1d87b2['order']=qs[_0xc172('0x3a')](_0x2fd2aa[_0xc172('0x35')][_0xc172('0x3a')]);_0x1d87b2[_0xc172('0x3b')]=qs[_0xc172('0x36')](_[_0xc172('0x3c')](_0x2fd2aa[_0xc172('0x35')],_0x2f917f[_0xc172('0x36')]),_0x2f9485);if(_0x2fd2aa[_0xc172('0x35')][_0xc172('0x3d')]){_0x1d87b2[_0xc172('0x3b')]=_[_0xc172('0x3e')](_0x1d87b2[_0xc172('0x3b')],{'$or':_[_0xc172('0x2e')](_0x2f9485,function(_0x55c88d){if(_0x55c88d[_0xc172('0x31')]!=='VIRTUAL'){var _0x1a1227={};_0x1a1227[_0x55c88d['name']]={'$like':'%'+_0x2fd2aa[_0xc172('0x35')][_0xc172('0x3d')]+'%'};return _0x1a1227;}})});}_0x1d87b2=_[_0xc172('0x3e')]({},_0x1d87b2,_0x2fd2aa['options']);var _0x41143c={'where':_0x1d87b2['where']};return db['ZohoField'][_0xc172('0x20')](_0x41143c)[_0xc172('0x27')](function(_0x1fa236){_0xa15049[_0xc172('0x20')]=_0x1fa236;if(_0x2fd2aa[_0xc172('0x35')]['includeAll']){_0x1d87b2[_0xc172('0x3f')]=[{'all':!![]}];}return db[_0xc172('0x40')][_0xc172('0x41')](_0x1d87b2);})[_0xc172('0x27')](function(_0x20a595){_0xa15049['rows']=_0x20a595;return _0xa15049;})['then'](respondWithFilteredResult(_0xb6d298,_0x1d87b2))[_0xc172('0x42')](handleError(_0xb6d298,null));};exports['show']=function(_0x1f1f3d,_0x17b3a0){var _0x193006={'raw':!![],'where':{'id':_0x1f1f3d[_0xc172('0x43')]['id']}},_0x43c8c8={};_0x43c8c8['model']=_[_0xc172('0x34')](db[_0xc172('0x40')]['rawAttributes']);_0x43c8c8[_0xc172('0x35')]=_[_0xc172('0x34')](_0x1f1f3d[_0xc172('0x35')]);_0x43c8c8[_0xc172('0x36')]=_[_0xc172('0x44')](_0x43c8c8[_0xc172('0x33')],_0x43c8c8[_0xc172('0x35')]);_0x193006[_0xc172('0x37')]=_[_0xc172('0x44')](_0x43c8c8[_0xc172('0x33')],qs[_0xc172('0x38')](_0x1f1f3d[_0xc172('0x35')][_0xc172('0x38')]));_0x193006[_0xc172('0x37')]=_0x193006['attributes'][_0xc172('0x45')]?_0x193006['attributes']:_0x43c8c8[_0xc172('0x33')];if(_0x1f1f3d['query'][_0xc172('0x46')]){_0x193006[_0xc172('0x3f')]=[{'all':!![]}];}_0x193006=_[_0xc172('0x3e')]({},_0x193006,_0x1f1f3d[_0xc172('0x47')]);return db[_0xc172('0x40')][_0xc172('0x48')](_0x193006)[_0xc172('0x27')](handleEntityNotFound(_0x17b3a0,null))[_0xc172('0x27')](respondWithResult(_0x17b3a0,null))['catch'](handleError(_0x17b3a0,null));};exports[_0xc172('0x49')]=function(_0x4e6603,_0x3904ec){return db[_0xc172('0x40')]['create'](_0x4e6603[_0xc172('0x4a')],{})[_0xc172('0x27')](respondWithResult(_0x3904ec,0xc9))[_0xc172('0x42')](handleError(_0x3904ec,null));};exports[_0xc172('0x26')]=function(_0x23cf79,_0x5de016){if(_0x23cf79[_0xc172('0x4a')]['id']){delete _0x23cf79[_0xc172('0x4a')]['id'];}return db[_0xc172('0x40')]['find']({'where':{'id':_0x23cf79[_0xc172('0x43')]['id']}})[_0xc172('0x27')](handleEntityNotFound(_0x5de016,null))[_0xc172('0x27')](saveUpdates(_0x23cf79[_0xc172('0x4a')],null))['then'](respondWithResult(_0x5de016,null))[_0xc172('0x42')](handleError(_0x5de016,null));};exports[_0xc172('0x28')]=function(_0x29fc33,_0x482e70){return db[_0xc172('0x40')][_0xc172('0x48')]({'where':{'id':_0x29fc33[_0xc172('0x43')]['id']}})[_0xc172('0x27')](handleEntityNotFound(_0x482e70,null))[_0xc172('0x27')](removeEntity(_0x482e70,null))[_0xc172('0x42')](handleError(_0x482e70,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 573be3b..e1f1853 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 _0x1a85=['rimraf','../../config/environment','exports','ZohoField','int_zoho_fields','idField','../../config/logger','api','moment','path'];(function(_0x195bb3,_0x4ff2b0){var _0x1fc21e=function(_0x150e8c){while(--_0x150e8c){_0x195bb3['push'](_0x195bb3['shift']());}};_0x1fc21e(++_0x4ff2b0);}(_0x1a85,0x178));var _0x51a8=function(_0x354bd6,_0x4a7c74){_0x354bd6=_0x354bd6-0x0;var _0x39bf52=_0x1a85[_0x354bd6];return _0x39bf52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x51a8('0x0'))(_0x51a8('0x1'));var moment=require(_0x51a8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x51a8('0x3'));var rimraf=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var attributes=require('./intZohoField.attributes');module[_0x51a8('0x6')]=function(_0x4b76a8,_0x2c1180){return _0x4b76a8['define'](_0x51a8('0x7'),attributes,{'tableName':_0x51a8('0x8'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x51a8('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee1=['request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','moment','bluebird'];(function(_0x40ec17,_0xfdfb8){var _0x4bd2a5=function(_0x5b1ec4){while(--_0x5b1ec4){_0x40ec17['push'](_0x40ec17['shift']());}};_0x4bd2a5(++_0xfdfb8);}(_0x7ee1,0x8d));var _0x17ee=function(_0x5560d0,_0x250a32){_0x5560d0=_0x5560d0-0x0;var _0x3e3211=_0x7ee1[_0x5560d0];return _0x3e3211;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));module[_0x17ee('0x7')]=function(_0x5c0617,_0x52b1db){return _0x5c0617[_0x17ee('0x8')]('ZohoField',attributes,{'tableName':_0x17ee('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x17ee('0xa'),_0x17ee('0xb')],'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 c6908e8..b1b21f5 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 _0x7ad0=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0x7ad0,0xf4));var _0x07ad=function(_0xc4743b,_0x5d8f4e){_0xc4743b=_0xc4743b-0x0;var _0x317924=_0x7ad0[_0xc4743b];return _0x317924;};'use strict';var _=require('lodash');var util=require(_0x07ad('0x0'));var moment=require(_0x07ad('0x1'));var BPromise=require(_0x07ad('0x2'));var rs=require(_0x07ad('0x3'));var fs=require('fs');var Redis=require(_0x07ad('0x4'));var db=require(_0x07ad('0x5'))['db'];var utils=require(_0x07ad('0x6'));var logger=require(_0x07ad('0x7'))('rpc');var config=require(_0x07ad('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x07ad('0x9')][_0x07ad('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a6f19,_0x24c1b8,_0x2b01e5){return new BPromise(function(_0x18309d,_0x399a5f){return client[_0x07ad('0xb')](_0x2a6f19,_0x2b01e5)[_0x07ad('0xc')](function(_0x488910){logger[_0x07ad('0xd')](_0x07ad('0xe'),_0x24c1b8,'request\x20sent');logger[_0x07ad('0xf')](_0x07ad('0x10'),_0x24c1b8,_0x07ad('0x11'),JSON[_0x07ad('0x12')](_0x488910));if(_0x488910[_0x07ad('0x13')]){if(_0x488910[_0x07ad('0x13')][_0x07ad('0x14')]===0x1f4){logger[_0x07ad('0x13')](_0x07ad('0xe'),_0x24c1b8,_0x488910['error'][_0x07ad('0x15')]);return _0x399a5f(_0x488910['error']['message']);}logger['error']('ZohoField,\x20%s,\x20%s',_0x24c1b8,_0x488910['error']['message']);return _0x18309d(_0x488910[_0x07ad('0x13')][_0x07ad('0x15')]);}else{logger[_0x07ad('0xd')](_0x07ad('0xe'),_0x24c1b8,_0x07ad('0x11'));_0x18309d(_0x488910[_0x07ad('0x16')][_0x07ad('0x15')]);}})[_0x07ad('0x17')](function(_0xdfcebb){logger[_0x07ad('0x13')]('ZohoField,\x20%s,\x20%s',_0x24c1b8,_0xdfcebb);_0x399a5f(_0xdfcebb);});});} \ No newline at end of file +var _0xfb67=['rpc','client','http','request','then','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','ZohoField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37a3a4,_0x41cac1){var _0x4b9f0c=function(_0x1286c2){while(--_0x1286c2){_0x37a3a4['push'](_0x37a3a4['shift']());}};_0x4b9f0c(++_0x41cac1);}(_0xfb67,0xf4));var _0x7fb6=function(_0x2f0ecb,_0x5d739e){_0x2f0ecb=_0x2f0ecb-0x0;var _0x4aae3a=_0xfb67[_0x2f0ecb];return _0x4aae3a;};'use strict';var _=require(_0x7fb6('0x0'));var util=require(_0x7fb6('0x1'));var moment=require(_0x7fb6('0x2'));var BPromise=require(_0x7fb6('0x3'));var rs=require(_0x7fb6('0x4'));var fs=require('fs');var Redis=require(_0x7fb6('0x5'));var db=require(_0x7fb6('0x6'))['db'];var utils=require(_0x7fb6('0x7'));var logger=require(_0x7fb6('0x8'))(_0x7fb6('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7fb6('0xa')][_0x7fb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x202bb0,_0x30cb6a,_0xe8067d){return new BPromise(function(_0x1a4e63,_0x36fcb8){return client[_0x7fb6('0xc')](_0x202bb0,_0xe8067d)[_0x7fb6('0xd')](function(_0x2f6ad2){logger['info']('ZohoField,\x20%s,\x20%s',_0x30cb6a,_0x7fb6('0xe'));logger[_0x7fb6('0xf')](_0x7fb6('0x10'),_0x30cb6a,'request\x20sent',JSON[_0x7fb6('0x11')](_0x2f6ad2));if(_0x2f6ad2['error']){if(_0x2f6ad2[_0x7fb6('0x12')]['code']===0x1f4){logger[_0x7fb6('0x12')](_0x7fb6('0x13'),_0x30cb6a,_0x2f6ad2[_0x7fb6('0x12')][_0x7fb6('0x14')]);return _0x36fcb8(_0x2f6ad2['error'][_0x7fb6('0x14')]);}logger[_0x7fb6('0x12')](_0x7fb6('0x13'),_0x30cb6a,_0x2f6ad2[_0x7fb6('0x12')]['message']);return _0x1a4e63(_0x2f6ad2['error'][_0x7fb6('0x14')]);}else{logger[_0x7fb6('0x15')](_0x7fb6('0x13'),_0x30cb6a,_0x7fb6('0xe'));_0x1a4e63(_0x2f6ad2['result'][_0x7fb6('0x14')]);}})[_0x7fb6('0x16')](function(_0x3c9479){logger[_0x7fb6('0x12')](_0x7fb6('0x13'),_0x30cb6a,_0x3c9479);_0x36fcb8(_0x3c9479);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7dcceaf..3bcd069 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x585199,_0x10d223){var _0x4f5eaf=function(_0x19f4cf){while(--_0x19f4cf){_0x585199['push'](_0x585199['shift']());}};_0x4f5eaf(++_0x10d223);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d313e,_0x278f09){var _0x5bdea4=function(_0x2eaee3){while(--_0x2eaee3){_0x4d313e['push'](_0x4d313e['shift']());}};_0x5bdea4(++_0x278f09);}(_0xe706,0xa3));var _0x6e70=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xe706[_0x26b8b5];return _0x2150a9;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index baf1268..e5bf605 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 _0xcba4=['state','sequelize','exports','STRING','unique_name_and_version','BOOLEAN'];(function(_0x53a740,_0x311877){var _0x10a7af=function(_0x21fce7){while(--_0x21fce7){_0x53a740['push'](_0x53a740['shift']());}};_0x10a7af(++_0x311877);}(_0xcba4,0x109));var _0x4cba=function(_0x1410b4,_0x56c67f){_0x1410b4=_0x1410b4-0x0;var _0x1671f3=_0xcba4[_0x1410b4];return _0x1671f3;};'use strict';var Sequelize=require(_0x4cba('0x0'));module[_0x4cba('0x1')]={'name':{'type':Sequelize[_0x4cba('0x2')],'allowNull':![],'unique':_0x4cba('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4cba('0x3')},'main':{'type':Sequelize[_0x4cba('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x4cba('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4cba('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x4cba('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x4cba('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x4cba('0x2')],'unique':_0x4cba('0x5')},'description':{'type':Sequelize[_0x4cba('0x2')]},'title':{'type':Sequelize[_0x4cba('0x2')]},'remoteUri':{'type':Sequelize[_0x4cba('0x2')]},'link':{'type':Sequelize[_0x4cba('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x0418=['sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN','state'];(function(_0x3f3bad,_0x193f06){var _0x4f0801=function(_0x5cfd32){while(--_0x5cfd32){_0x3f3bad['push'](_0x3f3bad['shift']());}};_0x4f0801(++_0x193f06);}(_0x0418,0x165));var _0x8041=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x0418[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x8041('0x0'));module[_0x8041('0x1')]={'name':{'type':Sequelize[_0x8041('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x8041('0x2')],'allowNull':![],'unique':_0x8041('0x3')},'main':{'type':Sequelize[_0x8041('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x8041('0x2')]},'type':{'type':Sequelize[_0x8041('0x2')]},'size':{'type':Sequelize[_0x8041('0x4')]},'active':{'type':Sequelize[_0x8041('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8041('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x8041('0x2')],'unique':_0x8041('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x8041('0x2')]},'remoteUri':{'type':Sequelize[_0x8041('0x2')]},'link':{'type':Sequelize[_0x8041('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0a9736f..2b84707 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 _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','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','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','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'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x524e,0x15e));var _0xe524=function(_0x2995fe,_0x139130){_0x2995fe=_0x2995fe-0x0;var _0x1c07cb=_0x524e[_0x2995fe];return _0x1c07cb;};'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['Integration'][_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['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','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','Integration','fieldName','type','key'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xadb5,0xad));var _0x5adb=function(_0x1b0849,_0x4cd609){_0x1b0849=_0x1b0849-0x0;var _0x564fcd=_0xadb5[_0x1b0849];return _0x564fcd;};'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['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index a5a1633..b50dac9 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 _0x0edf=['Integration','integrations','lodash','util','moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0edf,0xb6));var _0xf0ed=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x0edf[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xf0ed('0x0'));var util=require(_0xf0ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf0ed('0x2'));var BPromise=require(_0xf0ed('0x3'));var rp=require(_0xf0ed('0x4'));var fs=require('fs');var path=require(_0xf0ed('0x5'));var rimraf=require(_0xf0ed('0x6'));var config=require('../../config/environment');var attributes=require(_0xf0ed('0x7'));module[_0xf0ed('0x8')]=function(_0x4ec8ea,_0x96d4d8){return _0x4ec8ea[_0xf0ed('0x9')](_0xf0ed('0xa'),attributes,{'tableName':_0xf0ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x040f=['./integration.attributes','exports','define','Integration','integrations','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x1e1b5d,_0x42e906){var _0xed683d=function(_0x5c04cb){while(--_0x5c04cb){_0x1e1b5d['push'](_0x1e1b5d['shift']());}};_0xed683d(++_0x42e906);}(_0x040f,0x9f));var _0xf040=function(_0x3e9b51,_0x146374){_0x3e9b51=_0x3e9b51-0x0;var _0x333349=_0x040f[_0x3e9b51];return _0x333349;};'use strict';var _=require('lodash');var util=require(_0xf040('0x0'));var logger=require(_0xf040('0x1'))('api');var moment=require(_0xf040('0x2'));var BPromise=require('bluebird');var rp=require(_0xf040('0x3'));var fs=require('fs');var path=require(_0xf040('0x4'));var rimraf=require(_0xf040('0x5'));var config=require('../../config/environment');var attributes=require(_0xf040('0x6'));module[_0xf040('0x7')]=function(_0x59ce30,_0x17fc66){return _0x59ce30[_0xf040('0x8')](_0xf040('0x9'),attributes,{'tableName':_0xf040('0xa'),'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 1b112eb..8b06446 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 _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x4975,0x86));var _0x5497=function(_0x33acfb,_0x482609){_0x33acfb=_0x33acfb-0x0;var _0xda8935=_0x4975[_0x33acfb];return _0xda8935;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});} \ No newline at end of file +var _0x7a54=['info','Integration,\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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x18ea3e,_0x208ce4){_0x18ea3e=_0x18ea3e-0x0;var _0x383c18=_0x7a54[_0x18ea3e];return _0x383c18;};'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')]('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index 75fd98f..f235981 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 _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x125339,_0x3e13b3){var _0x303dec=function(_0x299719){while(--_0x299719){_0x125339['push'](_0x125339['shift']());}};_0x303dec(++_0x3e13b3);}(_0x9f0e,0x116));var _0xe9f0=function(_0x45d2fa,_0x36752f){_0x45d2fa=_0x45d2fa-0x0;var _0x5df9d3=_0x9f0e[_0x45d2fa];return _0x5df9d3;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x0295,0x1f0));var _0x5029=function(_0x2967c1,_0x202a72){_0x2967c1=_0x2967c1-0x0;var _0x103397=_0x0295[_0x2967c1];return _0x103397;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 0993e7b..ee2fe43 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 _0x7359=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize','exports','STRING'];(function(_0xdd02,_0x18d520){var _0x1e5029=function(_0x246b3a){while(--_0x246b3a){_0xdd02['push'](_0xdd02['shift']());}};_0x1e5029(++_0x18d520);}(_0x7359,0x13d));var _0x9735=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7359[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x9735('0x0'));module[_0x9735('0x1')]={'integration':{'type':Sequelize[_0x9735('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x9735('0x2')]},'ticketId':{'type':Sequelize[_0x9735('0x2')]},'integrationId':{'type':Sequelize[_0x9735('0x3')]},'contacts':{'type':Sequelize[_0x9735('0x2')]},'uniqueid':{'type':Sequelize[_0x9735('0x2')]},'calleridnum':{'type':Sequelize[_0x9735('0x2')]},'calleridname':{'type':Sequelize[_0x9735('0x2')]},'queue':{'type':Sequelize[_0x9735('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x9735('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9735('0x3')]},'agentcomplete':{'type':Sequelize[_0x9735('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x9735('0x4')]},'talktime':{'type':Sequelize[_0x9735('0x3')]},'agentacw':{'type':Sequelize[_0x9735('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9735('0x3')]},'reason':{'type':Sequelize[_0x9735('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x9735('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x9735('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x9735('0x4')]},'lastevent':{'type':Sequelize[_0x9735('0x2')]},'channel':{'type':Sequelize[_0x9735('0x2')]},'channelstate':{'type':Sequelize[_0x9735('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9735('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9735('0x2')]},'connectedlinename':{'type':Sequelize[_0x9735('0x2')]},'language':{'type':Sequelize[_0x9735('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9735('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9735('0x2')]},'destchannel':{'type':Sequelize[_0x9735('0x2')]},'destchannelstate':{'type':Sequelize[_0x9735('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9735('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9735('0x2')]},'destcalleridname':{'type':Sequelize[_0x9735('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x9735('0x2')]},'destlanguage':{'type':Sequelize[_0x9735('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9735('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x9735('0x2')]},'subject':{'type':Sequelize[_0x9735('0x2')]},'from':{'type':Sequelize[_0x9735('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x9735('0x2')]},'attachment':{'type':Sequelize[_0x9735('0x6')]},'html':{'type':Sequelize[_0x9735('0x6')]},'text':{'type':Sequelize[_0x9735('0x6')]},'status':{'type':Sequelize[_0x9735('0x7')]('SENT',_0x9735('0x8'),_0x9735('0x9'),'FAILED')},'url':{'type':Sequelize[_0x9735('0x2')]},'app':{'type':Sequelize[_0x9735('0x2')]},'appdata':{'type':Sequelize[_0x9735('0x2')]},'projectId':{'type':Sequelize[_0x9735('0x3')]}}; \ No newline at end of file +var _0xcc1e=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','sequelize'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0xcc1e,0x1a3));var _0xecc1=function(_0x21aeed,_0x387040){_0x21aeed=_0x21aeed-0x0;var _0x12bad5=_0xcc1e[_0x21aeed];return _0x12bad5;};'use strict';var Sequelize=require(_0xecc1('0x0'));module[_0xecc1('0x1')]={'integration':{'type':Sequelize[_0xecc1('0x2')]},'eventChannel':{'type':Sequelize[_0xecc1('0x2')]},'exitStatus':{'type':Sequelize[_0xecc1('0x2')]},'ticketId':{'type':Sequelize[_0xecc1('0x2')]},'integrationId':{'type':Sequelize[_0xecc1('0x3')]},'contacts':{'type':Sequelize[_0xecc1('0x2')]},'uniqueid':{'type':Sequelize[_0xecc1('0x2')]},'calleridnum':{'type':Sequelize[_0xecc1('0x2')]},'calleridname':{'type':Sequelize[_0xecc1('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xecc1('0x2')]},'agentcalledAt':{'type':Sequelize[_0xecc1('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xecc1('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xecc1('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xecc1('0x3')]},'reason':{'type':Sequelize[_0xecc1('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xecc1('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xecc1('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xecc1('0x4')]},'lastevent':{'type':Sequelize[_0xecc1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xecc1('0x3')]},'channelstatedesc':{'type':Sequelize[_0xecc1('0x2')]},'connectedlinenum':{'type':Sequelize[_0xecc1('0x2')]},'connectedlinename':{'type':Sequelize[_0xecc1('0x2')]},'language':{'type':Sequelize[_0xecc1('0x2')]},'accountcode':{'type':Sequelize[_0xecc1('0x2')]},'context':{'type':Sequelize[_0xecc1('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xecc1('0x2')]},'destchannel':{'type':Sequelize[_0xecc1('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xecc1('0x2')]},'destcalleridnum':{'type':Sequelize[_0xecc1('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xecc1('0x2')]},'destlanguage':{'type':Sequelize[_0xecc1('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xecc1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xecc1('0x2')]},'messageId':{'type':Sequelize[_0xecc1('0x2')]},'inReplyTo':{'type':Sequelize[_0xecc1('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xecc1('0x2')]},'to':{'type':Sequelize[_0xecc1('0x2')]},'cc':{'type':Sequelize[_0xecc1('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xecc1('0x6')]},'text':{'type':Sequelize[_0xecc1('0x6')]},'status':{'type':Sequelize[_0xecc1('0x7')](_0xecc1('0x8'),'SENDING',_0xecc1('0x9'),'FAILED')},'url':{'type':Sequelize[_0xecc1('0x2')]},'app':{'type':Sequelize[_0xecc1('0x2')]},'appdata':{'type':Sequelize[_0xecc1('0x2')]},'projectId':{'type':Sequelize[_0xecc1('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b664e22..4f88e82 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 _0xc751=['query','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','sendStatus','error','stack','name','send','IntegrationReport','rawAttributes','type','key','model','map','filters','intersection','attributes','fields','length'];(function(_0x26b8db,_0x4b1ac9){var _0x168fd5=function(_0x196fe9){while(--_0x196fe9){_0x26b8db['push'](_0x26b8db['shift']());}};_0x168fd5(++_0x4b1ac9);}(_0xc751,0xfa));var _0x1c75=function(_0x236ed6,_0x562e24){_0x236ed6=_0x236ed6-0x0;var _0x2507e4=_0xc751[_0x236ed6];return _0x2507e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c75('0x0'));var zipdir=require(_0x1c75('0x1'));var jsonpatch=require(_0x1c75('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1c75('0x3'));var Mustache=require(_0x1c75('0x4'));var util=require(_0x1c75('0x5'));var path=require(_0x1c75('0x6'));var sox=require(_0x1c75('0x7'));var csv=require('to-csv');var ejs=require(_0x1c75('0x8'));var fs=require('fs');var fs_extra=require(_0x1c75('0x9'));var _=require('lodash');var squel=require(_0x1c75('0xa'));var crypto=require(_0x1c75('0xb'));var jsforce=require(_0x1c75('0xc'));var deskjs=require(_0x1c75('0xd'));var toCsv=require(_0x1c75('0xe'));var querystring=require(_0x1c75('0xf'));var Papa=require(_0x1c75('0x10'));var Redis=require(_0x1c75('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1c75('0x12'));var hardwareService=require(_0x1c75('0x13'));var logger=require(_0x1c75('0x14'))(_0x1c75('0x15'));var utils=require(_0x1c75('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c75('0x17'));var db=require(_0x1c75('0x18'))['db'];function respondWithStatusCode(_0x535863,_0x2c763f){_0x2c763f=_0x2c763f||0xcc;return function(_0x428b23){if(_0x428b23){return _0x535863['sendStatus'](_0x2c763f);}return _0x535863[_0x1c75('0x19')](_0x2c763f)[_0x1c75('0x1a')]();};}function respondWithResult(_0x370944,_0x104e0f){_0x104e0f=_0x104e0f||0xc8;return function(_0x417c0e){if(_0x417c0e){return _0x370944[_0x1c75('0x19')](_0x104e0f)['json'](_0x417c0e);}};}function respondWithFilteredResult(_0x452c6c,_0x3f55f0){return function(_0x2cdc9c){if(_0x2cdc9c){var _0x368ac2=typeof _0x3f55f0['offset']===_0x1c75('0x1b')&&typeof _0x3f55f0['limit']===_0x1c75('0x1b');var _0x52f6a6=_0x2cdc9c[_0x1c75('0x1c')];var _0x3e4855=_0x368ac2?0x0:_0x3f55f0[_0x1c75('0x1d')];var _0x481467=_0x368ac2?_0x2cdc9c[_0x1c75('0x1c')]:_0x3f55f0[_0x1c75('0x1d')]+_0x3f55f0[_0x1c75('0x1e')];var _0x406136;if(_0x481467>=_0x52f6a6){_0x481467=_0x52f6a6;_0x406136=0xc8;}else{_0x406136=0xce;}_0x452c6c['status'](_0x406136);return _0x452c6c[_0x1c75('0x1f')](_0x1c75('0x20'),_0x3e4855+'-'+_0x481467+'/'+_0x52f6a6)[_0x1c75('0x21')](_0x2cdc9c);}return null;};}function patchUpdates(_0x1ab3f0){return function(_0x1df0b9){try{jsonpatch[_0x1c75('0x22')](_0x1df0b9,_0x1ab3f0,!![]);}catch(_0x2bf0de){return BPromise['reject'](_0x2bf0de);}return _0x1df0b9[_0x1c75('0x23')]();};}function saveUpdates(_0x5ca28e,_0xa7da5){return function(_0x1e04c0){if(_0x1e04c0){return _0x1e04c0[_0x1c75('0x24')](_0x5ca28e)['then'](function(_0x2eb78f){return _0x2eb78f;});}return null;};}function removeEntity(_0x37300e,_0x42c873){return function(_0x5259b2){if(_0x5259b2){return _0x5259b2[_0x1c75('0x25')]()['then'](function(){_0x37300e[_0x1c75('0x19')](0xcc)[_0x1c75('0x1a')]();});}};}function handleEntityNotFound(_0xca2ef1,_0x5f095f){return function(_0x1143d5){if(!_0x1143d5){_0xca2ef1[_0x1c75('0x26')](0x194);}return _0x1143d5;};}function handleError(_0x1a0264,_0x5d56e5){_0x5d56e5=_0x5d56e5||0x1f4;return function(_0x4c61dd){logger[_0x1c75('0x27')](_0x4c61dd[_0x1c75('0x28')]);if(_0x4c61dd['name']){delete _0x4c61dd[_0x1c75('0x29')];}_0x1a0264['status'](_0x5d56e5)[_0x1c75('0x2a')](_0x4c61dd);};}exports['index']=function(_0x2d9bc0,_0x4cf0c4){var _0x529d3d={},_0x32da41={},_0x4b12b1={'count':0x0,'rows':[]};var _0x11a444=_['map'](db[_0x1c75('0x2b')][_0x1c75('0x2c')],function(_0x21ceb1){return{'name':_0x21ceb1['fieldName'],'type':_0x21ceb1[_0x1c75('0x2d')][_0x1c75('0x2e')]};});_0x32da41[_0x1c75('0x2f')]=_[_0x1c75('0x30')](_0x11a444,_0x1c75('0x29'));_0x32da41['query']=_['keys'](_0x2d9bc0['query']);_0x32da41[_0x1c75('0x31')]=_[_0x1c75('0x32')](_0x32da41[_0x1c75('0x2f')],_0x32da41['query']);_0x529d3d[_0x1c75('0x33')]=_[_0x1c75('0x32')](_0x32da41[_0x1c75('0x2f')],qs[_0x1c75('0x34')](_0x2d9bc0['query'][_0x1c75('0x34')]));_0x529d3d[_0x1c75('0x33')]=_0x529d3d['attributes'][_0x1c75('0x35')]?_0x529d3d[_0x1c75('0x33')]:_0x32da41['model'];if(!_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x37')]('nolimit')){_0x529d3d['limit']=qs[_0x1c75('0x1e')](_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x1e')]);_0x529d3d[_0x1c75('0x1d')]=qs[_0x1c75('0x1d')](_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x1d')]);}_0x529d3d[_0x1c75('0x38')]=qs['sort'](_0x2d9bc0[_0x1c75('0x36')]['sort']);_0x529d3d[_0x1c75('0x39')]=qs[_0x1c75('0x31')](_[_0x1c75('0x3a')](_0x2d9bc0[_0x1c75('0x36')],_0x32da41['filters']),_0x11a444);if(_0x2d9bc0['query'][_0x1c75('0x3b')]){_0x529d3d['where']=_['merge'](_0x529d3d[_0x1c75('0x39')],{'$or':_[_0x1c75('0x30')](_0x11a444,function(_0x262824){if(_0x262824['type']!==_0x1c75('0x3c')){var _0x4876de={};_0x4876de[_0x262824['name']]={'$like':'%'+_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x3b')]+'%'};return _0x4876de;}})});}_0x529d3d=_[_0x1c75('0x3d')]({},_0x529d3d,_0x2d9bc0[_0x1c75('0x3e')]);var _0x19530d={'where':_0x529d3d['where']};return db[_0x1c75('0x2b')][_0x1c75('0x1c')](_0x19530d)[_0x1c75('0x3f')](function(_0x51ac6d){_0x4b12b1[_0x1c75('0x1c')]=_0x51ac6d;if(_0x2d9bc0[_0x1c75('0x36')][_0x1c75('0x40')]){_0x529d3d[_0x1c75('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0x1c75('0x42')](_0x529d3d);})[_0x1c75('0x3f')](function(_0xfdff3b){_0x4b12b1[_0x1c75('0x43')]=_0xfdff3b;return _0x4b12b1;})[_0x1c75('0x3f')](respondWithFilteredResult(_0x4cf0c4,_0x529d3d))[_0x1c75('0x44')](handleError(_0x4cf0c4,null));};exports[_0x1c75('0x45')]=function(_0x9e554f,_0x5b8251){var _0x5ad7af={'raw':![],'where':{'id':_0x9e554f[_0x1c75('0x46')]['id']}},_0x5b6a72={};_0x5b6a72[_0x1c75('0x2f')]=_['keys'](db['IntegrationReport']['rawAttributes']);_0x5b6a72['query']=_[_0x1c75('0x47')](_0x9e554f[_0x1c75('0x36')]);_0x5b6a72[_0x1c75('0x31')]=_[_0x1c75('0x32')](_0x5b6a72[_0x1c75('0x2f')],_0x5b6a72[_0x1c75('0x36')]);_0x5ad7af[_0x1c75('0x33')]=_['intersection'](_0x5b6a72[_0x1c75('0x2f')],qs[_0x1c75('0x34')](_0x9e554f['query'][_0x1c75('0x34')]));_0x5ad7af['attributes']=_0x5ad7af[_0x1c75('0x33')]['length']?_0x5ad7af[_0x1c75('0x33')]:_0x5b6a72['model'];if(_0x9e554f[_0x1c75('0x36')][_0x1c75('0x40')]){_0x5ad7af[_0x1c75('0x41')]=[{'all':!![]}];}_0x5ad7af=_[_0x1c75('0x3d')]({},_0x5ad7af,_0x9e554f['options']);return db[_0x1c75('0x2b')][_0x1c75('0x48')](_0x5ad7af)[_0x1c75('0x3f')](handleEntityNotFound(_0x5b8251,null))[_0x1c75('0x3f')](respondWithResult(_0x5b8251,null))[_0x1c75('0x44')](handleError(_0x5b8251,null));};exports[_0x1c75('0x49')]=function(_0x2a7e06,_0x2b9d4a){return db['IntegrationReport'][_0x1c75('0x49')](_0x2a7e06[_0x1c75('0x4a')],{})[_0x1c75('0x3f')](respondWithResult(_0x2b9d4a,0xc9))[_0x1c75('0x44')](handleError(_0x2b9d4a,null));};exports['update']=function(_0x50c3ff,_0x284c39){if(_0x50c3ff[_0x1c75('0x4a')]['id']){delete _0x50c3ff[_0x1c75('0x4a')]['id'];}return db[_0x1c75('0x2b')]['find']({'where':{'id':_0x50c3ff[_0x1c75('0x46')]['id']}})['then'](handleEntityNotFound(_0x284c39,null))[_0x1c75('0x3f')](saveUpdates(_0x50c3ff['body'],null))[_0x1c75('0x3f')](respondWithResult(_0x284c39,null))[_0x1c75('0x44')](handleError(_0x284c39,null));};exports['destroy']=function(_0x1fb3db,_0x224a80){return db['IntegrationReport'][_0x1c75('0x48')]({'where':{'id':_0x1fb3db[_0x1c75('0x46')]['id']}})[_0x1c75('0x3f')](handleEntityNotFound(_0x224a80,null))['then'](removeEntity(_0x224a80,null))['catch'](handleError(_0x224a80,null));};exports[_0x1c75('0x4b')]=function(_0x563def,_0x59addf){return db[_0x1c75('0x2b')][_0x1c75('0x4b')]()[_0x1c75('0x3f')](respondWithResult(_0x59addf,null))['catch'](handleError(_0x59addf,null));}; \ No newline at end of file +var _0x8aa2=['catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','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/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','nolimit','order','sort','where','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include'];(function(_0x515ff0,_0x44a0b1){var _0x132616=function(_0x449772){while(--_0x449772){_0x515ff0['push'](_0x515ff0['shift']());}};_0x132616(++_0x44a0b1);}(_0x8aa2,0x1c4));var _0x28aa=function(_0x58918b,_0x123a6d){_0x58918b=_0x58918b-0x0;var _0x10ffe8=_0x8aa2[_0x58918b];return _0x10ffe8;};'use strict';var emlformat=require(_0x28aa('0x0'));var rimraf=require(_0x28aa('0x1'));var zipdir=require(_0x28aa('0x2'));var jsonpatch=require(_0x28aa('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x28aa('0x4'));var Mustache=require(_0x28aa('0x5'));var util=require(_0x28aa('0x6'));var path=require(_0x28aa('0x7'));var sox=require(_0x28aa('0x8'));var csv=require(_0x28aa('0x9'));var ejs=require(_0x28aa('0xa'));var fs=require('fs');var fs_extra=require(_0x28aa('0xb'));var _=require(_0x28aa('0xc'));var squel=require(_0x28aa('0xd'));var crypto=require(_0x28aa('0xe'));var jsforce=require(_0x28aa('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x28aa('0x9'));var querystring=require(_0x28aa('0x10'));var Papa=require(_0x28aa('0x11'));var Redis=require(_0x28aa('0x12'));var authService=require(_0x28aa('0x13'));var qs=require(_0x28aa('0x14'));var as=require(_0x28aa('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x28aa('0x16'))(_0x28aa('0x17'));var utils=require(_0x28aa('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x28aa('0x19'))['db'];function respondWithStatusCode(_0x3dc168,_0x17a89b){_0x17a89b=_0x17a89b||0xcc;return function(_0x2a5779){if(_0x2a5779){return _0x3dc168[_0x28aa('0x1a')](_0x17a89b);}return _0x3dc168[_0x28aa('0x1b')](_0x17a89b)[_0x28aa('0x1c')]();};}function respondWithResult(_0x39e034,_0x57df2c){_0x57df2c=_0x57df2c||0xc8;return function(_0x4a4700){if(_0x4a4700){return _0x39e034[_0x28aa('0x1b')](_0x57df2c)['json'](_0x4a4700);}};}function respondWithFilteredResult(_0x315e2c,_0x369e4d){return function(_0x580b30){if(_0x580b30){var _0x305c94=typeof _0x369e4d[_0x28aa('0x1d')]==='undefined'&&typeof _0x369e4d[_0x28aa('0x1e')]===_0x28aa('0x1f');var _0x6cd81d=_0x580b30['count'];var _0x188bf1=_0x305c94?0x0:_0x369e4d[_0x28aa('0x1d')];var _0x88432b=_0x305c94?_0x580b30[_0x28aa('0x20')]:_0x369e4d[_0x28aa('0x1d')]+_0x369e4d['limit'];var _0x57f9b2;if(_0x88432b>=_0x6cd81d){_0x88432b=_0x6cd81d;_0x57f9b2=0xc8;}else{_0x57f9b2=0xce;}_0x315e2c[_0x28aa('0x1b')](_0x57f9b2);return _0x315e2c['set'](_0x28aa('0x21'),_0x188bf1+'-'+_0x88432b+'/'+_0x6cd81d)[_0x28aa('0x22')](_0x580b30);}return null;};}function patchUpdates(_0x284d1a){return function(_0x68fa72){try{jsonpatch[_0x28aa('0x23')](_0x68fa72,_0x284d1a,!![]);}catch(_0x44362b){return BPromise[_0x28aa('0x24')](_0x44362b);}return _0x68fa72[_0x28aa('0x25')]();};}function saveUpdates(_0x4e9417,_0x236a3e){return function(_0x1097c6){if(_0x1097c6){return _0x1097c6[_0x28aa('0x26')](_0x4e9417)[_0x28aa('0x27')](function(_0x4bd967){return _0x4bd967;});}return null;};}function removeEntity(_0xd897d4,_0x17184d){return function(_0x35750c){if(_0x35750c){return _0x35750c['destroy']()[_0x28aa('0x27')](function(){_0xd897d4['status'](0xcc)[_0x28aa('0x1c')]();});}};}function handleEntityNotFound(_0x4b38ce,_0x3bd4e3){return function(_0x506e72){if(!_0x506e72){_0x4b38ce['sendStatus'](0x194);}return _0x506e72;};}function handleError(_0x3c6e8a,_0x4e68d6){_0x4e68d6=_0x4e68d6||0x1f4;return function(_0x14443a){logger[_0x28aa('0x28')](_0x14443a[_0x28aa('0x29')]);if(_0x14443a[_0x28aa('0x2a')]){delete _0x14443a[_0x28aa('0x2a')];}_0x3c6e8a[_0x28aa('0x1b')](_0x4e68d6)[_0x28aa('0x2b')](_0x14443a);};}exports['index']=function(_0x10066b,_0x3a5a1f){var _0xe54aec={},_0x85dbc3={},_0x582c0c={'count':0x0,'rows':[]};var _0x6e28f5=_['map'](db['IntegrationReport'][_0x28aa('0x2c')],function(_0x34988d){return{'name':_0x34988d[_0x28aa('0x2d')],'type':_0x34988d[_0x28aa('0x2e')][_0x28aa('0x2f')]};});_0x85dbc3[_0x28aa('0x30')]=_[_0x28aa('0x31')](_0x6e28f5,'name');_0x85dbc3[_0x28aa('0x32')]=_[_0x28aa('0x33')](_0x10066b['query']);_0x85dbc3[_0x28aa('0x34')]=_[_0x28aa('0x35')](_0x85dbc3['model'],_0x85dbc3[_0x28aa('0x32')]);_0xe54aec['attributes']=_[_0x28aa('0x35')](_0x85dbc3[_0x28aa('0x30')],qs['fields'](_0x10066b[_0x28aa('0x32')]['fields']));_0xe54aec[_0x28aa('0x36')]=_0xe54aec[_0x28aa('0x36')]['length']?_0xe54aec['attributes']:_0x85dbc3['model'];if(!_0x10066b[_0x28aa('0x32')]['hasOwnProperty'](_0x28aa('0x37'))){_0xe54aec[_0x28aa('0x1e')]=qs['limit'](_0x10066b[_0x28aa('0x32')][_0x28aa('0x1e')]);_0xe54aec[_0x28aa('0x1d')]=qs['offset'](_0x10066b['query'][_0x28aa('0x1d')]);}_0xe54aec[_0x28aa('0x38')]=qs['sort'](_0x10066b[_0x28aa('0x32')][_0x28aa('0x39')]);_0xe54aec[_0x28aa('0x3a')]=qs[_0x28aa('0x34')](_['pick'](_0x10066b['query'],_0x85dbc3[_0x28aa('0x34')]),_0x6e28f5);if(_0x10066b[_0x28aa('0x32')][_0x28aa('0x3b')]){_0xe54aec['where']=_[_0x28aa('0x3c')](_0xe54aec[_0x28aa('0x3a')],{'$or':_[_0x28aa('0x31')](_0x6e28f5,function(_0x4fcb92){if(_0x4fcb92[_0x28aa('0x2e')]!==_0x28aa('0x3d')){var _0x2c33b5={};_0x2c33b5[_0x4fcb92[_0x28aa('0x2a')]]={'$like':'%'+_0x10066b['query'][_0x28aa('0x3b')]+'%'};return _0x2c33b5;}})});}_0xe54aec=_[_0x28aa('0x3c')]({},_0xe54aec,_0x10066b[_0x28aa('0x3e')]);var _0x13c6c3={'where':_0xe54aec[_0x28aa('0x3a')]};return db[_0x28aa('0x3f')]['count'](_0x13c6c3)[_0x28aa('0x27')](function(_0x82987f){_0x582c0c[_0x28aa('0x20')]=_0x82987f;if(_0x10066b[_0x28aa('0x32')][_0x28aa('0x40')]){_0xe54aec[_0x28aa('0x41')]=[{'all':!![]}];}return db[_0x28aa('0x3f')]['findAll'](_0xe54aec);})[_0x28aa('0x27')](function(_0x1ddb34){_0x582c0c['rows']=_0x1ddb34;return _0x582c0c;})[_0x28aa('0x27')](respondWithFilteredResult(_0x3a5a1f,_0xe54aec))[_0x28aa('0x42')](handleError(_0x3a5a1f,null));};exports[_0x28aa('0x43')]=function(_0xd60630,_0x5e7ce7){var _0x4044f0={'raw':![],'where':{'id':_0xd60630[_0x28aa('0x44')]['id']}},_0x346293={};_0x346293['model']=_[_0x28aa('0x33')](db['IntegrationReport'][_0x28aa('0x2c')]);_0x346293[_0x28aa('0x32')]=_[_0x28aa('0x33')](_0xd60630[_0x28aa('0x32')]);_0x346293['filters']=_[_0x28aa('0x35')](_0x346293[_0x28aa('0x30')],_0x346293[_0x28aa('0x32')]);_0x4044f0[_0x28aa('0x36')]=_[_0x28aa('0x35')](_0x346293[_0x28aa('0x30')],qs[_0x28aa('0x45')](_0xd60630[_0x28aa('0x32')]['fields']));_0x4044f0[_0x28aa('0x36')]=_0x4044f0[_0x28aa('0x36')]['length']?_0x4044f0['attributes']:_0x346293[_0x28aa('0x30')];if(_0xd60630['query']['includeAll']){_0x4044f0[_0x28aa('0x41')]=[{'all':!![]}];}_0x4044f0=_['merge']({},_0x4044f0,_0xd60630[_0x28aa('0x3e')]);return db['IntegrationReport'][_0x28aa('0x46')](_0x4044f0)[_0x28aa('0x27')](handleEntityNotFound(_0x5e7ce7,null))['then'](respondWithResult(_0x5e7ce7,null))['catch'](handleError(_0x5e7ce7,null));};exports[_0x28aa('0x47')]=function(_0x518752,_0x482041){return db[_0x28aa('0x3f')][_0x28aa('0x47')](_0x518752[_0x28aa('0x48')],{})[_0x28aa('0x27')](respondWithResult(_0x482041,0xc9))['catch'](handleError(_0x482041,null));};exports['update']=function(_0x58289d,_0x5a7ab9){if(_0x58289d[_0x28aa('0x48')]['id']){delete _0x58289d[_0x28aa('0x48')]['id'];}return db['IntegrationReport'][_0x28aa('0x46')]({'where':{'id':_0x58289d[_0x28aa('0x44')]['id']}})[_0x28aa('0x27')](handleEntityNotFound(_0x5a7ab9,null))[_0x28aa('0x27')](saveUpdates(_0x58289d['body'],null))['then'](respondWithResult(_0x5a7ab9,null))[_0x28aa('0x42')](handleError(_0x5a7ab9,null));};exports['destroy']=function(_0x1da1d0,_0x180392){return db[_0x28aa('0x3f')][_0x28aa('0x46')]({'where':{'id':_0x1da1d0[_0x28aa('0x44')]['id']}})[_0x28aa('0x27')](handleEntityNotFound(_0x180392,null))[_0x28aa('0x27')](removeEntity(_0x180392,null))['catch'](handleError(_0x180392,null));};exports[_0x28aa('0x49')]=function(_0x441d13,_0x55d5af){return db[_0x28aa('0x3f')][_0x28aa('0x49')]()['then'](respondWithResult(_0x55d5af,null))[_0x28aa('0x42')](handleError(_0x55d5af,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 99b4f26..e1b355f 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 _0x9ff8=['report_integration','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0x9ff8,0x79));var _0x89ff=function(_0x1243f4,_0x212a75){_0x1243f4=_0x1243f4-0x0;var _0x28c549=_0x9ff8[_0x1243f4];return _0x28c549;};'use strict';var _=require('lodash');var util=require(_0x89ff('0x0'));var logger=require(_0x89ff('0x1'))(_0x89ff('0x2'));var moment=require('moment');var BPromise=require(_0x89ff('0x3'));var rp=require(_0x89ff('0x4'));var fs=require('fs');var path=require(_0x89ff('0x5'));var rimraf=require(_0x89ff('0x6'));var config=require(_0x89ff('0x7'));var attributes=require('./integrationReport.attributes');module['exports']=function(_0x540d47,_0x9ce2ad){return _0x540d47[_0x89ff('0x8')]('IntegrationReport',attributes,{'tableName':_0x89ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad03=['request-promise','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','report_integration','lodash','util','api','moment','bluebird'];(function(_0x5a6b28,_0x5fd642){var _0x1c0764=function(_0x12d3de){while(--_0x12d3de){_0x5a6b28['push'](_0x5a6b28['shift']());}};_0x1c0764(++_0x5fd642);}(_0xad03,0x8b));var _0x3ad0=function(_0x44ecf0,_0xeeabbd){_0x44ecf0=_0x44ecf0-0x0;var _0x5e8acd=_0xad03[_0x44ecf0];return _0x5e8acd;};'use strict';var _=require(_0x3ad0('0x0'));var util=require(_0x3ad0('0x1'));var logger=require('../../config/logger')(_0x3ad0('0x2'));var moment=require(_0x3ad0('0x3'));var BPromise=require(_0x3ad0('0x4'));var rp=require(_0x3ad0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ad0('0x6'));var config=require(_0x3ad0('0x7'));var attributes=require(_0x3ad0('0x8'));module['exports']=function(_0x10bf1e,_0x550a37){return _0x10bf1e[_0x3ad0('0x9')](_0x3ad0('0xa'),attributes,{'tableName':_0x3ad0('0xb'),'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 f614022..09156b5 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x165fa0,_0x3a25a9){var _0x5d58bb=function(_0x2dfaee){while(--_0x2dfaee){_0x165fa0['push'](_0x165fa0['shift']());}};_0x5d58bb(++_0x3a25a9);}(_0x2ef3,0xba));var _0x32ef=function(_0x1e2b69,_0x5781eb){_0x1e2b69=_0x1e2b69-0x0;var _0x8d585c=_0x2ef3[_0x1e2b69];return _0x8d585c;};'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')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2559ed,_0x4d8534){var _0x4a5536=function(_0x3a0729){while(--_0x3a0729){_0x2559ed['push'](_0x2559ed['shift']());}};_0x4a5536(++_0x4d8534);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index aa723f4..5c632f7 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 _0x5692=['post','addIntervals','put','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','addInterval'];(function(_0x9ac89b,_0x25b61d){var _0x40da74=function(_0x2643a2){while(--_0x2643a2){_0x9ac89b['push'](_0x9ac89b['shift']());}};_0x40da74(++_0x25b61d);}(_0x5692,0x8b));var _0x2569=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5692[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x2569('0x0'));var path=require(_0x2569('0x1'));var timeout=require('connect-timeout');var express=require(_0x2569('0x2'));var router=express[_0x2569('0x3')]();var fs_extra=require(_0x2569('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2569('0x5'));var config=require(_0x2569('0x6'));var controller=require(_0x2569('0x7'));router[_0x2569('0x8')]('/',auth[_0x2569('0x9')](),controller[_0x2569('0xa')]);router[_0x2569('0x8')]('/:id',auth[_0x2569('0x9')](),controller[_0x2569('0xb')]);router['get'](_0x2569('0xc'),auth[_0x2569('0x9')](),controller[_0x2569('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x2569('0xc'),auth['isAuthenticated'](),controller[_0x2569('0xe')]);router[_0x2569('0xf')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x2569('0x10')]);router[_0x2569('0x11')]('/:id',auth[_0x2569('0x9')](),controller['update']);router[_0x2569('0x12')](_0x2569('0x13'),auth[_0x2569('0x9')](),controller[_0x2569('0x14')]);module[_0x2569('0x15')]=router; \ No newline at end of file +var _0x3831=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','delete','/:id'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0x3831,0x14c));var _0x1383=function(_0x31a9d1,_0x283ae9){_0x31a9d1=_0x31a9d1-0x0;var _0x127d8e=_0x3831[_0x31a9d1];return _0x127d8e;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/:id',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0xd')]('/',auth[_0x1383('0x9')](),controller['create']);router[_0x1383('0xd')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xe')]);router[_0x1383('0xd')]('/:id/sub_intervals/create_many',auth[_0x1383('0x9')](),controller[_0x1383('0xf')]);router[_0x1383('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1383('0x11')]);router[_0x1383('0x12')](_0x1383('0x13'),auth[_0x1383('0x9')](),controller[_0x1383('0x14')]);module[_0x1383('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 b5bbd6e..1007d92 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 _0x4297=['sequelize','STRING'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x4297,0x1b6));var _0x7429=function(_0x497df2,_0x2a44a4){_0x497df2=_0x497df2-0x0;var _0x460db7=_0x4297[_0x497df2];return _0x460db7;};'use strict';var Sequelize=require(_0x7429('0x0'));module['exports']={'name':{'type':Sequelize[_0x7429('0x1')]},'description':{'type':Sequelize[_0x7429('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xe44a=['exports','STRING'];(function(_0x16087e,_0x1f868e){var _0x443813=function(_0x101467){while(--_0x101467){_0x16087e['push'](_0x16087e['shift']());}};_0x443813(++_0x1f868e);}(_0xe44a,0x1e2));var _0xae44=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe44a[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require('sequelize');module[_0xae44('0x0')]={'name':{'type':Sequelize[_0xae44('0x1')]},'description':{'type':Sequelize[_0xae44('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 8fee8b9..1d406c0 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 _0xb68e=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','addInterval','IntervalId','getIntervals','findOne','length','sort','nolimit','addIntervals','sequelize','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','limit','order','where','pick','type','VIRTUAL','filter','merge','options','findAll','rows','catch','params','include','find'];(function(_0x4b9a3c,_0x40898a){var _0x4c16e9=function(_0x20d018){while(--_0x20d018){_0x4b9a3c['push'](_0x4b9a3c['shift']());}};_0x4c16e9(++_0x40898a);}(_0xb68e,0x122));var _0xeb68=function(_0x169845,_0x33d35b){_0x169845=_0x169845-0x0;var _0x45fc96=_0xb68e[_0x169845];return _0x45fc96;};'use strict';var emlformat=require(_0xeb68('0x0'));var rimraf=require(_0xeb68('0x1'));var zipdir=require(_0xeb68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb68('0x3'));var moment=require('moment');var BPromise=require(_0xeb68('0x4'));var Mustache=require(_0xeb68('0x5'));var util=require(_0xeb68('0x6'));var path=require(_0xeb68('0x7'));var sox=require(_0xeb68('0x8'));var csv=require('to-csv');var ejs=require(_0xeb68('0x9'));var fs=require('fs');var fs_extra=require(_0xeb68('0xa'));var _=require(_0xeb68('0xb'));var squel=require(_0xeb68('0xc'));var crypto=require(_0xeb68('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeb68('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb68('0xf'));var Papa=require(_0xeb68('0x10'));var Redis=require(_0xeb68('0x11'));var authService=require(_0xeb68('0x12'));var qs=require(_0xeb68('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb68('0x14'));var logger=require('../../config/logger')(_0xeb68('0x15'));var utils=require(_0xeb68('0x16'));var config=require(_0xeb68('0x17'));var licenseUtil=require(_0xeb68('0x18'));var db=require(_0xeb68('0x19'))['db'];var extensions=require(_0xeb68('0x1a'));function respondWithStatusCode(_0x4a4746,_0x301001){_0x301001=_0x301001||0xcc;return function(_0x228769){if(_0x228769){return _0x4a4746['sendStatus'](_0x301001);}return _0x4a4746[_0xeb68('0x1b')](_0x301001)[_0xeb68('0x1c')]();};}function respondWithResult(_0x4d3a2a,_0x3ed07a){_0x3ed07a=_0x3ed07a||0xc8;return function(_0x5f0799){if(_0x5f0799){return _0x4d3a2a['status'](_0x3ed07a)[_0xeb68('0x1d')](_0x5f0799);}};}function respondWithFilteredResult(_0xe3967a,_0x37da52){return function(_0x23e9e5){if(_0x23e9e5){var _0x5a6236=typeof _0x37da52['offset']==='undefined'&&typeof _0x37da52['limit']===_0xeb68('0x1e');var _0x397f7c=_0x23e9e5[_0xeb68('0x1f')];var _0x3c9b4d=_0x5a6236?0x0:_0x37da52['offset'];var _0x40300a=_0x5a6236?_0x23e9e5['count']:_0x37da52[_0xeb68('0x20')]+_0x37da52['limit'];var _0x2e28e3;if(_0x40300a>=_0x397f7c){_0x40300a=_0x397f7c;_0x2e28e3=0xc8;}else{_0x2e28e3=0xce;}_0xe3967a[_0xeb68('0x1b')](_0x2e28e3);return _0xe3967a[_0xeb68('0x21')](_0xeb68('0x22'),_0x3c9b4d+'-'+_0x40300a+'/'+_0x397f7c)[_0xeb68('0x1d')](_0x23e9e5);}return null;};}function patchUpdates(_0x111451){return function(_0x35986b){try{jsonpatch['apply'](_0x35986b,_0x111451,!![]);}catch(_0x152278){return BPromise[_0xeb68('0x23')](_0x152278);}return _0x35986b[_0xeb68('0x24')]();};}function saveUpdates(_0x2ac6ce,_0x2321fc){return function(_0x2531a5){if(_0x2531a5){return _0x2531a5[_0xeb68('0x25')](_0x2ac6ce)[_0xeb68('0x26')](function(_0xaa580c){return _0xaa580c;});}return null;};}function removeEntity(_0x5b4545,_0x178817){return function(_0x1c6df0){if(_0x1c6df0){return _0x1c6df0[_0xeb68('0x27')]()[_0xeb68('0x26')](function(){var _0x4df0e0=_0x1c6df0[_0xeb68('0x28')]({'plain':!![]});var _0x31c2bb=_0xeb68('0x29');return db[_0xeb68('0x2a')][_0xeb68('0x27')]({'where':{'type':_0x31c2bb,'resourceId':_0x4df0e0['id']}})[_0xeb68('0x26')](function(){return _0x1c6df0;});})[_0xeb68('0x26')](function(){_0x5b4545[_0xeb68('0x1b')](0xcc)[_0xeb68('0x1c')]();});}};}function handleEntityNotFound(_0x8be6c5,_0x4cac0a){return function(_0x502e76){if(!_0x502e76){_0x8be6c5['sendStatus'](0x194);}return _0x502e76;};}function handleError(_0x5d2053,_0x25940b){_0x25940b=_0x25940b||0x1f4;return function(_0x414a51){logger['error'](_0x414a51[_0xeb68('0x2b')]);if(_0x414a51[_0xeb68('0x2c')]){delete _0x414a51[_0xeb68('0x2c')];}_0x5d2053[_0xeb68('0x1b')](_0x25940b)[_0xeb68('0x2d')](_0x414a51);};}exports[_0xeb68('0x2e')]=function(_0x3b5e62,_0x213df2){var _0x61e549={},_0x6f045e={},_0x4b145e={'count':0x0,'rows':[]};var _0x22a33f=_[_0xeb68('0x2f')](db[_0xeb68('0x30')][_0xeb68('0x31')],function(_0x307659){return{'name':_0x307659[_0xeb68('0x32')],'type':_0x307659['type']['key']};});_0x6f045e['model']=_[_0xeb68('0x2f')](_0x22a33f,_0xeb68('0x2c'));_0x6f045e[_0xeb68('0x33')]=_[_0xeb68('0x34')](_0x3b5e62['query']);_0x6f045e[_0xeb68('0x35')]=_[_0xeb68('0x36')](_0x6f045e['model'],_0x6f045e['query']);_0x61e549[_0xeb68('0x37')]=_['intersection'](_0x6f045e['model'],qs['fields'](_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x38')]));_0x61e549[_0xeb68('0x37')]=_0x61e549[_0xeb68('0x37')]['length']?_0x61e549[_0xeb68('0x37')]:_0x6f045e[_0xeb68('0x39')];if(!_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x3a')]('nolimit')){_0x61e549[_0xeb68('0x3b')]=qs[_0xeb68('0x3b')](_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x3b')]);_0x61e549[_0xeb68('0x20')]=qs[_0xeb68('0x20')](_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x20')]);}_0x61e549[_0xeb68('0x3c')]=qs['sort'](_0x3b5e62['query']['sort']);_0x61e549[_0xeb68('0x3d')]=qs[_0xeb68('0x35')](_[_0xeb68('0x3e')](_0x3b5e62[_0xeb68('0x33')],_0x6f045e[_0xeb68('0x35')]),_0x22a33f);if(_0x3b5e62[_0xeb68('0x33')]['filter']){_0x61e549[_0xeb68('0x3d')]=_['merge'](_0x61e549[_0xeb68('0x3d')],{'$or':_[_0xeb68('0x2f')](_0x22a33f,function(_0x4be157){if(_0x4be157[_0xeb68('0x3f')]!==_0xeb68('0x40')){var _0x46eca6={};_0x46eca6[_0x4be157[_0xeb68('0x2c')]]={'$like':'%'+_0x3b5e62[_0xeb68('0x33')][_0xeb68('0x41')]+'%'};return _0x46eca6;}})});}_0x61e549=_[_0xeb68('0x42')]({},_0x61e549,_0x3b5e62[_0xeb68('0x43')]);var _0x1bdd14={'where':_0x61e549[_0xeb68('0x3d')]};return db[_0xeb68('0x30')][_0xeb68('0x1f')](_0x1bdd14)['then'](function(_0x53c172){_0x4b145e[_0xeb68('0x1f')]=_0x53c172;if(_0x3b5e62[_0xeb68('0x33')]['includeAll']){_0x61e549['include']=[{'all':!![]}];}return db[_0xeb68('0x30')][_0xeb68('0x44')](_0x61e549);})[_0xeb68('0x26')](function(_0x2dcd4c){_0x4b145e[_0xeb68('0x45')]=_0x2dcd4c;return _0x4b145e;})['then'](respondWithFilteredResult(_0x213df2,_0x61e549))[_0xeb68('0x46')](handleError(_0x213df2,null));};exports['show']=function(_0x4cabcc,_0x28c629){var _0x269a5d={'raw':!![],'where':{'id':_0x4cabcc[_0xeb68('0x47')]['id']}},_0x1c655f={};_0x1c655f[_0xeb68('0x39')]=_['keys'](db[_0xeb68('0x30')][_0xeb68('0x31')]);_0x1c655f[_0xeb68('0x33')]=_[_0xeb68('0x34')](_0x4cabcc[_0xeb68('0x33')]);_0x1c655f[_0xeb68('0x35')]=_[_0xeb68('0x36')](_0x1c655f[_0xeb68('0x39')],_0x1c655f[_0xeb68('0x33')]);_0x269a5d[_0xeb68('0x37')]=_['intersection'](_0x1c655f[_0xeb68('0x39')],qs[_0xeb68('0x38')](_0x4cabcc[_0xeb68('0x33')][_0xeb68('0x38')]));_0x269a5d[_0xeb68('0x37')]=_0x269a5d['attributes']['length']?_0x269a5d[_0xeb68('0x37')]:_0x1c655f[_0xeb68('0x39')];if(_0x4cabcc[_0xeb68('0x33')]['includeAll']){_0x269a5d[_0xeb68('0x48')]=[{'all':!![]}];}_0x269a5d=_[_0xeb68('0x42')]({},_0x269a5d,_0x4cabcc['options']);return db[_0xeb68('0x30')][_0xeb68('0x49')](_0x269a5d)['then'](handleEntityNotFound(_0x28c629,null))[_0xeb68('0x26')](respondWithResult(_0x28c629,null))['catch'](handleError(_0x28c629,null));};exports[_0xeb68('0x4a')]=function(_0x1bee19,_0x5765e1){return db[_0xeb68('0x30')][_0xeb68('0x4a')](_0x1bee19[_0xeb68('0x4b')],{})[_0xeb68('0x26')](function(_0xee49cd){var _0x22c855=_0x1bee19[_0xeb68('0x4c')][_0xeb68('0x28')]({'plain':!![]});if(!_0x22c855)throw new Error(_0xeb68('0x4d'));if(_0x22c855[_0xeb68('0x4e')]==='user'){var _0x1f65b4=_0xee49cd['get']({'plain':!![]});var _0x6ce704=_0xeb68('0x29');return db[_0xeb68('0x4f')]['find']({'where':{'name':_0x6ce704,'userProfileId':_0x22c855[_0xeb68('0x50')]},'raw':!![]})['then'](function(_0x2611b4){if(_0x2611b4&&_0x2611b4['autoAssociation']===0x0){return db[_0xeb68('0x2a')][_0xeb68('0x4a')]({'name':_0x1f65b4[_0xeb68('0x2c')],'resourceId':_0x1f65b4['id'],'type':_0x2611b4[_0xeb68('0x2c')],'sectionId':_0x2611b4['id']},{})[_0xeb68('0x26')](function(){return _0xee49cd;});}else{return _0xee49cd;}})[_0xeb68('0x46')](function(_0x179210){logger[_0xeb68('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x179210);throw _0x179210;});}return _0xee49cd;})['then'](respondWithResult(_0x5765e1,0xc9))[_0xeb68('0x46')](handleError(_0x5765e1,null));};exports['update']=function(_0x42f6ea,_0x51caf1){if(_0x42f6ea['body']['id']){delete _0x42f6ea[_0xeb68('0x4b')]['id'];}return db['Interval'][_0xeb68('0x49')]({'where':{'id':_0x42f6ea[_0xeb68('0x47')]['id']}})['then'](handleEntityNotFound(_0x51caf1,null))[_0xeb68('0x26')](saveUpdates(_0x42f6ea[_0xeb68('0x4b')],null))[_0xeb68('0x26')](respondWithResult(_0x51caf1,null))['catch'](handleError(_0x51caf1,null));};exports[_0xeb68('0x27')]=function(_0x262def,_0x166308){return db[_0xeb68('0x30')][_0xeb68('0x49')]({'where':{'id':_0x262def[_0xeb68('0x47')]['id']}})[_0xeb68('0x26')](handleEntityNotFound(_0x166308,null))['then'](removeEntity(_0x166308,null))[_0xeb68('0x46')](handleError(_0x166308,null));};exports[_0xeb68('0x52')]=function(_0x89ba36,_0xd8e218,_0x17a2ea){if(_0x89ba36[_0xeb68('0x4b')]['id']){delete _0x89ba36[_0xeb68('0x4b')]['id'];}return db['Interval'][_0xeb68('0x49')]({'where':{'id':_0x89ba36[_0xeb68('0x47')]['id']}})[_0xeb68('0x26')](handleEntityNotFound(_0xd8e218,null))['then'](function(_0x1412d8){if(_0x1412d8){_0x89ba36[_0xeb68('0x4b')][_0xeb68('0x53')]=_0x1412d8['id'];return db[_0xeb68('0x30')][_0xeb68('0x4a')](_0x89ba36[_0xeb68('0x4b')]);}})[_0xeb68('0x26')](respondWithResult(_0xd8e218,null))[_0xeb68('0x46')](handleError(_0xd8e218,null));};exports[_0xeb68('0x54')]=function(_0x1bb0c6,_0x3106ce,_0x3813ec){var _0x380b7e={};var _0x5cf423={};var _0x556554;var _0x14f10b;return db[_0xeb68('0x30')][_0xeb68('0x55')]({'where':{'id':_0x1bb0c6[_0xeb68('0x47')]['id']}})[_0xeb68('0x26')](handleEntityNotFound(_0x3106ce,null))[_0xeb68('0x26')](function(_0x1e5480){if(_0x1e5480){_0x556554=_0x1e5480;_0x5cf423['model']=_[_0xeb68('0x34')](db[_0xeb68('0x30')][_0xeb68('0x31')]);_0x5cf423[_0xeb68('0x33')]=_['keys'](_0x1bb0c6[_0xeb68('0x33')]);_0x5cf423['filters']=_[_0xeb68('0x36')](_0x5cf423['model'],_0x5cf423['query']);_0x380b7e[_0xeb68('0x37')]=_[_0xeb68('0x36')](_0x5cf423[_0xeb68('0x39')],qs[_0xeb68('0x38')](_0x1bb0c6['query']['fields']));_0x380b7e['attributes']=_0x380b7e['attributes'][_0xeb68('0x56')]?_0x380b7e[_0xeb68('0x37')]:_0x5cf423[_0xeb68('0x39')];_0x380b7e[_0xeb68('0x3c')]=qs['sort'](_0x1bb0c6['query'][_0xeb68('0x57')]);_0x380b7e[_0xeb68('0x3d')]=qs['filters'](_['pick'](_0x1bb0c6[_0xeb68('0x33')],_0x5cf423[_0xeb68('0x35')]));if(_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x41')]){_0x380b7e[_0xeb68('0x3d')]=_[_0xeb68('0x42')](_0x380b7e[_0xeb68('0x3d')],{'$or':_['map'](_0x380b7e[_0xeb68('0x37')],function(_0x52c2b9){var _0x389524={};_0x389524[_0x52c2b9]={'$like':'%'+_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x41')]+'%'};return _0x389524;})});}_0x380b7e=_[_0xeb68('0x42')]({},_0x380b7e,_0x1bb0c6['options']);return _0x556554[_0xeb68('0x54')](_0x380b7e);}})[_0xeb68('0x26')](function(_0x5976c6){if(_0x5976c6){_0x14f10b=_0x5976c6['length'];if(!_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x3a')](_0xeb68('0x58'))){_0x380b7e[_0xeb68('0x3b')]=qs[_0xeb68('0x3b')](_0x1bb0c6['query']['limit']);_0x380b7e[_0xeb68('0x20')]=qs[_0xeb68('0x20')](_0x1bb0c6[_0xeb68('0x33')][_0xeb68('0x20')]);}return _0x556554['getIntervals'](_0x380b7e);}})['then'](function(_0x30de41){if(_0x30de41){return _0x30de41?{'count':_0x14f10b,'rows':_0x30de41}:null;}})[_0xeb68('0x26')](respondWithResult(_0x3106ce,null))[_0xeb68('0x46')](handleError(_0x3106ce,null));};exports[_0xeb68('0x59')]=function(_0x3d21c3,_0x4a4f8d,_0x3fa5e1){return db[_0xeb68('0x30')]['findOne']({'where':{'id':_0x3d21c3['params']['id']}})['then'](handleEntityNotFound(_0x4a4f8d,null))[_0xeb68('0x26')](function(_0x3b38bf){if(_0x3b38bf){return db[_0xeb68('0x5a')]['transaction'](function(_0x1b0c41){return db['Interval'][_0xeb68('0x27')]({'where':{'IntervalId':_0x3d21c3[_0xeb68('0x47')]['id']},'transaction':_0x1b0c41})['then'](function(_0x422b98){var _0x1baddf=_[_0xeb68('0x2f')](_0x3d21c3[_0xeb68('0x4b')],function(_0x2294fd){delete _0x2294fd['id'];_0x2294fd[_0xeb68('0x53')]=_0x3d21c3[_0xeb68('0x47')]['id'];return _0x2294fd;});return db[_0xeb68('0x30')]['bulkCreate'](_0x1baddf,{'transaction':_0x1b0c41});});})['then'](function(){return db[_0xeb68('0x30')][_0xeb68('0x44')]({'where':{'IntervalId':_0x3d21c3[_0xeb68('0x47')]['id']}});});}})[_0xeb68('0x26')](respondWithResult(_0x4a4f8d,null))[_0xeb68('0x46')](handleError(_0x4a4f8d,null));}; \ No newline at end of file +var _0x896f=['lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','Intervals','destroy','name','send','index','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','Interval','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addInterval','IntervalId','order','filter','getIntervals','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2e4bb0,_0x282023){var _0x36a95d=function(_0x5a0367){while(--_0x5a0367){_0x2e4bb0['push'](_0x2e4bb0['shift']());}};_0x36a95d(++_0x282023);}(_0x896f,0x1b6));var _0xf896=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x896f[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0xf896('0x0'));var rimraf=require(_0xf896('0x1'));var zipdir=require(_0xf896('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf896('0x3'));var moment=require(_0xf896('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf896('0x5'));var util=require(_0xf896('0x6'));var path=require(_0xf896('0x7'));var sox=require(_0xf896('0x8'));var csv=require(_0xf896('0x9'));var ejs=require(_0xf896('0xa'));var fs=require('fs');var fs_extra=require(_0xf896('0xb'));var _=require(_0xf896('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf896('0xd'));var deskjs=require(_0xf896('0xe'));var toCsv=require(_0xf896('0x9'));var querystring=require(_0xf896('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf896('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf896('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf896('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf896('0x13'));var licenseUtil=require(_0xf896('0x14'));var db=require('../../mysqldb')['db'];var extensions=require(_0xf896('0x15'));function respondWithStatusCode(_0x494de4,_0x52888f){_0x52888f=_0x52888f||0xcc;return function(_0x4214e1){if(_0x4214e1){return _0x494de4[_0xf896('0x16')](_0x52888f);}return _0x494de4[_0xf896('0x17')](_0x52888f)[_0xf896('0x18')]();};}function respondWithResult(_0x45c069,_0x54d54c){_0x54d54c=_0x54d54c||0xc8;return function(_0x59e49e){if(_0x59e49e){return _0x45c069[_0xf896('0x17')](_0x54d54c)['json'](_0x59e49e);}};}function respondWithFilteredResult(_0x5bf81e,_0xc94c48){return function(_0x2b6e51){if(_0x2b6e51){var _0x5f3b32=typeof _0xc94c48[_0xf896('0x19')]===_0xf896('0x1a')&&typeof _0xc94c48[_0xf896('0x1b')]===_0xf896('0x1a');var _0x5322e9=_0x2b6e51['count'];var _0x1caed3=_0x5f3b32?0x0:_0xc94c48['offset'];var _0x119fb6=_0x5f3b32?_0x2b6e51[_0xf896('0x1c')]:_0xc94c48[_0xf896('0x19')]+_0xc94c48['limit'];var _0x3ae247;if(_0x119fb6>=_0x5322e9){_0x119fb6=_0x5322e9;_0x3ae247=0xc8;}else{_0x3ae247=0xce;}_0x5bf81e[_0xf896('0x17')](_0x3ae247);return _0x5bf81e['set'](_0xf896('0x1d'),_0x1caed3+'-'+_0x119fb6+'/'+_0x5322e9)['json'](_0x2b6e51);}return null;};}function patchUpdates(_0x3e33f7){return function(_0x2169ec){try{jsonpatch[_0xf896('0x1e')](_0x2169ec,_0x3e33f7,!![]);}catch(_0x250257){return BPromise[_0xf896('0x1f')](_0x250257);}return _0x2169ec[_0xf896('0x20')]();};}function saveUpdates(_0x1b51cb,_0x5155c9){return function(_0x2981bf){if(_0x2981bf){return _0x2981bf[_0xf896('0x21')](_0x1b51cb)[_0xf896('0x22')](function(_0x1391c8){return _0x1391c8;});}return null;};}function removeEntity(_0x534689,_0x687457){return function(_0x4c1b25){if(_0x4c1b25){return _0x4c1b25['destroy']()['then'](function(){var _0x48461f=_0x4c1b25[_0xf896('0x23')]({'plain':!![]});var _0x3e0c33=_0xf896('0x24');return db['UserProfileResource'][_0xf896('0x25')]({'where':{'type':_0x3e0c33,'resourceId':_0x48461f['id']}})[_0xf896('0x22')](function(){return _0x4c1b25;});})[_0xf896('0x22')](function(){_0x534689[_0xf896('0x17')](0xcc)[_0xf896('0x18')]();});}};}function handleEntityNotFound(_0x52a843,_0x50dee7){return function(_0x44821b){if(!_0x44821b){_0x52a843[_0xf896('0x16')](0x194);}return _0x44821b;};}function handleError(_0x464267,_0x1f51b7){_0x1f51b7=_0x1f51b7||0x1f4;return function(_0x41a879){logger['error'](_0x41a879['stack']);if(_0x41a879['name']){delete _0x41a879[_0xf896('0x26')];}_0x464267[_0xf896('0x17')](_0x1f51b7)[_0xf896('0x27')](_0x41a879);};}exports[_0xf896('0x28')]=function(_0x400560,_0x386084){var _0x1a12a7={},_0x3f9494={},_0x4b3c46={'count':0x0,'rows':[]};var _0x4ebe68=_['map'](db['Interval']['rawAttributes'],function(_0x2b1877){return{'name':_0x2b1877[_0xf896('0x29')],'type':_0x2b1877[_0xf896('0x2a')]['key']};});_0x3f9494[_0xf896('0x2b')]=_[_0xf896('0x2c')](_0x4ebe68,_0xf896('0x26'));_0x3f9494[_0xf896('0x2d')]=_[_0xf896('0x2e')](_0x400560[_0xf896('0x2d')]);_0x3f9494[_0xf896('0x2f')]=_['intersection'](_0x3f9494[_0xf896('0x2b')],_0x3f9494[_0xf896('0x2d')]);_0x1a12a7[_0xf896('0x30')]=_[_0xf896('0x31')](_0x3f9494[_0xf896('0x2b')],qs[_0xf896('0x32')](_0x400560[_0xf896('0x2d')][_0xf896('0x32')]));_0x1a12a7['attributes']=_0x1a12a7[_0xf896('0x30')][_0xf896('0x33')]?_0x1a12a7['attributes']:_0x3f9494[_0xf896('0x2b')];if(!_0x400560['query'][_0xf896('0x34')](_0xf896('0x35'))){_0x1a12a7[_0xf896('0x1b')]=qs[_0xf896('0x1b')](_0x400560[_0xf896('0x2d')]['limit']);_0x1a12a7[_0xf896('0x19')]=qs[_0xf896('0x19')](_0x400560[_0xf896('0x2d')][_0xf896('0x19')]);}_0x1a12a7['order']=qs['sort'](_0x400560[_0xf896('0x2d')][_0xf896('0x36')]);_0x1a12a7[_0xf896('0x37')]=qs['filters'](_[_0xf896('0x38')](_0x400560[_0xf896('0x2d')],_0x3f9494[_0xf896('0x2f')]),_0x4ebe68);if(_0x400560[_0xf896('0x2d')]['filter']){_0x1a12a7[_0xf896('0x37')]=_[_0xf896('0x39')](_0x1a12a7['where'],{'$or':_['map'](_0x4ebe68,function(_0x226e47){if(_0x226e47[_0xf896('0x2a')]!==_0xf896('0x3a')){var _0x14745d={};_0x14745d[_0x226e47[_0xf896('0x26')]]={'$like':'%'+_0x400560[_0xf896('0x2d')]['filter']+'%'};return _0x14745d;}})});}_0x1a12a7=_[_0xf896('0x39')]({},_0x1a12a7,_0x400560['options']);var _0x41ba02={'where':_0x1a12a7[_0xf896('0x37')]};return db[_0xf896('0x3b')][_0xf896('0x1c')](_0x41ba02)[_0xf896('0x22')](function(_0x51d34a){_0x4b3c46[_0xf896('0x1c')]=_0x51d34a;if(_0x400560['query'][_0xf896('0x3c')]){_0x1a12a7[_0xf896('0x3d')]=[{'all':!![]}];}return db['Interval'][_0xf896('0x3e')](_0x1a12a7);})[_0xf896('0x22')](function(_0x1f7790){_0x4b3c46[_0xf896('0x3f')]=_0x1f7790;return _0x4b3c46;})['then'](respondWithFilteredResult(_0x386084,_0x1a12a7))['catch'](handleError(_0x386084,null));};exports[_0xf896('0x40')]=function(_0x410f13,_0x230947){var _0x431c4d={'raw':!![],'where':{'id':_0x410f13['params']['id']}},_0x3c819a={};_0x3c819a[_0xf896('0x2b')]=_[_0xf896('0x2e')](db[_0xf896('0x3b')][_0xf896('0x41')]);_0x3c819a['query']=_[_0xf896('0x2e')](_0x410f13[_0xf896('0x2d')]);_0x3c819a[_0xf896('0x2f')]=_['intersection'](_0x3c819a[_0xf896('0x2b')],_0x3c819a[_0xf896('0x2d')]);_0x431c4d[_0xf896('0x30')]=_[_0xf896('0x31')](_0x3c819a[_0xf896('0x2b')],qs[_0xf896('0x32')](_0x410f13[_0xf896('0x2d')][_0xf896('0x32')]));_0x431c4d['attributes']=_0x431c4d[_0xf896('0x30')][_0xf896('0x33')]?_0x431c4d[_0xf896('0x30')]:_0x3c819a[_0xf896('0x2b')];if(_0x410f13[_0xf896('0x2d')][_0xf896('0x3c')]){_0x431c4d[_0xf896('0x3d')]=[{'all':!![]}];}_0x431c4d=_['merge']({},_0x431c4d,_0x410f13[_0xf896('0x42')]);return db['Interval'][_0xf896('0x43')](_0x431c4d)['then'](handleEntityNotFound(_0x230947,null))['then'](respondWithResult(_0x230947,null))[_0xf896('0x44')](handleError(_0x230947,null));};exports['create']=function(_0x38e261,_0x431502){return db['Interval'][_0xf896('0x45')](_0x38e261['body'],{})['then'](function(_0x2369cd){var _0x2f48bd=_0x38e261['user'][_0xf896('0x23')]({'plain':!![]});if(!_0x2f48bd)throw new Error(_0xf896('0x46'));if(_0x2f48bd[_0xf896('0x47')]===_0xf896('0x48')){var _0x5b78d2=_0x2369cd[_0xf896('0x23')]({'plain':!![]});var _0x173854=_0xf896('0x24');return db[_0xf896('0x49')]['find']({'where':{'name':_0x173854,'userProfileId':_0x2f48bd[_0xf896('0x4a')]},'raw':!![]})[_0xf896('0x22')](function(_0x4d1306){if(_0x4d1306&&_0x4d1306[_0xf896('0x4b')]===0x0){return db[_0xf896('0x4c')][_0xf896('0x45')]({'name':_0x5b78d2['name'],'resourceId':_0x5b78d2['id'],'type':_0x4d1306[_0xf896('0x26')],'sectionId':_0x4d1306['id']},{})[_0xf896('0x22')](function(){return _0x2369cd;});}else{return _0x2369cd;}})[_0xf896('0x44')](function(_0x2dfa92){logger[_0xf896('0x4d')](_0xf896('0x4e'),_0x2dfa92);throw _0x2dfa92;});}return _0x2369cd;})['then'](respondWithResult(_0x431502,0xc9))[_0xf896('0x44')](handleError(_0x431502,null));};exports[_0xf896('0x21')]=function(_0x361853,_0x2be331){if(_0x361853[_0xf896('0x4f')]['id']){delete _0x361853[_0xf896('0x4f')]['id'];}return db[_0xf896('0x3b')][_0xf896('0x43')]({'where':{'id':_0x361853[_0xf896('0x50')]['id']}})[_0xf896('0x22')](handleEntityNotFound(_0x2be331,null))[_0xf896('0x22')](saveUpdates(_0x361853['body'],null))[_0xf896('0x22')](respondWithResult(_0x2be331,null))[_0xf896('0x44')](handleError(_0x2be331,null));};exports[_0xf896('0x25')]=function(_0xf33f6d,_0x4ddd13){return db[_0xf896('0x3b')][_0xf896('0x43')]({'where':{'id':_0xf33f6d[_0xf896('0x50')]['id']}})[_0xf896('0x22')](handleEntityNotFound(_0x4ddd13,null))[_0xf896('0x22')](removeEntity(_0x4ddd13,null))[_0xf896('0x44')](handleError(_0x4ddd13,null));};exports[_0xf896('0x51')]=function(_0x14e8c5,_0x750cc4,_0x167a07){if(_0x14e8c5[_0xf896('0x4f')]['id']){delete _0x14e8c5[_0xf896('0x4f')]['id'];}return db[_0xf896('0x3b')][_0xf896('0x43')]({'where':{'id':_0x14e8c5[_0xf896('0x50')]['id']}})[_0xf896('0x22')](handleEntityNotFound(_0x750cc4,null))[_0xf896('0x22')](function(_0x584b31){if(_0x584b31){_0x14e8c5[_0xf896('0x4f')][_0xf896('0x52')]=_0x584b31['id'];return db['Interval'][_0xf896('0x45')](_0x14e8c5[_0xf896('0x4f')]);}})[_0xf896('0x22')](respondWithResult(_0x750cc4,null))['catch'](handleError(_0x750cc4,null));};exports['getIntervals']=function(_0x2960a2,_0x248595,_0x4c2a1b){var _0x3b32c0={};var _0x4d3a82={};var _0x14e7f8;var _0x47b06f;return db[_0xf896('0x3b')]['findOne']({'where':{'id':_0x2960a2[_0xf896('0x50')]['id']}})[_0xf896('0x22')](handleEntityNotFound(_0x248595,null))['then'](function(_0x16e457){if(_0x16e457){_0x14e7f8=_0x16e457;_0x4d3a82['model']=_['keys'](db[_0xf896('0x3b')][_0xf896('0x41')]);_0x4d3a82[_0xf896('0x2d')]=_[_0xf896('0x2e')](_0x2960a2[_0xf896('0x2d')]);_0x4d3a82[_0xf896('0x2f')]=_[_0xf896('0x31')](_0x4d3a82[_0xf896('0x2b')],_0x4d3a82[_0xf896('0x2d')]);_0x3b32c0['attributes']=_[_0xf896('0x31')](_0x4d3a82[_0xf896('0x2b')],qs[_0xf896('0x32')](_0x2960a2[_0xf896('0x2d')][_0xf896('0x32')]));_0x3b32c0[_0xf896('0x30')]=_0x3b32c0['attributes'][_0xf896('0x33')]?_0x3b32c0[_0xf896('0x30')]:_0x4d3a82[_0xf896('0x2b')];_0x3b32c0[_0xf896('0x53')]=qs[_0xf896('0x36')](_0x2960a2[_0xf896('0x2d')][_0xf896('0x36')]);_0x3b32c0['where']=qs[_0xf896('0x2f')](_['pick'](_0x2960a2[_0xf896('0x2d')],_0x4d3a82[_0xf896('0x2f')]));if(_0x2960a2[_0xf896('0x2d')][_0xf896('0x54')]){_0x3b32c0[_0xf896('0x37')]=_[_0xf896('0x39')](_0x3b32c0[_0xf896('0x37')],{'$or':_[_0xf896('0x2c')](_0x3b32c0[_0xf896('0x30')],function(_0x3eef3b){var _0x4938d1={};_0x4938d1[_0x3eef3b]={'$like':'%'+_0x2960a2[_0xf896('0x2d')][_0xf896('0x54')]+'%'};return _0x4938d1;})});}_0x3b32c0=_[_0xf896('0x39')]({},_0x3b32c0,_0x2960a2[_0xf896('0x42')]);return _0x14e7f8[_0xf896('0x55')](_0x3b32c0);}})[_0xf896('0x22')](function(_0x1849e1){if(_0x1849e1){_0x47b06f=_0x1849e1[_0xf896('0x33')];if(!_0x2960a2['query'][_0xf896('0x34')](_0xf896('0x35'))){_0x3b32c0['limit']=qs[_0xf896('0x1b')](_0x2960a2[_0xf896('0x2d')][_0xf896('0x1b')]);_0x3b32c0[_0xf896('0x19')]=qs['offset'](_0x2960a2[_0xf896('0x2d')]['offset']);}return _0x14e7f8['getIntervals'](_0x3b32c0);}})[_0xf896('0x22')](function(_0x12ab22){if(_0x12ab22){return _0x12ab22?{'count':_0x47b06f,'rows':_0x12ab22}:null;}})['then'](respondWithResult(_0x248595,null))[_0xf896('0x44')](handleError(_0x248595,null));};exports[_0xf896('0x56')]=function(_0x76559b,_0x2e8fbd,_0x34376f){return db[_0xf896('0x3b')]['findOne']({'where':{'id':_0x76559b[_0xf896('0x50')]['id']}})[_0xf896('0x22')](handleEntityNotFound(_0x2e8fbd,null))[_0xf896('0x22')](function(_0x5d59e8){if(_0x5d59e8){return db[_0xf896('0x57')][_0xf896('0x58')](function(_0x4aaafe){return db[_0xf896('0x3b')]['destroy']({'where':{'IntervalId':_0x76559b[_0xf896('0x50')]['id']},'transaction':_0x4aaafe})[_0xf896('0x22')](function(_0x40c537){var _0x4c0b21=_[_0xf896('0x2c')](_0x76559b['body'],function(_0x54bde3){delete _0x54bde3['id'];_0x54bde3[_0xf896('0x52')]=_0x76559b[_0xf896('0x50')]['id'];return _0x54bde3;});return db[_0xf896('0x3b')][_0xf896('0x59')](_0x4c0b21,{'transaction':_0x4aaafe});});})[_0xf896('0x22')](function(){return db[_0xf896('0x3b')]['findAll']({'where':{'IntervalId':_0x76559b[_0xf896('0x50')]['id']}});});}})['then'](respondWithResult(_0x2e8fbd,null))['catch'](handleError(_0x2e8fbd,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index a01490b..bd1af74 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 _0xc8e7=['getIntervals','then','map','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval','string'];(function(_0x56fa7d,_0x521d83){var _0x13beb2=function(_0x274bd1){while(--_0x274bd1){_0x56fa7d['push'](_0x56fa7d['shift']());}};_0x13beb2(++_0x521d83);}(_0xc8e7,0x1e0));var _0x7c8e=function(_0x455893,_0x909838){_0x455893=_0x455893-0x0;var _0x3851e8=_0xc8e7[_0x455893];return _0x3851e8;};'use strict';var attributes=require(_0x7c8e('0x0'));var extensions=require(_0x7c8e('0x1'));var iftime=require(_0x7c8e('0x2'))['iftime'];module[_0x7c8e('0x3')]=function(_0x3ba27f){return _0x3ba27f[_0x7c8e('0x4')](_0x7c8e('0x5'),attributes,{'tableName':_0x7c8e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x34297c){extensions[_0x7c8e('0x7')](_0x3ba27f,_0x34297c);},'afterBulkCreate':function(_0xa10753,_0x8893e6,_0x35500b){_0x35500b();extensions[_0x7c8e('0x7')](_0x3ba27f,_0xa10753[0x0]);},'afterUpdate':function(_0x227dcd){extensions[_0x7c8e('0x7')](_0x3ba27f,_0x227dcd);},'afterDestroy':function(_0x1208f8){extensions['rewrite'](_0x3ba27f,_0x1208f8);}},'instanceMethods':{'ifTime':function(_0x533210=undefined,_0x5ea1fe=new Date()){if(typeof this[_0x7c8e('0x8')]===_0x7c8e('0x9')){return iftime(this[_0x7c8e('0x8')],_0x533210,_0x5ea1fe);}else{return this[_0x7c8e('0xa')]()[_0x7c8e('0xb')](function(_0x663db4){return Promise['all'](_0x663db4[_0x7c8e('0xc')](function(_0x20fadf){return _0x20fadf['ifTime'](_0x533210,_0x5ea1fe);}));})[_0x7c8e('0xb')](function(_0x1f8e4b){return _0x1f8e4b[_0x7c8e('0xd')](function(_0x598473,_0x6b8cef){return _0x598473||_0x6b8cef;},![]);});}}}});}; \ No newline at end of file +var _0x428c=['string','interval','getIntervals','then','map','ifTime','./interval.attributes','../../components/extensions/rewrite','exports','rewrite'];(function(_0xb0bc7c,_0x909c6c){var _0x3a7f2f=function(_0x503b1b){while(--_0x503b1b){_0xb0bc7c['push'](_0xb0bc7c['shift']());}};_0x3a7f2f(++_0x909c6c);}(_0x428c,0xb0));var _0xc428=function(_0x166842,_0x21a86c){_0x166842=_0x166842-0x0;var _0x102e2c=_0x428c[_0x166842];return _0x102e2c;};'use strict';var attributes=require(_0xc428('0x0'));var extensions=require(_0xc428('0x1'));var iftime=require('../../utils/iftime')['iftime'];module[_0xc428('0x2')]=function(_0x2427fa){return _0x2427fa['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x11fa37){extensions[_0xc428('0x3')](_0x2427fa,_0x11fa37);},'afterBulkCreate':function(_0x4ce5aa,_0x5df7e9,_0xfc7b95){_0xfc7b95();extensions[_0xc428('0x3')](_0x2427fa,_0x4ce5aa[0x0]);},'afterUpdate':function(_0x54a8a5){extensions[_0xc428('0x3')](_0x2427fa,_0x54a8a5);},'afterDestroy':function(_0xef897){extensions['rewrite'](_0x2427fa,_0xef897);}},'instanceMethods':{'ifTime':function(_0x24421b=undefined,_0x2c00e=new Date()){if(typeof this['interval']===_0xc428('0x4')){return iftime(this[_0xc428('0x5')],_0x24421b,_0x2c00e);}else{return this[_0xc428('0x6')]()[_0xc428('0x7')](function(_0x2f8df7){return Promise['all'](_0x2f8df7[_0xc428('0x8')](function(_0x793482){return _0x793482[_0xc428('0x9')](_0x24421b,_0x2c00e);}));})[_0xc428('0x7')](function(_0x4820cb){return _0x4820cb['reduce'](function(_0x4123bd,_0xbbb18e){return _0x4123bd||_0xbbb18e;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index a9ef409..6030368 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 _0xa517=['all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','IntervalIftime','resolve','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','GetInterval','Interval','findAll','options','where','attributes','limit','include','map','model','info','debug','error','message','ShowInterval','find','then','catch'];(function(_0x32f897,_0x2d1995){var _0x204715=function(_0x5512e7){while(--_0x5512e7){_0x32f897['push'](_0x32f897['shift']());}};_0x204715(++_0x2d1995);}(_0xa517,0x131));var _0x7a51=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa517[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x7a51('0x0'));var util=require('util');var db=require(_0x7a51('0x1'))['db'];var iftime=require(_0x7a51('0x2'))[_0x7a51('0x3')];var logger=require(_0x7a51('0x4'))('rpc');exports[_0x7a51('0x5')]=function(_0x5ed170){var _0x12a879=this;return new Promise(function(_0x1082d8,_0x338779){return db[_0x7a51('0x6')][_0x7a51('0x7')]({'raw':_0x5ed170[_0x7a51('0x8')]?_0x5ed170[_0x7a51('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x5ed170[_0x7a51('0x8')]?_0x5ed170[_0x7a51('0x8')][_0x7a51('0x9')]||null:null,'attributes':_0x5ed170['options']?_0x5ed170[_0x7a51('0x8')][_0x7a51('0xa')]||null:null,'limit':_0x5ed170['options']?_0x5ed170[_0x7a51('0x8')][_0x7a51('0xb')]||null:null,'include':_0x5ed170[_0x7a51('0x8')]?_0x5ed170[_0x7a51('0x8')][_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x5ed170[_0x7a51('0x8')][_0x7a51('0xc')],function(_0x33ccdd){return{'model':db[_0x33ccdd[_0x7a51('0xe')]],'as':_0x33ccdd['as'],'attributes':_0x33ccdd['attributes'],'include':_0x33ccdd['include']?_[_0x7a51('0xd')](_0x33ccdd[_0x7a51('0xc')],function(_0x143d96){return{'model':db[_0x143d96[_0x7a51('0xe')]],'as':_0x143d96['as'],'attributes':_0x143d96[_0x7a51('0xa')],'include':_0x143d96['include']?_[_0x7a51('0xd')](_0x143d96['include'],function(_0x172e10){return{'model':db[_0x172e10['model']],'as':_0x172e10['as'],'attributes':_0x172e10['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x515378){logger[_0x7a51('0xf')]('GetInterval',_0x5ed170);logger[_0x7a51('0x10')]('GetInterval',_0x5ed170,JSON['stringify'](_0x515378));_0x1082d8(_0x515378);})['catch'](function(_0x3bd438){logger[_0x7a51('0x11')](_0x7a51('0x5'),_0x3bd438[_0x7a51('0x12')],_0x5ed170);_0x338779(_0x12a879[_0x7a51('0x11')](0x1f4,_0x3bd438[_0x7a51('0x12')]));});});};exports[_0x7a51('0x13')]=function(_0x4b08ca){var _0x35906d=this;return new Promise(function(_0x39204d,_0x5f54cf){return db[_0x7a51('0x6')][_0x7a51('0x14')]({'raw':_0x4b08ca[_0x7a51('0x8')]?_0x4b08ca[_0x7a51('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x4b08ca['options']?_0x4b08ca[_0x7a51('0x8')][_0x7a51('0x9')]||null:null,'attributes':_0x4b08ca[_0x7a51('0x8')]?_0x4b08ca[_0x7a51('0x8')][_0x7a51('0xa')]||null:null,'include':_0x4b08ca[_0x7a51('0x8')]?_0x4b08ca['options'][_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x4b08ca[_0x7a51('0x8')][_0x7a51('0xc')],function(_0x457020){return{'model':db[_0x457020['model']],'as':_0x457020['as'],'attributes':_0x457020[_0x7a51('0xa')],'include':_0x457020[_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x457020['include'],function(_0x1cc699){return{'model':db[_0x1cc699[_0x7a51('0xe')]],'as':_0x1cc699['as'],'attributes':_0x1cc699[_0x7a51('0xa')],'include':_0x1cc699[_0x7a51('0xc')]?_[_0x7a51('0xd')](_0x1cc699[_0x7a51('0xc')],function(_0x23bc8d){return{'model':db[_0x23bc8d[_0x7a51('0xe')]],'as':_0x23bc8d['as'],'attributes':_0x23bc8d['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a51('0x15')](function(_0x1a093a){logger[_0x7a51('0xf')]('ShowInterval',_0x4b08ca);logger[_0x7a51('0x10')]('ShowInterval',_0x4b08ca,JSON['stringify'](_0x1a093a));_0x39204d(_0x1a093a);})[_0x7a51('0x16')](function(_0x4b4b76){logger['error'](_0x7a51('0x13'),_0x4b4b76[_0x7a51('0x12')],_0x4b08ca);_0x5f54cf(_0x35906d[_0x7a51('0x11')](0x1f4,_0x4b4b76[_0x7a51('0x12')]));});});};function checkArrayOfIntervals(_0x1e82a6,_0x29517e){var _0x4587db=[];return db['Interval']['findAll']({'where':{'id':_0x1e82a6}})[_0x7a51('0x15')](function(_0x64974d){_0x4587db=_0x64974d;return Promise[_0x7a51('0x17')](_0x4587db['map'](function(_0xd4b4a6){return _0xd4b4a6[_0x7a51('0x18')](_0x29517e);}));})[_0x7a51('0x15')](function(_0x442c0b){var _0x3c0fc1=_0x442c0b[_0x7a51('0x19')](function(_0xeae91a,_0x119717){return _0xeae91a||_0x119717;},![]);logger[_0x7a51('0xf')](util[_0x7a51('0x1a')](_0x7a51('0x1b'),_0x4587db[_0x7a51('0xd')](function(_0x3eeb50){return _0x3eeb50[_0x7a51('0x1c')];})[_0x7a51('0x1d')](',\x20'),_0x4587db['map'](function(_0x149cda){return _0x149cda['id'];})[_0x7a51('0x1d')](',\x20')));return _0x3c0fc1;});}function checkSingleInterval(_0x10deb9,_0x2531ee){return db[_0x7a51('0x6')][_0x7a51('0x1e')](_0x10deb9)[_0x7a51('0x15')](function(_0x470e83){if(_0x470e83){logger[_0x7a51('0xf')](util[_0x7a51('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x470e83['name'],_0x470e83['id']));return _0x470e83[_0x7a51('0x18')](_0x2531ee);}});}exports['IntervalIftime']=function(_0x38eb97){var _0x4dc22d=_0x38eb97[_0x7a51('0x1f')];var _0x2e8e8a=Array[_0x7a51('0x20')](_0x38eb97[_0x7a51('0x21')])?_0x38eb97[_0x7a51('0x21')]:typeof _0x38eb97[_0x7a51('0x21')]===_0x7a51('0x22')?[_0x38eb97[_0x7a51('0x21')]]:[];var _0x2d4562=_0x38eb97['timezone']||undefined;var _0x20e06a=![];if(_0x2e8e8a[_0x7a51('0x23')]){logger[_0x7a51('0xf')](util[_0x7a51('0x1a')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x2e8e8a['join'](';\x20')));}if(_0x2d4562){logger[_0x7a51('0xf')](util[_0x7a51('0x1a')](_0x7a51('0x24'),_0x2d4562));}logger['debug'](_0x7a51('0x25'),_0x20e06a);logger[_0x7a51('0x26')](_0x7a51('0x27'),_0x38eb97);return Promise[_0x7a51('0x28')]()[_0x7a51('0x15')](function(){if(Array[_0x7a51('0x20')](_0x4dc22d)){return checkArrayOfIntervals(_0x4dc22d,_0x2d4562);}else if(_0x4dc22d){return checkSingleInterval(_0x4dc22d,_0x2d4562);}})['then'](function(_0x597636){var _0x58b981=_0x2e8e8a[_0x7a51('0x19')](function(_0x49e4a5,_0x302a5d){return _0x49e4a5||iftime(_0x302a5d,_0x2d4562);},![]);_0x20e06a=_0x597636||_0x58b981;return _0x20e06a;})[_0x7a51('0x16')](function(_0x103dfd){logger['error'](_0x7a51('0x27'),_0x38eb97,_0x103dfd);throw this['error'](0x1f4,_0x103dfd[_0x7a51('0x12')]);});}; \ No newline at end of file +var _0x0263=['IntervalIftime','intervalIds','isArray','intervals','string','length','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','stringify','catch','error','message','ShowInterval','find','all','reduce','info','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name'];(function(_0x5ec8ed,_0x743ebd){var _0x517d7e=function(_0x362df0){while(--_0x362df0){_0x5ec8ed['push'](_0x5ec8ed['shift']());}};_0x517d7e(++_0x743ebd);}(_0x0263,0xe6));var _0x3026=function(_0x3506e1,_0x24dabc){_0x3506e1=_0x3506e1-0x0;var _0xc87b29=_0x0263[_0x3506e1];return _0xc87b29;};'use strict';var _=require(_0x3026('0x0'));var util=require('util');var db=require(_0x3026('0x1'))['db'];var iftime=require(_0x3026('0x2'))[_0x3026('0x3')];var logger=require(_0x3026('0x4'))(_0x3026('0x5'));exports[_0x3026('0x6')]=function(_0x502159){var _0x51974e=this;return new Promise(function(_0x4aa318,_0xa3ac2d){return db[_0x3026('0x7')][_0x3026('0x8')]({'raw':_0x502159[_0x3026('0x9')]?_0x502159[_0x3026('0x9')][_0x3026('0xa')]===undefined?!![]:![]:!![],'where':_0x502159[_0x3026('0x9')]?_0x502159[_0x3026('0x9')][_0x3026('0xb')]||null:null,'attributes':_0x502159[_0x3026('0x9')]?_0x502159[_0x3026('0x9')][_0x3026('0xc')]||null:null,'limit':_0x502159['options']?_0x502159['options'][_0x3026('0xd')]||null:null,'include':_0x502159['options']?_0x502159[_0x3026('0x9')][_0x3026('0xe')]?_['map'](_0x502159['options'][_0x3026('0xe')],function(_0x4ad8b1){return{'model':db[_0x4ad8b1[_0x3026('0xf')]],'as':_0x4ad8b1['as'],'attributes':_0x4ad8b1[_0x3026('0xc')],'include':_0x4ad8b1[_0x3026('0xe')]?_[_0x3026('0x10')](_0x4ad8b1[_0x3026('0xe')],function(_0x51a719){return{'model':db[_0x51a719['model']],'as':_0x51a719['as'],'attributes':_0x51a719['attributes'],'include':_0x51a719[_0x3026('0xe')]?_[_0x3026('0x10')](_0x51a719[_0x3026('0xe')],function(_0x4405ec){return{'model':db[_0x4405ec['model']],'as':_0x4405ec['as'],'attributes':_0x4405ec[_0x3026('0xc')]};}):[]};}):[]};}):[]:[]})[_0x3026('0x11')](function(_0x580083){logger['info']('GetInterval',_0x502159);logger[_0x3026('0x12')]('GetInterval',_0x502159,JSON[_0x3026('0x13')](_0x580083));_0x4aa318(_0x580083);})[_0x3026('0x14')](function(_0x31f9d6){logger[_0x3026('0x15')](_0x3026('0x6'),_0x31f9d6[_0x3026('0x16')],_0x502159);_0xa3ac2d(_0x51974e[_0x3026('0x15')](0x1f4,_0x31f9d6['message']));});});};exports[_0x3026('0x17')]=function(_0xdc1c59){var _0x1e993b=this;return new Promise(function(_0x470f7d,_0x47e3a5){return db[_0x3026('0x7')][_0x3026('0x18')]({'raw':_0xdc1c59[_0x3026('0x9')]?_0xdc1c59[_0x3026('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0xdc1c59[_0x3026('0x9')]?_0xdc1c59['options'][_0x3026('0xb')]||null:null,'attributes':_0xdc1c59[_0x3026('0x9')]?_0xdc1c59['options'][_0x3026('0xc')]||null:null,'include':_0xdc1c59[_0x3026('0x9')]?_0xdc1c59[_0x3026('0x9')]['include']?_[_0x3026('0x10')](_0xdc1c59[_0x3026('0x9')][_0x3026('0xe')],function(_0x3ada8c){return{'model':db[_0x3ada8c[_0x3026('0xf')]],'as':_0x3ada8c['as'],'attributes':_0x3ada8c['attributes'],'include':_0x3ada8c[_0x3026('0xe')]?_['map'](_0x3ada8c['include'],function(_0x451c5a){return{'model':db[_0x451c5a['model']],'as':_0x451c5a['as'],'attributes':_0x451c5a[_0x3026('0xc')],'include':_0x451c5a['include']?_[_0x3026('0x10')](_0x451c5a[_0x3026('0xe')],function(_0x446229){return{'model':db[_0x446229[_0x3026('0xf')]],'as':_0x446229['as'],'attributes':_0x446229[_0x3026('0xc')]};}):[]};}):[]};}):[]:[]})[_0x3026('0x11')](function(_0x504311){logger['info'](_0x3026('0x17'),_0xdc1c59);logger['debug']('ShowInterval',_0xdc1c59,JSON['stringify'](_0x504311));_0x470f7d(_0x504311);})[_0x3026('0x14')](function(_0x12bc9c){logger[_0x3026('0x15')](_0x3026('0x17'),_0x12bc9c[_0x3026('0x16')],_0xdc1c59);_0x47e3a5(_0x1e993b[_0x3026('0x15')](0x1f4,_0x12bc9c['message']));});});};function checkArrayOfIntervals(_0x199afd,_0x554de2){var _0x497e9c=[];return db['Interval'][_0x3026('0x8')]({'where':{'id':_0x199afd}})['then'](function(_0x11588c){_0x497e9c=_0x11588c;return Promise[_0x3026('0x19')](_0x497e9c['map'](function(_0x73f1ff){return _0x73f1ff['ifTime'](_0x554de2);}));})['then'](function(_0x2b5dfd){var _0xb805b8=_0x2b5dfd[_0x3026('0x1a')](function(_0x490a6e,_0x39e24b){return _0x490a6e||_0x39e24b;},![]);logger[_0x3026('0x1b')](util[_0x3026('0x1c')](_0x3026('0x1d'),_0x497e9c['map'](function(_0x25ca9d){return _0x25ca9d['name'];})[_0x3026('0x1e')](',\x20'),_0x497e9c[_0x3026('0x10')](function(_0xbbd7b4){return _0xbbd7b4['id'];})[_0x3026('0x1e')](',\x20')));return _0xb805b8;});}function checkSingleInterval(_0x24e78,_0x562713){return db[_0x3026('0x7')][_0x3026('0x1f')](_0x24e78)[_0x3026('0x11')](function(_0x39a1c3){if(_0x39a1c3){logger[_0x3026('0x1b')](util[_0x3026('0x1c')](_0x3026('0x20'),_0x39a1c3[_0x3026('0x21')],_0x39a1c3['id']));return _0x39a1c3['ifTime'](_0x562713);}});}exports[_0x3026('0x22')]=function(_0x4be9a5){var _0x380f09=_0x4be9a5[_0x3026('0x23')];var _0x48e884=Array[_0x3026('0x24')](_0x4be9a5['intervals'])?_0x4be9a5['intervals']:typeof _0x4be9a5[_0x3026('0x25')]===_0x3026('0x26')?[_0x4be9a5[_0x3026('0x25')]]:[];var _0x1390c9=_0x4be9a5['timezone']||undefined;var _0x46d9f9=![];if(_0x48e884[_0x3026('0x27')]){logger['info'](util[_0x3026('0x1c')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x48e884[_0x3026('0x1e')](';\x20')));}if(_0x1390c9){logger[_0x3026('0x1b')](util[_0x3026('0x1c')](_0x3026('0x28'),_0x1390c9));}logger[_0x3026('0x12')](_0x3026('0x29'),_0x46d9f9);logger[_0x3026('0x2a')]('IntervalIftime',_0x4be9a5);return Promise[_0x3026('0x2b')]()[_0x3026('0x11')](function(){if(Array[_0x3026('0x24')](_0x380f09)){return checkArrayOfIntervals(_0x380f09,_0x1390c9);}else if(_0x380f09){return checkSingleInterval(_0x380f09,_0x1390c9);}})[_0x3026('0x11')](function(_0x4a487b){var _0x51a6c9=_0x48e884['reduce'](function(_0x1b12f1,_0xbae716){return _0x1b12f1||iftime(_0xbae716,_0x1390c9);},![]);_0x46d9f9=_0x4a487b||_0x51a6c9;return _0x46d9f9;})['catch'](function(_0x4609c7){logger[_0x3026('0x15')](_0x3026('0x22'),_0x4be9a5,_0x4609c7);throw this[_0x3026('0x15')](0x1f4,_0x4609c7[_0x3026('0x16')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d60e6f4..a8733d6 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x5d8dc5,_0x5da1c9){var _0x6eb9f5=function(_0x3c4068){while(--_0x3c4068){_0x5d8dc5['push'](_0x5d8dc5['shift']());}};_0x6eb9f5(++_0x5da1c9);}(_0x2ef3,0xba));var _0x32ef=function(_0xa941b0,_0x4ecab2){_0xa941b0=_0xa941b0-0x0;var _0x41ed69=_0x2ef3[_0xa941b0];return _0x41ed69;};'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 15ff074..007a065 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 _0x1824=['data','end','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','socket','bluebird','../../config/logger','support','3eAmWpBVP0','summary','Report','\x20from\x20','description','issuetype','Bug','fields','email','customfield_11501','oldToken','customfield_11502','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','stringify','request','setEncoding','utf8'];(function(_0x5bc2ef,_0x4d677b){var _0x76f2ac=function(_0x449c9d){while(--_0x449c9d){_0x5bc2ef['push'](_0x5bc2ef['shift']());}};_0x76f2ac(++_0x4d677b);}(_0x1824,0xe5));var _0x4182=function(_0x53dd3e,_0x4be502){_0x53dd3e=_0x53dd3e-0x0;var _0x2795a6=_0x1824[_0x53dd3e];return _0x2795a6;};'use strict';var BPromise=require(_0x4182('0x0'));var https=require('https');var logger=require(_0x4182('0x1'))('api');var USERNAME=_0x4182('0x2');var PASSWORD=_0x4182('0x3');function openIssue(_0x6e095a,_0x40ef46){var _0x57a255={'fields':{'project':{'key':_0x6e095a['key']||'MOTGUI'},'summary':(_0x6e095a[_0x4182('0x4')]||_0x4182('0x5'))+_0x4182('0x6')+_0x6e095a['ip'],'description':_0x6e095a[_0x4182('0x7')]||JSON['stringify'](_0x6e095a),'issuetype':{'name':_0x6e095a[_0x4182('0x8')]||_0x4182('0x9')}}};_0x57a255[_0x4182('0xa')]['customfield_11500']=_0x6e095a[_0x4182('0xb')];_0x57a255[_0x4182('0xa')][_0x4182('0xc')]=_0x6e095a[_0x4182('0xd')];_0x57a255['fields'][_0x4182('0xe')]=_0x6e095a['newToken'];_0x57a255['fields']['customfield_11503']=_0x6e095a[_0x4182('0xf')];_0x57a255['fields'][_0x4182('0x10')]=_0x6e095a[_0x4182('0x11')];_0x57a255[_0x4182('0xa')]['customfield_10102']=_0x6e095a['ip'];var _0x1755e7={'host':_0x4182('0x12'),'port':0x1bb,'path':_0x4182('0x13'),'method':_0x4182('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x4182('0x15'),'Authorization':_0x4182('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x4182('0x17')](_0x4182('0x18'))}};var _0x47daa7=JSON[_0x4182('0x19')](_0x57a255);var _0x5f1ea3=https[_0x4182('0x1a')](_0x1755e7,function(_0xc319cb){_0xc319cb[_0x4182('0x1b')](_0x4182('0x1c'));var _0x567bd4='';_0xc319cb['on'](_0x4182('0x1d'),function(_0x50b955){_0x567bd4+=_0x50b955;});_0xc319cb['on'](_0x4182('0x1e'),function(){if(_0x40ef46){return _0x40ef46['status'](_0xc319cb[_0x4182('0x1f')])[_0x4182('0x20')](JSON['parse'](_0x567bd4));}});});_0x5f1ea3['on'](_0x4182('0x21'),function(_0x35ce19){if(_0x40ef46){return _0x40ef46['status'](0x1f4)['json']({'errors':[{'message':_0x4182('0x22'),'type':_0x4182('0x23')}]});}});_0x5f1ea3[_0x4182('0x24')](_0x47daa7);_0x5f1ea3[_0x4182('0x1e')]();}exports[_0x4182('0x25')]=openIssue;exports['send']=function(_0x5a7330,_0x2eee65){_0x5a7330[_0x4182('0x26')]['ip']=_0x5a7330[_0x4182('0x27')][_0x4182('0x28')]||_0x5a7330[_0x4182('0x29')]['remoteAddress']||_0x5a7330[_0x4182('0x2a')]['remoteAddress']||_0x5a7330[_0x4182('0x29')][_0x4182('0x2a')]['remoteAddress'];return openIssue(_0x5a7330['body'],_0x2eee65);}; \ No newline at end of file +var _0x1f3e=['support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','issuetype','Bug','fields','email','oldToken','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','base64','stringify','request','setEncoding','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','api'];(function(_0x274638,_0x578968){var _0x5755df=function(_0x3227d5){while(--_0x3227d5){_0x274638['push'](_0x274638['shift']());}};_0x5755df(++_0x578968);}(_0x1f3e,0x181));var _0xe1f3=function(_0x2ec8d4,_0x386ddb){_0x2ec8d4=_0x2ec8d4-0x0;var _0x6007e7=_0x1f3e[_0x2ec8d4];return _0x6007e7;};'use strict';var BPromise=require(_0xe1f3('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xe1f3('0x1'));var USERNAME=_0xe1f3('0x2');var PASSWORD=_0xe1f3('0x3');function openIssue(_0x34fc53,_0x3d835b){var _0x1153e9={'fields':{'project':{'key':_0x34fc53[_0xe1f3('0x4')]||_0xe1f3('0x5')},'summary':(_0x34fc53[_0xe1f3('0x6')]||'Report')+_0xe1f3('0x7')+_0x34fc53['ip'],'description':_0x34fc53['description']||JSON['stringify'](_0x34fc53),'issuetype':{'name':_0x34fc53[_0xe1f3('0x8')]||_0xe1f3('0x9')}}};_0x1153e9[_0xe1f3('0xa')]['customfield_11500']=_0x34fc53[_0xe1f3('0xb')];_0x1153e9[_0xe1f3('0xa')]['customfield_11501']=_0x34fc53[_0xe1f3('0xc')];_0x1153e9[_0xe1f3('0xa')]['customfield_11502']=_0x34fc53[_0xe1f3('0xd')];_0x1153e9['fields'][_0xe1f3('0xe')]=_0x34fc53[_0xe1f3('0xf')];_0x1153e9[_0xe1f3('0xa')][_0xe1f3('0x10')]=_0x34fc53[_0xe1f3('0x11')];_0x1153e9[_0xe1f3('0xa')][_0xe1f3('0x12')]=_0x34fc53['ip'];var _0x58b632={'host':_0xe1f3('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xe1f3('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xe1f3('0x15'),'Authorization':_0xe1f3('0x16')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xe1f3('0x17'))}};var _0x15c983=JSON[_0xe1f3('0x18')](_0x1153e9);var _0x283d70=https[_0xe1f3('0x19')](_0x58b632,function(_0x1b4343){_0x1b4343[_0xe1f3('0x1a')]('utf8');var _0x2661a1='';_0x1b4343['on']('data',function(_0x161146){_0x2661a1+=_0x161146;});_0x1b4343['on'](_0xe1f3('0x1b'),function(){if(_0x3d835b){return _0x3d835b['status'](_0x1b4343[_0xe1f3('0x1c')])[_0xe1f3('0x1d')](JSON[_0xe1f3('0x1e')](_0x2661a1));}});});_0x283d70['on'](_0xe1f3('0x1f'),function(_0x7da5d6){if(_0x3d835b){return _0x3d835b[_0xe1f3('0x20')](0x1f4)[_0xe1f3('0x1d')]({'errors':[{'message':_0xe1f3('0x21'),'type':_0xe1f3('0x22')}]});}});_0x283d70[_0xe1f3('0x23')](_0x15c983);_0x283d70[_0xe1f3('0x1b')]();}exports[_0xe1f3('0x24')]=openIssue;exports[_0xe1f3('0x25')]=function(_0x4a61b2,_0x5b312f){_0x4a61b2[_0xe1f3('0x26')]['ip']=_0x4a61b2[_0xe1f3('0x27')]['x-forwarded-for']||_0x4a61b2[_0xe1f3('0x28')][_0xe1f3('0x29')]||_0x4a61b2[_0xe1f3('0x2a')][_0xe1f3('0x29')]||_0x4a61b2[_0xe1f3('0x28')]['socket'][_0xe1f3('0x29')];return openIssue(_0x4a61b2[_0xe1f3('0x26')],_0x5b312f);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f05cb20..ffd1822 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 _0x99e9=['update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x1ef7b2,_0x21aeb0){var _0x2381dd=function(_0x255872){while(--_0x255872){_0x1ef7b2['push'](_0x1ef7b2['shift']());}};_0x2381dd(++_0x21aeb0);}(_0x99e9,0xb4));var _0x999e=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0x99e9[_0x10dfdf];return _0x4d857d;};'use strict';var multer=require('multer');var util=require(_0x999e('0x0'));var path=require(_0x999e('0x1'));var timeout=require(_0x999e('0x2'));var express=require(_0x999e('0x3'));var router=express['Router']();var fs_extra=require(_0x999e('0x4'));var auth=require(_0x999e('0x5'));var interaction=require(_0x999e('0x6'));var config=require('../../config/environment');var controller=require(_0x999e('0x7'));router['get']('/',auth[_0x999e('0x8')](),controller[_0x999e('0x9')]);router[_0x999e('0xa')](_0x999e('0xb'),auth['isAuthenticated'](),controller[_0x999e('0xc')]);router[_0x999e('0xa')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0xe')]);router[_0x999e('0xf')]('/',auth[_0x999e('0x8')](),controller[_0x999e('0x10')]);router[_0x999e('0x11')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x12')]);router[_0x999e('0x13')](_0x999e('0xd'),auth[_0x999e('0x8')](),controller[_0x999e('0x14')]);module[_0x999e('0x15')]=router; \ No newline at end of file +var _0x878f=['./jscriptyAnswerReport.controller','get','/describe','/:id','post','isAuthenticated','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5db99b,_0xdee23a){var _0x4b2d0e=function(_0x4deee1){while(--_0x4deee1){_0x5db99b['push'](_0x5db99b['shift']());}};_0x4b2d0e(++_0xdee23a);}(_0x878f,0x173));var _0xf878=function(_0x4f8df4,_0x1fc935){_0x4f8df4=_0x4f8df4-0x0;var _0x4ac595=_0x878f[_0x4f8df4];return _0x4ac595;};'use strict';var multer=require('multer');var util=require(_0xf878('0x0'));var path=require(_0xf878('0x1'));var timeout=require(_0xf878('0x2'));var express=require(_0xf878('0x3'));var router=express[_0xf878('0x4')]();var fs_extra=require(_0xf878('0x5'));var auth=require(_0xf878('0x6'));var interaction=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var controller=require(_0xf878('0x9'));router[_0xf878('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf878('0xa')](_0xf878('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf878('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf878('0xd')]('/',auth[_0xf878('0xe')](),controller[_0xf878('0xf')]);router['put'](_0xf878('0xc'),auth[_0xf878('0xe')](),controller['update']);router[_0xf878('0x10')]('/:id',auth[_0xf878('0xe')](),controller[_0xf878('0x11')]);module[_0xf878('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 4b1ca14..04d2e03 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(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a54,0x106));var _0x47a5=function(_0x3a913d,_0x236e6c){_0x3a913d=_0x3a913d-0x0;var _0x301873=_0x7a54[_0x3a913d];return _0x301873;};'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(_0x4928df,_0xe409d6){_0x4928df=_0x4928df-0x0;var _0x4f46c9=_0x7a54[_0x4928df];return _0x4f46c9;};'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 d1df5e4..aae3964 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 _0x9576=['rows','catch','show','params','intersection','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','include','findAll'];(function(_0x31a3fb,_0x189fba){var _0x375314=function(_0xc09024){while(--_0xc09024){_0x31a3fb['push'](_0x31a3fb['shift']());}};_0x375314(++_0x189fba);}(_0x9576,0x182));var _0x6957=function(_0x5dfc7f,_0x430784){_0x5dfc7f=_0x5dfc7f-0x0;var _0x2f9440=_0x9576[_0x5dfc7f];return _0x2f9440;};'use strict';var emlformat=require(_0x6957('0x0'));var rimraf=require(_0x6957('0x1'));var zipdir=require(_0x6957('0x2'));var jsonpatch=require(_0x6957('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6957('0x4'));var Mustache=require(_0x6957('0x5'));var util=require(_0x6957('0x6'));var path=require(_0x6957('0x7'));var sox=require(_0x6957('0x8'));var csv=require(_0x6957('0x9'));var ejs=require(_0x6957('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6957('0xb'));var squel=require(_0x6957('0xc'));var crypto=require(_0x6957('0xd'));var jsforce=require(_0x6957('0xe'));var deskjs=require(_0x6957('0xf'));var toCsv=require(_0x6957('0x9'));var querystring=require('querystring');var Papa=require(_0x6957('0x10'));var Redis=require(_0x6957('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6957('0x12'));var hardwareService=require(_0x6957('0x13'));var logger=require(_0x6957('0x14'))(_0x6957('0x15'));var utils=require(_0x6957('0x16'));var config=require(_0x6957('0x17'));var licenseUtil=require(_0x6957('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5888d6,_0x548647){_0x548647=_0x548647||0xcc;return function(_0x3f40f0){if(_0x3f40f0){return _0x5888d6[_0x6957('0x19')](_0x548647);}return _0x5888d6[_0x6957('0x1a')](_0x548647)[_0x6957('0x1b')]();};}function respondWithResult(_0x345c3e,_0x1fd3d9){_0x1fd3d9=_0x1fd3d9||0xc8;return function(_0x25d32e){if(_0x25d32e){return _0x345c3e['status'](_0x1fd3d9)['json'](_0x25d32e);}};}function respondWithFilteredResult(_0x4f82cb,_0x35fffc){return function(_0x256ac7){if(_0x256ac7){var _0x228f76=typeof _0x35fffc[_0x6957('0x1c')]==='undefined'&&typeof _0x35fffc[_0x6957('0x1d')]==='undefined';var _0x2a39b5=_0x256ac7[_0x6957('0x1e')];var _0x49aa31=_0x228f76?0x0:_0x35fffc[_0x6957('0x1c')];var _0x448ff6=_0x228f76?_0x256ac7[_0x6957('0x1e')]:_0x35fffc['offset']+_0x35fffc[_0x6957('0x1d')];var _0x2c103c;if(_0x448ff6>=_0x2a39b5){_0x448ff6=_0x2a39b5;_0x2c103c=0xc8;}else{_0x2c103c=0xce;}_0x4f82cb[_0x6957('0x1a')](_0x2c103c);return _0x4f82cb[_0x6957('0x1f')](_0x6957('0x20'),_0x49aa31+'-'+_0x448ff6+'/'+_0x2a39b5)[_0x6957('0x21')](_0x256ac7);}return null;};}function patchUpdates(_0x35ee5b){return function(_0x3081b2){try{jsonpatch['apply'](_0x3081b2,_0x35ee5b,!![]);}catch(_0x5ee3f8){return BPromise[_0x6957('0x22')](_0x5ee3f8);}return _0x3081b2[_0x6957('0x23')]();};}function saveUpdates(_0x18037f,_0x2569f4){return function(_0x3591fa){if(_0x3591fa){return _0x3591fa[_0x6957('0x24')](_0x18037f)[_0x6957('0x25')](function(_0x310a5e){return _0x310a5e;});}return null;};}function removeEntity(_0x56b0ba,_0x2b2dcd){return function(_0x3c9de7){if(_0x3c9de7){return _0x3c9de7[_0x6957('0x26')]()[_0x6957('0x25')](function(){_0x56b0ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1e6af,_0x2a57b6){return function(_0x5c4e49){if(!_0x5c4e49){_0xa1e6af['sendStatus'](0x194);}return _0x5c4e49;};}function handleError(_0x320e7d,_0xa2f92f){_0xa2f92f=_0xa2f92f||0x1f4;return function(_0x3bc22f){logger['error'](_0x3bc22f[_0x6957('0x27')]);if(_0x3bc22f[_0x6957('0x28')]){delete _0x3bc22f[_0x6957('0x28')];}_0x320e7d[_0x6957('0x1a')](_0xa2f92f)[_0x6957('0x29')](_0x3bc22f);};}exports[_0x6957('0x2a')]=function(_0x2d33ef,_0x320e1a){var _0x595770={},_0x2e7fe1={},_0x3a6e07={'count':0x0,'rows':[]};var _0xd02a9=_[_0x6957('0x2b')](db[_0x6957('0x2c')][_0x6957('0x2d')],function(_0x3f8745){return{'name':_0x3f8745[_0x6957('0x2e')],'type':_0x3f8745[_0x6957('0x2f')][_0x6957('0x30')]};});_0x2e7fe1[_0x6957('0x31')]=_['map'](_0xd02a9,'name');_0x2e7fe1[_0x6957('0x32')]=_[_0x6957('0x33')](_0x2d33ef[_0x6957('0x32')]);_0x2e7fe1[_0x6957('0x34')]=_['intersection'](_0x2e7fe1[_0x6957('0x31')],_0x2e7fe1[_0x6957('0x32')]);_0x595770[_0x6957('0x35')]=_['intersection'](_0x2e7fe1['model'],qs[_0x6957('0x36')](_0x2d33ef[_0x6957('0x32')][_0x6957('0x36')]));_0x595770['attributes']=_0x595770[_0x6957('0x35')][_0x6957('0x37')]?_0x595770[_0x6957('0x35')]:_0x2e7fe1[_0x6957('0x31')];if(!_0x2d33ef[_0x6957('0x32')][_0x6957('0x38')](_0x6957('0x39'))){_0x595770[_0x6957('0x1d')]=qs[_0x6957('0x1d')](_0x2d33ef['query'][_0x6957('0x1d')]);_0x595770[_0x6957('0x1c')]=qs[_0x6957('0x1c')](_0x2d33ef['query']['offset']);}_0x595770['order']=qs[_0x6957('0x3a')](_0x2d33ef['query']['sort']);_0x595770[_0x6957('0x3b')]=qs[_0x6957('0x34')](_['pick'](_0x2d33ef['query'],_0x2e7fe1[_0x6957('0x34')]),_0xd02a9);if(_0x2d33ef[_0x6957('0x32')][_0x6957('0x3c')]){_0x595770[_0x6957('0x3b')]=_[_0x6957('0x3d')](_0x595770['where'],{'$or':_[_0x6957('0x2b')](_0xd02a9,function(_0x5c9be3){if(_0x5c9be3['type']!=='VIRTUAL'){var _0x5ab079={};_0x5ab079[_0x5c9be3['name']]={'$like':'%'+_0x2d33ef['query']['filter']+'%'};return _0x5ab079;}})});}_0x595770=_['merge']({},_0x595770,_0x2d33ef['options']);var _0x20caa3={'where':_0x595770[_0x6957('0x3b')]};return db[_0x6957('0x2c')][_0x6957('0x1e')](_0x20caa3)[_0x6957('0x25')](function(_0x51b189){_0x3a6e07[_0x6957('0x1e')]=_0x51b189;if(_0x2d33ef[_0x6957('0x32')]['includeAll']){_0x595770[_0x6957('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6957('0x3f')](_0x595770);})[_0x6957('0x25')](function(_0x22ec26){_0x3a6e07[_0x6957('0x40')]=_0x22ec26;return _0x3a6e07;})[_0x6957('0x25')](respondWithFilteredResult(_0x320e1a,_0x595770))[_0x6957('0x41')](handleError(_0x320e1a,null));};exports[_0x6957('0x42')]=function(_0x16575e,_0x18fb2a){var _0x35fa2d={'raw':!![],'where':{'id':_0x16575e[_0x6957('0x43')]['id']}},_0x421526={};_0x421526[_0x6957('0x31')]=_[_0x6957('0x33')](db[_0x6957('0x2c')][_0x6957('0x2d')]);_0x421526['query']=_[_0x6957('0x33')](_0x16575e['query']);_0x421526['filters']=_[_0x6957('0x44')](_0x421526['model'],_0x421526['query']);_0x35fa2d[_0x6957('0x35')]=_[_0x6957('0x44')](_0x421526[_0x6957('0x31')],qs[_0x6957('0x36')](_0x16575e[_0x6957('0x32')][_0x6957('0x36')]));_0x35fa2d[_0x6957('0x35')]=_0x35fa2d[_0x6957('0x35')][_0x6957('0x37')]?_0x35fa2d[_0x6957('0x35')]:_0x421526['model'];if(_0x16575e['query'][_0x6957('0x45')]){_0x35fa2d['include']=[{'all':!![]}];}_0x35fa2d=_[_0x6957('0x3d')]({},_0x35fa2d,_0x16575e[_0x6957('0x46')]);return db['JscriptyAnswerReport'][_0x6957('0x47')](_0x35fa2d)[_0x6957('0x25')](handleEntityNotFound(_0x18fb2a,null))[_0x6957('0x25')](respondWithResult(_0x18fb2a,null))[_0x6957('0x41')](handleError(_0x18fb2a,null));};exports[_0x6957('0x48')]=function(_0x497e99,_0x9763aa){return db[_0x6957('0x2c')][_0x6957('0x48')](_0x497e99[_0x6957('0x49')],{})['then'](respondWithResult(_0x9763aa,0xc9))[_0x6957('0x41')](handleError(_0x9763aa,null));};exports[_0x6957('0x24')]=function(_0x5c5d5b,_0x1768ba){if(_0x5c5d5b[_0x6957('0x49')]['id']){delete _0x5c5d5b[_0x6957('0x49')]['id'];}return db[_0x6957('0x2c')]['find']({'where':{'id':_0x5c5d5b['params']['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x1768ba,null))[_0x6957('0x25')](saveUpdates(_0x5c5d5b[_0x6957('0x49')],null))[_0x6957('0x25')](respondWithResult(_0x1768ba,null))['catch'](handleError(_0x1768ba,null));};exports[_0x6957('0x26')]=function(_0x4ca6dc,_0x10fac5){return db['JscriptyAnswerReport'][_0x6957('0x47')]({'where':{'id':_0x4ca6dc['params']['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x10fac5,null))['then'](removeEntity(_0x10fac5,null))['catch'](handleError(_0x10fac5,null));};exports[_0x6957('0x4a')]=function(_0x371e29,_0x38e917){return db[_0x6957('0x2c')][_0x6957('0x4a')]()[_0x6957('0x25')](respondWithResult(_0x38e917,null))[_0x6957('0x41')](handleError(_0x38e917,null));}; \ No newline at end of file +var _0x3edc=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','undefined','limit','count','offset','set','Content-Range','json','save','then','destroy','status','error','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger'];(function(_0x57f7de,_0x1b1699){var _0x3d1dd9=function(_0x1e60cc){while(--_0x1e60cc){_0x57f7de['push'](_0x57f7de['shift']());}};_0x3d1dd9(++_0x1b1699);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x4e0c31,_0x208e9f){_0x4e0c31=_0x4e0c31-0x0;var _0x3fd7df=_0x3edc[_0x4e0c31];return _0x3fd7df;};'use strict';var emlformat=require(_0xc3ed('0x0'));var rimraf=require(_0xc3ed('0x1'));var zipdir=require(_0xc3ed('0x2'));var jsonpatch=require(_0xc3ed('0x3'));var rp=require(_0xc3ed('0x4'));var moment=require('moment');var BPromise=require(_0xc3ed('0x5'));var Mustache=require('mustache');var util=require(_0xc3ed('0x6'));var path=require(_0xc3ed('0x7'));var sox=require(_0xc3ed('0x8'));var csv=require(_0xc3ed('0x9'));var ejs=require(_0xc3ed('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc3ed('0xb'));var squel=require(_0xc3ed('0xc'));var crypto=require(_0xc3ed('0xd'));var jsforce=require(_0xc3ed('0xe'));var deskjs=require(_0xc3ed('0xf'));var toCsv=require(_0xc3ed('0x9'));var querystring=require('querystring');var Papa=require(_0xc3ed('0x10'));var Redis=require(_0xc3ed('0x11'));var authService=require(_0xc3ed('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3ed('0x13'))(_0xc3ed('0x14'));var utils=require(_0xc3ed('0x15'));var config=require(_0xc3ed('0x16'));var licenseUtil=require(_0xc3ed('0x17'));var db=require(_0xc3ed('0x18'))['db'];function respondWithStatusCode(_0x430db2,_0x394517){_0x394517=_0x394517||0xcc;return function(_0x3cc51e){if(_0x3cc51e){return _0x430db2[_0xc3ed('0x19')](_0x394517);}return _0x430db2['status'](_0x394517)[_0xc3ed('0x1a')]();};}function respondWithResult(_0x2fc82d,_0x12f718){_0x12f718=_0x12f718||0xc8;return function(_0x2eb6f3){if(_0x2eb6f3){return _0x2fc82d['status'](_0x12f718)['json'](_0x2eb6f3);}};}function respondWithFilteredResult(_0x59f603,_0x5a1715){return function(_0x30f93a){if(_0x30f93a){var _0x15a654=typeof _0x5a1715['offset']===_0xc3ed('0x1b')&&typeof _0x5a1715[_0xc3ed('0x1c')]==='undefined';var _0x498d53=_0x30f93a[_0xc3ed('0x1d')];var _0x3c3c7a=_0x15a654?0x0:_0x5a1715['offset'];var _0x64e548=_0x15a654?_0x30f93a[_0xc3ed('0x1d')]:_0x5a1715[_0xc3ed('0x1e')]+_0x5a1715[_0xc3ed('0x1c')];var _0x439a2e;if(_0x64e548>=_0x498d53){_0x64e548=_0x498d53;_0x439a2e=0xc8;}else{_0x439a2e=0xce;}_0x59f603['status'](_0x439a2e);return _0x59f603[_0xc3ed('0x1f')](_0xc3ed('0x20'),_0x3c3c7a+'-'+_0x64e548+'/'+_0x498d53)[_0xc3ed('0x21')](_0x30f93a);}return null;};}function patchUpdates(_0x17a727){return function(_0x1a4ad6){try{jsonpatch['apply'](_0x1a4ad6,_0x17a727,!![]);}catch(_0x2df14f){return BPromise['reject'](_0x2df14f);}return _0x1a4ad6[_0xc3ed('0x22')]();};}function saveUpdates(_0x80d2ca,_0x394aad){return function(_0x5e2b03){if(_0x5e2b03){return _0x5e2b03['update'](_0x80d2ca)[_0xc3ed('0x23')](function(_0x485707){return _0x485707;});}return null;};}function removeEntity(_0x5e818f,_0x2a6193){return function(_0x425c13){if(_0x425c13){return _0x425c13[_0xc3ed('0x24')]()['then'](function(){_0x5e818f[_0xc3ed('0x25')](0xcc)[_0xc3ed('0x1a')]();});}};}function handleEntityNotFound(_0x4f29ef,_0x4e7a55){return function(_0x16a7ed){if(!_0x16a7ed){_0x4f29ef[_0xc3ed('0x19')](0x194);}return _0x16a7ed;};}function handleError(_0x235262,_0x317a32){_0x317a32=_0x317a32||0x1f4;return function(_0x96d2de){logger[_0xc3ed('0x26')](_0x96d2de[_0xc3ed('0x27')]);if(_0x96d2de[_0xc3ed('0x28')]){delete _0x96d2de[_0xc3ed('0x28')];}_0x235262['status'](_0x317a32)[_0xc3ed('0x29')](_0x96d2de);};}exports[_0xc3ed('0x2a')]=function(_0x2ffb24,_0x568aa8){var _0x3682e3={},_0x48c131={},_0x12b0ff={'count':0x0,'rows':[]};var _0x26bd2a=_[_0xc3ed('0x2b')](db[_0xc3ed('0x2c')]['rawAttributes'],function(_0x5b029f){return{'name':_0x5b029f[_0xc3ed('0x2d')],'type':_0x5b029f[_0xc3ed('0x2e')]['key']};});_0x48c131[_0xc3ed('0x2f')]=_[_0xc3ed('0x2b')](_0x26bd2a,_0xc3ed('0x28'));_0x48c131[_0xc3ed('0x30')]=_[_0xc3ed('0x31')](_0x2ffb24[_0xc3ed('0x30')]);_0x48c131['filters']=_[_0xc3ed('0x32')](_0x48c131['model'],_0x48c131[_0xc3ed('0x30')]);_0x3682e3[_0xc3ed('0x33')]=_['intersection'](_0x48c131[_0xc3ed('0x2f')],qs[_0xc3ed('0x34')](_0x2ffb24[_0xc3ed('0x30')][_0xc3ed('0x34')]));_0x3682e3['attributes']=_0x3682e3[_0xc3ed('0x33')][_0xc3ed('0x35')]?_0x3682e3[_0xc3ed('0x33')]:_0x48c131[_0xc3ed('0x2f')];if(!_0x2ffb24[_0xc3ed('0x30')]['hasOwnProperty'](_0xc3ed('0x36'))){_0x3682e3[_0xc3ed('0x1c')]=qs[_0xc3ed('0x1c')](_0x2ffb24['query'][_0xc3ed('0x1c')]);_0x3682e3[_0xc3ed('0x1e')]=qs[_0xc3ed('0x1e')](_0x2ffb24['query'][_0xc3ed('0x1e')]);}_0x3682e3[_0xc3ed('0x37')]=qs[_0xc3ed('0x38')](_0x2ffb24['query']['sort']);_0x3682e3['where']=qs[_0xc3ed('0x39')](_['pick'](_0x2ffb24[_0xc3ed('0x30')],_0x48c131[_0xc3ed('0x39')]),_0x26bd2a);if(_0x2ffb24[_0xc3ed('0x30')][_0xc3ed('0x3a')]){_0x3682e3[_0xc3ed('0x3b')]=_[_0xc3ed('0x3c')](_0x3682e3[_0xc3ed('0x3b')],{'$or':_['map'](_0x26bd2a,function(_0x44404f){if(_0x44404f[_0xc3ed('0x2e')]!==_0xc3ed('0x3d')){var _0x18a2a0={};_0x18a2a0[_0x44404f[_0xc3ed('0x28')]]={'$like':'%'+_0x2ffb24[_0xc3ed('0x30')][_0xc3ed('0x3a')]+'%'};return _0x18a2a0;}})});}_0x3682e3=_[_0xc3ed('0x3c')]({},_0x3682e3,_0x2ffb24[_0xc3ed('0x3e')]);var _0x2b8c8c={'where':_0x3682e3['where']};return db[_0xc3ed('0x2c')]['count'](_0x2b8c8c)[_0xc3ed('0x23')](function(_0x28a3bd){_0x12b0ff[_0xc3ed('0x1d')]=_0x28a3bd;if(_0x2ffb24[_0xc3ed('0x30')]['includeAll']){_0x3682e3[_0xc3ed('0x3f')]=[{'all':!![]}];}return db[_0xc3ed('0x2c')][_0xc3ed('0x40')](_0x3682e3);})['then'](function(_0x30965d){_0x12b0ff[_0xc3ed('0x41')]=_0x30965d;return _0x12b0ff;})[_0xc3ed('0x23')](respondWithFilteredResult(_0x568aa8,_0x3682e3))[_0xc3ed('0x42')](handleError(_0x568aa8,null));};exports[_0xc3ed('0x43')]=function(_0x33c0ee,_0x4154d5){var _0x277982={'raw':!![],'where':{'id':_0x33c0ee[_0xc3ed('0x44')]['id']}},_0x36fea5={};_0x36fea5['model']=_[_0xc3ed('0x31')](db[_0xc3ed('0x2c')]['rawAttributes']);_0x36fea5['query']=_[_0xc3ed('0x31')](_0x33c0ee[_0xc3ed('0x30')]);_0x36fea5[_0xc3ed('0x39')]=_[_0xc3ed('0x32')](_0x36fea5[_0xc3ed('0x2f')],_0x36fea5['query']);_0x277982[_0xc3ed('0x33')]=_[_0xc3ed('0x32')](_0x36fea5[_0xc3ed('0x2f')],qs[_0xc3ed('0x34')](_0x33c0ee[_0xc3ed('0x30')][_0xc3ed('0x34')]));_0x277982[_0xc3ed('0x33')]=_0x277982[_0xc3ed('0x33')]['length']?_0x277982[_0xc3ed('0x33')]:_0x36fea5['model'];if(_0x33c0ee[_0xc3ed('0x30')][_0xc3ed('0x45')]){_0x277982[_0xc3ed('0x3f')]=[{'all':!![]}];}_0x277982=_[_0xc3ed('0x3c')]({},_0x277982,_0x33c0ee[_0xc3ed('0x3e')]);return db['JscriptyAnswerReport'][_0xc3ed('0x46')](_0x277982)[_0xc3ed('0x23')](handleEntityNotFound(_0x4154d5,null))[_0xc3ed('0x23')](respondWithResult(_0x4154d5,null))[_0xc3ed('0x42')](handleError(_0x4154d5,null));};exports[_0xc3ed('0x47')]=function(_0x5b71ac,_0x347d2a){return db[_0xc3ed('0x2c')]['create'](_0x5b71ac['body'],{})[_0xc3ed('0x23')](respondWithResult(_0x347d2a,0xc9))['catch'](handleError(_0x347d2a,null));};exports[_0xc3ed('0x48')]=function(_0x1effde,_0xcfc1d7){if(_0x1effde[_0xc3ed('0x49')]['id']){delete _0x1effde[_0xc3ed('0x49')]['id'];}return db[_0xc3ed('0x2c')][_0xc3ed('0x46')]({'where':{'id':_0x1effde[_0xc3ed('0x44')]['id']}})[_0xc3ed('0x23')](handleEntityNotFound(_0xcfc1d7,null))[_0xc3ed('0x23')](saveUpdates(_0x1effde[_0xc3ed('0x49')],null))[_0xc3ed('0x23')](respondWithResult(_0xcfc1d7,null))['catch'](handleError(_0xcfc1d7,null));};exports[_0xc3ed('0x24')]=function(_0x22e83f,_0x271e2b){return db[_0xc3ed('0x2c')][_0xc3ed('0x46')]({'where':{'id':_0x22e83f['params']['id']}})[_0xc3ed('0x23')](handleEntityNotFound(_0x271e2b,null))['then'](removeEntity(_0x271e2b,null))[_0xc3ed('0x42')](handleError(_0x271e2b,null));};exports['describe']=function(_0x29376b,_0x2cc20b){return db['JscriptyAnswerReport'][_0xc3ed('0x4a')]()['then'](respondWithResult(_0x2cc20b,null))[_0xc3ed('0x42')](handleError(_0x2cc20b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index ead7411..50623b7 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 _0x741a=['bluebird','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','api','moment'];(function(_0x21c48,_0x49ac0a){var _0x1f2cea=function(_0x51a5eb){while(--_0x51a5eb){_0x21c48['push'](_0x21c48['shift']());}};_0x1f2cea(++_0x49ac0a);}(_0x741a,0xb1));var _0xa741=function(_0x4a3e73,_0x4fea7c){_0x4a3e73=_0x4a3e73-0x0;var _0x2d8eb9=_0x741a[_0x4a3e73];return _0x2d8eb9;};'use strict';var _=require(_0xa741('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa741('0x1'));var moment=require(_0xa741('0x2'));var BPromise=require(_0xa741('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa741('0x4'));var rimraf=require('rimraf');var config=require(_0xa741('0x5'));var attributes=require(_0xa741('0x6'));module[_0xa741('0x7')]=function(_0x4f1253,_0x2f1d11){return _0x4f1253[_0xa741('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0xa741('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7a9=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x37e81f,_0x4de6ec){var _0x1fade0=function(_0x2eddea){while(--_0x2eddea){_0x37e81f['push'](_0x37e81f['shift']());}};_0x1fade0(++_0x4de6ec);}(_0xa7a9,0x1df));var _0x9a7a=function(_0x329b1c,_0x2a87d7){_0x329b1c=_0x329b1c-0x0;var _0x72bb76=_0xa7a9[_0x329b1c];return _0x72bb76;};'use strict';var _=require(_0x9a7a('0x0'));var util=require(_0x9a7a('0x1'));var logger=require(_0x9a7a('0x2'))(_0x9a7a('0x3'));var moment=require(_0x9a7a('0x4'));var BPromise=require(_0x9a7a('0x5'));var rp=require(_0x9a7a('0x6'));var fs=require('fs');var path=require(_0x9a7a('0x7'));var rimraf=require(_0x9a7a('0x8'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0x9a7a('0x9')]=function(_0x343121,_0xe60bd8){return _0x343121['define'](_0x9a7a('0xa'),attributes,{'tableName':_0x9a7a('0xb'),'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 0b78c2e..561e9bd 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 _0x656a=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','bluebird','ioredis','rpc','../../config/environment','jayson/promise','then'];(function(_0x51b362,_0x2a3af3){var _0x18bd6=function(_0xd5fcdb){while(--_0xd5fcdb){_0x51b362['push'](_0x51b362['shift']());}};_0x18bd6(++_0x2a3af3);}(_0x656a,0x68));var _0xa656=function(_0x2ace95,_0x186b37){_0x2ace95=_0x2ace95-0x0;var _0x35ecfa=_0x656a[_0x2ace95];return _0x35ecfa;};'use strict';var _=require(_0xa656('0x0'));var util=require(_0xa656('0x1'));var moment=require('moment');var BPromise=require(_0xa656('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa656('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa656('0x4'));var config=require(_0xa656('0x5'));var jayson=require(_0xa656('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x66669c,_0x318717,_0x4dbdfa){return new BPromise(function(_0x225083,_0x2bffa6){return client['request'](_0x66669c,_0x4dbdfa)[_0xa656('0x7')](function(_0x500fff){logger['info'](_0xa656('0x8'),_0x318717,_0xa656('0x9'));logger['debug'](_0xa656('0xa'),_0x318717,'request\x20sent',JSON[_0xa656('0xb')](_0x500fff));if(_0x500fff[_0xa656('0xc')]){if(_0x500fff[_0xa656('0xc')][_0xa656('0xd')]===0x1f4){logger['error'](_0xa656('0x8'),_0x318717,_0x500fff['error'][_0xa656('0xe')]);return _0x2bffa6(_0x500fff[_0xa656('0xc')][_0xa656('0xe')]);}logger['error'](_0xa656('0x8'),_0x318717,_0x500fff[_0xa656('0xc')][_0xa656('0xe')]);return _0x225083(_0x500fff['error'][_0xa656('0xe')]);}else{logger[_0xa656('0xf')](_0xa656('0x8'),_0x318717,'request\x20sent');_0x225083(_0x500fff['result']['message']);}})['catch'](function(_0x1879a4){logger['error'](_0xa656('0x8'),_0x318717,_0x1879a4);_0x2bffa6(_0x1879a4);});});} \ No newline at end of file +var _0x128e=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2b2c14,_0x1ae8f2){var _0x544072=function(_0x504ea0){while(--_0x504ea0){_0x2b2c14['push'](_0x2b2c14['shift']());}};_0x544072(++_0x1ae8f2);}(_0x128e,0x9e));var _0xe128=function(_0x2445dc,_0x386209){_0x2445dc=_0x2445dc-0x0;var _0x143dfd=_0x128e[_0x2445dc];return _0x143dfd;};'use strict';var _=require('lodash');var util=require(_0xe128('0x0'));var moment=require(_0xe128('0x1'));var BPromise=require(_0xe128('0x2'));var rs=require(_0xe128('0x3'));var fs=require('fs');var Redis=require(_0xe128('0x4'));var db=require(_0xe128('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe128('0x6'))(_0xe128('0x7'));var config=require(_0xe128('0x8'));var jayson=require(_0xe128('0x9'));var client=jayson[_0xe128('0xa')][_0xe128('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3eeaa8,_0x22e23b,_0x38ea18){return new BPromise(function(_0x522c82,_0x3b3e27){return client[_0xe128('0xc')](_0x3eeaa8,_0x38ea18)[_0xe128('0xd')](function(_0x469c67){logger[_0xe128('0xe')](_0xe128('0xf'),_0x22e23b,_0xe128('0x10'));logger[_0xe128('0x11')](_0xe128('0x12'),_0x22e23b,'request\x20sent',JSON[_0xe128('0x13')](_0x469c67));if(_0x469c67[_0xe128('0x14')]){if(_0x469c67[_0xe128('0x14')][_0xe128('0x15')]===0x1f4){logger[_0xe128('0x14')](_0xe128('0xf'),_0x22e23b,_0x469c67[_0xe128('0x14')][_0xe128('0x16')]);return _0x3b3e27(_0x469c67[_0xe128('0x14')][_0xe128('0x16')]);}logger[_0xe128('0x14')](_0xe128('0xf'),_0x22e23b,_0x469c67['error'][_0xe128('0x16')]);return _0x522c82(_0x469c67[_0xe128('0x14')]['message']);}else{logger['info'](_0xe128('0xf'),_0x22e23b,_0xe128('0x10'));_0x522c82(_0x469c67[_0xe128('0x17')][_0xe128('0x16')]);}})[_0xe128('0x18')](function(_0x2dcc63){logger[_0xe128('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x22e23b,_0x2dcc63);_0x3b3e27(_0x2dcc63);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 0096ffc..875054b 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 _0x5568=['isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','30s','getSummary','post','/:id/clone','clone','put','update','delete','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0xcf581b,_0x4359dd){var _0x4f454d=function(_0x182d58){while(--_0x182d58){_0xcf581b['push'](_0xcf581b['shift']());}};_0x4f454d(++_0x4359dd);}(_0x5568,0x119));var _0x8556=function(_0x2b618e,_0x2dd4f0){_0x2b618e=_0x2b618e-0x0;var _0x1b7f9f=_0x5568[_0x2b618e];return _0x1b7f9f;};'use strict';var multer=require('multer');var util=require(_0x8556('0x0'));var path=require('path');var timeout=require(_0x8556('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8556('0x2'));var interaction=require(_0x8556('0x3'));var config=require(_0x8556('0x4'));var controller=require(_0x8556('0x5'));router[_0x8556('0x6')]('/',auth[_0x8556('0x7')](),controller[_0x8556('0x8')]);router[_0x8556('0x6')](_0x8556('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x8556('0x6')](_0x8556('0xa'),auth[_0x8556('0x7')](),controller[_0x8556('0xb')]);router['get'](_0x8556('0xc'),auth[_0x8556('0x7')](),controller[_0x8556('0xd')]);router[_0x8556('0x6')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x8556('0xe')),controller[_0x8556('0xf')]);router[_0x8556('0x10')]('/',auth[_0x8556('0x7')](),controller['create']);router[_0x8556('0x10')](_0x8556('0x11'),auth[_0x8556('0x7')](),controller[_0x8556('0x12')]);router[_0x8556('0x13')](_0x8556('0x9'),auth['isAuthenticated'](),controller[_0x8556('0x14')]);router[_0x8556('0x15')](_0x8556('0x9'),auth[_0x8556('0x7')](),controller[_0x8556('0x16')]);module[_0x8556('0x17')]=router; \ No newline at end of file +var _0xbf5d=['create','clone','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','/:id/sessions','isAuthenticated','getSessions','/:id/answers','30s','getSummary'];(function(_0x2348ad,_0x12b8ca){var _0x38ff75=function(_0x45980b){while(--_0x45980b){_0x2348ad['push'](_0x2348ad['shift']());}};_0x38ff75(++_0x12b8ca);}(_0xbf5d,0xcf));var _0xdbf5=function(_0x51594d,_0x110073){_0x51594d=_0x51594d-0x0;var _0x107268=_0xbf5d[_0x51594d];return _0x107268;};'use strict';var multer=require(_0xdbf5('0x0'));var util=require(_0xdbf5('0x1'));var path=require('path');var timeout=require(_0xdbf5('0x2'));var express=require(_0xdbf5('0x3'));var router=express[_0xdbf5('0x4')]();var fs_extra=require(_0xdbf5('0x5'));var auth=require(_0xdbf5('0x6'));var interaction=require(_0xdbf5('0x7'));var config=require(_0xdbf5('0x8'));var controller=require('./jscriptyProject.controller');router[_0xdbf5('0x9')]('/',auth['isAuthenticated'](),controller[_0xdbf5('0xa')]);router[_0xdbf5('0x9')](_0xdbf5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdbf5('0x9')](_0xdbf5('0xc'),auth[_0xdbf5('0xd')](),controller[_0xdbf5('0xe')]);router[_0xdbf5('0x9')](_0xdbf5('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xdbf5('0x9')]('/:id/summary',auth[_0xdbf5('0xd')](),timeout(_0xdbf5('0x10')),controller[_0xdbf5('0x11')]);router['post']('/',auth[_0xdbf5('0xd')](),controller[_0xdbf5('0x12')]);router['post']('/:id/clone',auth[_0xdbf5('0xd')](),controller[_0xdbf5('0x13')]);router[_0xdbf5('0x14')](_0xdbf5('0xb'),auth['isAuthenticated'](),controller[_0xdbf5('0x15')]);router[_0xdbf5('0x16')](_0xdbf5('0xb'),auth[_0xdbf5('0xd')](),controller[_0xdbf5('0x17')]);module[_0xdbf5('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 2430081..2310f0f 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 _0x9f0c=['isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike'];(function(_0x586a05,_0x213f1d){var _0x536a90=function(_0x497a1f){while(--_0x497a1f){_0x586a05['push'](_0x586a05['shift']());}};_0x536a90(++_0x213f1d);}(_0x9f0c,0x137));var _0xc9f0=function(_0x5b0ba6,_0x1596de){_0x5b0ba6=_0x5b0ba6-0x0;var _0x57460f=_0x9f0c[_0x5b0ba6];return _0x57460f;};'use strict';var Sequelize=require(_0xc9f0('0x0'));var _=require(_0xc9f0('0x1'));var util=require(_0xc9f0('0x2'));module[_0xc9f0('0x3')]={'name':{'type':Sequelize[_0xc9f0('0x4')],'unique':_0xc9f0('0x5')},'description':{'type':Sequelize[_0xc9f0('0x4')]},'formData':{'type':Sequelize[_0xc9f0('0x6')](_0xc9f0('0x7')),'set':function(_0xdd5cb1){if(_[_0xc9f0('0x8')](_0xdd5cb1)){this['setDataValue']('formData',JSON['stringify'](_0xdd5cb1));}else if(_[_0xc9f0('0x9')](_0xdd5cb1)){this[_0xc9f0('0xa')]('formData',_0xdd5cb1);}else{this['setDataValue']('formData',util[_0xc9f0('0xb')](_0xc9f0('0xc'),this[_0xc9f0('0xd')](_0xc9f0('0x5'))||'',this['getDataValue'](_0xc9f0('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc9f0('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc9f0('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x7aca=['getDataValue','description','BOOLEAN','sequelize','lodash','util','name','STRING','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x3e0112,_0x20a04b){var _0x259624=function(_0x149802){while(--_0x149802){_0x3e0112['push'](_0x3e0112['shift']());}};_0x259624(++_0x20a04b);}(_0x7aca,0xad));var _0xa7ac=function(_0x2fdadd,_0x6e157f){_0x2fdadd=_0x2fdadd-0x0;var _0x1c98a1=_0x7aca[_0x2fdadd];return _0x1c98a1;};'use strict';var Sequelize=require(_0xa7ac('0x0'));var _=require(_0xa7ac('0x1'));var util=require(_0xa7ac('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa7ac('0x3')},'description':{'type':Sequelize[_0xa7ac('0x4')]},'formData':{'type':Sequelize[_0xa7ac('0x5')](_0xa7ac('0x6')),'set':function(_0x1a5a58){if(_[_0xa7ac('0x7')](_0x1a5a58)){this[_0xa7ac('0x8')]('formData',JSON[_0xa7ac('0x9')](_0x1a5a58));}else if(_[_0xa7ac('0xa')](_0x1a5a58)){this[_0xa7ac('0x8')](_0xa7ac('0xb'),_0x1a5a58);}else{this[_0xa7ac('0x8')](_0xa7ac('0xb'),util[_0xa7ac('0xc')](_0xa7ac('0xd'),this[_0xa7ac('0xe')](_0xa7ac('0x3'))||'',this[_0xa7ac('0xe')](_0xa7ac('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa7ac('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa7ac('0x10')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 123c7ea..fdf78c1 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 _0xb1fa=['params','keys','find','create','body','user','role','Projects','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getSessions','findOne','JscriptySessionReport','order','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','indexOf','toString','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','sendStatus','zip-dir','request-promise','sox','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show'];(function(_0x3ae87c,_0x3eff99){var _0x1e2270=function(_0x115497){while(--_0x115497){_0x3ae87c['push'](_0x3ae87c['shift']());}};_0x1e2270(++_0x3eff99);}(_0xb1fa,0x9e));var _0xab1f=function(_0x15fef5,_0x4b9ec6){_0x15fef5=_0x15fef5-0x0;var _0x5a6199=_0xb1fa[_0x15fef5];return _0x5a6199;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xab1f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab1f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xab1f('0x2'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab1f('0x3'));var squel=require('squel');var crypto=require(_0xab1f('0x4'));var jsforce=require(_0xab1f('0x5'));var deskjs=require('desk.js');var toCsv=require(_0xab1f('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xab1f('0x7'));var authService=require(_0xab1f('0x8'));var qs=require(_0xab1f('0x9'));var as=require(_0xab1f('0xa'));var hardwareService=require(_0xab1f('0xb'));var logger=require('../../config/logger')(_0xab1f('0xc'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xab1f('0xd'));var db=require(_0xab1f('0xe'))['db'];function respondWithStatusCode(_0x5168bb,_0x4cb402){_0x4cb402=_0x4cb402||0xcc;return function(_0xea4a03){if(_0xea4a03){return _0x5168bb['sendStatus'](_0x4cb402);}return _0x5168bb[_0xab1f('0xf')](_0x4cb402)[_0xab1f('0x10')]();};}function respondWithResult(_0x68b4e4,_0x58a0fb){_0x58a0fb=_0x58a0fb||0xc8;return function(_0x2ee266){if(_0x2ee266){return _0x68b4e4[_0xab1f('0xf')](_0x58a0fb)[_0xab1f('0x11')](_0x2ee266);}};}function respondWithFilteredResult(_0x1c0260,_0x5124d6){return function(_0x33fc3a){if(_0x33fc3a){var _0x4c68b0=typeof _0x5124d6[_0xab1f('0x12')]===_0xab1f('0x13')&&typeof _0x5124d6[_0xab1f('0x14')]==='undefined';var _0x1582bd=_0x33fc3a[_0xab1f('0x15')];var _0x558c52=_0x4c68b0?0x0:_0x5124d6[_0xab1f('0x12')];var _0x4ba3f4=_0x4c68b0?_0x33fc3a[_0xab1f('0x15')]:_0x5124d6[_0xab1f('0x12')]+_0x5124d6[_0xab1f('0x14')];var _0x547fc0;if(_0x4ba3f4>=_0x1582bd){_0x4ba3f4=_0x1582bd;_0x547fc0=0xc8;}else{_0x547fc0=0xce;}_0x1c0260[_0xab1f('0xf')](_0x547fc0);return _0x1c0260[_0xab1f('0x16')]('Content-Range',_0x558c52+'-'+_0x4ba3f4+'/'+_0x1582bd)[_0xab1f('0x11')](_0x33fc3a);}return null;};}function patchUpdates(_0x30f973){return function(_0x4fe6d7){try{jsonpatch['apply'](_0x4fe6d7,_0x30f973,!![]);}catch(_0x3103e1){return BPromise[_0xab1f('0x17')](_0x3103e1);}return _0x4fe6d7[_0xab1f('0x18')]();};}function saveUpdates(_0x425b61,_0x1bd51b){return function(_0x2915b9){if(_0x2915b9){return _0x2915b9[_0xab1f('0x19')](_0x425b61)['then'](function(_0x37ae5e){return _0x37ae5e;});}return null;};}function removeEntity(_0x85f20a,_0x3662b8){return function(_0x33b647){if(_0x33b647){return _0x33b647['destroy']()[_0xab1f('0x1a')](function(){var _0x219f01=_0x33b647[_0xab1f('0x1b')]({'plain':!![]});var _0x162041='Projects';return db[_0xab1f('0x1c')][_0xab1f('0x1d')]({'where':{'type':_0x162041,'resourceId':_0x219f01['id']}})[_0xab1f('0x1a')](function(){return _0x33b647;});})[_0xab1f('0x1a')](function(){_0x85f20a[_0xab1f('0xf')](0xcc)[_0xab1f('0x10')]();});}};}function handleEntityNotFound(_0x357c51,_0x4ffb2e){return function(_0x2216ca){if(!_0x2216ca){_0x357c51['sendStatus'](0x194);}return _0x2216ca;};}function handleError(_0x38ee2b,_0x5b869d){_0x5b869d=_0x5b869d||0x1f4;return function(_0x3357b9){logger[_0xab1f('0x1e')](_0x3357b9[_0xab1f('0x1f')]);if(_0x3357b9[_0xab1f('0x20')]){delete _0x3357b9[_0xab1f('0x20')];}_0x38ee2b[_0xab1f('0xf')](_0x5b869d)[_0xab1f('0x21')](_0x3357b9);};}exports[_0xab1f('0x22')]=function(_0x12be07,_0x5d924b){var _0x355706={},_0x5e6170={},_0x1c1bce={'count':0x0,'rows':[]};var _0x24c678=_[_0xab1f('0x23')](db[_0xab1f('0x24')][_0xab1f('0x25')],function(_0x5c3de8){return{'name':_0x5c3de8[_0xab1f('0x26')],'type':_0x5c3de8[_0xab1f('0x27')][_0xab1f('0x28')]};});_0x5e6170['model']=_[_0xab1f('0x23')](_0x24c678,'name');_0x5e6170[_0xab1f('0x29')]=_['keys'](_0x12be07[_0xab1f('0x29')]);_0x5e6170['filters']=_[_0xab1f('0x2a')](_0x5e6170[_0xab1f('0x2b')],_0x5e6170[_0xab1f('0x29')]);_0x355706[_0xab1f('0x2c')]=_['intersection'](_0x5e6170['model'],qs[_0xab1f('0x2d')](_0x12be07['query'][_0xab1f('0x2d')]));_0x355706[_0xab1f('0x2c')]=_0x355706[_0xab1f('0x2c')][_0xab1f('0x2e')]?_0x355706[_0xab1f('0x2c')]:_0x5e6170[_0xab1f('0x2b')];if(!_0x12be07['query'][_0xab1f('0x2f')](_0xab1f('0x30'))){_0x355706['limit']=qs['limit'](_0x12be07[_0xab1f('0x29')][_0xab1f('0x14')]);_0x355706[_0xab1f('0x12')]=qs[_0xab1f('0x12')](_0x12be07[_0xab1f('0x29')][_0xab1f('0x12')]);}_0x355706['order']=qs[_0xab1f('0x31')](_0x12be07[_0xab1f('0x29')][_0xab1f('0x31')]);_0x355706[_0xab1f('0x32')]=qs[_0xab1f('0x33')](_[_0xab1f('0x34')](_0x12be07[_0xab1f('0x29')],_0x5e6170['filters']),_0x24c678);if(_0x12be07[_0xab1f('0x29')][_0xab1f('0x35')]){_0x355706[_0xab1f('0x32')]=_[_0xab1f('0x36')](_0x355706[_0xab1f('0x32')],{'$or':_[_0xab1f('0x23')](_0x24c678,function(_0x353ec8){if(_0x353ec8[_0xab1f('0x27')]!==_0xab1f('0x37')){var _0x5b28b0={};_0x5b28b0[_0x353ec8[_0xab1f('0x20')]]={'$like':'%'+_0x12be07[_0xab1f('0x29')][_0xab1f('0x35')]+'%'};return _0x5b28b0;}})});}_0x355706=_[_0xab1f('0x36')]({},_0x355706,_0x12be07[_0xab1f('0x38')]);var _0x1da2dc={'where':_0x355706[_0xab1f('0x32')]};return db[_0xab1f('0x24')][_0xab1f('0x15')](_0x1da2dc)[_0xab1f('0x1a')](function(_0xe349a6){_0x1c1bce[_0xab1f('0x15')]=_0xe349a6;if(_0x12be07[_0xab1f('0x29')][_0xab1f('0x39')]){_0x355706[_0xab1f('0x3a')]=[{'all':!![]}];}return db['JscriptyProject'][_0xab1f('0x3b')](_0x355706);})['then'](function(_0x3e12c3){_0x1c1bce['rows']=_0x3e12c3;return _0x1c1bce;})[_0xab1f('0x1a')](respondWithFilteredResult(_0x5d924b,_0x355706))[_0xab1f('0x3c')](handleError(_0x5d924b,null));};exports[_0xab1f('0x3d')]=function(_0x2240cc,_0x57e397){var _0x1fd5ee={'raw':![],'where':{'id':_0x2240cc[_0xab1f('0x3e')]['id']}},_0x26c50c={};_0x26c50c['model']=_[_0xab1f('0x3f')](db['JscriptyProject']['rawAttributes']);_0x26c50c[_0xab1f('0x29')]=_['keys'](_0x2240cc[_0xab1f('0x29')]);_0x26c50c['filters']=_['intersection'](_0x26c50c[_0xab1f('0x2b')],_0x26c50c[_0xab1f('0x29')]);_0x1fd5ee[_0xab1f('0x2c')]=_['intersection'](_0x26c50c[_0xab1f('0x2b')],qs['fields'](_0x2240cc[_0xab1f('0x29')][_0xab1f('0x2d')]));_0x1fd5ee[_0xab1f('0x2c')]=_0x1fd5ee['attributes'][_0xab1f('0x2e')]?_0x1fd5ee[_0xab1f('0x2c')]:_0x26c50c['model'];if(_0x2240cc[_0xab1f('0x29')][_0xab1f('0x39')]){_0x1fd5ee[_0xab1f('0x3a')]=[{'all':!![]}];}_0x1fd5ee=_['merge']({},_0x1fd5ee,_0x2240cc[_0xab1f('0x38')]);return db[_0xab1f('0x24')][_0xab1f('0x40')](_0x1fd5ee)[_0xab1f('0x1a')](handleEntityNotFound(_0x57e397,null))[_0xab1f('0x1a')](respondWithResult(_0x57e397,null))['catch'](handleError(_0x57e397,null));};exports[_0xab1f('0x41')]=function(_0xa21313,_0x2c11df){return db[_0xab1f('0x24')]['create'](_0xa21313[_0xab1f('0x42')],{})['then'](function(_0x3491d3){var _0x1d3d41=_0xa21313[_0xab1f('0x43')]['get']({'plain':!![]});if(!_0x1d3d41)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d3d41[_0xab1f('0x44')]==='user'){var _0x4905b0=_0x3491d3['get']({'plain':!![]});var _0xe2eced=_0xab1f('0x45');return db[_0xab1f('0x46')][_0xab1f('0x40')]({'where':{'name':_0xe2eced,'userProfileId':_0x1d3d41['userProfileId']},'raw':!![]})[_0xab1f('0x1a')](function(_0x37f819){if(_0x37f819&&_0x37f819['autoAssociation']===0x0){return db[_0xab1f('0x1c')][_0xab1f('0x41')]({'name':_0x4905b0[_0xab1f('0x20')],'resourceId':_0x4905b0['id'],'type':_0x37f819['name'],'sectionId':_0x37f819['id']},{})[_0xab1f('0x1a')](function(){return _0x3491d3;});}else{return _0x3491d3;}})[_0xab1f('0x3c')](function(_0x331754){logger[_0xab1f('0x1e')](_0xab1f('0x47'),_0x331754);throw _0x331754;});}return _0x3491d3;})[_0xab1f('0x1a')](respondWithResult(_0x2c11df,0xc9))[_0xab1f('0x3c')](handleError(_0x2c11df,null));};exports[_0xab1f('0x48')]=function(_0x2b1400,_0x3bf108){var _0x308e3e={'where':{'id':_0x2b1400[_0xab1f('0x3e')]['id']}},_0xb09f6d={};_0xb09f6d[_0xab1f('0x2b')]=_[_0xab1f('0x3f')](db['JscriptyProject'][_0xab1f('0x25')]);_0x308e3e[_0xab1f('0x2c')]=_[_0xab1f('0x2a')](_0xb09f6d[_0xab1f('0x2b')],qs[_0xab1f('0x2d')](_0x2b1400[_0xab1f('0x29')][_0xab1f('0x2d')]));_0x308e3e[_0xab1f('0x2c')]=_0x308e3e[_0xab1f('0x2c')][_0xab1f('0x2e')]?_0x308e3e[_0xab1f('0x2c')]:_0xb09f6d[_0xab1f('0x2b')];if(_0x2b1400['query'][_0xab1f('0x39')]){_0x308e3e[_0xab1f('0x3a')]=[{'all':!![]}];}_0x308e3e=_['merge']({},_0x308e3e,_0x2b1400[_0xab1f('0x38')]);return db[_0xab1f('0x24')][_0xab1f('0x40')](_0x308e3e)[_0xab1f('0x1a')](handleEntityNotFound(_0x3bf108,null))[_0xab1f('0x1a')](function(_0x557b50){if(_0x557b50){var _0x26ba40=_0x557b50[_0xab1f('0x1b')]({'plain':!![]});_0x26ba40=qs['omit'](_0x26ba40,['id',_0xab1f('0x49'),_0xab1f('0x4a')]);_0x2b1400['body']=_['omit'](_0x2b1400['body'],['id',_0xab1f('0x49'),_0xab1f('0x4a')]);return db[_0xab1f('0x24')]['create'](_[_0xab1f('0x36')](_0x26ba40,_0x2b1400[_0xab1f('0x42')]),{'include':_0x2b1400[_0xab1f('0x29')][_0xab1f('0x39')]?[{'all':!![]}]:undefined})[_0xab1f('0x1a')](function(_0x1899df){var _0x20e5af=_0x2b1400['user'][_0xab1f('0x1b')]({'plain':!![]});if(!_0x20e5af)throw new Error(_0xab1f('0x4b'));if(_0x20e5af[_0xab1f('0x44')]===_0xab1f('0x43')){var _0x28e5a4=_0x1899df['get']({'plain':!![]});var _0x3ff76e=_0xab1f('0x45');return db['UserProfileSection'][_0xab1f('0x40')]({'where':{'name':_0x3ff76e,'userProfileId':_0x20e5af['userProfileId']},'raw':!![]})['then'](function(_0x4bf0f3){if(_0x4bf0f3&&_0x4bf0f3[_0xab1f('0x4c')]===0x0){return db['UserProfileResource'][_0xab1f('0x41')]({'name':_0x28e5a4[_0xab1f('0x20')],'resourceId':_0x28e5a4['id'],'type':_0x4bf0f3[_0xab1f('0x20')],'sectionId':_0x4bf0f3['id']},{})[_0xab1f('0x1a')](function(){return _0x1899df;});}else{return _0x1899df;}})[_0xab1f('0x3c')](function(_0x2832f3){logger[_0xab1f('0x1e')](_0xab1f('0x47'),_0x2832f3);throw _0x2832f3;});}return _0x1899df;});}})[_0xab1f('0x1a')](respondWithResult(_0x3bf108,0xc9))[_0xab1f('0x3c')](handleError(_0x3bf108,null));};exports[_0xab1f('0x19')]=function(_0x260456,_0x1ce532){if(_0x260456[_0xab1f('0x42')]['id']){delete _0x260456[_0xab1f('0x42')]['id'];}return db['JscriptyProject'][_0xab1f('0x40')]({'where':{'id':_0x260456[_0xab1f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1ce532,null))[_0xab1f('0x1a')](saveUpdates(_0x260456['body'],null))['then'](respondWithResult(_0x1ce532,null))[_0xab1f('0x3c')](handleError(_0x1ce532,null));};exports[_0xab1f('0x1d')]=function(_0x15b9a4,_0x43e45b){return db[_0xab1f('0x24')]['find']({'where':{'id':_0x15b9a4[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x43e45b,null))['then'](removeEntity(_0x43e45b,null))[_0xab1f('0x3c')](handleError(_0x43e45b,null));};exports[_0xab1f('0x4d')]=function(_0x51a9e3,_0x340298,_0x340652){var _0x2562c6={'raw':!![],'where':{}};var _0x557dab={};var _0x49e901={'count':0x0,'rows':[]};return db[_0xab1f('0x24')][_0xab1f('0x4e')]({'where':{'id':_0x51a9e3[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x340298,null))[_0xab1f('0x1a')](function(_0x21502c){if(_0x21502c){_0x557dab['model']=_[_0xab1f('0x3f')](db[_0xab1f('0x4f')][_0xab1f('0x25')]);_0x557dab['query']=_[_0xab1f('0x3f')](_0x51a9e3['query']);_0x557dab[_0xab1f('0x33')]=_[_0xab1f('0x2a')](_0x557dab[_0xab1f('0x2b')],_0x557dab[_0xab1f('0x29')]);_0x2562c6['attributes']=_[_0xab1f('0x2a')](_0x557dab[_0xab1f('0x2b')],qs['fields'](_0x51a9e3['query'][_0xab1f('0x2d')]));_0x2562c6[_0xab1f('0x2c')]=_0x2562c6[_0xab1f('0x2c')][_0xab1f('0x2e')]?_0x2562c6['attributes']:_0x557dab[_0xab1f('0x2b')];if(!_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x2f')](_0xab1f('0x30'))){_0x2562c6[_0xab1f('0x14')]=qs[_0xab1f('0x14')](_0x51a9e3[_0xab1f('0x29')]['limit']);_0x2562c6[_0xab1f('0x12')]=qs['offset'](_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x12')]);}_0x2562c6[_0xab1f('0x50')]=qs['sort'](_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x31')]);_0x2562c6[_0xab1f('0x32')]=qs[_0xab1f('0x33')](_[_0xab1f('0x34')](_0x51a9e3['query'],_0x557dab[_0xab1f('0x33')]));_0x2562c6[_0xab1f('0x32')][_0xab1f('0x51')]=_0x21502c['id'];if(_0x51a9e3['query'][_0xab1f('0x35')]){_0x2562c6[_0xab1f('0x32')]=_[_0xab1f('0x36')](_0x2562c6[_0xab1f('0x32')],{'$or':_['map'](_0x2562c6[_0xab1f('0x2c')],function(_0x331d06){var _0x5a6cb3={};_0x5a6cb3[_0x331d06]={'$like':'%'+_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x35')]+'%'};return _0x5a6cb3;})});}_0x2562c6=_['merge']({},_0x2562c6,_0x51a9e3['options']);return db[_0xab1f('0x4f')][_0xab1f('0x15')]({'where':_0x2562c6[_0xab1f('0x32')]})[_0xab1f('0x1a')](function(_0x5055d7){_0x49e901['count']=_0x5055d7;if(_0x51a9e3[_0xab1f('0x29')][_0xab1f('0x39')]){_0x2562c6[_0xab1f('0x3a')]=[{'all':!![]}];}return db[_0xab1f('0x4f')][_0xab1f('0x3b')](_0x2562c6);})[_0xab1f('0x1a')](function(_0x15733b){_0x49e901[_0xab1f('0x52')]=_0x15733b;return _0x49e901;});}})[_0xab1f('0x1a')](respondWithFilteredResult(_0x340298,_0x2562c6))['catch'](handleError(_0x340298,null));};exports[_0xab1f('0x53')]=function(_0x573953,_0x36b5d2,_0x1b744a){var _0x5118b3={'raw':!![],'where':{}};var _0x3dc03a={};var _0x19e16a={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xab1f('0x4e')]({'where':{'id':_0x573953[_0xab1f('0x3e')]['id']}})[_0xab1f('0x1a')](handleEntityNotFound(_0x36b5d2,null))[_0xab1f('0x1a')](function(_0x405368){if(_0x405368){_0x3dc03a[_0xab1f('0x2b')]=_['keys'](db[_0xab1f('0x54')][_0xab1f('0x25')]);_0x3dc03a[_0xab1f('0x29')]=_['keys'](_0x573953[_0xab1f('0x29')]);_0x3dc03a['filters']=_[_0xab1f('0x2a')](_0x3dc03a[_0xab1f('0x2b')],_0x3dc03a[_0xab1f('0x29')]);_0x5118b3[_0xab1f('0x2c')]=_['intersection'](_0x3dc03a[_0xab1f('0x2b')],qs[_0xab1f('0x2d')](_0x573953[_0xab1f('0x29')][_0xab1f('0x2d')]));_0x5118b3[_0xab1f('0x2c')]=_0x5118b3[_0xab1f('0x2c')]['length']?_0x5118b3['attributes']:_0x3dc03a[_0xab1f('0x2b')];if(!_0x573953[_0xab1f('0x29')]['hasOwnProperty'](_0xab1f('0x30'))){_0x5118b3[_0xab1f('0x14')]=qs[_0xab1f('0x14')](_0x573953[_0xab1f('0x29')][_0xab1f('0x14')]);_0x5118b3[_0xab1f('0x12')]=qs[_0xab1f('0x12')](_0x573953[_0xab1f('0x29')][_0xab1f('0x12')]);}_0x5118b3[_0xab1f('0x50')]=qs[_0xab1f('0x31')](_0x573953[_0xab1f('0x29')][_0xab1f('0x31')]);_0x5118b3[_0xab1f('0x32')]=qs['filters'](_[_0xab1f('0x34')](_0x573953['query'],_0x3dc03a['filters']));_0x5118b3[_0xab1f('0x32')][_0xab1f('0x51')]=_0x405368['id'];if(_0x573953['query'][_0xab1f('0x35')]){_0x5118b3['where']=_[_0xab1f('0x36')](_0x5118b3[_0xab1f('0x32')],{'$or':_[_0xab1f('0x23')](_0x5118b3[_0xab1f('0x2c')],function(_0x42005f){var _0x3e1472={};_0x3e1472[_0x42005f]={'$like':'%'+_0x573953['query']['filter']+'%'};return _0x3e1472;})});}_0x5118b3=_[_0xab1f('0x36')]({},_0x5118b3,_0x573953[_0xab1f('0x38')]);return db[_0xab1f('0x54')][_0xab1f('0x15')]({'where':_0x5118b3['where']})[_0xab1f('0x1a')](function(_0x28f1b6){_0x19e16a['count']=_0x28f1b6;if(_0x573953[_0xab1f('0x29')][_0xab1f('0x39')]){_0x5118b3['include']=[{'all':!![]}];}return db[_0xab1f('0x54')][_0xab1f('0x3b')](_0x5118b3);})[_0xab1f('0x1a')](function(_0x14cb9d){_0x19e16a[_0xab1f('0x52')]=_0x14cb9d;return _0x19e16a;});}})[_0xab1f('0x1a')](respondWithFilteredResult(_0x36b5d2,_0x5118b3))['catch'](handleError(_0x36b5d2,null));};function char(_0x3d3f51){return _0xab1f('0x55')===typeof _0x3d3f51?String[_0xab1f('0x56')][_0xab1f('0x57')](null,arguments):_0x3d3f51;}function needsEncapsulation(_0xe851f7){return!!_0xe851f7&&(_0xe851f7['toString']()[_0xab1f('0x58')](char(0xd))>=0x0||_0xe851f7[_0xab1f('0x59')]()[_0xab1f('0x58')](char(0xa))>=0x0||_0xe851f7['toString']()[_0xab1f('0x58')](char(0x2c))>=0x0||_0xe851f7['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x21a891){var _0x44d765=char(0x22),_0x4e0da0='\x5c'+char(0x22),_0x1686c0=_0x21a891['toString']()['replace'](new RegExp(_0x44d765,'g'),_0x4e0da0);return _0x44d765+_0x1686c0+_0x44d765;}exports[_0xab1f('0x5a')]=function(_0x45af59,_0x461683,_0x3f9cd0){var _0x18b816,_0x2aa733;var _0x1bed49={'where':{'ProjectId':_0x45af59[_0xab1f('0x3e')]['id']}};if(_0x45af59[_0xab1f('0x29')]['startTime']){_0x1bed49[_0xab1f('0x32')]['starttime']=JSON['parse'](_0x45af59['query'][_0xab1f('0x5b')]);}return db[_0xab1f('0x4f')]['findAll'](_0x1bed49)[_0xab1f('0x1a')](handleEntityNotFound(_0x461683,null))[_0xab1f('0x1a')](function(_0x2d3a50){if(_0x2d3a50){_0x18b816=_0x2d3a50;return db[_0xab1f('0x5c')]['findAll']({'where':{'SessionId':{'$in':_[_0xab1f('0x23')](_0x18b816,'id')},'ProjectId':_0x45af59[_0xab1f('0x3e')]['id']},'order':_0xab1f('0x5d')});}})['then'](handleEntityNotFound(_0x461683,null))[_0xab1f('0x1a')](function(_0xa4ed29){if(_0xa4ed29){_0x2aa733=_0xa4ed29;var _0x4fea54={};for(var _0x1f14ed=0x0,_0x3b2ba0=_0x2aa733[_0xab1f('0x2e')];_0x1f14ed<_0x3b2ba0;_0x1f14ed++){if(!_0x4fea54[_0xab1f('0x2f')](_0x2aa733[_0x1f14ed][_0xab1f('0x5e')])){_0x4fea54[_0x2aa733[_0x1f14ed][_0xab1f('0x5e')]]=needsEncapsulation(_0x2aa733[_0x1f14ed][_0xab1f('0x5f')])?encapsulate(_0x2aa733[_0x1f14ed][_0xab1f('0x5f')]):_0x2aa733[_0x1f14ed][_0xab1f('0x5f')];}}var _0x19d501=[],_0x3ac58f={};for(var _0x14d6ff=0x0,_0x3d7d1f=_0x18b816[_0xab1f('0x2e')];_0x14d6ff<_0x3d7d1f;_0x14d6ff++){_0x3ac58f={'ProjectId':_0x45af59[_0xab1f('0x3e')]['id'],'SessionId':_0x18b816[_0x14d6ff]['id'],'StartTime':moment(_0x18b816[_0x14d6ff]['starttime'])[_0xab1f('0x60')](_0xab1f('0x61'))};for(var _0x377858=0x0,_0x1c8efd=_0x2aa733['length'];_0x377858<_0x1c8efd;_0x377858++){if(_0x2aa733[_0x377858][_0xab1f('0x62')]==_0x18b816[_0x14d6ff]['id']&&_0x4fea54['hasOwnProperty'](_0x2aa733[_0x377858]['questionId'])){_0x3ac58f[_0x4fea54[_0x2aa733[_0x377858]['questionId']]]=_0x2aa733[_0x377858][_0xab1f('0x63')];}}for(var _0x8a57e1 in _0x4fea54){if(!_0x3ac58f[_0xab1f('0x2f')](_0x4fea54[_0x8a57e1])){_0x3ac58f[_0x4fea54[_0x8a57e1]]=null;}}_0x19d501[_0xab1f('0x64')](_0x3ac58f);}return _0x19d501;}})[_0xab1f('0x1a')](function(_0x56fb8a){if(!_['isEmpty'](_0x56fb8a)){var _0x522fd2=toCsv(_0x56fb8a);var _0x5b2d62=Date[_0xab1f('0x65')]();fs[_0xab1f('0x66')](util[_0xab1f('0x60')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x45af59[_0xab1f('0x3e')]['id'],_0x5b2d62),_0x522fd2);_0x461683[_0xab1f('0x67')](_0xab1f('0x68'),_0xab1f('0x69')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x45af59['params']['id'],_0x5b2d62));_0x461683[_0xab1f('0x67')](_0xab1f('0x6a'),_0xab1f('0x6b'));return _0x461683[_0xab1f('0x6c')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x45af59[_0xab1f('0x3e')]['id'],_0x5b2d62));}else{return _0x461683[_0xab1f('0x6d')](0xcc);}})[_0xab1f('0x3c')](handleError(_0x461683,null));}; \ No newline at end of file +var _0xaf4c=['setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','save','update','destroy','then','get','Projects','UserProfileResource','end','stack','name','send','index','JscriptyProject','type','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','error','getSessions','JscriptySessionReport','order','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x4ee00e,_0x21acce){_0x4ee00e=_0x4ee00e-0x0;var _0x4acec2=_0xaf4c[_0x4ee00e];return _0x4acec2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcaf4('0x0'));var zipdir=require(_0xcaf4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcaf4('0x2'));var moment=require(_0xcaf4('0x3'));var BPromise=require(_0xcaf4('0x4'));var Mustache=require('mustache');var util=require(_0xcaf4('0x5'));var path=require(_0xcaf4('0x6'));var sox=require(_0xcaf4('0x7'));var csv=require('to-csv');var ejs=require(_0xcaf4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaf4('0x9'));var squel=require(_0xcaf4('0xa'));var crypto=require(_0xcaf4('0xb'));var jsforce=require(_0xcaf4('0xc'));var deskjs=require(_0xcaf4('0xd'));var toCsv=require(_0xcaf4('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcaf4('0xf'));var authService=require(_0xcaf4('0x10'));var qs=require(_0xcaf4('0x11'));var as=require(_0xcaf4('0x12'));var hardwareService=require(_0xcaf4('0x13'));var logger=require(_0xcaf4('0x14'))(_0xcaf4('0x15'));var utils=require(_0xcaf4('0x16'));var config=require(_0xcaf4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcaf4('0x18'))['db'];function respondWithStatusCode(_0x41486c,_0x4d270c){_0x4d270c=_0x4d270c||0xcc;return function(_0x308173){if(_0x308173){return _0x41486c[_0xcaf4('0x19')](_0x4d270c);}return _0x41486c[_0xcaf4('0x1a')](_0x4d270c)['end']();};}function respondWithResult(_0x3738b7,_0x2ad48b){_0x2ad48b=_0x2ad48b||0xc8;return function(_0x593c44){if(_0x593c44){return _0x3738b7[_0xcaf4('0x1a')](_0x2ad48b)['json'](_0x593c44);}};}function respondWithFilteredResult(_0x2a1243,_0x191f38){return function(_0x67532a){if(_0x67532a){var _0x1ec93e=typeof _0x191f38[_0xcaf4('0x1b')]===_0xcaf4('0x1c')&&typeof _0x191f38['limit']===_0xcaf4('0x1c');var _0x488bac=_0x67532a[_0xcaf4('0x1d')];var _0x5bb3b5=_0x1ec93e?0x0:_0x191f38[_0xcaf4('0x1b')];var _0x36c34c=_0x1ec93e?_0x67532a[_0xcaf4('0x1d')]:_0x191f38['offset']+_0x191f38['limit'];var _0x1ddae3;if(_0x36c34c>=_0x488bac){_0x36c34c=_0x488bac;_0x1ddae3=0xc8;}else{_0x1ddae3=0xce;}_0x2a1243[_0xcaf4('0x1a')](_0x1ddae3);return _0x2a1243[_0xcaf4('0x1e')](_0xcaf4('0x1f'),_0x5bb3b5+'-'+_0x36c34c+'/'+_0x488bac)[_0xcaf4('0x20')](_0x67532a);}return null;};}function patchUpdates(_0x596997){return function(_0x42d129){try{jsonpatch[_0xcaf4('0x21')](_0x42d129,_0x596997,!![]);}catch(_0x3f6172){return BPromise['reject'](_0x3f6172);}return _0x42d129[_0xcaf4('0x22')]();};}function saveUpdates(_0x2b500b,_0x39ff5d){return function(_0x5b6525){if(_0x5b6525){return _0x5b6525[_0xcaf4('0x23')](_0x2b500b)['then'](function(_0x2be740){return _0x2be740;});}return null;};}function removeEntity(_0x3fb28a,_0x1d9f77){return function(_0x5e4af3){if(_0x5e4af3){return _0x5e4af3[_0xcaf4('0x24')]()[_0xcaf4('0x25')](function(){var _0x116349=_0x5e4af3[_0xcaf4('0x26')]({'plain':!![]});var _0x4c3485=_0xcaf4('0x27');return db[_0xcaf4('0x28')]['destroy']({'where':{'type':_0x4c3485,'resourceId':_0x116349['id']}})[_0xcaf4('0x25')](function(){return _0x5e4af3;});})[_0xcaf4('0x25')](function(){_0x3fb28a[_0xcaf4('0x1a')](0xcc)[_0xcaf4('0x29')]();});}};}function handleEntityNotFound(_0x25beed,_0x1dbe80){return function(_0x10765c){if(!_0x10765c){_0x25beed['sendStatus'](0x194);}return _0x10765c;};}function handleError(_0x4183e2,_0x16b3b8){_0x16b3b8=_0x16b3b8||0x1f4;return function(_0x237077){logger['error'](_0x237077[_0xcaf4('0x2a')]);if(_0x237077[_0xcaf4('0x2b')]){delete _0x237077[_0xcaf4('0x2b')];}_0x4183e2[_0xcaf4('0x1a')](_0x16b3b8)[_0xcaf4('0x2c')](_0x237077);};}exports[_0xcaf4('0x2d')]=function(_0x31322d,_0x52ee2a){var _0x8126a7={},_0x5c355e={},_0x5af341={'count':0x0,'rows':[]};var _0x6f6cae=_['map'](db[_0xcaf4('0x2e')]['rawAttributes'],function(_0xf616c7){return{'name':_0xf616c7['fieldName'],'type':_0xf616c7[_0xcaf4('0x2f')][_0xcaf4('0x30')]};});_0x5c355e[_0xcaf4('0x31')]=_[_0xcaf4('0x32')](_0x6f6cae,_0xcaf4('0x2b'));_0x5c355e[_0xcaf4('0x33')]=_[_0xcaf4('0x34')](_0x31322d[_0xcaf4('0x33')]);_0x5c355e['filters']=_[_0xcaf4('0x35')](_0x5c355e[_0xcaf4('0x31')],_0x5c355e[_0xcaf4('0x33')]);_0x8126a7[_0xcaf4('0x36')]=_[_0xcaf4('0x35')](_0x5c355e['model'],qs['fields'](_0x31322d['query']['fields']));_0x8126a7['attributes']=_0x8126a7[_0xcaf4('0x36')][_0xcaf4('0x37')]?_0x8126a7[_0xcaf4('0x36')]:_0x5c355e['model'];if(!_0x31322d[_0xcaf4('0x33')][_0xcaf4('0x38')](_0xcaf4('0x39'))){_0x8126a7[_0xcaf4('0x3a')]=qs['limit'](_0x31322d['query']['limit']);_0x8126a7['offset']=qs['offset'](_0x31322d[_0xcaf4('0x33')][_0xcaf4('0x1b')]);}_0x8126a7['order']=qs[_0xcaf4('0x3b')](_0x31322d[_0xcaf4('0x33')]['sort']);_0x8126a7[_0xcaf4('0x3c')]=qs[_0xcaf4('0x3d')](_[_0xcaf4('0x3e')](_0x31322d['query'],_0x5c355e['filters']),_0x6f6cae);if(_0x31322d[_0xcaf4('0x33')][_0xcaf4('0x3f')]){_0x8126a7[_0xcaf4('0x3c')]=_[_0xcaf4('0x40')](_0x8126a7['where'],{'$or':_[_0xcaf4('0x32')](_0x6f6cae,function(_0x23c725){if(_0x23c725[_0xcaf4('0x2f')]!=='VIRTUAL'){var _0x3c4d63={};_0x3c4d63[_0x23c725[_0xcaf4('0x2b')]]={'$like':'%'+_0x31322d[_0xcaf4('0x33')][_0xcaf4('0x3f')]+'%'};return _0x3c4d63;}})});}_0x8126a7=_[_0xcaf4('0x40')]({},_0x8126a7,_0x31322d[_0xcaf4('0x41')]);var _0x4dccd1={'where':_0x8126a7['where']};return db[_0xcaf4('0x2e')][_0xcaf4('0x1d')](_0x4dccd1)['then'](function(_0xda0fde){_0x5af341[_0xcaf4('0x1d')]=_0xda0fde;if(_0x31322d[_0xcaf4('0x33')][_0xcaf4('0x42')]){_0x8126a7[_0xcaf4('0x43')]=[{'all':!![]}];}return db['JscriptyProject'][_0xcaf4('0x44')](_0x8126a7);})[_0xcaf4('0x25')](function(_0x340566){_0x5af341[_0xcaf4('0x45')]=_0x340566;return _0x5af341;})[_0xcaf4('0x25')](respondWithFilteredResult(_0x52ee2a,_0x8126a7))['catch'](handleError(_0x52ee2a,null));};exports[_0xcaf4('0x46')]=function(_0x35962e,_0x26c963){var _0x5bc6e2={'raw':![],'where':{'id':_0x35962e[_0xcaf4('0x47')]['id']}},_0x34d8ea={};_0x34d8ea['model']=_[_0xcaf4('0x34')](db[_0xcaf4('0x2e')][_0xcaf4('0x48')]);_0x34d8ea['query']=_[_0xcaf4('0x34')](_0x35962e[_0xcaf4('0x33')]);_0x34d8ea[_0xcaf4('0x3d')]=_[_0xcaf4('0x35')](_0x34d8ea[_0xcaf4('0x31')],_0x34d8ea[_0xcaf4('0x33')]);_0x5bc6e2[_0xcaf4('0x36')]=_['intersection'](_0x34d8ea[_0xcaf4('0x31')],qs[_0xcaf4('0x49')](_0x35962e[_0xcaf4('0x33')][_0xcaf4('0x49')]));_0x5bc6e2[_0xcaf4('0x36')]=_0x5bc6e2[_0xcaf4('0x36')][_0xcaf4('0x37')]?_0x5bc6e2[_0xcaf4('0x36')]:_0x34d8ea[_0xcaf4('0x31')];if(_0x35962e['query']['includeAll']){_0x5bc6e2[_0xcaf4('0x43')]=[{'all':!![]}];}_0x5bc6e2=_[_0xcaf4('0x40')]({},_0x5bc6e2,_0x35962e[_0xcaf4('0x41')]);return db[_0xcaf4('0x2e')]['find'](_0x5bc6e2)['then'](handleEntityNotFound(_0x26c963,null))[_0xcaf4('0x25')](respondWithResult(_0x26c963,null))[_0xcaf4('0x4a')](handleError(_0x26c963,null));};exports['create']=function(_0x179d26,_0x37a2ba){return db[_0xcaf4('0x2e')][_0xcaf4('0x4b')](_0x179d26[_0xcaf4('0x4c')],{})[_0xcaf4('0x25')](function(_0x6efd8d){var _0x3f32a5=_0x179d26['user']['get']({'plain':!![]});if(!_0x3f32a5)throw new Error(_0xcaf4('0x4d'));if(_0x3f32a5[_0xcaf4('0x4e')]===_0xcaf4('0x4f')){var _0x4f2e01=_0x6efd8d[_0xcaf4('0x26')]({'plain':!![]});var _0x2d35be='Projects';return db[_0xcaf4('0x50')][_0xcaf4('0x51')]({'where':{'name':_0x2d35be,'userProfileId':_0x3f32a5[_0xcaf4('0x52')]},'raw':!![]})[_0xcaf4('0x25')](function(_0x403922){if(_0x403922&&_0x403922[_0xcaf4('0x53')]===0x0){return db['UserProfileResource'][_0xcaf4('0x4b')]({'name':_0x4f2e01[_0xcaf4('0x2b')],'resourceId':_0x4f2e01['id'],'type':_0x403922['name'],'sectionId':_0x403922['id']},{})[_0xcaf4('0x25')](function(){return _0x6efd8d;});}else{return _0x6efd8d;}})['catch'](function(_0x51c928){logger['error'](_0xcaf4('0x54'),_0x51c928);throw _0x51c928;});}return _0x6efd8d;})[_0xcaf4('0x25')](respondWithResult(_0x37a2ba,0xc9))[_0xcaf4('0x4a')](handleError(_0x37a2ba,null));};exports[_0xcaf4('0x55')]=function(_0x35de1f,_0x2b1ee7){var _0x5d5b92={'where':{'id':_0x35de1f[_0xcaf4('0x47')]['id']}},_0x561864={};_0x561864[_0xcaf4('0x31')]=_['keys'](db[_0xcaf4('0x2e')][_0xcaf4('0x48')]);_0x5d5b92[_0xcaf4('0x36')]=_[_0xcaf4('0x35')](_0x561864[_0xcaf4('0x31')],qs[_0xcaf4('0x49')](_0x35de1f['query'][_0xcaf4('0x49')]));_0x5d5b92['attributes']=_0x5d5b92['attributes'][_0xcaf4('0x37')]?_0x5d5b92['attributes']:_0x561864[_0xcaf4('0x31')];if(_0x35de1f['query'][_0xcaf4('0x42')]){_0x5d5b92[_0xcaf4('0x43')]=[{'all':!![]}];}_0x5d5b92=_[_0xcaf4('0x40')]({},_0x5d5b92,_0x35de1f['options']);return db[_0xcaf4('0x2e')][_0xcaf4('0x51')](_0x5d5b92)[_0xcaf4('0x25')](handleEntityNotFound(_0x2b1ee7,null))[_0xcaf4('0x25')](function(_0x3ead01){if(_0x3ead01){var _0xae6cbc=_0x3ead01[_0xcaf4('0x26')]({'plain':!![]});_0xae6cbc=qs[_0xcaf4('0x56')](_0xae6cbc,['id',_0xcaf4('0x57'),'updatedAt']);_0x35de1f[_0xcaf4('0x4c')]=_['omit'](_0x35de1f[_0xcaf4('0x4c')],['id',_0xcaf4('0x57'),_0xcaf4('0x58')]);return db[_0xcaf4('0x2e')][_0xcaf4('0x4b')](_[_0xcaf4('0x40')](_0xae6cbc,_0x35de1f[_0xcaf4('0x4c')]),{'include':_0x35de1f[_0xcaf4('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0xcaf4('0x25')](function(_0x20448){var _0xb26e05=_0x35de1f[_0xcaf4('0x4f')][_0xcaf4('0x26')]({'plain':!![]});if(!_0xb26e05)throw new Error(_0xcaf4('0x4d'));if(_0xb26e05[_0xcaf4('0x4e')]===_0xcaf4('0x4f')){var _0x568e8c=_0x20448[_0xcaf4('0x26')]({'plain':!![]});var _0x386f09=_0xcaf4('0x27');return db[_0xcaf4('0x50')][_0xcaf4('0x51')]({'where':{'name':_0x386f09,'userProfileId':_0xb26e05[_0xcaf4('0x52')]},'raw':!![]})[_0xcaf4('0x25')](function(_0x2449d8){if(_0x2449d8&&_0x2449d8[_0xcaf4('0x53')]===0x0){return db[_0xcaf4('0x28')][_0xcaf4('0x4b')]({'name':_0x568e8c[_0xcaf4('0x2b')],'resourceId':_0x568e8c['id'],'type':_0x2449d8['name'],'sectionId':_0x2449d8['id']},{})[_0xcaf4('0x25')](function(){return _0x20448;});}else{return _0x20448;}})[_0xcaf4('0x4a')](function(_0x1b000b){logger[_0xcaf4('0x59')](_0xcaf4('0x54'),_0x1b000b);throw _0x1b000b;});}return _0x20448;});}})['then'](respondWithResult(_0x2b1ee7,0xc9))[_0xcaf4('0x4a')](handleError(_0x2b1ee7,null));};exports[_0xcaf4('0x23')]=function(_0x429b7a,_0x1a6f19){if(_0x429b7a[_0xcaf4('0x4c')]['id']){delete _0x429b7a['body']['id'];}return db['JscriptyProject'][_0xcaf4('0x51')]({'where':{'id':_0x429b7a[_0xcaf4('0x47')]['id']}})[_0xcaf4('0x25')](handleEntityNotFound(_0x1a6f19,null))['then'](saveUpdates(_0x429b7a[_0xcaf4('0x4c')],null))[_0xcaf4('0x25')](respondWithResult(_0x1a6f19,null))['catch'](handleError(_0x1a6f19,null));};exports[_0xcaf4('0x24')]=function(_0x4b50e0,_0x3e6417){return db['JscriptyProject'][_0xcaf4('0x51')]({'where':{'id':_0x4b50e0[_0xcaf4('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e6417,null))[_0xcaf4('0x25')](removeEntity(_0x3e6417,null))['catch'](handleError(_0x3e6417,null));};exports[_0xcaf4('0x5a')]=function(_0x29eede,_0x23cac1,_0x5483e0){var _0x43a6a8={'raw':!![],'where':{}};var _0x492310={};var _0x435b23={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x29eede['params']['id']}})[_0xcaf4('0x25')](handleEntityNotFound(_0x23cac1,null))[_0xcaf4('0x25')](function(_0x3c00b1){if(_0x3c00b1){_0x492310['model']=_[_0xcaf4('0x34')](db[_0xcaf4('0x5b')][_0xcaf4('0x48')]);_0x492310[_0xcaf4('0x33')]=_[_0xcaf4('0x34')](_0x29eede['query']);_0x492310['filters']=_[_0xcaf4('0x35')](_0x492310[_0xcaf4('0x31')],_0x492310[_0xcaf4('0x33')]);_0x43a6a8[_0xcaf4('0x36')]=_['intersection'](_0x492310[_0xcaf4('0x31')],qs[_0xcaf4('0x49')](_0x29eede[_0xcaf4('0x33')][_0xcaf4('0x49')]));_0x43a6a8[_0xcaf4('0x36')]=_0x43a6a8['attributes'][_0xcaf4('0x37')]?_0x43a6a8[_0xcaf4('0x36')]:_0x492310['model'];if(!_0x29eede[_0xcaf4('0x33')]['hasOwnProperty']('nolimit')){_0x43a6a8[_0xcaf4('0x3a')]=qs[_0xcaf4('0x3a')](_0x29eede[_0xcaf4('0x33')][_0xcaf4('0x3a')]);_0x43a6a8[_0xcaf4('0x1b')]=qs[_0xcaf4('0x1b')](_0x29eede[_0xcaf4('0x33')][_0xcaf4('0x1b')]);}_0x43a6a8[_0xcaf4('0x5c')]=qs['sort'](_0x29eede[_0xcaf4('0x33')][_0xcaf4('0x3b')]);_0x43a6a8['where']=qs[_0xcaf4('0x3d')](_[_0xcaf4('0x3e')](_0x29eede[_0xcaf4('0x33')],_0x492310[_0xcaf4('0x3d')]));_0x43a6a8[_0xcaf4('0x3c')][_0xcaf4('0x5d')]=_0x3c00b1['id'];if(_0x29eede['query'][_0xcaf4('0x3f')]){_0x43a6a8[_0xcaf4('0x3c')]=_[_0xcaf4('0x40')](_0x43a6a8[_0xcaf4('0x3c')],{'$or':_['map'](_0x43a6a8['attributes'],function(_0x418b8f){var _0x3c0a35={};_0x3c0a35[_0x418b8f]={'$like':'%'+_0x29eede[_0xcaf4('0x33')][_0xcaf4('0x3f')]+'%'};return _0x3c0a35;})});}_0x43a6a8=_[_0xcaf4('0x40')]({},_0x43a6a8,_0x29eede['options']);return db[_0xcaf4('0x5b')]['count']({'where':_0x43a6a8[_0xcaf4('0x3c')]})[_0xcaf4('0x25')](function(_0x207eb0){_0x435b23['count']=_0x207eb0;if(_0x29eede[_0xcaf4('0x33')][_0xcaf4('0x42')]){_0x43a6a8[_0xcaf4('0x43')]=[{'all':!![]}];}return db[_0xcaf4('0x5b')][_0xcaf4('0x44')](_0x43a6a8);})[_0xcaf4('0x25')](function(_0xe0196f){_0x435b23[_0xcaf4('0x45')]=_0xe0196f;return _0x435b23;});}})[_0xcaf4('0x25')](respondWithFilteredResult(_0x23cac1,_0x43a6a8))[_0xcaf4('0x4a')](handleError(_0x23cac1,null));};exports[_0xcaf4('0x5e')]=function(_0x2cc17d,_0x46f320,_0x59d266){var _0x149e4a={'raw':!![],'where':{}};var _0x1ecdb6={};var _0x4d7668={'count':0x0,'rows':[]};return db[_0xcaf4('0x2e')][_0xcaf4('0x5f')]({'where':{'id':_0x2cc17d['params']['id']}})['then'](handleEntityNotFound(_0x46f320,null))[_0xcaf4('0x25')](function(_0x21644f){if(_0x21644f){_0x1ecdb6[_0xcaf4('0x31')]=_['keys'](db[_0xcaf4('0x60')][_0xcaf4('0x48')]);_0x1ecdb6[_0xcaf4('0x33')]=_[_0xcaf4('0x34')](_0x2cc17d[_0xcaf4('0x33')]);_0x1ecdb6[_0xcaf4('0x3d')]=_[_0xcaf4('0x35')](_0x1ecdb6[_0xcaf4('0x31')],_0x1ecdb6[_0xcaf4('0x33')]);_0x149e4a[_0xcaf4('0x36')]=_[_0xcaf4('0x35')](_0x1ecdb6[_0xcaf4('0x31')],qs['fields'](_0x2cc17d[_0xcaf4('0x33')][_0xcaf4('0x49')]));_0x149e4a[_0xcaf4('0x36')]=_0x149e4a[_0xcaf4('0x36')][_0xcaf4('0x37')]?_0x149e4a[_0xcaf4('0x36')]:_0x1ecdb6[_0xcaf4('0x31')];if(!_0x2cc17d[_0xcaf4('0x33')][_0xcaf4('0x38')](_0xcaf4('0x39'))){_0x149e4a[_0xcaf4('0x3a')]=qs[_0xcaf4('0x3a')](_0x2cc17d[_0xcaf4('0x33')][_0xcaf4('0x3a')]);_0x149e4a[_0xcaf4('0x1b')]=qs[_0xcaf4('0x1b')](_0x2cc17d['query']['offset']);}_0x149e4a['order']=qs[_0xcaf4('0x3b')](_0x2cc17d['query'][_0xcaf4('0x3b')]);_0x149e4a['where']=qs[_0xcaf4('0x3d')](_[_0xcaf4('0x3e')](_0x2cc17d[_0xcaf4('0x33')],_0x1ecdb6['filters']));_0x149e4a[_0xcaf4('0x3c')][_0xcaf4('0x5d')]=_0x21644f['id'];if(_0x2cc17d[_0xcaf4('0x33')][_0xcaf4('0x3f')]){_0x149e4a['where']=_[_0xcaf4('0x40')](_0x149e4a[_0xcaf4('0x3c')],{'$or':_[_0xcaf4('0x32')](_0x149e4a[_0xcaf4('0x36')],function(_0x55dbdd){var _0x3cf7ea={};_0x3cf7ea[_0x55dbdd]={'$like':'%'+_0x2cc17d['query'][_0xcaf4('0x3f')]+'%'};return _0x3cf7ea;})});}_0x149e4a=_['merge']({},_0x149e4a,_0x2cc17d[_0xcaf4('0x41')]);return db[_0xcaf4('0x60')][_0xcaf4('0x1d')]({'where':_0x149e4a[_0xcaf4('0x3c')]})[_0xcaf4('0x25')](function(_0x176a40){_0x4d7668['count']=_0x176a40;if(_0x2cc17d[_0xcaf4('0x33')][_0xcaf4('0x42')]){_0x149e4a['include']=[{'all':!![]}];}return db[_0xcaf4('0x60')][_0xcaf4('0x44')](_0x149e4a);})[_0xcaf4('0x25')](function(_0x15db07){_0x4d7668[_0xcaf4('0x45')]=_0x15db07;return _0x4d7668;});}})['then'](respondWithFilteredResult(_0x46f320,_0x149e4a))[_0xcaf4('0x4a')](handleError(_0x46f320,null));};function char(_0xa920b3){return _0xcaf4('0x61')===typeof _0xa920b3?String[_0xcaf4('0x62')][_0xcaf4('0x21')](null,arguments):_0xa920b3;}function needsEncapsulation(_0x5b2008){return!!_0x5b2008&&(_0x5b2008[_0xcaf4('0x63')]()[_0xcaf4('0x64')](char(0xd))>=0x0||_0x5b2008[_0xcaf4('0x63')]()['indexOf'](char(0xa))>=0x0||_0x5b2008[_0xcaf4('0x63')]()[_0xcaf4('0x64')](char(0x2c))>=0x0||_0x5b2008[_0xcaf4('0x63')]()[_0xcaf4('0x64')](char(0x22))>=0x0);}function encapsulate(_0x780b78){var _0x482080=char(0x22),_0x31925f='\x5c'+char(0x22),_0x5f82ab=_0x780b78[_0xcaf4('0x63')]()['replace'](new RegExp(_0x482080,'g'),_0x31925f);return _0x482080+_0x5f82ab+_0x482080;}exports[_0xcaf4('0x65')]=function(_0x4c496a,_0x48b51b,_0x1b8e88){var _0x1a903f,_0x13edf0;var _0x2ecf55={'where':{'ProjectId':_0x4c496a[_0xcaf4('0x47')]['id']}};if(_0x4c496a[_0xcaf4('0x33')]['startTime']){_0x2ecf55[_0xcaf4('0x3c')][_0xcaf4('0x66')]=JSON[_0xcaf4('0x67')](_0x4c496a['query'][_0xcaf4('0x68')]);}return db[_0xcaf4('0x5b')][_0xcaf4('0x44')](_0x2ecf55)[_0xcaf4('0x25')](handleEntityNotFound(_0x48b51b,null))[_0xcaf4('0x25')](function(_0x261c8c){if(_0x261c8c){_0x1a903f=_0x261c8c;return db[_0xcaf4('0x69')]['findAll']({'where':{'SessionId':{'$in':_[_0xcaf4('0x32')](_0x1a903f,'id')},'ProjectId':_0x4c496a[_0xcaf4('0x47')]['id']},'order':_0xcaf4('0x6a')});}})[_0xcaf4('0x25')](handleEntityNotFound(_0x48b51b,null))['then'](function(_0xa01db1){if(_0xa01db1){_0x13edf0=_0xa01db1;var _0x39dfcb={};for(var _0x33ac7b=0x0,_0xa68ec3=_0x13edf0['length'];_0x33ac7b<_0xa68ec3;_0x33ac7b++){if(!_0x39dfcb[_0xcaf4('0x38')](_0x13edf0[_0x33ac7b]['questionId'])){_0x39dfcb[_0x13edf0[_0x33ac7b][_0xcaf4('0x6b')]]=needsEncapsulation(_0x13edf0[_0x33ac7b]['question'])?encapsulate(_0x13edf0[_0x33ac7b][_0xcaf4('0x6c')]):_0x13edf0[_0x33ac7b]['question'];}}var _0x3f49c4=[],_0x695bde={};for(var _0x30e4b1=0x0,_0x11b203=_0x1a903f[_0xcaf4('0x37')];_0x30e4b1<_0x11b203;_0x30e4b1++){_0x695bde={'ProjectId':_0x4c496a['params']['id'],'SessionId':_0x1a903f[_0x30e4b1]['id'],'StartTime':moment(_0x1a903f[_0x30e4b1][_0xcaf4('0x66')])[_0xcaf4('0x6d')](_0xcaf4('0x6e'))};for(var _0x2fcec0=0x0,_0x565fcf=_0x13edf0[_0xcaf4('0x37')];_0x2fcec0<_0x565fcf;_0x2fcec0++){if(_0x13edf0[_0x2fcec0][_0xcaf4('0x6f')]==_0x1a903f[_0x30e4b1]['id']&&_0x39dfcb[_0xcaf4('0x38')](_0x13edf0[_0x2fcec0][_0xcaf4('0x6b')])){_0x695bde[_0x39dfcb[_0x13edf0[_0x2fcec0]['questionId']]]=_0x13edf0[_0x2fcec0][_0xcaf4('0x70')];}}for(var _0x4edae1 in _0x39dfcb){if(!_0x695bde[_0xcaf4('0x38')](_0x39dfcb[_0x4edae1])){_0x695bde[_0x39dfcb[_0x4edae1]]=null;}}_0x3f49c4[_0xcaf4('0x71')](_0x695bde);}return _0x3f49c4;}})[_0xcaf4('0x25')](function(_0x128116){if(!_['isEmpty'](_0x128116)){var _0x1c50ed=toCsv(_0x128116);var _0x181936=Date[_0xcaf4('0x72')]();fs[_0xcaf4('0x73')](util[_0xcaf4('0x6d')](_0xcaf4('0x74'),_0x4c496a['params']['id'],_0x181936),_0x1c50ed);_0x48b51b[_0xcaf4('0x75')](_0xcaf4('0x76'),_0xcaf4('0x77')+util[_0xcaf4('0x6d')](_0xcaf4('0x78'),_0x4c496a['params']['id'],_0x181936));_0x48b51b[_0xcaf4('0x75')]('Content-type',_0xcaf4('0x79'));return _0x48b51b['download'](util[_0xcaf4('0x6d')](_0xcaf4('0x74'),_0x4c496a[_0xcaf4('0x47')]['id'],_0x181936));}else{return _0x48b51b['sendStatus'](0xcc);}})['catch'](handleError(_0x48b51b,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index cdb9dc5..956ee1e 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 _0xac0a=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','../../config/logger','api'];(function(_0x148ccb,_0x251799){var _0x15e08a=function(_0x3e209d){while(--_0x3e209d){_0x148ccb['push'](_0x148ccb['shift']());}};_0x15e08a(++_0x251799);}(_0xac0a,0x11e));var _0xaac0=function(_0x39761b,_0x32982c){_0x39761b=_0x39761b-0x0;var _0x4429e9=_0xac0a[_0x39761b];return _0x4429e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaac0('0x0'))(_0xaac0('0x1'));var moment=require('moment');var BPromise=require(_0xaac0('0x2'));var rp=require(_0xaac0('0x3'));var fs=require('fs');var path=require(_0xaac0('0x4'));var rimraf=require(_0xaac0('0x5'));var config=require(_0xaac0('0x6'));var attributes=require(_0xaac0('0x7'));module[_0xaac0('0x8')]=function(_0x1c92d1,_0x2cefc3){return _0x1c92d1[_0xaac0('0x9')](_0xaac0('0xa'),attributes,{'tableName':_0xaac0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab3f=['JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define'];(function(_0x40318c,_0x2ac42f){var _0x5783b8=function(_0x2f95f0){while(--_0x2f95f0){_0x40318c['push'](_0x40318c['shift']());}};_0x5783b8(++_0x2ac42f);}(_0xab3f,0x72));var _0xfab3=function(_0x47e904,_0x5d809c){_0x47e904=_0x47e904-0x0;var _0x4df208=_0xab3f[_0x47e904];return _0x4df208;};'use strict';var _=require(_0xfab3('0x0'));var util=require('util');var logger=require(_0xfab3('0x1'))(_0xfab3('0x2'));var moment=require(_0xfab3('0x3'));var BPromise=require(_0xfab3('0x4'));var rp=require(_0xfab3('0x5'));var fs=require('fs');var path=require(_0xfab3('0x6'));var rimraf=require(_0xfab3('0x7'));var config=require(_0xfab3('0x8'));var attributes=require(_0xfab3('0x9'));module[_0xfab3('0xa')]=function(_0x2daeb4,_0x5ed108){return _0x2daeb4[_0xfab3('0xb')](_0xfab3('0xc'),attributes,{'tableName':_0xfab3('0xd'),'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 87571c4..9fa1355 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 _0xa9e0=['http','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\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(_0x34cd72,_0x2e18aa){var _0x1bb902=function(_0x305d97){while(--_0x305d97){_0x34cd72['push'](_0x34cd72['shift']());}};_0x1bb902(++_0x2e18aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0xf3120,_0x80a54c){var _0x5aa549=function(_0x17ba5b){while(--_0x17ba5b){_0xf3120['push'](_0xf3120['shift']());}};_0x5aa549(++_0x80a54c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5a2022,_0x26b336){_0x5a2022=_0x5a2022-0x0;var _0x206727=_0xf4eb[_0x5a2022];return _0x206727;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 65aed3a..8a90d6c 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 _0x4c8e=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./jscriptyQuestionReport.controller','get'];(function(_0x56c394,_0x5e9757){var _0x1eeb36=function(_0x302142){while(--_0x302142){_0x56c394['push'](_0x56c394['shift']());}};_0x1eeb36(++_0x5e9757);}(_0x4c8e,0x14d));var _0xe4c8=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x4c8e[_0x311909];return _0x8d3163;};'use strict';var multer=require(_0xe4c8('0x0'));var util=require(_0xe4c8('0x1'));var path=require(_0xe4c8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe4c8('0x3'));var router=express[_0xe4c8('0x4')]();var fs_extra=require(_0xe4c8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4c8('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c8('0x7'));router[_0xe4c8('0x8')]('/',auth[_0xe4c8('0x9')](),controller[_0xe4c8('0xa')]);router['get'](_0xe4c8('0xb'),auth[_0xe4c8('0x9')](),controller[_0xe4c8('0xc')]);router[_0xe4c8('0x8')](_0xe4c8('0xd'),auth[_0xe4c8('0x9')](),controller[_0xe4c8('0xe')]);router[_0xe4c8('0xf')]('/',auth[_0xe4c8('0x9')](),controller['create']);router[_0xe4c8('0x10')](_0xe4c8('0xd'),auth[_0xe4c8('0x9')](),controller[_0xe4c8('0x11')]);router['delete'](_0xe4c8('0xd'),auth['isAuthenticated'](),controller[_0xe4c8('0x12')]);module['exports']=router; \ No newline at end of file +var _0x22cc=['get','isAuthenticated','index','describe','show','put','update','delete','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x22cc,0x90));var _0xc22c=function(_0x5c5c52,_0x36d085){_0x5c5c52=_0x5c5c52-0x0;var _0x4229ff=_0x22cc[_0x5c5c52];return _0x4229ff;};'use strict';var multer=require('multer');var util=require(_0xc22c('0x0'));var path=require('path');var timeout=require(_0xc22c('0x1'));var express=require(_0xc22c('0x2'));var router=express[_0xc22c('0x3')]();var fs_extra=require(_0xc22c('0x4'));var auth=require(_0xc22c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc22c('0x6'));var controller=require(_0xc22c('0x7'));router[_0xc22c('0x8')]('/',auth[_0xc22c('0x9')](),controller[_0xc22c('0xa')]);router[_0xc22c('0x8')]('/describe',auth[_0xc22c('0x9')](),controller[_0xc22c('0xb')]);router[_0xc22c('0x8')]('/:id',auth[_0xc22c('0x9')](),controller[_0xc22c('0xc')]);router['post']('/',auth[_0xc22c('0x9')](),controller['create']);router[_0xc22c('0xd')]('/:id',auth[_0xc22c('0x9')](),controller[_0xc22c('0xe')]);router[_0xc22c('0xf')](_0xc22c('0x10'),auth['isAuthenticated'](),controller[_0xc22c('0x11')]);module[_0xc22c('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9048ab7..f4f21c4 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(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x7a54,0x106));var _0x47a5=function(_0x21c4f6,_0x41c728){_0x21c4f6=_0x21c4f6-0x0;var _0x796aee=_0x7a54[_0x21c4f6];return _0x796aee;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7a54,0x106));var _0x47a5=function(_0x58febc,_0x22eec4){_0x58febc=_0x58febc-0x0;var _0x33ff24=_0x7a54[_0x58febc];return _0x33ff24;};'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 72a08e7..e7f0ef0 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 _0x809a=['length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','include','findAll','show','params','rawAttributes','keys','includeAll','merge','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','index','map','JscriptyQuestionReport','type','query','intersection','attributes','model','fields'];(function(_0x1af66e,_0xbb55bb){var _0x193670=function(_0x2c05f2){while(--_0x2c05f2){_0x1af66e['push'](_0x1af66e['shift']());}};_0x193670(++_0xbb55bb);}(_0x809a,0x179));var _0xa809=function(_0x7f9ac4,_0x2302ea){_0x7f9ac4=_0x7f9ac4-0x0;var _0x19b578=_0x809a[_0x7f9ac4];return _0x19b578;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa809('0x0'));var zipdir=require(_0xa809('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa809('0x2'));var moment=require(_0xa809('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa809('0x4'));var util=require(_0xa809('0x5'));var path=require(_0xa809('0x6'));var sox=require(_0xa809('0x7'));var csv=require(_0xa809('0x8'));var ejs=require(_0xa809('0x9'));var fs=require('fs');var fs_extra=require(_0xa809('0xa'));var _=require(_0xa809('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa809('0xc'));var toCsv=require(_0xa809('0x8'));var querystring=require('querystring');var Papa=require(_0xa809('0xd'));var Redis=require('ioredis');var authService=require(_0xa809('0xe'));var qs=require(_0xa809('0xf'));var as=require(_0xa809('0x10'));var hardwareService=require(_0xa809('0x11'));var logger=require(_0xa809('0x12'))(_0xa809('0x13'));var utils=require(_0xa809('0x14'));var config=require(_0xa809('0x15'));var licenseUtil=require(_0xa809('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4749f3,_0x487d77){_0x487d77=_0x487d77||0xcc;return function(_0x3e8233){if(_0x3e8233){return _0x4749f3[_0xa809('0x17')](_0x487d77);}return _0x4749f3['status'](_0x487d77)['end']();};}function respondWithResult(_0x520844,_0x4a3c2c){_0x4a3c2c=_0x4a3c2c||0xc8;return function(_0x3ce147){if(_0x3ce147){return _0x520844[_0xa809('0x18')](_0x4a3c2c)[_0xa809('0x19')](_0x3ce147);}};}function respondWithFilteredResult(_0x28a5ec,_0x5cffcf){return function(_0x56e552){if(_0x56e552){var _0x115eb9=typeof _0x5cffcf['offset']===_0xa809('0x1a')&&typeof _0x5cffcf[_0xa809('0x1b')]==='undefined';var _0x2473a8=_0x56e552[_0xa809('0x1c')];var _0x17ea7e=_0x115eb9?0x0:_0x5cffcf[_0xa809('0x1d')];var _0x24f25c=_0x115eb9?_0x56e552['count']:_0x5cffcf['offset']+_0x5cffcf['limit'];var _0x402df2;if(_0x24f25c>=_0x2473a8){_0x24f25c=_0x2473a8;_0x402df2=0xc8;}else{_0x402df2=0xce;}_0x28a5ec[_0xa809('0x18')](_0x402df2);return _0x28a5ec['set'](_0xa809('0x1e'),_0x17ea7e+'-'+_0x24f25c+'/'+_0x2473a8)[_0xa809('0x19')](_0x56e552);}return null;};}function patchUpdates(_0x42f268){return function(_0x5ad1b2){try{jsonpatch[_0xa809('0x1f')](_0x5ad1b2,_0x42f268,!![]);}catch(_0x412b6c){return BPromise[_0xa809('0x20')](_0x412b6c);}return _0x5ad1b2[_0xa809('0x21')]();};}function saveUpdates(_0x13b67c,_0x5da85c){return function(_0x3b135a){if(_0x3b135a){return _0x3b135a['update'](_0x13b67c)['then'](function(_0x228d1c){return _0x228d1c;});}return null;};}function removeEntity(_0x5939f5,_0x270fb0){return function(_0x11089d){if(_0x11089d){return _0x11089d[_0xa809('0x22')]()[_0xa809('0x23')](function(){_0x5939f5[_0xa809('0x18')](0xcc)[_0xa809('0x24')]();});}};}function handleEntityNotFound(_0x12c2eb,_0x5941f8){return function(_0x38253e){if(!_0x38253e){_0x12c2eb['sendStatus'](0x194);}return _0x38253e;};}function handleError(_0x3207d8,_0x4addfe){_0x4addfe=_0x4addfe||0x1f4;return function(_0x3edf8e){logger[_0xa809('0x25')](_0x3edf8e[_0xa809('0x26')]);if(_0x3edf8e[_0xa809('0x27')]){delete _0x3edf8e['name'];}_0x3207d8[_0xa809('0x18')](_0x4addfe)['send'](_0x3edf8e);};}exports[_0xa809('0x28')]=function(_0x682d45,_0x37e7ca){var _0x518a8e={},_0x217f0b={},_0x12dc80={'count':0x0,'rows':[]};var _0x59914f=_[_0xa809('0x29')](db[_0xa809('0x2a')]['rawAttributes'],function(_0x11938f){return{'name':_0x11938f['fieldName'],'type':_0x11938f[_0xa809('0x2b')]['key']};});_0x217f0b['model']=_[_0xa809('0x29')](_0x59914f,_0xa809('0x27'));_0x217f0b[_0xa809('0x2c')]=_['keys'](_0x682d45[_0xa809('0x2c')]);_0x217f0b['filters']=_[_0xa809('0x2d')](_0x217f0b['model'],_0x217f0b[_0xa809('0x2c')]);_0x518a8e[_0xa809('0x2e')]=_['intersection'](_0x217f0b[_0xa809('0x2f')],qs[_0xa809('0x30')](_0x682d45[_0xa809('0x2c')][_0xa809('0x30')]));_0x518a8e[_0xa809('0x2e')]=_0x518a8e[_0xa809('0x2e')][_0xa809('0x31')]?_0x518a8e['attributes']:_0x217f0b[_0xa809('0x2f')];if(!_0x682d45[_0xa809('0x2c')][_0xa809('0x32')](_0xa809('0x33'))){_0x518a8e[_0xa809('0x1b')]=qs[_0xa809('0x1b')](_0x682d45[_0xa809('0x2c')][_0xa809('0x1b')]);_0x518a8e['offset']=qs[_0xa809('0x1d')](_0x682d45[_0xa809('0x2c')]['offset']);}_0x518a8e[_0xa809('0x34')]=qs[_0xa809('0x35')](_0x682d45['query'][_0xa809('0x35')]);_0x518a8e[_0xa809('0x36')]=qs[_0xa809('0x37')](_['pick'](_0x682d45[_0xa809('0x2c')],_0x217f0b[_0xa809('0x37')]),_0x59914f);if(_0x682d45[_0xa809('0x2c')][_0xa809('0x38')]){_0x518a8e[_0xa809('0x36')]=_['merge'](_0x518a8e[_0xa809('0x36')],{'$or':_[_0xa809('0x29')](_0x59914f,function(_0x6d5c68){if(_0x6d5c68[_0xa809('0x2b')]!=='VIRTUAL'){var _0x1b7366={};_0x1b7366[_0x6d5c68[_0xa809('0x27')]]={'$like':'%'+_0x682d45[_0xa809('0x2c')][_0xa809('0x38')]+'%'};return _0x1b7366;}})});}_0x518a8e=_['merge']({},_0x518a8e,_0x682d45[_0xa809('0x39')]);var _0x40da18={'where':_0x518a8e[_0xa809('0x36')]};return db[_0xa809('0x2a')][_0xa809('0x1c')](_0x40da18)[_0xa809('0x23')](function(_0x1d3be3){_0x12dc80[_0xa809('0x1c')]=_0x1d3be3;if(_0x682d45['query']['includeAll']){_0x518a8e[_0xa809('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xa809('0x3b')](_0x518a8e);})[_0xa809('0x23')](function(_0x70408a){_0x12dc80['rows']=_0x70408a;return _0x12dc80;})[_0xa809('0x23')](respondWithFilteredResult(_0x37e7ca,_0x518a8e))['catch'](handleError(_0x37e7ca,null));};exports[_0xa809('0x3c')]=function(_0x2c471e,_0x1f4eba){var _0x2fdac3={'raw':!![],'where':{'id':_0x2c471e[_0xa809('0x3d')]['id']}},_0x4f5c1f={};_0x4f5c1f[_0xa809('0x2f')]=_['keys'](db[_0xa809('0x2a')][_0xa809('0x3e')]);_0x4f5c1f['query']=_[_0xa809('0x3f')](_0x2c471e[_0xa809('0x2c')]);_0x4f5c1f[_0xa809('0x37')]=_['intersection'](_0x4f5c1f[_0xa809('0x2f')],_0x4f5c1f[_0xa809('0x2c')]);_0x2fdac3[_0xa809('0x2e')]=_[_0xa809('0x2d')](_0x4f5c1f[_0xa809('0x2f')],qs[_0xa809('0x30')](_0x2c471e[_0xa809('0x2c')][_0xa809('0x30')]));_0x2fdac3[_0xa809('0x2e')]=_0x2fdac3['attributes'][_0xa809('0x31')]?_0x2fdac3[_0xa809('0x2e')]:_0x4f5c1f['model'];if(_0x2c471e[_0xa809('0x2c')][_0xa809('0x40')]){_0x2fdac3[_0xa809('0x3a')]=[{'all':!![]}];}_0x2fdac3=_[_0xa809('0x41')]({},_0x2fdac3,_0x2c471e['options']);return db[_0xa809('0x2a')][_0xa809('0x42')](_0x2fdac3)['then'](handleEntityNotFound(_0x1f4eba,null))['then'](respondWithResult(_0x1f4eba,null))[_0xa809('0x43')](handleError(_0x1f4eba,null));};exports[_0xa809('0x44')]=function(_0x31366b,_0x652776){return db[_0xa809('0x2a')][_0xa809('0x44')](_0x31366b[_0xa809('0x45')],{})['then'](respondWithResult(_0x652776,0xc9))[_0xa809('0x43')](handleError(_0x652776,null));};exports['update']=function(_0x470e5c,_0x419b7d){if(_0x470e5c[_0xa809('0x45')]['id']){delete _0x470e5c[_0xa809('0x45')]['id'];}return db[_0xa809('0x2a')][_0xa809('0x42')]({'where':{'id':_0x470e5c[_0xa809('0x3d')]['id']}})[_0xa809('0x23')](handleEntityNotFound(_0x419b7d,null))[_0xa809('0x23')](saveUpdates(_0x470e5c['body'],null))[_0xa809('0x23')](respondWithResult(_0x419b7d,null))[_0xa809('0x43')](handleError(_0x419b7d,null));};exports[_0xa809('0x22')]=function(_0x29c37a,_0x759ae8){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x29c37a['params']['id']}})[_0xa809('0x23')](handleEntityNotFound(_0x759ae8,null))[_0xa809('0x23')](removeEntity(_0x759ae8,null))[_0xa809('0x43')](handleError(_0x759ae8,null));};exports[_0xa809('0x46')]=function(_0x674c12,_0x27ed4a){return db[_0xa809('0x2a')]['describe']()[_0xa809('0x23')](respondWithResult(_0x27ed4a,null))[_0xa809('0x43')](handleError(_0x27ed4a,null));}; \ No newline at end of file +var _0xd453=['count','set','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit'];(function(_0x38e622,_0x4ceded){var _0x5c8905=function(_0x59bf9e){while(--_0x59bf9e){_0x38e622['push'](_0x38e622['shift']());}};_0x5c8905(++_0x4ceded);}(_0xd453,0xc3));var _0x3d45=function(_0x153738,_0xe704c1){_0x153738=_0x153738-0x0;var _0x3028d9=_0xd453[_0x153738];return _0x3028d9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3d45('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d45('0x1'));var moment=require(_0x3d45('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3d45('0x3'));var util=require('util');var path=require(_0x3d45('0x4'));var sox=require(_0x3d45('0x5'));var csv=require(_0x3d45('0x6'));var ejs=require(_0x3d45('0x7'));var fs=require('fs');var fs_extra=require(_0x3d45('0x8'));var _=require(_0x3d45('0x9'));var squel=require(_0x3d45('0xa'));var crypto=require(_0x3d45('0xb'));var jsforce=require(_0x3d45('0xc'));var deskjs=require(_0x3d45('0xd'));var toCsv=require(_0x3d45('0x6'));var querystring=require('querystring');var Papa=require(_0x3d45('0xe'));var Redis=require(_0x3d45('0xf'));var authService=require(_0x3d45('0x10'));var qs=require(_0x3d45('0x11'));var as=require(_0x3d45('0x12'));var hardwareService=require(_0x3d45('0x13'));var logger=require(_0x3d45('0x14'))('api');var utils=require(_0x3d45('0x15'));var config=require(_0x3d45('0x16'));var licenseUtil=require(_0x3d45('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x202e9b,_0x194d8a){_0x194d8a=_0x194d8a||0xcc;return function(_0x187e84){if(_0x187e84){return _0x202e9b[_0x3d45('0x18')](_0x194d8a);}return _0x202e9b[_0x3d45('0x19')](_0x194d8a)['end']();};}function respondWithResult(_0x68d963,_0x10bb56){_0x10bb56=_0x10bb56||0xc8;return function(_0x5469c2){if(_0x5469c2){return _0x68d963['status'](_0x10bb56)[_0x3d45('0x1a')](_0x5469c2);}};}function respondWithFilteredResult(_0x258281,_0x244a82){return function(_0x4a0425){if(_0x4a0425){var _0x4e091d=typeof _0x244a82[_0x3d45('0x1b')]===_0x3d45('0x1c')&&typeof _0x244a82[_0x3d45('0x1d')]===_0x3d45('0x1c');var _0x2c0cf4=_0x4a0425[_0x3d45('0x1e')];var _0x41e1c8=_0x4e091d?0x0:_0x244a82[_0x3d45('0x1b')];var _0x992b05=_0x4e091d?_0x4a0425[_0x3d45('0x1e')]:_0x244a82[_0x3d45('0x1b')]+_0x244a82['limit'];var _0x3b76d2;if(_0x992b05>=_0x2c0cf4){_0x992b05=_0x2c0cf4;_0x3b76d2=0xc8;}else{_0x3b76d2=0xce;}_0x258281['status'](_0x3b76d2);return _0x258281[_0x3d45('0x1f')](_0x3d45('0x20'),_0x41e1c8+'-'+_0x992b05+'/'+_0x2c0cf4)[_0x3d45('0x1a')](_0x4a0425);}return null;};}function patchUpdates(_0x55ccc0){return function(_0x15902c){try{jsonpatch['apply'](_0x15902c,_0x55ccc0,!![]);}catch(_0x44ac16){return BPromise['reject'](_0x44ac16);}return _0x15902c['save']();};}function saveUpdates(_0x5467b9,_0x587e8d){return function(_0x2aeb99){if(_0x2aeb99){return _0x2aeb99[_0x3d45('0x21')](_0x5467b9)[_0x3d45('0x22')](function(_0x3acf30){return _0x3acf30;});}return null;};}function removeEntity(_0x4d19d8,_0x21cd2d){return function(_0x24b114){if(_0x24b114){return _0x24b114[_0x3d45('0x23')]()['then'](function(){_0x4d19d8[_0x3d45('0x19')](0xcc)[_0x3d45('0x24')]();});}};}function handleEntityNotFound(_0x4ebb89,_0x264860){return function(_0x147ee3){if(!_0x147ee3){_0x4ebb89[_0x3d45('0x18')](0x194);}return _0x147ee3;};}function handleError(_0x106edb,_0x313468){_0x313468=_0x313468||0x1f4;return function(_0x14f3ed){logger[_0x3d45('0x25')](_0x14f3ed[_0x3d45('0x26')]);if(_0x14f3ed[_0x3d45('0x27')]){delete _0x14f3ed['name'];}_0x106edb['status'](_0x313468)[_0x3d45('0x28')](_0x14f3ed);};}exports[_0x3d45('0x29')]=function(_0x261e37,_0x2ea7d1){var _0x3e230d={},_0x3915e7={},_0xdf77ac={'count':0x0,'rows':[]};var _0x5c706e=_[_0x3d45('0x2a')](db[_0x3d45('0x2b')]['rawAttributes'],function(_0x25d842){return{'name':_0x25d842[_0x3d45('0x2c')],'type':_0x25d842[_0x3d45('0x2d')][_0x3d45('0x2e')]};});_0x3915e7[_0x3d45('0x2f')]=_['map'](_0x5c706e,_0x3d45('0x27'));_0x3915e7[_0x3d45('0x30')]=_[_0x3d45('0x31')](_0x261e37['query']);_0x3915e7['filters']=_[_0x3d45('0x32')](_0x3915e7[_0x3d45('0x2f')],_0x3915e7[_0x3d45('0x30')]);_0x3e230d['attributes']=_[_0x3d45('0x32')](_0x3915e7[_0x3d45('0x2f')],qs[_0x3d45('0x33')](_0x261e37[_0x3d45('0x30')][_0x3d45('0x33')]));_0x3e230d[_0x3d45('0x34')]=_0x3e230d[_0x3d45('0x34')][_0x3d45('0x35')]?_0x3e230d[_0x3d45('0x34')]:_0x3915e7[_0x3d45('0x2f')];if(!_0x261e37[_0x3d45('0x30')][_0x3d45('0x36')]('nolimit')){_0x3e230d[_0x3d45('0x1d')]=qs[_0x3d45('0x1d')](_0x261e37[_0x3d45('0x30')][_0x3d45('0x1d')]);_0x3e230d[_0x3d45('0x1b')]=qs[_0x3d45('0x1b')](_0x261e37['query'][_0x3d45('0x1b')]);}_0x3e230d['order']=qs[_0x3d45('0x37')](_0x261e37['query'][_0x3d45('0x37')]);_0x3e230d[_0x3d45('0x38')]=qs[_0x3d45('0x39')](_[_0x3d45('0x3a')](_0x261e37[_0x3d45('0x30')],_0x3915e7[_0x3d45('0x39')]),_0x5c706e);if(_0x261e37[_0x3d45('0x30')][_0x3d45('0x3b')]){_0x3e230d[_0x3d45('0x38')]=_['merge'](_0x3e230d[_0x3d45('0x38')],{'$or':_[_0x3d45('0x2a')](_0x5c706e,function(_0x135b5a){if(_0x135b5a[_0x3d45('0x2d')]!==_0x3d45('0x3c')){var _0x25aaee={};_0x25aaee[_0x135b5a[_0x3d45('0x27')]]={'$like':'%'+_0x261e37[_0x3d45('0x30')][_0x3d45('0x3b')]+'%'};return _0x25aaee;}})});}_0x3e230d=_[_0x3d45('0x3d')]({},_0x3e230d,_0x261e37[_0x3d45('0x3e')]);var _0x161999={'where':_0x3e230d['where']};return db['JscriptyQuestionReport'][_0x3d45('0x1e')](_0x161999)[_0x3d45('0x22')](function(_0x1fe948){_0xdf77ac['count']=_0x1fe948;if(_0x261e37[_0x3d45('0x30')][_0x3d45('0x3f')]){_0x3e230d[_0x3d45('0x40')]=[{'all':!![]}];}return db[_0x3d45('0x2b')][_0x3d45('0x41')](_0x3e230d);})['then'](function(_0x1f8678){_0xdf77ac[_0x3d45('0x42')]=_0x1f8678;return _0xdf77ac;})[_0x3d45('0x22')](respondWithFilteredResult(_0x2ea7d1,_0x3e230d))[_0x3d45('0x43')](handleError(_0x2ea7d1,null));};exports[_0x3d45('0x44')]=function(_0x18178e,_0x172883){var _0x48795b={'raw':!![],'where':{'id':_0x18178e[_0x3d45('0x45')]['id']}},_0x31edbf={};_0x31edbf[_0x3d45('0x2f')]=_[_0x3d45('0x31')](db[_0x3d45('0x2b')][_0x3d45('0x46')]);_0x31edbf[_0x3d45('0x30')]=_[_0x3d45('0x31')](_0x18178e[_0x3d45('0x30')]);_0x31edbf[_0x3d45('0x39')]=_['intersection'](_0x31edbf[_0x3d45('0x2f')],_0x31edbf[_0x3d45('0x30')]);_0x48795b[_0x3d45('0x34')]=_[_0x3d45('0x32')](_0x31edbf[_0x3d45('0x2f')],qs['fields'](_0x18178e['query'][_0x3d45('0x33')]));_0x48795b['attributes']=_0x48795b[_0x3d45('0x34')][_0x3d45('0x35')]?_0x48795b[_0x3d45('0x34')]:_0x31edbf[_0x3d45('0x2f')];if(_0x18178e[_0x3d45('0x30')][_0x3d45('0x3f')]){_0x48795b[_0x3d45('0x40')]=[{'all':!![]}];}_0x48795b=_[_0x3d45('0x3d')]({},_0x48795b,_0x18178e['options']);return db['JscriptyQuestionReport'][_0x3d45('0x47')](_0x48795b)[_0x3d45('0x22')](handleEntityNotFound(_0x172883,null))[_0x3d45('0x22')](respondWithResult(_0x172883,null))['catch'](handleError(_0x172883,null));};exports[_0x3d45('0x48')]=function(_0x375a0a,_0x3af226){return db[_0x3d45('0x2b')][_0x3d45('0x48')](_0x375a0a[_0x3d45('0x49')],{})['then'](respondWithResult(_0x3af226,0xc9))[_0x3d45('0x43')](handleError(_0x3af226,null));};exports[_0x3d45('0x21')]=function(_0x29925e,_0x30902d){if(_0x29925e['body']['id']){delete _0x29925e[_0x3d45('0x49')]['id'];}return db[_0x3d45('0x2b')][_0x3d45('0x47')]({'where':{'id':_0x29925e[_0x3d45('0x45')]['id']}})['then'](handleEntityNotFound(_0x30902d,null))[_0x3d45('0x22')](saveUpdates(_0x29925e[_0x3d45('0x49')],null))[_0x3d45('0x22')](respondWithResult(_0x30902d,null))['catch'](handleError(_0x30902d,null));};exports[_0x3d45('0x23')]=function(_0x2211b6,_0x1c59ea){return db[_0x3d45('0x2b')][_0x3d45('0x47')]({'where':{'id':_0x2211b6[_0x3d45('0x45')]['id']}})[_0x3d45('0x22')](handleEntityNotFound(_0x1c59ea,null))[_0x3d45('0x22')](removeEntity(_0x1c59ea,null))[_0x3d45('0x43')](handleError(_0x1c59ea,null));};exports['describe']=function(_0x3eda75,_0x325fcd){return db[_0x3d45('0x2b')][_0x3d45('0x4a')]()[_0x3d45('0x22')](respondWithResult(_0x325fcd,null))[_0x3d45('0x43')](handleError(_0x325fcd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 18ad301..4afbc80 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 _0x55d3=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x246bcc,_0x4051a2){var _0x2e5f50=function(_0x1e118f){while(--_0x1e118f){_0x246bcc['push'](_0x246bcc['shift']());}};_0x2e5f50(++_0x4051a2);}(_0x55d3,0x1f1));var _0x355d=function(_0x301f96,_0x21beec){_0x301f96=_0x301f96-0x0;var _0x265a71=_0x55d3[_0x301f96];return _0x265a71;};'use strict';var _=require(_0x355d('0x0'));var util=require(_0x355d('0x1'));var logger=require(_0x355d('0x2'))(_0x355d('0x3'));var moment=require(_0x355d('0x4'));var BPromise=require(_0x355d('0x5'));var rp=require(_0x355d('0x6'));var fs=require('fs');var path=require(_0x355d('0x7'));var rimraf=require(_0x355d('0x8'));var config=require(_0x355d('0x9'));var attributes=require(_0x355d('0xa'));module[_0x355d('0xb')]=function(_0x339ffd,_0x460df5){return _0x339ffd[_0x355d('0xc')]('JscriptyQuestionReport',attributes,{'tableName':_0x355d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c8c=['./jscriptyQuestionReport.attributes','exports','define','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x245e0e,_0xcab6db){var _0xafcff4=function(_0x3ec00c){while(--_0x3ec00c){_0x245e0e['push'](_0x245e0e['shift']());}};_0xafcff4(++_0xcab6db);}(_0x9c8c,0xd4));var _0xc9c8=function(_0x40c7fd,_0x451a08){_0x40c7fd=_0x40c7fd-0x0;var _0x9ecd50=_0x9c8c[_0x40c7fd];return _0x9ecd50;};'use strict';var _=require(_0xc9c8('0x0'));var util=require(_0xc9c8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc9c8('0x2'));var BPromise=require(_0xc9c8('0x3'));var rp=require(_0xc9c8('0x4'));var fs=require('fs');var path=require(_0xc9c8('0x5'));var rimraf=require(_0xc9c8('0x6'));var config=require(_0xc9c8('0x7'));var attributes=require(_0xc9c8('0x8'));module[_0xc9c8('0x9')]=function(_0x2087d9,_0x3ff2b6){return _0x2087d9[_0xc9c8('0xa')]('JscriptyQuestionReport',attributes,{'tableName':'report_jscripty_questions','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 b7871ab..941d2bc 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 _0x79ce=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x79ce,0x66));var _0xe79c=function(_0x4eb76e,_0x1c82c7){_0x4eb76e=_0x4eb76e-0x0;var _0x16bb60=_0x79ce[_0x4eb76e];return _0x16bb60;};'use strict';var _=require(_0xe79c('0x0'));var util=require(_0xe79c('0x1'));var moment=require(_0xe79c('0x2'));var BPromise=require(_0xe79c('0x3'));var rs=require(_0xe79c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe79c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe79c('0x6'))(_0xe79c('0x7'));var config=require(_0xe79c('0x8'));var jayson=require(_0xe79c('0x9'));var client=jayson[_0xe79c('0xa')][_0xe79c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20eeeb,_0x2598a8,_0x222579){return new BPromise(function(_0x58d60e,_0x4077f1){return client[_0xe79c('0xc')](_0x20eeeb,_0x222579)[_0xe79c('0xd')](function(_0x128d19){logger[_0xe79c('0xe')](_0xe79c('0xf'),_0x2598a8,_0xe79c('0x10'));logger[_0xe79c('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2598a8,'request\x20sent',JSON[_0xe79c('0x12')](_0x128d19));if(_0x128d19[_0xe79c('0x13')]){if(_0x128d19[_0xe79c('0x13')]['code']===0x1f4){logger[_0xe79c('0x13')](_0xe79c('0xf'),_0x2598a8,_0x128d19[_0xe79c('0x13')]['message']);return _0x4077f1(_0x128d19[_0xe79c('0x13')][_0xe79c('0x14')]);}logger['error'](_0xe79c('0xf'),_0x2598a8,_0x128d19[_0xe79c('0x13')][_0xe79c('0x14')]);return _0x58d60e(_0x128d19[_0xe79c('0x13')][_0xe79c('0x14')]);}else{logger[_0xe79c('0xe')](_0xe79c('0xf'),_0x2598a8,_0xe79c('0x10'));_0x58d60e(_0x128d19[_0xe79c('0x15')][_0xe79c('0x14')]);}})['catch'](function(_0x5e25ed){logger['error'](_0xe79c('0xf'),_0x2598a8,_0x5e25ed);_0x4077f1(_0x5e25ed);});});} \ No newline at end of file +var _0x4ef6=['request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','client'];(function(_0x497d44,_0xfd24ec){var _0x19f8a5=function(_0xb13bd2){while(--_0xb13bd2){_0x497d44['push'](_0x497d44['shift']());}};_0x19f8a5(++_0xfd24ec);}(_0x4ef6,0x1ef));var _0x64ef=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0x4ef6[_0x4a8418];return _0x390174;};'use strict';var _=require(_0x64ef('0x0'));var util=require(_0x64ef('0x1'));var moment=require(_0x64ef('0x2'));var BPromise=require(_0x64ef('0x3'));var rs=require(_0x64ef('0x4'));var fs=require('fs');var Redis=require(_0x64ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x64ef('0x6'));var config=require('../../config/environment');var jayson=require(_0x64ef('0x7'));var client=jayson[_0x64ef('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x211856,_0x5183b2,_0x3181d5){return new BPromise(function(_0x2c92e4,_0x263104){return client[_0x64ef('0x9')](_0x211856,_0x3181d5)['then'](function(_0x15661e){logger[_0x64ef('0xa')](_0x64ef('0xb'),_0x5183b2,_0x64ef('0xc'));logger[_0x64ef('0xd')](_0x64ef('0xe'),_0x5183b2,_0x64ef('0xc'),JSON[_0x64ef('0xf')](_0x15661e));if(_0x15661e[_0x64ef('0x10')]){if(_0x15661e[_0x64ef('0x10')][_0x64ef('0x11')]===0x1f4){logger['error'](_0x64ef('0xb'),_0x5183b2,_0x15661e[_0x64ef('0x10')][_0x64ef('0x12')]);return _0x263104(_0x15661e['error'][_0x64ef('0x12')]);}logger[_0x64ef('0x10')](_0x64ef('0xb'),_0x5183b2,_0x15661e[_0x64ef('0x10')][_0x64ef('0x12')]);return _0x2c92e4(_0x15661e['error'][_0x64ef('0x12')]);}else{logger[_0x64ef('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5183b2,_0x64ef('0xc'));_0x2c92e4(_0x15661e[_0x64ef('0x13')]['message']);}})[_0x64ef('0x14')](function(_0x3e3bcd){logger['error'](_0x64ef('0xb'),_0x5183b2,_0x3e3bcd);_0x263104(_0x3e3bcd);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 2f7d744..b2994ae 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 _0xd0c8=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','/:id','getQuestions','post','create','put','update','delete','destroy','multer'];(function(_0x335412,_0x459891){var _0x24fa5c=function(_0x43df14){while(--_0x43df14){_0x335412['push'](_0x335412['shift']());}};_0x24fa5c(++_0x459891);}(_0xd0c8,0x179));var _0x8d0c=function(_0x22ae37,_0x55c142){_0x22ae37=_0x22ae37-0x0;var _0x5874e9=_0xd0c8[_0x22ae37];return _0x5874e9;};'use strict';var multer=require(_0x8d0c('0x0'));var util=require(_0x8d0c('0x1'));var path=require(_0x8d0c('0x2'));var timeout=require(_0x8d0c('0x3'));var express=require(_0x8d0c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8d0c('0x5'));var interaction=require(_0x8d0c('0x6'));var config=require(_0x8d0c('0x7'));var controller=require(_0x8d0c('0x8'));router[_0x8d0c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8d0c('0x9')](_0x8d0c('0xa'),auth[_0x8d0c('0xb')](),controller[_0x8d0c('0xc')]);router[_0x8d0c('0x9')](_0x8d0c('0xd'),auth[_0x8d0c('0xb')](),controller['show']);router[_0x8d0c('0x9')]('/:id/questions',auth[_0x8d0c('0xb')](),controller[_0x8d0c('0xe')]);router[_0x8d0c('0xf')]('/',auth[_0x8d0c('0xb')](),controller[_0x8d0c('0x10')]);router[_0x8d0c('0x11')](_0x8d0c('0xd'),auth[_0x8d0c('0xb')](),controller[_0x8d0c('0x12')]);router[_0x8d0c('0x13')](_0x8d0c('0xd'),auth[_0x8d0c('0xb')](),controller[_0x8d0c('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd75d=['/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','describe','get','show','getQuestions','post','create','put'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xd75d,0x1d1));var _0xdd75=function(_0x522dbf,_0x58071b){_0x522dbf=_0x522dbf-0x0;var _0x21d222=_0xd75d[_0x522dbf];return _0x21d222;};'use strict';var multer=require(_0xdd75('0x0'));var util=require(_0xdd75('0x1'));var path=require(_0xdd75('0x2'));var timeout=require(_0xdd75('0x3'));var express=require(_0xdd75('0x4'));var router=express[_0xdd75('0x5')]();var fs_extra=require(_0xdd75('0x6'));var auth=require(_0xdd75('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdd75('0x8'));var controller=require(_0xdd75('0x9'));router['get']('/',auth[_0xdd75('0xa')](),controller[_0xdd75('0xb')]);router['get']('/describe',auth[_0xdd75('0xa')](),controller[_0xdd75('0xc')]);router[_0xdd75('0xd')]('/:id',auth[_0xdd75('0xa')](),controller[_0xdd75('0xe')]);router[_0xdd75('0xd')]('/:id/questions',auth[_0xdd75('0xa')](),controller[_0xdd75('0xf')]);router[_0xdd75('0x10')]('/',auth[_0xdd75('0xa')](),controller[_0xdd75('0x11')]);router[_0xdd75('0x12')](_0xdd75('0x13'),auth[_0xdd75('0xa')](),controller[_0xdd75('0x14')]);router[_0xdd75('0x15')](_0xdd75('0x13'),auth[_0xdd75('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 769937e..835dbb5 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 _0xf762=['setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','DATE'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0xf762,0x1af));var _0x2f76=function(_0x563bf5,_0x1de761){_0x563bf5=_0x563bf5-0x0;var _0xd8ccdf=_0xf762[_0x563bf5];return _0xd8ccdf;};'use strict';var moment=require(_0x2f76('0x0'));var Sequelize=require('sequelize');module[_0x2f76('0x1')]={'starttime':{'type':Sequelize[_0x2f76('0x2')],'set':function(_0x4c46d7){this[_0x2f76('0x3')]('starttime',_0x4c46d7);this[_0x2f76('0x3')](_0x2f76('0x4'),moment()['format'](_0x2f76('0x5')));}},'endtime':{'type':Sequelize[_0x2f76('0x2')]},'membername':{'type':Sequelize[_0x2f76('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2f76('0x6')]},'uniqueid':{'type':Sequelize[_0x2f76('0x6')]},'calleridname':{'type':Sequelize[_0x2f76('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xba87=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue','starttime'];(function(_0x2ce699,_0x43d507){var _0x4adac9=function(_0x1630e4){while(--_0x1630e4){_0x2ce699['push'](_0x2ce699['shift']());}};_0x4adac9(++_0x43d507);}(_0xba87,0xe1));var _0x7ba8=function(_0xa92013,_0x3b2577){_0xa92013=_0xa92013-0x0;var _0x49fdfa=_0xba87[_0xa92013];return _0x49fdfa;};'use strict';var moment=require(_0x7ba8('0x0'));var Sequelize=require('sequelize');module[_0x7ba8('0x1')]={'starttime':{'type':Sequelize[_0x7ba8('0x2')],'set':function(_0x119727){this[_0x7ba8('0x3')](_0x7ba8('0x4'),_0x119727);this['setDataValue'](_0x7ba8('0x5'),moment()[_0x7ba8('0x6')](_0x7ba8('0x7')));}},'endtime':{'type':Sequelize[_0x7ba8('0x2')]},'membername':{'type':Sequelize[_0x7ba8('0x8')]},'projectname':{'type':Sequelize[_0x7ba8('0x8')]},'queue':{'type':Sequelize[_0x7ba8('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7ba8('0x8')]},'calleridnum':{'type':Sequelize[_0x7ba8('0x8')]},'completed':{'type':Sequelize[_0x7ba8('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a034bc5..e4fbc79 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 _0xbf75=['getQuestions','findOne','order','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body','describe'];(function(_0x42a865,_0x40fdf9){var _0x15de7c=function(_0x5d9032){while(--_0x5d9032){_0x42a865['push'](_0x42a865['shift']());}};_0x15de7c(++_0x40fdf9);}(_0xbf75,0x155));var _0x5bf7=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xbf75[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0x5bf7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5bf7('0x1'));var jsonpatch=require(_0x5bf7('0x2'));var rp=require(_0x5bf7('0x3'));var moment=require(_0x5bf7('0x4'));var BPromise=require(_0x5bf7('0x5'));var Mustache=require(_0x5bf7('0x6'));var util=require(_0x5bf7('0x7'));var path=require(_0x5bf7('0x8'));var sox=require('sox');var csv=require(_0x5bf7('0x9'));var ejs=require(_0x5bf7('0xa'));var fs=require('fs');var fs_extra=require(_0x5bf7('0xb'));var _=require(_0x5bf7('0xc'));var squel=require(_0x5bf7('0xd'));var crypto=require(_0x5bf7('0xe'));var jsforce=require(_0x5bf7('0xf'));var deskjs=require(_0x5bf7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5bf7('0x11'));var Papa=require(_0x5bf7('0x12'));var Redis=require(_0x5bf7('0x13'));var authService=require(_0x5bf7('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bf7('0x15'));var logger=require(_0x5bf7('0x16'))(_0x5bf7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5bf7('0x18'));var db=require(_0x5bf7('0x19'))['db'];function respondWithStatusCode(_0xcfb515,_0x1a7a12){_0x1a7a12=_0x1a7a12||0xcc;return function(_0x29945d){if(_0x29945d){return _0xcfb515['sendStatus'](_0x1a7a12);}return _0xcfb515[_0x5bf7('0x1a')](_0x1a7a12)[_0x5bf7('0x1b')]();};}function respondWithResult(_0x5ee552,_0x25f0da){_0x25f0da=_0x25f0da||0xc8;return function(_0x598da4){if(_0x598da4){return _0x5ee552[_0x5bf7('0x1a')](_0x25f0da)[_0x5bf7('0x1c')](_0x598da4);}};}function respondWithFilteredResult(_0x14ce5d,_0x4ae771){return function(_0x31f3d4){if(_0x31f3d4){var _0x32e7a1=typeof _0x4ae771['offset']==='undefined'&&typeof _0x4ae771[_0x5bf7('0x1d')]===_0x5bf7('0x1e');var _0x5a0497=_0x31f3d4[_0x5bf7('0x1f')];var _0x4b0014=_0x32e7a1?0x0:_0x4ae771[_0x5bf7('0x20')];var _0x5c9fa6=_0x32e7a1?_0x31f3d4[_0x5bf7('0x1f')]:_0x4ae771[_0x5bf7('0x20')]+_0x4ae771['limit'];var _0x280631;if(_0x5c9fa6>=_0x5a0497){_0x5c9fa6=_0x5a0497;_0x280631=0xc8;}else{_0x280631=0xce;}_0x14ce5d['status'](_0x280631);return _0x14ce5d[_0x5bf7('0x21')](_0x5bf7('0x22'),_0x4b0014+'-'+_0x5c9fa6+'/'+_0x5a0497)[_0x5bf7('0x1c')](_0x31f3d4);}return null;};}function patchUpdates(_0x360f02){return function(_0x5dfaf5){try{jsonpatch[_0x5bf7('0x23')](_0x5dfaf5,_0x360f02,!![]);}catch(_0x283332){return BPromise[_0x5bf7('0x24')](_0x283332);}return _0x5dfaf5[_0x5bf7('0x25')]();};}function saveUpdates(_0x2ffad2,_0x4a868d){return function(_0x3f7af4){if(_0x3f7af4){return _0x3f7af4['update'](_0x2ffad2)['then'](function(_0x5534d6){return _0x5534d6;});}return null;};}function removeEntity(_0x5862d8,_0x117bfb){return function(_0x5087b6){if(_0x5087b6){return _0x5087b6['destroy']()[_0x5bf7('0x26')](function(){_0x5862d8[_0x5bf7('0x1a')](0xcc)[_0x5bf7('0x1b')]();});}};}function handleEntityNotFound(_0x54ef2f,_0x4f1034){return function(_0x3e7ed3){if(!_0x3e7ed3){_0x54ef2f[_0x5bf7('0x27')](0x194);}return _0x3e7ed3;};}function handleError(_0xf8d10a,_0x5a5ecf){_0x5a5ecf=_0x5a5ecf||0x1f4;return function(_0x17dfe4){logger[_0x5bf7('0x28')](_0x17dfe4[_0x5bf7('0x29')]);if(_0x17dfe4['name']){delete _0x17dfe4[_0x5bf7('0x2a')];}_0xf8d10a[_0x5bf7('0x1a')](_0x5a5ecf)[_0x5bf7('0x2b')](_0x17dfe4);};}exports[_0x5bf7('0x2c')]=function(_0x1d25d7,_0x69391d){var _0x5e136b={},_0x3d2f54={},_0x3cd22c={'count':0x0,'rows':[]};var _0x1585ec=_[_0x5bf7('0x2d')](db[_0x5bf7('0x2e')]['rawAttributes'],function(_0xeac632){return{'name':_0xeac632[_0x5bf7('0x2f')],'type':_0xeac632[_0x5bf7('0x30')][_0x5bf7('0x31')]};});_0x3d2f54[_0x5bf7('0x32')]=_[_0x5bf7('0x2d')](_0x1585ec,_0x5bf7('0x2a'));_0x3d2f54[_0x5bf7('0x33')]=_[_0x5bf7('0x34')](_0x1d25d7['query']);_0x3d2f54[_0x5bf7('0x35')]=_[_0x5bf7('0x36')](_0x3d2f54['model'],_0x3d2f54[_0x5bf7('0x33')]);_0x5e136b[_0x5bf7('0x37')]=_['intersection'](_0x3d2f54[_0x5bf7('0x32')],qs[_0x5bf7('0x38')](_0x1d25d7[_0x5bf7('0x33')]['fields']));_0x5e136b[_0x5bf7('0x37')]=_0x5e136b[_0x5bf7('0x37')][_0x5bf7('0x39')]?_0x5e136b[_0x5bf7('0x37')]:_0x3d2f54[_0x5bf7('0x32')];if(!_0x1d25d7['query'][_0x5bf7('0x3a')](_0x5bf7('0x3b'))){_0x5e136b[_0x5bf7('0x1d')]=qs['limit'](_0x1d25d7['query'][_0x5bf7('0x1d')]);_0x5e136b[_0x5bf7('0x20')]=qs[_0x5bf7('0x20')](_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x20')]);}_0x5e136b['order']=qs[_0x5bf7('0x3c')](_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x3c')]);_0x5e136b[_0x5bf7('0x3d')]=qs[_0x5bf7('0x35')](_[_0x5bf7('0x3e')](_0x1d25d7[_0x5bf7('0x33')],_0x3d2f54[_0x5bf7('0x35')]),_0x1585ec);if(_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x3f')]){_0x5e136b[_0x5bf7('0x3d')]=_[_0x5bf7('0x40')](_0x5e136b['where'],{'$or':_['map'](_0x1585ec,function(_0x221b24){if(_0x221b24[_0x5bf7('0x30')]!=='VIRTUAL'){var _0x35aab8={};_0x35aab8[_0x221b24['name']]={'$like':'%'+_0x1d25d7[_0x5bf7('0x33')]['filter']+'%'};return _0x35aab8;}})});}_0x5e136b=_[_0x5bf7('0x40')]({},_0x5e136b,_0x1d25d7[_0x5bf7('0x41')]);var _0x5b5642={'where':_0x5e136b[_0x5bf7('0x3d')]};return db[_0x5bf7('0x2e')][_0x5bf7('0x1f')](_0x5b5642)['then'](function(_0xb0af17){_0x3cd22c[_0x5bf7('0x1f')]=_0xb0af17;if(_0x1d25d7[_0x5bf7('0x33')][_0x5bf7('0x42')]){_0x5e136b[_0x5bf7('0x43')]=[{'all':!![]}];}return db[_0x5bf7('0x2e')][_0x5bf7('0x44')](_0x5e136b);})[_0x5bf7('0x26')](function(_0x29a536){_0x3cd22c[_0x5bf7('0x45')]=_0x29a536;return _0x3cd22c;})[_0x5bf7('0x26')](respondWithFilteredResult(_0x69391d,_0x5e136b))[_0x5bf7('0x46')](handleError(_0x69391d,null));};exports[_0x5bf7('0x47')]=function(_0x33316f,_0x126e3b){var _0x789bb8={'raw':!![],'where':{'id':_0x33316f[_0x5bf7('0x48')]['id']}},_0x49b2e4={};_0x49b2e4[_0x5bf7('0x32')]=_[_0x5bf7('0x34')](db[_0x5bf7('0x2e')][_0x5bf7('0x49')]);_0x49b2e4[_0x5bf7('0x33')]=_[_0x5bf7('0x34')](_0x33316f['query']);_0x49b2e4['filters']=_[_0x5bf7('0x36')](_0x49b2e4[_0x5bf7('0x32')],_0x49b2e4[_0x5bf7('0x33')]);_0x789bb8['attributes']=_[_0x5bf7('0x36')](_0x49b2e4[_0x5bf7('0x32')],qs[_0x5bf7('0x38')](_0x33316f[_0x5bf7('0x33')][_0x5bf7('0x38')]));_0x789bb8['attributes']=_0x789bb8[_0x5bf7('0x37')]['length']?_0x789bb8[_0x5bf7('0x37')]:_0x49b2e4[_0x5bf7('0x32')];if(_0x33316f[_0x5bf7('0x33')][_0x5bf7('0x42')]){_0x789bb8[_0x5bf7('0x43')]=[{'all':!![]}];}_0x789bb8=_[_0x5bf7('0x40')]({},_0x789bb8,_0x33316f[_0x5bf7('0x41')]);return db['JscriptySessionReport'][_0x5bf7('0x4a')](_0x789bb8)[_0x5bf7('0x26')](handleEntityNotFound(_0x126e3b,null))[_0x5bf7('0x26')](respondWithResult(_0x126e3b,null))[_0x5bf7('0x46')](handleError(_0x126e3b,null));};exports['create']=function(_0x38b9f6,_0x1ba994){return db['JscriptySessionReport'][_0x5bf7('0x4b')](_0x38b9f6['body'],{})[_0x5bf7('0x26')](respondWithResult(_0x1ba994,0xc9))['catch'](handleError(_0x1ba994,null));};exports[_0x5bf7('0x4c')]=function(_0x19b9ce,_0x321c10){if(_0x19b9ce['body']['id']){delete _0x19b9ce[_0x5bf7('0x4d')]['id'];}return db[_0x5bf7('0x2e')][_0x5bf7('0x4a')]({'where':{'id':_0x19b9ce[_0x5bf7('0x48')]['id']}})[_0x5bf7('0x26')](handleEntityNotFound(_0x321c10,null))['then'](saveUpdates(_0x19b9ce[_0x5bf7('0x4d')],null))[_0x5bf7('0x26')](respondWithResult(_0x321c10,null))[_0x5bf7('0x46')](handleError(_0x321c10,null));};exports['destroy']=function(_0x7ffa77,_0x24bbb1){return db[_0x5bf7('0x2e')][_0x5bf7('0x4a')]({'where':{'id':_0x7ffa77[_0x5bf7('0x48')]['id']}})[_0x5bf7('0x26')](handleEntityNotFound(_0x24bbb1,null))['then'](removeEntity(_0x24bbb1,null))[_0x5bf7('0x46')](handleError(_0x24bbb1,null));};exports['describe']=function(_0x26acd8,_0x331e15){return db['JscriptySessionReport'][_0x5bf7('0x4e')]()[_0x5bf7('0x26')](respondWithResult(_0x331e15,null))[_0x5bf7('0x46')](handleError(_0x331e15,null));};exports[_0x5bf7('0x4f')]=function(_0x43252e,_0x2a9157,_0x1232bf){var _0x54be74={'raw':!![],'where':{}};var _0xb98cbc={};var _0x599117={'count':0x0,'rows':[]};return db[_0x5bf7('0x2e')][_0x5bf7('0x50')]({'where':{'id':_0x43252e[_0x5bf7('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a9157,null))['then'](function(_0x357604){if(_0x357604){_0xb98cbc[_0x5bf7('0x32')]=_[_0x5bf7('0x34')](db['JscriptyQuestionReport'][_0x5bf7('0x49')]);_0xb98cbc[_0x5bf7('0x33')]=_['keys'](_0x43252e[_0x5bf7('0x33')]);_0xb98cbc['filters']=_['intersection'](_0xb98cbc[_0x5bf7('0x32')],_0xb98cbc[_0x5bf7('0x33')]);_0x54be74[_0x5bf7('0x37')]=_['intersection'](_0xb98cbc[_0x5bf7('0x32')],qs[_0x5bf7('0x38')](_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x38')]));_0x54be74[_0x5bf7('0x37')]=_0x54be74[_0x5bf7('0x37')][_0x5bf7('0x39')]?_0x54be74[_0x5bf7('0x37')]:_0xb98cbc[_0x5bf7('0x32')];if(!_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x3a')](_0x5bf7('0x3b'))){_0x54be74[_0x5bf7('0x1d')]=qs[_0x5bf7('0x1d')](_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x1d')]);_0x54be74[_0x5bf7('0x20')]=qs[_0x5bf7('0x20')](_0x43252e['query']['offset']);}_0x54be74[_0x5bf7('0x51')]=qs[_0x5bf7('0x3c')](_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x3c')]);_0x54be74[_0x5bf7('0x3d')]=qs['filters'](_['pick'](_0x43252e[_0x5bf7('0x33')],_0xb98cbc[_0x5bf7('0x35')]));_0x54be74[_0x5bf7('0x3d')][_0x5bf7('0x52')]=_0x357604['id'];if(_0x43252e[_0x5bf7('0x33')]['filter']){_0x54be74[_0x5bf7('0x3d')]=_['merge'](_0x54be74['where'],{'$or':_[_0x5bf7('0x2d')](_0x54be74[_0x5bf7('0x37')],function(_0x2692b6){var _0x5f471e={};_0x5f471e[_0x2692b6]={'$like':'%'+_0x43252e[_0x5bf7('0x33')][_0x5bf7('0x3f')]+'%'};return _0x5f471e;})});}_0x54be74=_[_0x5bf7('0x40')]({},_0x54be74,_0x43252e[_0x5bf7('0x41')]);return db['JscriptyQuestionReport'][_0x5bf7('0x1f')]({'where':_0x54be74['where']})['then'](function(_0x57f797){_0x599117['count']=_0x57f797;if(_0x43252e['query']['includeAll']){_0x54be74[_0x5bf7('0x43')]=[{'all':!![]}];}return db[_0x5bf7('0x53')][_0x5bf7('0x44')](_0x54be74);})[_0x5bf7('0x26')](function(_0x3c6742){_0x599117[_0x5bf7('0x45')]=_0x3c6742;return _0x599117;});}})['then'](respondWithFilteredResult(_0x2a9157,_0x54be74))[_0x5bf7('0x46')](handleError(_0x2a9157,null));}; \ No newline at end of file +var _0x9747=['hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','rows','catch','fields','find','create','body','params','describe','findOne','JscriptyQuestionReport','pick','SessionId','findAll','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','query','length'];(function(_0x539724,_0x55a59b){var _0xeaab51=function(_0x3b1a14){while(--_0x3b1a14){_0x539724['push'](_0x539724['shift']());}};_0xeaab51(++_0x55a59b);}(_0x9747,0xff));var _0x7974=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9747[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7974('0x0'));var zipdir=require(_0x7974('0x1'));var jsonpatch=require(_0x7974('0x2'));var rp=require(_0x7974('0x3'));var moment=require('moment');var BPromise=require(_0x7974('0x4'));var Mustache=require('mustache');var util=require(_0x7974('0x5'));var path=require(_0x7974('0x6'));var sox=require(_0x7974('0x7'));var csv=require(_0x7974('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7974('0x9'));var crypto=require('crypto');var jsforce=require(_0x7974('0xa'));var deskjs=require(_0x7974('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7974('0xc'));var Papa=require('papaparse');var Redis=require(_0x7974('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7974('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7974('0xf'))(_0x7974('0x10'));var utils=require(_0x7974('0x11'));var config=require(_0x7974('0x12'));var licenseUtil=require(_0x7974('0x13'));var db=require(_0x7974('0x14'))['db'];function respondWithStatusCode(_0x4da572,_0x5e7991){_0x5e7991=_0x5e7991||0xcc;return function(_0x38d91e){if(_0x38d91e){return _0x4da572[_0x7974('0x15')](_0x5e7991);}return _0x4da572[_0x7974('0x16')](_0x5e7991)[_0x7974('0x17')]();};}function respondWithResult(_0x48bd95,_0x4251a4){_0x4251a4=_0x4251a4||0xc8;return function(_0x56c440){if(_0x56c440){return _0x48bd95[_0x7974('0x16')](_0x4251a4)[_0x7974('0x18')](_0x56c440);}};}function respondWithFilteredResult(_0x22c8cd,_0x81d0de){return function(_0x167261){if(_0x167261){var _0x40c42b=typeof _0x81d0de['offset']==='undefined'&&typeof _0x81d0de[_0x7974('0x19')]===_0x7974('0x1a');var _0xf68ebf=_0x167261[_0x7974('0x1b')];var _0x42119a=_0x40c42b?0x0:_0x81d0de[_0x7974('0x1c')];var _0x57504b=_0x40c42b?_0x167261['count']:_0x81d0de[_0x7974('0x1c')]+_0x81d0de['limit'];var _0x5a6cc4;if(_0x57504b>=_0xf68ebf){_0x57504b=_0xf68ebf;_0x5a6cc4=0xc8;}else{_0x5a6cc4=0xce;}_0x22c8cd['status'](_0x5a6cc4);return _0x22c8cd[_0x7974('0x1d')](_0x7974('0x1e'),_0x42119a+'-'+_0x57504b+'/'+_0xf68ebf)[_0x7974('0x18')](_0x167261);}return null;};}function patchUpdates(_0x2e515c){return function(_0x161416){try{jsonpatch[_0x7974('0x1f')](_0x161416,_0x2e515c,!![]);}catch(_0x58dbcf){return BPromise[_0x7974('0x20')](_0x58dbcf);}return _0x161416[_0x7974('0x21')]();};}function saveUpdates(_0x595464,_0x727460){return function(_0x33c6a4){if(_0x33c6a4){return _0x33c6a4['update'](_0x595464)[_0x7974('0x22')](function(_0x5e42e7){return _0x5e42e7;});}return null;};}function removeEntity(_0x2fd799,_0x5e505c){return function(_0x1af9ee){if(_0x1af9ee){return _0x1af9ee[_0x7974('0x23')]()[_0x7974('0x22')](function(){_0x2fd799[_0x7974('0x16')](0xcc)[_0x7974('0x17')]();});}};}function handleEntityNotFound(_0x54aaba,_0xf06864){return function(_0x4ad6af){if(!_0x4ad6af){_0x54aaba[_0x7974('0x15')](0x194);}return _0x4ad6af;};}function handleError(_0x4b3fc5,_0x33df2f){_0x33df2f=_0x33df2f||0x1f4;return function(_0x482aaa){logger[_0x7974('0x24')](_0x482aaa[_0x7974('0x25')]);if(_0x482aaa[_0x7974('0x26')]){delete _0x482aaa['name'];}_0x4b3fc5[_0x7974('0x16')](_0x33df2f)[_0x7974('0x27')](_0x482aaa);};}exports[_0x7974('0x28')]=function(_0x41c946,_0x26e490){var _0x141fac={},_0x2a715a={},_0x1542b0={'count':0x0,'rows':[]};var _0xd1045f=_[_0x7974('0x29')](db[_0x7974('0x2a')][_0x7974('0x2b')],function(_0x2e330d){return{'name':_0x2e330d[_0x7974('0x2c')],'type':_0x2e330d[_0x7974('0x2d')][_0x7974('0x2e')]};});_0x2a715a[_0x7974('0x2f')]=_['map'](_0xd1045f,_0x7974('0x26'));_0x2a715a['query']=_[_0x7974('0x30')](_0x41c946['query']);_0x2a715a['filters']=_[_0x7974('0x31')](_0x2a715a[_0x7974('0x2f')],_0x2a715a['query']);_0x141fac[_0x7974('0x32')]=_[_0x7974('0x31')](_0x2a715a[_0x7974('0x2f')],qs['fields'](_0x41c946[_0x7974('0x33')]['fields']));_0x141fac[_0x7974('0x32')]=_0x141fac[_0x7974('0x32')][_0x7974('0x34')]?_0x141fac['attributes']:_0x2a715a['model'];if(!_0x41c946[_0x7974('0x33')][_0x7974('0x35')](_0x7974('0x36'))){_0x141fac[_0x7974('0x19')]=qs[_0x7974('0x19')](_0x41c946[_0x7974('0x33')]['limit']);_0x141fac['offset']=qs[_0x7974('0x1c')](_0x41c946[_0x7974('0x33')][_0x7974('0x1c')]);}_0x141fac[_0x7974('0x37')]=qs[_0x7974('0x38')](_0x41c946[_0x7974('0x33')][_0x7974('0x38')]);_0x141fac[_0x7974('0x39')]=qs[_0x7974('0x3a')](_['pick'](_0x41c946[_0x7974('0x33')],_0x2a715a[_0x7974('0x3a')]),_0xd1045f);if(_0x41c946['query'][_0x7974('0x3b')]){_0x141fac[_0x7974('0x39')]=_[_0x7974('0x3c')](_0x141fac['where'],{'$or':_[_0x7974('0x29')](_0xd1045f,function(_0x4fa528){if(_0x4fa528['type']!=='VIRTUAL'){var _0x2b0454={};_0x2b0454[_0x4fa528[_0x7974('0x26')]]={'$like':'%'+_0x41c946[_0x7974('0x33')]['filter']+'%'};return _0x2b0454;}})});}_0x141fac=_['merge']({},_0x141fac,_0x41c946[_0x7974('0x3d')]);var _0x3f6dec={'where':_0x141fac[_0x7974('0x39')]};return db[_0x7974('0x2a')][_0x7974('0x1b')](_0x3f6dec)[_0x7974('0x22')](function(_0x31e53f){_0x1542b0['count']=_0x31e53f;if(_0x41c946[_0x7974('0x33')][_0x7974('0x3e')]){_0x141fac[_0x7974('0x3f')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x141fac);})[_0x7974('0x22')](function(_0x1855bf){_0x1542b0[_0x7974('0x40')]=_0x1855bf;return _0x1542b0;})[_0x7974('0x22')](respondWithFilteredResult(_0x26e490,_0x141fac))[_0x7974('0x41')](handleError(_0x26e490,null));};exports['show']=function(_0x405ed6,_0x1099df){var _0x36d332={'raw':!![],'where':{'id':_0x405ed6['params']['id']}},_0xc3b77d={};_0xc3b77d[_0x7974('0x2f')]=_['keys'](db['JscriptySessionReport'][_0x7974('0x2b')]);_0xc3b77d['query']=_[_0x7974('0x30')](_0x405ed6[_0x7974('0x33')]);_0xc3b77d[_0x7974('0x3a')]=_[_0x7974('0x31')](_0xc3b77d['model'],_0xc3b77d[_0x7974('0x33')]);_0x36d332['attributes']=_[_0x7974('0x31')](_0xc3b77d['model'],qs[_0x7974('0x42')](_0x405ed6[_0x7974('0x33')]['fields']));_0x36d332[_0x7974('0x32')]=_0x36d332['attributes'][_0x7974('0x34')]?_0x36d332[_0x7974('0x32')]:_0xc3b77d[_0x7974('0x2f')];if(_0x405ed6[_0x7974('0x33')][_0x7974('0x3e')]){_0x36d332[_0x7974('0x3f')]=[{'all':!![]}];}_0x36d332=_[_0x7974('0x3c')]({},_0x36d332,_0x405ed6[_0x7974('0x3d')]);return db[_0x7974('0x2a')][_0x7974('0x43')](_0x36d332)[_0x7974('0x22')](handleEntityNotFound(_0x1099df,null))[_0x7974('0x22')](respondWithResult(_0x1099df,null))['catch'](handleError(_0x1099df,null));};exports[_0x7974('0x44')]=function(_0x28268f,_0x39eb1){return db[_0x7974('0x2a')]['create'](_0x28268f[_0x7974('0x45')],{})['then'](respondWithResult(_0x39eb1,0xc9))['catch'](handleError(_0x39eb1,null));};exports['update']=function(_0x2b738c,_0x30b244){if(_0x2b738c['body']['id']){delete _0x2b738c['body']['id'];}return db[_0x7974('0x2a')][_0x7974('0x43')]({'where':{'id':_0x2b738c['params']['id']}})[_0x7974('0x22')](handleEntityNotFound(_0x30b244,null))[_0x7974('0x22')](saveUpdates(_0x2b738c[_0x7974('0x45')],null))['then'](respondWithResult(_0x30b244,null))['catch'](handleError(_0x30b244,null));};exports[_0x7974('0x23')]=function(_0x2d78fd,_0x3f1eaa){return db[_0x7974('0x2a')][_0x7974('0x43')]({'where':{'id':_0x2d78fd[_0x7974('0x46')]['id']}})['then'](handleEntityNotFound(_0x3f1eaa,null))[_0x7974('0x22')](removeEntity(_0x3f1eaa,null))[_0x7974('0x41')](handleError(_0x3f1eaa,null));};exports[_0x7974('0x47')]=function(_0x5be1e2,_0x4cf24c){return db[_0x7974('0x2a')][_0x7974('0x47')]()[_0x7974('0x22')](respondWithResult(_0x4cf24c,null))[_0x7974('0x41')](handleError(_0x4cf24c,null));};exports['getQuestions']=function(_0x4eda4b,_0x1e1964,_0x1c774f){var _0x2695ab={'raw':!![],'where':{}};var _0x4f9437={};var _0x5cbfc6={'count':0x0,'rows':[]};return db[_0x7974('0x2a')][_0x7974('0x48')]({'where':{'id':_0x4eda4b['params']['id']}})[_0x7974('0x22')](handleEntityNotFound(_0x1e1964,null))[_0x7974('0x22')](function(_0x12619c){if(_0x12619c){_0x4f9437['model']=_['keys'](db[_0x7974('0x49')]['rawAttributes']);_0x4f9437[_0x7974('0x33')]=_[_0x7974('0x30')](_0x4eda4b[_0x7974('0x33')]);_0x4f9437[_0x7974('0x3a')]=_[_0x7974('0x31')](_0x4f9437['model'],_0x4f9437[_0x7974('0x33')]);_0x2695ab['attributes']=_[_0x7974('0x31')](_0x4f9437['model'],qs[_0x7974('0x42')](_0x4eda4b[_0x7974('0x33')]['fields']));_0x2695ab[_0x7974('0x32')]=_0x2695ab[_0x7974('0x32')][_0x7974('0x34')]?_0x2695ab['attributes']:_0x4f9437['model'];if(!_0x4eda4b[_0x7974('0x33')][_0x7974('0x35')]('nolimit')){_0x2695ab['limit']=qs[_0x7974('0x19')](_0x4eda4b[_0x7974('0x33')][_0x7974('0x19')]);_0x2695ab[_0x7974('0x1c')]=qs[_0x7974('0x1c')](_0x4eda4b['query'][_0x7974('0x1c')]);}_0x2695ab[_0x7974('0x37')]=qs[_0x7974('0x38')](_0x4eda4b[_0x7974('0x33')][_0x7974('0x38')]);_0x2695ab[_0x7974('0x39')]=qs[_0x7974('0x3a')](_[_0x7974('0x4a')](_0x4eda4b[_0x7974('0x33')],_0x4f9437[_0x7974('0x3a')]));_0x2695ab['where'][_0x7974('0x4b')]=_0x12619c['id'];if(_0x4eda4b[_0x7974('0x33')]['filter']){_0x2695ab[_0x7974('0x39')]=_[_0x7974('0x3c')](_0x2695ab[_0x7974('0x39')],{'$or':_['map'](_0x2695ab[_0x7974('0x32')],function(_0x5c583e){var _0x153f61={};_0x153f61[_0x5c583e]={'$like':'%'+_0x4eda4b[_0x7974('0x33')][_0x7974('0x3b')]+'%'};return _0x153f61;})});}_0x2695ab=_[_0x7974('0x3c')]({},_0x2695ab,_0x4eda4b['options']);return db[_0x7974('0x49')][_0x7974('0x1b')]({'where':_0x2695ab['where']})[_0x7974('0x22')](function(_0x14c113){_0x5cbfc6['count']=_0x14c113;if(_0x4eda4b[_0x7974('0x33')][_0x7974('0x3e')]){_0x2695ab[_0x7974('0x3f')]=[{'all':!![]}];}return db[_0x7974('0x49')][_0x7974('0x4c')](_0x2695ab);})['then'](function(_0x2f1e36){_0x5cbfc6[_0x7974('0x40')]=_0x2f1e36;return _0x5cbfc6;});}})['then'](respondWithFilteredResult(_0x1e1964,_0x2695ab))[_0x7974('0x41')](handleError(_0x1e1964,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index c58ce82..7c71b64 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 _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5075,0x73));var _0x5507=function(_0xc08f00,_0x28067f){_0xc08f00=_0xc08f00-0x0;var _0x8649f7=_0x5075[_0xc08f00];return _0x8649f7;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('JscriptySessionReport',attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc4=['path','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xafc4,0x69));var _0x4afc=function(_0x533b36,_0x1d82ea){_0x533b36=_0x533b36-0x0;var _0x33560d=_0xafc4[_0x533b36];return _0x33560d;};'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('./jscriptySessionReport.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'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 b96832a..6dac5ae 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 _0x8952=['JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error'];(function(_0x1726e1,_0x1cc1f4){var _0x44eccc=function(_0x29d671){while(--_0x29d671){_0x1726e1['push'](_0x1726e1['shift']());}};_0x44eccc(++_0x1cc1f4);}(_0x8952,0x17e));var _0x2895=function(_0x30c76f,_0x5ba061){_0x30c76f=_0x30c76f-0x0;var _0x23811c=_0x8952[_0x30c76f];return _0x23811c;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ea619,_0x526c32,_0x238b4a){return new BPromise(function(_0x335002,_0x159f86){return client[_0x2895('0xb')](_0x4ea619,_0x238b4a)[_0x2895('0xc')](function(_0x4952fa){logger[_0x2895('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x526c32,_0x2895('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x526c32,'request\x20sent',JSON[_0x2895('0xf')](_0x4952fa));if(_0x4952fa[_0x2895('0x10')]){if(_0x4952fa[_0x2895('0x10')]['code']===0x1f4){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x4952fa['error'][_0x2895('0x12')]);return _0x159f86(_0x4952fa[_0x2895('0x10')]['message']);}logger['error'](_0x2895('0x11'),_0x526c32,_0x4952fa[_0x2895('0x10')]['message']);return _0x335002(_0x4952fa[_0x2895('0x10')][_0x2895('0x12')]);}else{logger[_0x2895('0xd')](_0x2895('0x11'),_0x526c32,_0x2895('0xe'));_0x335002(_0x4952fa[_0x2895('0x13')][_0x2895('0x12')]);}})[_0x2895('0x14')](function(_0x3e96d7){logger[_0x2895('0x10')](_0x2895('0x11'),_0x526c32,_0x3e96d7);_0x159f86(_0x3e96d7);});});} \ No newline at end of file +var _0x430c=['then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x430c,0x1a1));var _0xc430=function(_0x19f5fc,_0x4c658a){_0x19f5fc=_0x19f5fc-0x0;var _0x315fa3=_0x430c[_0x19f5fc];return _0x315fa3;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc430('0x1'));var rs=require(_0xc430('0x2'));var fs=require('fs');var Redis=require(_0xc430('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc430('0x4'));var jayson=require(_0xc430('0x5'));var client=jayson['client'][_0xc430('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4de44f,_0x212354,_0x2e51c6){return new BPromise(function(_0x814a90,_0x13ae66){return client[_0xc430('0x7')](_0x4de44f,_0x2e51c6)[_0xc430('0x8')](function(_0x861581){logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');logger[_0xc430('0xb')](_0xc430('0xc'),_0x212354,'request\x20sent',JSON[_0xc430('0xd')](_0x861581));if(_0x861581['error']){if(_0x861581[_0xc430('0xe')]['code']===0x1f4){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x861581[_0xc430('0xe')][_0xc430('0xf')]);return _0x13ae66(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}logger[_0xc430('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x212354,_0x861581['error'][_0xc430('0xf')]);return _0x814a90(_0x861581[_0xc430('0xe')][_0xc430('0xf')]);}else{logger[_0xc430('0x9')](_0xc430('0xa'),_0x212354,'request\x20sent');_0x814a90(_0x861581[_0xc430('0x10')]['message']);}})['catch'](function(_0x2e7987){logger[_0xc430('0xe')](_0xc430('0xa'),_0x212354,_0x2e7987);_0x13ae66(_0x2e7987);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index f971605..0df90af 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 _0x66a5=['update','isAuthenticated','downloadLogFile','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id'];(function(_0x54a3eb,_0xb59e45){var _0x206931=function(_0x29f3fb){while(--_0x29f3fb){_0x54a3eb['push'](_0x54a3eb['shift']());}};_0x206931(++_0xb59e45);}(_0x66a5,0x7b));var _0x566a=function(_0x83d08e,_0x228942){_0x83d08e=_0x83d08e-0x0;var _0x404d4f=_0x66a5[_0x83d08e];return _0x404d4f;};'use strict';var multer=require(_0x566a('0x0'));var util=require(_0x566a('0x1'));var path=require(_0x566a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x566a('0x3')]();var fs_extra=require(_0x566a('0x4'));var auth=require(_0x566a('0x5'));var interaction=require(_0x566a('0x6'));var config=require(_0x566a('0x7'));var controller=require(_0x566a('0x8'));router[_0x566a('0x9')]('/',controller[_0x566a('0xa')]);router[_0x566a('0xb')](_0x566a('0xc'),auth['isAuthenticated'](),controller[_0x566a('0xd')]);router[_0x566a('0x9')]('/download_log_file',auth[_0x566a('0xe')](),controller[_0x566a('0xf')]);module[_0x566a('0x10')]=router; \ No newline at end of file +var _0xbc7a=['express','../../config/environment','get','put','/:id','isAuthenticated','update','/download_log_file','exports','multer','util','connect-timeout'];(function(_0x3c9916,_0x53f419){var _0x58cbaf=function(_0xa64a7b){while(--_0xa64a7b){_0x3c9916['push'](_0x3c9916['shift']());}};_0x58cbaf(++_0x53f419);}(_0xbc7a,0x171));var _0xabc7=function(_0x5c5b8b,_0x5ad9bc){_0x5c5b8b=_0x5c5b8b-0x0;var _0x5b5689=_0xbc7a[_0x5c5b8b];return _0x5b5689;};'use strict';var multer=require(_0xabc7('0x0'));var util=require(_0xabc7('0x1'));var path=require('path');var timeout=require(_0xabc7('0x2'));var express=require(_0xabc7('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(_0xabc7('0x4'));var controller=require('./license.controller');router[_0xabc7('0x5')]('/',controller['index']);router[_0xabc7('0x6')](_0xabc7('0x7'),auth[_0xabc7('0x8')](),controller[_0xabc7('0x9')]);router[_0xabc7('0x5')](_0xabc7('0xa'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0xabc7('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 847fe88..4860826 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 _0xc1e4=['exports','TEXT','STRING','INTEGER'];(function(_0x421526,_0x368eca){var _0xc44c07=function(_0x31b0cc){while(--_0x31b0cc){_0x421526['push'](_0x421526['shift']());}};_0xc44c07(++_0x368eca);}(_0xc1e4,0x104));var _0x4c1e=function(_0x518b69,_0x12758d){_0x518b69=_0x518b69-0x0;var _0x47604e=_0xc1e4[_0x518b69];return _0x47604e;};'use strict';var Sequelize=require('sequelize');module[_0x4c1e('0x0')]={'license':{'type':Sequelize[_0x4c1e('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x4c1e('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x4c1e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc277=['INTEGER','sequelize','exports','STRING'];(function(_0x1c3e9c,_0x1e6694){var _0x2761b5=function(_0x5600a0){while(--_0x5600a0){_0x1c3e9c['push'](_0x1c3e9c['shift']());}};_0x2761b5(++_0x1e6694);}(_0xc277,0xb9));var _0x7c27=function(_0x4fb72f,_0x29566d){_0x4fb72f=_0x4fb72f-0x0;var _0x2fe429=_0xc277[_0x4fb72f];return _0x2fe429;};'use strict';var Sequelize=require(_0x7c27('0x0'));module[_0x7c27('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x7c27('0x2')]},'data2':{'type':Sequelize[_0x7c27('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x7c27('0x3')],'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 4290815..8a4974a 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 _0x11be=['set','Content-Range','reject','save','update','then','destroy','stack','name','send','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','merge','options','getLicense','catch','body','find','params','get','key','demo','license-info.log','join','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','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','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x11eadc,_0x155efe){var _0x253972=function(_0x395109){while(--_0x395109){_0x11eadc['push'](_0x11eadc['shift']());}};_0x253972(++_0x155efe);}(_0x11be,0x67));var _0xe11b=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x11be[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0xe11b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe11b('0x1'));var moment=require(_0xe11b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe11b('0x3'));var util=require(_0xe11b('0x4'));var path=require(_0xe11b('0x5'));var sox=require(_0xe11b('0x6'));var csv=require(_0xe11b('0x7'));var ejs=require(_0xe11b('0x8'));var fs=require('fs');var fs_extra=require(_0xe11b('0x9'));var _=require(_0xe11b('0xa'));var squel=require('squel');var crypto=require(_0xe11b('0xb'));var jsforce=require(_0xe11b('0xc'));var deskjs=require(_0xe11b('0xd'));var toCsv=require(_0xe11b('0x7'));var querystring=require(_0xe11b('0xe'));var Papa=require(_0xe11b('0xf'));var Redis=require(_0xe11b('0x10'));var authService=require(_0xe11b('0x11'));var qs=require(_0xe11b('0x12'));var as=require(_0xe11b('0x13'));var hardwareService=require(_0xe11b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xe11b('0x15'));var config=require(_0xe11b('0x16'));var licenseUtil=require(_0xe11b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd647f7,_0x118809){_0x118809=_0x118809||0xcc;return function(_0x1120d3){if(_0x1120d3){return _0xd647f7[_0xe11b('0x18')](_0x118809);}return _0xd647f7[_0xe11b('0x19')](_0x118809)['end']();};}function respondWithResult(_0x2aa21e,_0x98313c){_0x98313c=_0x98313c||0xc8;return function(_0x5b6fbe){if(_0x5b6fbe){return _0x2aa21e[_0xe11b('0x19')](_0x98313c)[_0xe11b('0x1a')](_0x5b6fbe);}};}function respondWithFilteredResult(_0x251d5f,_0x4b2de4){return function(_0x574251){if(_0x574251){var _0x50cf9a=typeof _0x4b2de4[_0xe11b('0x1b')]===_0xe11b('0x1c')&&typeof _0x4b2de4[_0xe11b('0x1d')]===_0xe11b('0x1c');var _0x1b4292=_0x574251[_0xe11b('0x1e')];var _0x3bdefb=_0x50cf9a?0x0:_0x4b2de4[_0xe11b('0x1b')];var _0xd2986=_0x50cf9a?_0x574251['count']:_0x4b2de4[_0xe11b('0x1b')]+_0x4b2de4['limit'];var _0x298a06;if(_0xd2986>=_0x1b4292){_0xd2986=_0x1b4292;_0x298a06=0xc8;}else{_0x298a06=0xce;}_0x251d5f['status'](_0x298a06);return _0x251d5f[_0xe11b('0x1f')](_0xe11b('0x20'),_0x3bdefb+'-'+_0xd2986+'/'+_0x1b4292)[_0xe11b('0x1a')](_0x574251);}return null;};}function patchUpdates(_0x18ce2a){return function(_0x201b90){try{jsonpatch['apply'](_0x201b90,_0x18ce2a,!![]);}catch(_0xdee4f0){return BPromise[_0xe11b('0x21')](_0xdee4f0);}return _0x201b90[_0xe11b('0x22')]();};}function saveUpdates(_0x38c680,_0x1816e2){return function(_0x1b18c5){if(_0x1b18c5){return _0x1b18c5[_0xe11b('0x23')](_0x38c680)[_0xe11b('0x24')](function(_0x1475e6){return _0x1475e6;});}return null;};}function removeEntity(_0xce5e52,_0x1b3567){return function(_0x1975f9){if(_0x1975f9){return _0x1975f9[_0xe11b('0x25')]()[_0xe11b('0x24')](function(){_0xce5e52[_0xe11b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27b94d,_0x10d872){return function(_0x447c58){if(!_0x447c58){_0x27b94d[_0xe11b('0x18')](0x194);}return _0x447c58;};}function handleError(_0x5e7336,_0x6a3ffd){_0x6a3ffd=_0x6a3ffd||0x1f4;return function(_0x302d6e){logger['error'](_0x302d6e[_0xe11b('0x26')]);if(_0x302d6e[_0xe11b('0x27')]){delete _0x302d6e[_0xe11b('0x27')];}_0x5e7336['status'](_0x6a3ffd)[_0xe11b('0x28')](_0x302d6e);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x3ead2d,_0x4aefdc){var _0x1be8e9={'raw':!![],'where':{'id':0x1}},_0x4c8b1f={};_0x4c8b1f[_0xe11b('0x29')]=_[_0xe11b('0x2a')](db[_0xe11b('0x2b')][_0xe11b('0x2c')]);_0x4c8b1f[_0xe11b('0x2d')]=_['keys'](_0x3ead2d[_0xe11b('0x2d')]);_0x4c8b1f[_0xe11b('0x2e')]=_['intersection'](_0x4c8b1f[_0xe11b('0x29')],_0x4c8b1f[_0xe11b('0x2d')]);_0x1be8e9[_0xe11b('0x2f')]=_[_0xe11b('0x30')](_0x4c8b1f[_0xe11b('0x29')],qs[_0xe11b('0x31')](_0x3ead2d[_0xe11b('0x2d')][_0xe11b('0x31')]));_0x1be8e9[_0xe11b('0x2f')]=_0x1be8e9[_0xe11b('0x2f')]['length']?_0x1be8e9[_0xe11b('0x2f')]:_0x4c8b1f[_0xe11b('0x29')];_0x1be8e9=_[_0xe11b('0x32')]({},_0x1be8e9,_0x3ead2d[_0xe11b('0x33')]);return utilLicense[_0xe11b('0x34')](_0x1be8e9)[_0xe11b('0x24')](respondWithResult(_0x4aefdc,null))[_0xe11b('0x35')](handleError(_0x4aefdc,null));};exports[_0xe11b('0x23')]=function(_0x57eb05,_0x57cf48){if(_0x57eb05[_0xe11b('0x36')]['id']){delete _0x57eb05[_0xe11b('0x36')]['id'];}return db[_0xe11b('0x2b')][_0xe11b('0x37')]({'where':{'id':_0x57eb05[_0xe11b('0x38')]['id']}})[_0xe11b('0x24')](handleEntityNotFound(_0x57cf48,null))[_0xe11b('0x24')](function(_0x485ae1){var _0x56d985=_0x485ae1[_0xe11b('0x39')]({'plain':!![]});return utilLicense['checkLicense'](_0x56d985,_0x57eb05[_0xe11b('0x36')][_0xe11b('0x3a')]);})['then'](function(_0x4ba582){if(!_0x4ba582[_0xe11b('0x3b')]){return saveUpdates(_0x57eb05[_0xe11b('0x36')],null);}return _0x4ba582;})['then'](respondWithResult(_0x57cf48,null))['catch'](handleError(_0x57cf48,null));};exports['downloadLogFile']=function(_0x409658,_0x119119){var _0xc12ec3=_0xe11b('0x3c');var _0x378601=path[_0xe11b('0x3d')]('/var',_0xe11b('0x3e'),'xcally',_0xc12ec3);_0x119119[_0xe11b('0x3f')](_0xe11b('0x40'),_0xe11b('0x41')+_0xc12ec3);_0x119119['set'](_0xe11b('0x42'),'text/plain');_0x119119['download'](_0x378601);}; \ No newline at end of file +var _0x8c94=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','error','name','../../config/license/util','index','model','License','query','keys','filters','intersection','attributes','fields','length','merge','getLicense','body','find','params','checkLicense','demo','catch','downloadLogFile','license-info.log','/var','xcally','setHeader','Content-disposition','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8c94,0x186));var _0x48c9=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8c94[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0x48c9('0x0'));var rimraf=require(_0x48c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48c9('0x2'));var rp=require(_0x48c9('0x3'));var moment=require(_0x48c9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x48c9('0x5'));var util=require('util');var path=require(_0x48c9('0x6'));var sox=require('sox');var csv=require(_0x48c9('0x7'));var ejs=require(_0x48c9('0x8'));var fs=require('fs');var fs_extra=require(_0x48c9('0x9'));var _=require(_0x48c9('0xa'));var squel=require(_0x48c9('0xb'));var crypto=require(_0x48c9('0xc'));var jsforce=require(_0x48c9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x48c9('0x7'));var querystring=require(_0x48c9('0xe'));var Papa=require(_0x48c9('0xf'));var Redis=require(_0x48c9('0x10'));var authService=require(_0x48c9('0x11'));var qs=require(_0x48c9('0x12'));var as=require(_0x48c9('0x13'));var hardwareService=require(_0x48c9('0x14'));var logger=require(_0x48c9('0x15'))(_0x48c9('0x16'));var utils=require(_0x48c9('0x17'));var config=require(_0x48c9('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x48c9('0x19'))['db'];function respondWithStatusCode(_0x2ed089,_0x400ba3){_0x400ba3=_0x400ba3||0xcc;return function(_0x36b932){if(_0x36b932){return _0x2ed089[_0x48c9('0x1a')](_0x400ba3);}return _0x2ed089[_0x48c9('0x1b')](_0x400ba3)[_0x48c9('0x1c')]();};}function respondWithResult(_0x1abc6b,_0x46f607){_0x46f607=_0x46f607||0xc8;return function(_0x1a140f){if(_0x1a140f){return _0x1abc6b[_0x48c9('0x1b')](_0x46f607)[_0x48c9('0x1d')](_0x1a140f);}};}function respondWithFilteredResult(_0xe82eff,_0xf82bd0){return function(_0x21d286){if(_0x21d286){var _0x8aee52=typeof _0xf82bd0['offset']===_0x48c9('0x1e')&&typeof _0xf82bd0[_0x48c9('0x1f')]===_0x48c9('0x1e');var _0x1d42a6=_0x21d286[_0x48c9('0x20')];var _0x5b0286=_0x8aee52?0x0:_0xf82bd0[_0x48c9('0x21')];var _0x20ca79=_0x8aee52?_0x21d286[_0x48c9('0x20')]:_0xf82bd0[_0x48c9('0x21')]+_0xf82bd0[_0x48c9('0x1f')];var _0x5de38b;if(_0x20ca79>=_0x1d42a6){_0x20ca79=_0x1d42a6;_0x5de38b=0xc8;}else{_0x5de38b=0xce;}_0xe82eff[_0x48c9('0x1b')](_0x5de38b);return _0xe82eff['set'](_0x48c9('0x22'),_0x5b0286+'-'+_0x20ca79+'/'+_0x1d42a6)[_0x48c9('0x1d')](_0x21d286);}return null;};}function patchUpdates(_0x435820){return function(_0x2a5ebf){try{jsonpatch[_0x48c9('0x23')](_0x2a5ebf,_0x435820,!![]);}catch(_0x154457){return BPromise['reject'](_0x154457);}return _0x2a5ebf[_0x48c9('0x24')]();};}function saveUpdates(_0x354bfa,_0x20268b){return function(_0x191e35){if(_0x191e35){return _0x191e35[_0x48c9('0x25')](_0x354bfa)[_0x48c9('0x26')](function(_0x5bed8d){return _0x5bed8d;});}return null;};}function removeEntity(_0x327a86,_0x19a090){return function(_0x307919){if(_0x307919){return _0x307919['destroy']()[_0x48c9('0x26')](function(){_0x327a86[_0x48c9('0x1b')](0xcc)[_0x48c9('0x1c')]();});}};}function handleEntityNotFound(_0x1c391b,_0x59d248){return function(_0x33447e){if(!_0x33447e){_0x1c391b['sendStatus'](0x194);}return _0x33447e;};}function handleError(_0x52466a,_0x41b35f){_0x41b35f=_0x41b35f||0x1f4;return function(_0x1cb296){logger[_0x48c9('0x27')](_0x1cb296['stack']);if(_0x1cb296[_0x48c9('0x28')]){delete _0x1cb296['name'];}_0x52466a[_0x48c9('0x1b')](_0x41b35f)['send'](_0x1cb296);};}var utilLicense=require(_0x48c9('0x29'));exports[_0x48c9('0x2a')]=function(_0x111d07,_0x3268ac){var _0x2ead4c={'raw':!![],'where':{'id':0x1}},_0x5bf9ad={};_0x5bf9ad[_0x48c9('0x2b')]=_['keys'](db[_0x48c9('0x2c')]['rawAttributes']);_0x5bf9ad[_0x48c9('0x2d')]=_[_0x48c9('0x2e')](_0x111d07['query']);_0x5bf9ad[_0x48c9('0x2f')]=_[_0x48c9('0x30')](_0x5bf9ad[_0x48c9('0x2b')],_0x5bf9ad['query']);_0x2ead4c[_0x48c9('0x31')]=_[_0x48c9('0x30')](_0x5bf9ad[_0x48c9('0x2b')],qs['fields'](_0x111d07['query'][_0x48c9('0x32')]));_0x2ead4c['attributes']=_0x2ead4c['attributes'][_0x48c9('0x33')]?_0x2ead4c[_0x48c9('0x31')]:_0x5bf9ad[_0x48c9('0x2b')];_0x2ead4c=_[_0x48c9('0x34')]({},_0x2ead4c,_0x111d07['options']);return utilLicense[_0x48c9('0x35')](_0x2ead4c)[_0x48c9('0x26')](respondWithResult(_0x3268ac,null))['catch'](handleError(_0x3268ac,null));};exports['update']=function(_0x36c33d,_0x11dd7e){if(_0x36c33d[_0x48c9('0x36')]['id']){delete _0x36c33d[_0x48c9('0x36')]['id'];}return db[_0x48c9('0x2c')][_0x48c9('0x37')]({'where':{'id':_0x36c33d[_0x48c9('0x38')]['id']}})['then'](handleEntityNotFound(_0x11dd7e,null))[_0x48c9('0x26')](function(_0x2d3a6e){var _0x11b98d=_0x2d3a6e['get']({'plain':!![]});return utilLicense[_0x48c9('0x39')](_0x11b98d,_0x36c33d[_0x48c9('0x36')]['key']);})['then'](function(_0x352508){if(!_0x352508[_0x48c9('0x3a')]){return saveUpdates(_0x36c33d['body'],null);}return _0x352508;})[_0x48c9('0x26')](respondWithResult(_0x11dd7e,null))[_0x48c9('0x3b')](handleError(_0x11dd7e,null));};exports[_0x48c9('0x3c')]=function(_0x88dd4d,_0x578438){var _0x13c0c2=_0x48c9('0x3d');var _0x5e7005=path['join'](_0x48c9('0x3e'),'log',_0x48c9('0x3f'),_0x13c0c2);_0x578438[_0x48c9('0x40')](_0x48c9('0x41'),'attachment;\x20filename='+_0x13c0c2);_0x578438['set']('Content-Type',_0x48c9('0x42'));_0x578438[_0x48c9('0x43')](_0x5e7005);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 023add2..cbed297 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 _0x9156=['License','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','define'];(function(_0x3e8d78,_0xef4524){var _0x50532d=function(_0x358963){while(--_0x358963){_0x3e8d78['push'](_0x3e8d78['shift']());}};_0x50532d(++_0xef4524);}(_0x9156,0x155));var _0x6915=function(_0x537b82,_0x1ec5d7){_0x537b82=_0x537b82-0x0;var _0x5863ad=_0x9156[_0x537b82];return _0x5863ad;};'use strict';var _=require(_0x6915('0x0'));var util=require(_0x6915('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6915('0x2'));var BPromise=require('bluebird');var rp=require(_0x6915('0x3'));var fs=require('fs');var path=require(_0x6915('0x4'));var rimraf=require(_0x6915('0x5'));var config=require(_0x6915('0x6'));var attributes=require(_0x6915('0x7'));module['exports']=function(_0x5eec15,_0x44951f){return _0x5eec15[_0x6915('0x8')](_0x6915('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf433=['define','License','lodash','util','api','bluebird','path','../../config/environment','./license.attributes'];(function(_0x4194d2,_0x22db8d){var _0x3a6415=function(_0x522413){while(--_0x522413){_0x4194d2['push'](_0x4194d2['shift']());}};_0x3a6415(++_0x22db8d);}(_0xf433,0x1cd));var _0x3f43=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf433[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3f43('0x0'));var util=require(_0x3f43('0x1'));var logger=require('../../config/logger')(_0x3f43('0x2'));var moment=require('moment');var BPromise=require(_0x3f43('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f43('0x4'));var rimraf=require('rimraf');var config=require(_0x3f43('0x5'));var attributes=require(_0x3f43('0x6'));module['exports']=function(_0x487dde,_0x307093){return _0x487dde[_0x3f43('0x7')](_0x3f43('0x8'),attributes,{'tableName':'license','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 ce78ae7..b1ee2b6 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 _0x32e2=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','info','result','catch','lodash','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32e2,0xf0));var _0x232e=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x32e2[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x232e('0x0'));var util=require('util');var moment=require(_0x232e('0x1'));var BPromise=require(_0x232e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x232e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x232e('0x4'));var logger=require(_0x232e('0x5'))(_0x232e('0x6'));var config=require(_0x232e('0x7'));var jayson=require(_0x232e('0x8'));var client=jayson[_0x232e('0x9')][_0x232e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9ae8d5,_0x32d3bc,_0x3ff6b4){return new BPromise(function(_0x121c56,_0x536992){return client['request'](_0x9ae8d5,_0x3ff6b4)[_0x232e('0xb')](function(_0x2ecaf8){logger['info']('License,\x20%s,\x20%s',_0x32d3bc,_0x232e('0xc'));logger[_0x232e('0xd')](_0x232e('0xe'),_0x32d3bc,'request\x20sent',JSON[_0x232e('0xf')](_0x2ecaf8));if(_0x2ecaf8[_0x232e('0x10')]){if(_0x2ecaf8[_0x232e('0x10')]['code']===0x1f4){logger['error'](_0x232e('0x11'),_0x32d3bc,_0x2ecaf8[_0x232e('0x10')][_0x232e('0x12')]);return _0x536992(_0x2ecaf8['error'][_0x232e('0x12')]);}logger['error'](_0x232e('0x11'),_0x32d3bc,_0x2ecaf8[_0x232e('0x10')]['message']);return _0x121c56(_0x2ecaf8['error']['message']);}else{logger[_0x232e('0x13')](_0x232e('0x11'),_0x32d3bc,_0x232e('0xc'));_0x121c56(_0x2ecaf8[_0x232e('0x14')][_0x232e('0x12')]);}})[_0x232e('0x15')](function(_0x22c335){logger[_0x232e('0x10')](_0x232e('0x11'),_0x32d3bc,_0x22c335);_0x536992(_0x22c335);});});} \ No newline at end of file +var _0x519a=['randomstring','jayson/promise','http','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','License,\x20%s,\x20%s','message','catch','util','moment','bluebird'];(function(_0x1f5c77,_0x3821d8){var _0x36f69c=function(_0x373ca1){while(--_0x373ca1){_0x1f5c77['push'](_0x1f5c77['shift']());}};_0x36f69c(++_0x3821d8);}(_0x519a,0xc0));var _0xa519=function(_0x12ca5f,_0x223d98){_0x12ca5f=_0x12ca5f-0x0;var _0xfc3ae9=_0x519a[_0x12ca5f];return _0xfc3ae9;};'use strict';var _=require('lodash');var util=require(_0xa519('0x0'));var moment=require(_0xa519('0x1'));var BPromise=require(_0xa519('0x2'));var rs=require(_0xa519('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa519('0x4'));var client=jayson['client'][_0xa519('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x56add2,_0xf91580,_0x4e4fc1){return new BPromise(function(_0x28d544,_0xd42592){return client['request'](_0x56add2,_0x4e4fc1)[_0xa519('0x6')](function(_0x5009dc){logger[_0xa519('0x7')]('License,\x20%s,\x20%s',_0xf91580,_0xa519('0x8'));logger['debug'](_0xa519('0x9'),_0xf91580,_0xa519('0x8'),JSON[_0xa519('0xa')](_0x5009dc));if(_0x5009dc[_0xa519('0xb')]){if(_0x5009dc['error']['code']===0x1f4){logger[_0xa519('0xb')](_0xa519('0xc'),_0xf91580,_0x5009dc[_0xa519('0xb')][_0xa519('0xd')]);return _0xd42592(_0x5009dc[_0xa519('0xb')][_0xa519('0xd')]);}logger[_0xa519('0xb')](_0xa519('0xc'),_0xf91580,_0x5009dc['error'][_0xa519('0xd')]);return _0x28d544(_0x5009dc['error']['message']);}else{logger[_0xa519('0x7')](_0xa519('0xc'),_0xf91580,_0xa519('0x8'));_0x28d544(_0x5009dc['result']['message']);}})[_0xa519('0xe')](function(_0x31ec60){logger[_0xa519('0xb')](_0xa519('0xc'),_0xf91580,_0x31ec60);_0xd42592(_0x31ec60);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 7440440..2cb3cb5 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 _0x7a43=['removeDispositions','removeAnswers','removeSmtp','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0x7a43,0x137));var _0x37a4=function(_0x2f12eb,_0x1be312){_0x2f12eb=_0x2f12eb-0x0;var _0x334308=_0x7a43[_0x2f12eb];return _0x334308;};'use strict';var multer=require(_0x37a4('0x0'));var util=require(_0x37a4('0x1'));var path=require(_0x37a4('0x2'));var timeout=require(_0x37a4('0x3'));var express=require(_0x37a4('0x4'));var router=express[_0x37a4('0x5')]();var fs_extra=require(_0x37a4('0x6'));var auth=require(_0x37a4('0x7'));var interaction=require(_0x37a4('0x8'));var config=require(_0x37a4('0x9'));var controller=require(_0x37a4('0xa'));router[_0x37a4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x37a4('0xb')](_0x37a4('0xc'),auth[_0x37a4('0xd')](),controller['describe']);router[_0x37a4('0xb')](_0x37a4('0xe'),auth[_0x37a4('0xd')](),controller[_0x37a4('0xf')]);router[_0x37a4('0xb')](_0x37a4('0x10'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x11')]);router[_0x37a4('0xb')](_0x37a4('0x12'),auth['isAuthenticated'](),controller[_0x37a4('0x13')]);router[_0x37a4('0xb')](_0x37a4('0x14'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x15')]);router[_0x37a4('0xb')](_0x37a4('0x16'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x17')]);router[_0x37a4('0xb')]('/:id/interactions',auth[_0x37a4('0xd')](),controller['getInteractions']);router['get'](_0x37a4('0x18'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x19')]);router[_0x37a4('0xb')](_0x37a4('0x1a'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x1b')]);router[_0x37a4('0xb')](_0x37a4('0x1c'),auth[_0x37a4('0xd')](),controller['verifySmtp']);router[_0x37a4('0xb')](_0x37a4('0x1d'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x1e')]);router[_0x37a4('0x1f')](_0x37a4('0x10'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x20')]);router[_0x37a4('0x1f')](_0x37a4('0x12'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x21')]);router[_0x37a4('0x1f')]('/',auth[_0x37a4('0xd')](),controller[_0x37a4('0x22')]);router[_0x37a4('0x1f')](_0x37a4('0x14'),auth['isAuthenticated'](),controller[_0x37a4('0x23')]);router[_0x37a4('0x1f')](_0x37a4('0x16'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x24')]);router[_0x37a4('0x1f')](_0x37a4('0x25'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x26')]);router[_0x37a4('0x1f')]('/:id/applications',auth[_0x37a4('0xd')](),controller[_0x37a4('0x27')]);router['post'](_0x37a4('0x28'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x29')]);router[_0x37a4('0x1f')](_0x37a4('0x1d'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x2a')]);router[_0x37a4('0x2b')]('/:id',auth[_0x37a4('0xd')](),controller[_0x37a4('0x2c')]);router[_0x37a4('0x2d')](_0x37a4('0x10'),auth[_0x37a4('0xd')](),controller[_0x37a4('0x2e')]);router[_0x37a4('0x2d')]('/:id/canned_answers',auth[_0x37a4('0xd')](),controller[_0x37a4('0x2f')]);router[_0x37a4('0x2d')](_0x37a4('0x14'),auth[_0x37a4('0xd')](),controller['removeImap']);router[_0x37a4('0x2d')]('/:id/out_servers',auth[_0x37a4('0xd')](),controller[_0x37a4('0x30')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x37a4('0x31')]);router[_0x37a4('0x2d')](_0x37a4('0x1d'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x37a4('0x32')]=router; \ No newline at end of file +var _0x9674=['/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','create','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeImap','removeSmtp','destroy','/:id/users','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post'];(function(_0x471552,_0x27a000){var _0x186c68=function(_0x1dea7a){while(--_0x1dea7a){_0x471552['push'](_0x471552['shift']());}};_0x186c68(++_0x27a000);}(_0x9674,0x16d));var _0x4967=function(_0x53c493,_0x425909){_0x53c493=_0x53c493-0x0;var _0x1478ab=_0x9674[_0x53c493];return _0x1478ab;};'use strict';var multer=require(_0x4967('0x0'));var util=require('util');var path=require(_0x4967('0x1'));var timeout=require(_0x4967('0x2'));var express=require(_0x4967('0x3'));var router=express[_0x4967('0x4')]();var fs_extra=require(_0x4967('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4967('0x6'));var controller=require('./mailAccount.controller');router[_0x4967('0x7')]('/',auth[_0x4967('0x8')](),controller[_0x4967('0x9')]);router[_0x4967('0x7')](_0x4967('0xa'),auth[_0x4967('0x8')](),controller[_0x4967('0xb')]);router[_0x4967('0x7')](_0x4967('0xc'),auth['isAuthenticated'](),controller[_0x4967('0xd')]);router[_0x4967('0x7')]('/:id/dispositions',auth[_0x4967('0x8')](),controller[_0x4967('0xe')]);router[_0x4967('0x7')]('/:id/canned_answers',auth[_0x4967('0x8')](),controller[_0x4967('0xf')]);router[_0x4967('0x7')]('/:id/in_servers',auth[_0x4967('0x8')](),controller['getImap']);router[_0x4967('0x7')](_0x4967('0x10'),auth[_0x4967('0x8')](),controller[_0x4967('0x11')]);router[_0x4967('0x7')]('/:id/interactions',auth[_0x4967('0x8')](),controller[_0x4967('0x12')]);router[_0x4967('0x7')](_0x4967('0x13'),auth[_0x4967('0x8')](),controller[_0x4967('0x14')]);router[_0x4967('0x7')](_0x4967('0x15'),auth['isAuthenticated'](),controller[_0x4967('0x16')]);router[_0x4967('0x7')](_0x4967('0x17'),auth['isAuthenticated'](),controller[_0x4967('0x18')]);router[_0x4967('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0x4967('0x19')]);router[_0x4967('0x1a')](_0x4967('0x1b'),auth[_0x4967('0x8')](),controller[_0x4967('0x1c')]);router[_0x4967('0x1a')](_0x4967('0x1d'),auth['isAuthenticated'](),controller[_0x4967('0x1e')]);router[_0x4967('0x1a')]('/',auth[_0x4967('0x8')](),controller[_0x4967('0x1f')]);router[_0x4967('0x1a')]('/:id/in_servers',auth[_0x4967('0x8')](),controller['addImap']);router['post'](_0x4967('0x10'),auth[_0x4967('0x8')](),controller[_0x4967('0x20')]);router[_0x4967('0x1a')](_0x4967('0x21'),auth[_0x4967('0x8')](),controller[_0x4967('0x22')]);router[_0x4967('0x1a')](_0x4967('0x13'),auth[_0x4967('0x8')](),controller[_0x4967('0x23')]);router[_0x4967('0x1a')](_0x4967('0x24'),auth[_0x4967('0x8')](),controller['send']);router['post']('/:id/users',auth[_0x4967('0x8')](),controller[_0x4967('0x25')]);router[_0x4967('0x26')](_0x4967('0xc'),auth[_0x4967('0x8')](),controller[_0x4967('0x27')]);router[_0x4967('0x28')](_0x4967('0x1b'),auth[_0x4967('0x8')](),controller[_0x4967('0x29')]);router[_0x4967('0x28')](_0x4967('0x1d'),auth[_0x4967('0x8')](),controller[_0x4967('0x2a')]);router[_0x4967('0x28')](_0x4967('0x2b'),auth[_0x4967('0x8')](),controller[_0x4967('0x2c')]);router[_0x4967('0x28')](_0x4967('0x10'),auth[_0x4967('0x8')](),controller[_0x4967('0x2d')]);router[_0x4967('0x28')](_0x4967('0xc'),auth[_0x4967('0x8')](),controller[_0x4967('0x2e')]);router[_0x4967('0x28')](_0x4967('0x2f'),auth[_0x4967('0x8')](),controller[_0x4967('0x30')]);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 6606ff3..b1f6539 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 _0xf68a=['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','mandatoryDisposition','hotmail','outlook365','getDataValue','provider','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0xe38dbe,_0x2648a7){var _0x536f04=function(_0x2867be){while(--_0x2867be){_0xe38dbe['push'](_0xe38dbe['shift']());}};_0x536f04(++_0x2648a7);}(_0xf68a,0x104));var _0xaf68=function(_0x463ddb,_0xae9b68){_0x463ddb=_0x463ddb-0x0;var _0x3b07ce=_0xf68a[_0x463ddb];return _0x3b07ce;};'use strict';var Sequelize=require(_0xaf68('0x0'));module['exports']={'description':{'type':Sequelize[_0xaf68('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xaf68('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xaf68('0x4')](0x2)[_0xaf68('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xaf68('0x3')],'defaultValue':function(){return _0xaf68('0x6');}},'notificationSound':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaf68('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaf68('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xaf68('0x2')],'defaultValue':![],'comment':_0xaf68('0x7'),'set':function(_0x332fcd){if(!_0x332fcd)this[_0xaf68('0x8')]('mandatoryDispositionPauseId',null);this[_0xaf68('0x8')](_0xaf68('0x9'),_0x332fcd);}},'provider':{'type':Sequelize['ENUM']('gmail',_0xaf68('0xa'),'yahoo',_0xaf68('0xb')),'defaultValue':null,'get':function(){var _0x32229a=this[_0xaf68('0xc')]('provider');return _0x32229a||'custom';},'set':function(_0x27b854){if(_0x27b854==='custom'){_0x27b854=null;}return this[_0xaf68('0x8')](_0xaf68('0xd'),_0x27b854);}}}; \ No newline at end of file +var _0xbfe7=['getDataValue','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','gmail','hotmail','yahoo','outlook365'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xbfe7,0x9c));var _0x7bfe=function(_0x100f20,_0x35fce9){_0x100f20=_0x100f20-0x0;var _0x24984d=_0xbfe7[_0x100f20];return _0x24984d;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7bfe('0x0')]},'name':{'type':Sequelize[_0x7bfe('0x0')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x7bfe('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x7bfe('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x7bfe('0x2')]},'markAsUnread':{'type':Sequelize[_0x7bfe('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x7bfe('0x0')],'allowNull':![],'defaultValue':_0x7bfe('0x3')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x7bfe('0x2')],'defaultValue':function(){return _0x7bfe('0x4');}},'notificationSound':{'type':Sequelize[_0x7bfe('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7bfe('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7bfe('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7bfe('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7bfe('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7bfe('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7bfe('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7bfe('0x6'),'set':function(_0xce0bae){if(!_0xce0bae)this['setDataValue'](_0x7bfe('0x7'),null);this[_0x7bfe('0x8')](_0x7bfe('0x9'),_0xce0bae);}},'provider':{'type':Sequelize['ENUM'](_0x7bfe('0xa'),_0x7bfe('0xb'),_0x7bfe('0xc'),_0x7bfe('0xd')),'defaultValue':null,'get':function(){var _0x373aea=this[_0x7bfe('0xe')](_0x7bfe('0xf'));return _0x373aea||_0x7bfe('0x10');},'set':function(_0x1c7b6b){if(_0x1c7b6b===_0x7bfe('0x10')){_0x1c7b6b=null;}return this['setDataValue']('provider',_0x1c7b6b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index ba76fcc..8125b2b 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 _0x978c=['addAgents','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','lodash','juice','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','MailAccounts','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp-mail.outlook.com','password','pass','CloudProviderId','host','port','secure','service','authentication','user','username','Imap','index','Smtp','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','find','body','provider','custom','modernAuthentication','describe','addDisposition','MailAccountId','Disposition','create','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','isNil','active','description','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','removeImap','setImap','getSmtp','removeSmtp','addInteraction','getInteractions','MailInteraction','Contact','Owner','fullname','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmContact','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List','List\x20not\x20found','Contacts','messageId','subject','attach','out','Messages','VerifySmtp','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account'];(function(_0x284c77,_0xe71aea){var _0x49a322=function(_0xb598d){while(--_0xb598d){_0x284c77['push'](_0x284c77['shift']());}};_0x49a322(++_0xe71aea);}(_0x978c,0xc4));var _0xc978=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x978c[_0x43d11d];return _0x38cd08;};'use strict';var moment=require(_0xc978('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var _=require(_0xc978('0x1'));var juice=require(_0xc978('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc978('0x3'))(_0xc978('0x4'));var config=require(_0xc978('0x5'));var db=require(_0xc978('0x6'))['db'];config[_0xc978('0x7')]=_[_0xc978('0x8')](config[_0xc978('0x7')],{'host':_0xc978('0x9'),'port':0x18eb});var socket=require(_0xc978('0xa'))(new Redis(config['redis']));require(_0xc978('0xb'))[_0xc978('0xc')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x1f0587,_0x574707,_0x1094cc,_0x33ebee){return new BPromise(function(_0x398c49,_0x1d83dd){var _0x274144=_0x33ebee||client;return _0x274144[_0xc978('0xd')](_0x1f0587,_0x1094cc)[_0xc978('0xe')](function(_0x30d1c9){logger[_0xc978('0xf')](_0xc978('0x10'),_0x574707,_0xc978('0x11'));logger[_0xc978('0x12')](_0xc978('0x13'),_0x574707,_0xc978('0x11'),JSON['stringify'](_0x30d1c9));if(_0x30d1c9[_0xc978('0x14')]){if(_0x30d1c9[_0xc978('0x14')][_0xc978('0x15')]===0x1f4){logger['error'](_0xc978('0x10'),_0x574707,_0x30d1c9[_0xc978('0x14')][_0xc978('0x16')]);return _0x1d83dd(_0x30d1c9[_0xc978('0x14')][_0xc978('0x16')]);}logger[_0xc978('0x14')](_0xc978('0x10'),_0x574707,_0x30d1c9[_0xc978('0x14')]['message']);return _0x398c49(_0x30d1c9[_0xc978('0x14')]['message']);}else{logger['info'](_0xc978('0x10'),_0x574707,_0xc978('0x11'));_0x398c49(_0x30d1c9['result'][_0xc978('0x16')]);}})['catch'](function(_0x4059af){logger['error'](_0xc978('0x10'),_0x574707,_0x4059af);_0x1d83dd(_0x4059af);});});}function respondWithStatusCode(_0x27dd46,_0x22338c){_0x22338c=_0x22338c||0xcc;return function(_0x5a6d5b){if(_0x5a6d5b){return _0x27dd46[_0xc978('0x17')](_0x22338c);}return _0x27dd46[_0xc978('0x18')](_0x22338c)[_0xc978('0x19')]();};}function respondWithResult(_0x18fc03,_0x11a722){_0x11a722=_0x11a722||0xc8;return function(_0x1da50b){if(_0x1da50b){return _0x18fc03[_0xc978('0x18')](_0x11a722)[_0xc978('0x1a')](_0x1da50b);}};}function respondWithFilteredResult(_0x422332,_0x2a581e){return function(_0x2b97fc){if(_0x2b97fc){var _0x57639a=typeof _0x2a581e[_0xc978('0x1b')]===_0xc978('0x1c')&&typeof _0x2a581e[_0xc978('0x1d')]===_0xc978('0x1c');var _0x4d430d=_0x2b97fc[_0xc978('0x1e')];var _0x46323b=_0x57639a?0x0:_0x2a581e[_0xc978('0x1b')];var _0x4cc1a9=_0x57639a?_0x2b97fc[_0xc978('0x1e')]:_0x2a581e[_0xc978('0x1b')]+_0x2a581e[_0xc978('0x1d')];var _0x402807;if(_0x4cc1a9>=_0x4d430d){_0x4cc1a9=_0x4d430d;_0x402807=0xc8;}else{_0x402807=0xce;}_0x422332[_0xc978('0x18')](_0x402807);return _0x422332[_0xc978('0x1f')](_0xc978('0x20'),_0x46323b+'-'+_0x4cc1a9+'/'+_0x4d430d)[_0xc978('0x1a')](_0x2b97fc);}return null;};}function saveUpdates(_0x48af17){return function(_0x236070){if(_0x236070){return _0x236070[_0xc978('0x21')](_0x48af17)[_0xc978('0xe')](function(_0xdc92f9){return _0xdc92f9;});}return null;};}function removeEntity(_0x84180e){return function(_0x26b47c){if(_0x26b47c){return _0x26b47c[_0xc978('0x22')]()[_0xc978('0xe')](function(){var _0x537da1=_0x26b47c[_0xc978('0x23')]({'plain':!![]});var _0x218049=_0xc978('0x24');return db['UserProfileResource'][_0xc978('0x22')]({'where':{'type':_0x218049,'resourceId':_0x537da1['id']}})[_0xc978('0xe')](function(){return _0x26b47c;});})['then'](function(){_0x84180e[_0xc978('0x18')](0xcc)[_0xc978('0x19')]();});}};}function handleEntityNotFound(_0xfc79d4){return function(_0x4dac93){if(!_0x4dac93){_0xfc79d4[_0xc978('0x17')](0x194);}return _0x4dac93;};}function handleError(_0x4eda34,_0x2e491f){_0x2e491f=_0x2e491f||0x1f4;return function(_0x1b62a5){logger[_0xc978('0x14')](_0x1b62a5[_0xc978('0x25')]);if(_0x1b62a5['name']){delete _0x1b62a5[_0xc978('0x26')];}_0x4eda34['status'](_0x2e491f)[_0xc978('0x27')](_0x1b62a5);};}function getImapHost(_0x53d66a){switch(_0x53d66a){case'gmail':return _0xc978('0x28');case _0xc978('0x29'):return _0xc978('0x2a');case _0xc978('0x2b'):return'imap-mail.outlook.com';case _0xc978('0x2c'):return _0xc978('0x2d');}throw new Error(_0xc978('0x2e'),_0x53d66a);}function getSmtpHost(_0x1e42a8){switch(_0x1e42a8){case _0xc978('0x2f'):return'smtp.gmail.com';case _0xc978('0x29'):return'smtp.mail.yahoo.com';case'hotmail':return _0xc978('0x30');case'outlook365':return'smtp.office365.com';}throw new Error(_0xc978('0x2e'),_0x1e42a8);}function getAuthenticationOptions(_0x3d050f,_0x462a4f){var _0x263ecf={};var _0xde1e6b={};if(_0x3d050f){_0x263ecf['user']=_0xde1e6b['user']=_0x462a4f['username'];_0x263ecf[_0xc978('0x31')]=_0xde1e6b[_0xc978('0x32')]=_0x462a4f[_0xc978('0x31')];if(_0x462a4f['modernAuthentication']){_0x263ecf['modernAuthentication']=_0xde1e6b['modernAuthentication']=!![];_0x263ecf[_0xc978('0x33')]=_0xde1e6b['CloudProviderId']=_0x462a4f[_0xc978('0x33')];_0x263ecf[_0xc978('0x31')]=_0xde1e6b[_0xc978('0x32')]=null;}else{_0x263ecf[_0xc978('0x33')]=_0xde1e6b[_0xc978('0x33')]=null;}_0x263ecf[_0xc978('0x34')]=getImapHost(_0x3d050f);_0x263ecf[_0xc978('0x35')]=0x3e1;_0xde1e6b[_0xc978('0x34')]=getSmtpHost(_0x3d050f);_0xde1e6b[_0xc978('0x35')]=0x24b;_0xde1e6b[_0xc978('0x36')]=![];_0x263ecf[_0xc978('0x37')]=_0xde1e6b['service']=null;}else{if(_0x462a4f[_0xc978('0x38')]){_0x263ecf[_0xc978('0x39')]=_0xde1e6b['user']=_0x462a4f[_0xc978('0x3a')];_0x263ecf['password']=_0xde1e6b[_0xc978('0x32')]=_0x462a4f['password'];}else{_0x263ecf['authentication']=_0xde1e6b[_0xc978('0x38')]=![];_0x263ecf['user']=_0xde1e6b['user']=null;_0x263ecf['password']=_0xde1e6b[_0xc978('0x32')]=null;}_0x263ecf[_0xc978('0x34')]=_0x462a4f[_0xc978('0x3b')]['host'];_0x263ecf['port']=_0x462a4f['Imap'][_0xc978('0x35')];_0xde1e6b['host']=_0x462a4f['Smtp'][_0xc978('0x34')];_0xde1e6b[_0xc978('0x35')]=_0x462a4f['Smtp'][_0xc978('0x35')];}return{'Imap':_0x263ecf,'Smtp':_0xde1e6b};}exports[_0xc978('0x3c')]=function(_0x217b23,_0x2e2379){var _0x5405db={'include':[{'model':db['MailServerIn'],'as':_0xc978('0x3b')},{'model':db['MailServerOut'],'as':_0xc978('0x3d')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x497987={},_0x20794a={'count':0x0,'rows':[]};var _0x1e4fee=_['map'](db['MailAccount']['rawAttributes'],function(_0x1fbcdb){return{'name':_0x1fbcdb[_0xc978('0x3e')],'type':_0x1fbcdb[_0xc978('0x3f')][_0xc978('0x40')]};});_0x497987['model']=_['map'](_0x1e4fee,'name');_0x497987[_0xc978('0x41')]=_[_0xc978('0x42')](_0x217b23[_0xc978('0x41')]);_0x497987[_0xc978('0x43')]=_[_0xc978('0x44')](_0x497987[_0xc978('0x45')],_0x497987['query']);_0x5405db[_0xc978('0x46')]=_['intersection'](_0x497987[_0xc978('0x45')],qs[_0xc978('0x47')](_0x217b23['query'][_0xc978('0x47')]));_0x5405db[_0xc978('0x46')]=_0x5405db[_0xc978('0x46')][_0xc978('0x48')]?_0x5405db[_0xc978('0x46')]:_0x497987[_0xc978('0x45')];if(!_0x217b23['query']['hasOwnProperty'](_0xc978('0x49'))){_0x5405db['limit']=qs[_0xc978('0x1d')](_0x217b23[_0xc978('0x41')][_0xc978('0x1d')]);_0x5405db['offset']=qs['offset'](_0x217b23['query'][_0xc978('0x1b')]);}_0x5405db[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x217b23[_0xc978('0x41')][_0xc978('0x4b')]);_0x5405db['where']=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x217b23['query'],_0x497987[_0xc978('0x43')]),_0x1e4fee);if(_0x217b23[_0xc978('0x41')][_0xc978('0x4d')]){_0x5405db[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x5405db[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x1e4fee,function(_0x5786fa){if(_0x5786fa[_0xc978('0x3f')]!==_0xc978('0x51')){var _0x3c100f={};_0x3c100f[_0x5786fa[_0xc978('0x26')]]={'$like':'%'+_0x217b23[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x3c100f;}})});}_0x5405db=_[_0xc978('0x4f')]({},_0x5405db,_0x217b23[_0xc978('0x52')]);var _0xaa65dc={'where':_0x5405db['where']};return db['MailAccount'][_0xc978('0x1e')](_0xaa65dc)[_0xc978('0xe')](function(_0x1cc4dd){_0x20794a['count']=_0x1cc4dd;if(_0x217b23[_0xc978('0x41')][_0xc978('0x53')]){_0x5405db[_0xc978('0x54')]=[{'all':!![]}];}return db['MailAccount'][_0xc978('0x55')](_0x5405db);})['then'](function(_0x2668fb){_0x20794a[_0xc978('0x56')]=_0x2668fb;return _0x20794a;})[_0xc978('0xe')](respondWithFilteredResult(_0x2e2379,_0x5405db))[_0xc978('0x57')](handleError(_0x2e2379,null));};exports[_0xc978('0x58')]=function(_0x5efa49,_0x137faa){var _0x7f8253={'raw':![],'where':{'id':_0x5efa49[_0xc978('0x59')]['id']},'include':[{'model':db[_0xc978('0x5a')],'as':'Imap'},{'model':db[_0xc978('0x5b')],'as':_0xc978('0x3d')},{'model':db[_0xc978('0x5c')],'as':_0xc978('0x5d')}]},_0x596248={};_0x596248[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x5e')][_0xc978('0x5f')]);_0x596248[_0xc978('0x41')]=_['keys'](_0x5efa49[_0xc978('0x41')]);_0x596248[_0xc978('0x43')]=_['intersection'](_0x596248['model'],_0x596248[_0xc978('0x41')]);_0x7f8253[_0xc978('0x46')]=_[_0xc978('0x44')](_0x596248[_0xc978('0x45')],qs['fields'](_0x5efa49[_0xc978('0x41')][_0xc978('0x47')]));_0x7f8253[_0xc978('0x46')]=_0x7f8253[_0xc978('0x46')]['length']?_0x7f8253[_0xc978('0x46')]:_0x596248['model'];if(_0x5efa49['query']['includeAll']){_0x7f8253[_0xc978('0x54')]=[{'all':!![]}];}_0x7f8253=_[_0xc978('0x4f')]({},_0x7f8253,_0x5efa49[_0xc978('0x52')]);return db['MailAccount'][_0xc978('0x60')](_0x7f8253)[_0xc978('0xe')](handleEntityNotFound(_0x137faa,null))[_0xc978('0xe')](respondWithResult(_0x137faa,null))[_0xc978('0x57')](handleError(_0x137faa,null));};exports[_0xc978('0x21')]=function(_0x3b6f64,_0x20f3f3){if(_0x3b6f64['body']['id']){delete _0x3b6f64[_0xc978('0x61')]['id'];}var _0x122ecb=_0x3b6f64[_0xc978('0x61')][_0xc978('0x62')]===_0xc978('0x63')?null:_0x3b6f64[_0xc978('0x61')]['provider'];var _0x473ec0=_0x3b6f64['body'][_0xc978('0x3b')]||{};var _0x5bda24=_0x3b6f64['body'][_0xc978('0x3d')]||{};if(_0x122ecb){_0x473ec0[_0xc978('0x34')]=getImapHost(_0x122ecb);_0x473ec0[_0xc978('0x35')]=0x3e1;_0x5bda24[_0xc978('0x34')]=getSmtpHost(_0x122ecb);_0x5bda24[_0xc978('0x35')]=0x24b;_0x5bda24['secure']=![];}if(_0x5bda24[_0xc978('0x64')]){_0x5bda24[_0xc978('0x36')]=![];}else{_0x5bda24[_0xc978('0x33')]=null;}if(!_0x473ec0[_0xc978('0x64')])_0x473ec0['CloudProviderId']=null;_0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')]=_0x473ec0;_0x3b6f64[_0xc978('0x61')]['Smtp']=_0x5bda24;return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x3b6f64[_0xc978('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0xc978('0x5c')],'as':_0xc978('0x5d')}]})['then'](handleEntityNotFound(_0x20f3f3,null))['then'](function(_0x46a425){if(!_0x46a425)throw new Error('Mail\x20Account\x20not\x20found');if(_0x46a425[_0xc978('0x37')])delete _0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')];return _0x46a425;})[_0xc978('0xe')](saveUpdates(_0x3b6f64[_0xc978('0x61')],null))['then'](function(_0x5664f3){if(!_0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')])return _0x5664f3;return db[_0xc978('0x5a')][_0xc978('0x21')](_0x3b6f64[_0xc978('0x61')][_0xc978('0x3b')],{'where':{'MailAccountId':_0x5664f3['id']}})[_0xc978('0xe')](function(){return _0x5664f3;});})[_0xc978('0xe')](function(_0x3e25c8){if(!_0x3b6f64['body']['Smtp'])return _0x3e25c8;return db[_0xc978('0x5b')][_0xc978('0x21')](_0x3b6f64[_0xc978('0x61')]['Smtp'],{'where':{'MailAccountId':_0x3e25c8['id']}})[_0xc978('0xe')](function(){return _0x3e25c8;});})['then'](respondWithResult(_0x20f3f3,null))[_0xc978('0x57')](handleError(_0x20f3f3,null));};exports['describe']=function(_0x5bcf42,_0xd849e9){return db[_0xc978('0x5e')][_0xc978('0x65')]()[_0xc978('0xe')](respondWithResult(_0xd849e9,null))[_0xc978('0x57')](handleError(_0xd849e9,null));};exports[_0xc978('0x66')]=function(_0x249f23,_0x53e4dd){if(_0x249f23[_0xc978('0x61')]['id']){delete _0x249f23['body']['id'];}return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x249f23['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x53e4dd,null))['then'](function(_0x338db5){if(_0x338db5){_0x249f23['body'][_0xc978('0x67')]=_0x338db5['id'];return db[_0xc978('0x68')][_0xc978('0x69')](_0x249f23[_0xc978('0x61')]);}})[_0xc978('0xe')](respondWithResult(_0x53e4dd,null))[_0xc978('0x57')](handleError(_0x53e4dd,null));};exports['getDispositions']=function(_0x479ebc,_0x39111b){var _0x2a1ccc={'raw':![],'where':{}};var _0x59050c={};var _0x42276e={'count':0x0,'rows':[]};return db[_0xc978('0x5e')]['findOne']({'where':{'id':_0x479ebc[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x39111b,null))[_0xc978('0xe')](function(_0x11f18d){if(_0x11f18d){_0x59050c['model']=_['keys'](db[_0xc978('0x68')][_0xc978('0x5f')]);_0x59050c['query']=_[_0xc978('0x42')](_0x479ebc[_0xc978('0x41')]);_0x59050c[_0xc978('0x43')]=_[_0xc978('0x44')](_0x59050c[_0xc978('0x45')],_0x59050c['query']);_0x2a1ccc[_0xc978('0x46')]=_[_0xc978('0x44')](_0x59050c[_0xc978('0x45')],qs[_0xc978('0x47')](_0x479ebc[_0xc978('0x41')][_0xc978('0x47')]));_0x2a1ccc[_0xc978('0x46')]=_0x2a1ccc[_0xc978('0x46')]['length']?_0x2a1ccc[_0xc978('0x46')]:_0x59050c[_0xc978('0x45')];if(!_0x479ebc['query'][_0xc978('0x6a')]('nolimit')){_0x2a1ccc[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x479ebc[_0xc978('0x41')][_0xc978('0x1d')]);_0x2a1ccc['offset']=qs[_0xc978('0x1b')](_0x479ebc[_0xc978('0x41')][_0xc978('0x1b')]);}_0x2a1ccc[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x479ebc[_0xc978('0x41')][_0xc978('0x4b')]);_0x2a1ccc['where']=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x479ebc['query'],_0x59050c[_0xc978('0x43')]));_0x2a1ccc['where'][_0xc978('0x67')]=_0x11f18d['id'];if(_0x479ebc[_0xc978('0x41')][_0xc978('0x4d')]){_0x2a1ccc['where']=_['merge'](_0x2a1ccc['where'],{'$or':_[_0xc978('0x50')](_0x2a1ccc[_0xc978('0x46')],function(_0x1be856){var _0x31dcc0={};_0x31dcc0[_0x1be856]={'$like':'%'+_0x479ebc[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x31dcc0;})});}_0x2a1ccc=_[_0xc978('0x4f')]({},_0x2a1ccc,_0x479ebc[_0xc978('0x52')]);return db['Disposition']['count']({'where':_0x2a1ccc['where']})[_0xc978('0xe')](function(_0x3d553b){_0x42276e['count']=_0x3d553b;if(_0x479ebc[_0xc978('0x41')][_0xc978('0x53')]){_0x2a1ccc[_0xc978('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2a1ccc);})[_0xc978('0xe')](function(_0x23bfe2){_0x42276e[_0xc978('0x56')]=_0x23bfe2;return _0x42276e;});}})[_0xc978('0xe')](respondWithFilteredResult(_0x39111b,_0x2a1ccc))[_0xc978('0x57')](handleError(_0x39111b,null));};exports[_0xc978('0x6b')]=function(_0x4e02b9,_0x141be8){return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x4e02b9[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x141be8,null))[_0xc978('0xe')](function(_0x3ebd84){if(_0x3ebd84){return _0x3ebd84['removeDispositions'](_0x4e02b9[_0xc978('0x41')][_0xc978('0x6c')]);}})[_0xc978('0xe')](respondWithStatusCode(_0x141be8,null))[_0xc978('0x57')](handleError(_0x141be8,null));};exports[_0xc978('0x6d')]=function(_0x257c8c,_0x2e5c11){if(_0x257c8c[_0xc978('0x61')]['id']){delete _0x257c8c['body']['id'];}return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x257c8c['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x2e5c11,null))[_0xc978('0xe')](function(_0x18b0d4){if(_0x18b0d4){_0x257c8c['body'][_0xc978('0x67')]=_0x18b0d4['id'];return db[_0xc978('0x6e')][_0xc978('0x69')](_0x257c8c[_0xc978('0x61')]);}})[_0xc978('0xe')](respondWithResult(_0x2e5c11,null))[_0xc978('0x57')](handleError(_0x2e5c11,null));};exports[_0xc978('0x6f')]=function(_0x1908e2,_0x3b205e){var _0x267c3e={'raw':![],'where':{}};var _0x4cd9a6={};var _0x5186e0={'count':0x0,'rows':[]};return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x1908e2[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b205e,null))[_0xc978('0xe')](function(_0x475935){if(_0x475935){_0x4cd9a6[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x6e')][_0xc978('0x5f')]);_0x4cd9a6[_0xc978('0x41')]=_[_0xc978('0x42')](_0x1908e2[_0xc978('0x41')]);_0x4cd9a6[_0xc978('0x43')]=_[_0xc978('0x44')](_0x4cd9a6[_0xc978('0x45')],_0x4cd9a6[_0xc978('0x41')]);_0x267c3e[_0xc978('0x46')]=_[_0xc978('0x44')](_0x4cd9a6[_0xc978('0x45')],qs[_0xc978('0x47')](_0x1908e2[_0xc978('0x41')][_0xc978('0x47')]));_0x267c3e[_0xc978('0x46')]=_0x267c3e[_0xc978('0x46')]['length']?_0x267c3e[_0xc978('0x46')]:_0x4cd9a6[_0xc978('0x45')];if(!_0x1908e2[_0xc978('0x41')]['hasOwnProperty'](_0xc978('0x49'))){_0x267c3e[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x1908e2[_0xc978('0x41')][_0xc978('0x1d')]);_0x267c3e[_0xc978('0x1b')]=qs[_0xc978('0x1b')](_0x1908e2[_0xc978('0x41')][_0xc978('0x1b')]);}_0x267c3e['order']=qs[_0xc978('0x4b')](_0x1908e2[_0xc978('0x41')][_0xc978('0x4b')]);_0x267c3e[_0xc978('0x4e')]=qs[_0xc978('0x43')](_['pick'](_0x1908e2[_0xc978('0x41')],_0x4cd9a6[_0xc978('0x43')]));_0x267c3e[_0xc978('0x4e')][_0xc978('0x67')]=_0x475935['id'];if(_0x1908e2[_0xc978('0x41')][_0xc978('0x4d')]){_0x267c3e['where']=_[_0xc978('0x4f')](_0x267c3e[_0xc978('0x4e')],{'$or':_['map'](_0x267c3e[_0xc978('0x46')],function(_0x1fcf7f){var _0x33f5f4={};_0x33f5f4[_0x1fcf7f]={'$like':'%'+_0x1908e2[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x33f5f4;})});}_0x267c3e=_[_0xc978('0x4f')]({},_0x267c3e,_0x1908e2[_0xc978('0x52')]);return db['CannedAnswer'][_0xc978('0x1e')]({'where':_0x267c3e[_0xc978('0x4e')]})['then'](function(_0x106c68){_0x5186e0[_0xc978('0x1e')]=_0x106c68;if(_0x1908e2[_0xc978('0x41')][_0xc978('0x53')]){_0x267c3e['include']=[{'all':!![]}];}return db[_0xc978('0x6e')][_0xc978('0x55')](_0x267c3e);})['then'](function(_0x2c4919){_0x5186e0[_0xc978('0x56')]=_0x2c4919;return _0x5186e0;});}})['then'](respondWithFilteredResult(_0x3b205e,_0x267c3e))[_0xc978('0x57')](handleError(_0x3b205e,null));};exports[_0xc978('0x71')]=function(_0x4392ef,_0x3a3788){return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x4392ef[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x3a3788,null))[_0xc978('0xe')](function(_0x56ab08){if(_0x56ab08){return _0x56ab08[_0xc978('0x71')](_0x4392ef['query'][_0xc978('0x6c')]);}})[_0xc978('0xe')](respondWithStatusCode(_0x3a3788,null))[_0xc978('0x57')](handleError(_0x3a3788,null));};exports[_0xc978('0x69')]=function(_0x5461af,_0x3d450f){var _0x3b9553={'name':_0x5461af[_0xc978('0x61')][_0xc978('0x26')],'key':_0x5461af[_0xc978('0x61')][_0xc978('0x40')],'provider':_0x5461af[_0xc978('0x61')][_0xc978('0x62')]==='custom'?null:_0x5461af[_0xc978('0x61')][_0xc978('0x62')],'email':_0x5461af[_0xc978('0x61')][_0xc978('0x72')],'ListId':_0x5461af[_0xc978('0x61')][_0xc978('0x73')],'active':!_[_0xc978('0x74')](_0x5461af[_0xc978('0x61')][_0xc978('0x75')])?_0x5461af[_0xc978('0x61')]['active']:!![],'description':_0x5461af[_0xc978('0x61')][_0xc978('0x76')]||null};var _0x54920e=getAuthenticationOptions(_0x3b9553['provider'],_0x5461af[_0xc978('0x61')]);_0x3b9553[_0xc978('0x3b')]=_0x54920e[_0xc978('0x3b')];_0x3b9553[_0xc978('0x3d')]=_0x54920e[_0xc978('0x3d')];return db['MailAccount'][_0xc978('0x69')](_0x3b9553,{'include':[{'model':db[_0xc978('0x5b')],'as':_0xc978('0x3d')},{'model':db['MailServerIn'],'as':_0xc978('0x3b')}]})['then'](function(_0x4be413){var _0x5dc308=_0x5461af[_0xc978('0x39')][_0xc978('0x23')]({'plain':!![]});if(!_0x5dc308)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5dc308['role']===_0xc978('0x39')){var _0x395255=_0x4be413['get']({'plain':!![]});return db[_0xc978('0x77')][_0xc978('0x60')]({'where':{'name':'MailAccounts','userProfileId':_0x5dc308[_0xc978('0x78')]},'raw':!![]})[_0xc978('0xe')](function(_0x471f1d){if(_0x471f1d&&_0x471f1d[_0xc978('0x79')]===0x0){return db[_0xc978('0x7a')][_0xc978('0x69')]({'name':_0x395255[_0xc978('0x26')],'resourceId':_0x395255['id'],'type':_0x471f1d[_0xc978('0x26')],'sectionId':_0x471f1d['id']},{})[_0xc978('0xe')](function(){return _0x4be413;});}else{return _0x4be413;}})['catch'](function(_0xcea7c4){logger[_0xc978('0x14')](_0xc978('0x7b'),_0xcea7c4);throw _0xcea7c4;});}return _0x4be413;})[_0xc978('0xe')](respondWithResult(_0x3d450f,0xc9))[_0xc978('0x57')](handleError(_0x3d450f,null));};exports['getImap']=function(_0xf42ec6,_0x1d7232){return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0xf42ec6[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x1d7232,null))[_0xc978('0xe')](function(_0x1314e8){if(_0x1314e8){return _0x1314e8['getImap']();}return null;})['then'](respondWithResult(_0x1d7232,null))['catch'](handleError(_0x1d7232,null));};exports['addImap']=function(_0x369b82,_0x47d756){if(_0x369b82[_0xc978('0x61')]['id']){delete _0x369b82[_0xc978('0x61')]['id'];}return db[_0xc978('0x5e')]['find']({'where':{'id':_0x369b82['params']['id']}})['then'](handleEntityNotFound(_0x47d756,null))[_0xc978('0xe')](function(_0x152134){if(_0x152134){_0x369b82[_0xc978('0x61')][_0xc978('0x67')]=_0x152134['id'];return db[_0xc978('0x5a')][_0xc978('0x69')](_0x369b82[_0xc978('0x61')]);}})['then'](respondWithResult(_0x47d756,null))[_0xc978('0x57')](handleError(_0x47d756,null));};exports[_0xc978('0x7c')]=function(_0x1573df,_0x14a072){return db['MailAccount'][_0xc978('0x70')]({'where':{'id':_0x1573df[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x14a072,null))['then'](function(_0x22dba3){if(_0x22dba3){return _0x22dba3[_0xc978('0x7d')](null);}return null;})['then'](respondWithStatusCode(_0x14a072,null))[_0xc978('0x57')](handleError(_0x14a072,null));};exports[_0xc978('0x7e')]=function(_0x549541,_0x49bd28){return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x549541[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x49bd28,null))['then'](function(_0x1ae128){if(_0x1ae128){return _0x1ae128['getSmtp']();}return null;})[_0xc978('0xe')](respondWithResult(_0x49bd28,null))[_0xc978('0x57')](handleError(_0x49bd28,null));};exports['addSmtp']=function(_0x3f79d8,_0x2c3df9){if(_0x3f79d8['body']['id']){delete _0x3f79d8[_0xc978('0x61')]['id'];}return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x3f79d8['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x2c3df9,null))['then'](function(_0x4a48b4){if(_0x4a48b4){_0x3f79d8[_0xc978('0x61')][_0xc978('0x67')]=_0x4a48b4['id'];return db['MailServerOut'][_0xc978('0x69')](_0x3f79d8['body']);}})[_0xc978('0xe')](respondWithResult(_0x2c3df9,null))[_0xc978('0x57')](handleError(_0x2c3df9,null));};exports[_0xc978('0x7f')]=function(_0x3cb62b,_0x52bd13){return db['MailAccount'][_0xc978('0x70')]({'where':{'id':_0x3cb62b[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x52bd13,null))[_0xc978('0xe')](function(_0x319e52){if(_0x319e52){return _0x319e52['setSmtp'](null);}return null;})[_0xc978('0xe')](respondWithStatusCode(_0x52bd13,null))[_0xc978('0x57')](handleError(_0x52bd13,null));};exports[_0xc978('0x80')]=function(_0x4bc7bc,_0x34b7a6){return db['MailInteraction']['find']({'where':{'id':_0x4bc7bc[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x34b7a6,null))['then'](function(_0x1d310c){if(_0x1d310c){return _0x1d310c[_0xc978('0x80')](_0x4bc7bc[_0xc978('0x61')][_0xc978('0x6c')],_['omit'](_0x4bc7bc['body'],[_0xc978('0x6c'),'id'])||{});}})[_0xc978('0xe')](respondWithResult(_0x34b7a6,null))['catch'](handleError(_0x34b7a6,null));};exports[_0xc978('0x81')]=function(_0x4ff00d,_0x4b502f){var _0x43ae55={'raw':![],'where':{}};var _0x4bef97={};var _0x333df8={'count':0x0,'rows':[]};return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x4ff00d['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x4b502f,null))['then'](function(_0x2658cc){if(_0x2658cc){_0x4bef97['model']=_['keys'](db['MailInteraction'][_0xc978('0x5f')]);_0x4bef97['query']=_[_0xc978('0x42')](_0x4ff00d[_0xc978('0x41')]);_0x4bef97[_0xc978('0x43')]=_[_0xc978('0x44')](_0x4bef97[_0xc978('0x45')],_0x4bef97[_0xc978('0x41')]);_0x43ae55[_0xc978('0x46')]=_[_0xc978('0x44')](_0x4bef97['model'],qs[_0xc978('0x47')](_0x4ff00d['query']['fields']));_0x43ae55[_0xc978('0x46')]=_0x43ae55[_0xc978('0x46')][_0xc978('0x48')]?_0x43ae55['attributes']:_0x4bef97[_0xc978('0x45')];if(!_0x4ff00d[_0xc978('0x41')][_0xc978('0x6a')]('nolimit')){_0x43ae55[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x4ff00d[_0xc978('0x41')][_0xc978('0x1d')]);_0x43ae55[_0xc978('0x1b')]=qs[_0xc978('0x1b')](_0x4ff00d[_0xc978('0x41')]['offset']);}_0x43ae55[_0xc978('0x4a')]=qs['sort'](_0x4ff00d['query'][_0xc978('0x4b')]);_0x43ae55[_0xc978('0x4e')]=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x4ff00d[_0xc978('0x41')],_0x4bef97['filters']));_0x43ae55[_0xc978('0x4e')]['MailAccountId']=_0x2658cc['id'];if(_0x4ff00d[_0xc978('0x41')][_0xc978('0x4d')]){_0x43ae55[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x43ae55[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x43ae55[_0xc978('0x46')],function(_0x460fdd){var _0x39f85f={};_0x39f85f[_0x460fdd]={'$like':'%'+_0x4ff00d['query'][_0xc978('0x4d')]+'%'};return _0x39f85f;})});}_0x43ae55=_['merge']({},_0x43ae55,_0x4ff00d['options']);return db[_0xc978('0x82')][_0xc978('0x1e')]({'where':_0x43ae55[_0xc978('0x4e')]})['then'](function(_0x588843){_0x333df8[_0xc978('0x1e')]=_0x588843;if(_0x4ff00d[_0xc978('0x41')]['includeAll']){_0x43ae55[_0xc978('0x54')]=[{'model':db['CmContact'],'as':_0xc978('0x83'),'required':![]},{'model':db['User'],'as':_0xc978('0x84'),'attributes':['name',_0xc978('0x85'),'internal'],'required':![]},{'model':db[_0xc978('0x86')],'as':_0xc978('0x87'),'attributes':['id',_0xc978('0x26'),_0xc978('0x88')],'where':_0x4ff00d[_0xc978('0x41')][_0xc978('0x89')]?{'id':_0x4ff00d[_0xc978('0x41')][_0xc978('0x89')]}:undefined,'required':_0x4ff00d[_0xc978('0x41')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xc978('0x55')](_0x43ae55);})[_0xc978('0xe')](function(_0x2431d0){_0x333df8[_0xc978('0x56')]=_0x2431d0;return _0x333df8;});}})[_0xc978('0xe')](respondWithFilteredResult(_0x4b502f,_0x43ae55))[_0xc978('0x57')](handleError(_0x4b502f,null));};exports['addApplications']=function addApplications(_0x3f5edb,_0xfe91ad){var _0x45c65b=_0x3f5edb['params']['id'];var _0xb4a37c=_0x3f5edb['body'];var _0x1100ba=0xc8;var _0x4922e6=null;return db[_0xc978('0x8a')]['transaction']({'isolationLevel':db['sequelize'][_0xc978('0x8b')][_0xc978('0x8c')][_0xc978('0x8d')]},function(_0x2e1968){return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x45c65b},'transaction':_0x2e1968})[_0xc978('0xe')](function(_0x4c4da4){if(_0x4c4da4){return db[_0xc978('0x8e')][_0xc978('0x22')]({'where':{'MailAccountId':_0x45c65b},'transaction':_0x2e1968})['then'](function(){var _0xfd1e0=_[_0xc978('0x50')](_0xb4a37c,function(_0x44d8e6){_0x44d8e6[_0xc978('0x67')]=_0x45c65b;return _0x44d8e6;});return db[_0xc978('0x8e')][_0xc978('0x8f')](_0xfd1e0,{'transaction':_0x2e1968});});}else{_0x1100ba=0x194;_0x4922e6=[];}});})['then'](function(){if(_0x1100ba!==0x194){return db[_0xc978('0x8e')][_0xc978('0x90')]({'where':{'MailAccountId':_0x45c65b},'order':_0xc978('0x91')})[_0xc978('0xe')](function(_0x26b736){_0x4922e6=_0x26b736;});}})[_0xc978('0x57')](function(_0x3e23a6){_0x1100ba=0x1f4;logger[_0xc978('0x14')](_0x3e23a6[_0xc978('0x25')]);if(_0x3e23a6['name']){delete _0x3e23a6[_0xc978('0x26')];}_0x4922e6=_0x3e23a6;})['finally'](function(){if(_0x4922e6===null){_0xfe91ad[_0xc978('0x17')](_0x1100ba);}else{if(_0x1100ba===0x1f4){_0xfe91ad[_0xc978('0x18')](_0x1100ba)[_0xc978('0x27')](_0x4922e6);}else{_0xfe91ad[_0xc978('0x18')](_0x1100ba)['json'](_0x4922e6);}}});};exports[_0xc978('0x92')]=function(_0x1e78c9,_0x36e759){var _0x5bee6e={};var _0x1dea3b={};var _0x3da3d3;var _0x3a4850;return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x1e78c9['params']['id']}})['then'](handleEntityNotFound(_0x36e759,null))[_0xc978('0xe')](function(_0x482036){if(_0x482036){_0x3da3d3=_0x482036;_0x1dea3b[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x8e')][_0xc978('0x5f')]);_0x1dea3b[_0xc978('0x41')]=_[_0xc978('0x42')](_0x1e78c9[_0xc978('0x41')]);_0x1dea3b['filters']=_[_0xc978('0x44')](_0x1dea3b[_0xc978('0x45')],_0x1dea3b['query']);_0x5bee6e[_0xc978('0x46')]=_[_0xc978('0x44')](_0x1dea3b[_0xc978('0x45')],qs[_0xc978('0x47')](_0x1e78c9[_0xc978('0x41')][_0xc978('0x47')]));_0x5bee6e[_0xc978('0x46')]=_0x5bee6e[_0xc978('0x46')][_0xc978('0x48')]?_0x5bee6e[_0xc978('0x46')]:_0x1dea3b[_0xc978('0x45')];_0x5bee6e[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x1e78c9['query'][_0xc978('0x4b')]);_0x5bee6e[_0xc978('0x4e')]=qs['filters'](_['pick'](_0x1e78c9[_0xc978('0x41')],_0x1dea3b[_0xc978('0x43')]));if(_0x1e78c9['query'][_0xc978('0x4d')]){_0x5bee6e[_0xc978('0x4e')]=_['merge'](_0x5bee6e[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x5bee6e['attributes'],function(_0x135a19){var _0x5591c5={};_0x5591c5[_0x135a19]={'$like':'%'+_0x1e78c9[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x5591c5;})});}_0x5bee6e=_[_0xc978('0x4f')]({},_0x5bee6e,_0x1e78c9[_0xc978('0x52')]);return _0x3da3d3[_0xc978('0x92')](_0x5bee6e);}})['then'](function(_0x439437){if(_0x439437){_0x3a4850=_0x439437[_0xc978('0x48')];if(!_0x1e78c9[_0xc978('0x41')][_0xc978('0x6a')]('nolimit')){_0x5bee6e[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x1e78c9[_0xc978('0x41')][_0xc978('0x1d')]);_0x5bee6e[_0xc978('0x1b')]=qs['offset'](_0x1e78c9[_0xc978('0x41')][_0xc978('0x1b')]);}return _0x3da3d3[_0xc978('0x92')](_0x5bee6e);}})['then'](function(_0x1840d1){if(_0x1840d1){return _0x1840d1?{'count':_0x3a4850,'rows':_0x1840d1}:null;}})[_0xc978('0xe')](respondWithResult(_0x36e759,null))[_0xc978('0x57')](handleError(_0x36e759,null));};exports[_0xc978('0x93')]=function(_0x3e1502,_0x456cd9){var _0x261810={'raw':!![],'where':{}};var _0x15b9cf={};var _0x404439={'count':0x0,'rows':[]};return db[_0xc978('0x5e')][_0xc978('0x70')]({'where':{'id':_0x3e1502['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x456cd9,null))[_0xc978('0xe')](function(_0x27c220){if(_0x27c220){_0x15b9cf[_0xc978('0x45')]=_[_0xc978('0x42')](db[_0xc978('0x94')][_0xc978('0x5f')]);_0x15b9cf[_0xc978('0x41')]=_['keys'](_0x3e1502['query']);_0x15b9cf[_0xc978('0x43')]=_['intersection'](_0x15b9cf['model'],_0x15b9cf[_0xc978('0x41')]);_0x261810[_0xc978('0x46')]=_['intersection'](_0x15b9cf['model'],qs[_0xc978('0x47')](_0x3e1502[_0xc978('0x41')][_0xc978('0x47')]));_0x261810[_0xc978('0x46')]=_0x261810[_0xc978('0x46')][_0xc978('0x48')]?_0x261810[_0xc978('0x46')]:_0x15b9cf[_0xc978('0x45')];if(!_0x3e1502[_0xc978('0x41')][_0xc978('0x6a')](_0xc978('0x49'))){_0x261810[_0xc978('0x1d')]=qs[_0xc978('0x1d')](_0x3e1502[_0xc978('0x41')][_0xc978('0x1d')]);_0x261810[_0xc978('0x1b')]=qs[_0xc978('0x1b')](_0x3e1502[_0xc978('0x41')][_0xc978('0x1b')]);}_0x261810[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x3e1502['query'][_0xc978('0x4b')]);_0x261810[_0xc978('0x4e')]=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x3e1502[_0xc978('0x41')],_0x15b9cf[_0xc978('0x43')]));_0x261810[_0xc978('0x4e')][_0xc978('0x67')]=_0x27c220['id'];if(_0x3e1502[_0xc978('0x41')][_0xc978('0x4d')]){_0x261810[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x261810[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x261810['attributes'],function(_0x2a260e){var _0x9b665={};_0x9b665[_0x2a260e]={'$like':'%'+_0x3e1502[_0xc978('0x41')][_0xc978('0x4d')]+'%'};return _0x9b665;})});}if(_0x3e1502[_0xc978('0x41')]['$gte']){var _0x498ca8=_0x3e1502[_0xc978('0x41')][_0xc978('0x95')][_0xc978('0x96')](',');var _0x105954={};_0x105954[_0x498ca8[0x0]]={'$gte':moment(_0x498ca8[0x1])[_0xc978('0x97')](_0xc978('0x98'))};_0x261810[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x261810['where'],_0x105954);}_0x261810=_['merge']({},_0x261810,_0x3e1502[_0xc978('0x52')]);return db[_0xc978('0x94')][_0xc978('0x1e')]({'where':_0x261810[_0xc978('0x4e')]})[_0xc978('0xe')](function(_0x59b65b){_0x404439[_0xc978('0x1e')]=_0x59b65b;if(_0x3e1502['query'][_0xc978('0x53')]){_0x261810[_0xc978('0x54')]=[{'all':!![]}];}return db['MailMessage'][_0xc978('0x55')](_0x261810);})[_0xc978('0xe')](function(_0xe591e1){if(_0x3e1502[_0xc978('0x41')][_0xc978('0x99')]===_0xc978('0x9a')){for(var _0x528b4c=0x0;_0x528b4c<_0xe591e1[_0xc978('0x48')];_0x528b4c++){_0xe591e1[_0x528b4c]['body']=juice(_0xe591e1[_0x528b4c][_0xc978('0x61')]);}}_0x404439[_0xc978('0x56')]=_0xe591e1;return _0x404439;});}})[_0xc978('0xe')](respondWithFilteredResult(_0x456cd9,_0x261810))[_0xc978('0x57')](handleError(_0x456cd9,null));};exports[_0xc978('0x27')]=function(_0x51cd8b,_0x52aae9){var _0x25596d,_0xbd1c32={},_0x430164;if(_0x51cd8b[_0xc978('0x61')]['to']){_0x430164=_0x51cd8b[_0xc978('0x61')]['to'][_0xc978('0x96')](',')[0x0];}return db[_0xc978('0x5e')][_0xc978('0x60')]({'where':{'id':_0x51cd8b[_0xc978('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc978('0x9b')],'as':'Contacts','where':{'email':_0x430164},'limit':0x1,'order':[['updatedAt',_0xc978('0x9c')]]}]},{'model':db[_0xc978('0x5b')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc978('0x9d')],'as':_0xc978('0x9d'),'raw':!![]}]}]})[_0xc978('0xe')](handleEntityNotFound(_0x52aae9,null))[_0xc978('0xe')](function(_0x26f06c){if(!_0x26f06c)return;_0x25596d=_0x26f06c;if(!_0x26f06c[_0xc978('0x3d')])throw new Error(_0xc978('0x9e'));if(_[_0xc978('0x74')](_0x51cd8b['body'][_0xc978('0x9f')])){_0x51cd8b['body'][_0xc978('0x9f')]=util[_0xc978('0x97')](_0xc978('0xa0'),_0x26f06c[_0xc978('0x26')],_0x26f06c[_0xc978('0x72')]||_0x26f06c[_0xc978('0x3d')][_0xc978('0x39')]);}if(_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')]&&_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')][_0xc978('0x48')]){for(var _0x178f1f=0x0;_0x178f1f<_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')][_0xc978('0x48')];_0x178f1f+=0x1){_0x51cd8b['body'][_0xc978('0xa1')][_0x178f1f]={'filename':_0x51cd8b[_0xc978('0x61')][_0xc978('0xa1')][_0x178f1f]['name'],'path':path['join'](config[_0xc978('0xa2')],_0xc978('0xa3'),_0x51cd8b[_0xc978('0x61')]['attachments'][_0x178f1f][_0xc978('0xa4')])};}}var _0x5cf575=_0x26f06c[_0xc978('0xa5')]();return respondWithRpcPromise(_0xc978('0xa6'),'sendMail',{'account':_0x5cf575,'message':_0x51cd8b[_0xc978('0x61')]});})[_0xc978('0xe')](function(_0x2d0036){if(!_0x2d0036)return;_0xbd1c32=_0x2d0036;if(!_0x25596d[_0xc978('0xa7')])throw new Error(_0xc978('0xa8'));if(_0x25596d['List']['Contacts'][_0xc978('0x48')])return _0x25596d['List'][_0xc978('0xa9')][0x0];return db[_0xc978('0x9b')]['create'](_['defaults'](_0x51cd8b['body'],{'firstName':_0x51cd8b[_0xc978('0x61')]['to'],'email':_0x51cd8b['body']['to'],'phone':_0x51cd8b[_0xc978('0x61')]['to'],'ListId':_0x25596d[_0xc978('0x73')]}));})[_0xc978('0xe')](function(_0x331c56){if(!_0x331c56)return;var _0x32b914={'UserId':_0x51cd8b['user']['id'],'ContactId':_0x331c56['id'],'MailAccountId':_0x25596d['id'],'inReplyTo':_0xbd1c32[_0xc978('0xaa')],'to':_0x51cd8b['body'][_0xc978('0x9f')],'cc':_0x51cd8b['body']['cc'],'subject':_0x51cd8b[_0xc978('0x61')][_0xc978('0xab')],'attach':_0x51cd8b['body'][_0xc978('0xac')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xc978('0x97')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xc978('0xad'),'Messages':[_[_0xc978('0x4f')](_0x51cd8b['body'],{'messageId':_0xbd1c32['messageId'],'sentAt':moment()['format'](_0xc978('0x98')),'read':!![],'MailAccountId':_0x25596d['id'],'UserId':_0x51cd8b[_0xc978('0x39')]['id'],'ContactId':_0x331c56['id']})]};if(_0x51cd8b['body']['Interaction']){_0x32b914=_[_0xc978('0x4f')](_0x32b914,_0x51cd8b[_0xc978('0x61')]['Interaction']);}return db['MailInteraction'][_0xc978('0x69')](_0x32b914,{'include':[{'model':db[_0xc978('0x94')],'as':_0xc978('0xae')}]});})[_0xc978('0xe')](respondWithResult(_0x52aae9,null))[_0xc978('0x57')](handleError(_0x52aae9,null));};exports['verifySmtp']=function(_0x8e838c,_0x35edef){return db[_0xc978('0x5e')]['find']({'where':{'id':_0x8e838c[_0xc978('0x59')]['id']},'include':[{'model':db[_0xc978('0x5b')],'as':_0xc978('0x3d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc978('0x9d'),'raw':!![]}]}]})[_0xc978('0xe')](handleEntityNotFound(_0x35edef,null))[_0xc978('0xe')](function(_0x3b9145){if(!_0x3b9145['Smtp'])return;var _0x11efc7=_0x3b9145[_0xc978('0xa5')]();return respondWithRpcPromise(_0xc978('0xaf'),_0xc978('0xb0'),{'account':_0x11efc7});})['then'](respondWithResult(_0x35edef,null))[_0xc978('0x57')](handleError(_0x35edef,null));};exports[_0xc978('0x22')]=function(_0x2041cc,_0x1e64c8){return db['MailAccount'][_0xc978('0x60')]({'where':{'id':_0x2041cc[_0xc978('0x59')]['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x1e64c8,null))[_0xc978('0xe')](function(_0x79fc3c){if(_0x79fc3c&&_0x79fc3c[_0xc978('0x37')]){throw new db[(_0xc978('0xb1'))][(_0xc978('0xb2'))](_0xc978('0xb3'));}return _0x79fc3c;})[_0xc978('0xe')](removeEntity(_0x1e64c8,null))[_0xc978('0x57')](handleError(_0x1e64c8,null));};exports[_0xc978('0xb4')]=function(_0x550f63,_0x492465){return db['MailAccount']['find']({'where':{'id':_0x550f63['params']['id']}})[_0xc978('0xe')](handleEntityNotFound(_0x492465,null))['then'](function(_0x380083){if(_0x380083){return _0x380083[_0xc978('0xb4')](_0x550f63[_0xc978('0x61')][_0xc978('0x6c')],_[_0xc978('0xb5')](_0x550f63['body'],['ids','id'])||{})[_0xc978('0xb6')](function(_0x97ed0e){for(var _0x4a8f2b=0x0;_0x4a8f2b<_0x550f63[_0xc978('0x61')][_0xc978('0x6c')][_0xc978('0x48')];_0x4a8f2b+=0x1){socket[_0xc978('0xb7')]('userMailAccount:save',{'UserId':Number(_0x550f63[_0xc978('0x61')][_0xc978('0x6c')][_0x4a8f2b]),'MailAccountId':Number(_0x550f63[_0xc978('0x59')]['id'])});}return _0x97ed0e;});}})['then'](respondWithResult(_0x492465,null))[_0xc978('0x57')](handleError(_0x492465,null));};exports[_0xc978('0xb8')]=function(_0x24462b,_0x368c0f){return db[_0xc978('0x5e')]['find']({'where':{'id':_0x24462b[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x368c0f,null))['then'](function(_0x393b8b){if(_0x393b8b){return _0x393b8b[_0xc978('0xb8')](_0x24462b[_0xc978('0x41')][_0xc978('0x6c')])[_0xc978('0xe')](function(){if(_[_0xc978('0xb9')](_0x24462b[_0xc978('0x41')]['ids'])){for(var _0x351288=0x0;_0x351288<_0x24462b['query']['ids'][_0xc978('0x48')];_0x351288+=0x1){socket[_0xc978('0xb7')](_0xc978('0xba'),{'UserId':Number(_0x24462b[_0xc978('0x41')][_0xc978('0x6c')][_0x351288]),'MailAccountId':Number(_0x24462b[_0xc978('0x59')]['id'])});}}else{socket['emit'](_0xc978('0xba'),{'UserId':Number(_0x24462b[_0xc978('0x41')][_0xc978('0x6c')]),'MailAccountId':Number(_0x24462b[_0xc978('0x59')]['id'])});}});}})[_0xc978('0xe')](respondWithStatusCode(_0x368c0f,null))[_0xc978('0x57')](handleError(_0x368c0f,null));};exports[_0xc978('0xbb')]=function(_0x599444,_0x15ccac){var _0x18818b={};var _0x5613c5={};var _0x31dd4c;var _0x174f27;return db[_0xc978('0x5e')]['findOne']({'where':{'id':_0x599444[_0xc978('0x59')]['id']}})['then'](handleEntityNotFound(_0x15ccac,null))[_0xc978('0xe')](function(_0x2041f6){if(_0x2041f6){_0x31dd4c=_0x2041f6;_0x5613c5[_0xc978('0x45')]=_['keys'](db['User'][_0xc978('0x5f')]);_0x5613c5[_0xc978('0x41')]=_[_0xc978('0x42')](_0x599444[_0xc978('0x41')]);_0x5613c5[_0xc978('0x43')]=_[_0xc978('0x44')](_0x5613c5[_0xc978('0x45')],_0x5613c5[_0xc978('0x41')]);_0x18818b['attributes']=_[_0xc978('0x44')](_0x5613c5['model'],qs[_0xc978('0x47')](_0x599444['query'][_0xc978('0x47')]));_0x18818b['attributes']=_0x18818b[_0xc978('0x46')][_0xc978('0x48')]?_0x18818b[_0xc978('0x46')]:_0x5613c5[_0xc978('0x45')];_0x18818b[_0xc978('0x4a')]=qs[_0xc978('0x4b')](_0x599444[_0xc978('0x41')][_0xc978('0x4b')]);_0x18818b[_0xc978('0x4e')]=qs[_0xc978('0x43')](_[_0xc978('0x4c')](_0x599444[_0xc978('0x41')],_0x5613c5[_0xc978('0x43')]));if(_0x599444[_0xc978('0x41')][_0xc978('0x4d')]){_0x18818b[_0xc978('0x4e')]=_[_0xc978('0x4f')](_0x18818b[_0xc978('0x4e')],{'$or':_[_0xc978('0x50')](_0x18818b[_0xc978('0x46')],function(_0x16937d){var _0x5a597c={};_0x5a597c[_0x16937d]={'$like':'%'+_0x599444[_0xc978('0x41')]['filter']+'%'};return _0x5a597c;})});}_0x18818b=_['merge']({},_0x18818b,_0x599444['options']);return _0x31dd4c[_0xc978('0xbb')](_0x18818b);}})[_0xc978('0xe')](function(_0x471aea){if(_0x471aea){_0x174f27=_0x471aea['length'];if(!_0x599444[_0xc978('0x41')][_0xc978('0x6a')](_0xc978('0x49'))){_0x18818b[_0xc978('0x1d')]=qs['limit'](_0x599444[_0xc978('0x41')][_0xc978('0x1d')]);_0x18818b['offset']=qs[_0xc978('0x1b')](_0x599444[_0xc978('0x41')][_0xc978('0x1b')]);}return _0x31dd4c[_0xc978('0xbb')](_0x18818b);}})[_0xc978('0xe')](function(_0x50bca4){if(_0x50bca4){return _0x50bca4?{'count':_0x174f27,'rows':_0x50bca4}:null;}})[_0xc978('0xe')](respondWithResult(_0x15ccac,null))[_0xc978('0x57')](handleError(_0x15ccac,null));}; \ No newline at end of file +var _0x3e19=['show','find','body','provider','custom','params','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','ListId','active','description','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','fullname','internal','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','format','email','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','jayson/promise','client','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','sendStatus','status','end','json','offset','limit','Content-Range','update','destroy','MailAccounts','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','smtp.gmail.com','hotmail','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','MailAccount','count','includeAll','include','findAll','catch'];(function(_0x313079,_0x2b9220){var _0x3f6cf8=function(_0x1d1dd8){while(--_0x1d1dd8){_0x313079['push'](_0x313079['shift']());}};_0x3f6cf8(++_0x2b9220);}(_0x3e19,0x1da));var _0x93e1=function(_0xa4f636,_0xaca1b6){_0xa4f636=_0xa4f636-0x0;var _0x37e02a=_0x3e19[_0xa4f636];return _0x37e02a;};'use strict';var moment=require('moment');var BPromise=require(_0x93e1('0x0'));var util=require('util');var path=require(_0x93e1('0x1'));var _=require(_0x93e1('0x2'));var juice=require(_0x93e1('0x3'));var Redis=require(_0x93e1('0x4'));var qs=require(_0x93e1('0x5'));var logger=require(_0x93e1('0x6'))(_0x93e1('0x7'));var config=require('../../config/environment');var db=require(_0x93e1('0x8'))['db'];config[_0x93e1('0x9')]=_[_0x93e1('0xa')](config[_0x93e1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x93e1('0xb'))(new Redis(config[_0x93e1('0x9')]));require(_0x93e1('0xc'))['register'](socket);var jayson=require(_0x93e1('0xd'));var client=jayson[_0x93e1('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x1f3b0c,_0xe67838,_0x3bb6db,_0x27b02d){return new BPromise(function(_0x1e2f08,_0x74c34b){var _0x216298=_0x27b02d||client;return _0x216298[_0x93e1('0xf')](_0x1f3b0c,_0x3bb6db)[_0x93e1('0x10')](function(_0x8480d6){logger['info'](_0x93e1('0x11'),_0xe67838,_0x93e1('0x12'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0xe67838,_0x93e1('0x12'),JSON[_0x93e1('0x13')](_0x8480d6));if(_0x8480d6[_0x93e1('0x14')]){if(_0x8480d6[_0x93e1('0x14')][_0x93e1('0x15')]===0x1f4){logger['error'](_0x93e1('0x11'),_0xe67838,_0x8480d6['error'][_0x93e1('0x16')]);return _0x74c34b(_0x8480d6[_0x93e1('0x14')][_0x93e1('0x16')]);}logger['error'](_0x93e1('0x11'),_0xe67838,_0x8480d6[_0x93e1('0x14')]['message']);return _0x1e2f08(_0x8480d6['error'][_0x93e1('0x16')]);}else{logger[_0x93e1('0x17')]('MailAccount,\x20%s,\x20%s',_0xe67838,_0x93e1('0x12'));_0x1e2f08(_0x8480d6['result'][_0x93e1('0x16')]);}})['catch'](function(_0x4ec6c0){logger['error'](_0x93e1('0x11'),_0xe67838,_0x4ec6c0);_0x74c34b(_0x4ec6c0);});});}function respondWithStatusCode(_0x1b9093,_0x53be61){_0x53be61=_0x53be61||0xcc;return function(_0x3db61e){if(_0x3db61e){return _0x1b9093[_0x93e1('0x18')](_0x53be61);}return _0x1b9093[_0x93e1('0x19')](_0x53be61)[_0x93e1('0x1a')]();};}function respondWithResult(_0x3ce920,_0x3b641){_0x3b641=_0x3b641||0xc8;return function(_0x225fa6){if(_0x225fa6){return _0x3ce920[_0x93e1('0x19')](_0x3b641)[_0x93e1('0x1b')](_0x225fa6);}};}function respondWithFilteredResult(_0x55abaa,_0x4ee840){return function(_0xe30bc1){if(_0xe30bc1){var _0x414b4b=typeof _0x4ee840[_0x93e1('0x1c')]==='undefined'&&typeof _0x4ee840['limit']==='undefined';var _0x2a5a3e=_0xe30bc1['count'];var _0x464882=_0x414b4b?0x0:_0x4ee840[_0x93e1('0x1c')];var _0x15be12=_0x414b4b?_0xe30bc1['count']:_0x4ee840[_0x93e1('0x1c')]+_0x4ee840[_0x93e1('0x1d')];var _0x308d7e;if(_0x15be12>=_0x2a5a3e){_0x15be12=_0x2a5a3e;_0x308d7e=0xc8;}else{_0x308d7e=0xce;}_0x55abaa['status'](_0x308d7e);return _0x55abaa['set'](_0x93e1('0x1e'),_0x464882+'-'+_0x15be12+'/'+_0x2a5a3e)['json'](_0xe30bc1);}return null;};}function saveUpdates(_0x29e9ba){return function(_0x33e525){if(_0x33e525){return _0x33e525[_0x93e1('0x1f')](_0x29e9ba)[_0x93e1('0x10')](function(_0xed549b){return _0xed549b;});}return null;};}function removeEntity(_0x4ab3a8){return function(_0x3697e9){if(_0x3697e9){return _0x3697e9[_0x93e1('0x20')]()[_0x93e1('0x10')](function(){var _0x2554c7=_0x3697e9['get']({'plain':!![]});var _0x3581c1=_0x93e1('0x21');return db['UserProfileResource'][_0x93e1('0x20')]({'where':{'type':_0x3581c1,'resourceId':_0x2554c7['id']}})[_0x93e1('0x10')](function(){return _0x3697e9;});})[_0x93e1('0x10')](function(){_0x4ab3a8[_0x93e1('0x19')](0xcc)[_0x93e1('0x1a')]();});}};}function handleEntityNotFound(_0x1426a2){return function(_0x3256df){if(!_0x3256df){_0x1426a2[_0x93e1('0x18')](0x194);}return _0x3256df;};}function handleError(_0x151455,_0x529dda){_0x529dda=_0x529dda||0x1f4;return function(_0x496092){logger['error'](_0x496092[_0x93e1('0x22')]);if(_0x496092[_0x93e1('0x23')]){delete _0x496092[_0x93e1('0x23')];}_0x151455['status'](_0x529dda)[_0x93e1('0x24')](_0x496092);};}function getImapHost(_0x3e84a4){switch(_0x3e84a4){case'gmail':return _0x93e1('0x25');case _0x93e1('0x26'):return _0x93e1('0x27');case'hotmail':return _0x93e1('0x28');case _0x93e1('0x29'):return _0x93e1('0x2a');}throw new Error('Unknown\x20email\x20service\x20provider',_0x3e84a4);}function getSmtpHost(_0x30b14d){switch(_0x30b14d){case'gmail':return _0x93e1('0x2b');case _0x93e1('0x26'):return'smtp.mail.yahoo.com';case _0x93e1('0x2c'):return'smtp-mail.outlook.com';case'outlook365':return _0x93e1('0x2d');}throw new Error(_0x93e1('0x2e'),_0x30b14d);}function getAuthenticationOptions(_0xf6a7f8,_0x459256){var _0x2cc931={};var _0x2bc714={};if(_0xf6a7f8){_0x2cc931[_0x93e1('0x2f')]=_0x2bc714[_0x93e1('0x2f')]=_0x459256[_0x93e1('0x30')];_0x2cc931[_0x93e1('0x31')]=_0x2bc714[_0x93e1('0x32')]=_0x459256['password'];if(_0x459256[_0x93e1('0x33')]){_0x2cc931[_0x93e1('0x33')]=_0x2bc714[_0x93e1('0x33')]=!![];_0x2cc931['CloudProviderId']=_0x2bc714['CloudProviderId']=_0x459256['CloudProviderId'];_0x2cc931[_0x93e1('0x31')]=_0x2bc714[_0x93e1('0x32')]=null;}else{_0x2cc931['CloudProviderId']=_0x2bc714[_0x93e1('0x34')]=null;}_0x2cc931['host']=getImapHost(_0xf6a7f8);_0x2cc931[_0x93e1('0x35')]=0x3e1;_0x2bc714[_0x93e1('0x36')]=getSmtpHost(_0xf6a7f8);_0x2bc714['port']=0x24b;_0x2bc714[_0x93e1('0x37')]=![];_0x2cc931[_0x93e1('0x38')]=_0x2bc714[_0x93e1('0x38')]=null;}else{if(_0x459256[_0x93e1('0x39')]){_0x2cc931['user']=_0x2bc714['user']=_0x459256[_0x93e1('0x30')];_0x2cc931[_0x93e1('0x31')]=_0x2bc714['pass']=_0x459256['password'];}else{_0x2cc931[_0x93e1('0x39')]=_0x2bc714[_0x93e1('0x39')]=![];_0x2cc931[_0x93e1('0x2f')]=_0x2bc714[_0x93e1('0x2f')]=null;_0x2cc931[_0x93e1('0x31')]=_0x2bc714[_0x93e1('0x32')]=null;}_0x2cc931[_0x93e1('0x36')]=_0x459256['Imap']['host'];_0x2cc931[_0x93e1('0x35')]=_0x459256[_0x93e1('0x3a')][_0x93e1('0x35')];_0x2bc714[_0x93e1('0x36')]=_0x459256[_0x93e1('0x3b')]['host'];_0x2bc714[_0x93e1('0x35')]=_0x459256[_0x93e1('0x3b')][_0x93e1('0x35')];}return{'Imap':_0x2cc931,'Smtp':_0x2bc714};}exports[_0x93e1('0x3c')]=function(_0x52b8bb,_0x5775d3){var _0x2364a8={'include':[{'model':db[_0x93e1('0x3d')],'as':_0x93e1('0x3a')},{'model':db[_0x93e1('0x3e')],'as':'Smtp'},{'model':db[_0x93e1('0x3f')],'as':_0x93e1('0x40')}]},_0x39b940={},_0x43377f={'count':0x0,'rows':[]};var _0x7bb971=_[_0x93e1('0x41')](db['MailAccount'][_0x93e1('0x42')],function(_0x26d5eb){return{'name':_0x26d5eb[_0x93e1('0x43')],'type':_0x26d5eb[_0x93e1('0x44')][_0x93e1('0x45')]};});_0x39b940[_0x93e1('0x46')]=_[_0x93e1('0x41')](_0x7bb971,_0x93e1('0x23'));_0x39b940[_0x93e1('0x47')]=_[_0x93e1('0x48')](_0x52b8bb[_0x93e1('0x47')]);_0x39b940[_0x93e1('0x49')]=_['intersection'](_0x39b940[_0x93e1('0x46')],_0x39b940[_0x93e1('0x47')]);_0x2364a8['attributes']=_[_0x93e1('0x4a')](_0x39b940[_0x93e1('0x46')],qs[_0x93e1('0x4b')](_0x52b8bb[_0x93e1('0x47')][_0x93e1('0x4b')]));_0x2364a8[_0x93e1('0x4c')]=_0x2364a8['attributes'][_0x93e1('0x4d')]?_0x2364a8[_0x93e1('0x4c')]:_0x39b940[_0x93e1('0x46')];if(!_0x52b8bb[_0x93e1('0x47')]['hasOwnProperty'](_0x93e1('0x4e'))){_0x2364a8[_0x93e1('0x1d')]=qs[_0x93e1('0x1d')](_0x52b8bb[_0x93e1('0x47')][_0x93e1('0x1d')]);_0x2364a8[_0x93e1('0x1c')]=qs[_0x93e1('0x1c')](_0x52b8bb[_0x93e1('0x47')]['offset']);}_0x2364a8[_0x93e1('0x4f')]=qs[_0x93e1('0x50')](_0x52b8bb[_0x93e1('0x47')]['sort']);_0x2364a8[_0x93e1('0x51')]=qs[_0x93e1('0x49')](_[_0x93e1('0x52')](_0x52b8bb[_0x93e1('0x47')],_0x39b940[_0x93e1('0x49')]),_0x7bb971);if(_0x52b8bb[_0x93e1('0x47')][_0x93e1('0x53')]){_0x2364a8['where']=_['merge'](_0x2364a8[_0x93e1('0x51')],{'$or':_['map'](_0x7bb971,function(_0x174508){if(_0x174508[_0x93e1('0x44')]!==_0x93e1('0x54')){var _0x339845={};_0x339845[_0x174508[_0x93e1('0x23')]]={'$like':'%'+_0x52b8bb[_0x93e1('0x47')][_0x93e1('0x53')]+'%'};return _0x339845;}})});}_0x2364a8=_[_0x93e1('0x55')]({},_0x2364a8,_0x52b8bb[_0x93e1('0x56')]);var _0x3253b2={'where':_0x2364a8[_0x93e1('0x51')]};return db[_0x93e1('0x57')][_0x93e1('0x58')](_0x3253b2)[_0x93e1('0x10')](function(_0x25c29f){_0x43377f[_0x93e1('0x58')]=_0x25c29f;if(_0x52b8bb['query'][_0x93e1('0x59')]){_0x2364a8[_0x93e1('0x5a')]=[{'all':!![]}];}return db[_0x93e1('0x57')][_0x93e1('0x5b')](_0x2364a8);})[_0x93e1('0x10')](function(_0x1e95aa){_0x43377f['rows']=_0x1e95aa;return _0x43377f;})[_0x93e1('0x10')](respondWithFilteredResult(_0x5775d3,_0x2364a8))[_0x93e1('0x5c')](handleError(_0x5775d3,null));};exports[_0x93e1('0x5d')]=function(_0x2c122c,_0x590c1d){var _0x36e645={'raw':![],'where':{'id':_0x2c122c['params']['id']},'include':[{'model':db[_0x93e1('0x3d')],'as':_0x93e1('0x3a')},{'model':db[_0x93e1('0x3e')],'as':'Smtp'},{'model':db[_0x93e1('0x3f')],'as':_0x93e1('0x40')}]},_0x3e9126={};_0x3e9126['model']=_[_0x93e1('0x48')](db[_0x93e1('0x57')][_0x93e1('0x42')]);_0x3e9126[_0x93e1('0x47')]=_[_0x93e1('0x48')](_0x2c122c['query']);_0x3e9126[_0x93e1('0x49')]=_['intersection'](_0x3e9126[_0x93e1('0x46')],_0x3e9126[_0x93e1('0x47')]);_0x36e645[_0x93e1('0x4c')]=_[_0x93e1('0x4a')](_0x3e9126['model'],qs[_0x93e1('0x4b')](_0x2c122c[_0x93e1('0x47')]['fields']));_0x36e645[_0x93e1('0x4c')]=_0x36e645[_0x93e1('0x4c')]['length']?_0x36e645['attributes']:_0x3e9126[_0x93e1('0x46')];if(_0x2c122c['query'][_0x93e1('0x59')]){_0x36e645[_0x93e1('0x5a')]=[{'all':!![]}];}_0x36e645=_[_0x93e1('0x55')]({},_0x36e645,_0x2c122c[_0x93e1('0x56')]);return db['MailAccount'][_0x93e1('0x5e')](_0x36e645)['then'](handleEntityNotFound(_0x590c1d,null))[_0x93e1('0x10')](respondWithResult(_0x590c1d,null))[_0x93e1('0x5c')](handleError(_0x590c1d,null));};exports[_0x93e1('0x1f')]=function(_0xc4cc9f,_0x10c7d8){if(_0xc4cc9f[_0x93e1('0x5f')]['id']){delete _0xc4cc9f['body']['id'];}var _0x59a723=_0xc4cc9f[_0x93e1('0x5f')][_0x93e1('0x60')]===_0x93e1('0x61')?null:_0xc4cc9f[_0x93e1('0x5f')][_0x93e1('0x60')];var _0x5635e5=_0xc4cc9f[_0x93e1('0x5f')]['Imap']||{};var _0x3679db=_0xc4cc9f['body'][_0x93e1('0x3b')]||{};if(_0x59a723){_0x5635e5['host']=getImapHost(_0x59a723);_0x5635e5[_0x93e1('0x35')]=0x3e1;_0x3679db['host']=getSmtpHost(_0x59a723);_0x3679db[_0x93e1('0x35')]=0x24b;_0x3679db[_0x93e1('0x37')]=![];}if(_0x3679db[_0x93e1('0x33')]){_0x3679db['secure']=![];}else{_0x3679db[_0x93e1('0x34')]=null;}if(!_0x5635e5[_0x93e1('0x33')])_0x5635e5[_0x93e1('0x34')]=null;_0xc4cc9f[_0x93e1('0x5f')]['Imap']=_0x5635e5;_0xc4cc9f[_0x93e1('0x5f')][_0x93e1('0x3b')]=_0x3679db;return db['MailAccount']['find']({'where':{'id':_0xc4cc9f[_0x93e1('0x62')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x93e1('0x3a')},{'model':db[_0x93e1('0x3e')],'as':_0x93e1('0x3b')},{'model':db[_0x93e1('0x3f')],'as':_0x93e1('0x40')}]})[_0x93e1('0x10')](handleEntityNotFound(_0x10c7d8,null))[_0x93e1('0x10')](function(_0x7287be){if(!_0x7287be)throw new Error(_0x93e1('0x63'));if(_0x7287be['service'])delete _0xc4cc9f[_0x93e1('0x5f')][_0x93e1('0x3a')];return _0x7287be;})['then'](saveUpdates(_0xc4cc9f[_0x93e1('0x5f')],null))['then'](function(_0x27363b){if(!_0xc4cc9f[_0x93e1('0x5f')][_0x93e1('0x3a')])return _0x27363b;return db[_0x93e1('0x3d')][_0x93e1('0x1f')](_0xc4cc9f[_0x93e1('0x5f')][_0x93e1('0x3a')],{'where':{'MailAccountId':_0x27363b['id']}})[_0x93e1('0x10')](function(){return _0x27363b;});})[_0x93e1('0x10')](function(_0x59e1b7){if(!_0xc4cc9f[_0x93e1('0x5f')]['Smtp'])return _0x59e1b7;return db[_0x93e1('0x3e')]['update'](_0xc4cc9f['body'][_0x93e1('0x3b')],{'where':{'MailAccountId':_0x59e1b7['id']}})[_0x93e1('0x10')](function(){return _0x59e1b7;});})['then'](respondWithResult(_0x10c7d8,null))[_0x93e1('0x5c')](handleError(_0x10c7d8,null));};exports['describe']=function(_0x68d376,_0x2a2092){return db[_0x93e1('0x57')][_0x93e1('0x64')]()[_0x93e1('0x10')](respondWithResult(_0x2a2092,null))[_0x93e1('0x5c')](handleError(_0x2a2092,null));};exports['addDisposition']=function(_0x31bd75,_0x2cb7b7){if(_0x31bd75['body']['id']){delete _0x31bd75[_0x93e1('0x5f')]['id'];}return db[_0x93e1('0x57')]['find']({'where':{'id':_0x31bd75[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x2cb7b7,null))[_0x93e1('0x10')](function(_0x13f463){if(_0x13f463){_0x31bd75[_0x93e1('0x5f')][_0x93e1('0x65')]=_0x13f463['id'];return db[_0x93e1('0x66')][_0x93e1('0x67')](_0x31bd75['body']);}})[_0x93e1('0x10')](respondWithResult(_0x2cb7b7,null))['catch'](handleError(_0x2cb7b7,null));};exports[_0x93e1('0x68')]=function(_0x3f8c93,_0xbc7b5b){var _0x37c2bc={'raw':![],'where':{}};var _0x525b01={};var _0x5c4879={'count':0x0,'rows':[]};return db[_0x93e1('0x57')][_0x93e1('0x69')]({'where':{'id':_0x3f8c93['params']['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0xbc7b5b,null))['then'](function(_0x16bfbf){if(_0x16bfbf){_0x525b01[_0x93e1('0x46')]=_[_0x93e1('0x48')](db[_0x93e1('0x66')][_0x93e1('0x42')]);_0x525b01[_0x93e1('0x47')]=_['keys'](_0x3f8c93[_0x93e1('0x47')]);_0x525b01[_0x93e1('0x49')]=_[_0x93e1('0x4a')](_0x525b01[_0x93e1('0x46')],_0x525b01[_0x93e1('0x47')]);_0x37c2bc[_0x93e1('0x4c')]=_[_0x93e1('0x4a')](_0x525b01['model'],qs[_0x93e1('0x4b')](_0x3f8c93['query']['fields']));_0x37c2bc[_0x93e1('0x4c')]=_0x37c2bc['attributes'][_0x93e1('0x4d')]?_0x37c2bc[_0x93e1('0x4c')]:_0x525b01[_0x93e1('0x46')];if(!_0x3f8c93[_0x93e1('0x47')][_0x93e1('0x6a')](_0x93e1('0x4e'))){_0x37c2bc[_0x93e1('0x1d')]=qs['limit'](_0x3f8c93[_0x93e1('0x47')][_0x93e1('0x1d')]);_0x37c2bc[_0x93e1('0x1c')]=qs[_0x93e1('0x1c')](_0x3f8c93[_0x93e1('0x47')][_0x93e1('0x1c')]);}_0x37c2bc['order']=qs[_0x93e1('0x50')](_0x3f8c93['query'][_0x93e1('0x50')]);_0x37c2bc[_0x93e1('0x51')]=qs[_0x93e1('0x49')](_[_0x93e1('0x52')](_0x3f8c93[_0x93e1('0x47')],_0x525b01['filters']));_0x37c2bc['where'][_0x93e1('0x65')]=_0x16bfbf['id'];if(_0x3f8c93['query'][_0x93e1('0x53')]){_0x37c2bc[_0x93e1('0x51')]=_['merge'](_0x37c2bc['where'],{'$or':_[_0x93e1('0x41')](_0x37c2bc[_0x93e1('0x4c')],function(_0x1169b8){var _0x11111e={};_0x11111e[_0x1169b8]={'$like':'%'+_0x3f8c93[_0x93e1('0x47')]['filter']+'%'};return _0x11111e;})});}_0x37c2bc=_[_0x93e1('0x55')]({},_0x37c2bc,_0x3f8c93[_0x93e1('0x56')]);return db[_0x93e1('0x66')][_0x93e1('0x58')]({'where':_0x37c2bc[_0x93e1('0x51')]})[_0x93e1('0x10')](function(_0x5326e8){_0x5c4879[_0x93e1('0x58')]=_0x5326e8;if(_0x3f8c93['query'][_0x93e1('0x59')]){_0x37c2bc[_0x93e1('0x5a')]=[{'all':!![]}];}return db[_0x93e1('0x66')][_0x93e1('0x5b')](_0x37c2bc);})[_0x93e1('0x10')](function(_0x29e418){_0x5c4879[_0x93e1('0x6b')]=_0x29e418;return _0x5c4879;});}})[_0x93e1('0x10')](respondWithFilteredResult(_0xbc7b5b,_0x37c2bc))[_0x93e1('0x5c')](handleError(_0xbc7b5b,null));};exports['removeDispositions']=function(_0x66f37c,_0x1d8d80){return db[_0x93e1('0x57')][_0x93e1('0x5e')]({'where':{'id':_0x66f37c[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x1d8d80,null))[_0x93e1('0x10')](function(_0x58b069){if(_0x58b069){return _0x58b069[_0x93e1('0x6c')](_0x66f37c[_0x93e1('0x47')]['ids']);}})[_0x93e1('0x10')](respondWithStatusCode(_0x1d8d80,null))[_0x93e1('0x5c')](handleError(_0x1d8d80,null));};exports['addAnswer']=function(_0x1ac56c,_0x539497){if(_0x1ac56c[_0x93e1('0x5f')]['id']){delete _0x1ac56c[_0x93e1('0x5f')]['id'];}return db[_0x93e1('0x57')][_0x93e1('0x5e')]({'where':{'id':_0x1ac56c[_0x93e1('0x62')]['id']}})['then'](handleEntityNotFound(_0x539497,null))['then'](function(_0x3445c7){if(_0x3445c7){_0x1ac56c[_0x93e1('0x5f')][_0x93e1('0x65')]=_0x3445c7['id'];return db[_0x93e1('0x6d')][_0x93e1('0x67')](_0x1ac56c[_0x93e1('0x5f')]);}})[_0x93e1('0x10')](respondWithResult(_0x539497,null))['catch'](handleError(_0x539497,null));};exports[_0x93e1('0x6e')]=function(_0x2cdf9d,_0x3ef76d){var _0x53c31a={'raw':![],'where':{}};var _0x1c963a={};var _0x4bbda7={'count':0x0,'rows':[]};return db[_0x93e1('0x57')]['findOne']({'where':{'id':_0x2cdf9d['params']['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x3ef76d,null))['then'](function(_0x4b84f7){if(_0x4b84f7){_0x1c963a[_0x93e1('0x46')]=_[_0x93e1('0x48')](db[_0x93e1('0x6d')][_0x93e1('0x42')]);_0x1c963a['query']=_[_0x93e1('0x48')](_0x2cdf9d[_0x93e1('0x47')]);_0x1c963a[_0x93e1('0x49')]=_[_0x93e1('0x4a')](_0x1c963a[_0x93e1('0x46')],_0x1c963a[_0x93e1('0x47')]);_0x53c31a['attributes']=_[_0x93e1('0x4a')](_0x1c963a[_0x93e1('0x46')],qs['fields'](_0x2cdf9d[_0x93e1('0x47')][_0x93e1('0x4b')]));_0x53c31a['attributes']=_0x53c31a[_0x93e1('0x4c')]['length']?_0x53c31a[_0x93e1('0x4c')]:_0x1c963a[_0x93e1('0x46')];if(!_0x2cdf9d[_0x93e1('0x47')][_0x93e1('0x6a')](_0x93e1('0x4e'))){_0x53c31a[_0x93e1('0x1d')]=qs[_0x93e1('0x1d')](_0x2cdf9d[_0x93e1('0x47')][_0x93e1('0x1d')]);_0x53c31a[_0x93e1('0x1c')]=qs['offset'](_0x2cdf9d['query']['offset']);}_0x53c31a[_0x93e1('0x4f')]=qs[_0x93e1('0x50')](_0x2cdf9d[_0x93e1('0x47')][_0x93e1('0x50')]);_0x53c31a['where']=qs[_0x93e1('0x49')](_['pick'](_0x2cdf9d['query'],_0x1c963a[_0x93e1('0x49')]));_0x53c31a[_0x93e1('0x51')][_0x93e1('0x65')]=_0x4b84f7['id'];if(_0x2cdf9d[_0x93e1('0x47')]['filter']){_0x53c31a['where']=_[_0x93e1('0x55')](_0x53c31a[_0x93e1('0x51')],{'$or':_[_0x93e1('0x41')](_0x53c31a[_0x93e1('0x4c')],function(_0x41a1c6){var _0x51e175={};_0x51e175[_0x41a1c6]={'$like':'%'+_0x2cdf9d['query'][_0x93e1('0x53')]+'%'};return _0x51e175;})});}_0x53c31a=_['merge']({},_0x53c31a,_0x2cdf9d[_0x93e1('0x56')]);return db[_0x93e1('0x6d')][_0x93e1('0x58')]({'where':_0x53c31a[_0x93e1('0x51')]})['then'](function(_0x3fb5e8){_0x4bbda7[_0x93e1('0x58')]=_0x3fb5e8;if(_0x2cdf9d[_0x93e1('0x47')][_0x93e1('0x59')]){_0x53c31a['include']=[{'all':!![]}];}return db[_0x93e1('0x6d')][_0x93e1('0x5b')](_0x53c31a);})[_0x93e1('0x10')](function(_0x54ac8e){_0x4bbda7['rows']=_0x54ac8e;return _0x4bbda7;});}})[_0x93e1('0x10')](respondWithFilteredResult(_0x3ef76d,_0x53c31a))[_0x93e1('0x5c')](handleError(_0x3ef76d,null));};exports[_0x93e1('0x6f')]=function(_0x1304f2,_0x4997e9){return db['MailAccount'][_0x93e1('0x5e')]({'where':{'id':_0x1304f2['params']['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x4997e9,null))[_0x93e1('0x10')](function(_0x397537){if(_0x397537){return _0x397537[_0x93e1('0x6f')](_0x1304f2[_0x93e1('0x47')][_0x93e1('0x70')]);}})[_0x93e1('0x10')](respondWithStatusCode(_0x4997e9,null))[_0x93e1('0x5c')](handleError(_0x4997e9,null));};exports['create']=function(_0x334e26,_0x2192ac){var _0x544fc2={'name':_0x334e26[_0x93e1('0x5f')][_0x93e1('0x23')],'key':_0x334e26[_0x93e1('0x5f')][_0x93e1('0x45')],'provider':_0x334e26[_0x93e1('0x5f')][_0x93e1('0x60')]===_0x93e1('0x61')?null:_0x334e26[_0x93e1('0x5f')][_0x93e1('0x60')],'email':_0x334e26[_0x93e1('0x5f')]['email'],'ListId':_0x334e26[_0x93e1('0x5f')][_0x93e1('0x71')],'active':!_['isNil'](_0x334e26[_0x93e1('0x5f')][_0x93e1('0x72')])?_0x334e26[_0x93e1('0x5f')][_0x93e1('0x72')]:!![],'description':_0x334e26[_0x93e1('0x5f')][_0x93e1('0x73')]||null};var _0x12ce6d=getAuthenticationOptions(_0x544fc2[_0x93e1('0x60')],_0x334e26[_0x93e1('0x5f')]);_0x544fc2[_0x93e1('0x3a')]=_0x12ce6d['Imap'];_0x544fc2[_0x93e1('0x3b')]=_0x12ce6d[_0x93e1('0x3b')];return db['MailAccount'][_0x93e1('0x67')](_0x544fc2,{'include':[{'model':db[_0x93e1('0x3e')],'as':'Smtp'},{'model':db[_0x93e1('0x3d')],'as':_0x93e1('0x3a')}]})['then'](function(_0xbaa25c){var _0x44fd31=_0x334e26[_0x93e1('0x2f')][_0x93e1('0x74')]({'plain':!![]});if(!_0x44fd31)throw new Error(_0x93e1('0x75'));if(_0x44fd31[_0x93e1('0x76')]===_0x93e1('0x2f')){var _0x404204=_0xbaa25c[_0x93e1('0x74')]({'plain':!![]});return db[_0x93e1('0x77')][_0x93e1('0x5e')]({'where':{'name':_0x93e1('0x21'),'userProfileId':_0x44fd31['userProfileId']},'raw':!![]})['then'](function(_0x401b3f){if(_0x401b3f&&_0x401b3f[_0x93e1('0x78')]===0x0){return db[_0x93e1('0x79')][_0x93e1('0x67')]({'name':_0x404204['name'],'resourceId':_0x404204['id'],'type':_0x401b3f[_0x93e1('0x23')],'sectionId':_0x401b3f['id']},{})[_0x93e1('0x10')](function(){return _0xbaa25c;});}else{return _0xbaa25c;}})[_0x93e1('0x5c')](function(_0x2776b2){logger[_0x93e1('0x14')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2776b2);throw _0x2776b2;});}return _0xbaa25c;})[_0x93e1('0x10')](respondWithResult(_0x2192ac,0xc9))[_0x93e1('0x5c')](handleError(_0x2192ac,null));};exports[_0x93e1('0x7a')]=function(_0x47d0f4,_0x2223cb){return db[_0x93e1('0x57')]['findOne']({'where':{'id':_0x47d0f4['params']['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x2223cb,null))[_0x93e1('0x10')](function(_0x533492){if(_0x533492){return _0x533492[_0x93e1('0x7a')]();}return null;})[_0x93e1('0x10')](respondWithResult(_0x2223cb,null))['catch'](handleError(_0x2223cb,null));};exports[_0x93e1('0x7b')]=function(_0x2650dc,_0x5f4e93){if(_0x2650dc[_0x93e1('0x5f')]['id']){delete _0x2650dc[_0x93e1('0x5f')]['id'];}return db['MailAccount'][_0x93e1('0x5e')]({'where':{'id':_0x2650dc['params']['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x5f4e93,null))[_0x93e1('0x10')](function(_0x48dfed){if(_0x48dfed){_0x2650dc['body'][_0x93e1('0x65')]=_0x48dfed['id'];return db[_0x93e1('0x3d')][_0x93e1('0x67')](_0x2650dc[_0x93e1('0x5f')]);}})[_0x93e1('0x10')](respondWithResult(_0x5f4e93,null))[_0x93e1('0x5c')](handleError(_0x5f4e93,null));};exports[_0x93e1('0x7c')]=function(_0x276bd9,_0x529363){return db[_0x93e1('0x57')][_0x93e1('0x69')]({'where':{'id':_0x276bd9[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x529363,null))['then'](function(_0x31b7fb){if(_0x31b7fb){return _0x31b7fb[_0x93e1('0x7d')](null);}return null;})['then'](respondWithStatusCode(_0x529363,null))[_0x93e1('0x5c')](handleError(_0x529363,null));};exports[_0x93e1('0x7e')]=function(_0x3176a9,_0x25f8f3){return db['MailAccount'][_0x93e1('0x69')]({'where':{'id':_0x3176a9['params']['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x25f8f3,null))['then'](function(_0x558451){if(_0x558451){return _0x558451[_0x93e1('0x7e')]();}return null;})[_0x93e1('0x10')](respondWithResult(_0x25f8f3,null))[_0x93e1('0x5c')](handleError(_0x25f8f3,null));};exports[_0x93e1('0x7f')]=function(_0x3c88ae,_0x191725){if(_0x3c88ae[_0x93e1('0x5f')]['id']){delete _0x3c88ae['body']['id'];}return db[_0x93e1('0x57')]['find']({'where':{'id':_0x3c88ae[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x191725,null))[_0x93e1('0x10')](function(_0x212e70){if(_0x212e70){_0x3c88ae[_0x93e1('0x5f')]['MailAccountId']=_0x212e70['id'];return db[_0x93e1('0x3e')][_0x93e1('0x67')](_0x3c88ae[_0x93e1('0x5f')]);}})[_0x93e1('0x10')](respondWithResult(_0x191725,null))[_0x93e1('0x5c')](handleError(_0x191725,null));};exports[_0x93e1('0x80')]=function(_0x2389ab,_0x216685){return db[_0x93e1('0x57')][_0x93e1('0x69')]({'where':{'id':_0x2389ab[_0x93e1('0x62')]['id']}})['then'](handleEntityNotFound(_0x216685,null))[_0x93e1('0x10')](function(_0x1a948d){if(_0x1a948d){return _0x1a948d['setSmtp'](null);}return null;})[_0x93e1('0x10')](respondWithStatusCode(_0x216685,null))[_0x93e1('0x5c')](handleError(_0x216685,null));};exports['addInteraction']=function(_0x5a2a1c,_0x1d4836){return db[_0x93e1('0x81')][_0x93e1('0x5e')]({'where':{'id':_0x5a2a1c[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x1d4836,null))[_0x93e1('0x10')](function(_0x16c935){if(_0x16c935){return _0x16c935[_0x93e1('0x82')](_0x5a2a1c[_0x93e1('0x5f')][_0x93e1('0x70')],_[_0x93e1('0x83')](_0x5a2a1c[_0x93e1('0x5f')],[_0x93e1('0x70'),'id'])||{});}})['then'](respondWithResult(_0x1d4836,null))[_0x93e1('0x5c')](handleError(_0x1d4836,null));};exports[_0x93e1('0x84')]=function(_0x576250,_0x3c483c){var _0x198902={'raw':![],'where':{}};var _0x4970c0={};var _0x762512={'count':0x0,'rows':[]};return db[_0x93e1('0x57')]['findOne']({'where':{'id':_0x576250[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x3c483c,null))['then'](function(_0xdc53a5){if(_0xdc53a5){_0x4970c0['model']=_[_0x93e1('0x48')](db[_0x93e1('0x81')][_0x93e1('0x42')]);_0x4970c0['query']=_[_0x93e1('0x48')](_0x576250[_0x93e1('0x47')]);_0x4970c0[_0x93e1('0x49')]=_[_0x93e1('0x4a')](_0x4970c0[_0x93e1('0x46')],_0x4970c0['query']);_0x198902[_0x93e1('0x4c')]=_[_0x93e1('0x4a')](_0x4970c0[_0x93e1('0x46')],qs[_0x93e1('0x4b')](_0x576250[_0x93e1('0x47')][_0x93e1('0x4b')]));_0x198902[_0x93e1('0x4c')]=_0x198902[_0x93e1('0x4c')][_0x93e1('0x4d')]?_0x198902[_0x93e1('0x4c')]:_0x4970c0[_0x93e1('0x46')];if(!_0x576250['query']['hasOwnProperty']('nolimit')){_0x198902['limit']=qs[_0x93e1('0x1d')](_0x576250[_0x93e1('0x47')][_0x93e1('0x1d')]);_0x198902[_0x93e1('0x1c')]=qs[_0x93e1('0x1c')](_0x576250[_0x93e1('0x47')][_0x93e1('0x1c')]);}_0x198902[_0x93e1('0x4f')]=qs[_0x93e1('0x50')](_0x576250[_0x93e1('0x47')][_0x93e1('0x50')]);_0x198902[_0x93e1('0x51')]=qs[_0x93e1('0x49')](_['pick'](_0x576250[_0x93e1('0x47')],_0x4970c0[_0x93e1('0x49')]));_0x198902['where'][_0x93e1('0x65')]=_0xdc53a5['id'];if(_0x576250[_0x93e1('0x47')][_0x93e1('0x53')]){_0x198902['where']=_[_0x93e1('0x55')](_0x198902[_0x93e1('0x51')],{'$or':_['map'](_0x198902['attributes'],function(_0x496201){var _0x5b78c2={};_0x5b78c2[_0x496201]={'$like':'%'+_0x576250[_0x93e1('0x47')]['filter']+'%'};return _0x5b78c2;})});}_0x198902=_[_0x93e1('0x55')]({},_0x198902,_0x576250['options']);return db[_0x93e1('0x81')]['count']({'where':_0x198902[_0x93e1('0x51')]})[_0x93e1('0x10')](function(_0x1f2a9e){_0x762512[_0x93e1('0x58')]=_0x1f2a9e;if(_0x576250['query'][_0x93e1('0x59')]){_0x198902[_0x93e1('0x5a')]=[{'model':db[_0x93e1('0x85')],'as':_0x93e1('0x86'),'required':![]},{'model':db[_0x93e1('0x87')],'as':'Owner','attributes':[_0x93e1('0x23'),_0x93e1('0x88'),_0x93e1('0x89')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name','color'],'where':_0x576250[_0x93e1('0x47')]['tag']?{'id':_0x576250[_0x93e1('0x47')][_0x93e1('0x8a')]}:undefined,'required':_0x576250[_0x93e1('0x47')][_0x93e1('0x8a')]?!![]:![]}];}return db[_0x93e1('0x81')]['findAll'](_0x198902);})[_0x93e1('0x10')](function(_0x3e14a1){_0x762512[_0x93e1('0x6b')]=_0x3e14a1;return _0x762512;});}})[_0x93e1('0x10')](respondWithFilteredResult(_0x3c483c,_0x198902))[_0x93e1('0x5c')](handleError(_0x3c483c,null));};exports['addApplications']=function addApplications(_0x4a0b7b,_0x87058b){var _0x816c22=_0x4a0b7b[_0x93e1('0x62')]['id'];var _0x34f1c9=_0x4a0b7b[_0x93e1('0x5f')];var _0x242eb1=0xc8;var _0x13d676=null;return db[_0x93e1('0x8b')][_0x93e1('0x8c')]({'isolationLevel':db['sequelize'][_0x93e1('0x8d')][_0x93e1('0x8e')][_0x93e1('0x8f')]},function(_0x5684b9){return db[_0x93e1('0x57')][_0x93e1('0x69')]({'where':{'id':_0x816c22},'transaction':_0x5684b9})['then'](function(_0x33572a){if(_0x33572a){return db[_0x93e1('0x90')]['destroy']({'where':{'MailAccountId':_0x816c22},'transaction':_0x5684b9})[_0x93e1('0x10')](function(){var _0x4bc950=_[_0x93e1('0x41')](_0x34f1c9,function(_0x1858ce){_0x1858ce['MailAccountId']=_0x816c22;return _0x1858ce;});return db[_0x93e1('0x90')][_0x93e1('0x91')](_0x4bc950,{'transaction':_0x5684b9});});}else{_0x242eb1=0x194;_0x13d676=[];}});})[_0x93e1('0x10')](function(){if(_0x242eb1!==0x194){return db[_0x93e1('0x90')][_0x93e1('0x92')]({'where':{'MailAccountId':_0x816c22},'order':_0x93e1('0x93')})[_0x93e1('0x10')](function(_0x4a897e){_0x13d676=_0x4a897e;});}})['catch'](function(_0xd4bc21){_0x242eb1=0x1f4;logger[_0x93e1('0x14')](_0xd4bc21['stack']);if(_0xd4bc21[_0x93e1('0x23')]){delete _0xd4bc21['name'];}_0x13d676=_0xd4bc21;})[_0x93e1('0x94')](function(){if(_0x13d676===null){_0x87058b[_0x93e1('0x18')](_0x242eb1);}else{if(_0x242eb1===0x1f4){_0x87058b[_0x93e1('0x19')](_0x242eb1)[_0x93e1('0x24')](_0x13d676);}else{_0x87058b[_0x93e1('0x19')](_0x242eb1)['json'](_0x13d676);}}});};exports[_0x93e1('0x95')]=function(_0xde7b38,_0x5ab223){var _0x49af14={};var _0xd3e700={};var _0x31412b;var _0x7c5db7;return db[_0x93e1('0x57')][_0x93e1('0x69')]({'where':{'id':_0xde7b38[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x5ab223,null))[_0x93e1('0x10')](function(_0x1e0561){if(_0x1e0561){_0x31412b=_0x1e0561;_0xd3e700[_0x93e1('0x46')]=_[_0x93e1('0x48')](db[_0x93e1('0x90')]['rawAttributes']);_0xd3e700[_0x93e1('0x47')]=_['keys'](_0xde7b38[_0x93e1('0x47')]);_0xd3e700[_0x93e1('0x49')]=_[_0x93e1('0x4a')](_0xd3e700['model'],_0xd3e700[_0x93e1('0x47')]);_0x49af14[_0x93e1('0x4c')]=_['intersection'](_0xd3e700[_0x93e1('0x46')],qs[_0x93e1('0x4b')](_0xde7b38[_0x93e1('0x47')]['fields']));_0x49af14['attributes']=_0x49af14[_0x93e1('0x4c')][_0x93e1('0x4d')]?_0x49af14[_0x93e1('0x4c')]:_0xd3e700[_0x93e1('0x46')];_0x49af14[_0x93e1('0x4f')]=qs[_0x93e1('0x50')](_0xde7b38['query'][_0x93e1('0x50')]);_0x49af14[_0x93e1('0x51')]=qs[_0x93e1('0x49')](_['pick'](_0xde7b38[_0x93e1('0x47')],_0xd3e700['filters']));if(_0xde7b38['query'][_0x93e1('0x53')]){_0x49af14[_0x93e1('0x51')]=_['merge'](_0x49af14['where'],{'$or':_[_0x93e1('0x41')](_0x49af14[_0x93e1('0x4c')],function(_0x21c246){var _0x452f8d={};_0x452f8d[_0x21c246]={'$like':'%'+_0xde7b38['query'][_0x93e1('0x53')]+'%'};return _0x452f8d;})});}_0x49af14=_[_0x93e1('0x55')]({},_0x49af14,_0xde7b38[_0x93e1('0x56')]);return _0x31412b['getApplications'](_0x49af14);}})[_0x93e1('0x10')](function(_0x2f7722){if(_0x2f7722){_0x7c5db7=_0x2f7722[_0x93e1('0x4d')];if(!_0xde7b38[_0x93e1('0x47')][_0x93e1('0x6a')](_0x93e1('0x4e'))){_0x49af14[_0x93e1('0x1d')]=qs[_0x93e1('0x1d')](_0xde7b38[_0x93e1('0x47')]['limit']);_0x49af14[_0x93e1('0x1c')]=qs[_0x93e1('0x1c')](_0xde7b38[_0x93e1('0x47')][_0x93e1('0x1c')]);}return _0x31412b[_0x93e1('0x95')](_0x49af14);}})[_0x93e1('0x10')](function(_0xc5ef4b){if(_0xc5ef4b){return _0xc5ef4b?{'count':_0x7c5db7,'rows':_0xc5ef4b}:null;}})['then'](respondWithResult(_0x5ab223,null))['catch'](handleError(_0x5ab223,null));};exports[_0x93e1('0x96')]=function(_0x56646c,_0x5b69f9){var _0x5cf7a1={'raw':!![],'where':{}};var _0x35c2ca={};var _0x25c10f={'count':0x0,'rows':[]};return db[_0x93e1('0x57')][_0x93e1('0x69')]({'where':{'id':_0x56646c[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x5b69f9,null))[_0x93e1('0x10')](function(_0x582935){if(_0x582935){_0x35c2ca['model']=_['keys'](db[_0x93e1('0x97')][_0x93e1('0x42')]);_0x35c2ca[_0x93e1('0x47')]=_['keys'](_0x56646c[_0x93e1('0x47')]);_0x35c2ca[_0x93e1('0x49')]=_[_0x93e1('0x4a')](_0x35c2ca['model'],_0x35c2ca[_0x93e1('0x47')]);_0x5cf7a1[_0x93e1('0x4c')]=_['intersection'](_0x35c2ca[_0x93e1('0x46')],qs[_0x93e1('0x4b')](_0x56646c['query'][_0x93e1('0x4b')]));_0x5cf7a1[_0x93e1('0x4c')]=_0x5cf7a1[_0x93e1('0x4c')]['length']?_0x5cf7a1[_0x93e1('0x4c')]:_0x35c2ca[_0x93e1('0x46')];if(!_0x56646c[_0x93e1('0x47')][_0x93e1('0x6a')](_0x93e1('0x4e'))){_0x5cf7a1['limit']=qs[_0x93e1('0x1d')](_0x56646c[_0x93e1('0x47')][_0x93e1('0x1d')]);_0x5cf7a1[_0x93e1('0x1c')]=qs[_0x93e1('0x1c')](_0x56646c[_0x93e1('0x47')][_0x93e1('0x1c')]);}_0x5cf7a1[_0x93e1('0x4f')]=qs[_0x93e1('0x50')](_0x56646c['query'][_0x93e1('0x50')]);_0x5cf7a1[_0x93e1('0x51')]=qs[_0x93e1('0x49')](_[_0x93e1('0x52')](_0x56646c[_0x93e1('0x47')],_0x35c2ca[_0x93e1('0x49')]));_0x5cf7a1[_0x93e1('0x51')][_0x93e1('0x65')]=_0x582935['id'];if(_0x56646c[_0x93e1('0x47')]['filter']){_0x5cf7a1['where']=_[_0x93e1('0x55')](_0x5cf7a1['where'],{'$or':_[_0x93e1('0x41')](_0x5cf7a1[_0x93e1('0x4c')],function(_0x55679a){var _0x561f7b={};_0x561f7b[_0x55679a]={'$like':'%'+_0x56646c['query'][_0x93e1('0x53')]+'%'};return _0x561f7b;})});}if(_0x56646c[_0x93e1('0x47')]['$gte']){var _0x348cab=_0x56646c[_0x93e1('0x47')][_0x93e1('0x98')][_0x93e1('0x99')](',');var _0x4d331a={};_0x4d331a[_0x348cab[0x0]]={'$gte':moment(_0x348cab[0x1])['format'](_0x93e1('0x9a'))};_0x5cf7a1[_0x93e1('0x51')]=_[_0x93e1('0x55')](_0x5cf7a1['where'],_0x4d331a);}_0x5cf7a1=_[_0x93e1('0x55')]({},_0x5cf7a1,_0x56646c[_0x93e1('0x56')]);return db[_0x93e1('0x97')][_0x93e1('0x58')]({'where':_0x5cf7a1[_0x93e1('0x51')]})[_0x93e1('0x10')](function(_0x251ff3){_0x25c10f[_0x93e1('0x58')]=_0x251ff3;if(_0x56646c[_0x93e1('0x47')][_0x93e1('0x59')]){_0x5cf7a1[_0x93e1('0x5a')]=[{'all':!![]}];}return db[_0x93e1('0x97')][_0x93e1('0x5b')](_0x5cf7a1);})[_0x93e1('0x10')](function(_0x29929d){if(_0x56646c[_0x93e1('0x47')][_0x93e1('0x9b')]===_0x93e1('0x9c')){for(var _0x4d34f6=0x0;_0x4d34f6<_0x29929d[_0x93e1('0x4d')];_0x4d34f6++){_0x29929d[_0x4d34f6][_0x93e1('0x5f')]=juice(_0x29929d[_0x4d34f6][_0x93e1('0x5f')]);}}_0x25c10f['rows']=_0x29929d;return _0x25c10f;});}})[_0x93e1('0x10')](respondWithFilteredResult(_0x5b69f9,_0x5cf7a1))[_0x93e1('0x5c')](handleError(_0x5b69f9,null));};exports[_0x93e1('0x24')]=function(_0x4ae19d,_0x1f1256){var _0x3e6d99,_0xe5c726={},_0x404ddb;if(_0x4ae19d[_0x93e1('0x5f')]['to']){_0x404ddb=_0x4ae19d[_0x93e1('0x5f')]['to'][_0x93e1('0x99')](',')[0x0];}return db['MailAccount'][_0x93e1('0x5e')]({'where':{'id':_0x4ae19d[_0x93e1('0x62')]['id']},'include':[{'model':db[_0x93e1('0x9d')],'as':_0x93e1('0x9e'),'include':[{'model':db[_0x93e1('0x85')],'as':_0x93e1('0x9f'),'where':{'email':_0x404ddb},'limit':0x1,'order':[[_0x93e1('0xa0'),'DESC']]}]},{'model':db[_0x93e1('0x3e')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x93e1('0xa1')],'as':_0x93e1('0xa1'),'raw':!![]}]}]})[_0x93e1('0x10')](handleEntityNotFound(_0x1f1256,null))[_0x93e1('0x10')](function(_0xd8efe8){if(!_0xd8efe8)return;_0x3e6d99=_0xd8efe8;if(!_0xd8efe8[_0x93e1('0x3b')])throw new Error(_0x93e1('0xa2'));if(_[_0x93e1('0xa3')](_0x4ae19d[_0x93e1('0x5f')][_0x93e1('0xa4')])){_0x4ae19d['body'][_0x93e1('0xa4')]=util[_0x93e1('0xa5')]('%s\x20<%s>',_0xd8efe8['name'],_0xd8efe8[_0x93e1('0xa6')]||_0xd8efe8[_0x93e1('0x3b')][_0x93e1('0x2f')]);}if(_0x4ae19d['body'][_0x93e1('0xa7')]&&_0x4ae19d[_0x93e1('0x5f')][_0x93e1('0xa7')][_0x93e1('0x4d')]){for(var _0xbba029=0x0;_0xbba029<_0x4ae19d['body'][_0x93e1('0xa7')][_0x93e1('0x4d')];_0xbba029+=0x1){_0x4ae19d['body']['attachments'][_0xbba029]={'filename':_0x4ae19d['body'][_0x93e1('0xa7')][_0xbba029][_0x93e1('0x23')],'path':path[_0x93e1('0xa8')](config[_0x93e1('0xa9')],_0x93e1('0xaa'),_0x4ae19d['body'][_0x93e1('0xa7')][_0xbba029]['basename'])};}}var _0x8a8153=_0xd8efe8[_0x93e1('0xab')]();return respondWithRpcPromise(_0x93e1('0xac'),_0x93e1('0xad'),{'account':_0x8a8153,'message':_0x4ae19d[_0x93e1('0x5f')]});})[_0x93e1('0x10')](function(_0x1ddd9b){if(!_0x1ddd9b)return;_0xe5c726=_0x1ddd9b;if(!_0x3e6d99['List'])throw new Error(_0x93e1('0xae'));if(_0x3e6d99['List'][_0x93e1('0x9f')][_0x93e1('0x4d')])return _0x3e6d99[_0x93e1('0x9e')][_0x93e1('0x9f')][0x0];return db[_0x93e1('0x85')]['create'](_[_0x93e1('0xa')](_0x4ae19d['body'],{'firstName':_0x4ae19d['body']['to'],'email':_0x4ae19d['body']['to'],'phone':_0x4ae19d[_0x93e1('0x5f')]['to'],'ListId':_0x3e6d99[_0x93e1('0x71')]}));})[_0x93e1('0x10')](function(_0x24d6f4){if(!_0x24d6f4)return;var _0x57012c={'UserId':_0x4ae19d['user']['id'],'ContactId':_0x24d6f4['id'],'MailAccountId':_0x3e6d99['id'],'inReplyTo':_0xe5c726[_0x93e1('0xaf')],'to':_0x4ae19d[_0x93e1('0x5f')][_0x93e1('0xa4')],'cc':_0x4ae19d[_0x93e1('0x5f')]['cc'],'subject':_0x4ae19d[_0x93e1('0x5f')][_0x93e1('0xb0')],'attach':_0x4ae19d[_0x93e1('0x5f')]['attach'],'firstMsgDirection':_0x93e1('0xb1'),'lastMsgAt':moment()[_0x93e1('0xa5')](_0x93e1('0x9a')),'lastMsgDirection':_0x93e1('0xb1'),'Messages':[_['merge'](_0x4ae19d['body'],{'messageId':_0xe5c726['messageId'],'sentAt':moment()['format'](_0x93e1('0x9a')),'read':!![],'MailAccountId':_0x3e6d99['id'],'UserId':_0x4ae19d[_0x93e1('0x2f')]['id'],'ContactId':_0x24d6f4['id']})]};if(_0x4ae19d['body']['Interaction']){_0x57012c=_[_0x93e1('0x55')](_0x57012c,_0x4ae19d[_0x93e1('0x5f')]['Interaction']);}return db[_0x93e1('0x81')]['create'](_0x57012c,{'include':[{'model':db[_0x93e1('0x97')],'as':'Messages'}]});})[_0x93e1('0x10')](respondWithResult(_0x1f1256,null))[_0x93e1('0x5c')](handleError(_0x1f1256,null));};exports['verifySmtp']=function(_0x18a39b,_0x20fbab){return db[_0x93e1('0x57')]['find']({'where':{'id':_0x18a39b[_0x93e1('0x62')]['id']},'include':[{'model':db[_0x93e1('0x3e')],'as':_0x93e1('0x3b'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x93e1('0xa1'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20fbab,null))[_0x93e1('0x10')](function(_0x2a7ee6){if(!_0x2a7ee6[_0x93e1('0x3b')])return;var _0x4ce823=_0x2a7ee6[_0x93e1('0xab')]();return respondWithRpcPromise('VerifySmtp',_0x93e1('0xb2'),{'account':_0x4ce823});})[_0x93e1('0x10')](respondWithResult(_0x20fbab,null))['catch'](handleError(_0x20fbab,null));};exports[_0x93e1('0x20')]=function(_0x579994,_0x413c42){return db[_0x93e1('0x57')][_0x93e1('0x5e')]({'where':{'id':_0x579994[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x413c42,null))['then'](function(_0x37da3d){if(_0x37da3d&&_0x37da3d[_0x93e1('0x38')]){throw new db['Sequelize'][(_0x93e1('0xb3'))](_0x93e1('0xb4'));}return _0x37da3d;})[_0x93e1('0x10')](removeEntity(_0x413c42,null))['catch'](handleError(_0x413c42,null));};exports['addAgents']=function(_0x3d85ba,_0x4d4408){return db[_0x93e1('0x57')][_0x93e1('0x5e')]({'where':{'id':_0x3d85ba[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x4d4408,null))[_0x93e1('0x10')](function(_0x1d99aa){if(_0x1d99aa){return _0x1d99aa[_0x93e1('0xb5')](_0x3d85ba['body'][_0x93e1('0x70')],_['omit'](_0x3d85ba[_0x93e1('0x5f')],[_0x93e1('0x70'),'id'])||{})[_0x93e1('0xb6')](function(_0x22681d){for(var _0x3a6681=0x0;_0x3a6681<_0x3d85ba[_0x93e1('0x5f')][_0x93e1('0x70')][_0x93e1('0x4d')];_0x3a6681+=0x1){socket['emit'](_0x93e1('0xb7'),{'UserId':Number(_0x3d85ba['body'][_0x93e1('0x70')][_0x3a6681]),'MailAccountId':Number(_0x3d85ba[_0x93e1('0x62')]['id'])});}return _0x22681d;});}})['then'](respondWithResult(_0x4d4408,null))['catch'](handleError(_0x4d4408,null));};exports[_0x93e1('0xb8')]=function(_0x5ba0d9,_0x2cffa0){return db[_0x93e1('0x57')][_0x93e1('0x5e')]({'where':{'id':_0x5ba0d9[_0x93e1('0x62')]['id']}})['then'](handleEntityNotFound(_0x2cffa0,null))['then'](function(_0x1df07f){if(_0x1df07f){return _0x1df07f[_0x93e1('0xb8')](_0x5ba0d9[_0x93e1('0x47')][_0x93e1('0x70')])['then'](function(){if(_[_0x93e1('0xb9')](_0x5ba0d9[_0x93e1('0x47')]['ids'])){for(var _0x8d1c1b=0x0;_0x8d1c1b<_0x5ba0d9[_0x93e1('0x47')][_0x93e1('0x70')][_0x93e1('0x4d')];_0x8d1c1b+=0x1){socket[_0x93e1('0xba')](_0x93e1('0xbb'),{'UserId':Number(_0x5ba0d9[_0x93e1('0x47')][_0x93e1('0x70')][_0x8d1c1b]),'MailAccountId':Number(_0x5ba0d9[_0x93e1('0x62')]['id'])});}}else{socket[_0x93e1('0xba')]('userMailAccount:remove',{'UserId':Number(_0x5ba0d9[_0x93e1('0x47')][_0x93e1('0x70')]),'MailAccountId':Number(_0x5ba0d9[_0x93e1('0x62')]['id'])});}});}})[_0x93e1('0x10')](respondWithStatusCode(_0x2cffa0,null))[_0x93e1('0x5c')](handleError(_0x2cffa0,null));};exports['getAgents']=function(_0x371f67,_0x171513){var _0x46f4a1={};var _0x39315c={};var _0x58629f;var _0x38f18c;return db[_0x93e1('0x57')][_0x93e1('0x69')]({'where':{'id':_0x371f67[_0x93e1('0x62')]['id']}})[_0x93e1('0x10')](handleEntityNotFound(_0x171513,null))[_0x93e1('0x10')](function(_0x56487d){if(_0x56487d){_0x58629f=_0x56487d;_0x39315c[_0x93e1('0x46')]=_[_0x93e1('0x48')](db[_0x93e1('0x87')]['rawAttributes']);_0x39315c[_0x93e1('0x47')]=_[_0x93e1('0x48')](_0x371f67[_0x93e1('0x47')]);_0x39315c[_0x93e1('0x49')]=_['intersection'](_0x39315c[_0x93e1('0x46')],_0x39315c[_0x93e1('0x47')]);_0x46f4a1[_0x93e1('0x4c')]=_['intersection'](_0x39315c[_0x93e1('0x46')],qs[_0x93e1('0x4b')](_0x371f67[_0x93e1('0x47')][_0x93e1('0x4b')]));_0x46f4a1['attributes']=_0x46f4a1[_0x93e1('0x4c')][_0x93e1('0x4d')]?_0x46f4a1['attributes']:_0x39315c[_0x93e1('0x46')];_0x46f4a1[_0x93e1('0x4f')]=qs[_0x93e1('0x50')](_0x371f67[_0x93e1('0x47')][_0x93e1('0x50')]);_0x46f4a1['where']=qs[_0x93e1('0x49')](_[_0x93e1('0x52')](_0x371f67[_0x93e1('0x47')],_0x39315c['filters']));if(_0x371f67[_0x93e1('0x47')][_0x93e1('0x53')]){_0x46f4a1['where']=_[_0x93e1('0x55')](_0x46f4a1[_0x93e1('0x51')],{'$or':_[_0x93e1('0x41')](_0x46f4a1[_0x93e1('0x4c')],function(_0x3e125d){var _0x50b182={};_0x50b182[_0x3e125d]={'$like':'%'+_0x371f67[_0x93e1('0x47')][_0x93e1('0x53')]+'%'};return _0x50b182;})});}_0x46f4a1=_['merge']({},_0x46f4a1,_0x371f67[_0x93e1('0x56')]);return _0x58629f[_0x93e1('0xbc')](_0x46f4a1);}})[_0x93e1('0x10')](function(_0x599346){if(_0x599346){_0x38f18c=_0x599346[_0x93e1('0x4d')];if(!_0x371f67[_0x93e1('0x47')][_0x93e1('0x6a')]('nolimit')){_0x46f4a1[_0x93e1('0x1d')]=qs[_0x93e1('0x1d')](_0x371f67[_0x93e1('0x47')][_0x93e1('0x1d')]);_0x46f4a1[_0x93e1('0x1c')]=qs[_0x93e1('0x1c')](_0x371f67[_0x93e1('0x47')]['offset']);}return _0x58629f[_0x93e1('0xbc')](_0x46f4a1);}})[_0x93e1('0x10')](function(_0x29fdd4){if(_0x29fdd4){return _0x29fdd4?{'count':_0x38f18c,'rows':_0x29fdd4}:null;}})[_0x93e1('0x10')](respondWithResult(_0x171513,null))[_0x93e1('0x5c')](handleError(_0x171513,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b6ed46e..6ae0490 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 _0x930b=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x177b30,_0x26b916){var _0x3f148c=function(_0x3c6216){while(--_0x3c6216){_0x177b30['push'](_0x177b30['shift']());}};_0x3f148c(++_0x26b916);}(_0x930b,0x106));var _0xb930=function(_0x3aa82c,_0x45b770){_0x3aa82c=_0x3aa82c-0x0;var _0x4afcbe=_0x930b[_0x3aa82c];return _0x4afcbe;};'use strict';var EventEmitter=require(_0xb930('0x0'));var MailAccount=require(_0xb930('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb930('0x2')](0x0);var events={'afterCreate':_0xb930('0x3'),'afterUpdate':_0xb930('0x4'),'afterDestroy':'remove'};function emitEvent(_0x59c730){return function(_0x3bf5d0,_0x31400f,_0xa9cacd){MailAccountEvents['emit'](_0x59c730+':'+_0x3bf5d0['id'],_0x3bf5d0);MailAccountEvents[_0xb930('0x5')](_0x59c730,_0x3bf5d0);_0xa9cacd(null);};}for(var e in events){if(events[_0xb930('0x6')](e)){var event=events[e];MailAccount[_0xb930('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0xa786=['exports','events','../../mysqldb','MailAccount','save','emit','hasOwnProperty'];(function(_0x224b2f,_0x192fc7){var _0x3e5ed4=function(_0x2a069e){while(--_0x2a069e){_0x224b2f['push'](_0x224b2f['shift']());}};_0x3e5ed4(++_0x192fc7);}(_0xa786,0x71));var _0x6a78=function(_0x22d577,_0x1cd3c6){_0x22d577=_0x22d577-0x0;var _0x317265=_0xa786[_0x22d577];return _0x317265;};'use strict';var EventEmitter=require(_0x6a78('0x0'));var MailAccount=require(_0x6a78('0x1'))['db'][_0x6a78('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6a78('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x47d5d5){return function(_0x2b0fed,_0x3b3608,_0x19285c){MailAccountEvents[_0x6a78('0x4')](_0x47d5d5+':'+_0x2b0fed['id'],_0x2b0fed);MailAccountEvents[_0x6a78('0x4')](_0x47d5d5,_0x2b0fed);_0x19285c(null);};}for(var e in events){if(events[_0x6a78('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x6a78('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 4ee8ff3..4dfb952 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 _0xbe55=['exports','MailAccount','mail_accounts','provider','service','host','Smtp','port','secure','Cloud\x20Provider\x20configuration\x20not\x20found','auth','CloudProvider','data5','user','pass','./mailAccount.attributes'];(function(_0x5c58f4,_0x2b37d1){var _0x3e230e=function(_0x30344a){while(--_0x30344a){_0x5c58f4['push'](_0x5c58f4['shift']());}};_0x3e230e(++_0x2b37d1);}(_0xbe55,0x13f));var _0x5be5=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xbe55[_0x1b349a];return _0x5d1f7c;};'use strict';var attributes=require(_0x5be5('0x0'));module[_0x5be5('0x1')]=function(_0x22a72e){return _0x22a72e['define'](_0x5be5('0x2'),attributes,{'tableName':_0x5be5('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x33d0a3=this;var _0x4962f8={'id':_0x33d0a3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x33d0a3[_0x5be5('0x4')]!=='custom'){_0x4962f8[_0x5be5('0x5')]=_0x33d0a3[_0x5be5('0x4')];}else{_0x4962f8[_0x5be5('0x6')]=_0x33d0a3['Smtp']['host'];_0x4962f8['port']=_0x33d0a3[_0x5be5('0x7')][_0x5be5('0x8')];_0x4962f8[_0x5be5('0x9')]=_0x33d0a3['Smtp'][_0x5be5('0x9')];}if(_0x33d0a3[_0x5be5('0x7')]['authentication']){if(_0x33d0a3[_0x5be5('0x7')]['modernAuthentication']){if(!_0x33d0a3['Smtp']['CloudProvider'])throw new Error(_0x5be5('0xa'));_0x4962f8[_0x5be5('0xb')]={'type':'OAuth2','user':_0x33d0a3[_0x5be5('0x7')]['user'],'accessToken':_0x33d0a3[_0x5be5('0x7')][_0x5be5('0xc')][_0x5be5('0xd')]};}else{_0x4962f8[_0x5be5('0xb')]={'user':_0x33d0a3[_0x5be5('0x7')][_0x5be5('0xe')],'pass':_0x33d0a3[_0x5be5('0x7')][_0x5be5('0xf')]};}}return _0x4962f8;}}});}; \ No newline at end of file +var _0xd6c7=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','data5','user','pass'];(function(_0x2a8926,_0x3c219e){var _0x35bd60=function(_0x3ccd3b){while(--_0x3ccd3b){_0x2a8926['push'](_0x2a8926['shift']());}};_0x35bd60(++_0x3c219e);}(_0xd6c7,0xab));var _0x7d6c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd6c7[_0x2f5ac5];return _0x37c9a8;};'use strict';var attributes=require(_0x7d6c('0x0'));module[_0x7d6c('0x1')]=function(_0x1c618b){return _0x1c618b[_0x7d6c('0x2')](_0x7d6c('0x3'),attributes,{'tableName':_0x7d6c('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3aebea=this;var _0x13b2b8={'id':_0x3aebea['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3aebea[_0x7d6c('0x5')]!=='custom'){_0x13b2b8[_0x7d6c('0x6')]=_0x3aebea[_0x7d6c('0x5')];}else{_0x13b2b8[_0x7d6c('0x7')]=_0x3aebea[_0x7d6c('0x8')]['host'];_0x13b2b8[_0x7d6c('0x9')]=_0x3aebea[_0x7d6c('0x8')][_0x7d6c('0x9')];_0x13b2b8[_0x7d6c('0xa')]=_0x3aebea[_0x7d6c('0x8')][_0x7d6c('0xa')];}if(_0x3aebea[_0x7d6c('0x8')][_0x7d6c('0xb')]){if(_0x3aebea['Smtp'][_0x7d6c('0xc')]){if(!_0x3aebea[_0x7d6c('0x8')][_0x7d6c('0xd')])throw new Error(_0x7d6c('0xe'));_0x13b2b8[_0x7d6c('0xf')]={'type':'OAuth2','user':_0x3aebea[_0x7d6c('0x8')]['user'],'accessToken':_0x3aebea[_0x7d6c('0x8')][_0x7d6c('0xd')][_0x7d6c('0x10')]};}else{_0x13b2b8[_0x7d6c('0xf')]={'user':_0x3aebea['Smtp'][_0x7d6c('0x11')],'pass':_0x3aebea['Smtp'][_0x7d6c('0x12')]};}}return _0x13b2b8;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 6839b5a..537d377 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 _0xf006=['agent','waitForTheAssignedAgent','MailQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','bluebird','randomstring','../../mysqldb','rpc','client','http','redis','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','MailAccount,\x20%s,\x20%s','result','catch','GetMailAccount','MailAccount','raw','options','attributes','limit','map','include','model','find','where','setDataValue','getSmtpOptions','ShowMailAccount','NotifyMailAccount','body','mail','difference','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','account','List','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','CloudProvider','omit','smtpOptions','applications','orderBy','priority','autoclose','push','length','close','*,*,*,*','defaults','ListId','create','contact','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','update','attach','get','interaction','created','MailMessage','attachments','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachment','UserId','User','name','unshift'];(function(_0x1070b5,_0x3398bc){var _0x1eee10=function(_0x2bfffe){while(--_0x2bfffe){_0x1070b5['push'](_0x1070b5['shift']());}};_0x1eee10(++_0x3398bc);}(_0xf006,0x146));var _0x6f00=function(_0x40edf5,_0x468936){_0x40edf5=_0x40edf5-0x0;var _0x267c71=_0xf006[_0x40edf5];return _0x267c71;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x6f00('0x0'));var rs=require(_0x6f00('0x1'));var Redis=require('ioredis');var db=require(_0x6f00('0x2'))['db'];var logger=require('../../config/logger')(_0x6f00('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6f00('0x4')][_0x6f00('0x5')]({'port':0x232c});config[_0x6f00('0x6')]=_['defaults'](config[_0x6f00('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f00('0x7'))(new Redis(config[_0x6f00('0x6')]));require(_0x6f00('0x8'))[_0x6f00('0x9')](socket);function respondWithRpcPromise(_0x286d32,_0x3001c6,_0x44b63c){return new BPromise(function(_0x1e0720,_0x2aa181){return client[_0x6f00('0xa')](_0x286d32,_0x44b63c)[_0x6f00('0xb')](function(_0x13b052){logger[_0x6f00('0xc')]('MailAccount,\x20%s,\x20%s',_0x3001c6,_0x6f00('0xd'));logger[_0x6f00('0xe')](_0x6f00('0xf'),_0x3001c6,_0x6f00('0xd'),JSON[_0x6f00('0x10')](_0x13b052));if(_0x13b052['error']){if(_0x13b052[_0x6f00('0x11')]['code']===0x1f4){logger[_0x6f00('0x11')]('MailAccount,\x20%s,\x20%s',_0x3001c6,_0x13b052[_0x6f00('0x11')][_0x6f00('0x12')]);return _0x2aa181(_0x13b052[_0x6f00('0x11')][_0x6f00('0x12')]);}logger[_0x6f00('0x11')](_0x6f00('0x13'),_0x3001c6,_0x13b052[_0x6f00('0x11')][_0x6f00('0x12')]);return _0x1e0720(_0x13b052[_0x6f00('0x11')]['message']);}else{logger[_0x6f00('0xc')]('MailAccount,\x20%s,\x20%s',_0x3001c6,'request\x20sent');_0x1e0720(_0x13b052[_0x6f00('0x14')][_0x6f00('0x12')]);}})[_0x6f00('0x15')](function(_0x340f78){logger[_0x6f00('0x11')](_0x6f00('0x13'),_0x3001c6,_0x340f78);_0x2aa181(_0x340f78);});});}exports[_0x6f00('0x16')]=function(_0x295640){var _0x9844bf=this;return new Promise(function(_0x198cc7,_0x2d807f){return db[_0x6f00('0x17')]['findAll']({'raw':_0x295640['options']?_0x295640['options'][_0x6f00('0x18')]===undefined?!![]:![]:!![],'where':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')]['where']||null:null,'attributes':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')][_0x6f00('0x1a')]||null:null,'limit':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')][_0x6f00('0x1b')]||null:null,'include':_0x295640[_0x6f00('0x19')]?_0x295640[_0x6f00('0x19')]['include']?_[_0x6f00('0x1c')](_0x295640[_0x6f00('0x19')][_0x6f00('0x1d')],function(_0x4d41ef){return{'model':db[_0x4d41ef[_0x6f00('0x1e')]],'as':_0x4d41ef['as'],'attributes':_0x4d41ef['attributes'],'include':_0x4d41ef[_0x6f00('0x1d')]?_['map'](_0x4d41ef[_0x6f00('0x1d')],function(_0x39375d){return{'model':db[_0x39375d[_0x6f00('0x1e')]],'as':_0x39375d['as'],'attributes':_0x39375d[_0x6f00('0x1a')],'include':_0x39375d[_0x6f00('0x1d')]?_['map'](_0x39375d[_0x6f00('0x1d')],function(_0x25cc71){return{'model':db[_0x25cc71[_0x6f00('0x1e')]],'as':_0x25cc71['as'],'attributes':_0x25cc71[_0x6f00('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6f00('0xb')](function(_0x235a86){logger[_0x6f00('0xc')](_0x6f00('0x16'),_0x295640);logger[_0x6f00('0xe')](_0x6f00('0x16'),_0x295640,JSON[_0x6f00('0x10')](_0x235a86));_0x198cc7(_0x235a86);})[_0x6f00('0x15')](function(_0x29555d){logger[_0x6f00('0x11')]('GetMailAccount',_0x29555d['message'],_0x295640);_0x2d807f(_0x9844bf['error'](0x1f4,_0x29555d['message']));});});};exports['ShowMailAccount']=function(_0x4edc83){var _0xc5ad42=this;return new Promise(function(_0x56338c,_0x3c0e5d){return db[_0x6f00('0x17')][_0x6f00('0x1f')]({'raw':_0x4edc83[_0x6f00('0x19')]?_0x4edc83[_0x6f00('0x19')][_0x6f00('0x18')]===undefined?!![]:![]:!![],'where':_0x4edc83['options']?_0x4edc83[_0x6f00('0x19')][_0x6f00('0x20')]||null:null,'attributes':_0x4edc83[_0x6f00('0x19')]?_0x4edc83[_0x6f00('0x19')][_0x6f00('0x1a')]||null:null,'include':_0x4edc83['options']?_0x4edc83['options']['include']?_[_0x6f00('0x1c')](_0x4edc83[_0x6f00('0x19')][_0x6f00('0x1d')],function(_0x27ebb4){return{'model':db[_0x27ebb4[_0x6f00('0x1e')]],'as':_0x27ebb4['as'],'attributes':_0x27ebb4['attributes'],'include':_0x27ebb4[_0x6f00('0x1d')]?_[_0x6f00('0x1c')](_0x27ebb4[_0x6f00('0x1d')],function(_0x4646dc){return{'model':db[_0x4646dc[_0x6f00('0x1e')]],'as':_0x4646dc['as'],'attributes':_0x4646dc[_0x6f00('0x1a')],'include':_0x4646dc[_0x6f00('0x1d')]?_['map'](_0x4646dc[_0x6f00('0x1d')],function(_0x1dee52){return{'model':db[_0x1dee52[_0x6f00('0x1e')]],'as':_0x1dee52['as'],'attributes':_0x1dee52['attributes']};}):[]};}):[]};}):[]:[]})[_0x6f00('0xb')](function(_0x389ff9){if(_0x4edc83[_0x6f00('0x19')]['smtp']===!![])_0x389ff9[_0x6f00('0x21')]('smtpOptions',_0x389ff9[_0x6f00('0x22')]());logger['info'](_0x6f00('0x23'),_0x4edc83);logger[_0x6f00('0xe')](_0x6f00('0x23'),_0x4edc83,JSON[_0x6f00('0x10')](_0x389ff9));_0x56338c(_0x389ff9);})['catch'](function(_0xcfcc78){logger['error'](_0x6f00('0x23'),_0xcfcc78['message'],_0x4edc83);_0x3c0e5d(_0xc5ad42[_0x6f00('0x11')](0x1f4,_0xcfcc78[_0x6f00('0x12')]));});});};exports[_0x6f00('0x24')]=function(_0x1ed015){var _0x57c72d=this;return new Promise(function(_0x53dc8c,_0x2e745c){var _0x51bfbd={'body':_0x1ed015[_0x6f00('0x25')],'channel':_0x6f00('0x26')};var _0x4a70ea=_[_0x6f00('0x27')](_['keys'](db['CmContact'][_0x6f00('0x28')]),[_0x6f00('0x29'),_0x6f00('0x2a'),_0x6f00('0x2b'),'ListId']);var _0x38ee25=![];if(_0x1ed015[_0x6f00('0x25')]['id']){delete _0x1ed015[_0x6f00('0x25')]['id'];}if(_[_0x6f00('0x2c')](_0x1ed015[_0x6f00('0x25')][_0x6f00('0x2d')])){return _0x2e745c(_0x57c72d['error'](0x1f4,_0x6f00('0x2e')));}if(_[_0x6f00('0x2c')](_0x1ed015[_0x6f00('0x25')][_0x6f00('0x25')])||_0x1ed015[_0x6f00('0x25')][_0x6f00('0x25')]===''){return _0x2e745c(_0x57c72d['error'](0x1f4,_0x6f00('0x2f')));}if(_[_0x6f00('0x2c')](_0x1ed015[_0x6f00('0x25')]['mapKey'])){return _0x2e745c(_0x57c72d[_0x6f00('0x11')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a70ea));}if(!_[_0x6f00('0x30')](_0x4a70ea,_0x1ed015[_0x6f00('0x25')]['mapKey'])){return _0x2e745c(_0x57c72d[_0x6f00('0x11')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4a70ea));}var _0xadd6d8={};_0xadd6d8[_0x1ed015[_0x6f00('0x25')][_0x6f00('0x31')]]=_0x1ed015[_0x6f00('0x25')]['from'];return db[_0x6f00('0x17')]['find']({'where':{'id':_0x1ed015[_0x6f00('0x32')]['id']},'include':[{'model':db['CmList'],'as':_0x6f00('0x33'),'include':[{'model':db[_0x6f00('0x34')],'as':_0x6f00('0x35'),'where':_0xadd6d8,'limit':0x1,'order':[[_0x6f00('0x2a'),_0x6f00('0x36')]]}]},{'model':db[_0x6f00('0x37')],'as':_0x6f00('0x38')},{'model':db[_0x6f00('0x39')],'as':'Smtp','include':[{'model':db[_0x6f00('0x3a')],'as':'CloudProvider'}]}]})[_0x6f00('0xb')](function(_0x31fb17){if(_0x31fb17&&_0x31fb17[_0x6f00('0x33')]){var _0x5eec08=_0x31fb17['get']({'plain':!![]});_0x51bfbd[_0x6f00('0x32')]=_[_0x6f00('0x3b')](_0x5eec08,['Applications',_0x6f00('0x33')]);_0x51bfbd['account'][_0x6f00('0x3c')]=_0x31fb17['getSmtpOptions']();_0x51bfbd[_0x6f00('0x3d')]=_0x5eec08[_0x6f00('0x38')];_0x51bfbd['list']=_0x5eec08['List'];_0x51bfbd[_0x6f00('0x3d')]=_[_0x6f00('0x3e')](_0x51bfbd['applications'],[_0x6f00('0x3f')],['asc']);if(_0x51bfbd[_0x6f00('0x32')]&&_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x40')]){_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x41')]({'id':0x0,'priority':_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x42')]+0x1,'app':_0x6f00('0x43'),'appdata':_0x6f00('0x40'),'interval':_0x6f00('0x44')});}if(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x38')]){delete _0x51bfbd[_0x6f00('0x32')][_0x6f00('0x38')];}if(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x33')]){delete _0x51bfbd[_0x6f00('0x32')][_0x6f00('0x33')];}if(_0x5eec08[_0x6f00('0x33')][_0x6f00('0x35')]['length']){return _0x5eec08['List'][_0x6f00('0x35')][0x0];}var _0x5eda94=_[_0x6f00('0x45')](_0x1ed015[_0x6f00('0x25')],{'firstName':_0x1ed015['body'][_0x6f00('0x2d')],'ListId':_0x5eec08[_0x6f00('0x46')]});_0x5eda94[_0x1ed015[_0x6f00('0x25')]['mapKey']]=_0x1ed015[_0x6f00('0x25')]['from'];return db[_0x6f00('0x34')][_0x6f00('0x47')](_0x5eda94);}else{throw new Error('List\x20not\x20found');}})[_0x6f00('0xb')](function(_0x28677d){_0x51bfbd[_0x6f00('0x48')]=_0x28677d;if(_0x28677d){if(!_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x49')]){_0x1ed015[_0x6f00('0x25')]['message']['messageId']=rs['generate']()+'\x20'+_0x1ed015['body'][_0x6f00('0x12')][_0x6f00('0x2d')];}var _0x5bbfdb={'ContactId':_0x28677d['id'],'MailAccountId':_0x1ed015['account']['id'],'inReplyTo':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x49')],'to':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x2d')],'cc':_0x1ed015['body']['message']['cc'],'subject':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x4a')],'attach':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['attach'],'lastMsgAt':moment()[_0x6f00('0x4b')](_0x6f00('0x4c')),'lastMsgDirection':'in'};return db[_0x6f00('0x4d')][_0x6f00('0x1f')]({'where':{'closed':![],'MailAccountId':_0x1ed015['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x6f00('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x4f')]}}]})[_0x6f00('0xb')](function(_0x53e55c){if(_0x53e55c){return[_0x53e55c,![]];}return db['MailInteraction'][_0x6f00('0x47')](_0x5bbfdb)[_0x6f00('0xb')](function(_0x4ff6dc){return[_0x4ff6dc,!![]];});});}else{throw new Error(_0x6f00('0x50'));}})['spread'](function(_0x14554c,_0x37af94){if(_0x14554c){_0x38ee25=_0x37af94;if(!_0x37af94){return _0x14554c[_0x6f00('0x51')]({'inReplyTo':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['messageId'],'to':_0x1ed015['body']['message'][_0x6f00('0x2d')],'cc':_0x1ed015[_0x6f00('0x25')]['message']['cc'],'subject':_0x1ed015['body'][_0x6f00('0x12')][_0x6f00('0x4a')],'attach':_0x14554c['attach']?_0x14554c['attach']:_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x52')],'substatus':null,'substatusAt':moment()[_0x6f00('0x4b')](_0x6f00('0x4c')),'lastMsgAt':moment()[_0x6f00('0x4b')](_0x6f00('0x4c')),'lastMsgDirection':'in'});}else{return _0x14554c;}}})[_0x6f00('0xb')](function(_0x5ee0b6){_0x51bfbd['interaction']=_0x5ee0b6[_0x6f00('0x53')]({'plain':!![]});_0x51bfbd[_0x6f00('0x54')][_0x6f00('0x55')]=_0x38ee25;return db[_0x6f00('0x56')][_0x6f00('0x47')]({'body':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x25')],'MailAccountId':_0x1ed015[_0x6f00('0x32')]['id'],'MailInteractionId':_0x5ee0b6['id'],'direction':'in','ContactId':_0x51bfbd[_0x6f00('0x48')]['id'],'messageId':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x49')],'from':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x2d')],'to':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['to'],'cc':_0x1ed015['body']['message']['cc'],'subject':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x4a')],'attach':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x52')],'Attachments':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x57')],'originTo':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x58')],'originCc':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x59')],'bcc':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x5a')],'ChatWebsiteId':_0x1ed015[_0x6f00('0x25')]['message'][_0x6f00('0x5b')]||null,'originChannel':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')]['originChannel']||'Email','ChatOfflineMessageId':_0x1ed015[_0x6f00('0x25')][_0x6f00('0x12')][_0x6f00('0x5c')]||null},{'include':[{'model':db[_0x6f00('0x5d')],'as':'Attachments'}]});})['then'](function(_0x4cb62d){_0x51bfbd['message']=_0x4cb62d;if(!_0x51bfbd[_0x6f00('0x54')][_0x6f00('0x5e')]){return;}return db[_0x6f00('0x5f')][_0x6f00('0x1f')]({'attributes':['id',_0x6f00('0x60')],'where':{'id':_0x51bfbd['interaction'][_0x6f00('0x5e')]}});})[_0x6f00('0xb')](function(_0x538143){if(_0x538143){_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x61')]({'id':0x0,'priority':0x0,'app':_0x6f00('0x62'),'appdata':_0x538143[_0x6f00('0x60')]+','+(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x63')]||0xa),'interval':_0x6f00('0x44')});}if(!_0x51bfbd[_0x6f00('0x54')]['queueId']){return;}return db[_0x6f00('0x64')]['find']({'attributes':['id',_0x6f00('0x60')],'where':{'id':_0x51bfbd[_0x6f00('0x54')][_0x6f00('0x65')]}});})[_0x6f00('0xb')](function(_0x1ad295){if(_0x1ad295){_0x51bfbd[_0x6f00('0x3d')][_0x6f00('0x61')]({'id':0x0,'priority':0x1,'app':_0x6f00('0x66'),'appdata':_0x1ad295[_0x6f00('0x60')]+','+(_0x51bfbd[_0x6f00('0x32')][_0x6f00('0x67')]||0x12c),'interval':_0x6f00('0x44')});}return respondWithRpcPromise(_0x6f00('0x68'),_0x6f00('0x69'),_0x51bfbd);})['then'](function(_0x3ba021){_0x53dc8c(_0x3ba021);})[_0x6f00('0x15')](function(_0x1be439){_0x2e745c(_0x57c72d['error'](0x1f4,_0x1be439[_0x6f00('0x12')]));});});}; \ No newline at end of file +var _0xf767=['MailQueue','queue','waitForTheAssignedQueue','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailAccount','MailAccount','options','where','limit','map','model','attributes','include','debug','ShowMailAccount','find','raw','smtp','setDataValue','getSmtpOptions','catch','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','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','account','List','Contacts','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','smtpOptions','applications','list','orderBy','priority','autoclose','push','close','*,*,*,*','length','create','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','spread','update','subject','attach','interaction','created','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','unshift','name','queueId'];(function(_0x46b057,_0x25aa56){var _0x25cf84=function(_0x324ba6){while(--_0x324ba6){_0x46b057['push'](_0x46b057['shift']());}};_0x25cf84(++_0x25aa56);}(_0xf767,0x76));var _0x7f76=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xf767[_0x8de54f];return _0x14cba4;};'use strict';var _=require('lodash');var moment=require(_0x7f76('0x0'));var BPromise=require(_0x7f76('0x1'));var rs=require(_0x7f76('0x2'));var Redis=require(_0x7f76('0x3'));var db=require(_0x7f76('0x4'))['db'];var logger=require('../../config/logger')(_0x7f76('0x5'));var config=require(_0x7f76('0x6'));var jayson=require(_0x7f76('0x7'));var client=jayson[_0x7f76('0x8')]['http']({'port':0x232c});config[_0x7f76('0x9')]=_[_0x7f76('0xa')](config[_0x7f76('0x9')],{'host':_0x7f76('0xb'),'port':0x18eb});var socket=require(_0x7f76('0xc'))(new Redis(config['redis']));require(_0x7f76('0xd'))[_0x7f76('0xe')](socket);function respondWithRpcPromise(_0x35d28d,_0x15dcd9,_0x4c5f88){return new BPromise(function(_0x247403,_0x5dc8aa){return client[_0x7f76('0xf')](_0x35d28d,_0x4c5f88)[_0x7f76('0x10')](function(_0x4dbc83){logger[_0x7f76('0x11')](_0x7f76('0x12'),_0x15dcd9,_0x7f76('0x13'));logger['debug'](_0x7f76('0x14'),_0x15dcd9,_0x7f76('0x13'),JSON[_0x7f76('0x15')](_0x4dbc83));if(_0x4dbc83[_0x7f76('0x16')]){if(_0x4dbc83[_0x7f76('0x16')]['code']===0x1f4){logger[_0x7f76('0x16')]('MailAccount,\x20%s,\x20%s',_0x15dcd9,_0x4dbc83[_0x7f76('0x16')][_0x7f76('0x17')]);return _0x5dc8aa(_0x4dbc83['error']['message']);}logger['error'](_0x7f76('0x12'),_0x15dcd9,_0x4dbc83[_0x7f76('0x16')][_0x7f76('0x17')]);return _0x247403(_0x4dbc83['error'][_0x7f76('0x17')]);}else{logger['info'](_0x7f76('0x12'),_0x15dcd9,_0x7f76('0x13'));_0x247403(_0x4dbc83[_0x7f76('0x18')]['message']);}})['catch'](function(_0x494537){logger['error']('MailAccount,\x20%s,\x20%s',_0x15dcd9,_0x494537);_0x5dc8aa(_0x494537);});});}exports[_0x7f76('0x19')]=function(_0xdb1407){var _0x2b2e32=this;return new Promise(function(_0x21c2ca,_0x54610a){return db[_0x7f76('0x1a')]['findAll']({'raw':_0xdb1407[_0x7f76('0x1b')]?_0xdb1407[_0x7f76('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xdb1407['options']?_0xdb1407[_0x7f76('0x1b')][_0x7f76('0x1c')]||null:null,'attributes':_0xdb1407['options']?_0xdb1407[_0x7f76('0x1b')]['attributes']||null:null,'limit':_0xdb1407[_0x7f76('0x1b')]?_0xdb1407[_0x7f76('0x1b')][_0x7f76('0x1d')]||null:null,'include':_0xdb1407[_0x7f76('0x1b')]?_0xdb1407[_0x7f76('0x1b')]['include']?_[_0x7f76('0x1e')](_0xdb1407['options']['include'],function(_0x197519){return{'model':db[_0x197519[_0x7f76('0x1f')]],'as':_0x197519['as'],'attributes':_0x197519[_0x7f76('0x20')],'include':_0x197519['include']?_[_0x7f76('0x1e')](_0x197519[_0x7f76('0x21')],function(_0x3e624d){return{'model':db[_0x3e624d[_0x7f76('0x1f')]],'as':_0x3e624d['as'],'attributes':_0x3e624d[_0x7f76('0x20')],'include':_0x3e624d['include']?_[_0x7f76('0x1e')](_0x3e624d[_0x7f76('0x21')],function(_0x523d7a){return{'model':db[_0x523d7a['model']],'as':_0x523d7a['as'],'attributes':_0x523d7a[_0x7f76('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1dd664){logger[_0x7f76('0x11')](_0x7f76('0x19'),_0xdb1407);logger[_0x7f76('0x22')](_0x7f76('0x19'),_0xdb1407,JSON[_0x7f76('0x15')](_0x1dd664));_0x21c2ca(_0x1dd664);})['catch'](function(_0x3570ec){logger[_0x7f76('0x16')](_0x7f76('0x19'),_0x3570ec[_0x7f76('0x17')],_0xdb1407);_0x54610a(_0x2b2e32['error'](0x1f4,_0x3570ec[_0x7f76('0x17')]));});});};exports[_0x7f76('0x23')]=function(_0x3aacba){var _0x4d7a2f=this;return new Promise(function(_0x208ced,_0x419dad){return db[_0x7f76('0x1a')][_0x7f76('0x24')]({'raw':_0x3aacba[_0x7f76('0x1b')]?_0x3aacba[_0x7f76('0x1b')][_0x7f76('0x25')]===undefined?!![]:![]:!![],'where':_0x3aacba[_0x7f76('0x1b')]?_0x3aacba[_0x7f76('0x1b')][_0x7f76('0x1c')]||null:null,'attributes':_0x3aacba[_0x7f76('0x1b')]?_0x3aacba[_0x7f76('0x1b')][_0x7f76('0x20')]||null:null,'include':_0x3aacba['options']?_0x3aacba[_0x7f76('0x1b')][_0x7f76('0x21')]?_[_0x7f76('0x1e')](_0x3aacba[_0x7f76('0x1b')][_0x7f76('0x21')],function(_0x20c260){return{'model':db[_0x20c260[_0x7f76('0x1f')]],'as':_0x20c260['as'],'attributes':_0x20c260[_0x7f76('0x20')],'include':_0x20c260['include']?_[_0x7f76('0x1e')](_0x20c260['include'],function(_0x5e9a68){return{'model':db[_0x5e9a68[_0x7f76('0x1f')]],'as':_0x5e9a68['as'],'attributes':_0x5e9a68['attributes'],'include':_0x5e9a68[_0x7f76('0x21')]?_[_0x7f76('0x1e')](_0x5e9a68['include'],function(_0x3dbcc3){return{'model':db[_0x3dbcc3['model']],'as':_0x3dbcc3['as'],'attributes':_0x3dbcc3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f76('0x10')](function(_0x205223){if(_0x3aacba[_0x7f76('0x1b')][_0x7f76('0x26')]===!![])_0x205223[_0x7f76('0x27')]('smtpOptions',_0x205223[_0x7f76('0x28')]());logger[_0x7f76('0x11')]('ShowMailAccount',_0x3aacba);logger['debug'](_0x7f76('0x23'),_0x3aacba,JSON['stringify'](_0x205223));_0x208ced(_0x205223);})[_0x7f76('0x29')](function(_0x17dfb3){logger[_0x7f76('0x16')]('ShowMailAccount',_0x17dfb3[_0x7f76('0x17')],_0x3aacba);_0x419dad(_0x4d7a2f[_0x7f76('0x16')](0x1f4,_0x17dfb3[_0x7f76('0x17')]));});});};exports[_0x7f76('0x2a')]=function(_0x1ed18a){var _0x438de8=this;return new Promise(function(_0x58649f,_0x518ced){var _0x218370={'body':_0x1ed18a[_0x7f76('0x2b')],'channel':_0x7f76('0x2c')};var _0x331f75=_[_0x7f76('0x2d')](_[_0x7f76('0x2e')](db[_0x7f76('0x2f')][_0x7f76('0x30')]),[_0x7f76('0x31'),_0x7f76('0x32'),_0x7f76('0x33'),_0x7f76('0x34')]);var _0x3229b9=![];if(_0x1ed18a[_0x7f76('0x2b')]['id']){delete _0x1ed18a[_0x7f76('0x2b')]['id'];}if(_[_0x7f76('0x35')](_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x36')])){return _0x518ced(_0x438de8['error'](0x1f4,_0x7f76('0x37')));}if(_[_0x7f76('0x35')](_0x1ed18a[_0x7f76('0x2b')]['body'])||_0x1ed18a['body'][_0x7f76('0x2b')]===''){return _0x518ced(_0x438de8['error'](0x1f4,_0x7f76('0x38')));}if(_['isNil'](_0x1ed18a['body'][_0x7f76('0x39')])){return _0x518ced(_0x438de8[_0x7f76('0x16')](0x1f4,_0x7f76('0x3a')+_0x331f75));}if(!_[_0x7f76('0x3b')](_0x331f75,_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x39')])){return _0x518ced(_0x438de8[_0x7f76('0x16')](0x1f4,_0x7f76('0x3c')+_0x331f75));}var _0x71f722={};_0x71f722[_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x39')]]=_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x36')];return db[_0x7f76('0x1a')]['find']({'where':{'id':_0x1ed18a[_0x7f76('0x3d')]['id']},'include':[{'model':db['CmList'],'as':_0x7f76('0x3e'),'include':[{'model':db[_0x7f76('0x2f')],'as':_0x7f76('0x3f'),'where':_0x71f722,'limit':0x1,'order':[[_0x7f76('0x32'),'DESC']]}]},{'model':db[_0x7f76('0x40')],'as':_0x7f76('0x41')},{'model':db[_0x7f76('0x42')],'as':_0x7f76('0x43'),'include':[{'model':db['CloudProvider'],'as':_0x7f76('0x44')}]}]})[_0x7f76('0x10')](function(_0x53f77a){if(_0x53f77a&&_0x53f77a[_0x7f76('0x3e')]){var _0x364fea=_0x53f77a[_0x7f76('0x45')]({'plain':!![]});_0x218370['account']=_[_0x7f76('0x46')](_0x364fea,[_0x7f76('0x41'),_0x7f76('0x3e')]);_0x218370[_0x7f76('0x3d')][_0x7f76('0x47')]=_0x53f77a[_0x7f76('0x28')]();_0x218370[_0x7f76('0x48')]=_0x364fea[_0x7f76('0x41')];_0x218370[_0x7f76('0x49')]=_0x364fea[_0x7f76('0x3e')];_0x218370[_0x7f76('0x48')]=_[_0x7f76('0x4a')](_0x218370['applications'],[_0x7f76('0x4b')],['asc']);if(_0x218370[_0x7f76('0x3d')]&&_0x218370[_0x7f76('0x3d')][_0x7f76('0x4c')]){_0x218370['applications'][_0x7f76('0x4d')]({'id':0x0,'priority':_0x218370[_0x7f76('0x48')]['length']+0x1,'app':_0x7f76('0x4e'),'appdata':_0x7f76('0x4c'),'interval':_0x7f76('0x4f')});}if(_0x218370[_0x7f76('0x3d')][_0x7f76('0x41')]){delete _0x218370[_0x7f76('0x3d')][_0x7f76('0x41')];}if(_0x218370[_0x7f76('0x3d')][_0x7f76('0x3e')]){delete _0x218370['account']['List'];}if(_0x364fea[_0x7f76('0x3e')][_0x7f76('0x3f')][_0x7f76('0x50')]){return _0x364fea[_0x7f76('0x3e')][_0x7f76('0x3f')][0x0];}var _0x33b0ae=_[_0x7f76('0xa')](_0x1ed18a[_0x7f76('0x2b')],{'firstName':_0x1ed18a[_0x7f76('0x2b')]['from'],'ListId':_0x364fea[_0x7f76('0x34')]});_0x33b0ae[_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x39')]]=_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x36')];return db[_0x7f76('0x2f')][_0x7f76('0x51')](_0x33b0ae);}else{throw new Error('List\x20not\x20found');}})[_0x7f76('0x10')](function(_0x52b523){_0x218370[_0x7f76('0x52')]=_0x52b523;if(_0x52b523){if(!_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x53')]){_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x53')]=rs[_0x7f76('0x54')]()+'\x20'+_0x1ed18a['body']['message'][_0x7f76('0x36')];}var _0x4529b0={'ContactId':_0x52b523['id'],'MailAccountId':_0x1ed18a[_0x7f76('0x3d')]['id'],'inReplyTo':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x53')],'to':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')]['from'],'cc':_0x1ed18a['body'][_0x7f76('0x17')]['cc'],'subject':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')]['subject'],'attach':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')]['attach'],'lastMsgAt':moment()[_0x7f76('0x55')](_0x7f76('0x56')),'lastMsgDirection':'in'};return db[_0x7f76('0x57')][_0x7f76('0x24')]({'where':{'closed':![],'MailAccountId':_0x1ed18a[_0x7f76('0x3d')]['id']},'include':[{'model':db[_0x7f76('0x58')],'as':'Messages','attributes':[_0x7f76('0x53')],'where':{'messageId':_0x1ed18a['body'][_0x7f76('0x17')]['inReplyTo']}}]})[_0x7f76('0x10')](function(_0x5f3db2){if(_0x5f3db2){return[_0x5f3db2,![]];}return db[_0x7f76('0x57')][_0x7f76('0x51')](_0x4529b0)[_0x7f76('0x10')](function(_0x3e83d2){return[_0x3e83d2,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7f76('0x59')](function(_0x20264e,_0x46b15b){if(_0x20264e){_0x3229b9=_0x46b15b;if(!_0x46b15b){return _0x20264e[_0x7f76('0x5a')]({'inReplyTo':_0x1ed18a[_0x7f76('0x2b')]['message'][_0x7f76('0x53')],'to':_0x1ed18a['body'][_0x7f76('0x17')]['from'],'cc':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')]['cc'],'subject':_0x1ed18a['body'][_0x7f76('0x17')][_0x7f76('0x5b')],'attach':_0x20264e[_0x7f76('0x5c')]?_0x20264e[_0x7f76('0x5c')]:_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x5c')],'substatus':null,'substatusAt':moment()[_0x7f76('0x55')](_0x7f76('0x56')),'lastMsgAt':moment()[_0x7f76('0x55')](_0x7f76('0x56')),'lastMsgDirection':'in'});}else{return _0x20264e;}}})[_0x7f76('0x10')](function(_0xb0be79){_0x218370[_0x7f76('0x5d')]=_0xb0be79['get']({'plain':!![]});_0x218370[_0x7f76('0x5d')][_0x7f76('0x5e')]=_0x3229b9;return db['MailMessage'][_0x7f76('0x51')]({'body':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x2b')],'MailAccountId':_0x1ed18a[_0x7f76('0x3d')]['id'],'MailInteractionId':_0xb0be79['id'],'direction':'in','ContactId':_0x218370[_0x7f76('0x52')]['id'],'messageId':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x53')],'from':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x36')],'to':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')]['to'],'cc':_0x1ed18a[_0x7f76('0x2b')]['message']['cc'],'subject':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')]['subject'],'attach':_0x1ed18a['body']['message'][_0x7f76('0x5c')],'Attachments':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')]['attachments'],'originTo':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x5f')],'originCc':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x60')],'bcc':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x61')],'ChatWebsiteId':_0x1ed18a['body'][_0x7f76('0x17')][_0x7f76('0x62')]||null,'originChannel':_0x1ed18a[_0x7f76('0x2b')][_0x7f76('0x17')][_0x7f76('0x63')]||_0x7f76('0x64'),'ChatOfflineMessageId':_0x1ed18a[_0x7f76('0x2b')]['message'][_0x7f76('0x65')]||null},{'include':[{'model':db[_0x7f76('0x66')],'as':_0x7f76('0x67')}]});})[_0x7f76('0x10')](function(_0x43d856){_0x218370['message']=_0x43d856;if(!_0x218370[_0x7f76('0x5d')][_0x7f76('0x68')]){return;}return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x218370[_0x7f76('0x5d')][_0x7f76('0x68')]}});})[_0x7f76('0x10')](function(_0x8d6dec){if(_0x8d6dec){_0x218370[_0x7f76('0x48')][_0x7f76('0x69')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x8d6dec[_0x7f76('0x6a')]+','+(_0x218370[_0x7f76('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':_0x7f76('0x4f')});}if(!_0x218370[_0x7f76('0x5d')][_0x7f76('0x6b')]){return;}return db[_0x7f76('0x6c')][_0x7f76('0x24')]({'attributes':['id',_0x7f76('0x6a')],'where':{'id':_0x218370[_0x7f76('0x5d')]['queueId']}});})[_0x7f76('0x10')](function(_0x428865){if(_0x428865){_0x218370['applications'][_0x7f76('0x69')]({'id':0x0,'priority':0x1,'app':_0x7f76('0x6d'),'appdata':_0x428865['name']+','+(_0x218370[_0x7f76('0x3d')][_0x7f76('0x6e')]||0x12c),'interval':_0x7f76('0x4f')});}return respondWithRpcPromise(_0x7f76('0x6f'),_0x7f76('0x70'),_0x218370);})[_0x7f76('0x10')](function(_0x37afb1){_0x58649f(_0x37afb1);})[_0x7f76('0x29')](function(_0x95d3a8){_0x518ced(_0x438de8[_0x7f76('0x16')](0x1f4,_0x95d3a8[_0x7f76('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 090d402..82052df 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 _0xd6dc=['removeListener','register','length','mailAccount:','./mailAccount.events','save','update','emit'];(function(_0x48a31c,_0x2897f6){var _0x213ddd=function(_0x52b953){while(--_0x52b953){_0x48a31c['push'](_0x48a31c['shift']());}};_0x213ddd(++_0x2897f6);}(_0xd6dc,0x184));var _0xcd6d=function(_0x5f0964,_0x407e25){_0x5f0964=_0x5f0964-0x0;var _0x18873e=_0xd6dc[_0x5f0964];return _0x18873e;};'use strict';var MailAccountEvents=require(_0xcd6d('0x0'));var events=[_0xcd6d('0x1'),'remove',_0xcd6d('0x2')];function createListener(_0x325305,_0x35f502){return function(_0x49c797){_0x35f502[_0xcd6d('0x3')](_0x325305,_0x49c797);};}function removeListener(_0x170703,_0x5a8dbe){return function(){MailAccountEvents[_0xcd6d('0x4')](_0x170703,_0x5a8dbe);};}exports[_0xcd6d('0x5')]=function(_0x4be466){for(var _0xbb2564=0x0,_0x52c3c9=events[_0xcd6d('0x6')];_0xbb2564<_0x52c3c9;_0xbb2564++){var _0x31345d=events[_0xbb2564];var _0x4d9f05=createListener(_0xcd6d('0x7')+_0x31345d,_0x4be466);MailAccountEvents['on'](_0x31345d,_0x4d9f05);}}; \ No newline at end of file +var _0xed3d=['register','mailAccount:','save','remove','update','emit'];(function(_0x216586,_0x2e9346){var _0x2c0807=function(_0x3ade09){while(--_0x3ade09){_0x216586['push'](_0x216586['shift']());}};_0x2c0807(++_0x2e9346);}(_0xed3d,0xe6));var _0xded3=function(_0x254f63,_0x240e06){_0x254f63=_0x254f63-0x0;var _0x252ada=_0xed3d[_0x254f63];return _0x252ada;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xded3('0x0'),_0xded3('0x1'),_0xded3('0x2')];function createListener(_0x4e3eda,_0x4ce1db){return function(_0x49f5bb){_0x4ce1db[_0xded3('0x3')](_0x4e3eda,_0x49f5bb);};}function removeListener(_0x3afba7,_0x4aa5f2){return function(){MailAccountEvents['removeListener'](_0x3afba7,_0x4aa5f2);};}exports[_0xded3('0x4')]=function(_0x538d65){for(var _0x126f88=0x0,_0x2522c1=events['length'];_0x126f88<_0x2522c1;_0x126f88++){var _0x14303f=events[_0x126f88];var _0x4bbde2=createListener(_0xded3('0x5')+_0x14303f,_0x538d65);MailAccountEvents['on'](_0x14303f,_0x4bbde2);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index fc19c2c..b5a0839 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 _0x450a=['./mailApplication.controller','get','isAuthenticated','put','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf3121d,_0x26340a){var _0x511854=function(_0x328f11){while(--_0x328f11){_0xf3121d['push'](_0xf3121d['shift']());}};_0x511854(++_0x26340a);}(_0x450a,0x86));var _0xa450=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x450a[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xa450('0x0'));var util=require(_0xa450('0x1'));var path=require(_0xa450('0x2'));var timeout=require(_0xa450('0x3'));var express=require(_0xa450('0x4'));var router=express[_0xa450('0x5')]();var fs_extra=require(_0xa450('0x6'));var auth=require(_0xa450('0x7'));var interaction=require(_0xa450('0x8'));var config=require(_0xa450('0x9'));var controller=require(_0xa450('0xa'));router[_0xa450('0xb')]('/:id',auth[_0xa450('0xc')](),controller['show']);router[_0xa450('0xd')](_0xa450('0xe'),auth[_0xa450('0xc')](),controller['update']);router['delete'](_0xa450('0xe'),auth['isAuthenticated'](),controller[_0xa450('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa76e=['fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','put','delete','destroy','exports','multer','util','connect-timeout','Router'];(function(_0x211732,_0x257a3e){var _0x5eae81=function(_0x18a7f9){while(--_0x18a7f9){_0x211732['push'](_0x211732['shift']());}};_0x5eae81(++_0x257a3e);}(_0xa76e,0x6c));var _0xea76=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0xa76e[_0x2c2980];return _0x2a20a9;};'use strict';var multer=require(_0xea76('0x0'));var util=require(_0xea76('0x1'));var path=require('path');var timeout=require(_0xea76('0x2'));var express=require('express');var router=express[_0xea76('0x3')]();var fs_extra=require(_0xea76('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xea76('0x5'));var config=require(_0xea76('0x6'));var controller=require(_0xea76('0x7'));router['get'](_0xea76('0x8'),auth[_0xea76('0x9')](),controller['show']);router[_0xea76('0xa')](_0xea76('0x8'),auth[_0xea76('0x9')](),controller['update']);router[_0xea76('0xb')](_0xea76('0x8'),auth[_0xea76('0x9')](),controller[_0xea76('0xc')]);module[_0xea76('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 859a2b2..f1bb1a5 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 _0x7809=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0xd11863,_0x1a251f){var _0x5904c0=function(_0x336d99){while(--_0x336d99){_0xd11863['push'](_0xd11863['shift']());}};_0x5904c0(++_0x1a251f);}(_0x7809,0xf2));var _0x9780=function(_0x5036aa,_0x46ea5a){_0x5036aa=_0x5036aa-0x0;var _0x1e4814=_0x7809[_0x5036aa];return _0x1e4814;};'use strict';var Sequelize=require(_0x9780('0x0'));module[_0x9780('0x1')]={'priority':{'type':Sequelize[_0x9780('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9780('0x3')],'allowNull':![],'defaultValue':_0x9780('0x4')},'appdata':{'type':Sequelize[_0x9780('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9780('0x3')],'defaultValue':_0x9780('0x6')}}; \ No newline at end of file +var _0x064e=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x383620,_0x57b3aa){var _0x49293c=function(_0x1ae7ea){while(--_0x1ae7ea){_0x383620['push'](_0x383620['shift']());}};_0x49293c(++_0x57b3aa);}(_0x064e,0xe8));var _0xe064=function(_0x312d64,_0x2ae942){_0x312d64=_0x312d64-0x0;var _0x2bfb83=_0x064e[_0x312d64];return _0x2bfb83;};'use strict';var Sequelize=require(_0xe064('0x0'));module[_0xe064('0x1')]={'priority':{'type':Sequelize[_0xe064('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe064('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe064('0x3')]},'interval':{'type':Sequelize[_0xe064('0x3')],'defaultValue':_0xe064('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 8eadabb..b32cd16 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 _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','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','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x313823,_0x530249){var _0x4d2f81=function(_0x40023f){while(--_0x40023f){_0x313823['push'](_0x313823['shift']());}};_0x4d2f81(++_0x530249);}(_0xda3f,0xec));var _0xfda3=function(_0x3005b5,_0x27978d){_0x3005b5=_0x3005b5-0x0;var _0x2ef4e8=_0xda3f[_0x3005b5];return _0x2ef4e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','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','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0xed9c3b,_0x594a76){var _0x8df122=function(_0x220a9d){while(--_0x220a9d){_0xed9c3b['push'](_0xed9c3b['shift']());}};_0x8df122(++_0x594a76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 883c90c..d6c372a 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 _0x7774=['moment','bluebird','request-promise','path','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x44f470,_0x74d1a8){var _0x54f0f5=function(_0x1bddbe){while(--_0x1bddbe){_0x44f470['push'](_0x44f470['shift']());}};_0x54f0f5(++_0x74d1a8);}(_0x7774,0xe1));var _0x4777=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x7774[_0x5ecadc];return _0x565037;};'use strict';var _=require(_0x4777('0x0'));var util=require('util');var logger=require(_0x4777('0x1'))(_0x4777('0x2'));var moment=require(_0x4777('0x3'));var BPromise=require(_0x4777('0x4'));var rp=require(_0x4777('0x5'));var fs=require('fs');var path=require(_0x4777('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x4777('0x7')]=function(_0x4dc8e6,_0x212929){return _0x4dc8e6[_0x4777('0x8')]('MailApplication',attributes,{'tableName':_0x4777('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4777('0xa'),'collate':_0x4777('0xb')});}; \ No newline at end of file +var _0xee48=['rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x39132b,_0x2ab32f){var _0x5ef904=function(_0x136b0a){while(--_0x136b0a){_0x39132b['push'](_0x39132b['shift']());}};_0x5ef904(++_0x2ab32f);}(_0xee48,0x18d));var _0x8ee4=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0xee48[_0x587fb5];return _0x551105;};'use strict';var _=require(_0x8ee4('0x0'));var util=require(_0x8ee4('0x1'));var logger=require(_0x8ee4('0x2'))(_0x8ee4('0x3'));var moment=require(_0x8ee4('0x4'));var BPromise=require(_0x8ee4('0x5'));var rp=require(_0x8ee4('0x6'));var fs=require('fs');var path=require(_0x8ee4('0x7'));var rimraf=require(_0x8ee4('0x8'));var config=require(_0x8ee4('0x9'));var attributes=require(_0x8ee4('0xa'));module[_0x8ee4('0xb')]=function(_0xbaadb1,_0x31ffab){return _0xbaadb1['define']('MailApplication',attributes,{'tableName':_0x8ee4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8ee4('0xd'),'collate':_0x8ee4('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c87c8a3..9177374 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 _0x1e52=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit'];(function(_0x23459b,_0x5e788d){var _0x1f5839=function(_0x216836){while(--_0x216836){_0x23459b['push'](_0x23459b['shift']());}};_0x1f5839(++_0x5e788d);}(_0x1e52,0x7c));var _0x21e5=function(_0x332e65,_0x368a12){_0x332e65=_0x332e65-0x0;var _0x1b19dc=_0x1e52[_0x332e65];return _0x1b19dc;};'use strict';var _=require('lodash');var util=require(_0x21e5('0x0'));var moment=require(_0x21e5('0x1'));var BPromise=require(_0x21e5('0x2'));var rs=require(_0x21e5('0x3'));var fs=require('fs');var Redis=require(_0x21e5('0x4'));var db=require(_0x21e5('0x5'))['db'];var utils=require(_0x21e5('0x6'));var logger=require(_0x21e5('0x7'))(_0x21e5('0x8'));var config=require(_0x21e5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x21e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ef4be,_0x1101eb,_0x232a46){return new BPromise(function(_0x5a4c4f,_0x15bd86){return client[_0x21e5('0xb')](_0x1ef4be,_0x232a46)[_0x21e5('0xc')](function(_0x155657){logger['info'](_0x21e5('0xd'),_0x1101eb,_0x21e5('0xe'));logger[_0x21e5('0xf')](_0x21e5('0x10'),_0x1101eb,_0x21e5('0xe'),JSON[_0x21e5('0x11')](_0x155657));if(_0x155657[_0x21e5('0x12')]){if(_0x155657[_0x21e5('0x12')][_0x21e5('0x13')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x1101eb,_0x155657[_0x21e5('0x12')][_0x21e5('0x14')]);return _0x15bd86(_0x155657['error']['message']);}logger['error'](_0x21e5('0xd'),_0x1101eb,_0x155657[_0x21e5('0x12')]['message']);return _0x5a4c4f(_0x155657['error'][_0x21e5('0x14')]);}else{logger[_0x21e5('0x15')](_0x21e5('0xd'),_0x1101eb,_0x21e5('0xe'));_0x5a4c4f(_0x155657['result'][_0x21e5('0x14')]);}})[_0x21e5('0x16')](function(_0x1e4cfd){logger['error']('MailApplication,\x20%s,\x20%s',_0x1101eb,_0x1e4cfd);_0x15bd86(_0x1e4cfd);});});}exports[_0x21e5('0x17')]=function(_0x1a254a){var _0x3a9b2f=this;return new Promise(function(_0x278799,_0x5c529a){return db[_0x21e5('0x18')][_0x21e5('0x19')](_0x1a254a[_0x21e5('0x1a')],{'raw':_0x1a254a[_0x21e5('0x1b')]?_0x1a254a[_0x21e5('0x1b')][_0x21e5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a254a[_0x21e5('0x1b')]?_0x1a254a[_0x21e5('0x1b')][_0x21e5('0x1d')]||null:null,'attributes':_0x1a254a[_0x21e5('0x1b')]?_0x1a254a['options']['attributes']||null:null,'limit':_0x1a254a['options']?_0x1a254a[_0x21e5('0x1b')][_0x21e5('0x1e')]||null:null})[_0x21e5('0xc')](function(_0x36325d){logger[_0x21e5('0x15')]('UpdateMailApplication',_0x1a254a);logger[_0x21e5('0xf')](_0x21e5('0x17'),_0x1a254a,JSON[_0x21e5('0x11')](_0x36325d));_0x278799(_0x36325d);})['catch'](function(_0x1b5df0){logger[_0x21e5('0x12')]('UpdateMailApplication',_0x1b5df0[_0x21e5('0x14')],_0x1a254a);_0x5c529a(_0x3a9b2f['error'](0x1f4,_0x1b5df0[_0x21e5('0x14')]));});});}; \ No newline at end of file +var _0x4f08=['error','code','MailApplication,\x20%s,\x20%s','message','info','catch','UpdateMailApplication','MailApplication','raw','options','where','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x30e7f9,_0x2c2073){var _0x2d0590=function(_0x557023){while(--_0x557023){_0x30e7f9['push'](_0x30e7f9['shift']());}};_0x2d0590(++_0x2c2073);}(_0x4f08,0x194));var _0x84f0=function(_0x2abe54,_0x2e6fed){_0x2abe54=_0x2abe54-0x0;var _0x168961=_0x4f08[_0x2abe54];return _0x168961;};'use strict';var _=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var moment=require('moment');var BPromise=require(_0x84f0('0x2'));var rs=require(_0x84f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x84f0('0x4'))['db'];var utils=require(_0x84f0('0x5'));var logger=require(_0x84f0('0x6'))('rpc');var config=require(_0x84f0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x84f0('0x8')][_0x84f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4548f3,_0x5a877f,_0x430993){return new BPromise(function(_0x42f42e,_0x15b01d){return client[_0x84f0('0xa')](_0x4548f3,_0x430993)[_0x84f0('0xb')](function(_0x1b256f){logger['info']('MailApplication,\x20%s,\x20%s',_0x5a877f,_0x84f0('0xc'));logger[_0x84f0('0xd')](_0x84f0('0xe'),_0x5a877f,_0x84f0('0xc'),JSON[_0x84f0('0xf')](_0x1b256f));if(_0x1b256f[_0x84f0('0x10')]){if(_0x1b256f[_0x84f0('0x10')][_0x84f0('0x11')]===0x1f4){logger[_0x84f0('0x10')]('MailApplication,\x20%s,\x20%s',_0x5a877f,_0x1b256f[_0x84f0('0x10')]['message']);return _0x15b01d(_0x1b256f[_0x84f0('0x10')]['message']);}logger[_0x84f0('0x10')](_0x84f0('0x12'),_0x5a877f,_0x1b256f[_0x84f0('0x10')][_0x84f0('0x13')]);return _0x42f42e(_0x1b256f[_0x84f0('0x10')][_0x84f0('0x13')]);}else{logger[_0x84f0('0x14')](_0x84f0('0x12'),_0x5a877f,_0x84f0('0xc'));_0x42f42e(_0x1b256f['result'][_0x84f0('0x13')]);}})[_0x84f0('0x15')](function(_0x9e40a8){logger['error']('MailApplication,\x20%s,\x20%s',_0x5a877f,_0x9e40a8);_0x15b01d(_0x9e40a8);});});}exports[_0x84f0('0x16')]=function(_0x295fe5){var _0x2906a8=this;return new Promise(function(_0x40f536,_0x46dc6e){return db[_0x84f0('0x17')]['update'](_0x295fe5['body'],{'raw':_0x295fe5['options']?_0x295fe5['options'][_0x84f0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295fe5['options']?_0x295fe5[_0x84f0('0x19')][_0x84f0('0x1a')]||null:null,'attributes':_0x295fe5[_0x84f0('0x19')]?_0x295fe5[_0x84f0('0x19')]['attributes']||null:null,'limit':_0x295fe5[_0x84f0('0x19')]?_0x295fe5[_0x84f0('0x19')][_0x84f0('0x1b')]||null:null})['then'](function(_0x5662e1){logger[_0x84f0('0x14')](_0x84f0('0x16'),_0x295fe5);logger[_0x84f0('0xd')](_0x84f0('0x16'),_0x295fe5,JSON[_0x84f0('0xf')](_0x5662e1));_0x40f536(_0x5662e1);})['catch'](function(_0x923f56){logger['error']('UpdateMailApplication',_0x923f56[_0x84f0('0x13')],_0x295fe5);_0x46dc6e(_0x2906a8[_0x84f0('0x10')](0x1f4,_0x923f56[_0x84f0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 201c267..d3bb73f 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 _0xd47d=['update','mailinteraction:destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','download','create','addMessage','post','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd47d,0x9a));var _0xdd47=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xd47d[_0x43b06b];return _0x2c555b;};'use strict';var express=require('express');var router=express[_0xdd47('0x0')]();var auth=require(_0xdd47('0x1'));var interaction=require(_0xdd47('0x2'));var controller=require('./mailInteraction.controller');router[_0xdd47('0x3')]('/',auth[_0xdd47('0x4')](),controller[_0xdd47('0x5')]);router[_0xdd47('0x3')](_0xdd47('0x6'),auth[_0xdd47('0x4')](),controller[_0xdd47('0x7')]);router[_0xdd47('0x3')](_0xdd47('0x8'),auth[_0xdd47('0x4')](),controller['show']);router[_0xdd47('0x3')](_0xdd47('0x9'),auth['isAuthenticated'](),controller['getMessages']);router[_0xdd47('0x3')]('/:id/download',auth[_0xdd47('0x4')](),controller[_0xdd47('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdd47('0xb')]);router['post'](_0xdd47('0x9'),auth[_0xdd47('0x4')](),controller[_0xdd47('0xc')]);router[_0xdd47('0xd')](_0xdd47('0xe'),auth[_0xdd47('0x4')](),interaction['tracked'](_0xdd47('0xf'),_0xdd47('0x10')),controller[_0xdd47('0x11')]);router[_0xdd47('0x12')](_0xdd47('0x8'),auth[_0xdd47('0x4')](),interaction[_0xdd47('0x13')](_0xdd47('0xf'),_0xdd47('0x14')),controller[_0xdd47('0x15')]);router['delete'](_0xdd47('0x8'),auth[_0xdd47('0x4')](),interaction[_0xdd47('0x13')]('mail',_0xdd47('0x16')),controller['destroy']);router['delete'](_0xdd47('0xe'),auth[_0xdd47('0x4')](),controller[_0xdd47('0x17')]);module[_0xdd47('0x18')]=router; \ No newline at end of file +var _0xa48b=['create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','/:id','tracked','update','delete','mailinteraction:destroy','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id/messages','/:id/download','download','post'];(function(_0x48e348,_0x3e7b30){var _0x29016a=function(_0x1fcfc4){while(--_0x1fcfc4){_0x48e348['push'](_0x48e348['shift']());}};_0x29016a(++_0x3e7b30);}(_0xa48b,0x1d4));var _0xba48=function(_0x35fbfb,_0x564ab8){_0x35fbfb=_0x35fbfb-0x0;var _0x293f82=_0xa48b[_0x35fbfb];return _0x293f82;};'use strict';var express=require('express');var router=express[_0xba48('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0xba48('0x1'));var controller=require(_0xba48('0x2'));router[_0xba48('0x3')]('/',auth[_0xba48('0x4')](),controller[_0xba48('0x5')]);router[_0xba48('0x3')](_0xba48('0x6'),auth[_0xba48('0x4')](),controller[_0xba48('0x7')]);router[_0xba48('0x3')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xba48('0x3')](_0xba48('0x8'),auth['isAuthenticated'](),controller['getMessages']);router[_0xba48('0x3')](_0xba48('0x9'),auth['isAuthenticated'](),controller[_0xba48('0xa')]);router[_0xba48('0xb')]('/',auth['isAuthenticated'](),controller[_0xba48('0xc')]);router[_0xba48('0xb')](_0xba48('0x8'),auth[_0xba48('0x4')](),controller[_0xba48('0xd')]);router[_0xba48('0xb')](_0xba48('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xba48('0xf'),_0xba48('0x10')),controller[_0xba48('0x11')]);router[_0xba48('0x12')](_0xba48('0x13'),auth[_0xba48('0x4')](),interaction[_0xba48('0x14')](_0xba48('0xf'),'mailinteraction:update'),controller[_0xba48('0x15')]);router[_0xba48('0x16')]('/:id',auth['isAuthenticated'](),interaction['tracked']('mail',_0xba48('0x17')),controller['destroy']);router[_0xba48('0x16')](_0xba48('0xe'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index d3a77fb..20c2a52 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 _0x5555=['out','BOOLEAN','sequelize','iconv','DATE','STRING','ENUM'];(function(_0x98fb05,_0xe0654c){var _0x2ebdaa=function(_0x26e107){while(--_0x26e107){_0x98fb05['push'](_0x98fb05['shift']());}};_0x2ebdaa(++_0xe0654c);}(_0x5555,0xa3));var _0x5555=function(_0x36dc4d,_0x3c1e38){_0x36dc4d=_0x36dc4d-0x0;var _0x5e894d=_0x5555[_0x36dc4d];return _0x5e894d;};'use strict';var Sequelize=require(_0x5555('0x0'));var iconv=require(_0x5555('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5555('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x5555('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5555('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x5555('0x3')]},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x5555('0x2')]},'substatus':{'type':Sequelize[_0x5555('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5555('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5555('0x4')]('in',_0x5555('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5555('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbcfe=['DATE','STRING','long','out','INTEGER','sequelize','exports','BOOLEAN'];(function(_0x53cc00,_0x5e5117){var _0x562f09=function(_0x1e2086){while(--_0x1e2086){_0x53cc00['push'](_0x53cc00['shift']());}};_0x562f09(++_0x5e5117);}(_0xbcfe,0x195));var _0xebcf=function(_0x23d621,_0x519c50){_0x23d621=_0x23d621-0x0;var _0x2d5fa1=_0xbcfe[_0x23d621];return _0x2d5fa1;};'use strict';var Sequelize=require(_0xebcf('0x0'));var iconv=require('iconv');module[_0xebcf('0x1')]={'closed':{'type':Sequelize[_0xebcf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xebcf('0x3')]},'disposition':{'type':Sequelize[_0xebcf('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xebcf('0x4')]},'note':{'type':Sequelize[_0xebcf('0x4')]},'inReplyTo':{'type':Sequelize[_0xebcf('0x4')](0x1fe)},'to':{'type':Sequelize[_0xebcf('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xebcf('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xebcf('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xebcf('0x3')]},'substatus':{'type':Sequelize[_0xebcf('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xebcf('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xebcf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xebcf('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xebcf('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xebcf('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index fee0052..4392b77 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 _0xf696=['map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','color','mailInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','subject','get','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','unlinkSync','rimraf','moment','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','register','status','end','undefined','count','offset','limit','set','json','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','getOptions','findAll','query','user','catch','show','params','keys','MailInteraction','filters','intersection','model','attributes','fields','length','includeAll','include','options','find','create','update','body','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x591356,_0xb2befd){var _0x5c533f=function(_0x2242bc){while(--_0x2242bc){_0x591356['push'](_0x591356['shift']());}};_0x5c533f(++_0xb2befd);}(_0xf696,0x180));var _0x6f69=function(_0x24b33c,_0x34703a){_0x24b33c=_0x24b33c-0x0;var _0x300961=_0xf696[_0x24b33c];return _0x300961;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f69('0x0'));var zipdir=require('zip-dir');var moment=require(_0x6f69('0x1'));var BPromise=require(_0x6f69('0x2'));var util=require(_0x6f69('0x3'));var path=require(_0x6f69('0x4'));var fs=require('fs');var _=require(_0x6f69('0x5'));var juice=require(_0x6f69('0x6'));var Redis=require(_0x6f69('0x7'));var interaction=require(_0x6f69('0x8'));var qs=require(_0x6f69('0x9'));var logger=require('../../config/logger')(_0x6f69('0xa'));var config=require('../../config/environment');var db=require(_0x6f69('0xb'))['db'];var htmlEntities=require(_0x6f69('0xc'));config[_0x6f69('0xd')]=_[_0x6f69('0xe')](config[_0x6f69('0xd')],{'host':_0x6f69('0xf'),'port':0x18eb});var socket=require(_0x6f69('0x10'))(new Redis(config[_0x6f69('0xd')]));require('./mailInteraction.socket')[_0x6f69('0x11')](socket);function respondWithStatusCode(_0x44ec31,_0x2a3786){_0x2a3786=_0x2a3786||0xcc;return function(_0x1e25d3){if(_0x1e25d3){return _0x44ec31['sendStatus'](_0x2a3786);}return _0x44ec31[_0x6f69('0x12')](_0x2a3786)[_0x6f69('0x13')]();};}function respondWithResult(_0x5e0e8d,_0x45d088){_0x45d088=_0x45d088||0xc8;return function(_0x443019){if(_0x443019){return _0x5e0e8d[_0x6f69('0x12')](_0x45d088)['json'](_0x443019);}};}function respondWithFilteredResult(_0x10a2db,_0xbbc161){return function(_0x31b0d6){if(_0x31b0d6){var _0x15ff46=typeof _0xbbc161['offset']===_0x6f69('0x14')&&typeof _0xbbc161['limit']===_0x6f69('0x14');var _0x3e0f21=_0x31b0d6[_0x6f69('0x15')];var _0xb69209=_0x15ff46?0x0:_0xbbc161[_0x6f69('0x16')];var _0x483f50=_0x15ff46?_0x31b0d6[_0x6f69('0x15')]:_0xbbc161['offset']+_0xbbc161[_0x6f69('0x17')];var _0x186fa3;if(_0x483f50>=_0x3e0f21){_0x483f50=_0x3e0f21;_0x186fa3=0xc8;}else{_0x186fa3=0xce;}_0x10a2db[_0x6f69('0x12')](_0x186fa3);return _0x10a2db[_0x6f69('0x18')]('Content-Range',_0xb69209+'-'+_0x483f50+'/'+_0x3e0f21)[_0x6f69('0x19')](_0x31b0d6);}return null;};}function saveUpdates(_0x3521d1){return function(_0x214a3e){if(_0x214a3e){return _0x214a3e['update'](_0x3521d1)[_0x6f69('0x1a')](function(_0x33f18b){return _0x33f18b;});}return null;};}function removeEntity(_0x51f1c8){return function(_0x579663){if(_0x579663){return _0x579663[_0x6f69('0x1b')]()['then'](function(){_0x51f1c8[_0x6f69('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386871){return function(_0x268d70){if(!_0x268d70){_0x386871[_0x6f69('0x1c')](0x194);}return _0x268d70;};}function handleError(_0x848625,_0x3e3dd4){_0x3e3dd4=_0x3e3dd4||0x1f4;return function(_0x3d7e83){logger[_0x6f69('0x1d')](_0x3d7e83[_0x6f69('0x1e')]);if(_0x3d7e83[_0x6f69('0x1f')]){delete _0x3d7e83[_0x6f69('0x1f')];}_0x848625[_0x6f69('0x12')](_0x3e3dd4)[_0x6f69('0x20')](_0x3d7e83);};}exports[_0x6f69('0x21')]=function(_0x48480d,_0x3063a7){var _0x2bb119={};var _0x440946=_['map'](db['MailInteraction'][_0x6f69('0x22')],function(_0x2906e7){return{'name':_0x2906e7['fieldName'],'type':_0x2906e7[_0x6f69('0x23')][_0x6f69('0x24')]};});_0x2bb119=qs[_0x6f69('0x25')](_0x440946,_0x48480d);return interaction[_0x6f69('0x26')]('mail',_0x48480d[_0x6f69('0x27')],_0x48480d[_0x6f69('0x28')],_0x2bb119,_0x440946)[_0x6f69('0x1a')](respondWithFilteredResult(_0x3063a7,_0x2bb119))[_0x6f69('0x29')](handleError(_0x3063a7,null));};exports[_0x6f69('0x2a')]=function(_0x3e58e8,_0x4fe1dd){var _0x1580a1={'raw':![],'where':{'id':_0x3e58e8[_0x6f69('0x2b')]['id']}},_0x2e6189={};_0x2e6189['model']=_[_0x6f69('0x2c')](db[_0x6f69('0x2d')][_0x6f69('0x22')]);_0x2e6189[_0x6f69('0x27')]=_[_0x6f69('0x2c')](_0x3e58e8[_0x6f69('0x27')]);_0x2e6189[_0x6f69('0x2e')]=_[_0x6f69('0x2f')](_0x2e6189[_0x6f69('0x30')],_0x2e6189[_0x6f69('0x27')]);_0x1580a1[_0x6f69('0x31')]=_[_0x6f69('0x2f')](_0x2e6189[_0x6f69('0x30')],qs[_0x6f69('0x32')](_0x3e58e8['query']['fields']));_0x1580a1[_0x6f69('0x31')]=_0x1580a1[_0x6f69('0x31')][_0x6f69('0x33')]?_0x1580a1['attributes']:_0x2e6189[_0x6f69('0x30')];if(_0x3e58e8[_0x6f69('0x27')][_0x6f69('0x34')]){_0x1580a1[_0x6f69('0x35')]=[{'all':!![]}];}_0x1580a1=_['merge']({},_0x1580a1,_0x3e58e8[_0x6f69('0x36')]);return db[_0x6f69('0x2d')][_0x6f69('0x37')](_0x1580a1)[_0x6f69('0x1a')](handleEntityNotFound(_0x4fe1dd,null))['then'](respondWithResult(_0x4fe1dd,null))[_0x6f69('0x29')](handleError(_0x4fe1dd,null));};exports[_0x6f69('0x38')]=function(_0x50d203,_0x21f20){return db[_0x6f69('0x2d')][_0x6f69('0x38')](_0x50d203['body'],{})[_0x6f69('0x1a')](respondWithResult(_0x21f20,0xc9))[_0x6f69('0x29')](handleError(_0x21f20,null));};exports[_0x6f69('0x39')]=function(_0x27a980,_0x11b665){if(_0x27a980[_0x6f69('0x3a')]['id']){delete _0x27a980[_0x6f69('0x3a')]['id'];}return db[_0x6f69('0x2d')][_0x6f69('0x37')]({'where':{'id':_0x27a980[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x11b665,null))[_0x6f69('0x1a')](saveUpdates(_0x27a980[_0x6f69('0x3a')],null))['then'](respondWithResult(_0x11b665,null))[_0x6f69('0x29')](handleError(_0x11b665,null));};exports[_0x6f69('0x1b')]=function(_0x285b5c,_0x18fd85){return db[_0x6f69('0x2d')][_0x6f69('0x37')]({'where':{'id':_0x285b5c['params']['id']}})['then'](handleEntityNotFound(_0x18fd85,null))[_0x6f69('0x1a')](removeEntity(_0x18fd85,null))[_0x6f69('0x29')](handleError(_0x18fd85,null));};exports[_0x6f69('0x3b')]=function(_0x25bbc7,_0x4c7adc){return db[_0x6f69('0x2d')][_0x6f69('0x3b')]()[_0x6f69('0x1a')](respondWithResult(_0x4c7adc,null))[_0x6f69('0x29')](handleError(_0x4c7adc,null));};exports[_0x6f69('0x3c')]=function(_0x49d4b2,_0x6a0de5){return db[_0x6f69('0x3d')][_0x6f69('0x37')]({'where':{'id':_0x49d4b2[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x6a0de5,null))[_0x6f69('0x1a')](function(_0x2d2904){if(_0x2d2904){return _0x2d2904[_0x6f69('0x3c')](_0x49d4b2[_0x6f69('0x3a')][_0x6f69('0x3e')],_[_0x6f69('0x3f')](_0x49d4b2[_0x6f69('0x3a')],[_0x6f69('0x3e'),'id'])||{});}})[_0x6f69('0x1a')](respondWithResult(_0x6a0de5,null))[_0x6f69('0x29')](handleError(_0x6a0de5,null));};exports['getMessages']=function(_0xe39093,_0x3fb32a){var _0x14e1fb={'raw':![],'where':{}};var _0x5172c0={};var _0x48a096={'count':0x0,'rows':[]};return db['MailInteraction'][_0x6f69('0x40')]({'where':{'id':_0xe39093[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x3fb32a,null))[_0x6f69('0x1a')](function(_0x528c90){if(_0x528c90){_0x5172c0['model']=_[_0x6f69('0x2c')](db[_0x6f69('0x3d')]['rawAttributes']);_0x5172c0[_0x6f69('0x27')]=_[_0x6f69('0x2c')](_0xe39093[_0x6f69('0x27')]);_0x5172c0[_0x6f69('0x2e')]=_[_0x6f69('0x2f')](_0x5172c0[_0x6f69('0x30')],_0x5172c0[_0x6f69('0x27')]);_0x14e1fb[_0x6f69('0x31')]=_[_0x6f69('0x2f')](_0x5172c0['model'],qs[_0x6f69('0x32')](_0xe39093['query'][_0x6f69('0x32')]));_0x14e1fb[_0x6f69('0x31')]=_0x14e1fb[_0x6f69('0x31')][_0x6f69('0x33')]?_0x14e1fb[_0x6f69('0x31')]:_0x5172c0[_0x6f69('0x30')];if(!_0xe39093[_0x6f69('0x27')][_0x6f69('0x41')](_0x6f69('0x42'))){_0x14e1fb['limit']=qs[_0x6f69('0x17')](_0xe39093['query'][_0x6f69('0x17')]);_0x14e1fb[_0x6f69('0x16')]=qs[_0x6f69('0x16')](_0xe39093[_0x6f69('0x27')][_0x6f69('0x16')]);}_0x14e1fb[_0x6f69('0x43')]=qs[_0x6f69('0x44')](_0xe39093[_0x6f69('0x27')][_0x6f69('0x44')]);_0x14e1fb['where']=qs[_0x6f69('0x2e')](_['pick'](_0xe39093[_0x6f69('0x27')],_0x5172c0[_0x6f69('0x2e')]));_0x14e1fb[_0x6f69('0x45')]['MailInteractionId']=_0x528c90['id'];if(_0xe39093[_0x6f69('0x27')][_0x6f69('0x46')]){_0x14e1fb[_0x6f69('0x45')]=_[_0x6f69('0x47')](_0x14e1fb[_0x6f69('0x45')],{'$or':_[_0x6f69('0x48')](_0x14e1fb[_0x6f69('0x31')],function(_0x36cc9e){var _0x4a72a5={};_0x4a72a5[_0x36cc9e]={'$like':'%'+_0xe39093[_0x6f69('0x27')][_0x6f69('0x46')]+'%'};return _0x4a72a5;})});}if(_0xe39093[_0x6f69('0x27')]['$gte']){var _0x4cac04=_0xe39093[_0x6f69('0x27')][_0x6f69('0x49')][_0x6f69('0x4a')](',');var _0x4a9c76={};_0x4a9c76[_0x4cac04[0x0]]={'$gte':moment(_0x4cac04[0x1])[_0x6f69('0x4b')](_0x6f69('0x4c'))};_0x14e1fb[_0x6f69('0x45')]=_[_0x6f69('0x47')](_0x14e1fb[_0x6f69('0x45')],_0x4a9c76);}_0x14e1fb=_[_0x6f69('0x47')]({},_0x14e1fb,_0xe39093[_0x6f69('0x36')]);return db[_0x6f69('0x3d')]['count']({'where':_0x14e1fb[_0x6f69('0x45')]})[_0x6f69('0x1a')](function(_0x11f519){_0x48a096['count']=_0x11f519;if(_0xe39093[_0x6f69('0x27')][_0x6f69('0x34')]){_0x14e1fb[_0x6f69('0x35')]=[{'all':!![]}];}return db[_0x6f69('0x3d')][_0x6f69('0x26')](_0x14e1fb);})[_0x6f69('0x1a')](function(_0x5f4c73){if(_0xe39093['query'][_0x6f69('0x4d')]===_0x6f69('0x4e')){for(var _0x55551e=0x0;_0x55551e<_0x5f4c73[_0x6f69('0x33')];_0x55551e++){_0x5f4c73[_0x55551e][_0x6f69('0x3a')]=juice(_0x5f4c73[_0x55551e][_0x6f69('0x3a')]);}}_0x48a096[_0x6f69('0x4f')]=_0x5f4c73;return _0x48a096;});}})[_0x6f69('0x1a')](respondWithFilteredResult(_0x3fb32a,_0x14e1fb))[_0x6f69('0x29')](handleError(_0x3fb32a,null));};exports[_0x6f69('0x50')]=function(_0x3b9bf6,_0x4fe88f){return db[_0x6f69('0x2d')][_0x6f69('0x37')]({'where':{'id':_0x3b9bf6['params']['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0x4fe88f,null))['then'](function(_0x14431c){if(_0x14431c){return _0x14431c[_0x6f69('0x51')](_0x3b9bf6[_0x6f69('0x3a')][_0x6f69('0x3e')],_[_0x6f69('0x3f')](_0x3b9bf6[_0x6f69('0x3a')],[_0x6f69('0x3e'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x6f69('0x1f'),_0x6f69('0x52')],'where':{'id':_0x3b9bf6[_0x6f69('0x3a')][_0x6f69('0x3e')]}});})[_0x6f69('0x1a')](function(_0x20fa43){socket['emit'](_0x6f69('0x53'),{'id':Number(_0x3b9bf6[_0x6f69('0x2b')]['id']),'tags':_0x20fa43||[]});return{'id':Number(_0x3b9bf6['params']['id']),'tags':_0x20fa43||[]};});}})['then'](respondWithResult(_0x4fe88f,null))[_0x6f69('0x29')](handleError(_0x4fe88f,null));};exports[_0x6f69('0x54')]=function(_0x25034f,_0xbc25ee){return db[_0x6f69('0x2d')]['find']({'where':{'id':_0x25034f[_0x6f69('0x2b')]['id']}})[_0x6f69('0x1a')](handleEntityNotFound(_0xbc25ee,null))[_0x6f69('0x1a')](function(_0x487ccc){if(_0x487ccc){return _0x487ccc['removeTags'](_0x25034f[_0x6f69('0x27')][_0x6f69('0x3e')]);}})[_0x6f69('0x1a')](respondWithStatusCode(_0xbc25ee,null))['catch'](handleError(_0xbc25ee,null));};exports[_0x6f69('0x55')]=function(_0x53a5b7,_0x14a51e){var _0x36a479=moment()[_0x6f69('0x56')]()[_0x6f69('0x57')]();var _0x5129a2=path[_0x6f69('0x58')](config[_0x6f69('0x59')],'server',_0x6f69('0x5a'),_0x6f69('0x5b'));var _0x4381de=path[_0x6f69('0x58')](config[_0x6f69('0x59')],_0x6f69('0x5c'),_0x6f69('0x5a'),_0x6f69('0x5d'));var _0xa7ce7=path[_0x6f69('0x58')](_0x5129a2,_0x36a479);var _0x5cd767=util['format'](_0x6f69('0x5e'),_0x53a5b7[_0x6f69('0x2b')]['id'],_0x36a479);var _0x552d85=path[_0x6f69('0x58')](_0x5129a2,_0x5cd767);var _0x1825a5=[];if(_0x53a5b7[_0x6f69('0x27')][_0x6f69('0x5d')]){_0x1825a5[_0x6f69('0x5f')]({'model':db[_0x6f69('0x60')],'as':'Attachments','raw':!![]});}var _0x6fe196=[{'model':db[_0x6f69('0x3d')],'as':_0x6f69('0x61'),'attributes':['id',_0x6f69('0x3a'),_0x6f69('0x62'),'to','cc',_0x6f69('0x63'),_0x6f69('0x64'),'createdAt'],'where':{'secret':![]},'order':qs[_0x6f69('0x44')]('id'),'include':_0x1825a5}];return db['MailInteraction']['find']({'where':{'id':_0x53a5b7['params']['id']},'include':_0x6fe196})[_0x6f69('0x1a')](handleEntityNotFound(_0x14a51e,null))[_0x6f69('0x1a')](function(_0x326ab7){if(_0x326ab7&&_0x326ab7['Messages']){var _0xfef872=_0x326ab7[_0x6f69('0x65')]({'plain':!![]});fs[_0x6f69('0x66')](_0xa7ce7);return BPromise[_0x6f69('0x67')](_0xfef872['Messages'],function(_0x41f88d,_0x3bba06){var _0x5c7df8={'from':_0x41f88d[_0x6f69('0x62')],'to':_0x41f88d['to']||_0x6f69('0x68'),'subject':_0x41f88d[_0x6f69('0x64')],'html':htmlEntities[_0x6f69('0x69')](_0x41f88d[_0x6f69('0x3a')]),'headers':{'Date':moment(_0x41f88d['createdAt'])['format'](_0x6f69('0x6a'))},'attachments':[]};if(_0x41f88d['cc']){_0x5c7df8['headers']['Cc']=_0x41f88d['cc'];}if(_0x41f88d['bcc']){_0x5c7df8[_0x6f69('0x6b')][_0x6f69('0x6c')]=_0x41f88d[_0x6f69('0x63')];}return new BPromise(function(_0x520fea,_0x3a7207){if(_0x41f88d[_0x6f69('0x6d')]){for(var _0x32e704=0x0;_0x32e704<_0x41f88d[_0x6f69('0x6d')][_0x6f69('0x33')];_0x32e704++){var _0x525103=_0x41f88d[_0x6f69('0x6d')][_0x32e704];var _0x2b817e=path[_0x6f69('0x58')](_0x4381de,_0x525103[_0x6f69('0x6e')]);if(fs[_0x6f69('0x6f')](_0x2b817e)){_0x5c7df8[_0x6f69('0x5d')][_0x6f69('0x5f')]({'name':_0x525103[_0x6f69('0x1f')],'contentType':_0x525103['type'],'data':fs['readFileSync'](_0x2b817e)});}}}emlformat[_0x6f69('0x70')](_0x5c7df8,function(_0xd1e3d,_0x18238){if(_0xd1e3d)return _0x3a7207(_0xd1e3d);fs['writeFileSync'](path[_0x6f69('0x58')](_0xa7ce7,util[_0x6f69('0x4b')]('message%d.eml',_0x3bba06)),_0x18238);return _0x520fea(_0x18238);});});})[_0x6f69('0x1a')](function(){return new BPromise(function(_0x1e4208,_0x5b22d5){zipdir(_0xa7ce7,{'saveTo':_0x552d85},function(_0xad851,_0x366011){if(_0xad851)return _0x5b22d5(_0xad851);return _0x1e4208(_0x366011);});})[_0x6f69('0x1a')](function(){return new BPromise(function(_0x28cb0e,_0x5a2f2d){rimraf(_0xa7ce7,function(_0x376316){if(_0x376316)_0x5a2f2d(_0x376316);return _0x28cb0e();});});})['then'](function(){return _0x14a51e[_0x6f69('0x55')](_0x552d85,_0x5cd767,function(_0x4bf712){if(!_0x4bf712)fs[_0x6f69('0x71')](_0x552d85);});});});}else{return _0x14a51e[_0x6f69('0x1c')](0xc8);}})['catch'](handleError(_0x14a51e,null));}; \ No newline at end of file +var _0xae75=['sort','where','pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','rows','addTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','from','bcc','createdAt','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','eml-format','bluebird','util','path','lodash','juice','ioredis','../../components/interaction/service','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','sendStatus','status','end','json','undefined','count','offset','set','update','then','destroy','error','stack','name','send','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','show','params','keys','filters','intersection','model','attributes','fields','length','include','merge','options','find','catch','create','body','addMessage','ids','omit','getMessages','findOne','MailMessage','hasOwnProperty','nolimit','limit','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae75,0x1d6));var _0x5ae7=function(_0x16a994,_0x3a9cb2){_0x16a994=_0x16a994-0x0;var _0x1d3e8d=_0xae75[_0x16a994];return _0x1d3e8d;};'use strict';var emlformat=require(_0x5ae7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x5ae7('0x1'));var util=require(_0x5ae7('0x2'));var path=require(_0x5ae7('0x3'));var fs=require('fs');var _=require(_0x5ae7('0x4'));var juice=require(_0x5ae7('0x5'));var Redis=require(_0x5ae7('0x6'));var interaction=require(_0x5ae7('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x5ae7('0x8'))['db'];var htmlEntities=require(_0x5ae7('0x9'));config[_0x5ae7('0xa')]=_[_0x5ae7('0xb')](config[_0x5ae7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5ae7('0xc'))(new Redis(config[_0x5ae7('0xa')]));require(_0x5ae7('0xd'))['register'](socket);function respondWithStatusCode(_0x2831b6,_0x349b57){_0x349b57=_0x349b57||0xcc;return function(_0x2e72b4){if(_0x2e72b4){return _0x2831b6[_0x5ae7('0xe')](_0x349b57);}return _0x2831b6[_0x5ae7('0xf')](_0x349b57)[_0x5ae7('0x10')]();};}function respondWithResult(_0x1961cf,_0x492f5f){_0x492f5f=_0x492f5f||0xc8;return function(_0x305f57){if(_0x305f57){return _0x1961cf['status'](_0x492f5f)[_0x5ae7('0x11')](_0x305f57);}};}function respondWithFilteredResult(_0x3f6b07,_0x54ef0d){return function(_0x5f5016){if(_0x5f5016){var _0x355fc7=typeof _0x54ef0d['offset']===_0x5ae7('0x12')&&typeof _0x54ef0d['limit']===_0x5ae7('0x12');var _0x5e7244=_0x5f5016[_0x5ae7('0x13')];var _0x547940=_0x355fc7?0x0:_0x54ef0d[_0x5ae7('0x14')];var _0x576466=_0x355fc7?_0x5f5016[_0x5ae7('0x13')]:_0x54ef0d[_0x5ae7('0x14')]+_0x54ef0d['limit'];var _0x837e38;if(_0x576466>=_0x5e7244){_0x576466=_0x5e7244;_0x837e38=0xc8;}else{_0x837e38=0xce;}_0x3f6b07['status'](_0x837e38);return _0x3f6b07[_0x5ae7('0x15')]('Content-Range',_0x547940+'-'+_0x576466+'/'+_0x5e7244)[_0x5ae7('0x11')](_0x5f5016);}return null;};}function saveUpdates(_0x1d3c5b){return function(_0x8e25ca){if(_0x8e25ca){return _0x8e25ca[_0x5ae7('0x16')](_0x1d3c5b)[_0x5ae7('0x17')](function(_0x4cb60e){return _0x4cb60e;});}return null;};}function removeEntity(_0x49945a){return function(_0x16e188){if(_0x16e188){return _0x16e188[_0x5ae7('0x18')]()[_0x5ae7('0x17')](function(){_0x49945a[_0x5ae7('0xf')](0xcc)[_0x5ae7('0x10')]();});}};}function handleEntityNotFound(_0x23bc97){return function(_0x18f91f){if(!_0x18f91f){_0x23bc97['sendStatus'](0x194);}return _0x18f91f;};}function handleError(_0x2808ca,_0x109344){_0x109344=_0x109344||0x1f4;return function(_0x5c7ae6){logger[_0x5ae7('0x19')](_0x5c7ae6[_0x5ae7('0x1a')]);if(_0x5c7ae6[_0x5ae7('0x1b')]){delete _0x5c7ae6['name'];}_0x2808ca['status'](_0x109344)[_0x5ae7('0x1c')](_0x5c7ae6);};}exports['index']=function(_0x39ba71,_0x3ed55f){var _0x48e05e={};var _0x479720=_[_0x5ae7('0x1d')](db[_0x5ae7('0x1e')][_0x5ae7('0x1f')],function(_0x441bec){return{'name':_0x441bec[_0x5ae7('0x20')],'type':_0x441bec[_0x5ae7('0x21')][_0x5ae7('0x22')]};});_0x48e05e=qs[_0x5ae7('0x23')](_0x479720,_0x39ba71);return interaction[_0x5ae7('0x24')]('mail',_0x39ba71[_0x5ae7('0x25')],_0x39ba71[_0x5ae7('0x26')],_0x48e05e,_0x479720)[_0x5ae7('0x17')](respondWithFilteredResult(_0x3ed55f,_0x48e05e))['catch'](handleError(_0x3ed55f,null));};exports[_0x5ae7('0x27')]=function(_0x6050a0,_0x2bc077){var _0x4910ca={'raw':![],'where':{'id':_0x6050a0[_0x5ae7('0x28')]['id']}},_0x5ef362={};_0x5ef362['model']=_[_0x5ae7('0x29')](db[_0x5ae7('0x1e')][_0x5ae7('0x1f')]);_0x5ef362[_0x5ae7('0x25')]=_[_0x5ae7('0x29')](_0x6050a0[_0x5ae7('0x25')]);_0x5ef362[_0x5ae7('0x2a')]=_[_0x5ae7('0x2b')](_0x5ef362[_0x5ae7('0x2c')],_0x5ef362[_0x5ae7('0x25')]);_0x4910ca[_0x5ae7('0x2d')]=_[_0x5ae7('0x2b')](_0x5ef362[_0x5ae7('0x2c')],qs[_0x5ae7('0x2e')](_0x6050a0['query'][_0x5ae7('0x2e')]));_0x4910ca[_0x5ae7('0x2d')]=_0x4910ca[_0x5ae7('0x2d')][_0x5ae7('0x2f')]?_0x4910ca['attributes']:_0x5ef362['model'];if(_0x6050a0[_0x5ae7('0x25')]['includeAll']){_0x4910ca[_0x5ae7('0x30')]=[{'all':!![]}];}_0x4910ca=_[_0x5ae7('0x31')]({},_0x4910ca,_0x6050a0[_0x5ae7('0x32')]);return db[_0x5ae7('0x1e')][_0x5ae7('0x33')](_0x4910ca)[_0x5ae7('0x17')](handleEntityNotFound(_0x2bc077,null))[_0x5ae7('0x17')](respondWithResult(_0x2bc077,null))[_0x5ae7('0x34')](handleError(_0x2bc077,null));};exports[_0x5ae7('0x35')]=function(_0x40f696,_0x66f606){return db['MailInteraction'][_0x5ae7('0x35')](_0x40f696[_0x5ae7('0x36')],{})['then'](respondWithResult(_0x66f606,0xc9))[_0x5ae7('0x34')](handleError(_0x66f606,null));};exports[_0x5ae7('0x16')]=function(_0x19ff27,_0x3c0db1){if(_0x19ff27[_0x5ae7('0x36')]['id']){delete _0x19ff27[_0x5ae7('0x36')]['id'];}return db[_0x5ae7('0x1e')][_0x5ae7('0x33')]({'where':{'id':_0x19ff27[_0x5ae7('0x28')]['id']}})[_0x5ae7('0x17')](handleEntityNotFound(_0x3c0db1,null))[_0x5ae7('0x17')](saveUpdates(_0x19ff27['body'],null))[_0x5ae7('0x17')](respondWithResult(_0x3c0db1,null))[_0x5ae7('0x34')](handleError(_0x3c0db1,null));};exports[_0x5ae7('0x18')]=function(_0x26c03c,_0x2d5150){return db[_0x5ae7('0x1e')]['find']({'where':{'id':_0x26c03c[_0x5ae7('0x28')]['id']}})[_0x5ae7('0x17')](handleEntityNotFound(_0x2d5150,null))[_0x5ae7('0x17')](removeEntity(_0x2d5150,null))[_0x5ae7('0x34')](handleError(_0x2d5150,null));};exports['describe']=function(_0x25223c,_0x47fabd){return db['MailInteraction']['describe']()[_0x5ae7('0x17')](respondWithResult(_0x47fabd,null))[_0x5ae7('0x34')](handleError(_0x47fabd,null));};exports[_0x5ae7('0x37')]=function(_0xfb57a0,_0x5aad69){return db['MailMessage']['find']({'where':{'id':_0xfb57a0[_0x5ae7('0x28')]['id']}})[_0x5ae7('0x17')](handleEntityNotFound(_0x5aad69,null))[_0x5ae7('0x17')](function(_0x44ca05){if(_0x44ca05){return _0x44ca05[_0x5ae7('0x37')](_0xfb57a0[_0x5ae7('0x36')][_0x5ae7('0x38')],_[_0x5ae7('0x39')](_0xfb57a0[_0x5ae7('0x36')],[_0x5ae7('0x38'),'id'])||{});}})[_0x5ae7('0x17')](respondWithResult(_0x5aad69,null))[_0x5ae7('0x34')](handleError(_0x5aad69,null));};exports[_0x5ae7('0x3a')]=function(_0x77c203,_0x2537d2){var _0x790b5a={'raw':![],'where':{}};var _0x51f042={};var _0x2a4ebe={'count':0x0,'rows':[]};return db[_0x5ae7('0x1e')][_0x5ae7('0x3b')]({'where':{'id':_0x77c203[_0x5ae7('0x28')]['id']}})[_0x5ae7('0x17')](handleEntityNotFound(_0x2537d2,null))[_0x5ae7('0x17')](function(_0x27dc8b){if(_0x27dc8b){_0x51f042[_0x5ae7('0x2c')]=_[_0x5ae7('0x29')](db[_0x5ae7('0x3c')]['rawAttributes']);_0x51f042['query']=_[_0x5ae7('0x29')](_0x77c203[_0x5ae7('0x25')]);_0x51f042['filters']=_[_0x5ae7('0x2b')](_0x51f042['model'],_0x51f042[_0x5ae7('0x25')]);_0x790b5a[_0x5ae7('0x2d')]=_['intersection'](_0x51f042[_0x5ae7('0x2c')],qs[_0x5ae7('0x2e')](_0x77c203[_0x5ae7('0x25')]['fields']));_0x790b5a[_0x5ae7('0x2d')]=_0x790b5a['attributes']['length']?_0x790b5a[_0x5ae7('0x2d')]:_0x51f042[_0x5ae7('0x2c')];if(!_0x77c203[_0x5ae7('0x25')][_0x5ae7('0x3d')](_0x5ae7('0x3e'))){_0x790b5a['limit']=qs[_0x5ae7('0x3f')](_0x77c203['query'][_0x5ae7('0x3f')]);_0x790b5a['offset']=qs[_0x5ae7('0x14')](_0x77c203[_0x5ae7('0x25')][_0x5ae7('0x14')]);}_0x790b5a[_0x5ae7('0x40')]=qs['sort'](_0x77c203['query'][_0x5ae7('0x41')]);_0x790b5a[_0x5ae7('0x42')]=qs['filters'](_[_0x5ae7('0x43')](_0x77c203[_0x5ae7('0x25')],_0x51f042[_0x5ae7('0x2a')]));_0x790b5a[_0x5ae7('0x42')]['MailInteractionId']=_0x27dc8b['id'];if(_0x77c203[_0x5ae7('0x25')]['filter']){_0x790b5a[_0x5ae7('0x42')]=_['merge'](_0x790b5a[_0x5ae7('0x42')],{'$or':_[_0x5ae7('0x1d')](_0x790b5a[_0x5ae7('0x2d')],function(_0x3cfbd3){var _0x532773={};_0x532773[_0x3cfbd3]={'$like':'%'+_0x77c203[_0x5ae7('0x25')][_0x5ae7('0x44')]+'%'};return _0x532773;})});}if(_0x77c203[_0x5ae7('0x25')][_0x5ae7('0x45')]){var _0x3af2cc=_0x77c203['query'][_0x5ae7('0x45')][_0x5ae7('0x46')](',');var _0x3b355d={};_0x3b355d[_0x3af2cc[0x0]]={'$gte':moment(_0x3af2cc[0x1])[_0x5ae7('0x47')](_0x5ae7('0x48'))};_0x790b5a['where']=_['merge'](_0x790b5a[_0x5ae7('0x42')],_0x3b355d);}_0x790b5a=_[_0x5ae7('0x31')]({},_0x790b5a,_0x77c203[_0x5ae7('0x32')]);return db[_0x5ae7('0x3c')][_0x5ae7('0x13')]({'where':_0x790b5a['where']})[_0x5ae7('0x17')](function(_0x53ec69){_0x2a4ebe[_0x5ae7('0x13')]=_0x53ec69;if(_0x77c203[_0x5ae7('0x25')]['includeAll']){_0x790b5a[_0x5ae7('0x30')]=[{'all':!![]}];}return db['MailMessage'][_0x5ae7('0x24')](_0x790b5a);})[_0x5ae7('0x17')](function(_0x542c51){if(_0x77c203[_0x5ae7('0x25')]['inlineCss']===_0x5ae7('0x49')){for(var _0x2c8d73=0x0;_0x2c8d73<_0x542c51[_0x5ae7('0x2f')];_0x2c8d73++){_0x542c51[_0x2c8d73][_0x5ae7('0x36')]=juice(_0x542c51[_0x2c8d73][_0x5ae7('0x36')]);}}_0x2a4ebe[_0x5ae7('0x4a')]=_0x542c51;return _0x2a4ebe;});}})['then'](respondWithFilteredResult(_0x2537d2,_0x790b5a))[_0x5ae7('0x34')](handleError(_0x2537d2,null));};exports[_0x5ae7('0x4b')]=function(_0x27eaa6,_0x39b6fd){return db[_0x5ae7('0x1e')][_0x5ae7('0x33')]({'where':{'id':_0x27eaa6[_0x5ae7('0x28')]['id']}})[_0x5ae7('0x17')](handleEntityNotFound(_0x39b6fd,null))[_0x5ae7('0x17')](function(_0xc8e34c){if(_0xc8e34c){return _0xc8e34c['setTags'](_0x27eaa6[_0x5ae7('0x36')][_0x5ae7('0x38')],_['omit'](_0x27eaa6[_0x5ae7('0x36')],['ids','id'])||{})[_0x5ae7('0x4c')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x27eaa6['body'][_0x5ae7('0x38')]}});})[_0x5ae7('0x17')](function(_0x2a861d){socket[_0x5ae7('0x4d')](_0x5ae7('0x4e'),{'id':Number(_0x27eaa6['params']['id']),'tags':_0x2a861d||[]});return{'id':Number(_0x27eaa6[_0x5ae7('0x28')]['id']),'tags':_0x2a861d||[]};});}})['then'](respondWithResult(_0x39b6fd,null))[_0x5ae7('0x34')](handleError(_0x39b6fd,null));};exports['removeTags']=function(_0x79fcbd,_0xc55815){return db[_0x5ae7('0x1e')][_0x5ae7('0x33')]({'where':{'id':_0x79fcbd[_0x5ae7('0x28')]['id']}})[_0x5ae7('0x17')](handleEntityNotFound(_0xc55815,null))[_0x5ae7('0x17')](function(_0x39bf09){if(_0x39bf09){return _0x39bf09[_0x5ae7('0x4f')](_0x79fcbd['query'][_0x5ae7('0x38')]);}})[_0x5ae7('0x17')](respondWithStatusCode(_0xc55815,null))[_0x5ae7('0x34')](handleError(_0xc55815,null));};exports[_0x5ae7('0x50')]=function(_0x5541b4,_0x39f89f){var _0x23263a=moment()[_0x5ae7('0x51')]()[_0x5ae7('0x52')]();var _0x19e958=path[_0x5ae7('0x53')](config[_0x5ae7('0x54')],_0x5ae7('0x55'),_0x5ae7('0x56'),_0x5ae7('0x57'));var _0x5d0589=path[_0x5ae7('0x53')](config[_0x5ae7('0x54')],_0x5ae7('0x55'),_0x5ae7('0x56'),_0x5ae7('0x58'));var _0x854a58=path[_0x5ae7('0x53')](_0x19e958,_0x23263a);var _0x4b17a1=util[_0x5ae7('0x47')]('transcript-%d-%s.zip',_0x5541b4[_0x5ae7('0x28')]['id'],_0x23263a);var _0x1c309d=path[_0x5ae7('0x53')](_0x19e958,_0x4b17a1);var _0x4a0fab=[];if(_0x5541b4[_0x5ae7('0x25')][_0x5ae7('0x58')]){_0x4a0fab[_0x5ae7('0x59')]({'model':db[_0x5ae7('0x5a')],'as':_0x5ae7('0x5b'),'raw':!![]});}var _0x668af9=[{'model':db[_0x5ae7('0x3c')],'as':_0x5ae7('0x5c'),'attributes':['id',_0x5ae7('0x36'),_0x5ae7('0x5d'),'to','cc',_0x5ae7('0x5e'),'subject',_0x5ae7('0x5f')],'where':{'secret':![]},'order':qs[_0x5ae7('0x41')]('id'),'include':_0x4a0fab}];return db[_0x5ae7('0x1e')]['find']({'where':{'id':_0x5541b4[_0x5ae7('0x28')]['id']},'include':_0x668af9})[_0x5ae7('0x17')](handleEntityNotFound(_0x39f89f,null))[_0x5ae7('0x17')](function(_0x4f90df){if(_0x4f90df&&_0x4f90df[_0x5ae7('0x5c')]){var _0xa66a1f=_0x4f90df[_0x5ae7('0x60')]({'plain':!![]});fs['mkdirSync'](_0x854a58);return BPromise[_0x5ae7('0x61')](_0xa66a1f[_0x5ae7('0x5c')],function(_0x547918,_0x2c6d5e){var _0x3717cb={'from':_0x547918[_0x5ae7('0x5d')],'to':_0x547918['to']||'missing.recipient@your.company.com','subject':_0x547918['subject'],'html':htmlEntities[_0x5ae7('0x62')](_0x547918['body']),'headers':{'Date':moment(_0x547918[_0x5ae7('0x5f')])[_0x5ae7('0x47')](_0x5ae7('0x63'))},'attachments':[]};if(_0x547918['cc']){_0x3717cb['headers']['Cc']=_0x547918['cc'];}if(_0x547918[_0x5ae7('0x5e')]){_0x3717cb[_0x5ae7('0x64')][_0x5ae7('0x65')]=_0x547918[_0x5ae7('0x5e')];}return new BPromise(function(_0x60be16,_0x369428){if(_0x547918['Attachments']){for(var _0x427562=0x0;_0x427562<_0x547918[_0x5ae7('0x5b')][_0x5ae7('0x2f')];_0x427562++){var _0x562511=_0x547918['Attachments'][_0x427562];var _0x58e59f=path[_0x5ae7('0x53')](_0x5d0589,_0x562511[_0x5ae7('0x66')]);if(fs[_0x5ae7('0x67')](_0x58e59f)){_0x3717cb[_0x5ae7('0x58')]['push']({'name':_0x562511[_0x5ae7('0x1b')],'contentType':_0x562511[_0x5ae7('0x21')],'data':fs[_0x5ae7('0x68')](_0x58e59f)});}}}emlformat[_0x5ae7('0x69')](_0x3717cb,function(_0x5cd5e7,_0xfac9f2){if(_0x5cd5e7)return _0x369428(_0x5cd5e7);fs[_0x5ae7('0x6a')](path[_0x5ae7('0x53')](_0x854a58,util['format']('message%d.eml',_0x2c6d5e)),_0xfac9f2);return _0x60be16(_0xfac9f2);});});})[_0x5ae7('0x17')](function(){return new BPromise(function(_0x2148d7,_0x3c2c76){zipdir(_0x854a58,{'saveTo':_0x1c309d},function(_0x30e0b7,_0x450feb){if(_0x30e0b7)return _0x3c2c76(_0x30e0b7);return _0x2148d7(_0x450feb);});})[_0x5ae7('0x17')](function(){return new BPromise(function(_0x102d2b,_0x19def6){rimraf(_0x854a58,function(_0x39758c){if(_0x39758c)_0x19def6(_0x39758c);return _0x102d2b();});});})[_0x5ae7('0x17')](function(){return _0x39f89f[_0x5ae7('0x50')](_0x1c309d,_0x4b17a1,function(_0x3b224f){if(!_0x3b224f)fs['unlinkSync'](_0x1c309d);});});});}else{return _0x39f89f[_0x5ae7('0xe')](0xc8);}})['catch'](handleError(_0x39f89f,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 6afdfa8..45d433c 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 _0xe339=['exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x2bed89,_0x1556ef){var _0x3b46c6=function(_0x103df1){while(--_0x103df1){_0x2bed89['push'](_0x2bed89['shift']());}};_0x3b46c6(++_0x1556ef);}(_0xe339,0x91));var _0x9e33=function(_0x5d2699,_0xbb63f2){_0x5d2699=_0x5d2699-0x0;var _0x2a2ee6=_0xe339[_0x5d2699];return _0x2a2ee6;};'use strict';var EventEmitter=require(_0x9e33('0x0'));var MailInteraction=require(_0x9e33('0x1'))['db'][_0x9e33('0x2')];var MailMessage=require(_0x9e33('0x1'))['db'][_0x9e33('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9e33('0x4')](0x0);var events={'afterCreate':_0x9e33('0x5'),'afterUpdate':'update','afterDestroy':_0x9e33('0x6')};function emitEvent(_0x45d1d6){return function(_0x34de42,_0x1c530e,_0x1f0e8d){_0x34de42[_0x9e33('0x7')]({'attributes':['id'],'raw':!![]})[_0x9e33('0x8')](function(_0x202eb8){_0x34de42[_0x9e33('0x9')]('Users',_0x202eb8[_0x9e33('0xa')](function(_0x16e748){return{'id':_0x16e748['id']};}));return MailMessage[_0x9e33('0xb')]({'where':{'MailInteractionId':_0x34de42['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9e33('0x8')](function(_0x36a0ab){_0x34de42['setDataValue'](_0x9e33('0xc'),_0x36a0ab[_0x9e33('0xd')]);MailInteractionEvents['emit'](_0x45d1d6+':'+_0x34de42['id'],_0x34de42);MailInteractionEvents[_0x9e33('0xe')](_0x45d1d6,_0x34de42);_0x1f0e8d(null);})[_0x9e33('0xf')](_0x1f0e8d(null));};}for(var e in events){if(events[_0x9e33('0x10')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x9e33('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0xf1c9=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users'];(function(_0x53f017,_0x1a394c){var _0x2d8aa7=function(_0x4b2d47){while(--_0x4b2d47){_0x53f017['push'](_0x53f017['shift']());}};_0x2d8aa7(++_0x1a394c);}(_0xf1c9,0xa0));var _0x9f1c=function(_0x545a6c,_0x28b254){_0x545a6c=_0x545a6c-0x0;var _0x48d3f8=_0xf1c9[_0x545a6c];return _0x48d3f8;};'use strict';var EventEmitter=require(_0x9f1c('0x0'));var MailInteraction=require(_0x9f1c('0x1'))['db'][_0x9f1c('0x2')];var MailMessage=require(_0x9f1c('0x1'))['db'][_0x9f1c('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9f1c('0x4')](0x0);var events={'afterCreate':_0x9f1c('0x5'),'afterUpdate':_0x9f1c('0x6'),'afterDestroy':_0x9f1c('0x7')};function emitEvent(_0x682c2f){return function(_0x47fa4b,_0x5cca81,_0x57086d){_0x47fa4b[_0x9f1c('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2be1f9){_0x47fa4b[_0x9f1c('0x9')](_0x9f1c('0xa'),_0x2be1f9[_0x9f1c('0xb')](function(_0x5d6843){return{'id':_0x5d6843['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x47fa4b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xc99fb6){_0x47fa4b[_0x9f1c('0x9')](_0x9f1c('0xc'),_0xc99fb6[_0x9f1c('0xd')]);MailInteractionEvents['emit'](_0x682c2f+':'+_0x47fa4b['id'],_0x47fa4b);MailInteractionEvents[_0x9f1c('0xe')](_0x682c2f,_0x47fa4b);_0x57086d(null);})[_0x9f1c('0xf')](_0x57086d(null));};}for(var e in events){if(events[_0x9f1c('0x10')](e)){var event=events[e];MailInteraction[_0x9f1c('0x11')](e,emitEvent(event));}}module[_0x9f1c('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8508885..1b4ce0a 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 _0x4694=['../../config/logger','api','path','../../config/environment','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','closed','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4694,0xce));var _0x4469=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x4694[_0xdeefbd];return _0x4ff63f;};'use strict';var _=require(_0x4469('0x0'));var util=require('util');var logger=require(_0x4469('0x1'))(_0x4469('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4469('0x3'));var rimraf=require('rimraf');var config=require(_0x4469('0x4'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x541183,_0x1bcee2){return _0x541183['define'](_0x4469('0x5'),attributes,{'tableName':_0x4469('0x6'),'paranoid':![],'indexes':[{'name':_0x4469('0x7'),'fields':[_0x4469('0x8'),'to'],'type':_0x4469('0x9')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e3150,_0x1f1454,_0x269f6f){if(_0x4e3150['substatus']){_0x4e3150[_0x4469('0xa')]=moment()[_0x4469('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x4e3150[_0x4469('0xc')]){_0x4e3150['closedAt']=moment()[_0x4469('0xb')](_0x4469('0xd'));}_0x269f6f(null,_0x1f1454);},'beforeUpdate':function(_0x38c8ee,_0x46bcf7,_0xa186d9){if(_0x38c8ee[_0x4469('0xe')](_0x4469('0xf'))){_0x38c8ee['substatusAt']=_0x38c8ee['substatus']?moment()[_0x4469('0xb')](_0x4469('0xd')):null;}if(_0x38c8ee[_0x4469('0xe')](_0x4469('0xc'))){_0x38c8ee['closedAt']=moment()[_0x4469('0xb')]('YYYY-MM-DD\x20HH:mm:ss');_0x38c8ee[_0x4469('0xf')]=null;_0x38c8ee[_0x4469('0xa')]=null;}_0xa186d9(null,_0x38c8ee);},'afterUpdate':function(_0x35094f,_0x426fd7,_0x1ad83c){var _0x11ed43=_0x541183[_0x4469('0x10')];var _0x2e3b3c=_0x35094f[_0x4469('0x11')]({'plain':!![]});if(_0x2e3b3c['closed']){return _0x11ed43[_0x4469('0x12')][_0x4469('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x2e3b3c['id']}})['then'](function(){_0x1ad83c();})[_0x4469('0x14')](function(_0x33da12){_0x1ad83c(_0x33da12);});}else{_0x1ad83c();}}},'charset':_0x4469('0x15'),'collate':_0x4469('0x16')});}; \ No newline at end of file +var _0xb673=['MailInteraction','mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','get','catch','utf8mb4','../../config/logger','moment','rimraf','./mailInteraction.attributes','define'];(function(_0x30033a,_0x5ce4a6){var _0x5e3518=function(_0x11494a){while(--_0x11494a){_0x30033a['push'](_0x30033a['shift']());}};_0x5e3518(++_0x5ce4a6);}(_0xb673,0x1c3));var _0x3b67=function(_0x41c13f,_0x506b99){_0x41c13f=_0x41c13f-0x0;var _0x32415f=_0xb673[_0x41c13f];return _0x32415f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3b67('0x0'))('api');var moment=require(_0x3b67('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3b67('0x2'));var config=require('../../config/environment');var attributes=require(_0x3b67('0x3'));module['exports']=function(_0x5af63c,_0x562836){return _0x5af63c[_0x3b67('0x4')](_0x3b67('0x5'),attributes,{'tableName':_0x3b67('0x6'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x3b67('0x7'),'to'],'type':_0x3b67('0x8')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x20f200,_0x49a032,_0x5609b9){if(_0x20f200[_0x3b67('0x9')]){_0x20f200['substatusAt']=moment()['format'](_0x3b67('0xa'));}if(_0x20f200[_0x3b67('0xb')]){_0x20f200[_0x3b67('0xc')]=moment()[_0x3b67('0xd')](_0x3b67('0xa'));}_0x5609b9(null,_0x49a032);},'beforeUpdate':function(_0x4e800f,_0x13e8b4,_0x22056d){if(_0x4e800f[_0x3b67('0xe')](_0x3b67('0x9'))){_0x4e800f['substatusAt']=_0x4e800f[_0x3b67('0x9')]?moment()['format'](_0x3b67('0xa')):null;}if(_0x4e800f[_0x3b67('0xe')](_0x3b67('0xb'))){_0x4e800f[_0x3b67('0xc')]=moment()[_0x3b67('0xd')](_0x3b67('0xa'));_0x4e800f[_0x3b67('0x9')]=null;_0x4e800f['substatusAt']=null;}_0x22056d(null,_0x4e800f);},'afterUpdate':function(_0x4afd7d,_0x5d2565,_0x4a71ba){var _0x527f51=_0x5af63c[_0x3b67('0xf')];var _0x132548=_0x4afd7d[_0x3b67('0x10')]({'plain':!![]});if(_0x132548[_0x3b67('0xb')]){return _0x527f51['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x132548['id']}})['then'](function(){_0x4a71ba();})[_0x3b67('0x11')](function(_0x1bb915){_0x4a71ba(_0x1bb915);});}else{_0x4a71ba();}}},'charset':_0x3b67('0x12'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 1208dec..0de4bf3 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 _0xabf7=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','then','request\x20sent','debug','error','code','message','MailInteraction,\x20%s,\x20%s','info','result','catch','UpdateMailInteraction','body','options','raw','limit','stringify','find','ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x4a2be6,_0x4c22e0){var _0xf600aa=function(_0x4ad2c6){while(--_0x4ad2c6){_0x4a2be6['push'](_0x4a2be6['shift']());}};_0xf600aa(++_0x4c22e0);}(_0xabf7,0xae));var _0x7abf=function(_0x3154a3,_0x45d16d){_0x3154a3=_0x3154a3-0x0;var _0x553af5=_0xabf7[_0x3154a3];return _0x553af5;};'use strict';var _=require(_0x7abf('0x0'));var util=require('util');var moment=require(_0x7abf('0x1'));var BPromise=require(_0x7abf('0x2'));var rs=require(_0x7abf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7abf('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7abf('0x5'));var config=require(_0x7abf('0x6'));var jayson=require(_0x7abf('0x7'));var client=jayson[_0x7abf('0x8')][_0x7abf('0x9')]({'port':0x232a});config[_0x7abf('0xa')]=_[_0x7abf('0xb')](config['redis'],{'host':_0x7abf('0xc'),'port':0x18eb});var socket=require(_0x7abf('0xd'))(new Redis(config[_0x7abf('0xa')]));require(_0x7abf('0xe'))[_0x7abf('0xf')](socket);function respondWithRpcPromise(_0x5a0ce2,_0x5c9da3,_0x3e8c13){return new BPromise(function(_0x10e5ee,_0x54ae39){return client['request'](_0x5a0ce2,_0x3e8c13)[_0x7abf('0x10')](function(_0x15748a){logger['info']('MailInteraction,\x20%s,\x20%s',_0x5c9da3,_0x7abf('0x11'));logger[_0x7abf('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x5c9da3,_0x7abf('0x11'),JSON['stringify'](_0x15748a));if(_0x15748a['error']){if(_0x15748a[_0x7abf('0x13')][_0x7abf('0x14')]===0x1f4){logger[_0x7abf('0x13')]('MailInteraction,\x20%s,\x20%s',_0x5c9da3,_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);return _0x54ae39(_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);}logger[_0x7abf('0x13')](_0x7abf('0x16'),_0x5c9da3,_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);return _0x10e5ee(_0x15748a[_0x7abf('0x13')][_0x7abf('0x15')]);}else{logger[_0x7abf('0x17')](_0x7abf('0x16'),_0x5c9da3,_0x7abf('0x11'));_0x10e5ee(_0x15748a[_0x7abf('0x18')][_0x7abf('0x15')]);}})[_0x7abf('0x19')](function(_0x3d8105){logger['error'](_0x7abf('0x16'),_0x5c9da3,_0x3d8105);_0x54ae39(_0x3d8105);});});}exports[_0x7abf('0x1a')]=function(_0x464c48){var _0x37d04a=this;return new Promise(function(_0x5375d5,_0x570385){return db['MailInteraction']['update'](_0x464c48[_0x7abf('0x1b')],{'raw':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')][_0x7abf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')]['where']||null:null,'attributes':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')]['attributes']||null:null,'limit':_0x464c48[_0x7abf('0x1c')]?_0x464c48[_0x7abf('0x1c')][_0x7abf('0x1e')]||null:null})['then'](function(_0x245c9b){logger[_0x7abf('0x17')](_0x7abf('0x1a'),_0x464c48);logger[_0x7abf('0x12')]('UpdateMailInteraction',_0x464c48,JSON[_0x7abf('0x1f')](_0x245c9b));_0x5375d5(_0x245c9b);})[_0x7abf('0x19')](function(_0x313db0){logger[_0x7abf('0x13')](_0x7abf('0x1a'),_0x313db0[_0x7abf('0x15')],_0x464c48);_0x570385(_0x37d04a[_0x7abf('0x13')](0x1f4,_0x313db0['message']));});});};exports['AddTagsToMailInteraction']=function(_0x5e8c9e){return new Promise(function(_0x2d3795,_0x5844bf){return db['MailInteraction'][_0x7abf('0x20')]({'where':_0x5e8c9e[_0x7abf('0x1c')]?_0x5e8c9e[_0x7abf('0x1c')]['where']||null:null})[_0x7abf('0x10')](function(_0x40f1e8){if(_0x40f1e8){return _0x40f1e8['addTags'](_0x5e8c9e[_0x7abf('0x1b')][_0x7abf('0x21')],_['omit'](_0x5e8c9e[_0x7abf('0x1b')],[_0x7abf('0x21'),'id'])||{});}})[_0x7abf('0x22')](function(_0x1a083b){logger[_0x7abf('0x17')](_0x7abf('0x23'),_0x5e8c9e);logger['debug'](_0x7abf('0x23'),_0x5e8c9e,JSON['stringify'](_0x1a083b));_0x2d3795(_0x1a083b);})[_0x7abf('0x19')](function(_0xfdc784){logger[_0x7abf('0x13')](_0x7abf('0x23'),_0xfdc784[_0x7abf('0x15')],_0x5e8c9e);_0x5844bf(_this[_0x7abf('0x13')](0x1f4,_0xfdc784['message']));});});}; \ No newline at end of file +var _0xa84f=['localhost','socket.io-emitter','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','body','options','raw','where','attributes','limit','then','UpdateMailInteraction','find','omit','spread','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xa84f,0x1dd));var _0xfa84=function(_0xfafe54,_0x23c9a6){_0xfafe54=_0xfafe54-0x0;var _0x4ab8e6=_0xa84f[_0xfafe54];return _0x4ab8e6;};'use strict';var _=require(_0xfa84('0x0'));var util=require(_0xfa84('0x1'));var moment=require(_0xfa84('0x2'));var BPromise=require(_0xfa84('0x3'));var rs=require(_0xfa84('0x4'));var fs=require('fs');var Redis=require(_0xfa84('0x5'));var db=require(_0xfa84('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfa84('0x7'))(_0xfa84('0x8'));var config=require(_0xfa84('0x9'));var jayson=require(_0xfa84('0xa'));var client=jayson[_0xfa84('0xb')][_0xfa84('0xc')]({'port':0x232a});config[_0xfa84('0xd')]=_[_0xfa84('0xe')](config[_0xfa84('0xd')],{'host':_0xfa84('0xf'),'port':0x18eb});var socket=require(_0xfa84('0x10'))(new Redis(config[_0xfa84('0xd')]));require('./mailInteraction.socket')[_0xfa84('0x11')](socket);function respondWithRpcPromise(_0x156a4c,_0x504c54,_0x3f0153){return new BPromise(function(_0x1fe5f2,_0x47534d){return client['request'](_0x156a4c,_0x3f0153)['then'](function(_0x19c769){logger[_0xfa84('0x12')](_0xfa84('0x13'),_0x504c54,_0xfa84('0x14'));logger[_0xfa84('0x15')](_0xfa84('0x16'),_0x504c54,_0xfa84('0x14'),JSON[_0xfa84('0x17')](_0x19c769));if(_0x19c769[_0xfa84('0x18')]){if(_0x19c769[_0xfa84('0x18')][_0xfa84('0x19')]===0x1f4){logger[_0xfa84('0x18')](_0xfa84('0x13'),_0x504c54,_0x19c769[_0xfa84('0x18')][_0xfa84('0x1a')]);return _0x47534d(_0x19c769['error'][_0xfa84('0x1a')]);}logger['error'](_0xfa84('0x13'),_0x504c54,_0x19c769[_0xfa84('0x18')][_0xfa84('0x1a')]);return _0x1fe5f2(_0x19c769[_0xfa84('0x18')][_0xfa84('0x1a')]);}else{logger[_0xfa84('0x12')](_0xfa84('0x13'),_0x504c54,_0xfa84('0x14'));_0x1fe5f2(_0x19c769[_0xfa84('0x1b')][_0xfa84('0x1a')]);}})[_0xfa84('0x1c')](function(_0x135d39){logger[_0xfa84('0x18')](_0xfa84('0x13'),_0x504c54,_0x135d39);_0x47534d(_0x135d39);});});}exports['UpdateMailInteraction']=function(_0x3f34f1){var _0x40e6e8=this;return new Promise(function(_0x3151ad,_0x2113d0){return db[_0xfa84('0x1d')]['update'](_0x3f34f1[_0xfa84('0x1e')],{'raw':_0x3f34f1[_0xfa84('0x1f')]?_0x3f34f1[_0xfa84('0x1f')][_0xfa84('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f34f1[_0xfa84('0x1f')]?_0x3f34f1[_0xfa84('0x1f')][_0xfa84('0x21')]||null:null,'attributes':_0x3f34f1[_0xfa84('0x1f')]?_0x3f34f1[_0xfa84('0x1f')][_0xfa84('0x22')]||null:null,'limit':_0x3f34f1[_0xfa84('0x1f')]?_0x3f34f1[_0xfa84('0x1f')][_0xfa84('0x23')]||null:null})[_0xfa84('0x24')](function(_0x11a9da){logger['info']('UpdateMailInteraction',_0x3f34f1);logger[_0xfa84('0x15')]('UpdateMailInteraction',_0x3f34f1,JSON[_0xfa84('0x17')](_0x11a9da));_0x3151ad(_0x11a9da);})['catch'](function(_0x35a146){logger[_0xfa84('0x18')](_0xfa84('0x25'),_0x35a146[_0xfa84('0x1a')],_0x3f34f1);_0x2113d0(_0x40e6e8['error'](0x1f4,_0x35a146['message']));});});};exports['AddTagsToMailInteraction']=function(_0x20dbb2){return new Promise(function(_0x2b124a,_0xc9af8a){return db[_0xfa84('0x1d')][_0xfa84('0x26')]({'where':_0x20dbb2[_0xfa84('0x1f')]?_0x20dbb2[_0xfa84('0x1f')][_0xfa84('0x21')]||null:null})[_0xfa84('0x24')](function(_0x4ef64d){if(_0x4ef64d){return _0x4ef64d['addTags'](_0x20dbb2['body']['ids'],_[_0xfa84('0x27')](_0x20dbb2[_0xfa84('0x1e')],['ids','id'])||{});}})[_0xfa84('0x28')](function(_0x255c98){logger[_0xfa84('0x12')]('AddTags',_0x20dbb2);logger[_0xfa84('0x15')]('AddTags',_0x20dbb2,JSON[_0xfa84('0x17')](_0x255c98));_0x2b124a(_0x255c98);})[_0xfa84('0x1c')](function(_0x3fe04e){logger[_0xfa84('0x18')]('AddTags',_0x3fe04e['message'],_0x20dbb2);_0xc9af8a(_this['error'](0x1f4,_0x3fe04e[_0xfa84('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 29c7535..1b1ad66 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 _0x400f=['save','remove','update','emit','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x400f,0x19f));var _0xf400=function(_0xe409a6,_0x5b9ce6){_0xe409a6=_0xe409a6-0x0;var _0x40a2f8=_0x400f[_0xe409a6];return _0x40a2f8;};'use strict';var MailInteractionEvents=require(_0xf400('0x0'));var events=[_0xf400('0x1'),_0xf400('0x2'),_0xf400('0x3')];function createListener(_0x2b66f2,_0x7ce8cd){return function(_0x3d5b01){_0x7ce8cd[_0xf400('0x4')](_0x2b66f2,_0x3d5b01);};}function removeListener(_0x5784f7,_0x4f034e){return function(){MailInteractionEvents['removeListener'](_0x5784f7,_0x4f034e);};}exports[_0xf400('0x5')]=function(_0x50b1d4){for(var _0x3e3556=0x0,_0x3de70d=events[_0xf400('0x6')];_0x3e3556<_0x3de70d;_0x3e3556++){var _0x572863=events[_0x3e3556];var _0x33f830=createListener(_0xf400('0x7')+_0x572863,_0x50b1d4);MailInteractionEvents['on'](_0x572863,_0x33f830);}}; \ No newline at end of file +var _0x7682=['remove','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x2f635e,_0x1f899d){var _0x2169a8=function(_0x40ed60){while(--_0x40ed60){_0x2f635e['push'](_0x2f635e['shift']());}};_0x2169a8(++_0x1f899d);}(_0x7682,0x116));var _0x2768=function(_0x4e8fb5,_0x5bb89a){_0x4e8fb5=_0x4e8fb5-0x0;var _0x198b65=_0x7682[_0x4e8fb5];return _0x198b65;};'use strict';var MailInteractionEvents=require(_0x2768('0x0'));var events=[_0x2768('0x1'),_0x2768('0x2'),'update'];function createListener(_0x3b8121,_0x518793){return function(_0x3445b9){_0x518793[_0x2768('0x3')](_0x3b8121,_0x3445b9);};}function removeListener(_0x26ab35,_0x582ef1){return function(){MailInteractionEvents[_0x2768('0x4')](_0x26ab35,_0x582ef1);};}exports[_0x2768('0x5')]=function(_0x2b03fe){for(var _0x2d2849=0x0,_0x1258be=events[_0x2768('0x6')];_0x2d2849<_0x1258be;_0x2d2849++){var _0xf664a=events[_0x2d2849];var _0x51c77a=createListener(_0x2768('0x7')+_0xf664a,_0x2b03fe);MailInteractionEvents['on'](_0xf664a,_0x51c77a);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 3d4034f..5565a5c 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 _0xf6fa=['Router','./mailInteractionHasTag.controller','get','/describe','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf6fa,0x87));var _0xaf6f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf6fa[_0x126558];return _0x1f6d14;};'use strict';var express=require('express');var router=express[_0xaf6f('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xaf6f('0x1'));router[_0xaf6f('0x2')](_0xaf6f('0x3'),auth['isAuthenticated'](),controller['describe']);module[_0xaf6f('0x4')]=router; \ No newline at end of file +var _0xdebe=['express','Router','../../components/auth/service','./mailInteractionHasTag.controller','/describe','describe','exports'];(function(_0x869333,_0xf50143){var _0x420377=function(_0xde5b0d){while(--_0xde5b0d){_0x869333['push'](_0x869333['shift']());}};_0x420377(++_0xf50143);}(_0xdebe,0x142));var _0xedeb=function(_0x518acd,_0x43c0c7){_0x518acd=_0x518acd-0x0;var _0x2faa0d=_0xdebe[_0x518acd];return _0x2faa0d;};'use strict';var express=require(_0xedeb('0x0'));var router=express[_0xedeb('0x1')]();var auth=require(_0xedeb('0x2'));var controller=require(_0xedeb('0x3'));router['get'](_0xedeb('0x4'),auth['isAuthenticated'](),controller[_0xedeb('0x5')]);module[_0xedeb('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index 4f0d610..8ca96d9 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(_0x15e42d,_0x35bd15){var _0x1e62a1=function(_0x9f71e3){while(--_0x9f71e3){_0x15e42d['push'](_0x15e42d['shift']());}};_0x1e62a1(++_0x35bd15);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x510eb6,_0x1c22ce){var _0x3168a6=function(_0x21ef33){while(--_0x21ef33){_0x510eb6['push'](_0x510eb6['shift']());}};_0x3168a6(++_0x1c22ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 c689973..4b453c8 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 _0xe6dd=['sequelize','INTEGER'];(function(_0x53c2b7,_0x16563d){var _0x3d1806=function(_0x53b51d){while(--_0x53b51d){_0x53c2b7['push'](_0x53c2b7['shift']());}};_0x3d1806(++_0x16563d);}(_0xe6dd,0x11c));var _0xde6d=function(_0x2af462,_0xba428e){_0x2af462=_0x2af462-0x0;var _0x37cb1e=_0xe6dd[_0x2af462];return _0x37cb1e;};'use strict';var Sequelize=require(_0xde6d('0x0'));module['exports']={'MailInteractionId':{'type':Sequelize[_0xde6d('0x1')],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file +var _0x57bf=['exports','INTEGER','sequelize'];(function(_0x2c7018,_0xae875e){var _0x3a29c8=function(_0x502f9c){while(--_0x502f9c){_0x2c7018['push'](_0x2c7018['shift']());}};_0x3a29c8(++_0xae875e);}(_0x57bf,0x1e8));var _0xf57b=function(_0x24104f,_0x2fbb92){_0x24104f=_0x24104f-0x0;var _0x524d2b=_0x57bf[_0x24104f];return _0x524d2b;};'use strict';var Sequelize=require(_0xf57b('0x0'));module[_0xf57b('0x1')]={'MailInteractionId':{'type':Sequelize[_0xf57b('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xf57b('0x2')],'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 86af3bc..28337e4 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 _0x04eb=['exports','MailInteractionHasTag','./mailInteractionHasTag'];(function(_0x29e0eb,_0x9acb52){var _0x597d2d=function(_0x596ef9){while(--_0x596ef9){_0x29e0eb['push'](_0x29e0eb['shift']());}};_0x597d2d(++_0x9acb52);}(_0x04eb,0x18b));var _0xb04e=function(_0xac3c81,_0x14317f){_0xac3c81=_0xac3c81-0x0;var _0x424433=_0x04eb[_0xac3c81];return _0x424433;};'use strict';var attributes=require(_0xb04e('0x0'));module[_0xb04e('0x1')]=function(_0x171ccb){return _0x171ccb['define'](_0xb04e('0x2'),attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x658d=['./mailInteractionHasTag','exports','define','MailInteractionHasTag','mail_interaction_has_tags'];(function(_0x43e2e4,_0x4ad3b4){var _0x1b71d0=function(_0x45812a){while(--_0x45812a){_0x43e2e4['push'](_0x43e2e4['shift']());}};_0x1b71d0(++_0x4ad3b4);}(_0x658d,0x7d));var _0xd658=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x658d[_0x231e16];return _0x570a7c;};'use strict';var attributes=require(_0xd658('0x0'));module[_0xd658('0x1')]=function(_0x3a8615){return _0x3a8615[_0xd658('0x2')](_0xd658('0x3'),attributes,{'tableName':_0xd658('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f5b3b38..88b57fc 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 _0x195e=['create','put','update','/:id/accept','accept','reject','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id/download','download','tracked','mail'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x195e,0xfb));var _0xe195=function(_0x71b795,_0x46affc){_0x71b795=_0x71b795-0x0;var _0xb409a3=_0x195e[_0x71b795];return _0xb409a3;};'use strict';var multer=require(_0xe195('0x0'));var util=require(_0xe195('0x1'));var path=require(_0xe195('0x2'));var timeout=require(_0xe195('0x3'));var express=require(_0xe195('0x4'));var router=express[_0xe195('0x5')]();var fs_extra=require(_0xe195('0x6'));var auth=require(_0xe195('0x7'));var interaction=require(_0xe195('0x8'));var config=require(_0xe195('0x9'));var controller=require(_0xe195('0xa'));router[_0xe195('0xb')]('/',auth[_0xe195('0xc')](),controller['index']);router[_0xe195('0xb')](_0xe195('0xd'),auth[_0xe195('0xc')](),controller[_0xe195('0xe')]);router[_0xe195('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xe195('0xb')](_0xe195('0xf'),auth[_0xe195('0xc')](),controller[_0xe195('0x10')]);router['post']('/',auth[_0xe195('0xc')](),interaction[_0xe195('0x11')](_0xe195('0x12'),'mailmessage:create'),controller[_0xe195('0x13')]);router[_0xe195('0x14')]('/:id',auth[_0xe195('0xc')](),controller[_0xe195('0x15')]);router[_0xe195('0x14')](_0xe195('0x16'),auth['isAuthenticated'](),controller[_0xe195('0x17')]);router[_0xe195('0x14')]('/:id/reject',auth['isAuthenticated'](),controller[_0xe195('0x18')]);router['delete'](_0xe195('0x19'),auth['isAuthenticated'](),controller['destroy']);module[_0xe195('0x1a')]=router; \ No newline at end of file +var _0x5a68=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','describe','/:id','show','/:id/download','post','mailmessage:create','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout'];(function(_0x36d203,_0x3653f3){var _0x2f9e62=function(_0x461a77){while(--_0x461a77){_0x36d203['push'](_0x36d203['shift']());}};_0x2f9e62(++_0x3653f3);}(_0x5a68,0x1ae));var _0x85a6=function(_0x8589d2,_0x189461){_0x8589d2=_0x8589d2-0x0;var _0x4f2d62=_0x5a68[_0x8589d2];return _0x4f2d62;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85a6('0x0'));var timeout=require(_0x85a6('0x1'));var express=require(_0x85a6('0x2'));var router=express[_0x85a6('0x3')]();var fs_extra=require(_0x85a6('0x4'));var auth=require(_0x85a6('0x5'));var interaction=require(_0x85a6('0x6'));var config=require(_0x85a6('0x7'));var controller=require(_0x85a6('0x8'));router['get']('/',auth[_0x85a6('0x9')](),controller[_0x85a6('0xa')]);router[_0x85a6('0xb')]('/describe',auth[_0x85a6('0x9')](),controller[_0x85a6('0xc')]);router[_0x85a6('0xb')](_0x85a6('0xd'),auth[_0x85a6('0x9')](),controller[_0x85a6('0xe')]);router[_0x85a6('0xb')](_0x85a6('0xf'),auth[_0x85a6('0x9')](),controller['download']);router[_0x85a6('0x10')]('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0x85a6('0x11')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x85a6('0x12')]);router[_0x85a6('0x13')](_0x85a6('0x14'),auth['isAuthenticated'](),controller[_0x85a6('0x15')]);router[_0x85a6('0x13')](_0x85a6('0x16'),auth[_0x85a6('0x9')](),controller[_0x85a6('0x17')]);router[_0x85a6('0x18')](_0x85a6('0xd'),auth[_0x85a6('0x9')](),controller[_0x85a6('0x19')]);module[_0x85a6('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7801ea0..fad6d3d 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 _0x4996=['BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x20dadd,_0x364e56){var _0x24a247=function(_0x5a48c2){while(--_0x5a48c2){_0x20dadd['push'](_0x20dadd['shift']());}};_0x24a247(++_0x364e56);}(_0x4996,0x173));var _0x6499=function(_0xacabb,_0x1fbcd9){_0xacabb=_0xacabb-0x0;var _0x2b4a14=_0x4996[_0xacabb];return _0x2b4a14;};'use strict';var Sequelize=require(_0x6499('0x0'));var _=require(_0x6499('0x1'));module[_0x6499('0x2')]={'body':{'type':Sequelize[_0x6499('0x3')](_0x6499('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6499('0x3')](_0x6499('0x5'))},'read':{'type':Sequelize[_0x6499('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6499('0x7')]('in','out'),'defaultValue':_0x6499('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6499('0x9')](0x1fe)},'from':{'type':Sequelize[_0x6499('0x9')]},'to':{'type':Sequelize[_0x6499('0x3')]('long')},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize['TEXT'](_0x6499('0x4'))},'subject':{'type':Sequelize[_0x6499('0x3')]},'sentAt':{'type':Sequelize[_0x6499('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6499('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6499('0xa')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x6499('0x3')](_0x6499('0x4'))},'originChannel':{'type':Sequelize[_0x6499('0x7')](_0x6499('0xb'),_0x6499('0xc')),'defaultValue':_0x6499('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x163e=['ENUM','Email','Chat','sequelize','lodash','exports','TEXT','long','medium','out','STRING','DATE','INTEGER','BOOLEAN'];(function(_0xf56b46,_0x4e32e8){var _0x583cea=function(_0x4ce708){while(--_0x4ce708){_0xf56b46['push'](_0xf56b46['shift']());}};_0x583cea(++_0x4e32e8);}(_0x163e,0x9d));var _0xe163=function(_0xd2a568,_0x4e8606){_0xd2a568=_0xd2a568-0x0;var _0x4cf0ba=_0x163e[_0xd2a568];return _0x4cf0ba;};'use strict';var Sequelize=require(_0xe163('0x0'));var _=require(_0xe163('0x1'));module[_0xe163('0x2')]={'body':{'type':Sequelize[_0xe163('0x3')](_0xe163('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe163('0x3')](_0xe163('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xe163('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xe163('0x7')]},'to':{'type':Sequelize[_0xe163('0x3')]('long')},'cc':{'type':Sequelize[_0xe163('0x3')](_0xe163('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0xe163('0x3')]},'sentAt':{'type':Sequelize[_0xe163('0x8')]},'attach':{'type':Sequelize[_0xe163('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe163('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe163('0x8')]},'originTo':{'type':Sequelize[_0xe163('0x3')](_0xe163('0x4'))},'originCc':{'type':Sequelize[_0xe163('0x3')](_0xe163('0x4'))},'originChannel':{'type':Sequelize[_0xe163('0xb')](_0xe163('0xc'),_0xe163('0xd')),'defaultValue':_0xe163('0xc'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index dd553d1..1f97603 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 _0x6e0d=['getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','Contacts','ListId','List\x20not\x20found','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','format','UserId','user','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','rejectMessage','ContactId','Sequelize','QueryTypes','motionChannel','rejectmessage','download','files','tmp','server','message-%s.eml','subject','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','api','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','undefined','limit','count','offset','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','where','filter','merge','options','MailMessage','include','findAll','rows','catch','keys','length','body','find','params','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','CmContact','updatedAt','DESC','CloudProvider','Smtp'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6e0d,0x188));var _0xd6e0=function(_0x3fea3b,_0x3bcebe){_0x3fea3b=_0x3fea3b-0x0;var _0x18b180=_0x6e0d[_0x3fea3b];return _0x18b180;};'use strict';var emlformat=require(_0xd6e0('0x0'));var moment=require(_0xd6e0('0x1'));var BPromise=require(_0xd6e0('0x2'));var util=require(_0xd6e0('0x3'));var path=require(_0xd6e0('0x4'));var fs=require('fs');var _=require(_0xd6e0('0x5'));var Redis=require(_0xd6e0('0x6'));var htmlToText=require(_0xd6e0('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xd6e0('0x8'));var interaction_log=require(_0xd6e0('0x9'))('mail-interactions');var config=require(_0xd6e0('0xa'));var db=require(_0xd6e0('0xb'))['db'];config['redis']=_[_0xd6e0('0xc')](config[_0xd6e0('0xd')],{'host':_0xd6e0('0xe'),'port':0x18eb});var socket=require(_0xd6e0('0xf'))(new Redis(config[_0xd6e0('0xd')]));var htmlEntities=require(_0xd6e0('0x10'));require(_0xd6e0('0x11'))['register'](socket);var jayson=require(_0xd6e0('0x12'));var client=jayson['client'][_0xd6e0('0x13')]({'port':0x232c});var client9003=jayson[_0xd6e0('0x14')][_0xd6e0('0x13')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f7712,_0x226ec2,_0x5f17b,_0x1c3b8a){return new BPromise(function(_0x392d6d,_0x3bc69e){var _0x26d24d=_0x1c3b8a||client;return _0x26d24d[_0xd6e0('0x15')](_0x1f7712,_0x5f17b)[_0xd6e0('0x16')](function(_0x3df0b2){logger[_0xd6e0('0x17')](_0xd6e0('0x18'),_0x226ec2,_0xd6e0('0x19'));logger[_0xd6e0('0x1a')](_0xd6e0('0x1b'),_0x226ec2,_0xd6e0('0x19'),JSON[_0xd6e0('0x1c')](_0x3df0b2));if(_0x3df0b2[_0xd6e0('0x1d')]){if(_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1e')]===0x1f4){logger[_0xd6e0('0x1d')]('MailMessage,\x20%s,\x20%s',_0x226ec2,_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1f')]);return _0x3bc69e(_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1f')]);}logger[_0xd6e0('0x1d')]('MailMessage,\x20%s,\x20%s',_0x226ec2,_0x3df0b2['error'][_0xd6e0('0x1f')]);return _0x392d6d(_0x3df0b2[_0xd6e0('0x1d')][_0xd6e0('0x1f')]);}else{logger[_0xd6e0('0x17')](_0xd6e0('0x18'),_0x226ec2,_0xd6e0('0x19'));_0x392d6d(_0x3df0b2[_0xd6e0('0x20')][_0xd6e0('0x1f')]);}})['catch'](function(_0x4a2c3d){logger[_0xd6e0('0x1d')](_0xd6e0('0x18'),_0x226ec2,_0x4a2c3d);_0x3bc69e(_0x4a2c3d);});});}function respondWithResult(_0x1229f2,_0x39df99){_0x39df99=_0x39df99||0xc8;return function(_0x243361){if(_0x243361){return _0x1229f2[_0xd6e0('0x21')](_0x39df99)['json'](_0x243361);}};}function respondWithFilteredResult(_0x5c3134,_0x4c3dfd){return function(_0x47f2c2){if(_0x47f2c2){var _0x35f4de=typeof _0x4c3dfd['offset']===_0xd6e0('0x22')&&typeof _0x4c3dfd[_0xd6e0('0x23')]===_0xd6e0('0x22');var _0x2c05d5=_0x47f2c2[_0xd6e0('0x24')];var _0xf97552=_0x35f4de?0x0:_0x4c3dfd[_0xd6e0('0x25')];var _0x14fd73=_0x35f4de?_0x47f2c2[_0xd6e0('0x24')]:_0x4c3dfd[_0xd6e0('0x25')]+_0x4c3dfd[_0xd6e0('0x23')];var _0x29b2c4;if(_0x14fd73>=_0x2c05d5){_0x14fd73=_0x2c05d5;_0x29b2c4=0xc8;}else{_0x29b2c4=0xce;}_0x5c3134[_0xd6e0('0x21')](_0x29b2c4);return _0x5c3134['set'](_0xd6e0('0x26'),_0xf97552+'-'+_0x14fd73+'/'+_0x2c05d5)[_0xd6e0('0x27')](_0x47f2c2);}return null;};}function saveUpdates(_0x203286){return function(_0x5c413f){if(_0x5c413f){return _0x5c413f[_0xd6e0('0x28')](_0x203286)[_0xd6e0('0x16')](function(_0x4a610a){return _0x4a610a;});}return null;};}function removeEntity(_0xd6cc7b){return function(_0x250590){if(_0x250590){return _0x250590[_0xd6e0('0x29')]()[_0xd6e0('0x16')](function(){_0xd6cc7b[_0xd6e0('0x21')](0xcc)[_0xd6e0('0x2a')]();});}};}function handleEntityNotFound(_0x1e49a3){return function(_0x3d3757){if(!_0x3d3757){_0x1e49a3[_0xd6e0('0x2b')](0x194);}return _0x3d3757;};}function handleError(_0x3a89f5,_0x353ee6){_0x353ee6=_0x353ee6||0x1f4;return function(_0x442c03){logger[_0xd6e0('0x1d')](_0x442c03[_0xd6e0('0x2c')]);if(_0x442c03[_0xd6e0('0x2d')]){delete _0x442c03[_0xd6e0('0x2d')];}_0x3a89f5[_0xd6e0('0x21')](_0x353ee6)[_0xd6e0('0x2e')](_0x442c03);};}exports[_0xd6e0('0x2f')]=function(_0x11fad2,_0x3b09f2){var _0x59c443={},_0xd4f0a5={},_0x17cc2a={'count':0x0,'rows':[]};var _0x5f5a33=_[_0xd6e0('0x30')](db['MailMessage'][_0xd6e0('0x31')],function(_0x5359b4){return{'name':_0x5359b4[_0xd6e0('0x32')],'type':_0x5359b4[_0xd6e0('0x33')][_0xd6e0('0x34')]};});_0xd4f0a5[_0xd6e0('0x35')]=_[_0xd6e0('0x30')](_0x5f5a33,'name');_0xd4f0a5[_0xd6e0('0x36')]=_['keys'](_0x11fad2['query']);_0xd4f0a5['filters']=_[_0xd6e0('0x37')](_0xd4f0a5[_0xd6e0('0x35')],_0xd4f0a5[_0xd6e0('0x36')]);_0x59c443[_0xd6e0('0x38')]=_['intersection'](_0xd4f0a5[_0xd6e0('0x35')],qs[_0xd6e0('0x39')](_0x11fad2[_0xd6e0('0x36')]['fields']));_0x59c443['attributes']=_0x59c443[_0xd6e0('0x38')]['length']?_0x59c443[_0xd6e0('0x38')]:_0xd4f0a5['model'];if(!_0x11fad2[_0xd6e0('0x36')][_0xd6e0('0x3a')](_0xd6e0('0x3b'))){_0x59c443[_0xd6e0('0x23')]=qs['limit'](_0x11fad2['query'][_0xd6e0('0x23')]);_0x59c443[_0xd6e0('0x25')]=qs['offset'](_0x11fad2[_0xd6e0('0x36')][_0xd6e0('0x25')]);}_0x59c443[_0xd6e0('0x3c')]=qs['sort'](_0x11fad2[_0xd6e0('0x36')][_0xd6e0('0x3d')]);_0x59c443['where']=qs[_0xd6e0('0x3e')](_['pick'](_0x11fad2[_0xd6e0('0x36')],_0xd4f0a5[_0xd6e0('0x3e')]),_0x5f5a33);if(_0x11fad2[_0xd6e0('0x36')]['filter']){_0x59c443[_0xd6e0('0x3f')]=_['merge'](_0x59c443[_0xd6e0('0x3f')],{'$or':_['map'](_0x5f5a33,function(_0x2dc84c){if(_0x2dc84c[_0xd6e0('0x33')]!=='VIRTUAL'){var _0x1430b2={};_0x1430b2[_0x2dc84c[_0xd6e0('0x2d')]]={'$like':'%'+_0x11fad2['query'][_0xd6e0('0x40')]+'%'};return _0x1430b2;}})});}_0x59c443=_[_0xd6e0('0x41')]({},_0x59c443,_0x11fad2[_0xd6e0('0x42')]);var _0x30328b={'where':_0x59c443[_0xd6e0('0x3f')]};return db[_0xd6e0('0x43')][_0xd6e0('0x24')](_0x30328b)[_0xd6e0('0x16')](function(_0xfbf61c){_0x17cc2a[_0xd6e0('0x24')]=_0xfbf61c;if(_0x11fad2[_0xd6e0('0x36')]['includeAll']){_0x59c443[_0xd6e0('0x44')]=[{'all':!![]}];}return db['MailMessage'][_0xd6e0('0x45')](_0x59c443);})[_0xd6e0('0x16')](function(_0x2952ef){_0x17cc2a[_0xd6e0('0x46')]=_0x2952ef;return _0x17cc2a;})[_0xd6e0('0x16')](respondWithFilteredResult(_0x3b09f2,_0x59c443))[_0xd6e0('0x47')](handleError(_0x3b09f2,null));};exports['show']=function(_0x38ee5c,_0x5c4121){var _0x32ca37={'raw':!![],'where':{'id':_0x38ee5c['params']['id']}},_0x3760df={};_0x3760df['model']=_[_0xd6e0('0x48')](db[_0xd6e0('0x43')][_0xd6e0('0x31')]);_0x3760df[_0xd6e0('0x36')]=_[_0xd6e0('0x48')](_0x38ee5c[_0xd6e0('0x36')]);_0x3760df[_0xd6e0('0x3e')]=_[_0xd6e0('0x37')](_0x3760df[_0xd6e0('0x35')],_0x3760df[_0xd6e0('0x36')]);_0x32ca37['attributes']=_['intersection'](_0x3760df[_0xd6e0('0x35')],qs[_0xd6e0('0x39')](_0x38ee5c[_0xd6e0('0x36')][_0xd6e0('0x39')]));_0x32ca37[_0xd6e0('0x38')]=_0x32ca37['attributes'][_0xd6e0('0x49')]?_0x32ca37[_0xd6e0('0x38')]:_0x3760df['model'];if(_0x38ee5c[_0xd6e0('0x36')]['includeAll']){_0x32ca37[_0xd6e0('0x44')]=[{'all':!![]}];}_0x32ca37=_[_0xd6e0('0x41')]({},_0x32ca37,_0x38ee5c[_0xd6e0('0x42')]);return db[_0xd6e0('0x43')]['find'](_0x32ca37)[_0xd6e0('0x16')](handleEntityNotFound(_0x5c4121,null))['then'](respondWithResult(_0x5c4121,null))['catch'](handleError(_0x5c4121,null));};exports[_0xd6e0('0x28')]=function(_0xbdc36a,_0x2b8f53){if(_0xbdc36a[_0xd6e0('0x4a')]['id']){delete _0xbdc36a['body']['id'];}return db['MailMessage'][_0xd6e0('0x4b')]({'where':{'id':_0xbdc36a['params']['id']}})[_0xd6e0('0x16')](handleEntityNotFound(_0x2b8f53,null))['then'](saveUpdates(_0xbdc36a['body'],null))[_0xd6e0('0x16')](respondWithResult(_0x2b8f53,null))[_0xd6e0('0x47')](handleError(_0x2b8f53,null));};exports['destroy']=function(_0x297455,_0xcdd69f){return db[_0xd6e0('0x43')][_0xd6e0('0x4b')]({'where':{'id':_0x297455[_0xd6e0('0x4c')]['id']}})[_0xd6e0('0x16')](handleEntityNotFound(_0xcdd69f,null))[_0xd6e0('0x16')](removeEntity(_0xcdd69f,null))['catch'](handleError(_0xcdd69f,null));};exports[_0xd6e0('0x4d')]=function(_0x46d795,_0x113375){return db[_0xd6e0('0x43')][_0xd6e0('0x4d')]()[_0xd6e0('0x16')](respondWithResult(_0x113375,null))[_0xd6e0('0x47')](handleError(_0x113375,null));};exports['create']=function(_0x4a394e,_0x49d61f){return db['MailMessage'][_0xd6e0('0x4e')](_0x4a394e[_0xd6e0('0x4a')])[_0xd6e0('0x16')](function(_0x3a8fa9){if(_0x3a8fa9){if(_0x3a8fa9[_0xd6e0('0x4f')]===_0xd6e0('0x50')&&!_0x3a8fa9[_0xd6e0('0x51')]){var _0x4d1b07,_0x19e366,_0x596343;if(_0x4a394e['body']['to']){_0x19e366=_0x4a394e['body']['to'][_0xd6e0('0x52')](',')[0x0];}return db['MailAccount'][_0xd6e0('0x53')]({'where':{'id':_0x3a8fa9[_0xd6e0('0x54')]},'include':[{'model':db[_0xd6e0('0x55')],'as':'List','include':[{'model':db[_0xd6e0('0x56')],'as':'Contacts','where':{'email':_0x19e366},'limit':0x1,'order':[[_0xd6e0('0x57'),_0xd6e0('0x58')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xd6e0('0x59')],'as':_0xd6e0('0x59'),'raw':!![]}]}]})[_0xd6e0('0x16')](function(_0x339d88){_0x4d1b07=_0x339d88;if(!_0x4d1b07||!_0x4d1b07[_0xd6e0('0x5a')])return;var _0x26451a=_0x4d1b07[_0xd6e0('0x5b')]();if(_0x4a394e['body'][_0xd6e0('0x5c')]&&_0x4a394e[_0xd6e0('0x4a')][_0xd6e0('0x5c')][_0xd6e0('0x49')]){for(var _0x30cbae=0x0;_0x30cbae<_0x4a394e[_0xd6e0('0x4a')]['attachments'][_0xd6e0('0x49')];_0x30cbae+=0x1){_0x4a394e[_0xd6e0('0x4a')][_0xd6e0('0x5c')][_0x30cbae]={'filename':_0x4a394e[_0xd6e0('0x4a')][_0xd6e0('0x5c')][_0x30cbae][_0xd6e0('0x2d')],'path':path[_0xd6e0('0x5d')](config[_0xd6e0('0x5e')],_0xd6e0('0x5f'),_0x4a394e[_0xd6e0('0x4a')]['attachments'][_0x30cbae][_0xd6e0('0x60')])};}}_0x596343={'account':_0x26451a,'message':_0x4a394e[_0xd6e0('0x4a')]};return;})['then'](function(){if(_0x4d1b07[_0xd6e0('0x61')]){if(_0x4d1b07[_0xd6e0('0x61')][_0xd6e0('0x62')]['length']){return _0x4d1b07[_0xd6e0('0x61')][_0xd6e0('0x62')][0x0];}else{return db[_0xd6e0('0x56')][_0xd6e0('0x4e')](_[_0xd6e0('0xc')](_0x4a394e[_0xd6e0('0x4a')],{'firstName':_0x4a394e['body']['to'],'email':_0x4a394e['body']['to'],'phone':_0x4a394e[_0xd6e0('0x4a')]['to'],'ListId':_0x4d1b07[_0xd6e0('0x63')]}));}}else{throw new Error(_0xd6e0('0x64'));}})[_0xd6e0('0x16')](function(){if(_0x596343){return respondWithRpcPromise('SendMail',_0xd6e0('0x65'),_0x596343,client9003)[_0xd6e0('0x16')](function(_0x2f4ea9){return _0x3a8fa9[_0xd6e0('0x28')]({'read':!![],'messageId':_0x2f4ea9[_0xd6e0('0x66')],'sentAt':moment()['format'](_0xd6e0('0x67'))});})[_0xd6e0('0x47')](function(_0x4d513e){logger[_0xd6e0('0x1d')]('%s',JSON[_0xd6e0('0x1c')](_0x4d513e));return _0x3a8fa9;});}return _0x3a8fa9;});}return _0x3a8fa9;}})['then'](respondWithResult(_0x49d61f,0xc9))[_0xd6e0('0x47')](handleError(_0x49d61f,null));};exports[_0xd6e0('0x68')]=function(_0x35c8c0,_0x2e424b){var _0x1c37db={'agent':{},'channel':_0xd6e0('0x69')};if(_0x35c8c0[_0xd6e0('0x4a')]['id']){delete _0x35c8c0[_0xd6e0('0x4a')]['id'];}_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6a')]=!![];_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6b')]=moment()[_0xd6e0('0x6c')](_0xd6e0('0x67'));_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')]=_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')]||_0x35c8c0[_0xd6e0('0x6e')]['id'];_0x1c37db['agent']['id']=_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')];return db[_0xd6e0('0x43')]['find']({'where':{'id':_0x35c8c0[_0xd6e0('0x4c')]['id'],'UserId':null}})[_0xd6e0('0x16')](handleEntityNotFound(_0x2e424b,null))['then'](saveUpdates(_0x35c8c0[_0xd6e0('0x4a')],null))[_0xd6e0('0x16')](function(_0x1db9f6){if(_0x1db9f6){_0x1c37db[_0xd6e0('0x1f')]=_0x1db9f6[_0xd6e0('0x6f')]({'plain':!![]});return db[_0xd6e0('0x70')][_0xd6e0('0x4b')]({'where':{'id':_0x1db9f6[_0xd6e0('0x71')]}});}return null;})['then'](handleEntityNotFound(_0x2e424b,null))[_0xd6e0('0x16')](function(_0x25233b){if(_0x25233b){return _0x25233b['update']({'UserId':_0x35c8c0[_0xd6e0('0x4a')]['UserId'],'read1stAt':_['isNil'](_0x25233b[_0xd6e0('0x72')])?moment()[_0xd6e0('0x6c')](_0xd6e0('0x67')):undefined});}return null;})[_0xd6e0('0x16')](function(_0x2ee9d4){if(_0x2ee9d4){_0x1c37db[_0xd6e0('0x73')]=_0x2ee9d4[_0xd6e0('0x6f')]({'plain':!![]});interaction_log['info'](_0xd6e0('0x74'),_0x35c8c0[_0xd6e0('0x6e')]['id'],_0x35c8c0[_0xd6e0('0x6e')][_0xd6e0('0x2d')],_0x35c8c0['user'][_0xd6e0('0x75')],_0x1c37db[_0xd6e0('0x73')]['id'],_0x35c8c0['body']?JSON[_0xd6e0('0x1c')](_0x35c8c0[_0xd6e0('0x4a')]):_0xd6e0('0x76'));return respondWithRpcPromise('AcceptMessage',_0xd6e0('0x77'),_0x1c37db);}return null;})[_0xd6e0('0x16')](function(_0x1519af){var _0x2bac1a=_0xd6e0('0x78')+_0x1519af[_0xd6e0('0x1f')]['ContactId'];return db['sequelize']['query'](_0x2bac1a,{'type':db['Sequelize']['QueryTypes'][_0xd6e0('0x79')],'raw':!![]})[_0xd6e0('0x16')](function(_0x4e4a48){return _0x4e4a48;});})[_0xd6e0('0x16')](function(_0xe17810){if(_0xe17810){_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x7a')]=_0xe17810[0x0];if(!_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x6d')])return;return db[_0xd6e0('0x7b')][_0xd6e0('0x4b')]({'where':{'id':_0x35c8c0[_0xd6e0('0x4a')]['UserId'],'role':_0xd6e0('0x7c')},'attributes':['id','name',_0xd6e0('0x7d'),_0xd6e0('0x7e'),_0xd6e0('0x7f')],'raw':!![]});}return null;})[_0xd6e0('0x16')](function(_0x1b703d){if(!_0x1b703d)return null;_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x7c')]=_0x1b703d;return _0x1c37db;})[_0xd6e0('0x16')](function(_0x22c0cc){if(_0x22c0cc){if(_0x35c8c0[_0xd6e0('0x4a')][_0xd6e0('0x80')]){_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x81')]=util['format'](_0xd6e0('0x82'),_0x35c8c0[_0xd6e0('0x6e')][_0xd6e0('0x2d')]);_0x1c37db[_0xd6e0('0x1f')]['channel']=_0x1c37db[_0xd6e0('0x83')];_0x1c37db[_0xd6e0('0x1f')]['motionChannel']=_0x1c37db[_0xd6e0('0x83')];_0x1c37db['message'][_0xd6e0('0x84')]=_0xd6e0('0x68');_0x1c37db[_0xd6e0('0x1f')][_0xd6e0('0x4a')]=htmlToText[_0xd6e0('0x85')](_0x1c37db['message'][_0xd6e0('0x4a')]);return respondWithRpcPromise(_0xd6e0('0x86'),'EventManager',{'event':_0xd6e0('0x87'),'message':_0x1c37db[_0xd6e0('0x1f')]},client9002)[_0xd6e0('0x16')](function(){return _0x1c37db;});}return _0x1c37db;}return null;})[_0xd6e0('0x16')](respondWithResult(_0x2e424b,null))['catch'](handleError(_0x2e424b,null));};exports[_0xd6e0('0x88')]=function(_0x1ddd47,_0x35f8fa){var _0x196d0f={'agent':{},'channel':'mail'};if(_0x1ddd47[_0xd6e0('0x4a')]['id']){delete _0x1ddd47[_0xd6e0('0x4a')]['id'];}_0x1ddd47[_0xd6e0('0x4a')]['UserId']=_0x1ddd47['body'][_0xd6e0('0x6d')]||_0x1ddd47[_0xd6e0('0x6e')]['id'];_0x196d0f[_0xd6e0('0x7c')]['id']=_0x1ddd47[_0xd6e0('0x4a')][_0xd6e0('0x6d')];return db[_0xd6e0('0x43')]['find']({'where':{'id':_0x1ddd47[_0xd6e0('0x4c')]['id'],'UserId':null}})[_0xd6e0('0x16')](handleEntityNotFound(_0x35f8fa,null))[_0xd6e0('0x16')](function(_0x5d41c1){if(_0x5d41c1){_0x196d0f[_0xd6e0('0x1f')]=_0x5d41c1['get']({'plain':!![]});return db[_0xd6e0('0x70')][_0xd6e0('0x4b')]({'where':{'id':_0x5d41c1['MailInteractionId']}});}return null;})[_0xd6e0('0x16')](handleEntityNotFound(_0x35f8fa,null))['then'](function(_0x1bf651){if(_0x1bf651){_0x196d0f[_0xd6e0('0x73')]=_0x1bf651[_0xd6e0('0x6f')]({'plain':!![]});interaction_log[_0xd6e0('0x17')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ddd47[_0xd6e0('0x6e')]['id'],_0x1ddd47[_0xd6e0('0x6e')][_0xd6e0('0x2d')],_0x1ddd47[_0xd6e0('0x6e')]['role'],_0x196d0f[_0xd6e0('0x73')]['id'],_0x1ddd47[_0xd6e0('0x4a')]?JSON[_0xd6e0('0x1c')](_0x1ddd47[_0xd6e0('0x4a')]):'null');return respondWithRpcPromise('RejectMessage',_0xd6e0('0x89'),_0x196d0f);}return null;})[_0xd6e0('0x16')](function(_0x12f01e){var _0x18bcac=_0xd6e0('0x78')+_0x12f01e[_0xd6e0('0x1f')][_0xd6e0('0x8a')];return db['sequelize']['query'](_0x18bcac,{'type':db[_0xd6e0('0x8b')][_0xd6e0('0x8c')][_0xd6e0('0x79')],'raw':!![]})[_0xd6e0('0x16')](function(_0x5828d8){return _0x5828d8;});})['then'](function(_0xe185b1){if(_0xe185b1){_0x196d0f[_0xd6e0('0x1f')][_0xd6e0('0x7a')]=_0xe185b1[0x0];if(!_0x1ddd47['body'][_0xd6e0('0x6d')])return;return db['User'][_0xd6e0('0x4b')]({'where':{'id':_0x1ddd47[_0xd6e0('0x4a')][_0xd6e0('0x6d')],'role':_0xd6e0('0x7c')},'attributes':['id',_0xd6e0('0x2d'),_0xd6e0('0x7d'),'email',_0xd6e0('0x7f')],'raw':!![]});}return null;})[_0xd6e0('0x16')](function(_0x46dd3e){if(!_0x46dd3e)return null;_0x196d0f[_0xd6e0('0x1f')]['agent']=_0x46dd3e;return _0x196d0f;})[_0xd6e0('0x16')](function(_0x149d9f){if(_0x149d9f){_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x81')]=util['format'](_0xd6e0('0x82'),_0x1ddd47[_0xd6e0('0x6e')][_0xd6e0('0x2d')]);_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x83')]=_0x196d0f[_0xd6e0('0x83')];_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x8d')]=_0x196d0f[_0xd6e0('0x83')];_0x149d9f['message'][_0xd6e0('0x84')]='reject';_0x149d9f[_0xd6e0('0x1f')][_0xd6e0('0x4a')]=htmlToText['fromString'](_0x196d0f['message']['body']);respondWithRpcPromise(_0xd6e0('0x86'),_0xd6e0('0x86'),{'event':_0xd6e0('0x8e'),'message':_0x149d9f[_0xd6e0('0x1f')]},client9002);return _0x196d0f;}return null;})[_0xd6e0('0x16')](respondWithResult(_0x35f8fa,null))[_0xd6e0('0x47')](handleError(_0x35f8fa,null));};exports[_0xd6e0('0x8f')]=function(_0xcfccbc,_0x33fa58){var _0x3a5dd3=moment()['unix']()['toString']();var _0x275589=path[_0xd6e0('0x5d')](config['root'],'server',_0xd6e0('0x90'),_0xd6e0('0x91'));var _0x3b4e5e=path[_0xd6e0('0x5d')](config[_0xd6e0('0x5e')],_0xd6e0('0x92'),'files',_0xd6e0('0x5c'));var _0x3597a2=util[_0xd6e0('0x6c')](_0xd6e0('0x93'),_0x3a5dd3);return db[_0xd6e0('0x43')]['find']({'where':{'id':_0xcfccbc[_0xd6e0('0x4c')]['id']},'attributes':['id','body','from','to','cc','bcc',_0xd6e0('0x94'),'createdAt'],'include':_0xcfccbc[_0xd6e0('0x36')][_0xd6e0('0x5c')]?[{'model':db[_0xd6e0('0x95')],'as':_0xd6e0('0x96')}]:undefined})[_0xd6e0('0x16')](handleEntityNotFound(_0x33fa58,null))[_0xd6e0('0x16')](function(_0x1bb6cc){if(_0x1bb6cc){var _0x3eaf47=_0x1bb6cc;var _0x1c648e={'from':_0x3eaf47[_0xd6e0('0x97')],'to':_0x3eaf47['to'],'subject':_0x3eaf47['subject'],'html':htmlEntities['decode'](_0x3eaf47[_0xd6e0('0x4a')]),'headers':{'Date':moment(_0x3eaf47['createdAt'])[_0xd6e0('0x6c')](_0xd6e0('0x98'))},'attachments':[]};if(_0x1bb6cc['cc']){_0x1c648e['headers']['Cc']=_0x1bb6cc['cc'];}if(_0x1bb6cc['bcc']){_0x1c648e[_0xd6e0('0x99')][_0xd6e0('0x9a')]=_0x1bb6cc['bcc'];}return new BPromise(function(_0x3736f0,_0x435088){if(_0x1bb6cc[_0xd6e0('0x96')]){for(var _0x48fa24=0x0;_0x48fa24<_0x1bb6cc['Attachments'][_0xd6e0('0x49')];_0x48fa24++){var _0x109959=_0x1bb6cc[_0xd6e0('0x96')][_0x48fa24];var _0x1cd031=path['join'](_0x3b4e5e,_0x109959[_0xd6e0('0x60')]);if(fs[_0xd6e0('0x9b')](_0x1cd031)){_0x1c648e[_0xd6e0('0x5c')][_0xd6e0('0x9c')]({'name':_0x109959[_0xd6e0('0x2d')],'contentType':_0x109959[_0xd6e0('0x33')],'data':fs[_0xd6e0('0x9d')](_0x1cd031)});}}}emlformat[_0xd6e0('0x9e')](_0x1c648e,function(_0x10a834,_0x45a510){if(_0x10a834)return _0x435088(_0x10a834);fs[_0xd6e0('0x9f')](path['join'](_0x275589,_0x3597a2),_0x45a510);return _0x3736f0(_0x45a510);});});}})[_0xd6e0('0x16')](function(_0x5955c9){if(_0x5955c9){return _0x33fa58['download'](path[_0xd6e0('0x5d')](_0x275589,_0x3597a2),_0x3597a2,function(_0x6526da){if(!_0x6526da)fs[_0xd6e0('0xa0')](path[_0xd6e0('0x5d')](_0x275589,_0x3597a2));});}})[_0xd6e0('0x47')](handleError(_0x33fa58,null));}; \ No newline at end of file +var _0xa922=['name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','find','body','destroy','describe','create','direction','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','get','MailInteraction','MailInteractionId','interaction','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','channel','event','fromString','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','download','moment','bluebird','util','path','lodash','ioredis','api','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','then','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','json','offset','undefined','limit','count','update','end','stack'];(function(_0x338a2b,_0x498662){var _0xebfc3b=function(_0x535de0){while(--_0x535de0){_0x338a2b['push'](_0x338a2b['shift']());}};_0xebfc3b(++_0x498662);}(_0xa922,0x1a6));var _0x2a92=function(_0x32124e,_0x491dc3){_0x32124e=_0x32124e-0x0;var _0x9ea410=_0xa922[_0x32124e];return _0x9ea410;};'use strict';var emlformat=require('eml-format');var moment=require(_0x2a92('0x0'));var BPromise=require(_0x2a92('0x1'));var util=require(_0x2a92('0x2'));var path=require(_0x2a92('0x3'));var fs=require('fs');var _=require(_0x2a92('0x4'));var Redis=require(_0x2a92('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x2a92('0x6'));var interaction_log=require(_0x2a92('0x7'))('mail-interactions');var config=require(_0x2a92('0x8'));var db=require(_0x2a92('0x9'))['db'];config[_0x2a92('0xa')]=_[_0x2a92('0xb')](config[_0x2a92('0xa')],{'host':_0x2a92('0xc'),'port':0x18eb});var socket=require(_0x2a92('0xd'))(new Redis(config[_0x2a92('0xa')]));var htmlEntities=require(_0x2a92('0xe'));require(_0x2a92('0xf'))['register'](socket);var jayson=require(_0x2a92('0x10'));var client=jayson[_0x2a92('0x11')]['http']({'port':0x232c});var client9003=jayson[_0x2a92('0x11')]['http']({'port':0x232b});var client9002=jayson[_0x2a92('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x836f8d,_0x23fb9f,_0x56f145,_0x310a5b){return new BPromise(function(_0x3bb527,_0x40a68f){var _0x1791f3=_0x310a5b||client;return _0x1791f3['request'](_0x836f8d,_0x56f145)[_0x2a92('0x12')](function(_0x567566){logger[_0x2a92('0x13')](_0x2a92('0x14'),_0x23fb9f,'request\x20sent');logger[_0x2a92('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x23fb9f,_0x2a92('0x16'),JSON['stringify'](_0x567566));if(_0x567566[_0x2a92('0x17')]){if(_0x567566[_0x2a92('0x17')][_0x2a92('0x18')]===0x1f4){logger[_0x2a92('0x17')](_0x2a92('0x14'),_0x23fb9f,_0x567566[_0x2a92('0x17')][_0x2a92('0x19')]);return _0x40a68f(_0x567566[_0x2a92('0x17')][_0x2a92('0x19')]);}logger[_0x2a92('0x17')](_0x2a92('0x14'),_0x23fb9f,_0x567566[_0x2a92('0x17')][_0x2a92('0x19')]);return _0x3bb527(_0x567566[_0x2a92('0x17')][_0x2a92('0x19')]);}else{logger[_0x2a92('0x13')](_0x2a92('0x14'),_0x23fb9f,'request\x20sent');_0x3bb527(_0x567566[_0x2a92('0x1a')]['message']);}})[_0x2a92('0x1b')](function(_0x66aacd){logger[_0x2a92('0x17')]('MailMessage,\x20%s,\x20%s',_0x23fb9f,_0x66aacd);_0x40a68f(_0x66aacd);});});}function respondWithResult(_0x3b5820,_0x546fc1){_0x546fc1=_0x546fc1||0xc8;return function(_0x2b7602){if(_0x2b7602){return _0x3b5820[_0x2a92('0x1c')](_0x546fc1)[_0x2a92('0x1d')](_0x2b7602);}};}function respondWithFilteredResult(_0x1c5444,_0xb6d358){return function(_0x2439e8){if(_0x2439e8){var _0x4ab4a4=typeof _0xb6d358[_0x2a92('0x1e')]===_0x2a92('0x1f')&&typeof _0xb6d358[_0x2a92('0x20')]===_0x2a92('0x1f');var _0x52f3e1=_0x2439e8[_0x2a92('0x21')];var _0x4cead5=_0x4ab4a4?0x0:_0xb6d358['offset'];var _0x46a566=_0x4ab4a4?_0x2439e8[_0x2a92('0x21')]:_0xb6d358[_0x2a92('0x1e')]+_0xb6d358[_0x2a92('0x20')];var _0x21118c;if(_0x46a566>=_0x52f3e1){_0x46a566=_0x52f3e1;_0x21118c=0xc8;}else{_0x21118c=0xce;}_0x1c5444[_0x2a92('0x1c')](_0x21118c);return _0x1c5444['set']('Content-Range',_0x4cead5+'-'+_0x46a566+'/'+_0x52f3e1)[_0x2a92('0x1d')](_0x2439e8);}return null;};}function saveUpdates(_0xa8f572){return function(_0x57c5d0){if(_0x57c5d0){return _0x57c5d0[_0x2a92('0x22')](_0xa8f572)['then'](function(_0x368c08){return _0x368c08;});}return null;};}function removeEntity(_0x3dcb35){return function(_0x3004b4){if(_0x3004b4){return _0x3004b4['destroy']()['then'](function(){_0x3dcb35[_0x2a92('0x1c')](0xcc)[_0x2a92('0x23')]();});}};}function handleEntityNotFound(_0x1f56fa){return function(_0x2734a0){if(!_0x2734a0){_0x1f56fa['sendStatus'](0x194);}return _0x2734a0;};}function handleError(_0x5d9917,_0x192da8){_0x192da8=_0x192da8||0x1f4;return function(_0x89b9a2){logger[_0x2a92('0x17')](_0x89b9a2[_0x2a92('0x24')]);if(_0x89b9a2['name']){delete _0x89b9a2[_0x2a92('0x25')];}_0x5d9917[_0x2a92('0x1c')](_0x192da8)[_0x2a92('0x26')](_0x89b9a2);};}exports[_0x2a92('0x27')]=function(_0x135fbf,_0x150318){var _0x1d3e1c={},_0xef40f4={},_0x68f3f8={'count':0x0,'rows':[]};var _0x4a5494=_[_0x2a92('0x28')](db[_0x2a92('0x29')][_0x2a92('0x2a')],function(_0x1ee8a3){return{'name':_0x1ee8a3[_0x2a92('0x2b')],'type':_0x1ee8a3[_0x2a92('0x2c')][_0x2a92('0x2d')]};});_0xef40f4[_0x2a92('0x2e')]=_[_0x2a92('0x28')](_0x4a5494,_0x2a92('0x25'));_0xef40f4[_0x2a92('0x2f')]=_[_0x2a92('0x30')](_0x135fbf[_0x2a92('0x2f')]);_0xef40f4[_0x2a92('0x31')]=_[_0x2a92('0x32')](_0xef40f4[_0x2a92('0x2e')],_0xef40f4['query']);_0x1d3e1c[_0x2a92('0x33')]=_['intersection'](_0xef40f4[_0x2a92('0x2e')],qs[_0x2a92('0x34')](_0x135fbf[_0x2a92('0x2f')]['fields']));_0x1d3e1c[_0x2a92('0x33')]=_0x1d3e1c[_0x2a92('0x33')][_0x2a92('0x35')]?_0x1d3e1c[_0x2a92('0x33')]:_0xef40f4[_0x2a92('0x2e')];if(!_0x135fbf[_0x2a92('0x2f')][_0x2a92('0x36')]('nolimit')){_0x1d3e1c[_0x2a92('0x20')]=qs[_0x2a92('0x20')](_0x135fbf[_0x2a92('0x2f')][_0x2a92('0x20')]);_0x1d3e1c[_0x2a92('0x1e')]=qs[_0x2a92('0x1e')](_0x135fbf[_0x2a92('0x2f')][_0x2a92('0x1e')]);}_0x1d3e1c[_0x2a92('0x37')]=qs[_0x2a92('0x38')](_0x135fbf[_0x2a92('0x2f')][_0x2a92('0x38')]);_0x1d3e1c[_0x2a92('0x39')]=qs[_0x2a92('0x31')](_[_0x2a92('0x3a')](_0x135fbf[_0x2a92('0x2f')],_0xef40f4[_0x2a92('0x31')]),_0x4a5494);if(_0x135fbf['query']['filter']){_0x1d3e1c[_0x2a92('0x39')]=_['merge'](_0x1d3e1c['where'],{'$or':_[_0x2a92('0x28')](_0x4a5494,function(_0x42beec){if(_0x42beec['type']!==_0x2a92('0x3b')){var _0x49051d={};_0x49051d[_0x42beec[_0x2a92('0x25')]]={'$like':'%'+_0x135fbf[_0x2a92('0x2f')][_0x2a92('0x3c')]+'%'};return _0x49051d;}})});}_0x1d3e1c=_[_0x2a92('0x3d')]({},_0x1d3e1c,_0x135fbf[_0x2a92('0x3e')]);var _0x2d7dda={'where':_0x1d3e1c[_0x2a92('0x39')]};return db['MailMessage'][_0x2a92('0x21')](_0x2d7dda)[_0x2a92('0x12')](function(_0x46564d){_0x68f3f8[_0x2a92('0x21')]=_0x46564d;if(_0x135fbf['query'][_0x2a92('0x3f')]){_0x1d3e1c[_0x2a92('0x40')]=[{'all':!![]}];}return db[_0x2a92('0x29')][_0x2a92('0x41')](_0x1d3e1c);})[_0x2a92('0x12')](function(_0x54f0fd){_0x68f3f8['rows']=_0x54f0fd;return _0x68f3f8;})['then'](respondWithFilteredResult(_0x150318,_0x1d3e1c))[_0x2a92('0x1b')](handleError(_0x150318,null));};exports[_0x2a92('0x42')]=function(_0x1ff996,_0x16a852){var _0x5aee53={'raw':!![],'where':{'id':_0x1ff996[_0x2a92('0x43')]['id']}},_0x2d1b4b={};_0x2d1b4b[_0x2a92('0x2e')]=_['keys'](db[_0x2a92('0x29')][_0x2a92('0x2a')]);_0x2d1b4b[_0x2a92('0x2f')]=_[_0x2a92('0x30')](_0x1ff996[_0x2a92('0x2f')]);_0x2d1b4b[_0x2a92('0x31')]=_['intersection'](_0x2d1b4b[_0x2a92('0x2e')],_0x2d1b4b[_0x2a92('0x2f')]);_0x5aee53['attributes']=_[_0x2a92('0x32')](_0x2d1b4b[_0x2a92('0x2e')],qs[_0x2a92('0x34')](_0x1ff996[_0x2a92('0x2f')]['fields']));_0x5aee53[_0x2a92('0x33')]=_0x5aee53[_0x2a92('0x33')][_0x2a92('0x35')]?_0x5aee53['attributes']:_0x2d1b4b['model'];if(_0x1ff996[_0x2a92('0x2f')]['includeAll']){_0x5aee53[_0x2a92('0x40')]=[{'all':!![]}];}_0x5aee53=_[_0x2a92('0x3d')]({},_0x5aee53,_0x1ff996[_0x2a92('0x3e')]);return db['MailMessage'][_0x2a92('0x44')](_0x5aee53)[_0x2a92('0x12')](handleEntityNotFound(_0x16a852,null))[_0x2a92('0x12')](respondWithResult(_0x16a852,null))[_0x2a92('0x1b')](handleError(_0x16a852,null));};exports[_0x2a92('0x22')]=function(_0x593812,_0x342ef3){if(_0x593812[_0x2a92('0x45')]['id']){delete _0x593812[_0x2a92('0x45')]['id'];}return db[_0x2a92('0x29')]['find']({'where':{'id':_0x593812[_0x2a92('0x43')]['id']}})[_0x2a92('0x12')](handleEntityNotFound(_0x342ef3,null))[_0x2a92('0x12')](saveUpdates(_0x593812[_0x2a92('0x45')],null))['then'](respondWithResult(_0x342ef3,null))[_0x2a92('0x1b')](handleError(_0x342ef3,null));};exports[_0x2a92('0x46')]=function(_0x525086,_0x5bf4f2){return db[_0x2a92('0x29')][_0x2a92('0x44')]({'where':{'id':_0x525086[_0x2a92('0x43')]['id']}})[_0x2a92('0x12')](handleEntityNotFound(_0x5bf4f2,null))[_0x2a92('0x12')](removeEntity(_0x5bf4f2,null))[_0x2a92('0x1b')](handleError(_0x5bf4f2,null));};exports[_0x2a92('0x47')]=function(_0x5a17e2,_0x12fe6e){return db['MailMessage'][_0x2a92('0x47')]()['then'](respondWithResult(_0x12fe6e,null))[_0x2a92('0x1b')](handleError(_0x12fe6e,null));};exports[_0x2a92('0x48')]=function(_0x39df77,_0x11fd2c){return db[_0x2a92('0x29')][_0x2a92('0x48')](_0x39df77['body'])[_0x2a92('0x12')](function(_0x720920){if(_0x720920){if(_0x720920[_0x2a92('0x49')]==='out'&&!_0x720920[_0x2a92('0x4a')]){var _0x12ade4,_0xefcc78,_0x2dcaa9;if(_0x39df77[_0x2a92('0x45')]['to']){_0xefcc78=_0x39df77[_0x2a92('0x45')]['to'][_0x2a92('0x4b')](',')[0x0];}return db[_0x2a92('0x4c')]['findOne']({'where':{'id':_0x720920[_0x2a92('0x4d')]},'include':[{'model':db[_0x2a92('0x4e')],'as':_0x2a92('0x4f'),'include':[{'model':db[_0x2a92('0x50')],'as':_0x2a92('0x51'),'where':{'email':_0xefcc78},'limit':0x1,'order':[[_0x2a92('0x52'),_0x2a92('0x53')]]}]},{'model':db[_0x2a92('0x54')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2a92('0x55')],'as':'CloudProvider','raw':!![]}]}]})[_0x2a92('0x12')](function(_0x4c34ec){_0x12ade4=_0x4c34ec;if(!_0x12ade4||!_0x12ade4[_0x2a92('0x56')])return;var _0x1ffa04=_0x12ade4[_0x2a92('0x57')]();if(_0x39df77[_0x2a92('0x45')][_0x2a92('0x58')]&&_0x39df77[_0x2a92('0x45')]['attachments'][_0x2a92('0x35')]){for(var _0x3ff2ae=0x0;_0x3ff2ae<_0x39df77[_0x2a92('0x45')][_0x2a92('0x58')][_0x2a92('0x35')];_0x3ff2ae+=0x1){_0x39df77[_0x2a92('0x45')][_0x2a92('0x58')][_0x3ff2ae]={'filename':_0x39df77[_0x2a92('0x45')][_0x2a92('0x58')][_0x3ff2ae][_0x2a92('0x25')],'path':path[_0x2a92('0x59')](config[_0x2a92('0x5a')],'server/files/attachments',_0x39df77['body'][_0x2a92('0x58')][_0x3ff2ae]['basename'])};}}_0x2dcaa9={'account':_0x1ffa04,'message':_0x39df77[_0x2a92('0x45')]};return;})[_0x2a92('0x12')](function(){if(_0x12ade4[_0x2a92('0x4f')]){if(_0x12ade4[_0x2a92('0x4f')][_0x2a92('0x51')][_0x2a92('0x35')]){return _0x12ade4[_0x2a92('0x4f')]['Contacts'][0x0];}else{return db[_0x2a92('0x50')]['create'](_['defaults'](_0x39df77['body'],{'firstName':_0x39df77[_0x2a92('0x45')]['to'],'email':_0x39df77['body']['to'],'phone':_0x39df77[_0x2a92('0x45')]['to'],'ListId':_0x12ade4[_0x2a92('0x5b')]}));}}else{throw new Error(_0x2a92('0x5c'));}})[_0x2a92('0x12')](function(){if(_0x2dcaa9){return respondWithRpcPromise(_0x2a92('0x5d'),'sendMail',_0x2dcaa9,client9003)['then'](function(_0x11b122){return _0x720920[_0x2a92('0x22')]({'read':!![],'messageId':_0x11b122[_0x2a92('0x5e')],'sentAt':moment()[_0x2a92('0x5f')](_0x2a92('0x60'))});})[_0x2a92('0x1b')](function(_0x3a2200){logger[_0x2a92('0x17')]('%s',JSON['stringify'](_0x3a2200));return _0x720920;});}return _0x720920;});}return _0x720920;}})[_0x2a92('0x12')](respondWithResult(_0x11fd2c,0xc9))[_0x2a92('0x1b')](handleError(_0x11fd2c,null));};exports[_0x2a92('0x61')]=function(_0x2943ab,_0x3e366f){var _0x21b9c6={'agent':{},'channel':_0x2a92('0x62')};if(_0x2943ab[_0x2a92('0x45')]['id']){delete _0x2943ab[_0x2a92('0x45')]['id'];}_0x2943ab[_0x2a92('0x45')][_0x2a92('0x63')]=!![];_0x2943ab[_0x2a92('0x45')][_0x2a92('0x64')]=moment()[_0x2a92('0x5f')](_0x2a92('0x60'));_0x2943ab[_0x2a92('0x45')]['UserId']=_0x2943ab['body'][_0x2a92('0x65')]||_0x2943ab[_0x2a92('0x66')]['id'];_0x21b9c6['agent']['id']=_0x2943ab[_0x2a92('0x45')][_0x2a92('0x65')];return db[_0x2a92('0x29')]['find']({'where':{'id':_0x2943ab[_0x2a92('0x43')]['id'],'UserId':null}})[_0x2a92('0x12')](handleEntityNotFound(_0x3e366f,null))[_0x2a92('0x12')](saveUpdates(_0x2943ab[_0x2a92('0x45')],null))[_0x2a92('0x12')](function(_0xd1f908){if(_0xd1f908){_0x21b9c6['message']=_0xd1f908[_0x2a92('0x67')]({'plain':!![]});return db[_0x2a92('0x68')][_0x2a92('0x44')]({'where':{'id':_0xd1f908[_0x2a92('0x69')]}});}return null;})[_0x2a92('0x12')](handleEntityNotFound(_0x3e366f,null))[_0x2a92('0x12')](function(_0x20c1ba){if(_0x20c1ba){return _0x20c1ba['update']({'UserId':_0x2943ab[_0x2a92('0x45')][_0x2a92('0x65')],'read1stAt':_['isNil'](_0x20c1ba['read1stAt'])?moment()[_0x2a92('0x5f')](_0x2a92('0x60')):undefined});}return null;})[_0x2a92('0x12')](function(_0x1dfa71){if(_0x1dfa71){_0x21b9c6[_0x2a92('0x6a')]=_0x1dfa71[_0x2a92('0x67')]({'plain':!![]});interaction_log[_0x2a92('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2943ab['user']['id'],_0x2943ab[_0x2a92('0x66')][_0x2a92('0x25')],_0x2943ab[_0x2a92('0x66')][_0x2a92('0x6b')],_0x21b9c6[_0x2a92('0x6a')]['id'],_0x2943ab[_0x2a92('0x45')]?JSON[_0x2a92('0x6c')](_0x2943ab['body']):_0x2a92('0x6d'));return respondWithRpcPromise(_0x2a92('0x6e'),_0x2a92('0x6f'),_0x21b9c6);}return null;})[_0x2a92('0x12')](function(_0x3dc823){var _0xe0089e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3dc823['message'][_0x2a92('0x70')];return db[_0x2a92('0x71')]['query'](_0xe0089e,{'type':db[_0x2a92('0x72')][_0x2a92('0x73')][_0x2a92('0x74')],'raw':!![]})[_0x2a92('0x12')](function(_0x1f8f66){return _0x1f8f66;});})['then'](function(_0x22eef7){if(_0x22eef7){_0x21b9c6[_0x2a92('0x19')][_0x2a92('0x75')]=_0x22eef7[0x0];if(!_0x2943ab[_0x2a92('0x45')][_0x2a92('0x65')])return;return db['User'][_0x2a92('0x44')]({'where':{'id':_0x2943ab['body'][_0x2a92('0x65')],'role':_0x2a92('0x76')},'attributes':['id','name',_0x2a92('0x77'),_0x2a92('0x78'),_0x2a92('0x79')],'raw':!![]});}return null;})['then'](function(_0x1c9773){if(!_0x1c9773)return null;_0x21b9c6['message'][_0x2a92('0x76')]=_0x1c9773;return _0x21b9c6;})[_0x2a92('0x12')](function(_0x459979){if(_0x459979){if(_0x2943ab[_0x2a92('0x45')][_0x2a92('0x7a')]){_0x21b9c6['message'][_0x2a92('0x7b')]=util[_0x2a92('0x5f')]('SIP/%s',_0x2943ab[_0x2a92('0x66')][_0x2a92('0x25')]);_0x21b9c6['message'][_0x2a92('0x7c')]=_0x21b9c6[_0x2a92('0x7c')];_0x21b9c6[_0x2a92('0x19')]['motionChannel']=_0x21b9c6[_0x2a92('0x7c')];_0x21b9c6[_0x2a92('0x19')][_0x2a92('0x7d')]=_0x2a92('0x61');_0x21b9c6[_0x2a92('0x19')][_0x2a92('0x45')]=htmlToText[_0x2a92('0x7e')](_0x21b9c6['message'][_0x2a92('0x45')]);return respondWithRpcPromise(_0x2a92('0x7f'),'EventManager',{'event':_0x2a92('0x80'),'message':_0x21b9c6['message']},client9002)[_0x2a92('0x12')](function(){return _0x21b9c6;});}return _0x21b9c6;}return null;})['then'](respondWithResult(_0x3e366f,null))['catch'](handleError(_0x3e366f,null));};exports[_0x2a92('0x81')]=function(_0x5aa8c8,_0x1f8017){var _0x4a76b3={'agent':{},'channel':_0x2a92('0x62')};if(_0x5aa8c8[_0x2a92('0x45')]['id']){delete _0x5aa8c8['body']['id'];}_0x5aa8c8['body'][_0x2a92('0x65')]=_0x5aa8c8['body'][_0x2a92('0x65')]||_0x5aa8c8[_0x2a92('0x66')]['id'];_0x4a76b3['agent']['id']=_0x5aa8c8[_0x2a92('0x45')][_0x2a92('0x65')];return db['MailMessage'][_0x2a92('0x44')]({'where':{'id':_0x5aa8c8['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1f8017,null))['then'](function(_0x5af988){if(_0x5af988){_0x4a76b3['message']=_0x5af988[_0x2a92('0x67')]({'plain':!![]});return db[_0x2a92('0x68')][_0x2a92('0x44')]({'where':{'id':_0x5af988['MailInteractionId']}});}return null;})[_0x2a92('0x12')](handleEntityNotFound(_0x1f8017,null))[_0x2a92('0x12')](function(_0x2820c0){if(_0x2820c0){_0x4a76b3[_0x2a92('0x6a')]=_0x2820c0[_0x2a92('0x67')]({'plain':!![]});interaction_log[_0x2a92('0x13')](_0x2a92('0x82'),_0x5aa8c8[_0x2a92('0x66')]['id'],_0x5aa8c8[_0x2a92('0x66')]['name'],_0x5aa8c8['user'][_0x2a92('0x6b')],_0x4a76b3[_0x2a92('0x6a')]['id'],_0x5aa8c8[_0x2a92('0x45')]?JSON[_0x2a92('0x6c')](_0x5aa8c8[_0x2a92('0x45')]):_0x2a92('0x6d'));return respondWithRpcPromise(_0x2a92('0x83'),_0x2a92('0x84'),_0x4a76b3);}return null;})[_0x2a92('0x12')](function(_0x52f5ab){var _0x94a1a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x52f5ab['message'][_0x2a92('0x70')];return db[_0x2a92('0x71')][_0x2a92('0x2f')](_0x94a1a,{'type':db[_0x2a92('0x72')][_0x2a92('0x73')][_0x2a92('0x74')],'raw':!![]})[_0x2a92('0x12')](function(_0xf3a949){return _0xf3a949;});})[_0x2a92('0x12')](function(_0x51fb1b){if(_0x51fb1b){_0x4a76b3[_0x2a92('0x19')][_0x2a92('0x75')]=_0x51fb1b[0x0];if(!_0x5aa8c8[_0x2a92('0x45')][_0x2a92('0x65')])return;return db['User'][_0x2a92('0x44')]({'where':{'id':_0x5aa8c8[_0x2a92('0x45')][_0x2a92('0x65')],'role':_0x2a92('0x76')},'attributes':['id',_0x2a92('0x25'),'fullname',_0x2a92('0x78'),_0x2a92('0x79')],'raw':!![]});}return null;})[_0x2a92('0x12')](function(_0x1030cd){if(!_0x1030cd)return null;_0x4a76b3[_0x2a92('0x19')][_0x2a92('0x76')]=_0x1030cd;return _0x4a76b3;})['then'](function(_0x28b87a){if(_0x28b87a){_0x28b87a['message'][_0x2a92('0x7b')]=util['format']('SIP/%s',_0x5aa8c8[_0x2a92('0x66')][_0x2a92('0x25')]);_0x28b87a[_0x2a92('0x19')][_0x2a92('0x7c')]=_0x4a76b3[_0x2a92('0x7c')];_0x28b87a[_0x2a92('0x19')][_0x2a92('0x85')]=_0x4a76b3[_0x2a92('0x7c')];_0x28b87a[_0x2a92('0x19')][_0x2a92('0x7d')]=_0x2a92('0x81');_0x28b87a[_0x2a92('0x19')][_0x2a92('0x45')]=htmlToText[_0x2a92('0x7e')](_0x4a76b3[_0x2a92('0x19')][_0x2a92('0x45')]);respondWithRpcPromise(_0x2a92('0x7f'),_0x2a92('0x7f'),{'event':'rejectmessage','message':_0x28b87a[_0x2a92('0x19')]},client9002);return _0x4a76b3;}return null;})[_0x2a92('0x12')](respondWithResult(_0x1f8017,null))[_0x2a92('0x1b')](handleError(_0x1f8017,null));};exports['download']=function(_0x46c6d1,_0x2acbf1){var _0x4f2314=moment()[_0x2a92('0x86')]()[_0x2a92('0x87')]();var _0x148256=path['join'](config[_0x2a92('0x5a')],_0x2a92('0x88'),_0x2a92('0x89'),_0x2a92('0x8a'));var _0x40ec5d=path[_0x2a92('0x59')](config[_0x2a92('0x5a')],'server','files',_0x2a92('0x58'));var _0x3d2da4=util[_0x2a92('0x5f')](_0x2a92('0x8b'),_0x4f2314);return db['MailMessage'][_0x2a92('0x44')]({'where':{'id':_0x46c6d1[_0x2a92('0x43')]['id']},'attributes':['id','body',_0x2a92('0x8c'),'to','cc',_0x2a92('0x8d'),_0x2a92('0x8e'),_0x2a92('0x8f')],'include':_0x46c6d1[_0x2a92('0x2f')]['attachments']?[{'model':db[_0x2a92('0x90')],'as':_0x2a92('0x91')}]:undefined})[_0x2a92('0x12')](handleEntityNotFound(_0x2acbf1,null))['then'](function(_0x4c06d2){if(_0x4c06d2){var _0x4c7b4a=_0x4c06d2;var _0x11133d={'from':_0x4c7b4a[_0x2a92('0x8c')],'to':_0x4c7b4a['to'],'subject':_0x4c7b4a[_0x2a92('0x8e')],'html':htmlEntities[_0x2a92('0x92')](_0x4c7b4a[_0x2a92('0x45')]),'headers':{'Date':moment(_0x4c7b4a[_0x2a92('0x8f')])['format'](_0x2a92('0x93'))},'attachments':[]};if(_0x4c06d2['cc']){_0x11133d[_0x2a92('0x94')]['Cc']=_0x4c06d2['cc'];}if(_0x4c06d2[_0x2a92('0x8d')]){_0x11133d[_0x2a92('0x94')]['Bcc']=_0x4c06d2[_0x2a92('0x8d')];}return new BPromise(function(_0x1b518c,_0x28a481){if(_0x4c06d2[_0x2a92('0x91')]){for(var _0x9d88a8=0x0;_0x9d88a8<_0x4c06d2[_0x2a92('0x91')][_0x2a92('0x35')];_0x9d88a8++){var _0x346641=_0x4c06d2['Attachments'][_0x9d88a8];var _0x19a06c=path[_0x2a92('0x59')](_0x40ec5d,_0x346641['basename']);if(fs[_0x2a92('0x95')](_0x19a06c)){_0x11133d[_0x2a92('0x58')][_0x2a92('0x96')]({'name':_0x346641['name'],'contentType':_0x346641[_0x2a92('0x2c')],'data':fs['readFileSync'](_0x19a06c)});}}}emlformat[_0x2a92('0x97')](_0x11133d,function(_0x2d8977,_0x363771){if(_0x2d8977)return _0x28a481(_0x2d8977);fs['writeFileSync'](path[_0x2a92('0x59')](_0x148256,_0x3d2da4),_0x363771);return _0x1b518c(_0x363771);});});}})['then'](function(_0x5dd4c2){if(_0x5dd4c2){return _0x2acbf1[_0x2a92('0x98')](path[_0x2a92('0x59')](_0x148256,_0x3d2da4),_0x3d2da4,function(_0x55f98f){if(!_0x55f98f)fs['unlinkSync'](path[_0x2a92('0x59')](_0x148256,_0x3d2da4));});}})[_0x2a92('0x1b')](handleError(_0x2acbf1,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index ef7cc8a..394e410 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 _0x1a10=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1a10,0x1e4));var _0x01a1=function(_0x23940b,_0x494433){_0x23940b=_0x23940b-0x0;var _0x3822de=_0x1a10[_0x23940b];return _0x3822de;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x01a1('0x0'))['db'][_0x01a1('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x01a1('0x2')](0x0);var events={'afterCreate':_0x01a1('0x3'),'afterUpdate':_0x01a1('0x4'),'afterDestroy':_0x01a1('0x5')};function emitEvent(_0x17bac9){return function(_0x536165,_0x36318d,_0x4c95ad){MailMessageEvents[_0x01a1('0x6')](_0x17bac9+':'+_0x536165['id'],_0x536165);MailMessageEvents[_0x01a1('0x6')](_0x17bac9,_0x536165);_0x4c95ad(null);};}for(var e in events){if(events[_0x01a1('0x7')](e)){var event=events[e];MailMessage[_0x01a1('0x8')](e,emitEvent(event));}}module[_0x01a1('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x1513=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x2b93a5,_0x31934c){var _0x4111dc=function(_0x3d4f71){while(--_0x3d4f71){_0x2b93a5['push'](_0x2b93a5['shift']());}};_0x4111dc(++_0x31934c);}(_0x1513,0x88));var _0x3151=function(_0xdf1c76,_0x3bf317){_0xdf1c76=_0xdf1c76-0x0;var _0x5779db=_0x1513[_0xdf1c76];return _0x5779db;};'use strict';var EventEmitter=require(_0x3151('0x0'));var MailMessage=require(_0x3151('0x1'))['db'][_0x3151('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3151('0x3')](0x0);var events={'afterCreate':_0x3151('0x4'),'afterUpdate':_0x3151('0x5'),'afterDestroy':_0x3151('0x6')};function emitEvent(_0x27383c){return function(_0x5c3994,_0x5cae17,_0x41aa69){MailMessageEvents[_0x3151('0x7')](_0x27383c+':'+_0x5c3994['id'],_0x5c3994);MailMessageEvents['emit'](_0x27383c,_0x5c3994);_0x41aa69(null);};}for(var e in events){if(events[_0x3151('0x8')](e)){var event=events[e];MailMessage[_0x3151('0x9')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index ca996df..e069261 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 _0xce61=['MailMessage','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','get','direction','toLowerCase','secret','isNil','UserId','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports'];(function(_0x255fa3,_0x5165c1){var _0x184639=function(_0x3af8c1){while(--_0x3af8c1){_0x255fa3['push'](_0x255fa3['shift']());}};_0x184639(++_0x5165c1);}(_0xce61,0x1e4));var _0x1ce6=function(_0x4d9133,_0x1572b5){_0x4d9133=_0x4d9133-0x0;var _0xd96f1c=_0xce61[_0x4d9133];return _0xd96f1c;};'use strict';var _=require(_0x1ce6('0x0'));var util=require('util');var logger=require(_0x1ce6('0x1'))('api');var moment=require(_0x1ce6('0x2'));var BPromise=require(_0x1ce6('0x3'));var rp=require(_0x1ce6('0x4'));var htmlToText=require(_0x1ce6('0x5'));var fs=require('fs');var path=require(_0x1ce6('0x6'));var rimraf=require(_0x1ce6('0x7'));var config=require(_0x1ce6('0x8'));var attributes=require(_0x1ce6('0x9'));module[_0x1ce6('0xa')]=function(_0x302e4a,_0x558d09){return _0x302e4a['define'](_0x1ce6('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x1ce6('0xc'),'fields':['messageId']},{'name':_0x1ce6('0xd'),'fields':['plainBody',_0x1ce6('0xe')],'type':_0x1ce6('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1dbf6b,_0x5e3a5d,_0x416720){if(_0x1dbf6b[_0x1ce6('0x10')]){_0x1dbf6b[_0x1ce6('0x11')]=htmlToText[_0x1ce6('0x12')](_0x1dbf6b['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x416720(null,_0x5e3a5d);},'afterCreate':function(_0x1c978e,_0x2b7ab2,_0x4e9e99){var _0x2f97de=_0x302e4a['models'];var _0x421ee9=_0x1c978e[_0x1ce6('0x13')]({'plain':!![]});if(_0x421ee9[_0x1ce6('0x14')][_0x1ce6('0x15')]()==='in'||_0x421ee9[_0x1ce6('0x14')][_0x1ce6('0x15')]()==='out'&&!_0x421ee9[_0x1ce6('0x16')]&&!_[_0x1ce6('0x17')](_0x421ee9[_0x1ce6('0x18')])){_0x2f97de['MailInteraction']['findOne']({'where':{'id':_0x421ee9[_0x1ce6('0x19')]}})[_0x1ce6('0x1a')](function(_0x41f8fa){if(_0x41f8fa){_0x41f8fa[_0x1ce6('0x1b')]({'lastMsgAt':_0x421ee9[_0x1ce6('0x1c')],'lastMsgDirection':_0x421ee9[_0x1ce6('0x14')][_0x1ce6('0x15')]()});}})[_0x1ce6('0x1d')](function(_0x31dd35){console[_0x1ce6('0x1e')](_0x31dd35);});}_0x4e9e99();}},'charset':_0x1ce6('0x1f'),'collate':_0x1ce6('0x20')});}; \ No newline at end of file +var _0x4824=['MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','isNil','UserId','MailInteraction','findOne','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','html-to-text','path','rimraf','../../config/environment','exports','define'];(function(_0x54a354,_0x34cc60){var _0x5a9b34=function(_0x2d1c24){while(--_0x2d1c24){_0x54a354['push'](_0x54a354['shift']());}};_0x5a9b34(++_0x34cc60);}(_0x4824,0x18d));var _0x4482=function(_0x4a1921,_0x3d1bed){_0x4a1921=_0x4a1921-0x0;var _0x134e34=_0x4824[_0x4a1921];return _0x134e34;};'use strict';var _=require(_0x4482('0x0'));var util=require(_0x4482('0x1'));var logger=require(_0x4482('0x2'))('api');var moment=require(_0x4482('0x3'));var BPromise=require(_0x4482('0x4'));var rp=require('request-promise');var htmlToText=require(_0x4482('0x5'));var fs=require('fs');var path=require(_0x4482('0x6'));var rimraf=require(_0x4482('0x7'));var config=require(_0x4482('0x8'));var attributes=require('./mailMessage.attributes');module[_0x4482('0x9')]=function(_0x1058d9,_0x3dfd41){return _0x1058d9[_0x4482('0xa')](_0x4482('0xb'),attributes,{'tableName':_0x4482('0xc'),'paranoid':![],'indexes':[{'name':_0x4482('0xd'),'fields':[_0x4482('0xd')]},{'name':_0x4482('0xe'),'fields':[_0x4482('0xf'),_0x4482('0x10')],'type':_0x4482('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4cf63f,_0xdc48aa,_0x2a8c93){if(_0x4cf63f[_0x4482('0x12')]){_0x4cf63f['plainBody']=htmlToText[_0x4482('0x13')](_0x4cf63f[_0x4482('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2a8c93(null,_0xdc48aa);},'afterCreate':function(_0x2026f3,_0x226831,_0x34d4d0){var _0x49be73=_0x1058d9[_0x4482('0x14')];var _0x17424a=_0x2026f3[_0x4482('0x15')]({'plain':!![]});if(_0x17424a[_0x4482('0x16')][_0x4482('0x17')]()==='in'||_0x17424a['direction'][_0x4482('0x17')]()===_0x4482('0x18')&&!_0x17424a['secret']&&!_[_0x4482('0x19')](_0x17424a[_0x4482('0x1a')])){_0x49be73[_0x4482('0x1b')][_0x4482('0x1c')]({'where':{'id':_0x17424a['MailInteractionId']}})['then'](function(_0x1c22ac){if(_0x1c22ac){_0x1c22ac[_0x4482('0x1d')]({'lastMsgAt':_0x17424a[_0x4482('0x1e')],'lastMsgDirection':_0x17424a[_0x4482('0x16')][_0x4482('0x17')]()});}})['catch'](function(_0x4fe40e){console[_0x4482('0x1f')](_0x4fe40e);});}_0x34d4d0();}},'charset':_0x4482('0x20'),'collate':_0x4482('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 125bd35..a2289ab 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 _0x0abf=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info'];(function(_0xd6165e,_0x2195e1){var _0x207e4f=function(_0xb5ac83){while(--_0xb5ac83){_0xd6165e['push'](_0xd6165e['shift']());}};_0x207e4f(++_0x2195e1);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./mailMessage.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});}exports[_0xf0ab('0x1a')]=function(_0x715579){var _0xdfcfb2=this;return new Promise(function(_0xf43bc4,_0x22a205){return db[_0xf0ab('0x1b')][_0xf0ab('0x1c')](_0x715579['body'],{'raw':_0x715579[_0xf0ab('0x1d')]?_0x715579[_0xf0ab('0x1d')][_0xf0ab('0x1e')]===undefined?!![]:![]:!![]})[_0xf0ab('0xe')](function(_0x3bf6a1){logger[_0xf0ab('0xf')](_0xf0ab('0x1a'),_0x715579);logger[_0xf0ab('0x12')](_0xf0ab('0x1a'),_0x715579,JSON[_0xf0ab('0x14')](_0x3bf6a1));_0xf43bc4(_0x3bf6a1);})[_0xf0ab('0x19')](function(_0x5645b2){logger['error']('CreateMailMessage',_0x5645b2[_0xf0ab('0x17')],_0x715579);_0x22a205(_0xdfcfb2['error'](0x1f4,_0x5645b2[_0xf0ab('0x17')]));});});}; \ No newline at end of file +var _0x236c=['http','defaults','redis','./mailMessage.socket','then','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateMailMessage','MailMessage','create','body','options','info','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x236c,0x155));var _0xc236=function(_0x27cf8f,_0x230508){_0x27cf8f=_0x27cf8f-0x0;var _0x3c7cd7=_0x236c[_0x27cf8f];return _0x3c7cd7;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});config['redis']=_[_0xc236('0xc')](config[_0xc236('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc236('0xe'))['register'](socket);function respondWithRpcPromise(_0x30a28d,_0x381ed1,_0x18f33b){return new BPromise(function(_0x2f8b72,_0xaf651b){return client['request'](_0x30a28d,_0x18f33b)[_0xc236('0xf')](function(_0x3311f7){logger['info'](_0xc236('0x10'),_0x381ed1,_0xc236('0x11'));logger['debug'](_0xc236('0x12'),_0x381ed1,'request\x20sent',JSON['stringify'](_0x3311f7));if(_0x3311f7[_0xc236('0x13')]){if(_0x3311f7[_0xc236('0x13')][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('MailMessage,\x20%s,\x20%s',_0x381ed1,_0x3311f7[_0xc236('0x13')]['message']);return _0xaf651b(_0x3311f7['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0x10'),_0x381ed1,_0x3311f7[_0xc236('0x13')][_0xc236('0x15')]);return _0x2f8b72(_0x3311f7['error']['message']);}else{logger['info'](_0xc236('0x10'),_0x381ed1,_0xc236('0x11'));_0x2f8b72(_0x3311f7[_0xc236('0x16')]['message']);}})[_0xc236('0x17')](function(_0x506974){logger['error'](_0xc236('0x10'),_0x381ed1,_0x506974);_0xaf651b(_0x506974);});});}exports[_0xc236('0x18')]=function(_0x3a6183){var _0x46bc69=this;return new Promise(function(_0x2b6d3f,_0x27c6ab){return db[_0xc236('0x19')][_0xc236('0x1a')](_0x3a6183[_0xc236('0x1b')],{'raw':_0x3a6183[_0xc236('0x1c')]?_0x3a6183[_0xc236('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xc236('0xf')](function(_0x34d73a){logger[_0xc236('0x1d')](_0xc236('0x18'),_0x3a6183);logger[_0xc236('0x1e')](_0xc236('0x18'),_0x3a6183,JSON[_0xc236('0x1f')](_0x34d73a));_0x2b6d3f(_0x34d73a);})[_0xc236('0x17')](function(_0x1d65e2){logger[_0xc236('0x13')](_0xc236('0x18'),_0x1d65e2['message'],_0x3a6183);_0x27c6ab(_0x46bc69[_0xc236('0x13')](0x1f4,_0x1d65e2[_0xc236('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 43300b6..5d6585d 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 _0x5c85=['update','emit','removeListener','length','./mailMessage.events','save','remove'];(function(_0x28d282,_0x31213c){var _0x191fd7=function(_0x1abe10){while(--_0x1abe10){_0x28d282['push'](_0x28d282['shift']());}};_0x191fd7(++_0x31213c);}(_0x5c85,0xc1));var _0x55c8=function(_0x5e4602,_0x4b2a34){_0x5e4602=_0x5e4602-0x0;var _0x3f5f15=_0x5c85[_0x5e4602];return _0x3f5f15;};'use strict';var MailMessageEvents=require(_0x55c8('0x0'));var events=[_0x55c8('0x1'),_0x55c8('0x2'),_0x55c8('0x3')];function createListener(_0x1b0fa6,_0x15c0f2){return function(_0x255906){_0x15c0f2[_0x55c8('0x4')](_0x1b0fa6,_0x255906);};}function removeListener(_0x5637e2,_0x54ec80){return function(){MailMessageEvents[_0x55c8('0x5')](_0x5637e2,_0x54ec80);};}exports['register']=function(_0x58dec5){for(var _0x3472aa=0x0,_0x15b7b5=events[_0x55c8('0x6')];_0x3472aa<_0x15b7b5;_0x3472aa++){var _0x5a3fbc=events[_0x3472aa];var _0x3805f6=createListener('mailMessage:'+_0x5a3fbc,_0x58dec5);MailMessageEvents['on'](_0x5a3fbc,_0x3805f6);}}; \ No newline at end of file +var _0x1a54=['update','removeListener','register','length','mailMessage:','save'];(function(_0x2f0e43,_0x28ca2c){var _0x179741=function(_0x5e5541){while(--_0x5e5541){_0x2f0e43['push'](_0x2f0e43['shift']());}};_0x179741(++_0x28ca2c);}(_0x1a54,0x14f));var _0x41a5=function(_0x17d7ef,_0x1d0d3b){_0x17d7ef=_0x17d7ef-0x0;var _0x29ff99=_0x1a54[_0x17d7ef];return _0x29ff99;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x41a5('0x0'),'remove',_0x41a5('0x1')];function createListener(_0x1ca2ac,_0x502798){return function(_0x30feb7){_0x502798['emit'](_0x1ca2ac,_0x30feb7);};}function removeListener(_0x940b5d,_0x4a477f){return function(){MailMessageEvents[_0x41a5('0x2')](_0x940b5d,_0x4a477f);};}exports[_0x41a5('0x3')]=function(_0x11d8de){for(var _0x5ef0aa=0x0,_0x11f22c=events[_0x41a5('0x4')];_0x5ef0aa<_0x11f22c;_0x5ef0aa++){var _0x1440c4=events[_0x5ef0aa];var _0xbeb528=createListener(_0x41a5('0x5')+_0x1440c4,_0x11d8de);MailMessageEvents['on'](_0x1440c4,_0xbeb528);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 4fc3313..01c5e07 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 _0x3e0a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0x3e0a,0x151));var _0xa3e0=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x3e0a[_0x2a8c21];return _0x5f3061;};'use strict';var multer=require(_0xa3e0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa3e0('0x1'));var express=require('express');var router=express[_0xa3e0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa3e0('0x3'));var interaction=require(_0xa3e0('0x4'));var config=require(_0xa3e0('0x5'));var controller=require('./mailQueue.controller');router[_0xa3e0('0x6')]('/',auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa3e0('0x9')]);router[_0xa3e0('0x6')](_0xa3e0('0xa'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0xb')]);router['get'](_0xa3e0('0xc'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0xd')]);router[_0xa3e0('0x6')](_0xa3e0('0xe'),auth[_0xa3e0('0x7')](),controller['getTeams']);router['get'](_0xa3e0('0xf'),auth['isAuthenticated'](),controller[_0xa3e0('0x10')]);router[_0xa3e0('0x11')]('/',auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x12')]);router[_0xa3e0('0x11')](_0xa3e0('0xe'),auth[_0xa3e0('0x7')](),controller['addTeams']);router[_0xa3e0('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0xa3e0('0x13')]);router[_0xa3e0('0x14')]('/:id',auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x15')]);router[_0xa3e0('0x16')](_0xa3e0('0xa'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x17')]);router[_0xa3e0('0x16')](_0xa3e0('0xe'),auth['isAuthenticated'](),controller[_0xa3e0('0x18')]);router[_0xa3e0('0x16')](_0xa3e0('0xf'),auth[_0xa3e0('0x7')](),controller[_0xa3e0('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2f6c=['getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x2f6c,0x126));var _0xc2f6=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x2f6c[_0x519756];return _0x37047e;};'use strict';var multer=require(_0xc2f6('0x0'));var util=require(_0xc2f6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc2f6('0x2'));var router=express[_0xc2f6('0x3')]();var fs_extra=require(_0xc2f6('0x4'));var auth=require(_0xc2f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc2f6('0x6'));var controller=require(_0xc2f6('0x7'));router['get']('/',auth[_0xc2f6('0x8')](),controller[_0xc2f6('0x9')]);router[_0xc2f6('0xa')](_0xc2f6('0xb'),auth[_0xc2f6('0x8')](),controller[_0xc2f6('0xc')]);router[_0xc2f6('0xa')](_0xc2f6('0xd'),auth['isAuthenticated'](),controller[_0xc2f6('0xe')]);router[_0xc2f6('0xa')](_0xc2f6('0xf'),auth[_0xc2f6('0x8')](),controller[_0xc2f6('0x10')]);router[_0xc2f6('0xa')](_0xc2f6('0x11'),auth[_0xc2f6('0x8')](),controller[_0xc2f6('0x12')]);router[_0xc2f6('0xa')](_0xc2f6('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0xc2f6('0x14')]('/',auth[_0xc2f6('0x8')](),controller[_0xc2f6('0x15')]);router[_0xc2f6('0x14')](_0xc2f6('0x11'),auth['isAuthenticated'](),controller[_0xc2f6('0x16')]);router[_0xc2f6('0x14')](_0xc2f6('0x13'),auth['isAuthenticated'](),controller[_0xc2f6('0x17')]);router[_0xc2f6('0x18')](_0xc2f6('0xd'),auth[_0xc2f6('0x8')](),controller[_0xc2f6('0x19')]);router['delete'](_0xc2f6('0xd'),auth[_0xc2f6('0x8')](),controller[_0xc2f6('0x1a')]);router[_0xc2f6('0x1b')](_0xc2f6('0x11'),auth['isAuthenticated'](),controller[_0xc2f6('0x1c')]);router[_0xc2f6('0x1b')](_0xc2f6('0x13'),auth[_0xc2f6('0x8')](),controller[_0xc2f6('0x1d')]);module[_0xc2f6('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 8ba8ec3..4b9101b 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 _0xb0d4=['sequelize','exports','STRING','name','ENUM','beepall','roundrobin'];(function(_0x494a42,_0x1f2103){var _0x254792=function(_0x5f1c1d){while(--_0x5f1c1d){_0x494a42['push'](_0x494a42['shift']());}};_0x254792(++_0x1f2103);}(_0xb0d4,0x13b));var _0x4b0d=function(_0x33dc75,_0x425795){_0x33dc75=_0x33dc75-0x0;var _0x1a227d=_0xb0d4[_0x33dc75];return _0x1a227d;};'use strict';var Sequelize=require(_0x4b0d('0x0'));module[_0x4b0d('0x1')]={'name':{'type':Sequelize[_0x4b0d('0x2')],'unique':_0x4b0d('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4b0d('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4b0d('0x4')]('rrmemory',_0x4b0d('0x5'),_0x4b0d('0x6'))}}; \ No newline at end of file +var _0x4461=['STRING','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3eb2a2,_0x1af0c9){var _0x159cc5=function(_0x45d935){while(--_0x45d935){_0x3eb2a2['push'](_0x3eb2a2['shift']());}};_0x159cc5(++_0x1af0c9);}(_0x4461,0x12b));var _0x1446=function(_0x35ffc7,_0x568d1d){_0x35ffc7=_0x35ffc7-0x0;var _0x21ca6a=_0x4461[_0x35ffc7];return _0x21ca6a;};'use strict';var Sequelize=require(_0x1446('0x0'));module[_0x1446('0x1')]={'name':{'type':Sequelize[_0x1446('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1446('0x3')](_0x1446('0x4'),_0x1446('0x5'),_0x1446('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index f10f367..45bff6b 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 _0x28f7=['defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','UserProfileResource','destroy','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','sort','pick','filter','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','order','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','sequelize','SELECT','every','TeamId','includes','compact','isEmpty','userMailQueue:remove','addAgents','omit','spread','emit','removeAgents','getAgents','nolimit','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','redis'];(function(_0x1d2520,_0x105606){var _0x22fd54=function(_0x2c3123){while(--_0x2c3123){_0x1d2520['push'](_0x1d2520['shift']());}};_0x22fd54(++_0x105606);}(_0x28f7,0xea));var _0x728f=function(_0x1f4f18,_0x525ce3){_0x1f4f18=_0x1f4f18-0x0;var _0x73b1e4=_0x28f7[_0x1f4f18];return _0x73b1e4;};'use strict';var BPromise=require('bluebird');var util=require(_0x728f('0x0'));var _=require(_0x728f('0x1'));var squel=require(_0x728f('0x2'));var Redis=require(_0x728f('0x3'));var qs=require(_0x728f('0x4'));var logger=require(_0x728f('0x5'))(_0x728f('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x728f('0x7')]=_[_0x728f('0x8')](config['redis'],{'host':_0x728f('0x9'),'port':0x18eb});var socket=require(_0x728f('0xa'))(new Redis(config['redis']));require(_0x728f('0xb'))[_0x728f('0xc')](socket);function respondWithStatusCode(_0x2f4d00,_0x555b58){_0x555b58=_0x555b58||0xcc;return function(_0x340d4c){if(_0x340d4c){return _0x2f4d00[_0x728f('0xd')](_0x555b58);}return _0x2f4d00[_0x728f('0xe')](_0x555b58)['end']();};}function respondWithResult(_0x37dce2,_0x5e7f30){_0x5e7f30=_0x5e7f30||0xc8;return function(_0x42d1a6){if(_0x42d1a6){return _0x37dce2['status'](_0x5e7f30)[_0x728f('0xf')](_0x42d1a6);}};}function respondWithFilteredResult(_0x42f562,_0x3b2038){return function(_0x404cd6){if(_0x404cd6){var _0x577681=typeof _0x3b2038['offset']===_0x728f('0x10')&&typeof _0x3b2038['limit']==='undefined';var _0x20370e=_0x404cd6[_0x728f('0x11')];var _0x43b092=_0x577681?0x0:_0x3b2038[_0x728f('0x12')];var _0x70b34a=_0x577681?_0x404cd6[_0x728f('0x11')]:_0x3b2038[_0x728f('0x12')]+_0x3b2038[_0x728f('0x13')];var _0x1fc067;if(_0x70b34a>=_0x20370e){_0x70b34a=_0x20370e;_0x1fc067=0xc8;}else{_0x1fc067=0xce;}_0x42f562[_0x728f('0xe')](_0x1fc067);return _0x42f562[_0x728f('0x14')](_0x728f('0x15'),_0x43b092+'-'+_0x70b34a+'/'+_0x20370e)[_0x728f('0xf')](_0x404cd6);}return null;};}function saveUpdates(_0x3bf48d){return function(_0x368575){if(_0x368575){return _0x368575[_0x728f('0x16')](_0x3bf48d)[_0x728f('0x17')](function(_0x1571a6){return _0x1571a6;});}return null;};}function removeEntity(_0x371764){return function(_0x6fffe5){if(_0x6fffe5){return _0x6fffe5['destroy']()[_0x728f('0x17')](function(){var _0x1d79b9=_0x6fffe5['get']({'plain':!![]});var _0x3e3dc9='MailQueues';return db[_0x728f('0x18')][_0x728f('0x19')]({'where':{'type':_0x3e3dc9,'resourceId':_0x1d79b9['id']}})[_0x728f('0x17')](function(){return _0x6fffe5;});})[_0x728f('0x17')](function(){_0x371764[_0x728f('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3ead9){return function(_0x5174f5){if(!_0x5174f5){_0xe3ead9[_0x728f('0xd')](0x194);}return _0x5174f5;};}function handleError(_0x251785,_0x470d8c){_0x470d8c=_0x470d8c||0x1f4;return function(_0x1b3cfe){logger['error'](_0x1b3cfe[_0x728f('0x1a')]);if(_0x1b3cfe[_0x728f('0x1b')]){delete _0x1b3cfe[_0x728f('0x1b')];}_0x251785['status'](_0x470d8c)[_0x728f('0x1c')](_0x1b3cfe);};}exports[_0x728f('0x1d')]=function(_0x490ad2,_0x4f744c){var _0x4b19a0={};var _0x36dd3f={'count':0x0,'rows':[]};var _0x1baa10=_[_0x728f('0x1e')](db[_0x728f('0x1f')][_0x728f('0x20')],function(_0x7ebbe9){return{'name':_0x7ebbe9[_0x728f('0x21')],'type':_0x7ebbe9[_0x728f('0x22')][_0x728f('0x23')]};});_0x4b19a0=qs[_0x728f('0x24')](_0x1baa10,_0x490ad2);var _0x26c18d={'where':_0x4b19a0[_0x728f('0x25')]};return db[_0x728f('0x1f')][_0x728f('0x11')](_0x26c18d)['then'](function(_0x43b235){_0x36dd3f[_0x728f('0x11')]=_0x43b235;_0x4b19a0[_0x728f('0x26')]=qs[_0x728f('0x26')](_0x490ad2[_0x728f('0x27')]);return db[_0x728f('0x1f')][_0x728f('0x28')](_0x4b19a0);})['then'](function(_0x27947c){_0x36dd3f[_0x728f('0x29')]=_0x27947c;return _0x36dd3f;})[_0x728f('0x17')](respondWithFilteredResult(_0x4f744c,_0x4b19a0))[_0x728f('0x2a')](handleError(_0x4f744c,null));};exports['show']=function(_0x210856,_0x5118a1){var _0x3ad293={'raw':!![],'where':{'id':_0x210856[_0x728f('0x2b')]['id']}},_0xac0c3b={};_0xac0c3b[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x1f')][_0x728f('0x20')]);_0xac0c3b[_0x728f('0x27')]=_[_0x728f('0x2d')](_0x210856['query']);_0xac0c3b[_0x728f('0x2e')]=_[_0x728f('0x2f')](_0xac0c3b[_0x728f('0x2c')],_0xac0c3b['query']);_0x3ad293[_0x728f('0x30')]=_['intersection'](_0xac0c3b[_0x728f('0x2c')],qs[_0x728f('0x31')](_0x210856[_0x728f('0x27')]['fields']));_0x3ad293['attributes']=_0x3ad293['attributes'][_0x728f('0x32')]?_0x3ad293['attributes']:_0xac0c3b[_0x728f('0x2c')];if(_0x210856[_0x728f('0x27')][_0x728f('0x33')]){_0x3ad293['include']=[{'all':!![]}];}_0x3ad293=_[_0x728f('0x34')]({},_0x3ad293,_0x210856[_0x728f('0x35')]);return db['MailQueue']['find'](_0x3ad293)[_0x728f('0x17')](handleEntityNotFound(_0x5118a1,null))[_0x728f('0x17')](respondWithResult(_0x5118a1,null))[_0x728f('0x2a')](handleError(_0x5118a1,null));};exports['create']=function(_0x54f18b,_0x1e798b){return db['MailQueue'][_0x728f('0x36')](_0x54f18b[_0x728f('0x37')],{})['then'](function(_0x5182db){var _0x40a992=_0x54f18b['user'][_0x728f('0x38')]({'plain':!![]});if(!_0x40a992)throw new Error(_0x728f('0x39'));if(_0x40a992[_0x728f('0x3a')]==='user'){var _0x494333=_0x5182db['get']({'plain':!![]});var _0x522759=_0x728f('0x3b');return db[_0x728f('0x3c')][_0x728f('0x3d')]({'where':{'name':_0x522759,'userProfileId':_0x40a992[_0x728f('0x3e')]},'raw':!![]})[_0x728f('0x17')](function(_0x5adddf){if(_0x5adddf&&_0x5adddf['autoAssociation']===0x0){return db[_0x728f('0x18')][_0x728f('0x36')]({'name':_0x494333[_0x728f('0x1b')],'resourceId':_0x494333['id'],'type':_0x5adddf[_0x728f('0x1b')],'sectionId':_0x5adddf['id']},{})[_0x728f('0x17')](function(){return _0x5182db;});}else{return _0x5182db;}})[_0x728f('0x2a')](function(_0x411043){logger['error'](_0x728f('0x3f'),_0x411043);throw _0x411043;});}return _0x5182db;})[_0x728f('0x17')](respondWithResult(_0x1e798b,0xc9))[_0x728f('0x2a')](handleError(_0x1e798b,null));};exports['update']=function(_0x16f0ab,_0x350847){if(_0x16f0ab[_0x728f('0x37')]['id']){delete _0x16f0ab['body']['id'];}return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x16f0ab[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x350847,null))[_0x728f('0x17')](saveUpdates(_0x16f0ab[_0x728f('0x37')],null))['then'](respondWithResult(_0x350847,null))['catch'](handleError(_0x350847,null));};exports['destroy']=function(_0x39f3c2,_0x16ac57){return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x39f3c2[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x16ac57,null))[_0x728f('0x17')](removeEntity(_0x16ac57,null))['catch'](handleError(_0x16ac57,null));};exports['describe']=function(_0x3c92e5,_0x58f8a4){return db[_0x728f('0x1f')][_0x728f('0x40')]()['then'](respondWithResult(_0x58f8a4,null))[_0x728f('0x2a')](handleError(_0x58f8a4,null));};exports[_0x728f('0x41')]=function(_0x5f28e9,_0x279d4e){var _0x3d625f={'raw':!![],'where':{}},_0x54f6eb={},_0x3aa234;return db[_0x728f('0x1f')][_0x728f('0x42')]({'where':{'id':_0x5f28e9[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x279d4e,null))[_0x728f('0x17')](function(_0x19fac1){if(_0x19fac1){_0x3aa234=_0x19fac1[_0x728f('0x38')]({'plain':!![]});_0x54f6eb[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x43')][_0x728f('0x20')]);_0x54f6eb[_0x728f('0x27')]=_[_0x728f('0x2d')](_0x5f28e9[_0x728f('0x27')]);_0x54f6eb['filters']=_[_0x728f('0x2f')](_0x54f6eb['model'],_0x54f6eb[_0x728f('0x27')]);_0x3d625f[_0x728f('0x30')]=_[_0x728f('0x2f')](_0x54f6eb[_0x728f('0x2c')],qs['fields'](_0x5f28e9['query']['fields']));_0x3d625f[_0x728f('0x30')]=_0x3d625f[_0x728f('0x30')]['length']?_0x3d625f[_0x728f('0x30')]:_0x54f6eb['model'];if(!_0x5f28e9['query'][_0x728f('0x44')]('nolimit')){_0x3d625f[_0x728f('0x13')]=qs['limit'](_0x5f28e9[_0x728f('0x27')]['limit']);_0x3d625f[_0x728f('0x12')]=qs['offset'](_0x5f28e9['query'][_0x728f('0x12')]);}_0x3d625f['order']=qs[_0x728f('0x45')](_0x5f28e9[_0x728f('0x27')][_0x728f('0x45')]);_0x3d625f['where']=qs[_0x728f('0x2e')](_[_0x728f('0x46')](_0x5f28e9['query'],_0x54f6eb[_0x728f('0x2e')]));_0x3d625f['where']['MailQueueId']=_0x19fac1['id'];if(_0x5f28e9[_0x728f('0x27')][_0x728f('0x47')]){_0x3d625f[_0x728f('0x25')]=_[_0x728f('0x34')](_0x3d625f['where'],{'$or':_[_0x728f('0x1e')](_0x3d625f['attributes'],function(_0x186c1b){var _0x81ac10={};_0x81ac10[_0x186c1b]={'$like':'%'+_0x5f28e9[_0x728f('0x27')][_0x728f('0x47')]+'%'};return _0x81ac10;})});}_0x3d625f=_['merge']({},_0x3d625f,_0x5f28e9['options']);return db['UserMailQueue'][_0x728f('0x28')](_0x3d625f);}})[_0x728f('0x17')](function(_0x5594ac){if(_0x5594ac){return db[_0x728f('0x48')][_0x728f('0x49')]({'where':{'id':_[_0x728f('0x1e')](_0x5594ac,_0x728f('0x4a')),'role':'agent'},'attributes':['id',_0x728f('0x1b'),_0x728f('0x4b'),_0x728f('0x4c'),_0x728f('0x4d')]});}})[_0x728f('0x17')](function(_0x12dc35){if(_0x12dc35){return{'count':_0x12dc35[_0x728f('0x11')],'rows':_[_0x728f('0x1e')](_0x12dc35[_0x728f('0x29')],function(_0x30620e){return{'membername':_0x30620e[_0x728f('0x1b')],'UserId':_0x30620e['id'],'queue_name':_0x3aa234[_0x728f('0x1b')],'MailQueueId':_0x3aa234['id'],'interface':util[_0x728f('0x4e')]('%s/%s',_0x728f('0x4f'),_0x30620e[_0x728f('0x1b')]),'penalty':0x0,'paused':_0x30620e[_0x728f('0x4b')],'createdAt':_0x30620e['createdAt'],'updatedAt':_0x30620e[_0x728f('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x728f('0x17')](respondWithFilteredResult(_0x279d4e,_0x3d625f))[_0x728f('0x2a')](handleError(_0x279d4e,null));};exports[_0x728f('0x50')]=function(_0x4c1f1f,_0x298f6c){var _0x4682d4={};var _0x3b6116={};var _0x3ea94f;var _0x423872;return db[_0x728f('0x1f')]['findOne']({'where':{'id':_0x4c1f1f[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x298f6c,null))[_0x728f('0x17')](function(_0x28bcce){if(_0x28bcce){_0x3ea94f=_0x28bcce;_0x3b6116[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x51')][_0x728f('0x20')]);_0x3b6116['query']=_[_0x728f('0x2d')](_0x4c1f1f[_0x728f('0x27')]);_0x3b6116[_0x728f('0x2e')]=_[_0x728f('0x2f')](_0x3b6116[_0x728f('0x2c')],_0x3b6116['query']);_0x4682d4[_0x728f('0x30')]=_['intersection'](_0x3b6116['model'],qs[_0x728f('0x31')](_0x4c1f1f[_0x728f('0x27')][_0x728f('0x31')]));_0x4682d4[_0x728f('0x30')]=_0x4682d4[_0x728f('0x30')][_0x728f('0x32')]?_0x4682d4[_0x728f('0x30')]:_0x3b6116['model'];_0x4682d4[_0x728f('0x52')]=qs[_0x728f('0x45')](_0x4c1f1f['query'][_0x728f('0x45')]);_0x4682d4[_0x728f('0x25')]=qs[_0x728f('0x2e')](_[_0x728f('0x46')](_0x4c1f1f[_0x728f('0x27')],_0x3b6116[_0x728f('0x2e')]));if(_0x4c1f1f['query'][_0x728f('0x47')]){_0x4682d4[_0x728f('0x25')]=_[_0x728f('0x34')](_0x4682d4[_0x728f('0x25')],{'$or':_[_0x728f('0x1e')](_0x4682d4[_0x728f('0x30')],function(_0xd0cc20){var _0x7b8909={};_0x7b8909[_0xd0cc20]={'$like':'%'+_0x4c1f1f[_0x728f('0x27')][_0x728f('0x47')]+'%'};return _0x7b8909;})});}_0x4682d4=_[_0x728f('0x34')]({},_0x4682d4,_0x4c1f1f[_0x728f('0x35')]);return _0x3ea94f[_0x728f('0x50')](_0x4682d4);}})[_0x728f('0x17')](function(_0x2c1759){if(_0x2c1759){_0x423872=_0x2c1759['length'];if(!_0x4c1f1f[_0x728f('0x27')]['hasOwnProperty']('nolimit')){_0x4682d4[_0x728f('0x13')]=qs[_0x728f('0x13')](_0x4c1f1f[_0x728f('0x27')][_0x728f('0x13')]);_0x4682d4[_0x728f('0x12')]=qs[_0x728f('0x12')](_0x4c1f1f['query']['offset']);}return _0x3ea94f['getTeams'](_0x4682d4);}})[_0x728f('0x17')](function(_0x12496c){if(_0x12496c){return _0x12496c?{'count':_0x423872,'rows':_0x12496c}:null;}})[_0x728f('0x17')](respondWithResult(_0x298f6c,null))[_0x728f('0x2a')](handleError(_0x298f6c,null));};exports[_0x728f('0x53')]=function(_0x5ad363,_0x4c781b){var _0x478c07=_0x5ad363['body'][_0x728f('0x54')];return db['Team'][_0x728f('0x28')]({'where':{'id':_0x478c07},'attributes':['id'],'include':[{'model':db[_0x728f('0x48')],'as':'Agents','attributes':['id',_0x728f('0x1b'),_0x728f('0x55'),_0x728f('0x56'),_0x728f('0x57')],'raw':!![]}]})[_0x728f('0x17')](function(_0x360c45){if(_0x360c45){var _0x447c5b=_[_0x728f('0x58')](_0x360c45,function(_0x4dc5e1){var _0x25db78=_0x4dc5e1[_0x728f('0x38')]({'plain':!![]});return _0x25db78[_0x728f('0x59')];});return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x5ad363[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](function(_0x4e4d26){return db['sequelize'][_0x728f('0x5a')](function(_0x49f809){return _0x4e4d26[_0x728f('0x53')](_0x478c07,{'transaction':_0x49f809})['then'](function(){return BPromise[_0x728f('0x5b')](_0x447c5b,function(_0x393c22){return db[_0x728f('0x43')][_0x728f('0x5c')]({'where':{'UserId':_0x393c22['id'],'MailQueueId':_0x5ad363[_0x728f('0x2b')]['id']},'transaction':_0x49f809});});})['then'](function(){_0x447c5b[_0x728f('0x5d')](function(_0x321705){socket['emit'](_0x728f('0x5e'),{'UserId':_0x321705['id'],'MailQueueId':_0x4e4d26['id']});});});});});}})['then'](respondWithStatusCode(_0x4c781b,null))[_0x728f('0x2a')](handleError(_0x4c781b,null));};exports[_0x728f('0x5f')]=function(_0x1bb9b9,_0x40cb4c){return db['Team'][_0x728f('0x28')]({'where':{'id':_0x1bb9b9[_0x728f('0x27')][_0x728f('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x728f('0x59'),'attributes':['id'],'raw':!![]}]})[_0x728f('0x17')](handleEntityNotFound(_0x40cb4c,null))['then'](function(_0x5728f2){var _0x3d4305=_[_0x728f('0x1e')](_0x5728f2,'id');var _0x3ec73d=[];var _0x178145=[];var _0x246f34=squel[_0x728f('0x60')]();_0x246f34[_0x728f('0x61')]('tq.TeamId')[_0x728f('0x62')](_0x728f('0x63'),'tq')[_0x728f('0x64')](_0x728f('0x65'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('MailQueueId\x20=\x20?',_0x1bb9b9[_0x728f('0x2b')]['id']);for(var _0x5dc9a4=0x0;_0x5dc9a4<_0x5728f2[_0x728f('0x32')];_0x5dc9a4+=0x1){let _0x2d6fa5=_0x5728f2[_0x5dc9a4];for(var _0x5126d0=0x0;_0x5126d0<_0x2d6fa5[_0x728f('0x59')][_0x728f('0x32')];_0x5126d0+=0x1){let _0x3ef9eb=_0x2d6fa5[_0x728f('0x59')][_0x5126d0];var _0xdaf8e9=_0x246f34[_0x728f('0x66')]();_0xdaf8e9[_0x728f('0x25')](_0x728f('0x67'),_0x3ef9eb['id']);_0x178145[_0x728f('0x68')](db['sequelize'][_0x728f('0x27')](_0xdaf8e9[_0x728f('0x69')](),{'type':db[_0x728f('0x6a')]['QueryTypes'][_0x728f('0x6b')]})[_0x728f('0x17')](function(_0x1b1eef){if(_0x1b1eef['length']===0x1){return _0x3ef9eb['id'];}else{var _0x31b93f=_[_0x728f('0x6c')](_[_0x728f('0x1e')](_0x1b1eef,_0x728f('0x6d')),function(_0x1104cb){return _[_0x728f('0x6e')](_0x3d4305,_0x1104cb);});if(_0x31b93f){return _0x3ef9eb['id'];}}}));}}return BPromise['all'](_0x178145)['then'](function(_0x372151){_0x3ec73d=_(_0x3ec73d)['union'](_0x372151)[_0x728f('0x6f')]()['value']();return db['MailQueue'][_0x728f('0x3d')]({'where':{'id':_0x1bb9b9[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](function(_0x11e149){return db[_0x728f('0x6a')][_0x728f('0x5a')](function(_0x28df23){return _0x11e149[_0x728f('0x5f')](_0x1bb9b9[_0x728f('0x27')][_0x728f('0x54')],{'transaction':_0x28df23})[_0x728f('0x17')](function(){if(!_[_0x728f('0x70')](_0x3ec73d)){return _0x11e149['removeAgents'](_0x3ec73d,{'transaction':_0x28df23});}})['then'](function(){_0x3ec73d['forEach'](function(_0x4bb3ef){socket['emit'](_0x728f('0x71'),{'UserId':_0x4bb3ef,'MailQueueId':_0x11e149['id']});});});});});});})[_0x728f('0x17')](respondWithStatusCode(_0x40cb4c,null))['catch'](handleError(_0x40cb4c,null));};exports[_0x728f('0x72')]=function(_0xdc30e3,_0x1d2379){return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0xdc30e3[_0x728f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x1d2379,null))[_0x728f('0x17')](function(_0x517bae){if(_0x517bae){return _0x517bae[_0x728f('0x72')](_0xdc30e3['body']['ids'],_[_0x728f('0x73')](_0xdc30e3[_0x728f('0x37')],[_0x728f('0x54'),'id'])||{})[_0x728f('0x74')](function(_0x15a3b1){for(var _0x38f9b2=0x0;_0x38f9b2<_0xdc30e3['body'][_0x728f('0x54')][_0x728f('0x32')];_0x38f9b2+=0x1){socket[_0x728f('0x75')]('userMailQueue:save',{'UserId':Number(_0xdc30e3[_0x728f('0x37')][_0x728f('0x54')][_0x38f9b2]),'MailQueueId':Number(_0xdc30e3['params']['id'])});}return _0x15a3b1;});}})[_0x728f('0x17')](respondWithResult(_0x1d2379,null))[_0x728f('0x2a')](handleError(_0x1d2379,null));};exports[_0x728f('0x76')]=function(_0x199c3a,_0x46f6cd){return db[_0x728f('0x1f')][_0x728f('0x3d')]({'where':{'id':_0x199c3a[_0x728f('0x2b')]['id']}})[_0x728f('0x17')](handleEntityNotFound(_0x46f6cd,null))['then'](function(_0x5b382e){if(_0x5b382e){return _0x5b382e[_0x728f('0x76')](_0x199c3a[_0x728f('0x27')][_0x728f('0x54')])[_0x728f('0x17')](function(){if(_['isArray'](_0x199c3a[_0x728f('0x27')][_0x728f('0x54')])){for(var _0x101cff=0x0;_0x101cff<_0x199c3a[_0x728f('0x27')][_0x728f('0x54')]['length'];_0x101cff+=0x1){socket[_0x728f('0x75')](_0x728f('0x71'),{'UserId':Number(_0x199c3a[_0x728f('0x27')][_0x728f('0x54')][_0x101cff]),'MailQueueId':Number(_0x199c3a[_0x728f('0x2b')]['id'])});}}else{socket[_0x728f('0x75')](_0x728f('0x71'),{'UserId':Number(_0x199c3a['query'][_0x728f('0x54')]),'MailQueueId':Number(_0x199c3a[_0x728f('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x46f6cd,null))['catch'](handleError(_0x46f6cd,null));};exports[_0x728f('0x77')]=function(_0x13e66c,_0x4c331d){var _0x4d624e={};var _0x396b20={};var _0x5d6aac;var _0x7949ea;return db[_0x728f('0x1f')][_0x728f('0x42')]({'where':{'id':_0x13e66c[_0x728f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4c331d,null))[_0x728f('0x17')](function(_0x29b3ea){if(_0x29b3ea){_0x5d6aac=_0x29b3ea;_0x396b20[_0x728f('0x2c')]=_[_0x728f('0x2d')](db[_0x728f('0x48')][_0x728f('0x20')]);_0x396b20[_0x728f('0x27')]=_['keys'](_0x13e66c['query']);_0x396b20[_0x728f('0x2e')]=_[_0x728f('0x2f')](_0x396b20[_0x728f('0x2c')],_0x396b20['query']);_0x4d624e[_0x728f('0x30')]=_[_0x728f('0x2f')](_0x396b20[_0x728f('0x2c')],qs[_0x728f('0x31')](_0x13e66c[_0x728f('0x27')][_0x728f('0x31')]));_0x4d624e['attributes']=_0x4d624e[_0x728f('0x30')][_0x728f('0x32')]?_0x4d624e[_0x728f('0x30')]:_0x396b20[_0x728f('0x2c')];_0x4d624e['order']=qs[_0x728f('0x45')](_0x13e66c[_0x728f('0x27')][_0x728f('0x45')]);_0x4d624e[_0x728f('0x25')]=qs[_0x728f('0x2e')](_[_0x728f('0x46')](_0x13e66c[_0x728f('0x27')],_0x396b20[_0x728f('0x2e')]));if(_0x13e66c[_0x728f('0x27')][_0x728f('0x47')]){_0x4d624e[_0x728f('0x25')]=_[_0x728f('0x34')](_0x4d624e[_0x728f('0x25')],{'$or':_[_0x728f('0x1e')](_0x4d624e['attributes'],function(_0x3a101e){var _0x330272={};_0x330272[_0x3a101e]={'$like':'%'+_0x13e66c[_0x728f('0x27')][_0x728f('0x47')]+'%'};return _0x330272;})});}_0x4d624e=_[_0x728f('0x34')]({},_0x4d624e,_0x13e66c[_0x728f('0x35')]);return _0x5d6aac['getAgents'](_0x4d624e);}})[_0x728f('0x17')](function(_0x389918){if(_0x389918){_0x7949ea=_0x389918['length'];if(!_0x13e66c['query'][_0x728f('0x44')](_0x728f('0x78'))){_0x4d624e[_0x728f('0x13')]=qs['limit'](_0x13e66c[_0x728f('0x27')][_0x728f('0x13')]);_0x4d624e[_0x728f('0x12')]=qs['offset'](_0x13e66c[_0x728f('0x27')][_0x728f('0x12')]);}return _0x5d6aac[_0x728f('0x77')](_0x4d624e);}})[_0x728f('0x17')](function(_0x28b8ac){if(_0x28b8ac){return _0x28b8ac?{'count':_0x7949ea,'rows':_0x28b8ac}:null;}})[_0x728f('0x17')](respondWithResult(_0x4c331d,null))[_0x728f('0x2a')](handleError(_0x4c331d,null));}; \ No newline at end of file +var _0x82f5=['offset','undefined','limit','count','set','Content-Range','json','then','destroy','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserMailQueue','hasOwnProperty','nolimit','sort','MailQueueId','filter','findAll','findAndCountAll','UserId','agent','format','%s/%s','SIP','mailPause','createdAt','updatedAt','getTeams','order','pick','addTeams','ids','Agents','online','interface','sequelize','each','forEach','emit','userMailQueue:save','removeTeams','Team','User','select','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','userMailQueue:remove','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','end','status'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x82f5,0x1e3));var _0x582f=function(_0x6e4cd7,_0x3975ba){_0x6e4cd7=_0x6e4cd7-0x0;var _0x53998f=_0x82f5[_0x6e4cd7];return _0x53998f;};'use strict';var BPromise=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var _=require(_0x582f('0x2'));var squel=require(_0x582f('0x3'));var Redis=require(_0x582f('0x4'));var qs=require(_0x582f('0x5'));var logger=require(_0x582f('0x6'))(_0x582f('0x7'));var config=require('../../config/environment');var db=require(_0x582f('0x8'))['db'];config['redis']=_[_0x582f('0x9')](config['redis'],{'host':_0x582f('0xa'),'port':0x18eb});var socket=require(_0x582f('0xb'))(new Redis(config[_0x582f('0xc')]));require(_0x582f('0xd'))[_0x582f('0xe')](socket);function respondWithStatusCode(_0x48437e,_0x143bed){_0x143bed=_0x143bed||0xcc;return function(_0x12a42d){if(_0x12a42d){return _0x48437e['sendStatus'](_0x143bed);}return _0x48437e['status'](_0x143bed)[_0x582f('0xf')]();};}function respondWithResult(_0x3c68b9,_0x5a9a65){_0x5a9a65=_0x5a9a65||0xc8;return function(_0x3f9275){if(_0x3f9275){return _0x3c68b9[_0x582f('0x10')](_0x5a9a65)['json'](_0x3f9275);}};}function respondWithFilteredResult(_0x1ebfc1,_0x13b109){return function(_0x1bce3){if(_0x1bce3){var _0xd9fe86=typeof _0x13b109[_0x582f('0x11')]===_0x582f('0x12')&&typeof _0x13b109[_0x582f('0x13')]===_0x582f('0x12');var _0x210f56=_0x1bce3[_0x582f('0x14')];var _0x16deb9=_0xd9fe86?0x0:_0x13b109[_0x582f('0x11')];var _0x26a7b3=_0xd9fe86?_0x1bce3['count']:_0x13b109['offset']+_0x13b109['limit'];var _0x4253cf;if(_0x26a7b3>=_0x210f56){_0x26a7b3=_0x210f56;_0x4253cf=0xc8;}else{_0x4253cf=0xce;}_0x1ebfc1['status'](_0x4253cf);return _0x1ebfc1[_0x582f('0x15')](_0x582f('0x16'),_0x16deb9+'-'+_0x26a7b3+'/'+_0x210f56)[_0x582f('0x17')](_0x1bce3);}return null;};}function saveUpdates(_0xc4aec8){return function(_0x42f078){if(_0x42f078){return _0x42f078['update'](_0xc4aec8)[_0x582f('0x18')](function(_0x2bd1f3){return _0x2bd1f3;});}return null;};}function removeEntity(_0x1b23f2){return function(_0x1ff58b){if(_0x1ff58b){return _0x1ff58b[_0x582f('0x19')]()[_0x582f('0x18')](function(){var _0xe910d3=_0x1ff58b['get']({'plain':!![]});var _0x48079b=_0x582f('0x1a');return db[_0x582f('0x1b')][_0x582f('0x19')]({'where':{'type':_0x48079b,'resourceId':_0xe910d3['id']}})[_0x582f('0x18')](function(){return _0x1ff58b;});})[_0x582f('0x18')](function(){_0x1b23f2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x536456){return function(_0x4cefbf){if(!_0x4cefbf){_0x536456[_0x582f('0x1c')](0x194);}return _0x4cefbf;};}function handleError(_0x2c9316,_0x2c231d){_0x2c231d=_0x2c231d||0x1f4;return function(_0x2a505c){logger[_0x582f('0x1d')](_0x2a505c[_0x582f('0x1e')]);if(_0x2a505c[_0x582f('0x1f')]){delete _0x2a505c[_0x582f('0x1f')];}_0x2c9316[_0x582f('0x10')](_0x2c231d)[_0x582f('0x20')](_0x2a505c);};}exports['index']=function(_0x285ab4,_0x36e9db){var _0x4ce031={};var _0x24f124={'count':0x0,'rows':[]};var _0x3f1bb6=_[_0x582f('0x21')](db[_0x582f('0x22')][_0x582f('0x23')],function(_0x341e26){return{'name':_0x341e26[_0x582f('0x24')],'type':_0x341e26[_0x582f('0x25')][_0x582f('0x26')]};});_0x4ce031=qs[_0x582f('0x27')](_0x3f1bb6,_0x285ab4);var _0x42fce0={'where':_0x4ce031[_0x582f('0x28')]};return db['MailQueue'][_0x582f('0x14')](_0x42fce0)[_0x582f('0x18')](function(_0x404f33){_0x24f124['count']=_0x404f33;_0x4ce031[_0x582f('0x29')]=qs[_0x582f('0x29')](_0x285ab4[_0x582f('0x2a')]);return db[_0x582f('0x22')]['findAll'](_0x4ce031);})[_0x582f('0x18')](function(_0x3cd340){_0x24f124[_0x582f('0x2b')]=_0x3cd340;return _0x24f124;})[_0x582f('0x18')](respondWithFilteredResult(_0x36e9db,_0x4ce031))['catch'](handleError(_0x36e9db,null));};exports[_0x582f('0x2c')]=function(_0x1e0fc9,_0x13dcfd){var _0x219512={'raw':!![],'where':{'id':_0x1e0fc9[_0x582f('0x2d')]['id']}},_0x257010={};_0x257010['model']=_[_0x582f('0x2e')](db[_0x582f('0x22')][_0x582f('0x23')]);_0x257010['query']=_[_0x582f('0x2e')](_0x1e0fc9[_0x582f('0x2a')]);_0x257010[_0x582f('0x2f')]=_[_0x582f('0x30')](_0x257010[_0x582f('0x31')],_0x257010[_0x582f('0x2a')]);_0x219512[_0x582f('0x32')]=_[_0x582f('0x30')](_0x257010[_0x582f('0x31')],qs[_0x582f('0x33')](_0x1e0fc9[_0x582f('0x2a')][_0x582f('0x33')]));_0x219512[_0x582f('0x32')]=_0x219512[_0x582f('0x32')][_0x582f('0x34')]?_0x219512[_0x582f('0x32')]:_0x257010[_0x582f('0x31')];if(_0x1e0fc9[_0x582f('0x2a')][_0x582f('0x35')]){_0x219512[_0x582f('0x29')]=[{'all':!![]}];}_0x219512=_[_0x582f('0x36')]({},_0x219512,_0x1e0fc9[_0x582f('0x37')]);return db[_0x582f('0x22')][_0x582f('0x38')](_0x219512)[_0x582f('0x18')](handleEntityNotFound(_0x13dcfd,null))[_0x582f('0x18')](respondWithResult(_0x13dcfd,null))[_0x582f('0x39')](handleError(_0x13dcfd,null));};exports['create']=function(_0x4fc866,_0x58bd65){return db[_0x582f('0x22')][_0x582f('0x3a')](_0x4fc866['body'],{})['then'](function(_0x2ae34f){var _0x13863a=_0x4fc866[_0x582f('0x3b')][_0x582f('0x3c')]({'plain':!![]});if(!_0x13863a)throw new Error(_0x582f('0x3d'));if(_0x13863a[_0x582f('0x3e')]===_0x582f('0x3b')){var _0x458af0=_0x2ae34f[_0x582f('0x3c')]({'plain':!![]});var _0x213fcb=_0x582f('0x1a');return db[_0x582f('0x3f')]['find']({'where':{'name':_0x213fcb,'userProfileId':_0x13863a[_0x582f('0x40')]},'raw':!![]})[_0x582f('0x18')](function(_0x55ec5f){if(_0x55ec5f&&_0x55ec5f[_0x582f('0x41')]===0x0){return db[_0x582f('0x1b')][_0x582f('0x3a')]({'name':_0x458af0[_0x582f('0x1f')],'resourceId':_0x458af0['id'],'type':_0x55ec5f['name'],'sectionId':_0x55ec5f['id']},{})['then'](function(){return _0x2ae34f;});}else{return _0x2ae34f;}})[_0x582f('0x39')](function(_0x4b52a4){logger[_0x582f('0x1d')](_0x582f('0x42'),_0x4b52a4);throw _0x4b52a4;});}return _0x2ae34f;})[_0x582f('0x18')](respondWithResult(_0x58bd65,0xc9))[_0x582f('0x39')](handleError(_0x58bd65,null));};exports['update']=function(_0x439dd8,_0x3f7449){if(_0x439dd8[_0x582f('0x43')]['id']){delete _0x439dd8[_0x582f('0x43')]['id'];}return db[_0x582f('0x22')]['find']({'where':{'id':_0x439dd8[_0x582f('0x2d')]['id']}})[_0x582f('0x18')](handleEntityNotFound(_0x3f7449,null))[_0x582f('0x18')](saveUpdates(_0x439dd8['body'],null))[_0x582f('0x18')](respondWithResult(_0x3f7449,null))[_0x582f('0x39')](handleError(_0x3f7449,null));};exports[_0x582f('0x19')]=function(_0x452521,_0x349b18){return db[_0x582f('0x22')][_0x582f('0x38')]({'where':{'id':_0x452521['params']['id']}})[_0x582f('0x18')](handleEntityNotFound(_0x349b18,null))[_0x582f('0x18')](removeEntity(_0x349b18,null))[_0x582f('0x39')](handleError(_0x349b18,null));};exports[_0x582f('0x44')]=function(_0x4cf2a7,_0x3f6f43){return db[_0x582f('0x22')][_0x582f('0x44')]()[_0x582f('0x18')](respondWithResult(_0x3f6f43,null))[_0x582f('0x39')](handleError(_0x3f6f43,null));};exports['getMembers']=function(_0x1c87ca,_0x49b13b){var _0x281d9d={'raw':!![],'where':{}},_0x1489ee={},_0x1e6a16;return db['MailQueue'][_0x582f('0x45')]({'where':{'id':_0x1c87ca[_0x582f('0x2d')]['id']}})[_0x582f('0x18')](handleEntityNotFound(_0x49b13b,null))['then'](function(_0x777cfd){if(_0x777cfd){_0x1e6a16=_0x777cfd[_0x582f('0x3c')]({'plain':!![]});_0x1489ee[_0x582f('0x31')]=_['keys'](db[_0x582f('0x46')][_0x582f('0x23')]);_0x1489ee[_0x582f('0x2a')]=_[_0x582f('0x2e')](_0x1c87ca['query']);_0x1489ee['filters']=_['intersection'](_0x1489ee[_0x582f('0x31')],_0x1489ee[_0x582f('0x2a')]);_0x281d9d[_0x582f('0x32')]=_[_0x582f('0x30')](_0x1489ee[_0x582f('0x31')],qs[_0x582f('0x33')](_0x1c87ca[_0x582f('0x2a')][_0x582f('0x33')]));_0x281d9d['attributes']=_0x281d9d[_0x582f('0x32')]['length']?_0x281d9d[_0x582f('0x32')]:_0x1489ee[_0x582f('0x31')];if(!_0x1c87ca[_0x582f('0x2a')][_0x582f('0x47')](_0x582f('0x48'))){_0x281d9d[_0x582f('0x13')]=qs[_0x582f('0x13')](_0x1c87ca['query'][_0x582f('0x13')]);_0x281d9d[_0x582f('0x11')]=qs[_0x582f('0x11')](_0x1c87ca[_0x582f('0x2a')][_0x582f('0x11')]);}_0x281d9d['order']=qs['sort'](_0x1c87ca['query'][_0x582f('0x49')]);_0x281d9d[_0x582f('0x28')]=qs[_0x582f('0x2f')](_['pick'](_0x1c87ca[_0x582f('0x2a')],_0x1489ee[_0x582f('0x2f')]));_0x281d9d[_0x582f('0x28')][_0x582f('0x4a')]=_0x777cfd['id'];if(_0x1c87ca[_0x582f('0x2a')][_0x582f('0x4b')]){_0x281d9d[_0x582f('0x28')]=_[_0x582f('0x36')](_0x281d9d[_0x582f('0x28')],{'$or':_[_0x582f('0x21')](_0x281d9d[_0x582f('0x32')],function(_0x5ea111){var _0x439e4c={};_0x439e4c[_0x5ea111]={'$like':'%'+_0x1c87ca[_0x582f('0x2a')][_0x582f('0x4b')]+'%'};return _0x439e4c;})});}_0x281d9d=_[_0x582f('0x36')]({},_0x281d9d,_0x1c87ca[_0x582f('0x37')]);return db[_0x582f('0x46')][_0x582f('0x4c')](_0x281d9d);}})['then'](function(_0x3df17e){if(_0x3df17e){return db['User'][_0x582f('0x4d')]({'where':{'id':_['map'](_0x3df17e,_0x582f('0x4e')),'role':_0x582f('0x4f')},'attributes':['id',_0x582f('0x1f'),'mailPause','updatedAt','createdAt']});}})[_0x582f('0x18')](function(_0x518180){if(_0x518180){return{'count':_0x518180[_0x582f('0x14')],'rows':_[_0x582f('0x21')](_0x518180[_0x582f('0x2b')],function(_0x30196d){return{'membername':_0x30196d[_0x582f('0x1f')],'UserId':_0x30196d['id'],'queue_name':_0x1e6a16[_0x582f('0x1f')],'MailQueueId':_0x1e6a16['id'],'interface':util[_0x582f('0x50')](_0x582f('0x51'),_0x582f('0x52'),_0x30196d['name']),'penalty':0x0,'paused':_0x30196d[_0x582f('0x53')],'createdAt':_0x30196d[_0x582f('0x54')],'updatedAt':_0x30196d[_0x582f('0x55')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x582f('0x18')](respondWithFilteredResult(_0x49b13b,_0x281d9d))['catch'](handleError(_0x49b13b,null));};exports[_0x582f('0x56')]=function(_0x48146a,_0x5ef9c2){var _0x113773={};var _0x5bdbb9={};var _0x4fd6e0;var _0x4e5a86;return db[_0x582f('0x22')][_0x582f('0x45')]({'where':{'id':_0x48146a[_0x582f('0x2d')]['id']}})[_0x582f('0x18')](handleEntityNotFound(_0x5ef9c2,null))[_0x582f('0x18')](function(_0x58d23b){if(_0x58d23b){_0x4fd6e0=_0x58d23b;_0x5bdbb9[_0x582f('0x31')]=_['keys'](db['Team'][_0x582f('0x23')]);_0x5bdbb9[_0x582f('0x2a')]=_[_0x582f('0x2e')](_0x48146a[_0x582f('0x2a')]);_0x5bdbb9[_0x582f('0x2f')]=_[_0x582f('0x30')](_0x5bdbb9['model'],_0x5bdbb9[_0x582f('0x2a')]);_0x113773[_0x582f('0x32')]=_[_0x582f('0x30')](_0x5bdbb9['model'],qs[_0x582f('0x33')](_0x48146a['query'][_0x582f('0x33')]));_0x113773[_0x582f('0x32')]=_0x113773[_0x582f('0x32')]['length']?_0x113773[_0x582f('0x32')]:_0x5bdbb9[_0x582f('0x31')];_0x113773[_0x582f('0x57')]=qs[_0x582f('0x49')](_0x48146a['query']['sort']);_0x113773[_0x582f('0x28')]=qs[_0x582f('0x2f')](_[_0x582f('0x58')](_0x48146a[_0x582f('0x2a')],_0x5bdbb9[_0x582f('0x2f')]));if(_0x48146a[_0x582f('0x2a')]['filter']){_0x113773[_0x582f('0x28')]=_['merge'](_0x113773[_0x582f('0x28')],{'$or':_[_0x582f('0x21')](_0x113773[_0x582f('0x32')],function(_0x21650e){var _0x4c3aa2={};_0x4c3aa2[_0x21650e]={'$like':'%'+_0x48146a['query'][_0x582f('0x4b')]+'%'};return _0x4c3aa2;})});}_0x113773=_['merge']({},_0x113773,_0x48146a['options']);return _0x4fd6e0[_0x582f('0x56')](_0x113773);}})[_0x582f('0x18')](function(_0x4c2354){if(_0x4c2354){_0x4e5a86=_0x4c2354[_0x582f('0x34')];if(!_0x48146a['query'][_0x582f('0x47')]('nolimit')){_0x113773[_0x582f('0x13')]=qs[_0x582f('0x13')](_0x48146a[_0x582f('0x2a')][_0x582f('0x13')]);_0x113773[_0x582f('0x11')]=qs['offset'](_0x48146a[_0x582f('0x2a')][_0x582f('0x11')]);}return _0x4fd6e0[_0x582f('0x56')](_0x113773);}})[_0x582f('0x18')](function(_0x1328f6){if(_0x1328f6){return _0x1328f6?{'count':_0x4e5a86,'rows':_0x1328f6}:null;}})[_0x582f('0x18')](respondWithResult(_0x5ef9c2,null))[_0x582f('0x39')](handleError(_0x5ef9c2,null));};exports[_0x582f('0x59')]=function(_0x7bf921,_0x29eb75){var _0x375047=_0x7bf921[_0x582f('0x43')][_0x582f('0x5a')];return db['Team'][_0x582f('0x4c')]({'where':{'id':_0x375047},'attributes':['id'],'include':[{'model':db['User'],'as':_0x582f('0x5b'),'attributes':['id','name',_0x582f('0x5c'),'voicePause',_0x582f('0x5d')],'raw':!![]}]})[_0x582f('0x18')](function(_0x3e35a0){if(_0x3e35a0){var _0x1128e4=_['flatMap'](_0x3e35a0,function(_0x3e1fbf){var _0x2b32ad=_0x3e1fbf[_0x582f('0x3c')]({'plain':!![]});return _0x2b32ad['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x7bf921[_0x582f('0x2d')]['id']}})[_0x582f('0x18')](function(_0xddd4){return db[_0x582f('0x5e')]['transaction'](function(_0x12e2ea){return _0xddd4['addTeams'](_0x375047,{'transaction':_0x12e2ea})[_0x582f('0x18')](function(){return BPromise[_0x582f('0x5f')](_0x1128e4,function(_0x15f38d){return db[_0x582f('0x46')]['findOrCreate']({'where':{'UserId':_0x15f38d['id'],'MailQueueId':_0x7bf921[_0x582f('0x2d')]['id']},'transaction':_0x12e2ea});});})['then'](function(){_0x1128e4[_0x582f('0x60')](function(_0x2d5fc4){socket[_0x582f('0x61')](_0x582f('0x62'),{'UserId':_0x2d5fc4['id'],'MailQueueId':_0xddd4['id']});});});});});}})[_0x582f('0x18')](respondWithStatusCode(_0x29eb75,null))[_0x582f('0x39')](handleError(_0x29eb75,null));};exports[_0x582f('0x63')]=function(_0x298197,_0x666fe1){return db[_0x582f('0x64')][_0x582f('0x4c')]({'where':{'id':_0x298197[_0x582f('0x2a')][_0x582f('0x5a')]},'attributes':['id'],'include':[{'model':db[_0x582f('0x65')],'as':_0x582f('0x5b'),'attributes':['id'],'raw':!![]}]})[_0x582f('0x18')](handleEntityNotFound(_0x666fe1,null))['then'](function(_0x415781){var _0xb83928=_['map'](_0x415781,'id');var _0x398937=[];var _0x4e708b=[];var _0x44a53a=squel[_0x582f('0x66')]();_0x44a53a['field'](_0x582f('0x67'))['from'](_0x582f('0x68'),'tq')[_0x582f('0x69')]('user_has_teams','ut',_0x582f('0x6a'))[_0x582f('0x28')](_0x582f('0x6b'),_0x298197[_0x582f('0x2d')]['id']);for(var _0x1f3abf=0x0;_0x1f3abf<_0x415781[_0x582f('0x34')];_0x1f3abf+=0x1){let _0x58874d=_0x415781[_0x1f3abf];for(var _0xb770b6=0x0;_0xb770b6<_0x58874d['Agents'][_0x582f('0x34')];_0xb770b6+=0x1){let _0x6cb5a6=_0x58874d[_0x582f('0x5b')][_0xb770b6];var _0xdbf916=_0x44a53a[_0x582f('0x6c')]();_0xdbf916[_0x582f('0x28')](_0x582f('0x6d'),_0x6cb5a6['id']);_0x4e708b[_0x582f('0x6e')](db[_0x582f('0x5e')][_0x582f('0x2a')](_0xdbf916[_0x582f('0x6f')](),{'type':db['sequelize'][_0x582f('0x70')]['SELECT']})['then'](function(_0xc8a01c){if(_0xc8a01c[_0x582f('0x34')]===0x1){return _0x6cb5a6['id'];}else{var _0x32dbb7=_[_0x582f('0x71')](_['map'](_0xc8a01c,'TeamId'),function(_0x2edbc5){return _[_0x582f('0x72')](_0xb83928,_0x2edbc5);});if(_0x32dbb7){return _0x6cb5a6['id'];}}}));}}return BPromise[_0x582f('0x73')](_0x4e708b)[_0x582f('0x18')](function(_0x5f1559){_0x398937=_(_0x398937)[_0x582f('0x74')](_0x5f1559)[_0x582f('0x75')]()[_0x582f('0x76')]();return db[_0x582f('0x22')]['find']({'where':{'id':_0x298197[_0x582f('0x2d')]['id']}})[_0x582f('0x18')](function(_0x502fca){return db[_0x582f('0x5e')][_0x582f('0x77')](function(_0x182410){return _0x502fca[_0x582f('0x63')](_0x298197[_0x582f('0x2a')][_0x582f('0x5a')],{'transaction':_0x182410})['then'](function(){if(!_[_0x582f('0x78')](_0x398937)){return _0x502fca[_0x582f('0x79')](_0x398937,{'transaction':_0x182410});}})['then'](function(){_0x398937['forEach'](function(_0x171f88){socket[_0x582f('0x61')]('userMailQueue:remove',{'UserId':_0x171f88,'MailQueueId':_0x502fca['id']});});});});});});})[_0x582f('0x18')](respondWithStatusCode(_0x666fe1,null))[_0x582f('0x39')](handleError(_0x666fe1,null));};exports[_0x582f('0x7a')]=function(_0x1abb39,_0x5871e8){return db['MailQueue']['find']({'where':{'id':_0x1abb39[_0x582f('0x2d')]['id']}})[_0x582f('0x18')](handleEntityNotFound(_0x5871e8,null))[_0x582f('0x18')](function(_0x156b1f){if(_0x156b1f){return _0x156b1f[_0x582f('0x7a')](_0x1abb39['body'][_0x582f('0x5a')],_[_0x582f('0x7b')](_0x1abb39['body'],[_0x582f('0x5a'),'id'])||{})['spread'](function(_0x5a4ac5){for(var _0x3c536f=0x0;_0x3c536f<_0x1abb39[_0x582f('0x43')][_0x582f('0x5a')][_0x582f('0x34')];_0x3c536f+=0x1){socket['emit'](_0x582f('0x62'),{'UserId':Number(_0x1abb39[_0x582f('0x43')][_0x582f('0x5a')][_0x3c536f]),'MailQueueId':Number(_0x1abb39[_0x582f('0x2d')]['id'])});}return _0x5a4ac5;});}})[_0x582f('0x18')](respondWithResult(_0x5871e8,null))[_0x582f('0x39')](handleError(_0x5871e8,null));};exports['removeAgents']=function(_0x2b2dd4,_0x1c04bf){return db[_0x582f('0x22')][_0x582f('0x38')]({'where':{'id':_0x2b2dd4[_0x582f('0x2d')]['id']}})[_0x582f('0x18')](handleEntityNotFound(_0x1c04bf,null))[_0x582f('0x18')](function(_0x35a309){if(_0x35a309){return _0x35a309[_0x582f('0x79')](_0x2b2dd4['query'][_0x582f('0x5a')])[_0x582f('0x18')](function(){if(_['isArray'](_0x2b2dd4[_0x582f('0x2a')][_0x582f('0x5a')])){for(var _0x12d2bc=0x0;_0x12d2bc<_0x2b2dd4['query']['ids'][_0x582f('0x34')];_0x12d2bc+=0x1){socket['emit'](_0x582f('0x7c'),{'UserId':Number(_0x2b2dd4[_0x582f('0x2a')][_0x582f('0x5a')][_0x12d2bc]),'MailQueueId':Number(_0x2b2dd4[_0x582f('0x2d')]['id'])});}}else{socket[_0x582f('0x61')](_0x582f('0x7c'),{'UserId':Number(_0x2b2dd4['query'][_0x582f('0x5a')]),'MailQueueId':Number(_0x2b2dd4[_0x582f('0x2d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c04bf,null))[_0x582f('0x39')](handleError(_0x1c04bf,null));};exports['getAgents']=function(_0x192ac2,_0x1f109){var _0x1faaf7={};var _0x4089f1={};var _0x3f1d8d;var _0x3decd9;return db[_0x582f('0x22')]['findOne']({'where':{'id':_0x192ac2[_0x582f('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1f109,null))[_0x582f('0x18')](function(_0x1273f9){if(_0x1273f9){_0x3f1d8d=_0x1273f9;_0x4089f1[_0x582f('0x31')]=_['keys'](db[_0x582f('0x65')]['rawAttributes']);_0x4089f1['query']=_['keys'](_0x192ac2[_0x582f('0x2a')]);_0x4089f1[_0x582f('0x2f')]=_[_0x582f('0x30')](_0x4089f1[_0x582f('0x31')],_0x4089f1[_0x582f('0x2a')]);_0x1faaf7[_0x582f('0x32')]=_[_0x582f('0x30')](_0x4089f1[_0x582f('0x31')],qs[_0x582f('0x33')](_0x192ac2['query'][_0x582f('0x33')]));_0x1faaf7[_0x582f('0x32')]=_0x1faaf7[_0x582f('0x32')][_0x582f('0x34')]?_0x1faaf7[_0x582f('0x32')]:_0x4089f1[_0x582f('0x31')];_0x1faaf7[_0x582f('0x57')]=qs[_0x582f('0x49')](_0x192ac2[_0x582f('0x2a')]['sort']);_0x1faaf7[_0x582f('0x28')]=qs[_0x582f('0x2f')](_[_0x582f('0x58')](_0x192ac2['query'],_0x4089f1[_0x582f('0x2f')]));if(_0x192ac2[_0x582f('0x2a')][_0x582f('0x4b')]){_0x1faaf7[_0x582f('0x28')]=_[_0x582f('0x36')](_0x1faaf7['where'],{'$or':_['map'](_0x1faaf7[_0x582f('0x32')],function(_0x54aa48){var _0x5ba235={};_0x5ba235[_0x54aa48]={'$like':'%'+_0x192ac2[_0x582f('0x2a')][_0x582f('0x4b')]+'%'};return _0x5ba235;})});}_0x1faaf7=_[_0x582f('0x36')]({},_0x1faaf7,_0x192ac2[_0x582f('0x37')]);return _0x3f1d8d['getAgents'](_0x1faaf7);}})[_0x582f('0x18')](function(_0x1f6a67){if(_0x1f6a67){_0x3decd9=_0x1f6a67[_0x582f('0x34')];if(!_0x192ac2[_0x582f('0x2a')]['hasOwnProperty'](_0x582f('0x48'))){_0x1faaf7[_0x582f('0x13')]=qs[_0x582f('0x13')](_0x192ac2[_0x582f('0x2a')][_0x582f('0x13')]);_0x1faaf7[_0x582f('0x11')]=qs[_0x582f('0x11')](_0x192ac2[_0x582f('0x2a')][_0x582f('0x11')]);}return _0x3f1d8d['getAgents'](_0x1faaf7);}})['then'](function(_0x33777c){if(_0x33777c){return _0x33777c?{'count':_0x3decd9,'rows':_0x33777c}:null;}})[_0x582f('0x18')](respondWithResult(_0x1f109,null))['catch'](handleError(_0x1f109,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c58be10..bf20df3 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 _0xc0c2=['exports','events','../../mysqldb','MailQueue','setMaxListeners','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc0c2,0x151));var _0x2c0c=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0xc0c2[_0x533e4e];return _0x1f14bb;};'use strict';var EventEmitter=require(_0x2c0c('0x0'));var MailQueue=require(_0x2c0c('0x1'))['db'][_0x2c0c('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x2c0c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2c0c('0x4')};function emitEvent(_0x265dff){return function(_0xab4efb,_0x27b0cf,_0x46dc27){MailQueueEvents['emit'](_0x265dff+':'+_0xab4efb['id'],_0xab4efb);MailQueueEvents[_0x2c0c('0x5')](_0x265dff,_0xab4efb);_0x46dc27(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x2c0c('0x6')]=MailQueueEvents; \ No newline at end of file +var _0x6a3a=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x3a788d,_0x5ab075){var _0x47956a=function(_0x97f79d){while(--_0x97f79d){_0x3a788d['push'](_0x3a788d['shift']());}};_0x47956a(++_0x5ab075);}(_0x6a3a,0x69));var _0xa6a3=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x6a3a[_0x1a7846];return _0x48049;};'use strict';var EventEmitter=require(_0xa6a3('0x0'));var MailQueue=require(_0xa6a3('0x1'))['db'][_0xa6a3('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa6a3('0x3')](0x0);var events={'afterCreate':_0xa6a3('0x4'),'afterUpdate':_0xa6a3('0x5'),'afterDestroy':_0xa6a3('0x6')};function emitEvent(_0x33f213){return function(_0x39cc3f,_0xcde649,_0x571527){MailQueueEvents[_0xa6a3('0x7')](_0x33f213+':'+_0x39cc3f['id'],_0x39cc3f);MailQueueEvents['emit'](_0x33f213,_0x39cc3f);_0x571527(null);};}for(var e in events){if(events[_0xa6a3('0x8')](e)){var event=events[e];MailQueue[_0xa6a3('0x9')](e,emitEvent(event));}}module[_0xa6a3('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f56e20d..707c553 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 _0xf807=['rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0xf807,0x1cd));var _0x7f80=function(_0x487a0b,_0x33c302){_0x487a0b=_0x487a0b-0x0;var _0x4cb1ba=_0xf807[_0x487a0b];return _0x4cb1ba;};'use strict';var _=require(_0x7f80('0x0'));var util=require(_0x7f80('0x1'));var logger=require(_0x7f80('0x2'))(_0x7f80('0x3'));var moment=require(_0x7f80('0x4'));var BPromise=require(_0x7f80('0x5'));var rp=require(_0x7f80('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f80('0x7'));var config=require('../../config/environment');var attributes=require(_0x7f80('0x8'));module[_0x7f80('0x9')]=function(_0x13f9b4,_0x49ec50){return _0x13f9b4[_0x7f80('0xa')](_0x7f80('0xb'),attributes,{'tableName':_0x7f80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd9f=['bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','util','api','moment'];(function(_0x58044c,_0x14a89a){var _0xda7e=function(_0x41fc4b){while(--_0x41fc4b){_0x58044c['push'](_0x58044c['shift']());}};_0xda7e(++_0x14a89a);}(_0xfd9f,0x1aa));var _0xffd9=function(_0x39414d,_0x26b932){_0x39414d=_0x39414d-0x0;var _0x5e2c82=_0xfd9f[_0x39414d];return _0x5e2c82;};'use strict';var _=require('lodash');var util=require(_0xffd9('0x0'));var logger=require('../../config/logger')(_0xffd9('0x1'));var moment=require(_0xffd9('0x2'));var BPromise=require(_0xffd9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffd9('0x4'));var rimraf=require(_0xffd9('0x5'));var config=require(_0xffd9('0x6'));var attributes=require(_0xffd9('0x7'));module[_0xffd9('0x8')]=function(_0x148c76,_0x2da9e1){return _0x148c76[_0xffd9('0x9')](_0xffd9('0xa'),attributes,{'tableName':'mail_queues','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 fc8b5a3..06a5895 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 _0xfacc=['error','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowMailQueue','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3aacd1,_0x13b72e){var _0xec5062=function(_0x3ddaad){while(--_0x3ddaad){_0x3aacd1['push'](_0x3aacd1['shift']());}};_0xec5062(++_0x13b72e);}(_0xfacc,0x8a));var _0xcfac=function(_0x4d5e00,_0x4d3c5d){_0x4d5e00=_0x4d5e00-0x0;var _0x3fe9b2=_0xfacc[_0x4d5e00];return _0x3fe9b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcfac('0x0'));var BPromise=require(_0xcfac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfac('0x2'));var db=require(_0xcfac('0x3'))['db'];var utils=require(_0xcfac('0x4'));var logger=require(_0xcfac('0x5'))('rpc');var config=require(_0xcfac('0x6'));var jayson=require(_0xcfac('0x7'));var client=jayson[_0xcfac('0x8')]['http']({'port':0x232a});config['redis']=_[_0xcfac('0x9')](config['redis'],{'host':_0xcfac('0xa'),'port':0x18eb});var socket=require(_0xcfac('0xb'))(new Redis(config[_0xcfac('0xc')]));require(_0xcfac('0xd'))[_0xcfac('0xe')](socket);function respondWithRpcPromise(_0x4cdc99,_0x5c2f9d,_0x1dfab3){return new BPromise(function(_0x4645ed,_0x366bd8){return client[_0xcfac('0xf')](_0x4cdc99,_0x1dfab3)[_0xcfac('0x10')](function(_0x1736d8){logger[_0xcfac('0x11')](_0xcfac('0x12'),_0x5c2f9d,_0xcfac('0x13'));logger[_0xcfac('0x14')](_0xcfac('0x15'),_0x5c2f9d,_0xcfac('0x13'),JSON['stringify'](_0x1736d8));if(_0x1736d8[_0xcfac('0x16')]){if(_0x1736d8[_0xcfac('0x16')]['code']===0x1f4){logger[_0xcfac('0x16')](_0xcfac('0x12'),_0x5c2f9d,_0x1736d8[_0xcfac('0x16')][_0xcfac('0x17')]);return _0x366bd8(_0x1736d8['error'][_0xcfac('0x17')]);}logger[_0xcfac('0x16')](_0xcfac('0x12'),_0x5c2f9d,_0x1736d8[_0xcfac('0x16')]['message']);return _0x4645ed(_0x1736d8[_0xcfac('0x16')][_0xcfac('0x17')]);}else{logger['info'](_0xcfac('0x12'),_0x5c2f9d,_0xcfac('0x13'));_0x4645ed(_0x1736d8[_0xcfac('0x18')][_0xcfac('0x17')]);}})[_0xcfac('0x19')](function(_0x143187){logger[_0xcfac('0x16')](_0xcfac('0x12'),_0x5c2f9d,_0x143187);_0x366bd8(_0x143187);});});}exports[_0xcfac('0x1a')]=function(_0x59168a){var _0x426126=this;return new Promise(function(_0x36bc98,_0x10228b){return db[_0xcfac('0x1b')][_0xcfac('0x1c')]({'raw':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')][_0xcfac('0x1e')]===undefined?!![]:![]:!![],'where':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')][_0xcfac('0x1f')]||null:null,'attributes':_0x59168a[_0xcfac('0x1d')]?_0x59168a['options'][_0xcfac('0x20')]||null:null,'limit':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')][_0xcfac('0x21')]||null:null,'include':_0x59168a[_0xcfac('0x1d')]?_0x59168a[_0xcfac('0x1d')]['include']?_[_0xcfac('0x22')](_0x59168a[_0xcfac('0x1d')][_0xcfac('0x23')],function(_0x45f028){return{'model':db[_0x45f028[_0xcfac('0x24')]],'as':_0x45f028['as'],'attributes':_0x45f028[_0xcfac('0x20')],'include':_0x45f028['include']?_[_0xcfac('0x22')](_0x45f028[_0xcfac('0x23')],function(_0x2d89be){return{'model':db[_0x2d89be[_0xcfac('0x24')]],'as':_0x2d89be['as'],'attributes':_0x2d89be[_0xcfac('0x20')],'include':_0x2d89be[_0xcfac('0x23')]?_[_0xcfac('0x22')](_0x2d89be['include'],function(_0x5b71a4){return{'model':db[_0x5b71a4[_0xcfac('0x24')]],'as':_0x5b71a4['as'],'attributes':_0x5b71a4[_0xcfac('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcfac('0x10')](function(_0x4f8ee2){logger[_0xcfac('0x11')](_0xcfac('0x1a'),_0x59168a);logger['debug'](_0xcfac('0x1a'),_0x59168a,JSON[_0xcfac('0x25')](_0x4f8ee2));_0x36bc98(_0x4f8ee2);})[_0xcfac('0x19')](function(_0x495e96){logger[_0xcfac('0x16')]('GetMailQueue',_0x495e96[_0xcfac('0x17')],_0x59168a);_0x10228b(_0x426126[_0xcfac('0x16')](0x1f4,_0x495e96[_0xcfac('0x17')]));});});};exports[_0xcfac('0x26')]=function(_0x284f5a){var _0x363777=this;return new Promise(function(_0x4c8df0,_0x59ddcb){return db[_0xcfac('0x1b')][_0xcfac('0x27')]({'raw':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')][_0xcfac('0x1e')]===undefined?!![]:![]:!![],'where':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')][_0xcfac('0x1f')]||null:null,'attributes':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')]['attributes']||null:null,'include':_0x284f5a[_0xcfac('0x1d')]?_0x284f5a[_0xcfac('0x1d')]['include']?_['map'](_0x284f5a[_0xcfac('0x1d')][_0xcfac('0x23')],function(_0x580e51){return{'model':db[_0x580e51[_0xcfac('0x24')]],'as':_0x580e51['as'],'attributes':_0x580e51[_0xcfac('0x20')],'include':_0x580e51[_0xcfac('0x23')]?_[_0xcfac('0x22')](_0x580e51[_0xcfac('0x23')],function(_0x2aea2f){return{'model':db[_0x2aea2f[_0xcfac('0x24')]],'as':_0x2aea2f['as'],'attributes':_0x2aea2f[_0xcfac('0x20')],'include':_0x2aea2f['include']?_[_0xcfac('0x22')](_0x2aea2f[_0xcfac('0x23')],function(_0x15ad04){return{'model':db[_0x15ad04[_0xcfac('0x24')]],'as':_0x15ad04['as'],'attributes':_0x15ad04['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47b737){logger[_0xcfac('0x11')](_0xcfac('0x26'),_0x284f5a);logger['debug'](_0xcfac('0x26'),_0x284f5a,JSON[_0xcfac('0x25')](_0x47b737));_0x4c8df0(_0x47b737);})['catch'](function(_0x2b30be){logger['error'](_0xcfac('0x26'),_0x2b30be[_0xcfac('0x17')],_0x284f5a);_0x59ddcb(_0x363777[_0xcfac('0x16')](0x1f4,_0x2b30be[_0xcfac('0x17')]));});});}; \ No newline at end of file +var _0x62e4=['stringify','code','error','message','info','result','catch','MailQueue','findAll','options','where','attributes','limit','include','model','map','GetMailQueue','ShowMailQueue','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xc0018e,_0x4f51a6){var _0xbcae25=function(_0x5b64c7){while(--_0x5b64c7){_0xc0018e['push'](_0xc0018e['shift']());}};_0xbcae25(++_0x4f51a6);}(_0x62e4,0x12b));var _0x462e=function(_0x570869,_0x20481f){_0x570869=_0x570869-0x0;var _0x39629c=_0x62e4[_0x570869];return _0x39629c;};'use strict';var _=require(_0x462e('0x0'));var util=require(_0x462e('0x1'));var moment=require(_0x462e('0x2'));var BPromise=require('bluebird');var rs=require(_0x462e('0x3'));var fs=require('fs');var Redis=require(_0x462e('0x4'));var db=require(_0x462e('0x5'))['db'];var utils=require(_0x462e('0x6'));var logger=require(_0x462e('0x7'))(_0x462e('0x8'));var config=require(_0x462e('0x9'));var jayson=require(_0x462e('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x462e('0xb')]=_[_0x462e('0xc')](config[_0x462e('0xb')],{'host':_0x462e('0xd'),'port':0x18eb});var socket=require(_0x462e('0xe'))(new Redis(config['redis']));require(_0x462e('0xf'))['register'](socket);function respondWithRpcPromise(_0x26820f,_0x3ea257,_0x363685){return new BPromise(function(_0x156543,_0x261186){return client[_0x462e('0x10')](_0x26820f,_0x363685)[_0x462e('0x11')](function(_0x4e9446){logger['info'](_0x462e('0x12'),_0x3ea257,_0x462e('0x13'));logger[_0x462e('0x14')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x3ea257,'request\x20sent',JSON[_0x462e('0x15')](_0x4e9446));if(_0x4e9446['error']){if(_0x4e9446['error'][_0x462e('0x16')]===0x1f4){logger['error'](_0x462e('0x12'),_0x3ea257,_0x4e9446[_0x462e('0x17')][_0x462e('0x18')]);return _0x261186(_0x4e9446[_0x462e('0x17')][_0x462e('0x18')]);}logger[_0x462e('0x17')]('MailQueue,\x20%s,\x20%s',_0x3ea257,_0x4e9446['error'][_0x462e('0x18')]);return _0x156543(_0x4e9446[_0x462e('0x17')][_0x462e('0x18')]);}else{logger[_0x462e('0x19')](_0x462e('0x12'),_0x3ea257,'request\x20sent');_0x156543(_0x4e9446[_0x462e('0x1a')][_0x462e('0x18')]);}})[_0x462e('0x1b')](function(_0x524cc8){logger[_0x462e('0x17')](_0x462e('0x12'),_0x3ea257,_0x524cc8);_0x261186(_0x524cc8);});});}exports['GetMailQueue']=function(_0x457827){var _0xb6256e=this;return new Promise(function(_0x55101d,_0x5a3393){return db[_0x462e('0x1c')][_0x462e('0x1d')]({'raw':_0x457827[_0x462e('0x1e')]?_0x457827['options']['raw']===undefined?!![]:![]:!![],'where':_0x457827[_0x462e('0x1e')]?_0x457827[_0x462e('0x1e')][_0x462e('0x1f')]||null:null,'attributes':_0x457827['options']?_0x457827['options'][_0x462e('0x20')]||null:null,'limit':_0x457827[_0x462e('0x1e')]?_0x457827[_0x462e('0x1e')][_0x462e('0x21')]||null:null,'include':_0x457827[_0x462e('0x1e')]?_0x457827['options'][_0x462e('0x22')]?_['map'](_0x457827[_0x462e('0x1e')]['include'],function(_0x46a1cf){return{'model':db[_0x46a1cf['model']],'as':_0x46a1cf['as'],'attributes':_0x46a1cf[_0x462e('0x20')],'include':_0x46a1cf[_0x462e('0x22')]?_['map'](_0x46a1cf[_0x462e('0x22')],function(_0xf74972){return{'model':db[_0xf74972[_0x462e('0x23')]],'as':_0xf74972['as'],'attributes':_0xf74972['attributes'],'include':_0xf74972[_0x462e('0x22')]?_[_0x462e('0x24')](_0xf74972[_0x462e('0x22')],function(_0x3eaa25){return{'model':db[_0x3eaa25[_0x462e('0x23')]],'as':_0x3eaa25['as'],'attributes':_0x3eaa25[_0x462e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x462e('0x11')](function(_0x4aa176){logger[_0x462e('0x19')]('GetMailQueue',_0x457827);logger[_0x462e('0x14')](_0x462e('0x25'),_0x457827,JSON[_0x462e('0x15')](_0x4aa176));_0x55101d(_0x4aa176);})['catch'](function(_0x141a89){logger[_0x462e('0x17')]('GetMailQueue',_0x141a89[_0x462e('0x18')],_0x457827);_0x5a3393(_0xb6256e[_0x462e('0x17')](0x1f4,_0x141a89[_0x462e('0x18')]));});});};exports[_0x462e('0x26')]=function(_0x5101ba){var _0x1806cc=this;return new Promise(function(_0x2a28e1,_0x15d74f){return db['MailQueue']['find']({'raw':_0x5101ba[_0x462e('0x1e')]?_0x5101ba[_0x462e('0x1e')][_0x462e('0x27')]===undefined?!![]:![]:!![],'where':_0x5101ba[_0x462e('0x1e')]?_0x5101ba[_0x462e('0x1e')][_0x462e('0x1f')]||null:null,'attributes':_0x5101ba[_0x462e('0x1e')]?_0x5101ba[_0x462e('0x1e')][_0x462e('0x20')]||null:null,'include':_0x5101ba[_0x462e('0x1e')]?_0x5101ba[_0x462e('0x1e')][_0x462e('0x22')]?_[_0x462e('0x24')](_0x5101ba[_0x462e('0x1e')]['include'],function(_0x1fbc88){return{'model':db[_0x1fbc88[_0x462e('0x23')]],'as':_0x1fbc88['as'],'attributes':_0x1fbc88['attributes'],'include':_0x1fbc88[_0x462e('0x22')]?_['map'](_0x1fbc88[_0x462e('0x22')],function(_0x46c2da){return{'model':db[_0x46c2da[_0x462e('0x23')]],'as':_0x46c2da['as'],'attributes':_0x46c2da[_0x462e('0x20')],'include':_0x46c2da[_0x462e('0x22')]?_[_0x462e('0x24')](_0x46c2da[_0x462e('0x22')],function(_0x15a52a){return{'model':db[_0x15a52a['model']],'as':_0x15a52a['as'],'attributes':_0x15a52a[_0x462e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x462e('0x11')](function(_0xded2f){logger[_0x462e('0x19')](_0x462e('0x26'),_0x5101ba);logger[_0x462e('0x14')]('ShowMailQueue',_0x5101ba,JSON[_0x462e('0x15')](_0xded2f));_0x2a28e1(_0xded2f);})['catch'](function(_0x592883){logger[_0x462e('0x17')]('ShowMailQueue',_0x592883[_0x462e('0x18')],_0x5101ba);_0x15d74f(_0x1806cc['error'](0x1f4,_0x592883[_0x462e('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index ca43a5b..152c4ff 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 _0xc125=['save','update','emit','removeListener','length','mailQueue:','./mailQueue.events'];(function(_0x12c280,_0x51dd07){var _0x3638d3=function(_0x53b273){while(--_0x53b273){_0x12c280['push'](_0x12c280['shift']());}};_0x3638d3(++_0x51dd07);}(_0xc125,0x19c));var _0x5c12=function(_0x582467,_0x553c42){_0x582467=_0x582467-0x0;var _0x1919a0=_0xc125[_0x582467];return _0x1919a0;};'use strict';var MailQueueEvents=require(_0x5c12('0x0'));var events=[_0x5c12('0x1'),'remove',_0x5c12('0x2')];function createListener(_0x70a5db,_0x4a568c){return function(_0x16aced){_0x4a568c[_0x5c12('0x3')](_0x70a5db,_0x16aced);};}function removeListener(_0x2a26bc,_0x5ae246){return function(){MailQueueEvents[_0x5c12('0x4')](_0x2a26bc,_0x5ae246);};}exports['register']=function(_0x221d83){for(var _0x4bfd21=0x0,_0x22bff5=events[_0x5c12('0x5')];_0x4bfd21<_0x22bff5;_0x4bfd21++){var _0x19d2a0=events[_0x4bfd21];var _0x4853fc=createListener(_0x5c12('0x6')+_0x19d2a0,_0x221d83);MailQueueEvents['on'](_0x19d2a0,_0x4853fc);}}; \ No newline at end of file +var _0xa264=['remove','update','emit','removeListener','register','length','./mailQueue.events'];(function(_0x5dca17,_0x43cdb8){var _0xcc7f0c=function(_0x3c0ca2){while(--_0x3c0ca2){_0x5dca17['push'](_0x5dca17['shift']());}};_0xcc7f0c(++_0x43cdb8);}(_0xa264,0x148));var _0x4a26=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xa264[_0x411017];return _0x2adeea;};'use strict';var MailQueueEvents=require(_0x4a26('0x0'));var events=['save',_0x4a26('0x1'),_0x4a26('0x2')];function createListener(_0x411121,_0x1946e7){return function(_0x2cfc52){_0x1946e7[_0x4a26('0x3')](_0x411121,_0x2cfc52);};}function removeListener(_0x511409,_0x9084fe){return function(){MailQueueEvents[_0x4a26('0x4')](_0x511409,_0x9084fe);};}exports[_0x4a26('0x5')]=function(_0x449d3d){for(var _0x204ec0=0x0,_0x38f0dd=events[_0x4a26('0x6')];_0x204ec0<_0x38f0dd;_0x204ec0++){var _0x5f3886=events[_0x204ec0];var _0x6c431b=createListener('mailQueue:'+_0x5f3886,_0x449d3d);MailQueueEvents['on'](_0x5f3886,_0x6c431b);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0b920c5..476f8d6 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 _0x4bc5=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x46c318,_0x3a5b3f){var _0x143050=function(_0x38a645){while(--_0x38a645){_0x46c318['push'](_0x46c318['shift']());}};_0x143050(++_0x3a5b3f);}(_0x4bc5,0x11b));var _0x54bc=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x4bc5[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require(_0x54bc('0x0'));var util=require('util');var path=require(_0x54bc('0x1'));var timeout=require(_0x54bc('0x2'));var express=require(_0x54bc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x54bc('0x4'));var interaction=require(_0x54bc('0x5'));var config=require('../../config/environment');var controller=require(_0x54bc('0x6'));router[_0x54bc('0x7')]('/',auth[_0x54bc('0x8')](),controller[_0x54bc('0x9')]);router[_0x54bc('0x7')](_0x54bc('0xa'),auth[_0x54bc('0x8')](),controller[_0x54bc('0xb')]);router['get'](_0x54bc('0xc'),auth['isAuthenticated'](),controller[_0x54bc('0xd')]);router[_0x54bc('0xe')]('/',auth['isAuthenticated'](),controller[_0x54bc('0xf')]);router[_0x54bc('0x10')](_0x54bc('0xc'),auth[_0x54bc('0x8')](),controller[_0x54bc('0x11')]);router[_0x54bc('0x12')]('/:id',auth[_0x54bc('0x8')](),controller[_0x54bc('0x13')]);module[_0x54bc('0x14')]=router; \ No newline at end of file +var _0xea1d=['isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x49f916,_0x3819ed){var _0x1bdaa5=function(_0x5c265c){while(--_0x5c265c){_0x49f916['push'](_0x49f916['shift']());}};_0x1bdaa5(++_0x3819ed);}(_0xea1d,0x90));var _0xdea1=function(_0x31647c,_0x42fb69){_0x31647c=_0x31647c-0x0;var _0x5a30dd=_0xea1d[_0x31647c];return _0x5a30dd;};'use strict';var multer=require(_0xdea1('0x0'));var util=require(_0xdea1('0x1'));var path=require(_0xdea1('0x2'));var timeout=require(_0xdea1('0x3'));var express=require('express');var router=express[_0xdea1('0x4')]();var fs_extra=require(_0xdea1('0x5'));var auth=require(_0xdea1('0x6'));var interaction=require(_0xdea1('0x7'));var config=require(_0xdea1('0x8'));var controller=require('./mailQueueReport.controller');router[_0xdea1('0x9')]('/',auth[_0xdea1('0xa')](),controller[_0xdea1('0xb')]);router[_0xdea1('0x9')](_0xdea1('0xc'),auth[_0xdea1('0xa')](),controller[_0xdea1('0xd')]);router[_0xdea1('0x9')](_0xdea1('0xe'),auth[_0xdea1('0xa')](),controller[_0xdea1('0xf')]);router[_0xdea1('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdea1('0x11')](_0xdea1('0xe'),auth['isAuthenticated'](),controller[_0xdea1('0x12')]);router[_0xdea1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xdea1('0x14')]);module[_0xdea1('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index adbd847..7c2ca74 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 _0xf220=['exports','STRING','DATE','sequelize'];(function(_0x16f6f6,_0x5d6f57){var _0x15d80a=function(_0x3876d2){while(--_0x3876d2){_0x16f6f6['push'](_0x16f6f6['shift']());}};_0x15d80a(++_0x5d6f57);}(_0xf220,0x113));var _0x0f22=function(_0x305351,_0x36103c){_0x305351=_0x305351-0x0;var _0x16a638=_0xf220[_0x305351];return _0x16a638;};'use strict';var moment=require('moment');var Sequelize=require(_0x0f22('0x0'));module[_0x0f22('0x1')]={'uniqueid':{'type':Sequelize[_0x0f22('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0f22('0x2')]},'joinAt':{'type':Sequelize[_0x0f22('0x3')]},'leaveAt':{'type':Sequelize[_0x0f22('0x3')]},'acceptAt':{'type':Sequelize[_0x0f22('0x3')]},'exitAt':{'type':Sequelize[_0x0f22('0x3')]},'reason':{'type':Sequelize[_0x0f22('0x2')]}}; \ No newline at end of file +var _0x3561=['moment','exports','STRING','DATE'];(function(_0x20183c,_0x3789a8){var _0xb1c1f2=function(_0x21a6e2){while(--_0x21a6e2){_0x20183c['push'](_0x20183c['shift']());}};_0xb1c1f2(++_0x3789a8);}(_0x3561,0x94));var _0x1356=function(_0x198d00,_0x392f9c){_0x198d00=_0x198d00-0x0;var _0x66c697=_0x3561[_0x198d00];return _0x66c697;};'use strict';var moment=require(_0x1356('0x0'));var Sequelize=require('sequelize');module[_0x1356('0x1')]={'uniqueid':{'type':Sequelize[_0x1356('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1356('0x2')]},'joinAt':{'type':Sequelize[_0x1356('0x3')]},'leaveAt':{'type':Sequelize[_0x1356('0x3')]},'acceptAt':{'type':Sequelize[_0x1356('0x3')]},'exitAt':{'type':Sequelize[_0x1356('0x3')]},'reason':{'type':Sequelize[_0x1356('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 073259a..03b6793 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 _0xbbbc=['query','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','params','keys','filters','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x40dc22,_0x21aa75){_0x40dc22=_0x40dc22-0x0;var _0x413c19=_0xbbbc[_0x40dc22];return _0x413c19;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x4ffa80,_0x48dfc4){return function(_0x575d56){if(!_0x575d56){_0x4ffa80[_0xcbbb('0x18')](0x194);}return _0x575d56;};}function handleError(_0x548440,_0x59c422){_0x59c422=_0x59c422||0x1f4;return function(_0x5499a1){logger[_0xcbbb('0x27')](_0x5499a1['stack']);if(_0x5499a1['name']){delete _0x5499a1[_0xcbbb('0x28')];}_0x548440[_0xcbbb('0x19')](_0x59c422)[_0xcbbb('0x29')](_0x5499a1);};}exports[_0xcbbb('0x2a')]=function(_0x372024,_0x39ba8b){var _0x3d4c0d={},_0x1c986d={},_0x2a023f={'count':0x0,'rows':[]};var _0x26c05e=_[_0xcbbb('0x2b')](db[_0xcbbb('0x2c')][_0xcbbb('0x2d')],function(_0x1ce741){return{'name':_0x1ce741[_0xcbbb('0x2e')],'type':_0x1ce741[_0xcbbb('0x2f')][_0xcbbb('0x30')]};});_0x1c986d[_0xcbbb('0x31')]=_['map'](_0x26c05e,_0xcbbb('0x28'));_0x1c986d[_0xcbbb('0x32')]=_['keys'](_0x372024[_0xcbbb('0x32')]);_0x1c986d['filters']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],_0x1c986d[_0xcbbb('0x32')]);_0x3d4c0d['attributes']=_[_0xcbbb('0x33')](_0x1c986d[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x3d4c0d[_0xcbbb('0x35')]=_0x3d4c0d[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x3d4c0d[_0xcbbb('0x35')]:_0x1c986d[_0xcbbb('0x31')];if(!_0x372024['query']['hasOwnProperty']('nolimit')){_0x3d4c0d['limit']=qs[_0xcbbb('0x1f')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1f')]);_0x3d4c0d[_0xcbbb('0x1c')]=qs[_0xcbbb('0x1c')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x1c')]);}_0x3d4c0d[_0xcbbb('0x37')]=qs[_0xcbbb('0x38')](_0x372024[_0xcbbb('0x32')][_0xcbbb('0x38')]);_0x3d4c0d[_0xcbbb('0x39')]=qs['filters'](_['pick'](_0x372024[_0xcbbb('0x32')],_0x1c986d['filters']),_0x26c05e);if(_0x372024['query']['filter']){_0x3d4c0d[_0xcbbb('0x39')]=_[_0xcbbb('0x3a')](_0x3d4c0d[_0xcbbb('0x39')],{'$or':_[_0xcbbb('0x2b')](_0x26c05e,function(_0x38e59d){if(_0x38e59d[_0xcbbb('0x2f')]!==_0xcbbb('0x3b')){var _0x14c1a2={};_0x14c1a2[_0x38e59d[_0xcbbb('0x28')]]={'$like':'%'+_0x372024[_0xcbbb('0x32')][_0xcbbb('0x3c')]+'%'};return _0x14c1a2;}})});}_0x3d4c0d=_['merge']({},_0x3d4c0d,_0x372024[_0xcbbb('0x3d')]);var _0x55d349={'where':_0x3d4c0d[_0xcbbb('0x39')]};return db[_0xcbbb('0x2c')][_0xcbbb('0x1e')](_0x55d349)[_0xcbbb('0x25')](function(_0x433065){_0x2a023f[_0xcbbb('0x1e')]=_0x433065;if(_0x372024['query']['includeAll']){_0x3d4c0d['include']=[{'all':!![]}];}return db[_0xcbbb('0x2c')][_0xcbbb('0x3e')](_0x3d4c0d);})[_0xcbbb('0x25')](function(_0x162979){_0x2a023f[_0xcbbb('0x3f')]=_0x162979;return _0x2a023f;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x39ba8b,_0x3d4c0d))[_0xcbbb('0x40')](handleError(_0x39ba8b,null));};exports['show']=function(_0x1a7799,_0x22076a){var _0x5550d2={'raw':!![],'where':{'id':_0x1a7799[_0xcbbb('0x41')]['id']}},_0x15b3bc={};_0x15b3bc[_0xcbbb('0x31')]=_[_0xcbbb('0x42')](db[_0xcbbb('0x2c')]['rawAttributes']);_0x15b3bc[_0xcbbb('0x32')]=_['keys'](_0x1a7799['query']);_0x15b3bc[_0xcbbb('0x43')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],_0x15b3bc[_0xcbbb('0x32')]);_0x5550d2[_0xcbbb('0x35')]=_[_0xcbbb('0x33')](_0x15b3bc[_0xcbbb('0x31')],qs[_0xcbbb('0x34')](_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x34')]));_0x5550d2[_0xcbbb('0x35')]=_0x5550d2[_0xcbbb('0x35')][_0xcbbb('0x36')]?_0x5550d2[_0xcbbb('0x35')]:_0x15b3bc['model'];if(_0x1a7799[_0xcbbb('0x32')][_0xcbbb('0x44')]){_0x5550d2[_0xcbbb('0x45')]=[{'all':!![]}];}_0x5550d2=_[_0xcbbb('0x3a')]({},_0x5550d2,_0x1a7799['options']);return db['MailQueueReport']['find'](_0x5550d2)[_0xcbbb('0x25')](handleEntityNotFound(_0x22076a,null))[_0xcbbb('0x25')](respondWithResult(_0x22076a,null))[_0xcbbb('0x40')](handleError(_0x22076a,null));};exports[_0xcbbb('0x46')]=function(_0x146f37,_0x1ef25b){return db[_0xcbbb('0x2c')]['create'](_0x146f37[_0xcbbb('0x47')],{})[_0xcbbb('0x25')](respondWithResult(_0x1ef25b,0xc9))[_0xcbbb('0x40')](handleError(_0x1ef25b,null));};exports[_0xcbbb('0x24')]=function(_0x478c22,_0x3378cd){if(_0x478c22[_0xcbbb('0x47')]['id']){delete _0x478c22[_0xcbbb('0x47')]['id'];}return db[_0xcbbb('0x2c')]['find']({'where':{'id':_0x478c22['params']['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3378cd,null))[_0xcbbb('0x25')](saveUpdates(_0x478c22[_0xcbbb('0x47')],null))['then'](respondWithResult(_0x3378cd,null))['catch'](handleError(_0x3378cd,null));};exports['destroy']=function(_0x189a40,_0x3070d9){return db['MailQueueReport'][_0xcbbb('0x48')]({'where':{'id':_0x189a40[_0xcbbb('0x41')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x3070d9,null))[_0xcbbb('0x25')](removeEntity(_0x3070d9,null))['catch'](handleError(_0x3070d9,null));};exports[_0xcbbb('0x49')]=function(_0x1e4bb0,_0x39640d){return db[_0xcbbb('0x2c')][_0xcbbb('0x49')]()[_0xcbbb('0x25')](respondWithResult(_0x39640d,null))[_0xcbbb('0x40')](handleError(_0x39640d,null));}; \ No newline at end of file +var _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0x7a54,0x106));var _0x47a5=function(_0x42a249,_0x4d4375){_0x42a249=_0x42a249-0x0;var _0x19dbd5=_0x7a54[_0x42a249];return _0x19dbd5;};'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['MailQueueReport'][_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['MailQueueReport']['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['MailQueueReport']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['MailQueueReport'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index eeee468..ff00bf1 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 _0x4e52=['uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue'];(function(_0x4b5bf1,_0x3a9485){var _0x48be71=function(_0x437109){while(--_0x437109){_0x4b5bf1['push'](_0x4b5bf1['shift']());}};_0x48be71(++_0x3a9485);}(_0x4e52,0x115));var _0x24e5=function(_0x5efc2e,_0x494a0b){_0x5efc2e=_0x5efc2e-0x0;var _0x3ba2c1=_0x4e52[_0x5efc2e];return _0x3ba2c1;};'use strict';var _=require('lodash');var util=require(_0x24e5('0x0'));var logger=require(_0x24e5('0x1'))('api');var moment=require(_0x24e5('0x2'));var BPromise=require(_0x24e5('0x3'));var rp=require(_0x24e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x24e5('0x5'));var config=require('../../config/environment');var attributes=require(_0x24e5('0x6'));module[_0x24e5('0x7')]=function(_0x5d5665,_0x443e75){return _0x5d5665[_0x24e5('0x8')](_0x24e5('0x9'),attributes,{'tableName':_0x24e5('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x24e5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa875=['MailQueueReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports'];(function(_0xd55a05,_0x2a2030){var _0x1e7679=function(_0x48a93a){while(--_0x48a93a){_0xd55a05['push'](_0xd55a05['shift']());}};_0x1e7679(++_0x2a2030);}(_0xa875,0x176));var _0x5a87=function(_0x26fc81,_0x57fc19){_0x26fc81=_0x26fc81-0x0;var _0x9feece=_0xa875[_0x26fc81];return _0x9feece;};'use strict';var _=require('lodash');var util=require(_0x5a87('0x0'));var logger=require(_0x5a87('0x1'))(_0x5a87('0x2'));var moment=require(_0x5a87('0x3'));var BPromise=require(_0x5a87('0x4'));var rp=require(_0x5a87('0x5'));var fs=require('fs');var path=require(_0x5a87('0x6'));var rimraf=require(_0x5a87('0x7'));var config=require('../../config/environment');var attributes=require(_0x5a87('0x8'));module[_0x5a87('0x9')]=function(_0x1707cc,_0x42fe59){return _0x1707cc['define'](_0x5a87('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x5a87('0xb'),'fields':[_0x5a87('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 0f13b30..bde7ed3 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x1f418a,_0x3336a1){var _0x261511=function(_0x1d8492){while(--_0x1d8492){_0x1f418a['push'](_0x1f418a['shift']());}};_0x261511(++_0x3336a1);}(_0x7a54,0x106));var _0x47a5=function(_0x4242c1,_0x3bfa6d){_0x4242c1=_0x4242c1-0x0;var _0x48aa94=_0x7a54[_0x4242c1];return _0x48aa94;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x4e6c17,_0x34f0e5){var _0x539f2e=function(_0x2ff44a){while(--_0x2ff44a){_0x4e6c17['push'](_0x4e6c17['shift']());}};_0x539f2e(++_0x34f0e5);}(_0x7a54,0x106));var _0x47a5=function(_0x13ae75,_0x323376){_0x13ae75=_0x13ae75-0x0;var _0x350ef6=_0x7a54[_0x13ae75];return _0x350ef6;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 68eeea5..2b40596 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x38a814,_0x339349){var _0x54b539=function(_0x2ded1c){while(--_0x2ded1c){_0x38a814['push'](_0x38a814['shift']());}};_0x54b539(++_0x339349);}(_0xe706,0xa3));var _0x6e70=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xe706[_0x1f5143];return _0x383a38;};'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 +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x435411,_0x6c15bf){var _0x1d207e=function(_0x1b8da4){while(--_0x1b8da4){_0x435411['push'](_0x435411['shift']());}};_0x1d207e(++_0x6c15bf);}(_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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 5a9e6d4..c2edf03 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 _0x7d8f=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x364471,_0x302e8a){var _0x59236f=function(_0x524944){while(--_0x524944){_0x364471['push'](_0x364471['shift']());}};_0x59236f(++_0x302e8a);}(_0x7d8f,0x178));var _0xf7d8=function(_0x11a95a,_0x3c4bbd){_0x11a95a=_0x11a95a-0x0;var _0x4e92ec=_0x7d8f[_0x11a95a];return _0x4e92ec;};'use strict';var Sequelize=require(_0xf7d8('0x0'));module[_0xf7d8('0x1')]={'description':{'type':Sequelize[_0xf7d8('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xf7d8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf7d8('0x4')]},'tls':{'type':Sequelize[_0xf7d8('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf7d8('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xf7d8('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf7d8('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf7d8('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x6a02=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a02,0x99));var _0x26a0=function(_0x2cf048,_0x5eb0e5){_0x2cf048=_0x2cf048-0x0;var _0x20d612=_0x6a02[_0x2cf048];return _0x20d612;};'use strict';var Sequelize=require(_0x26a0('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x26a0('0x1')]},'authentication':{'type':Sequelize[_0x26a0('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x26a0('0x1')]},'password':{'type':Sequelize[_0x26a0('0x1')]},'port':{'type':Sequelize[_0x26a0('0x3')]},'tls':{'type':Sequelize[_0x26a0('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x26a0('0x1')],'defaultValue':_0x26a0('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x26a0('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x26a0('0x1')]},'modernAuthentication':{'type':Sequelize[_0x26a0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7958ac2..cc74b12 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 _0x47e7=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x47e7,0x129));var _0x747e=function(_0xa4923a,_0x16d2f1){_0xa4923a=_0xa4923a-0x0;var _0x391b71=_0x47e7[_0xa4923a];return _0x391b71;};'use strict';var _=require(_0x747e('0x0'));var util=require(_0x747e('0x1'));var logger=require(_0x747e('0x2'))('api');var moment=require(_0x747e('0x3'));var BPromise=require(_0x747e('0x4'));var rp=require(_0x747e('0x5'));var fs=require('fs');var path=require(_0x747e('0x6'));var rimraf=require(_0x747e('0x7'));var config=require(_0x747e('0x8'));var attributes=require(_0x747e('0x9'));module[_0x747e('0xa')]=function(_0x3c7ddf,_0x1de9ea){return _0x3c7ddf['define'](_0x747e('0xb'),attributes,{'tableName':_0x747e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeff3=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x14cfa9,_0x2a805f){var _0x32be38=function(_0x51860d){while(--_0x51860d){_0x14cfa9['push'](_0x14cfa9['shift']());}};_0x32be38(++_0x2a805f);}(_0xeff3,0xe9));var _0x3eff=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0xeff3[_0x3124f8];return _0x5bab5f;};'use strict';var _=require(_0x3eff('0x0'));var util=require('util');var logger=require(_0x3eff('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3eff('0x2'));var rp=require(_0x3eff('0x3'));var fs=require('fs');var path=require(_0x3eff('0x4'));var rimraf=require(_0x3eff('0x5'));var config=require(_0x3eff('0x6'));var attributes=require(_0x3eff('0x7'));module[_0x3eff('0x8')]=function(_0x390b5d,_0x1bd158){return _0x390b5d[_0x3eff('0x9')](_0x3eff('0xa'),attributes,{'tableName':_0x3eff('0xb'),'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 e14b2b8..26b85d4 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 _0x4e6e=['map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','request','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','findAll','raw','options','where','attributes','limit','include'];(function(_0x2ab6d0,_0x2331d0){var _0x5d78bb=function(_0x139d93){while(--_0x139d93){_0x2ab6d0['push'](_0x2ab6d0['shift']());}};_0x5d78bb(++_0x2331d0);}(_0x4e6e,0x1c5));var _0xe4e6=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x4e6e[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0xe4e6('0x0'));var util=require('util');var moment=require(_0xe4e6('0x1'));var BPromise=require(_0xe4e6('0x2'));var rs=require(_0xe4e6('0x3'));var fs=require('fs');var Redis=require(_0xe4e6('0x4'));var db=require(_0xe4e6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe4e6('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51c7a7,_0x5102e3,_0x53f7f0){return new BPromise(function(_0x58602b,_0x558d23){return client[_0xe4e6('0x7')](_0x51c7a7,_0x53f7f0)['then'](function(_0x5571af){logger[_0xe4e6('0x8')](_0xe4e6('0x9'),_0x5102e3,'request\x20sent');logger[_0xe4e6('0xa')](_0xe4e6('0xb'),_0x5102e3,_0xe4e6('0xc'),JSON[_0xe4e6('0xd')](_0x5571af));if(_0x5571af['error']){if(_0x5571af[_0xe4e6('0xe')][_0xe4e6('0xf')]===0x1f4){logger['error'](_0xe4e6('0x9'),_0x5102e3,_0x5571af[_0xe4e6('0xe')][_0xe4e6('0x10')]);return _0x558d23(_0x5571af[_0xe4e6('0xe')]['message']);}logger[_0xe4e6('0xe')](_0xe4e6('0x9'),_0x5102e3,_0x5571af['error'][_0xe4e6('0x10')]);return _0x58602b(_0x5571af[_0xe4e6('0xe')][_0xe4e6('0x10')]);}else{logger[_0xe4e6('0x8')](_0xe4e6('0x9'),_0x5102e3,_0xe4e6('0xc'));_0x58602b(_0x5571af[_0xe4e6('0x11')][_0xe4e6('0x10')]);}})[_0xe4e6('0x12')](function(_0x54f055){logger[_0xe4e6('0xe')](_0xe4e6('0x9'),_0x5102e3,_0x54f055);_0x558d23(_0x54f055);});});}exports[_0xe4e6('0x13')]=function(_0x346445){var _0x580cd9=this;return new Promise(function(_0x49934c,_0x250f30){return db['MailServerIn'][_0xe4e6('0x14')]({'raw':_0x346445['options']?_0x346445['options'][_0xe4e6('0x15')]===undefined?!![]:![]:!![],'where':_0x346445[_0xe4e6('0x16')]?_0x346445[_0xe4e6('0x16')][_0xe4e6('0x17')]||null:null,'attributes':_0x346445['options']?_0x346445['options'][_0xe4e6('0x18')]||null:null,'limit':_0x346445['options']?_0x346445['options'][_0xe4e6('0x19')]||null:null,'include':_0x346445['options']?_0x346445[_0xe4e6('0x16')][_0xe4e6('0x1a')]?_[_0xe4e6('0x1b')](_0x346445['options']['include'],function(_0x51c4d4){return{'model':db[_0x51c4d4[_0xe4e6('0x1c')]],'as':_0x51c4d4['as'],'attributes':_0x51c4d4[_0xe4e6('0x18')],'include':_0x51c4d4[_0xe4e6('0x1a')]?_[_0xe4e6('0x1b')](_0x51c4d4[_0xe4e6('0x1a')],function(_0x17ad9d){return{'model':db[_0x17ad9d[_0xe4e6('0x1c')]],'as':_0x17ad9d['as'],'attributes':_0x17ad9d[_0xe4e6('0x18')],'include':_0x17ad9d[_0xe4e6('0x1a')]?_['map'](_0x17ad9d[_0xe4e6('0x1a')],function(_0x23da59){return{'model':db[_0x23da59[_0xe4e6('0x1c')]],'as':_0x23da59['as'],'attributes':_0x23da59['attributes']};}):[]};}):[]};}):[]:[]})[_0xe4e6('0x1d')](function(_0x51dbb9){logger[_0xe4e6('0x8')](_0xe4e6('0x13'),_0x346445);logger[_0xe4e6('0xa')]('GetMailServerIn',_0x346445,JSON[_0xe4e6('0xd')](_0x51dbb9));_0x49934c(_0x51dbb9);})[_0xe4e6('0x12')](function(_0x1d2675){logger['error'](_0xe4e6('0x13'),_0x1d2675['message'],_0x346445);_0x250f30(_0x580cd9[_0xe4e6('0xe')](0x1f4,_0x1d2675[_0xe4e6('0x10')]));});});}; \ No newline at end of file +var _0xa6f0=['code','message','info','request\x20sent','result','GetMailServerIn','findAll','options','raw','where','attributes','limit','include','map','then','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','MailServerIn,\x20%s,\x20%s','debug','error'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa6f0,0xea));var _0x0a6f=function(_0x40cfb4,_0x15c502){_0x40cfb4=_0x40cfb4-0x0;var _0x339ad2=_0xa6f0[_0x40cfb4];return _0x339ad2;};'use strict';var _=require(_0x0a6f('0x0'));var util=require(_0x0a6f('0x1'));var moment=require(_0x0a6f('0x2'));var BPromise=require(_0x0a6f('0x3'));var rs=require(_0x0a6f('0x4'));var fs=require('fs');var Redis=require(_0x0a6f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a6f('0x6'));var logger=require(_0x0a6f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0a6f('0x8')][_0x0a6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29bfc0,_0x4a5db0,_0x3269c9){return new BPromise(function(_0x7632be,_0x21e578){return client[_0x0a6f('0xa')](_0x29bfc0,_0x3269c9)['then'](function(_0x434512){logger['info'](_0x0a6f('0xb'),_0x4a5db0,'request\x20sent');logger[_0x0a6f('0xc')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4a5db0,'request\x20sent',JSON['stringify'](_0x434512));if(_0x434512[_0x0a6f('0xd')]){if(_0x434512[_0x0a6f('0xd')][_0x0a6f('0xe')]===0x1f4){logger[_0x0a6f('0xd')](_0x0a6f('0xb'),_0x4a5db0,_0x434512['error'][_0x0a6f('0xf')]);return _0x21e578(_0x434512[_0x0a6f('0xd')]['message']);}logger['error'](_0x0a6f('0xb'),_0x4a5db0,_0x434512[_0x0a6f('0xd')][_0x0a6f('0xf')]);return _0x7632be(_0x434512[_0x0a6f('0xd')][_0x0a6f('0xf')]);}else{logger[_0x0a6f('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4a5db0,_0x0a6f('0x11'));_0x7632be(_0x434512[_0x0a6f('0x12')][_0x0a6f('0xf')]);}})['catch'](function(_0x2edefd){logger[_0x0a6f('0xd')]('MailServerIn,\x20%s,\x20%s',_0x4a5db0,_0x2edefd);_0x21e578(_0x2edefd);});});}exports[_0x0a6f('0x13')]=function(_0x19fbff){var _0x3a5125=this;return new Promise(function(_0x539413,_0xb35e3a){return db['MailServerIn'][_0x0a6f('0x14')]({'raw':_0x19fbff['options']?_0x19fbff[_0x0a6f('0x15')][_0x0a6f('0x16')]===undefined?!![]:![]:!![],'where':_0x19fbff[_0x0a6f('0x15')]?_0x19fbff[_0x0a6f('0x15')][_0x0a6f('0x17')]||null:null,'attributes':_0x19fbff[_0x0a6f('0x15')]?_0x19fbff[_0x0a6f('0x15')][_0x0a6f('0x18')]||null:null,'limit':_0x19fbff[_0x0a6f('0x15')]?_0x19fbff[_0x0a6f('0x15')][_0x0a6f('0x19')]||null:null,'include':_0x19fbff['options']?_0x19fbff[_0x0a6f('0x15')][_0x0a6f('0x1a')]?_[_0x0a6f('0x1b')](_0x19fbff[_0x0a6f('0x15')][_0x0a6f('0x1a')],function(_0x5e4b61){return{'model':db[_0x5e4b61['model']],'as':_0x5e4b61['as'],'attributes':_0x5e4b61[_0x0a6f('0x18')],'include':_0x5e4b61[_0x0a6f('0x1a')]?_['map'](_0x5e4b61['include'],function(_0x109bb0){return{'model':db[_0x109bb0['model']],'as':_0x109bb0['as'],'attributes':_0x109bb0[_0x0a6f('0x18')],'include':_0x109bb0[_0x0a6f('0x1a')]?_[_0x0a6f('0x1b')](_0x109bb0[_0x0a6f('0x1a')],function(_0x183503){return{'model':db[_0x183503['model']],'as':_0x183503['as'],'attributes':_0x183503[_0x0a6f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0a6f('0x1c')](function(_0x5dcc2a){logger[_0x0a6f('0x10')](_0x0a6f('0x13'),_0x19fbff);logger[_0x0a6f('0xc')]('GetMailServerIn',_0x19fbff,JSON[_0x0a6f('0x1d')](_0x5dcc2a));_0x539413(_0x5dcc2a);})[_0x0a6f('0x1e')](function(_0x250bf1){logger[_0x0a6f('0xd')](_0x0a6f('0x13'),_0x250bf1[_0x0a6f('0xf')],_0x19fbff);_0xb35e3a(_0x3a5125['error'](0x1f4,_0x250bf1[_0x0a6f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 0baa56f..2e4740f 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(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x284bb6,_0x25aefb){_0x284bb6=_0x284bb6-0x0;var _0x30b1b6=_0x7a54[_0x284bb6];return _0x30b1b6;};'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 _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(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x7a54,0x106));var _0x47a5=function(_0x28fee9,_0x483ab2){_0x28fee9=_0x28fee9-0x0;var _0x3fb94a=_0x7a54[_0x28fee9];return _0x3fb94a;};'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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index a1ef89f..3e50cda 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 _0x0abf=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x13ff59,_0x31281b){var _0x520b47=function(_0x2b13cf){while(--_0x2b13cf){_0x13ff59['push'](_0x13ff59['shift']());}};_0x520b47(++_0x31281b);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'description':{'type':Sequelize[_0xf0ab('0x1')]},'host':{'type':Sequelize[_0xf0ab('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf0ab('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xf0ab('0x1')]},'authentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x96cc=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0xe62388,_0x20a8dc){var _0x364a83=function(_0x3c3718){while(--_0x3c3718){_0xe62388['push'](_0xe62388['shift']());}};_0x364a83(++_0x20a8dc);}(_0x96cc,0x16c));var _0xc96c=function(_0x3b29b7,_0x31831e){_0x3b29b7=_0x3b29b7-0x0;var _0x2b2669=_0x96cc[_0x3b29b7];return _0x2b2669;};'use strict';var Sequelize=require(_0xc96c('0x0'));module['exports']={'description':{'type':Sequelize[_0xc96c('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xc96c('0x1')]},'pass':{'type':Sequelize[_0xc96c('0x1')]},'port':{'type':Sequelize[_0xc96c('0x2')]},'secure':{'type':Sequelize[_0xc96c('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xc96c('0x1')]},'authentication':{'type':Sequelize[_0xc96c('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xc96c('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 48805bc..575c0ef 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 _0x1f8f=['show','params','includeAll','catch','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','update','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','options','MailServerOut','then','include','rows'];(function(_0x1f9f27,_0x1d63df){var _0x5ec68d=function(_0x258546){while(--_0x258546){_0x1f9f27['push'](_0x1f9f27['shift']());}};_0x5ec68d(++_0x1d63df);}(_0x1f8f,0x95));var _0xf1f8=function(_0x110129,_0x2ed398){_0x110129=_0x110129-0x0;var _0x375002=_0x1f8f[_0x110129];return _0x375002;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1f8('0x0'));var zipdir=require(_0xf1f8('0x1'));var jsonpatch=require(_0xf1f8('0x2'));var rp=require(_0xf1f8('0x3'));var moment=require('moment');var BPromise=require(_0xf1f8('0x4'));var Mustache=require(_0xf1f8('0x5'));var util=require(_0xf1f8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf1f8('0x7'));var ejs=require(_0xf1f8('0x8'));var fs=require('fs');var fs_extra=require(_0xf1f8('0x9'));var _=require(_0xf1f8('0xa'));var squel=require(_0xf1f8('0xb'));var crypto=require(_0xf1f8('0xc'));var jsforce=require(_0xf1f8('0xd'));var deskjs=require(_0xf1f8('0xe'));var toCsv=require(_0xf1f8('0x7'));var querystring=require(_0xf1f8('0xf'));var Papa=require(_0xf1f8('0x10'));var Redis=require(_0xf1f8('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf1f8('0x12'));var hardwareService=require(_0xf1f8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf1f8('0x14'));var config=require(_0xf1f8('0x15'));var licenseUtil=require(_0xf1f8('0x16'));var db=require(_0xf1f8('0x17'))['db'];function respondWithStatusCode(_0x409f21,_0x3dd928){_0x3dd928=_0x3dd928||0xcc;return function(_0x755b2d){if(_0x755b2d){return _0x409f21[_0xf1f8('0x18')](_0x3dd928);}return _0x409f21[_0xf1f8('0x19')](_0x3dd928)['end']();};}function respondWithResult(_0x870b6b,_0x379130){_0x379130=_0x379130||0xc8;return function(_0x64ee24){if(_0x64ee24){return _0x870b6b['status'](_0x379130)[_0xf1f8('0x1a')](_0x64ee24);}};}function respondWithFilteredResult(_0x3423b5,_0x4f06b4){return function(_0x48931a){if(_0x48931a){var _0x525447=typeof _0x4f06b4['offset']===_0xf1f8('0x1b')&&typeof _0x4f06b4['limit']==='undefined';var _0xe98095=_0x48931a[_0xf1f8('0x1c')];var _0x15b471=_0x525447?0x0:_0x4f06b4[_0xf1f8('0x1d')];var _0x1f5717=_0x525447?_0x48931a[_0xf1f8('0x1c')]:_0x4f06b4[_0xf1f8('0x1d')]+_0x4f06b4[_0xf1f8('0x1e')];var _0x4e5dde;if(_0x1f5717>=_0xe98095){_0x1f5717=_0xe98095;_0x4e5dde=0xc8;}else{_0x4e5dde=0xce;}_0x3423b5['status'](_0x4e5dde);return _0x3423b5['set'](_0xf1f8('0x1f'),_0x15b471+'-'+_0x1f5717+'/'+_0xe98095)[_0xf1f8('0x1a')](_0x48931a);}return null;};}function patchUpdates(_0x2fb898){return function(_0x3a5b99){try{jsonpatch[_0xf1f8('0x20')](_0x3a5b99,_0x2fb898,!![]);}catch(_0x35b6c5){return BPromise[_0xf1f8('0x21')](_0x35b6c5);}return _0x3a5b99['save']();};}function saveUpdates(_0x3d2c79,_0x37d565){return function(_0x21c664){if(_0x21c664){return _0x21c664[_0xf1f8('0x22')](_0x3d2c79)['then'](function(_0x2ae578){return _0x2ae578;});}return null;};}function removeEntity(_0x13ca4f,_0x1a0341){return function(_0xf56780){if(_0xf56780){return _0xf56780[_0xf1f8('0x23')]()['then'](function(){_0x13ca4f['status'](0xcc)[_0xf1f8('0x24')]();});}};}function handleEntityNotFound(_0x1ccadc,_0x35dbc5){return function(_0x22f5ac){if(!_0x22f5ac){_0x1ccadc[_0xf1f8('0x18')](0x194);}return _0x22f5ac;};}function handleError(_0x3e9fc5,_0x184f99){_0x184f99=_0x184f99||0x1f4;return function(_0x320eed){logger['error'](_0x320eed[_0xf1f8('0x25')]);if(_0x320eed[_0xf1f8('0x26')]){delete _0x320eed[_0xf1f8('0x26')];}_0x3e9fc5[_0xf1f8('0x19')](_0x184f99)[_0xf1f8('0x27')](_0x320eed);};}exports['index']=function(_0x5692c6,_0x291b4b){var _0x574a1b={},_0x21b0d7={},_0x4d3eee={'count':0x0,'rows':[]};var _0x365acc=_[_0xf1f8('0x28')](db['MailServerOut'][_0xf1f8('0x29')],function(_0x13149d){return{'name':_0x13149d[_0xf1f8('0x2a')],'type':_0x13149d[_0xf1f8('0x2b')][_0xf1f8('0x2c')]};});_0x21b0d7[_0xf1f8('0x2d')]=_[_0xf1f8('0x28')](_0x365acc,_0xf1f8('0x26'));_0x21b0d7['query']=_[_0xf1f8('0x2e')](_0x5692c6[_0xf1f8('0x2f')]);_0x21b0d7['filters']=_[_0xf1f8('0x30')](_0x21b0d7[_0xf1f8('0x2d')],_0x21b0d7[_0xf1f8('0x2f')]);_0x574a1b[_0xf1f8('0x31')]=_[_0xf1f8('0x30')](_0x21b0d7[_0xf1f8('0x2d')],qs[_0xf1f8('0x32')](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x32')]));_0x574a1b[_0xf1f8('0x31')]=_0x574a1b[_0xf1f8('0x31')][_0xf1f8('0x33')]?_0x574a1b[_0xf1f8('0x31')]:_0x21b0d7[_0xf1f8('0x2d')];if(!_0x5692c6[_0xf1f8('0x2f')]['hasOwnProperty']('nolimit')){_0x574a1b[_0xf1f8('0x1e')]=qs[_0xf1f8('0x1e')](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x1e')]);_0x574a1b[_0xf1f8('0x1d')]=qs[_0xf1f8('0x1d')](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x1d')]);}_0x574a1b[_0xf1f8('0x34')]=qs['sort'](_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x35')]);_0x574a1b[_0xf1f8('0x36')]=qs[_0xf1f8('0x37')](_[_0xf1f8('0x38')](_0x5692c6[_0xf1f8('0x2f')],_0x21b0d7[_0xf1f8('0x37')]),_0x365acc);if(_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x39')]){_0x574a1b['where']=_[_0xf1f8('0x3a')](_0x574a1b[_0xf1f8('0x36')],{'$or':_[_0xf1f8('0x28')](_0x365acc,function(_0x423517){if(_0x423517[_0xf1f8('0x2b')]!=='VIRTUAL'){var _0x4c8c3a={};_0x4c8c3a[_0x423517[_0xf1f8('0x26')]]={'$like':'%'+_0x5692c6[_0xf1f8('0x2f')][_0xf1f8('0x39')]+'%'};return _0x4c8c3a;}})});}_0x574a1b=_[_0xf1f8('0x3a')]({},_0x574a1b,_0x5692c6[_0xf1f8('0x3b')]);var _0xe630b4={'where':_0x574a1b['where']};return db[_0xf1f8('0x3c')][_0xf1f8('0x1c')](_0xe630b4)[_0xf1f8('0x3d')](function(_0xa34835){_0x4d3eee[_0xf1f8('0x1c')]=_0xa34835;if(_0x5692c6[_0xf1f8('0x2f')]['includeAll']){_0x574a1b[_0xf1f8('0x3e')]=[{'all':!![]}];}return db[_0xf1f8('0x3c')]['findAll'](_0x574a1b);})[_0xf1f8('0x3d')](function(_0xba9f98){_0x4d3eee[_0xf1f8('0x3f')]=_0xba9f98;return _0x4d3eee;})[_0xf1f8('0x3d')](respondWithFilteredResult(_0x291b4b,_0x574a1b))['catch'](handleError(_0x291b4b,null));};exports[_0xf1f8('0x40')]=function(_0x21e326,_0x3656b1){var _0x2b1eff={'raw':!![],'where':{'id':_0x21e326[_0xf1f8('0x41')]['id']}},_0xf2dc2a={};_0xf2dc2a[_0xf1f8('0x2d')]=_[_0xf1f8('0x2e')](db[_0xf1f8('0x3c')]['rawAttributes']);_0xf2dc2a[_0xf1f8('0x2f')]=_[_0xf1f8('0x2e')](_0x21e326['query']);_0xf2dc2a['filters']=_[_0xf1f8('0x30')](_0xf2dc2a[_0xf1f8('0x2d')],_0xf2dc2a[_0xf1f8('0x2f')]);_0x2b1eff[_0xf1f8('0x31')]=_[_0xf1f8('0x30')](_0xf2dc2a[_0xf1f8('0x2d')],qs[_0xf1f8('0x32')](_0x21e326['query'][_0xf1f8('0x32')]));_0x2b1eff[_0xf1f8('0x31')]=_0x2b1eff[_0xf1f8('0x31')]['length']?_0x2b1eff[_0xf1f8('0x31')]:_0xf2dc2a['model'];if(_0x21e326['query'][_0xf1f8('0x42')]){_0x2b1eff['include']=[{'all':!![]}];}_0x2b1eff=_[_0xf1f8('0x3a')]({},_0x2b1eff,_0x21e326['options']);return db[_0xf1f8('0x3c')]['find'](_0x2b1eff)[_0xf1f8('0x3d')](handleEntityNotFound(_0x3656b1,null))[_0xf1f8('0x3d')](respondWithResult(_0x3656b1,null))[_0xf1f8('0x43')](handleError(_0x3656b1,null));};exports[_0xf1f8('0x44')]=function(_0x5557b5,_0x350beb){return db[_0xf1f8('0x3c')][_0xf1f8('0x44')](_0x5557b5[_0xf1f8('0x45')],{})[_0xf1f8('0x3d')](respondWithResult(_0x350beb,0xc9))['catch'](handleError(_0x350beb,null));};exports['update']=function(_0x5c988d,_0x12bd0f){if(_0x5c988d[_0xf1f8('0x45')]['id']){delete _0x5c988d[_0xf1f8('0x45')]['id'];}return db[_0xf1f8('0x3c')][_0xf1f8('0x46')]({'where':{'id':_0x5c988d[_0xf1f8('0x41')]['id']}})['then'](handleEntityNotFound(_0x12bd0f,null))[_0xf1f8('0x3d')](saveUpdates(_0x5c988d[_0xf1f8('0x45')],null))[_0xf1f8('0x3d')](respondWithResult(_0x12bd0f,null))[_0xf1f8('0x43')](handleError(_0x12bd0f,null));};exports[_0xf1f8('0x23')]=function(_0x26b05a,_0x59e0c6){return db[_0xf1f8('0x3c')][_0xf1f8('0x46')]({'where':{'id':_0x26b05a['params']['id']}})[_0xf1f8('0x3d')](handleEntityNotFound(_0x59e0c6,null))[_0xf1f8('0x3d')](removeEntity(_0x59e0c6,null))[_0xf1f8('0x43')](handleError(_0x59e0c6,null));}; \ No newline at end of file +var _0x1c33=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','then','destroy','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','sort','where','pick','filters','filter','merge','options','MailServerOut','includeAll','findAll','rows','show','keys','include','find','create','body','catch','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x30e467,_0x48c36f){var _0x157c71=function(_0x59a326){while(--_0x59a326){_0x30e467['push'](_0x30e467['shift']());}};_0x157c71(++_0x48c36f);}(_0x1c33,0x1e9));var _0x31c3=function(_0x184a2d,_0x461b69){_0x184a2d=_0x184a2d-0x0;var _0x52d40f=_0x1c33[_0x184a2d];return _0x52d40f;};'use strict';var emlformat=require(_0x31c3('0x0'));var rimraf=require(_0x31c3('0x1'));var zipdir=require(_0x31c3('0x2'));var jsonpatch=require(_0x31c3('0x3'));var rp=require(_0x31c3('0x4'));var moment=require(_0x31c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31c3('0x6'));var util=require(_0x31c3('0x7'));var path=require(_0x31c3('0x8'));var sox=require('sox');var csv=require(_0x31c3('0x9'));var ejs=require(_0x31c3('0xa'));var fs=require('fs');var fs_extra=require(_0x31c3('0xb'));var _=require('lodash');var squel=require(_0x31c3('0xc'));var crypto=require(_0x31c3('0xd'));var jsforce=require(_0x31c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x31c3('0x9'));var querystring=require('querystring');var Papa=require(_0x31c3('0xf'));var Redis=require(_0x31c3('0x10'));var authService=require(_0x31c3('0x11'));var qs=require(_0x31c3('0x12'));var as=require(_0x31c3('0x13'));var hardwareService=require(_0x31c3('0x14'));var logger=require('../../config/logger')(_0x31c3('0x15'));var utils=require('../../config/utils');var config=require(_0x31c3('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x31c3('0x17'))['db'];function respondWithStatusCode(_0x528200,_0x3cd18f){_0x3cd18f=_0x3cd18f||0xcc;return function(_0x5331a6){if(_0x5331a6){return _0x528200[_0x31c3('0x18')](_0x3cd18f);}return _0x528200[_0x31c3('0x19')](_0x3cd18f)[_0x31c3('0x1a')]();};}function respondWithResult(_0x52076b,_0x2217a){_0x2217a=_0x2217a||0xc8;return function(_0x587ebd){if(_0x587ebd){return _0x52076b[_0x31c3('0x19')](_0x2217a)[_0x31c3('0x1b')](_0x587ebd);}};}function respondWithFilteredResult(_0x2e7291,_0x2afce3){return function(_0x4b37f9){if(_0x4b37f9){var _0xa53175=typeof _0x2afce3['offset']===_0x31c3('0x1c')&&typeof _0x2afce3['limit']===_0x31c3('0x1c');var _0x3c9f64=_0x4b37f9[_0x31c3('0x1d')];var _0x2b653b=_0xa53175?0x0:_0x2afce3[_0x31c3('0x1e')];var _0x9af21f=_0xa53175?_0x4b37f9[_0x31c3('0x1d')]:_0x2afce3[_0x31c3('0x1e')]+_0x2afce3[_0x31c3('0x1f')];var _0x54126e;if(_0x9af21f>=_0x3c9f64){_0x9af21f=_0x3c9f64;_0x54126e=0xc8;}else{_0x54126e=0xce;}_0x2e7291['status'](_0x54126e);return _0x2e7291[_0x31c3('0x20')](_0x31c3('0x21'),_0x2b653b+'-'+_0x9af21f+'/'+_0x3c9f64)['json'](_0x4b37f9);}return null;};}function patchUpdates(_0x31743b){return function(_0x4bba6d){try{jsonpatch['apply'](_0x4bba6d,_0x31743b,!![]);}catch(_0x8bcdf8){return BPromise[_0x31c3('0x22')](_0x8bcdf8);}return _0x4bba6d['save']();};}function saveUpdates(_0x5bd37b,_0x10bb31){return function(_0x704541){if(_0x704541){return _0x704541['update'](_0x5bd37b)[_0x31c3('0x23')](function(_0xf38645){return _0xf38645;});}return null;};}function removeEntity(_0x1b40fd,_0x1de9d2){return function(_0x9811b9){if(_0x9811b9){return _0x9811b9[_0x31c3('0x24')]()[_0x31c3('0x23')](function(){_0x1b40fd['status'](0xcc)[_0x31c3('0x1a')]();});}};}function handleEntityNotFound(_0x2e2bdd,_0x32ea7c){return function(_0x56ec36){if(!_0x56ec36){_0x2e2bdd[_0x31c3('0x18')](0x194);}return _0x56ec36;};}function handleError(_0x26be24,_0x2338db){_0x2338db=_0x2338db||0x1f4;return function(_0x5e3be4){logger['error'](_0x5e3be4[_0x31c3('0x25')]);if(_0x5e3be4[_0x31c3('0x26')]){delete _0x5e3be4[_0x31c3('0x26')];}_0x26be24['status'](_0x2338db)[_0x31c3('0x27')](_0x5e3be4);};}exports[_0x31c3('0x28')]=function(_0x12a531,_0x142e1b){var _0x1ea860={},_0x20a894={},_0xa22d99={'count':0x0,'rows':[]};var _0x267d44=_[_0x31c3('0x29')](db['MailServerOut'][_0x31c3('0x2a')],function(_0x73ec8f){return{'name':_0x73ec8f['fieldName'],'type':_0x73ec8f[_0x31c3('0x2b')][_0x31c3('0x2c')]};});_0x20a894[_0x31c3('0x2d')]=_['map'](_0x267d44,_0x31c3('0x26'));_0x20a894[_0x31c3('0x2e')]=_['keys'](_0x12a531[_0x31c3('0x2e')]);_0x20a894['filters']=_[_0x31c3('0x2f')](_0x20a894['model'],_0x20a894['query']);_0x1ea860[_0x31c3('0x30')]=_['intersection'](_0x20a894[_0x31c3('0x2d')],qs[_0x31c3('0x31')](_0x12a531[_0x31c3('0x2e')][_0x31c3('0x31')]));_0x1ea860['attributes']=_0x1ea860[_0x31c3('0x30')][_0x31c3('0x32')]?_0x1ea860[_0x31c3('0x30')]:_0x20a894[_0x31c3('0x2d')];if(!_0x12a531[_0x31c3('0x2e')]['hasOwnProperty']('nolimit')){_0x1ea860['limit']=qs[_0x31c3('0x1f')](_0x12a531[_0x31c3('0x2e')][_0x31c3('0x1f')]);_0x1ea860[_0x31c3('0x1e')]=qs[_0x31c3('0x1e')](_0x12a531[_0x31c3('0x2e')][_0x31c3('0x1e')]);}_0x1ea860[_0x31c3('0x33')]=qs[_0x31c3('0x34')](_0x12a531['query'][_0x31c3('0x34')]);_0x1ea860[_0x31c3('0x35')]=qs['filters'](_[_0x31c3('0x36')](_0x12a531[_0x31c3('0x2e')],_0x20a894[_0x31c3('0x37')]),_0x267d44);if(_0x12a531[_0x31c3('0x2e')][_0x31c3('0x38')]){_0x1ea860['where']=_[_0x31c3('0x39')](_0x1ea860[_0x31c3('0x35')],{'$or':_[_0x31c3('0x29')](_0x267d44,function(_0x2922f1){if(_0x2922f1[_0x31c3('0x2b')]!=='VIRTUAL'){var _0x1bca1c={};_0x1bca1c[_0x2922f1[_0x31c3('0x26')]]={'$like':'%'+_0x12a531[_0x31c3('0x2e')][_0x31c3('0x38')]+'%'};return _0x1bca1c;}})});}_0x1ea860=_[_0x31c3('0x39')]({},_0x1ea860,_0x12a531[_0x31c3('0x3a')]);var _0x5c1268={'where':_0x1ea860[_0x31c3('0x35')]};return db[_0x31c3('0x3b')]['count'](_0x5c1268)[_0x31c3('0x23')](function(_0x2351bb){_0xa22d99['count']=_0x2351bb;if(_0x12a531[_0x31c3('0x2e')][_0x31c3('0x3c')]){_0x1ea860['include']=[{'all':!![]}];}return db[_0x31c3('0x3b')][_0x31c3('0x3d')](_0x1ea860);})[_0x31c3('0x23')](function(_0x2a222a){_0xa22d99[_0x31c3('0x3e')]=_0x2a222a;return _0xa22d99;})[_0x31c3('0x23')](respondWithFilteredResult(_0x142e1b,_0x1ea860))['catch'](handleError(_0x142e1b,null));};exports[_0x31c3('0x3f')]=function(_0x23c71e,_0xd589d9){var _0x44e2a4={'raw':!![],'where':{'id':_0x23c71e['params']['id']}},_0x4e4538={};_0x4e4538[_0x31c3('0x2d')]=_['keys'](db[_0x31c3('0x3b')][_0x31c3('0x2a')]);_0x4e4538[_0x31c3('0x2e')]=_[_0x31c3('0x40')](_0x23c71e[_0x31c3('0x2e')]);_0x4e4538['filters']=_[_0x31c3('0x2f')](_0x4e4538[_0x31c3('0x2d')],_0x4e4538['query']);_0x44e2a4['attributes']=_[_0x31c3('0x2f')](_0x4e4538[_0x31c3('0x2d')],qs['fields'](_0x23c71e['query'][_0x31c3('0x31')]));_0x44e2a4[_0x31c3('0x30')]=_0x44e2a4['attributes']['length']?_0x44e2a4[_0x31c3('0x30')]:_0x4e4538[_0x31c3('0x2d')];if(_0x23c71e[_0x31c3('0x2e')][_0x31c3('0x3c')]){_0x44e2a4[_0x31c3('0x41')]=[{'all':!![]}];}_0x44e2a4=_[_0x31c3('0x39')]({},_0x44e2a4,_0x23c71e[_0x31c3('0x3a')]);return db[_0x31c3('0x3b')][_0x31c3('0x42')](_0x44e2a4)[_0x31c3('0x23')](handleEntityNotFound(_0xd589d9,null))[_0x31c3('0x23')](respondWithResult(_0xd589d9,null))['catch'](handleError(_0xd589d9,null));};exports[_0x31c3('0x43')]=function(_0x37933e,_0x12e641){return db[_0x31c3('0x3b')][_0x31c3('0x43')](_0x37933e[_0x31c3('0x44')],{})[_0x31c3('0x23')](respondWithResult(_0x12e641,0xc9))[_0x31c3('0x45')](handleError(_0x12e641,null));};exports[_0x31c3('0x46')]=function(_0x1748e3,_0x66bccd){if(_0x1748e3[_0x31c3('0x44')]['id']){delete _0x1748e3[_0x31c3('0x44')]['id'];}return db['MailServerOut'][_0x31c3('0x42')]({'where':{'id':_0x1748e3[_0x31c3('0x47')]['id']}})[_0x31c3('0x23')](handleEntityNotFound(_0x66bccd,null))[_0x31c3('0x23')](saveUpdates(_0x1748e3['body'],null))[_0x31c3('0x23')](respondWithResult(_0x66bccd,null))['catch'](handleError(_0x66bccd,null));};exports[_0x31c3('0x24')]=function(_0x240bb0,_0x19462b){return db[_0x31c3('0x3b')]['find']({'where':{'id':_0x240bb0[_0x31c3('0x47')]['id']}})[_0x31c3('0x23')](handleEntityNotFound(_0x19462b,null))[_0x31c3('0x23')](removeEntity(_0x19462b,null))[_0x31c3('0x45')](handleError(_0x19462b,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 561eae0..9c4d4f2 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 _0xca16=['../../config/logger','api','request-promise','path','./mailServerOut.attributes','MailServerOut','lodash','util'];(function(_0x5b8c1b,_0x500d78){var _0x81587a=function(_0x393b5a){while(--_0x393b5a){_0x5b8c1b['push'](_0x5b8c1b['shift']());}};_0x81587a(++_0x500d78);}(_0xca16,0xa6));var _0x6ca1=function(_0x45482b,_0x203bcb){_0x45482b=_0x45482b-0x0;var _0x4db7df=_0xca16[_0x45482b];return _0x4db7df;};'use strict';var _=require(_0x6ca1('0x0'));var util=require(_0x6ca1('0x1'));var logger=require(_0x6ca1('0x2'))(_0x6ca1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6ca1('0x4'));var fs=require('fs');var path=require(_0x6ca1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6ca1('0x6'));module['exports']=function(_0x9877c4,_0x396785){return _0x9877c4['define'](_0x6ca1('0x7'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d8a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out'];(function(_0x290137,_0x26c160){var _0x356555=function(_0x8ce1f0){while(--_0x8ce1f0){_0x290137['push'](_0x290137['shift']());}};_0x356555(++_0x26c160);}(_0x1d8a,0x142));var _0xa1d8=function(_0x18ec5f,_0x5a8010){_0x18ec5f=_0x18ec5f-0x0;var _0x283981=_0x1d8a[_0x18ec5f];return _0x283981;};'use strict';var _=require(_0xa1d8('0x0'));var util=require(_0xa1d8('0x1'));var logger=require(_0xa1d8('0x2'))(_0xa1d8('0x3'));var moment=require(_0xa1d8('0x4'));var BPromise=require(_0xa1d8('0x5'));var rp=require(_0xa1d8('0x6'));var fs=require('fs');var path=require(_0xa1d8('0x7'));var rimraf=require(_0xa1d8('0x8'));var config=require(_0xa1d8('0x9'));var attributes=require(_0xa1d8('0xa'));module[_0xa1d8('0xb')]=function(_0x1fe1d5,_0x2b0895){return _0x1fe1d5['define'](_0xa1d8('0xc'),attributes,{'tableName':_0xa1d8('0xd'),'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 57a0b81..08ec870 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 _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(_0x11c1a1,_0x17ba8c){var _0x483746=function(_0x5253c3){while(--_0x5253c3){_0x11c1a1['push'](_0x11c1a1['shift']());}};_0x483746(++_0x17ba8c);}(_0xadb5,0xad));var _0x5adb=function(_0x55a444,_0x3ffb39){_0x55a444=_0x55a444-0x0;var _0x53c2ba=_0xadb5[_0x55a444];return _0x53c2ba;};'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 +var _0x7a54=['info','MailServerOut,\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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x490eb3,_0x3c96be){_0x490eb3=_0x490eb3-0x0;var _0x27b837=_0x7a54[_0x490eb3];return _0x27b837;};'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')]('MailServerOut,\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/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 21f725f..8a7989e 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 _0xdaef=['create','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post'];(function(_0x58386b,_0xe17103){var _0x3af06d=function(_0x205769){while(--_0x205769){_0x58386b['push'](_0x58386b['shift']());}};_0x3af06d(++_0xe17103);}(_0xdaef,0x1e0));var _0xfdae=function(_0x2c92f5,_0x46280b){_0x2c92f5=_0x2c92f5-0x0;var _0x3b3a97=_0xdaef[_0x2c92f5];return _0x3b3a97;};'use strict';var multer=require(_0xfdae('0x0'));var util=require('util');var path=require(_0xfdae('0x1'));var timeout=require(_0xfdae('0x2'));var express=require('express');var router=express[_0xfdae('0x3')]();var fs_extra=require(_0xfdae('0x4'));var auth=require(_0xfdae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfdae('0x6'));var controller=require('./mailSubstatus.controller');router[_0xfdae('0x7')]('/',auth[_0xfdae('0x8')](),controller[_0xfdae('0x9')]);router[_0xfdae('0x7')](_0xfdae('0xa'),auth[_0xfdae('0x8')](),controller['describe']);router[_0xfdae('0x7')](_0xfdae('0xb'),auth[_0xfdae('0x8')](),controller[_0xfdae('0xc')]);router[_0xfdae('0xd')]('/',auth[_0xfdae('0x8')](),controller[_0xfdae('0xe')]);router[_0xfdae('0xf')]('/:id',auth[_0xfdae('0x8')](),controller[_0xfdae('0x10')]);router[_0xfdae('0x11')](_0xfdae('0xb'),auth[_0xfdae('0x8')](),controller['destroy']);module[_0xfdae('0x12')]=router; \ No newline at end of file +var _0x3ccf=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x134374,_0xa30e6e){var _0x336abf=function(_0x3165dd){while(--_0x3165dd){_0x134374['push'](_0x134374['shift']());}};_0x336abf(++_0xa30e6e);}(_0x3ccf,0x87));var _0xf3cc=function(_0x5cac2a,_0xfeeebb){_0x5cac2a=_0x5cac2a-0x0;var _0x3c5c86=_0x3ccf[_0x5cac2a];return _0x3c5c86;};'use strict';var multer=require(_0xf3cc('0x0'));var util=require(_0xf3cc('0x1'));var path=require(_0xf3cc('0x2'));var timeout=require(_0xf3cc('0x3'));var express=require(_0xf3cc('0x4'));var router=express[_0xf3cc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf3cc('0x6'));var interaction=require(_0xf3cc('0x7'));var config=require(_0xf3cc('0x8'));var controller=require('./mailSubstatus.controller');router[_0xf3cc('0x9')]('/',auth[_0xf3cc('0xa')](),controller[_0xf3cc('0xb')]);router[_0xf3cc('0x9')]('/describe',auth[_0xf3cc('0xa')](),controller[_0xf3cc('0xc')]);router[_0xf3cc('0x9')](_0xf3cc('0xd'),auth[_0xf3cc('0xa')](),controller[_0xf3cc('0xe')]);router['post']('/',auth[_0xf3cc('0xa')](),controller[_0xf3cc('0xf')]);router[_0xf3cc('0x10')](_0xf3cc('0xd'),auth[_0xf3cc('0xa')](),controller['update']);router[_0xf3cc('0x11')](_0xf3cc('0xd'),auth[_0xf3cc('0xa')](),controller[_0xf3cc('0x12')]);module[_0xf3cc('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 63aa6bb..2e64204 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 _0x6657=['STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6657,0x17f));var _0x7665=function(_0x227c55,_0x49db56){_0x227c55=_0x227c55-0x0;var _0x49e02b=_0x6657[_0x227c55];return _0x49e02b;};'use strict';var Sequelize=require(_0x7665('0x0'));module['exports']={'name':{'type':Sequelize[_0x7665('0x1')],'unique':_0x7665('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7665('0x1')]}}; \ No newline at end of file +var _0x3831=['STRING','name','sequelize'];(function(_0x308fbc,_0x805091){var _0x268f1e=function(_0xbf85ad){while(--_0xbf85ad){_0x308fbc['push'](_0x308fbc['shift']());}};_0x268f1e(++_0x805091);}(_0x3831,0x14c));var _0x1383=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x3831[_0x131585];return _0x1fcca2;};'use strict';var Sequelize=require(_0x1383('0x0'));module['exports']={'name':{'type':Sequelize[_0x1383('0x1')],'unique':_0x1383('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1383('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index eeea428..5d6009d 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 _0x58a5=['zip-dir','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','MailSubstatus','rawAttributes','key','model','query','keys','filters','intersection','fields','length','attributes','nolimit','order','sort','where','pick','type','filter','merge','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','update','describe'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x58a5,0x1aa));var _0x558a=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x58a5[_0x648163];return _0x199d4d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x558a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x558a('0x1'));var Mustache=require(_0x558a('0x2'));var util=require(_0x558a('0x3'));var path=require(_0x558a('0x4'));var sox=require(_0x558a('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x558a('0x6'));var squel=require(_0x558a('0x7'));var crypto=require(_0x558a('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x558a('0x9'));var toCsv=require('to-csv');var querystring=require(_0x558a('0xa'));var Papa=require(_0x558a('0xb'));var Redis=require(_0x558a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x558a('0xd'));var as=require(_0x558a('0xe'));var hardwareService=require(_0x558a('0xf'));var logger=require('../../config/logger')(_0x558a('0x10'));var utils=require(_0x558a('0x11'));var config=require(_0x558a('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c083,_0x5b83b4){_0x5b83b4=_0x5b83b4||0xcc;return function(_0x20d448){if(_0x20d448){return _0xb0c083[_0x558a('0x13')](_0x5b83b4);}return _0xb0c083['status'](_0x5b83b4)['end']();};}function respondWithResult(_0x3f2928,_0x4acdfc){_0x4acdfc=_0x4acdfc||0xc8;return function(_0x1a38dc){if(_0x1a38dc){return _0x3f2928['status'](_0x4acdfc)[_0x558a('0x14')](_0x1a38dc);}};}function respondWithFilteredResult(_0x15b1d5,_0x19aee2){return function(_0x26e515){if(_0x26e515){var _0x3339f0=typeof _0x19aee2[_0x558a('0x15')]===_0x558a('0x16')&&typeof _0x19aee2[_0x558a('0x17')]===_0x558a('0x16');var _0x14ff6e=_0x26e515[_0x558a('0x18')];var _0x3de2de=_0x3339f0?0x0:_0x19aee2[_0x558a('0x15')];var _0x6b7e7f=_0x3339f0?_0x26e515[_0x558a('0x18')]:_0x19aee2[_0x558a('0x15')]+_0x19aee2[_0x558a('0x17')];var _0x2e2214;if(_0x6b7e7f>=_0x14ff6e){_0x6b7e7f=_0x14ff6e;_0x2e2214=0xc8;}else{_0x2e2214=0xce;}_0x15b1d5[_0x558a('0x19')](_0x2e2214);return _0x15b1d5[_0x558a('0x1a')](_0x558a('0x1b'),_0x3de2de+'-'+_0x6b7e7f+'/'+_0x14ff6e)[_0x558a('0x14')](_0x26e515);}return null;};}function patchUpdates(_0x2b8c54){return function(_0x5a6b9b){try{jsonpatch[_0x558a('0x1c')](_0x5a6b9b,_0x2b8c54,!![]);}catch(_0x1bfdeb){return BPromise[_0x558a('0x1d')](_0x1bfdeb);}return _0x5a6b9b[_0x558a('0x1e')]();};}function saveUpdates(_0x19ff70,_0x3910d5){return function(_0x5c290b){if(_0x5c290b){return _0x5c290b['update'](_0x19ff70)[_0x558a('0x1f')](function(_0x32c78f){return _0x32c78f;});}return null;};}function removeEntity(_0x473f9b,_0x564877){return function(_0x3ef8fb){if(_0x3ef8fb){return _0x3ef8fb[_0x558a('0x20')]()[_0x558a('0x1f')](function(){_0x473f9b['status'](0xcc)[_0x558a('0x21')]();});}};}function handleEntityNotFound(_0x323736,_0x2c8a8a){return function(_0x51eca1){if(!_0x51eca1){_0x323736[_0x558a('0x13')](0x194);}return _0x51eca1;};}function handleError(_0xe44ef8,_0x5c7d66){_0x5c7d66=_0x5c7d66||0x1f4;return function(_0xaac5d8){logger[_0x558a('0x22')](_0xaac5d8[_0x558a('0x23')]);if(_0xaac5d8[_0x558a('0x24')]){delete _0xaac5d8[_0x558a('0x24')];}_0xe44ef8[_0x558a('0x19')](_0x5c7d66)[_0x558a('0x25')](_0xaac5d8);};}exports['index']=function(_0x1c11be,_0x3e4929){var _0xb0975b={},_0x17783d={},_0x5a0a98={'count':0x0,'rows':[]};var _0x5b91fa=_[_0x558a('0x26')](db[_0x558a('0x27')][_0x558a('0x28')],function(_0x593ccd){return{'name':_0x593ccd['fieldName'],'type':_0x593ccd['type'][_0x558a('0x29')]};});_0x17783d[_0x558a('0x2a')]=_[_0x558a('0x26')](_0x5b91fa,'name');_0x17783d[_0x558a('0x2b')]=_[_0x558a('0x2c')](_0x1c11be[_0x558a('0x2b')]);_0x17783d[_0x558a('0x2d')]=_[_0x558a('0x2e')](_0x17783d[_0x558a('0x2a')],_0x17783d[_0x558a('0x2b')]);_0xb0975b['attributes']=_[_0x558a('0x2e')](_0x17783d[_0x558a('0x2a')],qs[_0x558a('0x2f')](_0x1c11be['query'][_0x558a('0x2f')]));_0xb0975b['attributes']=_0xb0975b['attributes'][_0x558a('0x30')]?_0xb0975b[_0x558a('0x31')]:_0x17783d['model'];if(!_0x1c11be[_0x558a('0x2b')]['hasOwnProperty'](_0x558a('0x32'))){_0xb0975b[_0x558a('0x17')]=qs['limit'](_0x1c11be['query']['limit']);_0xb0975b[_0x558a('0x15')]=qs[_0x558a('0x15')](_0x1c11be[_0x558a('0x2b')][_0x558a('0x15')]);}_0xb0975b[_0x558a('0x33')]=qs['sort'](_0x1c11be[_0x558a('0x2b')][_0x558a('0x34')]);_0xb0975b[_0x558a('0x35')]=qs[_0x558a('0x2d')](_[_0x558a('0x36')](_0x1c11be[_0x558a('0x2b')],_0x17783d['filters']),_0x5b91fa);if(_0x1c11be['query']['filter']){_0xb0975b[_0x558a('0x35')]=_['merge'](_0xb0975b[_0x558a('0x35')],{'$or':_[_0x558a('0x26')](_0x5b91fa,function(_0x9a3dba){if(_0x9a3dba[_0x558a('0x37')]!=='VIRTUAL'){var _0x18b510={};_0x18b510[_0x9a3dba[_0x558a('0x24')]]={'$like':'%'+_0x1c11be['query'][_0x558a('0x38')]+'%'};return _0x18b510;}})});}_0xb0975b=_[_0x558a('0x39')]({},_0xb0975b,_0x1c11be['options']);var _0x5bdf0d={'where':_0xb0975b[_0x558a('0x35')]};return db['MailSubstatus']['count'](_0x5bdf0d)[_0x558a('0x1f')](function(_0x14e1fb){_0x5a0a98[_0x558a('0x18')]=_0x14e1fb;if(_0x1c11be[_0x558a('0x2b')]['includeAll']){_0xb0975b['include']=[{'all':!![]}];}return db[_0x558a('0x27')][_0x558a('0x3a')](_0xb0975b);})[_0x558a('0x1f')](function(_0x1e346f){_0x5a0a98[_0x558a('0x3b')]=_0x1e346f;return _0x5a0a98;})[_0x558a('0x1f')](respondWithFilteredResult(_0x3e4929,_0xb0975b))[_0x558a('0x3c')](handleError(_0x3e4929,null));};exports[_0x558a('0x3d')]=function(_0xed331c,_0x28bfe7){var _0x1071b7={'raw':!![],'where':{'id':_0xed331c[_0x558a('0x3e')]['id']}},_0x59789c={};_0x59789c[_0x558a('0x2a')]=_['keys'](db[_0x558a('0x27')][_0x558a('0x28')]);_0x59789c[_0x558a('0x2b')]=_['keys'](_0xed331c[_0x558a('0x2b')]);_0x59789c[_0x558a('0x2d')]=_[_0x558a('0x2e')](_0x59789c[_0x558a('0x2a')],_0x59789c[_0x558a('0x2b')]);_0x1071b7[_0x558a('0x31')]=_[_0x558a('0x2e')](_0x59789c['model'],qs['fields'](_0xed331c['query']['fields']));_0x1071b7[_0x558a('0x31')]=_0x1071b7[_0x558a('0x31')][_0x558a('0x30')]?_0x1071b7[_0x558a('0x31')]:_0x59789c[_0x558a('0x2a')];if(_0xed331c[_0x558a('0x2b')][_0x558a('0x3f')]){_0x1071b7[_0x558a('0x40')]=[{'all':!![]}];}_0x1071b7=_[_0x558a('0x39')]({},_0x1071b7,_0xed331c[_0x558a('0x41')]);return db[_0x558a('0x27')][_0x558a('0x42')](_0x1071b7)[_0x558a('0x1f')](handleEntityNotFound(_0x28bfe7,null))[_0x558a('0x1f')](respondWithResult(_0x28bfe7,null))[_0x558a('0x3c')](handleError(_0x28bfe7,null));};exports[_0x558a('0x43')]=function(_0x3897f8,_0x4f2e24){return db[_0x558a('0x27')][_0x558a('0x43')](_0x3897f8[_0x558a('0x44')],{})[_0x558a('0x1f')](respondWithResult(_0x4f2e24,0xc9))[_0x558a('0x3c')](handleError(_0x4f2e24,null));};exports[_0x558a('0x45')]=function(_0x2d00f,_0x2b624a){if(_0x2d00f[_0x558a('0x44')]['id']){delete _0x2d00f[_0x558a('0x44')]['id'];}return db['MailSubstatus'][_0x558a('0x42')]({'where':{'id':_0x2d00f[_0x558a('0x3e')]['id']}})[_0x558a('0x1f')](handleEntityNotFound(_0x2b624a,null))[_0x558a('0x1f')](saveUpdates(_0x2d00f[_0x558a('0x44')],null))['then'](respondWithResult(_0x2b624a,null))[_0x558a('0x3c')](handleError(_0x2b624a,null));};exports['destroy']=function(_0x545eb5,_0xda842b){return db[_0x558a('0x27')][_0x558a('0x42')]({'where':{'id':_0x545eb5[_0x558a('0x3e')]['id']}})['then'](handleEntityNotFound(_0xda842b,null))[_0x558a('0x1f')](removeEntity(_0xda842b,null))['catch'](handleError(_0xda842b,null));};exports[_0x558a('0x46')]=function(_0x496b85,_0x3f840f){return db['MailSubstatus']['describe']()[_0x558a('0x1f')](respondWithResult(_0x3f840f,null))[_0x558a('0x3c')](handleError(_0x3f840f,null));}; \ No newline at end of file +var _0xab85=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','MailSubstatus','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x284863,_0x346c0d){var _0x3688f5=function(_0x2bfb95){while(--_0x2bfb95){_0x284863['push'](_0x284863['shift']());}};_0x3688f5(++_0x346c0d);}(_0xab85,0x1ed));var _0x5ab8=function(_0x4e6ed0,_0x22ed4a){_0x4e6ed0=_0x4e6ed0-0x0;var _0x2e0e84=_0xab85[_0x4e6ed0];return _0x2e0e84;};'use strict';var emlformat=require(_0x5ab8('0x0'));var rimraf=require(_0x5ab8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ab8('0x2'));var rp=require(_0x5ab8('0x3'));var moment=require(_0x5ab8('0x4'));var BPromise=require(_0x5ab8('0x5'));var Mustache=require(_0x5ab8('0x6'));var util=require(_0x5ab8('0x7'));var path=require(_0x5ab8('0x8'));var sox=require('sox');var csv=require(_0x5ab8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5ab8('0xa'));var crypto=require(_0x5ab8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ab8('0xc'));var Papa=require(_0x5ab8('0xd'));var Redis=require(_0x5ab8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5ab8('0xf'));var as=require(_0x5ab8('0x10'));var hardwareService=require(_0x5ab8('0x11'));var logger=require(_0x5ab8('0x12'))(_0x5ab8('0x13'));var utils=require('../../config/utils');var config=require(_0x5ab8('0x14'));var licenseUtil=require(_0x5ab8('0x15'));var db=require(_0x5ab8('0x16'))['db'];function respondWithStatusCode(_0x4327c3,_0x1c2ef1){_0x1c2ef1=_0x1c2ef1||0xcc;return function(_0x4cea03){if(_0x4cea03){return _0x4327c3['sendStatus'](_0x1c2ef1);}return _0x4327c3[_0x5ab8('0x17')](_0x1c2ef1)[_0x5ab8('0x18')]();};}function respondWithResult(_0x40ed82,_0x49880f){_0x49880f=_0x49880f||0xc8;return function(_0x5c6d21){if(_0x5c6d21){return _0x40ed82[_0x5ab8('0x17')](_0x49880f)[_0x5ab8('0x19')](_0x5c6d21);}};}function respondWithFilteredResult(_0x2ac531,_0x5d8617){return function(_0x5e68f2){if(_0x5e68f2){var _0x452e9d=typeof _0x5d8617[_0x5ab8('0x1a')]===_0x5ab8('0x1b')&&typeof _0x5d8617[_0x5ab8('0x1c')]===_0x5ab8('0x1b');var _0x537058=_0x5e68f2['count'];var _0x232819=_0x452e9d?0x0:_0x5d8617[_0x5ab8('0x1a')];var _0x29054c=_0x452e9d?_0x5e68f2[_0x5ab8('0x1d')]:_0x5d8617[_0x5ab8('0x1a')]+_0x5d8617[_0x5ab8('0x1c')];var _0x34e87d;if(_0x29054c>=_0x537058){_0x29054c=_0x537058;_0x34e87d=0xc8;}else{_0x34e87d=0xce;}_0x2ac531[_0x5ab8('0x17')](_0x34e87d);return _0x2ac531[_0x5ab8('0x1e')](_0x5ab8('0x1f'),_0x232819+'-'+_0x29054c+'/'+_0x537058)[_0x5ab8('0x19')](_0x5e68f2);}return null;};}function patchUpdates(_0x23f367){return function(_0x31f60a){try{jsonpatch[_0x5ab8('0x20')](_0x31f60a,_0x23f367,!![]);}catch(_0x2aa5fe){return BPromise['reject'](_0x2aa5fe);}return _0x31f60a['save']();};}function saveUpdates(_0x51f4eb,_0x56fd05){return function(_0x5f59de){if(_0x5f59de){return _0x5f59de[_0x5ab8('0x21')](_0x51f4eb)[_0x5ab8('0x22')](function(_0x49e444){return _0x49e444;});}return null;};}function removeEntity(_0x405687,_0x280391){return function(_0x408a85){if(_0x408a85){return _0x408a85[_0x5ab8('0x23')]()[_0x5ab8('0x22')](function(){_0x405687[_0x5ab8('0x17')](0xcc)[_0x5ab8('0x18')]();});}};}function handleEntityNotFound(_0x4758bf,_0x236b29){return function(_0x3ba5ed){if(!_0x3ba5ed){_0x4758bf[_0x5ab8('0x24')](0x194);}return _0x3ba5ed;};}function handleError(_0x33a7c0,_0x2bafd9){_0x2bafd9=_0x2bafd9||0x1f4;return function(_0x4a0b05){logger[_0x5ab8('0x25')](_0x4a0b05[_0x5ab8('0x26')]);if(_0x4a0b05[_0x5ab8('0x27')]){delete _0x4a0b05['name'];}_0x33a7c0[_0x5ab8('0x17')](_0x2bafd9)['send'](_0x4a0b05);};}exports[_0x5ab8('0x28')]=function(_0x55da46,_0x34f2de){var _0x33b290={},_0x23bfb7={},_0x45b661={'count':0x0,'rows':[]};var _0x5f19ef=_[_0x5ab8('0x29')](db['MailSubstatus'][_0x5ab8('0x2a')],function(_0x38958c){return{'name':_0x38958c[_0x5ab8('0x2b')],'type':_0x38958c[_0x5ab8('0x2c')][_0x5ab8('0x2d')]};});_0x23bfb7[_0x5ab8('0x2e')]=_['map'](_0x5f19ef,'name');_0x23bfb7[_0x5ab8('0x2f')]=_[_0x5ab8('0x30')](_0x55da46[_0x5ab8('0x2f')]);_0x23bfb7['filters']=_[_0x5ab8('0x31')](_0x23bfb7[_0x5ab8('0x2e')],_0x23bfb7[_0x5ab8('0x2f')]);_0x33b290[_0x5ab8('0x32')]=_[_0x5ab8('0x31')](_0x23bfb7[_0x5ab8('0x2e')],qs[_0x5ab8('0x33')](_0x55da46[_0x5ab8('0x2f')][_0x5ab8('0x33')]));_0x33b290[_0x5ab8('0x32')]=_0x33b290[_0x5ab8('0x32')]['length']?_0x33b290['attributes']:_0x23bfb7[_0x5ab8('0x2e')];if(!_0x55da46[_0x5ab8('0x2f')]['hasOwnProperty'](_0x5ab8('0x34'))){_0x33b290[_0x5ab8('0x1c')]=qs[_0x5ab8('0x1c')](_0x55da46[_0x5ab8('0x2f')][_0x5ab8('0x1c')]);_0x33b290[_0x5ab8('0x1a')]=qs[_0x5ab8('0x1a')](_0x55da46[_0x5ab8('0x2f')][_0x5ab8('0x1a')]);}_0x33b290['order']=qs[_0x5ab8('0x35')](_0x55da46['query'][_0x5ab8('0x35')]);_0x33b290[_0x5ab8('0x36')]=qs[_0x5ab8('0x37')](_[_0x5ab8('0x38')](_0x55da46[_0x5ab8('0x2f')],_0x23bfb7[_0x5ab8('0x37')]),_0x5f19ef);if(_0x55da46[_0x5ab8('0x2f')]['filter']){_0x33b290[_0x5ab8('0x36')]=_['merge'](_0x33b290[_0x5ab8('0x36')],{'$or':_[_0x5ab8('0x29')](_0x5f19ef,function(_0x13dbc2){if(_0x13dbc2['type']!==_0x5ab8('0x39')){var _0x162d94={};_0x162d94[_0x13dbc2['name']]={'$like':'%'+_0x55da46[_0x5ab8('0x2f')]['filter']+'%'};return _0x162d94;}})});}_0x33b290=_[_0x5ab8('0x3a')]({},_0x33b290,_0x55da46[_0x5ab8('0x3b')]);var _0x55c203={'where':_0x33b290[_0x5ab8('0x36')]};return db[_0x5ab8('0x3c')][_0x5ab8('0x1d')](_0x55c203)['then'](function(_0x3dc575){_0x45b661[_0x5ab8('0x1d')]=_0x3dc575;if(_0x55da46[_0x5ab8('0x2f')][_0x5ab8('0x3d')]){_0x33b290[_0x5ab8('0x3e')]=[{'all':!![]}];}return db[_0x5ab8('0x3c')][_0x5ab8('0x3f')](_0x33b290);})[_0x5ab8('0x22')](function(_0x5ca497){_0x45b661[_0x5ab8('0x40')]=_0x5ca497;return _0x45b661;})[_0x5ab8('0x22')](respondWithFilteredResult(_0x34f2de,_0x33b290))[_0x5ab8('0x41')](handleError(_0x34f2de,null));};exports[_0x5ab8('0x42')]=function(_0x1a26d1,_0x5e928a){var _0x4be0c3={'raw':!![],'where':{'id':_0x1a26d1['params']['id']}},_0x4d1587={};_0x4d1587[_0x5ab8('0x2e')]=_[_0x5ab8('0x30')](db[_0x5ab8('0x3c')][_0x5ab8('0x2a')]);_0x4d1587[_0x5ab8('0x2f')]=_[_0x5ab8('0x30')](_0x1a26d1[_0x5ab8('0x2f')]);_0x4d1587['filters']=_[_0x5ab8('0x31')](_0x4d1587[_0x5ab8('0x2e')],_0x4d1587[_0x5ab8('0x2f')]);_0x4be0c3['attributes']=_[_0x5ab8('0x31')](_0x4d1587[_0x5ab8('0x2e')],qs[_0x5ab8('0x33')](_0x1a26d1['query'][_0x5ab8('0x33')]));_0x4be0c3[_0x5ab8('0x32')]=_0x4be0c3[_0x5ab8('0x32')][_0x5ab8('0x43')]?_0x4be0c3['attributes']:_0x4d1587['model'];if(_0x1a26d1['query'][_0x5ab8('0x3d')]){_0x4be0c3[_0x5ab8('0x3e')]=[{'all':!![]}];}_0x4be0c3=_['merge']({},_0x4be0c3,_0x1a26d1[_0x5ab8('0x3b')]);return db['MailSubstatus'][_0x5ab8('0x44')](_0x4be0c3)[_0x5ab8('0x22')](handleEntityNotFound(_0x5e928a,null))[_0x5ab8('0x22')](respondWithResult(_0x5e928a,null))[_0x5ab8('0x41')](handleError(_0x5e928a,null));};exports[_0x5ab8('0x45')]=function(_0x3476c6,_0x1db87e){return db[_0x5ab8('0x3c')]['create'](_0x3476c6[_0x5ab8('0x46')],{})[_0x5ab8('0x22')](respondWithResult(_0x1db87e,0xc9))[_0x5ab8('0x41')](handleError(_0x1db87e,null));};exports[_0x5ab8('0x21')]=function(_0xfd20d6,_0x2dbd39){if(_0xfd20d6[_0x5ab8('0x46')]['id']){delete _0xfd20d6[_0x5ab8('0x46')]['id'];}return db['MailSubstatus'][_0x5ab8('0x44')]({'where':{'id':_0xfd20d6['params']['id']}})[_0x5ab8('0x22')](handleEntityNotFound(_0x2dbd39,null))[_0x5ab8('0x22')](saveUpdates(_0xfd20d6['body'],null))[_0x5ab8('0x22')](respondWithResult(_0x2dbd39,null))[_0x5ab8('0x41')](handleError(_0x2dbd39,null));};exports[_0x5ab8('0x23')]=function(_0x219d29,_0xa65bd5){return db[_0x5ab8('0x3c')][_0x5ab8('0x44')]({'where':{'id':_0x219d29[_0x5ab8('0x47')]['id']}})[_0x5ab8('0x22')](handleEntityNotFound(_0xa65bd5,null))[_0x5ab8('0x22')](removeEntity(_0xa65bd5,null))['catch'](handleError(_0xa65bd5,null));};exports[_0x5ab8('0x48')]=function(_0x2c1529,_0x4a9c03){return db[_0x5ab8('0x3c')][_0x5ab8('0x48')]()[_0x5ab8('0x22')](respondWithResult(_0x4a9c03,null))[_0x5ab8('0x41')](handleError(_0x4a9c03,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 885d10c..82719de 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 _0xe086=['hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit'];(function(_0x37eb7c,_0x3f53f0){var _0x1a1167=function(_0x48f751){while(--_0x48f751){_0x37eb7c['push'](_0x37eb7c['shift']());}};_0x1a1167(++_0x3f53f0);}(_0xe086,0x142));var _0x6e08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe086[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6e08('0x0'));var MailSubstatus=require(_0x6e08('0x1'))['db'][_0x6e08('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6e08('0x3')](0x0);var events={'afterUpdate':_0x6e08('0x4')};function emitEvent(_0x58e5a4){return function(_0x3b33f5,_0x4fd445,_0x42cb5f){MailSubstatusEvents[_0x6e08('0x5')](_0x58e5a4+':'+_0x3b33f5['id'],_0x3b33f5);MailSubstatusEvents[_0x6e08('0x5')](_0x58e5a4,_0x3b33f5);_0x42cb5f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x6e08('0x6')](e,emitEvent(event));}}module[_0x6e08('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xb1e0=['MailSubstatus','setMaxListeners','update','emit','hook','exports','events'];(function(_0x484f8a,_0x5eb358){var _0x83631d=function(_0x2c3eeb){while(--_0x2c3eeb){_0x484f8a['push'](_0x484f8a['shift']());}};_0x83631d(++_0x5eb358);}(_0xb1e0,0xb5));var _0x0b1e=function(_0xa12236,_0x4d37b0){_0xa12236=_0xa12236-0x0;var _0x45091b=_0xb1e0[_0xa12236];return _0x45091b;};'use strict';var EventEmitter=require(_0x0b1e('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x0b1e('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0b1e('0x2')](0x0);var events={'afterUpdate':_0x0b1e('0x3')};function emitEvent(_0x42b180){return function(_0x2d7047,_0x3fa572,_0x48756c){MailSubstatusEvents[_0x0b1e('0x4')](_0x42b180+':'+_0x2d7047['id'],_0x2d7047);MailSubstatusEvents['emit'](_0x42b180,_0x2d7047);_0x48756c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x0b1e('0x5')](e,emitEvent(event));}}module[_0x0b1e('0x6')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 042039e..efc6a93 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 _0xea59=['Condition','update','mailSubstatus','name','then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses'];(function(_0x35cafb,_0x5e3489){var _0x4f7d13=function(_0x5c11b8){while(--_0x5c11b8){_0x35cafb['push'](_0x35cafb['shift']());}};_0x4f7d13(++_0x5e3489);}(_0xea59,0x1ea));var _0x9ea5=function(_0x3df364,_0x3943d2){_0x3df364=_0x3df364-0x0;var _0xe6547a=_0xea59[_0x3df364];return _0xe6547a;};'use strict';var attributes=require(_0x9ea5('0x0'));module[_0x9ea5('0x1')]=function(_0x488c6e){var _0x17df1b=_0x488c6e[_0x9ea5('0x2')];return _0x488c6e[_0x9ea5('0x3')]('MailSubstatus',attributes,{'tableName':_0x9ea5('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x300433,_0x260e8b,_0x25d57f){return _0x17df1b[_0x9ea5('0x5')][_0x9ea5('0x6')]({'value':_0x300433['name']},{'where':{'field':_0x9ea5('0x7'),'value':_0x300433['_previousDataValues'][_0x9ea5('0x8')]}})[_0x9ea5('0x9')](function(){_0x25d57f();})[_0x9ea5('0xa')](function(_0x216abf){_0x25d57f(_0x216abf);});}}});}; \ No newline at end of file +var _0x1534=['then','catch','./mailSubstatus.attributes','exports','models','define','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues'];(function(_0x4a8a48,_0x2c4409){var _0x4e6c45=function(_0x4aa716){while(--_0x4aa716){_0x4a8a48['push'](_0x4a8a48['shift']());}};_0x4e6c45(++_0x2c4409);}(_0x1534,0xda));var _0x4153=function(_0xa808d9,_0x186110){_0xa808d9=_0xa808d9-0x0;var _0x2ae6af=_0x1534[_0xa808d9];return _0x2ae6af;};'use strict';var attributes=require(_0x4153('0x0'));module[_0x4153('0x1')]=function(_0xa85771){var _0x50cd35=_0xa85771[_0x4153('0x2')];return _0xa85771[_0x4153('0x3')]('MailSubstatus',attributes,{'tableName':_0x4153('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xb1b5f7,_0x4fbdd2,_0x308068){return _0x50cd35[_0x4153('0x5')][_0x4153('0x6')]({'value':_0xb1b5f7[_0x4153('0x7')]},{'where':{'field':_0x4153('0x8'),'value':_0xb1b5f7[_0x4153('0x9')][_0x4153('0x7')]}})[_0x4153('0xa')](function(){_0x308068();})[_0x4153('0xb')](function(_0x71fcb9){_0x308068(_0x71fcb9);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 6f8b2f8..b798f2d 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 _0xb514=['MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x40d9ed,_0x21b85a){var _0x37c713=function(_0x4da0ce){while(--_0x4da0ce){_0x40d9ed['push'](_0x40d9ed['shift']());}};_0x37c713(++_0x21b85a);}(_0xb514,0xc6));var _0x4b51=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xb514[_0x1b3a5c];return _0x2ae8cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b51('0x0'));var BPromise=require(_0x4b51('0x1'));var rs=require(_0x4b51('0x2'));var fs=require('fs');var Redis=require(_0x4b51('0x3'));var db=require(_0x4b51('0x4'))['db'];var utils=require(_0x4b51('0x5'));var logger=require('../../config/logger')(_0x4b51('0x6'));var config=require(_0x4b51('0x7'));var jayson=require(_0x4b51('0x8'));var client=jayson[_0x4b51('0x9')][_0x4b51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59ca87,_0x1f8a25,_0x5ce9be){return new BPromise(function(_0x28dc82,_0x2326d0){return client['request'](_0x59ca87,_0x5ce9be)['then'](function(_0x52e371){logger[_0x4b51('0xb')](_0x4b51('0xc'),_0x1f8a25,_0x4b51('0xd'));logger[_0x4b51('0xe')](_0x4b51('0xf'),_0x1f8a25,'request\x20sent',JSON[_0x4b51('0x10')](_0x52e371));if(_0x52e371[_0x4b51('0x11')]){if(_0x52e371[_0x4b51('0x11')][_0x4b51('0x12')]===0x1f4){logger[_0x4b51('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1f8a25,_0x52e371['error'][_0x4b51('0x13')]);return _0x2326d0(_0x52e371[_0x4b51('0x11')][_0x4b51('0x13')]);}logger[_0x4b51('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1f8a25,_0x52e371[_0x4b51('0x11')][_0x4b51('0x13')]);return _0x28dc82(_0x52e371[_0x4b51('0x11')]['message']);}else{logger[_0x4b51('0xb')](_0x4b51('0xc'),_0x1f8a25,_0x4b51('0xd'));_0x28dc82(_0x52e371[_0x4b51('0x14')][_0x4b51('0x13')]);}})['catch'](function(_0xfa1285){logger[_0x4b51('0x11')](_0x4b51('0xc'),_0x1f8a25,_0xfa1285);_0x2326d0(_0xfa1285);});});} \ No newline at end of file +var _0xd48a=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','then','MailSubstatus,\x20%s,\x20%s','request\x20sent'];(function(_0x47d493,_0x3bedfb){var _0x50242a=function(_0x473bd6){while(--_0x473bd6){_0x47d493['push'](_0x47d493['shift']());}};_0x50242a(++_0x3bedfb);}(_0xd48a,0x8c));var _0xad48=function(_0x58017c,_0x1fb63a){_0x58017c=_0x58017c-0x0;var _0x1cb5d7=_0xd48a[_0x58017c];return _0x1cb5d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xad48('0x0'));var BPromise=require(_0xad48('0x1'));var rs=require(_0xad48('0x2'));var fs=require('fs');var Redis=require(_0xad48('0x3'));var db=require(_0xad48('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xad48('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xad48('0x6'));var client=jayson[_0xad48('0x7')][_0xad48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb8b3bf,_0x3d13b7,_0x2511c4){return new BPromise(function(_0x26b9fd,_0x164a02){return client['request'](_0xb8b3bf,_0x2511c4)[_0xad48('0x9')](function(_0x2511a1){logger['info'](_0xad48('0xa'),_0x3d13b7,_0xad48('0xb'));logger[_0xad48('0xc')](_0xad48('0xd'),_0x3d13b7,_0xad48('0xb'),JSON['stringify'](_0x2511a1));if(_0x2511a1[_0xad48('0xe')]){if(_0x2511a1['error'][_0xad48('0xf')]===0x1f4){logger[_0xad48('0xe')](_0xad48('0xa'),_0x3d13b7,_0x2511a1[_0xad48('0xe')][_0xad48('0x10')]);return _0x164a02(_0x2511a1[_0xad48('0xe')][_0xad48('0x10')]);}logger[_0xad48('0xe')](_0xad48('0xa'),_0x3d13b7,_0x2511a1[_0xad48('0xe')][_0xad48('0x10')]);return _0x26b9fd(_0x2511a1[_0xad48('0xe')][_0xad48('0x10')]);}else{logger[_0xad48('0x11')](_0xad48('0xa'),_0x3d13b7,_0xad48('0xb'));_0x26b9fd(_0x2511a1[_0xad48('0x12')]['message']);}})['catch'](function(_0x12b025){logger[_0xad48('0xe')](_0xad48('0xa'),_0x3d13b7,_0x12b025);_0x164a02(_0x12b025);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 9b3a081..ea3de80 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 _0x6ae3=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','post','create','/:id','update','destroy','exports'];(function(_0x182baf,_0x1375fb){var _0x4d10f1=function(_0x1e0dde){while(--_0x1e0dde){_0x182baf['push'](_0x182baf['shift']());}};_0x4d10f1(++_0x1375fb);}(_0x6ae3,0x1c2));var _0x36ae=function(_0x4952af,_0x33bf56){_0x4952af=_0x4952af-0x0;var _0xe0819a=_0x6ae3[_0x4952af];return _0xe0819a;};'use strict';var multer=require(_0x36ae('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x36ae('0x1'));var express=require(_0x36ae('0x2'));var router=express[_0x36ae('0x3')]();var fs_extra=require(_0x36ae('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x36ae('0x5'));var config=require(_0x36ae('0x6'));var controller=require(_0x36ae('0x7'));router[_0x36ae('0x8')]('/',auth[_0x36ae('0x9')](),controller['index']);router[_0x36ae('0x8')](_0x36ae('0xa'),auth[_0x36ae('0x9')](),controller[_0x36ae('0xb')]);router[_0x36ae('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x36ae('0xc')]('/',auth[_0x36ae('0x9')](),controller[_0x36ae('0xd')]);router['put'](_0x36ae('0xe'),auth[_0x36ae('0x9')](),controller[_0x36ae('0xf')]);router['delete']('/:id',auth[_0x36ae('0x9')](),controller[_0x36ae('0x10')]);module[_0x36ae('0x11')]=router; \ No newline at end of file +var _0xa8a5=['express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','path'];(function(_0x51e178,_0x13aa7f){var _0x3e778b=function(_0x29bfce){while(--_0x29bfce){_0x51e178['push'](_0x51e178['shift']());}};_0x3e778b(++_0x13aa7f);}(_0xa8a5,0x1d2));var _0x5a8a=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0xa8a5[_0x39772f];return _0xc9edbf;};'use strict';var multer=require(_0x5a8a('0x0'));var util=require('util');var path=require(_0x5a8a('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a8a('0x2'));var router=express['Router']();var fs_extra=require(_0x5a8a('0x3'));var auth=require(_0x5a8a('0x4'));var interaction=require(_0x5a8a('0x5'));var config=require('../../config/environment');var controller=require(_0x5a8a('0x6'));router[_0x5a8a('0x7')]('/',auth[_0x5a8a('0x8')](),controller['index']);router[_0x5a8a('0x7')](_0x5a8a('0x9'),auth[_0x5a8a('0x8')](),controller[_0x5a8a('0xa')]);router['get'](_0x5a8a('0xb'),auth[_0x5a8a('0x8')](),controller[_0x5a8a('0xc')]);router[_0x5a8a('0xd')]('/',auth[_0x5a8a('0x8')](),controller[_0x5a8a('0xe')]);router['put'](_0x5a8a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5a8a('0xf')](_0x5a8a('0xb'),auth[_0x5a8a('0x8')](),controller[_0x5a8a('0x10')]);module[_0x5a8a('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4d39cd6..1cc3b90 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5209ef,_0x3a4592){var _0x63f75f=function(_0x2591e1){while(--_0x2591e1){_0x5209ef['push'](_0x5209ef['shift']());}};_0x63f75f(++_0x3a4592);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x56ebb4,_0x19cacb){var _0x1fbb7f=function(_0x5354ce){while(--_0x5354ce){_0x56ebb4['push'](_0x56ebb4['shift']());}};_0x1fbb7f(++_0x19cacb);}(_0xf4eb,0xec));var _0xbf4e=function(_0x54858c,_0x4aa170){_0x54858c=_0x54858c-0x0;var _0x4466d0=_0xf4eb[_0x54858c];return _0x4466d0;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 0ac35c3..4ddaacb 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 _0xf57f=['rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','show','params','length','find','catch','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','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','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','end','error','stack','name','send','index','MailTransferReport'];(function(_0x1b4aa4,_0x1c8a03){var _0x565266=function(_0xb5746a){while(--_0xb5746a){_0x1b4aa4['push'](_0x1b4aa4['shift']());}};_0x565266(++_0x1c8a03);}(_0xf57f,0x6d));var _0xff57=function(_0x2a99ea,_0x1bfb13){_0x2a99ea=_0x2a99ea-0x0;var _0x5887ae=_0xf57f[_0x2a99ea];return _0x5887ae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff57('0x0'));var jsonpatch=require(_0xff57('0x1'));var rp=require(_0xff57('0x2'));var moment=require(_0xff57('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff57('0x4'));var util=require(_0xff57('0x5'));var path=require(_0xff57('0x6'));var sox=require('sox');var csv=require(_0xff57('0x7'));var ejs=require(_0xff57('0x8'));var fs=require('fs');var fs_extra=require(_0xff57('0x9'));var _=require(_0xff57('0xa'));var squel=require(_0xff57('0xb'));var crypto=require(_0xff57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xff57('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xff57('0xe'));var Redis=require(_0xff57('0xf'));var authService=require(_0xff57('0x10'));var qs=require(_0xff57('0x11'));var as=require(_0xff57('0x12'));var hardwareService=require(_0xff57('0x13'));var logger=require(_0xff57('0x14'))(_0xff57('0x15'));var utils=require(_0xff57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f4ba2,_0x29fc4d){_0x29fc4d=_0x29fc4d||0xcc;return function(_0x46187c){if(_0x46187c){return _0x5f4ba2[_0xff57('0x17')](_0x29fc4d);}return _0x5f4ba2[_0xff57('0x18')](_0x29fc4d)['end']();};}function respondWithResult(_0x5da1cb,_0xdc6769){_0xdc6769=_0xdc6769||0xc8;return function(_0x2e72aa){if(_0x2e72aa){return _0x5da1cb[_0xff57('0x18')](_0xdc6769)['json'](_0x2e72aa);}};}function respondWithFilteredResult(_0x317caa,_0x3070da){return function(_0x215c2d){if(_0x215c2d){var _0x1bf780=typeof _0x3070da[_0xff57('0x19')]===_0xff57('0x1a')&&typeof _0x3070da[_0xff57('0x1b')]===_0xff57('0x1a');var _0x378b6c=_0x215c2d[_0xff57('0x1c')];var _0x593b45=_0x1bf780?0x0:_0x3070da[_0xff57('0x19')];var _0x209ad7=_0x1bf780?_0x215c2d[_0xff57('0x1c')]:_0x3070da[_0xff57('0x19')]+_0x3070da['limit'];var _0x32196a;if(_0x209ad7>=_0x378b6c){_0x209ad7=_0x378b6c;_0x32196a=0xc8;}else{_0x32196a=0xce;}_0x317caa[_0xff57('0x18')](_0x32196a);return _0x317caa[_0xff57('0x1d')](_0xff57('0x1e'),_0x593b45+'-'+_0x209ad7+'/'+_0x378b6c)[_0xff57('0x1f')](_0x215c2d);}return null;};}function patchUpdates(_0x505ab1){return function(_0x6c5f90){try{jsonpatch[_0xff57('0x20')](_0x6c5f90,_0x505ab1,!![]);}catch(_0x2f31b4){return BPromise['reject'](_0x2f31b4);}return _0x6c5f90[_0xff57('0x21')]();};}function saveUpdates(_0x2a1c76,_0x28265d){return function(_0x1e1425){if(_0x1e1425){return _0x1e1425[_0xff57('0x22')](_0x2a1c76)[_0xff57('0x23')](function(_0x2506ea){return _0x2506ea;});}return null;};}function removeEntity(_0x28091a,_0x11ece5){return function(_0x399d8e){if(_0x399d8e){return _0x399d8e['destroy']()[_0xff57('0x23')](function(){_0x28091a[_0xff57('0x18')](0xcc)[_0xff57('0x24')]();});}};}function handleEntityNotFound(_0x1c9483,_0x2da72f){return function(_0x2b4cbb){if(!_0x2b4cbb){_0x1c9483[_0xff57('0x17')](0x194);}return _0x2b4cbb;};}function handleError(_0xeefea0,_0x574621){_0x574621=_0x574621||0x1f4;return function(_0x1035c7){logger[_0xff57('0x25')](_0x1035c7[_0xff57('0x26')]);if(_0x1035c7[_0xff57('0x27')]){delete _0x1035c7['name'];}_0xeefea0[_0xff57('0x18')](_0x574621)[_0xff57('0x28')](_0x1035c7);};}exports[_0xff57('0x29')]=function(_0x31c6d3,_0x244928){var _0x12bdc4={},_0x2be948={},_0x3974ae={'count':0x0,'rows':[]};var _0x2cf65c=_['map'](db[_0xff57('0x2a')][_0xff57('0x2b')],function(_0x53a012){return{'name':_0x53a012[_0xff57('0x2c')],'type':_0x53a012[_0xff57('0x2d')]['key']};});_0x2be948[_0xff57('0x2e')]=_[_0xff57('0x2f')](_0x2cf65c,'name');_0x2be948[_0xff57('0x30')]=_[_0xff57('0x31')](_0x31c6d3['query']);_0x2be948[_0xff57('0x32')]=_[_0xff57('0x33')](_0x2be948[_0xff57('0x2e')],_0x2be948[_0xff57('0x30')]);_0x12bdc4[_0xff57('0x34')]=_[_0xff57('0x33')](_0x2be948[_0xff57('0x2e')],qs[_0xff57('0x35')](_0x31c6d3[_0xff57('0x30')][_0xff57('0x35')]));_0x12bdc4['attributes']=_0x12bdc4[_0xff57('0x34')]['length']?_0x12bdc4['attributes']:_0x2be948[_0xff57('0x2e')];if(!_0x31c6d3['query'][_0xff57('0x36')](_0xff57('0x37'))){_0x12bdc4[_0xff57('0x1b')]=qs['limit'](_0x31c6d3[_0xff57('0x30')]['limit']);_0x12bdc4[_0xff57('0x19')]=qs[_0xff57('0x19')](_0x31c6d3['query'][_0xff57('0x19')]);}_0x12bdc4[_0xff57('0x38')]=qs[_0xff57('0x39')](_0x31c6d3[_0xff57('0x30')]['sort']);_0x12bdc4['where']=qs['filters'](_[_0xff57('0x3a')](_0x31c6d3[_0xff57('0x30')],_0x2be948[_0xff57('0x32')]),_0x2cf65c);if(_0x31c6d3[_0xff57('0x30')][_0xff57('0x3b')]){_0x12bdc4['where']=_['merge'](_0x12bdc4['where'],{'$or':_[_0xff57('0x2f')](_0x2cf65c,function(_0x3664f3){if(_0x3664f3['type']!==_0xff57('0x3c')){var _0x11ade7={};_0x11ade7[_0x3664f3[_0xff57('0x27')]]={'$like':'%'+_0x31c6d3[_0xff57('0x30')]['filter']+'%'};return _0x11ade7;}})});}_0x12bdc4=_[_0xff57('0x3d')]({},_0x12bdc4,_0x31c6d3[_0xff57('0x3e')]);var _0x51c993={'where':_0x12bdc4[_0xff57('0x3f')]};return db[_0xff57('0x2a')][_0xff57('0x1c')](_0x51c993)[_0xff57('0x23')](function(_0x4bb42b){_0x3974ae['count']=_0x4bb42b;if(_0x31c6d3[_0xff57('0x30')][_0xff57('0x40')]){_0x12bdc4[_0xff57('0x41')]=[{'all':!![]}];}return db[_0xff57('0x2a')][_0xff57('0x42')](_0x12bdc4);})[_0xff57('0x23')](function(_0x3372f0){_0x3974ae[_0xff57('0x43')]=_0x3372f0;return _0x3974ae;})[_0xff57('0x23')](respondWithFilteredResult(_0x244928,_0x12bdc4))['catch'](handleError(_0x244928,null));};exports[_0xff57('0x44')]=function(_0x25edf0,_0x3b563e){var _0x562daf={'raw':!![],'where':{'id':_0x25edf0[_0xff57('0x45')]['id']}},_0x46ea8c={};_0x46ea8c[_0xff57('0x2e')]=_[_0xff57('0x31')](db['MailTransferReport'][_0xff57('0x2b')]);_0x46ea8c[_0xff57('0x30')]=_[_0xff57('0x31')](_0x25edf0['query']);_0x46ea8c[_0xff57('0x32')]=_[_0xff57('0x33')](_0x46ea8c[_0xff57('0x2e')],_0x46ea8c[_0xff57('0x30')]);_0x562daf[_0xff57('0x34')]=_[_0xff57('0x33')](_0x46ea8c[_0xff57('0x2e')],qs['fields'](_0x25edf0['query'][_0xff57('0x35')]));_0x562daf[_0xff57('0x34')]=_0x562daf[_0xff57('0x34')][_0xff57('0x46')]?_0x562daf[_0xff57('0x34')]:_0x46ea8c[_0xff57('0x2e')];if(_0x25edf0[_0xff57('0x30')]['includeAll']){_0x562daf['include']=[{'all':!![]}];}_0x562daf=_[_0xff57('0x3d')]({},_0x562daf,_0x25edf0[_0xff57('0x3e')]);return db['MailTransferReport'][_0xff57('0x47')](_0x562daf)[_0xff57('0x23')](handleEntityNotFound(_0x3b563e,null))[_0xff57('0x23')](respondWithResult(_0x3b563e,null))[_0xff57('0x48')](handleError(_0x3b563e,null));};exports['create']=function(_0x5f5995,_0x1bef64){return db[_0xff57('0x2a')]['create'](_0x5f5995['body'],{})[_0xff57('0x23')](respondWithResult(_0x1bef64,0xc9))[_0xff57('0x48')](handleError(_0x1bef64,null));};exports[_0xff57('0x22')]=function(_0x4bc9f9,_0x4f843e){if(_0x4bc9f9[_0xff57('0x49')]['id']){delete _0x4bc9f9[_0xff57('0x49')]['id'];}return db[_0xff57('0x2a')]['find']({'where':{'id':_0x4bc9f9[_0xff57('0x45')]['id']}})[_0xff57('0x23')](handleEntityNotFound(_0x4f843e,null))[_0xff57('0x23')](saveUpdates(_0x4bc9f9['body'],null))[_0xff57('0x23')](respondWithResult(_0x4f843e,null))[_0xff57('0x48')](handleError(_0x4f843e,null));};exports[_0xff57('0x4a')]=function(_0x2a343f,_0x1f6ed3){return db[_0xff57('0x2a')][_0xff57('0x47')]({'where':{'id':_0x2a343f[_0xff57('0x45')]['id']}})[_0xff57('0x23')](handleEntityNotFound(_0x1f6ed3,null))[_0xff57('0x23')](removeEntity(_0x1f6ed3,null))[_0xff57('0x48')](handleError(_0x1f6ed3,null));};exports[_0xff57('0x4b')]=function(_0x362047,_0x3030c6){return db[_0xff57('0x2a')][_0xff57('0x4b')]()[_0xff57('0x23')](respondWithResult(_0x3030c6,null))[_0xff57('0x48')](handleError(_0x3030c6,null));}; \ No newline at end of file +var _0x0444=['where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter'];(function(_0x45812c,_0x5442eb){var _0x234115=function(_0x2e4dfe){while(--_0x2e4dfe){_0x45812c['push'](_0x45812c['shift']());}};_0x234115(++_0x5442eb);}(_0x0444,0xaa));var _0x4044=function(_0x408de0,_0x3c5b89){_0x408de0=_0x408de0-0x0;var _0x21e649=_0x0444[_0x408de0];return _0x21e649;};'use strict';var emlformat=require(_0x4044('0x0'));var rimraf=require(_0x4044('0x1'));var zipdir=require(_0x4044('0x2'));var jsonpatch=require(_0x4044('0x3'));var rp=require('request-promise');var moment=require(_0x4044('0x4'));var BPromise=require(_0x4044('0x5'));var Mustache=require(_0x4044('0x6'));var util=require(_0x4044('0x7'));var path=require('path');var sox=require(_0x4044('0x8'));var csv=require(_0x4044('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4044('0xa'));var _=require('lodash');var squel=require(_0x4044('0xb'));var crypto=require(_0x4044('0xc'));var jsforce=require(_0x4044('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4044('0x9'));var querystring=require(_0x4044('0xe'));var Papa=require(_0x4044('0xf'));var Redis=require(_0x4044('0x10'));var authService=require(_0x4044('0x11'));var qs=require(_0x4044('0x12'));var as=require(_0x4044('0x13'));var hardwareService=require(_0x4044('0x14'));var logger=require('../../config/logger')(_0x4044('0x15'));var utils=require('../../config/utils');var config=require(_0x4044('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4044('0x17'))['db'];function respondWithStatusCode(_0x38a10a,_0x42a16c){_0x42a16c=_0x42a16c||0xcc;return function(_0x3b46be){if(_0x3b46be){return _0x38a10a[_0x4044('0x18')](_0x42a16c);}return _0x38a10a[_0x4044('0x19')](_0x42a16c)[_0x4044('0x1a')]();};}function respondWithResult(_0x1ad916,_0x53289d){_0x53289d=_0x53289d||0xc8;return function(_0xe85daf){if(_0xe85daf){return _0x1ad916['status'](_0x53289d)[_0x4044('0x1b')](_0xe85daf);}};}function respondWithFilteredResult(_0x13762d,_0x4f2691){return function(_0x5dfb61){if(_0x5dfb61){var _0x2ed2ea=typeof _0x4f2691[_0x4044('0x1c')]===_0x4044('0x1d')&&typeof _0x4f2691['limit']===_0x4044('0x1d');var _0x25182c=_0x5dfb61[_0x4044('0x1e')];var _0x532989=_0x2ed2ea?0x0:_0x4f2691['offset'];var _0x335e21=_0x2ed2ea?_0x5dfb61[_0x4044('0x1e')]:_0x4f2691['offset']+_0x4f2691[_0x4044('0x1f')];var _0x31c100;if(_0x335e21>=_0x25182c){_0x335e21=_0x25182c;_0x31c100=0xc8;}else{_0x31c100=0xce;}_0x13762d['status'](_0x31c100);return _0x13762d[_0x4044('0x20')](_0x4044('0x21'),_0x532989+'-'+_0x335e21+'/'+_0x25182c)[_0x4044('0x1b')](_0x5dfb61);}return null;};}function patchUpdates(_0x1f18d1){return function(_0x4844fc){try{jsonpatch['apply'](_0x4844fc,_0x1f18d1,!![]);}catch(_0x427f49){return BPromise[_0x4044('0x22')](_0x427f49);}return _0x4844fc[_0x4044('0x23')]();};}function saveUpdates(_0x1da435,_0x15709b){return function(_0x18c93e){if(_0x18c93e){return _0x18c93e[_0x4044('0x24')](_0x1da435)[_0x4044('0x25')](function(_0x14131d){return _0x14131d;});}return null;};}function removeEntity(_0x43c788,_0xdb9548){return function(_0x2592f6){if(_0x2592f6){return _0x2592f6[_0x4044('0x26')]()[_0x4044('0x25')](function(){_0x43c788[_0x4044('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cbb5b,_0x1dfd26){return function(_0x51079e){if(!_0x51079e){_0x5cbb5b[_0x4044('0x18')](0x194);}return _0x51079e;};}function handleError(_0x41e755,_0x275a1f){_0x275a1f=_0x275a1f||0x1f4;return function(_0x46159a){logger[_0x4044('0x27')](_0x46159a[_0x4044('0x28')]);if(_0x46159a[_0x4044('0x29')]){delete _0x46159a[_0x4044('0x29')];}_0x41e755[_0x4044('0x19')](_0x275a1f)[_0x4044('0x2a')](_0x46159a);};}exports[_0x4044('0x2b')]=function(_0x184fff,_0x5d5c24){var _0x3c3c9d={},_0x1f6d5e={},_0x2a7ae8={'count':0x0,'rows':[]};var _0x352c30=_[_0x4044('0x2c')](db[_0x4044('0x2d')][_0x4044('0x2e')],function(_0x303d01){return{'name':_0x303d01['fieldName'],'type':_0x303d01['type'][_0x4044('0x2f')]};});_0x1f6d5e[_0x4044('0x30')]=_[_0x4044('0x2c')](_0x352c30,'name');_0x1f6d5e['query']=_[_0x4044('0x31')](_0x184fff[_0x4044('0x32')]);_0x1f6d5e[_0x4044('0x33')]=_[_0x4044('0x34')](_0x1f6d5e[_0x4044('0x30')],_0x1f6d5e[_0x4044('0x32')]);_0x3c3c9d[_0x4044('0x35')]=_[_0x4044('0x34')](_0x1f6d5e[_0x4044('0x30')],qs[_0x4044('0x36')](_0x184fff[_0x4044('0x32')][_0x4044('0x36')]));_0x3c3c9d[_0x4044('0x35')]=_0x3c3c9d['attributes'][_0x4044('0x37')]?_0x3c3c9d[_0x4044('0x35')]:_0x1f6d5e[_0x4044('0x30')];if(!_0x184fff[_0x4044('0x32')][_0x4044('0x38')](_0x4044('0x39'))){_0x3c3c9d[_0x4044('0x1f')]=qs['limit'](_0x184fff[_0x4044('0x32')][_0x4044('0x1f')]);_0x3c3c9d['offset']=qs[_0x4044('0x1c')](_0x184fff[_0x4044('0x32')][_0x4044('0x1c')]);}_0x3c3c9d['order']=qs['sort'](_0x184fff[_0x4044('0x32')][_0x4044('0x3a')]);_0x3c3c9d['where']=qs['filters'](_[_0x4044('0x3b')](_0x184fff[_0x4044('0x32')],_0x1f6d5e[_0x4044('0x33')]),_0x352c30);if(_0x184fff[_0x4044('0x32')][_0x4044('0x3c')]){_0x3c3c9d[_0x4044('0x3d')]=_['merge'](_0x3c3c9d[_0x4044('0x3d')],{'$or':_[_0x4044('0x2c')](_0x352c30,function(_0x416b66){if(_0x416b66[_0x4044('0x3e')]!==_0x4044('0x3f')){var _0x18e38d={};_0x18e38d[_0x416b66[_0x4044('0x29')]]={'$like':'%'+_0x184fff[_0x4044('0x32')]['filter']+'%'};return _0x18e38d;}})});}_0x3c3c9d=_[_0x4044('0x40')]({},_0x3c3c9d,_0x184fff[_0x4044('0x41')]);var _0x112153={'where':_0x3c3c9d[_0x4044('0x3d')]};return db[_0x4044('0x2d')]['count'](_0x112153)['then'](function(_0x2fd49d){_0x2a7ae8[_0x4044('0x1e')]=_0x2fd49d;if(_0x184fff[_0x4044('0x32')][_0x4044('0x42')]){_0x3c3c9d[_0x4044('0x43')]=[{'all':!![]}];}return db[_0x4044('0x2d')][_0x4044('0x44')](_0x3c3c9d);})[_0x4044('0x25')](function(_0x281194){_0x2a7ae8[_0x4044('0x45')]=_0x281194;return _0x2a7ae8;})['then'](respondWithFilteredResult(_0x5d5c24,_0x3c3c9d))[_0x4044('0x46')](handleError(_0x5d5c24,null));};exports[_0x4044('0x47')]=function(_0x4bed68,_0x372820){var _0x35be11={'raw':!![],'where':{'id':_0x4bed68[_0x4044('0x48')]['id']}},_0x4bd812={};_0x4bd812[_0x4044('0x30')]=_[_0x4044('0x31')](db['MailTransferReport']['rawAttributes']);_0x4bd812[_0x4044('0x32')]=_[_0x4044('0x31')](_0x4bed68[_0x4044('0x32')]);_0x4bd812[_0x4044('0x33')]=_['intersection'](_0x4bd812[_0x4044('0x30')],_0x4bd812[_0x4044('0x32')]);_0x35be11[_0x4044('0x35')]=_[_0x4044('0x34')](_0x4bd812[_0x4044('0x30')],qs['fields'](_0x4bed68['query']['fields']));_0x35be11[_0x4044('0x35')]=_0x35be11[_0x4044('0x35')][_0x4044('0x37')]?_0x35be11['attributes']:_0x4bd812[_0x4044('0x30')];if(_0x4bed68[_0x4044('0x32')]['includeAll']){_0x35be11[_0x4044('0x43')]=[{'all':!![]}];}_0x35be11=_['merge']({},_0x35be11,_0x4bed68[_0x4044('0x41')]);return db[_0x4044('0x2d')][_0x4044('0x49')](_0x35be11)[_0x4044('0x25')](handleEntityNotFound(_0x372820,null))[_0x4044('0x25')](respondWithResult(_0x372820,null))[_0x4044('0x46')](handleError(_0x372820,null));};exports[_0x4044('0x4a')]=function(_0x205861,_0x53cd02){return db[_0x4044('0x2d')][_0x4044('0x4a')](_0x205861[_0x4044('0x4b')],{})['then'](respondWithResult(_0x53cd02,0xc9))['catch'](handleError(_0x53cd02,null));};exports[_0x4044('0x24')]=function(_0x332469,_0xfca6b6){if(_0x332469[_0x4044('0x4b')]['id']){delete _0x332469[_0x4044('0x4b')]['id'];}return db[_0x4044('0x2d')][_0x4044('0x49')]({'where':{'id':_0x332469[_0x4044('0x48')]['id']}})[_0x4044('0x25')](handleEntityNotFound(_0xfca6b6,null))['then'](saveUpdates(_0x332469[_0x4044('0x4b')],null))[_0x4044('0x25')](respondWithResult(_0xfca6b6,null))[_0x4044('0x46')](handleError(_0xfca6b6,null));};exports[_0x4044('0x26')]=function(_0x556fd8,_0x3dba99){return db['MailTransferReport'][_0x4044('0x49')]({'where':{'id':_0x556fd8[_0x4044('0x48')]['id']}})[_0x4044('0x25')](handleEntityNotFound(_0x3dba99,null))[_0x4044('0x25')](removeEntity(_0x3dba99,null))[_0x4044('0x46')](handleError(_0x3dba99,null));};exports['describe']=function(_0x30574a,_0x2a07fa){return db['MailTransferReport'][_0x4044('0x4c')]()['then'](respondWithResult(_0x2a07fa,null))[_0x4044('0x46')](handleError(_0x2a07fa,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index fecedc6..1cc37f6 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 _0x0a9f=['bluebird','path','MailTransferReport','uniqueid','util','../../config/logger'];(function(_0x5796c5,_0x2b436f){var _0x374ff0=function(_0x87f8ff){while(--_0x87f8ff){_0x5796c5['push'](_0x5796c5['shift']());}};_0x374ff0(++_0x2b436f);}(_0x0a9f,0x64));var _0xf0a9=function(_0x401a04,_0x27cd04){_0x401a04=_0x401a04-0x0;var _0x469676=_0x0a9f[_0x401a04];return _0x469676;};'use strict';var _=require('lodash');var util=require(_0xf0a9('0x0'));var logger=require(_0xf0a9('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf0a9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0a9('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x5343c2,_0x2502a2){return _0x5343c2['define'](_0xf0a9('0x4'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xf0a9('0x5'),'fields':[_0xf0a9('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x79d3=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x79d3,0x15f));var _0x379d=function(_0xfc8faf,_0x86244a){_0xfc8faf=_0xfc8faf-0x0;var _0x48c40b=_0x79d3[_0xfc8faf];return _0x48c40b;};'use strict';var _=require(_0x379d('0x0'));var util=require('util');var logger=require(_0x379d('0x1'))('api');var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x379d('0x4'));var rimraf=require(_0x379d('0x5'));var config=require(_0x379d('0x6'));var attributes=require(_0x379d('0x7'));module[_0x379d('0x8')]=function(_0x2078a6,_0x2a1b43){return _0x2078a6['define'](_0x379d('0x9'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x379d('0xa'),'fields':[_0x379d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 020a23a..0f987a7 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 _0x7987=['../../mysqldb','rpc','jayson/promise','http','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','catch','lodash','moment','ioredis'];(function(_0xf63a33,_0xf38cbc){var _0x3c809d=function(_0x161767){while(--_0x161767){_0xf63a33['push'](_0xf63a33['shift']());}};_0x3c809d(++_0xf38cbc);}(_0x7987,0x11d));var _0x7798=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x7987[_0x543084];return _0x306a57;};'use strict';var _=require(_0x7798('0x0'));var util=require('util');var moment=require(_0x7798('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7798('0x2'));var db=require(_0x7798('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7798('0x4'));var config=require('../../config/environment');var jayson=require(_0x7798('0x5'));var client=jayson['client'][_0x7798('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x38de8f,_0x279756,_0x292f7b){return new BPromise(function(_0x35b966,_0x557773){return client['request'](_0x38de8f,_0x292f7b)[_0x7798('0x7')](function(_0x5bed0d){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x279756,_0x7798('0x8'));logger[_0x7798('0x9')](_0x7798('0xa'),_0x279756,_0x7798('0x8'),JSON[_0x7798('0xb')](_0x5bed0d));if(_0x5bed0d['error']){if(_0x5bed0d[_0x7798('0xc')][_0x7798('0xd')]===0x1f4){logger[_0x7798('0xc')](_0x7798('0xe'),_0x279756,_0x5bed0d[_0x7798('0xc')][_0x7798('0xf')]);return _0x557773(_0x5bed0d['error'][_0x7798('0xf')]);}logger[_0x7798('0xc')](_0x7798('0xe'),_0x279756,_0x5bed0d[_0x7798('0xc')][_0x7798('0xf')]);return _0x35b966(_0x5bed0d['error'][_0x7798('0xf')]);}else{logger[_0x7798('0x10')](_0x7798('0xe'),_0x279756,_0x7798('0x8'));_0x35b966(_0x5bed0d['result'][_0x7798('0xf')]);}})[_0x7798('0x11')](function(_0x442879){logger[_0x7798('0xc')](_0x7798('0xe'),_0x279756,_0x442879);_0x557773(_0x442879);});});} \ No newline at end of file +var _0x522e=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MailTransferReport,\x20%s,\x20%s'];(function(_0x2c45c4,_0x4bb43b){var _0x34540a=function(_0x3398f4){while(--_0x3398f4){_0x2c45c4['push'](_0x2c45c4['shift']());}};_0x34540a(++_0x4bb43b);}(_0x522e,0xff));var _0xe522=function(_0x338c70,_0x3f1c09){_0x338c70=_0x338c70-0x0;var _0x165103=_0x522e[_0x338c70];return _0x165103;};'use strict';var _=require(_0xe522('0x0'));var util=require(_0xe522('0x1'));var moment=require(_0xe522('0x2'));var BPromise=require(_0xe522('0x3'));var rs=require(_0xe522('0x4'));var fs=require('fs');var Redis=require(_0xe522('0x5'));var db=require(_0xe522('0x6'))['db'];var utils=require(_0xe522('0x7'));var logger=require(_0xe522('0x8'))('rpc');var config=require(_0xe522('0x9'));var jayson=require(_0xe522('0xa'));var client=jayson[_0xe522('0xb')][_0xe522('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30803a,_0x2f8152,_0x559fdb){return new BPromise(function(_0x2abf67,_0x486214){return client[_0xe522('0xd')](_0x30803a,_0x559fdb)['then'](function(_0x2460d2){logger[_0xe522('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2f8152,'request\x20sent');logger[_0xe522('0xf')](_0xe522('0x10'),_0x2f8152,_0xe522('0x11'),JSON['stringify'](_0x2460d2));if(_0x2460d2[_0xe522('0x12')]){if(_0x2460d2[_0xe522('0x12')][_0xe522('0x13')]===0x1f4){logger[_0xe522('0x12')](_0xe522('0x14'),_0x2f8152,_0x2460d2[_0xe522('0x12')][_0xe522('0x15')]);return _0x486214(_0x2460d2[_0xe522('0x12')]['message']);}logger[_0xe522('0x12')](_0xe522('0x14'),_0x2f8152,_0x2460d2[_0xe522('0x12')]['message']);return _0x2abf67(_0x2460d2['error'][_0xe522('0x15')]);}else{logger['info'](_0xe522('0x14'),_0x2f8152,_0xe522('0x11'));_0x2abf67(_0x2460d2[_0xe522('0x16')][_0xe522('0x15')]);}})['catch'](function(_0x1cf562){logger[_0xe522('0x12')](_0xe522('0x14'),_0x2f8152,_0x1cf562);_0x486214(_0x1cf562);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index e0793dc..372c4ca 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 _0xe1fa=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1749a0,_0x52fe61){var _0x2fd1af=function(_0x27241c){while(--_0x27241c){_0x1749a0['push'](_0x1749a0['shift']());}};_0x2fd1af(++_0x52fe61);}(_0xe1fa,0x11e));var _0xae1f=function(_0x35665e,_0x3247c0){_0x35665e=_0x35665e-0x0;var _0x5c30bf=_0xe1fa[_0x35665e];return _0x5c30bf;};'use strict';var multer=require(_0xae1f('0x0'));var util=require(_0xae1f('0x1'));var path=require(_0xae1f('0x2'));var timeout=require(_0xae1f('0x3'));var express=require(_0xae1f('0x4'));var router=express[_0xae1f('0x5')]();var fs_extra=require(_0xae1f('0x6'));var auth=require(_0xae1f('0x7'));var interaction=require(_0xae1f('0x8'));var config=require('../../config/environment');var controller=require(_0xae1f('0x9'));router[_0xae1f('0xa')]('/',auth[_0xae1f('0xb')](),controller[_0xae1f('0xc')]);router[_0xae1f('0xa')](_0xae1f('0xd'),auth[_0xae1f('0xb')](),controller[_0xae1f('0xe')]);router[_0xae1f('0xa')](_0xae1f('0xf'),auth[_0xae1f('0xb')](),controller[_0xae1f('0x10')]);router[_0xae1f('0x11')]('/',auth['isAuthenticated'](),controller[_0xae1f('0x12')]);router[_0xae1f('0x13')]('/:id',auth[_0xae1f('0xb')](),controller[_0xae1f('0x14')]);router[_0xae1f('0x15')]('/:id',auth[_0xae1f('0xb')](),controller[_0xae1f('0x16')]);module[_0xae1f('0x17')]=router; \ No newline at end of file +var _0x685b=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','update'];(function(_0x3ee8fc,_0x25babf){var _0x525fb6=function(_0x14e4b2){while(--_0x14e4b2){_0x3ee8fc['push'](_0x3ee8fc['shift']());}};_0x525fb6(++_0x25babf);}(_0x685b,0xbd));var _0xb685=function(_0x1af577,_0x1bd440){_0x1af577=_0x1af577-0x0;var _0x18ec4f=_0x685b[_0x1af577];return _0x18ec4f;};'use strict';var multer=require(_0xb685('0x0'));var util=require('util');var path=require(_0xb685('0x1'));var timeout=require(_0xb685('0x2'));var express=require('express');var router=express[_0xb685('0x3')]();var fs_extra=require(_0xb685('0x4'));var auth=require(_0xb685('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb685('0x6'));var controller=require('./memberReport.controller');router[_0xb685('0x7')]('/',auth[_0xb685('0x8')](),controller[_0xb685('0x9')]);router[_0xb685('0x7')](_0xb685('0xa'),auth['isAuthenticated'](),controller[_0xb685('0xb')]);router['get'](_0xb685('0xc'),auth[_0xb685('0x8')](),controller[_0xb685('0xd')]);router['post']('/',auth[_0xb685('0x8')](),controller['create']);router['put'](_0xb685('0xc'),auth[_0xb685('0x8')](),controller[_0xb685('0xe')]);router['delete'](_0xb685('0xc'),auth[_0xb685('0x8')](),controller[_0xb685('0xf')]);module[_0xb685('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 e99f0cc..075bd4e 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 _0xd30f=['STRING','INTEGER','DATE','enterAt','seconds','setDataValue','exitAt','duration','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xd30f,0x7f));var _0xfd30=function(_0x256ba6,_0x18d545){_0x256ba6=_0x256ba6-0x0;var _0x1b51e5=_0xd30f[_0x256ba6];return _0x1b51e5;};'use strict';var Sequelize=require(_0xfd30('0x0'));var moment=require(_0xfd30('0x1'));module[_0xfd30('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfd30('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfd30('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xfd30('0x4')]},'enterAt':{'type':Sequelize[_0xfd30('0x5')]},'exitAt':{'type':Sequelize[_0xfd30('0x5')],'set':function(_0xf9f4e1){var _0x3cdb9f=moment(_0xf9f4e1);var _0x28f311=moment(this['getDataValue'](_0xfd30('0x6')));var _0x4c8dbf=_0x3cdb9f['diff'](_0x28f311,_0xfd30('0x7'));this[_0xfd30('0x8')](_0xfd30('0x9'),_0xf9f4e1);this['setDataValue'](_0xfd30('0xa'),_0x4c8dbf>=0x0?_0x4c8dbf:null);}},'data1':{'type':Sequelize[_0xfd30('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xfd30('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xfd30('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xfd30('0x3')],'comment':_0xfd30('0xb')},'data5':{'type':Sequelize['STRING'],'comment':_0xfd30('0xc')},'role':{'type':Sequelize[_0xfd30('0x3')]},'internal':{'type':Sequelize[_0xfd30('0x4')]},'uniqueid':{'type':Sequelize[_0xfd30('0x3')]}}; \ No newline at end of file +var _0xaa11=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt'];(function(_0x44747b,_0x25f797){var _0x14c42b=function(_0x1f7293){while(--_0x1f7293){_0x44747b['push'](_0x44747b['shift']());}};_0x14c42b(++_0x25f797);}(_0xaa11,0x110));var _0x1aa1=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0xaa11[_0xf44d98];return _0x5ebb04;};'use strict';var Sequelize=require(_0x1aa1('0x0'));var moment=require('moment');module[_0x1aa1('0x1')]={'channel':{'type':Sequelize[_0x1aa1('0x2')]},'membername':{'type':Sequelize[_0x1aa1('0x2')]},'interface':{'type':Sequelize[_0x1aa1('0x2')]},'type':{'type':Sequelize[_0x1aa1('0x2')],'defaultValue':_0x1aa1('0x3'),'comment':_0x1aa1('0x4')},'duration':{'type':Sequelize[_0x1aa1('0x5')]},'enterAt':{'type':Sequelize[_0x1aa1('0x6')]},'exitAt':{'type':Sequelize[_0x1aa1('0x6')],'set':function(_0x4b299e){var _0x34fe52=moment(_0x4b299e);var _0x30f9b1=moment(this[_0x1aa1('0x7')](_0x1aa1('0x8')));var _0x26fe94=_0x34fe52[_0x1aa1('0x9')](_0x30f9b1,_0x1aa1('0xa'));this[_0x1aa1('0xb')](_0x1aa1('0xc'),_0x4b299e);this[_0x1aa1('0xb')](_0x1aa1('0xd'),_0x26fe94>=0x0?_0x26fe94:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x1aa1('0xe')},'data2':{'type':Sequelize[_0x1aa1('0x2')],'comment':_0x1aa1('0xf')},'data3':{'type':Sequelize[_0x1aa1('0x2')],'comment':_0x1aa1('0x10')},'data4':{'type':Sequelize[_0x1aa1('0x2')],'comment':_0x1aa1('0x11')},'data5':{'type':Sequelize['STRING'],'comment':_0x1aa1('0x12')},'role':{'type':Sequelize[_0x1aa1('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index fcecbaa..90df263 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x106cbe,_0x51f293){var _0x1a5c17=function(_0x58d401){while(--_0x58d401){_0x106cbe['push'](_0x106cbe['shift']());}};_0x1a5c17(++_0x51f293);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x3b42cb,_0x68fc26){var _0x264413=function(_0x484070){while(--_0x484070){_0x3b42cb['push'](_0x3b42cb['shift']());}};_0x264413(++_0x68fc26);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 855a826..2f207b7 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 _0x4771=['../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4be7a5,_0x573b3c){var _0x5acc8b=function(_0x256f59){while(--_0x256f59){_0x4be7a5['push'](_0x4be7a5['shift']());}};_0x5acc8b(++_0x573b3c);}(_0x4771,0x1d9));var _0x1477=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x4771[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x1477('0x0'));var util=require(_0x1477('0x1'));var logger=require(_0x1477('0x2'))(_0x1477('0x3'));var moment=require('moment');var BPromise=require(_0x1477('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1477('0x5'));var rimraf=require(_0x1477('0x6'));var config=require(_0x1477('0x7'));var attributes=require(_0x1477('0x8'));module[_0x1477('0x9')]=function(_0x59f54e,_0x526f3b){return _0x59f54e['define'](_0x1477('0xa'),attributes,{'tableName':_0x1477('0xb'),'paranoid':![],'indexes':[{'name':_0x1477('0xc'),'fields':[_0x1477('0xd'),_0x1477('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x44f2=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername_interface','membername'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44f2,0xc4));var _0x244f=function(_0x114f87,_0x128e6e){_0x114f87=_0x114f87-0x0;var _0xbf0eb8=_0x44f2[_0x114f87];return _0xbf0eb8;};'use strict';var _=require(_0x244f('0x0'));var util=require(_0x244f('0x1'));var logger=require(_0x244f('0x2'))('api');var moment=require(_0x244f('0x3'));var BPromise=require(_0x244f('0x4'));var rp=require(_0x244f('0x5'));var fs=require('fs');var path=require(_0x244f('0x6'));var rimraf=require('rimraf');var config=require(_0x244f('0x7'));var attributes=require(_0x244f('0x8'));module[_0x244f('0x9')]=function(_0x1ff6ec,_0x4edcbd){return _0x1ff6ec[_0x244f('0xa')](_0x244f('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x244f('0xc'),'fields':[_0x244f('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index e5d0119..6b20b71 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 _0x87d3=['stringify','error','code','message','result','catch','GetMemberReport','findAll','options','where','limit','include','map','model','attributes','MemberReport','body','CreateMemberReport','update','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x14a129,_0x319fc4){var _0x20d46d=function(_0x22a8ce){while(--_0x22a8ce){_0x14a129['push'](_0x14a129['shift']());}};_0x20d46d(++_0x319fc4);}(_0x87d3,0x86));var _0x387d=function(_0x22a3f0,_0x513d0e){_0x22a3f0=_0x22a3f0-0x0;var _0x2d8a9c=_0x87d3[_0x22a3f0];return _0x2d8a9c;};'use strict';var _=require(_0x387d('0x0'));var util=require(_0x387d('0x1'));var moment=require(_0x387d('0x2'));var BPromise=require(_0x387d('0x3'));var rs=require(_0x387d('0x4'));var fs=require('fs');var Redis=require(_0x387d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x387d('0x6'));var logger=require('../../config/logger')(_0x387d('0x7'));var config=require(_0x387d('0x8'));var jayson=require(_0x387d('0x9'));var client=jayson['client'][_0x387d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x265532,_0x3b1d5b,_0x689c51){return new BPromise(function(_0x86e92e,_0x39fece){return client[_0x387d('0xb')](_0x265532,_0x689c51)[_0x387d('0xc')](function(_0x47568d){logger[_0x387d('0xd')](_0x387d('0xe'),_0x3b1d5b,'request\x20sent');logger[_0x387d('0xf')](_0x387d('0x10'),_0x3b1d5b,_0x387d('0x11'),JSON[_0x387d('0x12')](_0x47568d));if(_0x47568d[_0x387d('0x13')]){if(_0x47568d[_0x387d('0x13')][_0x387d('0x14')]===0x1f4){logger[_0x387d('0x13')](_0x387d('0xe'),_0x3b1d5b,_0x47568d[_0x387d('0x13')][_0x387d('0x15')]);return _0x39fece(_0x47568d[_0x387d('0x13')][_0x387d('0x15')]);}logger[_0x387d('0x13')](_0x387d('0xe'),_0x3b1d5b,_0x47568d['error']['message']);return _0x86e92e(_0x47568d[_0x387d('0x13')]['message']);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x3b1d5b,_0x387d('0x11'));_0x86e92e(_0x47568d[_0x387d('0x16')][_0x387d('0x15')]);}})[_0x387d('0x17')](function(_0x3cd7ce){logger[_0x387d('0x13')](_0x387d('0xe'),_0x3b1d5b,_0x3cd7ce);_0x39fece(_0x3cd7ce);});});}exports[_0x387d('0x18')]=function(_0x560b1c){var _0xf8ae7b=this;return new Promise(function(_0xa50585,_0x178fe4){return db['MemberReport'][_0x387d('0x19')]({'raw':_0x560b1c['options']?_0x560b1c[_0x387d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x560b1c[_0x387d('0x1a')]?_0x560b1c[_0x387d('0x1a')][_0x387d('0x1b')]||null:null,'attributes':_0x560b1c[_0x387d('0x1a')]?_0x560b1c[_0x387d('0x1a')]['attributes']||null:null,'limit':_0x560b1c['options']?_0x560b1c[_0x387d('0x1a')][_0x387d('0x1c')]||null:null,'include':_0x560b1c[_0x387d('0x1a')]?_0x560b1c[_0x387d('0x1a')][_0x387d('0x1d')]?_[_0x387d('0x1e')](_0x560b1c[_0x387d('0x1a')][_0x387d('0x1d')],function(_0x36ee8b){return{'model':db[_0x36ee8b['model']],'as':_0x36ee8b['as'],'attributes':_0x36ee8b['attributes'],'include':_0x36ee8b['include']?_[_0x387d('0x1e')](_0x36ee8b['include'],function(_0x5c567b){return{'model':db[_0x5c567b['model']],'as':_0x5c567b['as'],'attributes':_0x5c567b['attributes'],'include':_0x5c567b[_0x387d('0x1d')]?_[_0x387d('0x1e')](_0x5c567b[_0x387d('0x1d')],function(_0x31b8fc){return{'model':db[_0x31b8fc[_0x387d('0x1f')]],'as':_0x31b8fc['as'],'attributes':_0x31b8fc[_0x387d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x387d('0xc')](function(_0x2df701){logger[_0x387d('0xd')](_0x387d('0x18'),_0x560b1c);logger[_0x387d('0xf')](_0x387d('0x18'),_0x560b1c,JSON[_0x387d('0x12')](_0x2df701));_0xa50585(_0x2df701);})[_0x387d('0x17')](function(_0x601f52){logger[_0x387d('0x13')]('GetMemberReport',_0x601f52[_0x387d('0x15')],_0x560b1c);_0x178fe4(_0xf8ae7b[_0x387d('0x13')](0x1f4,_0x601f52[_0x387d('0x15')]));});});};exports['CreateMemberReport']=function(_0x370689){var _0x452a11=this;return new Promise(function(_0x386af6,_0x23a388){return db[_0x387d('0x21')]['create'](_0x370689[_0x387d('0x22')],{'raw':_0x370689[_0x387d('0x1a')]?_0x370689['options']['raw']===undefined?!![]:![]:!![]})[_0x387d('0xc')](function(_0x3c1bee){logger[_0x387d('0xd')](_0x387d('0x23'),_0x370689);logger[_0x387d('0xf')](_0x387d('0x23'),_0x370689,JSON['stringify'](_0x3c1bee));_0x386af6(_0x3c1bee);})[_0x387d('0x17')](function(_0x265e8f){logger[_0x387d('0x13')](_0x387d('0x23'),_0x265e8f[_0x387d('0x15')],_0x370689);_0x23a388(_0x452a11[_0x387d('0x13')](0x1f4,_0x265e8f[_0x387d('0x15')]));});});};exports['UpdateMemberReport']=function(_0x16ca2c){var _0x29fe6b=this;return new Promise(function(_0x2d6350,_0x1a4762){return db[_0x387d('0x21')][_0x387d('0x24')](_0x16ca2c['body'],{'raw':_0x16ca2c['options']?_0x16ca2c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16ca2c[_0x387d('0x1a')]?_0x16ca2c[_0x387d('0x1a')]['where']||null:null,'attributes':_0x16ca2c[_0x387d('0x1a')]?_0x16ca2c[_0x387d('0x1a')]['attributes']||null:null,'limit':_0x16ca2c[_0x387d('0x1a')]?_0x16ca2c[_0x387d('0x1a')][_0x387d('0x1c')]||null:null})['then'](function(_0x1de229){logger['info'](_0x387d('0x25'),_0x16ca2c);logger[_0x387d('0xf')](_0x387d('0x25'),_0x16ca2c,JSON[_0x387d('0x12')](_0x1de229));_0x2d6350(_0x1de229);})['catch'](function(_0xc2c15b){logger[_0x387d('0x13')]('UpdateMemberReport',_0xc2c15b[_0x387d('0x15')],_0x16ca2c);_0x1a4762(_0x29fe6b['error'](0x1f4,_0xc2c15b[_0x387d('0x15')]));});});}; \ No newline at end of file +var _0xb138=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','stringify','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','moment'];(function(_0x581013,_0x1d85af){var _0x11de02=function(_0x34de89){while(--_0x34de89){_0x581013['push'](_0x581013['shift']());}};_0x11de02(++_0x1d85af);}(_0xb138,0x1dd));var _0x8b13=function(_0x32a3de,_0x4cea7a){_0x32a3de=_0x32a3de-0x0;var _0x30f1f8=_0xb138[_0x32a3de];return _0x30f1f8;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var BPromise=require(_0x8b13('0x3'));var rs=require(_0x8b13('0x4'));var fs=require('fs');var Redis=require(_0x8b13('0x5'));var db=require(_0x8b13('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b13('0x7'))(_0x8b13('0x8'));var config=require(_0x8b13('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8b13('0xa')][_0x8b13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d51b1,_0x3fdf4d,_0x33d1a7){return new BPromise(function(_0x22e157,_0x498832){return client[_0x8b13('0xc')](_0x5d51b1,_0x33d1a7)[_0x8b13('0xd')](function(_0x58683a){logger['info'](_0x8b13('0xe'),_0x3fdf4d,_0x8b13('0xf'));logger[_0x8b13('0x10')](_0x8b13('0x11'),_0x3fdf4d,_0x8b13('0xf'),JSON['stringify'](_0x58683a));if(_0x58683a[_0x8b13('0x12')]){if(_0x58683a[_0x8b13('0x12')][_0x8b13('0x13')]===0x1f4){logger[_0x8b13('0x12')](_0x8b13('0xe'),_0x3fdf4d,_0x58683a[_0x8b13('0x12')]['message']);return _0x498832(_0x58683a['error'][_0x8b13('0x14')]);}logger[_0x8b13('0x12')]('MemberReport,\x20%s,\x20%s',_0x3fdf4d,_0x58683a['error']['message']);return _0x22e157(_0x58683a[_0x8b13('0x12')][_0x8b13('0x14')]);}else{logger[_0x8b13('0x15')](_0x8b13('0xe'),_0x3fdf4d,_0x8b13('0xf'));_0x22e157(_0x58683a['result'][_0x8b13('0x14')]);}})[_0x8b13('0x16')](function(_0x393bc1){logger[_0x8b13('0x12')](_0x8b13('0xe'),_0x3fdf4d,_0x393bc1);_0x498832(_0x393bc1);});});}exports[_0x8b13('0x17')]=function(_0x10fbde){var _0x441ddc=this;return new Promise(function(_0x4989d3,_0x4dac71){return db[_0x8b13('0x18')][_0x8b13('0x19')]({'raw':_0x10fbde[_0x8b13('0x1a')]?_0x10fbde[_0x8b13('0x1a')][_0x8b13('0x1b')]===undefined?!![]:![]:!![],'where':_0x10fbde[_0x8b13('0x1a')]?_0x10fbde['options'][_0x8b13('0x1c')]||null:null,'attributes':_0x10fbde[_0x8b13('0x1a')]?_0x10fbde[_0x8b13('0x1a')]['attributes']||null:null,'limit':_0x10fbde['options']?_0x10fbde[_0x8b13('0x1a')][_0x8b13('0x1d')]||null:null,'include':_0x10fbde['options']?_0x10fbde[_0x8b13('0x1a')][_0x8b13('0x1e')]?_[_0x8b13('0x1f')](_0x10fbde[_0x8b13('0x1a')][_0x8b13('0x1e')],function(_0x583639){return{'model':db[_0x583639[_0x8b13('0x20')]],'as':_0x583639['as'],'attributes':_0x583639[_0x8b13('0x21')],'include':_0x583639['include']?_[_0x8b13('0x1f')](_0x583639['include'],function(_0x420772){return{'model':db[_0x420772[_0x8b13('0x20')]],'as':_0x420772['as'],'attributes':_0x420772['attributes'],'include':_0x420772[_0x8b13('0x1e')]?_[_0x8b13('0x1f')](_0x420772['include'],function(_0x134c5e){return{'model':db[_0x134c5e[_0x8b13('0x20')]],'as':_0x134c5e['as'],'attributes':_0x134c5e[_0x8b13('0x21')]};}):[]};}):[]};}):[]:[]})[_0x8b13('0xd')](function(_0x27fef3){logger['info'](_0x8b13('0x17'),_0x10fbde);logger[_0x8b13('0x10')](_0x8b13('0x17'),_0x10fbde,JSON[_0x8b13('0x22')](_0x27fef3));_0x4989d3(_0x27fef3);})[_0x8b13('0x16')](function(_0x2bb51d){logger['error'](_0x8b13('0x17'),_0x2bb51d[_0x8b13('0x14')],_0x10fbde);_0x4dac71(_0x441ddc[_0x8b13('0x12')](0x1f4,_0x2bb51d[_0x8b13('0x14')]));});});};exports[_0x8b13('0x23')]=function(_0x29946e){var _0x3304bd=this;return new Promise(function(_0x44bce2,_0x36f732){return db['MemberReport'][_0x8b13('0x24')](_0x29946e[_0x8b13('0x25')],{'raw':_0x29946e[_0x8b13('0x1a')]?_0x29946e[_0x8b13('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xb7771d){logger['info']('CreateMemberReport',_0x29946e);logger[_0x8b13('0x10')]('CreateMemberReport',_0x29946e,JSON[_0x8b13('0x22')](_0xb7771d));_0x44bce2(_0xb7771d);})[_0x8b13('0x16')](function(_0x40fc29){logger[_0x8b13('0x12')](_0x8b13('0x23'),_0x40fc29[_0x8b13('0x14')],_0x29946e);_0x36f732(_0x3304bd[_0x8b13('0x12')](0x1f4,_0x40fc29[_0x8b13('0x14')]));});});};exports[_0x8b13('0x26')]=function(_0x1b313d){var _0x4d45bc=this;return new Promise(function(_0xa07850,_0x31f5bd){return db[_0x8b13('0x18')][_0x8b13('0x27')](_0x1b313d[_0x8b13('0x25')],{'raw':_0x1b313d[_0x8b13('0x1a')]?_0x1b313d[_0x8b13('0x1a')][_0x8b13('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b313d['options']?_0x1b313d[_0x8b13('0x1a')]['where']||null:null,'attributes':_0x1b313d[_0x8b13('0x1a')]?_0x1b313d[_0x8b13('0x1a')][_0x8b13('0x21')]||null:null,'limit':_0x1b313d[_0x8b13('0x1a')]?_0x1b313d[_0x8b13('0x1a')][_0x8b13('0x1d')]||null:null})['then'](function(_0x499ccf){logger[_0x8b13('0x15')]('UpdateMemberReport',_0x1b313d);logger[_0x8b13('0x10')]('UpdateMemberReport',_0x1b313d,JSON[_0x8b13('0x22')](_0x499ccf));_0xa07850(_0x499ccf);})[_0x8b13('0x16')](function(_0x29a359){logger[_0x8b13('0x12')](_0x8b13('0x26'),_0x29a359['message'],_0x1b313d);_0x31f5bd(_0x4d45bc['error'](0x1f4,_0x29a359[_0x8b13('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 695fdb6..099b900 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 _0xe7fe=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x26489d,_0x2c0901){var _0x143823=function(_0x34dbcd){while(--_0x34dbcd){_0x26489d['push'](_0x26489d['shift']());}};_0x143823(++_0x2c0901);}(_0xe7fe,0x19f));var _0xee7f=function(_0x54f895,_0x16cc3d){_0x54f895=_0x54f895-0x0;var _0xd47d66=_0xe7fe[_0x54f895];return _0xd47d66;};'use strict';var multer=require(_0xee7f('0x0'));var util=require(_0xee7f('0x1'));var path=require(_0xee7f('0x2'));var timeout=require(_0xee7f('0x3'));var express=require('express');var router=express[_0xee7f('0x4')]();var fs_extra=require(_0xee7f('0x5'));var auth=require(_0xee7f('0x6'));var interaction=require(_0xee7f('0x7'));var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0xee7f('0x8')]=router; \ No newline at end of file +var _0x85d3=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','util','path'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x85d3,0x1a9));var _0x385d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x85d3[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require(_0x385d('0x0'));var path=require(_0x385d('0x1'));var timeout=require(_0x385d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x385d('0x3'));var auth=require(_0x385d('0x4'));var interaction=require(_0x385d('0x5'));var config=require('../../config/environment');var controller=require(_0x385d('0x6'));router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 9d6b399..5320b2d 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 _0x7263=['STRING','version','exports'];(function(_0x234f28,_0x1a311c){var _0x38bcb6=function(_0x2e7739){while(--_0x2e7739){_0x234f28['push'](_0x234f28['shift']());}};_0x38bcb6(++_0x1a311c);}(_0x7263,0xc5));var _0x3726=function(_0x18baa4,_0x5e35f2){_0x18baa4=_0x18baa4-0x0;var _0x370834=_0x7263[_0x18baa4];return _0x370834;};'use strict';var Sequelize=require('sequelize');module[_0x3726('0x0')]={'version':{'type':Sequelize[_0x3726('0x1')],'unique':_0x3726('0x2')}}; \ No newline at end of file +var _0x72b6=['exports','STRING','version','sequelize'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x72b6,0x103));var _0x672b=function(_0x291a5e,_0x461392){_0x291a5e=_0x291a5e-0x0;var _0x5ac624=_0x72b6[_0x291a5e];return _0x5ac624;};'use strict';var Sequelize=require(_0x672b('0x0'));module[_0x672b('0x1')]={'version':{'type':Sequelize[_0x672b('0x2')],'unique':_0x672b('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 1532d2e..678aa72 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 _0xd662=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../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','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir'];(function(_0x2f9604,_0x445a20){var _0x228267=function(_0x53d9aa){while(--_0x53d9aa){_0x2f9604['push'](_0x2f9604['shift']());}};_0x228267(++_0x445a20);}(_0xd662,0x85));var _0x2d66=function(_0x3e9d0f,_0x291760){_0x3e9d0f=_0x3e9d0f-0x0;var _0x215d13=_0xd662[_0x3e9d0f];return _0x215d13;};'use strict';var emlformat=require(_0x2d66('0x0'));var rimraf=require(_0x2d66('0x1'));var zipdir=require(_0x2d66('0x2'));var jsonpatch=require(_0x2d66('0x3'));var rp=require('request-promise');var moment=require(_0x2d66('0x4'));var BPromise=require(_0x2d66('0x5'));var Mustache=require(_0x2d66('0x6'));var util=require(_0x2d66('0x7'));var path=require(_0x2d66('0x8'));var sox=require(_0x2d66('0x9'));var csv=require(_0x2d66('0xa'));var ejs=require(_0x2d66('0xb'));var fs=require('fs');var fs_extra=require(_0x2d66('0xc'));var _=require('lodash');var squel=require(_0x2d66('0xd'));var crypto=require(_0x2d66('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2d66('0xf'));var toCsv=require(_0x2d66('0xa'));var querystring=require(_0x2d66('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d66('0x11'));var as=require(_0x2d66('0x12'));var hardwareService=require(_0x2d66('0x13'));var logger=require(_0x2d66('0x14'))(_0x2d66('0x15'));var utils=require(_0x2d66('0x16'));var config=require(_0x2d66('0x17'));var licenseUtil=require(_0x2d66('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cdf7e,_0x3825fa){_0x3825fa=_0x3825fa||0xcc;return function(_0x1e765e){if(_0x1e765e){return _0x3cdf7e[_0x2d66('0x19')](_0x3825fa);}return _0x3cdf7e[_0x2d66('0x1a')](_0x3825fa)[_0x2d66('0x1b')]();};}function respondWithResult(_0x28f2c6,_0x4c8a1d){_0x4c8a1d=_0x4c8a1d||0xc8;return function(_0x54cd84){if(_0x54cd84){return _0x28f2c6[_0x2d66('0x1a')](_0x4c8a1d)[_0x2d66('0x1c')](_0x54cd84);}};}function respondWithFilteredResult(_0x295728,_0x149808){return function(_0x3c8982){if(_0x3c8982){var _0x30524d=typeof _0x149808[_0x2d66('0x1d')]===_0x2d66('0x1e')&&typeof _0x149808[_0x2d66('0x1f')]===_0x2d66('0x1e');var _0x32ad98=_0x3c8982['count'];var _0x260040=_0x30524d?0x0:_0x149808[_0x2d66('0x1d')];var _0xabcef9=_0x30524d?_0x3c8982['count']:_0x149808[_0x2d66('0x1d')]+_0x149808[_0x2d66('0x1f')];var _0x90f423;if(_0xabcef9>=_0x32ad98){_0xabcef9=_0x32ad98;_0x90f423=0xc8;}else{_0x90f423=0xce;}_0x295728[_0x2d66('0x1a')](_0x90f423);return _0x295728[_0x2d66('0x20')](_0x2d66('0x21'),_0x260040+'-'+_0xabcef9+'/'+_0x32ad98)[_0x2d66('0x1c')](_0x3c8982);}return null;};}function patchUpdates(_0x255b53){return function(_0x536131){try{jsonpatch[_0x2d66('0x22')](_0x536131,_0x255b53,!![]);}catch(_0x37aac4){return BPromise[_0x2d66('0x23')](_0x37aac4);}return _0x536131[_0x2d66('0x24')]();};}function saveUpdates(_0x1d1934,_0x28dc34){return function(_0x2887b2){if(_0x2887b2){return _0x2887b2[_0x2d66('0x25')](_0x1d1934)[_0x2d66('0x26')](function(_0x3274b5){return _0x3274b5;});}return null;};}function removeEntity(_0x5d0351,_0x2bbfe3){return function(_0x5a4563){if(_0x5a4563){return _0x5a4563[_0x2d66('0x27')]()[_0x2d66('0x26')](function(){_0x5d0351['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x141c72,_0x6001a){return function(_0x4292d8){if(!_0x4292d8){_0x141c72['sendStatus'](0x194);}return _0x4292d8;};}function handleError(_0x3982ab,_0x3ef552){_0x3ef552=_0x3ef552||0x1f4;return function(_0x198084){logger[_0x2d66('0x28')](_0x198084[_0x2d66('0x29')]);if(_0x198084[_0x2d66('0x2a')]){delete _0x198084[_0x2d66('0x2a')];}_0x3982ab[_0x2d66('0x1a')](_0x3ef552)[_0x2d66('0x2b')](_0x198084);};}exports['index']=function(_0x1cafaa,_0x1d5b25){var _0xfe0c7c={},_0x45704f={},_0x1e03e4={'count':0x0,'rows':[]};var _0xd6c658=_[_0x2d66('0x2c')](db[_0x2d66('0x2d')][_0x2d66('0x2e')],function(_0x318a69){return{'name':_0x318a69[_0x2d66('0x2f')],'type':_0x318a69[_0x2d66('0x30')][_0x2d66('0x31')]};});_0x45704f['model']=_[_0x2d66('0x2c')](_0xd6c658,_0x2d66('0x2a'));_0x45704f[_0x2d66('0x32')]=_['keys'](_0x1cafaa['query']);_0x45704f['filters']=_[_0x2d66('0x33')](_0x45704f[_0x2d66('0x34')],_0x45704f['query']);_0xfe0c7c[_0x2d66('0x35')]=_[_0x2d66('0x33')](_0x45704f[_0x2d66('0x34')],qs[_0x2d66('0x36')](_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x36')]));_0xfe0c7c[_0x2d66('0x35')]=_0xfe0c7c[_0x2d66('0x35')][_0x2d66('0x37')]?_0xfe0c7c[_0x2d66('0x35')]:_0x45704f[_0x2d66('0x34')];if(!_0x1cafaa['query'][_0x2d66('0x38')]('nolimit')){_0xfe0c7c[_0x2d66('0x1f')]=qs['limit'](_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x1f')]);_0xfe0c7c['offset']=qs[_0x2d66('0x1d')](_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x1d')]);}_0xfe0c7c[_0x2d66('0x39')]=qs[_0x2d66('0x3a')](_0x1cafaa['query'][_0x2d66('0x3a')]);_0xfe0c7c[_0x2d66('0x3b')]=qs[_0x2d66('0x3c')](_[_0x2d66('0x3d')](_0x1cafaa[_0x2d66('0x32')],_0x45704f[_0x2d66('0x3c')]),_0xd6c658);if(_0x1cafaa[_0x2d66('0x32')]['filter']){_0xfe0c7c['where']=_[_0x2d66('0x3e')](_0xfe0c7c[_0x2d66('0x3b')],{'$or':_[_0x2d66('0x2c')](_0xd6c658,function(_0x47af24){if(_0x47af24[_0x2d66('0x30')]!==_0x2d66('0x3f')){var _0x3b3c03={};_0x3b3c03[_0x47af24[_0x2d66('0x2a')]]={'$like':'%'+_0x1cafaa[_0x2d66('0x32')]['filter']+'%'};return _0x3b3c03;}})});}_0xfe0c7c=_[_0x2d66('0x3e')]({},_0xfe0c7c,_0x1cafaa['options']);var _0x45a6c0={'where':_0xfe0c7c[_0x2d66('0x3b')]};return db[_0x2d66('0x2d')]['count'](_0x45a6c0)['then'](function(_0x4306c1){_0x1e03e4['count']=_0x4306c1;if(_0x1cafaa[_0x2d66('0x32')][_0x2d66('0x40')]){_0xfe0c7c[_0x2d66('0x41')]=[{'all':!![]}];}return db[_0x2d66('0x2d')][_0x2d66('0x42')](_0xfe0c7c);})[_0x2d66('0x26')](function(_0xf80467){_0x1e03e4['rows']=_0xf80467;return _0x1e03e4;})[_0x2d66('0x26')](respondWithFilteredResult(_0x1d5b25,_0xfe0c7c))[_0x2d66('0x43')](handleError(_0x1d5b25,null));}; \ No newline at end of file +var _0x9540=['merge','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','send','map','Migration','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x287479,_0x531889){var _0x1ae903=function(_0x1d5901){while(--_0x1d5901){_0x287479['push'](_0x287479['shift']());}};_0x1ae903(++_0x531889);}(_0x9540,0x10c));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0954('0x0'));var rimraf=require(_0x0954('0x1'));var zipdir=require(_0x0954('0x2'));var jsonpatch=require(_0x0954('0x3'));var rp=require(_0x0954('0x4'));var moment=require(_0x0954('0x5'));var BPromise=require(_0x0954('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0954('0x7'));var sox=require(_0x0954('0x8'));var csv=require(_0x0954('0x9'));var ejs=require(_0x0954('0xa'));var fs=require('fs');var fs_extra=require(_0x0954('0xb'));var _=require(_0x0954('0xc'));var squel=require('squel');var crypto=require(_0x0954('0xd'));var jsforce=require(_0x0954('0xe'));var deskjs=require(_0x0954('0xf'));var toCsv=require(_0x0954('0x9'));var querystring=require(_0x0954('0x10'));var Papa=require(_0x0954('0x11'));var Redis=require(_0x0954('0x12'));var authService=require(_0x0954('0x13'));var qs=require(_0x0954('0x14'));var as=require(_0x0954('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0954('0x16'))(_0x0954('0x17'));var utils=require('../../config/utils');var config=require(_0x0954('0x18'));var licenseUtil=require(_0x0954('0x19'));var db=require(_0x0954('0x1a'))['db'];function respondWithStatusCode(_0x22f5f7,_0x3acfe8){_0x3acfe8=_0x3acfe8||0xcc;return function(_0x4a37ce){if(_0x4a37ce){return _0x22f5f7[_0x0954('0x1b')](_0x3acfe8);}return _0x22f5f7[_0x0954('0x1c')](_0x3acfe8)[_0x0954('0x1d')]();};}function respondWithResult(_0x391b4f,_0x27f6d4){_0x27f6d4=_0x27f6d4||0xc8;return function(_0x36fee7){if(_0x36fee7){return _0x391b4f['status'](_0x27f6d4)[_0x0954('0x1e')](_0x36fee7);}};}function respondWithFilteredResult(_0x5b47e6,_0x5daefd){return function(_0x95080d){if(_0x95080d){var _0x2b66b6=typeof _0x5daefd[_0x0954('0x1f')]===_0x0954('0x20')&&typeof _0x5daefd[_0x0954('0x21')]===_0x0954('0x20');var _0x124f94=_0x95080d[_0x0954('0x22')];var _0x534d98=_0x2b66b6?0x0:_0x5daefd[_0x0954('0x1f')];var _0x470291=_0x2b66b6?_0x95080d[_0x0954('0x22')]:_0x5daefd[_0x0954('0x1f')]+_0x5daefd[_0x0954('0x21')];var _0x516233;if(_0x470291>=_0x124f94){_0x470291=_0x124f94;_0x516233=0xc8;}else{_0x516233=0xce;}_0x5b47e6[_0x0954('0x1c')](_0x516233);return _0x5b47e6['set'](_0x0954('0x23'),_0x534d98+'-'+_0x470291+'/'+_0x124f94)[_0x0954('0x1e')](_0x95080d);}return null;};}function patchUpdates(_0x1a1f2d){return function(_0x4a7bc4){try{jsonpatch[_0x0954('0x24')](_0x4a7bc4,_0x1a1f2d,!![]);}catch(_0x3626aa){return BPromise[_0x0954('0x25')](_0x3626aa);}return _0x4a7bc4[_0x0954('0x26')]();};}function saveUpdates(_0x5dd29f,_0x36bdae){return function(_0x50c498){if(_0x50c498){return _0x50c498[_0x0954('0x27')](_0x5dd29f)[_0x0954('0x28')](function(_0x2cb497){return _0x2cb497;});}return null;};}function removeEntity(_0x36bb06,_0x274420){return function(_0x5041f2){if(_0x5041f2){return _0x5041f2[_0x0954('0x29')]()[_0x0954('0x28')](function(){_0x36bb06[_0x0954('0x1c')](0xcc)[_0x0954('0x1d')]();});}};}function handleEntityNotFound(_0x729e86,_0x1f26dd){return function(_0x4d7e05){if(!_0x4d7e05){_0x729e86[_0x0954('0x1b')](0x194);}return _0x4d7e05;};}function handleError(_0x20c37b,_0x102be1){_0x102be1=_0x102be1||0x1f4;return function(_0x2120e3){logger['error'](_0x2120e3[_0x0954('0x2a')]);if(_0x2120e3['name']){delete _0x2120e3['name'];}_0x20c37b['status'](_0x102be1)[_0x0954('0x2b')](_0x2120e3);};}exports['index']=function(_0x1be3aa,_0x2939fc){var _0x452006={},_0x383ce1={},_0x18e378={'count':0x0,'rows':[]};var _0x365ab6=_[_0x0954('0x2c')](db[_0x0954('0x2d')][_0x0954('0x2e')],function(_0x124eee){return{'name':_0x124eee['fieldName'],'type':_0x124eee[_0x0954('0x2f')][_0x0954('0x30')]};});_0x383ce1['model']=_['map'](_0x365ab6,'name');_0x383ce1[_0x0954('0x31')]=_[_0x0954('0x32')](_0x1be3aa[_0x0954('0x31')]);_0x383ce1[_0x0954('0x33')]=_[_0x0954('0x34')](_0x383ce1['model'],_0x383ce1[_0x0954('0x31')]);_0x452006[_0x0954('0x35')]=_[_0x0954('0x34')](_0x383ce1[_0x0954('0x36')],qs['fields'](_0x1be3aa[_0x0954('0x31')][_0x0954('0x37')]));_0x452006[_0x0954('0x35')]=_0x452006['attributes']['length']?_0x452006[_0x0954('0x35')]:_0x383ce1[_0x0954('0x36')];if(!_0x1be3aa[_0x0954('0x31')][_0x0954('0x38')]('nolimit')){_0x452006[_0x0954('0x21')]=qs[_0x0954('0x21')](_0x1be3aa[_0x0954('0x31')][_0x0954('0x21')]);_0x452006[_0x0954('0x1f')]=qs[_0x0954('0x1f')](_0x1be3aa['query']['offset']);}_0x452006[_0x0954('0x39')]=qs[_0x0954('0x3a')](_0x1be3aa[_0x0954('0x31')][_0x0954('0x3a')]);_0x452006[_0x0954('0x3b')]=qs[_0x0954('0x33')](_[_0x0954('0x3c')](_0x1be3aa[_0x0954('0x31')],_0x383ce1[_0x0954('0x33')]),_0x365ab6);if(_0x1be3aa[_0x0954('0x31')][_0x0954('0x3d')]){_0x452006[_0x0954('0x3b')]=_[_0x0954('0x3e')](_0x452006[_0x0954('0x3b')],{'$or':_[_0x0954('0x2c')](_0x365ab6,function(_0x2727eb){if(_0x2727eb[_0x0954('0x2f')]!=='VIRTUAL'){var _0x15d3db={};_0x15d3db[_0x2727eb['name']]={'$like':'%'+_0x1be3aa['query'][_0x0954('0x3d')]+'%'};return _0x15d3db;}})});}_0x452006=_[_0x0954('0x3e')]({},_0x452006,_0x1be3aa['options']);var _0xfec149={'where':_0x452006[_0x0954('0x3b')]};return db[_0x0954('0x2d')][_0x0954('0x22')](_0xfec149)[_0x0954('0x28')](function(_0x1475b4){_0x18e378[_0x0954('0x22')]=_0x1475b4;if(_0x1be3aa[_0x0954('0x31')]['includeAll']){_0x452006[_0x0954('0x3f')]=[{'all':!![]}];}return db[_0x0954('0x2d')]['findAll'](_0x452006);})[_0x0954('0x28')](function(_0x267a37){_0x18e378[_0x0954('0x40')]=_0x267a37;return _0x18e378;})[_0x0954('0x28')](respondWithFilteredResult(_0x2939fc,_0x452006))[_0x0954('0x41')](handleError(_0x2939fc,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 54ea485..3639f6a 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 _0x1477=['exports','define','migrations','util','bluebird','request-promise','../../config/environment','./migration.attributes'];(function(_0x141904,_0x3ee01f){var _0x337da8=function(_0x43055a){while(--_0x43055a){_0x141904['push'](_0x141904['shift']());}};_0x337da8(++_0x3ee01f);}(_0x1477,0xa3));var _0x7147=function(_0x1bcf80,_0x4568ff){_0x1bcf80=_0x1bcf80-0x0;var _0x2b39a=_0x1477[_0x1bcf80];return _0x2b39a;};'use strict';var _=require('lodash');var util=require(_0x7147('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7147('0x1'));var rp=require(_0x7147('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7147('0x3'));var attributes=require(_0x7147('0x4'));module[_0x7147('0x5')]=function(_0x2e03a2,_0xeaa23b){return _0x2e03a2[_0x7147('0x6')]('Migration',attributes,{'tableName':_0x7147('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f96=['define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports'];(function(_0x45974d,_0x16fd32){var _0x7a059e=function(_0x47af46){while(--_0x47af46){_0x45974d['push'](_0x45974d['shift']());}};_0x7a059e(++_0x16fd32);}(_0x8f96,0xc7));var _0x68f9=function(_0x4cb230,_0x4296fb){_0x4cb230=_0x4cb230-0x0;var _0x149000=_0x8f96[_0x4cb230];return _0x149000;};'use strict';var _=require(_0x68f9('0x0'));var util=require(_0x68f9('0x1'));var logger=require(_0x68f9('0x2'))(_0x68f9('0x3'));var moment=require(_0x68f9('0x4'));var BPromise=require(_0x68f9('0x5'));var rp=require(_0x68f9('0x6'));var fs=require('fs');var path=require(_0x68f9('0x7'));var rimraf=require('rimraf');var config=require(_0x68f9('0x8'));var attributes=require(_0x68f9('0x9'));module[_0x68f9('0xa')]=function(_0x5c7c50,_0x3c0b34){return _0x5c7c50[_0x68f9('0xb')](_0x68f9('0xc'),attributes,{'tableName':_0x68f9('0xd'),'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 43ad78d..b007a32 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 _0xc368=['client','request','then','request\x20sent','debug','stringify','error','code','Migration,\x20%s,\x20%s','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3ddf57,_0x541ef1){var _0x17cf01=function(_0x48885f){while(--_0x48885f){_0x3ddf57['push'](_0x3ddf57['shift']());}};_0x17cf01(++_0x541ef1);}(_0xc368,0x7b));var _0x8c36=function(_0x3c6e93,_0x207f5e){_0x3c6e93=_0x3c6e93-0x0;var _0x77a2da=_0xc368[_0x3c6e93];return _0x77a2da;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var moment=require('moment');var BPromise=require(_0x8c36('0x1'));var rs=require(_0x8c36('0x2'));var fs=require('fs');var Redis=require(_0x8c36('0x3'));var db=require(_0x8c36('0x4'))['db'];var utils=require(_0x8c36('0x5'));var logger=require('../../config/logger')(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var jayson=require(_0x8c36('0x8'));var client=jayson[_0x8c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554022,_0x8ed437,_0x384867){return new BPromise(function(_0x3e76be,_0x26bad1){return client[_0x8c36('0xa')](_0x554022,_0x384867)[_0x8c36('0xb')](function(_0x569f29){logger['info']('Migration,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});} \ No newline at end of file +var _0xf151=['message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c734e,_0x405b0e){var _0x167c17=function(_0xf7cd19){while(--_0xf7cd19){_0x4c734e['push'](_0x4c734e['shift']());}};_0x167c17(++_0x405b0e);}(_0xf151,0xab));var _0x1f15=function(_0x56bbd0,_0x4be5b8){_0x56bbd0=_0x56bbd0-0x0;var _0x32c8ce=_0xf151[_0x56bbd0];return _0x32c8ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f15('0x0'));var BPromise=require(_0x1f15('0x1'));var rs=require(_0x1f15('0x2'));var fs=require('fs');var Redis=require(_0x1f15('0x3'));var db=require(_0x1f15('0x4'))['db'];var utils=require(_0x1f15('0x5'));var logger=require(_0x1f15('0x6'))(_0x1f15('0x7'));var config=require('../../config/environment');var jayson=require(_0x1f15('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ecda5,_0x1a1c65,_0x166156){return new BPromise(function(_0xc7ae4b,_0x5d0bc8){return client[_0x1f15('0x9')](_0x5ecda5,_0x166156)[_0x1f15('0xa')](function(_0x590e7c){logger['info'](_0x1f15('0xb'),_0x1a1c65,_0x1f15('0xc'));logger[_0x1f15('0xd')](_0x1f15('0xe'),_0x1a1c65,'request\x20sent',JSON[_0x1f15('0xf')](_0x590e7c));if(_0x590e7c[_0x1f15('0x10')]){if(_0x590e7c[_0x1f15('0x10')][_0x1f15('0x11')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x1a1c65,_0x590e7c[_0x1f15('0x10')][_0x1f15('0x12')]);return _0x5d0bc8(_0x590e7c[_0x1f15('0x10')][_0x1f15('0x12')]);}logger[_0x1f15('0x10')](_0x1f15('0xb'),_0x1a1c65,_0x590e7c['error'][_0x1f15('0x12')]);return _0xc7ae4b(_0x590e7c[_0x1f15('0x10')][_0x1f15('0x12')]);}else{logger[_0x1f15('0x13')]('Migration,\x20%s,\x20%s',_0x1a1c65,_0x1f15('0xc'));_0xc7ae4b(_0x590e7c['result'][_0x1f15('0x12')]);}})[_0x1f15('0x14')](function(_0x2960d2){logger['error']('Migration,\x20%s,\x20%s',_0x1a1c65,_0x2960d2);_0x5d0bc8(_0x2960d2);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d4cdc67..b4ff6a5 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 _0x3144=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index','show','post','create','put','delete'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x3144,0x17c));var _0x4314=function(_0x5bf181,_0x50c830){_0x5bf181=_0x5bf181-0x0;var _0x5b99ed=_0x3144[_0x5bf181];return _0x5b99ed;};'use strict';var multer=require('multer');var util=require(_0x4314('0x0'));var path=require(_0x4314('0x1'));var timeout=require(_0x4314('0x2'));var express=require('express');var router=express[_0x4314('0x3')]();var fs_extra=require(_0x4314('0x4'));var auth=require(_0x4314('0x5'));var interaction=require(_0x4314('0x6'));var config=require('../../config/environment');var controller=require(_0x4314('0x7'));router[_0x4314('0x8')]('/',auth[_0x4314('0x9')](),controller[_0x4314('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4314('0xb')]);router[_0x4314('0xc')]('/',auth[_0x4314('0x9')](),controller[_0x4314('0xd')]);router[_0x4314('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4314('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4314('0x10')]);module[_0x4314('0x11')]=router; \ No newline at end of file +var _0xe714=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','multer','path'];(function(_0x34308c,_0x216cba){var _0x5770c1=function(_0x18d428){while(--_0x18d428){_0x34308c['push'](_0x34308c['shift']());}};_0x5770c1(++_0x216cba);}(_0xe714,0xe2));var _0x4e71=function(_0x4f28b7,_0x526514){_0x4f28b7=_0x4f28b7-0x0;var _0x4de36f=_0xe714[_0x4f28b7];return _0x4de36f;};'use strict';var multer=require(_0x4e71('0x0'));var util=require('util');var path=require(_0x4e71('0x1'));var timeout=require(_0x4e71('0x2'));var express=require(_0x4e71('0x3'));var router=express[_0x4e71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e71('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e71('0x6'));var controller=require(_0x4e71('0x7'));router[_0x4e71('0x8')]('/',auth[_0x4e71('0x9')](),controller[_0x4e71('0xa')]);router[_0x4e71('0x8')]('/:id',auth[_0x4e71('0x9')](),controller[_0x4e71('0xb')]);router[_0x4e71('0xc')]('/',auth['isAuthenticated'](),controller[_0x4e71('0xd')]);router['put'](_0x4e71('0xe'),auth[_0x4e71('0x9')](),controller[_0x4e71('0xf')]);router[_0x4e71('0x10')](_0x4e71('0xe'),auth[_0x4e71('0x9')](),controller[_0x4e71('0x11')]);module[_0x4e71('0x12')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index c6e5e97..1f17fea 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 _0x7883=['STRING','ENUM','externip','stun','turn'];(function(_0x34a0f7,_0x18dbf5){var _0x4da84c=function(_0x3a5815){while(--_0x3a5815){_0x34a0f7['push'](_0x34a0f7['shift']());}};_0x4da84c(++_0x18dbf5);}(_0x7883,0x128));var _0x3788=function(_0x48d699,_0x475482){_0x48d699=_0x48d699-0x0;var _0x56f317=_0x7883[_0x48d699];return _0x56f317;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x3788('0x0')]('localnet',_0x3788('0x1'),_0x3788('0x2'),_0x3788('0x3'))},'value':{'type':Sequelize[_0x3788('0x4')]},'username':{'type':Sequelize[_0x3788('0x4')]},'password':{'type':Sequelize[_0x3788('0x4')]}}; \ No newline at end of file +var _0x2976=['externip','STRING','sequelize','exports'];(function(_0x2331f8,_0x446a3a){var _0x244773=function(_0x2accba){while(--_0x2accba){_0x2331f8['push'](_0x2331f8['shift']());}};_0x244773(++_0x446a3a);}(_0x2976,0x12e));var _0x6297=function(_0x27b616,_0x4e3351){_0x27b616=_0x27b616-0x0;var _0x197f05=_0x2976[_0x27b616];return _0x197f05;};'use strict';var Sequelize=require(_0x6297('0x0'));module[_0x6297('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0x6297('0x2'),'stun','turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6297('0x3')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 011f957..ba6eea5 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 _0xed6f=['set','Content-Range','update','end','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','Network','include','findAll','rows','params','rawAttributes','merge','find','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','server/files/templates/turn_multiple.ejs','destroy','util','path','lodash','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','undefined','limit','count','offset'];(function(_0x45bd07,_0x27fa33){var _0x23ec0a=function(_0x14a3a0){while(--_0x14a3a0){_0x45bd07['push'](_0x45bd07['shift']());}};_0x23ec0a(++_0x27fa33);}(_0xed6f,0x8e));var _0xfed6=function(_0x5779dd,_0x3e6fdc){_0x5779dd=_0x5779dd-0x0;var _0xc84315=_0xed6f[_0x5779dd];return _0xc84315;};'use strict';var util=require(_0xfed6('0x0'));var path=require(_0xfed6('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfed6('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xfed6('0x3'));var config=require(_0xfed6('0x4'));var db=require(_0xfed6('0x5'))['db'];var jayson=require(_0xfed6('0x6'));var client=jayson[_0xfed6('0x7')][_0xfed6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4535ce,_0x35d04e,_0x25df7e,_0x27a89e){return new Promise(function(_0x274d9a,_0x122357){var _0x4acf7d=_0x27a89e||client;return _0x4acf7d[_0xfed6('0x9')](_0x4535ce,_0x25df7e)[_0xfed6('0xa')](function(_0x5b2da1){logger[_0xfed6('0xb')](_0xfed6('0xc'),_0x35d04e,_0xfed6('0xd'));logger[_0xfed6('0xe')](_0xfed6('0xf'),_0x35d04e,_0xfed6('0xd'),JSON[_0xfed6('0x10')](_0x5b2da1));if(_0x5b2da1[_0xfed6('0x11')]){if(_0x5b2da1[_0xfed6('0x11')]['code']===0x1f4){logger['error'](_0xfed6('0xc'),_0x35d04e,_0x5b2da1[_0xfed6('0x11')]['message']);return _0x122357(_0x5b2da1['error'][_0xfed6('0x12')]);}logger['error'](_0xfed6('0xc'),_0x35d04e,_0x5b2da1['error'][_0xfed6('0x12')]);return _0x274d9a(_0x5b2da1[_0xfed6('0x11')][_0xfed6('0x12')]);}else{logger[_0xfed6('0xb')](_0xfed6('0xc'),_0x35d04e,'request\x20sent');_0x274d9a(_0x5b2da1['result']['message']);}})[_0xfed6('0x13')](function(_0x42ce06){logger['error']('Network,\x20%s,\x20%s',_0x35d04e,_0x42ce06);_0x122357(_0x42ce06);});});}function respondWithResult(_0x6d93b3,_0x1e407a){_0x1e407a=_0x1e407a||0xc8;return function(_0xd75a17){if(_0xd75a17){return _0x6d93b3[_0xfed6('0x14')](_0x1e407a)[_0xfed6('0x15')](_0xd75a17);}};}function respondWithFilteredResult(_0x4e69bf,_0x3640ab){return function(_0x71c083){if(_0x71c083){var _0x409cc7=typeof _0x3640ab['offset']===_0xfed6('0x16')&&typeof _0x3640ab[_0xfed6('0x17')]===_0xfed6('0x16');var _0x906a30=_0x71c083[_0xfed6('0x18')];var _0x3b23ea=_0x409cc7?0x0:_0x3640ab['offset'];var _0x104c34=_0x409cc7?_0x71c083['count']:_0x3640ab[_0xfed6('0x19')]+_0x3640ab[_0xfed6('0x17')];var _0x351638;if(_0x104c34>=_0x906a30){_0x104c34=_0x906a30;_0x351638=0xc8;}else{_0x351638=0xce;}_0x4e69bf[_0xfed6('0x14')](_0x351638);return _0x4e69bf[_0xfed6('0x1a')](_0xfed6('0x1b'),_0x3b23ea+'-'+_0x104c34+'/'+_0x906a30)[_0xfed6('0x15')](_0x71c083);}return null;};}function saveUpdates(_0x1357da){return function(_0x5e26fa){if(_0x5e26fa){return _0x5e26fa[_0xfed6('0x1c')](_0x1357da)[_0xfed6('0xa')](function(_0xb0007e){return _0xb0007e;});}return null;};}function removeEntity(_0x2ab5c6){return function(_0xea0a6f){if(_0xea0a6f){return _0xea0a6f['destroy']()[_0xfed6('0xa')](function(){_0x2ab5c6[_0xfed6('0x14')](0xcc)[_0xfed6('0x1d')]();});}};}function handleEntityNotFound(_0x1ca3a3){return function(_0x13107f){if(!_0x13107f){_0x1ca3a3['sendStatus'](0x194);}return _0x13107f;};}function handleError(_0x2afbc7,_0x855fe0){_0x855fe0=_0x855fe0||0x1f4;return function(_0x27f137){logger[_0xfed6('0x11')](_0x27f137['stack']);if(_0x27f137[_0xfed6('0x1e')]){delete _0x27f137[_0xfed6('0x1e')];}_0x2afbc7[_0xfed6('0x14')](_0x855fe0)[_0xfed6('0x1f')](_0x27f137);};}exports[_0xfed6('0x20')]=function(_0x131742,_0x1c671d){var _0x191c8d={},_0xf9652b={},_0x5c3e91={'count':0x0,'rows':[]};var _0x3fd6fd=_[_0xfed6('0x21')](db['Network']['rawAttributes'],function(_0x2327b4){return{'name':_0x2327b4[_0xfed6('0x22')],'type':_0x2327b4[_0xfed6('0x23')][_0xfed6('0x24')]};});_0xf9652b[_0xfed6('0x25')]=_[_0xfed6('0x21')](_0x3fd6fd,_0xfed6('0x1e'));_0xf9652b[_0xfed6('0x26')]=_[_0xfed6('0x27')](_0x131742[_0xfed6('0x26')]);_0xf9652b[_0xfed6('0x28')]=_[_0xfed6('0x29')](_0xf9652b[_0xfed6('0x25')],_0xf9652b[_0xfed6('0x26')]);_0x191c8d[_0xfed6('0x2a')]=_[_0xfed6('0x29')](_0xf9652b[_0xfed6('0x25')],qs[_0xfed6('0x2b')](_0x131742[_0xfed6('0x26')][_0xfed6('0x2b')]));_0x191c8d[_0xfed6('0x2a')]=_0x191c8d[_0xfed6('0x2a')][_0xfed6('0x2c')]?_0x191c8d[_0xfed6('0x2a')]:_0xf9652b['model'];if(!_0x131742[_0xfed6('0x26')][_0xfed6('0x2d')](_0xfed6('0x2e'))){_0x191c8d[_0xfed6('0x17')]=qs[_0xfed6('0x17')](_0x131742[_0xfed6('0x26')]['limit']);_0x191c8d[_0xfed6('0x19')]=qs['offset'](_0x131742[_0xfed6('0x26')]['offset']);}_0x191c8d[_0xfed6('0x2f')]=qs[_0xfed6('0x30')](_0x131742[_0xfed6('0x26')][_0xfed6('0x30')]);_0x191c8d[_0xfed6('0x31')]=qs[_0xfed6('0x28')](_[_0xfed6('0x32')](_0x131742[_0xfed6('0x26')],_0xf9652b[_0xfed6('0x28')]),_0x3fd6fd);if(_0x131742['query'][_0xfed6('0x33')]){_0x191c8d[_0xfed6('0x31')]=_['merge'](_0x191c8d[_0xfed6('0x31')],{'$or':_[_0xfed6('0x21')](_0x3fd6fd,function(_0x377807){if(_0x377807['type']!==_0xfed6('0x34')){var _0x42dd9d={};_0x42dd9d[_0x377807[_0xfed6('0x1e')]]={'$like':'%'+_0x131742[_0xfed6('0x26')][_0xfed6('0x33')]+'%'};return _0x42dd9d;}})});}_0x191c8d=_['merge']({},_0x191c8d,_0x131742[_0xfed6('0x35')]);var _0x269460={'where':_0x191c8d[_0xfed6('0x31')]};return db[_0xfed6('0x36')][_0xfed6('0x18')](_0x269460)[_0xfed6('0xa')](function(_0x5c3243){_0x5c3e91[_0xfed6('0x18')]=_0x5c3243;if(_0x131742['query']['includeAll']){_0x191c8d[_0xfed6('0x37')]=[{'all':!![]}];}return db[_0xfed6('0x36')][_0xfed6('0x38')](_0x191c8d);})[_0xfed6('0xa')](function(_0x74768d){_0x5c3e91[_0xfed6('0x39')]=_0x74768d;return _0x5c3e91;})[_0xfed6('0xa')](respondWithFilteredResult(_0x1c671d,_0x191c8d))['catch'](handleError(_0x1c671d,null));};exports['show']=function(_0x429b4b,_0x117882){var _0x303834={'raw':!![],'where':{'id':_0x429b4b[_0xfed6('0x3a')]['id']}},_0x23c43c={};_0x23c43c[_0xfed6('0x25')]=_[_0xfed6('0x27')](db[_0xfed6('0x36')][_0xfed6('0x3b')]);_0x23c43c[_0xfed6('0x26')]=_[_0xfed6('0x27')](_0x429b4b['query']);_0x23c43c[_0xfed6('0x28')]=_[_0xfed6('0x29')](_0x23c43c['model'],_0x23c43c[_0xfed6('0x26')]);_0x303834[_0xfed6('0x2a')]=_[_0xfed6('0x29')](_0x23c43c[_0xfed6('0x25')],qs[_0xfed6('0x2b')](_0x429b4b[_0xfed6('0x26')][_0xfed6('0x2b')]));_0x303834[_0xfed6('0x2a')]=_0x303834[_0xfed6('0x2a')][_0xfed6('0x2c')]?_0x303834['attributes']:_0x23c43c[_0xfed6('0x25')];if(_0x429b4b[_0xfed6('0x26')]['includeAll']){_0x303834['include']=[{'all':!![]}];}_0x303834=_[_0xfed6('0x3c')]({},_0x303834,_0x429b4b[_0xfed6('0x35')]);return db[_0xfed6('0x36')][_0xfed6('0x3d')](_0x303834)['then'](handleEntityNotFound(_0x117882,null))[_0xfed6('0xa')](respondWithResult(_0x117882,null))[_0xfed6('0x13')](handleError(_0x117882,null));};exports[_0xfed6('0x3e')]=function(_0x201d0c,_0x5cee29){var _0x517925;return db[_0xfed6('0x36')][_0xfed6('0x3e')](_0x201d0c['body'],{'raw':!![]})['then'](function(_0x489630){_0x517925=_0x489630;return db['Network'][_0xfed6('0x38')]({'where':{'type':_0x201d0c[_0xfed6('0x3f')]['type']},'raw':!![]});})[_0xfed6('0xa')](function(_0x15e26a){if(_0x517925['type'][_0xfed6('0x40')]()=='STUN'){var _0x2140ee=fs[_0xfed6('0x41')](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x44')),_0xfed6('0x45'));var _0x4c5b20=ejs[_0xfed6('0x46')](_0x2140ee,{'networks':_0x15e26a||[]});fs[_0xfed6('0x47')](_0xfed6('0x48'),_0x4c5b20);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x3e'),{'module':'res_stun_monitor.so'});}else if(_0x517925['type']['toUpperCase']()==_0xfed6('0x4a')){var _0x1174be=fs[_0xfed6('0x41')](path['join'](config[_0xfed6('0x43')],'server/files/templates/turn_multiple.ejs'),_0xfed6('0x45'));var _0x2cfdcf=ejs[_0xfed6('0x46')](_0x1174be,{'networks':_0x15e26a||[]});fs['writeFileSync'](_0xfed6('0x4b'),_0x2cfdcf);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x3e'),{'module':_0xfed6('0x4c')});}else{var _0x166d0c=fs['readFileSync'](path['join'](config[_0xfed6('0x43')],_0xfed6('0x4d')),_0xfed6('0x45'));var _0x1caebf=ejs['render'](_0x166d0c,{'networks':_0x15e26a||[]});fs[_0xfed6('0x47')](util[_0xfed6('0x4e')](_0xfed6('0x4f'),_0x201d0c[_0xfed6('0x3f')][_0xfed6('0x23')]['toLowerCase']()),_0x1caebf);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x3e'),{'module':_0xfed6('0x50')});}})[_0xfed6('0xa')](function(){return _0x517925;})[_0xfed6('0xa')](respondWithResult(_0x5cee29,0xc9))[_0xfed6('0x13')](handleError(_0x5cee29,null));};exports['update']=function(_0x448ef4,_0x3e3054){var _0x22ee3c;return db['Network'][_0xfed6('0x3d')]({'where':{'id':_0x448ef4[_0xfed6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3e3054,null))[_0xfed6('0xa')](saveUpdates(_0x448ef4[_0xfed6('0x3f')],null))['then'](function(_0x333e06){if(_0x333e06){_0x22ee3c=_0x333e06;return db[_0xfed6('0x36')][_0xfed6('0x38')]({'where':{'type':_0x22ee3c['type']},'raw':!![]});}return null;})[_0xfed6('0xa')](function(_0x228c72){if(_0x22ee3c[_0xfed6('0x23')][_0xfed6('0x40')]()==_0xfed6('0x51')){var _0x152870=fs['readFileSync'](path['join'](config['root'],_0xfed6('0x44')),_0xfed6('0x45'));var _0x1a5527=ejs[_0xfed6('0x46')](_0x152870,{'networks':_0x228c72||[]});fs[_0xfed6('0x47')](_0xfed6('0x48'),_0x1a5527);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x1c'),{'module':_0xfed6('0x4c')});}else if(_0x22ee3c['type']['toUpperCase']()==_0xfed6('0x4a')){var _0x505b00=fs[_0xfed6('0x41')](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x52')),'utf8');var _0x288ff3=ejs['render'](_0x505b00,{'networks':_0x228c72||[]});fs[_0xfed6('0x47')]('/etc/asterisk/turn_xcally.conf',_0x288ff3);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x1c'),{'module':_0xfed6('0x4c')});}else{var _0x350d63=fs[_0xfed6('0x41')](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x4d')),_0xfed6('0x45'));var _0x3e5c5b=ejs[_0xfed6('0x46')](_0x350d63,{'networks':_0x228c72||[]});fs['writeFileSync'](util[_0xfed6('0x4e')](_0xfed6('0x4f'),_0x448ef4['body'][_0xfed6('0x23')]['toLowerCase']()),_0x3e5c5b);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x1c'),{'module':_0xfed6('0x50')});}})[_0xfed6('0xa')](function(_0x122b60){if(_0x122b60){return _0x22ee3c;}return null;})[_0xfed6('0xa')](respondWithResult(_0x3e3054,null))[_0xfed6('0x13')](handleError(_0x3e3054,null));};exports[_0xfed6('0x53')]=function(_0x49c646,_0x3ca759){var _0x2bbfbe;return db[_0xfed6('0x36')][_0xfed6('0x3d')]({'where':{'id':_0x49c646[_0xfed6('0x3a')]['id']}})[_0xfed6('0xa')](function(_0x346aca){_0x2bbfbe=_0x346aca;return _0x346aca;})[_0xfed6('0xa')](handleEntityNotFound(_0x3ca759,null))[_0xfed6('0xa')](removeEntity(_0x3ca759,null))[_0xfed6('0xa')](function(){if(_0x2bbfbe){return db['Network'][_0xfed6('0x38')]({'where':{'type':_0x2bbfbe[_0xfed6('0x23')]},'raw':!![]});}})[_0xfed6('0xa')](function(_0x5b4029){if(_0x2bbfbe[_0xfed6('0x23')][_0xfed6('0x40')]()==_0xfed6('0x51')){var _0x2f13dc=fs['readFileSync'](path['join'](config[_0xfed6('0x43')],'server/files/templates/stun_multiple.ejs'),_0xfed6('0x45'));var _0x40233d=ejs[_0xfed6('0x46')](_0x2f13dc,{'networks':_0x5b4029||[]});fs[_0xfed6('0x47')]('/etc/asterisk/stun_xcally.conf',_0x40233d);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x53'),{'module':_0xfed6('0x4c')});}else if(_0x2bbfbe[_0xfed6('0x23')]['toUpperCase']()==_0xfed6('0x4a')){var _0x326f71=fs['readFileSync'](path['join'](config[_0xfed6('0x43')],_0xfed6('0x52')),'utf8');var _0xd42608=ejs[_0xfed6('0x46')](_0x326f71,{'networks':_0x5b4029||[]});fs[_0xfed6('0x47')](_0xfed6('0x4b'),_0xd42608);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x53'),{'module':_0xfed6('0x4c')});}else{var _0x429f10=fs['readFileSync'](path[_0xfed6('0x42')](config[_0xfed6('0x43')],_0xfed6('0x4d')),_0xfed6('0x45'));var _0x28f4a7=ejs[_0xfed6('0x46')](_0x429f10,{'networks':_0x5b4029||[]});fs[_0xfed6('0x47')](util[_0xfed6('0x4e')](_0xfed6('0x4f'),_0x2bbfbe[_0xfed6('0x23')]['toLowerCase']()),_0x28f4a7);return respondWithRpcPromise(_0xfed6('0x49'),_0xfed6('0x53'),{'module':_0xfed6('0x50')});}})[_0xfed6('0x13')](handleError(_0x3ca759,null));}; \ No newline at end of file +var _0xee95=['merge','includeAll','findAll','rows','show','params','keys','options','Network','create','body','toUpperCase','STUN','readFileSync','join','root','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','find','server/files/templates/stun_multiple.ejs','utf8','destroy','path','ejs','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','http','request','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','status','offset','undefined','limit','count','set','json','update','then','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL'];(function(_0x4f5127,_0x30c028){var _0x234778=function(_0x1df8f6){while(--_0x1df8f6){_0x4f5127['push'](_0x4f5127['shift']());}};_0x234778(++_0x30c028);}(_0xee95,0x1c5));var _0x5ee9=function(_0x85e00e,_0x5b89b4){_0x85e00e=_0x85e00e-0x0;var _0x167e86=_0xee95[_0x85e00e];return _0x167e86;};'use strict';var util=require('util');var path=require(_0x5ee9('0x0'));var ejs=require(_0x5ee9('0x1'));var fs=require('fs');var _=require(_0x5ee9('0x2'));var qs=require(_0x5ee9('0x3'));var logger=require(_0x5ee9('0x4'))('api');var config=require(_0x5ee9('0x5'));var db=require(_0x5ee9('0x6'))['db'];var jayson=require(_0x5ee9('0x7'));var client=jayson['client'][_0x5ee9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x535a83,_0x2768fa,_0x4b64d0,_0x11583e){return new Promise(function(_0x19c16a,_0x616928){var _0x2a3614=_0x11583e||client;return _0x2a3614[_0x5ee9('0x9')](_0x535a83,_0x4b64d0)['then'](function(_0x193d89){logger['info'](_0x5ee9('0xa'),_0x2768fa,_0x5ee9('0xb'));logger['debug'](_0x5ee9('0xc'),_0x2768fa,_0x5ee9('0xb'),JSON['stringify'](_0x193d89));if(_0x193d89[_0x5ee9('0xd')]){if(_0x193d89[_0x5ee9('0xd')][_0x5ee9('0xe')]===0x1f4){logger[_0x5ee9('0xd')](_0x5ee9('0xa'),_0x2768fa,_0x193d89[_0x5ee9('0xd')]['message']);return _0x616928(_0x193d89[_0x5ee9('0xd')][_0x5ee9('0xf')]);}logger[_0x5ee9('0xd')](_0x5ee9('0xa'),_0x2768fa,_0x193d89['error'][_0x5ee9('0xf')]);return _0x19c16a(_0x193d89[_0x5ee9('0xd')][_0x5ee9('0xf')]);}else{logger[_0x5ee9('0x10')]('Network,\x20%s,\x20%s',_0x2768fa,_0x5ee9('0xb'));_0x19c16a(_0x193d89['result'][_0x5ee9('0xf')]);}})[_0x5ee9('0x11')](function(_0x47e55e){logger['error'](_0x5ee9('0xa'),_0x2768fa,_0x47e55e);_0x616928(_0x47e55e);});});}function respondWithResult(_0x1a8315,_0x201fe4){_0x201fe4=_0x201fe4||0xc8;return function(_0x1915b4){if(_0x1915b4){return _0x1a8315[_0x5ee9('0x12')](_0x201fe4)['json'](_0x1915b4);}};}function respondWithFilteredResult(_0x524eb7,_0x385a99){return function(_0x5f4038){if(_0x5f4038){var _0x3bb8e6=typeof _0x385a99[_0x5ee9('0x13')]===_0x5ee9('0x14')&&typeof _0x385a99[_0x5ee9('0x15')]===_0x5ee9('0x14');var _0x13be3b=_0x5f4038[_0x5ee9('0x16')];var _0x19df2f=_0x3bb8e6?0x0:_0x385a99[_0x5ee9('0x13')];var _0x3b56a0=_0x3bb8e6?_0x5f4038[_0x5ee9('0x16')]:_0x385a99['offset']+_0x385a99[_0x5ee9('0x15')];var _0x22d921;if(_0x3b56a0>=_0x13be3b){_0x3b56a0=_0x13be3b;_0x22d921=0xc8;}else{_0x22d921=0xce;}_0x524eb7[_0x5ee9('0x12')](_0x22d921);return _0x524eb7[_0x5ee9('0x17')]('Content-Range',_0x19df2f+'-'+_0x3b56a0+'/'+_0x13be3b)[_0x5ee9('0x18')](_0x5f4038);}return null;};}function saveUpdates(_0x4fc4aa){return function(_0x5a0b54){if(_0x5a0b54){return _0x5a0b54[_0x5ee9('0x19')](_0x4fc4aa)[_0x5ee9('0x1a')](function(_0x39ab1a){return _0x39ab1a;});}return null;};}function removeEntity(_0x121e59){return function(_0x59df30){if(_0x59df30){return _0x59df30['destroy']()[_0x5ee9('0x1a')](function(){_0x121e59[_0x5ee9('0x12')](0xcc)[_0x5ee9('0x1b')]();});}};}function handleEntityNotFound(_0xf4383a){return function(_0x31bb01){if(!_0x31bb01){_0xf4383a[_0x5ee9('0x1c')](0x194);}return _0x31bb01;};}function handleError(_0x41cea3,_0x1f4860){_0x1f4860=_0x1f4860||0x1f4;return function(_0x52f7fe){logger[_0x5ee9('0xd')](_0x52f7fe[_0x5ee9('0x1d')]);if(_0x52f7fe[_0x5ee9('0x1e')]){delete _0x52f7fe['name'];}_0x41cea3[_0x5ee9('0x12')](_0x1f4860)[_0x5ee9('0x1f')](_0x52f7fe);};}exports[_0x5ee9('0x20')]=function(_0x5037cb,_0x3ca81e){var _0x3da947={},_0x2b9ef0={},_0x5f29ea={'count':0x0,'rows':[]};var _0x4797aa=_['map'](db['Network'][_0x5ee9('0x21')],function(_0x394e00){return{'name':_0x394e00[_0x5ee9('0x22')],'type':_0x394e00['type'][_0x5ee9('0x23')]};});_0x2b9ef0[_0x5ee9('0x24')]=_[_0x5ee9('0x25')](_0x4797aa,'name');_0x2b9ef0[_0x5ee9('0x26')]=_['keys'](_0x5037cb[_0x5ee9('0x26')]);_0x2b9ef0[_0x5ee9('0x27')]=_[_0x5ee9('0x28')](_0x2b9ef0[_0x5ee9('0x24')],_0x2b9ef0['query']);_0x3da947[_0x5ee9('0x29')]=_[_0x5ee9('0x28')](_0x2b9ef0[_0x5ee9('0x24')],qs[_0x5ee9('0x2a')](_0x5037cb[_0x5ee9('0x26')][_0x5ee9('0x2a')]));_0x3da947['attributes']=_0x3da947[_0x5ee9('0x29')][_0x5ee9('0x2b')]?_0x3da947['attributes']:_0x2b9ef0[_0x5ee9('0x24')];if(!_0x5037cb['query'][_0x5ee9('0x2c')]('nolimit')){_0x3da947['limit']=qs[_0x5ee9('0x15')](_0x5037cb[_0x5ee9('0x26')]['limit']);_0x3da947[_0x5ee9('0x13')]=qs[_0x5ee9('0x13')](_0x5037cb['query'][_0x5ee9('0x13')]);}_0x3da947[_0x5ee9('0x2d')]=qs[_0x5ee9('0x2e')](_0x5037cb[_0x5ee9('0x26')]['sort']);_0x3da947[_0x5ee9('0x2f')]=qs['filters'](_['pick'](_0x5037cb['query'],_0x2b9ef0[_0x5ee9('0x27')]),_0x4797aa);if(_0x5037cb['query'][_0x5ee9('0x30')]){_0x3da947[_0x5ee9('0x2f')]=_['merge'](_0x3da947[_0x5ee9('0x2f')],{'$or':_[_0x5ee9('0x25')](_0x4797aa,function(_0x34a2f9){if(_0x34a2f9[_0x5ee9('0x31')]!==_0x5ee9('0x32')){var _0x1305d2={};_0x1305d2[_0x34a2f9['name']]={'$like':'%'+_0x5037cb[_0x5ee9('0x26')][_0x5ee9('0x30')]+'%'};return _0x1305d2;}})});}_0x3da947=_[_0x5ee9('0x33')]({},_0x3da947,_0x5037cb['options']);var _0x3d02cf={'where':_0x3da947[_0x5ee9('0x2f')]};return db['Network'][_0x5ee9('0x16')](_0x3d02cf)['then'](function(_0x38d5d3){_0x5f29ea[_0x5ee9('0x16')]=_0x38d5d3;if(_0x5037cb[_0x5ee9('0x26')][_0x5ee9('0x34')]){_0x3da947['include']=[{'all':!![]}];}return db['Network'][_0x5ee9('0x35')](_0x3da947);})[_0x5ee9('0x1a')](function(_0x1e637c){_0x5f29ea[_0x5ee9('0x36')]=_0x1e637c;return _0x5f29ea;})[_0x5ee9('0x1a')](respondWithFilteredResult(_0x3ca81e,_0x3da947))[_0x5ee9('0x11')](handleError(_0x3ca81e,null));};exports[_0x5ee9('0x37')]=function(_0x50eca1,_0x4e1945){var _0x2817f5={'raw':!![],'where':{'id':_0x50eca1[_0x5ee9('0x38')]['id']}},_0x5e58ec={};_0x5e58ec[_0x5ee9('0x24')]=_[_0x5ee9('0x39')](db['Network']['rawAttributes']);_0x5e58ec[_0x5ee9('0x26')]=_[_0x5ee9('0x39')](_0x50eca1[_0x5ee9('0x26')]);_0x5e58ec[_0x5ee9('0x27')]=_['intersection'](_0x5e58ec[_0x5ee9('0x24')],_0x5e58ec[_0x5ee9('0x26')]);_0x2817f5[_0x5ee9('0x29')]=_['intersection'](_0x5e58ec['model'],qs[_0x5ee9('0x2a')](_0x50eca1[_0x5ee9('0x26')][_0x5ee9('0x2a')]));_0x2817f5[_0x5ee9('0x29')]=_0x2817f5[_0x5ee9('0x29')]['length']?_0x2817f5[_0x5ee9('0x29')]:_0x5e58ec[_0x5ee9('0x24')];if(_0x50eca1[_0x5ee9('0x26')][_0x5ee9('0x34')]){_0x2817f5['include']=[{'all':!![]}];}_0x2817f5=_[_0x5ee9('0x33')]({},_0x2817f5,_0x50eca1[_0x5ee9('0x3a')]);return db[_0x5ee9('0x3b')]['find'](_0x2817f5)[_0x5ee9('0x1a')](handleEntityNotFound(_0x4e1945,null))[_0x5ee9('0x1a')](respondWithResult(_0x4e1945,null))[_0x5ee9('0x11')](handleError(_0x4e1945,null));};exports[_0x5ee9('0x3c')]=function(_0x37f08e,_0x25ff28){var _0x2a68d2;return db[_0x5ee9('0x3b')][_0x5ee9('0x3c')](_0x37f08e[_0x5ee9('0x3d')],{'raw':!![]})[_0x5ee9('0x1a')](function(_0x3590ec){_0x2a68d2=_0x3590ec;return db[_0x5ee9('0x3b')]['findAll']({'where':{'type':_0x37f08e[_0x5ee9('0x3d')][_0x5ee9('0x31')]},'raw':!![]});})[_0x5ee9('0x1a')](function(_0x2de51b){if(_0x2a68d2[_0x5ee9('0x31')][_0x5ee9('0x3e')]()==_0x5ee9('0x3f')){var _0x3daafd=fs[_0x5ee9('0x40')](path[_0x5ee9('0x41')](config[_0x5ee9('0x42')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x18f1ab=ejs[_0x5ee9('0x43')](_0x3daafd,{'networks':_0x2de51b||[]});fs['writeFileSync'](_0x5ee9('0x44'),_0x18f1ab);return respondWithRpcPromise(_0x5ee9('0x45'),_0x5ee9('0x3c'),{'module':'res_stun_monitor.so'});}else if(_0x2a68d2[_0x5ee9('0x31')][_0x5ee9('0x3e')]()==_0x5ee9('0x46')){var _0x4b2c30=fs[_0x5ee9('0x40')](path[_0x5ee9('0x41')](config[_0x5ee9('0x42')],_0x5ee9('0x47')),'utf8');var _0x2fabf5=ejs[_0x5ee9('0x43')](_0x4b2c30,{'networks':_0x2de51b||[]});fs[_0x5ee9('0x48')](_0x5ee9('0x49'),_0x2fabf5);return respondWithRpcPromise(_0x5ee9('0x45'),_0x5ee9('0x3c'),{'module':_0x5ee9('0x4a')});}else{var _0x48c191=fs[_0x5ee9('0x40')](path[_0x5ee9('0x41')](config[_0x5ee9('0x42')],_0x5ee9('0x4b')),'utf8');var _0x18ad5a=ejs[_0x5ee9('0x43')](_0x48c191,{'networks':_0x2de51b||[]});fs[_0x5ee9('0x48')](util[_0x5ee9('0x4c')](_0x5ee9('0x4d'),_0x37f08e[_0x5ee9('0x3d')][_0x5ee9('0x31')][_0x5ee9('0x4e')]()),_0x18ad5a);return respondWithRpcPromise(_0x5ee9('0x45'),_0x5ee9('0x3c'),{'module':_0x5ee9('0x4f')});}})['then'](function(){return _0x2a68d2;})[_0x5ee9('0x1a')](respondWithResult(_0x25ff28,0xc9))[_0x5ee9('0x11')](handleError(_0x25ff28,null));};exports[_0x5ee9('0x19')]=function(_0x410ad0,_0x1d1838){var _0x135e28;return db[_0x5ee9('0x3b')][_0x5ee9('0x50')]({'where':{'id':_0x410ad0[_0x5ee9('0x38')]['id']}})[_0x5ee9('0x1a')](handleEntityNotFound(_0x1d1838,null))[_0x5ee9('0x1a')](saveUpdates(_0x410ad0[_0x5ee9('0x3d')],null))['then'](function(_0xbcdc96){if(_0xbcdc96){_0x135e28=_0xbcdc96;return db[_0x5ee9('0x3b')][_0x5ee9('0x35')]({'where':{'type':_0x135e28[_0x5ee9('0x31')]},'raw':!![]});}return null;})[_0x5ee9('0x1a')](function(_0x4573fb){if(_0x135e28[_0x5ee9('0x31')][_0x5ee9('0x3e')]()==_0x5ee9('0x3f')){var _0x54f517=fs['readFileSync'](path['join'](config[_0x5ee9('0x42')],_0x5ee9('0x51')),_0x5ee9('0x52'));var _0x3f5fa2=ejs[_0x5ee9('0x43')](_0x54f517,{'networks':_0x4573fb||[]});fs['writeFileSync'](_0x5ee9('0x44'),_0x3f5fa2);return respondWithRpcPromise(_0x5ee9('0x45'),_0x5ee9('0x19'),{'module':'res_stun_monitor.so'});}else if(_0x135e28[_0x5ee9('0x31')]['toUpperCase']()=='TURN'){var _0x11964b=fs['readFileSync'](path[_0x5ee9('0x41')](config[_0x5ee9('0x42')],'server/files/templates/turn_multiple.ejs'),_0x5ee9('0x52'));var _0x33ede2=ejs[_0x5ee9('0x43')](_0x11964b,{'networks':_0x4573fb||[]});fs[_0x5ee9('0x48')]('/etc/asterisk/turn_xcally.conf',_0x33ede2);return respondWithRpcPromise(_0x5ee9('0x45'),_0x5ee9('0x19'),{'module':_0x5ee9('0x4a')});}else{var _0x3e5c1c=fs[_0x5ee9('0x40')](path[_0x5ee9('0x41')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x31b60e=ejs[_0x5ee9('0x43')](_0x3e5c1c,{'networks':_0x4573fb||[]});fs['writeFileSync'](util[_0x5ee9('0x4c')](_0x5ee9('0x4d'),_0x410ad0[_0x5ee9('0x3d')]['type']['toLowerCase']()),_0x31b60e);return respondWithRpcPromise(_0x5ee9('0x45'),'update',{'module':_0x5ee9('0x4f')});}})[_0x5ee9('0x1a')](function(_0x5cc29e){if(_0x5cc29e){return _0x135e28;}return null;})[_0x5ee9('0x1a')](respondWithResult(_0x1d1838,null))[_0x5ee9('0x11')](handleError(_0x1d1838,null));};exports[_0x5ee9('0x53')]=function(_0x21de2e,_0x1ffe50){var _0x47d236;return db[_0x5ee9('0x3b')][_0x5ee9('0x50')]({'where':{'id':_0x21de2e[_0x5ee9('0x38')]['id']}})[_0x5ee9('0x1a')](function(_0x595263){_0x47d236=_0x595263;return _0x595263;})[_0x5ee9('0x1a')](handleEntityNotFound(_0x1ffe50,null))['then'](removeEntity(_0x1ffe50,null))[_0x5ee9('0x1a')](function(){if(_0x47d236){return db[_0x5ee9('0x3b')][_0x5ee9('0x35')]({'where':{'type':_0x47d236[_0x5ee9('0x31')]},'raw':!![]});}})[_0x5ee9('0x1a')](function(_0x98dbe0){if(_0x47d236['type'][_0x5ee9('0x3e')]()==_0x5ee9('0x3f')){var _0xbeff6a=fs['readFileSync'](path['join'](config[_0x5ee9('0x42')],_0x5ee9('0x51')),_0x5ee9('0x52'));var _0x2b81ff=ejs[_0x5ee9('0x43')](_0xbeff6a,{'networks':_0x98dbe0||[]});fs['writeFileSync'](_0x5ee9('0x44'),_0x2b81ff);return respondWithRpcPromise('Reload',_0x5ee9('0x53'),{'module':_0x5ee9('0x4a')});}else if(_0x47d236[_0x5ee9('0x31')][_0x5ee9('0x3e')]()==_0x5ee9('0x46')){var _0x1761f6=fs['readFileSync'](path[_0x5ee9('0x41')](config[_0x5ee9('0x42')],_0x5ee9('0x47')),_0x5ee9('0x52'));var _0x3c7e87=ejs['render'](_0x1761f6,{'networks':_0x98dbe0||[]});fs[_0x5ee9('0x48')](_0x5ee9('0x49'),_0x3c7e87);return respondWithRpcPromise('Reload',_0x5ee9('0x53'),{'module':_0x5ee9('0x4a')});}else{var _0x4fcdd5=fs['readFileSync'](path[_0x5ee9('0x41')](config[_0x5ee9('0x42')],_0x5ee9('0x4b')),_0x5ee9('0x52'));var _0x4293dc=ejs[_0x5ee9('0x43')](_0x4fcdd5,{'networks':_0x98dbe0||[]});fs[_0x5ee9('0x48')](util[_0x5ee9('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x47d236[_0x5ee9('0x31')][_0x5ee9('0x4e')]()),_0x4293dc);return respondWithRpcPromise('Reload',_0x5ee9('0x53'),{'module':_0x5ee9('0x4f')});}})[_0x5ee9('0x11')](handleError(_0x1ffe50,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index cff3363..dd82c98 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 _0x2f68=['Network','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x2f68,0x9a));var _0x82f6=function(_0x230016,_0x27fc50){_0x230016=_0x230016-0x0;var _0x19b201=_0x2f68[_0x230016];return _0x19b201;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var logger=require(_0x82f6('0x1'))(_0x82f6('0x2'));var moment=require(_0x82f6('0x3'));var BPromise=require('bluebird');var rp=require(_0x82f6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82f6('0x5'));var config=require(_0x82f6('0x6'));var attributes=require('./network.attributes');module[_0x82f6('0x7')]=function(_0x2c4302,_0x542737){return _0x2c4302['define'](_0x82f6('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22fb=['define','Network','../../config/logger','moment','bluebird','request-promise','path','rimraf','./network.attributes','exports'];(function(_0x2f07ea,_0x467418){var _0x42836c=function(_0x10879b){while(--_0x10879b){_0x2f07ea['push'](_0x2f07ea['shift']());}};_0x42836c(++_0x467418);}(_0x22fb,0x192));var _0xb22f=function(_0x3aeb76,_0xe47d32){_0x3aeb76=_0x3aeb76-0x0;var _0x4808ff=_0x22fb[_0x3aeb76];return _0x4808ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'network','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 b47300a..b49be6b 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 _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(_0x19e884,_0x562e79){var _0x34cdac=function(_0x2ff28c){while(--_0x2ff28c){_0x19e884['push'](_0x19e884['shift']());}};_0x34cdac(++_0x562e79);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 +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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0xba9ec5,_0x19dff4){_0xba9ec5=_0xba9ec5-0x0;var _0x6e2e48=_0x7a54[_0xba9ec5];return _0x6e2e48;};'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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index d48b0ed..a52f3fa 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 _0x7b84=['notify','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition'];(function(_0x57b9a1,_0x1bbe43){var _0x1c7cd8=function(_0x38d801){while(--_0x38d801){_0x57b9a1['push'](_0x57b9a1['shift']());}};_0x1c7cd8(++_0x1bbe43);}(_0x7b84,0x17c));var _0x47b8=function(_0x541724,_0x3e8574){_0x541724=_0x541724-0x0;var _0x30d7b9=_0x7b84[_0x541724];return _0x30d7b9;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var fs_extra=require(_0x47b8('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var controller=require(_0x47b8('0x9'));router[_0x47b8('0xa')]('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0xc')]);router['get'](_0x47b8('0xd'),auth[_0x47b8('0xb')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xa')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x10')]);router[_0x47b8('0xa')](_0x47b8('0x11'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x12')]);router[_0x47b8('0xa')](_0x47b8('0x13'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x14')]);router[_0x47b8('0xa')](_0x47b8('0x15'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x16')]);router[_0x47b8('0xa')](_0x47b8('0x17'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x18')]);router[_0x47b8('0xa')](_0x47b8('0x19'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x1a')]);router['post']('/',auth[_0x47b8('0xb')](),controller[_0x47b8('0x1b')]);router[_0x47b8('0x1c')](_0x47b8('0x11'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x1d')]);router[_0x47b8('0x1c')]('/:id/canned_answers',auth[_0x47b8('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x47b8('0x1e')]);router[_0x47b8('0x1c')](_0x47b8('0x15'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x47b8('0x19'),auth['isAuthenticated'](),controller[_0x47b8('0x1f')]);router[_0x47b8('0x1c')](_0x47b8('0x20'),auth[_0x47b8('0xb')](),controller['send']);router[_0x47b8('0x21')](_0x47b8('0xf'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x22')]);router[_0x47b8('0x23')](_0x47b8('0xf'),auth['isAuthenticated'](),controller[_0x47b8('0x24')]);router[_0x47b8('0x23')]('/:id/dispositions',auth[_0x47b8('0xb')](),controller[_0x47b8('0x25')]);router[_0x47b8('0x23')](_0x47b8('0x13'),auth['isAuthenticated'](),controller[_0x47b8('0x26')]);router[_0x47b8('0x23')](_0x47b8('0x19'),auth[_0x47b8('0xb')](),controller[_0x47b8('0x27')]);module[_0x47b8('0x28')]=router; \ No newline at end of file +var _0xda2d=['getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/notify','notify','/:id/applications','addApplications','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','util','path','connect-timeout','express','Router','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions'];(function(_0x597009,_0x254949){var _0x4e88bd=function(_0x33832e){while(--_0x33832e){_0x597009['push'](_0x597009['shift']());}};_0x4e88bd(++_0x254949);}(_0xda2d,0x102));var _0xdda2=function(_0x2a4402,_0x39ec90){_0x2a4402=_0x2a4402-0x0;var _0x5afd6b=_0xda2d[_0x2a4402];return _0x5afd6b;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x7')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),controller['getAgents']);router[_0xdda2('0x14')]('/',auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x14')](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/canned_answers',auth[_0xdda2('0x8')](),controller['addAnswer']);router[_0xdda2('0x14')](_0xdda2('0x17'),controller[_0xdda2('0x18')]);router[_0xdda2('0x14')](_0xdda2('0x19'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1a')]);router[_0xdda2('0x14')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x14')]('/:id/send',auth[_0xdda2('0x8')](),controller['send']);router[_0xdda2('0x1c')](_0xdda2('0x1d'),auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1e')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1e')](_0xdda2('0xf'),auth['isAuthenticated'](),controller[_0xdda2('0x21')]);router[_0xdda2('0x1e')](_0xdda2('0x13'),auth[_0xdda2('0x8')](),controller['removeAgents']);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 cd1ef5f..fbff35a 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 _0x9e11=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x9e11,0xaf));var _0x19e1=function(_0x2001ab,_0x37a84d){_0x2001ab=_0x2001ab-0x0;var _0x4e226a=_0x9e11[_0x2001ab];return _0x4e226a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x19e1('0x0'));module['exports']={'name':{'type':Sequelize[_0x19e1('0x1')],'unique':_0x19e1('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x19e1('0x1')]},'token':{'type':Sequelize[_0x19e1('0x1')],'defaultValue':function(){return rs[_0x19e1('0x3')]();}},'replyUri':{'type':Sequelize[_0x19e1('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x19e1('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x19e1('0x4');}},'notificationSound':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x19e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x19e1('0x1')]},'queueTransfer':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x19e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x19e1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x19e1('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x19e1('0x5')],'defaultValue':![],'comment':_0x19e1('0x8'),'set':function(_0x339de1){if(!_0x339de1)this[_0x19e1('0x9')](_0x19e1('0xa'),null);this[_0x19e1('0x9')](_0x19e1('0xb'),_0x339de1);}}}; \ No newline at end of file +var _0xdf24=['sequelize','STRING','name','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','mandatoryDisposition'];(function(_0x35ad1d,_0x139af2){var _0x178bde=function(_0x3a3fb6){while(--_0x3a3fb6){_0x35ad1d['push'](_0x35ad1d['shift']());}};_0x178bde(++_0x139af2);}(_0xdf24,0x197));var _0x4df2=function(_0x44c6d3,_0x8107ad){_0x44c6d3=_0x44c6d3-0x0;var _0x1c1b7d=_0xdf24[_0x44c6d3];return _0x1c1b7d;};'use strict';var Sequelize=require(_0x4df2('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x4df2('0x1')],'unique':_0x4df2('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x4df2('0x1')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x4df2('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4df2('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4df2('0x3')],'defaultValue':function(){return _0x4df2('0x4');}},'notificationSound':{'type':Sequelize[_0x4df2('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4df2('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4df2('0x1')]},'queueTransfer':{'type':Sequelize[_0x4df2('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4df2('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4df2('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x4df2('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x4df2('0x5')],'defaultValue':![],'comment':_0x4df2('0x8'),'set':function(_0x304a9a){if(!_0x304a9a)this[_0x4df2('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x4df2('0xa'),_0x304a9a);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index a11e8ea..33ffd1c 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 _0x7f05=['Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','defaults','out','Messages','dataValues','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','jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','OpenchannelAccounts','UserProfileResource','destroy','end','sendStatus','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','OpenchannelAccount','includeAll','include','findAll','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','Disposition','getDispositions','findOne','order','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','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','List','Contacts','DESC','Applications','account','list','applications','firstName','threadId','OpenchannelInteraction','spread','contact','lastName','messageId','interaction','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','transaction','sequelize'];(function(_0x499826,_0xc37e60){var _0x23da09=function(_0x46bb64){while(--_0x46bb64){_0x499826['push'](_0x499826['shift']());}};_0x23da09(++_0xc37e60);}(_0x7f05,0xdc));var _0x57f0=function(_0x501192,_0x20aff9){_0x501192=_0x501192-0x0;var _0x563ed4=_0x7f05[_0x501192];return _0x563ed4;};'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('./openchannelAccount.socket')['register'](socket);var jayson=require(_0x57f0('0x16'));var client=jayson[_0x57f0('0x17')][_0x57f0('0x18')]({'port':0x232c});var client9002=jayson[_0x57f0('0x17')][_0x57f0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x2130ca,_0x555e18,_0x51dac4,_0x40a925){return new BPromise(function(_0x5be425,_0x56b342){var _0x48eadd=_0x40a925||client;return _0x48eadd['request'](_0x2130ca,_0x51dac4)[_0x57f0('0x19')](function(_0x2a382e){logger[_0x57f0('0x1a')]('OpenchannelAccount,\x20%s,\x20%s',_0x555e18,_0x57f0('0x1b'));logger[_0x57f0('0x1c')](_0x57f0('0x1d'),_0x555e18,'request\x20sent',JSON[_0x57f0('0x1e')](_0x2a382e));if(_0x2a382e[_0x57f0('0x1f')]){if(_0x2a382e['error']['code']===0x1f4){logger[_0x57f0('0x1f')](_0x57f0('0x20'),_0x555e18,_0x2a382e['error'][_0x57f0('0x21')]);return _0x56b342(_0x2a382e['error'][_0x57f0('0x21')]);}logger[_0x57f0('0x1f')](_0x57f0('0x20'),_0x555e18,_0x2a382e[_0x57f0('0x1f')]['message']);return _0x5be425(_0x2a382e['error'][_0x57f0('0x21')]);}else{logger['info'](_0x57f0('0x20'),_0x555e18,_0x57f0('0x1b'));_0x5be425(_0x2a382e[_0x57f0('0x22')][_0x57f0('0x21')]);}})[_0x57f0('0x23')](function(_0x1c2cae){logger[_0x57f0('0x1f')](_0x57f0('0x20'),_0x555e18,_0x1c2cae);_0x56b342(_0x1c2cae);});});}function respondWithStatusCode(_0x5a079e,_0x44a353){_0x44a353=_0x44a353||0xcc;return function(_0x5a176f){if(_0x5a176f){return _0x5a079e['sendStatus'](_0x44a353);}return _0x5a079e[_0x57f0('0x24')](_0x44a353)['end']();};}function respondWithResult(_0x407829,_0x50347e){_0x50347e=_0x50347e||0xc8;return function(_0x4f85b7){if(_0x4f85b7){return _0x407829[_0x57f0('0x24')](_0x50347e)[_0x57f0('0x25')](_0x4f85b7);}};}function respondWithFilteredResult(_0x16c711,_0x3ac9d3){return function(_0x1858ea){if(_0x1858ea){var _0x114b1d=typeof _0x3ac9d3[_0x57f0('0x26')]===_0x57f0('0x27')&&typeof _0x3ac9d3[_0x57f0('0x28')]===_0x57f0('0x27');var _0x5c7095=_0x1858ea[_0x57f0('0x29')];var _0x390400=_0x114b1d?0x0:_0x3ac9d3[_0x57f0('0x26')];var _0xa224e0=_0x114b1d?_0x1858ea[_0x57f0('0x29')]:_0x3ac9d3[_0x57f0('0x26')]+_0x3ac9d3[_0x57f0('0x28')];var _0x40c45a;if(_0xa224e0>=_0x5c7095){_0xa224e0=_0x5c7095;_0x40c45a=0xc8;}else{_0x40c45a=0xce;}_0x16c711[_0x57f0('0x24')](_0x40c45a);return _0x16c711[_0x57f0('0x2a')](_0x57f0('0x2b'),_0x390400+'-'+_0xa224e0+'/'+_0x5c7095)[_0x57f0('0x25')](_0x1858ea);}return null;};}function patchUpdates(_0x12fb54){return function(_0x3a8e5f){try{jsonpatch['apply'](_0x3a8e5f,_0x12fb54,!![]);}catch(_0x21a1c2){return BPromise[_0x57f0('0x2c')](_0x21a1c2);}return _0x3a8e5f[_0x57f0('0x2d')]();};}function saveUpdates(_0x3751d7,_0x5cf226){return function(_0x562247){if(_0x562247){return _0x562247['update'](_0x3751d7)[_0x57f0('0x19')](function(_0x4c0876){return _0x4c0876;});}return null;};}function removeEntity(_0xc88d03,_0x29587a){return function(_0x2f3f1b){if(_0x2f3f1b){return _0x2f3f1b['destroy']()[_0x57f0('0x19')](function(){var _0x277edf=_0x2f3f1b[_0x57f0('0x2e')]({'plain':!![]});var _0x302301=_0x57f0('0x2f');return db[_0x57f0('0x30')][_0x57f0('0x31')]({'where':{'type':_0x302301,'resourceId':_0x277edf['id']}})[_0x57f0('0x19')](function(){return _0x2f3f1b;});})[_0x57f0('0x19')](function(){_0xc88d03[_0x57f0('0x24')](0xcc)[_0x57f0('0x32')]();});}};}function handleEntityNotFound(_0x13f4ed,_0xd8f0ca){return function(_0x854d35){if(!_0x854d35){_0x13f4ed[_0x57f0('0x33')](0x194);}return _0x854d35;};}function handleError(_0x1c5345,_0x1769de){_0x1769de=_0x1769de||0x1f4;return function(_0x3ec2ad){logger[_0x57f0('0x1f')](_0x3ec2ad['stack']);if(_0x3ec2ad['name']){delete _0x3ec2ad[_0x57f0('0x34')];}_0x1c5345[_0x57f0('0x24')](_0x1769de)[_0x57f0('0x35')](_0x3ec2ad);};}exports['index']=function(_0x23d181,_0x294756){var _0x3c40d1={'include':[{'model':db[_0x57f0('0x36')],'as':_0x57f0('0x37')}]},_0x1f4f7d={},_0x15d4ea={'count':0x0,'rows':[]};var _0x2cf365=_[_0x57f0('0x38')](db['OpenchannelAccount'][_0x57f0('0x39')],function(_0x2d7388){return{'name':_0x2d7388[_0x57f0('0x3a')],'type':_0x2d7388[_0x57f0('0x3b')]['key']};});_0x1f4f7d[_0x57f0('0x3c')]=_[_0x57f0('0x38')](_0x2cf365,'name');_0x1f4f7d[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x23d181[_0x57f0('0x3d')]);_0x1f4f7d[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x1f4f7d[_0x57f0('0x3c')],_0x1f4f7d[_0x57f0('0x3d')]);_0x3c40d1['attributes']=_[_0x57f0('0x40')](_0x1f4f7d['model'],qs[_0x57f0('0x41')](_0x23d181['query'][_0x57f0('0x41')]));_0x3c40d1[_0x57f0('0x42')]=_0x3c40d1[_0x57f0('0x42')][_0x57f0('0x43')]?_0x3c40d1[_0x57f0('0x42')]:_0x1f4f7d[_0x57f0('0x3c')];if(!_0x23d181[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x3c40d1[_0x57f0('0x28')]=qs[_0x57f0('0x28')](_0x23d181['query'][_0x57f0('0x28')]);_0x3c40d1[_0x57f0('0x26')]=qs['offset'](_0x23d181['query'][_0x57f0('0x26')]);}_0x3c40d1['order']=qs[_0x57f0('0x46')](_0x23d181[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x3c40d1['where']=qs[_0x57f0('0x3f')](_[_0x57f0('0x47')](_0x23d181['query'],_0x1f4f7d[_0x57f0('0x3f')]),_0x2cf365);if(_0x23d181[_0x57f0('0x3d')][_0x57f0('0x48')]){_0x3c40d1[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x3c40d1[_0x57f0('0x49')],{'$or':_['map'](_0x2cf365,function(_0x262199){if(_0x262199[_0x57f0('0x3b')]!=='VIRTUAL'){var _0x2c957a={};_0x2c957a[_0x262199['name']]={'$like':'%'+_0x23d181[_0x57f0('0x3d')]['filter']+'%'};return _0x2c957a;}})});}_0x3c40d1=_[_0x57f0('0x4a')]({},_0x3c40d1,_0x23d181['options']);var _0x4c6eb1={'where':_0x3c40d1[_0x57f0('0x49')]};return db[_0x57f0('0x4b')][_0x57f0('0x29')](_0x4c6eb1)['then'](function(_0x238983){_0x15d4ea[_0x57f0('0x29')]=_0x238983;if(_0x23d181[_0x57f0('0x3d')][_0x57f0('0x4c')]){_0x3c40d1[_0x57f0('0x4d')]=[{'all':!![]}];}return db[_0x57f0('0x4b')][_0x57f0('0x4e')](_0x3c40d1);})[_0x57f0('0x19')](function(_0x7f6cf5){_0x15d4ea['rows']=_0x7f6cf5;return _0x15d4ea;})[_0x57f0('0x19')](respondWithFilteredResult(_0x294756,_0x3c40d1))[_0x57f0('0x23')](handleError(_0x294756,null));};exports['show']=function(_0x3c60de,_0x3e891e){var _0x5ee6dd={'raw':![],'where':{'id':_0x3c60de[_0x57f0('0x4f')]['id']},'include':[{'model':db[_0x57f0('0x36')],'as':'mandatoryDispositionPause'}]},_0x58ca0d={};_0x58ca0d['model']=_['keys'](db[_0x57f0('0x4b')][_0x57f0('0x39')]);_0x58ca0d['query']=_[_0x57f0('0x3e')](_0x3c60de['query']);_0x58ca0d[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x58ca0d['model'],_0x58ca0d[_0x57f0('0x3d')]);_0x5ee6dd[_0x57f0('0x42')]=_['intersection'](_0x58ca0d[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x3c60de['query'][_0x57f0('0x41')]));_0x5ee6dd[_0x57f0('0x42')]=_0x5ee6dd[_0x57f0('0x42')]['length']?_0x5ee6dd[_0x57f0('0x42')]:_0x58ca0d[_0x57f0('0x3c')];if(_0x3c60de[_0x57f0('0x3d')]['includeAll']){_0x5ee6dd[_0x57f0('0x4d')]=[{'all':!![]}];}_0x5ee6dd=_[_0x57f0('0x4a')]({},_0x5ee6dd,_0x3c60de[_0x57f0('0x50')]);return db[_0x57f0('0x4b')][_0x57f0('0x51')](_0x5ee6dd)[_0x57f0('0x19')](handleEntityNotFound(_0x3e891e,null))[_0x57f0('0x19')](respondWithResult(_0x3e891e,null))[_0x57f0('0x23')](handleError(_0x3e891e,null));};exports[_0x57f0('0x52')]=function(_0x4af55b,_0x1f0d2c){return db[_0x57f0('0x4b')][_0x57f0('0x52')](_0x4af55b[_0x57f0('0x53')],{})[_0x57f0('0x19')](function(_0x1ee690){var _0x53406d=_0x4af55b[_0x57f0('0x54')][_0x57f0('0x2e')]({'plain':!![]});if(!_0x53406d)throw new Error(_0x57f0('0x55'));if(_0x53406d['role']===_0x57f0('0x54')){var _0x1b59a2=_0x1ee690[_0x57f0('0x2e')]({'plain':!![]});var _0x35e315=_0x57f0('0x2f');return db[_0x57f0('0x56')][_0x57f0('0x51')]({'where':{'name':_0x35e315,'userProfileId':_0x53406d[_0x57f0('0x57')]},'raw':!![]})[_0x57f0('0x19')](function(_0x3074d4){if(_0x3074d4&&_0x3074d4[_0x57f0('0x58')]===0x0){return db[_0x57f0('0x30')][_0x57f0('0x52')]({'name':_0x1b59a2[_0x57f0('0x34')],'resourceId':_0x1b59a2['id'],'type':_0x3074d4[_0x57f0('0x34')],'sectionId':_0x3074d4['id']},{})[_0x57f0('0x19')](function(){return _0x1ee690;});}else{return _0x1ee690;}})[_0x57f0('0x23')](function(_0x649599){logger[_0x57f0('0x1f')](_0x57f0('0x59'),_0x649599);throw _0x649599;});}return _0x1ee690;})['then'](respondWithResult(_0x1f0d2c,0xc9))[_0x57f0('0x23')](handleError(_0x1f0d2c,null));};exports[_0x57f0('0x5a')]=function(_0x510542,_0x1a6787){if(_0x510542[_0x57f0('0x53')]['id']){delete _0x510542['body']['id'];}return db['OpenchannelAccount'][_0x57f0('0x51')]({'where':{'id':_0x510542[_0x57f0('0x4f')]['id']},'include':[{'model':db[_0x57f0('0x36')],'as':'mandatoryDispositionPause'}]})[_0x57f0('0x19')](handleEntityNotFound(_0x1a6787,null))[_0x57f0('0x19')](saveUpdates(_0x510542['body'],null))['then'](respondWithResult(_0x1a6787,null))[_0x57f0('0x23')](handleError(_0x1a6787,null));};exports[_0x57f0('0x31')]=function(_0x5aff07,_0x409ebe){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x5aff07[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x409ebe,null))[_0x57f0('0x19')](removeEntity(_0x409ebe,null))[_0x57f0('0x23')](handleError(_0x409ebe,null));};exports[_0x57f0('0x5b')]=function(_0x7825d7,_0x13745e){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0x13745e,null))[_0x57f0('0x23')](handleError(_0x13745e,null));};exports['addDisposition']=function(_0x5cbcf3,_0x117f8b,_0x30ac3e){if(_0x5cbcf3[_0x57f0('0x53')]['id']){delete _0x5cbcf3['body']['id'];}return db['OpenchannelAccount'][_0x57f0('0x51')]({'where':{'id':_0x5cbcf3['params']['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x117f8b,null))[_0x57f0('0x19')](function(_0x16a021){if(_0x16a021){_0x5cbcf3[_0x57f0('0x53')]['OpenchannelAccountId']=_0x16a021['id'];return db[_0x57f0('0x5c')]['create'](_0x5cbcf3[_0x57f0('0x53')]);}})[_0x57f0('0x19')](respondWithResult(_0x117f8b,null))[_0x57f0('0x23')](handleError(_0x117f8b,null));};exports[_0x57f0('0x5d')]=function(_0x2f9385,_0x4528f1,_0x3ec3e4){var _0x287cd1={'raw':![],'where':{}};var _0x4300e5={};var _0x539e1c={'count':0x0,'rows':[]};return db[_0x57f0('0x4b')][_0x57f0('0x5e')]({'where':{'id':_0x2f9385[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x4528f1,null))[_0x57f0('0x19')](function(_0x370592){if(_0x370592){_0x4300e5[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0x5c')][_0x57f0('0x39')]);_0x4300e5[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x2f9385[_0x57f0('0x3d')]);_0x4300e5['filters']=_[_0x57f0('0x40')](_0x4300e5[_0x57f0('0x3c')],_0x4300e5[_0x57f0('0x3d')]);_0x287cd1['attributes']=_[_0x57f0('0x40')](_0x4300e5[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x2f9385[_0x57f0('0x3d')]['fields']));_0x287cd1['attributes']=_0x287cd1[_0x57f0('0x42')]['length']?_0x287cd1['attributes']:_0x4300e5[_0x57f0('0x3c')];if(!_0x2f9385[_0x57f0('0x3d')]['hasOwnProperty'](_0x57f0('0x45'))){_0x287cd1['limit']=qs[_0x57f0('0x28')](_0x2f9385['query'][_0x57f0('0x28')]);_0x287cd1[_0x57f0('0x26')]=qs['offset'](_0x2f9385[_0x57f0('0x3d')]['offset']);}_0x287cd1[_0x57f0('0x5f')]=qs['sort'](_0x2f9385[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x287cd1[_0x57f0('0x49')]=qs[_0x57f0('0x3f')](_[_0x57f0('0x47')](_0x2f9385['query'],_0x4300e5[_0x57f0('0x3f')]));_0x287cd1['where'][_0x57f0('0x60')]=_0x370592['id'];if(_0x2f9385[_0x57f0('0x3d')][_0x57f0('0x48')]){_0x287cd1[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x287cd1['where'],{'$or':_[_0x57f0('0x38')](_0x287cd1[_0x57f0('0x42')],function(_0x59a801){var _0x4509df={};_0x4509df[_0x59a801]={'$like':'%'+_0x2f9385[_0x57f0('0x3d')]['filter']+'%'};return _0x4509df;})});}_0x287cd1=_[_0x57f0('0x4a')]({},_0x287cd1,_0x2f9385[_0x57f0('0x50')]);return db[_0x57f0('0x5c')][_0x57f0('0x29')]({'where':_0x287cd1[_0x57f0('0x49')]})[_0x57f0('0x19')](function(_0x123923){_0x539e1c[_0x57f0('0x29')]=_0x123923;if(_0x2f9385['query'][_0x57f0('0x4c')]){_0x287cd1['include']=[{'all':!![]}];}return db[_0x57f0('0x5c')][_0x57f0('0x4e')](_0x287cd1);})['then'](function(_0x20d88f){_0x539e1c[_0x57f0('0x61')]=_0x20d88f;return _0x539e1c;});}})[_0x57f0('0x19')](respondWithFilteredResult(_0x4528f1,_0x287cd1))[_0x57f0('0x23')](handleError(_0x4528f1,null));};exports[_0x57f0('0x62')]=function(_0x403bd6,_0x297c3a,_0xdbbdcd){return db[_0x57f0('0x4b')]['find']({'where':{'id':_0x403bd6['params']['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x297c3a,null))['then'](function(_0x541125){if(_0x541125){return _0x541125[_0x57f0('0x62')](_0x403bd6['query'][_0x57f0('0x63')]);}})[_0x57f0('0x19')](respondWithStatusCode(_0x297c3a,null))[_0x57f0('0x23')](handleError(_0x297c3a,null));};exports[_0x57f0('0x64')]=function(_0x547829,_0x37e32a,_0x231baa){if(_0x547829[_0x57f0('0x53')]['id']){delete _0x547829[_0x57f0('0x53')]['id'];}return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x547829[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x37e32a,null))['then'](function(_0x4c651d){if(_0x4c651d){_0x547829[_0x57f0('0x53')][_0x57f0('0x60')]=_0x4c651d['id'];return db[_0x57f0('0x65')]['create'](_0x547829['body']);}})['then'](respondWithResult(_0x37e32a,null))['catch'](handleError(_0x37e32a,null));};exports[_0x57f0('0x66')]=function(_0x448a42,_0x50e2bd,_0x2cfd47){var _0x208fdf={'raw':![],'where':{}};var _0x43f8dc={};var _0x5f090a={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x448a42[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x50e2bd,null))['then'](function(_0x17d9f4){if(_0x17d9f4){_0x43f8dc[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0x65')]['rawAttributes']);_0x43f8dc[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x448a42['query']);_0x43f8dc[_0x57f0('0x3f')]=_['intersection'](_0x43f8dc[_0x57f0('0x3c')],_0x43f8dc[_0x57f0('0x3d')]);_0x208fdf['attributes']=_[_0x57f0('0x40')](_0x43f8dc['model'],qs[_0x57f0('0x41')](_0x448a42['query'][_0x57f0('0x41')]));_0x208fdf[_0x57f0('0x42')]=_0x208fdf[_0x57f0('0x42')][_0x57f0('0x43')]?_0x208fdf[_0x57f0('0x42')]:_0x43f8dc['model'];if(!_0x448a42[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x208fdf[_0x57f0('0x28')]=qs['limit'](_0x448a42['query'][_0x57f0('0x28')]);_0x208fdf['offset']=qs['offset'](_0x448a42[_0x57f0('0x3d')][_0x57f0('0x26')]);}_0x208fdf[_0x57f0('0x5f')]=qs['sort'](_0x448a42[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x208fdf[_0x57f0('0x49')]=qs['filters'](_[_0x57f0('0x47')](_0x448a42[_0x57f0('0x3d')],_0x43f8dc[_0x57f0('0x3f')]));_0x208fdf[_0x57f0('0x49')][_0x57f0('0x60')]=_0x17d9f4['id'];if(_0x448a42['query']['filter']){_0x208fdf[_0x57f0('0x49')]=_['merge'](_0x208fdf[_0x57f0('0x49')],{'$or':_[_0x57f0('0x38')](_0x208fdf[_0x57f0('0x42')],function(_0x321a27){var _0x162448={};_0x162448[_0x321a27]={'$like':'%'+_0x448a42[_0x57f0('0x3d')][_0x57f0('0x48')]+'%'};return _0x162448;})});}_0x208fdf=_['merge']({},_0x208fdf,_0x448a42[_0x57f0('0x50')]);return db[_0x57f0('0x65')][_0x57f0('0x29')]({'where':_0x208fdf[_0x57f0('0x49')]})[_0x57f0('0x19')](function(_0x2aaf91){_0x5f090a['count']=_0x2aaf91;if(_0x448a42[_0x57f0('0x3d')][_0x57f0('0x4c')]){_0x208fdf[_0x57f0('0x4d')]=[{'all':!![]}];}return db[_0x57f0('0x65')][_0x57f0('0x4e')](_0x208fdf);})[_0x57f0('0x19')](function(_0x5cad65){_0x5f090a[_0x57f0('0x61')]=_0x5cad65;return _0x5f090a;});}})['then'](respondWithFilteredResult(_0x50e2bd,_0x208fdf))[_0x57f0('0x23')](handleError(_0x50e2bd,null));};exports[_0x57f0('0x67')]=function(_0x5358cf,_0x4e1457,_0x5844c7){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x5358cf[_0x57f0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4e1457,null))[_0x57f0('0x19')](function(_0x3a6238){if(_0x3a6238){return _0x3a6238[_0x57f0('0x67')](_0x5358cf[_0x57f0('0x3d')][_0x57f0('0x63')]);}})['then'](respondWithStatusCode(_0x4e1457,null))[_0x57f0('0x23')](handleError(_0x4e1457,null));};exports[_0x57f0('0x68')]=function(_0x1040b7,_0x42899f,_0x3d9aad){var _0x25de99={'body':_0x1040b7[_0x57f0('0x53')],'channel':_0x57f0('0x69')};var _0x10164f=[];var _0x60af3f=[];var _0x26a466={};var _0x1478b2=![];return db[_0x57f0('0x6a')][_0x57f0('0x5b')]()[_0x57f0('0x19')](function(_0xd3054){if(!_0xd3054){throw new db[(_0x57f0('0x6b'))][(_0x57f0('0x6c'))]('no\x20available\x20attributes');}_0x10164f=_[_0x57f0('0x6d')](_['keys'](_0xd3054),[_0x57f0('0x6e'),_0x57f0('0x6f')]);_0x60af3f=_[_0x57f0('0x6d')](_['keys'](_0xd3054),[_0x57f0('0x6e'),_0x57f0('0x6f'),_0x57f0('0x70'),_0x57f0('0x71')]);if(_0x1040b7[_0x57f0('0x53')]['id']){delete _0x1040b7['body']['id'];}if(_['isNil'](_0x1040b7[_0x57f0('0x53')][_0x57f0('0x72')])){throw new db['Sequelize'][(_0x57f0('0x6c'))](_0x57f0('0x73'));}if(_[_0x57f0('0x74')](_0x1040b7['body']['body'])||_0x1040b7[_0x57f0('0x53')][_0x57f0('0x53')]===''){throw new db[(_0x57f0('0x6b'))][(_0x57f0('0x6c'))](_0x57f0('0x75'));}if(_['isNil'](_0x1040b7[_0x57f0('0x53')][_0x57f0('0x76')])){throw new db[(_0x57f0('0x6b'))]['ValidationError'](_0x57f0('0x77')+_0x60af3f);}if(!_[_0x57f0('0x78')](_0x60af3f,_0x1040b7[_0x57f0('0x53')][_0x57f0('0x76')])){throw new db['Sequelize'][(_0x57f0('0x6c'))](_0x57f0('0x79')+_0x60af3f);}_0x26a466[_0x1040b7[_0x57f0('0x53')]['mapKey']]=_0x1040b7[_0x57f0('0x53')][_0x57f0('0x72')];})[_0x57f0('0x19')](function(){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x1040b7[_0x57f0('0x4f')]['id']},'include':[{'model':db['CmList'],'as':_0x57f0('0x7a'),'include':[{'model':db['CmContact'],'as':_0x57f0('0x7b'),'where':_0x26a466,'limit':0x1,'order':[[_0x57f0('0x6f'),_0x57f0('0x7c')]]}]},{'model':db['OpenchannelApplication'],'as':_0x57f0('0x7d')}]});})[_0x57f0('0x19')](handleEntityNotFound(_0x42899f,null))[_0x57f0('0x19')](function(_0x170933){if(_0x170933&&_0x170933[_0x57f0('0x7a')]){_0x25de99[_0x57f0('0x7e')]=_0x170933;_0x25de99['applications']=_0x170933[_0x57f0('0x7d')];_0x25de99[_0x57f0('0x7f')]=_0x170933[_0x57f0('0x7a')];_0x25de99[_0x57f0('0x80')]=_['orderBy'](_0x25de99[_0x57f0('0x80')],['priority'],['asc']);if(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x7d')]){delete _0x25de99['account'][_0x57f0('0x7d')];}if(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x7a')]&&_0x25de99[_0x57f0('0x7e')]['List']['Contacts'][_0x57f0('0x43')]){return _0x25de99[_0x57f0('0x7e')][_0x57f0('0x7a')]['Contacts'][0x0];}var _0x13e815=_['defaults'](_0x1040b7[_0x57f0('0x53')],{'firstName':_0x1040b7[_0x57f0('0x53')][_0x57f0('0x72')],'ListId':_0x170933['ListId']});_0x13e815[_0x1040b7[_0x57f0('0x53')][_0x57f0('0x76')]]=_0x1040b7['body'][_0x57f0('0x72')];return db[_0x57f0('0x6a')][_0x57f0('0x52')](_0x13e815,{'fields':_0x10164f,'raw':!![]});}})[_0x57f0('0x19')](handleEntityNotFound(_0x42899f,null))['then'](function(_0xd5ef79){_0x25de99['contact']=_0xd5ef79;if(_0xd5ef79){var _0x916e1d={'ContactId':_0xd5ef79['id'],'OpenchannelAccountId':_0x1040b7[_0x57f0('0x4f')]['id'],'from':(_0xd5ef79[_0x57f0('0x81')]||'')+'\x20'+(_0xd5ef79['lastName']||'')};var _0x5ec5b5={'OpenchannelAccountId':_0x1040b7[_0x57f0('0x4f')]['id'],'closed':![]};if(_0x1040b7[_0x57f0('0x53')]['threadId']){_0x5ec5b5['threadId']=_0x1040b7[_0x57f0('0x53')][_0x57f0('0x82')];return db['OpenchannelInteraction'][_0x57f0('0x51')]({'where':_0x5ec5b5})[_0x57f0('0x19')](function(_0x5d2905){if(_0x5d2905){return[_0x5d2905,![]];}_0x916e1d[_0x57f0('0x82')]=_0x1040b7[_0x57f0('0x53')]['threadId'];_0x916e1d['externalUrl']=_0x1040b7['body']['externalUrl'];return db['OpenchannelInteraction'][_0x57f0('0x52')](_0x916e1d)['then'](function(_0x16ab4d){return[_0x16ab4d,!![]];});});}else{_0x5ec5b5['threadId']=null;}_0x5ec5b5['ContactId']=_0xd5ef79['id'];return db[_0x57f0('0x83')]['find']({'where':_0x5ec5b5})[_0x57f0('0x19')](function(_0x4bcd47){if(_0x4bcd47){return[_0x4bcd47,![]];}return db[_0x57f0('0x83')][_0x57f0('0x52')](_0x916e1d)[_0x57f0('0x19')](function(_0x880eab){return[_0x880eab,!![]];});});}})[_0x57f0('0x84')](function(_0x16cf49,_0x1995fe){if(_0x16cf49){_0x1478b2=_0x1995fe;if(!_0x1995fe){var _0x39b10d={'from':(_0x25de99[_0x57f0('0x85')][_0x57f0('0x81')]||'')+'\x20'+(_0x25de99[_0x57f0('0x85')][_0x57f0('0x86')]||'')};if(_0x1040b7[_0x57f0('0x53')]['threadId']&&_0x1040b7[_0x57f0('0x53')]['messageId']&&_0x1040b7['body'][_0x57f0('0x82')]!=_0x1040b7['body']['messageId']){_0x39b10d[_0x57f0('0x82')]=_0x1040b7[_0x57f0('0x53')][_0x57f0('0x87')];}return _0x16cf49[_0x57f0('0x5a')](_0x39b10d);}else{return _0x16cf49;}}})[_0x57f0('0x19')](function(_0x5abf88){_0x25de99['interaction']=_0x5abf88['get']({'plain':!![]});_0x25de99[_0x57f0('0x88')]['created']=_0x1478b2;if(_0x25de99[_0x57f0('0x88')]['created']){if(_0x25de99['account'][_0x57f0('0x89')]){_0x25de99[_0x57f0('0x80')][_0x57f0('0x8a')]({'id':0x0,'priority':_0x25de99[_0x57f0('0x80')][_0x57f0('0x43')]+0x1,'app':_0x57f0('0x8b'),'appdata':'unmanaged','interval':_0x57f0('0x8c')});}}return db[_0x57f0('0x8d')][_0x57f0('0x52')]({'body':_0x1040b7[_0x57f0('0x53')][_0x57f0('0x53')],'OpenchannelAccountId':_0x1040b7[_0x57f0('0x4f')]['id'],'OpenchannelInteractionId':_0x5abf88['id'],'direction':'in','ContactId':_0x25de99[_0x57f0('0x85')]['id'],'AttachmentId':_0x1040b7[_0x57f0('0x53')][_0x57f0('0x8e')]});})[_0x57f0('0x19')](function(_0x15cf3e){_0x25de99[_0x57f0('0x21')]=_0x15cf3e;if(!_0x25de99[_0x57f0('0x88')][_0x57f0('0x8f')])return;return db['User'][_0x57f0('0x51')]({'attributes':['id',_0x57f0('0x34')],'where':{'id':_0x25de99[_0x57f0('0x88')][_0x57f0('0x8f')]}});})[_0x57f0('0x19')](function(_0x56c1bf){if(_0x56c1bf){_0x25de99['applications'][_0x57f0('0x90')]({'id':0x0,'priority':0x0,'app':_0x57f0('0x91'),'appdata':_0x56c1bf[_0x57f0('0x34')]+','+(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x92')]||0xa),'interval':_0x57f0('0x8c')});}if(!_0x25de99['interaction'][_0x57f0('0x93')])return;return db['OpenchannelQueue']['find']({'attributes':['id',_0x57f0('0x34')],'where':{'id':_0x25de99[_0x57f0('0x88')]['queueId']}});})[_0x57f0('0x19')](function(_0x5176c7){if(_0x5176c7){_0x25de99[_0x57f0('0x80')][_0x57f0('0x90')]({'id':0x0,'priority':0x1,'app':_0x57f0('0x94'),'appdata':_0x5176c7[_0x57f0('0x34')]+','+(_0x25de99[_0x57f0('0x7e')][_0x57f0('0x95')]||0x12c),'interval':_0x57f0('0x8c')});}return respondWithRpcPromise(_0x57f0('0x96'),_0x57f0('0x97'),_0x25de99);})[_0x57f0('0x19')](function(_0x227a45){respondWithRpcPromise(_0x57f0('0x98'),_0x57f0('0x98'),{'event':_0x57f0('0x68'),'message':_0x227a45},client9002);return _0x227a45;})[_0x57f0('0x19')](respondWithResult(_0x42899f,null))['catch'](handleError(_0x42899f,null));};exports[_0x57f0('0x99')]=function(_0x320abe,_0x18b894){var _0x32bdac=_0x320abe[_0x57f0('0x4f')]['id'];var _0x3f6ed9=_0x320abe[_0x57f0('0x53')];var _0x20dbea=0xc8;var _0x5dd734=null;return db['sequelize'][_0x57f0('0x9a')]({'isolationLevel':db[_0x57f0('0x9b')][_0x57f0('0x9c')][_0x57f0('0x9d')][_0x57f0('0x9e')]},function(_0x103f08){return db['OpenchannelAccount'][_0x57f0('0x5e')]({'where':{'id':_0x32bdac},'transaction':_0x103f08})[_0x57f0('0x19')](function(_0x28c382){if(_0x28c382){return db[_0x57f0('0x9f')][_0x57f0('0x31')]({'where':{'OpenchannelAccountId':_0x32bdac},'transaction':_0x103f08})[_0x57f0('0x19')](function(){var _0xb33d44=_['map'](_0x3f6ed9,function(_0x353565){_0x353565[_0x57f0('0x60')]=_0x32bdac;return _0x353565;});return db[_0x57f0('0x9f')][_0x57f0('0xa0')](_0xb33d44,{'transaction':_0x103f08});});}else{_0x20dbea=0x194;_0x5dd734=[];}});})[_0x57f0('0x19')](function(){if(_0x20dbea!==0x194){return db[_0x57f0('0x9f')][_0x57f0('0xa1')]({'where':{'OpenchannelAccountId':_0x32bdac},'order':_0x57f0('0xa2')})[_0x57f0('0x19')](function(_0x17b22f){_0x5dd734=_0x17b22f;});}})[_0x57f0('0x23')](function(_0x3cfced){_0x20dbea=0x1f4;logger[_0x57f0('0x1f')](_0x3cfced[_0x57f0('0xa3')]);if(_0x3cfced[_0x57f0('0x34')]){delete _0x3cfced[_0x57f0('0x34')];}_0x5dd734=_0x3cfced;})[_0x57f0('0xa4')](function(){if(_0x5dd734===null){_0x18b894[_0x57f0('0x33')](_0x20dbea);}else{if(_0x20dbea===0x1f4){_0x18b894[_0x57f0('0x24')](_0x20dbea)[_0x57f0('0x35')](_0x5dd734);}else{_0x18b894[_0x57f0('0x24')](_0x20dbea)['json'](_0x5dd734);}}});};exports[_0x57f0('0xa5')]=function(_0x3d9984,_0x44a035,_0x17a4ae){var _0x1cd8a3={};var _0x205c82={};var _0x201def;var _0x522d4c;return db[_0x57f0('0x4b')][_0x57f0('0x5e')]({'where':{'id':_0x3d9984[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x44a035,null))[_0x57f0('0x19')](function(_0x10bd6f){if(_0x10bd6f){_0x201def=_0x10bd6f;_0x205c82[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0x9f')][_0x57f0('0x39')]);_0x205c82['query']=_[_0x57f0('0x3e')](_0x3d9984[_0x57f0('0x3d')]);_0x205c82[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x205c82[_0x57f0('0x3c')],_0x205c82['query']);_0x1cd8a3[_0x57f0('0x42')]=_['intersection'](_0x205c82[_0x57f0('0x3c')],qs['fields'](_0x3d9984[_0x57f0('0x3d')][_0x57f0('0x41')]));_0x1cd8a3['attributes']=_0x1cd8a3[_0x57f0('0x42')][_0x57f0('0x43')]?_0x1cd8a3[_0x57f0('0x42')]:_0x205c82[_0x57f0('0x3c')];_0x1cd8a3[_0x57f0('0x5f')]=qs[_0x57f0('0x46')](_0x3d9984['query'][_0x57f0('0x46')]);_0x1cd8a3[_0x57f0('0x49')]=qs['filters'](_[_0x57f0('0x47')](_0x3d9984[_0x57f0('0x3d')],_0x205c82[_0x57f0('0x3f')]));if(_0x3d9984['query'][_0x57f0('0x48')]){_0x1cd8a3[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x1cd8a3[_0x57f0('0x49')],{'$or':_['map'](_0x1cd8a3[_0x57f0('0x42')],function(_0x327815){var _0x55fed1={};_0x55fed1[_0x327815]={'$like':'%'+_0x3d9984[_0x57f0('0x3d')]['filter']+'%'};return _0x55fed1;})});}_0x1cd8a3=_[_0x57f0('0x4a')]({},_0x1cd8a3,_0x3d9984[_0x57f0('0x50')]);return _0x201def['getApplications'](_0x1cd8a3);}})[_0x57f0('0x19')](function(_0x51a540){if(_0x51a540){_0x522d4c=_0x51a540['length'];if(!_0x3d9984[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x1cd8a3['limit']=qs[_0x57f0('0x28')](_0x3d9984[_0x57f0('0x3d')]['limit']);_0x1cd8a3[_0x57f0('0x26')]=qs[_0x57f0('0x26')](_0x3d9984[_0x57f0('0x3d')][_0x57f0('0x26')]);}return _0x201def[_0x57f0('0xa5')](_0x1cd8a3);}})['then'](function(_0x39ed0b){if(_0x39ed0b){return _0x39ed0b?{'count':_0x522d4c,'rows':_0x39ed0b}:null;}})['then'](respondWithResult(_0x44a035,null))[_0x57f0('0x23')](handleError(_0x44a035,null));};exports[_0x57f0('0xa6')]=function(_0x53299a,_0x422433,_0x52d268){var _0x5ebec4={'raw':![],'where':{}};var _0x1af1ed={};var _0x818a3c={'count':0x0,'rows':[]};return db[_0x57f0('0x4b')]['findOne']({'where':{'id':_0x53299a[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x422433,null))[_0x57f0('0x19')](function(_0x141b53){if(_0x141b53){_0x1af1ed[_0x57f0('0x3c')]=_['keys'](db[_0x57f0('0x83')]['rawAttributes']);_0x1af1ed[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x53299a[_0x57f0('0x3d')]);_0x1af1ed[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x1af1ed[_0x57f0('0x3c')],_0x1af1ed[_0x57f0('0x3d')]);_0x5ebec4['attributes']=_['intersection'](_0x1af1ed[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x53299a[_0x57f0('0x3d')][_0x57f0('0x41')]));_0x5ebec4['attributes']=_0x5ebec4[_0x57f0('0x42')][_0x57f0('0x43')]?_0x5ebec4[_0x57f0('0x42')]:_0x1af1ed[_0x57f0('0x3c')];if(!_0x53299a[_0x57f0('0x3d')][_0x57f0('0x44')](_0x57f0('0x45'))){_0x5ebec4[_0x57f0('0x28')]=qs[_0x57f0('0x28')](_0x53299a[_0x57f0('0x3d')]['limit']);_0x5ebec4[_0x57f0('0x26')]=qs[_0x57f0('0x26')](_0x53299a[_0x57f0('0x3d')]['offset']);}_0x5ebec4[_0x57f0('0x5f')]=qs['sort'](_0x53299a[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x5ebec4[_0x57f0('0x49')]=qs['filters'](_[_0x57f0('0x47')](_0x53299a[_0x57f0('0x3d')],_0x1af1ed[_0x57f0('0x3f')]));_0x5ebec4[_0x57f0('0x49')][_0x57f0('0x60')]=_0x141b53['id'];if(_0x53299a[_0x57f0('0x3d')][_0x57f0('0x48')]){_0x5ebec4[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x5ebec4[_0x57f0('0x49')],{'$or':_[_0x57f0('0x38')](_0x5ebec4['attributes'],function(_0x425ad7){var _0x5cc0e1={};_0x5cc0e1[_0x425ad7]={'$like':'%'+_0x53299a[_0x57f0('0x3d')]['filter']+'%'};return _0x5cc0e1;})});}_0x5ebec4=_[_0x57f0('0x4a')]({},_0x5ebec4,_0x53299a[_0x57f0('0x50')]);return db[_0x57f0('0x83')][_0x57f0('0x29')]({'where':_0x5ebec4['where']})[_0x57f0('0x19')](function(_0x3cdba7){_0x818a3c[_0x57f0('0x29')]=_0x3cdba7;if(_0x53299a[_0x57f0('0x3d')][_0x57f0('0x4c')]){_0x5ebec4['include']=[{'model':db[_0x57f0('0x6a')],'as':_0x57f0('0xa7'),'required':![]},{'model':db[_0x57f0('0xa8')],'as':_0x57f0('0xa9'),'attributes':['name',_0x57f0('0xaa'),_0x57f0('0xab')],'required':![]},{'model':db[_0x57f0('0xac')],'as':'Tags','attributes':['id',_0x57f0('0x34'),_0x57f0('0xad')],'where':_0x53299a[_0x57f0('0x3d')]['tag']?{'id':_0x53299a['query'][_0x57f0('0xae')]}:undefined,'required':_0x53299a[_0x57f0('0x3d')][_0x57f0('0xae')]?!![]:![]}];}return db[_0x57f0('0x83')][_0x57f0('0x4e')](_0x5ebec4);})[_0x57f0('0x19')](function(_0xad8d48){_0x818a3c[_0x57f0('0x61')]=_0xad8d48;return _0x818a3c;});}})[_0x57f0('0x19')](respondWithFilteredResult(_0x422433,_0x5ebec4))[_0x57f0('0x23')](handleError(_0x422433,null));};exports[_0x57f0('0xaf')]=function(_0x16e928,_0x40760c,_0x189bdf){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x16e928[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x40760c,null))[_0x57f0('0x19')](function(_0x2a1335){if(_0x2a1335){return _0x2a1335[_0x57f0('0xaf')](_0x16e928['body'][_0x57f0('0x63')],_[_0x57f0('0xb0')](_0x16e928[_0x57f0('0x53')],[_0x57f0('0x63'),'id'])||{})[_0x57f0('0x84')](function(_0x167e99){for(var _0x4e3982=0x0;_0x4e3982<_0x16e928[_0x57f0('0x53')][_0x57f0('0x63')][_0x57f0('0x43')];_0x4e3982+=0x1){socket[_0x57f0('0xb1')](_0x57f0('0xb2'),{'UserId':Number(_0x16e928[_0x57f0('0x53')]['ids'][_0x4e3982]),'OpenchannelAccountId':Number(_0x16e928[_0x57f0('0x4f')]['id'])});}return _0x167e99;});}})[_0x57f0('0x19')](respondWithResult(_0x40760c,null))['catch'](handleError(_0x40760c,null));};exports[_0x57f0('0xb3')]=function(_0x78f3c9,_0x3d2c6c,_0x48db9b){return db[_0x57f0('0x4b')][_0x57f0('0x51')]({'where':{'id':_0x78f3c9[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x3d2c6c,null))[_0x57f0('0x19')](function(_0x38f9b2){if(_0x38f9b2){return _0x38f9b2[_0x57f0('0xb3')](_0x78f3c9[_0x57f0('0x3d')][_0x57f0('0x63')])[_0x57f0('0x19')](function(){if(_[_0x57f0('0xb4')](_0x78f3c9['query'][_0x57f0('0x63')])){for(var _0x27cbc5=0x0;_0x27cbc5<_0x78f3c9[_0x57f0('0x3d')]['ids']['length'];_0x27cbc5+=0x1){socket[_0x57f0('0xb1')](_0x57f0('0xb5'),{'UserId':Number(_0x78f3c9['query'][_0x57f0('0x63')][_0x27cbc5]),'OpenchannelAccountId':Number(_0x78f3c9[_0x57f0('0x4f')]['id'])});}}else{socket[_0x57f0('0xb1')]('userOpenchannelAccount:remove',{'UserId':Number(_0x78f3c9[_0x57f0('0x3d')][_0x57f0('0x63')]),'OpenchannelAccountId':Number(_0x78f3c9[_0x57f0('0x4f')]['id'])});}});}})[_0x57f0('0x19')](respondWithStatusCode(_0x3d2c6c,null))['catch'](handleError(_0x3d2c6c,null));};exports['getAgents']=function(_0x26ce4b,_0x3ee259,_0x280420){var _0x1c2744={};var _0x4419ac={};var _0x35fb48;var _0x35af29;return db[_0x57f0('0x4b')][_0x57f0('0x5e')]({'where':{'id':_0x26ce4b[_0x57f0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3ee259,null))['then'](function(_0x4a3acb){if(_0x4a3acb){_0x35fb48=_0x4a3acb;_0x4419ac[_0x57f0('0x3c')]=_[_0x57f0('0x3e')](db[_0x57f0('0xa8')][_0x57f0('0x39')]);_0x4419ac[_0x57f0('0x3d')]=_[_0x57f0('0x3e')](_0x26ce4b[_0x57f0('0x3d')]);_0x4419ac[_0x57f0('0x3f')]=_[_0x57f0('0x40')](_0x4419ac[_0x57f0('0x3c')],_0x4419ac[_0x57f0('0x3d')]);_0x1c2744[_0x57f0('0x42')]=_[_0x57f0('0x40')](_0x4419ac[_0x57f0('0x3c')],qs[_0x57f0('0x41')](_0x26ce4b['query'][_0x57f0('0x41')]));_0x1c2744[_0x57f0('0x42')]=_0x1c2744[_0x57f0('0x42')][_0x57f0('0x43')]?_0x1c2744['attributes']:_0x4419ac['model'];_0x1c2744['order']=qs[_0x57f0('0x46')](_0x26ce4b[_0x57f0('0x3d')][_0x57f0('0x46')]);_0x1c2744[_0x57f0('0x49')]=qs[_0x57f0('0x3f')](_['pick'](_0x26ce4b[_0x57f0('0x3d')],_0x4419ac['filters']));if(_0x26ce4b['query']['filter']){_0x1c2744[_0x57f0('0x49')]=_[_0x57f0('0x4a')](_0x1c2744['where'],{'$or':_[_0x57f0('0x38')](_0x1c2744[_0x57f0('0x42')],function(_0x578218){var _0x1d5542={};_0x1d5542[_0x578218]={'$like':'%'+_0x26ce4b[_0x57f0('0x3d')]['filter']+'%'};return _0x1d5542;})});}_0x1c2744=_[_0x57f0('0x4a')]({},_0x1c2744,_0x26ce4b[_0x57f0('0x50')]);return _0x35fb48[_0x57f0('0xb6')](_0x1c2744);}})[_0x57f0('0x19')](function(_0x2c9fe5){if(_0x2c9fe5){_0x35af29=_0x2c9fe5[_0x57f0('0x43')];if(!_0x26ce4b[_0x57f0('0x3d')]['hasOwnProperty']('nolimit')){_0x1c2744['limit']=qs[_0x57f0('0x28')](_0x26ce4b[_0x57f0('0x3d')][_0x57f0('0x28')]);_0x1c2744[_0x57f0('0x26')]=qs[_0x57f0('0x26')](_0x26ce4b[_0x57f0('0x3d')][_0x57f0('0x26')]);}return _0x35fb48['getAgents'](_0x1c2744);}})[_0x57f0('0x19')](function(_0x330eff){if(_0x330eff){return _0x330eff?{'count':_0x35af29,'rows':_0x330eff}:null;}})[_0x57f0('0x19')](respondWithResult(_0x3ee259,null))['catch'](handleError(_0x3ee259,null));};exports[_0x57f0('0x35')]=function(_0x353cd1,_0x5a7cfa,_0x12ac70){var _0x204999,_0x36089c,_0x55f209;if(_[_0x57f0('0x74')](_0x353cd1[_0x57f0('0x53')][_0x57f0('0x53')])||_0x353cd1['body'][_0x57f0('0x53')]===''){throw new db['Sequelize']['ValidationError'](_0x57f0('0x75'));}if(_[_0x57f0('0x74')](_0x353cd1[_0x57f0('0x53')]['to'])){}_0x204999=_0x353cd1[_0x57f0('0x53')]['to'];return db['OpenchannelAccount'][_0x57f0('0x5e')]({'where':{'id':_0x353cd1[_0x57f0('0x4f')]['id']}})[_0x57f0('0x19')](handleEntityNotFound(_0x5a7cfa,null))[_0x57f0('0x19')](function(_0x597ffd){if(_0x597ffd){return db['OpenchannelAccount'][_0x57f0('0x51')]({'where':{'id':_0x597ffd['id']},'include':[{'model':db[_0x57f0('0xb7')],'as':_0x57f0('0x7a'),'include':[{'model':db[_0x57f0('0x6a')],'as':_0x57f0('0x7b'),'where':{[_0x597ffd[_0x57f0('0x76')]]:_0x204999},'limit':0x1,'order':[[_0x57f0('0x6f'),'DESC']]}]}]})[_0x57f0('0x19')](handleEntityNotFound(_0x5a7cfa,null))[_0x57f0('0x19')](function(_0x52358e){if(_0x52358e&&_0x52358e[_0x57f0('0x7a')]){_0x36089c=_0x52358e['get']({'plain':!![]});if(_0x36089c['List']&&_0x36089c[_0x57f0('0x7a')][_0x57f0('0x7b')][_0x57f0('0x43')]){return _0x36089c[_0x57f0('0x7a')][_0x57f0('0x7b')][0x0];}return db[_0x57f0('0x6a')]['create'](_[_0x57f0('0xb8')](_0x353cd1[_0x57f0('0x53')],{'firstName':_0x204999,[_0x52358e[_0x57f0('0x76')]]:_0x204999,'phone':_0x204999,'ListId':_0x36089c['ListId']}));}})[_0x57f0('0x19')](handleEntityNotFound(_0x5a7cfa,null))['then'](function(_0x180352){if(_0x180352){_0x55f209=_0x180352;return db[_0x57f0('0x83')][_0x57f0('0x51')]({'where':{'ContactId':_0x55f209['id'],'closed':![],'OpenchannelAccountId':_0x36089c['id']}})[_0x57f0('0x19')](function(_0x227b5b){if(_0x227b5b){return[_0x227b5b,![]];}return db[_0x57f0('0x83')]['create']({'UserId':_0x353cd1[_0x57f0('0x54')]['id'],'ContactId':_0x55f209['id'],'OpenchannelAccountId':_0x36089c['id'],'lastMsgDirection':_0x57f0('0xb9'),'firstMsgDirection':_0x57f0('0xb9'),'Messages':[_[_0x57f0('0x4a')](_0x353cd1[_0x57f0('0x53')],{'read':![],'body':_0x353cd1[_0x57f0('0x53')][_0x57f0('0x53')],'OpenchannelAccountId':_0x36089c['id'],'UserId':_0x353cd1[_0x57f0('0x54')]['id'],'ContactId':_0x55f209['id']})]},{'include':[{'model':db[_0x57f0('0x8d')],'as':_0x57f0('0xba')}]})['then'](function(_0x5caf05){return[_0x5caf05,!![]];});});}})[_0x57f0('0x84')](function(_0x39835d,_0x2b714f){if(_0x2b714f){return _0x39835d;}return db['OpenchannelMessage'][_0x57f0('0x52')](_[_0x57f0('0x4a')](_0x353cd1['body'],{'read':![],'body':_0x353cd1[_0x57f0('0x53')][_0x57f0('0x53')],'OpenchannelAccountId':_0x36089c['id'],'OpenchannelInteractionId':_0x39835d['id'],'UserId':_0x353cd1[_0x57f0('0x54')]['id'],'ContactId':_0x55f209['id']}))[_0x57f0('0x19')](function(_0x33ae6c){_0x39835d[_0x57f0('0xbb')][_0x57f0('0xba')]=[];_0x39835d['dataValues'][_0x57f0('0xba')][_0x57f0('0x8a')](_0x33ae6c[_0x57f0('0xbb')]);return _0x39835d;});});}})[_0x57f0('0x19')](respondWithResult(_0x5a7cfa,null))['catch'](handleError(_0x5a7cfa,null));}; \ No newline at end of file +var _0xb51e=['hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','include','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','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','removeDispositions','CannedAnswer','getAnswers','nolimit','removeAnswers','openchannel','Sequelize','ValidationError','createdAt','difference','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','priority','asc','account','ListId','CmContact','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','get','created','push','*,*,*,*','UserId','User','unshift','agent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','color','tag','addAgents','ids','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','updatedAt','out','OpenchannelMessage','dataValues','Messages','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','OpenchannelAccounts','destroy','end','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length'];(function(_0x50c16c,_0x43b99e){var _0x24dc5f=function(_0x39b90f){while(--_0x39b90f){_0x50c16c['push'](_0x50c16c['shift']());}};_0x24dc5f(++_0x43b99e);}(_0xb51e,0x12f));var _0xeb51=function(_0x8f61fe,_0x1ad7a2){_0x8f61fe=_0x8f61fe-0x0;var _0x2b9d7d=_0xb51e[_0x8f61fe];return _0x2b9d7d;};'use strict';var emlformat=require(_0xeb51('0x0'));var rimraf=require(_0xeb51('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeb51('0x2'));var moment=require(_0xeb51('0x3'));var BPromise=require(_0xeb51('0x4'));var Mustache=require(_0xeb51('0x5'));var util=require(_0xeb51('0x6'));var path=require(_0xeb51('0x7'));var sox=require(_0xeb51('0x8'));var csv=require(_0xeb51('0x9'));var ejs=require(_0xeb51('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb51('0xb'));var squel=require('squel');var crypto=require(_0xeb51('0xc'));var jsforce=require(_0xeb51('0xd'));var deskjs=require(_0xeb51('0xe'));var toCsv=require(_0xeb51('0x9'));var querystring=require(_0xeb51('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb51('0x10'));var authService=require(_0xeb51('0x11'));var qs=require(_0xeb51('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb51('0x13'));var logger=require(_0xeb51('0x14'))(_0xeb51('0x15'));var utils=require(_0xeb51('0x16'));var config=require(_0xeb51('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xeb51('0x18')]=_[_0xeb51('0x19')](config[_0xeb51('0x18')],{'host':_0xeb51('0x1a'),'port':0x18eb});var socket=require(_0xeb51('0x1b'))(new Redis(config[_0xeb51('0x18')]));require(_0xeb51('0x1c'))[_0xeb51('0x1d')](socket);var jayson=require(_0xeb51('0x1e'));var client=jayson[_0xeb51('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0xeb51('0x1f')][_0xeb51('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2b0ee2,_0x1c6748,_0x2eead5,_0x36dfdf){return new BPromise(function(_0xa19fea,_0x2f09a8){var _0x412a9e=_0x36dfdf||client;return _0x412a9e['request'](_0x2b0ee2,_0x2eead5)[_0xeb51('0x21')](function(_0xeb6d0e){logger[_0xeb51('0x22')](_0xeb51('0x23'),_0x1c6748,_0xeb51('0x24'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x1c6748,'request\x20sent',JSON[_0xeb51('0x25')](_0xeb6d0e));if(_0xeb6d0e[_0xeb51('0x26')]){if(_0xeb6d0e[_0xeb51('0x26')][_0xeb51('0x27')]===0x1f4){logger[_0xeb51('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x1c6748,_0xeb6d0e[_0xeb51('0x26')][_0xeb51('0x28')]);return _0x2f09a8(_0xeb6d0e[_0xeb51('0x26')][_0xeb51('0x28')]);}logger[_0xeb51('0x26')](_0xeb51('0x23'),_0x1c6748,_0xeb6d0e[_0xeb51('0x26')][_0xeb51('0x28')]);return _0xa19fea(_0xeb6d0e[_0xeb51('0x26')][_0xeb51('0x28')]);}else{logger[_0xeb51('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x1c6748,_0xeb51('0x24'));_0xa19fea(_0xeb6d0e[_0xeb51('0x29')]['message']);}})[_0xeb51('0x2a')](function(_0x2afddd){logger[_0xeb51('0x26')](_0xeb51('0x23'),_0x1c6748,_0x2afddd);_0x2f09a8(_0x2afddd);});});}function respondWithStatusCode(_0x3cbb0d,_0x24f7fc){_0x24f7fc=_0x24f7fc||0xcc;return function(_0x3b8cf1){if(_0x3b8cf1){return _0x3cbb0d[_0xeb51('0x2b')](_0x24f7fc);}return _0x3cbb0d[_0xeb51('0x2c')](_0x24f7fc)['end']();};}function respondWithResult(_0x265d60,_0x404b3c){_0x404b3c=_0x404b3c||0xc8;return function(_0x2e323b){if(_0x2e323b){return _0x265d60[_0xeb51('0x2c')](_0x404b3c)[_0xeb51('0x2d')](_0x2e323b);}};}function respondWithFilteredResult(_0x1c48fc,_0xaa433){return function(_0x321b67){if(_0x321b67){var _0x28933f=typeof _0xaa433[_0xeb51('0x2e')]===_0xeb51('0x2f')&&typeof _0xaa433['limit']===_0xeb51('0x2f');var _0x3df529=_0x321b67[_0xeb51('0x30')];var _0x2661f4=_0x28933f?0x0:_0xaa433[_0xeb51('0x2e')];var _0xd24f92=_0x28933f?_0x321b67[_0xeb51('0x30')]:_0xaa433[_0xeb51('0x2e')]+_0xaa433[_0xeb51('0x31')];var _0x1306b8;if(_0xd24f92>=_0x3df529){_0xd24f92=_0x3df529;_0x1306b8=0xc8;}else{_0x1306b8=0xce;}_0x1c48fc[_0xeb51('0x2c')](_0x1306b8);return _0x1c48fc[_0xeb51('0x32')]('Content-Range',_0x2661f4+'-'+_0xd24f92+'/'+_0x3df529)[_0xeb51('0x2d')](_0x321b67);}return null;};}function patchUpdates(_0xaaac40){return function(_0x873a3a){try{jsonpatch['apply'](_0x873a3a,_0xaaac40,!![]);}catch(_0x448c3a){return BPromise[_0xeb51('0x33')](_0x448c3a);}return _0x873a3a[_0xeb51('0x34')]();};}function saveUpdates(_0x4877de,_0x30cf91){return function(_0x26ffac){if(_0x26ffac){return _0x26ffac[_0xeb51('0x35')](_0x4877de)[_0xeb51('0x21')](function(_0x333b1f){return _0x333b1f;});}return null;};}function removeEntity(_0x2c63f6,_0x1f9968){return function(_0x389f93){if(_0x389f93){return _0x389f93['destroy']()[_0xeb51('0x21')](function(){var _0x17b2bc=_0x389f93['get']({'plain':!![]});var _0x5a9ab9=_0xeb51('0x36');return db['UserProfileResource'][_0xeb51('0x37')]({'where':{'type':_0x5a9ab9,'resourceId':_0x17b2bc['id']}})[_0xeb51('0x21')](function(){return _0x389f93;});})[_0xeb51('0x21')](function(){_0x2c63f6[_0xeb51('0x2c')](0xcc)[_0xeb51('0x38')]();});}};}function handleEntityNotFound(_0x8a1489,_0x4eeb3c){return function(_0x56e132){if(!_0x56e132){_0x8a1489[_0xeb51('0x2b')](0x194);}return _0x56e132;};}function handleError(_0x2f9623,_0x7d0036){_0x7d0036=_0x7d0036||0x1f4;return function(_0x4f1712){logger['error'](_0x4f1712[_0xeb51('0x39')]);if(_0x4f1712[_0xeb51('0x3a')]){delete _0x4f1712[_0xeb51('0x3a')];}_0x2f9623[_0xeb51('0x2c')](_0x7d0036)[_0xeb51('0x3b')](_0x4f1712);};}exports[_0xeb51('0x3c')]=function(_0x4599da,_0x157c64){var _0x448dca={'include':[{'model':db[_0xeb51('0x3d')],'as':'mandatoryDispositionPause'}]},_0x468a39={},_0x4dc138={'count':0x0,'rows':[]};var _0x36af07=_[_0xeb51('0x3e')](db[_0xeb51('0x3f')][_0xeb51('0x40')],function(_0x3a7d6b){return{'name':_0x3a7d6b[_0xeb51('0x41')],'type':_0x3a7d6b['type'][_0xeb51('0x42')]};});_0x468a39['model']=_[_0xeb51('0x3e')](_0x36af07,_0xeb51('0x3a'));_0x468a39[_0xeb51('0x43')]=_[_0xeb51('0x44')](_0x4599da[_0xeb51('0x43')]);_0x468a39[_0xeb51('0x45')]=_['intersection'](_0x468a39[_0xeb51('0x46')],_0x468a39[_0xeb51('0x43')]);_0x448dca[_0xeb51('0x47')]=_[_0xeb51('0x48')](_0x468a39[_0xeb51('0x46')],qs['fields'](_0x4599da[_0xeb51('0x43')][_0xeb51('0x49')]));_0x448dca[_0xeb51('0x47')]=_0x448dca['attributes'][_0xeb51('0x4a')]?_0x448dca[_0xeb51('0x47')]:_0x468a39[_0xeb51('0x46')];if(!_0x4599da['query'][_0xeb51('0x4b')]('nolimit')){_0x448dca[_0xeb51('0x31')]=qs['limit'](_0x4599da[_0xeb51('0x43')][_0xeb51('0x31')]);_0x448dca[_0xeb51('0x2e')]=qs[_0xeb51('0x2e')](_0x4599da[_0xeb51('0x43')][_0xeb51('0x2e')]);}_0x448dca[_0xeb51('0x4c')]=qs[_0xeb51('0x4d')](_0x4599da[_0xeb51('0x43')][_0xeb51('0x4d')]);_0x448dca['where']=qs[_0xeb51('0x45')](_[_0xeb51('0x4e')](_0x4599da[_0xeb51('0x43')],_0x468a39[_0xeb51('0x45')]),_0x36af07);if(_0x4599da['query'][_0xeb51('0x4f')]){_0x448dca[_0xeb51('0x50')]=_[_0xeb51('0x51')](_0x448dca[_0xeb51('0x50')],{'$or':_[_0xeb51('0x3e')](_0x36af07,function(_0x1a9be4){if(_0x1a9be4['type']!==_0xeb51('0x52')){var _0x1f78dc={};_0x1f78dc[_0x1a9be4[_0xeb51('0x3a')]]={'$like':'%'+_0x4599da[_0xeb51('0x43')]['filter']+'%'};return _0x1f78dc;}})});}_0x448dca=_[_0xeb51('0x51')]({},_0x448dca,_0x4599da[_0xeb51('0x53')]);var _0x108dd2={'where':_0x448dca['where']};return db[_0xeb51('0x3f')][_0xeb51('0x30')](_0x108dd2)[_0xeb51('0x21')](function(_0x16461c){_0x4dc138[_0xeb51('0x30')]=_0x16461c;if(_0x4599da[_0xeb51('0x43')][_0xeb51('0x54')]){_0x448dca['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0xeb51('0x55')](_0x448dca);})['then'](function(_0x5d596a){_0x4dc138[_0xeb51('0x56')]=_0x5d596a;return _0x4dc138;})['then'](respondWithFilteredResult(_0x157c64,_0x448dca))[_0xeb51('0x2a')](handleError(_0x157c64,null));};exports[_0xeb51('0x57')]=function(_0x28c7b0,_0x18d25d){var _0x4bf6fe={'raw':![],'where':{'id':_0x28c7b0[_0xeb51('0x58')]['id']},'include':[{'model':db[_0xeb51('0x3d')],'as':_0xeb51('0x59')}]},_0x128872={};_0x128872['model']=_[_0xeb51('0x44')](db[_0xeb51('0x3f')]['rawAttributes']);_0x128872['query']=_[_0xeb51('0x44')](_0x28c7b0[_0xeb51('0x43')]);_0x128872[_0xeb51('0x45')]=_[_0xeb51('0x48')](_0x128872['model'],_0x128872[_0xeb51('0x43')]);_0x4bf6fe['attributes']=_[_0xeb51('0x48')](_0x128872[_0xeb51('0x46')],qs['fields'](_0x28c7b0[_0xeb51('0x43')][_0xeb51('0x49')]));_0x4bf6fe[_0xeb51('0x47')]=_0x4bf6fe[_0xeb51('0x47')][_0xeb51('0x4a')]?_0x4bf6fe[_0xeb51('0x47')]:_0x128872[_0xeb51('0x46')];if(_0x28c7b0['query']['includeAll']){_0x4bf6fe[_0xeb51('0x5a')]=[{'all':!![]}];}_0x4bf6fe=_['merge']({},_0x4bf6fe,_0x28c7b0[_0xeb51('0x53')]);return db[_0xeb51('0x3f')][_0xeb51('0x5b')](_0x4bf6fe)[_0xeb51('0x21')](handleEntityNotFound(_0x18d25d,null))[_0xeb51('0x21')](respondWithResult(_0x18d25d,null))[_0xeb51('0x2a')](handleError(_0x18d25d,null));};exports[_0xeb51('0x5c')]=function(_0x54a3ca,_0x42516e){return db[_0xeb51('0x3f')][_0xeb51('0x5c')](_0x54a3ca[_0xeb51('0x5d')],{})[_0xeb51('0x21')](function(_0x49d54a){var _0x46564b=_0x54a3ca[_0xeb51('0x5e')]['get']({'plain':!![]});if(!_0x46564b)throw new Error(_0xeb51('0x5f'));if(_0x46564b[_0xeb51('0x60')]===_0xeb51('0x5e')){var _0x4b6974=_0x49d54a['get']({'plain':!![]});var _0x1f3c9b='OpenchannelAccounts';return db[_0xeb51('0x61')][_0xeb51('0x5b')]({'where':{'name':_0x1f3c9b,'userProfileId':_0x46564b[_0xeb51('0x62')]},'raw':!![]})[_0xeb51('0x21')](function(_0x4bb88a){if(_0x4bb88a&&_0x4bb88a[_0xeb51('0x63')]===0x0){return db['UserProfileResource'][_0xeb51('0x5c')]({'name':_0x4b6974['name'],'resourceId':_0x4b6974['id'],'type':_0x4bb88a[_0xeb51('0x3a')],'sectionId':_0x4bb88a['id']},{})[_0xeb51('0x21')](function(){return _0x49d54a;});}else{return _0x49d54a;}})['catch'](function(_0x2e9d11){logger[_0xeb51('0x26')](_0xeb51('0x64'),_0x2e9d11);throw _0x2e9d11;});}return _0x49d54a;})[_0xeb51('0x21')](respondWithResult(_0x42516e,0xc9))['catch'](handleError(_0x42516e,null));};exports[_0xeb51('0x35')]=function(_0x1e4845,_0x4543d7){if(_0x1e4845[_0xeb51('0x5d')]['id']){delete _0x1e4845[_0xeb51('0x5d')]['id'];}return db['OpenchannelAccount'][_0xeb51('0x5b')]({'where':{'id':_0x1e4845[_0xeb51('0x58')]['id']},'include':[{'model':db[_0xeb51('0x3d')],'as':'mandatoryDispositionPause'}]})[_0xeb51('0x21')](handleEntityNotFound(_0x4543d7,null))[_0xeb51('0x21')](saveUpdates(_0x1e4845['body'],null))[_0xeb51('0x21')](respondWithResult(_0x4543d7,null))[_0xeb51('0x2a')](handleError(_0x4543d7,null));};exports[_0xeb51('0x37')]=function(_0x2d5825,_0x237c5a){return db[_0xeb51('0x3f')][_0xeb51('0x5b')]({'where':{'id':_0x2d5825[_0xeb51('0x58')]['id']}})['then'](handleEntityNotFound(_0x237c5a,null))['then'](removeEntity(_0x237c5a,null))[_0xeb51('0x2a')](handleError(_0x237c5a,null));};exports[_0xeb51('0x65')]=function(_0x975742,_0x5accda){return db[_0xeb51('0x3f')]['describe']()[_0xeb51('0x21')](respondWithResult(_0x5accda,null))[_0xeb51('0x2a')](handleError(_0x5accda,null));};exports[_0xeb51('0x66')]=function(_0x429a2d,_0xc88762,_0x26bc2e){if(_0x429a2d[_0xeb51('0x5d')]['id']){delete _0x429a2d['body']['id'];}return db[_0xeb51('0x3f')][_0xeb51('0x5b')]({'where':{'id':_0x429a2d[_0xeb51('0x58')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0xc88762,null))[_0xeb51('0x21')](function(_0x1f4b64){if(_0x1f4b64){_0x429a2d[_0xeb51('0x5d')][_0xeb51('0x67')]=_0x1f4b64['id'];return db['Disposition']['create'](_0x429a2d[_0xeb51('0x5d')]);}})[_0xeb51('0x21')](respondWithResult(_0xc88762,null))['catch'](handleError(_0xc88762,null));};exports[_0xeb51('0x68')]=function(_0x5b22b3,_0x430a9d,_0x5ea71a){var _0xf7e86a={'raw':![],'where':{}};var _0x1f432a={};var _0x6346a={'count':0x0,'rows':[]};return db[_0xeb51('0x3f')][_0xeb51('0x69')]({'where':{'id':_0x5b22b3[_0xeb51('0x58')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x430a9d,null))['then'](function(_0x4ec422){if(_0x4ec422){_0x1f432a[_0xeb51('0x46')]=_[_0xeb51('0x44')](db['Disposition'][_0xeb51('0x40')]);_0x1f432a[_0xeb51('0x43')]=_['keys'](_0x5b22b3['query']);_0x1f432a[_0xeb51('0x45')]=_[_0xeb51('0x48')](_0x1f432a[_0xeb51('0x46')],_0x1f432a[_0xeb51('0x43')]);_0xf7e86a[_0xeb51('0x47')]=_[_0xeb51('0x48')](_0x1f432a[_0xeb51('0x46')],qs[_0xeb51('0x49')](_0x5b22b3[_0xeb51('0x43')]['fields']));_0xf7e86a[_0xeb51('0x47')]=_0xf7e86a[_0xeb51('0x47')][_0xeb51('0x4a')]?_0xf7e86a[_0xeb51('0x47')]:_0x1f432a[_0xeb51('0x46')];if(!_0x5b22b3['query'][_0xeb51('0x4b')]('nolimit')){_0xf7e86a['limit']=qs[_0xeb51('0x31')](_0x5b22b3[_0xeb51('0x43')][_0xeb51('0x31')]);_0xf7e86a[_0xeb51('0x2e')]=qs[_0xeb51('0x2e')](_0x5b22b3['query'][_0xeb51('0x2e')]);}_0xf7e86a['order']=qs['sort'](_0x5b22b3[_0xeb51('0x43')][_0xeb51('0x4d')]);_0xf7e86a[_0xeb51('0x50')]=qs['filters'](_['pick'](_0x5b22b3[_0xeb51('0x43')],_0x1f432a[_0xeb51('0x45')]));_0xf7e86a[_0xeb51('0x50')][_0xeb51('0x67')]=_0x4ec422['id'];if(_0x5b22b3['query']['filter']){_0xf7e86a[_0xeb51('0x50')]=_[_0xeb51('0x51')](_0xf7e86a[_0xeb51('0x50')],{'$or':_[_0xeb51('0x3e')](_0xf7e86a['attributes'],function(_0x1ab675){var _0x7e9a3d={};_0x7e9a3d[_0x1ab675]={'$like':'%'+_0x5b22b3['query'][_0xeb51('0x4f')]+'%'};return _0x7e9a3d;})});}_0xf7e86a=_[_0xeb51('0x51')]({},_0xf7e86a,_0x5b22b3['options']);return db[_0xeb51('0x6a')][_0xeb51('0x30')]({'where':_0xf7e86a['where']})[_0xeb51('0x21')](function(_0x3c59af){_0x6346a['count']=_0x3c59af;if(_0x5b22b3[_0xeb51('0x43')]['includeAll']){_0xf7e86a[_0xeb51('0x5a')]=[{'all':!![]}];}return db[_0xeb51('0x6a')][_0xeb51('0x55')](_0xf7e86a);})['then'](function(_0xf7a1bb){_0x6346a['rows']=_0xf7a1bb;return _0x6346a;});}})[_0xeb51('0x21')](respondWithFilteredResult(_0x430a9d,_0xf7e86a))['catch'](handleError(_0x430a9d,null));};exports[_0xeb51('0x6b')]=function(_0x12c863,_0x450ca3,_0x519ea4){return db['OpenchannelAccount'][_0xeb51('0x5b')]({'where':{'id':_0x12c863['params']['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x450ca3,null))['then'](function(_0x4db968){if(_0x4db968){return _0x4db968[_0xeb51('0x6b')](_0x12c863[_0xeb51('0x43')]['ids']);}})[_0xeb51('0x21')](respondWithStatusCode(_0x450ca3,null))[_0xeb51('0x2a')](handleError(_0x450ca3,null));};exports['addAnswer']=function(_0x110f73,_0x49047b,_0xba2ee2){if(_0x110f73[_0xeb51('0x5d')]['id']){delete _0x110f73[_0xeb51('0x5d')]['id'];}return db['OpenchannelAccount'][_0xeb51('0x5b')]({'where':{'id':_0x110f73['params']['id']}})['then'](handleEntityNotFound(_0x49047b,null))['then'](function(_0x165426){if(_0x165426){_0x110f73[_0xeb51('0x5d')][_0xeb51('0x67')]=_0x165426['id'];return db[_0xeb51('0x6c')][_0xeb51('0x5c')](_0x110f73[_0xeb51('0x5d')]);}})[_0xeb51('0x21')](respondWithResult(_0x49047b,null))['catch'](handleError(_0x49047b,null));};exports[_0xeb51('0x6d')]=function(_0x18391d,_0x901c70,_0x32e6df){var _0x3db0f1={'raw':![],'where':{}};var _0x207144={};var _0x4691c2={'count':0x0,'rows':[]};return db[_0xeb51('0x3f')][_0xeb51('0x69')]({'where':{'id':_0x18391d[_0xeb51('0x58')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x901c70,null))['then'](function(_0x510a4c){if(_0x510a4c){_0x207144[_0xeb51('0x46')]=_['keys'](db[_0xeb51('0x6c')]['rawAttributes']);_0x207144[_0xeb51('0x43')]=_['keys'](_0x18391d['query']);_0x207144['filters']=_['intersection'](_0x207144[_0xeb51('0x46')],_0x207144[_0xeb51('0x43')]);_0x3db0f1['attributes']=_['intersection'](_0x207144[_0xeb51('0x46')],qs[_0xeb51('0x49')](_0x18391d[_0xeb51('0x43')][_0xeb51('0x49')]));_0x3db0f1['attributes']=_0x3db0f1[_0xeb51('0x47')][_0xeb51('0x4a')]?_0x3db0f1[_0xeb51('0x47')]:_0x207144[_0xeb51('0x46')];if(!_0x18391d['query']['hasOwnProperty'](_0xeb51('0x6e'))){_0x3db0f1[_0xeb51('0x31')]=qs['limit'](_0x18391d[_0xeb51('0x43')][_0xeb51('0x31')]);_0x3db0f1[_0xeb51('0x2e')]=qs[_0xeb51('0x2e')](_0x18391d[_0xeb51('0x43')]['offset']);}_0x3db0f1[_0xeb51('0x4c')]=qs[_0xeb51('0x4d')](_0x18391d[_0xeb51('0x43')][_0xeb51('0x4d')]);_0x3db0f1['where']=qs[_0xeb51('0x45')](_['pick'](_0x18391d[_0xeb51('0x43')],_0x207144[_0xeb51('0x45')]));_0x3db0f1[_0xeb51('0x50')][_0xeb51('0x67')]=_0x510a4c['id'];if(_0x18391d['query'][_0xeb51('0x4f')]){_0x3db0f1['where']=_[_0xeb51('0x51')](_0x3db0f1['where'],{'$or':_[_0xeb51('0x3e')](_0x3db0f1[_0xeb51('0x47')],function(_0x5570fc){var _0x140cc9={};_0x140cc9[_0x5570fc]={'$like':'%'+_0x18391d[_0xeb51('0x43')][_0xeb51('0x4f')]+'%'};return _0x140cc9;})});}_0x3db0f1=_[_0xeb51('0x51')]({},_0x3db0f1,_0x18391d[_0xeb51('0x53')]);return db[_0xeb51('0x6c')][_0xeb51('0x30')]({'where':_0x3db0f1[_0xeb51('0x50')]})[_0xeb51('0x21')](function(_0x294d97){_0x4691c2[_0xeb51('0x30')]=_0x294d97;if(_0x18391d[_0xeb51('0x43')][_0xeb51('0x54')]){_0x3db0f1[_0xeb51('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xeb51('0x55')](_0x3db0f1);})['then'](function(_0x44e849){_0x4691c2[_0xeb51('0x56')]=_0x44e849;return _0x4691c2;});}})[_0xeb51('0x21')](respondWithFilteredResult(_0x901c70,_0x3db0f1))[_0xeb51('0x2a')](handleError(_0x901c70,null));};exports[_0xeb51('0x6f')]=function(_0x360897,_0x3873e5,_0x35b32e){return db['OpenchannelAccount'][_0xeb51('0x5b')]({'where':{'id':_0x360897[_0xeb51('0x58')]['id']}})['then'](handleEntityNotFound(_0x3873e5,null))['then'](function(_0x26639e){if(_0x26639e){return _0x26639e['removeAnswers'](_0x360897[_0xeb51('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x3873e5,null))[_0xeb51('0x2a')](handleError(_0x3873e5,null));};exports['notify']=function(_0x48b97c,_0x2dc370,_0x1098fc){var _0x3de866={'body':_0x48b97c['body'],'channel':_0xeb51('0x70')};var _0x3a2825=[];var _0x1b2348=[];var _0x2137ff={};var _0x41669f=![];return db['CmContact']['describe']()[_0xeb51('0x21')](function(_0x564751){if(!_0x564751){throw new db[(_0xeb51('0x71'))][(_0xeb51('0x72'))]('no\x20available\x20attributes');}_0x3a2825=_['difference'](_['keys'](_0x564751),[_0xeb51('0x73'),'updatedAt']);_0x1b2348=_[_0xeb51('0x74')](_[_0xeb51('0x44')](_0x564751),['createdAt','updatedAt',_0xeb51('0x75'),'ListId']);if(_0x48b97c[_0xeb51('0x5d')]['id']){delete _0x48b97c['body']['id'];}if(_[_0xeb51('0x76')](_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x77')])){throw new db[(_0xeb51('0x71'))][(_0xeb51('0x72'))](_0xeb51('0x78'));}if(_[_0xeb51('0x76')](_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x5d')])||_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x5d')]===''){throw new db[(_0xeb51('0x71'))][(_0xeb51('0x72'))](_0xeb51('0x79'));}if(_['isNil'](_0x48b97c['body']['mapKey'])){throw new db[(_0xeb51('0x71'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b2348);}if(!_['includes'](_0x1b2348,_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x7a')])){throw new db[(_0xeb51('0x71'))][(_0xeb51('0x72'))](_0xeb51('0x7b')+_0x1b2348);}_0x2137ff[_0x48b97c['body'][_0xeb51('0x7a')]]=_0x48b97c['body'][_0xeb51('0x77')];})[_0xeb51('0x21')](function(){return db['OpenchannelAccount'][_0xeb51('0x5b')]({'where':{'id':_0x48b97c[_0xeb51('0x58')]['id']},'include':[{'model':db[_0xeb51('0x7c')],'as':_0xeb51('0x7d'),'include':[{'model':db['CmContact'],'as':_0xeb51('0x7e'),'where':_0x2137ff,'limit':0x1,'order':[['updatedAt',_0xeb51('0x7f')]]}]},{'model':db[_0xeb51('0x80')],'as':_0xeb51('0x81')}]});})['then'](handleEntityNotFound(_0x2dc370,null))[_0xeb51('0x21')](function(_0x5016b2){if(_0x5016b2&&_0x5016b2['List']){_0x3de866['account']=_0x5016b2;_0x3de866[_0xeb51('0x82')]=_0x5016b2[_0xeb51('0x81')];_0x3de866['list']=_0x5016b2[_0xeb51('0x7d')];_0x3de866[_0xeb51('0x82')]=_['orderBy'](_0x3de866[_0xeb51('0x82')],[_0xeb51('0x83')],[_0xeb51('0x84')]);if(_0x3de866[_0xeb51('0x85')][_0xeb51('0x81')]){delete _0x3de866[_0xeb51('0x85')]['Applications'];}if(_0x3de866['account']['List']&&_0x3de866[_0xeb51('0x85')]['List'][_0xeb51('0x7e')][_0xeb51('0x4a')]){return _0x3de866[_0xeb51('0x85')]['List'][_0xeb51('0x7e')][0x0];}var _0x36e37d=_[_0xeb51('0x19')](_0x48b97c[_0xeb51('0x5d')],{'firstName':_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x77')],'ListId':_0x5016b2[_0xeb51('0x86')]});_0x36e37d[_0x48b97c['body'][_0xeb51('0x7a')]]=_0x48b97c['body'][_0xeb51('0x77')];return db[_0xeb51('0x87')][_0xeb51('0x5c')](_0x36e37d,{'fields':_0x3a2825,'raw':!![]});}})[_0xeb51('0x21')](handleEntityNotFound(_0x2dc370,null))[_0xeb51('0x21')](function(_0x28028e){_0x3de866[_0xeb51('0x88')]=_0x28028e;if(_0x28028e){var _0x13b910={'ContactId':_0x28028e['id'],'OpenchannelAccountId':_0x48b97c[_0xeb51('0x58')]['id'],'from':(_0x28028e[_0xeb51('0x89')]||'')+'\x20'+(_0x28028e[_0xeb51('0x8a')]||'')};var _0x30d78d={'OpenchannelAccountId':_0x48b97c[_0xeb51('0x58')]['id'],'closed':![]};if(_0x48b97c['body'][_0xeb51('0x8b')]){_0x30d78d[_0xeb51('0x8b')]=_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x8b')];return db[_0xeb51('0x8c')]['find']({'where':_0x30d78d})[_0xeb51('0x21')](function(_0x345be7){if(_0x345be7){return[_0x345be7,![]];}_0x13b910['threadId']=_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x8b')];_0x13b910[_0xeb51('0x8d')]=_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x8d')];return db[_0xeb51('0x8c')][_0xeb51('0x5c')](_0x13b910)[_0xeb51('0x21')](function(_0x126827){return[_0x126827,!![]];});});}else{_0x30d78d[_0xeb51('0x8b')]=null;}_0x30d78d[_0xeb51('0x8e')]=_0x28028e['id'];return db[_0xeb51('0x8c')][_0xeb51('0x5b')]({'where':_0x30d78d})['then'](function(_0x5ce6d2){if(_0x5ce6d2){return[_0x5ce6d2,![]];}return db[_0xeb51('0x8c')]['create'](_0x13b910)[_0xeb51('0x21')](function(_0x1edb38){return[_0x1edb38,!![]];});});}})[_0xeb51('0x8f')](function(_0x596b58,_0x1f17c5){if(_0x596b58){_0x41669f=_0x1f17c5;if(!_0x1f17c5){var _0x4139aa={'from':(_0x3de866[_0xeb51('0x88')][_0xeb51('0x89')]||'')+'\x20'+(_0x3de866['contact'][_0xeb51('0x8a')]||'')};if(_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x8b')]&&_0x48b97c[_0xeb51('0x5d')]['messageId']&&_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x8b')]!=_0x48b97c[_0xeb51('0x5d')]['messageId']){_0x4139aa[_0xeb51('0x8b')]=_0x48b97c[_0xeb51('0x5d')][_0xeb51('0x90')];}return _0x596b58[_0xeb51('0x35')](_0x4139aa);}else{return _0x596b58;}}})[_0xeb51('0x21')](function(_0x2f312d){_0x3de866[_0xeb51('0x91')]=_0x2f312d[_0xeb51('0x92')]({'plain':!![]});_0x3de866[_0xeb51('0x91')][_0xeb51('0x93')]=_0x41669f;if(_0x3de866[_0xeb51('0x91')]['created']){if(_0x3de866['account']['autoclose']){_0x3de866['applications'][_0xeb51('0x94')]({'id':0x0,'priority':_0x3de866['applications']['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xeb51('0x95')});}}return db['OpenchannelMessage']['create']({'body':_0x48b97c[_0xeb51('0x5d')]['body'],'OpenchannelAccountId':_0x48b97c['params']['id'],'OpenchannelInteractionId':_0x2f312d['id'],'direction':'in','ContactId':_0x3de866[_0xeb51('0x88')]['id'],'AttachmentId':_0x48b97c[_0xeb51('0x5d')]['AttachmentId']});})[_0xeb51('0x21')](function(_0x9ac077){_0x3de866[_0xeb51('0x28')]=_0x9ac077;if(!_0x3de866[_0xeb51('0x91')][_0xeb51('0x96')])return;return db[_0xeb51('0x97')][_0xeb51('0x5b')]({'attributes':['id',_0xeb51('0x3a')],'where':{'id':_0x3de866['interaction'][_0xeb51('0x96')]}});})[_0xeb51('0x21')](function(_0x3f1a01){if(_0x3f1a01){_0x3de866[_0xeb51('0x82')][_0xeb51('0x98')]({'id':0x0,'priority':0x0,'app':_0xeb51('0x99'),'appdata':_0x3f1a01['name']+','+(_0x3de866[_0xeb51('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0xeb51('0x95')});}if(!_0x3de866[_0xeb51('0x91')][_0xeb51('0x9a')])return;return db[_0xeb51('0x9b')][_0xeb51('0x5b')]({'attributes':['id',_0xeb51('0x3a')],'where':{'id':_0x3de866[_0xeb51('0x91')]['queueId']}});})[_0xeb51('0x21')](function(_0x16c55c){if(_0x16c55c){_0x3de866['applications'][_0xeb51('0x98')]({'id':0x0,'priority':0x1,'app':_0xeb51('0x9c'),'appdata':_0x16c55c[_0xeb51('0x3a')]+','+(_0x3de866[_0xeb51('0x85')][_0xeb51('0x9d')]||0x12c),'interval':_0xeb51('0x95')});}return respondWithRpcPromise(_0xeb51('0x9e'),_0xeb51('0x9f'),_0x3de866);})[_0xeb51('0x21')](function(_0x41345b){respondWithRpcPromise(_0xeb51('0xa0'),_0xeb51('0xa0'),{'event':_0xeb51('0xa1'),'message':_0x41345b},client9002);return _0x41345b;})[_0xeb51('0x21')](respondWithResult(_0x2dc370,null))[_0xeb51('0x2a')](handleError(_0x2dc370,null));};exports['addApplications']=function(_0x2e7152,_0x2d208c){var _0x41efc1=_0x2e7152[_0xeb51('0x58')]['id'];var _0x10578d=_0x2e7152[_0xeb51('0x5d')];var _0x54cd31=0xc8;var _0x3838c5=null;return db['sequelize'][_0xeb51('0xa2')]({'isolationLevel':db[_0xeb51('0xa3')][_0xeb51('0xa4')][_0xeb51('0xa5')][_0xeb51('0xa6')]},function(_0x3e3cba){return db[_0xeb51('0x3f')][_0xeb51('0x69')]({'where':{'id':_0x41efc1},'transaction':_0x3e3cba})['then'](function(_0x5abf4a){if(_0x5abf4a){return db[_0xeb51('0x80')][_0xeb51('0x37')]({'where':{'OpenchannelAccountId':_0x41efc1},'transaction':_0x3e3cba})[_0xeb51('0x21')](function(){var _0x3ac3cc=_[_0xeb51('0x3e')](_0x10578d,function(_0x124277){_0x124277[_0xeb51('0x67')]=_0x41efc1;return _0x124277;});return db[_0xeb51('0x80')][_0xeb51('0xa7')](_0x3ac3cc,{'transaction':_0x3e3cba});});}else{_0x54cd31=0x194;_0x3838c5=[];}});})[_0xeb51('0x21')](function(){if(_0x54cd31!==0x194){return db[_0xeb51('0x80')][_0xeb51('0xa8')]({'where':{'OpenchannelAccountId':_0x41efc1},'order':'priority'})[_0xeb51('0x21')](function(_0x2a9b2e){_0x3838c5=_0x2a9b2e;});}})[_0xeb51('0x2a')](function(_0x40d817){_0x54cd31=0x1f4;logger['error'](_0x40d817[_0xeb51('0x39')]);if(_0x40d817[_0xeb51('0x3a')]){delete _0x40d817[_0xeb51('0x3a')];}_0x3838c5=_0x40d817;})['finally'](function(){if(_0x3838c5===null){_0x2d208c[_0xeb51('0x2b')](_0x54cd31);}else{if(_0x54cd31===0x1f4){_0x2d208c['status'](_0x54cd31)[_0xeb51('0x3b')](_0x3838c5);}else{_0x2d208c['status'](_0x54cd31)['json'](_0x3838c5);}}});};exports[_0xeb51('0xa9')]=function(_0xcebaf8,_0xc69bda,_0xa1ad47){var _0x1d218a={};var _0x3570b6={};var _0x5d753d;var _0x1fbbf7;return db[_0xeb51('0x3f')][_0xeb51('0x69')]({'where':{'id':_0xcebaf8[_0xeb51('0x58')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0xc69bda,null))[_0xeb51('0x21')](function(_0x2d4cd5){if(_0x2d4cd5){_0x5d753d=_0x2d4cd5;_0x3570b6[_0xeb51('0x46')]=_[_0xeb51('0x44')](db[_0xeb51('0x80')][_0xeb51('0x40')]);_0x3570b6[_0xeb51('0x43')]=_[_0xeb51('0x44')](_0xcebaf8[_0xeb51('0x43')]);_0x3570b6[_0xeb51('0x45')]=_[_0xeb51('0x48')](_0x3570b6[_0xeb51('0x46')],_0x3570b6['query']);_0x1d218a[_0xeb51('0x47')]=_[_0xeb51('0x48')](_0x3570b6[_0xeb51('0x46')],qs[_0xeb51('0x49')](_0xcebaf8[_0xeb51('0x43')][_0xeb51('0x49')]));_0x1d218a['attributes']=_0x1d218a[_0xeb51('0x47')]['length']?_0x1d218a['attributes']:_0x3570b6['model'];_0x1d218a[_0xeb51('0x4c')]=qs[_0xeb51('0x4d')](_0xcebaf8[_0xeb51('0x43')][_0xeb51('0x4d')]);_0x1d218a[_0xeb51('0x50')]=qs['filters'](_['pick'](_0xcebaf8[_0xeb51('0x43')],_0x3570b6[_0xeb51('0x45')]));if(_0xcebaf8['query'][_0xeb51('0x4f')]){_0x1d218a[_0xeb51('0x50')]=_['merge'](_0x1d218a[_0xeb51('0x50')],{'$or':_[_0xeb51('0x3e')](_0x1d218a[_0xeb51('0x47')],function(_0x390700){var _0x24315a={};_0x24315a[_0x390700]={'$like':'%'+_0xcebaf8[_0xeb51('0x43')][_0xeb51('0x4f')]+'%'};return _0x24315a;})});}_0x1d218a=_[_0xeb51('0x51')]({},_0x1d218a,_0xcebaf8[_0xeb51('0x53')]);return _0x5d753d[_0xeb51('0xa9')](_0x1d218a);}})['then'](function(_0x5e0e94){if(_0x5e0e94){_0x1fbbf7=_0x5e0e94['length'];if(!_0xcebaf8[_0xeb51('0x43')][_0xeb51('0x4b')](_0xeb51('0x6e'))){_0x1d218a[_0xeb51('0x31')]=qs['limit'](_0xcebaf8[_0xeb51('0x43')][_0xeb51('0x31')]);_0x1d218a[_0xeb51('0x2e')]=qs['offset'](_0xcebaf8[_0xeb51('0x43')][_0xeb51('0x2e')]);}return _0x5d753d[_0xeb51('0xa9')](_0x1d218a);}})[_0xeb51('0x21')](function(_0x5d5335){if(_0x5d5335){return _0x5d5335?{'count':_0x1fbbf7,'rows':_0x5d5335}:null;}})[_0xeb51('0x21')](respondWithResult(_0xc69bda,null))[_0xeb51('0x2a')](handleError(_0xc69bda,null));};exports[_0xeb51('0xaa')]=function(_0x2aa41d,_0x3427b6,_0x59bde2){var _0x23f644={'raw':![],'where':{}};var _0x5ce59d={};var _0x3fb149={'count':0x0,'rows':[]};return db[_0xeb51('0x3f')][_0xeb51('0x69')]({'where':{'id':_0x2aa41d['params']['id']}})['then'](handleEntityNotFound(_0x3427b6,null))[_0xeb51('0x21')](function(_0x2dcefb){if(_0x2dcefb){_0x5ce59d[_0xeb51('0x46')]=_[_0xeb51('0x44')](db[_0xeb51('0x8c')][_0xeb51('0x40')]);_0x5ce59d['query']=_[_0xeb51('0x44')](_0x2aa41d[_0xeb51('0x43')]);_0x5ce59d[_0xeb51('0x45')]=_[_0xeb51('0x48')](_0x5ce59d[_0xeb51('0x46')],_0x5ce59d[_0xeb51('0x43')]);_0x23f644[_0xeb51('0x47')]=_[_0xeb51('0x48')](_0x5ce59d['model'],qs[_0xeb51('0x49')](_0x2aa41d[_0xeb51('0x43')][_0xeb51('0x49')]));_0x23f644[_0xeb51('0x47')]=_0x23f644[_0xeb51('0x47')][_0xeb51('0x4a')]?_0x23f644[_0xeb51('0x47')]:_0x5ce59d[_0xeb51('0x46')];if(!_0x2aa41d[_0xeb51('0x43')][_0xeb51('0x4b')]('nolimit')){_0x23f644[_0xeb51('0x31')]=qs[_0xeb51('0x31')](_0x2aa41d['query'][_0xeb51('0x31')]);_0x23f644['offset']=qs[_0xeb51('0x2e')](_0x2aa41d['query'][_0xeb51('0x2e')]);}_0x23f644[_0xeb51('0x4c')]=qs[_0xeb51('0x4d')](_0x2aa41d[_0xeb51('0x43')][_0xeb51('0x4d')]);_0x23f644[_0xeb51('0x50')]=qs[_0xeb51('0x45')](_[_0xeb51('0x4e')](_0x2aa41d[_0xeb51('0x43')],_0x5ce59d[_0xeb51('0x45')]));_0x23f644[_0xeb51('0x50')][_0xeb51('0x67')]=_0x2dcefb['id'];if(_0x2aa41d[_0xeb51('0x43')][_0xeb51('0x4f')]){_0x23f644[_0xeb51('0x50')]=_[_0xeb51('0x51')](_0x23f644[_0xeb51('0x50')],{'$or':_[_0xeb51('0x3e')](_0x23f644[_0xeb51('0x47')],function(_0x18f73e){var _0x1222fa={};_0x1222fa[_0x18f73e]={'$like':'%'+_0x2aa41d['query'][_0xeb51('0x4f')]+'%'};return _0x1222fa;})});}_0x23f644=_[_0xeb51('0x51')]({},_0x23f644,_0x2aa41d['options']);return db['OpenchannelInteraction']['count']({'where':_0x23f644[_0xeb51('0x50')]})[_0xeb51('0x21')](function(_0xc0f248){_0x3fb149['count']=_0xc0f248;if(_0x2aa41d[_0xeb51('0x43')][_0xeb51('0x54')]){_0x23f644[_0xeb51('0x5a')]=[{'model':db[_0xeb51('0x87')],'as':_0xeb51('0xab'),'required':![]},{'model':db[_0xeb51('0x97')],'as':'Owner','attributes':[_0xeb51('0x3a'),_0xeb51('0xac'),_0xeb51('0xad')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xeb51('0x3a'),_0xeb51('0xae')],'where':_0x2aa41d[_0xeb51('0x43')][_0xeb51('0xaf')]?{'id':_0x2aa41d[_0xeb51('0x43')][_0xeb51('0xaf')]}:undefined,'required':_0x2aa41d[_0xeb51('0x43')]['tag']?!![]:![]}];}return db[_0xeb51('0x8c')]['findAll'](_0x23f644);})[_0xeb51('0x21')](function(_0x3656ed){_0x3fb149[_0xeb51('0x56')]=_0x3656ed;return _0x3fb149;});}})[_0xeb51('0x21')](respondWithFilteredResult(_0x3427b6,_0x23f644))['catch'](handleError(_0x3427b6,null));};exports[_0xeb51('0xb0')]=function(_0x32fddf,_0x49290e,_0x74b19){return db['OpenchannelAccount'][_0xeb51('0x5b')]({'where':{'id':_0x32fddf[_0xeb51('0x58')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x49290e,null))[_0xeb51('0x21')](function(_0x17fb07){if(_0x17fb07){return _0x17fb07[_0xeb51('0xb0')](_0x32fddf[_0xeb51('0x5d')]['ids'],_['omit'](_0x32fddf[_0xeb51('0x5d')],[_0xeb51('0xb1'),'id'])||{})['spread'](function(_0x48d1bc){for(var _0x228d3b=0x0;_0x228d3b<_0x32fddf[_0xeb51('0x5d')][_0xeb51('0xb1')][_0xeb51('0x4a')];_0x228d3b+=0x1){socket[_0xeb51('0xb2')](_0xeb51('0xb3'),{'UserId':Number(_0x32fddf[_0xeb51('0x5d')][_0xeb51('0xb1')][_0x228d3b]),'OpenchannelAccountId':Number(_0x32fddf[_0xeb51('0x58')]['id'])});}return _0x48d1bc;});}})[_0xeb51('0x21')](respondWithResult(_0x49290e,null))['catch'](handleError(_0x49290e,null));};exports['removeAgents']=function(_0x1d7313,_0x276aa4,_0x1f1305){return db[_0xeb51('0x3f')][_0xeb51('0x5b')]({'where':{'id':_0x1d7313[_0xeb51('0x58')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x276aa4,null))[_0xeb51('0x21')](function(_0x5ec8bf){if(_0x5ec8bf){return _0x5ec8bf[_0xeb51('0xb4')](_0x1d7313[_0xeb51('0x43')][_0xeb51('0xb1')])[_0xeb51('0x21')](function(){if(_[_0xeb51('0xb5')](_0x1d7313[_0xeb51('0x43')][_0xeb51('0xb1')])){for(var _0x5bde17=0x0;_0x5bde17<_0x1d7313[_0xeb51('0x43')][_0xeb51('0xb1')]['length'];_0x5bde17+=0x1){socket[_0xeb51('0xb2')](_0xeb51('0xb6'),{'UserId':Number(_0x1d7313['query']['ids'][_0x5bde17]),'OpenchannelAccountId':Number(_0x1d7313[_0xeb51('0x58')]['id'])});}}else{socket[_0xeb51('0xb2')](_0xeb51('0xb6'),{'UserId':Number(_0x1d7313[_0xeb51('0x43')][_0xeb51('0xb1')]),'OpenchannelAccountId':Number(_0x1d7313[_0xeb51('0x58')]['id'])});}});}})[_0xeb51('0x21')](respondWithStatusCode(_0x276aa4,null))[_0xeb51('0x2a')](handleError(_0x276aa4,null));};exports[_0xeb51('0xb7')]=function(_0x586d85,_0x39cbcb,_0x57527d){var _0x243baa={};var _0x1d2e04={};var _0x50ff98;var _0x1e37be;return db[_0xeb51('0x3f')][_0xeb51('0x69')]({'where':{'id':_0x586d85['params']['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x39cbcb,null))[_0xeb51('0x21')](function(_0x246db4){if(_0x246db4){_0x50ff98=_0x246db4;_0x1d2e04[_0xeb51('0x46')]=_[_0xeb51('0x44')](db[_0xeb51('0x97')][_0xeb51('0x40')]);_0x1d2e04[_0xeb51('0x43')]=_['keys'](_0x586d85['query']);_0x1d2e04[_0xeb51('0x45')]=_[_0xeb51('0x48')](_0x1d2e04[_0xeb51('0x46')],_0x1d2e04[_0xeb51('0x43')]);_0x243baa['attributes']=_[_0xeb51('0x48')](_0x1d2e04[_0xeb51('0x46')],qs['fields'](_0x586d85['query']['fields']));_0x243baa[_0xeb51('0x47')]=_0x243baa[_0xeb51('0x47')][_0xeb51('0x4a')]?_0x243baa[_0xeb51('0x47')]:_0x1d2e04[_0xeb51('0x46')];_0x243baa[_0xeb51('0x4c')]=qs['sort'](_0x586d85[_0xeb51('0x43')][_0xeb51('0x4d')]);_0x243baa['where']=qs[_0xeb51('0x45')](_[_0xeb51('0x4e')](_0x586d85['query'],_0x1d2e04[_0xeb51('0x45')]));if(_0x586d85[_0xeb51('0x43')][_0xeb51('0x4f')]){_0x243baa[_0xeb51('0x50')]=_[_0xeb51('0x51')](_0x243baa[_0xeb51('0x50')],{'$or':_[_0xeb51('0x3e')](_0x243baa[_0xeb51('0x47')],function(_0x4159c9){var _0x29d692={};_0x29d692[_0x4159c9]={'$like':'%'+_0x586d85['query'][_0xeb51('0x4f')]+'%'};return _0x29d692;})});}_0x243baa=_['merge']({},_0x243baa,_0x586d85[_0xeb51('0x53')]);return _0x50ff98[_0xeb51('0xb7')](_0x243baa);}})[_0xeb51('0x21')](function(_0x37c7f8){if(_0x37c7f8){_0x1e37be=_0x37c7f8['length'];if(!_0x586d85[_0xeb51('0x43')][_0xeb51('0x4b')](_0xeb51('0x6e'))){_0x243baa[_0xeb51('0x31')]=qs['limit'](_0x586d85['query'][_0xeb51('0x31')]);_0x243baa[_0xeb51('0x2e')]=qs[_0xeb51('0x2e')](_0x586d85['query'][_0xeb51('0x2e')]);}return _0x50ff98[_0xeb51('0xb7')](_0x243baa);}})[_0xeb51('0x21')](function(_0x5b93db){if(_0x5b93db){return _0x5b93db?{'count':_0x1e37be,'rows':_0x5b93db}:null;}})[_0xeb51('0x21')](respondWithResult(_0x39cbcb,null))[_0xeb51('0x2a')](handleError(_0x39cbcb,null));};exports[_0xeb51('0x3b')]=function(_0x1a36ae,_0x1757c8,_0x456685){var _0x3deeaf,_0x4f7776,_0x422b0e;if(_['isNil'](_0x1a36ae[_0xeb51('0x5d')][_0xeb51('0x5d')])||_0x1a36ae[_0xeb51('0x5d')][_0xeb51('0x5d')]===''){throw new db[(_0xeb51('0x71'))][(_0xeb51('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xeb51('0x76')](_0x1a36ae[_0xeb51('0x5d')]['to'])){}_0x3deeaf=_0x1a36ae['body']['to'];return db[_0xeb51('0x3f')][_0xeb51('0x69')]({'where':{'id':_0x1a36ae[_0xeb51('0x58')]['id']}})[_0xeb51('0x21')](handleEntityNotFound(_0x1757c8,null))[_0xeb51('0x21')](function(_0x2e67bc){if(_0x2e67bc){return db[_0xeb51('0x3f')][_0xeb51('0x5b')]({'where':{'id':_0x2e67bc['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xeb51('0x87')],'as':_0xeb51('0x7e'),'where':{[_0x2e67bc[_0xeb51('0x7a')]]:_0x3deeaf},'limit':0x1,'order':[[_0xeb51('0xb8'),_0xeb51('0x7f')]]}]}]})[_0xeb51('0x21')](handleEntityNotFound(_0x1757c8,null))[_0xeb51('0x21')](function(_0x14f1ac){if(_0x14f1ac&&_0x14f1ac[_0xeb51('0x7d')]){_0x4f7776=_0x14f1ac['get']({'plain':!![]});if(_0x4f7776[_0xeb51('0x7d')]&&_0x4f7776[_0xeb51('0x7d')]['Contacts'][_0xeb51('0x4a')]){return _0x4f7776['List'][_0xeb51('0x7e')][0x0];}return db[_0xeb51('0x87')][_0xeb51('0x5c')](_[_0xeb51('0x19')](_0x1a36ae[_0xeb51('0x5d')],{'firstName':_0x3deeaf,[_0x14f1ac[_0xeb51('0x7a')]]:_0x3deeaf,'phone':_0x3deeaf,'ListId':_0x4f7776['ListId']}));}})[_0xeb51('0x21')](handleEntityNotFound(_0x1757c8,null))[_0xeb51('0x21')](function(_0x37ef0f){if(_0x37ef0f){_0x422b0e=_0x37ef0f;return db[_0xeb51('0x8c')][_0xeb51('0x5b')]({'where':{'ContactId':_0x422b0e['id'],'closed':![],'OpenchannelAccountId':_0x4f7776['id']}})[_0xeb51('0x21')](function(_0x1306a8){if(_0x1306a8){return[_0x1306a8,![]];}return db[_0xeb51('0x8c')][_0xeb51('0x5c')]({'UserId':_0x1a36ae[_0xeb51('0x5e')]['id'],'ContactId':_0x422b0e['id'],'OpenchannelAccountId':_0x4f7776['id'],'lastMsgDirection':_0xeb51('0xb9'),'firstMsgDirection':_0xeb51('0xb9'),'Messages':[_['merge'](_0x1a36ae[_0xeb51('0x5d')],{'read':![],'body':_0x1a36ae[_0xeb51('0x5d')][_0xeb51('0x5d')],'OpenchannelAccountId':_0x4f7776['id'],'UserId':_0x1a36ae['user']['id'],'ContactId':_0x422b0e['id']})]},{'include':[{'model':db[_0xeb51('0xba')],'as':'Messages'}]})[_0xeb51('0x21')](function(_0x147ef9){return[_0x147ef9,!![]];});});}})['spread'](function(_0x591103,_0x14b1a3){if(_0x14b1a3){return _0x591103;}return db[_0xeb51('0xba')][_0xeb51('0x5c')](_['merge'](_0x1a36ae['body'],{'read':![],'body':_0x1a36ae[_0xeb51('0x5d')][_0xeb51('0x5d')],'OpenchannelAccountId':_0x4f7776['id'],'OpenchannelInteractionId':_0x591103['id'],'UserId':_0x1a36ae[_0xeb51('0x5e')]['id'],'ContactId':_0x422b0e['id']}))['then'](function(_0xbb3dd2){_0x591103[_0xeb51('0xbb')][_0xeb51('0xbc')]=[];_0x591103['dataValues']['Messages'][_0xeb51('0x94')](_0xbb3dd2[_0xeb51('0xbb')]);return _0x591103;});});}})[_0xeb51('0x21')](respondWithResult(_0x1757c8,null))[_0xeb51('0x2a')](handleError(_0x1757c8,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c9b5fa4..c3a0567 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 _0xee5b=['remove','emit','hasOwnProperty','hook','events','OpenchannelAccount','setMaxListeners','update'];(function(_0x6adac5,_0x49bf44){var _0x112c7=function(_0x4021d9){while(--_0x4021d9){_0x6adac5['push'](_0x6adac5['shift']());}};_0x112c7(++_0x49bf44);}(_0xee5b,0x1f4));var _0xbee5=function(_0x779626,_0x4f2fc2){_0x779626=_0x779626-0x0;var _0x5d5d71=_0xee5b[_0x779626];return _0x5d5d71;};'use strict';var EventEmitter=require(_0xbee5('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbee5('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbee5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbee5('0x3'),'afterDestroy':_0xbee5('0x4')};function emitEvent(_0x2eb857){return function(_0x210159,_0x4bd202,_0x5200b1){OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857+':'+_0x210159['id'],_0x210159);OpenchannelAccountEvents[_0xbee5('0x5')](_0x2eb857,_0x210159);_0x5200b1(null);};}for(var e in events){if(events[_0xbee5('0x6')](e)){var event=events[e];OpenchannelAccount[_0xbee5('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x0bb5=['events','../../mysqldb','save','update','remove','emit','hook','exports'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0x0bb5,0x148));var _0x50bb=function(_0x5ec9d4,_0x274ca4){_0x5ec9d4=_0x5ec9d4-0x0;var _0x16562f=_0x0bb5[_0x5ec9d4];return _0x16562f;};'use strict';var EventEmitter=require(_0x50bb('0x0'));var OpenchannelAccount=require(_0x50bb('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50bb('0x2'),'afterUpdate':_0x50bb('0x3'),'afterDestroy':_0x50bb('0x4')};function emitEvent(_0x117e36){return function(_0x29c72b,_0xfdc9d4,_0x451b4c){OpenchannelAccountEvents[_0x50bb('0x5')](_0x117e36+':'+_0x29c72b['id'],_0x29c72b);OpenchannelAccountEvents['emit'](_0x117e36,_0x29c72b);_0x451b4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x50bb('0x6')](e,emitEvent(event));}}module[_0x50bb('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 5043028..fedf64b 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(_0x144abc,_0x497a41){var _0x398a80=function(_0x56c0b5){while(--_0x56c0b5){_0x144abc['push'](_0x144abc['shift']());}};_0x398a80(++_0x497a41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x4ca973,_0x3c4fba){var _0x1b8e0a=function(_0x36c463){while(--_0x36c463){_0x4ca973['push'](_0x4ca973['shift']());}};_0x1b8e0a(++_0x3c4fba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 44d0f8b..079bdfc 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 _0x34b7=['redis','defaults','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0xd4f90b,_0x148333){var _0x451848=function(_0x12c95c){while(--_0x12c95c){_0xd4f90b['push'](_0xd4f90b['shift']());}};_0x451848(++_0x148333);}(_0x34b7,0x196));var _0x734b=function(_0x583bf0,_0x4b59aa){_0x583bf0=_0x583bf0-0x0;var _0x210ec6=_0x34b7[_0x583bf0];return _0x210ec6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});config[_0x734b('0xa')]=_[_0x734b('0xb')](config['redis'],{'host':_0x734b('0xc'),'port':0x18eb});var socket=require(_0x734b('0xd'))(new Redis(config['redis']));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x19a88e,_0x598dee,_0x43c5e0){return new BPromise(function(_0x333738,_0x2860a2){return client[_0x734b('0xe')](_0x19a88e,_0x43c5e0)[_0x734b('0xf')](function(_0x16e451){logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));logger[_0x734b('0x13')](_0x734b('0x14'),_0x598dee,_0x734b('0x12'),JSON[_0x734b('0x15')](_0x16e451));if(_0x16e451[_0x734b('0x16')]){if(_0x16e451['error'][_0x734b('0x17')]===0x1f4){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x2860a2(_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);}logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x333738(_0x16e451['error'][_0x734b('0x18')]);}else{logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));_0x333738(_0x16e451['result']['message']);}})[_0x734b('0x19')](function(_0x3033cd){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x3033cd);_0x2860a2(_0x3033cd);});});} \ No newline at end of file +var _0x9354=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9354,0x96));var _0x4935=function(_0x17249c,_0x168d62){_0x17249c=_0x17249c-0x0;var _0x324e7b=_0x9354[_0x17249c];return _0x324e7b;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});config[_0x4935('0xb')]=_[_0x4935('0xc')](config[_0x4935('0xb')],{'host':_0x4935('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4935('0xb')]));require('./openchannelAccount.socket')[_0x4935('0xe')](socket);function respondWithRpcPromise(_0x38de96,_0xd5b117,_0x22a83f){return new BPromise(function(_0x261462,_0x319b72){return client['request'](_0x38de96,_0x22a83f)['then'](function(_0x2ebd4c){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0xd5b117,_0x4935('0xf'));logger[_0x4935('0x10')](_0x4935('0x11'),_0xd5b117,_0x4935('0xf'),JSON[_0x4935('0x12')](_0x2ebd4c));if(_0x2ebd4c[_0x4935('0x13')]){if(_0x2ebd4c[_0x4935('0x13')][_0x4935('0x14')]===0x1f4){logger[_0x4935('0x13')](_0x4935('0x15'),_0xd5b117,_0x2ebd4c[_0x4935('0x13')][_0x4935('0x16')]);return _0x319b72(_0x2ebd4c[_0x4935('0x13')][_0x4935('0x16')]);}logger[_0x4935('0x13')](_0x4935('0x15'),_0xd5b117,_0x2ebd4c['error'][_0x4935('0x16')]);return _0x261462(_0x2ebd4c[_0x4935('0x13')][_0x4935('0x16')]);}else{logger[_0x4935('0x17')](_0x4935('0x15'),_0xd5b117,_0x4935('0xf'));_0x261462(_0x2ebd4c['result'][_0x4935('0x16')]);}})[_0x4935('0x18')](function(_0x4fe356){logger[_0x4935('0x13')](_0x4935('0x15'),_0xd5b117,_0x4fe356);_0x319b72(_0x4fe356);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index b710de1..b4a3f8a 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 _0x2242=['register','length','openchannelAccount:','./openchannelAccount.events','save','remove','emit','removeListener'];(function(_0xbc4659,_0x578fba){var _0x5831f9=function(_0x5eb0eb){while(--_0x5eb0eb){_0xbc4659['push'](_0xbc4659['shift']());}};_0x5831f9(++_0x578fba);}(_0x2242,0x1a3));var _0x2224=function(_0x2610db,_0x2d13f2){_0x2610db=_0x2610db-0x0;var _0x118629=_0x2242[_0x2610db];return _0x118629;};'use strict';var OpenchannelAccountEvents=require(_0x2224('0x0'));var events=[_0x2224('0x1'),_0x2224('0x2'),'update'];function createListener(_0x3180c8,_0x317565){return function(_0x4acc10){_0x317565[_0x2224('0x3')](_0x3180c8,_0x4acc10);};}function removeListener(_0xb65b2f,_0x4b2099){return function(){OpenchannelAccountEvents[_0x2224('0x4')](_0xb65b2f,_0x4b2099);};}exports[_0x2224('0x5')]=function(_0x23a873){for(var _0x54d057=0x0,_0x28833b=events[_0x2224('0x6')];_0x54d057<_0x28833b;_0x54d057++){var _0x35f807=events[_0x54d057];var _0x25c6d4=createListener(_0x2224('0x7')+_0x35f807,_0x23a873);OpenchannelAccountEvents['on'](_0x35f807,_0x25c6d4);}}; \ No newline at end of file +var _0x2083=['save','update','emit','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x23e5f7,_0x531677){var _0x5411d1=function(_0xe5625b){while(--_0xe5625b){_0x23e5f7['push'](_0x23e5f7['shift']());}};_0x5411d1(++_0x531677);}(_0x2083,0x137));var _0x3208=function(_0x388d4c,_0x278500){_0x388d4c=_0x388d4c-0x0;var _0x3e2f5d=_0x2083[_0x388d4c];return _0x3e2f5d;};'use strict';var OpenchannelAccountEvents=require(_0x3208('0x0'));var events=[_0x3208('0x1'),'remove',_0x3208('0x2')];function createListener(_0x3c185a,_0x8e8849){return function(_0x9f4a1){_0x8e8849[_0x3208('0x3')](_0x3c185a,_0x9f4a1);};}function removeListener(_0x3ba273,_0x1535fb){return function(){OpenchannelAccountEvents['removeListener'](_0x3ba273,_0x1535fb);};}exports['register']=function(_0x5c8d7f){for(var _0x152b81=0x0,_0x3d837d=events[_0x3208('0x4')];_0x152b81<_0x3d837d;_0x152b81++){var _0x17972f=events[_0x152b81];var _0x564ff6=createListener(_0x3208('0x5')+_0x17972f,_0x5c8d7f);OpenchannelAccountEvents['on'](_0x17972f,_0x564ff6);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index f2b3a5b..2686719 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 _0x634b=['../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x4b43cf,_0x314e49){var _0x4f8add=function(_0x3f2ff1){while(--_0x3f2ff1){_0x4b43cf['push'](_0x4b43cf['shift']());}};_0x4f8add(++_0x314e49);}(_0x634b,0x11c));var _0xb634=function(_0x48a5e5,_0x2a7c15){_0x48a5e5=_0x48a5e5-0x0;var _0x2da266=_0x634b[_0x48a5e5];return _0x2da266;};'use strict';var multer=require(_0xb634('0x0'));var util=require('util');var path=require(_0xb634('0x1'));var timeout=require(_0xb634('0x2'));var express=require('express');var router=express[_0xb634('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb634('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb634('0x5'));var controller=require(_0xb634('0x6'));router[_0xb634('0x7')]('/',auth[_0xb634('0x8')](),controller[_0xb634('0x9')]);router[_0xb634('0x7')](_0xb634('0xa'),auth[_0xb634('0x8')](),controller[_0xb634('0xb')]);router[_0xb634('0xc')]('/',auth[_0xb634('0x8')](),controller['create']);router[_0xb634('0xd')](_0xb634('0xa'),auth[_0xb634('0x8')](),controller[_0xb634('0xe')]);router[_0xb634('0xf')]('/:id',auth[_0xb634('0x8')](),controller[_0xb634('0x10')]);module[_0xb634('0x11')]=router; \ No newline at end of file +var _0x4cce=['../../components/auth/service','isAuthenticated','index','get','show','create','put','/:id','update','delete','destroy','util','path','connect-timeout','fs-extra'];(function(_0x2b0f7d,_0x1a71e3){var _0x3af0b9=function(_0x286111){while(--_0x286111){_0x2b0f7d['push'](_0x2b0f7d['shift']());}};_0x3af0b9(++_0x1a71e3);}(_0x4cce,0x128));var _0xe4cc=function(_0x1d73fe,_0x4ba414){_0x1d73fe=_0x1d73fe-0x0;var _0x40998b=_0x4cce[_0x1d73fe];return _0x40998b;};'use strict';var multer=require('multer');var util=require(_0xe4cc('0x0'));var path=require(_0xe4cc('0x1'));var timeout=require(_0xe4cc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe4cc('0x3'));var auth=require(_0xe4cc('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0xe4cc('0x5')](),controller[_0xe4cc('0x6')]);router[_0xe4cc('0x7')]('/:id',auth[_0xe4cc('0x5')](),controller[_0xe4cc('0x8')]);router['post']('/',auth[_0xe4cc('0x5')](),controller[_0xe4cc('0x9')]);router[_0xe4cc('0xa')](_0xe4cc('0xb'),auth[_0xe4cc('0x5')](),controller[_0xe4cc('0xc')]);router[_0xe4cc('0xd')](_0xe4cc('0xb'),auth[_0xe4cc('0x5')](),controller[_0xe4cc('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 5f6af0b..f5bd540 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 _0x68de=['sequelize','exports','STRING','*,*,*,*'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x68de,0x1c0));var _0xe68d=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x68de[_0x374ccf];return _0x443cde;};'use strict';var Sequelize=require(_0xe68d('0x0'));module[_0xe68d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe68d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe68d('0x2')]},'interval':{'type':Sequelize[_0xe68d('0x2')],'defaultValue':_0xe68d('0x3')}}; \ No newline at end of file +var _0x7666=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x39a31c,_0x350438){var _0x4c27a6=function(_0x30c9dc){while(--_0x30c9dc){_0x39a31c['push'](_0x39a31c['shift']());}};_0x4c27a6(++_0x350438);}(_0x7666,0x1c6));var _0x6766=function(_0x1842df,_0x223e04){_0x1842df=_0x1842df-0x0;var _0x1d4584=_0x7666[_0x1842df];return _0x1d4584;};'use strict';var Sequelize=require(_0x6766('0x0'));module[_0x6766('0x1')]={'priority':{'type':Sequelize[_0x6766('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6766('0x3')],'allowNull':![],'defaultValue':_0x6766('0x4')},'appdata':{'type':Sequelize[_0x6766('0x5')]()},'description':{'type':Sequelize[_0x6766('0x3')]},'interval':{'type':Sequelize[_0x6766('0x3')],'defaultValue':_0x6766('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index ae30a39..55f8bd2 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 _0x8c02=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','OpenchannelApplication','findAll','rows','show','params','includeAll','include','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring'];(function(_0x4623ef,_0x41adee){var _0x493a39=function(_0x41bc60){while(--_0x41bc60){_0x4623ef['push'](_0x4623ef['shift']());}};_0x493a39(++_0x41adee);}(_0x8c02,0x155));var _0x28c0=function(_0x524447,_0x37b7c8){_0x524447=_0x524447-0x0;var _0x4cb266=_0x8c02[_0x524447];return _0x4cb266;};'use strict';var emlformat=require(_0x28c0('0x0'));var rimraf=require(_0x28c0('0x1'));var zipdir=require(_0x28c0('0x2'));var jsonpatch=require(_0x28c0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x28c0('0x4'));var util=require(_0x28c0('0x5'));var path=require(_0x28c0('0x6'));var sox=require(_0x28c0('0x7'));var csv=require(_0x28c0('0x8'));var ejs=require(_0x28c0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x28c0('0xa'));var crypto=require(_0x28c0('0xb'));var jsforce=require(_0x28c0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x28c0('0x8'));var querystring=require(_0x28c0('0xd'));var Papa=require(_0x28c0('0xe'));var Redis=require('ioredis');var authService=require(_0x28c0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x28c0('0x10'));var hardwareService=require(_0x28c0('0x11'));var logger=require(_0x28c0('0x12'))(_0x28c0('0x13'));var utils=require(_0x28c0('0x14'));var config=require(_0x28c0('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118e33,_0x49ffdf){_0x49ffdf=_0x49ffdf||0xcc;return function(_0x4b291c){if(_0x4b291c){return _0x118e33['sendStatus'](_0x49ffdf);}return _0x118e33[_0x28c0('0x16')](_0x49ffdf)['end']();};}function respondWithResult(_0x5a8afc,_0x1e3017){_0x1e3017=_0x1e3017||0xc8;return function(_0x18fd9a){if(_0x18fd9a){return _0x5a8afc['status'](_0x1e3017)[_0x28c0('0x17')](_0x18fd9a);}};}function respondWithFilteredResult(_0x2ad616,_0x4e17f8){return function(_0x5730b6){if(_0x5730b6){var _0x43fef7=typeof _0x4e17f8['offset']===_0x28c0('0x18')&&typeof _0x4e17f8['limit']===_0x28c0('0x18');var _0x2f99da=_0x5730b6[_0x28c0('0x19')];var _0x52d9db=_0x43fef7?0x0:_0x4e17f8['offset'];var _0x46bd28=_0x43fef7?_0x5730b6['count']:_0x4e17f8['offset']+_0x4e17f8[_0x28c0('0x1a')];var _0x1fb951;if(_0x46bd28>=_0x2f99da){_0x46bd28=_0x2f99da;_0x1fb951=0xc8;}else{_0x1fb951=0xce;}_0x2ad616[_0x28c0('0x16')](_0x1fb951);return _0x2ad616[_0x28c0('0x1b')]('Content-Range',_0x52d9db+'-'+_0x46bd28+'/'+_0x2f99da)[_0x28c0('0x17')](_0x5730b6);}return null;};}function patchUpdates(_0xfa874){return function(_0x29e645){try{jsonpatch[_0x28c0('0x1c')](_0x29e645,_0xfa874,!![]);}catch(_0xdae2){return BPromise[_0x28c0('0x1d')](_0xdae2);}return _0x29e645['save']();};}function saveUpdates(_0x2919b7,_0x5e8c1a){return function(_0x37ffdc){if(_0x37ffdc){return _0x37ffdc[_0x28c0('0x1e')](_0x2919b7)[_0x28c0('0x1f')](function(_0x100656){return _0x100656;});}return null;};}function removeEntity(_0x2065bc,_0x40ceeb){return function(_0x4a9aa7){if(_0x4a9aa7){return _0x4a9aa7[_0x28c0('0x20')]()[_0x28c0('0x1f')](function(){_0x2065bc[_0x28c0('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x450125,_0x479e68){return function(_0xf0040c){if(!_0xf0040c){_0x450125[_0x28c0('0x21')](0x194);}return _0xf0040c;};}function handleError(_0x1ab935,_0x423b57){_0x423b57=_0x423b57||0x1f4;return function(_0x2f2421){logger['error'](_0x2f2421['stack']);if(_0x2f2421[_0x28c0('0x22')]){delete _0x2f2421[_0x28c0('0x22')];}_0x1ab935['status'](_0x423b57)[_0x28c0('0x23')](_0x2f2421);};}exports[_0x28c0('0x24')]=function(_0x24608e,_0x51574d){var _0x1904f9={},_0x2ae8c9={},_0x4db3a8={'count':0x0,'rows':[]};var _0xdf2028=_['map'](db['OpenchannelApplication'][_0x28c0('0x25')],function(_0x2c1815){return{'name':_0x2c1815[_0x28c0('0x26')],'type':_0x2c1815[_0x28c0('0x27')][_0x28c0('0x28')]};});_0x2ae8c9['model']=_[_0x28c0('0x29')](_0xdf2028,_0x28c0('0x22'));_0x2ae8c9[_0x28c0('0x2a')]=_[_0x28c0('0x2b')](_0x24608e['query']);_0x2ae8c9[_0x28c0('0x2c')]=_[_0x28c0('0x2d')](_0x2ae8c9[_0x28c0('0x2e')],_0x2ae8c9[_0x28c0('0x2a')]);_0x1904f9['attributes']=_[_0x28c0('0x2d')](_0x2ae8c9[_0x28c0('0x2e')],qs[_0x28c0('0x2f')](_0x24608e[_0x28c0('0x2a')][_0x28c0('0x2f')]));_0x1904f9['attributes']=_0x1904f9[_0x28c0('0x30')][_0x28c0('0x31')]?_0x1904f9[_0x28c0('0x30')]:_0x2ae8c9[_0x28c0('0x2e')];if(!_0x24608e['query'][_0x28c0('0x32')](_0x28c0('0x33'))){_0x1904f9[_0x28c0('0x1a')]=qs[_0x28c0('0x1a')](_0x24608e[_0x28c0('0x2a')][_0x28c0('0x1a')]);_0x1904f9[_0x28c0('0x34')]=qs[_0x28c0('0x34')](_0x24608e['query']['offset']);}_0x1904f9[_0x28c0('0x35')]=qs[_0x28c0('0x36')](_0x24608e[_0x28c0('0x2a')]['sort']);_0x1904f9[_0x28c0('0x37')]=qs[_0x28c0('0x2c')](_[_0x28c0('0x38')](_0x24608e['query'],_0x2ae8c9[_0x28c0('0x2c')]),_0xdf2028);if(_0x24608e['query'][_0x28c0('0x39')]){_0x1904f9[_0x28c0('0x37')]=_['merge'](_0x1904f9[_0x28c0('0x37')],{'$or':_[_0x28c0('0x29')](_0xdf2028,function(_0x11dd12){if(_0x11dd12[_0x28c0('0x27')]!=='VIRTUAL'){var _0x5a3313={};_0x5a3313[_0x11dd12['name']]={'$like':'%'+_0x24608e[_0x28c0('0x2a')][_0x28c0('0x39')]+'%'};return _0x5a3313;}})});}_0x1904f9=_[_0x28c0('0x3a')]({},_0x1904f9,_0x24608e[_0x28c0('0x3b')]);var _0x299909={'where':_0x1904f9['where']};return db[_0x28c0('0x3c')][_0x28c0('0x19')](_0x299909)[_0x28c0('0x1f')](function(_0x27dc68){_0x4db3a8[_0x28c0('0x19')]=_0x27dc68;if(_0x24608e[_0x28c0('0x2a')]['includeAll']){_0x1904f9['include']=[{'all':!![]}];}return db[_0x28c0('0x3c')][_0x28c0('0x3d')](_0x1904f9);})[_0x28c0('0x1f')](function(_0x5c1c98){_0x4db3a8[_0x28c0('0x3e')]=_0x5c1c98;return _0x4db3a8;})['then'](respondWithFilteredResult(_0x51574d,_0x1904f9))['catch'](handleError(_0x51574d,null));};exports[_0x28c0('0x3f')]=function(_0x512d73,_0x5e2deb){var _0x4a5ed0={'raw':!![],'where':{'id':_0x512d73[_0x28c0('0x40')]['id']}},_0x48d437={};_0x48d437[_0x28c0('0x2e')]=_[_0x28c0('0x2b')](db[_0x28c0('0x3c')][_0x28c0('0x25')]);_0x48d437[_0x28c0('0x2a')]=_[_0x28c0('0x2b')](_0x512d73[_0x28c0('0x2a')]);_0x48d437[_0x28c0('0x2c')]=_['intersection'](_0x48d437[_0x28c0('0x2e')],_0x48d437[_0x28c0('0x2a')]);_0x4a5ed0[_0x28c0('0x30')]=_[_0x28c0('0x2d')](_0x48d437[_0x28c0('0x2e')],qs[_0x28c0('0x2f')](_0x512d73['query']['fields']));_0x4a5ed0[_0x28c0('0x30')]=_0x4a5ed0[_0x28c0('0x30')][_0x28c0('0x31')]?_0x4a5ed0[_0x28c0('0x30')]:_0x48d437['model'];if(_0x512d73[_0x28c0('0x2a')][_0x28c0('0x41')]){_0x4a5ed0[_0x28c0('0x42')]=[{'all':!![]}];}_0x4a5ed0=_['merge']({},_0x4a5ed0,_0x512d73['options']);return db['OpenchannelApplication']['find'](_0x4a5ed0)[_0x28c0('0x1f')](handleEntityNotFound(_0x5e2deb,null))['then'](respondWithResult(_0x5e2deb,null))[_0x28c0('0x43')](handleError(_0x5e2deb,null));};exports[_0x28c0('0x44')]=function(_0x1c8f47,_0x42ff96){return db[_0x28c0('0x3c')][_0x28c0('0x44')](_0x1c8f47[_0x28c0('0x45')],{})[_0x28c0('0x1f')](respondWithResult(_0x42ff96,0xc9))[_0x28c0('0x43')](handleError(_0x42ff96,null));};exports['update']=function(_0x2a34d6,_0x2419ed){if(_0x2a34d6[_0x28c0('0x45')]['id']){delete _0x2a34d6[_0x28c0('0x45')]['id'];}return db[_0x28c0('0x3c')][_0x28c0('0x46')]({'where':{'id':_0x2a34d6[_0x28c0('0x40')]['id']}})[_0x28c0('0x1f')](handleEntityNotFound(_0x2419ed,null))[_0x28c0('0x1f')](saveUpdates(_0x2a34d6[_0x28c0('0x45')],null))[_0x28c0('0x1f')](respondWithResult(_0x2419ed,null))[_0x28c0('0x43')](handleError(_0x2419ed,null));};exports[_0x28c0('0x20')]=function(_0x4b1668,_0x386762){return db['OpenchannelApplication'][_0x28c0('0x46')]({'where':{'id':_0x4b1668[_0x28c0('0x40')]['id']}})[_0x28c0('0x1f')](handleEntityNotFound(_0x386762,null))[_0x28c0('0x1f')](removeEntity(_0x386762,null))['catch'](handleError(_0x386762,null));}; \ No newline at end of file +var _0x1eae=['name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','show','params','length','includeAll','include','find','create','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eae,0xb8));var _0xe1ea=function(_0x4fbed7,_0x2a33b7){_0x4fbed7=_0x4fbed7-0x0;var _0x1ecc07=_0x1eae[_0x4fbed7];return _0x1ecc07;};'use strict';var emlformat=require(_0xe1ea('0x0'));var rimraf=require(_0xe1ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1ea('0x2'));var rp=require(_0xe1ea('0x3'));var moment=require(_0xe1ea('0x4'));var BPromise=require(_0xe1ea('0x5'));var Mustache=require(_0xe1ea('0x6'));var util=require(_0xe1ea('0x7'));var path=require('path');var sox=require(_0xe1ea('0x8'));var csv=require(_0xe1ea('0x9'));var ejs=require(_0xe1ea('0xa'));var fs=require('fs');var fs_extra=require(_0xe1ea('0xb'));var _=require(_0xe1ea('0xc'));var squel=require(_0xe1ea('0xd'));var crypto=require('crypto');var jsforce=require(_0xe1ea('0xe'));var deskjs=require(_0xe1ea('0xf'));var toCsv=require(_0xe1ea('0x9'));var querystring=require(_0xe1ea('0x10'));var Papa=require('papaparse');var Redis=require(_0xe1ea('0x11'));var authService=require(_0xe1ea('0x12'));var qs=require(_0xe1ea('0x13'));var as=require(_0xe1ea('0x14'));var hardwareService=require(_0xe1ea('0x15'));var logger=require(_0xe1ea('0x16'))('api');var utils=require(_0xe1ea('0x17'));var config=require(_0xe1ea('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262b86,_0x4d6f13){_0x4d6f13=_0x4d6f13||0xcc;return function(_0x581797){if(_0x581797){return _0x262b86['sendStatus'](_0x4d6f13);}return _0x262b86[_0xe1ea('0x19')](_0x4d6f13)[_0xe1ea('0x1a')]();};}function respondWithResult(_0x1acd06,_0x1f2e55){_0x1f2e55=_0x1f2e55||0xc8;return function(_0xee2401){if(_0xee2401){return _0x1acd06[_0xe1ea('0x19')](_0x1f2e55)['json'](_0xee2401);}};}function respondWithFilteredResult(_0x29070f,_0x4d77a5){return function(_0x5b859b){if(_0x5b859b){var _0x5bbafb=typeof _0x4d77a5[_0xe1ea('0x1b')]==='undefined'&&typeof _0x4d77a5['limit']==='undefined';var _0x1b3190=_0x5b859b[_0xe1ea('0x1c')];var _0x306d0c=_0x5bbafb?0x0:_0x4d77a5[_0xe1ea('0x1b')];var _0x16d6e1=_0x5bbafb?_0x5b859b['count']:_0x4d77a5[_0xe1ea('0x1b')]+_0x4d77a5[_0xe1ea('0x1d')];var _0xab2527;if(_0x16d6e1>=_0x1b3190){_0x16d6e1=_0x1b3190;_0xab2527=0xc8;}else{_0xab2527=0xce;}_0x29070f[_0xe1ea('0x19')](_0xab2527);return _0x29070f['set'](_0xe1ea('0x1e'),_0x306d0c+'-'+_0x16d6e1+'/'+_0x1b3190)[_0xe1ea('0x1f')](_0x5b859b);}return null;};}function patchUpdates(_0xaab892){return function(_0x47d6e4){try{jsonpatch[_0xe1ea('0x20')](_0x47d6e4,_0xaab892,!![]);}catch(_0x483d30){return BPromise[_0xe1ea('0x21')](_0x483d30);}return _0x47d6e4[_0xe1ea('0x22')]();};}function saveUpdates(_0x5b62c3,_0x2304c1){return function(_0x339a61){if(_0x339a61){return _0x339a61[_0xe1ea('0x23')](_0x5b62c3)[_0xe1ea('0x24')](function(_0x983151){return _0x983151;});}return null;};}function removeEntity(_0x4742ba,_0x20d31f){return function(_0xbd159b){if(_0xbd159b){return _0xbd159b[_0xe1ea('0x25')]()[_0xe1ea('0x24')](function(){_0x4742ba[_0xe1ea('0x19')](0xcc)[_0xe1ea('0x1a')]();});}};}function handleEntityNotFound(_0x323adc,_0xc0af3d){return function(_0x1acde9){if(!_0x1acde9){_0x323adc[_0xe1ea('0x26')](0x194);}return _0x1acde9;};}function handleError(_0x389345,_0x4e044c){_0x4e044c=_0x4e044c||0x1f4;return function(_0x25cd58){logger[_0xe1ea('0x27')](_0x25cd58[_0xe1ea('0x28')]);if(_0x25cd58[_0xe1ea('0x29')]){delete _0x25cd58[_0xe1ea('0x29')];}_0x389345[_0xe1ea('0x19')](_0x4e044c)[_0xe1ea('0x2a')](_0x25cd58);};}exports[_0xe1ea('0x2b')]=function(_0x1874cb,_0x383a0c){var _0x4031b8={},_0x49cdcd={},_0x39d042={'count':0x0,'rows':[]};var _0x19d626=_[_0xe1ea('0x2c')](db[_0xe1ea('0x2d')][_0xe1ea('0x2e')],function(_0x46df29){return{'name':_0x46df29[_0xe1ea('0x2f')],'type':_0x46df29[_0xe1ea('0x30')][_0xe1ea('0x31')]};});_0x49cdcd[_0xe1ea('0x32')]=_[_0xe1ea('0x2c')](_0x19d626,'name');_0x49cdcd[_0xe1ea('0x33')]=_[_0xe1ea('0x34')](_0x1874cb[_0xe1ea('0x33')]);_0x49cdcd[_0xe1ea('0x35')]=_[_0xe1ea('0x36')](_0x49cdcd[_0xe1ea('0x32')],_0x49cdcd[_0xe1ea('0x33')]);_0x4031b8[_0xe1ea('0x37')]=_[_0xe1ea('0x36')](_0x49cdcd[_0xe1ea('0x32')],qs[_0xe1ea('0x38')](_0x1874cb['query']['fields']));_0x4031b8[_0xe1ea('0x37')]=_0x4031b8[_0xe1ea('0x37')]['length']?_0x4031b8[_0xe1ea('0x37')]:_0x49cdcd[_0xe1ea('0x32')];if(!_0x1874cb[_0xe1ea('0x33')]['hasOwnProperty'](_0xe1ea('0x39'))){_0x4031b8[_0xe1ea('0x1d')]=qs['limit'](_0x1874cb[_0xe1ea('0x33')][_0xe1ea('0x1d')]);_0x4031b8[_0xe1ea('0x1b')]=qs[_0xe1ea('0x1b')](_0x1874cb[_0xe1ea('0x33')]['offset']);}_0x4031b8[_0xe1ea('0x3a')]=qs[_0xe1ea('0x3b')](_0x1874cb[_0xe1ea('0x33')]['sort']);_0x4031b8[_0xe1ea('0x3c')]=qs[_0xe1ea('0x35')](_[_0xe1ea('0x3d')](_0x1874cb[_0xe1ea('0x33')],_0x49cdcd['filters']),_0x19d626);if(_0x1874cb[_0xe1ea('0x33')][_0xe1ea('0x3e')]){_0x4031b8[_0xe1ea('0x3c')]=_[_0xe1ea('0x3f')](_0x4031b8[_0xe1ea('0x3c')],{'$or':_[_0xe1ea('0x2c')](_0x19d626,function(_0x27adf2){if(_0x27adf2[_0xe1ea('0x30')]!=='VIRTUAL'){var _0x4067ad={};_0x4067ad[_0x27adf2['name']]={'$like':'%'+_0x1874cb[_0xe1ea('0x33')]['filter']+'%'};return _0x4067ad;}})});}_0x4031b8=_[_0xe1ea('0x3f')]({},_0x4031b8,_0x1874cb[_0xe1ea('0x40')]);var _0x2120cf={'where':_0x4031b8[_0xe1ea('0x3c')]};return db[_0xe1ea('0x2d')][_0xe1ea('0x1c')](_0x2120cf)[_0xe1ea('0x24')](function(_0x42ef09){_0x39d042[_0xe1ea('0x1c')]=_0x42ef09;if(_0x1874cb[_0xe1ea('0x33')]['includeAll']){_0x4031b8['include']=[{'all':!![]}];}return db[_0xe1ea('0x2d')][_0xe1ea('0x41')](_0x4031b8);})['then'](function(_0x26b1b5){_0x39d042['rows']=_0x26b1b5;return _0x39d042;})[_0xe1ea('0x24')](respondWithFilteredResult(_0x383a0c,_0x4031b8))[_0xe1ea('0x42')](handleError(_0x383a0c,null));};exports[_0xe1ea('0x43')]=function(_0x220228,_0x343f69){var _0x3f9970={'raw':!![],'where':{'id':_0x220228[_0xe1ea('0x44')]['id']}},_0x1d1551={};_0x1d1551[_0xe1ea('0x32')]=_[_0xe1ea('0x34')](db[_0xe1ea('0x2d')][_0xe1ea('0x2e')]);_0x1d1551[_0xe1ea('0x33')]=_[_0xe1ea('0x34')](_0x220228[_0xe1ea('0x33')]);_0x1d1551[_0xe1ea('0x35')]=_['intersection'](_0x1d1551[_0xe1ea('0x32')],_0x1d1551[_0xe1ea('0x33')]);_0x3f9970[_0xe1ea('0x37')]=_['intersection'](_0x1d1551[_0xe1ea('0x32')],qs['fields'](_0x220228[_0xe1ea('0x33')]['fields']));_0x3f9970[_0xe1ea('0x37')]=_0x3f9970['attributes'][_0xe1ea('0x45')]?_0x3f9970[_0xe1ea('0x37')]:_0x1d1551[_0xe1ea('0x32')];if(_0x220228[_0xe1ea('0x33')][_0xe1ea('0x46')]){_0x3f9970[_0xe1ea('0x47')]=[{'all':!![]}];}_0x3f9970=_[_0xe1ea('0x3f')]({},_0x3f9970,_0x220228['options']);return db[_0xe1ea('0x2d')][_0xe1ea('0x48')](_0x3f9970)[_0xe1ea('0x24')](handleEntityNotFound(_0x343f69,null))[_0xe1ea('0x24')](respondWithResult(_0x343f69,null))['catch'](handleError(_0x343f69,null));};exports[_0xe1ea('0x49')]=function(_0x46b2af,_0x32dcef){return db[_0xe1ea('0x2d')]['create'](_0x46b2af[_0xe1ea('0x4a')],{})[_0xe1ea('0x24')](respondWithResult(_0x32dcef,0xc9))[_0xe1ea('0x42')](handleError(_0x32dcef,null));};exports['update']=function(_0x54bddd,_0x569e34){if(_0x54bddd['body']['id']){delete _0x54bddd['body']['id'];}return db[_0xe1ea('0x2d')][_0xe1ea('0x48')]({'where':{'id':_0x54bddd[_0xe1ea('0x44')]['id']}})['then'](handleEntityNotFound(_0x569e34,null))[_0xe1ea('0x24')](saveUpdates(_0x54bddd['body'],null))[_0xe1ea('0x24')](respondWithResult(_0x569e34,null))[_0xe1ea('0x42')](handleError(_0x569e34,null));};exports[_0xe1ea('0x25')]=function(_0x2412aa,_0x2e08ab){return db[_0xe1ea('0x2d')][_0xe1ea('0x48')]({'where':{'id':_0x2412aa[_0xe1ea('0x44')]['id']}})[_0xe1ea('0x24')](handleEntityNotFound(_0x2e08ab,null))[_0xe1ea('0x24')](removeEntity(_0x2e08ab,null))['catch'](handleError(_0x2e08ab,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index b93ad72..09f4940 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 _0xb5d9=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','path','rimraf','../../config/environment','exports'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0xb5d9,0x101));var _0x9b5d=function(_0x348077,_0xe82a34){_0x348077=_0x348077-0x0;var _0x5de059=_0xb5d9[_0x348077];return _0x5de059;};'use strict';var _=require(_0x9b5d('0x0'));var util=require(_0x9b5d('0x1'));var logger=require(_0x9b5d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b5d('0x3'));var rimraf=require(_0x9b5d('0x4'));var config=require(_0x9b5d('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x9b5d('0x6')]=function(_0x25a10a,_0x44c1a3){return _0x25a10a[_0x9b5d('0x7')](_0x9b5d('0x8'),attributes,{'tableName':_0x9b5d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9b5d('0xa'),'collate':_0x9b5d('0xb')});}; \ No newline at end of file +var _0x360a=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4532c7,_0x108452){var _0x5c6cad=function(_0x39621a){while(--_0x39621a){_0x4532c7['push'](_0x4532c7['shift']());}};_0x5c6cad(++_0x108452);}(_0x360a,0x13f));var _0xa360=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x360a[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0xa360('0x0'));var logger=require(_0xa360('0x1'))(_0xa360('0x2'));var moment=require(_0xa360('0x3'));var BPromise=require(_0xa360('0x4'));var rp=require(_0xa360('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa360('0x6'));var config=require(_0xa360('0x7'));var attributes=require(_0xa360('0x8'));module[_0xa360('0x9')]=function(_0x2f1fc6,_0x527e31){return _0x2f1fc6[_0xa360('0xa')]('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa360('0xb'),'collate':_0xa360('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2d808b2..7633fe0 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 _0x97b5=['message','result','OpenchannelApplication','body','options','where','attributes','UpdateOpenchannelApplication','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x97b5,0x135));var _0x597b=function(_0x2abf68,_0x4ec499){_0x2abf68=_0x2abf68-0x0;var _0x2adec3=_0x97b5[_0x2abf68];return _0x2adec3;};'use strict';var _=require(_0x597b('0x0'));var util=require(_0x597b('0x1'));var moment=require(_0x597b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597b('0x3'));var db=require(_0x597b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x597b('0x5'))(_0x597b('0x6'));var config=require(_0x597b('0x7'));var jayson=require(_0x597b('0x8'));var client=jayson[_0x597b('0x9')][_0x597b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x966fd1,_0x25cfa7,_0xf4b6d5){return new BPromise(function(_0x237c51,_0x194691){return client[_0x597b('0xb')](_0x966fd1,_0xf4b6d5)[_0x597b('0xc')](function(_0x4f1156){logger[_0x597b('0xd')](_0x597b('0xe'),_0x25cfa7,_0x597b('0xf'));logger[_0x597b('0x10')](_0x597b('0x11'),_0x25cfa7,_0x597b('0xf'),JSON[_0x597b('0x12')](_0x4f1156));if(_0x4f1156[_0x597b('0x13')]){if(_0x4f1156[_0x597b('0x13')][_0x597b('0x14')]===0x1f4){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x25cfa7,_0x4f1156[_0x597b('0x13')][_0x597b('0x15')]);return _0x194691(_0x4f1156[_0x597b('0x13')]['message']);}logger[_0x597b('0x13')](_0x597b('0xe'),_0x25cfa7,_0x4f1156[_0x597b('0x13')]['message']);return _0x237c51(_0x4f1156[_0x597b('0x13')][_0x597b('0x15')]);}else{logger[_0x597b('0xd')]('OpenchannelApplication,\x20%s,\x20%s',_0x25cfa7,'request\x20sent');_0x237c51(_0x4f1156[_0x597b('0x16')]['message']);}})['catch'](function(_0x1f0955){logger[_0x597b('0x13')](_0x597b('0xe'),_0x25cfa7,_0x1f0955);_0x194691(_0x1f0955);});});}exports['UpdateOpenchannelApplication']=function(_0x4e8def){var _0x165576=this;return new Promise(function(_0x1b1a1d,_0x49a7b3){return db[_0x597b('0x17')]['update'](_0x4e8def[_0x597b('0x18')],{'raw':_0x4e8def[_0x597b('0x19')]?_0x4e8def[_0x597b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e8def[_0x597b('0x19')]?_0x4e8def['options'][_0x597b('0x1a')]||null:null,'attributes':_0x4e8def['options']?_0x4e8def['options'][_0x597b('0x1b')]||null:null,'limit':_0x4e8def[_0x597b('0x19')]?_0x4e8def[_0x597b('0x19')]['limit']||null:null})[_0x597b('0xc')](function(_0x37062e){logger[_0x597b('0xd')](_0x597b('0x1c'),_0x4e8def);logger[_0x597b('0x10')](_0x597b('0x1c'),_0x4e8def,JSON[_0x597b('0x12')](_0x37062e));_0x1b1a1d(_0x37062e);})[_0x597b('0x1d')](function(_0x65bb46){logger[_0x597b('0x13')](_0x597b('0x1c'),_0x65bb46[_0x597b('0x15')],_0x4e8def);_0x49a7b3(_0x165576[_0x597b('0x13')](0x1f4,_0x65bb46['message']));});});}; \ No newline at end of file +var _0xc613=['../../config/logger','rpc','../../config/environment','jayson/promise','request','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','OpenchannelApplication','body','options','attributes','limit','then','info','UpdateOpenchannelApplication','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2589ee,_0x539491){var _0x3b0dea=function(_0x31977a){while(--_0x31977a){_0x2589ee['push'](_0x2589ee['shift']());}};_0x3b0dea(++_0x539491);}(_0xc613,0x161));var _0x3c61=function(_0x3435ac,_0x280230){_0x3435ac=_0x3435ac-0x0;var _0x3c7261=_0xc613[_0x3435ac];return _0x3c7261;};'use strict';var _=require('lodash');var util=require(_0x3c61('0x0'));var moment=require(_0x3c61('0x1'));var BPromise=require(_0x3c61('0x2'));var rs=require(_0x3c61('0x3'));var fs=require('fs');var Redis=require(_0x3c61('0x4'));var db=require(_0x3c61('0x5'))['db'];var utils=require(_0x3c61('0x6'));var logger=require(_0x3c61('0x7'))(_0x3c61('0x8'));var config=require(_0x3c61('0x9'));var jayson=require(_0x3c61('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4f7853,_0x50adb6,_0x318f28){return new BPromise(function(_0x170741,_0x3cf0e5){return client[_0x3c61('0xb')](_0x4f7853,_0x318f28)['then'](function(_0xaf9462){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x50adb6,_0x3c61('0xc'));logger[_0x3c61('0xd')](_0x3c61('0xe'),_0x50adb6,'request\x20sent',JSON[_0x3c61('0xf')](_0xaf9462));if(_0xaf9462[_0x3c61('0x10')]){if(_0xaf9462[_0x3c61('0x10')][_0x3c61('0x11')]===0x1f4){logger[_0x3c61('0x10')](_0x3c61('0x12'),_0x50adb6,_0xaf9462[_0x3c61('0x10')][_0x3c61('0x13')]);return _0x3cf0e5(_0xaf9462['error'][_0x3c61('0x13')]);}logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x50adb6,_0xaf9462[_0x3c61('0x10')][_0x3c61('0x13')]);return _0x170741(_0xaf9462['error'][_0x3c61('0x13')]);}else{logger['info'](_0x3c61('0x12'),_0x50adb6,_0x3c61('0xc'));_0x170741(_0xaf9462[_0x3c61('0x14')][_0x3c61('0x13')]);}})[_0x3c61('0x15')](function(_0x48e0cc){logger['error'](_0x3c61('0x12'),_0x50adb6,_0x48e0cc);_0x3cf0e5(_0x48e0cc);});});}exports['UpdateOpenchannelApplication']=function(_0x59f327){var _0x38638b=this;return new Promise(function(_0x4d0257,_0x334add){return db[_0x3c61('0x16')]['update'](_0x59f327[_0x3c61('0x17')],{'raw':_0x59f327['options']?_0x59f327[_0x3c61('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59f327['options']?_0x59f327[_0x3c61('0x18')]['where']||null:null,'attributes':_0x59f327[_0x3c61('0x18')]?_0x59f327[_0x3c61('0x18')][_0x3c61('0x19')]||null:null,'limit':_0x59f327['options']?_0x59f327[_0x3c61('0x18')][_0x3c61('0x1a')]||null:null})[_0x3c61('0x1b')](function(_0x400a1d){logger[_0x3c61('0x1c')](_0x3c61('0x1d'),_0x59f327);logger[_0x3c61('0xd')]('UpdateOpenchannelApplication',_0x59f327,JSON[_0x3c61('0xf')](_0x400a1d));_0x4d0257(_0x400a1d);})[_0x3c61('0x15')](function(_0xae9aad){logger[_0x3c61('0x10')](_0x3c61('0x1d'),_0xae9aad[_0x3c61('0x13')],_0x59f327);_0x334add(_0x38638b['error'](0x1f4,_0xae9aad[_0x3c61('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index ecce9d6..67a7101 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 _0x6425=['util','path','connect-timeout','Router','fs-extra','./openchannelInteraction.controller','get','isAuthenticated','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','/:id','update','delete','openchannelinteraction:destroy','destroy','exports','multer'];(function(_0x53d9a7,_0x44c4a3){var _0x1c8958=function(_0x597d99){while(--_0x597d99){_0x53d9a7['push'](_0x53d9a7['shift']());}};_0x1c8958(++_0x44c4a3);}(_0x6425,0x194));var _0x5642=function(_0xc79a93,_0x2cb42a){_0xc79a93=_0xc79a93-0x0;var _0x477faf=_0x6425[_0xc79a93];return _0x477faf;};'use strict';var multer=require(_0x5642('0x0'));var util=require(_0x5642('0x1'));var path=require(_0x5642('0x2'));var timeout=require(_0x5642('0x3'));var express=require('express');var router=express[_0x5642('0x4')]();var fs_extra=require(_0x5642('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5642('0x6'));router[_0x5642('0x7')]('/',auth[_0x5642('0x8')](),controller['index']);router[_0x5642('0x7')](_0x5642('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x5642('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x5642('0xa')]);router['get'](_0x5642('0xb'),auth[_0x5642('0x8')](),controller[_0x5642('0xc')]);router[_0x5642('0x7')](_0x5642('0xd'),auth[_0x5642('0x8')](),controller[_0x5642('0xe')]);router[_0x5642('0xf')]('/',auth[_0x5642('0x8')](),controller['create']);router[_0x5642('0xf')](_0x5642('0xb'),auth['isAuthenticated'](),controller[_0x5642('0x10')]);router[_0x5642('0xf')](_0x5642('0x11'),auth[_0x5642('0x8')](),interaction[_0x5642('0x12')](_0x5642('0x13'),_0x5642('0x14')),controller['addTags']);router['put'](_0x5642('0x15'),auth[_0x5642('0x8')](),interaction[_0x5642('0x12')]('openchannel','openchannelinteraction:update'),controller[_0x5642('0x16')]);router[_0x5642('0x17')](_0x5642('0x15'),auth[_0x5642('0x8')](),interaction[_0x5642('0x12')](_0x5642('0x13'),_0x5642('0x18')),controller[_0x5642('0x19')]);router[_0x5642('0x17')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x5642('0x1a')]=router; \ No newline at end of file +var _0x6b0a=['/:id/messages','getMessages','/:id/download','download','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x6b0a,0xe6));var _0xa6b0=function(_0x1ce843,_0x1f404c){_0x1ce843=_0x1ce843-0x0;var _0x591367=_0x6b0a[_0x1ce843];return _0x591367;};'use strict';var multer=require('multer');var util=require(_0xa6b0('0x0'));var path=require(_0xa6b0('0x1'));var timeout=require(_0xa6b0('0x2'));var express=require(_0xa6b0('0x3'));var router=express[_0xa6b0('0x4')]();var fs_extra=require(_0xa6b0('0x5'));var auth=require(_0xa6b0('0x6'));var interaction=require(_0xa6b0('0x7'));var config=require('../../config/environment');var controller=require(_0xa6b0('0x8'));router[_0xa6b0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa6b0('0x9')]('/describe',auth[_0xa6b0('0xa')](),controller[_0xa6b0('0xb')]);router['get'](_0xa6b0('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa6b0('0xd'),auth[_0xa6b0('0xa')](),controller[_0xa6b0('0xe')]);router[_0xa6b0('0x9')](_0xa6b0('0xf'),auth['isAuthenticated'](),controller[_0xa6b0('0x10')]);router['post']('/',auth[_0xa6b0('0xa')](),controller['create']);router['post'](_0xa6b0('0xd'),auth[_0xa6b0('0xa')](),controller[_0xa6b0('0x11')]);router['post'](_0xa6b0('0x12'),auth[_0xa6b0('0xa')](),interaction[_0xa6b0('0x13')](_0xa6b0('0x14'),_0xa6b0('0x15')),controller['addTags']);router[_0xa6b0('0x16')](_0xa6b0('0xc'),auth[_0xa6b0('0xa')](),interaction[_0xa6b0('0x13')]('openchannel',_0xa6b0('0x17')),controller['update']);router[_0xa6b0('0x18')](_0xa6b0('0xc'),auth[_0xa6b0('0xa')](),interaction[_0xa6b0('0x13')](_0xa6b0('0x14'),_0xa6b0('0x19')),controller[_0xa6b0('0x1a')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4692958..ee9597a 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 _0xb78e=['INTEGER','sequelize','exports','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x5a511b,_0x9259c9){var _0x58f997=function(_0x4fb254){while(--_0x4fb254){_0x5a511b['push'](_0x5a511b['shift']());}};_0x58f997(++_0x9259c9);}(_0xb78e,0x1c9));var _0xeb78=function(_0x107069,_0x26a147){_0x107069=_0x107069-0x0;var _0x509d66=_0xb78e[_0x107069];return _0x509d66;};'use strict';var Sequelize=require(_0xeb78('0x0'));module[_0xeb78('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xeb78('0x2')]},'disposition':{'type':Sequelize[_0xeb78('0x3')]},'secondDisposition':{'type':Sequelize[_0xeb78('0x3')]},'thirdDisposition':{'type':Sequelize[_0xeb78('0x3')]},'note':{'type':Sequelize[_0xeb78('0x3')]},'read1stAt':{'type':Sequelize[_0xeb78('0x2')]},'threadId':{'type':Sequelize[_0xeb78('0x3')]},'externalUrl':{'type':Sequelize[_0xeb78('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xeb78('0x4')]('in',_0xeb78('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xeb78('0x4')]('in',_0xeb78('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xeb78('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xeb78('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xeb78('0x7')]}}; \ No newline at end of file +var _0x1152=['INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3841ee,_0x525997){var _0x278f08=function(_0x3aefb0){while(--_0x3aefb0){_0x3841ee['push'](_0x3841ee['shift']());}};_0x278f08(++_0x525997);}(_0x1152,0x182));var _0x2115=function(_0x135e73,_0x53d25e){_0x135e73=_0x135e73-0x0;var _0x207d86=_0x1152[_0x135e73];return _0x207d86;};'use strict';var Sequelize=require(_0x2115('0x0'));module[_0x2115('0x1')]={'closed':{'type':Sequelize[_0x2115('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2115('0x3')]},'disposition':{'type':Sequelize[_0x2115('0x4')]},'secondDisposition':{'type':Sequelize[_0x2115('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2115('0x4')]},'note':{'type':Sequelize[_0x2115('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x2115('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x2115('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2115('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2115('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0f112da..d4f9f20 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 _0x2e57=['name','send','index','map','OpenchannelInteraction','fieldName','key','getOptions','openchannel','user','catch','show','type','from','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','find','describe','addMessage','OpenchannelMessage','omit','getMessages','hasOwnProperty','nolimit','order','sort','pick','where','OpenchannelInteractionId','filter','$gte','split','format','count','findAll','addTags','setTags','ids','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','firstName','Attachment','createdAt','direction','read','OpenchannelAccount','Account','fullname','get','mkdirSync','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','System','Contact','lastName','secret','value','renderFile','views','transcript-','.pdf','Openchannel','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','sendStatus','moment','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2e57,0x6a));var _0x72e5=function(_0x48582d,_0x5520ff){_0x48582d=_0x48582d-0x0;var _0x4c76d6=_0x2e57[_0x48582d];return _0x4c76d6;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var path=require(_0x72e5('0x2'));var ejs=require(_0x72e5('0x3'));var fs=require('fs');var _=require(_0x72e5('0x4'));var Redis=require(_0x72e5('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x72e5('0x6'));var pdf=require(_0x72e5('0x7'));var logger=require(_0x72e5('0x8'))(_0x72e5('0x9'));var config=require('../../config/environment');var db=require(_0x72e5('0xa'))['db'];config[_0x72e5('0xb')]=_[_0x72e5('0xc')](config['redis'],{'host':_0x72e5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72e5('0xb')]));require('./openchannelInteraction.socket')[_0x72e5('0xe')](socket);function respondWithStatusCode(_0x1e483f,_0x2ea783){_0x2ea783=_0x2ea783||0xcc;return function(_0x42b78d){if(_0x42b78d){return _0x1e483f['sendStatus'](_0x2ea783);}return _0x1e483f[_0x72e5('0xf')](_0x2ea783)[_0x72e5('0x10')]();};}function respondWithResult(_0x2f42bd,_0x4a996b){_0x4a996b=_0x4a996b||0xc8;return function(_0x3bcdb6){if(_0x3bcdb6){return _0x2f42bd['status'](_0x4a996b)[_0x72e5('0x11')](_0x3bcdb6);}};}function respondWithFilteredResult(_0x275985,_0x16ed63){return function(_0xd729ad){if(_0xd729ad){var _0x34c9ac=typeof _0x16ed63[_0x72e5('0x12')]==='undefined'&&typeof _0x16ed63[_0x72e5('0x13')]===_0x72e5('0x14');var _0x266aca=_0xd729ad['count'];var _0x32748b=_0x34c9ac?0x0:_0x16ed63['offset'];var _0x23ef99=_0x34c9ac?_0xd729ad['count']:_0x16ed63[_0x72e5('0x12')]+_0x16ed63[_0x72e5('0x13')];var _0x2d7395;if(_0x23ef99>=_0x266aca){_0x23ef99=_0x266aca;_0x2d7395=0xc8;}else{_0x2d7395=0xce;}_0x275985[_0x72e5('0xf')](_0x2d7395);return _0x275985[_0x72e5('0x15')](_0x72e5('0x16'),_0x32748b+'-'+_0x23ef99+'/'+_0x266aca)[_0x72e5('0x11')](_0xd729ad);}return null;};}function saveUpdates(_0x5005db){return function(_0x4aa38b){if(_0x4aa38b){return _0x4aa38b[_0x72e5('0x17')](_0x5005db)[_0x72e5('0x18')](function(_0xe28caa){return _0xe28caa;});}return null;};}function removeEntity(_0x3b9481){return function(_0xb58073){if(_0xb58073){return _0xb58073[_0x72e5('0x19')]()[_0x72e5('0x18')](function(){_0x3b9481[_0x72e5('0xf')](0xcc)[_0x72e5('0x10')]();});}};}function handleEntityNotFound(_0x2d95f9){return function(_0x4517fe){if(!_0x4517fe){_0x2d95f9['sendStatus'](0x194);}return _0x4517fe;};}function handleError(_0x14d350,_0x22999f){_0x22999f=_0x22999f||0x1f4;return function(_0x436692){logger[_0x72e5('0x1a')](_0x436692[_0x72e5('0x1b')]);if(_0x436692[_0x72e5('0x1c')]){delete _0x436692[_0x72e5('0x1c')];}_0x14d350[_0x72e5('0xf')](_0x22999f)[_0x72e5('0x1d')](_0x436692);};}exports[_0x72e5('0x1e')]=function(_0x3609b6,_0x107e98){var _0x4770ec={};var _0xd50d5=_[_0x72e5('0x1f')](db[_0x72e5('0x20')]['rawAttributes'],function(_0xbbc8fc){return{'name':_0xbbc8fc[_0x72e5('0x21')],'type':_0xbbc8fc['type'][_0x72e5('0x22')]};});_0x4770ec=qs[_0x72e5('0x23')](_0xd50d5,_0x3609b6);return interaction['findAll'](_0x72e5('0x24'),_0x3609b6['query'],_0x3609b6[_0x72e5('0x25')],_0x4770ec,_0xd50d5)['then'](respondWithFilteredResult(_0x107e98,_0x4770ec))[_0x72e5('0x26')](handleError(_0x107e98,null));};exports[_0x72e5('0x27')]=function(_0x4eb721,_0x17a547){var _0x4bfe16={};if(_0x4eb721['query']['type']&&_0x4eb721['query'][_0x72e5('0x28')]==='from'){_0x4bfe16[_0x72e5('0x29')]=_0x4eb721[_0x72e5('0x2a')]['id'];}else{_0x4bfe16['id']=_0x4eb721[_0x72e5('0x2a')]['id'];}var _0x413d08={'raw':![],'where':_0x4bfe16},_0x2698cc={};_0x2698cc[_0x72e5('0x2b')]=_[_0x72e5('0x2c')](db['OpenchannelInteraction'][_0x72e5('0x2d')]);_0x2698cc[_0x72e5('0x2e')]=_[_0x72e5('0x2c')](_0x4eb721[_0x72e5('0x2e')]);_0x2698cc[_0x72e5('0x2f')]=_[_0x72e5('0x30')](_0x2698cc[_0x72e5('0x2b')],_0x2698cc[_0x72e5('0x2e')]);_0x413d08[_0x72e5('0x31')]=_[_0x72e5('0x30')](_0x2698cc['model'],qs[_0x72e5('0x32')](_0x4eb721[_0x72e5('0x2e')][_0x72e5('0x32')]));_0x413d08[_0x72e5('0x31')]=_0x413d08['attributes'][_0x72e5('0x33')]?_0x413d08[_0x72e5('0x31')]:_0x2698cc[_0x72e5('0x2b')];if(_0x4eb721[_0x72e5('0x2e')][_0x72e5('0x34')]){_0x413d08[_0x72e5('0x35')]=[{'all':!![]}];}_0x413d08=_[_0x72e5('0x36')]({},_0x413d08,_0x4eb721[_0x72e5('0x37')]);return db[_0x72e5('0x20')]['find'](_0x413d08)['then'](handleEntityNotFound(_0x17a547,null))[_0x72e5('0x18')](respondWithResult(_0x17a547,null))[_0x72e5('0x26')](handleError(_0x17a547,null));};exports[_0x72e5('0x38')]=function(_0x1b2ea6,_0x442f6e){return db[_0x72e5('0x20')]['create'](_0x1b2ea6[_0x72e5('0x39')],{})['then'](respondWithResult(_0x442f6e,0xc9))[_0x72e5('0x26')](handleError(_0x442f6e,null));};exports[_0x72e5('0x17')]=function(_0x5249f7,_0x2ffbc7){if(_0x5249f7[_0x72e5('0x39')]['id']){delete _0x5249f7['body']['id'];}return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0x5249f7[_0x72e5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x2ffbc7,null))[_0x72e5('0x18')](saveUpdates(_0x5249f7[_0x72e5('0x39')],null))[_0x72e5('0x18')](respondWithResult(_0x2ffbc7,null))[_0x72e5('0x26')](handleError(_0x2ffbc7,null));};exports[_0x72e5('0x19')]=function(_0xa20343,_0xdb73d5){return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0xa20343[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0xdb73d5,null))[_0x72e5('0x18')](removeEntity(_0xdb73d5,null))['catch'](handleError(_0xdb73d5,null));};exports[_0x72e5('0x3b')]=function(_0x77a328,_0x356890){return db[_0x72e5('0x20')]['describe']()[_0x72e5('0x18')](respondWithResult(_0x356890,null))[_0x72e5('0x26')](handleError(_0x356890,null));};exports[_0x72e5('0x3c')]=function(_0x5f8523,_0x16491a){return db[_0x72e5('0x3d')]['find']({'where':{'id':_0x5f8523[_0x72e5('0x2a')]['id']}})['then'](handleEntityNotFound(_0x16491a,null))[_0x72e5('0x18')](function(_0x45238d){if(_0x45238d){return _0x45238d['addMessage'](_0x5f8523[_0x72e5('0x39')]['ids'],_[_0x72e5('0x3e')](_0x5f8523[_0x72e5('0x39')],['ids','id'])||{});}})[_0x72e5('0x18')](respondWithResult(_0x16491a,null))[_0x72e5('0x26')](handleError(_0x16491a,null));};exports[_0x72e5('0x3f')]=function(_0x244e08,_0x345d38){var _0x1d43c3={'raw':![],'where':{}};var _0x11da00={};var _0x21d153={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x244e08[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0x345d38,null))[_0x72e5('0x18')](function(_0x32cad0){if(_0x32cad0){_0x11da00[_0x72e5('0x2b')]=_[_0x72e5('0x2c')](db[_0x72e5('0x3d')][_0x72e5('0x2d')]);_0x11da00[_0x72e5('0x2e')]=_[_0x72e5('0x2c')](_0x244e08[_0x72e5('0x2e')]);_0x11da00['filters']=_[_0x72e5('0x30')](_0x11da00['model'],_0x11da00[_0x72e5('0x2e')]);_0x1d43c3['attributes']=_[_0x72e5('0x30')](_0x11da00['model'],qs[_0x72e5('0x32')](_0x244e08['query'][_0x72e5('0x32')]));_0x1d43c3['attributes']=_0x1d43c3['attributes'][_0x72e5('0x33')]?_0x1d43c3['attributes']:_0x11da00[_0x72e5('0x2b')];if(!_0x244e08[_0x72e5('0x2e')][_0x72e5('0x40')](_0x72e5('0x41'))){_0x1d43c3[_0x72e5('0x13')]=qs['limit'](_0x244e08[_0x72e5('0x2e')]['limit']);_0x1d43c3[_0x72e5('0x12')]=qs[_0x72e5('0x12')](_0x244e08[_0x72e5('0x2e')][_0x72e5('0x12')]);}_0x1d43c3[_0x72e5('0x42')]=qs[_0x72e5('0x43')](_0x244e08[_0x72e5('0x2e')][_0x72e5('0x43')]);_0x1d43c3['where']=qs[_0x72e5('0x2f')](_[_0x72e5('0x44')](_0x244e08[_0x72e5('0x2e')],_0x11da00[_0x72e5('0x2f')]));_0x1d43c3[_0x72e5('0x45')][_0x72e5('0x46')]=_0x32cad0['id'];if(_0x244e08[_0x72e5('0x2e')][_0x72e5('0x47')]){_0x1d43c3[_0x72e5('0x45')]=_[_0x72e5('0x36')](_0x1d43c3[_0x72e5('0x45')],{'$or':_[_0x72e5('0x1f')](_0x1d43c3[_0x72e5('0x31')],function(_0x558248){var _0x582393={};_0x582393[_0x558248]={'$like':'%'+_0x244e08[_0x72e5('0x2e')][_0x72e5('0x47')]+'%'};return _0x582393;})});}if(_0x244e08['query'][_0x72e5('0x48')]){var _0x5a8288=_0x244e08['query'][_0x72e5('0x48')][_0x72e5('0x49')](',');var _0xd2c873={};_0xd2c873[_0x5a8288[0x0]]={'$gte':moment(_0x5a8288[0x1])[_0x72e5('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1d43c3[_0x72e5('0x45')]=_['merge'](_0x1d43c3[_0x72e5('0x45')],_0xd2c873);}_0x1d43c3=_[_0x72e5('0x36')]({},_0x1d43c3,_0x244e08[_0x72e5('0x37')]);return db['OpenchannelMessage'][_0x72e5('0x4b')]({'where':_0x1d43c3[_0x72e5('0x45')]})[_0x72e5('0x18')](function(_0x1d8000){_0x21d153[_0x72e5('0x4b')]=_0x1d8000;if(_0x244e08[_0x72e5('0x2e')][_0x72e5('0x34')]){_0x1d43c3[_0x72e5('0x35')]=[{'all':!![]}];}return db[_0x72e5('0x3d')][_0x72e5('0x4c')](_0x1d43c3);})['then'](function(_0x3501e6){_0x21d153['rows']=_0x3501e6;return _0x21d153;});}})[_0x72e5('0x18')](respondWithFilteredResult(_0x345d38,_0x1d43c3))['catch'](handleError(_0x345d38,null));};exports[_0x72e5('0x4d')]=function(_0x8b482,_0x31692a){return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0x8b482[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0x31692a,null))[_0x72e5('0x18')](function(_0x1b4677){if(_0x1b4677){return _0x1b4677[_0x72e5('0x4e')](_0x8b482[_0x72e5('0x39')]['ids'],_[_0x72e5('0x3e')](_0x8b482[_0x72e5('0x39')],[_0x72e5('0x4f'),'id'])||{})[_0x72e5('0x50')](function(){return db[_0x72e5('0x51')]['findAll']({'attributes':['id','name',_0x72e5('0x52')],'where':{'id':_0x8b482[_0x72e5('0x39')][_0x72e5('0x4f')]}});})[_0x72e5('0x18')](function(_0x239af4){socket[_0x72e5('0x53')]('openchannelInteractionTags:save',{'id':Number(_0x8b482[_0x72e5('0x2a')]['id']),'tags':_0x239af4||[]});return{'id':Number(_0x8b482[_0x72e5('0x2a')]['id']),'tags':_0x239af4||[]};});}})[_0x72e5('0x18')](respondWithResult(_0x31692a,null))[_0x72e5('0x26')](handleError(_0x31692a,null));};exports[_0x72e5('0x54')]=function(_0x4358aa,_0x3eb9a7){return db[_0x72e5('0x20')][_0x72e5('0x3a')]({'where':{'id':_0x4358aa[_0x72e5('0x2a')]['id']}})[_0x72e5('0x18')](handleEntityNotFound(_0x3eb9a7,null))[_0x72e5('0x18')](function(_0x391828){if(_0x391828){return _0x391828[_0x72e5('0x54')](_0x4358aa[_0x72e5('0x2e')][_0x72e5('0x4f')]);}})[_0x72e5('0x18')](respondWithStatusCode(_0x3eb9a7,null))['catch'](handleError(_0x3eb9a7,null));};exports[_0x72e5('0x55')]=function(_0x4b15e1,_0x1b205d){var _0x203bbf=moment()[_0x72e5('0x56')]()[_0x72e5('0x57')]();var _0x439e74=path[_0x72e5('0x58')](config[_0x72e5('0x59')],_0x72e5('0x5a'),_0x72e5('0x5b'),_0x72e5('0x5c'));var _0x123039=path[_0x72e5('0x58')](config[_0x72e5('0x59')],_0x72e5('0x5a'),_0x72e5('0x5b'),'attachments');var _0x39f9a5=path[_0x72e5('0x58')](_0x439e74,_0x203bbf);var _0x2c93b=util['format'](_0x72e5('0x5d'),_0x4b15e1[_0x72e5('0x2a')]['id'],_0x203bbf);var _0x36c2e3=path[_0x72e5('0x58')](_0x439e74,_0x2c93b);var _0x9ff93f=[];_0x9ff93f[_0x72e5('0x5e')]({'model':db[_0x72e5('0x5f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x9ff93f[_0x72e5('0x5e')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x72e5('0x60'),'lastName'],'raw':!![]});if(_0x4b15e1['query']['attachments']){_0x9ff93f[_0x72e5('0x5e')]({'model':db[_0x72e5('0x61')],'as':_0x72e5('0x61'),'raw':!![]});}var _0x2eb4ed=[{'model':db[_0x72e5('0x3d')],'as':'Messages','attributes':['id',_0x72e5('0x39'),_0x72e5('0x62'),_0x72e5('0x63'),'secret',_0x72e5('0x64')],'include':_0x9ff93f}];_0x2eb4ed[_0x72e5('0x5e')]({'model':db[_0x72e5('0x65')],'as':_0x72e5('0x66'),'attributes':['id','name']});_0x2eb4ed[_0x72e5('0x5e')]({'model':db['User'],'as':'Owner','attributes':['id',_0x72e5('0x67')]});return db[_0x72e5('0x20')]['find']({'where':{'id':_0x4b15e1[_0x72e5('0x2a')]['id']},'include':_0x2eb4ed})[_0x72e5('0x18')](handleEntityNotFound(_0x1b205d,null))['then'](function(_0x440d32){if(_0x440d32){var _0x2908d2=_0x440d32[_0x72e5('0x68')]({'plain':!![]});fs[_0x72e5('0x69')](_0x39f9a5);var _0x26a2b5={'channel':'Openchannel','account':_0x2908d2[_0x72e5('0x66')]['name'],'agent':_0x2908d2['Owner']?_0x2908d2[_0x72e5('0x6a')][_0x72e5('0x67')]:_0x72e5('0x6b'),'createdAt':moment(_0x2908d2['createdAt'])[_0x72e5('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')[_0x72e5('0x57')](),'closedAt':_0x2908d2['closed']?moment(_0x2908d2[_0x72e5('0x6c')])['format'](_0x72e5('0x6d'))['toString']():'','disposition':_0x2908d2[_0x72e5('0x6e')],'visibility':_0x2908d2[_0x72e5('0x6f')]?_0x72e5('0x70'):_0x72e5('0x71'),'messages':_(_0x2908d2[_0x72e5('0x72')])[_0x72e5('0x47')]({'secret':![]})[_0x72e5('0x1f')](function(_0x444fb2){if(_0x444fb2[_0x72e5('0x61')]){var _0x10f9a1=path[_0x72e5('0x58')](_0x123039,_0x444fb2[_0x72e5('0x61')][_0x72e5('0x73')]);if(fs['existsSync'](_0x10f9a1)){fs[_0x72e5('0x74')](_0x10f9a1)[_0x72e5('0x75')](fs[_0x72e5('0x76')](path[_0x72e5('0x58')](_0x39f9a5,_0x444fb2[_0x72e5('0x61')][_0x72e5('0x73')])));}}return{'date':moment(_0x444fb2[_0x72e5('0x62')])[_0x72e5('0x4a')](_0x72e5('0x6d'))[_0x72e5('0x57')](),'sender':_0x444fb2['direction']===_0x72e5('0x77')?_0x444fb2['User']?_0x444fb2['User'][_0x72e5('0x67')]:_0x72e5('0x78'):_0x444fb2[_0x72e5('0x79')][_0x72e5('0x60')]+(_0x444fb2['Contact'][_0x72e5('0x7a')]?'\x20'+_0x444fb2[_0x72e5('0x79')][_0x72e5('0x7a')]:''),'body':_0x444fb2['Attachment']?_0x444fb2[_0x72e5('0x61')][_0x72e5('0x73')]:_0x444fb2[_0x72e5('0x39')],'direction':_0x444fb2['direction']==='out'?'A':'C','secret':_0x444fb2[_0x72e5('0x7b')],'read':_0x444fb2[_0x72e5('0x64')],'attachment':_0x444fb2[_0x72e5('0x61')]};})[_0x72e5('0x7c')]()};return ejs[_0x72e5('0x7d')](path[_0x72e5('0x58')](config[_0x72e5('0x59')],_0x72e5('0x5a'),_0x72e5('0x7e'),'downloadInteraction.ejs'),{'interaction':_0x26a2b5})[_0x72e5('0x18')](function(_0x4591ae){var _0x48b48a=path[_0x72e5('0x58')](_0x39f9a5,_0x72e5('0x7f')+_0x2908d2['id']+'-'+_0x203bbf+_0x72e5('0x80'));var _0x90bd95={'path':_0x48b48a,'channel':_0x72e5('0x81'),'interactionId':_0x2908d2['id']};return pdf[_0x72e5('0x82')](_0x4591ae,_0x90bd95);})['then'](function(){return new Promise(function(_0x37dec5,_0x5c04c1){zipdir(_0x39f9a5,{'saveTo':_0x36c2e3},function(_0x493419,_0x423b45){if(_0x493419)return _0x5c04c1(_0x493419);return _0x37dec5(_0x423b45);});})[_0x72e5('0x18')](function(){return new Promise(function(_0x3e443f,_0x1070b6){rimraf(_0x39f9a5,function(_0x48a69a){if(_0x48a69a)_0x1070b6(_0x48a69a);return _0x3e443f();});});})[_0x72e5('0x18')](function(){return _0x1b205d[_0x72e5('0x55')](_0x36c2e3,_0x2c93b,function(_0x5776f0){if(_0x5776f0){logger[_0x72e5('0x1a')](_0x72e5('0x83'),_0x5776f0);}else{fs[_0x72e5('0x84')](_0x36c2e3);}});});});}else{return _0x1b205d[_0x72e5('0x85')](0xc8);}})[_0x72e5('0x26')](handleError(_0x1b205d,null));}; \ No newline at end of file +var _0xc90c=['server','files','tmp','attachments','push','User','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','OpenchannelAccount','Account','fullname','get','mkdirSync','Openchannel','Owner','N.A.','closed','closedAt','disposition','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','value','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','Content-Range','update','then','destroy','error','stack','name','send','index','OpenchannelInteraction','type','findAll','openchannel','query','user','show','from','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','describe','addMessage','ids','omit','OpenchannelMessage','hasOwnProperty','limit','offset','order','sort','pick','where','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root'];(function(_0x12b9f9,_0x4a7dc3){var _0x305250=function(_0x1ad3d0){while(--_0x1ad3d0){_0x12b9f9['push'](_0x12b9f9['shift']());}};_0x305250(++_0x4a7dc3);}(_0xc90c,0x1a6));var _0xcc90=function(_0x215fa1,_0x4870e2){_0x215fa1=_0x215fa1-0x0;var _0x4467b9=_0xc90c[_0x215fa1];return _0x4467b9;};'use strict';var rimraf=require(_0xcc90('0x0'));var zipdir=require(_0xcc90('0x1'));var moment=require(_0xcc90('0x2'));var util=require(_0xcc90('0x3'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xcc90('0x4'));var qs=require(_0xcc90('0x5'));var pdf=require(_0xcc90('0x6'));var logger=require(_0xcc90('0x7'))(_0xcc90('0x8'));var config=require(_0xcc90('0x9'));var db=require(_0xcc90('0xa'))['db'];config[_0xcc90('0xb')]=_[_0xcc90('0xc')](config[_0xcc90('0xb')],{'host':_0xcc90('0xd'),'port':0x18eb});var socket=require(_0xcc90('0xe'))(new Redis(config[_0xcc90('0xb')]));require('./openchannelInteraction.socket')[_0xcc90('0xf')](socket);function respondWithStatusCode(_0x1b07af,_0x2f8cbd){_0x2f8cbd=_0x2f8cbd||0xcc;return function(_0x2e8116){if(_0x2e8116){return _0x1b07af[_0xcc90('0x10')](_0x2f8cbd);}return _0x1b07af[_0xcc90('0x11')](_0x2f8cbd)[_0xcc90('0x12')]();};}function respondWithResult(_0x27e717,_0x103b72){_0x103b72=_0x103b72||0xc8;return function(_0xc43e3){if(_0xc43e3){return _0x27e717[_0xcc90('0x11')](_0x103b72)[_0xcc90('0x13')](_0xc43e3);}};}function respondWithFilteredResult(_0x2e70fd,_0x3e4da3){return function(_0x973a2d){if(_0x973a2d){var _0x207da4=typeof _0x3e4da3['offset']===_0xcc90('0x14')&&typeof _0x3e4da3['limit']===_0xcc90('0x14');var _0x177c56=_0x973a2d['count'];var _0x166929=_0x207da4?0x0:_0x3e4da3['offset'];var _0x2e9075=_0x207da4?_0x973a2d[_0xcc90('0x15')]:_0x3e4da3['offset']+_0x3e4da3['limit'];var _0x3cb392;if(_0x2e9075>=_0x177c56){_0x2e9075=_0x177c56;_0x3cb392=0xc8;}else{_0x3cb392=0xce;}_0x2e70fd[_0xcc90('0x11')](_0x3cb392);return _0x2e70fd['set'](_0xcc90('0x16'),_0x166929+'-'+_0x2e9075+'/'+_0x177c56)[_0xcc90('0x13')](_0x973a2d);}return null;};}function saveUpdates(_0x3a396e){return function(_0x564aaa){if(_0x564aaa){return _0x564aaa[_0xcc90('0x17')](_0x3a396e)[_0xcc90('0x18')](function(_0x440c21){return _0x440c21;});}return null;};}function removeEntity(_0x5c68ea){return function(_0x2f4c86){if(_0x2f4c86){return _0x2f4c86[_0xcc90('0x19')]()[_0xcc90('0x18')](function(){_0x5c68ea[_0xcc90('0x11')](0xcc)[_0xcc90('0x12')]();});}};}function handleEntityNotFound(_0x30d78c){return function(_0x1f825c){if(!_0x1f825c){_0x30d78c[_0xcc90('0x10')](0x194);}return _0x1f825c;};}function handleError(_0x461801,_0x4657e6){_0x4657e6=_0x4657e6||0x1f4;return function(_0x6632f3){logger[_0xcc90('0x1a')](_0x6632f3[_0xcc90('0x1b')]);if(_0x6632f3[_0xcc90('0x1c')]){delete _0x6632f3['name'];}_0x461801[_0xcc90('0x11')](_0x4657e6)[_0xcc90('0x1d')](_0x6632f3);};}exports[_0xcc90('0x1e')]=function(_0x42b7cb,_0x136562){var _0x41a973={};var _0x55fdc4=_['map'](db[_0xcc90('0x1f')]['rawAttributes'],function(_0x44f172){return{'name':_0x44f172['fieldName'],'type':_0x44f172[_0xcc90('0x20')]['key']};});_0x41a973=qs['getOptions'](_0x55fdc4,_0x42b7cb);return interaction[_0xcc90('0x21')](_0xcc90('0x22'),_0x42b7cb[_0xcc90('0x23')],_0x42b7cb[_0xcc90('0x24')],_0x41a973,_0x55fdc4)[_0xcc90('0x18')](respondWithFilteredResult(_0x136562,_0x41a973))['catch'](handleError(_0x136562,null));};exports[_0xcc90('0x25')]=function(_0x41b608,_0x2cc917){var _0x2da351={};if(_0x41b608[_0xcc90('0x23')]['type']&&_0x41b608[_0xcc90('0x23')][_0xcc90('0x20')]==='from'){_0x2da351[_0xcc90('0x26')]=_0x41b608['params']['id'];}else{_0x2da351['id']=_0x41b608[_0xcc90('0x27')]['id'];}var _0x14567b={'raw':![],'where':_0x2da351},_0x2c7957={};_0x2c7957[_0xcc90('0x28')]=_[_0xcc90('0x29')](db[_0xcc90('0x1f')][_0xcc90('0x2a')]);_0x2c7957[_0xcc90('0x23')]=_[_0xcc90('0x29')](_0x41b608[_0xcc90('0x23')]);_0x2c7957[_0xcc90('0x2b')]=_[_0xcc90('0x2c')](_0x2c7957[_0xcc90('0x28')],_0x2c7957[_0xcc90('0x23')]);_0x14567b[_0xcc90('0x2d')]=_[_0xcc90('0x2c')](_0x2c7957[_0xcc90('0x28')],qs[_0xcc90('0x2e')](_0x41b608[_0xcc90('0x23')][_0xcc90('0x2e')]));_0x14567b[_0xcc90('0x2d')]=_0x14567b[_0xcc90('0x2d')][_0xcc90('0x2f')]?_0x14567b[_0xcc90('0x2d')]:_0x2c7957[_0xcc90('0x28')];if(_0x41b608['query'][_0xcc90('0x30')]){_0x14567b[_0xcc90('0x31')]=[{'all':!![]}];}_0x14567b=_[_0xcc90('0x32')]({},_0x14567b,_0x41b608['options']);return db['OpenchannelInteraction'][_0xcc90('0x33')](_0x14567b)[_0xcc90('0x18')](handleEntityNotFound(_0x2cc917,null))[_0xcc90('0x18')](respondWithResult(_0x2cc917,null))[_0xcc90('0x34')](handleError(_0x2cc917,null));};exports[_0xcc90('0x35')]=function(_0x26dc54,_0x359ccb){return db[_0xcc90('0x1f')][_0xcc90('0x35')](_0x26dc54['body'],{})[_0xcc90('0x18')](respondWithResult(_0x359ccb,0xc9))[_0xcc90('0x34')](handleError(_0x359ccb,null));};exports[_0xcc90('0x17')]=function(_0x12a87d,_0x29a30e){if(_0x12a87d[_0xcc90('0x36')]['id']){delete _0x12a87d['body']['id'];}return db[_0xcc90('0x1f')]['find']({'where':{'id':_0x12a87d[_0xcc90('0x27')]['id']}})[_0xcc90('0x18')](handleEntityNotFound(_0x29a30e,null))['then'](saveUpdates(_0x12a87d[_0xcc90('0x36')],null))[_0xcc90('0x18')](respondWithResult(_0x29a30e,null))[_0xcc90('0x34')](handleError(_0x29a30e,null));};exports[_0xcc90('0x19')]=function(_0x5c2815,_0x25ec1c){return db['OpenchannelInteraction'][_0xcc90('0x33')]({'where':{'id':_0x5c2815[_0xcc90('0x27')]['id']}})[_0xcc90('0x18')](handleEntityNotFound(_0x25ec1c,null))[_0xcc90('0x18')](removeEntity(_0x25ec1c,null))['catch'](handleError(_0x25ec1c,null));};exports[_0xcc90('0x37')]=function(_0x5f1611,_0x58b0b2){return db['OpenchannelInteraction']['describe']()[_0xcc90('0x18')](respondWithResult(_0x58b0b2,null))[_0xcc90('0x34')](handleError(_0x58b0b2,null));};exports[_0xcc90('0x38')]=function(_0x339c05,_0x8dd291){return db['OpenchannelMessage'][_0xcc90('0x33')]({'where':{'id':_0x339c05[_0xcc90('0x27')]['id']}})['then'](handleEntityNotFound(_0x8dd291,null))[_0xcc90('0x18')](function(_0x159e5e){if(_0x159e5e){return _0x159e5e[_0xcc90('0x38')](_0x339c05[_0xcc90('0x36')][_0xcc90('0x39')],_[_0xcc90('0x3a')](_0x339c05[_0xcc90('0x36')],[_0xcc90('0x39'),'id'])||{});}})[_0xcc90('0x18')](respondWithResult(_0x8dd291,null))['catch'](handleError(_0x8dd291,null));};exports['getMessages']=function(_0x11c781,_0x425818){var _0x1d95e1={'raw':![],'where':{}};var _0x369af={};var _0x45de6c={'count':0x0,'rows':[]};return db[_0xcc90('0x1f')]['findOne']({'where':{'id':_0x11c781['params']['id']}})[_0xcc90('0x18')](handleEntityNotFound(_0x425818,null))[_0xcc90('0x18')](function(_0x58473e){if(_0x58473e){_0x369af['model']=_['keys'](db[_0xcc90('0x3b')][_0xcc90('0x2a')]);_0x369af[_0xcc90('0x23')]=_[_0xcc90('0x29')](_0x11c781[_0xcc90('0x23')]);_0x369af[_0xcc90('0x2b')]=_[_0xcc90('0x2c')](_0x369af[_0xcc90('0x28')],_0x369af['query']);_0x1d95e1[_0xcc90('0x2d')]=_['intersection'](_0x369af['model'],qs['fields'](_0x11c781[_0xcc90('0x23')][_0xcc90('0x2e')]));_0x1d95e1['attributes']=_0x1d95e1[_0xcc90('0x2d')][_0xcc90('0x2f')]?_0x1d95e1[_0xcc90('0x2d')]:_0x369af[_0xcc90('0x28')];if(!_0x11c781[_0xcc90('0x23')][_0xcc90('0x3c')]('nolimit')){_0x1d95e1['limit']=qs[_0xcc90('0x3d')](_0x11c781[_0xcc90('0x23')]['limit']);_0x1d95e1['offset']=qs[_0xcc90('0x3e')](_0x11c781['query'][_0xcc90('0x3e')]);}_0x1d95e1[_0xcc90('0x3f')]=qs[_0xcc90('0x40')](_0x11c781[_0xcc90('0x23')][_0xcc90('0x40')]);_0x1d95e1['where']=qs[_0xcc90('0x2b')](_[_0xcc90('0x41')](_0x11c781[_0xcc90('0x23')],_0x369af[_0xcc90('0x2b')]));_0x1d95e1[_0xcc90('0x42')]['OpenchannelInteractionId']=_0x58473e['id'];if(_0x11c781[_0xcc90('0x23')][_0xcc90('0x43')]){_0x1d95e1['where']=_['merge'](_0x1d95e1['where'],{'$or':_[_0xcc90('0x44')](_0x1d95e1[_0xcc90('0x2d')],function(_0x311ab6){var _0x537968={};_0x537968[_0x311ab6]={'$like':'%'+_0x11c781[_0xcc90('0x23')][_0xcc90('0x43')]+'%'};return _0x537968;})});}if(_0x11c781['query'][_0xcc90('0x45')]){var _0x5427be=_0x11c781['query'][_0xcc90('0x45')][_0xcc90('0x46')](',');var _0x4450da={};_0x4450da[_0x5427be[0x0]]={'$gte':moment(_0x5427be[0x1])[_0xcc90('0x47')](_0xcc90('0x48'))};_0x1d95e1[_0xcc90('0x42')]=_[_0xcc90('0x32')](_0x1d95e1[_0xcc90('0x42')],_0x4450da);}_0x1d95e1=_[_0xcc90('0x32')]({},_0x1d95e1,_0x11c781[_0xcc90('0x49')]);return db['OpenchannelMessage'][_0xcc90('0x15')]({'where':_0x1d95e1['where']})[_0xcc90('0x18')](function(_0x37531d){_0x45de6c[_0xcc90('0x15')]=_0x37531d;if(_0x11c781['query']['includeAll']){_0x1d95e1[_0xcc90('0x31')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xcc90('0x21')](_0x1d95e1);})[_0xcc90('0x18')](function(_0x1e3b65){_0x45de6c[_0xcc90('0x4a')]=_0x1e3b65;return _0x45de6c;});}})['then'](respondWithFilteredResult(_0x425818,_0x1d95e1))[_0xcc90('0x34')](handleError(_0x425818,null));};exports['addTags']=function(_0x4e6921,_0x4924c2){return db[_0xcc90('0x1f')]['find']({'where':{'id':_0x4e6921[_0xcc90('0x27')]['id']}})[_0xcc90('0x18')](handleEntityNotFound(_0x4924c2,null))[_0xcc90('0x18')](function(_0x5787d3){if(_0x5787d3){return _0x5787d3[_0xcc90('0x4b')](_0x4e6921[_0xcc90('0x36')][_0xcc90('0x39')],_[_0xcc90('0x3a')](_0x4e6921[_0xcc90('0x36')],[_0xcc90('0x39'),'id'])||{})[_0xcc90('0x4c')](function(){return db[_0xcc90('0x4d')][_0xcc90('0x21')]({'attributes':['id',_0xcc90('0x1c'),_0xcc90('0x4e')],'where':{'id':_0x4e6921[_0xcc90('0x36')]['ids']}});})['then'](function(_0x51109b){socket[_0xcc90('0x4f')]('openchannelInteractionTags:save',{'id':Number(_0x4e6921[_0xcc90('0x27')]['id']),'tags':_0x51109b||[]});return{'id':Number(_0x4e6921[_0xcc90('0x27')]['id']),'tags':_0x51109b||[]};});}})['then'](respondWithResult(_0x4924c2,null))[_0xcc90('0x34')](handleError(_0x4924c2,null));};exports[_0xcc90('0x50')]=function(_0x2db781,_0x22d9fa){return db[_0xcc90('0x1f')][_0xcc90('0x33')]({'where':{'id':_0x2db781[_0xcc90('0x27')]['id']}})['then'](handleEntityNotFound(_0x22d9fa,null))[_0xcc90('0x18')](function(_0x85ba5d){if(_0x85ba5d){return _0x85ba5d[_0xcc90('0x50')](_0x2db781['query'][_0xcc90('0x39')]);}})[_0xcc90('0x18')](respondWithStatusCode(_0x22d9fa,null))[_0xcc90('0x34')](handleError(_0x22d9fa,null));};exports[_0xcc90('0x51')]=function(_0x5c1e56,_0x44afd2){var _0x4b9158=moment()[_0xcc90('0x52')]()[_0xcc90('0x53')]();var _0x4a3344=path[_0xcc90('0x54')](config[_0xcc90('0x55')],_0xcc90('0x56'),_0xcc90('0x57'),_0xcc90('0x58'));var _0x3391aa=path['join'](config[_0xcc90('0x55')],_0xcc90('0x56'),_0xcc90('0x57'),_0xcc90('0x59'));var _0x5962d3=path[_0xcc90('0x54')](_0x4a3344,_0x4b9158);var _0x159da1=util[_0xcc90('0x47')]('transcript-%d-%s.zip',_0x5c1e56['params']['id'],_0x4b9158);var _0x32779e=path[_0xcc90('0x54')](_0x4a3344,_0x159da1);var _0x3b9021=[];_0x3b9021[_0xcc90('0x5a')]({'model':db[_0xcc90('0x5b')],'as':_0xcc90('0x5b'),'attributes':['id','fullname'],'raw':!![]});_0x3b9021[_0xcc90('0x5a')]({'model':db[_0xcc90('0x5c')],'as':_0xcc90('0x5d'),'attributes':['id',_0xcc90('0x5e'),_0xcc90('0x5f')],'raw':!![]});if(_0x5c1e56[_0xcc90('0x23')][_0xcc90('0x59')]){_0x3b9021['push']({'model':db[_0xcc90('0x60')],'as':_0xcc90('0x60'),'raw':!![]});}var _0x1fe834=[{'model':db[_0xcc90('0x3b')],'as':_0xcc90('0x61'),'attributes':['id',_0xcc90('0x36'),'createdAt',_0xcc90('0x62'),_0xcc90('0x63'),_0xcc90('0x64')],'include':_0x3b9021}];_0x1fe834[_0xcc90('0x5a')]({'model':db[_0xcc90('0x65')],'as':_0xcc90('0x66'),'attributes':['id',_0xcc90('0x1c')]});_0x1fe834[_0xcc90('0x5a')]({'model':db[_0xcc90('0x5b')],'as':'Owner','attributes':['id',_0xcc90('0x67')]});return db[_0xcc90('0x1f')]['find']({'where':{'id':_0x5c1e56[_0xcc90('0x27')]['id']},'include':_0x1fe834})[_0xcc90('0x18')](handleEntityNotFound(_0x44afd2,null))[_0xcc90('0x18')](function(_0x5908ec){if(_0x5908ec){var _0x1c188c=_0x5908ec[_0xcc90('0x68')]({'plain':!![]});fs[_0xcc90('0x69')](_0x5962d3);var _0x18bb74={'channel':_0xcc90('0x6a'),'account':_0x1c188c[_0xcc90('0x66')][_0xcc90('0x1c')],'agent':_0x1c188c[_0xcc90('0x6b')]?_0x1c188c[_0xcc90('0x6b')][_0xcc90('0x67')]:_0xcc90('0x6c'),'createdAt':moment(_0x1c188c['createdAt'])[_0xcc90('0x47')](_0xcc90('0x48'))['toString'](),'closedAt':_0x1c188c[_0xcc90('0x6d')]?moment(_0x1c188c[_0xcc90('0x6e')])[_0xcc90('0x47')](_0xcc90('0x48'))[_0xcc90('0x53')]():'','disposition':_0x1c188c[_0xcc90('0x6f')],'visibility':_0x1c188c['threadId']?_0xcc90('0x70'):_0xcc90('0x71'),'messages':_(_0x1c188c[_0xcc90('0x61')])[_0xcc90('0x43')]({'secret':![]})['map'](function(_0x9c0d2d){if(_0x9c0d2d[_0xcc90('0x60')]){var _0x20c009=path[_0xcc90('0x54')](_0x3391aa,_0x9c0d2d[_0xcc90('0x60')][_0xcc90('0x72')]);if(fs[_0xcc90('0x73')](_0x20c009)){fs[_0xcc90('0x74')](_0x20c009)[_0xcc90('0x75')](fs[_0xcc90('0x76')](path[_0xcc90('0x54')](_0x5962d3,_0x9c0d2d[_0xcc90('0x60')][_0xcc90('0x72')])));}}return{'date':moment(_0x9c0d2d['createdAt'])[_0xcc90('0x47')](_0xcc90('0x48'))[_0xcc90('0x53')](),'sender':_0x9c0d2d[_0xcc90('0x62')]===_0xcc90('0x77')?_0x9c0d2d['User']?_0x9c0d2d[_0xcc90('0x5b')][_0xcc90('0x67')]:'System':_0x9c0d2d[_0xcc90('0x5d')][_0xcc90('0x5e')]+(_0x9c0d2d['Contact'][_0xcc90('0x5f')]?'\x20'+_0x9c0d2d[_0xcc90('0x5d')][_0xcc90('0x5f')]:''),'body':_0x9c0d2d[_0xcc90('0x60')]?_0x9c0d2d['Attachment'][_0xcc90('0x72')]:_0x9c0d2d['body'],'direction':_0x9c0d2d[_0xcc90('0x62')]===_0xcc90('0x77')?'A':'C','secret':_0x9c0d2d[_0xcc90('0x63')],'read':_0x9c0d2d[_0xcc90('0x64')],'attachment':_0x9c0d2d['Attachment']};})[_0xcc90('0x78')]()};return ejs['renderFile'](path[_0xcc90('0x54')](config[_0xcc90('0x55')],_0xcc90('0x56'),_0xcc90('0x79'),_0xcc90('0x7a')),{'interaction':_0x18bb74})[_0xcc90('0x18')](function(_0x1e5f8a){var _0x4245dd=path[_0xcc90('0x54')](_0x5962d3,'transcript-'+_0x1c188c['id']+'-'+_0x4b9158+_0xcc90('0x7b'));var _0x430e50={'path':_0x4245dd,'channel':_0xcc90('0x6a'),'interactionId':_0x1c188c['id']};return pdf[_0xcc90('0x7c')](_0x1e5f8a,_0x430e50);})[_0xcc90('0x18')](function(){return new Promise(function(_0x321dfb,_0x11ad3b){zipdir(_0x5962d3,{'saveTo':_0x32779e},function(_0x3a6982,_0x25bb18){if(_0x3a6982)return _0x11ad3b(_0x3a6982);return _0x321dfb(_0x25bb18);});})['then'](function(){return new Promise(function(_0xa455a6,_0xf2c122){rimraf(_0x5962d3,function(_0x18e6eb){if(_0x18e6eb)_0xf2c122(_0x18e6eb);return _0xa455a6();});});})[_0xcc90('0x18')](function(){return _0x44afd2['download'](_0x32779e,_0x159da1,function(_0x5f2beb){if(_0x5f2beb){logger[_0xcc90('0x1a')](_0xcc90('0x7d'),_0x5f2beb);}else{fs[_0xcc90('0x7e')](_0x32779e);}});});});}else{return _0x44afd2[_0xcc90('0x10')](0xc8);}})['catch'](handleError(_0x44afd2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 34c91b3..e46ed2d 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 _0x68f4=['emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','remove','then','Users','map','setDataValue','unreadMessages','length'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0x68f4,0x114));var _0x468f=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x68f4[_0x3fe6df];return _0x372a0e;};'use strict';var EventEmitter=require(_0x468f('0x0'));var OpenchannelInteraction=require(_0x468f('0x1'))['db'][_0x468f('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x468f('0x3')](0x0);var events={'afterCreate':_0x468f('0x4'),'afterUpdate':'update','afterDestroy':_0x468f('0x5')};function emitEvent(_0x38cd14){return function(_0x102c30,_0xd013d6,_0x10090e){_0x102c30['getUsers']({'attributes':['id'],'raw':!![]})[_0x468f('0x6')](function(_0x5c5825){_0x102c30['setDataValue'](_0x468f('0x7'),_0x5c5825[_0x468f('0x8')](function(_0x7153df){return{'id':_0x7153df['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x102c30['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x508900){_0x102c30[_0x468f('0x9')](_0x468f('0xa'),_0x508900[_0x468f('0xb')]);OpenchannelInteractionEvents['emit'](_0x38cd14+':'+_0x102c30['id'],_0x102c30);OpenchannelInteractionEvents[_0x468f('0xc')](_0x38cd14,_0x102c30);_0x10090e(null);})[_0x468f('0xd')](_0x10090e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x468f('0xe')](e,emitEvent(event));}}module[_0x468f('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xab40=['remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x1479f4,_0x1db6a1){var _0x4cf01a=function(_0x2ce6e5){while(--_0x2ce6e5){_0x1479f4['push'](_0x1479f4['shift']());}};_0x4cf01a(++_0x1db6a1);}(_0xab40,0x186));var _0x0ab4=function(_0x1a8f4e,_0x3e5bef){_0x1a8f4e=_0x1a8f4e-0x0;var _0x493c67=_0xab40[_0x1a8f4e];return _0x493c67;};'use strict';var EventEmitter=require(_0x0ab4('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x0ab4('0x1'))['db'][_0x0ab4('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x0ab4('0x3')](0x0);var events={'afterCreate':_0x0ab4('0x4'),'afterUpdate':_0x0ab4('0x5'),'afterDestroy':_0x0ab4('0x6')};function emitEvent(_0x38b4b0){return function(_0x595cdd,_0x27a563,_0x28e19d){_0x595cdd[_0x0ab4('0x7')]({'attributes':['id'],'raw':!![]})[_0x0ab4('0x8')](function(_0x103002){_0x595cdd[_0x0ab4('0x9')](_0x0ab4('0xa'),_0x103002['map'](function(_0x2063af){return{'id':_0x2063af['id']};}));return OpenchannelMessage[_0x0ab4('0xb')]({'where':{'OpenchannelInteractionId':_0x595cdd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ab4('0x8')](function(_0x334b0c){_0x595cdd[_0x0ab4('0x9')](_0x0ab4('0xc'),_0x334b0c[_0x0ab4('0xd')]);OpenchannelInteractionEvents[_0x0ab4('0xe')](_0x38b4b0+':'+_0x595cdd['id'],_0x595cdd);OpenchannelInteractionEvents['emit'](_0x38b4b0,_0x595cdd);_0x28e19d(null);})['catch'](_0x28e19d(null));};}for(var e in events){if(events[_0x0ab4('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x0ab4('0x10')](e,emitEvent(event));}}module[_0x0ab4('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 9a7e64d..b02998e 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 _0x0931=['closedAt','format','lodash','api','request-promise','path','rimraf','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0931,0x16e));var _0x1093=function(_0x1c6622,_0x13a4b6){_0x1c6622=_0x1c6622-0x0;var _0x1ec3bb=_0x0931[_0x1c6622];return _0x1ec3bb;};'use strict';var _=require(_0x1093('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1093('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1093('0x2'));var fs=require('fs');var path=require(_0x1093('0x3'));var rimraf=require(_0x1093('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x1093('0x5')]=function(_0x1ba4b4,_0x68deeb){return _0x1ba4b4[_0x1093('0x6')](_0x1093('0x7'),attributes,{'tableName':_0x1093('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1093('0x9'),'hooks':{'beforeUpdate':function(_0x2f2a31,_0x9fddb5,_0x4936b7){if(_0x2f2a31['changed'](_0x1093('0xa'))){_0x2f2a31[_0x1093('0xb')]=moment()[_0x1093('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4936b7(null,_0x2f2a31);}}});}; \ No newline at end of file +var _0x8675=['path','../../config/environment','./openchannelInteraction.attributes','exports','define','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','../../config/logger','api','bluebird'];(function(_0x512654,_0x3abeee){var _0x2e3a69=function(_0x3ccc0f){while(--_0x3ccc0f){_0x512654['push'](_0x512654['shift']());}};_0x2e3a69(++_0x3abeee);}(_0x8675,0x1ae));var _0x5867=function(_0x39bc4a,_0x595147){_0x39bc4a=_0x39bc4a-0x0;var _0x436b0d=_0x8675[_0x39bc4a];return _0x436b0d;};'use strict';var _=require(_0x5867('0x0'));var util=require(_0x5867('0x1'));var logger=require(_0x5867('0x2'))(_0x5867('0x3'));var moment=require('moment');var BPromise=require(_0x5867('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5867('0x5'));var rimraf=require('rimraf');var config=require(_0x5867('0x6'));var attributes=require(_0x5867('0x7'));module[_0x5867('0x8')]=function(_0x43adca,_0x3e90f5){return _0x43adca[_0x5867('0x9')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5867('0xa'),'hooks':{'beforeUpdate':function(_0x2085c3,_0x37a9d0,_0x2520f0){if(_0x2085c3[_0x5867('0xb')](_0x5867('0xc'))){_0x2085c3[_0x5867('0xd')]=moment()[_0x5867('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2520f0(null,_0x2085c3);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index dea7406..566b869 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 _0x4d73=['catch','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','UpdateOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x4d73,0xf2));var _0x34d7=function(_0x181672,_0x1d614d){_0x181672=_0x181672-0x0;var _0x35100d=_0x4d73[_0x181672];return _0x35100d;};'use strict';var _=require(_0x34d7('0x0'));var util=require(_0x34d7('0x1'));var moment=require(_0x34d7('0x2'));var BPromise=require(_0x34d7('0x3'));var rs=require(_0x34d7('0x4'));var fs=require('fs');var Redis=require(_0x34d7('0x5'));var db=require(_0x34d7('0x6'))['db'];var utils=require(_0x34d7('0x7'));var logger=require(_0x34d7('0x8'))('rpc');var config=require(_0x34d7('0x9'));var jayson=require(_0x34d7('0xa'));var client=jayson['client'][_0x34d7('0xb')]({'port':0x232a});config[_0x34d7('0xc')]=_[_0x34d7('0xd')](config[_0x34d7('0xc')],{'host':_0x34d7('0xe'),'port':0x18eb});var socket=require(_0x34d7('0xf'))(new Redis(config['redis']));require(_0x34d7('0x10'))[_0x34d7('0x11')](socket);function respondWithRpcPromise(_0x2f051f,_0x4760f3,_0x5a96b7){return new BPromise(function(_0x2d4e4e,_0x3973ac){return client[_0x34d7('0x12')](_0x2f051f,_0x5a96b7)[_0x34d7('0x13')](function(_0x526bd2){logger['info'](_0x34d7('0x14'),_0x4760f3,'request\x20sent');logger[_0x34d7('0x15')](_0x34d7('0x16'),_0x4760f3,_0x34d7('0x17'),JSON['stringify'](_0x526bd2));if(_0x526bd2[_0x34d7('0x18')]){if(_0x526bd2[_0x34d7('0x18')][_0x34d7('0x19')]===0x1f4){logger['error'](_0x34d7('0x14'),_0x4760f3,_0x526bd2[_0x34d7('0x18')][_0x34d7('0x1a')]);return _0x3973ac(_0x526bd2['error'][_0x34d7('0x1a')]);}logger[_0x34d7('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4760f3,_0x526bd2['error'][_0x34d7('0x1a')]);return _0x2d4e4e(_0x526bd2[_0x34d7('0x18')][_0x34d7('0x1a')]);}else{logger[_0x34d7('0x1b')](_0x34d7('0x14'),_0x4760f3,_0x34d7('0x17'));_0x2d4e4e(_0x526bd2['result']['message']);}})[_0x34d7('0x1c')](function(_0x5db778){logger[_0x34d7('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4760f3,_0x5db778);_0x3973ac(_0x5db778);});});}exports['UpdateOpenchannelInteraction']=function(_0x441f72){var _0x2646ed=this;return new Promise(function(_0x54b09d,_0x5ac819){return db[_0x34d7('0x1d')][_0x34d7('0x1e')](_0x441f72[_0x34d7('0x1f')],{'raw':_0x441f72['options']?_0x441f72[_0x34d7('0x20')][_0x34d7('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x441f72[_0x34d7('0x20')]?_0x441f72[_0x34d7('0x20')][_0x34d7('0x22')]||null:null,'attributes':_0x441f72[_0x34d7('0x20')]?_0x441f72[_0x34d7('0x20')][_0x34d7('0x23')]||null:null,'limit':_0x441f72['options']?_0x441f72[_0x34d7('0x20')][_0x34d7('0x24')]||null:null})[_0x34d7('0x13')](function(_0x1a16a0){logger[_0x34d7('0x1b')](_0x34d7('0x25'),_0x441f72);logger[_0x34d7('0x15')]('UpdateOpenchannelInteraction',_0x441f72,JSON['stringify'](_0x1a16a0));_0x54b09d(_0x1a16a0);})[_0x34d7('0x1c')](function(_0x6b08aa){logger[_0x34d7('0x18')](_0x34d7('0x25'),_0x6b08aa['message'],_0x441f72);_0x5ac819(_0x2646ed['error'](0x1f4,_0x6b08aa[_0x34d7('0x1a')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x1bc11a){return new Promise(function(_0x5f5213,_0x59b3f0){return db[_0x34d7('0x1d')][_0x34d7('0x26')]({'where':_0x1bc11a[_0x34d7('0x20')]?_0x1bc11a[_0x34d7('0x20')][_0x34d7('0x22')]||null:null})[_0x34d7('0x13')](function(_0x3c87ea){if(_0x3c87ea){return _0x3c87ea[_0x34d7('0x27')](_0x1bc11a[_0x34d7('0x1f')][_0x34d7('0x28')],_[_0x34d7('0x29')](_0x1bc11a[_0x34d7('0x1f')],[_0x34d7('0x28'),'id'])||{});}})[_0x34d7('0x2a')](function(_0x12ee14){logger['info'](_0x34d7('0x2b'),_0x1bc11a);logger[_0x34d7('0x15')](_0x34d7('0x2b'),_0x1bc11a,JSON[_0x34d7('0x2c')](_0x12ee14));_0x5f5213(_0x12ee14);})[_0x34d7('0x1c')](function(_0x236666){logger[_0x34d7('0x18')]('AddTags',_0x236666[_0x34d7('0x1a')],_0x1bc11a);_0x59b3f0(_this[_0x34d7('0x18')](0x1f4,_0x236666['message']));});});}; \ No newline at end of file +var _0xed5c=['rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','limit','catch','AddTagsToOpenchannelInteraction','find','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xed5c,0x162));var _0xced5=function(_0x5b5058,_0xf6c8b3){_0x5b5058=_0x5b5058-0x0;var _0x189ba9=_0xed5c[_0x5b5058];return _0x189ba9;};'use strict';var _=require('lodash');var util=require(_0xced5('0x0'));var moment=require(_0xced5('0x1'));var BPromise=require(_0xced5('0x2'));var rs=require(_0xced5('0x3'));var fs=require('fs');var Redis=require(_0xced5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xced5('0x5'));var logger=require('../../config/logger')(_0xced5('0x6'));var config=require(_0xced5('0x7'));var jayson=require(_0xced5('0x8'));var client=jayson[_0xced5('0x9')][_0xced5('0xa')]({'port':0x232a});config['redis']=_[_0xced5('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xced5('0xc'))(new Redis(config[_0xced5('0xd')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4fe043,_0x1d2afd,_0x3deba0){return new BPromise(function(_0x2e073d,_0x2ea1ad){return client[_0xced5('0xe')](_0x4fe043,_0x3deba0)[_0xced5('0xf')](function(_0x9b35fe){logger[_0xced5('0x10')](_0xced5('0x11'),_0x1d2afd,_0xced5('0x12'));logger[_0xced5('0x13')](_0xced5('0x14'),_0x1d2afd,'request\x20sent',JSON[_0xced5('0x15')](_0x9b35fe));if(_0x9b35fe[_0xced5('0x16')]){if(_0x9b35fe[_0xced5('0x16')][_0xced5('0x17')]===0x1f4){logger[_0xced5('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1d2afd,_0x9b35fe[_0xced5('0x16')]['message']);return _0x2ea1ad(_0x9b35fe['error'][_0xced5('0x18')]);}logger['error'](_0xced5('0x11'),_0x1d2afd,_0x9b35fe[_0xced5('0x16')][_0xced5('0x18')]);return _0x2e073d(_0x9b35fe['error'][_0xced5('0x18')]);}else{logger['info'](_0xced5('0x11'),_0x1d2afd,_0xced5('0x12'));_0x2e073d(_0x9b35fe[_0xced5('0x19')][_0xced5('0x18')]);}})['catch'](function(_0x3f6fd0){logger[_0xced5('0x16')](_0xced5('0x11'),_0x1d2afd,_0x3f6fd0);_0x2ea1ad(_0x3f6fd0);});});}exports[_0xced5('0x1a')]=function(_0x2229f8){var _0x530ec3=this;return new Promise(function(_0x540aef,_0x258fb1){return db[_0xced5('0x1b')][_0xced5('0x1c')](_0x2229f8[_0xced5('0x1d')],{'raw':_0x2229f8[_0xced5('0x1e')]?_0x2229f8[_0xced5('0x1e')][_0xced5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2229f8[_0xced5('0x1e')]?_0x2229f8['options'][_0xced5('0x20')]||null:null,'attributes':_0x2229f8[_0xced5('0x1e')]?_0x2229f8[_0xced5('0x1e')]['attributes']||null:null,'limit':_0x2229f8[_0xced5('0x1e')]?_0x2229f8[_0xced5('0x1e')][_0xced5('0x21')]||null:null})['then'](function(_0x384d02){logger[_0xced5('0x10')](_0xced5('0x1a'),_0x2229f8);logger[_0xced5('0x13')](_0xced5('0x1a'),_0x2229f8,JSON[_0xced5('0x15')](_0x384d02));_0x540aef(_0x384d02);})[_0xced5('0x22')](function(_0x3f952e){logger['error'](_0xced5('0x1a'),_0x3f952e[_0xced5('0x18')],_0x2229f8);_0x258fb1(_0x530ec3[_0xced5('0x16')](0x1f4,_0x3f952e[_0xced5('0x18')]));});});};exports[_0xced5('0x23')]=function(_0x52b794){return new Promise(function(_0x23c78f,_0x2341be){return db[_0xced5('0x1b')][_0xced5('0x24')]({'where':_0x52b794['options']?_0x52b794['options'][_0xced5('0x20')]||null:null})[_0xced5('0xf')](function(_0xb2d7e5){if(_0xb2d7e5){return _0xb2d7e5['addTags'](_0x52b794[_0xced5('0x1d')][_0xced5('0x25')],_['omit'](_0x52b794['body'],['ids','id'])||{});}})[_0xced5('0x26')](function(_0x477207){logger[_0xced5('0x10')](_0xced5('0x27'),_0x52b794);logger['debug'](_0xced5('0x27'),_0x52b794,JSON['stringify'](_0x477207));_0x23c78f(_0x477207);})[_0xced5('0x22')](function(_0x368fad){logger[_0xced5('0x16')](_0xced5('0x27'),_0x368fad[_0xced5('0x18')],_0x52b794);_0x2341be(_this[_0xced5('0x16')](0x1f4,_0x368fad[_0xced5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 3b8c10d..bc6e4e7 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 _0xef6e=['remove','update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xef6e,0xee));var _0xeef6=function(_0xad5769,_0x2530ca){_0xad5769=_0xad5769-0x0;var _0x476fed=_0xef6e[_0xad5769];return _0x476fed;};'use strict';var OpenchannelInteractionEvents=require(_0xeef6('0x0'));var events=[_0xeef6('0x1'),_0xeef6('0x2'),_0xeef6('0x3')];function createListener(_0x578cd6,_0x2bac83){return function(_0x4de7cb){_0x2bac83[_0xeef6('0x4')](_0x578cd6,_0x4de7cb);};}function removeListener(_0x396901,_0x121145){return function(){OpenchannelInteractionEvents['removeListener'](_0x396901,_0x121145);};}exports[_0xeef6('0x5')]=function(_0x519698){for(var _0x3365c8=0x0,_0x1fcfad=events[_0xeef6('0x6')];_0x3365c8<_0x1fcfad;_0x3365c8++){var _0x193cbd=events[_0x3365c8];var _0xcb6d4=createListener(_0xeef6('0x7')+_0x193cbd,_0x519698);OpenchannelInteractionEvents['on'](_0x193cbd,_0xcb6d4);}}; \ No newline at end of file +var _0xf8f6=['register','length','openchannelInteraction:','./openchannelInteraction.events','save','emit'];(function(_0x14712f,_0x52f18b){var _0x269303=function(_0x5885d7){while(--_0x5885d7){_0x14712f['push'](_0x14712f['shift']());}};_0x269303(++_0x52f18b);}(_0xf8f6,0x1d7));var _0x6f8f=function(_0x3bea3c,_0x1b509f){_0x3bea3c=_0x3bea3c-0x0;var _0x5935d2=_0xf8f6[_0x3bea3c];return _0x5935d2;};'use strict';var OpenchannelInteractionEvents=require(_0x6f8f('0x0'));var events=[_0x6f8f('0x1'),'remove','update'];function createListener(_0xe7dd3d,_0x577410){return function(_0x46a626){_0x577410[_0x6f8f('0x2')](_0xe7dd3d,_0x46a626);};}function removeListener(_0xa988ba,_0x1761aa){return function(){OpenchannelInteractionEvents['removeListener'](_0xa988ba,_0x1761aa);};}exports[_0x6f8f('0x3')]=function(_0x1884ee){for(var _0x1944da=0x0,_0x151a28=events[_0x6f8f('0x4')];_0x1944da<_0x151a28;_0x1944da++){var _0x194b5f=events[_0x1944da];var _0x5f2416=createListener(_0x6f8f('0x5')+_0x194b5f,_0x1884ee);OpenchannelInteractionEvents['on'](_0x194b5f,_0x5f2416);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index edcd787..af0324a 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x3564d8,_0x167f6d){var _0x14fbcc=function(_0x299432){while(--_0x299432){_0x3564d8['push'](_0x3564d8['shift']());}};_0x14fbcc(++_0x167f6d);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'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');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=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(_0x5f3d7e,_0x40bf7b){var _0x1a4919=function(_0x171dd4){while(--_0x171dd4){_0x5f3d7e['push'](_0x5f3d7e['shift']());}};_0x1a4919(++_0x40bf7b);}(_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('./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 460567f..f5aee15 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 _0x566f=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x16bd14,_0x214dfd){var _0x496083=function(_0x36e630){while(--_0x36e630){_0x16bd14['push'](_0x16bd14['shift']());}};_0x496083(++_0x214dfd);}(_0x566f,0x124));var _0xf566=function(_0x5f2b47,_0x19e1e7){_0x5f2b47=_0x5f2b47-0x0;var _0x2fcf51=_0x566f[_0x5f2b47];return _0x2fcf51;};'use strict';var Sequelize=require(_0xf566('0x0'));module[_0xf566('0x1')]={'body':{'type':Sequelize[_0xf566('0x2')](_0xf566('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf566('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf566('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf566('0x5')]('in',_0xf566('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xf566('0x7')]},'providerName':{'type':Sequelize[_0xf566('0x8')]},'providerResponse':{'type':Sequelize[_0xf566('0x2')]}}; \ No newline at end of file +var _0x915a=['DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3c155f,_0x193642){var _0x4ba095=function(_0x2260ef){while(--_0x2260ef){_0x3c155f['push'](_0x3c155f['shift']());}};_0x4ba095(++_0x193642);}(_0x915a,0x1d2));var _0xa915=function(_0xe295bf,_0x456157){_0xe295bf=_0xe295bf-0x0;var _0xc419fa=_0x915a[_0xe295bf];return _0xc419fa;};'use strict';var Sequelize=require(_0xa915('0x0'));module[_0xa915('0x1')]={'body':{'type':Sequelize[_0xa915('0x2')](_0xa915('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa915('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa915('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xa915('0x6')]},'providerName':{'type':Sequelize[_0xa915('0x7')]},'providerResponse':{'type':Sequelize[_0xa915('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index a60c1b7..2ce666d 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 _0x3955=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','request','info','OpenchannelMessage,\x20%s,\x20%s','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','undefined','offset','count','limit','Content-Range','apply','save','update','destroy','then','sendStatus','stack','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','name','filter','includeAll','include','findAll','rows','catch','show','params','length','merge','options','find','body','describe','../../config/logger','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteractionId','isNil','interaction','[OPENCHANNELMESSAGE: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','contact','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','reject','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','SIP/%s','eml-format','zip-dir','request-promise','moment','bluebird','path','sox'];(function(_0x3c2b87,_0x50248e){var _0x246d3a=function(_0x49fb59){while(--_0x49fb59){_0x3c2b87['push'](_0x3c2b87['shift']());}};_0x246d3a(++_0x50248e);}(_0x3955,0x7b));var _0x5395=function(_0x425617,_0x3c4e5f){_0x425617=_0x425617-0x0;var _0x3f636e=_0x3955[_0x425617];return _0x3f636e;};'use strict';var emlformat=require(_0x5395('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5395('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5395('0x2'));var moment=require(_0x5395('0x3'));var BPromise=require(_0x5395('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5395('0x5'));var sox=require(_0x5395('0x6'));var csv=require(_0x5395('0x7'));var ejs=require(_0x5395('0x8'));var fs=require('fs');var fs_extra=require(_0x5395('0x9'));var _=require(_0x5395('0xa'));var squel=require('squel');var crypto=require(_0x5395('0xb'));var jsforce=require(_0x5395('0xc'));var deskjs=require(_0x5395('0xd'));var toCsv=require(_0x5395('0x7'));var querystring=require('querystring');var Papa=require(_0x5395('0xe'));var Redis=require(_0x5395('0xf'));var authService=require(_0x5395('0x10'));var qs=require(_0x5395('0x11'));var as=require(_0x5395('0x12'));var hardwareService=require(_0x5395('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5395('0x14'));var config=require(_0x5395('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5395('0x16'))['db'];config['redis']=_[_0x5395('0x17')](config[_0x5395('0x18')],{'host':_0x5395('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5395('0x18')]));require(_0x5395('0x1a'))[_0x5395('0x1b')](socket);var jayson=require(_0x5395('0x1c'));var client=jayson[_0x5395('0x1d')][_0x5395('0x1e')]({'port':0x232c});var client9002=jayson[_0x5395('0x1d')][_0x5395('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3fe73e,_0x2206fa,_0x59e08e,_0x50d141){return new BPromise(function(_0x186918,_0x5c094b){var _0x5d7c0c=_0x50d141||client;return _0x5d7c0c[_0x5395('0x1f')](_0x3fe73e,_0x59e08e)['then'](function(_0x3dbd7c){logger[_0x5395('0x20')](_0x5395('0x21'),_0x2206fa,'request\x20sent');logger['debug'](_0x5395('0x22'),_0x2206fa,_0x5395('0x23'),JSON[_0x5395('0x24')](_0x3dbd7c));if(_0x3dbd7c[_0x5395('0x25')]){if(_0x3dbd7c['error'][_0x5395('0x26')]===0x1f4){logger[_0x5395('0x25')](_0x5395('0x21'),_0x2206fa,_0x3dbd7c['error'][_0x5395('0x27')]);return _0x5c094b(_0x3dbd7c[_0x5395('0x25')][_0x5395('0x27')]);}logger[_0x5395('0x25')](_0x5395('0x21'),_0x2206fa,_0x3dbd7c[_0x5395('0x25')][_0x5395('0x27')]);return _0x186918(_0x3dbd7c['error'][_0x5395('0x27')]);}else{logger['info'](_0x5395('0x21'),_0x2206fa,_0x5395('0x23'));_0x186918(_0x3dbd7c['result']['message']);}})['catch'](function(_0x44a40c){logger[_0x5395('0x25')](_0x5395('0x21'),_0x2206fa,_0x44a40c);_0x5c094b(_0x44a40c);});});}function respondWithStatusCode(_0x4416fe,_0x199c83){_0x199c83=_0x199c83||0xcc;return function(_0x4e35b2){if(_0x4e35b2){return _0x4416fe['sendStatus'](_0x199c83);}return _0x4416fe[_0x5395('0x28')](_0x199c83)[_0x5395('0x29')]();};}function respondWithResult(_0x1e0dcd,_0x16fed7){_0x16fed7=_0x16fed7||0xc8;return function(_0x39224e){if(_0x39224e){return _0x1e0dcd['status'](_0x16fed7)[_0x5395('0x2a')](_0x39224e);}};}function respondWithFilteredResult(_0x5be66b,_0x1278ca){return function(_0x45b3d5){if(_0x45b3d5){var _0x20b175=typeof _0x1278ca['offset']==='undefined'&&typeof _0x1278ca['limit']===_0x5395('0x2b');var _0x5d44f5=_0x45b3d5['count'];var _0x341d2f=_0x20b175?0x0:_0x1278ca[_0x5395('0x2c')];var _0x45e7a2=_0x20b175?_0x45b3d5[_0x5395('0x2d')]:_0x1278ca[_0x5395('0x2c')]+_0x1278ca[_0x5395('0x2e')];var _0x1d5e7d;if(_0x45e7a2>=_0x5d44f5){_0x45e7a2=_0x5d44f5;_0x1d5e7d=0xc8;}else{_0x1d5e7d=0xce;}_0x5be66b[_0x5395('0x28')](_0x1d5e7d);return _0x5be66b['set'](_0x5395('0x2f'),_0x341d2f+'-'+_0x45e7a2+'/'+_0x5d44f5)['json'](_0x45b3d5);}return null;};}function patchUpdates(_0x877ce2){return function(_0x414a0a){try{jsonpatch[_0x5395('0x30')](_0x414a0a,_0x877ce2,!![]);}catch(_0x43dd48){return BPromise['reject'](_0x43dd48);}return _0x414a0a[_0x5395('0x31')]();};}function saveUpdates(_0x47c4f3,_0x21caca){return function(_0x44d582){if(_0x44d582){return _0x44d582[_0x5395('0x32')](_0x47c4f3)['then'](function(_0x28cc00){return _0x28cc00;});}return null;};}function removeEntity(_0x1ef767,_0xa69928){return function(_0x52e297){if(_0x52e297){return _0x52e297[_0x5395('0x33')]()[_0x5395('0x34')](function(){_0x1ef767[_0x5395('0x28')](0xcc)[_0x5395('0x29')]();});}};}function handleEntityNotFound(_0x8ce67a,_0xa30249){return function(_0x42ebb4){if(!_0x42ebb4){_0x8ce67a[_0x5395('0x35')](0x194);}return _0x42ebb4;};}function handleError(_0x30dc2e,_0x57e661){_0x57e661=_0x57e661||0x1f4;return function(_0x1a843a){logger['error'](_0x1a843a[_0x5395('0x36')]);if(_0x1a843a['name']){delete _0x1a843a['name'];}_0x30dc2e[_0x5395('0x28')](_0x57e661)[_0x5395('0x37')](_0x1a843a);};}exports[_0x5395('0x38')]=function(_0x58f537,_0x5a0098){var _0x3c51d2={},_0x32232a={},_0xc68f57={'count':0x0,'rows':[]};var _0x5f4750=_[_0x5395('0x39')](db[_0x5395('0x3a')][_0x5395('0x3b')],function(_0x12e86f){return{'name':_0x12e86f['fieldName'],'type':_0x12e86f[_0x5395('0x3c')][_0x5395('0x3d')]};});_0x32232a[_0x5395('0x3e')]=_[_0x5395('0x39')](_0x5f4750,'name');_0x32232a[_0x5395('0x3f')]=_[_0x5395('0x40')](_0x58f537[_0x5395('0x3f')]);_0x32232a[_0x5395('0x41')]=_[_0x5395('0x42')](_0x32232a[_0x5395('0x3e')],_0x32232a[_0x5395('0x3f')]);_0x3c51d2[_0x5395('0x43')]=_[_0x5395('0x42')](_0x32232a[_0x5395('0x3e')],qs[_0x5395('0x44')](_0x58f537[_0x5395('0x3f')]['fields']));_0x3c51d2[_0x5395('0x43')]=_0x3c51d2[_0x5395('0x43')]['length']?_0x3c51d2[_0x5395('0x43')]:_0x32232a[_0x5395('0x3e')];if(!_0x58f537[_0x5395('0x3f')][_0x5395('0x45')]('nolimit')){_0x3c51d2[_0x5395('0x2e')]=qs[_0x5395('0x2e')](_0x58f537[_0x5395('0x3f')][_0x5395('0x2e')]);_0x3c51d2[_0x5395('0x2c')]=qs[_0x5395('0x2c')](_0x58f537[_0x5395('0x3f')]['offset']);}_0x3c51d2[_0x5395('0x46')]=qs[_0x5395('0x47')](_0x58f537[_0x5395('0x3f')]['sort']);_0x3c51d2[_0x5395('0x48')]=qs[_0x5395('0x41')](_[_0x5395('0x49')](_0x58f537['query'],_0x32232a[_0x5395('0x41')]),_0x5f4750);if(_0x58f537[_0x5395('0x3f')]['filter']){_0x3c51d2[_0x5395('0x48')]=_['merge'](_0x3c51d2[_0x5395('0x48')],{'$or':_[_0x5395('0x39')](_0x5f4750,function(_0x2c903a){if(_0x2c903a[_0x5395('0x3c')]!==_0x5395('0x4a')){var _0x190b4f={};_0x190b4f[_0x2c903a[_0x5395('0x4b')]]={'$like':'%'+_0x58f537[_0x5395('0x3f')][_0x5395('0x4c')]+'%'};return _0x190b4f;}})});}_0x3c51d2=_['merge']({},_0x3c51d2,_0x58f537['options']);var _0x2b610d={'where':_0x3c51d2[_0x5395('0x48')]};return db['OpenchannelMessage']['count'](_0x2b610d)[_0x5395('0x34')](function(_0x26eb51){_0xc68f57['count']=_0x26eb51;if(_0x58f537[_0x5395('0x3f')][_0x5395('0x4d')]){_0x3c51d2[_0x5395('0x4e')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x5395('0x4f')](_0x3c51d2);})[_0x5395('0x34')](function(_0x1304da){_0xc68f57[_0x5395('0x50')]=_0x1304da;return _0xc68f57;})[_0x5395('0x34')](respondWithFilteredResult(_0x5a0098,_0x3c51d2))[_0x5395('0x51')](handleError(_0x5a0098,null));};exports[_0x5395('0x52')]=function(_0xbfc438,_0x329867){var _0x33435f={'raw':!![],'where':{'id':_0xbfc438[_0x5395('0x53')]['id']}},_0x9fd28f={};_0x9fd28f['model']=_[_0x5395('0x40')](db[_0x5395('0x3a')][_0x5395('0x3b')]);_0x9fd28f['query']=_[_0x5395('0x40')](_0xbfc438['query']);_0x9fd28f[_0x5395('0x41')]=_[_0x5395('0x42')](_0x9fd28f[_0x5395('0x3e')],_0x9fd28f[_0x5395('0x3f')]);_0x33435f['attributes']=_[_0x5395('0x42')](_0x9fd28f['model'],qs[_0x5395('0x44')](_0xbfc438[_0x5395('0x3f')][_0x5395('0x44')]));_0x33435f[_0x5395('0x43')]=_0x33435f['attributes'][_0x5395('0x54')]?_0x33435f[_0x5395('0x43')]:_0x9fd28f[_0x5395('0x3e')];if(_0xbfc438['query'][_0x5395('0x4d')]){_0x33435f[_0x5395('0x4e')]=[{'all':!![]}];}_0x33435f=_[_0x5395('0x55')]({},_0x33435f,_0xbfc438[_0x5395('0x56')]);return db[_0x5395('0x3a')][_0x5395('0x57')](_0x33435f)[_0x5395('0x34')](handleEntityNotFound(_0x329867,null))['then'](respondWithResult(_0x329867,null))[_0x5395('0x51')](handleError(_0x329867,null));};exports['create']=function(_0x57f050,_0x2ab0c3){return db['OpenchannelMessage']['create'](_0x57f050[_0x5395('0x58')],{})[_0x5395('0x34')](respondWithResult(_0x2ab0c3,0xc9))[_0x5395('0x51')](handleError(_0x2ab0c3,null));};exports[_0x5395('0x32')]=function(_0x32875b,_0x382fb0){if(_0x32875b[_0x5395('0x58')]['id']){delete _0x32875b[_0x5395('0x58')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x32875b[_0x5395('0x53')]['id']}})[_0x5395('0x34')](handleEntityNotFound(_0x382fb0,null))[_0x5395('0x34')](saveUpdates(_0x32875b[_0x5395('0x58')],null))['then'](respondWithResult(_0x382fb0,null))[_0x5395('0x51')](handleError(_0x382fb0,null));};exports[_0x5395('0x33')]=function(_0x14f0a8,_0x1822e7){return db[_0x5395('0x3a')][_0x5395('0x57')]({'where':{'id':_0x14f0a8[_0x5395('0x53')]['id']}})['then'](handleEntityNotFound(_0x1822e7,null))['then'](removeEntity(_0x1822e7,null))[_0x5395('0x51')](handleError(_0x1822e7,null));};exports[_0x5395('0x59')]=function(_0x4841e0,_0x49a200){return db[_0x5395('0x3a')]['describe']()['then'](respondWithResult(_0x49a200,null))[_0x5395('0x51')](handleError(_0x49a200,null));};var interaction_log=require(_0x5395('0x5a'))(_0x5395('0x5b'));exports['accept']=function(_0x504cb1,_0x4f1430,_0x39c511){var _0x570f44={'agent':{},'channel':_0x5395('0x5c')};if(_0x504cb1[_0x5395('0x58')]['id']){delete _0x504cb1['body']['id'];}_0x504cb1['body']['read']=!![];_0x504cb1[_0x5395('0x58')][_0x5395('0x5d')]=moment()[_0x5395('0x5e')](_0x5395('0x5f'));_0x504cb1[_0x5395('0x58')][_0x5395('0x60')]=_0x504cb1[_0x5395('0x58')][_0x5395('0x60')]||_0x504cb1[_0x5395('0x61')]['id'];_0x570f44[_0x5395('0x62')]['id']=_0x504cb1[_0x5395('0x58')][_0x5395('0x60')];return db[_0x5395('0x3a')][_0x5395('0x57')]({'where':{'id':_0x504cb1[_0x5395('0x53')]['id'],'UserId':null}})[_0x5395('0x34')](handleEntityNotFound(_0x4f1430,null))['then'](saveUpdates(_0x504cb1[_0x5395('0x58')],null))[_0x5395('0x34')](function(_0x3d66f6){if(_0x3d66f6){_0x570f44[_0x5395('0x27')]=_0x3d66f6[_0x5395('0x63')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x3d66f6[_0x5395('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x4f1430,null))[_0x5395('0x34')](function(_0x3b1f7f){if(_0x3b1f7f){return _0x3b1f7f[_0x5395('0x32')]({'UserId':_0x504cb1[_0x5395('0x58')][_0x5395('0x60')],'read1stAt':_[_0x5395('0x65')](_0x3b1f7f['read1stAt'])?moment()[_0x5395('0x5e')](_0x5395('0x5f')):undefined});}return null;})[_0x5395('0x34')](function(_0x3dbdfb){if(_0x3dbdfb){_0x570f44[_0x5395('0x66')]=_0x3dbdfb[_0x5395('0x63')]({'plain':!![]});interaction_log['info'](_0x5395('0x67'),_0x504cb1[_0x5395('0x61')]['id'],_0x504cb1[_0x5395('0x61')][_0x5395('0x4b')],_0x504cb1[_0x5395('0x61')][_0x5395('0x68')],_0x570f44[_0x5395('0x66')]['id'],_0x504cb1[_0x5395('0x58')]?JSON[_0x5395('0x24')](_0x504cb1[_0x5395('0x58')]):_0x5395('0x69'));return respondWithRpcPromise(_0x5395('0x6a'),_0x5395('0x6b'),_0x570f44);}return null;})['then'](function(_0x5d2bd6){var _0x47a7db=_0x5395('0x6c')+_0x5d2bd6[_0x5395('0x27')]['ContactId'];return db[_0x5395('0x6d')]['query'](_0x47a7db,{'type':db[_0x5395('0x6e')][_0x5395('0x6f')][_0x5395('0x70')],'raw':!![]})[_0x5395('0x34')](function(_0x4e5633){return _0x4e5633;});})[_0x5395('0x34')](function(_0x42ef9c){if(_0x42ef9c){_0x570f44[_0x5395('0x27')][_0x5395('0x71')]=_0x42ef9c[0x0];if(!_0x504cb1[_0x5395('0x58')][_0x5395('0x60')])return;return db[_0x5395('0x72')][_0x5395('0x57')]({'where':{'id':_0x504cb1[_0x5395('0x58')][_0x5395('0x60')],'role':_0x5395('0x62')},'attributes':['id',_0x5395('0x4b'),_0x5395('0x73'),_0x5395('0x74'),_0x5395('0x75')],'raw':!![]});}return null;})[_0x5395('0x34')](function(_0x59778b){if(!_0x59778b)return null;_0x570f44['message']['agent']=_0x59778b;return _0x570f44;})[_0x5395('0x34')](function(_0x9f1f28){if(_0x9f1f28){if(_0x504cb1[_0x5395('0x58')][_0x5395('0x76')]){_0x570f44[_0x5395('0x27')]['interface']=util[_0x5395('0x5e')]('SIP/%s',_0x504cb1['user']['name']);_0x570f44['message'][_0x5395('0x77')]=_0x570f44['channel'];_0x570f44[_0x5395('0x27')][_0x5395('0x78')]=_0x570f44[_0x5395('0x77')];_0x570f44['message'][_0x5395('0x79')]='accept';return respondWithRpcPromise(_0x5395('0x7a'),_0x5395('0x7a'),{'event':_0x5395('0x7b'),'message':_0x570f44[_0x5395('0x27')]},client9002)[_0x5395('0x34')](function(){return _0x570f44;});}return _0x570f44;}return null;})[_0x5395('0x34')](respondWithResult(_0x4f1430,null))[_0x5395('0x51')](handleError(_0x4f1430,null));};var interaction_log=require('../../config/logger')(_0x5395('0x5b'));exports[_0x5395('0x7c')]=function(_0x10ee5b,_0x3a4b8f,_0x30e722){var _0x365ff6={'agent':{},'channel':_0x5395('0x5c')};if(_0x10ee5b[_0x5395('0x58')]['id']){delete _0x10ee5b[_0x5395('0x58')]['id'];}_0x10ee5b['body'][_0x5395('0x60')]=_0x10ee5b[_0x5395('0x58')][_0x5395('0x60')]||_0x10ee5b['user']['id'];_0x365ff6[_0x5395('0x62')]['id']=_0x10ee5b[_0x5395('0x58')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x10ee5b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a4b8f,null))[_0x5395('0x34')](function(_0x5951af){if(_0x5951af){_0x365ff6[_0x5395('0x27')]=_0x5951af['get']({'plain':!![]});return db[_0x5395('0x7d')]['find']({'where':{'id':_0x5951af[_0x5395('0x64')]}});}return null;})[_0x5395('0x34')](handleEntityNotFound(_0x3a4b8f,null))[_0x5395('0x34')](function(_0x2d1c7f){if(_0x2d1c7f){_0x365ff6[_0x5395('0x66')]=_0x2d1c7f[_0x5395('0x63')]({'plain':!![]});interaction_log[_0x5395('0x20')](_0x5395('0x7e'),_0x10ee5b[_0x5395('0x61')]['id'],_0x10ee5b['user'][_0x5395('0x4b')],_0x10ee5b[_0x5395('0x61')][_0x5395('0x68')],_0x365ff6[_0x5395('0x66')]['id'],_0x10ee5b['body']?JSON[_0x5395('0x24')](_0x10ee5b['body']):_0x5395('0x69'));return respondWithRpcPromise(_0x5395('0x7f'),'rejectMessage',_0x365ff6);}return null;})[_0x5395('0x34')](function(_0x12e155){var _0x1395c6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12e155[_0x5395('0x27')][_0x5395('0x80')];return db['sequelize']['query'](_0x1395c6,{'type':db[_0x5395('0x6e')][_0x5395('0x6f')][_0x5395('0x70')],'raw':!![]})['then'](function(_0x4166f2){return _0x4166f2;});})[_0x5395('0x34')](function(_0x13d065){if(_0x13d065){_0x365ff6[_0x5395('0x27')][_0x5395('0x71')]=_0x13d065[0x0];if(!_0x10ee5b[_0x5395('0x58')][_0x5395('0x60')])return;return db[_0x5395('0x72')][_0x5395('0x57')]({'where':{'id':_0x10ee5b[_0x5395('0x58')][_0x5395('0x60')],'role':_0x5395('0x62')},'attributes':['id',_0x5395('0x4b'),_0x5395('0x73'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x371031){if(!_0x371031)return null;_0x365ff6[_0x5395('0x27')][_0x5395('0x62')]=_0x371031;return _0x365ff6;})[_0x5395('0x34')](function(_0x3e4e23){if(_0x3e4e23){_0x3e4e23[_0x5395('0x27')]['interface']=util[_0x5395('0x5e')](_0x5395('0x81'),_0x10ee5b[_0x5395('0x61')]['name']);_0x3e4e23[_0x5395('0x27')][_0x5395('0x77')]=_0x365ff6[_0x5395('0x77')];_0x3e4e23[_0x5395('0x27')][_0x5395('0x78')]=_0x365ff6[_0x5395('0x77')];_0x3e4e23[_0x5395('0x27')][_0x5395('0x79')]='reject';respondWithRpcPromise('EventManager',_0x5395('0x7a'),{'event':'rejectmessage','message':_0x3e4e23[_0x5395('0x27')]},client9002);return _0x365ff6;}return null;})[_0x5395('0x34')](respondWithResult(_0x3a4b8f,null))[_0x5395('0x51')](handleError(_0x3a4b8f,null));}; \ No newline at end of file +var _0x36b2=['api','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','register','jayson/promise','client','http','then','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','nolimit','sort','where','pick','VIRTUAL','filter','options','count','include','findAll','keys','length','merge','find','create','body','params','describe','openchannel-interactions','accept','openchannel','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','role','AcceptMessage','sequelize','Sequelize','SELECT','User','fullname','email','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','stringify','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','internal','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3f6910,_0x285aa5){var _0x12c29a=function(_0x5ab272){while(--_0x5ab272){_0x3f6910['push'](_0x3f6910['shift']());}};_0x12c29a(++_0x285aa5);}(_0x36b2,0x6b));var _0x236b=function(_0x2c4287,_0x11b7fe){_0x2c4287=_0x2c4287-0x0;var _0xa177a9=_0x36b2[_0x2c4287];return _0xa177a9;};'use strict';var emlformat=require(_0x236b('0x0'));var rimraf=require(_0x236b('0x1'));var zipdir=require(_0x236b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x236b('0x3'));var moment=require(_0x236b('0x4'));var BPromise=require(_0x236b('0x5'));var Mustache=require('mustache');var util=require(_0x236b('0x6'));var path=require(_0x236b('0x7'));var sox=require('sox');var csv=require(_0x236b('0x8'));var ejs=require(_0x236b('0x9'));var fs=require('fs');var fs_extra=require(_0x236b('0xa'));var _=require(_0x236b('0xb'));var squel=require(_0x236b('0xc'));var crypto=require(_0x236b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x236b('0xe'));var toCsv=require(_0x236b('0x8'));var querystring=require(_0x236b('0xf'));var Papa=require(_0x236b('0x10'));var Redis=require('ioredis');var authService=require(_0x236b('0x11'));var qs=require(_0x236b('0x12'));var as=require(_0x236b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x236b('0x14'))(_0x236b('0x15'));var utils=require(_0x236b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x236b('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x236b('0x18')](config['redis'],{'host':_0x236b('0x19'),'port':0x18eb});var socket=require(_0x236b('0x1a'))(new Redis(config[_0x236b('0x1b')]));require(_0x236b('0x1c'))[_0x236b('0x1d')](socket);var jayson=require(_0x236b('0x1e'));var client=jayson[_0x236b('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x236b('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x13248a,_0x258935,_0x1436f2,_0x20bdbd){return new BPromise(function(_0x4f0152,_0x4e54c2){var _0xab13f4=_0x20bdbd||client;return _0xab13f4['request'](_0x13248a,_0x1436f2)[_0x236b('0x21')](function(_0x183191){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x258935,_0x236b('0x22'));logger['debug'](_0x236b('0x23'),_0x258935,'request\x20sent',JSON['stringify'](_0x183191));if(_0x183191[_0x236b('0x24')]){if(_0x183191[_0x236b('0x24')][_0x236b('0x25')]===0x1f4){logger[_0x236b('0x24')](_0x236b('0x26'),_0x258935,_0x183191[_0x236b('0x24')][_0x236b('0x27')]);return _0x4e54c2(_0x183191[_0x236b('0x24')][_0x236b('0x27')]);}logger[_0x236b('0x24')](_0x236b('0x26'),_0x258935,_0x183191[_0x236b('0x24')]['message']);return _0x4f0152(_0x183191[_0x236b('0x24')][_0x236b('0x27')]);}else{logger['info'](_0x236b('0x26'),_0x258935,_0x236b('0x22'));_0x4f0152(_0x183191[_0x236b('0x28')]['message']);}})[_0x236b('0x29')](function(_0x1617f8){logger[_0x236b('0x24')](_0x236b('0x26'),_0x258935,_0x1617f8);_0x4e54c2(_0x1617f8);});});}function respondWithStatusCode(_0x198fba,_0x29e0ec){_0x29e0ec=_0x29e0ec||0xcc;return function(_0x9702b2){if(_0x9702b2){return _0x198fba['sendStatus'](_0x29e0ec);}return _0x198fba[_0x236b('0x2a')](_0x29e0ec)[_0x236b('0x2b')]();};}function respondWithResult(_0xe73dbc,_0x462eea){_0x462eea=_0x462eea||0xc8;return function(_0x8ef628){if(_0x8ef628){return _0xe73dbc[_0x236b('0x2a')](_0x462eea)[_0x236b('0x2c')](_0x8ef628);}};}function respondWithFilteredResult(_0x1b5a50,_0x1de15f){return function(_0x2e7fc5){if(_0x2e7fc5){var _0x15a520=typeof _0x1de15f[_0x236b('0x2d')]===_0x236b('0x2e')&&typeof _0x1de15f[_0x236b('0x2f')]===_0x236b('0x2e');var _0x1ba9bf=_0x2e7fc5['count'];var _0x1795cc=_0x15a520?0x0:_0x1de15f[_0x236b('0x2d')];var _0x3d18b7=_0x15a520?_0x2e7fc5['count']:_0x1de15f[_0x236b('0x2d')]+_0x1de15f[_0x236b('0x2f')];var _0x292a33;if(_0x3d18b7>=_0x1ba9bf){_0x3d18b7=_0x1ba9bf;_0x292a33=0xc8;}else{_0x292a33=0xce;}_0x1b5a50[_0x236b('0x2a')](_0x292a33);return _0x1b5a50[_0x236b('0x30')](_0x236b('0x31'),_0x1795cc+'-'+_0x3d18b7+'/'+_0x1ba9bf)[_0x236b('0x2c')](_0x2e7fc5);}return null;};}function patchUpdates(_0x34317e){return function(_0x32fee6){try{jsonpatch[_0x236b('0x32')](_0x32fee6,_0x34317e,!![]);}catch(_0x2ed529){return BPromise[_0x236b('0x33')](_0x2ed529);}return _0x32fee6[_0x236b('0x34')]();};}function saveUpdates(_0x3e5910,_0x146f6a){return function(_0x5d129a){if(_0x5d129a){return _0x5d129a[_0x236b('0x35')](_0x3e5910)['then'](function(_0x53a906){return _0x53a906;});}return null;};}function removeEntity(_0x14f700,_0x9391b1){return function(_0x11806d){if(_0x11806d){return _0x11806d[_0x236b('0x36')]()[_0x236b('0x21')](function(){_0x14f700[_0x236b('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x218762,_0x560089){return function(_0x563a29){if(!_0x563a29){_0x218762[_0x236b('0x37')](0x194);}return _0x563a29;};}function handleError(_0x40adf4,_0x3aa16b){_0x3aa16b=_0x3aa16b||0x1f4;return function(_0x38664d){logger[_0x236b('0x24')](_0x38664d['stack']);if(_0x38664d[_0x236b('0x38')]){delete _0x38664d[_0x236b('0x38')];}_0x40adf4[_0x236b('0x2a')](_0x3aa16b)[_0x236b('0x39')](_0x38664d);};}exports[_0x236b('0x3a')]=function(_0x34ee17,_0x2e96ac){var _0x45d1c8={},_0x362cb7={},_0x3c80cc={'count':0x0,'rows':[]};var _0x19d202=_[_0x236b('0x3b')](db[_0x236b('0x3c')][_0x236b('0x3d')],function(_0x2423e5){return{'name':_0x2423e5[_0x236b('0x3e')],'type':_0x2423e5[_0x236b('0x3f')][_0x236b('0x40')]};});_0x362cb7[_0x236b('0x41')]=_[_0x236b('0x3b')](_0x19d202,_0x236b('0x38'));_0x362cb7['query']=_['keys'](_0x34ee17['query']);_0x362cb7[_0x236b('0x42')]=_[_0x236b('0x43')](_0x362cb7[_0x236b('0x41')],_0x362cb7[_0x236b('0x44')]);_0x45d1c8[_0x236b('0x45')]=_[_0x236b('0x43')](_0x362cb7[_0x236b('0x41')],qs[_0x236b('0x46')](_0x34ee17[_0x236b('0x44')][_0x236b('0x46')]));_0x45d1c8['attributes']=_0x45d1c8[_0x236b('0x45')]['length']?_0x45d1c8[_0x236b('0x45')]:_0x362cb7['model'];if(!_0x34ee17[_0x236b('0x44')]['hasOwnProperty'](_0x236b('0x47'))){_0x45d1c8[_0x236b('0x2f')]=qs[_0x236b('0x2f')](_0x34ee17[_0x236b('0x44')][_0x236b('0x2f')]);_0x45d1c8['offset']=qs[_0x236b('0x2d')](_0x34ee17['query'][_0x236b('0x2d')]);}_0x45d1c8['order']=qs[_0x236b('0x48')](_0x34ee17[_0x236b('0x44')]['sort']);_0x45d1c8[_0x236b('0x49')]=qs[_0x236b('0x42')](_[_0x236b('0x4a')](_0x34ee17[_0x236b('0x44')],_0x362cb7['filters']),_0x19d202);if(_0x34ee17[_0x236b('0x44')]['filter']){_0x45d1c8[_0x236b('0x49')]=_['merge'](_0x45d1c8[_0x236b('0x49')],{'$or':_['map'](_0x19d202,function(_0x3846a9){if(_0x3846a9[_0x236b('0x3f')]!==_0x236b('0x4b')){var _0x735960={};_0x735960[_0x3846a9[_0x236b('0x38')]]={'$like':'%'+_0x34ee17['query'][_0x236b('0x4c')]+'%'};return _0x735960;}})});}_0x45d1c8=_['merge']({},_0x45d1c8,_0x34ee17[_0x236b('0x4d')]);var _0x62617c={'where':_0x45d1c8['where']};return db[_0x236b('0x3c')][_0x236b('0x4e')](_0x62617c)['then'](function(_0x2510e7){_0x3c80cc['count']=_0x2510e7;if(_0x34ee17['query']['includeAll']){_0x45d1c8[_0x236b('0x4f')]=[{'all':!![]}];}return db[_0x236b('0x3c')][_0x236b('0x50')](_0x45d1c8);})['then'](function(_0xcb554e){_0x3c80cc['rows']=_0xcb554e;return _0x3c80cc;})[_0x236b('0x21')](respondWithFilteredResult(_0x2e96ac,_0x45d1c8))[_0x236b('0x29')](handleError(_0x2e96ac,null));};exports['show']=function(_0x50881d,_0x527c16){var _0x5713cb={'raw':!![],'where':{'id':_0x50881d['params']['id']}},_0x16030d={};_0x16030d[_0x236b('0x41')]=_[_0x236b('0x51')](db[_0x236b('0x3c')]['rawAttributes']);_0x16030d[_0x236b('0x44')]=_[_0x236b('0x51')](_0x50881d['query']);_0x16030d['filters']=_[_0x236b('0x43')](_0x16030d[_0x236b('0x41')],_0x16030d[_0x236b('0x44')]);_0x5713cb[_0x236b('0x45')]=_[_0x236b('0x43')](_0x16030d[_0x236b('0x41')],qs['fields'](_0x50881d[_0x236b('0x44')][_0x236b('0x46')]));_0x5713cb[_0x236b('0x45')]=_0x5713cb[_0x236b('0x45')][_0x236b('0x52')]?_0x5713cb[_0x236b('0x45')]:_0x16030d[_0x236b('0x41')];if(_0x50881d[_0x236b('0x44')]['includeAll']){_0x5713cb[_0x236b('0x4f')]=[{'all':!![]}];}_0x5713cb=_[_0x236b('0x53')]({},_0x5713cb,_0x50881d[_0x236b('0x4d')]);return db[_0x236b('0x3c')][_0x236b('0x54')](_0x5713cb)[_0x236b('0x21')](handleEntityNotFound(_0x527c16,null))[_0x236b('0x21')](respondWithResult(_0x527c16,null))['catch'](handleError(_0x527c16,null));};exports[_0x236b('0x55')]=function(_0x15e195,_0x41920d){return db[_0x236b('0x3c')][_0x236b('0x55')](_0x15e195[_0x236b('0x56')],{})['then'](respondWithResult(_0x41920d,0xc9))['catch'](handleError(_0x41920d,null));};exports[_0x236b('0x35')]=function(_0x2e81b1,_0x8ae11c){if(_0x2e81b1[_0x236b('0x56')]['id']){delete _0x2e81b1[_0x236b('0x56')]['id'];}return db[_0x236b('0x3c')]['find']({'where':{'id':_0x2e81b1[_0x236b('0x57')]['id']}})[_0x236b('0x21')](handleEntityNotFound(_0x8ae11c,null))[_0x236b('0x21')](saveUpdates(_0x2e81b1[_0x236b('0x56')],null))[_0x236b('0x21')](respondWithResult(_0x8ae11c,null))[_0x236b('0x29')](handleError(_0x8ae11c,null));};exports[_0x236b('0x36')]=function(_0x140305,_0x44affc){return db[_0x236b('0x3c')][_0x236b('0x54')]({'where':{'id':_0x140305[_0x236b('0x57')]['id']}})[_0x236b('0x21')](handleEntityNotFound(_0x44affc,null))['then'](removeEntity(_0x44affc,null))[_0x236b('0x29')](handleError(_0x44affc,null));};exports[_0x236b('0x58')]=function(_0x335176,_0xb67ed8){return db[_0x236b('0x3c')]['describe']()['then'](respondWithResult(_0xb67ed8,null))[_0x236b('0x29')](handleError(_0xb67ed8,null));};var interaction_log=require('../../config/logger')(_0x236b('0x59'));exports[_0x236b('0x5a')]=function(_0xc88394,_0x3910b0,_0xefe33f){var _0x4db17={'agent':{},'channel':_0x236b('0x5b')};if(_0xc88394[_0x236b('0x56')]['id']){delete _0xc88394['body']['id'];}_0xc88394[_0x236b('0x56')]['read']=!![];_0xc88394[_0x236b('0x56')]['readAt']=moment()[_0x236b('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0xc88394[_0x236b('0x56')][_0x236b('0x5d')]=_0xc88394[_0x236b('0x56')][_0x236b('0x5d')]||_0xc88394[_0x236b('0x5e')]['id'];_0x4db17[_0x236b('0x5f')]['id']=_0xc88394['body'][_0x236b('0x5d')];return db[_0x236b('0x3c')][_0x236b('0x54')]({'where':{'id':_0xc88394[_0x236b('0x57')]['id'],'UserId':null}})[_0x236b('0x21')](handleEntityNotFound(_0x3910b0,null))[_0x236b('0x21')](saveUpdates(_0xc88394['body'],null))['then'](function(_0x603d91){if(_0x603d91){_0x4db17[_0x236b('0x27')]=_0x603d91[_0x236b('0x60')]({'plain':!![]});return db[_0x236b('0x61')][_0x236b('0x54')]({'where':{'id':_0x603d91[_0x236b('0x62')]}});}return null;})[_0x236b('0x21')](handleEntityNotFound(_0x3910b0,null))['then'](function(_0x1999b6){if(_0x1999b6){return _0x1999b6[_0x236b('0x35')]({'UserId':_0xc88394[_0x236b('0x56')]['UserId'],'read1stAt':_[_0x236b('0x63')](_0x1999b6[_0x236b('0x64')])?moment()[_0x236b('0x5c')](_0x236b('0x65')):undefined});}return null;})[_0x236b('0x21')](function(_0x842889){if(_0x842889){_0x4db17[_0x236b('0x66')]=_0x842889['get']({'plain':!![]});interaction_log[_0x236b('0x67')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc88394[_0x236b('0x5e')]['id'],_0xc88394[_0x236b('0x5e')][_0x236b('0x38')],_0xc88394[_0x236b('0x5e')][_0x236b('0x68')],_0x4db17[_0x236b('0x66')]['id'],_0xc88394[_0x236b('0x56')]?JSON['stringify'](_0xc88394[_0x236b('0x56')]):'null');return respondWithRpcPromise(_0x236b('0x69'),'acceptMessage',_0x4db17);}return null;})[_0x236b('0x21')](function(_0x5760ee){var _0x52eef3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5760ee[_0x236b('0x27')]['ContactId'];return db[_0x236b('0x6a')][_0x236b('0x44')](_0x52eef3,{'type':db[_0x236b('0x6b')]['QueryTypes'][_0x236b('0x6c')],'raw':!![]})[_0x236b('0x21')](function(_0x31087b){return _0x31087b;});})[_0x236b('0x21')](function(_0x4a02d1){if(_0x4a02d1){_0x4db17[_0x236b('0x27')]['contact']=_0x4a02d1[0x0];if(!_0xc88394[_0x236b('0x56')][_0x236b('0x5d')])return;return db[_0x236b('0x6d')][_0x236b('0x54')]({'where':{'id':_0xc88394[_0x236b('0x56')][_0x236b('0x5d')],'role':_0x236b('0x5f')},'attributes':['id',_0x236b('0x38'),_0x236b('0x6e'),_0x236b('0x6f'),'internal'],'raw':!![]});}return null;})[_0x236b('0x21')](function(_0x4e7f57){if(!_0x4e7f57)return null;_0x4db17[_0x236b('0x27')][_0x236b('0x5f')]=_0x4e7f57;return _0x4db17;})[_0x236b('0x21')](function(_0x34ea41){if(_0x34ea41){if(_0xc88394[_0x236b('0x56')][_0x236b('0x70')]){_0x4db17[_0x236b('0x27')][_0x236b('0x71')]=util['format'](_0x236b('0x72'),_0xc88394[_0x236b('0x5e')]['name']);_0x4db17[_0x236b('0x27')][_0x236b('0x73')]=_0x4db17[_0x236b('0x73')];_0x4db17[_0x236b('0x27')]['motionChannel']=_0x4db17[_0x236b('0x73')];_0x4db17[_0x236b('0x27')][_0x236b('0x74')]=_0x236b('0x5a');return respondWithRpcPromise(_0x236b('0x75'),_0x236b('0x75'),{'event':_0x236b('0x76'),'message':_0x4db17[_0x236b('0x27')]},client9002)[_0x236b('0x21')](function(){return _0x4db17;});}return _0x4db17;}return null;})[_0x236b('0x21')](respondWithResult(_0x3910b0,null))[_0x236b('0x29')](handleError(_0x3910b0,null));};var interaction_log=require(_0x236b('0x14'))(_0x236b('0x59'));exports[_0x236b('0x33')]=function(_0x3bf682,_0x59d9da,_0xa583f8){var _0x198216={'agent':{},'channel':'openchannel'};if(_0x3bf682[_0x236b('0x56')]['id']){delete _0x3bf682[_0x236b('0x56')]['id'];}_0x3bf682[_0x236b('0x56')][_0x236b('0x5d')]=_0x3bf682['body'][_0x236b('0x5d')]||_0x3bf682['user']['id'];_0x198216[_0x236b('0x5f')]['id']=_0x3bf682['body']['UserId'];return db['OpenchannelMessage'][_0x236b('0x54')]({'where':{'id':_0x3bf682['params']['id'],'UserId':null}})[_0x236b('0x21')](handleEntityNotFound(_0x59d9da,null))[_0x236b('0x21')](function(_0x11a22e){if(_0x11a22e){_0x198216[_0x236b('0x27')]=_0x11a22e['get']({'plain':!![]});return db[_0x236b('0x61')][_0x236b('0x54')]({'where':{'id':_0x11a22e[_0x236b('0x62')]}});}return null;})[_0x236b('0x21')](handleEntityNotFound(_0x59d9da,null))[_0x236b('0x21')](function(_0x4d39a1){if(_0x4d39a1){_0x198216[_0x236b('0x66')]=_0x4d39a1[_0x236b('0x60')]({'plain':!![]});interaction_log[_0x236b('0x67')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3bf682[_0x236b('0x5e')]['id'],_0x3bf682[_0x236b('0x5e')][_0x236b('0x38')],_0x3bf682[_0x236b('0x5e')][_0x236b('0x68')],_0x198216['interaction']['id'],_0x3bf682[_0x236b('0x56')]?JSON[_0x236b('0x77')](_0x3bf682[_0x236b('0x56')]):_0x236b('0x78'));return respondWithRpcPromise(_0x236b('0x79'),_0x236b('0x7a'),_0x198216);}return null;})[_0x236b('0x21')](function(_0x66bb52){var _0x4fcac6=_0x236b('0x7b')+_0x66bb52['message']['ContactId'];return db['sequelize']['query'](_0x4fcac6,{'type':db[_0x236b('0x6b')][_0x236b('0x7c')]['SELECT'],'raw':!![]})['then'](function(_0x4adf8a){return _0x4adf8a;});})[_0x236b('0x21')](function(_0x435522){if(_0x435522){_0x198216['message']['contact']=_0x435522[0x0];if(!_0x3bf682['body'][_0x236b('0x5d')])return;return db[_0x236b('0x6d')][_0x236b('0x54')]({'where':{'id':_0x3bf682['body'][_0x236b('0x5d')],'role':_0x236b('0x5f')},'attributes':['id','name','fullname',_0x236b('0x6f'),_0x236b('0x7d')],'raw':!![]});}return null;})['then'](function(_0x54ca6a){if(!_0x54ca6a)return null;_0x198216[_0x236b('0x27')][_0x236b('0x5f')]=_0x54ca6a;return _0x198216;})[_0x236b('0x21')](function(_0x37808e){if(_0x37808e){_0x37808e[_0x236b('0x27')][_0x236b('0x71')]=util[_0x236b('0x5c')](_0x236b('0x72'),_0x3bf682[_0x236b('0x5e')][_0x236b('0x38')]);_0x37808e[_0x236b('0x27')][_0x236b('0x73')]=_0x198216['channel'];_0x37808e[_0x236b('0x27')][_0x236b('0x7e')]=_0x198216[_0x236b('0x73')];_0x37808e['message'][_0x236b('0x74')]=_0x236b('0x33');respondWithRpcPromise(_0x236b('0x75'),_0x236b('0x75'),{'event':_0x236b('0x7f'),'message':_0x37808e[_0x236b('0x27')]},client9002);return _0x198216;}return null;})[_0x236b('0x21')](respondWithResult(_0x59d9da,null))[_0x236b('0x29')](handleError(_0x59d9da,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 85c5019..93e53e3 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 _0x575d=['update','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0xd54582,_0x59d0cf){var _0x4af38a=function(_0x4f534b){while(--_0x4f534b){_0xd54582['push'](_0xd54582['shift']());}};_0x4af38a(++_0x59d0cf);}(_0x575d,0x1af));var _0xd575=function(_0x459e32,_0x4cc5ce){_0x459e32=_0x459e32-0x0;var _0x36e453=_0x575d[_0x459e32];return _0x36e453;};'use strict';var EventEmitter=require(_0xd575('0x0'));var OpenchannelMessage=require(_0xd575('0x1'))['db'][_0xd575('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd575('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3927d5){return function(_0x47ff51,_0x48f65a,_0x47ba1e){OpenchannelMessageEvents['emit'](_0x3927d5+':'+_0x47ff51['id'],_0x47ff51);OpenchannelMessageEvents[_0xd575('0x4')](_0x3927d5,_0x47ff51);_0x47ba1e(null);};}for(var e in events){if(events[_0xd575('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xd575('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x96f3=['OpenchannelMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1d7046,_0x39792d){var _0x4f4e3f=function(_0xc50645){while(--_0xc50645){_0x1d7046['push'](_0x1d7046['shift']());}};_0x4f4e3f(++_0x39792d);}(_0x96f3,0x80));var _0x396f=function(_0x42cc45,_0x40d55f){_0x42cc45=_0x42cc45-0x0;var _0x40a10a=_0x96f3[_0x42cc45];return _0x40a10a;};'use strict';var EventEmitter=require(_0x396f('0x0'));var OpenchannelMessage=require(_0x396f('0x1'))['db'][_0x396f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x396f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x396f('0x4'),'afterDestroy':_0x396f('0x5')};function emitEvent(_0x45fdc4){return function(_0x566321,_0x42158c,_0x14afc3){OpenchannelMessageEvents[_0x396f('0x6')](_0x45fdc4+':'+_0x566321['id'],_0x566321);OpenchannelMessageEvents['emit'](_0x45fdc4,_0x566321);_0x14afc3(null);};}for(var e in events){if(events[_0x396f('0x7')](e)){var event=events[e];OpenchannelMessage[_0x396f('0x8')](e,emitEvent(event));}}module[_0x396f('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 009aa7e..beb1af9 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 _0x6d90=['out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','afterCreate','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6d90,0x16d));var _0x06d9=function(_0x2eae28,_0x4f6c29){_0x2eae28=_0x2eae28-0x0;var _0x5c0750=_0x6d90[_0x2eae28];return _0x5c0750;};'use strict';var _=require(_0x06d9('0x0'));var util=require(_0x06d9('0x1'));var logger=require(_0x06d9('0x2'))(_0x06d9('0x3'));var moment=require(_0x06d9('0x4'));var BPromise=require(_0x06d9('0x5'));var rp=require(_0x06d9('0x6'));var fs=require('fs');var path=require(_0x06d9('0x7'));var rimraf=require(_0x06d9('0x8'));var config=require(_0x06d9('0x9'));var attributes=require(_0x06d9('0xa'));module[_0x06d9('0xb')]=function(_0x15b6d8,_0x1299f8){return _0x15b6d8[_0x06d9('0xc')]('OpenchannelMessage',attributes,{'tableName':_0x06d9('0xd'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x06d9('0xe')],'type':_0x06d9('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c2b7a,_0x3fd096,_0x10459c){var _0x20c4c6=_0x15b6d8[_0x06d9('0x10')];var _0x52921b=_0x1c2b7a[_0x06d9('0x11')]({'plain':!![]});if(_0x52921b[_0x06d9('0x12')][_0x06d9('0x13')]()==='in'||_0x52921b['direction'][_0x06d9('0x13')]()===_0x06d9('0x14')&&!_0x52921b[_0x06d9('0x15')]&&!_[_0x06d9('0x16')](_0x52921b['UserId'])){_0x20c4c6[_0x06d9('0x17')][_0x06d9('0x18')]({'where':{'id':_0x52921b[_0x06d9('0x19')]}})[_0x06d9('0x1a')](function(_0x3f25a2){if(_0x3f25a2){_0x3f25a2['update']({'lastMsgAt':_0x52921b[_0x06d9('0x1b')],'lastMsgDirection':_0x52921b[_0x06d9('0x12')][_0x06d9('0x13')]()});}})[_0x06d9('0x1c')](function(_0x123448){console[_0x06d9('0x1d')](_0x123448);});}if(_0x52921b[_0x06d9('0x12')]===_0x06d9('0x14')&&!_0x52921b[_0x06d9('0x15')]){var _0x60ad0f;_0x20c4c6['CmContact'][_0x06d9('0x1e')]()[_0x06d9('0x1a')](function(_0xf8456e){return _0x20c4c6[_0x06d9('0x1f')][_0x06d9('0x20')]({'where':{'id':_0x52921b['OpenchannelAccountId']},'include':[{'model':_0x20c4c6[_0x06d9('0x17')],'as':_0x06d9('0x21'),'where':{'id':_0x52921b[_0x06d9('0x19')]},'limit':0x1,'include':[{'model':_0x20c4c6[_0x06d9('0x22')],'as':_0x06d9('0x23'),'attributes':_[_0x06d9('0x24')](_0xf8456e)}]}]});})[_0x06d9('0x1a')](function(_0x471453){_0x60ad0f=_0x471453[_0x06d9('0x11')]({'plain':!![]});if(_0x60ad0f&&_0x60ad0f[_0x06d9('0x25')]){logger[_0x06d9('0x26')](_0x06d9('0x27'),'afterCreate',util[_0x06d9('0x28')](_0x06d9('0x29'),_0x52921b['id'],_0x60ad0f['replyUri']));if(_0x60ad0f[_0x06d9('0x21')]&&_0x60ad0f[_0x06d9('0x21')][_0x06d9('0x2a')]){_0x52921b[_0x06d9('0x2b')]=_[_0x06d9('0x2c')](_0x60ad0f[_0x06d9('0x21')][0x0],_0x06d9('0x23'));_0x52921b[_0x06d9('0x23')]=_0x60ad0f[_0x06d9('0x21')][0x0][_0x06d9('0x23')];}var _0x3fd096={'method':_0x06d9('0x2d'),'uri':encodeURI(_0x60ad0f[_0x06d9('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3fd096[_0x06d9('0x2e')]){case _0x06d9('0x2f'):_0x3fd096['qs']=_0x52921b;break;case _0x06d9('0x2d'):_0x3fd096[_0x06d9('0xe')]=_0x52921b;break;}return rp(_0x3fd096)[_0x06d9('0x1a')](function(_0x1fc943){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x06d9('0x28')](_0x06d9('0x30'),_0x52921b['id'],_0x60ad0f['replyUri']));if(_0x1fc943[_0x06d9('0xe')]['threadId']&&_0x1fc943[_0x06d9('0xe')][_0x06d9('0x31')]!=_0x52921b[_0x06d9('0x2b')][_0x06d9('0x31')]){return _0x20c4c6[_0x06d9('0x17')][_0x06d9('0x32')]({'threadId':_0x1fc943[_0x06d9('0xe')][_0x06d9('0x31')]},{'where':{'id':_0x52921b[_0x06d9('0x2b')]['id']}});}else{return;}})[_0x06d9('0x1a')](function(){return _0x1c2b7a['update']({'read':!![]});})[_0x06d9('0x1c')](function(_0x81b32e){logger[_0x06d9('0x1d')]('OpenchannelMessage,\x20%s,\x20%s',_0x06d9('0x33'),util['inspect'](_0x81b32e,{'showHidden':![],'depth':null}));_0x10459c();});}else{_0x10459c();}})[_0x06d9('0x34')](function(){_0x10459c();});}else{_0x10459c();}}},'charset':_0x06d9('0x35'),'collate':_0x06d9('0x36')});}; \ No newline at end of file +var _0x1747=['update','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','createdAt','catch','error','out','then','find','OpenchannelAccountId','OpenchannelInteractionId','CmContact','keys','replyUri','info','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Contact','POST','method','body','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x1747,0x1ad));var _0x7174=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x1747[_0x82129b];return _0x2ae5dc;};'use strict';var _=require('lodash');var util=require(_0x7174('0x0'));var logger=require('../../config/logger')(_0x7174('0x1'));var moment=require('moment');var BPromise=require(_0x7174('0x2'));var rp=require(_0x7174('0x3'));var fs=require('fs');var path=require(_0x7174('0x4'));var rimraf=require('rimraf');var config=require(_0x7174('0x5'));var attributes=require('./openchannelMessage.attributes');module[_0x7174('0x6')]=function(_0x495171,_0x5f3d50){return _0x495171[_0x7174('0x7')](_0x7174('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x7174('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x329e9d,_0x5a5195,_0x4f93b2){var _0x4c2121=_0x495171['models'];var _0xc98184=_0x329e9d[_0x7174('0xa')]({'plain':!![]});if(_0xc98184[_0x7174('0xb')][_0x7174('0xc')]()==='in'||_0xc98184[_0x7174('0xb')][_0x7174('0xc')]()==='out'&&!_0xc98184[_0x7174('0xd')]&&!_['isNil'](_0xc98184[_0x7174('0xe')])){_0x4c2121[_0x7174('0xf')][_0x7174('0x10')]({'where':{'id':_0xc98184['OpenchannelInteractionId']}})['then'](function(_0x534bf4){if(_0x534bf4){_0x534bf4['update']({'lastMsgAt':_0xc98184[_0x7174('0x11')],'lastMsgDirection':_0xc98184['direction'][_0x7174('0xc')]()});}})[_0x7174('0x12')](function(_0x52ce82){console[_0x7174('0x13')](_0x52ce82);});}if(_0xc98184[_0x7174('0xb')]===_0x7174('0x14')&&!_0xc98184[_0x7174('0xd')]){var _0x3450cb;_0x4c2121['CmContact']['describe']()[_0x7174('0x15')](function(_0x128062){return _0x4c2121['OpenchannelAccount'][_0x7174('0x16')]({'where':{'id':_0xc98184[_0x7174('0x17')]},'include':[{'model':_0x4c2121[_0x7174('0xf')],'as':'Interactions','where':{'id':_0xc98184[_0x7174('0x18')]},'limit':0x1,'include':[{'model':_0x4c2121[_0x7174('0x19')],'as':'Contact','attributes':_[_0x7174('0x1a')](_0x128062)}]}]});})['then'](function(_0x519bae){_0x3450cb=_0x519bae[_0x7174('0xa')]({'plain':!![]});if(_0x3450cb&&_0x3450cb[_0x7174('0x1b')]){logger[_0x7174('0x1c')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x7174('0x1d'),_0xc98184['id'],_0x3450cb['replyUri']));if(_0x3450cb['Interactions']&&_0x3450cb[_0x7174('0x1e')][_0x7174('0x1f')]){_0xc98184['Interaction']=_['omit'](_0x3450cb[_0x7174('0x1e')][0x0],_0x7174('0x20'));_0xc98184[_0x7174('0x20')]=_0x3450cb[_0x7174('0x1e')][0x0][_0x7174('0x20')];}var _0x5a5195={'method':_0x7174('0x21'),'uri':encodeURI(_0x3450cb['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5a5195[_0x7174('0x22')]){case'GET':_0x5a5195['qs']=_0xc98184;break;case _0x7174('0x21'):_0x5a5195[_0x7174('0x23')]=_0xc98184;break;}return rp(_0x5a5195)[_0x7174('0x15')](function(_0x1e81f3){logger[_0x7174('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0x7174('0x24'),util[_0x7174('0x25')](_0x7174('0x26'),_0xc98184['id'],_0x3450cb[_0x7174('0x1b')]));if(_0x1e81f3[_0x7174('0x23')][_0x7174('0x27')]&&_0x1e81f3[_0x7174('0x23')][_0x7174('0x27')]!=_0xc98184[_0x7174('0x28')][_0x7174('0x27')]){return _0x4c2121[_0x7174('0xf')]['update']({'threadId':_0x1e81f3[_0x7174('0x23')][_0x7174('0x27')]},{'where':{'id':_0xc98184[_0x7174('0x28')]['id']}});}else{return;}})[_0x7174('0x15')](function(){return _0x329e9d[_0x7174('0x29')]({'read':!![]});})[_0x7174('0x12')](function(_0x3df6c5){logger[_0x7174('0x13')](_0x7174('0x2a'),_0x7174('0x24'),util[_0x7174('0x2b')](_0x3df6c5,{'showHidden':![],'depth':null}));_0x4f93b2();});}else{_0x4f93b2();}})[_0x7174('0x2c')](function(){_0x4f93b2();});}else{_0x4f93b2();}}},'charset':_0x7174('0x2d'),'collate':_0x7174('0x2e')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 4771d60..d1647d9 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x45f7ca,_0x2a15ea){var _0x2124ce=function(_0x40b5e6){while(--_0x40b5e6){_0x45f7ca['push'](_0x45f7ca['shift']());}};_0x2124ce(++_0x2a15ea);}(_0x1261,0x144));var _0x1126=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0x1261[_0x5c4e16];return _0x36044a;};'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});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0xfb081d,_0x775fb){var _0x3c3bad=function(_0x130e5e){while(--_0x130e5e){_0xfb081d['push'](_0xfb081d['shift']());}};_0x3c3bad(++_0x775fb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'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});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 08f33d2..b3321fc 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 _0x770d=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','removeListener','register'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x770d,0x122));var _0xd770=function(_0x11a4dd,_0x722077){_0x11a4dd=_0x11a4dd-0x0;var _0x186bf5=_0x770d[_0x11a4dd];return _0x186bf5;};'use strict';var OpenchannelMessageEvents=require(_0xd770('0x0'));var events=[_0xd770('0x1'),_0xd770('0x2'),_0xd770('0x3')];function createListener(_0x286d89,_0x2b9932){return function(_0x742a9a){_0x2b9932['emit'](_0x286d89,_0x742a9a);};}function removeListener(_0x2ce50a,_0x3ac59f){return function(){OpenchannelMessageEvents[_0xd770('0x4')](_0x2ce50a,_0x3ac59f);};}exports[_0xd770('0x5')]=function(_0x5d3b18){for(var _0x554c5e=0x0,_0x2d73bd=events[_0xd770('0x6')];_0x554c5e<_0x2d73bd;_0x554c5e++){var _0x2224c4=events[_0x554c5e];var _0x433e3d=createListener(_0xd770('0x7')+_0x2224c4,_0x5d3b18);OpenchannelMessageEvents['on'](_0x2224c4,_0x433e3d);}}; \ No newline at end of file +var _0xee55=['register','length','./openchannelMessage.events','remove','emit','removeListener'];(function(_0x2aa747,_0x14a00d){var _0x811f93=function(_0x5ca30d){while(--_0x5ca30d){_0x2aa747['push'](_0x2aa747['shift']());}};_0x811f93(++_0x14a00d);}(_0xee55,0x1a0));var _0x5ee5=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0xee55[_0xf9a6cf];return _0x59e2bc;};'use strict';var OpenchannelMessageEvents=require(_0x5ee5('0x0'));var events=['save',_0x5ee5('0x1'),'update'];function createListener(_0x36b757,_0x537936){return function(_0x8d4be8){_0x537936[_0x5ee5('0x2')](_0x36b757,_0x8d4be8);};}function removeListener(_0x4e5f9b,_0x394334){return function(){OpenchannelMessageEvents[_0x5ee5('0x3')](_0x4e5f9b,_0x394334);};}exports[_0x5ee5('0x4')]=function(_0x392a8e){for(var _0x684992=0x0,_0x42950c=events[_0x5ee5('0x5')];_0x684992<_0x42950c;_0x684992++){var _0x5e0eb2=events[_0x684992];var _0x168427=createListener('openchannelMessage:'+_0x5e0eb2,_0x392a8e);OpenchannelMessageEvents['on'](_0x5e0eb2,_0x168427);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 83d5a9a..5fc9b0e 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 _0xa48a=['index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated'];(function(_0x2028d5,_0x31e421){var _0x1620fb=function(_0xc32f4a){while(--_0xc32f4a){_0x2028d5['push'](_0x2028d5['shift']());}};_0x1620fb(++_0x31e421);}(_0xa48a,0xa4));var _0xaa48=function(_0x5cd54f,_0xc513d7){_0x5cd54f=_0x5cd54f-0x0;var _0x48811b=_0xa48a[_0x5cd54f];return _0x48811b;};'use strict';var multer=require(_0xaa48('0x0'));var util=require(_0xaa48('0x1'));var path=require(_0xaa48('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa48('0x3'));var router=express[_0xaa48('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaa48('0x5'));var interaction=require(_0xaa48('0x6'));var config=require('../../config/environment');var controller=require(_0xaa48('0x7'));router[_0xaa48('0x8')]('/',auth[_0xaa48('0x9')](),controller[_0xaa48('0xa')]);router[_0xaa48('0x8')](_0xaa48('0xb'),auth[_0xaa48('0x9')](),controller[_0xaa48('0xc')]);router[_0xaa48('0x8')](_0xaa48('0xd'),auth['isAuthenticated'](),controller[_0xaa48('0xe')]);router['get']('/:id/members',auth[_0xaa48('0x9')](),controller[_0xaa48('0xf')]);router[_0xaa48('0x8')](_0xaa48('0x10'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x11')]);router['get'](_0xaa48('0x12'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x13')]);router[_0xaa48('0x14')]('/',auth[_0xaa48('0x9')](),controller['create']);router['post'](_0xaa48('0x10'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x15')]);router[_0xaa48('0x14')](_0xaa48('0x12'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x16')]);router[_0xaa48('0x17')](_0xaa48('0xd'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x18')]);router[_0xaa48('0x19')]('/:id',auth[_0xaa48('0x9')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xaa48('0x9')](),controller[_0xaa48('0x1a')]);router[_0xaa48('0x19')](_0xaa48('0x12'),auth[_0xaa48('0x9')](),controller[_0xaa48('0x1b')]);module[_0xaa48('0x1c')]=router; \ No newline at end of file +var _0xe65b=['fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','addTeams','addAgents','put','/:id','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x57c219,_0x28adb0){var _0x41eda0=function(_0x53c3bb){while(--_0x53c3bb){_0x57c219['push'](_0x57c219['shift']());}};_0x41eda0(++_0x28adb0);}(_0xe65b,0x111));var _0xbe65=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xe65b[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0xbe65('0x0'));var util=require(_0xbe65('0x1'));var path=require(_0xbe65('0x2'));var timeout=require(_0xbe65('0x3'));var express=require(_0xbe65('0x4'));var router=express[_0xbe65('0x5')]();var fs_extra=require(_0xbe65('0x6'));var auth=require(_0xbe65('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbe65('0x8'));var controller=require(_0xbe65('0x9'));router[_0xbe65('0xa')]('/',auth['isAuthenticated'](),controller[_0xbe65('0xb')]);router[_0xbe65('0xa')](_0xbe65('0xc'),auth[_0xbe65('0xd')](),controller[_0xbe65('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbe65('0xf')]);router[_0xbe65('0xa')](_0xbe65('0x10'),auth['isAuthenticated'](),controller[_0xbe65('0x11')]);router[_0xbe65('0xa')]('/:id/teams',auth[_0xbe65('0xd')](),controller[_0xbe65('0x12')]);router['get'](_0xbe65('0x13'),auth[_0xbe65('0xd')](),controller[_0xbe65('0x14')]);router['post']('/',auth[_0xbe65('0xd')](),controller[_0xbe65('0x15')]);router['post']('/:id/teams',auth[_0xbe65('0xd')](),controller[_0xbe65('0x16')]);router['post'](_0xbe65('0x13'),auth['isAuthenticated'](),controller[_0xbe65('0x17')]);router[_0xbe65('0x18')](_0xbe65('0x19'),auth['isAuthenticated'](),controller['update']);router[_0xbe65('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xbe65('0x1a')](_0xbe65('0x1b'),auth['isAuthenticated'](),controller[_0xbe65('0x1c')]);router[_0xbe65('0x1a')](_0xbe65('0x13'),auth[_0xbe65('0xd')](),controller[_0xbe65('0x1d')]);module[_0xbe65('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 4a21eee..88f10a0 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 _0xcb26=['rrmemory','beepall','roundrobin','exports','STRING','ENUM'];(function(_0x10a904,_0x2bf292){var _0x53815a=function(_0x2e6ce4){while(--_0x2e6ce4){_0x10a904['push'](_0x10a904['shift']());}};_0x53815a(++_0x2bf292);}(_0xcb26,0x1a7));var _0x6cb2=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xcb26[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');module[_0x6cb2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6cb2('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6cb2('0x2')](_0x6cb2('0x3'),_0x6cb2('0x4'),_0x6cb2('0x5'))}}; \ No newline at end of file +var _0x285b=['name','INTEGER','beepall','exports','STRING'];(function(_0x4016fb,_0x9ab704){var _0x5d7d3a=function(_0x16c5ad){while(--_0x16c5ad){_0x4016fb['push'](_0x4016fb['shift']());}};_0x5d7d3a(++_0x9ab704);}(_0x285b,0xd5));var _0xb285=function(_0x4230ee,_0xc48832){_0x4230ee=_0x4230ee-0x0;var _0x2b7c73=_0x285b[_0x4230ee];return _0x2b7c73;};'use strict';var Sequelize=require('sequelize');module[_0xb285('0x0')]={'name':{'type':Sequelize[_0xb285('0x1')],'unique':_0xb285('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb285('0x1')]},'timeout':{'type':Sequelize[_0xb285('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xb285('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4cc8f75..cb488f6 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 _0xdca3=['transaction','each','findOrCreate','emit','userOpenchannelQueue:save','ids','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','value','removeTeams','isEmpty','forEach','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','pick','bluebird','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','params','model','keys','attributes','intersection','fields','length','includeAll','merge','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','UserOpenchannelQueue','filters','hasOwnProperty','nolimit','order','sort','filter','User','agent','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdca3,0x9b));var _0x3dca=function(_0x57e80b,_0x1ecd5d){_0x57e80b=_0x57e80b-0x0;var _0x3884ed=_0xdca3[_0x57e80b];return _0x3884ed;};'use strict';var BPromise=require(_0x3dca('0x0'));var util=require(_0x3dca('0x1'));var _=require(_0x3dca('0x2'));var squel=require(_0x3dca('0x3'));var Redis=require('ioredis');var qs=require(_0x3dca('0x4'));var logger=require(_0x3dca('0x5'))(_0x3dca('0x6'));var config=require('../../config/environment');var db=require(_0x3dca('0x7'))['db'];config[_0x3dca('0x8')]=_[_0x3dca('0x9')](config['redis'],{'host':_0x3dca('0xa'),'port':0x18eb});var socket=require(_0x3dca('0xb'))(new Redis(config[_0x3dca('0x8')]));require('./openchannelQueue.socket')[_0x3dca('0xc')](socket);function respondWithStatusCode(_0x2815f6,_0x354b21){_0x354b21=_0x354b21||0xcc;return function(_0x235889){if(_0x235889){return _0x2815f6[_0x3dca('0xd')](_0x354b21);}return _0x2815f6[_0x3dca('0xe')](_0x354b21)['end']();};}function respondWithResult(_0x1aed69,_0x186884){_0x186884=_0x186884||0xc8;return function(_0x4b8710){if(_0x4b8710){return _0x1aed69['status'](_0x186884)[_0x3dca('0xf')](_0x4b8710);}};}function respondWithFilteredResult(_0x264563,_0x2e39ae){return function(_0x51e15){if(_0x51e15){var _0x1430d5=typeof _0x2e39ae[_0x3dca('0x10')]===_0x3dca('0x11')&&typeof _0x2e39ae[_0x3dca('0x12')]===_0x3dca('0x11');var _0x4ff997=_0x51e15[_0x3dca('0x13')];var _0x372d7b=_0x1430d5?0x0:_0x2e39ae[_0x3dca('0x10')];var _0x5b9263=_0x1430d5?_0x51e15[_0x3dca('0x13')]:_0x2e39ae[_0x3dca('0x10')]+_0x2e39ae[_0x3dca('0x12')];var _0xbf323a;if(_0x5b9263>=_0x4ff997){_0x5b9263=_0x4ff997;_0xbf323a=0xc8;}else{_0xbf323a=0xce;}_0x264563[_0x3dca('0xe')](_0xbf323a);return _0x264563[_0x3dca('0x14')](_0x3dca('0x15'),_0x372d7b+'-'+_0x5b9263+'/'+_0x4ff997)[_0x3dca('0xf')](_0x51e15);}return null;};}function saveUpdates(_0x48bab1){return function(_0x1e3ffd){if(_0x1e3ffd){return _0x1e3ffd[_0x3dca('0x16')](_0x48bab1)[_0x3dca('0x17')](function(_0x361f36){return _0x361f36;});}return null;};}function removeEntity(_0x39334a){return function(_0x13c8cf){if(_0x13c8cf){return _0x13c8cf[_0x3dca('0x18')]()[_0x3dca('0x17')](function(){var _0x39e216=_0x13c8cf[_0x3dca('0x19')]({'plain':!![]});var _0x258c84='OpenchannelQueues';return db[_0x3dca('0x1a')]['destroy']({'where':{'type':_0x258c84,'resourceId':_0x39e216['id']}})[_0x3dca('0x17')](function(){return _0x13c8cf;});})[_0x3dca('0x17')](function(){_0x39334a[_0x3dca('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ac0bd){return function(_0x42c2ce){if(!_0x42c2ce){_0x2ac0bd[_0x3dca('0xd')](0x194);}return _0x42c2ce;};}function handleError(_0x35a5ba,_0x2a19e5){_0x2a19e5=_0x2a19e5||0x1f4;return function(_0x4ccb65){logger[_0x3dca('0x1b')](_0x4ccb65['stack']);if(_0x4ccb65[_0x3dca('0x1c')]){delete _0x4ccb65['name'];}_0x35a5ba[_0x3dca('0xe')](_0x2a19e5)[_0x3dca('0x1d')](_0x4ccb65);};}exports[_0x3dca('0x1e')]=function(_0x386f50,_0x2fdce2){var _0x8c6471={};var _0x5191dc={'count':0x0,'rows':[]};var _0xce2973=_[_0x3dca('0x1f')](db[_0x3dca('0x20')][_0x3dca('0x21')],function(_0x59a637){return{'name':_0x59a637[_0x3dca('0x22')],'type':_0x59a637[_0x3dca('0x23')][_0x3dca('0x24')]};});_0x8c6471=qs[_0x3dca('0x25')](_0xce2973,_0x386f50);var _0x4e52e2={'where':_0x8c6471[_0x3dca('0x26')]};return db[_0x3dca('0x20')]['count'](_0x4e52e2)['then'](function(_0x367860){_0x5191dc['count']=_0x367860;_0x8c6471[_0x3dca('0x27')]=qs[_0x3dca('0x27')](_0x386f50[_0x3dca('0x28')]);return db[_0x3dca('0x20')][_0x3dca('0x29')](_0x8c6471);})[_0x3dca('0x17')](function(_0x3a4f25){_0x5191dc[_0x3dca('0x2a')]=_0x3a4f25;return _0x5191dc;})[_0x3dca('0x17')](respondWithFilteredResult(_0x2fdce2,_0x8c6471))[_0x3dca('0x2b')](handleError(_0x2fdce2,null));};exports['show']=function(_0x556394,_0x4c73d8){var _0x5ce2e7={'raw':!![],'where':{'id':_0x556394[_0x3dca('0x2c')]['id']}},_0x226cf0={};_0x226cf0[_0x3dca('0x2d')]=_[_0x3dca('0x2e')](db[_0x3dca('0x20')][_0x3dca('0x21')]);_0x226cf0['query']=_[_0x3dca('0x2e')](_0x556394['query']);_0x226cf0['filters']=_['intersection'](_0x226cf0[_0x3dca('0x2d')],_0x226cf0[_0x3dca('0x28')]);_0x5ce2e7[_0x3dca('0x2f')]=_[_0x3dca('0x30')](_0x226cf0['model'],qs[_0x3dca('0x31')](_0x556394[_0x3dca('0x28')][_0x3dca('0x31')]));_0x5ce2e7[_0x3dca('0x2f')]=_0x5ce2e7['attributes'][_0x3dca('0x32')]?_0x5ce2e7['attributes']:_0x226cf0[_0x3dca('0x2d')];if(_0x556394[_0x3dca('0x28')][_0x3dca('0x33')]){_0x5ce2e7['include']=[{'all':!![]}];}_0x5ce2e7=_[_0x3dca('0x34')]({},_0x5ce2e7,_0x556394[_0x3dca('0x35')]);return db['OpenchannelQueue'][_0x3dca('0x36')](_0x5ce2e7)['then'](handleEntityNotFound(_0x4c73d8,null))['then'](respondWithResult(_0x4c73d8,null))[_0x3dca('0x2b')](handleError(_0x4c73d8,null));};exports['create']=function(_0xc2fbdf,_0x5d2af4){return db[_0x3dca('0x20')][_0x3dca('0x37')](_0xc2fbdf['body'],{})[_0x3dca('0x17')](function(_0xca9c30){var _0x5640db=_0xc2fbdf[_0x3dca('0x38')]['get']({'plain':!![]});if(!_0x5640db)throw new Error(_0x3dca('0x39'));if(_0x5640db[_0x3dca('0x3a')]===_0x3dca('0x38')){var _0x2ab75b=_0xca9c30[_0x3dca('0x19')]({'plain':!![]});var _0x32c4f5='OpenchannelQueues';return db[_0x3dca('0x3b')][_0x3dca('0x36')]({'where':{'name':_0x32c4f5,'userProfileId':_0x5640db[_0x3dca('0x3c')]},'raw':!![]})[_0x3dca('0x17')](function(_0xa05c21){if(_0xa05c21&&_0xa05c21[_0x3dca('0x3d')]===0x0){return db['UserProfileResource'][_0x3dca('0x37')]({'name':_0x2ab75b[_0x3dca('0x1c')],'resourceId':_0x2ab75b['id'],'type':_0xa05c21['name'],'sectionId':_0xa05c21['id']},{})[_0x3dca('0x17')](function(){return _0xca9c30;});}else{return _0xca9c30;}})[_0x3dca('0x2b')](function(_0x5942de){logger[_0x3dca('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5942de);throw _0x5942de;});}return _0xca9c30;})[_0x3dca('0x17')](respondWithResult(_0x5d2af4,0xc9))[_0x3dca('0x2b')](handleError(_0x5d2af4,null));};exports[_0x3dca('0x16')]=function(_0x1452e6,_0x223d5c){if(_0x1452e6[_0x3dca('0x3e')]['id']){delete _0x1452e6[_0x3dca('0x3e')]['id'];}return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x1452e6[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x223d5c,null))[_0x3dca('0x17')](saveUpdates(_0x1452e6[_0x3dca('0x3e')],null))[_0x3dca('0x17')](respondWithResult(_0x223d5c,null))['catch'](handleError(_0x223d5c,null));};exports[_0x3dca('0x18')]=function(_0x22af32,_0x68ea8f){return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x22af32['params']['id']}})['then'](handleEntityNotFound(_0x68ea8f,null))['then'](removeEntity(_0x68ea8f,null))['catch'](handleError(_0x68ea8f,null));};exports['describe']=function(_0xc6f673,_0x58bf79){return db[_0x3dca('0x20')][_0x3dca('0x3f')]()[_0x3dca('0x17')](respondWithResult(_0x58bf79,null))['catch'](handleError(_0x58bf79,null));};exports[_0x3dca('0x40')]=function(_0x420622,_0x182421){var _0xaef35={'raw':!![],'where':{}},_0x5353e2={},_0x1e66d3;return db[_0x3dca('0x20')][_0x3dca('0x41')]({'where':{'id':_0x420622[_0x3dca('0x2c')]['id']}})['then'](handleEntityNotFound(_0x182421,null))[_0x3dca('0x17')](function(_0x19d5ab){if(_0x19d5ab){_0x1e66d3=_0x19d5ab['get']({'plain':!![]});_0x5353e2[_0x3dca('0x2d')]=_[_0x3dca('0x2e')](db[_0x3dca('0x42')][_0x3dca('0x21')]);_0x5353e2[_0x3dca('0x28')]=_[_0x3dca('0x2e')](_0x420622[_0x3dca('0x28')]);_0x5353e2[_0x3dca('0x43')]=_['intersection'](_0x5353e2[_0x3dca('0x2d')],_0x5353e2[_0x3dca('0x28')]);_0xaef35[_0x3dca('0x2f')]=_['intersection'](_0x5353e2[_0x3dca('0x2d')],qs[_0x3dca('0x31')](_0x420622[_0x3dca('0x28')][_0x3dca('0x31')]));_0xaef35[_0x3dca('0x2f')]=_0xaef35[_0x3dca('0x2f')][_0x3dca('0x32')]?_0xaef35[_0x3dca('0x2f')]:_0x5353e2[_0x3dca('0x2d')];if(!_0x420622[_0x3dca('0x28')][_0x3dca('0x44')](_0x3dca('0x45'))){_0xaef35['limit']=qs['limit'](_0x420622[_0x3dca('0x28')][_0x3dca('0x12')]);_0xaef35[_0x3dca('0x10')]=qs[_0x3dca('0x10')](_0x420622[_0x3dca('0x28')]['offset']);}_0xaef35[_0x3dca('0x46')]=qs[_0x3dca('0x47')](_0x420622[_0x3dca('0x28')]['sort']);_0xaef35[_0x3dca('0x26')]=qs[_0x3dca('0x43')](_['pick'](_0x420622[_0x3dca('0x28')],_0x5353e2['filters']));_0xaef35[_0x3dca('0x26')]['OpenchannelQueueId']=_0x19d5ab['id'];if(_0x420622[_0x3dca('0x28')][_0x3dca('0x48')]){_0xaef35[_0x3dca('0x26')]=_[_0x3dca('0x34')](_0xaef35[_0x3dca('0x26')],{'$or':_[_0x3dca('0x1f')](_0xaef35[_0x3dca('0x2f')],function(_0x3ab876){var _0x390180={};_0x390180[_0x3ab876]={'$like':'%'+_0x420622['query']['filter']+'%'};return _0x390180;})});}_0xaef35=_['merge']({},_0xaef35,_0x420622['options']);return db[_0x3dca('0x42')][_0x3dca('0x29')](_0xaef35);}})[_0x3dca('0x17')](function(_0x4c50e0){if(_0x4c50e0){return db[_0x3dca('0x49')]['findAndCountAll']({'where':{'id':_[_0x3dca('0x1f')](_0x4c50e0,'UserId'),'role':_0x3dca('0x4a')},'attributes':['id',_0x3dca('0x1c'),_0x3dca('0x4b'),_0x3dca('0x4c'),_0x3dca('0x4d')]});}})[_0x3dca('0x17')](function(_0x1a0d31){if(_0x1a0d31){return{'count':_0x1a0d31['count'],'rows':_['map'](_0x1a0d31[_0x3dca('0x2a')],function(_0x1841a8){return{'membername':_0x1841a8['name'],'UserId':_0x1841a8['id'],'queue_name':_0x1e66d3[_0x3dca('0x1c')],'OpenchannelQueueId':_0x1e66d3['id'],'interface':util['format'](_0x3dca('0x4e'),_0x3dca('0x4f'),_0x1841a8[_0x3dca('0x1c')]),'penalty':0x0,'paused':_0x1841a8['openchannelPause'],'createdAt':_0x1841a8[_0x3dca('0x4d')],'updatedAt':_0x1841a8[_0x3dca('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3dca('0x17')](respondWithFilteredResult(_0x182421,_0xaef35))[_0x3dca('0x2b')](handleError(_0x182421,null));};exports[_0x3dca('0x50')]=function(_0x50a915,_0x1a36af){var _0x4ca4cb={};var _0x4a65e6={};var _0x1ad85f;var _0x4777a8;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x50a915[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x1a36af,null))[_0x3dca('0x17')](function(_0x4d4eaa){if(_0x4d4eaa){_0x1ad85f=_0x4d4eaa;_0x4a65e6['model']=_[_0x3dca('0x2e')](db[_0x3dca('0x51')][_0x3dca('0x21')]);_0x4a65e6['query']=_['keys'](_0x50a915['query']);_0x4a65e6['filters']=_[_0x3dca('0x30')](_0x4a65e6[_0x3dca('0x2d')],_0x4a65e6[_0x3dca('0x28')]);_0x4ca4cb[_0x3dca('0x2f')]=_[_0x3dca('0x30')](_0x4a65e6['model'],qs[_0x3dca('0x31')](_0x50a915['query']['fields']));_0x4ca4cb[_0x3dca('0x2f')]=_0x4ca4cb[_0x3dca('0x2f')][_0x3dca('0x32')]?_0x4ca4cb['attributes']:_0x4a65e6[_0x3dca('0x2d')];_0x4ca4cb[_0x3dca('0x46')]=qs[_0x3dca('0x47')](_0x50a915[_0x3dca('0x28')][_0x3dca('0x47')]);_0x4ca4cb['where']=qs['filters'](_['pick'](_0x50a915['query'],_0x4a65e6[_0x3dca('0x43')]));if(_0x50a915[_0x3dca('0x28')][_0x3dca('0x48')]){_0x4ca4cb['where']=_[_0x3dca('0x34')](_0x4ca4cb[_0x3dca('0x26')],{'$or':_[_0x3dca('0x1f')](_0x4ca4cb[_0x3dca('0x2f')],function(_0x5c7e39){var _0x3424af={};_0x3424af[_0x5c7e39]={'$like':'%'+_0x50a915['query'][_0x3dca('0x48')]+'%'};return _0x3424af;})});}_0x4ca4cb=_['merge']({},_0x4ca4cb,_0x50a915[_0x3dca('0x35')]);return _0x1ad85f[_0x3dca('0x50')](_0x4ca4cb);}})[_0x3dca('0x17')](function(_0x486bfc){if(_0x486bfc){_0x4777a8=_0x486bfc[_0x3dca('0x32')];if(!_0x50a915['query'][_0x3dca('0x44')](_0x3dca('0x45'))){_0x4ca4cb[_0x3dca('0x12')]=qs[_0x3dca('0x12')](_0x50a915[_0x3dca('0x28')][_0x3dca('0x12')]);_0x4ca4cb['offset']=qs[_0x3dca('0x10')](_0x50a915['query'][_0x3dca('0x10')]);}return _0x1ad85f[_0x3dca('0x50')](_0x4ca4cb);}})['then'](function(_0x366160){if(_0x366160){return _0x366160?{'count':_0x4777a8,'rows':_0x366160}:null;}})['then'](respondWithResult(_0x1a36af,null))[_0x3dca('0x2b')](handleError(_0x1a36af,null));};exports[_0x3dca('0x52')]=function(_0x9ab06e,_0x2649c6){var _0x2c54cc=_0x9ab06e[_0x3dca('0x3e')]['ids'];return db[_0x3dca('0x51')][_0x3dca('0x29')]({'where':{'id':_0x2c54cc},'attributes':['id'],'include':[{'model':db[_0x3dca('0x49')],'as':_0x3dca('0x53'),'attributes':['id',_0x3dca('0x1c'),_0x3dca('0x54'),_0x3dca('0x55'),_0x3dca('0x56')],'raw':!![]}]})[_0x3dca('0x17')](function(_0x2c0d91){if(_0x2c0d91){var _0xbf8361=_[_0x3dca('0x57')](_0x2c0d91,function(_0x469787){var _0x81cf1f=_0x469787['get']({'plain':!![]});return _0x81cf1f[_0x3dca('0x53')];});return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x9ab06e[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](function(_0x10d8ed){return db[_0x3dca('0x58')][_0x3dca('0x59')](function(_0xef53c8){return _0x10d8ed[_0x3dca('0x52')](_0x2c54cc,{'transaction':_0xef53c8})[_0x3dca('0x17')](function(){return BPromise[_0x3dca('0x5a')](_0xbf8361,function(_0x1d5d58){return db[_0x3dca('0x42')][_0x3dca('0x5b')]({'where':{'UserId':_0x1d5d58['id'],'OpenchannelQueueId':_0x9ab06e['params']['id']},'transaction':_0xef53c8});});})['then'](function(){_0xbf8361['forEach'](function(_0x33c2a4){socket[_0x3dca('0x5c')](_0x3dca('0x5d'),{'UserId':_0x33c2a4['id'],'OpenchannelQueueId':_0x10d8ed['id']});});});});});}})[_0x3dca('0x17')](respondWithStatusCode(_0x2649c6,null))[_0x3dca('0x2b')](handleError(_0x2649c6,null));};exports['removeTeams']=function(_0x5d5e97,_0x2af4b0){return db[_0x3dca('0x51')][_0x3dca('0x29')]({'where':{'id':_0x5d5e97[_0x3dca('0x28')][_0x3dca('0x5e')]},'attributes':['id'],'include':[{'model':db[_0x3dca('0x49')],'as':_0x3dca('0x53'),'attributes':['id'],'raw':!![]}]})[_0x3dca('0x17')](handleEntityNotFound(_0x2af4b0,null))['then'](function(_0x5ae28f){var _0x5b362a=_['map'](_0x5ae28f,'id');var _0x3cab5e=[];var _0x3df237=[];var _0x4b83b4=squel[_0x3dca('0x5f')]();_0x4b83b4[_0x3dca('0x60')]('tq.TeamId')[_0x3dca('0x61')](_0x3dca('0x62'),'tq')[_0x3dca('0x63')](_0x3dca('0x64'),'ut',_0x3dca('0x65'))[_0x3dca('0x26')]('OpenchannelQueueId\x20=\x20?',_0x5d5e97[_0x3dca('0x2c')]['id']);for(var _0x53cfb6=0x0;_0x53cfb6<_0x5ae28f[_0x3dca('0x32')];_0x53cfb6+=0x1){let _0x3e8b68=_0x5ae28f[_0x53cfb6];for(var _0x5ffde7=0x0;_0x5ffde7<_0x3e8b68[_0x3dca('0x53')][_0x3dca('0x32')];_0x5ffde7+=0x1){let _0x5c3178=_0x3e8b68[_0x3dca('0x53')][_0x5ffde7];var _0x27703c=_0x4b83b4[_0x3dca('0x66')]();_0x27703c['where'](_0x3dca('0x67'),_0x5c3178['id']);_0x3df237[_0x3dca('0x68')](db['sequelize'][_0x3dca('0x28')](_0x27703c[_0x3dca('0x69')](),{'type':db[_0x3dca('0x58')][_0x3dca('0x6a')]['SELECT']})[_0x3dca('0x17')](function(_0x2512ab){if(_0x2512ab['length']===0x1){return _0x5c3178['id'];}else{var _0x79b2f9=_['every'](_[_0x3dca('0x1f')](_0x2512ab,'TeamId'),function(_0x2d4fa6){return _[_0x3dca('0x6b')](_0x5b362a,_0x2d4fa6);});if(_0x79b2f9){return _0x5c3178['id'];}}}));}}return BPromise[_0x3dca('0x6c')](_0x3df237)[_0x3dca('0x17')](function(_0x46ce31){_0x3cab5e=_(_0x3cab5e)[_0x3dca('0x6d')](_0x46ce31)[_0x3dca('0x6e')]()[_0x3dca('0x6f')]();return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x5d5e97[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](function(_0x1d610e){return db[_0x3dca('0x58')][_0x3dca('0x59')](function(_0x32133f){return _0x1d610e[_0x3dca('0x70')](_0x5d5e97[_0x3dca('0x28')][_0x3dca('0x5e')],{'transaction':_0x32133f})['then'](function(){if(!_[_0x3dca('0x71')](_0x3cab5e)){return _0x1d610e['removeAgents'](_0x3cab5e,{'transaction':_0x32133f});}})[_0x3dca('0x17')](function(){_0x3cab5e[_0x3dca('0x72')](function(_0x211fd5){socket[_0x3dca('0x5c')](_0x3dca('0x73'),{'UserId':_0x211fd5,'OpenchannelQueueId':_0x1d610e['id']});});});});});});})[_0x3dca('0x17')](respondWithStatusCode(_0x2af4b0,null))['catch'](handleError(_0x2af4b0,null));};exports['addAgents']=function(_0x2b6169,_0xdff527){return db['OpenchannelQueue']['find']({'where':{'id':_0x2b6169[_0x3dca('0x2c')]['id']}})['then'](handleEntityNotFound(_0xdff527,null))['then'](function(_0x8ccc08){if(_0x8ccc08){return _0x8ccc08[_0x3dca('0x74')](_0x2b6169[_0x3dca('0x3e')]['ids'],_[_0x3dca('0x75')](_0x2b6169[_0x3dca('0x3e')],[_0x3dca('0x5e'),'id'])||{})['spread'](function(_0x5248a6){for(var _0xd1a00a=0x0;_0xd1a00a<_0x2b6169['body']['ids']['length'];_0xd1a00a+=0x1){socket[_0x3dca('0x5c')](_0x3dca('0x5d'),{'UserId':Number(_0x2b6169['body'][_0x3dca('0x5e')][_0xd1a00a]),'OpenchannelQueueId':Number(_0x2b6169['params']['id'])});}return _0x5248a6;});}})['then'](respondWithResult(_0xdff527,null))[_0x3dca('0x2b')](handleError(_0xdff527,null));};exports[_0x3dca('0x76')]=function(_0x523b7c,_0x415feb){return db[_0x3dca('0x20')][_0x3dca('0x36')]({'where':{'id':_0x523b7c[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x415feb,null))[_0x3dca('0x17')](function(_0x308fde){if(_0x308fde){return _0x308fde[_0x3dca('0x76')](_0x523b7c['query'][_0x3dca('0x5e')])[_0x3dca('0x17')](function(){if(_[_0x3dca('0x77')](_0x523b7c['query'][_0x3dca('0x5e')])){for(var _0x39c357=0x0;_0x39c357<_0x523b7c[_0x3dca('0x28')][_0x3dca('0x5e')][_0x3dca('0x32')];_0x39c357+=0x1){socket[_0x3dca('0x5c')](_0x3dca('0x73'),{'UserId':Number(_0x523b7c[_0x3dca('0x28')]['ids'][_0x39c357]),'OpenchannelQueueId':Number(_0x523b7c[_0x3dca('0x2c')]['id'])});}}else{socket[_0x3dca('0x5c')](_0x3dca('0x73'),{'UserId':Number(_0x523b7c[_0x3dca('0x28')][_0x3dca('0x5e')]),'OpenchannelQueueId':Number(_0x523b7c['params']['id'])});}});}})[_0x3dca('0x17')](respondWithStatusCode(_0x415feb,null))['catch'](handleError(_0x415feb,null));};exports[_0x3dca('0x78')]=function(_0x49d937,_0x95173a){var _0x7e2519={};var _0x1e3de9={};var _0x3df12f;var _0x1d31ab;return db[_0x3dca('0x20')]['findOne']({'where':{'id':_0x49d937[_0x3dca('0x2c')]['id']}})[_0x3dca('0x17')](handleEntityNotFound(_0x95173a,null))[_0x3dca('0x17')](function(_0x218c43){if(_0x218c43){_0x3df12f=_0x218c43;_0x1e3de9[_0x3dca('0x2d')]=_[_0x3dca('0x2e')](db['User'][_0x3dca('0x21')]);_0x1e3de9[_0x3dca('0x28')]=_[_0x3dca('0x2e')](_0x49d937[_0x3dca('0x28')]);_0x1e3de9[_0x3dca('0x43')]=_[_0x3dca('0x30')](_0x1e3de9[_0x3dca('0x2d')],_0x1e3de9[_0x3dca('0x28')]);_0x7e2519[_0x3dca('0x2f')]=_['intersection'](_0x1e3de9['model'],qs['fields'](_0x49d937[_0x3dca('0x28')][_0x3dca('0x31')]));_0x7e2519[_0x3dca('0x2f')]=_0x7e2519[_0x3dca('0x2f')][_0x3dca('0x32')]?_0x7e2519[_0x3dca('0x2f')]:_0x1e3de9[_0x3dca('0x2d')];_0x7e2519[_0x3dca('0x46')]=qs['sort'](_0x49d937[_0x3dca('0x28')][_0x3dca('0x47')]);_0x7e2519[_0x3dca('0x26')]=qs[_0x3dca('0x43')](_[_0x3dca('0x79')](_0x49d937[_0x3dca('0x28')],_0x1e3de9['filters']));if(_0x49d937[_0x3dca('0x28')][_0x3dca('0x48')]){_0x7e2519[_0x3dca('0x26')]=_[_0x3dca('0x34')](_0x7e2519[_0x3dca('0x26')],{'$or':_['map'](_0x7e2519[_0x3dca('0x2f')],function(_0x1eb59d){var _0x485f13={};_0x485f13[_0x1eb59d]={'$like':'%'+_0x49d937[_0x3dca('0x28')][_0x3dca('0x48')]+'%'};return _0x485f13;})});}_0x7e2519=_[_0x3dca('0x34')]({},_0x7e2519,_0x49d937[_0x3dca('0x35')]);return _0x3df12f[_0x3dca('0x78')](_0x7e2519);}})[_0x3dca('0x17')](function(_0x427aa7){if(_0x427aa7){_0x1d31ab=_0x427aa7['length'];if(!_0x49d937[_0x3dca('0x28')]['hasOwnProperty'](_0x3dca('0x45'))){_0x7e2519[_0x3dca('0x12')]=qs[_0x3dca('0x12')](_0x49d937[_0x3dca('0x28')][_0x3dca('0x12')]);_0x7e2519[_0x3dca('0x10')]=qs[_0x3dca('0x10')](_0x49d937[_0x3dca('0x28')][_0x3dca('0x10')]);}return _0x3df12f[_0x3dca('0x78')](_0x7e2519);}})['then'](function(_0x57a88a){if(_0x57a88a){return _0x57a88a?{'count':_0x1d31ab,'rows':_0x57a88a}:null;}})[_0x3dca('0x17')](respondWithResult(_0x95173a,null))[_0x3dca('0x2b')](handleError(_0x95173a,null));}; \ No newline at end of file +var _0xceb3=['../../config/environment','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','then','get','OpenchannelQueues','UserProfileResource','stack','send','index','map','rawAttributes','fieldName','type','key','where','OpenchannelQueue','query','catch','show','params','model','keys','intersection','fields','length','attributes','includeAll','include','options','find','create','user','UserProfileSection','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','filters','hasOwnProperty','nolimit','order','sort','OpenchannelQueueId','filter','merge','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','all','union','compact','value','removeTeams','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','pick','util','lodash','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x4fa892,_0x4e66a0){var _0x260ef6=function(_0x3ac4a5){while(--_0x3ac4a5){_0x4fa892['push'](_0x4fa892['shift']());}};_0x260ef6(++_0x4e66a0);}(_0xceb3,0x154));var _0x3ceb=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0xceb3[_0x47cfa0];return _0x386b1d;};'use strict';var BPromise=require('bluebird');var util=require(_0x3ceb('0x0'));var _=require(_0x3ceb('0x1'));var squel=require('squel');var Redis=require(_0x3ceb('0x2'));var qs=require(_0x3ceb('0x3'));var logger=require(_0x3ceb('0x4'))('api');var config=require(_0x3ceb('0x5'));var db=require('../../mysqldb')['db'];config[_0x3ceb('0x6')]=_['defaults'](config[_0x3ceb('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x3ceb('0x7'))(new Redis(config[_0x3ceb('0x6')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4452a4,_0x5dfb17){_0x5dfb17=_0x5dfb17||0xcc;return function(_0x4a7a4b){if(_0x4a7a4b){return _0x4452a4[_0x3ceb('0x8')](_0x5dfb17);}return _0x4452a4[_0x3ceb('0x9')](_0x5dfb17)[_0x3ceb('0xa')]();};}function respondWithResult(_0x1bca8e,_0x109791){_0x109791=_0x109791||0xc8;return function(_0xbcb697){if(_0xbcb697){return _0x1bca8e[_0x3ceb('0x9')](_0x109791)[_0x3ceb('0xb')](_0xbcb697);}};}function respondWithFilteredResult(_0x1de49a,_0x133242){return function(_0x38236a){if(_0x38236a){var _0x591146=typeof _0x133242[_0x3ceb('0xc')]===_0x3ceb('0xd')&&typeof _0x133242[_0x3ceb('0xe')]===_0x3ceb('0xd');var _0x2ed163=_0x38236a[_0x3ceb('0xf')];var _0x76a479=_0x591146?0x0:_0x133242[_0x3ceb('0xc')];var _0x4a6e50=_0x591146?_0x38236a['count']:_0x133242[_0x3ceb('0xc')]+_0x133242[_0x3ceb('0xe')];var _0x4c0858;if(_0x4a6e50>=_0x2ed163){_0x4a6e50=_0x2ed163;_0x4c0858=0xc8;}else{_0x4c0858=0xce;}_0x1de49a[_0x3ceb('0x9')](_0x4c0858);return _0x1de49a['set'](_0x3ceb('0x10'),_0x76a479+'-'+_0x4a6e50+'/'+_0x2ed163)[_0x3ceb('0xb')](_0x38236a);}return null;};}function saveUpdates(_0x369b39){return function(_0x555820){if(_0x555820){return _0x555820[_0x3ceb('0x11')](_0x369b39)['then'](function(_0x5be77c){return _0x5be77c;});}return null;};}function removeEntity(_0x5b1df5){return function(_0x1ca095){if(_0x1ca095){return _0x1ca095[_0x3ceb('0x12')]()[_0x3ceb('0x13')](function(){var _0x46069c=_0x1ca095[_0x3ceb('0x14')]({'plain':!![]});var _0x51277c=_0x3ceb('0x15');return db[_0x3ceb('0x16')]['destroy']({'where':{'type':_0x51277c,'resourceId':_0x46069c['id']}})['then'](function(){return _0x1ca095;});})[_0x3ceb('0x13')](function(){_0x5b1df5[_0x3ceb('0x9')](0xcc)[_0x3ceb('0xa')]();});}};}function handleEntityNotFound(_0x156cc9){return function(_0x4b8b6f){if(!_0x4b8b6f){_0x156cc9[_0x3ceb('0x8')](0x194);}return _0x4b8b6f;};}function handleError(_0x1073db,_0x141348){_0x141348=_0x141348||0x1f4;return function(_0xb7e13f){logger['error'](_0xb7e13f[_0x3ceb('0x17')]);if(_0xb7e13f['name']){delete _0xb7e13f['name'];}_0x1073db[_0x3ceb('0x9')](_0x141348)[_0x3ceb('0x18')](_0xb7e13f);};}exports[_0x3ceb('0x19')]=function(_0x6cc1d1,_0xe66fdd){var _0x40ad2d={};var _0x3aaf1f={'count':0x0,'rows':[]};var _0x2aaa32=_[_0x3ceb('0x1a')](db['OpenchannelQueue'][_0x3ceb('0x1b')],function(_0xa78529){return{'name':_0xa78529[_0x3ceb('0x1c')],'type':_0xa78529[_0x3ceb('0x1d')][_0x3ceb('0x1e')]};});_0x40ad2d=qs['getOptions'](_0x2aaa32,_0x6cc1d1);var _0x1d02ed={'where':_0x40ad2d[_0x3ceb('0x1f')]};return db[_0x3ceb('0x20')][_0x3ceb('0xf')](_0x1d02ed)[_0x3ceb('0x13')](function(_0x15f644){_0x3aaf1f['count']=_0x15f644;_0x40ad2d['include']=qs['include'](_0x6cc1d1[_0x3ceb('0x21')]);return db[_0x3ceb('0x20')]['findAll'](_0x40ad2d);})[_0x3ceb('0x13')](function(_0x24cee1){_0x3aaf1f['rows']=_0x24cee1;return _0x3aaf1f;})[_0x3ceb('0x13')](respondWithFilteredResult(_0xe66fdd,_0x40ad2d))[_0x3ceb('0x22')](handleError(_0xe66fdd,null));};exports[_0x3ceb('0x23')]=function(_0x5906d5,_0x11fdc8){var _0x3e6def={'raw':!![],'where':{'id':_0x5906d5[_0x3ceb('0x24')]['id']}},_0x5674a0={};_0x5674a0[_0x3ceb('0x25')]=_['keys'](db[_0x3ceb('0x20')][_0x3ceb('0x1b')]);_0x5674a0[_0x3ceb('0x21')]=_[_0x3ceb('0x26')](_0x5906d5[_0x3ceb('0x21')]);_0x5674a0['filters']=_[_0x3ceb('0x27')](_0x5674a0[_0x3ceb('0x25')],_0x5674a0[_0x3ceb('0x21')]);_0x3e6def['attributes']=_['intersection'](_0x5674a0[_0x3ceb('0x25')],qs[_0x3ceb('0x28')](_0x5906d5[_0x3ceb('0x21')][_0x3ceb('0x28')]));_0x3e6def['attributes']=_0x3e6def['attributes'][_0x3ceb('0x29')]?_0x3e6def[_0x3ceb('0x2a')]:_0x5674a0[_0x3ceb('0x25')];if(_0x5906d5['query'][_0x3ceb('0x2b')]){_0x3e6def[_0x3ceb('0x2c')]=[{'all':!![]}];}_0x3e6def=_['merge']({},_0x3e6def,_0x5906d5[_0x3ceb('0x2d')]);return db[_0x3ceb('0x20')][_0x3ceb('0x2e')](_0x3e6def)['then'](handleEntityNotFound(_0x11fdc8,null))['then'](respondWithResult(_0x11fdc8,null))['catch'](handleError(_0x11fdc8,null));};exports['create']=function(_0x4d9f28,_0x54128){return db[_0x3ceb('0x20')][_0x3ceb('0x2f')](_0x4d9f28['body'],{})['then'](function(_0x45a6e3){var _0x2c1088=_0x4d9f28[_0x3ceb('0x30')][_0x3ceb('0x14')]({'plain':!![]});if(!_0x2c1088)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c1088['role']==='user'){var _0x5c53e7=_0x45a6e3[_0x3ceb('0x14')]({'plain':!![]});var _0x3d68b1=_0x3ceb('0x15');return db[_0x3ceb('0x31')][_0x3ceb('0x2e')]({'where':{'name':_0x3d68b1,'userProfileId':_0x2c1088['userProfileId']},'raw':!![]})[_0x3ceb('0x13')](function(_0xf353fa){if(_0xf353fa&&_0xf353fa[_0x3ceb('0x32')]===0x0){return db[_0x3ceb('0x16')][_0x3ceb('0x2f')]({'name':_0x5c53e7[_0x3ceb('0x33')],'resourceId':_0x5c53e7['id'],'type':_0xf353fa[_0x3ceb('0x33')],'sectionId':_0xf353fa['id']},{})[_0x3ceb('0x13')](function(){return _0x45a6e3;});}else{return _0x45a6e3;}})[_0x3ceb('0x22')](function(_0x4715e7){logger[_0x3ceb('0x34')](_0x3ceb('0x35'),_0x4715e7);throw _0x4715e7;});}return _0x45a6e3;})[_0x3ceb('0x13')](respondWithResult(_0x54128,0xc9))[_0x3ceb('0x22')](handleError(_0x54128,null));};exports[_0x3ceb('0x11')]=function(_0x1b9e8c,_0x4d7738){if(_0x1b9e8c[_0x3ceb('0x36')]['id']){delete _0x1b9e8c['body']['id'];}return db['OpenchannelQueue'][_0x3ceb('0x2e')]({'where':{'id':_0x1b9e8c['params']['id']}})[_0x3ceb('0x13')](handleEntityNotFound(_0x4d7738,null))['then'](saveUpdates(_0x1b9e8c[_0x3ceb('0x36')],null))['then'](respondWithResult(_0x4d7738,null))[_0x3ceb('0x22')](handleError(_0x4d7738,null));};exports[_0x3ceb('0x12')]=function(_0xb69637,_0x5526fc){return db[_0x3ceb('0x20')][_0x3ceb('0x2e')]({'where':{'id':_0xb69637[_0x3ceb('0x24')]['id']}})[_0x3ceb('0x13')](handleEntityNotFound(_0x5526fc,null))[_0x3ceb('0x13')](removeEntity(_0x5526fc,null))[_0x3ceb('0x22')](handleError(_0x5526fc,null));};exports[_0x3ceb('0x37')]=function(_0x2a0e83,_0x2f804c){return db[_0x3ceb('0x20')][_0x3ceb('0x37')]()[_0x3ceb('0x13')](respondWithResult(_0x2f804c,null))[_0x3ceb('0x22')](handleError(_0x2f804c,null));};exports[_0x3ceb('0x38')]=function(_0x56e55b,_0x2c0d3f){var _0x9651ca={'raw':!![],'where':{}},_0x1f2084={},_0x5b2dcb;return db[_0x3ceb('0x20')][_0x3ceb('0x39')]({'where':{'id':_0x56e55b[_0x3ceb('0x24')]['id']}})[_0x3ceb('0x13')](handleEntityNotFound(_0x2c0d3f,null))[_0x3ceb('0x13')](function(_0x1684f8){if(_0x1684f8){_0x5b2dcb=_0x1684f8[_0x3ceb('0x14')]({'plain':!![]});_0x1f2084[_0x3ceb('0x25')]=_[_0x3ceb('0x26')](db[_0x3ceb('0x3a')]['rawAttributes']);_0x1f2084[_0x3ceb('0x21')]=_[_0x3ceb('0x26')](_0x56e55b[_0x3ceb('0x21')]);_0x1f2084[_0x3ceb('0x3b')]=_['intersection'](_0x1f2084[_0x3ceb('0x25')],_0x1f2084['query']);_0x9651ca[_0x3ceb('0x2a')]=_[_0x3ceb('0x27')](_0x1f2084[_0x3ceb('0x25')],qs[_0x3ceb('0x28')](_0x56e55b[_0x3ceb('0x21')][_0x3ceb('0x28')]));_0x9651ca[_0x3ceb('0x2a')]=_0x9651ca[_0x3ceb('0x2a')][_0x3ceb('0x29')]?_0x9651ca[_0x3ceb('0x2a')]:_0x1f2084['model'];if(!_0x56e55b['query'][_0x3ceb('0x3c')](_0x3ceb('0x3d'))){_0x9651ca[_0x3ceb('0xe')]=qs[_0x3ceb('0xe')](_0x56e55b[_0x3ceb('0x21')][_0x3ceb('0xe')]);_0x9651ca[_0x3ceb('0xc')]=qs[_0x3ceb('0xc')](_0x56e55b[_0x3ceb('0x21')][_0x3ceb('0xc')]);}_0x9651ca[_0x3ceb('0x3e')]=qs[_0x3ceb('0x3f')](_0x56e55b[_0x3ceb('0x21')][_0x3ceb('0x3f')]);_0x9651ca[_0x3ceb('0x1f')]=qs[_0x3ceb('0x3b')](_['pick'](_0x56e55b[_0x3ceb('0x21')],_0x1f2084[_0x3ceb('0x3b')]));_0x9651ca[_0x3ceb('0x1f')][_0x3ceb('0x40')]=_0x1684f8['id'];if(_0x56e55b[_0x3ceb('0x21')][_0x3ceb('0x41')]){_0x9651ca['where']=_[_0x3ceb('0x42')](_0x9651ca[_0x3ceb('0x1f')],{'$or':_['map'](_0x9651ca[_0x3ceb('0x2a')],function(_0x446a0d){var _0x571d45={};_0x571d45[_0x446a0d]={'$like':'%'+_0x56e55b['query'][_0x3ceb('0x41')]+'%'};return _0x571d45;})});}_0x9651ca=_['merge']({},_0x9651ca,_0x56e55b[_0x3ceb('0x2d')]);return db[_0x3ceb('0x3a')][_0x3ceb('0x43')](_0x9651ca);}})[_0x3ceb('0x13')](function(_0xcd0fb9){if(_0xcd0fb9){return db[_0x3ceb('0x44')][_0x3ceb('0x45')]({'where':{'id':_[_0x3ceb('0x1a')](_0xcd0fb9,_0x3ceb('0x46')),'role':_0x3ceb('0x47')},'attributes':['id',_0x3ceb('0x33'),_0x3ceb('0x48'),_0x3ceb('0x49'),_0x3ceb('0x4a')]});}})['then'](function(_0x37441f){if(_0x37441f){return{'count':_0x37441f[_0x3ceb('0xf')],'rows':_[_0x3ceb('0x1a')](_0x37441f['rows'],function(_0x4b7a2b){return{'membername':_0x4b7a2b[_0x3ceb('0x33')],'UserId':_0x4b7a2b['id'],'queue_name':_0x5b2dcb[_0x3ceb('0x33')],'OpenchannelQueueId':_0x5b2dcb['id'],'interface':util[_0x3ceb('0x4b')](_0x3ceb('0x4c'),_0x3ceb('0x4d'),_0x4b7a2b[_0x3ceb('0x33')]),'penalty':0x0,'paused':_0x4b7a2b['openchannelPause'],'createdAt':_0x4b7a2b[_0x3ceb('0x4a')],'updatedAt':_0x4b7a2b['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3ceb('0x13')](respondWithFilteredResult(_0x2c0d3f,_0x9651ca))[_0x3ceb('0x22')](handleError(_0x2c0d3f,null));};exports['getTeams']=function(_0x54db1a,_0x21e87a){var _0xd4d36b={};var _0x5b2eff={};var _0x5d5e08;var _0x577d84;return db[_0x3ceb('0x20')][_0x3ceb('0x39')]({'where':{'id':_0x54db1a['params']['id']}})[_0x3ceb('0x13')](handleEntityNotFound(_0x21e87a,null))['then'](function(_0x59564f){if(_0x59564f){_0x5d5e08=_0x59564f;_0x5b2eff[_0x3ceb('0x25')]=_[_0x3ceb('0x26')](db['Team'][_0x3ceb('0x1b')]);_0x5b2eff[_0x3ceb('0x21')]=_[_0x3ceb('0x26')](_0x54db1a[_0x3ceb('0x21')]);_0x5b2eff[_0x3ceb('0x3b')]=_[_0x3ceb('0x27')](_0x5b2eff[_0x3ceb('0x25')],_0x5b2eff[_0x3ceb('0x21')]);_0xd4d36b[_0x3ceb('0x2a')]=_[_0x3ceb('0x27')](_0x5b2eff[_0x3ceb('0x25')],qs['fields'](_0x54db1a[_0x3ceb('0x21')][_0x3ceb('0x28')]));_0xd4d36b[_0x3ceb('0x2a')]=_0xd4d36b[_0x3ceb('0x2a')][_0x3ceb('0x29')]?_0xd4d36b['attributes']:_0x5b2eff[_0x3ceb('0x25')];_0xd4d36b[_0x3ceb('0x3e')]=qs[_0x3ceb('0x3f')](_0x54db1a[_0x3ceb('0x21')][_0x3ceb('0x3f')]);_0xd4d36b['where']=qs[_0x3ceb('0x3b')](_['pick'](_0x54db1a[_0x3ceb('0x21')],_0x5b2eff['filters']));if(_0x54db1a['query']['filter']){_0xd4d36b[_0x3ceb('0x1f')]=_[_0x3ceb('0x42')](_0xd4d36b['where'],{'$or':_[_0x3ceb('0x1a')](_0xd4d36b[_0x3ceb('0x2a')],function(_0x2d393f){var _0x1ddb80={};_0x1ddb80[_0x2d393f]={'$like':'%'+_0x54db1a[_0x3ceb('0x21')][_0x3ceb('0x41')]+'%'};return _0x1ddb80;})});}_0xd4d36b=_[_0x3ceb('0x42')]({},_0xd4d36b,_0x54db1a[_0x3ceb('0x2d')]);return _0x5d5e08[_0x3ceb('0x4e')](_0xd4d36b);}})[_0x3ceb('0x13')](function(_0x5165d1){if(_0x5165d1){_0x577d84=_0x5165d1[_0x3ceb('0x29')];if(!_0x54db1a[_0x3ceb('0x21')][_0x3ceb('0x3c')](_0x3ceb('0x3d'))){_0xd4d36b['limit']=qs[_0x3ceb('0xe')](_0x54db1a[_0x3ceb('0x21')][_0x3ceb('0xe')]);_0xd4d36b[_0x3ceb('0xc')]=qs[_0x3ceb('0xc')](_0x54db1a[_0x3ceb('0x21')]['offset']);}return _0x5d5e08[_0x3ceb('0x4e')](_0xd4d36b);}})['then'](function(_0x2e0051){if(_0x2e0051){return _0x2e0051?{'count':_0x577d84,'rows':_0x2e0051}:null;}})['then'](respondWithResult(_0x21e87a,null))[_0x3ceb('0x22')](handleError(_0x21e87a,null));};exports[_0x3ceb('0x4f')]=function(_0x4cf5c1,_0x494313){var _0x34b5e3=_0x4cf5c1[_0x3ceb('0x36')][_0x3ceb('0x50')];return db[_0x3ceb('0x51')][_0x3ceb('0x43')]({'where':{'id':_0x34b5e3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3ceb('0x52'),'attributes':['id',_0x3ceb('0x33'),'online',_0x3ceb('0x53'),_0x3ceb('0x54')],'raw':!![]}]})[_0x3ceb('0x13')](function(_0x1c858f){if(_0x1c858f){var _0xa3aee=_[_0x3ceb('0x55')](_0x1c858f,function(_0x1cd65a){var _0x2b6f35=_0x1cd65a[_0x3ceb('0x14')]({'plain':!![]});return _0x2b6f35['Agents'];});return db[_0x3ceb('0x20')][_0x3ceb('0x2e')]({'where':{'id':_0x4cf5c1[_0x3ceb('0x24')]['id']}})[_0x3ceb('0x13')](function(_0x416e9e){return db[_0x3ceb('0x56')][_0x3ceb('0x57')](function(_0x47dd84){return _0x416e9e[_0x3ceb('0x4f')](_0x34b5e3,{'transaction':_0x47dd84})[_0x3ceb('0x13')](function(){return BPromise['each'](_0xa3aee,function(_0x6a0c81){return db['UserOpenchannelQueue'][_0x3ceb('0x58')]({'where':{'UserId':_0x6a0c81['id'],'OpenchannelQueueId':_0x4cf5c1['params']['id']},'transaction':_0x47dd84});});})['then'](function(){_0xa3aee[_0x3ceb('0x59')](function(_0x34d0e8){socket[_0x3ceb('0x5a')](_0x3ceb('0x5b'),{'UserId':_0x34d0e8['id'],'OpenchannelQueueId':_0x416e9e['id']});});});});});}})[_0x3ceb('0x13')](respondWithStatusCode(_0x494313,null))[_0x3ceb('0x22')](handleError(_0x494313,null));};exports['removeTeams']=function(_0x4e32f2,_0x557f78){return db[_0x3ceb('0x51')][_0x3ceb('0x43')]({'where':{'id':_0x4e32f2['query'][_0x3ceb('0x50')]},'attributes':['id'],'include':[{'model':db[_0x3ceb('0x44')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3ceb('0x13')](handleEntityNotFound(_0x557f78,null))[_0x3ceb('0x13')](function(_0x22780a){var _0x57d0f9=_['map'](_0x22780a,'id');var _0x1890f0=[];var _0x351d04=[];var _0x2d608e=squel['select']();_0x2d608e[_0x3ceb('0x5c')](_0x3ceb('0x5d'))[_0x3ceb('0x5e')](_0x3ceb('0x5f'),'tq')[_0x3ceb('0x60')]('user_has_teams','ut',_0x3ceb('0x61'))[_0x3ceb('0x1f')]('OpenchannelQueueId\x20=\x20?',_0x4e32f2['params']['id']);for(var _0x5acf42=0x0;_0x5acf42<_0x22780a['length'];_0x5acf42+=0x1){let _0x590ab7=_0x22780a[_0x5acf42];for(var _0x4f72b8=0x0;_0x4f72b8<_0x590ab7[_0x3ceb('0x52')][_0x3ceb('0x29')];_0x4f72b8+=0x1){let _0x48103c=_0x590ab7[_0x3ceb('0x52')][_0x4f72b8];var _0x4d1e42=_0x2d608e[_0x3ceb('0x62')]();_0x4d1e42[_0x3ceb('0x1f')]('ut.UserId\x20=\x20?',_0x48103c['id']);_0x351d04[_0x3ceb('0x63')](db[_0x3ceb('0x56')][_0x3ceb('0x21')](_0x4d1e42[_0x3ceb('0x64')](),{'type':db[_0x3ceb('0x56')][_0x3ceb('0x65')]['SELECT']})['then'](function(_0x242794){if(_0x242794[_0x3ceb('0x29')]===0x1){return _0x48103c['id'];}else{var _0x1780df=_['every'](_[_0x3ceb('0x1a')](_0x242794,'TeamId'),function(_0x5e428b){return _['includes'](_0x57d0f9,_0x5e428b);});if(_0x1780df){return _0x48103c['id'];}}}));}}return BPromise[_0x3ceb('0x66')](_0x351d04)[_0x3ceb('0x13')](function(_0x27eb60){_0x1890f0=_(_0x1890f0)[_0x3ceb('0x67')](_0x27eb60)[_0x3ceb('0x68')]()[_0x3ceb('0x69')]();return db[_0x3ceb('0x20')]['find']({'where':{'id':_0x4e32f2[_0x3ceb('0x24')]['id']}})[_0x3ceb('0x13')](function(_0x65554d){return db[_0x3ceb('0x56')][_0x3ceb('0x57')](function(_0x29d4ff){return _0x65554d[_0x3ceb('0x6a')](_0x4e32f2[_0x3ceb('0x21')][_0x3ceb('0x50')],{'transaction':_0x29d4ff})[_0x3ceb('0x13')](function(){if(!_['isEmpty'](_0x1890f0)){return _0x65554d[_0x3ceb('0x6b')](_0x1890f0,{'transaction':_0x29d4ff});}})[_0x3ceb('0x13')](function(){_0x1890f0[_0x3ceb('0x59')](function(_0x7f6c64){socket['emit'](_0x3ceb('0x6c'),{'UserId':_0x7f6c64,'OpenchannelQueueId':_0x65554d['id']});});});});});});})[_0x3ceb('0x13')](respondWithStatusCode(_0x557f78,null))[_0x3ceb('0x22')](handleError(_0x557f78,null));};exports[_0x3ceb('0x6d')]=function(_0x3e3f9c,_0x285e93){return db['OpenchannelQueue'][_0x3ceb('0x2e')]({'where':{'id':_0x3e3f9c[_0x3ceb('0x24')]['id']}})[_0x3ceb('0x13')](handleEntityNotFound(_0x285e93,null))[_0x3ceb('0x13')](function(_0x49d2f1){if(_0x49d2f1){return _0x49d2f1[_0x3ceb('0x6d')](_0x3e3f9c[_0x3ceb('0x36')][_0x3ceb('0x50')],_[_0x3ceb('0x6e')](_0x3e3f9c[_0x3ceb('0x36')],['ids','id'])||{})[_0x3ceb('0x6f')](function(_0x3bfd45){for(var _0x42d909=0x0;_0x42d909<_0x3e3f9c['body'][_0x3ceb('0x50')]['length'];_0x42d909+=0x1){socket['emit'](_0x3ceb('0x5b'),{'UserId':Number(_0x3e3f9c[_0x3ceb('0x36')][_0x3ceb('0x50')][_0x42d909]),'OpenchannelQueueId':Number(_0x3e3f9c[_0x3ceb('0x24')]['id'])});}return _0x3bfd45;});}})[_0x3ceb('0x13')](respondWithResult(_0x285e93,null))['catch'](handleError(_0x285e93,null));};exports[_0x3ceb('0x6b')]=function(_0x32aeda,_0x472751){return db['OpenchannelQueue'][_0x3ceb('0x2e')]({'where':{'id':_0x32aeda[_0x3ceb('0x24')]['id']}})[_0x3ceb('0x13')](handleEntityNotFound(_0x472751,null))[_0x3ceb('0x13')](function(_0x1a8ada){if(_0x1a8ada){return _0x1a8ada[_0x3ceb('0x6b')](_0x32aeda[_0x3ceb('0x21')][_0x3ceb('0x50')])[_0x3ceb('0x13')](function(){if(_[_0x3ceb('0x70')](_0x32aeda[_0x3ceb('0x21')][_0x3ceb('0x50')])){for(var _0x5a256c=0x0;_0x5a256c<_0x32aeda[_0x3ceb('0x21')][_0x3ceb('0x50')][_0x3ceb('0x29')];_0x5a256c+=0x1){socket[_0x3ceb('0x5a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x32aeda[_0x3ceb('0x21')][_0x3ceb('0x50')][_0x5a256c]),'OpenchannelQueueId':Number(_0x32aeda[_0x3ceb('0x24')]['id'])});}}else{socket[_0x3ceb('0x5a')]('userOpenchannelQueue:remove',{'UserId':Number(_0x32aeda[_0x3ceb('0x21')][_0x3ceb('0x50')]),'OpenchannelQueueId':Number(_0x32aeda['params']['id'])});}});}})[_0x3ceb('0x13')](respondWithStatusCode(_0x472751,null))[_0x3ceb('0x22')](handleError(_0x472751,null));};exports[_0x3ceb('0x71')]=function(_0x77ee36,_0x398a2f){var _0x199982={};var _0x44f5be={};var _0x48a7cf;var _0x487533;return db[_0x3ceb('0x20')][_0x3ceb('0x39')]({'where':{'id':_0x77ee36['params']['id']}})[_0x3ceb('0x13')](handleEntityNotFound(_0x398a2f,null))[_0x3ceb('0x13')](function(_0x148e69){if(_0x148e69){_0x48a7cf=_0x148e69;_0x44f5be[_0x3ceb('0x25')]=_[_0x3ceb('0x26')](db['User'][_0x3ceb('0x1b')]);_0x44f5be[_0x3ceb('0x21')]=_[_0x3ceb('0x26')](_0x77ee36[_0x3ceb('0x21')]);_0x44f5be[_0x3ceb('0x3b')]=_['intersection'](_0x44f5be[_0x3ceb('0x25')],_0x44f5be[_0x3ceb('0x21')]);_0x199982[_0x3ceb('0x2a')]=_[_0x3ceb('0x27')](_0x44f5be[_0x3ceb('0x25')],qs[_0x3ceb('0x28')](_0x77ee36['query']['fields']));_0x199982[_0x3ceb('0x2a')]=_0x199982['attributes'][_0x3ceb('0x29')]?_0x199982[_0x3ceb('0x2a')]:_0x44f5be['model'];_0x199982[_0x3ceb('0x3e')]=qs['sort'](_0x77ee36[_0x3ceb('0x21')][_0x3ceb('0x3f')]);_0x199982['where']=qs['filters'](_[_0x3ceb('0x72')](_0x77ee36[_0x3ceb('0x21')],_0x44f5be['filters']));if(_0x77ee36[_0x3ceb('0x21')]['filter']){_0x199982[_0x3ceb('0x1f')]=_[_0x3ceb('0x42')](_0x199982[_0x3ceb('0x1f')],{'$or':_[_0x3ceb('0x1a')](_0x199982['attributes'],function(_0x3d7115){var _0xcbbd4e={};_0xcbbd4e[_0x3d7115]={'$like':'%'+_0x77ee36[_0x3ceb('0x21')]['filter']+'%'};return _0xcbbd4e;})});}_0x199982=_['merge']({},_0x199982,_0x77ee36[_0x3ceb('0x2d')]);return _0x48a7cf[_0x3ceb('0x71')](_0x199982);}})['then'](function(_0x11ff38){if(_0x11ff38){_0x487533=_0x11ff38[_0x3ceb('0x29')];if(!_0x77ee36[_0x3ceb('0x21')][_0x3ceb('0x3c')]('nolimit')){_0x199982[_0x3ceb('0xe')]=qs[_0x3ceb('0xe')](_0x77ee36[_0x3ceb('0x21')][_0x3ceb('0xe')]);_0x199982[_0x3ceb('0xc')]=qs[_0x3ceb('0xc')](_0x77ee36[_0x3ceb('0x21')][_0x3ceb('0xc')]);}return _0x48a7cf[_0x3ceb('0x71')](_0x199982);}})[_0x3ceb('0x13')](function(_0x3523c3){if(_0x3523c3){return _0x3523c3?{'count':_0x487533,'rows':_0x3523c3}:null;}})['then'](respondWithResult(_0x398a2f,null))[_0x3ceb('0x22')](handleError(_0x398a2f,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 30b2c3f..ee5b0f3 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 _0xe909=['save','update','remove','emit','exports','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x113de1,_0x9c179a){var _0xa1aa86=function(_0x3d84ff){while(--_0x3d84ff){_0x113de1['push'](_0x113de1['shift']());}};_0xa1aa86(++_0x9c179a);}(_0xe909,0x1c5));var _0x9e90=function(_0x4efb22,_0x53b3eb){_0x4efb22=_0x4efb22-0x0;var _0x389e1f=_0xe909[_0x4efb22];return _0x389e1f;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x9e90('0x0'))['db'][_0x9e90('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x9e90('0x2')](0x0);var events={'afterCreate':_0x9e90('0x3'),'afterUpdate':_0x9e90('0x4'),'afterDestroy':_0x9e90('0x5')};function emitEvent(_0x5b5435){return function(_0x870d5a,_0x4416e1,_0x1d0306){OpenchannelQueueEvents[_0x9e90('0x6')](_0x5b5435+':'+_0x870d5a['id'],_0x870d5a);OpenchannelQueueEvents[_0x9e90('0x6')](_0x5b5435,_0x870d5a);_0x1d0306(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x9e90('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xfd0a=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x431e58,_0x464075){var _0x3b608b=function(_0x413c4f){while(--_0x413c4f){_0x431e58['push'](_0x431e58['shift']());}};_0x3b608b(++_0x464075);}(_0xfd0a,0xe6));var _0xafd0=function(_0x3d1187,_0x2a8e79){_0x3d1187=_0x3d1187-0x0;var _0x3ceb4d=_0xfd0a[_0x3d1187];return _0x3ceb4d;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xafd0('0x0'))['db'][_0xafd0('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xafd0('0x2')](0x0);var events={'afterCreate':_0xafd0('0x3'),'afterUpdate':_0xafd0('0x4'),'afterDestroy':_0xafd0('0x5')};function emitEvent(_0x4b6b11){return function(_0x1a0b0c,_0x306718,_0x327b56){OpenchannelQueueEvents[_0xafd0('0x6')](_0x4b6b11+':'+_0x1a0b0c['id'],_0x1a0b0c);OpenchannelQueueEvents[_0xafd0('0x6')](_0x4b6b11,_0x1a0b0c);_0x327b56(null);};}for(var e in events){if(events[_0xafd0('0x7')](e)){var event=events[e];OpenchannelQueue[_0xafd0('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 857268e..ca7e13f 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 _0xc5f9=['../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelQueue.attributes','lodash','util'];(function(_0x96ac9b,_0x4104e0){var _0x7c45c8=function(_0x580b50){while(--_0x580b50){_0x96ac9b['push'](_0x96ac9b['shift']());}};_0x7c45c8(++_0x4104e0);}(_0xc5f9,0x142));var _0x9c5f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc5f9[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x9c5f('0x0'));var util=require(_0x9c5f('0x1'));var logger=require(_0x9c5f('0x2'))(_0x9c5f('0x3'));var moment=require(_0x9c5f('0x4'));var BPromise=require(_0x9c5f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c5f('0x6'));var rimraf=require('rimraf');var config=require(_0x9c5f('0x7'));var attributes=require(_0x9c5f('0x8'));module['exports']=function(_0x5d01fd,_0x3fb15d){return _0x5d01fd['define']('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b9e=['exports','OpenchannelQueue','../../config/logger','api','moment','path','rimraf','./openchannelQueue.attributes'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x5b9e,0x122));var _0xe5b9=function(_0x580d1e,_0x2062d1){_0x580d1e=_0x580d1e-0x0;var _0x475c21=_0x5b9e[_0x580d1e];return _0x475c21;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe5b9('0x0'))(_0xe5b9('0x1'));var moment=require(_0xe5b9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5b9('0x3'));var rimraf=require(_0xe5b9('0x4'));var config=require('../../config/environment');var attributes=require(_0xe5b9('0x5'));module[_0xe5b9('0x6')]=function(_0x5c7543,_0x1a69ef){return _0x5c7543['define'](_0xe5b9('0x7'),attributes,{'tableName':'openchannel_queues','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 f1a6d9a..936fc23 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 _0x9f14=['request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','OpenchannelQueue','findAll','options','attributes','limit','include','map','model','GetOpenchannelQueue','catch','ShowOpenchannelQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','then','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x9f14,0xbf));var _0x49f1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x9f14[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x49f1('0x0'));var util=require(_0x49f1('0x1'));var moment=require(_0x49f1('0x2'));var BPromise=require(_0x49f1('0x3'));var rs=require(_0x49f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49f1('0x5'))['db'];var utils=require(_0x49f1('0x6'));var logger=require(_0x49f1('0x7'))(_0x49f1('0x8'));var config=require(_0x49f1('0x9'));var jayson=require(_0x49f1('0xa'));var client=jayson['client'][_0x49f1('0xb')]({'port':0x232a});config[_0x49f1('0xc')]=_[_0x49f1('0xd')](config[_0x49f1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x49f1('0xe'))(new Redis(config[_0x49f1('0xc')]));require(_0x49f1('0xf'))[_0x49f1('0x10')](socket);function respondWithRpcPromise(_0x2a1cfc,_0x2b2eee,_0x4d4ac5){return new BPromise(function(_0x388dfe,_0x46b230){return client['request'](_0x2a1cfc,_0x4d4ac5)[_0x49f1('0x11')](function(_0x5a9caa){logger['info'](_0x49f1('0x12'),_0x2b2eee,_0x49f1('0x13'));logger[_0x49f1('0x14')](_0x49f1('0x15'),_0x2b2eee,_0x49f1('0x13'),JSON[_0x49f1('0x16')](_0x5a9caa));if(_0x5a9caa[_0x49f1('0x17')]){if(_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x18')]===0x1f4){logger[_0x49f1('0x17')](_0x49f1('0x12'),_0x2b2eee,_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x19')]);return _0x46b230(_0x5a9caa['error'][_0x49f1('0x19')]);}logger[_0x49f1('0x17')](_0x49f1('0x12'),_0x2b2eee,_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x19')]);return _0x388dfe(_0x5a9caa[_0x49f1('0x17')][_0x49f1('0x19')]);}else{logger[_0x49f1('0x1a')](_0x49f1('0x12'),_0x2b2eee,_0x49f1('0x13'));_0x388dfe(_0x5a9caa[_0x49f1('0x1b')][_0x49f1('0x19')]);}})['catch'](function(_0x54ebb3){logger[_0x49f1('0x17')](_0x49f1('0x12'),_0x2b2eee,_0x54ebb3);_0x46b230(_0x54ebb3);});});}exports['GetOpenchannelQueue']=function(_0x58f84b){var _0x5ae0cd=this;return new Promise(function(_0x325354,_0x9e5609){return db[_0x49f1('0x1c')][_0x49f1('0x1d')]({'raw':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b[_0x49f1('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b['options']['where']||null:null,'attributes':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b['options'][_0x49f1('0x1f')]||null:null,'limit':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b[_0x49f1('0x1e')][_0x49f1('0x20')]||null:null,'include':_0x58f84b[_0x49f1('0x1e')]?_0x58f84b['options'][_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x58f84b[_0x49f1('0x1e')][_0x49f1('0x21')],function(_0x2daea7){return{'model':db[_0x2daea7[_0x49f1('0x23')]],'as':_0x2daea7['as'],'attributes':_0x2daea7[_0x49f1('0x1f')],'include':_0x2daea7[_0x49f1('0x21')]?_['map'](_0x2daea7['include'],function(_0x5f50ad){return{'model':db[_0x5f50ad[_0x49f1('0x23')]],'as':_0x5f50ad['as'],'attributes':_0x5f50ad[_0x49f1('0x1f')],'include':_0x5f50ad[_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x5f50ad['include'],function(_0x301f76){return{'model':db[_0x301f76[_0x49f1('0x23')]],'as':_0x301f76['as'],'attributes':_0x301f76[_0x49f1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d3893){logger['info'](_0x49f1('0x24'),_0x58f84b);logger[_0x49f1('0x14')]('GetOpenchannelQueue',_0x58f84b,JSON[_0x49f1('0x16')](_0x2d3893));_0x325354(_0x2d3893);})[_0x49f1('0x25')](function(_0x3249d2){logger[_0x49f1('0x17')](_0x49f1('0x24'),_0x3249d2[_0x49f1('0x19')],_0x58f84b);_0x9e5609(_0x5ae0cd[_0x49f1('0x17')](0x1f4,_0x3249d2[_0x49f1('0x19')]));});});};exports[_0x49f1('0x26')]=function(_0x338f2a){var _0x2b2a1d=this;return new Promise(function(_0x3c0be8,_0x207bb3){return db['OpenchannelQueue'][_0x49f1('0x27')]({'raw':_0x338f2a[_0x49f1('0x1e')]?_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x28')]===undefined?!![]:![]:!![],'where':_0x338f2a[_0x49f1('0x1e')]?_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x29')]||null:null,'attributes':_0x338f2a['options']?_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x1f')]||null:null,'include':_0x338f2a[_0x49f1('0x1e')]?_0x338f2a['options'][_0x49f1('0x21')]?_['map'](_0x338f2a[_0x49f1('0x1e')][_0x49f1('0x21')],function(_0x47683e){return{'model':db[_0x47683e[_0x49f1('0x23')]],'as':_0x47683e['as'],'attributes':_0x47683e[_0x49f1('0x1f')],'include':_0x47683e[_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x47683e[_0x49f1('0x21')],function(_0x514e14){return{'model':db[_0x514e14['model']],'as':_0x514e14['as'],'attributes':_0x514e14['attributes'],'include':_0x514e14[_0x49f1('0x21')]?_[_0x49f1('0x22')](_0x514e14[_0x49f1('0x21')],function(_0x493d04){return{'model':db[_0x493d04[_0x49f1('0x23')]],'as':_0x493d04['as'],'attributes':_0x493d04[_0x49f1('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42facc){logger[_0x49f1('0x1a')](_0x49f1('0x26'),_0x338f2a);logger[_0x49f1('0x14')](_0x49f1('0x26'),_0x338f2a,JSON[_0x49f1('0x16')](_0x42facc));_0x3c0be8(_0x42facc);})[_0x49f1('0x25')](function(_0x359589){logger[_0x49f1('0x17')](_0x49f1('0x26'),_0x359589[_0x49f1('0x19')],_0x338f2a);_0x207bb3(_0x2b2a1d['error'](0x1f4,_0x359589[_0x49f1('0x19')]));});});}; \ No newline at end of file +var _0x9c41=['code','message','OpenchannelQueue,\x20%s,\x20%s','GetOpenchannelQueue','findAll','options','raw','limit','include','model','attributes','map','catch','ShowOpenchannelQueue','OpenchannelQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','./openchannelQueue.socket','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xbec237,_0x444d0f){var _0x57ba82=function(_0xc9dda3){while(--_0xc9dda3){_0xbec237['push'](_0xbec237['shift']());}};_0x57ba82(++_0x444d0f);}(_0x9c41,0x183));var _0x19c4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c41[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x19c4('0x0'));var util=require('util');var moment=require(_0x19c4('0x1'));var BPromise=require(_0x19c4('0x2'));var rs=require(_0x19c4('0x3'));var fs=require('fs');var Redis=require(_0x19c4('0x4'));var db=require(_0x19c4('0x5'))['db'];var utils=require(_0x19c4('0x6'));var logger=require('../../config/logger')(_0x19c4('0x7'));var config=require(_0x19c4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x19c4('0x9')]=_['defaults'](config[_0x19c4('0x9')],{'host':_0x19c4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x19c4('0x9')]));require(_0x19c4('0xb'))['register'](socket);function respondWithRpcPromise(_0x2606fe,_0x136376,_0x760471){return new BPromise(function(_0x3ce9df,_0xf61ada){return client[_0x19c4('0xc')](_0x2606fe,_0x760471)[_0x19c4('0xd')](function(_0x349f67){logger[_0x19c4('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x136376,_0x19c4('0xf'));logger[_0x19c4('0x10')](_0x19c4('0x11'),_0x136376,_0x19c4('0xf'),JSON[_0x19c4('0x12')](_0x349f67));if(_0x349f67['error']){if(_0x349f67[_0x19c4('0x13')][_0x19c4('0x14')]===0x1f4){logger[_0x19c4('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x136376,_0x349f67[_0x19c4('0x13')][_0x19c4('0x15')]);return _0xf61ada(_0x349f67[_0x19c4('0x13')][_0x19c4('0x15')]);}logger[_0x19c4('0x13')](_0x19c4('0x16'),_0x136376,_0x349f67[_0x19c4('0x13')]['message']);return _0x3ce9df(_0x349f67[_0x19c4('0x13')][_0x19c4('0x15')]);}else{logger[_0x19c4('0xe')](_0x19c4('0x16'),_0x136376,_0x19c4('0xf'));_0x3ce9df(_0x349f67['result'][_0x19c4('0x15')]);}})['catch'](function(_0x4ce993){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x136376,_0x4ce993);_0xf61ada(_0x4ce993);});});}exports[_0x19c4('0x17')]=function(_0xb3a84f){var _0x14d29c=this;return new Promise(function(_0x4a0ad,_0x11572b){return db['OpenchannelQueue'][_0x19c4('0x18')]({'raw':_0xb3a84f[_0x19c4('0x19')]?_0xb3a84f[_0x19c4('0x19')][_0x19c4('0x1a')]===undefined?!![]:![]:!![],'where':_0xb3a84f[_0x19c4('0x19')]?_0xb3a84f[_0x19c4('0x19')]['where']||null:null,'attributes':_0xb3a84f[_0x19c4('0x19')]?_0xb3a84f['options']['attributes']||null:null,'limit':_0xb3a84f[_0x19c4('0x19')]?_0xb3a84f['options'][_0x19c4('0x1b')]||null:null,'include':_0xb3a84f[_0x19c4('0x19')]?_0xb3a84f[_0x19c4('0x19')][_0x19c4('0x1c')]?_['map'](_0xb3a84f['options']['include'],function(_0x10b097){return{'model':db[_0x10b097[_0x19c4('0x1d')]],'as':_0x10b097['as'],'attributes':_0x10b097[_0x19c4('0x1e')],'include':_0x10b097[_0x19c4('0x1c')]?_[_0x19c4('0x1f')](_0x10b097[_0x19c4('0x1c')],function(_0x3f2ca1){return{'model':db[_0x3f2ca1[_0x19c4('0x1d')]],'as':_0x3f2ca1['as'],'attributes':_0x3f2ca1[_0x19c4('0x1e')],'include':_0x3f2ca1[_0x19c4('0x1c')]?_[_0x19c4('0x1f')](_0x3f2ca1[_0x19c4('0x1c')],function(_0xcd2f5c){return{'model':db[_0xcd2f5c['model']],'as':_0xcd2f5c['as'],'attributes':_0xcd2f5c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cf883){logger['info']('GetOpenchannelQueue',_0xb3a84f);logger[_0x19c4('0x10')](_0x19c4('0x17'),_0xb3a84f,JSON['stringify'](_0x4cf883));_0x4a0ad(_0x4cf883);})[_0x19c4('0x20')](function(_0x30aa68){logger[_0x19c4('0x13')]('GetOpenchannelQueue',_0x30aa68[_0x19c4('0x15')],_0xb3a84f);_0x11572b(_0x14d29c[_0x19c4('0x13')](0x1f4,_0x30aa68[_0x19c4('0x15')]));});});};exports[_0x19c4('0x21')]=function(_0x412b39){var _0x4bd109=this;return new Promise(function(_0x345042,_0x2818d9){return db[_0x19c4('0x22')][_0x19c4('0x23')]({'raw':_0x412b39['options']?_0x412b39[_0x19c4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x412b39[_0x19c4('0x19')]?_0x412b39[_0x19c4('0x19')][_0x19c4('0x24')]||null:null,'attributes':_0x412b39['options']?_0x412b39['options'][_0x19c4('0x1e')]||null:null,'include':_0x412b39[_0x19c4('0x19')]?_0x412b39[_0x19c4('0x19')][_0x19c4('0x1c')]?_[_0x19c4('0x1f')](_0x412b39['options'][_0x19c4('0x1c')],function(_0x21f029){return{'model':db[_0x21f029[_0x19c4('0x1d')]],'as':_0x21f029['as'],'attributes':_0x21f029[_0x19c4('0x1e')],'include':_0x21f029['include']?_[_0x19c4('0x1f')](_0x21f029[_0x19c4('0x1c')],function(_0x1f9281){return{'model':db[_0x1f9281['model']],'as':_0x1f9281['as'],'attributes':_0x1f9281[_0x19c4('0x1e')],'include':_0x1f9281[_0x19c4('0x1c')]?_[_0x19c4('0x1f')](_0x1f9281['include'],function(_0x596f8c){return{'model':db[_0x596f8c[_0x19c4('0x1d')]],'as':_0x596f8c['as'],'attributes':_0x596f8c[_0x19c4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x19c4('0xd')](function(_0x42065d){logger['info'](_0x19c4('0x21'),_0x412b39);logger['debug']('ShowOpenchannelQueue',_0x412b39,JSON['stringify'](_0x42065d));_0x345042(_0x42065d);})[_0x19c4('0x20')](function(_0x446099){logger['error'](_0x19c4('0x21'),_0x446099[_0x19c4('0x15')],_0x412b39);_0x2818d9(_0x4bd109[_0x19c4('0x13')](0x1f4,_0x446099['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 1552607..735578d 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 _0xd69d=['save','remove','length'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd69d,0x171));var _0xdd69=function(_0xf2de17,_0x2daf0f){_0xf2de17=_0xf2de17-0x0;var _0x49f796=_0xd69d[_0xf2de17];return _0x49f796;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xdd69('0x0'),_0xdd69('0x1'),'update'];function createListener(_0x33d476,_0x22236e){return function(_0x4e3bf0){_0x22236e['emit'](_0x33d476,_0x4e3bf0);};}function removeListener(_0x3e3df,_0x21977a){return function(){OpenchannelQueueEvents['removeListener'](_0x3e3df,_0x21977a);};}exports['register']=function(_0x13466a){for(var _0x19c244=0x0,_0x595a87=events[_0xdd69('0x2')];_0x19c244<_0x595a87;_0x19c244++){var _0x232443=events[_0x19c244];var _0x46f559=createListener('openchannelQueue:'+_0x232443,_0x13466a);OpenchannelQueueEvents['on'](_0x232443,_0x46f559);}}; \ No newline at end of file +var _0xde75=['register','length','./openchannelQueue.events','emit','removeListener'];(function(_0x51c082,_0x429269){var _0xf0b7b9=function(_0x172a3e){while(--_0x172a3e){_0x51c082['push'](_0x51c082['shift']());}};_0xf0b7b9(++_0x429269);}(_0xde75,0x1d3));var _0x5de7=function(_0x5a390a,_0x53cefd){_0x5a390a=_0x5a390a-0x0;var _0x179bc8=_0xde75[_0x5a390a];return _0x179bc8;};'use strict';var OpenchannelQueueEvents=require(_0x5de7('0x0'));var events=['save','remove','update'];function createListener(_0x491370,_0x2ba3a3){return function(_0xfea812){_0x2ba3a3[_0x5de7('0x1')](_0x491370,_0xfea812);};}function removeListener(_0x531cc8,_0x79f5bc){return function(){OpenchannelQueueEvents[_0x5de7('0x2')](_0x531cc8,_0x79f5bc);};}exports[_0x5de7('0x3')]=function(_0x411517){for(var _0x6d1218=0x0,_0xcfa00e=events[_0x5de7('0x4')];_0x6d1218<_0xcfa00e;_0x6d1218++){var _0x16dd0e=events[_0x6d1218];var _0x4439ad=createListener('openchannelQueue:'+_0x16dd0e,_0x411517);OpenchannelQueueEvents['on'](_0x16dd0e,_0x4439ad);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 69a9986..fd3574f 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 _0x963f=['/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x963f,0x9b));var _0xf963=function(_0x2dd615,_0x18099c){_0x2dd615=_0x2dd615-0x0;var _0x5255a4=_0x963f[_0x2dd615];return _0x5255a4;};'use strict';var multer=require('multer');var util=require(_0xf963('0x0'));var path=require(_0xf963('0x1'));var timeout=require('connect-timeout');var express=require(_0xf963('0x2'));var router=express[_0xf963('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf963('0x4'));var interaction=require(_0xf963('0x5'));var config=require(_0xf963('0x6'));var controller=require(_0xf963('0x7'));router[_0xf963('0x8')]('/',auth[_0xf963('0x9')](),controller[_0xf963('0xa')]);router[_0xf963('0x8')](_0xf963('0xb'),auth[_0xf963('0x9')](),controller[_0xf963('0xc')]);router['get'](_0xf963('0xd'),auth[_0xf963('0x9')](),controller[_0xf963('0xe')]);router[_0xf963('0xf')]('/',auth[_0xf963('0x9')](),controller[_0xf963('0x10')]);router[_0xf963('0x11')](_0xf963('0xd'),auth['isAuthenticated'](),controller[_0xf963('0x12')]);router[_0xf963('0x13')](_0xf963('0xd'),auth[_0xf963('0x9')](),controller[_0xf963('0x14')]);module['exports']=router; \ No newline at end of file +var _0x44c9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x90e9ab,_0x426802){var _0xdfa58b=function(_0x3d760e){while(--_0x3d760e){_0x90e9ab['push'](_0x90e9ab['shift']());}};_0xdfa58b(++_0x426802);}(_0x44c9,0x15a));var _0x944c=function(_0x508d16,_0x3e5c76){_0x508d16=_0x508d16-0x0;var _0x169e38=_0x44c9[_0x508d16];return _0x169e38;};'use strict';var multer=require(_0x944c('0x0'));var util=require(_0x944c('0x1'));var path=require(_0x944c('0x2'));var timeout=require(_0x944c('0x3'));var express=require(_0x944c('0x4'));var router=express[_0x944c('0x5')]();var fs_extra=require(_0x944c('0x6'));var auth=require(_0x944c('0x7'));var interaction=require(_0x944c('0x8'));var config=require(_0x944c('0x9'));var controller=require(_0x944c('0xa'));router[_0x944c('0xb')]('/',auth[_0x944c('0xc')](),controller['index']);router['get'](_0x944c('0xd'),auth[_0x944c('0xc')](),controller[_0x944c('0xe')]);router['get'](_0x944c('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x944c('0xc')](),controller[_0x944c('0x10')]);router[_0x944c('0x11')](_0x944c('0xf'),auth[_0x944c('0xc')](),controller[_0x944c('0x12')]);router[_0x944c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x944c('0x14')]);module[_0x944c('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 53991ba..b07a55e 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 _0x5f2b=['exports','STRING','DATE','moment','sequelize'];(function(_0x3bac03,_0x52ff06){var _0x3f9c56=function(_0x14b0c1){while(--_0x14b0c1){_0x3bac03['push'](_0x3bac03['shift']());}};_0x3f9c56(++_0x52ff06);}(_0x5f2b,0x17a));var _0xb5f2=function(_0x3137ad,_0x28cd46){_0x3137ad=_0x3137ad-0x0;var _0x18bfc8=_0x5f2b[_0x3137ad];return _0x18bfc8;};'use strict';var moment=require(_0xb5f2('0x0'));var Sequelize=require(_0xb5f2('0x1'));module[_0xb5f2('0x2')]={'uniqueid':{'type':Sequelize[_0xb5f2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb5f2('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb5f2('0x4')]},'acceptAt':{'type':Sequelize[_0xb5f2('0x4')]},'exitAt':{'type':Sequelize[_0xb5f2('0x4')]},'reason':{'type':Sequelize[_0xb5f2('0x3')]}}; \ No newline at end of file +var _0xd4d4=['DATE','STRING','moment','sequelize','exports'];(function(_0x5aad23,_0x3c4989){var _0x5260e3=function(_0x37b65f){while(--_0x37b65f){_0x5aad23['push'](_0x5aad23['shift']());}};_0x5260e3(++_0x3c4989);}(_0xd4d4,0x7a));var _0x4d4d=function(_0x2185e0,_0x18b07e){_0x2185e0=_0x2185e0-0x0;var _0x785257=_0xd4d4[_0x2185e0];return _0x785257;};'use strict';var moment=require(_0x4d4d('0x0'));var Sequelize=require(_0x4d4d('0x1'));module[_0x4d4d('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4d4d('0x3')]},'leaveAt':{'type':Sequelize[_0x4d4d('0x3')]},'acceptAt':{'type':Sequelize[_0x4d4d('0x3')]},'exitAt':{'type':Sequelize[_0x4d4d('0x3')]},'reason':{'type':Sequelize[_0x4d4d('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index cc4c4f9..cb4e6e8 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 _0x0b5d=['create','body','describe','rimraf','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','options','find','catch'];(function(_0x2816ca,_0x4c990a){var _0x18fefe=function(_0x525e11){while(--_0x525e11){_0x2816ca['push'](_0x2816ca['shift']());}};_0x18fefe(++_0x4c990a);}(_0x0b5d,0x11f));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0b5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd0b5('0x1'));var moment=require('moment');var BPromise=require(_0xd0b5('0x2'));var Mustache=require('mustache');var util=require(_0xd0b5('0x3'));var path=require(_0xd0b5('0x4'));var sox=require(_0xd0b5('0x5'));var csv=require('to-csv');var ejs=require(_0xd0b5('0x6'));var fs=require('fs');var fs_extra=require(_0xd0b5('0x7'));var _=require(_0xd0b5('0x8'));var squel=require(_0xd0b5('0x9'));var crypto=require('crypto');var jsforce=require(_0xd0b5('0xa'));var deskjs=require(_0xd0b5('0xb'));var toCsv=require(_0xd0b5('0xc'));var querystring=require(_0xd0b5('0xd'));var Papa=require(_0xd0b5('0xe'));var Redis=require('ioredis');var authService=require(_0xd0b5('0xf'));var qs=require(_0xd0b5('0x10'));var as=require(_0xd0b5('0x11'));var hardwareService=require(_0xd0b5('0x12'));var logger=require('../../config/logger')(_0xd0b5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f3518,_0x5d0fe6){_0x5d0fe6=_0x5d0fe6||0xcc;return function(_0x30cb73){if(_0x30cb73){return _0x4f3518[_0xd0b5('0x14')](_0x5d0fe6);}return _0x4f3518['status'](_0x5d0fe6)['end']();};}function respondWithResult(_0x325601,_0x78c3a0){_0x78c3a0=_0x78c3a0||0xc8;return function(_0x3812aa){if(_0x3812aa){return _0x325601[_0xd0b5('0x15')](_0x78c3a0)[_0xd0b5('0x16')](_0x3812aa);}};}function respondWithFilteredResult(_0x1ec0e1,_0x319d1f){return function(_0x388209){if(_0x388209){var _0xc169da=typeof _0x319d1f[_0xd0b5('0x17')]===_0xd0b5('0x18')&&typeof _0x319d1f[_0xd0b5('0x19')]===_0xd0b5('0x18');var _0x1fed3a=_0x388209[_0xd0b5('0x1a')];var _0x14dcc0=_0xc169da?0x0:_0x319d1f['offset'];var _0x2e4b16=_0xc169da?_0x388209[_0xd0b5('0x1a')]:_0x319d1f[_0xd0b5('0x17')]+_0x319d1f[_0xd0b5('0x19')];var _0x3cd119;if(_0x2e4b16>=_0x1fed3a){_0x2e4b16=_0x1fed3a;_0x3cd119=0xc8;}else{_0x3cd119=0xce;}_0x1ec0e1[_0xd0b5('0x15')](_0x3cd119);return _0x1ec0e1[_0xd0b5('0x1b')](_0xd0b5('0x1c'),_0x14dcc0+'-'+_0x2e4b16+'/'+_0x1fed3a)[_0xd0b5('0x16')](_0x388209);}return null;};}function patchUpdates(_0x50c527){return function(_0x5552ba){try{jsonpatch[_0xd0b5('0x1d')](_0x5552ba,_0x50c527,!![]);}catch(_0x305970){return BPromise[_0xd0b5('0x1e')](_0x305970);}return _0x5552ba['save']();};}function saveUpdates(_0x4ae797,_0x27c1ea){return function(_0x223831){if(_0x223831){return _0x223831[_0xd0b5('0x1f')](_0x4ae797)[_0xd0b5('0x20')](function(_0x5ddb81){return _0x5ddb81;});}return null;};}function removeEntity(_0xf9cdec,_0xdddb62){return function(_0x5db422){if(_0x5db422){return _0x5db422['destroy']()['then'](function(){_0xf9cdec[_0xd0b5('0x15')](0xcc)[_0xd0b5('0x21')]();});}};}function handleEntityNotFound(_0x32d307,_0x18560f){return function(_0x4f4285){if(!_0x4f4285){_0x32d307['sendStatus'](0x194);}return _0x4f4285;};}function handleError(_0x14a7d4,_0x20e3fa){_0x20e3fa=_0x20e3fa||0x1f4;return function(_0x2bd2c3){logger[_0xd0b5('0x22')](_0x2bd2c3[_0xd0b5('0x23')]);if(_0x2bd2c3[_0xd0b5('0x24')]){delete _0x2bd2c3[_0xd0b5('0x24')];}_0x14a7d4['status'](_0x20e3fa)[_0xd0b5('0x25')](_0x2bd2c3);};}exports[_0xd0b5('0x26')]=function(_0x462abc,_0x5b42f8){var _0x46772b={},_0x238811={},_0x438f67={'count':0x0,'rows':[]};var _0x71d252=_[_0xd0b5('0x27')](db[_0xd0b5('0x28')][_0xd0b5('0x29')],function(_0x298610){return{'name':_0x298610[_0xd0b5('0x2a')],'type':_0x298610[_0xd0b5('0x2b')]['key']};});_0x238811['model']=_['map'](_0x71d252,_0xd0b5('0x24'));_0x238811[_0xd0b5('0x2c')]=_['keys'](_0x462abc[_0xd0b5('0x2c')]);_0x238811[_0xd0b5('0x2d')]=_['intersection'](_0x238811[_0xd0b5('0x2e')],_0x238811[_0xd0b5('0x2c')]);_0x46772b[_0xd0b5('0x2f')]=_[_0xd0b5('0x30')](_0x238811['model'],qs[_0xd0b5('0x31')](_0x462abc['query'][_0xd0b5('0x31')]));_0x46772b['attributes']=_0x46772b['attributes'][_0xd0b5('0x32')]?_0x46772b[_0xd0b5('0x2f')]:_0x238811[_0xd0b5('0x2e')];if(!_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x33')](_0xd0b5('0x34'))){_0x46772b[_0xd0b5('0x19')]=qs[_0xd0b5('0x19')](_0x462abc[_0xd0b5('0x2c')]['limit']);_0x46772b['offset']=qs[_0xd0b5('0x17')](_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x17')]);}_0x46772b['order']=qs[_0xd0b5('0x35')](_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x35')]);_0x46772b['where']=qs[_0xd0b5('0x2d')](_[_0xd0b5('0x36')](_0x462abc['query'],_0x238811['filters']),_0x71d252);if(_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x37')]){_0x46772b[_0xd0b5('0x38')]=_[_0xd0b5('0x39')](_0x46772b[_0xd0b5('0x38')],{'$or':_[_0xd0b5('0x27')](_0x71d252,function(_0x566fd9){if(_0x566fd9[_0xd0b5('0x2b')]!==_0xd0b5('0x3a')){var _0x239731={};_0x239731[_0x566fd9[_0xd0b5('0x24')]]={'$like':'%'+_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x37')]+'%'};return _0x239731;}})});}_0x46772b=_[_0xd0b5('0x39')]({},_0x46772b,_0x462abc['options']);var _0x274d35={'where':_0x46772b[_0xd0b5('0x38')]};return db[_0xd0b5('0x28')][_0xd0b5('0x1a')](_0x274d35)[_0xd0b5('0x20')](function(_0x86e7db){_0x438f67[_0xd0b5('0x1a')]=_0x86e7db;if(_0x462abc[_0xd0b5('0x2c')][_0xd0b5('0x3b')]){_0x46772b[_0xd0b5('0x3c')]=[{'all':!![]}];}return db[_0xd0b5('0x28')][_0xd0b5('0x3d')](_0x46772b);})[_0xd0b5('0x20')](function(_0x28d8dc){_0x438f67[_0xd0b5('0x3e')]=_0x28d8dc;return _0x438f67;})['then'](respondWithFilteredResult(_0x5b42f8,_0x46772b))['catch'](handleError(_0x5b42f8,null));};exports['show']=function(_0x2da99c,_0x63ecdb){var _0x2c5500={'raw':!![],'where':{'id':_0x2da99c[_0xd0b5('0x3f')]['id']}},_0x2ea5ee={};_0x2ea5ee[_0xd0b5('0x2e')]=_[_0xd0b5('0x40')](db[_0xd0b5('0x28')][_0xd0b5('0x29')]);_0x2ea5ee['query']=_['keys'](_0x2da99c[_0xd0b5('0x2c')]);_0x2ea5ee[_0xd0b5('0x2d')]=_[_0xd0b5('0x30')](_0x2ea5ee['model'],_0x2ea5ee['query']);_0x2c5500[_0xd0b5('0x2f')]=_[_0xd0b5('0x30')](_0x2ea5ee[_0xd0b5('0x2e')],qs[_0xd0b5('0x31')](_0x2da99c['query'][_0xd0b5('0x31')]));_0x2c5500[_0xd0b5('0x2f')]=_0x2c5500[_0xd0b5('0x2f')][_0xd0b5('0x32')]?_0x2c5500[_0xd0b5('0x2f')]:_0x2ea5ee[_0xd0b5('0x2e')];if(_0x2da99c['query'][_0xd0b5('0x3b')]){_0x2c5500[_0xd0b5('0x3c')]=[{'all':!![]}];}_0x2c5500=_['merge']({},_0x2c5500,_0x2da99c[_0xd0b5('0x41')]);return db[_0xd0b5('0x28')][_0xd0b5('0x42')](_0x2c5500)['then'](handleEntityNotFound(_0x63ecdb,null))['then'](respondWithResult(_0x63ecdb,null))[_0xd0b5('0x43')](handleError(_0x63ecdb,null));};exports['create']=function(_0x334fb4,_0x35b312){return db[_0xd0b5('0x28')][_0xd0b5('0x44')](_0x334fb4[_0xd0b5('0x45')],{})[_0xd0b5('0x20')](respondWithResult(_0x35b312,0xc9))[_0xd0b5('0x43')](handleError(_0x35b312,null));};exports[_0xd0b5('0x1f')]=function(_0x3e5e11,_0x1e1763){if(_0x3e5e11[_0xd0b5('0x45')]['id']){delete _0x3e5e11[_0xd0b5('0x45')]['id'];}return db[_0xd0b5('0x28')][_0xd0b5('0x42')]({'where':{'id':_0x3e5e11[_0xd0b5('0x3f')]['id']}})[_0xd0b5('0x20')](handleEntityNotFound(_0x1e1763,null))[_0xd0b5('0x20')](saveUpdates(_0x3e5e11[_0xd0b5('0x45')],null))[_0xd0b5('0x20')](respondWithResult(_0x1e1763,null))[_0xd0b5('0x43')](handleError(_0x1e1763,null));};exports['destroy']=function(_0x4d2ab4,_0x15daa7){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x4d2ab4[_0xd0b5('0x3f')]['id']}})[_0xd0b5('0x20')](handleEntityNotFound(_0x15daa7,null))['then'](removeEntity(_0x15daa7,null))[_0xd0b5('0x43')](handleError(_0x15daa7,null));};exports['describe']=function(_0x5c4d16,_0x33637a){return db['OpenchannelQueueReport'][_0xd0b5('0x46')]()[_0xd0b5('0x20')](respondWithResult(_0x33637a,null))[_0xd0b5('0x43')](handleError(_0x33637a,null));}; \ No newline at end of file +var _0x404a=['moment','bluebird','mustache','util','path','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','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','end','error','stack','name','send','index','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','OpenchannelQueueReport','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x1c34a6,_0x1108e1){var _0x48fe79=function(_0x163e66){while(--_0x163e66){_0x1c34a6['push'](_0x1c34a6['shift']());}};_0x48fe79(++_0x1108e1);}(_0x404a,0x182));var _0xa404=function(_0x175e3c,_0x464ee6){_0x175e3c=_0x175e3c-0x0;var _0x1f1e5d=_0x404a[_0x175e3c];return _0x1f1e5d;};'use strict';var emlformat=require(_0xa404('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa404('0x1'));var jsonpatch=require(_0xa404('0x2'));var rp=require(_0xa404('0x3'));var moment=require(_0xa404('0x4'));var BPromise=require(_0xa404('0x5'));var Mustache=require(_0xa404('0x6'));var util=require(_0xa404('0x7'));var path=require(_0xa404('0x8'));var sox=require('sox');var csv=require(_0xa404('0x9'));var ejs=require(_0xa404('0xa'));var fs=require('fs');var fs_extra=require(_0xa404('0xb'));var _=require(_0xa404('0xc'));var squel=require(_0xa404('0xd'));var crypto=require(_0xa404('0xe'));var jsforce=require(_0xa404('0xf'));var deskjs=require(_0xa404('0x10'));var toCsv=require(_0xa404('0x9'));var querystring=require(_0xa404('0x11'));var Papa=require('papaparse');var Redis=require(_0xa404('0x12'));var authService=require(_0xa404('0x13'));var qs=require(_0xa404('0x14'));var as=require(_0xa404('0x15'));var hardwareService=require(_0xa404('0x16'));var logger=require(_0xa404('0x17'))('api');var utils=require(_0xa404('0x18'));var config=require(_0xa404('0x19'));var licenseUtil=require(_0xa404('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c1fcd,_0x35daa8){_0x35daa8=_0x35daa8||0xcc;return function(_0x373127){if(_0x373127){return _0x4c1fcd[_0xa404('0x1b')](_0x35daa8);}return _0x4c1fcd[_0xa404('0x1c')](_0x35daa8)['end']();};}function respondWithResult(_0x54e178,_0x595a26){_0x595a26=_0x595a26||0xc8;return function(_0x456f8a){if(_0x456f8a){return _0x54e178[_0xa404('0x1c')](_0x595a26)[_0xa404('0x1d')](_0x456f8a);}};}function respondWithFilteredResult(_0x10a7c2,_0x467a01){return function(_0x74e08a){if(_0x74e08a){var _0xe3bc94=typeof _0x467a01[_0xa404('0x1e')]===_0xa404('0x1f')&&typeof _0x467a01[_0xa404('0x20')]===_0xa404('0x1f');var _0x2c8a5b=_0x74e08a[_0xa404('0x21')];var _0x3d611b=_0xe3bc94?0x0:_0x467a01[_0xa404('0x1e')];var _0x3378d6=_0xe3bc94?_0x74e08a[_0xa404('0x21')]:_0x467a01[_0xa404('0x1e')]+_0x467a01[_0xa404('0x20')];var _0x269841;if(_0x3378d6>=_0x2c8a5b){_0x3378d6=_0x2c8a5b;_0x269841=0xc8;}else{_0x269841=0xce;}_0x10a7c2[_0xa404('0x1c')](_0x269841);return _0x10a7c2[_0xa404('0x22')](_0xa404('0x23'),_0x3d611b+'-'+_0x3378d6+'/'+_0x2c8a5b)['json'](_0x74e08a);}return null;};}function patchUpdates(_0x5aa2e2){return function(_0x321c22){try{jsonpatch['apply'](_0x321c22,_0x5aa2e2,!![]);}catch(_0x272a3c){return BPromise['reject'](_0x272a3c);}return _0x321c22[_0xa404('0x24')]();};}function saveUpdates(_0x6fe253,_0x304acc){return function(_0xf3d468){if(_0xf3d468){return _0xf3d468[_0xa404('0x25')](_0x6fe253)['then'](function(_0x27ab3e){return _0x27ab3e;});}return null;};}function removeEntity(_0x1bd395,_0x25c665){return function(_0x22ab36){if(_0x22ab36){return _0x22ab36[_0xa404('0x26')]()[_0xa404('0x27')](function(){_0x1bd395['status'](0xcc)[_0xa404('0x28')]();});}};}function handleEntityNotFound(_0x220ca7,_0x26a97c){return function(_0x2fe8eb){if(!_0x2fe8eb){_0x220ca7[_0xa404('0x1b')](0x194);}return _0x2fe8eb;};}function handleError(_0x342399,_0x12cf2f){_0x12cf2f=_0x12cf2f||0x1f4;return function(_0x496ed8){logger[_0xa404('0x29')](_0x496ed8[_0xa404('0x2a')]);if(_0x496ed8[_0xa404('0x2b')]){delete _0x496ed8[_0xa404('0x2b')];}_0x342399[_0xa404('0x1c')](_0x12cf2f)[_0xa404('0x2c')](_0x496ed8);};}exports[_0xa404('0x2d')]=function(_0xcc222d,_0x58debb){var _0x2b9cab={},_0x4fe152={},_0x3194cf={'count':0x0,'rows':[]};var _0x518686=_['map'](db['OpenchannelQueueReport']['rawAttributes'],function(_0x381f46){return{'name':_0x381f46['fieldName'],'type':_0x381f46[_0xa404('0x2e')][_0xa404('0x2f')]};});_0x4fe152[_0xa404('0x30')]=_[_0xa404('0x31')](_0x518686,_0xa404('0x2b'));_0x4fe152[_0xa404('0x32')]=_[_0xa404('0x33')](_0xcc222d[_0xa404('0x32')]);_0x4fe152['filters']=_['intersection'](_0x4fe152[_0xa404('0x30')],_0x4fe152[_0xa404('0x32')]);_0x2b9cab['attributes']=_[_0xa404('0x34')](_0x4fe152[_0xa404('0x30')],qs['fields'](_0xcc222d[_0xa404('0x32')][_0xa404('0x35')]));_0x2b9cab[_0xa404('0x36')]=_0x2b9cab['attributes'][_0xa404('0x37')]?_0x2b9cab[_0xa404('0x36')]:_0x4fe152['model'];if(!_0xcc222d[_0xa404('0x32')][_0xa404('0x38')]('nolimit')){_0x2b9cab[_0xa404('0x20')]=qs[_0xa404('0x20')](_0xcc222d[_0xa404('0x32')][_0xa404('0x20')]);_0x2b9cab['offset']=qs[_0xa404('0x1e')](_0xcc222d['query'][_0xa404('0x1e')]);}_0x2b9cab[_0xa404('0x39')]=qs[_0xa404('0x3a')](_0xcc222d[_0xa404('0x32')][_0xa404('0x3a')]);_0x2b9cab[_0xa404('0x3b')]=qs[_0xa404('0x3c')](_['pick'](_0xcc222d[_0xa404('0x32')],_0x4fe152[_0xa404('0x3c')]),_0x518686);if(_0xcc222d['query'][_0xa404('0x3d')]){_0x2b9cab[_0xa404('0x3b')]=_[_0xa404('0x3e')](_0x2b9cab[_0xa404('0x3b')],{'$or':_[_0xa404('0x31')](_0x518686,function(_0x34f00b){if(_0x34f00b[_0xa404('0x2e')]!==_0xa404('0x3f')){var _0x23791d={};_0x23791d[_0x34f00b[_0xa404('0x2b')]]={'$like':'%'+_0xcc222d[_0xa404('0x32')][_0xa404('0x3d')]+'%'};return _0x23791d;}})});}_0x2b9cab=_[_0xa404('0x3e')]({},_0x2b9cab,_0xcc222d['options']);var _0xea6238={'where':_0x2b9cab['where']};return db[_0xa404('0x40')][_0xa404('0x21')](_0xea6238)[_0xa404('0x27')](function(_0x3bcab5){_0x3194cf[_0xa404('0x21')]=_0x3bcab5;if(_0xcc222d[_0xa404('0x32')][_0xa404('0x41')]){_0x2b9cab[_0xa404('0x42')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xa404('0x43')](_0x2b9cab);})[_0xa404('0x27')](function(_0x1894ef){_0x3194cf[_0xa404('0x44')]=_0x1894ef;return _0x3194cf;})[_0xa404('0x27')](respondWithFilteredResult(_0x58debb,_0x2b9cab))['catch'](handleError(_0x58debb,null));};exports[_0xa404('0x45')]=function(_0x585b3a,_0x526e8c){var _0x119049={'raw':!![],'where':{'id':_0x585b3a['params']['id']}},_0x4205bc={};_0x4205bc[_0xa404('0x30')]=_[_0xa404('0x33')](db[_0xa404('0x40')][_0xa404('0x46')]);_0x4205bc[_0xa404('0x32')]=_['keys'](_0x585b3a[_0xa404('0x32')]);_0x4205bc[_0xa404('0x3c')]=_[_0xa404('0x34')](_0x4205bc[_0xa404('0x30')],_0x4205bc[_0xa404('0x32')]);_0x119049[_0xa404('0x36')]=_[_0xa404('0x34')](_0x4205bc[_0xa404('0x30')],qs['fields'](_0x585b3a[_0xa404('0x32')][_0xa404('0x35')]));_0x119049[_0xa404('0x36')]=_0x119049['attributes'][_0xa404('0x37')]?_0x119049[_0xa404('0x36')]:_0x4205bc['model'];if(_0x585b3a[_0xa404('0x32')]['includeAll']){_0x119049['include']=[{'all':!![]}];}_0x119049=_[_0xa404('0x3e')]({},_0x119049,_0x585b3a[_0xa404('0x47')]);return db[_0xa404('0x40')][_0xa404('0x48')](_0x119049)[_0xa404('0x27')](handleEntityNotFound(_0x526e8c,null))['then'](respondWithResult(_0x526e8c,null))[_0xa404('0x49')](handleError(_0x526e8c,null));};exports['create']=function(_0x4f0e50,_0x49f72b){return db['OpenchannelQueueReport'][_0xa404('0x4a')](_0x4f0e50[_0xa404('0x4b')],{})[_0xa404('0x27')](respondWithResult(_0x49f72b,0xc9))['catch'](handleError(_0x49f72b,null));};exports[_0xa404('0x25')]=function(_0x1ec416,_0x4881b8){if(_0x1ec416['body']['id']){delete _0x1ec416['body']['id'];}return db[_0xa404('0x40')][_0xa404('0x48')]({'where':{'id':_0x1ec416['params']['id']}})[_0xa404('0x27')](handleEntityNotFound(_0x4881b8,null))[_0xa404('0x27')](saveUpdates(_0x1ec416['body'],null))['then'](respondWithResult(_0x4881b8,null))[_0xa404('0x49')](handleError(_0x4881b8,null));};exports[_0xa404('0x26')]=function(_0xc27c8c,_0x2d6490){return db[_0xa404('0x40')][_0xa404('0x48')]({'where':{'id':_0xc27c8c[_0xa404('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d6490,null))['then'](removeEntity(_0x2d6490,null))['catch'](handleError(_0x2d6490,null));};exports[_0xa404('0x4d')]=function(_0x305e0b,_0x58c65c){return db[_0xa404('0x40')][_0xa404('0x4d')]()[_0xa404('0x27')](respondWithResult(_0x58c65c,null))[_0xa404('0x49')](handleError(_0x58c65c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 031af38..7ef6959 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 _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x469cce,_0x272783){var _0x5e6205=function(_0xe419c5){while(--_0xe419c5){_0x469cce['push'](_0x469cce['shift']());}};_0x5e6205(++_0x272783);}(_0x326f,0xd1));var _0xf326=function(_0x5c3c12,_0x160737){_0x5c3c12=_0x5c3c12-0x0;var _0x24fa7c=_0x326f[_0x5c3c12];return _0x24fa7c;};'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 +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0x814b,0x1a2));var _0xb814=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0x814b[_0x3c2b2e];return _0x27a338;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index d760a96..d3d00fb 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 _0x47c5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x11e81d,_0xce9b6b){var _0x8bfd50=function(_0xf7e7da){while(--_0xf7e7da){_0x11e81d['push'](_0x11e81d['shift']());}};_0x8bfd50(++_0xce9b6b);}(_0x47c5,0x165));var _0x547c=function(_0x120891,_0x415544){_0x120891=_0x120891-0x0;var _0x2c52b7=_0x47c5[_0x120891];return _0x2c52b7;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x439f25,_0x381f2e,_0x10a334){return new BPromise(function(_0x12fb7d,_0x4ef079){return client[_0x547c('0xb')](_0x439f25,_0x10a334)[_0x547c('0xc')](function(_0x10dec9){logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));logger[_0x547c('0x10')](_0x547c('0x11'),_0x381f2e,_0x547c('0xf'),JSON[_0x547c('0x12')](_0x10dec9));if(_0x10dec9[_0x547c('0x13')]){if(_0x10dec9['error'][_0x547c('0x14')]===0x1f4){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x4ef079(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}logger[_0x547c('0x13')](_0x547c('0xe'),_0x381f2e,_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);return _0x12fb7d(_0x10dec9[_0x547c('0x13')][_0x547c('0x15')]);}else{logger[_0x547c('0xd')](_0x547c('0xe'),_0x381f2e,_0x547c('0xf'));_0x12fb7d(_0x10dec9[_0x547c('0x16')][_0x547c('0x15')]);}})[_0x547c('0x17')](function(_0x39498d){logger[_0x547c('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x381f2e,_0x39498d);_0x4ef079(_0x39498d);});});}exports['CreateOpenchannelQueueReport']=function(_0x23fa9e){var _0x199e4f=this;return new Promise(function(_0xeb059e,_0x4a8901){return db[_0x547c('0x18')][_0x547c('0x19')](_0x23fa9e[_0x547c('0x1a')],{'raw':_0x23fa9e['options']?_0x23fa9e[_0x547c('0x1b')][_0x547c('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x5453f9){logger[_0x547c('0xd')](_0x547c('0x1d'),_0x23fa9e);logger['debug'](_0x547c('0x1d'),_0x23fa9e,JSON[_0x547c('0x12')](_0x5453f9));_0xeb059e(_0x5453f9);})['catch'](function(_0x2e317a){logger[_0x547c('0x13')](_0x547c('0x1d'),_0x2e317a['message'],_0x23fa9e);_0x4a8901(_0x199e4f[_0x547c('0x13')](0x1f4,_0x2e317a[_0x547c('0x15')]));});});};exports[_0x547c('0x1e')]=function(_0x26823c){var _0x1f3581=this;return new Promise(function(_0x2663bc,_0x2ab2cc){return db[_0x547c('0x18')]['update'](_0x26823c[_0x547c('0x1a')],{'raw':_0x26823c['options']?_0x26823c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26823c['options']?_0x26823c[_0x547c('0x1b')]['where']||null:null,'attributes':_0x26823c[_0x547c('0x1b')]?_0x26823c['options'][_0x547c('0x1f')]||null:null,'limit':_0x26823c['options']?_0x26823c[_0x547c('0x1b')][_0x547c('0x20')]||null:null})[_0x547c('0xc')](function(_0x30a96c){logger[_0x547c('0xd')]('UpdateOpenchannelQueueReport',_0x26823c);logger['debug'](_0x547c('0x1e'),_0x26823c,JSON['stringify'](_0x30a96c));_0x2663bc(_0x30a96c);})[_0x547c('0x17')](function(_0xed2d39){logger[_0x547c('0x13')](_0x547c('0x1e'),_0xed2d39[_0x547c('0x15')],_0x26823c);_0x2ab2cc(_0x1f3581[_0x547c('0x13')](0x1f4,_0xed2d39[_0x547c('0x15')]));});});}; \ No newline at end of file +var _0xbb59=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateOpenchannelQueueReport','body','options','catch','UpdateOpenchannelQueueReport','update','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x2aee2f,_0xad9887){var _0x19337f=function(_0x2e62d){while(--_0x2e62d){_0x2aee2f['push'](_0x2aee2f['shift']());}};_0x19337f(++_0xad9887);}(_0xbb59,0xec));var _0x9bb5=function(_0xf83757,_0x15e41c){_0xf83757=_0xf83757-0x0;var _0x5552c1=_0xbb59[_0xf83757];return _0x5552c1;};'use strict';var _=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var moment=require(_0x9bb5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb5('0x3'));var db=require(_0x9bb5('0x4'))['db'];var utils=require(_0x9bb5('0x5'));var logger=require(_0x9bb5('0x6'))(_0x9bb5('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bb5('0x8'));var client=jayson[_0x9bb5('0x9')][_0x9bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df722,_0xe362e0,_0x83fd10){return new BPromise(function(_0x2d6cce,_0x4e3857){return client[_0x9bb5('0xb')](_0x2df722,_0x83fd10)[_0x9bb5('0xc')](function(_0x2fdbcb){logger[_0x9bb5('0xd')](_0x9bb5('0xe'),_0xe362e0,'request\x20sent');logger[_0x9bb5('0xf')](_0x9bb5('0x10'),_0xe362e0,_0x9bb5('0x11'),JSON[_0x9bb5('0x12')](_0x2fdbcb));if(_0x2fdbcb[_0x9bb5('0x13')]){if(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x14')]===0x1f4){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);return _0x4e3857(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);}logger[_0x9bb5('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x2fdbcb['error'][_0x9bb5('0x15')]);return _0x2d6cce(_0x2fdbcb['error']['message']);}else{logger[_0x9bb5('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x9bb5('0x11'));_0x2d6cce(_0x2fdbcb[_0x9bb5('0x16')][_0x9bb5('0x15')]);}})['catch'](function(_0xb471e){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0xb471e);_0x4e3857(_0xb471e);});});}exports[_0x9bb5('0x17')]=function(_0xba8392){var _0x19d1e9=this;return new Promise(function(_0x162815,_0xe44bdd){return db['OpenchannelQueueReport']['create'](_0xba8392[_0x9bb5('0x18')],{'raw':_0xba8392[_0x9bb5('0x19')]?_0xba8392['options']['raw']===undefined?!![]:![]:!![]})[_0x9bb5('0xc')](function(_0x182966){logger[_0x9bb5('0xd')]('CreateOpenchannelQueueReport',_0xba8392);logger[_0x9bb5('0xf')](_0x9bb5('0x17'),_0xba8392,JSON[_0x9bb5('0x12')](_0x182966));_0x162815(_0x182966);})[_0x9bb5('0x1a')](function(_0x51fa34){logger[_0x9bb5('0x13')](_0x9bb5('0x17'),_0x51fa34['message'],_0xba8392);_0xe44bdd(_0x19d1e9[_0x9bb5('0x13')](0x1f4,_0x51fa34['message']));});});};exports[_0x9bb5('0x1b')]=function(_0x5357e9){var _0x4be52b=this;return new Promise(function(_0x1d7195,_0x16db23){return db['OpenchannelQueueReport'][_0x9bb5('0x1c')](_0x5357e9[_0x9bb5('0x18')],{'raw':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1d')]||null:null,'attributes':_0x5357e9['options']?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1e')]||null:null,'limit':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['limit']||null:null})['then'](function(_0x1ad67b){logger[_0x9bb5('0xd')](_0x9bb5('0x1b'),_0x5357e9);logger[_0x9bb5('0xf')](_0x9bb5('0x1b'),_0x5357e9,JSON['stringify'](_0x1ad67b));_0x1d7195(_0x1ad67b);})['catch'](function(_0x59ef00){logger[_0x9bb5('0x13')](_0x9bb5('0x1b'),_0x59ef00[_0x9bb5('0x15')],_0x5357e9);_0x16db23(_0x4be52b['error'](0x1f4,_0x59ef00['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 898631e..77cf265 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 _0x01e4=['update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','isAuthenticated','/describe','get','/:id','show','post','create'];(function(_0x569c8f,_0x519095){var _0x48fa26=function(_0x46be6f){while(--_0x46be6f){_0x569c8f['push'](_0x569c8f['shift']());}};_0x48fa26(++_0x519095);}(_0x01e4,0x147));var _0x401e=function(_0x50a4ee,_0x4dad3c){_0x50a4ee=_0x50a4ee-0x0;var _0x710c9b=_0x01e4[_0x50a4ee];return _0x710c9b;};'use strict';var multer=require(_0x401e('0x0'));var util=require('util');var path=require(_0x401e('0x1'));var timeout=require(_0x401e('0x2'));var express=require('express');var router=express[_0x401e('0x3')]();var fs_extra=require(_0x401e('0x4'));var auth=require(_0x401e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x401e('0x6')](),controller['index']);router['get'](_0x401e('0x7'),auth[_0x401e('0x6')](),controller['describe']);router[_0x401e('0x8')](_0x401e('0x9'),auth['isAuthenticated'](),controller[_0x401e('0xa')]);router[_0x401e('0xb')]('/',auth['isAuthenticated'](),controller[_0x401e('0xc')]);router['put'](_0x401e('0x9'),auth[_0x401e('0x6')](),controller[_0x401e('0xd')]);router[_0x401e('0xe')]('/:id',auth[_0x401e('0x6')](),controller[_0x401e('0xf')]);module[_0x401e('0x10')]=router; \ No newline at end of file +var _0xd415=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2e9b87,_0xc828f){var _0x34889a=function(_0x478ff5){while(--_0x478ff5){_0x2e9b87['push'](_0x2e9b87['shift']());}};_0x34889a(++_0xc828f);}(_0xd415,0xf9));var _0x5d41=function(_0x318f52,_0x4dd664){_0x318f52=_0x318f52-0x0;var _0x55c506=_0xd415[_0x318f52];return _0x55c506;};'use strict';var multer=require(_0x5d41('0x0'));var util=require(_0x5d41('0x1'));var path=require(_0x5d41('0x2'));var timeout=require(_0x5d41('0x3'));var express=require(_0x5d41('0x4'));var router=express[_0x5d41('0x5')]();var fs_extra=require(_0x5d41('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5d41('0x7'));var config=require(_0x5d41('0x8'));var controller=require(_0x5d41('0x9'));router[_0x5d41('0xa')]('/',auth['isAuthenticated'](),controller[_0x5d41('0xb')]);router[_0x5d41('0xa')](_0x5d41('0xc'),auth[_0x5d41('0xd')](),controller[_0x5d41('0xe')]);router['get'](_0x5d41('0xf'),auth[_0x5d41('0xd')](),controller[_0x5d41('0x10')]);router[_0x5d41('0x11')]('/',auth['isAuthenticated'](),controller[_0x5d41('0x12')]);router[_0x5d41('0x13')]('/:id',auth[_0x5d41('0xd')](),controller[_0x5d41('0x14')]);router['delete'](_0x5d41('0xf'),auth[_0x5d41('0xd')](),controller[_0x5d41('0x15')]);module[_0x5d41('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index bfa013f..83dc12d 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x1af5b2,_0x1b82fe){var _0xf1aa2d=function(_0x2ceae2){while(--_0x2ceae2){_0x1af5b2['push'](_0x1af5b2['shift']());}};_0xf1aa2d(++_0x1b82fe);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'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 +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x262e3e,_0x4de374){var _0x2f97a0=function(_0x275a37){while(--_0x275a37){_0x262e3e['push'](_0x262e3e['shift']());}};_0x2f97a0(++_0x4de374);}(_0xf4eb,0xec));var _0xbf4e=function(_0x567ba9,_0x87d1d1){_0x567ba9=_0x567ba9-0x0;var _0x1f9dae=_0xf4eb[_0x567ba9];return _0x1f9dae;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index bc8b493..b0a9d1b 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 _0xe6c5=['undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','query','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','filter','merge','options','includeAll','include','show','params','keys','rawAttributes','length','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x514718,_0xdcbcd2){var _0xf5beda=function(_0x4c962c){while(--_0x4c962c){_0x514718['push'](_0x514718['shift']());}};_0xf5beda(++_0xdcbcd2);}(_0xe6c5,0x155));var _0x5e6c=function(_0x49bedd,_0x469f40){_0x49bedd=_0x49bedd-0x0;var _0x2dc886=_0xe6c5[_0x49bedd];return _0x2dc886;};'use strict';var emlformat=require(_0x5e6c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5e6c('0x1'));var rp=require(_0x5e6c('0x2'));var moment=require(_0x5e6c('0x3'));var BPromise=require(_0x5e6c('0x4'));var Mustache=require('mustache');var util=require(_0x5e6c('0x5'));var path=require(_0x5e6c('0x6'));var sox=require(_0x5e6c('0x7'));var csv=require(_0x5e6c('0x8'));var ejs=require(_0x5e6c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5e6c('0xa'));var crypto=require(_0x5e6c('0xb'));var jsforce=require(_0x5e6c('0xc'));var deskjs=require(_0x5e6c('0xd'));var toCsv=require(_0x5e6c('0x8'));var querystring=require(_0x5e6c('0xe'));var Papa=require(_0x5e6c('0xf'));var Redis=require('ioredis');var authService=require(_0x5e6c('0x10'));var qs=require(_0x5e6c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e6c('0x12'));var logger=require(_0x5e6c('0x13'))(_0x5e6c('0x14'));var utils=require(_0x5e6c('0x15'));var config=require(_0x5e6c('0x16'));var licenseUtil=require(_0x5e6c('0x17'));var db=require(_0x5e6c('0x18'))['db'];function respondWithStatusCode(_0x4a202e,_0x40f827){_0x40f827=_0x40f827||0xcc;return function(_0xff9826){if(_0xff9826){return _0x4a202e[_0x5e6c('0x19')](_0x40f827);}return _0x4a202e[_0x5e6c('0x1a')](_0x40f827)[_0x5e6c('0x1b')]();};}function respondWithResult(_0x70c550,_0xfab85f){_0xfab85f=_0xfab85f||0xc8;return function(_0x481a63){if(_0x481a63){return _0x70c550[_0x5e6c('0x1a')](_0xfab85f)[_0x5e6c('0x1c')](_0x481a63);}};}function respondWithFilteredResult(_0x528556,_0x62ed7f){return function(_0x9244d9){if(_0x9244d9){var _0x5be190=typeof _0x62ed7f['offset']===_0x5e6c('0x1d')&&typeof _0x62ed7f[_0x5e6c('0x1e')]===_0x5e6c('0x1d');var _0xcfc557=_0x9244d9[_0x5e6c('0x1f')];var _0x39ce22=_0x5be190?0x0:_0x62ed7f[_0x5e6c('0x20')];var _0x20f44f=_0x5be190?_0x9244d9[_0x5e6c('0x1f')]:_0x62ed7f[_0x5e6c('0x20')]+_0x62ed7f[_0x5e6c('0x1e')];var _0x44c374;if(_0x20f44f>=_0xcfc557){_0x20f44f=_0xcfc557;_0x44c374=0xc8;}else{_0x44c374=0xce;}_0x528556['status'](_0x44c374);return _0x528556[_0x5e6c('0x21')](_0x5e6c('0x22'),_0x39ce22+'-'+_0x20f44f+'/'+_0xcfc557)['json'](_0x9244d9);}return null;};}function patchUpdates(_0x1447f8){return function(_0x4317aa){try{jsonpatch['apply'](_0x4317aa,_0x1447f8,!![]);}catch(_0x5167a9){return BPromise[_0x5e6c('0x23')](_0x5167a9);}return _0x4317aa[_0x5e6c('0x24')]();};}function saveUpdates(_0x1feae5,_0x570556){return function(_0x1ce49c){if(_0x1ce49c){return _0x1ce49c[_0x5e6c('0x25')](_0x1feae5)[_0x5e6c('0x26')](function(_0x4afebc){return _0x4afebc;});}return null;};}function removeEntity(_0x29d6d9,_0x419d68){return function(_0x41be5c){if(_0x41be5c){return _0x41be5c[_0x5e6c('0x27')]()['then'](function(){_0x29d6d9[_0x5e6c('0x1a')](0xcc)[_0x5e6c('0x1b')]();});}};}function handleEntityNotFound(_0x356779,_0x3fd7b1){return function(_0x31c9a3){if(!_0x31c9a3){_0x356779['sendStatus'](0x194);}return _0x31c9a3;};}function handleError(_0x53085c,_0x2d28c2){_0x2d28c2=_0x2d28c2||0x1f4;return function(_0x455b81){logger[_0x5e6c('0x28')](_0x455b81[_0x5e6c('0x29')]);if(_0x455b81['name']){delete _0x455b81[_0x5e6c('0x2a')];}_0x53085c[_0x5e6c('0x1a')](_0x2d28c2)[_0x5e6c('0x2b')](_0x455b81);};}exports[_0x5e6c('0x2c')]=function(_0x19d25c,_0x44bc4e){var _0x313b10={},_0x2e76cd={},_0x1e08f5={'count':0x0,'rows':[]};var _0x2ea161=_[_0x5e6c('0x2d')](db[_0x5e6c('0x2e')]['rawAttributes'],function(_0x583ec7){return{'name':_0x583ec7[_0x5e6c('0x2f')],'type':_0x583ec7[_0x5e6c('0x30')]['key']};});_0x2e76cd['model']=_['map'](_0x2ea161,_0x5e6c('0x2a'));_0x2e76cd[_0x5e6c('0x31')]=_['keys'](_0x19d25c[_0x5e6c('0x31')]);_0x2e76cd[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x2e76cd[_0x5e6c('0x34')],_0x2e76cd[_0x5e6c('0x31')]);_0x313b10['attributes']=_[_0x5e6c('0x33')](_0x2e76cd['model'],qs[_0x5e6c('0x35')](_0x19d25c['query']['fields']));_0x313b10[_0x5e6c('0x36')]=_0x313b10[_0x5e6c('0x36')]['length']?_0x313b10[_0x5e6c('0x36')]:_0x2e76cd[_0x5e6c('0x34')];if(!_0x19d25c[_0x5e6c('0x31')]['hasOwnProperty'](_0x5e6c('0x37'))){_0x313b10['limit']=qs['limit'](_0x19d25c[_0x5e6c('0x31')]['limit']);_0x313b10[_0x5e6c('0x20')]=qs[_0x5e6c('0x20')](_0x19d25c[_0x5e6c('0x31')]['offset']);}_0x313b10['order']=qs[_0x5e6c('0x38')](_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x38')]);_0x313b10[_0x5e6c('0x39')]=qs[_0x5e6c('0x32')](_[_0x5e6c('0x3a')](_0x19d25c['query'],_0x2e76cd[_0x5e6c('0x32')]),_0x2ea161);if(_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3b')]){_0x313b10[_0x5e6c('0x39')]=_[_0x5e6c('0x3c')](_0x313b10[_0x5e6c('0x39')],{'$or':_[_0x5e6c('0x2d')](_0x2ea161,function(_0x304085){if(_0x304085[_0x5e6c('0x30')]!=='VIRTUAL'){var _0x399736={};_0x399736[_0x304085['name']]={'$like':'%'+_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3b')]+'%'};return _0x399736;}})});}_0x313b10=_['merge']({},_0x313b10,_0x19d25c[_0x5e6c('0x3d')]);var _0x3fb303={'where':_0x313b10[_0x5e6c('0x39')]};return db[_0x5e6c('0x2e')][_0x5e6c('0x1f')](_0x3fb303)[_0x5e6c('0x26')](function(_0x5beb6b){_0x1e08f5[_0x5e6c('0x1f')]=_0x5beb6b;if(_0x19d25c[_0x5e6c('0x31')][_0x5e6c('0x3e')]){_0x313b10[_0x5e6c('0x3f')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x313b10);})[_0x5e6c('0x26')](function(_0x2e79e0){_0x1e08f5['rows']=_0x2e79e0;return _0x1e08f5;})[_0x5e6c('0x26')](respondWithFilteredResult(_0x44bc4e,_0x313b10))['catch'](handleError(_0x44bc4e,null));};exports[_0x5e6c('0x40')]=function(_0x22a3cb,_0xb2025f){var _0x57b0e0={'raw':!![],'where':{'id':_0x22a3cb[_0x5e6c('0x41')]['id']}},_0x2b5162={};_0x2b5162[_0x5e6c('0x34')]=_[_0x5e6c('0x42')](db[_0x5e6c('0x2e')][_0x5e6c('0x43')]);_0x2b5162[_0x5e6c('0x31')]=_['keys'](_0x22a3cb[_0x5e6c('0x31')]);_0x2b5162[_0x5e6c('0x32')]=_[_0x5e6c('0x33')](_0x2b5162[_0x5e6c('0x34')],_0x2b5162['query']);_0x57b0e0['attributes']=_[_0x5e6c('0x33')](_0x2b5162[_0x5e6c('0x34')],qs[_0x5e6c('0x35')](_0x22a3cb[_0x5e6c('0x31')][_0x5e6c('0x35')]));_0x57b0e0['attributes']=_0x57b0e0[_0x5e6c('0x36')][_0x5e6c('0x44')]?_0x57b0e0[_0x5e6c('0x36')]:_0x2b5162[_0x5e6c('0x34')];if(_0x22a3cb[_0x5e6c('0x31')][_0x5e6c('0x3e')]){_0x57b0e0[_0x5e6c('0x3f')]=[{'all':!![]}];}_0x57b0e0=_[_0x5e6c('0x3c')]({},_0x57b0e0,_0x22a3cb[_0x5e6c('0x3d')]);return db[_0x5e6c('0x2e')][_0x5e6c('0x45')](_0x57b0e0)[_0x5e6c('0x26')](handleEntityNotFound(_0xb2025f,null))['then'](respondWithResult(_0xb2025f,null))[_0x5e6c('0x46')](handleError(_0xb2025f,null));};exports['create']=function(_0x37ec14,_0x20858a){return db['OpenchannelTransferReport'][_0x5e6c('0x47')](_0x37ec14['body'],{})[_0x5e6c('0x26')](respondWithResult(_0x20858a,0xc9))['catch'](handleError(_0x20858a,null));};exports['update']=function(_0x35b5f9,_0x284f96){if(_0x35b5f9[_0x5e6c('0x48')]['id']){delete _0x35b5f9[_0x5e6c('0x48')]['id'];}return db[_0x5e6c('0x2e')][_0x5e6c('0x45')]({'where':{'id':_0x35b5f9[_0x5e6c('0x41')]['id']}})[_0x5e6c('0x26')](handleEntityNotFound(_0x284f96,null))[_0x5e6c('0x26')](saveUpdates(_0x35b5f9[_0x5e6c('0x48')],null))[_0x5e6c('0x26')](respondWithResult(_0x284f96,null))[_0x5e6c('0x46')](handleError(_0x284f96,null));};exports[_0x5e6c('0x27')]=function(_0xa0bf68,_0x2230af){return db[_0x5e6c('0x2e')][_0x5e6c('0x45')]({'where':{'id':_0xa0bf68['params']['id']}})[_0x5e6c('0x26')](handleEntityNotFound(_0x2230af,null))[_0x5e6c('0x26')](removeEntity(_0x2230af,null))[_0x5e6c('0x46')](handleError(_0x2230af,null));};exports[_0x5e6c('0x49')]=function(_0x29ed91,_0x577e56){return db[_0x5e6c('0x2e')][_0x5e6c('0x49')]()['then'](respondWithResult(_0x577e56,null))[_0x5e6c('0x46')](handleError(_0x577e56,null));}; \ No newline at end of file +var _0x61e4=['fs-extra','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','index','map','OpenchannelTransferReport','rawAttributes','key','model','name','query','filters','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','includeAll','include','catch','params','keys','attributes','merge','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xbfec58,_0x5f4153){var _0x3dc84d=function(_0x498ef6){while(--_0x498ef6){_0xbfec58['push'](_0xbfec58['shift']());}};_0x3dc84d(++_0x5f4153);}(_0x61e4,0x112));var _0x461e=function(_0x275804,_0x1690bb){_0x275804=_0x275804-0x0;var _0x5cf3a4=_0x61e4[_0x275804];return _0x5cf3a4;};'use strict';var emlformat=require(_0x461e('0x0'));var rimraf=require(_0x461e('0x1'));var zipdir=require(_0x461e('0x2'));var jsonpatch=require(_0x461e('0x3'));var rp=require('request-promise');var moment=require(_0x461e('0x4'));var BPromise=require(_0x461e('0x5'));var Mustache=require(_0x461e('0x6'));var util=require('util');var path=require(_0x461e('0x7'));var sox=require(_0x461e('0x8'));var csv=require(_0x461e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x461e('0xa'));var _=require('lodash');var squel=require(_0x461e('0xb'));var crypto=require(_0x461e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x461e('0x9'));var querystring=require(_0x461e('0xd'));var Papa=require(_0x461e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x461e('0xf'));var as=require(_0x461e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x461e('0x11'))('api');var utils=require(_0x461e('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x461e('0x13'));var db=require(_0x461e('0x14'))['db'];function respondWithStatusCode(_0x2d25e3,_0x428ab3){_0x428ab3=_0x428ab3||0xcc;return function(_0x5866d7){if(_0x5866d7){return _0x2d25e3[_0x461e('0x15')](_0x428ab3);}return _0x2d25e3[_0x461e('0x16')](_0x428ab3)[_0x461e('0x17')]();};}function respondWithResult(_0x49f9d0,_0xd3d40b){_0xd3d40b=_0xd3d40b||0xc8;return function(_0x1568d6){if(_0x1568d6){return _0x49f9d0[_0x461e('0x16')](_0xd3d40b)[_0x461e('0x18')](_0x1568d6);}};}function respondWithFilteredResult(_0x4f196b,_0x40b134){return function(_0x2c61d9){if(_0x2c61d9){var _0x31b6ae=typeof _0x40b134[_0x461e('0x19')]===_0x461e('0x1a')&&typeof _0x40b134[_0x461e('0x1b')]===_0x461e('0x1a');var _0x349b5e=_0x2c61d9[_0x461e('0x1c')];var _0x453573=_0x31b6ae?0x0:_0x40b134[_0x461e('0x19')];var _0x3ba12c=_0x31b6ae?_0x2c61d9[_0x461e('0x1c')]:_0x40b134[_0x461e('0x19')]+_0x40b134[_0x461e('0x1b')];var _0x10ddcb;if(_0x3ba12c>=_0x349b5e){_0x3ba12c=_0x349b5e;_0x10ddcb=0xc8;}else{_0x10ddcb=0xce;}_0x4f196b[_0x461e('0x16')](_0x10ddcb);return _0x4f196b[_0x461e('0x1d')](_0x461e('0x1e'),_0x453573+'-'+_0x3ba12c+'/'+_0x349b5e)[_0x461e('0x18')](_0x2c61d9);}return null;};}function patchUpdates(_0x6ee51d){return function(_0x300749){try{jsonpatch[_0x461e('0x1f')](_0x300749,_0x6ee51d,!![]);}catch(_0x33f72e){return BPromise[_0x461e('0x20')](_0x33f72e);}return _0x300749[_0x461e('0x21')]();};}function saveUpdates(_0x2fc217,_0x1190b7){return function(_0x48e8a9){if(_0x48e8a9){return _0x48e8a9[_0x461e('0x22')](_0x2fc217)[_0x461e('0x23')](function(_0x1fcdd8){return _0x1fcdd8;});}return null;};}function removeEntity(_0x79e9e2,_0x4b8f73){return function(_0x1152c0){if(_0x1152c0){return _0x1152c0['destroy']()[_0x461e('0x23')](function(){_0x79e9e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x25c8fd,_0x1b04dd){return function(_0xc0ec1a){if(!_0xc0ec1a){_0x25c8fd[_0x461e('0x15')](0x194);}return _0xc0ec1a;};}function handleError(_0x363453,_0x5a4788){_0x5a4788=_0x5a4788||0x1f4;return function(_0x448e77){logger[_0x461e('0x24')](_0x448e77[_0x461e('0x25')]);if(_0x448e77['name']){delete _0x448e77['name'];}_0x363453[_0x461e('0x16')](_0x5a4788)['send'](_0x448e77);};}exports[_0x461e('0x26')]=function(_0x5e23ec,_0x281eaf){var _0x368b57={},_0x4e5e21={},_0x4109e7={'count':0x0,'rows':[]};var _0x12035b=_[_0x461e('0x27')](db[_0x461e('0x28')][_0x461e('0x29')],function(_0x1e7b94){return{'name':_0x1e7b94['fieldName'],'type':_0x1e7b94['type'][_0x461e('0x2a')]};});_0x4e5e21[_0x461e('0x2b')]=_[_0x461e('0x27')](_0x12035b,_0x461e('0x2c'));_0x4e5e21[_0x461e('0x2d')]=_['keys'](_0x5e23ec[_0x461e('0x2d')]);_0x4e5e21[_0x461e('0x2e')]=_[_0x461e('0x2f')](_0x4e5e21[_0x461e('0x2b')],_0x4e5e21[_0x461e('0x2d')]);_0x368b57['attributes']=_['intersection'](_0x4e5e21[_0x461e('0x2b')],qs['fields'](_0x5e23ec['query'][_0x461e('0x30')]));_0x368b57['attributes']=_0x368b57['attributes'][_0x461e('0x31')]?_0x368b57['attributes']:_0x4e5e21[_0x461e('0x2b')];if(!_0x5e23ec[_0x461e('0x2d')][_0x461e('0x32')](_0x461e('0x33'))){_0x368b57[_0x461e('0x1b')]=qs[_0x461e('0x1b')](_0x5e23ec[_0x461e('0x2d')][_0x461e('0x1b')]);_0x368b57[_0x461e('0x19')]=qs[_0x461e('0x19')](_0x5e23ec['query'][_0x461e('0x19')]);}_0x368b57['order']=qs[_0x461e('0x34')](_0x5e23ec[_0x461e('0x2d')]['sort']);_0x368b57[_0x461e('0x35')]=qs[_0x461e('0x2e')](_[_0x461e('0x36')](_0x5e23ec[_0x461e('0x2d')],_0x4e5e21[_0x461e('0x2e')]),_0x12035b);if(_0x5e23ec['query'][_0x461e('0x37')]){_0x368b57[_0x461e('0x35')]=_['merge'](_0x368b57['where'],{'$or':_[_0x461e('0x27')](_0x12035b,function(_0x29f25c){if(_0x29f25c[_0x461e('0x38')]!==_0x461e('0x39')){var _0x2aab39={};_0x2aab39[_0x29f25c[_0x461e('0x2c')]]={'$like':'%'+_0x5e23ec[_0x461e('0x2d')][_0x461e('0x37')]+'%'};return _0x2aab39;}})});}_0x368b57=_['merge']({},_0x368b57,_0x5e23ec['options']);var _0x142ed4={'where':_0x368b57[_0x461e('0x35')]};return db[_0x461e('0x28')][_0x461e('0x1c')](_0x142ed4)[_0x461e('0x23')](function(_0x41932a){_0x4109e7[_0x461e('0x1c')]=_0x41932a;if(_0x5e23ec[_0x461e('0x2d')][_0x461e('0x3a')]){_0x368b57[_0x461e('0x3b')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x368b57);})[_0x461e('0x23')](function(_0x4bcd2b){_0x4109e7['rows']=_0x4bcd2b;return _0x4109e7;})[_0x461e('0x23')](respondWithFilteredResult(_0x281eaf,_0x368b57))[_0x461e('0x3c')](handleError(_0x281eaf,null));};exports['show']=function(_0x5634f4,_0x3c1d45){var _0x3a8c67={'raw':!![],'where':{'id':_0x5634f4[_0x461e('0x3d')]['id']}},_0x4abc38={};_0x4abc38[_0x461e('0x2b')]=_[_0x461e('0x3e')](db[_0x461e('0x28')][_0x461e('0x29')]);_0x4abc38[_0x461e('0x2d')]=_[_0x461e('0x3e')](_0x5634f4[_0x461e('0x2d')]);_0x4abc38[_0x461e('0x2e')]=_[_0x461e('0x2f')](_0x4abc38[_0x461e('0x2b')],_0x4abc38[_0x461e('0x2d')]);_0x3a8c67[_0x461e('0x3f')]=_[_0x461e('0x2f')](_0x4abc38[_0x461e('0x2b')],qs[_0x461e('0x30')](_0x5634f4[_0x461e('0x2d')][_0x461e('0x30')]));_0x3a8c67[_0x461e('0x3f')]=_0x3a8c67[_0x461e('0x3f')]['length']?_0x3a8c67[_0x461e('0x3f')]:_0x4abc38['model'];if(_0x5634f4[_0x461e('0x2d')][_0x461e('0x3a')]){_0x3a8c67['include']=[{'all':!![]}];}_0x3a8c67=_[_0x461e('0x40')]({},_0x3a8c67,_0x5634f4[_0x461e('0x41')]);return db[_0x461e('0x28')][_0x461e('0x42')](_0x3a8c67)[_0x461e('0x23')](handleEntityNotFound(_0x3c1d45,null))['then'](respondWithResult(_0x3c1d45,null))[_0x461e('0x3c')](handleError(_0x3c1d45,null));};exports[_0x461e('0x43')]=function(_0x1301b1,_0x4af962){return db['OpenchannelTransferReport']['create'](_0x1301b1[_0x461e('0x44')],{})[_0x461e('0x23')](respondWithResult(_0x4af962,0xc9))[_0x461e('0x3c')](handleError(_0x4af962,null));};exports[_0x461e('0x22')]=function(_0x59d9bd,_0x3a0cdf){if(_0x59d9bd[_0x461e('0x44')]['id']){delete _0x59d9bd[_0x461e('0x44')]['id'];}return db[_0x461e('0x28')][_0x461e('0x42')]({'where':{'id':_0x59d9bd['params']['id']}})[_0x461e('0x23')](handleEntityNotFound(_0x3a0cdf,null))['then'](saveUpdates(_0x59d9bd[_0x461e('0x44')],null))[_0x461e('0x23')](respondWithResult(_0x3a0cdf,null))['catch'](handleError(_0x3a0cdf,null));};exports[_0x461e('0x45')]=function(_0x5bad35,_0x455ac4){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x5bad35[_0x461e('0x3d')]['id']}})[_0x461e('0x23')](handleEntityNotFound(_0x455ac4,null))[_0x461e('0x23')](removeEntity(_0x455ac4,null))[_0x461e('0x3c')](handleError(_0x455ac4,null));};exports[_0x461e('0x46')]=function(_0x42a5fd,_0x573dd2){return db[_0x461e('0x28')]['describe']()[_0x461e('0x23')](respondWithResult(_0x573dd2,null))[_0x461e('0x3c')](handleError(_0x573dd2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a398958..515ba64 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 _0x6bbd=['rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1923e4,_0xd6764b){var _0x135d5e=function(_0x3a61cd){while(--_0x3a61cd){_0x1923e4['push'](_0x1923e4['shift']());}};_0x135d5e(++_0xd6764b);}(_0x6bbd,0x124));var _0xd6bb=function(_0x4a7273,_0x19c9ca){_0x4a7273=_0x4a7273-0x0;var _0x135ca9=_0x6bbd[_0x4a7273];return _0x135ca9;};'use strict';var _=require(_0xd6bb('0x0'));var util=require(_0xd6bb('0x1'));var logger=require(_0xd6bb('0x2'))(_0xd6bb('0x3'));var moment=require(_0xd6bb('0x4'));var BPromise=require(_0xd6bb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6bb('0x6'));var rimraf=require(_0xd6bb('0x7'));var config=require('../../config/environment');var attributes=require(_0xd6bb('0x8'));module[_0xd6bb('0x9')]=function(_0x13ea9e,_0x15f751){return _0x13ea9e[_0xd6bb('0xa')](_0xd6bb('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xd6bb('0xc'),'fields':[_0xd6bb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdf1=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfdf1,0x116));var _0x1fdf=function(_0xb63923,_0x5df3bb){_0xb63923=_0xb63923-0x0;var _0x35d5ac=_0xfdf1[_0xb63923];return _0x35d5ac;};'use strict';var _=require(_0x1fdf('0x0'));var util=require(_0x1fdf('0x1'));var logger=require(_0x1fdf('0x2'))(_0x1fdf('0x3'));var moment=require(_0x1fdf('0x4'));var BPromise=require(_0x1fdf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fdf('0x6'));var rimraf=require(_0x1fdf('0x7'));var config=require(_0x1fdf('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0x1fdf('0x9')]=function(_0x1a80cb,_0x3c814a){return _0x1a80cb[_0x1fdf('0xa')](_0x1fdf('0xb'),attributes,{'tableName':_0x1fdf('0xc'),'paranoid':![],'indexes':[{'name':_0x1fdf('0xd'),'fields':[_0x1fdf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 641a629..6bb2408 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 _0xa7e6=['stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa7e6,0x74));var _0x6a7e=function(_0x15c211,_0x13093b){_0x15c211=_0x15c211-0x0;var _0x2fc84c=_0xa7e6[_0x15c211];return _0x2fc84c;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var moment=require(_0x6a7e('0x2'));var BPromise=require(_0x6a7e('0x3'));var rs=require(_0x6a7e('0x4'));var fs=require('fs');var Redis=require(_0x6a7e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a7e('0x6'));var logger=require(_0x6a7e('0x7'))(_0x6a7e('0x8'));var config=require(_0x6a7e('0x9'));var jayson=require(_0x6a7e('0xa'));var client=jayson['client'][_0x6a7e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16249d,_0x37165d,_0x342c96){return new BPromise(function(_0x45e92e,_0x3f3f2f){return client[_0x6a7e('0xc')](_0x16249d,_0x342c96)[_0x6a7e('0xd')](function(_0xdaa33d){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x37165d,'request\x20sent');logger['debug'](_0x6a7e('0xe'),_0x37165d,_0x6a7e('0xf'),JSON[_0x6a7e('0x10')](_0xdaa33d));if(_0xdaa33d[_0x6a7e('0x11')]){if(_0xdaa33d[_0x6a7e('0x11')]['code']===0x1f4){logger[_0x6a7e('0x11')](_0x6a7e('0x12'),_0x37165d,_0xdaa33d['error']['message']);return _0x3f3f2f(_0xdaa33d[_0x6a7e('0x11')][_0x6a7e('0x13')]);}logger[_0x6a7e('0x11')](_0x6a7e('0x12'),_0x37165d,_0xdaa33d['error'][_0x6a7e('0x13')]);return _0x45e92e(_0xdaa33d[_0x6a7e('0x11')][_0x6a7e('0x13')]);}else{logger[_0x6a7e('0x14')](_0x6a7e('0x12'),_0x37165d,'request\x20sent');_0x45e92e(_0xdaa33d[_0x6a7e('0x15')]['message']);}})['catch'](function(_0x454561){logger['error'](_0x6a7e('0x12'),_0x37165d,_0x454561);_0x3f3f2f(_0x454561);});});} \ No newline at end of file +var _0x2975=['http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0xc489d8,_0x562c9b){var _0x17dc03=function(_0x774be0){while(--_0x774be0){_0xc489d8['push'](_0xc489d8['shift']());}};_0x17dc03(++_0x562c9b);}(_0x2975,0x1c5));var _0x5297=function(_0x47b464,_0x448ef1){_0x47b464=_0x47b464-0x0;var _0x1cd888=_0x2975[_0x47b464];return _0x1cd888;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var moment=require(_0x5297('0x1'));var BPromise=require(_0x5297('0x2'));var rs=require(_0x5297('0x3'));var fs=require('fs');var Redis=require(_0x5297('0x4'));var db=require(_0x5297('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5297('0x6'));var jayson=require(_0x5297('0x7'));var client=jayson[_0x5297('0x8')][_0x5297('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1d2c,_0x1f6762,_0x1b72a7){return new BPromise(function(_0x4f12b0,_0x2c015c){return client[_0x5297('0xa')](_0x4d1d2c,_0x1b72a7)[_0x5297('0xb')](function(_0x2f3b24){logger[_0x5297('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x5297('0xd'));logger[_0x5297('0xe')](_0x5297('0xf'),_0x1f6762,'request\x20sent',JSON[_0x5297('0x10')](_0x2f3b24));if(_0x2f3b24[_0x5297('0x11')]){if(_0x2f3b24[_0x5297('0x11')]['code']===0x1f4){logger[_0x5297('0x11')](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error']['message']);return _0x2c015c(_0x2f3b24[_0x5297('0x11')][_0x5297('0x13')]);}logger['error'](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error'][_0x5297('0x13')]);return _0x4f12b0(_0x2f3b24[_0x5297('0x11')]['message']);}else{logger[_0x5297('0xc')](_0x5297('0x12'),_0x1f6762,_0x5297('0xd'));_0x4f12b0(_0x2f3b24[_0x5297('0x14')][_0x5297('0x13')]);}})[_0x5297('0x15')](function(_0x1fb138){logger[_0x5297('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x1fb138);_0x2c015c(_0x1fb138);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 5008ae4..9c121c4 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 _0xbc72=['../../components/auth/service','../../config/environment','./pause.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','multer','util','path','express','Router','fs-extra'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0xbc72,0x8a));var _0x2bc7=function(_0x4ec16b,_0x5bc004){_0x4ec16b=_0x4ec16b-0x0;var _0x38d25f=_0xbc72[_0x4ec16b];return _0x38d25f;};'use strict';var multer=require(_0x2bc7('0x0'));var util=require(_0x2bc7('0x1'));var path=require(_0x2bc7('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bc7('0x3'));var router=express[_0x2bc7('0x4')]();var fs_extra=require(_0x2bc7('0x5'));var auth=require(_0x2bc7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2bc7('0x7'));var controller=require(_0x2bc7('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2bc7('0x9')](_0x2bc7('0xa'),auth[_0x2bc7('0xb')](),controller[_0x2bc7('0xc')]);router[_0x2bc7('0xd')]('/',auth['isAuthenticated'](),controller[_0x2bc7('0xe')]);router[_0x2bc7('0xf')](_0x2bc7('0xa'),auth[_0x2bc7('0xb')](),controller[_0x2bc7('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2bc7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x301c=['../../config/environment','index','get','/:id','show','post','put','update','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5e1e25,_0xdc1421){var _0x548e5f=function(_0x576360){while(--_0x576360){_0x5e1e25['push'](_0x5e1e25['shift']());}};_0x548e5f(++_0xdc1421);}(_0x301c,0x83));var _0xc301=function(_0x2e8889,_0xcd72f9){_0x2e8889=_0x2e8889-0x0;var _0x19dae6=_0x301c[_0x2e8889];return _0x19dae6;};'use strict';var multer=require(_0xc301('0x0'));var util=require(_0xc301('0x1'));var path=require(_0xc301('0x2'));var timeout=require(_0xc301('0x3'));var express=require(_0xc301('0x4'));var router=express[_0xc301('0x5')]();var fs_extra=require(_0xc301('0x6'));var auth=require(_0xc301('0x7'));var interaction=require(_0xc301('0x8'));var config=require(_0xc301('0x9'));var controller=require('./pause.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc301('0xa')]);router[_0xc301('0xb')](_0xc301('0xc'),auth['isAuthenticated'](),controller[_0xc301('0xd')]);router[_0xc301('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc301('0xf')](_0xc301('0xc'),auth['isAuthenticated'](),controller[_0xc301('0x10')]);router['delete'](_0xc301('0xc'),auth[_0xc301('0x11')](),controller[_0xc301('0x12')]);module[_0xc301('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index ed3529d..3ed3df9 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 _0xaf44=['STRING','sequelize','exports','name'];(function(_0x3048ed,_0x511d4e){var _0x2b3578=function(_0x563a69){while(--_0x563a69){_0x3048ed['push'](_0x3048ed['shift']());}};_0x2b3578(++_0x511d4e);}(_0xaf44,0x145));var _0x4af4=function(_0x2e2cfb,_0x51d703){_0x2e2cfb=_0x2e2cfb-0x0;var _0x1b7f7b=_0xaf44[_0x2e2cfb];return _0x1b7f7b;};'use strict';var Sequelize=require(_0x4af4('0x0'));module[_0x4af4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4af4('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4af4('0x3')]}}; \ No newline at end of file +var _0x407b=['name','STRING'];(function(_0x5a8f92,_0x3721f0){var _0x3f94a5=function(_0x5482eb){while(--_0x5482eb){_0x5a8f92['push'](_0x5a8f92['shift']());}};_0x3f94a5(++_0x3721f0);}(_0x407b,0xd1));var _0xb407=function(_0x358647,_0x5a50a3){_0x358647=_0x358647-0x0;var _0x4d176d=_0x407b[_0x358647];return _0x4d176d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb407('0x0')],'unique':_0xb407('0x1'),'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 263ded4..62212f8 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 _0x4ba0=['index','map','Pause','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','reject','save','update','then','get','Pauses','UserProfileResource','destroy','sendStatus','stack','name','send'];(function(_0x28f02b,_0x39c4aa){var _0x2cc42e=function(_0x4c16b9){while(--_0x4c16b9){_0x28f02b['push'](_0x28f02b['shift']());}};_0x2cc42e(++_0x39c4aa);}(_0x4ba0,0x75));var _0x04ba=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x4ba0[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0x04ba('0x0'));var rimraf=require(_0x04ba('0x1'));var zipdir=require(_0x04ba('0x2'));var jsonpatch=require(_0x04ba('0x3'));var rp=require('request-promise');var moment=require(_0x04ba('0x4'));var BPromise=require(_0x04ba('0x5'));var Mustache=require(_0x04ba('0x6'));var util=require('util');var path=require(_0x04ba('0x7'));var sox=require(_0x04ba('0x8'));var csv=require(_0x04ba('0x9'));var ejs=require(_0x04ba('0xa'));var fs=require('fs');var fs_extra=require(_0x04ba('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x04ba('0xc'));var jsforce=require(_0x04ba('0xd'));var deskjs=require(_0x04ba('0xe'));var toCsv=require(_0x04ba('0x9'));var querystring=require(_0x04ba('0xf'));var Papa=require(_0x04ba('0x10'));var Redis=require(_0x04ba('0x11'));var authService=require(_0x04ba('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x04ba('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x04ba('0x14'))('api');var utils=require(_0x04ba('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x04ba('0x16'));var db=require(_0x04ba('0x17'))['db'];function respondWithStatusCode(_0x304aba,_0x127b74){_0x127b74=_0x127b74||0xcc;return function(_0x51eab8){if(_0x51eab8){return _0x304aba['sendStatus'](_0x127b74);}return _0x304aba[_0x04ba('0x18')](_0x127b74)[_0x04ba('0x19')]();};}function respondWithResult(_0x1d5f8c,_0x36b42a){_0x36b42a=_0x36b42a||0xc8;return function(_0x538c0a){if(_0x538c0a){return _0x1d5f8c[_0x04ba('0x18')](_0x36b42a)['json'](_0x538c0a);}};}function respondWithFilteredResult(_0x137a5d,_0x914cfe){return function(_0x2a119b){if(_0x2a119b){var _0x337912=typeof _0x914cfe[_0x04ba('0x1a')]==='undefined'&&typeof _0x914cfe[_0x04ba('0x1b')]===_0x04ba('0x1c');var _0x469aa6=_0x2a119b['count'];var _0x498354=_0x337912?0x0:_0x914cfe['offset'];var _0x1922f5=_0x337912?_0x2a119b[_0x04ba('0x1d')]:_0x914cfe[_0x04ba('0x1a')]+_0x914cfe[_0x04ba('0x1b')];var _0xca48a8;if(_0x1922f5>=_0x469aa6){_0x1922f5=_0x469aa6;_0xca48a8=0xc8;}else{_0xca48a8=0xce;}_0x137a5d[_0x04ba('0x18')](_0xca48a8);return _0x137a5d[_0x04ba('0x1e')]('Content-Range',_0x498354+'-'+_0x1922f5+'/'+_0x469aa6)['json'](_0x2a119b);}return null;};}function patchUpdates(_0x30a7c9){return function(_0x5034b2){try{jsonpatch['apply'](_0x5034b2,_0x30a7c9,!![]);}catch(_0x25a757){return BPromise[_0x04ba('0x1f')](_0x25a757);}return _0x5034b2[_0x04ba('0x20')]();};}function saveUpdates(_0x2bb92b,_0x29778b){return function(_0x43874d){if(_0x43874d){return _0x43874d[_0x04ba('0x21')](_0x2bb92b)[_0x04ba('0x22')](function(_0x374529){return _0x374529;});}return null;};}function removeEntity(_0x27f979,_0x4acfde){return function(_0x4257c7){if(_0x4257c7){return _0x4257c7['destroy']()['then'](function(){var _0x3f13e7=_0x4257c7[_0x04ba('0x23')]({'plain':!![]});var _0x4c0360=_0x04ba('0x24');return db[_0x04ba('0x25')][_0x04ba('0x26')]({'where':{'type':_0x4c0360,'resourceId':_0x3f13e7['id']}})[_0x04ba('0x22')](function(){return _0x4257c7;});})[_0x04ba('0x22')](function(){_0x27f979[_0x04ba('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51aff4,_0x458ec7){return function(_0x11db49){if(!_0x11db49){_0x51aff4[_0x04ba('0x27')](0x194);}return _0x11db49;};}function handleError(_0x3961ae,_0xe12d57){_0xe12d57=_0xe12d57||0x1f4;return function(_0x24e426){logger['error'](_0x24e426[_0x04ba('0x28')]);if(_0x24e426['name']){delete _0x24e426[_0x04ba('0x29')];}_0x3961ae[_0x04ba('0x18')](_0xe12d57)[_0x04ba('0x2a')](_0x24e426);};}exports[_0x04ba('0x2b')]=function(_0x36da5a,_0xb749b1){var _0x400f50={},_0x4c3b81={},_0x55defa={'count':0x0,'rows':[]};var _0x3d07b8=_[_0x04ba('0x2c')](db[_0x04ba('0x2d')][_0x04ba('0x2e')],function(_0xe618e5){return{'name':_0xe618e5[_0x04ba('0x2f')],'type':_0xe618e5[_0x04ba('0x30')]['key']};});_0x4c3b81[_0x04ba('0x31')]=_['map'](_0x3d07b8,_0x04ba('0x29'));_0x4c3b81['query']=_[_0x04ba('0x32')](_0x36da5a[_0x04ba('0x33')]);_0x4c3b81['filters']=_[_0x04ba('0x34')](_0x4c3b81[_0x04ba('0x31')],_0x4c3b81[_0x04ba('0x33')]);_0x400f50[_0x04ba('0x35')]=_[_0x04ba('0x34')](_0x4c3b81[_0x04ba('0x31')],qs['fields'](_0x36da5a[_0x04ba('0x33')][_0x04ba('0x36')]));_0x400f50[_0x04ba('0x35')]=_0x400f50['attributes'][_0x04ba('0x37')]?_0x400f50['attributes']:_0x4c3b81['model'];if(!_0x36da5a[_0x04ba('0x33')]['hasOwnProperty'](_0x04ba('0x38'))){_0x400f50[_0x04ba('0x1b')]=qs[_0x04ba('0x1b')](_0x36da5a['query']['limit']);_0x400f50[_0x04ba('0x1a')]=qs[_0x04ba('0x1a')](_0x36da5a[_0x04ba('0x33')][_0x04ba('0x1a')]);}_0x400f50[_0x04ba('0x39')]=qs[_0x04ba('0x3a')](_0x36da5a[_0x04ba('0x33')]['sort']);_0x400f50[_0x04ba('0x3b')]=qs[_0x04ba('0x3c')](_[_0x04ba('0x3d')](_0x36da5a[_0x04ba('0x33')],_0x4c3b81[_0x04ba('0x3c')]),_0x3d07b8);if(_0x36da5a[_0x04ba('0x33')][_0x04ba('0x3e')]){_0x400f50[_0x04ba('0x3b')]=_[_0x04ba('0x3f')](_0x400f50[_0x04ba('0x3b')],{'$or':_['map'](_0x3d07b8,function(_0x658154){if(_0x658154[_0x04ba('0x30')]!==_0x04ba('0x40')){var _0x3fa6e8={};_0x3fa6e8[_0x658154[_0x04ba('0x29')]]={'$like':'%'+_0x36da5a[_0x04ba('0x33')][_0x04ba('0x3e')]+'%'};return _0x3fa6e8;}})});}_0x400f50=_[_0x04ba('0x3f')]({},_0x400f50,_0x36da5a[_0x04ba('0x41')]);var _0x5f0f26={'where':_0x400f50[_0x04ba('0x3b')]};return db[_0x04ba('0x2d')][_0x04ba('0x1d')](_0x5f0f26)['then'](function(_0x16774f){_0x55defa[_0x04ba('0x1d')]=_0x16774f;if(_0x36da5a[_0x04ba('0x33')]['includeAll']){_0x400f50['include']=[{'all':!![]}];}return db[_0x04ba('0x2d')][_0x04ba('0x42')](_0x400f50);})[_0x04ba('0x22')](function(_0xf951a4){_0x55defa[_0x04ba('0x43')]=_0xf951a4;return _0x55defa;})[_0x04ba('0x22')](respondWithFilteredResult(_0xb749b1,_0x400f50))[_0x04ba('0x44')](handleError(_0xb749b1,null));};exports['show']=function(_0x6caa08,_0x4ff6c5){var _0x29dcb7={'raw':!![],'where':{'id':_0x6caa08['params']['id']}},_0x4b1535={};_0x4b1535[_0x04ba('0x31')]=_[_0x04ba('0x32')](db[_0x04ba('0x2d')]['rawAttributes']);_0x4b1535[_0x04ba('0x33')]=_[_0x04ba('0x32')](_0x6caa08[_0x04ba('0x33')]);_0x4b1535[_0x04ba('0x3c')]=_[_0x04ba('0x34')](_0x4b1535[_0x04ba('0x31')],_0x4b1535[_0x04ba('0x33')]);_0x29dcb7[_0x04ba('0x35')]=_[_0x04ba('0x34')](_0x4b1535[_0x04ba('0x31')],qs[_0x04ba('0x36')](_0x6caa08[_0x04ba('0x33')][_0x04ba('0x36')]));_0x29dcb7[_0x04ba('0x35')]=_0x29dcb7[_0x04ba('0x35')][_0x04ba('0x37')]?_0x29dcb7[_0x04ba('0x35')]:_0x4b1535[_0x04ba('0x31')];if(_0x6caa08[_0x04ba('0x33')]['includeAll']){_0x29dcb7[_0x04ba('0x45')]=[{'all':!![]}];}_0x29dcb7=_[_0x04ba('0x3f')]({},_0x29dcb7,_0x6caa08[_0x04ba('0x41')]);return db[_0x04ba('0x2d')][_0x04ba('0x46')](_0x29dcb7)[_0x04ba('0x22')](handleEntityNotFound(_0x4ff6c5,null))[_0x04ba('0x22')](respondWithResult(_0x4ff6c5,null))[_0x04ba('0x44')](handleError(_0x4ff6c5,null));};exports[_0x04ba('0x47')]=function(_0x3b5ae1,_0x1ec905){return db['Pause'][_0x04ba('0x47')](_0x3b5ae1['body'],{})['then'](function(_0x1aa585){var _0x3fa32f=_0x3b5ae1[_0x04ba('0x48')][_0x04ba('0x23')]({'plain':!![]});if(!_0x3fa32f)throw new Error(_0x04ba('0x49'));if(_0x3fa32f[_0x04ba('0x4a')]===_0x04ba('0x48')){var _0x41a946=_0x1aa585[_0x04ba('0x23')]({'plain':!![]});var _0x198f0f=_0x04ba('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x198f0f,'userProfileId':_0x3fa32f[_0x04ba('0x4b')]},'raw':!![]})['then'](function(_0x334c0b){if(_0x334c0b&&_0x334c0b[_0x04ba('0x4c')]===0x0){return db[_0x04ba('0x25')]['create']({'name':_0x41a946[_0x04ba('0x29')],'resourceId':_0x41a946['id'],'type':_0x334c0b[_0x04ba('0x29')],'sectionId':_0x334c0b['id']},{})['then'](function(){return _0x1aa585;});}else{return _0x1aa585;}})[_0x04ba('0x44')](function(_0x14e3d8){logger['error'](_0x04ba('0x4d'),_0x14e3d8);throw _0x14e3d8;});}return _0x1aa585;})['then'](respondWithResult(_0x1ec905,0xc9))[_0x04ba('0x44')](handleError(_0x1ec905,null));};exports[_0x04ba('0x21')]=function(_0xee7842,_0x15835c){if(_0xee7842[_0x04ba('0x4e')]['id']){delete _0xee7842[_0x04ba('0x4e')]['id'];}return db['Pause'][_0x04ba('0x46')]({'where':{'id':_0xee7842[_0x04ba('0x4f')]['id']}})[_0x04ba('0x22')](handleEntityNotFound(_0x15835c,null))[_0x04ba('0x22')](saveUpdates(_0xee7842['body'],null))[_0x04ba('0x22')](respondWithResult(_0x15835c,null))[_0x04ba('0x44')](handleError(_0x15835c,null));};exports['destroy']=function(_0x20f40b,_0x474dd5){return db[_0x04ba('0x2d')][_0x04ba('0x46')]({'where':{'id':_0x20f40b[_0x04ba('0x4f')]['id']}})['then'](handleEntityNotFound(_0x474dd5,null))[_0x04ba('0x22')](removeEntity(_0x474dd5,null))[_0x04ba('0x44')](handleError(_0x474dd5,null));}; \ No newline at end of file +var _0x6138=['rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','includeAll','include','findAll','rows','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','Pause'];(function(_0x2802e4,_0xc318b8){var _0x101a9b=function(_0x260f58){while(--_0x260f58){_0x2802e4['push'](_0x2802e4['shift']());}};_0x101a9b(++_0xc318b8);}(_0x6138,0x72));var _0x8613=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6138[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x8613('0x0'));var rimraf=require(_0x8613('0x1'));var zipdir=require(_0x8613('0x2'));var jsonpatch=require(_0x8613('0x3'));var rp=require('request-promise');var moment=require(_0x8613('0x4'));var BPromise=require(_0x8613('0x5'));var Mustache=require(_0x8613('0x6'));var util=require(_0x8613('0x7'));var path=require(_0x8613('0x8'));var sox=require('sox');var csv=require(_0x8613('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8613('0xa'));var squel=require(_0x8613('0xb'));var crypto=require(_0x8613('0xc'));var jsforce=require(_0x8613('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8613('0xe'));var Papa=require(_0x8613('0xf'));var Redis=require(_0x8613('0x10'));var authService=require(_0x8613('0x11'));var qs=require(_0x8613('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8613('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8613('0x14'));var config=require(_0x8613('0x15'));var licenseUtil=require(_0x8613('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4509ec,_0xfcfb98){_0xfcfb98=_0xfcfb98||0xcc;return function(_0x1fe292){if(_0x1fe292){return _0x4509ec[_0x8613('0x17')](_0xfcfb98);}return _0x4509ec[_0x8613('0x18')](_0xfcfb98)[_0x8613('0x19')]();};}function respondWithResult(_0x28fa01,_0x190d15){_0x190d15=_0x190d15||0xc8;return function(_0x3b40b1){if(_0x3b40b1){return _0x28fa01[_0x8613('0x18')](_0x190d15)[_0x8613('0x1a')](_0x3b40b1);}};}function respondWithFilteredResult(_0x4d3e0c,_0x2ff246){return function(_0x2986ce){if(_0x2986ce){var _0x1ba4ec=typeof _0x2ff246[_0x8613('0x1b')]===_0x8613('0x1c')&&typeof _0x2ff246['limit']===_0x8613('0x1c');var _0x55c1a7=_0x2986ce[_0x8613('0x1d')];var _0x169976=_0x1ba4ec?0x0:_0x2ff246['offset'];var _0xd1af24=_0x1ba4ec?_0x2986ce[_0x8613('0x1d')]:_0x2ff246[_0x8613('0x1b')]+_0x2ff246[_0x8613('0x1e')];var _0x3e0051;if(_0xd1af24>=_0x55c1a7){_0xd1af24=_0x55c1a7;_0x3e0051=0xc8;}else{_0x3e0051=0xce;}_0x4d3e0c['status'](_0x3e0051);return _0x4d3e0c[_0x8613('0x1f')](_0x8613('0x20'),_0x169976+'-'+_0xd1af24+'/'+_0x55c1a7)[_0x8613('0x1a')](_0x2986ce);}return null;};}function patchUpdates(_0x50c30b){return function(_0x32b62f){try{jsonpatch[_0x8613('0x21')](_0x32b62f,_0x50c30b,!![]);}catch(_0x27ae61){return BPromise[_0x8613('0x22')](_0x27ae61);}return _0x32b62f[_0x8613('0x23')]();};}function saveUpdates(_0x56e26b,_0x1f23a5){return function(_0x1a7c5f){if(_0x1a7c5f){return _0x1a7c5f[_0x8613('0x24')](_0x56e26b)[_0x8613('0x25')](function(_0x184b49){return _0x184b49;});}return null;};}function removeEntity(_0x141ac8,_0x66aab4){return function(_0x4072af){if(_0x4072af){return _0x4072af[_0x8613('0x26')]()['then'](function(){var _0x2b04a5=_0x4072af[_0x8613('0x27')]({'plain':!![]});var _0x284dc6='Pauses';return db[_0x8613('0x28')]['destroy']({'where':{'type':_0x284dc6,'resourceId':_0x2b04a5['id']}})['then'](function(){return _0x4072af;});})[_0x8613('0x25')](function(){_0x141ac8[_0x8613('0x18')](0xcc)[_0x8613('0x19')]();});}};}function handleEntityNotFound(_0x191515,_0x3aa9a1){return function(_0x40ebbd){if(!_0x40ebbd){_0x191515[_0x8613('0x17')](0x194);}return _0x40ebbd;};}function handleError(_0x505d56,_0x116913){_0x116913=_0x116913||0x1f4;return function(_0x19f9d1){logger[_0x8613('0x29')](_0x19f9d1[_0x8613('0x2a')]);if(_0x19f9d1[_0x8613('0x2b')]){delete _0x19f9d1[_0x8613('0x2b')];}_0x505d56[_0x8613('0x18')](_0x116913)[_0x8613('0x2c')](_0x19f9d1);};}exports['index']=function(_0x4d7a1f,_0x4e2401){var _0x678fe6={},_0x62fb46={},_0x52a3f8={'count':0x0,'rows':[]};var _0x3977c9=_['map'](db[_0x8613('0x2d')][_0x8613('0x2e')],function(_0x1b15e0){return{'name':_0x1b15e0[_0x8613('0x2f')],'type':_0x1b15e0[_0x8613('0x30')][_0x8613('0x31')]};});_0x62fb46[_0x8613('0x32')]=_[_0x8613('0x33')](_0x3977c9,'name');_0x62fb46['query']=_[_0x8613('0x34')](_0x4d7a1f[_0x8613('0x35')]);_0x62fb46['filters']=_['intersection'](_0x62fb46['model'],_0x62fb46[_0x8613('0x35')]);_0x678fe6['attributes']=_[_0x8613('0x36')](_0x62fb46['model'],qs[_0x8613('0x37')](_0x4d7a1f[_0x8613('0x35')]['fields']));_0x678fe6[_0x8613('0x38')]=_0x678fe6[_0x8613('0x38')][_0x8613('0x39')]?_0x678fe6[_0x8613('0x38')]:_0x62fb46[_0x8613('0x32')];if(!_0x4d7a1f[_0x8613('0x35')][_0x8613('0x3a')](_0x8613('0x3b'))){_0x678fe6['limit']=qs['limit'](_0x4d7a1f['query'][_0x8613('0x1e')]);_0x678fe6['offset']=qs[_0x8613('0x1b')](_0x4d7a1f[_0x8613('0x35')][_0x8613('0x1b')]);}_0x678fe6['order']=qs[_0x8613('0x3c')](_0x4d7a1f[_0x8613('0x35')][_0x8613('0x3c')]);_0x678fe6[_0x8613('0x3d')]=qs['filters'](_['pick'](_0x4d7a1f[_0x8613('0x35')],_0x62fb46[_0x8613('0x3e')]),_0x3977c9);if(_0x4d7a1f[_0x8613('0x35')][_0x8613('0x3f')]){_0x678fe6[_0x8613('0x3d')]=_['merge'](_0x678fe6[_0x8613('0x3d')],{'$or':_[_0x8613('0x33')](_0x3977c9,function(_0x5c8062){if(_0x5c8062[_0x8613('0x30')]!=='VIRTUAL'){var _0x22218e={};_0x22218e[_0x5c8062[_0x8613('0x2b')]]={'$like':'%'+_0x4d7a1f[_0x8613('0x35')][_0x8613('0x3f')]+'%'};return _0x22218e;}})});}_0x678fe6=_[_0x8613('0x40')]({},_0x678fe6,_0x4d7a1f['options']);var _0xaf032b={'where':_0x678fe6[_0x8613('0x3d')]};return db['Pause'][_0x8613('0x1d')](_0xaf032b)[_0x8613('0x25')](function(_0x2b597a){_0x52a3f8[_0x8613('0x1d')]=_0x2b597a;if(_0x4d7a1f[_0x8613('0x35')][_0x8613('0x41')]){_0x678fe6[_0x8613('0x42')]=[{'all':!![]}];}return db[_0x8613('0x2d')][_0x8613('0x43')](_0x678fe6);})[_0x8613('0x25')](function(_0x4ec05e){_0x52a3f8[_0x8613('0x44')]=_0x4ec05e;return _0x52a3f8;})[_0x8613('0x25')](respondWithFilteredResult(_0x4e2401,_0x678fe6))['catch'](handleError(_0x4e2401,null));};exports['show']=function(_0x3b2250,_0x4b9b75){var _0x58cb73={'raw':!![],'where':{'id':_0x3b2250['params']['id']}},_0x49286b={};_0x49286b[_0x8613('0x32')]=_[_0x8613('0x34')](db[_0x8613('0x2d')][_0x8613('0x2e')]);_0x49286b[_0x8613('0x35')]=_['keys'](_0x3b2250[_0x8613('0x35')]);_0x49286b[_0x8613('0x3e')]=_['intersection'](_0x49286b[_0x8613('0x32')],_0x49286b[_0x8613('0x35')]);_0x58cb73[_0x8613('0x38')]=_['intersection'](_0x49286b[_0x8613('0x32')],qs[_0x8613('0x37')](_0x3b2250['query']['fields']));_0x58cb73[_0x8613('0x38')]=_0x58cb73[_0x8613('0x38')]['length']?_0x58cb73['attributes']:_0x49286b['model'];if(_0x3b2250[_0x8613('0x35')][_0x8613('0x41')]){_0x58cb73[_0x8613('0x42')]=[{'all':!![]}];}_0x58cb73=_[_0x8613('0x40')]({},_0x58cb73,_0x3b2250[_0x8613('0x45')]);return db['Pause'][_0x8613('0x46')](_0x58cb73)[_0x8613('0x25')](handleEntityNotFound(_0x4b9b75,null))[_0x8613('0x25')](respondWithResult(_0x4b9b75,null))[_0x8613('0x47')](handleError(_0x4b9b75,null));};exports[_0x8613('0x48')]=function(_0x88def5,_0x214419){return db[_0x8613('0x2d')][_0x8613('0x48')](_0x88def5['body'],{})[_0x8613('0x25')](function(_0x4a587c){var _0x5deb16=_0x88def5[_0x8613('0x49')]['get']({'plain':!![]});if(!_0x5deb16)throw new Error(_0x8613('0x4a'));if(_0x5deb16[_0x8613('0x4b')]===_0x8613('0x49')){var _0x40eef6=_0x4a587c['get']({'plain':!![]});var _0x3191a8='Pauses';return db[_0x8613('0x4c')][_0x8613('0x46')]({'where':{'name':_0x3191a8,'userProfileId':_0x5deb16['userProfileId']},'raw':!![]})[_0x8613('0x25')](function(_0x563ef1){if(_0x563ef1&&_0x563ef1['autoAssociation']===0x0){return db[_0x8613('0x28')][_0x8613('0x48')]({'name':_0x40eef6[_0x8613('0x2b')],'resourceId':_0x40eef6['id'],'type':_0x563ef1[_0x8613('0x2b')],'sectionId':_0x563ef1['id']},{})['then'](function(){return _0x4a587c;});}else{return _0x4a587c;}})['catch'](function(_0x3122a2){logger[_0x8613('0x29')](_0x8613('0x4d'),_0x3122a2);throw _0x3122a2;});}return _0x4a587c;})['then'](respondWithResult(_0x214419,0xc9))[_0x8613('0x47')](handleError(_0x214419,null));};exports[_0x8613('0x24')]=function(_0x97c9a9,_0x4b3888){if(_0x97c9a9[_0x8613('0x4e')]['id']){delete _0x97c9a9['body']['id'];}return db[_0x8613('0x2d')][_0x8613('0x46')]({'where':{'id':_0x97c9a9[_0x8613('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4b3888,null))[_0x8613('0x25')](saveUpdates(_0x97c9a9['body'],null))[_0x8613('0x25')](respondWithResult(_0x4b3888,null))[_0x8613('0x47')](handleError(_0x4b3888,null));};exports[_0x8613('0x26')]=function(_0x10a324,_0x48b7ab){return db[_0x8613('0x2d')]['find']({'where':{'id':_0x10a324[_0x8613('0x4f')]['id']}})[_0x8613('0x25')](handleEntityNotFound(_0x48b7ab,null))[_0x8613('0x25')](removeEntity(_0x48b7ab,null))['catch'](handleError(_0x48b7ab,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 9be2aae..0012477 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x16d384,_0x8155be){var _0x46926f=function(_0x530b7d){while(--_0x530b7d){_0x16d384['push'](_0x16d384['shift']());}};_0x46926f(++_0x8155be);}(_0xf494,0x1c6));var _0x4f49=function(_0x51916a,_0x3ee470){_0x51916a=_0x51916a-0x0;var _0x439863=_0xf494[_0x51916a];return _0x439863;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x347f9e,_0x1cc08f){var _0x5f1d60=function(_0x26987c){while(--_0x26987c){_0x347f9e['push'](_0x347f9e['shift']());}};_0x5f1d60(++_0x1cc08f);}(_0xe14b,0x93));var _0xbe14=function(_0x3be7d4,_0x2a412f){_0x3be7d4=_0x3be7d4-0x0;var _0x49acbc=_0xe14b[_0x3be7d4];return _0x49acbc;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index c09a0d0..a95a08d 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(_0xd0c6a4,_0x4b637a){var _0x596e98=function(_0x24a543){while(--_0x24a543){_0xd0c6a4['push'](_0xd0c6a4['shift']());}};_0x596e98(++_0x4b637a);}(_0x7a54,0x106));var _0x47a5=function(_0xfef305,_0x68533){_0xfef305=_0xfef305-0x0;var _0x35afa3=_0x7a54[_0xfef305];return _0x35afa3;};'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(_0x4ad095,_0x5f4d18){var _0x168ddf=function(_0x3600af){while(--_0x3600af){_0x4ad095['push'](_0x4ad095['shift']());}};_0x168ddf(++_0x5f4d18);}(_0x7a54,0x106));var _0x47a5=function(_0x32f9ab,_0x363c2b){_0x32f9ab=_0x32f9ab-0x0;var _0x2be6df=_0x7a54[_0x32f9ab];return _0x2be6df;};'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 60666eb..b284440 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 _0x579c=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','extname','file','upload','post','/webhook','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x446889,_0x1e417c){var _0x27bb85=function(_0x52428d){while(--_0x52428d){_0x446889['push'](_0x446889['shift']());}};_0x27bb85(++_0x1e417c);}(_0x579c,0xda));var _0xc579=function(_0xec1f31,_0x7dbc13){_0xec1f31=_0xec1f31-0x0;var _0x2226c9=_0x579c[_0xec1f31];return _0x2226c9;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/webhook',controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth[_0xc579('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xc579('0x10')]({'destination':function(_0x2048bc,_0x17e37f,_0x3684b7){_0x3684b7(null,path[_0xc579('0x11')](config[_0xc579('0x12')],_0xc579('0x13')));},'filename':function(_0x1905b7,_0x421812,_0x441028){_0x421812[_0xc579('0x14')]=_0x421812['originalname'][_0xc579('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x441028(null,util['format'](_0xc579('0x16'),path['basename'](_0x421812[_0xc579('0x14')],path['extname'](_0x421812[_0xc579('0x14')])),Date['now'](),path[_0xc579('0x17')](_0x421812[_0xc579('0x14')])));}})});router['post']('/',upload['single'](_0xc579('0x18')),controller[_0xc579('0x19')]);router[_0xc579('0x1a')](_0xc579('0x1b'),controller[_0xc579('0x1c')]);router[_0xc579('0x1d')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x1e')]);router[_0xc579('0x1f')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x55e0=['webhookPost','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','post','file','upload','/webhook'];(function(_0x2b6644,_0x5c9b7e){var _0x9a9674=function(_0x5c2139){while(--_0x5c2139){_0x2b6644['push'](_0x2b6644['shift']());}};_0x9a9674(++_0x5c9b7e);}(_0x55e0,0xdc));var _0x055e=function(_0x6c40ba,_0x5e39fa){_0x6c40ba=_0x6c40ba-0x0;var _0x7a54dd=_0x55e0[_0x6c40ba];return _0x7a54dd;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/webhook',controller[_0x055e('0xa')]);router[_0x055e('0x9')](_0x055e('0xb'),auth[_0x055e('0xc')](),controller[_0x055e('0xd')]);router['get'](_0x055e('0xe'),auth[_0x055e('0xc')](),controller[_0x055e('0xf')]);var upload=multer({'storage':multer[_0x055e('0x10')]({'destination':function(_0x238068,_0x5237d9,_0x56c78a){_0x56c78a(null,path[_0x055e('0x11')](config['root'],_0x055e('0x12')));},'filename':function(_0x466da3,_0x72d424,_0x101bc3){_0x72d424[_0x055e('0x13')]=_0x72d424[_0x055e('0x13')][_0x055e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x101bc3(null,util['format'](_0x055e('0x15'),path[_0x055e('0x16')](_0x72d424[_0x055e('0x13')],path[_0x055e('0x17')](_0x72d424[_0x055e('0x13')])),Date['now'](),path[_0x055e('0x17')](_0x72d424[_0x055e('0x13')])));}})});router[_0x055e('0x18')]('/',upload['single'](_0x055e('0x19')),controller[_0x055e('0x1a')]);router[_0x055e('0x18')](_0x055e('0x1b'),controller[_0x055e('0x1c')]);router['put'](_0x055e('0xb'),auth[_0x055e('0xc')](),controller[_0x055e('0x1d')]);router[_0x055e('0x1e')]('/:id',auth[_0x055e('0xc')](),controller[_0x055e('0x1e')]);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 9cc2d82..aaf8664 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 _0x7639=['exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x3dea8b,_0x231a01){var _0x3a511e=function(_0x5a946d){while(--_0x5a946d){_0x3dea8b['push'](_0x3dea8b['shift']());}};_0x3a511e(++_0x231a01);}(_0x7639,0x176));var _0x9763=function(_0x412546,_0x32e614){_0x412546=_0x412546-0x0;var _0x5897a1=_0x7639[_0x412546];return _0x5897a1;};'use strict';var Sequelize=require(_0x9763('0x0'));module[_0x9763('0x1')]={'name':{'type':Sequelize[_0x9763('0x2')]},'type':{'type':Sequelize[_0x9763('0x3')](_0x9763('0x4'),_0x9763('0x5'))},'description':{'type':Sequelize[_0x9763('0x6')]},'version':{'type':Sequelize[_0x9763('0x6')]},'path':{'type':Sequelize[_0x9763('0x2')],'comment':_0x9763('0x7')},'active':{'type':Sequelize[_0x9763('0x8')],'defaultValue':0x0,'comment':_0x9763('0x9')},'sidebar':{'type':Sequelize[_0x9763('0x3')](_0x9763('0xa'),_0x9763('0xb'),_0x9763('0xc'),_0x9763('0xd')),'defaultValue':_0x9763('0xc'),'comment':_0x9763('0xe')},'icon':{'type':Sequelize[_0x9763('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x9763('0x2')]},'scriptName':{'type':Sequelize[_0x9763('0x2')]},'scriptPath':{'type':Sequelize[_0x9763('0x2')]}}; \ No newline at end of file +var _0x24d6=['ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','html','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x24d6,0xc1));var _0x624d=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x24d6[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require('sequelize');module[_0x624d('0x0')]={'name':{'type':Sequelize[_0x624d('0x1')]},'type':{'type':Sequelize['ENUM'](_0x624d('0x2'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x624d('0x3')]},'path':{'type':Sequelize[_0x624d('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x624d('0x4')},'sidebar':{'type':Sequelize[_0x624d('0x5')](_0x624d('0x6'),_0x624d('0x7'),_0x624d('0x8'),_0x624d('0x9')),'defaultValue':'always','comment':_0x624d('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x624d('0x1')]},'agentUrl':{'type':Sequelize[_0x624d('0x1')]},'scriptName':{'type':Sequelize[_0x624d('0x1')]},'scriptPath':{'type':Sequelize[_0x624d('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index a8968bf..6b45ef0 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 _0xceef=['order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','keys','download','params','join','root','server/files/plugins','format','createWriteStream','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','catch','upload','basename','extname','filename','file','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','error','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','statusCode','webhookPost','method','content-length','content-type','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','then','destroy','get','Plugins','name','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xceef,0x118));var _0xfcee=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xceef[_0x59bcb1];return _0x4a737f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcee('0x0'));var zipdir=require(_0xfcee('0x1'));var jsonpatch=require(_0xfcee('0x2'));var rp=require(_0xfcee('0x3'));var moment=require(_0xfcee('0x4'));var BPromise=require(_0xfcee('0x5'));var Mustache=require(_0xfcee('0x6'));var util=require('util');var path=require(_0xfcee('0x7'));var sox=require(_0xfcee('0x8'));var csv=require(_0xfcee('0x9'));var ejs=require(_0xfcee('0xa'));var fs=require('fs');var fs_extra=require(_0xfcee('0xb'));var _=require(_0xfcee('0xc'));var squel=require(_0xfcee('0xd'));var crypto=require(_0xfcee('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfcee('0xf'));var toCsv=require(_0xfcee('0x9'));var querystring=require(_0xfcee('0x10'));var Papa=require(_0xfcee('0x11'));var extract=require(_0xfcee('0x12'));var rimraf=require('rimraf');var archiver=require(_0xfcee('0x13'));var Redis=require(_0xfcee('0x14'));var authService=require(_0xfcee('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xfcee('0x16'));var hardwareService=require(_0xfcee('0x17'));var logger=require('../../config/logger')(_0xfcee('0x18'));var utils=require(_0xfcee('0x19'));var config=require(_0xfcee('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcee('0x1b'))['db'];config[_0xfcee('0x1c')]=_[_0xfcee('0x1d')](config[_0xfcee('0x1c')],{'host':_0xfcee('0x1e'),'port':0x18eb});var socket=require(_0xfcee('0x1f'))(new Redis(config[_0xfcee('0x1c')]));require(_0xfcee('0x20'))[_0xfcee('0x21')](socket);function respondWithStatusCode(_0x2fff7c,_0x279ed8){_0x279ed8=_0x279ed8||0xcc;return function(_0x28762b){if(_0x28762b){return _0x2fff7c[_0xfcee('0x22')](_0x279ed8);}return _0x2fff7c[_0xfcee('0x23')](_0x279ed8)[_0xfcee('0x24')]();};}function respondWithResult(_0xaed138,_0x3c47af){_0x3c47af=_0x3c47af||0xc8;return function(_0xacfa9d){if(_0xacfa9d){return _0xaed138[_0xfcee('0x23')](_0x3c47af)[_0xfcee('0x25')](_0xacfa9d);}};}function respondWithFilteredResult(_0xf10ac3,_0x110970){return function(_0x4fd377){if(_0x4fd377){var _0x2a123b=typeof _0x110970['offset']==='undefined'&&typeof _0x110970[_0xfcee('0x26')]===_0xfcee('0x27');var _0x384b09=_0x4fd377[_0xfcee('0x28')];var _0x419554=_0x2a123b?0x0:_0x110970[_0xfcee('0x29')];var _0x5cd47d=_0x2a123b?_0x4fd377[_0xfcee('0x28')]:_0x110970[_0xfcee('0x29')]+_0x110970[_0xfcee('0x26')];var _0x14b228;if(_0x5cd47d>=_0x384b09){_0x5cd47d=_0x384b09;_0x14b228=0xc8;}else{_0x14b228=0xce;}_0xf10ac3[_0xfcee('0x23')](_0x14b228);return _0xf10ac3[_0xfcee('0x2a')]('Content-Range',_0x419554+'-'+_0x5cd47d+'/'+_0x384b09)[_0xfcee('0x25')](_0x4fd377);}return null;};}function patchUpdates(_0x520f3f){return function(_0x4eb836){try{jsonpatch[_0xfcee('0x2b')](_0x4eb836,_0x520f3f,!![]);}catch(_0x278c67){return BPromise[_0xfcee('0x2c')](_0x278c67);}return _0x4eb836['save']();};}function saveUpdates(_0x34255a,_0x3eece9){return function(_0x591d5d){if(_0x591d5d){return _0x591d5d['update'](_0x34255a)[_0xfcee('0x2d')](function(_0x1d7492){return _0x1d7492;});}return null;};}function removeEntity(_0x31131c,_0x46cf4b){return function(_0x332933){if(_0x332933){return _0x332933[_0xfcee('0x2e')]()[_0xfcee('0x2d')](function(){var _0x1b1af5=_0x332933[_0xfcee('0x2f')]({'plain':!![]});var _0x1a8559=_0xfcee('0x30');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a8559,'resourceId':_0x1b1af5['id']}})[_0xfcee('0x2d')](function(){return _0x332933;});})[_0xfcee('0x2d')](function(){_0x31131c[_0xfcee('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a71b0,_0x5463b3){return function(_0xac5b0d){if(!_0xac5b0d){_0x4a71b0[_0xfcee('0x22')](0x194);}return _0xac5b0d;};}function handleError(_0x30f254,_0xd04fc){_0xd04fc=_0xd04fc||0x1f4;return function(_0x3b2336){logger['error'](_0x3b2336['stack']);if(_0x3b2336[_0xfcee('0x31')]){delete _0x3b2336['name'];}_0x30f254[_0xfcee('0x23')](_0xd04fc)['send'](_0x3b2336);};}exports[_0xfcee('0x32')]=function(_0x4f3ad2,_0x50995b){var _0x50cdd0={},_0x1fe40d={},_0x11f359={'count':0x0,'rows':[]};var _0x52ea0f=_[_0xfcee('0x33')](db[_0xfcee('0x34')][_0xfcee('0x35')],function(_0x29a2b1){return{'name':_0x29a2b1[_0xfcee('0x36')],'type':_0x29a2b1[_0xfcee('0x37')][_0xfcee('0x38')]};});_0x1fe40d[_0xfcee('0x39')]=_[_0xfcee('0x33')](_0x52ea0f,_0xfcee('0x31'));_0x1fe40d[_0xfcee('0x3a')]=_['keys'](_0x4f3ad2['query']);_0x1fe40d['filters']=_[_0xfcee('0x3b')](_0x1fe40d[_0xfcee('0x39')],_0x1fe40d['query']);_0x50cdd0[_0xfcee('0x3c')]=_[_0xfcee('0x3b')](_0x1fe40d['model'],qs[_0xfcee('0x3d')](_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x3d')]));_0x50cdd0[_0xfcee('0x3c')]=_0x50cdd0[_0xfcee('0x3c')][_0xfcee('0x3e')]?_0x50cdd0[_0xfcee('0x3c')]:_0x1fe40d[_0xfcee('0x39')];if(!_0x4f3ad2['query']['hasOwnProperty'](_0xfcee('0x3f'))){_0x50cdd0['limit']=qs['limit'](_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x26')]);_0x50cdd0[_0xfcee('0x29')]=qs['offset'](_0x4f3ad2['query'][_0xfcee('0x29')]);}_0x50cdd0[_0xfcee('0x40')]=qs['sort'](_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x41')]);_0x50cdd0['where']=qs[_0xfcee('0x42')](_[_0xfcee('0x43')](_0x4f3ad2[_0xfcee('0x3a')],_0x1fe40d['filters']),_0x52ea0f);if(_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x44')]){_0x50cdd0[_0xfcee('0x45')]=_[_0xfcee('0x46')](_0x50cdd0['where'],{'$or':_[_0xfcee('0x33')](_0x52ea0f,function(_0x242270){if(_0x242270[_0xfcee('0x37')]!==_0xfcee('0x47')){var _0x3b24fb={};_0x3b24fb[_0x242270[_0xfcee('0x31')]]={'$like':'%'+_0x4f3ad2[_0xfcee('0x3a')][_0xfcee('0x44')]+'%'};return _0x3b24fb;}})});}_0x50cdd0=_[_0xfcee('0x46')]({},_0x50cdd0,_0x4f3ad2[_0xfcee('0x48')]);var _0x2f4273={'where':_0x50cdd0[_0xfcee('0x45')]};return db['Plugin'][_0xfcee('0x28')](_0x2f4273)[_0xfcee('0x2d')](function(_0x2843a9){_0x11f359[_0xfcee('0x28')]=_0x2843a9;if(_0x4f3ad2['query'][_0xfcee('0x49')]){_0x50cdd0['include']=[{'all':!![]}];}return db[_0xfcee('0x34')][_0xfcee('0x4a')](_0x50cdd0);})['then'](function(_0x53d8da){_0x11f359[_0xfcee('0x4b')]=_0x53d8da;return _0x11f359;})[_0xfcee('0x2d')](respondWithFilteredResult(_0x50995b,_0x50cdd0))['catch'](handleError(_0x50995b,null));};exports[_0xfcee('0x4c')]=function(_0x341a46,_0x51a192){var _0x7538b3={'raw':!![],'where':{'id':_0x341a46['params']['id']}},_0x565a45={};_0x565a45[_0xfcee('0x39')]=_[_0xfcee('0x4d')](db[_0xfcee('0x34')][_0xfcee('0x35')]);_0x565a45[_0xfcee('0x3a')]=_[_0xfcee('0x4d')](_0x341a46[_0xfcee('0x3a')]);_0x565a45[_0xfcee('0x42')]=_[_0xfcee('0x3b')](_0x565a45[_0xfcee('0x39')],_0x565a45[_0xfcee('0x3a')]);_0x7538b3[_0xfcee('0x3c')]=_[_0xfcee('0x3b')](_0x565a45[_0xfcee('0x39')],qs['fields'](_0x341a46[_0xfcee('0x3a')][_0xfcee('0x3d')]));_0x7538b3['attributes']=_0x7538b3[_0xfcee('0x3c')]['length']?_0x7538b3['attributes']:_0x565a45[_0xfcee('0x39')];if(_0x341a46[_0xfcee('0x3a')][_0xfcee('0x49')]){_0x7538b3['include']=[{'all':!![]}];}_0x7538b3=_[_0xfcee('0x46')]({},_0x7538b3,_0x341a46[_0xfcee('0x48')]);return db[_0xfcee('0x34')]['find'](_0x7538b3)[_0xfcee('0x2d')](handleEntityNotFound(_0x51a192,null))[_0xfcee('0x2d')](respondWithResult(_0x51a192,null))['catch'](handleError(_0x51a192,null));};exports[_0xfcee('0x4e')]=function(_0x54d672,_0x3f3b8a,_0x2e1505){return db['Plugin']['find']({'where':{'id':_0x54d672[_0xfcee('0x4f')]['id']},'attributes':[_0xfcee('0x31'),'path'],'raw':!![]})[_0xfcee('0x2d')](handleEntityNotFound(_0x3f3b8a,null))['then'](function(_0x25629c){if(_0x25629c){var _0x23a757=path[_0xfcee('0x50')](config[_0xfcee('0x51')],_0xfcee('0x52'),util[_0xfcee('0x53')]('%s.zip',path['basename'](_0x25629c[_0xfcee('0x7')])));var _0x2d60df=fs[_0xfcee('0x54')](_0x23a757);var _0x3502d2=archiver(_0xfcee('0x55'),{'zlib':{'level':0x9}});_0x3502d2['on']('warning',function(_0x4df77c){if(_0x4df77c[_0xfcee('0x56')]===_0xfcee('0x57')){logger['error'](_0x4df77c);}else{throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))](_0xfcee('0x5a'));}});_0x3502d2['on']('error',function(_0x2c088f){throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))](_0xfcee('0x5a'));});_0x3502d2[_0xfcee('0x5b')](_0x2d60df);_0x3502d2['glob']('**/*',{'cwd':path['join'](config[_0xfcee('0x51')],_0xfcee('0x52'),path[_0xfcee('0x5c')](_0x25629c['path'])),'ignore':[path[_0xfcee('0x50')](path['basename'](_0x25629c[_0xfcee('0x7')]),'node_modules/**/*'),path[_0xfcee('0x50')](path['basename'](_0x25629c[_0xfcee('0x7')]),_0xfcee('0x5d'))],'nodir':!![]})[_0xfcee('0x5e')]();_0x2d60df['on'](_0xfcee('0x5f'),function(){if(!fs[_0xfcee('0x60')](_0x23a757)){throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))](_0xfcee('0x61'));}return _0x3f3b8a[_0xfcee('0x4e')](_0x23a757,util[_0xfcee('0x53')](_0xfcee('0x62'),path['basename'](_0x25629c[_0xfcee('0x7')])),function(_0xe8056d){if(_0xe8056d){throw new db[(_0xfcee('0x58'))][(_0xfcee('0x59'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x23a757);logger[_0xfcee('0x63')](_0xfcee('0x64'));logger['info'](_0xfcee('0x65'));});});}return null;})[_0xfcee('0x66')](handleError(_0x3f3b8a,null));};exports[_0xfcee('0x67')]=function(_0x116cf9,_0x2cbd88,_0x55c7dd){var _0x580dc7=path[_0xfcee('0x68')](_0x116cf9['file']['filename'],path[_0xfcee('0x69')](_0x116cf9['file'][_0xfcee('0x6a')]));var _0x2deb38=path['join'](config[_0xfcee('0x51')],'server/files/plugins',_0x116cf9[_0xfcee('0x6b')][_0xfcee('0x6a')]);var _0x1f81a7=path[_0xfcee('0x50')](config[_0xfcee('0x51')],'server/files/plugins',_0x580dc7);logger[_0xfcee('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x2deb38);logger[_0xfcee('0x63')](_0xfcee('0x6c'),_0x1f81a7);try{fs[_0xfcee('0x6d')](_0x2deb38,parseInt(_0xfcee('0x6e'),0x8));extract(_0x2deb38,{'dir':_0x1f81a7},function(_0x42c7e9){if(_0x42c7e9){logger[_0xfcee('0x6f')](_0x42c7e9);handleError(_0x42c7e9,!![]);};var _0x3c3b07=fs[_0xfcee('0x70')](_0x1f81a7);if(_0x3c3b07[_0xfcee('0x3e')]>0x1){removeReferences(_0x2deb38,_0x1f81a7);logger['error'](_0xfcee('0x71'));return _0x55c7dd(new Error('Invalid\x20plugin\x20structure'));}var _0x54d56a=fs[_0xfcee('0x72')](path[_0xfcee('0x50')](_0x1f81a7,_0x3c3b07[0x0]));if(_0x54d56a[_0xfcee('0x73')]()){removeReferences(_0x2deb38,_0x1f81a7);logger['error'](_0xfcee('0x71'));return _0x55c7dd(new Error('Invalid\x20plugin\x20structure'));}if(_0x54d56a['isDirectory']()){var _0x179ddc=fs[_0xfcee('0x70')](path[_0xfcee('0x50')](_0x1f81a7,_0x3c3b07[0x0]));if(_0x179ddc[_0xfcee('0x3e')]===0x0){removeReferences(_0x2deb38,_0x1f81a7);logger[_0xfcee('0x6f')]('Invalid\x20plugin\x20structure');return _0x55c7dd(new Error('Invalid\x20plugin\x20structure'));}var _0xe2e2c4=_0x179ddc[_0xfcee('0x74')](function(_0x2eabda){return _0x2eabda===_0xfcee('0x75');});if(!_0xe2e2c4){return _0x55c7dd(new Error('Plugin\x20manifest\x20missing'));}var _0x55b73a=fs[_0xfcee('0x76')](path[_0xfcee('0x50')](_0x1f81a7,_0x3c3b07[0x0],_0xfcee('0x75')));var _0x7e8cba=JSON[_0xfcee('0x77')](_0x55b73a);if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x31')]){return _0x55c7dd(new Error(_0xfcee('0x78')));}if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x37')]){return _0x55c7dd(new Error(_0xfcee('0x79')));}if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7a')]){return _0x55c7dd(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xfcee('0x27')==typeof _0x7e8cba['parameters']){return _0x55c7dd(new Error(_0xfcee('0x7b')));}if(_0x7e8cba[_0xfcee('0x37')]===_0xfcee('0x7c')){if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')]){return _0x55c7dd(new Error(_0xfcee('0x7f')));}if(_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x80')]&&_0xfcee('0x27')==typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')]){return _0x55c7dd(new Error(_0xfcee('0x82')));}}else if(_0x7e8cba[_0xfcee('0x37')]===_0xfcee('0x83')){if(_0xfcee('0x27')==typeof _0x7e8cba['parameters'][_0xfcee('0x84')]){return _0x55c7dd(new Error(_0xfcee('0x85')));}if(_0xfcee('0x27')==typeof _0x7e8cba['parameters'][_0xfcee('0x86')]){return _0x55c7dd(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x55c7dd(new Error(_0xfcee('0x87')));}var _0x5adf86=_0x7e8cba[_0xfcee('0x31')];var _0x5be83d=_0x7e8cba['description'];var _0x38329f=_0x7e8cba[_0xfcee('0x37')];var _0x533d49=_0x7e8cba[_0xfcee('0x88')]?_0x7e8cba[_0xfcee('0x88')]:'always';var _0x1aa906=_0x7e8cba[_0xfcee('0x89')]?_0x7e8cba['icon']:_0xfcee('0x8a');var _0x58a089='';var _0x5a4d0b='';var _0x486c54='';var _0x39d3aa='';var _0x3c483a=_0x7e8cba[_0xfcee('0x7a')];if(_0x38329f===_0xfcee('0x7c')){if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')]['admin']){var _0x58daab=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x58daab)){_0x58a089=path['join'](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x58daab);}else{_0x58a089=_0x58daab;}}else{logger[_0xfcee('0x63')](_0xfcee('0x8d'));}if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')]){var _0x23eb65=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x23eb65)){_0x5a4d0b=path[_0xfcee('0x50')](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x23eb65);}else{_0x5a4d0b=_0x23eb65;}}else{logger[_0xfcee('0x63')](_0xfcee('0x8e'));}}else if(_0x38329f===_0xfcee('0x83')){_0x486c54=_0x7e8cba[_0xfcee('0x7d')]['scriptName'];_0x39d3aa=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x86')];if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')]['views']){if('undefined'!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')]['admin']){var _0x58daab=_0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x58daab)){_0x58a089=path[_0xfcee('0x50')](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x58daab);}else{_0x58a089=_0x58daab;}}if(_0xfcee('0x27')!=typeof _0x7e8cba[_0xfcee('0x7d')][_0xfcee('0x7e')][_0xfcee('0x81')]){var _0x23eb65=_0x7e8cba[_0xfcee('0x7d')]['views'][_0xfcee('0x81')];if(!/^(f|ht)tps?:\/\//i[_0xfcee('0x8b')](_0x23eb65)){_0x5a4d0b=path[_0xfcee('0x50')](_0xfcee('0x8c'),_0x580dc7,_0x3c3b07[0x0],_0x23eb65);}else{_0x5a4d0b=_0x23eb65;}}}}var _0x6a2f4={'name':_0x5adf86,'description':_0x5be83d,'path':path[_0xfcee('0x50')](_0x580dc7,_0x3c3b07[0x0]),'type':_0x38329f,'sidebar':_0x533d49,'icon':_0x1aa906,'adminUrl':_0x58a089,'agentUrl':_0x5a4d0b,'scriptName':_0x486c54,'scriptPath':_0x39d3aa,'version':_0x3c483a};removeReferences(_0x2deb38,null);return db['Plugin'][_0xfcee('0x8f')](_0x6a2f4)[_0xfcee('0x2d')](function(_0x3ecbfe){var _0xeed4bf={'role':_0x116cf9[_0xfcee('0x90')][_0xfcee('0x91')],'userProfileId':_0x116cf9[_0xfcee('0x90')][_0xfcee('0x92')]};if(!_0xeed4bf)throw new Error(_0xfcee('0x93'));if(_0xeed4bf['role']===_0xfcee('0x94')){var _0x36331f=_0x3ecbfe['get']({'plain':!![]});return db['UserProfileSection'][_0xfcee('0x95')]({'where':{'name':_0xfcee('0x30'),'userProfileId':_0xeed4bf[_0xfcee('0x92')]},'raw':!![]})[_0xfcee('0x2d')](function(_0x5ef397){if(_0x5ef397&&_0x5ef397[_0xfcee('0x96')]===0x0){return db[_0xfcee('0x97')]['create']({'name':_0x36331f[_0xfcee('0x31')],'resourceId':_0x36331f['id'],'type':_0x5ef397[_0xfcee('0x31')],'sectionId':_0x5ef397['id']},{})[_0xfcee('0x2d')](function(){return _0x3ecbfe;});}else{return _0x3ecbfe;}})['catch'](function(_0x1b44c9){logger[_0xfcee('0x6f')](_0xfcee('0x98'),_0x1b44c9);throw _0x1b44c9;});}return _0x3ecbfe;})['then'](respondWithResult(_0x2cbd88,null))[_0xfcee('0x66')](handleError(_0x2cbd88,null));}});}catch(_0x3bb3db){_0x2cbd88[_0xfcee('0x23')](0x1f4)[_0xfcee('0x99')](_0x3bb3db);}};function removeReferences(_0x2afe95,_0x41291c){try{if(_0x2afe95){fs[_0xfcee('0x9a')](_0x2afe95);logger[_0xfcee('0x63')](_0xfcee('0x9b'));}if(_0x41291c){rimraf(_0x41291c,function(){});logger[_0xfcee('0x63')](_0xfcee('0x9c'));}}catch(_0x2337c6){logger[_0xfcee('0x6f')](_0x2337c6);}}exports[_0xfcee('0x9d')]=function(_0x1dbf42,_0x499ff3,_0x34fa87){return db[_0xfcee('0x34')]['find']({'where':{'id':_0x1dbf42[_0xfcee('0x4f')]['id']}})[_0xfcee('0x2d')](handleEntityNotFound(_0x499ff3,null))[_0xfcee('0x2d')](saveUpdates(_0x1dbf42[_0xfcee('0x90')],null))[_0xfcee('0x2d')](respondWithResult(_0x499ff3,null))['catch'](handleError(_0x499ff3,null));};exports[_0xfcee('0x9e')]=function(_0x1ebc24,_0x179525,_0x55fc9a){return db['Plugin'][_0xfcee('0x95')]({'where':{'id':_0x1ebc24['params']['id']}})[_0xfcee('0x2d')](function(_0x2972ea){if(_0x2972ea){return _0x2972ea[_0xfcee('0x2e')]();}})['then'](function(_0x301308){rimraf(path[_0xfcee('0x50')](config[_0xfcee('0x51')],_0xfcee('0x52'),path['dirname'](_0x301308['path'])),function(){});return _0x301308;})[_0xfcee('0x2d')](handleEntityNotFound(_0x179525,null))[_0xfcee('0x2d')](respondWithStatusCode(_0x179525,null))[_0xfcee('0x66')](handleError(_0x179525,null));};exports[_0xfcee('0x9f')]=function(_0x362fd5,_0x53f1a8,_0x17cf1a){return BPromise['resolve']()[_0xfcee('0x2d')](function(){if(!_0x362fd5['query'][_0xfcee('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa0')]){throw new Error(_0xfcee('0xa1'));}var _0x21f31d=_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa2')]?_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa2')]+':'+_0x362fd5['query']['port']:_0xfcee('0xa3')+_0x362fd5['query']['port'];var _0x356121=_0x362fd5[_0xfcee('0x3a')][_0xfcee('0x25')]?_0x362fd5['query']['json']:!![];var _0x3b584a=_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa4')]?_0x362fd5[_0xfcee('0x3a')][_0xfcee('0xa4')]:null;var _0x560838={'method':_0x362fd5['method'],'uri':util['format'](_0xfcee('0xa5'),_0x21f31d,_0x362fd5[_0xfcee('0x3a')][_0xfcee('0x7')]),'json':_0x356121,'resolveWithFullResponse':!![],'encoding':_0x3b584a,'qs':_0x362fd5[_0xfcee('0x3a')]};if(_0x362fd5['headers']){_0x560838[_0xfcee('0xa6')]=_0x362fd5[_0xfcee('0xa6')];if(_0x560838[_0xfcee('0xa6')]['content-length']){delete _0x560838[_0xfcee('0xa6')]['content-length'];}}if(_0x560838[_0xfcee('0xa6')]['content-type']){delete _0x560838[_0xfcee('0xa6')]['content-type'];}return rp(_0x560838);})[_0xfcee('0x2d')](function(_0x3554dd){if(_0x3554dd){_0x53f1a8[_0xfcee('0x2a')](_0x3554dd[_0xfcee('0xa6')]);logger[_0xfcee('0x63')](_0x3554dd[_0xfcee('0x90')]);if(_['endsWith'](_0x362fd5[_0xfcee('0x3a')][_0xfcee('0x7')],_0xfcee('0x4e'))&&_0x3554dd[_0xfcee('0xa7')]==0x1f4){return _0x53f1a8[_0xfcee('0x22')](_0x3554dd[_0xfcee('0xa7')]);}else{return _0x53f1a8[_0xfcee('0x23')](_0x3554dd[_0xfcee('0xa7')])['send'](_0x3554dd[_0xfcee('0x90')]);}}else{return _0x53f1a8[_0xfcee('0x22')](0xc8);}})[_0xfcee('0x66')](handleError(_0x53f1a8,null));};exports[_0xfcee('0xa8')]=function(_0x58c388,_0x5c067c,_0x484174){return BPromise['resolve']()[_0xfcee('0x2d')](function(){if(!_0x58c388['query'][_0xfcee('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x58c388['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5d8318=_0x58c388[_0xfcee('0x3a')][_0xfcee('0xa2')]?_0x58c388['query'][_0xfcee('0xa2')]+':'+_0x58c388[_0xfcee('0x3a')]['port']:_0xfcee('0xa3')+_0x58c388['query'][_0xfcee('0xa0')];var _0x3da9ce=_0x58c388[_0xfcee('0x3a')][_0xfcee('0x25')]?_0x58c388[_0xfcee('0x3a')]['json']:!![];var _0x9d4c11=_0x58c388[_0xfcee('0x3a')][_0xfcee('0xa4')]?_0x58c388[_0xfcee('0x3a')][_0xfcee('0xa4')]:null;var _0x276cab={'method':_0x58c388[_0xfcee('0xa9')],'uri':util[_0xfcee('0x53')](_0xfcee('0xa5'),_0x5d8318,_0x58c388['query'][_0xfcee('0x7')]),'json':_0x3da9ce,'resolveWithFullResponse':!![],'encoding':_0x9d4c11,'body':_0x58c388['body']};if(_0x58c388['headers']){_0x276cab['headers']=_0x58c388[_0xfcee('0xa6')];if(_0x276cab[_0xfcee('0xa6')][_0xfcee('0xaa')]){delete _0x276cab[_0xfcee('0xa6')]['content-length'];}}if(_0x276cab[_0xfcee('0xa6')][_0xfcee('0xab')]){delete _0x276cab['headers'][_0xfcee('0xab')];}return rp(_0x276cab);})[_0xfcee('0x2d')](function(_0x26a643){if(_0x26a643){_0x5c067c[_0xfcee('0x2a')](_0x26a643[_0xfcee('0xa6')]);logger[_0xfcee('0x63')](_0x26a643[_0xfcee('0x90')]);return _0x5c067c[_0xfcee('0x23')](_0x26a643['statusCode'])['send'](_0x26a643['body']);}else{return _0x5c067c['sendStatus'](0xc8);}})[_0xfcee('0x66')](handleError(_0x5c067c,null));}; \ No newline at end of file +var _0xa6b0=['options','includeAll','findAll','catch','include','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','params','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','download','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','rimraf','fast-json-patch','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','filters','filter','where','merge','VIRTUAL'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xa6b0,0x10a));var _0x0a6b=function(_0x371e0c,_0x4c7107){_0x371e0c=_0x371e0c-0x0;var _0x21db9f=_0xa6b0[_0x371e0c];return _0x21db9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a6b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a6b('0x1'));var rp=require('request-promise');var moment=require(_0x0a6b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0a6b('0x3'));var util=require('util');var path=require(_0x0a6b('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0a6b('0x5'));var fs=require('fs');var fs_extra=require(_0x0a6b('0x6'));var _=require(_0x0a6b('0x7'));var squel=require(_0x0a6b('0x8'));var crypto=require(_0x0a6b('0x9'));var jsforce=require(_0x0a6b('0xa'));var deskjs=require(_0x0a6b('0xb'));var toCsv=require(_0x0a6b('0xc'));var querystring=require(_0x0a6b('0xd'));var Papa=require(_0x0a6b('0xe'));var extract=require(_0x0a6b('0xf'));var rimraf=require(_0x0a6b('0x0'));var archiver=require(_0x0a6b('0x10'));var Redis=require(_0x0a6b('0x11'));var authService=require(_0x0a6b('0x12'));var qs=require(_0x0a6b('0x13'));var as=require(_0x0a6b('0x14'));var hardwareService=require(_0x0a6b('0x15'));var logger=require(_0x0a6b('0x16'))(_0x0a6b('0x17'));var utils=require(_0x0a6b('0x18'));var config=require(_0x0a6b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a6b('0x1a'))['db'];config[_0x0a6b('0x1b')]=_[_0x0a6b('0x1c')](config[_0x0a6b('0x1b')],{'host':_0x0a6b('0x1d'),'port':0x18eb});var socket=require(_0x0a6b('0x1e'))(new Redis(config['redis']));require(_0x0a6b('0x1f'))[_0x0a6b('0x20')](socket);function respondWithStatusCode(_0x4166a5,_0x44a3c0){_0x44a3c0=_0x44a3c0||0xcc;return function(_0xfe0540){if(_0xfe0540){return _0x4166a5[_0x0a6b('0x21')](_0x44a3c0);}return _0x4166a5['status'](_0x44a3c0)[_0x0a6b('0x22')]();};}function respondWithResult(_0x31bb7b,_0x39a8ef){_0x39a8ef=_0x39a8ef||0xc8;return function(_0x57bc2b){if(_0x57bc2b){return _0x31bb7b[_0x0a6b('0x23')](_0x39a8ef)[_0x0a6b('0x24')](_0x57bc2b);}};}function respondWithFilteredResult(_0x230a5e,_0x177c55){return function(_0x67b951){if(_0x67b951){var _0x563797=typeof _0x177c55[_0x0a6b('0x25')]==='undefined'&&typeof _0x177c55[_0x0a6b('0x26')]===_0x0a6b('0x27');var _0x34a43a=_0x67b951['count'];var _0x4de3e1=_0x563797?0x0:_0x177c55[_0x0a6b('0x25')];var _0x274d09=_0x563797?_0x67b951[_0x0a6b('0x28')]:_0x177c55[_0x0a6b('0x25')]+_0x177c55[_0x0a6b('0x26')];var _0x1c0c74;if(_0x274d09>=_0x34a43a){_0x274d09=_0x34a43a;_0x1c0c74=0xc8;}else{_0x1c0c74=0xce;}_0x230a5e[_0x0a6b('0x23')](_0x1c0c74);return _0x230a5e[_0x0a6b('0x29')](_0x0a6b('0x2a'),_0x4de3e1+'-'+_0x274d09+'/'+_0x34a43a)[_0x0a6b('0x24')](_0x67b951);}return null;};}function patchUpdates(_0x4f9467){return function(_0x137f5b){try{jsonpatch['apply'](_0x137f5b,_0x4f9467,!![]);}catch(_0x253654){return BPromise[_0x0a6b('0x2b')](_0x253654);}return _0x137f5b[_0x0a6b('0x2c')]();};}function saveUpdates(_0x5ae767,_0x4de9cf){return function(_0x117e9b){if(_0x117e9b){return _0x117e9b['update'](_0x5ae767)[_0x0a6b('0x2d')](function(_0x3e911a){return _0x3e911a;});}return null;};}function removeEntity(_0x5c5e41,_0x2db552){return function(_0x2a73db){if(_0x2a73db){return _0x2a73db[_0x0a6b('0x2e')]()['then'](function(){var _0x255b28=_0x2a73db[_0x0a6b('0x2f')]({'plain':!![]});var _0x828de8=_0x0a6b('0x30');return db[_0x0a6b('0x31')]['destroy']({'where':{'type':_0x828de8,'resourceId':_0x255b28['id']}})[_0x0a6b('0x2d')](function(){return _0x2a73db;});})['then'](function(){_0x5c5e41[_0x0a6b('0x23')](0xcc)[_0x0a6b('0x22')]();});}};}function handleEntityNotFound(_0x333283,_0x9b04d6){return function(_0x2cef58){if(!_0x2cef58){_0x333283[_0x0a6b('0x21')](0x194);}return _0x2cef58;};}function handleError(_0x48ad3c,_0x550dbd){_0x550dbd=_0x550dbd||0x1f4;return function(_0x560453){logger[_0x0a6b('0x32')](_0x560453[_0x0a6b('0x33')]);if(_0x560453[_0x0a6b('0x34')]){delete _0x560453['name'];}_0x48ad3c['status'](_0x550dbd)[_0x0a6b('0x35')](_0x560453);};}exports['index']=function(_0x557038,_0x4463da){var _0x6ed2b2={},_0x154c0e={},_0x3e1317={'count':0x0,'rows':[]};var _0x468dad=_[_0x0a6b('0x36')](db[_0x0a6b('0x37')][_0x0a6b('0x38')],function(_0x293897){return{'name':_0x293897[_0x0a6b('0x39')],'type':_0x293897[_0x0a6b('0x3a')]['key']};});_0x154c0e[_0x0a6b('0x3b')]=_[_0x0a6b('0x36')](_0x468dad,_0x0a6b('0x34'));_0x154c0e[_0x0a6b('0x3c')]=_[_0x0a6b('0x3d')](_0x557038[_0x0a6b('0x3c')]);_0x154c0e['filters']=_['intersection'](_0x154c0e[_0x0a6b('0x3b')],_0x154c0e[_0x0a6b('0x3c')]);_0x6ed2b2[_0x0a6b('0x3e')]=_[_0x0a6b('0x3f')](_0x154c0e[_0x0a6b('0x3b')],qs[_0x0a6b('0x40')](_0x557038[_0x0a6b('0x3c')][_0x0a6b('0x40')]));_0x6ed2b2[_0x0a6b('0x3e')]=_0x6ed2b2[_0x0a6b('0x3e')][_0x0a6b('0x41')]?_0x6ed2b2[_0x0a6b('0x3e')]:_0x154c0e['model'];if(!_0x557038[_0x0a6b('0x3c')][_0x0a6b('0x42')]('nolimit')){_0x6ed2b2['limit']=qs[_0x0a6b('0x26')](_0x557038['query'][_0x0a6b('0x26')]);_0x6ed2b2[_0x0a6b('0x25')]=qs[_0x0a6b('0x25')](_0x557038[_0x0a6b('0x3c')][_0x0a6b('0x25')]);}_0x6ed2b2['order']=qs['sort'](_0x557038[_0x0a6b('0x3c')]['sort']);_0x6ed2b2['where']=qs[_0x0a6b('0x43')](_['pick'](_0x557038['query'],_0x154c0e['filters']),_0x468dad);if(_0x557038['query'][_0x0a6b('0x44')]){_0x6ed2b2[_0x0a6b('0x45')]=_[_0x0a6b('0x46')](_0x6ed2b2['where'],{'$or':_['map'](_0x468dad,function(_0x59d70f){if(_0x59d70f[_0x0a6b('0x3a')]!==_0x0a6b('0x47')){var _0x4f425a={};_0x4f425a[_0x59d70f['name']]={'$like':'%'+_0x557038[_0x0a6b('0x3c')][_0x0a6b('0x44')]+'%'};return _0x4f425a;}})});}_0x6ed2b2=_[_0x0a6b('0x46')]({},_0x6ed2b2,_0x557038[_0x0a6b('0x48')]);var _0x45382a={'where':_0x6ed2b2['where']};return db[_0x0a6b('0x37')][_0x0a6b('0x28')](_0x45382a)[_0x0a6b('0x2d')](function(_0x5756c4){_0x3e1317[_0x0a6b('0x28')]=_0x5756c4;if(_0x557038[_0x0a6b('0x3c')][_0x0a6b('0x49')]){_0x6ed2b2['include']=[{'all':!![]}];}return db['Plugin'][_0x0a6b('0x4a')](_0x6ed2b2);})['then'](function(_0x25a838){_0x3e1317['rows']=_0x25a838;return _0x3e1317;})['then'](respondWithFilteredResult(_0x4463da,_0x6ed2b2))[_0x0a6b('0x4b')](handleError(_0x4463da,null));};exports['show']=function(_0x33c648,_0x3b453d){var _0x4c55be={'raw':!![],'where':{'id':_0x33c648['params']['id']}},_0x5c94c6={};_0x5c94c6[_0x0a6b('0x3b')]=_[_0x0a6b('0x3d')](db[_0x0a6b('0x37')][_0x0a6b('0x38')]);_0x5c94c6['query']=_[_0x0a6b('0x3d')](_0x33c648['query']);_0x5c94c6[_0x0a6b('0x43')]=_[_0x0a6b('0x3f')](_0x5c94c6[_0x0a6b('0x3b')],_0x5c94c6[_0x0a6b('0x3c')]);_0x4c55be[_0x0a6b('0x3e')]=_['intersection'](_0x5c94c6['model'],qs[_0x0a6b('0x40')](_0x33c648['query'][_0x0a6b('0x40')]));_0x4c55be['attributes']=_0x4c55be[_0x0a6b('0x3e')][_0x0a6b('0x41')]?_0x4c55be[_0x0a6b('0x3e')]:_0x5c94c6[_0x0a6b('0x3b')];if(_0x33c648['query'][_0x0a6b('0x49')]){_0x4c55be[_0x0a6b('0x4c')]=[{'all':!![]}];}_0x4c55be=_[_0x0a6b('0x46')]({},_0x4c55be,_0x33c648[_0x0a6b('0x48')]);return db[_0x0a6b('0x37')][_0x0a6b('0x4d')](_0x4c55be)['then'](handleEntityNotFound(_0x3b453d,null))[_0x0a6b('0x2d')](respondWithResult(_0x3b453d,null))[_0x0a6b('0x4b')](handleError(_0x3b453d,null));};exports['download']=function(_0xfe32c5,_0x3bdba5,_0x200e44){return db[_0x0a6b('0x37')][_0x0a6b('0x4d')]({'where':{'id':_0xfe32c5['params']['id']},'attributes':[_0x0a6b('0x34'),'path'],'raw':!![]})[_0x0a6b('0x2d')](handleEntityNotFound(_0x3bdba5,null))['then'](function(_0x1ed037){if(_0x1ed037){var _0x18c861=path[_0x0a6b('0x4e')](config[_0x0a6b('0x4f')],_0x0a6b('0x50'),util[_0x0a6b('0x51')](_0x0a6b('0x52'),path[_0x0a6b('0x53')](_0x1ed037['path'])));var _0x55c52b=fs[_0x0a6b('0x54')](_0x18c861);var _0x58aea8=archiver(_0x0a6b('0x55'),{'zlib':{'level':0x9}});_0x58aea8['on'](_0x0a6b('0x56'),function(_0x39507c){if(_0x39507c['code']===_0x0a6b('0x57')){logger[_0x0a6b('0x32')](_0x39507c);}else{throw new db[(_0x0a6b('0x58'))][(_0x0a6b('0x59'))](_0x0a6b('0x5a'));}});_0x58aea8['on'](_0x0a6b('0x32'),function(_0x43824a){throw new db[(_0x0a6b('0x58'))][(_0x0a6b('0x59'))](_0x0a6b('0x5a'));});_0x58aea8[_0x0a6b('0x5b')](_0x55c52b);_0x58aea8['glob'](_0x0a6b('0x5c'),{'cwd':path['join'](config[_0x0a6b('0x4f')],_0x0a6b('0x50'),path[_0x0a6b('0x5d')](_0x1ed037['path'])),'ignore':[path['join'](path[_0x0a6b('0x53')](_0x1ed037[_0x0a6b('0x4')]),'node_modules/**/*'),path[_0x0a6b('0x4e')](path[_0x0a6b('0x53')](_0x1ed037['path']),_0x0a6b('0x5e'))],'nodir':!![]})[_0x0a6b('0x5f')]();_0x55c52b['on'](_0x0a6b('0x60'),function(){if(!fs[_0x0a6b('0x61')](_0x18c861)){throw new db[(_0x0a6b('0x58'))][(_0x0a6b('0x59'))](_0x0a6b('0x62'));}return _0x3bdba5['download'](_0x18c861,util[_0x0a6b('0x51')](_0x0a6b('0x52'),path['basename'](_0x1ed037[_0x0a6b('0x4')])),function(_0x395e61){if(_0x395e61){throw new db[(_0x0a6b('0x58'))][(_0x0a6b('0x59'))](_0x0a6b('0x63'));}fs['unlinkSync'](_0x18c861);logger['info'](_0x0a6b('0x64'));logger['info'](_0x0a6b('0x65'));});});}return null;})[_0x0a6b('0x4b')](handleError(_0x3bdba5,null));};exports[_0x0a6b('0x66')]=function(_0x575bb0,_0x426000,_0x121bc5){var _0x3331a7=path['basename'](_0x575bb0[_0x0a6b('0x67')][_0x0a6b('0x68')],path['extname'](_0x575bb0[_0x0a6b('0x67')][_0x0a6b('0x68')]));var _0x3564c1=path[_0x0a6b('0x4e')](config['root'],_0x0a6b('0x50'),_0x575bb0['file'][_0x0a6b('0x68')]);var _0x81063a=path['join'](config[_0x0a6b('0x4f')],'server/files/plugins',_0x3331a7);logger[_0x0a6b('0x69')](_0x0a6b('0x6a'),_0x3564c1);logger[_0x0a6b('0x69')](_0x0a6b('0x6b'),_0x81063a);try{fs[_0x0a6b('0x6c')](_0x3564c1,parseInt('0777',0x8));extract(_0x3564c1,{'dir':_0x81063a},function(_0x498f4b){if(_0x498f4b){logger[_0x0a6b('0x32')](_0x498f4b);handleError(_0x498f4b,!![]);};var _0x23846b=fs[_0x0a6b('0x6d')](_0x81063a);if(_0x23846b['length']>0x1){removeReferences(_0x3564c1,_0x81063a);logger[_0x0a6b('0x32')](_0x0a6b('0x6e'));return _0x121bc5(new Error('Invalid\x20plugin\x20structure'));}var _0x17c95f=fs[_0x0a6b('0x6f')](path['join'](_0x81063a,_0x23846b[0x0]));if(_0x17c95f[_0x0a6b('0x70')]()){removeReferences(_0x3564c1,_0x81063a);logger[_0x0a6b('0x32')]('Invalid\x20plugin\x20structure');return _0x121bc5(new Error(_0x0a6b('0x6e')));}if(_0x17c95f[_0x0a6b('0x71')]()){var _0x4815f6=fs[_0x0a6b('0x6d')](path[_0x0a6b('0x4e')](_0x81063a,_0x23846b[0x0]));if(_0x4815f6[_0x0a6b('0x41')]===0x0){removeReferences(_0x3564c1,_0x81063a);logger[_0x0a6b('0x32')](_0x0a6b('0x6e'));return _0x121bc5(new Error(_0x0a6b('0x6e')));}var _0x58e6b8=_0x4815f6['some'](function(_0x3d66d5){return _0x3d66d5==='manifest.json';});if(!_0x58e6b8){return _0x121bc5(new Error('Plugin\x20manifest\x20missing'));}var _0x1f8ddd=fs[_0x0a6b('0x72')](path[_0x0a6b('0x4e')](_0x81063a,_0x23846b[0x0],_0x0a6b('0x73')));var _0x2a43b5=JSON[_0x0a6b('0x74')](_0x1f8ddd);if(_0x0a6b('0x27')==typeof _0x2a43b5[_0x0a6b('0x34')]){return _0x121bc5(new Error(_0x0a6b('0x75')));}if(_0x0a6b('0x27')==typeof _0x2a43b5['type']){return _0x121bc5(new Error(_0x0a6b('0x76')));}if(_0x0a6b('0x27')==typeof _0x2a43b5[_0x0a6b('0x77')]){return _0x121bc5(new Error(_0x0a6b('0x78')));}if(_0x0a6b('0x27')==typeof _0x2a43b5['parameters']){return _0x121bc5(new Error(_0x0a6b('0x79')));}if(_0x2a43b5[_0x0a6b('0x3a')]===_0x0a6b('0x7a')){if(_0x0a6b('0x27')==typeof _0x2a43b5[_0x0a6b('0x7b')]['views']){return _0x121bc5(new Error(_0x0a6b('0x7c')));}if(_0x0a6b('0x27')==typeof _0x2a43b5[_0x0a6b('0x7b')][_0x0a6b('0x7d')][_0x0a6b('0x7e')]&&_0x0a6b('0x27')==typeof _0x2a43b5['parameters'][_0x0a6b('0x7d')][_0x0a6b('0x7f')]){return _0x121bc5(new Error(_0x0a6b('0x80')));}}else if(_0x2a43b5[_0x0a6b('0x3a')]===_0x0a6b('0x81')){if(_0x0a6b('0x27')==typeof _0x2a43b5[_0x0a6b('0x7b')]['scriptName']){return _0x121bc5(new Error(_0x0a6b('0x82')));}if(_0x0a6b('0x27')==typeof _0x2a43b5[_0x0a6b('0x7b')][_0x0a6b('0x83')]){return _0x121bc5(new Error(_0x0a6b('0x84')));}}else{return _0x121bc5(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0xc619ab=_0x2a43b5[_0x0a6b('0x34')];var _0x396e3d=_0x2a43b5[_0x0a6b('0x85')];var _0x2d6f0f=_0x2a43b5['type'];var _0x260428=_0x2a43b5[_0x0a6b('0x86')]?_0x2a43b5[_0x0a6b('0x86')]:'always';var _0x3e79ee=_0x2a43b5[_0x0a6b('0x87')]?_0x2a43b5[_0x0a6b('0x87')]:_0x0a6b('0x88');var _0x36df0f='';var _0x235336='';var _0x30a520='';var _0x2aa61a='';var _0x37c154=_0x2a43b5['version'];if(_0x2d6f0f==='html'){if(_0x0a6b('0x27')!=typeof _0x2a43b5[_0x0a6b('0x7b')]['views'][_0x0a6b('0x7e')]){var _0x28c582=_0x2a43b5[_0x0a6b('0x7b')][_0x0a6b('0x7d')][_0x0a6b('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x0a6b('0x89')](_0x28c582)){_0x36df0f=path[_0x0a6b('0x4e')]('plugins',_0x3331a7,_0x23846b[0x0],_0x28c582);}else{_0x36df0f=_0x28c582;}}else{logger[_0x0a6b('0x69')](_0x0a6b('0x8a'));}if('undefined'!=typeof _0x2a43b5[_0x0a6b('0x7b')][_0x0a6b('0x7d')][_0x0a6b('0x7f')]){var _0x4e24d2=_0x2a43b5['parameters'][_0x0a6b('0x7d')][_0x0a6b('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x0a6b('0x89')](_0x4e24d2)){_0x235336=path[_0x0a6b('0x4e')](_0x0a6b('0x8b'),_0x3331a7,_0x23846b[0x0],_0x4e24d2);}else{_0x235336=_0x4e24d2;}}else{logger[_0x0a6b('0x69')](_0x0a6b('0x8c'));}}else if(_0x2d6f0f==='script'){_0x30a520=_0x2a43b5[_0x0a6b('0x7b')]['scriptName'];_0x2aa61a=_0x2a43b5[_0x0a6b('0x7b')]['scriptPath'];if(_0x0a6b('0x27')!=typeof _0x2a43b5[_0x0a6b('0x7b')]['views']){if(_0x0a6b('0x27')!=typeof _0x2a43b5[_0x0a6b('0x7b')][_0x0a6b('0x7d')][_0x0a6b('0x7e')]){var _0x28c582=_0x2a43b5[_0x0a6b('0x7b')][_0x0a6b('0x7d')][_0x0a6b('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x28c582)){_0x36df0f=path['join'](_0x0a6b('0x8b'),_0x3331a7,_0x23846b[0x0],_0x28c582);}else{_0x36df0f=_0x28c582;}}if('undefined'!=typeof _0x2a43b5[_0x0a6b('0x7b')]['views']['agent']){var _0x4e24d2=_0x2a43b5[_0x0a6b('0x7b')]['views'][_0x0a6b('0x7f')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4e24d2)){_0x235336=path[_0x0a6b('0x4e')](_0x0a6b('0x8b'),_0x3331a7,_0x23846b[0x0],_0x4e24d2);}else{_0x235336=_0x4e24d2;}}}}var _0x2b79cb={'name':_0xc619ab,'description':_0x396e3d,'path':path['join'](_0x3331a7,_0x23846b[0x0]),'type':_0x2d6f0f,'sidebar':_0x260428,'icon':_0x3e79ee,'adminUrl':_0x36df0f,'agentUrl':_0x235336,'scriptName':_0x30a520,'scriptPath':_0x2aa61a,'version':_0x37c154};removeReferences(_0x3564c1,null);return db['Plugin'][_0x0a6b('0x8d')](_0x2b79cb)['then'](function(_0x113d97){var _0x114b2f={'role':_0x575bb0[_0x0a6b('0x8e')]['role'],'userProfileId':_0x575bb0[_0x0a6b('0x8e')][_0x0a6b('0x8f')]};if(!_0x114b2f)throw new Error(_0x0a6b('0x90'));if(_0x114b2f['role']===_0x0a6b('0x91')){var _0x21fe2d=_0x113d97[_0x0a6b('0x2f')]({'plain':!![]});return db[_0x0a6b('0x92')]['find']({'where':{'name':_0x0a6b('0x30'),'userProfileId':_0x114b2f['userProfileId']},'raw':!![]})['then'](function(_0x3aa155){if(_0x3aa155&&_0x3aa155[_0x0a6b('0x93')]===0x0){return db[_0x0a6b('0x31')][_0x0a6b('0x8d')]({'name':_0x21fe2d[_0x0a6b('0x34')],'resourceId':_0x21fe2d['id'],'type':_0x3aa155[_0x0a6b('0x34')],'sectionId':_0x3aa155['id']},{})['then'](function(){return _0x113d97;});}else{return _0x113d97;}})[_0x0a6b('0x4b')](function(_0x1c7896){logger[_0x0a6b('0x32')](_0x0a6b('0x94'),_0x1c7896);throw _0x1c7896;});}return _0x113d97;})['then'](respondWithResult(_0x426000,null))[_0x0a6b('0x4b')](handleError(_0x426000,null));}});}catch(_0x489282){_0x426000[_0x0a6b('0x23')](0x1f4)[_0x0a6b('0x35')](_0x489282);}};function removeReferences(_0xfdc13c,_0xb7022){try{if(_0xfdc13c){fs[_0x0a6b('0x95')](_0xfdc13c);logger[_0x0a6b('0x69')](_0x0a6b('0x96'));}if(_0xb7022){rimraf(_0xb7022,function(){});logger[_0x0a6b('0x69')]('Extracted\x20folder\x20removed');}}catch(_0x4629d6){logger[_0x0a6b('0x32')](_0x4629d6);}}exports['update']=function(_0x52e3d4,_0x35793a,_0x58c424){return db['Plugin'][_0x0a6b('0x4d')]({'where':{'id':_0x52e3d4[_0x0a6b('0x97')]['id']}})[_0x0a6b('0x2d')](handleEntityNotFound(_0x35793a,null))[_0x0a6b('0x2d')](saveUpdates(_0x52e3d4[_0x0a6b('0x8e')],null))[_0x0a6b('0x2d')](respondWithResult(_0x35793a,null))['catch'](handleError(_0x35793a,null));};exports[_0x0a6b('0x98')]=function(_0x44a491,_0x452d7c,_0x3740d1){return db[_0x0a6b('0x37')][_0x0a6b('0x4d')]({'where':{'id':_0x44a491[_0x0a6b('0x97')]['id']}})[_0x0a6b('0x2d')](function(_0x4d48ec){if(_0x4d48ec){return _0x4d48ec['destroy']();}})[_0x0a6b('0x2d')](function(_0x4bc67b){rimraf(path['join'](config[_0x0a6b('0x4f')],_0x0a6b('0x50'),path[_0x0a6b('0x5d')](_0x4bc67b['path'])),function(){});return _0x4bc67b;})[_0x0a6b('0x2d')](handleEntityNotFound(_0x452d7c,null))[_0x0a6b('0x2d')](respondWithStatusCode(_0x452d7c,null))['catch'](handleError(_0x452d7c,null));};exports[_0x0a6b('0x99')]=function(_0x3a15a8,_0x1438f8,_0x4a9554){return BPromise[_0x0a6b('0x9a')]()['then'](function(){if(!_0x3a15a8['query']['path']){throw new Error(_0x0a6b('0x9b'));}if(!_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x9c')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3a3898=_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x9d')]?_0x3a15a8['query'][_0x0a6b('0x9d')]+':'+_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x9c')]:_0x0a6b('0x9e')+_0x3a15a8['query']['port'];var _0x2bebe0=_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x24')]?_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x24')]:!![];var _0x47a7f=_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x9f')]?_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x9f')]:null;var _0x36ecfc={'method':_0x3a15a8[_0x0a6b('0xa0')],'uri':util['format'](_0x0a6b('0xa1'),_0x3a3898,_0x3a15a8[_0x0a6b('0x3c')][_0x0a6b('0x4')]),'json':_0x2bebe0,'resolveWithFullResponse':!![],'encoding':_0x47a7f,'qs':_0x3a15a8[_0x0a6b('0x3c')]};if(_0x3a15a8[_0x0a6b('0xa2')]){_0x36ecfc[_0x0a6b('0xa2')]=_0x3a15a8[_0x0a6b('0xa2')];if(_0x36ecfc[_0x0a6b('0xa2')][_0x0a6b('0xa3')]){delete _0x36ecfc[_0x0a6b('0xa2')][_0x0a6b('0xa3')];}}if(_0x36ecfc[_0x0a6b('0xa2')][_0x0a6b('0xa4')]){delete _0x36ecfc[_0x0a6b('0xa2')][_0x0a6b('0xa4')];}return rp(_0x36ecfc);})[_0x0a6b('0x2d')](function(_0xdd4874){if(_0xdd4874){_0x1438f8['set'](_0xdd4874[_0x0a6b('0xa2')]);logger[_0x0a6b('0x69')](_0xdd4874[_0x0a6b('0x8e')]);if(_[_0x0a6b('0xa5')](_0x3a15a8[_0x0a6b('0x3c')]['path'],_0x0a6b('0xa6'))&&_0xdd4874['statusCode']==0x1f4){return _0x1438f8[_0x0a6b('0x21')](_0xdd4874['statusCode']);}else{return _0x1438f8[_0x0a6b('0x23')](_0xdd4874[_0x0a6b('0xa7')])[_0x0a6b('0x35')](_0xdd4874[_0x0a6b('0x8e')]);}}else{return _0x1438f8['sendStatus'](0xc8);}})[_0x0a6b('0x4b')](handleError(_0x1438f8,null));};exports['webhookPost']=function(_0x77b245,_0x10ae9f,_0x4e1c6a){return BPromise[_0x0a6b('0x9a')]()['then'](function(){if(!_0x77b245[_0x0a6b('0x3c')][_0x0a6b('0x4')]){throw new Error(_0x0a6b('0x9b'));}if(!_0x77b245['query']['port']){throw new Error(_0x0a6b('0xa8'));}var _0x4b871b=_0x77b245[_0x0a6b('0x3c')][_0x0a6b('0x9d')]?_0x77b245[_0x0a6b('0x3c')][_0x0a6b('0x9d')]+':'+_0x77b245[_0x0a6b('0x3c')][_0x0a6b('0x9c')]:_0x0a6b('0x9e')+_0x77b245[_0x0a6b('0x3c')][_0x0a6b('0x9c')];var _0x2efd87=_0x77b245['query'][_0x0a6b('0x24')]?_0x77b245['query'][_0x0a6b('0x24')]:!![];var _0x2bb895=_0x77b245['query'][_0x0a6b('0x9f')]?_0x77b245[_0x0a6b('0x3c')][_0x0a6b('0x9f')]:null;var _0x3da4cb={'method':_0x77b245['method'],'uri':util[_0x0a6b('0x51')]('%s%s',_0x4b871b,_0x77b245[_0x0a6b('0x3c')][_0x0a6b('0x4')]),'json':_0x2efd87,'resolveWithFullResponse':!![],'encoding':_0x2bb895,'body':_0x77b245[_0x0a6b('0x8e')]};if(_0x77b245['headers']){_0x3da4cb['headers']=_0x77b245['headers'];if(_0x3da4cb[_0x0a6b('0xa2')][_0x0a6b('0xa3')]){delete _0x3da4cb[_0x0a6b('0xa2')]['content-length'];}}if(_0x3da4cb[_0x0a6b('0xa2')][_0x0a6b('0xa4')]){delete _0x3da4cb['headers']['content-type'];}return rp(_0x3da4cb);})[_0x0a6b('0x2d')](function(_0x1c0ce4){if(_0x1c0ce4){_0x10ae9f['set'](_0x1c0ce4[_0x0a6b('0xa2')]);logger[_0x0a6b('0x69')](_0x1c0ce4[_0x0a6b('0x8e')]);return _0x10ae9f['status'](_0x1c0ce4[_0x0a6b('0xa7')])[_0x0a6b('0x35')](_0x1c0ce4[_0x0a6b('0x8e')]);}else{return _0x10ae9f[_0x0a6b('0x21')](0xc8);}})['catch'](handleError(_0x10ae9f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 63b756c..9cd5e9c 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 _0x812d=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','Plugin'];(function(_0x4fc168,_0xf06de2){var _0x19f8e8=function(_0x5236ff){while(--_0x5236ff){_0x4fc168['push'](_0x4fc168['shift']());}};_0x19f8e8(++_0xf06de2);}(_0x812d,0x6e));var _0xd812=function(_0x5bba41,_0x593378){_0x5bba41=_0x5bba41-0x0;var _0x4e3deb=_0x812d[_0x5bba41];return _0x4e3deb;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xd812('0x0'))['db'][_0xd812('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xd812('0x2')](0x0);var events={'afterCreate':_0xd812('0x3'),'afterUpdate':_0xd812('0x4'),'afterDestroy':_0xd812('0x5')};function emitEvent(_0x15181f){return function(_0x2fba72,_0x47efde,_0x39c083){PluginEvents[_0xd812('0x6')](_0x15181f+':'+_0x2fba72['id'],_0x2fba72);PluginEvents[_0xd812('0x6')](_0x15181f,_0x2fba72);_0x39c083(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xd812('0x7')]=PluginEvents; \ No newline at end of file +var _0x647c=['Plugin','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x156ce4,_0x355350){var _0x37f36a=function(_0x2681d8){while(--_0x2681d8){_0x156ce4['push'](_0x156ce4['shift']());}};_0x37f36a(++_0x355350);}(_0x647c,0x1d3));var _0xc647=function(_0x56c5c0,_0x2901e6){_0x56c5c0=_0x56c5c0-0x0;var _0x3610b8=_0x647c[_0x56c5c0];return _0x3610b8;};'use strict';var EventEmitter=require(_0xc647('0x0'));var Plugin=require('../../mysqldb')['db'][_0xc647('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xc647('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc647('0x3'),'afterDestroy':_0xc647('0x4')};function emitEvent(_0x12bd28){return function(_0x339174,_0x2719dc,_0x535407){PluginEvents[_0xc647('0x5')](_0x12bd28+':'+_0x339174['id'],_0x339174);PluginEvents[_0xc647('0x5')](_0x12bd28,_0x339174);_0x535407(null);};}for(var e in events){if(events[_0xc647('0x6')](e)){var event=events[e];Plugin[_0xc647('0x7')](e,emitEvent(event));}}module[_0xc647('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index c2fa202..9e5e1e2 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 _0xf57a=['lodash','../../config/logger','request-promise','../../config/environment','exports','Plugin'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xf57a,0x108));var _0xaf57=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xf57a[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xaf57('0x0'));var util=require('util');var logger=require(_0xaf57('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaf57('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf57('0x3'));var attributes=require('./plugin.attributes');module[_0xaf57('0x4')]=function(_0x58077d,_0x49c8ae){return _0x58077d['define'](_0xaf57('0x5'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd199=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','Plugin','plugins'];(function(_0x4a8e14,_0x519668){var _0x28be98=function(_0x147116){while(--_0x147116){_0x4a8e14['push'](_0x4a8e14['shift']());}};_0x28be98(++_0x519668);}(_0xd199,0x75));var _0x9d19=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd199[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9d19('0x0'));var util=require('util');var logger=require(_0x9d19('0x1'))(_0x9d19('0x2'));var moment=require(_0x9d19('0x3'));var BPromise=require(_0x9d19('0x4'));var rp=require(_0x9d19('0x5'));var fs=require('fs');var path=require(_0x9d19('0x6'));var rimraf=require(_0x9d19('0x7'));var config=require(_0x9d19('0x8'));var attributes=require(_0x9d19('0x9'));module['exports']=function(_0x42856a,_0x2a453f){return _0x42856a[_0x9d19('0xa')](_0x9d19('0xb'),attributes,{'tableName':_0x9d19('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 7c2cdf2..fd44f6f 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 _0x1cd8=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x438075,_0x59ca9e){var _0x3c2ff0=function(_0x305e6e){while(--_0x305e6e){_0x438075['push'](_0x438075['shift']());}};_0x3c2ff0(++_0x59ca9e);}(_0x1cd8,0x198));var _0x81cd=function(_0x552505,_0x521218){_0x552505=_0x552505-0x0;var _0x49a65c=_0x1cd8[_0x552505];return _0x49a65c;};'use strict';var _=require(_0x81cd('0x0'));var util=require(_0x81cd('0x1'));var moment=require(_0x81cd('0x2'));var BPromise=require(_0x81cd('0x3'));var rs=require(_0x81cd('0x4'));var fs=require('fs');var Redis=require(_0x81cd('0x5'));var db=require(_0x81cd('0x6'))['db'];var utils=require(_0x81cd('0x7'));var logger=require(_0x81cd('0x8'))(_0x81cd('0x9'));var config=require('../../config/environment');var jayson=require(_0x81cd('0xa'));var client=jayson[_0x81cd('0xb')]['http']({'port':0x232a});config[_0x81cd('0xc')]=_[_0x81cd('0xd')](config[_0x81cd('0xc')],{'host':_0x81cd('0xe'),'port':0x18eb});var socket=require(_0x81cd('0xf'))(new Redis(config[_0x81cd('0xc')]));require('./plugin.socket')[_0x81cd('0x10')](socket);function respondWithRpcPromise(_0x1fa17c,_0x5eb47e,_0x25cf40){return new BPromise(function(_0x4991f5,_0x41da1e){return client[_0x81cd('0x11')](_0x1fa17c,_0x25cf40)[_0x81cd('0x12')](function(_0x4b669a){logger[_0x81cd('0x13')](_0x81cd('0x14'),_0x5eb47e,_0x81cd('0x15'));logger[_0x81cd('0x16')](_0x81cd('0x17'),_0x5eb47e,_0x81cd('0x15'),JSON[_0x81cd('0x18')](_0x4b669a));if(_0x4b669a[_0x81cd('0x19')]){if(_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1a')]===0x1f4){logger[_0x81cd('0x19')](_0x81cd('0x14'),_0x5eb47e,_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1b')]);return _0x41da1e(_0x4b669a[_0x81cd('0x19')]['message']);}logger[_0x81cd('0x19')](_0x81cd('0x14'),_0x5eb47e,_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1b')]);return _0x4991f5(_0x4b669a[_0x81cd('0x19')][_0x81cd('0x1b')]);}else{logger['info'](_0x81cd('0x14'),_0x5eb47e,_0x81cd('0x15'));_0x4991f5(_0x4b669a['result']['message']);}})[_0x81cd('0x1c')](function(_0x612a72){logger[_0x81cd('0x19')](_0x81cd('0x14'),_0x5eb47e,_0x612a72);_0x41da1e(_0x612a72);});});}exports[_0x81cd('0x1d')]=function(_0x9b74a0){var _0x19097b=this;return new Promise(function(_0x324e1a,_0x2efb81){return db[_0x81cd('0x1e')][_0x81cd('0x1f')](_0x9b74a0[_0x81cd('0x20')],{'raw':_0x9b74a0[_0x81cd('0x21')]?_0x9b74a0[_0x81cd('0x21')][_0x81cd('0x22')]===undefined?!![]:![]:!![]})[_0x81cd('0x12')](function(_0x57f81e){logger[_0x81cd('0x13')]('CreatePlugin',_0x9b74a0);logger[_0x81cd('0x16')]('CreatePlugin',_0x9b74a0,JSON[_0x81cd('0x18')](_0x57f81e));_0x324e1a(_0x57f81e);})[_0x81cd('0x1c')](function(_0x2a5593){logger[_0x81cd('0x19')]('CreatePlugin',_0x2a5593[_0x81cd('0x1b')],_0x9b74a0);_0x2efb81(_0x19097b['error'](0x1f4,_0x2a5593['message']));});});}; \ No newline at end of file +var _0x5eda=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug'];(function(_0x18488e,_0x6c138){var _0x451896=function(_0x3ac076){while(--_0x3ac076){_0x18488e['push'](_0x18488e['shift']());}};_0x451896(++_0x6c138);}(_0x5eda,0x1af));var _0xa5ed=function(_0x34192a,_0x306455){_0x34192a=_0x34192a-0x0;var _0x36257b=_0x5eda[_0x34192a];return _0x36257b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa5ed('0x0'));var BPromise=require(_0xa5ed('0x1'));var rs=require(_0xa5ed('0x2'));var fs=require('fs');var Redis=require(_0xa5ed('0x3'));var db=require(_0xa5ed('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5ed('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa5ed('0x6'));var client=jayson[_0xa5ed('0x7')][_0xa5ed('0x8')]({'port':0x232a});config['redis']=_[_0xa5ed('0x9')](config[_0xa5ed('0xa')],{'host':_0xa5ed('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa5ed('0xa')]));require('./plugin.socket')[_0xa5ed('0xc')](socket);function respondWithRpcPromise(_0x45aae0,_0x3d8179,_0x2014ae){return new BPromise(function(_0x5dc35c,_0x18f444){return client[_0xa5ed('0xd')](_0x45aae0,_0x2014ae)['then'](function(_0xe17e31){logger[_0xa5ed('0xe')]('Plugin,\x20%s,\x20%s',_0x3d8179,_0xa5ed('0xf'));logger[_0xa5ed('0x10')](_0xa5ed('0x11'),_0x3d8179,_0xa5ed('0xf'),JSON[_0xa5ed('0x12')](_0xe17e31));if(_0xe17e31[_0xa5ed('0x13')]){if(_0xe17e31['error'][_0xa5ed('0x14')]===0x1f4){logger['error'](_0xa5ed('0x15'),_0x3d8179,_0xe17e31[_0xa5ed('0x13')]['message']);return _0x18f444(_0xe17e31[_0xa5ed('0x13')][_0xa5ed('0x16')]);}logger[_0xa5ed('0x13')](_0xa5ed('0x15'),_0x3d8179,_0xe17e31[_0xa5ed('0x13')]['message']);return _0x5dc35c(_0xe17e31['error'][_0xa5ed('0x16')]);}else{logger[_0xa5ed('0xe')](_0xa5ed('0x15'),_0x3d8179,_0xa5ed('0xf'));_0x5dc35c(_0xe17e31[_0xa5ed('0x17')][_0xa5ed('0x16')]);}})[_0xa5ed('0x18')](function(_0x233e15){logger[_0xa5ed('0x13')](_0xa5ed('0x15'),_0x3d8179,_0x233e15);_0x18f444(_0x233e15);});});}exports[_0xa5ed('0x19')]=function(_0xaeb373){var _0x1ea203=this;return new Promise(function(_0xabd3cf,_0x713b89){return db[_0xa5ed('0x1a')][_0xa5ed('0x1b')](_0xaeb373[_0xa5ed('0x1c')],{'raw':_0xaeb373['options']?_0xaeb373[_0xa5ed('0x1d')][_0xa5ed('0x1e')]===undefined?!![]:![]:!![]})[_0xa5ed('0x1f')](function(_0x425be0){logger[_0xa5ed('0xe')]('CreatePlugin',_0xaeb373);logger[_0xa5ed('0x10')](_0xa5ed('0x19'),_0xaeb373,JSON['stringify'](_0x425be0));_0xabd3cf(_0x425be0);})[_0xa5ed('0x18')](function(_0x2516ae){logger[_0xa5ed('0x13')](_0xa5ed('0x19'),_0x2516ae[_0xa5ed('0x16')],_0xaeb373);_0x713b89(_0x1ea203['error'](0x1f4,_0x2516ae[_0xa5ed('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 69651d3..c235baf 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 _0x5706=['removeListener','length','plugin:','save','remove','update','emit'];(function(_0x2afd07,_0x3da1c6){var _0x28ecb5=function(_0x3a3f5b){while(--_0x3a3f5b){_0x2afd07['push'](_0x2afd07['shift']());}};_0x28ecb5(++_0x3da1c6);}(_0x5706,0x96));var _0x6570=function(_0x27dc36,_0x15e84c){_0x27dc36=_0x27dc36-0x0;var _0x3efb5c=_0x5706[_0x27dc36];return _0x3efb5c;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x6570('0x0'),_0x6570('0x1'),_0x6570('0x2')];function createListener(_0x1ff82c,_0x1859c7){return function(_0x2d856d){_0x1859c7[_0x6570('0x3')](_0x1ff82c,_0x2d856d);};}function removeListener(_0x5364e7,_0x12d8e6){return function(){PluginEvents[_0x6570('0x4')](_0x5364e7,_0x12d8e6);};}exports['register']=function(_0x529c5e){for(var _0x5793b6=0x0,_0x1d5ec8=events[_0x6570('0x5')];_0x5793b6<_0x1d5ec8;_0x5793b6++){var _0x5e8a68=events[_0x5793b6];var _0x3adf73=createListener(_0x6570('0x6')+_0x5e8a68,_0x529c5e);PluginEvents['on'](_0x5e8a68,_0x3adf73);}}; \ No newline at end of file +var _0x1bbb=['remove','update','removeListener','register','length','plugin:','./plugin.events'];(function(_0x248e67,_0x1da42f){var _0x39aaa7=function(_0x1849a9){while(--_0x1849a9){_0x248e67['push'](_0x248e67['shift']());}};_0x39aaa7(++_0x1da42f);}(_0x1bbb,0xbc));var _0xb1bb=function(_0x1c6af8,_0x4c96de){_0x1c6af8=_0x1c6af8-0x0;var _0x4b99b6=_0x1bbb[_0x1c6af8];return _0x4b99b6;};'use strict';var PluginEvents=require(_0xb1bb('0x0'));var events=['save',_0xb1bb('0x1'),_0xb1bb('0x2')];function createListener(_0x10f7f7,_0x3adc95){return function(_0x5823d5){_0x3adc95['emit'](_0x10f7f7,_0x5823d5);};}function removeListener(_0x5d60c5,_0x36d208){return function(){PluginEvents[_0xb1bb('0x3')](_0x5d60c5,_0x36d208);};}exports[_0xb1bb('0x4')]=function(_0x5706d9){for(var _0x322542=0x0,_0x2eab5e=events[_0xb1bb('0x5')];_0x322542<_0x2eab5e;_0x322542++){var _0x30ec83=events[_0x322542];var _0x2a3bd2=createListener(_0xb1bb('0x6')+_0x30ec83,_0x5706d9);PluginEvents['on'](_0x30ec83,_0x2a3bd2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index c3c7993..14141f0 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(_0x20be39,_0x3d1520){var _0x10c677=function(_0x2da761){while(--_0x2da761){_0x20be39['push'](_0x20be39['shift']());}};_0x10c677(++_0x3d1520);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x3b13a1,_0x2d7f26){var _0x26faff=function(_0x58516e){while(--_0x58516e){_0x3b13a1['push'](_0x3b13a1['shift']());}};_0x26faff(++_0x2d7f26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 a09875c..d5f8f70 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 _0x750a=['restart','stop','Unknown\x20status','delete','Unknown\x20id','../../config/pm2','path','child_process','exec','bluebird','sendStatus','status','json','stack','name','send','npm\x20install','info','error','index','list','then','reject','express','length','describe','params','body','../../files/plugins','chdir','start','dump','catch','Missing\x20name\x20and/or\x20path','update'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x750a,0x140));var _0xa750=function(_0x3b982d,_0x50a501){_0x3b982d=_0x3b982d-0x0;var _0x905ba9=_0x750a[_0x3b982d];return _0x905ba9;};'use strict';var _=require('lodash');var pm2=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var path=require(_0xa750('0x1'));var exec=require(_0xa750('0x2'))[_0xa750('0x3')];var BPromise=require(_0xa750('0x4'));function handleEntityNotFound(_0x457cae,_0x43d704){return function(_0x562911){if(!_0x562911){_0x457cae[_0xa750('0x5')](0x194);;}return _0x562911;};}function respondWithResult(_0x10b4d9,_0x2497df){_0x2497df=_0x2497df||0xc8;return function(_0x197299){if(_0x197299){return _0x10b4d9[_0xa750('0x6')](_0x2497df)[_0xa750('0x7')](_0x197299);}return null;};}function handleError(_0x47a4dd,_0x53f2cb){_0x53f2cb=_0x53f2cb||0x1f4;return function(_0x2678ff){logger['error'](_0x2678ff[_0xa750('0x8')]);if(_0x2678ff[_0xa750('0x9')]){delete _0x2678ff['name'];}_0x47a4dd[_0xa750('0x6')](_0x53f2cb)[_0xa750('0xa')](_0x2678ff);};}function execChildProcess(){return new BPromise(function(_0x5870f0,_0x5aca9c){exec(_0xa750('0xb'),function(_0x4b19a1,_0x174fd0,_0x5adaae){logger['info'](_0x174fd0);logger[_0xa750('0xc')](_0x5adaae);if(_0x4b19a1){logger[_0xa750('0xd')](_0x4b19a1);return _0x5aca9c(_0x4b19a1);}return _0x5870f0(_0x174fd0);});});}exports[_0xa750('0xe')]=function(_0x567c51,_0x2f670f){return pm2[_0xa750('0xf')]()[_0xa750('0x10')](function(_0x24e48a){if(_0x24e48a){var _0xa66181=_[_0xa750('0x11')](_0x24e48a,function(_0x5806ed){return _0x5806ed[_0xa750('0x9')]===_0xa750('0x12')||_0x5806ed[_0xa750('0x9')]==='motion2';});return{'rows':_0xa66181,'count':_0xa66181[_0xa750('0x13')]};}return null;})[_0xa750('0x10')](respondWithResult(_0x2f670f,null))['catch'](handleError(_0x2f670f,null));};exports['show']=function(_0x321eb2,_0x5b1e6b){return pm2[_0xa750('0x14')](_0x321eb2[_0xa750('0x15')]['id'])['then'](respondWithResult(_0x5b1e6b,null))[_0xa750('0x10')](handleEntityNotFound(_0x5b1e6b,null))['catch'](handleError(_0x5b1e6b,null));};exports['create']=function(_0x25e335,_0x5d0935){if(_0x25e335[_0xa750('0x16')]['name']&&_0x25e335[_0xa750('0x16')]['script']){var _0x3dc7f1=path['join'](__dirname,_0xa750('0x17'),_0x25e335['body']['script']);var _0xaa9d3e=process['cwd']();process[_0xa750('0x18')](path['dirname'](_0x3dc7f1));return execChildProcess()['then'](function(_0x5b433d){process['chdir'](_0xaa9d3e);return pm2[_0xa750('0x19')]({'name':_0x25e335[_0xa750('0x16')][_0xa750('0x9')],'script':_0x3dc7f1});})[_0xa750('0x10')](function(_0x1b80a5){pm2[_0xa750('0x1a')]();return _0x1b80a5[0x0];})[_0xa750('0x10')](respondWithResult(_0x5d0935,0xc9))[_0xa750('0x1b')](handleError(_0x5d0935,null));}else{return _0x5d0935[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x1c')});}};exports[_0xa750('0x1d')]=function(_0x31ea63,_0x3f7d6d){if(_0x31ea63[_0xa750('0x16')]['id']){delete _0x31ea63['body']['id'];}var _0x3d3923={'online':_0xa750('0x1e'),'stopped':_0xa750('0x1f')};if(_0x3d3923['hasOwnProperty'](_0x31ea63[_0xa750('0x16')][_0xa750('0x6')])){return pm2[_0x3d3923[_0x31ea63[_0xa750('0x16')][_0xa750('0x6')]]](_0x31ea63['params']['id'])[_0xa750('0x10')](respondWithResult(_0x3f7d6d,0xc8))[_0xa750('0x1b')](handleError(_0x3f7d6d,null));}else{return _0x3f7d6d[_0xa750('0x6')](0x1f4)[_0xa750('0xa')]({'message':_0xa750('0x20')});}};exports['destroy']=function(_0x46cc11,_0x4c2c9e){if(_0x46cc11[_0xa750('0x16')]['id']){delete _0x46cc11[_0xa750('0x16')]['id'];}if(_0x46cc11['params']['id']){return pm2[_0xa750('0x21')](_0x46cc11[_0xa750('0x15')]['id'])[_0xa750('0x10')](function(_0x314f88){pm2[_0xa750('0x1a')]();return _0x314f88[0x0];})[_0xa750('0x10')](respondWithResult(_0x4c2c9e,null))[_0xa750('0x1b')](handleError(_0x4c2c9e,null));}else{return _0x4c2c9e[_0xa750('0x6')](0x1f4)['send']({'message':_0xa750('0x22')});}}; \ No newline at end of file +var _0xcea2=['then','express','motion2','length','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','update','restart','stop','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','status','json','stack','name','send','npm\x20install','info','index','list'];(function(_0x3a50fd,_0x275987){var _0x167328=function(_0x35c723){while(--_0x35c723){_0x3a50fd['push'](_0x3a50fd['shift']());}};_0x167328(++_0x275987);}(_0xcea2,0x15a));var _0x2cea=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xcea2[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x2cea('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2cea('0x1'))('api');var path=require(_0x2cea('0x2'));var exec=require(_0x2cea('0x3'))[_0x2cea('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3ff73f,_0x46060b){return function(_0x11596e){if(!_0x11596e){_0x3ff73f['sendStatus'](0x194);;}return _0x11596e;};}function respondWithResult(_0x34f0f2,_0x485c26){_0x485c26=_0x485c26||0xc8;return function(_0x2d69ff){if(_0x2d69ff){return _0x34f0f2[_0x2cea('0x5')](_0x485c26)[_0x2cea('0x6')](_0x2d69ff);}return null;};}function handleError(_0x160cca,_0x11c5c0){_0x11c5c0=_0x11c5c0||0x1f4;return function(_0x1519f6){logger['error'](_0x1519f6[_0x2cea('0x7')]);if(_0x1519f6[_0x2cea('0x8')]){delete _0x1519f6[_0x2cea('0x8')];}_0x160cca[_0x2cea('0x5')](_0x11c5c0)[_0x2cea('0x9')](_0x1519f6);};}function execChildProcess(){return new BPromise(function(_0x439c4d,_0x4298a4){exec(_0x2cea('0xa'),function(_0x58a102,_0x5724b0,_0x2fe9cd){logger[_0x2cea('0xb')](_0x5724b0);logger['info'](_0x2fe9cd);if(_0x58a102){logger['error'](_0x58a102);return _0x4298a4(_0x58a102);}return _0x439c4d(_0x5724b0);});});}exports[_0x2cea('0xc')]=function(_0x4e0da7,_0xa4ce3d){return pm2[_0x2cea('0xd')]()[_0x2cea('0xe')](function(_0x5cf805){if(_0x5cf805){var _0x4d7f8b=_['reject'](_0x5cf805,function(_0x369c72){return _0x369c72['name']===_0x2cea('0xf')||_0x369c72[_0x2cea('0x8')]===_0x2cea('0x10');});return{'rows':_0x4d7f8b,'count':_0x4d7f8b[_0x2cea('0x11')]};}return null;})[_0x2cea('0xe')](respondWithResult(_0xa4ce3d,null))[_0x2cea('0x12')](handleError(_0xa4ce3d,null));};exports[_0x2cea('0x13')]=function(_0x1ead4c,_0x5eee09){return pm2[_0x2cea('0x14')](_0x1ead4c[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x5eee09,null))[_0x2cea('0xe')](handleEntityNotFound(_0x5eee09,null))[_0x2cea('0x12')](handleError(_0x5eee09,null));};exports[_0x2cea('0x16')]=function(_0x5d75c4,_0x27375b){if(_0x5d75c4['body'][_0x2cea('0x8')]&&_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]){var _0x4fd3d5=path[_0x2cea('0x19')](__dirname,_0x2cea('0x1a'),_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x18')]);var _0x3246bc=process[_0x2cea('0x1b')]();process[_0x2cea('0x1c')](path['dirname'](_0x4fd3d5));return execChildProcess()[_0x2cea('0xe')](function(_0x5e5b46){process[_0x2cea('0x1c')](_0x3246bc);return pm2['start']({'name':_0x5d75c4[_0x2cea('0x17')][_0x2cea('0x8')],'script':_0x4fd3d5});})['then'](function(_0x41d272){pm2[_0x2cea('0x1d')]();return _0x41d272[0x0];})[_0x2cea('0xe')](respondWithResult(_0x27375b,0xc9))[_0x2cea('0x12')](handleError(_0x27375b,null));}else{return _0x27375b[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2cea('0x1e')]=function(_0x32b6a3,_0x2bbe9b){if(_0x32b6a3[_0x2cea('0x17')]['id']){delete _0x32b6a3[_0x2cea('0x17')]['id'];}var _0x3ea40c={'online':_0x2cea('0x1f'),'stopped':_0x2cea('0x20')};if(_0x3ea40c['hasOwnProperty'](_0x32b6a3[_0x2cea('0x17')][_0x2cea('0x5')])){return pm2[_0x3ea40c[_0x32b6a3['body'][_0x2cea('0x5')]]](_0x32b6a3[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](respondWithResult(_0x2bbe9b,0xc8))[_0x2cea('0x12')](handleError(_0x2bbe9b,null));}else{return _0x2bbe9b['status'](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x21')});}};exports['destroy']=function(_0x2bf4e9,_0x2e3d44){if(_0x2bf4e9[_0x2cea('0x17')]['id']){delete _0x2bf4e9[_0x2cea('0x17')]['id'];}if(_0x2bf4e9[_0x2cea('0x15')]['id']){return pm2[_0x2cea('0x22')](_0x2bf4e9[_0x2cea('0x15')]['id'])[_0x2cea('0xe')](function(_0x2e1cd6){pm2[_0x2cea('0x1d')]();return _0x2e1cd6[0x0];})[_0x2cea('0xe')](respondWithResult(_0x2e3d44,null))['catch'](handleError(_0x2e3d44,null));}else{return _0x2e3d44[_0x2cea('0x5')](0x1f4)[_0x2cea('0x9')]({'message':_0x2cea('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index cba08cc..913a546 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 _0xaeee=['./realtime.controller','/agents','isAuthenticated','get','express'];(function(_0x41fde7,_0x292321){var _0x452ce6=function(_0xce7714){while(--_0xce7714){_0x41fde7['push'](_0x41fde7['shift']());}};_0x452ce6(++_0x292321);}(_0xaeee,0x1c1));var _0xeaee=function(_0x456d5a,_0x27866d){_0x456d5a=_0x456d5a-0x0;var _0x10bcf1=_0xaeee[_0x456d5a];return _0x10bcf1;};'use strict';var express=require(_0xeaee('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xeaee('0x1'));router['get'](_0xeaee('0x2'),auth[_0xeaee('0x3')](),controller['getAgents']);router[_0xeaee('0x4')]('/queues',auth[_0xeaee('0x3')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0xf638=['get','/agents','isAuthenticated','/queues','exports','express','../../components/auth/service','./realtime.controller'];(function(_0x4b91c4,_0x23f35f){var _0x25cb80=function(_0x48e283){while(--_0x48e283){_0x4b91c4['push'](_0x4b91c4['shift']());}};_0x25cb80(++_0x23f35f);}(_0xf638,0x135));var _0x8f63=function(_0x1388c4,_0x2ba6d9){_0x1388c4=_0x1388c4-0x0;var _0xbe0331=_0xf638[_0x1388c4];return _0xbe0331;};'use strict';var express=require(_0x8f63('0x0'));var router=express['Router']();var auth=require(_0x8f63('0x1'));var controller=require(_0x8f63('0x2'));router[_0x8f63('0x3')](_0x8f63('0x4'),auth[_0x8f63('0x5')](),controller['getAgents']);router[_0x8f63('0x3')](_0x8f63('0x6'),auth['isAuthenticated'](),controller['getQueues']);module[_0x8f63('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index bf24157..3d9b2c4 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 _0xeda4=['limit','count','offset','status','set','Content-Range','json','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','resolve','then','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','toLowerCase','sort','includes','globalStatus','validateSortParameter','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','*pause','Pause','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','filterAgentAttributes','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','Queue','key','name','outbound','dialActive','dialMethod','startCase','Queues','filter','findAndCountAll','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','handleError','undefined'];(function(_0x1240a5,_0x43c02d){var _0x19955b=function(_0x4686dc){while(--_0x4686dc){_0x1240a5['push'](_0x1240a5['shift']());}};_0x19955b(++_0x43c02d);}(_0xeda4,0xa5));var _0x4eda=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0xeda4[_0x291d3f];return _0x242080;};'use strict';var _=require(_0x4eda('0x0'));var util=require(_0x4eda('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x4eda('0x2'));var qs=require(_0x4eda('0x3'));var utils=require(_0x4eda('0x4'));var db=require(_0x4eda('0x5'))['db'];var APIBadRequestError=require(_0x4eda('0x6'))['APIBadRequestError'];var APIHandleError=require(_0x4eda('0x6'))[_0x4eda('0x7')];function respondWithFilteredResult(_0xb112fc,_0x1248a3){return function(_0x180872){if(_0x180872){var _0xe024f4=typeof _0x1248a3['offset']===_0x4eda('0x8')&&typeof _0x1248a3[_0x4eda('0x9')]===_0x4eda('0x8');var _0x57d161=_0x180872[_0x4eda('0xa')];var _0x1c465f=_0xe024f4?0x0:_0x1248a3[_0x4eda('0xb')];var _0x51ed1f=_0xe024f4?_0x180872['count']:_0x1248a3[_0x4eda('0xb')]+_0x1248a3[_0x4eda('0x9')];var _0x393d47;if(_0x51ed1f>=_0x57d161){_0x51ed1f=_0x57d161;_0x393d47=0xc8;}else{_0x393d47=0xce;}_0xb112fc[_0x4eda('0xc')](_0x393d47);return _0xb112fc[_0x4eda('0xd')](_0x4eda('0xe'),_0x1c465f+'-'+_0x51ed1f+'/'+_0x57d161)[_0x4eda('0xf')](_0x180872);}return null;};}exports[_0x4eda('0x10')]=function(_0x43eb68,_0x2cfadf){var _0xbc13={'count':0x0,'rows':[]};var _0x321004={};var _0x29952f;var _0x5294f6=utils[_0x4eda('0x11')]();var _0x35fdb6;var _0x5d6a75;var _0x4c7281=_0x43eb68[_0x4eda('0x12')][_0x4eda('0x13')];var _0x28dc84=_0x43eb68[_0x4eda('0x12')][_0x4eda('0x14')];var _0x490e7a=_0x43eb68[_0x4eda('0x12')][_0x4eda('0x15')];var _0x447b43=_0x28dc84===_0x4eda('0x16')||_0x28dc84==='*pause'?!![]:![];var _0x41b367=[];var _0x1479a5;var _0x12ffb6;Promise[_0x4eda('0x17')]()[_0x4eda('0x18')](function(){if(_0x43eb68['query']['channel']){if(!utils[_0x4eda('0x19')](_0x43eb68[_0x4eda('0x12')]['channel'])){throw new APIBadRequestError(util[_0x4eda('0x1a')](_0x4eda('0x1b'),_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1c')]));}_0x29952f=_0x43eb68['query'][_0x4eda('0x1c')][_0x4eda('0x1d')]();}if(!_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]||!_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')][_0x4eda('0x1f')](_0x4eda('0x20'))){_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]=rta[_0x4eda('0x21')](_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]);return;}var _0x7c646=rta['getUpdatedSortOptions'](_0x43eb68['query'][_0x4eda('0x1e')]);_0x43eb68[_0x4eda('0x12')][_0x4eda('0x1e')]=_0x7c646[_0x4eda('0x22')]['join'](',');_0x1479a5=_0x7c646[_0x4eda('0x23')];})[_0x4eda('0x18')](function(){if(!_0x4c7281){return[];}return rta[_0x4eda('0x24')](_0x4c7281,_0x29952f);})[_0x4eda('0x18')](function(_0x54e31e){_0x41b367=_0x54e31e;return rta[_0x4eda('0x25')]();})[_0x4eda('0x18')](function(_0x35bdf6){_0x5d6a75=_0x35bdf6[_0x4eda('0x26')];if((!_0x28dc84||_0x447b43)&&!_0x1479a5){return _0x41b367;}if(_0x1479a5&&!_0x28dc84){return rta[_0x4eda('0x27')](_0x5d6a75,_0x41b367,_0x1479a5);}else{return rta['getAgentIdsByStatus'](_0x5d6a75,_0x41b367,_0x28dc84);}})['then'](function(_0x1f0ce3){_0x41b367=_0x1f0ce3;var _0x5694eb=![];if(_0x41b367[_0x4eda('0x28')]===0x0){if(_0x4c7281||_0x28dc84){_0x5694eb=!![];}if(_0x447b43){_0x5694eb=![];}}if(_0x5694eb){return _0xbc13;}var _0x575c73=_[_0x4eda('0x29')](db[_0x4eda('0x2a')][_0x4eda('0x2b')],function(_0x3b480c){return{'name':_0x3b480c[_0x4eda('0x2c')],'type':_0x3b480c[_0x4eda('0x2d')]['key']};});_0x43eb68[_0x4eda('0x12')][_0x4eda('0x2e')]=_0x4eda('0x2f');_0x321004=qs[_0x4eda('0x30')](_0x575c73,_0x43eb68);_0x321004[_0x4eda('0x31')]=!![];var _0x1e69c3=[];if(_0x41b367[_0x4eda('0x28')]>0x0){_0x1e69c3[_0x4eda('0x32')]({'id':{'$in':_0x41b367}});if(_0x1479a5&&!_0x28dc84){_0x12ffb6=[db[_0x4eda('0x33')][_0x4eda('0x34')](_0x4eda('0x35')+_0x41b367+')')];_0x321004[_0x4eda('0x23')]=_0x12ffb6;}}if(_0x447b43){_0x5294f6[_0x4eda('0x36')](function(_0x543aa9){var _0xd273b3=!![];if(_0x28dc84===_0x4eda('0x37')&&_0x29952f!==_0x543aa9){_0xd273b3=![];}_0x1e69c3[_0x4eda('0x32')]({[_0x543aa9+_0x4eda('0x38')]:_0xd273b3});});if(_0x490e7a){_0x1e69c3[_0x4eda('0x32')]({'pauseType':_0x490e7a});}}else if(_0x28dc84){_0x5294f6['forEach'](function(_0x15ab22){_0x1e69c3[_0x4eda('0x32')]({[_0x15ab22+_0x4eda('0x38')]:![]});});}_0x321004[_0x4eda('0x39')]=_[_0x4eda('0x3a')](_0x321004[_0x4eda('0x39')],{'$and':_0x1e69c3});if(_0x43eb68[_0x4eda('0x3b')][_0x4eda('0x2e')]===_0x4eda('0x3b')){var _0x19782c={'params':{'id':_0x43eb68['user'][_0x4eda('0x3c')]},'query':{'section':_0x4eda('0x3d'),'role':_0x4eda('0x2f'),'raw':!![],'ids':_0x41b367,'customSorting':_0x12ffb6}};if(_0x43eb68[_0x4eda('0x12')][_0x4eda('0x3e')]){_0x19782c[_0x4eda('0x12')]['online']=!![];}if(_0x447b43){_0x19782c[_0x4eda('0x12')][_0x4eda('0x3f')]=_0x1e69c3;}_0x19782c['query']=Object[_0x4eda('0x40')](_0x19782c[_0x4eda('0x12')],_0x43eb68[_0x4eda('0x12')]);return db[_0x4eda('0x41')][_0x4eda('0x42')](_0x19782c);}return db['User']['findAndCountAll'](_0x321004);})['then'](function(_0x49901c){_0xbc13[_0x4eda('0xa')]=_0x49901c[_0x4eda('0xa')];_0x35fdb6=_0x49901c[_0x4eda('0x26')];return _0x35fdb6['map'](function(_0x22b89f){var _0x3bf8be=_['find'](_0x5d6a75,['id',_0x22b89f['id']]);if(_0x3bf8be){var _0x406d2e=rta[_0x4eda('0x43')](_0x3bf8be);_[_0x4eda('0x3a')](_0x22b89f,_0x406d2e);}_0x22b89f[_0x4eda('0x20')]=rta[_0x4eda('0x44')](_0x22b89f);if(_0x22b89f['globalStatus']['includes']('pause')){_0x5294f6[_0x4eda('0x36')](function(_0x506674){if(_0x22b89f[_0x506674+_0x4eda('0x38')]){if(_0x506674===_0x4eda('0x45')){if(_0x22b89f[_0x4eda('0x46')]!==_0x4eda('0x47')){_0x22b89f[_0x4eda('0x46')]=_0x4eda('0x16');}}else{_0x22b89f[_0x506674+_0x4eda('0x48')]='pause';}}});}return _0x22b89f;});})[_0x4eda('0x18')](function(_0x501b2a){if(!_0x1479a5||_0x12ffb6){return _0x501b2a;}return rta[_0x4eda('0x49')](_0x501b2a,_0x1479a5);})[_0x4eda('0x18')](function(_0x3a86c9){var _0x3ef17d=rta[_0x4eda('0x4a')]();_0xbc13['rows']=_0x3a86c9[_0x4eda('0x29')](function(_0xbd637c){return _[_0x4eda('0x4b')](_0xbd637c,_0x3ef17d);});return _0xbc13;})[_0x4eda('0x18')](respondWithFilteredResult(_0x2cfadf,_0x321004))[_0x4eda('0x4c')](APIHandleError(_0x2cfadf));};exports['getQueues']=function(_0x20f517,_0xbe5129){var _0x9167bb={'count':0x0,'rows':[]};var _0x84465d={};var _0xdd67d2;var _0x363b52;var _0x1ce425;Promise[_0x4eda('0x17')]()[_0x4eda('0x18')](function(){if(_0x20f517[_0x4eda('0x12')][_0x4eda('0x1c')]){if(!utils[_0x4eda('0x19')](_0x20f517['query']['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x20f517['query'][_0x4eda('0x1c')]));}_0xdd67d2=_0x20f517[_0x4eda('0x12')][_0x4eda('0x1c')]['toLowerCase']();}var _0x102634=_['startCase'](_0xdd67d2)+_0x4eda('0x4d');var _0x1f2735=_[_0x4eda('0x29')](db[_0x102634][_0x4eda('0x2b')],function(_0x4d8f38){return{'name':_0x4d8f38['fieldName'],'type':_0x4d8f38['type'][_0x4eda('0x4e')]};});if(!_0x20f517['query'][_0x4eda('0x22')]){var _0x2586ae=['id',_0x4eda('0x4f')];if(_0xdd67d2===_0x4eda('0x45')){_0x2586ae[_0x4eda('0x32')](_0x4eda('0x2d'));if(_0x20f517['query'][_0x4eda('0x2d')]===_0x4eda('0x50')){_0x2586ae['push']([_0x4eda('0x51'),_0x4eda('0x52')]);}}_0x20f517[_0x4eda('0x12')][_0x4eda('0x22')]=_0x2586ae['join'](',');}_0x84465d=qs[_0x4eda('0x30')](_0x1f2735,_0x20f517);if(_0x20f517[_0x4eda('0x3b')][_0x4eda('0x2e')]==='user'){var _0x48d1e9={'params':{'id':_0x20f517[_0x4eda('0x3b')][_0x4eda('0x3c')]},'query':{'section':_0xdd67d2===_0x4eda('0x45')&&_0x20f517['query'][_0x4eda('0x2d')]===_0x4eda('0x50')?'QueueCampaigns':_[_0x4eda('0x53')](_0xdd67d2)+_0x4eda('0x54'),'type':_0x20f517[_0x4eda('0x12')]['type'],'nolimit':!![],'sort':_0x4eda('0x4f'),'filter':_0x20f517[_0x4eda('0x12')][_0x4eda('0x55')]}};_0x48d1e9[_0x4eda('0x12')]=Object['assign'](_0x48d1e9[_0x4eda('0x12')],_0x20f517['query']);delete _0x48d1e9['query']['id'];return db[_0x4eda('0x41')][_0x4eda('0x42')](_0x48d1e9);}return db[_0x102634][_0x4eda('0x56')](_0x84465d);})[_0x4eda('0x18')](function(_0xa99b84){_0x9167bb[_0x4eda('0xa')]=_0xa99b84[_0x4eda('0xa')];_0x363b52=_0xa99b84[_0x4eda('0x26')];return rtq['getRealtimeQueues'](_0x20f517,_0xdd67d2);})['then'](function(_0x1aabdc){_0x1ce425=_0x1aabdc['rows'];return rtq['initializeQueues'](_0x363b52,_0x1ce425,_0xdd67d2,_0x20f517[_0x4eda('0x12')]['type']);})['then'](function(_0x242b43){_0x9167bb[_0x4eda('0x26')]=_0x242b43;return _0x9167bb;})[_0x4eda('0x18')](respondWithFilteredResult(_0xbe5129,_0x84465d))['catch'](APIHandleError(_0xbe5129));}; \ No newline at end of file +var _0x4922=['sequelize','literal','forEach','*pause','merge','where','user','userProfileId','Agents','online','extraQueryConditions','assign','UserProfile','getResources','findAndCountAll','find','filterAgentAttributes','globalStatus','getAgentStatus','talking','Status','getRealtimeAgentsQueryFields','pick','catch','getQueues','startCase','Queue','name','voice','outbound','dialActive','dialMethod','QueueCampaigns','Queues','filter','getRealtimeQueues','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../errors/api','handleError','offset','limit','undefined','count','status','set','getChannels','query','globalQueueFilter','pauseTypeFilter','pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','length','map','User','rawAttributes','fieldName','type','role','agent','getOptions','raw','push'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x4922,0x111));var _0x2492=function(_0x347541,_0x137cf){_0x347541=_0x347541-0x0;var _0x5c0e38=_0x4922[_0x347541];return _0x5c0e38;};'use strict';var _=require('lodash');var util=require(_0x2492('0x0'));var rta=require(_0x2492('0x1'));var rtq=require(_0x2492('0x2'));var qs=require(_0x2492('0x3'));var utils=require('../../config/utils');var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x2492('0x4'))['APIBadRequestError'];var APIHandleError=require(_0x2492('0x4'))[_0x2492('0x5')];function respondWithFilteredResult(_0x121239,_0x2529d0){return function(_0x54c62a){if(_0x54c62a){var _0x1dcb0a=typeof _0x2529d0[_0x2492('0x6')]==='undefined'&&typeof _0x2529d0[_0x2492('0x7')]===_0x2492('0x8');var _0x4adc61=_0x54c62a[_0x2492('0x9')];var _0x25dd63=_0x1dcb0a?0x0:_0x2529d0[_0x2492('0x6')];var _0x56f686=_0x1dcb0a?_0x54c62a['count']:_0x2529d0[_0x2492('0x6')]+_0x2529d0[_0x2492('0x7')];var _0x57e170;if(_0x56f686>=_0x4adc61){_0x56f686=_0x4adc61;_0x57e170=0xc8;}else{_0x57e170=0xce;}_0x121239[_0x2492('0xa')](_0x57e170);return _0x121239[_0x2492('0xb')]('Content-Range',_0x25dd63+'-'+_0x56f686+'/'+_0x4adc61)['json'](_0x54c62a);}return null;};}exports['getAgents']=function(_0x3d1d96,_0x1005f0){var _0x4d3bd6={'count':0x0,'rows':[]};var _0x34c48c={};var _0x165bbe;var _0x14b4d8=utils[_0x2492('0xc')]();var _0x482241;var _0x59e668;var _0x5414e0=_0x3d1d96[_0x2492('0xd')][_0x2492('0xe')];var _0x48eda5=_0x3d1d96[_0x2492('0xd')]['globalStatusFilter'];var _0x459d43=_0x3d1d96[_0x2492('0xd')][_0x2492('0xf')];var _0x47e914=_0x48eda5===_0x2492('0x10')||_0x48eda5==='*pause'?!![]:![];var _0x21db92=[];var _0x54e826;var _0x605d0e;Promise[_0x2492('0x11')]()[_0x2492('0x12')](function(){if(_0x3d1d96[_0x2492('0xd')][_0x2492('0x13')]){if(!utils[_0x2492('0x14')](_0x3d1d96[_0x2492('0xd')][_0x2492('0x13')])){throw new APIBadRequestError(util[_0x2492('0x15')](_0x2492('0x16'),_0x3d1d96[_0x2492('0xd')][_0x2492('0x13')]));}_0x165bbe=_0x3d1d96[_0x2492('0xd')][_0x2492('0x13')][_0x2492('0x17')]();}if(!_0x3d1d96[_0x2492('0xd')][_0x2492('0x18')]||!_0x3d1d96['query']['sort']['includes']('globalStatus')){_0x3d1d96[_0x2492('0xd')][_0x2492('0x18')]=rta['validateSortParameter'](_0x3d1d96['query'][_0x2492('0x18')]);return;}var _0x3e71fb=rta[_0x2492('0x19')](_0x3d1d96[_0x2492('0xd')][_0x2492('0x18')]);_0x3d1d96[_0x2492('0xd')][_0x2492('0x18')]=_0x3e71fb[_0x2492('0x1a')][_0x2492('0x1b')](',');_0x54e826=_0x3e71fb[_0x2492('0x1c')];})['then'](function(){if(!_0x5414e0){return[];}return rta[_0x2492('0x1d')](_0x5414e0,_0x165bbe);})[_0x2492('0x12')](function(_0x2c13af){_0x21db92=_0x2c13af;return rta['getRealtimeAgents']();})['then'](function(_0x172725){_0x59e668=_0x172725[_0x2492('0x1e')];if((!_0x48eda5||_0x47e914)&&!_0x54e826){return _0x21db92;}if(_0x54e826&&!_0x48eda5){return rta[_0x2492('0x1f')](_0x59e668,_0x21db92,_0x54e826);}else{return rta['getAgentIdsByStatus'](_0x59e668,_0x21db92,_0x48eda5);}})['then'](function(_0x594b8d){_0x21db92=_0x594b8d;var _0x3279cb=![];if(_0x21db92[_0x2492('0x20')]===0x0){if(_0x5414e0||_0x48eda5){_0x3279cb=!![];}if(_0x47e914){_0x3279cb=![];}}if(_0x3279cb){return _0x4d3bd6;}var _0x4e2619=_[_0x2492('0x21')](db[_0x2492('0x22')][_0x2492('0x23')],function(_0x479530){return{'name':_0x479530[_0x2492('0x24')],'type':_0x479530[_0x2492('0x25')]['key']};});_0x3d1d96[_0x2492('0xd')][_0x2492('0x26')]=_0x2492('0x27');_0x34c48c=qs[_0x2492('0x28')](_0x4e2619,_0x3d1d96);_0x34c48c[_0x2492('0x29')]=!![];var _0x5748fb=[];if(_0x21db92[_0x2492('0x20')]>0x0){_0x5748fb[_0x2492('0x2a')]({'id':{'$in':_0x21db92}});if(_0x54e826&&!_0x48eda5){_0x605d0e=[db[_0x2492('0x2b')][_0x2492('0x2c')]('FIELD(id,'+_0x21db92+')')];_0x34c48c[_0x2492('0x1c')]=_0x605d0e;}}if(_0x47e914){_0x14b4d8[_0x2492('0x2d')](function(_0x241e07){var _0x2f73dc=!![];if(_0x48eda5===_0x2492('0x2e')&&_0x165bbe!==_0x241e07){_0x2f73dc=![];}_0x5748fb[_0x2492('0x2a')]({[_0x241e07+'Pause']:_0x2f73dc});});if(_0x459d43){_0x5748fb[_0x2492('0x2a')]({'pauseType':_0x459d43});}}else if(_0x48eda5){_0x14b4d8['forEach'](function(_0x104eec){_0x5748fb[_0x2492('0x2a')]({[_0x104eec+'Pause']:![]});});}_0x34c48c['where']=_[_0x2492('0x2f')](_0x34c48c[_0x2492('0x30')],{'$and':_0x5748fb});if(_0x3d1d96['user'][_0x2492('0x26')]===_0x2492('0x31')){var _0x527cf2={'params':{'id':_0x3d1d96[_0x2492('0x31')][_0x2492('0x32')]},'query':{'section':_0x2492('0x33'),'role':'agent','raw':!![],'ids':_0x21db92,'customSorting':_0x605d0e}};if(_0x3d1d96['query'][_0x2492('0x34')]){_0x527cf2[_0x2492('0xd')][_0x2492('0x34')]=!![];}if(_0x47e914){_0x527cf2[_0x2492('0xd')][_0x2492('0x35')]=_0x5748fb;}_0x527cf2[_0x2492('0xd')]=Object[_0x2492('0x36')](_0x527cf2[_0x2492('0xd')],_0x3d1d96[_0x2492('0xd')]);return db[_0x2492('0x37')][_0x2492('0x38')](_0x527cf2);}return db[_0x2492('0x22')][_0x2492('0x39')](_0x34c48c);})[_0x2492('0x12')](function(_0x1d637e){_0x4d3bd6[_0x2492('0x9')]=_0x1d637e[_0x2492('0x9')];_0x482241=_0x1d637e[_0x2492('0x1e')];return _0x482241[_0x2492('0x21')](function(_0x3131cf){var _0x5014cb=_[_0x2492('0x3a')](_0x59e668,['id',_0x3131cf['id']]);if(_0x5014cb){var _0x1dc2d2=rta[_0x2492('0x3b')](_0x5014cb);_[_0x2492('0x2f')](_0x3131cf,_0x1dc2d2);}_0x3131cf[_0x2492('0x3c')]=rta[_0x2492('0x3d')](_0x3131cf);if(_0x3131cf['globalStatus']['includes'](_0x2492('0x10'))){_0x14b4d8['forEach'](function(_0x2fd459){if(_0x3131cf[_0x2fd459+'Pause']){if(_0x2fd459==='voice'){if(_0x3131cf['voiceStatus']!==_0x2492('0x3e')){_0x3131cf['voiceStatus']=_0x2492('0x10');}}else{_0x3131cf[_0x2fd459+_0x2492('0x3f')]=_0x2492('0x10');}}});}return _0x3131cf;});})[_0x2492('0x12')](function(_0x1509a3){if(!_0x54e826||_0x605d0e){return _0x1509a3;}return rta['sortAgentsByStatus'](_0x1509a3,_0x54e826);})[_0x2492('0x12')](function(_0x7f56a6){var _0x291be9=rta[_0x2492('0x40')]();_0x4d3bd6['rows']=_0x7f56a6[_0x2492('0x21')](function(_0x5498a1){return _[_0x2492('0x41')](_0x5498a1,_0x291be9);});return _0x4d3bd6;})[_0x2492('0x12')](respondWithFilteredResult(_0x1005f0,_0x34c48c))[_0x2492('0x42')](APIHandleError(_0x1005f0));};exports[_0x2492('0x43')]=function(_0x3553d4,_0x317518){var _0x4cdc1d={'count':0x0,'rows':[]};var _0x304b4c={};var _0x157291;var _0x154c16;var _0x3842d5;Promise[_0x2492('0x11')]()[_0x2492('0x12')](function(){if(_0x3553d4[_0x2492('0xd')][_0x2492('0x13')]){if(!utils[_0x2492('0x14')](_0x3553d4['query']['channel'])){throw new APIBadRequestError(util[_0x2492('0x15')](_0x2492('0x16'),_0x3553d4['query'][_0x2492('0x13')]));}_0x157291=_0x3553d4['query']['channel'][_0x2492('0x17')]();}var _0x3e3097=_[_0x2492('0x44')](_0x157291)+_0x2492('0x45');var _0x3e90ae=_[_0x2492('0x21')](db[_0x3e3097][_0x2492('0x23')],function(_0x46d563){return{'name':_0x46d563[_0x2492('0x24')],'type':_0x46d563['type']['key']};});if(!_0x3553d4['query']['fields']){var _0x28e98a=['id',_0x2492('0x46')];if(_0x157291===_0x2492('0x47')){_0x28e98a[_0x2492('0x2a')](_0x2492('0x25'));if(_0x3553d4[_0x2492('0xd')]['type']===_0x2492('0x48')){_0x28e98a[_0x2492('0x2a')]([_0x2492('0x49'),_0x2492('0x4a')]);}}_0x3553d4[_0x2492('0xd')][_0x2492('0x1a')]=_0x28e98a[_0x2492('0x1b')](',');}_0x304b4c=qs[_0x2492('0x28')](_0x3e90ae,_0x3553d4);if(_0x3553d4[_0x2492('0x31')]['role']==='user'){var _0x1266ff={'params':{'id':_0x3553d4[_0x2492('0x31')][_0x2492('0x32')]},'query':{'section':_0x157291===_0x2492('0x47')&&_0x3553d4[_0x2492('0xd')]['type']===_0x2492('0x48')?_0x2492('0x4b'):_[_0x2492('0x44')](_0x157291)+_0x2492('0x4c'),'type':_0x3553d4[_0x2492('0xd')][_0x2492('0x25')],'nolimit':!![],'sort':_0x2492('0x46'),'filter':_0x3553d4[_0x2492('0xd')][_0x2492('0x4d')]}};_0x1266ff[_0x2492('0xd')]=Object['assign'](_0x1266ff['query'],_0x3553d4['query']);delete _0x1266ff['query']['id'];return db[_0x2492('0x37')][_0x2492('0x38')](_0x1266ff);}return db[_0x3e3097][_0x2492('0x39')](_0x304b4c);})[_0x2492('0x12')](function(_0x21bfd3){_0x4cdc1d[_0x2492('0x9')]=_0x21bfd3[_0x2492('0x9')];_0x154c16=_0x21bfd3['rows'];return rtq[_0x2492('0x4e')](_0x3553d4,_0x157291);})[_0x2492('0x12')](function(_0x1841f3){_0x3842d5=_0x1841f3[_0x2492('0x1e')];return rtq['initializeQueues'](_0x154c16,_0x3842d5,_0x157291,_0x3553d4['query'][_0x2492('0x25')]);})[_0x2492('0x12')](function(_0x3de1c2){_0x4cdc1d[_0x2492('0x1e')]=_0x3de1c2;return _0x4cdc1d;})[_0x2492('0x12')](respondWithFilteredResult(_0x317518,_0x304b4c))[_0x2492('0x42')](APIHandleError(_0x317518));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 2f2eb08..1667cf8 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x508d43,_0x11ac44){var _0x38336d=function(_0x537248){while(--_0x537248){_0x508d43['push'](_0x508d43['shift']());}};_0x38336d(++_0x11ac44);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b9ebe,_0x44aa6b){_0x2b9ebe=_0x2b9ebe-0x0;var _0x558677=_0xedd9[_0x2b9ebe];return _0x558677;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x20a938,_0x2a7f99){var _0x43f26b=function(_0x44a378){while(--_0x44a378){_0x20a938['push'](_0x20a938['shift']());}};_0x43f26b(++_0x2a7f99);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xcb91[_0x28aea5];return _0x6a55f9;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 9e53726..cd73a92 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 _0xee8f=['DATE','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xee8f,0x1ed));var _0xfee8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xee8f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xfee8('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xfee8('0x1')]},'scheduledat':{'type':Sequelize[_0xfee8('0x2')]},'uniqueid':{'type':Sequelize[_0xfee8('0x1')]},'starttime':{'type':Sequelize[_0xfee8('0x2')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xfee8('0x1')]},'membername':{'type':Sequelize[_0xfee8('0x1')]}}; \ No newline at end of file +var _0xab3f=['STRING','DATE','sequelize','INTEGER'];(function(_0xa651d4,_0x5df6cb){var _0x1301be=function(_0x5aa409){while(--_0x5aa409){_0xa651d4['push'](_0xa651d4['shift']());}};_0x1301be(++_0x5df6cb);}(_0xab3f,0x72));var _0xfab3=function(_0x1454bb,_0x2b6dc6){_0x1454bb=_0x1454bb-0x0;var _0x1cf1f0=_0xab3f[_0x1454bb];return _0x1cf1f0;};'use strict';var Sequelize=require(_0xfab3('0x0'));module['exports']={'state':{'type':Sequelize[_0xfab3('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfab3('0x2')]},'scheduledat':{'type':Sequelize[_0xfab3('0x3')]},'uniqueid':{'type':Sequelize[_0xfab3('0x2')]},'starttime':{'type':Sequelize[_0xfab3('0x3')]},'responsetime':{'type':Sequelize[_0xfab3('0x3')]},'ringtime':{'type':Sequelize[_0xfab3('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xfab3('0x2')]},'campaigntype':{'type':Sequelize[_0xfab3('0x2')]},'membername':{'type':Sequelize[_0xfab3('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index d5d1c4b..7fe1b71 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 _0x715c=['moment','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define','util','../../config/logger','api'];(function(_0x53174f,_0x986a3b){var _0x1cbd1c=function(_0x5bbcb1){while(--_0x5bbcb1){_0x53174f['push'](_0x53174f['shift']());}};_0x1cbd1c(++_0x986a3b);}(_0x715c,0x1c9));var _0xc715=function(_0x311468,_0x451a2b){_0x311468=_0x311468-0x0;var _0x415c4b=_0x715c[_0x311468];return _0x415c4b;};'use strict';var _=require('lodash');var util=require(_0xc715('0x0'));var logger=require(_0xc715('0x1'))(_0xc715('0x2'));var moment=require(_0xc715('0x3'));var BPromise=require('bluebird');var rp=require(_0xc715('0x4'));var fs=require('fs');var path=require(_0xc715('0x5'));var rimraf=require(_0xc715('0x6'));var config=require('../../config/environment');var attributes=require(_0xc715('0x7'));module[_0xc715('0x8')]=function(_0x1700d7,_0x1f2b8c){return _0x1700d7[_0xc715('0x9')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe914=['report_agent_preview','lodash','util','../../config/logger','path','rimraf','../../config/environment','exports','define','ReportAgentPreview'];(function(_0x327c6c,_0x1c578e){var _0x276ccd=function(_0x42b66f){while(--_0x42b66f){_0x327c6c['push'](_0x327c6c['shift']());}};_0x276ccd(++_0x1c578e);}(_0xe914,0x1d7));var _0x4e91=function(_0x1ace72,_0x274a09){_0x1ace72=_0x1ace72-0x0;var _0x38e16e=_0xe914[_0x1ace72];return _0x38e16e;};'use strict';var _=require(_0x4e91('0x0'));var util=require(_0x4e91('0x1'));var logger=require(_0x4e91('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e91('0x3'));var rimraf=require(_0x4e91('0x4'));var config=require(_0x4e91('0x5'));var attributes=require('./reportAgentPreview.attributes');module[_0x4e91('0x6')]=function(_0x4d0390,_0x1ccf0c){return _0x4d0390[_0x4e91('0x7')](_0x4e91('0x8'),attributes,{'tableName':_0x4e91('0x9'),'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 1f7245d..eaeb3cd 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 _0xa468=['rpc','../../config/environment','jayson/promise','then','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','info','catch','CreateReportAgentPreview','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x305fbd,_0x1ac19e){var _0xd4469=function(_0x4172ec){while(--_0x4172ec){_0x305fbd['push'](_0x305fbd['shift']());}};_0xd4469(++_0x1ac19e);}(_0xa468,0x1d3));var _0x8a46=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xa468[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x8a46('0x0'));var util=require(_0x8a46('0x1'));var moment=require(_0x8a46('0x2'));var BPromise=require(_0x8a46('0x3'));var rs=require(_0x8a46('0x4'));var fs=require('fs');var Redis=require(_0x8a46('0x5'));var db=require(_0x8a46('0x6'))['db'];var utils=require(_0x8a46('0x7'));var logger=require(_0x8a46('0x8'))(_0x8a46('0x9'));var config=require(_0x8a46('0xa'));var jayson=require(_0x8a46('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4520ce,_0xcbc898,_0x454563){return new BPromise(function(_0x334dfa,_0x45f3ac){return client['request'](_0x4520ce,_0x454563)[_0x8a46('0xc')](function(_0x2ebdb4){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0xcbc898,'request\x20sent');logger['debug'](_0x8a46('0xd'),_0xcbc898,_0x8a46('0xe'),JSON[_0x8a46('0xf')](_0x2ebdb4));if(_0x2ebdb4[_0x8a46('0x10')]){if(_0x2ebdb4['error'][_0x8a46('0x11')]===0x1f4){logger['error'](_0x8a46('0x12'),_0xcbc898,_0x2ebdb4['error']['message']);return _0x45f3ac(_0x2ebdb4[_0x8a46('0x10')][_0x8a46('0x13')]);}logger[_0x8a46('0x10')](_0x8a46('0x12'),_0xcbc898,_0x2ebdb4['error'][_0x8a46('0x13')]);return _0x334dfa(_0x2ebdb4['error'][_0x8a46('0x13')]);}else{logger[_0x8a46('0x14')](_0x8a46('0x12'),_0xcbc898,_0x8a46('0xe'));_0x334dfa(_0x2ebdb4['result'][_0x8a46('0x13')]);}})[_0x8a46('0x15')](function(_0x437394){logger['error'](_0x8a46('0x12'),_0xcbc898,_0x437394);_0x45f3ac(_0x437394);});});}exports[_0x8a46('0x16')]=function(_0x507c78){var _0x3f0f39=this;return new Promise(function(_0x2530b7,_0x4b3bb2){return db['ReportAgentPreview'][_0x8a46('0x17')](_0x507c78[_0x8a46('0x18')],{'raw':_0x507c78['options']?_0x507c78[_0x8a46('0x19')][_0x8a46('0x1a')]===undefined?!![]:![]:!![]})[_0x8a46('0xc')](function(_0x421d65){logger[_0x8a46('0x14')]('CreateReportAgentPreview',_0x507c78);logger[_0x8a46('0x1b')](_0x8a46('0x16'),_0x507c78,JSON[_0x8a46('0xf')](_0x421d65));_0x2530b7(_0x421d65);})[_0x8a46('0x15')](function(_0x3a9c80){logger['error']('CreateReportAgentPreview',_0x3a9c80['message'],_0x507c78);_0x4b3bb2(_0x3f0f39[_0x8a46('0x10')](0x1f4,_0x3a9c80[_0x8a46('0x13')]));});});}; \ No newline at end of file +var _0xe47c=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x31ff15,_0x98116d){var _0x1435e2=function(_0x8764b7){while(--_0x8764b7){_0x31ff15['push'](_0x31ff15['shift']());}};_0x1435e2(++_0x98116d);}(_0xe47c,0x97));var _0xce47=function(_0x41ceb5,_0x30a19a){_0x41ceb5=_0x41ceb5-0x0;var _0xc3e44f=_0xe47c[_0x41ceb5];return _0xc3e44f;};'use strict';var _=require(_0xce47('0x0'));var util=require(_0xce47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xce47('0x2'));var fs=require('fs');var Redis=require(_0xce47('0x3'));var db=require(_0xce47('0x4'))['db'];var utils=require(_0xce47('0x5'));var logger=require(_0xce47('0x6'))(_0xce47('0x7'));var config=require(_0xce47('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce47('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45c837,_0x341ba9,_0x1e3241){return new BPromise(function(_0x3651fd,_0x2df39f){return client[_0xce47('0xa')](_0x45c837,_0x1e3241)[_0xce47('0xb')](function(_0x291e8a){logger[_0xce47('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x341ba9,'request\x20sent');logger[_0xce47('0xd')](_0xce47('0xe'),_0x341ba9,_0xce47('0xf'),JSON[_0xce47('0x10')](_0x291e8a));if(_0x291e8a['error']){if(_0x291e8a[_0xce47('0x11')][_0xce47('0x12')]===0x1f4){logger[_0xce47('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x341ba9,_0x291e8a['error']['message']);return _0x2df39f(_0x291e8a[_0xce47('0x11')][_0xce47('0x13')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x341ba9,_0x291e8a[_0xce47('0x11')][_0xce47('0x13')]);return _0x3651fd(_0x291e8a['error'][_0xce47('0x13')]);}else{logger[_0xce47('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x341ba9,'request\x20sent');_0x3651fd(_0x291e8a[_0xce47('0x14')][_0xce47('0x13')]);}})[_0xce47('0x15')](function(_0x2f31dc){logger['error'](_0xce47('0x16'),_0x341ba9,_0x2f31dc);_0x2df39f(_0x2f31dc);});});}exports[_0xce47('0x17')]=function(_0x297857){var _0x53c6e2=this;return new Promise(function(_0x1369b2,_0x3cb717){return db[_0xce47('0x18')][_0xce47('0x19')](_0x297857[_0xce47('0x1a')],{'raw':_0x297857[_0xce47('0x1b')]?_0x297857[_0xce47('0x1b')][_0xce47('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1b5dc5){logger[_0xce47('0xc')](_0xce47('0x17'),_0x297857);logger[_0xce47('0xd')](_0xce47('0x17'),_0x297857,JSON[_0xce47('0x10')](_0x1b5dc5));_0x1369b2(_0x1b5dc5);})['catch'](function(_0x5ee9ed){logger[_0xce47('0x11')]('CreateReportAgentPreview',_0x5ee9ed[_0xce47('0x13')],_0x297857);_0x3cb717(_0x53c6e2[_0xce47('0x11')](0x1f4,_0x5ee9ed['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8aa3024..52e72ad 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 _0xaf88=['outbound','/outbound/channels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','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','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue'];(function(_0x3592d1,_0x41c43a){var _0x326a80=function(_0x5c4f7f){while(--_0x5c4f7f){_0x3592d1['push'](_0x3592d1['shift']());}};_0x326a80(++_0x41c43a);}(_0xaf88,0x141));var _0x8af8=function(_0x2d141e,_0x3097c6){_0x2d141e=_0x2d141e-0x0;var _0x486401=_0xaf88[_0x2d141e];return _0x486401;};'use strict';var multer=require(_0x8af8('0x0'));var util=require(_0x8af8('0x1'));var path=require(_0x8af8('0x2'));var express=require(_0x8af8('0x3'));var router=express[_0x8af8('0x4')]();var auth=require(_0x8af8('0x5'));var controller=require('./rpc.controller');router['get'](_0x8af8('0x6'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x8')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x8af8('0x9')]);router[_0x8af8('0xa')](_0x8af8('0xb'),auth[_0x8af8('0x7')](),controller[_0x8af8('0xc')]);router[_0x8af8('0xa')](_0x8af8('0xd'),auth['isAuthenticated'](),controller[_0x8af8('0xe')]);router[_0x8af8('0xa')](_0x8af8('0xf'),auth['isAuthenticated'](),controller[_0x8af8('0x10')]);router['get'](_0x8af8('0x11'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x12')]);router[_0x8af8('0xa')](_0x8af8('0x13'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x14')]);router[_0x8af8('0xa')](_0x8af8('0x15'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x16')]);router['get']('/sms/queues',auth[_0x8af8('0x7')](),controller[_0x8af8('0x17')]);router[_0x8af8('0xa')](_0x8af8('0x18'),auth['isAuthenticated'](),controller[_0x8af8('0x19')]);router[_0x8af8('0xa')](_0x8af8('0x1a'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x1b')]);router['get'](_0x8af8('0x1c'),auth['isAuthenticated'](),controller[_0x8af8('0x1d')]);router[_0x8af8('0xa')]('/voice/queues/channels',auth['isAuthenticated'](),controller[_0x8af8('0x1e')]);router[_0x8af8('0xa')]('/voice/queues/channels/:uniqueid',auth[_0x8af8('0x7')](),controller[_0x8af8('0x1f')]);router['get'](_0x8af8('0x20'),auth['isAuthenticated'](),controller[_0x8af8('0x21')]);router[_0x8af8('0xa')](_0x8af8('0x22'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x23')]);router['get'](_0x8af8('0x24'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x25')]);router['put'](_0x8af8('0x24'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x26')]);router['get']('/outbound',auth[_0x8af8('0x7')](),controller[_0x8af8('0x27')]);router[_0x8af8('0xa')](_0x8af8('0x28'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0x8af8('0xa')]('/agents',auth[_0x8af8('0x7')](),controller[_0x8af8('0x29')]);router[_0x8af8('0x2a')](_0x8af8('0x2b'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x2c')]);router['get'](_0x8af8('0x2d'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x2e')]);router[_0x8af8('0xa')]('/trunks',auth[_0x8af8('0x7')](),controller[_0x8af8('0x2f')]);router[_0x8af8('0xa')](_0x8af8('0x30'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x31')]);router[_0x8af8('0xa')](_0x8af8('0x32'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x33')]);router[_0x8af8('0xa')](_0x8af8('0x34'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x35')]);router[_0x8af8('0xa')](_0x8af8('0x36'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x37')]);router['get'](_0x8af8('0x38'),auth['isAuthenticated'](),controller[_0x8af8('0x39')]);router[_0x8af8('0xa')](_0x8af8('0x3a'),auth[_0x8af8('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x8af8('0x3b'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x3c')]);router[_0x8af8('0xa')](_0x8af8('0x3d'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x3e')]);router[_0x8af8('0xa')](_0x8af8('0x3f'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x40')]);router[_0x8af8('0x41')](_0x8af8('0x42'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x43')](_0x8af8('0x44')));router['get'](_0x8af8('0x45'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x46')]);router[_0x8af8('0x41')](_0x8af8('0x47'),auth['isAuthenticated'](),controller[_0x8af8('0x43')](_0x8af8('0x48')));router[_0x8af8('0xa')](_0x8af8('0x49'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x4a')]);router['post'](_0x8af8('0x4b'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x43')](_0x8af8('0x4c')));router[_0x8af8('0xa')](_0x8af8('0x4d'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x4e')]);router[_0x8af8('0x41')](_0x8af8('0x4f'),auth[_0x8af8('0x7')](),controller[_0x8af8('0x43')](_0x8af8('0x50')));router[_0x8af8('0xa')]('/openchannel/queues/:id',auth[_0x8af8('0x7')](),controller[_0x8af8('0x51')]);router['post'](_0x8af8('0x52'),auth[_0x8af8('0x7')](),controller['queueNotify']('sms'));router[_0x8af8('0x41')](_0x8af8('0x53'),auth['isAuthenticated'](),controller[_0x8af8('0x43')](_0x8af8('0x54')));router[_0x8af8('0xa')](_0x8af8('0x55'),auth['isAuthenticated'](),controller[_0x8af8('0x56')]);router['get']('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x8af8('0x57')]);router[_0x8af8('0x41')]('/agents/:id/notify',auth[_0x8af8('0x7')](),controller[_0x8af8('0x58')]);module[_0x8af8('0x59')]=router; \ No newline at end of file +var _0x5c01=['/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','chat','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x5c01,0x135));var _0x15c0=function(_0x63db28,_0x630301){_0x63db28=_0x63db28-0x0;var _0x3b91d0=_0x5c01[_0x63db28];return _0x3b91d0;};'use strict';var multer=require(_0x15c0('0x0'));var util=require(_0x15c0('0x1'));var path=require(_0x15c0('0x2'));var express=require(_0x15c0('0x3'));var router=express['Router']();var auth=require(_0x15c0('0x4'));var controller=require(_0x15c0('0x5'));router[_0x15c0('0x6')]('/voice/channels',auth['isAuthenticated'](),controller['voiceChannels']);router[_0x15c0('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x15c0('0x7')](),controller[_0x15c0('0x8')]);router[_0x15c0('0x6')](_0x15c0('0x9'),auth[_0x15c0('0x7')](),controller[_0x15c0('0xa')]);router[_0x15c0('0x6')](_0x15c0('0xb'),auth[_0x15c0('0x7')](),controller[_0x15c0('0xc')]);router[_0x15c0('0x6')](_0x15c0('0xd'),auth['isAuthenticated'](),controller[_0x15c0('0xe')]);router[_0x15c0('0x6')](_0x15c0('0xf'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x10')]);router[_0x15c0('0x6')](_0x15c0('0x11'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x12')]);router[_0x15c0('0x6')](_0x15c0('0x13'),auth[_0x15c0('0x7')](),controller['openchannelQueues']);router[_0x15c0('0x6')]('/sms/queues',auth[_0x15c0('0x7')](),controller[_0x15c0('0x14')]);router[_0x15c0('0x6')](_0x15c0('0x15'),auth[_0x15c0('0x7')](),controller['whatsappQueues']);router[_0x15c0('0x6')](_0x15c0('0x16'),auth[_0x15c0('0x7')](),controller['faxQueues']);router[_0x15c0('0x6')](_0x15c0('0x17'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x18')]);router[_0x15c0('0x6')](_0x15c0('0x19'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x1a')]);router[_0x15c0('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x15c0('0x7')](),controller[_0x15c0('0x1b')]);router['get'](_0x15c0('0x1c'),auth['isAuthenticated'](),controller[_0x15c0('0x1d')]);router[_0x15c0('0x6')](_0x15c0('0x1e'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x1f')]);router['get'](_0x15c0('0x20'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x21')]);router[_0x15c0('0x22')](_0x15c0('0x20'),auth[_0x15c0('0x7')](),controller['updateVoiceQueue']);router[_0x15c0('0x6')](_0x15c0('0x23'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x24')]);router['get'](_0x15c0('0x25'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x26')]);router[_0x15c0('0x6')]('/agents',auth['isAuthenticated'](),controller[_0x15c0('0x27')]);router['put'](_0x15c0('0x28'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x29')]);router[_0x15c0('0x6')](_0x15c0('0x2a'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x2b')]);router[_0x15c0('0x6')]('/trunks',auth[_0x15c0('0x7')](),controller[_0x15c0('0x2c')]);router['get'](_0x15c0('0x2d'),auth[_0x15c0('0x7')](),controller['campaigns']);router['get'](_0x15c0('0x2e'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x2f')]);router['get'](_0x15c0('0x30'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x31')]);router['get'](_0x15c0('0x32'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x33')]);router['get'](_0x15c0('0x34'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x35')]);router[_0x15c0('0x6')](_0x15c0('0x36'),auth[_0x15c0('0x7')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x15c0('0x6')](_0x15c0('0x37'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x38')]);router[_0x15c0('0x6')](_0x15c0('0x39'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x3a')]);router[_0x15c0('0x6')](_0x15c0('0x3b'),auth[_0x15c0('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0x15c0('0x3c')]('/mail/queues/:id/notify',auth[_0x15c0('0x7')](),controller[_0x15c0('0x3d')](_0x15c0('0x3e')));router[_0x15c0('0x6')]('/mail/queues/:id',auth[_0x15c0('0x7')](),controller[_0x15c0('0x3f')]);router[_0x15c0('0x3c')](_0x15c0('0x40'),auth['isAuthenticated'](),controller[_0x15c0('0x3d')](_0x15c0('0x41')));router[_0x15c0('0x6')]('/chat/queues/:id',auth[_0x15c0('0x7')](),controller['showChatQueues']);router[_0x15c0('0x3c')]('/fax/queues/:id/notify',auth[_0x15c0('0x7')](),controller[_0x15c0('0x3d')](_0x15c0('0x42')));router[_0x15c0('0x6')](_0x15c0('0x43'),auth[_0x15c0('0x7')](),controller['showFaxQueues']);router[_0x15c0('0x3c')](_0x15c0('0x44'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x3d')](_0x15c0('0x45')));router[_0x15c0('0x6')]('/openchannel/queues/:id',auth[_0x15c0('0x7')](),controller[_0x15c0('0x46')]);router['post'](_0x15c0('0x47'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x3d')]('sms'));router[_0x15c0('0x3c')](_0x15c0('0x48'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x3d')](_0x15c0('0x49')));router[_0x15c0('0x6')](_0x15c0('0x4a'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x4b')]);router[_0x15c0('0x6')](_0x15c0('0x4c'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x4d')]);router[_0x15c0('0x3c')](_0x15c0('0x4e'),auth[_0x15c0('0x7')](),controller[_0x15c0('0x4f')]);module[_0x15c0('0x50')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 79cd3ec..c75538f 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 _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file +var _0xd8b0=['showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','value','filter','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','InteractionId','From','QueueId','TransferReport','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','agent','Message','create','Start','agentTransferTimeout','bluebird','moment','../../config/logger','api','jayson/promise','client','http','request','then','error','code','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','findAll','user','length','format','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','internal','capacity','campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x91fc86,_0x2ad31b){var _0x3579cf=function(_0x1b4fce){while(--_0x1b4fce){_0x91fc86['push'](_0x91fc86['shift']());}};_0x3579cf(++_0x2ad31b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var jayson=require(_0x0d8b('0x4'));var amiClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x0d8b('0x5')][_0x0d8b('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){var _0x129310=_0x413284?_0x413284:amiClient;return _0x129310[_0x0d8b('0x7')](_0x39f43a,_0x4a4470)[_0x0d8b('0x8')](function(_0x1f4800){if(_0x1f4800[_0x0d8b('0x9')]){if(_0x1f4800[_0x0d8b('0x9')][_0x0d8b('0xa')]===0x1f4){return _0x58e4e2(_0x1f4800[_0x0d8b('0x9')]['message']);}return _0x284169(_0x1f4800[_0x0d8b('0x9')]['message']);}else{_0x284169(_0x1f4800[_0x0d8b('0xb')]);}})[_0x0d8b('0xc')](function(_0x340cc4){_0x58e4e2(_0x340cc4);});});}function respondWithResult(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xc8;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0xe')](_0x32bb1a);}return _0x92cdd8[_0x0d8b('0xf')](0x194);};}function handleError(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0x1f4;return function(_0xe65334){logger[_0x0d8b('0x9')](_0xe65334[_0x0d8b('0x10')]);if(_0xe65334['name']){delete _0xe65334[_0x0d8b('0x11')];}_0x2ce75e[_0x0d8b('0xd')](_0x5ad086)[_0x0d8b('0x12')](_0xe65334);};}function findById(_0xe2e167){return function(_0x2cb03c){if(!_['isNil'](_0xe2e167)&&!_[_0x0d8b('0x13')](_0x2cb03c)&&!_[_0x0d8b('0x13')](_0x2cb03c[_0x0d8b('0x14')])){return _[_0x0d8b('0x15')](_0x2cb03c[_0x0d8b('0x14')],function(_0x18dd2d){return _0x18dd2d['id']==_0xe2e167;});}return null;};}exports[_0x0d8b('0x16')]=function(_0xa3612a,_0x4a15bf){return respondWithRpcPromise(_0x0d8b('0x17'),_0xa3612a[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4a15bf,null))[_0x0d8b('0xc')](handleError(_0x4a15bf,null));};exports[_0x0d8b('0x19')]=function(_0x5b709c,_0x393beb){return respondWithRpcPromise(_0x0d8b('0x1a'),_['merge'](_0x5b709c['query'],_0x5b709c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x393beb,null))['catch'](handleError(_0x393beb,null));};exports['voiceChannelStopMixMonitor']=function(_0x238728,_0x2b924f){return respondWithRpcPromise(_0x0d8b('0x1c'),_[_0x0d8b('0x1d')](_0x238728[_0x0d8b('0x18')],_0x238728[_0x0d8b('0x1b')]))[_0x0d8b('0x8')](respondWithResult(_0x2b924f,null))[_0x0d8b('0xc')](handleError(_0x2b924f,null));};exports[_0x0d8b('0x1e')]=function(_0x5e5bc3,_0xe8bbee){return respondWithRpcPromise(_0x0d8b('0x1f'),_0x5e5bc3['query'])[_0x0d8b('0x8')](respondWithResult(_0xe8bbee,null))['catch'](handleError(_0xe8bbee,null));};exports[_0x0d8b('0x20')]=function(_0x234bdd,_0xa2af02){return respondWithRpcPromise('VoiceQueues',_0x234bdd['query'])[_0x0d8b('0x8')](findById(_0x234bdd[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0xa2af02,null))[_0x0d8b('0xc')](handleError(_0xa2af02,null));};exports['updateVoiceQueue']=function(_0x1b2b59,_0x4b59e5){return respondWithRpcPromise(_0x0d8b('0x21'),_['merge'](_0x1b2b59[_0x0d8b('0x22')],_0x1b2b59['params']))[_0x0d8b('0x8')](respondWithResult(_0x4b59e5,null))['catch'](handleError(_0x4b59e5,null));};exports[_0x0d8b('0x23')]=function(_0x106e4c,_0x2c058d){return respondWithRpcPromise('VoiceQueuesPreview',_['merge'](_0x106e4c['query'],_0x106e4c[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x2c058d,null))[_0x0d8b('0xc')](handleError(_0x2c058d,null));};exports['voiceQueuesChannels']=function(_0x5d05fc,_0x36017a){return respondWithRpcPromise(_0x0d8b('0x24'),_0x5d05fc[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x36017a,null))[_0x0d8b('0xc')](handleError(_0x36017a,null));};exports[_0x0d8b('0x25')]=function(_0x4a99d3,_0x6f93c7){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0d8b('0x1d')](_0x4a99d3[_0x0d8b('0x18')],_0x4a99d3['params']))[_0x0d8b('0x8')](respondWithResult(_0x6f93c7,null))[_0x0d8b('0xc')](handleError(_0x6f93c7,null));};exports[_0x0d8b('0x26')]=function(_0x4f2ed2,_0x113318){return respondWithRpcPromise(_0x0d8b('0x27'),_[_0x0d8b('0x1d')](_0x4f2ed2[_0x0d8b('0x18')],_0x4f2ed2[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x113318,null))[_0x0d8b('0xc')](handleError(_0x113318,null));};exports[_0x0d8b('0x28')]=function(_0x5ad0fe,_0x1180ac){return respondWithRpcPromise(_0x0d8b('0x29'),_[_0x0d8b('0x1d')](_0x5ad0fe[_0x0d8b('0x18')],_0x5ad0fe[_0x0d8b('0x1b')]))['then'](respondWithResult(_0x1180ac,null))['catch'](handleError(_0x1180ac,null));};exports[_0x0d8b('0x2a')]=function(_0x5c2c04,_0x531c55){return respondWithRpcPromise(_0x0d8b('0x2b'),_0x5c2c04[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x531c55,null))[_0x0d8b('0xc')](handleError(_0x531c55,null));};exports[_0x0d8b('0x2c')]=function(_0x24c789,_0x579324){return respondWithRpcPromise(_0x0d8b('0x2d'),_0x24c789[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x579324,null))[_0x0d8b('0xc')](handleError(_0x579324,null));};exports[_0x0d8b('0x2e')]=function(_0x1a39ad,_0xf1680e){var _0x5c980b;return respondWithRpcPromise(_0x0d8b('0x2f'),_0x1a39ad[_0x0d8b('0x18')])[_0x0d8b('0x8')](function(_0x1f196d){_0x5c980b=_0x1f196d;return respondWithRpcPromise('Agents',_0x1a39ad[_0x0d8b('0x18')],routingClient);})['then'](function(_0x37b26c){return _[_0x0d8b('0x1d')]({},_0x37b26c,_0x5c980b);})[_0x0d8b('0x8')](respondWithResult(_0xf1680e,null))[_0x0d8b('0xc')](handleError(_0xf1680e,null));};exports[_0x0d8b('0x30')]=function(_0x3e632e,_0x1ff17d){if(_0x3e632e[_0x0d8b('0x22')]&&_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]&&_0x3e632e['user']&&_0x3e632e['user']['name']){for(var _0x4d0811 in _0x3e632e['body'][_0x0d8b('0x31')]){if(_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')]['hasOwnProperty'](_0x4d0811)){db['MemberReport'][_0x0d8b('0x32')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811]&&_0x3e632e['body']['interaction'][_0x4d0811][_0x0d8b('0x34')]?{'$notIn':_0x3e632e['body'][_0x0d8b('0x31')][_0x4d0811]}:{'$ne':null}}})['then'](function(_0x53f643){var _0x30ccee=moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5ebe8a=0x0,_0x59b8e9=_0x53f643['length'];_0x5ebe8a<_0x59b8e9;_0x5ebe8a+=0x1){_0x53f643[_0x5ebe8a][_0x0d8b('0x36')]({'exitAt':_0x30ccee});}});for(var _0x1e0498=0x0;_0x1e0498<_0x3e632e[_0x0d8b('0x22')]['interaction'][_0x4d0811][_0x0d8b('0x34')];_0x1e0498+=0x1){db[_0x0d8b('0x37')][_0x0d8b('0x38')]({'where':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'type':_0x0d8b('0x39'),'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498],'exitAt':null},'defaults':{'channel':_0x4d0811,'membername':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')],'interface':_[_0x0d8b('0x13')](_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')])?util[_0x0d8b('0x35')](_0x0d8b('0x3b'),_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x11')]):_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x0d8b('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3e632e[_0x0d8b('0x33')][_0x0d8b('0x3c')],'uniqueid':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x31')][_0x4d0811][_0x1e0498]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x3e632e[_0x0d8b('0x1b')]['id'],'capacity':_0x3e632e[_0x0d8b('0x22')][_0x0d8b('0x3d')]},routingClient)[_0x0d8b('0x8')](respondWithResult(_0x1ff17d,null))[_0x0d8b('0xc')](handleError(_0x1ff17d,null));};exports['telephones']=function(_0x5c0824,_0x4e4d5f){return respondWithRpcPromise('Telephones',_0x5c0824[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x4e4d5f,null))['catch'](handleError(_0x4e4d5f,null));};exports['trunks']=function(_0x44c5c1,_0x3d3cb6){return respondWithRpcPromise('Trunks',_0x44c5c1['query'])[_0x0d8b('0x8')](respondWithResult(_0x3d3cb6,null))[_0x0d8b('0xc')](handleError(_0x3d3cb6,null));};exports[_0x0d8b('0x3e')]=function(_0x346c0d,_0x2d5519){return respondWithRpcPromise('Campaigns',_0x346c0d[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x2d5519,null))['catch'](handleError(_0x2d5519,null));};exports['chatQueues']=function(_0xf6a773,_0x3f2d95){return respondWithRpcPromise('ChatQueues',_0xf6a773['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f2d95,null))[_0x0d8b('0xc')](handleError(_0x3f2d95,null));};exports[_0x0d8b('0x3f')]=function(_0xb58818,_0x4a2989){return respondWithRpcPromise(_0x0d8b('0x40'),_0xb58818['query'],routingClient)['then'](findById(_0xb58818[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x4a2989,null))['catch'](handleError(_0x4a2989,null));};exports['mailQueues']=function(_0x44ed23,_0x3d7161){return respondWithRpcPromise(_0x0d8b('0x41'),_0x44ed23[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3d7161,null))[_0x0d8b('0xc')](handleError(_0x3d7161,null));};exports[_0x0d8b('0x42')]=function(_0x3bead7,_0x5418d8){return respondWithRpcPromise(_0x0d8b('0x41'),_0x3bead7[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x3bead7[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x5418d8,null))[_0x0d8b('0xc')](handleError(_0x5418d8,null));};exports[_0x0d8b('0x43')]=function(_0x1c78b6,_0x375684){return respondWithRpcPromise('MailAccounts',_0x1c78b6[_0x0d8b('0x18')],mailClient)[_0x0d8b('0x8')](respondWithResult(_0x375684,null))[_0x0d8b('0xc')](handleError(_0x375684,null));};exports[_0x0d8b('0x44')]=function(_0x43ad22,_0x577951){return respondWithRpcPromise(_0x0d8b('0x45'),_0x43ad22[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x577951,null))[_0x0d8b('0xc')](handleError(_0x577951,null));};exports[_0x0d8b('0x46')]=function(_0x59ada2,_0x4d0e7c){return respondWithRpcPromise(_0x0d8b('0x45'),_0x59ada2[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x59ada2[_0x0d8b('0x1b')]['id']))['then'](respondWithResult(_0x4d0e7c,null))[_0x0d8b('0xc')](handleError(_0x4d0e7c,null));};exports[_0x0d8b('0x47')]=function(_0x8c0bbe,_0x5952dd){return respondWithRpcPromise(_0x0d8b('0x48'),_0x8c0bbe['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5952dd,null))[_0x0d8b('0xc')](handleError(_0x5952dd,null));};exports[_0x0d8b('0x49')]=function(_0x26ccf0,_0x2b6eb6){return respondWithRpcPromise(_0x0d8b('0x48'),_0x26ccf0['query'],routingClient)[_0x0d8b('0x8')](findById(_0x26ccf0['params']['id']))[_0x0d8b('0x8')](respondWithResult(_0x2b6eb6,null))[_0x0d8b('0xc')](handleError(_0x2b6eb6,null));};exports[_0x0d8b('0x4a')]=function(_0x33a614,_0x48025e){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x33a614[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x48025e,null))[_0x0d8b('0xc')](handleError(_0x48025e,null));};exports[_0x0d8b('0x4c')]=function(_0x273aef,_0x223fd8){return respondWithRpcPromise(_0x0d8b('0x4b'),_0x273aef[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x273aef['params']['id']))['then'](respondWithResult(_0x223fd8,null))[_0x0d8b('0xc')](handleError(_0x223fd8,null));};exports[_0x0d8b('0x4d')]=function(_0x53e399,_0xb1aa96){return respondWithRpcPromise('FaxQueues',_0x53e399['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0xb1aa96,null))[_0x0d8b('0xc')](handleError(_0xb1aa96,null));};exports['showFaxQueues']=function(_0x587128,_0x1900e3){return respondWithRpcPromise(_0x0d8b('0x4e'),_0x587128[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](findById(_0x587128[_0x0d8b('0x1b')]['id']))[_0x0d8b('0x8')](respondWithResult(_0x1900e3,null))[_0x0d8b('0xc')](handleError(_0x1900e3,null));};exports['faxAccounts']=function(_0x1ca60c,_0x5878c2){return respondWithRpcPromise(_0x0d8b('0x4f'),_0x1ca60c[_0x0d8b('0x18')])[_0x0d8b('0x8')](respondWithResult(_0x5878c2,null))[_0x0d8b('0xc')](handleError(_0x5878c2,null));};exports['chatQueuesWaitingInteractions']=function(_0x3fe47d,_0x4a1c4a){return respondWithRpcPromise(_0x0d8b('0x50'),_0x3fe47d[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x4a1c4a,null))[_0x0d8b('0xc')](handleError(_0x4a1c4a,null));};exports[_0x0d8b('0x51')]=function(_0x2b44e5,_0x3e927c){return respondWithRpcPromise(_0x0d8b('0x52'),_0x2b44e5[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e927c,null))['catch'](handleError(_0x3e927c,null));};exports[_0x0d8b('0x53')]=function(_0x54c28b,_0x3e4121){return respondWithRpcPromise(_0x0d8b('0x54'),_0x54c28b['query'],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3e4121,null))['catch'](handleError(_0x3e4121,null));};exports[_0x0d8b('0x55')]=function(_0x445a00,_0x24f75){return respondWithRpcPromise(_0x0d8b('0x54'),_0x445a00[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](function(_0x3a073b){if(_0x445a00[_0x0d8b('0x18')]['type']!==undefined){var _0x10eca6=_(_0x3a073b[_0x0d8b('0x14')])['filter']([_0x445a00[_0x0d8b('0x18')][_0x0d8b('0x56')],_0x445a00[_0x0d8b('0x1b')]['id']])[_0x0d8b('0x57')](_0x0d8b('0x58'))[_0x0d8b('0x59')]()[_0x0d8b('0x5a')]();return _0x3a073b[_0x0d8b('0x14')][_0x0d8b('0x5b')](function(_0x5007c0){return _0x10eca6[_0x0d8b('0x5c')](_0x5007c0[_0x0d8b('0x58')])>-0x1;});}else{return _0x3a073b['rows'][_0x0d8b('0x5b')](function(_0x93fc55){return _0x93fc55[_0x0d8b('0x58')]===parseInt(_0x445a00['params']['id']);});}})['then'](respondWithResult(_0x24f75,null))[_0x0d8b('0xc')](handleError(_0x24f75,null));};exports[_0x0d8b('0x5d')]=function(_0x2c55bc,_0x5b76af){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2c55bc[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x5b76af,null))[_0x0d8b('0xc')](handleError(_0x5b76af,null));};exports[_0x0d8b('0x5e')]=function(_0x2a2b58,_0x3f7895){return respondWithRpcPromise(_0x0d8b('0x5f'),_0x2a2b58[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3f7895,null))[_0x0d8b('0xc')](handleError(_0x3f7895,null));};exports[_0x0d8b('0x60')]=function(_0x291336,_0x3b060e){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x291336[_0x0d8b('0x18')],routingClient)[_0x0d8b('0x8')](respondWithResult(_0x3b060e,null))['catch'](handleError(_0x3b060e,null));};exports['queueNotify']=function(_0x1a1029){return function(_0x1dad9f,_0x3573b4){var _0x14b1b8,_0x23e2e0;var _0x354208=_['capitalize'](_0x1a1029);var _0x502715=_0x1a1029==='chat'?_0x0d8b('0x61'):_0x0d8b('0x62');return db[_0x354208+_0x0d8b('0x63')][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x1dad9f[_0x0d8b('0x1b')]['id']}})[_0x0d8b('0x8')](function(_0x5ef461){if(_[_0x0d8b('0x13')](_0x5ef461)){throw new Error(_0x354208+_0x0d8b('0x65'));}_0x14b1b8=_0x5ef461;return db[_0x354208+'Message'][_0x0d8b('0x64')]({'where':{'id':_0x1dad9f['body'][_0x0d8b('0x66')]},'include':[{'model':db[_0x354208+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x354208+_0x502715],'as':_0x0d8b('0x62')}]});})[_0x0d8b('0x8')](function(_0x8fae7f){if(_[_0x0d8b('0x13')](_0x8fae7f)){throw new Error(_0x354208+_0x0d8b('0x68'));}_0x23e2e0=_0x8fae7f;return _0x8fae7f[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x276558={'uniqueid':_0x1a1029+'.'+_0x23e2e0['id']+'.'+_0x23e2e0[_0x0d8b('0x67')]['id'],'FromUserId':_0x1dad9f['user']['id'],'type':'queue'};_0x276558[_0x354208+_0x0d8b('0x6a')]=_0x23e2e0['id'];_0x276558[_0x354208+_0x0d8b('0x6b')]=_0x23e2e0[_0x0d8b('0x67')]['id'];_0x276558[_0x0d8b('0x6c')+_0x354208+_0x502715+'Id']=_0x23e2e0[_0x0d8b('0x62')]['id'];_0x276558['To'+_0x354208+_0x0d8b('0x6d')]=_0x14b1b8['id'];return db[_0x354208+_0x0d8b('0x6e')]['create'](_0x276558);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a1029,'interaction':_0x23e2e0[_0x0d8b('0x67')],'message':_0x23e2e0,'account':_0x23e2e0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x14b1b8[_0x0d8b('0x11')]+','+(_0x23e2e0[_0x0d8b('0x62')][_0x0d8b('0x6f')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})[_0x0d8b('0x8')](respondWithResult(_0x3573b4,null))[_0x0d8b('0xc')](handleError(_0x3573b4,null));};};exports[_0x0d8b('0x71')]=function(_0x180eda,_0x35267a){var _0x20a8b6,_0x3a6014;if(_[_0x0d8b('0x13')](_0x180eda['body'][_0x0d8b('0x72')])){throw new Error(_0x0d8b('0x73'));}var _0x8be77c=_0x180eda['body']['channel'];var _0x2db144=_[_0x0d8b('0x74')](_0x8be77c);var _0x36d6ca=_0x8be77c===_0x0d8b('0x75')?_0x0d8b('0x61'):_0x0d8b('0x62');return db['User'][_0x0d8b('0x64')]({'raw':!![],'where':{'id':_0x180eda[_0x0d8b('0x1b')]['id'],'role':_0x0d8b('0x76')}})[_0x0d8b('0x8')](function(_0x4350ee){if(_['isNil'](_0x4350ee)){throw new Error('Agent\x20not\x20found');}_0x20a8b6=_0x4350ee;return db[_0x2db144+_0x0d8b('0x77')][_0x0d8b('0x64')]({'where':{'id':_0x180eda[_0x0d8b('0x22')]['messageId']},'include':[{'model':db[_0x2db144+_0x0d8b('0x67')],'as':_0x0d8b('0x67')},{'model':db[_0x2db144+_0x36d6ca],'as':_0x0d8b('0x62')}]});})['then'](function(_0xb61d4b){if(_[_0x0d8b('0x13')](_0xb61d4b)){throw new Error(_0x2db144+_0x0d8b('0x68'));}_0x3a6014=_0xb61d4b;return _0xb61d4b[_0x0d8b('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0d8b('0x8')](function(){var _0x150e9f={'uniqueid':_0x8be77c+'.'+_0x3a6014['id']+'.'+_0x3a6014[_0x0d8b('0x67')]['id'],'FromUserId':_0x180eda[_0x0d8b('0x33')]['id'],'type':_0x0d8b('0x76'),'ToUserId':_0x20a8b6['id']};_0x150e9f[_0x2db144+'MessageId']=_0x3a6014['id'];_0x150e9f[_0x2db144+_0x0d8b('0x6b')]=_0x3a6014[_0x0d8b('0x67')]['id'];_0x150e9f[_0x0d8b('0x6c')+_0x2db144+_0x36d6ca+'Id']=_0x3a6014[_0x0d8b('0x62')]['id'];return db[_0x2db144+_0x0d8b('0x6e')][_0x0d8b('0x78')](_0x150e9f);})[_0x0d8b('0x8')](function(){return respondWithRpcPromise(_0x0d8b('0x79'),{'channel':_0x8be77c,'interaction':_0x3a6014[_0x0d8b('0x67')],'message':_0x3a6014,'account':_0x3a6014['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x20a8b6[_0x0d8b('0x11')]+','+(_0x3a6014[_0x0d8b('0x62')][_0x0d8b('0x7a')]||0x12c),'interval':_0x0d8b('0x70')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x35267a,null))[_0x0d8b('0xc')](handleError(_0x35267a,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f3128ed..31fd014 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 _0x0108=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','get','/:id','show','/:id/run','run','post','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x267665,_0x889bef){var _0x3dd35c=function(_0x2869da){while(--_0x2869da){_0x267665['push'](_0x267665['shift']());}};_0x3dd35c(++_0x889bef);}(_0x0108,0x129));var _0x8010=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0x0108[_0x3f1710];return _0x528458;};'use strict';var multer=require(_0x8010('0x0'));var util=require('util');var path=require(_0x8010('0x1'));var timeout=require(_0x8010('0x2'));var express=require('express');var router=express[_0x8010('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8010('0x4'));var interaction=require(_0x8010('0x5'));var config=require(_0x8010('0x6'));var controller=require(_0x8010('0x7'));router['get']('/',auth[_0x8010('0x8')](),controller['index']);router[_0x8010('0x9')](_0x8010('0xa'),auth['isAuthenticated'](),controller[_0x8010('0xb')]);router[_0x8010('0x9')](_0x8010('0xc'),auth['isAuthenticated'](),controller[_0x8010('0xd')]);router[_0x8010('0xe')]('/',auth['isAuthenticated'](),controller[_0x8010('0xf')]);router[_0x8010('0x10')]('/:id',auth[_0x8010('0x8')](),controller['update']);router[_0x8010('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8010('0x12')]);module[_0x8010('0x13')]=router; \ No newline at end of file +var _0x3442=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','run'];(function(_0x5181cf,_0x25b5c7){var _0x246901=function(_0x3084a5){while(--_0x3084a5){_0x5181cf['push'](_0x5181cf['shift']());}};_0x246901(++_0x25b5c7);}(_0x3442,0x166));var _0x2344=function(_0x5dbd9d,_0x24d438){_0x5dbd9d=_0x5dbd9d-0x0;var _0x225ccf=_0x3442[_0x5dbd9d];return _0x225ccf;};'use strict';var multer=require(_0x2344('0x0'));var util=require(_0x2344('0x1'));var path=require(_0x2344('0x2'));var timeout=require(_0x2344('0x3'));var express=require(_0x2344('0x4'));var router=express[_0x2344('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2344('0x6'));var config=require(_0x2344('0x7'));var controller=require(_0x2344('0x8'));router[_0x2344('0x9')]('/',auth['isAuthenticated'](),controller[_0x2344('0xa')]);router[_0x2344('0x9')](_0x2344('0xb'),auth[_0x2344('0xc')](),controller[_0x2344('0xd')]);router[_0x2344('0x9')](_0x2344('0xe'),auth[_0x2344('0xc')](),controller[_0x2344('0xf')]);router[_0x2344('0x10')]('/',auth['isAuthenticated'](),controller[_0x2344('0x11')]);router[_0x2344('0x12')](_0x2344('0xb'),auth[_0x2344('0xc')](),controller['update']);router[_0x2344('0x13')](_0x2344('0xb'),auth[_0x2344('0xc')](),controller[_0x2344('0x14')]);module[_0x2344('0x15')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 25a5654..688cbf3 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 _0x6dd1=['quarters','months','weeks','hours','minutes','csv','default','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years'];(function(_0x1040c8,_0x1baa50){var _0x5d0df0=function(_0x182b7f){while(--_0x182b7f){_0x1040c8['push'](_0x1040c8['shift']());}};_0x5d0df0(++_0x1baa50);}(_0x6dd1,0x179));var _0x16dd=function(_0x22e434,_0x496014){_0x22e434=_0x22e434-0x0;var _0x350da1=_0x6dd1[_0x22e434];return _0x350da1;};'use strict';var Sequelize=require(_0x16dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x16dd('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x16dd('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x16dd('0x1')],'allowNull':![],'defaultValue':_0x16dd('0x3')},'startAt':{'type':Sequelize[_0x16dd('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x16dd('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x16dd('0x5')](_0x16dd('0x6'),_0x16dd('0x7'),_0x16dd('0x8'),_0x16dd('0x9'),'days',_0x16dd('0xa'),_0x16dd('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x16dd('0x5')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x16dd('0xc')},'type':{'type':Sequelize[_0x16dd('0x5')]('custom',_0x16dd('0xd')),'allowNull':![],'defaultValue':_0x16dd('0xe')},'sendMail':{'type':Sequelize[_0x16dd('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x16dd('0x1')]},'cc':{'type':Sequelize[_0x16dd('0xf')]},'bcc':{'type':Sequelize[_0x16dd('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x16dd('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc518=['weeks','days','hours','minutes','pdf','xlsx','csv','custom','TEXT','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters'];(function(_0xfc67,_0x4f5357){var _0x24ad9b=function(_0x3b6e6f){while(--_0x3b6e6f){_0xfc67['push'](_0xfc67['shift']());}};_0x24ad9b(++_0x4f5357);}(_0xc518,0x1a1));var _0x8c51=function(_0x1cfad3,_0x16fda0){_0x1cfad3=_0x1cfad3-0x0;var _0x16ab1c=_0xc518[_0x1cfad3];return _0x16ab1c;};'use strict';var Sequelize=require(_0x8c51('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8c51('0x1')]},'active':{'type':Sequelize[_0x8c51('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8c51('0x1')],'allowNull':![],'defaultValue':_0x8c51('0x3')},'startAt':{'type':Sequelize[_0x8c51('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8c51('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x8c51('0x6')]('years',_0x8c51('0x7'),'months',_0x8c51('0x8'),_0x8c51('0x9'),_0x8c51('0xa'),_0x8c51('0xb')),'allowNull':![],'defaultValue':_0x8c51('0x9')},'output':{'type':Sequelize[_0x8c51('0x6')]('csv',_0x8c51('0xc'),_0x8c51('0xd')),'allowNull':![],'defaultValue':_0x8c51('0xe')},'type':{'type':Sequelize['ENUM'](_0x8c51('0xf'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x8c51('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x8c51('0x10')]},'bcc':{'type':Sequelize[_0x8c51('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x8c51('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 0fb4578..44be60c 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 _0x7253=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','Schedule','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','options','includeAll','include','rows','catch','merge','find','create','body','user'];(function(_0x59dd4f,_0x2a082f){var _0x1ff6d3=function(_0x23372c){while(--_0x23372c){_0x59dd4f['push'](_0x59dd4f['shift']());}};_0x1ff6d3(++_0x2a082f);}(_0x7253,0x159));var _0x3725=function(_0x294c73,_0x2801b2){_0x294c73=_0x294c73-0x0;var _0xc44764=_0x7253[_0x294c73];return _0xc44764;};'use strict';var emlformat=require(_0x3725('0x0'));var rimraf=require(_0x3725('0x1'));var zipdir=require(_0x3725('0x2'));var jsonpatch=require(_0x3725('0x3'));var rp=require(_0x3725('0x4'));var moment=require(_0x3725('0x5'));var BPromise=require(_0x3725('0x6'));var Mustache=require(_0x3725('0x7'));var util=require(_0x3725('0x8'));var path=require(_0x3725('0x9'));var sox=require(_0x3725('0xa'));var csv=require(_0x3725('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3725('0xc'));var _=require(_0x3725('0xd'));var squel=require(_0x3725('0xe'));var crypto=require(_0x3725('0xf'));var jsforce=require(_0x3725('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x3725('0xb'));var querystring=require('querystring');var Papa=require(_0x3725('0x11'));var Redis=require(_0x3725('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3725('0x13'));var as=require(_0x3725('0x14'));var hardwareService=require(_0x3725('0x15'));var logger=require(_0x3725('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x3725('0x17'));var licenseUtil=require(_0x3725('0x18'));var db=require(_0x3725('0x19'))['db'];function respondWithStatusCode(_0x412a3d,_0xcecdc5){_0xcecdc5=_0xcecdc5||0xcc;return function(_0x39acc8){if(_0x39acc8){return _0x412a3d[_0x3725('0x1a')](_0xcecdc5);}return _0x412a3d['status'](_0xcecdc5)[_0x3725('0x1b')]();};}function respondWithResult(_0x189d41,_0x5b93e9){_0x5b93e9=_0x5b93e9||0xc8;return function(_0x250db4){if(_0x250db4){return _0x189d41[_0x3725('0x1c')](_0x5b93e9)[_0x3725('0x1d')](_0x250db4);}};}function respondWithFilteredResult(_0x1bb3c5,_0x39fa05){return function(_0x291571){if(_0x291571){var _0x2058b9=typeof _0x39fa05[_0x3725('0x1e')]===_0x3725('0x1f')&&typeof _0x39fa05['limit']===_0x3725('0x1f');var _0x3fbc9f=_0x291571[_0x3725('0x20')];var _0x20080d=_0x2058b9?0x0:_0x39fa05[_0x3725('0x1e')];var _0x4e24d1=_0x2058b9?_0x291571['count']:_0x39fa05[_0x3725('0x1e')]+_0x39fa05[_0x3725('0x21')];var _0x2834be;if(_0x4e24d1>=_0x3fbc9f){_0x4e24d1=_0x3fbc9f;_0x2834be=0xc8;}else{_0x2834be=0xce;}_0x1bb3c5[_0x3725('0x1c')](_0x2834be);return _0x1bb3c5[_0x3725('0x22')](_0x3725('0x23'),_0x20080d+'-'+_0x4e24d1+'/'+_0x3fbc9f)['json'](_0x291571);}return null;};}function patchUpdates(_0x2151e8){return function(_0x1b839a){try{jsonpatch[_0x3725('0x24')](_0x1b839a,_0x2151e8,!![]);}catch(_0x46fe45){return BPromise['reject'](_0x46fe45);}return _0x1b839a['save']();};}function saveUpdates(_0x62644c,_0x426b92){return function(_0x1fa419){if(_0x1fa419){return _0x1fa419['update'](_0x62644c)[_0x3725('0x25')](function(_0x529c67){return _0x529c67;});}return null;};}function removeEntity(_0x50b56d,_0x2fec5c){return function(_0x560f98){if(_0x560f98){return _0x560f98[_0x3725('0x26')]()['then'](function(){var _0x287db9=_0x560f98[_0x3725('0x27')]({'plain':!![]});var _0x54fad2=_0x3725('0x28');return db[_0x3725('0x29')][_0x3725('0x26')]({'where':{'type':_0x54fad2,'resourceId':_0x287db9['id']}})[_0x3725('0x25')](function(){return _0x560f98;});})[_0x3725('0x25')](function(){_0x50b56d['status'](0xcc)[_0x3725('0x1b')]();});}};}function handleEntityNotFound(_0x209ad9,_0x5f3760){return function(_0x249b0a){if(!_0x249b0a){_0x209ad9[_0x3725('0x1a')](0x194);}return _0x249b0a;};}function handleError(_0x1e70d8,_0x47a2c3){_0x47a2c3=_0x47a2c3||0x1f4;return function(_0x519d31){logger['error'](_0x519d31[_0x3725('0x2a')]);if(_0x519d31['name']){delete _0x519d31[_0x3725('0x2b')];}_0x1e70d8['status'](_0x47a2c3)[_0x3725('0x2c')](_0x519d31);};}exports[_0x3725('0x2d')]=function(_0xf014b7,_0x405b95){var _0x9eb700={},_0x49fdf5={},_0xc383b4={'count':0x0,'rows':[]};var _0x437c17=_['map'](db[_0x3725('0x2e')][_0x3725('0x2f')],function(_0x521f4b){return{'name':_0x521f4b[_0x3725('0x30')],'type':_0x521f4b['type']['key']};});_0x49fdf5[_0x3725('0x31')]=_[_0x3725('0x32')](_0x437c17,_0x3725('0x2b'));_0x49fdf5[_0x3725('0x33')]=_[_0x3725('0x34')](_0xf014b7['query']);_0x49fdf5[_0x3725('0x35')]=_[_0x3725('0x36')](_0x49fdf5[_0x3725('0x31')],_0x49fdf5[_0x3725('0x33')]);_0x9eb700[_0x3725('0x37')]=_['intersection'](_0x49fdf5[_0x3725('0x31')],qs[_0x3725('0x38')](_0xf014b7['query'][_0x3725('0x38')]));_0x9eb700[_0x3725('0x37')]=_0x9eb700[_0x3725('0x37')][_0x3725('0x39')]?_0x9eb700[_0x3725('0x37')]:_0x49fdf5[_0x3725('0x31')];if(!_0xf014b7['query'][_0x3725('0x3a')]('nolimit')){_0x9eb700[_0x3725('0x21')]=qs[_0x3725('0x21')](_0xf014b7[_0x3725('0x33')][_0x3725('0x21')]);_0x9eb700[_0x3725('0x1e')]=qs[_0x3725('0x1e')](_0xf014b7['query']['offset']);}_0x9eb700[_0x3725('0x3b')]=qs[_0x3725('0x3c')](_0xf014b7[_0x3725('0x33')][_0x3725('0x3c')]);_0x9eb700[_0x3725('0x3d')]=qs['filters'](_[_0x3725('0x3e')](_0xf014b7[_0x3725('0x33')],_0x49fdf5['filters']),_0x437c17);if(_0xf014b7[_0x3725('0x33')]['filter']){_0x9eb700[_0x3725('0x3d')]=_['merge'](_0x9eb700[_0x3725('0x3d')],{'$or':_[_0x3725('0x32')](_0x437c17,function(_0x5b2125){if(_0x5b2125[_0x3725('0x3f')]!==_0x3725('0x40')){var _0x1b63ab={};_0x1b63ab[_0x5b2125[_0x3725('0x2b')]]={'$like':'%'+_0xf014b7[_0x3725('0x33')]['filter']+'%'};return _0x1b63ab;}})});}_0x9eb700=_['merge']({},_0x9eb700,_0xf014b7[_0x3725('0x41')]);var _0x178ac4={'where':_0x9eb700['where']};return db[_0x3725('0x2e')][_0x3725('0x20')](_0x178ac4)['then'](function(_0x43ec4f){_0xc383b4[_0x3725('0x20')]=_0x43ec4f;if(_0xf014b7[_0x3725('0x33')][_0x3725('0x42')]){_0x9eb700[_0x3725('0x43')]=[{'all':!![]}];}return db[_0x3725('0x2e')]['findAll'](_0x9eb700);})[_0x3725('0x25')](function(_0x4bd8e5){_0xc383b4[_0x3725('0x44')]=_0x4bd8e5;return _0xc383b4;})[_0x3725('0x25')](respondWithFilteredResult(_0x405b95,_0x9eb700))[_0x3725('0x45')](handleError(_0x405b95,null));};exports['show']=function(_0x5c5eec,_0xda581d){var _0x5ec93e={'raw':![],'where':{'id':_0x5c5eec['params']['id']}},_0x1d972c={};_0x1d972c[_0x3725('0x31')]=_[_0x3725('0x34')](db['Schedule'][_0x3725('0x2f')]);_0x1d972c[_0x3725('0x33')]=_['keys'](_0x5c5eec['query']);_0x1d972c['filters']=_[_0x3725('0x36')](_0x1d972c['model'],_0x1d972c['query']);_0x5ec93e[_0x3725('0x37')]=_[_0x3725('0x36')](_0x1d972c[_0x3725('0x31')],qs['fields'](_0x5c5eec[_0x3725('0x33')][_0x3725('0x38')]));_0x5ec93e[_0x3725('0x37')]=_0x5ec93e['attributes'][_0x3725('0x39')]?_0x5ec93e[_0x3725('0x37')]:_0x1d972c[_0x3725('0x31')];if(_0x5c5eec[_0x3725('0x33')]['includeAll']){_0x5ec93e[_0x3725('0x43')]=[{'all':!![]}];}_0x5ec93e=_[_0x3725('0x46')]({},_0x5ec93e,_0x5c5eec[_0x3725('0x41')]);return db[_0x3725('0x2e')][_0x3725('0x47')](_0x5ec93e)[_0x3725('0x25')](handleEntityNotFound(_0xda581d,null))[_0x3725('0x25')](respondWithResult(_0xda581d,null))['catch'](handleError(_0xda581d,null));};exports[_0x3725('0x48')]=function(_0x5eb4b7,_0x397263){return db[_0x3725('0x2e')][_0x3725('0x48')](_0x5eb4b7[_0x3725('0x49')],{})[_0x3725('0x25')](function(_0x13813d){var _0xea9db3=_0x5eb4b7[_0x3725('0x4a')][_0x3725('0x27')]({'plain':!![]});if(!_0xea9db3)throw new Error(_0x3725('0x4b'));if(_0xea9db3['role']===_0x3725('0x4a')){var _0x56213d=_0x13813d[_0x3725('0x27')]({'plain':!![]});var _0x20ee7b=_0x3725('0x28');return db[_0x3725('0x4c')][_0x3725('0x47')]({'where':{'name':_0x20ee7b,'userProfileId':_0xea9db3['userProfileId']},'raw':!![]})[_0x3725('0x25')](function(_0x22ed79){if(_0x22ed79&&_0x22ed79[_0x3725('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x56213d[_0x3725('0x2b')],'resourceId':_0x56213d['id'],'type':_0x22ed79['name'],'sectionId':_0x22ed79['id']},{})[_0x3725('0x25')](function(){return _0x13813d;});}else{return _0x13813d;}})[_0x3725('0x45')](function(_0x20e306){logger[_0x3725('0x4e')](_0x3725('0x4f'),_0x20e306);throw _0x20e306;});}return _0x13813d;})[_0x3725('0x25')](respondWithResult(_0x397263,0xc9))[_0x3725('0x45')](handleError(_0x397263,null));};exports[_0x3725('0x50')]=function(_0x49b340,_0x281dbc){if(_0x49b340[_0x3725('0x49')]['id']){delete _0x49b340[_0x3725('0x49')]['id'];}return db[_0x3725('0x2e')][_0x3725('0x47')]({'where':{'id':_0x49b340[_0x3725('0x51')]['id']}})[_0x3725('0x25')](handleEntityNotFound(_0x281dbc,null))[_0x3725('0x25')](saveUpdates(_0x49b340[_0x3725('0x49')],null))[_0x3725('0x25')](respondWithResult(_0x281dbc,null))['catch'](handleError(_0x281dbc,null));};exports['destroy']=function(_0x43bf73,_0x3b836a){return db[_0x3725('0x2e')]['find']({'where':{'id':_0x43bf73[_0x3725('0x51')]['id']}})[_0x3725('0x25')](handleEntityNotFound(_0x3b836a,null))[_0x3725('0x25')](removeEntity(_0x3b836a,null))[_0x3725('0x45')](handleError(_0x3b836a,null));};exports['run']=function(_0x39ba8b,_0x4ad79c,_0x16c2f5){var _0x142a69=require(_0x3725('0x52'));return db['Schedule']['find']({'where':{'id':_0x39ba8b[_0x3725('0x51')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4ad79c,null))['then'](function(){_0x142a69[_0x3725('0x53')](_0x39ba8b[_0x3725('0x51')]['id']);})[_0x3725('0x25')](respondWithStatusCode(_0x4ad79c,null))[_0x3725('0x45')](handleError(_0x4ad79c,null));}; \ No newline at end of file +var _0x95ba=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','includeAll','findAll','catch','show','params','rawAttributes','options','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','map','Schedule','fieldName','type','key','model','query','keys','filters'];(function(_0xcfc44,_0x179bc1){var _0x307a25=function(_0x2b64de){while(--_0x2b64de){_0xcfc44['push'](_0xcfc44['shift']());}};_0x307a25(++_0x179bc1);}(_0x95ba,0x11e));var _0xa95b=function(_0x5560b5,_0x56fb64){_0x5560b5=_0x5560b5-0x0;var _0x31d8f7=_0x95ba[_0x5560b5];return _0x31d8f7;};'use strict';var emlformat=require(_0xa95b('0x0'));var rimraf=require(_0xa95b('0x1'));var zipdir=require(_0xa95b('0x2'));var jsonpatch=require(_0xa95b('0x3'));var rp=require(_0xa95b('0x4'));var moment=require(_0xa95b('0x5'));var BPromise=require(_0xa95b('0x6'));var Mustache=require(_0xa95b('0x7'));var util=require(_0xa95b('0x8'));var path=require(_0xa95b('0x9'));var sox=require(_0xa95b('0xa'));var csv=require(_0xa95b('0xb'));var ejs=require(_0xa95b('0xc'));var fs=require('fs');var fs_extra=require(_0xa95b('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa95b('0xe'));var jsforce=require(_0xa95b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa95b('0xb'));var querystring=require(_0xa95b('0x10'));var Papa=require(_0xa95b('0x11'));var Redis=require(_0xa95b('0x12'));var authService=require(_0xa95b('0x13'));var qs=require(_0xa95b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa95b('0x15'));var logger=require(_0xa95b('0x16'))(_0xa95b('0x17'));var utils=require(_0xa95b('0x18'));var config=require(_0xa95b('0x19'));var licenseUtil=require(_0xa95b('0x1a'));var db=require(_0xa95b('0x1b'))['db'];function respondWithStatusCode(_0x288a7f,_0x574086){_0x574086=_0x574086||0xcc;return function(_0x21427f){if(_0x21427f){return _0x288a7f[_0xa95b('0x1c')](_0x574086);}return _0x288a7f['status'](_0x574086)['end']();};}function respondWithResult(_0x10d3d0,_0x5a3220){_0x5a3220=_0x5a3220||0xc8;return function(_0x4b2203){if(_0x4b2203){return _0x10d3d0[_0xa95b('0x1d')](_0x5a3220)[_0xa95b('0x1e')](_0x4b2203);}};}function respondWithFilteredResult(_0x1ef915,_0x458d87){return function(_0x1d6ebb){if(_0x1d6ebb){var _0x4d0b27=typeof _0x458d87[_0xa95b('0x1f')]===_0xa95b('0x20')&&typeof _0x458d87[_0xa95b('0x21')]==='undefined';var _0x18f7fa=_0x1d6ebb[_0xa95b('0x22')];var _0x2e6624=_0x4d0b27?0x0:_0x458d87['offset'];var _0x586710=_0x4d0b27?_0x1d6ebb[_0xa95b('0x22')]:_0x458d87[_0xa95b('0x1f')]+_0x458d87[_0xa95b('0x21')];var _0x56829d;if(_0x586710>=_0x18f7fa){_0x586710=_0x18f7fa;_0x56829d=0xc8;}else{_0x56829d=0xce;}_0x1ef915[_0xa95b('0x1d')](_0x56829d);return _0x1ef915[_0xa95b('0x23')](_0xa95b('0x24'),_0x2e6624+'-'+_0x586710+'/'+_0x18f7fa)['json'](_0x1d6ebb);}return null;};}function patchUpdates(_0x25f0b9){return function(_0xdf7148){try{jsonpatch['apply'](_0xdf7148,_0x25f0b9,!![]);}catch(_0x401266){return BPromise[_0xa95b('0x25')](_0x401266);}return _0xdf7148[_0xa95b('0x26')]();};}function saveUpdates(_0x299e5c,_0x39a337){return function(_0x5499d4){if(_0x5499d4){return _0x5499d4[_0xa95b('0x27')](_0x299e5c)[_0xa95b('0x28')](function(_0x3ec08e){return _0x3ec08e;});}return null;};}function removeEntity(_0x56312b,_0x5044f6){return function(_0x276b28){if(_0x276b28){return _0x276b28[_0xa95b('0x29')]()[_0xa95b('0x28')](function(){var _0x372e60=_0x276b28[_0xa95b('0x2a')]({'plain':!![]});var _0xda2e0d=_0xa95b('0x2b');return db[_0xa95b('0x2c')][_0xa95b('0x29')]({'where':{'type':_0xda2e0d,'resourceId':_0x372e60['id']}})[_0xa95b('0x28')](function(){return _0x276b28;});})[_0xa95b('0x28')](function(){_0x56312b[_0xa95b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc3b9,_0x258028){return function(_0x26431d){if(!_0x26431d){_0x2cc3b9[_0xa95b('0x1c')](0x194);}return _0x26431d;};}function handleError(_0x5306c1,_0x505aa2){_0x505aa2=_0x505aa2||0x1f4;return function(_0x49fe9f){logger['error'](_0x49fe9f[_0xa95b('0x2d')]);if(_0x49fe9f[_0xa95b('0x2e')]){delete _0x49fe9f['name'];}_0x5306c1[_0xa95b('0x1d')](_0x505aa2)[_0xa95b('0x2f')](_0x49fe9f);};}exports[_0xa95b('0x30')]=function(_0x154931,_0x199ebb){var _0x4e6a80={},_0x76b7a2={},_0x896dbf={'count':0x0,'rows':[]};var _0x48da25=_[_0xa95b('0x31')](db[_0xa95b('0x32')]['rawAttributes'],function(_0x3df2ff){return{'name':_0x3df2ff[_0xa95b('0x33')],'type':_0x3df2ff[_0xa95b('0x34')][_0xa95b('0x35')]};});_0x76b7a2[_0xa95b('0x36')]=_['map'](_0x48da25,_0xa95b('0x2e'));_0x76b7a2[_0xa95b('0x37')]=_[_0xa95b('0x38')](_0x154931[_0xa95b('0x37')]);_0x76b7a2[_0xa95b('0x39')]=_[_0xa95b('0x3a')](_0x76b7a2[_0xa95b('0x36')],_0x76b7a2[_0xa95b('0x37')]);_0x4e6a80[_0xa95b('0x3b')]=_[_0xa95b('0x3a')](_0x76b7a2[_0xa95b('0x36')],qs[_0xa95b('0x3c')](_0x154931[_0xa95b('0x37')]['fields']));_0x4e6a80[_0xa95b('0x3b')]=_0x4e6a80[_0xa95b('0x3b')][_0xa95b('0x3d')]?_0x4e6a80[_0xa95b('0x3b')]:_0x76b7a2[_0xa95b('0x36')];if(!_0x154931[_0xa95b('0x37')][_0xa95b('0x3e')](_0xa95b('0x3f'))){_0x4e6a80['limit']=qs[_0xa95b('0x21')](_0x154931[_0xa95b('0x37')][_0xa95b('0x21')]);_0x4e6a80['offset']=qs['offset'](_0x154931['query']['offset']);}_0x4e6a80[_0xa95b('0x40')]=qs[_0xa95b('0x41')](_0x154931[_0xa95b('0x37')]['sort']);_0x4e6a80['where']=qs[_0xa95b('0x39')](_[_0xa95b('0x42')](_0x154931[_0xa95b('0x37')],_0x76b7a2[_0xa95b('0x39')]),_0x48da25);if(_0x154931[_0xa95b('0x37')][_0xa95b('0x43')]){_0x4e6a80['where']=_[_0xa95b('0x44')](_0x4e6a80[_0xa95b('0x45')],{'$or':_[_0xa95b('0x31')](_0x48da25,function(_0x29130e){if(_0x29130e[_0xa95b('0x34')]!=='VIRTUAL'){var _0x3999b0={};_0x3999b0[_0x29130e[_0xa95b('0x2e')]]={'$like':'%'+_0x154931[_0xa95b('0x37')][_0xa95b('0x43')]+'%'};return _0x3999b0;}})});}_0x4e6a80=_[_0xa95b('0x44')]({},_0x4e6a80,_0x154931['options']);var _0x1429dd={'where':_0x4e6a80[_0xa95b('0x45')]};return db[_0xa95b('0x32')][_0xa95b('0x22')](_0x1429dd)[_0xa95b('0x28')](function(_0x2f07d0){_0x896dbf[_0xa95b('0x22')]=_0x2f07d0;if(_0x154931[_0xa95b('0x37')][_0xa95b('0x46')]){_0x4e6a80['include']=[{'all':!![]}];}return db['Schedule'][_0xa95b('0x47')](_0x4e6a80);})[_0xa95b('0x28')](function(_0x4f04ee){_0x896dbf['rows']=_0x4f04ee;return _0x896dbf;})[_0xa95b('0x28')](respondWithFilteredResult(_0x199ebb,_0x4e6a80))[_0xa95b('0x48')](handleError(_0x199ebb,null));};exports[_0xa95b('0x49')]=function(_0x456cde,_0x4c4a5d){var _0x529324={'raw':![],'where':{'id':_0x456cde[_0xa95b('0x4a')]['id']}},_0x5a024b={};_0x5a024b[_0xa95b('0x36')]=_[_0xa95b('0x38')](db[_0xa95b('0x32')][_0xa95b('0x4b')]);_0x5a024b[_0xa95b('0x37')]=_[_0xa95b('0x38')](_0x456cde[_0xa95b('0x37')]);_0x5a024b[_0xa95b('0x39')]=_[_0xa95b('0x3a')](_0x5a024b[_0xa95b('0x36')],_0x5a024b[_0xa95b('0x37')]);_0x529324[_0xa95b('0x3b')]=_[_0xa95b('0x3a')](_0x5a024b[_0xa95b('0x36')],qs[_0xa95b('0x3c')](_0x456cde[_0xa95b('0x37')][_0xa95b('0x3c')]));_0x529324[_0xa95b('0x3b')]=_0x529324[_0xa95b('0x3b')][_0xa95b('0x3d')]?_0x529324[_0xa95b('0x3b')]:_0x5a024b[_0xa95b('0x36')];if(_0x456cde[_0xa95b('0x37')][_0xa95b('0x46')]){_0x529324['include']=[{'all':!![]}];}_0x529324=_['merge']({},_0x529324,_0x456cde[_0xa95b('0x4c')]);return db[_0xa95b('0x32')][_0xa95b('0x4d')](_0x529324)[_0xa95b('0x28')](handleEntityNotFound(_0x4c4a5d,null))['then'](respondWithResult(_0x4c4a5d,null))['catch'](handleError(_0x4c4a5d,null));};exports[_0xa95b('0x4e')]=function(_0x317b6b,_0x5ef1ce){return db[_0xa95b('0x32')]['create'](_0x317b6b['body'],{})[_0xa95b('0x28')](function(_0x251552){var _0x3b1fca=_0x317b6b[_0xa95b('0x4f')][_0xa95b('0x2a')]({'plain':!![]});if(!_0x3b1fca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b1fca['role']===_0xa95b('0x4f')){var _0x34fdde=_0x251552[_0xa95b('0x2a')]({'plain':!![]});var _0x310184=_0xa95b('0x2b');return db[_0xa95b('0x50')]['find']({'where':{'name':_0x310184,'userProfileId':_0x3b1fca[_0xa95b('0x51')]},'raw':!![]})[_0xa95b('0x28')](function(_0x5c182a){if(_0x5c182a&&_0x5c182a[_0xa95b('0x52')]===0x0){return db[_0xa95b('0x2c')][_0xa95b('0x4e')]({'name':_0x34fdde[_0xa95b('0x2e')],'resourceId':_0x34fdde['id'],'type':_0x5c182a[_0xa95b('0x2e')],'sectionId':_0x5c182a['id']},{})['then'](function(){return _0x251552;});}else{return _0x251552;}})[_0xa95b('0x48')](function(_0xa6768){logger['error'](_0xa95b('0x53'),_0xa6768);throw _0xa6768;});}return _0x251552;})[_0xa95b('0x28')](respondWithResult(_0x5ef1ce,0xc9))[_0xa95b('0x48')](handleError(_0x5ef1ce,null));};exports['update']=function(_0x418d34,_0x2a8135){if(_0x418d34[_0xa95b('0x54')]['id']){delete _0x418d34[_0xa95b('0x54')]['id'];}return db[_0xa95b('0x32')][_0xa95b('0x4d')]({'where':{'id':_0x418d34['params']['id']}})[_0xa95b('0x28')](handleEntityNotFound(_0x2a8135,null))['then'](saveUpdates(_0x418d34[_0xa95b('0x54')],null))[_0xa95b('0x28')](respondWithResult(_0x2a8135,null))['catch'](handleError(_0x2a8135,null));};exports[_0xa95b('0x29')]=function(_0x39e6e7,_0x3cc297){return db[_0xa95b('0x32')]['find']({'where':{'id':_0x39e6e7['params']['id']}})[_0xa95b('0x28')](handleEntityNotFound(_0x3cc297,null))[_0xa95b('0x28')](removeEntity(_0x3cc297,null))['catch'](handleError(_0x3cc297,null));};exports[_0xa95b('0x55')]=function(_0x569487,_0x379fd8,_0x9cd856){var _0x41324b=require('../../config/schedule');return db[_0xa95b('0x32')][_0xa95b('0x4d')]({'where':{'id':_0x569487[_0xa95b('0x4a')]['id']},'raw':!![]})[_0xa95b('0x28')](handleEntityNotFound(_0x379fd8,null))[_0xa95b('0x28')](function(){_0x41324b[_0xa95b('0x55')](_0x569487[_0xa95b('0x4a')]['id']);})[_0xa95b('0x28')](respondWithStatusCode(_0x379fd8,null))['catch'](handleError(_0x379fd8,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index a89fe18..4c44f83 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 _0x61b7=['bluebird','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules','lodash','util','../../config/logger'];(function(_0x293b78,_0x42c367){var _0x2b63c1=function(_0x14d912){while(--_0x14d912){_0x293b78['push'](_0x293b78['shift']());}};_0x2b63c1(++_0x42c367);}(_0x61b7,0x194));var _0x761b=function(_0x2a4e01,_0x177610){_0x2a4e01=_0x2a4e01-0x0;var _0x58e960=_0x61b7[_0x2a4e01];return _0x58e960;};'use strict';var _=require(_0x761b('0x0'));var util=require(_0x761b('0x1'));var logger=require(_0x761b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x761b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x761b('0x4'));var rimraf=require(_0x761b('0x5'));var config=require(_0x761b('0x6'));var attributes=require(_0x761b('0x7'));module['exports']=function(_0x245920,_0x5bfb97){return _0x245920[_0x761b('0x8')](_0x761b('0x9'),attributes,{'tableName':_0x761b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c90=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','bluebird'];(function(_0x5e4f7c,_0x4a990a){var _0x55a20b=function(_0x1bd3eb){while(--_0x1bd3eb){_0x5e4f7c['push'](_0x5e4f7c['shift']());}};_0x55a20b(++_0x4a990a);}(_0x2c90,0x181));var _0x02c9=function(_0x326ad1,_0x289898){_0x326ad1=_0x326ad1-0x0;var _0x4683d1=_0x2c90[_0x326ad1];return _0x4683d1;};'use strict';var _=require(_0x02c9('0x0'));var util=require(_0x02c9('0x1'));var logger=require(_0x02c9('0x2'))(_0x02c9('0x3'));var moment=require('moment');var BPromise=require(_0x02c9('0x4'));var rp=require(_0x02c9('0x5'));var fs=require('fs');var path=require(_0x02c9('0x6'));var rimraf=require(_0x02c9('0x7'));var config=require(_0x02c9('0x8'));var attributes=require(_0x02c9('0x9'));module[_0x02c9('0xa')]=function(_0x5316b5,_0x4cc415){return _0x5316b5[_0x02c9('0xb')](_0x02c9('0xc'),attributes,{'tableName':'tools_schedules','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 2bb0b7a..d7307e3 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 _0x6c7f=['../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x342eea,_0x390da7){var _0x5b7094=function(_0x378f70){while(--_0x378f70){_0x342eea['push'](_0x342eea['shift']());}};_0x5b7094(++_0x390da7);}(_0x6c7f,0x93));var _0xf6c7=function(_0x3a7ece,_0x52dbca){_0x3a7ece=_0x3a7ece-0x0;var _0x52f617=_0x6c7f[_0x3a7ece];return _0x52f617;};'use strict';var _=require(_0xf6c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf6c7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6c7('0x2'))['db'];var utils=require(_0xf6c7('0x3'));var logger=require(_0xf6c7('0x4'))('rpc');var config=require(_0xf6c7('0x5'));var jayson=require(_0xf6c7('0x6'));var client=jayson['client'][_0xf6c7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x485f75,_0x4602e6,_0xbbf5ad){return new BPromise(function(_0x9bba2,_0x482b78){return client[_0xf6c7('0x8')](_0x485f75,_0xbbf5ad)[_0xf6c7('0x9')](function(_0x1d2613){logger[_0xf6c7('0xa')](_0xf6c7('0xb'),_0x4602e6,_0xf6c7('0xc'));logger[_0xf6c7('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4602e6,'request\x20sent',JSON[_0xf6c7('0xe')](_0x1d2613));if(_0x1d2613['error']){if(_0x1d2613[_0xf6c7('0xf')]['code']===0x1f4){logger[_0xf6c7('0xf')](_0xf6c7('0xb'),_0x4602e6,_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);return _0x482b78(_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);}logger['error'](_0xf6c7('0xb'),_0x4602e6,_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);return _0x9bba2(_0x1d2613[_0xf6c7('0xf')][_0xf6c7('0x10')]);}else{logger[_0xf6c7('0xa')](_0xf6c7('0xb'),_0x4602e6,'request\x20sent');_0x9bba2(_0x1d2613[_0xf6c7('0x11')]['message']);}})[_0xf6c7('0x12')](function(_0xda01dd){logger[_0xf6c7('0xf')]('Schedule,\x20%s,\x20%s',_0x4602e6,_0xda01dd);_0x482b78(_0xda01dd);});});} \ No newline at end of file +var _0xe6d9=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5f2fea,_0x9fde07){var _0x198a0c=function(_0x2bb11a){while(--_0x2bb11a){_0x5f2fea['push'](_0x5f2fea['shift']());}};_0x198a0c(++_0x9fde07);}(_0xe6d9,0x9d));var _0x9e6d=function(_0x243c52,_0x496529){_0x243c52=_0x243c52-0x0;var _0x492280=_0xe6d9[_0x243c52];return _0x492280;};'use strict';var _=require(_0x9e6d('0x0'));var util=require(_0x9e6d('0x1'));var moment=require(_0x9e6d('0x2'));var BPromise=require(_0x9e6d('0x3'));var rs=require(_0x9e6d('0x4'));var fs=require('fs');var Redis=require(_0x9e6d('0x5'));var db=require(_0x9e6d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e6d('0x7'))(_0x9e6d('0x8'));var config=require('../../config/environment');var jayson=require(_0x9e6d('0x9'));var client=jayson[_0x9e6d('0xa')][_0x9e6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9dc81,_0x5f25fa,_0x1b58ba){return new BPromise(function(_0x18e8fa,_0x1c6bb4){return client[_0x9e6d('0xc')](_0x9dc81,_0x1b58ba)[_0x9e6d('0xd')](function(_0x4c0bad){logger[_0x9e6d('0xe')](_0x9e6d('0xf'),_0x5f25fa,'request\x20sent');logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x5f25fa,_0x9e6d('0x10'),JSON[_0x9e6d('0x11')](_0x4c0bad));if(_0x4c0bad[_0x9e6d('0x12')]){if(_0x4c0bad['error']['code']===0x1f4){logger['error'](_0x9e6d('0xf'),_0x5f25fa,_0x4c0bad[_0x9e6d('0x12')][_0x9e6d('0x13')]);return _0x1c6bb4(_0x4c0bad[_0x9e6d('0x12')][_0x9e6d('0x13')]);}logger['error'](_0x9e6d('0xf'),_0x5f25fa,_0x4c0bad[_0x9e6d('0x12')][_0x9e6d('0x13')]);return _0x18e8fa(_0x4c0bad['error']['message']);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x5f25fa,_0x9e6d('0x10'));_0x18e8fa(_0x4c0bad[_0x9e6d('0x14')][_0x9e6d('0x13')]);}})[_0x9e6d('0x15')](function(_0x295031){logger[_0x9e6d('0x12')](_0x9e6d('0xf'),_0x5f25fa,_0x295031);_0x1c6bb4(_0x295031);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 7c0be97..9cc68a8 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 _0xf965=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','put'];(function(_0x2db63a,_0x52ee8e){var _0x556b91=function(_0x4ad3aa){while(--_0x4ad3aa){_0x2db63a['push'](_0x2db63a['shift']());}};_0x556b91(++_0x52ee8e);}(_0xf965,0xb6));var _0x5f96=function(_0x27875e,_0x588823){_0x27875e=_0x27875e-0x0;var _0x3882ca=_0xf965[_0x27875e];return _0x3882ca;};'use strict';var multer=require(_0x5f96('0x0'));var util=require(_0x5f96('0x1'));var path=require(_0x5f96('0x2'));var timeout=require(_0x5f96('0x3'));var express=require(_0x5f96('0x4'));var router=express[_0x5f96('0x5')]();var fs_extra=require(_0x5f96('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5f96('0x7'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x5f96('0x8')]('/',auth[_0x5f96('0x9')](),controller[_0x5f96('0xa')]);router[_0x5f96('0x8')](_0x5f96('0xb'),auth[_0x5f96('0x9')](),controller['describe']);router['get'](_0x5f96('0xc'),auth[_0x5f96('0x9')](),controller[_0x5f96('0xd')]);router['get'](_0x5f96('0xe'),auth[_0x5f96('0x9')](),controller[_0x5f96('0xf')]);router[_0x5f96('0x10')]('/',auth[_0x5f96('0x9')](),controller['create']);router[_0x5f96('0x11')](_0x5f96('0xc'),auth[_0x5f96('0x9')](),controller['update']);router['delete'](_0x5f96('0xc'),auth[_0x5f96('0x9')](),controller[_0x5f96('0x12')]);module[_0x5f96('0x13')]=router; \ No newline at end of file +var _0xff3f=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','exports'];(function(_0x1f74e7,_0x5efe6b){var _0x139a69=function(_0x3ab5da){while(--_0x3ab5da){_0x1f74e7['push'](_0x1f74e7['shift']());}};_0x139a69(++_0x5efe6b);}(_0xff3f,0x190));var _0xfff3=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0xff3f[_0x2d4421];return _0x2d3b01;};'use strict';var multer=require(_0xfff3('0x0'));var util=require(_0xfff3('0x1'));var path=require(_0xfff3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfff3('0x3')]();var fs_extra=require(_0xfff3('0x4'));var auth=require(_0xfff3('0x5'));var interaction=require(_0xfff3('0x6'));var config=require(_0xfff3('0x7'));var controller=require(_0xfff3('0x8'));router[_0xfff3('0x9')]('/',auth[_0xfff3('0xa')](),controller[_0xfff3('0xb')]);router['get'](_0xfff3('0xc'),auth[_0xfff3('0xa')](),controller['describe']);router[_0xfff3('0x9')](_0xfff3('0xd'),auth[_0xfff3('0xa')](),controller[_0xfff3('0xe')]);router[_0xfff3('0x9')]('/:id/download',auth[_0xfff3('0xa')](),controller['download']);router[_0xfff3('0xf')]('/',auth[_0xfff3('0xa')](),controller[_0xfff3('0x10')]);router[_0xfff3('0x11')](_0xfff3('0xd'),auth[_0xfff3('0xa')](),controller['update']);router[_0xfff3('0x12')](_0xfff3('0xd'),auth[_0xfff3('0xa')](),controller['destroy']);module[_0xfff3('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 12cdef9..588109a 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 _0x7669=['path','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','startedAt','toString','format','MM-DD-YYYY\x20HH:mm','DATE','createdAt','sequelize','moment'];(function(_0x18432e,_0x57521b){var _0x189dc5=function(_0x303bde){while(--_0x303bde){_0x18432e['push'](_0x18432e['shift']());}};_0x189dc5(++_0x57521b);}(_0x7669,0xe5));var _0x9766=function(_0x44c097,_0x4f09e5){_0x44c097=_0x44c097-0x0;var _0x253779=_0x7669[_0x44c097];return _0x253779;};'use strict';var Sequelize=require(_0x9766('0x0'));var moment=require(_0x9766('0x1'));var path=require(_0x9766('0x2'));var config=require('../../config/environment');module[_0x9766('0x3')]={'format':{'type':Sequelize[_0x9766('0x4')],'get':function(){return this[_0x9766('0x5')](_0x9766('0x6'))?path[_0x9766('0x7')](this[_0x9766('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x9766('0x8')]},'channel':{'type':Sequelize[_0x9766('0x8')]},'value':{'type':Sequelize[_0x9766('0x8')],'set':function(_0x251329){var _0x4f85e7=_0x251329[_0x9766('0x9')](/\\/g,'/');this[_0x9766('0xa')](_0x9766('0x6'),_0x4f85e7);}},'rating':{'type':Sequelize[_0x9766('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9766('0xb')],'set':function(_0x5cb787){this[_0x9766('0xa')]('startedAt',moment()[_0x9766('0xc')](_0x5cb787,'ms'));this['setDataValue'](_0x9766('0xd'),moment());this['setDataValue'](_0x9766('0xe'),_0x5cb787);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9766('0x5')](_0x9766('0xf')))['format']('MM-DD-YYYY\x20HH:mm')[_0x9766('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x9766('0x5')]('closedAt'))[_0x9766('0x11')](_0x9766('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x9766('0x13')],'get':function(){return moment(this['getDataValue'](_0x9766('0x14')))[_0x9766('0x11')](_0x9766('0x12'))[_0x9766('0x10')]();}},'updatedAt':{'type':Sequelize[_0x9766('0x13')],'get':function(){return moment(this[_0x9766('0x5')]('updatedAt'))[_0x9766('0x11')](_0x9766('0x12'))[_0x9766('0x10')]();}}}; \ No newline at end of file +var _0x236c=['DATE','format','toString','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','duration'];(function(_0x16c1a5,_0x17dfb0){var _0x421b5e=function(_0x2813d2){while(--_0x2813d2){_0x16c1a5['push'](_0x16c1a5['shift']());}};_0x421b5e(++_0x17dfb0);}(_0x236c,0x155));var _0xc236=function(_0x5ac8e6,_0x1983c8){_0x5ac8e6=_0x5ac8e6-0x0;var _0x52a564=_0x236c[_0x5ac8e6];return _0x52a564;};'use strict';var Sequelize=require(_0xc236('0x0'));var moment=require('moment');var path=require(_0xc236('0x1'));var config=require(_0xc236('0x2'));module[_0xc236('0x3')]={'format':{'type':Sequelize[_0xc236('0x4')],'get':function(){return this[_0xc236('0x5')]('value')?path[_0xc236('0x6')](this[_0xc236('0x5')](_0xc236('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xc236('0x8')]},'channel':{'type':Sequelize[_0xc236('0x8')]},'value':{'type':Sequelize[_0xc236('0x8')],'set':function(_0x5abd65){var _0xd612c6=_0x5abd65[_0xc236('0x9')](/\\/g,'/');this['setDataValue']('value',_0xd612c6);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc236('0xa')],'set':function(_0x4b8dc6){this[_0xc236('0xb')](_0xc236('0xc'),moment()[_0xc236('0xd')](_0x4b8dc6,'ms'));this[_0xc236('0xb')](_0xc236('0xe'),moment());this['setDataValue'](_0xc236('0xf'),_0x4b8dc6);}},'startedAt':{'type':Sequelize[_0xc236('0x10')],'get':function(){return moment(this['getDataValue'](_0xc236('0xc')))[_0xc236('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xc236('0x12')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xc236('0xe')))[_0xc236('0x11')](_0xc236('0x13'))[_0xc236('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc236('0x5')]('createdAt'))['format'](_0xc236('0x13'))[_0xc236('0x12')]();}},'updatedAt':{'type':Sequelize[_0xc236('0x10')],'get':function(){return moment(this[_0xc236('0x5')](_0xc236('0x14')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index b361160..b0e6782 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 _0x1cb9=['ValidationError','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','keys','length','include','options','find','create','body','duration','createdAt','value','params','describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize'];(function(_0x1d9dfe,_0x556a07){var _0x1f9c68=function(_0x59be7d){while(--_0x59be7d){_0x1d9dfe['push'](_0x1d9dfe['shift']());}};_0x1f9c68(++_0x556a07);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1bd383,_0x25e163){_0x1bd383=_0x1bd383-0x0;var _0x471b5d=_0x1cb9[_0x1bd383];return _0x471b5d;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x33')](_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29')),[_0x91cb('0x34')]);_0x504275[_0x91cb('0x35')]=_['keys'](_0x3b3ee6[_0x91cb('0x35')]);_0x504275[_0x91cb('0x36')]=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x35')]);_0x468908['attributes']=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x38')]));_0x468908['attributes']=_0x468908[_0x91cb('0x39')]['length']?_0x468908['attributes']:_0x504275['model'];if(!_0x3b3ee6[_0x91cb('0x35')]['hasOwnProperty'](_0x91cb('0x3a'))){_0x468908['limit']=qs['limit'](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x1d')]);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x35')]['offset']);}_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3c')]);_0x468908['where']=qs['filters'](_[_0x91cb('0x3d')](_0x3b3ee6[_0x91cb('0x35')],_0x504275['filters']),_0x52670a);if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]){_0x468908['where']=_[_0x91cb('0x3f')](_0x468908[_0x91cb('0x40')],{'$or':_['map'](_0x52670a,function(_0x43d4fe){if(_0x43d4fe['type']!==_0x91cb('0x41')){var _0xabe6a3={};_0xabe6a3[_0x43d4fe[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]+'%'};return _0xabe6a3;}})});}_0x468908=_[_0x91cb('0x3f')]({},_0x468908,_0x3b3ee6['options']);var _0xa90111={'where':_0x468908[_0x91cb('0x40')]};return db['ScreenRecording'][_0x91cb('0x1e')](_0xa90111)['then'](function(_0x2c6102){_0x2f04a3[_0x91cb('0x1e')]=_0x2c6102;if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x42')]){_0x468908['include']=[{'all':!![]}];}return db[_0x91cb('0x2d')][_0x91cb('0x43')](_0x468908);})[_0x91cb('0x25')](function(_0x37e777){_0x2f04a3[_0x91cb('0x44')]=_0x37e777;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x45')](handleError(_0x2fb473,null));};exports[_0x91cb('0x46')]=function(_0x325dca,_0x3cc4c1){var _0x49bc42={'raw':![],'where':{'id':_0x325dca['params']['id']}},_0x16993f={};_0x16993f[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x16993f[_0x91cb('0x35')]=_[_0x91cb('0x47')](_0x325dca[_0x91cb('0x35')]);_0x16993f[_0x91cb('0x36')]=_['intersection'](_0x16993f[_0x91cb('0x32')],_0x16993f[_0x91cb('0x35')]);_0x49bc42['attributes']=_[_0x91cb('0x37')](_0x16993f[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x325dca[_0x91cb('0x35')][_0x91cb('0x38')]));_0x49bc42[_0x91cb('0x39')]=_0x49bc42[_0x91cb('0x39')][_0x91cb('0x48')]?_0x49bc42[_0x91cb('0x39')]:_0x16993f['model'];if(_0x325dca[_0x91cb('0x35')][_0x91cb('0x42')]){_0x49bc42[_0x91cb('0x49')]=[{'all':!![]}];}_0x49bc42=_[_0x91cb('0x3f')]({},_0x49bc42,_0x325dca[_0x91cb('0x4a')]);return db[_0x91cb('0x2d')][_0x91cb('0x4b')](_0x49bc42)[_0x91cb('0x25')](handleEntityNotFound(_0x3cc4c1,null))['then'](respondWithResult(_0x3cc4c1,null))[_0x91cb('0x45')](handleError(_0x3cc4c1,null));};exports[_0x91cb('0x4c')]=function(_0x2b8b7f,_0x3b8cfd){return db['ScreenRecording'][_0x91cb('0x4c')](_0x2b8b7f[_0x91cb('0x4d')],{})['then'](respondWithResult(_0x3b8cfd,0xc9))[_0x91cb('0x45')](handleError(_0x3b8cfd,null));};exports['update']=function(_0x2c419b,_0x4c0acd){if(_0x2c419b['body']['id']){delete _0x2c419b['body']['id'];}delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4e')];delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4f')];delete _0x2c419b[_0x91cb('0x4d')]['closedAt'];delete _0x2c419b['body'][_0x91cb('0x50')];return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x2c419b[_0x91cb('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c0acd,null))['then'](saveUpdates(_0x2c419b['body'],null))[_0x91cb('0x25')](respondWithResult(_0x4c0acd,null))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x52')]=function(_0x4aa670,_0x21463a){return db[_0x91cb('0x2d')][_0x91cb('0x52')]()[_0x91cb('0x25')](respondWithResult(_0x21463a,null))[_0x91cb('0x45')](handleError(_0x21463a,null));};exports[_0x91cb('0x53')]=function(_0x3ec250,_0x30fd4e,_0xff7c3f){var _0x20fc0a=require(_0x91cb('0x54'));var _0x5752ed=![];var _0x1e445a={};if(_0x3ec250[_0x91cb('0x35')]['type']&&_0x3ec250[_0x91cb('0x35')][_0x91cb('0x30')]==='uniqueid'){_0x1e445a[_0x91cb('0x55')]=_0x3ec250[_0x91cb('0x51')]['id'];}else{_0x1e445a['id']=_0x3ec250[_0x91cb('0x51')]['id'];}return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':_0x1e445a,'attributes':['id',_0x91cb('0x50')],'raw':!![]})[_0x91cb('0x25')](handleEntityNotFound(_0x30fd4e,null))[_0x91cb('0x25')](function(_0x3320bd){if(_0x3320bd){var _0x93ef52=path[_0x91cb('0x56')](config['root'],_0x91cb('0x57'),_0x3320bd['value']);var _0x37221e=util['format'](_0x91cb('0x58'),_0x93ef52);if(fs[_0x91cb('0x59')](_0x37221e)){_0x5752ed=!![];return _0x20fc0a[_0x91cb('0x5a')](_0x37221e,_0x93ef52,config['secrets'][_0x91cb('0x5b')])[_0x91cb('0x25')](function(){return _0x3320bd;});}return _0x3320bd;}})['then'](function(_0xef4754){if(_0xef4754){var _0x102025=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],'server/files/screen_recordings',_0xef4754[_0x91cb('0x50')]);if(!fs[_0x91cb('0x59')](_0x102025)){throw new db[(_0x91cb('0x5d'))][(_0x91cb('0x5e'))]('ScreenRecording\x20not\x20found');}if(_0xef4754[_0x91cb('0x5f')]){return _0x30fd4e[_0x91cb('0x53')](_0x102025,_0xef4754['filename']+path['extname'](_0x102025),function(){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}else{return _0x30fd4e['download'](_0x102025,function(_0x1180ac){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}}})['catch'](function(_0x4f19c8){if(_0x4f19c8[_0x91cb('0x61')]==='ScreenRecording\x20not\x20found'){_0x30fd4e[_0x91cb('0x1a')](0x194)[_0x91cb('0x2a')](_0x91cb('0x62'));}else{return handleError(_0x30fd4e,null);}});};exports['destroy']=function(_0x22fea8,_0x524400){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x22fea8[_0x91cb('0x51')]['id']}})[_0x91cb('0x25')](function(_0x483172){if(_[_0x91cb('0x63')](_0x483172)){throw new ReferenceError(_0x91cb('0x64'));}return _0x483172;})[_0x91cb('0x25')](function(_0x443c72){var _0xaf70c5=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],_0x91cb('0x57'),_0x443c72[_0x91cb('0x50')]);logger[_0x91cb('0x65')](_0x91cb('0x66'),_0xaf70c5);if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger[_0x91cb('0x65')](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}_0xaf70c5=_0xaf70c5+_0x91cb('0x6a');if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger['info'](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}return _0x443c72;})[_0x91cb('0x25')](function(_0x48fcfe){if(!_0x48fcfe)throw new InternalError();return _0x48fcfe[_0x91cb('0x26')]();})[_0x91cb('0x25')](function(){_0x524400[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();})[_0x91cb('0x45')](handleError(_0x524400,null));}; \ No newline at end of file +var _0x032e=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ScreenRecording','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','eml-format','zip-dir','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0xf617bf,_0x47a280){var _0x26722a=function(_0x451cda){while(--_0x451cda){_0xf617bf['push'](_0xf617bf['shift']());}};_0x26722a(++_0x47a280);}(_0x032e,0x124));var _0xe032=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x032e[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['ScreenRecording'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_[_0xe032('0x30')](_0x4e8b72,_0xe032('0x29')),[_0xe032('0x31')]);_0x469290['query']=_[_0xe032('0x32')](_0x5573e4[_0xe032('0x33')]);_0x469290[_0xe032('0x34')]=_[_0xe032('0x35')](_0x469290['model'],_0x469290[_0xe032('0x33')]);_0x38e7ea['attributes']=_[_0xe032('0x35')](_0x469290['model'],qs[_0xe032('0x36')](_0x5573e4['query'][_0xe032('0x36')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x37')][_0xe032('0x38')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x2e')];if(!_0x5573e4[_0xe032('0x33')][_0xe032('0x39')](_0xe032('0x3a'))){_0x38e7ea['limit']=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea[_0xe032('0x1f')]=qs['offset'](_0x5573e4[_0xe032('0x33')][_0xe032('0x1f')]);}_0x38e7ea['order']=qs[_0xe032('0x3b')](_0x5573e4[_0xe032('0x33')][_0xe032('0x3b')]);_0x38e7ea[_0xe032('0x3c')]=qs[_0xe032('0x34')](_[_0xe032('0x3d')](_0x5573e4[_0xe032('0x33')],_0x469290[_0xe032('0x34')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x33')][_0xe032('0x3e')]){_0x38e7ea[_0xe032('0x3c')]=_[_0xe032('0x3f')](_0x38e7ea[_0xe032('0x3c')],{'$or':_[_0xe032('0x30')](_0x4e8b72,function(_0x39af44){if(_0x39af44[_0xe032('0x2d')]!==_0xe032('0x40')){var _0x555914={};_0x555914[_0x39af44[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3e')]+'%'};return _0x555914;}})});}_0x38e7ea=_[_0xe032('0x3f')]({},_0x38e7ea,_0x5573e4[_0xe032('0x41')]);var _0x119790={'where':_0x38e7ea[_0xe032('0x3c')]};return db['ScreenRecording'][_0xe032('0x22')](_0x119790)['then'](function(_0x46ea84){_0xae116e['count']=_0x46ea84;if(_0x5573e4[_0xe032('0x33')][_0xe032('0x42')]){_0x38e7ea[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')]['findAll'](_0x38e7ea);})[_0xe032('0x27')](function(_0x5a6450){_0xae116e[_0xe032('0x45')]=_0x5a6450;return _0xae116e;})[_0xe032('0x27')](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x46')](handleError(_0x3e2575,null));};exports[_0xe032('0x47')]=function(_0x4b58eb,_0x513b0c){var _0x45345d={'raw':![],'where':{'id':_0x4b58eb['params']['id']}},_0x203021={};_0x203021[_0xe032('0x2e')]=_[_0xe032('0x32')](db[_0xe032('0x44')][_0xe032('0x2b')]);_0x203021[_0xe032('0x33')]=_['keys'](_0x4b58eb[_0xe032('0x33')]);_0x203021[_0xe032('0x34')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],_0x203021[_0xe032('0x33')]);_0x45345d[_0xe032('0x37')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],qs['fields'](_0x4b58eb['query'][_0xe032('0x36')]));_0x45345d['attributes']=_0x45345d[_0xe032('0x37')][_0xe032('0x38')]?_0x45345d[_0xe032('0x37')]:_0x203021[_0xe032('0x2e')];if(_0x4b58eb[_0xe032('0x33')][_0xe032('0x42')]){_0x45345d[_0xe032('0x43')]=[{'all':!![]}];}_0x45345d=_[_0xe032('0x3f')]({},_0x45345d,_0x4b58eb[_0xe032('0x41')]);return db['ScreenRecording'][_0xe032('0x48')](_0x45345d)['then'](handleEntityNotFound(_0x513b0c,null))['then'](respondWithResult(_0x513b0c,null))[_0xe032('0x46')](handleError(_0x513b0c,null));};exports[_0xe032('0x49')]=function(_0x62bfc8,_0x1e54d3){return db['ScreenRecording'][_0xe032('0x49')](_0x62bfc8[_0xe032('0x4a')],{})[_0xe032('0x27')](respondWithResult(_0x1e54d3,0xc9))[_0xe032('0x46')](handleError(_0x1e54d3,null));};exports[_0xe032('0x26')]=function(_0x233d9e,_0x3774bc){if(_0x233d9e['body']['id']){delete _0x233d9e[_0xe032('0x4a')]['id'];}delete _0x233d9e[_0xe032('0x4a')]['duration'];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4b')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4c')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4d')];return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x233d9e[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x3774bc,null))[_0xe032('0x27')](saveUpdates(_0x233d9e[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x3774bc,null))[_0xe032('0x46')](handleError(_0x3774bc,null));};exports['describe']=function(_0x1c8b32,_0x53c8b2){return db[_0xe032('0x44')][_0xe032('0x4f')]()[_0xe032('0x27')](respondWithResult(_0x53c8b2,null))[_0xe032('0x46')](handleError(_0x53c8b2,null));};exports[_0xe032('0x50')]=function(_0x1b7a91,_0x2e29d3,_0xa98ee6){var _0x16c91e=require(_0xe032('0x51'));var _0x1b9012=![];var _0x564fe0={};if(_0x1b7a91[_0xe032('0x33')][_0xe032('0x2d')]&&_0x1b7a91['query'][_0xe032('0x2d')]==='uniqueid'){_0x564fe0[_0xe032('0x52')]=_0x1b7a91[_0xe032('0x4e')]['id'];}else{_0x564fe0['id']=_0x1b7a91[_0xe032('0x4e')]['id'];}return db[_0xe032('0x44')][_0xe032('0x48')]({'where':_0x564fe0,'attributes':['id','value'],'raw':!![]})[_0xe032('0x27')](handleEntityNotFound(_0x2e29d3,null))[_0xe032('0x27')](function(_0x1e1277){if(_0x1e1277){var _0x21a32f=path[_0xe032('0x53')](config[_0xe032('0x54')],_0xe032('0x55'),_0x1e1277['value']);var _0x3f46c0=util[_0xe032('0x31')](_0xe032('0x56'),_0x21a32f);if(fs[_0xe032('0x57')](_0x3f46c0)){_0x1b9012=!![];return _0x16c91e[_0xe032('0x58')](_0x3f46c0,_0x21a32f,config[_0xe032('0x59')][_0xe032('0x5a')])[_0xe032('0x27')](function(){return _0x1e1277;});}return _0x1e1277;}})[_0xe032('0x27')](function(_0x54c0b0){if(_0x54c0b0){var _0x795a58=path[_0xe032('0x53')](config[_0xe032('0x54')],'server/files/screen_recordings',_0x54c0b0[_0xe032('0x4d')]);if(!fs[_0xe032('0x57')](_0x795a58)){throw new db['Sequelize'][(_0xe032('0x5b'))](_0xe032('0x5c'));}if(_0x54c0b0[_0xe032('0x5d')]){return _0x2e29d3[_0xe032('0x50')](_0x795a58,_0x54c0b0[_0xe032('0x5d')]+path[_0xe032('0x5e')](_0x795a58),function(){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}else{return _0x2e29d3[_0xe032('0x50')](_0x795a58,function(_0x1aa18e){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}}})[_0xe032('0x46')](function(_0x505986){if(_0x505986[_0xe032('0x60')]===_0xe032('0x5c')){_0x2e29d3[_0xe032('0x1d')](0x194)[_0xe032('0x2a')](_0xe032('0x61'));}else{return handleError(_0x2e29d3,null);}});};exports['destroy']=function(_0x2b6ef8,_0x55e6b0){return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x2b6ef8[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](function(_0x3c5eb8){if(_[_0xe032('0x62')](_0x3c5eb8)){throw new ReferenceError(_0xe032('0x63'));}return _0x3c5eb8;})[_0xe032('0x27')](function(_0x22fd01){var _0x536510=path['join'](config['root'],_0xe032('0x55'),_0x22fd01[_0xe032('0x4d')]);logger[_0xe032('0x64')](_0xe032('0x65'),_0x536510);if(!_[_0xe032('0x62')](_0x22fd01[_0xe032('0x4d')])&&fs['existsSync'](_0x536510)){logger[_0xe032('0x64')](_0xe032('0x66')+_0x536510+_0xe032('0x67'));fs['unlinkSync'](_0x536510);}_0x536510=_0x536510+_0xe032('0x68');if(!_['isNil'](_0x22fd01[_0xe032('0x4d')])&&fs[_0xe032('0x57')](_0x536510)){logger['info']('File:\x20\x22'+_0x536510+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe032('0x69')](_0x536510);}return _0x22fd01;})['then'](function(_0x5157f7){if(!_0x5157f7)throw new InternalError();return _0x5157f7[_0xe032('0x6a')]();})[_0xe032('0x27')](function(){_0x55e6b0[_0xe032('0x1d')](0xcc)['end']();})[_0xe032('0x46')](handleError(_0x55e6b0,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 4c71dac..91d0bca 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 _0x33a3=['path','rimraf','../../config/environment','define','ScreenRecording','interactionid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x33a3,0x103));var _0x333a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x33a3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x333a('0x0'))(_0x333a('0x1'));var moment=require(_0x333a('0x2'));var BPromise=require(_0x333a('0x3'));var rp=require(_0x333a('0x4'));var fs=require('fs');var path=require(_0x333a('0x5'));var rimraf=require(_0x333a('0x6'));var config=require(_0x333a('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x2d5813,_0x183963){return _0x2d5813[_0x333a('0x8')](_0x333a('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x333a('0xa'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x68b8=['interactionid','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings'];(function(_0x38188a,_0x967439){var _0x4ca70d=function(_0x203707){while(--_0x203707){_0x38188a['push'](_0x38188a['shift']());}};_0x4ca70d(++_0x967439);}(_0x68b8,0x1c8));var _0x868b=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x68b8[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0x868b('0x0'));var util=require('util');var logger=require(_0x868b('0x1'))(_0x868b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x868b('0x3'));var fs=require('fs');var path=require(_0x868b('0x4'));var rimraf=require(_0x868b('0x5'));var config=require(_0x868b('0x6'));var attributes=require(_0x868b('0x7'));module[_0x868b('0x8')]=function(_0x34eab1,_0x336a11){return _0x34eab1[_0x868b('0x9')](_0x868b('0xa'),attributes,{'tableName':_0x868b('0xb'),'paranoid':![],'indexes':[{'name':_0x868b('0xc'),'fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 5100c66..d1a1895 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 _0x8787=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0xe2406d,_0x20b53e){var _0x38826b=function(_0x238edf){while(--_0x238edf){_0xe2406d['push'](_0xe2406d['shift']());}};_0x38826b(++_0x20b53e);}(_0x8787,0x158));var _0x7878=function(_0x2480cd,_0x433aec){_0x2480cd=_0x2480cd-0x0;var _0x1ca300=_0x8787[_0x2480cd];return _0x1ca300;};'use strict';var _=require(_0x7878('0x0'));var util=require(_0x7878('0x1'));var moment=require('moment');var BPromise=require(_0x7878('0x2'));var rs=require(_0x7878('0x3'));var fs=require('fs');var Redis=require(_0x7878('0x4'));var db=require(_0x7878('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7878('0x6'))(_0x7878('0x7'));var config=require('../../config/environment');var jayson=require(_0x7878('0x8'));var client=jayson[_0x7878('0x9')][_0x7878('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7955d1,_0x2e4213,_0x257c26){return new BPromise(function(_0x51bb9f,_0x2d569a){return client[_0x7878('0xb')](_0x7955d1,_0x257c26)[_0x7878('0xc')](function(_0x2bbf8c){logger[_0x7878('0xd')](_0x7878('0xe'),_0x2e4213,'request\x20sent');logger[_0x7878('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x2e4213,_0x7878('0x10'),JSON[_0x7878('0x11')](_0x2bbf8c));if(_0x2bbf8c[_0x7878('0x12')]){if(_0x2bbf8c['error'][_0x7878('0x13')]===0x1f4){logger[_0x7878('0x12')](_0x7878('0xe'),_0x2e4213,_0x2bbf8c[_0x7878('0x12')][_0x7878('0x14')]);return _0x2d569a(_0x2bbf8c[_0x7878('0x12')][_0x7878('0x14')]);}logger[_0x7878('0x12')](_0x7878('0xe'),_0x2e4213,_0x2bbf8c['error'][_0x7878('0x14')]);return _0x51bb9f(_0x2bbf8c[_0x7878('0x12')][_0x7878('0x14')]);}else{logger[_0x7878('0xd')](_0x7878('0xe'),_0x2e4213,_0x7878('0x10'));_0x51bb9f(_0x2bbf8c[_0x7878('0x15')][_0x7878('0x14')]);}})[_0x7878('0x16')](function(_0x5e55a2){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x2e4213,_0x5e55a2);_0x2d569a(_0x5e55a2);});});} \ No newline at end of file +var _0x68ad=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0xb9f87c,_0x13669a){var _0x54d8b5=function(_0x16b5fa){while(--_0x16b5fa){_0xb9f87c['push'](_0xb9f87c['shift']());}};_0x54d8b5(++_0x13669a);}(_0x68ad,0x1b2));var _0xd68a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x68ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd68a('0x0'));var util=require(_0xd68a('0x1'));var moment=require(_0xd68a('0x2'));var BPromise=require(_0xd68a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd68a('0x4'));var db=require(_0xd68a('0x5'))['db'];var utils=require(_0xd68a('0x6'));var logger=require('../../config/logger')(_0xd68a('0x7'));var config=require(_0xd68a('0x8'));var jayson=require(_0xd68a('0x9'));var client=jayson['client'][_0xd68a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xadd940,_0xe32e17,_0x2c9742){return new BPromise(function(_0x44d751,_0x13da2a){return client[_0xd68a('0xb')](_0xadd940,_0x2c9742)[_0xd68a('0xc')](function(_0x754b5f){logger[_0xd68a('0xd')](_0xd68a('0xe'),_0xe32e17,'request\x20sent');logger[_0xd68a('0xf')](_0xd68a('0x10'),_0xe32e17,'request\x20sent',JSON[_0xd68a('0x11')](_0x754b5f));if(_0x754b5f[_0xd68a('0x12')]){if(_0x754b5f[_0xd68a('0x12')]['code']===0x1f4){logger[_0xd68a('0x12')]('ScreenRecording,\x20%s,\x20%s',_0xe32e17,_0x754b5f[_0xd68a('0x12')]['message']);return _0x13da2a(_0x754b5f[_0xd68a('0x12')]['message']);}logger[_0xd68a('0x12')](_0xd68a('0xe'),_0xe32e17,_0x754b5f['error']['message']);return _0x44d751(_0x754b5f[_0xd68a('0x12')][_0xd68a('0x13')]);}else{logger['info'](_0xd68a('0xe'),_0xe32e17,_0xd68a('0x14'));_0x44d751(_0x754b5f[_0xd68a('0x15')][_0xd68a('0x13')]);}})[_0xd68a('0x16')](function(_0x565e37){logger[_0xd68a('0x12')]('ScreenRecording,\x20%s,\x20%s',_0xe32e17,_0x565e37);_0x13da2a(_0x565e37);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index a8ea2b7..6d7eaac 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 _0x17ab=['/:id','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','join','logologin','single','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x17ab,0x154));var _0xb17a=function(_0x1105bc,_0x45f698){_0x1105bc=_0x1105bc-0x0;var _0x46a675=_0x17ab[_0x1105bc];return _0x46a675;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb17a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb17a('0x1')]();var fs_extra=require(_0xb17a('0x2'));var auth=require(_0xb17a('0x3'));var interaction=require(_0xb17a('0x4'));var config=require(_0xb17a('0x5'));var controller=require(_0xb17a('0x6'));router[_0xb17a('0x7')]('/',auth[_0xb17a('0x8')](),controller[_0xb17a('0x9')]);router[_0xb17a('0x7')](_0xb17a('0xa'),controller[_0xb17a('0xb')]);router[_0xb17a('0x7')](_0xb17a('0xc'),controller['show']);router[_0xb17a('0x7')](_0xb17a('0xd'),controller['getLogo']);router[_0xb17a('0x7')](_0xb17a('0xe'),controller[_0xb17a('0xf')]);router[_0xb17a('0x7')](_0xb17a('0x10'),controller[_0xb17a('0x11')]);router[_0xb17a('0x7')](_0xb17a('0x12'),controller[_0xb17a('0x13')]);router[_0xb17a('0x7')](_0xb17a('0x14'),controller[_0xb17a('0x15')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0x2dd517,_0x5142c5,_0x4704b5){_0x4704b5(null,path['join'](config[_0xb17a('0x17')],_0xb17a('0x18')));},'filename':function(_0xa9dcc2,_0xa4b09b,_0xbf5965){_0xbf5965(null,util[_0xb17a('0x19')](_0xb17a('0x1a'),_0xb17a('0x1b'),path[_0xb17a('0x1c')](_0xa4b09b[_0xb17a('0x1d')])));}})});router[_0xb17a('0x1e')](_0xb17a('0xd'),upload['single'](_0xb17a('0x1f')),controller[_0xb17a('0x20')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0xc6eae3,_0x5f0034,_0x1941c5){_0x1941c5(null,path[_0xb17a('0x21')](config['root'],_0xb17a('0x18')));},'filename':function(_0x5ecbbe,_0x4baf69,_0xca6d18){_0xca6d18(null,util[_0xb17a('0x19')](_0xb17a('0x1a'),_0xb17a('0x22'),path['extname'](_0x4baf69[_0xb17a('0x1d')])));}})});router[_0xb17a('0x1e')](_0xb17a('0xe'),upload[_0xb17a('0x23')](_0xb17a('0x1f')),controller[_0xb17a('0x24')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0x17f4ff,_0x3b9ca6,_0x4f1f5c){_0x4f1f5c(null,path[_0xb17a('0x21')](config[_0xb17a('0x17')],_0xb17a('0x18')));},'filename':function(_0x4f2737,_0x3972a8,_0x148579){_0x148579(null,util['format'](_0xb17a('0x1a'),_0xb17a('0x25'),path[_0xb17a('0x1c')](_0x3972a8[_0xb17a('0x1d')])));}})});router['post'](_0xb17a('0x12'),upload[_0xb17a('0x23')]('file'),controller[_0xb17a('0x26')]);var upload=multer({'storage':multer[_0xb17a('0x16')]({'destination':function(_0x10071d,_0x3340ae,_0x5c6572){_0x5c6572(null,path[_0xb17a('0x21')](config[_0xb17a('0x17')],'server/files/images/logos/'));},'filename':function(_0xf31b73,_0x23de4a,_0x49377a){_0x49377a(null,util[_0xb17a('0x19')](_0xb17a('0x1a'),_0xb17a('0x27'),path[_0xb17a('0x1c')](_0x23de4a['originalname'])));}})});router[_0xb17a('0x1e')](_0xb17a('0x14'),upload[_0xb17a('0x23')]('file'),controller[_0xb17a('0x28')]);router[_0xb17a('0x29')](_0xb17a('0xc'),auth[_0xb17a('0x8')](),controller[_0xb17a('0x2a')]);module[_0xb17a('0x2b')]=router; \ No newline at end of file +var _0x0914=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/now','getDate','/:id','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','logo','extname','originalname','post','single','file','addLogo','server/files/images/logos/','logologin','addLogoLogin','%s%s','preferred','addPreferred','favicon','addFavicon','update'];(function(_0x3ff322,_0x5d61b1){var _0x1be859=function(_0x1bd0f3){while(--_0x1bd0f3){_0x3ff322['push'](_0x3ff322['shift']());}};_0x1be859(++_0x5d61b1);}(_0x0914,0x1af));var _0x4091=function(_0xb99b7a,_0x239e96){_0xb99b7a=_0xb99b7a-0x0;var _0xba8b5c=_0x0914[_0xb99b7a];return _0xba8b5c;};'use strict';var multer=require(_0x4091('0x0'));var util=require('util');var path=require(_0x4091('0x1'));var timeout=require('connect-timeout');var express=require(_0x4091('0x2'));var router=express[_0x4091('0x3')]();var fs_extra=require(_0x4091('0x4'));var auth=require(_0x4091('0x5'));var interaction=require(_0x4091('0x6'));var config=require(_0x4091('0x7'));var controller=require('./setting.controller');router['get']('/',auth[_0x4091('0x8')](),controller[_0x4091('0x9')]);router[_0x4091('0xa')](_0x4091('0xb'),controller[_0x4091('0xc')]);router[_0x4091('0xa')](_0x4091('0xd'),controller['show']);router[_0x4091('0xa')](_0x4091('0xe'),controller['getLogo']);router[_0x4091('0xa')](_0x4091('0xf'),controller['getLogoLogin']);router[_0x4091('0xa')](_0x4091('0x10'),controller[_0x4091('0x11')]);router[_0x4091('0xa')](_0x4091('0x12'),controller[_0x4091('0x13')]);router[_0x4091('0xa')](_0x4091('0x14'),controller[_0x4091('0x15')]);var upload=multer({'storage':multer[_0x4091('0x16')]({'destination':function(_0x5a604c,_0x50108f,_0x3a90f3){_0x3a90f3(null,path[_0x4091('0x17')](config[_0x4091('0x18')],'server/files/images/logos/'));},'filename':function(_0x22f1c9,_0x4b990e,_0x293e91){_0x293e91(null,util[_0x4091('0x19')]('%s%s',_0x4091('0x1a'),path[_0x4091('0x1b')](_0x4b990e[_0x4091('0x1c')])));}})});router[_0x4091('0x1d')](_0x4091('0xe'),upload[_0x4091('0x1e')](_0x4091('0x1f')),controller[_0x4091('0x20')]);var upload=multer({'storage':multer[_0x4091('0x16')]({'destination':function(_0x25dfd8,_0x41e346,_0x287e19){_0x287e19(null,path['join'](config[_0x4091('0x18')],_0x4091('0x21')));},'filename':function(_0x6b5f0b,_0x31b6ce,_0x5dad51){_0x5dad51(null,util['format']('%s%s',_0x4091('0x22'),path[_0x4091('0x1b')](_0x31b6ce[_0x4091('0x1c')])));}})});router[_0x4091('0x1d')](_0x4091('0xf'),upload[_0x4091('0x1e')](_0x4091('0x1f')),controller[_0x4091('0x23')]);var upload=multer({'storage':multer[_0x4091('0x16')]({'destination':function(_0x217312,_0x9b802a,_0x496d68){_0x496d68(null,path[_0x4091('0x17')](config[_0x4091('0x18')],_0x4091('0x21')));},'filename':function(_0x9518e6,_0x3bccdd,_0x3dca71){_0x3dca71(null,util['format'](_0x4091('0x24'),_0x4091('0x25'),path[_0x4091('0x1b')](_0x3bccdd[_0x4091('0x1c')])));}})});router[_0x4091('0x1d')](_0x4091('0x12'),upload[_0x4091('0x1e')](_0x4091('0x1f')),controller[_0x4091('0x26')]);var upload=multer({'storage':multer[_0x4091('0x16')]({'destination':function(_0x34820d,_0x319003,_0x1f6e15){_0x1f6e15(null,path[_0x4091('0x17')](config[_0x4091('0x18')],_0x4091('0x21')));},'filename':function(_0x405187,_0x2fcaeb,_0x520ef0){_0x520ef0(null,util[_0x4091('0x19')](_0x4091('0x24'),_0x4091('0x27'),path[_0x4091('0x1b')](_0x2fcaeb['originalname'])));}})});router[_0x4091('0x1d')]('/:id/favicon',upload[_0x4091('0x1e')](_0x4091('0x1f')),controller[_0x4091('0x28')]);router['put'](_0x4091('0xd'),auth['isAuthenticated'](),controller[_0x4091('0x29')]);module[_0x4091('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index ffae03f..b98b5c7 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 _0x5cea=['min_internal','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','sequelize','INTEGER'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0x5cea,0x15c));var _0xa5ce=function(_0x1b7ed6,_0x2387bc){_0x1b7ed6=_0x1b7ed6-0x0;var _0x3d3655=_0x5cea[_0x1b7ed6];return _0x3d3655;};'use strict';var Sequelize=require(_0xa5ce('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xa5ce('0x1')](0xb),'unique':_0xa5ce('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xa5ce('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xa5ce('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xa5ce('0x3')]},'defaultLogo':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xa5ce('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xa5ce('0x3')]},'turnaddr':{'type':Sequelize[_0xa5ce('0x3')]},'turnusername':{'type':Sequelize[_0xa5ce('0x3')]},'turnpassword':{'type':Sequelize[_0xa5ce('0x3')]},'pageTitle':{'type':Sequelize[_0xa5ce('0x3')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xa5ce('0x5')},'enableEmailPreview':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'split':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xa5ce('0x3')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xa5ce('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xa5ce('0x1')]},'transcribeRegion':{'type':Sequelize[_0xa5ce('0x3')]},'sentiment':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xa5ce('0x1')]},'sentimentRegion':{'type':Sequelize[_0xa5ce('0x3')]},'language':{'type':Sequelize[_0xa5ce('0x3')]},'bucket':{'type':Sequelize[_0xa5ce('0x3')]},'googleSsoEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xa5ce('0x1')](0x2)[_0xa5ce('0x6')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xa5ce('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xccd4=['UNSIGNED','sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN'];(function(_0x133803,_0x152948){var _0xd6b9e6=function(_0x56711c){while(--_0x56711c){_0x133803['push'](_0x133803['shift']());}};_0xd6b9e6(++_0x152948);}(_0xccd4,0x1b1));var _0x4ccd=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xccd4[_0xc67528];return _0x38e26d;};'use strict';var Sequelize=require(_0x4ccd('0x0'));module[_0x4ccd('0x1')]={'min_internal':{'type':Sequelize[_0x4ccd('0x2')](0xb),'unique':_0x4ccd('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4ccd('0x2')](0xb),'unique':_0x4ccd('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x4ccd('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x4ccd('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x4ccd('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x4ccd('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x4ccd('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x4ccd('0x5')]},'turnusername':{'type':Sequelize[_0x4ccd('0x5')]},'turnpassword':{'type':Sequelize[_0x4ccd('0x5')]},'pageTitle':{'type':Sequelize[_0x4ccd('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x4ccd('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x4ccd('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4ccd('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x4ccd('0x5')]},'defaultPreferred':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x4ccd('0x5')]},'defaultFavicon':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x4ccd('0x2')]},'transcribeRegion':{'type':Sequelize[_0x4ccd('0x5')]},'sentiment':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x4ccd('0x2')]},'sentimentRegion':{'type':Sequelize[_0x4ccd('0x5')]},'language':{'type':Sequelize[_0x4ccd('0x5')]},'bucket':{'type':Sequelize[_0x4ccd('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x4ccd('0x2')](0x2)[_0x4ccd('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x4ccd('0x2')](0x2)[_0x4ccd('0x7')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x4ccd('0x2')](0x2)[_0x4ccd('0x7')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x4ccd('0x2')](0x2)[_0x4ccd('0x7')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x4ccd('0x2')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x4ccd('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c2d4c61..25d5095 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 _0xdcab=['../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','Setting','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','custom','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x52e187,_0xf0db3a){var _0x32cd17=function(_0xe9ffae){while(--_0xe9ffae){_0x52e187['push'](_0x52e187['shift']());}};_0x32cd17(++_0xf0db3a);}(_0xdcab,0x1e9));var _0xbdca=function(_0x594140,_0x21fa9d){_0x594140=_0x594140-0x0;var _0x179ec8=_0xdcab[_0x594140];return _0x179ec8;};'use strict';var emlformat=require(_0xbdca('0x0'));var rimraf=require(_0xbdca('0x1'));var zipdir=require(_0xbdca('0x2'));var jsonpatch=require(_0xbdca('0x3'));var rp=require(_0xbdca('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbdca('0x5'));var util=require(_0xbdca('0x6'));var path=require(_0xbdca('0x7'));var sox=require(_0xbdca('0x8'));var csv=require(_0xbdca('0x9'));var ejs=require(_0xbdca('0xa'));var fs=require('fs');var fs_extra=require(_0xbdca('0xb'));var _=require(_0xbdca('0xc'));var squel=require(_0xbdca('0xd'));var crypto=require(_0xbdca('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbdca('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbdca('0x10'));var Papa=require(_0xbdca('0x11'));var Redis=require(_0xbdca('0x12'));var authService=require(_0xbdca('0x13'));var qs=require(_0xbdca('0x14'));var as=require(_0xbdca('0x15'));var hardwareService=require(_0xbdca('0x16'));var logger=require(_0xbdca('0x17'))(_0xbdca('0x18'));var utils=require('../../config/utils');var config=require(_0xbdca('0x19'));var licenseUtil=require(_0xbdca('0x1a'));var db=require(_0xbdca('0x1b'))['db'];var jayson=require(_0xbdca('0x1c'));var client=jayson['client'][_0xbdca('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x559c84,_0x249f54,_0x446421,_0x115564){return new BPromise(function(_0x5c4080,_0x5775ef){var _0x18c27a=_0x115564||client;return _0x18c27a[_0xbdca('0x1e')](_0x559c84,_0x446421)[_0xbdca('0x1f')](function(_0x16944f){logger[_0xbdca('0x20')](_0xbdca('0x21'),_0x249f54,'request\x20sent');logger[_0xbdca('0x22')](_0xbdca('0x23'),_0x249f54,_0xbdca('0x24'),JSON[_0xbdca('0x25')](_0x16944f));if(_0x16944f['error']){if(_0x16944f[_0xbdca('0x26')][_0xbdca('0x27')]===0x1f4){logger[_0xbdca('0x26')](_0xbdca('0x21'),_0x249f54,_0x16944f['error'][_0xbdca('0x28')]);return _0x5775ef(_0x16944f[_0xbdca('0x26')]['message']);}logger[_0xbdca('0x26')](_0xbdca('0x21'),_0x249f54,_0x16944f['error'][_0xbdca('0x28')]);return _0x5c4080(_0x16944f[_0xbdca('0x26')][_0xbdca('0x28')]);}else{logger[_0xbdca('0x20')](_0xbdca('0x21'),_0x249f54,_0xbdca('0x24'));_0x5c4080(_0x16944f['result'][_0xbdca('0x28')]);}})[_0xbdca('0x29')](function(_0x4b73b1){logger['error'](_0xbdca('0x21'),_0x249f54,_0x4b73b1);_0x5775ef(_0x4b73b1);});});}function respondWithStatusCode(_0x3f581f,_0x3fb260){_0x3fb260=_0x3fb260||0xcc;return function(_0x27299c){if(_0x27299c){return _0x3f581f[_0xbdca('0x2a')](_0x3fb260);}return _0x3f581f[_0xbdca('0x2b')](_0x3fb260)[_0xbdca('0x2c')]();};}function respondWithResult(_0x379e58,_0x3b260c){_0x3b260c=_0x3b260c||0xc8;return function(_0x3a647c){if(_0x3a647c){return _0x379e58[_0xbdca('0x2b')](_0x3b260c)['json'](_0x3a647c);}};}function respondWithFilteredResult(_0x5ebea6,_0x4eecc1){return function(_0x4cdc60){if(_0x4cdc60){var _0x5d6cb8=typeof _0x4eecc1[_0xbdca('0x2d')]===_0xbdca('0x2e')&&typeof _0x4eecc1[_0xbdca('0x2f')]===_0xbdca('0x2e');var _0x452488=_0x4cdc60[_0xbdca('0x30')];var _0x4c495e=_0x5d6cb8?0x0:_0x4eecc1[_0xbdca('0x2d')];var _0x170948=_0x5d6cb8?_0x4cdc60['count']:_0x4eecc1[_0xbdca('0x2d')]+_0x4eecc1['limit'];var _0x3b6675;if(_0x170948>=_0x452488){_0x170948=_0x452488;_0x3b6675=0xc8;}else{_0x3b6675=0xce;}_0x5ebea6[_0xbdca('0x2b')](_0x3b6675);return _0x5ebea6[_0xbdca('0x31')](_0xbdca('0x32'),_0x4c495e+'-'+_0x170948+'/'+_0x452488)['json'](_0x4cdc60);}return null;};}function patchUpdates(_0x230f32){return function(_0x1998d8){try{jsonpatch[_0xbdca('0x33')](_0x1998d8,_0x230f32,!![]);}catch(_0x155268){return BPromise[_0xbdca('0x34')](_0x155268);}return _0x1998d8[_0xbdca('0x35')]();};}function saveUpdates(_0x593b35,_0x345829){return function(_0x4f5ea9){if(_0x4f5ea9){return _0x4f5ea9[_0xbdca('0x36')](_0x593b35)[_0xbdca('0x1f')](function(_0x41a482){return _0x41a482;});}return null;};}function removeEntity(_0x3d4311,_0x34d66c){return function(_0x253a51){if(_0x253a51){return _0x253a51[_0xbdca('0x37')]()[_0xbdca('0x1f')](function(){_0x3d4311['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45496b,_0xe2b451){return function(_0x3adccb){if(!_0x3adccb){_0x45496b['sendStatus'](0x194);}return _0x3adccb;};}function handleError(_0x1a5f5f,_0x41372c){_0x41372c=_0x41372c||0x1f4;return function(_0x58a8c0){logger['error'](_0x58a8c0[_0xbdca('0x38')]);if(_0x58a8c0[_0xbdca('0x39')]){delete _0x58a8c0['name'];}_0x1a5f5f[_0xbdca('0x2b')](_0x41372c)[_0xbdca('0x3a')](_0x58a8c0);};}exports['index']=function(_0x1f54ec,_0x220ffc){var _0x11a714={},_0x11e109={},_0x394329={'count':0x0,'rows':[]};var _0x12ad2b=_['map'](db[_0xbdca('0x3b')][_0xbdca('0x3c')],function(_0x3b1ba5){return{'name':_0x3b1ba5[_0xbdca('0x3d')],'type':_0x3b1ba5[_0xbdca('0x3e')]['key']};});_0x11e109[_0xbdca('0x3f')]=_[_0xbdca('0x40')](_0x12ad2b,_0xbdca('0x39'));_0x11e109['query']=_[_0xbdca('0x41')](_0x1f54ec[_0xbdca('0x42')]);_0x11e109[_0xbdca('0x43')]=_[_0xbdca('0x44')](_0x11e109[_0xbdca('0x3f')],_0x11e109[_0xbdca('0x42')]);_0x11a714[_0xbdca('0x45')]=_[_0xbdca('0x44')](_0x11e109[_0xbdca('0x3f')],qs[_0xbdca('0x46')](_0x1f54ec[_0xbdca('0x42')]['fields']));_0x11a714[_0xbdca('0x45')]=_0x11a714[_0xbdca('0x45')][_0xbdca('0x47')]?_0x11a714[_0xbdca('0x45')]:_0x11e109[_0xbdca('0x3f')];if(!_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x48')](_0xbdca('0x49'))){_0x11a714[_0xbdca('0x2f')]=qs[_0xbdca('0x2f')](_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x2f')]);_0x11a714[_0xbdca('0x2d')]=qs[_0xbdca('0x2d')](_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x2d')]);}_0x11a714[_0xbdca('0x4a')]=qs['sort'](_0x1f54ec[_0xbdca('0x42')]['sort']);_0x11a714[_0xbdca('0x4b')]=qs[_0xbdca('0x43')](_[_0xbdca('0x4c')](_0x1f54ec[_0xbdca('0x42')],_0x11e109['filters']),_0x12ad2b);if(_0x1f54ec['query']['filter']){_0x11a714[_0xbdca('0x4b')]=_[_0xbdca('0x4d')](_0x11a714['where'],{'$or':_['map'](_0x12ad2b,function(_0x12ba96){if(_0x12ba96[_0xbdca('0x3e')]!==_0xbdca('0x4e')){var _0x3f02b5={};_0x3f02b5[_0x12ba96[_0xbdca('0x39')]]={'$like':'%'+_0x1f54ec['query'][_0xbdca('0x4f')]+'%'};return _0x3f02b5;}})});}_0x11a714=_[_0xbdca('0x4d')]({},_0x11a714,_0x1f54ec[_0xbdca('0x50')]);var _0x39d85e={'where':_0x11a714[_0xbdca('0x4b')]};return db[_0xbdca('0x3b')][_0xbdca('0x30')](_0x39d85e)[_0xbdca('0x1f')](function(_0x30d7e3){_0x394329[_0xbdca('0x30')]=_0x30d7e3;if(_0x1f54ec[_0xbdca('0x42')][_0xbdca('0x51')]){_0x11a714[_0xbdca('0x52')]=[{'all':!![]}];}return db[_0xbdca('0x3b')][_0xbdca('0x53')](_0x11a714);})[_0xbdca('0x1f')](function(_0x2c8775){_0x394329[_0xbdca('0x54')]=_0x2c8775;return _0x394329;})[_0xbdca('0x1f')](respondWithFilteredResult(_0x220ffc,_0x11a714))[_0xbdca('0x29')](handleError(_0x220ffc,null));};exports[_0xbdca('0x55')]=function(_0x1996a2,_0x1b99c3){var _0x3beda2={'raw':![],'where':{'id':_0x1996a2[_0xbdca('0x56')]['id']}},_0x1e8d25={};_0x1e8d25['model']=_['keys'](db[_0xbdca('0x3b')][_0xbdca('0x3c')]);_0x1e8d25[_0xbdca('0x42')]=_[_0xbdca('0x41')](_0x1996a2[_0xbdca('0x42')]);_0x1e8d25[_0xbdca('0x43')]=_[_0xbdca('0x44')](_0x1e8d25[_0xbdca('0x3f')],_0x1e8d25[_0xbdca('0x42')]);_0x3beda2[_0xbdca('0x45')]=_[_0xbdca('0x44')](_0x1e8d25[_0xbdca('0x3f')],qs[_0xbdca('0x46')](_0x1996a2[_0xbdca('0x42')][_0xbdca('0x46')]));_0x3beda2[_0xbdca('0x45')]=_0x3beda2[_0xbdca('0x45')][_0xbdca('0x47')]?_0x3beda2['attributes']:_0x1e8d25['model'];if(_0x1996a2[_0xbdca('0x42')][_0xbdca('0x51')]){_0x3beda2[_0xbdca('0x52')]=[{'all':!![]}];}_0x3beda2=_[_0xbdca('0x4d')]({},_0x3beda2,_0x1996a2[_0xbdca('0x50')]);return db[_0xbdca('0x3b')][_0xbdca('0x57')](_0x3beda2)['then'](handleEntityNotFound(_0x1b99c3,null))[_0xbdca('0x1f')](respondWithResult(_0x1b99c3,null))[_0xbdca('0x29')](handleError(_0x1b99c3,null));};exports[_0xbdca('0x36')]=function(_0x177b69,_0x174b84){if(_0x177b69[_0xbdca('0x58')]['id']){delete _0x177b69['body']['id'];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x177b69[_0xbdca('0x56')]['id']}})['then'](handleEntityNotFound(_0x174b84,null))[_0xbdca('0x1f')](saveUpdates(_0x177b69['body'],null))[_0xbdca('0x1f')](respondWithResult(_0x174b84,null))[_0xbdca('0x29')](handleError(_0x174b84,null));};exports[_0xbdca('0x59')]=function(_0x40648c,_0x283284,_0x2aa46a){if(_0x40648c[_0xbdca('0x5a')]&&_0x40648c['file'][_0xbdca('0x5b')]){_0x40648c[_0xbdca('0x58')][_0xbdca('0x5c')]=_0x40648c[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x40648c['params']['id']}})['then'](handleEntityNotFound(_0x283284,null))[_0xbdca('0x1f')](saveUpdates(_0x40648c[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x283284,null))['catch'](handleError(_0x283284,null));};exports[_0xbdca('0x5d')]=function(_0x479144,_0x14f482,_0x12527f){if(_0x479144['file']&&_0x479144[_0xbdca('0x5a')][_0xbdca('0x5b')]){_0x479144[_0xbdca('0x58')][_0xbdca('0x5e')]=_0x479144[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')]['find']({'where':{'id':_0x479144[_0xbdca('0x56')]['id']}})[_0xbdca('0x1f')](handleEntityNotFound(_0x14f482,null))[_0xbdca('0x1f')](saveUpdates(_0x479144[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x14f482,null))[_0xbdca('0x29')](handleError(_0x14f482,null));};var utilLicense=require(_0xbdca('0x1a'));exports['getLogo']=function(_0xe56b25,_0x128872,_0x5325bd){var _0x4ab816='server/files/images/logos';var _0x10d955={'custom':![]};return utilLicense[_0xbdca('0x5f')]()[_0xbdca('0x1f')](function(_0x1a6830){if(_0x1a6830){_0x10d955=_0x1a6830;}return db['Setting'][_0xbdca('0x57')]({'where':{'id':_0xe56b25[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),_0xbdca('0x5e'),_0xbdca('0x60'),_0xbdca('0x61'),_0xbdca('0x62'),_0xbdca('0x63'),_0xbdca('0x64'),_0xbdca('0x65')],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x128872,null))[_0xbdca('0x1f')](function(_0x494389){if(_0x494389){var _0x3967d8=_0x494389[_0xbdca('0x5c')]&&fs['existsSync'](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x4ab816,_[_0xbdca('0x68')](_0x494389[_0xbdca('0x5c')])))?path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x4ab816,_[_0xbdca('0x68')](_0x494389[_0xbdca('0x5c')])):path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x4ab816,_['toLower']('default_logo.svg'));var _0x54e262=_0xbdca('0x69')+_[_0xbdca('0x6a')](_0xbdca('0x5c'));if(_0x494389[_0x54e262]||!_0x10d955[_0xbdca('0x6b')]){_0x3967d8=path['join'](config[_0xbdca('0x67')],_0x4ab816,_['toLower'](_0xbdca('0x6c')));}if(!fs[_0xbdca('0x6d')](_0x3967d8)){throw new db[(_0xbdca('0x6e'))][(_0xbdca('0x6f'))](_['upperFirst'](_0xbdca('0x5c'))+_0xbdca('0x70'));}return _0x128872[_0xbdca('0x71')](_0x3967d8);}})[_0xbdca('0x29')](handleError(_0x128872,null));};var utilLicense=require(_0xbdca('0x1a'));exports[_0xbdca('0x72')]=function(_0x539ced,_0x432854,_0x114258){var _0x2b1767=_0xbdca('0x73');var _0x3e99ee={'custom':![]};return utilLicense[_0xbdca('0x5f')]()['then'](function(_0x44eeb0){if(_0x44eeb0){_0x3e99ee=_0x44eeb0;}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x539ced[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),_0xbdca('0x5e'),_0xbdca('0x60'),_0xbdca('0x61'),_0xbdca('0x62'),_0xbdca('0x63'),_0xbdca('0x64'),'defaultFavicon'],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x432854,null))[_0xbdca('0x1f')](function(_0x57e90f){if(_0x57e90f){var _0x216ca3=_0x57e90f['loginLogo']&&fs['existsSync'](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x2b1767,_[_0xbdca('0x68')](_0x57e90f[_0xbdca('0x5e')])))?path['join'](config[_0xbdca('0x67')],_0x2b1767,_['toLower'](_0x57e90f[_0xbdca('0x5e')])):path[_0xbdca('0x66')](config['root'],_0x2b1767,_[_0xbdca('0x68')]('default_loginLogo.svg'));var _0x28ef0f=_0xbdca('0x69')+_[_0xbdca('0x6a')](_0xbdca('0x5e'));if(_0x57e90f[_0x28ef0f]||!_0x3e99ee['custom']){_0x216ca3=path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x2b1767,_[_0xbdca('0x68')](_0xbdca('0x74')));}if(!fs[_0xbdca('0x6d')](_0x216ca3)){throw new db['Sequelize'][(_0xbdca('0x6f'))](_[_0xbdca('0x6a')](_0xbdca('0x5e'))+_0xbdca('0x70'));}return _0x432854[_0xbdca('0x71')](_0x216ca3);}})['catch'](handleError(_0x432854,null));};exports[_0xbdca('0x75')]=function(_0x30c128,_0x49d298){return db['Setting'][_0xbdca('0x57')]({'where':{'id':_0x30c128[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x76')]})['then'](respondWithResult(_0x49d298,null))[_0xbdca('0x29')](handleError(_0x49d298,null));};exports[_0xbdca('0x77')]=function(_0x19bf4a,_0x266360,_0x2d49e5){if(_0x19bf4a[_0xbdca('0x5a')]&&_0x19bf4a[_0xbdca('0x5a')][_0xbdca('0x5b')]){_0x19bf4a[_0xbdca('0x58')][_0xbdca('0x60')]=_0x19bf4a[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x19bf4a[_0xbdca('0x56')]['id']}})['then'](handleEntityNotFound(_0x266360,null))[_0xbdca('0x1f')](saveUpdates(_0x19bf4a[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x266360,null))[_0xbdca('0x29')](handleError(_0x266360,null));};var utilLicense=require(_0xbdca('0x1a'));exports[_0xbdca('0x78')]=function(_0x5033dc,_0x18d3d3,_0x3149d5){var _0x3bb96c='server/files/images/logos';var _0x46c24b={'custom':![]};return utilLicense[_0xbdca('0x5f')]()[_0xbdca('0x1f')](function(_0x552d81){if(_0x552d81){_0x46c24b=_0x552d81;}return db['Setting'][_0xbdca('0x57')]({'where':{'id':_0x5033dc[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),'loginLogo',_0xbdca('0x60'),_0xbdca('0x61'),'defaultLogo',_0xbdca('0x63'),_0xbdca('0x64'),_0xbdca('0x65')],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x18d3d3,null))[_0xbdca('0x1f')](function(_0x26d151){if(_0x26d151){var _0x18f635=_0x26d151[_0xbdca('0x60')]&&fs[_0xbdca('0x6d')](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3bb96c,_[_0xbdca('0x68')](_0x26d151['preferred'])))?path[_0xbdca('0x66')](config['root'],_0x3bb96c,_[_0xbdca('0x68')](_0x26d151[_0xbdca('0x60')])):path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3bb96c,_['toLower']('default_preferred.png'));var _0x345738=_0xbdca('0x69')+_[_0xbdca('0x6a')](_0xbdca('0x60'));if(_0x26d151[_0x345738]||!_0x46c24b[_0xbdca('0x6b')]||!_0x46c24b[_0xbdca('0x60')]){_0x18f635=path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3bb96c,_[_0xbdca('0x68')](_0xbdca('0x79')));}if(!fs[_0xbdca('0x6d')](_0x18f635)){throw new db[(_0xbdca('0x6e'))][(_0xbdca('0x6f'))](_['upperFirst'](_0xbdca('0x60'))+_0xbdca('0x70'));}return _0x18d3d3['download'](_0x18f635);}})[_0xbdca('0x29')](handleError(_0x18d3d3,null));};exports[_0xbdca('0x7a')]=function(_0x353b04,_0x296fb6,_0x2f7f88){if(_0x353b04['file']&&_0x353b04[_0xbdca('0x5a')][_0xbdca('0x5b')]){_0x353b04['body'][_0xbdca('0x61')]=_0x353b04[_0xbdca('0x5a')][_0xbdca('0x5b')];}return db[_0xbdca('0x3b')][_0xbdca('0x57')]({'where':{'id':_0x353b04['params']['id']}})[_0xbdca('0x1f')](handleEntityNotFound(_0x296fb6,null))[_0xbdca('0x1f')](saveUpdates(_0x353b04[_0xbdca('0x58')],null))[_0xbdca('0x1f')](respondWithResult(_0x296fb6,null))['catch'](handleError(_0x296fb6,null));};var utilLicense=require(_0xbdca('0x1a'));exports[_0xbdca('0x7b')]=function(_0x10883a,_0x67d436,_0x4eb5ff){var _0x3ddbd7=_0xbdca('0x73');var _0x211a4b={'custom':![]};return utilLicense[_0xbdca('0x5f')]()['then'](function(_0x128b1a){if(_0x128b1a){_0x211a4b=_0x128b1a;}return db[_0xbdca('0x3b')]['find']({'where':{'id':_0x10883a[_0xbdca('0x56')]['id']},'attributes':[_0xbdca('0x5c'),'loginLogo',_0xbdca('0x60'),_0xbdca('0x61'),_0xbdca('0x62'),_0xbdca('0x63'),'defaultPreferred',_0xbdca('0x65')],'raw':!![]});})[_0xbdca('0x1f')](handleEntityNotFound(_0x67d436,null))[_0xbdca('0x1f')](function(_0x54dc84){if(_0x54dc84){var _0x546980=_0x54dc84[_0xbdca('0x61')]&&fs['existsSync'](path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3ddbd7,_[_0xbdca('0x68')](_0x54dc84['favicon'])))?path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3ddbd7,_[_0xbdca('0x68')](_0x54dc84[_0xbdca('0x61')])):path[_0xbdca('0x66')](config[_0xbdca('0x67')],_0x3ddbd7,_['toLower'](_0xbdca('0x7c')));var _0x599b50=_0xbdca('0x69')+_[_0xbdca('0x6a')]('favicon');if(_0x54dc84[_0x599b50]||!_0x211a4b[_0xbdca('0x6b')]){_0x546980=path['join'](config['root'],_0x3ddbd7,_[_0xbdca('0x68')](_0xbdca('0x7c')));}if(!fs['existsSync'](_0x546980)){throw new db[(_0xbdca('0x6e'))][(_0xbdca('0x6f'))](_[_0xbdca('0x6a')](_0xbdca('0x61'))+_0xbdca('0x70'));}return _0x67d436[_0xbdca('0x71')](_0x546980);}})[_0xbdca('0x29')](handleError(_0x67d436,null));};exports[_0xbdca('0x7d')]=function(_0x3fa5c1,_0x48eb9d){var _0x34a1c1={'offset':moment()['utcOffset']()};_0x34a1c1['now']=moment()[_0xbdca('0x7e')](_0x34a1c1[_0xbdca('0x2d')])[_0xbdca('0x7f')](_0xbdca('0x80'));return _0x48eb9d[_0xbdca('0x2b')](0xc8)[_0xbdca('0x3a')](_0x34a1c1);}; \ No newline at end of file +var _0x0506=['../../mysqldb','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','rows','show','params','keys','includeAll','include','body','find','addLogo','file','logo','filename','addLogoLogin','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default','upperFirst','custom','default_logo.svg','existsSync','Sequelize','ValidationError','\x20not\x20found','getLogoLogin','server/files/images/logos','loginLogo','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','download','getDate','utcOffset','format','eml-format','rimraf','zip-dir','mustache','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x0506,0x1d1));var _0x6050=function(_0x1d3984,_0x1a6db0){_0x1d3984=_0x1d3984-0x0;var _0x381d6=_0x0506[_0x1d3984];return _0x381d6;};'use strict';var emlformat=require(_0x6050('0x0'));var rimraf=require(_0x6050('0x1'));var zipdir=require(_0x6050('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6050('0x3'));var util=require('util');var path=require(_0x6050('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6050('0x5'));var fs=require('fs');var fs_extra=require(_0x6050('0x6'));var _=require(_0x6050('0x7'));var squel=require(_0x6050('0x8'));var crypto=require(_0x6050('0x9'));var jsforce=require(_0x6050('0xa'));var deskjs=require(_0x6050('0xb'));var toCsv=require(_0x6050('0xc'));var querystring=require('querystring');var Papa=require(_0x6050('0xd'));var Redis=require('ioredis');var authService=require(_0x6050('0xe'));var qs=require(_0x6050('0xf'));var as=require(_0x6050('0x10'));var hardwareService=require(_0x6050('0x11'));var logger=require(_0x6050('0x12'))(_0x6050('0x13'));var utils=require(_0x6050('0x14'));var config=require(_0x6050('0x15'));var licenseUtil=require(_0x6050('0x16'));var db=require(_0x6050('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x6050('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fbd8a,_0x98b3ef,_0x2e404b,_0x248431){return new BPromise(function(_0x4b5503,_0x223a06){var _0x5d0a25=_0x248431||client;return _0x5d0a25[_0x6050('0x19')](_0x2fbd8a,_0x2e404b)[_0x6050('0x1a')](function(_0x465e2b){logger[_0x6050('0x1b')](_0x6050('0x1c'),_0x98b3ef,_0x6050('0x1d'));logger[_0x6050('0x1e')](_0x6050('0x1f'),_0x98b3ef,_0x6050('0x1d'),JSON[_0x6050('0x20')](_0x465e2b));if(_0x465e2b[_0x6050('0x21')]){if(_0x465e2b[_0x6050('0x21')]['code']===0x1f4){logger[_0x6050('0x21')](_0x6050('0x1c'),_0x98b3ef,_0x465e2b[_0x6050('0x21')]['message']);return _0x223a06(_0x465e2b['error']['message']);}logger['error'](_0x6050('0x1c'),_0x98b3ef,_0x465e2b[_0x6050('0x21')]['message']);return _0x4b5503(_0x465e2b[_0x6050('0x21')][_0x6050('0x22')]);}else{logger[_0x6050('0x1b')](_0x6050('0x1c'),_0x98b3ef,_0x6050('0x1d'));_0x4b5503(_0x465e2b[_0x6050('0x23')]['message']);}})[_0x6050('0x24')](function(_0x4018c2){logger[_0x6050('0x21')](_0x6050('0x1c'),_0x98b3ef,_0x4018c2);_0x223a06(_0x4018c2);});});}function respondWithStatusCode(_0x19602f,_0x178d58){_0x178d58=_0x178d58||0xcc;return function(_0x2c76ba){if(_0x2c76ba){return _0x19602f[_0x6050('0x25')](_0x178d58);}return _0x19602f['status'](_0x178d58)[_0x6050('0x26')]();};}function respondWithResult(_0x48d9fd,_0x2a991b){_0x2a991b=_0x2a991b||0xc8;return function(_0x411dc9){if(_0x411dc9){return _0x48d9fd[_0x6050('0x27')](_0x2a991b)[_0x6050('0x28')](_0x411dc9);}};}function respondWithFilteredResult(_0x29eed8,_0x45ba65){return function(_0x4b46e0){if(_0x4b46e0){var _0x2345d2=typeof _0x45ba65[_0x6050('0x29')]===_0x6050('0x2a')&&typeof _0x45ba65[_0x6050('0x2b')]==='undefined';var _0x1527ea=_0x4b46e0[_0x6050('0x2c')];var _0x1698fa=_0x2345d2?0x0:_0x45ba65[_0x6050('0x29')];var _0x46769f=_0x2345d2?_0x4b46e0[_0x6050('0x2c')]:_0x45ba65[_0x6050('0x29')]+_0x45ba65['limit'];var _0x29069d;if(_0x46769f>=_0x1527ea){_0x46769f=_0x1527ea;_0x29069d=0xc8;}else{_0x29069d=0xce;}_0x29eed8[_0x6050('0x27')](_0x29069d);return _0x29eed8[_0x6050('0x2d')](_0x6050('0x2e'),_0x1698fa+'-'+_0x46769f+'/'+_0x1527ea)[_0x6050('0x28')](_0x4b46e0);}return null;};}function patchUpdates(_0x182137){return function(_0x2a5313){try{jsonpatch[_0x6050('0x2f')](_0x2a5313,_0x182137,!![]);}catch(_0x252ebb){return BPromise['reject'](_0x252ebb);}return _0x2a5313[_0x6050('0x30')]();};}function saveUpdates(_0x5c6e90,_0x5542fa){return function(_0x31fd3b){if(_0x31fd3b){return _0x31fd3b[_0x6050('0x31')](_0x5c6e90)[_0x6050('0x1a')](function(_0x536f51){return _0x536f51;});}return null;};}function removeEntity(_0x36eb96,_0x5295ad){return function(_0x486527){if(_0x486527){return _0x486527[_0x6050('0x32')]()[_0x6050('0x1a')](function(){_0x36eb96['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2888ae,_0x42a545){return function(_0x5e6025){if(!_0x5e6025){_0x2888ae[_0x6050('0x25')](0x194);}return _0x5e6025;};}function handleError(_0x110818,_0x360a34){_0x360a34=_0x360a34||0x1f4;return function(_0x6912ac){logger['error'](_0x6912ac[_0x6050('0x33')]);if(_0x6912ac['name']){delete _0x6912ac[_0x6050('0x34')];}_0x110818['status'](_0x360a34)[_0x6050('0x35')](_0x6912ac);};}exports[_0x6050('0x36')]=function(_0x162941,_0x50f014){var _0x35f347={},_0x5b94f0={},_0x16e74e={'count':0x0,'rows':[]};var _0x5f24f1=_[_0x6050('0x37')](db[_0x6050('0x38')][_0x6050('0x39')],function(_0x30b11f){return{'name':_0x30b11f['fieldName'],'type':_0x30b11f[_0x6050('0x3a')][_0x6050('0x3b')]};});_0x5b94f0['model']=_[_0x6050('0x37')](_0x5f24f1,_0x6050('0x34'));_0x5b94f0[_0x6050('0x3c')]=_['keys'](_0x162941[_0x6050('0x3c')]);_0x5b94f0[_0x6050('0x3d')]=_[_0x6050('0x3e')](_0x5b94f0['model'],_0x5b94f0[_0x6050('0x3c')]);_0x35f347[_0x6050('0x3f')]=_['intersection'](_0x5b94f0[_0x6050('0x40')],qs[_0x6050('0x41')](_0x162941[_0x6050('0x3c')][_0x6050('0x41')]));_0x35f347[_0x6050('0x3f')]=_0x35f347[_0x6050('0x3f')][_0x6050('0x42')]?_0x35f347[_0x6050('0x3f')]:_0x5b94f0['model'];if(!_0x162941['query'][_0x6050('0x43')](_0x6050('0x44'))){_0x35f347['limit']=qs[_0x6050('0x2b')](_0x162941['query'][_0x6050('0x2b')]);_0x35f347[_0x6050('0x29')]=qs[_0x6050('0x29')](_0x162941[_0x6050('0x3c')][_0x6050('0x29')]);}_0x35f347[_0x6050('0x45')]=qs[_0x6050('0x46')](_0x162941[_0x6050('0x3c')]['sort']);_0x35f347['where']=qs['filters'](_[_0x6050('0x47')](_0x162941[_0x6050('0x3c')],_0x5b94f0[_0x6050('0x3d')]),_0x5f24f1);if(_0x162941[_0x6050('0x3c')][_0x6050('0x48')]){_0x35f347[_0x6050('0x49')]=_[_0x6050('0x4a')](_0x35f347[_0x6050('0x49')],{'$or':_[_0x6050('0x37')](_0x5f24f1,function(_0x16283f){if(_0x16283f[_0x6050('0x3a')]!==_0x6050('0x4b')){var _0x57e2ed={};_0x57e2ed[_0x16283f['name']]={'$like':'%'+_0x162941[_0x6050('0x3c')][_0x6050('0x48')]+'%'};return _0x57e2ed;}})});}_0x35f347=_[_0x6050('0x4a')]({},_0x35f347,_0x162941[_0x6050('0x4c')]);var _0x4ff116={'where':_0x35f347['where']};return db[_0x6050('0x38')][_0x6050('0x2c')](_0x4ff116)['then'](function(_0x3dac47){_0x16e74e[_0x6050('0x2c')]=_0x3dac47;if(_0x162941[_0x6050('0x3c')]['includeAll']){_0x35f347['include']=[{'all':!![]}];}return db['Setting']['findAll'](_0x35f347);})[_0x6050('0x1a')](function(_0x1752ee){_0x16e74e[_0x6050('0x4d')]=_0x1752ee;return _0x16e74e;})[_0x6050('0x1a')](respondWithFilteredResult(_0x50f014,_0x35f347))[_0x6050('0x24')](handleError(_0x50f014,null));};exports[_0x6050('0x4e')]=function(_0x28f971,_0x2fec17){var _0x42471f={'raw':![],'where':{'id':_0x28f971[_0x6050('0x4f')]['id']}},_0x52580d={};_0x52580d[_0x6050('0x40')]=_[_0x6050('0x50')](db[_0x6050('0x38')][_0x6050('0x39')]);_0x52580d[_0x6050('0x3c')]=_[_0x6050('0x50')](_0x28f971[_0x6050('0x3c')]);_0x52580d['filters']=_['intersection'](_0x52580d['model'],_0x52580d[_0x6050('0x3c')]);_0x42471f[_0x6050('0x3f')]=_[_0x6050('0x3e')](_0x52580d[_0x6050('0x40')],qs[_0x6050('0x41')](_0x28f971['query'][_0x6050('0x41')]));_0x42471f[_0x6050('0x3f')]=_0x42471f[_0x6050('0x3f')]['length']?_0x42471f[_0x6050('0x3f')]:_0x52580d[_0x6050('0x40')];if(_0x28f971[_0x6050('0x3c')][_0x6050('0x51')]){_0x42471f[_0x6050('0x52')]=[{'all':!![]}];}_0x42471f=_['merge']({},_0x42471f,_0x28f971[_0x6050('0x4c')]);return db[_0x6050('0x38')]['find'](_0x42471f)[_0x6050('0x1a')](handleEntityNotFound(_0x2fec17,null))[_0x6050('0x1a')](respondWithResult(_0x2fec17,null))['catch'](handleError(_0x2fec17,null));};exports[_0x6050('0x31')]=function(_0x135a9d,_0x3e2861){if(_0x135a9d[_0x6050('0x53')]['id']){delete _0x135a9d['body']['id'];}return db['Setting'][_0x6050('0x54')]({'where':{'id':_0x135a9d[_0x6050('0x4f')]['id']}})[_0x6050('0x1a')](handleEntityNotFound(_0x3e2861,null))[_0x6050('0x1a')](saveUpdates(_0x135a9d[_0x6050('0x53')],null))[_0x6050('0x1a')](respondWithResult(_0x3e2861,null))[_0x6050('0x24')](handleError(_0x3e2861,null));};exports[_0x6050('0x55')]=function(_0xe4df85,_0x232c9f,_0x3ba734){if(_0xe4df85[_0x6050('0x56')]&&_0xe4df85[_0x6050('0x56')]['filename']){_0xe4df85['body'][_0x6050('0x57')]=_0xe4df85['file'][_0x6050('0x58')];}return db['Setting'][_0x6050('0x54')]({'where':{'id':_0xe4df85[_0x6050('0x4f')]['id']}})['then'](handleEntityNotFound(_0x232c9f,null))[_0x6050('0x1a')](saveUpdates(_0xe4df85[_0x6050('0x53')],null))[_0x6050('0x1a')](respondWithResult(_0x232c9f,null))[_0x6050('0x24')](handleError(_0x232c9f,null));};exports[_0x6050('0x59')]=function(_0x230d1a,_0x228b8c,_0x5aba76){if(_0x230d1a[_0x6050('0x56')]&&_0x230d1a['file']['filename']){_0x230d1a[_0x6050('0x53')]['loginLogo']=_0x230d1a[_0x6050('0x56')][_0x6050('0x58')];}return db[_0x6050('0x38')][_0x6050('0x54')]({'where':{'id':_0x230d1a['params']['id']}})[_0x6050('0x1a')](handleEntityNotFound(_0x228b8c,null))['then'](saveUpdates(_0x230d1a[_0x6050('0x53')],null))[_0x6050('0x1a')](respondWithResult(_0x228b8c,null))['catch'](handleError(_0x228b8c,null));};var utilLicense=require(_0x6050('0x16'));exports[_0x6050('0x5a')]=function(_0x412112,_0x15f415,_0x19b81b){var _0xe62909='server/files/images/logos';var _0x78fd3b={'custom':![]};return utilLicense[_0x6050('0x5b')]()[_0x6050('0x1a')](function(_0x3f8aac){if(_0x3f8aac){_0x78fd3b=_0x3f8aac;}return db[_0x6050('0x38')][_0x6050('0x54')]({'where':{'id':_0x412112[_0x6050('0x4f')]['id']},'attributes':[_0x6050('0x57'),'loginLogo',_0x6050('0x5c'),_0x6050('0x5d'),_0x6050('0x5e'),_0x6050('0x5f'),_0x6050('0x60'),_0x6050('0x61')],'raw':!![]});})[_0x6050('0x1a')](handleEntityNotFound(_0x15f415,null))[_0x6050('0x1a')](function(_0x55b1a2){if(_0x55b1a2){var _0x5c8122=_0x55b1a2['logo']&&fs['existsSync'](path[_0x6050('0x62')](config[_0x6050('0x63')],_0xe62909,_[_0x6050('0x64')](_0x55b1a2['logo'])))?path[_0x6050('0x62')](config[_0x6050('0x63')],_0xe62909,_['toLower'](_0x55b1a2[_0x6050('0x57')])):path['join'](config[_0x6050('0x63')],_0xe62909,_[_0x6050('0x64')]('default_logo.svg'));var _0x3a0945=_0x6050('0x65')+_[_0x6050('0x66')](_0x6050('0x57'));if(_0x55b1a2[_0x3a0945]||!_0x78fd3b[_0x6050('0x67')]){_0x5c8122=path['join'](config[_0x6050('0x63')],_0xe62909,_['toLower'](_0x6050('0x68')));}if(!fs[_0x6050('0x69')](_0x5c8122)){throw new db[(_0x6050('0x6a'))][(_0x6050('0x6b'))](_['upperFirst'](_0x6050('0x57'))+_0x6050('0x6c'));}return _0x15f415['download'](_0x5c8122);}})['catch'](handleError(_0x15f415,null));};var utilLicense=require(_0x6050('0x16'));exports[_0x6050('0x6d')]=function(_0x416195,_0x216aff,_0x172b7e){var _0x59873b=_0x6050('0x6e');var _0x5ad031={'custom':![]};return utilLicense[_0x6050('0x5b')]()[_0x6050('0x1a')](function(_0x400945){if(_0x400945){_0x5ad031=_0x400945;}return db['Setting'][_0x6050('0x54')]({'where':{'id':_0x416195[_0x6050('0x4f')]['id']},'attributes':[_0x6050('0x57'),_0x6050('0x6f'),_0x6050('0x5c'),_0x6050('0x5d'),'defaultLogo',_0x6050('0x5f'),_0x6050('0x60'),_0x6050('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x216aff,null))['then'](function(_0x17b765){if(_0x17b765){var _0x9105fe=_0x17b765[_0x6050('0x6f')]&&fs[_0x6050('0x69')](path[_0x6050('0x62')](config[_0x6050('0x63')],_0x59873b,_[_0x6050('0x64')](_0x17b765[_0x6050('0x6f')])))?path[_0x6050('0x62')](config[_0x6050('0x63')],_0x59873b,_[_0x6050('0x64')](_0x17b765[_0x6050('0x6f')])):path['join'](config[_0x6050('0x63')],_0x59873b,_[_0x6050('0x64')](_0x6050('0x70')));var _0x5a2b0d='default'+_['upperFirst']('loginLogo');if(_0x17b765[_0x5a2b0d]||!_0x5ad031['custom']){_0x9105fe=path[_0x6050('0x62')](config['root'],_0x59873b,_[_0x6050('0x64')](_0x6050('0x70')));}if(!fs['existsSync'](_0x9105fe)){throw new db['Sequelize'][(_0x6050('0x6b'))](_[_0x6050('0x66')](_0x6050('0x6f'))+_0x6050('0x6c'));}return _0x216aff['download'](_0x9105fe);}})[_0x6050('0x24')](handleError(_0x216aff,null));};exports[_0x6050('0x71')]=function(_0x5aaca5,_0x33e975){return db['Setting'][_0x6050('0x54')]({'where':{'id':_0x5aaca5[_0x6050('0x4f')]['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x33e975,null))[_0x6050('0x24')](handleError(_0x33e975,null));};exports[_0x6050('0x72')]=function(_0x26d37d,_0x56d712,_0x6257ca){if(_0x26d37d['file']&&_0x26d37d[_0x6050('0x56')][_0x6050('0x58')]){_0x26d37d[_0x6050('0x53')]['preferred']=_0x26d37d[_0x6050('0x56')][_0x6050('0x58')];}return db[_0x6050('0x38')]['find']({'where':{'id':_0x26d37d[_0x6050('0x4f')]['id']}})[_0x6050('0x1a')](handleEntityNotFound(_0x56d712,null))['then'](saveUpdates(_0x26d37d[_0x6050('0x53')],null))['then'](respondWithResult(_0x56d712,null))[_0x6050('0x24')](handleError(_0x56d712,null));};var utilLicense=require(_0x6050('0x16'));exports[_0x6050('0x73')]=function(_0x69cfb5,_0x4c6a0b,_0x4c7a42){var _0x39d139='server/files/images/logos';var _0x249a80={'custom':![]};return utilLicense[_0x6050('0x5b')]()[_0x6050('0x1a')](function(_0x3c147e){if(_0x3c147e){_0x249a80=_0x3c147e;}return db[_0x6050('0x38')]['find']({'where':{'id':_0x69cfb5[_0x6050('0x4f')]['id']},'attributes':[_0x6050('0x57'),_0x6050('0x6f'),'preferred',_0x6050('0x5d'),'defaultLogo','defaultLoginLogo',_0x6050('0x60'),'defaultFavicon'],'raw':!![]});})[_0x6050('0x1a')](handleEntityNotFound(_0x4c6a0b,null))['then'](function(_0x2f14f3){if(_0x2f14f3){var _0x3aaa63=_0x2f14f3[_0x6050('0x5c')]&&fs[_0x6050('0x69')](path['join'](config[_0x6050('0x63')],_0x39d139,_[_0x6050('0x64')](_0x2f14f3[_0x6050('0x5c')])))?path[_0x6050('0x62')](config[_0x6050('0x63')],_0x39d139,_[_0x6050('0x64')](_0x2f14f3['preferred'])):path[_0x6050('0x62')](config[_0x6050('0x63')],_0x39d139,_['toLower'](_0x6050('0x74')));var _0x10694c=_0x6050('0x65')+_[_0x6050('0x66')](_0x6050('0x5c'));if(_0x2f14f3[_0x10694c]||!_0x249a80[_0x6050('0x67')]||!_0x249a80['preferred']){_0x3aaa63=path[_0x6050('0x62')](config[_0x6050('0x63')],_0x39d139,_[_0x6050('0x64')](_0x6050('0x74')));}if(!fs['existsSync'](_0x3aaa63)){throw new db[(_0x6050('0x6a'))][(_0x6050('0x6b'))](_[_0x6050('0x66')](_0x6050('0x5c'))+_0x6050('0x6c'));}return _0x4c6a0b['download'](_0x3aaa63);}})[_0x6050('0x24')](handleError(_0x4c6a0b,null));};exports['addFavicon']=function(_0xc2d8de,_0xadc45e,_0x295689){if(_0xc2d8de[_0x6050('0x56')]&&_0xc2d8de[_0x6050('0x56')]['filename']){_0xc2d8de[_0x6050('0x53')][_0x6050('0x5d')]=_0xc2d8de[_0x6050('0x56')][_0x6050('0x58')];}return db[_0x6050('0x38')][_0x6050('0x54')]({'where':{'id':_0xc2d8de[_0x6050('0x4f')]['id']}})[_0x6050('0x1a')](handleEntityNotFound(_0xadc45e,null))[_0x6050('0x1a')](saveUpdates(_0xc2d8de[_0x6050('0x53')],null))[_0x6050('0x1a')](respondWithResult(_0xadc45e,null))[_0x6050('0x24')](handleError(_0xadc45e,null));};var utilLicense=require(_0x6050('0x16'));exports['getFavicon']=function(_0x1932a1,_0xc910f7,_0x32da97){var _0x19dab6='server/files/images/logos';var _0x5f7012={'custom':![]};return utilLicense[_0x6050('0x5b')]()[_0x6050('0x1a')](function(_0x125c0d){if(_0x125c0d){_0x5f7012=_0x125c0d;}return db['Setting'][_0x6050('0x54')]({'where':{'id':_0x1932a1[_0x6050('0x4f')]['id']},'attributes':[_0x6050('0x57'),_0x6050('0x6f'),_0x6050('0x5c'),_0x6050('0x5d'),_0x6050('0x5e'),_0x6050('0x5f'),'defaultPreferred',_0x6050('0x61')],'raw':!![]});})[_0x6050('0x1a')](handleEntityNotFound(_0xc910f7,null))[_0x6050('0x1a')](function(_0xb625ed){if(_0xb625ed){var _0x31b44c=_0xb625ed['favicon']&&fs['existsSync'](path[_0x6050('0x62')](config[_0x6050('0x63')],_0x19dab6,_[_0x6050('0x64')](_0xb625ed[_0x6050('0x5d')])))?path[_0x6050('0x62')](config['root'],_0x19dab6,_['toLower'](_0xb625ed[_0x6050('0x5d')])):path[_0x6050('0x62')](config['root'],_0x19dab6,_[_0x6050('0x64')](_0x6050('0x75')));var _0x51855c=_0x6050('0x65')+_[_0x6050('0x66')](_0x6050('0x5d'));if(_0xb625ed[_0x51855c]||!_0x5f7012['custom']){_0x31b44c=path[_0x6050('0x62')](config[_0x6050('0x63')],_0x19dab6,_['toLower'](_0x6050('0x75')));}if(!fs[_0x6050('0x69')](_0x31b44c)){throw new db[(_0x6050('0x6a'))][(_0x6050('0x6b'))](_[_0x6050('0x66')](_0x6050('0x5d'))+_0x6050('0x6c'));}return _0xc910f7[_0x6050('0x76')](_0x31b44c);}})[_0x6050('0x24')](handleError(_0xc910f7,null));};exports[_0x6050('0x77')]=function(_0x7a9455,_0x484ce9){var _0x40346e={'offset':moment()[_0x6050('0x78')]()};_0x40346e['now']=moment()[_0x6050('0x78')](_0x40346e['offset'])[_0x6050('0x79')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x484ce9[_0x6050('0x27')](0xc8)[_0x6050('0x35')](_0x40346e);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 10ee181..05a88ad 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 _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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':'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(_0x41f567,_0x3eb995){var _0x51dd07=function(_0x26694e){while(--_0x26694e){_0x41f567['push'](_0x41f567['shift']());}};_0x51dd07(++_0x3eb995);}(_0x34e8,0x12c));var _0x834e=function(_0x46004f,_0x5e5b0d){_0x46004f=_0x46004f-0x0;var _0x1c183b=_0x34e8[_0x46004f];return _0x1c183b;};'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 7be8fab..95285f4 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 _0x72b7=['randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','then','lodash','util','bluebird'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x72b7,0x114));var _0x772b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x72b7[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x772b('0x0'));var util=require(_0x772b('0x1'));var moment=require('moment');var BPromise=require(_0x772b('0x2'));var rs=require(_0x772b('0x3'));var fs=require('fs');var Redis=require(_0x772b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x772b('0x5'))('rpc');var config=require(_0x772b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x772b('0x7')][_0x772b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bed17,_0x32b4de,_0x77ddc){return new BPromise(function(_0x59756f,_0x44304d){return client[_0x772b('0x9')](_0x4bed17,_0x77ddc)['then'](function(_0x1ce686){logger[_0x772b('0xa')](_0x772b('0xb'),_0x32b4de,_0x772b('0xc'));logger[_0x772b('0xd')](_0x772b('0xe'),_0x32b4de,_0x772b('0xc'),JSON[_0x772b('0xf')](_0x1ce686));if(_0x1ce686[_0x772b('0x10')]){if(_0x1ce686[_0x772b('0x10')]['code']===0x1f4){logger[_0x772b('0x10')]('Setting,\x20%s,\x20%s',_0x32b4de,_0x1ce686[_0x772b('0x10')][_0x772b('0x11')]);return _0x44304d(_0x1ce686[_0x772b('0x10')][_0x772b('0x11')]);}logger[_0x772b('0x10')]('Setting,\x20%s,\x20%s',_0x32b4de,_0x1ce686[_0x772b('0x10')][_0x772b('0x11')]);return _0x59756f(_0x1ce686[_0x772b('0x10')]['message']);}else{logger[_0x772b('0xa')](_0x772b('0xb'),_0x32b4de,'request\x20sent');_0x59756f(_0x1ce686[_0x772b('0x12')][_0x772b('0x11')]);}})[_0x772b('0x13')](function(_0x5e282c){logger[_0x772b('0x10')](_0x772b('0xb'),_0x32b4de,_0x5e282c);_0x44304d(_0x5e282c);});});}exports[_0x772b('0x14')]=function(_0x174a77){var _0x220f1d=this;return new Promise(function(_0x49ded1,_0x9ea698){return db[_0x772b('0x15')][_0x772b('0x16')]({'raw':_0x174a77[_0x772b('0x17')]?_0x174a77[_0x772b('0x17')][_0x772b('0x18')]===undefined?!![]:![]:!![],'where':_0x174a77[_0x772b('0x17')]?_0x174a77['options'][_0x772b('0x19')]||null:null,'attributes':_0x174a77['options']?_0x174a77[_0x772b('0x17')][_0x772b('0x1a')]||null:null,'include':_0x174a77[_0x772b('0x17')]?_0x174a77[_0x772b('0x17')]['include']?_['map'](_0x174a77[_0x772b('0x17')][_0x772b('0x1b')],function(_0x4eaf1d){return{'model':db[_0x4eaf1d[_0x772b('0x1c')]],'as':_0x4eaf1d['as'],'attributes':_0x4eaf1d[_0x772b('0x1a')],'include':_0x4eaf1d[_0x772b('0x1b')]?_['map'](_0x4eaf1d[_0x772b('0x1b')],function(_0x299559){return{'model':db[_0x299559[_0x772b('0x1c')]],'as':_0x299559['as'],'attributes':_0x299559['attributes'],'include':_0x299559[_0x772b('0x1b')]?_[_0x772b('0x1d')](_0x299559[_0x772b('0x1b')],function(_0x2b018f){return{'model':db[_0x2b018f[_0x772b('0x1c')]],'as':_0x2b018f['as'],'attributes':_0x2b018f[_0x772b('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x772b('0x1e')](function(_0x333205){logger[_0x772b('0xa')](_0x772b('0x14'),_0x174a77);logger[_0x772b('0xd')](_0x772b('0x14'),_0x174a77,JSON[_0x772b('0xf')](_0x333205));_0x49ded1(_0x333205);})[_0x772b('0x13')](function(_0x2f7a02){logger['error'](_0x772b('0x14'),_0x2f7a02[_0x772b('0x11')],_0x174a77);_0x9ea698(_0x220f1d[_0x772b('0x10')](0x1f4,_0x2f7a02['message']));});});}; \ No newline at end of file +var _0x7dc9=['request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','options','raw','where','attributes','include','model','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x7dc9,0x16f));var _0x97dc=function(_0x30eda9,_0x7ef14e){_0x30eda9=_0x30eda9-0x0;var _0x208ae3=_0x7dc9[_0x30eda9];return _0x208ae3;};'use strict';var _=require('lodash');var util=require(_0x97dc('0x0'));var moment=require('moment');var BPromise=require(_0x97dc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x97dc('0x2'));var db=require(_0x97dc('0x3'))['db'];var utils=require(_0x97dc('0x4'));var logger=require(_0x97dc('0x5'))(_0x97dc('0x6'));var config=require(_0x97dc('0x7'));var jayson=require(_0x97dc('0x8'));var client=jayson[_0x97dc('0x9')][_0x97dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a7981,_0x411028,_0x448366){return new BPromise(function(_0x3c9ab4,_0x147ec5){return client[_0x97dc('0xb')](_0x1a7981,_0x448366)[_0x97dc('0xc')](function(_0x3e75b1){logger[_0x97dc('0xd')](_0x97dc('0xe'),_0x411028,'request\x20sent');logger[_0x97dc('0xf')](_0x97dc('0x10'),_0x411028,_0x97dc('0x11'),JSON[_0x97dc('0x12')](_0x3e75b1));if(_0x3e75b1['error']){if(_0x3e75b1[_0x97dc('0x13')][_0x97dc('0x14')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x411028,_0x3e75b1[_0x97dc('0x13')]['message']);return _0x147ec5(_0x3e75b1[_0x97dc('0x13')][_0x97dc('0x15')]);}logger[_0x97dc('0x13')]('Setting,\x20%s,\x20%s',_0x411028,_0x3e75b1[_0x97dc('0x13')][_0x97dc('0x15')]);return _0x3c9ab4(_0x3e75b1[_0x97dc('0x13')][_0x97dc('0x15')]);}else{logger[_0x97dc('0xd')](_0x97dc('0xe'),_0x411028,_0x97dc('0x11'));_0x3c9ab4(_0x3e75b1[_0x97dc('0x16')][_0x97dc('0x15')]);}})[_0x97dc('0x17')](function(_0x474e80){logger[_0x97dc('0x13')](_0x97dc('0xe'),_0x411028,_0x474e80);_0x147ec5(_0x474e80);});});}exports[_0x97dc('0x18')]=function(_0x2b6837){var _0x4e00f2=this;return new Promise(function(_0x54a3dc,_0x2ce918){return db[_0x97dc('0x19')]['find']({'raw':_0x2b6837[_0x97dc('0x1a')]?_0x2b6837[_0x97dc('0x1a')][_0x97dc('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b6837[_0x97dc('0x1a')]?_0x2b6837[_0x97dc('0x1a')][_0x97dc('0x1c')]||null:null,'attributes':_0x2b6837[_0x97dc('0x1a')]?_0x2b6837['options'][_0x97dc('0x1d')]||null:null,'include':_0x2b6837[_0x97dc('0x1a')]?_0x2b6837[_0x97dc('0x1a')][_0x97dc('0x1e')]?_['map'](_0x2b6837[_0x97dc('0x1a')]['include'],function(_0x26c3cb){return{'model':db[_0x26c3cb[_0x97dc('0x1f')]],'as':_0x26c3cb['as'],'attributes':_0x26c3cb[_0x97dc('0x1d')],'include':_0x26c3cb[_0x97dc('0x1e')]?_['map'](_0x26c3cb[_0x97dc('0x1e')],function(_0x490ebc){return{'model':db[_0x490ebc['model']],'as':_0x490ebc['as'],'attributes':_0x490ebc[_0x97dc('0x1d')],'include':_0x490ebc[_0x97dc('0x1e')]?_['map'](_0x490ebc['include'],function(_0x514fd8){return{'model':db[_0x514fd8[_0x97dc('0x1f')]],'as':_0x514fd8['as'],'attributes':_0x514fd8[_0x97dc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x97dc('0xc')](function(_0xa896ed){logger[_0x97dc('0xd')](_0x97dc('0x18'),_0x2b6837);logger[_0x97dc('0xf')](_0x97dc('0x18'),_0x2b6837,JSON[_0x97dc('0x12')](_0xa896ed));_0x54a3dc(_0xa896ed);})[_0x97dc('0x17')](function(_0x25816a){logger['error']('ShowSetting',_0x25816a[_0x97dc('0x15')],_0x2b6837);_0x2ce918(_0x4e00f2['error'](0x1f4,_0x25816a[_0x97dc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 2405c54..7423971 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(_0x1f39c9,_0x39ca18){var _0x5627d7=function(_0xc3d8fa){while(--_0xc3d8fa){_0x1f39c9['push'](_0x1f39c9['shift']());}};_0x5627d7(++_0x39ca18);}(_0x7a54,0x106));var _0x47a5=function(_0x505c96,_0x5d93e9){_0x505c96=_0x505c96-0x0;var _0x5c1d54=_0x7a54[_0x505c96];return _0x5c1d54;};'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(_0x3a58fc,_0x4787a9){var _0x5211fd=function(_0x55f5bf){while(--_0x55f5bf){_0x3a58fc['push'](_0x3a58fc['shift']());}};_0x5211fd(++_0x4787a9);}(_0x7a54,0x106));var _0x47a5=function(_0x391a45,_0x1296a8){_0x391a45=_0x391a45-0x0;var _0x5be5ea=_0x7a54[_0x391a45];return _0x5be5ea;};'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 ab39d46..0fc41f0 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 _0x4a44=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','ENUM','twilio','skebby','clicksend','plivo','bandwidth','csc','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'];(function(_0x2d7711,_0x279f33){var _0xaa8fef=function(_0x619cc0){while(--_0x619cc0){_0x2d7711['push'](_0x2d7711['shift']());}};_0xaa8fef(++_0x279f33);}(_0x4a44,0x1d0));var _0x44a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4a44[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x44a4('0x0'));var rs=require(_0x44a4('0x1'));module[_0x44a4('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x44a4('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x44a4('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x44a4('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x44a4('0x3')]},'type':{'type':Sequelize[_0x44a4('0x4')](_0x44a4('0x5'),_0x44a4('0x6'),'connectel',_0x44a4('0x7'),_0x44a4('0x8'),'clickatell',_0x44a4('0x9'),_0x44a4('0xa'),'infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x44a4('0x3')]},'authToken':{'type':Sequelize[_0x44a4('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x44a4('0x3')]},'password':{'type':Sequelize[_0x44a4('0x3')]},'apiKey':{'type':Sequelize[_0x44a4('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x44a4('0x3')]},'senderString':{'type':Sequelize[_0x44a4('0x3')]},'deliveryReport':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x44a4('0x3')]},'notificationTemplate':{'type':Sequelize[_0x44a4('0xc')],'defaultValue':function(){return _0x44a4('0xd');}},'notificationSound':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x44a4('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x44a4('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x44a4('0xe')],'comment':_0x44a4('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x44a4('0xb')],'defaultValue':![],'comment':_0x44a4('0x10'),'set':function(_0x5d735d){if(!_0x5d735d)this[_0x44a4('0x11')](_0x44a4('0x12'),null);this['setDataValue'](_0x44a4('0x13'),_0x5d735d);}}}; \ No newline at end of file +var _0x4aff=['bandwidth','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell'];(function(_0x24c194,_0xad42b5){var _0x46e37f=function(_0x9982d3){while(--_0x9982d3){_0x24c194['push'](_0x24c194['shift']());}};_0x46e37f(++_0xad42b5);}(_0x4aff,0x80));var _0xf4af=function(_0x51679b,_0x2d621c){_0x51679b=_0x51679b-0x0;var _0x4085f3=_0x4aff[_0x51679b];return _0x4085f3;};'use strict';var Sequelize=require(_0xf4af('0x0'));var rs=require(_0xf4af('0x1'));module[_0xf4af('0x2')]={'name':{'type':Sequelize[_0xf4af('0x3')],'unique':_0xf4af('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xf4af('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xf4af('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xf4af('0x3')],'defaultValue':function(){return rs[_0xf4af('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf4af('0x6')](_0xf4af('0x7'),_0xf4af('0x8'),_0xf4af('0x9'),_0xf4af('0xa'),'plivo',_0xf4af('0xb'),_0xf4af('0xc'),'csc',_0xf4af('0xd'),_0xf4af('0xe'))},'accountSid':{'type':Sequelize[_0xf4af('0x3')]},'authId':{'type':Sequelize[_0xf4af('0x3')]},'authToken':{'type':Sequelize[_0xf4af('0x3')]},'smsMethod':{'type':Sequelize[_0xf4af('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf4af('0x3')]},'apiKey':{'type':Sequelize[_0xf4af('0x3')]},'applicationId':{'type':Sequelize[_0xf4af('0x3')]},'accountId':{'type':Sequelize[_0xf4af('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xf4af('0xf')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf4af('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf4af('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf4af('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf4af('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf4af('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf4af('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xf4af('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf4af('0x11')],'comment':_0xf4af('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xf4af('0xf')],'defaultValue':![],'comment':_0xf4af('0x13'),'set':function(_0xb078aa){if(!_0xb078aa)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0xb078aa);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 8ddca04..4c77b7c 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 _0x2cbe=['message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/logger','api','../../config/license/util','defaults','redis','localhost','register','jayson/promise','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','SmsAccounts','sendStatus','stack','name','send','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','Applications','account','applications','orderBy','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','MessageSid','text','connectel','clicksend','messageId','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','SmsQueue','queueId','queue','waitForTheAssignedQueue','Start','startRouting','entity\x20found','Content-Type','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','SmsApplication','hasOwnProperty','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','CmList','List','SmsMessage','Messages','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby','requestid','statusInt','status_code','message_id','groupName','bandwidth','redif','error_code','update','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','csc'];(function(_0x3e444a,_0x5def2c){var _0x192cf9=function(_0x5d2abb){while(--_0x5d2abb){_0x3e444a['push'](_0x3e444a['shift']());}};_0x192cf9(++_0x5def2c);}(_0x2cbe,0xeb));var _0xe2cb=function(_0x4f75b5,_0x4db76d){_0x4f75b5=_0x4f75b5-0x0;var _0x5c263b=_0x2cbe[_0x4f75b5];return _0x5c263b;};'use strict';var emlformat=require(_0xe2cb('0x0'));var rimraf=require(_0xe2cb('0x1'));var zipdir=require(_0xe2cb('0x2'));var jsonpatch=require(_0xe2cb('0x3'));var rp=require(_0xe2cb('0x4'));var moment=require(_0xe2cb('0x5'));var BPromise=require(_0xe2cb('0x6'));var Mustache=require('mustache');var util=require(_0xe2cb('0x7'));var path=require(_0xe2cb('0x8'));var sox=require(_0xe2cb('0x9'));var csv=require(_0xe2cb('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2cb('0xb'));var _=require(_0xe2cb('0xc'));var squel=require(_0xe2cb('0xd'));var crypto=require(_0xe2cb('0xe'));var jsforce=require(_0xe2cb('0xf'));var deskjs=require(_0xe2cb('0x10'));var toCsv=require(_0xe2cb('0xa'));var querystring=require('querystring');var Papa=require(_0xe2cb('0x11'));var Redis=require(_0xe2cb('0x12'));var authService=require(_0xe2cb('0x13'));var qs=require(_0xe2cb('0x14'));var as=require(_0xe2cb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2cb('0x16'))(_0xe2cb('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe2cb('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe2cb('0x19')](config[_0xe2cb('0x1a')],{'host':_0xe2cb('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe2cb('0x1a')]));require('./smsAccount.socket')[_0xe2cb('0x1c')](socket);var jayson=require(_0xe2cb('0x1d'));var client=jayson['client'][_0xe2cb('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x44adb5,_0x1fef32,_0x19cad9,_0xf066cc){return new BPromise(function(_0x5ec517,_0x4ea3dd){var _0x480270=_0xf066cc||client;return _0x480270[_0xe2cb('0x1f')](_0x44adb5,_0x19cad9)['then'](function(_0x1bffe2){logger[_0xe2cb('0x20')](_0xe2cb('0x21'),_0x1fef32,_0xe2cb('0x22'));logger['debug'](_0xe2cb('0x23'),_0x1fef32,_0xe2cb('0x22'),JSON[_0xe2cb('0x24')](_0x1bffe2));if(_0x1bffe2['error']){if(_0x1bffe2[_0xe2cb('0x25')]['code']===0x1f4){logger[_0xe2cb('0x25')](_0xe2cb('0x21'),_0x1fef32,_0x1bffe2['error']['message']);return _0x4ea3dd(_0x1bffe2[_0xe2cb('0x25')][_0xe2cb('0x26')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x1fef32,_0x1bffe2[_0xe2cb('0x25')][_0xe2cb('0x26')]);return _0x5ec517(_0x1bffe2[_0xe2cb('0x25')][_0xe2cb('0x26')]);}else{logger[_0xe2cb('0x20')](_0xe2cb('0x21'),_0x1fef32,'request\x20sent');_0x5ec517(_0x1bffe2['result'][_0xe2cb('0x26')]);}})[_0xe2cb('0x27')](function(_0x1f22a7){logger[_0xe2cb('0x25')](_0xe2cb('0x21'),_0x1fef32,_0x1f22a7);_0x4ea3dd(_0x1f22a7);});});}function respondWithStatusCode(_0x4a5b28,_0x1958bb){_0x1958bb=_0x1958bb||0xcc;return function(_0x36f74c){if(_0x36f74c){return _0x4a5b28['sendStatus'](_0x1958bb);}return _0x4a5b28['status'](_0x1958bb)[_0xe2cb('0x28')]();};}function respondWithResult(_0x191afa,_0x3820e3){_0x3820e3=_0x3820e3||0xc8;return function(_0x370807){if(_0x370807){return _0x191afa[_0xe2cb('0x29')](_0x3820e3)[_0xe2cb('0x2a')](_0x370807);}};}function respondWithFilteredResult(_0x3c0cfc,_0x228984){return function(_0x1fe82b){if(_0x1fe82b){var _0x1e30d5=typeof _0x228984[_0xe2cb('0x2b')]===_0xe2cb('0x2c')&&typeof _0x228984['limit']==='undefined';var _0x4929ad=_0x1fe82b[_0xe2cb('0x2d')];var _0x229770=_0x1e30d5?0x0:_0x228984[_0xe2cb('0x2b')];var _0x542981=_0x1e30d5?_0x1fe82b[_0xe2cb('0x2d')]:_0x228984[_0xe2cb('0x2b')]+_0x228984[_0xe2cb('0x2e')];var _0x122f67;if(_0x542981>=_0x4929ad){_0x542981=_0x4929ad;_0x122f67=0xc8;}else{_0x122f67=0xce;}_0x3c0cfc[_0xe2cb('0x29')](_0x122f67);return _0x3c0cfc[_0xe2cb('0x2f')](_0xe2cb('0x30'),_0x229770+'-'+_0x542981+'/'+_0x4929ad)['json'](_0x1fe82b);}return null;};}function patchUpdates(_0x1d1d25){return function(_0x41374a){try{jsonpatch[_0xe2cb('0x31')](_0x41374a,_0x1d1d25,!![]);}catch(_0x3b8111){return BPromise['reject'](_0x3b8111);}return _0x41374a[_0xe2cb('0x32')]();};}function saveUpdates(_0x4c0c88,_0x21805f){return function(_0x3756b5){if(_0x3756b5){return _0x3756b5['update'](_0x4c0c88)[_0xe2cb('0x33')](function(_0x40fda9){return _0x40fda9;});}return null;};}function removeEntity(_0x55c808,_0x59dee5){return function(_0x409c4e){if(_0x409c4e){return _0x409c4e[_0xe2cb('0x34')]()[_0xe2cb('0x33')](function(){var _0x30735f=_0x409c4e[_0xe2cb('0x35')]({'plain':!![]});var _0x620677=_0xe2cb('0x36');return db['UserProfileResource'][_0xe2cb('0x34')]({'where':{'type':_0x620677,'resourceId':_0x30735f['id']}})[_0xe2cb('0x33')](function(){return _0x409c4e;});})[_0xe2cb('0x33')](function(){_0x55c808[_0xe2cb('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3310f6,_0x563334){return function(_0x5a2b29){if(!_0x5a2b29){_0x3310f6[_0xe2cb('0x37')](0x194);}return _0x5a2b29;};}function handleError(_0x4231d7,_0x10909f){_0x10909f=_0x10909f||0x1f4;return function(_0x4e70db){logger[_0xe2cb('0x25')](_0x4e70db[_0xe2cb('0x38')]);if(_0x4e70db[_0xe2cb('0x39')]){delete _0x4e70db['name'];}_0x4231d7[_0xe2cb('0x29')](_0x10909f)[_0xe2cb('0x3a')](_0x4e70db);};}exports['index']=function(_0x38838f,_0x5e7e5c){var _0x508856={'include':[{'model':db['Pause'],'as':_0xe2cb('0x3b')}]},_0xf24ae0={},_0x20c790={'count':0x0,'rows':[]};var _0x565772=_[_0xe2cb('0x3c')](db[_0xe2cb('0x3d')][_0xe2cb('0x3e')],function(_0x1b667f){return{'name':_0x1b667f[_0xe2cb('0x3f')],'type':_0x1b667f[_0xe2cb('0x40')][_0xe2cb('0x41')]};});_0xf24ae0[_0xe2cb('0x42')]=_[_0xe2cb('0x3c')](_0x565772,_0xe2cb('0x39'));_0xf24ae0['query']=_['keys'](_0x38838f[_0xe2cb('0x43')]);_0xf24ae0[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0xf24ae0['model'],_0xf24ae0[_0xe2cb('0x43')]);_0x508856[_0xe2cb('0x46')]=_['intersection'](_0xf24ae0[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x38838f[_0xe2cb('0x43')]['fields']));_0x508856['attributes']=_0x508856['attributes'][_0xe2cb('0x48')]?_0x508856[_0xe2cb('0x46')]:_0xf24ae0['model'];if(!_0x38838f[_0xe2cb('0x43')]['hasOwnProperty'](_0xe2cb('0x49'))){_0x508856[_0xe2cb('0x2e')]=qs['limit'](_0x38838f['query']['limit']);_0x508856[_0xe2cb('0x2b')]=qs[_0xe2cb('0x2b')](_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}_0x508856[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x508856['where']=qs['filters'](_[_0xe2cb('0x4c')](_0x38838f[_0xe2cb('0x43')],_0xf24ae0[_0xe2cb('0x44')]),_0x565772);if(_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x4d')]){_0x508856[_0xe2cb('0x4e')]=_['merge'](_0x508856[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x565772,function(_0x24b762){if(_0x24b762['type']!=='VIRTUAL'){var _0x3f137e={};_0x3f137e[_0x24b762[_0xe2cb('0x39')]]={'$like':'%'+_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x4d')]+'%'};return _0x3f137e;}})});}_0x508856=_[_0xe2cb('0x4f')]({},_0x508856,_0x38838f[_0xe2cb('0x50')]);var _0x2791eb={'where':_0x508856[_0xe2cb('0x4e')]};return db[_0xe2cb('0x3d')][_0xe2cb('0x2d')](_0x2791eb)['then'](function(_0x50bbf8){_0x20c790[_0xe2cb('0x2d')]=_0x50bbf8;if(_0x38838f[_0xe2cb('0x43')][_0xe2cb('0x51')]){_0x508856[_0xe2cb('0x52')]=[{'all':!![]}];}return db[_0xe2cb('0x3d')]['findAll'](_0x508856);})['then'](function(_0x1787db){_0x20c790[_0xe2cb('0x53')]=_0x1787db;return _0x20c790;})[_0xe2cb('0x33')](respondWithFilteredResult(_0x5e7e5c,_0x508856))['catch'](handleError(_0x5e7e5c,null));};exports[_0xe2cb('0x54')]=function(_0x48312f,_0x4ea6de){var _0x3e9aa9={'raw':![],'where':{'id':_0x48312f[_0xe2cb('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xe2cb('0x3b')}]},_0x50ca7b={};_0x50ca7b[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db['SmsAccount'][_0xe2cb('0x3e')]);_0x50ca7b[_0xe2cb('0x43')]=_[_0xe2cb('0x56')](_0x48312f['query']);_0x50ca7b['filters']=_[_0xe2cb('0x45')](_0x50ca7b[_0xe2cb('0x42')],_0x50ca7b[_0xe2cb('0x43')]);_0x3e9aa9['attributes']=_[_0xe2cb('0x45')](_0x50ca7b[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x48312f[_0xe2cb('0x43')]['fields']));_0x3e9aa9[_0xe2cb('0x46')]=_0x3e9aa9[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x3e9aa9['attributes']:_0x50ca7b[_0xe2cb('0x42')];if(_0x48312f[_0xe2cb('0x43')][_0xe2cb('0x51')]){_0x3e9aa9[_0xe2cb('0x52')]=[{'all':!![]}];}_0x3e9aa9=_[_0xe2cb('0x4f')]({},_0x3e9aa9,_0x48312f['options']);return db['SmsAccount']['find'](_0x3e9aa9)[_0xe2cb('0x33')](handleEntityNotFound(_0x4ea6de,null))[_0xe2cb('0x33')](respondWithResult(_0x4ea6de,null))['catch'](handleError(_0x4ea6de,null));};exports[_0xe2cb('0x57')]=function(_0x9c86fc,_0x49148f){return db[_0xe2cb('0x3d')][_0xe2cb('0x57')](_0x9c86fc[_0xe2cb('0x58')],{})['then'](function(_0x2c322b){var _0x3ec0f4=_0x9c86fc[_0xe2cb('0x59')][_0xe2cb('0x35')]({'plain':!![]});if(!_0x3ec0f4)throw new Error(_0xe2cb('0x5a'));if(_0x3ec0f4[_0xe2cb('0x5b')]===_0xe2cb('0x59')){var _0x273513=_0x2c322b[_0xe2cb('0x35')]({'plain':!![]});var _0x1f3d3c=_0xe2cb('0x36');return db[_0xe2cb('0x5c')][_0xe2cb('0x5d')]({'where':{'name':_0x1f3d3c,'userProfileId':_0x3ec0f4['userProfileId']},'raw':!![]})[_0xe2cb('0x33')](function(_0xa3f040){if(_0xa3f040&&_0xa3f040['autoAssociation']===0x0){return db[_0xe2cb('0x5e')]['create']({'name':_0x273513[_0xe2cb('0x39')],'resourceId':_0x273513['id'],'type':_0xa3f040[_0xe2cb('0x39')],'sectionId':_0xa3f040['id']},{})['then'](function(){return _0x2c322b;});}else{return _0x2c322b;}})[_0xe2cb('0x27')](function(_0x5471e8){logger['error'](_0xe2cb('0x5f'),_0x5471e8);throw _0x5471e8;});}return _0x2c322b;})[_0xe2cb('0x33')](respondWithResult(_0x49148f,0xc9))[_0xe2cb('0x27')](handleError(_0x49148f,null));};exports['update']=function(_0x2d0ecd,_0xa4722a){if(_0x2d0ecd['body']['id']){delete _0x2d0ecd[_0xe2cb('0x58')]['id'];}return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x2d0ecd[_0xe2cb('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0xe2cb('0x3b')}]})[_0xe2cb('0x33')](handleEntityNotFound(_0xa4722a,null))[_0xe2cb('0x33')](saveUpdates(_0x2d0ecd[_0xe2cb('0x58')],null))['then'](respondWithResult(_0xa4722a,null))[_0xe2cb('0x27')](handleError(_0xa4722a,null));};exports[_0xe2cb('0x34')]=function(_0x2e3582,_0x263f65){return db['SmsAccount']['find']({'where':{'id':_0x2e3582['params']['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x263f65,null))[_0xe2cb('0x33')](removeEntity(_0x263f65,null))[_0xe2cb('0x27')](handleError(_0x263f65,null));};exports[_0xe2cb('0x60')]=function(_0x4dea7e,_0x24e642){return db['SmsAccount'][_0xe2cb('0x60')]()['then'](respondWithResult(_0x24e642,null))[_0xe2cb('0x27')](handleError(_0x24e642,null));};exports[_0xe2cb('0x61')]=function(_0x5451d9,_0x11163c,_0x3b54ea){if(_0x5451d9[_0xe2cb('0x58')]['id']){delete _0x5451d9['body']['id'];}return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x5451d9[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x11163c,null))[_0xe2cb('0x33')](function(_0x2a0672){if(_0x2a0672){_0x5451d9[_0xe2cb('0x58')][_0xe2cb('0x62')]=_0x2a0672['id'];return db[_0xe2cb('0x63')][_0xe2cb('0x57')](_0x5451d9['body']);}})[_0xe2cb('0x33')](respondWithResult(_0x11163c,null))[_0xe2cb('0x27')](handleError(_0x11163c,null));};exports['getDispositions']=function(_0x44819f,_0x573db4,_0x3cf74f){var _0x454564={'raw':![],'where':{}};var _0x2a0f21={};var _0x98b073={'count':0x0,'rows':[]};return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x44819f[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x573db4,null))[_0xe2cb('0x33')](function(_0x4bc724){if(_0x4bc724){_0x2a0f21[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db[_0xe2cb('0x63')][_0xe2cb('0x3e')]);_0x2a0f21['query']=_[_0xe2cb('0x56')](_0x44819f[_0xe2cb('0x43')]);_0x2a0f21['filters']=_[_0xe2cb('0x45')](_0x2a0f21[_0xe2cb('0x42')],_0x2a0f21[_0xe2cb('0x43')]);_0x454564['attributes']=_[_0xe2cb('0x45')](_0x2a0f21[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x44819f[_0xe2cb('0x43')]['fields']));_0x454564[_0xe2cb('0x46')]=_0x454564[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x454564[_0xe2cb('0x46')]:_0x2a0f21[_0xe2cb('0x42')];if(!_0x44819f[_0xe2cb('0x43')]['hasOwnProperty'](_0xe2cb('0x49'))){_0x454564[_0xe2cb('0x2e')]=qs[_0xe2cb('0x2e')](_0x44819f[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x454564[_0xe2cb('0x2b')]=qs['offset'](_0x44819f[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}_0x454564[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x44819f[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x454564['where']=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x44819f['query'],_0x2a0f21[_0xe2cb('0x44')]));_0x454564[_0xe2cb('0x4e')][_0xe2cb('0x62')]=_0x4bc724['id'];if(_0x44819f['query'][_0xe2cb('0x4d')]){_0x454564['where']=_[_0xe2cb('0x4f')](_0x454564[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x454564[_0xe2cb('0x46')],function(_0x2505f4){var _0x208d38={};_0x208d38[_0x2505f4]={'$like':'%'+_0x44819f['query'][_0xe2cb('0x4d')]+'%'};return _0x208d38;})});}_0x454564=_[_0xe2cb('0x4f')]({},_0x454564,_0x44819f[_0xe2cb('0x50')]);return db[_0xe2cb('0x63')]['count']({'where':_0x454564['where']})['then'](function(_0x13485d){_0x98b073[_0xe2cb('0x2d')]=_0x13485d;if(_0x44819f['query'][_0xe2cb('0x51')]){_0x454564[_0xe2cb('0x52')]=[{'all':!![]}];}return db['Disposition'][_0xe2cb('0x65')](_0x454564);})[_0xe2cb('0x33')](function(_0x33301a){_0x98b073['rows']=_0x33301a;return _0x98b073;});}})['then'](respondWithFilteredResult(_0x573db4,_0x454564))[_0xe2cb('0x27')](handleError(_0x573db4,null));};exports[_0xe2cb('0x66')]=function(_0xa5b3cb,_0x51be50,_0x3071a7){return db['SmsAccount'][_0xe2cb('0x5d')]({'where':{'id':_0xa5b3cb[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x51be50,null))[_0xe2cb('0x33')](function(_0x206cec){if(_0x206cec){return _0x206cec[_0xe2cb('0x66')](_0xa5b3cb[_0xe2cb('0x43')][_0xe2cb('0x67')]);}})['then'](respondWithStatusCode(_0x51be50,null))[_0xe2cb('0x27')](handleError(_0x51be50,null));};exports['addAnswer']=function(_0x378625,_0x283f8b,_0x29e75f){if(_0x378625[_0xe2cb('0x58')]['id']){delete _0x378625[_0xe2cb('0x58')]['id'];}return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x378625[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x283f8b,null))[_0xe2cb('0x33')](function(_0x2a9c1f){if(_0x2a9c1f){_0x378625[_0xe2cb('0x58')][_0xe2cb('0x62')]=_0x2a9c1f['id'];return db[_0xe2cb('0x68')]['create'](_0x378625['body']);}})[_0xe2cb('0x33')](respondWithResult(_0x283f8b,null))[_0xe2cb('0x27')](handleError(_0x283f8b,null));};exports[_0xe2cb('0x69')]=function(_0x2aaab0,_0x499c6e,_0x43918f){var _0x1229ae={'raw':![],'where':{}};var _0x147e63={};var _0x11783d={'count':0x0,'rows':[]};return db['SmsAccount'][_0xe2cb('0x64')]({'where':{'id':_0x2aaab0[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x499c6e,null))[_0xe2cb('0x33')](function(_0x53732b){if(_0x53732b){_0x147e63[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db[_0xe2cb('0x68')][_0xe2cb('0x3e')]);_0x147e63['query']=_[_0xe2cb('0x56')](_0x2aaab0['query']);_0x147e63['filters']=_[_0xe2cb('0x45')](_0x147e63[_0xe2cb('0x42')],_0x147e63[_0xe2cb('0x43')]);_0x1229ae[_0xe2cb('0x46')]=_['intersection'](_0x147e63[_0xe2cb('0x42')],qs['fields'](_0x2aaab0[_0xe2cb('0x43')]['fields']));_0x1229ae[_0xe2cb('0x46')]=_0x1229ae[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x1229ae[_0xe2cb('0x46')]:_0x147e63['model'];if(!_0x2aaab0['query']['hasOwnProperty'](_0xe2cb('0x49'))){_0x1229ae[_0xe2cb('0x2e')]=qs[_0xe2cb('0x2e')](_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x1229ae[_0xe2cb('0x2b')]=qs['offset'](_0x2aaab0['query'][_0xe2cb('0x2b')]);}_0x1229ae[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x1229ae[_0xe2cb('0x4e')]=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x2aaab0[_0xe2cb('0x43')],_0x147e63[_0xe2cb('0x44')]));_0x1229ae['where']['SmsAccountId']=_0x53732b['id'];if(_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x4d')]){_0x1229ae[_0xe2cb('0x4e')]=_[_0xe2cb('0x4f')](_0x1229ae[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x1229ae[_0xe2cb('0x46')],function(_0x526945){var _0x26ecf1={};_0x26ecf1[_0x526945]={'$like':'%'+_0x2aaab0[_0xe2cb('0x43')]['filter']+'%'};return _0x26ecf1;})});}_0x1229ae=_[_0xe2cb('0x4f')]({},_0x1229ae,_0x2aaab0[_0xe2cb('0x50')]);return db[_0xe2cb('0x68')][_0xe2cb('0x2d')]({'where':_0x1229ae[_0xe2cb('0x4e')]})['then'](function(_0x782837){_0x11783d[_0xe2cb('0x2d')]=_0x782837;if(_0x2aaab0[_0xe2cb('0x43')][_0xe2cb('0x51')]){_0x1229ae[_0xe2cb('0x52')]=[{'all':!![]}];}return db[_0xe2cb('0x68')][_0xe2cb('0x65')](_0x1229ae);})[_0xe2cb('0x33')](function(_0x53a9d6){_0x11783d[_0xe2cb('0x53')]=_0x53a9d6;return _0x11783d;});}})[_0xe2cb('0x33')](respondWithFilteredResult(_0x499c6e,_0x1229ae))[_0xe2cb('0x27')](handleError(_0x499c6e,null));};exports['removeAnswers']=function(_0x3e0b1a,_0x182ffd,_0xffc224){return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x3e0b1a[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x182ffd,null))[_0xe2cb('0x33')](function(_0x53ab77){if(_0x53ab77){return _0x53ab77[_0xe2cb('0x6a')](_0x3e0b1a['query']['ids']);}})[_0xe2cb('0x33')](respondWithStatusCode(_0x182ffd,null))['catch'](handleError(_0x182ffd,null));};exports['notify']=function(_0x3361a2,_0x1746c4,_0x72eeae){var _0xaf7685={'channel':'sms'};var _0x37c2c5=[];var _0x197c21=[];var _0x596f1a={};return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x3361a2[_0xe2cb('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xe2cb('0x6b')}]})[_0xe2cb('0x33')](handleEntityNotFound(_0x1746c4,null))[_0xe2cb('0x33')](function(_0x65c980){_0xaf7685[_0xe2cb('0x6c')]=_0x65c980;_0xaf7685[_0xe2cb('0x6d')]=_[_0xe2cb('0x6e')](_0x65c980[_0xe2cb('0x6b')],['priority'],['asc']);if(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x6b')]){delete _0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x6b')];}return db[_0xe2cb('0x6f')][_0xe2cb('0x60')]();})[_0xe2cb('0x33')](function(_0x4c7561){if(!_0x4c7561){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x71'));}_0x37c2c5=_[_0xe2cb('0x72')](_[_0xe2cb('0x56')](_0x4c7561),['createdAt','updatedAt']);_0x197c21=_[_0xe2cb('0x72')](_[_0xe2cb('0x56')](_0x4c7561),[_0xe2cb('0x73'),_0xe2cb('0x74'),_0xe2cb('0x75'),_0xe2cb('0x76')]);_0xaf7685['body']={'mapKey':_0xe2cb('0x77')};if(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x40')]){switch(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x40')]){case _0xe2cb('0x78'):_0xaf7685['body'][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7a')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7b')];_0xaf7685[_0xe2cb('0x58')]['messageId']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7c')];break;case'skebby':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]='+'+_0x3361a2[_0xe2cb('0x58')]['sender'];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7d')];break;case _0xe2cb('0x7e'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2['body'][_0xe2cb('0x79')];_0xaf7685['body'][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x26')];break;case _0xe2cb('0x7f'):_0xaf7685[_0xe2cb('0x58')]['from']=_0x3361a2[_0xe2cb('0x58')]['from'];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2['body'][_0xe2cb('0x58')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x80')]=_0x3361a2[_0xe2cb('0x58')]['message_id'];break;case'plivo':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7a')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x81')];_0xaf7685['body']['messageId']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x82')];break;case _0xe2cb('0x83'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]='+'+_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x84')][0x0][_0xe2cb('0x79')];_0xaf7685['body'][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x84')][0x0][_0xe2cb('0x7d')];_0xaf7685[_0xe2cb('0x58')]['messageId']=_0x3361a2[_0xe2cb('0x58')]['results'][0x0][_0xe2cb('0x80')];break;case'csc':_0xaf7685[_0xe2cb('0x58')]['from']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x85')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x86')][_0xe2cb('0x26')];break;case _0xe2cb('0x87'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x88')];_0xaf7685['body'][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x7d')];_0xaf7685['body'][_0xe2cb('0x80')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x89')];break;case'bandwidth':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x80')]=_0x3361a2[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')]['id'];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][0x0]['message'][_0xe2cb('0x79')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')][_0xe2cb('0x7d')];break;case _0xe2cb('0x8a'):_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')]=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x79')];_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')]=_0x3361a2[_0xe2cb('0x58')]['message'];_0xaf7685[_0xe2cb('0x58')]['messageId']=_0x3361a2[_0xe2cb('0x58')][_0xe2cb('0x8b')];break;}}if(_0xaf7685['body']['id']){delete _0xaf7685[_0xe2cb('0x58')]['id'];}if(_['isNil'](_0xaf7685['body'][_0xe2cb('0x79')])){throw new db[(_0xe2cb('0x70'))][(_0xe2cb('0x8c'))]('from\x20is\x20mandatory');}if(_[_0xe2cb('0x8d')](_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x58')])||_0xaf7685['body']['body']===''){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x8e'));}if(_['isNil'](_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x8f')])){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x90')+_0x197c21);}if(!_['includes'](_0x197c21,_0xaf7685['body'][_0xe2cb('0x8f')])){throw new db[(_0xe2cb('0x70'))]['ValidationError'](_0xe2cb('0x91')+_0x197c21);}_0x596f1a[_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x8f')]]=_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')];return db['CmList'][_0xe2cb('0x5d')]({'where':{'id':_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x76')]},'include':[{'model':db['CmContact'],'as':_0xe2cb('0x92'),'where':_0x596f1a,'limit':0x1,'order':[[_0xe2cb('0x74'),_0xe2cb('0x93')]]}]});})[_0xe2cb('0x33')](handleEntityNotFound(_0x1746c4,null))[_0xe2cb('0x33')](function(_0x5b25d7){if(_0x5b25d7){_0xaf7685['list']=_['omit'](_0x5b25d7,[_0xe2cb('0x92')]);if(_0x5b25d7[_0xe2cb('0x92')][_0xe2cb('0x48')]){return _0x5b25d7['Contacts'][0x0];}var _0x467a76=_[_0xe2cb('0x19')](_0xaf7685[_0xe2cb('0x58')],{'firstName':_0xaf7685['body'][_0xe2cb('0x79')],'ListId':_0x5b25d7['id']});_0x467a76[_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x8f')]]=_0xaf7685[_0xe2cb('0x58')]['from'];return db['CmContact'][_0xe2cb('0x57')](_0x467a76,{'fields':_0x37c2c5,'raw':!![]});}})[_0xe2cb('0x33')](handleEntityNotFound(_0x1746c4,null))[_0xe2cb('0x33')](function(_0x50c9e0){if(_0x50c9e0){_0xaf7685[_0xe2cb('0x94')]=_0x50c9e0;var _0x595362={'ContactId':_0x50c9e0['id'],'phone':_0xaf7685['body'][_0xe2cb('0x79')],'SmsAccountId':_0x3361a2[_0xe2cb('0x55')]['id']};var _0x3ccfc8={'ContactId':_0x50c9e0['id'],'SmsAccountId':_0x3361a2[_0xe2cb('0x55')]['id'],'closed':![]};return db[_0xe2cb('0x95')]['find']({'where':_0x3ccfc8})['then'](function(_0xc1250b){if(_0xc1250b){return[_0xc1250b,![]];}return db[_0xe2cb('0x95')][_0xe2cb('0x57')](_0x595362)[_0xe2cb('0x33')](function(_0x2faddd){return[_0x2faddd,!![]];});});}})[_0xe2cb('0x96')](function(_0x54f0c6,_0xf10ce9){_0xaf7685[_0xe2cb('0x97')]=_0x54f0c6[_0xe2cb('0x35')]({'plain':!![]});_0xaf7685['interaction'][_0xe2cb('0x98')]=![];if(_0xf10ce9){if(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0x99')]){_0xaf7685[_0xe2cb('0x6d')][_0xe2cb('0x9a')]({'id':0x0,'priority':_0xaf7685['applications'][_0xe2cb('0x48')]+0x1,'app':_0xe2cb('0x9b'),'appdata':_0xe2cb('0x9c'),'interval':_0xe2cb('0x9d')});}_0xaf7685['interaction'][_0xe2cb('0x98')]=!![];}return db['SmsMessage']['create']({'phone':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x79')],'messageId':_0xaf7685['body'][_0xe2cb('0x80')],'body':_0xaf7685[_0xe2cb('0x58')]['body'],'SmsAccountId':_0x3361a2[_0xe2cb('0x55')]['id'],'SmsInteractionId':_0x54f0c6['id'],'direction':'in','ContactId':_0x54f0c6['ContactId'],'AttachmentId':_0xaf7685[_0xe2cb('0x58')][_0xe2cb('0x9e')]});})['then'](function(_0x2c4b2c){_0xaf7685[_0xe2cb('0x26')]=_0x2c4b2c;if(!_0xaf7685[_0xe2cb('0x97')][_0xe2cb('0x9f')])return;return db[_0xe2cb('0xa0')]['find']({'attributes':['id',_0xe2cb('0x39')],'where':{'id':_0xaf7685[_0xe2cb('0x97')]['UserId']}});})['then'](function(_0x2730f4){if(_0x2730f4){_0xaf7685['applications'][_0xe2cb('0xa1')]({'id':0x0,'priority':0x0,'app':_0xe2cb('0xa2'),'appdata':_0x2730f4[_0xe2cb('0x39')]+','+(_0xaf7685['account']['waitForTheAssignedAgent']||0xa),'interval':_0xe2cb('0x9d')});}if(!_0xaf7685[_0xe2cb('0x97')]['queueId'])return;return db[_0xe2cb('0xa3')][_0xe2cb('0x5d')]({'attributes':['id',_0xe2cb('0x39')],'where':{'id':_0xaf7685[_0xe2cb('0x97')][_0xe2cb('0xa4')]}});})[_0xe2cb('0x33')](function(_0x41e5f9){if(_0x41e5f9){_0xaf7685[_0xe2cb('0x6d')][_0xe2cb('0xa1')]({'id':0x0,'priority':0x1,'app':_0xe2cb('0xa5'),'appdata':_0x41e5f9[_0xe2cb('0x39')]+','+(_0xaf7685[_0xe2cb('0x6c')][_0xe2cb('0xa6')]||0x12c),'interval':_0xe2cb('0x9d')});}return respondWithRpcPromise(_0xe2cb('0xa7'),_0xe2cb('0xa8'),_0xaf7685);})[_0xe2cb('0x33')](function(_0x284553){if(_0x284553){var _0x5f0fbd=0xc8;var _0x3d208c='receiveMessage';logger[_0xe2cb('0x20')](_0xe2cb('0x23'),_0x3d208c,_0x5f0fbd,_0xe2cb('0xa9'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x3d208c,_0x5f0fbd,'entity\x20found',JSON[_0xe2cb('0x24')](_0x284553));if(_0xaf7685[_0xe2cb('0x6c')]['type']===_0xe2cb('0x78')){return _0x1746c4['status'](_0x5f0fbd)[_0xe2cb('0x2f')](_0xe2cb('0xaa'),'text/xml')[_0xe2cb('0x3a')](_0xe2cb('0xab'));}else{return _0x1746c4[_0xe2cb('0x29')](_0x5f0fbd)['json'](_0x284553);}}})['catch'](handleError(_0x1746c4,null));};exports[_0xe2cb('0xac')]=function(_0x52328e,_0x473b74){var _0x549df3=_0x52328e[_0xe2cb('0x55')]['id'];var _0x15c9a6=_0x52328e[_0xe2cb('0x58')];var _0x10b3a8=0xc8;var _0x5c175b=null;return db[_0xe2cb('0xad')][_0xe2cb('0xae')]({'isolationLevel':db[_0xe2cb('0xad')][_0xe2cb('0xaf')]['ISOLATION_LEVELS'][_0xe2cb('0xb0')]},function(_0xfbe6c7){return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x549df3},'transaction':_0xfbe6c7})[_0xe2cb('0x33')](function(_0xb622a8){if(_0xb622a8){return db['SmsApplication'][_0xe2cb('0x34')]({'where':{'SmsAccountId':_0x549df3},'transaction':_0xfbe6c7})['then'](function(){var _0xc79907=_[_0xe2cb('0x3c')](_0x15c9a6,function(_0x1c516e){_0x1c516e[_0xe2cb('0x62')]=_0x549df3;return _0x1c516e;});return db['SmsApplication'][_0xe2cb('0xb1')](_0xc79907,{'transaction':_0xfbe6c7});});}else{_0x10b3a8=0x194;_0x5c175b=[];}});})[_0xe2cb('0x33')](function(){if(_0x10b3a8!==0x194){return db['SmsApplication'][_0xe2cb('0xb2')]({'where':{'SmsAccountId':_0x549df3},'order':_0xe2cb('0xb3')})['then'](function(_0x3dbdc7){_0x5c175b=_0x3dbdc7;});}})['catch'](function(_0xc61360){_0x10b3a8=0x1f4;logger['error'](_0xc61360[_0xe2cb('0x38')]);if(_0xc61360[_0xe2cb('0x39')]){delete _0xc61360[_0xe2cb('0x39')];}_0x5c175b=_0xc61360;})[_0xe2cb('0xb4')](function(){if(_0x5c175b===null){_0x473b74[_0xe2cb('0x37')](_0x10b3a8);}else{if(_0x10b3a8===0x1f4){_0x473b74[_0xe2cb('0x29')](_0x10b3a8)[_0xe2cb('0x3a')](_0x5c175b);}else{_0x473b74[_0xe2cb('0x29')](_0x10b3a8)[_0xe2cb('0x2a')](_0x5c175b);}}});};exports[_0xe2cb('0xb5')]=function(_0x1f9a29,_0x594cec,_0x272bd3){var _0x4cc0e5={};var _0x1dcb09={};var _0x178aa3;var _0x4c6b6e;return db[_0xe2cb('0x3d')]['findOne']({'where':{'id':_0x1f9a29['params']['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x594cec,null))[_0xe2cb('0x33')](function(_0x253b61){if(_0x253b61){_0x178aa3=_0x253b61;_0x1dcb09[_0xe2cb('0x42')]=_['keys'](db[_0xe2cb('0xb6')][_0xe2cb('0x3e')]);_0x1dcb09[_0xe2cb('0x43')]=_[_0xe2cb('0x56')](_0x1f9a29[_0xe2cb('0x43')]);_0x1dcb09[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0x1dcb09[_0xe2cb('0x42')],_0x1dcb09[_0xe2cb('0x43')]);_0x4cc0e5[_0xe2cb('0x46')]=_['intersection'](_0x1dcb09[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x1f9a29['query'][_0xe2cb('0x47')]));_0x4cc0e5['attributes']=_0x4cc0e5[_0xe2cb('0x46')][_0xe2cb('0x48')]?_0x4cc0e5[_0xe2cb('0x46')]:_0x1dcb09[_0xe2cb('0x42')];_0x4cc0e5[_0xe2cb('0x4a')]=qs[_0xe2cb('0x4b')](_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x4cc0e5[_0xe2cb('0x4e')]=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x1f9a29[_0xe2cb('0x43')],_0x1dcb09[_0xe2cb('0x44')]));if(_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x4d')]){_0x4cc0e5[_0xe2cb('0x4e')]=_[_0xe2cb('0x4f')](_0x4cc0e5[_0xe2cb('0x4e')],{'$or':_[_0xe2cb('0x3c')](_0x4cc0e5[_0xe2cb('0x46')],function(_0x2796bc){var _0x47ec26={};_0x47ec26[_0x2796bc]={'$like':'%'+_0x1f9a29[_0xe2cb('0x43')]['filter']+'%'};return _0x47ec26;})});}_0x4cc0e5=_['merge']({},_0x4cc0e5,_0x1f9a29[_0xe2cb('0x50')]);return _0x178aa3[_0xe2cb('0xb5')](_0x4cc0e5);}})[_0xe2cb('0x33')](function(_0x17ea0a){if(_0x17ea0a){_0x4c6b6e=_0x17ea0a[_0xe2cb('0x48')];if(!_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0xb7')]('nolimit')){_0x4cc0e5[_0xe2cb('0x2e')]=qs[_0xe2cb('0x2e')](_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x4cc0e5[_0xe2cb('0x2b')]=qs['offset'](_0x1f9a29[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}return _0x178aa3[_0xe2cb('0xb5')](_0x4cc0e5);}})[_0xe2cb('0x33')](function(_0x52904d){if(_0x52904d){return _0x52904d?{'count':_0x4c6b6e,'rows':_0x52904d}:null;}})[_0xe2cb('0x33')](respondWithResult(_0x594cec,null))[_0xe2cb('0x27')](handleError(_0x594cec,null));};exports[_0xe2cb('0xb8')]=function(_0x19c3e0,_0x53bd22,_0x2f9ae9){var _0x473d6d={'raw':![],'where':{}};var _0x26f932={};var _0x2e5643={'count':0x0,'rows':[]};return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x19c3e0[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x53bd22,null))[_0xe2cb('0x33')](function(_0x15b657){if(_0x15b657){_0x26f932[_0xe2cb('0x42')]=_['keys'](db[_0xe2cb('0x95')][_0xe2cb('0x3e')]);_0x26f932[_0xe2cb('0x43')]=_[_0xe2cb('0x56')](_0x19c3e0['query']);_0x26f932[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0x26f932[_0xe2cb('0x42')],_0x26f932[_0xe2cb('0x43')]);_0x473d6d[_0xe2cb('0x46')]=_[_0xe2cb('0x45')](_0x26f932[_0xe2cb('0x42')],qs['fields'](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x47')]));_0x473d6d[_0xe2cb('0x46')]=_0x473d6d['attributes']['length']?_0x473d6d[_0xe2cb('0x46')]:_0x26f932[_0xe2cb('0x42')];if(!_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0xb7')](_0xe2cb('0x49'))){_0x473d6d[_0xe2cb('0x2e')]=qs['limit'](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x473d6d[_0xe2cb('0x2b')]=qs[_0xe2cb('0x2b')](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x2b')]);}_0x473d6d['order']=qs[_0xe2cb('0x4b')](_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0x4b')]);_0x473d6d[_0xe2cb('0x4e')]=qs[_0xe2cb('0x44')](_[_0xe2cb('0x4c')](_0x19c3e0[_0xe2cb('0x43')],_0x26f932['filters']));_0x473d6d[_0xe2cb('0x4e')][_0xe2cb('0x62')]=_0x15b657['id'];if(_0x19c3e0[_0xe2cb('0x43')]['filter']){_0x473d6d['where']=_['merge'](_0x473d6d[_0xe2cb('0x4e')],{'$or':_['map'](_0x473d6d[_0xe2cb('0x46')],function(_0x556fe5){var _0x5b4625={};_0x5b4625[_0x556fe5]={'$like':'%'+_0x19c3e0['query']['filter']+'%'};return _0x5b4625;})});}_0x473d6d=_['merge']({},_0x473d6d,_0x19c3e0[_0xe2cb('0x50')]);return db[_0xe2cb('0x95')]['count']({'where':_0x473d6d[_0xe2cb('0x4e')]})['then'](function(_0x334750){_0x2e5643[_0xe2cb('0x2d')]=_0x334750;if(_0x19c3e0[_0xe2cb('0x43')]['includeAll']){_0x473d6d[_0xe2cb('0x52')]=[{'model':db[_0xe2cb('0x6f')],'as':_0xe2cb('0xb9'),'required':![]},{'model':db['User'],'as':_0xe2cb('0xba'),'attributes':['name',_0xe2cb('0xbb'),_0xe2cb('0xbc')],'required':![]},{'model':db[_0xe2cb('0xbd')],'as':'Tags','attributes':['id','name',_0xe2cb('0xbe')],'where':_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0xbf')]?{'id':_0x19c3e0[_0xe2cb('0x43')]['tag']}:undefined,'required':_0x19c3e0[_0xe2cb('0x43')][_0xe2cb('0xbf')]?!![]:![]}];}return db[_0xe2cb('0x95')][_0xe2cb('0x65')](_0x473d6d);})[_0xe2cb('0x33')](function(_0x178ab8){_0x2e5643[_0xe2cb('0x53')]=_0x178ab8;return _0x2e5643;});}})[_0xe2cb('0x33')](respondWithFilteredResult(_0x53bd22,_0x473d6d))[_0xe2cb('0x27')](handleError(_0x53bd22,null));};exports['send']=function(_0x249461,_0x3636f8,_0x448674){var _0x225080,_0x39644f,_0x13a464;if(_[_0xe2cb('0x8d')](_0x249461['body'][_0xe2cb('0x58')])||_0x249461['body'][_0xe2cb('0x58')]===''){throw new db['Sequelize'][(_0xe2cb('0x8c'))](_0xe2cb('0x8e'));}if(_[_0xe2cb('0x8d')](_0x249461['body']['to'])){throw new db['Sequelize'][(_0xe2cb('0x8c'))]('to\x20is\x20mandatory');}_0x225080=_0x249461[_0xe2cb('0x58')]['to'];return db[_0xe2cb('0x3d')]['find']({'where':{'id':_0x249461[_0xe2cb('0x55')]['id']},'include':[{'model':db[_0xe2cb('0xc0')],'as':_0xe2cb('0xc1'),'include':[{'model':db['CmContact'],'as':_0xe2cb('0x92'),'where':{'mobile':_0x225080},'limit':0x1,'order':[[_0xe2cb('0x74'),_0xe2cb('0x93')]]}]}]})[_0xe2cb('0x33')](handleEntityNotFound(_0x3636f8,null))[_0xe2cb('0x33')](function(_0x4a7124){if(_0x4a7124&&_0x4a7124[_0xe2cb('0xc1')]){_0x39644f=_0x4a7124[_0xe2cb('0x35')]({'plain':!![]});if(_0x39644f[_0xe2cb('0xc1')]&&_0x39644f[_0xe2cb('0xc1')][_0xe2cb('0x92')][_0xe2cb('0x48')]){return _0x39644f[_0xe2cb('0xc1')][_0xe2cb('0x92')][0x0];}return db[_0xe2cb('0x6f')][_0xe2cb('0x57')](_[_0xe2cb('0x19')](_0x249461[_0xe2cb('0x58')],{'firstName':_0x225080,'mobile':_0x225080,'phone':_0x225080,'ListId':_0x39644f[_0xe2cb('0x76')]}));}})['then'](handleEntityNotFound(_0x3636f8,null))['then'](function(_0x46f621){if(_0x46f621){_0x13a464=_0x46f621;return db[_0xe2cb('0x95')][_0xe2cb('0x5d')]({'where':{'ContactId':_0x13a464['id'],'closed':![],'SmsAccountId':_0x39644f['id']}})[_0xe2cb('0x33')](function(_0x493b8){if(_0x493b8){return[_0x493b8,![]];}return db[_0xe2cb('0x95')]['create']({'UserId':_0x249461[_0xe2cb('0x59')]['id'],'ContactId':_0x13a464['id'],'SmsAccountId':_0x39644f['id'],'phone':_0x225080,'firstMsgDirection':'out','Messages':[_[_0xe2cb('0x4f')](_0x249461[_0xe2cb('0x58')],{'read':![],'body':_0x249461[_0xe2cb('0x58')][_0xe2cb('0x58')],'phone':_0x225080,'SmsAccountId':_0x39644f['id'],'UserId':_0x249461[_0xe2cb('0x59')]['id'],'ContactId':_0x13a464['id']})]},{'include':[{'model':db[_0xe2cb('0xc2')],'as':_0xe2cb('0xc3')}]})[_0xe2cb('0x33')](function(_0x25189c){return[_0x25189c,!![]];});});}})[_0xe2cb('0x96')](function(_0x4c0d51,_0x26d059){if(_0x26d059){return _0x4c0d51;}return db[_0xe2cb('0xc2')][_0xe2cb('0x57')](_[_0xe2cb('0x4f')](_0x249461[_0xe2cb('0x58')],{'read':![],'body':_0x249461[_0xe2cb('0x58')]['body'],'phone':_0x225080,'SmsAccountId':_0x39644f['id'],'SmsInteractionId':_0x4c0d51['id'],'UserId':_0x249461[_0xe2cb('0x59')]['id'],'ContactId':_0x13a464['id']}))[_0xe2cb('0x33')](function(_0x1d33ea){_0x4c0d51[_0xe2cb('0xc4')][_0xe2cb('0xc3')]=[];_0x4c0d51['dataValues'][_0xe2cb('0xc3')]['push'](_0x1d33ea['dataValues']);return _0x4c0d51;});})['then'](respondWithResult(_0x3636f8,null))[_0xe2cb('0x27')](handleError(_0x3636f8,null));};exports[_0xe2cb('0x29')]=function(_0x45d233,_0x26146c,_0x551c21){if(_0x45d233[_0xe2cb('0x58')]['id']){delete _0x45d233[_0xe2cb('0x58')]['id'];}var _0x20a3b5,_0x4b5412,_0x440529;return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x45d233[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x26146c,null))[_0xe2cb('0x33')](function(_0x27c74d){if(_0x27c74d){_0x440529=_0x27c74d;logger[_0xe2cb('0xc5')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0xc6'),_0x27c74d[_0xe2cb('0x40')],util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));switch(_0x27c74d[_0xe2cb('0x40')]){case _0xe2cb('0xc8'):if(_0x45d233[_0xe2cb('0x58')]['skebby_dispatch_id']&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x29')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x45d233['body']['skebby_dispatch_id']}});}break;case'connectel':if(_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xc9')]&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xca')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xca')];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xc9')]}});}break;case _0xe2cb('0x7f'):if(_0x45d233[_0xe2cb('0x58')]['message_id']&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcb')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcb')];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcc')]}});}break;case'infobip':var _0x3fe199=_0x45d233['body'][_0xe2cb('0x84')][0x0];if(_0x3fe199[_0xe2cb('0x80')]&&_0x3fe199[_0xe2cb('0x29')][_0xe2cb('0xcd')]==='DELIVERED'){_0x4b5412=_0x3fe199[_0xe2cb('0x29')]['groupName'];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x3fe199['messageId']}});}break;case _0xe2cb('0x87'):if(_0x45d233[_0xe2cb('0x58')]['messageId']&&_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x29')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')]['status'];return db[_0xe2cb('0xc2')]['find']({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x80')]}});}break;case _0xe2cb('0xce'):if(_0x45d233[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')]['id']){_0x4b5412=_0x45d233['body'][0x0]['type'];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')][0x0][_0xe2cb('0x26')]['id']}});}break;case'intelepeer':if(_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xcf')]&&_0x45d233['body'][_0xe2cb('0x29')]){_0x4b5412=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x29')];return db['SmsMessage'][_0xe2cb('0x5d')]({'where':{'messageId':_0x45d233[_0xe2cb('0x58')]['redif']}});}break;}}})[_0xe2cb('0x33')](handleEntityNotFound(_0x26146c,null))[_0xe2cb('0x33')](function(_0x517816){if(_0x517816){_0x20a3b5=_0x517816;switch(_0x440529[_0xe2cb('0x40')]){case _0xe2cb('0xc8'):if(_0x4b5412==='DELIVERED'){return _0x20a3b5['update']({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),'skebby',util[_0xe2cb('0xc7')](_0x45d233['body'],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x7e'):if(_0x4b5412==='1'){return _0x20a3b5['update']({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),'status',_0xe2cb('0xc8'),util['inspect'](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x7f'):if(!_0x45d233[_0xe2cb('0x58')][_0xe2cb('0xd0')]&&_0x4b5412>=0xc8&&_0x4b5412<=0xce){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0x7f'),util['inspect'](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x83'):var _0xce858a=_0x45d233[_0xe2cb('0x58')][_0xe2cb('0x84')][0x0];if(_0xce858a[_0xe2cb('0x29')]['groupName']==='DELIVERED'){return _0x20a3b5['update']({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0x83'),util[_0xe2cb('0xc7')](_0x45d233['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4b5412=='DELIVERED_TO_GATEWAY'||_0x4b5412==_0xe2cb('0xd2')){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger['error'](_0xe2cb('0x23'),'status',_0xe2cb('0x87'),util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0xce'):if(_0x4b5412=='message-delivered'){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger[_0xe2cb('0x25')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0xce'),util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;case _0xe2cb('0x8a'):if(_0x4b5412===_0xe2cb('0xd3')||_0x4b5412===_0xe2cb('0xd4')){return _0x20a3b5[_0xe2cb('0xd1')]({'read':!![]});}else{logger[_0xe2cb('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe2cb('0x29'),_0xe2cb('0x8a'),util[_0xe2cb('0xc7')](_0x45d233[_0xe2cb('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x20a3b5;}})['then'](respondWithResult(_0x26146c,null))[_0xe2cb('0x27')](handleError(_0x26146c,null));};exports[_0xe2cb('0xd5')]=function(_0x249f94,_0x58cb2a,_0x52b297){var _0x3dbf91,_0x1c1237,_0x1f3f7b;return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x249f94[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x58cb2a,null))[_0xe2cb('0x33')](function(_0x12af78){if(_0x12af78){_0x1f3f7b=_0x12af78;logger[_0xe2cb('0xc5')](_0xe2cb('0x23'),_0xe2cb('0x29'),_0xe2cb('0xc6'),_0x12af78[_0xe2cb('0x40')],util[_0xe2cb('0xc7')](_0x249f94[_0xe2cb('0x43')],{'showHidden':![],'depth':null}));switch(_0x12af78[_0xe2cb('0x40')]){case _0xe2cb('0xd6'):if(_0x249f94[_0xe2cb('0x43')][_0xe2cb('0xd7')]&&_0x249f94[_0xe2cb('0x43')][_0xe2cb('0xd8')]){_0x1c1237=_0x249f94['query']['state'];return db[_0xe2cb('0xc2')][_0xe2cb('0x5d')]({'where':{'messageId':_0x249f94[_0xe2cb('0x43')][_0xe2cb('0xd7')]}});}break;}}})[_0xe2cb('0x33')](handleEntityNotFound(_0x58cb2a,null))[_0xe2cb('0x33')](function(_0x590a7d){if(_0x590a7d){_0x3dbf91=_0x590a7d;switch(_0x1f3f7b['type']){case _0xe2cb('0xd6'):if(_0x1c1237==='2'||_0x1c1237==='6'){return _0x3dbf91['update']({'read':!![]});}else{logger[_0xe2cb('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xe2cb('0xd6'),util['inspect'](_0x249f94[_0xe2cb('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x3dbf91;}})['then'](respondWithResult(_0x58cb2a,null))[_0xe2cb('0x27')](handleError(_0x58cb2a,null));};exports[_0xe2cb('0xd9')]=function(_0x11eb9d,_0x2d7d43,_0x4a343f){return db['SmsAccount']['find']({'where':{'id':_0x11eb9d[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x2d7d43,null))[_0xe2cb('0x33')](function(_0x126379){if(_0x126379){return _0x126379[_0xe2cb('0xd9')](_0x11eb9d[_0xe2cb('0x58')][_0xe2cb('0x67')],_[_0xe2cb('0xda')](_0x11eb9d[_0xe2cb('0x58')],[_0xe2cb('0x67'),'id'])||{})[_0xe2cb('0x96')](function(_0x13619a){for(var _0x1bff7a=0x0;_0x1bff7a<_0x11eb9d['body'][_0xe2cb('0x67')][_0xe2cb('0x48')];_0x1bff7a+=0x1){socket[_0xe2cb('0xdb')](_0xe2cb('0xdc'),{'UserId':Number(_0x11eb9d[_0xe2cb('0x58')][_0xe2cb('0x67')][_0x1bff7a]),'SmsAccountId':Number(_0x11eb9d['params']['id'])});}return _0x13619a;});}})[_0xe2cb('0x33')](respondWithResult(_0x2d7d43,null))[_0xe2cb('0x27')](handleError(_0x2d7d43,null));};exports[_0xe2cb('0xdd')]=function(_0x165673,_0xefe54b,_0x2efc00){return db[_0xe2cb('0x3d')][_0xe2cb('0x5d')]({'where':{'id':_0x165673[_0xe2cb('0x55')]['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0xefe54b,null))['then'](function(_0x22fb08){if(_0x22fb08){return _0x22fb08[_0xe2cb('0xdd')](_0x165673[_0xe2cb('0x43')]['ids'])[_0xe2cb('0x33')](function(){if(_[_0xe2cb('0xde')](_0x165673[_0xe2cb('0x43')][_0xe2cb('0x67')])){for(var _0x1e1953=0x0;_0x1e1953<_0x165673[_0xe2cb('0x43')][_0xe2cb('0x67')]['length'];_0x1e1953+=0x1){socket[_0xe2cb('0xdb')](_0xe2cb('0xdf'),{'UserId':Number(_0x165673[_0xe2cb('0x43')][_0xe2cb('0x67')][_0x1e1953]),'SmsAccountId':Number(_0x165673[_0xe2cb('0x55')]['id'])});}}else{socket[_0xe2cb('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x165673['query'][_0xe2cb('0x67')]),'SmsAccountId':Number(_0x165673[_0xe2cb('0x55')]['id'])});}});}})[_0xe2cb('0x33')](respondWithStatusCode(_0xefe54b,null))[_0xe2cb('0x27')](handleError(_0xefe54b,null));};exports[_0xe2cb('0xe0')]=function(_0x75f4b2,_0x5a6c71,_0x4d8e9e){var _0x103729={};var _0x24ae42={};var _0x578917;var _0x358c75;return db[_0xe2cb('0x3d')][_0xe2cb('0x64')]({'where':{'id':_0x75f4b2['params']['id']}})[_0xe2cb('0x33')](handleEntityNotFound(_0x5a6c71,null))[_0xe2cb('0x33')](function(_0x294445){if(_0x294445){_0x578917=_0x294445;_0x24ae42[_0xe2cb('0x42')]=_[_0xe2cb('0x56')](db[_0xe2cb('0xa0')][_0xe2cb('0x3e')]);_0x24ae42[_0xe2cb('0x43')]=_['keys'](_0x75f4b2[_0xe2cb('0x43')]);_0x24ae42[_0xe2cb('0x44')]=_[_0xe2cb('0x45')](_0x24ae42[_0xe2cb('0x42')],_0x24ae42[_0xe2cb('0x43')]);_0x103729['attributes']=_['intersection'](_0x24ae42[_0xe2cb('0x42')],qs[_0xe2cb('0x47')](_0x75f4b2[_0xe2cb('0x43')]['fields']));_0x103729[_0xe2cb('0x46')]=_0x103729[_0xe2cb('0x46')]['length']?_0x103729['attributes']:_0x24ae42['model'];_0x103729[_0xe2cb('0x4a')]=qs['sort'](_0x75f4b2['query'][_0xe2cb('0x4b')]);_0x103729[_0xe2cb('0x4e')]=qs['filters'](_[_0xe2cb('0x4c')](_0x75f4b2['query'],_0x24ae42['filters']));if(_0x75f4b2[_0xe2cb('0x43')]['filter']){_0x103729['where']=_[_0xe2cb('0x4f')](_0x103729['where'],{'$or':_[_0xe2cb('0x3c')](_0x103729[_0xe2cb('0x46')],function(_0x2271a5){var _0x26a707={};_0x26a707[_0x2271a5]={'$like':'%'+_0x75f4b2[_0xe2cb('0x43')][_0xe2cb('0x4d')]+'%'};return _0x26a707;})});}_0x103729=_['merge']({},_0x103729,_0x75f4b2[_0xe2cb('0x50')]);return _0x578917['getAgents'](_0x103729);}})[_0xe2cb('0x33')](function(_0x8afb31){if(_0x8afb31){_0x358c75=_0x8afb31['length'];if(!_0x75f4b2['query'][_0xe2cb('0xb7')](_0xe2cb('0x49'))){_0x103729[_0xe2cb('0x2e')]=qs['limit'](_0x75f4b2[_0xe2cb('0x43')][_0xe2cb('0x2e')]);_0x103729[_0xe2cb('0x2b')]=qs[_0xe2cb('0x2b')](_0x75f4b2['query'][_0xe2cb('0x2b')]);}return _0x578917[_0xe2cb('0xe0')](_0x103729);}})[_0xe2cb('0x33')](function(_0x497cdf){if(_0x497cdf){return _0x497cdf?{'count':_0x358c75,'rows':_0x497cdf}:null;}})[_0xe2cb('0x33')](respondWithResult(_0x5a6c71,null))[_0xe2cb('0x27')](handleError(_0x5a6c71,null));}; \ No newline at end of file +var _0x03e1=['type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','ids','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','clicksend','message_id','plivo','infobip','results','originatingAddress','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','SmsInteraction','spread','interaction','autoclose','applications','push','close','unmanaged','*,*,*,*','created','SmsMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','Contact','User','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','debug','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','statusInt','status_code','groupName','redif','DELIVERED','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','csc','state','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','get','SmsAccounts','UserProfileResource','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName'];(function(_0x4a28a6,_0x4bac1c){var _0x2b2af6=function(_0x1244f2){while(--_0x1244f2){_0x4a28a6['push'](_0x4a28a6['shift']());}};_0x2b2af6(++_0x4bac1c);}(_0x03e1,0x188));var _0x103e=function(_0x104ebf,_0x406211){_0x104ebf=_0x104ebf-0x0;var _0x2312f7=_0x03e1[_0x104ebf];return _0x2312f7;};'use strict';var emlformat=require(_0x103e('0x0'));var rimraf=require(_0x103e('0x1'));var zipdir=require(_0x103e('0x2'));var jsonpatch=require(_0x103e('0x3'));var rp=require('request-promise');var moment=require(_0x103e('0x4'));var BPromise=require(_0x103e('0x5'));var Mustache=require(_0x103e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x103e('0x7'));var csv=require(_0x103e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x103e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x103e('0xa'));var deskjs=require(_0x103e('0xb'));var toCsv=require(_0x103e('0x8'));var querystring=require(_0x103e('0xc'));var Papa=require(_0x103e('0xd'));var Redis=require('ioredis');var authService=require(_0x103e('0xe'));var qs=require(_0x103e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x103e('0x10'));var logger=require(_0x103e('0x11'))(_0x103e('0x12'));var utils=require('../../config/utils');var config=require(_0x103e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x103e('0x14'))['db'];config['redis']=_[_0x103e('0x15')](config[_0x103e('0x16')],{'host':_0x103e('0x17'),'port':0x18eb});var socket=require(_0x103e('0x18'))(new Redis(config[_0x103e('0x16')]));require(_0x103e('0x19'))[_0x103e('0x1a')](socket);var jayson=require(_0x103e('0x1b'));var client=jayson[_0x103e('0x1c')][_0x103e('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x3d7cb3,_0x1c986c,_0x4aae60,_0xf050bf){return new BPromise(function(_0x93c26b,_0xc69b2d){var _0x5cbce7=_0xf050bf||client;return _0x5cbce7[_0x103e('0x1e')](_0x3d7cb3,_0x4aae60)[_0x103e('0x1f')](function(_0xe083a5){logger['info'](_0x103e('0x20'),_0x1c986c,_0x103e('0x21'));logger['debug'](_0x103e('0x22'),_0x1c986c,'request\x20sent',JSON[_0x103e('0x23')](_0xe083a5));if(_0xe083a5['error']){if(_0xe083a5[_0x103e('0x24')][_0x103e('0x25')]===0x1f4){logger[_0x103e('0x24')](_0x103e('0x20'),_0x1c986c,_0xe083a5[_0x103e('0x24')][_0x103e('0x26')]);return _0xc69b2d(_0xe083a5['error'][_0x103e('0x26')]);}logger[_0x103e('0x24')](_0x103e('0x20'),_0x1c986c,_0xe083a5['error'][_0x103e('0x26')]);return _0x93c26b(_0xe083a5[_0x103e('0x24')][_0x103e('0x26')]);}else{logger[_0x103e('0x27')](_0x103e('0x20'),_0x1c986c,_0x103e('0x21'));_0x93c26b(_0xe083a5[_0x103e('0x28')][_0x103e('0x26')]);}})[_0x103e('0x29')](function(_0x2dd1e6){logger[_0x103e('0x24')](_0x103e('0x20'),_0x1c986c,_0x2dd1e6);_0xc69b2d(_0x2dd1e6);});});}function respondWithStatusCode(_0x349a1f,_0x499954){_0x499954=_0x499954||0xcc;return function(_0x1e6f58){if(_0x1e6f58){return _0x349a1f[_0x103e('0x2a')](_0x499954);}return _0x349a1f[_0x103e('0x2b')](_0x499954)['end']();};}function respondWithResult(_0x4f23e5,_0x1b6672){_0x1b6672=_0x1b6672||0xc8;return function(_0x31e403){if(_0x31e403){return _0x4f23e5[_0x103e('0x2b')](_0x1b6672)[_0x103e('0x2c')](_0x31e403);}};}function respondWithFilteredResult(_0x12cd9b,_0x4993bf){return function(_0x829ccd){if(_0x829ccd){var _0xe6ab32=typeof _0x4993bf[_0x103e('0x2d')]===_0x103e('0x2e')&&typeof _0x4993bf['limit']==='undefined';var _0x40d772=_0x829ccd[_0x103e('0x2f')];var _0x5e5bd4=_0xe6ab32?0x0:_0x4993bf[_0x103e('0x2d')];var _0x21303a=_0xe6ab32?_0x829ccd[_0x103e('0x2f')]:_0x4993bf['offset']+_0x4993bf[_0x103e('0x30')];var _0x468b74;if(_0x21303a>=_0x40d772){_0x21303a=_0x40d772;_0x468b74=0xc8;}else{_0x468b74=0xce;}_0x12cd9b[_0x103e('0x2b')](_0x468b74);return _0x12cd9b[_0x103e('0x31')](_0x103e('0x32'),_0x5e5bd4+'-'+_0x21303a+'/'+_0x40d772)[_0x103e('0x2c')](_0x829ccd);}return null;};}function patchUpdates(_0x1779c1){return function(_0x1249ec){try{jsonpatch[_0x103e('0x33')](_0x1249ec,_0x1779c1,!![]);}catch(_0x1dacce){return BPromise['reject'](_0x1dacce);}return _0x1249ec[_0x103e('0x34')]();};}function saveUpdates(_0x4a99ee,_0x2e81d8){return function(_0x4c2e61){if(_0x4c2e61){return _0x4c2e61[_0x103e('0x35')](_0x4a99ee)['then'](function(_0x21656b){return _0x21656b;});}return null;};}function removeEntity(_0x319480,_0x6b36a8){return function(_0x2fd673){if(_0x2fd673){return _0x2fd673['destroy']()[_0x103e('0x1f')](function(){var _0x2f84ca=_0x2fd673[_0x103e('0x36')]({'plain':!![]});var _0x32f349=_0x103e('0x37');return db[_0x103e('0x38')][_0x103e('0x39')]({'where':{'type':_0x32f349,'resourceId':_0x2f84ca['id']}})[_0x103e('0x1f')](function(){return _0x2fd673;});})[_0x103e('0x1f')](function(){_0x319480[_0x103e('0x2b')](0xcc)[_0x103e('0x3a')]();});}};}function handleEntityNotFound(_0x1a0d97,_0xbbc0a3){return function(_0x675139){if(!_0x675139){_0x1a0d97[_0x103e('0x2a')](0x194);}return _0x675139;};}function handleError(_0x13819c,_0x211d20){_0x211d20=_0x211d20||0x1f4;return function(_0x1efdda){logger[_0x103e('0x24')](_0x1efdda[_0x103e('0x3b')]);if(_0x1efdda[_0x103e('0x3c')]){delete _0x1efdda[_0x103e('0x3c')];}_0x13819c['status'](_0x211d20)[_0x103e('0x3d')](_0x1efdda);};}exports['index']=function(_0x475e7f,_0x5dbba6){var _0x54d3c9={'include':[{'model':db[_0x103e('0x3e')],'as':_0x103e('0x3f')}]},_0x3489c0={},_0x2d61ea={'count':0x0,'rows':[]};var _0x39aa91=_[_0x103e('0x40')](db[_0x103e('0x41')][_0x103e('0x42')],function(_0x2d36cd){return{'name':_0x2d36cd[_0x103e('0x43')],'type':_0x2d36cd[_0x103e('0x44')]['key']};});_0x3489c0[_0x103e('0x45')]=_[_0x103e('0x40')](_0x39aa91,'name');_0x3489c0[_0x103e('0x46')]=_[_0x103e('0x47')](_0x475e7f[_0x103e('0x46')]);_0x3489c0['filters']=_[_0x103e('0x48')](_0x3489c0[_0x103e('0x45')],_0x3489c0[_0x103e('0x46')]);_0x54d3c9['attributes']=_[_0x103e('0x48')](_0x3489c0['model'],qs[_0x103e('0x49')](_0x475e7f['query'][_0x103e('0x49')]));_0x54d3c9[_0x103e('0x4a')]=_0x54d3c9[_0x103e('0x4a')][_0x103e('0x4b')]?_0x54d3c9['attributes']:_0x3489c0[_0x103e('0x45')];if(!_0x475e7f[_0x103e('0x46')][_0x103e('0x4c')](_0x103e('0x4d'))){_0x54d3c9[_0x103e('0x30')]=qs[_0x103e('0x30')](_0x475e7f[_0x103e('0x46')][_0x103e('0x30')]);_0x54d3c9[_0x103e('0x2d')]=qs[_0x103e('0x2d')](_0x475e7f[_0x103e('0x46')][_0x103e('0x2d')]);}_0x54d3c9[_0x103e('0x4e')]=qs['sort'](_0x475e7f[_0x103e('0x46')][_0x103e('0x4f')]);_0x54d3c9[_0x103e('0x50')]=qs[_0x103e('0x51')](_[_0x103e('0x52')](_0x475e7f['query'],_0x3489c0['filters']),_0x39aa91);if(_0x475e7f['query'][_0x103e('0x53')]){_0x54d3c9[_0x103e('0x50')]=_[_0x103e('0x54')](_0x54d3c9[_0x103e('0x50')],{'$or':_[_0x103e('0x40')](_0x39aa91,function(_0x672bd9){if(_0x672bd9['type']!==_0x103e('0x55')){var _0x1ef18e={};_0x1ef18e[_0x672bd9[_0x103e('0x3c')]]={'$like':'%'+_0x475e7f[_0x103e('0x46')][_0x103e('0x53')]+'%'};return _0x1ef18e;}})});}_0x54d3c9=_[_0x103e('0x54')]({},_0x54d3c9,_0x475e7f[_0x103e('0x56')]);var _0x52b32a={'where':_0x54d3c9[_0x103e('0x50')]};return db['SmsAccount'][_0x103e('0x2f')](_0x52b32a)[_0x103e('0x1f')](function(_0x46079a){_0x2d61ea[_0x103e('0x2f')]=_0x46079a;if(_0x475e7f[_0x103e('0x46')][_0x103e('0x57')]){_0x54d3c9[_0x103e('0x58')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x54d3c9);})[_0x103e('0x1f')](function(_0x4ed6fd){_0x2d61ea[_0x103e('0x59')]=_0x4ed6fd;return _0x2d61ea;})['then'](respondWithFilteredResult(_0x5dbba6,_0x54d3c9))['catch'](handleError(_0x5dbba6,null));};exports[_0x103e('0x5a')]=function(_0x1f0ff3,_0x3facba){var _0x248eac={'raw':![],'where':{'id':_0x1f0ff3[_0x103e('0x5b')]['id']},'include':[{'model':db[_0x103e('0x3e')],'as':_0x103e('0x3f')}]},_0x493aed={};_0x493aed['model']=_[_0x103e('0x47')](db[_0x103e('0x41')][_0x103e('0x42')]);_0x493aed[_0x103e('0x46')]=_['keys'](_0x1f0ff3[_0x103e('0x46')]);_0x493aed['filters']=_[_0x103e('0x48')](_0x493aed[_0x103e('0x45')],_0x493aed[_0x103e('0x46')]);_0x248eac['attributes']=_[_0x103e('0x48')](_0x493aed['model'],qs[_0x103e('0x49')](_0x1f0ff3[_0x103e('0x46')]['fields']));_0x248eac['attributes']=_0x248eac[_0x103e('0x4a')][_0x103e('0x4b')]?_0x248eac['attributes']:_0x493aed[_0x103e('0x45')];if(_0x1f0ff3['query'][_0x103e('0x57')]){_0x248eac['include']=[{'all':!![]}];}_0x248eac=_[_0x103e('0x54')]({},_0x248eac,_0x1f0ff3[_0x103e('0x56')]);return db['SmsAccount'][_0x103e('0x5c')](_0x248eac)['then'](handleEntityNotFound(_0x3facba,null))[_0x103e('0x1f')](respondWithResult(_0x3facba,null))[_0x103e('0x29')](handleError(_0x3facba,null));};exports['create']=function(_0x4e239b,_0x4cca64){return db[_0x103e('0x41')][_0x103e('0x5d')](_0x4e239b['body'],{})['then'](function(_0x2a8e97){var _0x42f36a=_0x4e239b[_0x103e('0x5e')]['get']({'plain':!![]});if(!_0x42f36a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42f36a[_0x103e('0x5f')]==='user'){var _0x3a7548=_0x2a8e97[_0x103e('0x36')]({'plain':!![]});var _0x10e2c5=_0x103e('0x37');return db[_0x103e('0x60')][_0x103e('0x5c')]({'where':{'name':_0x10e2c5,'userProfileId':_0x42f36a[_0x103e('0x61')]},'raw':!![]})[_0x103e('0x1f')](function(_0x3ffdb6){if(_0x3ffdb6&&_0x3ffdb6['autoAssociation']===0x0){return db[_0x103e('0x38')][_0x103e('0x5d')]({'name':_0x3a7548[_0x103e('0x3c')],'resourceId':_0x3a7548['id'],'type':_0x3ffdb6[_0x103e('0x3c')],'sectionId':_0x3ffdb6['id']},{})[_0x103e('0x1f')](function(){return _0x2a8e97;});}else{return _0x2a8e97;}})['catch'](function(_0x262304){logger['error'](_0x103e('0x62'),_0x262304);throw _0x262304;});}return _0x2a8e97;})[_0x103e('0x1f')](respondWithResult(_0x4cca64,0xc9))[_0x103e('0x29')](handleError(_0x4cca64,null));};exports['update']=function(_0x7b61cf,_0x283c8e){if(_0x7b61cf[_0x103e('0x63')]['id']){delete _0x7b61cf[_0x103e('0x63')]['id'];}return db['SmsAccount'][_0x103e('0x5c')]({'where':{'id':_0x7b61cf['params']['id']},'include':[{'model':db[_0x103e('0x3e')],'as':_0x103e('0x3f')}]})[_0x103e('0x1f')](handleEntityNotFound(_0x283c8e,null))[_0x103e('0x1f')](saveUpdates(_0x7b61cf[_0x103e('0x63')],null))[_0x103e('0x1f')](respondWithResult(_0x283c8e,null))['catch'](handleError(_0x283c8e,null));};exports[_0x103e('0x39')]=function(_0x1b504a,_0x5776da){return db['SmsAccount'][_0x103e('0x5c')]({'where':{'id':_0x1b504a[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x5776da,null))[_0x103e('0x1f')](removeEntity(_0x5776da,null))[_0x103e('0x29')](handleError(_0x5776da,null));};exports[_0x103e('0x64')]=function(_0x1ad666,_0x11a268){return db[_0x103e('0x41')][_0x103e('0x64')]()[_0x103e('0x1f')](respondWithResult(_0x11a268,null))['catch'](handleError(_0x11a268,null));};exports[_0x103e('0x65')]=function(_0x5f09f7,_0xae2bce,_0x4eb0f2){if(_0x5f09f7[_0x103e('0x63')]['id']){delete _0x5f09f7[_0x103e('0x63')]['id'];}return db[_0x103e('0x41')][_0x103e('0x5c')]({'where':{'id':_0x5f09f7[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0xae2bce,null))[_0x103e('0x1f')](function(_0x5d44a4){if(_0x5d44a4){_0x5f09f7[_0x103e('0x63')][_0x103e('0x66')]=_0x5d44a4['id'];return db[_0x103e('0x67')]['create'](_0x5f09f7['body']);}})['then'](respondWithResult(_0xae2bce,null))[_0x103e('0x29')](handleError(_0xae2bce,null));};exports[_0x103e('0x68')]=function(_0x1d1acf,_0x16ef52,_0x2473fc){var _0x5b5905={'raw':![],'where':{}};var _0x5ead58={};var _0x1f6d17={'count':0x0,'rows':[]};return db['SmsAccount'][_0x103e('0x69')]({'where':{'id':_0x1d1acf['params']['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x16ef52,null))[_0x103e('0x1f')](function(_0x32b409){if(_0x32b409){_0x5ead58[_0x103e('0x45')]=_[_0x103e('0x47')](db[_0x103e('0x67')][_0x103e('0x42')]);_0x5ead58[_0x103e('0x46')]=_['keys'](_0x1d1acf[_0x103e('0x46')]);_0x5ead58['filters']=_[_0x103e('0x48')](_0x5ead58['model'],_0x5ead58[_0x103e('0x46')]);_0x5b5905['attributes']=_[_0x103e('0x48')](_0x5ead58[_0x103e('0x45')],qs['fields'](_0x1d1acf[_0x103e('0x46')][_0x103e('0x49')]));_0x5b5905[_0x103e('0x4a')]=_0x5b5905[_0x103e('0x4a')][_0x103e('0x4b')]?_0x5b5905[_0x103e('0x4a')]:_0x5ead58['model'];if(!_0x1d1acf[_0x103e('0x46')][_0x103e('0x4c')](_0x103e('0x4d'))){_0x5b5905[_0x103e('0x30')]=qs[_0x103e('0x30')](_0x1d1acf['query']['limit']);_0x5b5905[_0x103e('0x2d')]=qs[_0x103e('0x2d')](_0x1d1acf[_0x103e('0x46')][_0x103e('0x2d')]);}_0x5b5905[_0x103e('0x4e')]=qs[_0x103e('0x4f')](_0x1d1acf[_0x103e('0x46')][_0x103e('0x4f')]);_0x5b5905[_0x103e('0x50')]=qs[_0x103e('0x51')](_[_0x103e('0x52')](_0x1d1acf[_0x103e('0x46')],_0x5ead58[_0x103e('0x51')]));_0x5b5905[_0x103e('0x50')][_0x103e('0x66')]=_0x32b409['id'];if(_0x1d1acf[_0x103e('0x46')][_0x103e('0x53')]){_0x5b5905[_0x103e('0x50')]=_[_0x103e('0x54')](_0x5b5905['where'],{'$or':_[_0x103e('0x40')](_0x5b5905[_0x103e('0x4a')],function(_0x493389){var _0x5bda31={};_0x5bda31[_0x493389]={'$like':'%'+_0x1d1acf['query']['filter']+'%'};return _0x5bda31;})});}_0x5b5905=_[_0x103e('0x54')]({},_0x5b5905,_0x1d1acf['options']);return db[_0x103e('0x67')][_0x103e('0x2f')]({'where':_0x5b5905[_0x103e('0x50')]})[_0x103e('0x1f')](function(_0x4283eb){_0x1f6d17[_0x103e('0x2f')]=_0x4283eb;if(_0x1d1acf[_0x103e('0x46')][_0x103e('0x57')]){_0x5b5905[_0x103e('0x58')]=[{'all':!![]}];}return db[_0x103e('0x67')]['findAll'](_0x5b5905);})[_0x103e('0x1f')](function(_0x4f2fac){_0x1f6d17[_0x103e('0x59')]=_0x4f2fac;return _0x1f6d17;});}})[_0x103e('0x1f')](respondWithFilteredResult(_0x16ef52,_0x5b5905))[_0x103e('0x29')](handleError(_0x16ef52,null));};exports[_0x103e('0x6a')]=function(_0xae1c09,_0x297ca2,_0x7259d8){return db[_0x103e('0x41')][_0x103e('0x5c')]({'where':{'id':_0xae1c09[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x297ca2,null))[_0x103e('0x1f')](function(_0x36851d){if(_0x36851d){return _0x36851d[_0x103e('0x6a')](_0xae1c09[_0x103e('0x46')]['ids']);}})[_0x103e('0x1f')](respondWithStatusCode(_0x297ca2,null))[_0x103e('0x29')](handleError(_0x297ca2,null));};exports[_0x103e('0x6b')]=function(_0x50db4b,_0x1dcd23,_0x1d1103){if(_0x50db4b[_0x103e('0x63')]['id']){delete _0x50db4b['body']['id'];}return db[_0x103e('0x41')][_0x103e('0x5c')]({'where':{'id':_0x50db4b[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x1dcd23,null))['then'](function(_0x287dee){if(_0x287dee){_0x50db4b[_0x103e('0x63')]['SmsAccountId']=_0x287dee['id'];return db[_0x103e('0x6c')][_0x103e('0x5d')](_0x50db4b['body']);}})[_0x103e('0x1f')](respondWithResult(_0x1dcd23,null))[_0x103e('0x29')](handleError(_0x1dcd23,null));};exports[_0x103e('0x6d')]=function(_0x225432,_0xad0bc0,_0x69c0aa){var _0x2f7d4f={'raw':![],'where':{}};var _0x2986f8={};var _0x1bd64d={'count':0x0,'rows':[]};return db['SmsAccount'][_0x103e('0x69')]({'where':{'id':_0x225432[_0x103e('0x5b')]['id']}})['then'](handleEntityNotFound(_0xad0bc0,null))[_0x103e('0x1f')](function(_0x4d854c){if(_0x4d854c){_0x2986f8[_0x103e('0x45')]=_['keys'](db[_0x103e('0x6c')][_0x103e('0x42')]);_0x2986f8[_0x103e('0x46')]=_[_0x103e('0x47')](_0x225432['query']);_0x2986f8[_0x103e('0x51')]=_[_0x103e('0x48')](_0x2986f8['model'],_0x2986f8['query']);_0x2f7d4f['attributes']=_['intersection'](_0x2986f8[_0x103e('0x45')],qs[_0x103e('0x49')](_0x225432[_0x103e('0x46')]['fields']));_0x2f7d4f[_0x103e('0x4a')]=_0x2f7d4f[_0x103e('0x4a')][_0x103e('0x4b')]?_0x2f7d4f[_0x103e('0x4a')]:_0x2986f8[_0x103e('0x45')];if(!_0x225432[_0x103e('0x46')]['hasOwnProperty'](_0x103e('0x4d'))){_0x2f7d4f['limit']=qs[_0x103e('0x30')](_0x225432[_0x103e('0x46')]['limit']);_0x2f7d4f[_0x103e('0x2d')]=qs['offset'](_0x225432[_0x103e('0x46')][_0x103e('0x2d')]);}_0x2f7d4f[_0x103e('0x4e')]=qs[_0x103e('0x4f')](_0x225432[_0x103e('0x46')][_0x103e('0x4f')]);_0x2f7d4f[_0x103e('0x50')]=qs[_0x103e('0x51')](_[_0x103e('0x52')](_0x225432[_0x103e('0x46')],_0x2986f8[_0x103e('0x51')]));_0x2f7d4f['where'][_0x103e('0x66')]=_0x4d854c['id'];if(_0x225432[_0x103e('0x46')][_0x103e('0x53')]){_0x2f7d4f['where']=_['merge'](_0x2f7d4f[_0x103e('0x50')],{'$or':_[_0x103e('0x40')](_0x2f7d4f[_0x103e('0x4a')],function(_0x567aab){var _0x449c5e={};_0x449c5e[_0x567aab]={'$like':'%'+_0x225432[_0x103e('0x46')]['filter']+'%'};return _0x449c5e;})});}_0x2f7d4f=_[_0x103e('0x54')]({},_0x2f7d4f,_0x225432[_0x103e('0x56')]);return db[_0x103e('0x6c')][_0x103e('0x2f')]({'where':_0x2f7d4f[_0x103e('0x50')]})['then'](function(_0x28fe09){_0x1bd64d['count']=_0x28fe09;if(_0x225432[_0x103e('0x46')][_0x103e('0x57')]){_0x2f7d4f[_0x103e('0x58')]=[{'all':!![]}];}return db[_0x103e('0x6c')][_0x103e('0x6e')](_0x2f7d4f);})[_0x103e('0x1f')](function(_0x1bfeb7){_0x1bd64d['rows']=_0x1bfeb7;return _0x1bd64d;});}})['then'](respondWithFilteredResult(_0xad0bc0,_0x2f7d4f))['catch'](handleError(_0xad0bc0,null));};exports[_0x103e('0x6f')]=function(_0x4e03a9,_0x14321a,_0x287a86){return db[_0x103e('0x41')][_0x103e('0x5c')]({'where':{'id':_0x4e03a9['params']['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x14321a,null))['then'](function(_0x377672){if(_0x377672){return _0x377672[_0x103e('0x6f')](_0x4e03a9[_0x103e('0x46')][_0x103e('0x70')]);}})['then'](respondWithStatusCode(_0x14321a,null))['catch'](handleError(_0x14321a,null));};exports['notify']=function(_0x5a6b49,_0x2ce3e1,_0x26c801){var _0x35fa80={'channel':'sms'};var _0x5d7b23=[];var _0x3ea6da=[];var _0xfae397={};return db[_0x103e('0x41')][_0x103e('0x5c')]({'where':{'id':_0x5a6b49[_0x103e('0x5b')]['id']},'include':[{'model':db[_0x103e('0x71')],'as':_0x103e('0x72')}]})[_0x103e('0x1f')](handleEntityNotFound(_0x2ce3e1,null))[_0x103e('0x1f')](function(_0x2c550e){_0x35fa80[_0x103e('0x73')]=_0x2c550e;_0x35fa80['applications']=_[_0x103e('0x74')](_0x2c550e['Applications'],[_0x103e('0x75')],[_0x103e('0x76')]);if(_0x35fa80['account'][_0x103e('0x72')]){delete _0x35fa80[_0x103e('0x73')]['Applications'];}return db[_0x103e('0x77')]['describe']();})[_0x103e('0x1f')](function(_0x33317d){if(!_0x33317d){throw new db[(_0x103e('0x78'))]['ValidationError'](_0x103e('0x79'));}_0x5d7b23=_['difference'](_[_0x103e('0x47')](_0x33317d),[_0x103e('0x7a'),_0x103e('0x7b')]);_0x3ea6da=_[_0x103e('0x7c')](_['keys'](_0x33317d),[_0x103e('0x7a'),_0x103e('0x7b'),'CompanyId',_0x103e('0x7d')]);_0x35fa80[_0x103e('0x63')]={'mapKey':'mobile'};if(_0x35fa80[_0x103e('0x73')][_0x103e('0x44')]){switch(_0x35fa80['account'][_0x103e('0x44')]){case _0x103e('0x7e'):_0x35fa80[_0x103e('0x63')]['from']=_0x5a6b49[_0x103e('0x63')][_0x103e('0x7f')];_0x35fa80[_0x103e('0x63')]['body']=_0x5a6b49[_0x103e('0x63')][_0x103e('0x80')];_0x35fa80[_0x103e('0x63')][_0x103e('0x81')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x82')];break;case _0x103e('0x83'):_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]='+'+_0x5a6b49[_0x103e('0x63')][_0x103e('0x85')];_0x35fa80['body']['body']=_0x5a6b49[_0x103e('0x63')][_0x103e('0x86')];break;case'connectel':_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]=_0x5a6b49['body'][_0x103e('0x84')];_0x35fa80[_0x103e('0x63')][_0x103e('0x63')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x26')];break;case _0x103e('0x87'):_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x84')];_0x35fa80['body'][_0x103e('0x63')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x63')];_0x35fa80[_0x103e('0x63')][_0x103e('0x81')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x88')];break;case _0x103e('0x89'):_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x7f')];_0x35fa80[_0x103e('0x63')][_0x103e('0x63')]=_0x5a6b49['body']['Text'];_0x35fa80[_0x103e('0x63')][_0x103e('0x81')]=_0x5a6b49[_0x103e('0x63')]['MessageUUID'];break;case _0x103e('0x8a'):_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]='+'+_0x5a6b49[_0x103e('0x63')][_0x103e('0x8b')][0x0][_0x103e('0x84')];_0x35fa80[_0x103e('0x63')][_0x103e('0x63')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x8b')][0x0][_0x103e('0x86')];_0x35fa80[_0x103e('0x63')]['messageId']=_0x5a6b49['body'][_0x103e('0x8b')][0x0][_0x103e('0x81')];break;case'csc':_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x8c')];_0x35fa80['body'][_0x103e('0x63')]=_0x5a6b49[_0x103e('0x63')]['segmentedMessage'][_0x103e('0x26')];break;case _0x103e('0x8d'):_0x35fa80['body'][_0x103e('0x84')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x8e')];_0x35fa80[_0x103e('0x63')][_0x103e('0x63')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x86')];_0x35fa80[_0x103e('0x63')][_0x103e('0x81')]=_0x5a6b49[_0x103e('0x63')]['replyMessageId'];break;case _0x103e('0x8f'):_0x35fa80['body']['messageId']=_0x5a6b49[_0x103e('0x63')][0x0][_0x103e('0x26')]['id'];_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]=_0x5a6b49[_0x103e('0x63')][0x0][_0x103e('0x26')]['from'];_0x35fa80['body'][_0x103e('0x63')]=_0x5a6b49[_0x103e('0x63')][0x0]['message']['text'];break;case _0x103e('0x90'):_0x35fa80[_0x103e('0x63')][_0x103e('0x84')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x84')];_0x35fa80[_0x103e('0x63')][_0x103e('0x63')]=_0x5a6b49[_0x103e('0x63')]['message'];_0x35fa80[_0x103e('0x63')][_0x103e('0x81')]=_0x5a6b49[_0x103e('0x63')][_0x103e('0x91')];break;}}if(_0x35fa80[_0x103e('0x63')]['id']){delete _0x35fa80[_0x103e('0x63')]['id'];}if(_[_0x103e('0x92')](_0x35fa80['body'][_0x103e('0x84')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x103e('0x92')](_0x35fa80[_0x103e('0x63')]['body'])||_0x35fa80['body'][_0x103e('0x63')]===''){throw new db['Sequelize'][(_0x103e('0x93'))](_0x103e('0x94'));}if(_[_0x103e('0x92')](_0x35fa80[_0x103e('0x63')][_0x103e('0x95')])){throw new db[(_0x103e('0x78'))][(_0x103e('0x93'))](_0x103e('0x96')+_0x3ea6da);}if(!_[_0x103e('0x97')](_0x3ea6da,_0x35fa80['body'][_0x103e('0x95')])){throw new db[(_0x103e('0x78'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3ea6da);}_0xfae397[_0x35fa80[_0x103e('0x63')][_0x103e('0x95')]]=_0x35fa80['body'][_0x103e('0x84')];return db[_0x103e('0x98')][_0x103e('0x5c')]({'where':{'id':_0x35fa80[_0x103e('0x73')][_0x103e('0x7d')]},'include':[{'model':db[_0x103e('0x77')],'as':_0x103e('0x99'),'where':_0xfae397,'limit':0x1,'order':[[_0x103e('0x7b'),_0x103e('0x9a')]]}]});})[_0x103e('0x1f')](handleEntityNotFound(_0x2ce3e1,null))['then'](function(_0x31b411){if(_0x31b411){_0x35fa80[_0x103e('0x9b')]=_['omit'](_0x31b411,[_0x103e('0x99')]);if(_0x31b411[_0x103e('0x99')]['length']){return _0x31b411[_0x103e('0x99')][0x0];}var _0x33b2ba=_[_0x103e('0x15')](_0x35fa80[_0x103e('0x63')],{'firstName':_0x35fa80[_0x103e('0x63')]['from'],'ListId':_0x31b411['id']});_0x33b2ba[_0x35fa80['body'][_0x103e('0x95')]]=_0x35fa80[_0x103e('0x63')][_0x103e('0x84')];return db['CmContact'][_0x103e('0x5d')](_0x33b2ba,{'fields':_0x5d7b23,'raw':!![]});}})['then'](handleEntityNotFound(_0x2ce3e1,null))[_0x103e('0x1f')](function(_0x56b948){if(_0x56b948){_0x35fa80['contact']=_0x56b948;var _0x207ce4={'ContactId':_0x56b948['id'],'phone':_0x35fa80[_0x103e('0x63')][_0x103e('0x84')],'SmsAccountId':_0x5a6b49[_0x103e('0x5b')]['id']};var _0x571279={'ContactId':_0x56b948['id'],'SmsAccountId':_0x5a6b49[_0x103e('0x5b')]['id'],'closed':![]};return db[_0x103e('0x9c')]['find']({'where':_0x571279})[_0x103e('0x1f')](function(_0x4271af){if(_0x4271af){return[_0x4271af,![]];}return db[_0x103e('0x9c')][_0x103e('0x5d')](_0x207ce4)[_0x103e('0x1f')](function(_0x3d1ca7){return[_0x3d1ca7,!![]];});});}})[_0x103e('0x9d')](function(_0x4ef248,_0x21c14b){_0x35fa80[_0x103e('0x9e')]=_0x4ef248[_0x103e('0x36')]({'plain':!![]});_0x35fa80[_0x103e('0x9e')]['created']=![];if(_0x21c14b){if(_0x35fa80[_0x103e('0x73')][_0x103e('0x9f')]){_0x35fa80[_0x103e('0xa0')][_0x103e('0xa1')]({'id':0x0,'priority':_0x35fa80[_0x103e('0xa0')][_0x103e('0x4b')]+0x1,'app':_0x103e('0xa2'),'appdata':_0x103e('0xa3'),'interval':_0x103e('0xa4')});}_0x35fa80[_0x103e('0x9e')][_0x103e('0xa5')]=!![];}return db[_0x103e('0xa6')][_0x103e('0x5d')]({'phone':_0x35fa80[_0x103e('0x63')][_0x103e('0x84')],'messageId':_0x35fa80[_0x103e('0x63')][_0x103e('0x81')],'body':_0x35fa80[_0x103e('0x63')][_0x103e('0x63')],'SmsAccountId':_0x5a6b49[_0x103e('0x5b')]['id'],'SmsInteractionId':_0x4ef248['id'],'direction':'in','ContactId':_0x4ef248['ContactId'],'AttachmentId':_0x35fa80['body'][_0x103e('0xa7')]});})[_0x103e('0x1f')](function(_0x35c7a3){_0x35fa80[_0x103e('0x26')]=_0x35c7a3;if(!_0x35fa80[_0x103e('0x9e')][_0x103e('0xa8')])return;return db['User'][_0x103e('0x5c')]({'attributes':['id','name'],'where':{'id':_0x35fa80[_0x103e('0x9e')][_0x103e('0xa8')]}});})['then'](function(_0x478533){if(_0x478533){_0x35fa80[_0x103e('0xa0')][_0x103e('0xa9')]({'id':0x0,'priority':0x0,'app':_0x103e('0xaa'),'appdata':_0x478533['name']+','+(_0x35fa80[_0x103e('0x73')][_0x103e('0xab')]||0xa),'interval':_0x103e('0xa4')});}if(!_0x35fa80[_0x103e('0x9e')][_0x103e('0xac')])return;return db[_0x103e('0xad')][_0x103e('0x5c')]({'attributes':['id','name'],'where':{'id':_0x35fa80[_0x103e('0x9e')][_0x103e('0xac')]}});})[_0x103e('0x1f')](function(_0x319c59){if(_0x319c59){_0x35fa80[_0x103e('0xa0')][_0x103e('0xa9')]({'id':0x0,'priority':0x1,'app':_0x103e('0xae'),'appdata':_0x319c59[_0x103e('0x3c')]+','+(_0x35fa80[_0x103e('0x73')]['waitForTheAssignedQueue']||0x12c),'interval':_0x103e('0xa4')});}return respondWithRpcPromise(_0x103e('0xaf'),_0x103e('0xb0'),_0x35fa80);})[_0x103e('0x1f')](function(_0x4ec1b3){if(_0x4ec1b3){var _0x4d40b2=0xc8;var _0x5908ba=_0x103e('0xb1');logger[_0x103e('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5908ba,_0x4d40b2,'entity\x20found');logger['debug'](_0x103e('0xb2'),_0x5908ba,_0x4d40b2,'entity\x20found',JSON[_0x103e('0x23')](_0x4ec1b3));if(_0x35fa80[_0x103e('0x73')][_0x103e('0x44')]===_0x103e('0x7e')){return _0x2ce3e1['status'](_0x4d40b2)[_0x103e('0x31')](_0x103e('0xb3'),_0x103e('0xb4'))[_0x103e('0x3d')](_0x103e('0xb5'));}else{return _0x2ce3e1[_0x103e('0x2b')](_0x4d40b2)[_0x103e('0x2c')](_0x4ec1b3);}}})['catch'](handleError(_0x2ce3e1,null));};exports[_0x103e('0xb6')]=function(_0x1a55fc,_0xc04b54){var _0x3a16f2=_0x1a55fc[_0x103e('0x5b')]['id'];var _0x318393=_0x1a55fc[_0x103e('0x63')];var _0x4b5352=0xc8;var _0x519de8=null;return db[_0x103e('0xb7')][_0x103e('0xb8')]({'isolationLevel':db[_0x103e('0xb7')][_0x103e('0xb9')][_0x103e('0xba')][_0x103e('0xbb')]},function(_0x31c7ea){return db[_0x103e('0x41')][_0x103e('0x69')]({'where':{'id':_0x3a16f2},'transaction':_0x31c7ea})[_0x103e('0x1f')](function(_0x1dc4e1){if(_0x1dc4e1){return db[_0x103e('0x71')][_0x103e('0x39')]({'where':{'SmsAccountId':_0x3a16f2},'transaction':_0x31c7ea})[_0x103e('0x1f')](function(){var _0x21ecf6=_['map'](_0x318393,function(_0x1fec35){_0x1fec35[_0x103e('0x66')]=_0x3a16f2;return _0x1fec35;});return db[_0x103e('0x71')][_0x103e('0xbc')](_0x21ecf6,{'transaction':_0x31c7ea});});}else{_0x4b5352=0x194;_0x519de8=[];}});})[_0x103e('0x1f')](function(){if(_0x4b5352!==0x194){return db[_0x103e('0x71')][_0x103e('0xbd')]({'where':{'SmsAccountId':_0x3a16f2},'order':_0x103e('0x75')})[_0x103e('0x1f')](function(_0x576def){_0x519de8=_0x576def;});}})[_0x103e('0x29')](function(_0x36e9fc){_0x4b5352=0x1f4;logger['error'](_0x36e9fc[_0x103e('0x3b')]);if(_0x36e9fc[_0x103e('0x3c')]){delete _0x36e9fc[_0x103e('0x3c')];}_0x519de8=_0x36e9fc;})[_0x103e('0xbe')](function(){if(_0x519de8===null){_0xc04b54[_0x103e('0x2a')](_0x4b5352);}else{if(_0x4b5352===0x1f4){_0xc04b54[_0x103e('0x2b')](_0x4b5352)[_0x103e('0x3d')](_0x519de8);}else{_0xc04b54[_0x103e('0x2b')](_0x4b5352)[_0x103e('0x2c')](_0x519de8);}}});};exports[_0x103e('0xbf')]=function(_0x205747,_0x3cd3f5,_0x323157){var _0x5342dc={};var _0x5bb4eb={};var _0x5e776f;var _0x3c0832;return db['SmsAccount'][_0x103e('0x69')]({'where':{'id':_0x205747[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x3cd3f5,null))[_0x103e('0x1f')](function(_0x86cc4){if(_0x86cc4){_0x5e776f=_0x86cc4;_0x5bb4eb[_0x103e('0x45')]=_[_0x103e('0x47')](db[_0x103e('0x71')][_0x103e('0x42')]);_0x5bb4eb[_0x103e('0x46')]=_[_0x103e('0x47')](_0x205747[_0x103e('0x46')]);_0x5bb4eb['filters']=_[_0x103e('0x48')](_0x5bb4eb[_0x103e('0x45')],_0x5bb4eb[_0x103e('0x46')]);_0x5342dc[_0x103e('0x4a')]=_[_0x103e('0x48')](_0x5bb4eb[_0x103e('0x45')],qs[_0x103e('0x49')](_0x205747['query'][_0x103e('0x49')]));_0x5342dc[_0x103e('0x4a')]=_0x5342dc[_0x103e('0x4a')][_0x103e('0x4b')]?_0x5342dc[_0x103e('0x4a')]:_0x5bb4eb[_0x103e('0x45')];_0x5342dc[_0x103e('0x4e')]=qs[_0x103e('0x4f')](_0x205747[_0x103e('0x46')][_0x103e('0x4f')]);_0x5342dc[_0x103e('0x50')]=qs['filters'](_[_0x103e('0x52')](_0x205747['query'],_0x5bb4eb[_0x103e('0x51')]));if(_0x205747[_0x103e('0x46')]['filter']){_0x5342dc[_0x103e('0x50')]=_[_0x103e('0x54')](_0x5342dc[_0x103e('0x50')],{'$or':_[_0x103e('0x40')](_0x5342dc['attributes'],function(_0x24a9a0){var _0x441c22={};_0x441c22[_0x24a9a0]={'$like':'%'+_0x205747[_0x103e('0x46')][_0x103e('0x53')]+'%'};return _0x441c22;})});}_0x5342dc=_[_0x103e('0x54')]({},_0x5342dc,_0x205747[_0x103e('0x56')]);return _0x5e776f[_0x103e('0xbf')](_0x5342dc);}})[_0x103e('0x1f')](function(_0x18ddeb){if(_0x18ddeb){_0x3c0832=_0x18ddeb[_0x103e('0x4b')];if(!_0x205747['query'][_0x103e('0x4c')](_0x103e('0x4d'))){_0x5342dc[_0x103e('0x30')]=qs[_0x103e('0x30')](_0x205747[_0x103e('0x46')]['limit']);_0x5342dc[_0x103e('0x2d')]=qs[_0x103e('0x2d')](_0x205747[_0x103e('0x46')][_0x103e('0x2d')]);}return _0x5e776f[_0x103e('0xbf')](_0x5342dc);}})[_0x103e('0x1f')](function(_0x6e15d4){if(_0x6e15d4){return _0x6e15d4?{'count':_0x3c0832,'rows':_0x6e15d4}:null;}})[_0x103e('0x1f')](respondWithResult(_0x3cd3f5,null))[_0x103e('0x29')](handleError(_0x3cd3f5,null));};exports['getInteractions']=function(_0x526a0c,_0x391ed8,_0xa4cfa6){var _0x49287c={'raw':![],'where':{}};var _0x373aff={};var _0x26418c={'count':0x0,'rows':[]};return db[_0x103e('0x41')][_0x103e('0x69')]({'where':{'id':_0x526a0c['params']['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x391ed8,null))[_0x103e('0x1f')](function(_0x53b058){if(_0x53b058){_0x373aff[_0x103e('0x45')]=_[_0x103e('0x47')](db[_0x103e('0x9c')][_0x103e('0x42')]);_0x373aff[_0x103e('0x46')]=_[_0x103e('0x47')](_0x526a0c[_0x103e('0x46')]);_0x373aff['filters']=_[_0x103e('0x48')](_0x373aff[_0x103e('0x45')],_0x373aff[_0x103e('0x46')]);_0x49287c[_0x103e('0x4a')]=_[_0x103e('0x48')](_0x373aff[_0x103e('0x45')],qs[_0x103e('0x49')](_0x526a0c[_0x103e('0x46')][_0x103e('0x49')]));_0x49287c[_0x103e('0x4a')]=_0x49287c[_0x103e('0x4a')][_0x103e('0x4b')]?_0x49287c[_0x103e('0x4a')]:_0x373aff['model'];if(!_0x526a0c[_0x103e('0x46')]['hasOwnProperty']('nolimit')){_0x49287c['limit']=qs[_0x103e('0x30')](_0x526a0c[_0x103e('0x46')][_0x103e('0x30')]);_0x49287c[_0x103e('0x2d')]=qs[_0x103e('0x2d')](_0x526a0c[_0x103e('0x46')][_0x103e('0x2d')]);}_0x49287c[_0x103e('0x4e')]=qs[_0x103e('0x4f')](_0x526a0c[_0x103e('0x46')]['sort']);_0x49287c['where']=qs[_0x103e('0x51')](_[_0x103e('0x52')](_0x526a0c['query'],_0x373aff[_0x103e('0x51')]));_0x49287c[_0x103e('0x50')][_0x103e('0x66')]=_0x53b058['id'];if(_0x526a0c['query'][_0x103e('0x53')]){_0x49287c[_0x103e('0x50')]=_[_0x103e('0x54')](_0x49287c[_0x103e('0x50')],{'$or':_['map'](_0x49287c[_0x103e('0x4a')],function(_0x10a3fd){var _0x2cf002={};_0x2cf002[_0x10a3fd]={'$like':'%'+_0x526a0c[_0x103e('0x46')][_0x103e('0x53')]+'%'};return _0x2cf002;})});}_0x49287c=_[_0x103e('0x54')]({},_0x49287c,_0x526a0c['options']);return db['SmsInteraction'][_0x103e('0x2f')]({'where':_0x49287c[_0x103e('0x50')]})['then'](function(_0x12c244){_0x26418c['count']=_0x12c244;if(_0x526a0c['query'][_0x103e('0x57')]){_0x49287c['include']=[{'model':db[_0x103e('0x77')],'as':_0x103e('0xc0'),'required':![]},{'model':db[_0x103e('0xc1')],'as':'Owner','attributes':[_0x103e('0x3c'),_0x103e('0xc2'),_0x103e('0xc3')],'required':![]},{'model':db[_0x103e('0xc4')],'as':_0x103e('0xc5'),'attributes':['id',_0x103e('0x3c'),_0x103e('0xc6')],'where':_0x526a0c['query']['tag']?{'id':_0x526a0c[_0x103e('0x46')][_0x103e('0xc7')]}:undefined,'required':_0x526a0c[_0x103e('0x46')][_0x103e('0xc7')]?!![]:![]}];}return db['SmsInteraction'][_0x103e('0x6e')](_0x49287c);})[_0x103e('0x1f')](function(_0x4abfb7){_0x26418c[_0x103e('0x59')]=_0x4abfb7;return _0x26418c;});}})['then'](respondWithFilteredResult(_0x391ed8,_0x49287c))[_0x103e('0x29')](handleError(_0x391ed8,null));};exports['send']=function(_0x27a3d5,_0x3aed2b,_0x5166ba){var _0x93cb45,_0x47e02e,_0x3f2805;if(_[_0x103e('0x92')](_0x27a3d5['body']['body'])||_0x27a3d5['body'][_0x103e('0x63')]===''){throw new db[(_0x103e('0x78'))][(_0x103e('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x103e('0x92')](_0x27a3d5[_0x103e('0x63')]['to'])){throw new db['Sequelize'][(_0x103e('0x93'))](_0x103e('0xc8'));}_0x93cb45=_0x27a3d5['body']['to'];return db[_0x103e('0x41')]['find']({'where':{'id':_0x27a3d5[_0x103e('0x5b')]['id']},'include':[{'model':db[_0x103e('0x98')],'as':_0x103e('0xc9'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x93cb45},'limit':0x1,'order':[[_0x103e('0x7b'),_0x103e('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x3aed2b,null))[_0x103e('0x1f')](function(_0x33215a){if(_0x33215a&&_0x33215a[_0x103e('0xc9')]){_0x47e02e=_0x33215a[_0x103e('0x36')]({'plain':!![]});if(_0x47e02e['List']&&_0x47e02e[_0x103e('0xc9')]['Contacts'][_0x103e('0x4b')]){return _0x47e02e[_0x103e('0xc9')][_0x103e('0x99')][0x0];}return db[_0x103e('0x77')]['create'](_[_0x103e('0x15')](_0x27a3d5[_0x103e('0x63')],{'firstName':_0x93cb45,'mobile':_0x93cb45,'phone':_0x93cb45,'ListId':_0x47e02e[_0x103e('0x7d')]}));}})['then'](handleEntityNotFound(_0x3aed2b,null))['then'](function(_0x38208e){if(_0x38208e){_0x3f2805=_0x38208e;return db[_0x103e('0x9c')][_0x103e('0x5c')]({'where':{'ContactId':_0x3f2805['id'],'closed':![],'SmsAccountId':_0x47e02e['id']}})[_0x103e('0x1f')](function(_0x4eb005){if(_0x4eb005){return[_0x4eb005,![]];}return db[_0x103e('0x9c')][_0x103e('0x5d')]({'UserId':_0x27a3d5[_0x103e('0x5e')]['id'],'ContactId':_0x3f2805['id'],'SmsAccountId':_0x47e02e['id'],'phone':_0x93cb45,'firstMsgDirection':_0x103e('0xca'),'Messages':[_[_0x103e('0x54')](_0x27a3d5[_0x103e('0x63')],{'read':![],'body':_0x27a3d5['body']['body'],'phone':_0x93cb45,'SmsAccountId':_0x47e02e['id'],'UserId':_0x27a3d5[_0x103e('0x5e')]['id'],'ContactId':_0x3f2805['id']})]},{'include':[{'model':db[_0x103e('0xa6')],'as':_0x103e('0xcb')}]})[_0x103e('0x1f')](function(_0xacd497){return[_0xacd497,!![]];});});}})[_0x103e('0x9d')](function(_0x37af93,_0x13f920){if(_0x13f920){return _0x37af93;}return db[_0x103e('0xa6')][_0x103e('0x5d')](_[_0x103e('0x54')](_0x27a3d5['body'],{'read':![],'body':_0x27a3d5[_0x103e('0x63')]['body'],'phone':_0x93cb45,'SmsAccountId':_0x47e02e['id'],'SmsInteractionId':_0x37af93['id'],'UserId':_0x27a3d5[_0x103e('0x5e')]['id'],'ContactId':_0x3f2805['id']}))[_0x103e('0x1f')](function(_0x4f7f9a){_0x37af93[_0x103e('0xcc')][_0x103e('0xcb')]=[];_0x37af93[_0x103e('0xcc')][_0x103e('0xcb')][_0x103e('0xa1')](_0x4f7f9a[_0x103e('0xcc')]);return _0x37af93;});})['then'](respondWithResult(_0x3aed2b,null))[_0x103e('0x29')](handleError(_0x3aed2b,null));};exports[_0x103e('0x2b')]=function(_0x5f2bf3,_0x4bf53c,_0x4cec18){if(_0x5f2bf3[_0x103e('0x63')]['id']){delete _0x5f2bf3[_0x103e('0x63')]['id'];}var _0x37ead5,_0x148163,_0x1f9565;return db[_0x103e('0x41')]['find']({'where':{'id':_0x5f2bf3[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x4bf53c,null))[_0x103e('0x1f')](function(_0x2a5b6e){if(_0x2a5b6e){_0x1f9565=_0x2a5b6e;logger[_0x103e('0xcd')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x103e('0x2b'),_0x103e('0xce'),_0x2a5b6e[_0x103e('0x44')],util[_0x103e('0xcf')](_0x5f2bf3[_0x103e('0x63')],{'showHidden':![],'depth':null}));switch(_0x2a5b6e[_0x103e('0x44')]){case _0x103e('0x83'):if(_0x5f2bf3[_0x103e('0x63')][_0x103e('0xd0')]&&_0x5f2bf3[_0x103e('0x63')][_0x103e('0x2b')]){_0x148163=_0x5f2bf3[_0x103e('0x63')][_0x103e('0x2b')];return db[_0x103e('0xa6')]['find']({'where':{'messageId':_0x5f2bf3[_0x103e('0x63')]['skebby_dispatch_id']}});}break;case _0x103e('0xd1'):if(_0x5f2bf3['body']['requestid']&&_0x5f2bf3[_0x103e('0x63')]['statusInt']){_0x148163=_0x5f2bf3[_0x103e('0x63')][_0x103e('0xd2')];return db[_0x103e('0xa6')][_0x103e('0x5c')]({'where':{'messageId':_0x5f2bf3['body']['requestid']}});}break;case'clicksend':if(_0x5f2bf3[_0x103e('0x63')]['message_id']&&_0x5f2bf3[_0x103e('0x63')][_0x103e('0xd3')]){_0x148163=_0x5f2bf3[_0x103e('0x63')][_0x103e('0xd3')];return db[_0x103e('0xa6')]['find']({'where':{'messageId':_0x5f2bf3[_0x103e('0x63')][_0x103e('0x88')]}});}break;case _0x103e('0x8a'):var _0x5a11af=_0x5f2bf3[_0x103e('0x63')][_0x103e('0x8b')][0x0];if(_0x5a11af[_0x103e('0x81')]&&_0x5a11af[_0x103e('0x2b')][_0x103e('0xd4')]==='DELIVERED'){_0x148163=_0x5a11af[_0x103e('0x2b')][_0x103e('0xd4')];return db[_0x103e('0xa6')]['find']({'where':{'messageId':_0x5a11af[_0x103e('0x81')]}});}break;case _0x103e('0x8d'):if(_0x5f2bf3[_0x103e('0x63')][_0x103e('0x81')]&&_0x5f2bf3[_0x103e('0x63')][_0x103e('0x2b')]){_0x148163=_0x5f2bf3[_0x103e('0x63')][_0x103e('0x2b')];return db[_0x103e('0xa6')][_0x103e('0x5c')]({'where':{'messageId':_0x5f2bf3['body'][_0x103e('0x81')]}});}break;case'bandwidth':if(_0x5f2bf3['body'][0x0][_0x103e('0x26')]['id']){_0x148163=_0x5f2bf3[_0x103e('0x63')][0x0][_0x103e('0x44')];return db[_0x103e('0xa6')][_0x103e('0x5c')]({'where':{'messageId':_0x5f2bf3[_0x103e('0x63')][0x0]['message']['id']}});}break;case _0x103e('0x90'):if(_0x5f2bf3[_0x103e('0x63')][_0x103e('0xd5')]&&_0x5f2bf3['body'][_0x103e('0x2b')]){_0x148163=_0x5f2bf3[_0x103e('0x63')][_0x103e('0x2b')];return db[_0x103e('0xa6')]['find']({'where':{'messageId':_0x5f2bf3[_0x103e('0x63')]['redif']}});}break;}}})[_0x103e('0x1f')](handleEntityNotFound(_0x4bf53c,null))[_0x103e('0x1f')](function(_0x2e1d63){if(_0x2e1d63){_0x37ead5=_0x2e1d63;switch(_0x1f9565[_0x103e('0x44')]){case _0x103e('0x83'):if(_0x148163===_0x103e('0xd6')){return _0x37ead5[_0x103e('0x35')]({'read':!![]});}else{logger['error'](_0x103e('0x22'),'status',_0x103e('0x83'),util[_0x103e('0xcf')](_0x5f2bf3[_0x103e('0x63')],{'showHidden':![],'depth':null}));}break;case _0x103e('0xd1'):if(_0x148163==='1'){return _0x37ead5[_0x103e('0x35')]({'read':!![]});}else{logger[_0x103e('0x24')](_0x103e('0x22'),_0x103e('0x2b'),_0x103e('0x83'),util[_0x103e('0xcf')](_0x5f2bf3[_0x103e('0x63')],{'showHidden':![],'depth':null}));}break;case _0x103e('0x87'):if(!_0x5f2bf3[_0x103e('0x63')][_0x103e('0xd7')]&&_0x148163>=0xc8&&_0x148163<=0xce){return _0x37ead5['update']({'read':!![]});}else{logger[_0x103e('0x24')](_0x103e('0x22'),'status',_0x103e('0x87'),util['inspect'](_0x5f2bf3[_0x103e('0x63')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xf11fc2=_0x5f2bf3[_0x103e('0x63')]['results'][0x0];if(_0xf11fc2[_0x103e('0x2b')][_0x103e('0xd4')]==='DELIVERED'){return _0x37ead5[_0x103e('0x35')]({'read':!![]});}else{logger[_0x103e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x103e('0x2b'),_0x103e('0x8a'),util[_0x103e('0xcf')](_0x5f2bf3[_0x103e('0x63')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x148163=='DELIVERED_TO_GATEWAY'||_0x148163==_0x103e('0xd8')){return _0x37ead5['update']({'read':!![]});}else{logger['error'](_0x103e('0x22'),_0x103e('0x2b'),_0x103e('0x8d'),util['inspect'](_0x5f2bf3['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x148163=='message-delivered'){return _0x37ead5['update']({'read':!![]});}else{logger[_0x103e('0x24')](_0x103e('0x22'),_0x103e('0x2b'),_0x103e('0x8f'),util['inspect'](_0x5f2bf3[_0x103e('0x63')],{'showHidden':![],'depth':null}));}break;case _0x103e('0x90'):if(_0x148163===_0x103e('0xd9')||_0x148163===_0x103e('0xda')){return _0x37ead5[_0x103e('0x35')]({'read':!![]});}else{logger['error'](_0x103e('0x22'),_0x103e('0x2b'),_0x103e('0x90'),util[_0x103e('0xcf')](_0x5f2bf3['body'],{'showHidden':![],'depth':null}));}break;}return _0x37ead5;}})[_0x103e('0x1f')](respondWithResult(_0x4bf53c,null))[_0x103e('0x29')](handleError(_0x4bf53c,null));};exports['statusGet']=function(_0x6d2993,_0x584502,_0x570c5b){var _0x1cbdc2,_0x2208b2,_0x1ccd72;return db[_0x103e('0x41')][_0x103e('0x5c')]({'where':{'id':_0x6d2993[_0x103e('0x5b')]['id']}})['then'](handleEntityNotFound(_0x584502,null))[_0x103e('0x1f')](function(_0x1a3902){if(_0x1a3902){_0x1ccd72=_0x1a3902;logger[_0x103e('0xcd')](_0x103e('0x22'),_0x103e('0x2b'),_0x103e('0xce'),_0x1a3902[_0x103e('0x44')],util[_0x103e('0xcf')](_0x6d2993[_0x103e('0x46')],{'showHidden':![],'depth':null}));switch(_0x1a3902[_0x103e('0x44')]){case _0x103e('0xdb'):if(_0x6d2993[_0x103e('0x46')]['message-id']&&_0x6d2993[_0x103e('0x46')][_0x103e('0xdc')]){_0x2208b2=_0x6d2993['query'][_0x103e('0xdc')];return db[_0x103e('0xa6')]['find']({'where':{'messageId':_0x6d2993[_0x103e('0x46')][_0x103e('0xdd')]}});}break;}}})[_0x103e('0x1f')](handleEntityNotFound(_0x584502,null))['then'](function(_0x5b8dae){if(_0x5b8dae){_0x1cbdc2=_0x5b8dae;switch(_0x1ccd72[_0x103e('0x44')]){case _0x103e('0xdb'):if(_0x2208b2==='2'||_0x2208b2==='6'){return _0x1cbdc2[_0x103e('0x35')]({'read':!![]});}else{logger[_0x103e('0x24')](_0x103e('0x22'),_0x103e('0x2b'),_0x103e('0xdb'),util['inspect'](_0x6d2993['query'],{'showHidden':![],'depth':null}));};break;}return _0x1cbdc2;}})[_0x103e('0x1f')](respondWithResult(_0x584502,null))[_0x103e('0x29')](handleError(_0x584502,null));};exports[_0x103e('0xde')]=function(_0x3c37ef,_0x23cc0e,_0x2746d9){return db['SmsAccount'][_0x103e('0x5c')]({'where':{'id':_0x3c37ef[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x23cc0e,null))[_0x103e('0x1f')](function(_0x16fdc4){if(_0x16fdc4){return _0x16fdc4[_0x103e('0xde')](_0x3c37ef[_0x103e('0x63')][_0x103e('0x70')],_[_0x103e('0xdf')](_0x3c37ef[_0x103e('0x63')],[_0x103e('0x70'),'id'])||{})[_0x103e('0x9d')](function(_0x5a7cb5){for(var _0x5d7a79=0x0;_0x5d7a79<_0x3c37ef[_0x103e('0x63')]['ids'][_0x103e('0x4b')];_0x5d7a79+=0x1){socket[_0x103e('0xe0')](_0x103e('0xe1'),{'UserId':Number(_0x3c37ef[_0x103e('0x63')][_0x103e('0x70')][_0x5d7a79]),'SmsAccountId':Number(_0x3c37ef[_0x103e('0x5b')]['id'])});}return _0x5a7cb5;});}})['then'](respondWithResult(_0x23cc0e,null))[_0x103e('0x29')](handleError(_0x23cc0e,null));};exports[_0x103e('0xe2')]=function(_0x1561e8,_0x58230a,_0x3903cb){return db[_0x103e('0x41')]['find']({'where':{'id':_0x1561e8[_0x103e('0x5b')]['id']}})[_0x103e('0x1f')](handleEntityNotFound(_0x58230a,null))[_0x103e('0x1f')](function(_0x28822d){if(_0x28822d){return _0x28822d[_0x103e('0xe2')](_0x1561e8[_0x103e('0x46')][_0x103e('0x70')])[_0x103e('0x1f')](function(){if(_[_0x103e('0xe3')](_0x1561e8['query']['ids'])){for(var _0x32bcf6=0x0;_0x32bcf6<_0x1561e8[_0x103e('0x46')][_0x103e('0x70')][_0x103e('0x4b')];_0x32bcf6+=0x1){socket[_0x103e('0xe0')](_0x103e('0xe4'),{'UserId':Number(_0x1561e8[_0x103e('0x46')][_0x103e('0x70')][_0x32bcf6]),'SmsAccountId':Number(_0x1561e8[_0x103e('0x5b')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x1561e8[_0x103e('0x46')][_0x103e('0x70')]),'SmsAccountId':Number(_0x1561e8[_0x103e('0x5b')]['id'])});}});}})[_0x103e('0x1f')](respondWithStatusCode(_0x58230a,null))[_0x103e('0x29')](handleError(_0x58230a,null));};exports['getAgents']=function(_0x4a5043,_0x140c58,_0x107e27){var _0x5ee605={};var _0x4833de={};var _0x359282;var _0x46d8db;return db['SmsAccount'][_0x103e('0x69')]({'where':{'id':_0x4a5043[_0x103e('0x5b')]['id']}})['then'](handleEntityNotFound(_0x140c58,null))['then'](function(_0x528361){if(_0x528361){_0x359282=_0x528361;_0x4833de[_0x103e('0x45')]=_[_0x103e('0x47')](db[_0x103e('0xc1')]['rawAttributes']);_0x4833de[_0x103e('0x46')]=_[_0x103e('0x47')](_0x4a5043['query']);_0x4833de[_0x103e('0x51')]=_[_0x103e('0x48')](_0x4833de[_0x103e('0x45')],_0x4833de['query']);_0x5ee605[_0x103e('0x4a')]=_[_0x103e('0x48')](_0x4833de[_0x103e('0x45')],qs[_0x103e('0x49')](_0x4a5043[_0x103e('0x46')][_0x103e('0x49')]));_0x5ee605[_0x103e('0x4a')]=_0x5ee605[_0x103e('0x4a')]['length']?_0x5ee605[_0x103e('0x4a')]:_0x4833de[_0x103e('0x45')];_0x5ee605[_0x103e('0x4e')]=qs[_0x103e('0x4f')](_0x4a5043[_0x103e('0x46')][_0x103e('0x4f')]);_0x5ee605['where']=qs[_0x103e('0x51')](_['pick'](_0x4a5043[_0x103e('0x46')],_0x4833de[_0x103e('0x51')]));if(_0x4a5043[_0x103e('0x46')][_0x103e('0x53')]){_0x5ee605['where']=_['merge'](_0x5ee605['where'],{'$or':_[_0x103e('0x40')](_0x5ee605[_0x103e('0x4a')],function(_0x4d6625){var _0x106064={};_0x106064[_0x4d6625]={'$like':'%'+_0x4a5043['query'][_0x103e('0x53')]+'%'};return _0x106064;})});}_0x5ee605=_[_0x103e('0x54')]({},_0x5ee605,_0x4a5043[_0x103e('0x56')]);return _0x359282[_0x103e('0xe5')](_0x5ee605);}})[_0x103e('0x1f')](function(_0x3f8a12){if(_0x3f8a12){_0x46d8db=_0x3f8a12[_0x103e('0x4b')];if(!_0x4a5043[_0x103e('0x46')][_0x103e('0x4c')](_0x103e('0x4d'))){_0x5ee605[_0x103e('0x30')]=qs[_0x103e('0x30')](_0x4a5043[_0x103e('0x46')][_0x103e('0x30')]);_0x5ee605[_0x103e('0x2d')]=qs[_0x103e('0x2d')](_0x4a5043[_0x103e('0x46')]['offset']);}return _0x359282[_0x103e('0xe5')](_0x5ee605);}})[_0x103e('0x1f')](function(_0x11758e){if(_0x11758e){return _0x11758e?{'count':_0x46d8db,'rows':_0x11758e}:null;}})['then'](respondWithResult(_0x140c58,null))[_0x103e('0x29')](handleError(_0x140c58,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 04c0d62..56e6332 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 _0xfc65=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x409c75,_0x50c9aa){var _0x38a7f3=function(_0x2eca5d){while(--_0x2eca5d){_0x409c75['push'](_0x409c75['shift']());}};_0x38a7f3(++_0x50c9aa);}(_0xfc65,0x181));var _0x5fc6=function(_0x2fc018,_0x4747d7){_0x2fc018=_0x2fc018-0x0;var _0x2eaba0=_0xfc65[_0x2fc018];return _0x2eaba0;};'use strict';var EventEmitter=require(_0x5fc6('0x0'));var SmsAccount=require(_0x5fc6('0x1'))['db'][_0x5fc6('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x5fc6('0x3')](0x0);var events={'afterCreate':_0x5fc6('0x4'),'afterUpdate':_0x5fc6('0x5'),'afterDestroy':_0x5fc6('0x6')};function emitEvent(_0x1d11aa){return function(_0x400787,_0x516dea,_0x3c3abd){SmsAccountEvents['emit'](_0x1d11aa+':'+_0x400787['id'],_0x400787);SmsAccountEvents[_0x5fc6('0x7')](_0x1d11aa,_0x400787);_0x3c3abd(null);};}for(var e in events){if(events[_0x5fc6('0x8')](e)){var event=events[e];SmsAccount[_0x5fc6('0x9')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xe926=['hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x37672b,_0x372b6f){var _0xc022b2=function(_0x1175fc){while(--_0x1175fc){_0x37672b['push'](_0x37672b['shift']());}};_0xc022b2(++_0x372b6f);}(_0xe926,0x16a));var _0x6e92=function(_0x32cf96,_0x7502d5){_0x32cf96=_0x32cf96-0x0;var _0x125cc1=_0xe926[_0x32cf96];return _0x125cc1;};'use strict';var EventEmitter=require(_0x6e92('0x0'));var SmsAccount=require(_0x6e92('0x1'))['db'][_0x6e92('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6e92('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6e92('0x4'),'afterDestroy':_0x6e92('0x5')};function emitEvent(_0x51de1b){return function(_0x5380a9,_0x14080e,_0x584806){SmsAccountEvents[_0x6e92('0x6')](_0x51de1b+':'+_0x5380a9['id'],_0x5380a9);SmsAccountEvents['emit'](_0x51de1b,_0x5380a9);_0x584806(null);};}for(var e in events){if(events[_0x6e92('0x7')](e)){var event=events[e];SmsAccount[_0x6e92('0x8')](e,emitEvent(event));}}module[_0x6e92('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 2163cb5..149e5b1 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 _0x4aef=['./smsAccount.attributes','exports','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x130f71,_0x3501c0){var _0x4aed4c=function(_0x5d51a9){while(--_0x5d51a9){_0x130f71['push'](_0x130f71['shift']());}};_0x4aed4c(++_0x3501c0);}(_0x4aef,0x197));var _0xf4ae=function(_0x271a80,_0x268bac){_0x271a80=_0x271a80-0x0;var _0xf8233e=_0x4aef[_0x271a80];return _0xf8233e;};'use strict';var _=require(_0xf4ae('0x0'));var util=require(_0xf4ae('0x1'));var logger=require(_0xf4ae('0x2'))(_0xf4ae('0x3'));var moment=require('moment');var BPromise=require(_0xf4ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ae('0x5'));var rimraf=require('rimraf');var config=require(_0xf4ae('0x6'));var attributes=require(_0xf4ae('0x7'));module[_0xf4ae('0x8')]=function(_0x1a85bb,_0x56ad02){return _0x1a85bb['define']('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xacb4=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','sms_accounts'];(function(_0x31939f,_0x41f91f){var _0x362cb9=function(_0xec91d9){while(--_0xec91d9){_0x31939f['push'](_0x31939f['shift']());}};_0x362cb9(++_0x41f91f);}(_0xacb4,0xfd));var _0x4acb=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0xacb4[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0x4acb('0x0'));var util=require(_0x4acb('0x1'));var logger=require('../../config/logger')(_0x4acb('0x2'));var moment=require(_0x4acb('0x3'));var BPromise=require('bluebird');var rp=require(_0x4acb('0x4'));var fs=require('fs');var path=require(_0x4acb('0x5'));var rimraf=require(_0x4acb('0x6'));var config=require(_0x4acb('0x7'));var attributes=require(_0x4acb('0x8'));module[_0x4acb('0x9')]=function(_0x4279a0,_0x2fee55){return _0x4279a0['define']('SmsAccount',attributes,{'tableName':_0x4acb('0xa'),'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 6f05172..c1e7576 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 _0x663d=['attributes','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw'];(function(_0x18b0d3,_0x3e8830){var _0x2d4949=function(_0x57e2c6){while(--_0x57e2c6){_0x18b0d3['push'](_0x18b0d3['shift']());}};_0x2d4949(++_0x3e8830);}(_0x663d,0x185));var _0xd663=function(_0x5e4748,_0x379e05){_0x5e4748=_0x5e4748-0x0;var _0x3073b5=_0x663d[_0x5e4748];return _0x3073b5;};'use strict';var _=require(_0xd663('0x0'));var util=require(_0xd663('0x1'));var moment=require('moment');var BPromise=require(_0xd663('0x2'));var rs=require(_0xd663('0x3'));var fs=require('fs');var Redis=require(_0xd663('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd663('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xd663('0x6'));var jayson=require(_0xd663('0x7'));var client=jayson[_0xd663('0x8')]['http']({'port':0x232a});config[_0xd663('0x9')]=_[_0xd663('0xa')](config[_0xd663('0x9')],{'host':_0xd663('0xb'),'port':0x18eb});var socket=require(_0xd663('0xc'))(new Redis(config[_0xd663('0x9')]));require('./smsAccount.socket')[_0xd663('0xd')](socket);function respondWithRpcPromise(_0x3f53f7,_0x6a97c8,_0x217eb3){return new BPromise(function(_0x5e58f2,_0x65479c){return client[_0xd663('0xe')](_0x3f53f7,_0x217eb3)[_0xd663('0xf')](function(_0x578702){logger[_0xd663('0x10')](_0xd663('0x11'),_0x6a97c8,_0xd663('0x12'));logger[_0xd663('0x13')](_0xd663('0x14'),_0x6a97c8,_0xd663('0x12'),JSON[_0xd663('0x15')](_0x578702));if(_0x578702[_0xd663('0x16')]){if(_0x578702[_0xd663('0x16')][_0xd663('0x17')]===0x1f4){logger[_0xd663('0x16')]('SmsAccount,\x20%s,\x20%s',_0x6a97c8,_0x578702[_0xd663('0x16')][_0xd663('0x18')]);return _0x65479c(_0x578702['error'][_0xd663('0x18')]);}logger['error'](_0xd663('0x11'),_0x6a97c8,_0x578702[_0xd663('0x16')][_0xd663('0x18')]);return _0x5e58f2(_0x578702[_0xd663('0x16')][_0xd663('0x18')]);}else{logger[_0xd663('0x10')](_0xd663('0x11'),_0x6a97c8,_0xd663('0x12'));_0x5e58f2(_0x578702[_0xd663('0x19')][_0xd663('0x18')]);}})[_0xd663('0x1a')](function(_0x430a7f){logger[_0xd663('0x16')](_0xd663('0x11'),_0x6a97c8,_0x430a7f);_0x65479c(_0x430a7f);});});}exports[_0xd663('0x1b')]=function(_0x20025e){var _0x179b73=this;return new Promise(function(_0x438e03,_0x1d772a){return db[_0xd663('0x1c')]['find']({'raw':_0x20025e[_0xd663('0x1d')]?_0x20025e['options'][_0xd663('0x1e')]===undefined?!![]:![]:!![],'where':_0x20025e[_0xd663('0x1d')]?_0x20025e[_0xd663('0x1d')]['where']||null:null,'attributes':_0x20025e[_0xd663('0x1d')]?_0x20025e[_0xd663('0x1d')][_0xd663('0x1f')]||null:null,'include':_0x20025e[_0xd663('0x1d')]?_0x20025e[_0xd663('0x1d')][_0xd663('0x20')]?_['map'](_0x20025e[_0xd663('0x1d')][_0xd663('0x20')],function(_0x56c1e7){return{'model':db[_0x56c1e7[_0xd663('0x21')]],'as':_0x56c1e7['as'],'attributes':_0x56c1e7[_0xd663('0x1f')],'include':_0x56c1e7[_0xd663('0x20')]?_[_0xd663('0x22')](_0x56c1e7['include'],function(_0xe8848d){return{'model':db[_0xe8848d[_0xd663('0x21')]],'as':_0xe8848d['as'],'attributes':_0xe8848d['attributes'],'include':_0xe8848d[_0xd663('0x20')]?_[_0xd663('0x22')](_0xe8848d['include'],function(_0x3c8f9c){return{'model':db[_0x3c8f9c['model']],'as':_0x3c8f9c['as'],'attributes':_0x3c8f9c[_0xd663('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd663('0xf')](function(_0x12e95a){logger[_0xd663('0x10')](_0xd663('0x1b'),_0x20025e);logger[_0xd663('0x13')](_0xd663('0x1b'),_0x20025e,JSON['stringify'](_0x12e95a));_0x438e03(_0x12e95a);})[_0xd663('0x1a')](function(_0x311ec2){logger['error']('ShowSmsAccount',_0x311ec2[_0xd663('0x18')],_0x20025e);_0x1d772a(_0x179b73[_0xd663('0x16')](0x1f4,_0x311ec2[_0xd663('0x18')]));});});}; \ No newline at end of file +var _0x0d5b=['map','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x0d5b,0x1d6));var _0xb0d5=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x0d5b[_0x24f31b];return _0x488401;};'use strict';var _=require('lodash');var util=require(_0xb0d5('0x0'));var moment=require('moment');var BPromise=require(_0xb0d5('0x1'));var rs=require(_0xb0d5('0x2'));var fs=require('fs');var Redis=require(_0xb0d5('0x3'));var db=require(_0xb0d5('0x4'))['db'];var utils=require(_0xb0d5('0x5'));var logger=require('../../config/logger')(_0xb0d5('0x6'));var config=require(_0xb0d5('0x7'));var jayson=require(_0xb0d5('0x8'));var client=jayson['client'][_0xb0d5('0x9')]({'port':0x232a});config[_0xb0d5('0xa')]=_['defaults'](config['redis'],{'host':_0xb0d5('0xb'),'port':0x18eb});var socket=require(_0xb0d5('0xc'))(new Redis(config[_0xb0d5('0xa')]));require('./smsAccount.socket')[_0xb0d5('0xd')](socket);function respondWithRpcPromise(_0x41da25,_0x40c9d8,_0x3e4a2c){return new BPromise(function(_0x182cec,_0x2529c9){return client[_0xb0d5('0xe')](_0x41da25,_0x3e4a2c)[_0xb0d5('0xf')](function(_0x54b90f){logger[_0xb0d5('0x10')](_0xb0d5('0x11'),_0x40c9d8,_0xb0d5('0x12'));logger[_0xb0d5('0x13')](_0xb0d5('0x14'),_0x40c9d8,'request\x20sent',JSON['stringify'](_0x54b90f));if(_0x54b90f[_0xb0d5('0x15')]){if(_0x54b90f[_0xb0d5('0x15')][_0xb0d5('0x16')]===0x1f4){logger['error'](_0xb0d5('0x11'),_0x40c9d8,_0x54b90f[_0xb0d5('0x15')][_0xb0d5('0x17')]);return _0x2529c9(_0x54b90f[_0xb0d5('0x15')][_0xb0d5('0x17')]);}logger['error'](_0xb0d5('0x11'),_0x40c9d8,_0x54b90f['error'][_0xb0d5('0x17')]);return _0x182cec(_0x54b90f[_0xb0d5('0x15')]['message']);}else{logger[_0xb0d5('0x10')]('SmsAccount,\x20%s,\x20%s',_0x40c9d8,_0xb0d5('0x12'));_0x182cec(_0x54b90f[_0xb0d5('0x18')][_0xb0d5('0x17')]);}})[_0xb0d5('0x19')](function(_0x49dd7a){logger[_0xb0d5('0x15')](_0xb0d5('0x11'),_0x40c9d8,_0x49dd7a);_0x2529c9(_0x49dd7a);});});}exports[_0xb0d5('0x1a')]=function(_0x4ad95f){var _0x510853=this;return new Promise(function(_0x407c30,_0x297f6f){return db[_0xb0d5('0x1b')][_0xb0d5('0x1c')]({'raw':_0x4ad95f[_0xb0d5('0x1d')]?_0x4ad95f[_0xb0d5('0x1d')][_0xb0d5('0x1e')]===undefined?!![]:![]:!![],'where':_0x4ad95f['options']?_0x4ad95f[_0xb0d5('0x1d')][_0xb0d5('0x1f')]||null:null,'attributes':_0x4ad95f[_0xb0d5('0x1d')]?_0x4ad95f[_0xb0d5('0x1d')][_0xb0d5('0x20')]||null:null,'include':_0x4ad95f[_0xb0d5('0x1d')]?_0x4ad95f[_0xb0d5('0x1d')][_0xb0d5('0x21')]?_[_0xb0d5('0x22')](_0x4ad95f[_0xb0d5('0x1d')]['include'],function(_0x33e5c8){return{'model':db[_0x33e5c8[_0xb0d5('0x23')]],'as':_0x33e5c8['as'],'attributes':_0x33e5c8[_0xb0d5('0x20')],'include':_0x33e5c8['include']?_['map'](_0x33e5c8[_0xb0d5('0x21')],function(_0x4e89e7){return{'model':db[_0x4e89e7['model']],'as':_0x4e89e7['as'],'attributes':_0x4e89e7[_0xb0d5('0x20')],'include':_0x4e89e7[_0xb0d5('0x21')]?_[_0xb0d5('0x22')](_0x4e89e7[_0xb0d5('0x21')],function(_0x22ed89){return{'model':db[_0x22ed89[_0xb0d5('0x23')]],'as':_0x22ed89['as'],'attributes':_0x22ed89['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0d5('0xf')](function(_0x229ffd){logger[_0xb0d5('0x10')](_0xb0d5('0x1a'),_0x4ad95f);logger[_0xb0d5('0x13')]('ShowSmsAccount',_0x4ad95f,JSON['stringify'](_0x229ffd));_0x407c30(_0x229ffd);})[_0xb0d5('0x19')](function(_0x236084){logger[_0xb0d5('0x15')](_0xb0d5('0x1a'),_0x236084['message'],_0x4ad95f);_0x297f6f(_0x510853[_0xb0d5('0x15')](0x1f4,_0x236084[_0xb0d5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 4575a5a..aba9157 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 1e7e7d5..4aaa80b 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 _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(_0x28cec4,_0xaa9dca){var _0x110db5=function(_0x52439f){while(--_0x52439f){_0x28cec4['push'](_0x28cec4['shift']());}};_0x110db5(++_0xaa9dca);}(_0xedd9,0xfc));var _0x9edd=function(_0x204441,_0x955413){_0x204441=_0x204441-0x0;var _0x382819=_0xedd9[_0x204441];return _0x382819;};'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 +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3d2345,_0x1fc9ac){var _0x3d1f0f=function(_0x529e28){while(--_0x529e28){_0x3d2345['push'](_0x3d2345['shift']());}};_0x3d1f0f(++_0x1fc9ac);}(_0x34e8,0x12c));var _0x834e=function(_0x4ca941,_0x3d93d7){_0x4ca941=_0x4ca941-0x0;var _0x1dc50c=_0x34e8[_0x4ca941];return _0x1dc50c;};'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('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 9f4f677..604b04f 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 _0xf987=['INTEGER','STRING','exports'];(function(_0x98ad9d,_0xe0aba){var _0x375413=function(_0x3099d3){while(--_0x3099d3){_0x98ad9d['push'](_0x98ad9d['shift']());}};_0x375413(++_0xe0aba);}(_0xf987,0x1d6));var _0x7f98=function(_0x4c69f2,_0x22a0b0){_0x4c69f2=_0x4c69f2-0x0;var _0x8d5088=_0xf987[_0x4c69f2];return _0x8d5088;};'use strict';var Sequelize=require('sequelize');module[_0x7f98('0x0')]={'priority':{'type':Sequelize[_0x7f98('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7f98('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7f98('0x2')]},'interval':{'type':Sequelize[_0x7f98('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc21f=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x4c3a36,_0xdba60f){var _0x40f945=function(_0x4efdb2){while(--_0x4efdb2){_0x4c3a36['push'](_0x4c3a36['shift']());}};_0x40f945(++_0xdba60f);}(_0xc21f,0x114));var _0xfc21=function(_0x134c96,_0x41e92c){_0x134c96=_0x134c96-0x0;var _0x3d86d6=_0xc21f[_0x134c96];return _0x3d86d6;};'use strict';var Sequelize=require(_0xfc21('0x0'));module[_0xfc21('0x1')]={'priority':{'type':Sequelize[_0xfc21('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfc21('0x3')]},'interval':{'type':Sequelize[_0xfc21('0x3')],'defaultValue':_0xfc21('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 7e38fcf..0d11144 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 _0x4ca2=['pick','filter','merge','type','VIRTUAL','then','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x4ca2,0x166));var _0x24ca=function(_0x51f9bf,_0x24d5b7){_0x51f9bf=_0x51f9bf-0x0;var _0x2986e3=_0x4ca2[_0x51f9bf];return _0x2986e3;};'use strict';var emlformat=require(_0x24ca('0x0'));var rimraf=require(_0x24ca('0x1'));var zipdir=require(_0x24ca('0x2'));var jsonpatch=require(_0x24ca('0x3'));var rp=require(_0x24ca('0x4'));var moment=require('moment');var BPromise=require(_0x24ca('0x5'));var Mustache=require(_0x24ca('0x6'));var util=require(_0x24ca('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x24ca('0x8'));var ejs=require(_0x24ca('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x24ca('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x24ca('0x8'));var querystring=require('querystring');var Papa=require(_0x24ca('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x24ca('0xc'));var as=require(_0x24ca('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24ca('0xe'))(_0x24ca('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x24ca('0x10'));var db=require(_0x24ca('0x11'))['db'];function respondWithStatusCode(_0x2d79bb,_0x58e86e){_0x58e86e=_0x58e86e||0xcc;return function(_0x40885f){if(_0x40885f){return _0x2d79bb[_0x24ca('0x12')](_0x58e86e);}return _0x2d79bb[_0x24ca('0x13')](_0x58e86e)['end']();};}function respondWithResult(_0x1bb413,_0x56daea){_0x56daea=_0x56daea||0xc8;return function(_0x255666){if(_0x255666){return _0x1bb413[_0x24ca('0x13')](_0x56daea)[_0x24ca('0x14')](_0x255666);}};}function respondWithFilteredResult(_0x863631,_0x332f56){return function(_0x11e415){if(_0x11e415){var _0x3125c1=typeof _0x332f56[_0x24ca('0x15')]==='undefined'&&typeof _0x332f56[_0x24ca('0x16')]===_0x24ca('0x17');var _0x5f01b7=_0x11e415['count'];var _0x7b29c2=_0x3125c1?0x0:_0x332f56[_0x24ca('0x15')];var _0x222f1e=_0x3125c1?_0x11e415[_0x24ca('0x18')]:_0x332f56['offset']+_0x332f56[_0x24ca('0x16')];var _0x2772ae;if(_0x222f1e>=_0x5f01b7){_0x222f1e=_0x5f01b7;_0x2772ae=0xc8;}else{_0x2772ae=0xce;}_0x863631['status'](_0x2772ae);return _0x863631[_0x24ca('0x19')](_0x24ca('0x1a'),_0x7b29c2+'-'+_0x222f1e+'/'+_0x5f01b7)['json'](_0x11e415);}return null;};}function patchUpdates(_0x52cedf){return function(_0x1217ea){try{jsonpatch[_0x24ca('0x1b')](_0x1217ea,_0x52cedf,!![]);}catch(_0x5de14f){return BPromise[_0x24ca('0x1c')](_0x5de14f);}return _0x1217ea['save']();};}function saveUpdates(_0xed8bd9,_0x180cf0){return function(_0x4a89df){if(_0x4a89df){return _0x4a89df['update'](_0xed8bd9)['then'](function(_0x224b70){return _0x224b70;});}return null;};}function removeEntity(_0x26ac81,_0x2b3818){return function(_0x446caa){if(_0x446caa){return _0x446caa['destroy']()['then'](function(){_0x26ac81[_0x24ca('0x13')](0xcc)[_0x24ca('0x1d')]();});}};}function handleEntityNotFound(_0xff13d,_0x9d8a08){return function(_0x976d7e){if(!_0x976d7e){_0xff13d['sendStatus'](0x194);}return _0x976d7e;};}function handleError(_0x4a3c62,_0x55b018){_0x55b018=_0x55b018||0x1f4;return function(_0x250de6){logger[_0x24ca('0x1e')](_0x250de6[_0x24ca('0x1f')]);if(_0x250de6['name']){delete _0x250de6[_0x24ca('0x20')];}_0x4a3c62[_0x24ca('0x13')](_0x55b018)['send'](_0x250de6);};}exports[_0x24ca('0x21')]=function(_0xdaf8d3,_0x11c7a9){var _0x3d1de8={},_0x4816e5={},_0x36c39b={'count':0x0,'rows':[]};var _0x375444=_[_0x24ca('0x22')](db[_0x24ca('0x23')][_0x24ca('0x24')],function(_0x46606e){return{'name':_0x46606e[_0x24ca('0x25')],'type':_0x46606e['type']['key']};});_0x4816e5[_0x24ca('0x26')]=_['map'](_0x375444,_0x24ca('0x20'));_0x4816e5['query']=_['keys'](_0xdaf8d3[_0x24ca('0x27')]);_0x4816e5[_0x24ca('0x28')]=_[_0x24ca('0x29')](_0x4816e5['model'],_0x4816e5[_0x24ca('0x27')]);_0x3d1de8['attributes']=_[_0x24ca('0x29')](_0x4816e5[_0x24ca('0x26')],qs[_0x24ca('0x2a')](_0xdaf8d3[_0x24ca('0x27')][_0x24ca('0x2a')]));_0x3d1de8['attributes']=_0x3d1de8[_0x24ca('0x2b')][_0x24ca('0x2c')]?_0x3d1de8[_0x24ca('0x2b')]:_0x4816e5[_0x24ca('0x26')];if(!_0xdaf8d3[_0x24ca('0x27')][_0x24ca('0x2d')](_0x24ca('0x2e'))){_0x3d1de8['limit']=qs['limit'](_0xdaf8d3[_0x24ca('0x27')]['limit']);_0x3d1de8[_0x24ca('0x15')]=qs['offset'](_0xdaf8d3[_0x24ca('0x27')]['offset']);}_0x3d1de8[_0x24ca('0x2f')]=qs['sort'](_0xdaf8d3[_0x24ca('0x27')][_0x24ca('0x30')]);_0x3d1de8[_0x24ca('0x31')]=qs['filters'](_[_0x24ca('0x32')](_0xdaf8d3[_0x24ca('0x27')],_0x4816e5[_0x24ca('0x28')]),_0x375444);if(_0xdaf8d3['query'][_0x24ca('0x33')]){_0x3d1de8[_0x24ca('0x31')]=_[_0x24ca('0x34')](_0x3d1de8[_0x24ca('0x31')],{'$or':_[_0x24ca('0x22')](_0x375444,function(_0x3d32c0){if(_0x3d32c0[_0x24ca('0x35')]!==_0x24ca('0x36')){var _0x5b32ef={};_0x5b32ef[_0x3d32c0[_0x24ca('0x20')]]={'$like':'%'+_0xdaf8d3[_0x24ca('0x27')]['filter']+'%'};return _0x5b32ef;}})});}_0x3d1de8=_[_0x24ca('0x34')]({},_0x3d1de8,_0xdaf8d3['options']);var _0xcb7fa2={'where':_0x3d1de8[_0x24ca('0x31')]};return db[_0x24ca('0x23')][_0x24ca('0x18')](_0xcb7fa2)[_0x24ca('0x37')](function(_0x2b5291){_0x36c39b['count']=_0x2b5291;if(_0xdaf8d3[_0x24ca('0x27')]['includeAll']){_0x3d1de8[_0x24ca('0x38')]=[{'all':!![]}];}return db[_0x24ca('0x23')][_0x24ca('0x39')](_0x3d1de8);})[_0x24ca('0x37')](function(_0x5a32e6){_0x36c39b['rows']=_0x5a32e6;return _0x36c39b;})['then'](respondWithFilteredResult(_0x11c7a9,_0x3d1de8))[_0x24ca('0x3a')](handleError(_0x11c7a9,null));};exports[_0x24ca('0x3b')]=function(_0x2d6d26,_0xa9623a){var _0x39434e={'raw':!![],'where':{'id':_0x2d6d26[_0x24ca('0x3c')]['id']}},_0x395a86={};_0x395a86[_0x24ca('0x26')]=_[_0x24ca('0x3d')](db[_0x24ca('0x23')]['rawAttributes']);_0x395a86[_0x24ca('0x27')]=_[_0x24ca('0x3d')](_0x2d6d26['query']);_0x395a86[_0x24ca('0x28')]=_[_0x24ca('0x29')](_0x395a86[_0x24ca('0x26')],_0x395a86['query']);_0x39434e[_0x24ca('0x2b')]=_['intersection'](_0x395a86[_0x24ca('0x26')],qs[_0x24ca('0x2a')](_0x2d6d26[_0x24ca('0x27')][_0x24ca('0x2a')]));_0x39434e[_0x24ca('0x2b')]=_0x39434e[_0x24ca('0x2b')][_0x24ca('0x2c')]?_0x39434e[_0x24ca('0x2b')]:_0x395a86[_0x24ca('0x26')];if(_0x2d6d26[_0x24ca('0x27')][_0x24ca('0x3e')]){_0x39434e[_0x24ca('0x38')]=[{'all':!![]}];}_0x39434e=_[_0x24ca('0x34')]({},_0x39434e,_0x2d6d26[_0x24ca('0x3f')]);return db[_0x24ca('0x23')][_0x24ca('0x40')](_0x39434e)['then'](handleEntityNotFound(_0xa9623a,null))[_0x24ca('0x37')](respondWithResult(_0xa9623a,null))[_0x24ca('0x3a')](handleError(_0xa9623a,null));};exports[_0x24ca('0x41')]=function(_0x5e4c83,_0x462d16){return db['SmsApplication'][_0x24ca('0x41')](_0x5e4c83[_0x24ca('0x42')],{})[_0x24ca('0x37')](respondWithResult(_0x462d16,0xc9))['catch'](handleError(_0x462d16,null));};exports[_0x24ca('0x43')]=function(_0x4cf462,_0xe97f17){if(_0x4cf462[_0x24ca('0x42')]['id']){delete _0x4cf462[_0x24ca('0x42')]['id'];}return db[_0x24ca('0x23')]['find']({'where':{'id':_0x4cf462[_0x24ca('0x3c')]['id']}})[_0x24ca('0x37')](handleEntityNotFound(_0xe97f17,null))[_0x24ca('0x37')](saveUpdates(_0x4cf462[_0x24ca('0x42')],null))[_0x24ca('0x37')](respondWithResult(_0xe97f17,null))[_0x24ca('0x3a')](handleError(_0xe97f17,null));};exports['destroy']=function(_0x26c90a,_0x1cdbb9){return db[_0x24ca('0x23')][_0x24ca('0x40')]({'where':{'id':_0x26c90a['params']['id']}})[_0x24ca('0x37')](handleEntityNotFound(_0x1cdbb9,null))['then'](removeEntity(_0x1cdbb9,null))[_0x24ca('0x3a')](handleError(_0x1cdbb9,null));}; \ No newline at end of file +var _0xbe3d=['then','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','SmsApplication','findAll','catch','params','keys','create','body','update','find','eml-format','rimraf','request-promise','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','Content-Range','json','reject','destroy'];(function(_0x251fde,_0x384469){var _0x350af6=function(_0x15a6a3){while(--_0x15a6a3){_0x251fde['push'](_0x251fde['shift']());}};_0x350af6(++_0x384469);}(_0xbe3d,0x1e8));var _0xdbe3=function(_0x123b14,_0x916a25){_0x123b14=_0x123b14-0x0;var _0x5722d2=_0xbe3d[_0x123b14];return _0x5722d2;};'use strict';var emlformat=require(_0xdbe3('0x0'));var rimraf=require(_0xdbe3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdbe3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdbe3('0x3'));var util=require(_0xdbe3('0x4'));var path=require(_0xdbe3('0x5'));var sox=require(_0xdbe3('0x6'));var csv=require(_0xdbe3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbe3('0x8'));var _=require(_0xdbe3('0x9'));var squel=require(_0xdbe3('0xa'));var crypto=require(_0xdbe3('0xb'));var jsforce=require(_0xdbe3('0xc'));var deskjs=require(_0xdbe3('0xd'));var toCsv=require(_0xdbe3('0x7'));var querystring=require(_0xdbe3('0xe'));var Papa=require(_0xdbe3('0xf'));var Redis=require(_0xdbe3('0x10'));var authService=require(_0xdbe3('0x11'));var qs=require(_0xdbe3('0x12'));var as=require(_0xdbe3('0x13'));var hardwareService=require(_0xdbe3('0x14'));var logger=require(_0xdbe3('0x15'))(_0xdbe3('0x16'));var utils=require(_0xdbe3('0x17'));var config=require(_0xdbe3('0x18'));var licenseUtil=require(_0xdbe3('0x19'));var db=require(_0xdbe3('0x1a'))['db'];function respondWithStatusCode(_0x3de77e,_0x59fcc3){_0x59fcc3=_0x59fcc3||0xcc;return function(_0x4a69df){if(_0x4a69df){return _0x3de77e['sendStatus'](_0x59fcc3);}return _0x3de77e['status'](_0x59fcc3)[_0xdbe3('0x1b')]();};}function respondWithResult(_0x567282,_0x1c76df){_0x1c76df=_0x1c76df||0xc8;return function(_0x36b95c){if(_0x36b95c){return _0x567282[_0xdbe3('0x1c')](_0x1c76df)['json'](_0x36b95c);}};}function respondWithFilteredResult(_0x5bfb30,_0x37a863){return function(_0x46b57b){if(_0x46b57b){var _0x64f246=typeof _0x37a863[_0xdbe3('0x1d')]===_0xdbe3('0x1e')&&typeof _0x37a863[_0xdbe3('0x1f')]===_0xdbe3('0x1e');var _0x482f07=_0x46b57b[_0xdbe3('0x20')];var _0x2fb457=_0x64f246?0x0:_0x37a863['offset'];var _0x2707e8=_0x64f246?_0x46b57b[_0xdbe3('0x20')]:_0x37a863[_0xdbe3('0x1d')]+_0x37a863[_0xdbe3('0x1f')];var _0x27b139;if(_0x2707e8>=_0x482f07){_0x2707e8=_0x482f07;_0x27b139=0xc8;}else{_0x27b139=0xce;}_0x5bfb30[_0xdbe3('0x1c')](_0x27b139);return _0x5bfb30['set'](_0xdbe3('0x21'),_0x2fb457+'-'+_0x2707e8+'/'+_0x482f07)[_0xdbe3('0x22')](_0x46b57b);}return null;};}function patchUpdates(_0x35a9a5){return function(_0xaaacd0){try{jsonpatch['apply'](_0xaaacd0,_0x35a9a5,!![]);}catch(_0x4a9a38){return BPromise[_0xdbe3('0x23')](_0x4a9a38);}return _0xaaacd0['save']();};}function saveUpdates(_0x4bb4d4,_0x173ca3){return function(_0x3b1d32){if(_0x3b1d32){return _0x3b1d32['update'](_0x4bb4d4)['then'](function(_0x5a3a93){return _0x5a3a93;});}return null;};}function removeEntity(_0x2f9d25,_0x3dba95){return function(_0x3a2826){if(_0x3a2826){return _0x3a2826[_0xdbe3('0x24')]()[_0xdbe3('0x25')](function(){_0x2f9d25[_0xdbe3('0x1c')](0xcc)[_0xdbe3('0x1b')]();});}};}function handleEntityNotFound(_0x2279ff,_0x4932ca){return function(_0x417ad9){if(!_0x417ad9){_0x2279ff[_0xdbe3('0x26')](0x194);}return _0x417ad9;};}function handleError(_0x3a104b,_0x4fea66){_0x4fea66=_0x4fea66||0x1f4;return function(_0x1cd04a){logger[_0xdbe3('0x27')](_0x1cd04a[_0xdbe3('0x28')]);if(_0x1cd04a[_0xdbe3('0x29')]){delete _0x1cd04a[_0xdbe3('0x29')];}_0x3a104b[_0xdbe3('0x1c')](_0x4fea66)[_0xdbe3('0x2a')](_0x1cd04a);};}exports['index']=function(_0x3cb79f,_0x8735c2){var _0x5ef0cc={},_0x5934b0={},_0x3393b6={'count':0x0,'rows':[]};var _0x23fd84=_['map'](db['SmsApplication'][_0xdbe3('0x2b')],function(_0x3c8ed9){return{'name':_0x3c8ed9[_0xdbe3('0x2c')],'type':_0x3c8ed9['type'][_0xdbe3('0x2d')]};});_0x5934b0[_0xdbe3('0x2e')]=_[_0xdbe3('0x2f')](_0x23fd84,'name');_0x5934b0[_0xdbe3('0x30')]=_['keys'](_0x3cb79f[_0xdbe3('0x30')]);_0x5934b0['filters']=_['intersection'](_0x5934b0['model'],_0x5934b0[_0xdbe3('0x30')]);_0x5ef0cc[_0xdbe3('0x31')]=_[_0xdbe3('0x32')](_0x5934b0['model'],qs[_0xdbe3('0x33')](_0x3cb79f['query']['fields']));_0x5ef0cc[_0xdbe3('0x31')]=_0x5ef0cc['attributes'][_0xdbe3('0x34')]?_0x5ef0cc[_0xdbe3('0x31')]:_0x5934b0[_0xdbe3('0x2e')];if(!_0x3cb79f[_0xdbe3('0x30')][_0xdbe3('0x35')](_0xdbe3('0x36'))){_0x5ef0cc[_0xdbe3('0x1f')]=qs[_0xdbe3('0x1f')](_0x3cb79f[_0xdbe3('0x30')][_0xdbe3('0x1f')]);_0x5ef0cc[_0xdbe3('0x1d')]=qs[_0xdbe3('0x1d')](_0x3cb79f[_0xdbe3('0x30')][_0xdbe3('0x1d')]);}_0x5ef0cc[_0xdbe3('0x37')]=qs[_0xdbe3('0x38')](_0x3cb79f[_0xdbe3('0x30')][_0xdbe3('0x38')]);_0x5ef0cc[_0xdbe3('0x39')]=qs[_0xdbe3('0x3a')](_[_0xdbe3('0x3b')](_0x3cb79f[_0xdbe3('0x30')],_0x5934b0[_0xdbe3('0x3a')]),_0x23fd84);if(_0x3cb79f[_0xdbe3('0x30')][_0xdbe3('0x3c')]){_0x5ef0cc['where']=_[_0xdbe3('0x3d')](_0x5ef0cc[_0xdbe3('0x39')],{'$or':_[_0xdbe3('0x2f')](_0x23fd84,function(_0x32ba0d){if(_0x32ba0d['type']!==_0xdbe3('0x3e')){var _0x40e705={};_0x40e705[_0x32ba0d['name']]={'$like':'%'+_0x3cb79f[_0xdbe3('0x30')][_0xdbe3('0x3c')]+'%'};return _0x40e705;}})});}_0x5ef0cc=_[_0xdbe3('0x3d')]({},_0x5ef0cc,_0x3cb79f[_0xdbe3('0x3f')]);var _0x7470a1={'where':_0x5ef0cc[_0xdbe3('0x39')]};return db['SmsApplication'][_0xdbe3('0x20')](_0x7470a1)[_0xdbe3('0x25')](function(_0x560516){_0x3393b6[_0xdbe3('0x20')]=_0x560516;if(_0x3cb79f[_0xdbe3('0x30')][_0xdbe3('0x40')]){_0x5ef0cc[_0xdbe3('0x41')]=[{'all':!![]}];}return db[_0xdbe3('0x42')][_0xdbe3('0x43')](_0x5ef0cc);})[_0xdbe3('0x25')](function(_0x44abb8){_0x3393b6['rows']=_0x44abb8;return _0x3393b6;})[_0xdbe3('0x25')](respondWithFilteredResult(_0x8735c2,_0x5ef0cc))[_0xdbe3('0x44')](handleError(_0x8735c2,null));};exports['show']=function(_0x578247,_0x4148ee){var _0x1a86ae={'raw':!![],'where':{'id':_0x578247[_0xdbe3('0x45')]['id']}},_0x2a9e22={};_0x2a9e22[_0xdbe3('0x2e')]=_['keys'](db[_0xdbe3('0x42')][_0xdbe3('0x2b')]);_0x2a9e22['query']=_[_0xdbe3('0x46')](_0x578247[_0xdbe3('0x30')]);_0x2a9e22[_0xdbe3('0x3a')]=_['intersection'](_0x2a9e22['model'],_0x2a9e22[_0xdbe3('0x30')]);_0x1a86ae[_0xdbe3('0x31')]=_[_0xdbe3('0x32')](_0x2a9e22['model'],qs[_0xdbe3('0x33')](_0x578247[_0xdbe3('0x30')][_0xdbe3('0x33')]));_0x1a86ae[_0xdbe3('0x31')]=_0x1a86ae['attributes'][_0xdbe3('0x34')]?_0x1a86ae[_0xdbe3('0x31')]:_0x2a9e22[_0xdbe3('0x2e')];if(_0x578247['query']['includeAll']){_0x1a86ae[_0xdbe3('0x41')]=[{'all':!![]}];}_0x1a86ae=_[_0xdbe3('0x3d')]({},_0x1a86ae,_0x578247['options']);return db[_0xdbe3('0x42')]['find'](_0x1a86ae)[_0xdbe3('0x25')](handleEntityNotFound(_0x4148ee,null))[_0xdbe3('0x25')](respondWithResult(_0x4148ee,null))[_0xdbe3('0x44')](handleError(_0x4148ee,null));};exports[_0xdbe3('0x47')]=function(_0x1aed3e,_0x546aac){return db[_0xdbe3('0x42')][_0xdbe3('0x47')](_0x1aed3e[_0xdbe3('0x48')],{})['then'](respondWithResult(_0x546aac,0xc9))['catch'](handleError(_0x546aac,null));};exports[_0xdbe3('0x49')]=function(_0x613cea,_0x5e5be4){if(_0x613cea[_0xdbe3('0x48')]['id']){delete _0x613cea[_0xdbe3('0x48')]['id'];}return db[_0xdbe3('0x42')][_0xdbe3('0x4a')]({'where':{'id':_0x613cea[_0xdbe3('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e5be4,null))[_0xdbe3('0x25')](saveUpdates(_0x613cea['body'],null))['then'](respondWithResult(_0x5e5be4,null))[_0xdbe3('0x44')](handleError(_0x5e5be4,null));};exports[_0xdbe3('0x24')]=function(_0x49f217,_0x317db3){return db['SmsApplication'][_0xdbe3('0x4a')]({'where':{'id':_0x49f217[_0xdbe3('0x45')]['id']}})[_0xdbe3('0x25')](handleEntityNotFound(_0x317db3,null))['then'](removeEntity(_0x317db3,null))[_0xdbe3('0x44')](handleError(_0x317db3,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index ce8e89f..8522a65 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 _0x7499=['define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x8d38b6,_0x4b6bee){var _0x303125=function(_0x1dc4cd){while(--_0x1dc4cd){_0x8d38b6['push'](_0x8d38b6['shift']());}};_0x303125(++_0x4b6bee);}(_0x7499,0x162));var _0x9749=function(_0x24c405,_0x56d6fb){_0x24c405=_0x24c405-0x0;var _0x383aef=_0x7499[_0x24c405];return _0x383aef;};'use strict';var _=require(_0x9749('0x0'));var util=require(_0x9749('0x1'));var logger=require('../../config/logger')(_0x9749('0x2'));var moment=require(_0x9749('0x3'));var BPromise=require(_0x9749('0x4'));var rp=require(_0x9749('0x5'));var fs=require('fs');var path=require(_0x9749('0x6'));var rimraf=require(_0x9749('0x7'));var config=require(_0x9749('0x8'));var attributes=require('./smsApplication.attributes');module[_0x9749('0x9')]=function(_0x71a2b2,_0x3587cc){return _0x71a2b2[_0x9749('0xa')](_0x9749('0xb'),attributes,{'tableName':_0x9749('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9749('0xd')});}; \ No newline at end of file +var _0x3525=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','sms_applications'];(function(_0x3c77f9,_0x2abb07){var _0x41790a=function(_0x363994){while(--_0x363994){_0x3c77f9['push'](_0x3c77f9['shift']());}};_0x41790a(++_0x2abb07);}(_0x3525,0x143));var _0x5352=function(_0x5944e9,_0xf3da60){_0x5944e9=_0x5944e9-0x0;var _0x1098b8=_0x3525[_0x5944e9];return _0x1098b8;};'use strict';var _=require(_0x5352('0x0'));var util=require(_0x5352('0x1'));var logger=require(_0x5352('0x2'))(_0x5352('0x3'));var moment=require(_0x5352('0x4'));var BPromise=require(_0x5352('0x5'));var rp=require(_0x5352('0x6'));var fs=require('fs');var path=require(_0x5352('0x7'));var rimraf=require('rimraf');var config=require(_0x5352('0x8'));var attributes=require(_0x5352('0x9'));module[_0x5352('0xa')]=function(_0x2c2596,_0x39d6b6){return _0x2c2596[_0x5352('0xb')]('SmsApplication',attributes,{'tableName':_0x5352('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5352('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index eb9740a..3fb763a 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 _0x4959=['../../config/logger','rpc','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x4959,0x9b));var _0x9495=function(_0x2f8612,_0x5ca6ed){_0x2f8612=_0x2f8612-0x0;var _0x1c3a07=_0x4959[_0x2f8612];return _0x1c3a07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9495('0x0'));var BPromise=require(_0x9495('0x1'));var rs=require(_0x9495('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9495('0x3'))['db'];var utils=require(_0x9495('0x4'));var logger=require(_0x9495('0x5'))(_0x9495('0x6'));var config=require('../../config/environment');var jayson=require(_0x9495('0x7'));var client=jayson[_0x9495('0x8')][_0x9495('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21f4e7,_0xd77231,_0x34744d){return new BPromise(function(_0x2a4754,_0x19f08c){return client[_0x9495('0xa')](_0x21f4e7,_0x34744d)[_0x9495('0xb')](function(_0x6b1466){logger['info'](_0x9495('0xc'),_0xd77231,'request\x20sent');logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0xd77231,'request\x20sent',JSON[_0x9495('0xd')](_0x6b1466));if(_0x6b1466[_0x9495('0xe')]){if(_0x6b1466[_0x9495('0xe')][_0x9495('0xf')]===0x1f4){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x19f08c(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);return _0x2a4754(_0x6b1466[_0x9495('0xe')][_0x9495('0x10')]);}else{logger['info'](_0x9495('0xc'),_0xd77231,_0x9495('0x11'));_0x2a4754(_0x6b1466[_0x9495('0x12')][_0x9495('0x10')]);}})[_0x9495('0x13')](function(_0x4c1d9d){logger[_0x9495('0xe')](_0x9495('0xc'),_0xd77231,_0x4c1d9d);_0x19f08c(_0x4c1d9d);});});} \ No newline at end of file +var _0xb4d9=['client','http','request','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x128b18,_0x817f20){var _0x2d1e7d=function(_0x142c1e){while(--_0x142c1e){_0x128b18['push'](_0x128b18['shift']());}};_0x2d1e7d(++_0x817f20);}(_0xb4d9,0xce));var _0x9b4d=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb4d9[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x9b4d('0x0'));var util=require(_0x9b4d('0x1'));var moment=require('moment');var BPromise=require(_0x9b4d('0x2'));var rs=require(_0x9b4d('0x3'));var fs=require('fs');var Redis=require(_0x9b4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9b4d('0x5'));var logger=require(_0x9b4d('0x6'))(_0x9b4d('0x7'));var config=require(_0x9b4d('0x8'));var jayson=require(_0x9b4d('0x9'));var client=jayson[_0x9b4d('0xa')][_0x9b4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x429cc5,_0x461cb1,_0x14cb0b){return new BPromise(function(_0x156c68,_0x48832a){return client[_0x9b4d('0xc')](_0x429cc5,_0x14cb0b)['then'](function(_0x340b21){logger['info'](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));logger[_0x9b4d('0xf')](_0x9b4d('0x10'),_0x461cb1,_0x9b4d('0xe'),JSON[_0x9b4d('0x11')](_0x340b21));if(_0x340b21[_0x9b4d('0x12')]){if(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x13')]===0x1f4){logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21[_0x9b4d('0x12')]['message']);return _0x48832a(_0x340b21[_0x9b4d('0x12')][_0x9b4d('0x14')]);}logger[_0x9b4d('0x12')](_0x9b4d('0xd'),_0x461cb1,_0x340b21['error'][_0x9b4d('0x14')]);return _0x156c68(_0x340b21['error']['message']);}else{logger[_0x9b4d('0x15')](_0x9b4d('0xd'),_0x461cb1,_0x9b4d('0xe'));_0x156c68(_0x340b21[_0x9b4d('0x16')][_0x9b4d('0x14')]);}})[_0x9b4d('0x17')](function(_0x5d23f3){logger['error'](_0x9b4d('0xd'),_0x461cb1,_0x5d23f3);_0x48832a(_0x5d23f3);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 194f461..b8cd620 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 _0x2032=['./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','/:id/tags','sms','smsinteraction:addtags','addTags','put','/:id','tracked','smsinteraction:update','update','smsinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x315216,_0x15d0cc){var _0x4dfb84=function(_0x7e1a19){while(--_0x7e1a19){_0x315216['push'](_0x315216['shift']());}};_0x4dfb84(++_0x15d0cc);}(_0x2032,0xd9));var _0x2203=function(_0x148021,_0xc0730b){_0x148021=_0x148021-0x0;var _0x1d5d4e=_0x2032[_0x148021];return _0x1d5d4e;};'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',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['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x2203('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction[_0x2203('0x19')](_0x2203('0x14'),_0x2203('0x1a')),controller[_0x2203('0x1b')]);router['delete'](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x1c')),controller['destroy']);router[_0x2203('0x1d')]('/:id/tags',auth[_0x2203('0x9')](),controller[_0x2203('0x1e')]);module[_0x2203('0x1f')]=router; \ No newline at end of file +var _0xb62e=['removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','put','sms','smsinteraction:update','update','delete','smsinteraction:destroy','destroy'];(function(_0x454043,_0x124652){var _0x183c52=function(_0x1432d4){while(--_0x1432d4){_0x454043['push'](_0x454043['shift']());}};_0x183c52(++_0x124652);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/describe',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xc')](_0xeb62('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xeb62('0xc')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0xc')](_0xeb62('0x11'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);router[_0xeb62('0x13')]('/',auth[_0xeb62('0xa')](),controller['create']);router[_0xeb62('0x13')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x14')]);router['post'](_0xeb62('0x15'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')]('sms',_0xeb62('0x17')),controller[_0xeb62('0x18')]);router[_0xeb62('0x19')]('/:id',auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1b')),controller[_0xeb62('0x1c')]);router[_0xeb62('0x1d')](_0xeb62('0xe'),auth[_0xeb62('0xa')](),interaction[_0xeb62('0x16')](_0xeb62('0x1a'),_0xeb62('0x1e')),controller[_0xeb62('0x1f')]);router[_0xeb62('0x1d')]('/:id/tags',auth[_0xeb62('0xa')](),controller[_0xeb62('0x20')]);module[_0xeb62('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 32fc7c4..6e2175a 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 _0x4888=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0xdd561f,_0x5d5e9a){var _0x5631d6=function(_0x2ae923){while(--_0x2ae923){_0xdd561f['push'](_0xdd561f['shift']());}};_0x5631d6(++_0x5d5e9a);}(_0x4888,0x198));var _0x8488=function(_0x91ec40,_0xa1ec3b){_0x91ec40=_0x91ec40-0x0;var _0x428c7a=_0x4888[_0x91ec40];return _0x428c7a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8488('0x0'));module[_0x8488('0x1')]={'closed':{'type':Sequelize[_0x8488('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8488('0x3')]},'disposition':{'type':Sequelize[_0x8488('0x4')]},'secondDisposition':{'type':Sequelize[_0x8488('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8488('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x8488('0x4')]},'read1stAt':{'type':Sequelize[_0x8488('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8488('0x5')]('in',_0x8488('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8488('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8488('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xc4e1=['out','INTEGER','sequelize','moment','exports','BOOLEAN','STRING','ENUM'];(function(_0x46cd48,_0x403bc6){var _0x32da5f=function(_0x52b0bd){while(--_0x52b0bd){_0x46cd48['push'](_0x46cd48['shift']());}};_0x32da5f(++_0x403bc6);}(_0xc4e1,0x172));var _0x1c4e=function(_0x291006,_0x3aea61){_0x291006=_0x291006-0x0;var _0x357db8=_0xc4e1[_0x291006];return _0x357db8;};'use strict';var Sequelize=require(_0x1c4e('0x0'));var moment=require(_0x1c4e('0x1'));module[_0x1c4e('0x2')]={'closed':{'type':Sequelize[_0x1c4e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x1c4e('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1c4e('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1c4e('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x1c4e('0x5')]('in',_0x1c4e('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1c4e('0x5')]('in',_0x1c4e('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x1c4e('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b1a0007..c952b76 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 _0x70e9=['split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','spread','smsInteractionTags:save','removeTags','download','join','root','server','files','tmp','format','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Messages','createdAt','direction','secret','read','SmsAccount','Account','get','mkdirSync','Owner','N.A.','toString','closed','closedAt','out','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','register','end','json','offset','limit','undefined','count','status','set','Content-Range','update','then','error','stack','name','send','index','map','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','model','keys','SmsInteraction','rawAttributes','intersection','attributes','length','includeAll','include','merge','options','create','body','find','params','destroy','describe','addMessage','SmsMessage','omit','ids','getMessages','filters','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x70e9,0xa2));var _0x970e=function(_0x76dc7e,_0x2a1697){_0x76dc7e=_0x76dc7e-0x0;var _0x2e4e9e=_0x70e9[_0x76dc7e];return _0x2e4e9e;};'use strict';var rimraf=require(_0x970e('0x0'));var zipdir=require(_0x970e('0x1'));var moment=require(_0x970e('0x2'));var BPromise=require('bluebird');var util=require(_0x970e('0x3'));var path=require(_0x970e('0x4'));var ejs=require(_0x970e('0x5'));var fs=require('fs');var _=require(_0x970e('0x6'));var Redis=require(_0x970e('0x7'));var interaction=require(_0x970e('0x8'));var qs=require(_0x970e('0x9'));var pdf=require(_0x970e('0xa'));var logger=require('../../config/logger')(_0x970e('0xb'));var config=require(_0x970e('0xc'));var db=require('../../mysqldb')['db'];config[_0x970e('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0x970e('0xe')](socket);function respondWithStatusCode(_0x5dd488,_0x3c356e){_0x3c356e=_0x3c356e||0xcc;return function(_0x280694){if(_0x280694){return _0x5dd488['sendStatus'](_0x3c356e);}return _0x5dd488['status'](_0x3c356e)[_0x970e('0xf')]();};}function respondWithResult(_0xe65e7,_0x7e7dab){_0x7e7dab=_0x7e7dab||0xc8;return function(_0x41b18e){if(_0x41b18e){return _0xe65e7['status'](_0x7e7dab)[_0x970e('0x10')](_0x41b18e);}};}function respondWithFilteredResult(_0x598ca2,_0x3e72e0){return function(_0x563997){if(_0x563997){var _0x654d82=typeof _0x3e72e0[_0x970e('0x11')]==='undefined'&&typeof _0x3e72e0[_0x970e('0x12')]===_0x970e('0x13');var _0x37b090=_0x563997[_0x970e('0x14')];var _0x8a87f=_0x654d82?0x0:_0x3e72e0['offset'];var _0x2d3373=_0x654d82?_0x563997['count']:_0x3e72e0[_0x970e('0x11')]+_0x3e72e0[_0x970e('0x12')];var _0x4fd61e;if(_0x2d3373>=_0x37b090){_0x2d3373=_0x37b090;_0x4fd61e=0xc8;}else{_0x4fd61e=0xce;}_0x598ca2[_0x970e('0x15')](_0x4fd61e);return _0x598ca2[_0x970e('0x16')](_0x970e('0x17'),_0x8a87f+'-'+_0x2d3373+'/'+_0x37b090)[_0x970e('0x10')](_0x563997);}return null;};}function saveUpdates(_0x2b175e){return function(_0xfed2ae){if(_0xfed2ae){return _0xfed2ae[_0x970e('0x18')](_0x2b175e)[_0x970e('0x19')](function(_0x32f66c){return _0x32f66c;});}return null;};}function removeEntity(_0x3dbe1c){return function(_0xea132b){if(_0xea132b){return _0xea132b['destroy']()[_0x970e('0x19')](function(){_0x3dbe1c[_0x970e('0x15')](0xcc)[_0x970e('0xf')]();});}};}function handleEntityNotFound(_0x2de937){return function(_0xf35d2d){if(!_0xf35d2d){_0x2de937['sendStatus'](0x194);}return _0xf35d2d;};}function handleError(_0x580a6e,_0x32e1e6){_0x32e1e6=_0x32e1e6||0x1f4;return function(_0x4b6747){logger[_0x970e('0x1a')](_0x4b6747[_0x970e('0x1b')]);if(_0x4b6747[_0x970e('0x1c')]){delete _0x4b6747[_0x970e('0x1c')];}_0x580a6e[_0x970e('0x15')](_0x32e1e6)[_0x970e('0x1d')](_0x4b6747);};}exports[_0x970e('0x1e')]=function(_0x5cdebd,_0x447a13){var _0x38dfe6={};var _0x47db66=_[_0x970e('0x1f')](db['SmsInteraction']['rawAttributes'],function(_0x2c5180){return{'name':_0x2c5180[_0x970e('0x20')],'type':_0x2c5180[_0x970e('0x21')][_0x970e('0x22')]};});_0x38dfe6=qs[_0x970e('0x23')](_0x47db66,_0x5cdebd);return interaction[_0x970e('0x24')](_0x970e('0x25'),_0x5cdebd[_0x970e('0x26')],_0x5cdebd[_0x970e('0x27')],_0x38dfe6,_0x47db66)[_0x970e('0x19')](respondWithFilteredResult(_0x447a13,_0x38dfe6))[_0x970e('0x28')](handleError(_0x447a13,null));};exports[_0x970e('0x29')]=function(_0x23e503,_0x2a6a31){var _0x48ccbb={'raw':![],'where':{'id':_0x23e503['params']['id']}},_0x1d1ebb={};_0x1d1ebb[_0x970e('0x2a')]=_[_0x970e('0x2b')](db[_0x970e('0x2c')][_0x970e('0x2d')]);_0x1d1ebb[_0x970e('0x26')]=_[_0x970e('0x2b')](_0x23e503[_0x970e('0x26')]);_0x1d1ebb['filters']=_[_0x970e('0x2e')](_0x1d1ebb['model'],_0x1d1ebb[_0x970e('0x26')]);_0x48ccbb[_0x970e('0x2f')]=_[_0x970e('0x2e')](_0x1d1ebb[_0x970e('0x2a')],qs['fields'](_0x23e503[_0x970e('0x26')]['fields']));_0x48ccbb[_0x970e('0x2f')]=_0x48ccbb[_0x970e('0x2f')][_0x970e('0x30')]?_0x48ccbb[_0x970e('0x2f')]:_0x1d1ebb['model'];if(_0x23e503[_0x970e('0x26')][_0x970e('0x31')]){_0x48ccbb[_0x970e('0x32')]=[{'all':!![]}];}_0x48ccbb=_[_0x970e('0x33')]({},_0x48ccbb,_0x23e503[_0x970e('0x34')]);return db['SmsInteraction']['find'](_0x48ccbb)[_0x970e('0x19')](handleEntityNotFound(_0x2a6a31,null))[_0x970e('0x19')](respondWithResult(_0x2a6a31,null))[_0x970e('0x28')](handleError(_0x2a6a31,null));};exports[_0x970e('0x35')]=function(_0x41c498,_0x40e84b){return db[_0x970e('0x2c')]['create'](_0x41c498[_0x970e('0x36')],{})[_0x970e('0x19')](respondWithResult(_0x40e84b,0xc9))[_0x970e('0x28')](handleError(_0x40e84b,null));};exports[_0x970e('0x18')]=function(_0x502c2,_0x3d4a18){if(_0x502c2['body']['id']){delete _0x502c2[_0x970e('0x36')]['id'];}return db['SmsInteraction'][_0x970e('0x37')]({'where':{'id':_0x502c2[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x3d4a18,null))['then'](saveUpdates(_0x502c2[_0x970e('0x36')],null))[_0x970e('0x19')](respondWithResult(_0x3d4a18,null))[_0x970e('0x28')](handleError(_0x3d4a18,null));};exports[_0x970e('0x39')]=function(_0x5934fd,_0x4b55b5){return db['SmsInteraction']['find']({'where':{'id':_0x5934fd['params']['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x4b55b5,null))[_0x970e('0x19')](removeEntity(_0x4b55b5,null))['catch'](handleError(_0x4b55b5,null));};exports[_0x970e('0x3a')]=function(_0x1885ee,_0x4d7edf){return db[_0x970e('0x2c')]['describe']()['then'](respondWithResult(_0x4d7edf,null))[_0x970e('0x28')](handleError(_0x4d7edf,null));};exports[_0x970e('0x3b')]=function(_0x64d289,_0x3cc99e){return db[_0x970e('0x3c')][_0x970e('0x37')]({'where':{'id':_0x64d289[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x3cc99e,null))[_0x970e('0x19')](function(_0x337e08){if(_0x337e08){return _0x337e08[_0x970e('0x3b')](_0x64d289[_0x970e('0x36')]['ids'],_[_0x970e('0x3d')](_0x64d289[_0x970e('0x36')],[_0x970e('0x3e'),'id'])||{});}})[_0x970e('0x19')](respondWithResult(_0x3cc99e,null))[_0x970e('0x28')](handleError(_0x3cc99e,null));};exports[_0x970e('0x3f')]=function(_0x49ac7c,_0x18eded){var _0x5a3de7={'raw':![],'where':{}};var _0x115202={};var _0x40e0bd={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x49ac7c[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x18eded,null))['then'](function(_0x3a8d82){if(_0x3a8d82){_0x115202['model']=_['keys'](db[_0x970e('0x3c')]['rawAttributes']);_0x115202[_0x970e('0x26')]=_['keys'](_0x49ac7c[_0x970e('0x26')]);_0x115202[_0x970e('0x40')]=_[_0x970e('0x2e')](_0x115202[_0x970e('0x2a')],_0x115202[_0x970e('0x26')]);_0x5a3de7[_0x970e('0x2f')]=_[_0x970e('0x2e')](_0x115202[_0x970e('0x2a')],qs['fields'](_0x49ac7c[_0x970e('0x26')][_0x970e('0x41')]));_0x5a3de7['attributes']=_0x5a3de7[_0x970e('0x2f')][_0x970e('0x30')]?_0x5a3de7[_0x970e('0x2f')]:_0x115202[_0x970e('0x2a')];if(!_0x49ac7c[_0x970e('0x26')][_0x970e('0x42')](_0x970e('0x43'))){_0x5a3de7['limit']=qs['limit'](_0x49ac7c['query'][_0x970e('0x12')]);_0x5a3de7[_0x970e('0x11')]=qs[_0x970e('0x11')](_0x49ac7c[_0x970e('0x26')][_0x970e('0x11')]);}_0x5a3de7[_0x970e('0x44')]=qs[_0x970e('0x45')](_0x49ac7c[_0x970e('0x26')][_0x970e('0x45')]);_0x5a3de7[_0x970e('0x46')]=qs['filters'](_[_0x970e('0x47')](_0x49ac7c[_0x970e('0x26')],_0x115202['filters']));_0x5a3de7[_0x970e('0x46')]['SmsInteractionId']=_0x3a8d82['id'];if(_0x49ac7c['query'][_0x970e('0x48')]){_0x5a3de7['where']=_[_0x970e('0x33')](_0x5a3de7[_0x970e('0x46')],{'$or':_['map'](_0x5a3de7['attributes'],function(_0x3da39b){var _0x46d605={};_0x46d605[_0x3da39b]={'$like':'%'+_0x49ac7c['query'][_0x970e('0x48')]+'%'};return _0x46d605;})});}if(_0x49ac7c[_0x970e('0x26')][_0x970e('0x49')]){var _0x18a73d=_0x49ac7c['query'][_0x970e('0x49')][_0x970e('0x4a')](',');var _0xe0d8e4={};_0xe0d8e4[_0x18a73d[0x0]]={'$gte':moment(_0x18a73d[0x1])['format'](_0x970e('0x4b'))};_0x5a3de7['where']=_['merge'](_0x5a3de7[_0x970e('0x46')],_0xe0d8e4);}_0x5a3de7=_['merge']({},_0x5a3de7,_0x49ac7c[_0x970e('0x34')]);return db['SmsMessage'][_0x970e('0x14')]({'where':_0x5a3de7['where']})[_0x970e('0x19')](function(_0xc801ed){_0x40e0bd[_0x970e('0x14')]=_0xc801ed;if(_0x49ac7c['query'][_0x970e('0x31')]){_0x5a3de7[_0x970e('0x32')]=[{'all':!![]}];}return db[_0x970e('0x3c')][_0x970e('0x24')](_0x5a3de7);})[_0x970e('0x19')](function(_0x44655d){_0x40e0bd[_0x970e('0x4c')]=_0x44655d;return _0x40e0bd;});}})[_0x970e('0x19')](respondWithFilteredResult(_0x18eded,_0x5a3de7))[_0x970e('0x28')](handleError(_0x18eded,null));};exports[_0x970e('0x4d')]=function(_0xec62fa,_0x437304){return db[_0x970e('0x2c')]['find']({'where':{'id':_0xec62fa[_0x970e('0x38')]['id']}})['then'](handleEntityNotFound(_0x437304,null))['then'](function(_0x45a3a5){if(_0x45a3a5){return _0x45a3a5['setTags'](_0xec62fa[_0x970e('0x36')][_0x970e('0x3e')],_[_0x970e('0x3d')](_0xec62fa[_0x970e('0x36')],['ids','id'])||{})[_0x970e('0x4e')](function(){return db['Tag'][_0x970e('0x24')]({'attributes':['id','name','color'],'where':{'id':_0xec62fa['body'][_0x970e('0x3e')]}});})['then'](function(_0x48549b){socket['emit'](_0x970e('0x4f'),{'id':Number(_0xec62fa[_0x970e('0x38')]['id']),'tags':_0x48549b||[]});return{'id':Number(_0xec62fa[_0x970e('0x38')]['id']),'tags':_0x48549b||[]};});}})[_0x970e('0x19')](respondWithResult(_0x437304,null))[_0x970e('0x28')](handleError(_0x437304,null));};exports[_0x970e('0x50')]=function(_0x267aa5,_0x1d770c){return db['SmsInteraction'][_0x970e('0x37')]({'where':{'id':_0x267aa5[_0x970e('0x38')]['id']}})[_0x970e('0x19')](handleEntityNotFound(_0x1d770c,null))[_0x970e('0x19')](function(_0x2061fa){if(_0x2061fa){return _0x2061fa[_0x970e('0x50')](_0x267aa5['query']['ids']);}})[_0x970e('0x19')](respondWithStatusCode(_0x1d770c,null))[_0x970e('0x28')](handleError(_0x1d770c,null));};exports[_0x970e('0x51')]=function(_0x2e9495,_0x2d49a1){var _0x40a9ed=moment()['unix']()['toString']();var _0x4b0e78=path[_0x970e('0x52')](config[_0x970e('0x53')],_0x970e('0x54'),_0x970e('0x55'),_0x970e('0x56'));var _0x37e17d=path[_0x970e('0x52')](_0x4b0e78,_0x40a9ed);var _0x5b3ca3=util[_0x970e('0x57')](_0x970e('0x58'),_0x2e9495[_0x970e('0x38')]['id'],_0x40a9ed);var _0x4b45bc=path[_0x970e('0x52')](_0x4b0e78,_0x5b3ca3);var _0x9a3eed=[];_0x9a3eed[_0x970e('0x59')]({'model':db[_0x970e('0x5a')],'as':'User','attributes':['id',_0x970e('0x5b')],'raw':!![]});_0x9a3eed[_0x970e('0x59')]({'model':db['CmContact'],'as':_0x970e('0x5c'),'attributes':['id',_0x970e('0x5d'),_0x970e('0x5e')],'raw':!![]});var _0x253cd6=[{'model':db[_0x970e('0x3c')],'as':_0x970e('0x5f'),'attributes':['id',_0x970e('0x36'),_0x970e('0x60'),_0x970e('0x61'),_0x970e('0x62'),_0x970e('0x63')],'include':_0x9a3eed}];_0x253cd6[_0x970e('0x59')]({'model':db[_0x970e('0x64')],'as':_0x970e('0x65'),'attributes':['id','name']});_0x253cd6[_0x970e('0x59')]({'model':db['User'],'as':'Owner','attributes':['id',_0x970e('0x5b')]});return db[_0x970e('0x2c')][_0x970e('0x37')]({'where':{'id':_0x2e9495[_0x970e('0x38')]['id']},'include':_0x253cd6})[_0x970e('0x19')](handleEntityNotFound(_0x2d49a1,null))[_0x970e('0x19')](function(_0x490fba){if(_0x490fba){var _0x3a5f11=_0x490fba[_0x970e('0x66')]({'plain':!![]});fs[_0x970e('0x67')](_0x37e17d);var _0x3d1283={'channel':'Sms','account':_0x3a5f11[_0x970e('0x65')]['name'],'agent':_0x3a5f11[_0x970e('0x68')]?_0x3a5f11[_0x970e('0x68')][_0x970e('0x5b')]:_0x970e('0x69'),'createdAt':moment(_0x3a5f11[_0x970e('0x60')])[_0x970e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0x970e('0x6a')](),'closedAt':_0x3a5f11[_0x970e('0x6b')]?moment(_0x3a5f11[_0x970e('0x6c')])[_0x970e('0x57')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3a5f11['disposition'],'messages':_(_0x3a5f11[_0x970e('0x5f')])['filter']({'secret':![]})[_0x970e('0x1f')](function(_0x567e20){return{'date':moment(_0x567e20[_0x970e('0x60')])[_0x970e('0x57')](_0x970e('0x4b'))[_0x970e('0x6a')](),'sender':_0x567e20[_0x970e('0x61')]===_0x970e('0x6d')?_0x567e20['User']?_0x567e20['User']['fullname']:'System':_0x567e20[_0x970e('0x5c')][_0x970e('0x5d')]+(_0x567e20[_0x970e('0x5c')][_0x970e('0x5e')]?'\x20'+_0x567e20['Contact']['lastName']:''),'body':_0x567e20[_0x970e('0x36')],'direction':_0x567e20[_0x970e('0x61')]===_0x970e('0x6d')?'A':'C','secret':_0x567e20[_0x970e('0x62')],'read':_0x567e20[_0x970e('0x63')]};})[_0x970e('0x6e')]()};return ejs['renderFile'](path['join'](config[_0x970e('0x53')],_0x970e('0x54'),_0x970e('0x6f'),_0x970e('0x70')),{'interaction':_0x3d1283})[_0x970e('0x19')](function(_0x1c33d4){var _0x4e937a=path[_0x970e('0x52')](_0x37e17d,_0x970e('0x71')+_0x3a5f11['id']+'-'+_0x40a9ed+_0x970e('0x72'));var _0x371d1f={'path':_0x4e937a,'channel':'Sms','interactionId':_0x3a5f11['id']};return pdf[_0x970e('0x73')](_0x1c33d4,_0x371d1f);})[_0x970e('0x19')](function(){return new BPromise(function(_0x51db71,_0x1bdb7d){zipdir(_0x37e17d,{'saveTo':_0x4b45bc},function(_0xa9d8b1,_0x3bd661){if(_0xa9d8b1)return _0x1bdb7d(_0xa9d8b1);return _0x51db71(_0x3bd661);});})[_0x970e('0x19')](function(){return new BPromise(function(_0x156347,_0x160fe1){rimraf(_0x37e17d,function(_0x21593f){if(_0x21593f)_0x160fe1(_0x21593f);return _0x156347();});});})[_0x970e('0x19')](function(){return _0x2d49a1[_0x970e('0x51')](_0x4b45bc,_0x5b3ca3,function(_0x3afd5b){if(_0x3afd5b){console[_0x970e('0x74')](_0x970e('0x75'),_0x3afd5b);}else{fs['unlinkSync'](_0x4b45bc);}});});});}else{return _0x2d49a1['sendStatus'](0xc8);}})[_0x970e('0x28')](handleError(_0x2d49a1,null));}; \ No newline at end of file +var _0x092f=['SmsMessage','include','setTags','spread','Tag','color','smsInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','transcript-%d-%s.zip','push','User','fullname','Contact','lastName','Messages','direction','read','SmsAccount','Account','Owner','mkdirSync','Sms','N.A.','filter','createdAt','out','System','firstName','secret','value','renderFile','root','views','downloadInteraction.ejs','transcript-','log','err','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','SmsInteraction','fieldName','type','key','getOptions','findAll','sms','query','user','show','params','model','keys','intersection','fields','attributes','length','includeAll','merge','options','find','catch','create','body','describe','addMessage','ids','omit','getMessages','findOne','nolimit','sort','where','filters','pick','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b267e,_0x1c72f4){var _0x1ace17=function(_0x3860e8){while(--_0x3860e8){_0x4b267e['push'](_0x4b267e['shift']());}};_0x1ace17(++_0x1c72f4);}(_0x092f,0xa0));var _0xf092=function(_0x2bf5bd,_0x120787){_0x2bf5bd=_0x2bf5bd-0x0;var _0xc810c0=_0x092f[_0x2bf5bd];return _0xc810c0;};'use strict';var rimraf=require(_0xf092('0x0'));var zipdir=require(_0xf092('0x1'));var moment=require(_0xf092('0x2'));var BPromise=require(_0xf092('0x3'));var util=require('util');var path=require(_0xf092('0x4'));var ejs=require(_0xf092('0x5'));var fs=require('fs');var _=require(_0xf092('0x6'));var Redis=require(_0xf092('0x7'));var interaction=require(_0xf092('0x8'));var qs=require(_0xf092('0x9'));var pdf=require(_0xf092('0xa'));var logger=require('../../config/logger')('api');var config=require(_0xf092('0xb'));var db=require(_0xf092('0xc'))['db'];config[_0xf092('0xd')]=_[_0xf092('0xe')](config[_0xf092('0xd')],{'host':_0xf092('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf092('0xd')]));require(_0xf092('0x10'))['register'](socket);function respondWithStatusCode(_0x4b519f,_0x31d224){_0x31d224=_0x31d224||0xcc;return function(_0x292219){if(_0x292219){return _0x4b519f['sendStatus'](_0x31d224);}return _0x4b519f[_0xf092('0x11')](_0x31d224)[_0xf092('0x12')]();};}function respondWithResult(_0x4d782e,_0xd4582){_0xd4582=_0xd4582||0xc8;return function(_0x4c5698){if(_0x4c5698){return _0x4d782e[_0xf092('0x11')](_0xd4582)[_0xf092('0x13')](_0x4c5698);}};}function respondWithFilteredResult(_0x3aa2f1,_0x4f9583){return function(_0x25572a){if(_0x25572a){var _0x2ace77=typeof _0x4f9583[_0xf092('0x14')]===_0xf092('0x15')&&typeof _0x4f9583[_0xf092('0x16')]===_0xf092('0x15');var _0x2feb71=_0x25572a['count'];var _0x19be02=_0x2ace77?0x0:_0x4f9583['offset'];var _0x1db2c=_0x2ace77?_0x25572a[_0xf092('0x17')]:_0x4f9583[_0xf092('0x14')]+_0x4f9583[_0xf092('0x16')];var _0x38daa6;if(_0x1db2c>=_0x2feb71){_0x1db2c=_0x2feb71;_0x38daa6=0xc8;}else{_0x38daa6=0xce;}_0x3aa2f1['status'](_0x38daa6);return _0x3aa2f1[_0xf092('0x18')](_0xf092('0x19'),_0x19be02+'-'+_0x1db2c+'/'+_0x2feb71)[_0xf092('0x13')](_0x25572a);}return null;};}function saveUpdates(_0x49301c){return function(_0x5b3b0b){if(_0x5b3b0b){return _0x5b3b0b[_0xf092('0x1a')](_0x49301c)[_0xf092('0x1b')](function(_0x25be8a){return _0x25be8a;});}return null;};}function removeEntity(_0x445063){return function(_0x3750a3){if(_0x3750a3){return _0x3750a3[_0xf092('0x1c')]()[_0xf092('0x1b')](function(){_0x445063[_0xf092('0x11')](0xcc)[_0xf092('0x12')]();});}};}function handleEntityNotFound(_0x421fb5){return function(_0x15f663){if(!_0x15f663){_0x421fb5[_0xf092('0x1d')](0x194);}return _0x15f663;};}function handleError(_0x29c2ff,_0x12e39a){_0x12e39a=_0x12e39a||0x1f4;return function(_0x47df7f){logger[_0xf092('0x1e')](_0x47df7f[_0xf092('0x1f')]);if(_0x47df7f['name']){delete _0x47df7f[_0xf092('0x20')];}_0x29c2ff[_0xf092('0x11')](_0x12e39a)[_0xf092('0x21')](_0x47df7f);};}exports[_0xf092('0x22')]=function(_0x7cf8fb,_0x4dc55a){var _0x1ecd93={};var _0x587a3e=_['map'](db[_0xf092('0x23')]['rawAttributes'],function(_0x158ae5){return{'name':_0x158ae5[_0xf092('0x24')],'type':_0x158ae5[_0xf092('0x25')][_0xf092('0x26')]};});_0x1ecd93=qs[_0xf092('0x27')](_0x587a3e,_0x7cf8fb);return interaction[_0xf092('0x28')](_0xf092('0x29'),_0x7cf8fb[_0xf092('0x2a')],_0x7cf8fb[_0xf092('0x2b')],_0x1ecd93,_0x587a3e)['then'](respondWithFilteredResult(_0x4dc55a,_0x1ecd93))['catch'](handleError(_0x4dc55a,null));};exports[_0xf092('0x2c')]=function(_0x45bfb3,_0x1b280b){var _0x2950f7={'raw':![],'where':{'id':_0x45bfb3[_0xf092('0x2d')]['id']}},_0x302c42={};_0x302c42[_0xf092('0x2e')]=_[_0xf092('0x2f')](db[_0xf092('0x23')]['rawAttributes']);_0x302c42[_0xf092('0x2a')]=_[_0xf092('0x2f')](_0x45bfb3['query']);_0x302c42['filters']=_['intersection'](_0x302c42[_0xf092('0x2e')],_0x302c42[_0xf092('0x2a')]);_0x2950f7['attributes']=_[_0xf092('0x30')](_0x302c42[_0xf092('0x2e')],qs['fields'](_0x45bfb3[_0xf092('0x2a')][_0xf092('0x31')]));_0x2950f7[_0xf092('0x32')]=_0x2950f7[_0xf092('0x32')][_0xf092('0x33')]?_0x2950f7['attributes']:_0x302c42[_0xf092('0x2e')];if(_0x45bfb3['query'][_0xf092('0x34')]){_0x2950f7['include']=[{'all':!![]}];}_0x2950f7=_[_0xf092('0x35')]({},_0x2950f7,_0x45bfb3[_0xf092('0x36')]);return db[_0xf092('0x23')][_0xf092('0x37')](_0x2950f7)[_0xf092('0x1b')](handleEntityNotFound(_0x1b280b,null))[_0xf092('0x1b')](respondWithResult(_0x1b280b,null))[_0xf092('0x38')](handleError(_0x1b280b,null));};exports[_0xf092('0x39')]=function(_0x35f629,_0x37800f){return db[_0xf092('0x23')][_0xf092('0x39')](_0x35f629[_0xf092('0x3a')],{})[_0xf092('0x1b')](respondWithResult(_0x37800f,0xc9))[_0xf092('0x38')](handleError(_0x37800f,null));};exports[_0xf092('0x1a')]=function(_0x419d1a,_0x218e77){if(_0x419d1a[_0xf092('0x3a')]['id']){delete _0x419d1a[_0xf092('0x3a')]['id'];}return db['SmsInteraction'][_0xf092('0x37')]({'where':{'id':_0x419d1a['params']['id']}})[_0xf092('0x1b')](handleEntityNotFound(_0x218e77,null))[_0xf092('0x1b')](saveUpdates(_0x419d1a[_0xf092('0x3a')],null))[_0xf092('0x1b')](respondWithResult(_0x218e77,null))[_0xf092('0x38')](handleError(_0x218e77,null));};exports[_0xf092('0x1c')]=function(_0x52327a,_0x3dcf91){return db[_0xf092('0x23')][_0xf092('0x37')]({'where':{'id':_0x52327a['params']['id']}})[_0xf092('0x1b')](handleEntityNotFound(_0x3dcf91,null))[_0xf092('0x1b')](removeEntity(_0x3dcf91,null))[_0xf092('0x38')](handleError(_0x3dcf91,null));};exports[_0xf092('0x3b')]=function(_0x132bf2,_0x59e1e5){return db[_0xf092('0x23')][_0xf092('0x3b')]()[_0xf092('0x1b')](respondWithResult(_0x59e1e5,null))[_0xf092('0x38')](handleError(_0x59e1e5,null));};exports[_0xf092('0x3c')]=function(_0x58278e,_0x15cb10){return db['SmsMessage'][_0xf092('0x37')]({'where':{'id':_0x58278e[_0xf092('0x2d')]['id']}})['then'](handleEntityNotFound(_0x15cb10,null))['then'](function(_0x4e8a6c){if(_0x4e8a6c){return _0x4e8a6c[_0xf092('0x3c')](_0x58278e[_0xf092('0x3a')][_0xf092('0x3d')],_[_0xf092('0x3e')](_0x58278e[_0xf092('0x3a')],[_0xf092('0x3d'),'id'])||{});}})[_0xf092('0x1b')](respondWithResult(_0x15cb10,null))[_0xf092('0x38')](handleError(_0x15cb10,null));};exports[_0xf092('0x3f')]=function(_0x2a13bd,_0x202cf6){var _0x58d958={'raw':![],'where':{}};var _0x4910af={};var _0x2e78cf={'count':0x0,'rows':[]};return db[_0xf092('0x23')][_0xf092('0x40')]({'where':{'id':_0x2a13bd[_0xf092('0x2d')]['id']}})['then'](handleEntityNotFound(_0x202cf6,null))['then'](function(_0x447c7f){if(_0x447c7f){_0x4910af[_0xf092('0x2e')]=_[_0xf092('0x2f')](db['SmsMessage']['rawAttributes']);_0x4910af[_0xf092('0x2a')]=_[_0xf092('0x2f')](_0x2a13bd[_0xf092('0x2a')]);_0x4910af['filters']=_[_0xf092('0x30')](_0x4910af[_0xf092('0x2e')],_0x4910af[_0xf092('0x2a')]);_0x58d958['attributes']=_[_0xf092('0x30')](_0x4910af['model'],qs[_0xf092('0x31')](_0x2a13bd[_0xf092('0x2a')][_0xf092('0x31')]));_0x58d958[_0xf092('0x32')]=_0x58d958[_0xf092('0x32')]['length']?_0x58d958[_0xf092('0x32')]:_0x4910af['model'];if(!_0x2a13bd[_0xf092('0x2a')]['hasOwnProperty'](_0xf092('0x41'))){_0x58d958[_0xf092('0x16')]=qs[_0xf092('0x16')](_0x2a13bd[_0xf092('0x2a')][_0xf092('0x16')]);_0x58d958[_0xf092('0x14')]=qs['offset'](_0x2a13bd[_0xf092('0x2a')][_0xf092('0x14')]);}_0x58d958['order']=qs[_0xf092('0x42')](_0x2a13bd['query'][_0xf092('0x42')]);_0x58d958[_0xf092('0x43')]=qs[_0xf092('0x44')](_[_0xf092('0x45')](_0x2a13bd['query'],_0x4910af['filters']));_0x58d958[_0xf092('0x43')]['SmsInteractionId']=_0x447c7f['id'];if(_0x2a13bd['query']['filter']){_0x58d958[_0xf092('0x43')]=_['merge'](_0x58d958[_0xf092('0x43')],{'$or':_[_0xf092('0x46')](_0x58d958[_0xf092('0x32')],function(_0x5e6aa2){var _0xeb13={};_0xeb13[_0x5e6aa2]={'$like':'%'+_0x2a13bd[_0xf092('0x2a')]['filter']+'%'};return _0xeb13;})});}if(_0x2a13bd[_0xf092('0x2a')][_0xf092('0x47')]){var _0x3911a1=_0x2a13bd[_0xf092('0x2a')][_0xf092('0x47')]['split'](',');var _0x3b4410={};_0x3b4410[_0x3911a1[0x0]]={'$gte':moment(_0x3911a1[0x1])[_0xf092('0x48')](_0xf092('0x49'))};_0x58d958[_0xf092('0x43')]=_[_0xf092('0x35')](_0x58d958[_0xf092('0x43')],_0x3b4410);}_0x58d958=_[_0xf092('0x35')]({},_0x58d958,_0x2a13bd[_0xf092('0x36')]);return db[_0xf092('0x4a')][_0xf092('0x17')]({'where':_0x58d958[_0xf092('0x43')]})[_0xf092('0x1b')](function(_0x1678dd){_0x2e78cf[_0xf092('0x17')]=_0x1678dd;if(_0x2a13bd[_0xf092('0x2a')][_0xf092('0x34')]){_0x58d958[_0xf092('0x4b')]=[{'all':!![]}];}return db[_0xf092('0x4a')]['findAll'](_0x58d958);})[_0xf092('0x1b')](function(_0x28d6e2){_0x2e78cf['rows']=_0x28d6e2;return _0x2e78cf;});}})[_0xf092('0x1b')](respondWithFilteredResult(_0x202cf6,_0x58d958))[_0xf092('0x38')](handleError(_0x202cf6,null));};exports['addTags']=function(_0x4f5b70,_0x3b94f6){return db[_0xf092('0x23')][_0xf092('0x37')]({'where':{'id':_0x4f5b70[_0xf092('0x2d')]['id']}})[_0xf092('0x1b')](handleEntityNotFound(_0x3b94f6,null))[_0xf092('0x1b')](function(_0xdf0d5c){if(_0xdf0d5c){return _0xdf0d5c[_0xf092('0x4c')](_0x4f5b70[_0xf092('0x3a')][_0xf092('0x3d')],_[_0xf092('0x3e')](_0x4f5b70[_0xf092('0x3a')],[_0xf092('0x3d'),'id'])||{})[_0xf092('0x4d')](function(){return db[_0xf092('0x4e')][_0xf092('0x28')]({'attributes':['id','name',_0xf092('0x4f')],'where':{'id':_0x4f5b70[_0xf092('0x3a')]['ids']}});})[_0xf092('0x1b')](function(_0x4c0144){socket['emit'](_0xf092('0x50'),{'id':Number(_0x4f5b70['params']['id']),'tags':_0x4c0144||[]});return{'id':Number(_0x4f5b70[_0xf092('0x2d')]['id']),'tags':_0x4c0144||[]};});}})[_0xf092('0x1b')](respondWithResult(_0x3b94f6,null))[_0xf092('0x38')](handleError(_0x3b94f6,null));};exports[_0xf092('0x51')]=function(_0x3dd7e7,_0x125c56){return db[_0xf092('0x23')][_0xf092('0x37')]({'where':{'id':_0x3dd7e7[_0xf092('0x2d')]['id']}})[_0xf092('0x1b')](handleEntityNotFound(_0x125c56,null))[_0xf092('0x1b')](function(_0x2de3fb){if(_0x2de3fb){return _0x2de3fb[_0xf092('0x51')](_0x3dd7e7['query'][_0xf092('0x3d')]);}})['then'](respondWithStatusCode(_0x125c56,null))['catch'](handleError(_0x125c56,null));};exports[_0xf092('0x52')]=function(_0x391680,_0x545ed0){var _0xd7994f=moment()[_0xf092('0x53')]()[_0xf092('0x54')]();var _0x49414b=path[_0xf092('0x55')](config['root'],_0xf092('0x56'),'files',_0xf092('0x57'));var _0x511155=path[_0xf092('0x55')](_0x49414b,_0xd7994f);var _0x4ed56d=util[_0xf092('0x48')](_0xf092('0x58'),_0x391680[_0xf092('0x2d')]['id'],_0xd7994f);var _0xb65bb2=path['join'](_0x49414b,_0x4ed56d);var _0x38e6ff=[];_0x38e6ff[_0xf092('0x59')]({'model':db[_0xf092('0x5a')],'as':_0xf092('0x5a'),'attributes':['id',_0xf092('0x5b')],'raw':!![]});_0x38e6ff['push']({'model':db['CmContact'],'as':_0xf092('0x5c'),'attributes':['id','firstName',_0xf092('0x5d')],'raw':!![]});var _0x156024=[{'model':db[_0xf092('0x4a')],'as':_0xf092('0x5e'),'attributes':['id','body','createdAt',_0xf092('0x5f'),'secret',_0xf092('0x60')],'include':_0x38e6ff}];_0x156024[_0xf092('0x59')]({'model':db[_0xf092('0x61')],'as':_0xf092('0x62'),'attributes':['id',_0xf092('0x20')]});_0x156024['push']({'model':db['User'],'as':_0xf092('0x63'),'attributes':['id',_0xf092('0x5b')]});return db['SmsInteraction'][_0xf092('0x37')]({'where':{'id':_0x391680[_0xf092('0x2d')]['id']},'include':_0x156024})[_0xf092('0x1b')](handleEntityNotFound(_0x545ed0,null))['then'](function(_0x1e26e2){if(_0x1e26e2){var _0x4d4de6=_0x1e26e2['get']({'plain':!![]});fs[_0xf092('0x64')](_0x511155);var _0x4025e2={'channel':_0xf092('0x65'),'account':_0x4d4de6[_0xf092('0x62')][_0xf092('0x20')],'agent':_0x4d4de6['Owner']?_0x4d4de6[_0xf092('0x63')]['fullname']:_0xf092('0x66'),'createdAt':moment(_0x4d4de6['createdAt'])[_0xf092('0x48')](_0xf092('0x49'))[_0xf092('0x54')](),'closedAt':_0x4d4de6['closed']?moment(_0x4d4de6['closedAt'])[_0xf092('0x48')](_0xf092('0x49'))[_0xf092('0x54')]():'','disposition':_0x4d4de6['disposition'],'messages':_(_0x4d4de6[_0xf092('0x5e')])[_0xf092('0x67')]({'secret':![]})[_0xf092('0x46')](function(_0x1abef1){return{'date':moment(_0x1abef1[_0xf092('0x68')])[_0xf092('0x48')](_0xf092('0x49'))[_0xf092('0x54')](),'sender':_0x1abef1['direction']===_0xf092('0x69')?_0x1abef1[_0xf092('0x5a')]?_0x1abef1[_0xf092('0x5a')][_0xf092('0x5b')]:_0xf092('0x6a'):_0x1abef1['Contact'][_0xf092('0x6b')]+(_0x1abef1[_0xf092('0x5c')][_0xf092('0x5d')]?'\x20'+_0x1abef1[_0xf092('0x5c')][_0xf092('0x5d')]:''),'body':_0x1abef1[_0xf092('0x3a')],'direction':_0x1abef1['direction']==='out'?'A':'C','secret':_0x1abef1[_0xf092('0x6c')],'read':_0x1abef1['read']};})[_0xf092('0x6d')]()};return ejs[_0xf092('0x6e')](path[_0xf092('0x55')](config[_0xf092('0x6f')],_0xf092('0x56'),_0xf092('0x70'),_0xf092('0x71')),{'interaction':_0x4025e2})[_0xf092('0x1b')](function(_0x539db4){var _0x113d2d=path[_0xf092('0x55')](_0x511155,_0xf092('0x72')+_0x4d4de6['id']+'-'+_0xd7994f+'.pdf');var _0x420f03={'path':_0x113d2d,'channel':_0xf092('0x65'),'interactionId':_0x4d4de6['id']};return pdf['createPdfFromHTML'](_0x539db4,_0x420f03);})[_0xf092('0x1b')](function(){return new BPromise(function(_0x47fd5f,_0x274004){zipdir(_0x511155,{'saveTo':_0xb65bb2},function(_0x5847ff,_0x5a2c0d){if(_0x5847ff)return _0x274004(_0x5847ff);return _0x47fd5f(_0x5a2c0d);});})['then'](function(){return new BPromise(function(_0x322315,_0xaed86f){rimraf(_0x511155,function(_0x1c8d5d){if(_0x1c8d5d)_0xaed86f(_0x1c8d5d);return _0x322315();});});})[_0xf092('0x1b')](function(){return _0x545ed0[_0xf092('0x52')](_0xb65bb2,_0x4ed56d,function(_0x5e3709){if(_0x5e3709){console[_0xf092('0x73')](_0xf092('0x74'),_0x5e3709);}else{fs['unlinkSync'](_0xb65bb2);}});});});}else{return _0x545ed0['sendStatus'](0xc8);}})[_0xf092('0x38')](handleError(_0x545ed0,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index d178144..11c6db2 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 _0x6cb4=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','events'];(function(_0x116930,_0x10327c){var _0x5bb1fa=function(_0x4077a9){while(--_0x4077a9){_0x116930['push'](_0x116930['shift']());}};_0x5bb1fa(++_0x10327c);}(_0x6cb4,0xff));var _0x46cb=function(_0x2c3996,_0x286abe){_0x2c3996=_0x2c3996-0x0;var _0x5cdd2f=_0x6cb4[_0x2c3996];return _0x5cdd2f;};'use strict';var EventEmitter=require(_0x46cb('0x0'));var SmsInteraction=require(_0x46cb('0x1'))['db'][_0x46cb('0x2')];var SmsMessage=require(_0x46cb('0x1'))['db'][_0x46cb('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x46cb('0x4')](0x0);var events={'afterCreate':_0x46cb('0x5'),'afterUpdate':_0x46cb('0x6'),'afterDestroy':_0x46cb('0x7')};function emitEvent(_0x5032a4){return function(_0x1a3fe4,_0x5cb9a4,_0x3d9d3c){_0x1a3fe4['getUsers']({'attributes':['id'],'raw':!![]})[_0x46cb('0x8')](function(_0x148d0f){_0x1a3fe4[_0x46cb('0x9')](_0x46cb('0xa'),_0x148d0f[_0x46cb('0xb')](function(_0x196a93){return{'id':_0x196a93['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x1a3fe4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46cb('0x8')](function(_0x34f9e9){_0x1a3fe4['setDataValue'](_0x46cb('0xc'),_0x34f9e9[_0x46cb('0xd')]);SmsInteractionEvents['emit'](_0x5032a4+':'+_0x1a3fe4['id'],_0x1a3fe4);SmsInteractionEvents[_0x46cb('0xe')](_0x5032a4,_0x1a3fe4);_0x3d9d3c(null);})[_0x46cb('0xf')](_0x3d9d3c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0xf1081a,_0xfe4f04){var _0x311841=function(_0x6945c4){while(--_0x6945c4){_0xf1081a['push'](_0xf1081a['shift']());}};_0x311841(++_0xfe4f04);}(_0xdb28,0x106));var _0x8db2=function(_0x184dff,_0x423f99){_0x184dff=_0x184dff-0x0;var _0x191b07=_0xdb28[_0x184dff];return _0x191b07;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index ed61932..2599205 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 _0xa7df=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closed','closedAt','format','util','../../config/logger'];(function(_0xde9c4f,_0x2697df){var _0x252ce2=function(_0x4b0d4c){while(--_0x4b0d4c){_0xde9c4f['push'](_0xde9c4f['shift']());}};_0x252ce2(++_0x2697df);}(_0xa7df,0x11e));var _0xfa7d=function(_0x48b929,_0xb79e4e){_0x48b929=_0x48b929-0x0;var _0x2ba8ec=_0xa7df[_0x48b929];return _0x2ba8ec;};'use strict';var _=require('lodash');var util=require(_0xfa7d('0x0'));var logger=require(_0xfa7d('0x1'))(_0xfa7d('0x2'));var moment=require(_0xfa7d('0x3'));var BPromise=require(_0xfa7d('0x4'));var rp=require(_0xfa7d('0x5'));var fs=require('fs');var path=require(_0xfa7d('0x6'));var rimraf=require(_0xfa7d('0x7'));var config=require(_0xfa7d('0x8'));var attributes=require(_0xfa7d('0x9'));module['exports']=function(_0x1023d0,_0x357982){return _0x1023d0['define'](_0xfa7d('0xa'),attributes,{'tableName':_0xfa7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29193e,_0x4617fd,_0x4ab9d9){if(_0x29193e[_0xfa7d('0xc')](_0xfa7d('0xd'))){_0x29193e[_0xfa7d('0xe')]=moment()[_0xfa7d('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ab9d9(null,_0x29193e);}}});}; \ No newline at end of file +var _0xb0c6=['../../config/environment','define','sms_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','moment','bluebird','path','rimraf'];(function(_0x2c464c,_0x5a7b8e){var _0x42332b=function(_0x787030){while(--_0x787030){_0x2c464c['push'](_0x2c464c['shift']());}};_0x42332b(++_0x5a7b8e);}(_0xb0c6,0x7e));var _0x6b0c=function(_0x25c054,_0x5eea6b){_0x25c054=_0x25c054-0x0;var _0x265c70=_0xb0c6[_0x25c054];return _0x265c70;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6b0c('0x0'));var BPromise=require(_0x6b0c('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b0c('0x2'));var rimraf=require(_0x6b0c('0x3'));var config=require(_0x6b0c('0x4'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x346f49,_0x2aa39e){return _0x346f49[_0x6b0c('0x5')]('SmsInteraction',attributes,{'tableName':_0x6b0c('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38ee81,_0x24eff0,_0x52c3ed){if(_0x38ee81[_0x6b0c('0x7')]('closed')){_0x38ee81[_0x6b0c('0x8')]=moment()['format'](_0x6b0c('0x9'));}_0x52c3ed(null,_0x38ee81);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index c87536e..2426fc7 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 _0x8a5b=['ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','result','message','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','limit','stringify','AddTagsToSmsInteraction','find','addTags'];(function(_0x5dc073,_0x3d21d2){var _0x2c7c3a=function(_0x41c036){while(--_0x41c036){_0x5dc073['push'](_0x5dc073['shift']());}};_0x2c7c3a(++_0x3d21d2);}(_0x8a5b,0x1d7));var _0xb8a5=function(_0x29fba8,_0x2b16f2){_0x29fba8=_0x29fba8-0x0;var _0x42f260=_0x8a5b[_0x29fba8];return _0x42f260;};'use strict';var _=require(_0xb8a5('0x0'));var util=require(_0xb8a5('0x1'));var moment=require('moment');var BPromise=require(_0xb8a5('0x2'));var rs=require(_0xb8a5('0x3'));var fs=require('fs');var Redis=require(_0xb8a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8a5('0x5'));var logger=require(_0xb8a5('0x6'))(_0xb8a5('0x7'));var config=require(_0xb8a5('0x8'));var jayson=require(_0xb8a5('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xb8a5('0xa')]=_['defaults'](config[_0xb8a5('0xa')],{'host':_0xb8a5('0xb'),'port':0x18eb});var socket=require(_0xb8a5('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xb8a5('0xd')](socket);function respondWithRpcPromise(_0x4234da,_0x200400,_0x3cf7a4){return new BPromise(function(_0x335434,_0x191d51){return client[_0xb8a5('0xe')](_0x4234da,_0x3cf7a4)[_0xb8a5('0xf')](function(_0x323a77){logger[_0xb8a5('0x10')](_0xb8a5('0x11'),_0x200400,_0xb8a5('0x12'));logger[_0xb8a5('0x13')](_0xb8a5('0x14'),_0x200400,'request\x20sent',JSON['stringify'](_0x323a77));if(_0x323a77[_0xb8a5('0x15')]){if(_0x323a77['error'][_0xb8a5('0x16')]===0x1f4){logger[_0xb8a5('0x15')](_0xb8a5('0x11'),_0x200400,_0x323a77[_0xb8a5('0x15')]['message']);return _0x191d51(_0x323a77[_0xb8a5('0x15')]['message']);}logger[_0xb8a5('0x15')](_0xb8a5('0x11'),_0x200400,_0x323a77[_0xb8a5('0x15')]['message']);return _0x335434(_0x323a77['error']['message']);}else{logger[_0xb8a5('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x200400,'request\x20sent');_0x335434(_0x323a77[_0xb8a5('0x17')][_0xb8a5('0x18')]);}})[_0xb8a5('0x19')](function(_0x4871fa){logger[_0xb8a5('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x200400,_0x4871fa);_0x191d51(_0x4871fa);});});}exports[_0xb8a5('0x1a')]=function(_0x266293){var _0x381307=this;return new Promise(function(_0x196e09,_0x2dddfa){return db[_0xb8a5('0x1b')]['update'](_0x266293[_0xb8a5('0x1c')],{'raw':_0x266293[_0xb8a5('0x1d')]?_0x266293[_0xb8a5('0x1d')][_0xb8a5('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x266293['options']?_0x266293['options']['where']||null:null,'attributes':_0x266293[_0xb8a5('0x1d')]?_0x266293[_0xb8a5('0x1d')]['attributes']||null:null,'limit':_0x266293['options']?_0x266293['options'][_0xb8a5('0x1f')]||null:null})['then'](function(_0x4fa600){logger['info']('UpdateSmsInteraction',_0x266293);logger[_0xb8a5('0x13')](_0xb8a5('0x1a'),_0x266293,JSON[_0xb8a5('0x20')](_0x4fa600));_0x196e09(_0x4fa600);})[_0xb8a5('0x19')](function(_0x21a156){logger[_0xb8a5('0x15')]('UpdateSmsInteraction',_0x21a156[_0xb8a5('0x18')],_0x266293);_0x2dddfa(_0x381307[_0xb8a5('0x15')](0x1f4,_0x21a156[_0xb8a5('0x18')]));});});};exports[_0xb8a5('0x21')]=function(_0x235deb){return new Promise(function(_0x41aeaf,_0x469a05){return db['SmsInteraction'][_0xb8a5('0x22')]({'where':_0x235deb[_0xb8a5('0x1d')]?_0x235deb[_0xb8a5('0x1d')]['where']||null:null})[_0xb8a5('0xf')](function(_0x32f5cb){if(_0x32f5cb){return _0x32f5cb[_0xb8a5('0x23')](_0x235deb[_0xb8a5('0x1c')][_0xb8a5('0x24')],_['omit'](_0x235deb[_0xb8a5('0x1c')],[_0xb8a5('0x24'),'id'])||{});}})[_0xb8a5('0x25')](function(_0x506aa3){logger['info'](_0xb8a5('0x26'),_0x235deb);logger['debug']('AddTags',_0x235deb,JSON['stringify'](_0x506aa3));_0x41aeaf(_0x506aa3);})['catch'](function(_0x608d1c){logger[_0xb8a5('0x15')](_0xb8a5('0x26'),_0x608d1c['message'],_0x235deb);_0x469a05(_this[_0xb8a5('0x15')](0x1f4,_0x608d1c[_0xb8a5('0x18')]));});});}; \ No newline at end of file +var _0xf67b=['SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','catch','UpdateSmsInteraction','SmsInteraction','body','raw','options','where','attributes','limit','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug'];(function(_0x234ec9,_0x5b6e71){var _0x15bd88=function(_0x245fcb){while(--_0x245fcb){_0x234ec9['push'](_0x234ec9['shift']());}};_0x15bd88(++_0x5b6e71);}(_0xf67b,0x104));var _0xbf67=function(_0x51df00,_0x4ac573){_0x51df00=_0x51df00-0x0;var _0x198328=_0xf67b[_0x51df00];return _0x198328;};'use strict';var _=require(_0xbf67('0x0'));var util=require(_0xbf67('0x1'));var moment=require(_0xbf67('0x2'));var BPromise=require(_0xbf67('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf67('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf67('0x5'))(_0xbf67('0x6'));var config=require(_0xbf67('0x7'));var jayson=require(_0xbf67('0x8'));var client=jayson['client'][_0xbf67('0x9')]({'port':0x232a});config['redis']=_[_0xbf67('0xa')](config['redis'],{'host':_0xbf67('0xb'),'port':0x18eb});var socket=require(_0xbf67('0xc'))(new Redis(config['redis']));require(_0xbf67('0xd'))[_0xbf67('0xe')](socket);function respondWithRpcPromise(_0x41d4b0,_0x4ad436,_0x3a5a80){return new BPromise(function(_0x2a5b30,_0x515149){return client[_0xbf67('0xf')](_0x41d4b0,_0x3a5a80)[_0xbf67('0x10')](function(_0x56f518){logger[_0xbf67('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x4ad436,_0xbf67('0x12'));logger[_0xbf67('0x13')](_0xbf67('0x14'),_0x4ad436,_0xbf67('0x12'),JSON[_0xbf67('0x15')](_0x56f518));if(_0x56f518['error']){if(_0x56f518[_0xbf67('0x16')][_0xbf67('0x17')]===0x1f4){logger[_0xbf67('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x4ad436,_0x56f518[_0xbf67('0x16')]['message']);return _0x515149(_0x56f518['error']['message']);}logger[_0xbf67('0x16')](_0xbf67('0x18'),_0x4ad436,_0x56f518[_0xbf67('0x16')]['message']);return _0x2a5b30(_0x56f518[_0xbf67('0x16')][_0xbf67('0x19')]);}else{logger['info'](_0xbf67('0x18'),_0x4ad436,'request\x20sent');_0x2a5b30(_0x56f518['result'][_0xbf67('0x19')]);}})[_0xbf67('0x1a')](function(_0x156633){logger[_0xbf67('0x16')](_0xbf67('0x18'),_0x4ad436,_0x156633);_0x515149(_0x156633);});});}exports[_0xbf67('0x1b')]=function(_0x4f144a){var _0x55cdb8=this;return new Promise(function(_0x35632a,_0x1dacfb){return db[_0xbf67('0x1c')]['update'](_0x4f144a[_0xbf67('0x1d')],{'raw':_0x4f144a['options']?_0x4f144a['options'][_0xbf67('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f144a[_0xbf67('0x1f')]?_0x4f144a['options'][_0xbf67('0x20')]||null:null,'attributes':_0x4f144a[_0xbf67('0x1f')]?_0x4f144a[_0xbf67('0x1f')][_0xbf67('0x21')]||null:null,'limit':_0x4f144a[_0xbf67('0x1f')]?_0x4f144a[_0xbf67('0x1f')][_0xbf67('0x22')]||null:null})[_0xbf67('0x10')](function(_0x56e07a){logger[_0xbf67('0x11')]('UpdateSmsInteraction',_0x4f144a);logger[_0xbf67('0x13')](_0xbf67('0x1b'),_0x4f144a,JSON[_0xbf67('0x15')](_0x56e07a));_0x35632a(_0x56e07a);})['catch'](function(_0x26e47a){logger[_0xbf67('0x16')](_0xbf67('0x1b'),_0x26e47a['message'],_0x4f144a);_0x1dacfb(_0x55cdb8[_0xbf67('0x16')](0x1f4,_0x26e47a[_0xbf67('0x19')]));});});};exports['AddTagsToSmsInteraction']=function(_0x57821c){return new Promise(function(_0x53cc7d,_0x3b8086){return db[_0xbf67('0x1c')][_0xbf67('0x23')]({'where':_0x57821c[_0xbf67('0x1f')]?_0x57821c[_0xbf67('0x1f')][_0xbf67('0x20')]||null:null})['then'](function(_0x30b9c4){if(_0x30b9c4){return _0x30b9c4[_0xbf67('0x24')](_0x57821c['body']['ids'],_['omit'](_0x57821c[_0xbf67('0x1d')],[_0xbf67('0x25'),'id'])||{});}})[_0xbf67('0x26')](function(_0x17fddc){logger[_0xbf67('0x11')](_0xbf67('0x27'),_0x57821c);logger[_0xbf67('0x13')](_0xbf67('0x27'),_0x57821c,JSON[_0xbf67('0x15')](_0x17fddc));_0x53cc7d(_0x17fddc);})['catch'](function(_0x90464b){logger[_0xbf67('0x16')](_0xbf67('0x27'),_0x90464b[_0xbf67('0x19')],_0x57821c);_0x3b8086(_this[_0xbf67('0x16')](0x1f4,_0x90464b[_0xbf67('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e05e47d..4347bb3 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 _0x5e1e=['register','length','./smsInteraction.events','save','update','removeListener'];(function(_0x7574c7,_0x3dec6d){var _0x5e0f4f=function(_0x5a2058){while(--_0x5a2058){_0x7574c7['push'](_0x7574c7['shift']());}};_0x5e0f4f(++_0x3dec6d);}(_0x5e1e,0x1d0));var _0xe5e1=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5e1e[_0x9cd4c3];return _0x4c9025;};'use strict';var SmsInteractionEvents=require(_0xe5e1('0x0'));var events=[_0xe5e1('0x1'),'remove',_0xe5e1('0x2')];function createListener(_0xdc881c,_0x3f6175){return function(_0x37c1be){_0x3f6175['emit'](_0xdc881c,_0x37c1be);};}function removeListener(_0x46af4c,_0x1413e){return function(){SmsInteractionEvents[_0xe5e1('0x3')](_0x46af4c,_0x1413e);};}exports[_0xe5e1('0x4')]=function(_0x28c3f0){for(var _0x382e4b=0x0,_0xe5c872=events[_0xe5e1('0x5')];_0x382e4b<_0xe5c872;_0x382e4b++){var _0x9327c0=events[_0x382e4b];var _0x3cc692=createListener('smsInteraction:'+_0x9327c0,_0x28c3f0);SmsInteractionEvents['on'](_0x9327c0,_0x3cc692);}}; \ No newline at end of file +var _0x3766=['remove','update','emit','removeListener','smsInteraction:','./smsInteraction.events'];(function(_0x598152,_0x204a9a){var _0x1c908a=function(_0x4a00e0){while(--_0x4a00e0){_0x598152['push'](_0x598152['shift']());}};_0x1c908a(++_0x204a9a);}(_0x3766,0xbf));var _0x6376=function(_0x53814c,_0x25a944){_0x53814c=_0x53814c-0x0;var _0x1be846=_0x3766[_0x53814c];return _0x1be846;};'use strict';var SmsInteractionEvents=require(_0x6376('0x0'));var events=['save',_0x6376('0x1'),_0x6376('0x2')];function createListener(_0x271bf9,_0x54bc7e){return function(_0x3bd439){_0x54bc7e[_0x6376('0x3')](_0x271bf9,_0x3bd439);};}function removeListener(_0x2e2e2c,_0x58a4a4){return function(){SmsInteractionEvents[_0x6376('0x4')](_0x2e2e2c,_0x58a4a4);};}exports['register']=function(_0x1e1dc0){for(var _0x2b2a32=0x0,_0x47b1f5=events['length'];_0x2b2a32<_0x47b1f5;_0x2b2a32++){var _0x1e0306=events[_0x2b2a32];var _0x977516=createListener(_0x6376('0x5')+_0x1e0306,_0x1e1dc0);SmsInteractionEvents['on'](_0x1e0306,_0x977516);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 15f6dd2..0b55115 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 _0xd56e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','sms','smsmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','reject','delete','exports','util'];(function(_0x58c200,_0x5f0395){var _0x362c1c=function(_0x1ffa48){while(--_0x1ffa48){_0x58c200['push'](_0x58c200['shift']());}};_0x362c1c(++_0x5f0395);}(_0xd56e,0xa7));var _0xed56=function(_0x152a35,_0x1d8e49){_0x152a35=_0x152a35-0x0;var _0x20e127=_0xd56e[_0x152a35];return _0x20e127;};'use strict';var multer=require('multer');var util=require(_0xed56('0x0'));var path=require(_0xed56('0x1'));var timeout=require(_0xed56('0x2'));var express=require(_0xed56('0x3'));var router=express[_0xed56('0x4')]();var fs_extra=require(_0xed56('0x5'));var auth=require(_0xed56('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed56('0x7'));var controller=require(_0xed56('0x8'));router[_0xed56('0x9')]('/',auth[_0xed56('0xa')](),controller[_0xed56('0xb')]);router[_0xed56('0x9')](_0xed56('0xc'),auth[_0xed56('0xa')](),controller['describe']);router[_0xed56('0x9')](_0xed56('0xd'),auth['isAuthenticated'](),controller[_0xed56('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xed56('0xf'),_0xed56('0x10')),controller[_0xed56('0x11')]);router[_0xed56('0x12')](_0xed56('0x13'),controller[_0xed56('0x14')]);router[_0xed56('0x15')](_0xed56('0xd'),auth[_0xed56('0xa')](),controller[_0xed56('0x16')]);router[_0xed56('0x15')](_0xed56('0x17'),auth['isAuthenticated'](),controller[_0xed56('0x18')]);router[_0xed56('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0xed56('0x19')]);router[_0xed56('0x1a')](_0xed56('0xd'),auth[_0xed56('0xa')](),controller['destroy']);module[_0xed56('0x1b')]=router; \ No newline at end of file +var _0x8b78=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','sms','create','/:id/status','put','/:id/accept','reject','delete'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0x8b78,0xaa));var _0x88b7=function(_0xa2ea9b,_0x107abe){_0xa2ea9b=_0xa2ea9b-0x0;var _0x12119b=_0x8b78[_0xa2ea9b];return _0x12119b;};'use strict';var multer=require(_0x88b7('0x0'));var util=require('util');var path=require(_0x88b7('0x1'));var timeout=require('connect-timeout');var express=require(_0x88b7('0x2'));var router=express[_0x88b7('0x3')]();var fs_extra=require(_0x88b7('0x4'));var auth=require(_0x88b7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x88b7('0x6'));var controller=require('./smsMessage.controller');router[_0x88b7('0x7')]('/',auth[_0x88b7('0x8')](),controller[_0x88b7('0x9')]);router['get'](_0x88b7('0xa'),auth[_0x88b7('0x8')](),controller[_0x88b7('0xb')]);router['get'](_0x88b7('0xc'),auth[_0x88b7('0x8')](),controller['show']);router[_0x88b7('0xd')]('/',auth[_0x88b7('0x8')](),interaction[_0x88b7('0xe')](_0x88b7('0xf'),'smsmessage:create'),controller[_0x88b7('0x10')]);router['post'](_0x88b7('0x11'),controller['status']);router[_0x88b7('0x12')](_0x88b7('0xc'),auth['isAuthenticated'](),controller['update']);router['put'](_0x88b7('0x13'),auth[_0x88b7('0x8')](),controller['accept']);router[_0x88b7('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x88b7('0x14')]);router[_0x88b7('0x15')]('/:id',auth[_0x88b7('0x8')](),controller[_0x88b7('0x16')]);module[_0x88b7('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d32e2b5..40356df 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 _0xc6f1=['TEXT','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x46f4e2,_0x546f34){var _0x49009=function(_0x19ac03){while(--_0x19ac03){_0x46f4e2['push'](_0x46f4e2['shift']());}};_0x49009(++_0x546f34);}(_0xc6f1,0x133));var _0x1c6f=function(_0x292716,_0x96d32){_0x292716=_0x292716-0x0;var _0x34cb57=_0xc6f1[_0x292716];return _0x34cb57;};'use strict';var Sequelize=require(_0x1c6f('0x0'));module[_0x1c6f('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1c6f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1c6f('0x3')](0xbe)},'phone':{'type':Sequelize[_0x1c6f('0x3')]},'readAt':{'type':Sequelize[_0x1c6f('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1c6f('0x3')]},'providerResponse':{'type':Sequelize[_0x1c6f('0x5')]}}; \ No newline at end of file +var _0xdd11=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x8f4ba5,_0x135638){var _0x65fe3b=function(_0x5b2484){while(--_0x5b2484){_0x8f4ba5['push'](_0x8f4ba5['shift']());}};_0x65fe3b(++_0x135638);}(_0xdd11,0xf1));var _0x1dd1=function(_0x58bce9,_0x3c41e5){_0x58bce9=_0x58bce9-0x0;var _0x1b4eaf=_0xdd11[_0x58bce9];return _0x1b4eaf;};'use strict';var Sequelize=require(_0x1dd1('0x0'));module[_0x1dd1('0x1')]={'body':{'type':Sequelize[_0x1dd1('0x2')](_0x1dd1('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1dd1('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1dd1('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1dd1('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x1dd1('0x7')]},'secret':{'type':Sequelize[_0x1dd1('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x1dd1('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index eafa44b..ee994a9 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 _0x98d4=['MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','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','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','SmsMessage','findAll','rows','catch','show','includeAll','include','options','create','body','params','find','describe','sms-interactions','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','isNil','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','sms','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','fullname','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo'];(function(_0x4a4ed8,_0x370f86){var _0x3dae5f=function(_0x47c7cc){while(--_0x47c7cc){_0x4a4ed8['push'](_0x4a4ed8['shift']());}};_0x3dae5f(++_0x370f86);}(_0x98d4,0xa3));var _0x498d=function(_0x205f84,_0x2250d9){_0x205f84=_0x205f84-0x0;var _0x335567=_0x98d4[_0x205f84];return _0x335567;};'use strict';var emlformat=require(_0x498d('0x0'));var rimraf=require(_0x498d('0x1'));var zipdir=require(_0x498d('0x2'));var jsonpatch=require(_0x498d('0x3'));var rp=require(_0x498d('0x4'));var moment=require(_0x498d('0x5'));var BPromise=require(_0x498d('0x6'));var Mustache=require('mustache');var util=require(_0x498d('0x7'));var path=require(_0x498d('0x8'));var sox=require('sox');var csv=require(_0x498d('0x9'));var ejs=require(_0x498d('0xa'));var fs=require('fs');var fs_extra=require(_0x498d('0xb'));var _=require(_0x498d('0xc'));var squel=require(_0x498d('0xd'));var crypto=require(_0x498d('0xe'));var jsforce=require(_0x498d('0xf'));var deskjs=require(_0x498d('0x10'));var toCsv=require(_0x498d('0x9'));var querystring=require(_0x498d('0x11'));var Papa=require(_0x498d('0x12'));var Redis=require(_0x498d('0x13'));var authService=require(_0x498d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x498d('0x15'));var hardwareService=require(_0x498d('0x16'));var logger=require(_0x498d('0x17'))(_0x498d('0x18'));var utils=require('../../config/utils');var config=require(_0x498d('0x19'));var licenseUtil=require(_0x498d('0x1a'));var db=require('../../mysqldb')['db'];config[_0x498d('0x1b')]=_['defaults'](config[_0x498d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x498d('0x1c'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x498d('0x1d')](socket);var jayson=require(_0x498d('0x1e'));var client=jayson[_0x498d('0x1f')][_0x498d('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x498d('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3c816f,_0x3a1bf1,_0xf18e30,_0x377ee4){return new BPromise(function(_0x1d9a55,_0xcc7575){var _0x336da5=_0x377ee4||client;return _0x336da5[_0x498d('0x21')](_0x3c816f,_0xf18e30)[_0x498d('0x22')](function(_0x53033b){logger[_0x498d('0x23')](_0x498d('0x24'),_0x3a1bf1,_0x498d('0x25'));logger[_0x498d('0x26')](_0x498d('0x27'),_0x3a1bf1,'request\x20sent',JSON[_0x498d('0x28')](_0x53033b));if(_0x53033b[_0x498d('0x29')]){if(_0x53033b['error'][_0x498d('0x2a')]===0x1f4){logger[_0x498d('0x29')](_0x498d('0x24'),_0x3a1bf1,_0x53033b[_0x498d('0x29')][_0x498d('0x2b')]);return _0xcc7575(_0x53033b['error'][_0x498d('0x2b')]);}logger['error'](_0x498d('0x24'),_0x3a1bf1,_0x53033b[_0x498d('0x29')][_0x498d('0x2b')]);return _0x1d9a55(_0x53033b[_0x498d('0x29')][_0x498d('0x2b')]);}else{logger[_0x498d('0x23')](_0x498d('0x24'),_0x3a1bf1,_0x498d('0x25'));_0x1d9a55(_0x53033b[_0x498d('0x2c')][_0x498d('0x2b')]);}})['catch'](function(_0x5718de){logger[_0x498d('0x29')](_0x498d('0x24'),_0x3a1bf1,_0x5718de);_0xcc7575(_0x5718de);});});}function respondWithStatusCode(_0xd0ffbe,_0x1d9121){_0x1d9121=_0x1d9121||0xcc;return function(_0x2f9a47){if(_0x2f9a47){return _0xd0ffbe[_0x498d('0x2d')](_0x1d9121);}return _0xd0ffbe['status'](_0x1d9121)[_0x498d('0x2e')]();};}function respondWithResult(_0x1381cc,_0x16b7fc){_0x16b7fc=_0x16b7fc||0xc8;return function(_0x5d6f7f){if(_0x5d6f7f){return _0x1381cc[_0x498d('0x2f')](_0x16b7fc)[_0x498d('0x30')](_0x5d6f7f);}};}function respondWithFilteredResult(_0x257b59,_0x65ad2){return function(_0x18eded){if(_0x18eded){var _0x57200a=typeof _0x65ad2[_0x498d('0x31')]===_0x498d('0x32')&&typeof _0x65ad2[_0x498d('0x33')]===_0x498d('0x32');var _0x5eb597=_0x18eded[_0x498d('0x34')];var _0x4292ec=_0x57200a?0x0:_0x65ad2[_0x498d('0x31')];var _0x173e1f=_0x57200a?_0x18eded['count']:_0x65ad2[_0x498d('0x31')]+_0x65ad2[_0x498d('0x33')];var _0x569229;if(_0x173e1f>=_0x5eb597){_0x173e1f=_0x5eb597;_0x569229=0xc8;}else{_0x569229=0xce;}_0x257b59[_0x498d('0x2f')](_0x569229);return _0x257b59[_0x498d('0x35')](_0x498d('0x36'),_0x4292ec+'-'+_0x173e1f+'/'+_0x5eb597)['json'](_0x18eded);}return null;};}function patchUpdates(_0x360cfc){return function(_0x3f31eb){try{jsonpatch[_0x498d('0x37')](_0x3f31eb,_0x360cfc,!![]);}catch(_0x4ad9f8){return BPromise[_0x498d('0x38')](_0x4ad9f8);}return _0x3f31eb[_0x498d('0x39')]();};}function saveUpdates(_0xfd627a,_0x2bb697){return function(_0x33102f){if(_0x33102f){return _0x33102f[_0x498d('0x3a')](_0xfd627a)[_0x498d('0x22')](function(_0x1edb1d){return _0x1edb1d;});}return null;};}function removeEntity(_0x479f42,_0x91842b){return function(_0x1758a9){if(_0x1758a9){return _0x1758a9[_0x498d('0x3b')]()['then'](function(){_0x479f42[_0x498d('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ba07c,_0x166ad1){return function(_0x3b5aae){if(!_0x3b5aae){_0x1ba07c['sendStatus'](0x194);}return _0x3b5aae;};}function handleError(_0x358700,_0x5d8e48){_0x5d8e48=_0x5d8e48||0x1f4;return function(_0x2cd1d2){logger[_0x498d('0x29')](_0x2cd1d2[_0x498d('0x3c')]);if(_0x2cd1d2[_0x498d('0x3d')]){delete _0x2cd1d2['name'];}_0x358700[_0x498d('0x2f')](_0x5d8e48)[_0x498d('0x3e')](_0x2cd1d2);};}exports['index']=function(_0x395aff,_0x3df946){var _0x35454e={},_0x63e9ea={},_0x279740={'count':0x0,'rows':[]};var _0x5b45fb=_[_0x498d('0x3f')](db['SmsMessage'][_0x498d('0x40')],function(_0x1496d6){return{'name':_0x1496d6[_0x498d('0x41')],'type':_0x1496d6['type'][_0x498d('0x42')]};});_0x63e9ea[_0x498d('0x43')]=_[_0x498d('0x3f')](_0x5b45fb,'name');_0x63e9ea['query']=_[_0x498d('0x44')](_0x395aff[_0x498d('0x45')]);_0x63e9ea[_0x498d('0x46')]=_[_0x498d('0x47')](_0x63e9ea['model'],_0x63e9ea[_0x498d('0x45')]);_0x35454e[_0x498d('0x48')]=_[_0x498d('0x47')](_0x63e9ea[_0x498d('0x43')],qs[_0x498d('0x49')](_0x395aff[_0x498d('0x45')][_0x498d('0x49')]));_0x35454e[_0x498d('0x48')]=_0x35454e[_0x498d('0x48')][_0x498d('0x4a')]?_0x35454e['attributes']:_0x63e9ea[_0x498d('0x43')];if(!_0x395aff[_0x498d('0x45')][_0x498d('0x4b')]('nolimit')){_0x35454e['limit']=qs['limit'](_0x395aff['query'][_0x498d('0x33')]);_0x35454e[_0x498d('0x31')]=qs[_0x498d('0x31')](_0x395aff[_0x498d('0x45')][_0x498d('0x31')]);}_0x35454e[_0x498d('0x4c')]=qs[_0x498d('0x4d')](_0x395aff['query'][_0x498d('0x4d')]);_0x35454e[_0x498d('0x4e')]=qs[_0x498d('0x46')](_[_0x498d('0x4f')](_0x395aff[_0x498d('0x45')],_0x63e9ea[_0x498d('0x46')]),_0x5b45fb);if(_0x395aff[_0x498d('0x45')][_0x498d('0x50')]){_0x35454e[_0x498d('0x4e')]=_[_0x498d('0x51')](_0x35454e[_0x498d('0x4e')],{'$or':_['map'](_0x5b45fb,function(_0x505fa1){if(_0x505fa1[_0x498d('0x52')]!=='VIRTUAL'){var _0x3c64a5={};_0x3c64a5[_0x505fa1['name']]={'$like':'%'+_0x395aff[_0x498d('0x45')][_0x498d('0x50')]+'%'};return _0x3c64a5;}})});}_0x35454e=_[_0x498d('0x51')]({},_0x35454e,_0x395aff['options']);var _0x50f520={'where':_0x35454e['where']};return db[_0x498d('0x53')][_0x498d('0x34')](_0x50f520)[_0x498d('0x22')](function(_0x14b2e4){_0x279740[_0x498d('0x34')]=_0x14b2e4;if(_0x395aff['query']['includeAll']){_0x35454e['include']=[{'all':!![]}];}return db[_0x498d('0x53')][_0x498d('0x54')](_0x35454e);})[_0x498d('0x22')](function(_0x298465){_0x279740[_0x498d('0x55')]=_0x298465;return _0x279740;})['then'](respondWithFilteredResult(_0x3df946,_0x35454e))[_0x498d('0x56')](handleError(_0x3df946,null));};exports[_0x498d('0x57')]=function(_0x27e2fe,_0x1352fc){var _0x249a78={'raw':!![],'where':{'id':_0x27e2fe['params']['id']}},_0x1b9e60={};_0x1b9e60[_0x498d('0x43')]=_[_0x498d('0x44')](db[_0x498d('0x53')]['rawAttributes']);_0x1b9e60['query']=_[_0x498d('0x44')](_0x27e2fe['query']);_0x1b9e60[_0x498d('0x46')]=_[_0x498d('0x47')](_0x1b9e60[_0x498d('0x43')],_0x1b9e60[_0x498d('0x45')]);_0x249a78[_0x498d('0x48')]=_[_0x498d('0x47')](_0x1b9e60[_0x498d('0x43')],qs[_0x498d('0x49')](_0x27e2fe[_0x498d('0x45')][_0x498d('0x49')]));_0x249a78[_0x498d('0x48')]=_0x249a78[_0x498d('0x48')][_0x498d('0x4a')]?_0x249a78['attributes']:_0x1b9e60[_0x498d('0x43')];if(_0x27e2fe[_0x498d('0x45')][_0x498d('0x58')]){_0x249a78[_0x498d('0x59')]=[{'all':!![]}];}_0x249a78=_['merge']({},_0x249a78,_0x27e2fe[_0x498d('0x5a')]);return db[_0x498d('0x53')]['find'](_0x249a78)[_0x498d('0x22')](handleEntityNotFound(_0x1352fc,null))[_0x498d('0x22')](respondWithResult(_0x1352fc,null))[_0x498d('0x56')](handleError(_0x1352fc,null));};exports[_0x498d('0x5b')]=function(_0xf86225,_0x10680f){return db[_0x498d('0x53')]['create'](_0xf86225[_0x498d('0x5c')],{})['then'](respondWithResult(_0x10680f,0xc9))[_0x498d('0x56')](handleError(_0x10680f,null));};exports[_0x498d('0x3a')]=function(_0x2fa5c1,_0x2de8dc){if(_0x2fa5c1[_0x498d('0x5c')]['id']){delete _0x2fa5c1['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0x2fa5c1[_0x498d('0x5d')]['id']}})[_0x498d('0x22')](handleEntityNotFound(_0x2de8dc,null))[_0x498d('0x22')](saveUpdates(_0x2fa5c1[_0x498d('0x5c')],null))[_0x498d('0x22')](respondWithResult(_0x2de8dc,null))[_0x498d('0x56')](handleError(_0x2de8dc,null));};exports[_0x498d('0x3b')]=function(_0x4b0e93,_0xf88828){return db[_0x498d('0x53')][_0x498d('0x5e')]({'where':{'id':_0x4b0e93[_0x498d('0x5d')]['id']}})[_0x498d('0x22')](handleEntityNotFound(_0xf88828,null))['then'](removeEntity(_0xf88828,null))['catch'](handleError(_0xf88828,null));};exports[_0x498d('0x5f')]=function(_0x43426c,_0x5f5d3f){return db['SmsMessage'][_0x498d('0x5f')]()['then'](respondWithResult(_0x5f5d3f,null))[_0x498d('0x56')](handleError(_0x5f5d3f,null));};var interaction_log=require('../../config/logger')(_0x498d('0x60'));exports['accept']=function(_0x3f0d85,_0x45be19,_0x4f668a){var _0x52c7e2={'agent':{},'channel':'sms'};if(_0x3f0d85[_0x498d('0x5c')]['id']){delete _0x3f0d85['body']['id'];}_0x3f0d85[_0x498d('0x5c')]['read']=!![];_0x3f0d85[_0x498d('0x5c')]['readAt']=moment()['format'](_0x498d('0x61'));_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')]=_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')]||_0x3f0d85['user']['id'];_0x52c7e2[_0x498d('0x63')]['id']=_0x3f0d85[_0x498d('0x5c')]['UserId'];return db[_0x498d('0x53')][_0x498d('0x5e')]({'where':{'id':_0x3f0d85[_0x498d('0x5d')]['id'],'UserId':null}})[_0x498d('0x22')](handleEntityNotFound(_0x45be19,null))['then'](saveUpdates(_0x3f0d85[_0x498d('0x5c')],null))[_0x498d('0x22')](function(_0x4deea0){if(_0x4deea0){_0x52c7e2['message']=_0x4deea0[_0x498d('0x64')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x4deea0['SmsInteractionId']}});}return null;})[_0x498d('0x22')](handleEntityNotFound(_0x45be19,null))[_0x498d('0x22')](function(_0x4c577d){if(_0x4c577d){return _0x4c577d[_0x498d('0x3a')]({'UserId':_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')],'read1stAt':_[_0x498d('0x65')](_0x4c577d['read1stAt'])?moment()[_0x498d('0x66')](_0x498d('0x61')):undefined});}return null;})[_0x498d('0x22')](function(_0x461de2){if(_0x461de2){_0x52c7e2['interaction']=_0x461de2[_0x498d('0x64')]({'plain':!![]});interaction_log[_0x498d('0x23')](_0x498d('0x67'),_0x3f0d85[_0x498d('0x68')]['id'],_0x3f0d85[_0x498d('0x68')][_0x498d('0x3d')],_0x3f0d85[_0x498d('0x68')][_0x498d('0x69')],_0x52c7e2[_0x498d('0x6a')]['id'],_0x3f0d85[_0x498d('0x5c')]?JSON['stringify'](_0x3f0d85[_0x498d('0x5c')]):_0x498d('0x6b'));return respondWithRpcPromise(_0x498d('0x6c'),_0x498d('0x6d'),_0x52c7e2);}return null;})[_0x498d('0x22')](function(_0xe17dbe){var _0x410d33='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe17dbe[_0x498d('0x2b')][_0x498d('0x6e')];return db[_0x498d('0x6f')][_0x498d('0x45')](_0x410d33,{'type':db['Sequelize']['QueryTypes'][_0x498d('0x70')],'raw':!![]})['then'](function(_0x298b9c){return _0x298b9c;});})['then'](function(_0x4a1fae){if(_0x4a1fae){_0x52c7e2[_0x498d('0x2b')][_0x498d('0x71')]=_0x4a1fae[0x0];if(!_0x3f0d85['body']['UserId'])return;return db[_0x498d('0x72')][_0x498d('0x5e')]({'where':{'id':_0x3f0d85[_0x498d('0x5c')][_0x498d('0x62')],'role':_0x498d('0x63')},'attributes':['id','name','fullname',_0x498d('0x73'),_0x498d('0x74')],'raw':!![]});}return null;})['then'](function(_0x883574){if(!_0x883574)return null;_0x52c7e2['message'][_0x498d('0x63')]=_0x883574;return _0x52c7e2;})['then'](function(_0x543479){if(_0x543479){if(_0x3f0d85[_0x498d('0x5c')][_0x498d('0x75')]){_0x52c7e2[_0x498d('0x2b')]['interface']=util['format'](_0x498d('0x76'),_0x3f0d85[_0x498d('0x68')]['name']);_0x52c7e2[_0x498d('0x2b')][_0x498d('0x77')]=_0x52c7e2['channel'];_0x52c7e2[_0x498d('0x2b')][_0x498d('0x78')]=_0x52c7e2['channel'];_0x52c7e2[_0x498d('0x2b')][_0x498d('0x79')]=_0x498d('0x7a');return respondWithRpcPromise(_0x498d('0x7b'),'EventManager',{'event':_0x498d('0x7c'),'message':_0x52c7e2[_0x498d('0x2b')]},client9002)['then'](function(){return _0x52c7e2;});}return _0x52c7e2;}return null;})[_0x498d('0x22')](respondWithResult(_0x45be19,null))[_0x498d('0x56')](handleError(_0x45be19,null));};var interaction_log=require(_0x498d('0x17'))(_0x498d('0x60'));exports['reject']=function(_0x83c7b9,_0xaafe9,_0x3107a4){var _0x1b5907={'agent':{},'channel':_0x498d('0x7d')};if(_0x83c7b9[_0x498d('0x5c')]['id']){delete _0x83c7b9['body']['id'];}_0x83c7b9[_0x498d('0x5c')][_0x498d('0x62')]=_0x83c7b9[_0x498d('0x5c')][_0x498d('0x62')]||_0x83c7b9['user']['id'];_0x1b5907[_0x498d('0x63')]['id']=_0x83c7b9['body'][_0x498d('0x62')];return db[_0x498d('0x53')][_0x498d('0x5e')]({'where':{'id':_0x83c7b9[_0x498d('0x5d')]['id'],'UserId':null}})[_0x498d('0x22')](handleEntityNotFound(_0xaafe9,null))[_0x498d('0x22')](function(_0xcc88c7){if(_0xcc88c7){_0x1b5907[_0x498d('0x2b')]=_0xcc88c7[_0x498d('0x64')]({'plain':!![]});return db[_0x498d('0x7e')]['find']({'where':{'id':_0xcc88c7[_0x498d('0x7f')]}});}return null;})[_0x498d('0x22')](handleEntityNotFound(_0xaafe9,null))[_0x498d('0x22')](function(_0x396eed){if(_0x396eed){_0x1b5907[_0x498d('0x6a')]=_0x396eed[_0x498d('0x64')]({'plain':!![]});interaction_log[_0x498d('0x23')](_0x498d('0x80'),_0x83c7b9[_0x498d('0x68')]['id'],_0x83c7b9[_0x498d('0x68')][_0x498d('0x3d')],_0x83c7b9[_0x498d('0x68')]['role'],_0x1b5907[_0x498d('0x6a')]['id'],_0x83c7b9[_0x498d('0x5c')]?JSON['stringify'](_0x83c7b9[_0x498d('0x5c')]):_0x498d('0x6b'));return respondWithRpcPromise(_0x498d('0x81'),_0x498d('0x82'),_0x1b5907);}return null;})[_0x498d('0x22')](function(_0x50d28e){var _0xda558a=_0x498d('0x83')+_0x50d28e[_0x498d('0x2b')][_0x498d('0x6e')];return db[_0x498d('0x6f')]['query'](_0xda558a,{'type':db[_0x498d('0x84')][_0x498d('0x85')]['SELECT'],'raw':!![]})['then'](function(_0x1910cb){return _0x1910cb;});})[_0x498d('0x22')](function(_0x48816f){if(_0x48816f){_0x1b5907['message'][_0x498d('0x71')]=_0x48816f[0x0];if(!_0x83c7b9['body'][_0x498d('0x62')])return;return db['User'][_0x498d('0x5e')]({'where':{'id':_0x83c7b9['body'][_0x498d('0x62')],'role':_0x498d('0x63')},'attributes':['id',_0x498d('0x3d'),_0x498d('0x86'),_0x498d('0x73'),_0x498d('0x74')],'raw':!![]});}return null;})['then'](function(_0x23c5f1){if(!_0x23c5f1)return null;_0x1b5907[_0x498d('0x2b')][_0x498d('0x63')]=_0x23c5f1;return _0x1b5907;})['then'](function(_0x2e475c){if(_0x2e475c){_0x2e475c[_0x498d('0x2b')][_0x498d('0x87')]=util[_0x498d('0x66')]('SIP/%s',_0x83c7b9[_0x498d('0x68')][_0x498d('0x3d')]);_0x2e475c[_0x498d('0x2b')][_0x498d('0x77')]=_0x1b5907[_0x498d('0x77')];_0x2e475c[_0x498d('0x2b')][_0x498d('0x78')]=_0x1b5907[_0x498d('0x77')];_0x2e475c[_0x498d('0x2b')][_0x498d('0x79')]=_0x498d('0x38');respondWithRpcPromise(_0x498d('0x7b'),_0x498d('0x7b'),{'event':_0x498d('0x88'),'message':_0x2e475c[_0x498d('0x2b')]},client9002);return _0x1b5907;}return null;})[_0x498d('0x22')](respondWithResult(_0xaafe9,null))['catch'](handleError(_0xaafe9,null));};exports['status']=function(_0x50a958,_0x375a90,_0x2cd5b8){if(_0x50a958['body']['id']){delete _0x50a958['body']['id'];}var _0x55e6a7;return db[_0x498d('0x53')]['find']({'where':{'id':_0x50a958[_0x498d('0x5d')]['id']}})[_0x498d('0x22')](handleEntityNotFound(_0x375a90,null))['then'](function(_0x86c257){if(_0x86c257){_0x55e6a7=_0x86c257;return db[_0x498d('0x89')][_0x498d('0x5e')]({'where':{'id':_0x86c257[_0x498d('0x8a')]}});}})['then'](handleEntityNotFound(_0x375a90,null))[_0x498d('0x22')](function(_0x1c4d3a){if(_0x1c4d3a){logger[_0x498d('0x26')](_0x498d('0x27'),'status',_0x498d('0x8b'),_0x1c4d3a[_0x498d('0x52')],util[_0x498d('0x8c')](_0x50a958['body'],{'showHidden':![],'depth':null}));switch(_0x1c4d3a['type']){case _0x498d('0x8d'):if(_0x50a958[_0x498d('0x5c')][_0x498d('0x8e')]&&_0x50a958['body'][_0x498d('0x8e')]===_0x55e6a7['messageId']){return _0x55e6a7['update']({'read':!![]});}else{logger[_0x498d('0x29')](_0x498d('0x8f'),'status',_0x498d('0x8d'),util[_0x498d('0x8c')](_0x50a958[_0x498d('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x498d('0x90'):if(_0x50a958[_0x498d('0x5c')][_0x498d('0x91')]&&_0x50a958[_0x498d('0x5c')]['MessageUUID']===_0x55e6a7['messageId']&&_[_0x498d('0x92')]([_0x498d('0x93'),_0x498d('0x94')],_0x50a958[_0x498d('0x5c')][_0x498d('0x95')])>=0x0){return _0x55e6a7[_0x498d('0x3a')]({'read':!![]});}else{logger[_0x498d('0x29')](_0x498d('0x8f'),_0x498d('0x2f'),_0x498d('0x96'),util['inspect'](_0x50a958['body'],{'showHidden':![],'depth':null}));}break;case _0x498d('0x97'):var _0x4d2698=_0x50a958[_0x498d('0x5c')][_0x498d('0x98')][0x0];if(_0x4d2698[_0x498d('0x2f')][_0x498d('0x99')]==='DELIVERED'){return _0x55e6a7[_0x498d('0x3a')]({'read':!![]});}else{logger[_0x498d('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x498d('0x2f'),_0x498d('0x97'),util[_0x498d('0x8c')](_0x50a958['body'],{'showHidden':![],'depth':null}));}break;}return _0x55e6a7;}})['then'](respondWithResult(_0x375a90,null))[_0x498d('0x56')](handleError(_0x375a90,null));}; \ No newline at end of file +var _0xfa75=['attributes','fields','length','hasOwnProperty','sort','where','merge','includeAll','include','findAll','catch','show','options','find','body','update','params','destroy','describe','../../config/logger','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','isNil','read1stAt','interaction','get','[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','ContactId','sequelize','Sequelize','fullname','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','SmsInteractionId','RejectMessage','QueryTypes','SELECT','User','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','type','inspect','twilio','plivo','MessageUUID','messageId','indexOf','sent','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','DELIVERED','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','stack','name','send','map','SmsMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xfa75,0x1ef));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5fa7('0x0'));var rimraf=require(_0x5fa7('0x1'));var zipdir=require(_0x5fa7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fa7('0x3'));var moment=require(_0x5fa7('0x4'));var BPromise=require(_0x5fa7('0x5'));var Mustache=require(_0x5fa7('0x6'));var util=require('util');var path=require(_0x5fa7('0x7'));var sox=require(_0x5fa7('0x8'));var csv=require(_0x5fa7('0x9'));var ejs=require(_0x5fa7('0xa'));var fs=require('fs');var fs_extra=require(_0x5fa7('0xb'));var _=require('lodash');var squel=require(_0x5fa7('0xc'));var crypto=require('crypto');var jsforce=require(_0x5fa7('0xd'));var deskjs=require(_0x5fa7('0xe'));var toCsv=require(_0x5fa7('0x9'));var querystring=require(_0x5fa7('0xf'));var Papa=require(_0x5fa7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5fa7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5fa7('0x12'));var logger=require('../../config/logger')(_0x5fa7('0x13'));var utils=require('../../config/utils');var config=require(_0x5fa7('0x14'));var licenseUtil=require(_0x5fa7('0x15'));var db=require('../../mysqldb')['db'];config[_0x5fa7('0x16')]=_[_0x5fa7('0x17')](config[_0x5fa7('0x16')],{'host':_0x5fa7('0x18'),'port':0x18eb});var socket=require(_0x5fa7('0x19'))(new Redis(config[_0x5fa7('0x16')]));require(_0x5fa7('0x1a'))[_0x5fa7('0x1b')](socket);var jayson=require(_0x5fa7('0x1c'));var client=jayson[_0x5fa7('0x1d')][_0x5fa7('0x1e')]({'port':0x232c});var client9002=jayson[_0x5fa7('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b725a,_0x6b21bd,_0x42fc74,_0x3d196e){return new BPromise(function(_0x6999a0,_0x4a9fd7){var _0x5c1ec0=_0x3d196e||client;return _0x5c1ec0[_0x5fa7('0x1f')](_0x4b725a,_0x42fc74)[_0x5fa7('0x20')](function(_0x212f13){logger['info'](_0x5fa7('0x21'),_0x6b21bd,_0x5fa7('0x22'));logger[_0x5fa7('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6b21bd,_0x5fa7('0x22'),JSON[_0x5fa7('0x24')](_0x212f13));if(_0x212f13[_0x5fa7('0x25')]){if(_0x212f13['error']['code']===0x1f4){logger[_0x5fa7('0x25')](_0x5fa7('0x21'),_0x6b21bd,_0x212f13[_0x5fa7('0x25')][_0x5fa7('0x26')]);return _0x4a9fd7(_0x212f13[_0x5fa7('0x25')]['message']);}logger['error'](_0x5fa7('0x21'),_0x6b21bd,_0x212f13[_0x5fa7('0x25')][_0x5fa7('0x26')]);return _0x6999a0(_0x212f13[_0x5fa7('0x25')][_0x5fa7('0x26')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x6b21bd,_0x5fa7('0x22'));_0x6999a0(_0x212f13[_0x5fa7('0x27')][_0x5fa7('0x26')]);}})['catch'](function(_0x52f35){logger['error'](_0x5fa7('0x21'),_0x6b21bd,_0x52f35);_0x4a9fd7(_0x52f35);});});}function respondWithStatusCode(_0x14203b,_0x19e40c){_0x19e40c=_0x19e40c||0xcc;return function(_0x48f090){if(_0x48f090){return _0x14203b[_0x5fa7('0x28')](_0x19e40c);}return _0x14203b[_0x5fa7('0x29')](_0x19e40c)[_0x5fa7('0x2a')]();};}function respondWithResult(_0x15111e,_0xcf9bd4){_0xcf9bd4=_0xcf9bd4||0xc8;return function(_0x50a7e0){if(_0x50a7e0){return _0x15111e[_0x5fa7('0x29')](_0xcf9bd4)['json'](_0x50a7e0);}};}function respondWithFilteredResult(_0x2bac5e,_0x31d7c9){return function(_0x1b1157){if(_0x1b1157){var _0x337d6f=typeof _0x31d7c9[_0x5fa7('0x2b')]===_0x5fa7('0x2c')&&typeof _0x31d7c9[_0x5fa7('0x2d')]===_0x5fa7('0x2c');var _0x283f26=_0x1b1157[_0x5fa7('0x2e')];var _0x11df17=_0x337d6f?0x0:_0x31d7c9[_0x5fa7('0x2b')];var _0x2e6fc6=_0x337d6f?_0x1b1157['count']:_0x31d7c9[_0x5fa7('0x2b')]+_0x31d7c9[_0x5fa7('0x2d')];var _0x5b9441;if(_0x2e6fc6>=_0x283f26){_0x2e6fc6=_0x283f26;_0x5b9441=0xc8;}else{_0x5b9441=0xce;}_0x2bac5e[_0x5fa7('0x29')](_0x5b9441);return _0x2bac5e[_0x5fa7('0x2f')]('Content-Range',_0x11df17+'-'+_0x2e6fc6+'/'+_0x283f26)[_0x5fa7('0x30')](_0x1b1157);}return null;};}function patchUpdates(_0x297c67){return function(_0x24a492){try{jsonpatch[_0x5fa7('0x31')](_0x24a492,_0x297c67,!![]);}catch(_0x38ec1d){return BPromise[_0x5fa7('0x32')](_0x38ec1d);}return _0x24a492[_0x5fa7('0x33')]();};}function saveUpdates(_0x14bfca,_0x553073){return function(_0x1bdcf5){if(_0x1bdcf5){return _0x1bdcf5['update'](_0x14bfca)['then'](function(_0x588d61){return _0x588d61;});}return null;};}function removeEntity(_0xd85c6d,_0x5d180f){return function(_0x5e63c8){if(_0x5e63c8){return _0x5e63c8['destroy']()[_0x5fa7('0x20')](function(){_0xd85c6d[_0x5fa7('0x29')](0xcc)[_0x5fa7('0x2a')]();});}};}function handleEntityNotFound(_0x5a6f03,_0x2ebbf8){return function(_0x3aec54){if(!_0x3aec54){_0x5a6f03[_0x5fa7('0x28')](0x194);}return _0x3aec54;};}function handleError(_0x33b1b5,_0x5002e8){_0x5002e8=_0x5002e8||0x1f4;return function(_0x3b8e87){logger[_0x5fa7('0x25')](_0x3b8e87[_0x5fa7('0x34')]);if(_0x3b8e87['name']){delete _0x3b8e87[_0x5fa7('0x35')];}_0x33b1b5[_0x5fa7('0x29')](_0x5002e8)[_0x5fa7('0x36')](_0x3b8e87);};}exports['index']=function(_0x3c7a29,_0xd09630){var _0x3a18e5={},_0x377ea4={},_0xb0f640={'count':0x0,'rows':[]};var _0x5dd4f6=_[_0x5fa7('0x37')](db[_0x5fa7('0x38')][_0x5fa7('0x39')],function(_0x14ab87){return{'name':_0x14ab87[_0x5fa7('0x3a')],'type':_0x14ab87['type'][_0x5fa7('0x3b')]};});_0x377ea4[_0x5fa7('0x3c')]=_[_0x5fa7('0x37')](_0x5dd4f6,_0x5fa7('0x35'));_0x377ea4['query']=_[_0x5fa7('0x3d')](_0x3c7a29[_0x5fa7('0x3e')]);_0x377ea4[_0x5fa7('0x3f')]=_[_0x5fa7('0x40')](_0x377ea4[_0x5fa7('0x3c')],_0x377ea4[_0x5fa7('0x3e')]);_0x3a18e5[_0x5fa7('0x41')]=_[_0x5fa7('0x40')](_0x377ea4['model'],qs['fields'](_0x3c7a29[_0x5fa7('0x3e')][_0x5fa7('0x42')]));_0x3a18e5[_0x5fa7('0x41')]=_0x3a18e5['attributes'][_0x5fa7('0x43')]?_0x3a18e5[_0x5fa7('0x41')]:_0x377ea4[_0x5fa7('0x3c')];if(!_0x3c7a29[_0x5fa7('0x3e')][_0x5fa7('0x44')]('nolimit')){_0x3a18e5[_0x5fa7('0x2d')]=qs[_0x5fa7('0x2d')](_0x3c7a29[_0x5fa7('0x3e')][_0x5fa7('0x2d')]);_0x3a18e5[_0x5fa7('0x2b')]=qs['offset'](_0x3c7a29[_0x5fa7('0x3e')]['offset']);}_0x3a18e5['order']=qs[_0x5fa7('0x45')](_0x3c7a29[_0x5fa7('0x3e')][_0x5fa7('0x45')]);_0x3a18e5[_0x5fa7('0x46')]=qs[_0x5fa7('0x3f')](_['pick'](_0x3c7a29[_0x5fa7('0x3e')],_0x377ea4[_0x5fa7('0x3f')]),_0x5dd4f6);if(_0x3c7a29[_0x5fa7('0x3e')]['filter']){_0x3a18e5[_0x5fa7('0x46')]=_['merge'](_0x3a18e5[_0x5fa7('0x46')],{'$or':_[_0x5fa7('0x37')](_0x5dd4f6,function(_0xc2d2f1){if(_0xc2d2f1['type']!=='VIRTUAL'){var _0x2ece77={};_0x2ece77[_0xc2d2f1[_0x5fa7('0x35')]]={'$like':'%'+_0x3c7a29[_0x5fa7('0x3e')]['filter']+'%'};return _0x2ece77;}})});}_0x3a18e5=_[_0x5fa7('0x47')]({},_0x3a18e5,_0x3c7a29['options']);var _0x103992={'where':_0x3a18e5['where']};return db[_0x5fa7('0x38')][_0x5fa7('0x2e')](_0x103992)[_0x5fa7('0x20')](function(_0x4e823b){_0xb0f640[_0x5fa7('0x2e')]=_0x4e823b;if(_0x3c7a29[_0x5fa7('0x3e')][_0x5fa7('0x48')]){_0x3a18e5[_0x5fa7('0x49')]=[{'all':!![]}];}return db['SmsMessage'][_0x5fa7('0x4a')](_0x3a18e5);})[_0x5fa7('0x20')](function(_0xff86f9){_0xb0f640['rows']=_0xff86f9;return _0xb0f640;})['then'](respondWithFilteredResult(_0xd09630,_0x3a18e5))[_0x5fa7('0x4b')](handleError(_0xd09630,null));};exports[_0x5fa7('0x4c')]=function(_0x1ba4c6,_0x1bf985){var _0x1f5f56={'raw':!![],'where':{'id':_0x1ba4c6['params']['id']}},_0x44c879={};_0x44c879[_0x5fa7('0x3c')]=_[_0x5fa7('0x3d')](db[_0x5fa7('0x38')]['rawAttributes']);_0x44c879['query']=_[_0x5fa7('0x3d')](_0x1ba4c6[_0x5fa7('0x3e')]);_0x44c879[_0x5fa7('0x3f')]=_[_0x5fa7('0x40')](_0x44c879[_0x5fa7('0x3c')],_0x44c879[_0x5fa7('0x3e')]);_0x1f5f56['attributes']=_['intersection'](_0x44c879[_0x5fa7('0x3c')],qs[_0x5fa7('0x42')](_0x1ba4c6[_0x5fa7('0x3e')]['fields']));_0x1f5f56['attributes']=_0x1f5f56[_0x5fa7('0x41')][_0x5fa7('0x43')]?_0x1f5f56[_0x5fa7('0x41')]:_0x44c879[_0x5fa7('0x3c')];if(_0x1ba4c6[_0x5fa7('0x3e')][_0x5fa7('0x48')]){_0x1f5f56[_0x5fa7('0x49')]=[{'all':!![]}];}_0x1f5f56=_['merge']({},_0x1f5f56,_0x1ba4c6[_0x5fa7('0x4d')]);return db[_0x5fa7('0x38')][_0x5fa7('0x4e')](_0x1f5f56)[_0x5fa7('0x20')](handleEntityNotFound(_0x1bf985,null))[_0x5fa7('0x20')](respondWithResult(_0x1bf985,null))['catch'](handleError(_0x1bf985,null));};exports['create']=function(_0x5babe4,_0x31ce3d){return db[_0x5fa7('0x38')]['create'](_0x5babe4[_0x5fa7('0x4f')],{})[_0x5fa7('0x20')](respondWithResult(_0x31ce3d,0xc9))[_0x5fa7('0x4b')](handleError(_0x31ce3d,null));};exports[_0x5fa7('0x50')]=function(_0x38a261,_0x4e9f2f){if(_0x38a261[_0x5fa7('0x4f')]['id']){delete _0x38a261[_0x5fa7('0x4f')]['id'];}return db[_0x5fa7('0x38')][_0x5fa7('0x4e')]({'where':{'id':_0x38a261[_0x5fa7('0x51')]['id']}})[_0x5fa7('0x20')](handleEntityNotFound(_0x4e9f2f,null))[_0x5fa7('0x20')](saveUpdates(_0x38a261[_0x5fa7('0x4f')],null))[_0x5fa7('0x20')](respondWithResult(_0x4e9f2f,null))['catch'](handleError(_0x4e9f2f,null));};exports[_0x5fa7('0x52')]=function(_0x16ab7a,_0x2435b3){return db[_0x5fa7('0x38')][_0x5fa7('0x4e')]({'where':{'id':_0x16ab7a[_0x5fa7('0x51')]['id']}})['then'](handleEntityNotFound(_0x2435b3,null))['then'](removeEntity(_0x2435b3,null))[_0x5fa7('0x4b')](handleError(_0x2435b3,null));};exports['describe']=function(_0x3d1d9d,_0x34818f){return db[_0x5fa7('0x38')][_0x5fa7('0x53')]()[_0x5fa7('0x20')](respondWithResult(_0x34818f,null))[_0x5fa7('0x4b')](handleError(_0x34818f,null));};var interaction_log=require(_0x5fa7('0x54'))(_0x5fa7('0x55'));exports['accept']=function(_0x265f49,_0x2966cb,_0x2cc3eb){var _0x468d7b={'agent':{},'channel':_0x5fa7('0x56')};if(_0x265f49[_0x5fa7('0x4f')]['id']){delete _0x265f49[_0x5fa7('0x4f')]['id'];}_0x265f49[_0x5fa7('0x4f')][_0x5fa7('0x57')]=!![];_0x265f49[_0x5fa7('0x4f')][_0x5fa7('0x58')]=moment()[_0x5fa7('0x59')](_0x5fa7('0x5a'));_0x265f49[_0x5fa7('0x4f')][_0x5fa7('0x5b')]=_0x265f49[_0x5fa7('0x4f')][_0x5fa7('0x5b')]||_0x265f49[_0x5fa7('0x5c')]['id'];_0x468d7b[_0x5fa7('0x5d')]['id']=_0x265f49[_0x5fa7('0x4f')]['UserId'];return db['SmsMessage'][_0x5fa7('0x4e')]({'where':{'id':_0x265f49[_0x5fa7('0x51')]['id'],'UserId':null}})[_0x5fa7('0x20')](handleEntityNotFound(_0x2966cb,null))['then'](saveUpdates(_0x265f49['body'],null))[_0x5fa7('0x20')](function(_0x469e50){if(_0x469e50){_0x468d7b[_0x5fa7('0x26')]=_0x469e50['get']({'plain':!![]});return db[_0x5fa7('0x5e')]['find']({'where':{'id':_0x469e50['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2966cb,null))['then'](function(_0x185d08){if(_0x185d08){return _0x185d08[_0x5fa7('0x50')]({'UserId':_0x265f49['body'][_0x5fa7('0x5b')],'read1stAt':_[_0x5fa7('0x5f')](_0x185d08[_0x5fa7('0x60')])?moment()[_0x5fa7('0x59')](_0x5fa7('0x5a')):undefined});}return null;})[_0x5fa7('0x20')](function(_0x1080ec){if(_0x1080ec){_0x468d7b[_0x5fa7('0x61')]=_0x1080ec[_0x5fa7('0x62')]({'plain':!![]});interaction_log['info'](_0x5fa7('0x63'),_0x265f49['user']['id'],_0x265f49[_0x5fa7('0x5c')]['name'],_0x265f49[_0x5fa7('0x5c')][_0x5fa7('0x64')],_0x468d7b[_0x5fa7('0x61')]['id'],_0x265f49[_0x5fa7('0x4f')]?JSON[_0x5fa7('0x24')](_0x265f49[_0x5fa7('0x4f')]):_0x5fa7('0x65'));return respondWithRpcPromise(_0x5fa7('0x66'),_0x5fa7('0x67'),_0x468d7b);}return null;})['then'](function(_0x144c69){var _0x2dd214=_0x5fa7('0x68')+_0x144c69[_0x5fa7('0x26')][_0x5fa7('0x69')];return db[_0x5fa7('0x6a')][_0x5fa7('0x3e')](_0x2dd214,{'type':db[_0x5fa7('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})[_0x5fa7('0x20')](function(_0x58fa71){return _0x58fa71;});})['then'](function(_0x4d5674){if(_0x4d5674){_0x468d7b[_0x5fa7('0x26')]['contact']=_0x4d5674[0x0];if(!_0x265f49[_0x5fa7('0x4f')][_0x5fa7('0x5b')])return;return db['User'][_0x5fa7('0x4e')]({'where':{'id':_0x265f49[_0x5fa7('0x4f')][_0x5fa7('0x5b')],'role':_0x5fa7('0x5d')},'attributes':['id','name',_0x5fa7('0x6c'),'email',_0x5fa7('0x6d')],'raw':!![]});}return null;})['then'](function(_0x4830a7){if(!_0x4830a7)return null;_0x468d7b['message'][_0x5fa7('0x5d')]=_0x4830a7;return _0x468d7b;})[_0x5fa7('0x20')](function(_0x42c79a){if(_0x42c79a){if(_0x265f49[_0x5fa7('0x4f')][_0x5fa7('0x6e')]){_0x468d7b[_0x5fa7('0x26')]['interface']=util[_0x5fa7('0x59')](_0x5fa7('0x6f'),_0x265f49[_0x5fa7('0x5c')]['name']);_0x468d7b[_0x5fa7('0x26')]['channel']=_0x468d7b[_0x5fa7('0x70')];_0x468d7b[_0x5fa7('0x26')][_0x5fa7('0x71')]=_0x468d7b['channel'];_0x468d7b[_0x5fa7('0x26')][_0x5fa7('0x72')]=_0x5fa7('0x73');return respondWithRpcPromise(_0x5fa7('0x74'),'EventManager',{'event':_0x5fa7('0x75'),'message':_0x468d7b[_0x5fa7('0x26')]},client9002)[_0x5fa7('0x20')](function(){return _0x468d7b;});}return _0x468d7b;}return null;})[_0x5fa7('0x20')](respondWithResult(_0x2966cb,null))[_0x5fa7('0x4b')](handleError(_0x2966cb,null));};var interaction_log=require(_0x5fa7('0x54'))(_0x5fa7('0x55'));exports[_0x5fa7('0x32')]=function(_0x5c33d7,_0x3369d8,_0x4f7aec){var _0x2f1fb0={'agent':{},'channel':_0x5fa7('0x56')};if(_0x5c33d7[_0x5fa7('0x4f')]['id']){delete _0x5c33d7[_0x5fa7('0x4f')]['id'];}_0x5c33d7[_0x5fa7('0x4f')][_0x5fa7('0x5b')]=_0x5c33d7[_0x5fa7('0x4f')][_0x5fa7('0x5b')]||_0x5c33d7['user']['id'];_0x2f1fb0[_0x5fa7('0x5d')]['id']=_0x5c33d7[_0x5fa7('0x4f')][_0x5fa7('0x5b')];return db['SmsMessage'][_0x5fa7('0x4e')]({'where':{'id':_0x5c33d7[_0x5fa7('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3369d8,null))[_0x5fa7('0x20')](function(_0x2fa9e6){if(_0x2fa9e6){_0x2f1fb0['message']=_0x2fa9e6[_0x5fa7('0x62')]({'plain':!![]});return db[_0x5fa7('0x5e')]['find']({'where':{'id':_0x2fa9e6[_0x5fa7('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x3369d8,null))[_0x5fa7('0x20')](function(_0x42b9d6){if(_0x42b9d6){_0x2f1fb0[_0x5fa7('0x61')]=_0x42b9d6['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5c33d7[_0x5fa7('0x5c')]['id'],_0x5c33d7[_0x5fa7('0x5c')][_0x5fa7('0x35')],_0x5c33d7['user'][_0x5fa7('0x64')],_0x2f1fb0['interaction']['id'],_0x5c33d7[_0x5fa7('0x4f')]?JSON[_0x5fa7('0x24')](_0x5c33d7[_0x5fa7('0x4f')]):_0x5fa7('0x65'));return respondWithRpcPromise(_0x5fa7('0x77'),'rejectMessage',_0x2f1fb0);}return null;})[_0x5fa7('0x20')](function(_0x23fa34){var _0x27691a=_0x5fa7('0x68')+_0x23fa34[_0x5fa7('0x26')][_0x5fa7('0x69')];return db['sequelize'][_0x5fa7('0x3e')](_0x27691a,{'type':db[_0x5fa7('0x6b')][_0x5fa7('0x78')][_0x5fa7('0x79')],'raw':!![]})[_0x5fa7('0x20')](function(_0x3eb6a9){return _0x3eb6a9;});})['then'](function(_0x341ba5){if(_0x341ba5){_0x2f1fb0[_0x5fa7('0x26')]['contact']=_0x341ba5[0x0];if(!_0x5c33d7['body']['UserId'])return;return db[_0x5fa7('0x7a')][_0x5fa7('0x4e')]({'where':{'id':_0x5c33d7[_0x5fa7('0x4f')]['UserId'],'role':_0x5fa7('0x5d')},'attributes':['id',_0x5fa7('0x35'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x5fa7('0x20')](function(_0x529ee0){if(!_0x529ee0)return null;_0x2f1fb0[_0x5fa7('0x26')][_0x5fa7('0x5d')]=_0x529ee0;return _0x2f1fb0;})[_0x5fa7('0x20')](function(_0x2580d5){if(_0x2580d5){_0x2580d5[_0x5fa7('0x26')]['interface']=util[_0x5fa7('0x59')](_0x5fa7('0x6f'),_0x5c33d7['user'][_0x5fa7('0x35')]);_0x2580d5[_0x5fa7('0x26')][_0x5fa7('0x70')]=_0x2f1fb0['channel'];_0x2580d5['message']['motionChannel']=_0x2f1fb0[_0x5fa7('0x70')];_0x2580d5[_0x5fa7('0x26')][_0x5fa7('0x72')]='reject';respondWithRpcPromise(_0x5fa7('0x74'),_0x5fa7('0x74'),{'event':_0x5fa7('0x7b'),'message':_0x2580d5['message']},client9002);return _0x2f1fb0;}return null;})['then'](respondWithResult(_0x3369d8,null))[_0x5fa7('0x4b')](handleError(_0x3369d8,null));};exports[_0x5fa7('0x29')]=function(_0x8f82f8,_0x5b4196,_0x1c8be5){if(_0x8f82f8[_0x5fa7('0x4f')]['id']){delete _0x8f82f8['body']['id'];}var _0x41d627;return db['SmsMessage'][_0x5fa7('0x4e')]({'where':{'id':_0x8f82f8[_0x5fa7('0x51')]['id']}})['then'](handleEntityNotFound(_0x5b4196,null))[_0x5fa7('0x20')](function(_0x5def41){if(_0x5def41){_0x41d627=_0x5def41;return db[_0x5fa7('0x7c')]['find']({'where':{'id':_0x5def41[_0x5fa7('0x7d')]}});}})[_0x5fa7('0x20')](handleEntityNotFound(_0x5b4196,null))['then'](function(_0x4436f7){if(_0x4436f7){logger['debug'](_0x5fa7('0x7e'),'status','received\x20delivery\x20report\x20from',_0x4436f7[_0x5fa7('0x7f')],util[_0x5fa7('0x80')](_0x8f82f8[_0x5fa7('0x4f')],{'showHidden':![],'depth':null}));switch(_0x4436f7[_0x5fa7('0x7f')]){case _0x5fa7('0x81'):if(_0x8f82f8[_0x5fa7('0x4f')]['MessageSid']&&_0x8f82f8[_0x5fa7('0x4f')]['MessageSid']===_0x41d627['messageId']){return _0x41d627[_0x5fa7('0x50')]({'read':!![]});}else{logger[_0x5fa7('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5fa7('0x29'),_0x5fa7('0x81'),util[_0x5fa7('0x80')](_0x8f82f8[_0x5fa7('0x4f')],{'showHidden':![],'depth':null}));}break;case _0x5fa7('0x82'):if(_0x8f82f8[_0x5fa7('0x4f')]['MessageUUID']&&_0x8f82f8[_0x5fa7('0x4f')][_0x5fa7('0x83')]===_0x41d627[_0x5fa7('0x84')]&&_[_0x5fa7('0x85')]([_0x5fa7('0x86'),_0x5fa7('0x87')],_0x8f82f8[_0x5fa7('0x4f')]['Status'])>=0x0){return _0x41d627['update']({'read':!![]});}else{logger['error'](_0x5fa7('0x88'),_0x5fa7('0x29'),_0x5fa7('0x89'),util[_0x5fa7('0x80')](_0x8f82f8[_0x5fa7('0x4f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x51197f=_0x8f82f8[_0x5fa7('0x4f')][_0x5fa7('0x8a')][0x0];if(_0x51197f[_0x5fa7('0x29')]['groupName']===_0x5fa7('0x8b')){return _0x41d627[_0x5fa7('0x50')]({'read':!![]});}else{logger[_0x5fa7('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x5fa7('0x80')](_0x8f82f8[_0x5fa7('0x4f')],{'showHidden':![],'depth':null}));}break;}return _0x41d627;}})[_0x5fa7('0x20')](respondWithResult(_0x5b4196,null))[_0x5fa7('0x4b')](handleError(_0x5b4196,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 174a651..091a36b 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 _0x8265=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0x46c853,_0x7cb710){var _0x1a14f2=function(_0x4b0b39){while(--_0x4b0b39){_0x46c853['push'](_0x46c853['shift']());}};_0x1a14f2(++_0x7cb710);}(_0x8265,0xf4));var _0x5826=function(_0x2f5379,_0x15f97a){_0x2f5379=_0x2f5379-0x0;var _0x3b2237=_0x8265[_0x2f5379];return _0x3b2237;};'use strict';var EventEmitter=require(_0x5826('0x0'));var SmsMessage=require(_0x5826('0x1'))['db'][_0x5826('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5826('0x3')](0x0);var events={'afterCreate':_0x5826('0x4'),'afterUpdate':_0x5826('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3194ed){return function(_0x3070ea,_0x59f636,_0x90db7){SmsMessageEvents[_0x5826('0x6')](_0x3194ed+':'+_0x3070ea['id'],_0x3070ea);SmsMessageEvents[_0x5826('0x6')](_0x3194ed,_0x3070ea);_0x90db7(null);};}for(var e in events){if(events[_0x5826('0x7')](e)){var event=events[e];SmsMessage[_0x5826('0x8')](e,emitEvent(event));}}module[_0x5826('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xb876=['emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save','update'];(function(_0x3a8bb8,_0x5aae01){var _0x13a3e3=function(_0x1aefa6){while(--_0x1aefa6){_0x3a8bb8['push'](_0x3a8bb8['shift']());}};_0x13a3e3(++_0x5aae01);}(_0xb876,0x175));var _0x6b87=function(_0xf364c1,_0x4b4bd1){_0xf364c1=_0xf364c1-0x0;var _0xdd0940=_0xb876[_0xf364c1];return _0xdd0940;};'use strict';var EventEmitter=require(_0x6b87('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x6b87('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6b87('0x2')](0x0);var events={'afterCreate':_0x6b87('0x3'),'afterUpdate':_0x6b87('0x4'),'afterDestroy':'remove'};function emitEvent(_0x8db2e5){return function(_0x2d2124,_0x163ba8,_0x1c5122){SmsMessageEvents[_0x6b87('0x5')](_0x8db2e5+':'+_0x2d2124['id'],_0x2d2124);SmsMessageEvents[_0x6b87('0x5')](_0x8db2e5,_0x2d2124);_0x1c5122(null);};}for(var e in events){if(events[_0x6b87('0x6')](e)){var event=events[e];SmsMessage[_0x6b87('0x7')](e,emitEvent(event));}}module[_0x6b87('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 76b5d97..68a684f 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 _0x2820=['https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','status','refid','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','update','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','password','GET','split','sms','POST','user_key','session_key','deliveryReport','read','inspect','skebby','Missing\x20parameters:\x20username,\x20password','connectel','requestid','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','Basic\x20%s','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','login','text','keys','sort','length','apiKey','createHash','md5','id_sms','Missing\x20parameters:\x20apiKey'];(function(_0x2fcda2,_0x428a8e){var _0x466965=function(_0x386fa8){while(--_0x386fa8){_0x2fcda2['push'](_0x2fcda2['shift']());}};_0x466965(++_0x428a8e);}(_0x2820,0x8b));var _0x0282=function(_0x5c3b05,_0x436794){_0x5c3b05=_0x5c3b05-0x0;var _0x221f26=_0x2820[_0x5c3b05];return _0x221f26;};'use strict';var _=require('lodash');var util=require(_0x0282('0x0'));var logger=require(_0x0282('0x1'))(_0x0282('0x2'));var moment=require('moment');var BPromise=require(_0x0282('0x3'));var rp=require(_0x0282('0x4'));var fs=require('fs');var path=require(_0x0282('0x5'));var rimraf=require(_0x0282('0x6'));var config=require(_0x0282('0x7'));var attributes=require(_0x0282('0x8'));module[_0x0282('0x9')]=function(_0x3346d0,_0x2acb21){return _0x3346d0[_0x0282('0xa')](_0x0282('0xb'),attributes,{'tableName':_0x0282('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x0282('0xd')]},{'name':'fti_sms_messages','fields':[_0x0282('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x357e73,_0x4f5c56,_0x316bfd){var _0x252b3a=_0x3346d0[_0x0282('0xf')];var _0x52ceff=_0x357e73[_0x0282('0x10')]({'plain':!![]});if(_0x52ceff[_0x0282('0x11')][_0x0282('0x12')]()==='in'||_0x52ceff[_0x0282('0x11')][_0x0282('0x12')]()===_0x0282('0x13')&&!_0x52ceff[_0x0282('0x14')]&&!_[_0x0282('0x15')](_0x52ceff[_0x0282('0x16')])&&!_[_0x0282('0x15')](_0x52ceff[_0x0282('0x17')])){_0x252b3a['SmsInteraction']['findOne']({'where':{'id':_0x52ceff[_0x0282('0x17')]}})['then'](function(_0xc63aaa){if(_0xc63aaa){_0xc63aaa[_0x0282('0x18')]({'lastMsgAt':_0x52ceff['createdAt'],'lastMsgDirection':_0x52ceff[_0x0282('0x11')][_0x0282('0x12')]()});}})[_0x0282('0x19')](function(_0x54b1a0){console[_0x0282('0x1a')](_0x54b1a0);});}if(_0x52ceff['direction']==='out'&&!_0x52ceff[_0x0282('0x14')]){var _0x50fd01;_0x252b3a[_0x0282('0x1b')][_0x0282('0x1c')]({'where':{'id':_0x52ceff[_0x0282('0x1d')]},'raw':!![]})[_0x0282('0x1e')](function(_0x28c97c){_0x50fd01=_0x28c97c;if(_0x50fd01&&_0x50fd01[_0x0282('0x1f')]){switch(_0x50fd01[_0x0282('0x1f')]){case _0x0282('0x20'):var _0x25b09a=require('twilio');if(_0x50fd01[_0x0282('0x21')]&&_0x50fd01[_0x0282('0x22')]&&_0x50fd01['phone']){var _0x2bb7ce=new _0x25b09a(_0x50fd01[_0x0282('0x21')],_0x50fd01[_0x0282('0x22')]);_0x2bb7ce[_0x0282('0x23')][_0x0282('0x24')]({'body':_0x52ceff[_0x0282('0xe')],'to':_0x52ceff['phone'],'from':_0x50fd01[_0x0282('0x25')],'statusCallback':_0x50fd01[_0x0282('0x26')]+_0x0282('0x27')+_0x52ceff['id']+_0x0282('0x28')+_0x50fd01[_0x0282('0x29')]})[_0x0282('0x1e')](function(_0x16a86b){if(_0x16a86b[_0x0282('0x2a')]){return _0x357e73['update']({'messageId':_0x16a86b[_0x0282('0x2a')]});}})[_0x0282('0x19')](function(_0x22143d){logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x20'),util['inspect'](_0x22143d,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x3f679f=_0x0282('0x2d');if(_0x50fd01[_0x0282('0x2e')]&&_0x50fd01['password']){var _0x89d537={'recipient':[_0x52ceff['phone']],'message':_0x52ceff[_0x0282('0xe')],'message_type':_0x50fd01['smsMethod']};if(_0x50fd01[_0x0282('0x2f')]&&_0x50fd01[_0x0282('0x2f')]!=='SI'){_0x89d537[_0x0282('0x30')]=_0x50fd01[_0x0282('0x25')];}var _0x1998ab={'url':_0x3f679f+_0x0282('0x31')+_0x50fd01[_0x0282('0x2e')]+'&password='+_0x50fd01[_0x0282('0x32')],'method':_0x0282('0x33')};rp(_0x1998ab)[_0x0282('0x1e')](function(_0x4d35de){var _0x358b32=_0x4d35de[_0x0282('0x34')](';');var _0x1cae14={'user_key':_0x358b32[0x0],'session_key':_0x358b32[0x1]};_0x1998ab={'url':_0x3f679f+_0x0282('0x35'),'method':_0x0282('0x36'),'headers':{'user_key':_0x1cae14[_0x0282('0x37')],'Session_key':_0x1cae14[_0x0282('0x38')]},'json':!![],'body':_0x89d537};return rp(_0x1998ab);})[_0x0282('0x1e')](function(_0xbda9ab){if(_0xbda9ab['total_sent']>=0x1){var _0xcabdff={'messageId':_0xbda9ab['internal_order_id']};if(_0x50fd01['smsMethod']!=='GP'||!_0x50fd01[_0x0282('0x39')]){_0xcabdff[_0x0282('0x3a')]=!![];}return _0x357e73[_0x0282('0x18')](_0xcabdff);}else{return logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),'skebby',util[_0x0282('0x3b')](_0xbda9ab,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x3fe448){return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),'skebby',util[_0x0282('0x3b')](_0x3fe448,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x3c'),_0x0282('0x3d'));}break;case _0x0282('0x3e'):if(_0x50fd01['authToken']){var _0x549457={'recipient':_0x52ceff[_0x0282('0x25')],'message':_0x52ceff[_0x0282('0xe')],'sender':_0x50fd01['senderString']||_0x50fd01['phone'],'authorization':_0x50fd01[_0x0282('0x22')]};var _0x4f5c56={'method':_0x0282('0x36'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x549457,'json':!![]};rp(_0x4f5c56)[_0x0282('0x1e')](function(_0x292d81){var _0x3763f8={'messageId':_0x292d81[_0x0282('0x3f')]};if(!_0x50fd01[_0x0282('0x39')]){_0x3763f8['read']=!![];}return _0x357e73['update'](_0x3763f8);})[_0x0282('0x19')](function(_0x1e1220){logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x3e'),util[_0x0282('0x3b')](_0x1e1220,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x50fd01[_0x0282('0x2e')]&&_0x50fd01['password']){var _0x549457={'messages':[{'source':_0x0282('0x40'),'to':_0x52ceff[_0x0282('0x25')],'body':_0x52ceff[_0x0282('0xe')],'from':_0x50fd01[_0x0282('0x41')]||_0x50fd01[_0x0282('0x25')]}]};var _0x23cffa=util[_0x0282('0x42')](_0x0282('0x43'),_0x50fd01[_0x0282('0x2e')],_0x50fd01[_0x0282('0x32')]);var _0x4f5c56={'method':_0x0282('0x36'),'uri':_0x0282('0x44'),'body':_0x549457,'headers':{'Authorization':util[_0x0282('0x42')]('Basic\x20%s',new Buffer(_0x23cffa)['toString'](_0x0282('0x45')))},'json':!![]};rp(_0x4f5c56)[_0x0282('0x1e')](function(_0x287e3c){if(_0x287e3c[_0x0282('0x46')]>=0xc8&&_0x287e3c[_0x0282('0x46')]<=0xce){if(_0x287e3c[_0x0282('0x47')]&&_0x287e3c[_0x0282('0x47')][_0x0282('0x48')]>0x0){var _0x36527f=_[_0x0282('0x49')](_0x287e3c['data'][_0x0282('0x23')]);var _0x64d563={'messageId':_0x36527f[_0x0282('0x4a')]};if(!_0x50fd01[_0x0282('0x39')]){_0x64d563['read']=!![];}return _0x357e73[_0x0282('0x18')](_0x64d563);}else{logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x4b'),util[_0x0282('0x3b')](_0x287e3c,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x4b'),util[_0x0282('0x3b')](_0x287e3c,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x135815){logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate',_0x0282('0x4b'),util[_0x0282('0x3b')](_0x135815,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate',_0x0282('0x4b'),_0x0282('0x3d'));}break;case _0x0282('0x4c'):if(_0x50fd01[_0x0282('0x4d')]&&_0x50fd01[_0x0282('0x22')]){var _0x549457={'dst':_0x52ceff['phone'],'text':_0x52ceff[_0x0282('0xe')],'src':_0x50fd01[_0x0282('0x41')]||_0x50fd01[_0x0282('0x25')],'url':_0x50fd01[_0x0282('0x26')]+_0x0282('0x27')+_0x52ceff['id']+'/status?token='+_0x50fd01[_0x0282('0x29')]};var _0x23cffa=util[_0x0282('0x42')](_0x0282('0x43'),_0x50fd01[_0x0282('0x4d')],_0x50fd01[_0x0282('0x22')]);var _0x4f5c56={'method':_0x0282('0x36'),'uri':util[_0x0282('0x42')]('https://api.plivo.com/v1/Account/%s/Message/',_0x50fd01[_0x0282('0x4d')]),'body':_0x549457,'headers':{'Authorization':util[_0x0282('0x42')](_0x0282('0x4e'),new Buffer(_0x23cffa)[_0x0282('0x4f')](_0x0282('0x45')))},'json':!![]};rp(_0x4f5c56)['then'](function(_0x1a7367){var _0xd4c218={'messageId':_0x1a7367['message_uuid'][0x0]};return _0x357e73[_0x0282('0x18')](_0xd4c218);})['catch'](function(_0x595129){logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x4c'),util[_0x0282('0x3b')](_0x595129,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0282('0x4c'),_0x0282('0x50'));}break;case _0x0282('0x51'):if(_0x50fd01['username']&&_0x50fd01[_0x0282('0x32')]){if(_0x50fd01[_0x0282('0x52')]){var _0x2ec81c={'method':_0x0282('0x36'),'uri':_0x50fd01[_0x0282('0x52')]+_0x0282('0x53'),'body':{'username':_0x50fd01['username'],'password':_0x50fd01['password']},'json':!![]};return rp(_0x2ec81c)[_0x0282('0x1e')](function(_0x1797b5){var _0x58c93a={'method':_0x0282('0x36'),'uri':_0x50fd01[_0x0282('0x52')]+_0x0282('0x54'),'body':{'messages':[{'from':_0x50fd01[_0x0282('0x25')],'destinations':[{'to':_0x52ceff[_0x0282('0x25')]}],'text':_0x52ceff[_0x0282('0xe')],'notifyUrl':_0x50fd01['remote']+'/api/sms/messages/'+_0x52ceff['id']+_0x0282('0x28')+_0x50fd01[_0x0282('0x29')],'notifyContentType':_0x0282('0x55'),'callbackData':_0x50fd01['phone']+';'+_0x52ceff[_0x0282('0xe')]}]},'headers':{'Authorization':_0x0282('0x56')+_0x1797b5[_0x0282('0x29')]},'json':!![]};return rp(_0x58c93a)[_0x0282('0x1e')](function(_0x1a9117){if(_0x1a9117['messages']){var _0x293daa={'messageId':_0x1a9117['messages'][0x0][_0x0282('0xd')]};if(!_0x50fd01[_0x0282('0x39')]){_0x293daa['read']=!![];}return _0x357e73['update'](_0x293daa);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x51'),util['inspect'](_0x1a9117,{'showHidden':![],'depth':null}));}});})[_0x0282('0x19')](function(_0x323ab5){return logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0282('0x51'),util[_0x0282('0x3b')](_0x323ab5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate',_0x0282('0x51'),_0x0282('0x3d'));}break;case _0x0282('0x57'):var _0x3a3ea5=require(_0x0282('0x58'));if(_0x50fd01['apiKey']){var _0x179977={};_0x179977[_0x0282('0x59')]=_0x50fd01[_0x0282('0x2e')];_0x179977['phone']=_0x52ceff['phone'];_0x179977['sender']=_0x50fd01['phone'];_0x179977[_0x0282('0x5a')]=_0x52ceff[_0x0282('0xe')];_0x179977['timestamp']=+new Date();var _0x35406d='';var _0x337421='';var _0x16903f=Object[_0x0282('0x5b')](_0x179977);_0x16903f[_0x0282('0x5c')]();for(var _0x10979a=0x0;_0x10979a<_0x16903f[_0x0282('0x5d')];_0x10979a++){if(_0x35406d!=''){_0x35406d+='&';}_0x35406d+=_0x16903f[_0x10979a]+'='+encodeURIComponent(_0x179977[_0x16903f[_0x10979a]]);_0x337421+=_0x179977[_0x16903f[_0x10979a]];}_0x337421+=_0x50fd01[_0x0282('0x5e')];_0x337421=_0x3a3ea5[_0x0282('0x5f')](_0x0282('0x60'))[_0x0282('0x18')](_0x337421)['digest']('hex');if(_0x35406d!==''){_0x35406d+='&';}_0x35406d+='signature='+_0x337421;var _0x1998ab={'method':'GET','uri':_0x50fd01[_0x0282('0x52')]+'/external/get/send.php?'+_0x35406d,'json':!![]};return rp(_0x1998ab)['then'](function(_0x254db8){var _0x52fa8e=Object[_0x0282('0x5b')](_0x254db8);if(_0x254db8[_0x52fa8e[0x0]][_0x0282('0x1a')]&&parseInt(_0x254db8[_0x52fa8e[0x0]]['error'])===0x0){var _0x593d64={'messageId':_0x254db8[_0x52fa8e[0x0]][_0x0282('0x61')]};if(!_0x50fd01[_0x0282('0x39')]){_0x593d64[_0x0282('0x3a')]=!![];}return _0x357e73[_0x0282('0x18')](_0x593d64);}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x57'),util['inspect'](_0x254db8['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e5c4b){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),_0x0282('0x57'),util[_0x0282('0x3b')](_0x1e5c4b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),'csc',_0x0282('0x62'));}break;case'clickatell':if(_0x50fd01[_0x0282('0x5e')]){var _0x4bba5a={'method':_0x0282('0x36'),'uri':_0x0282('0x63'),'headers':{'Authorization':_0x50fd01[_0x0282('0x5e')]},'body':{'content':_0x52ceff['body'],'to':[_0x52ceff['phone']],'from':_0x50fd01[_0x0282('0x25')],'binary':![],'clientMessageId':_0x0282('0x64'),'charset':_0x0282('0x65')},'json':!![]};rp(_0x4bba5a)[_0x0282('0x1e')](function(_0x428b91){if(!_0x428b91[_0x0282('0x1a')]){var _0x2d6f43={'messageId':_0x428b91[_0x0282('0x23')][0x0][_0x0282('0x66')]};if(!_0x50fd01[_0x0282('0x39')]){_0x2d6f43[_0x0282('0x3a')]=!![];}return _0x357e73[_0x0282('0x18')](_0x2d6f43);}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),'clickatell',util['inspect'](_0x428b91[_0x0282('0x1a')],{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x4e8e98){return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x67'),util['inspect'](_0x4e8e98,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x50fd01[_0x0282('0x2e')]&&_0x50fd01[_0x0282('0x32')]){var _0x23cffa=util['format']('%s:%s',_0x50fd01[_0x0282('0x2e')],_0x50fd01[_0x0282('0x32')]);var _0x4f5c56={'method':_0x0282('0x36'),'uri':_0x0282('0x68')+_0x50fd01[_0x0282('0x69')]+_0x0282('0x6a'),'body':{'to':[_0x52ceff[_0x0282('0x25')]],'text':_0x52ceff[_0x0282('0xe')],'from':_0x50fd01['phone'],'applicationId':_0x50fd01[_0x0282('0x6b')]},'headers':{'Authorization':util['format'](_0x0282('0x4e'),new Buffer(_0x23cffa)[_0x0282('0x4f')](_0x0282('0x45')))},'json':!![]};rp(_0x4f5c56)[_0x0282('0x1e')](function(_0x304a30){if(_0x304a30['id']){var _0x11adf1={'messageId':_0x304a30['id']};return _0x357e73['update'](_0x11adf1);}else{logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x6c'),util[_0x0282('0x3b')](_0x304a30,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x176ad8){logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x6c'),util[_0x0282('0x3b')](_0x176ad8,{'showHidden':![],'depth':null}));});}else{logger[_0x0282('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0282('0x2c'),'bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x50fd01[_0x0282('0x5e')]){var _0x5118d3={};var _0x1998ab={'method':_0x0282('0x36'),'uri':_0x0282('0x6d'),'headers':{'Authorization':_0x0282('0x6e')+_0x50fd01[_0x0282('0x5e')],'Content-Type':_0x0282('0x55')},'body':{'from':_0x50fd01[_0x0282('0x25')],'to':_0x52ceff[_0x0282('0x25')],'text':_0x52ceff['body']},'json':!![]};return rp(_0x1998ab)['then'](function(_0x397fb3){if(_0x397fb3[_0x0282('0x6f')]==0xca){_0x5118d3[_0x0282('0x70')]=_0x397fb3;var _0x334a31={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x0282('0x6e')+_0x50fd01['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x5118d3[_0x0282('0x70')]['refid']},'json':!![]};return rp(_0x334a31)[_0x0282('0x1e')](function(_0x456cfa){_0x5118d3[_0x0282('0x71')]=_0x456cfa;var _0x237fb6={'messageId':_0x5118d3[_0x0282('0x70')][_0x0282('0x72')],'read':!![]};return _0x357e73[_0x0282('0x18')](_0x237fb6);});}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x73'),util[_0x0282('0x3b')](_0x397fb3,{'showHidden':![],'depth':null}));}})[_0x0282('0x19')](function(_0x28b873){return logger['error'](_0x0282('0x2b'),_0x0282('0x2c'),_0x0282('0x73'),util[_0x0282('0x3b')](_0x28b873,{'showHidden':![],'depth':null}));});}else{return logger[_0x0282('0x1a')](_0x0282('0x2b'),'afterCreate','intelepeer','Token\x20not\x20received');}break;}}})[_0x0282('0x74')](function(){_0x316bfd();});}else{_0x316bfd();}}},'charset':_0x0282('0x75'),'collate':_0x0282('0x76')});}; \ No newline at end of file +var _0x28e6=['intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','catch','out','find','SmsAccountId','type','twilio','authToken','accountSid','create','phone','remote','/api/sms/messages/','/status?token=','token','update','SmsMessage,\x20%s,\x20%s,\x20%s','username','password','smsMethod','GET','sms','POST','total_sent','internal_order_id','deliveryReport','read','error','afterCreate','skebby','inspect','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','toString','base64','http_code','data','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','infobip','csc','crypto','apiKey','login','sender','text','timestamp','sort','createHash','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth'];(function(_0x9980cb,_0x4579dc){var _0x511557=function(_0xcda812){while(--_0xcda812){_0x9980cb['push'](_0x9980cb['shift']());}};_0x511557(++_0x4579dc);}(_0x28e6,0xf2));var _0x628e=function(_0x638d4a,_0x51b9d0){_0x638d4a=_0x638d4a-0x0;var _0x15ac5a=_0x28e6[_0x638d4a];return _0x15ac5a;};'use strict';var _=require(_0x628e('0x0'));var util=require(_0x628e('0x1'));var logger=require('../../config/logger')(_0x628e('0x2'));var moment=require('moment');var BPromise=require(_0x628e('0x3'));var rp=require(_0x628e('0x4'));var fs=require('fs');var path=require(_0x628e('0x5'));var rimraf=require(_0x628e('0x6'));var config=require(_0x628e('0x7'));var attributes=require(_0x628e('0x8'));module[_0x628e('0x9')]=function(_0x32d9e4,_0x13f6cd){return _0x32d9e4[_0x628e('0xa')](_0x628e('0xb'),attributes,{'tableName':_0x628e('0xc'),'paranoid':![],'indexes':[{'name':_0x628e('0xd'),'fields':[_0x628e('0xd')]},{'name':_0x628e('0xe'),'fields':[_0x628e('0xf')],'type':_0x628e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17c7fb,_0x19912a,_0x53393a){var _0x29eba8=_0x32d9e4[_0x628e('0x11')];var _0x3e6afc=_0x17c7fb[_0x628e('0x12')]({'plain':!![]});if(_0x3e6afc[_0x628e('0x13')][_0x628e('0x14')]()==='in'||_0x3e6afc[_0x628e('0x13')][_0x628e('0x14')]()==='out'&&!_0x3e6afc[_0x628e('0x15')]&&!_[_0x628e('0x16')](_0x3e6afc['UserId'])&&!_[_0x628e('0x16')](_0x3e6afc[_0x628e('0x17')])){_0x29eba8[_0x628e('0x18')][_0x628e('0x19')]({'where':{'id':_0x3e6afc['SmsInteractionId']}})[_0x628e('0x1a')](function(_0x113867){if(_0x113867){_0x113867['update']({'lastMsgAt':_0x3e6afc['createdAt'],'lastMsgDirection':_0x3e6afc['direction'][_0x628e('0x14')]()});}})[_0x628e('0x1b')](function(_0x360ed2){console['error'](_0x360ed2);});}if(_0x3e6afc[_0x628e('0x13')]===_0x628e('0x1c')&&!_0x3e6afc['secret']){var _0x3254d4;_0x29eba8['SmsAccount'][_0x628e('0x1d')]({'where':{'id':_0x3e6afc[_0x628e('0x1e')]},'raw':!![]})[_0x628e('0x1a')](function(_0xe0079c){_0x3254d4=_0xe0079c;if(_0x3254d4&&_0x3254d4[_0x628e('0x1f')]){switch(_0x3254d4[_0x628e('0x1f')]){case _0x628e('0x20'):var _0x3ba04d=require(_0x628e('0x20'));if(_0x3254d4['accountSid']&&_0x3254d4[_0x628e('0x21')]&&_0x3254d4['phone']){var _0x13b226=new _0x3ba04d(_0x3254d4[_0x628e('0x22')],_0x3254d4[_0x628e('0x21')]);_0x13b226['messages'][_0x628e('0x23')]({'body':_0x3e6afc['body'],'to':_0x3e6afc[_0x628e('0x24')],'from':_0x3254d4[_0x628e('0x24')],'statusCallback':_0x3254d4[_0x628e('0x25')]+_0x628e('0x26')+_0x3e6afc['id']+_0x628e('0x27')+_0x3254d4[_0x628e('0x28')]})['then'](function(_0xf2f8d5){if(_0xf2f8d5['sid']){return _0x17c7fb[_0x628e('0x29')]({'messageId':_0xf2f8d5['sid']});}})[_0x628e('0x1b')](function(_0x37367d){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio',util['inspect'](_0x37367d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x628e('0x2a'),'afterCreate',_0x628e('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x2c3643='https://api.skebby.it/API/v1.0/REST/';if(_0x3254d4[_0x628e('0x2b')]&&_0x3254d4[_0x628e('0x2c')]){var _0x3d892f={'recipient':[_0x3e6afc[_0x628e('0x24')]],'message':_0x3e6afc[_0x628e('0xf')],'message_type':_0x3254d4['smsMethod']};if(_0x3254d4['smsMethod']&&_0x3254d4[_0x628e('0x2d')]!=='SI'){_0x3d892f['sender']=_0x3254d4[_0x628e('0x24')];}var _0x2b48c4={'url':_0x2c3643+'login?username='+_0x3254d4[_0x628e('0x2b')]+'&password='+_0x3254d4[_0x628e('0x2c')],'method':_0x628e('0x2e')};rp(_0x2b48c4)[_0x628e('0x1a')](function(_0x9d61da){var _0x264dc7=_0x9d61da['split'](';');var _0xd94351={'user_key':_0x264dc7[0x0],'session_key':_0x264dc7[0x1]};_0x2b48c4={'url':_0x2c3643+_0x628e('0x2f'),'method':_0x628e('0x30'),'headers':{'user_key':_0xd94351['user_key'],'Session_key':_0xd94351['session_key']},'json':!![],'body':_0x3d892f};return rp(_0x2b48c4);})[_0x628e('0x1a')](function(_0x560863){if(_0x560863[_0x628e('0x31')]>=0x1){var _0x2ae1ad={'messageId':_0x560863[_0x628e('0x32')]};if(_0x3254d4[_0x628e('0x2d')]!=='GP'||!_0x3254d4[_0x628e('0x33')]){_0x2ae1ad[_0x628e('0x34')]=!![];}return _0x17c7fb[_0x628e('0x29')](_0x2ae1ad);}else{return logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x37'),util[_0x628e('0x38')](_0x560863,{'showHidden':![],'depth':null}));}})[_0x628e('0x1b')](function(_0x969e46){return logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x37'),util[_0x628e('0x38')](_0x969e46,{'showHidden':![],'depth':null}));});}else{logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0x628e('0x39'):if(_0x3254d4[_0x628e('0x21')]){var _0xd42f03={'recipient':_0x3e6afc[_0x628e('0x24')],'message':_0x3e6afc[_0x628e('0xf')],'sender':_0x3254d4[_0x628e('0x3a')]||_0x3254d4['phone'],'authorization':_0x3254d4[_0x628e('0x21')]};var _0x19912a={'method':_0x628e('0x30'),'uri':_0x628e('0x3b'),'body':_0xd42f03,'json':!![]};rp(_0x19912a)['then'](function(_0x170cc7){var _0x300302={'messageId':_0x170cc7[_0x628e('0x3c')]};if(!_0x3254d4[_0x628e('0x33')]){_0x300302[_0x628e('0x34')]=!![];}return _0x17c7fb[_0x628e('0x29')](_0x300302);})[_0x628e('0x1b')](function(_0x10e362){logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x39'),util[_0x628e('0x38')](_0x10e362,{'showHidden':![],'depth':null}));});}else{logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x39'),_0x628e('0x3d'));}break;case _0x628e('0x3e'):if(_0x3254d4[_0x628e('0x2b')]&&_0x3254d4['password']){var _0xd42f03={'messages':[{'source':'xCALLY\x20Motion','to':_0x3e6afc[_0x628e('0x24')],'body':_0x3e6afc[_0x628e('0xf')],'from':_0x3254d4[_0x628e('0x3a')]||_0x3254d4[_0x628e('0x24')]}]};var _0x348d18=util[_0x628e('0x3f')](_0x628e('0x40'),_0x3254d4[_0x628e('0x2b')],_0x3254d4[_0x628e('0x2c')]);var _0x19912a={'method':_0x628e('0x30'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0xd42f03,'headers':{'Authorization':util[_0x628e('0x3f')]('Basic\x20%s',new Buffer(_0x348d18)[_0x628e('0x41')](_0x628e('0x42')))},'json':!![]};rp(_0x19912a)[_0x628e('0x1a')](function(_0x37f394){if(_0x37f394['http_code']>=0xc8&&_0x37f394[_0x628e('0x43')]<=0xce){if(_0x37f394[_0x628e('0x44')]&&_0x37f394[_0x628e('0x44')]['queued_count']>0x0){var _0x3b8b2c=_[_0x628e('0x45')](_0x37f394[_0x628e('0x44')]['messages']);var _0x273b03={'messageId':_0x3b8b2c['message_id']};if(!_0x3254d4[_0x628e('0x33')]){_0x273b03['read']=!![];}return _0x17c7fb[_0x628e('0x29')](_0x273b03);}else{logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x46'),util['inspect'](_0x37f394,{'showHidden':![],'depth':null}));}}else{logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x46'),util['inspect'](_0x37f394,{'showHidden':![],'depth':null}));}})[_0x628e('0x1b')](function(_0x194f1b){logger[_0x628e('0x35')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x628e('0x46'),util[_0x628e('0x38')](_0x194f1b,{'showHidden':![],'depth':null}));});}else{logger[_0x628e('0x35')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x628e('0x36'),_0x628e('0x46'),_0x628e('0x47'));}break;case _0x628e('0x48'):if(_0x3254d4[_0x628e('0x49')]&&_0x3254d4[_0x628e('0x21')]){var _0xd42f03={'dst':_0x3e6afc['phone'],'text':_0x3e6afc[_0x628e('0xf')],'src':_0x3254d4[_0x628e('0x3a')]||_0x3254d4[_0x628e('0x24')],'url':_0x3254d4[_0x628e('0x25')]+_0x628e('0x26')+_0x3e6afc['id']+_0x628e('0x27')+_0x3254d4[_0x628e('0x28')]};var _0x348d18=util['format'](_0x628e('0x40'),_0x3254d4[_0x628e('0x49')],_0x3254d4[_0x628e('0x21')]);var _0x19912a={'method':_0x628e('0x30'),'uri':util['format'](_0x628e('0x4a'),_0x3254d4[_0x628e('0x49')]),'body':_0xd42f03,'headers':{'Authorization':util[_0x628e('0x3f')](_0x628e('0x4b'),new Buffer(_0x348d18)[_0x628e('0x41')](_0x628e('0x42')))},'json':!![]};rp(_0x19912a)[_0x628e('0x1a')](function(_0x4510d1){var _0x4dade3={'messageId':_0x4510d1[_0x628e('0x4c')][0x0]};return _0x17c7fb[_0x628e('0x29')](_0x4dade3);})['catch'](function(_0x57b54e){logger['error'](_0x628e('0x2a'),'afterCreate',_0x628e('0x48'),util['inspect'](_0x57b54e,{'showHidden':![],'depth':null}));});}else{logger[_0x628e('0x35')](_0x628e('0x2a'),'afterCreate',_0x628e('0x48'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x3254d4['username']&&_0x3254d4[_0x628e('0x2c')]){if(_0x3254d4[_0x628e('0x4d')]){var _0x1e61f9={'method':'POST','uri':_0x3254d4[_0x628e('0x4d')]+_0x628e('0x4e'),'body':{'username':_0x3254d4[_0x628e('0x2b')],'password':_0x3254d4['password']},'json':!![]};return rp(_0x1e61f9)[_0x628e('0x1a')](function(_0x35058e){var _0x5965c2={'method':_0x628e('0x30'),'uri':_0x3254d4[_0x628e('0x4d')]+_0x628e('0x4f'),'body':{'messages':[{'from':_0x3254d4[_0x628e('0x24')],'destinations':[{'to':_0x3e6afc['phone']}],'text':_0x3e6afc[_0x628e('0xf')],'notifyUrl':_0x3254d4[_0x628e('0x25')]+_0x628e('0x26')+_0x3e6afc['id']+_0x628e('0x27')+_0x3254d4[_0x628e('0x28')],'notifyContentType':_0x628e('0x50'),'callbackData':_0x3254d4['phone']+';'+_0x3e6afc[_0x628e('0xf')]}]},'headers':{'Authorization':_0x628e('0x51')+_0x35058e[_0x628e('0x28')]},'json':!![]};return rp(_0x5965c2)[_0x628e('0x1a')](function(_0x51805d){if(_0x51805d[_0x628e('0x52')]){var _0x45235b={'messageId':_0x51805d[_0x628e('0x52')][0x0][_0x628e('0xd')]};if(!_0x3254d4[_0x628e('0x33')]){_0x45235b[_0x628e('0x34')]=!![];}return _0x17c7fb[_0x628e('0x29')](_0x45235b);}else{return logger[_0x628e('0x35')](_0x628e('0x2a'),'afterCreate',_0x628e('0x53'),util[_0x628e('0x38')](_0x51805d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x564f57){return logger['error'](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x53'),util['inspect'](_0x564f57,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x628e('0x36'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x53'),_0x628e('0x47'));}break;case _0x628e('0x54'):var _0x257043=require(_0x628e('0x55'));if(_0x3254d4[_0x628e('0x56')]){var _0x29ec4d={};_0x29ec4d[_0x628e('0x57')]=_0x3254d4['username'];_0x29ec4d['phone']=_0x3e6afc[_0x628e('0x24')];_0x29ec4d[_0x628e('0x58')]=_0x3254d4[_0x628e('0x24')];_0x29ec4d[_0x628e('0x59')]=_0x3e6afc[_0x628e('0xf')];_0x29ec4d[_0x628e('0x5a')]=+new Date();var _0x2ed018='';var _0x1fd6eb='';var _0x2b956b=Object['keys'](_0x29ec4d);_0x2b956b[_0x628e('0x5b')]();for(var _0x148bdb=0x0;_0x148bdb<_0x2b956b['length'];_0x148bdb++){if(_0x2ed018!=''){_0x2ed018+='&';}_0x2ed018+=_0x2b956b[_0x148bdb]+'='+encodeURIComponent(_0x29ec4d[_0x2b956b[_0x148bdb]]);_0x1fd6eb+=_0x29ec4d[_0x2b956b[_0x148bdb]];}_0x1fd6eb+=_0x3254d4['apiKey'];_0x1fd6eb=_0x257043[_0x628e('0x5c')]('md5')['update'](_0x1fd6eb)[_0x628e('0x5d')](_0x628e('0x5e'));if(_0x2ed018!==''){_0x2ed018+='&';}_0x2ed018+=_0x628e('0x5f')+_0x1fd6eb;var _0x2b48c4={'method':_0x628e('0x2e'),'uri':_0x3254d4[_0x628e('0x4d')]+_0x628e('0x60')+_0x2ed018,'json':!![]};return rp(_0x2b48c4)[_0x628e('0x1a')](function(_0x3afbc5){var _0x50d386=Object['keys'](_0x3afbc5);if(_0x3afbc5[_0x50d386[0x0]][_0x628e('0x35')]&&parseInt(_0x3afbc5[_0x50d386[0x0]][_0x628e('0x35')])===0x0){var _0x115aff={'messageId':_0x3afbc5[_0x50d386[0x0]][_0x628e('0x61')]};if(!_0x3254d4[_0x628e('0x33')]){_0x115aff['read']=!![];}return _0x17c7fb['update'](_0x115aff);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x628e('0x36'),'csc',util[_0x628e('0x38')](_0x3afbc5[_0x628e('0x35')],{'showHidden':![],'depth':null}));}})[_0x628e('0x1b')](function(_0x209b12){return logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x54'),util[_0x628e('0x38')](_0x209b12,{'showHidden':![],'depth':null}));});}else{logger[_0x628e('0x35')](_0x628e('0x2a'),'afterCreate',_0x628e('0x54'),_0x628e('0x62'));}break;case'clickatell':if(_0x3254d4['apiKey']){var _0x2a254d={'method':_0x628e('0x30'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3254d4['apiKey']},'body':{'content':_0x3e6afc[_0x628e('0xf')],'to':[_0x3e6afc[_0x628e('0x24')]],'from':_0x3254d4[_0x628e('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0x628e('0x63')},'json':!![]};rp(_0x2a254d)[_0x628e('0x1a')](function(_0x5341df){if(!_0x5341df[_0x628e('0x35')]){var _0x2f7738={'messageId':_0x5341df[_0x628e('0x52')][0x0][_0x628e('0x64')]};if(!_0x3254d4['deliveryReport']){_0x2f7738[_0x628e('0x34')]=!![];}return _0x17c7fb[_0x628e('0x29')](_0x2f7738);}else{return logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x65'),util['inspect'](_0x5341df['error'],{'showHidden':![],'depth':null}));}})[_0x628e('0x1b')](function(_0x5af86e){return logger[_0x628e('0x35')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x628e('0x36'),_0x628e('0x65'),util[_0x628e('0x38')](_0x5af86e,{'showHidden':![],'depth':null}));});}else{logger[_0x628e('0x35')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x628e('0x36'),_0x628e('0x65'),_0x628e('0x62'));}break;case'bandwidth':if(_0x3254d4[_0x628e('0x2b')]&&_0x3254d4[_0x628e('0x2c')]){var _0x348d18=util[_0x628e('0x3f')]('%s:%s',_0x3254d4[_0x628e('0x2b')],_0x3254d4['password']);var _0x19912a={'method':'POST','uri':_0x628e('0x66')+_0x3254d4[_0x628e('0x67')]+_0x628e('0x68'),'body':{'to':[_0x3e6afc[_0x628e('0x24')]],'text':_0x3e6afc[_0x628e('0xf')],'from':_0x3254d4[_0x628e('0x24')],'applicationId':_0x3254d4['applicationId']},'headers':{'Authorization':util[_0x628e('0x3f')](_0x628e('0x4b'),new Buffer(_0x348d18)[_0x628e('0x41')](_0x628e('0x42')))},'json':!![]};rp(_0x19912a)['then'](function(_0x347ed8){if(_0x347ed8['id']){var _0x569d46={'messageId':_0x347ed8['id']};return _0x17c7fb[_0x628e('0x29')](_0x569d46);}else{logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),'bandwidth',util[_0x628e('0x38')](_0x347ed8,{'showHidden':![],'depth':null}));}})[_0x628e('0x1b')](function(_0x55d644){logger['error'](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x69'),util[_0x628e('0x38')](_0x55d644,{'showHidden':![],'depth':null}));});}else{logger[_0x628e('0x35')](_0x628e('0x2a'),_0x628e('0x36'),_0x628e('0x69'),_0x628e('0x47'));}break;case _0x628e('0x6a'):if(_0x3254d4[_0x628e('0x56')]){var _0x141b6c={};var _0x2b48c4={'method':_0x628e('0x30'),'uri':_0x628e('0x6b'),'headers':{'Authorization':_0x628e('0x6c')+_0x3254d4[_0x628e('0x56')],'Content-Type':'application/json'},'body':{'from':_0x3254d4['phone'],'to':_0x3e6afc[_0x628e('0x24')],'text':_0x3e6afc[_0x628e('0xf')]},'json':!![]};return rp(_0x2b48c4)['then'](function(_0x2d4da5){if(_0x2d4da5[_0x628e('0x6d')]==0xca){_0x141b6c['message']=_0x2d4da5;var _0x2cad73={'method':_0x628e('0x30'),'uri':_0x628e('0x6e'),'headers':{'Authorization':_0x628e('0x6c')+_0x3254d4[_0x628e('0x56')],'Content-Type':'application/json'},'body':{'refid':_0x141b6c[_0x628e('0x6f')][_0x628e('0x70')]},'json':!![]};return rp(_0x2cad73)[_0x628e('0x1a')](function(_0x64a0b9){_0x141b6c[_0x628e('0x71')]=_0x64a0b9;var _0x398fa8={'messageId':_0x141b6c['message'][_0x628e('0x70')],'read':!![]};return _0x17c7fb[_0x628e('0x29')](_0x398fa8);});}else{return logger[_0x628e('0x35')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x628e('0x36'),_0x628e('0x6a'),util[_0x628e('0x38')](_0x2d4da5,{'showHidden':![],'depth':null}));}})[_0x628e('0x1b')](function(_0xc26e7b){return logger[_0x628e('0x35')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x628e('0x36'),_0x628e('0x6a'),util['inspect'](_0xc26e7b,{'showHidden':![],'depth':null}));});}else{return logger[_0x628e('0x35')](_0x628e('0x2a'),'afterCreate','intelepeer',_0x628e('0x72'));}break;}}})['finally'](function(){_0x53393a();});}else{_0x53393a();}}},'charset':'utf8mb4','collate':_0x628e('0x73')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index f8d4077..4cdf99b 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 _0xf896=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSmsMessage','SmsMessage','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','request','then'];(function(_0x20f6f3,_0x391d04){var _0x542dc1=function(_0xd0e47c){while(--_0xd0e47c){_0x20f6f3['push'](_0x20f6f3['shift']());}};_0x542dc1(++_0x391d04);}(_0xf896,0x1a7));var _0x6f89=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0xf896[_0x367e5b];return _0x4b909e;};'use strict';var _=require(_0x6f89('0x0'));var util=require('util');var moment=require(_0x6f89('0x1'));var BPromise=require(_0x6f89('0x2'));var rs=require(_0x6f89('0x3'));var fs=require('fs');var Redis=require(_0x6f89('0x4'));var db=require(_0x6f89('0x5'))['db'];var utils=require(_0x6f89('0x6'));var logger=require('../../config/logger')(_0x6f89('0x7'));var config=require(_0x6f89('0x8'));var jayson=require(_0x6f89('0x9'));var client=jayson['client'][_0x6f89('0xa')]({'port':0x232a});config['redis']=_[_0x6f89('0xb')](config['redis'],{'host':_0x6f89('0xc'),'port':0x18eb});var socket=require(_0x6f89('0xd'))(new Redis(config[_0x6f89('0xe')]));require(_0x6f89('0xf'))[_0x6f89('0x10')](socket);function respondWithRpcPromise(_0x38a5b7,_0x5181e8,_0x5dce41){return new BPromise(function(_0x1d35df,_0x2c2b79){return client[_0x6f89('0x11')](_0x38a5b7,_0x5dce41)[_0x6f89('0x12')](function(_0x5a1f51){logger['info'](_0x6f89('0x13'),_0x5181e8,_0x6f89('0x14'));logger[_0x6f89('0x15')](_0x6f89('0x16'),_0x5181e8,_0x6f89('0x14'),JSON[_0x6f89('0x17')](_0x5a1f51));if(_0x5a1f51[_0x6f89('0x18')]){if(_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x19')]===0x1f4){logger[_0x6f89('0x18')](_0x6f89('0x13'),_0x5181e8,_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x1a')]);return _0x2c2b79(_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x1a')]);}logger[_0x6f89('0x18')]('SmsMessage,\x20%s,\x20%s',_0x5181e8,_0x5a1f51['error'][_0x6f89('0x1a')]);return _0x1d35df(_0x5a1f51[_0x6f89('0x18')][_0x6f89('0x1a')]);}else{logger[_0x6f89('0x1b')](_0x6f89('0x13'),_0x5181e8,'request\x20sent');_0x1d35df(_0x5a1f51[_0x6f89('0x1c')][_0x6f89('0x1a')]);}})[_0x6f89('0x1d')](function(_0x20e25e){logger[_0x6f89('0x18')](_0x6f89('0x13'),_0x5181e8,_0x20e25e);_0x2c2b79(_0x20e25e);});});}exports[_0x6f89('0x1e')]=function(_0x15b04c){var _0x550e42=this;return new Promise(function(_0x289922,_0x38bd34){return db[_0x6f89('0x1f')]['create'](_0x15b04c[_0x6f89('0x20')],{'raw':_0x15b04c[_0x6f89('0x21')]?_0x15b04c[_0x6f89('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6f89('0x12')](function(_0x268aea){logger[_0x6f89('0x1b')](_0x6f89('0x1e'),_0x15b04c);logger[_0x6f89('0x15')](_0x6f89('0x1e'),_0x15b04c,JSON['stringify'](_0x268aea));_0x289922(_0x268aea);})[_0x6f89('0x1d')](function(_0x33f5ab){logger['error']('CreateSmsMessage',_0x33f5ab[_0x6f89('0x1a')],_0x15b04c);_0x38bd34(_0x550e42[_0x6f89('0x18')](0x1f4,_0x33f5ab[_0x6f89('0x1a')]));});});}; \ No newline at end of file +var _0x787e=['message','info','catch','CreateSmsMessage','SmsMessage','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsMessage.socket','register','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsMessage,\x20%s,\x20%s'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x787e,0x11f));var _0xe787=function(_0x26d241,_0xc598af){_0x26d241=_0x26d241-0x0;var _0x1f1385=_0x787e[_0x26d241];return _0x1f1385;};'use strict';var _=require(_0xe787('0x0'));var util=require(_0xe787('0x1'));var moment=require(_0xe787('0x2'));var BPromise=require(_0xe787('0x3'));var rs=require(_0xe787('0x4'));var fs=require('fs');var Redis=require(_0xe787('0x5'));var db=require(_0xe787('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe787('0x7'));var config=require(_0xe787('0x8'));var jayson=require(_0xe787('0x9'));var client=jayson['client'][_0xe787('0xa')]({'port':0x232a});config[_0xe787('0xb')]=_[_0xe787('0xc')](config[_0xe787('0xb')],{'host':_0xe787('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe787('0xb')]));require(_0xe787('0xe'))[_0xe787('0xf')](socket);function respondWithRpcPromise(_0x398a02,_0x5688b9,_0x3e578b){return new BPromise(function(_0x59ca64,_0x1a58e6){return client['request'](_0x398a02,_0x3e578b)['then'](function(_0x242108){logger['info']('SmsMessage,\x20%s,\x20%s',_0x5688b9,'request\x20sent');logger['debug'](_0xe787('0x10'),_0x5688b9,_0xe787('0x11'),JSON[_0xe787('0x12')](_0x242108));if(_0x242108[_0xe787('0x13')]){if(_0x242108[_0xe787('0x13')]['code']===0x1f4){logger[_0xe787('0x13')](_0xe787('0x14'),_0x5688b9,_0x242108[_0xe787('0x13')]['message']);return _0x1a58e6(_0x242108[_0xe787('0x13')][_0xe787('0x15')]);}logger[_0xe787('0x13')]('SmsMessage,\x20%s,\x20%s',_0x5688b9,_0x242108[_0xe787('0x13')]['message']);return _0x59ca64(_0x242108[_0xe787('0x13')][_0xe787('0x15')]);}else{logger[_0xe787('0x16')](_0xe787('0x14'),_0x5688b9,_0xe787('0x11'));_0x59ca64(_0x242108['result']['message']);}})[_0xe787('0x17')](function(_0x2772a6){logger[_0xe787('0x13')](_0xe787('0x14'),_0x5688b9,_0x2772a6);_0x1a58e6(_0x2772a6);});});}exports[_0xe787('0x18')]=function(_0x514b78){var _0x5e7c64=this;return new Promise(function(_0x39ae6b,_0xca8492){return db[_0xe787('0x19')]['create'](_0x514b78['body'],{'raw':_0x514b78['options']?_0x514b78['options']['raw']===undefined?!![]:![]:!![]})[_0xe787('0x1a')](function(_0x313098){logger[_0xe787('0x16')](_0xe787('0x18'),_0x514b78);logger[_0xe787('0x1b')](_0xe787('0x18'),_0x514b78,JSON[_0xe787('0x12')](_0x313098));_0x39ae6b(_0x313098);})['catch'](function(_0x9e18c6){logger[_0xe787('0x13')](_0xe787('0x18'),_0x9e18c6[_0xe787('0x15')],_0x514b78);_0xca8492(_0x5e7c64[_0xe787('0x13')](0x1f4,_0x9e18c6[_0xe787('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4d83aa6..6e8d7ab 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 _0x966f=['smsMessage:','save','remove','update','emit','removeListener','register','length'];(function(_0x5a0bba,_0x4637dd){var _0x34efe9=function(_0x32b950){while(--_0x32b950){_0x5a0bba['push'](_0x5a0bba['shift']());}};_0x34efe9(++_0x4637dd);}(_0x966f,0xf9));var _0xf966=function(_0x41e2de,_0x74fec7){_0x41e2de=_0x41e2de-0x0;var _0x3717ff=_0x966f[_0x41e2de];return _0x3717ff;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xf966('0x0'),_0xf966('0x1'),_0xf966('0x2')];function createListener(_0x4d7ee1,_0x13a21d){return function(_0x3bb990){_0x13a21d[_0xf966('0x3')](_0x4d7ee1,_0x3bb990);};}function removeListener(_0x118213,_0x5057df){return function(){SmsMessageEvents[_0xf966('0x4')](_0x118213,_0x5057df);};}exports[_0xf966('0x5')]=function(_0x58b353){for(var _0x240f04=0x0,_0x2bd817=events[_0xf966('0x6')];_0x240f04<_0x2bd817;_0x240f04++){var _0xafe05b=events[_0x240f04];var _0x5487da=createListener(_0xf966('0x7')+_0xafe05b,_0x58b353);SmsMessageEvents['on'](_0xafe05b,_0x5487da);}}; \ No newline at end of file +var _0x7679=['length','smsMessage:','./smsMessage.events','save','remove','update','emit','register'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0x7679,0x1b2));var _0x9767=function(_0x2dc0d4,_0x9e84da){_0x2dc0d4=_0x2dc0d4-0x0;var _0x997a9c=_0x7679[_0x2dc0d4];return _0x997a9c;};'use strict';var SmsMessageEvents=require(_0x9767('0x0'));var events=[_0x9767('0x1'),_0x9767('0x2'),_0x9767('0x3')];function createListener(_0x46d2c0,_0x243949){return function(_0x2a99b8){_0x243949[_0x9767('0x4')](_0x46d2c0,_0x2a99b8);};}function removeListener(_0x5750a8,_0x5768a1){return function(){SmsMessageEvents['removeListener'](_0x5750a8,_0x5768a1);};}exports[_0x9767('0x5')]=function(_0x30fe07){for(var _0x37454b=0x0,_0x2cfbbf=events[_0x9767('0x6')];_0x37454b<_0x2cfbbf;_0x37454b++){var _0x140266=events[_0x37454b];var _0x53c485=createListener(_0x9767('0x7')+_0x140266,_0x30fe07);SmsMessageEvents['on'](_0x140266,_0x53c485);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index fb7d157..45ee518 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 _0xd7b8=['create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x16c9c5,_0x403b16){var _0x378a9c=function(_0x2b3dbc){while(--_0x2b3dbc){_0x16c9c5['push'](_0x16c9c5['shift']());}};_0x378a9c(++_0x403b16);}(_0xd7b8,0x102));var _0x8d7b=function(_0x54f91f,_0x101a1f){_0x54f91f=_0x54f91f-0x0;var _0x24ea71=_0xd7b8[_0x54f91f];return _0x24ea71;};'use strict';var multer=require(_0x8d7b('0x0'));var util=require(_0x8d7b('0x1'));var path=require('path');var timeout=require(_0x8d7b('0x2'));var express=require(_0x8d7b('0x3'));var router=express[_0x8d7b('0x4')]();var fs_extra=require(_0x8d7b('0x5'));var auth=require(_0x8d7b('0x6'));var interaction=require(_0x8d7b('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x8d7b('0x8')]('/',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0xa')]);router[_0x8d7b('0x8')](_0x8d7b('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8d7b('0x8')](_0x8d7b('0xc'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0xd')]);router[_0x8d7b('0x8')](_0x8d7b('0xe'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0xf')]);router[_0x8d7b('0x8')](_0x8d7b('0x10'),auth['isAuthenticated'](),controller[_0x8d7b('0x11')]);router[_0x8d7b('0x8')](_0x8d7b('0x12'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x13')]);router[_0x8d7b('0x14')]('/',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x15')]);router[_0x8d7b('0x14')]('/:id/teams',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x16')]);router[_0x8d7b('0x14')](_0x8d7b('0x12'),auth['isAuthenticated'](),controller[_0x8d7b('0x17')]);router[_0x8d7b('0x18')](_0x8d7b('0xc'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x19')]);router['delete']('/:id',auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x1a')]);router[_0x8d7b('0x1b')](_0x8d7b('0x10'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x1c')]);router[_0x8d7b('0x1b')](_0x8d7b('0x12'),auth[_0x8d7b('0x9')](),controller[_0x8d7b('0x1d')]);module[_0x8d7b('0x1e')]=router; \ No newline at end of file +var _0x4a0f=['/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members'];(function(_0x22bfc1,_0x235e2b){var _0x19abe8=function(_0x2f7e56){while(--_0x2f7e56){_0x22bfc1['push'](_0x22bfc1['shift']());}};_0x19abe8(++_0x235e2b);}(_0x4a0f,0x191));var _0xf4a0=function(_0x25b943,_0x561f21){_0x25b943=_0x25b943-0x0;var _0xd315ad=_0x4a0f[_0x25b943];return _0xd315ad;};'use strict';var multer=require(_0xf4a0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf4a0('0x1'));var express=require(_0xf4a0('0x2'));var router=express[_0xf4a0('0x3')]();var fs_extra=require(_0xf4a0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf4a0('0x5'));var controller=require(_0xf4a0('0x6'));router[_0xf4a0('0x7')]('/',auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x9')]);router[_0xf4a0('0x7')](_0xf4a0('0xa'),auth[_0xf4a0('0x8')](),controller[_0xf4a0('0xb')]);router[_0xf4a0('0x7')](_0xf4a0('0xc'),auth[_0xf4a0('0x8')](),controller[_0xf4a0('0xd')]);router[_0xf4a0('0x7')](_0xf4a0('0xe'),auth[_0xf4a0('0x8')](),controller['getMembers']);router[_0xf4a0('0x7')](_0xf4a0('0xf'),auth['isAuthenticated'](),controller[_0xf4a0('0x10')]);router['get'](_0xf4a0('0x11'),auth[_0xf4a0('0x8')](),controller['getAgents']);router[_0xf4a0('0x12')]('/',auth[_0xf4a0('0x8')](),controller['create']);router[_0xf4a0('0x12')](_0xf4a0('0xf'),auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x13')]);router['post'](_0xf4a0('0x11'),auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x14')]);router['put'](_0xf4a0('0xc'),auth['isAuthenticated'](),controller[_0xf4a0('0x15')]);router[_0xf4a0('0x16')](_0xf4a0('0xc'),auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x17')]);router[_0xf4a0('0x16')]('/:id/teams',auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x18')]);router[_0xf4a0('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xf4a0('0x19')]);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 3231b50..c86885a 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 _0x1179=['beepall','roundrobin','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x196bab,_0x4f5a09){var _0x24d802=function(_0x451764){while(--_0x451764){_0x196bab['push'](_0x196bab['shift']());}};_0x24d802(++_0x4f5a09);}(_0x1179,0xdb));var _0x9117=function(_0x43c363,_0x16c2e1){_0x43c363=_0x43c363-0x0;var _0xf102f2=_0x1179[_0x43c363];return _0xf102f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9117('0x0')],'unique':_0x9117('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9117('0x0')]},'timeout':{'type':Sequelize[_0x9117('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9117('0x3')](_0x9117('0x4'),_0x9117('0x5'),_0x9117('0x6'))}}; \ No newline at end of file +var _0x0cef=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0xf48e50,_0x2431d4){var _0x19c779=function(_0xe19450){while(--_0xe19450){_0xf48e50['push'](_0xf48e50['shift']());}};_0x19c779(++_0x2431d4);}(_0x0cef,0x1ef));var _0xf0ce=function(_0x36d1c1,_0x4e6866){_0x36d1c1=_0x36d1c1-0x0;var _0x19883d=_0x0cef[_0x36d1c1];return _0x19883d;};'use strict';var Sequelize=require(_0xf0ce('0x0'));module[_0xf0ce('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf0ce('0x2')]},'timeout':{'type':Sequelize[_0xf0ce('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf0ce('0x4')](_0xf0ce('0x5'),'beepall',_0xf0ce('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 9846ccd..d851119 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(_0x5b574d,_0x387fa0){var _0x13359f=function(_0x107824){while(--_0x107824){_0x5b574d['push'](_0x5b574d['shift']());}};_0x13359f(++_0x387fa0);}(_0x7a54,0x106));var _0x47a5=function(_0x2ddb1a,_0x17601d){_0x2ddb1a=_0x2ddb1a-0x0;var _0x599067=_0x7a54[_0x2ddb1a];return _0x599067;};'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 _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(_0x34c607,_0x1394ee){var _0x310707=function(_0x23cab5){while(--_0x23cab5){_0x34c607['push'](_0x34c607['shift']());}};_0x310707(++_0x1394ee);}(_0x7a54,0x106));var _0x47a5=function(_0x37badf,_0x309429){_0x37badf=_0x37badf-0x0;var _0x4ec9e6=_0x7a54[_0x37badf];return _0x4ec9e6;};'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 diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 1794c80..157fdf8 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 _0x707b=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5d267f,_0x5a5900){var _0x526a72=function(_0x3a99cf){while(--_0x3a99cf){_0x5d267f['push'](_0x5d267f['shift']());}};_0x526a72(++_0x5a5900);}(_0x707b,0xfc));var _0xb707=function(_0x17788a,_0x150887){_0x17788a=_0x17788a-0x0;var _0x33f47c=_0x707b[_0x17788a];return _0x33f47c;};'use strict';var EventEmitter=require(_0xb707('0x0'));var SmsQueue=require(_0xb707('0x1'))['db'][_0xb707('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb707('0x3')](0x0);var events={'afterCreate':_0xb707('0x4'),'afterUpdate':_0xb707('0x5'),'afterDestroy':_0xb707('0x6')};function emitEvent(_0x23b64e){return function(_0x4d3c64,_0x47e908,_0x210299){SmsQueueEvents[_0xb707('0x7')](_0x23b64e+':'+_0x4d3c64['id'],_0x4d3c64);SmsQueueEvents[_0xb707('0x7')](_0x23b64e,_0x4d3c64);_0x210299(null);};}for(var e in events){if(events[_0xb707('0x8')](e)){var event=events[e];SmsQueue[_0xb707('0x9')](e,emitEvent(event));}}module[_0xb707('0xa')]=SmsQueueEvents; \ No newline at end of file +var _0x5952=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x10a212,_0x579d85){var _0x23c82b=function(_0x412ea9){while(--_0x412ea9){_0x10a212['push'](_0x10a212['shift']());}};_0x23c82b(++_0x579d85);}(_0x5952,0x1b0));var _0x2595=function(_0x4f3719,_0x1e2dff){_0x4f3719=_0x4f3719-0x0;var _0x51ecfa=_0x5952[_0x4f3719];return _0x51ecfa;};'use strict';var EventEmitter=require(_0x2595('0x0'));var SmsQueue=require(_0x2595('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2595('0x2')](0x0);var events={'afterCreate':_0x2595('0x3'),'afterUpdate':_0x2595('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d9a04){return function(_0x2267b7,_0x11430c,_0x76dae2){SmsQueueEvents[_0x2595('0x5')](_0x1d9a04+':'+_0x2267b7['id'],_0x2267b7);SmsQueueEvents[_0x2595('0x5')](_0x1d9a04,_0x2267b7);_0x76dae2(null);};}for(var e in events){if(events[_0x2595('0x6')](e)){var event=events[e];SmsQueue[_0x2595('0x7')](e,emitEvent(event));}}module[_0x2595('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 779f908..6950ac4 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 _0xd716=['SmsQueue','sms_queues','lodash','util','../../config/logger','bluebird','request-promise','rimraf','./smsQueue.attributes','exports','define'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xd716,0x70));var _0x6d71=function(_0xa1e7d7,_0x5714bb){_0xa1e7d7=_0xa1e7d7-0x0;var _0x287bee=_0xd716[_0xa1e7d7];return _0x287bee;};'use strict';var _=require(_0x6d71('0x0'));var util=require(_0x6d71('0x1'));var logger=require(_0x6d71('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6d71('0x3'));var rp=require(_0x6d71('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d71('0x5'));var config=require('../../config/environment');var attributes=require(_0x6d71('0x6'));module[_0x6d71('0x7')]=function(_0x5fae21,_0x2b7d9e){return _0x5fae21[_0x6d71('0x8')](_0x6d71('0x9'),attributes,{'tableName':_0x6d71('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b67=['define','SmsQueue','sms_queues','util','moment','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x564e00,_0x23d1c5){var _0x437fb5=function(_0x2c10b5){while(--_0x2c10b5){_0x564e00['push'](_0x564e00['shift']());}};_0x437fb5(++_0x23d1c5);}(_0x7b67,0xab));var _0x77b6=function(_0x1e33de,_0x452628){_0x1e33de=_0x1e33de-0x0;var _0x15114e=_0x7b67[_0x1e33de];return _0x15114e;};'use strict';var _=require('lodash');var util=require(_0x77b6('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x77b6('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x77b6('0x2'));var config=require(_0x77b6('0x3'));var attributes=require(_0x77b6('0x4'));module['exports']=function(_0x234f1d,_0x934640){return _0x234f1d[_0x77b6('0x5')](_0x77b6('0x6'),attributes,{'tableName':_0x77b6('0x7'),'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 422d916..0d85759 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 _0x188f=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSmsQueue','findAll','options','raw','where','limit','map','include','attributes','model','ShowSmsQueue','find','then','util','moment','bluebird','randomstring'];(function(_0x5d23f3,_0x5d5549){var _0x1c38b8=function(_0x9c1038){while(--_0x9c1038){_0x5d23f3['push'](_0x5d23f3['shift']());}};_0x1c38b8(++_0x5d5549);}(_0x188f,0x196));var _0xf188=function(_0x3db945,_0x1aee62){_0x3db945=_0x3db945-0x0;var _0x924490=_0x188f[_0x3db945];return _0x924490;};'use strict';var _=require('lodash');var util=require(_0xf188('0x0'));var moment=require(_0xf188('0x1'));var BPromise=require(_0xf188('0x2'));var rs=require(_0xf188('0x3'));var fs=require('fs');var Redis=require(_0xf188('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf188('0x5'));var logger=require(_0xf188('0x6'))(_0xf188('0x7'));var config=require(_0xf188('0x8'));var jayson=require(_0xf188('0x9'));var client=jayson[_0xf188('0xa')]['http']({'port':0x232a});config[_0xf188('0xb')]=_[_0xf188('0xc')](config[_0xf188('0xb')],{'host':_0xf188('0xd'),'port':0x18eb});var socket=require(_0xf188('0xe'))(new Redis(config[_0xf188('0xb')]));require('./smsQueue.socket')[_0xf188('0xf')](socket);function respondWithRpcPromise(_0x156889,_0x49de50,_0x3c7187){return new BPromise(function(_0x583deb,_0x3fd050){return client[_0xf188('0x10')](_0x156889,_0x3c7187)['then'](function(_0xde1f28){logger['info'](_0xf188('0x11'),_0x49de50,'request\x20sent');logger[_0xf188('0x12')](_0xf188('0x13'),_0x49de50,_0xf188('0x14'),JSON[_0xf188('0x15')](_0xde1f28));if(_0xde1f28['error']){if(_0xde1f28[_0xf188('0x16')][_0xf188('0x17')]===0x1f4){logger[_0xf188('0x16')](_0xf188('0x11'),_0x49de50,_0xde1f28[_0xf188('0x16')][_0xf188('0x18')]);return _0x3fd050(_0xde1f28[_0xf188('0x16')][_0xf188('0x18')]);}logger['error'](_0xf188('0x11'),_0x49de50,_0xde1f28['error']['message']);return _0x583deb(_0xde1f28['error'][_0xf188('0x18')]);}else{logger[_0xf188('0x19')]('SmsQueue,\x20%s,\x20%s',_0x49de50,'request\x20sent');_0x583deb(_0xde1f28[_0xf188('0x1a')][_0xf188('0x18')]);}})[_0xf188('0x1b')](function(_0x14b0df){logger[_0xf188('0x16')](_0xf188('0x11'),_0x49de50,_0x14b0df);_0x3fd050(_0x14b0df);});});}exports[_0xf188('0x1c')]=function(_0x40269f){var _0xf63f49=this;return new Promise(function(_0x5937d5,_0x16b5f3){return db['SmsQueue'][_0xf188('0x1d')]({'raw':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')][_0xf188('0x1f')]===undefined?!![]:![]:!![],'where':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')][_0xf188('0x20')]||null:null,'attributes':_0x40269f[_0xf188('0x1e')]?_0x40269f['options']['attributes']||null:null,'limit':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')][_0xf188('0x21')]||null:null,'include':_0x40269f[_0xf188('0x1e')]?_0x40269f[_0xf188('0x1e')]['include']?_[_0xf188('0x22')](_0x40269f[_0xf188('0x1e')][_0xf188('0x23')],function(_0x100eca){return{'model':db[_0x100eca['model']],'as':_0x100eca['as'],'attributes':_0x100eca[_0xf188('0x24')],'include':_0x100eca[_0xf188('0x23')]?_['map'](_0x100eca[_0xf188('0x23')],function(_0x59204b){return{'model':db[_0x59204b['model']],'as':_0x59204b['as'],'attributes':_0x59204b[_0xf188('0x24')],'include':_0x59204b[_0xf188('0x23')]?_['map'](_0x59204b[_0xf188('0x23')],function(_0x48912b){return{'model':db[_0x48912b[_0xf188('0x25')]],'as':_0x48912b['as'],'attributes':_0x48912b[_0xf188('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x587642){logger[_0xf188('0x19')](_0xf188('0x1c'),_0x40269f);logger['debug'](_0xf188('0x1c'),_0x40269f,JSON[_0xf188('0x15')](_0x587642));_0x5937d5(_0x587642);})[_0xf188('0x1b')](function(_0x5096c7){logger['error'](_0xf188('0x1c'),_0x5096c7[_0xf188('0x18')],_0x40269f);_0x16b5f3(_0xf63f49['error'](0x1f4,_0x5096c7[_0xf188('0x18')]));});});};exports[_0xf188('0x26')]=function(_0x4050bd){var _0x4a559a=this;return new Promise(function(_0x25f658,_0x5f292d){return db['SmsQueue'][_0xf188('0x27')]({'raw':_0x4050bd[_0xf188('0x1e')]?_0x4050bd[_0xf188('0x1e')][_0xf188('0x1f')]===undefined?!![]:![]:!![],'where':_0x4050bd[_0xf188('0x1e')]?_0x4050bd['options'][_0xf188('0x20')]||null:null,'attributes':_0x4050bd[_0xf188('0x1e')]?_0x4050bd[_0xf188('0x1e')][_0xf188('0x24')]||null:null,'include':_0x4050bd[_0xf188('0x1e')]?_0x4050bd[_0xf188('0x1e')][_0xf188('0x23')]?_[_0xf188('0x22')](_0x4050bd[_0xf188('0x1e')][_0xf188('0x23')],function(_0x39e157){return{'model':db[_0x39e157[_0xf188('0x25')]],'as':_0x39e157['as'],'attributes':_0x39e157[_0xf188('0x24')],'include':_0x39e157[_0xf188('0x23')]?_['map'](_0x39e157[_0xf188('0x23')],function(_0x2d6ada){return{'model':db[_0x2d6ada['model']],'as':_0x2d6ada['as'],'attributes':_0x2d6ada['attributes'],'include':_0x2d6ada[_0xf188('0x23')]?_[_0xf188('0x22')](_0x2d6ada[_0xf188('0x23')],function(_0x124ad4){return{'model':db[_0x124ad4[_0xf188('0x25')]],'as':_0x124ad4['as'],'attributes':_0x124ad4[_0xf188('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf188('0x28')](function(_0x16be8b){logger[_0xf188('0x19')]('ShowSmsQueue',_0x4050bd);logger[_0xf188('0x12')](_0xf188('0x26'),_0x4050bd,JSON['stringify'](_0x16be8b));_0x25f658(_0x16be8b);})[_0xf188('0x1b')](function(_0x402f12){logger[_0xf188('0x16')]('ShowSmsQueue',_0x402f12[_0xf188('0x18')],_0x4050bd);_0x5f292d(_0x4a559a['error'](0x1f4,_0x402f12[_0xf188('0x18')]));});});}; \ No newline at end of file +var _0xeaef=['SmsQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowSmsQueue','find','where','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue'];(function(_0x2a8841,_0x355633){var _0x164f64=function(_0x5f29e2){while(--_0x5f29e2){_0x2a8841['push'](_0x2a8841['shift']());}};_0x164f64(++_0x355633);}(_0xeaef,0xfe));var _0xfeae=function(_0x19e71c,_0x237f22){_0x19e71c=_0x19e71c-0x0;var _0x1791a3=_0xeaef[_0x19e71c];return _0x1791a3;};'use strict';var _=require(_0xfeae('0x0'));var util=require('util');var moment=require(_0xfeae('0x1'));var BPromise=require('bluebird');var rs=require(_0xfeae('0x2'));var fs=require('fs');var Redis=require(_0xfeae('0x3'));var db=require(_0xfeae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfeae('0x5'))(_0xfeae('0x6'));var config=require(_0xfeae('0x7'));var jayson=require(_0xfeae('0x8'));var client=jayson[_0xfeae('0x9')][_0xfeae('0xa')]({'port':0x232a});config[_0xfeae('0xb')]=_[_0xfeae('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfeae('0xb')]));require('./smsQueue.socket')[_0xfeae('0xd')](socket);function respondWithRpcPromise(_0x46f4b6,_0x4d27f4,_0xc9ee55){return new BPromise(function(_0x11be3a,_0xcd8486){return client[_0xfeae('0xe')](_0x46f4b6,_0xc9ee55)[_0xfeae('0xf')](function(_0x299986){logger['info']('SmsQueue,\x20%s,\x20%s',_0x4d27f4,_0xfeae('0x10'));logger['debug'](_0xfeae('0x11'),_0x4d27f4,_0xfeae('0x10'),JSON['stringify'](_0x299986));if(_0x299986[_0xfeae('0x12')]){if(_0x299986['error'][_0xfeae('0x13')]===0x1f4){logger[_0xfeae('0x12')](_0xfeae('0x14'),_0x4d27f4,_0x299986[_0xfeae('0x12')]['message']);return _0xcd8486(_0x299986['error'][_0xfeae('0x15')]);}logger[_0xfeae('0x12')]('SmsQueue,\x20%s,\x20%s',_0x4d27f4,_0x299986[_0xfeae('0x12')][_0xfeae('0x15')]);return _0x11be3a(_0x299986[_0xfeae('0x12')][_0xfeae('0x15')]);}else{logger[_0xfeae('0x16')](_0xfeae('0x14'),_0x4d27f4,'request\x20sent');_0x11be3a(_0x299986[_0xfeae('0x17')][_0xfeae('0x15')]);}})[_0xfeae('0x18')](function(_0x17bbd0){logger['error'](_0xfeae('0x14'),_0x4d27f4,_0x17bbd0);_0xcd8486(_0x17bbd0);});});}exports[_0xfeae('0x19')]=function(_0x24d820){var _0x9b6230=this;return new Promise(function(_0x51ca0e,_0x3ddc56){return db[_0xfeae('0x1a')][_0xfeae('0x1b')]({'raw':_0x24d820[_0xfeae('0x1c')]?_0x24d820['options'][_0xfeae('0x1d')]===undefined?!![]:![]:!![],'where':_0x24d820[_0xfeae('0x1c')]?_0x24d820[_0xfeae('0x1c')]['where']||null:null,'attributes':_0x24d820['options']?_0x24d820[_0xfeae('0x1c')][_0xfeae('0x1e')]||null:null,'limit':_0x24d820[_0xfeae('0x1c')]?_0x24d820[_0xfeae('0x1c')][_0xfeae('0x1f')]||null:null,'include':_0x24d820['options']?_0x24d820[_0xfeae('0x1c')][_0xfeae('0x20')]?_[_0xfeae('0x21')](_0x24d820[_0xfeae('0x1c')][_0xfeae('0x20')],function(_0x906681){return{'model':db[_0x906681['model']],'as':_0x906681['as'],'attributes':_0x906681['attributes'],'include':_0x906681[_0xfeae('0x20')]?_['map'](_0x906681[_0xfeae('0x20')],function(_0x26118d){return{'model':db[_0x26118d['model']],'as':_0x26118d['as'],'attributes':_0x26118d[_0xfeae('0x1e')],'include':_0x26118d[_0xfeae('0x20')]?_[_0xfeae('0x21')](_0x26118d['include'],function(_0x3d92bb){return{'model':db[_0x3d92bb[_0xfeae('0x22')]],'as':_0x3d92bb['as'],'attributes':_0x3d92bb['attributes']};}):[]};}):[]};}):[]:[]})[_0xfeae('0xf')](function(_0x19df1b){logger[_0xfeae('0x16')](_0xfeae('0x19'),_0x24d820);logger[_0xfeae('0x23')](_0xfeae('0x19'),_0x24d820,JSON['stringify'](_0x19df1b));_0x51ca0e(_0x19df1b);})['catch'](function(_0x42baaa){logger[_0xfeae('0x12')](_0xfeae('0x19'),_0x42baaa[_0xfeae('0x15')],_0x24d820);_0x3ddc56(_0x9b6230['error'](0x1f4,_0x42baaa[_0xfeae('0x15')]));});});};exports[_0xfeae('0x24')]=function(_0x15e9b6){var _0x2d19a9=this;return new Promise(function(_0x693add,_0x12fc4b){return db[_0xfeae('0x1a')][_0xfeae('0x25')]({'raw':_0x15e9b6[_0xfeae('0x1c')]?_0x15e9b6['options']['raw']===undefined?!![]:![]:!![],'where':_0x15e9b6['options']?_0x15e9b6[_0xfeae('0x1c')][_0xfeae('0x26')]||null:null,'attributes':_0x15e9b6[_0xfeae('0x1c')]?_0x15e9b6[_0xfeae('0x1c')][_0xfeae('0x1e')]||null:null,'include':_0x15e9b6['options']?_0x15e9b6['options'][_0xfeae('0x20')]?_[_0xfeae('0x21')](_0x15e9b6['options'][_0xfeae('0x20')],function(_0x588425){return{'model':db[_0x588425[_0xfeae('0x22')]],'as':_0x588425['as'],'attributes':_0x588425[_0xfeae('0x1e')],'include':_0x588425[_0xfeae('0x20')]?_[_0xfeae('0x21')](_0x588425[_0xfeae('0x20')],function(_0x498490){return{'model':db[_0x498490[_0xfeae('0x22')]],'as':_0x498490['as'],'attributes':_0x498490['attributes'],'include':_0x498490[_0xfeae('0x20')]?_[_0xfeae('0x21')](_0x498490['include'],function(_0x1bd93d){return{'model':db[_0x1bd93d['model']],'as':_0x1bd93d['as'],'attributes':_0x1bd93d[_0xfeae('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xfeae('0xf')](function(_0x3089ec){logger['info'](_0xfeae('0x24'),_0x15e9b6);logger[_0xfeae('0x23')]('ShowSmsQueue',_0x15e9b6,JSON[_0xfeae('0x27')](_0x3089ec));_0x693add(_0x3089ec);})[_0xfeae('0x18')](function(_0x22cae3){logger[_0xfeae('0x12')](_0xfeae('0x24'),_0x22cae3[_0xfeae('0x15')],_0x15e9b6);_0x12fc4b(_0x2d19a9[_0xfeae('0x12')](0x1f4,_0x22cae3['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index eea24aa..a95ec28 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 _0xf44f=['length','save','remove','update','emit','removeListener'];(function(_0x442aea,_0xd03adb){var _0x45a2a5=function(_0x39ab0c){while(--_0x39ab0c){_0x442aea['push'](_0x442aea['shift']());}};_0x45a2a5(++_0xd03adb);}(_0xf44f,0x1a5));var _0xff44=function(_0x39662d,_0x20f4b2){_0x39662d=_0x39662d-0x0;var _0x30ab20=_0xf44f[_0x39662d];return _0x30ab20;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xff44('0x0'),_0xff44('0x1'),_0xff44('0x2')];function createListener(_0x4d60d9,_0x1c540f){return function(_0x2543da){_0x1c540f[_0xff44('0x3')](_0x4d60d9,_0x2543da);};}function removeListener(_0x293a66,_0x107d2d){return function(){SmsQueueEvents[_0xff44('0x4')](_0x293a66,_0x107d2d);};}exports['register']=function(_0x4e54f0){for(var _0x32d683=0x0,_0x1aebca=events[_0xff44('0x5')];_0x32d683<_0x1aebca;_0x32d683++){var _0x388211=events[_0x32d683];var _0x6c03e0=createListener('smsQueue:'+_0x388211,_0x4e54f0);SmsQueueEvents['on'](_0x388211,_0x6c03e0);}}; \ No newline at end of file +var _0x7b36=['emit','removeListener','register','length','smsQueue:','./smsQueue.events','remove','update'];(function(_0x4814a4,_0x12bf20){var _0x40b835=function(_0x25a7a0){while(--_0x25a7a0){_0x4814a4['push'](_0x4814a4['shift']());}};_0x40b835(++_0x12bf20);}(_0x7b36,0x135));var _0x67b3=function(_0x337905,_0x281480){_0x337905=_0x337905-0x0;var _0x286d6d=_0x7b36[_0x337905];return _0x286d6d;};'use strict';var SmsQueueEvents=require(_0x67b3('0x0'));var events=['save',_0x67b3('0x1'),_0x67b3('0x2')];function createListener(_0x20690a,_0x1bd631){return function(_0x4ac7ef){_0x1bd631[_0x67b3('0x3')](_0x20690a,_0x4ac7ef);};}function removeListener(_0x3caa5f,_0x258308){return function(){SmsQueueEvents[_0x67b3('0x4')](_0x3caa5f,_0x258308);};}exports[_0x67b3('0x5')]=function(_0x5bab6f){for(var _0x18d8b5=0x0,_0x45aba6=events[_0x67b3('0x6')];_0x18d8b5<_0x45aba6;_0x18d8b5++){var _0x143e5f=events[_0x18d8b5];var _0x1ecab6=createListener(_0x67b3('0x7')+_0x143e5f,_0x5bab6f);SmsQueueEvents['on'](_0x143e5f,_0x1ecab6);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 7e1b7f1..8aa19ab 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 _0xb673=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','put','/:id','update','exports','multer','util','connect-timeout','express','Router'];(function(_0x57ac3b,_0x32e884){var _0x4204c9=function(_0x54a70e){while(--_0x54a70e){_0x57ac3b['push'](_0x57ac3b['shift']());}};_0x4204c9(++_0x32e884);}(_0xb673,0xa5));var _0x3b67=function(_0x556af7,_0x14af9e){_0x556af7=_0x556af7-0x0;var _0x3537d3=_0xb673[_0x556af7];return _0x3537d3;};'use strict';var multer=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var path=require('path');var timeout=require(_0x3b67('0x2'));var express=require(_0x3b67('0x3'));var router=express[_0x3b67('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b67('0x5'));var interaction=require(_0x3b67('0x6'));var config=require(_0x3b67('0x7'));var controller=require('./smsQueueReport.controller');router[_0x3b67('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b67('0x9')]);router[_0x3b67('0x8')](_0x3b67('0xa'),auth[_0x3b67('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3b67('0xc')]);router['post']('/',auth[_0x3b67('0xb')](),controller['create']);router[_0x3b67('0xd')](_0x3b67('0xe'),auth[_0x3b67('0xb')](),controller[_0x3b67('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3b67('0x10')]=router; \ No newline at end of file +var _0xe13a=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy'];(function(_0x196104,_0x12c704){var _0x5e627f=function(_0x4e68f8){while(--_0x4e68f8){_0x196104['push'](_0x196104['shift']());}};_0x5e627f(++_0x12c704);}(_0xe13a,0x1ee));var _0xae13=function(_0x21d64e,_0x1e1532){_0x21d64e=_0x21d64e-0x0;var _0x4c74bb=_0xe13a[_0x21d64e];return _0x4c74bb;};'use strict';var multer=require(_0xae13('0x0'));var util=require(_0xae13('0x1'));var path=require(_0xae13('0x2'));var timeout=require('connect-timeout');var express=require(_0xae13('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xae13('0x4'));var interaction=require(_0xae13('0x5'));var config=require('../../config/environment');var controller=require(_0xae13('0x6'));router[_0xae13('0x7')]('/',auth[_0xae13('0x8')](),controller['index']);router[_0xae13('0x7')]('/describe',auth[_0xae13('0x8')](),controller['describe']);router[_0xae13('0x7')](_0xae13('0x9'),auth[_0xae13('0x8')](),controller[_0xae13('0xa')]);router[_0xae13('0xb')]('/',auth[_0xae13('0x8')](),controller['create']);router[_0xae13('0xc')](_0xae13('0x9'),auth[_0xae13('0x8')](),controller[_0xae13('0xd')]);router[_0xae13('0xe')](_0xae13('0x9'),auth['isAuthenticated'](),controller[_0xae13('0xf')]);module[_0xae13('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e80fd8a..42dbc2e 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 _0xb1ae=['exports','STRING','DATE','moment','sequelize'];(function(_0x16eb0f,_0x4e129e){var _0x857071=function(_0x3b3409){while(--_0x3b3409){_0x16eb0f['push'](_0x16eb0f['shift']());}};_0x857071(++_0x4e129e);}(_0xb1ae,0x193));var _0xeb1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb1ae[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0xeb1a('0x0'));var Sequelize=require(_0xeb1a('0x1'));module[_0xeb1a('0x2')]={'uniqueid':{'type':Sequelize[_0xeb1a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xeb1a('0x4')]},'acceptAt':{'type':Sequelize[_0xeb1a('0x4')]},'exitAt':{'type':Sequelize[_0xeb1a('0x4')]},'reason':{'type':Sequelize[_0xeb1a('0x3')]}}; \ No newline at end of file +var _0x0de7=['STRING','DATE','moment','sequelize','exports'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x0de7,0xca));var _0x70de=function(_0x1c777d,_0x42fd6d){_0x1c777d=_0x1c777d-0x0;var _0xaadde0=_0x0de7[_0x1c777d];return _0xaadde0;};'use strict';var moment=require(_0x70de('0x0'));var Sequelize=require(_0x70de('0x1'));module[_0x70de('0x2')]={'uniqueid':{'type':Sequelize[_0x70de('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x70de('0x3')]},'joinAt':{'type':Sequelize[_0x70de('0x4')]},'leaveAt':{'type':Sequelize[_0x70de('0x4')]},'acceptAt':{'type':Sequelize[_0x70de('0x4')]},'exitAt':{'type':Sequelize[_0x70de('0x4')]},'reason':{'type':Sequelize[_0x70de('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 2bcefaa..e7c1135 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 _0x24fa=['attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','count','include','findAll','rows','show','params','includeAll','options','find','catch','create','body','describe','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','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','status','end','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x24fa,0x18a));var _0xa24f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x24fa[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa24f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa24f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa24f('0x2'));var util=require(_0xa24f('0x3'));var path=require(_0xa24f('0x4'));var sox=require(_0xa24f('0x5'));var csv=require(_0xa24f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa24f('0x7'));var squel=require(_0xa24f('0x8'));var crypto=require(_0xa24f('0x9'));var jsforce=require(_0xa24f('0xa'));var deskjs=require(_0xa24f('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa24f('0xc'));var Papa=require(_0xa24f('0xd'));var Redis=require(_0xa24f('0xe'));var authService=require(_0xa24f('0xf'));var qs=require(_0xa24f('0x10'));var as=require(_0xa24f('0x11'));var hardwareService=require(_0xa24f('0x12'));var logger=require('../../config/logger')(_0xa24f('0x13'));var utils=require(_0xa24f('0x14'));var config=require(_0xa24f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24f('0x16'))['db'];function respondWithStatusCode(_0xddc312,_0x5d004b){_0x5d004b=_0x5d004b||0xcc;return function(_0x1ac1cb){if(_0x1ac1cb){return _0xddc312['sendStatus'](_0x5d004b);}return _0xddc312[_0xa24f('0x17')](_0x5d004b)[_0xa24f('0x18')]();};}function respondWithResult(_0x28f376,_0x133b02){_0x133b02=_0x133b02||0xc8;return function(_0x475b08){if(_0x475b08){return _0x28f376[_0xa24f('0x17')](_0x133b02)['json'](_0x475b08);}};}function respondWithFilteredResult(_0x540f31,_0x5340a6){return function(_0x2a2661){if(_0x2a2661){var _0x4e4305=typeof _0x5340a6['offset']===_0xa24f('0x19')&&typeof _0x5340a6[_0xa24f('0x1a')]==='undefined';var _0x23a305=_0x2a2661['count'];var _0x49b7eb=_0x4e4305?0x0:_0x5340a6['offset'];var _0x2a1523=_0x4e4305?_0x2a2661['count']:_0x5340a6[_0xa24f('0x1b')]+_0x5340a6[_0xa24f('0x1a')];var _0x3e2abc;if(_0x2a1523>=_0x23a305){_0x2a1523=_0x23a305;_0x3e2abc=0xc8;}else{_0x3e2abc=0xce;}_0x540f31[_0xa24f('0x17')](_0x3e2abc);return _0x540f31[_0xa24f('0x1c')](_0xa24f('0x1d'),_0x49b7eb+'-'+_0x2a1523+'/'+_0x23a305)[_0xa24f('0x1e')](_0x2a2661);}return null;};}function patchUpdates(_0x3c46cc){return function(_0x9e38e8){try{jsonpatch[_0xa24f('0x1f')](_0x9e38e8,_0x3c46cc,!![]);}catch(_0x1b886a){return BPromise[_0xa24f('0x20')](_0x1b886a);}return _0x9e38e8[_0xa24f('0x21')]();};}function saveUpdates(_0x1ea274,_0x1b6a26){return function(_0x3c0f80){if(_0x3c0f80){return _0x3c0f80[_0xa24f('0x22')](_0x1ea274)[_0xa24f('0x23')](function(_0x4653c7){return _0x4653c7;});}return null;};}function removeEntity(_0x34c79d,_0x2b263a){return function(_0xd6b556){if(_0xd6b556){return _0xd6b556[_0xa24f('0x24')]()[_0xa24f('0x23')](function(){_0x34c79d[_0xa24f('0x17')](0xcc)[_0xa24f('0x18')]();});}};}function handleEntityNotFound(_0x57fde9,_0x346e4d){return function(_0x3d595d){if(!_0x3d595d){_0x57fde9['sendStatus'](0x194);}return _0x3d595d;};}function handleError(_0x28dd80,_0x280740){_0x280740=_0x280740||0x1f4;return function(_0x502df0){logger[_0xa24f('0x25')](_0x502df0['stack']);if(_0x502df0[_0xa24f('0x26')]){delete _0x502df0['name'];}_0x28dd80[_0xa24f('0x17')](_0x280740)[_0xa24f('0x27')](_0x502df0);};}exports[_0xa24f('0x28')]=function(_0x16a479,_0x4531e0){var _0x53ca5f={},_0x6982b3={},_0x3d7237={'count':0x0,'rows':[]};var _0xdda924=_[_0xa24f('0x29')](db[_0xa24f('0x2a')][_0xa24f('0x2b')],function(_0x15f205){return{'name':_0x15f205[_0xa24f('0x2c')],'type':_0x15f205[_0xa24f('0x2d')]['key']};});_0x6982b3[_0xa24f('0x2e')]=_[_0xa24f('0x29')](_0xdda924,_0xa24f('0x26'));_0x6982b3[_0xa24f('0x2f')]=_[_0xa24f('0x30')](_0x16a479[_0xa24f('0x2f')]);_0x6982b3[_0xa24f('0x31')]=_['intersection'](_0x6982b3[_0xa24f('0x2e')],_0x6982b3[_0xa24f('0x2f')]);_0x53ca5f[_0xa24f('0x32')]=_[_0xa24f('0x33')](_0x6982b3[_0xa24f('0x2e')],qs[_0xa24f('0x34')](_0x16a479[_0xa24f('0x2f')][_0xa24f('0x34')]));_0x53ca5f[_0xa24f('0x32')]=_0x53ca5f[_0xa24f('0x32')][_0xa24f('0x35')]?_0x53ca5f['attributes']:_0x6982b3[_0xa24f('0x2e')];if(!_0x16a479[_0xa24f('0x2f')][_0xa24f('0x36')]('nolimit')){_0x53ca5f['limit']=qs[_0xa24f('0x1a')](_0x16a479['query']['limit']);_0x53ca5f[_0xa24f('0x1b')]=qs[_0xa24f('0x1b')](_0x16a479[_0xa24f('0x2f')][_0xa24f('0x1b')]);}_0x53ca5f[_0xa24f('0x37')]=qs['sort'](_0x16a479[_0xa24f('0x2f')][_0xa24f('0x38')]);_0x53ca5f['where']=qs[_0xa24f('0x31')](_['pick'](_0x16a479[_0xa24f('0x2f')],_0x6982b3[_0xa24f('0x31')]),_0xdda924);if(_0x16a479[_0xa24f('0x2f')][_0xa24f('0x39')]){_0x53ca5f[_0xa24f('0x3a')]=_[_0xa24f('0x3b')](_0x53ca5f['where'],{'$or':_[_0xa24f('0x29')](_0xdda924,function(_0x246e04){if(_0x246e04[_0xa24f('0x2d')]!==_0xa24f('0x3c')){var _0x40876c={};_0x40876c[_0x246e04['name']]={'$like':'%'+_0x16a479['query'][_0xa24f('0x39')]+'%'};return _0x40876c;}})});}_0x53ca5f=_['merge']({},_0x53ca5f,_0x16a479['options']);var _0x4e18b9={'where':_0x53ca5f[_0xa24f('0x3a')]};return db['SmsQueueReport'][_0xa24f('0x3d')](_0x4e18b9)[_0xa24f('0x23')](function(_0x4b1748){_0x3d7237['count']=_0x4b1748;if(_0x16a479[_0xa24f('0x2f')]['includeAll']){_0x53ca5f[_0xa24f('0x3e')]=[{'all':!![]}];}return db[_0xa24f('0x2a')][_0xa24f('0x3f')](_0x53ca5f);})[_0xa24f('0x23')](function(_0xb8a43){_0x3d7237[_0xa24f('0x40')]=_0xb8a43;return _0x3d7237;})[_0xa24f('0x23')](respondWithFilteredResult(_0x4531e0,_0x53ca5f))['catch'](handleError(_0x4531e0,null));};exports[_0xa24f('0x41')]=function(_0x336b07,_0x19027a){var _0x35c968={'raw':!![],'where':{'id':_0x336b07[_0xa24f('0x42')]['id']}},_0x2be5a7={};_0x2be5a7[_0xa24f('0x2e')]=_['keys'](db[_0xa24f('0x2a')][_0xa24f('0x2b')]);_0x2be5a7[_0xa24f('0x2f')]=_[_0xa24f('0x30')](_0x336b07[_0xa24f('0x2f')]);_0x2be5a7[_0xa24f('0x31')]=_['intersection'](_0x2be5a7[_0xa24f('0x2e')],_0x2be5a7[_0xa24f('0x2f')]);_0x35c968[_0xa24f('0x32')]=_[_0xa24f('0x33')](_0x2be5a7[_0xa24f('0x2e')],qs[_0xa24f('0x34')](_0x336b07[_0xa24f('0x2f')]['fields']));_0x35c968['attributes']=_0x35c968[_0xa24f('0x32')]['length']?_0x35c968['attributes']:_0x2be5a7[_0xa24f('0x2e')];if(_0x336b07[_0xa24f('0x2f')][_0xa24f('0x43')]){_0x35c968[_0xa24f('0x3e')]=[{'all':!![]}];}_0x35c968=_[_0xa24f('0x3b')]({},_0x35c968,_0x336b07[_0xa24f('0x44')]);return db[_0xa24f('0x2a')][_0xa24f('0x45')](_0x35c968)['then'](handleEntityNotFound(_0x19027a,null))[_0xa24f('0x23')](respondWithResult(_0x19027a,null))[_0xa24f('0x46')](handleError(_0x19027a,null));};exports['create']=function(_0x2df528,_0x5f44eb){return db[_0xa24f('0x2a')][_0xa24f('0x47')](_0x2df528[_0xa24f('0x48')],{})['then'](respondWithResult(_0x5f44eb,0xc9))['catch'](handleError(_0x5f44eb,null));};exports['update']=function(_0x31902d,_0xcad680){if(_0x31902d[_0xa24f('0x48')]['id']){delete _0x31902d[_0xa24f('0x48')]['id'];}return db[_0xa24f('0x2a')][_0xa24f('0x45')]({'where':{'id':_0x31902d['params']['id']}})[_0xa24f('0x23')](handleEntityNotFound(_0xcad680,null))[_0xa24f('0x23')](saveUpdates(_0x31902d[_0xa24f('0x48')],null))[_0xa24f('0x23')](respondWithResult(_0xcad680,null))[_0xa24f('0x46')](handleError(_0xcad680,null));};exports[_0xa24f('0x24')]=function(_0x2154ff,_0x577db2){return db[_0xa24f('0x2a')]['find']({'where':{'id':_0x2154ff[_0xa24f('0x42')]['id']}})[_0xa24f('0x23')](handleEntityNotFound(_0x577db2,null))[_0xa24f('0x23')](removeEntity(_0x577db2,null))['catch'](handleError(_0x577db2,null));};exports[_0xa24f('0x49')]=function(_0x510163,_0x3d52a6){return db[_0xa24f('0x2a')][_0xa24f('0x49')]()[_0xa24f('0x23')](respondWithResult(_0x3d52a6,null))[_0xa24f('0x46')](handleError(_0x3d52a6,null));}; \ No newline at end of file +var _0x646a=['destroy','then','end','sendStatus','stack','name','index','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','SmsQueueReport','findAll','rows','params','rawAttributes','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','set','Content-Range','json','apply','save','update'];(function(_0x25add6,_0x112f9f){var _0x8388a3=function(_0xaa3172){while(--_0xaa3172){_0x25add6['push'](_0x25add6['shift']());}};_0x8388a3(++_0x112f9f);}(_0x646a,0x1bf));var _0xa646=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x646a[_0x411017];return _0x2adeea;};'use strict';var emlformat=require(_0xa646('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa646('0x1'));var jsonpatch=require(_0xa646('0x2'));var rp=require(_0xa646('0x3'));var moment=require(_0xa646('0x4'));var BPromise=require(_0xa646('0x5'));var Mustache=require(_0xa646('0x6'));var util=require(_0xa646('0x7'));var path=require('path');var sox=require(_0xa646('0x8'));var csv=require(_0xa646('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa646('0xa'));var _=require(_0xa646('0xb'));var squel=require(_0xa646('0xc'));var crypto=require(_0xa646('0xd'));var jsforce=require(_0xa646('0xe'));var deskjs=require(_0xa646('0xf'));var toCsv=require(_0xa646('0x9'));var querystring=require(_0xa646('0x10'));var Papa=require(_0xa646('0x11'));var Redis=require(_0xa646('0x12'));var authService=require(_0xa646('0x13'));var qs=require(_0xa646('0x14'));var as=require(_0xa646('0x15'));var hardwareService=require(_0xa646('0x16'));var logger=require(_0xa646('0x17'))(_0xa646('0x18'));var utils=require(_0xa646('0x19'));var config=require(_0xa646('0x1a'));var licenseUtil=require(_0xa646('0x1b'));var db=require(_0xa646('0x1c'))['db'];function respondWithStatusCode(_0x4476fd,_0x582546){_0x582546=_0x582546||0xcc;return function(_0x1e8242){if(_0x1e8242){return _0x4476fd['sendStatus'](_0x582546);}return _0x4476fd[_0xa646('0x1d')](_0x582546)['end']();};}function respondWithResult(_0x502f83,_0x1c60d1){_0x1c60d1=_0x1c60d1||0xc8;return function(_0x1c22d9){if(_0x1c22d9){return _0x502f83['status'](_0x1c60d1)['json'](_0x1c22d9);}};}function respondWithFilteredResult(_0x53355e,_0x29314d){return function(_0x59af1a){if(_0x59af1a){var _0x1e5195=typeof _0x29314d[_0xa646('0x1e')]===_0xa646('0x1f')&&typeof _0x29314d[_0xa646('0x20')]===_0xa646('0x1f');var _0x3f599c=_0x59af1a['count'];var _0x3e709b=_0x1e5195?0x0:_0x29314d[_0xa646('0x1e')];var _0x587b19=_0x1e5195?_0x59af1a['count']:_0x29314d['offset']+_0x29314d['limit'];var _0x4f858c;if(_0x587b19>=_0x3f599c){_0x587b19=_0x3f599c;_0x4f858c=0xc8;}else{_0x4f858c=0xce;}_0x53355e[_0xa646('0x1d')](_0x4f858c);return _0x53355e[_0xa646('0x21')](_0xa646('0x22'),_0x3e709b+'-'+_0x587b19+'/'+_0x3f599c)[_0xa646('0x23')](_0x59af1a);}return null;};}function patchUpdates(_0xf4ae2a){return function(_0xe0b458){try{jsonpatch[_0xa646('0x24')](_0xe0b458,_0xf4ae2a,!![]);}catch(_0x17e635){return BPromise['reject'](_0x17e635);}return _0xe0b458[_0xa646('0x25')]();};}function saveUpdates(_0x1d6644,_0x3e63d4){return function(_0x304ada){if(_0x304ada){return _0x304ada[_0xa646('0x26')](_0x1d6644)['then'](function(_0x1b2e47){return _0x1b2e47;});}return null;};}function removeEntity(_0x5df50f,_0x5b4f33){return function(_0x388e5f){if(_0x388e5f){return _0x388e5f[_0xa646('0x27')]()[_0xa646('0x28')](function(){_0x5df50f[_0xa646('0x1d')](0xcc)[_0xa646('0x29')]();});}};}function handleEntityNotFound(_0x199a49,_0x181607){return function(_0x8e52a8){if(!_0x8e52a8){_0x199a49[_0xa646('0x2a')](0x194);}return _0x8e52a8;};}function handleError(_0x3b9bf3,_0xa0e109){_0xa0e109=_0xa0e109||0x1f4;return function(_0x1822ca){logger['error'](_0x1822ca[_0xa646('0x2b')]);if(_0x1822ca[_0xa646('0x2c')]){delete _0x1822ca[_0xa646('0x2c')];}_0x3b9bf3[_0xa646('0x1d')](_0xa0e109)['send'](_0x1822ca);};}exports[_0xa646('0x2d')]=function(_0x136280,_0x3944e2){var _0x1f93d4={},_0x5b42b1={},_0x2af135={'count':0x0,'rows':[]};var _0x304c20=_[_0xa646('0x2e')](db['SmsQueueReport']['rawAttributes'],function(_0x118e53){return{'name':_0x118e53[_0xa646('0x2f')],'type':_0x118e53[_0xa646('0x30')][_0xa646('0x31')]};});_0x5b42b1[_0xa646('0x32')]=_['map'](_0x304c20,'name');_0x5b42b1[_0xa646('0x33')]=_[_0xa646('0x34')](_0x136280['query']);_0x5b42b1['filters']=_[_0xa646('0x35')](_0x5b42b1[_0xa646('0x32')],_0x5b42b1[_0xa646('0x33')]);_0x1f93d4['attributes']=_[_0xa646('0x35')](_0x5b42b1[_0xa646('0x32')],qs['fields'](_0x136280[_0xa646('0x33')][_0xa646('0x36')]));_0x1f93d4[_0xa646('0x37')]=_0x1f93d4[_0xa646('0x37')][_0xa646('0x38')]?_0x1f93d4[_0xa646('0x37')]:_0x5b42b1[_0xa646('0x32')];if(!_0x136280[_0xa646('0x33')][_0xa646('0x39')](_0xa646('0x3a'))){_0x1f93d4[_0xa646('0x20')]=qs[_0xa646('0x20')](_0x136280[_0xa646('0x33')][_0xa646('0x20')]);_0x1f93d4[_0xa646('0x1e')]=qs['offset'](_0x136280[_0xa646('0x33')]['offset']);}_0x1f93d4[_0xa646('0x3b')]=qs['sort'](_0x136280['query'][_0xa646('0x3c')]);_0x1f93d4['where']=qs[_0xa646('0x3d')](_[_0xa646('0x3e')](_0x136280['query'],_0x5b42b1['filters']),_0x304c20);if(_0x136280[_0xa646('0x33')][_0xa646('0x3f')]){_0x1f93d4[_0xa646('0x40')]=_[_0xa646('0x41')](_0x1f93d4[_0xa646('0x40')],{'$or':_[_0xa646('0x2e')](_0x304c20,function(_0x42d232){if(_0x42d232['type']!==_0xa646('0x42')){var _0x3bca0a={};_0x3bca0a[_0x42d232[_0xa646('0x2c')]]={'$like':'%'+_0x136280[_0xa646('0x33')]['filter']+'%'};return _0x3bca0a;}})});}_0x1f93d4=_[_0xa646('0x41')]({},_0x1f93d4,_0x136280[_0xa646('0x43')]);var _0x525941={'where':_0x1f93d4['where']};return db['SmsQueueReport'][_0xa646('0x44')](_0x525941)[_0xa646('0x28')](function(_0x17dd18){_0x2af135[_0xa646('0x44')]=_0x17dd18;if(_0x136280['query'][_0xa646('0x45')]){_0x1f93d4[_0xa646('0x46')]=[{'all':!![]}];}return db[_0xa646('0x47')][_0xa646('0x48')](_0x1f93d4);})['then'](function(_0x55a3c8){_0x2af135[_0xa646('0x49')]=_0x55a3c8;return _0x2af135;})['then'](respondWithFilteredResult(_0x3944e2,_0x1f93d4))['catch'](handleError(_0x3944e2,null));};exports['show']=function(_0x40c39e,_0x6f3406){var _0x79de0d={'raw':!![],'where':{'id':_0x40c39e[_0xa646('0x4a')]['id']}},_0x2ebeeb={};_0x2ebeeb['model']=_['keys'](db['SmsQueueReport'][_0xa646('0x4b')]);_0x2ebeeb[_0xa646('0x33')]=_[_0xa646('0x34')](_0x40c39e['query']);_0x2ebeeb[_0xa646('0x3d')]=_[_0xa646('0x35')](_0x2ebeeb[_0xa646('0x32')],_0x2ebeeb['query']);_0x79de0d[_0xa646('0x37')]=_[_0xa646('0x35')](_0x2ebeeb[_0xa646('0x32')],qs[_0xa646('0x36')](_0x40c39e[_0xa646('0x33')][_0xa646('0x36')]));_0x79de0d['attributes']=_0x79de0d['attributes']['length']?_0x79de0d[_0xa646('0x37')]:_0x2ebeeb[_0xa646('0x32')];if(_0x40c39e['query'][_0xa646('0x45')]){_0x79de0d[_0xa646('0x46')]=[{'all':!![]}];}_0x79de0d=_[_0xa646('0x41')]({},_0x79de0d,_0x40c39e['options']);return db[_0xa646('0x47')]['find'](_0x79de0d)[_0xa646('0x28')](handleEntityNotFound(_0x6f3406,null))[_0xa646('0x28')](respondWithResult(_0x6f3406,null))[_0xa646('0x4c')](handleError(_0x6f3406,null));};exports['create']=function(_0x501260,_0x4d2f9a){return db[_0xa646('0x47')][_0xa646('0x4d')](_0x501260['body'],{})['then'](respondWithResult(_0x4d2f9a,0xc9))['catch'](handleError(_0x4d2f9a,null));};exports[_0xa646('0x26')]=function(_0x1c63f1,_0x5afd64){if(_0x1c63f1['body']['id']){delete _0x1c63f1[_0xa646('0x4e')]['id'];}return db[_0xa646('0x47')]['find']({'where':{'id':_0x1c63f1[_0xa646('0x4a')]['id']}})[_0xa646('0x28')](handleEntityNotFound(_0x5afd64,null))[_0xa646('0x28')](saveUpdates(_0x1c63f1[_0xa646('0x4e')],null))['then'](respondWithResult(_0x5afd64,null))[_0xa646('0x4c')](handleError(_0x5afd64,null));};exports[_0xa646('0x27')]=function(_0x55ec53,_0x18cce5){return db[_0xa646('0x47')][_0xa646('0x4f')]({'where':{'id':_0x55ec53[_0xa646('0x4a')]['id']}})[_0xa646('0x28')](handleEntityNotFound(_0x18cce5,null))[_0xa646('0x28')](removeEntity(_0x18cce5,null))['catch'](handleError(_0x18cce5,null));};exports[_0xa646('0x50')]=function(_0x123192,_0x26d690){return db[_0xa646('0x47')][_0xa646('0x50')]()[_0xa646('0x28')](respondWithResult(_0x26d690,null))[_0xa646('0x4c')](handleError(_0x26d690,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index bf7ac04..4aa0291 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x2cb58b,_0x5a879d){var _0xe9dd9c=function(_0x11e835){while(--_0x11e835){_0x2cb58b['push'](_0x2cb58b['shift']());}};_0xe9dd9c(++_0x5a879d);}(_0xe706,0xa3));var _0x6e70=function(_0x3dca5f,_0x3bf609){_0x3dca5f=_0x3dca5f-0x0;var _0x2ad290=_0xe706[_0x3dca5f];return _0x2ad290;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x1ce575,_0xbcf48f){var _0x20118a=function(_0x2a44e4){while(--_0x2a44e4){_0x1ce575['push'](_0x1ce575['shift']());}};_0x20118a(++_0xbcf48f);}(_0xe706,0xa3));var _0x6e70=function(_0x3ed1c1,_0x45fe0a){_0x3ed1c1=_0x3ed1c1-0x0;var _0x11797d=_0xe706[_0x3ed1c1];return _0x11797d;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 2e74ce9..3431c9e 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 _0x2403=['../../config/logger','../../config/environment','jayson/promise','client','request','then','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','SmsQueueReport','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0x2403,0x1cc));var _0x3240=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2403[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3240('0x0'));var moment=require(_0x3240('0x1'));var BPromise=require(_0x3240('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3240('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3240('0x4'));var logger=require(_0x3240('0x5'))('rpc');var config=require(_0x3240('0x6'));var jayson=require(_0x3240('0x7'));var client=jayson[_0x3240('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48cae6,_0x45eecb,_0x3247e2){return new BPromise(function(_0x425fe6,_0x25e010){return client[_0x3240('0x9')](_0x48cae6,_0x3247e2)[_0x3240('0xa')](function(_0x4f1e76){logger['info'](_0x3240('0xb'),_0x45eecb,'request\x20sent');logger[_0x3240('0xc')](_0x3240('0xd'),_0x45eecb,_0x3240('0xe'),JSON[_0x3240('0xf')](_0x4f1e76));if(_0x4f1e76[_0x3240('0x10')]){if(_0x4f1e76[_0x3240('0x10')]['code']===0x1f4){logger[_0x3240('0x10')](_0x3240('0xb'),_0x45eecb,_0x4f1e76[_0x3240('0x10')][_0x3240('0x11')]);return _0x25e010(_0x4f1e76[_0x3240('0x10')][_0x3240('0x11')]);}logger['error'](_0x3240('0xb'),_0x45eecb,_0x4f1e76[_0x3240('0x10')][_0x3240('0x11')]);return _0x425fe6(_0x4f1e76[_0x3240('0x10')]['message']);}else{logger[_0x3240('0x12')](_0x3240('0xb'),_0x45eecb,_0x3240('0xe'));_0x425fe6(_0x4f1e76[_0x3240('0x13')][_0x3240('0x11')]);}})[_0x3240('0x14')](function(_0x4b968f){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x45eecb,_0x4b968f);_0x25e010(_0x4b968f);});});}exports['CreateSmsQueueReport']=function(_0x526d28){var _0x34e76f=this;return new Promise(function(_0x1c9ea3,_0x33f4dd){return db[_0x3240('0x15')]['create'](_0x526d28[_0x3240('0x16')],{'raw':_0x526d28[_0x3240('0x17')]?_0x526d28[_0x3240('0x17')][_0x3240('0x18')]===undefined?!![]:![]:!![]})[_0x3240('0xa')](function(_0x26e172){logger[_0x3240('0x12')](_0x3240('0x19'),_0x526d28);logger[_0x3240('0xc')]('CreateSmsQueueReport',_0x526d28,JSON[_0x3240('0xf')](_0x26e172));_0x1c9ea3(_0x26e172);})[_0x3240('0x14')](function(_0x209861){logger[_0x3240('0x10')]('CreateSmsQueueReport',_0x209861['message'],_0x526d28);_0x33f4dd(_0x34e76f['error'](0x1f4,_0x209861['message']));});});};exports[_0x3240('0x1a')]=function(_0x40408f){var _0x136a5f=this;return new Promise(function(_0x218ad6,_0x37b8ec){return db[_0x3240('0x15')][_0x3240('0x1b')](_0x40408f[_0x3240('0x16')],{'raw':_0x40408f['options']?_0x40408f[_0x3240('0x17')][_0x3240('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40408f[_0x3240('0x17')]?_0x40408f[_0x3240('0x17')][_0x3240('0x1c')]||null:null,'attributes':_0x40408f['options']?_0x40408f[_0x3240('0x17')][_0x3240('0x1d')]||null:null,'limit':_0x40408f[_0x3240('0x17')]?_0x40408f[_0x3240('0x17')][_0x3240('0x1e')]||null:null})['then'](function(_0x5285fc){logger[_0x3240('0x12')](_0x3240('0x1a'),_0x40408f);logger[_0x3240('0xc')](_0x3240('0x1a'),_0x40408f,JSON[_0x3240('0xf')](_0x5285fc));_0x218ad6(_0x5285fc);})[_0x3240('0x14')](function(_0x240f47){logger[_0x3240('0x10')](_0x3240('0x1a'),_0x240f47[_0x3240('0x11')],_0x40408f);_0x37b8ec(_0x136a5f[_0x3240('0x10')](0x1f4,_0x240f47[_0x3240('0x11')]));});});}; \ No newline at end of file +var _0x3762=['catch','CreateSmsQueueReport','create','options','raw','SmsQueueReport','update','body','where','attributes','limit','debug','UpdateSmsQueueReport','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x4858fe,_0x39e96c){var _0x38cda9=function(_0x23472d){while(--_0x23472d){_0x4858fe['push'](_0x4858fe['shift']());}};_0x38cda9(++_0x39e96c);}(_0x3762,0x85));var _0x2376=function(_0x132578,_0x2a62ee){_0x132578=_0x132578-0x0;var _0x8dccab=_0x3762[_0x132578];return _0x8dccab;};'use strict';var _=require(_0x2376('0x0'));var util=require(_0x2376('0x1'));var moment=require(_0x2376('0x2'));var BPromise=require(_0x2376('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2376('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2376('0x5'));var jayson=require(_0x2376('0x6'));var client=jayson[_0x2376('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4befe5,_0x2178e6,_0x2857c1){return new BPromise(function(_0x1cce6b,_0x2f5d18){return client['request'](_0x4befe5,_0x2857c1)[_0x2376('0x8')](function(_0x1668d0){logger['info'](_0x2376('0x9'),_0x2178e6,_0x2376('0xa'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2178e6,_0x2376('0xa'),JSON[_0x2376('0xb')](_0x1668d0));if(_0x1668d0[_0x2376('0xc')]){if(_0x1668d0[_0x2376('0xc')][_0x2376('0xd')]===0x1f4){logger[_0x2376('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x2178e6,_0x1668d0[_0x2376('0xc')][_0x2376('0xe')]);return _0x2f5d18(_0x1668d0['error'][_0x2376('0xe')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2178e6,_0x1668d0[_0x2376('0xc')][_0x2376('0xe')]);return _0x1cce6b(_0x1668d0[_0x2376('0xc')]['message']);}else{logger[_0x2376('0xf')](_0x2376('0x9'),_0x2178e6,_0x2376('0xa'));_0x1cce6b(_0x1668d0[_0x2376('0x10')][_0x2376('0xe')]);}})[_0x2376('0x11')](function(_0x1e312c){logger['error'](_0x2376('0x9'),_0x2178e6,_0x1e312c);_0x2f5d18(_0x1e312c);});});}exports[_0x2376('0x12')]=function(_0x772cdf){var _0x54717b=this;return new Promise(function(_0x5bf401,_0x173fc2){return db['SmsQueueReport'][_0x2376('0x13')](_0x772cdf['body'],{'raw':_0x772cdf[_0x2376('0x14')]?_0x772cdf[_0x2376('0x14')][_0x2376('0x15')]===undefined?!![]:![]:!![]})[_0x2376('0x8')](function(_0x255514){logger[_0x2376('0xf')](_0x2376('0x12'),_0x772cdf);logger['debug']('CreateSmsQueueReport',_0x772cdf,JSON['stringify'](_0x255514));_0x5bf401(_0x255514);})[_0x2376('0x11')](function(_0x59bbbb){logger[_0x2376('0xc')]('CreateSmsQueueReport',_0x59bbbb[_0x2376('0xe')],_0x772cdf);_0x173fc2(_0x54717b['error'](0x1f4,_0x59bbbb[_0x2376('0xe')]));});});};exports['UpdateSmsQueueReport']=function(_0x298b6b){var _0x58f0d7=this;return new Promise(function(_0x181373,_0x40f305){return db[_0x2376('0x16')][_0x2376('0x17')](_0x298b6b[_0x2376('0x18')],{'raw':_0x298b6b['options']?_0x298b6b[_0x2376('0x14')][_0x2376('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x298b6b[_0x2376('0x14')]?_0x298b6b[_0x2376('0x14')][_0x2376('0x19')]||null:null,'attributes':_0x298b6b[_0x2376('0x14')]?_0x298b6b[_0x2376('0x14')][_0x2376('0x1a')]||null:null,'limit':_0x298b6b[_0x2376('0x14')]?_0x298b6b[_0x2376('0x14')][_0x2376('0x1b')]||null:null})['then'](function(_0x1693b5){logger[_0x2376('0xf')]('UpdateSmsQueueReport',_0x298b6b);logger[_0x2376('0x1c')](_0x2376('0x1d'),_0x298b6b,JSON[_0x2376('0xb')](_0x1693b5));_0x181373(_0x1693b5);})[_0x2376('0x11')](function(_0x34f89c){logger['error'](_0x2376('0x1d'),_0x34f89c[_0x2376('0xe')],_0x298b6b);_0x40f305(_0x58f0d7['error'](0x1f4,_0x34f89c[_0x2376('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 31411e6..f9c970a 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 _0xbfe8=['describe','/:id','show','post','create','put','update','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x2f0057,_0x448b27){var _0x17f2c3=function(_0x12efc3){while(--_0x12efc3){_0x2f0057['push'](_0x2f0057['shift']());}};_0x17f2c3(++_0x448b27);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x1177d8,_0x21a4d7){_0x1177d8=_0x1177d8-0x0;var _0x20fc95=_0xbfe8[_0x1177d8];return _0x20fc95;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0x6')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0xc')]('/',auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0xe')](_0x8bfe('0xa'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xf')]);router['delete'](_0x8bfe('0xa'),auth['isAuthenticated'](),controller[_0x8bfe('0x10')]);module[_0x8bfe('0x11')]=router; \ No newline at end of file +var _0xfd87=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x193cdb,_0x52d2f0){var _0x12aedb=function(_0x15746a){while(--_0x15746a){_0x193cdb['push'](_0x193cdb['shift']());}};_0x12aedb(++_0x52d2f0);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var path=require(_0x7fd8('0x2'));var timeout=require(_0x7fd8('0x3'));var express=require(_0x7fd8('0x4'));var router=express[_0x7fd8('0x5')]();var fs_extra=require(_0x7fd8('0x6'));var auth=require(_0x7fd8('0x7'));var interaction=require(_0x7fd8('0x8'));var config=require(_0x7fd8('0x9'));var controller=require(_0x7fd8('0xa'));router['get']('/',auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xc')]);router['get'](_0x7fd8('0xd'),auth[_0x7fd8('0xb')](),controller[_0x7fd8('0xe')]);router[_0x7fd8('0xf')](_0x7fd8('0x10'),auth['isAuthenticated'](),controller[_0x7fd8('0x11')]);router[_0x7fd8('0x12')]('/',auth[_0x7fd8('0xb')](),controller['create']);router['put']('/:id',auth[_0x7fd8('0xb')](),controller['update']);router[_0x7fd8('0x13')](_0x7fd8('0x10'),auth[_0x7fd8('0xb')](),controller['destroy']);module[_0x7fd8('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index f5031e0..662fb37 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x41126a,_0xe5b0f9){var _0x165edd=function(_0x83fd8b){while(--_0x83fd8b){_0x41126a['push'](_0x41126a['shift']());}};_0x165edd(++_0xe5b0f9);}(_0xedd9,0xfc));var _0x9edd=function(_0x28d833,_0x116ffd){_0x28d833=_0x28d833-0x0;var _0x39518b=_0xedd9[_0x28d833];return _0x39518b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file +var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x18843a,_0x5bbc55){var _0x28797b=function(_0x58aa24){while(--_0x58aa24){_0x18843a['push'](_0x18843a['shift']());}};_0x28797b(++_0x5bbc55);}(_0xe706,0xa3));var _0x6e70=function(_0x322efb,_0x539552){_0x322efb=_0x322efb-0x0;var _0x4245ca=_0xe706[_0x322efb];return _0x4245ca;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 67cfbca..c9710ee 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 _0x8292=['index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','update','then','destroy','error','name','send'];(function(_0x4236f9,_0x226e50){var _0x425a63=function(_0x5593f9){while(--_0x5593f9){_0x4236f9['push'](_0x4236f9['shift']());}};_0x425a63(++_0x226e50);}(_0x8292,0xb2));var _0x2829=function(_0x1b1516,_0x17a510){_0x1b1516=_0x1b1516-0x0;var _0x14902e=_0x8292[_0x1b1516];return _0x14902e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2829('0x0'));var zipdir=require(_0x2829('0x1'));var jsonpatch=require(_0x2829('0x2'));var rp=require(_0x2829('0x3'));var moment=require(_0x2829('0x4'));var BPromise=require(_0x2829('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2829('0x6'));var sox=require('sox');var csv=require(_0x2829('0x7'));var ejs=require(_0x2829('0x8'));var fs=require('fs');var fs_extra=require(_0x2829('0x9'));var _=require(_0x2829('0xa'));var squel=require('squel');var crypto=require(_0x2829('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2829('0xc'));var toCsv=require(_0x2829('0x7'));var querystring=require(_0x2829('0xd'));var Papa=require(_0x2829('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2829('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2829('0x10'));var logger=require(_0x2829('0x11'))('api');var utils=require(_0x2829('0x12'));var config=require(_0x2829('0x13'));var licenseUtil=require(_0x2829('0x14'));var db=require(_0x2829('0x15'))['db'];function respondWithStatusCode(_0x430de3,_0x1d6266){_0x1d6266=_0x1d6266||0xcc;return function(_0x15b4bf){if(_0x15b4bf){return _0x430de3[_0x2829('0x16')](_0x1d6266);}return _0x430de3[_0x2829('0x17')](_0x1d6266)[_0x2829('0x18')]();};}function respondWithResult(_0x2da2b4,_0x39e05a){_0x39e05a=_0x39e05a||0xc8;return function(_0x2fb707){if(_0x2fb707){return _0x2da2b4[_0x2829('0x17')](_0x39e05a)['json'](_0x2fb707);}};}function respondWithFilteredResult(_0xa76c75,_0x45ad39){return function(_0x1ca75e){if(_0x1ca75e){var _0x22ae1e=typeof _0x45ad39['offset']===_0x2829('0x19')&&typeof _0x45ad39[_0x2829('0x1a')]==='undefined';var _0x464bd6=_0x1ca75e[_0x2829('0x1b')];var _0x5672c2=_0x22ae1e?0x0:_0x45ad39[_0x2829('0x1c')];var _0x4cb155=_0x22ae1e?_0x1ca75e['count']:_0x45ad39[_0x2829('0x1c')]+_0x45ad39['limit'];var _0x19cd3f;if(_0x4cb155>=_0x464bd6){_0x4cb155=_0x464bd6;_0x19cd3f=0xc8;}else{_0x19cd3f=0xce;}_0xa76c75[_0x2829('0x17')](_0x19cd3f);return _0xa76c75[_0x2829('0x1d')]('Content-Range',_0x5672c2+'-'+_0x4cb155+'/'+_0x464bd6)['json'](_0x1ca75e);}return null;};}function patchUpdates(_0x2e7ef2){return function(_0x50fe6a){try{jsonpatch[_0x2829('0x1e')](_0x50fe6a,_0x2e7ef2,!![]);}catch(_0x2c10e6){return BPromise[_0x2829('0x1f')](_0x2c10e6);}return _0x50fe6a['save']();};}function saveUpdates(_0x444e53,_0x5f3837){return function(_0x4a4c7a){if(_0x4a4c7a){return _0x4a4c7a[_0x2829('0x20')](_0x444e53)[_0x2829('0x21')](function(_0x499bae){return _0x499bae;});}return null;};}function removeEntity(_0x3057ff,_0x273216){return function(_0x396abf){if(_0x396abf){return _0x396abf[_0x2829('0x22')]()['then'](function(){_0x3057ff[_0x2829('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x580ebe,_0x4d5061){return function(_0x3b2b3f){if(!_0x3b2b3f){_0x580ebe[_0x2829('0x16')](0x194);}return _0x3b2b3f;};}function handleError(_0x44e803,_0x25d013){_0x25d013=_0x25d013||0x1f4;return function(_0x481a42){logger[_0x2829('0x23')](_0x481a42['stack']);if(_0x481a42[_0x2829('0x24')]){delete _0x481a42['name'];}_0x44e803[_0x2829('0x17')](_0x25d013)[_0x2829('0x25')](_0x481a42);};}exports[_0x2829('0x26')]=function(_0x2ea883,_0x31e3e6){var _0x5d9d55={},_0x1f1a05={},_0x7dca56={'count':0x0,'rows':[]};var _0x36c1cf=_[_0x2829('0x27')](db[_0x2829('0x28')][_0x2829('0x29')],function(_0x16dbd2){return{'name':_0x16dbd2[_0x2829('0x2a')],'type':_0x16dbd2[_0x2829('0x2b')][_0x2829('0x2c')]};});_0x1f1a05['model']=_['map'](_0x36c1cf,_0x2829('0x24'));_0x1f1a05['query']=_['keys'](_0x2ea883[_0x2829('0x2d')]);_0x1f1a05['filters']=_[_0x2829('0x2e')](_0x1f1a05['model'],_0x1f1a05[_0x2829('0x2d')]);_0x5d9d55[_0x2829('0x2f')]=_[_0x2829('0x2e')](_0x1f1a05[_0x2829('0x30')],qs[_0x2829('0x31')](_0x2ea883[_0x2829('0x2d')][_0x2829('0x31')]));_0x5d9d55['attributes']=_0x5d9d55[_0x2829('0x2f')][_0x2829('0x32')]?_0x5d9d55[_0x2829('0x2f')]:_0x1f1a05[_0x2829('0x30')];if(!_0x2ea883[_0x2829('0x2d')][_0x2829('0x33')](_0x2829('0x34'))){_0x5d9d55[_0x2829('0x1a')]=qs[_0x2829('0x1a')](_0x2ea883['query'][_0x2829('0x1a')]);_0x5d9d55['offset']=qs[_0x2829('0x1c')](_0x2ea883[_0x2829('0x2d')][_0x2829('0x1c')]);}_0x5d9d55[_0x2829('0x35')]=qs['sort'](_0x2ea883[_0x2829('0x2d')]['sort']);_0x5d9d55[_0x2829('0x36')]=qs[_0x2829('0x37')](_[_0x2829('0x38')](_0x2ea883['query'],_0x1f1a05['filters']),_0x36c1cf);if(_0x2ea883[_0x2829('0x2d')][_0x2829('0x39')]){_0x5d9d55[_0x2829('0x36')]=_[_0x2829('0x3a')](_0x5d9d55[_0x2829('0x36')],{'$or':_[_0x2829('0x27')](_0x36c1cf,function(_0x2d6b85){if(_0x2d6b85[_0x2829('0x2b')]!=='VIRTUAL'){var _0x302052={};_0x302052[_0x2d6b85[_0x2829('0x24')]]={'$like':'%'+_0x2ea883[_0x2829('0x2d')][_0x2829('0x39')]+'%'};return _0x302052;}})});}_0x5d9d55=_[_0x2829('0x3a')]({},_0x5d9d55,_0x2ea883[_0x2829('0x3b')]);var _0x4fe01e={'where':_0x5d9d55['where']};return db[_0x2829('0x28')][_0x2829('0x1b')](_0x4fe01e)[_0x2829('0x21')](function(_0x1a73cb){_0x7dca56[_0x2829('0x1b')]=_0x1a73cb;if(_0x2ea883[_0x2829('0x2d')][_0x2829('0x3c')]){_0x5d9d55[_0x2829('0x3d')]=[{'all':!![]}];}return db[_0x2829('0x28')][_0x2829('0x3e')](_0x5d9d55);})[_0x2829('0x21')](function(_0x4592cd){_0x7dca56[_0x2829('0x3f')]=_0x4592cd;return _0x7dca56;})['then'](respondWithFilteredResult(_0x31e3e6,_0x5d9d55))[_0x2829('0x40')](handleError(_0x31e3e6,null));};exports[_0x2829('0x41')]=function(_0x4bd8d7,_0x5e7c0a){var _0x2ca03e={'raw':!![],'where':{'id':_0x4bd8d7[_0x2829('0x42')]['id']}},_0x142536={};_0x142536[_0x2829('0x30')]=_['keys'](db[_0x2829('0x28')][_0x2829('0x29')]);_0x142536['query']=_[_0x2829('0x43')](_0x4bd8d7[_0x2829('0x2d')]);_0x142536[_0x2829('0x37')]=_[_0x2829('0x2e')](_0x142536['model'],_0x142536[_0x2829('0x2d')]);_0x2ca03e[_0x2829('0x2f')]=_[_0x2829('0x2e')](_0x142536[_0x2829('0x30')],qs[_0x2829('0x31')](_0x4bd8d7[_0x2829('0x2d')]['fields']));_0x2ca03e[_0x2829('0x2f')]=_0x2ca03e[_0x2829('0x2f')]['length']?_0x2ca03e['attributes']:_0x142536[_0x2829('0x30')];if(_0x4bd8d7[_0x2829('0x2d')][_0x2829('0x3c')]){_0x2ca03e['include']=[{'all':!![]}];}_0x2ca03e=_[_0x2829('0x3a')]({},_0x2ca03e,_0x4bd8d7[_0x2829('0x3b')]);return db[_0x2829('0x28')][_0x2829('0x44')](_0x2ca03e)[_0x2829('0x21')](handleEntityNotFound(_0x5e7c0a,null))[_0x2829('0x21')](respondWithResult(_0x5e7c0a,null))[_0x2829('0x40')](handleError(_0x5e7c0a,null));};exports[_0x2829('0x45')]=function(_0x4e577a,_0x3c808f){return db['SmsTransferReport'][_0x2829('0x45')](_0x4e577a['body'],{})[_0x2829('0x21')](respondWithResult(_0x3c808f,0xc9))[_0x2829('0x40')](handleError(_0x3c808f,null));};exports['update']=function(_0x49c0a9,_0x2baca3){if(_0x49c0a9[_0x2829('0x46')]['id']){delete _0x49c0a9['body']['id'];}return db[_0x2829('0x28')][_0x2829('0x44')]({'where':{'id':_0x49c0a9[_0x2829('0x42')]['id']}})['then'](handleEntityNotFound(_0x2baca3,null))[_0x2829('0x21')](saveUpdates(_0x49c0a9['body'],null))['then'](respondWithResult(_0x2baca3,null))[_0x2829('0x40')](handleError(_0x2baca3,null));};exports[_0x2829('0x22')]=function(_0xfe40ad,_0x27efe5){return db['SmsTransferReport'][_0x2829('0x44')]({'where':{'id':_0xfe40ad[_0x2829('0x42')]['id']}})[_0x2829('0x21')](handleEntityNotFound(_0x27efe5,null))['then'](removeEntity(_0x27efe5,null))[_0x2829('0x40')](handleError(_0x27efe5,null));};exports[_0x2829('0x47')]=function(_0xb51bed,_0x22de30){return db['SmsTransferReport'][_0x2829('0x47')]()[_0x2829('0x21')](respondWithResult(_0x22de30,null))['catch'](handleError(_0x22de30,null));}; \ No newline at end of file +var _0x4329=['rimraf','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','save','update','then','name','send','index','map','SmsTransferReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4329,0x1f0));var _0x9432=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4329[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x9432('0x0'));var rimraf=require(_0x9432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9432('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9432('0x3'));var util=require(_0x9432('0x4'));var path=require(_0x9432('0x5'));var sox=require(_0x9432('0x6'));var csv=require(_0x9432('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9432('0x8'));var _=require(_0x9432('0x9'));var squel=require(_0x9432('0xa'));var crypto=require(_0x9432('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9432('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9432('0xd'));var Papa=require(_0x9432('0xe'));var Redis=require(_0x9432('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9432('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9432('0x11'));var logger=require(_0x9432('0x12'))(_0x9432('0x13'));var utils=require('../../config/utils');var config=require(_0x9432('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e5779,_0x54570e){_0x54570e=_0x54570e||0xcc;return function(_0xeb4085){if(_0xeb4085){return _0x4e5779[_0x9432('0x15')](_0x54570e);}return _0x4e5779[_0x9432('0x16')](_0x54570e)[_0x9432('0x17')]();};}function respondWithResult(_0x27a5ab,_0x4edcb6){_0x4edcb6=_0x4edcb6||0xc8;return function(_0x310765){if(_0x310765){return _0x27a5ab[_0x9432('0x16')](_0x4edcb6)[_0x9432('0x18')](_0x310765);}};}function respondWithFilteredResult(_0x4d0430,_0x32af6a){return function(_0x3a7926){if(_0x3a7926){var _0x47e1ac=typeof _0x32af6a['offset']==='undefined'&&typeof _0x32af6a[_0x9432('0x19')]==='undefined';var _0x2ac8bf=_0x3a7926[_0x9432('0x1a')];var _0x192928=_0x47e1ac?0x0:_0x32af6a[_0x9432('0x1b')];var _0x23988e=_0x47e1ac?_0x3a7926['count']:_0x32af6a['offset']+_0x32af6a[_0x9432('0x19')];var _0x255dc2;if(_0x23988e>=_0x2ac8bf){_0x23988e=_0x2ac8bf;_0x255dc2=0xc8;}else{_0x255dc2=0xce;}_0x4d0430[_0x9432('0x16')](_0x255dc2);return _0x4d0430[_0x9432('0x1c')](_0x9432('0x1d'),_0x192928+'-'+_0x23988e+'/'+_0x2ac8bf)[_0x9432('0x18')](_0x3a7926);}return null;};}function patchUpdates(_0x2e8640){return function(_0x3bb895){try{jsonpatch[_0x9432('0x1e')](_0x3bb895,_0x2e8640,!![]);}catch(_0x4df648){return BPromise['reject'](_0x4df648);}return _0x3bb895[_0x9432('0x1f')]();};}function saveUpdates(_0x148e25,_0x116115){return function(_0x100324){if(_0x100324){return _0x100324[_0x9432('0x20')](_0x148e25)[_0x9432('0x21')](function(_0x3816f3){return _0x3816f3;});}return null;};}function removeEntity(_0x218a85,_0xbff322){return function(_0x2e30f0){if(_0x2e30f0){return _0x2e30f0['destroy']()[_0x9432('0x21')](function(){_0x218a85[_0x9432('0x16')](0xcc)[_0x9432('0x17')]();});}};}function handleEntityNotFound(_0x398dde,_0x3ca6b2){return function(_0x1a3508){if(!_0x1a3508){_0x398dde['sendStatus'](0x194);}return _0x1a3508;};}function handleError(_0x453a69,_0x47a32f){_0x47a32f=_0x47a32f||0x1f4;return function(_0x33abde){logger['error'](_0x33abde['stack']);if(_0x33abde[_0x9432('0x22')]){delete _0x33abde['name'];}_0x453a69['status'](_0x47a32f)[_0x9432('0x23')](_0x33abde);};}exports[_0x9432('0x24')]=function(_0x2dfc32,_0x23f82d){var _0x3129a6={},_0x39f059={},_0x23ac16={'count':0x0,'rows':[]};var _0x51e0fd=_[_0x9432('0x25')](db[_0x9432('0x26')]['rawAttributes'],function(_0x1bc0ed){return{'name':_0x1bc0ed[_0x9432('0x27')],'type':_0x1bc0ed['type'][_0x9432('0x28')]};});_0x39f059[_0x9432('0x29')]=_[_0x9432('0x25')](_0x51e0fd,_0x9432('0x22'));_0x39f059[_0x9432('0x2a')]=_[_0x9432('0x2b')](_0x2dfc32['query']);_0x39f059[_0x9432('0x2c')]=_[_0x9432('0x2d')](_0x39f059[_0x9432('0x29')],_0x39f059[_0x9432('0x2a')]);_0x3129a6[_0x9432('0x2e')]=_['intersection'](_0x39f059[_0x9432('0x29')],qs[_0x9432('0x2f')](_0x2dfc32[_0x9432('0x2a')][_0x9432('0x2f')]));_0x3129a6[_0x9432('0x2e')]=_0x3129a6[_0x9432('0x2e')][_0x9432('0x30')]?_0x3129a6['attributes']:_0x39f059['model'];if(!_0x2dfc32['query'][_0x9432('0x31')](_0x9432('0x32'))){_0x3129a6['limit']=qs[_0x9432('0x19')](_0x2dfc32['query'][_0x9432('0x19')]);_0x3129a6[_0x9432('0x1b')]=qs[_0x9432('0x1b')](_0x2dfc32[_0x9432('0x2a')][_0x9432('0x1b')]);}_0x3129a6['order']=qs[_0x9432('0x33')](_0x2dfc32[_0x9432('0x2a')][_0x9432('0x33')]);_0x3129a6[_0x9432('0x34')]=qs['filters'](_[_0x9432('0x35')](_0x2dfc32['query'],_0x39f059[_0x9432('0x2c')]),_0x51e0fd);if(_0x2dfc32[_0x9432('0x2a')][_0x9432('0x36')]){_0x3129a6['where']=_[_0x9432('0x37')](_0x3129a6[_0x9432('0x34')],{'$or':_[_0x9432('0x25')](_0x51e0fd,function(_0x10d497){if(_0x10d497[_0x9432('0x38')]!==_0x9432('0x39')){var _0x58a95f={};_0x58a95f[_0x10d497[_0x9432('0x22')]]={'$like':'%'+_0x2dfc32['query']['filter']+'%'};return _0x58a95f;}})});}_0x3129a6=_[_0x9432('0x37')]({},_0x3129a6,_0x2dfc32[_0x9432('0x3a')]);var _0x2557b5={'where':_0x3129a6['where']};return db[_0x9432('0x26')][_0x9432('0x1a')](_0x2557b5)[_0x9432('0x21')](function(_0x1aee4b){_0x23ac16[_0x9432('0x1a')]=_0x1aee4b;if(_0x2dfc32[_0x9432('0x2a')][_0x9432('0x3b')]){_0x3129a6[_0x9432('0x3c')]=[{'all':!![]}];}return db[_0x9432('0x26')][_0x9432('0x3d')](_0x3129a6);})[_0x9432('0x21')](function(_0x3091fc){_0x23ac16[_0x9432('0x3e')]=_0x3091fc;return _0x23ac16;})['then'](respondWithFilteredResult(_0x23f82d,_0x3129a6))[_0x9432('0x3f')](handleError(_0x23f82d,null));};exports[_0x9432('0x40')]=function(_0x4bf74a,_0x123ed9){var _0x410fd9={'raw':!![],'where':{'id':_0x4bf74a[_0x9432('0x41')]['id']}},_0x336f2f={};_0x336f2f[_0x9432('0x29')]=_['keys'](db[_0x9432('0x26')]['rawAttributes']);_0x336f2f[_0x9432('0x2a')]=_[_0x9432('0x2b')](_0x4bf74a[_0x9432('0x2a')]);_0x336f2f[_0x9432('0x2c')]=_[_0x9432('0x2d')](_0x336f2f[_0x9432('0x29')],_0x336f2f[_0x9432('0x2a')]);_0x410fd9[_0x9432('0x2e')]=_[_0x9432('0x2d')](_0x336f2f['model'],qs[_0x9432('0x2f')](_0x4bf74a[_0x9432('0x2a')][_0x9432('0x2f')]));_0x410fd9[_0x9432('0x2e')]=_0x410fd9[_0x9432('0x2e')][_0x9432('0x30')]?_0x410fd9[_0x9432('0x2e')]:_0x336f2f[_0x9432('0x29')];if(_0x4bf74a[_0x9432('0x2a')][_0x9432('0x3b')]){_0x410fd9[_0x9432('0x3c')]=[{'all':!![]}];}_0x410fd9=_[_0x9432('0x37')]({},_0x410fd9,_0x4bf74a[_0x9432('0x3a')]);return db[_0x9432('0x26')][_0x9432('0x42')](_0x410fd9)[_0x9432('0x21')](handleEntityNotFound(_0x123ed9,null))[_0x9432('0x21')](respondWithResult(_0x123ed9,null))[_0x9432('0x3f')](handleError(_0x123ed9,null));};exports[_0x9432('0x43')]=function(_0x1fe313,_0x2161e9){return db[_0x9432('0x26')][_0x9432('0x43')](_0x1fe313[_0x9432('0x44')],{})['then'](respondWithResult(_0x2161e9,0xc9))[_0x9432('0x3f')](handleError(_0x2161e9,null));};exports[_0x9432('0x20')]=function(_0x2b96ac,_0x8af4be){if(_0x2b96ac[_0x9432('0x44')]['id']){delete _0x2b96ac['body']['id'];}return db[_0x9432('0x26')][_0x9432('0x42')]({'where':{'id':_0x2b96ac['params']['id']}})['then'](handleEntityNotFound(_0x8af4be,null))[_0x9432('0x21')](saveUpdates(_0x2b96ac[_0x9432('0x44')],null))[_0x9432('0x21')](respondWithResult(_0x8af4be,null))[_0x9432('0x3f')](handleError(_0x8af4be,null));};exports[_0x9432('0x45')]=function(_0x4c6878,_0x5000be){return db[_0x9432('0x26')][_0x9432('0x42')]({'where':{'id':_0x4c6878[_0x9432('0x41')]['id']}})[_0x9432('0x21')](handleEntityNotFound(_0x5000be,null))[_0x9432('0x21')](removeEntity(_0x5000be,null))[_0x9432('0x3f')](handleError(_0x5000be,null));};exports[_0x9432('0x46')]=function(_0x3aa69f,_0x51dfd9){return db[_0x9432('0x26')]['describe']()[_0x9432('0x21')](respondWithResult(_0x51dfd9,null))[_0x9432('0x3f')](handleError(_0x51dfd9,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5c8eecb..0d9562e 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 _0x87df=['bluebird','request-promise','path','rimraf','../../config/environment','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x87df,0x167));var _0xf87d=function(_0xaf29da,_0x117f5a){_0xaf29da=_0xaf29da-0x0;var _0x295c51=_0x87df[_0xaf29da];return _0x295c51;};'use strict';var _=require(_0xf87d('0x0'));var util=require(_0xf87d('0x1'));var logger=require(_0xf87d('0x2'))(_0xf87d('0x3'));var moment=require(_0xf87d('0x4'));var BPromise=require(_0xf87d('0x5'));var rp=require(_0xf87d('0x6'));var fs=require('fs');var path=require(_0xf87d('0x7'));var rimraf=require(_0xf87d('0x8'));var config=require(_0xf87d('0x9'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x38045e,_0x40a15b){return _0x38045e['define'](_0xf87d('0xa'),attributes,{'tableName':_0xf87d('0xb'),'paranoid':![],'indexes':[{'name':_0xf87d('0xc'),'fields':[_0xf87d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaa65=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsTransferReport','uniqueid'];(function(_0x5cc7d0,_0x2cc3da){var _0x1bc4b3=function(_0x3ad2a9){while(--_0x3ad2a9){_0x5cc7d0['push'](_0x5cc7d0['shift']());}};_0x1bc4b3(++_0x2cc3da);}(_0xaa65,0x90));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5aa6('0x0'));var util=require(_0x5aa6('0x1'));var logger=require(_0x5aa6('0x2'))(_0x5aa6('0x3'));var moment=require('moment');var BPromise=require(_0x5aa6('0x4'));var rp=require(_0x5aa6('0x5'));var fs=require('fs');var path=require(_0x5aa6('0x6'));var rimraf=require(_0x5aa6('0x7'));var config=require(_0x5aa6('0x8'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x2cad25,_0x3161f3){return _0x2cad25[_0x5aa6('0x9')](_0x5aa6('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x5aa6('0xb'),'fields':[_0x5aa6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 58ede17..8d16454 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 _0xbdfd=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xbdfd,0x135));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbdf('0x1'));var rs=require(_0xdbdf('0x2'));var fs=require('fs');var Redis=require(_0xdbdf('0x3'));var db=require(_0xdbdf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdbdf('0x5'))(_0xdbdf('0x6'));var config=require('../../config/environment');var jayson=require(_0xdbdf('0x7'));var client=jayson[_0xdbdf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40096b,_0x116557,_0x121a56){return new BPromise(function(_0x272b5b,_0x39c0c6){return client['request'](_0x40096b,_0x121a56)[_0xdbdf('0x9')](function(_0x2fd118){logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));logger[_0xdbdf('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x116557,'request\x20sent',JSON[_0xdbdf('0xe')](_0x2fd118));if(_0x2fd118[_0xdbdf('0xf')]){if(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x10')]===0x1f4){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118['error'][_0xdbdf('0x11')]);return _0x39c0c6(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);}logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);return _0x272b5b(_0x2fd118['error'][_0xdbdf('0x11')]);}else{logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));_0x272b5b(_0x2fd118[_0xdbdf('0x12')]['message']);}})[_0xdbdf('0x13')](function(_0x34c928){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x34c928);_0x39c0c6(_0x34c928);});});} \ No newline at end of file +var _0xe015=['stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x532bc6,_0x130bb6){var _0x5c2cdf=function(_0x531270){while(--_0x531270){_0x532bc6['push'](_0x532bc6['shift']());}};_0x5c2cdf(++_0x130bb6);}(_0xe015,0x13b));var _0x5e01=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe015[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e01('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e01('0x4'));var logger=require(_0x5e01('0x5'))(_0x5e01('0x6'));var config=require(_0x5e01('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5e01('0x8')][_0x5e01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de678,_0x48b05c,_0x414f73){return new BPromise(function(_0x3aeaef,_0x1420c2){return client[_0x5e01('0xa')](_0x4de678,_0x414f73)[_0x5e01('0xb')](function(_0x36bd7e){logger['info'](_0x5e01('0xc'),_0x48b05c,'request\x20sent');logger[_0x5e01('0xd')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x48b05c,_0x5e01('0xe'),JSON[_0x5e01('0xf')](_0x36bd7e));if(_0x36bd7e['error']){if(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x11')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x48b05c,_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);return _0x1420c2(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);}logger[_0x5e01('0x10')](_0x5e01('0xc'),_0x48b05c,_0x36bd7e['error'][_0x5e01('0x12')]);return _0x3aeaef(_0x36bd7e['error']['message']);}else{logger[_0x5e01('0x13')](_0x5e01('0xc'),_0x48b05c,'request\x20sent');_0x3aeaef(_0x36bd7e[_0x5e01('0x14')]['message']);}})[_0x5e01('0x15')](function(_0x5e4058){logger[_0x5e01('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x48b05c,_0x5e4058);_0x1420c2(_0x5e4058);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 8f1a784..9f2281f 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 _0xc086=['Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','download','diskStorage','join','root','format','basename','originalname','extname','now','post','single','create','update','delete','multer','path','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc086,0x18d));var _0x6c08=function(_0x388460,_0x311393){_0x388460=_0x388460-0x0;var _0x59d1ee=_0xc086[_0x388460];return _0x59d1ee;};'use strict';var multer=require(_0x6c08('0x0'));var util=require('util');var path=require(_0x6c08('0x1'));var timeout=require('connect-timeout');var express=require(_0x6c08('0x2'));var router=express[_0x6c08('0x3')]();var fs_extra=require(_0x6c08('0x4'));var auth=require(_0x6c08('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6c08('0x6'));var controller=require(_0x6c08('0x7'));router[_0x6c08('0x8')]('/',auth[_0x6c08('0x9')](),controller['index']);router['get'](_0x6c08('0xa'),auth[_0x6c08('0x9')](),controller['show']);router[_0x6c08('0x8')]('/:id/download',auth[_0x6c08('0x9')](),controller[_0x6c08('0xb')]);var upload=multer({'storage':multer[_0x6c08('0xc')]({'destination':function(_0x5b2368,_0xc284fc,_0x3b4bc3){_0x3b4bc3(null,path[_0x6c08('0xd')](config[_0x6c08('0xe')],'server/files/sounds/original/'));},'filename':function(_0x5e16fc,_0x25c522,_0x3287b4){_0x25c522['originalname']=_0x25c522['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3287b4(null,util[_0x6c08('0xf')]('%s-%s%s',path[_0x6c08('0x10')](_0x25c522[_0x6c08('0x11')],path[_0x6c08('0x12')](_0x25c522[_0x6c08('0x11')])),Date[_0x6c08('0x13')](),path['extname'](_0x25c522['originalname'])));}})});router[_0x6c08('0x14')]('/',upload[_0x6c08('0x15')]('file'),controller[_0x6c08('0x16')]);router['put'](_0x6c08('0xa'),auth[_0x6c08('0x9')](),controller[_0x6c08('0x17')]);router[_0x6c08('0x18')](_0x6c08('0xa'),auth[_0x6c08('0x9')](),controller[_0x6c08('0x18')]);module['exports']=router; \ No newline at end of file +var _0x491d=['now','post','single','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','show','isAuthenticated','download','join','root','server/files/sounds/original/','originalname','%s-%s%s','extname'];(function(_0x4636b5,_0x626e56){var _0x27a912=function(_0x1bd07d){while(--_0x1bd07d){_0x4636b5['push'](_0x4636b5['shift']());}};_0x27a912(++_0x626e56);}(_0x491d,0xe6));var _0xd491=function(_0x220ca2,_0x424fae){_0x220ca2=_0x220ca2-0x0;var _0x1ce38c=_0x491d[_0x220ca2];return _0x1ce38c;};'use strict';var multer=require(_0xd491('0x0'));var util=require(_0xd491('0x1'));var path=require(_0xd491('0x2'));var timeout=require(_0xd491('0x3'));var express=require(_0xd491('0x4'));var router=express['Router']();var fs_extra=require(_0xd491('0x5'));var auth=require(_0xd491('0x6'));var interaction=require(_0xd491('0x7'));var config=require(_0xd491('0x8'));var controller=require(_0xd491('0x9'));router[_0xd491('0xa')]('/',auth['isAuthenticated'](),controller[_0xd491('0xb')]);router['get'](_0xd491('0xc'),auth['isAuthenticated'](),controller[_0xd491('0xd')]);router['get']('/:id/download',auth[_0xd491('0xe')](),controller[_0xd491('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e3b17,_0x5f177d,_0x497003){_0x497003(null,path[_0xd491('0x10')](config[_0xd491('0x11')],_0xd491('0x12')));},'filename':function(_0x44554d,_0x50fce2,_0x579c67){_0x50fce2[_0xd491('0x13')]=_0x50fce2[_0xd491('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x579c67(null,util['format'](_0xd491('0x14'),path['basename'](_0x50fce2[_0xd491('0x13')],path[_0xd491('0x15')](_0x50fce2[_0xd491('0x13')])),Date[_0xd491('0x16')](),path[_0xd491('0x15')](_0x50fce2['originalname'])));}})});router[_0xd491('0x17')]('/',upload[_0xd491('0x18')]('file'),controller['create']);router['put'](_0xd491('0xc'),auth['isAuthenticated'](),controller[_0xd491('0x19')]);router[_0xd491('0x1a')](_0xd491('0xc'),auth[_0xd491('0xe')](),controller[_0xd491('0x1a')]);module[_0xd491('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 7ed0b3d..32d4aed 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 _0xfc15=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x3b78f0,_0x1b51d5){var _0x213ef3=function(_0x304190){while(--_0x304190){_0x3b78f0['push'](_0x3b78f0['shift']());}};_0x213ef3(++_0x1b51d5);}(_0xfc15,0xd6));var _0x5fc1=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xfc15[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x5fc1('0x0'));module[_0x5fc1('0x1')]={'name':{'type':Sequelize[_0x5fc1('0x2')],'unique':_0x5fc1('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x5fc1('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x5fc1('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x5fc1('0x4')]},'original_sampleCount':{'type':Sequelize[_0x5fc1('0x5')]},'original_channelCount':{'type':Sequelize[_0x5fc1('0x6')]},'original_bitRate':{'type':Sequelize[_0x5fc1('0x5')]},'original_sampleRate':{'type':Sequelize[_0x5fc1('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x5fc1('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x5fc1('0x5')]},'converted_channelCount':{'type':Sequelize[_0x5fc1('0x6')]},'converted_bitRate':{'type':Sequelize[_0x5fc1('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x5fc1('0x6')]}}; \ No newline at end of file +var _0x1629=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING','name'];(function(_0x4fe496,_0x1d8673){var _0x422b24=function(_0x27a644){while(--_0x27a644){_0x4fe496['push'](_0x4fe496['shift']());}};_0x422b24(++_0x1d8673);}(_0x1629,0x1d8));var _0x9162=function(_0x471c4d,_0x297910){_0x471c4d=_0x471c4d-0x0;var _0x29c188=_0x1629[_0x471c4d];return _0x29c188;};'use strict';var Sequelize=require(_0x9162('0x0'));module[_0x9162('0x1')]={'name':{'type':Sequelize[_0x9162('0x2')],'unique':_0x9162('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x9162('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x9162('0x4')]},'original_sampleCount':{'type':Sequelize[_0x9162('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x9162('0x6')]},'converted_format':{'type':Sequelize[_0x9162('0x2')]},'converted_duration':{'type':Sequelize[_0x9162('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x9162('0x5')]},'converted_channelCount':{'type':Sequelize[_0x9162('0x6')]},'converted_bitRate':{'type':Sequelize[_0x9162('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0517f88..ab0676a 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 _0xd32e=['converted_format','existsSync','join','server/files/sounds/converted','Sound\x20not\x20found','download','format','create','file','extname','originalname','basename','filename','wav','server/files/sounds/original','root','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','error','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','description','delete','original_format','unlinkSync','zip-dir','fast-json-patch','request-promise','bluebird','mustache','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','Sounds','UserProfileResource','then','stack','name','send','index','map','Sound','rawAttributes','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','show','intersection','catch','find','save_name'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xd32e,0xa0));var _0xed32=function(_0x4bb95a,_0x4720f5){_0x4bb95a=_0x4bb95a-0x0;var _0x531365=_0xd32e[_0x4bb95a];return _0x531365;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xed32('0x0'));var jsonpatch=require(_0xed32('0x1'));var rp=require(_0xed32('0x2'));var moment=require('moment');var BPromise=require(_0xed32('0x3'));var Mustache=require(_0xed32('0x4'));var util=require(_0xed32('0x5'));var path=require(_0xed32('0x6'));var sox=require(_0xed32('0x7'));var csv=require(_0xed32('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed32('0x9'));var _=require(_0xed32('0xa'));var squel=require(_0xed32('0xb'));var crypto=require(_0xed32('0xc'));var jsforce=require(_0xed32('0xd'));var deskjs=require(_0xed32('0xe'));var toCsv=require(_0xed32('0x8'));var querystring=require(_0xed32('0xf'));var Papa=require(_0xed32('0x10'));var Redis=require(_0xed32('0x11'));var authService=require(_0xed32('0x12'));var qs=require(_0xed32('0x13'));var as=require(_0xed32('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed32('0x15'))(_0xed32('0x16'));var utils=require(_0xed32('0x17'));var config=require(_0xed32('0x18'));var licenseUtil=require(_0xed32('0x19'));var db=require(_0xed32('0x1a'))['db'];function respondWithStatusCode(_0x435a41,_0x3b5330){_0x3b5330=_0x3b5330||0xcc;return function(_0x48239d){if(_0x48239d){return _0x435a41[_0xed32('0x1b')](_0x3b5330);}return _0x435a41[_0xed32('0x1c')](_0x3b5330)[_0xed32('0x1d')]();};}function respondWithResult(_0x508e12,_0x98c52b){_0x98c52b=_0x98c52b||0xc8;return function(_0x2a2ff1){if(_0x2a2ff1){return _0x508e12['status'](_0x98c52b)[_0xed32('0x1e')](_0x2a2ff1);}};}function respondWithFilteredResult(_0x40e650,_0x5b7d28){return function(_0x55e530){if(_0x55e530){var _0x130665=typeof _0x5b7d28[_0xed32('0x1f')]===_0xed32('0x20')&&typeof _0x5b7d28[_0xed32('0x21')]===_0xed32('0x20');var _0xcbf29e=_0x55e530[_0xed32('0x22')];var _0x491b18=_0x130665?0x0:_0x5b7d28[_0xed32('0x1f')];var _0x5c57be=_0x130665?_0x55e530[_0xed32('0x22')]:_0x5b7d28[_0xed32('0x1f')]+_0x5b7d28[_0xed32('0x21')];var _0x2a07d4;if(_0x5c57be>=_0xcbf29e){_0x5c57be=_0xcbf29e;_0x2a07d4=0xc8;}else{_0x2a07d4=0xce;}_0x40e650[_0xed32('0x1c')](_0x2a07d4);return _0x40e650[_0xed32('0x23')](_0xed32('0x24'),_0x491b18+'-'+_0x5c57be+'/'+_0xcbf29e)['json'](_0x55e530);}return null;};}function patchUpdates(_0x153f5e){return function(_0x2e7085){try{jsonpatch[_0xed32('0x25')](_0x2e7085,_0x153f5e,!![]);}catch(_0x45eb48){return BPromise['reject'](_0x45eb48);}return _0x2e7085[_0xed32('0x26')]();};}function saveUpdates(_0x178237,_0x194b1f){return function(_0x3d655d){if(_0x3d655d){return _0x3d655d[_0xed32('0x27')](_0x178237)['then'](function(_0x10fe06){return _0x10fe06;});}return null;};}function removeEntity(_0x135591,_0x144825){return function(_0x1c896f){if(_0x1c896f){return _0x1c896f[_0xed32('0x28')]()['then'](function(){var _0xa9f31f=_0x1c896f[_0xed32('0x29')]({'plain':!![]});var _0x480fa6=_0xed32('0x2a');return db[_0xed32('0x2b')]['destroy']({'where':{'type':_0x480fa6,'resourceId':_0xa9f31f['id']}})[_0xed32('0x2c')](function(){return _0x1c896f;});})[_0xed32('0x2c')](function(){_0x135591[_0xed32('0x1c')](0xcc)[_0xed32('0x1d')]();});}};}function handleEntityNotFound(_0x4ccd57,_0x525cbf){return function(_0x3704c){if(!_0x3704c){_0x4ccd57[_0xed32('0x1b')](0x194);}return _0x3704c;};}function handleError(_0x59ab82,_0x24b879){_0x24b879=_0x24b879||0x1f4;return function(_0xd69171){logger['error'](_0xd69171[_0xed32('0x2d')]);if(_0xd69171[_0xed32('0x2e')]){delete _0xd69171[_0xed32('0x2e')];}_0x59ab82['status'](_0x24b879)[_0xed32('0x2f')](_0xd69171);};}exports[_0xed32('0x30')]=function(_0xd181e1,_0x2a93a2){var _0x45ee2e={},_0x4574f2={},_0x540a38={'count':0x0,'rows':[]};var _0x659441=_[_0xed32('0x31')](db[_0xed32('0x32')][_0xed32('0x33')],function(_0x3df756){return{'name':_0x3df756['fieldName'],'type':_0x3df756[_0xed32('0x34')]['key']};});_0x4574f2[_0xed32('0x35')]=_[_0xed32('0x31')](_0x659441,_0xed32('0x2e'));_0x4574f2[_0xed32('0x36')]=_[_0xed32('0x37')](_0xd181e1[_0xed32('0x36')]);_0x4574f2[_0xed32('0x38')]=_['intersection'](_0x4574f2['model'],_0x4574f2[_0xed32('0x36')]);_0x45ee2e[_0xed32('0x39')]=_['intersection'](_0x4574f2[_0xed32('0x35')],qs[_0xed32('0x3a')](_0xd181e1['query'][_0xed32('0x3a')]));_0x45ee2e[_0xed32('0x39')]=_0x45ee2e['attributes']['length']?_0x45ee2e[_0xed32('0x39')]:_0x4574f2[_0xed32('0x35')];if(!_0xd181e1[_0xed32('0x36')]['hasOwnProperty'](_0xed32('0x3b'))){_0x45ee2e[_0xed32('0x21')]=qs[_0xed32('0x21')](_0xd181e1['query'][_0xed32('0x21')]);_0x45ee2e['offset']=qs[_0xed32('0x1f')](_0xd181e1[_0xed32('0x36')][_0xed32('0x1f')]);}_0x45ee2e[_0xed32('0x3c')]=qs[_0xed32('0x3d')](_0xd181e1['query'][_0xed32('0x3d')]);_0x45ee2e[_0xed32('0x3e')]=qs['filters'](_[_0xed32('0x3f')](_0xd181e1[_0xed32('0x36')],_0x4574f2[_0xed32('0x38')]),_0x659441);if(_0xd181e1[_0xed32('0x36')][_0xed32('0x40')]){_0x45ee2e[_0xed32('0x3e')]=_[_0xed32('0x41')](_0x45ee2e[_0xed32('0x3e')],{'$or':_[_0xed32('0x31')](_0x659441,function(_0x1d34da){if(_0x1d34da[_0xed32('0x34')]!=='VIRTUAL'){var _0x5159ce={};_0x5159ce[_0x1d34da['name']]={'$like':'%'+_0xd181e1[_0xed32('0x36')]['filter']+'%'};return _0x5159ce;}})});}_0x45ee2e=_[_0xed32('0x41')]({},_0x45ee2e,_0xd181e1[_0xed32('0x42')]);var _0x12dff2={'where':_0x45ee2e[_0xed32('0x3e')]};return db['Sound'][_0xed32('0x22')](_0x12dff2)['then'](function(_0x441026){_0x540a38[_0xed32('0x22')]=_0x441026;if(_0xd181e1['query'][_0xed32('0x43')]){_0x45ee2e[_0xed32('0x44')]=[{'all':!![]}];}return db[_0xed32('0x32')]['findAll'](_0x45ee2e);})['then'](function(_0x40f0eb){_0x540a38['rows']=_0x40f0eb;return _0x540a38;})[_0xed32('0x2c')](respondWithFilteredResult(_0x2a93a2,_0x45ee2e))['catch'](handleError(_0x2a93a2,null));};exports[_0xed32('0x45')]=function(_0xf15000,_0x346073){var _0x2e4ecf={'raw':!![],'where':{'id':_0xf15000['params']['id']}},_0x960fe5={};_0x960fe5[_0xed32('0x35')]=_['keys'](db[_0xed32('0x32')]['rawAttributes']);_0x960fe5[_0xed32('0x36')]=_[_0xed32('0x37')](_0xf15000[_0xed32('0x36')]);_0x960fe5[_0xed32('0x38')]=_[_0xed32('0x46')](_0x960fe5['model'],_0x960fe5[_0xed32('0x36')]);_0x2e4ecf[_0xed32('0x39')]=_[_0xed32('0x46')](_0x960fe5[_0xed32('0x35')],qs[_0xed32('0x3a')](_0xf15000[_0xed32('0x36')][_0xed32('0x3a')]));_0x2e4ecf[_0xed32('0x39')]=_0x2e4ecf['attributes']['length']?_0x2e4ecf[_0xed32('0x39')]:_0x960fe5['model'];if(_0xf15000['query'][_0xed32('0x43')]){_0x2e4ecf[_0xed32('0x44')]=[{'all':!![]}];}_0x2e4ecf=_[_0xed32('0x41')]({},_0x2e4ecf,_0xf15000[_0xed32('0x42')]);return db[_0xed32('0x32')]['find'](_0x2e4ecf)[_0xed32('0x2c')](handleEntityNotFound(_0x346073,null))[_0xed32('0x2c')](respondWithResult(_0x346073,null))[_0xed32('0x47')](handleError(_0x346073,null));};exports['download']=function(_0x239eff,_0x5bbe9f,_0x196837){return db[_0xed32('0x32')][_0xed32('0x48')]({'where':{'id':_0x239eff['params']['id']},'attributes':[_0xed32('0x2e'),_0xed32('0x49'),_0xed32('0x4a')],'raw':!![]})[_0xed32('0x2c')](handleEntityNotFound(_0x5bbe9f,null))[_0xed32('0x2c')](function(_0x356d04){if(_0x356d04){if(!fs[_0xed32('0x4b')](path[_0xed32('0x4c')](config['root'],_0xed32('0x4d'),_0x356d04[_0xed32('0x49')]+'.'+_0x356d04[_0xed32('0x4a')]))){throw new db['Sequelize']['ValidationError'](_0xed32('0x4e'));}return _0x5bbe9f[_0xed32('0x4f')](path[_0xed32('0x4c')](config['root'],'server/files/sounds/converted',util[_0xed32('0x50')]('%s.%s',_0x356d04['save_name'],_0x356d04[_0xed32('0x4a')])),util[_0xed32('0x50')]('%s.%s',_0x356d04['name'],_0x356d04[_0xed32('0x4a')]));}return null;})[_0xed32('0x47')](handleError(_0x5bbe9f,null));};exports[_0xed32('0x51')]=function(_0x3b9bd1,_0x55d316,_0x4974d7){var _0x569ac1={'name':path['basename'](_0x3b9bd1[_0xed32('0x52')]['originalname'],path[_0xed32('0x53')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x54')])),'save_name':path[_0xed32('0x55')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')],path['extname'](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')])),'original_format':path[_0xed32('0x53')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x54')])['substring'](0x1),'converted_format':_0xed32('0x57')};var _0x597104=path['join'](config['root'],_0xed32('0x58'),_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')]);var _0x571c94=path[_0xed32('0x4c')](config[_0xed32('0x59')],_0xed32('0x4d'),util[_0xed32('0x50')](_0xed32('0x5a'),path[_0xed32('0x55')](_0x3b9bd1[_0xed32('0x52')][_0xed32('0x56')],path['extname'](_0x3b9bd1['file'][_0xed32('0x56')])),_0x569ac1['converted_format']));logger[_0xed32('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x597104);logger['info'](_0xed32('0x5c'),_0x571c94);try{fs[_0xed32('0x5d')](_0x597104,parseInt('0777',0x8));var _0x3715c4=sox['transcode'](_0x597104,_0x571c94,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3715c4['on'](_0xed32('0x5e'),function(_0x4c05a9){fs['unlinkSync'](_0x597104);_0x55d316['status'](0x1f4)['send'](_0x4c05a9);});_0x3715c4['on'](_0xed32('0x5f'),function(_0x81f592){_0x569ac1[_0xed32('0x60')]=isNaN(_0x81f592[_0xed32('0x61')])?null:_0x81f592[_0xed32('0x61')]*0x3e8;_0x569ac1[_0xed32('0x62')]=isNaN(_0x81f592['sampleCount'])?null:_0x81f592[_0xed32('0x63')];_0x569ac1[_0xed32('0x64')]=isNaN(_0x81f592[_0xed32('0x65')])?null:_0x81f592[_0xed32('0x65')];_0x569ac1[_0xed32('0x66')]=isNaN(_0x81f592['bitRate'])?null:_0x81f592[_0xed32('0x67')];_0x569ac1[_0xed32('0x68')]=isNaN(_0x81f592[_0xed32('0x69')])?null:_0x81f592['sampleRate'];});_0x3715c4['on']('dest',function(_0x5ca732){_0x569ac1['converted_duration']=isNaN(_0x5ca732[_0xed32('0x61')])?null:_0x5ca732[_0xed32('0x61')]*0x3e8;_0x569ac1[_0xed32('0x6a')]=isNaN(_0x5ca732[_0xed32('0x63')])?null:_0x5ca732[_0xed32('0x63')];_0x569ac1['converted_channelCount']=isNaN(_0x5ca732[_0xed32('0x65')])?null:_0x5ca732[_0xed32('0x65')];_0x569ac1[_0xed32('0x6b')]=isNaN(_0x5ca732[_0xed32('0x67')])?null:_0x5ca732['bitRate'];_0x569ac1['converted_sampleRate']=isNaN(_0x5ca732[_0xed32('0x69')])?null:_0x5ca732[_0xed32('0x69')];});_0x3715c4['on'](_0xed32('0x1d'),function(){fs['chmodSync'](_0x571c94,parseInt('0777',0x8));return db[_0xed32('0x32')][_0xed32('0x51')](_0x569ac1)['then'](function(_0x44f238){var _0xedb84c={'role':_0x3b9bd1[_0xed32('0x6c')][_0xed32('0x6d')],'userProfileId':_0x3b9bd1[_0xed32('0x6c')][_0xed32('0x6e')]};if(!_0xedb84c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xedb84c[_0xed32('0x6d')]==='user'){var _0xd515ad=_0x44f238[_0xed32('0x29')]({'plain':!![]});return db['UserProfileSection'][_0xed32('0x48')]({'where':{'name':_0xed32('0x2a'),'userProfileId':_0xedb84c['userProfileId']},'raw':!![]})[_0xed32('0x2c')](function(_0x16dbb1){if(_0x16dbb1&&_0x16dbb1['autoAssociation']===0x0){return db[_0xed32('0x2b')][_0xed32('0x51')]({'name':_0xd515ad[_0xed32('0x2e')],'resourceId':_0xd515ad['id'],'type':_0x16dbb1[_0xed32('0x2e')],'sectionId':_0x16dbb1['id']},{})[_0xed32('0x2c')](function(){return _0x44f238;});}else{return _0x44f238;}})[_0xed32('0x47')](function(_0x1861ef){logger[_0xed32('0x5e')](_0xed32('0x6f'),_0x1861ef);throw _0x1861ef;});}return _0x44f238;})[_0xed32('0x2c')](respondWithResult(_0x55d316,null))['catch'](handleError(_0x55d316,null));});_0x3715c4['start']();}catch(_0x2ac4f2){_0x55d316[_0xed32('0x1c')](0x1f4)[_0xed32('0x2f')](_0x2ac4f2);}};exports[_0xed32('0x27')]=function(_0x3f89f8,_0x392b2e,_0x484874){return db['Sound'][_0xed32('0x48')]({'where':{'id':_0x3f89f8[_0xed32('0x70')]['id']}})[_0xed32('0x2c')](handleEntityNotFound(_0x392b2e,null))['then'](saveUpdates(_['pick'](_0x3f89f8['body'],[_0xed32('0x2e'),_0xed32('0x71')]),null))[_0xed32('0x2c')](respondWithResult(_0x392b2e,null))[_0xed32('0x47')](handleError(_0x392b2e,null));};exports[_0xed32('0x72')]=function(_0x4d10a3,_0x1e1c14,_0x5dd942){return db[_0xed32('0x32')]['find']({'where':{'id':_0x4d10a3[_0xed32('0x70')]['id']}})[_0xed32('0x2c')](function(_0x17ee95){if(_0x17ee95){return _0x17ee95[_0xed32('0x28')]();}})[_0xed32('0x2c')](function(_0x1f691a){var _0x3333a0=path[_0xed32('0x4c')](config[_0xed32('0x59')],_0xed32('0x58'),util[_0xed32('0x50')]('%s.%s',_0x1f691a[_0xed32('0x49')],_0x1f691a[_0xed32('0x73')]));var _0x1e1c0c=path[_0xed32('0x4c')](config[_0xed32('0x59')],'server/files/sounds/converted',util[_0xed32('0x50')](_0xed32('0x5a'),_0x1f691a[_0xed32('0x49')],_0x1f691a['converted_format']));fs['unlinkSync'](_0x3333a0);fs[_0xed32('0x74')](_0x1e1c0c);return _0x1f691a;})[_0xed32('0x2c')](function(_0x1c1e9c){if(_0x1c1e9c){return _0x1e1c14['status'](0xcc)[_0xed32('0x1d')]();}})[_0xed32('0x2c')](handleEntityNotFound(_0x1e1c14,null))[_0xed32('0x47')](handleError(_0x1e1c14,null));}; \ No newline at end of file +var _0xfa50=['apply','reject','update','then','get','Sounds','UserProfileResource','end','error','stack','index','map','Sound','rawAttributes','key','model','name','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','sort','filters','filter','where','type','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','download','find','params','existsSync','root','server/files/sounds/converted','save_name','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','join','%s.%s','create','originalname','file','basename','filename','extname','substring','wav','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','info','0777','transcode','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','description','original_format','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','set','Content-Range'];(function(_0x582d9c,_0x28e6ab){var _0x3baea6=function(_0x1ff1da){while(--_0x1ff1da){_0x582d9c['push'](_0x582d9c['shift']());}};_0x3baea6(++_0x28e6ab);}(_0xfa50,0x152));var _0x0fa5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfa50[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x0fa5('0x0'));var rimraf=require(_0x0fa5('0x1'));var zipdir=require(_0x0fa5('0x2'));var jsonpatch=require(_0x0fa5('0x3'));var rp=require(_0x0fa5('0x4'));var moment=require(_0x0fa5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0fa5('0x6'));var util=require(_0x0fa5('0x7'));var path=require(_0x0fa5('0x8'));var sox=require(_0x0fa5('0x9'));var csv=require(_0x0fa5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fa5('0xb'));var squel=require(_0x0fa5('0xc'));var crypto=require(_0x0fa5('0xd'));var jsforce=require(_0x0fa5('0xe'));var deskjs=require(_0x0fa5('0xf'));var toCsv=require(_0x0fa5('0xa'));var querystring=require('querystring');var Papa=require(_0x0fa5('0x10'));var Redis=require(_0x0fa5('0x11'));var authService=require(_0x0fa5('0x12'));var qs=require(_0x0fa5('0x13'));var as=require(_0x0fa5('0x14'));var hardwareService=require(_0x0fa5('0x15'));var logger=require(_0x0fa5('0x16'))('api');var utils=require(_0x0fa5('0x17'));var config=require(_0x0fa5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fa5('0x19'))['db'];function respondWithStatusCode(_0x3c6928,_0x22e561){_0x22e561=_0x22e561||0xcc;return function(_0xd3d0ae){if(_0xd3d0ae){return _0x3c6928[_0x0fa5('0x1a')](_0x22e561);}return _0x3c6928[_0x0fa5('0x1b')](_0x22e561)['end']();};}function respondWithResult(_0xc61427,_0x125fbf){_0x125fbf=_0x125fbf||0xc8;return function(_0x38a6ba){if(_0x38a6ba){return _0xc61427[_0x0fa5('0x1b')](_0x125fbf)[_0x0fa5('0x1c')](_0x38a6ba);}};}function respondWithFilteredResult(_0x228a59,_0x1b0afa){return function(_0x1c5873){if(_0x1c5873){var _0x351c65=typeof _0x1b0afa['offset']===_0x0fa5('0x1d')&&typeof _0x1b0afa[_0x0fa5('0x1e')]===_0x0fa5('0x1d');var _0x1c0932=_0x1c5873['count'];var _0x8c792=_0x351c65?0x0:_0x1b0afa[_0x0fa5('0x1f')];var _0x53f295=_0x351c65?_0x1c5873['count']:_0x1b0afa[_0x0fa5('0x1f')]+_0x1b0afa[_0x0fa5('0x1e')];var _0x5d4864;if(_0x53f295>=_0x1c0932){_0x53f295=_0x1c0932;_0x5d4864=0xc8;}else{_0x5d4864=0xce;}_0x228a59[_0x0fa5('0x1b')](_0x5d4864);return _0x228a59[_0x0fa5('0x20')](_0x0fa5('0x21'),_0x8c792+'-'+_0x53f295+'/'+_0x1c0932)[_0x0fa5('0x1c')](_0x1c5873);}return null;};}function patchUpdates(_0x39a9aa){return function(_0x449b5c){try{jsonpatch[_0x0fa5('0x22')](_0x449b5c,_0x39a9aa,!![]);}catch(_0x418cfc){return BPromise[_0x0fa5('0x23')](_0x418cfc);}return _0x449b5c['save']();};}function saveUpdates(_0x5a3137,_0x16f795){return function(_0x10b14c){if(_0x10b14c){return _0x10b14c[_0x0fa5('0x24')](_0x5a3137)[_0x0fa5('0x25')](function(_0xed0e84){return _0xed0e84;});}return null;};}function removeEntity(_0x18c313,_0x5f3649){return function(_0x1b075c){if(_0x1b075c){return _0x1b075c['destroy']()[_0x0fa5('0x25')](function(){var _0x878258=_0x1b075c[_0x0fa5('0x26')]({'plain':!![]});var _0x1c8768=_0x0fa5('0x27');return db[_0x0fa5('0x28')]['destroy']({'where':{'type':_0x1c8768,'resourceId':_0x878258['id']}})[_0x0fa5('0x25')](function(){return _0x1b075c;});})[_0x0fa5('0x25')](function(){_0x18c313[_0x0fa5('0x1b')](0xcc)[_0x0fa5('0x29')]();});}};}function handleEntityNotFound(_0x2df6e7,_0x5e7383){return function(_0x570062){if(!_0x570062){_0x2df6e7[_0x0fa5('0x1a')](0x194);}return _0x570062;};}function handleError(_0x2d1447,_0x160680){_0x160680=_0x160680||0x1f4;return function(_0x4899f2){logger[_0x0fa5('0x2a')](_0x4899f2[_0x0fa5('0x2b')]);if(_0x4899f2['name']){delete _0x4899f2['name'];}_0x2d1447[_0x0fa5('0x1b')](_0x160680)['send'](_0x4899f2);};}exports[_0x0fa5('0x2c')]=function(_0x550a97,_0x12c372){var _0x2c353f={},_0x1d3ad4={},_0x3406bf={'count':0x0,'rows':[]};var _0x30dec6=_[_0x0fa5('0x2d')](db[_0x0fa5('0x2e')][_0x0fa5('0x2f')],function(_0x1ff8ec){return{'name':_0x1ff8ec['fieldName'],'type':_0x1ff8ec['type'][_0x0fa5('0x30')]};});_0x1d3ad4[_0x0fa5('0x31')]=_[_0x0fa5('0x2d')](_0x30dec6,_0x0fa5('0x32'));_0x1d3ad4['query']=_[_0x0fa5('0x33')](_0x550a97['query']);_0x1d3ad4['filters']=_[_0x0fa5('0x34')](_0x1d3ad4[_0x0fa5('0x31')],_0x1d3ad4['query']);_0x2c353f[_0x0fa5('0x35')]=_['intersection'](_0x1d3ad4[_0x0fa5('0x31')],qs[_0x0fa5('0x36')](_0x550a97[_0x0fa5('0x37')][_0x0fa5('0x36')]));_0x2c353f[_0x0fa5('0x35')]=_0x2c353f[_0x0fa5('0x35')][_0x0fa5('0x38')]?_0x2c353f[_0x0fa5('0x35')]:_0x1d3ad4[_0x0fa5('0x31')];if(!_0x550a97[_0x0fa5('0x37')][_0x0fa5('0x39')](_0x0fa5('0x3a'))){_0x2c353f[_0x0fa5('0x1e')]=qs[_0x0fa5('0x1e')](_0x550a97['query'][_0x0fa5('0x1e')]);_0x2c353f[_0x0fa5('0x1f')]=qs[_0x0fa5('0x1f')](_0x550a97[_0x0fa5('0x37')][_0x0fa5('0x1f')]);}_0x2c353f['order']=qs[_0x0fa5('0x3b')](_0x550a97[_0x0fa5('0x37')][_0x0fa5('0x3b')]);_0x2c353f['where']=qs[_0x0fa5('0x3c')](_['pick'](_0x550a97['query'],_0x1d3ad4[_0x0fa5('0x3c')]),_0x30dec6);if(_0x550a97[_0x0fa5('0x37')][_0x0fa5('0x3d')]){_0x2c353f[_0x0fa5('0x3e')]=_['merge'](_0x2c353f[_0x0fa5('0x3e')],{'$or':_['map'](_0x30dec6,function(_0x50cea8){if(_0x50cea8[_0x0fa5('0x3f')]!==_0x0fa5('0x40')){var _0x3561be={};_0x3561be[_0x50cea8[_0x0fa5('0x32')]]={'$like':'%'+_0x550a97[_0x0fa5('0x37')][_0x0fa5('0x3d')]+'%'};return _0x3561be;}})});}_0x2c353f=_[_0x0fa5('0x41')]({},_0x2c353f,_0x550a97[_0x0fa5('0x42')]);var _0x21e6f6={'where':_0x2c353f[_0x0fa5('0x3e')]};return db[_0x0fa5('0x2e')][_0x0fa5('0x43')](_0x21e6f6)['then'](function(_0x59690e){_0x3406bf[_0x0fa5('0x43')]=_0x59690e;if(_0x550a97[_0x0fa5('0x37')][_0x0fa5('0x44')]){_0x2c353f['include']=[{'all':!![]}];}return db[_0x0fa5('0x2e')][_0x0fa5('0x45')](_0x2c353f);})[_0x0fa5('0x25')](function(_0xb02217){_0x3406bf[_0x0fa5('0x46')]=_0xb02217;return _0x3406bf;})[_0x0fa5('0x25')](respondWithFilteredResult(_0x12c372,_0x2c353f))[_0x0fa5('0x47')](handleError(_0x12c372,null));};exports['show']=function(_0x366287,_0x1a0416){var _0x3b79e5={'raw':!![],'where':{'id':_0x366287['params']['id']}},_0x37c7c7={};_0x37c7c7[_0x0fa5('0x31')]=_[_0x0fa5('0x33')](db['Sound'][_0x0fa5('0x2f')]);_0x37c7c7[_0x0fa5('0x37')]=_[_0x0fa5('0x33')](_0x366287[_0x0fa5('0x37')]);_0x37c7c7[_0x0fa5('0x3c')]=_['intersection'](_0x37c7c7[_0x0fa5('0x31')],_0x37c7c7['query']);_0x3b79e5[_0x0fa5('0x35')]=_[_0x0fa5('0x34')](_0x37c7c7[_0x0fa5('0x31')],qs[_0x0fa5('0x36')](_0x366287[_0x0fa5('0x37')]['fields']));_0x3b79e5[_0x0fa5('0x35')]=_0x3b79e5['attributes'][_0x0fa5('0x38')]?_0x3b79e5['attributes']:_0x37c7c7[_0x0fa5('0x31')];if(_0x366287[_0x0fa5('0x37')][_0x0fa5('0x44')]){_0x3b79e5['include']=[{'all':!![]}];}_0x3b79e5=_['merge']({},_0x3b79e5,_0x366287[_0x0fa5('0x42')]);return db[_0x0fa5('0x2e')]['find'](_0x3b79e5)[_0x0fa5('0x25')](handleEntityNotFound(_0x1a0416,null))[_0x0fa5('0x25')](respondWithResult(_0x1a0416,null))[_0x0fa5('0x47')](handleError(_0x1a0416,null));};exports[_0x0fa5('0x48')]=function(_0x42596e,_0x105f87,_0xf14259){return db[_0x0fa5('0x2e')][_0x0fa5('0x49')]({'where':{'id':_0x42596e[_0x0fa5('0x4a')]['id']},'attributes':[_0x0fa5('0x32'),'save_name','converted_format'],'raw':!![]})[_0x0fa5('0x25')](handleEntityNotFound(_0x105f87,null))[_0x0fa5('0x25')](function(_0x4f9f86){if(_0x4f9f86){if(!fs[_0x0fa5('0x4b')](path['join'](config[_0x0fa5('0x4c')],_0x0fa5('0x4d'),_0x4f9f86[_0x0fa5('0x4e')]+'.'+_0x4f9f86[_0x0fa5('0x4f')]))){throw new db[(_0x0fa5('0x50'))][(_0x0fa5('0x51'))](_0x0fa5('0x52'));}return _0x105f87[_0x0fa5('0x48')](path[_0x0fa5('0x53')](config['root'],_0x0fa5('0x4d'),util['format'](_0x0fa5('0x54'),_0x4f9f86[_0x0fa5('0x4e')],_0x4f9f86[_0x0fa5('0x4f')])),util['format'](_0x0fa5('0x54'),_0x4f9f86[_0x0fa5('0x32')],_0x4f9f86[_0x0fa5('0x4f')]));}return null;})[_0x0fa5('0x47')](handleError(_0x105f87,null));};exports[_0x0fa5('0x55')]=function(_0x1b97ed,_0x54b73c,_0x1e6e9a){var _0x46eb89={'name':path['basename'](_0x1b97ed['file'][_0x0fa5('0x56')],path['extname'](_0x1b97ed[_0x0fa5('0x57')][_0x0fa5('0x56')])),'save_name':path[_0x0fa5('0x58')](_0x1b97ed[_0x0fa5('0x57')][_0x0fa5('0x59')],path['extname'](_0x1b97ed[_0x0fa5('0x57')][_0x0fa5('0x59')])),'original_format':path[_0x0fa5('0x5a')](_0x1b97ed[_0x0fa5('0x57')][_0x0fa5('0x56')])[_0x0fa5('0x5b')](0x1),'converted_format':_0x0fa5('0x5c')};var _0x4a053d=path[_0x0fa5('0x53')](config[_0x0fa5('0x4c')],_0x0fa5('0x5d'),_0x1b97ed['file'][_0x0fa5('0x59')]);var _0x5e1f9f=path['join'](config[_0x0fa5('0x4c')],_0x0fa5('0x4d'),util['format'](_0x0fa5('0x54'),path['basename'](_0x1b97ed[_0x0fa5('0x57')][_0x0fa5('0x59')],path[_0x0fa5('0x5a')](_0x1b97ed['file'][_0x0fa5('0x59')])),_0x46eb89[_0x0fa5('0x4f')]));logger['info'](_0x0fa5('0x5e'),_0x4a053d);logger[_0x0fa5('0x5f')]('Sound\x20upload\x20destination:\x20%s',_0x5e1f9f);try{fs['chmodSync'](_0x4a053d,parseInt(_0x0fa5('0x60'),0x8));var _0x514eea=sox[_0x0fa5('0x61')](_0x4a053d,_0x5e1f9f,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x514eea['on']('error',function(_0x32f056){fs[_0x0fa5('0x62')](_0x4a053d);_0x54b73c[_0x0fa5('0x1b')](0x1f4)[_0x0fa5('0x63')](_0x32f056);});_0x514eea['on'](_0x0fa5('0x64'),function(_0x38cc5f){_0x46eb89[_0x0fa5('0x65')]=isNaN(_0x38cc5f[_0x0fa5('0x66')])?null:_0x38cc5f[_0x0fa5('0x66')]*0x3e8;_0x46eb89['original_sampleCount']=isNaN(_0x38cc5f[_0x0fa5('0x67')])?null:_0x38cc5f['sampleCount'];_0x46eb89[_0x0fa5('0x68')]=isNaN(_0x38cc5f[_0x0fa5('0x69')])?null:_0x38cc5f['channelCount'];_0x46eb89['original_bitRate']=isNaN(_0x38cc5f[_0x0fa5('0x6a')])?null:_0x38cc5f['bitRate'];_0x46eb89['original_sampleRate']=isNaN(_0x38cc5f[_0x0fa5('0x6b')])?null:_0x38cc5f['sampleRate'];});_0x514eea['on']('dest',function(_0x2ef087){_0x46eb89['converted_duration']=isNaN(_0x2ef087[_0x0fa5('0x66')])?null:_0x2ef087['duration']*0x3e8;_0x46eb89[_0x0fa5('0x6c')]=isNaN(_0x2ef087[_0x0fa5('0x67')])?null:_0x2ef087[_0x0fa5('0x67')];_0x46eb89[_0x0fa5('0x6d')]=isNaN(_0x2ef087[_0x0fa5('0x69')])?null:_0x2ef087[_0x0fa5('0x69')];_0x46eb89[_0x0fa5('0x6e')]=isNaN(_0x2ef087[_0x0fa5('0x6a')])?null:_0x2ef087[_0x0fa5('0x6a')];_0x46eb89['converted_sampleRate']=isNaN(_0x2ef087['sampleRate'])?null:_0x2ef087['sampleRate'];});_0x514eea['on'](_0x0fa5('0x29'),function(){fs['chmodSync'](_0x5e1f9f,parseInt(_0x0fa5('0x60'),0x8));return db['Sound']['create'](_0x46eb89)[_0x0fa5('0x25')](function(_0x2ee8d7){var _0x4288dc={'role':_0x1b97ed[_0x0fa5('0x6f')][_0x0fa5('0x70')],'userProfileId':_0x1b97ed['body'][_0x0fa5('0x71')]};if(!_0x4288dc)throw new Error(_0x0fa5('0x72'));if(_0x4288dc['role']===_0x0fa5('0x73')){var _0x35630f=_0x2ee8d7['get']({'plain':!![]});return db[_0x0fa5('0x74')]['find']({'where':{'name':'Sounds','userProfileId':_0x4288dc[_0x0fa5('0x71')]},'raw':!![]})[_0x0fa5('0x25')](function(_0x3958e3){if(_0x3958e3&&_0x3958e3[_0x0fa5('0x75')]===0x0){return db['UserProfileResource'][_0x0fa5('0x55')]({'name':_0x35630f[_0x0fa5('0x32')],'resourceId':_0x35630f['id'],'type':_0x3958e3['name'],'sectionId':_0x3958e3['id']},{})[_0x0fa5('0x25')](function(){return _0x2ee8d7;});}else{return _0x2ee8d7;}})['catch'](function(_0x47521e){logger[_0x0fa5('0x2a')](_0x0fa5('0x76'),_0x47521e);throw _0x47521e;});}return _0x2ee8d7;})[_0x0fa5('0x25')](respondWithResult(_0x54b73c,null))['catch'](handleError(_0x54b73c,null));});_0x514eea[_0x0fa5('0x77')]();}catch(_0x159480){_0x54b73c[_0x0fa5('0x1b')](0x1f4)[_0x0fa5('0x63')](_0x159480);}};exports['update']=function(_0x4ebb9b,_0x4e7d1a,_0x355bc1){return db[_0x0fa5('0x2e')]['find']({'where':{'id':_0x4ebb9b['params']['id']}})['then'](handleEntityNotFound(_0x4e7d1a,null))[_0x0fa5('0x25')](saveUpdates(_[_0x0fa5('0x78')](_0x4ebb9b[_0x0fa5('0x6f')],[_0x0fa5('0x32'),_0x0fa5('0x79')]),null))[_0x0fa5('0x25')](respondWithResult(_0x4e7d1a,null))[_0x0fa5('0x47')](handleError(_0x4e7d1a,null));};exports['delete']=function(_0x31fb9d,_0x872ba6,_0xbfc764){return db['Sound']['find']({'where':{'id':_0x31fb9d['params']['id']}})[_0x0fa5('0x25')](function(_0x5b4ae1){if(_0x5b4ae1){return _0x5b4ae1['destroy']();}})[_0x0fa5('0x25')](function(_0x27444f){var _0x3a29b5=path[_0x0fa5('0x53')](config[_0x0fa5('0x4c')],_0x0fa5('0x5d'),util['format'](_0x0fa5('0x54'),_0x27444f[_0x0fa5('0x4e')],_0x27444f[_0x0fa5('0x7a')]));var _0x16bf83=path[_0x0fa5('0x53')](config[_0x0fa5('0x4c')],_0x0fa5('0x4d'),util[_0x0fa5('0x7b')](_0x0fa5('0x54'),_0x27444f[_0x0fa5('0x4e')],_0x27444f[_0x0fa5('0x4f')]));fs['unlinkSync'](_0x3a29b5);fs[_0x0fa5('0x62')](_0x16bf83);return _0x27444f;})[_0x0fa5('0x25')](function(_0x579b7e){if(_0x579b7e){return _0x872ba6[_0x0fa5('0x1b')](0xcc)[_0x0fa5('0x29')]();}})[_0x0fa5('0x25')](handleEntityNotFound(_0x872ba6,null))[_0x0fa5('0x47')](handleError(_0x872ba6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e084d80..7a7de1e 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 _0x7689=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','Sound','lodash','util','../../config/logger','api'];(function(_0xe480c6,_0x224bb4){var _0x48290b=function(_0x2bfe9d){while(--_0x2bfe9d){_0xe480c6['push'](_0xe480c6['shift']());}};_0x48290b(++_0x224bb4);}(_0x7689,0xe6));var _0x9768=function(_0x3547d7,_0x31561a){_0x3547d7=_0x3547d7-0x0;var _0x32fb3c=_0x7689[_0x3547d7];return _0x32fb3c;};'use strict';var _=require(_0x9768('0x0'));var util=require(_0x9768('0x1'));var logger=require(_0x9768('0x2'))(_0x9768('0x3'));var moment=require(_0x9768('0x4'));var BPromise=require(_0x9768('0x5'));var rp=require(_0x9768('0x6'));var fs=require('fs');var path=require(_0x9768('0x7'));var rimraf=require(_0x9768('0x8'));var config=require(_0x9768('0x9'));var attributes=require(_0x9768('0xa'));module[_0x9768('0xb')]=function(_0x2d46cc,_0xf48898){return _0x2d46cc['define'](_0x9768('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x725c=['api','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','tools_sounds','util','../../config/logger'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x725c,0xa8));var _0xc725=function(_0x20d290,_0x40fc11){_0x20d290=_0x20d290-0x0;var _0x2bfa8f=_0x725c[_0x20d290];return _0x2bfa8f;};'use strict';var _=require('lodash');var util=require(_0xc725('0x0'));var logger=require(_0xc725('0x1'))(_0xc725('0x2'));var moment=require(_0xc725('0x3'));var BPromise=require(_0xc725('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc725('0x5'));var rimraf=require(_0xc725('0x6'));var config=require(_0xc725('0x7'));var attributes=require(_0xc725('0x8'));module['exports']=function(_0x1f379e,_0x272a83){return _0x1f379e['define']('Sound',attributes,{'tableName':_0xc725('0x9'),'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 ceff77b..6d5e4b0 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 _0x80f2=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','ShowSound','Sound','find','options','raw','where','include','map','model','attributes','stringify','lodash','util'];(function(_0x1df79c,_0x5ad8fd){var _0x2f23e4=function(_0x47836f){while(--_0x47836f){_0x1df79c['push'](_0x1df79c['shift']());}};_0x2f23e4(++_0x5ad8fd);}(_0x80f2,0x130));var _0x280f=function(_0x104be8,_0x51a270){_0x104be8=_0x104be8-0x0;var _0x49b8cf=_0x80f2[_0x104be8];return _0x49b8cf;};'use strict';var _=require(_0x280f('0x0'));var util=require(_0x280f('0x1'));var moment=require('moment');var BPromise=require(_0x280f('0x2'));var rs=require(_0x280f('0x3'));var fs=require('fs');var Redis=require(_0x280f('0x4'));var db=require(_0x280f('0x5'))['db'];var utils=require(_0x280f('0x6'));var logger=require(_0x280f('0x7'))(_0x280f('0x8'));var config=require(_0x280f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x280f('0xa')][_0x280f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dcf13,_0x948146,_0x2f7009){return new BPromise(function(_0x5b7e36,_0x3db190){return client[_0x280f('0xc')](_0x4dcf13,_0x2f7009)[_0x280f('0xd')](function(_0x598ea4){logger[_0x280f('0xe')](_0x280f('0xf'),_0x948146,'request\x20sent');logger[_0x280f('0x10')](_0x280f('0x11'),_0x948146,_0x280f('0x12'),JSON['stringify'](_0x598ea4));if(_0x598ea4[_0x280f('0x13')]){if(_0x598ea4[_0x280f('0x13')][_0x280f('0x14')]===0x1f4){logger[_0x280f('0x13')]('Sound,\x20%s,\x20%s',_0x948146,_0x598ea4[_0x280f('0x13')]['message']);return _0x3db190(_0x598ea4[_0x280f('0x13')][_0x280f('0x15')]);}logger[_0x280f('0x13')](_0x280f('0xf'),_0x948146,_0x598ea4[_0x280f('0x13')]['message']);return _0x5b7e36(_0x598ea4['error'][_0x280f('0x15')]);}else{logger[_0x280f('0xe')]('Sound,\x20%s,\x20%s',_0x948146,'request\x20sent');_0x5b7e36(_0x598ea4['result'][_0x280f('0x15')]);}})[_0x280f('0x16')](function(_0x1fff9d){logger[_0x280f('0x13')]('Sound,\x20%s,\x20%s',_0x948146,_0x1fff9d);_0x3db190(_0x1fff9d);});});}exports[_0x280f('0x17')]=function(_0x528c81){var _0x7ddb0a=this;return new Promise(function(_0x40badf,_0x5af642){return db[_0x280f('0x18')][_0x280f('0x19')]({'raw':_0x528c81[_0x280f('0x1a')]?_0x528c81['options'][_0x280f('0x1b')]===undefined?!![]:![]:!![],'where':_0x528c81[_0x280f('0x1a')]?_0x528c81[_0x280f('0x1a')][_0x280f('0x1c')]||null:null,'attributes':_0x528c81[_0x280f('0x1a')]?_0x528c81[_0x280f('0x1a')]['attributes']||null:null,'include':_0x528c81[_0x280f('0x1a')]?_0x528c81[_0x280f('0x1a')][_0x280f('0x1d')]?_[_0x280f('0x1e')](_0x528c81[_0x280f('0x1a')]['include'],function(_0x1f8dd3){return{'model':db[_0x1f8dd3['model']],'as':_0x1f8dd3['as'],'attributes':_0x1f8dd3['attributes'],'include':_0x1f8dd3[_0x280f('0x1d')]?_[_0x280f('0x1e')](_0x1f8dd3['include'],function(_0xf4d769){return{'model':db[_0xf4d769['model']],'as':_0xf4d769['as'],'attributes':_0xf4d769['attributes'],'include':_0xf4d769[_0x280f('0x1d')]?_[_0x280f('0x1e')](_0xf4d769[_0x280f('0x1d')],function(_0x3a0cf2){return{'model':db[_0x3a0cf2[_0x280f('0x1f')]],'as':_0x3a0cf2['as'],'attributes':_0x3a0cf2[_0x280f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x280f('0xd')](function(_0x3860ba){logger[_0x280f('0xe')]('ShowSound',_0x528c81);logger['debug'](_0x280f('0x17'),_0x528c81,JSON[_0x280f('0x21')](_0x3860ba));_0x40badf(_0x3860ba);})['catch'](function(_0x5a716a){logger[_0x280f('0x13')](_0x280f('0x17'),_0x5a716a[_0x280f('0x15')],_0x528c81);_0x5af642(_0x7ddb0a[_0x280f('0x13')](0x1f4,_0x5a716a['message']));});});}; \ No newline at end of file +var _0x935d=['then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Sound','options','raw','where','attributes','include','model','map','ShowSound','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x5eb39a,_0x392f2e){var _0x5c3c75=function(_0x388b41){while(--_0x388b41){_0x5eb39a['push'](_0x5eb39a['shift']());}};_0x5c3c75(++_0x392f2e);}(_0x935d,0x1b5));var _0xd935=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x935d[_0x725a4c];return _0x37b2cc;};'use strict';var _=require('lodash');var util=require(_0xd935('0x0'));var moment=require(_0xd935('0x1'));var BPromise=require(_0xd935('0x2'));var rs=require(_0xd935('0x3'));var fs=require('fs');var Redis=require(_0xd935('0x4'));var db=require(_0xd935('0x5'))['db'];var utils=require(_0xd935('0x6'));var logger=require(_0xd935('0x7'))('rpc');var config=require(_0xd935('0x8'));var jayson=require(_0xd935('0x9'));var client=jayson['client'][_0xd935('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c642d,_0x377cfc,_0x20a573){return new BPromise(function(_0x1d1259,_0x59ed94){return client['request'](_0x1c642d,_0x20a573)[_0xd935('0xb')](function(_0x30c4bd){logger[_0xd935('0xc')](_0xd935('0xd'),_0x377cfc,_0xd935('0xe'));logger[_0xd935('0xf')](_0xd935('0x10'),_0x377cfc,_0xd935('0xe'),JSON[_0xd935('0x11')](_0x30c4bd));if(_0x30c4bd[_0xd935('0x12')]){if(_0x30c4bd['error'][_0xd935('0x13')]===0x1f4){logger['error'](_0xd935('0xd'),_0x377cfc,_0x30c4bd[_0xd935('0x12')][_0xd935('0x14')]);return _0x59ed94(_0x30c4bd[_0xd935('0x12')][_0xd935('0x14')]);}logger['error'](_0xd935('0xd'),_0x377cfc,_0x30c4bd[_0xd935('0x12')][_0xd935('0x14')]);return _0x1d1259(_0x30c4bd[_0xd935('0x12')]['message']);}else{logger['info'](_0xd935('0xd'),_0x377cfc,_0xd935('0xe'));_0x1d1259(_0x30c4bd[_0xd935('0x15')][_0xd935('0x14')]);}})[_0xd935('0x16')](function(_0xe3a73a){logger[_0xd935('0x12')](_0xd935('0xd'),_0x377cfc,_0xe3a73a);_0x59ed94(_0xe3a73a);});});}exports['ShowSound']=function(_0x44cb50){var _0x59daf5=this;return new Promise(function(_0x9d780,_0x40773a){return db[_0xd935('0x17')]['find']({'raw':_0x44cb50[_0xd935('0x18')]?_0x44cb50[_0xd935('0x18')][_0xd935('0x19')]===undefined?!![]:![]:!![],'where':_0x44cb50[_0xd935('0x18')]?_0x44cb50['options'][_0xd935('0x1a')]||null:null,'attributes':_0x44cb50[_0xd935('0x18')]?_0x44cb50[_0xd935('0x18')][_0xd935('0x1b')]||null:null,'include':_0x44cb50[_0xd935('0x18')]?_0x44cb50[_0xd935('0x18')][_0xd935('0x1c')]?_['map'](_0x44cb50[_0xd935('0x18')][_0xd935('0x1c')],function(_0x4992b1){return{'model':db[_0x4992b1[_0xd935('0x1d')]],'as':_0x4992b1['as'],'attributes':_0x4992b1[_0xd935('0x1b')],'include':_0x4992b1['include']?_[_0xd935('0x1e')](_0x4992b1[_0xd935('0x1c')],function(_0x266f28){return{'model':db[_0x266f28[_0xd935('0x1d')]],'as':_0x266f28['as'],'attributes':_0x266f28[_0xd935('0x1b')],'include':_0x266f28['include']?_[_0xd935('0x1e')](_0x266f28['include'],function(_0x1b6cd2){return{'model':db[_0x1b6cd2['model']],'as':_0x1b6cd2['as'],'attributes':_0x1b6cd2['attributes']};}):[]};}):[]};}):[]:[]})[_0xd935('0xb')](function(_0xa4a3ac){logger['info'](_0xd935('0x1f'),_0x44cb50);logger[_0xd935('0xf')](_0xd935('0x1f'),_0x44cb50,JSON['stringify'](_0xa4a3ac));_0x9d780(_0xa4a3ac);})['catch'](function(_0x522ead){logger['error'](_0xd935('0x1f'),_0x522ead[_0xd935('0x14')],_0x44cb50);_0x40773a(_0x59daf5[_0xd935('0x12')](0x1f4,_0x522ead[_0xd935('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 00995a1..80d267f 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x2fba2b,_0x4977bf){var _0x438896=function(_0x3c73ca){while(--_0x3c73ca){_0x2fba2b['push'](_0x2fba2b['shift']());}};_0x438896(++_0x4977bf);}(_0xda3f,0xec));var _0xfda3=function(_0x2e1bf0,_0xbdd79f){_0x2e1bf0=_0x2e1bf0-0x0;var _0x2db958=_0xda3f[_0x2e1bf0];return _0x2db958;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x41e10,_0x17657d){var _0x4efe10=function(_0x5dacde){while(--_0x5dacde){_0x41e10['push'](_0x41e10['shift']());}};_0x4efe10(++_0x17657d);}(_0xda3f,0xec));var _0xfda3=function(_0x55f068,_0x21128a){_0x55f068=_0x55f068-0x0;var _0xbc516d=_0xda3f[_0x55f068];return _0xbc516d;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 34ec967..e371641 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 _0x4746=['TEXT','ENUM','out','sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4746,0x93));var _0x6474=function(_0x4c20f8,_0x1255e1){_0x4c20f8=_0x4c20f8-0x0;var _0x1e8a8a=_0x4746[_0x4c20f8];return _0x1e8a8a;};'use strict';var Sequelize=require(_0x6474('0x0'));module[_0x6474('0x1')]={'uniqueid':{'type':Sequelize[_0x6474('0x2')]},'body':{'type':Sequelize[_0x6474('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x6474('0x4')]('in',_0x6474('0x5')),'defaultValue':_0x6474('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x6474('0x2')]},'providerResponse':{'type':Sequelize[_0x6474('0x3')]}}; \ No newline at end of file +var _0x7c06=['STRING','TEXT','medium','out','sequelize'];(function(_0xaf7d7f,_0x3fad2e){var _0x263731=function(_0x4c68fd){while(--_0x4c68fd){_0xaf7d7f['push'](_0xaf7d7f['shift']());}};_0x263731(++_0x3fad2e);}(_0x7c06,0x1da));var _0x67c0=function(_0x5ce268,_0x1835b6){_0x5ce268=_0x5ce268-0x0;var _0x28c96a=_0x7c06[_0x5ce268];return _0x28c96a;};'use strict';var Sequelize=require(_0x67c0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x67c0('0x1')]},'body':{'type':Sequelize[_0x67c0('0x2')](_0x67c0('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x67c0('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x67c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index ca2e52a..0bbd538 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 _0xae0d=['status','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','length','includeAll','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x508435,_0x376102){var _0x182b58=function(_0x3eb9fb){while(--_0x3eb9fb){_0x508435['push'](_0x508435['shift']());}};_0x182b58(++_0x376102);}(_0xae0d,0x14e));var _0xdae0=function(_0x32c8c2,_0x4b9d13){_0x32c8c2=_0x32c8c2-0x0;var _0x477dd8=_0xae0d[_0x32c8c2];return _0x477dd8;};'use strict';var emlformat=require(_0xdae0('0x0'));var rimraf=require(_0xdae0('0x1'));var zipdir=require(_0xdae0('0x2'));var jsonpatch=require(_0xdae0('0x3'));var rp=require('request-promise');var moment=require(_0xdae0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdae0('0x5'));var util=require(_0xdae0('0x6'));var path=require(_0xdae0('0x7'));var sox=require('sox');var csv=require(_0xdae0('0x8'));var ejs=require(_0xdae0('0x9'));var fs=require('fs');var fs_extra=require(_0xdae0('0xa'));var _=require(_0xdae0('0xb'));var squel=require('squel');var crypto=require(_0xdae0('0xc'));var jsforce=require(_0xdae0('0xd'));var deskjs=require(_0xdae0('0xe'));var toCsv=require(_0xdae0('0x8'));var querystring=require('querystring');var Papa=require(_0xdae0('0xf'));var Redis=require(_0xdae0('0x10'));var authService=require(_0xdae0('0x11'));var qs=require(_0xdae0('0x12'));var as=require(_0xdae0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdae0('0x14'))(_0xdae0('0x15'));var utils=require('../../config/utils');var config=require(_0xdae0('0x16'));var licenseUtil=require(_0xdae0('0x17'));var db=require(_0xdae0('0x18'))['db'];function respondWithStatusCode(_0x2709a4,_0x55a111){_0x55a111=_0x55a111||0xcc;return function(_0x24dacd){if(_0x24dacd){return _0x2709a4[_0xdae0('0x19')](_0x55a111);}return _0x2709a4[_0xdae0('0x1a')](_0x55a111)['end']();};}function respondWithResult(_0x5d862e,_0x31d186){_0x31d186=_0x31d186||0xc8;return function(_0x342812){if(_0x342812){return _0x5d862e[_0xdae0('0x1a')](_0x31d186)[_0xdae0('0x1b')](_0x342812);}};}function respondWithFilteredResult(_0x1643ba,_0x356fd5){return function(_0x4d7bce){if(_0x4d7bce){var _0x42c54c=typeof _0x356fd5[_0xdae0('0x1c')]===_0xdae0('0x1d')&&typeof _0x356fd5[_0xdae0('0x1e')]===_0xdae0('0x1d');var _0x22bccf=_0x4d7bce['count'];var _0x248666=_0x42c54c?0x0:_0x356fd5['offset'];var _0x23dcd4=_0x42c54c?_0x4d7bce[_0xdae0('0x1f')]:_0x356fd5[_0xdae0('0x1c')]+_0x356fd5['limit'];var _0x4729d9;if(_0x23dcd4>=_0x22bccf){_0x23dcd4=_0x22bccf;_0x4729d9=0xc8;}else{_0x4729d9=0xce;}_0x1643ba['status'](_0x4729d9);return _0x1643ba[_0xdae0('0x20')]('Content-Range',_0x248666+'-'+_0x23dcd4+'/'+_0x22bccf)['json'](_0x4d7bce);}return null;};}function patchUpdates(_0x5e669e){return function(_0x4fbdbd){try{jsonpatch['apply'](_0x4fbdbd,_0x5e669e,!![]);}catch(_0x231dc4){return BPromise['reject'](_0x231dc4);}return _0x4fbdbd['save']();};}function saveUpdates(_0x46a063,_0x3191c1){return function(_0x4f8d67){if(_0x4f8d67){return _0x4f8d67[_0xdae0('0x21')](_0x46a063)[_0xdae0('0x22')](function(_0x1d7a55){return _0x1d7a55;});}return null;};}function removeEntity(_0x46863d,_0x4aaf1e){return function(_0x3b990e){if(_0x3b990e){return _0x3b990e[_0xdae0('0x23')]()[_0xdae0('0x22')](function(){_0x46863d[_0xdae0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x163605,_0x154000){return function(_0x5845d8){if(!_0x5845d8){_0x163605['sendStatus'](0x194);}return _0x5845d8;};}function handleError(_0x2a81fd,_0x3f718e){_0x3f718e=_0x3f718e||0x1f4;return function(_0x1ed515){logger[_0xdae0('0x24')](_0x1ed515[_0xdae0('0x25')]);if(_0x1ed515[_0xdae0('0x26')]){delete _0x1ed515[_0xdae0('0x26')];}_0x2a81fd[_0xdae0('0x1a')](_0x3f718e)['send'](_0x1ed515);};}exports[_0xdae0('0x27')]=function(_0xd55123,_0x233b04){var _0xebd483={},_0x49f72b={},_0x34af05={'count':0x0,'rows':[]};var _0x4ade5a=_[_0xdae0('0x28')](db[_0xdae0('0x29')][_0xdae0('0x2a')],function(_0x4fe8ac){return{'name':_0x4fe8ac[_0xdae0('0x2b')],'type':_0x4fe8ac['type'][_0xdae0('0x2c')]};});_0x49f72b[_0xdae0('0x2d')]=_[_0xdae0('0x28')](_0x4ade5a,'name');_0x49f72b[_0xdae0('0x2e')]=_[_0xdae0('0x2f')](_0xd55123['query']);_0x49f72b[_0xdae0('0x30')]=_[_0xdae0('0x31')](_0x49f72b[_0xdae0('0x2d')],_0x49f72b['query']);_0xebd483[_0xdae0('0x32')]=_[_0xdae0('0x31')](_0x49f72b[_0xdae0('0x2d')],qs[_0xdae0('0x33')](_0xd55123[_0xdae0('0x2e')][_0xdae0('0x33')]));_0xebd483[_0xdae0('0x32')]=_0xebd483[_0xdae0('0x32')]['length']?_0xebd483[_0xdae0('0x32')]:_0x49f72b['model'];if(!_0xd55123[_0xdae0('0x2e')][_0xdae0('0x34')](_0xdae0('0x35'))){_0xebd483['limit']=qs['limit'](_0xd55123['query'][_0xdae0('0x1e')]);_0xebd483[_0xdae0('0x1c')]=qs['offset'](_0xd55123[_0xdae0('0x2e')][_0xdae0('0x1c')]);}_0xebd483[_0xdae0('0x36')]=qs['sort'](_0xd55123['query'][_0xdae0('0x37')]);_0xebd483[_0xdae0('0x38')]=qs[_0xdae0('0x30')](_[_0xdae0('0x39')](_0xd55123[_0xdae0('0x2e')],_0x49f72b[_0xdae0('0x30')]),_0x4ade5a);if(_0xd55123['query'][_0xdae0('0x3a')]){_0xebd483[_0xdae0('0x38')]=_[_0xdae0('0x3b')](_0xebd483[_0xdae0('0x38')],{'$or':_[_0xdae0('0x28')](_0x4ade5a,function(_0x4499f8){if(_0x4499f8['type']!=='VIRTUAL'){var _0x2ecf0e={};_0x2ecf0e[_0x4499f8[_0xdae0('0x26')]]={'$like':'%'+_0xd55123[_0xdae0('0x2e')][_0xdae0('0x3a')]+'%'};return _0x2ecf0e;}})});}_0xebd483=_[_0xdae0('0x3b')]({},_0xebd483,_0xd55123[_0xdae0('0x3c')]);var _0x107bfd={'where':_0xebd483[_0xdae0('0x38')]};return db['SquareMessage']['count'](_0x107bfd)[_0xdae0('0x22')](function(_0xdc83f5){_0x34af05[_0xdae0('0x1f')]=_0xdc83f5;if(_0xd55123[_0xdae0('0x2e')]['includeAll']){_0xebd483[_0xdae0('0x3d')]=[{'all':!![]}];}return db[_0xdae0('0x29')][_0xdae0('0x3e')](_0xebd483);})['then'](function(_0x28fcce){_0x34af05[_0xdae0('0x3f')]=_0x28fcce;return _0x34af05;})[_0xdae0('0x22')](respondWithFilteredResult(_0x233b04,_0xebd483))['catch'](handleError(_0x233b04,null));};exports[_0xdae0('0x40')]=function(_0x1bbfba,_0x381de4){var _0x1f56e4={'raw':!![],'where':{'id':_0x1bbfba['params']['id']}},_0xb5542={};_0xb5542[_0xdae0('0x2d')]=_[_0xdae0('0x2f')](db['SquareMessage'][_0xdae0('0x2a')]);_0xb5542[_0xdae0('0x2e')]=_['keys'](_0x1bbfba[_0xdae0('0x2e')]);_0xb5542[_0xdae0('0x30')]=_['intersection'](_0xb5542[_0xdae0('0x2d')],_0xb5542[_0xdae0('0x2e')]);_0x1f56e4['attributes']=_[_0xdae0('0x31')](_0xb5542['model'],qs[_0xdae0('0x33')](_0x1bbfba[_0xdae0('0x2e')][_0xdae0('0x33')]));_0x1f56e4['attributes']=_0x1f56e4['attributes'][_0xdae0('0x41')]?_0x1f56e4[_0xdae0('0x32')]:_0xb5542['model'];if(_0x1bbfba[_0xdae0('0x2e')][_0xdae0('0x42')]){_0x1f56e4[_0xdae0('0x3d')]=[{'all':!![]}];}_0x1f56e4=_[_0xdae0('0x3b')]({},_0x1f56e4,_0x1bbfba[_0xdae0('0x3c')]);return db[_0xdae0('0x29')][_0xdae0('0x43')](_0x1f56e4)[_0xdae0('0x22')](handleEntityNotFound(_0x381de4,null))['then'](respondWithResult(_0x381de4,null))[_0xdae0('0x44')](handleError(_0x381de4,null));};exports[_0xdae0('0x45')]=function(_0xbc5c74,_0x1d7db6){return db[_0xdae0('0x29')]['create'](_0xbc5c74[_0xdae0('0x46')],{})['then'](respondWithResult(_0x1d7db6,0xc9))['catch'](handleError(_0x1d7db6,null));};exports['update']=function(_0x2bc518,_0x4451fd){if(_0x2bc518[_0xdae0('0x46')]['id']){delete _0x2bc518[_0xdae0('0x46')]['id'];}return db[_0xdae0('0x29')][_0xdae0('0x43')]({'where':{'id':_0x2bc518[_0xdae0('0x47')]['id']}})[_0xdae0('0x22')](handleEntityNotFound(_0x4451fd,null))[_0xdae0('0x22')](saveUpdates(_0x2bc518[_0xdae0('0x46')],null))[_0xdae0('0x22')](respondWithResult(_0x4451fd,null))[_0xdae0('0x44')](handleError(_0x4451fd,null));};exports['destroy']=function(_0x42a10a,_0x109dbf){return db[_0xdae0('0x29')][_0xdae0('0x43')]({'where':{'id':_0x42a10a[_0xdae0('0x47')]['id']}})[_0xdae0('0x22')](handleEntityNotFound(_0x109dbf,null))[_0xdae0('0x22')](removeEntity(_0x109dbf,null))[_0xdae0('0x44')](handleError(_0x109dbf,null));}; \ No newline at end of file +var _0x5829=['VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','map','keys','filters','intersection','model','attributes','fields','length','query','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x42127d,_0x319f25){var _0x338b8c=function(_0x2360c5){while(--_0x2360c5){_0x42127d['push'](_0x42127d['shift']());}};_0x338b8c(++_0x319f25);}(_0x5829,0xf4));var _0x9582=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x5829[_0x288f5e];return _0x476cc9;};'use strict';var emlformat=require(_0x9582('0x0'));var rimraf=require(_0x9582('0x1'));var zipdir=require(_0x9582('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9582('0x3'));var moment=require('moment');var BPromise=require(_0x9582('0x4'));var Mustache=require('mustache');var util=require(_0x9582('0x5'));var path=require(_0x9582('0x6'));var sox=require(_0x9582('0x7'));var csv=require(_0x9582('0x8'));var ejs=require(_0x9582('0x9'));var fs=require('fs');var fs_extra=require(_0x9582('0xa'));var _=require(_0x9582('0xb'));var squel=require(_0x9582('0xc'));var crypto=require(_0x9582('0xd'));var jsforce=require(_0x9582('0xe'));var deskjs=require(_0x9582('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9582('0x10'));var Papa=require('papaparse');var Redis=require(_0x9582('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9582('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9582('0x13'))(_0x9582('0x14'));var utils=require(_0x9582('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9582('0x16'))['db'];function respondWithStatusCode(_0x373352,_0x1d3890){_0x1d3890=_0x1d3890||0xcc;return function(_0x4141f0){if(_0x4141f0){return _0x373352[_0x9582('0x17')](_0x1d3890);}return _0x373352[_0x9582('0x18')](_0x1d3890)[_0x9582('0x19')]();};}function respondWithResult(_0xec997c,_0x3b696a){_0x3b696a=_0x3b696a||0xc8;return function(_0x82e6b8){if(_0x82e6b8){return _0xec997c[_0x9582('0x18')](_0x3b696a)[_0x9582('0x1a')](_0x82e6b8);}};}function respondWithFilteredResult(_0x54b881,_0x1b568b){return function(_0x5ade93){if(_0x5ade93){var _0x2029eb=typeof _0x1b568b[_0x9582('0x1b')]===_0x9582('0x1c')&&typeof _0x1b568b[_0x9582('0x1d')]==='undefined';var _0x42f583=_0x5ade93[_0x9582('0x1e')];var _0x5bff08=_0x2029eb?0x0:_0x1b568b['offset'];var _0x3bb84d=_0x2029eb?_0x5ade93[_0x9582('0x1e')]:_0x1b568b[_0x9582('0x1b')]+_0x1b568b[_0x9582('0x1d')];var _0x53178b;if(_0x3bb84d>=_0x42f583){_0x3bb84d=_0x42f583;_0x53178b=0xc8;}else{_0x53178b=0xce;}_0x54b881[_0x9582('0x18')](_0x53178b);return _0x54b881[_0x9582('0x1f')](_0x9582('0x20'),_0x5bff08+'-'+_0x3bb84d+'/'+_0x42f583)[_0x9582('0x1a')](_0x5ade93);}return null;};}function patchUpdates(_0x7d50bc){return function(_0x521f7f){try{jsonpatch[_0x9582('0x21')](_0x521f7f,_0x7d50bc,!![]);}catch(_0x3587cc){return BPromise[_0x9582('0x22')](_0x3587cc);}return _0x521f7f[_0x9582('0x23')]();};}function saveUpdates(_0x3afe26,_0x4e249a){return function(_0x382908){if(_0x382908){return _0x382908[_0x9582('0x24')](_0x3afe26)[_0x9582('0x25')](function(_0x41af22){return _0x41af22;});}return null;};}function removeEntity(_0x33b3e5,_0x42f217){return function(_0x181d95){if(_0x181d95){return _0x181d95['destroy']()[_0x9582('0x25')](function(){_0x33b3e5[_0x9582('0x18')](0xcc)[_0x9582('0x19')]();});}};}function handleEntityNotFound(_0x3a3ada,_0x1ad277){return function(_0xe6484b){if(!_0xe6484b){_0x3a3ada[_0x9582('0x17')](0x194);}return _0xe6484b;};}function handleError(_0x2f2b8d,_0x271334){_0x271334=_0x271334||0x1f4;return function(_0x538e80){logger[_0x9582('0x26')](_0x538e80[_0x9582('0x27')]);if(_0x538e80[_0x9582('0x28')]){delete _0x538e80['name'];}_0x2f2b8d['status'](_0x271334)[_0x9582('0x29')](_0x538e80);};}exports[_0x9582('0x2a')]=function(_0x4d1710,_0x307325){var _0x588841={},_0x354eec={},_0x3d1c5a={'count':0x0,'rows':[]};var _0x8c5c40=_['map'](db[_0x9582('0x2b')][_0x9582('0x2c')],function(_0x4d2bc4){return{'name':_0x4d2bc4[_0x9582('0x2d')],'type':_0x4d2bc4[_0x9582('0x2e')][_0x9582('0x2f')]};});_0x354eec['model']=_[_0x9582('0x30')](_0x8c5c40,_0x9582('0x28'));_0x354eec['query']=_[_0x9582('0x31')](_0x4d1710['query']);_0x354eec[_0x9582('0x32')]=_[_0x9582('0x33')](_0x354eec[_0x9582('0x34')],_0x354eec['query']);_0x588841[_0x9582('0x35')]=_[_0x9582('0x33')](_0x354eec[_0x9582('0x34')],qs[_0x9582('0x36')](_0x4d1710['query'][_0x9582('0x36')]));_0x588841['attributes']=_0x588841[_0x9582('0x35')][_0x9582('0x37')]?_0x588841[_0x9582('0x35')]:_0x354eec[_0x9582('0x34')];if(!_0x4d1710[_0x9582('0x38')][_0x9582('0x39')](_0x9582('0x3a'))){_0x588841[_0x9582('0x1d')]=qs[_0x9582('0x1d')](_0x4d1710[_0x9582('0x38')][_0x9582('0x1d')]);_0x588841['offset']=qs[_0x9582('0x1b')](_0x4d1710[_0x9582('0x38')][_0x9582('0x1b')]);}_0x588841['order']=qs[_0x9582('0x3b')](_0x4d1710['query'][_0x9582('0x3b')]);_0x588841[_0x9582('0x3c')]=qs[_0x9582('0x32')](_[_0x9582('0x3d')](_0x4d1710[_0x9582('0x38')],_0x354eec[_0x9582('0x32')]),_0x8c5c40);if(_0x4d1710['query'][_0x9582('0x3e')]){_0x588841[_0x9582('0x3c')]=_[_0x9582('0x3f')](_0x588841[_0x9582('0x3c')],{'$or':_[_0x9582('0x30')](_0x8c5c40,function(_0x25aaaf){if(_0x25aaaf[_0x9582('0x2e')]!==_0x9582('0x40')){var _0x4d4260={};_0x4d4260[_0x25aaaf[_0x9582('0x28')]]={'$like':'%'+_0x4d1710[_0x9582('0x38')][_0x9582('0x3e')]+'%'};return _0x4d4260;}})});}_0x588841=_[_0x9582('0x3f')]({},_0x588841,_0x4d1710['options']);var _0x4deb62={'where':_0x588841[_0x9582('0x3c')]};return db[_0x9582('0x2b')][_0x9582('0x1e')](_0x4deb62)['then'](function(_0x6044ed){_0x3d1c5a[_0x9582('0x1e')]=_0x6044ed;if(_0x4d1710[_0x9582('0x38')]['includeAll']){_0x588841[_0x9582('0x41')]=[{'all':!![]}];}return db[_0x9582('0x2b')][_0x9582('0x42')](_0x588841);})[_0x9582('0x25')](function(_0x1bfc4b){_0x3d1c5a[_0x9582('0x43')]=_0x1bfc4b;return _0x3d1c5a;})['then'](respondWithFilteredResult(_0x307325,_0x588841))[_0x9582('0x44')](handleError(_0x307325,null));};exports[_0x9582('0x45')]=function(_0x2c3899,_0x46a6f4){var _0x4d8937={'raw':!![],'where':{'id':_0x2c3899[_0x9582('0x46')]['id']}},_0x33c8df={};_0x33c8df[_0x9582('0x34')]=_[_0x9582('0x31')](db[_0x9582('0x2b')][_0x9582('0x2c')]);_0x33c8df[_0x9582('0x38')]=_[_0x9582('0x31')](_0x2c3899['query']);_0x33c8df['filters']=_[_0x9582('0x33')](_0x33c8df[_0x9582('0x34')],_0x33c8df[_0x9582('0x38')]);_0x4d8937[_0x9582('0x35')]=_[_0x9582('0x33')](_0x33c8df[_0x9582('0x34')],qs[_0x9582('0x36')](_0x2c3899[_0x9582('0x38')]['fields']));_0x4d8937[_0x9582('0x35')]=_0x4d8937[_0x9582('0x35')][_0x9582('0x37')]?_0x4d8937['attributes']:_0x33c8df[_0x9582('0x34')];if(_0x2c3899[_0x9582('0x38')][_0x9582('0x47')]){_0x4d8937['include']=[{'all':!![]}];}_0x4d8937=_[_0x9582('0x3f')]({},_0x4d8937,_0x2c3899[_0x9582('0x48')]);return db[_0x9582('0x2b')][_0x9582('0x49')](_0x4d8937)[_0x9582('0x25')](handleEntityNotFound(_0x46a6f4,null))[_0x9582('0x25')](respondWithResult(_0x46a6f4,null))[_0x9582('0x44')](handleError(_0x46a6f4,null));};exports[_0x9582('0x4a')]=function(_0x4f5a10,_0xf78b34){return db[_0x9582('0x2b')]['create'](_0x4f5a10[_0x9582('0x4b')],{})[_0x9582('0x25')](respondWithResult(_0xf78b34,0xc9))[_0x9582('0x44')](handleError(_0xf78b34,null));};exports[_0x9582('0x24')]=function(_0x27de32,_0x363b6e){if(_0x27de32[_0x9582('0x4b')]['id']){delete _0x27de32[_0x9582('0x4b')]['id'];}return db[_0x9582('0x2b')][_0x9582('0x49')]({'where':{'id':_0x27de32[_0x9582('0x46')]['id']}})[_0x9582('0x25')](handleEntityNotFound(_0x363b6e,null))[_0x9582('0x25')](saveUpdates(_0x27de32['body'],null))[_0x9582('0x25')](respondWithResult(_0x363b6e,null))[_0x9582('0x44')](handleError(_0x363b6e,null));};exports[_0x9582('0x4c')]=function(_0x8a7a0f,_0x3d2653){return db[_0x9582('0x2b')][_0x9582('0x49')]({'where':{'id':_0x8a7a0f[_0x9582('0x46')]['id']}})[_0x9582('0x25')](handleEntityNotFound(_0x3d2653,null))[_0x9582('0x25')](removeEntity(_0x3d2653,null))['catch'](handleError(_0x3d2653,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index dffe3f2..7c960b7 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 _0xd150=['square_messages','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage'];(function(_0x282f68,_0x239640){var _0x1aba38=function(_0x5955c8){while(--_0x5955c8){_0x282f68['push'](_0x282f68['shift']());}};_0x1aba38(++_0x239640);}(_0xd150,0x8d));var _0x0d15=function(_0x1d23be,_0x1c8c3f){_0x1d23be=_0x1d23be-0x0;var _0x1872a0=_0xd150[_0x1d23be];return _0x1872a0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0d15('0x0'))('api');var moment=require(_0x0d15('0x1'));var BPromise=require(_0x0d15('0x2'));var rp=require(_0x0d15('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0d15('0x4'));var config=require(_0x0d15('0x5'));var attributes=require(_0x0d15('0x6'));module[_0x0d15('0x7')]=function(_0x4e8ca3,_0x359671){return _0x4e8ca3['define'](_0x0d15('0x8'),attributes,{'tableName':_0x0d15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f86=['rimraf','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x8f86,0x1b2));var _0x68f8=function(_0x53b13c,_0x30a404){_0x53b13c=_0x53b13c-0x0;var _0x1910d1=_0x8f86[_0x53b13c];return _0x1910d1;};'use strict';var _=require(_0x68f8('0x0'));var util=require('util');var logger=require(_0x68f8('0x1'))(_0x68f8('0x2'));var moment=require(_0x68f8('0x3'));var BPromise=require(_0x68f8('0x4'));var rp=require(_0x68f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68f8('0x6'));var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x68f8('0x7')]=function(_0x2c31ca,_0xb86be4){return _0x2c31ca[_0x68f8('0x8')](_0x68f8('0x9'),attributes,{'tableName':_0x68f8('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 24e04bf..005b57a 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 _0xd6d3=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareMessage','create','body','options','raw','then','lodash','bluebird','randomstring'];(function(_0x41e507,_0x694b79){var _0x3bbe37=function(_0x2df851){while(--_0x2df851){_0x41e507['push'](_0x41e507['shift']());}};_0x3bbe37(++_0x694b79);}(_0xd6d3,0x93));var _0x3d6d=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd6d3[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x3d6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d6d('0x1'));var rs=require(_0x3d6d('0x2'));var fs=require('fs');var Redis=require(_0x3d6d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d6d('0x4'));var logger=require(_0x3d6d('0x5'))(_0x3d6d('0x6'));var config=require(_0x3d6d('0x7'));var jayson=require(_0x3d6d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x255a65,_0x1f69e1,_0x43b4f6){return new BPromise(function(_0x2cb498,_0x540661){return client['request'](_0x255a65,_0x43b4f6)['then'](function(_0x3d4365){logger[_0x3d6d('0x9')](_0x3d6d('0xa'),_0x1f69e1,_0x3d6d('0xb'));logger[_0x3d6d('0xc')](_0x3d6d('0xd'),_0x1f69e1,'request\x20sent',JSON[_0x3d6d('0xe')](_0x3d4365));if(_0x3d4365[_0x3d6d('0xf')]){if(_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x10')]===0x1f4){logger[_0x3d6d('0xf')](_0x3d6d('0xa'),_0x1f69e1,_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x11')]);return _0x540661(_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x11')]);}logger[_0x3d6d('0xf')](_0x3d6d('0xa'),_0x1f69e1,_0x3d4365[_0x3d6d('0xf')][_0x3d6d('0x11')]);return _0x2cb498(_0x3d4365['error']['message']);}else{logger['info'](_0x3d6d('0xa'),_0x1f69e1,_0x3d6d('0xb'));_0x2cb498(_0x3d4365['result'][_0x3d6d('0x11')]);}})[_0x3d6d('0x12')](function(_0x765f03){logger[_0x3d6d('0xf')](_0x3d6d('0xa'),_0x1f69e1,_0x765f03);_0x540661(_0x765f03);});});}exports[_0x3d6d('0x13')]=function(_0x47a9ff){var _0x75f468=this;return new Promise(function(_0x53f399,_0x4be27a){return db['SquareMessage'][_0x3d6d('0x14')](_0x47a9ff[_0x3d6d('0x15')],{'raw':_0x47a9ff[_0x3d6d('0x16')]?_0x47a9ff[_0x3d6d('0x16')][_0x3d6d('0x17')]===undefined?!![]:![]:!![]})[_0x3d6d('0x18')](function(_0x23ad74){logger['info'](_0x3d6d('0x13'),_0x47a9ff);logger['debug']('CreateSquareMessage',_0x47a9ff,JSON[_0x3d6d('0xe')](_0x23ad74));_0x53f399(_0x23ad74);})['catch'](function(_0x14e939){logger[_0x3d6d('0xf')](_0x3d6d('0x13'),_0x14e939[_0x3d6d('0x11')],_0x47a9ff);_0x4be27a(_0x75f468[_0x3d6d('0xf')](0x1f4,_0x14e939[_0x3d6d('0x11')]));});});}; \ No newline at end of file +var _0x1820=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareMessage','SquareMessage','body','options','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5c3c30,_0x5d3ce9){var _0x5b77dc=function(_0x4d21b1){while(--_0x4d21b1){_0x5c3c30['push'](_0x5c3c30['shift']());}};_0x5b77dc(++_0x5d3ce9);}(_0x1820,0x188));var _0x0182=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x1820[_0xbb091];return _0x467a04;};'use strict';var _=require(_0x0182('0x0'));var util=require(_0x0182('0x1'));var moment=require('moment');var BPromise=require(_0x0182('0x2'));var rs=require(_0x0182('0x3'));var fs=require('fs');var Redis=require(_0x0182('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0182('0x5'));var logger=require(_0x0182('0x6'))(_0x0182('0x7'));var config=require(_0x0182('0x8'));var jayson=require(_0x0182('0x9'));var client=jayson[_0x0182('0xa')][_0x0182('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e02c5,_0x33d656,_0x8cd44f){return new BPromise(function(_0x465e3a,_0x4d1cef){return client['request'](_0x1e02c5,_0x8cd44f)[_0x0182('0xc')](function(_0x184e34){logger[_0x0182('0xd')](_0x0182('0xe'),_0x33d656,_0x0182('0xf'));logger[_0x0182('0x10')](_0x0182('0x11'),_0x33d656,'request\x20sent',JSON['stringify'](_0x184e34));if(_0x184e34[_0x0182('0x12')]){if(_0x184e34[_0x0182('0x12')][_0x0182('0x13')]===0x1f4){logger['error'](_0x0182('0xe'),_0x33d656,_0x184e34['error'][_0x0182('0x14')]);return _0x4d1cef(_0x184e34[_0x0182('0x12')][_0x0182('0x14')]);}logger[_0x0182('0x12')](_0x0182('0xe'),_0x33d656,_0x184e34['error']['message']);return _0x465e3a(_0x184e34['error']['message']);}else{logger[_0x0182('0xd')](_0x0182('0xe'),_0x33d656,_0x0182('0xf'));_0x465e3a(_0x184e34[_0x0182('0x15')]['message']);}})['catch'](function(_0x354c20){logger[_0x0182('0x12')](_0x0182('0xe'),_0x33d656,_0x354c20);_0x4d1cef(_0x354c20);});});}exports[_0x0182('0x16')]=function(_0x384729){var _0x2dcb2f=this;return new Promise(function(_0x3976ba,_0x55941a){return db[_0x0182('0x17')]['create'](_0x384729[_0x0182('0x18')],{'raw':_0x384729[_0x0182('0x19')]?_0x384729[_0x0182('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0182('0xc')](function(_0x3a5ddd){logger[_0x0182('0xd')](_0x0182('0x16'),_0x384729);logger[_0x0182('0x10')](_0x0182('0x16'),_0x384729,JSON['stringify'](_0x3a5ddd));_0x3976ba(_0x3a5ddd);})[_0x0182('0x1a')](function(_0x144c62){logger[_0x0182('0x12')](_0x0182('0x16'),_0x144c62['message'],_0x384729);_0x55941a(_0x2dcb2f['error'](0x1f4,_0x144c62[_0x0182('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 33547f8..e8b1287 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 _0x9c2e=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','show','/:id/test','isAuthenticated','15s','test','post','create','update','delete','destroy','multer','util','path'];(function(_0x3eafd8,_0x1dc4f5){var _0x219db7=function(_0x10c912){while(--_0x10c912){_0x3eafd8['push'](_0x3eafd8['shift']());}};_0x219db7(++_0x1dc4f5);}(_0x9c2e,0x19f));var _0xe9c2=function(_0x41d07b,_0x3ac2e2){_0x41d07b=_0x41d07b-0x0;var _0x2a59cb=_0x9c2e[_0x41d07b];return _0x2a59cb;};'use strict';var multer=require(_0xe9c2('0x0'));var util=require(_0xe9c2('0x1'));var path=require(_0xe9c2('0x2'));var timeout=require(_0xe9c2('0x3'));var express=require(_0xe9c2('0x4'));var router=express[_0xe9c2('0x5')]();var fs_extra=require(_0xe9c2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe9c2('0x7'));var config=require(_0xe9c2('0x8'));var controller=require(_0xe9c2('0x9'));router[_0xe9c2('0xa')]('/',auth['isAuthenticated'](),controller[_0xe9c2('0xb')]);router[_0xe9c2('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe9c2('0xc')]);router[_0xe9c2('0xa')](_0xe9c2('0xd'),auth[_0xe9c2('0xe')](),timeout(_0xe9c2('0xf')),controller[_0xe9c2('0x10')]);router[_0xe9c2('0x11')]('/',auth[_0xe9c2('0xe')](),controller[_0xe9c2('0x12')]);router['put']('/:id',auth[_0xe9c2('0xe')](),controller[_0xe9c2('0x13')]);router[_0xe9c2('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe9c2('0x15')]);module['exports']=router; \ No newline at end of file +var _0x45a8=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','create','put','update','destroy','multer','path','connect-timeout','express','Router'];(function(_0x401184,_0x3fa43d){var _0xd7804c=function(_0x170779){while(--_0x170779){_0x401184['push'](_0x401184['shift']());}};_0xd7804c(++_0x3fa43d);}(_0x45a8,0x1db));var _0x845a=function(_0x4c4626,_0x5e6fcc){_0x4c4626=_0x4c4626-0x0;var _0x48ccac=_0x45a8[_0x4c4626];return _0x48ccac;};'use strict';var multer=require(_0x845a('0x0'));var util=require('util');var path=require(_0x845a('0x1'));var timeout=require(_0x845a('0x2'));var express=require(_0x845a('0x3'));var router=express[_0x845a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x845a('0x5'));var interaction=require(_0x845a('0x6'));var config=require(_0x845a('0x7'));var controller=require('./squareOdbc.controller');router[_0x845a('0x8')]('/',auth[_0x845a('0x9')](),controller[_0x845a('0xa')]);router[_0x845a('0x8')](_0x845a('0xb'),auth[_0x845a('0x9')](),controller['show']);router['get'](_0x845a('0xc'),auth[_0x845a('0x9')](),timeout(_0x845a('0xd')),controller[_0x845a('0xe')]);router[_0x845a('0xf')]('/',auth[_0x845a('0x9')](),controller[_0x845a('0x10')]);router[_0x845a('0x11')](_0x845a('0xb'),auth['isAuthenticated'](),controller[_0x845a('0x12')]);router['delete'](_0x845a('0xb'),auth['isAuthenticated'](),controller[_0x845a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index a3e3ec6..018dce1 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 _0x337d=['STRING','sequelize','exports','name'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x337d,0x17d));var _0xd337=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x337d[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xd337('0x0'));module[_0xd337('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd337('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd337('0x3')]},'description':{'type':Sequelize[_0xd337('0x3')]}}; \ No newline at end of file +var _0x520f=['exports','STRING'];(function(_0xe262fc,_0x24774e){var _0x597955=function(_0x4463ff){while(--_0x4463ff){_0xe262fc['push'](_0xe262fc['shift']());}};_0x597955(++_0x24774e);}(_0x520f,0x15e));var _0xf520=function(_0x4becb8,_0x4ad3d3){_0x4becb8=_0x4becb8-0x0;var _0x5c8a37=_0x520f[_0x4becb8];return _0x5c8a37;};'use strict';var Sequelize=require('sequelize');module[_0xf520('0x0')]={'name':{'type':Sequelize[_0xf520('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xf520('0x1')]},'description':{'type':Sequelize[_0xf520('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 76f39c3..02b8521 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 _0x619f=['fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','error','body','test','dsn','odbc','openSync','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','desk.js','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','status','offset','undefined','count','limit','set','json','apply','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','name','send','map','SquareOdbc','rawAttributes'];(function(_0x155f58,_0x4d0489){var _0x51fb9d=function(_0x5d93ae){while(--_0x5d93ae){_0x155f58['push'](_0x155f58['shift']());}};_0x51fb9d(++_0x4d0489);}(_0x619f,0x12f));var _0xf619=function(_0x30faa8,_0xeba979){_0x30faa8=_0x30faa8-0x0;var _0x282076=_0x619f[_0x30faa8];return _0x282076;};'use strict';var emlformat=require(_0xf619('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf619('0x1'));var jsonpatch=require(_0xf619('0x2'));var rp=require(_0xf619('0x3'));var moment=require(_0xf619('0x4'));var BPromise=require(_0xf619('0x5'));var Mustache=require('mustache');var util=require(_0xf619('0x6'));var path=require('path');var sox=require(_0xf619('0x7'));var csv=require(_0xf619('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf619('0x9'));var crypto=require(_0xf619('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf619('0xb'));var toCsv=require(_0xf619('0x8'));var querystring=require(_0xf619('0xc'));var Papa=require(_0xf619('0xd'));var Redis=require('ioredis');var authService=require(_0xf619('0xe'));var qs=require(_0xf619('0xf'));var as=require(_0xf619('0x10'));var hardwareService=require(_0xf619('0x11'));var logger=require(_0xf619('0x12'))(_0xf619('0x13'));var utils=require(_0xf619('0x14'));var config=require(_0xf619('0x15'));var licenseUtil=require(_0xf619('0x16'));var db=require(_0xf619('0x17'))['db'];function respondWithStatusCode(_0x1dc924,_0x3fdfb2){_0x3fdfb2=_0x3fdfb2||0xcc;return function(_0x540fb8){if(_0x540fb8){return _0x1dc924['sendStatus'](_0x3fdfb2);}return _0x1dc924[_0xf619('0x18')](_0x3fdfb2)['end']();};}function respondWithResult(_0x373779,_0x8b4a40){_0x8b4a40=_0x8b4a40||0xc8;return function(_0x3870d1){if(_0x3870d1){return _0x373779[_0xf619('0x18')](_0x8b4a40)['json'](_0x3870d1);}};}function respondWithFilteredResult(_0x57e04d,_0x144a39){return function(_0x4d2853){if(_0x4d2853){var _0x208a3d=typeof _0x144a39[_0xf619('0x19')]===_0xf619('0x1a')&&typeof _0x144a39['limit']===_0xf619('0x1a');var _0x559734=_0x4d2853[_0xf619('0x1b')];var _0x7a0aa8=_0x208a3d?0x0:_0x144a39[_0xf619('0x19')];var _0x3d835c=_0x208a3d?_0x4d2853[_0xf619('0x1b')]:_0x144a39[_0xf619('0x19')]+_0x144a39[_0xf619('0x1c')];var _0x34927f;if(_0x3d835c>=_0x559734){_0x3d835c=_0x559734;_0x34927f=0xc8;}else{_0x34927f=0xce;}_0x57e04d['status'](_0x34927f);return _0x57e04d[_0xf619('0x1d')]('Content-Range',_0x7a0aa8+'-'+_0x3d835c+'/'+_0x559734)[_0xf619('0x1e')](_0x4d2853);}return null;};}function patchUpdates(_0x291007){return function(_0x2432b5){try{jsonpatch[_0xf619('0x1f')](_0x2432b5,_0x291007,!![]);}catch(_0x18c37d){return BPromise['reject'](_0x18c37d);}return _0x2432b5[_0xf619('0x20')]();};}function saveUpdates(_0x57ffc7,_0x31b779){return function(_0x172436){if(_0x172436){return _0x172436[_0xf619('0x21')](_0x57ffc7)[_0xf619('0x22')](function(_0x152853){return _0x152853;});}return null;};}function removeEntity(_0x3a0a5d,_0x8d57f0){return function(_0x1939ff){if(_0x1939ff){return _0x1939ff[_0xf619('0x23')]()['then'](function(){var _0x4f4022=_0x1939ff[_0xf619('0x24')]({'plain':!![]});var _0x2072de=_0xf619('0x25');return db[_0xf619('0x26')][_0xf619('0x23')]({'where':{'type':_0x2072de,'resourceId':_0x4f4022['id']}})['then'](function(){return _0x1939ff;});})[_0xf619('0x22')](function(){_0x3a0a5d[_0xf619('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498680,_0x594847){return function(_0x5468fe){if(!_0x5468fe){_0x498680[_0xf619('0x27')](0x194);}return _0x5468fe;};}function handleError(_0x5bf193,_0x21ed40){_0x21ed40=_0x21ed40||0x1f4;return function(_0x6a2320){logger['error'](_0x6a2320['stack']);if(_0x6a2320[_0xf619('0x28')]){delete _0x6a2320[_0xf619('0x28')];}_0x5bf193[_0xf619('0x18')](_0x21ed40)[_0xf619('0x29')](_0x6a2320);};}exports['index']=function(_0x2f85ec,_0x163b34){var _0x13ef1b={},_0x28290e={},_0x3ca5a0={'count':0x0,'rows':[]};var _0x2c4059=_[_0xf619('0x2a')](db[_0xf619('0x2b')][_0xf619('0x2c')],function(_0x73e4f9){return{'name':_0x73e4f9[_0xf619('0x2d')],'type':_0x73e4f9['type'][_0xf619('0x2e')]};});_0x28290e[_0xf619('0x2f')]=_['map'](_0x2c4059,'name');_0x28290e[_0xf619('0x30')]=_[_0xf619('0x31')](_0x2f85ec[_0xf619('0x30')]);_0x28290e[_0xf619('0x32')]=_[_0xf619('0x33')](_0x28290e[_0xf619('0x2f')],_0x28290e[_0xf619('0x30')]);_0x13ef1b['attributes']=_[_0xf619('0x33')](_0x28290e['model'],qs[_0xf619('0x34')](_0x2f85ec[_0xf619('0x30')][_0xf619('0x34')]));_0x13ef1b[_0xf619('0x35')]=_0x13ef1b[_0xf619('0x35')][_0xf619('0x36')]?_0x13ef1b[_0xf619('0x35')]:_0x28290e[_0xf619('0x2f')];if(!_0x2f85ec[_0xf619('0x30')][_0xf619('0x37')](_0xf619('0x38'))){_0x13ef1b[_0xf619('0x1c')]=qs[_0xf619('0x1c')](_0x2f85ec[_0xf619('0x30')][_0xf619('0x1c')]);_0x13ef1b[_0xf619('0x19')]=qs[_0xf619('0x19')](_0x2f85ec[_0xf619('0x30')]['offset']);}_0x13ef1b[_0xf619('0x39')]=qs[_0xf619('0x3a')](_0x2f85ec['query'][_0xf619('0x3a')]);_0x13ef1b[_0xf619('0x3b')]=qs[_0xf619('0x32')](_[_0xf619('0x3c')](_0x2f85ec['query'],_0x28290e[_0xf619('0x32')]),_0x2c4059);if(_0x2f85ec['query'][_0xf619('0x3d')]){_0x13ef1b['where']=_['merge'](_0x13ef1b[_0xf619('0x3b')],{'$or':_[_0xf619('0x2a')](_0x2c4059,function(_0x94f2a4){if(_0x94f2a4[_0xf619('0x3e')]!==_0xf619('0x3f')){var _0x50a363={};_0x50a363[_0x94f2a4['name']]={'$like':'%'+_0x2f85ec['query'][_0xf619('0x3d')]+'%'};return _0x50a363;}})});}_0x13ef1b=_[_0xf619('0x40')]({},_0x13ef1b,_0x2f85ec[_0xf619('0x41')]);var _0x14e4cc={'where':_0x13ef1b['where']};return db[_0xf619('0x2b')][_0xf619('0x1b')](_0x14e4cc)['then'](function(_0x166f18){_0x3ca5a0[_0xf619('0x1b')]=_0x166f18;if(_0x2f85ec[_0xf619('0x30')][_0xf619('0x42')]){_0x13ef1b[_0xf619('0x43')]=[{'all':!![]}];}return db[_0xf619('0x2b')][_0xf619('0x44')](_0x13ef1b);})[_0xf619('0x22')](function(_0x415487){_0x3ca5a0[_0xf619('0x45')]=_0x415487;return _0x3ca5a0;})[_0xf619('0x22')](respondWithFilteredResult(_0x163b34,_0x13ef1b))[_0xf619('0x46')](handleError(_0x163b34,null));};exports[_0xf619('0x47')]=function(_0x3afa89,_0x11f899){var _0x263a6b={'raw':!![],'where':{'id':_0x3afa89[_0xf619('0x48')]['id']}},_0x399557={};_0x399557[_0xf619('0x2f')]=_[_0xf619('0x31')](db['SquareOdbc']['rawAttributes']);_0x399557['query']=_[_0xf619('0x31')](_0x3afa89['query']);_0x399557['filters']=_[_0xf619('0x33')](_0x399557[_0xf619('0x2f')],_0x399557['query']);_0x263a6b[_0xf619('0x35')]=_[_0xf619('0x33')](_0x399557[_0xf619('0x2f')],qs['fields'](_0x3afa89[_0xf619('0x30')][_0xf619('0x34')]));_0x263a6b[_0xf619('0x35')]=_0x263a6b[_0xf619('0x35')][_0xf619('0x36')]?_0x263a6b[_0xf619('0x35')]:_0x399557['model'];if(_0x3afa89[_0xf619('0x30')][_0xf619('0x42')]){_0x263a6b[_0xf619('0x43')]=[{'all':!![]}];}_0x263a6b=_[_0xf619('0x40')]({},_0x263a6b,_0x3afa89['options']);return db[_0xf619('0x2b')][_0xf619('0x49')](_0x263a6b)[_0xf619('0x22')](handleEntityNotFound(_0x11f899,null))[_0xf619('0x22')](respondWithResult(_0x11f899,null))[_0xf619('0x46')](handleError(_0x11f899,null));};exports['create']=function(_0x3b573e,_0x3adcc9){return db[_0xf619('0x2b')]['create'](_0x3b573e['body'],{})[_0xf619('0x22')](function(_0x28274f){var _0x3367cc=_0x3b573e[_0xf619('0x4a')]['get']({'plain':!![]});if(!_0x3367cc)throw new Error(_0xf619('0x4b'));if(_0x3367cc[_0xf619('0x4c')]===_0xf619('0x4a')){var _0xb1fdd9=_0x28274f[_0xf619('0x24')]({'plain':!![]});var _0x1ac0ba=_0xf619('0x25');return db[_0xf619('0x4d')][_0xf619('0x49')]({'where':{'name':_0x1ac0ba,'userProfileId':_0x3367cc[_0xf619('0x4e')]},'raw':!![]})[_0xf619('0x22')](function(_0x3f5ecd){if(_0x3f5ecd&&_0x3f5ecd['autoAssociation']===0x0){return db[_0xf619('0x26')][_0xf619('0x4f')]({'name':_0xb1fdd9[_0xf619('0x28')],'resourceId':_0xb1fdd9['id'],'type':_0x3f5ecd[_0xf619('0x28')],'sectionId':_0x3f5ecd['id']},{})['then'](function(){return _0x28274f;});}else{return _0x28274f;}})['catch'](function(_0xcbcf5b){logger[_0xf619('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcbcf5b);throw _0xcbcf5b;});}return _0x28274f;})[_0xf619('0x22')](respondWithResult(_0x3adcc9,0xc9))[_0xf619('0x46')](handleError(_0x3adcc9,null));};exports[_0xf619('0x21')]=function(_0x4d3b3c,_0x3ee887){if(_0x4d3b3c[_0xf619('0x51')]['id']){delete _0x4d3b3c[_0xf619('0x51')]['id'];}return db[_0xf619('0x2b')][_0xf619('0x49')]({'where':{'id':_0x4d3b3c[_0xf619('0x48')]['id']}})['then'](handleEntityNotFound(_0x3ee887,null))['then'](saveUpdates(_0x4d3b3c[_0xf619('0x51')],null))[_0xf619('0x22')](respondWithResult(_0x3ee887,null))['catch'](handleError(_0x3ee887,null));};exports['destroy']=function(_0x475c32,_0x2c7e06){return db[_0xf619('0x2b')][_0xf619('0x49')]({'where':{'id':_0x475c32[_0xf619('0x48')]['id']}})[_0xf619('0x22')](handleEntityNotFound(_0x2c7e06,null))[_0xf619('0x22')](removeEntity(_0x2c7e06,null))[_0xf619('0x46')](handleError(_0x2c7e06,null));};exports[_0xf619('0x52')]=function(_0x51605f,_0x28578c,_0x5a951b){var _0x47057e;return db[_0xf619('0x2b')][_0xf619('0x49')]({'where':{'id':_0x51605f['params']['id']},'attributes':['id',_0xf619('0x53')]})['then'](handleEntityNotFound(_0x28578c,null))[_0xf619('0x22')](function(_0x435221){if(_0x435221){var _0x8b27af=require(_0xf619('0x54'))();_0x8b27af[_0xf619('0x55')](_0x435221[_0xf619('0x53')]);_0x8b27af[_0xf619('0x56')]();return _0x435221;}})[_0xf619('0x22')](respondWithResult(_0x28578c,null))[_0xf619('0x46')](handleError(_0x28578c,null));}; \ No newline at end of file +var _0x89a8=['Content-Range','apply','save','update','then','destroy','get','ODBC','error','name','send','index','map','SquareOdbc','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','body','params','test','dsn','odbc','openSync','closeSync','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x11f1d7,_0x232d9f){var _0x41b43f=function(_0x2ce8c7){while(--_0x2ce8c7){_0x11f1d7['push'](_0x11f1d7['shift']());}};_0x41b43f(++_0x232d9f);}(_0x89a8,0x81));var _0x889a=function(_0x20a761,_0x2ffd85){_0x20a761=_0x20a761-0x0;var _0x284a38=_0x89a8[_0x20a761];return _0x284a38;};'use strict';var emlformat=require(_0x889a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x889a('0x1'));var moment=require(_0x889a('0x2'));var BPromise=require(_0x889a('0x3'));var Mustache=require(_0x889a('0x4'));var util=require(_0x889a('0x5'));var path=require(_0x889a('0x6'));var sox=require(_0x889a('0x7'));var csv=require('to-csv');var ejs=require(_0x889a('0x8'));var fs=require('fs');var fs_extra=require(_0x889a('0x9'));var _=require('lodash');var squel=require(_0x889a('0xa'));var crypto=require('crypto');var jsforce=require(_0x889a('0xb'));var deskjs=require(_0x889a('0xc'));var toCsv=require(_0x889a('0xd'));var querystring=require(_0x889a('0xe'));var Papa=require(_0x889a('0xf'));var Redis=require(_0x889a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x889a('0x11'));var as=require(_0x889a('0x12'));var hardwareService=require(_0x889a('0x13'));var logger=require('../../config/logger')(_0x889a('0x14'));var utils=require('../../config/utils');var config=require(_0x889a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x889a('0x16'))['db'];function respondWithStatusCode(_0x43d62d,_0xbace6e){_0xbace6e=_0xbace6e||0xcc;return function(_0x172d12){if(_0x172d12){return _0x43d62d[_0x889a('0x17')](_0xbace6e);}return _0x43d62d[_0x889a('0x18')](_0xbace6e)[_0x889a('0x19')]();};}function respondWithResult(_0x1e7127,_0xda1c88){_0xda1c88=_0xda1c88||0xc8;return function(_0x3081c7){if(_0x3081c7){return _0x1e7127['status'](_0xda1c88)[_0x889a('0x1a')](_0x3081c7);}};}function respondWithFilteredResult(_0x300086,_0x3c759e){return function(_0x4c2497){if(_0x4c2497){var _0x136a7b=typeof _0x3c759e[_0x889a('0x1b')]===_0x889a('0x1c')&&typeof _0x3c759e[_0x889a('0x1d')]==='undefined';var _0x16d0df=_0x4c2497[_0x889a('0x1e')];var _0x3540df=_0x136a7b?0x0:_0x3c759e[_0x889a('0x1b')];var _0x3050f6=_0x136a7b?_0x4c2497['count']:_0x3c759e[_0x889a('0x1b')]+_0x3c759e[_0x889a('0x1d')];var _0x348f9;if(_0x3050f6>=_0x16d0df){_0x3050f6=_0x16d0df;_0x348f9=0xc8;}else{_0x348f9=0xce;}_0x300086[_0x889a('0x18')](_0x348f9);return _0x300086['set'](_0x889a('0x1f'),_0x3540df+'-'+_0x3050f6+'/'+_0x16d0df)[_0x889a('0x1a')](_0x4c2497);}return null;};}function patchUpdates(_0x76bb65){return function(_0x49e032){try{jsonpatch[_0x889a('0x20')](_0x49e032,_0x76bb65,!![]);}catch(_0x6c3853){return BPromise['reject'](_0x6c3853);}return _0x49e032[_0x889a('0x21')]();};}function saveUpdates(_0x15e02c,_0x5cc698){return function(_0x4e137e){if(_0x4e137e){return _0x4e137e[_0x889a('0x22')](_0x15e02c)[_0x889a('0x23')](function(_0x52e1e9){return _0x52e1e9;});}return null;};}function removeEntity(_0x3c38c6,_0x368ebe){return function(_0x1e41b4){if(_0x1e41b4){return _0x1e41b4[_0x889a('0x24')]()['then'](function(){var _0x1854df=_0x1e41b4[_0x889a('0x25')]({'plain':!![]});var _0x14eb0d=_0x889a('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x14eb0d,'resourceId':_0x1854df['id']}})[_0x889a('0x23')](function(){return _0x1e41b4;});})[_0x889a('0x23')](function(){_0x3c38c6[_0x889a('0x18')](0xcc)[_0x889a('0x19')]();});}};}function handleEntityNotFound(_0x34adaa,_0x45a63b){return function(_0x494230){if(!_0x494230){_0x34adaa[_0x889a('0x17')](0x194);}return _0x494230;};}function handleError(_0x59f651,_0x2fcb16){_0x2fcb16=_0x2fcb16||0x1f4;return function(_0x3c08f3){logger[_0x889a('0x27')](_0x3c08f3['stack']);if(_0x3c08f3['name']){delete _0x3c08f3[_0x889a('0x28')];}_0x59f651['status'](_0x2fcb16)[_0x889a('0x29')](_0x3c08f3);};}exports[_0x889a('0x2a')]=function(_0x10db4a,_0x54a395){var _0x30896e={},_0x3b560f={},_0x11ea37={'count':0x0,'rows':[]};var _0x7b48b7=_[_0x889a('0x2b')](db[_0x889a('0x2c')][_0x889a('0x2d')],function(_0x16bc25){return{'name':_0x16bc25['fieldName'],'type':_0x16bc25[_0x889a('0x2e')]['key']};});_0x3b560f[_0x889a('0x2f')]=_[_0x889a('0x2b')](_0x7b48b7,_0x889a('0x28'));_0x3b560f['query']=_[_0x889a('0x30')](_0x10db4a[_0x889a('0x31')]);_0x3b560f[_0x889a('0x32')]=_[_0x889a('0x33')](_0x3b560f[_0x889a('0x2f')],_0x3b560f[_0x889a('0x31')]);_0x30896e[_0x889a('0x34')]=_[_0x889a('0x33')](_0x3b560f[_0x889a('0x2f')],qs[_0x889a('0x35')](_0x10db4a[_0x889a('0x31')][_0x889a('0x35')]));_0x30896e['attributes']=_0x30896e[_0x889a('0x34')][_0x889a('0x36')]?_0x30896e[_0x889a('0x34')]:_0x3b560f[_0x889a('0x2f')];if(!_0x10db4a[_0x889a('0x31')]['hasOwnProperty'](_0x889a('0x37'))){_0x30896e[_0x889a('0x1d')]=qs['limit'](_0x10db4a[_0x889a('0x31')][_0x889a('0x1d')]);_0x30896e['offset']=qs[_0x889a('0x1b')](_0x10db4a[_0x889a('0x31')][_0x889a('0x1b')]);}_0x30896e['order']=qs[_0x889a('0x38')](_0x10db4a[_0x889a('0x31')][_0x889a('0x38')]);_0x30896e[_0x889a('0x39')]=qs[_0x889a('0x32')](_[_0x889a('0x3a')](_0x10db4a['query'],_0x3b560f['filters']),_0x7b48b7);if(_0x10db4a[_0x889a('0x31')][_0x889a('0x3b')]){_0x30896e[_0x889a('0x39')]=_[_0x889a('0x3c')](_0x30896e[_0x889a('0x39')],{'$or':_['map'](_0x7b48b7,function(_0x2f6bd2){if(_0x2f6bd2[_0x889a('0x2e')]!==_0x889a('0x3d')){var _0x2ba3d6={};_0x2ba3d6[_0x2f6bd2[_0x889a('0x28')]]={'$like':'%'+_0x10db4a['query']['filter']+'%'};return _0x2ba3d6;}})});}_0x30896e=_[_0x889a('0x3c')]({},_0x30896e,_0x10db4a[_0x889a('0x3e')]);var _0x2976d6={'where':_0x30896e[_0x889a('0x39')]};return db[_0x889a('0x2c')]['count'](_0x2976d6)[_0x889a('0x23')](function(_0x47c53b){_0x11ea37[_0x889a('0x1e')]=_0x47c53b;if(_0x10db4a[_0x889a('0x31')][_0x889a('0x3f')]){_0x30896e[_0x889a('0x40')]=[{'all':!![]}];}return db[_0x889a('0x2c')]['findAll'](_0x30896e);})[_0x889a('0x23')](function(_0x359180){_0x11ea37['rows']=_0x359180;return _0x11ea37;})[_0x889a('0x23')](respondWithFilteredResult(_0x54a395,_0x30896e))[_0x889a('0x41')](handleError(_0x54a395,null));};exports[_0x889a('0x42')]=function(_0x5b9df3,_0x4982c3){var _0x404298={'raw':!![],'where':{'id':_0x5b9df3['params']['id']}},_0x45efde={};_0x45efde['model']=_[_0x889a('0x30')](db[_0x889a('0x2c')][_0x889a('0x2d')]);_0x45efde[_0x889a('0x31')]=_['keys'](_0x5b9df3[_0x889a('0x31')]);_0x45efde[_0x889a('0x32')]=_['intersection'](_0x45efde['model'],_0x45efde[_0x889a('0x31')]);_0x404298[_0x889a('0x34')]=_[_0x889a('0x33')](_0x45efde[_0x889a('0x2f')],qs[_0x889a('0x35')](_0x5b9df3[_0x889a('0x31')]['fields']));_0x404298[_0x889a('0x34')]=_0x404298[_0x889a('0x34')]['length']?_0x404298[_0x889a('0x34')]:_0x45efde[_0x889a('0x2f')];if(_0x5b9df3['query'][_0x889a('0x3f')]){_0x404298[_0x889a('0x40')]=[{'all':!![]}];}_0x404298=_[_0x889a('0x3c')]({},_0x404298,_0x5b9df3[_0x889a('0x3e')]);return db[_0x889a('0x2c')]['find'](_0x404298)[_0x889a('0x23')](handleEntityNotFound(_0x4982c3,null))[_0x889a('0x23')](respondWithResult(_0x4982c3,null))[_0x889a('0x41')](handleError(_0x4982c3,null));};exports[_0x889a('0x43')]=function(_0x35eff6,_0x2b2397){return db[_0x889a('0x2c')][_0x889a('0x43')](_0x35eff6['body'],{})[_0x889a('0x23')](function(_0x1e20e4){var _0x1da57f=_0x35eff6[_0x889a('0x44')]['get']({'plain':!![]});if(!_0x1da57f)throw new Error(_0x889a('0x45'));if(_0x1da57f[_0x889a('0x46')]==='user'){var _0x658767=_0x1e20e4['get']({'plain':!![]});var _0x3a3858=_0x889a('0x26');return db['UserProfileSection'][_0x889a('0x47')]({'where':{'name':_0x3a3858,'userProfileId':_0x1da57f[_0x889a('0x48')]},'raw':!![]})[_0x889a('0x23')](function(_0x4d3128){if(_0x4d3128&&_0x4d3128['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x658767[_0x889a('0x28')],'resourceId':_0x658767['id'],'type':_0x4d3128[_0x889a('0x28')],'sectionId':_0x4d3128['id']},{})[_0x889a('0x23')](function(){return _0x1e20e4;});}else{return _0x1e20e4;}})[_0x889a('0x41')](function(_0x6430eb){logger[_0x889a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x6430eb);throw _0x6430eb;});}return _0x1e20e4;})['then'](respondWithResult(_0x2b2397,0xc9))['catch'](handleError(_0x2b2397,null));};exports[_0x889a('0x22')]=function(_0x2cab13,_0x3551d8){if(_0x2cab13[_0x889a('0x49')]['id']){delete _0x2cab13[_0x889a('0x49')]['id'];}return db[_0x889a('0x2c')][_0x889a('0x47')]({'where':{'id':_0x2cab13[_0x889a('0x4a')]['id']}})[_0x889a('0x23')](handleEntityNotFound(_0x3551d8,null))['then'](saveUpdates(_0x2cab13[_0x889a('0x49')],null))['then'](respondWithResult(_0x3551d8,null))[_0x889a('0x41')](handleError(_0x3551d8,null));};exports['destroy']=function(_0x585476,_0x1ea5d5){return db['SquareOdbc'][_0x889a('0x47')]({'where':{'id':_0x585476[_0x889a('0x4a')]['id']}})[_0x889a('0x23')](handleEntityNotFound(_0x1ea5d5,null))[_0x889a('0x23')](removeEntity(_0x1ea5d5,null))[_0x889a('0x41')](handleError(_0x1ea5d5,null));};exports[_0x889a('0x4b')]=function(_0x571d05,_0x29e3a5,_0x47b8cd){var _0x228d05;return db[_0x889a('0x2c')]['find']({'where':{'id':_0x571d05[_0x889a('0x4a')]['id']},'attributes':['id',_0x889a('0x4c')]})[_0x889a('0x23')](handleEntityNotFound(_0x29e3a5,null))[_0x889a('0x23')](function(_0x4b5a2c){if(_0x4b5a2c){var _0x14ee95=require(_0x889a('0x4d'))();_0x14ee95[_0x889a('0x4e')](_0x4b5a2c[_0x889a('0x4c')]);_0x14ee95[_0x889a('0x4f')]();return _0x4b5a2c;}})[_0x889a('0x23')](respondWithResult(_0x29e3a5,null))[_0x889a('0x41')](handleError(_0x29e3a5,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a27ce5e..3affe90 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 _0xf023=['define','SquareOdbc','square_odbc','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x523b20,_0x111ad2){var _0x5beb70=function(_0x19cbee){while(--_0x19cbee){_0x523b20['push'](_0x523b20['shift']());}};_0x5beb70(++_0x111ad2);}(_0xf023,0x153));var _0x3f02=function(_0x41f8b7,_0x180732){_0x41f8b7=_0x41f8b7-0x0;var _0x4aaab6=_0xf023[_0x41f8b7];return _0x4aaab6;};'use strict';var _=require(_0x3f02('0x0'));var util=require(_0x3f02('0x1'));var logger=require('../../config/logger')(_0x3f02('0x2'));var moment=require(_0x3f02('0x3'));var BPromise=require(_0x3f02('0x4'));var rp=require(_0x3f02('0x5'));var fs=require('fs');var path=require(_0x3f02('0x6'));var rimraf=require(_0x3f02('0x7'));var config=require(_0x3f02('0x8'));var attributes=require(_0x3f02('0x9'));module[_0x3f02('0xa')]=function(_0x2056a7,_0x7bc0ba){return _0x2056a7[_0x3f02('0xb')](_0x3f02('0xc'),attributes,{'tableName':_0x3f02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdcbc=['square_odbc','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./squareOdbc.attributes','define','SquareOdbc'];(function(_0x367050,_0x357afe){var _0x2aab7f=function(_0x2d7fb1){while(--_0x2d7fb1){_0x367050['push'](_0x367050['shift']());}};_0x2aab7f(++_0x357afe);}(_0xdcbc,0x16c));var _0xcdcb=function(_0x53f38d,_0x5ec720){_0x53f38d=_0x53f38d-0x0;var _0xdd4bca=_0xdcbc[_0x53f38d];return _0xdd4bca;};'use strict';var _=require(_0xcdcb('0x0'));var util=require(_0xcdcb('0x1'));var logger=require(_0xcdcb('0x2'))('api');var moment=require(_0xcdcb('0x3'));var BPromise=require(_0xcdcb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdcb('0x5'));var rimraf=require(_0xcdcb('0x6'));var config=require('../../config/environment');var attributes=require(_0xcdcb('0x7'));module['exports']=function(_0x210ca6,_0x4ebdf1){return _0x210ca6[_0xcdcb('0x8')](_0xcdcb('0x9'),attributes,{'tableName':_0xcdcb('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 4554f64..35ce2c8 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 _0x4437=['error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4437,0x19a));var _0x7443=function(_0x221d4f,_0x30e5fb){_0x221d4f=_0x221d4f-0x0;var _0x5b840d=_0x4437[_0x221d4f];return _0x5b840d;};'use strict';var _=require(_0x7443('0x0'));var util=require(_0x7443('0x1'));var moment=require(_0x7443('0x2'));var BPromise=require(_0x7443('0x3'));var rs=require(_0x7443('0x4'));var fs=require('fs');var Redis=require(_0x7443('0x5'));var db=require(_0x7443('0x6'))['db'];var utils=require(_0x7443('0x7'));var logger=require(_0x7443('0x8'))(_0x7443('0x9'));var config=require(_0x7443('0xa'));var jayson=require(_0x7443('0xb'));var client=jayson[_0x7443('0xc')][_0x7443('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d67d4,_0x2822db,_0xb7cc79){return new BPromise(function(_0x5beaaa,_0x4ee0d3){return client[_0x7443('0xe')](_0x1d67d4,_0xb7cc79)[_0x7443('0xf')](function(_0x20ca90){logger[_0x7443('0x10')](_0x7443('0x11'),_0x2822db,'request\x20sent');logger[_0x7443('0x12')](_0x7443('0x13'),_0x2822db,_0x7443('0x14'),JSON[_0x7443('0x15')](_0x20ca90));if(_0x20ca90[_0x7443('0x16')]){if(_0x20ca90[_0x7443('0x16')][_0x7443('0x17')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x2822db,_0x20ca90[_0x7443('0x16')]['message']);return _0x4ee0d3(_0x20ca90['error']['message']);}logger[_0x7443('0x16')](_0x7443('0x11'),_0x2822db,_0x20ca90[_0x7443('0x16')][_0x7443('0x18')]);return _0x5beaaa(_0x20ca90[_0x7443('0x16')][_0x7443('0x18')]);}else{logger['info'](_0x7443('0x11'),_0x2822db,_0x7443('0x14'));_0x5beaaa(_0x20ca90['result'][_0x7443('0x18')]);}})[_0x7443('0x19')](function(_0x3089c0){logger[_0x7443('0x16')]('SquareOdbc,\x20%s,\x20%s',_0x2822db,_0x3089c0);_0x4ee0d3(_0x3089c0);});});}exports[_0x7443('0x1a')]=function(_0x124bc1){var _0x5f2d45=this;return new Promise(function(_0x39343e,_0x25bf03){return db[_0x7443('0x1b')][_0x7443('0x1c')]({'raw':_0x124bc1[_0x7443('0x1d')]?_0x124bc1[_0x7443('0x1d')][_0x7443('0x1e')]===undefined?!![]:![]:!![],'where':_0x124bc1[_0x7443('0x1d')]?_0x124bc1[_0x7443('0x1d')][_0x7443('0x1f')]||null:null,'attributes':_0x124bc1[_0x7443('0x1d')]?_0x124bc1[_0x7443('0x1d')]['attributes']||null:null,'include':_0x124bc1['options']?_0x124bc1[_0x7443('0x1d')][_0x7443('0x20')]?_[_0x7443('0x21')](_0x124bc1['options'][_0x7443('0x20')],function(_0x435c3e){return{'model':db[_0x435c3e[_0x7443('0x22')]],'as':_0x435c3e['as'],'attributes':_0x435c3e[_0x7443('0x23')],'include':_0x435c3e[_0x7443('0x20')]?_[_0x7443('0x21')](_0x435c3e[_0x7443('0x20')],function(_0x1c9ac9){return{'model':db[_0x1c9ac9['model']],'as':_0x1c9ac9['as'],'attributes':_0x1c9ac9[_0x7443('0x23')],'include':_0x1c9ac9[_0x7443('0x20')]?_[_0x7443('0x21')](_0x1c9ac9[_0x7443('0x20')],function(_0x3fbb28){return{'model':db[_0x3fbb28['model']],'as':_0x3fbb28['as'],'attributes':_0x3fbb28[_0x7443('0x23')]};}):[]};}):[]};}):[]:[]})[_0x7443('0xf')](function(_0x34ff29){logger[_0x7443('0x10')](_0x7443('0x1a'),_0x124bc1);logger[_0x7443('0x12')]('ShowSquareOdbc',_0x124bc1,JSON[_0x7443('0x15')](_0x34ff29));_0x39343e(_0x34ff29);})[_0x7443('0x19')](function(_0x193032){logger[_0x7443('0x16')](_0x7443('0x1a'),_0x193032[_0x7443('0x18')],_0x124bc1);_0x25bf03(_0x5f2d45['error'](0x1f4,_0x193032[_0x7443('0x18')]));});});}; \ No newline at end of file +var _0x636d=['stringify','error','code','message','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x636d,0x164));var _0xd636=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x636d[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xd636('0x0'));var util=require(_0xd636('0x1'));var moment=require(_0xd636('0x2'));var BPromise=require('bluebird');var rs=require(_0xd636('0x3'));var fs=require('fs');var Redis=require(_0xd636('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd636('0x5'));var logger=require(_0xd636('0x6'))(_0xd636('0x7'));var config=require('../../config/environment');var jayson=require(_0xd636('0x8'));var client=jayson[_0xd636('0x9')][_0xd636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b7418,_0x748176,_0x63924b){return new BPromise(function(_0x2ad630,_0x512463){return client[_0xd636('0xb')](_0x1b7418,_0x63924b)['then'](function(_0x5258e6){logger[_0xd636('0xc')](_0xd636('0xd'),_0x748176,_0xd636('0xe'));logger[_0xd636('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x748176,'request\x20sent',JSON[_0xd636('0x10')](_0x5258e6));if(_0x5258e6['error']){if(_0x5258e6[_0xd636('0x11')][_0xd636('0x12')]===0x1f4){logger[_0xd636('0x11')](_0xd636('0xd'),_0x748176,_0x5258e6['error'][_0xd636('0x13')]);return _0x512463(_0x5258e6[_0xd636('0x11')][_0xd636('0x13')]);}logger[_0xd636('0x11')](_0xd636('0xd'),_0x748176,_0x5258e6[_0xd636('0x11')][_0xd636('0x13')]);return _0x2ad630(_0x5258e6[_0xd636('0x11')][_0xd636('0x13')]);}else{logger[_0xd636('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x748176,_0xd636('0xe'));_0x2ad630(_0x5258e6['result'][_0xd636('0x13')]);}})[_0xd636('0x14')](function(_0xade61e){logger[_0xd636('0x11')](_0xd636('0xd'),_0x748176,_0xade61e);_0x512463(_0xade61e);});});}exports[_0xd636('0x15')]=function(_0x1925fb){var _0x46bfcd=this;return new Promise(function(_0x2518e3,_0x370821){return db['SquareOdbc'][_0xd636('0x16')]({'raw':_0x1925fb['options']?_0x1925fb[_0xd636('0x17')][_0xd636('0x18')]===undefined?!![]:![]:!![],'where':_0x1925fb['options']?_0x1925fb[_0xd636('0x17')][_0xd636('0x19')]||null:null,'attributes':_0x1925fb[_0xd636('0x17')]?_0x1925fb['options'][_0xd636('0x1a')]||null:null,'include':_0x1925fb[_0xd636('0x17')]?_0x1925fb['options'][_0xd636('0x1b')]?_[_0xd636('0x1c')](_0x1925fb[_0xd636('0x17')][_0xd636('0x1b')],function(_0x263a10){return{'model':db[_0x263a10[_0xd636('0x1d')]],'as':_0x263a10['as'],'attributes':_0x263a10[_0xd636('0x1a')],'include':_0x263a10[_0xd636('0x1b')]?_['map'](_0x263a10[_0xd636('0x1b')],function(_0x1b1ee5){return{'model':db[_0x1b1ee5[_0xd636('0x1d')]],'as':_0x1b1ee5['as'],'attributes':_0x1b1ee5[_0xd636('0x1a')],'include':_0x1b1ee5[_0xd636('0x1b')]?_[_0xd636('0x1c')](_0x1b1ee5[_0xd636('0x1b')],function(_0x5c6095){return{'model':db[_0x5c6095[_0xd636('0x1d')]],'as':_0x5c6095['as'],'attributes':_0x5c6095[_0xd636('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd636('0x1e')](function(_0x27164a){logger[_0xd636('0xc')](_0xd636('0x15'),_0x1925fb);logger[_0xd636('0xf')]('ShowSquareOdbc',_0x1925fb,JSON[_0xd636('0x10')](_0x27164a));_0x2518e3(_0x27164a);})[_0xd636('0x14')](function(_0xfc9542){logger[_0xd636('0x11')]('ShowSquareOdbc',_0xfc9542[_0xd636('0x13')],_0x1925fb);_0x370821(_0x46bfcd[_0xd636('0x11')](0x1f4,_0xfc9542[_0xd636('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 6759504..0db8b95 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 _0x0f40=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','isAuthenticated','index','/:id','post','create','update','destroy','util','path','connect-timeout'];(function(_0x5ded81,_0x5d770d){var _0x3e99ab=function(_0x178ca6){while(--_0x178ca6){_0x5ded81['push'](_0x5ded81['shift']());}};_0x3e99ab(++_0x5d770d);}(_0x0f40,0x6d));var _0x00f4=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x0f40[_0x1ad901];return _0x3c0249;};'use strict';var multer=require('multer');var util=require(_0x00f4('0x0'));var path=require(_0x00f4('0x1'));var timeout=require(_0x00f4('0x2'));var express=require(_0x00f4('0x3'));var router=express[_0x00f4('0x4')]();var fs_extra=require(_0x00f4('0x5'));var auth=require(_0x00f4('0x6'));var interaction=require(_0x00f4('0x7'));var config=require('../../config/environment');var controller=require(_0x00f4('0x8'));router['get']('/',auth[_0x00f4('0x9')](),controller[_0x00f4('0xa')]);router['get'](_0x00f4('0xb'),auth[_0x00f4('0x9')](),controller['show']);router[_0x00f4('0xc')]('/',auth['isAuthenticated'](),controller[_0x00f4('0xd')]);router['put'](_0x00f4('0xb'),auth['isAuthenticated'](),controller[_0x00f4('0xe')]);router['delete']('/:id',auth[_0x00f4('0x9')](),controller[_0x00f4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x4df5=['fs-extra','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','util','path','express','Router'];(function(_0x2fb453,_0x37fa88){var _0x290bc0=function(_0x266486){while(--_0x266486){_0x2fb453['push'](_0x2fb453['shift']());}};_0x290bc0(++_0x37fa88);}(_0x4df5,0x13f));var _0x54df=function(_0x1ebe2e,_0x301e32){_0x1ebe2e=_0x1ebe2e-0x0;var _0x59dfdc=_0x4df5[_0x1ebe2e];return _0x59dfdc;};'use strict';var multer=require('multer');var util=require(_0x54df('0x0'));var path=require(_0x54df('0x1'));var timeout=require('connect-timeout');var express=require(_0x54df('0x2'));var router=express[_0x54df('0x3')]();var fs_extra=require(_0x54df('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x54df('0x5'));var config=require('../../config/environment');var controller=require(_0x54df('0x6'));router[_0x54df('0x7')]('/',auth[_0x54df('0x8')](),controller[_0x54df('0x9')]);router['get'](_0x54df('0xa'),auth['isAuthenticated'](),controller[_0x54df('0xb')]);router[_0x54df('0xc')]('/',auth[_0x54df('0x8')](),controller['create']);router[_0x54df('0xd')](_0x54df('0xa'),auth['isAuthenticated'](),controller[_0x54df('0xe')]);router[_0x54df('0xf')](_0x54df('0xa'),auth['isAuthenticated'](),controller[_0x54df('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 390043c..e186ce7 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 _0xcc76=['preproduction','utf8','long','production','toString','DATE','sequelize','exports','STRING','name','BLOB','getDataValue'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcc76,0x11a));var _0x6cc7=function(_0x140cc5,_0x41d4d6){_0x140cc5=_0x140cc5-0x0;var _0x21d4bd=_0xcc76[_0x140cc5];return _0x21d4bd;};'use strict';var Sequelize=require(_0x6cc7('0x0'));module[_0x6cc7('0x1')]={'name':{'type':Sequelize[_0x6cc7('0x2')],'unique':_0x6cc7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6cc7('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x6cc7('0x4')]('long'),'get':function(){if(this[_0x6cc7('0x5')](_0x6cc7('0x6'))){return this[_0x6cc7('0x5')]('preproduction')['toString'](_0x6cc7('0x7'));}}},'production':{'type':Sequelize[_0x6cc7('0x4')](_0x6cc7('0x8')),'get':function(){if(this[_0x6cc7('0x5')](_0x6cc7('0x9'))){return this[_0x6cc7('0x5')](_0x6cc7('0x9'))[_0x6cc7('0xa')](_0x6cc7('0x7'));}}},'savedAt':{'type':Sequelize[_0x6cc7('0xb')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x5df4=['STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x439fc4,_0x31c91e){var _0x33aed4=function(_0x5153d7){while(--_0x5153d7){_0x439fc4['push'](_0x439fc4['shift']());}};_0x33aed4(++_0x31c91e);}(_0x5df4,0x1a2));var _0x45df=function(_0x342184,_0x5ab1e4){_0x342184=_0x342184-0x0;var _0x1833ed=_0x5df4[_0x342184];return _0x1833ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x45df('0x0')],'unique':_0x45df('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x45df('0x2')]},'preproduction':{'type':Sequelize[_0x45df('0x3')](_0x45df('0x4')),'get':function(){if(this[_0x45df('0x5')](_0x45df('0x6'))){return this[_0x45df('0x5')](_0x45df('0x6'))[_0x45df('0x7')](_0x45df('0x8'));}}},'production':{'type':Sequelize[_0x45df('0x3')](_0x45df('0x4')),'get':function(){if(this[_0x45df('0x5')](_0x45df('0x9'))){return this[_0x45df('0x5')]('production')['toString'](_0x45df('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x45df('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index d944f1e..7cc8cfe 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 _0xd8f7=['pick','filter','merge','options','includeAll','params','keys','SquareProject','find','create','body','user','role','UserProfileSection','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','get','lodash','ioredis','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./squareProject.socket','register','offset','limit','count','status','Content-Range','json','destroy','then','SquareProjects','UserProfileResource','redis','publish','agi','stringify','end','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where'];(function(_0x3c9262,_0x2f20d6){var _0x5c6c65=function(_0x420482){while(--_0x420482){_0x3c9262['push'](_0x3c9262['shift']());}};_0x5c6c65(++_0x2f20d6);}(_0xd8f7,0x1c4));var _0x7d8f=function(_0x418bb1,_0x5211a4){_0x418bb1=_0x418bb1-0x0;var _0x111b58=_0xd8f7[_0x418bb1];return _0x111b58;};'use strict';var _=require(_0x7d8f('0x0'));var Redis=require(_0x7d8f('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x7d8f('0x2'));var config=require(_0x7d8f('0x3'));var db=require(_0x7d8f('0x4'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7d8f('0x5'),'port':0x18eb});var socket=require(_0x7d8f('0x6'))(new Redis(config['redis']));require(_0x7d8f('0x7'))[_0x7d8f('0x8')](socket);function respondWithResult(_0x395ce6,_0x1c61da){_0x1c61da=_0x1c61da||0xc8;return function(_0x176870){if(_0x176870){return _0x395ce6['status'](_0x1c61da)['json'](_0x176870);}};}function respondWithFilteredResult(_0x2f3264,_0x4e176b){return function(_0x4fa221){if(_0x4fa221){var _0x15f661=typeof _0x4e176b[_0x7d8f('0x9')]==='undefined'&&typeof _0x4e176b[_0x7d8f('0xa')]==='undefined';var _0x3d9ef5=_0x4fa221[_0x7d8f('0xb')];var _0x455ae5=_0x15f661?0x0:_0x4e176b['offset'];var _0x30a16b=_0x15f661?_0x4fa221[_0x7d8f('0xb')]:_0x4e176b[_0x7d8f('0x9')]+_0x4e176b[_0x7d8f('0xa')];var _0x542844;if(_0x30a16b>=_0x3d9ef5){_0x30a16b=_0x3d9ef5;_0x542844=0xc8;}else{_0x542844=0xce;}_0x2f3264[_0x7d8f('0xc')](_0x542844);return _0x2f3264['set'](_0x7d8f('0xd'),_0x455ae5+'-'+_0x30a16b+'/'+_0x3d9ef5)[_0x7d8f('0xe')](_0x4fa221);}return null;};}function saveUpdates(_0x5d3c56){return function(_0x167060){if(_0x167060){return _0x167060['update'](_0x5d3c56)['then'](function(_0x411c08){return _0x411c08;});}return null;};}function removeEntity(_0x19f1d6){return function(_0x3fd81e){if(_0x3fd81e){return _0x3fd81e[_0x7d8f('0xf')]()[_0x7d8f('0x10')](function(){var _0x48c91d=_0x3fd81e['get']({'plain':!![]});var _0x31f4ee=_0x7d8f('0x11');return db[_0x7d8f('0x12')][_0x7d8f('0xf')]({'where':{'type':_0x31f4ee,'resourceId':_0x48c91d['id']}})[_0x7d8f('0x10')](function(){return _0x3fd81e;});})[_0x7d8f('0x10')](function(){var _0x1e3be3=new Redis(config[_0x7d8f('0x13')]);_0x1e3be3[_0x7d8f('0x14')](_0x7d8f('0x15'),JSON[_0x7d8f('0x16')]({'id':_0x3fd81e['id'],'deleted':!![]}));})[_0x7d8f('0x10')](function(){_0x19f1d6[_0x7d8f('0xc')](0xcc)[_0x7d8f('0x17')]();});}};}function handleEntityNotFound(_0x51b037){return function(_0x4fed34){if(!_0x4fed34){_0x51b037[_0x7d8f('0x18')](0x194);}return _0x4fed34;};}function handleError(_0x2f4e82,_0x35d6c1){_0x35d6c1=_0x35d6c1||0x1f4;return function(_0x187f50){logger[_0x7d8f('0x19')](_0x187f50[_0x7d8f('0x1a')]);if(_0x187f50[_0x7d8f('0x1b')]){delete _0x187f50[_0x7d8f('0x1b')];}_0x2f4e82[_0x7d8f('0xc')](_0x35d6c1)[_0x7d8f('0x1c')](_0x187f50);};}exports[_0x7d8f('0x1d')]=function(_0x557f4f,_0x3090c9){var _0x57c8b5={},_0x1ea624={},_0x5d7262={'count':0x0,'rows':[]};var _0x4565f5=_['map'](db['SquareProject'][_0x7d8f('0x1e')],function(_0x9b9ea0){return{'name':_0x9b9ea0['fieldName'],'type':_0x9b9ea0[_0x7d8f('0x1f')][_0x7d8f('0x20')]};});_0x1ea624[_0x7d8f('0x21')]=_[_0x7d8f('0x22')](_0x4565f5,_0x7d8f('0x1b'));_0x1ea624['query']=_['keys'](_0x557f4f[_0x7d8f('0x23')]);_0x1ea624[_0x7d8f('0x24')]=_['intersection'](_0x1ea624['model'],_0x1ea624['query']);_0x57c8b5[_0x7d8f('0x25')]=_[_0x7d8f('0x26')](_0x1ea624[_0x7d8f('0x21')],qs[_0x7d8f('0x27')](_0x557f4f['query'][_0x7d8f('0x27')]));_0x57c8b5[_0x7d8f('0x25')]=_0x57c8b5[_0x7d8f('0x25')][_0x7d8f('0x28')]?_0x57c8b5[_0x7d8f('0x25')]:_0x1ea624[_0x7d8f('0x21')];if(!_0x557f4f[_0x7d8f('0x23')][_0x7d8f('0x29')]('nolimit')){_0x57c8b5[_0x7d8f('0xa')]=qs[_0x7d8f('0xa')](_0x557f4f[_0x7d8f('0x23')][_0x7d8f('0xa')]);_0x57c8b5[_0x7d8f('0x9')]=qs[_0x7d8f('0x9')](_0x557f4f[_0x7d8f('0x23')]['offset']);}_0x57c8b5[_0x7d8f('0x2a')]=qs['sort'](_0x557f4f[_0x7d8f('0x23')]['sort']);_0x57c8b5[_0x7d8f('0x2b')]=qs[_0x7d8f('0x24')](_[_0x7d8f('0x2c')](_0x557f4f[_0x7d8f('0x23')],_0x1ea624[_0x7d8f('0x24')]),_0x4565f5);if(_0x557f4f['query'][_0x7d8f('0x2d')]){_0x57c8b5[_0x7d8f('0x2b')]=_[_0x7d8f('0x2e')](_0x57c8b5['where'],{'$or':_[_0x7d8f('0x22')](_0x4565f5,function(_0x4b0e9b){if(_0x4b0e9b[_0x7d8f('0x1f')]!=='VIRTUAL'){var _0x53b74a={};_0x53b74a[_0x4b0e9b['name']]={'$like':'%'+_0x557f4f['query']['filter']+'%'};return _0x53b74a;}})});}_0x57c8b5=_[_0x7d8f('0x2e')]({},_0x57c8b5,_0x557f4f[_0x7d8f('0x2f')]);var _0x1e4b67={'where':_0x57c8b5['where']};return db['SquareProject']['count'](_0x1e4b67)[_0x7d8f('0x10')](function(_0x35e10e){_0x5d7262[_0x7d8f('0xb')]=_0x35e10e;if(_0x557f4f[_0x7d8f('0x23')][_0x7d8f('0x30')]){_0x57c8b5['include']=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x57c8b5);})[_0x7d8f('0x10')](function(_0x3e0ca3){_0x5d7262['rows']=_0x3e0ca3;return _0x5d7262;})['then'](respondWithFilteredResult(_0x3090c9,_0x57c8b5))['catch'](handleError(_0x3090c9,null));};exports['show']=function(_0x36bf58,_0x18c7c8){var _0x45cd62={'raw':![],'where':{'id':_0x36bf58[_0x7d8f('0x31')]['id']}},_0x2f2e11={};_0x2f2e11['model']=_[_0x7d8f('0x32')](db[_0x7d8f('0x33')][_0x7d8f('0x1e')]);_0x2f2e11[_0x7d8f('0x23')]=_[_0x7d8f('0x32')](_0x36bf58['query']);_0x2f2e11[_0x7d8f('0x24')]=_[_0x7d8f('0x26')](_0x2f2e11[_0x7d8f('0x21')],_0x2f2e11[_0x7d8f('0x23')]);_0x45cd62['attributes']=_[_0x7d8f('0x26')](_0x2f2e11[_0x7d8f('0x21')],qs[_0x7d8f('0x27')](_0x36bf58['query']['fields']));_0x45cd62[_0x7d8f('0x25')]=_0x45cd62[_0x7d8f('0x25')]['length']?_0x45cd62[_0x7d8f('0x25')]:_0x2f2e11[_0x7d8f('0x21')];if(_0x36bf58[_0x7d8f('0x23')][_0x7d8f('0x30')]){_0x45cd62['include']=[{'all':!![]}];}_0x45cd62=_['merge']({},_0x45cd62,_0x36bf58['options']);return db[_0x7d8f('0x33')][_0x7d8f('0x34')](_0x45cd62)[_0x7d8f('0x10')](handleEntityNotFound(_0x18c7c8,null))[_0x7d8f('0x10')](respondWithResult(_0x18c7c8,null))['catch'](handleError(_0x18c7c8,null));};exports['create']=function(_0x1fda61,_0x553ddc){return db[_0x7d8f('0x33')][_0x7d8f('0x35')](_0x1fda61[_0x7d8f('0x36')],{})[_0x7d8f('0x10')](function(_0x371c7c){var _0xf941c4=_0x1fda61[_0x7d8f('0x37')]['get']({'plain':!![]});if(!_0xf941c4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf941c4[_0x7d8f('0x38')]===_0x7d8f('0x37')){var _0x4015f3=_0x371c7c['get']({'plain':!![]});var _0x4efd06=_0x7d8f('0x11');return db[_0x7d8f('0x39')][_0x7d8f('0x34')]({'where':{'name':_0x4efd06,'userProfileId':_0xf941c4['userProfileId']},'raw':!![]})[_0x7d8f('0x10')](function(_0x4ed186){if(_0x4ed186&&_0x4ed186['autoAssociation']===0x0){return db[_0x7d8f('0x12')][_0x7d8f('0x35')]({'name':_0x4015f3[_0x7d8f('0x1b')],'resourceId':_0x4015f3['id'],'type':_0x4ed186[_0x7d8f('0x1b')],'sectionId':_0x4ed186['id']},{})[_0x7d8f('0x10')](function(){return _0x371c7c;});}else{return _0x371c7c;}})[_0x7d8f('0x3a')](function(_0x46507e){logger[_0x7d8f('0x19')](_0x7d8f('0x3b'),_0x46507e);throw _0x46507e;});}return _0x371c7c;})[_0x7d8f('0x10')](respondWithResult(_0x553ddc,0xc9))[_0x7d8f('0x3a')](handleError(_0x553ddc,null));};exports[_0x7d8f('0x3c')]=function(_0x3c89b2,_0x2ab79b){if(_0x3c89b2[_0x7d8f('0x36')]['id']){delete _0x3c89b2[_0x7d8f('0x36')]['id'];}return db[_0x7d8f('0x33')][_0x7d8f('0x34')]({'where':{'id':_0x3c89b2[_0x7d8f('0x31')]['id']}})[_0x7d8f('0x10')](handleEntityNotFound(_0x2ab79b,null))['then'](saveUpdates(_0x3c89b2[_0x7d8f('0x36')],null))[_0x7d8f('0x10')](function(_0x3e91eb){if(!_0x3e91eb)return;var _0x704535=_0x3e91eb[_0x7d8f('0x3d')]({'plain':!![]});return _0x704535;})['then'](function(_0x5d454f){var _0x1e600a=new Redis(config[_0x7d8f('0x13')]);_0x1e600a['publish'](_0x7d8f('0x15'),JSON[_0x7d8f('0x16')](_['pick'](_0x5d454f,['id','name','production'])));return _0x5d454f;})[_0x7d8f('0x10')](respondWithResult(_0x2ab79b,null))[_0x7d8f('0x3a')](handleError(_0x2ab79b,null));};exports[_0x7d8f('0xf')]=function(_0x25dde3,_0x179240){return db[_0x7d8f('0x33')][_0x7d8f('0x34')]({'where':{'id':_0x25dde3[_0x7d8f('0x31')]['id']}})[_0x7d8f('0x10')](handleEntityNotFound(_0x179240,null))[_0x7d8f('0x10')](removeEntity(_0x179240,null))[_0x7d8f('0x3a')](handleError(_0x179240,null));}; \ No newline at end of file +var _0xdf8b=['catch','length','user','find','userProfileId','autoAssociation','create','body','params','publish','production','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','json','undefined','limit','offset','count','status','set','Content-Range','update','destroy','then','get','SquareProjects','UserProfileResource','agi','stringify','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','SquareProject','includeAll','include','findAll','rows'];(function(_0x3460d1,_0x479b96){var _0x451f0f=function(_0x17ac54){while(--_0x17ac54){_0x3460d1['push'](_0x3460d1['shift']());}};_0x451f0f(++_0x479b96);}(_0xdf8b,0x93));var _0xbdf8=function(_0x27ebe8,_0x21dd01){_0x27ebe8=_0x27ebe8-0x0;var _0x431778=_0xdf8b[_0x27ebe8];return _0x431778;};'use strict';var _=require(_0xbdf8('0x0'));var Redis=require(_0xbdf8('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xbdf8('0x2'));var config=require(_0xbdf8('0x3'));var db=require(_0xbdf8('0x4'))['db'];config[_0xbdf8('0x5')]=_[_0xbdf8('0x6')](config[_0xbdf8('0x5')],{'host':_0xbdf8('0x7'),'port':0x18eb});var socket=require(_0xbdf8('0x8'))(new Redis(config[_0xbdf8('0x5')]));require(_0xbdf8('0x9'))[_0xbdf8('0xa')](socket);function respondWithResult(_0x59d53b,_0x136c4e){_0x136c4e=_0x136c4e||0xc8;return function(_0x5d219b){if(_0x5d219b){return _0x59d53b['status'](_0x136c4e)[_0xbdf8('0xb')](_0x5d219b);}};}function respondWithFilteredResult(_0x1943d9,_0x5a87c7){return function(_0xd5b7c7){if(_0xd5b7c7){var _0x18b1b5=typeof _0x5a87c7['offset']===_0xbdf8('0xc')&&typeof _0x5a87c7[_0xbdf8('0xd')]==='undefined';var _0x36a573=_0xd5b7c7['count'];var _0x57e719=_0x18b1b5?0x0:_0x5a87c7[_0xbdf8('0xe')];var _0x589f65=_0x18b1b5?_0xd5b7c7[_0xbdf8('0xf')]:_0x5a87c7[_0xbdf8('0xe')]+_0x5a87c7[_0xbdf8('0xd')];var _0x34eb3d;if(_0x589f65>=_0x36a573){_0x589f65=_0x36a573;_0x34eb3d=0xc8;}else{_0x34eb3d=0xce;}_0x1943d9[_0xbdf8('0x10')](_0x34eb3d);return _0x1943d9[_0xbdf8('0x11')](_0xbdf8('0x12'),_0x57e719+'-'+_0x589f65+'/'+_0x36a573)['json'](_0xd5b7c7);}return null;};}function saveUpdates(_0x47980f){return function(_0x3a0770){if(_0x3a0770){return _0x3a0770[_0xbdf8('0x13')](_0x47980f)['then'](function(_0x4b8a21){return _0x4b8a21;});}return null;};}function removeEntity(_0x405ee4){return function(_0x4740b0){if(_0x4740b0){return _0x4740b0[_0xbdf8('0x14')]()[_0xbdf8('0x15')](function(){var _0x4d0c3d=_0x4740b0[_0xbdf8('0x16')]({'plain':!![]});var _0x44b45c=_0xbdf8('0x17');return db[_0xbdf8('0x18')][_0xbdf8('0x14')]({'where':{'type':_0x44b45c,'resourceId':_0x4d0c3d['id']}})['then'](function(){return _0x4740b0;});})[_0xbdf8('0x15')](function(){var _0x40cf3c=new Redis(config[_0xbdf8('0x5')]);_0x40cf3c['publish'](_0xbdf8('0x19'),JSON[_0xbdf8('0x1a')]({'id':_0x4740b0['id'],'deleted':!![]}));})[_0xbdf8('0x15')](function(){_0x405ee4[_0xbdf8('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x521312){return function(_0x2d9ccd){if(!_0x2d9ccd){_0x521312[_0xbdf8('0x1b')](0x194);}return _0x2d9ccd;};}function handleError(_0x74d46,_0x3e8948){_0x3e8948=_0x3e8948||0x1f4;return function(_0x21f266){logger[_0xbdf8('0x1c')](_0x21f266[_0xbdf8('0x1d')]);if(_0x21f266['name']){delete _0x21f266[_0xbdf8('0x1e')];}_0x74d46[_0xbdf8('0x10')](_0x3e8948)['send'](_0x21f266);};}exports['index']=function(_0x67c6d3,_0x5eb246){var _0xcb2203={},_0x161a7e={},_0x518e2d={'count':0x0,'rows':[]};var _0xa0862f=_[_0xbdf8('0x1f')](db['SquareProject'][_0xbdf8('0x20')],function(_0x50aaec){return{'name':_0x50aaec[_0xbdf8('0x21')],'type':_0x50aaec[_0xbdf8('0x22')]['key']};});_0x161a7e[_0xbdf8('0x23')]=_[_0xbdf8('0x1f')](_0xa0862f,_0xbdf8('0x1e'));_0x161a7e['query']=_[_0xbdf8('0x24')](_0x67c6d3[_0xbdf8('0x25')]);_0x161a7e[_0xbdf8('0x26')]=_[_0xbdf8('0x27')](_0x161a7e[_0xbdf8('0x23')],_0x161a7e[_0xbdf8('0x25')]);_0xcb2203[_0xbdf8('0x28')]=_[_0xbdf8('0x27')](_0x161a7e[_0xbdf8('0x23')],qs[_0xbdf8('0x29')](_0x67c6d3[_0xbdf8('0x25')][_0xbdf8('0x29')]));_0xcb2203[_0xbdf8('0x28')]=_0xcb2203['attributes']['length']?_0xcb2203['attributes']:_0x161a7e['model'];if(!_0x67c6d3[_0xbdf8('0x25')][_0xbdf8('0x2a')](_0xbdf8('0x2b'))){_0xcb2203['limit']=qs[_0xbdf8('0xd')](_0x67c6d3[_0xbdf8('0x25')][_0xbdf8('0xd')]);_0xcb2203['offset']=qs[_0xbdf8('0xe')](_0x67c6d3['query'][_0xbdf8('0xe')]);}_0xcb2203[_0xbdf8('0x2c')]=qs['sort'](_0x67c6d3[_0xbdf8('0x25')][_0xbdf8('0x2d')]);_0xcb2203[_0xbdf8('0x2e')]=qs[_0xbdf8('0x26')](_[_0xbdf8('0x2f')](_0x67c6d3[_0xbdf8('0x25')],_0x161a7e['filters']),_0xa0862f);if(_0x67c6d3[_0xbdf8('0x25')]['filter']){_0xcb2203[_0xbdf8('0x2e')]=_['merge'](_0xcb2203[_0xbdf8('0x2e')],{'$or':_['map'](_0xa0862f,function(_0x2c21d4){if(_0x2c21d4[_0xbdf8('0x22')]!==_0xbdf8('0x30')){var _0x321638={};_0x321638[_0x2c21d4['name']]={'$like':'%'+_0x67c6d3['query'][_0xbdf8('0x31')]+'%'};return _0x321638;}})});}_0xcb2203=_[_0xbdf8('0x32')]({},_0xcb2203,_0x67c6d3[_0xbdf8('0x33')]);var _0x2389f9={'where':_0xcb2203['where']};return db[_0xbdf8('0x34')][_0xbdf8('0xf')](_0x2389f9)[_0xbdf8('0x15')](function(_0xa6dbe9){_0x518e2d[_0xbdf8('0xf')]=_0xa6dbe9;if(_0x67c6d3[_0xbdf8('0x25')][_0xbdf8('0x35')]){_0xcb2203[_0xbdf8('0x36')]=[{'all':!![]}];}return db[_0xbdf8('0x34')][_0xbdf8('0x37')](_0xcb2203);})['then'](function(_0x2340fa){_0x518e2d[_0xbdf8('0x38')]=_0x2340fa;return _0x518e2d;})[_0xbdf8('0x15')](respondWithFilteredResult(_0x5eb246,_0xcb2203))[_0xbdf8('0x39')](handleError(_0x5eb246,null));};exports['show']=function(_0xcb97bb,_0x12a0b5){var _0x34067e={'raw':![],'where':{'id':_0xcb97bb['params']['id']}},_0x2285e3={};_0x2285e3['model']=_[_0xbdf8('0x24')](db[_0xbdf8('0x34')]['rawAttributes']);_0x2285e3[_0xbdf8('0x25')]=_[_0xbdf8('0x24')](_0xcb97bb['query']);_0x2285e3[_0xbdf8('0x26')]=_[_0xbdf8('0x27')](_0x2285e3[_0xbdf8('0x23')],_0x2285e3[_0xbdf8('0x25')]);_0x34067e[_0xbdf8('0x28')]=_[_0xbdf8('0x27')](_0x2285e3[_0xbdf8('0x23')],qs[_0xbdf8('0x29')](_0xcb97bb['query']['fields']));_0x34067e[_0xbdf8('0x28')]=_0x34067e[_0xbdf8('0x28')][_0xbdf8('0x3a')]?_0x34067e[_0xbdf8('0x28')]:_0x2285e3['model'];if(_0xcb97bb[_0xbdf8('0x25')][_0xbdf8('0x35')]){_0x34067e[_0xbdf8('0x36')]=[{'all':!![]}];}_0x34067e=_['merge']({},_0x34067e,_0xcb97bb[_0xbdf8('0x33')]);return db['SquareProject']['find'](_0x34067e)[_0xbdf8('0x15')](handleEntityNotFound(_0x12a0b5,null))['then'](respondWithResult(_0x12a0b5,null))[_0xbdf8('0x39')](handleError(_0x12a0b5,null));};exports['create']=function(_0x4a31e6,_0x19560f){return db['SquareProject']['create'](_0x4a31e6['body'],{})[_0xbdf8('0x15')](function(_0x4bc92a){var _0xeca4b1=_0x4a31e6[_0xbdf8('0x3b')][_0xbdf8('0x16')]({'plain':!![]});if(!_0xeca4b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xeca4b1['role']===_0xbdf8('0x3b')){var _0x9b6253=_0x4bc92a[_0xbdf8('0x16')]({'plain':!![]});var _0xaeee25=_0xbdf8('0x17');return db['UserProfileSection'][_0xbdf8('0x3c')]({'where':{'name':_0xaeee25,'userProfileId':_0xeca4b1[_0xbdf8('0x3d')]},'raw':!![]})[_0xbdf8('0x15')](function(_0x14df8b){if(_0x14df8b&&_0x14df8b[_0xbdf8('0x3e')]===0x0){return db[_0xbdf8('0x18')][_0xbdf8('0x3f')]({'name':_0x9b6253[_0xbdf8('0x1e')],'resourceId':_0x9b6253['id'],'type':_0x14df8b[_0xbdf8('0x1e')],'sectionId':_0x14df8b['id']},{})[_0xbdf8('0x15')](function(){return _0x4bc92a;});}else{return _0x4bc92a;}})[_0xbdf8('0x39')](function(_0x1206e3){logger[_0xbdf8('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1206e3);throw _0x1206e3;});}return _0x4bc92a;})[_0xbdf8('0x15')](respondWithResult(_0x19560f,0xc9))[_0xbdf8('0x39')](handleError(_0x19560f,null));};exports[_0xbdf8('0x13')]=function(_0x494d19,_0x55bf68){if(_0x494d19[_0xbdf8('0x40')]['id']){delete _0x494d19[_0xbdf8('0x40')]['id'];}return db[_0xbdf8('0x34')][_0xbdf8('0x3c')]({'where':{'id':_0x494d19[_0xbdf8('0x41')]['id']}})[_0xbdf8('0x15')](handleEntityNotFound(_0x55bf68,null))[_0xbdf8('0x15')](saveUpdates(_0x494d19[_0xbdf8('0x40')],null))[_0xbdf8('0x15')](function(_0x166809){if(!_0x166809)return;var _0x24c064=_0x166809[_0xbdf8('0x16')]({'plain':!![]});return _0x24c064;})[_0xbdf8('0x15')](function(_0x5e06b2){var _0x325439=new Redis(config['redis']);_0x325439[_0xbdf8('0x42')](_0xbdf8('0x19'),JSON[_0xbdf8('0x1a')](_[_0xbdf8('0x2f')](_0x5e06b2,['id','name',_0xbdf8('0x43')])));return _0x5e06b2;})[_0xbdf8('0x15')](respondWithResult(_0x55bf68,null))[_0xbdf8('0x39')](handleError(_0x55bf68,null));};exports[_0xbdf8('0x14')]=function(_0xff5e19,_0x580c7a){return db['SquareProject'][_0xbdf8('0x3c')]({'where':{'id':_0xff5e19[_0xbdf8('0x41')]['id']}})[_0xbdf8('0x15')](handleEntityNotFound(_0x580c7a,null))[_0xbdf8('0x15')](removeEntity(_0x580c7a,null))[_0xbdf8('0x39')](handleError(_0x580c7a,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 5eeb8d7..1e95893 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 _0xe745=['emit','hasOwnProperty','hook','events','../../mysqldb','SquareProject','save','update','remove'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0xe745,0x93));var _0x5e74=function(_0x2b7951,_0x3ad12c){_0x2b7951=_0x2b7951-0x0;var _0x208337=_0xe745[_0x2b7951];return _0x208337;};'use strict';var EventEmitter=require(_0x5e74('0x0'));var SquareProject=require(_0x5e74('0x1'))['db'][_0x5e74('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5e74('0x3'),'afterUpdate':_0x5e74('0x4'),'afterDestroy':_0x5e74('0x5')};function emitEvent(_0xacdc11){return function(_0xcdf0e,_0x4eb59e,_0x5cbe2a){SquareProjectEvents[_0x5e74('0x6')](_0xacdc11+':'+_0xcdf0e['id'],_0xcdf0e);SquareProjectEvents[_0x5e74('0x6')](_0xacdc11,_0xcdf0e);_0x5cbe2a(null);};}for(var e in events){if(events[_0x5e74('0x7')](e)){var event=events[e];SquareProject[_0x5e74('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +var _0x780e=['hook','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x13c1aa,_0x56fa69){var _0x1c6974=function(_0x2264bb){while(--_0x2264bb){_0x13c1aa['push'](_0x13c1aa['shift']());}};_0x1c6974(++_0x56fa69);}(_0x780e,0xb7));var _0xe780=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x780e[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xe780('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe780('0x1'),'afterUpdate':_0xe780('0x2'),'afterDestroy':_0xe780('0x3')};function emitEvent(_0x5e15ad){return function(_0x23120e,_0x2f9c99,_0x1b58d2){SquareProjectEvents[_0xe780('0x4')](_0x5e15ad+':'+_0x23120e['id'],_0x23120e);SquareProjectEvents[_0xe780('0x4')](_0x5e15ad,_0x23120e);_0x1b58d2(null);};}for(var e in events){if(events[_0xe780('0x5')](e)){var event=events[e];SquareProject[_0xe780('0x6')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 7a07bdc..65ced49 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 _0xc17c=['request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format','lodash','util','../../config/logger','bluebird'];(function(_0x2dc171,_0x1dadb7){var _0x1373b1=function(_0x4935a9){while(--_0x4935a9){_0x2dc171['push'](_0x2dc171['shift']());}};_0x1373b1(++_0x1dadb7);}(_0xc17c,0x8c));var _0xcc17=function(_0x12bebf,_0xc9d433){_0x12bebf=_0x12bebf-0x0;var _0x19e77a=_0xc17c[_0x12bebf];return _0x19e77a;};'use strict';var _=require(_0xcc17('0x0'));var util=require(_0xcc17('0x1'));var logger=require(_0xcc17('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcc17('0x3'));var rp=require(_0xcc17('0x4'));var fs=require('fs');var path=require(_0xcc17('0x5'));var rimraf=require(_0xcc17('0x6'));var config=require(_0xcc17('0x7'));var attributes=require('./squareProject.attributes');module[_0xcc17('0x8')]=function(_0x5cb235,_0x1e1c74){return _0x5cb235[_0xcc17('0x9')](_0xcc17('0xa'),attributes,{'tableName':_0xcc17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5be3c8,_0xa4d768,_0x4b516e){if(_0x5be3c8[_0xcc17('0xc')](_0xcc17('0xd'))){_0x5be3c8[_0xcc17('0xe')]=moment()['format'](_0xcc17('0xf'));}if(_0x5be3c8[_0xcc17('0xc')]('production')){_0x5be3c8[_0xcc17('0x10')]=moment()[_0xcc17('0x11')](_0xcc17('0xf'));}_0x4b516e(null,_0x5be3c8);}}});}; \ No newline at end of file +var _0x6e03=['savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction'];(function(_0x206ca8,_0x34739a){var _0x508d10=function(_0x3a27a7){while(--_0x3a27a7){_0x206ca8['push'](_0x206ca8['shift']());}};_0x508d10(++_0x34739a);}(_0x6e03,0x98));var _0x36e0=function(_0x10e722,_0x297a74){_0x10e722=_0x10e722-0x0;var _0x39243a=_0x6e03[_0x10e722];return _0x39243a;};'use strict';var _=require(_0x36e0('0x0'));var util=require(_0x36e0('0x1'));var logger=require(_0x36e0('0x2'))(_0x36e0('0x3'));var moment=require(_0x36e0('0x4'));var BPromise=require(_0x36e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36e0('0x6'));var rimraf=require(_0x36e0('0x7'));var config=require(_0x36e0('0x8'));var attributes=require(_0x36e0('0x9'));module[_0x36e0('0xa')]=function(_0x2c5525,_0x128d4a){return _0x2c5525[_0x36e0('0xb')](_0x36e0('0xc'),attributes,{'tableName':_0x36e0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d16be,_0x2aee78,_0x5e30e3){if(_0x4d16be[_0x36e0('0xe')](_0x36e0('0xf'))){_0x4d16be[_0x36e0('0x10')]=moment()['format'](_0x36e0('0x11'));}if(_0x4d16be[_0x36e0('0xe')](_0x36e0('0x12'))){_0x4d16be[_0x36e0('0x13')]=moment()[_0x36e0('0x14')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5e30e3(null,_0x4d16be);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1256b9c..93e365e 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 _0x1583=['where','lodash','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','attributes','limit','include','map','model','then','info','debug','stringify','catch','message','error','ShowSquareProject','raw'];(function(_0x52bb1e,_0x47c818){var _0x15d57d=function(_0x551cd3){while(--_0x551cd3){_0x52bb1e['push'](_0x52bb1e['shift']());}};_0x15d57d(++_0x47c818);}(_0x1583,0x119));var _0x3158=function(_0x16daf2,_0x2353a9){_0x16daf2=_0x16daf2-0x0;var _0x48a0f1=_0x1583[_0x16daf2];return _0x48a0f1;};'use strict';var _=require(_0x3158('0x0'));var Redis=require('ioredis');var db=require(_0x3158('0x1'))['db'];var logger=require(_0x3158('0x2'))(_0x3158('0x3'));var config=require(_0x3158('0x4'));config['redis']=_['defaults'](config[_0x3158('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x3158('0x6'))(new Redis(config[_0x3158('0x5')]));require(_0x3158('0x7'))[_0x3158('0x8')](socket);exports[_0x3158('0x9')]=function(_0x32a383){var _0x1ad66c=this;return new Promise(function(_0x2e07d4,_0x57b0c1){return db[_0x3158('0xa')][_0x3158('0xb')]({'raw':_0x32a383['options']?_0x32a383[_0x3158('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x32a383[_0x3158('0xc')]?_0x32a383[_0x3158('0xc')]['where']||null:null,'attributes':_0x32a383[_0x3158('0xc')]?_0x32a383['options'][_0x3158('0xd')]||null:null,'limit':_0x32a383[_0x3158('0xc')]?_0x32a383[_0x3158('0xc')][_0x3158('0xe')]||null:null,'include':_0x32a383[_0x3158('0xc')]?_0x32a383[_0x3158('0xc')][_0x3158('0xf')]?_[_0x3158('0x10')](_0x32a383['options'][_0x3158('0xf')],function(_0x9a29a8){return{'model':db[_0x9a29a8['model']],'as':_0x9a29a8['as'],'attributes':_0x9a29a8[_0x3158('0xd')],'include':_0x9a29a8[_0x3158('0xf')]?_[_0x3158('0x10')](_0x9a29a8[_0x3158('0xf')],function(_0x1592f6){return{'model':db[_0x1592f6['model']],'as':_0x1592f6['as'],'attributes':_0x1592f6['attributes'],'include':_0x1592f6[_0x3158('0xf')]?_[_0x3158('0x10')](_0x1592f6['include'],function(_0x189220){return{'model':db[_0x189220[_0x3158('0x11')]],'as':_0x189220['as'],'attributes':_0x189220[_0x3158('0xd')]};}):[]};}):[]};}):[]:[]})[_0x3158('0x12')](function(_0x1a66c6){logger[_0x3158('0x13')]('GetSquareProjects',_0x32a383);logger[_0x3158('0x14')](_0x3158('0x9'),_0x32a383,JSON[_0x3158('0x15')](_0x1a66c6));_0x2e07d4(_0x1a66c6);})[_0x3158('0x16')](function(_0xb99df8){logger['error'](_0x3158('0x9'),_0xb99df8[_0x3158('0x17')],_0x32a383);_0x57b0c1(_0x1ad66c[_0x3158('0x18')](0x1f4,_0xb99df8[_0x3158('0x17')]));});});};exports[_0x3158('0x19')]=function(_0x5be6ca){var _0x19c2ad=this;return new Promise(function(_0x164ea4,_0x544e87){return db[_0x3158('0xa')]['find']({'raw':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca[_0x3158('0xc')][_0x3158('0x1a')]===undefined?!![]:![]:!![],'where':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca['options'][_0x3158('0x1b')]||null:null,'attributes':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca[_0x3158('0xc')][_0x3158('0xd')]||null:null,'include':_0x5be6ca[_0x3158('0xc')]?_0x5be6ca[_0x3158('0xc')][_0x3158('0xf')]?_[_0x3158('0x10')](_0x5be6ca['options'][_0x3158('0xf')],function(_0x11b3db){return{'model':db[_0x11b3db[_0x3158('0x11')]],'as':_0x11b3db['as'],'attributes':_0x11b3db[_0x3158('0xd')],'include':_0x11b3db['include']?_[_0x3158('0x10')](_0x11b3db['include'],function(_0x3d1241){return{'model':db[_0x3d1241[_0x3158('0x11')]],'as':_0x3d1241['as'],'attributes':_0x3d1241['attributes'],'include':_0x3d1241['include']?_[_0x3158('0x10')](_0x3d1241[_0x3158('0xf')],function(_0x16fd14){return{'model':db[_0x16fd14[_0x3158('0x11')]],'as':_0x16fd14['as'],'attributes':_0x16fd14['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b0ccf){logger['info']('ShowSquareProject',_0x5be6ca);logger[_0x3158('0x14')](_0x3158('0x19'),_0x5be6ca,JSON[_0x3158('0x15')](_0x2b0ccf));_0x164ea4(_0x2b0ccf);})[_0x3158('0x16')](function(_0x284781){logger[_0x3158('0x18')](_0x3158('0x19'),_0x284781['message'],_0x5be6ca);_0x544e87(_0x19c2ad[_0x3158('0x18')](0x1f4,_0x284781[_0x3158('0x17')]));});});}; \ No newline at end of file +var _0xbde2=['ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll','raw','options','attributes','include','map','model','then','info','stringify','error','message','ShowSquareProject','SquareProject','find','where','debug','lodash'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xbde2,0xa7));var _0x2bde=function(_0x4524dc,_0x4c1a2c){_0x4524dc=_0x4524dc-0x0;var _0x952d7d=_0xbde2[_0x4524dc];return _0x952d7d;};'use strict';var _=require(_0x2bde('0x0'));var Redis=require(_0x2bde('0x1'));var db=require(_0x2bde('0x2'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0x2bde('0x3'));config[_0x2bde('0x4')]=_[_0x2bde('0x5')](config[_0x2bde('0x4')],{'host':_0x2bde('0x6'),'port':0x18eb});var socket=require(_0x2bde('0x7'))(new Redis(config['redis']));require(_0x2bde('0x8'))[_0x2bde('0x9')](socket);exports[_0x2bde('0xa')]=function(_0x54d7da){var _0x3a8ccd=this;return new Promise(function(_0x319993,_0x7b4b11){return db['SquareProject'][_0x2bde('0xb')]({'raw':_0x54d7da['options']?_0x54d7da['options'][_0x2bde('0xc')]===undefined?!![]:![]:!![],'where':_0x54d7da['options']?_0x54d7da[_0x2bde('0xd')]['where']||null:null,'attributes':_0x54d7da[_0x2bde('0xd')]?_0x54d7da['options'][_0x2bde('0xe')]||null:null,'limit':_0x54d7da[_0x2bde('0xd')]?_0x54d7da['options']['limit']||null:null,'include':_0x54d7da[_0x2bde('0xd')]?_0x54d7da[_0x2bde('0xd')][_0x2bde('0xf')]?_[_0x2bde('0x10')](_0x54d7da[_0x2bde('0xd')][_0x2bde('0xf')],function(_0x47df39){return{'model':db[_0x47df39[_0x2bde('0x11')]],'as':_0x47df39['as'],'attributes':_0x47df39[_0x2bde('0xe')],'include':_0x47df39[_0x2bde('0xf')]?_[_0x2bde('0x10')](_0x47df39[_0x2bde('0xf')],function(_0x2fa4c5){return{'model':db[_0x2fa4c5[_0x2bde('0x11')]],'as':_0x2fa4c5['as'],'attributes':_0x2fa4c5[_0x2bde('0xe')],'include':_0x2fa4c5[_0x2bde('0xf')]?_[_0x2bde('0x10')](_0x2fa4c5[_0x2bde('0xf')],function(_0x3e3f4a){return{'model':db[_0x3e3f4a[_0x2bde('0x11')]],'as':_0x3e3f4a['as'],'attributes':_0x3e3f4a['attributes']};}):[]};}):[]};}):[]:[]})[_0x2bde('0x12')](function(_0x2e5fe5){logger[_0x2bde('0x13')]('GetSquareProjects',_0x54d7da);logger['debug'](_0x2bde('0xa'),_0x54d7da,JSON[_0x2bde('0x14')](_0x2e5fe5));_0x319993(_0x2e5fe5);})['catch'](function(_0x4ed9c0){logger[_0x2bde('0x15')]('GetSquareProjects',_0x4ed9c0[_0x2bde('0x16')],_0x54d7da);_0x7b4b11(_0x3a8ccd['error'](0x1f4,_0x4ed9c0[_0x2bde('0x16')]));});});};exports[_0x2bde('0x17')]=function(_0x221b24){var _0xc4db49=this;return new Promise(function(_0x3533bd,_0x21e793){return db[_0x2bde('0x18')][_0x2bde('0x19')]({'raw':_0x221b24['options']?_0x221b24[_0x2bde('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x221b24[_0x2bde('0xd')]?_0x221b24[_0x2bde('0xd')][_0x2bde('0x1a')]||null:null,'attributes':_0x221b24[_0x2bde('0xd')]?_0x221b24[_0x2bde('0xd')]['attributes']||null:null,'include':_0x221b24[_0x2bde('0xd')]?_0x221b24[_0x2bde('0xd')][_0x2bde('0xf')]?_[_0x2bde('0x10')](_0x221b24['options'][_0x2bde('0xf')],function(_0x16612d){return{'model':db[_0x16612d[_0x2bde('0x11')]],'as':_0x16612d['as'],'attributes':_0x16612d['attributes'],'include':_0x16612d['include']?_[_0x2bde('0x10')](_0x16612d['include'],function(_0x3d8060){return{'model':db[_0x3d8060[_0x2bde('0x11')]],'as':_0x3d8060['as'],'attributes':_0x3d8060[_0x2bde('0xe')],'include':_0x3d8060['include']?_[_0x2bde('0x10')](_0x3d8060[_0x2bde('0xf')],function(_0x4e47ef){return{'model':db[_0x4e47ef[_0x2bde('0x11')]],'as':_0x4e47ef['as'],'attributes':_0x4e47ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x2bde('0x12')](function(_0x4d9d42){logger['info']('ShowSquareProject',_0x221b24);logger[_0x2bde('0x1b')](_0x2bde('0x17'),_0x221b24,JSON[_0x2bde('0x14')](_0x4d9d42));_0x3533bd(_0x4d9d42);})['catch'](function(_0x4d2ceb){logger[_0x2bde('0x15')]('ShowSquareProject',_0x4d2ceb[_0x2bde('0x16')],_0x221b24);_0x21e793(_0xc4db49[_0x2bde('0x15')](0x1f4,_0x4d2ceb[_0x2bde('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 31c0acb..fd91059 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 _0x4341=['squareProject:','./squareProject.events','remove','update','emit','register','length'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x4341,0xa9));var _0x1434=function(_0x2f41dd,_0x5bd3a1){_0x2f41dd=_0x2f41dd-0x0;var _0x3b377d=_0x4341[_0x2f41dd];return _0x3b377d;};'use strict';var SquareProjectEvents=require(_0x1434('0x0'));var events=['save',_0x1434('0x1'),_0x1434('0x2')];function createListener(_0x50e76c,_0x152aee){return function(_0x5c9623){_0x152aee[_0x1434('0x3')](_0x50e76c,_0x5c9623);};}function removeListener(_0x510a61,_0x22ece4){return function(){SquareProjectEvents['removeListener'](_0x510a61,_0x22ece4);};}exports[_0x1434('0x4')]=function(_0x541321){for(var _0x5a21f7=0x0,_0x10a581=events[_0x1434('0x5')];_0x5a21f7<_0x10a581;_0x5a21f7++){var _0x60f32=events[_0x5a21f7];var _0x38e2e7=createListener(_0x1434('0x6')+_0x60f32,_0x541321);SquareProjectEvents['on'](_0x60f32,_0x38e2e7);}}; \ No newline at end of file +var _0x3b7a=['squareProject:','./squareProject.events','remove','update','emit','removeListener','register','length'];(function(_0x30d73b,_0x88d9a3){var _0x4e72d1=function(_0x160631){while(--_0x160631){_0x30d73b['push'](_0x30d73b['shift']());}};_0x4e72d1(++_0x88d9a3);}(_0x3b7a,0x1b1));var _0xa3b7=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3b7a[_0x17d9e3];return _0x14192d;};'use strict';var SquareProjectEvents=require(_0xa3b7('0x0'));var events=['save',_0xa3b7('0x1'),_0xa3b7('0x2')];function createListener(_0x50adfb,_0x3cfed5){return function(_0x423556){_0x3cfed5[_0xa3b7('0x3')](_0x50adfb,_0x423556);};}function removeListener(_0x3447d9,_0x189e1f){return function(){SquareProjectEvents[_0xa3b7('0x4')](_0x3447d9,_0x189e1f);};}exports[_0xa3b7('0x5')]=function(_0x39ba27){for(var _0x1fe18c=0x0,_0x18843b=events[_0xa3b7('0x6')];_0x1fe18c<_0x18843b;_0x1fe18c++){var _0x28c02d=events[_0x1fe18c];var _0x1f4422=createListener(_0xa3b7('0x7')+_0x28c02d,_0x39ba27);SquareProjectEvents['on'](_0x28c02d,_0x1f4422);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 4fcc3f3..bd83a73 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x522cb5,_0x6d9217){var _0xae2366=function(_0x3ab795){while(--_0x3ab795){_0x522cb5['push'](_0x522cb5['shift']());}};_0xae2366(++_0x6d9217);}(_0x53ec,0x192));var _0xc53e=function(_0x51046e,_0x46e77d){_0x51046e=_0x51046e-0x0;var _0x694f90=_0x53ec[_0x51046e];return _0x694f90;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x5511f2,_0x90ec21){var _0x2f2727=function(_0x2befe3){while(--_0x2befe3){_0x5511f2['push'](_0x5511f2['shift']());}};_0x2f2727(++_0x90ec21);}(_0x814b,0x1a2));var _0xb814=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x814b[_0x1cb18a];return _0x22442e;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 2c61c7e..89cca41 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 _0x1cb9=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x4cba43,_0x284c64){var _0x4e8617=function(_0x25e560){while(--_0x25e560){_0x4cba43['push'](_0x4cba43['shift']());}};_0x4e8617(++_0x284c64);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21884b,_0x541a02){_0x21884b=_0x21884b-0x0;var _0x56554d=_0x1cb9[_0x21884b];return _0x56554d;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x91cb('0x1')]},'callerid':{'type':Sequelize[_0x91cb('0x1')]},'calleridname':{'type':Sequelize[_0x91cb('0x1')]},'context':{'type':Sequelize[_0x91cb('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x91cb('0x1')]},'accountcode':{'type':Sequelize[_0x91cb('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x91cb('0x1')]},'saveName':{'type':Sequelize[_0x91cb('0x1')]},'filename':{'type':Sequelize[_0x91cb('0x1')]},'savePath':{'type':Sequelize[_0x91cb('0x1')]},'format':{'type':Sequelize[_0x91cb('0x2')],'get':function(){var _0x8f8a3b='';var _0x4c1f56=this[_0x91cb('0x3')]('savePath');if(_0x4c1f56){_0x8f8a3b=_0x4c1f56[_0x91cb('0x4')](_0x4c1f56['lastIndexOf']('.'));}return _0x8f8a3b;}}}; \ No newline at end of file +var _0xa630=['substring','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa630,0xbe));var _0x0a63=function(_0x212887,_0x310a3b){_0x212887=_0x212887-0x0;var _0x17e91e=_0xa630[_0x212887];return _0x17e91e;};'use strict';var Sequelize=require(_0x0a63('0x0'));module[_0x0a63('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0a63('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0a63('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0a63('0x2')]},'dnid':{'type':Sequelize[_0x0a63('0x2')]},'projectName':{'type':Sequelize[_0x0a63('0x2')]},'saveName':{'type':Sequelize[_0x0a63('0x2')]},'filename':{'type':Sequelize[_0x0a63('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x0a63('0x3')],'get':function(){var _0x3d5f0b='';var _0xc2dcd7=this[_0x0a63('0x4')](_0x0a63('0x5'));if(_0xc2dcd7){_0x3d5f0b=_0xc2dcd7[_0x0a63('0x6')](_0xc2dcd7['lastIndexOf']('.'));}return _0x3d5f0b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index aee9bd9..189b081 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 _0x7ea8=['../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','status','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SquareRecording','findAll','rows','catch','intersection','includeAll','include','find','create','body','params'];(function(_0x3634d8,_0xbfa70b){var _0x2c1369=function(_0x27b79a){while(--_0x27b79a){_0x3634d8['push'](_0x3634d8['shift']());}};_0x2c1369(++_0xbfa70b);}(_0x7ea8,0x1b4));var _0x87ea=function(_0xb8d96e,_0x15fb2c){_0xb8d96e=_0xb8d96e-0x0;var _0x212092=_0x7ea8[_0xb8d96e];return _0x212092;};'use strict';var emlformat=require(_0x87ea('0x0'));var rimraf=require(_0x87ea('0x1'));var zipdir=require(_0x87ea('0x2'));var jsonpatch=require(_0x87ea('0x3'));var rp=require(_0x87ea('0x4'));var moment=require(_0x87ea('0x5'));var BPromise=require(_0x87ea('0x6'));var Mustache=require(_0x87ea('0x7'));var util=require(_0x87ea('0x8'));var path=require(_0x87ea('0x9'));var sox=require(_0x87ea('0xa'));var csv=require(_0x87ea('0xb'));var ejs=require(_0x87ea('0xc'));var fs=require('fs');var fs_extra=require(_0x87ea('0xd'));var _=require(_0x87ea('0xe'));var squel=require(_0x87ea('0xf'));var crypto=require(_0x87ea('0x10'));var jsforce=require(_0x87ea('0x11'));var deskjs=require(_0x87ea('0x12'));var toCsv=require('to-csv');var querystring=require(_0x87ea('0x13'));var Papa=require(_0x87ea('0x14'));var Redis=require('ioredis');var authService=require(_0x87ea('0x15'));var qs=require(_0x87ea('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x87ea('0x17'))(_0x87ea('0x18'));var utils=require(_0x87ea('0x19'));var config=require(_0x87ea('0x1a'));var licenseUtil=require(_0x87ea('0x1b'));var db=require(_0x87ea('0x1c'))['db'];function respondWithStatusCode(_0x5076cc,_0x408bc3){_0x408bc3=_0x408bc3||0xcc;return function(_0x3ccb51){if(_0x3ccb51){return _0x5076cc[_0x87ea('0x1d')](_0x408bc3);}return _0x5076cc['status'](_0x408bc3)[_0x87ea('0x1e')]();};}function respondWithResult(_0x36f77e,_0x567d6d){_0x567d6d=_0x567d6d||0xc8;return function(_0x12a29f){if(_0x12a29f){return _0x36f77e['status'](_0x567d6d)['json'](_0x12a29f);}};}function respondWithFilteredResult(_0x17a404,_0x5afa21){return function(_0x1983c7){if(_0x1983c7){var _0x3e917f=typeof _0x5afa21[_0x87ea('0x1f')]===_0x87ea('0x20')&&typeof _0x5afa21[_0x87ea('0x21')]===_0x87ea('0x20');var _0x343607=_0x1983c7['count'];var _0x5b75b8=_0x3e917f?0x0:_0x5afa21[_0x87ea('0x1f')];var _0x5d16fc=_0x3e917f?_0x1983c7[_0x87ea('0x22')]:_0x5afa21[_0x87ea('0x1f')]+_0x5afa21[_0x87ea('0x21')];var _0x5cf60f;if(_0x5d16fc>=_0x343607){_0x5d16fc=_0x343607;_0x5cf60f=0xc8;}else{_0x5cf60f=0xce;}_0x17a404['status'](_0x5cf60f);return _0x17a404[_0x87ea('0x23')](_0x87ea('0x24'),_0x5b75b8+'-'+_0x5d16fc+'/'+_0x343607)[_0x87ea('0x25')](_0x1983c7);}return null;};}function patchUpdates(_0x366ecd){return function(_0x1811aa){try{jsonpatch[_0x87ea('0x26')](_0x1811aa,_0x366ecd,!![]);}catch(_0x5d1b54){return BPromise[_0x87ea('0x27')](_0x5d1b54);}return _0x1811aa[_0x87ea('0x28')]();};}function saveUpdates(_0x5f3c81,_0x4c0728){return function(_0x68f29f){if(_0x68f29f){return _0x68f29f[_0x87ea('0x29')](_0x5f3c81)['then'](function(_0x591408){return _0x591408;});}return null;};}function removeEntity(_0x5edbef,_0x26b3b0){return function(_0x560703){if(_0x560703){return _0x560703[_0x87ea('0x2a')]()[_0x87ea('0x2b')](function(){_0x5edbef[_0x87ea('0x2c')](0xcc)[_0x87ea('0x1e')]();});}};}function handleEntityNotFound(_0x805f9d,_0x2726d7){return function(_0x1c9dd5){if(!_0x1c9dd5){_0x805f9d[_0x87ea('0x1d')](0x194);}return _0x1c9dd5;};}function handleError(_0x406aee,_0x4e7127){_0x4e7127=_0x4e7127||0x1f4;return function(_0xbfef64){logger['error'](_0xbfef64['stack']);if(_0xbfef64[_0x87ea('0x2d')]){delete _0xbfef64[_0x87ea('0x2d')];}_0x406aee['status'](_0x4e7127)[_0x87ea('0x2e')](_0xbfef64);};}exports['index']=function(_0x3070c6,_0xe41521){var _0x4fa753={},_0x4375aa={},_0x38145e={'count':0x0,'rows':[]};var _0x4bbee2=_['map'](db['SquareRecording'][_0x87ea('0x2f')],function(_0x5840f0){return{'name':_0x5840f0[_0x87ea('0x30')],'type':_0x5840f0[_0x87ea('0x31')][_0x87ea('0x32')]};});_0x4375aa[_0x87ea('0x33')]=_[_0x87ea('0x34')](_0x4bbee2,_0x87ea('0x2d'));_0x4375aa[_0x87ea('0x35')]=_[_0x87ea('0x36')](_0x3070c6[_0x87ea('0x35')]);_0x4375aa[_0x87ea('0x37')]=_['intersection'](_0x4375aa[_0x87ea('0x33')],_0x4375aa[_0x87ea('0x35')]);_0x4fa753[_0x87ea('0x38')]=_['intersection'](_0x4375aa[_0x87ea('0x33')],qs['fields'](_0x3070c6[_0x87ea('0x35')][_0x87ea('0x39')]));_0x4fa753[_0x87ea('0x38')]=_0x4fa753[_0x87ea('0x38')][_0x87ea('0x3a')]?_0x4fa753[_0x87ea('0x38')]:_0x4375aa[_0x87ea('0x33')];if(!_0x3070c6[_0x87ea('0x35')][_0x87ea('0x3b')](_0x87ea('0x3c'))){_0x4fa753[_0x87ea('0x21')]=qs[_0x87ea('0x21')](_0x3070c6['query'][_0x87ea('0x21')]);_0x4fa753[_0x87ea('0x1f')]=qs[_0x87ea('0x1f')](_0x3070c6[_0x87ea('0x35')][_0x87ea('0x1f')]);}_0x4fa753[_0x87ea('0x3d')]=qs[_0x87ea('0x3e')](_0x3070c6[_0x87ea('0x35')]['sort']);_0x4fa753[_0x87ea('0x3f')]=qs[_0x87ea('0x37')](_[_0x87ea('0x40')](_0x3070c6[_0x87ea('0x35')],_0x4375aa[_0x87ea('0x37')]),_0x4bbee2);if(_0x3070c6[_0x87ea('0x35')][_0x87ea('0x41')]){_0x4fa753[_0x87ea('0x3f')]=_[_0x87ea('0x42')](_0x4fa753[_0x87ea('0x3f')],{'$or':_[_0x87ea('0x34')](_0x4bbee2,function(_0x535f4d){if(_0x535f4d[_0x87ea('0x31')]!=='VIRTUAL'){var _0x5c3f7e={};_0x5c3f7e[_0x535f4d['name']]={'$like':'%'+_0x3070c6[_0x87ea('0x35')]['filter']+'%'};return _0x5c3f7e;}})});}_0x4fa753=_[_0x87ea('0x42')]({},_0x4fa753,_0x3070c6[_0x87ea('0x43')]);var _0x318f24={'where':_0x4fa753[_0x87ea('0x3f')]};return db[_0x87ea('0x44')]['count'](_0x318f24)['then'](function(_0x27d5a4){_0x38145e[_0x87ea('0x22')]=_0x27d5a4;if(_0x3070c6[_0x87ea('0x35')]['includeAll']){_0x4fa753['include']=[{'all':!![]}];}return db[_0x87ea('0x44')][_0x87ea('0x45')](_0x4fa753);})['then'](function(_0x6e5684){_0x38145e[_0x87ea('0x46')]=_0x6e5684;return _0x38145e;})['then'](respondWithFilteredResult(_0xe41521,_0x4fa753))[_0x87ea('0x47')](handleError(_0xe41521,null));};exports['show']=function(_0x33c912,_0x1f8a1c){var _0x24e999={'raw':!![],'where':{'id':_0x33c912['params']['id']}},_0xb07b57={};_0xb07b57[_0x87ea('0x33')]=_['keys'](db['SquareRecording'][_0x87ea('0x2f')]);_0xb07b57['query']=_[_0x87ea('0x36')](_0x33c912[_0x87ea('0x35')]);_0xb07b57[_0x87ea('0x37')]=_['intersection'](_0xb07b57[_0x87ea('0x33')],_0xb07b57[_0x87ea('0x35')]);_0x24e999[_0x87ea('0x38')]=_[_0x87ea('0x48')](_0xb07b57[_0x87ea('0x33')],qs['fields'](_0x33c912[_0x87ea('0x35')][_0x87ea('0x39')]));_0x24e999['attributes']=_0x24e999[_0x87ea('0x38')][_0x87ea('0x3a')]?_0x24e999[_0x87ea('0x38')]:_0xb07b57[_0x87ea('0x33')];if(_0x33c912[_0x87ea('0x35')][_0x87ea('0x49')]){_0x24e999[_0x87ea('0x4a')]=[{'all':!![]}];}_0x24e999=_[_0x87ea('0x42')]({},_0x24e999,_0x33c912[_0x87ea('0x43')]);return db[_0x87ea('0x44')][_0x87ea('0x4b')](_0x24e999)[_0x87ea('0x2b')](handleEntityNotFound(_0x1f8a1c,null))[_0x87ea('0x2b')](respondWithResult(_0x1f8a1c,null))['catch'](handleError(_0x1f8a1c,null));};exports[_0x87ea('0x4c')]=function(_0x480937,_0x619e74){return db['SquareRecording'][_0x87ea('0x4c')](_0x480937[_0x87ea('0x4d')],{})[_0x87ea('0x2b')](respondWithResult(_0x619e74,0xc9))[_0x87ea('0x47')](handleError(_0x619e74,null));};exports[_0x87ea('0x29')]=function(_0x5c6a4b,_0xd34164){if(_0x5c6a4b[_0x87ea('0x4d')]['id']){delete _0x5c6a4b[_0x87ea('0x4d')]['id'];}return db[_0x87ea('0x44')][_0x87ea('0x4b')]({'where':{'id':_0x5c6a4b[_0x87ea('0x4e')]['id']}})[_0x87ea('0x2b')](handleEntityNotFound(_0xd34164,null))[_0x87ea('0x2b')](saveUpdates(_0x5c6a4b[_0x87ea('0x4d')],null))[_0x87ea('0x2b')](respondWithResult(_0xd34164,null))[_0x87ea('0x47')](handleError(_0xd34164,null));};exports['download']=function(_0x4a7b77,_0x5b5c54,_0x3f56e9){var _0x562886=require(_0x87ea('0x4f'));var _0x4fec87=![];var _0x22be12={};if(_0x4a7b77[_0x87ea('0x35')][_0x87ea('0x31')]&&_0x4a7b77[_0x87ea('0x35')][_0x87ea('0x31')]===_0x87ea('0x50')){_0x22be12['uniqueid']=_0x4a7b77[_0x87ea('0x4e')]['id'];}else{_0x22be12['id']=_0x4a7b77[_0x87ea('0x4e')]['id'];}return db[_0x87ea('0x44')]['find']({'where':_0x22be12,'attributes':['id',_0x87ea('0x51'),'filename'],'raw':!![]})[_0x87ea('0x2b')](handleEntityNotFound(_0x5b5c54,null))[_0x87ea('0x2b')](function(_0x5ddb1f){if(_0x5ddb1f){var _0x1b837c=_0x5ddb1f[_0x87ea('0x51')];var _0xff629e=util[_0x87ea('0x52')](_0x87ea('0x53'),_0x1b837c);if(fs[_0x87ea('0x54')](_0xff629e)){_0x4fec87=!![];return _0x562886[_0x87ea('0x55')](_0xff629e,_0x1b837c,config['secrets'][_0x87ea('0x56')])[_0x87ea('0x2b')](function(){return _0x5ddb1f;});}return _0x5ddb1f;}})['then'](function(_0x43a272){if(_0x43a272){var _0x335c3a=_0x43a272['savePath'];if(!fs['existsSync'](_0x335c3a)){throw new db[(_0x87ea('0x57'))][(_0x87ea('0x58'))](_0x87ea('0x59'));}if(_0x43a272[_0x87ea('0x5a')]){return _0x5b5c54[_0x87ea('0x5b')](_0x335c3a,_0x43a272['filename']+path[_0x87ea('0x5c')](_0x335c3a),function(){if(_0x4fec87){fs[_0x87ea('0x5d')](_0x335c3a);}});}else{return _0x5b5c54[_0x87ea('0x5b')](_0x335c3a,function(_0x25eec4){if(_0x4fec87){fs['unlink'](_0x335c3a);}});}}})['catch'](function(_0x324c79){if(_0x324c79['message']===_0x87ea('0x59')){_0x5b5c54[_0x87ea('0x2c')](0x194)[_0x87ea('0x2e')](_0x87ea('0x5e'));}else{return handleError(_0x5b5c54,null);}});};exports[_0x87ea('0x2a')]=function(_0xbc02a6,_0x192e56){return db[_0x87ea('0x44')][_0x87ea('0x4b')]({'where':{'id':_0xbc02a6[_0x87ea('0x4e')]['id']}})[_0x87ea('0x2b')](function(_0x816f0d){if(_[_0x87ea('0x5f')](_0x816f0d)){throw new ReferenceError(_0x87ea('0x60'));}return _0x816f0d;})['then'](function(_0x4ee1f0){var _0x330654=_0x4ee1f0[_0x87ea('0x51')];logger[_0x87ea('0x61')](_0x87ea('0x62'),_0x330654);if(!_[_0x87ea('0x5f')](_0x4ee1f0[_0x87ea('0x51')])&&fs[_0x87ea('0x54')](_0x330654)){logger['info'](_0x87ea('0x63')+_0x330654+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x87ea('0x64')](_0x330654);}_0x330654=_0x330654+_0x87ea('0x65');if(!_[_0x87ea('0x5f')](_0x4ee1f0[_0x87ea('0x51')])&&fs['existsSync'](_0x330654)){logger[_0x87ea('0x61')](_0x87ea('0x63')+_0x330654+_0x87ea('0x66'));fs[_0x87ea('0x64')](_0x330654);}return _0x4ee1f0;})[_0x87ea('0x2b')](function(_0x3557b8){if(!_0x3557b8)throw new InternalError();return _0x3557b8[_0x87ea('0x2a')]();})['then'](function(){_0x192e56[_0x87ea('0x2c')](0xcc)[_0x87ea('0x1e')]();})[_0x87ea('0x47')](handleError(_0x192e56,null));}; \ No newline at end of file +var _0xfea5=['order','sort','where','VIRTUAL','filter','options','SquareRecording','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','update','body','download','../../components/encryptor','uniqueid','params','savePath','filename','format','existsSync','decryptFile','secrets','recording','Sequelize','extname','unlink','message','SquareRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','unlinkSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfea5,0x8d));var _0x5fea=function(_0x5141a2,_0x3d81e5){_0x5141a2=_0x5141a2-0x0;var _0x9d6b28=_0xfea5[_0x5141a2];return _0x9d6b28;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5fea('0x0'));var jsonpatch=require(_0x5fea('0x1'));var rp=require(_0x5fea('0x2'));var moment=require('moment');var BPromise=require(_0x5fea('0x3'));var Mustache=require('mustache');var util=require(_0x5fea('0x4'));var path=require(_0x5fea('0x5'));var sox=require(_0x5fea('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5fea('0x7'));var _=require(_0x5fea('0x8'));var squel=require(_0x5fea('0x9'));var crypto=require(_0x5fea('0xa'));var jsforce=require(_0x5fea('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5fea('0xc'));var querystring=require(_0x5fea('0xd'));var Papa=require(_0x5fea('0xe'));var Redis=require(_0x5fea('0xf'));var authService=require(_0x5fea('0x10'));var qs=require(_0x5fea('0x11'));var as=require(_0x5fea('0x12'));var hardwareService=require(_0x5fea('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x5fea('0x14'));var config=require(_0x5fea('0x15'));var licenseUtil=require(_0x5fea('0x16'));var db=require(_0x5fea('0x17'))['db'];function respondWithStatusCode(_0xb43291,_0x183eac){_0x183eac=_0x183eac||0xcc;return function(_0x5dd2bf){if(_0x5dd2bf){return _0xb43291['sendStatus'](_0x183eac);}return _0xb43291['status'](_0x183eac)[_0x5fea('0x18')]();};}function respondWithResult(_0x3a9c92,_0x28d09c){_0x28d09c=_0x28d09c||0xc8;return function(_0x132c9b){if(_0x132c9b){return _0x3a9c92['status'](_0x28d09c)[_0x5fea('0x19')](_0x132c9b);}};}function respondWithFilteredResult(_0x3f31c5,_0xdb0372){return function(_0x565497){if(_0x565497){var _0x3cc130=typeof _0xdb0372[_0x5fea('0x1a')]==='undefined'&&typeof _0xdb0372[_0x5fea('0x1b')]===_0x5fea('0x1c');var _0x4db19f=_0x565497[_0x5fea('0x1d')];var _0x10d90d=_0x3cc130?0x0:_0xdb0372[_0x5fea('0x1a')];var _0x4723b2=_0x3cc130?_0x565497[_0x5fea('0x1d')]:_0xdb0372[_0x5fea('0x1a')]+_0xdb0372[_0x5fea('0x1b')];var _0xb26577;if(_0x4723b2>=_0x4db19f){_0x4723b2=_0x4db19f;_0xb26577=0xc8;}else{_0xb26577=0xce;}_0x3f31c5[_0x5fea('0x1e')](_0xb26577);return _0x3f31c5[_0x5fea('0x1f')](_0x5fea('0x20'),_0x10d90d+'-'+_0x4723b2+'/'+_0x4db19f)[_0x5fea('0x19')](_0x565497);}return null;};}function patchUpdates(_0x148e03){return function(_0x13dc09){try{jsonpatch[_0x5fea('0x21')](_0x13dc09,_0x148e03,!![]);}catch(_0x5089ca){return BPromise[_0x5fea('0x22')](_0x5089ca);}return _0x13dc09[_0x5fea('0x23')]();};}function saveUpdates(_0x4780ea,_0x2576ec){return function(_0x548778){if(_0x548778){return _0x548778['update'](_0x4780ea)['then'](function(_0x1866de){return _0x1866de;});}return null;};}function removeEntity(_0x22a6dc,_0x4a9f3f){return function(_0x379896){if(_0x379896){return _0x379896[_0x5fea('0x24')]()[_0x5fea('0x25')](function(){_0x22a6dc['status'](0xcc)[_0x5fea('0x18')]();});}};}function handleEntityNotFound(_0x462bec,_0xa0f361){return function(_0x337825){if(!_0x337825){_0x462bec[_0x5fea('0x26')](0x194);}return _0x337825;};}function handleError(_0x962ada,_0x3e52af){_0x3e52af=_0x3e52af||0x1f4;return function(_0x402f60){logger[_0x5fea('0x27')](_0x402f60[_0x5fea('0x28')]);if(_0x402f60['name']){delete _0x402f60[_0x5fea('0x29')];}_0x962ada[_0x5fea('0x1e')](_0x3e52af)[_0x5fea('0x2a')](_0x402f60);};}exports[_0x5fea('0x2b')]=function(_0xce60b4,_0x2fc7f5){var _0x30c07e={},_0x3840ea={},_0x3be256={'count':0x0,'rows':[]};var _0x21973f=_[_0x5fea('0x2c')](db['SquareRecording']['rawAttributes'],function(_0x1aa69b){return{'name':_0x1aa69b[_0x5fea('0x2d')],'type':_0x1aa69b[_0x5fea('0x2e')]['key']};});_0x3840ea[_0x5fea('0x2f')]=_[_0x5fea('0x2c')](_0x21973f,_0x5fea('0x29'));_0x3840ea['query']=_[_0x5fea('0x30')](_0xce60b4[_0x5fea('0x31')]);_0x3840ea[_0x5fea('0x32')]=_[_0x5fea('0x33')](_0x3840ea[_0x5fea('0x2f')],_0x3840ea[_0x5fea('0x31')]);_0x30c07e[_0x5fea('0x34')]=_['intersection'](_0x3840ea[_0x5fea('0x2f')],qs[_0x5fea('0x35')](_0xce60b4[_0x5fea('0x31')][_0x5fea('0x35')]));_0x30c07e['attributes']=_0x30c07e['attributes'][_0x5fea('0x36')]?_0x30c07e['attributes']:_0x3840ea[_0x5fea('0x2f')];if(!_0xce60b4['query'][_0x5fea('0x37')](_0x5fea('0x38'))){_0x30c07e[_0x5fea('0x1b')]=qs['limit'](_0xce60b4[_0x5fea('0x31')][_0x5fea('0x1b')]);_0x30c07e[_0x5fea('0x1a')]=qs['offset'](_0xce60b4['query'][_0x5fea('0x1a')]);}_0x30c07e[_0x5fea('0x39')]=qs[_0x5fea('0x3a')](_0xce60b4[_0x5fea('0x31')][_0x5fea('0x3a')]);_0x30c07e[_0x5fea('0x3b')]=qs[_0x5fea('0x32')](_['pick'](_0xce60b4[_0x5fea('0x31')],_0x3840ea[_0x5fea('0x32')]),_0x21973f);if(_0xce60b4[_0x5fea('0x31')]['filter']){_0x30c07e[_0x5fea('0x3b')]=_['merge'](_0x30c07e[_0x5fea('0x3b')],{'$or':_[_0x5fea('0x2c')](_0x21973f,function(_0x507760){if(_0x507760[_0x5fea('0x2e')]!==_0x5fea('0x3c')){var _0x6cf766={};_0x6cf766[_0x507760[_0x5fea('0x29')]]={'$like':'%'+_0xce60b4[_0x5fea('0x31')][_0x5fea('0x3d')]+'%'};return _0x6cf766;}})});}_0x30c07e=_['merge']({},_0x30c07e,_0xce60b4[_0x5fea('0x3e')]);var _0x52c1fa={'where':_0x30c07e[_0x5fea('0x3b')]};return db[_0x5fea('0x3f')][_0x5fea('0x1d')](_0x52c1fa)[_0x5fea('0x25')](function(_0x40374b){_0x3be256[_0x5fea('0x1d')]=_0x40374b;if(_0xce60b4[_0x5fea('0x31')][_0x5fea('0x40')]){_0x30c07e[_0x5fea('0x41')]=[{'all':!![]}];}return db[_0x5fea('0x3f')][_0x5fea('0x42')](_0x30c07e);})[_0x5fea('0x25')](function(_0x4024cd){_0x3be256[_0x5fea('0x43')]=_0x4024cd;return _0x3be256;})[_0x5fea('0x25')](respondWithFilteredResult(_0x2fc7f5,_0x30c07e))[_0x5fea('0x44')](handleError(_0x2fc7f5,null));};exports[_0x5fea('0x45')]=function(_0x51377a,_0x1ea7d2){var _0x5b91ee={'raw':!![],'where':{'id':_0x51377a['params']['id']}},_0xe0039f={};_0xe0039f[_0x5fea('0x2f')]=_[_0x5fea('0x30')](db[_0x5fea('0x3f')][_0x5fea('0x46')]);_0xe0039f[_0x5fea('0x31')]=_[_0x5fea('0x30')](_0x51377a[_0x5fea('0x31')]);_0xe0039f[_0x5fea('0x32')]=_[_0x5fea('0x33')](_0xe0039f[_0x5fea('0x2f')],_0xe0039f['query']);_0x5b91ee['attributes']=_['intersection'](_0xe0039f[_0x5fea('0x2f')],qs[_0x5fea('0x35')](_0x51377a[_0x5fea('0x31')]['fields']));_0x5b91ee[_0x5fea('0x34')]=_0x5b91ee['attributes'][_0x5fea('0x36')]?_0x5b91ee[_0x5fea('0x34')]:_0xe0039f[_0x5fea('0x2f')];if(_0x51377a[_0x5fea('0x31')][_0x5fea('0x40')]){_0x5b91ee[_0x5fea('0x41')]=[{'all':!![]}];}_0x5b91ee=_['merge']({},_0x5b91ee,_0x51377a[_0x5fea('0x3e')]);return db[_0x5fea('0x3f')][_0x5fea('0x47')](_0x5b91ee)[_0x5fea('0x25')](handleEntityNotFound(_0x1ea7d2,null))[_0x5fea('0x25')](respondWithResult(_0x1ea7d2,null))['catch'](handleError(_0x1ea7d2,null));};exports['create']=function(_0x3ab8aa,_0x3d741a){return db[_0x5fea('0x3f')][_0x5fea('0x48')](_0x3ab8aa['body'],{})['then'](respondWithResult(_0x3d741a,0xc9))[_0x5fea('0x44')](handleError(_0x3d741a,null));};exports[_0x5fea('0x49')]=function(_0x5b4917,_0x126b50){if(_0x5b4917['body']['id']){delete _0x5b4917[_0x5fea('0x4a')]['id'];}return db[_0x5fea('0x3f')][_0x5fea('0x47')]({'where':{'id':_0x5b4917['params']['id']}})[_0x5fea('0x25')](handleEntityNotFound(_0x126b50,null))[_0x5fea('0x25')](saveUpdates(_0x5b4917[_0x5fea('0x4a')],null))[_0x5fea('0x25')](respondWithResult(_0x126b50,null))[_0x5fea('0x44')](handleError(_0x126b50,null));};exports[_0x5fea('0x4b')]=function(_0x22eac7,_0x589616,_0xccbc43){var _0x550f65=require(_0x5fea('0x4c'));var _0x3796bd=![];var _0xc75414={};if(_0x22eac7['query']['type']&&_0x22eac7['query'][_0x5fea('0x2e')]==='uniqueid'){_0xc75414[_0x5fea('0x4d')]=_0x22eac7[_0x5fea('0x4e')]['id'];}else{_0xc75414['id']=_0x22eac7['params']['id'];}return db['SquareRecording'][_0x5fea('0x47')]({'where':_0xc75414,'attributes':['id',_0x5fea('0x4f'),_0x5fea('0x50')],'raw':!![]})[_0x5fea('0x25')](handleEntityNotFound(_0x589616,null))[_0x5fea('0x25')](function(_0x5f23f7){if(_0x5f23f7){var _0xb4d96e=_0x5f23f7[_0x5fea('0x4f')];var _0x4fa088=util[_0x5fea('0x51')]('%s.cypher',_0xb4d96e);if(fs[_0x5fea('0x52')](_0x4fa088)){_0x3796bd=!![];return _0x550f65[_0x5fea('0x53')](_0x4fa088,_0xb4d96e,config[_0x5fea('0x54')][_0x5fea('0x55')])[_0x5fea('0x25')](function(){return _0x5f23f7;});}return _0x5f23f7;}})[_0x5fea('0x25')](function(_0x2d5b74){if(_0x2d5b74){var _0x5da802=_0x2d5b74[_0x5fea('0x4f')];if(!fs[_0x5fea('0x52')](_0x5da802)){throw new db[(_0x5fea('0x56'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x2d5b74[_0x5fea('0x50')]){return _0x589616[_0x5fea('0x4b')](_0x5da802,_0x2d5b74['filename']+path[_0x5fea('0x57')](_0x5da802),function(){if(_0x3796bd){fs['unlink'](_0x5da802);}});}else{return _0x589616[_0x5fea('0x4b')](_0x5da802,function(_0x5a3bcd){if(_0x3796bd){fs[_0x5fea('0x58')](_0x5da802);}});}}})[_0x5fea('0x44')](function(_0x3f9c6e){if(_0x3f9c6e[_0x5fea('0x59')]===_0x5fea('0x5a')){_0x589616['status'](0x194)[_0x5fea('0x2a')](_0x5fea('0x5b'));}else{return handleError(_0x589616,null);}});};exports[_0x5fea('0x24')]=function(_0x2930d6,_0x20acb7){return db[_0x5fea('0x3f')][_0x5fea('0x47')]({'where':{'id':_0x2930d6[_0x5fea('0x4e')]['id']}})[_0x5fea('0x25')](function(_0x2e3499){if(_['isNil'](_0x2e3499)){throw new ReferenceError(_0x5fea('0x5c'));}return _0x2e3499;})[_0x5fea('0x25')](function(_0x59b830){var _0x2a1775=_0x59b830[_0x5fea('0x4f')];logger[_0x5fea('0x5d')](_0x5fea('0x5e'),_0x2a1775);if(!_[_0x5fea('0x5f')](_0x59b830[_0x5fea('0x4f')])&&fs['existsSync'](_0x2a1775)){logger[_0x5fea('0x5d')]('File:\x20\x22'+_0x2a1775+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x5fea('0x60')](_0x2a1775);}_0x2a1775=_0x2a1775+'.cypher';if(!_[_0x5fea('0x5f')](_0x59b830[_0x5fea('0x4f')])&&fs[_0x5fea('0x52')](_0x2a1775)){logger[_0x5fea('0x5d')](_0x5fea('0x61')+_0x2a1775+_0x5fea('0x62'));fs[_0x5fea('0x60')](_0x2a1775);}return _0x59b830;})['then'](function(_0x48f333){if(!_0x48f333)throw new InternalError();return _0x48f333[_0x5fea('0x24')]();})[_0x5fea('0x25')](function(){_0x20acb7[_0x5fea('0x1e')](0xcc)[_0x5fea('0x18')]();})['catch'](handleError(_0x20acb7,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index eee6e62..cc3bdb9 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 _0xf1c6=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xf1c6,0xf4));var _0x6f1c=function(_0x26bb1d,_0x4142b9){_0x26bb1d=_0x26bb1d-0x0;var _0x2ed9fb=_0xf1c6[_0x26bb1d];return _0x2ed9fb;};'use strict';var _=require(_0x6f1c('0x0'));var util=require(_0x6f1c('0x1'));var logger=require(_0x6f1c('0x2'))(_0x6f1c('0x3'));var moment=require(_0x6f1c('0x4'));var BPromise=require(_0x6f1c('0x5'));var rp=require(_0x6f1c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6f1c('0x7'));var config=require(_0x6f1c('0x8'));var attributes=require(_0x6f1c('0x9'));module[_0x6f1c('0xa')]=function(_0x4fd3fc,_0x57bb67){return _0x4fd3fc[_0x6f1c('0xb')](_0x6f1c('0xc'),attributes,{'tableName':_0x6f1c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5078=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x5078,0x148));var _0x8507=function(_0x5e8bfa,_0x1e83d1){_0x5e8bfa=_0x5e8bfa-0x0;var _0x10b312=_0x5078[_0x5e8bfa];return _0x10b312;};'use strict';var _=require(_0x8507('0x0'));var util=require(_0x8507('0x1'));var logger=require(_0x8507('0x2'))(_0x8507('0x3'));var moment=require(_0x8507('0x4'));var BPromise=require(_0x8507('0x5'));var rp=require(_0x8507('0x6'));var fs=require('fs');var path=require(_0x8507('0x7'));var rimraf=require(_0x8507('0x8'));var config=require(_0x8507('0x9'));var attributes=require(_0x8507('0xa'));module[_0x8507('0xb')]=function(_0x37519c,_0x5a359c){return _0x37519c[_0x8507('0xc')](_0x8507('0xd'),attributes,{'tableName':'square_recordings','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 bde75df..667f2ff 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 _0xc51e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','CreateSquareRecording','SquareRecording','create','options','catch','lodash','util','moment','bluebird'];(function(_0x4cdf21,_0x2dd601){var _0x13f529=function(_0x167ebc){while(--_0x167ebc){_0x4cdf21['push'](_0x4cdf21['shift']());}};_0x13f529(++_0x2dd601);}(_0xc51e,0x98));var _0xec51=function(_0x218947,_0x22c2a0){_0x218947=_0x218947-0x0;var _0x25c3bd=_0xc51e[_0x218947];return _0x25c3bd;};'use strict';var _=require(_0xec51('0x0'));var util=require(_0xec51('0x1'));var moment=require(_0xec51('0x2'));var BPromise=require(_0xec51('0x3'));var rs=require(_0xec51('0x4'));var fs=require('fs');var Redis=require(_0xec51('0x5'));var db=require(_0xec51('0x6'))['db'];var utils=require(_0xec51('0x7'));var logger=require(_0xec51('0x8'))(_0xec51('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec51('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ba73d,_0x233a44,_0x5031b8){return new BPromise(function(_0x298cd1,_0x27f410){return client[_0xec51('0xb')](_0x3ba73d,_0x5031b8)[_0xec51('0xc')](function(_0x1e6efc){logger[_0xec51('0xd')](_0xec51('0xe'),_0x233a44,_0xec51('0xf'));logger[_0xec51('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x233a44,_0xec51('0xf'),JSON[_0xec51('0x11')](_0x1e6efc));if(_0x1e6efc[_0xec51('0x12')]){if(_0x1e6efc[_0xec51('0x12')]['code']===0x1f4){logger[_0xec51('0x12')](_0xec51('0xe'),_0x233a44,_0x1e6efc['error']['message']);return _0x27f410(_0x1e6efc[_0xec51('0x12')][_0xec51('0x13')]);}logger[_0xec51('0x12')](_0xec51('0xe'),_0x233a44,_0x1e6efc['error'][_0xec51('0x13')]);return _0x298cd1(_0x1e6efc[_0xec51('0x12')]['message']);}else{logger['info'](_0xec51('0xe'),_0x233a44,_0xec51('0xf'));_0x298cd1(_0x1e6efc[_0xec51('0x14')][_0xec51('0x13')]);}})['catch'](function(_0x445953){logger[_0xec51('0x12')]('SquareRecording,\x20%s,\x20%s',_0x233a44,_0x445953);_0x27f410(_0x445953);});});}exports[_0xec51('0x15')]=function(_0xbf0976){var _0x357057=this;return new Promise(function(_0x441f2e,_0x371956){return db[_0xec51('0x16')][_0xec51('0x17')](_0xbf0976['body'],{'raw':_0xbf0976[_0xec51('0x18')]?_0xbf0976['options']['raw']===undefined?!![]:![]:!![]})[_0xec51('0xc')](function(_0xa3d162){logger[_0xec51('0xd')](_0xec51('0x15'),_0xbf0976);logger['debug'](_0xec51('0x15'),_0xbf0976,JSON['stringify'](_0xa3d162));_0x441f2e(_0xa3d162);})[_0xec51('0x19')](function(_0x17cc84){logger[_0xec51('0x12')](_0xec51('0x15'),_0x17cc84['message'],_0xbf0976);_0x371956(_0x357057['error'](0x1f4,_0x17cc84[_0xec51('0x13')]));});});}; \ No newline at end of file +var _0xef19=['options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','body'];(function(_0x2cf8be,_0x53cbc9){var _0x861a04=function(_0x15623b){while(--_0x15623b){_0x2cf8be['push'](_0x2cf8be['shift']());}};_0x861a04(++_0x53cbc9);}(_0xef19,0xb9));var _0x9ef1=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xef19[_0x43b584];return _0x48f27b;};'use strict';var _=require(_0x9ef1('0x0'));var util=require('util');var moment=require(_0x9ef1('0x1'));var BPromise=require(_0x9ef1('0x2'));var rs=require(_0x9ef1('0x3'));var fs=require('fs');var Redis=require(_0x9ef1('0x4'));var db=require(_0x9ef1('0x5'))['db'];var utils=require(_0x9ef1('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ef1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x456601,_0x1dcfd8,_0x3ea5c2){return new BPromise(function(_0x2ad394,_0x155872){return client[_0x9ef1('0x8')](_0x456601,_0x3ea5c2)[_0x9ef1('0x9')](function(_0xf1fe94){logger['info']('SquareRecording,\x20%s,\x20%s',_0x1dcfd8,_0x9ef1('0xa'));logger[_0x9ef1('0xb')](_0x9ef1('0xc'),_0x1dcfd8,_0x9ef1('0xa'),JSON['stringify'](_0xf1fe94));if(_0xf1fe94['error']){if(_0xf1fe94[_0x9ef1('0xd')][_0x9ef1('0xe')]===0x1f4){logger['error'](_0x9ef1('0xf'),_0x1dcfd8,_0xf1fe94[_0x9ef1('0xd')]['message']);return _0x155872(_0xf1fe94[_0x9ef1('0xd')][_0x9ef1('0x10')]);}logger['error'](_0x9ef1('0xf'),_0x1dcfd8,_0xf1fe94[_0x9ef1('0xd')][_0x9ef1('0x10')]);return _0x2ad394(_0xf1fe94[_0x9ef1('0xd')][_0x9ef1('0x10')]);}else{logger['info'](_0x9ef1('0xf'),_0x1dcfd8,_0x9ef1('0xa'));_0x2ad394(_0xf1fe94[_0x9ef1('0x11')]['message']);}})[_0x9ef1('0x12')](function(_0x192c1f){logger[_0x9ef1('0xd')]('SquareRecording,\x20%s,\x20%s',_0x1dcfd8,_0x192c1f);_0x155872(_0x192c1f);});});}exports[_0x9ef1('0x13')]=function(_0x218119){var _0x45bff2=this;return new Promise(function(_0xb45df9,_0x7e17bd){return db[_0x9ef1('0x14')][_0x9ef1('0x15')](_0x218119[_0x9ef1('0x16')],{'raw':_0x218119[_0x9ef1('0x17')]?_0x218119[_0x9ef1('0x17')][_0x9ef1('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x30edf8){logger['info'](_0x9ef1('0x13'),_0x218119);logger[_0x9ef1('0xb')](_0x9ef1('0x13'),_0x218119,JSON[_0x9ef1('0x19')](_0x30edf8));_0xb45df9(_0x30edf8);})[_0x9ef1('0x12')](function(_0x2da98e){logger[_0x9ef1('0xd')](_0x9ef1('0x13'),_0x2da98e[_0x9ef1('0x10')],_0x218119);_0x7e17bd(_0x45bff2[_0x9ef1('0xd')](0x1f4,_0x2da98e[_0x9ef1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 5e6523d..c72923a 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(_0x68d0a4,_0x40aae7){var _0x1dfd49=function(_0x39c1f9){while(--_0x39c1f9){_0x68d0a4['push'](_0x68d0a4['shift']());}};_0x1dfd49(++_0x40aae7);}(_0xe706,0xa3));var _0x6e70=function(_0x2a3653,_0x2b5804){_0x2a3653=_0x2a3653-0x0;var _0x2d9e61=_0xe706[_0x2a3653];return _0x2d9e61;};'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 _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(_0x86f71f,_0x461c14){var _0x247124=function(_0x2b662a){while(--_0x2b662a){_0x86f71f['push'](_0x86f71f['shift']());}};_0x247124(++_0x461c14);}(_0xe706,0xa3));var _0x6e70=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0xe706[_0x30c7c5];return _0x29e24e;};'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 diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index efb035c..95a2f6b 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 _0x2ca4=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2ca4,0x13b));var _0x42ca=function(_0xfaaad,_0x4c46e6){_0xfaaad=_0xfaaad-0x0;var _0x59136e=_0x2ca4[_0xfaaad];return _0x59136e;};'use strict';var Sequelize=require(_0x42ca('0x0'));module['exports']={'network':{'type':Sequelize[_0x42ca('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x42ca('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x42ca('0x1')]},'type':{'type':Sequelize[_0x42ca('0x1')]},'uniqueid':{'type':Sequelize[_0x42ca('0x1')]},'version':{'type':Sequelize[_0x42ca('0x1')]},'callerid':{'type':Sequelize[_0x42ca('0x1')]},'calleridname':{'type':Sequelize[_0x42ca('0x1')]},'callingpres':{'type':Sequelize[_0x42ca('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x42ca('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x42ca('0x1')]},'rdnis':{'type':Sequelize[_0x42ca('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x42ca('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x42ca('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x42ca('0x2')]},'bot':{'type':Sequelize[_0x42ca('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xaa23=['BOOLEAN','exports','STRING','DATE'];(function(_0x497ee9,_0x287e96){var _0x4783b5=function(_0x29b632){while(--_0x29b632){_0x497ee9['push'](_0x497ee9['shift']());}};_0x4783b5(++_0x287e96);}(_0xaa23,0x1a9));var _0x3aa2=function(_0x495054,_0x304104){_0x495054=_0x495054-0x0;var _0x146d2e=_0xaa23[_0x495054];return _0x146d2e;};'use strict';var Sequelize=require('sequelize');module[_0x3aa2('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x3aa2('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x3aa2('0x1')]},'type':{'type':Sequelize[_0x3aa2('0x1')]},'uniqueid':{'type':Sequelize[_0x3aa2('0x1')]},'version':{'type':Sequelize[_0x3aa2('0x1')]},'callerid':{'type':Sequelize[_0x3aa2('0x1')]},'calleridname':{'type':Sequelize[_0x3aa2('0x1')]},'callingpres':{'type':Sequelize[_0x3aa2('0x1')]},'callingani2':{'type':Sequelize[_0x3aa2('0x1')]},'callington':{'type':Sequelize[_0x3aa2('0x1')]},'callingtns':{'type':Sequelize[_0x3aa2('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3aa2('0x1')]},'extension':{'type':Sequelize[_0x3aa2('0x1')]},'priority':{'type':Sequelize[_0x3aa2('0x1')]},'enhanced':{'type':Sequelize[_0x3aa2('0x1')]},'accountcode':{'type':Sequelize[_0x3aa2('0x1')]},'threadid':{'type':Sequelize[_0x3aa2('0x1')]},'project_name':{'type':Sequelize[_0x3aa2('0x1')]},'joinAt':{'type':Sequelize[_0x3aa2('0x2')]},'leaveAt':{'type':Sequelize[_0x3aa2('0x2')]},'bot':{'type':Sequelize[_0x3aa2('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 8639447..872bc58 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 _0x9a15=['SquareReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','include','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','json','apply','save','update','then','destroy','stack','name','send','map'];(function(_0x3fe8f7,_0x37af44){var _0x250281=function(_0x58fdb8){while(--_0x58fdb8){_0x3fe8f7['push'](_0x3fe8f7['shift']());}};_0x250281(++_0x37af44);}(_0x9a15,0x1db));var _0x59a1=function(_0x5f4eff,_0x54d601){_0x5f4eff=_0x5f4eff-0x0;var _0x3446ef=_0x9a15[_0x5f4eff];return _0x3446ef;};'use strict';var emlformat=require(_0x59a1('0x0'));var rimraf=require(_0x59a1('0x1'));var zipdir=require(_0x59a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x59a1('0x3'));var moment=require('moment');var BPromise=require(_0x59a1('0x4'));var Mustache=require(_0x59a1('0x5'));var util=require('util');var path=require(_0x59a1('0x6'));var sox=require('sox');var csv=require(_0x59a1('0x7'));var ejs=require(_0x59a1('0x8'));var fs=require('fs');var fs_extra=require(_0x59a1('0x9'));var _=require(_0x59a1('0xa'));var squel=require(_0x59a1('0xb'));var crypto=require(_0x59a1('0xc'));var jsforce=require(_0x59a1('0xd'));var deskjs=require(_0x59a1('0xe'));var toCsv=require(_0x59a1('0x7'));var querystring=require(_0x59a1('0xf'));var Papa=require(_0x59a1('0x10'));var Redis=require(_0x59a1('0x11'));var authService=require(_0x59a1('0x12'));var qs=require(_0x59a1('0x13'));var as=require(_0x59a1('0x14'));var hardwareService=require(_0x59a1('0x15'));var logger=require('../../config/logger')(_0x59a1('0x16'));var utils=require(_0x59a1('0x17'));var config=require(_0x59a1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x59a1('0x19'))['db'];function respondWithStatusCode(_0xab8d7b,_0xfe55c3){_0xfe55c3=_0xfe55c3||0xcc;return function(_0x3c5f92){if(_0x3c5f92){return _0xab8d7b[_0x59a1('0x1a')](_0xfe55c3);}return _0xab8d7b[_0x59a1('0x1b')](_0xfe55c3)['end']();};}function respondWithResult(_0x3711ba,_0x599f57){_0x599f57=_0x599f57||0xc8;return function(_0x3f9e60){if(_0x3f9e60){return _0x3711ba[_0x59a1('0x1b')](_0x599f57)['json'](_0x3f9e60);}};}function respondWithFilteredResult(_0x4c244d,_0x5943e7){return function(_0x3f4b39){if(_0x3f4b39){var _0x2d4f9e=typeof _0x5943e7['offset']==='undefined'&&typeof _0x5943e7[_0x59a1('0x1c')]===_0x59a1('0x1d');var _0x1a89c9=_0x3f4b39[_0x59a1('0x1e')];var _0x4360c0=_0x2d4f9e?0x0:_0x5943e7['offset'];var _0x4daa69=_0x2d4f9e?_0x3f4b39[_0x59a1('0x1e')]:_0x5943e7[_0x59a1('0x1f')]+_0x5943e7[_0x59a1('0x1c')];var _0x310322;if(_0x4daa69>=_0x1a89c9){_0x4daa69=_0x1a89c9;_0x310322=0xc8;}else{_0x310322=0xce;}_0x4c244d[_0x59a1('0x1b')](_0x310322);return _0x4c244d[_0x59a1('0x20')]('Content-Range',_0x4360c0+'-'+_0x4daa69+'/'+_0x1a89c9)[_0x59a1('0x21')](_0x3f4b39);}return null;};}function patchUpdates(_0xfcd8bd){return function(_0x5d485a){try{jsonpatch[_0x59a1('0x22')](_0x5d485a,_0xfcd8bd,!![]);}catch(_0x185a39){return BPromise['reject'](_0x185a39);}return _0x5d485a[_0x59a1('0x23')]();};}function saveUpdates(_0x1aa035,_0x1e7c65){return function(_0x5e68b0){if(_0x5e68b0){return _0x5e68b0[_0x59a1('0x24')](_0x1aa035)[_0x59a1('0x25')](function(_0x8ca88a){return _0x8ca88a;});}return null;};}function removeEntity(_0x3d2d15,_0x1945b1){return function(_0x30b6aa){if(_0x30b6aa){return _0x30b6aa[_0x59a1('0x26')]()[_0x59a1('0x25')](function(){_0x3d2d15[_0x59a1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e0e14,_0xd8daba){return function(_0x28fc48){if(!_0x28fc48){_0x1e0e14[_0x59a1('0x1a')](0x194);}return _0x28fc48;};}function handleError(_0xb64b02,_0x473ba3){_0x473ba3=_0x473ba3||0x1f4;return function(_0x5cd1f0){logger['error'](_0x5cd1f0[_0x59a1('0x27')]);if(_0x5cd1f0[_0x59a1('0x28')]){delete _0x5cd1f0[_0x59a1('0x28')];}_0xb64b02[_0x59a1('0x1b')](_0x473ba3)[_0x59a1('0x29')](_0x5cd1f0);};}exports['index']=function(_0x12e75f,_0x274dd1){var _0x397f2f={},_0x5cf2a4={},_0x22a974={'count':0x0,'rows':[]};var _0x18689b=_[_0x59a1('0x2a')](db[_0x59a1('0x2b')][_0x59a1('0x2c')],function(_0x253da0){return{'name':_0x253da0['fieldName'],'type':_0x253da0['type'][_0x59a1('0x2d')]};});_0x5cf2a4[_0x59a1('0x2e')]=_[_0x59a1('0x2a')](_0x18689b,_0x59a1('0x28'));_0x5cf2a4[_0x59a1('0x2f')]=_[_0x59a1('0x30')](_0x12e75f['query']);_0x5cf2a4[_0x59a1('0x31')]=_[_0x59a1('0x32')](_0x5cf2a4[_0x59a1('0x2e')],_0x5cf2a4['query']);_0x397f2f['attributes']=_[_0x59a1('0x32')](_0x5cf2a4[_0x59a1('0x2e')],qs[_0x59a1('0x33')](_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x33')]));_0x397f2f['attributes']=_0x397f2f[_0x59a1('0x34')][_0x59a1('0x35')]?_0x397f2f[_0x59a1('0x34')]:_0x5cf2a4['model'];if(!_0x12e75f[_0x59a1('0x2f')]['hasOwnProperty'](_0x59a1('0x36'))){_0x397f2f[_0x59a1('0x1c')]=qs['limit'](_0x12e75f[_0x59a1('0x2f')]['limit']);_0x397f2f[_0x59a1('0x1f')]=qs[_0x59a1('0x1f')](_0x12e75f['query'][_0x59a1('0x1f')]);}_0x397f2f[_0x59a1('0x37')]=qs['sort'](_0x12e75f[_0x59a1('0x2f')]['sort']);_0x397f2f['where']=qs['filters'](_[_0x59a1('0x38')](_0x12e75f[_0x59a1('0x2f')],_0x5cf2a4[_0x59a1('0x31')]),_0x18689b);if(_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x39')]){_0x397f2f[_0x59a1('0x3a')]=_[_0x59a1('0x3b')](_0x397f2f[_0x59a1('0x3a')],{'$or':_[_0x59a1('0x2a')](_0x18689b,function(_0x1f1c4e){if(_0x1f1c4e[_0x59a1('0x3c')]!==_0x59a1('0x3d')){var _0x143c91={};_0x143c91[_0x1f1c4e[_0x59a1('0x28')]]={'$like':'%'+_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x39')]+'%'};return _0x143c91;}})});}_0x397f2f=_[_0x59a1('0x3b')]({},_0x397f2f,_0x12e75f['options']);var _0xfe4c27={'where':_0x397f2f[_0x59a1('0x3a')]};return db['SquareReport']['count'](_0xfe4c27)[_0x59a1('0x25')](function(_0x127e40){_0x22a974['count']=_0x127e40;if(_0x12e75f[_0x59a1('0x2f')][_0x59a1('0x3e')]){_0x397f2f['include']=[{'all':!![]}];}return db[_0x59a1('0x2b')][_0x59a1('0x3f')](_0x397f2f);})[_0x59a1('0x25')](function(_0x68d6c6){_0x22a974[_0x59a1('0x40')]=_0x68d6c6;return _0x22a974;})[_0x59a1('0x25')](respondWithFilteredResult(_0x274dd1,_0x397f2f))[_0x59a1('0x41')](handleError(_0x274dd1,null));};exports[_0x59a1('0x42')]=function(_0xbc2eef,_0x412b2e){var _0x1a671c={'raw':!![],'where':{'id':_0xbc2eef['params']['id']}},_0x1eaf2b={};_0x1eaf2b['model']=_[_0x59a1('0x30')](db[_0x59a1('0x2b')]['rawAttributes']);_0x1eaf2b[_0x59a1('0x2f')]=_['keys'](_0xbc2eef[_0x59a1('0x2f')]);_0x1eaf2b[_0x59a1('0x31')]=_[_0x59a1('0x32')](_0x1eaf2b[_0x59a1('0x2e')],_0x1eaf2b[_0x59a1('0x2f')]);_0x1a671c[_0x59a1('0x34')]=_[_0x59a1('0x32')](_0x1eaf2b['model'],qs[_0x59a1('0x33')](_0xbc2eef[_0x59a1('0x2f')]['fields']));_0x1a671c['attributes']=_0x1a671c[_0x59a1('0x34')][_0x59a1('0x35')]?_0x1a671c[_0x59a1('0x34')]:_0x1eaf2b[_0x59a1('0x2e')];if(_0xbc2eef[_0x59a1('0x2f')][_0x59a1('0x3e')]){_0x1a671c[_0x59a1('0x43')]=[{'all':!![]}];}_0x1a671c=_[_0x59a1('0x3b')]({},_0x1a671c,_0xbc2eef[_0x59a1('0x44')]);return db[_0x59a1('0x2b')][_0x59a1('0x45')](_0x1a671c)[_0x59a1('0x25')](handleEntityNotFound(_0x412b2e,null))[_0x59a1('0x25')](respondWithResult(_0x412b2e,null))[_0x59a1('0x41')](handleError(_0x412b2e,null));};exports[_0x59a1('0x46')]=function(_0x22421f,_0x204733){return db[_0x59a1('0x2b')]['create'](_0x22421f['body'],{})[_0x59a1('0x25')](respondWithResult(_0x204733,0xc9))[_0x59a1('0x41')](handleError(_0x204733,null));};exports[_0x59a1('0x24')]=function(_0x3e4e02,_0x54275b){if(_0x3e4e02[_0x59a1('0x47')]['id']){delete _0x3e4e02[_0x59a1('0x47')]['id'];}return db[_0x59a1('0x2b')][_0x59a1('0x45')]({'where':{'id':_0x3e4e02[_0x59a1('0x48')]['id']}})[_0x59a1('0x25')](handleEntityNotFound(_0x54275b,null))[_0x59a1('0x25')](saveUpdates(_0x3e4e02[_0x59a1('0x47')],null))['then'](respondWithResult(_0x54275b,null))['catch'](handleError(_0x54275b,null));};exports[_0x59a1('0x26')]=function(_0x247458,_0x391282){return db[_0x59a1('0x2b')][_0x59a1('0x45')]({'where':{'id':_0x247458[_0x59a1('0x48')]['id']}})[_0x59a1('0x25')](handleEntityNotFound(_0x391282,null))[_0x59a1('0x25')](removeEntity(_0x391282,null))[_0x59a1('0x41')](handleError(_0x391282,null));};exports[_0x59a1('0x49')]=function(_0x19d9af,_0x16c2e8){return db[_0x59a1('0x2b')][_0x59a1('0x49')]()[_0x59a1('0x25')](respondWithResult(_0x16c2e8,null))[_0x59a1('0x41')](handleError(_0x16c2e8,null));}; \ No newline at end of file +var _0x1941=['offset','undefined','limit','count','Content-Range','reject','update','name','send','index','map','SquareReport','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','type','options','includeAll','findAll','then','rows','include','catch','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x1fb1ad,_0x3a5c57){var _0x62f4ab=function(_0x2f1ee4){while(--_0x2f1ee4){_0x1fb1ad['push'](_0x1fb1ad['shift']());}};_0x62f4ab(++_0x3a5c57);}(_0x1941,0xfb));var _0x1194=function(_0x284852,_0xd3b275){_0x284852=_0x284852-0x0;var _0x3a54b9=_0x1941[_0x284852];return _0x3a54b9;};'use strict';var emlformat=require(_0x1194('0x0'));var rimraf=require(_0x1194('0x1'));var zipdir=require(_0x1194('0x2'));var jsonpatch=require(_0x1194('0x3'));var rp=require(_0x1194('0x4'));var moment=require(_0x1194('0x5'));var BPromise=require(_0x1194('0x6'));var Mustache=require(_0x1194('0x7'));var util=require('util');var path=require(_0x1194('0x8'));var sox=require(_0x1194('0x9'));var csv=require(_0x1194('0xa'));var ejs=require(_0x1194('0xb'));var fs=require('fs');var fs_extra=require(_0x1194('0xc'));var _=require(_0x1194('0xd'));var squel=require(_0x1194('0xe'));var crypto=require(_0x1194('0xf'));var jsforce=require(_0x1194('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1194('0xa'));var querystring=require('querystring');var Papa=require(_0x1194('0x11'));var Redis=require('ioredis');var authService=require(_0x1194('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1194('0x13'));var hardwareService=require(_0x1194('0x14'));var logger=require(_0x1194('0x15'))('api');var utils=require(_0x1194('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1194('0x17'));var db=require(_0x1194('0x18'))['db'];function respondWithStatusCode(_0x40213c,_0x2014b4){_0x2014b4=_0x2014b4||0xcc;return function(_0x188edc){if(_0x188edc){return _0x40213c[_0x1194('0x19')](_0x2014b4);}return _0x40213c['status'](_0x2014b4)[_0x1194('0x1a')]();};}function respondWithResult(_0x3fa8be,_0x43e760){_0x43e760=_0x43e760||0xc8;return function(_0x4bf749){if(_0x4bf749){return _0x3fa8be[_0x1194('0x1b')](_0x43e760)[_0x1194('0x1c')](_0x4bf749);}};}function respondWithFilteredResult(_0x538321,_0x55315e){return function(_0x17a092){if(_0x17a092){var _0x433cb9=typeof _0x55315e[_0x1194('0x1d')]===_0x1194('0x1e')&&typeof _0x55315e[_0x1194('0x1f')]===_0x1194('0x1e');var _0x3c5c39=_0x17a092[_0x1194('0x20')];var _0x45e2df=_0x433cb9?0x0:_0x55315e[_0x1194('0x1d')];var _0x16aa8d=_0x433cb9?_0x17a092['count']:_0x55315e[_0x1194('0x1d')]+_0x55315e['limit'];var _0x4c3bf4;if(_0x16aa8d>=_0x3c5c39){_0x16aa8d=_0x3c5c39;_0x4c3bf4=0xc8;}else{_0x4c3bf4=0xce;}_0x538321[_0x1194('0x1b')](_0x4c3bf4);return _0x538321['set'](_0x1194('0x21'),_0x45e2df+'-'+_0x16aa8d+'/'+_0x3c5c39)[_0x1194('0x1c')](_0x17a092);}return null;};}function patchUpdates(_0xc82b15){return function(_0x47b15a){try{jsonpatch['apply'](_0x47b15a,_0xc82b15,!![]);}catch(_0x4e4642){return BPromise[_0x1194('0x22')](_0x4e4642);}return _0x47b15a['save']();};}function saveUpdates(_0x1e9b3d,_0x35c4d6){return function(_0x75617f){if(_0x75617f){return _0x75617f[_0x1194('0x23')](_0x1e9b3d)['then'](function(_0x4ba99b){return _0x4ba99b;});}return null;};}function removeEntity(_0x3aaf5a,_0x2b0689){return function(_0xb265f3){if(_0xb265f3){return _0xb265f3['destroy']()['then'](function(){_0x3aaf5a[_0x1194('0x1b')](0xcc)[_0x1194('0x1a')]();});}};}function handleEntityNotFound(_0x7183c6,_0x1b9ea8){return function(_0x3dfc4b){if(!_0x3dfc4b){_0x7183c6[_0x1194('0x19')](0x194);}return _0x3dfc4b;};}function handleError(_0x3ce76d,_0x19b003){_0x19b003=_0x19b003||0x1f4;return function(_0x32e281){logger['error'](_0x32e281['stack']);if(_0x32e281[_0x1194('0x24')]){delete _0x32e281['name'];}_0x3ce76d[_0x1194('0x1b')](_0x19b003)[_0x1194('0x25')](_0x32e281);};}exports[_0x1194('0x26')]=function(_0x4afb7e,_0x95b1c0){var _0x1bd220={},_0x4872b2={},_0x4a1073={'count':0x0,'rows':[]};var _0x54bf03=_[_0x1194('0x27')](db[_0x1194('0x28')]['rawAttributes'],function(_0x2a74fa){return{'name':_0x2a74fa[_0x1194('0x29')],'type':_0x2a74fa['type'][_0x1194('0x2a')]};});_0x4872b2[_0x1194('0x2b')]=_[_0x1194('0x27')](_0x54bf03,'name');_0x4872b2[_0x1194('0x2c')]=_[_0x1194('0x2d')](_0x4afb7e['query']);_0x4872b2['filters']=_[_0x1194('0x2e')](_0x4872b2[_0x1194('0x2b')],_0x4872b2[_0x1194('0x2c')]);_0x1bd220[_0x1194('0x2f')]=_[_0x1194('0x2e')](_0x4872b2[_0x1194('0x2b')],qs[_0x1194('0x30')](_0x4afb7e[_0x1194('0x2c')]['fields']));_0x1bd220[_0x1194('0x2f')]=_0x1bd220['attributes']['length']?_0x1bd220['attributes']:_0x4872b2[_0x1194('0x2b')];if(!_0x4afb7e['query']['hasOwnProperty'](_0x1194('0x31'))){_0x1bd220[_0x1194('0x1f')]=qs[_0x1194('0x1f')](_0x4afb7e[_0x1194('0x2c')][_0x1194('0x1f')]);_0x1bd220[_0x1194('0x1d')]=qs[_0x1194('0x1d')](_0x4afb7e[_0x1194('0x2c')]['offset']);}_0x1bd220[_0x1194('0x32')]=qs['sort'](_0x4afb7e[_0x1194('0x2c')][_0x1194('0x33')]);_0x1bd220['where']=qs[_0x1194('0x34')](_[_0x1194('0x35')](_0x4afb7e[_0x1194('0x2c')],_0x4872b2['filters']),_0x54bf03);if(_0x4afb7e['query'][_0x1194('0x36')]){_0x1bd220[_0x1194('0x37')]=_[_0x1194('0x38')](_0x1bd220['where'],{'$or':_[_0x1194('0x27')](_0x54bf03,function(_0x350116){if(_0x350116[_0x1194('0x39')]!=='VIRTUAL'){var _0x418d35={};_0x418d35[_0x350116[_0x1194('0x24')]]={'$like':'%'+_0x4afb7e['query'][_0x1194('0x36')]+'%'};return _0x418d35;}})});}_0x1bd220=_[_0x1194('0x38')]({},_0x1bd220,_0x4afb7e[_0x1194('0x3a')]);var _0xa9b562={'where':_0x1bd220['where']};return db[_0x1194('0x28')]['count'](_0xa9b562)['then'](function(_0x379fa4){_0x4a1073['count']=_0x379fa4;if(_0x4afb7e[_0x1194('0x2c')][_0x1194('0x3b')]){_0x1bd220['include']=[{'all':!![]}];}return db[_0x1194('0x28')][_0x1194('0x3c')](_0x1bd220);})[_0x1194('0x3d')](function(_0xb53316){_0x4a1073[_0x1194('0x3e')]=_0xb53316;return _0x4a1073;})[_0x1194('0x3d')](respondWithFilteredResult(_0x95b1c0,_0x1bd220))['catch'](handleError(_0x95b1c0,null));};exports['show']=function(_0x1827a0,_0x26fae2){var _0x2c7e4a={'raw':!![],'where':{'id':_0x1827a0['params']['id']}},_0x202b07={};_0x202b07[_0x1194('0x2b')]=_[_0x1194('0x2d')](db[_0x1194('0x28')]['rawAttributes']);_0x202b07['query']=_['keys'](_0x1827a0[_0x1194('0x2c')]);_0x202b07['filters']=_[_0x1194('0x2e')](_0x202b07['model'],_0x202b07[_0x1194('0x2c')]);_0x2c7e4a[_0x1194('0x2f')]=_[_0x1194('0x2e')](_0x202b07[_0x1194('0x2b')],qs[_0x1194('0x30')](_0x1827a0[_0x1194('0x2c')][_0x1194('0x30')]));_0x2c7e4a[_0x1194('0x2f')]=_0x2c7e4a[_0x1194('0x2f')]['length']?_0x2c7e4a['attributes']:_0x202b07['model'];if(_0x1827a0['query'][_0x1194('0x3b')]){_0x2c7e4a[_0x1194('0x3f')]=[{'all':!![]}];}_0x2c7e4a=_[_0x1194('0x38')]({},_0x2c7e4a,_0x1827a0[_0x1194('0x3a')]);return db[_0x1194('0x28')]['find'](_0x2c7e4a)[_0x1194('0x3d')](handleEntityNotFound(_0x26fae2,null))[_0x1194('0x3d')](respondWithResult(_0x26fae2,null))[_0x1194('0x40')](handleError(_0x26fae2,null));};exports['create']=function(_0x5943bb,_0x6cd790){return db[_0x1194('0x28')][_0x1194('0x41')](_0x5943bb['body'],{})[_0x1194('0x3d')](respondWithResult(_0x6cd790,0xc9))[_0x1194('0x40')](handleError(_0x6cd790,null));};exports[_0x1194('0x23')]=function(_0x5b59fe,_0x6452b6){if(_0x5b59fe[_0x1194('0x42')]['id']){delete _0x5b59fe['body']['id'];}return db[_0x1194('0x28')]['find']({'where':{'id':_0x5b59fe['params']['id']}})[_0x1194('0x3d')](handleEntityNotFound(_0x6452b6,null))[_0x1194('0x3d')](saveUpdates(_0x5b59fe[_0x1194('0x42')],null))[_0x1194('0x3d')](respondWithResult(_0x6452b6,null))[_0x1194('0x40')](handleError(_0x6452b6,null));};exports[_0x1194('0x43')]=function(_0xb8ddf5,_0xb052ca){return db[_0x1194('0x28')][_0x1194('0x44')]({'where':{'id':_0xb8ddf5['params']['id']}})[_0x1194('0x3d')](handleEntityNotFound(_0xb052ca,null))['then'](removeEntity(_0xb052ca,null))['catch'](handleError(_0xb052ca,null));};exports[_0x1194('0x45')]=function(_0x3cfc2c,_0x23a847){return db[_0x1194('0x28')][_0x1194('0x45')]()[_0x1194('0x3d')](respondWithResult(_0x23a847,null))[_0x1194('0x40')](handleError(_0x23a847,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 45f25fc..f4342f3 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 _0x942f=['project_name','lodash','util','../../config/logger','api','moment','request-promise','path','./squareReport.attributes','exports','SquareReport','uid_pname'];(function(_0x447307,_0x17f67e){var _0x503f4e=function(_0x6061cb){while(--_0x6061cb){_0x447307['push'](_0x447307['shift']());}};_0x503f4e(++_0x17f67e);}(_0x942f,0x1ed));var _0xf942=function(_0x45790c,_0x1c726f){_0x45790c=_0x45790c-0x0;var _0x227f10=_0x942f[_0x45790c];return _0x227f10;};'use strict';var _=require(_0xf942('0x0'));var util=require(_0xf942('0x1'));var logger=require(_0xf942('0x2'))(_0xf942('0x3'));var moment=require(_0xf942('0x4'));var BPromise=require('bluebird');var rp=require(_0xf942('0x5'));var fs=require('fs');var path=require(_0xf942('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf942('0x7'));module[_0xf942('0x8')]=function(_0x20b1cb,_0x3fd5a6){return _0x20b1cb['define'](_0xf942('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xf942('0xa'),'fields':['uniqueid',_0xf942('0xb')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0217=['project_name','leaveAt','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareReport.attributes','report_square','uid_pname','uniqueid'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0217,0xe2));var _0x7021=function(_0x421b46,_0x54128e){_0x421b46=_0x421b46-0x0;var _0x1a6a76=_0x0217[_0x421b46];return _0x1a6a76;};'use strict';var _=require(_0x7021('0x0'));var util=require(_0x7021('0x1'));var logger=require(_0x7021('0x2'))(_0x7021('0x3'));var moment=require(_0x7021('0x4'));var BPromise=require('bluebird');var rp=require(_0x7021('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7021('0x6'));var config=require(_0x7021('0x7'));var attributes=require(_0x7021('0x8'));module['exports']=function(_0x4ecda0,_0x4835b9){return _0x4ecda0['define']('SquareReport',attributes,{'tableName':_0x7021('0x9'),'paranoid':![],'indexes':[{'name':_0x7021('0xa'),'fields':[_0x7021('0xb'),_0x7021('0xc')]},{'name':_0x7021('0xd'),'fields':[_0x7021('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ced9b73..8f16454 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 _0x66c0=['request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','SquareReport','create','options','raw','info','catch','UpdateSquareReport','update','body','where','attributes','limit','then','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','SquareReport,\x20%s,\x20%s'];(function(_0x525276,_0xd269da){var _0x49d8e2=function(_0x4725b0){while(--_0x4725b0){_0x525276['push'](_0x525276['shift']());}};_0x49d8e2(++_0xd269da);}(_0x66c0,0x11e));var _0x066c=function(_0x37566f,_0x177f7f){_0x37566f=_0x37566f-0x0;var _0x188ccc=_0x66c0[_0x37566f];return _0x188ccc;};'use strict';var _=require(_0x066c('0x0'));var util=require('util');var moment=require(_0x066c('0x1'));var BPromise=require('bluebird');var rs=require(_0x066c('0x2'));var fs=require('fs');var Redis=require(_0x066c('0x3'));var db=require(_0x066c('0x4'))['db'];var utils=require(_0x066c('0x5'));var logger=require(_0x066c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x066c('0x7'));var client=jayson['client'][_0x066c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d18d6,_0x525f47,_0x11c297){return new BPromise(function(_0x31b5c1,_0x3ba2ed){return client[_0x066c('0x9')](_0x2d18d6,_0x11c297)['then'](function(_0x3823b0){logger['info'](_0x066c('0xa'),_0x525f47,_0x066c('0xb'));logger['debug'](_0x066c('0xc'),_0x525f47,'request\x20sent',JSON[_0x066c('0xd')](_0x3823b0));if(_0x3823b0[_0x066c('0xe')]){if(_0x3823b0[_0x066c('0xe')][_0x066c('0xf')]===0x1f4){logger[_0x066c('0xe')]('SquareReport,\x20%s,\x20%s',_0x525f47,_0x3823b0['error'][_0x066c('0x10')]);return _0x3ba2ed(_0x3823b0['error'][_0x066c('0x10')]);}logger[_0x066c('0xe')]('SquareReport,\x20%s,\x20%s',_0x525f47,_0x3823b0[_0x066c('0xe')]['message']);return _0x31b5c1(_0x3823b0[_0x066c('0xe')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x525f47,'request\x20sent');_0x31b5c1(_0x3823b0[_0x066c('0x11')]['message']);}})['catch'](function(_0x2bb488){logger['error'](_0x066c('0xa'),_0x525f47,_0x2bb488);_0x3ba2ed(_0x2bb488);});});}exports[_0x066c('0x12')]=function(_0x293445){var _0x2f7590=this;return new Promise(function(_0x3e9c4c,_0xba8fa6){return db[_0x066c('0x13')][_0x066c('0x14')](_0x293445['body'],{'raw':_0x293445['options']?_0x293445[_0x066c('0x15')][_0x066c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5e3c2d){logger[_0x066c('0x17')](_0x066c('0x12'),_0x293445);logger['debug']('CreateSquareReport',_0x293445,JSON[_0x066c('0xd')](_0x5e3c2d));_0x3e9c4c(_0x5e3c2d);})[_0x066c('0x18')](function(_0x5c0c99){logger[_0x066c('0xe')](_0x066c('0x12'),_0x5c0c99[_0x066c('0x10')],_0x293445);_0xba8fa6(_0x2f7590['error'](0x1f4,_0x5c0c99['message']));});});};exports[_0x066c('0x19')]=function(_0x31b249){var _0x923e9b=this;return new Promise(function(_0x1bb915,_0x2de963){return db[_0x066c('0x13')][_0x066c('0x1a')](_0x31b249[_0x066c('0x1b')],{'raw':_0x31b249['options']?_0x31b249[_0x066c('0x15')][_0x066c('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31b249[_0x066c('0x15')]?_0x31b249[_0x066c('0x15')][_0x066c('0x1c')]||null:null,'attributes':_0x31b249['options']?_0x31b249['options'][_0x066c('0x1d')]||null:null,'limit':_0x31b249[_0x066c('0x15')]?_0x31b249[_0x066c('0x15')][_0x066c('0x1e')]||null:null})[_0x066c('0x1f')](function(_0x318903){logger['info'](_0x066c('0x19'),_0x31b249);logger[_0x066c('0x20')](_0x066c('0x19'),_0x31b249,JSON['stringify'](_0x318903));_0x1bb915(_0x318903);})[_0x066c('0x18')](function(_0x18e18c){logger[_0x066c('0xe')](_0x066c('0x19'),_0x18e18c[_0x066c('0x10')],_0x31b249);_0x2de963(_0x923e9b[_0x066c('0xe')](0x1f4,_0x18e18c['message']));});});}; \ No newline at end of file +var _0xfca5=['then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','create','options','UpdateSquareReport','raw','where','attributes','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x13d176,_0xc331){var _0x5807ee=function(_0x1274a7){while(--_0x1274a7){_0x13d176['push'](_0x13d176['shift']());}};_0x5807ee(++_0xc331);}(_0xfca5,0x18c));var _0x5fca=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0xfca5[_0x350258];return _0x3714b3;};'use strict';var _=require(_0x5fca('0x0'));var util=require(_0x5fca('0x1'));var moment=require(_0x5fca('0x2'));var BPromise=require('bluebird');var rs=require(_0x5fca('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fca('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5fca('0x5'))('rpc');var config=require(_0x5fca('0x6'));var jayson=require(_0x5fca('0x7'));var client=jayson[_0x5fca('0x8')][_0x5fca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59a3ca,_0x33eb75,_0xf15840){return new BPromise(function(_0x40d6df,_0x234ab8){return client['request'](_0x59a3ca,_0xf15840)[_0x5fca('0xa')](function(_0x2693ea){logger[_0x5fca('0xb')](_0x5fca('0xc'),_0x33eb75,_0x5fca('0xd'));logger[_0x5fca('0xe')](_0x5fca('0xf'),_0x33eb75,'request\x20sent',JSON[_0x5fca('0x10')](_0x2693ea));if(_0x2693ea[_0x5fca('0x11')]){if(_0x2693ea['error'][_0x5fca('0x12')]===0x1f4){logger['error'](_0x5fca('0xc'),_0x33eb75,_0x2693ea[_0x5fca('0x11')][_0x5fca('0x13')]);return _0x234ab8(_0x2693ea[_0x5fca('0x11')][_0x5fca('0x13')]);}logger['error'](_0x5fca('0xc'),_0x33eb75,_0x2693ea['error'][_0x5fca('0x13')]);return _0x40d6df(_0x2693ea[_0x5fca('0x11')][_0x5fca('0x13')]);}else{logger['info'](_0x5fca('0xc'),_0x33eb75,_0x5fca('0xd'));_0x40d6df(_0x2693ea[_0x5fca('0x14')][_0x5fca('0x13')]);}})[_0x5fca('0x15')](function(_0x136f81){logger[_0x5fca('0x11')](_0x5fca('0xc'),_0x33eb75,_0x136f81);_0x234ab8(_0x136f81);});});}exports[_0x5fca('0x16')]=function(_0x8af381){var _0x341cb7=this;return new Promise(function(_0x538e43,_0x2301c2){return db['SquareReport'][_0x5fca('0x17')](_0x8af381['body'],{'raw':_0x8af381[_0x5fca('0x18')]?_0x8af381['options']['raw']===undefined?!![]:![]:!![]})[_0x5fca('0xa')](function(_0x4f8706){logger['info'](_0x5fca('0x16'),_0x8af381);logger[_0x5fca('0xe')]('CreateSquareReport',_0x8af381,JSON[_0x5fca('0x10')](_0x4f8706));_0x538e43(_0x4f8706);})[_0x5fca('0x15')](function(_0x2d21cb){logger[_0x5fca('0x11')](_0x5fca('0x16'),_0x2d21cb[_0x5fca('0x13')],_0x8af381);_0x2301c2(_0x341cb7[_0x5fca('0x11')](0x1f4,_0x2d21cb[_0x5fca('0x13')]));});});};exports[_0x5fca('0x19')]=function(_0x3f0d5e){var _0x2bda73=this;return new Promise(function(_0x501c1f,_0x39fbd5){return db['SquareReport']['update'](_0x3f0d5e['body'],{'raw':_0x3f0d5e[_0x5fca('0x18')]?_0x3f0d5e['options'][_0x5fca('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f0d5e[_0x5fca('0x18')]?_0x3f0d5e['options'][_0x5fca('0x1b')]||null:null,'attributes':_0x3f0d5e[_0x5fca('0x18')]?_0x3f0d5e[_0x5fca('0x18')][_0x5fca('0x1c')]||null:null,'limit':_0x3f0d5e[_0x5fca('0x18')]?_0x3f0d5e[_0x5fca('0x18')]['limit']||null:null})[_0x5fca('0xa')](function(_0x5f2d38){logger[_0x5fca('0xb')](_0x5fca('0x19'),_0x3f0d5e);logger[_0x5fca('0xe')](_0x5fca('0x19'),_0x3f0d5e,JSON[_0x5fca('0x10')](_0x5f2d38));_0x501c1f(_0x5f2d38);})['catch'](function(_0x20100e){logger['error']('UpdateSquareReport',_0x20100e['message'],_0x3f0d5e);_0x39fbd5(_0x2bda73[_0x5fca('0x11')](0x1f4,_0x20100e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index ad774e6..acc9b1b 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 _0xc34b=['create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','/:id','show','post'];(function(_0x4c6154,_0x25d59d){var _0x4ae906=function(_0x2fd70d){while(--_0x2fd70d){_0x4c6154['push'](_0x4c6154['shift']());}};_0x4ae906(++_0x25d59d);}(_0xc34b,0xb6));var _0xbc34=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0xc34b[_0x1b9cd5];return _0x4c74ca;};'use strict';var multer=require(_0xbc34('0x0'));var util=require(_0xbc34('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbc34('0x2'));var router=express[_0xbc34('0x3')]();var fs_extra=require(_0xbc34('0x4'));var auth=require(_0xbc34('0x5'));var interaction=require(_0xbc34('0x6'));var config=require(_0xbc34('0x7'));var controller=require(_0xbc34('0x8'));router['get']('/',auth[_0xbc34('0x9')](),controller[_0xbc34('0xa')]);router[_0xbc34('0xb')](_0xbc34('0xc'),auth[_0xbc34('0x9')](),controller['describe']);router[_0xbc34('0xb')](_0xbc34('0xd'),auth['isAuthenticated'](),controller[_0xbc34('0xe')]);router[_0xbc34('0xf')]('/',auth[_0xbc34('0x9')](),controller[_0xbc34('0x10')]);router[_0xbc34('0x11')](_0xbc34('0xd'),auth[_0xbc34('0x9')](),controller[_0xbc34('0x12')]);router[_0xbc34('0x13')](_0xbc34('0xd'),auth[_0xbc34('0x9')](),controller[_0xbc34('0x14')]);module[_0xbc34('0x15')]=router; \ No newline at end of file +var _0x8deb=['put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x8deb,0xa5));var _0xb8de=function(_0xd066c8,_0x46b223){_0xd066c8=_0xd066c8-0x0;var _0x369df2=_0x8deb[_0xd066c8];return _0x369df2;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb8de('0x0'));var express=require(_0xb8de('0x1'));var router=express[_0xb8de('0x2')]();var fs_extra=require(_0xb8de('0x3'));var auth=require(_0xb8de('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb8de('0x5'));var controller=require(_0xb8de('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb8de('0x7')](_0xb8de('0x8'),auth[_0xb8de('0x9')](),controller[_0xb8de('0xa')]);router['get'](_0xb8de('0xb'),auth[_0xb8de('0x9')](),controller[_0xb8de('0xc')]);router[_0xb8de('0xd')]('/',auth[_0xb8de('0x9')](),controller[_0xb8de('0xe')]);router[_0xb8de('0xf')](_0xb8de('0xb'),auth[_0xb8de('0x9')](),controller[_0xb8de('0x10')]);router[_0xb8de('0x11')](_0xb8de('0xb'),auth[_0xb8de('0x9')](),controller[_0xb8de('0x12')]);module[_0xb8de('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 376c9a7..a43d9fc 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 _0x7aba=['sequelize','exports','STRING','TEXT'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x7aba,0x148));var _0xa7ab=function(_0x120e9f,_0x1fc050){_0x120e9f=_0x120e9f-0x0;var _0x2987c0=_0x7aba[_0x120e9f];return _0x2987c0;};'use strict';var Sequelize=require(_0xa7ab('0x0'));module[_0xa7ab('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xa7ab('0x2')]},'application':{'type':Sequelize[_0xa7ab('0x2')]},'data':{'type':Sequelize[_0xa7ab('0x3')]},'project_name':{'type':Sequelize[_0xa7ab('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc27f=['TEXT','exports','STRING'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc27f,0x1e7));var _0xfc27=function(_0x1de501,_0x1fcca4){_0x1de501=_0x1de501-0x0;var _0x164727=_0xc27f[_0x1de501];return _0x164727;};'use strict';var Sequelize=require('sequelize');module[_0xfc27('0x0')]={'uniqueid':{'type':Sequelize[_0xfc27('0x1')]},'node':{'type':Sequelize[_0xfc27('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xfc27('0x2')]},'project_name':{'type':Sequelize[_0xfc27('0x1')]},'callerid':{'type':Sequelize[_0xfc27('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 600943f..8e4996c 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 _0x8929=['squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','SquareDetailsReport','includeAll','include','show','params','options','find','catch','create','update','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8929,0x10e));var _0x9892=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x8929[_0x2a8c21];return _0x5f3061;};'use strict';var emlformat=require(_0x9892('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9892('0x1'));var jsonpatch=require(_0x9892('0x2'));var rp=require(_0x9892('0x3'));var moment=require(_0x9892('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9892('0x5'));var util=require(_0x9892('0x6'));var path=require('path');var sox=require(_0x9892('0x7'));var csv=require(_0x9892('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9892('0x9'));var _=require('lodash');var squel=require(_0x9892('0xa'));var crypto=require('crypto');var jsforce=require(_0x9892('0xb'));var deskjs=require(_0x9892('0xc'));var toCsv=require(_0x9892('0x8'));var querystring=require(_0x9892('0xd'));var Papa=require('papaparse');var Redis=require(_0x9892('0xe'));var authService=require(_0x9892('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9892('0x10'))(_0x9892('0x11'));var utils=require(_0x9892('0x12'));var config=require(_0x9892('0x13'));var licenseUtil=require(_0x9892('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22011b,_0xcaf5e3){_0xcaf5e3=_0xcaf5e3||0xcc;return function(_0x1c38c0){if(_0x1c38c0){return _0x22011b[_0x9892('0x15')](_0xcaf5e3);}return _0x22011b[_0x9892('0x16')](_0xcaf5e3)[_0x9892('0x17')]();};}function respondWithResult(_0x411b1c,_0xab86ee){_0xab86ee=_0xab86ee||0xc8;return function(_0x479755){if(_0x479755){return _0x411b1c[_0x9892('0x16')](_0xab86ee)[_0x9892('0x18')](_0x479755);}};}function respondWithFilteredResult(_0x21d54f,_0x907632){return function(_0x18f242){if(_0x18f242){var _0x1664a7=typeof _0x907632['offset']==='undefined'&&typeof _0x907632[_0x9892('0x19')]===_0x9892('0x1a');var _0x22d421=_0x18f242[_0x9892('0x1b')];var _0x392b7c=_0x1664a7?0x0:_0x907632[_0x9892('0x1c')];var _0x13d0ee=_0x1664a7?_0x18f242[_0x9892('0x1b')]:_0x907632[_0x9892('0x1c')]+_0x907632[_0x9892('0x19')];var _0x55dec2;if(_0x13d0ee>=_0x22d421){_0x13d0ee=_0x22d421;_0x55dec2=0xc8;}else{_0x55dec2=0xce;}_0x21d54f[_0x9892('0x16')](_0x55dec2);return _0x21d54f['set']('Content-Range',_0x392b7c+'-'+_0x13d0ee+'/'+_0x22d421)[_0x9892('0x18')](_0x18f242);}return null;};}function patchUpdates(_0x1b8035){return function(_0x488ae4){try{jsonpatch[_0x9892('0x1d')](_0x488ae4,_0x1b8035,!![]);}catch(_0x591cd8){return BPromise[_0x9892('0x1e')](_0x591cd8);}return _0x488ae4[_0x9892('0x1f')]();};}function saveUpdates(_0x80a26d,_0x41359a){return function(_0x408ce0){if(_0x408ce0){return _0x408ce0['update'](_0x80a26d)[_0x9892('0x20')](function(_0x5e4b06){return _0x5e4b06;});}return null;};}function removeEntity(_0x5f2baa,_0x375891){return function(_0x6f4b6f){if(_0x6f4b6f){return _0x6f4b6f[_0x9892('0x21')]()[_0x9892('0x20')](function(){_0x5f2baa[_0x9892('0x16')](0xcc)[_0x9892('0x17')]();});}};}function handleEntityNotFound(_0x4cc319,_0x45cac8){return function(_0x3af887){if(!_0x3af887){_0x4cc319[_0x9892('0x15')](0x194);}return _0x3af887;};}function handleError(_0x36f948,_0x5949d5){_0x5949d5=_0x5949d5||0x1f4;return function(_0x25d811){logger[_0x9892('0x22')](_0x25d811[_0x9892('0x23')]);if(_0x25d811[_0x9892('0x24')]){delete _0x25d811[_0x9892('0x24')];}_0x36f948[_0x9892('0x16')](_0x5949d5)[_0x9892('0x25')](_0x25d811);};}exports[_0x9892('0x26')]=function(_0x4633d1,_0x801c3a){var _0x2fa71b={},_0x3478cc={},_0x5078e2={'count':0x0,'rows':[]};var _0x4bef05=_['map'](db['SquareDetailsReport'][_0x9892('0x27')],function(_0x137860){return{'name':_0x137860[_0x9892('0x28')],'type':_0x137860[_0x9892('0x29')][_0x9892('0x2a')]};});_0x3478cc[_0x9892('0x2b')]=_[_0x9892('0x2c')](_0x4bef05,'name');_0x3478cc['query']=_[_0x9892('0x2d')](_0x4633d1[_0x9892('0x2e')]);_0x3478cc[_0x9892('0x2f')]=_[_0x9892('0x30')](_0x3478cc['model'],_0x3478cc['query']);_0x2fa71b[_0x9892('0x31')]=_[_0x9892('0x30')](_0x3478cc[_0x9892('0x2b')],qs[_0x9892('0x32')](_0x4633d1[_0x9892('0x2e')]['fields']));_0x2fa71b[_0x9892('0x31')]=_0x2fa71b['attributes'][_0x9892('0x33')]?_0x2fa71b['attributes']:_0x3478cc[_0x9892('0x2b')];if(!_0x4633d1[_0x9892('0x2e')]['hasOwnProperty'](_0x9892('0x34'))){_0x2fa71b[_0x9892('0x19')]=qs['limit'](_0x4633d1[_0x9892('0x2e')][_0x9892('0x19')]);_0x2fa71b[_0x9892('0x1c')]=qs[_0x9892('0x1c')](_0x4633d1[_0x9892('0x2e')][_0x9892('0x1c')]);}_0x2fa71b[_0x9892('0x35')]=qs[_0x9892('0x36')](_0x4633d1[_0x9892('0x2e')][_0x9892('0x36')]);_0x2fa71b[_0x9892('0x37')]=qs[_0x9892('0x2f')](_['pick'](_0x4633d1['query'],_0x3478cc['filters']),_0x4bef05);if(_0x4633d1[_0x9892('0x2e')]['filter']){_0x2fa71b[_0x9892('0x37')]=_[_0x9892('0x38')](_0x2fa71b[_0x9892('0x37')],{'$or':_[_0x9892('0x2c')](_0x4bef05,function(_0xddd01c){if(_0xddd01c[_0x9892('0x29')]!==_0x9892('0x39')){var _0x24d2d9={};_0x24d2d9[_0xddd01c[_0x9892('0x24')]]={'$like':'%'+_0x4633d1['query']['filter']+'%'};return _0x24d2d9;}})});}_0x2fa71b=_[_0x9892('0x38')]({},_0x2fa71b,_0x4633d1['options']);var _0x2c0c49={'where':_0x2fa71b[_0x9892('0x37')]};return db[_0x9892('0x3a')][_0x9892('0x1b')](_0x2c0c49)['then'](function(_0x53fffa){_0x5078e2['count']=_0x53fffa;if(_0x4633d1[_0x9892('0x2e')][_0x9892('0x3b')]){_0x2fa71b[_0x9892('0x3c')]=[{'all':!![]}];}return db[_0x9892('0x3a')]['findAll'](_0x2fa71b);})[_0x9892('0x20')](function(_0xd447a7){_0x5078e2['rows']=_0xd447a7;return _0x5078e2;})[_0x9892('0x20')](respondWithFilteredResult(_0x801c3a,_0x2fa71b))['catch'](handleError(_0x801c3a,null));};exports[_0x9892('0x3d')]=function(_0x535944,_0x356f56){var _0x392ed5={'raw':!![],'where':{'id':_0x535944[_0x9892('0x3e')]['id']}},_0x2d07f0={};_0x2d07f0[_0x9892('0x2b')]=_[_0x9892('0x2d')](db[_0x9892('0x3a')][_0x9892('0x27')]);_0x2d07f0['query']=_[_0x9892('0x2d')](_0x535944['query']);_0x2d07f0[_0x9892('0x2f')]=_['intersection'](_0x2d07f0['model'],_0x2d07f0[_0x9892('0x2e')]);_0x392ed5[_0x9892('0x31')]=_[_0x9892('0x30')](_0x2d07f0[_0x9892('0x2b')],qs['fields'](_0x535944[_0x9892('0x2e')][_0x9892('0x32')]));_0x392ed5[_0x9892('0x31')]=_0x392ed5['attributes'][_0x9892('0x33')]?_0x392ed5[_0x9892('0x31')]:_0x2d07f0[_0x9892('0x2b')];if(_0x535944[_0x9892('0x2e')][_0x9892('0x3b')]){_0x392ed5[_0x9892('0x3c')]=[{'all':!![]}];}_0x392ed5=_[_0x9892('0x38')]({},_0x392ed5,_0x535944[_0x9892('0x3f')]);return db[_0x9892('0x3a')][_0x9892('0x40')](_0x392ed5)[_0x9892('0x20')](handleEntityNotFound(_0x356f56,null))[_0x9892('0x20')](respondWithResult(_0x356f56,null))[_0x9892('0x41')](handleError(_0x356f56,null));};exports[_0x9892('0x42')]=function(_0x40bbfc,_0x591d4e){return db[_0x9892('0x3a')][_0x9892('0x42')](_0x40bbfc['body'],{})['then'](respondWithResult(_0x591d4e,0xc9))[_0x9892('0x41')](handleError(_0x591d4e,null));};exports[_0x9892('0x43')]=function(_0x1965a2,_0x3a4b8b){if(_0x1965a2[_0x9892('0x44')]['id']){delete _0x1965a2[_0x9892('0x44')]['id'];}return db[_0x9892('0x3a')][_0x9892('0x40')]({'where':{'id':_0x1965a2[_0x9892('0x3e')]['id']}})[_0x9892('0x20')](handleEntityNotFound(_0x3a4b8b,null))['then'](saveUpdates(_0x1965a2[_0x9892('0x44')],null))[_0x9892('0x20')](respondWithResult(_0x3a4b8b,null))[_0x9892('0x41')](handleError(_0x3a4b8b,null));};exports[_0x9892('0x21')]=function(_0x4e5cdb,_0x2094c3){return db['SquareDetailsReport'][_0x9892('0x40')]({'where':{'id':_0x4e5cdb[_0x9892('0x3e')]['id']}})[_0x9892('0x20')](handleEntityNotFound(_0x2094c3,null))['then'](removeEntity(_0x2094c3,null))['catch'](handleError(_0x2094c3,null));};exports['describe']=function(_0x511869,_0x20d474){return db['SquareDetailsReport'][_0x9892('0x45')]()[_0x9892('0x20')](respondWithResult(_0x20d474,null))[_0x9892('0x41')](handleError(_0x20d474,null));}; \ No newline at end of file +var _0x0607=['bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','map','SquareDetailsReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0607,0x16e));var _0x7060=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0607[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7060('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7060('0x1'));var rp=require(_0x7060('0x2'));var moment=require(_0x7060('0x3'));var BPromise=require(_0x7060('0x4'));var Mustache=require(_0x7060('0x5'));var util=require(_0x7060('0x6'));var path=require('path');var sox=require(_0x7060('0x7'));var csv=require(_0x7060('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7060('0x9'));var _=require('lodash');var squel=require(_0x7060('0xa'));var crypto=require(_0x7060('0xb'));var jsforce=require(_0x7060('0xc'));var deskjs=require(_0x7060('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7060('0xe'));var Papa=require('papaparse');var Redis=require(_0x7060('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7060('0x10'));var as=require(_0x7060('0x11'));var hardwareService=require(_0x7060('0x12'));var logger=require(_0x7060('0x13'))(_0x7060('0x14'));var utils=require(_0x7060('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7060('0x16'))['db'];function respondWithStatusCode(_0x257d91,_0x1fdc4c){_0x1fdc4c=_0x1fdc4c||0xcc;return function(_0x206ee7){if(_0x206ee7){return _0x257d91[_0x7060('0x17')](_0x1fdc4c);}return _0x257d91[_0x7060('0x18')](_0x1fdc4c)[_0x7060('0x19')]();};}function respondWithResult(_0x3648f2,_0x31f22d){_0x31f22d=_0x31f22d||0xc8;return function(_0x2ec998){if(_0x2ec998){return _0x3648f2[_0x7060('0x18')](_0x31f22d)[_0x7060('0x1a')](_0x2ec998);}};}function respondWithFilteredResult(_0x45eb3c,_0x4203d2){return function(_0x3a45cd){if(_0x3a45cd){var _0x2545f7=typeof _0x4203d2[_0x7060('0x1b')]===_0x7060('0x1c')&&typeof _0x4203d2['limit']===_0x7060('0x1c');var _0x152cd5=_0x3a45cd[_0x7060('0x1d')];var _0x58dbb4=_0x2545f7?0x0:_0x4203d2[_0x7060('0x1b')];var _0x4ed114=_0x2545f7?_0x3a45cd[_0x7060('0x1d')]:_0x4203d2[_0x7060('0x1b')]+_0x4203d2[_0x7060('0x1e')];var _0x5ccba0;if(_0x4ed114>=_0x152cd5){_0x4ed114=_0x152cd5;_0x5ccba0=0xc8;}else{_0x5ccba0=0xce;}_0x45eb3c[_0x7060('0x18')](_0x5ccba0);return _0x45eb3c['set'](_0x7060('0x1f'),_0x58dbb4+'-'+_0x4ed114+'/'+_0x152cd5)[_0x7060('0x1a')](_0x3a45cd);}return null;};}function patchUpdates(_0x4fa254){return function(_0x23cc7d){try{jsonpatch[_0x7060('0x20')](_0x23cc7d,_0x4fa254,!![]);}catch(_0x6cefeb){return BPromise[_0x7060('0x21')](_0x6cefeb);}return _0x23cc7d[_0x7060('0x22')]();};}function saveUpdates(_0x512796,_0x1f8f4c){return function(_0x4a5aeb){if(_0x4a5aeb){return _0x4a5aeb[_0x7060('0x23')](_0x512796)[_0x7060('0x24')](function(_0x1c1967){return _0x1c1967;});}return null;};}function removeEntity(_0x48001f,_0xeb0544){return function(_0x1bca72){if(_0x1bca72){return _0x1bca72[_0x7060('0x25')]()['then'](function(){_0x48001f[_0x7060('0x18')](0xcc)[_0x7060('0x19')]();});}};}function handleEntityNotFound(_0x1de20b,_0x2c20b5){return function(_0x3adbdd){if(!_0x3adbdd){_0x1de20b[_0x7060('0x17')](0x194);}return _0x3adbdd;};}function handleError(_0x3d9bf2,_0x33e224){_0x33e224=_0x33e224||0x1f4;return function(_0x4f377e){logger[_0x7060('0x26')](_0x4f377e[_0x7060('0x27')]);if(_0x4f377e[_0x7060('0x28')]){delete _0x4f377e[_0x7060('0x28')];}_0x3d9bf2[_0x7060('0x18')](_0x33e224)['send'](_0x4f377e);};}exports['index']=function(_0xd1c189,_0x4be8dc){var _0x187b77={},_0xb0a5ef={},_0x285721={'count':0x0,'rows':[]};var _0x4ceca2=_[_0x7060('0x29')](db[_0x7060('0x2a')][_0x7060('0x2b')],function(_0x56f4d3){return{'name':_0x56f4d3[_0x7060('0x2c')],'type':_0x56f4d3['type'][_0x7060('0x2d')]};});_0xb0a5ef[_0x7060('0x2e')]=_[_0x7060('0x29')](_0x4ceca2,_0x7060('0x28'));_0xb0a5ef[_0x7060('0x2f')]=_[_0x7060('0x30')](_0xd1c189[_0x7060('0x2f')]);_0xb0a5ef[_0x7060('0x31')]=_[_0x7060('0x32')](_0xb0a5ef[_0x7060('0x2e')],_0xb0a5ef[_0x7060('0x2f')]);_0x187b77[_0x7060('0x33')]=_[_0x7060('0x32')](_0xb0a5ef[_0x7060('0x2e')],qs[_0x7060('0x34')](_0xd1c189['query'][_0x7060('0x34')]));_0x187b77[_0x7060('0x33')]=_0x187b77[_0x7060('0x33')][_0x7060('0x35')]?_0x187b77['attributes']:_0xb0a5ef[_0x7060('0x2e')];if(!_0xd1c189[_0x7060('0x2f')][_0x7060('0x36')](_0x7060('0x37'))){_0x187b77[_0x7060('0x1e')]=qs[_0x7060('0x1e')](_0xd1c189[_0x7060('0x2f')][_0x7060('0x1e')]);_0x187b77[_0x7060('0x1b')]=qs['offset'](_0xd1c189[_0x7060('0x2f')][_0x7060('0x1b')]);}_0x187b77['order']=qs['sort'](_0xd1c189[_0x7060('0x2f')][_0x7060('0x38')]);_0x187b77[_0x7060('0x39')]=qs[_0x7060('0x31')](_[_0x7060('0x3a')](_0xd1c189[_0x7060('0x2f')],_0xb0a5ef['filters']),_0x4ceca2);if(_0xd1c189[_0x7060('0x2f')]['filter']){_0x187b77[_0x7060('0x39')]=_[_0x7060('0x3b')](_0x187b77[_0x7060('0x39')],{'$or':_['map'](_0x4ceca2,function(_0x52c1b1){if(_0x52c1b1[_0x7060('0x3c')]!=='VIRTUAL'){var _0x4a9fd9={};_0x4a9fd9[_0x52c1b1[_0x7060('0x28')]]={'$like':'%'+_0xd1c189['query'][_0x7060('0x3d')]+'%'};return _0x4a9fd9;}})});}_0x187b77=_['merge']({},_0x187b77,_0xd1c189['options']);var _0x14eca2={'where':_0x187b77[_0x7060('0x39')]};return db[_0x7060('0x2a')]['count'](_0x14eca2)[_0x7060('0x24')](function(_0x240efd){_0x285721[_0x7060('0x1d')]=_0x240efd;if(_0xd1c189[_0x7060('0x2f')][_0x7060('0x3e')]){_0x187b77[_0x7060('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x7060('0x40')](_0x187b77);})['then'](function(_0x1e8a72){_0x285721[_0x7060('0x41')]=_0x1e8a72;return _0x285721;})[_0x7060('0x24')](respondWithFilteredResult(_0x4be8dc,_0x187b77))[_0x7060('0x42')](handleError(_0x4be8dc,null));};exports[_0x7060('0x43')]=function(_0x2b9691,_0x8a13d1){var _0x27ed15={'raw':!![],'where':{'id':_0x2b9691['params']['id']}},_0x10b20c={};_0x10b20c[_0x7060('0x2e')]=_[_0x7060('0x30')](db[_0x7060('0x2a')][_0x7060('0x2b')]);_0x10b20c[_0x7060('0x2f')]=_[_0x7060('0x30')](_0x2b9691['query']);_0x10b20c[_0x7060('0x31')]=_[_0x7060('0x32')](_0x10b20c[_0x7060('0x2e')],_0x10b20c['query']);_0x27ed15[_0x7060('0x33')]=_['intersection'](_0x10b20c[_0x7060('0x2e')],qs[_0x7060('0x34')](_0x2b9691['query'][_0x7060('0x34')]));_0x27ed15[_0x7060('0x33')]=_0x27ed15['attributes'][_0x7060('0x35')]?_0x27ed15[_0x7060('0x33')]:_0x10b20c[_0x7060('0x2e')];if(_0x2b9691['query'][_0x7060('0x3e')]){_0x27ed15[_0x7060('0x3f')]=[{'all':!![]}];}_0x27ed15=_[_0x7060('0x3b')]({},_0x27ed15,_0x2b9691[_0x7060('0x44')]);return db[_0x7060('0x2a')][_0x7060('0x45')](_0x27ed15)['then'](handleEntityNotFound(_0x8a13d1,null))[_0x7060('0x24')](respondWithResult(_0x8a13d1,null))[_0x7060('0x42')](handleError(_0x8a13d1,null));};exports[_0x7060('0x46')]=function(_0x5a94b8,_0x1d6397){return db[_0x7060('0x2a')][_0x7060('0x46')](_0x5a94b8[_0x7060('0x47')],{})[_0x7060('0x24')](respondWithResult(_0x1d6397,0xc9))[_0x7060('0x42')](handleError(_0x1d6397,null));};exports['update']=function(_0x52f094,_0x3f0f5c){if(_0x52f094[_0x7060('0x47')]['id']){delete _0x52f094['body']['id'];}return db[_0x7060('0x2a')][_0x7060('0x45')]({'where':{'id':_0x52f094[_0x7060('0x48')]['id']}})[_0x7060('0x24')](handleEntityNotFound(_0x3f0f5c,null))[_0x7060('0x24')](saveUpdates(_0x52f094[_0x7060('0x47')],null))['then'](respondWithResult(_0x3f0f5c,null))['catch'](handleError(_0x3f0f5c,null));};exports[_0x7060('0x25')]=function(_0x48836c,_0x50d1bd){return db[_0x7060('0x2a')][_0x7060('0x45')]({'where':{'id':_0x48836c['params']['id']}})['then'](handleEntityNotFound(_0x50d1bd,null))[_0x7060('0x24')](removeEntity(_0x50d1bd,null))[_0x7060('0x42')](handleError(_0x50d1bd,null));};exports['describe']=function(_0x136b56,_0x26aa2a){return db[_0x7060('0x2a')][_0x7060('0x49')]()[_0x7060('0x24')](respondWithResult(_0x26aa2a,null))[_0x7060('0x42')](handleError(_0x26aa2a,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1916bd6..3fb3447 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 _0x95cf=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4f1f64,_0x445efa){var _0x3661a5=function(_0x413f50){while(--_0x413f50){_0x4f1f64['push'](_0x4f1f64['shift']());}};_0x3661a5(++_0x445efa);}(_0x95cf,0x14a));var _0xf95c=function(_0x55ae0f,_0x4d17e0){_0x55ae0f=_0x55ae0f-0x0;var _0x2f3a25=_0x95cf[_0x55ae0f];return _0x2f3a25;};'use strict';var _=require(_0xf95c('0x0'));var util=require(_0xf95c('0x1'));var logger=require(_0xf95c('0x2'))('api');var moment=require(_0xf95c('0x3'));var BPromise=require(_0xf95c('0x4'));var rp=require(_0xf95c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf95c('0x6'));var config=require(_0xf95c('0x7'));var attributes=require(_0xf95c('0x8'));module[_0xf95c('0x9')]=function(_0x427a41,_0x53c801){return _0x427a41[_0xf95c('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xf95c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70f2=['SquareDetailsReport','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x70f2,0x83));var _0x270f=function(_0x40ff41,_0x2b51bc){_0x40ff41=_0x40ff41-0x0;var _0x5339ac=_0x70f2[_0x40ff41];return _0x5339ac;};'use strict';var _=require(_0x270f('0x0'));var util=require('util');var logger=require(_0x270f('0x1'))(_0x270f('0x2'));var moment=require(_0x270f('0x3'));var BPromise=require(_0x270f('0x4'));var rp=require(_0x270f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x270f('0x6'));var config=require(_0x270f('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x270f('0x8')]=function(_0x15b179,_0x20b1d3){return _0x15b179['define'](_0x270f('0x9'),attributes,{'tableName':'report_square_details','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 a56e258..23edabd 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 _0x594d=['then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','create','options','raw','CreateSquareDetailsReport','stringify','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x22f76d,_0x40df07){var _0x49ada8=function(_0x33fd85){while(--_0x33fd85){_0x22f76d['push'](_0x22f76d['shift']());}};_0x49ada8(++_0x40df07);}(_0x594d,0x92));var _0xd594=function(_0x54c5b2,_0x5a8367){_0x54c5b2=_0x54c5b2-0x0;var _0x2fa0ae=_0x594d[_0x54c5b2];return _0x2fa0ae;};'use strict';var _=require(_0xd594('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd594('0x1'));var rs=require(_0xd594('0x2'));var fs=require('fs');var Redis=require(_0xd594('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd594('0x4'));var logger=require(_0xd594('0x5'))(_0xd594('0x6'));var config=require(_0xd594('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd594('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1c64,_0x446711,_0xeedad0){return new BPromise(function(_0x20325a,_0x20718a){return client[_0xd594('0x9')](_0x3b1c64,_0xeedad0)[_0xd594('0xa')](function(_0xf3043e){logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');logger[_0xd594('0xd')](_0xd594('0xe'),_0x446711,_0xd594('0xf'),JSON['stringify'](_0xf3043e));if(_0xf3043e[_0xd594('0x10')]){if(_0xf3043e[_0xd594('0x10')][_0xd594('0x11')]===0x1f4){logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e[_0xd594('0x10')][_0xd594('0x12')]);return _0x20718a(_0xf3043e['error']['message']);}logger[_0xd594('0x10')](_0xd594('0xc'),_0x446711,_0xf3043e['error'][_0xd594('0x12')]);return _0x20325a(_0xf3043e['error'][_0xd594('0x12')]);}else{logger[_0xd594('0xb')](_0xd594('0xc'),_0x446711,'request\x20sent');_0x20325a(_0xf3043e[_0xd594('0x13')]['message']);}})['catch'](function(_0x2a5f17){logger[_0xd594('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x446711,_0x2a5f17);_0x20718a(_0x2a5f17);});});}exports['CreateSquareDetailsReport']=function(_0x232776){var _0x4ea0d5=this;return new Promise(function(_0x54f640,_0x3ae9be){return db['SquareDetailsReport'][_0xd594('0x14')](_0x232776['body'],{'raw':_0x232776[_0xd594('0x15')]?_0x232776['options'][_0xd594('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x3b0fda){logger[_0xd594('0xb')](_0xd594('0x17'),_0x232776);logger[_0xd594('0xd')](_0xd594('0x17'),_0x232776,JSON[_0xd594('0x18')](_0x3b0fda));_0x54f640(_0x3b0fda);})[_0xd594('0x19')](function(_0x2b8495){logger[_0xd594('0x10')](_0xd594('0x17'),_0x2b8495[_0xd594('0x12')],_0x232776);_0x3ae9be(_0x4ea0d5[_0xd594('0x10')](0x1f4,_0x2b8495[_0xd594('0x12')]));});});}; \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','util','moment'];(function(_0x4daef0,_0x3837c8){var _0x3e7c81=function(_0x182172){while(--_0x182172){_0x4daef0['push'](_0x4daef0['shift']());}};_0x3e7c81(++_0x3837c8);}(_0xda2d,0x102));var _0xdda2=function(_0x3c7d45,_0x1e8a90){_0x3c7d45=_0x3c7d45-0x0;var _0x366cbd=_0xda2d[_0x3c7d45];return _0x366cbd;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')](_0x1a3b35[_0xdda2('0x17')],{'raw':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35[_0xdda2('0x18')][_0xdda2('0x19')]===undefined?!![]:![]:!![]})[_0xdda2('0xa')](function(_0x4eed30){logger[_0xdda2('0x12')]('CreateSquareDetailsReport',_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON[_0xdda2('0xf')](_0x4eed30));_0x2b6ee8(_0x4eed30);})['catch'](function(_0x347ee6){logger['error'](_0xdda2('0x14'),_0x347ee6[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5['error'](0x1f4,_0x347ee6[_0xdda2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index c3ccc33..2f5a611 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 _0x21fe=['get','isAuthenticated','exports','express','../../components/auth/service','./system.controller'];(function(_0x5b697a,_0x280202){var _0x5de43b=function(_0x2bc32f){while(--_0x2bc32f){_0x5b697a['push'](_0x5b697a['shift']());}};_0x5de43b(++_0x280202);}(_0x21fe,0x1d1));var _0xe21f=function(_0x2cbb72,_0x2e2448){_0x2cbb72=_0x2cbb72-0x0;var _0x296d2a=_0x21fe[_0x2cbb72];return _0x296d2a;};'use strict';var express=require(_0xe21f('0x0'));var router=express['Router']();var auth=require(_0xe21f('0x1'));var controller=require(_0xe21f('0x2'));router[_0xe21f('0x3')]('/',auth[_0xe21f('0x4')](),controller['index']);router[_0xe21f('0x3')]('/process/:pid/kill',auth[_0xe21f('0x4')](),controller['killProcess']);module[_0xe21f('0x5')]=router; \ No newline at end of file +var _0xa3d4=['index','/process/:pid/kill','killProcess','express','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x4b1769,_0xffb3a7){var _0x9556f9=function(_0x38a1c6){while(--_0x38a1c6){_0x4b1769['push'](_0x4b1769['shift']());}};_0x9556f9(++_0xffb3a7);}(_0xa3d4,0x1e3));var _0x4a3d=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa3d4[_0x5f09c5];return _0x426ad9;};'use strict';var express=require(_0x4a3d('0x0'));var router=express['Router']();var auth=require(_0x4a3d('0x1'));var controller=require(_0x4a3d('0x2'));router[_0x4a3d('0x3')]('/',auth[_0x4a3d('0x4')](),controller[_0x4a3d('0x5')]);router['get'](_0x4a3d('0x6'),auth['isAuthenticated'](),controller[_0x4a3d('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index a8d6667..7614146 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 _0xedb5=['kill','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','child_process','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','getAllData','then','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x1ad7fc,_0x444145){var _0x3bb433=function(_0x1e27ef){while(--_0x1e27ef){_0x1ad7fc['push'](_0x1ad7fc['shift']());}};_0x3bb433(++_0x444145);}(_0xedb5,0x131));var _0x5edb=function(_0x122e2c,_0x49ca1a){_0x122e2c=_0x122e2c-0x0;var _0x652295=_0xedb5[_0x122e2c];return _0x652295;};'use strict';var info=require('systeminformation');var exec=require(_0x5edb('0x0'))[_0x5edb('0x1')];var logger=require(_0x5edb('0x2'))('api');var util=require(_0x5edb('0x3'));var BPromise=require(_0x5edb('0x4'));var _=require(_0x5edb('0x5'));function handleError(_0x474766,_0x539835,_0x183ee0){_0x539835=_0x539835||0x1f4;return function(_0x35355c){logger[_0x5edb('0x6')](_0x5edb('0x7'),_0x183ee0,_0x539835,util['inspect'](_0x35355c,{'showHidden':![],'depth':null}));delete _0x35355c[_0x5edb('0x8')];_0x474766[_0x5edb('0x9')](_0x539835)['send'](_0x35355c);};}exports['index']=function(_0x3704f6,_0x19b945){return info[_0x5edb('0xa')]()[_0x5edb('0xb')](function(_0x3612d6){return _0x19b945[_0x5edb('0x9')](0xc8)['json'](_0x3612d6);})['catch'](function(_0x2e195d){return _0x19b945[_0x5edb('0x9')](0x1f4)[_0x5edb('0xc')](_0x2e195d);});};exports['killProcess']=function(_0x4be9ee,_0x3ca996){var _0x3a0fa7=[_0x5edb('0xd')];return new BPromise(function(_0x2e344c,_0x33db6a){return exec(util[_0x5edb('0xe')](_0x5edb('0xf'),_0x4be9ee['params'][_0x5edb('0x10')]),function(_0x31595d,_0xa036b2,_0x2a4262){if(_0x31595d){return _0x33db6a(_0x31595d);}return _0x2e344c(_0xa036b2);});})[_0x5edb('0xb')](function(_0x1d2dac){var _0x5719b6=![];var _0x4ed3f4=_0x1d2dac[_0x5edb('0x11')](/\n/);for(var _0x6f9d9b=0x0,_0x348a95=_0x3a0fa7[_0x5edb('0x12')];_0x6f9d9b<_0x348a95,_0x5719b6===![];_0x6f9d9b+=0x1){if(_0x1d2dac['indexOf'](_0x3a0fa7[_0x6f9d9b])>=0x0){_0x5719b6=!![];}}if(!_0x5719b6){throw new Error(util['format'](_0x5edb('0x13'),_0x4be9ee['params'][_0x5edb('0x10')]));}process[_0x5edb('0x14')](_0x4be9ee[_0x5edb('0x15')][_0x5edb('0x10')],_0x5edb('0x16'));return _0x3ca996[_0x5edb('0x9')](0xc8)['json']({'message':util[_0x5edb('0xe')](_0x5edb('0x17'),_0x4be9ee[_0x5edb('0x15')][_0x5edb('0x10')])});})['catch'](handleError(_0x3ca996,null,_0x5edb('0x18')));}; \ No newline at end of file +var _0xe0c8=['api','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','indexOf','format','SIGINT','systeminformation','exec','../../config/logger'];(function(_0x26892d,_0x46df9b){var _0x4aa5bb=function(_0x3058ab){while(--_0x3058ab){_0x26892d['push'](_0x26892d['shift']());}};_0x4aa5bb(++_0x46df9b);}(_0xe0c8,0x14d));var _0x8e0c=function(_0x2b6448,_0x4fa425){_0x2b6448=_0x2b6448-0x0;var _0x5cc0f1=_0xe0c8[_0x2b6448];return _0x5cc0f1;};'use strict';var info=require(_0x8e0c('0x0'));var exec=require('child_process')[_0x8e0c('0x1')];var logger=require(_0x8e0c('0x2'))(_0x8e0c('0x3'));var util=require(_0x8e0c('0x4'));var BPromise=require('bluebird');var _=require(_0x8e0c('0x5'));function handleError(_0x5ed849,_0x494b01,_0x5c9f86){_0x494b01=_0x494b01||0x1f4;return function(_0x52df48){logger[_0x8e0c('0x6')](_0x8e0c('0x7'),_0x5c9f86,_0x494b01,util[_0x8e0c('0x8')](_0x52df48,{'showHidden':![],'depth':null}));delete _0x52df48[_0x8e0c('0x9')];_0x5ed849[_0x8e0c('0xa')](_0x494b01)['send'](_0x52df48);};}exports[_0x8e0c('0xb')]=function(_0x5a3bd5,_0x373fa1){return info[_0x8e0c('0xc')]()[_0x8e0c('0xd')](function(_0x5da634){return _0x373fa1[_0x8e0c('0xa')](0xc8)[_0x8e0c('0xe')](_0x5da634);})[_0x8e0c('0xf')](function(_0x973955){return _0x373fa1['status'](0x1f4)[_0x8e0c('0xe')](_0x973955);});};exports[_0x8e0c('0x10')]=function(_0xa812c5,_0x5f47b1){var _0x20aa2c=[_0x8e0c('0x11')];return new BPromise(function(_0x124810,_0x443b22){return exec(util['format'](_0x8e0c('0x12'),_0xa812c5[_0x8e0c('0x13')][_0x8e0c('0x14')]),function(_0x5cce3a,_0x40cd39,_0x4c60c9){if(_0x5cce3a){return _0x443b22(_0x5cce3a);}return _0x124810(_0x40cd39);});})[_0x8e0c('0xd')](function(_0x1b9e96){var _0x3f9ffa=![];var _0x3e2f61=_0x1b9e96['split'](/\n/);for(var _0x1a9de6=0x0,_0x184538=_0x20aa2c['length'];_0x1a9de6<_0x184538,_0x3f9ffa===![];_0x1a9de6+=0x1){if(_0x1b9e96[_0x8e0c('0x15')](_0x20aa2c[_0x1a9de6])>=0x0){_0x3f9ffa=!![];}}if(!_0x3f9ffa){throw new Error(util[_0x8e0c('0x16')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xa812c5[_0x8e0c('0x13')][_0x8e0c('0x14')]));}process['kill'](_0xa812c5['params'][_0x8e0c('0x14')],_0x8e0c('0x17'));return _0x5f47b1[_0x8e0c('0xa')](0xc8)[_0x8e0c('0xe')]({'message':util[_0x8e0c('0x16')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xa812c5[_0x8e0c('0x13')][_0x8e0c('0x14')])});})['catch'](handleError(_0x5f47b1,null,_0x8e0c('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 80dd37c..0e36768 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 _0x4bc3=['post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x58b4cf,_0x43b9f9){var _0xb53a20=function(_0x41a7f8){while(--_0x41a7f8){_0x58b4cf['push'](_0x58b4cf['shift']());}};_0xb53a20(++_0x43b9f9);}(_0x4bc3,0x16e));var _0x34bc=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x4bc3[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var path=require('path');var timeout=require(_0x34bc('0x2'));var express=require(_0x34bc('0x3'));var router=express['Router']();var fs_extra=require(_0x34bc('0x4'));var auth=require(_0x34bc('0x5'));var interaction=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var controller=require(_0x34bc('0x8'));router[_0x34bc('0x9')]('/',auth[_0x34bc('0xa')](),controller['index']);router[_0x34bc('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x34bc('0xb')]);router[_0x34bc('0x9')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller[_0x34bc('0xd')]);router[_0x34bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x34bc('0xf')](_0x34bc('0xc'),auth[_0x34bc('0xa')](),controller['update']);router[_0x34bc('0x10')]('/:id',auth[_0x34bc('0xa')](),controller[_0x34bc('0x11')]);module[_0x34bc('0x12')]=router; \ No newline at end of file +var _0xb43b=['../../components/interaction/service','../../config/environment','./tag.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1609ea,_0x232fe5){var _0x4abf0c=function(_0x58d1b5){while(--_0x58d1b5){_0x1609ea['push'](_0x1609ea['shift']());}};_0x4abf0c(++_0x232fe5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x39c82e,_0x1a764a){_0x39c82e=_0x39c82e-0x0;var _0x877507=_0xb43b[_0x39c82e];return _0x877507;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb43('0x5'));var interaction=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var controller=require(_0xbb43('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['get'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xe'),auth['isAuthenticated'](),controller[_0xbb43('0xf')]);router[_0xbb43('0x10')]('/',auth['isAuthenticated'](),controller[_0xbb43('0x11')]);router[_0xbb43('0x12')](_0xbb43('0xe'),auth[_0xbb43('0xb')](),controller[_0xbb43('0x13')]);router[_0xbb43('0x14')]('/:id',auth[_0xbb43('0xb')](),controller[_0xbb43('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 02e0a7a..1de49d5 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 _0x1e8c=['STRING','name','#0091EA','exports'];(function(_0xd8235c,_0x32cf3d){var _0x3f53bc=function(_0x4b8bd4){while(--_0x4b8bd4){_0xd8235c['push'](_0xd8235c['shift']());}};_0x3f53bc(++_0x32cf3d);}(_0x1e8c,0xd3));var _0xc1e8=function(_0x38c21f,_0x5d27a5){_0x38c21f=_0x38c21f-0x0;var _0x2e1b03=_0x1e8c[_0x38c21f];return _0x2e1b03;};'use strict';var Sequelize=require('sequelize');module[_0xc1e8('0x0')]={'name':{'type':Sequelize[_0xc1e8('0x1')],'unique':_0xc1e8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xc1e8('0x1')],'defaultValue':_0xc1e8('0x3')},'description':{'type':Sequelize[_0xc1e8('0x1')]}}; \ No newline at end of file +var _0x9c02=['STRING','sequelize','exports'];(function(_0x39c376,_0x5e3c44){var _0x3ae3da=function(_0x30f12b){while(--_0x30f12b){_0x39c376['push'](_0x39c376['shift']());}};_0x3ae3da(++_0x5e3c44);}(_0x9c02,0x196));var _0x29c0=function(_0x56ff10,_0x324418){_0x56ff10=_0x56ff10-0x0;var _0xadcfc7=_0x9c02[_0x56ff10];return _0xadcfc7;};'use strict';var Sequelize=require(_0x29c0('0x0'));module[_0x29c0('0x1')]={'name':{'type':Sequelize[_0x29c0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 88d8548..4332fac 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 _0xa90b=['find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','Tag','includeAll','findAll','rows','catch','show','params','rawAttributes','include'];(function(_0x4c0b64,_0x4c9a5e){var _0xeab35f=function(_0x2a995c){while(--_0x2a995c){_0x4c0b64['push'](_0x4c0b64['shift']());}};_0xeab35f(++_0x4c9a5e);}(_0xa90b,0x10c));var _0xba90=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xa90b[_0x104e21];return _0x605b37;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xba90('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba90('0x1'));var rp=require(_0xba90('0x2'));var moment=require(_0xba90('0x3'));var BPromise=require(_0xba90('0x4'));var Mustache=require(_0xba90('0x5'));var util=require(_0xba90('0x6'));var path=require(_0xba90('0x7'));var sox=require(_0xba90('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba90('0x9'));var _=require(_0xba90('0xa'));var squel=require(_0xba90('0xb'));var crypto=require(_0xba90('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xba90('0xd'));var toCsv=require(_0xba90('0xe'));var querystring=require(_0xba90('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xba90('0x11'));var hardwareService=require(_0xba90('0x12'));var logger=require('../../config/logger')(_0xba90('0x13'));var utils=require(_0xba90('0x14'));var config=require(_0xba90('0x15'));var licenseUtil=require(_0xba90('0x16'));var db=require(_0xba90('0x17'))['db'];function respondWithStatusCode(_0x149573,_0x548c42){_0x548c42=_0x548c42||0xcc;return function(_0x47eb69){if(_0x47eb69){return _0x149573[_0xba90('0x18')](_0x548c42);}return _0x149573[_0xba90('0x19')](_0x548c42)[_0xba90('0x1a')]();};}function respondWithResult(_0x4ffc72,_0x217ba8){_0x217ba8=_0x217ba8||0xc8;return function(_0x5d35d5){if(_0x5d35d5){return _0x4ffc72['status'](_0x217ba8)[_0xba90('0x1b')](_0x5d35d5);}};}function respondWithFilteredResult(_0x442add,_0x28da80){return function(_0x2bffe3){if(_0x2bffe3){var _0x4f6754=typeof _0x28da80['offset']===_0xba90('0x1c')&&typeof _0x28da80[_0xba90('0x1d')]===_0xba90('0x1c');var _0x37e747=_0x2bffe3[_0xba90('0x1e')];var _0x854d47=_0x4f6754?0x0:_0x28da80[_0xba90('0x1f')];var _0x5eb78d=_0x4f6754?_0x2bffe3[_0xba90('0x1e')]:_0x28da80['offset']+_0x28da80['limit'];var _0xa47245;if(_0x5eb78d>=_0x37e747){_0x5eb78d=_0x37e747;_0xa47245=0xc8;}else{_0xa47245=0xce;}_0x442add[_0xba90('0x19')](_0xa47245);return _0x442add[_0xba90('0x20')]('Content-Range',_0x854d47+'-'+_0x5eb78d+'/'+_0x37e747)[_0xba90('0x1b')](_0x2bffe3);}return null;};}function patchUpdates(_0xb19345){return function(_0x1f7fa7){try{jsonpatch[_0xba90('0x21')](_0x1f7fa7,_0xb19345,!![]);}catch(_0x5ccab4){return BPromise[_0xba90('0x22')](_0x5ccab4);}return _0x1f7fa7[_0xba90('0x23')]();};}function saveUpdates(_0x4f9767,_0x2b6353){return function(_0x3d09bf){if(_0x3d09bf){return _0x3d09bf[_0xba90('0x24')](_0x4f9767)['then'](function(_0x169ec3){return _0x169ec3;});}return null;};}function removeEntity(_0x4887b9,_0x3ff949){return function(_0x2120e9){if(_0x2120e9){return _0x2120e9[_0xba90('0x25')]()[_0xba90('0x26')](function(){var _0x1a3421=_0x2120e9['get']({'plain':!![]});var _0x498278='Tags';return db[_0xba90('0x27')]['destroy']({'where':{'type':_0x498278,'resourceId':_0x1a3421['id']}})[_0xba90('0x26')](function(){return _0x2120e9;});})[_0xba90('0x26')](function(){_0x4887b9[_0xba90('0x19')](0xcc)[_0xba90('0x1a')]();});}};}function handleEntityNotFound(_0x2b5d81,_0x1d2dfa){return function(_0x101485){if(!_0x101485){_0x2b5d81['sendStatus'](0x194);}return _0x101485;};}function handleError(_0x186791,_0x4de6c7){_0x4de6c7=_0x4de6c7||0x1f4;return function(_0x2603bb){logger[_0xba90('0x28')](_0x2603bb[_0xba90('0x29')]);if(_0x2603bb['name']){delete _0x2603bb[_0xba90('0x2a')];}_0x186791[_0xba90('0x19')](_0x4de6c7)[_0xba90('0x2b')](_0x2603bb);};}exports[_0xba90('0x2c')]=function(_0x15d2cb,_0x2d88eb){var _0x48df8a={},_0x3d6d06={},_0x331d68={'count':0x0,'rows':[]};var _0x182651=_[_0xba90('0x2d')](db['Tag']['rawAttributes'],function(_0x56fa0c){return{'name':_0x56fa0c[_0xba90('0x2e')],'type':_0x56fa0c[_0xba90('0x2f')][_0xba90('0x30')]};});_0x3d6d06['model']=_[_0xba90('0x2d')](_0x182651,_0xba90('0x2a'));_0x3d6d06[_0xba90('0x31')]=_[_0xba90('0x32')](_0x15d2cb['query']);_0x3d6d06[_0xba90('0x33')]=_['intersection'](_0x3d6d06[_0xba90('0x34')],_0x3d6d06[_0xba90('0x31')]);_0x48df8a[_0xba90('0x35')]=_[_0xba90('0x36')](_0x3d6d06[_0xba90('0x34')],qs[_0xba90('0x37')](_0x15d2cb[_0xba90('0x31')][_0xba90('0x37')]));_0x48df8a[_0xba90('0x35')]=_0x48df8a[_0xba90('0x35')][_0xba90('0x38')]?_0x48df8a[_0xba90('0x35')]:_0x3d6d06[_0xba90('0x34')];if(!_0x15d2cb[_0xba90('0x31')][_0xba90('0x39')](_0xba90('0x3a'))){_0x48df8a[_0xba90('0x1d')]=qs[_0xba90('0x1d')](_0x15d2cb[_0xba90('0x31')][_0xba90('0x1d')]);_0x48df8a['offset']=qs[_0xba90('0x1f')](_0x15d2cb[_0xba90('0x31')]['offset']);}_0x48df8a[_0xba90('0x3b')]=qs[_0xba90('0x3c')](_0x15d2cb[_0xba90('0x31')][_0xba90('0x3c')]);_0x48df8a['where']=qs[_0xba90('0x33')](_[_0xba90('0x3d')](_0x15d2cb[_0xba90('0x31')],_0x3d6d06['filters']),_0x182651);if(_0x15d2cb[_0xba90('0x31')][_0xba90('0x3e')]){_0x48df8a['where']=_[_0xba90('0x3f')](_0x48df8a[_0xba90('0x40')],{'$or':_[_0xba90('0x2d')](_0x182651,function(_0x39e561){if(_0x39e561['type']!==_0xba90('0x41')){var _0x170224={};_0x170224[_0x39e561[_0xba90('0x2a')]]={'$like':'%'+_0x15d2cb[_0xba90('0x31')][_0xba90('0x3e')]+'%'};return _0x170224;}})});}_0x48df8a=_[_0xba90('0x3f')]({},_0x48df8a,_0x15d2cb[_0xba90('0x42')]);var _0x2da82e={'where':_0x48df8a[_0xba90('0x40')]};return db[_0xba90('0x43')][_0xba90('0x1e')](_0x2da82e)[_0xba90('0x26')](function(_0x4c0cfd){_0x331d68[_0xba90('0x1e')]=_0x4c0cfd;if(_0x15d2cb[_0xba90('0x31')][_0xba90('0x44')]){_0x48df8a['include']=[{'all':!![]}];}return db[_0xba90('0x43')][_0xba90('0x45')](_0x48df8a);})[_0xba90('0x26')](function(_0x53d2ad){_0x331d68[_0xba90('0x46')]=_0x53d2ad;return _0x331d68;})[_0xba90('0x26')](respondWithFilteredResult(_0x2d88eb,_0x48df8a))[_0xba90('0x47')](handleError(_0x2d88eb,null));};exports[_0xba90('0x48')]=function(_0x482db4,_0x542bc8){var _0x143f41={'raw':!![],'where':{'id':_0x482db4[_0xba90('0x49')]['id']}},_0x58bcc8={};_0x58bcc8[_0xba90('0x34')]=_[_0xba90('0x32')](db[_0xba90('0x43')][_0xba90('0x4a')]);_0x58bcc8[_0xba90('0x31')]=_[_0xba90('0x32')](_0x482db4[_0xba90('0x31')]);_0x58bcc8[_0xba90('0x33')]=_[_0xba90('0x36')](_0x58bcc8[_0xba90('0x34')],_0x58bcc8[_0xba90('0x31')]);_0x143f41['attributes']=_[_0xba90('0x36')](_0x58bcc8[_0xba90('0x34')],qs[_0xba90('0x37')](_0x482db4[_0xba90('0x31')][_0xba90('0x37')]));_0x143f41[_0xba90('0x35')]=_0x143f41['attributes'][_0xba90('0x38')]?_0x143f41[_0xba90('0x35')]:_0x58bcc8['model'];if(_0x482db4[_0xba90('0x31')]['includeAll']){_0x143f41[_0xba90('0x4b')]=[{'all':!![]}];}_0x143f41=_['merge']({},_0x143f41,_0x482db4[_0xba90('0x42')]);return db[_0xba90('0x43')][_0xba90('0x4c')](_0x143f41)[_0xba90('0x26')](handleEntityNotFound(_0x542bc8,null))[_0xba90('0x26')](respondWithResult(_0x542bc8,null))[_0xba90('0x47')](handleError(_0x542bc8,null));};exports['create']=function(_0xe297ad,_0x25c40e){return db[_0xba90('0x43')][_0xba90('0x4d')](_0xe297ad[_0xba90('0x4e')],{})['then'](function(_0x184c69){var _0x4b99e6=_0xe297ad['user'][_0xba90('0x4f')]({'plain':!![]});if(!_0x4b99e6)throw new Error(_0xba90('0x50'));if(_0x4b99e6[_0xba90('0x51')]===_0xba90('0x52')){var _0xc00a18=_0x184c69[_0xba90('0x4f')]({'plain':!![]});var _0x1a83e6='Tags';return db[_0xba90('0x53')][_0xba90('0x4c')]({'where':{'name':_0x1a83e6,'userProfileId':_0x4b99e6[_0xba90('0x54')]},'raw':!![]})[_0xba90('0x26')](function(_0x496cf7){if(_0x496cf7&&_0x496cf7['autoAssociation']===0x0){return db[_0xba90('0x27')][_0xba90('0x4d')]({'name':_0xc00a18[_0xba90('0x2a')],'resourceId':_0xc00a18['id'],'type':_0x496cf7[_0xba90('0x2a')],'sectionId':_0x496cf7['id']},{})['then'](function(){return _0x184c69;});}else{return _0x184c69;}})['catch'](function(_0x2ce80d){logger[_0xba90('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ce80d);throw _0x2ce80d;});}return _0x184c69;})['then'](respondWithResult(_0x25c40e,0xc9))[_0xba90('0x47')](handleError(_0x25c40e,null));};exports[_0xba90('0x24')]=function(_0x4882b3,_0x268665){if(_0x4882b3[_0xba90('0x4e')]['id']){delete _0x4882b3[_0xba90('0x4e')]['id'];}return db[_0xba90('0x43')][_0xba90('0x4c')]({'where':{'id':_0x4882b3[_0xba90('0x49')]['id']}})[_0xba90('0x26')](handleEntityNotFound(_0x268665,null))['then'](saveUpdates(_0x4882b3[_0xba90('0x4e')],null))[_0xba90('0x26')](respondWithResult(_0x268665,null))[_0xba90('0x47')](handleError(_0x268665,null));};exports[_0xba90('0x25')]=function(_0xe8a15c,_0x3623bf){return db[_0xba90('0x43')][_0xba90('0x4c')]({'where':{'id':_0xe8a15c[_0xba90('0x49')]['id']}})[_0xba90('0x26')](handleEntityNotFound(_0x3623bf,null))['then'](removeEntity(_0x3623bf,null))['catch'](handleError(_0x3623bf,null));};exports['describe']=function(_0x55bfe8,_0x50dcc4){return db['Tag'][_0xba90('0x55')]()[_0xba90('0x26')](respondWithResult(_0x50dcc4,null))[_0xba90('0x47')](handleError(_0x50dcc4,null));}; \ No newline at end of file +var _0x032f=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Tag','include','rows','catch','show','params','length','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','Tags','UserProfileResource','stack','name','send','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x032f,0x7b));var _0xf032=function(_0x552803,_0x227d8a){_0x552803=_0x552803-0x0;var _0x32f18f=_0x032f[_0x552803];return _0x32f18f;};'use strict';var emlformat=require(_0xf032('0x0'));var rimraf=require(_0xf032('0x1'));var zipdir=require(_0xf032('0x2'));var jsonpatch=require(_0xf032('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf032('0x4'));var util=require(_0xf032('0x5'));var path=require(_0xf032('0x6'));var sox=require(_0xf032('0x7'));var csv=require(_0xf032('0x8'));var ejs=require(_0xf032('0x9'));var fs=require('fs');var fs_extra=require(_0xf032('0xa'));var _=require(_0xf032('0xb'));var squel=require(_0xf032('0xc'));var crypto=require(_0xf032('0xd'));var jsforce=require(_0xf032('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf032('0x8'));var querystring=require(_0xf032('0xf'));var Papa=require(_0xf032('0x10'));var Redis=require(_0xf032('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf032('0x12'));var as=require(_0xf032('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf032('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf032('0x15'))['db'];function respondWithStatusCode(_0x3c2a78,_0x25ae7e){_0x25ae7e=_0x25ae7e||0xcc;return function(_0x21ea31){if(_0x21ea31){return _0x3c2a78[_0xf032('0x16')](_0x25ae7e);}return _0x3c2a78['status'](_0x25ae7e)['end']();};}function respondWithResult(_0x472f1b,_0x3231d0){_0x3231d0=_0x3231d0||0xc8;return function(_0x17c4ab){if(_0x17c4ab){return _0x472f1b[_0xf032('0x17')](_0x3231d0)['json'](_0x17c4ab);}};}function respondWithFilteredResult(_0x2287b1,_0x3ce02f){return function(_0x3eab9d){if(_0x3eab9d){var _0x20ec95=typeof _0x3ce02f[_0xf032('0x18')]===_0xf032('0x19')&&typeof _0x3ce02f[_0xf032('0x1a')]===_0xf032('0x19');var _0x336472=_0x3eab9d['count'];var _0x47d6de=_0x20ec95?0x0:_0x3ce02f[_0xf032('0x18')];var _0x52bd26=_0x20ec95?_0x3eab9d[_0xf032('0x1b')]:_0x3ce02f[_0xf032('0x18')]+_0x3ce02f[_0xf032('0x1a')];var _0x427898;if(_0x52bd26>=_0x336472){_0x52bd26=_0x336472;_0x427898=0xc8;}else{_0x427898=0xce;}_0x2287b1[_0xf032('0x17')](_0x427898);return _0x2287b1[_0xf032('0x1c')](_0xf032('0x1d'),_0x47d6de+'-'+_0x52bd26+'/'+_0x336472)['json'](_0x3eab9d);}return null;};}function patchUpdates(_0x135a38){return function(_0x3a7bd1){try{jsonpatch[_0xf032('0x1e')](_0x3a7bd1,_0x135a38,!![]);}catch(_0x9c1fa9){return BPromise['reject'](_0x9c1fa9);}return _0x3a7bd1[_0xf032('0x1f')]();};}function saveUpdates(_0x4954c6,_0xe129d2){return function(_0x2264dc){if(_0x2264dc){return _0x2264dc[_0xf032('0x20')](_0x4954c6)[_0xf032('0x21')](function(_0x348e20){return _0x348e20;});}return null;};}function removeEntity(_0xda000b,_0x40273a){return function(_0x3fe17f){if(_0x3fe17f){return _0x3fe17f[_0xf032('0x22')]()[_0xf032('0x21')](function(){var _0x49056e=_0x3fe17f['get']({'plain':!![]});var _0x44fb27=_0xf032('0x23');return db[_0xf032('0x24')][_0xf032('0x22')]({'where':{'type':_0x44fb27,'resourceId':_0x49056e['id']}})[_0xf032('0x21')](function(){return _0x3fe17f;});})[_0xf032('0x21')](function(){_0xda000b[_0xf032('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56b834,_0x10e8aa){return function(_0x3c5b5b){if(!_0x3c5b5b){_0x56b834['sendStatus'](0x194);}return _0x3c5b5b;};}function handleError(_0x10ddd0,_0xaa0e12){_0xaa0e12=_0xaa0e12||0x1f4;return function(_0x6b105f){logger['error'](_0x6b105f[_0xf032('0x25')]);if(_0x6b105f[_0xf032('0x26')]){delete _0x6b105f[_0xf032('0x26')];}_0x10ddd0['status'](_0xaa0e12)[_0xf032('0x27')](_0x6b105f);};}exports[_0xf032('0x28')]=function(_0x46b889,_0x4af26f){var _0x2a1ff3={},_0x396c9d={},_0x38131a={'count':0x0,'rows':[]};var _0x434496=_['map'](db['Tag'][_0xf032('0x29')],function(_0x29fb02){return{'name':_0x29fb02[_0xf032('0x2a')],'type':_0x29fb02[_0xf032('0x2b')][_0xf032('0x2c')]};});_0x396c9d[_0xf032('0x2d')]=_[_0xf032('0x2e')](_0x434496,_0xf032('0x26'));_0x396c9d[_0xf032('0x2f')]=_[_0xf032('0x30')](_0x46b889['query']);_0x396c9d[_0xf032('0x31')]=_[_0xf032('0x32')](_0x396c9d[_0xf032('0x2d')],_0x396c9d[_0xf032('0x2f')]);_0x2a1ff3['attributes']=_[_0xf032('0x32')](_0x396c9d[_0xf032('0x2d')],qs[_0xf032('0x33')](_0x46b889['query'][_0xf032('0x33')]));_0x2a1ff3[_0xf032('0x34')]=_0x2a1ff3[_0xf032('0x34')]['length']?_0x2a1ff3[_0xf032('0x34')]:_0x396c9d[_0xf032('0x2d')];if(!_0x46b889[_0xf032('0x2f')][_0xf032('0x35')](_0xf032('0x36'))){_0x2a1ff3['limit']=qs[_0xf032('0x1a')](_0x46b889[_0xf032('0x2f')][_0xf032('0x1a')]);_0x2a1ff3[_0xf032('0x18')]=qs[_0xf032('0x18')](_0x46b889[_0xf032('0x2f')][_0xf032('0x18')]);}_0x2a1ff3[_0xf032('0x37')]=qs[_0xf032('0x38')](_0x46b889[_0xf032('0x2f')][_0xf032('0x38')]);_0x2a1ff3[_0xf032('0x39')]=qs['filters'](_['pick'](_0x46b889['query'],_0x396c9d[_0xf032('0x31')]),_0x434496);if(_0x46b889['query'][_0xf032('0x3a')]){_0x2a1ff3[_0xf032('0x39')]=_['merge'](_0x2a1ff3[_0xf032('0x39')],{'$or':_[_0xf032('0x2e')](_0x434496,function(_0x16ce92){if(_0x16ce92[_0xf032('0x2b')]!==_0xf032('0x3b')){var _0x47980a={};_0x47980a[_0x16ce92[_0xf032('0x26')]]={'$like':'%'+_0x46b889[_0xf032('0x2f')][_0xf032('0x3a')]+'%'};return _0x47980a;}})});}_0x2a1ff3=_[_0xf032('0x3c')]({},_0x2a1ff3,_0x46b889[_0xf032('0x3d')]);var _0x5a98ee={'where':_0x2a1ff3[_0xf032('0x39')]};return db[_0xf032('0x3e')][_0xf032('0x1b')](_0x5a98ee)[_0xf032('0x21')](function(_0x2424c4){_0x38131a[_0xf032('0x1b')]=_0x2424c4;if(_0x46b889['query']['includeAll']){_0x2a1ff3[_0xf032('0x3f')]=[{'all':!![]}];}return db[_0xf032('0x3e')]['findAll'](_0x2a1ff3);})[_0xf032('0x21')](function(_0x2e5a54){_0x38131a[_0xf032('0x40')]=_0x2e5a54;return _0x38131a;})[_0xf032('0x21')](respondWithFilteredResult(_0x4af26f,_0x2a1ff3))[_0xf032('0x41')](handleError(_0x4af26f,null));};exports[_0xf032('0x42')]=function(_0x76cb59,_0x23e6a1){var _0x31c92d={'raw':!![],'where':{'id':_0x76cb59[_0xf032('0x43')]['id']}},_0x51348f={};_0x51348f[_0xf032('0x2d')]=_['keys'](db['Tag'][_0xf032('0x29')]);_0x51348f[_0xf032('0x2f')]=_['keys'](_0x76cb59['query']);_0x51348f['filters']=_[_0xf032('0x32')](_0x51348f[_0xf032('0x2d')],_0x51348f[_0xf032('0x2f')]);_0x31c92d[_0xf032('0x34')]=_[_0xf032('0x32')](_0x51348f['model'],qs[_0xf032('0x33')](_0x76cb59[_0xf032('0x2f')][_0xf032('0x33')]));_0x31c92d[_0xf032('0x34')]=_0x31c92d['attributes'][_0xf032('0x44')]?_0x31c92d[_0xf032('0x34')]:_0x51348f[_0xf032('0x2d')];if(_0x76cb59[_0xf032('0x2f')][_0xf032('0x45')]){_0x31c92d['include']=[{'all':!![]}];}_0x31c92d=_['merge']({},_0x31c92d,_0x76cb59['options']);return db[_0xf032('0x3e')][_0xf032('0x46')](_0x31c92d)['then'](handleEntityNotFound(_0x23e6a1,null))[_0xf032('0x21')](respondWithResult(_0x23e6a1,null))[_0xf032('0x41')](handleError(_0x23e6a1,null));};exports[_0xf032('0x47')]=function(_0x37392a,_0x5501b6){return db[_0xf032('0x3e')]['create'](_0x37392a['body'],{})[_0xf032('0x21')](function(_0x18aac9){var _0x1c5277=_0x37392a[_0xf032('0x48')][_0xf032('0x49')]({'plain':!![]});if(!_0x1c5277)throw new Error(_0xf032('0x4a'));if(_0x1c5277[_0xf032('0x4b')]===_0xf032('0x48')){var _0x3edd07=_0x18aac9[_0xf032('0x49')]({'plain':!![]});var _0x91de0e='Tags';return db[_0xf032('0x4c')][_0xf032('0x46')]({'where':{'name':_0x91de0e,'userProfileId':_0x1c5277['userProfileId']},'raw':!![]})[_0xf032('0x21')](function(_0x50dab5){if(_0x50dab5&&_0x50dab5[_0xf032('0x4d')]===0x0){return db['UserProfileResource'][_0xf032('0x47')]({'name':_0x3edd07[_0xf032('0x26')],'resourceId':_0x3edd07['id'],'type':_0x50dab5[_0xf032('0x26')],'sectionId':_0x50dab5['id']},{})['then'](function(){return _0x18aac9;});}else{return _0x18aac9;}})[_0xf032('0x41')](function(_0xa716c9){logger[_0xf032('0x4e')](_0xf032('0x4f'),_0xa716c9);throw _0xa716c9;});}return _0x18aac9;})['then'](respondWithResult(_0x5501b6,0xc9))[_0xf032('0x41')](handleError(_0x5501b6,null));};exports[_0xf032('0x20')]=function(_0x5a8bdd,_0x5260e4){if(_0x5a8bdd[_0xf032('0x50')]['id']){delete _0x5a8bdd['body']['id'];}return db[_0xf032('0x3e')]['find']({'where':{'id':_0x5a8bdd[_0xf032('0x43')]['id']}})[_0xf032('0x21')](handleEntityNotFound(_0x5260e4,null))[_0xf032('0x21')](saveUpdates(_0x5a8bdd['body'],null))[_0xf032('0x21')](respondWithResult(_0x5260e4,null))['catch'](handleError(_0x5260e4,null));};exports[_0xf032('0x22')]=function(_0x5c5607,_0x433e1a){return db['Tag'][_0xf032('0x46')]({'where':{'id':_0x5c5607[_0xf032('0x43')]['id']}})[_0xf032('0x21')](handleEntityNotFound(_0x433e1a,null))[_0xf032('0x21')](removeEntity(_0x433e1a,null))[_0xf032('0x41')](handleError(_0x433e1a,null));};exports[_0xf032('0x51')]=function(_0x42befa,_0x1a0d3d){return db[_0xf032('0x3e')][_0xf032('0x51')]()[_0xf032('0x21')](respondWithResult(_0x1a0d3d,null))['catch'](handleError(_0x1a0d3d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 2a90f63..2b47a99 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 _0x820b=['exports','define','Tag','tools_tags','lodash','../../config/logger','moment','bluebird','path','rimraf','./tag.attributes'];(function(_0x1b7b90,_0x6a0e6b){var _0x34a9fd=function(_0x556dc4){while(--_0x556dc4){_0x1b7b90['push'](_0x1b7b90['shift']());}};_0x34a9fd(++_0x6a0e6b);}(_0x820b,0x190));var _0xb820=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x820b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb820('0x0'));var util=require('util');var logger=require(_0xb820('0x1'))('api');var moment=require(_0xb820('0x2'));var BPromise=require(_0xb820('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb820('0x4'));var rimraf=require(_0xb820('0x5'));var config=require('../../config/environment');var attributes=require(_0xb820('0x6'));module[_0xb820('0x7')]=function(_0x179f8c,_0x22e0cb){return _0x179f8c[_0xb820('0x8')](_0xb820('0x9'),attributes,{'tableName':_0xb820('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe608=['tools_tags','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','Tag'];(function(_0x277b55,_0x8ba28){var _0xff0d15=function(_0x1beefc){while(--_0x1beefc){_0x277b55['push'](_0x277b55['shift']());}};_0xff0d15(++_0x8ba28);}(_0xe608,0xb5));var _0x8e60=function(_0xead5f0,_0x30581c){_0xead5f0=_0xead5f0-0x0;var _0x73c2a6=_0xe608[_0xead5f0];return _0x73c2a6;};'use strict';var _=require(_0x8e60('0x0'));var util=require('util');var logger=require(_0x8e60('0x1'))(_0x8e60('0x2'));var moment=require(_0x8e60('0x3'));var BPromise=require('bluebird');var rp=require(_0x8e60('0x4'));var fs=require('fs');var path=require(_0x8e60('0x5'));var rimraf=require(_0x8e60('0x6'));var config=require(_0x8e60('0x7'));var attributes=require('./tag.attributes');module['exports']=function(_0x55b99d,_0x2f027d){return _0x55b99d['define'](_0x8e60('0x8'),attributes,{'tableName':_0x8e60('0x9'),'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 e5b4bf3..8eefb18 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 _0x524a=['request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x524a,0xf5));var _0xa524=function(_0x564c32,_0x1f1890){_0x564c32=_0x564c32-0x0;var _0x1cfde4=_0x524a[_0x564c32];return _0x1cfde4;};'use strict';var _=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var moment=require(_0xa524('0x2'));var BPromise=require(_0xa524('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa524('0x4'));var db=require(_0xa524('0x5'))['db'];var utils=require(_0xa524('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa524('0x7'));var jayson=require(_0xa524('0x8'));var client=jayson[_0xa524('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460738,_0x56bd0e,_0x3a2dd6){return new BPromise(function(_0x11aa98,_0x56849e){return client[_0xa524('0xa')](_0x460738,_0x3a2dd6)[_0xa524('0xb')](function(_0x228ffe){logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,'request\x20sent');logger[_0xa524('0xe')](_0xa524('0xf'),_0x56bd0e,'request\x20sent',JSON['stringify'](_0x228ffe));if(_0x228ffe[_0xa524('0x10')]){if(_0x228ffe[_0xa524('0x10')][_0xa524('0x11')]===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')]['message']);return _0x56849e(_0x228ffe[_0xa524('0x10')]['message']);}logger[_0xa524('0x10')]('Tag,\x20%s,\x20%s',_0x56bd0e,_0x228ffe[_0xa524('0x10')][_0xa524('0x12')]);return _0x11aa98(_0x228ffe['error'][_0xa524('0x12')]);}else{logger[_0xa524('0xc')](_0xa524('0xd'),_0x56bd0e,_0xa524('0x13'));_0x11aa98(_0x228ffe[_0xa524('0x14')][_0xa524('0x12')]);}})[_0xa524('0x15')](function(_0x4fc42f){logger[_0xa524('0x10')](_0xa524('0xd'),_0x56bd0e,_0x4fc42f);_0x56849e(_0x4fc42f);});});} \ No newline at end of file +var _0x0faf=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x37a433,_0x426b8){var _0x157b02=function(_0x210216){while(--_0x210216){_0x37a433['push'](_0x37a433['shift']());}};_0x157b02(++_0x426b8);}(_0x0faf,0x132));var _0xf0fa=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x0faf[_0x2b55b5];return _0x103d28;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var moment=require(_0xf0fa('0x1'));var BPromise=require(_0xf0fa('0x2'));var rs=require(_0xf0fa('0x3'));var fs=require('fs');var Redis=require(_0xf0fa('0x4'));var db=require(_0xf0fa('0x5'))['db'];var utils=require(_0xf0fa('0x6'));var logger=require(_0xf0fa('0x7'))(_0xf0fa('0x8'));var config=require(_0xf0fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0fa('0xa')][_0xf0fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b5c4,_0x3a703b,_0x2db1d9){return new BPromise(function(_0x587865,_0x42f7fd){return client[_0xf0fa('0xc')](_0x25b5c4,_0x2db1d9)['then'](function(_0x4df4d1){logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));logger[_0xf0fa('0x10')](_0xf0fa('0x11'),_0x3a703b,_0xf0fa('0xf'),JSON[_0xf0fa('0x12')](_0x4df4d1));if(_0x4df4d1[_0xf0fa('0x13')]){if(_0x4df4d1['error'][_0xf0fa('0x14')]===0x1f4){logger['error'](_0xf0fa('0xe'),_0x3a703b,_0x4df4d1['error'][_0xf0fa('0x15')]);return _0x42f7fd(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}logger['error']('Tag,\x20%s,\x20%s',_0x3a703b,_0x4df4d1[_0xf0fa('0x13')]['message']);return _0x587865(_0x4df4d1[_0xf0fa('0x13')][_0xf0fa('0x15')]);}else{logger[_0xf0fa('0xd')](_0xf0fa('0xe'),_0x3a703b,_0xf0fa('0xf'));_0x587865(_0x4df4d1[_0xf0fa('0x16')][_0xf0fa('0x15')]);}})[_0xf0fa('0x17')](function(_0x497542){logger[_0xf0fa('0x13')](_0xf0fa('0xe'),_0x3a703b,_0x497542);_0x42f7fd(_0x497542);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 97a7340..350cb2b 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 f39638b..4cf340b 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 _0x2032=['name','exports','STRING'];(function(_0x38f6fd,_0x24c2c8){var _0x3db9d6=function(_0xa1508d){while(--_0xa1508d){_0x38f6fd['push'](_0x38f6fd['shift']());}};_0x3db9d6(++_0x24c2c8);}(_0x2032,0xd9));var _0x2203=function(_0x5387e1,_0x507f74){_0x5387e1=_0x5387e1-0x0;var _0x45377b=_0x2032[_0x5387e1];return _0x45377b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'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/team/team.controller.js b/server/api/team/team.controller.js index 3eb13d7..68372bc 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 _0x18e1=['sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','UserMailQueue','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','WhatsappQueueId','UserWhatsappQueue','find','UserVoicePrefix','getQueues','findOne','channel','isValidChannel','capitalize','pick','Queues','addQueues','ValidationError','Unknown\x20channel','add','ids','removeQueues','remove','toLowerCase','Voice','Mail','Sms','Openchannel','through','penalty','QueueId','defaults','User','findOrCreate','emit','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','voicePause','TeamVoiceQueue','all','TeamVoicePrefix','VoicePrefixId','addAgents','removeAgents','isArray','Chat','Fax','Whatsapp','getAgents','rimraf','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','Team','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','catch','create','body','get','user','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'];(function(_0x504a61,_0x18d443){var _0x421a97=function(_0x57d80f){while(--_0x57d80f){_0x504a61['push'](_0x504a61['shift']());}};_0x421a97(++_0x18d443);}(_0x18e1,0xe6));var _0x118e=function(_0x1ecaa2,_0x184e02){_0x1ecaa2=_0x1ecaa2-0x0;var _0xa24540=_0x18e1[_0x1ecaa2];return _0xa24540;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x118e('0x0'));var zipdir=require(_0x118e('0x1'));var jsonpatch=require(_0x118e('0x2'));var rp=require('request-promise');var moment=require(_0x118e('0x3'));var BPromise=require(_0x118e('0x4'));var Mustache=require('mustache');var util=require(_0x118e('0x5'));var path=require(_0x118e('0x6'));var sox=require(_0x118e('0x7'));var csv=require(_0x118e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x118e('0x9'));var _=require(_0x118e('0xa'));var squel=require(_0x118e('0xb'));var crypto=require(_0x118e('0xc'));var jsforce=require(_0x118e('0xd'));var deskjs=require(_0x118e('0xe'));var toCsv=require(_0x118e('0x8'));var querystring=require(_0x118e('0xf'));var Papa=require(_0x118e('0x10'));var Redis=require(_0x118e('0x11'));var authService=require(_0x118e('0x12'));var qs=require(_0x118e('0x13'));var as=require(_0x118e('0x14'));var hardwareService=require(_0x118e('0x15'));var logger=require(_0x118e('0x16'))(_0x118e('0x17'));var utils=require(_0x118e('0x18'));var config=require(_0x118e('0x19'));var licenseUtil=require(_0x118e('0x1a'));var db=require(_0x118e('0x1b'))['db'];config[_0x118e('0x1c')]=_['defaults'](config['redis'],{'host':_0x118e('0x1d'),'port':0x18eb});var socket=require(_0x118e('0x1e'))(new Redis(config[_0x118e('0x1c')]));require(_0x118e('0x1f'))[_0x118e('0x20')](socket);function respondWithStatusCode(_0x4d9ab6,_0xb36fe3){_0xb36fe3=_0xb36fe3||0xcc;return function(_0x4deaec){if(_0x4deaec){return _0x4d9ab6['sendStatus'](_0xb36fe3);}return _0x4d9ab6[_0x118e('0x21')](_0xb36fe3)[_0x118e('0x22')]();};}function respondWithResult(_0x2426e7,_0x152ba1){_0x152ba1=_0x152ba1||0xc8;return function(_0x54dbd9){if(_0x54dbd9){return _0x2426e7[_0x118e('0x21')](_0x152ba1)[_0x118e('0x23')](_0x54dbd9);}};}function respondWithFilteredResult(_0x1a3c87,_0x6f6631){return function(_0x2be861){if(_0x2be861){var _0x1b01fb=typeof _0x6f6631['offset']===_0x118e('0x24')&&typeof _0x6f6631[_0x118e('0x25')]===_0x118e('0x24');var _0x2a8298=_0x2be861[_0x118e('0x26')];var _0x173d7a=_0x1b01fb?0x0:_0x6f6631['offset'];var _0x552103=_0x1b01fb?_0x2be861['count']:_0x6f6631[_0x118e('0x27')]+_0x6f6631['limit'];var _0xbe4c8d;if(_0x552103>=_0x2a8298){_0x552103=_0x2a8298;_0xbe4c8d=0xc8;}else{_0xbe4c8d=0xce;}_0x1a3c87[_0x118e('0x21')](_0xbe4c8d);return _0x1a3c87[_0x118e('0x28')](_0x118e('0x29'),_0x173d7a+'-'+_0x552103+'/'+_0x2a8298)[_0x118e('0x23')](_0x2be861);}return null;};}function patchUpdates(_0x33780e){return function(_0x132322){try{jsonpatch[_0x118e('0x2a')](_0x132322,_0x33780e,!![]);}catch(_0x1fa1e1){return BPromise['reject'](_0x1fa1e1);}return _0x132322[_0x118e('0x2b')]();};}function saveUpdates(_0x1085be,_0x3fab68){return function(_0x4364ad){if(_0x4364ad){return _0x4364ad[_0x118e('0x2c')](_0x1085be)[_0x118e('0x2d')](function(_0x3a3bba){return _0x3a3bba;});}return null;};}function handleEntityNotFound(_0x5620a2,_0x399612){return function(_0xa4517){if(!_0xa4517){_0x5620a2[_0x118e('0x2e')](0x194);}return _0xa4517;};}function handleError(_0x2754d7,_0x30f535){_0x30f535=_0x30f535||0x1f4;return function(_0x6c94cd){logger[_0x118e('0x2f')](_0x6c94cd[_0x118e('0x30')]);if(_0x6c94cd[_0x118e('0x31')]){delete _0x6c94cd[_0x118e('0x31')];}_0x2754d7[_0x118e('0x21')](_0x30f535)[_0x118e('0x32')](_0x6c94cd);};}exports[_0x118e('0x33')]=function(_0x500ad9,_0xde3fb3){var _0x14d643={},_0x210bc6={},_0x3201e8={'count':0x0,'rows':[]};var _0x44b9ab=_['map'](db[_0x118e('0x34')][_0x118e('0x35')],function(_0x281b91){return{'name':_0x281b91[_0x118e('0x36')],'type':_0x281b91[_0x118e('0x37')]['key']};});_0x210bc6[_0x118e('0x38')]=_[_0x118e('0x39')](_0x44b9ab,_0x118e('0x31'));_0x210bc6['query']=_[_0x118e('0x3a')](_0x500ad9[_0x118e('0x3b')]);_0x210bc6[_0x118e('0x3c')]=_[_0x118e('0x3d')](_0x210bc6[_0x118e('0x38')],_0x210bc6[_0x118e('0x3b')]);_0x14d643[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0x210bc6[_0x118e('0x38')],qs[_0x118e('0x3f')](_0x500ad9[_0x118e('0x3b')][_0x118e('0x3f')]));_0x14d643['attributes']=_0x14d643[_0x118e('0x3e')][_0x118e('0x40')]?_0x14d643[_0x118e('0x3e')]:_0x210bc6[_0x118e('0x38')];if(!_0x500ad9[_0x118e('0x3b')][_0x118e('0x41')](_0x118e('0x42'))){_0x14d643[_0x118e('0x25')]=qs['limit'](_0x500ad9[_0x118e('0x3b')][_0x118e('0x25')]);_0x14d643['offset']=qs[_0x118e('0x27')](_0x500ad9[_0x118e('0x3b')]['offset']);}_0x14d643[_0x118e('0x43')]=qs[_0x118e('0x44')](_0x500ad9['query']['sort']);_0x14d643['where']=qs[_0x118e('0x3c')](_['pick'](_0x500ad9[_0x118e('0x3b')],_0x210bc6[_0x118e('0x3c')]),_0x44b9ab);if(_0x500ad9[_0x118e('0x3b')][_0x118e('0x45')]){_0x14d643[_0x118e('0x46')]=_['merge'](_0x14d643[_0x118e('0x46')],{'$or':_[_0x118e('0x39')](_0x44b9ab,function(_0x47279d){if(_0x47279d[_0x118e('0x37')]!==_0x118e('0x47')){var _0x3c72e9={};_0x3c72e9[_0x47279d[_0x118e('0x31')]]={'$like':'%'+_0x500ad9[_0x118e('0x3b')]['filter']+'%'};return _0x3c72e9;}})});}_0x14d643=_[_0x118e('0x48')]({},_0x14d643,_0x500ad9[_0x118e('0x49')]);var _0x5e7ea3={'where':_0x14d643['where']};return db['Team']['count'](_0x5e7ea3)[_0x118e('0x2d')](function(_0x34a34e){_0x3201e8[_0x118e('0x26')]=_0x34a34e;if(_0x500ad9[_0x118e('0x3b')][_0x118e('0x4a')]){_0x14d643['include']=[{'all':!![]}];}return db[_0x118e('0x34')][_0x118e('0x4b')](_0x14d643);})[_0x118e('0x2d')](function(_0x5dd8db){_0x3201e8[_0x118e('0x4c')]=_0x5dd8db;return _0x3201e8;})[_0x118e('0x2d')](respondWithFilteredResult(_0xde3fb3,_0x14d643))['catch'](handleError(_0xde3fb3,null));};exports[_0x118e('0x4d')]=function(_0x6ac48c,_0x14ca1b){var _0x271364={'raw':![],'where':{'id':_0x6ac48c[_0x118e('0x4e')]['id']}},_0x909055={};_0x909055['model']=_[_0x118e('0x3a')](db[_0x118e('0x34')][_0x118e('0x35')]);_0x909055[_0x118e('0x3b')]=_[_0x118e('0x3a')](_0x6ac48c['query']);_0x909055['filters']=_[_0x118e('0x3d')](_0x909055[_0x118e('0x38')],_0x909055[_0x118e('0x3b')]);_0x271364[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0x909055[_0x118e('0x38')],qs[_0x118e('0x3f')](_0x6ac48c[_0x118e('0x3b')]['fields']));_0x271364['attributes']=_0x271364[_0x118e('0x3e')][_0x118e('0x40')]?_0x271364[_0x118e('0x3e')]:_0x909055[_0x118e('0x38')];if(_0x6ac48c[_0x118e('0x3b')][_0x118e('0x4a')]){_0x271364['include']=[{'all':!![]}];}_0x271364=_[_0x118e('0x48')]({},_0x271364,_0x6ac48c['options']);return db[_0x118e('0x34')]['find'](_0x271364)[_0x118e('0x2d')](handleEntityNotFound(_0x14ca1b,null))[_0x118e('0x2d')](respondWithResult(_0x14ca1b,null))[_0x118e('0x4f')](handleError(_0x14ca1b,null));};exports[_0x118e('0x50')]=function(_0x10394f,_0x12131d){return db[_0x118e('0x34')][_0x118e('0x50')](_0x10394f[_0x118e('0x51')],{})[_0x118e('0x2d')](function(_0xd988ea){var _0x3776de=_0x10394f['user'][_0x118e('0x52')]({'plain':!![]});if(!_0x3776de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3776de['role']===_0x118e('0x53')){var _0x5278d1=_0xd988ea['get']({'plain':!![]});var _0x2f751b=_0x118e('0x54');return db[_0x118e('0x55')]['find']({'where':{'name':_0x2f751b,'userProfileId':_0x3776de[_0x118e('0x56')]},'raw':!![]})['then'](function(_0x31a36b){if(_0x31a36b&&_0x31a36b['autoAssociation']===0x0){return db[_0x118e('0x57')]['create']({'name':_0x5278d1[_0x118e('0x31')],'resourceId':_0x5278d1['id'],'type':_0x31a36b[_0x118e('0x31')],'sectionId':_0x31a36b['id']},{})[_0x118e('0x2d')](function(){return _0xd988ea;});}else{return _0xd988ea;}})[_0x118e('0x4f')](function(_0x1b589a){logger[_0x118e('0x2f')](_0x118e('0x58'),_0x1b589a);throw _0x1b589a;});}return _0xd988ea;})[_0x118e('0x2d')](respondWithResult(_0x12131d,0xc9))[_0x118e('0x4f')](handleError(_0x12131d,null));};exports['update']=function(_0x568361,_0xff81b4){if(_0x568361['body']['id']){delete _0x568361[_0x118e('0x51')]['id'];}return db[_0x118e('0x34')]['find']({'where':{'id':_0x568361[_0x118e('0x4e')]['id']}})[_0x118e('0x2d')](handleEntityNotFound(_0xff81b4,null))['then'](saveUpdates(_0x568361[_0x118e('0x51')],null))[_0x118e('0x2d')](respondWithResult(_0xff81b4,null))['catch'](handleError(_0xff81b4,null));};exports[_0x118e('0x59')]=function(_0x241449,_0x2c8da4){var _0x1f8a07=_0x241449['params']['id'];var _0x7d4932=[];return db['sequelize'][_0x118e('0x5a')](function(_0x5e1b93){var _0x51488c=_0x118e('0x5b')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x51488c,{'type':db['Sequelize'][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93})[_0x118e('0x2d')](function(_0xa1201a){_0x7d4932=_[_0x118e('0x39')](_0xa1201a,function(_0x46c3d5){return Number(_0x46c3d5[_0x118e('0x5f')]);});})['then'](function(){var _0x4e24cc=_0x118e('0x60')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x4e24cc,{'type':db[_0x118e('0x61')][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x1d0964){var _0xb24dcd=_[_0x118e('0x39')](_0x1d0964,function(_0x43f7e0){return Number(_0x43f7e0[_0x118e('0x62')]);});return db[_0x118e('0x63')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'VoiceQueueId':{'$in':_0xb24dcd}},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){var _0x3433cb='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1f8a07;return db['sequelize']['query'](_0x3433cb,{'type':db[_0x118e('0x61')]['QueryTypes'][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})['then'](function(_0x18dfe6){var _0x1d9ca5=_[_0x118e('0x39')](_0x18dfe6,function(_0x2802c3){return Number(_0x2802c3['MailQueueId']);});return db[_0x118e('0x64')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'MailQueueId':{'$in':_0x1d9ca5}},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){var _0x3ca803=_0x118e('0x65')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x3ca803,{'type':db[_0x118e('0x61')]['QueryTypes'][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x305a0e){var _0xc18ce8=_[_0x118e('0x39')](_0x305a0e,function(_0x2c456d){return Number(_0x2c456d[_0x118e('0x66')]);});return db[_0x118e('0x67')]['destroy']({'where':{'UserId':{'$in':_0x7d4932},'SmsQueueId':{'$in':_0xc18ce8}},'transaction':_0x5e1b93});})['then'](function(){var _0x4d470a=_0x118e('0x68')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x4d470a,{'type':db[_0x118e('0x61')][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})['then'](function(_0xfd8795){var _0x2726fe=_['map'](_0xfd8795,function(_0x46ece1){return Number(_0x46ece1[_0x118e('0x69')]);});return db[_0x118e('0x6a')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'ChatQueueId':{'$in':_0x2726fe}},'transaction':_0x5e1b93});})['then'](function(){var _0x4a835e=_0x118e('0x6b')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x4a835e,{'type':db['Sequelize'][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x1d9014){var _0x4a50c5=_['map'](_0x1d9014,function(_0x20080e){return Number(_0x20080e[_0x118e('0x6c')]);});return db[_0x118e('0x6d')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'FaxQueueId':{'$in':_0x4a50c5}},'transaction':_0x5e1b93});})['then'](function(){var _0x348bec=_0x118e('0x6e')+_0x1f8a07;return db[_0x118e('0x5c')][_0x118e('0x3b')](_0x348bec,{'type':db['Sequelize'][_0x118e('0x5d')]['SELECT'],'raw':!![],'transaction':_0x5e1b93});})['then'](function(_0x2dae70){var _0x5c0989=_[_0x118e('0x39')](_0x2dae70,function(_0x3da5e4){return Number(_0x3da5e4[_0x118e('0x6f')]);});return db[_0x118e('0x70')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'OpenchannelQueueId':{'$in':_0x5c0989}},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){var _0x2e84af='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1f8a07;return db['sequelize'][_0x118e('0x3b')](_0x2e84af,{'type':db[_0x118e('0x61')][_0x118e('0x5d')][_0x118e('0x5e')],'raw':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x5d7d5c){var _0x163478=_['map'](_0x5d7d5c,function(_0x3d9f5c){return Number(_0x3d9f5c[_0x118e('0x71')]);});return db[_0x118e('0x72')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'WhatsappQueueId':{'$in':_0x163478}},'transaction':_0x5e1b93});})['then'](function(){return db['TeamVoicePrefix'][_0x118e('0x73')]({'where':{'TeamId':_0x1f8a07}});})['then'](function(_0x27a51b){if(_0x27a51b===null){return;}return db[_0x118e('0x74')][_0x118e('0x59')]({'where':{'UserId':{'$in':_0x7d4932},'VoicePrefixId':_0x27a51b['VoicePrefixId']},'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(){return db[_0x118e('0x34')][_0x118e('0x59')]({'where':{'id':_0x1f8a07},'cascade':!![],'transaction':_0x5e1b93});})[_0x118e('0x2d')](function(_0x113516){if(_0x113516===0x0){_0x2c8da4[_0x118e('0x2e')](0x194);}else{return db[_0x118e('0x57')]['destroy']({'where':{'type':_0x118e('0x54'),'resourceId':_0x1f8a07},'cascade':!![],'transaction':_0x5e1b93})['then'](function(){_0x2c8da4[_0x118e('0x21')](0xcc)[_0x118e('0x22')]();});}})[_0x118e('0x4f')](function(_0x2eef3f){_0x2c8da4[_0x118e('0x21')](0x1f4)[_0x118e('0x32')](_0x2eef3f);});});};exports[_0x118e('0x75')]=function(_0xed04d0,_0x14e236,_0x3f0938){return db[_0x118e('0x34')][_0x118e('0x76')]({'where':{'id':_0xed04d0[_0x118e('0x4e')]['id']}})[_0x118e('0x2d')](handleEntityNotFound(_0x14e236,null))[_0x118e('0x2d')](function(_0x500360){if(!_0xed04d0[_0x118e('0x3b')][_0x118e('0x77')]||!utils[_0x118e('0x78')](_0xed04d0[_0x118e('0x3b')][_0x118e('0x77')])){throw new db[(_0x118e('0x61'))]['ValidationError']('Unknown\x20channel');}var _0x74e92f={};var _0xec7501={};_0xec7501[_0x118e('0x38')]=_['keys'](db[_[_0x118e('0x79')](_0xed04d0[_0x118e('0x3b')]['channel']['toLowerCase']())+'Queue'][_0x118e('0x35')]);_0xec7501[_0x118e('0x3b')]=_[_0x118e('0x3a')](_0xed04d0[_0x118e('0x3b')]);_0xec7501[_0x118e('0x3c')]=_['intersection'](_0xec7501['model'],_0xec7501[_0x118e('0x3b')]);_0x74e92f[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0xec7501[_0x118e('0x38')],qs[_0x118e('0x3f')](_0xed04d0['query']['fields']));_0x74e92f[_0x118e('0x3e')]=_0x74e92f[_0x118e('0x3e')]['length']?_0x74e92f[_0x118e('0x3e')]:_0xec7501[_0x118e('0x38')];_0x74e92f['limit']=qs[_0x118e('0x25')](_0xed04d0['query']['limit']);_0x74e92f['offset']=qs[_0x118e('0x27')](_0xed04d0[_0x118e('0x3b')]['offset']);_0x74e92f[_0x118e('0x43')]=qs[_0x118e('0x44')](_0xed04d0[_0x118e('0x3b')][_0x118e('0x44')]);_0x74e92f[_0x118e('0x46')]=qs['filters'](_[_0x118e('0x7a')](_0xed04d0[_0x118e('0x3b')],_0xec7501[_0x118e('0x3c')]));_0x74e92f=_['merge']({},_0x74e92f,_0xed04d0[_0x118e('0x49')]);return _0x500360['get'+_[_0x118e('0x79')](_0xed04d0[_0x118e('0x3b')][_0x118e('0x77')]['toLowerCase']())+_0x118e('0x7b')](_0x74e92f);})[_0x118e('0x2d')](respondWithResult(_0x14e236,null))[_0x118e('0x4f')](handleError(_0x14e236,null));};exports[_0x118e('0x7c')]=function(_0x3faec5,_0x39b4db,_0x16c310){return db[_0x118e('0x34')]['findOne']({'where':{'id':_0x3faec5['params']['id']}})[_0x118e('0x2d')](function(_0x4a9eaf){if(_0x4a9eaf){if(!_0x3faec5[_0x118e('0x51')][_0x118e('0x77')]||!utils[_0x118e('0x78')](_0x3faec5[_0x118e('0x51')][_0x118e('0x77')])){throw new db[(_0x118e('0x61'))][(_0x118e('0x7d'))](_0x118e('0x7e'));}return _0x4a9eaf[_0x118e('0x7f')+_[_0x118e('0x79')](_0x3faec5[_0x118e('0x51')][_0x118e('0x77')]['toLowerCase']())+_0x118e('0x7b')](_0x3faec5[_0x118e('0x51')][_0x118e('0x80')]);}return null;})[_0x118e('0x2d')](handleEntityNotFound(_0x39b4db,null))['then'](respondWithStatusCode(_0x39b4db,null))[_0x118e('0x4f')](handleError(_0x39b4db,null));};exports[_0x118e('0x81')]=function(_0x286005,_0x476466,_0x4415e6){return db['Team']['findOne']({'where':{'id':_0x286005[_0x118e('0x4e')]['id']}})[_0x118e('0x2d')](function(_0x3a3eb7){if(_0x3a3eb7){if(!_0x286005[_0x118e('0x3b')][_0x118e('0x77')]||!utils['isValidChannel'](_0x286005[_0x118e('0x3b')][_0x118e('0x77')])){throw new db[(_0x118e('0x61'))][(_0x118e('0x7d'))](_0x118e('0x7e'));}return _0x3a3eb7[_0x118e('0x82')+_[_0x118e('0x79')](_0x286005['query'][_0x118e('0x77')][_0x118e('0x83')]())+'Queues'](_0x286005['query'][_0x118e('0x80')]);}return null;})[_0x118e('0x2d')](handleEntityNotFound(_0x476466,null))['then'](respondWithStatusCode(_0x476466,null))[_0x118e('0x4f')](handleError(_0x476466,null));};exports['addAgents']=function(_0x167e66,_0x21f858){var _0xe6cba3=_['isArray'](_0x167e66[_0x118e('0x51')]['ids'])?_0x167e66['body'][_0x118e('0x80')]:[_0x167e66[_0x118e('0x51')][_0x118e('0x80')]];var _0x3c2912=_0x167e66[_0x118e('0x4e')]['id'];return db['Team'][_0x118e('0x73')]({'where':{'id':_0x3c2912}})[_0x118e('0x2d')](handleEntityNotFound(_0x21f858,null))[_0x118e('0x2d')](function(_0x172e73){if(_0x172e73){var _0x16c2cd=[_0x118e('0x84'),'Chat',_0x118e('0x85'),_0x118e('0x86'),'Fax',_0x118e('0x87'),'Whatsapp'];return db[_0x118e('0x5c')][_0x118e('0x5a')](function(_0x4609df){var _0x2e055b=_[_0x118e('0x39')](_0x16c2cd,function(_0x21490f){var _0x26d716={'attributes':['id',_0x118e('0x31')]};if(_0x21490f===_0x118e('0x84')){_0x26d716[_0x118e('0x88')]={'attributes':[_0x118e('0x89')]};}return _0x172e73[_0x118e('0x52')+_0x21490f+_0x118e('0x7b')](_0x26d716)[_0x118e('0x2d')](function(_0x4d0d20){var _0x2ec01e=_['map'](_0x4d0d20,function(_0x2cf4c6){var _0x2a3bda=_[_0x118e('0x39')](_0xe6cba3,function(_0x375bac){var _0x11cbf8={'where':{'UserId':_0x375bac,[_0x21490f+_0x118e('0x8a')]:_0x2cf4c6['id']},'transaction':_0x4609df};if(_0x21490f===_0x118e('0x84')){_0x11cbf8[_0x118e('0x8b')]={'penalty':_0x2cf4c6['TeamVoiceQueue'][_0x118e('0x89')]};}return db[_0x118e('0x8c')+_0x21490f+'Queue'][_0x118e('0x8d')](_0x11cbf8)[_0x118e('0x2d')](function(){socket[_0x118e('0x8e')](_0x118e('0x53')+_0x21490f+'Queue:save',{'UserId':_0x375bac,[_0x21490f+_0x118e('0x8a')]:_0x2cf4c6['id']});if(_0x21490f!=='Voice'){return;}return db[_0x118e('0x8c')][_0x118e('0x4b')]({'where':{'id':_0xe6cba3,'online':0x1},'attributes':['id',_0x118e('0x31'),'online','voicePause','interface'],'raw':!![]})[_0x118e('0x2d')](function(_0x494c61){var _0x38806d=_[_0x118e('0x39')](_0x494c61,function(_0x25f2f2){return db[_0x118e('0x8f')][_0x118e('0x90')]({'membername':_0x25f2f2[_0x118e('0x31')],'UserId':_0x25f2f2['id'],'queue_name':_0x2cf4c6[_0x118e('0x31')],'VoiceQueueId':_0x2cf4c6['id'],'interface':_[_0x118e('0x91')](_0x25f2f2['interface'])?util[_0x118e('0x92')](_0x118e('0x93'),_0x25f2f2[_0x118e('0x31')]):_0x25f2f2[_0x118e('0x94')],'paused':_0x25f2f2[_0x118e('0x95')]||![],'penalty':_0x2cf4c6[_0x118e('0x96')][_0x118e('0x89')]},{'transaction':_0x4609df});});return Promise[_0x118e('0x97')](_0x38806d);});});});return Promise['all'](_0x2a3bda);});return Promise[_0x118e('0x97')](_0x2ec01e);})[_0x118e('0x2d')](function(){return db[_0x118e('0x98')][_0x118e('0x76')]({'where':{'teamId':_0x3c2912}})[_0x118e('0x2d')](function(_0x24ca35){if(_0x24ca35){var _0x29edc1=_[_0x118e('0x39')](_0xe6cba3,function(_0xe3fde3){db[_0x118e('0x74')][_0x118e('0x90')]({'UserId':_0xe3fde3,'VoicePrefixId':_0x24ca35[_0x118e('0x99')]});});return Promise[_0x118e('0x97')](_0x29edc1);}});});});return Promise[_0x118e('0x97')](_0x2e055b)[_0x118e('0x2d')](function(){return _0x172e73[_0x118e('0x9a')](_0xe6cba3,{'transaction':_0x4609df})['spread'](function(_0x263d3b){return _0x263d3b;});});});}})[_0x118e('0x2d')](respondWithResult(_0x21f858,null))[_0x118e('0x4f')](handleError(_0x21f858,null));};exports[_0x118e('0x9b')]=function(_0x2be49a,_0x19f55e){var _0x5b364a=_[_0x118e('0x9c')](_0x2be49a['query'][_0x118e('0x80')])?_0x2be49a[_0x118e('0x3b')][_0x118e('0x80')]:[_0x2be49a['query'][_0x118e('0x80')]];var _0x492a06=_0x2be49a['params']['id'];return db['Team'][_0x118e('0x73')]({'where':{'id':_0x492a06}})[_0x118e('0x2d')](handleEntityNotFound(_0x19f55e,null))[_0x118e('0x2d')](function(_0x4ac11d){if(_0x4ac11d){var _0x3c4276=['Voice',_0x118e('0x9d'),_0x118e('0x85'),_0x118e('0x86'),_0x118e('0x9e'),'Openchannel',_0x118e('0x9f')];return db['sequelize']['transaction'](function(_0x11c4db){var _0x559385=_[_0x118e('0x39')](_0x3c4276,function(_0x2e7b32){var _0x5e27ae={'attributes':['id',_0x118e('0x31')]};return _0x4ac11d[_0x118e('0x52')+_0x2e7b32+_0x118e('0x7b')](_0x5e27ae)['then'](function(_0x477278){var _0x1874e4=_['map'](_0x477278,function(_0x4a9855){return _0x4a9855[_0x118e('0x9b')](_0x5b364a,{'transaction':_0x11c4db})[_0x118e('0x2d')](function(){var _0x23a6a4=_['map'](_0x5b364a,function(_0x370a2b){socket[_0x118e('0x8e')]('user'+_0x2e7b32+'Queue:remove',{'UserId':Number(_0x370a2b),[_0x2e7b32+_0x118e('0x8a')]:_0x4a9855['id']});if(_0x2e7b32!==_0x118e('0x84')){return;}return db[_0x118e('0x8f')]['destroy']({'where':{'VoiceQueueId':_0x4a9855['id'],'UserId':_0x370a2b},'transaction':_0x11c4db});});return Promise[_0x118e('0x97')](_0x23a6a4);});});return Promise['all'](_0x1874e4);});});return Promise['all'](_0x559385)['then'](function(){return _0x4ac11d[_0x118e('0x9b')](_0x5b364a,{'transaction':_0x11c4db});})[_0x118e('0x2d')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x492a06}})[_0x118e('0x2d')](function(_0x16f7da){if(_0x16f7da){var _0x181ca2=_[_0x118e('0x39')](_0x5b364a,function(_0x14c836){db[_0x118e('0x74')][_0x118e('0x59')]({'where':{'UserId':_0x14c836,'VoicePrefixId':_0x16f7da['VoicePrefixId']}});});return Promise[_0x118e('0x97')](_0x181ca2);}});});});}})[_0x118e('0x2d')](respondWithStatusCode(_0x19f55e,null))[_0x118e('0x4f')](handleError(_0x19f55e,null));};exports[_0x118e('0xa0')]=function(_0x11f451,_0x11756d,_0x2ef5ff){var _0x1f4172={};var _0x42a713={};var _0x2806b6;var _0x407626;return db[_0x118e('0x34')]['findOne']({'where':{'id':_0x11f451['params']['id']}})['then'](handleEntityNotFound(_0x11756d,null))[_0x118e('0x2d')](function(_0x14a586){if(_0x14a586){_0x2806b6=_0x14a586;_0x42a713[_0x118e('0x38')]=_[_0x118e('0x3a')](db[_0x118e('0x8c')][_0x118e('0x35')]);_0x42a713['query']=_[_0x118e('0x3a')](_0x11f451['query']);_0x42a713[_0x118e('0x3c')]=_['intersection'](_0x42a713[_0x118e('0x38')],_0x42a713[_0x118e('0x3b')]);_0x1f4172[_0x118e('0x3e')]=_[_0x118e('0x3d')](_0x42a713['model'],qs[_0x118e('0x3f')](_0x11f451[_0x118e('0x3b')][_0x118e('0x3f')]));_0x1f4172['attributes']=_0x1f4172[_0x118e('0x3e')][_0x118e('0x40')]?_0x1f4172[_0x118e('0x3e')]:_0x42a713[_0x118e('0x38')];_0x1f4172['order']=qs[_0x118e('0x44')](_0x11f451['query'][_0x118e('0x44')]);_0x1f4172[_0x118e('0x46')]=qs[_0x118e('0x3c')](_[_0x118e('0x7a')](_0x11f451[_0x118e('0x3b')],_0x42a713[_0x118e('0x3c')]));if(_0x11f451[_0x118e('0x3b')][_0x118e('0x45')]){_0x1f4172[_0x118e('0x46')]=_[_0x118e('0x48')](_0x1f4172[_0x118e('0x46')],{'$or':_[_0x118e('0x39')](_0x1f4172[_0x118e('0x3e')],function(_0x2ccd9a){var _0x205e08={};_0x205e08[_0x2ccd9a]={'$like':'%'+_0x11f451['query'][_0x118e('0x45')]+'%'};return _0x205e08;})});}_0x1f4172=_[_0x118e('0x48')]({},_0x1f4172,_0x11f451[_0x118e('0x49')]);return _0x2806b6[_0x118e('0xa0')](_0x1f4172);}})[_0x118e('0x2d')](function(_0x4558fa){if(_0x4558fa){_0x407626=_0x4558fa['length'];if(!_0x11f451[_0x118e('0x3b')][_0x118e('0x41')](_0x118e('0x42'))){_0x1f4172[_0x118e('0x25')]=qs[_0x118e('0x25')](_0x11f451[_0x118e('0x3b')]['limit']);_0x1f4172[_0x118e('0x27')]=qs[_0x118e('0x27')](_0x11f451[_0x118e('0x3b')]['offset']);}return _0x2806b6[_0x118e('0xa0')](_0x1f4172);}})['then'](function(_0x4f7f5e){if(_0x4f7f5e){return _0x4f7f5e?{'count':_0x407626,'rows':_0x4f7f5e}:null;}})[_0x118e('0x2d')](respondWithResult(_0x11756d,null))['catch'](handleError(_0x11756d,null));}; \ No newline at end of file +var _0xe5e9=['end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','Team','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','sequelize','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','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','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','addQueues','add','removeQueues','Unknown\x20channel','remove','Queues','ids','Chat','Mail','Fax','Openchannel','Whatsapp','Voice','through','penalty','QueueId','defaults','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','SIP/%s','all','spread','Sms','transaction','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','sendStatus'];(function(_0x22022c,_0x824cc6){var _0x390ee7=function(_0x910153){while(--_0x910153){_0x22022c['push'](_0x22022c['shift']());}};_0x390ee7(++_0x824cc6);}(_0xe5e9,0x83));var _0x9e5e=function(_0x1e40e9,_0x16cc7a){_0x1e40e9=_0x1e40e9-0x0;var _0x3d3cbc=_0xe5e9[_0x1e40e9];return _0x3d3cbc;};'use strict';var emlformat=require(_0x9e5e('0x0'));var rimraf=require(_0x9e5e('0x1'));var zipdir=require(_0x9e5e('0x2'));var jsonpatch=require(_0x9e5e('0x3'));var rp=require(_0x9e5e('0x4'));var moment=require(_0x9e5e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9e5e('0x6'));var path=require(_0x9e5e('0x7'));var sox=require(_0x9e5e('0x8'));var csv=require(_0x9e5e('0x9'));var ejs=require(_0x9e5e('0xa'));var fs=require('fs');var fs_extra=require(_0x9e5e('0xb'));var _=require(_0x9e5e('0xc'));var squel=require(_0x9e5e('0xd'));var crypto=require(_0x9e5e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9e5e('0xf'));var toCsv=require(_0x9e5e('0x9'));var querystring=require('querystring');var Papa=require(_0x9e5e('0x10'));var Redis=require(_0x9e5e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9e5e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e5e('0x13'))(_0x9e5e('0x14'));var utils=require(_0x9e5e('0x15'));var config=require(_0x9e5e('0x16'));var licenseUtil=require(_0x9e5e('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x9e5e('0x18')],{'host':_0x9e5e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9e5e('0x18')]));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x175c94,_0xde2761){_0xde2761=_0xde2761||0xcc;return function(_0x7765e6){if(_0x7765e6){return _0x175c94[_0x9e5e('0x1a')](_0xde2761);}return _0x175c94['status'](_0xde2761)[_0x9e5e('0x1b')]();};}function respondWithResult(_0xc54fc0,_0x2fdf40){_0x2fdf40=_0x2fdf40||0xc8;return function(_0x1b068e){if(_0x1b068e){return _0xc54fc0['status'](_0x2fdf40)[_0x9e5e('0x1c')](_0x1b068e);}};}function respondWithFilteredResult(_0x1c9b35,_0x5322de){return function(_0x879b7f){if(_0x879b7f){var _0x14d9a4=typeof _0x5322de[_0x9e5e('0x1d')]===_0x9e5e('0x1e')&&typeof _0x5322de[_0x9e5e('0x1f')]===_0x9e5e('0x1e');var _0x1f1cee=_0x879b7f[_0x9e5e('0x20')];var _0x2f073e=_0x14d9a4?0x0:_0x5322de[_0x9e5e('0x1d')];var _0x4c387a=_0x14d9a4?_0x879b7f[_0x9e5e('0x20')]:_0x5322de[_0x9e5e('0x1d')]+_0x5322de[_0x9e5e('0x1f')];var _0x18bb5e;if(_0x4c387a>=_0x1f1cee){_0x4c387a=_0x1f1cee;_0x18bb5e=0xc8;}else{_0x18bb5e=0xce;}_0x1c9b35[_0x9e5e('0x21')](_0x18bb5e);return _0x1c9b35[_0x9e5e('0x22')](_0x9e5e('0x23'),_0x2f073e+'-'+_0x4c387a+'/'+_0x1f1cee)['json'](_0x879b7f);}return null;};}function patchUpdates(_0x18e8e0){return function(_0x5b8b7d){try{jsonpatch[_0x9e5e('0x24')](_0x5b8b7d,_0x18e8e0,!![]);}catch(_0x2dad04){return BPromise[_0x9e5e('0x25')](_0x2dad04);}return _0x5b8b7d[_0x9e5e('0x26')]();};}function saveUpdates(_0x4ac10b,_0x203d88){return function(_0xec3c44){if(_0xec3c44){return _0xec3c44[_0x9e5e('0x27')](_0x4ac10b)[_0x9e5e('0x28')](function(_0x45ee7f){return _0x45ee7f;});}return null;};}function handleEntityNotFound(_0x52f8cc,_0x1360ae){return function(_0x18ebe9){if(!_0x18ebe9){_0x52f8cc[_0x9e5e('0x1a')](0x194);}return _0x18ebe9;};}function handleError(_0x4b2257,_0x5efb03){_0x5efb03=_0x5efb03||0x1f4;return function(_0x4b3a50){logger[_0x9e5e('0x29')](_0x4b3a50[_0x9e5e('0x2a')]);if(_0x4b3a50[_0x9e5e('0x2b')]){delete _0x4b3a50[_0x9e5e('0x2b')];}_0x4b2257[_0x9e5e('0x21')](_0x5efb03)[_0x9e5e('0x2c')](_0x4b3a50);};}exports[_0x9e5e('0x2d')]=function(_0x2d9a2a,_0x14e733){var _0x38693e={},_0x269bc7={},_0x2e5715={'count':0x0,'rows':[]};var _0x4866c9=_[_0x9e5e('0x2e')](db['Team'][_0x9e5e('0x2f')],function(_0x2d98e6){return{'name':_0x2d98e6[_0x9e5e('0x30')],'type':_0x2d98e6[_0x9e5e('0x31')][_0x9e5e('0x32')]};});_0x269bc7[_0x9e5e('0x33')]=_[_0x9e5e('0x2e')](_0x4866c9,_0x9e5e('0x2b'));_0x269bc7[_0x9e5e('0x34')]=_[_0x9e5e('0x35')](_0x2d9a2a[_0x9e5e('0x34')]);_0x269bc7[_0x9e5e('0x36')]=_[_0x9e5e('0x37')](_0x269bc7[_0x9e5e('0x33')],_0x269bc7[_0x9e5e('0x34')]);_0x38693e['attributes']=_['intersection'](_0x269bc7['model'],qs[_0x9e5e('0x38')](_0x2d9a2a[_0x9e5e('0x34')][_0x9e5e('0x38')]));_0x38693e[_0x9e5e('0x39')]=_0x38693e['attributes'][_0x9e5e('0x3a')]?_0x38693e[_0x9e5e('0x39')]:_0x269bc7['model'];if(!_0x2d9a2a[_0x9e5e('0x34')][_0x9e5e('0x3b')](_0x9e5e('0x3c'))){_0x38693e[_0x9e5e('0x1f')]=qs[_0x9e5e('0x1f')](_0x2d9a2a[_0x9e5e('0x34')][_0x9e5e('0x1f')]);_0x38693e[_0x9e5e('0x1d')]=qs[_0x9e5e('0x1d')](_0x2d9a2a[_0x9e5e('0x34')][_0x9e5e('0x1d')]);}_0x38693e[_0x9e5e('0x3d')]=qs[_0x9e5e('0x3e')](_0x2d9a2a[_0x9e5e('0x34')]['sort']);_0x38693e['where']=qs['filters'](_[_0x9e5e('0x3f')](_0x2d9a2a[_0x9e5e('0x34')],_0x269bc7[_0x9e5e('0x36')]),_0x4866c9);if(_0x2d9a2a[_0x9e5e('0x34')][_0x9e5e('0x40')]){_0x38693e[_0x9e5e('0x41')]=_['merge'](_0x38693e[_0x9e5e('0x41')],{'$or':_[_0x9e5e('0x2e')](_0x4866c9,function(_0x3275cf){if(_0x3275cf['type']!==_0x9e5e('0x42')){var _0x421a5b={};_0x421a5b[_0x3275cf[_0x9e5e('0x2b')]]={'$like':'%'+_0x2d9a2a['query']['filter']+'%'};return _0x421a5b;}})});}_0x38693e=_[_0x9e5e('0x43')]({},_0x38693e,_0x2d9a2a[_0x9e5e('0x44')]);var _0x31e303={'where':_0x38693e[_0x9e5e('0x41')]};return db[_0x9e5e('0x45')][_0x9e5e('0x20')](_0x31e303)[_0x9e5e('0x28')](function(_0x235cbd){_0x2e5715[_0x9e5e('0x20')]=_0x235cbd;if(_0x2d9a2a[_0x9e5e('0x34')][_0x9e5e('0x46')]){_0x38693e[_0x9e5e('0x47')]=[{'all':!![]}];}return db[_0x9e5e('0x45')][_0x9e5e('0x48')](_0x38693e);})[_0x9e5e('0x28')](function(_0x117282){_0x2e5715[_0x9e5e('0x49')]=_0x117282;return _0x2e5715;})[_0x9e5e('0x28')](respondWithFilteredResult(_0x14e733,_0x38693e))['catch'](handleError(_0x14e733,null));};exports[_0x9e5e('0x4a')]=function(_0x911c90,_0x529102){var _0x578228={'raw':![],'where':{'id':_0x911c90[_0x9e5e('0x4b')]['id']}},_0x20f9ef={};_0x20f9ef['model']=_[_0x9e5e('0x35')](db[_0x9e5e('0x45')][_0x9e5e('0x2f')]);_0x20f9ef[_0x9e5e('0x34')]=_[_0x9e5e('0x35')](_0x911c90['query']);_0x20f9ef['filters']=_[_0x9e5e('0x37')](_0x20f9ef[_0x9e5e('0x33')],_0x20f9ef['query']);_0x578228[_0x9e5e('0x39')]=_[_0x9e5e('0x37')](_0x20f9ef[_0x9e5e('0x33')],qs[_0x9e5e('0x38')](_0x911c90[_0x9e5e('0x34')][_0x9e5e('0x38')]));_0x578228[_0x9e5e('0x39')]=_0x578228[_0x9e5e('0x39')][_0x9e5e('0x3a')]?_0x578228[_0x9e5e('0x39')]:_0x20f9ef[_0x9e5e('0x33')];if(_0x911c90['query'][_0x9e5e('0x46')]){_0x578228[_0x9e5e('0x47')]=[{'all':!![]}];}_0x578228=_[_0x9e5e('0x43')]({},_0x578228,_0x911c90[_0x9e5e('0x44')]);return db[_0x9e5e('0x45')][_0x9e5e('0x4c')](_0x578228)[_0x9e5e('0x28')](handleEntityNotFound(_0x529102,null))[_0x9e5e('0x28')](respondWithResult(_0x529102,null))[_0x9e5e('0x4d')](handleError(_0x529102,null));};exports[_0x9e5e('0x4e')]=function(_0x2df283,_0x4badb6){return db['Team'][_0x9e5e('0x4e')](_0x2df283['body'],{})[_0x9e5e('0x28')](function(_0x54d889){var _0x21e304=_0x2df283[_0x9e5e('0x4f')]['get']({'plain':!![]});if(!_0x21e304)throw new Error(_0x9e5e('0x50'));if(_0x21e304[_0x9e5e('0x51')]===_0x9e5e('0x4f')){var _0x21b57e=_0x54d889[_0x9e5e('0x52')]({'plain':!![]});var _0x5d5959=_0x9e5e('0x53');return db[_0x9e5e('0x54')][_0x9e5e('0x4c')]({'where':{'name':_0x5d5959,'userProfileId':_0x21e304['userProfileId']},'raw':!![]})[_0x9e5e('0x28')](function(_0x19b430){if(_0x19b430&&_0x19b430[_0x9e5e('0x55')]===0x0){return db[_0x9e5e('0x56')][_0x9e5e('0x4e')]({'name':_0x21b57e[_0x9e5e('0x2b')],'resourceId':_0x21b57e['id'],'type':_0x19b430[_0x9e5e('0x2b')],'sectionId':_0x19b430['id']},{})[_0x9e5e('0x28')](function(){return _0x54d889;});}else{return _0x54d889;}})[_0x9e5e('0x4d')](function(_0xdb4815){logger[_0x9e5e('0x29')](_0x9e5e('0x57'),_0xdb4815);throw _0xdb4815;});}return _0x54d889;})[_0x9e5e('0x28')](respondWithResult(_0x4badb6,0xc9))[_0x9e5e('0x4d')](handleError(_0x4badb6,null));};exports[_0x9e5e('0x27')]=function(_0x4b345b,_0x2c4a83){if(_0x4b345b[_0x9e5e('0x58')]['id']){delete _0x4b345b[_0x9e5e('0x58')]['id'];}return db[_0x9e5e('0x45')][_0x9e5e('0x4c')]({'where':{'id':_0x4b345b[_0x9e5e('0x4b')]['id']}})[_0x9e5e('0x28')](handleEntityNotFound(_0x2c4a83,null))[_0x9e5e('0x28')](saveUpdates(_0x4b345b[_0x9e5e('0x58')],null))[_0x9e5e('0x28')](respondWithResult(_0x2c4a83,null))['catch'](handleError(_0x2c4a83,null));};exports[_0x9e5e('0x59')]=function(_0x419ce0,_0x5a057c){var _0x2a9200=_0x419ce0['params']['id'];var _0x49cda2=[];return db['sequelize']['transaction'](function(_0x2c6bcb){var _0x228f16=_0x9e5e('0x5a')+_0x2a9200;return db['sequelize'][_0x9e5e('0x34')](_0x228f16,{'type':db[_0x9e5e('0x5b')][_0x9e5e('0x5c')]['SELECT'],'raw':!![],'transaction':_0x2c6bcb})[_0x9e5e('0x28')](function(_0x2d45d1){_0x49cda2=_[_0x9e5e('0x2e')](_0x2d45d1,function(_0x468663){return Number(_0x468663[_0x9e5e('0x5d')]);});})[_0x9e5e('0x28')](function(){var _0x3f7110='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a9200;return db[_0x9e5e('0x5e')][_0x9e5e('0x34')](_0x3f7110,{'type':db['Sequelize'][_0x9e5e('0x5c')][_0x9e5e('0x5f')],'raw':!![],'transaction':_0x2c6bcb});})['then'](function(_0x5f0409){var _0x37054f=_[_0x9e5e('0x2e')](_0x5f0409,function(_0x75c409){return Number(_0x75c409[_0x9e5e('0x60')]);});return db['UserVoiceQueue'][_0x9e5e('0x59')]({'where':{'UserId':{'$in':_0x49cda2},'VoiceQueueId':{'$in':_0x37054f}},'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(){var _0x4c4ac4=_0x9e5e('0x61')+_0x2a9200;return db[_0x9e5e('0x5e')][_0x9e5e('0x34')](_0x4c4ac4,{'type':db[_0x9e5e('0x5b')][_0x9e5e('0x5c')][_0x9e5e('0x5f')],'raw':!![],'transaction':_0x2c6bcb});})['then'](function(_0x43025d){var _0x438f6f=_[_0x9e5e('0x2e')](_0x43025d,function(_0x32340f){return Number(_0x32340f[_0x9e5e('0x62')]);});return db[_0x9e5e('0x63')][_0x9e5e('0x59')]({'where':{'UserId':{'$in':_0x49cda2},'MailQueueId':{'$in':_0x438f6f}},'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(){var _0x2eea28=_0x9e5e('0x64')+_0x2a9200;return db[_0x9e5e('0x5e')][_0x9e5e('0x34')](_0x2eea28,{'type':db[_0x9e5e('0x5b')][_0x9e5e('0x5c')][_0x9e5e('0x5f')],'raw':!![],'transaction':_0x2c6bcb});})['then'](function(_0x5ec5f2){var _0x17b4e3=_[_0x9e5e('0x2e')](_0x5ec5f2,function(_0x24094f){return Number(_0x24094f['SmsQueueId']);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x49cda2},'SmsQueueId':{'$in':_0x17b4e3}},'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(){var _0x24a6f2=_0x9e5e('0x65')+_0x2a9200;return db[_0x9e5e('0x5e')][_0x9e5e('0x34')](_0x24a6f2,{'type':db[_0x9e5e('0x5b')][_0x9e5e('0x5c')][_0x9e5e('0x5f')],'raw':!![],'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(_0x586fde){var _0xed7513=_[_0x9e5e('0x2e')](_0x586fde,function(_0x2aea58){return Number(_0x2aea58[_0x9e5e('0x66')]);});return db[_0x9e5e('0x67')][_0x9e5e('0x59')]({'where':{'UserId':{'$in':_0x49cda2},'ChatQueueId':{'$in':_0xed7513}},'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(){var _0x718486=_0x9e5e('0x68')+_0x2a9200;return db['sequelize'][_0x9e5e('0x34')](_0x718486,{'type':db[_0x9e5e('0x5b')][_0x9e5e('0x5c')][_0x9e5e('0x5f')],'raw':!![],'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(_0x432b46){var _0xe87e6a=_[_0x9e5e('0x2e')](_0x432b46,function(_0x1c55c2){return Number(_0x1c55c2[_0x9e5e('0x69')]);});return db[_0x9e5e('0x6a')][_0x9e5e('0x59')]({'where':{'UserId':{'$in':_0x49cda2},'FaxQueueId':{'$in':_0xe87e6a}},'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(){var _0x204b1b=_0x9e5e('0x6b')+_0x2a9200;return db[_0x9e5e('0x5e')][_0x9e5e('0x34')](_0x204b1b,{'type':db[_0x9e5e('0x5b')][_0x9e5e('0x5c')][_0x9e5e('0x5f')],'raw':!![],'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(_0x338e3b){var _0x1c57e5=_[_0x9e5e('0x2e')](_0x338e3b,function(_0x29dd3a){return Number(_0x29dd3a[_0x9e5e('0x6c')]);});return db[_0x9e5e('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x49cda2},'OpenchannelQueueId':{'$in':_0x1c57e5}},'transaction':_0x2c6bcb});})['then'](function(){var _0x1f6ba0='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2a9200;return db[_0x9e5e('0x5e')][_0x9e5e('0x34')](_0x1f6ba0,{'type':db[_0x9e5e('0x5b')][_0x9e5e('0x5c')][_0x9e5e('0x5f')],'raw':!![],'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(_0x15ddc3){var _0x24f117=_['map'](_0x15ddc3,function(_0x3c10ce){return Number(_0x3c10ce[_0x9e5e('0x6e')]);});return db[_0x9e5e('0x6f')][_0x9e5e('0x59')]({'where':{'UserId':{'$in':_0x49cda2},'WhatsappQueueId':{'$in':_0x24f117}},'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(){return db[_0x9e5e('0x70')][_0x9e5e('0x4c')]({'where':{'TeamId':_0x2a9200}});})[_0x9e5e('0x28')](function(_0x224df6){if(_0x224df6===null){return;}return db[_0x9e5e('0x71')][_0x9e5e('0x59')]({'where':{'UserId':{'$in':_0x49cda2},'VoicePrefixId':_0x224df6[_0x9e5e('0x72')]},'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(){return db['Team'][_0x9e5e('0x59')]({'where':{'id':_0x2a9200},'cascade':!![],'transaction':_0x2c6bcb});})[_0x9e5e('0x28')](function(_0x1468fe){if(_0x1468fe===0x0){_0x5a057c['sendStatus'](0x194);}else{return db[_0x9e5e('0x56')][_0x9e5e('0x59')]({'where':{'type':_0x9e5e('0x53'),'resourceId':_0x2a9200},'cascade':!![],'transaction':_0x2c6bcb})['then'](function(){_0x5a057c[_0x9e5e('0x21')](0xcc)[_0x9e5e('0x1b')]();});}})[_0x9e5e('0x4d')](function(_0x3dedbb){_0x5a057c[_0x9e5e('0x21')](0x1f4)['send'](_0x3dedbb);});});};exports[_0x9e5e('0x73')]=function(_0x24af19,_0x2de61d,_0x2562ce){return db[_0x9e5e('0x45')][_0x9e5e('0x74')]({'where':{'id':_0x24af19[_0x9e5e('0x4b')]['id']}})[_0x9e5e('0x28')](handleEntityNotFound(_0x2de61d,null))[_0x9e5e('0x28')](function(_0x1cd3c1){if(!_0x24af19[_0x9e5e('0x34')][_0x9e5e('0x75')]||!utils[_0x9e5e('0x76')](_0x24af19[_0x9e5e('0x34')][_0x9e5e('0x75')])){throw new db[(_0x9e5e('0x5b'))][(_0x9e5e('0x77'))]('Unknown\x20channel');}var _0x3b73ee={};var _0x419040={};_0x419040['model']=_['keys'](db[_[_0x9e5e('0x78')](_0x24af19[_0x9e5e('0x34')]['channel'][_0x9e5e('0x79')]())+'Queue']['rawAttributes']);_0x419040[_0x9e5e('0x34')]=_[_0x9e5e('0x35')](_0x24af19['query']);_0x419040[_0x9e5e('0x36')]=_['intersection'](_0x419040[_0x9e5e('0x33')],_0x419040[_0x9e5e('0x34')]);_0x3b73ee[_0x9e5e('0x39')]=_[_0x9e5e('0x37')](_0x419040[_0x9e5e('0x33')],qs[_0x9e5e('0x38')](_0x24af19[_0x9e5e('0x34')][_0x9e5e('0x38')]));_0x3b73ee[_0x9e5e('0x39')]=_0x3b73ee[_0x9e5e('0x39')]['length']?_0x3b73ee[_0x9e5e('0x39')]:_0x419040[_0x9e5e('0x33')];_0x3b73ee[_0x9e5e('0x1f')]=qs['limit'](_0x24af19['query'][_0x9e5e('0x1f')]);_0x3b73ee[_0x9e5e('0x1d')]=qs[_0x9e5e('0x1d')](_0x24af19[_0x9e5e('0x34')][_0x9e5e('0x1d')]);_0x3b73ee[_0x9e5e('0x3d')]=qs['sort'](_0x24af19[_0x9e5e('0x34')][_0x9e5e('0x3e')]);_0x3b73ee[_0x9e5e('0x41')]=qs[_0x9e5e('0x36')](_['pick'](_0x24af19[_0x9e5e('0x34')],_0x419040[_0x9e5e('0x36')]));_0x3b73ee=_[_0x9e5e('0x43')]({},_0x3b73ee,_0x24af19[_0x9e5e('0x44')]);return _0x1cd3c1[_0x9e5e('0x52')+_['capitalize'](_0x24af19['query'][_0x9e5e('0x75')][_0x9e5e('0x79')]())+'Queues'](_0x3b73ee);})[_0x9e5e('0x28')](respondWithResult(_0x2de61d,null))[_0x9e5e('0x4d')](handleError(_0x2de61d,null));};exports[_0x9e5e('0x7a')]=function(_0x1b6656,_0x308a99,_0x4de83d){return db[_0x9e5e('0x45')][_0x9e5e('0x74')]({'where':{'id':_0x1b6656[_0x9e5e('0x4b')]['id']}})[_0x9e5e('0x28')](function(_0x154f66){if(_0x154f66){if(!_0x1b6656['body'][_0x9e5e('0x75')]||!utils[_0x9e5e('0x76')](_0x1b6656[_0x9e5e('0x58')][_0x9e5e('0x75')])){throw new db[(_0x9e5e('0x5b'))][(_0x9e5e('0x77'))]('Unknown\x20channel');}return _0x154f66[_0x9e5e('0x7b')+_['capitalize'](_0x1b6656[_0x9e5e('0x58')][_0x9e5e('0x75')][_0x9e5e('0x79')]())+'Queues'](_0x1b6656['body']['ids']);}return null;})[_0x9e5e('0x28')](handleEntityNotFound(_0x308a99,null))[_0x9e5e('0x28')](respondWithStatusCode(_0x308a99,null))[_0x9e5e('0x4d')](handleError(_0x308a99,null));};exports[_0x9e5e('0x7c')]=function(_0x4ff024,_0x95ca74,_0x2064b5){return db[_0x9e5e('0x45')][_0x9e5e('0x74')]({'where':{'id':_0x4ff024['params']['id']}})[_0x9e5e('0x28')](function(_0x3d11bd){if(_0x3d11bd){if(!_0x4ff024[_0x9e5e('0x34')]['channel']||!utils[_0x9e5e('0x76')](_0x4ff024[_0x9e5e('0x34')][_0x9e5e('0x75')])){throw new db[(_0x9e5e('0x5b'))][(_0x9e5e('0x77'))](_0x9e5e('0x7d'));}return _0x3d11bd[_0x9e5e('0x7e')+_[_0x9e5e('0x78')](_0x4ff024['query'][_0x9e5e('0x75')][_0x9e5e('0x79')]())+_0x9e5e('0x7f')](_0x4ff024[_0x9e5e('0x34')]['ids']);}return null;})[_0x9e5e('0x28')](handleEntityNotFound(_0x95ca74,null))[_0x9e5e('0x28')](respondWithStatusCode(_0x95ca74,null))[_0x9e5e('0x4d')](handleError(_0x95ca74,null));};exports['addAgents']=function(_0x3bd659,_0x5cf79c){var _0x4ad7d0=_['isArray'](_0x3bd659[_0x9e5e('0x58')][_0x9e5e('0x80')])?_0x3bd659['body'][_0x9e5e('0x80')]:[_0x3bd659[_0x9e5e('0x58')][_0x9e5e('0x80')]];var _0x4398b6=_0x3bd659[_0x9e5e('0x4b')]['id'];return db[_0x9e5e('0x45')][_0x9e5e('0x4c')]({'where':{'id':_0x4398b6}})[_0x9e5e('0x28')](handleEntityNotFound(_0x5cf79c,null))['then'](function(_0x4cf10a){if(_0x4cf10a){var _0x237d16=['Voice',_0x9e5e('0x81'),_0x9e5e('0x82'),'Sms',_0x9e5e('0x83'),_0x9e5e('0x84'),_0x9e5e('0x85')];return db[_0x9e5e('0x5e')]['transaction'](function(_0x2225d6){var _0x248f93=_['map'](_0x237d16,function(_0x50bbb5){var _0x1ab862={'attributes':['id','name']};if(_0x50bbb5===_0x9e5e('0x86')){_0x1ab862[_0x9e5e('0x87')]={'attributes':[_0x9e5e('0x88')]};}return _0x4cf10a['get'+_0x50bbb5+_0x9e5e('0x7f')](_0x1ab862)[_0x9e5e('0x28')](function(_0x49cf01){var _0x53f467=_['map'](_0x49cf01,function(_0x2caf4d){var _0x40a8db=_[_0x9e5e('0x2e')](_0x4ad7d0,function(_0x560c77){var _0x5e1040={'where':{'UserId':_0x560c77,[_0x50bbb5+_0x9e5e('0x89')]:_0x2caf4d['id']},'transaction':_0x2225d6};if(_0x50bbb5===_0x9e5e('0x86')){_0x5e1040[_0x9e5e('0x8a')]={'penalty':_0x2caf4d[_0x9e5e('0x8b')]['penalty']};}return db[_0x9e5e('0x8c')+_0x50bbb5+_0x9e5e('0x8d')][_0x9e5e('0x8e')](_0x5e1040)['then'](function(){socket[_0x9e5e('0x8f')](_0x9e5e('0x4f')+_0x50bbb5+_0x9e5e('0x90'),{'UserId':_0x560c77,[_0x50bbb5+_0x9e5e('0x89')]:_0x2caf4d['id']});if(_0x50bbb5!==_0x9e5e('0x86')){return;}return db[_0x9e5e('0x8c')]['findAll']({'where':{'id':_0x4ad7d0,'online':0x1},'attributes':['id','name',_0x9e5e('0x91'),_0x9e5e('0x92'),_0x9e5e('0x93')],'raw':!![]})[_0x9e5e('0x28')](function(_0x118b1f){var _0x5cfe4c=_[_0x9e5e('0x2e')](_0x118b1f,function(_0xb2cbd7){return db[_0x9e5e('0x94')][_0x9e5e('0x95')]({'membername':_0xb2cbd7[_0x9e5e('0x2b')],'UserId':_0xb2cbd7['id'],'queue_name':_0x2caf4d[_0x9e5e('0x2b')],'VoiceQueueId':_0x2caf4d['id'],'interface':_[_0x9e5e('0x96')](_0xb2cbd7['interface'])?util['format'](_0x9e5e('0x97'),_0xb2cbd7[_0x9e5e('0x2b')]):_0xb2cbd7[_0x9e5e('0x93')],'paused':_0xb2cbd7[_0x9e5e('0x92')]||![],'penalty':_0x2caf4d[_0x9e5e('0x8b')][_0x9e5e('0x88')]},{'transaction':_0x2225d6});});return Promise[_0x9e5e('0x98')](_0x5cfe4c);});});});return Promise['all'](_0x40a8db);});return Promise[_0x9e5e('0x98')](_0x53f467);})[_0x9e5e('0x28')](function(){return db[_0x9e5e('0x70')][_0x9e5e('0x74')]({'where':{'teamId':_0x4398b6}})[_0x9e5e('0x28')](function(_0x12269f){if(_0x12269f){var _0x5043c7=_['map'](_0x4ad7d0,function(_0x1fe409){db[_0x9e5e('0x71')]['upsert']({'UserId':_0x1fe409,'VoicePrefixId':_0x12269f['VoicePrefixId']});});return Promise[_0x9e5e('0x98')](_0x5043c7);}});});});return Promise[_0x9e5e('0x98')](_0x248f93)[_0x9e5e('0x28')](function(){return _0x4cf10a['addAgents'](_0x4ad7d0,{'transaction':_0x2225d6})[_0x9e5e('0x99')](function(_0x21dbd9){return _0x21dbd9;});});});}})[_0x9e5e('0x28')](respondWithResult(_0x5cf79c,null))[_0x9e5e('0x4d')](handleError(_0x5cf79c,null));};exports['removeAgents']=function(_0x2210fb,_0x1624de){var _0x3e41ba=_['isArray'](_0x2210fb['query']['ids'])?_0x2210fb[_0x9e5e('0x34')][_0x9e5e('0x80')]:[_0x2210fb['query'][_0x9e5e('0x80')]];var _0x17410a=_0x2210fb['params']['id'];return db[_0x9e5e('0x45')][_0x9e5e('0x4c')]({'where':{'id':_0x17410a}})[_0x9e5e('0x28')](handleEntityNotFound(_0x1624de,null))[_0x9e5e('0x28')](function(_0x4af027){if(_0x4af027){var _0x12a32d=[_0x9e5e('0x86'),_0x9e5e('0x81'),'Mail',_0x9e5e('0x9a'),_0x9e5e('0x83'),'Openchannel',_0x9e5e('0x85')];return db[_0x9e5e('0x5e')][_0x9e5e('0x9b')](function(_0x45431f){var _0x551a7a=_[_0x9e5e('0x2e')](_0x12a32d,function(_0xf0805f){var _0x260391={'attributes':['id','name']};return _0x4af027['get'+_0xf0805f+_0x9e5e('0x7f')](_0x260391)[_0x9e5e('0x28')](function(_0x5def73){var _0x880d5d=_['map'](_0x5def73,function(_0x1a93a){return _0x1a93a['removeAgents'](_0x3e41ba,{'transaction':_0x45431f})[_0x9e5e('0x28')](function(){var _0xd67c71=_[_0x9e5e('0x2e')](_0x3e41ba,function(_0x9b39d7){socket[_0x9e5e('0x8f')](_0x9e5e('0x4f')+_0xf0805f+_0x9e5e('0x9c'),{'UserId':Number(_0x9b39d7),[_0xf0805f+_0x9e5e('0x89')]:_0x1a93a['id']});if(_0xf0805f!==_0x9e5e('0x86')){return;}return db[_0x9e5e('0x94')][_0x9e5e('0x59')]({'where':{'VoiceQueueId':_0x1a93a['id'],'UserId':_0x9b39d7},'transaction':_0x45431f});});return Promise[_0x9e5e('0x98')](_0xd67c71);});});return Promise[_0x9e5e('0x98')](_0x880d5d);});});return Promise['all'](_0x551a7a)[_0x9e5e('0x28')](function(){return _0x4af027['removeAgents'](_0x3e41ba,{'transaction':_0x45431f});})[_0x9e5e('0x28')](function(){return db[_0x9e5e('0x70')][_0x9e5e('0x74')]({'where':{'teamId':_0x17410a}})[_0x9e5e('0x28')](function(_0x24d6c0){if(_0x24d6c0){var _0x2a3504=_[_0x9e5e('0x2e')](_0x3e41ba,function(_0x2f322b){db[_0x9e5e('0x71')]['destroy']({'where':{'UserId':_0x2f322b,'VoicePrefixId':_0x24d6c0[_0x9e5e('0x72')]}});});return Promise[_0x9e5e('0x98')](_0x2a3504);}});});});}})[_0x9e5e('0x28')](respondWithStatusCode(_0x1624de,null))[_0x9e5e('0x4d')](handleError(_0x1624de,null));};exports[_0x9e5e('0x9d')]=function(_0x15df28,_0x239ea2,_0x5dc571){var _0x1792c0={};var _0x2f5034={};var _0x1286f3;var _0x3ed47b;return db['Team'][_0x9e5e('0x74')]({'where':{'id':_0x15df28[_0x9e5e('0x4b')]['id']}})[_0x9e5e('0x28')](handleEntityNotFound(_0x239ea2,null))[_0x9e5e('0x28')](function(_0x175965){if(_0x175965){_0x1286f3=_0x175965;_0x2f5034[_0x9e5e('0x33')]=_[_0x9e5e('0x35')](db['User']['rawAttributes']);_0x2f5034['query']=_[_0x9e5e('0x35')](_0x15df28[_0x9e5e('0x34')]);_0x2f5034[_0x9e5e('0x36')]=_[_0x9e5e('0x37')](_0x2f5034[_0x9e5e('0x33')],_0x2f5034['query']);_0x1792c0[_0x9e5e('0x39')]=_[_0x9e5e('0x37')](_0x2f5034[_0x9e5e('0x33')],qs[_0x9e5e('0x38')](_0x15df28[_0x9e5e('0x34')][_0x9e5e('0x38')]));_0x1792c0[_0x9e5e('0x39')]=_0x1792c0[_0x9e5e('0x39')][_0x9e5e('0x3a')]?_0x1792c0['attributes']:_0x2f5034[_0x9e5e('0x33')];_0x1792c0['order']=qs[_0x9e5e('0x3e')](_0x15df28[_0x9e5e('0x34')][_0x9e5e('0x3e')]);_0x1792c0[_0x9e5e('0x41')]=qs[_0x9e5e('0x36')](_[_0x9e5e('0x3f')](_0x15df28[_0x9e5e('0x34')],_0x2f5034[_0x9e5e('0x36')]));if(_0x15df28[_0x9e5e('0x34')][_0x9e5e('0x40')]){_0x1792c0[_0x9e5e('0x41')]=_[_0x9e5e('0x43')](_0x1792c0[_0x9e5e('0x41')],{'$or':_['map'](_0x1792c0[_0x9e5e('0x39')],function(_0x1bbf5a){var _0x621b9c={};_0x621b9c[_0x1bbf5a]={'$like':'%'+_0x15df28['query']['filter']+'%'};return _0x621b9c;})});}_0x1792c0=_[_0x9e5e('0x43')]({},_0x1792c0,_0x15df28[_0x9e5e('0x44')]);return _0x1286f3[_0x9e5e('0x9d')](_0x1792c0);}})['then'](function(_0x272423){if(_0x272423){_0x3ed47b=_0x272423[_0x9e5e('0x3a')];if(!_0x15df28[_0x9e5e('0x34')][_0x9e5e('0x3b')](_0x9e5e('0x3c'))){_0x1792c0[_0x9e5e('0x1f')]=qs[_0x9e5e('0x1f')](_0x15df28[_0x9e5e('0x34')][_0x9e5e('0x1f')]);_0x1792c0[_0x9e5e('0x1d')]=qs[_0x9e5e('0x1d')](_0x15df28[_0x9e5e('0x34')]['offset']);}return _0x1286f3[_0x9e5e('0x9d')](_0x1792c0);}})[_0x9e5e('0x28')](function(_0x5bcd91){if(_0x5bcd91){return _0x5bcd91?{'count':_0x3ed47b,'rows':_0x5bcd91}:null;}})[_0x9e5e('0x28')](respondWithResult(_0x239ea2,null))['catch'](handleError(_0x239ea2,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a4dbb78..42f060a 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 _0xd9e3=['hook','events','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x241411,_0x5e38ae){var _0x562761=function(_0x5a5cb3){while(--_0x5a5cb3){_0x241411['push'](_0x241411['shift']());}};_0x562761(++_0x5e38ae);}(_0xd9e3,0x73));var _0x3d9e=function(_0x456816,_0x5e5ee0){_0x456816=_0x456816-0x0;var _0x1be256=_0xd9e3[_0x456816];return _0x1be256;};'use strict';var EventEmitter=require(_0x3d9e('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x3d9e('0x1')](0x0);var events={'afterCreate':_0x3d9e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8f18d2){return function(_0x1e8427,_0x4ae736,_0x42e003){TeamEvents[_0x3d9e('0x3')](_0x8f18d2+':'+_0x1e8427['id'],_0x1e8427);TeamEvents[_0x3d9e('0x3')](_0x8f18d2,_0x1e8427);_0x42e003(null);};}for(var e in events){if(events[_0x3d9e('0x4')](e)){var event=events[e];Team[_0x3d9e('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xef56=['Team','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3e2c74,_0x10bf0a){var _0xf59c04=function(_0x56d190){while(--_0x56d190){_0x3e2c74['push'](_0x3e2c74['shift']());}};_0xf59c04(++_0x10bf0a);}(_0xef56,0x7d));var _0x6ef5=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xef56[_0x382c73];return _0x1dd0bf;};'use strict';var EventEmitter=require(_0x6ef5('0x0'));var Team=require('../../mysqldb')['db'][_0x6ef5('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6ef5('0x2'),'afterUpdate':_0x6ef5('0x3'),'afterDestroy':_0x6ef5('0x4')};function emitEvent(_0xd14c18){return function(_0x1fa673,_0x17893d,_0x402c67){TeamEvents[_0x6ef5('0x5')](_0xd14c18+':'+_0x1fa673['id'],_0x1fa673);TeamEvents[_0x6ef5('0x5')](_0xd14c18,_0x1fa673);_0x402c67(null);};}for(var e in events){if(events[_0x6ef5('0x6')](e)){var event=events[e];Team[_0x6ef5('0x7')](e,emitEvent(event));}}module[_0x6ef5('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 0394637..f7c1ff5 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 _0x329b=['exports','define','Team','teams','Mail','Openchannel','Sms','Voice','resolve','map','lodash','./team.attributes','get','then'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x329b,0x192));var _0xb329=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x329b[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0xb329('0x0'));var attributes=require(_0xb329('0x1'));function getQueuesByChannel(_0x1a2d73,_0x5431b1){var _0x19ed19=_0xb329('0x2')+_0x5431b1+'Queues';return _0x1a2d73[_0x19ed19]()[_0xb329('0x3')](function(_0x34fabe){return _['map'](_0x34fabe,function(_0x3a595f){_0x3a595f['setDataValue']('channel',_0x5431b1);return _0x3a595f;});})['catch'](function(_0x93f68){throw _0x93f68;});}module[_0xb329('0x4')]=function(_0xd8df20){return _0xd8df20[_0xb329('0x5')](_0xb329('0x6'),attributes,{'tableName':_0xb329('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1031bd=this;var _0x489e1a=['Chat','Fax',_0xb329('0x8'),_0xb329('0x9'),_0xb329('0xa'),_0xb329('0xb'),'Whatsapp'];return Promise[_0xb329('0xc')]()['then'](function(){var _0x318f56=_[_0xb329('0xd')](_0x489e1a,function(_0x3c0941){return getQueuesByChannel(_0x1031bd,_0x3c0941);});return Promise['all'](_0x318f56);})['catch'](function(_0x512eb6){throw _0x512eb6;});}}});}; \ No newline at end of file +var _0xd83c=['all','./team.attributes','Queues','then','map','setDataValue','channel','catch','exports','define','teams','Chat','Fax','Openchannel','Whatsapp','resolve'];(function(_0x1ac6ec,_0x1f81fc){var _0x48a489=function(_0xf38b04){while(--_0xf38b04){_0x1ac6ec['push'](_0x1ac6ec['shift']());}};_0x48a489(++_0x1f81fc);}(_0xd83c,0x101));var _0xcd83=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xd83c[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require('lodash');var attributes=require(_0xcd83('0x0'));function getQueuesByChannel(_0x167848,_0x124fc1){var _0x2fd3f1='get'+_0x124fc1+_0xcd83('0x1');return _0x167848[_0x2fd3f1]()[_0xcd83('0x2')](function(_0x4cd344){return _[_0xcd83('0x3')](_0x4cd344,function(_0x4cfcd6){_0x4cfcd6[_0xcd83('0x4')](_0xcd83('0x5'),_0x124fc1);return _0x4cfcd6;});})[_0xcd83('0x6')](function(_0x319b93){throw _0x319b93;});}module[_0xcd83('0x7')]=function(_0x48a065){return _0x48a065[_0xcd83('0x8')]('Team',attributes,{'tableName':_0xcd83('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x17ee39=this;var _0x2c569a=[_0xcd83('0xa'),_0xcd83('0xb'),'Mail',_0xcd83('0xc'),'Sms','Voice',_0xcd83('0xd')];return Promise[_0xcd83('0xe')]()[_0xcd83('0x2')](function(){var _0x493c84=_[_0xcd83('0x3')](_0x2c569a,function(_0x1e72d7){return getQueuesByChannel(_0x17ee39,_0x1e72d7);});return Promise[_0xcd83('0xf')](_0x493c84);})[_0xcd83('0x6')](function(_0x217d45){throw _0x217d45;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index ea606c9..3f38e39 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 _0xb45d=['error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','redis','defaults','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x47b09d,_0x1e364f){var _0x18755b=function(_0x298ca7){while(--_0x298ca7){_0x47b09d['push'](_0x47b09d['shift']());}};_0x18755b(++_0x1e364f);}(_0xb45d,0x1ec));var _0xdb45=function(_0x483ab9,_0x419148){_0x483ab9=_0x483ab9-0x0;var _0x35043b=_0xb45d[_0x483ab9];return _0x35043b;};'use strict';var _=require(_0xdb45('0x0'));var util=require(_0xdb45('0x1'));var moment=require(_0xdb45('0x2'));var BPromise=require(_0xdb45('0x3'));var rs=require(_0xdb45('0x4'));var fs=require('fs');var Redis=require(_0xdb45('0x5'));var db=require(_0xdb45('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdb45('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdb45('0x8')]({'port':0x232a});config[_0xdb45('0x9')]=_[_0xdb45('0xa')](config[_0xdb45('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb45('0xb'))(new Redis(config[_0xdb45('0x9')]));require(_0xdb45('0xc'))[_0xdb45('0xd')](socket);function respondWithRpcPromise(_0x57f35b,_0x1ae8ba,_0x435a16){return new BPromise(function(_0xb431a9,_0x1d2f43){return client[_0xdb45('0xe')](_0x57f35b,_0x435a16)[_0xdb45('0xf')](function(_0x815d43){logger[_0xdb45('0x10')]('Team,\x20%s,\x20%s',_0x1ae8ba,_0xdb45('0x11'));logger[_0xdb45('0x12')](_0xdb45('0x13'),_0x1ae8ba,_0xdb45('0x11'),JSON[_0xdb45('0x14')](_0x815d43));if(_0x815d43['error']){if(_0x815d43[_0xdb45('0x15')][_0xdb45('0x16')]===0x1f4){logger[_0xdb45('0x15')](_0xdb45('0x17'),_0x1ae8ba,_0x815d43[_0xdb45('0x15')]['message']);return _0x1d2f43(_0x815d43['error'][_0xdb45('0x18')]);}logger[_0xdb45('0x15')](_0xdb45('0x17'),_0x1ae8ba,_0x815d43[_0xdb45('0x15')][_0xdb45('0x18')]);return _0xb431a9(_0x815d43[_0xdb45('0x15')]['message']);}else{logger[_0xdb45('0x10')](_0xdb45('0x17'),_0x1ae8ba,_0xdb45('0x11'));_0xb431a9(_0x815d43[_0xdb45('0x19')][_0xdb45('0x18')]);}})[_0xdb45('0x1a')](function(_0x2a5da3){logger[_0xdb45('0x15')](_0xdb45('0x17'),_0x1ae8ba,_0x2a5da3);_0x1d2f43(_0x2a5da3);});});} \ No newline at end of file +var _0x39cc=['request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s'];(function(_0x708c47,_0x6eaa1f){var _0x52a470=function(_0x14a750){while(--_0x14a750){_0x708c47['push'](_0x708c47['shift']());}};_0x52a470(++_0x6eaa1f);}(_0x39cc,0x104));var _0xc39c=function(_0x88be7b,_0x2403af){_0x88be7b=_0x88be7b-0x0;var _0x100b31=_0x39cc[_0x88be7b];return _0x100b31;};'use strict';var _=require(_0xc39c('0x0'));var util=require(_0xc39c('0x1'));var moment=require(_0xc39c('0x2'));var BPromise=require('bluebird');var rs=require(_0xc39c('0x3'));var fs=require('fs');var Redis=require(_0xc39c('0x4'));var db=require(_0xc39c('0x5'))['db'];var utils=require(_0xc39c('0x6'));var logger=require('../../config/logger')(_0xc39c('0x7'));var config=require(_0xc39c('0x8'));var jayson=require(_0xc39c('0x9'));var client=jayson[_0xc39c('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xc39c('0xb')],{'host':_0xc39c('0xc'),'port':0x18eb});var socket=require(_0xc39c('0xd'))(new Redis(config[_0xc39c('0xb')]));require(_0xc39c('0xe'))[_0xc39c('0xf')](socket);function respondWithRpcPromise(_0x568295,_0x5aa8c2,_0x3b6021){return new BPromise(function(_0x2923be,_0x1b8892){return client[_0xc39c('0x10')](_0x568295,_0x3b6021)[_0xc39c('0x11')](function(_0x4e2839){logger[_0xc39c('0x12')](_0xc39c('0x13'),_0x5aa8c2,_0xc39c('0x14'));logger[_0xc39c('0x15')](_0xc39c('0x16'),_0x5aa8c2,_0xc39c('0x14'),JSON[_0xc39c('0x17')](_0x4e2839));if(_0x4e2839[_0xc39c('0x18')]){if(_0x4e2839['error']['code']===0x1f4){logger[_0xc39c('0x18')](_0xc39c('0x13'),_0x5aa8c2,_0x4e2839[_0xc39c('0x18')]['message']);return _0x1b8892(_0x4e2839[_0xc39c('0x18')][_0xc39c('0x19')]);}logger['error'](_0xc39c('0x13'),_0x5aa8c2,_0x4e2839[_0xc39c('0x18')][_0xc39c('0x19')]);return _0x2923be(_0x4e2839[_0xc39c('0x18')][_0xc39c('0x19')]);}else{logger['info'](_0xc39c('0x13'),_0x5aa8c2,'request\x20sent');_0x2923be(_0x4e2839[_0xc39c('0x1a')][_0xc39c('0x19')]);}})[_0xc39c('0x1b')](function(_0x30a7c4){logger[_0xc39c('0x18')](_0xc39c('0x13'),_0x5aa8c2,_0x30a7c4);_0x1b8892(_0x30a7c4);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index de00811..3907f1d 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 _0x6c38=['save','remove','update','removeListener','length','./team.events'];(function(_0xe7ba9,_0x2ff262){var _0x34e6bd=function(_0x4b52e0){while(--_0x4b52e0){_0xe7ba9['push'](_0xe7ba9['shift']());}};_0x34e6bd(++_0x2ff262);}(_0x6c38,0x8f));var _0x86c3=function(_0x3256c6,_0x3166f8){_0x3256c6=_0x3256c6-0x0;var _0x19ae14=_0x6c38[_0x3256c6];return _0x19ae14;};'use strict';var TeamEvents=require(_0x86c3('0x0'));var events=[_0x86c3('0x1'),_0x86c3('0x2'),_0x86c3('0x3')];function createListener(_0x322e8c,_0x4daf60){return function(_0x437549){_0x4daf60['emit'](_0x322e8c,_0x437549);};}function removeListener(_0x503f44,_0x55bdeb){return function(){TeamEvents[_0x86c3('0x4')](_0x503f44,_0x55bdeb);};}exports['register']=function(_0x26ba7b){for(var _0x5b38ae=0x0,_0x49ff58=events[_0x86c3('0x5')];_0x5b38ae<_0x49ff58;_0x5b38ae++){var _0xbde89c=events[_0x5b38ae];var _0x224109=createListener('team:'+_0xbde89c,_0x26ba7b);TeamEvents['on'](_0xbde89c,_0x224109);}}; \ No newline at end of file +var _0xdbfc=['removeListener','length','team:','./team.events','save','emit'];(function(_0x5b6187,_0x5dc1ba){var _0x4ca690=function(_0x2882c7){while(--_0x2882c7){_0x5b6187['push'](_0x5b6187['shift']());}};_0x4ca690(++_0x5dc1ba);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x381cb0,_0x957076){_0x381cb0=_0x381cb0-0x0;var _0x44562f=_0xdbfc[_0x381cb0];return _0x44562f;};'use strict';var TeamEvents=require(_0xcdbf('0x0'));var events=[_0xcdbf('0x1'),'remove','update'];function createListener(_0x364647,_0x3067d8){return function(_0x3db24f){_0x3067d8[_0xcdbf('0x2')](_0x364647,_0x3db24f);};}function removeListener(_0x26c4cf,_0x1c2ce4){return function(){TeamEvents[_0xcdbf('0x3')](_0x26c4cf,_0x1c2ce4);};}exports['register']=function(_0x3ffa10){for(var _0x4129cf=0x0,_0x54aeaf=events[_0xcdbf('0x4')];_0x4129cf<_0x54aeaf;_0x4129cf++){var _0x3c077d=events[_0x4129cf];var _0x409a4e=createListener(_0xcdbf('0x5')+_0x3c077d,_0x3ffa10);TeamEvents['on'](_0x3c077d,_0x409a4e);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index dfd590e..021ef5e 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 _0x6325=['sequelize','exports'];(function(_0x53d026,_0x2384ff){var _0xf1418e=function(_0x294e0b){while(--_0x294e0b){_0x53d026['push'](_0x53d026['shift']());}};_0xf1418e(++_0x2384ff);}(_0x6325,0xe8));var _0x5632=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6325[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x5632('0x0'));module[_0x5632('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa25d=['exports','INTEGER','sequelize'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0xa25d,0x194));var _0xda25=function(_0x1af469,_0x584d95){_0x1af469=_0x1af469-0x0;var _0x336171=_0xa25d[_0x1af469];return _0x336171;};'use strict';var Sequelize=require(_0xda25('0x0'));module[_0xda25('0x1')]={'TeamId':{'type':Sequelize[_0xda25('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xda25('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index eaed71c..5d060c4 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 _0xb910=['../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xe6aa41,_0x5e89ce){var _0x5e9d14=function(_0x424a45){while(--_0x424a45){_0xe6aa41['push'](_0xe6aa41['shift']());}};_0x5e9d14(++_0x5e89ce);}(_0xb910,0x12b));var _0x0b91=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xb910[_0x2f1762];return _0x8ab21;};'use strict';var _=require(_0x0b91('0x0'));var util=require(_0x0b91('0x1'));var logger=require(_0x0b91('0x2'))(_0x0b91('0x3'));var moment=require(_0x0b91('0x4'));var BPromise=require(_0x0b91('0x5'));var rp=require(_0x0b91('0x6'));var fs=require('fs');var path=require(_0x0b91('0x7'));var rimraf=require(_0x0b91('0x8'));var config=require(_0x0b91('0x9'));var attributes=require(_0x0b91('0xa'));module[_0x0b91('0xb')]=function(_0x295749,_0x1800dc){return _0x295749['define'](_0x0b91('0xc'),attributes,{'tableName':_0x0b91('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddb8=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xddb8,0xd7));var _0x8ddb=function(_0x48aa43,_0x3d8bce){_0x48aa43=_0x48aa43-0x0;var _0x2a90da=_0xddb8[_0x48aa43];return _0x2a90da;};'use strict';var _=require('lodash');var util=require(_0x8ddb('0x0'));var logger=require(_0x8ddb('0x1'))(_0x8ddb('0x2'));var moment=require('moment');var BPromise=require(_0x8ddb('0x3'));var rp=require(_0x8ddb('0x4'));var fs=require('fs');var path=require(_0x8ddb('0x5'));var rimraf=require(_0x8ddb('0x6'));var config=require(_0x8ddb('0x7'));var attributes=require(_0x8ddb('0x8'));module['exports']=function(_0x5a52ec,_0x2ebc4b){return _0x5a52ec[_0x8ddb('0x9')]('TeamVoicePrefix',attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b1b31b6..5cf5add 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3c6928,_0x45e261){var _0x2dd931=function(_0x3960e1){while(--_0x3960e1){_0x3c6928['push'](_0x3c6928['shift']());}};_0x2dd931(++_0x45e261);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0xcb91[_0x2ab3d9];return _0x210a54;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3bf146,_0x3c40e1){var _0x2c3d2b=function(_0x46cd5d){while(--_0x46cd5d){_0x3bf146['push'](_0x3bf146['shift']());}};_0x2c3d2b(++_0x3c40e1);}(_0xe706,0xa3));var _0x6e70=function(_0x388899,_0x17f370){_0x388899=_0x388899-0x0;var _0x3be17d=_0xe706[_0x388899];return _0x3be17d;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 6612178..5af5e0f 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 _0xae3c=['sequelize','INTEGER'];(function(_0x54ba26,_0x301c1f){var _0x36ce4e=function(_0x227ccb){while(--_0x227ccb){_0x54ba26['push'](_0x54ba26['shift']());}};_0x36ce4e(++_0x301c1f);}(_0xae3c,0x104));var _0xcae3=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xae3c[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xcae3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcae3('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9dd1=['exports','INTEGER'];(function(_0x22abf5,_0x311567){var _0x38ef30=function(_0x595c11){while(--_0x595c11){_0x22abf5['push'](_0x22abf5['shift']());}};_0x38ef30(++_0x311567);}(_0x9dd1,0x160));var _0x19dd=function(_0x43a6cd,_0x503d1a){_0x43a6cd=_0x43a6cd-0x0;var _0x5acb36=_0x9dd1[_0x43a6cd];return _0x5acb36;};'use strict';var Sequelize=require('sequelize');module[_0x19dd('0x0')]={'penalty':{'type':Sequelize[_0x19dd('0x1')],'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 93e422c..6a9726f 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 _0xd246=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util'];(function(_0x5aab24,_0x3c8d4d){var _0x503327=function(_0xcc599){while(--_0xcc599){_0x5aab24['push'](_0x5aab24['shift']());}};_0x503327(++_0x3c8d4d);}(_0xd246,0xf5));var _0x6d24=function(_0x37bf43,_0x5b2339){_0x37bf43=_0x37bf43-0x0;var _0x4101c5=_0xd246[_0x37bf43];return _0x4101c5;};'use strict';var _=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var logger=require(_0x6d24('0x2'))(_0x6d24('0x3'));var moment=require(_0x6d24('0x4'));var BPromise=require(_0x6d24('0x5'));var rp=require(_0x6d24('0x6'));var fs=require('fs');var path=require(_0x6d24('0x7'));var rimraf=require('rimraf');var config=require(_0x6d24('0x8'));var attributes=require('./teamVoiceQueue.attributes');module[_0x6d24('0x9')]=function(_0x536c95,_0xa72e6e){return _0x536c95[_0x6d24('0xa')](_0x6d24('0xb'),attributes,{'tableName':_0x6d24('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc298=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0xc298,0x143));var _0x8c29=function(_0x53ae30,_0x194de8){_0x53ae30=_0x53ae30-0x0;var _0x3de7cd=_0xc298[_0x53ae30];return _0x3de7cd;};'use strict';var _=require('lodash');var util=require(_0x8c29('0x0'));var logger=require(_0x8c29('0x1'))(_0x8c29('0x2'));var moment=require(_0x8c29('0x3'));var BPromise=require(_0x8c29('0x4'));var rp=require(_0x8c29('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c29('0x6'));var config=require(_0x8c29('0x7'));var attributes=require(_0x8c29('0x8'));module[_0x8c29('0x9')]=function(_0x6cac5d,_0x50a81c){return _0x6cac5d[_0x8c29('0xa')](_0x8c29('0xb'),attributes,{'tableName':_0x8c29('0xc'),'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 f172dfc..2de81fa 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 _0x6c96=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x363010,_0xf95154){var _0x3c3f56=function(_0xcaf55b){while(--_0xcaf55b){_0x363010['push'](_0x363010['shift']());}};_0x3c3f56(++_0xf95154);}(_0x6c96,0x1c1));var _0x66c9=function(_0x103759,_0x3809f6){_0x103759=_0x103759-0x0;var _0x2e6e8b=_0x6c96[_0x103759];return _0x2e6e8b;};'use strict';var _=require(_0x66c9('0x0'));var util=require('util');var moment=require(_0x66c9('0x1'));var BPromise=require(_0x66c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66c9('0x3'));var db=require(_0x66c9('0x4'))['db'];var utils=require(_0x66c9('0x5'));var logger=require(_0x66c9('0x6'))(_0x66c9('0x7'));var config=require(_0x66c9('0x8'));var jayson=require(_0x66c9('0x9'));var client=jayson['client'][_0x66c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c6baa,_0xb03819,_0x4d7692){return new BPromise(function(_0x55b488,_0xfc41a4){return client[_0x66c9('0xb')](_0x4c6baa,_0x4d7692)[_0x66c9('0xc')](function(_0x2e8ad5){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0xb03819,'request\x20sent');logger['debug'](_0x66c9('0xd'),_0xb03819,_0x66c9('0xe'),JSON[_0x66c9('0xf')](_0x2e8ad5));if(_0x2e8ad5['error']){if(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x11')]===0x1f4){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5['error'][_0x66c9('0x13')]);return _0xfc41a4(_0x2e8ad5['error'][_0x66c9('0x13')]);}logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x2e8ad5[_0x66c9('0x10')]['message']);return _0x55b488(_0x2e8ad5[_0x66c9('0x10')][_0x66c9('0x13')]);}else{logger['info'](_0x66c9('0x12'),_0xb03819,_0x66c9('0xe'));_0x55b488(_0x2e8ad5[_0x66c9('0x14')][_0x66c9('0x13')]);}})[_0x66c9('0x15')](function(_0x14d989){logger[_0x66c9('0x10')](_0x66c9('0x12'),_0xb03819,_0x14d989);_0xfc41a4(_0x14d989);});});} \ No newline at end of file +var _0x8ebf=['TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x4c2384,_0x3e0fca){var _0x4696b6=function(_0x38cd89){while(--_0x38cd89){_0x4c2384['push'](_0x4c2384['shift']());}};_0x4696b6(++_0x3e0fca);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x8ebf[_0x2f9467];return _0x39894c;};'use strict';var _=require(_0xf8eb('0x0'));var util=require(_0xf8eb('0x1'));var moment=require(_0xf8eb('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8eb('0x3'));var fs=require('fs');var Redis=require(_0xf8eb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8eb('0x5'));var logger=require(_0xf8eb('0x6'))(_0xf8eb('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8eb('0x8'));var client=jayson[_0xf8eb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c91c,_0x2c2489,_0x2a1fb6){return new BPromise(function(_0x4c628d,_0x959b95){return client['request'](_0x30c91c,_0x2a1fb6)[_0xf8eb('0xa')](function(_0x4d1adc){logger[_0xf8eb('0xb')](_0xf8eb('0xc'),_0x2c2489,_0xf8eb('0xd'));logger['debug'](_0xf8eb('0xe'),_0x2c2489,_0xf8eb('0xd'),JSON[_0xf8eb('0xf')](_0x4d1adc));if(_0x4d1adc[_0xf8eb('0x10')]){if(_0x4d1adc[_0xf8eb('0x10')][_0xf8eb('0x11')]===0x1f4){logger[_0xf8eb('0x10')](_0xf8eb('0xc'),_0x2c2489,_0x4d1adc['error'][_0xf8eb('0x12')]);return _0x959b95(_0x4d1adc[_0xf8eb('0x10')][_0xf8eb('0x12')]);}logger[_0xf8eb('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2c2489,_0x4d1adc['error']['message']);return _0x4c628d(_0x4d1adc['error'][_0xf8eb('0x12')]);}else{logger[_0xf8eb('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x2c2489,_0xf8eb('0xd'));_0x4c628d(_0x4d1adc[_0xf8eb('0x13')][_0xf8eb('0x12')]);}})['catch'](function(_0x18dbbd){logger[_0xf8eb('0x10')](_0xf8eb('0xc'),_0x2c2489,_0x18dbbd);_0x959b95(_0x18dbbd);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 72c36c7..273b9ba 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 _0xd945=['./template.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c953b,_0x2f79a3){var _0x5e5a47=function(_0x2fd896){while(--_0x2fd896){_0x4c953b['push'](_0x4c953b['shift']());}};_0x5e5a47(++_0x2f79a3);}(_0xd945,0x84));var _0x5d94=function(_0x8c732d,_0x4ee1ff){_0x8c732d=_0x8c732d-0x0;var _0x42d329=_0xd945[_0x8c732d];return _0x42d329;};'use strict';var multer=require(_0x5d94('0x0'));var util=require(_0x5d94('0x1'));var path=require(_0x5d94('0x2'));var timeout=require('connect-timeout');var express=require(_0x5d94('0x3'));var router=express[_0x5d94('0x4')]();var fs_extra=require(_0x5d94('0x5'));var auth=require(_0x5d94('0x6'));var interaction=require(_0x5d94('0x7'));var config=require('../../config/environment');var controller=require(_0x5d94('0x8'));router[_0x5d94('0x9')]('/',auth[_0x5d94('0xa')](),controller[_0x5d94('0xb')]);router[_0x5d94('0x9')]('/:id',auth[_0x5d94('0xa')](),controller[_0x5d94('0xc')]);router[_0x5d94('0xd')]('/',auth['isAuthenticated'](),controller[_0x5d94('0xe')]);router[_0x5d94('0xf')](_0x5d94('0x10'),auth[_0x5d94('0xa')](),controller['update']);router[_0x5d94('0x11')]('/:id',auth[_0x5d94('0xa')](),controller[_0x5d94('0x12')]);module[_0x5d94('0x13')]=router; \ No newline at end of file +var _0xc274=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','post','create','put','isAuthenticated','update','destroy','exports','util','express','Router'];(function(_0x353275,_0x36b419){var _0x3097c3=function(_0x49e645){while(--_0x49e645){_0x353275['push'](_0x353275['shift']());}};_0x3097c3(++_0x36b419);}(_0xc274,0x151));var _0x4c27=function(_0x2dd88b,_0x4078f5){_0x2dd88b=_0x2dd88b-0x0;var _0x5eed67=_0xc274[_0x2dd88b];return _0x5eed67;};'use strict';var multer=require('multer');var util=require(_0x4c27('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4c27('0x1'));var router=express[_0x4c27('0x2')]();var fs_extra=require(_0x4c27('0x3'));var auth=require(_0x4c27('0x4'));var interaction=require(_0x4c27('0x5'));var config=require(_0x4c27('0x6'));var controller=require('./template.controller');router[_0x4c27('0x7')]('/',auth['isAuthenticated'](),controller[_0x4c27('0x8')]);router[_0x4c27('0x7')](_0x4c27('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4c27('0xa')]('/',auth['isAuthenticated'](),controller[_0x4c27('0xb')]);router[_0x4c27('0xc')](_0x4c27('0x9'),auth[_0x4c27('0xd')](),controller[_0x4c27('0xe')]);router['delete'](_0x4c27('0x9'),auth[_0x4c27('0xd')](),controller[_0x4c27('0xf')]);module[_0x4c27('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 50b1df9..049fa95 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 _0x305e=['sequelize','exports','STRING','TEXT'];(function(_0x36587e,_0x41f945){var _0x2b83a5=function(_0x2f9240){while(--_0x2f9240){_0x36587e['push'](_0x36587e['shift']());}};_0x2b83a5(++_0x41f945);}(_0x305e,0x164));var _0xe305=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x305e[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xe305('0x0'));module[_0xe305('0x1')]={'name':{'type':Sequelize[_0xe305('0x2')]},'description':{'type':Sequelize[_0xe305('0x2')]},'html':{'type':Sequelize[_0xe305('0x3')]}}; \ No newline at end of file +var _0xfce6=['TEXT','sequelize'];(function(_0x29b93d,_0x1a6632){var _0x848e7e=function(_0x55b674){while(--_0x55b674){_0x29b93d['push'](_0x29b93d['shift']());}};_0x848e7e(++_0x1a6632);}(_0xfce6,0xc7));var _0x6fce=function(_0x361098,_0x56950f){_0x361098=_0x361098-0x0;var _0x5f56f9=_0xfce6[_0x361098];return _0x5f56f9;};'use strict';var Sequelize=require(_0x6fce('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x6fce('0x1')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 11eed07..7cf32e8 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 _0x8e0c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Templates','UserProfileResource','end','stack','index','Template','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','user','role','UserProfileSection','find','autoAssociation','error','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0x8e0c,0x127));var _0xc8e0=function(_0x4b72d4,_0x1a3cfa){_0x4b72d4=_0x4b72d4-0x0;var _0x2435d2=_0x8e0c[_0x4b72d4];return _0x2435d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc8e0('0x0'));var rp=require(_0xc8e0('0x1'));var moment=require(_0xc8e0('0x2'));var BPromise=require(_0xc8e0('0x3'));var Mustache=require(_0xc8e0('0x4'));var util=require(_0xc8e0('0x5'));var path=require(_0xc8e0('0x6'));var sox=require(_0xc8e0('0x7'));var csv=require(_0xc8e0('0x8'));var ejs=require(_0xc8e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8e0('0xa'));var crypto=require(_0xc8e0('0xb'));var jsforce=require(_0xc8e0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc8e0('0x8'));var querystring=require('querystring');var Papa=require(_0xc8e0('0xd'));var Redis=require(_0xc8e0('0xe'));var authService=require(_0xc8e0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc8e0('0x10'));var hardwareService=require(_0xc8e0('0x11'));var logger=require(_0xc8e0('0x12'))(_0xc8e0('0x13'));var utils=require(_0xc8e0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc8e0('0x15'));var db=require(_0xc8e0('0x16'))['db'];function respondWithStatusCode(_0x37ce06,_0x935a61){_0x935a61=_0x935a61||0xcc;return function(_0x1bfc24){if(_0x1bfc24){return _0x37ce06[_0xc8e0('0x17')](_0x935a61);}return _0x37ce06[_0xc8e0('0x18')](_0x935a61)['end']();};}function respondWithResult(_0x1376e0,_0x6314cd){_0x6314cd=_0x6314cd||0xc8;return function(_0x56991d){if(_0x56991d){return _0x1376e0[_0xc8e0('0x18')](_0x6314cd)[_0xc8e0('0x19')](_0x56991d);}};}function respondWithFilteredResult(_0x1a7956,_0x5c1192){return function(_0x1d0eff){if(_0x1d0eff){var _0x6e6f94=typeof _0x5c1192[_0xc8e0('0x1a')]===_0xc8e0('0x1b')&&typeof _0x5c1192[_0xc8e0('0x1c')]===_0xc8e0('0x1b');var _0x268605=_0x1d0eff[_0xc8e0('0x1d')];var _0x189132=_0x6e6f94?0x0:_0x5c1192['offset'];var _0x5b136c=_0x6e6f94?_0x1d0eff[_0xc8e0('0x1d')]:_0x5c1192[_0xc8e0('0x1a')]+_0x5c1192[_0xc8e0('0x1c')];var _0x361fe7;if(_0x5b136c>=_0x268605){_0x5b136c=_0x268605;_0x361fe7=0xc8;}else{_0x361fe7=0xce;}_0x1a7956[_0xc8e0('0x18')](_0x361fe7);return _0x1a7956[_0xc8e0('0x1e')](_0xc8e0('0x1f'),_0x189132+'-'+_0x5b136c+'/'+_0x268605)[_0xc8e0('0x19')](_0x1d0eff);}return null;};}function patchUpdates(_0xcc7f56){return function(_0x472ec8){try{jsonpatch[_0xc8e0('0x20')](_0x472ec8,_0xcc7f56,!![]);}catch(_0x57fe3c){return BPromise['reject'](_0x57fe3c);}return _0x472ec8['save']();};}function saveUpdates(_0x2f658c,_0x10dd18){return function(_0x266635){if(_0x266635){return _0x266635[_0xc8e0('0x21')](_0x2f658c)[_0xc8e0('0x22')](function(_0x4c3622){return _0x4c3622;});}return null;};}function removeEntity(_0x28a52b,_0x2118fa){return function(_0x24006b){if(_0x24006b){return _0x24006b[_0xc8e0('0x23')]()[_0xc8e0('0x22')](function(){var _0x262df0=_0x24006b[_0xc8e0('0x24')]({'plain':!![]});var _0x1da428=_0xc8e0('0x25');return db[_0xc8e0('0x26')]['destroy']({'where':{'type':_0x1da428,'resourceId':_0x262df0['id']}})['then'](function(){return _0x24006b;});})[_0xc8e0('0x22')](function(){_0x28a52b[_0xc8e0('0x18')](0xcc)[_0xc8e0('0x27')]();});}};}function handleEntityNotFound(_0x36ecef,_0x3add86){return function(_0x1b4758){if(!_0x1b4758){_0x36ecef['sendStatus'](0x194);}return _0x1b4758;};}function handleError(_0x21ee23,_0x2748ff){_0x2748ff=_0x2748ff||0x1f4;return function(_0x449b17){logger['error'](_0x449b17[_0xc8e0('0x28')]);if(_0x449b17['name']){delete _0x449b17['name'];}_0x21ee23['status'](_0x2748ff)['send'](_0x449b17);};}exports[_0xc8e0('0x29')]=function(_0x1108bc,_0x49d87d){var _0x5749e6={},_0xd14c97={},_0x3dcb04={'count':0x0,'rows':[]};var _0x4b621f=_['map'](db[_0xc8e0('0x2a')][_0xc8e0('0x2b')],function(_0x4f803f){return{'name':_0x4f803f[_0xc8e0('0x2c')],'type':_0x4f803f[_0xc8e0('0x2d')][_0xc8e0('0x2e')]};});_0xd14c97[_0xc8e0('0x2f')]=_[_0xc8e0('0x30')](_0x4b621f,_0xc8e0('0x31'));_0xd14c97[_0xc8e0('0x32')]=_[_0xc8e0('0x33')](_0x1108bc[_0xc8e0('0x32')]);_0xd14c97[_0xc8e0('0x34')]=_['intersection'](_0xd14c97[_0xc8e0('0x2f')],_0xd14c97[_0xc8e0('0x32')]);_0x5749e6[_0xc8e0('0x35')]=_[_0xc8e0('0x36')](_0xd14c97[_0xc8e0('0x2f')],qs['fields'](_0x1108bc[_0xc8e0('0x32')]['fields']));_0x5749e6['attributes']=_0x5749e6[_0xc8e0('0x35')][_0xc8e0('0x37')]?_0x5749e6[_0xc8e0('0x35')]:_0xd14c97[_0xc8e0('0x2f')];if(!_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x38')]('nolimit')){_0x5749e6['limit']=qs[_0xc8e0('0x1c')](_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x1c')]);_0x5749e6[_0xc8e0('0x1a')]=qs[_0xc8e0('0x1a')](_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x1a')]);}_0x5749e6[_0xc8e0('0x39')]=qs['sort'](_0x1108bc[_0xc8e0('0x32')]['sort']);_0x5749e6[_0xc8e0('0x3a')]=qs[_0xc8e0('0x34')](_['pick'](_0x1108bc[_0xc8e0('0x32')],_0xd14c97[_0xc8e0('0x34')]),_0x4b621f);if(_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x3b')]){_0x5749e6[_0xc8e0('0x3a')]=_[_0xc8e0('0x3c')](_0x5749e6['where'],{'$or':_[_0xc8e0('0x30')](_0x4b621f,function(_0x3f470e){if(_0x3f470e['type']!=='VIRTUAL'){var _0x45e79f={};_0x45e79f[_0x3f470e[_0xc8e0('0x31')]]={'$like':'%'+_0x1108bc[_0xc8e0('0x32')]['filter']+'%'};return _0x45e79f;}})});}_0x5749e6=_[_0xc8e0('0x3c')]({},_0x5749e6,_0x1108bc[_0xc8e0('0x3d')]);var _0x599bb2={'where':_0x5749e6[_0xc8e0('0x3a')]};return db[_0xc8e0('0x2a')][_0xc8e0('0x1d')](_0x599bb2)[_0xc8e0('0x22')](function(_0x21f4fa){_0x3dcb04[_0xc8e0('0x1d')]=_0x21f4fa;if(_0x1108bc[_0xc8e0('0x32')][_0xc8e0('0x3e')]){_0x5749e6[_0xc8e0('0x3f')]=[{'all':!![]}];}return db['Template'][_0xc8e0('0x40')](_0x5749e6);})[_0xc8e0('0x22')](function(_0x202d88){_0x3dcb04[_0xc8e0('0x41')]=_0x202d88;return _0x3dcb04;})['then'](respondWithFilteredResult(_0x49d87d,_0x5749e6))[_0xc8e0('0x42')](handleError(_0x49d87d,null));};exports[_0xc8e0('0x43')]=function(_0x580e8b,_0x504c3a){var _0x1a98c1={'raw':!![],'where':{'id':_0x580e8b[_0xc8e0('0x44')]['id']}},_0x14e27a={};_0x14e27a[_0xc8e0('0x2f')]=_[_0xc8e0('0x33')](db[_0xc8e0('0x2a')]['rawAttributes']);_0x14e27a[_0xc8e0('0x32')]=_[_0xc8e0('0x33')](_0x580e8b[_0xc8e0('0x32')]);_0x14e27a[_0xc8e0('0x34')]=_[_0xc8e0('0x36')](_0x14e27a[_0xc8e0('0x2f')],_0x14e27a[_0xc8e0('0x32')]);_0x1a98c1[_0xc8e0('0x35')]=_[_0xc8e0('0x36')](_0x14e27a['model'],qs[_0xc8e0('0x45')](_0x580e8b[_0xc8e0('0x32')]['fields']));_0x1a98c1[_0xc8e0('0x35')]=_0x1a98c1[_0xc8e0('0x35')]['length']?_0x1a98c1[_0xc8e0('0x35')]:_0x14e27a['model'];if(_0x580e8b['query'][_0xc8e0('0x3e')]){_0x1a98c1['include']=[{'all':!![]}];}_0x1a98c1=_['merge']({},_0x1a98c1,_0x580e8b[_0xc8e0('0x3d')]);return db['Template']['find'](_0x1a98c1)[_0xc8e0('0x22')](handleEntityNotFound(_0x504c3a,null))['then'](respondWithResult(_0x504c3a,null))['catch'](handleError(_0x504c3a,null));};exports[_0xc8e0('0x46')]=function(_0x5429ff,_0x42f882){return db[_0xc8e0('0x2a')]['create'](_0x5429ff[_0xc8e0('0x47')],{})[_0xc8e0('0x22')](function(_0x21e80a){var _0x3e2201=_0x5429ff[_0xc8e0('0x48')]['get']({'plain':!![]});if(!_0x3e2201)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e2201[_0xc8e0('0x49')]===_0xc8e0('0x48')){var _0x27c7b3=_0x21e80a[_0xc8e0('0x24')]({'plain':!![]});var _0x188eba=_0xc8e0('0x25');return db[_0xc8e0('0x4a')][_0xc8e0('0x4b')]({'where':{'name':_0x188eba,'userProfileId':_0x3e2201['userProfileId']},'raw':!![]})[_0xc8e0('0x22')](function(_0x218ff1){if(_0x218ff1&&_0x218ff1[_0xc8e0('0x4c')]===0x0){return db[_0xc8e0('0x26')]['create']({'name':_0x27c7b3[_0xc8e0('0x31')],'resourceId':_0x27c7b3['id'],'type':_0x218ff1[_0xc8e0('0x31')],'sectionId':_0x218ff1['id']},{})[_0xc8e0('0x22')](function(){return _0x21e80a;});}else{return _0x21e80a;}})[_0xc8e0('0x42')](function(_0x3990e1){logger[_0xc8e0('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3990e1);throw _0x3990e1;});}return _0x21e80a;})[_0xc8e0('0x22')](respondWithResult(_0x42f882,0xc9))[_0xc8e0('0x42')](handleError(_0x42f882,null));};exports['update']=function(_0x21033d,_0xa2e2a2){if(_0x21033d[_0xc8e0('0x47')]['id']){delete _0x21033d['body']['id'];}return db[_0xc8e0('0x2a')][_0xc8e0('0x4b')]({'where':{'id':_0x21033d[_0xc8e0('0x44')]['id']}})['then'](handleEntityNotFound(_0xa2e2a2,null))[_0xc8e0('0x22')](saveUpdates(_0x21033d[_0xc8e0('0x47')],null))['then'](respondWithResult(_0xa2e2a2,null))['catch'](handleError(_0xa2e2a2,null));};exports[_0xc8e0('0x23')]=function(_0x2acda4,_0x1b29a7){return db[_0xc8e0('0x2a')][_0xc8e0('0x4b')]({'where':{'id':_0x2acda4[_0xc8e0('0x44')]['id']}})[_0xc8e0('0x22')](handleEntityNotFound(_0x1b29a7,null))['then'](removeEntity(_0x1b29a7,null))[_0xc8e0('0x42')](handleError(_0x1b29a7,null));}; \ No newline at end of file +var _0x88f1=['includeAll','findAll','rows','keys','find','catch','create','body','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','destroy','then','Templates','UserProfileResource','end','name','send','index','map','Template','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x88f1,0xa2));var _0x188f=function(_0x257875,_0x5b01ec){_0x257875=_0x257875-0x0;var _0x13a4cd=_0x88f1[_0x257875];return _0x13a4cd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x188f('0x0'));var zipdir=require(_0x188f('0x1'));var jsonpatch=require(_0x188f('0x2'));var rp=require(_0x188f('0x3'));var moment=require(_0x188f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x188f('0x5'));var util=require(_0x188f('0x6'));var path=require(_0x188f('0x7'));var sox=require('sox');var csv=require(_0x188f('0x8'));var ejs=require(_0x188f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x188f('0xa'));var squel=require(_0x188f('0xb'));var crypto=require(_0x188f('0xc'));var jsforce=require(_0x188f('0xd'));var deskjs=require(_0x188f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x188f('0xf'));var Papa=require('papaparse');var Redis=require(_0x188f('0x10'));var authService=require(_0x188f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x188f('0x12'))('api');var utils=require(_0x188f('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x188f('0x14'))['db'];function respondWithStatusCode(_0x309f4b,_0x350566){_0x350566=_0x350566||0xcc;return function(_0x2e5675){if(_0x2e5675){return _0x309f4b[_0x188f('0x15')](_0x350566);}return _0x309f4b[_0x188f('0x16')](_0x350566)['end']();};}function respondWithResult(_0xa0f47d,_0x43e4fa){_0x43e4fa=_0x43e4fa||0xc8;return function(_0x6f0061){if(_0x6f0061){return _0xa0f47d['status'](_0x43e4fa)[_0x188f('0x17')](_0x6f0061);}};}function respondWithFilteredResult(_0x5cdad4,_0x13160e){return function(_0x33524c){if(_0x33524c){var _0x2cb9f8=typeof _0x13160e[_0x188f('0x18')]===_0x188f('0x19')&&typeof _0x13160e['limit']===_0x188f('0x19');var _0x5c38ff=_0x33524c['count'];var _0x1ec586=_0x2cb9f8?0x0:_0x13160e[_0x188f('0x18')];var _0x8dc5ce=_0x2cb9f8?_0x33524c[_0x188f('0x1a')]:_0x13160e[_0x188f('0x18')]+_0x13160e[_0x188f('0x1b')];var _0x8a19f0;if(_0x8dc5ce>=_0x5c38ff){_0x8dc5ce=_0x5c38ff;_0x8a19f0=0xc8;}else{_0x8a19f0=0xce;}_0x5cdad4[_0x188f('0x16')](_0x8a19f0);return _0x5cdad4[_0x188f('0x1c')]('Content-Range',_0x1ec586+'-'+_0x8dc5ce+'/'+_0x5c38ff)[_0x188f('0x17')](_0x33524c);}return null;};}function patchUpdates(_0x40c2be){return function(_0x3fb0d5){try{jsonpatch[_0x188f('0x1d')](_0x3fb0d5,_0x40c2be,!![]);}catch(_0x4f9c3e){return BPromise[_0x188f('0x1e')](_0x4f9c3e);}return _0x3fb0d5['save']();};}function saveUpdates(_0x32e79d,_0xd3bb6b){return function(_0x575780){if(_0x575780){return _0x575780['update'](_0x32e79d)['then'](function(_0x54bc0e){return _0x54bc0e;});}return null;};}function removeEntity(_0x19c4c6,_0x1a9079){return function(_0x4ec8ca){if(_0x4ec8ca){return _0x4ec8ca[_0x188f('0x1f')]()[_0x188f('0x20')](function(){var _0x1194ad=_0x4ec8ca['get']({'plain':!![]});var _0x6c5db2=_0x188f('0x21');return db[_0x188f('0x22')][_0x188f('0x1f')]({'where':{'type':_0x6c5db2,'resourceId':_0x1194ad['id']}})[_0x188f('0x20')](function(){return _0x4ec8ca;});})[_0x188f('0x20')](function(){_0x19c4c6['status'](0xcc)[_0x188f('0x23')]();});}};}function handleEntityNotFound(_0x3be13d,_0x41c7b7){return function(_0x2e70d4){if(!_0x2e70d4){_0x3be13d['sendStatus'](0x194);}return _0x2e70d4;};}function handleError(_0x24b16e,_0x3a7ec6){_0x3a7ec6=_0x3a7ec6||0x1f4;return function(_0x2d2d41){logger['error'](_0x2d2d41['stack']);if(_0x2d2d41['name']){delete _0x2d2d41[_0x188f('0x24')];}_0x24b16e['status'](_0x3a7ec6)[_0x188f('0x25')](_0x2d2d41);};}exports[_0x188f('0x26')]=function(_0x4b7e87,_0x3cb006){var _0x1ee70e={},_0x3de3c3={},_0x2b7ff8={'count':0x0,'rows':[]};var _0x2c689a=_[_0x188f('0x27')](db[_0x188f('0x28')]['rawAttributes'],function(_0x13d8d1){return{'name':_0x13d8d1[_0x188f('0x29')],'type':_0x13d8d1[_0x188f('0x2a')][_0x188f('0x2b')]};});_0x3de3c3[_0x188f('0x2c')]=_[_0x188f('0x27')](_0x2c689a,_0x188f('0x24'));_0x3de3c3[_0x188f('0x2d')]=_['keys'](_0x4b7e87[_0x188f('0x2d')]);_0x3de3c3[_0x188f('0x2e')]=_[_0x188f('0x2f')](_0x3de3c3[_0x188f('0x2c')],_0x3de3c3[_0x188f('0x2d')]);_0x1ee70e['attributes']=_[_0x188f('0x2f')](_0x3de3c3[_0x188f('0x2c')],qs[_0x188f('0x30')](_0x4b7e87['query'][_0x188f('0x30')]));_0x1ee70e[_0x188f('0x31')]=_0x1ee70e[_0x188f('0x31')]['length']?_0x1ee70e[_0x188f('0x31')]:_0x3de3c3[_0x188f('0x2c')];if(!_0x4b7e87[_0x188f('0x2d')][_0x188f('0x32')](_0x188f('0x33'))){_0x1ee70e[_0x188f('0x1b')]=qs[_0x188f('0x1b')](_0x4b7e87[_0x188f('0x2d')]['limit']);_0x1ee70e['offset']=qs['offset'](_0x4b7e87['query'][_0x188f('0x18')]);}_0x1ee70e[_0x188f('0x34')]=qs[_0x188f('0x35')](_0x4b7e87['query'][_0x188f('0x35')]);_0x1ee70e[_0x188f('0x36')]=qs[_0x188f('0x2e')](_[_0x188f('0x37')](_0x4b7e87[_0x188f('0x2d')],_0x3de3c3[_0x188f('0x2e')]),_0x2c689a);if(_0x4b7e87[_0x188f('0x2d')][_0x188f('0x38')]){_0x1ee70e[_0x188f('0x36')]=_['merge'](_0x1ee70e[_0x188f('0x36')],{'$or':_['map'](_0x2c689a,function(_0x571674){if(_0x571674['type']!==_0x188f('0x39')){var _0x1a8aee={};_0x1a8aee[_0x571674[_0x188f('0x24')]]={'$like':'%'+_0x4b7e87[_0x188f('0x2d')][_0x188f('0x38')]+'%'};return _0x1a8aee;}})});}_0x1ee70e=_[_0x188f('0x3a')]({},_0x1ee70e,_0x4b7e87[_0x188f('0x3b')]);var _0x4cf5de={'where':_0x1ee70e['where']};return db[_0x188f('0x28')][_0x188f('0x1a')](_0x4cf5de)['then'](function(_0x582344){_0x2b7ff8[_0x188f('0x1a')]=_0x582344;if(_0x4b7e87[_0x188f('0x2d')][_0x188f('0x3c')]){_0x1ee70e['include']=[{'all':!![]}];}return db[_0x188f('0x28')][_0x188f('0x3d')](_0x1ee70e);})[_0x188f('0x20')](function(_0xaf3f75){_0x2b7ff8[_0x188f('0x3e')]=_0xaf3f75;return _0x2b7ff8;})[_0x188f('0x20')](respondWithFilteredResult(_0x3cb006,_0x1ee70e))['catch'](handleError(_0x3cb006,null));};exports['show']=function(_0x210661,_0x79e40){var _0x46f3ab={'raw':!![],'where':{'id':_0x210661['params']['id']}},_0x27f11f={};_0x27f11f[_0x188f('0x2c')]=_[_0x188f('0x3f')](db[_0x188f('0x28')]['rawAttributes']);_0x27f11f[_0x188f('0x2d')]=_[_0x188f('0x3f')](_0x210661['query']);_0x27f11f[_0x188f('0x2e')]=_[_0x188f('0x2f')](_0x27f11f[_0x188f('0x2c')],_0x27f11f[_0x188f('0x2d')]);_0x46f3ab[_0x188f('0x31')]=_[_0x188f('0x2f')](_0x27f11f['model'],qs[_0x188f('0x30')](_0x210661[_0x188f('0x2d')][_0x188f('0x30')]));_0x46f3ab[_0x188f('0x31')]=_0x46f3ab['attributes']['length']?_0x46f3ab['attributes']:_0x27f11f[_0x188f('0x2c')];if(_0x210661[_0x188f('0x2d')][_0x188f('0x3c')]){_0x46f3ab['include']=[{'all':!![]}];}_0x46f3ab=_[_0x188f('0x3a')]({},_0x46f3ab,_0x210661[_0x188f('0x3b')]);return db[_0x188f('0x28')][_0x188f('0x40')](_0x46f3ab)[_0x188f('0x20')](handleEntityNotFound(_0x79e40,null))['then'](respondWithResult(_0x79e40,null))[_0x188f('0x41')](handleError(_0x79e40,null));};exports[_0x188f('0x42')]=function(_0x55a314,_0x55bb04){return db[_0x188f('0x28')][_0x188f('0x42')](_0x55a314[_0x188f('0x43')],{})[_0x188f('0x20')](function(_0x26f757){var _0x5e944a=_0x55a314[_0x188f('0x44')]['get']({'plain':!![]});if(!_0x5e944a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e944a['role']===_0x188f('0x44')){var _0x584143=_0x26f757['get']({'plain':!![]});var _0x1e43d6=_0x188f('0x21');return db[_0x188f('0x45')]['find']({'where':{'name':_0x1e43d6,'userProfileId':_0x5e944a['userProfileId']},'raw':!![]})[_0x188f('0x20')](function(_0x220214){if(_0x220214&&_0x220214[_0x188f('0x46')]===0x0){return db[_0x188f('0x22')][_0x188f('0x42')]({'name':_0x584143[_0x188f('0x24')],'resourceId':_0x584143['id'],'type':_0x220214[_0x188f('0x24')],'sectionId':_0x220214['id']},{})[_0x188f('0x20')](function(){return _0x26f757;});}else{return _0x26f757;}})['catch'](function(_0x2fa119){logger[_0x188f('0x47')](_0x188f('0x48'),_0x2fa119);throw _0x2fa119;});}return _0x26f757;})[_0x188f('0x20')](respondWithResult(_0x55bb04,0xc9))[_0x188f('0x41')](handleError(_0x55bb04,null));};exports['update']=function(_0x1eb2fe,_0x1e7a2b){if(_0x1eb2fe['body']['id']){delete _0x1eb2fe[_0x188f('0x43')]['id'];}return db[_0x188f('0x28')][_0x188f('0x40')]({'where':{'id':_0x1eb2fe[_0x188f('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e7a2b,null))[_0x188f('0x20')](saveUpdates(_0x1eb2fe['body'],null))[_0x188f('0x20')](respondWithResult(_0x1e7a2b,null))[_0x188f('0x41')](handleError(_0x1e7a2b,null));};exports[_0x188f('0x1f')]=function(_0x58ab26,_0xd7d2d7){return db['Template']['find']({'where':{'id':_0x58ab26[_0x188f('0x49')]['id']}})[_0x188f('0x20')](handleEntityNotFound(_0xd7d2d7,null))[_0x188f('0x20')](removeEntity(_0xd7d2d7,null))[_0x188f('0x41')](handleError(_0xd7d2d7,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index db9542b..653374d 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 _0x474d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','tools_templates','lodash','util'];(function(_0x576710,_0x2766d0){var _0x792aaa=function(_0x533a38){while(--_0x533a38){_0x576710['push'](_0x576710['shift']());}};_0x792aaa(++_0x2766d0);}(_0x474d,0x73));var _0xd474=function(_0x1dca3a,_0x52403b){_0x1dca3a=_0x1dca3a-0x0;var _0x197d3a=_0x474d[_0x1dca3a];return _0x197d3a;};'use strict';var _=require(_0xd474('0x0'));var util=require(_0xd474('0x1'));var logger=require(_0xd474('0x2'))(_0xd474('0x3'));var moment=require(_0xd474('0x4'));var BPromise=require(_0xd474('0x5'));var rp=require(_0xd474('0x6'));var fs=require('fs');var path=require(_0xd474('0x7'));var rimraf=require(_0xd474('0x8'));var config=require(_0xd474('0x9'));var attributes=require(_0xd474('0xa'));module['exports']=function(_0xa119fe,_0x3779e0){return _0xa119fe[_0xd474('0xb')]('Template',attributes,{'tableName':_0xd474('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf25=['./template.attributes','exports','tools_templates','lodash','util','bluebird','request-promise','path','../../config/environment'];(function(_0x24d3c3,_0x1ce6b4){var _0x327d8f=function(_0x35076e){while(--_0x35076e){_0x24d3c3['push'](_0x24d3c3['shift']());}};_0x327d8f(++_0x1ce6b4);}(_0xaf25,0x162));var _0x5af2=function(_0x4e966d,_0x40a2f8){_0x4e966d=_0x4e966d-0x0;var _0x4fd09f=_0xaf25[_0x4e966d];return _0x4fd09f;};'use strict';var _=require(_0x5af2('0x0'));var util=require(_0x5af2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5af2('0x2'));var rp=require(_0x5af2('0x3'));var fs=require('fs');var path=require(_0x5af2('0x4'));var rimraf=require('rimraf');var config=require(_0x5af2('0x5'));var attributes=require(_0x5af2('0x6'));module[_0x5af2('0x7')]=function(_0x8b701e,_0x5c9110){return _0x8b701e['define']('Template',attributes,{'tableName':_0x5af2('0x8'),'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 42c2322..fdd518a 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 _0x0382=['../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','attributes','limit','map','include','model','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x348c95,_0x1bf9d7){var _0x39b698=function(_0x49b024){while(--_0x49b024){_0x348c95['push'](_0x348c95['shift']());}};_0x39b698(++_0x1bf9d7);}(_0x0382,0x14c));var _0x2038=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x0382[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x2038('0x0'));var util=require(_0x2038('0x1'));var moment=require(_0x2038('0x2'));var BPromise=require(_0x2038('0x3'));var rs=require(_0x2038('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2038('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2038('0x6'))(_0x2038('0x7'));var config=require(_0x2038('0x8'));var jayson=require(_0x2038('0x9'));var client=jayson[_0x2038('0xa')][_0x2038('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23b157,_0x346936,_0xd8562){return new BPromise(function(_0x2570ba,_0xed614c){return client[_0x2038('0xc')](_0x23b157,_0xd8562)[_0x2038('0xd')](function(_0x2f73f6){logger['info'](_0x2038('0xe'),_0x346936,_0x2038('0xf'));logger[_0x2038('0x10')](_0x2038('0x11'),_0x346936,_0x2038('0xf'),JSON[_0x2038('0x12')](_0x2f73f6));if(_0x2f73f6['error']){if(_0x2f73f6[_0x2038('0x13')][_0x2038('0x14')]===0x1f4){logger[_0x2038('0x13')](_0x2038('0xe'),_0x346936,_0x2f73f6['error']['message']);return _0xed614c(_0x2f73f6[_0x2038('0x13')][_0x2038('0x15')]);}logger['error'](_0x2038('0xe'),_0x346936,_0x2f73f6[_0x2038('0x13')]['message']);return _0x2570ba(_0x2f73f6[_0x2038('0x13')][_0x2038('0x15')]);}else{logger['info'](_0x2038('0xe'),_0x346936,_0x2038('0xf'));_0x2570ba(_0x2f73f6[_0x2038('0x16')][_0x2038('0x15')]);}})[_0x2038('0x17')](function(_0x295ce9){logger[_0x2038('0x13')](_0x2038('0xe'),_0x346936,_0x295ce9);_0xed614c(_0x295ce9);});});}exports[_0x2038('0x18')]=function(_0xd47622){var _0x5bd7b5=this;return new Promise(function(_0x5695d6,_0x1e5442){return db[_0x2038('0x19')][_0x2038('0x1a')]({'raw':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')]['where']||null:null,'attributes':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')][_0x2038('0x1c')]||null:null,'limit':_0xd47622[_0x2038('0x1b')]?_0xd47622[_0x2038('0x1b')][_0x2038('0x1d')]||null:null,'include':_0xd47622[_0x2038('0x1b')]?_0xd47622['options']['include']?_[_0x2038('0x1e')](_0xd47622[_0x2038('0x1b')][_0x2038('0x1f')],function(_0x4f74f3){return{'model':db[_0x4f74f3['model']],'as':_0x4f74f3['as'],'attributes':_0x4f74f3[_0x2038('0x1c')],'include':_0x4f74f3[_0x2038('0x1f')]?_[_0x2038('0x1e')](_0x4f74f3[_0x2038('0x1f')],function(_0x3e98e3){return{'model':db[_0x3e98e3[_0x2038('0x20')]],'as':_0x3e98e3['as'],'attributes':_0x3e98e3['attributes'],'include':_0x3e98e3['include']?_['map'](_0x3e98e3['include'],function(_0x578041){return{'model':db[_0x578041[_0x2038('0x20')]],'as':_0x578041['as'],'attributes':_0x578041['attributes']};}):[]};}):[]};}):[]:[]})[_0x2038('0xd')](function(_0x37ed21){logger[_0x2038('0x21')](_0x2038('0x18'),_0xd47622);logger['debug'](_0x2038('0x18'),_0xd47622,JSON['stringify'](_0x37ed21));_0x5695d6(_0x37ed21);})['catch'](function(_0x70967a){logger[_0x2038('0x13')]('GetTemplate',_0x70967a['message'],_0xd47622);_0x1e5442(_0x5bd7b5[_0x2038('0x13')](0x1f4,_0x70967a[_0x2038('0x15')]));});});}; \ No newline at end of file +var _0x4aec=['request\x20sent','result','catch','GetTemplate','Template','findAll','options','raw','attributes','limit','map','include','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x273204,_0x3b145c){var _0x1c574a=function(_0x1db5e4){while(--_0x1db5e4){_0x273204['push'](_0x273204['shift']());}};_0x1c574a(++_0x3b145c);}(_0x4aec,0x1ad));var _0xc4ae=function(_0x1d757c,_0x1e7634){_0x1d757c=_0x1d757c-0x0;var _0xf71071=_0x4aec[_0x1d757c];return _0xf71071;};'use strict';var _=require(_0xc4ae('0x0'));var util=require(_0xc4ae('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc4ae('0x2'));var db=require(_0xc4ae('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc4ae('0x4'))(_0xc4ae('0x5'));var config=require(_0xc4ae('0x6'));var jayson=require(_0xc4ae('0x7'));var client=jayson[_0xc4ae('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4690bf,_0x4a3530,_0x3e6900){return new BPromise(function(_0x1fec2f,_0xfb76bf){return client[_0xc4ae('0x9')](_0x4690bf,_0x3e6900)[_0xc4ae('0xa')](function(_0x5bb75a){logger['info'](_0xc4ae('0xb'),_0x4a3530,'request\x20sent');logger[_0xc4ae('0xc')](_0xc4ae('0xd'),_0x4a3530,'request\x20sent',JSON[_0xc4ae('0xe')](_0x5bb75a));if(_0x5bb75a[_0xc4ae('0xf')]){if(_0x5bb75a[_0xc4ae('0xf')][_0xc4ae('0x10')]===0x1f4){logger[_0xc4ae('0xf')](_0xc4ae('0xb'),_0x4a3530,_0x5bb75a['error'][_0xc4ae('0x11')]);return _0xfb76bf(_0x5bb75a[_0xc4ae('0xf')][_0xc4ae('0x11')]);}logger['error'](_0xc4ae('0xb'),_0x4a3530,_0x5bb75a[_0xc4ae('0xf')][_0xc4ae('0x11')]);return _0x1fec2f(_0x5bb75a[_0xc4ae('0xf')]['message']);}else{logger[_0xc4ae('0x12')](_0xc4ae('0xb'),_0x4a3530,_0xc4ae('0x13'));_0x1fec2f(_0x5bb75a[_0xc4ae('0x14')][_0xc4ae('0x11')]);}})[_0xc4ae('0x15')](function(_0x1685d2){logger[_0xc4ae('0xf')](_0xc4ae('0xb'),_0x4a3530,_0x1685d2);_0xfb76bf(_0x1685d2);});});}exports[_0xc4ae('0x16')]=function(_0x4be7df){var _0x4f0dd9=this;return new Promise(function(_0x4b6008,_0x26ebf7){return db[_0xc4ae('0x17')][_0xc4ae('0x18')]({'raw':_0x4be7df[_0xc4ae('0x19')]?_0x4be7df[_0xc4ae('0x19')][_0xc4ae('0x1a')]===undefined?!![]:![]:!![],'where':_0x4be7df[_0xc4ae('0x19')]?_0x4be7df[_0xc4ae('0x19')]['where']||null:null,'attributes':_0x4be7df[_0xc4ae('0x19')]?_0x4be7df[_0xc4ae('0x19')][_0xc4ae('0x1b')]||null:null,'limit':_0x4be7df['options']?_0x4be7df[_0xc4ae('0x19')][_0xc4ae('0x1c')]||null:null,'include':_0x4be7df['options']?_0x4be7df[_0xc4ae('0x19')]['include']?_[_0xc4ae('0x1d')](_0x4be7df[_0xc4ae('0x19')][_0xc4ae('0x1e')],function(_0x3ff98a){return{'model':db[_0x3ff98a[_0xc4ae('0x1f')]],'as':_0x3ff98a['as'],'attributes':_0x3ff98a[_0xc4ae('0x1b')],'include':_0x3ff98a['include']?_['map'](_0x3ff98a['include'],function(_0x1395f8){return{'model':db[_0x1395f8['model']],'as':_0x1395f8['as'],'attributes':_0x1395f8[_0xc4ae('0x1b')],'include':_0x1395f8[_0xc4ae('0x1e')]?_[_0xc4ae('0x1d')](_0x1395f8[_0xc4ae('0x1e')],function(_0x40c9d8){return{'model':db[_0x40c9d8[_0xc4ae('0x1f')]],'as':_0x40c9d8['as'],'attributes':_0x40c9d8[_0xc4ae('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc4ae('0xa')](function(_0x166c8f){logger[_0xc4ae('0x12')]('GetTemplate',_0x4be7df);logger[_0xc4ae('0xc')](_0xc4ae('0x16'),_0x4be7df,JSON[_0xc4ae('0xe')](_0x166c8f));_0x4b6008(_0x166c8f);})['catch'](function(_0x34a20a){logger['error'](_0xc4ae('0x16'),_0x34a20a['message'],_0x4be7df);_0x26ebf7(_0x4f0dd9['error'](0x1f4,_0x34a20a['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 0551899..7e005d3 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 _0xb35e=['../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','create','addAnyCondition','/:id/actions','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xd73239,_0x488346){var _0x41cee6=function(_0x4a8bb3){while(--_0x4a8bb3){_0xd73239['push'](_0xd73239['shift']());}};_0x41cee6(++_0x488346);}(_0xb35e,0x96));var _0xeb35=function(_0x48ba3b,_0x45a328){_0x48ba3b=_0x48ba3b-0x0;var _0x21f3cc=_0xb35e[_0x48ba3b];return _0x21f3cc;};'use strict';var multer=require('multer');var util=require(_0xeb35('0x0'));var path=require(_0xeb35('0x1'));var timeout=require(_0xeb35('0x2'));var express=require(_0xeb35('0x3'));var router=express[_0xeb35('0x4')]();var fs_extra=require(_0xeb35('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeb35('0x6'));var config=require(_0xeb35('0x7'));var controller=require(_0xeb35('0x8'));router[_0xeb35('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb35('0xa')]);router[_0xeb35('0x9')](_0xeb35('0xb'),auth[_0xeb35('0xc')](),controller[_0xeb35('0xd')]);router[_0xeb35('0x9')](_0xeb35('0xe'),auth[_0xeb35('0xc')](),controller[_0xeb35('0xf')]);router[_0xeb35('0x9')](_0xeb35('0x10'),auth[_0xeb35('0xc')](),controller['getAnyConditions']);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xeb35('0x11')]);router[_0xeb35('0x12')]('/',auth[_0xeb35('0xc')](),controller[_0xeb35('0x13')]);router[_0xeb35('0x12')](_0xeb35('0xe'),auth[_0xeb35('0xc')](),controller['addAllCondition']);router[_0xeb35('0x12')](_0xeb35('0x10'),auth[_0xeb35('0xc')](),controller[_0xeb35('0x14')]);router['post'](_0xeb35('0x15'),auth[_0xeb35('0xc')](),controller['addAction']);router[_0xeb35('0x16')](_0xeb35('0xb'),auth[_0xeb35('0xc')](),controller[_0xeb35('0x17')]);router[_0xeb35('0x18')](_0xeb35('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb35('0x19')]=router; \ No newline at end of file +var _0x7e33=['create','post','addAllCondition','addAnyCondition','addAction','update','delete','multer','util','express','Router','fs-extra','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','/:id/any_conditions','/:id/actions','getActions'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x7e33,0x7a));var _0x37e3=function(_0x1f6110,_0x4f90c2){_0x1f6110=_0x1f6110-0x0;var _0x1c7f18=_0x7e33[_0x1f6110];return _0x1c7f18;};'use strict';var multer=require(_0x37e3('0x0'));var util=require(_0x37e3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37e3('0x2'));var router=express[_0x37e3('0x3')]();var fs_extra=require(_0x37e3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x37e3('0x5'));var controller=require(_0x37e3('0x6'));router[_0x37e3('0x7')]('/',auth[_0x37e3('0x8')](),controller[_0x37e3('0x9')]);router['get'](_0x37e3('0xa'),auth[_0x37e3('0x8')](),controller[_0x37e3('0xb')]);router[_0x37e3('0x7')](_0x37e3('0xc'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x37e3('0x7')](_0x37e3('0xd'),auth[_0x37e3('0x8')](),controller['getAnyConditions']);router[_0x37e3('0x7')](_0x37e3('0xe'),auth[_0x37e3('0x8')](),controller[_0x37e3('0xf')]);router['post']('/',auth[_0x37e3('0x8')](),controller[_0x37e3('0x10')]);router[_0x37e3('0x11')](_0x37e3('0xc'),auth['isAuthenticated'](),controller[_0x37e3('0x12')]);router[_0x37e3('0x11')](_0x37e3('0xd'),auth['isAuthenticated'](),controller[_0x37e3('0x13')]);router[_0x37e3('0x11')](_0x37e3('0xe'),auth[_0x37e3('0x8')](),controller[_0x37e3('0x14')]);router['put'](_0x37e3('0xa'),auth[_0x37e3('0x8')](),controller[_0x37e3('0x15')]);router[_0x37e3('0x16')](_0x37e3('0xa'),auth[_0x37e3('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d0b05c1..56d0699 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 _0x9c05=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x9c05,0xdc));var _0x59c0=function(_0x4a5013,_0x4a1e37){_0x4a5013=_0x4a5013-0x0;var _0x32b4f4=_0x9c05[_0x4a5013];return _0x32b4f4;};'use strict';var Sequelize=require(_0x59c0('0x0'));module[_0x59c0('0x1')]={'name':{'type':Sequelize[_0x59c0('0x2')]},'channel':{'type':Sequelize[_0x59c0('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x59c0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x776f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x776f,0x18a));var _0xf776=function(_0x2b6b89,_0x172ec0){_0x2b6b89=_0x2b6b89-0x0;var _0x5aa6af=_0x776f[_0x2b6b89];return _0x5aa6af;};'use strict';var Sequelize=require(_0xf776('0x0'));module[_0xf776('0x1')]={'name':{'type':Sequelize[_0xf776('0x2')]},'channel':{'type':Sequelize[_0xf776('0x2')]},'description':{'type':Sequelize[_0xf776('0x2')]},'status':{'type':Sequelize[_0xf776('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 22d463a..6f93531 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 _0xc111=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','params','addAllCondition','addAnyCondition','Condition','getAllConditions','findOne','order','getAnyConditions','TriggerId','Action','getActions','eml-format','zip-dir','fast-json-patch','request-promise','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','end','offset','undefined','count','status','Content-Range','apply','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','Trigger','includeAll','include','rows','catch','show','keys','create','body'];(function(_0x40af29,_0x16b6a9){var _0x1d9783=function(_0x9cd065){while(--_0x9cd065){_0x40af29['push'](_0x40af29['shift']());}};_0x1d9783(++_0x16b6a9);}(_0xc111,0x182));var _0x1c11=function(_0x30e4ff,_0x2d33b5){_0x30e4ff=_0x30e4ff-0x0;var _0xe9c895=_0xc111[_0x30e4ff];return _0xe9c895;};'use strict';var emlformat=require(_0x1c11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c11('0x1'));var jsonpatch=require(_0x1c11('0x2'));var rp=require(_0x1c11('0x3'));var moment=require('moment');var BPromise=require(_0x1c11('0x4'));var Mustache=require('mustache');var util=require(_0x1c11('0x5'));var path=require(_0x1c11('0x6'));var sox=require('sox');var csv=require(_0x1c11('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1c11('0x8'));var _=require('lodash');var squel=require(_0x1c11('0x9'));var crypto=require(_0x1c11('0xa'));var jsforce=require(_0x1c11('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1c11('0xc'));var Papa=require(_0x1c11('0xd'));var Redis=require(_0x1c11('0xe'));var authService=require(_0x1c11('0xf'));var qs=require(_0x1c11('0x10'));var as=require(_0x1c11('0x11'));var hardwareService=require(_0x1c11('0x12'));var logger=require(_0x1c11('0x13'))(_0x1c11('0x14'));var utils=require(_0x1c11('0x15'));var config=require(_0x1c11('0x16'));var licenseUtil=require(_0x1c11('0x17'));var db=require(_0x1c11('0x18'))['db'];function respondWithStatusCode(_0x2c5f7a,_0x19180d){_0x19180d=_0x19180d||0xcc;return function(_0x18e15e){if(_0x18e15e){return _0x2c5f7a[_0x1c11('0x19')](_0x19180d);}return _0x2c5f7a['status'](_0x19180d)[_0x1c11('0x1a')]();};}function respondWithResult(_0xdbb2b1,_0x47a1f8){_0x47a1f8=_0x47a1f8||0xc8;return function(_0x6993e7){if(_0x6993e7){return _0xdbb2b1['status'](_0x47a1f8)['json'](_0x6993e7);}};}function respondWithFilteredResult(_0x362835,_0x17c3fd){return function(_0x138682){if(_0x138682){var _0x32859b=typeof _0x17c3fd[_0x1c11('0x1b')]===_0x1c11('0x1c')&&typeof _0x17c3fd['limit']===_0x1c11('0x1c');var _0x155894=_0x138682[_0x1c11('0x1d')];var _0x4d7f31=_0x32859b?0x0:_0x17c3fd[_0x1c11('0x1b')];var _0x1e835d=_0x32859b?_0x138682[_0x1c11('0x1d')]:_0x17c3fd['offset']+_0x17c3fd['limit'];var _0x439514;if(_0x1e835d>=_0x155894){_0x1e835d=_0x155894;_0x439514=0xc8;}else{_0x439514=0xce;}_0x362835[_0x1c11('0x1e')](_0x439514);return _0x362835['set'](_0x1c11('0x1f'),_0x4d7f31+'-'+_0x1e835d+'/'+_0x155894)['json'](_0x138682);}return null;};}function patchUpdates(_0x29af7c){return function(_0x36d8cf){try{jsonpatch[_0x1c11('0x20')](_0x36d8cf,_0x29af7c,!![]);}catch(_0x36d44a){return BPromise['reject'](_0x36d44a);}return _0x36d8cf['save']();};}function saveUpdates(_0x26ddcf,_0x173b4c){return function(_0xf94e40){if(_0xf94e40){return _0xf94e40[_0x1c11('0x21')](_0x26ddcf)[_0x1c11('0x22')](function(_0x35c03c){return _0x35c03c;});}return null;};}function removeEntity(_0x5b42b6,_0xf83037){return function(_0xe82d47){if(_0xe82d47){return _0xe82d47[_0x1c11('0x23')]()[_0x1c11('0x22')](function(){var _0x2756df=_0xe82d47[_0x1c11('0x24')]({'plain':!![]});var _0x1c769b=_0x1c11('0x25');return db[_0x1c11('0x26')][_0x1c11('0x23')]({'where':{'type':_0x1c769b,'resourceId':_0x2756df['id']}})[_0x1c11('0x22')](function(){return _0xe82d47;});})[_0x1c11('0x22')](function(){_0x5b42b6['status'](0xcc)[_0x1c11('0x1a')]();});}};}function handleEntityNotFound(_0x6bf7c7,_0x272fa2){return function(_0x715c59){if(!_0x715c59){_0x6bf7c7[_0x1c11('0x19')](0x194);}return _0x715c59;};}function handleError(_0x1d921c,_0x3d49a5){_0x3d49a5=_0x3d49a5||0x1f4;return function(_0x352dbe){logger[_0x1c11('0x27')](_0x352dbe[_0x1c11('0x28')]);if(_0x352dbe['name']){delete _0x352dbe[_0x1c11('0x29')];}_0x1d921c[_0x1c11('0x1e')](_0x3d49a5)[_0x1c11('0x2a')](_0x352dbe);};}exports['index']=function(_0x52564e,_0x3d409e){var _0x55d371={},_0x586856={},_0x16653a={'count':0x0,'rows':[]};var _0x3e9a16=_[_0x1c11('0x2b')](db['Trigger'][_0x1c11('0x2c')],function(_0xceb1c7){return{'name':_0xceb1c7[_0x1c11('0x2d')],'type':_0xceb1c7[_0x1c11('0x2e')][_0x1c11('0x2f')]};});_0x586856['model']=_[_0x1c11('0x2b')](_0x3e9a16,_0x1c11('0x29'));_0x586856[_0x1c11('0x30')]=_['keys'](_0x52564e[_0x1c11('0x30')]);_0x586856['filters']=_['intersection'](_0x586856[_0x1c11('0x31')],_0x586856[_0x1c11('0x30')]);_0x55d371[_0x1c11('0x32')]=_[_0x1c11('0x33')](_0x586856[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x52564e[_0x1c11('0x30')]['fields']));_0x55d371[_0x1c11('0x32')]=_0x55d371[_0x1c11('0x32')][_0x1c11('0x35')]?_0x55d371['attributes']:_0x586856[_0x1c11('0x31')];if(!_0x52564e[_0x1c11('0x30')][_0x1c11('0x36')](_0x1c11('0x37'))){_0x55d371['limit']=qs[_0x1c11('0x38')](_0x52564e[_0x1c11('0x30')][_0x1c11('0x38')]);_0x55d371[_0x1c11('0x1b')]=qs[_0x1c11('0x1b')](_0x52564e[_0x1c11('0x30')][_0x1c11('0x1b')]);}_0x55d371['order']=qs[_0x1c11('0x39')](_0x52564e[_0x1c11('0x30')][_0x1c11('0x39')]);_0x55d371[_0x1c11('0x3a')]=qs[_0x1c11('0x3b')](_[_0x1c11('0x3c')](_0x52564e[_0x1c11('0x30')],_0x586856[_0x1c11('0x3b')]),_0x3e9a16);if(_0x52564e[_0x1c11('0x30')][_0x1c11('0x3d')]){_0x55d371['where']=_['merge'](_0x55d371[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x3e9a16,function(_0x5e3f80){if(_0x5e3f80[_0x1c11('0x2e')]!==_0x1c11('0x3e')){var _0x59b96c={};_0x59b96c[_0x5e3f80[_0x1c11('0x29')]]={'$like':'%'+_0x52564e['query']['filter']+'%'};return _0x59b96c;}})});}_0x55d371=_[_0x1c11('0x3f')]({},_0x55d371,_0x52564e[_0x1c11('0x40')]);var _0x2b0626={'where':_0x55d371[_0x1c11('0x3a')]};return db[_0x1c11('0x41')][_0x1c11('0x1d')](_0x2b0626)[_0x1c11('0x22')](function(_0x346558){_0x16653a[_0x1c11('0x1d')]=_0x346558;if(_0x52564e[_0x1c11('0x30')][_0x1c11('0x42')]){_0x55d371[_0x1c11('0x43')]=[{'all':!![]}];}return db[_0x1c11('0x41')]['findAll'](_0x55d371);})[_0x1c11('0x22')](function(_0x4e5898){_0x16653a[_0x1c11('0x44')]=_0x4e5898;return _0x16653a;})[_0x1c11('0x22')](respondWithFilteredResult(_0x3d409e,_0x55d371))[_0x1c11('0x45')](handleError(_0x3d409e,null));};exports[_0x1c11('0x46')]=function(_0x1c512a,_0x2a6319){var _0x488f35={'raw':![],'where':{'id':_0x1c512a['params']['id']}},_0x5d0bf0={};_0x5d0bf0['model']=_[_0x1c11('0x47')](db[_0x1c11('0x41')][_0x1c11('0x2c')]);_0x5d0bf0[_0x1c11('0x30')]=_[_0x1c11('0x47')](_0x1c512a[_0x1c11('0x30')]);_0x5d0bf0['filters']=_[_0x1c11('0x33')](_0x5d0bf0['model'],_0x5d0bf0[_0x1c11('0x30')]);_0x488f35[_0x1c11('0x32')]=_[_0x1c11('0x33')](_0x5d0bf0[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x1c512a['query'][_0x1c11('0x34')]));_0x488f35[_0x1c11('0x32')]=_0x488f35[_0x1c11('0x32')]['length']?_0x488f35['attributes']:_0x5d0bf0[_0x1c11('0x31')];if(_0x1c512a[_0x1c11('0x30')]['includeAll']){_0x488f35['include']=[{'all':!![]}];}_0x488f35=_[_0x1c11('0x3f')]({},_0x488f35,_0x1c512a[_0x1c11('0x40')]);return db['Trigger']['find'](_0x488f35)[_0x1c11('0x22')](handleEntityNotFound(_0x2a6319,null))[_0x1c11('0x22')](respondWithResult(_0x2a6319,null))['catch'](handleError(_0x2a6319,null));};exports[_0x1c11('0x48')]=function(_0x4111c3,_0x2f74f5){return db[_0x1c11('0x41')]['create'](_0x4111c3[_0x1c11('0x49')],{})[_0x1c11('0x22')](function(_0x51bda0){var _0x14b186=_0x4111c3[_0x1c11('0x4a')]['get']({'plain':!![]});if(!_0x14b186)throw new Error(_0x1c11('0x4b'));if(_0x14b186[_0x1c11('0x4c')]==='user'){var _0x29bb2c=_0x51bda0[_0x1c11('0x24')]({'plain':!![]});var _0x1726d1=_0x1c11('0x25');return db[_0x1c11('0x4d')][_0x1c11('0x4e')]({'where':{'name':_0x1726d1,'userProfileId':_0x14b186[_0x1c11('0x4f')]},'raw':!![]})[_0x1c11('0x22')](function(_0x574548){if(_0x574548&&_0x574548[_0x1c11('0x50')]===0x0){return db[_0x1c11('0x26')]['create']({'name':_0x29bb2c[_0x1c11('0x29')],'resourceId':_0x29bb2c['id'],'type':_0x574548['name'],'sectionId':_0x574548['id']},{})[_0x1c11('0x22')](function(){return _0x51bda0;});}else{return _0x51bda0;}})[_0x1c11('0x45')](function(_0x27184d){logger[_0x1c11('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27184d);throw _0x27184d;});}return _0x51bda0;})[_0x1c11('0x22')](respondWithResult(_0x2f74f5,0xc9))[_0x1c11('0x45')](handleError(_0x2f74f5,null));};exports[_0x1c11('0x21')]=function(_0x427c39,_0x267e15){if(_0x427c39[_0x1c11('0x49')]['id']){delete _0x427c39[_0x1c11('0x49')]['id'];}return db['Trigger'][_0x1c11('0x4e')]({'where':{'id':_0x427c39[_0x1c11('0x51')]['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0x267e15,null))[_0x1c11('0x22')](saveUpdates(_0x427c39[_0x1c11('0x49')],null))[_0x1c11('0x22')](respondWithResult(_0x267e15,null))[_0x1c11('0x45')](handleError(_0x267e15,null));};exports[_0x1c11('0x23')]=function(_0x394fb,_0xe1ae8e){return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x394fb[_0x1c11('0x51')]['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0xe1ae8e,null))[_0x1c11('0x22')](removeEntity(_0xe1ae8e,null))['catch'](handleError(_0xe1ae8e,null));};exports[_0x1c11('0x52')]=function(_0x5dd43d,_0x12f63f,_0x2759c6){if(_0x5dd43d[_0x1c11('0x49')]['id']){delete _0x5dd43d[_0x1c11('0x49')]['id'];}return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x5dd43d['params']['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0x12f63f,null))['then'](function(_0xfa82d8){if(_0xfa82d8){_0x5dd43d[_0x1c11('0x49')]['TriggerAllId']=_0xfa82d8['id'];return db['Condition'][_0x1c11('0x48')](_0x5dd43d[_0x1c11('0x49')]);}})[_0x1c11('0x22')](respondWithResult(_0x12f63f,null))[_0x1c11('0x45')](handleError(_0x12f63f,null));};exports[_0x1c11('0x53')]=function(_0x124dad,_0x1da8d3,_0x12976f){if(_0x124dad[_0x1c11('0x49')]['id']){delete _0x124dad[_0x1c11('0x49')]['id'];}return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x124dad['params']['id']}})['then'](handleEntityNotFound(_0x1da8d3,null))[_0x1c11('0x22')](function(_0x4388b7){if(_0x4388b7){_0x124dad[_0x1c11('0x49')]['TriggerAnyId']=_0x4388b7['id'];return db[_0x1c11('0x54')][_0x1c11('0x48')](_0x124dad[_0x1c11('0x49')]);}})[_0x1c11('0x22')](respondWithResult(_0x1da8d3,null))['catch'](handleError(_0x1da8d3,null));};exports[_0x1c11('0x55')]=function(_0x13c60e,_0x3456ab,_0x56532d){var _0x34cce1={};var _0x5cf81a={};var _0x20dd04;var _0x4e1551;return db[_0x1c11('0x41')][_0x1c11('0x56')]({'where':{'id':_0x13c60e[_0x1c11('0x51')]['id']}})[_0x1c11('0x22')](handleEntityNotFound(_0x3456ab,null))[_0x1c11('0x22')](function(_0x2a1f39){if(_0x2a1f39){_0x20dd04=_0x2a1f39;_0x5cf81a[_0x1c11('0x31')]=_[_0x1c11('0x47')](db['Condition'][_0x1c11('0x2c')]);_0x5cf81a['query']=_[_0x1c11('0x47')](_0x13c60e[_0x1c11('0x30')]);_0x5cf81a[_0x1c11('0x3b')]=_[_0x1c11('0x33')](_0x5cf81a[_0x1c11('0x31')],_0x5cf81a[_0x1c11('0x30')]);_0x34cce1[_0x1c11('0x32')]=_[_0x1c11('0x33')](_0x5cf81a[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x13c60e[_0x1c11('0x30')][_0x1c11('0x34')]));_0x34cce1['attributes']=_0x34cce1['attributes'][_0x1c11('0x35')]?_0x34cce1[_0x1c11('0x32')]:_0x5cf81a[_0x1c11('0x31')];_0x34cce1[_0x1c11('0x57')]=qs[_0x1c11('0x39')](_0x13c60e[_0x1c11('0x30')][_0x1c11('0x39')]);_0x34cce1[_0x1c11('0x3a')]=qs['filters'](_['pick'](_0x13c60e['query'],_0x5cf81a[_0x1c11('0x3b')]));if(_0x13c60e['query'][_0x1c11('0x3d')]){_0x34cce1['where']=_['merge'](_0x34cce1[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x34cce1[_0x1c11('0x32')],function(_0x446591){var _0xf86568={};_0xf86568[_0x446591]={'$like':'%'+_0x13c60e['query'][_0x1c11('0x3d')]+'%'};return _0xf86568;})});}_0x34cce1=_[_0x1c11('0x3f')]({},_0x34cce1,_0x13c60e['options']);return _0x20dd04[_0x1c11('0x55')](_0x34cce1);}})[_0x1c11('0x22')](function(_0x4be4ae){if(_0x4be4ae){_0x4e1551=_0x4be4ae[_0x1c11('0x35')];if(!_0x13c60e[_0x1c11('0x30')]['hasOwnProperty'](_0x1c11('0x37'))){_0x34cce1['limit']=qs[_0x1c11('0x38')](_0x13c60e[_0x1c11('0x30')]['limit']);_0x34cce1[_0x1c11('0x1b')]=qs[_0x1c11('0x1b')](_0x13c60e['query'][_0x1c11('0x1b')]);}return _0x20dd04['getAllConditions'](_0x34cce1);}})[_0x1c11('0x22')](function(_0x44aaff){if(_0x44aaff){return _0x44aaff?{'count':_0x4e1551,'rows':_0x44aaff}:null;}})[_0x1c11('0x22')](respondWithResult(_0x3456ab,null))['catch'](handleError(_0x3456ab,null));};exports['getAnyConditions']=function(_0x2fbec4,_0x21bd57,_0x107b80){var _0x430754={};var _0x103fed={};var _0x4c377f;var _0x4a0841;return db[_0x1c11('0x41')][_0x1c11('0x56')]({'where':{'id':_0x2fbec4[_0x1c11('0x51')]['id']}})['then'](handleEntityNotFound(_0x21bd57,null))[_0x1c11('0x22')](function(_0x24f641){if(_0x24f641){_0x4c377f=_0x24f641;_0x103fed[_0x1c11('0x31')]=_[_0x1c11('0x47')](db[_0x1c11('0x54')][_0x1c11('0x2c')]);_0x103fed[_0x1c11('0x30')]=_['keys'](_0x2fbec4['query']);_0x103fed[_0x1c11('0x3b')]=_[_0x1c11('0x33')](_0x103fed['model'],_0x103fed[_0x1c11('0x30')]);_0x430754['attributes']=_[_0x1c11('0x33')](_0x103fed[_0x1c11('0x31')],qs[_0x1c11('0x34')](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x34')]));_0x430754[_0x1c11('0x32')]=_0x430754[_0x1c11('0x32')][_0x1c11('0x35')]?_0x430754['attributes']:_0x103fed[_0x1c11('0x31')];_0x430754[_0x1c11('0x57')]=qs['sort'](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x39')]);_0x430754[_0x1c11('0x3a')]=qs['filters'](_['pick'](_0x2fbec4[_0x1c11('0x30')],_0x103fed[_0x1c11('0x3b')]));if(_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x3d')]){_0x430754[_0x1c11('0x3a')]=_[_0x1c11('0x3f')](_0x430754[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x430754[_0x1c11('0x32')],function(_0xccc195){var _0x2eb752={};_0x2eb752[_0xccc195]={'$like':'%'+_0x2fbec4[_0x1c11('0x30')]['filter']+'%'};return _0x2eb752;})});}_0x430754=_[_0x1c11('0x3f')]({},_0x430754,_0x2fbec4[_0x1c11('0x40')]);return _0x4c377f[_0x1c11('0x58')](_0x430754);}})[_0x1c11('0x22')](function(_0x16cc3){if(_0x16cc3){_0x4a0841=_0x16cc3['length'];if(!_0x2fbec4['query'][_0x1c11('0x36')](_0x1c11('0x37'))){_0x430754[_0x1c11('0x38')]=qs[_0x1c11('0x38')](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x38')]);_0x430754[_0x1c11('0x1b')]=qs['offset'](_0x2fbec4[_0x1c11('0x30')][_0x1c11('0x1b')]);}return _0x4c377f[_0x1c11('0x58')](_0x430754);}})[_0x1c11('0x22')](function(_0x28ccb6){if(_0x28ccb6){return _0x28ccb6?{'count':_0x4a0841,'rows':_0x28ccb6}:null;}})[_0x1c11('0x22')](respondWithResult(_0x21bd57,null))[_0x1c11('0x45')](handleError(_0x21bd57,null));};exports['addAction']=function(_0x156a6f,_0x5f2759,_0x33430f){if(_0x156a6f[_0x1c11('0x49')]['id']){delete _0x156a6f[_0x1c11('0x49')]['id'];}return db[_0x1c11('0x41')][_0x1c11('0x4e')]({'where':{'id':_0x156a6f['params']['id']}})['then'](handleEntityNotFound(_0x5f2759,null))[_0x1c11('0x22')](function(_0x17b285){if(_0x17b285){_0x156a6f[_0x1c11('0x49')][_0x1c11('0x59')]=_0x17b285['id'];return db[_0x1c11('0x5a')]['create'](_0x156a6f['body']);}})[_0x1c11('0x22')](respondWithResult(_0x5f2759,null))[_0x1c11('0x45')](handleError(_0x5f2759,null));};exports[_0x1c11('0x5b')]=function(_0x4e5ef7,_0x4b8ffa,_0x4d7e6b){var _0x350acf={};var _0x5a31e8={};var _0x2a34a1;var _0xb7a7c7;return db[_0x1c11('0x41')]['findOne']({'where':{'id':_0x4e5ef7[_0x1c11('0x51')]['id']}})['then'](handleEntityNotFound(_0x4b8ffa,null))[_0x1c11('0x22')](function(_0xa24cce){if(_0xa24cce){_0x2a34a1=_0xa24cce;_0x5a31e8[_0x1c11('0x31')]=_[_0x1c11('0x47')](db[_0x1c11('0x5a')]['rawAttributes']);_0x5a31e8[_0x1c11('0x30')]=_[_0x1c11('0x47')](_0x4e5ef7[_0x1c11('0x30')]);_0x5a31e8[_0x1c11('0x3b')]=_[_0x1c11('0x33')](_0x5a31e8['model'],_0x5a31e8[_0x1c11('0x30')]);_0x350acf['attributes']=_[_0x1c11('0x33')](_0x5a31e8[_0x1c11('0x31')],qs['fields'](_0x4e5ef7[_0x1c11('0x30')][_0x1c11('0x34')]));_0x350acf[_0x1c11('0x32')]=_0x350acf[_0x1c11('0x32')][_0x1c11('0x35')]?_0x350acf[_0x1c11('0x32')]:_0x5a31e8[_0x1c11('0x31')];_0x350acf[_0x1c11('0x57')]=qs[_0x1c11('0x39')](_0x4e5ef7[_0x1c11('0x30')][_0x1c11('0x39')]);_0x350acf['where']=qs[_0x1c11('0x3b')](_[_0x1c11('0x3c')](_0x4e5ef7[_0x1c11('0x30')],_0x5a31e8[_0x1c11('0x3b')]));if(_0x4e5ef7[_0x1c11('0x30')]['filter']){_0x350acf[_0x1c11('0x3a')]=_[_0x1c11('0x3f')](_0x350acf[_0x1c11('0x3a')],{'$or':_[_0x1c11('0x2b')](_0x350acf[_0x1c11('0x32')],function(_0x24dc6d){var _0x3467e2={};_0x3467e2[_0x24dc6d]={'$like':'%'+_0x4e5ef7['query']['filter']+'%'};return _0x3467e2;})});}_0x350acf=_[_0x1c11('0x3f')]({},_0x350acf,_0x4e5ef7[_0x1c11('0x40')]);return _0x2a34a1[_0x1c11('0x5b')](_0x350acf);}})['then'](function(_0x58d0aa){if(_0x58d0aa){_0xb7a7c7=_0x58d0aa['length'];if(!_0x4e5ef7['query']['hasOwnProperty'](_0x1c11('0x37'))){_0x350acf[_0x1c11('0x38')]=qs['limit'](_0x4e5ef7['query'][_0x1c11('0x38')]);_0x350acf['offset']=qs['offset'](_0x4e5ef7[_0x1c11('0x30')][_0x1c11('0x1b')]);}return _0x2a34a1['getActions'](_0x350acf);}})[_0x1c11('0x22')](function(_0x3fe1f7){if(_0x3fe1f7){return _0x3fe1f7?{'count':_0xb7a7c7,'rows':_0x3fe1f7}:null;}})[_0x1c11('0x22')](respondWithResult(_0x4b8ffa,null))[_0x1c11('0x45')](handleError(_0x4b8ffa,null));}; \ No newline at end of file +var _0x96c0=['util','path','sox','to-csv','ejs','fs-extra','lodash','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','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','destroy','then','get','Triggers','UserProfileResource','end','error','stack','name','index','map','Trigger','rawAttributes','key','keys','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','find','create','body','user','role','userProfileId','autoAssociation','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','pick','addAction','TriggerId','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x50e0b4,_0x1057f7){var _0x2fa8b0=function(_0x3766bc){while(--_0x3766bc){_0x50e0b4['push'](_0x50e0b4['shift']());}};_0x2fa8b0(++_0x1057f7);}(_0x96c0,0xbb));var _0x096c=function(_0x8006f2,_0x26a636){_0x8006f2=_0x8006f2-0x0;var _0x1cfca7=_0x96c0[_0x8006f2];return _0x1cfca7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x096c('0x0'));var zipdir=require(_0x096c('0x1'));var jsonpatch=require(_0x096c('0x2'));var rp=require(_0x096c('0x3'));var moment=require(_0x096c('0x4'));var BPromise=require(_0x096c('0x5'));var Mustache=require(_0x096c('0x6'));var util=require(_0x096c('0x7'));var path=require(_0x096c('0x8'));var sox=require(_0x096c('0x9'));var csv=require(_0x096c('0xa'));var ejs=require(_0x096c('0xb'));var fs=require('fs');var fs_extra=require(_0x096c('0xc'));var _=require(_0x096c('0xd'));var squel=require('squel');var crypto=require(_0x096c('0xe'));var jsforce=require(_0x096c('0xf'));var deskjs=require(_0x096c('0x10'));var toCsv=require(_0x096c('0xa'));var querystring=require(_0x096c('0x11'));var Papa=require(_0x096c('0x12'));var Redis=require(_0x096c('0x13'));var authService=require(_0x096c('0x14'));var qs=require(_0x096c('0x15'));var as=require(_0x096c('0x16'));var hardwareService=require(_0x096c('0x17'));var logger=require(_0x096c('0x18'))(_0x096c('0x19'));var utils=require(_0x096c('0x1a'));var config=require(_0x096c('0x1b'));var licenseUtil=require(_0x096c('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x120e98,_0x48ef91){_0x48ef91=_0x48ef91||0xcc;return function(_0x312e17){if(_0x312e17){return _0x120e98['sendStatus'](_0x48ef91);}return _0x120e98[_0x096c('0x1d')](_0x48ef91)['end']();};}function respondWithResult(_0x203e90,_0x55000e){_0x55000e=_0x55000e||0xc8;return function(_0x22b539){if(_0x22b539){return _0x203e90['status'](_0x55000e)[_0x096c('0x1e')](_0x22b539);}};}function respondWithFilteredResult(_0xa80426,_0x8927c8){return function(_0x4ac6e0){if(_0x4ac6e0){var _0xbecd82=typeof _0x8927c8[_0x096c('0x1f')]===_0x096c('0x20')&&typeof _0x8927c8[_0x096c('0x21')]===_0x096c('0x20');var _0x260c32=_0x4ac6e0['count'];var _0x141c3e=_0xbecd82?0x0:_0x8927c8[_0x096c('0x1f')];var _0x26f25b=_0xbecd82?_0x4ac6e0['count']:_0x8927c8[_0x096c('0x1f')]+_0x8927c8['limit'];var _0x1ac4f8;if(_0x26f25b>=_0x260c32){_0x26f25b=_0x260c32;_0x1ac4f8=0xc8;}else{_0x1ac4f8=0xce;}_0xa80426[_0x096c('0x1d')](_0x1ac4f8);return _0xa80426[_0x096c('0x22')](_0x096c('0x23'),_0x141c3e+'-'+_0x26f25b+'/'+_0x260c32)[_0x096c('0x1e')](_0x4ac6e0);}return null;};}function patchUpdates(_0x2bc628){return function(_0xac8c85){try{jsonpatch['apply'](_0xac8c85,_0x2bc628,!![]);}catch(_0x334463){return BPromise[_0x096c('0x24')](_0x334463);}return _0xac8c85[_0x096c('0x25')]();};}function saveUpdates(_0x1955b4,_0x5e6505){return function(_0x579981){if(_0x579981){return _0x579981[_0x096c('0x26')](_0x1955b4)['then'](function(_0x4fdd81){return _0x4fdd81;});}return null;};}function removeEntity(_0x448a98,_0x8c662e){return function(_0x1676c4){if(_0x1676c4){return _0x1676c4[_0x096c('0x27')]()[_0x096c('0x28')](function(){var _0x499e24=_0x1676c4[_0x096c('0x29')]({'plain':!![]});var _0x2e767f=_0x096c('0x2a');return db[_0x096c('0x2b')][_0x096c('0x27')]({'where':{'type':_0x2e767f,'resourceId':_0x499e24['id']}})[_0x096c('0x28')](function(){return _0x1676c4;});})[_0x096c('0x28')](function(){_0x448a98[_0x096c('0x1d')](0xcc)[_0x096c('0x2c')]();});}};}function handleEntityNotFound(_0x49b1d3,_0x56d986){return function(_0x2c3a19){if(!_0x2c3a19){_0x49b1d3['sendStatus'](0x194);}return _0x2c3a19;};}function handleError(_0x580594,_0xf1fb72){_0xf1fb72=_0xf1fb72||0x1f4;return function(_0x2d2ef5){logger[_0x096c('0x2d')](_0x2d2ef5[_0x096c('0x2e')]);if(_0x2d2ef5[_0x096c('0x2f')]){delete _0x2d2ef5[_0x096c('0x2f')];}_0x580594[_0x096c('0x1d')](_0xf1fb72)['send'](_0x2d2ef5);};}exports[_0x096c('0x30')]=function(_0x2f7165,_0x713976){var _0x437227={},_0x23dfaa={},_0x173a17={'count':0x0,'rows':[]};var _0x343298=_[_0x096c('0x31')](db[_0x096c('0x32')][_0x096c('0x33')],function(_0x1456b0){return{'name':_0x1456b0['fieldName'],'type':_0x1456b0['type'][_0x096c('0x34')]};});_0x23dfaa['model']=_['map'](_0x343298,_0x096c('0x2f'));_0x23dfaa['query']=_[_0x096c('0x35')](_0x2f7165['query']);_0x23dfaa['filters']=_['intersection'](_0x23dfaa[_0x096c('0x36')],_0x23dfaa[_0x096c('0x37')]);_0x437227['attributes']=_[_0x096c('0x38')](_0x23dfaa['model'],qs['fields'](_0x2f7165[_0x096c('0x37')][_0x096c('0x39')]));_0x437227[_0x096c('0x3a')]=_0x437227[_0x096c('0x3a')][_0x096c('0x3b')]?_0x437227['attributes']:_0x23dfaa['model'];if(!_0x2f7165[_0x096c('0x37')][_0x096c('0x3c')](_0x096c('0x3d'))){_0x437227[_0x096c('0x21')]=qs['limit'](_0x2f7165[_0x096c('0x37')]['limit']);_0x437227[_0x096c('0x1f')]=qs[_0x096c('0x1f')](_0x2f7165[_0x096c('0x37')][_0x096c('0x1f')]);}_0x437227[_0x096c('0x3e')]=qs[_0x096c('0x3f')](_0x2f7165[_0x096c('0x37')][_0x096c('0x3f')]);_0x437227[_0x096c('0x40')]=qs[_0x096c('0x41')](_['pick'](_0x2f7165[_0x096c('0x37')],_0x23dfaa['filters']),_0x343298);if(_0x2f7165[_0x096c('0x37')][_0x096c('0x42')]){_0x437227[_0x096c('0x40')]=_[_0x096c('0x43')](_0x437227['where'],{'$or':_[_0x096c('0x31')](_0x343298,function(_0x2f4b48){if(_0x2f4b48[_0x096c('0x44')]!==_0x096c('0x45')){var _0x420940={};_0x420940[_0x2f4b48[_0x096c('0x2f')]]={'$like':'%'+_0x2f7165[_0x096c('0x37')][_0x096c('0x42')]+'%'};return _0x420940;}})});}_0x437227=_[_0x096c('0x43')]({},_0x437227,_0x2f7165[_0x096c('0x46')]);var _0x66ce9f={'where':_0x437227[_0x096c('0x40')]};return db[_0x096c('0x32')][_0x096c('0x47')](_0x66ce9f)[_0x096c('0x28')](function(_0x140e0c){_0x173a17[_0x096c('0x47')]=_0x140e0c;if(_0x2f7165[_0x096c('0x37')][_0x096c('0x48')]){_0x437227['include']=[{'all':!![]}];}return db[_0x096c('0x32')][_0x096c('0x49')](_0x437227);})['then'](function(_0xe836e6){_0x173a17[_0x096c('0x4a')]=_0xe836e6;return _0x173a17;})[_0x096c('0x28')](respondWithFilteredResult(_0x713976,_0x437227))[_0x096c('0x4b')](handleError(_0x713976,null));};exports['show']=function(_0x1f6fd0,_0x390889){var _0x342a38={'raw':![],'where':{'id':_0x1f6fd0[_0x096c('0x4c')]['id']}},_0x19d1d2={};_0x19d1d2[_0x096c('0x36')]=_[_0x096c('0x35')](db[_0x096c('0x32')][_0x096c('0x33')]);_0x19d1d2[_0x096c('0x37')]=_['keys'](_0x1f6fd0[_0x096c('0x37')]);_0x19d1d2[_0x096c('0x41')]=_['intersection'](_0x19d1d2[_0x096c('0x36')],_0x19d1d2['query']);_0x342a38[_0x096c('0x3a')]=_[_0x096c('0x38')](_0x19d1d2[_0x096c('0x36')],qs[_0x096c('0x39')](_0x1f6fd0[_0x096c('0x37')][_0x096c('0x39')]));_0x342a38[_0x096c('0x3a')]=_0x342a38[_0x096c('0x3a')][_0x096c('0x3b')]?_0x342a38['attributes']:_0x19d1d2['model'];if(_0x1f6fd0[_0x096c('0x37')][_0x096c('0x48')]){_0x342a38['include']=[{'all':!![]}];}_0x342a38=_[_0x096c('0x43')]({},_0x342a38,_0x1f6fd0['options']);return db[_0x096c('0x32')][_0x096c('0x4d')](_0x342a38)['then'](handleEntityNotFound(_0x390889,null))[_0x096c('0x28')](respondWithResult(_0x390889,null))[_0x096c('0x4b')](handleError(_0x390889,null));};exports[_0x096c('0x4e')]=function(_0xefb649,_0x4738f4){return db[_0x096c('0x32')]['create'](_0xefb649[_0x096c('0x4f')],{})[_0x096c('0x28')](function(_0x18312f){var _0xbe3c06=_0xefb649[_0x096c('0x50')][_0x096c('0x29')]({'plain':!![]});if(!_0xbe3c06)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbe3c06[_0x096c('0x51')]===_0x096c('0x50')){var _0x2081d6=_0x18312f[_0x096c('0x29')]({'plain':!![]});var _0x121011=_0x096c('0x2a');return db['UserProfileSection'][_0x096c('0x4d')]({'where':{'name':_0x121011,'userProfileId':_0xbe3c06[_0x096c('0x52')]},'raw':!![]})['then'](function(_0x42e0f4){if(_0x42e0f4&&_0x42e0f4[_0x096c('0x53')]===0x0){return db[_0x096c('0x2b')][_0x096c('0x4e')]({'name':_0x2081d6['name'],'resourceId':_0x2081d6['id'],'type':_0x42e0f4['name'],'sectionId':_0x42e0f4['id']},{})['then'](function(){return _0x18312f;});}else{return _0x18312f;}})[_0x096c('0x4b')](function(_0x4e3f81){logger[_0x096c('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e3f81);throw _0x4e3f81;});}return _0x18312f;})[_0x096c('0x28')](respondWithResult(_0x4738f4,0xc9))['catch'](handleError(_0x4738f4,null));};exports['update']=function(_0x410920,_0x5aed74){if(_0x410920[_0x096c('0x4f')]['id']){delete _0x410920[_0x096c('0x4f')]['id'];}return db[_0x096c('0x32')][_0x096c('0x4d')]({'where':{'id':_0x410920[_0x096c('0x4c')]['id']}})[_0x096c('0x28')](handleEntityNotFound(_0x5aed74,null))[_0x096c('0x28')](saveUpdates(_0x410920[_0x096c('0x4f')],null))['then'](respondWithResult(_0x5aed74,null))['catch'](handleError(_0x5aed74,null));};exports['destroy']=function(_0x593af2,_0x1a5154){return db[_0x096c('0x32')]['find']({'where':{'id':_0x593af2['params']['id']}})[_0x096c('0x28')](handleEntityNotFound(_0x1a5154,null))['then'](removeEntity(_0x1a5154,null))[_0x096c('0x4b')](handleError(_0x1a5154,null));};exports[_0x096c('0x54')]=function(_0x3f7a4a,_0x332d05,_0x14eb7e){if(_0x3f7a4a[_0x096c('0x4f')]['id']){delete _0x3f7a4a[_0x096c('0x4f')]['id'];}return db[_0x096c('0x32')][_0x096c('0x4d')]({'where':{'id':_0x3f7a4a[_0x096c('0x4c')]['id']}})[_0x096c('0x28')](handleEntityNotFound(_0x332d05,null))[_0x096c('0x28')](function(_0x511c84){if(_0x511c84){_0x3f7a4a[_0x096c('0x4f')][_0x096c('0x55')]=_0x511c84['id'];return db[_0x096c('0x56')][_0x096c('0x4e')](_0x3f7a4a[_0x096c('0x4f')]);}})[_0x096c('0x28')](respondWithResult(_0x332d05,null))[_0x096c('0x4b')](handleError(_0x332d05,null));};exports[_0x096c('0x57')]=function(_0x7ce89,_0x19c8b0,_0x4db7a2){if(_0x7ce89[_0x096c('0x4f')]['id']){delete _0x7ce89['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x7ce89[_0x096c('0x4c')]['id']}})[_0x096c('0x28')](handleEntityNotFound(_0x19c8b0,null))[_0x096c('0x28')](function(_0x1966a4){if(_0x1966a4){_0x7ce89[_0x096c('0x4f')][_0x096c('0x58')]=_0x1966a4['id'];return db['Condition'][_0x096c('0x4e')](_0x7ce89[_0x096c('0x4f')]);}})[_0x096c('0x28')](respondWithResult(_0x19c8b0,null))[_0x096c('0x4b')](handleError(_0x19c8b0,null));};exports[_0x096c('0x59')]=function(_0x491024,_0x36c9f2,_0x36cee7){var _0x1fd364={};var _0x80fbbf={};var _0x587f83;var _0x1fc67f;return db[_0x096c('0x32')][_0x096c('0x5a')]({'where':{'id':_0x491024[_0x096c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36c9f2,null))[_0x096c('0x28')](function(_0x492147){if(_0x492147){_0x587f83=_0x492147;_0x80fbbf['model']=_[_0x096c('0x35')](db[_0x096c('0x56')][_0x096c('0x33')]);_0x80fbbf[_0x096c('0x37')]=_[_0x096c('0x35')](_0x491024[_0x096c('0x37')]);_0x80fbbf[_0x096c('0x41')]=_[_0x096c('0x38')](_0x80fbbf['model'],_0x80fbbf[_0x096c('0x37')]);_0x1fd364[_0x096c('0x3a')]=_[_0x096c('0x38')](_0x80fbbf[_0x096c('0x36')],qs['fields'](_0x491024[_0x096c('0x37')][_0x096c('0x39')]));_0x1fd364[_0x096c('0x3a')]=_0x1fd364[_0x096c('0x3a')][_0x096c('0x3b')]?_0x1fd364['attributes']:_0x80fbbf[_0x096c('0x36')];_0x1fd364['order']=qs[_0x096c('0x3f')](_0x491024[_0x096c('0x37')][_0x096c('0x3f')]);_0x1fd364[_0x096c('0x40')]=qs[_0x096c('0x41')](_['pick'](_0x491024['query'],_0x80fbbf[_0x096c('0x41')]));if(_0x491024['query'][_0x096c('0x42')]){_0x1fd364[_0x096c('0x40')]=_[_0x096c('0x43')](_0x1fd364['where'],{'$or':_['map'](_0x1fd364[_0x096c('0x3a')],function(_0x40a21f){var _0x1de491={};_0x1de491[_0x40a21f]={'$like':'%'+_0x491024['query']['filter']+'%'};return _0x1de491;})});}_0x1fd364=_[_0x096c('0x43')]({},_0x1fd364,_0x491024[_0x096c('0x46')]);return _0x587f83[_0x096c('0x59')](_0x1fd364);}})[_0x096c('0x28')](function(_0xcbc9b1){if(_0xcbc9b1){_0x1fc67f=_0xcbc9b1[_0x096c('0x3b')];if(!_0x491024[_0x096c('0x37')][_0x096c('0x3c')](_0x096c('0x3d'))){_0x1fd364['limit']=qs[_0x096c('0x21')](_0x491024[_0x096c('0x37')][_0x096c('0x21')]);_0x1fd364[_0x096c('0x1f')]=qs[_0x096c('0x1f')](_0x491024[_0x096c('0x37')][_0x096c('0x1f')]);}return _0x587f83[_0x096c('0x59')](_0x1fd364);}})['then'](function(_0xbc5358){if(_0xbc5358){return _0xbc5358?{'count':_0x1fc67f,'rows':_0xbc5358}:null;}})[_0x096c('0x28')](respondWithResult(_0x36c9f2,null))[_0x096c('0x4b')](handleError(_0x36c9f2,null));};exports[_0x096c('0x5b')]=function(_0x2029ab,_0x3eeba9,_0x387641){var _0x1559c5={};var _0x409507={};var _0x40dda3;var _0x3f5318;return db['Trigger'][_0x096c('0x5a')]({'where':{'id':_0x2029ab['params']['id']}})['then'](handleEntityNotFound(_0x3eeba9,null))['then'](function(_0x7ea43e){if(_0x7ea43e){_0x40dda3=_0x7ea43e;_0x409507[_0x096c('0x36')]=_['keys'](db['Condition'][_0x096c('0x33')]);_0x409507[_0x096c('0x37')]=_[_0x096c('0x35')](_0x2029ab[_0x096c('0x37')]);_0x409507['filters']=_[_0x096c('0x38')](_0x409507[_0x096c('0x36')],_0x409507[_0x096c('0x37')]);_0x1559c5[_0x096c('0x3a')]=_[_0x096c('0x38')](_0x409507[_0x096c('0x36')],qs[_0x096c('0x39')](_0x2029ab[_0x096c('0x37')][_0x096c('0x39')]));_0x1559c5[_0x096c('0x3a')]=_0x1559c5[_0x096c('0x3a')][_0x096c('0x3b')]?_0x1559c5[_0x096c('0x3a')]:_0x409507[_0x096c('0x36')];_0x1559c5[_0x096c('0x3e')]=qs['sort'](_0x2029ab[_0x096c('0x37')]['sort']);_0x1559c5[_0x096c('0x40')]=qs[_0x096c('0x41')](_[_0x096c('0x5c')](_0x2029ab[_0x096c('0x37')],_0x409507[_0x096c('0x41')]));if(_0x2029ab[_0x096c('0x37')][_0x096c('0x42')]){_0x1559c5[_0x096c('0x40')]=_['merge'](_0x1559c5['where'],{'$or':_[_0x096c('0x31')](_0x1559c5['attributes'],function(_0x49914d){var _0x16fb09={};_0x16fb09[_0x49914d]={'$like':'%'+_0x2029ab[_0x096c('0x37')][_0x096c('0x42')]+'%'};return _0x16fb09;})});}_0x1559c5=_[_0x096c('0x43')]({},_0x1559c5,_0x2029ab[_0x096c('0x46')]);return _0x40dda3[_0x096c('0x5b')](_0x1559c5);}})[_0x096c('0x28')](function(_0x5ceabe){if(_0x5ceabe){_0x3f5318=_0x5ceabe[_0x096c('0x3b')];if(!_0x2029ab[_0x096c('0x37')][_0x096c('0x3c')](_0x096c('0x3d'))){_0x1559c5['limit']=qs[_0x096c('0x21')](_0x2029ab['query'][_0x096c('0x21')]);_0x1559c5[_0x096c('0x1f')]=qs[_0x096c('0x1f')](_0x2029ab[_0x096c('0x37')][_0x096c('0x1f')]);}return _0x40dda3[_0x096c('0x5b')](_0x1559c5);}})['then'](function(_0xb840d2){if(_0xb840d2){return _0xb840d2?{'count':_0x3f5318,'rows':_0xb840d2}:null;}})['then'](respondWithResult(_0x3eeba9,null))[_0x096c('0x4b')](handleError(_0x3eeba9,null));};exports[_0x096c('0x5d')]=function(_0x1f3e2c,_0x4cd3e3,_0xc2cefb){if(_0x1f3e2c[_0x096c('0x4f')]['id']){delete _0x1f3e2c['body']['id'];}return db[_0x096c('0x32')]['find']({'where':{'id':_0x1f3e2c[_0x096c('0x4c')]['id']}})[_0x096c('0x28')](handleEntityNotFound(_0x4cd3e3,null))[_0x096c('0x28')](function(_0x53fa56){if(_0x53fa56){_0x1f3e2c[_0x096c('0x4f')][_0x096c('0x5e')]=_0x53fa56['id'];return db[_0x096c('0x5f')]['create'](_0x1f3e2c[_0x096c('0x4f')]);}})[_0x096c('0x28')](respondWithResult(_0x4cd3e3,null))['catch'](handleError(_0x4cd3e3,null));};exports[_0x096c('0x60')]=function(_0x1047c2,_0x4e901a,_0x249db1){var _0x568cc0={};var _0x1264cd={};var _0x40cecb;var _0x106ac2;return db[_0x096c('0x32')][_0x096c('0x5a')]({'where':{'id':_0x1047c2[_0x096c('0x4c')]['id']}})[_0x096c('0x28')](handleEntityNotFound(_0x4e901a,null))[_0x096c('0x28')](function(_0xb06f61){if(_0xb06f61){_0x40cecb=_0xb06f61;_0x1264cd[_0x096c('0x36')]=_['keys'](db['Action'][_0x096c('0x33')]);_0x1264cd[_0x096c('0x37')]=_[_0x096c('0x35')](_0x1047c2[_0x096c('0x37')]);_0x1264cd[_0x096c('0x41')]=_[_0x096c('0x38')](_0x1264cd[_0x096c('0x36')],_0x1264cd[_0x096c('0x37')]);_0x568cc0[_0x096c('0x3a')]=_[_0x096c('0x38')](_0x1264cd[_0x096c('0x36')],qs['fields'](_0x1047c2['query'][_0x096c('0x39')]));_0x568cc0[_0x096c('0x3a')]=_0x568cc0[_0x096c('0x3a')][_0x096c('0x3b')]?_0x568cc0[_0x096c('0x3a')]:_0x1264cd[_0x096c('0x36')];_0x568cc0[_0x096c('0x3e')]=qs[_0x096c('0x3f')](_0x1047c2['query']['sort']);_0x568cc0['where']=qs[_0x096c('0x41')](_[_0x096c('0x5c')](_0x1047c2['query'],_0x1264cd[_0x096c('0x41')]));if(_0x1047c2[_0x096c('0x37')][_0x096c('0x42')]){_0x568cc0[_0x096c('0x40')]=_['merge'](_0x568cc0['where'],{'$or':_[_0x096c('0x31')](_0x568cc0['attributes'],function(_0x275d8b){var _0x5a6d0f={};_0x5a6d0f[_0x275d8b]={'$like':'%'+_0x1047c2[_0x096c('0x37')][_0x096c('0x42')]+'%'};return _0x5a6d0f;})});}_0x568cc0=_['merge']({},_0x568cc0,_0x1047c2['options']);return _0x40cecb['getActions'](_0x568cc0);}})[_0x096c('0x28')](function(_0x4fddb7){if(_0x4fddb7){_0x106ac2=_0x4fddb7[_0x096c('0x3b')];if(!_0x1047c2[_0x096c('0x37')][_0x096c('0x3c')](_0x096c('0x3d'))){_0x568cc0[_0x096c('0x21')]=qs[_0x096c('0x21')](_0x1047c2[_0x096c('0x37')]['limit']);_0x568cc0[_0x096c('0x1f')]=qs['offset'](_0x1047c2['query'][_0x096c('0x1f')]);}return _0x40cecb[_0x096c('0x60')](_0x568cc0);}})[_0x096c('0x28')](function(_0x42e211){if(_0x42e211){return _0x42e211?{'count':_0x106ac2,'rows':_0x42e211}:null;}})['then'](respondWithResult(_0x4e901a,null))[_0x096c('0x4b')](handleError(_0x4e901a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a34068d..a4a1fc3 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 _0x92f0=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./trigger.attributes','exports','Trigger','util'];(function(_0x4c732b,_0x479245){var _0x36f43f=function(_0x43fea2){while(--_0x43fea2){_0x4c732b['push'](_0x4c732b['shift']());}};_0x36f43f(++_0x479245);}(_0x92f0,0x10d));var _0x092f=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x92f0[_0x204eb7];return _0x37e444;};'use strict';var _=require('lodash');var util=require(_0x092f('0x0'));var logger=require(_0x092f('0x1'))('api');var moment=require(_0x092f('0x2'));var BPromise=require(_0x092f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x092f('0x4'));var config=require(_0x092f('0x5'));var attributes=require(_0x092f('0x6'));module[_0x092f('0x7')]=function(_0x2996b0,_0x2b6dcb){return _0x2996b0['define'](_0x092f('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac9d=['bluebird','request-promise','path','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xac9d,0x14d));var _0xdac9=function(_0x528bb5,_0x119c5b){_0x528bb5=_0x528bb5-0x0;var _0x58e8ca=_0xac9d[_0x528bb5];return _0x58e8ca;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var logger=require(_0xdac9('0x2'))(_0xdac9('0x3'));var moment=require(_0xdac9('0x4'));var BPromise=require(_0xdac9('0x5'));var rp=require(_0xdac9('0x6'));var fs=require('fs');var path=require(_0xdac9('0x7'));var rimraf=require('rimraf');var config=require(_0xdac9('0x8'));var attributes=require('./trigger.attributes');module[_0xdac9('0x9')]=function(_0x1f8ff3,_0x1222bb){return _0x1f8ff3[_0xdac9('0xa')](_0xdac9('0xb'),attributes,{'tableName':_0xdac9('0xc'),'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 a9a83f2..3839a6a 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 _0xf952=['options','raw','where','limit','include','model','attributes','GetTrigger','ShowTrigger','find','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trigger','findAll'];(function(_0xe4388c,_0x2abf8d){var _0x601e34=function(_0x37ed91){while(--_0x37ed91){_0xe4388c['push'](_0xe4388c['shift']());}};_0x601e34(++_0x2abf8d);}(_0xf952,0x158));var _0x2f95=function(_0x1025c2,_0x49e47b){_0x1025c2=_0x1025c2-0x0;var _0x244236=_0xf952[_0x1025c2];return _0x244236;};'use strict';var _=require(_0x2f95('0x0'));var util=require(_0x2f95('0x1'));var moment=require(_0x2f95('0x2'));var BPromise=require(_0x2f95('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f95('0x4'));var db=require(_0x2f95('0x5'))['db'];var utils=require(_0x2f95('0x6'));var logger=require(_0x2f95('0x7'))(_0x2f95('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f95('0x9')][_0x2f95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5793b5,_0x3783bd,_0x17128f){return new BPromise(function(_0x400b32,_0x4b01b1){return client[_0x2f95('0xb')](_0x5793b5,_0x17128f)[_0x2f95('0xc')](function(_0x5d0d36){logger[_0x2f95('0xd')](_0x2f95('0xe'),_0x3783bd,_0x2f95('0xf'));logger[_0x2f95('0x10')](_0x2f95('0x11'),_0x3783bd,'request\x20sent',JSON[_0x2f95('0x12')](_0x5d0d36));if(_0x5d0d36[_0x2f95('0x13')]){if(_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x14')]===0x1f4){logger[_0x2f95('0x13')](_0x2f95('0xe'),_0x3783bd,_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x15')]);return _0x4b01b1(_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x15')]);}logger[_0x2f95('0x13')](_0x2f95('0xe'),_0x3783bd,_0x5d0d36['error']['message']);return _0x400b32(_0x5d0d36[_0x2f95('0x13')][_0x2f95('0x15')]);}else{logger[_0x2f95('0xd')](_0x2f95('0xe'),_0x3783bd,_0x2f95('0xf'));_0x400b32(_0x5d0d36[_0x2f95('0x16')]['message']);}})[_0x2f95('0x17')](function(_0x818b9f){logger[_0x2f95('0x13')](_0x2f95('0xe'),_0x3783bd,_0x818b9f);_0x4b01b1(_0x818b9f);});});}exports['GetTrigger']=function(_0x7f22ed){var _0x58ec49=this;return new Promise(function(_0x166234,_0x2d17e3){return db[_0x2f95('0x18')][_0x2f95('0x19')]({'raw':_0x7f22ed[_0x2f95('0x1a')]?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1b')]===undefined?!![]:![]:!![],'where':_0x7f22ed[_0x2f95('0x1a')]?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1c')]||null:null,'attributes':_0x7f22ed[_0x2f95('0x1a')]?_0x7f22ed[_0x2f95('0x1a')]['attributes']||null:null,'limit':_0x7f22ed['options']?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1d')]||null:null,'include':_0x7f22ed['options']?_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1e')]?_['map'](_0x7f22ed[_0x2f95('0x1a')][_0x2f95('0x1e')],function(_0x1cd13a){return{'model':db[_0x1cd13a[_0x2f95('0x1f')]],'as':_0x1cd13a['as'],'attributes':_0x1cd13a['attributes'],'include':_0x1cd13a['include']?_['map'](_0x1cd13a[_0x2f95('0x1e')],function(_0x1c4ef9){return{'model':db[_0x1c4ef9[_0x2f95('0x1f')]],'as':_0x1c4ef9['as'],'attributes':_0x1c4ef9[_0x2f95('0x20')],'include':_0x1c4ef9['include']?_['map'](_0x1c4ef9['include'],function(_0xa8c8a7){return{'model':db[_0xa8c8a7[_0x2f95('0x1f')]],'as':_0xa8c8a7['as'],'attributes':_0xa8c8a7[_0x2f95('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2f95('0xc')](function(_0x4a28f5){logger['info'](_0x2f95('0x21'),_0x7f22ed);logger[_0x2f95('0x10')](_0x2f95('0x21'),_0x7f22ed,JSON[_0x2f95('0x12')](_0x4a28f5));_0x166234(_0x4a28f5);})[_0x2f95('0x17')](function(_0x26ed3f){logger[_0x2f95('0x13')]('GetTrigger',_0x26ed3f[_0x2f95('0x15')],_0x7f22ed);_0x2d17e3(_0x58ec49[_0x2f95('0x13')](0x1f4,_0x26ed3f[_0x2f95('0x15')]));});});};exports[_0x2f95('0x22')]=function(_0x4fdb82){var _0x52214e=this;return new Promise(function(_0x592da3,_0x2ec297){return db[_0x2f95('0x18')][_0x2f95('0x23')]({'raw':_0x4fdb82['options']?_0x4fdb82[_0x2f95('0x1a')][_0x2f95('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fdb82[_0x2f95('0x1a')]?_0x4fdb82[_0x2f95('0x1a')][_0x2f95('0x1c')]||null:null,'attributes':_0x4fdb82[_0x2f95('0x1a')]?_0x4fdb82['options'][_0x2f95('0x20')]||null:null,'include':_0x4fdb82[_0x2f95('0x1a')]?_0x4fdb82[_0x2f95('0x1a')][_0x2f95('0x1e')]?_[_0x2f95('0x24')](_0x4fdb82['options']['include'],function(_0x7ef4d2){return{'model':db[_0x7ef4d2[_0x2f95('0x1f')]],'as':_0x7ef4d2['as'],'attributes':_0x7ef4d2[_0x2f95('0x20')],'include':_0x7ef4d2[_0x2f95('0x1e')]?_[_0x2f95('0x24')](_0x7ef4d2[_0x2f95('0x1e')],function(_0x1b8b03){return{'model':db[_0x1b8b03[_0x2f95('0x1f')]],'as':_0x1b8b03['as'],'attributes':_0x1b8b03[_0x2f95('0x20')],'include':_0x1b8b03['include']?_['map'](_0x1b8b03[_0x2f95('0x1e')],function(_0x11a32b){return{'model':db[_0x11a32b[_0x2f95('0x1f')]],'as':_0x11a32b['as'],'attributes':_0x11a32b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f95('0xc')](function(_0x1d68b1){logger['info'](_0x2f95('0x22'),_0x4fdb82);logger[_0x2f95('0x10')](_0x2f95('0x22'),_0x4fdb82,JSON['stringify'](_0x1d68b1));_0x592da3(_0x1d68b1);})['catch'](function(_0x4c2211){logger[_0x2f95('0x13')]('ShowTrigger',_0x4c2211[_0x2f95('0x15')],_0x4fdb82);_0x2ec297(_0x52214e[_0x2f95('0x13')](0x1f4,_0x4c2211[_0x2f95('0x15')]));});});}; \ No newline at end of file +var _0xc161=['catch','GetTrigger','findAll','raw','options','where','attributes','limit','include','map','model','ShowTrigger','Trigger','find','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','debug','request\x20sent','error','message'];(function(_0x22ad2d,_0x5172c6){var _0x5638f8=function(_0x3d5d5f){while(--_0x3d5d5f){_0x22ad2d['push'](_0x22ad2d['shift']());}};_0x5638f8(++_0x5172c6);}(_0xc161,0x6f));var _0x1c16=function(_0xa3fa3,_0x328285){_0xa3fa3=_0xa3fa3-0x0;var _0x488dd4=_0xc161[_0xa3fa3];return _0x488dd4;};'use strict';var _=require(_0x1c16('0x0'));var util=require(_0x1c16('0x1'));var moment=require(_0x1c16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c16('0x3'));var db=require(_0x1c16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c16('0x5'))(_0x1c16('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c16('0x7'));var client=jayson[_0x1c16('0x8')][_0x1c16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28e891,_0x612081,_0x6b00be){return new BPromise(function(_0x5bb77a,_0x4d9291){return client[_0x1c16('0xa')](_0x28e891,_0x6b00be)['then'](function(_0x48797b){logger[_0x1c16('0xb')](_0x1c16('0xc'),_0x612081,'request\x20sent');logger[_0x1c16('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x612081,_0x1c16('0xe'),JSON['stringify'](_0x48797b));if(_0x48797b[_0x1c16('0xf')]){if(_0x48797b[_0x1c16('0xf')]['code']===0x1f4){logger[_0x1c16('0xf')](_0x1c16('0xc'),_0x612081,_0x48797b[_0x1c16('0xf')][_0x1c16('0x10')]);return _0x4d9291(_0x48797b[_0x1c16('0xf')]['message']);}logger[_0x1c16('0xf')](_0x1c16('0xc'),_0x612081,_0x48797b[_0x1c16('0xf')][_0x1c16('0x10')]);return _0x5bb77a(_0x48797b[_0x1c16('0xf')][_0x1c16('0x10')]);}else{logger[_0x1c16('0xb')]('Trigger,\x20%s,\x20%s',_0x612081,_0x1c16('0xe'));_0x5bb77a(_0x48797b['result'][_0x1c16('0x10')]);}})[_0x1c16('0x11')](function(_0x19cf21){logger[_0x1c16('0xf')](_0x1c16('0xc'),_0x612081,_0x19cf21);_0x4d9291(_0x19cf21);});});}exports[_0x1c16('0x12')]=function(_0x2efe2a){var _0x210475=this;return new Promise(function(_0x593098,_0x1f10cc){return db['Trigger'][_0x1c16('0x13')]({'raw':_0x2efe2a['options']?_0x2efe2a['options'][_0x1c16('0x14')]===undefined?!![]:![]:!![],'where':_0x2efe2a[_0x1c16('0x15')]?_0x2efe2a[_0x1c16('0x15')][_0x1c16('0x16')]||null:null,'attributes':_0x2efe2a[_0x1c16('0x15')]?_0x2efe2a[_0x1c16('0x15')][_0x1c16('0x17')]||null:null,'limit':_0x2efe2a[_0x1c16('0x15')]?_0x2efe2a[_0x1c16('0x15')][_0x1c16('0x18')]||null:null,'include':_0x2efe2a[_0x1c16('0x15')]?_0x2efe2a[_0x1c16('0x15')][_0x1c16('0x19')]?_[_0x1c16('0x1a')](_0x2efe2a[_0x1c16('0x15')][_0x1c16('0x19')],function(_0x3b577c){return{'model':db[_0x3b577c[_0x1c16('0x1b')]],'as':_0x3b577c['as'],'attributes':_0x3b577c[_0x1c16('0x17')],'include':_0x3b577c[_0x1c16('0x19')]?_['map'](_0x3b577c['include'],function(_0x1ed876){return{'model':db[_0x1ed876['model']],'as':_0x1ed876['as'],'attributes':_0x1ed876[_0x1c16('0x17')],'include':_0x1ed876[_0x1c16('0x19')]?_['map'](_0x1ed876['include'],function(_0x4a1115){return{'model':db[_0x4a1115['model']],'as':_0x4a1115['as'],'attributes':_0x4a1115['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x481266){logger['info']('GetTrigger',_0x2efe2a);logger['debug'](_0x1c16('0x12'),_0x2efe2a,JSON['stringify'](_0x481266));_0x593098(_0x481266);})['catch'](function(_0x20148e){logger[_0x1c16('0xf')](_0x1c16('0x12'),_0x20148e[_0x1c16('0x10')],_0x2efe2a);_0x1f10cc(_0x210475[_0x1c16('0xf')](0x1f4,_0x20148e[_0x1c16('0x10')]));});});};exports[_0x1c16('0x1c')]=function(_0x545d88){var _0xd98689=this;return new Promise(function(_0x4f6f49,_0x1877d4){return db[_0x1c16('0x1d')][_0x1c16('0x1e')]({'raw':_0x545d88[_0x1c16('0x15')]?_0x545d88['options'][_0x1c16('0x14')]===undefined?!![]:![]:!![],'where':_0x545d88[_0x1c16('0x15')]?_0x545d88[_0x1c16('0x15')][_0x1c16('0x16')]||null:null,'attributes':_0x545d88['options']?_0x545d88[_0x1c16('0x15')][_0x1c16('0x17')]||null:null,'include':_0x545d88[_0x1c16('0x15')]?_0x545d88[_0x1c16('0x15')][_0x1c16('0x19')]?_[_0x1c16('0x1a')](_0x545d88[_0x1c16('0x15')]['include'],function(_0x245229){return{'model':db[_0x245229['model']],'as':_0x245229['as'],'attributes':_0x245229[_0x1c16('0x17')],'include':_0x245229[_0x1c16('0x19')]?_[_0x1c16('0x1a')](_0x245229['include'],function(_0x2eff75){return{'model':db[_0x2eff75[_0x1c16('0x1b')]],'as':_0x2eff75['as'],'attributes':_0x2eff75[_0x1c16('0x17')],'include':_0x2eff75[_0x1c16('0x19')]?_['map'](_0x2eff75[_0x1c16('0x19')],function(_0x397c31){return{'model':db[_0x397c31[_0x1c16('0x1b')]],'as':_0x397c31['as'],'attributes':_0x397c31[_0x1c16('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x392b8d){logger[_0x1c16('0xb')](_0x1c16('0x1c'),_0x545d88);logger['debug'](_0x1c16('0x1c'),_0x545d88,JSON[_0x1c16('0x1f')](_0x392b8d));_0x4f6f49(_0x392b8d);})[_0x1c16('0x11')](function(_0x41d413){logger[_0x1c16('0xf')]('ShowTrigger',_0x41d413['message'],_0x545d88);_0x1877d4(_0xd98689[_0x1c16('0xf')](0x1f4,_0x41d413[_0x1c16('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index be13eae..e40599b 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 _0xca12=['../../components/auth/service','../../config/environment','./trunk.controller','get','index','/:id','show','post','/:id/clone','isAuthenticated','clone','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x3addea,_0x5d0716){var _0x7ab4a2=function(_0x584e07){while(--_0x584e07){_0x3addea['push'](_0x3addea['shift']());}};_0x7ab4a2(++_0x5d0716);}(_0xca12,0xec));var _0x2ca1=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xca12[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0x2ca1('0x0'));var util=require(_0x2ca1('0x1'));var path=require(_0x2ca1('0x2'));var timeout=require(_0x2ca1('0x3'));var express=require(_0x2ca1('0x4'));var router=express['Router']();var fs_extra=require(_0x2ca1('0x5'));var auth=require(_0x2ca1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ca1('0x7'));var controller=require(_0x2ca1('0x8'));router[_0x2ca1('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ca1('0xa')]);router[_0x2ca1('0x9')](_0x2ca1('0xb'),auth['isAuthenticated'](),controller[_0x2ca1('0xc')]);router[_0x2ca1('0xd')](_0x2ca1('0xe'),auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x10')]);router[_0x2ca1('0xd')]('/',auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x11')]);router[_0x2ca1('0x12')](_0x2ca1('0xb'),auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x13')]);router['delete']('/:id',auth[_0x2ca1('0xf')](),controller[_0x2ca1('0x14')]);module[_0x2ca1('0x15')]=router; \ No newline at end of file +var _0x8115=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','show','post','/:id/clone','clone','create','/:id','update','delete','destroy','exports'];(function(_0x903b8,_0x748a72){var _0x115ca6=function(_0x19fa66){while(--_0x19fa66){_0x903b8['push'](_0x903b8['shift']());}};_0x115ca6(++_0x748a72);}(_0x8115,0x108));var _0x5811=function(_0x1aced1,_0x120d53){_0x1aced1=_0x1aced1-0x0;var _0x42f54d=_0x8115[_0x1aced1];return _0x42f54d;};'use strict';var multer=require(_0x5811('0x0'));var util=require(_0x5811('0x1'));var path=require(_0x5811('0x2'));var timeout=require(_0x5811('0x3'));var express=require('express');var router=express[_0x5811('0x4')]();var fs_extra=require(_0x5811('0x5'));var auth=require(_0x5811('0x6'));var interaction=require(_0x5811('0x7'));var config=require(_0x5811('0x8'));var controller=require(_0x5811('0x9'));router[_0x5811('0xa')]('/',auth[_0x5811('0xb')](),controller['index']);router[_0x5811('0xa')]('/:id',auth[_0x5811('0xb')](),controller[_0x5811('0xc')]);router[_0x5811('0xd')](_0x5811('0xe'),auth[_0x5811('0xb')](),controller[_0x5811('0xf')]);router[_0x5811('0xd')]('/',auth['isAuthenticated'](),controller[_0x5811('0x10')]);router['put'](_0x5811('0x11'),auth[_0x5811('0xb')](),controller[_0x5811('0x12')]);router[_0x5811('0x13')](_0x5811('0x11'),auth[_0x5811('0xb')](),controller[_0x5811('0x14')]);module[_0x5811('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 63e0b96..537142a 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 _0xa882=['nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','certificate','active','passive','dynamic','update,nonat','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','join','getDataValue','transport','split','rfc2833','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue'];(function(_0x3d38ad,_0x236f52){var _0x4a9fe6=function(_0x315ced){while(--_0x315ced){_0x3d38ad['push'](_0x3d38ad['shift']());}};_0x4a9fe6(++_0x236f52);}(_0xa882,0xa9));var _0x2a88=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xa882[_0xd0b415];return _0x2bdf2c;};'use strict';var Sequelize=require(_0x2a88('0x0'));module[_0x2a88('0x1')]={'name':{'type':Sequelize[_0x2a88('0x2')],'allowNull':![],'unique':_0x2a88('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x5'),_0x2a88('0x6'),_0x2a88('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2a88('0x2')],'allowNull':![],'defaultValue':_0x2a88('0x8')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x2a88('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x2a88('0xa'),'PROHIB_PASSED_SCREEN',_0x2a88('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x2a88('0x2')]},'permit':{'type':Sequelize[_0x2a88('0x2')]},'secret':{'type':Sequelize[_0x2a88('0x2')]},'md5secret':{'type':Sequelize[_0x2a88('0x2')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x2a88('0xc'),'set':function(_0x395f6b){this['setDataValue']('transport',_0x395f6b?_0x395f6b[_0x2a88('0xd')](','):null);},'get':function(){return this[_0x2a88('0xe')]('transport')?this[_0x2a88('0xe')](_0x2a88('0xf'))[_0x2a88('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x11'),'info',_0x2a88('0x12'),_0x2a88('0x13'),_0x2a88('0x14')),'defaultValue':_0x2a88('0x11')},'directmedia':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no',_0x2a88('0x16'),_0x2a88('0x17'),_0x2a88('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2a88('0x2')]},'directmediadeny':{'type':Sequelize[_0x2a88('0x2')]},'nat':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x19'),'set':function(_0x5a0889){this[_0x2a88('0x1a')](_0x2a88('0x1b'),_0x5a0889?_0x5a0889[_0x2a88('0xd')](','):null);},'get':function(){return this[_0x2a88('0xe')](_0x2a88('0x1b'))?this[_0x2a88('0xe')](_0x2a88('0x1b'))[_0x2a88('0x10')](','):null;},'comment':_0x2a88('0x1c')},'callgroup':{'type':Sequelize[_0x2a88('0x2')]},'namedcallgroup':{'type':Sequelize[_0x2a88('0x2')]},'pickupgroup':{'type':Sequelize[_0x2a88('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x2a88('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2a88('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x1d')},'allow':{'type':Sequelize[_0x2a88('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x518f74){this[_0x2a88('0x1a')](_0x2a88('0x1e'),_0x518f74?_0x518f74['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x2a88('0xe')]('allow')[_0x2a88('0x10')](';'):null;},'comment':_0x2a88('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no')},'insecure':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x20'),'set':function(_0x2948f7){this[_0x2a88('0x1a')](_0x2a88('0x21'),_0x2948f7?_0x2948f7[_0x2a88('0xd')](','):null);},'get':function(){return this[_0x2a88('0xe')]('insecure')?this['getDataValue']('insecure')['split'](','):null;},'comment':_0x2a88('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no',_0x2a88('0x23'))},'promiscredir':{'type':Sequelize[_0x2a88('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'accountcode':{'type':Sequelize[_0x2a88('0x24')](0xb)},'setvar':{'type':Sequelize[_0x2a88('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x2a88('0x25')},'amaflags':{'type':Sequelize[_0x2a88('0x2')]},'callcounter':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no'),'defaultValue':_0x2a88('0x15')},'busylevel':{'type':Sequelize[_0x2a88('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x2a88('0x2')]},'template':{'type':Sequelize[_0x2a88('0x2')]},'videosupport':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2a88('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0x2a88('0x2')]},'session_timers':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x26'),_0x2a88('0x27'),_0x2a88('0x28'))},'session_expires':{'type':Sequelize[_0x2a88('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x2a88('0x24')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x2a88('0x29'),_0x2a88('0x2a')),'defaultValue':_0x2a88('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x2a88('0x2')]},'fromdomain':{'type':Sequelize[_0x2a88('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2a88('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2a88('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x2a88('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2a88('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no',_0x2a88('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2a88('0x2')]},'callbackextension':{'type':Sequelize[_0x2a88('0x2')]},'timert1':{'type':Sequelize[_0x2a88('0x24')](0xb)},'timerb':{'type':Sequelize[_0x2a88('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2a88('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x2a88('0x2')]},'use_q850_reason':{'type':Sequelize[_0x2a88('0x2')]},'maxforwards':{'type':Sequelize[_0x2a88('0x24')](0xb)},'encryption':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'force_avp':{'type':Sequelize[_0x2a88('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x2a88('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x2a88('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2a88('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2a88('0x2')]},'dtlscipher':{'type':Sequelize[_0x2a88('0x2')]},'dtlscafile':{'type':Sequelize[_0x2a88('0x2')]},'dtlscapath':{'type':Sequelize[_0x2a88('0x2')]},'dtlssetup':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x2d'),_0x2a88('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2a88('0x2')]},'usereqphone':{'type':Sequelize[_0x2a88('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2a88('0x2')]},'recordofffeature':{'type':Sequelize[_0x2a88('0x2')]},'call_limit':{'type':Sequelize[_0x2a88('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x2a88('0x15'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x2a88('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x2a88('0x2')]},'parkinglot':{'type':Sequelize[_0x2a88('0x2')]},'description':{'type':Sequelize[_0x2a88('0x2')]},'host':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':_0x2a88('0x2f')},'canreinvite':{'type':Sequelize[_0x2a88('0x4')](_0x2a88('0x15'),'no',_0x2a88('0x16'),'update',_0x2a88('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2a88('0x2')]},'otherFields':{'type':Sequelize[_0x2a88('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2a88('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x83bc=['update','outgoing','force_rport,comedia','setDataValue','nat','split','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]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','uas','fingerprint','active','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','nonat'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0x83bc,0x18f));var _0xc83b=function(_0x4d64e0,_0x1b7efb){_0x4d64e0=_0x4d64e0-0x0;var _0x54f3d6=_0x83bc[_0x4d64e0];return _0x54f3d6;};'use strict';var Sequelize=require(_0xc83b('0x0'));module[_0xc83b('0x1')]={'name':{'type':Sequelize[_0xc83b('0x2')],'allowNull':![],'unique':_0xc83b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x5'),'user',_0xc83b('0x6')),'allowNull':![],'defaultValue':_0xc83b('0x5')},'context':{'type':Sequelize[_0xc83b('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x7'),_0xc83b('0x8'),_0xc83b('0x9'),_0xc83b('0xa'),'PROHIB_NOT_SCREENED',_0xc83b('0xb'),_0xc83b('0xc'),_0xc83b('0xd'))},'deny':{'type':Sequelize[_0xc83b('0x2')]},'permit':{'type':Sequelize[_0xc83b('0x2')]},'secret':{'type':Sequelize[_0xc83b('0x2')]},'md5secret':{'type':Sequelize[_0xc83b('0x2')]},'remotesecret':{'type':Sequelize[_0xc83b('0x2')]},'transport':{'type':Sequelize[_0xc83b('0x2')],'defaultValue':_0xc83b('0xe'),'set':function(_0x30b40a){this['setDataValue'](_0xc83b('0xf'),_0x30b40a?_0x30b40a[_0xc83b('0x10')](','):null);},'get':function(){return this[_0xc83b('0x11')]('transport')?this[_0xc83b('0x11')](_0xc83b('0xf'))['split'](','):null;},'comment':_0xc83b('0x12')},'dtmfmode':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x13'),_0xc83b('0x14'),_0xc83b('0x15'),'inband',_0xc83b('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no',_0xc83b('0x18'),_0xc83b('0x19'),_0xc83b('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc83b('0x2')]},'directmediadeny':{'type':Sequelize[_0xc83b('0x2')]},'nat':{'type':Sequelize[_0xc83b('0x2')],'defaultValue':_0xc83b('0x1b'),'set':function(_0x5d7e41){this[_0xc83b('0x1c')](_0xc83b('0x1d'),_0x5d7e41?_0x5d7e41[_0xc83b('0x10')](','):null);},'get':function(){return this[_0xc83b('0x11')]('nat')?this[_0xc83b('0x11')]('nat')[_0xc83b('0x1e')](','):null;},'comment':_0xc83b('0x1f')},'callgroup':{'type':Sequelize[_0xc83b('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xc83b('0x2')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc83b('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc83b('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xc83b('0x2')],'defaultValue':_0xc83b('0x20')},'allow':{'type':Sequelize[_0xc83b('0x2')],'allowNull':![],'defaultValue':_0xc83b('0x21'),'set':function(_0x176440){this[_0xc83b('0x1c')]('allow',_0x176440?_0x176440[_0xc83b('0x10')](';'):_0xc83b('0x21'));},'get':function(){return this[_0xc83b('0x11')]('allow')?this[_0xc83b('0x11')](_0xc83b('0x22'))[_0xc83b('0x1e')](';'):null;},'comment':_0xc83b('0x23')},'autoframing':{'type':Sequelize[_0xc83b('0x4')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xc83b('0x24'),'set':function(_0x202258){this[_0xc83b('0x1c')](_0xc83b('0x25'),_0x202258?_0x202258['join'](','):null);},'get':function(){return this['getDataValue'](_0xc83b('0x25'))?this[_0xc83b('0x11')]('insecure')[_0xc83b('0x1e')](','):null;},'comment':_0xc83b('0x26')},'trustrpid':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc83b('0x4')]('yes','no',_0xc83b('0x27'))},'promiscredir':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xc83b('0x2')]},'callerid':{'type':Sequelize[_0xc83b('0x2')],'defaultValue':_0xc83b('0x28')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no'),'defaultValue':_0xc83b('0x17')},'busylevel':{'type':Sequelize[_0xc83b('0x29')](0xb)},'allowoverlap':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xc83b('0x2')]},'template':{'type':Sequelize[_0xc83b('0x2')]},'videosupport':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no',_0xc83b('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc83b('0x29')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc83b('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0xc83b('0x2')]},'session_timers':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x2b'),'refuse',_0xc83b('0x2c'))},'session_expires':{'type':Sequelize[_0xc83b('0x29')](0xb)},'session_minse':{'type':Sequelize[_0xc83b('0x29')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xc83b('0x2d'),_0xc83b('0x2e')),'defaultValue':_0xc83b('0x2e')},'t38pt_usertpsource':{'type':Sequelize[_0xc83b('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xc83b('0x2')]},'fromuser':{'type':Sequelize[_0xc83b('0x2')]},'port':{'type':Sequelize[_0xc83b('0x29')](0x5)},'qualify':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xc83b('0x29')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xc83b('0x2')]},'rtptimeout':{'type':Sequelize[_0xc83b('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xc83b('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc83b('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xc83b('0x2')]},'timert1':{'type':Sequelize[_0xc83b('0x29')](0xb)},'timerb':{'type':Sequelize[_0xc83b('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0xc83b('0x29')](0xb)},'contactpermit':{'type':Sequelize[_0xc83b('0x2')]},'contactdeny':{'type':Sequelize[_0xc83b('0x2')]},'contactacl':{'type':Sequelize[_0xc83b('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xc83b('0x2')]},'use_q850_reason':{'type':Sequelize[_0xc83b('0x2')]},'maxforwards':{'type':Sequelize[_0xc83b('0x29')](0xb)},'encryption':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no')},'icesupport':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no',_0xc83b('0x2f'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xc83b('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc83b('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xc83b('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xc83b('0x2')]},'dtlscapath':{'type':Sequelize[_0xc83b('0x2')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xc83b('0x30'),_0xc83b('0x31'),_0xc83b('0x32')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc83b('0x2')]},'usereqphone':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc83b('0x2')]},'recordofffeature':{'type':Sequelize[_0xc83b('0x2')]},'call_limit':{'type':Sequelize[_0xc83b('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0xc83b('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xc83b('0x2')]},'mohsuggest':{'type':Sequelize[_0xc83b('0x2')]},'parkinglot':{'type':Sequelize[_0xc83b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc83b('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xc83b('0x4')](_0xc83b('0x17'),'no','nonat',_0xc83b('0x19'),_0xc83b('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xc83b('0x2')]},'otherFields':{'type':Sequelize[_0xc83b('0x2')]},'active':{'type':Sequelize[_0xc83b('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc83b('0x2')],'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 250c8c9..c8d30ba 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 _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0x2c22b5,_0x4e38a2){var _0x1728eb=function(_0x1af8ee){while(--_0x1af8ee){_0x2c22b5['push'](_0x2c22b5['shift']());}};_0x1728eb(++_0x4e38a2);}(_0x9a19,0x114));var _0x99a1=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x9a19[_0x450689];return _0x46ffb0;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));}; \ No newline at end of file +var _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','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(_0x22760b,_0xf7e5fd){var _0x43e9a1=function(_0x309b91){while(--_0x309b91){_0x22760b['push'](_0x22760b['shift']());}};_0x43e9a1(++_0xf7e5fd);}(_0x98a8,0x12c));var _0x898a=function(_0x6532c9,_0x2e6ba1){_0x6532c9=_0x6532c9-0x0;var _0x3a3146=_0x98a8[_0x6532c9];return _0x3a3146;};'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'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 89b23b7..a73a8b0 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 _0xf60f=['request-promise','rimraf','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x28d628,_0x5134bf){var _0x528997=function(_0x2e1b09){while(--_0x2e1b09){_0x28d628['push'](_0x28d628['shift']());}};_0x528997(++_0x5134bf);}(_0xf60f,0x14c));var _0xff60=function(_0x6fba8f,_0x5c25bc){_0x6fba8f=_0x6fba8f-0x0;var _0x3d1ac9=_0xf60f[_0x6fba8f];return _0x3d1ac9;};'use strict';var _=require(_0xff60('0x0'));var util=require(_0xff60('0x1'));var logger=require(_0xff60('0x2'))(_0xff60('0x3'));var moment=require(_0xff60('0x4'));var BPromise=require(_0xff60('0x5'));var rp=require(_0xff60('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff60('0x7'));var config=require('../../config/environment');var attributes=require(_0xff60('0x8'));module[_0xff60('0x9')]=function(_0x2db877,_0x5e3653){return _0x2db877[_0xff60('0xa')](_0xff60('0xb'),attributes,{'tableName':_0xff60('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2874=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x4ee5ab,_0xd42447){var _0x341485=function(_0x5b941f){while(--_0x5b941f){_0x4ee5ab['push'](_0x4ee5ab['shift']());}};_0x341485(++_0xd42447);}(_0x2874,0x1e6));var _0x4287=function(_0x1db653,_0x3a9940){_0x1db653=_0x1db653-0x0;var _0x156348=_0x2874[_0x1db653];return _0x156348;};'use strict';var _=require(_0x4287('0x0'));var util=require(_0x4287('0x1'));var logger=require(_0x4287('0x2'))(_0x4287('0x3'));var moment=require(_0x4287('0x4'));var BPromise=require(_0x4287('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4287('0x6'));var rimraf=require(_0x4287('0x7'));var config=require(_0x4287('0x8'));var attributes=require(_0x4287('0x9'));module[_0x4287('0xa')]=function(_0x41b2e7,_0x434487){return _0x41b2e7[_0x4287('0xb')](_0x4287('0xc'),attributes,{'tableName':_0x4287('0xd'),'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 976beca..d7d157f 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 _0xe409=['client','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','include','model','map','ShowTrunk','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xe409,0x1d7));var _0x9e40=function(_0x4d7e44,_0x3e7e86){_0x4d7e44=_0x4d7e44-0x0;var _0x14b74c=_0xe409[_0x4d7e44];return _0x14b74c;};'use strict';var _=require(_0x9e40('0x0'));var util=require(_0x9e40('0x1'));var moment=require(_0x9e40('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e40('0x3'));var db=require(_0x9e40('0x4'))['db'];var utils=require(_0x9e40('0x5'));var logger=require(_0x9e40('0x6'))(_0x9e40('0x7'));var config=require(_0x9e40('0x8'));var jayson=require(_0x9e40('0x9'));var client=jayson[_0x9e40('0xa')][_0x9e40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b7a0e,_0x35f8e9,_0x597a27){return new BPromise(function(_0x1aec99,_0x4db7e1){return client[_0x9e40('0xc')](_0x1b7a0e,_0x597a27)[_0x9e40('0xd')](function(_0x356884){logger[_0x9e40('0xe')](_0x9e40('0xf'),_0x35f8e9,'request\x20sent');logger[_0x9e40('0x10')](_0x9e40('0x11'),_0x35f8e9,_0x9e40('0x12'),JSON[_0x9e40('0x13')](_0x356884));if(_0x356884[_0x9e40('0x14')]){if(_0x356884[_0x9e40('0x14')][_0x9e40('0x15')]===0x1f4){logger[_0x9e40('0x14')](_0x9e40('0xf'),_0x35f8e9,_0x356884['error']['message']);return _0x4db7e1(_0x356884[_0x9e40('0x14')]['message']);}logger['error'](_0x9e40('0xf'),_0x35f8e9,_0x356884[_0x9e40('0x14')][_0x9e40('0x16')]);return _0x1aec99(_0x356884[_0x9e40('0x14')][_0x9e40('0x16')]);}else{logger[_0x9e40('0xe')](_0x9e40('0xf'),_0x35f8e9,_0x9e40('0x12'));_0x1aec99(_0x356884[_0x9e40('0x17')][_0x9e40('0x16')]);}})[_0x9e40('0x18')](function(_0x4c4fbf){logger['error'](_0x9e40('0xf'),_0x35f8e9,_0x4c4fbf);_0x4db7e1(_0x4c4fbf);});});}exports[_0x9e40('0x19')]=function(_0x3e886b){var _0x2b08af=this;return new Promise(function(_0x1cd717,_0x54caad){return db[_0x9e40('0x1a')][_0x9e40('0x1b')]({'raw':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b['options'][_0x9e40('0x1d')]===undefined?!![]:![]:!![],'where':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x1e')]||null:null,'attributes':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x1f')]||null:null,'limit':_0x3e886b['options']?_0x3e886b[_0x9e40('0x1c')]['limit']||null:null,'include':_0x3e886b[_0x9e40('0x1c')]?_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x20')]?_['map'](_0x3e886b[_0x9e40('0x1c')][_0x9e40('0x20')],function(_0x18db00){return{'model':db[_0x18db00[_0x9e40('0x21')]],'as':_0x18db00['as'],'attributes':_0x18db00[_0x9e40('0x1f')],'include':_0x18db00['include']?_[_0x9e40('0x22')](_0x18db00[_0x9e40('0x20')],function(_0x118057){return{'model':db[_0x118057[_0x9e40('0x21')]],'as':_0x118057['as'],'attributes':_0x118057[_0x9e40('0x1f')],'include':_0x118057[_0x9e40('0x20')]?_[_0x9e40('0x22')](_0x118057[_0x9e40('0x20')],function(_0x4c1acc){return{'model':db[_0x4c1acc[_0x9e40('0x21')]],'as':_0x4c1acc['as'],'attributes':_0x4c1acc[_0x9e40('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x116a8f){logger[_0x9e40('0xe')](_0x9e40('0x19'),_0x3e886b);logger[_0x9e40('0x10')](_0x9e40('0x19'),_0x3e886b,JSON[_0x9e40('0x13')](_0x116a8f));_0x1cd717(_0x116a8f);})['catch'](function(_0x188dc0){logger['error']('GetTrunk',_0x188dc0['message'],_0x3e886b);_0x54caad(_0x2b08af['error'](0x1f4,_0x188dc0[_0x9e40('0x16')]));});});};exports[_0x9e40('0x23')]=function(_0xe44f6d){var _0x2b080a=this;return new Promise(function(_0xbd107e,_0x387590){return db[_0x9e40('0x1a')][_0x9e40('0x24')]({'raw':_0xe44f6d[_0x9e40('0x1c')]?_0xe44f6d['options']['raw']===undefined?!![]:![]:!![],'where':_0xe44f6d[_0x9e40('0x1c')]?_0xe44f6d['options']['where']||null:null,'attributes':_0xe44f6d['options']?_0xe44f6d[_0x9e40('0x1c')][_0x9e40('0x1f')]||null:null,'include':_0xe44f6d[_0x9e40('0x1c')]?_0xe44f6d[_0x9e40('0x1c')][_0x9e40('0x20')]?_[_0x9e40('0x22')](_0xe44f6d[_0x9e40('0x1c')][_0x9e40('0x20')],function(_0x50826d){return{'model':db[_0x50826d[_0x9e40('0x21')]],'as':_0x50826d['as'],'attributes':_0x50826d[_0x9e40('0x1f')],'include':_0x50826d[_0x9e40('0x20')]?_[_0x9e40('0x22')](_0x50826d[_0x9e40('0x20')],function(_0x4b2f71){return{'model':db[_0x4b2f71[_0x9e40('0x21')]],'as':_0x4b2f71['as'],'attributes':_0x4b2f71[_0x9e40('0x1f')],'include':_0x4b2f71[_0x9e40('0x20')]?_[_0x9e40('0x22')](_0x4b2f71[_0x9e40('0x20')],function(_0x2e00fa){return{'model':db[_0x2e00fa[_0x9e40('0x21')]],'as':_0x2e00fa['as'],'attributes':_0x2e00fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e40('0xd')](function(_0x5a4ce3){logger[_0x9e40('0xe')](_0x9e40('0x23'),_0xe44f6d);logger[_0x9e40('0x10')]('ShowTrunk',_0xe44f6d,JSON[_0x9e40('0x13')](_0x5a4ce3));_0xbd107e(_0x5a4ce3);})[_0x9e40('0x18')](function(_0x4727d0){logger[_0x9e40('0x14')](_0x9e40('0x23'),_0x4727d0[_0x9e40('0x16')],_0xe44f6d);_0x387590(_0x2b080a[_0x9e40('0x14')](0x1f4,_0x4727d0[_0x9e40('0x16')]));});});}; \ No newline at end of file +var _0xb9c8=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetTrunk','Trunk','options','raw','attributes','limit','include','map','model','stringify','ShowTrunk','find','where','lodash','util','moment'];(function(_0x665846,_0x1894fc){var _0x24c3ab=function(_0x3c94c6){while(--_0x3c94c6){_0x665846['push'](_0x665846['shift']());}};_0x24c3ab(++_0x1894fc);}(_0xb9c8,0x1d9));var _0x8b9c=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0xb9c8[_0x441563];return _0x2369ec;};'use strict';var _=require(_0x8b9c('0x0'));var util=require(_0x8b9c('0x1'));var moment=require(_0x8b9c('0x2'));var BPromise=require(_0x8b9c('0x3'));var rs=require(_0x8b9c('0x4'));var fs=require('fs');var Redis=require(_0x8b9c('0x5'));var db=require(_0x8b9c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8b9c('0x7'));var config=require(_0x8b9c('0x8'));var jayson=require(_0x8b9c('0x9'));var client=jayson[_0x8b9c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbd1907,_0xa17135,_0x276341){return new BPromise(function(_0x5eca4c,_0x16ee7e){return client[_0x8b9c('0xb')](_0xbd1907,_0x276341)[_0x8b9c('0xc')](function(_0x425e26){logger[_0x8b9c('0xd')](_0x8b9c('0xe'),_0xa17135,_0x8b9c('0xf'));logger[_0x8b9c('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0xa17135,_0x8b9c('0xf'),JSON['stringify'](_0x425e26));if(_0x425e26[_0x8b9c('0x11')]){if(_0x425e26[_0x8b9c('0x11')][_0x8b9c('0x12')]===0x1f4){logger[_0x8b9c('0x11')]('Trunk,\x20%s,\x20%s',_0xa17135,_0x425e26[_0x8b9c('0x11')][_0x8b9c('0x13')]);return _0x16ee7e(_0x425e26['error']['message']);}logger[_0x8b9c('0x11')](_0x8b9c('0xe'),_0xa17135,_0x425e26[_0x8b9c('0x11')][_0x8b9c('0x13')]);return _0x5eca4c(_0x425e26[_0x8b9c('0x11')][_0x8b9c('0x13')]);}else{logger['info'](_0x8b9c('0xe'),_0xa17135,_0x8b9c('0xf'));_0x5eca4c(_0x425e26['result']['message']);}})[_0x8b9c('0x14')](function(_0x32474f){logger[_0x8b9c('0x11')](_0x8b9c('0xe'),_0xa17135,_0x32474f);_0x16ee7e(_0x32474f);});});}exports[_0x8b9c('0x15')]=function(_0x422ebc){var _0x274cad=this;return new Promise(function(_0x5a62ea,_0x55bf36){return db[_0x8b9c('0x16')]['findAll']({'raw':_0x422ebc[_0x8b9c('0x17')]?_0x422ebc[_0x8b9c('0x17')][_0x8b9c('0x18')]===undefined?!![]:![]:!![],'where':_0x422ebc[_0x8b9c('0x17')]?_0x422ebc[_0x8b9c('0x17')]['where']||null:null,'attributes':_0x422ebc[_0x8b9c('0x17')]?_0x422ebc['options'][_0x8b9c('0x19')]||null:null,'limit':_0x422ebc[_0x8b9c('0x17')]?_0x422ebc[_0x8b9c('0x17')][_0x8b9c('0x1a')]||null:null,'include':_0x422ebc[_0x8b9c('0x17')]?_0x422ebc[_0x8b9c('0x17')][_0x8b9c('0x1b')]?_[_0x8b9c('0x1c')](_0x422ebc[_0x8b9c('0x17')][_0x8b9c('0x1b')],function(_0x32ea5a){return{'model':db[_0x32ea5a[_0x8b9c('0x1d')]],'as':_0x32ea5a['as'],'attributes':_0x32ea5a[_0x8b9c('0x19')],'include':_0x32ea5a['include']?_[_0x8b9c('0x1c')](_0x32ea5a[_0x8b9c('0x1b')],function(_0x50604a){return{'model':db[_0x50604a[_0x8b9c('0x1d')]],'as':_0x50604a['as'],'attributes':_0x50604a[_0x8b9c('0x19')],'include':_0x50604a['include']?_['map'](_0x50604a[_0x8b9c('0x1b')],function(_0x418114){return{'model':db[_0x418114[_0x8b9c('0x1d')]],'as':_0x418114['as'],'attributes':_0x418114[_0x8b9c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8b9c('0xc')](function(_0x49bec3){logger['info']('GetTrunk',_0x422ebc);logger['debug'](_0x8b9c('0x15'),_0x422ebc,JSON[_0x8b9c('0x1e')](_0x49bec3));_0x5a62ea(_0x49bec3);})[_0x8b9c('0x14')](function(_0x452ce0){logger['error']('GetTrunk',_0x452ce0[_0x8b9c('0x13')],_0x422ebc);_0x55bf36(_0x274cad[_0x8b9c('0x11')](0x1f4,_0x452ce0['message']));});});};exports[_0x8b9c('0x1f')]=function(_0x5274e9){var _0x13e01f=this;return new Promise(function(_0x25ab06,_0x570bdc){return db[_0x8b9c('0x16')][_0x8b9c('0x20')]({'raw':_0x5274e9[_0x8b9c('0x17')]?_0x5274e9[_0x8b9c('0x17')][_0x8b9c('0x18')]===undefined?!![]:![]:!![],'where':_0x5274e9['options']?_0x5274e9[_0x8b9c('0x17')][_0x8b9c('0x21')]||null:null,'attributes':_0x5274e9[_0x8b9c('0x17')]?_0x5274e9[_0x8b9c('0x17')][_0x8b9c('0x19')]||null:null,'include':_0x5274e9[_0x8b9c('0x17')]?_0x5274e9[_0x8b9c('0x17')][_0x8b9c('0x1b')]?_[_0x8b9c('0x1c')](_0x5274e9[_0x8b9c('0x17')][_0x8b9c('0x1b')],function(_0x20e6eb){return{'model':db[_0x20e6eb[_0x8b9c('0x1d')]],'as':_0x20e6eb['as'],'attributes':_0x20e6eb[_0x8b9c('0x19')],'include':_0x20e6eb[_0x8b9c('0x1b')]?_[_0x8b9c('0x1c')](_0x20e6eb[_0x8b9c('0x1b')],function(_0x585cb8){return{'model':db[_0x585cb8[_0x8b9c('0x1d')]],'as':_0x585cb8['as'],'attributes':_0x585cb8['attributes'],'include':_0x585cb8[_0x8b9c('0x1b')]?_[_0x8b9c('0x1c')](_0x585cb8[_0x8b9c('0x1b')],function(_0x569d54){return{'model':db[_0x569d54['model']],'as':_0x569d54['as'],'attributes':_0x569d54[_0x8b9c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x398b39){logger[_0x8b9c('0xd')](_0x8b9c('0x1f'),_0x5274e9);logger[_0x8b9c('0x10')](_0x8b9c('0x1f'),_0x5274e9,JSON[_0x8b9c('0x1e')](_0x398b39));_0x25ab06(_0x398b39);})[_0x8b9c('0x14')](function(_0x5b4669){logger['error'](_0x8b9c('0x1f'),_0x5b4669['message'],_0x5274e9);_0x570bdc(_0x13e01f[_0x8b9c('0x11')](0x1f4,_0x5b4669[_0x8b9c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index a2046d7..54eb9cc 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 _0x47d3=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','exports','Router'];(function(_0x3874dd,_0x1d9d9c){var _0x16e8ec=function(_0x13323e){while(--_0x13323e){_0x3874dd['push'](_0x3874dd['shift']());}};_0x16e8ec(++_0x1d9d9c);}(_0x47d3,0x92));var _0x347d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47d3[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express[_0x347d('0x0')]();var auth=require(_0x347d('0x1'));var controller=require(_0x347d('0x2'));router[_0x347d('0x3')](_0x347d('0x4'),auth[_0x347d('0x5')](),controller['update']);module[_0x347d('0x6')]=router; \ No newline at end of file +var _0x9b8b=['exports','express','../../components/auth/service','put','/:id','isAuthenticated','update'];(function(_0x1a03e1,_0x3f5037){var _0x528919=function(_0x179075){while(--_0x179075){_0x1a03e1['push'](_0x1a03e1['shift']());}};_0x528919(++_0x3f5037);}(_0x9b8b,0xc5));var _0xb9b8=function(_0xad8f02,_0x3b94bf){_0xad8f02=_0xad8f02-0x0;var _0x36ab56=_0x9b8b[_0xad8f02];return _0x36ab56;};'use strict';var express=require(_0xb9b8('0x0'));var router=express['Router']();var auth=require(_0xb9b8('0x1'));var controller=require('./user-setting.controller');router[_0xb9b8('0x2')](_0xb9b8('0x3'),auth[_0xb9b8('0x4')](),controller[_0xb9b8('0x5')]);module[_0xb9b8('0x6')]=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 839ac61..030a688 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 _0x96bb=['exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error','warning','info','debug'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x96bb,0x8b));var _0xb96b=function(_0x3fad5a,_0x2d3b02){_0x3fad5a=_0x3fad5a-0x0;var _0x4ca713=_0x96bb[_0x3fad5a];return _0x4ca713;};'use strict';var Sequelize=require(_0xb96b('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xb96b('0x1'),_0xb96b('0x2'),_0xb96b('0x3'),_0xb96b('0x4')];module[_0xb96b('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xb96b('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xb96b('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb96b('0x8')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xb96b('0x9')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb96b('0xa')],'unique':_0xb96b('0xb')}}; \ No newline at end of file +var _0x473d=['INTEGER','UserId','sequelize','error','warning','info','debug','exports','BOOLEAN','DATE'];(function(_0xeef852,_0x5ecff2){var _0x2c0c85=function(_0xe4f39){while(--_0xe4f39){_0xeef852['push'](_0xeef852['shift']());}};_0x2c0c85(++_0x5ecff2);}(_0x473d,0xf2));var _0xd473=function(_0x4ef904,_0x2508d8){_0x4ef904=_0x4ef904-0x0;var _0x2ea461=_0x473d[_0x4ef904];return _0x2ea461;};'use strict';var Sequelize=require(_0xd473('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd473('0x1'),_0xd473('0x2'),_0xd473('0x3'),_0xd473('0x4')];module[_0xd473('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd473('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd473('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd473('0x8')],'unique':_0xd473('0x9')}}; \ 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 fd061ec..369e7fd 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 _0xa37e=['Invalid\x20user\x20setting\x20id','UserSetting','body','catch','../../config/logger','api','../../config/environment','../../mysqldb','redis','register','defaults','status','json','then','stack','name','send','update','role','Unauthorized','params'];(function(_0x1b83f5,_0x14bd0d){var _0x3e783c=function(_0x1dff4f){while(--_0x1dff4f){_0x1b83f5['push'](_0x1b83f5['shift']());}};_0x3e783c(++_0x14bd0d);}(_0xa37e,0x97));var _0xea37=function(_0x3112cb,_0x13721d){_0x3112cb=_0x3112cb-0x0;var _0x5160c6=_0xa37e[_0x3112cb];return _0x5160c6;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0xea37('0x0'))(_0xea37('0x1'));var config=require(_0xea37('0x2'));var db=require(_0xea37('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xea37('0x4')]));require('./user-setting.socket')[_0xea37('0x5')](socket);config[_0xea37('0x4')]=_[_0xea37('0x6')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x36c489,_0x4a9e08){_0x4a9e08=_0x4a9e08||0xc8;return function(_0x4ae081){if(_0x4ae081){return _0x36c489[_0xea37('0x7')](_0x4a9e08)[_0xea37('0x8')](_0x4ae081);}};}function saveUpdates(_0x7a16c6){return function(_0xf5a9e1){if(_0xf5a9e1){return _0xf5a9e1['update'](_0x7a16c6)[_0xea37('0x9')](function(_0x37ca45){return _0x37ca45;});}return null;};}function handleEntityNotFound(_0x8371a){return function(_0x55d4de){if(!_0x55d4de){_0x8371a['sendStatus'](0x194);}return _0x55d4de;};}function handleError(_0x9a39cd,_0x117ce1){_0x117ce1=_0x117ce1||0x1f4;return function(_0x3cd18b){logger['error'](_0x3cd18b[_0xea37('0xa')]);if(_0x3cd18b[_0xea37('0xb')]){delete _0x3cd18b[_0xea37('0xb')];}_0x9a39cd['status'](_0x117ce1)[_0xea37('0xc')](_0x3cd18b);};}exports[_0xea37('0xd')]=function(_0x5924ff,_0x41e9be){if(_0x5924ff['user'][_0xea37('0xe')]!=='admin')throw new Error(_0xea37('0xf'));if(isNaN(Number(_0x5924ff[_0xea37('0x10')]['id'])))throw new Error(_0xea37('0x11'));return db[_0xea37('0x12')]['find']({'where':{'id':_0x5924ff[_0xea37('0x10')]['id']}})['then'](handleEntityNotFound(_0x41e9be,null))['then'](saveUpdates(_0x5924ff[_0xea37('0x13')],null))['then'](respondWithResult(_0x41e9be,null))[_0xea37('0x14')](handleError(_0x41e9be,null));}; \ No newline at end of file +var _0xde50=['sendStatus','error','name','send','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','../../config/logger','api','../../config/environment','../../mysqldb','redis','register','localhost','status','update','then'];(function(_0x4ceb9e,_0x291e82){var _0x259d85=function(_0x374762){while(--_0x374762){_0x4ceb9e['push'](_0x4ceb9e['shift']());}};_0x259d85(++_0x291e82);}(_0xde50,0x140));var _0x0de5=function(_0x2a586f,_0x1c05b2){_0x2a586f=_0x2a586f-0x0;var _0x2dd8c5=_0xde50[_0x2a586f];return _0x2dd8c5;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0x0de5('0x0'))(_0x0de5('0x1'));var config=require(_0x0de5('0x2'));var db=require(_0x0de5('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x0de5('0x4')]));require('./user-setting.socket')[_0x0de5('0x5')](socket);config['redis']=_['defaults'](config['redis'],{'host':_0x0de5('0x6'),'port':0x18eb});function respondWithResult(_0x2714e3,_0x2a5d94){_0x2a5d94=_0x2a5d94||0xc8;return function(_0x57410e){if(_0x57410e){return _0x2714e3[_0x0de5('0x7')](_0x2a5d94)['json'](_0x57410e);}};}function saveUpdates(_0x54c94f){return function(_0x5655f2){if(_0x5655f2){return _0x5655f2[_0x0de5('0x8')](_0x54c94f)[_0x0de5('0x9')](function(_0x833ae0){return _0x833ae0;});}return null;};}function handleEntityNotFound(_0x5a165a){return function(_0x3f12d4){if(!_0x3f12d4){_0x5a165a[_0x0de5('0xa')](0x194);}return _0x3f12d4;};}function handleError(_0x53cf09,_0x132a49){_0x132a49=_0x132a49||0x1f4;return function(_0x21a80e){logger[_0x0de5('0xb')](_0x21a80e['stack']);if(_0x21a80e['name']){delete _0x21a80e[_0x0de5('0xc')];}_0x53cf09[_0x0de5('0x7')](_0x132a49)[_0x0de5('0xd')](_0x21a80e);};}exports[_0x0de5('0x8')]=function(_0x2dddc0,_0x5ba869){if(_0x2dddc0[_0x0de5('0xe')]['role']!=='admin')throw new Error(_0x0de5('0xf'));if(isNaN(Number(_0x2dddc0[_0x0de5('0x10')]['id'])))throw new Error(_0x0de5('0x11'));return db[_0x0de5('0x12')][_0x0de5('0x13')]({'where':{'id':_0x2dddc0[_0x0de5('0x10')]['id']}})['then'](handleEntityNotFound(_0x5ba869,null))[_0x0de5('0x9')](saveUpdates(_0x2dddc0[_0x0de5('0x14')],null))[_0x0de5('0x9')](respondWithResult(_0x5ba869,null))[_0x0de5('0x15')](handleError(_0x5ba869,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 711641e..71e810f 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 _0x580c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners'];(function(_0x2e24d4,_0x3cad21){var _0x4888ee=function(_0x2a5ba6){while(--_0x2a5ba6){_0x2e24d4['push'](_0x2e24d4['shift']());}};_0x4888ee(++_0x3cad21);}(_0x580c,0x151));var _0xc580=function(_0x5b922f,_0xe6759b){_0x5b922f=_0x5b922f-0x0;var _0x5427f2=_0x580c[_0x5b922f];return _0x5427f2;};'use strict';var EventEmitter=require(_0xc580('0x0'));var UserSetting=require(_0xc580('0x1'))['db'][_0xc580('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc580('0x3')](0x0);var events={'afterCreate':_0xc580('0x4'),'afterUpdate':_0xc580('0x5'),'afterDestroy':_0xc580('0x6')};function emitEvent(_0x4f6210){return function(_0x17e689,_0x230e8f,_0x29f8c8){UserSettingEvents[_0xc580('0x7')](_0x4f6210+':'+_0x17e689['id'],_0x17e689);UserSettingEvents[_0xc580('0x7')](_0x4f6210,_0x17e689);_0x29f8c8(null);};}for(var e in events){if(events[_0xc580('0x8')](e)){var event=events[e];UserSetting[_0xc580('0x9')](e,emitEvent(event));}}module[_0xc580('0xa')]=UserSettingEvents; \ No newline at end of file +var _0x1e0c=['hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','save','emit'];(function(_0x340dac,_0x571885){var _0x40bf79=function(_0x42d4f9){while(--_0x42d4f9){_0x340dac['push'](_0x340dac['shift']());}};_0x40bf79(++_0x571885);}(_0x1e0c,0x1c5));var _0xc1e0=function(_0x7ab6d9,_0x1f1d29){_0x7ab6d9=_0x7ab6d9-0x0;var _0x2fbfb2=_0x1e0c[_0x7ab6d9];return _0x2fbfb2;};'use strict';var EventEmitter=require(_0xc1e0('0x0'));var UserSetting=require(_0xc1e0('0x1'))['db'][_0xc1e0('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc1e0('0x3')](0x0);var events={'afterCreate':_0xc1e0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a916f){return function(_0x109a92,_0x340b8a,_0x598c3b){UserSettingEvents[_0xc1e0('0x5')](_0x4a916f+':'+_0x109a92['id'],_0x109a92);UserSettingEvents[_0xc1e0('0x5')](_0x4a916f,_0x109a92);_0x598c3b(null);};}for(var e in events){if(events[_0xc1e0('0x6')](e)){var event=events[e];UserSetting[_0xc1e0('0x7')](e,emitEvent(event));}}module[_0xc1e0('0x8')]=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 6268ce2..b592d3c 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 _0x574d=['./user-setting.attributes','exports','define','UserSetting','user_settings','clientSideLoggingEnabledSince'];(function(_0x574211,_0x14bec4){var _0x5c14cc=function(_0x21c9fc){while(--_0x21c9fc){_0x574211['push'](_0x574211['shift']());}};_0x5c14cc(++_0x14bec4);}(_0x574d,0xc0));var _0xd574=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x574d[_0x46698a];return _0x356db0;};'use strict';var attributes=require(_0xd574('0x0'));module[_0xd574('0x1')]=function(_0x2ef0b0){return _0x2ef0b0[_0xd574('0x2')](_0xd574('0x3'),attributes,{'tableName':_0xd574('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46aec5){if(!_0x46aec5['clientSideLoggingEnabled'])_0x46aec5[_0xd574('0x5')]=null;else if(_0x46aec5[_0xd574('0x5')]===null)_0x46aec5[_0xd574('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x58e5=['exports','define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x58e5,0xd1));var _0x558e=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x58e5[_0x599f41];return _0x2e4d58;};'use strict';var attributes=require(_0x558e('0x0'));module[_0x558e('0x1')]=function(_0x41331c){return _0x41331c[_0x558e('0x2')](_0x558e('0x3'),attributes,{'tableName':_0x558e('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x49a1b7){if(!_0x49a1b7[_0x558e('0x5')])_0x49a1b7['clientSideLoggingEnabledSince']=null;else if(_0x49a1b7['clientSideLoggingEnabledSince']===null)_0x49a1b7[_0x558e('0x6')]=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 22dedf1..57ee693 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 _0xa677=['register','user-setting:','./user-setting.events','save','remove','user-setting:update','emit','user-setting:update:user-','UserId'];(function(_0x3c7952,_0x4e32b5){var _0x209c01=function(_0x433560){while(--_0x433560){_0x3c7952['push'](_0x3c7952['shift']());}};_0x209c01(++_0x4e32b5);}(_0xa677,0x1f1));var _0x7a67=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0xa677[_0x43b06b];return _0x2c555b;};'use strict';var UserSettingEvents=require(_0x7a67('0x0'));var events=[_0x7a67('0x1'),_0x7a67('0x2'),'update'];function createListener(_0x484ef9,_0x4348f1){return function(_0x46534d){_0x4348f1['emit'](_0x484ef9,_0x46534d);if(_0x484ef9===_0x7a67('0x3')){_0x4348f1[_0x7a67('0x4')](_0x7a67('0x5')+_0x46534d[_0x7a67('0x6')],_0x46534d);}};}exports[_0x7a67('0x7')]=function(_0x581061){for(var _0xc7ad9f=0x0,_0x22d3f0=events['length'];_0xc7ad9f<_0x22d3f0;_0xc7ad9f++){var _0x5831a1=events[_0xc7ad9f];var _0x2fafd6=createListener(_0x7a67('0x8')+_0x5831a1,_0x581061);UserSettingEvents['on'](_0x5831a1,_0x2fafd6);}}; \ No newline at end of file +var _0x83d4=['save','remove','update','emit','user-setting:update','UserId','register','length','user-setting:','./user-setting.events'];(function(_0x2f50cc,_0x3b9e38){var _0x1b5e1f=function(_0x1065bf){while(--_0x1065bf){_0x2f50cc['push'](_0x2f50cc['shift']());}};_0x1b5e1f(++_0x3b9e38);}(_0x83d4,0x1cb));var _0x483d=function(_0x56b000,_0x199ba8){_0x56b000=_0x56b000-0x0;var _0x50583c=_0x83d4[_0x56b000];return _0x50583c;};'use strict';var UserSettingEvents=require(_0x483d('0x0'));var events=[_0x483d('0x1'),_0x483d('0x2'),_0x483d('0x3')];function createListener(_0x415890,_0x19bd34){return function(_0xf8d790){_0x19bd34[_0x483d('0x4')](_0x415890,_0xf8d790);if(_0x415890===_0x483d('0x5')){_0x19bd34[_0x483d('0x4')]('user-setting:update:user-'+_0xf8d790[_0x483d('0x6')],_0xf8d790);}};}exports[_0x483d('0x7')]=function(_0x7d3fea){for(var _0x3b5826=0x0,_0x47ccfc=events[_0x483d('0x8')];_0x3b5826<_0x47ccfc;_0x3b5826++){var _0x1373bb=events[_0x3b5826];var _0x41f737=createListener(_0x483d('0x9')+_0x1373bb,_0x7d3fea);UserSettingEvents['on'](_0x1373bb,_0x41f737);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index de89869..ec6799a 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 _0x4bab=['getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','/:id/login','login','/:id/logout','pause','unpause','/:id/teams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','messengerSoundNotification','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','isAuthenticated','/describe','/whoami','whoami','/presence','getPresence','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','/:id/screen_recordings'];(function(_0x20ee7b,_0x17e3a1){var _0x5a4147=function(_0x5e64f5){while(--_0x5e64f5){_0x20ee7b['push'](_0x20ee7b['shift']());}};_0x5a4147(++_0x17e3a1);}(_0x4bab,0xc8));var _0xb4ba=function(_0x2959ee,_0x142cfd){_0x2959ee=_0x2959ee-0x0;var _0xad5776=_0x4bab[_0x2959ee];return _0xad5776;};'use strict';var multer=require('multer');var util=require(_0xb4ba('0x0'));var path=require(_0xb4ba('0x1'));var timeout=require(_0xb4ba('0x2'));var express=require(_0xb4ba('0x3'));var router=express[_0xb4ba('0x4')]();var fs_extra=require(_0xb4ba('0x5'));var auth=require(_0xb4ba('0x6'));var interaction=require(_0xb4ba('0x7'));var config=require('../../config/environment');var controller=require(_0xb4ba('0x8'));router[_0xb4ba('0x9')]('/',auth[_0xb4ba('0xa')](),controller['index']);router[_0xb4ba('0x9')](_0xb4ba('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb4ba('0xc'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0xd')]);router[_0xb4ba('0x9')](_0xb4ba('0xe'),auth['isAuthenticated'](),controller[_0xb4ba('0xf')]);router[_0xb4ba('0x9')](_0xb4ba('0x10'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x11')]);router[_0xb4ba('0x9')]('/:id/avatar',controller[_0xb4ba('0x12')]);router[_0xb4ba('0x9')]('/:id/open_tabs',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x13')]);router[_0xb4ba('0x9')](_0xb4ba('0x14'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x15')]);router[_0xb4ba('0x9')](_0xb4ba('0x16'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x17')]);router['get'](_0xb4ba('0x18'),auth['isAuthenticated'](),controller[_0xb4ba('0x19')]);router[_0xb4ba('0x9')]('/:id/groups',auth['isAuthenticated'](),controller['getGroups']);router[_0xb4ba('0x9')](_0xb4ba('0x1a'),auth[_0xb4ba('0xa')](),controller['getRecordings']);router[_0xb4ba('0x9')](_0xb4ba('0x1b'),auth['isAuthenticated'](),controller[_0xb4ba('0x1c')]);router[_0xb4ba('0x9')](_0xb4ba('0x1d'),auth['isAuthenticated'](),controller[_0xb4ba('0x1e')]);router[_0xb4ba('0x9')](_0xb4ba('0x1f'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x20')]);router[_0xb4ba('0x9')](_0xb4ba('0x21'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x22')]);router[_0xb4ba('0x9')](_0xb4ba('0x23'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x24')]);router['get']('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0xb4ba('0x25')]);router[_0xb4ba('0x9')]('/:id/whatsapp/interactions',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x26')]);router['get']('/:id/teams',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x27')]);router['get'](_0xb4ba('0x28'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x29')]);router[_0xb4ba('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0xb4ba('0x2a')]);router[_0xb4ba('0x9')](_0xb4ba('0x2b'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x2c')]);router[_0xb4ba('0x9')](_0xb4ba('0x2d'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x2e')]);router['get'](_0xb4ba('0x2f'),auth['isAuthenticated'](),controller[_0xb4ba('0x30')]);router['get'](_0xb4ba('0x31'),auth[_0xb4ba('0xa')](),controller['getOpenchannelAccounts']);router[_0xb4ba('0x9')]('/:id/sms_accounts',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x32')]);router['get']('/:id/chat_websites',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x33')]);router[_0xb4ba('0x9')](_0xb4ba('0x34'),auth['isAuthenticated'](),controller[_0xb4ba('0x35')]);router[_0xb4ba('0x9')](_0xb4ba('0x36'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x37')]);router[_0xb4ba('0x9')](_0xb4ba('0x38'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x39')]);router[_0xb4ba('0x3a')](_0xb4ba('0x14'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x3b')]);router[_0xb4ba('0x3a')]('/',auth[_0xb4ba('0xa')](),controller['create']);router[_0xb4ba('0x3a')](_0xb4ba('0x3c'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x3d')]);router[_0xb4ba('0x3a')](_0xb4ba('0x16'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0xb4ba('0x3e')]({'destination':function(_0x5aa4c8,_0x4c297e,_0x333daf){_0x333daf(null,path[_0xb4ba('0x3f')](config[_0xb4ba('0x40')],_0xb4ba('0x41')));},'filename':function(_0x2e29a8,_0xb907d6,_0x87cc49){_0x87cc49(null,util[_0xb4ba('0x42')](_0xb4ba('0x43'),Date[_0xb4ba('0x44')](),_0xb907d6['originalname']));}})});router[_0xb4ba('0x3a')]('/:id/avatar',upload[_0xb4ba('0x45')](_0xb4ba('0x46')),controller[_0xb4ba('0x47')]);router[_0xb4ba('0x3a')](_0xb4ba('0x48'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x49')]);router[_0xb4ba('0x3a')](_0xb4ba('0x4a'),auth[_0xb4ba('0xa')](),controller['logout']);router[_0xb4ba('0x3a')]('/:id/pause',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x4b')]);router[_0xb4ba('0x3a')]('/:id/unpause',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x4c')]);router[_0xb4ba('0x3a')](_0xb4ba('0x4d'),auth[_0xb4ba('0xa')](),controller['addTeams']);router[_0xb4ba('0x3a')](_0xb4ba('0x4e'),auth['isAuthenticated'](),controller[_0xb4ba('0x4f')]);router[_0xb4ba('0x3a')](_0xb4ba('0x50'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x51')]);router[_0xb4ba('0x3a')](_0xb4ba('0x52'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x53')]);router[_0xb4ba('0x3a')]('/:id/sms_interactions',auth[_0xb4ba('0xa')](),controller['addSmsInteractions']);router[_0xb4ba('0x3a')](_0xb4ba('0x54'),auth[_0xb4ba('0xa')](),controller['addOpenchannelInteractions']);router[_0xb4ba('0x3a')]('/:id/whatsapp_interactions',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x55')]);router[_0xb4ba('0x3a')](_0xb4ba('0x2d'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x56')]);router[_0xb4ba('0x3a')](_0xb4ba('0x2f'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x57')]);router[_0xb4ba('0x3a')](_0xb4ba('0x31'),auth['isAuthenticated'](),controller[_0xb4ba('0x58')]);router['post'](_0xb4ba('0x59'),auth['isAuthenticated'](),controller[_0xb4ba('0x5a')]);router[_0xb4ba('0x3a')](_0xb4ba('0x5b'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x5c')]);router['post']('/:id/whatsapp_accounts',auth[_0xb4ba('0xa')](),controller['addWhatsappAccounts']);router[_0xb4ba('0x3a')]('/:id/api_key',auth[_0xb4ba('0xa')](),controller['createApiKey']);router[_0xb4ba('0x5d')]('/:id',auth[_0xb4ba('0xa')](),controller['update']);router[_0xb4ba('0x5d')](_0xb4ba('0x5e'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x5f')]);router[_0xb4ba('0x60')]('/:id/queues',auth['isAuthenticated'](),controller[_0xb4ba('0x61')]);router[_0xb4ba('0x60')](_0xb4ba('0x4d'),auth['isAuthenticated'](),controller[_0xb4ba('0x62')]);router[_0xb4ba('0x60')](_0xb4ba('0x10'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x63')]);router['delete'](_0xb4ba('0x4e'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x64')]);router[_0xb4ba('0x60')](_0xb4ba('0x50'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x65')]);router[_0xb4ba('0x60')](_0xb4ba('0x52'),auth[_0xb4ba('0xa')](),controller['removeFaxInteractions']);router[_0xb4ba('0x60')](_0xb4ba('0x66'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x67')]);router[_0xb4ba('0x60')]('/:id/openchannel_interactions',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x68')]);router[_0xb4ba('0x60')](_0xb4ba('0x69'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6a')]);router[_0xb4ba('0x60')](_0xb4ba('0x2d'),auth['isAuthenticated'](),controller[_0xb4ba('0x6b')]);router[_0xb4ba('0x60')](_0xb4ba('0x2f'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6c')]);router[_0xb4ba('0x60')]('/:id/openchannel_accounts',auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6d')]);router[_0xb4ba('0x60')](_0xb4ba('0x59'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6e')]);router['delete'](_0xb4ba('0x5b'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x6f')]);router[_0xb4ba('0x60')](_0xb4ba('0x34'),auth[_0xb4ba('0xa')](),controller['removeWhatsappAccounts']);router[_0xb4ba('0x60')](_0xb4ba('0x38'),auth[_0xb4ba('0xa')](),controller[_0xb4ba('0x70')]);router[_0xb4ba('0x3a')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller[_0xb4ba('0x71')]);module['exports']=router; \ No newline at end of file +var _0x09d5=['getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','originalname','addAvatar','/:id/login','login','/:id/logout','logout','pause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/mail_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','createApiKey','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeApiKey','messengerSoundNotification','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/whoami','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x09d5,0x192));var _0x509d=function(_0x424462,_0x2f63bb){_0x424462=_0x424462-0x0;var _0x2002bf=_0x09d5[_0x424462];return _0x2002bf;};'use strict';var multer=require(_0x509d('0x0'));var util=require(_0x509d('0x1'));var path=require(_0x509d('0x2'));var timeout=require(_0x509d('0x3'));var express=require('express');var router=express[_0x509d('0x4')]();var fs_extra=require(_0x509d('0x5'));var auth=require(_0x509d('0x6'));var interaction=require(_0x509d('0x7'));var config=require(_0x509d('0x8'));var controller=require('./user.controller');router['get']('/',auth[_0x509d('0x9')](),controller[_0x509d('0xa')]);router[_0x509d('0xb')](_0x509d('0xc'),auth[_0x509d('0x9')](),controller['describe']);router[_0x509d('0xb')](_0x509d('0xd'),auth['isAuthenticated'](),controller['whoami']);router['get']('/presence',auth[_0x509d('0x9')](),controller['getPresence']);router[_0x509d('0xb')](_0x509d('0xe'),auth[_0x509d('0x9')](),controller[_0x509d('0xf')]);router[_0x509d('0xb')](_0x509d('0x10'),controller[_0x509d('0x11')]);router[_0x509d('0xb')](_0x509d('0x12'),auth[_0x509d('0x9')](),controller[_0x509d('0x13')]);router[_0x509d('0xb')](_0x509d('0x14'),auth['isAuthenticated'](),controller[_0x509d('0x15')]);router[_0x509d('0xb')](_0x509d('0x16'),auth['isAuthenticated'](),controller[_0x509d('0x17')]);router[_0x509d('0xb')](_0x509d('0x18'),auth[_0x509d('0x9')](),controller[_0x509d('0x19')]);router['get'](_0x509d('0x1a'),auth[_0x509d('0x9')](),controller[_0x509d('0x1b')]);router[_0x509d('0xb')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x509d('0x1c')]);router[_0x509d('0xb')](_0x509d('0x1d'),auth['isAuthenticated'](),controller[_0x509d('0x1e')]);router['get'](_0x509d('0x1f'),auth[_0x509d('0x9')](),controller[_0x509d('0x20')]);router['get'](_0x509d('0x21'),auth[_0x509d('0x9')](),controller[_0x509d('0x22')]);router[_0x509d('0xb')](_0x509d('0x23'),auth[_0x509d('0x9')](),controller[_0x509d('0x24')]);router[_0x509d('0xb')](_0x509d('0x25'),auth[_0x509d('0x9')](),controller[_0x509d('0x26')]);router[_0x509d('0xb')]('/:id/fax/interactions',auth[_0x509d('0x9')](),controller['getFaxInteractions']);router[_0x509d('0xb')](_0x509d('0x27'),auth[_0x509d('0x9')](),controller[_0x509d('0x28')]);router['get'](_0x509d('0x29'),auth[_0x509d('0x9')](),controller[_0x509d('0x2a')]);router['get'](_0x509d('0x2b'),auth[_0x509d('0x9')](),controller[_0x509d('0x2c')]);router[_0x509d('0xb')](_0x509d('0x2d'),auth[_0x509d('0x9')](),controller[_0x509d('0x2e')]);router[_0x509d('0xb')](_0x509d('0x2f'),auth[_0x509d('0x9')](),controller['getVoicePrefixes']);router[_0x509d('0xb')](_0x509d('0x30'),auth[_0x509d('0x9')](),controller[_0x509d('0x31')]);router[_0x509d('0xb')]('/:id/mail_accounts',auth[_0x509d('0x9')](),controller[_0x509d('0x32')]);router[_0x509d('0xb')](_0x509d('0x33'),auth[_0x509d('0x9')](),controller[_0x509d('0x34')]);router[_0x509d('0xb')](_0x509d('0x35'),auth[_0x509d('0x9')](),controller['getSmsAccounts']);router[_0x509d('0xb')]('/:id/chat_websites',auth[_0x509d('0x9')](),controller[_0x509d('0x36')]);router[_0x509d('0xb')](_0x509d('0x37'),auth[_0x509d('0x9')](),controller[_0x509d('0x38')]);router['get'](_0x509d('0x39'),auth[_0x509d('0x9')](),controller[_0x509d('0x3a')]);router[_0x509d('0xb')](_0x509d('0x3b'),auth[_0x509d('0x9')](),controller[_0x509d('0x3c')]);router[_0x509d('0x3d')](_0x509d('0x14'),auth[_0x509d('0x9')](),controller['addContacts']);router['post']('/',auth[_0x509d('0x9')](),controller[_0x509d('0x3e')]);router[_0x509d('0x3d')](_0x509d('0x3f'),auth['isAuthenticated'](),controller[_0x509d('0x40')]);router[_0x509d('0x3d')](_0x509d('0x16'),auth['isAuthenticated'](),controller[_0x509d('0x41')]);var upload=multer({'storage':multer[_0x509d('0x42')]({'destination':function(_0x1f4e18,_0x3c02d4,_0x378fa1){_0x378fa1(null,path['join'](config[_0x509d('0x43')],_0x509d('0x44')));},'filename':function(_0x4fabf1,_0x1b2c6e,_0x2287c6){_0x2287c6(null,util[_0x509d('0x45')](_0x509d('0x46'),Date['now'](),_0x1b2c6e[_0x509d('0x47')]));}})});router[_0x509d('0x3d')](_0x509d('0x10'),upload['single']('file'),controller[_0x509d('0x48')]);router[_0x509d('0x3d')](_0x509d('0x49'),auth[_0x509d('0x9')](),controller[_0x509d('0x4a')]);router[_0x509d('0x3d')](_0x509d('0x4b'),auth[_0x509d('0x9')](),controller[_0x509d('0x4c')]);router[_0x509d('0x3d')]('/:id/pause',auth[_0x509d('0x9')](),controller[_0x509d('0x4d')]);router[_0x509d('0x3d')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x509d('0x4e')]);router[_0x509d('0x3d')](_0x509d('0x29'),auth[_0x509d('0x9')](),controller['addTeams']);router[_0x509d('0x3d')](_0x509d('0x4f'),auth['isAuthenticated'](),controller[_0x509d('0x50')]);router['post'](_0x509d('0x51'),auth[_0x509d('0x9')](),controller[_0x509d('0x52')]);router['post'](_0x509d('0x53'),auth[_0x509d('0x9')](),controller['addFaxInteractions']);router[_0x509d('0x3d')](_0x509d('0x54'),auth[_0x509d('0x9')](),controller[_0x509d('0x55')]);router['post'](_0x509d('0x56'),auth[_0x509d('0x9')](),controller[_0x509d('0x57')]);router[_0x509d('0x3d')](_0x509d('0x58'),auth[_0x509d('0x9')](),controller['addWhatsappInteractions']);router[_0x509d('0x3d')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x509d('0x59'),auth[_0x509d('0x9')](),controller['addMailAccounts']);router[_0x509d('0x3d')](_0x509d('0x33'),auth[_0x509d('0x9')](),controller['addOpenchannelAccounts']);router[_0x509d('0x3d')](_0x509d('0x35'),auth[_0x509d('0x9')](),controller[_0x509d('0x5a')]);router[_0x509d('0x3d')](_0x509d('0x5b'),auth['isAuthenticated'](),controller[_0x509d('0x5c')]);router[_0x509d('0x3d')](_0x509d('0x37'),auth[_0x509d('0x9')](),controller[_0x509d('0x5d')]);router[_0x509d('0x3d')]('/:id/api_key',auth[_0x509d('0x9')](),controller[_0x509d('0x5e')]);router['put']('/:id',auth[_0x509d('0x9')](),controller['update']);router['put'](_0x509d('0x5f'),auth[_0x509d('0x9')](),controller['changePassword']);router[_0x509d('0x60')](_0x509d('0x16'),auth[_0x509d('0x9')](),controller[_0x509d('0x61')]);router[_0x509d('0x60')](_0x509d('0x29'),auth[_0x509d('0x9')](),controller[_0x509d('0x62')]);router[_0x509d('0x60')](_0x509d('0xe'),auth['isAuthenticated'](),controller[_0x509d('0x63')]);router[_0x509d('0x60')]('/:id/chat_interactions',auth[_0x509d('0x9')](),controller[_0x509d('0x64')]);router[_0x509d('0x60')](_0x509d('0x51'),auth[_0x509d('0x9')](),controller[_0x509d('0x65')]);router[_0x509d('0x60')]('/:id/fax_interactions',auth[_0x509d('0x9')](),controller[_0x509d('0x66')]);router[_0x509d('0x60')](_0x509d('0x54'),auth[_0x509d('0x9')](),controller['removeSmsInteractions']);router[_0x509d('0x60')]('/:id/openchannel_interactions',auth[_0x509d('0x9')](),controller[_0x509d('0x67')]);router[_0x509d('0x60')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router['delete'](_0x509d('0x30'),auth[_0x509d('0x9')](),controller[_0x509d('0x68')]);router[_0x509d('0x60')](_0x509d('0x59'),auth[_0x509d('0x9')](),controller[_0x509d('0x69')]);router[_0x509d('0x60')](_0x509d('0x33'),auth[_0x509d('0x9')](),controller['removeOpenchannelAccounts']);router[_0x509d('0x60')]('/:id/sms_accounts',auth[_0x509d('0x9')](),controller[_0x509d('0x6a')]);router[_0x509d('0x60')](_0x509d('0x5b'),auth[_0x509d('0x9')](),controller[_0x509d('0x6b')]);router[_0x509d('0x60')]('/:id/whatsapp_accounts',auth[_0x509d('0x9')](),controller['removeWhatsappAccounts']);router[_0x509d('0x60')](_0x509d('0x3b'),auth[_0x509d('0x9')](),controller[_0x509d('0x6c')]);router[_0x509d('0x3d')]('/:id/messengerSoundNotification',auth[_0x509d('0x9')](),controller[_0x509d('0x6d')]);module[_0x509d('0x6e')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 444fe45..0c2dddf 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 _0x8d57=['wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','lodash','STRING','setDataValue','name','The\x20name\x20of\x20the\x20user','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','admin','user','telephone','local','INTEGER','callerid','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','friend','peer','from-sip','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','split','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','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\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','uac','uas','fingerprint','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','udp'];(function(_0x2ff2f5,_0x4c4565){var _0x1b7012=function(_0x5c86e1){while(--_0x5c86e1){_0x2ff2f5['push'](_0x2ff2f5['shift']());}};_0x1b7012(++_0x4c4565);}(_0x8d57,0xcc));var _0x78d5=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x8d57[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require(_0x78d5('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x78d5('0x1'));module['exports']={'name':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4d122d){this[_0x78d5('0x3')](_0x78d5('0x4'),_0x4d122d);this[_0x78d5('0x3')]('defaultuser',_0x4d122d);},'comment':_0x78d5('0x5')},'fullname':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'set':function(_0x191b04){this[_0x78d5('0x3')]('fullname',_0x191b04);this['setDataValue']('callerid',util[_0x78d5('0x6')](_0x78d5('0x7'),_0x191b04,this['getDataValue'](_0x78d5('0x8'))));}},'alias':{'type':Sequelize[_0x78d5('0x2')]},'email':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'unique':_0x78d5('0x9'),'validate':{'isEmail':!![]},'set':function(_0x5493ec){if(_0x5493ec){this[_0x78d5('0x3')](_0x78d5('0x9'),_0x5493ec[_0x78d5('0xa')]());}}},'role':{'type':Sequelize['ENUM'](_0x78d5('0xb'),_0x78d5('0xc'),'agent',_0x78d5('0xd')),'allowNull':![]},'password':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':_0x78d5('0xe')},'internal':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':![],'unique':_0x78d5('0x8'),'set':function(_0x3666bd){this[_0x78d5('0x3')](_0x78d5('0x8'),_0x3666bd);this['setDataValue']('accountcode',_0x3666bd);this['setDataValue'](_0x78d5('0x10'),util['format'](_0x78d5('0x7'),this[_0x78d5('0x11')]('fullname'),_0x3666bd));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x78d5('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x78d5('0x2')]},'city':{'type':Sequelize[_0x78d5('0x2')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':_0x78d5('0x13')},'lastPauseAt':{'type':Sequelize[_0x78d5('0x14')]},'chatCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x78d5('0xf')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x78d5('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x78d5('0x15'),_0x78d5('0xc'),_0x78d5('0x16')),'allowNull':!![],'defaultValue':_0x78d5('0x15')},'context':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':_0x78d5('0x17')},'callingpres':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x19'),_0x78d5('0x1a'),_0x78d5('0x1b'),_0x78d5('0x1c'),_0x78d5('0x1d'),_0x78d5('0x1e'),_0x78d5('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'secret':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':'udp','set':function(_0x2f6652){this['setDataValue'](_0x78d5('0x20'),_0x2f6652?_0x2f6652['join'](','):null);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x20'))?this[_0x78d5('0x11')](_0x78d5('0x20'))[_0x78d5('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x78d5('0x22'),_0x78d5('0x23'),_0x78d5('0x24'),_0x78d5('0x25')),'allowNull':!![],'defaultValue':_0x78d5('0x26')},'directmedia':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no',_0x78d5('0x28'),_0x78d5('0x29'),_0x78d5('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':_0x78d5('0x2b'),'set':function(_0xdbb96f){this[_0x78d5('0x3')](_0x78d5('0x2c'),_0xdbb96f?_0xdbb96f[_0x78d5('0x2d')](','):null);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x2c'))?this['getDataValue'](_0x78d5('0x2c'))[_0x78d5('0x21')](','):null;},'comment':_0x78d5('0x2e')},'callgroup':{'type':Sequelize[_0x78d5('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x78d5('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x78d5('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x78d5('0x2')]},'disallow':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'defaultValue':_0x78d5('0x2f')},'allow':{'type':Sequelize[_0x78d5('0x2')],'allowNull':![],'defaultValue':_0x78d5('0x30'),'set':function(_0x368f28){this[_0x78d5('0x3')](_0x78d5('0x31'),_0x368f28?_0x368f28['join'](';'):_0x78d5('0x30'));},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x31'))?this[_0x78d5('0x11')]('allow')[_0x78d5('0x21')](';'):null;},'comment':_0x78d5('0x32')},'autoframing':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'set':function(_0x21abd8){this[_0x78d5('0x3')]('insecure',_0x21abd8?_0x21abd8[_0x78d5('0x2d')](','):null);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x33'))?this[_0x78d5('0x11')]('insecure')[_0x78d5('0x21')](','):null;},'comment':_0x78d5('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x78d5('0x18')]('yes','no',_0x78d5('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![],'defaultValue':_0x78d5('0x36')},'amaflags':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x78d5('0x18')]('yes','no',_0x78d5('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x78d5('0x18')]('accept',_0x78d5('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x78d5('0x3a')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':_0x78d5('0x27')},'keepalive':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x78d5('0x18')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x78d5('0x18')]('yes','no',_0x78d5('0x3b'),_0x78d5('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x78d5('0x18')]('active',_0x78d5('0x3d'),_0x78d5('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x78d5('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x78d5('0x18')](_0x78d5('0x27'),'no',_0x78d5('0x28'),_0x78d5('0x29'),_0x78d5('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x78d5('0x14')]},'passwordResetAt':{'type':Sequelize[_0x78d5('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x78d5('0x40')]},'showWebBar':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0,'set':function(_0xbcbe98){this[_0x78d5('0x3')](_0x78d5('0x41'),_0xbcbe98);var _0x89ad4=this[_0x78d5('0x42')]({'plain':!![]});switch(_0xbcbe98){case 0x0:case 0x1:var _0x26a21f=_0x89ad4[_0x78d5('0x20')]?_[_0x78d5('0x43')](_0x89ad4[_0x78d5('0x20')])?_0x89ad4[_0x78d5('0x20')][_0x78d5('0x2d')]():_0x89ad4[_0x78d5('0x20')]:_0x78d5('0x44');if(_0x26a21f===_0x78d5('0x45')){_0x26a21f=_0x78d5('0x44');}this[_0x78d5('0x3')](_0x78d5('0x20'),_0x26a21f);this[_0x78d5('0x3')](_0x78d5('0x46'),'no');this['setDataValue'](_0x78d5('0x47'),null);this[_0x78d5('0x3')](_0x78d5('0x48'),null);this[_0x78d5('0x3')](_0x78d5('0x49'),null);this[_0x78d5('0x3')](_0x78d5('0x4a'),null);this['setDataValue'](_0x78d5('0x4b'),null);this[_0x78d5('0x3')](_0x78d5('0x4c'),null);this['setDataValue']('dtlscertfile',null);this['setDataValue'](_0x78d5('0x4d'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0x78d5('0x3')](_0x78d5('0x20'),_0x78d5('0x45'));this[_0x78d5('0x3')]('encryption','yes');this['setDataValue'](_0x78d5('0x47'),_0x78d5('0x27'));this['setDataValue'](_0x78d5('0x48'),_0x78d5('0x27'));this[_0x78d5('0x3')](_0x78d5('0x49'),_0x78d5('0x27'));this[_0x78d5('0x3')](_0x78d5('0x4a'),_0x78d5('0x27'));this[_0x78d5('0x3')](_0x78d5('0x4b'),'no');this[_0x78d5('0x3')](_0x78d5('0x4c'),_0x78d5('0x3e'));this[_0x78d5('0x3')]('dtlscertfile',_0x89ad4[_0x78d5('0x4e')]||_0x78d5('0x4f'));this[_0x78d5('0x3')](_0x78d5('0x4d'),_0x89ad4[_0x78d5('0x4d')]||_0x78d5('0x50'));this[_0x78d5('0x3')]('rtcp_mux',_0x78d5('0x27'));break;default:}}},'permissions':{'type':Sequelize[_0x78d5('0x40')],'set':function(_0xb5b320){this[_0x78d5('0x3')](_0x78d5('0x51'),_0xb5b320?_0xb5b320[_0x78d5('0x2d')](','):[]);},'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x51'))?_['map'](this[_0x78d5('0x11')](_0x78d5('0x51'))[_0x78d5('0x21')](','),function(_0x3be3dc){return parseInt(_0x3be3dc,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x78d5('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x78d5('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x78d5('0x2')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x78d5('0x52')],'get':function(){return this[_0x78d5('0x11')](_0x78d5('0x53'))?this[_0x78d5('0x11')](_0x78d5('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x78d5('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x78d5('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x421d83){if(typeof _0x421d83==='string'){var _0x26aaa7=_0x421d83==='1'?!![]:_0x421d83==='0'?![]:_0x421d83===_0x78d5('0x54')?!![]:_0x421d83===_0x78d5('0x55')?![]:![];this[_0x78d5('0x3')](_0x78d5('0x56'),_0x26aaa7);}else{this[_0x78d5('0x3')](_0x78d5('0x56'),_0x421d83);}}},'blocked':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![],'set':function(_0x33c0ba){this['setDataValue'](_0x78d5('0x57'),_0x33c0ba);if(_0x33c0ba===!![]){this[_0x78d5('0x3')](_0x78d5('0x58'),moment());this['setDataValue'](_0x78d5('0x59'),0x0);}else{this[_0x78d5('0x3')](_0x78d5('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x78d5('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x78d5('0xf')](0x5)[_0x78d5('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x78d5('0x12')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x78d5('0xf')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc8ef=['/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','internal','email','toLowerCase','ENUM','user','agent','telephone','local','accountcode','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','peer','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','DATE','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','/etc/pki/tls/certs/motion.crt'];(function(_0x4f2152,_0x1bf26a){var _0x9a69a5=function(_0x2c57ba){while(--_0x2c57ba){_0x4f2152['push'](_0x4f2152['shift']());}};_0x9a69a5(++_0x1bf26a);}(_0xc8ef,0x128));var _0xfc8e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xc8ef[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfc8e('0x0'));var util=require(_0xfc8e('0x1'));var _=require(_0xfc8e('0x2'));module[_0xfc8e('0x3')]={'name':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x487f69){this[_0xfc8e('0x5')](_0xfc8e('0x6'),_0x487f69);this[_0xfc8e('0x5')](_0xfc8e('0x7'),_0x487f69);},'comment':_0xfc8e('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x1a3a2b){this[_0xfc8e('0x5')](_0xfc8e('0x9'),_0x1a3a2b);this[_0xfc8e('0x5')](_0xfc8e('0xa'),util[_0xfc8e('0xb')]('\x22%s\x22\x20<%s>',_0x1a3a2b,this['getDataValue'](_0xfc8e('0xc'))));}},'alias':{'type':Sequelize[_0xfc8e('0x4')]},'email':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3f155c){if(_0x3f155c){this[_0xfc8e('0x5')](_0xfc8e('0xd'),_0x3f155c[_0xfc8e('0xe')]());}}},'role':{'type':Sequelize[_0xfc8e('0xf')]('admin',_0xfc8e('0x10'),_0xfc8e('0x11'),_0xfc8e('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xfc8e('0x4')],'defaultValue':_0xfc8e('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xfc8e('0xc'),'set':function(_0x452e7d){this[_0xfc8e('0x5')](_0xfc8e('0xc'),_0x452e7d);this[_0xfc8e('0x5')](_0xfc8e('0x14'),_0x452e7d);this['setDataValue'](_0xfc8e('0xa'),util[_0xfc8e('0xb')]('\x22%s\x22\x20<%s>',this[_0xfc8e('0x15')](_0xfc8e('0x9')),_0x452e7d));}},'salt':{'type':Sequelize[_0xfc8e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xfc8e('0x4')]},'address':{'type':Sequelize[_0xfc8e('0x4')]},'zipcode':{'type':Sequelize[_0xfc8e('0x4')]},'userpic':{'type':Sequelize[_0xfc8e('0x4')]},'city':{'type':Sequelize[_0xfc8e('0x4')]},'country':{'type':Sequelize[_0xfc8e('0x4')]},'online':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfc8e('0x4')],'defaultValue':_0xfc8e('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfc8e('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfc8e('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![],'defaultValue':_0xfc8e('0x19')},'ipaddr':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xfc8e('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user',_0xfc8e('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xfc8e('0xf')]('ALLOWED_NOT_SCREENED',_0xfc8e('0x1b'),_0xfc8e('0x1c'),_0xfc8e('0x1d'),_0xfc8e('0x1e'),_0xfc8e('0x1f'),_0xfc8e('0x20'),_0xfc8e('0x21')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![],'defaultValue':_0xfc8e('0x22'),'set':function(_0x4078d9){this['setDataValue'](_0xfc8e('0x23'),_0x4078d9?_0x4078d9[_0xfc8e('0x24')](','):null);},'get':function(){return this[_0xfc8e('0x15')](_0xfc8e('0x23'))?this[_0xfc8e('0x15')]('transport')[_0xfc8e('0x25')](','):null;},'comment':_0xfc8e('0x26')},'dtmfmode':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x27'),_0xfc8e('0x28'),'shortinfo',_0xfc8e('0x29'),_0xfc8e('0x2a')),'allowNull':!![],'defaultValue':_0xfc8e('0x27')},'directmedia':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no',_0xfc8e('0x2c'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![],'defaultValue':_0xfc8e('0x2d'),'set':function(_0x1a1979){this[_0xfc8e('0x5')]('nat',_0x1a1979?_0x1a1979[_0xfc8e('0x24')](','):null);},'get':function(){return this[_0xfc8e('0x15')](_0xfc8e('0x2e'))?this[_0xfc8e('0x15')](_0xfc8e('0x2e'))[_0xfc8e('0x25')](','):null;},'comment':_0xfc8e('0x2f')},'callgroup':{'type':Sequelize[_0xfc8e('0x4')]},'namedcallgroup':{'type':Sequelize[_0xfc8e('0x4')]},'pickupgroup':{'type':Sequelize[_0xfc8e('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xfc8e('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfc8e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfc8e('0x30')},'allow':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':![],'defaultValue':_0xfc8e('0x31'),'set':function(_0x18f18d){this[_0xfc8e('0x5')](_0xfc8e('0x32'),_0x18f18d?_0x18f18d['join'](';'):_0xfc8e('0x31'));},'get':function(){return this['getDataValue']('allow')?this[_0xfc8e('0x15')](_0xfc8e('0x32'))[_0xfc8e('0x25')](';'):null;},'comment':_0xfc8e('0x33')},'autoframing':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![],'set':function(_0x1bef2e){this['setDataValue'](_0xfc8e('0x34'),_0x1bef2e?_0x1bef2e[_0xfc8e('0x24')](','):null);},'get':function(){return this[_0xfc8e('0x15')](_0xfc8e('0x34'))?this[_0xfc8e('0x15')](_0xfc8e('0x34'))[_0xfc8e('0x25')](','):null;},'comment':_0xfc8e('0x35')},'trustrpid':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no',_0xfc8e('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![],'defaultValue':_0xfc8e('0x37')},'amaflags':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xfc8e('0x2b')},'busylevel':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfc8e('0xf')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xfc8e('0x2b'),'no',_0xfc8e('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x39'),_0xfc8e('0x3a'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfc8e('0xf')]('uac',_0xfc8e('0x3b')),'allowNull':!![],'defaultValue':_0xfc8e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':_0xfc8e('0x2b')},'keepalive':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xfc8e('0xf')]('yes','no',_0xfc8e('0x3c'),_0xfc8e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x3e'),_0xfc8e('0x3f'),_0xfc8e('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfc8e('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfc8e('0xf')]('yes','no',_0xfc8e('0x2c'),_0xfc8e('0x41'),_0xfc8e('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xfc8e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xfc8e('0x43')]},'passwordResetAt':{'type':Sequelize[_0xfc8e('0x43')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xfc8e('0x44')]},'showWebBar':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0,'set':function(_0x8e7421){this[_0xfc8e('0x5')](_0xfc8e('0x45'),_0x8e7421);var _0x4d8a9d=this[_0xfc8e('0x46')]({'plain':!![]});switch(_0x8e7421){case 0x0:case 0x1:var _0xb9ea0a=_0x4d8a9d[_0xfc8e('0x23')]?_[_0xfc8e('0x47')](_0x4d8a9d['transport'])?_0x4d8a9d[_0xfc8e('0x23')][_0xfc8e('0x24')]():_0x4d8a9d[_0xfc8e('0x23')]:_0xfc8e('0x22');if(_0xb9ea0a===_0xfc8e('0x48')){_0xb9ea0a=_0xfc8e('0x22');}this[_0xfc8e('0x5')](_0xfc8e('0x23'),_0xb9ea0a);this['setDataValue'](_0xfc8e('0x49'),'no');this[_0xfc8e('0x5')](_0xfc8e('0x4a'),null);this[_0xfc8e('0x5')](_0xfc8e('0x4b'),null);this[_0xfc8e('0x5')]('icesupport',null);this['setDataValue'](_0xfc8e('0x4c'),null);this[_0xfc8e('0x5')](_0xfc8e('0x4d'),null);this[_0xfc8e('0x5')](_0xfc8e('0x4e'),null);this[_0xfc8e('0x5')](_0xfc8e('0x4f'),null);this[_0xfc8e('0x5')](_0xfc8e('0x50'),null);this['setDataValue'](_0xfc8e('0x51'),'no');break;case 0x2:this[_0xfc8e('0x5')]('transport',_0xfc8e('0x48'));this['setDataValue'](_0xfc8e('0x49'),_0xfc8e('0x2b'));this[_0xfc8e('0x5')]('avpf',_0xfc8e('0x2b'));this[_0xfc8e('0x5')](_0xfc8e('0x4b'),_0xfc8e('0x2b'));this[_0xfc8e('0x5')](_0xfc8e('0x52'),_0xfc8e('0x2b'));this[_0xfc8e('0x5')](_0xfc8e('0x4c'),_0xfc8e('0x2b'));this[_0xfc8e('0x5')](_0xfc8e('0x4d'),'no');this[_0xfc8e('0x5')](_0xfc8e('0x4e'),_0xfc8e('0x40'));this[_0xfc8e('0x5')](_0xfc8e('0x4f'),_0x4d8a9d[_0xfc8e('0x4f')]||_0xfc8e('0x53'));this['setDataValue'](_0xfc8e('0x50'),_0x4d8a9d[_0xfc8e('0x50')]||_0xfc8e('0x54'));this[_0xfc8e('0x5')](_0xfc8e('0x51'),_0xfc8e('0x2b'));break;default:}}},'permissions':{'type':Sequelize[_0xfc8e('0x44')],'set':function(_0x554107){this[_0xfc8e('0x5')](_0xfc8e('0x55'),_0x554107?_0x554107[_0xfc8e('0x24')](','):[]);},'get':function(){return this[_0xfc8e('0x15')]('permissions')?_['map'](this[_0xfc8e('0x15')](_0xfc8e('0x55'))[_0xfc8e('0x25')](','),function(_0xdac1fa){return parseInt(_0xdac1fa,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfc8e('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfc8e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xfc8e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xfc8e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xfc8e('0xf')](_0xfc8e('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfc8e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xfc8e('0x56')],'get':function(){return this[_0xfc8e('0x15')](_0xfc8e('0x57'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xfc8e('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfc8e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![],'set':function(_0x5c276f){if(typeof _0x5c276f===_0xfc8e('0x58')){var _0x118589=_0x5c276f==='1'?!![]:_0x5c276f==='0'?![]:_0x5c276f===_0xfc8e('0x59')?!![]:_0x5c276f===_0xfc8e('0x5a')?![]:![];this[_0xfc8e('0x5')](_0xfc8e('0x5b'),_0x118589);}else{this[_0xfc8e('0x5')]('screenrecording',_0x5c276f);}}},'blocked':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![],'set':function(_0x21d2ce){this[_0xfc8e('0x5')]('blocked',_0x21d2ce);if(_0x21d2ce===!![]){this[_0xfc8e('0x5')](_0xfc8e('0x5c'),moment());this['setDataValue'](_0xfc8e('0x5d'),0x0);}else{this['setDataValue'](_0xfc8e('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0xfc8e('0x43')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xfc8e('0x18')](0x5)[_0xfc8e('0x5e')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xfc8e('0x18')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xfc8e('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index bb59112..90eaf50 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 _0xc80f=['user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','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','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','CmContact','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','json','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','removeApiKey','API\x20key\x20not\x20available','whoami','getUserSetting','idle','unknown','ringing','teams','queues','toString','lower','asc','desc','substring','orderBy','offline','voiceStatus','unavailable','busy','slice','toUpperCase','select','InteractionId','field','user_has_','messengerSoundNotification','enabled','moment','util','path','lodash','squel','ioredis','jayson/promise','../../components/contacts','../../components/parsers/qs','../../config/utils','../../config/environment','../../errors/api','APIBadRequestError','APIForbiddenrror','handleError','../../mysqldb','redis','register','defaults','localhost','client','http','sendStatus','status','end','undefined','limit','count','offset','set','request','info','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','User,\x20%s,\x20%s','message','result','then','role','agent','emit','userNotification:recalc:','destroy','admin','Agents','Telephones','telephone','filter','map','value','find','name','UserProfileResource','stack','key','password','salt','previousPasswords','resetPasswordExpires','md5secret','includes','index','getOptions','query','includeAll','userSetting','true','include','UserSetting','attributes','User','openTabs','rows','length','push','chat','dataValues','fax','mail','openchannel','whatsapp','all','catch','show','params','options','sms','update','body','describe','addContacts','omit','Setting','findById','securePassword','validatePasswordPattern','min_internal','internal','sequelize','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)','QueryTypes','SELECT','isNil','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','107','108','100','111','114','115','create','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','Queues','ids','penalty','spread','toLowerCase','QueueId','Queue:save','voice','findAll','get','online','format','UserVoiceQueueRt','removeQueues','remove','isArray','Queue:remove','addAvatar','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','hasOwnProperty','CmList','List','Tags','color','tag','getQueues','keys','Queue','filters','intersection','model','fields','order','sort','where','pick','merge','getVoiceQueuesRt','rawAttributes','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','nolimit','UserId','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','remoteAddress','connection','socket','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','concat','LOGININPAUSE','isMiddleware','resolve','logout','QueuePause','pause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','addAgent','getDataValue','Voice','TeamVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','UserVoicePrefix','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','CmHopper','addChatInteractions'];(function(_0x22bf38,_0x496e63){var _0x24a586=function(_0x54ee09){while(--_0x54ee09){_0x22bf38['push'](_0x22bf38['shift']());}};_0x24a586(++_0x496e63);}(_0xc80f,0x69));var _0xfc80=function(_0x46837a,_0xa95a12){_0x46837a=_0x46837a-0x0;var _0xb3bea8=_0xc80f[_0x46837a];return _0xb3bea8;};'use strict';var moment=require(_0xfc80('0x0'));var util=require(_0xfc80('0x1'));var path=require(_0xfc80('0x2'));var fs=require('fs');var _=require(_0xfc80('0x3'));var squel=require(_0xfc80('0x4'));var Redis=require(_0xfc80('0x5'));var jayson=require(_0xfc80('0x6'));var authService=require('../../components/auth/service');var contacts=require(_0xfc80('0x7'));var qs=require(_0xfc80('0x8'));var rta=require('../../components/realtime/agents');var logger=require('../../config/logger')('api');var utils=require(_0xfc80('0x9'));var config=require(_0xfc80('0xa'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0xfc80('0xb'))[_0xfc80('0xc')];var APINotFoundError=require(_0xfc80('0xb'))['APINotFoundError'];var APIForbiddenError=require('../../errors/api')[_0xfc80('0xd')];var APIHandleError=require('../../errors/api')[_0xfc80('0xe')];var db=require(_0xfc80('0xf'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xfc80('0x10')]));require('./user.socket')[_0xfc80('0x11')](socket);config[_0xfc80('0x10')]=_[_0xfc80('0x12')](config[_0xfc80('0x10')],{'host':_0xfc80('0x13'),'port':0x18eb});var amiClient=jayson[_0xfc80('0x14')][_0xfc80('0x15')]({'port':0x232a});var values;function respondWithStatusCode(_0x4e5bf7,_0x89a6aa){_0x89a6aa=_0x89a6aa||0xcc;return function(_0x834eff){if(_0x834eff){return _0x4e5bf7[_0xfc80('0x16')](_0x89a6aa);}return _0x4e5bf7[_0xfc80('0x17')](_0x89a6aa)[_0xfc80('0x18')]();};}function respondWithResult(_0x180995,_0x23c4ff){_0x23c4ff=_0x23c4ff||0xc8;return function(_0x38aa07){if(_0x38aa07){return _0x180995['status'](_0x23c4ff)['json'](_0x38aa07);}};}function respondWithFilteredResult(_0x2a83ff,_0x27282d){return function(_0x44a4ec){if(_0x44a4ec){var _0x215b2a=typeof _0x27282d['offset']===_0xfc80('0x19')&&typeof _0x27282d[_0xfc80('0x1a')]===_0xfc80('0x19');var _0x4ec5f8=_0x44a4ec[_0xfc80('0x1b')];var _0x5b00fc=_0x215b2a?0x0:_0x27282d[_0xfc80('0x1c')];var _0x243774=_0x215b2a?_0x44a4ec['count']:_0x27282d[_0xfc80('0x1c')]+_0x27282d[_0xfc80('0x1a')];var _0x438c79;if(_0x243774>=_0x4ec5f8){_0x243774=_0x4ec5f8;_0x438c79=0xc8;}else{_0x438c79=0xce;}_0x2a83ff[_0xfc80('0x17')](_0x438c79);return _0x2a83ff[_0xfc80('0x1d')]('Content-Range',_0x5b00fc+'-'+_0x243774+'/'+_0x4ec5f8)['json'](_0x44a4ec);}return null;};}function respondWithRpcPromise(_0xab33b1,_0x16dc59,_0x5b687e,_0x2572b2){return new Promise(function(_0x4c4d54,_0x1731d3){var _0x317ba5=_0x2572b2||amiClient;return _0x317ba5[_0xfc80('0x1e')](_0xab33b1,_0x5b687e)['then'](function(_0x59e9d4){logger[_0xfc80('0x1f')]('User,\x20%s,\x20%s',_0x16dc59,'request\x20sent');logger[_0xfc80('0x20')](_0xfc80('0x21'),_0x16dc59,_0xfc80('0x22'),JSON[_0xfc80('0x23')](_0x59e9d4));if(_0x59e9d4['error']){if(_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x25')]===0x1f4){logger['error'](_0xfc80('0x26'),_0x16dc59,_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x27')]);return _0x1731d3(_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x27')]);}logger[_0xfc80('0x24')](_0xfc80('0x26'),_0x16dc59,_0x59e9d4[_0xfc80('0x24')][_0xfc80('0x27')]);return _0x4c4d54(_0x59e9d4[_0xfc80('0x24')]['message']);}else{logger[_0xfc80('0x1f')](_0xfc80('0x26'),_0x16dc59,_0xfc80('0x22'));_0x4c4d54(_0x59e9d4[_0xfc80('0x28')][_0xfc80('0x27')]);}})['catch'](function(_0x4f068d){logger[_0xfc80('0x24')](_0xfc80('0x26'),_0x16dc59,_0x4f068d);_0x1731d3(_0x4f068d);});});}function saveUpdates(_0x47f2a5){return function(_0x20a59a){if(_0x20a59a){return _0x20a59a['update'](_0x47f2a5)[_0xfc80('0x29')](function(_0x3e2395){if(_0x3e2395[_0xfc80('0x2a')]===_0xfc80('0x2b')){socket[_0xfc80('0x2c')](_0xfc80('0x2d')+_0x3e2395['id'],_0x3e2395);}return _0x3e2395;});}return null;};}function removeEntity(_0x15a338,_0x4f8a79){return function(_0x1d35a5){if(_0x1d35a5){return _0x1d35a5[_0xfc80('0x2e')]({'transaction':_0x4f8a79})[_0xfc80('0x29')](function(){var _0x4700fe=_0x1d35a5['get']({'plain':!![]});if(_0x4700fe['role']===_0xfc80('0x2f'))return;var _0x5733d3=[{'name':'Users','value':'user','ignore':!![]},{'name':_0xfc80('0x30'),'value':'agent','ignore':![]},{'name':_0xfc80('0x31'),'value':_0xfc80('0x32'),'ignore':![]}];var _0x233336=_(_0x5733d3)[_0xfc80('0x33')]('ignore')[_0xfc80('0x34')](_0xfc80('0x35'))[_0xfc80('0x35')]();if(_['includes'](_0x233336,_0x4700fe['role'])){return;}var _0x8ec804=_[_0xfc80('0x36')](_0x5733d3,[_0xfc80('0x35'),_0x4700fe[_0xfc80('0x2a')]])[_0xfc80('0x37')];return db[_0xfc80('0x38')][_0xfc80('0x2e')]({'where':{'type':_0x8ec804,'resourceId':_0x4700fe['id']},'transaction':_0x4f8a79})['then'](function(){return _0x1d35a5;});})[_0xfc80('0x29')](function(){_0x15a338[_0xfc80('0x17')](0xcc)[_0xfc80('0x18')]();});}};}function handleEntityNotFound(_0x29a6bf){return function(_0x78c5e2){if(!_0x78c5e2){_0x29a6bf['sendStatus'](0x194);}return _0x78c5e2;};}function handleError(_0x26d0dc,_0x221d5e){_0x221d5e=_0x221d5e||0x1f4;return function(_0x43d925){logger[_0xfc80('0x24')](_0x43d925[_0xfc80('0x39')]);if(_0x43d925[_0xfc80('0x37')]){delete _0x43d925[_0xfc80('0x37')];}_0x26d0dc[_0xfc80('0x17')](_0x221d5e)['send'](_0x43d925);};}function getUserAttributes(){return _(db['User']['rawAttributes'])[_0xfc80('0x34')](function(_0x4c0cf4){return{'name':_0x4c0cf4['fieldName'],'type':_0x4c0cf4['type'][_0xfc80('0x3a')]};})['filter'](function(_0xedc1de){return![_0xfc80('0x3b'),_0xfc80('0x3c'),_0xfc80('0x3d'),'resetPasswordToken',_0xfc80('0x3e'),_0xfc80('0x3f')][_0xfc80('0x40')](_0xedc1de[_0xfc80('0x37')]);})['value']();}exports[_0xfc80('0x41')]=function(_0xca787b,_0x1923cc){var _0x4562d7={},_0x176277={'count':0x0,'rows':[]};var _0x115646=getUserAttributes();_0x4562d7=qs[_0xfc80('0x42')](_0x115646,_0xca787b);var _0x3f2d4e={'where':_0x4562d7['where']};return db['User'][_0xfc80('0x1b')](_0x3f2d4e)[_0xfc80('0x29')](function(_0x330dec){_0x176277[_0xfc80('0x1b')]=_0x330dec;if(_0xca787b[_0xfc80('0x43')][_0xfc80('0x44')]){_0x4562d7['include']=[{'all':!![]}];}if(_0xca787b[_0xfc80('0x43')][_0xfc80('0x45')]===_0xfc80('0x46')){_0x4562d7[_0xfc80('0x47')]=[{'model':db[_0xfc80('0x48')],'as':_0xfc80('0x45')}];}if(!_[_0xfc80('0x40')](_0x4562d7[_0xfc80('0x49')],'id')){_0x4562d7['attributes']['push']('id');}return db[_0xfc80('0x4a')]['findAll'](_0x4562d7);})[_0xfc80('0x29')](function(_0x22c3da){_0x176277['rows']=_0x22c3da;if(_0xca787b[_0xfc80('0x43')][_0xfc80('0x4b')]===_0xfc80('0x46')){var _0x6625d6=[];for(var _0x5eb86a=0x0;_0x5eb86a<_0x176277[_0xfc80('0x4c')][_0xfc80('0x4d')];_0x5eb86a++){_0x6625d6[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x4f'),_0x176277[_0xfc80('0x4c')][_0x5eb86a]['dataValues']));_0x6625d6[_0xfc80('0x4e')](get_open_tabs('sms',_0x176277[_0xfc80('0x4c')][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6['push'](get_open_tabs(_0xfc80('0x51'),_0x176277[_0xfc80('0x4c')][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6['push'](get_open_tabs(_0xfc80('0x52'),_0x176277['rows'][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x53'),_0x176277[_0xfc80('0x4c')][_0x5eb86a][_0xfc80('0x50')]));_0x6625d6[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x54'),_0x176277['rows'][_0x5eb86a][_0xfc80('0x50')]));}return Promise[_0xfc80('0x55')](_0x6625d6)[_0xfc80('0x29')](function(){return _0x176277;});}else{return _0x176277;}})[_0xfc80('0x29')](respondWithFilteredResult(_0x1923cc,_0x4562d7))[_0xfc80('0x56')](handleError(_0x1923cc,null));};exports[_0xfc80('0x57')]=function(_0x26c4fa,_0x587ace){var _0xa8133=getUserAttributes();_0x26c4fa['query']['id']=_0x26c4fa[_0xfc80('0x58')]['id'];var _0x462715=qs[_0xfc80('0x42')](_0xa8133,_0x26c4fa);if(_0x26c4fa[_0xfc80('0x43')][_0xfc80('0x44')]){_0x462715[_0xfc80('0x47')]=[{'all':!![]}];}if(_0x26c4fa['query'][_0xfc80('0x45')]===_0xfc80('0x46')){_0x462715[_0xfc80('0x47')]=[{'model':db['UserSetting'],'as':_0xfc80('0x45')}];}_0x462715=_['merge']({},_0x462715,_0x26c4fa[_0xfc80('0x59')]);if(!_[_0xfc80('0x40')](_0x462715[_0xfc80('0x49')],'id')){_0x462715[_0xfc80('0x49')]['push']('id');}return db[_0xfc80('0x4a')][_0xfc80('0x36')](_0x462715)['then'](handleEntityNotFound(_0x587ace,null))['then'](function(_0x58693a){var _0x3b4bdf=[];values=_0x58693a;if(_0x26c4fa[_0xfc80('0x43')][_0xfc80('0x4b')]===_0xfc80('0x46')){_0x3b4bdf['push'](get_open_tabs(_0xfc80('0x4f'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x5a'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x53'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x54'),_0x58693a['dataValues']));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x51'),_0x58693a[_0xfc80('0x50')]));_0x3b4bdf[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x52'),_0x58693a[_0xfc80('0x50')]));return Promise[_0xfc80('0x55')](_0x3b4bdf);}else{return values;}})[_0xfc80('0x29')](function(){return values;})[_0xfc80('0x29')](respondWithResult(_0x587ace,null))[_0xfc80('0x56')](handleError(_0x587ace,null));};exports[_0xfc80('0x5b')]=function(_0x53551d,_0x3ecb0f){if(_0x53551d['body']['id']){delete _0x53551d[_0xfc80('0x5c')]['id'];}delete _0x53551d['body'][_0xfc80('0x2a')];return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x53551d['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x3ecb0f,null))[_0xfc80('0x29')](saveUpdates(_0x53551d[_0xfc80('0x5c')],null))['then'](respondWithResult(_0x3ecb0f,null))[_0xfc80('0x56')](handleError(_0x3ecb0f,null));};exports[_0xfc80('0x5d')]=function(_0x48ea0d,_0x387c48){return db[_0xfc80('0x4a')][_0xfc80('0x5d')]()[_0xfc80('0x29')](respondWithResult(_0x387c48,null))[_0xfc80('0x56')](handleError(_0x387c48,null));};exports[_0xfc80('0x5e')]=function(_0x5dfcac,_0x1b689f){return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x5dfcac[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x1b689f,null))[_0xfc80('0x29')](function(_0x16ce30){if(_0x16ce30){return _0x16ce30[_0xfc80('0x5e')](_0x5dfcac[_0xfc80('0x5c')]['ids'],_[_0xfc80('0x5f')](_0x5dfcac[_0xfc80('0x5c')],['ids','id'])||{});}})[_0xfc80('0x29')](respondWithResult(_0x1b689f,null))[_0xfc80('0x56')](handleError(_0x1b689f,null));};function validateUser(_0x378033){return new Promise(function(_0x5752b6,_0x471dbe){if(_0x378033['internal'])return _0x5752b6(_0x378033);return db[_0xfc80('0x60')][_0xfc80('0x61')](0x1)[_0xfc80('0x29')](function(_0x39f1a5){if(_0x39f1a5[_0xfc80('0x62')])authService[_0xfc80('0x63')](_0x378033[_0xfc80('0x3b')]);db[_0xfc80('0x4a')]['max']('internal')[_0xfc80('0x29')](function(_0x16527c){if(_['isNil'](_0x16527c)){_0x378033['internal']=_0x39f1a5[_0xfc80('0x64')]||0x1;return;}if(_['isNil'](_0x39f1a5[_0xfc80('0x64')])||_0x39f1a5[_0xfc80('0x64')]===_0x16527c){_0x378033[_0xfc80('0x65')]=_0x16527c+0x1;return;}if(_0x39f1a5[_0xfc80('0x64')]>_0x16527c){_0x378033[_0xfc80('0x65')]=_0x39f1a5[_0xfc80('0x64')];return;}return db[_0xfc80('0x66')]['query'](_0xfc80('0x67'),{'type':db[_0xfc80('0x66')][_0xfc80('0x68')][_0xfc80('0x69')]})[_0xfc80('0x29')](function(_0x5218b6){if(_0x5218b6&&_0x5218b6[_0xfc80('0x4d')]){for(var _0x55f941=0x0,_0x3e6e7a=_0x5218b6[_0xfc80('0x4d')];_0x55f941<_0x3e6e7a&&_[_0xfc80('0x6a')](_0x378033[_0xfc80('0x65')]);_0x55f941++){if(_0x39f1a5[_0xfc80('0x64')]<=_0x5218b6[_0x55f941][_0xfc80('0x6b')]){_0x378033[_0xfc80('0x65')]=_0x5218b6[_0x55f941][_0xfc80('0x6b')];}else if(_0x39f1a5[_0xfc80('0x64')]>_0x5218b6[_0x55f941]['from']&&_0x39f1a5[_0xfc80('0x64')]<=_0x5218b6[_0x55f941]['to']){_0x378033[_0xfc80('0x65')]=_0x39f1a5[_0xfc80('0x64')];}}}if(_[_0xfc80('0x6a')](_0x378033[_0xfc80('0x65')])){_0x378033['internal']=_0x16527c+0x1;}return _0x5752b6(_0x378033);});});})[_0xfc80('0x56')](function(_0x1a771c){_0x471dbe(_0x1a771c);});});}function updateUser(_0x4a6ade){return new Promise(function(_0x32fbb9,_0x3d0dc5){try{if(_0x4a6ade[_0xfc80('0x6c')]){_0x4a6ade[_0xfc80('0x6d')]=_0x4a6ade[_0xfc80('0x65')];_0x4a6ade[_0xfc80('0x6e')]={'mailbox':_0x4a6ade['internal'],'password':_0x4a6ade[_0xfc80('0x3b')],'fullname':_0x4a6ade[_0xfc80('0x6f')],'email':_0x4a6ade[_0xfc80('0x70')]};}if(_0x4a6ade[_0xfc80('0x2a')]===_0xfc80('0x2b')){if(!_0x4a6ade[_0xfc80('0x71')])_0x4a6ade[_0xfc80('0x71')]=[_0xfc80('0x72'),_0xfc80('0x73'),_0xfc80('0x74'),_0xfc80('0x75'),_0xfc80('0x76'),_0xfc80('0x77'),_0xfc80('0x78'),'106',_0xfc80('0x79'),_0xfc80('0x7a'),'109',_0xfc80('0x7b'),_0xfc80('0x7c'),_0xfc80('0x7d'),_0xfc80('0x7e')];}_0x32fbb9(_0x4a6ade);}catch(_0x30e38a){_0x3d0dc5(_0x30e38a);}});}exports[_0xfc80('0x7f')]=function(_0x5eccb6,_0x451cab){if(_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x2b'))throw new Error('Unauthorized');if(_0x5eccb6[_0xfc80('0x5c')][_0xfc80('0x2a')]===_0xfc80('0x80')&&_0x5eccb6['user'][_0xfc80('0x2a')]!==_0xfc80('0x2f')){throw new Error(_0xfc80('0x81'));}if(_0x5eccb6['body']['role']==='admin'&&_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x2f')){throw new Error(_0xfc80('0x82'));}return licenseUtil[_0xfc80('0x83')]([_0x5eccb6[_0xfc80('0x5c')]])[_0xfc80('0x29')](function(){return validateUser(_0x5eccb6[_0xfc80('0x5c')]);})['then'](function(_0x1d7420){return updateUser(_0x1d7420)[_0xfc80('0x29')](function(_0x28a214){if(_0x28a214[_0xfc80('0x2a')]===_0xfc80('0x2f')){_0x28a214[_0xfc80('0x84')]=_0x5eccb6['user'][_0xfc80('0x84')];delete _0x28a214['userProfileId'];}return _0x28a214;});})[_0xfc80('0x29')](function(_0x541131){return db['User']['create'](_0x541131,{'include':[{'model':db[_0xfc80('0x6e')],'as':_0xfc80('0x6e')}]});})[_0xfc80('0x29')](function(_0x145803){if(_0x5eccb6[_0xfc80('0x5c')][_0xfc80('0x2a')]===_0xfc80('0x80'))return _0x145803;if(_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x80'))return _0x145803;return db[_0xfc80('0x85')][_0xfc80('0x36')]({'where':{'name':_0x145803[_0xfc80('0x2a')]==='agent'?_0xfc80('0x30'):_0xfc80('0x31'),'userProfileId':_0x5eccb6[_0xfc80('0x80')][_0xfc80('0x86')]},'raw':!![]})[_0xfc80('0x29')](function(_0x4bc290){if(!_0x4bc290||_0x4bc290[_0xfc80('0x87')]!=0x0)return _0x145803;return db['UserProfileResource'][_0xfc80('0x7f')]({'name':_0x145803['name'],'resourceId':_0x145803['id'],'type':_0x4bc290[_0xfc80('0x37')],'sectionId':_0x4bc290['id']},{})[_0xfc80('0x29')](function(){return _0x145803;});})['catch'](function(_0x307272){logger[_0xfc80('0x24')](_0xfc80('0x88'),_0x307272);throw _0x307272;});})[_0xfc80('0x29')](respondWithResult(_0x451cab,0xc9))[_0xfc80('0x56')](handleError(_0x451cab,null));};exports[_0xfc80('0x89')]=function(_0x127817,_0x2be665){var _0xe2df7=_0x127817['body'];var _0x560c14=[];if(_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x2b'))throw new Error('Unauthorized');if(_[_0xfc80('0x8a')](_0xe2df7,[_0xfc80('0x2a'),_0xfc80('0x80')])&&_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]!=='admin'){throw new Error(_0xfc80('0x81'));}if(_[_0xfc80('0x8a')](_0xe2df7,['role',_0xfc80('0x2f')])&&_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x2f')){throw new Error(_0xfc80('0x8b'));}return licenseUtil[_0xfc80('0x83')](_0xe2df7)['then'](function(){return validateUser(_0xe2df7[0x0]);})['then'](function(){for(var _0x213fbf=0x1;_0x213fbf<_0xe2df7[_0xfc80('0x4d')];_0x213fbf++){var _0x26c037=_0xe2df7[_0x213fbf-0x1][_0xfc80('0x65')];if(!_0xe2df7[_0x213fbf][_0xfc80('0x65')])_0xe2df7[_0x213fbf][_0xfc80('0x65')]=_0x26c037+0x1;_0x560c14['push'](validateUser(_0xe2df7[_0x213fbf]));}return Promise[_0xfc80('0x55')](_0x560c14);})[_0xfc80('0x29')](function(){_0x560c14=[];for(var _0x820110=0x0;_0x820110<_0xe2df7[_0xfc80('0x4d')];_0x820110++){_0x560c14[_0xfc80('0x4e')](updateUser(_0xe2df7[_0x820110]));}return Promise[_0xfc80('0x55')](_0x560c14);})[_0xfc80('0x29')](function(){_0x560c14=_0xe2df7[_0xfc80('0x34')](function(_0x3dd7ff){return db[_0xfc80('0x4a')]['create'](_0x3dd7ff,{'include':[{'model':db['VoiceMail'],'as':_0xfc80('0x6e')}]})['then'](function(_0x4d4673){_0x3dd7ff['id']=_0x4d4673['id'];return _0x3dd7ff;});});return Promise[_0xfc80('0x55')](_0x560c14);})['then'](function(_0x344db6){if(_0x127817[_0xfc80('0x5c')]['role']==='user')return _0x344db6;if(_0x127817[_0xfc80('0x80')][_0xfc80('0x2a')]!==_0xfc80('0x80'))return _0x344db6;var _0x7a081a=_[_0xfc80('0x8a')](_0x344db6,function(_0x38ed67){return _0x38ed67[_0xfc80('0x2a')]===_0xfc80('0x2b')||_0x38ed67[_0xfc80('0x2a')]===_0xfc80('0x32');});if(!_0x7a081a)return _0x344db6;return db[_0xfc80('0x85')]['findAll']({'where':{'name':{'$or':[_0xfc80('0x30'),_0xfc80('0x31')]},'userProfileId':_0x127817[_0xfc80('0x80')][_0xfc80('0x86')]},'raw':!![]})[_0xfc80('0x29')](function(_0x4a3049){if(_[_0xfc80('0x8c')](_0x4a3049)||!_[_0xfc80('0x8a')](_0x4a3049,[_0xfc80('0x87'),0x0]))return _0x344db6;_0x560c14=[];var _0x4abc32=_(_0x4a3049)[_0xfc80('0x34')](function(_0x31cab5){if(_0x31cab5[_0xfc80('0x87')]===0x1)return;return _0x31cab5[_0xfc80('0x37')]===_0xfc80('0x30')?'agent':_0xfc80('0x32');})[_0xfc80('0x8d')]()[_0xfc80('0x35')]();for(var _0xf35c6d=0x0;_0xf35c6d<_0x344db6[_0xfc80('0x4d')];_0xf35c6d++){if(!_['includes'](_0x4abc32,_0x344db6[_0xf35c6d][_0xfc80('0x2a')]))return;var _0x2edcc1=_0x344db6[_0xf35c6d][_0xfc80('0x2a')]===_0xfc80('0x2b')?_0xfc80('0x30'):_0xfc80('0x31');_0x560c14['push'](db[_0xfc80('0x38')][_0xfc80('0x7f')]({'name':_0x344db6[_0xf35c6d][_0xfc80('0x37')],'resourceId':_0x344db6[_0xf35c6d]['id'],'type':_0x2edcc1,'sectionId':_['find'](_0x4a3049,['name',_0x2edcc1])['id']},{}));}return Promise[_0xfc80('0x55')](_0x560c14);});})['then'](respondWithResult(_0x2be665,0xc9))['catch'](handleError(_0x2be665,null));};exports[_0xfc80('0x8e')]=function(_0x737d2c,_0x53564d){if(_0x737d2c[_0xfc80('0x5c')]['id']){delete _0x737d2c['body']['id'];}return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x737d2c[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](function(_0x1f4e81){if(!_0x1f4e81)return null;if(_0x1f4e81['id']===_0x737d2c[_0xfc80('0x80')]['id']){if(!_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x8f')]||!_0x737d2c['body'][_0xfc80('0x90')]){throw new db[(_0xfc80('0x91'))]['ValidationError'](_0xfc80('0x92'));}if(!_0x1f4e81[_0xfc80('0x93')](_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x8f')])){throw new db[(_0xfc80('0x91'))]['ValidationError'](_0xfc80('0x94'));}if(_0x737d2c[_0xfc80('0x5c')]['oldPassword']===_0x737d2c[_0xfc80('0x5c')]['newPassword']){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0x96'));}}else if(_0x737d2c[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x2f')){if(!_0x737d2c['body'][_0xfc80('0x90')]){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0x97'));}}else if(_0x737d2c[_0xfc80('0x80')][_0xfc80('0x2a')]===_0xfc80('0x80')){if(!_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x90')]){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1f4e81[_0xfc80('0x2a')]!==_0xfc80('0x2b')){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))]('Unauthorized');}}else{throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))]('Unauthorized');}return _0x1f4e81;})['then'](handleEntityNotFound(_0x53564d,null))[_0xfc80('0x29')](function(_0x5dd0a8){return db[_0xfc80('0x60')][_0xfc80('0x98')]({'attributes':['id',_0xfc80('0x62'),_0xfc80('0x99'),'passwordHistoryLimit']})[_0xfc80('0x29')](function(_0x2c63e9){if(_0x2c63e9['securePassword'])authService[_0xfc80('0x63')](_0x737d2c['body'][_0xfc80('0x90')]);if(!_0x2c63e9[_0xfc80('0x99')]||!_0x5dd0a8['previousPasswords'])return _0x5dd0a8;authService['validatePasswordHistory'](_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x90')],_0x5dd0a8[_0xfc80('0x3d')],_0x2c63e9[_0xfc80('0x9a')]);return _0x5dd0a8;})[_0xfc80('0x29')](saveUpdates({'password':_0x737d2c[_0xfc80('0x5c')][_0xfc80('0x90')],'passwordResetAt':_0x737d2c[_0xfc80('0x80')]['id']==_0x737d2c[_0xfc80('0x58')]['id']?moment():null,'previousPasswords':authService[_0xfc80('0x9b')](_0x737d2c[_0xfc80('0x5c')]['newPassword'],_0x5dd0a8[_0xfc80('0x3d')])},null));})[_0xfc80('0x29')](respondWithResult(_0x53564d,null))[_0xfc80('0x56')](handleError(_0x53564d,null));};exports[_0xfc80('0x9c')]=function(_0x1b1d85,_0x502760){var _0x3bf6ee=_0x1b1d85['body'][_0xfc80('0x9d')];return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x1b1d85[_0xfc80('0x58')]['id']},'attributes':['id','name','role','online',_0xfc80('0x9e'),_0xfc80('0x9f'),_0xfc80('0xa0')]})['then'](handleEntityNotFound(_0x502760,null))[_0xfc80('0x29')](function(_0xd0f839){if(_0xd0f839){if(!utils[_0xfc80('0xa1')](_0x3bf6ee)){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0xa2'));}return _0xd0f839[_0xfc80('0xa3')+_[_0xfc80('0xa4')](_0x3bf6ee['toLowerCase']())+_0xfc80('0xa5')](_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa6')],{'penalty':_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa7')]||0x0})[_0xfc80('0xa8')](function(_0x51757a){for(var _0x3d3791=0x0;_0x3d3791<_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa6')][_0xfc80('0x4d')];_0x3d3791+=0x1){var _0x5140db={'UserId':Number(_0x1b1d85[_0xfc80('0x58')]['id'])};_0x5140db[_[_0xfc80('0xa4')](_0x3bf6ee[_0xfc80('0xa9')]())+_0xfc80('0xaa')]=Number(_0x1b1d85['body'][_0xfc80('0xa6')][_0x3d3791]);socket['emit'](_0xfc80('0x80')+_[_0xfc80('0xa4')](_0x3bf6ee[_0xfc80('0xa9')]())+_0xfc80('0xab'),_0x5140db);}return _0x51757a;})[_0xfc80('0x29')](function(){if(_0x3bf6ee===_0xfc80('0xac')){return db['VoiceQueue'][_0xfc80('0xad')]({'where':{'id':_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa6')]||[]},'raw':!![],'attributes':['id',_0xfc80('0x37')]});}})[_0xfc80('0x29')](function(_0x20088d){var _0xa5e228=_0xd0f839[_0xfc80('0xae')]({'plain':!![]});var _0x2ee91e=[];if(_0x3bf6ee==='voice'&&_0xa5e228[_0xfc80('0x2a')]===_0xfc80('0x2b')&&_0xa5e228[_0xfc80('0xaf')]){for(let _0x1659be=0x0;_0x1659be<_0x20088d[_0xfc80('0x4d')];_0x1659be+=0x1){_0x2ee91e[_0xfc80('0x4e')]({'membername':_0xa5e228[_0xfc80('0x37')],'UserId':_0xa5e228['id'],'queue_name':_0x20088d[_0x1659be][_0xfc80('0x37')],'VoiceQueueId':_0x20088d[_0x1659be]['id'],'interface':_['isNil'](_0xa5e228['interface'])?util[_0xfc80('0xb0')]('SIP/%s',_0xa5e228[_0xfc80('0x37')]):_0xa5e228[_0xfc80('0xa0')],'paused':_0xa5e228['voicePause']||![],'penalty':_0x1b1d85[_0xfc80('0x5c')][_0xfc80('0xa7')]||0x0});}return Promise[_0xfc80('0x55')](_0x2ee91e[_0xfc80('0x34')](function(_0x28be2b){return db[_0xfc80('0xb1')]['upsert'](_0x28be2b);}));}return _0xd0f839;});}})[_0xfc80('0x29')](respondWithStatusCode(_0x502760,null))[_0xfc80('0x56')](handleError(_0x502760,null));};exports[_0xfc80('0xb2')]=function(_0x189d00,_0x96f91d){var _0x1fe906,_0x10453b;return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x189d00['params']['id']},'attributes':['id',_0xfc80('0x37'),'role']})[_0xfc80('0x29')](handleEntityNotFound(_0x96f91d,null))[_0xfc80('0x29')](function(_0x29b02d){if(_0x29b02d){_0x1fe906=_0x29b02d;if(!_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')]||!utils[_0xfc80('0xa1')](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')])){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0xa2'));}return _0x29b02d[_0xfc80('0xb3')+_['capitalize'](_0x189d00[_0xfc80('0x43')]['channel'][_0xfc80('0xa9')]())+'Queues'](_0x189d00[_0xfc80('0x43')]['ids']);}})['then'](function(_0x1c4d79){if(_[_0xfc80('0xb4')](_0x189d00['query'][_0xfc80('0xa6')])){for(var _0x17af44=0x0;_0x17af44<_0x189d00[_0xfc80('0x43')]['ids'][_0xfc80('0x4d')];_0x17af44+=0x1){_0x10453b={'UserId':Number(_0x189d00['params']['id'])};_0x10453b[_['capitalize'](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')]['toLowerCase']())+'QueueId']=Number(_0x189d00[_0xfc80('0x43')][_0xfc80('0xa6')][_0x17af44]);socket[_0xfc80('0x2c')](_0xfc80('0x80')+_[_0xfc80('0xa4')](_0x189d00['query']['channel'][_0xfc80('0xa9')]())+_0xfc80('0xb5'),_0x10453b);}}else{_0x10453b={'UserId':Number(_0x189d00[_0xfc80('0x58')]['id'])};_0x10453b[_[_0xfc80('0xa4')](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')][_0xfc80('0xa9')]())+_0xfc80('0xaa')]=Number(_0x189d00[_0xfc80('0x43')][_0xfc80('0xa6')]);socket[_0xfc80('0x2c')]('user'+_[_0xfc80('0xa4')](_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')][_0xfc80('0xa9')]())+'Queue:remove',_0x10453b);}return _0x1c4d79;})['then'](function(){if(_0x189d00[_0xfc80('0x43')][_0xfc80('0x9d')]===_0xfc80('0xac')){return db[_0xfc80('0xb1')]['destroy']({'where':{'UserId':_0x189d00[_0xfc80('0x58')]['id'],'VoiceQueueId':_0x189d00[_0xfc80('0x43')][_0xfc80('0xa6')]},'individualHooks':!![]})['then'](function(){return _0x1fe906;});}return _0x1fe906;})[_0xfc80('0x29')](respondWithStatusCode(_0x96f91d,null))[_0xfc80('0x56')](handleError(_0x96f91d,null));};exports[_0xfc80('0xb6')]=function(_0x4d822c,_0x26c4e6){_0x4d822c[_0xfc80('0x5c')][_0xfc80('0xb7')]=_0x4d822c[_0xfc80('0xb8')][_0xfc80('0xb9')];return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x4d822c['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x26c4e6,null))[_0xfc80('0x29')](saveUpdates(_0x4d822c[_0xfc80('0x5c')],null))['then'](respondWithResult(_0x26c4e6,null))[_0xfc80('0x56')](handleError(_0x26c4e6,null));};exports['getAvatar']=function(_0x2683ad,_0x3bb10e){var _0x4b873b=path[_0xfc80('0xba')](config[_0xfc80('0xbb')],_0xfc80('0xbc'));return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x2683ad[_0xfc80('0x58')]['id']},'attributes':['id',_0xfc80('0xb7')],'raw':!![]})['then'](handleEntityNotFound(_0x3bb10e,null))[_0xfc80('0x29')](function(_0x52ce58){if(_0x52ce58){if(_[_0xfc80('0x6a')](_0x52ce58[_0xfc80('0xb7')])){return _0x3bb10e[_0xfc80('0xbd')](_0x4b873b);}else{if(!fs[_0xfc80('0xbe')](path['join'](config['root'],_0xfc80('0xbf'),_0x52ce58['userpic']))){return _0x3bb10e[_0xfc80('0xbd')](_0x4b873b);}return _0x3bb10e[_0xfc80('0xbd')](path['join'](config['root'],'server/files/images/',_0x52ce58[_0xfc80('0xb7')]));}}})[_0xfc80('0x56')](handleError(_0x3bb10e,null));};exports[_0xfc80('0xc0')]=function(_0x272719,_0x3808c2){return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x272719[_0xfc80('0x58')]['id']},'attributes':['id']})[_0xfc80('0x29')](handleEntityNotFound(_0x3808c2,null))[_0xfc80('0x29')](function(_0x49b1d4){var _0x3fc9fa=[];values=_0x49b1d4[_0xfc80('0x50')];_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x4f'),_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs('sms',_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x53'),_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs(_0xfc80('0x54'),_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa[_0xfc80('0x4e')](get_open_tabs('fax',_0x49b1d4[_0xfc80('0x50')]));_0x3fc9fa['push'](get_open_tabs('mail',_0x49b1d4[_0xfc80('0x50')]));return Promise[_0xfc80('0x55')](_0x3fc9fa);})['then'](function(_0x3c7bbb){if(_0x3c7bbb){var _0x391062=_['map'](values[_0xfc80('0xc1')],function(_0x4e5ecf){return{'channel':'CHAT','id':_0x4e5ecf['id'],'createdAt':_0x4e5ecf['createdAt']};});var _0x26e98f=_[_0xfc80('0x34')](values['FaxOpenTabs'],function(_0x4d3ef5){return{'channel':'FAX','id':_0x4d3ef5['id'],'createdAt':_0x4d3ef5[_0xfc80('0xc2')]};});var _0x13f3d1=_[_0xfc80('0x34')](values[_0xfc80('0xc3')],function(_0x242d6e){return{'channel':'OPENCHANNEL','id':_0x242d6e['id'],'createdAt':_0x242d6e[_0xfc80('0xc2')]};});var _0x2b0ec3=_[_0xfc80('0x34')](values[_0xfc80('0xc4')],function(_0x29d3a2){return{'channel':_0xfc80('0xc5'),'id':_0x29d3a2['id'],'createdAt':_0x29d3a2['createdAt']};});var _0x3fe696=_['map'](values[_0xfc80('0xc6')],function(_0x530cb3){return{'channel':_0xfc80('0xc7'),'id':_0x530cb3['id'],'createdAt':_0x530cb3[_0xfc80('0xc2')]};});var _0x510e8c=_[_0xfc80('0x34')](values[_0xfc80('0xc8')],function(_0x33dd60){return{'channel':_0xfc80('0xc9'),'id':_0x33dd60['id'],'createdAt':_0x33dd60[_0xfc80('0xc2')]};});var _0x87d4f2=_['concat'](_0x391062,_0x26e98f,_0x13f3d1,_0x2b0ec3,_0x3fe696,_0x510e8c);var _0x59ffec={'count':_0x87d4f2[_0xfc80('0x4d')],'rows':_0x87d4f2};return _0x59ffec;}else return null;})[_0xfc80('0x29')](respondWithResult(_0x3808c2,null))['catch'](handleError(_0x3808c2,null));};exports[_0xfc80('0xca')]=function(_0x363242,_0x4a7346){var _0x1ec9cb={};return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x363242[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](function(_0x587b27){if(!_0x587b27){throw new APINotFoundError(util[_0xfc80('0xb0')]('User\x20with\x20id\x20%s\x20not\x20found',_0x363242['params']['id']));}return contacts[_0xfc80('0x5d')]();})[_0xfc80('0x29')](function(_0x23de63){_0x363242[_0xfc80('0x43')]['User']=_0x363242['params']['id'];_0x1ec9cb=qs[_0xfc80('0x42')](_0x23de63,_0x363242);if(_0x363242[_0xfc80('0x43')][_0xfc80('0xcb')](_0xfc80('0x44'))){_0x1ec9cb[_0xfc80('0x47')]=[{'model':db[_0xfc80('0xcc')],'as':_0xfc80('0xcd'),'required':![]},{'model':db['Tag'],'as':_0xfc80('0xce'),'attributes':['id','name',_0xfc80('0xcf')],'where':_0x363242[_0xfc80('0x43')][_0xfc80('0xd0')]?{'id':_0x363242[_0xfc80('0x43')][_0xfc80('0xd0')]}:undefined,'required':_0x363242['query']['tag']?!![]:![]}];}return contacts['findAll'](_0x363242[_0xfc80('0x43')],_0x363242[_0xfc80('0x80')],_0x1ec9cb,_0x23de63);})['then'](respondWithFilteredResult(_0x4a7346,_0x1ec9cb))[_0xfc80('0x56')](APIHandleError(_0x4a7346));};exports[_0xfc80('0xd1')]=function(_0x1bc328,_0x323a58){var _0x319e95;var _0x5c88e5={};var _0x3fa65c;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x1bc328[_0xfc80('0x58')]['id']},'attributes':['id',_0xfc80('0x37'),_0xfc80('0x2a')]})[_0xfc80('0x29')](handleEntityNotFound(_0x323a58,null))['then'](function(_0x2887fc){if(!utils['isValidChannel'](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])){throw new db[(_0xfc80('0x91'))][(_0xfc80('0x95'))](_0xfc80('0xa2'));}_0x319e95=_0x2887fc;var _0x5d51e8={};_0x5d51e8['model']=_[_0xfc80('0xd2')](db[_[_0xfc80('0xa4')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xd3')]['rawAttributes']);_0x5d51e8[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x1bc328[_0xfc80('0x43')]);_0x5d51e8[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x5d51e8[_0xfc80('0xd6')],_0x5d51e8['query']);_0x5c88e5[_0xfc80('0x49')]=_['intersection'](_0x5d51e8['model'],qs[_0xfc80('0xd7')](_0x1bc328[_0xfc80('0x43')]['fields']));_0x5c88e5[_0xfc80('0x49')]=_0x5c88e5['attributes'][_0xfc80('0x4d')]?_0x5c88e5[_0xfc80('0x49')]:_0x5d51e8['model'];_0x5c88e5[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x1bc328[_0xfc80('0x43')]['sort']);_0x5c88e5[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x1bc328[_0xfc80('0x43')],_0x5d51e8['filters']));if(_0x1bc328['query'][_0xfc80('0x33')]){_0x5c88e5[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x5c88e5[_0xfc80('0xda')],{'$or':_['map'](_0x5c88e5['attributes'],function(_0x1c027d){var _0x3da045={};_0x3da045[_0x1c027d]={'$like':'%'+_0x1bc328[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x3da045;})});}_0x5c88e5=_[_0xfc80('0xdc')]({},_0x5c88e5,_0x1bc328['options']);switch(_0x319e95[_0xfc80('0x2a')]){case'admin':return db[_['capitalize'](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xd3')]['findAll'](_0x5c88e5);case _0xfc80('0x80'):case _0xfc80('0x2b'):return _0x319e95[_0xfc80('0xae')+_[_0xfc80('0xa4')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xa5')](_0x5c88e5);default:throw new db[(_0xfc80('0x91'))]['ValidationError']('Unknown\x20role');}})['then'](function(_0x396eb5){_0x3fa65c=_0x396eb5[_0xfc80('0x4d')];if(!_0x1bc328[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x5c88e5[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x5c88e5[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x1c')]);}switch(_0x319e95['role']){case _0xfc80('0x2f'):return db[_[_0xfc80('0xa4')](_0x1bc328['query'][_0xfc80('0x9d')])+'Queue']['findAll'](_0x5c88e5);case _0xfc80('0x80'):case _0xfc80('0x2b'):return _0x319e95[_0xfc80('0xae')+_[_0xfc80('0xa4')](_0x1bc328[_0xfc80('0x43')][_0xfc80('0x9d')])+_0xfc80('0xa5')](_0x5c88e5);}})[_0xfc80('0x29')](function(_0x262b79){return{'count':_0x3fa65c,'rows':_0x262b79};})['then'](respondWithResult(_0x323a58,null))[_0xfc80('0x56')](handleError(_0x323a58,null));};exports[_0xfc80('0xdd')]=function(_0x32abb3,_0x3dce00){var _0x5a6f54={};var _0x2773ef={};var _0x59d5db;var _0x225781;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x32abb3[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x3dce00,null))['then'](function(_0x3c281d){if(_0x3c281d){_0x59d5db=_0x3c281d;_0x2773ef[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0xb1')][_0xfc80('0xde')]);_0x2773ef[_0xfc80('0x43')]=_['keys'](_0x32abb3[_0xfc80('0x43')]);_0x2773ef['filters']=_[_0xfc80('0xd5')](_0x2773ef[_0xfc80('0xd6')],_0x2773ef[_0xfc80('0x43')]);_0x5a6f54[_0xfc80('0x49')]=_['intersection'](_0x2773ef[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x32abb3['query'][_0xfc80('0xd7')]));_0x5a6f54[_0xfc80('0x49')]=_0x5a6f54[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x5a6f54[_0xfc80('0x49')]:_0x2773ef[_0xfc80('0xd6')];_0x5a6f54['order']=qs[_0xfc80('0xd9')](_0x32abb3[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x5a6f54[_0xfc80('0xda')]=qs['filters'](_[_0xfc80('0xdb')](_0x32abb3[_0xfc80('0x43')],_0x2773ef['filters']));if(_0x32abb3[_0xfc80('0x43')][_0xfc80('0x33')]){_0x5a6f54['where']=_['merge'](_0x5a6f54[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x5a6f54['attributes'],function(_0x47cc41){var _0x351bc9={};_0x351bc9[_0x47cc41]={'$like':'%'+_0x32abb3[_0xfc80('0x43')]['filter']+'%'};return _0x351bc9;})});}_0x5a6f54=_[_0xfc80('0xdc')]({},_0x5a6f54,_0x32abb3[_0xfc80('0x59')]);return _0x59d5db[_0xfc80('0xdd')](_0x5a6f54);}})[_0xfc80('0x29')](function(_0x41fbdf){if(_0x41fbdf){_0x225781=_0x41fbdf[_0xfc80('0x4d')];if(!_0x32abb3[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x5a6f54['limit']=qs[_0xfc80('0x1a')](_0x32abb3[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x5a6f54[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x32abb3[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x59d5db[_0xfc80('0xdd')](_0x5a6f54);}})[_0xfc80('0x29')](function(_0x38d5f8){if(_0x38d5f8){return _0x38d5f8?{'count':_0x225781,'rows':_0x38d5f8}:null;}})[_0xfc80('0x29')](respondWithResult(_0x3dce00,null))['catch'](handleError(_0x3dce00,null));};exports[_0xfc80('0xdf')]=function(_0x575833,_0x2a0f58){var _0x1757c3={};var _0x5d953b={};var _0x48157e;var _0x34cbac;return db['User']['findOne']({'where':{'id':_0x575833[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x2a0f58,null))[_0xfc80('0x29')](function(_0x22ecf1){if(_0x22ecf1){_0x48157e=_0x22ecf1;_0x5d953b['model']=_[_0xfc80('0xd2')](db['ChatGroup'][_0xfc80('0xde')]);_0x5d953b[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x575833[_0xfc80('0x43')]);_0x5d953b[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x5d953b[_0xfc80('0xd6')],_0x5d953b[_0xfc80('0x43')]);_0x1757c3[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x5d953b[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x575833[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x1757c3[_0xfc80('0x49')]=_0x1757c3['attributes'][_0xfc80('0x4d')]?_0x1757c3[_0xfc80('0x49')]:_0x5d953b[_0xfc80('0xd6')];_0x1757c3[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x575833[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x1757c3[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x575833[_0xfc80('0x43')],_0x5d953b[_0xfc80('0xd4')]));if(_0x575833[_0xfc80('0x43')]['filter']){_0x1757c3[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x1757c3[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x1757c3['attributes'],function(_0x541b89){var _0x3e8498={};_0x3e8498[_0x541b89]={'$like':'%'+_0x575833[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x3e8498;})});}_0x1757c3=_[_0xfc80('0xdc')]({},_0x1757c3,_0x575833[_0xfc80('0x59')]);return _0x48157e[_0xfc80('0xdf')](_0x1757c3);}})[_0xfc80('0x29')](function(_0x25fe97){if(_0x25fe97){_0x34cbac=_0x25fe97['length'];if(!_0x575833[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x1757c3[_0xfc80('0x1a')]=qs['limit'](_0x575833[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x1757c3[_0xfc80('0x1c')]=qs['offset'](_0x575833[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x48157e['getGroups'](_0x1757c3);}})[_0xfc80('0x29')](function(_0x33a91e){if(_0x33a91e){return _0x33a91e?{'count':_0x34cbac,'rows':_0x33a91e}:null;}})[_0xfc80('0x29')](respondWithResult(_0x2a0f58,null))['catch'](handleError(_0x2a0f58,null));};exports[_0xfc80('0xe0')]=function(_0x529efb,_0x5727d4){var _0x1cba45={'raw':!![],'where':{}};var _0x148cc9={};var _0x3c327a={'count':0x0,'rows':[]};return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x529efb[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x5727d4,null))['then'](function(_0x3016b6){if(_0x3016b6){_0x148cc9[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0xe1')][_0xfc80('0xde')]);_0x148cc9['query']=_['keys'](_0x529efb['query']);_0x148cc9['filters']=_[_0xfc80('0xd5')](_0x148cc9['model'],_0x148cc9[_0xfc80('0x43')]);_0x1cba45[_0xfc80('0x49')]=_['intersection'](_0x148cc9[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x529efb['query'][_0xfc80('0xd7')]));_0x1cba45[_0xfc80('0x49')]=_0x1cba45[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x1cba45[_0xfc80('0x49')]:_0x148cc9[_0xfc80('0xd6')];if(!_0x529efb['query'][_0xfc80('0xcb')]('nolimit')){_0x1cba45[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x529efb[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x1cba45['offset']=qs[_0xfc80('0x1c')](_0x529efb[_0xfc80('0x43')]['offset']);}_0x1cba45[_0xfc80('0xd8')]=qs['sort'](_0x529efb[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x1cba45[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x529efb[_0xfc80('0x43')],_0x148cc9[_0xfc80('0xd4')]));_0x1cba45[_0xfc80('0xda')]['UserId']=_0x3016b6['id'];if(_0x529efb[_0xfc80('0x43')][_0xfc80('0x33')]){_0x1cba45[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x1cba45[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x1cba45[_0xfc80('0x49')],function(_0xf930db){var _0x4e6d6c={};_0x4e6d6c[_0xf930db]={'$like':'%'+_0x529efb[_0xfc80('0x43')]['filter']+'%'};return _0x4e6d6c;})});}_0x1cba45=_[_0xfc80('0xdc')]({},_0x1cba45,_0x529efb[_0xfc80('0x59')]);return db[_0xfc80('0xe1')][_0xfc80('0x1b')]({'where':_0x1cba45[_0xfc80('0xda')]})['then'](function(_0x5c98e0){_0x3c327a[_0xfc80('0x1b')]=_0x5c98e0;if(_0x529efb[_0xfc80('0x43')]['includeAll']){_0x1cba45[_0xfc80('0x47')]=[{'all':!![]}];}return db['VoiceRecording'][_0xfc80('0xad')](_0x1cba45);})['then'](function(_0x48b5c0){_0x3c327a['rows']=_0x48b5c0;return _0x3c327a;});}})[_0xfc80('0x29')](respondWithFilteredResult(_0x5727d4,_0x1cba45))[_0xfc80('0x56')](handleError(_0x5727d4,null));};exports[_0xfc80('0xe2')]=function(_0x31d6d6,_0x1460fa){var _0x3dd384={'raw':!![],'where':{}};var _0x8c0d8f={};var _0x1cdbe4={'count':0x0,'rows':[]};return db['User'][_0xfc80('0x98')]({'where':{'id':_0x31d6d6[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x1460fa,null))[_0xfc80('0x29')](function(_0x3a4b89){if(_0x3a4b89){_0x8c0d8f[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xe3')][_0xfc80('0xde')]);_0x8c0d8f[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x31d6d6['query']);_0x8c0d8f[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x8c0d8f[_0xfc80('0xd6')],_0x8c0d8f[_0xfc80('0x43')]);_0x3dd384[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x8c0d8f[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x31d6d6['query']['fields']));_0x3dd384[_0xfc80('0x49')]=_0x3dd384['attributes'][_0xfc80('0x4d')]?_0x3dd384[_0xfc80('0x49')]:_0x8c0d8f[_0xfc80('0xd6')];if(!_0x31d6d6['query'][_0xfc80('0xcb')](_0xfc80('0xe4'))){_0x3dd384[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x31d6d6[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x3dd384[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x31d6d6[_0xfc80('0x43')]['offset']);}_0x3dd384[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x31d6d6[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x3dd384[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x31d6d6['query'],_0x8c0d8f[_0xfc80('0xd4')]));_0x3dd384[_0xfc80('0xda')][_0xfc80('0xe5')]=_0x3a4b89['id'];if(_0x31d6d6[_0xfc80('0x43')]['filter']){_0x3dd384[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x3dd384[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x3dd384['attributes'],function(_0x2259a5){var _0x71f18={};_0x71f18[_0x2259a5]={'$like':'%'+_0x31d6d6[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x71f18;})});}_0x3dd384=_['merge']({},_0x3dd384,_0x31d6d6[_0xfc80('0x59')]);return db['ScreenRecording'][_0xfc80('0x1b')]({'where':_0x3dd384[_0xfc80('0xda')]})[_0xfc80('0x29')](function(_0x5f2073){_0x1cdbe4[_0xfc80('0x1b')]=_0x5f2073;if(_0x31d6d6[_0xfc80('0x43')][_0xfc80('0x44')]){_0x3dd384[_0xfc80('0x47')]=[{'all':!![]}];}return db[_0xfc80('0xe3')][_0xfc80('0xad')](_0x3dd384);})['then'](function(_0x1c52e0){_0x1cdbe4[_0xfc80('0x4c')]=_0x1c52e0;return _0x1cdbe4;});}})[_0xfc80('0x29')](respondWithFilteredResult(_0x1460fa,_0x3dd384))['catch'](handleError(_0x1460fa,null));};exports[_0xfc80('0xe6')]=function(_0x2de0da,_0x140828){var _0x2e84cc={};var _0x34bceb={};var _0x5b59fa;var _0xefd370;return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x2de0da[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x140828,null))[_0xfc80('0x29')](function(_0x1a1aab){if(_0x1a1aab){_0x5b59fa=_0x1a1aab;_0x34bceb[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xe7')][_0xfc80('0xde')]);_0x34bceb[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x2de0da['query']);_0x34bceb['filters']=_['intersection'](_0x34bceb[_0xfc80('0xd6')],_0x34bceb['query']);_0x2e84cc['attributes']=_[_0xfc80('0xd5')](_0x34bceb[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x2de0da[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x2e84cc[_0xfc80('0x49')]=_0x2e84cc[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x2e84cc[_0xfc80('0x49')]:_0x34bceb[_0xfc80('0xd6')];_0x2e84cc[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x2de0da[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x2e84cc[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_['pick'](_0x2de0da[_0xfc80('0x43')],_0x34bceb[_0xfc80('0xd4')]));if(_0x2de0da[_0xfc80('0x43')]['filter']){_0x2e84cc['where']=_[_0xfc80('0xdc')](_0x2e84cc['where'],{'$or':_[_0xfc80('0x34')](_0x2e84cc['attributes'],function(_0x53dd2a){var _0x2a581e={};_0x2a581e[_0x53dd2a]={'$like':'%'+_0x2de0da['query'][_0xfc80('0x33')]+'%'};return _0x2a581e;})});}_0x2e84cc=_[_0xfc80('0xdc')]({},_0x2e84cc,_0x2de0da[_0xfc80('0x59')]);return _0x5b59fa[_0xfc80('0xe6')](_0x2e84cc);}})[_0xfc80('0x29')](function(_0x1be9e8){if(_0x1be9e8){_0xefd370=_0x1be9e8[_0xfc80('0x4d')];if(!_0x2de0da[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x2e84cc[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x2de0da[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x2e84cc[_0xfc80('0x1c')]=qs['offset'](_0x2de0da[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x5b59fa[_0xfc80('0xe6')](_0x2e84cc);}})[_0xfc80('0x29')](function(_0x57a458){if(_0x57a458){return _0x57a458?{'count':_0xefd370,'rows':_0x57a458}:null;}})['then'](respondWithResult(_0x140828,null))[_0xfc80('0x56')](handleError(_0x140828,null));};exports['getOpenchannelInteractions']=function(_0x2bb107,_0x467dbb){var _0x163983={};var _0x24db40={};var _0x3fc9d0;var _0x3b03fc;return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x2bb107[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x467dbb,null))['then'](function(_0x6a4a1a){if(_0x6a4a1a){_0x3fc9d0=_0x6a4a1a;_0x24db40[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0xe8')][_0xfc80('0xde')]);_0x24db40[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x2bb107[_0xfc80('0x43')]);_0x24db40['filters']=_[_0xfc80('0xd5')](_0x24db40[_0xfc80('0xd6')],_0x24db40[_0xfc80('0x43')]);_0x163983[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x24db40['model'],qs[_0xfc80('0xd7')](_0x2bb107[_0xfc80('0x43')]['fields']));_0x163983['attributes']=_0x163983[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x163983[_0xfc80('0x49')]:_0x24db40[_0xfc80('0xd6')];_0x163983[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x2bb107[_0xfc80('0x43')]['sort']);_0x163983[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x2bb107[_0xfc80('0x43')],_0x24db40[_0xfc80('0xd4')]));if(_0x2bb107[_0xfc80('0x43')]['filter']){_0x163983[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x163983[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x163983['attributes'],function(_0x36790c){var _0xddc9c5={};_0xddc9c5[_0x36790c]={'$like':'%'+_0x2bb107[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0xddc9c5;})});}_0x163983=_[_0xfc80('0xdc')]({},_0x163983,_0x2bb107['options']);return _0x3fc9d0[_0xfc80('0xe9')](_0x163983);}})['then'](function(_0x206c7c){if(_0x206c7c){_0x3b03fc=_0x206c7c[_0xfc80('0x4d')];if(!_0x2bb107[_0xfc80('0x43')][_0xfc80('0xcb')]('nolimit')){_0x163983[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x2bb107['query']['limit']);_0x163983['offset']=qs[_0xfc80('0x1c')](_0x2bb107[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x3fc9d0[_0xfc80('0xe9')](_0x163983);}})[_0xfc80('0x29')](function(_0x43471e){if(_0x43471e){return _0x43471e?{'count':_0x3b03fc,'rows':_0x43471e}:null;}})[_0xfc80('0x29')](respondWithResult(_0x467dbb,null))[_0xfc80('0x56')](handleError(_0x467dbb,null));};exports[_0xfc80('0xea')]=function(_0xa31f25,_0x3ed196){var _0x155186={'raw':!![],'where':{}};var _0x480756={};var _0x594207={'count':0x0,'rows':[]};return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0xa31f25[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x3ed196,null))['then'](function(_0x1b92ef){if(_0x1b92ef){_0x480756[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xeb')]['rawAttributes']);_0x480756['query']=_[_0xfc80('0xd2')](_0xa31f25['query']);_0x480756[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x480756['model'],_0x480756[_0xfc80('0x43')]);_0x155186[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x480756[_0xfc80('0xd6')],qs['fields'](_0xa31f25[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x155186[_0xfc80('0x49')]=_0x155186[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x155186[_0xfc80('0x49')]:_0x480756[_0xfc80('0xd6')];if(!_0xa31f25['query'][_0xfc80('0xcb')]('nolimit')){_0x155186[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0xa31f25['query'][_0xfc80('0x1a')]);_0x155186[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0xa31f25[_0xfc80('0x43')][_0xfc80('0x1c')]);}_0x155186[_0xfc80('0xd8')]=qs['sort'](_0xa31f25[_0xfc80('0x43')]['sort']);_0x155186[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0xa31f25[_0xfc80('0x43')],_0x480756[_0xfc80('0xd4')]));_0x155186[_0xfc80('0xda')][_0xfc80('0xe5')]=_0x1b92ef['id'];if(_0xa31f25[_0xfc80('0x43')][_0xfc80('0x33')]){_0x155186[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x155186['where'],{'$or':_[_0xfc80('0x34')](_0x155186['attributes'],function(_0x1305a1){var _0x542ae7={};_0x542ae7[_0x1305a1]={'$like':'%'+_0xa31f25[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x542ae7;})});}_0x155186=_[_0xfc80('0xdc')]({},_0x155186,_0xa31f25['options']);return db['MailInteraction'][_0xfc80('0x1b')]({'where':_0x155186[_0xfc80('0xda')]})['then'](function(_0x1814cb){_0x594207[_0xfc80('0x1b')]=_0x1814cb;if(_0xa31f25[_0xfc80('0x43')]['includeAll']){_0x155186['include']=[{'all':!![]}];}return db[_0xfc80('0xeb')]['findAll'](_0x155186);})[_0xfc80('0x29')](function(_0x58b18c){_0x594207[_0xfc80('0x4c')]=_0x58b18c;return _0x594207;});}})['then'](respondWithFilteredResult(_0x3ed196,_0x155186))['catch'](handleError(_0x3ed196,null));};exports['getSmsInteractions']=function(_0x2814ca,_0x262b85){var _0x3eb282={};var _0x3c96fe={};var _0x1903b9;var _0x556911;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x2814ca[_0xfc80('0x58')]['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x262b85,null))['then'](function(_0x28af72){if(_0x28af72){_0x1903b9=_0x28af72;_0x3c96fe[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db['SmsInteraction'][_0xfc80('0xde')]);_0x3c96fe[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x2814ca['query']);_0x3c96fe[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x3c96fe[_0xfc80('0xd6')],_0x3c96fe[_0xfc80('0x43')]);_0x3eb282[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x3c96fe[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x2814ca[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x3eb282['attributes']=_0x3eb282['attributes'][_0xfc80('0x4d')]?_0x3eb282[_0xfc80('0x49')]:_0x3c96fe[_0xfc80('0xd6')];_0x3eb282[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x2814ca[_0xfc80('0x43')]['sort']);_0x3eb282[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x2814ca[_0xfc80('0x43')],_0x3c96fe[_0xfc80('0xd4')]));if(_0x2814ca['query'][_0xfc80('0x33')]){_0x3eb282[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x3eb282[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x3eb282[_0xfc80('0x49')],function(_0x1ea376){var _0x1580c4={};_0x1580c4[_0x1ea376]={'$like':'%'+_0x2814ca['query']['filter']+'%'};return _0x1580c4;})});}_0x3eb282=_['merge']({},_0x3eb282,_0x2814ca['options']);return _0x1903b9[_0xfc80('0xec')](_0x3eb282);}})[_0xfc80('0x29')](function(_0x2f0ef6){if(_0x2f0ef6){_0x556911=_0x2f0ef6[_0xfc80('0x4d')];if(!_0x2814ca[_0xfc80('0x43')]['hasOwnProperty'](_0xfc80('0xe4'))){_0x3eb282[_0xfc80('0x1a')]=qs['limit'](_0x2814ca[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x3eb282['offset']=qs[_0xfc80('0x1c')](_0x2814ca['query'][_0xfc80('0x1c')]);}return _0x1903b9['getSmsInteractions'](_0x3eb282);}})['then'](function(_0x6d483d){if(_0x6d483d){return _0x6d483d?{'count':_0x556911,'rows':_0x6d483d}:null;}})[_0xfc80('0x29')](respondWithResult(_0x262b85,null))[_0xfc80('0x56')](handleError(_0x262b85,null));};exports[_0xfc80('0xed')]=function(_0x33375a,_0x44094c){var _0x5e178b={};var _0x141908={};var _0x4c8895;var _0x4987da;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x33375a['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x44094c,null))[_0xfc80('0x29')](function(_0x4b8a52){if(_0x4b8a52){_0x4c8895=_0x4b8a52;_0x141908['model']=_[_0xfc80('0xd2')](db['FaxInteraction'][_0xfc80('0xde')]);_0x141908[_0xfc80('0x43')]=_['keys'](_0x33375a[_0xfc80('0x43')]);_0x141908['filters']=_['intersection'](_0x141908[_0xfc80('0xd6')],_0x141908[_0xfc80('0x43')]);_0x5e178b[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x141908[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x33375a[_0xfc80('0x43')]['fields']));_0x5e178b['attributes']=_0x5e178b[_0xfc80('0x49')][_0xfc80('0x4d')]?_0x5e178b['attributes']:_0x141908[_0xfc80('0xd6')];_0x5e178b[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x33375a[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x5e178b[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x33375a[_0xfc80('0x43')],_0x141908[_0xfc80('0xd4')]));if(_0x33375a['query']['filter']){_0x5e178b[_0xfc80('0xda')]=_['merge'](_0x5e178b[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x5e178b[_0xfc80('0x49')],function(_0x566180){var _0x5c8098={};_0x5c8098[_0x566180]={'$like':'%'+_0x33375a[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x5c8098;})});}_0x5e178b=_[_0xfc80('0xdc')]({},_0x5e178b,_0x33375a['options']);return _0x4c8895[_0xfc80('0xed')](_0x5e178b);}})[_0xfc80('0x29')](function(_0x1a066b){if(_0x1a066b){_0x4987da=_0x1a066b['length'];if(!_0x33375a[_0xfc80('0x43')]['hasOwnProperty']('nolimit')){_0x5e178b[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x33375a['query'][_0xfc80('0x1a')]);_0x5e178b[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x33375a[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x4c8895['getFaxInteractions'](_0x5e178b);}})[_0xfc80('0x29')](function(_0x1af591){if(_0x1af591){return _0x1af591?{'count':_0x4987da,'rows':_0x1af591}:null;}})[_0xfc80('0x29')](respondWithResult(_0x44094c,null))[_0xfc80('0x56')](handleError(_0x44094c,null));};exports['getWhatsappInteractions']=function(_0x36ac3c,_0x4faa85){var _0x55c739={};var _0x784e1d={};var _0x1b3025;var _0x9397b1;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x36ac3c['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0x4faa85,null))[_0xfc80('0x29')](function(_0x1d6086){if(_0x1d6086){_0x1b3025=_0x1d6086;_0x784e1d['model']=_[_0xfc80('0xd2')](db[_0xfc80('0xee')][_0xfc80('0xde')]);_0x784e1d['query']=_['keys'](_0x36ac3c[_0xfc80('0x43')]);_0x784e1d[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x784e1d[_0xfc80('0xd6')],_0x784e1d[_0xfc80('0x43')]);_0x55c739[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x784e1d['model'],qs[_0xfc80('0xd7')](_0x36ac3c[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x55c739['attributes']=_0x55c739['attributes'][_0xfc80('0x4d')]?_0x55c739[_0xfc80('0x49')]:_0x784e1d[_0xfc80('0xd6')];_0x55c739['order']=qs[_0xfc80('0xd9')](_0x36ac3c[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x55c739[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x36ac3c[_0xfc80('0x43')],_0x784e1d[_0xfc80('0xd4')]));if(_0x36ac3c[_0xfc80('0x43')][_0xfc80('0x33')]){_0x55c739[_0xfc80('0xda')]=_['merge'](_0x55c739[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x55c739[_0xfc80('0x49')],function(_0x396f5d){var _0x3d8d71={};_0x3d8d71[_0x396f5d]={'$like':'%'+_0x36ac3c[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x3d8d71;})});}_0x55c739=_['merge']({},_0x55c739,_0x36ac3c[_0xfc80('0x59')]);return _0x1b3025['getWhatsappInteractions'](_0x55c739);}})[_0xfc80('0x29')](function(_0x40453d){if(_0x40453d){_0x9397b1=_0x40453d[_0xfc80('0x4d')];if(!_0x36ac3c[_0xfc80('0x43')]['hasOwnProperty'](_0xfc80('0xe4'))){_0x55c739[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x36ac3c[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x55c739[_0xfc80('0x1c')]=qs['offset'](_0x36ac3c[_0xfc80('0x43')]['offset']);}return _0x1b3025['getWhatsappInteractions'](_0x55c739);}})['then'](function(_0x438cac){if(_0x438cac){return _0x438cac?{'count':_0x9397b1,'rows':_0x438cac}:null;}})[_0xfc80('0x29')](respondWithResult(_0x4faa85,null))[_0xfc80('0x56')](handleError(_0x4faa85,null));};exports[_0xfc80('0xef')]=function(_0x17852f,_0x31c171,_0x368734){var _0x334c16;var _0x5df60b;var _0x330616;var _0x414bcd=!_['isNil'](_0x17852f[_0xfc80('0x58')]['id'])?_0x17852f['params']['id']:!_[_0xfc80('0x6a')](_0x17852f[_0xfc80('0x80')]['id'])?_0x17852f[_0xfc80('0x80')]['id']:null;return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x414bcd,'role':{'$or':[_0xfc80('0x2f'),'user',_0xfc80('0x2b')]}},'attributes':['id',_0xfc80('0x37'),'phone',_0xfc80('0xf0'),_0xfc80('0x2a'),'internal',_0xfc80('0x9e')]})[_0xfc80('0x29')](function(_0x2d6a9a){if(_0x2d6a9a){if(_0x2d6a9a[_0xfc80('0x2a')]===_0xfc80('0x2b')){_0x334c16=_0x2d6a9a;if(_0x17852f[_0xfc80('0x5c')]['interface']){_0x330616=util[_0xfc80('0xb0')](_0xfc80('0xf1'),_0x334c16[_0x17852f[_0xfc80('0x5c')][_0xfc80('0xa0')]]);}else if(_0x17852f['body'][_0xfc80('0xf2')]){_0x330616=util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x17852f[_0xfc80('0x5c')][_0xfc80('0xf2')]);}else{_0x330616=util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x334c16[_0xfc80('0x37')]);}socket['to'](util['format'](_0xfc80('0xf4'),_0x334c16['name']))[_0xfc80('0x2c')](_0xfc80('0xf5'),{'user':{'id':_0x334c16['id'],'name':_0x334c16[_0xfc80('0x37')]},'ip':_0x17852f[_0xfc80('0xf6')]['x-forwarded-for']||_0x17852f['connection'][_0xfc80('0xf7')]||_0x17852f['socket'][_0xfc80('0xf7')]||_0x17852f[_0xfc80('0xf8')][_0xfc80('0xf9')]['remoteAddress']});return db['UserVoiceQueueRt'][_0xfc80('0x2e')]({'where':{'membername':_0x334c16[_0xfc80('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xfc80('0x91'))]['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xfc80('0x29')](function(){if(_0x334c16){return _0x334c16[_0xfc80('0xfa')]({'raw':!![]});}})[_0xfc80('0x29')](function(_0x3f5ec5){if(_0x334c16){if(_0x3f5ec5){_0x5df60b=_0x3f5ec5;if(_0x5df60b[_0xfc80('0x4d')]){var _0x54dd86=_0x5df60b[_0xfc80('0x34')](function(_0x1484c3){var _0x1dba1f={'membername':_0x334c16[_0xfc80('0x37')],'UserId':_0x334c16['id'],'queue_name':_0x1484c3['name'],'VoiceQueueId':_0x1484c3['id'],'interface':_0x330616,'paused':_0x334c16[_0xfc80('0x9e')]||![],'penalty':_0x1484c3[_0xfc80('0xfb')]||0x0};return db[_0xfc80('0xb1')][_0xfc80('0xfc')](_0x1dba1f);});return Promise['all'](_0x54dd86);}}}})[_0xfc80('0x29')](function(){if(_0x334c16){return db[_0xfc80('0xfd')][_0xfc80('0xad')]({'where':{'membername':_0x334c16['name'],'exitAt':null}});}})[_0xfc80('0x29')](function(_0x20dbe0){if(_0x334c16){var _0x2eea30=[];_0x20dbe0[_0xfc80('0xfe')](function(_0x2f878a){_0x2eea30['push'](_0x2f878a['update']({'exitAt':moment()['format'](_0xfc80('0xff'))}));});return Promise[_0xfc80('0x55')](_0x2eea30);}})['then'](function(){if(_0x334c16){var _0x4f2340=[];var _0x4551f1=[];var _0x2405a0=utils[_0xfc80('0x100')]();var _0x2a8389={'membername':_0x334c16['name'],'interface':_0x330616,'enterAt':moment()[_0xfc80('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x334c16[_0xfc80('0x2a')],'internal':_0x334c16[_0xfc80('0x65')]};_0x2405a0[_0xfc80('0xfe')](function(_0x10a845){_0x4f2340['push'](_[_0xfc80('0xdc')]({'channel':_0x10a845,'type':'LOGIN','data1':_0x17852f[_0xfc80('0x5c')][_0xfc80('0x101')],'data2':_0x330616},_0x2a8389));if(_0x334c16['loginInPause']){_0x4551f1[_0xfc80('0x4e')](_['merge']({'channel':_0x10a845,'type':_0xfc80('0x102'),'data1':'LOGININPAUSE'},_0x2a8389));}});return db[_0xfc80('0xfd')][_0xfc80('0x89')](_0x4f2340[_0xfc80('0x103')](_0x4551f1),{'individualHooks':!![]});}})[_0xfc80('0x29')](function(){if(_0x334c16){return _0x334c16['update']({'online':!![],'lastLoginAt':moment()['format'](_0xfc80('0xff')),'voicePause':_0x334c16[_0xfc80('0x9e')]||![],'mailPause':_0x334c16[_0xfc80('0x9e')]||![],'chatPause':_0x334c16[_0xfc80('0x9e')]||![],'faxPause':_0x334c16[_0xfc80('0x9e')]||![],'smsPause':_0x334c16['loginInPause']||![],'openchannelPause':_0x334c16['loginInPause']||![],'whatsappPause':_0x334c16[_0xfc80('0x9e')]||![],'pauseType':_0x334c16[_0xfc80('0x9e')]?_0xfc80('0x104'):null,'interface':_0x330616,'lastPauseAt':moment()[_0xfc80('0xb0')](_0xfc80('0xff'))});}})['then'](function(_0xdf743e){if(_0x17852f[_0xfc80('0x105')]){return _0x368734();}else{return Promise[_0xfc80('0x106')](_0xdf743e)[_0xfc80('0x29')](respondWithResult(_0x31c171,null));}})[_0xfc80('0x56')](handleError(_0x31c171,null));};exports[_0xfc80('0x107')]=function(_0x10a53a,_0x43f529){var _0x1d81dd;return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x10a53a['params']['id'],'role':'agent'},'attributes':['id',_0xfc80('0x37'),'role']})[_0xfc80('0x29')](handleEntityNotFound(_0x43f529,null))[_0xfc80('0x29')](function(_0x31da8d){if(_0x31da8d){_0x1d81dd=_0x31da8d;return db[_0xfc80('0xb1')]['destroy']({'where':{'membername':_0x1d81dd['name']},'individualHooks':!![]});}})[_0xfc80('0x29')](function(){return db[_0xfc80('0xfd')][_0xfc80('0xad')]({'where':{'membername':_0x1d81dd['name'],'exitAt':null}});})[_0xfc80('0x29')](function(_0x5c083d){var _0x6b9c73=[];_0x5c083d['forEach'](function(_0x28b7d5){_0x6b9c73['push'](_0x28b7d5['update']({'exitAt':moment()['format'](_0xfc80('0xff'))}));});return Promise[_0xfc80('0x55')](_0x6b9c73);})[_0xfc80('0x29')](function(){return _0x1d81dd[_0xfc80('0x5b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xfc80('0x29')](respondWithResult(_0x43f529,null))[_0xfc80('0x56')](handleError(_0x43f529,null));};exports['pause']=function(_0x8eb37e,_0xa35b95){var _0x230846;return db[_0xfc80('0xb1')][_0xfc80('0x5b')]({'paused':0x1},{'where':{'UserId':_0x8eb37e['params']['id']},'individualHooks':!![]})[_0xfc80('0x29')](function(){return db[_0xfc80('0x4a')]['find']({'where':{'id':_0x8eb37e[_0xfc80('0x58')]['id'],'role':'agent'},'attributes':['id',_0xfc80('0x37'),_0xfc80('0x2a'),_0xfc80('0x65'),_0xfc80('0xa0'),_0xfc80('0xaf')]});})[_0xfc80('0x29')](handleEntityNotFound(_0xa35b95,null))[_0xfc80('0x29')](function(_0x160014){if(_0x160014){_0x230846=_0x160014;return respondWithRpcPromise(_0xfc80('0x108'),_0xfc80('0x109'),{'id':_0x230846['id'],'name':_0x230846['name'],'pause':!![]});}})[_0xfc80('0x29')](function(){if(_0x230846){return db['MemberReport'][_0xfc80('0xad')]({'where':{'membername':_0x230846[_0xfc80('0x37')],'type':_0xfc80('0x102'),'exitAt':null}});}})[_0xfc80('0x29')](function(_0x1cbabd){if(_0x1cbabd['length']){var _0x21bb58=moment()[_0xfc80('0xb0')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3be4a1=0x0,_0x215d09=_0x1cbabd[_0xfc80('0x4d')];_0x3be4a1<_0x215d09;_0x3be4a1++){_0x1cbabd[_0x3be4a1][_0xfc80('0x10a')]({'exitAt':_0x21bb58});}}})[_0xfc80('0x29')](function(){var _0x596d6a=[];var _0x2f5e28=utils[_0xfc80('0x100')]();_0x2f5e28[_0xfc80('0xfe')](function(_0x2d01c8){_0x596d6a['push']({'channel':_0x2d01c8,'membername':_0x230846[_0xfc80('0x37')],'interface':_[_0xfc80('0x6a')](_0x230846[_0xfc80('0xa0')])?util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x230846['name']):_0x230846[_0xfc80('0xa0')],'type':_0xfc80('0x102'),'enterAt':moment()[_0xfc80('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x8eb37e[_0xfc80('0x5c')][_0xfc80('0x10b')]||_0xfc80('0x10c'),'role':_0x230846[_0xfc80('0x2a')],'internal':_0x230846[_0xfc80('0x65')]});});return db[_0xfc80('0xfd')]['bulkCreate'](_0x596d6a,{'individualHooks':!![]});})['then'](function(){return _0x230846[_0xfc80('0x5b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x8eb37e['body'][_0xfc80('0x10b')]||_0xfc80('0x10c'),'lastPauseAt':moment()[_0xfc80('0xb0')](_0xfc80('0xff'))});})[_0xfc80('0x29')](respondWithResult(_0xa35b95,null))[_0xfc80('0x56')](handleError(_0xa35b95,null));};exports[_0xfc80('0x10d')]=function(_0x5b6439,_0x5b0814){if(_0x5b6439['body'][_0xfc80('0x9d')]&&!utils[_0xfc80('0xa1')](_0x5b6439[_0xfc80('0x5c')]['channel'])){throw new APIBadRequestError(util[_0xfc80('0xb0')](_0xfc80('0x10e'),_0x5b6439['body']['channel']));}return db[_0xfc80('0x4a')][_0xfc80('0x36')]({'where':{'id':_0x5b6439[_0xfc80('0x58')]['id']},'attributes':['id','name','role',_0xfc80('0x65'),_0xfc80('0xa0'),'online','voicePause','mailPause',_0xfc80('0x10f'),_0xfc80('0x110'),_0xfc80('0x111'),_0xfc80('0x112'),_0xfc80('0x113'),'pauseType',_0xfc80('0x114')]})[_0xfc80('0x29')](function(_0x8e4bd4){if(!_0x8e4bd4){throw new APINotFoundError(util[_0xfc80('0xb0')](_0xfc80('0x115'),_0x5b6439[_0xfc80('0x58')]['id']));}return _0x8e4bd4['unpause'](_0x5b6439[_0xfc80('0x5c')][_0xfc80('0x9d')]);})['then'](respondWithResult(_0x5b0814,null))['catch'](APIHandleError(_0x5b0814));};exports['getTeams']=function(_0x179199,_0xad7eaa){var _0x37e5b2={};var _0x5e5607={};var _0x3a7863;var _0x1cb284;return db[_0xfc80('0x4a')]['findOne']({'where':{'id':_0x179199['params']['id']}})[_0xfc80('0x29')](handleEntityNotFound(_0xad7eaa,null))[_0xfc80('0x29')](function(_0x10a93a){if(_0x10a93a){_0x3a7863=_0x10a93a;_0x5e5607[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0x116')][_0xfc80('0xde')]);_0x5e5607[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x179199[_0xfc80('0x43')]);_0x5e5607[_0xfc80('0xd4')]=_[_0xfc80('0xd5')](_0x5e5607['model'],_0x5e5607[_0xfc80('0x43')]);_0x37e5b2[_0xfc80('0x49')]=_['intersection'](_0x5e5607['model'],qs[_0xfc80('0xd7')](_0x179199[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x37e5b2[_0xfc80('0x49')]=_0x37e5b2[_0xfc80('0x49')]['length']?_0x37e5b2[_0xfc80('0x49')]:_0x5e5607[_0xfc80('0xd6')];_0x37e5b2['order']=qs[_0xfc80('0xd9')](_0x179199[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x37e5b2[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x179199[_0xfc80('0x43')],_0x5e5607[_0xfc80('0xd4')]));if(_0x179199[_0xfc80('0x43')]['filter']){_0x37e5b2[_0xfc80('0xda')]=_['merge'](_0x37e5b2['where'],{'$or':_[_0xfc80('0x34')](_0x37e5b2[_0xfc80('0x49')],function(_0x3c090a){var _0x2281ba={};_0x2281ba[_0x3c090a]={'$like':'%'+_0x179199[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x2281ba;})});}_0x37e5b2=_[_0xfc80('0xdc')]({},_0x37e5b2,_0x179199[_0xfc80('0x59')]);return _0x3a7863['getTeams'](_0x37e5b2);}})[_0xfc80('0x29')](function(_0x586ec4){if(_0x586ec4){_0x1cb284=_0x586ec4[_0xfc80('0x4d')];if(!_0x179199[_0xfc80('0x43')][_0xfc80('0xcb')](_0xfc80('0xe4'))){_0x37e5b2[_0xfc80('0x1a')]=qs['limit'](_0x179199['query'][_0xfc80('0x1a')]);_0x37e5b2[_0xfc80('0x1c')]=qs[_0xfc80('0x1c')](_0x179199[_0xfc80('0x43')][_0xfc80('0x1c')]);}return _0x3a7863['getTeams'](_0x37e5b2);}})[_0xfc80('0x29')](function(_0x3b5edb){if(_0x3b5edb){return _0x3b5edb?{'count':_0x1cb284,'rows':_0x3b5edb}:null;}})[_0xfc80('0x29')](respondWithResult(_0xad7eaa,null))['catch'](handleError(_0xad7eaa,null));};exports[_0xfc80('0x117')]=function(_0x2d1a5f,_0x7f602e){var _0xa1b88f=_0x2d1a5f['params']['id'];var _0x2f884b=_0x2d1a5f['body']?_0x2d1a5f['body']['ids']:null;var _0x135e06=[];return Promise['resolve']()[_0xfc80('0x29')](function(){if(!_0x2f884b)throw new APIBadRequestError(_0xfc80('0x118'));})['then'](function(){return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0xa1b88f}});})[_0xfc80('0x29')](function(_0x4e6480){if(!_0x4e6480)throw new APINotFoundError(util[_0xfc80('0xb0')](_0xfc80('0x115'),_0x2d1a5f[_0xfc80('0x58')]['id']));return db['sequelize'][_0xfc80('0x119')](function(_0x1372ed){return _0x4e6480[_0xfc80('0x117')](_0x2f884b,{'transaction':_0x1372ed})['then'](function(){return db[_0xfc80('0x116')][_0xfc80('0xad')]({'where':{'id':{'$in':_0x2f884b}}});})['then'](function(_0x27c551){var _0xd45e6f=_[_0xfc80('0x34')](_0x27c551,function(_0x32c349){return _0x32c349[_0xfc80('0x11a')]();});return Promise[_0xfc80('0x55')](_0xd45e6f);})[_0xfc80('0x29')](function(_0x4938e3){_0x135e06=_['flattenDeep'](_0x4938e3);var _0x5c19d3=_[_0xfc80('0x34')](_0x135e06,function(_0x4e697d){return _0x4e697d[_0xfc80('0x11b')](_0x4e6480['id'],{'transaction':_0x1372ed});});return Promise[_0xfc80('0x55')](_0x5c19d3);})['then'](function(){if(!_0x4e6480[_0xfc80('0xaf')])return;var _0x515d7f=_[_0xfc80('0x33')](_0x135e06,function(_0x43d07e){return _0x43d07e[_0xfc80('0x11c')](_0xfc80('0x9d'))===_0xfc80('0x11d');});var _0x2b272e=_['map'](_0x515d7f,function(_0x56072b){return db[_0xfc80('0xb1')][_0xfc80('0xfc')]({'membername':_0x4e6480[_0xfc80('0x37')],'UserId':_0x4e6480['id'],'queue_name':_0x56072b[_0xfc80('0x37')],'VoiceQueueId':_0x56072b['id'],'interface':_[_0xfc80('0x6a')](_0x4e6480[_0xfc80('0xa0')])?util[_0xfc80('0xb0')](_0xfc80('0xf3'),_0x4e6480[_0xfc80('0x37')]):_0x4e6480['interface'],'paused':_0x4e6480[_0xfc80('0x9f')]||![],'penalty':_0x4e6480[_0xfc80('0xa7')]},{'transaction':_0x1372ed});});return Promise[_0xfc80('0x55')](_0x2b272e);})[_0xfc80('0x29')](function(){return db[_0xfc80('0x11e')]['findAll']({'where':{'teamId':{'$in':_0x2f884b}}});})[_0xfc80('0x29')](function(_0x41dec0){var _0x213df4=_[_0xfc80('0x34')](_0x41dec0,function(_0x4790b4){return db['UserVoicePrefix'][_0xfc80('0x7f')]({'UserId':_0x4e6480['id'],'VoicePrefixId':_0x4790b4[_0xfc80('0x11f')]},{'transaction':_0x1372ed});});return Promise[_0xfc80('0x55')](_0x213df4);});});})[_0xfc80('0x29')](function(){for(var _0x409d31=0x0;_0x409d31<_0x135e06['length'];_0x409d31++){var _0x10c0f5=_0x135e06[_0x409d31][_0xfc80('0x11c')](_0xfc80('0x9d'));var _0x22c3af=_0x10c0f5+'QueueId';socket[_0xfc80('0x2c')]('user'+_0x10c0f5+_0xfc80('0xab'),{'UserId':_0xa1b88f,['queueField']:_0x135e06[_0x409d31]['id']});}})['then'](respondWithStatusCode(_0x7f602e,null))[_0xfc80('0x56')](APIHandleError(_0x7f602e));};exports[_0xfc80('0x120')]=function(_0x3827cc,_0x4a56b7){var _0x9445f6=_0x3827cc['params']['id'];var _0x3c9d90=null;if(_0x3827cc[_0xfc80('0x43')][_0xfc80('0xa6')]){_0x3c9d90=_[_0xfc80('0xb4')](_0x3827cc[_0xfc80('0x43')]['ids'])?_0x3827cc['query'][_0xfc80('0xa6')]:[_0x3827cc[_0xfc80('0x43')][_0xfc80('0xa6')]];}var _0x336072=[];return Promise[_0xfc80('0x106')]()['then'](function(){if(!_0x3c9d90)throw new APIBadRequestError(_0xfc80('0x121'));})[_0xfc80('0x29')](function(){return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x9445f6}});})[_0xfc80('0x29')](function(_0x2eb96c){if(!_0x2eb96c)throw new APINotFoundError(util[_0xfc80('0xb0')](_0xfc80('0x115'),_0x3827cc[_0xfc80('0x58')]['id']));return db['sequelize'][_0xfc80('0x119')](function(_0x337109){return _0x2eb96c[_0xfc80('0x120')](_0x3c9d90,{'transaction':_0x337109})[_0xfc80('0x29')](function(){return db[_0xfc80('0x116')][_0xfc80('0xad')]({'where':{'id':{'$in':_0x3c9d90}}});})[_0xfc80('0x29')](function(_0x2e9636){var _0x14c66f=_['map'](_0x2e9636,function(_0x479f81){return _0x479f81['getAssociatedQueues']();});return Promise['all'](_0x14c66f);})['then'](function(_0x6df053){_0x336072=_[_0xfc80('0x122')](_0x6df053);var _0x51cd2c=_[_0xfc80('0x34')](_0x336072,function(_0x5b4cbd){return _0x5b4cbd['removeAgent'](_0x2eb96c['id'],{'transaction':_0x337109});});return Promise[_0xfc80('0x55')](_0x51cd2c);})[_0xfc80('0x29')](function(){if(!_0x2eb96c[_0xfc80('0xaf')])return;var _0x47ebba=_[_0xfc80('0x33')](_0x336072,function(_0x4f0bcb){return _0x4f0bcb[_0xfc80('0x11c')](_0xfc80('0x9d'))===_0xfc80('0x11d');});var _0x43be43=_[_0xfc80('0x34')](_0x47ebba,function(_0x54d1be){return db['UserVoiceQueueRt'][_0xfc80('0x2e')]({'where':{'VoiceQueueId':_0x54d1be['id'],'UserId':_0x2eb96c['id']},'transaction':_0x337109});});return Promise['all'](_0x43be43);})[_0xfc80('0x29')](function(){return db['TeamVoicePrefix'][_0xfc80('0xad')]({'where':{'teamId':{'$in':_0x3c9d90}}});})[_0xfc80('0x29')](function(_0x33c0e1){var _0x31c6da=_[_0xfc80('0x34')](_0x33c0e1,function(_0x287c24){return db[_0xfc80('0x123')][_0xfc80('0x2e')]({'where':{'UserId':_0x2eb96c['id'],'VoicePrefixId':_0x287c24['VoicePrefixId']}},{'transaction':_0x337109});});return Promise[_0xfc80('0x55')](_0x31c6da);});});})[_0xfc80('0x29')](function(){for(var _0x141a82=0x0;_0x141a82<_0x336072[_0xfc80('0x4d')];_0x141a82++){var _0x491eac=_0x336072[_0x141a82][_0xfc80('0x11c')]('channel');var _0x4514dd=_0x491eac+'QueueId';socket['emit']('user'+_0x491eac+_0xfc80('0xb5'),{'UserId':_0x9445f6,['queueField']:_0x336072[_0x141a82]['id']});}})['then'](respondWithStatusCode(_0x4a56b7,null))[_0xfc80('0x56')](APIHandleError(_0x4a56b7));};exports['getLists']=function(_0x11787c,_0x5a3d15){var _0x4d124b={};var _0x327226={};var _0x2984be;var _0x367fb0;return db['User'][_0xfc80('0x98')]({'where':{'id':_0x11787c['params']['id']}})['then'](handleEntityNotFound(_0x5a3d15,null))[_0xfc80('0x29')](function(_0x485ba4){if(_0x485ba4){_0x2984be=_0x485ba4;_0x327226[_0xfc80('0xd6')]=_[_0xfc80('0xd2')](db[_0xfc80('0xcc')][_0xfc80('0xde')]);_0x327226['query']=_['keys'](_0x11787c['query']);_0x327226[_0xfc80('0xd4')]=_['intersection'](_0x327226[_0xfc80('0xd6')],_0x327226['query']);_0x4d124b['attributes']=_[_0xfc80('0xd5')](_0x327226[_0xfc80('0xd6')],qs[_0xfc80('0xd7')](_0x11787c['query'][_0xfc80('0xd7')]));_0x4d124b['attributes']=_0x4d124b['attributes'][_0xfc80('0x4d')]?_0x4d124b['attributes']:_0x327226[_0xfc80('0xd6')];_0x4d124b[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x11787c[_0xfc80('0x43')][_0xfc80('0xd9')]);_0x4d124b['where']=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x11787c[_0xfc80('0x43')],_0x327226[_0xfc80('0xd4')]));if(_0x11787c[_0xfc80('0x43')][_0xfc80('0x33')]){_0x4d124b[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x4d124b[_0xfc80('0xda')],{'$or':_[_0xfc80('0x34')](_0x4d124b[_0xfc80('0x49')],function(_0xa26af0){var _0x52708e={};_0x52708e[_0xa26af0]={'$like':'%'+_0x11787c[_0xfc80('0x43')][_0xfc80('0x33')]+'%'};return _0x52708e;})});}_0x4d124b=_[_0xfc80('0xdc')]({},_0x4d124b,_0x11787c[_0xfc80('0x59')]);return _0x2984be[_0xfc80('0x124')](_0x4d124b);}})[_0xfc80('0x29')](function(_0x5b6e61){if(_0x5b6e61){_0x367fb0=_0x5b6e61['length'];if(!_0x11787c[_0xfc80('0x43')][_0xfc80('0xcb')](_0xfc80('0xe4'))){_0x4d124b[_0xfc80('0x1a')]=qs[_0xfc80('0x1a')](_0x11787c[_0xfc80('0x43')][_0xfc80('0x1a')]);_0x4d124b[_0xfc80('0x1c')]=qs['offset'](_0x11787c['query'][_0xfc80('0x1c')]);}return _0x2984be[_0xfc80('0x124')](_0x4d124b);}})[_0xfc80('0x29')](function(_0x48f98b){if(_0x48f98b){return _0x48f98b?{'count':_0x367fb0,'rows':_0x48f98b}:null;}})[_0xfc80('0x29')](respondWithResult(_0x5a3d15,null))[_0xfc80('0x56')](handleError(_0x5a3d15,null));};exports[_0xfc80('0x125')]=function(_0x251c77,_0x2d79d7){var _0x2226a6={};var _0x57264d={};var _0x3f5ef9;return db[_0xfc80('0x4a')][_0xfc80('0x98')]({'where':{'id':_0x251c77[_0xfc80('0x58')]['id']}})['then'](handleEntityNotFound(_0x2d79d7,null))[_0xfc80('0x29')](function(_0x58c163){if(_0x58c163){_0x3f5ef9=_0x58c163;_0x57264d[_0xfc80('0xd6')]=_['keys'](db[_0xfc80('0x4a')][_0xfc80('0xde')]);_0x57264d[_0xfc80('0x43')]=_[_0xfc80('0xd2')](_0x251c77['query']);_0x57264d[_0xfc80('0xd4')]=_['intersection'](_0x57264d[_0xfc80('0xd6')],_0x57264d['query']);_0x2226a6[_0xfc80('0x49')]=_[_0xfc80('0xd5')](_0x57264d[_0xfc80('0xd6')],qs['fields'](_0x251c77[_0xfc80('0x43')][_0xfc80('0xd7')]));_0x2226a6[_0xfc80('0x49')]=_0x2226a6['attributes'][_0xfc80('0x4d')]?_0x2226a6[_0xfc80('0x49')]:_0x57264d[_0xfc80('0xd6')];_0x2226a6[_0xfc80('0xd8')]=qs[_0xfc80('0xd9')](_0x251c77[_0xfc80('0x43')]['sort']);_0x2226a6[_0xfc80('0xda')]=qs[_0xfc80('0xd4')](_[_0xfc80('0xdb')](_0x251c77['query'],_0x57264d[_0xfc80('0xd4')]));if(_0x251c77['query'][_0xfc80('0x33')]){_0x2226a6[_0xfc80('0xda')]=_[_0xfc80('0xdc')](_0x2226a6['where'],{'$or':_['map'](_0x2226a6['attributes'],function(_0x8ee9d6){var _0x3fe4bb={};_0x3fe4bb[_0x8ee9d6]={'$like':'%'+_0x251c77[_0xfc80('0x43')]['filter']+'%'};return _0x3fe4bb;})});}_0x2226a6['model']=db['User'];_0x2226a6['as']='Agents';_0x2226a6=_[_0xfc80('0xdc')]({},_0x2226a6,_0x251c77[_0xfc80('0x59')]);return _0x3f5ef9[_0xfc80('0xfa')]({'include':[_0x2226a6]});}})['then'](function(_0x416c04){if(_0x416c04){var _0xdf99cb={},_0x503c7e=[];for(var _0x52648a=0x0;_0x52648a<_0x416c04[_0xfc80('0x4d')];_0x52648a+=0x1){for(var _0x55cccc=0x0,_0x43bf2b;_0x55cccc<_0x416c04[_0x52648a][_0xfc80('0x30')][_0xfc80('0x4d')];_0x55cccc+=0x1){_0x43bf2b=_0x416c04[_0x52648a]['Agents'][_0x55cccc][_0xfc80('0xae')]({'plain':!![]});_0xdf99cb[_0x43bf2b['id']]=_0x43bf2b;}}_0xdf99cb=_[_0xfc80('0x126')](_0xdf99cb);for(var _0xb12453=qs[_0xfc80('0x1c')](_0x251c77[_0xfc80('0x43')][_0xfc80('0x1c')]);_0xb12453<_0xdf99cb[_0xfc80('0x4d')]&&_0x503c7e['length']=_0x19ab87){_0x5f59a8=_0x19ab87;_0x3ff559=0xc8;}else{_0x3ff559=0xce;}_0x28009a[_0xdde3('0x1a')](_0x3ff559);return _0x28009a['set'](_0xdde3('0x1f'),_0x2ae1e5+'-'+_0x5f59a8+'/'+_0x19ab87)['json'](_0x26b3be);}return null;};}function respondWithRpcPromise(_0xe0d169,_0xebbccf,_0xa24ccf,_0x2e2547){return new Promise(function(_0x390baf,_0x303814){var _0x1644f2=_0x2e2547||amiClient;return _0x1644f2[_0xdde3('0x20')](_0xe0d169,_0xa24ccf)[_0xdde3('0x21')](function(_0x2f2b19){logger[_0xdde3('0x22')](_0xdde3('0x23'),_0xebbccf,_0xdde3('0x24'));logger['debug'](_0xdde3('0x25'),_0xebbccf,_0xdde3('0x24'),JSON[_0xdde3('0x26')](_0x2f2b19));if(_0x2f2b19[_0xdde3('0x27')]){if(_0x2f2b19[_0xdde3('0x27')]['code']===0x1f4){logger['error'](_0xdde3('0x23'),_0xebbccf,_0x2f2b19[_0xdde3('0x27')][_0xdde3('0x28')]);return _0x303814(_0x2f2b19['error']['message']);}logger['error'](_0xdde3('0x23'),_0xebbccf,_0x2f2b19['error']['message']);return _0x390baf(_0x2f2b19[_0xdde3('0x27')][_0xdde3('0x28')]);}else{logger['info']('User,\x20%s,\x20%s',_0xebbccf,_0xdde3('0x24'));_0x390baf(_0x2f2b19[_0xdde3('0x29')][_0xdde3('0x28')]);}})['catch'](function(_0x1b164c){logger[_0xdde3('0x27')](_0xdde3('0x23'),_0xebbccf,_0x1b164c);_0x303814(_0x1b164c);});});}function saveUpdates(_0x4d7518){return function(_0x4fa952){if(_0x4fa952){return _0x4fa952[_0xdde3('0x2a')](_0x4d7518)['then'](function(_0x4a0a21){if(_0x4a0a21[_0xdde3('0x2b')]===_0xdde3('0x2c')){socket[_0xdde3('0x2d')](_0xdde3('0x2e')+_0x4a0a21['id'],_0x4a0a21);}return _0x4a0a21;});}return null;};}function removeEntity(_0x2b85d1,_0x26278d){return function(_0x5af305){if(_0x5af305){return _0x5af305['destroy']({'transaction':_0x26278d})['then'](function(){var _0x64aeeb=_0x5af305[_0xdde3('0x2f')]({'plain':!![]});if(_0x64aeeb[_0xdde3('0x2b')]==='admin')return;var _0x2c87cd=[{'name':_0xdde3('0x30'),'value':_0xdde3('0x31'),'ignore':!![]},{'name':_0xdde3('0x32'),'value':_0xdde3('0x2c'),'ignore':![]},{'name':_0xdde3('0x33'),'value':'telephone','ignore':![]}];var _0x7be356=_(_0x2c87cd)['filter'](_0xdde3('0x34'))[_0xdde3('0x35')](_0xdde3('0x36'))[_0xdde3('0x36')]();if(_[_0xdde3('0x37')](_0x7be356,_0x64aeeb['role'])){return;}var _0x441682=_['find'](_0x2c87cd,[_0xdde3('0x36'),_0x64aeeb[_0xdde3('0x2b')]])[_0xdde3('0x38')];return db[_0xdde3('0x39')][_0xdde3('0x3a')]({'where':{'type':_0x441682,'resourceId':_0x64aeeb['id']},'transaction':_0x26278d})['then'](function(){return _0x5af305;});})[_0xdde3('0x21')](function(){_0x2b85d1[_0xdde3('0x1a')](0xcc)[_0xdde3('0x3b')]();});}};}function handleEntityNotFound(_0x47c2f1){return function(_0x4254a6){if(!_0x4254a6){_0x47c2f1['sendStatus'](0x194);}return _0x4254a6;};}function handleError(_0x3b73f4,_0x3a0899){_0x3a0899=_0x3a0899||0x1f4;return function(_0x56acd8){logger[_0xdde3('0x27')](_0x56acd8[_0xdde3('0x3c')]);if(_0x56acd8['name']){delete _0x56acd8['name'];}_0x3b73f4[_0xdde3('0x1a')](_0x3a0899)[_0xdde3('0x3d')](_0x56acd8);};}function getUserAttributes(){return _(db['User'][_0xdde3('0x3e')])[_0xdde3('0x35')](function(_0x241d3d){return{'name':_0x241d3d['fieldName'],'type':_0x241d3d[_0xdde3('0x3f')][_0xdde3('0x40')]};})[_0xdde3('0x41')](function(_0x1afb7c){return![_0xdde3('0x42'),_0xdde3('0x43'),_0xdde3('0x44'),_0xdde3('0x45'),_0xdde3('0x46'),'md5secret'][_0xdde3('0x37')](_0x1afb7c['name']);})[_0xdde3('0x36')]();}exports['index']=function(_0x19b966,_0x240821){var _0x14cfe0={},_0x527363={'count':0x0,'rows':[]};var _0x120149=getUserAttributes();_0x14cfe0=qs[_0xdde3('0x47')](_0x120149,_0x19b966);var _0x3037cc={'where':_0x14cfe0['where']};return db[_0xdde3('0x48')]['count'](_0x3037cc)[_0xdde3('0x21')](function(_0x307204){_0x527363[_0xdde3('0x1e')]=_0x307204;if(_0x19b966['query'][_0xdde3('0x49')]){_0x14cfe0[_0xdde3('0x4a')]=[{'all':!![]}];}if(_0x19b966[_0xdde3('0x4b')][_0xdde3('0x4c')]===_0xdde3('0x4d')){_0x14cfe0['include']=[{'model':db[_0xdde3('0x4e')],'as':_0xdde3('0x4c')}];}if(!_[_0xdde3('0x37')](_0x14cfe0['attributes'],'id')){_0x14cfe0[_0xdde3('0x4f')][_0xdde3('0x50')]('id');}return db[_0xdde3('0x48')][_0xdde3('0x51')](_0x14cfe0);})[_0xdde3('0x21')](function(_0x32bef0){_0x527363['rows']=_0x32bef0;if(_0x19b966[_0xdde3('0x4b')][_0xdde3('0x52')]==='true'){var _0x41c6f2=[];for(var _0x3b29c6=0x0;_0x3b29c6<_0x527363['rows']['length'];_0x3b29c6++){_0x41c6f2['push'](get_open_tabs(_0xdde3('0x53'),_0x527363[_0xdde3('0x54')][_0x3b29c6]['dataValues']));_0x41c6f2[_0xdde3('0x50')](get_open_tabs('sms',_0x527363[_0xdde3('0x54')][_0x3b29c6]['dataValues']));_0x41c6f2[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x55'),_0x527363['rows'][_0x3b29c6][_0xdde3('0x56')]));_0x41c6f2[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x57'),_0x527363['rows'][_0x3b29c6][_0xdde3('0x56')]));_0x41c6f2[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x58'),_0x527363[_0xdde3('0x54')][_0x3b29c6]['dataValues']));_0x41c6f2[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x59'),_0x527363[_0xdde3('0x54')][_0x3b29c6][_0xdde3('0x56')]));}return Promise['all'](_0x41c6f2)[_0xdde3('0x21')](function(){return _0x527363;});}else{return _0x527363;}})[_0xdde3('0x21')](respondWithFilteredResult(_0x240821,_0x14cfe0))[_0xdde3('0x5a')](handleError(_0x240821,null));};exports[_0xdde3('0x5b')]=function(_0x28f5e3,_0x318c4b){var _0x1a4d3b=getUserAttributes();_0x28f5e3['query']['id']=_0x28f5e3[_0xdde3('0x5c')]['id'];var _0x5b3df0=qs[_0xdde3('0x47')](_0x1a4d3b,_0x28f5e3);if(_0x28f5e3[_0xdde3('0x4b')][_0xdde3('0x49')]){_0x5b3df0[_0xdde3('0x4a')]=[{'all':!![]}];}if(_0x28f5e3[_0xdde3('0x4b')][_0xdde3('0x4c')]===_0xdde3('0x4d')){_0x5b3df0[_0xdde3('0x4a')]=[{'model':db[_0xdde3('0x4e')],'as':_0xdde3('0x4c')}];}_0x5b3df0=_['merge']({},_0x5b3df0,_0x28f5e3[_0xdde3('0x5d')]);if(!_['includes'](_0x5b3df0[_0xdde3('0x4f')],'id')){_0x5b3df0['attributes'][_0xdde3('0x50')]('id');}return db[_0xdde3('0x48')]['find'](_0x5b3df0)[_0xdde3('0x21')](handleEntityNotFound(_0x318c4b,null))[_0xdde3('0x21')](function(_0x5bd3f1){var _0xceafd6=[];values=_0x5bd3f1;if(_0x28f5e3[_0xdde3('0x4b')]['openTabs']===_0xdde3('0x4d')){_0xceafd6['push'](get_open_tabs('chat',_0x5bd3f1['dataValues']));_0xceafd6[_0xdde3('0x50')](get_open_tabs('sms',_0x5bd3f1[_0xdde3('0x56')]));_0xceafd6[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x58'),_0x5bd3f1['dataValues']));_0xceafd6['push'](get_open_tabs(_0xdde3('0x59'),_0x5bd3f1['dataValues']));_0xceafd6[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x55'),_0x5bd3f1[_0xdde3('0x56')]));_0xceafd6[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x57'),_0x5bd3f1[_0xdde3('0x56')]));return Promise[_0xdde3('0x5e')](_0xceafd6);}else{return values;}})[_0xdde3('0x21')](function(){return values;})['then'](respondWithResult(_0x318c4b,null))[_0xdde3('0x5a')](handleError(_0x318c4b,null));};exports[_0xdde3('0x2a')]=function(_0x21e8a8,_0xff0c68){if(_0x21e8a8[_0xdde3('0x5f')]['id']){delete _0x21e8a8[_0xdde3('0x5f')]['id'];}delete _0x21e8a8[_0xdde3('0x5f')][_0xdde3('0x2b')];return db['User'][_0xdde3('0x60')]({'where':{'id':_0x21e8a8[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0xff0c68,null))['then'](saveUpdates(_0x21e8a8[_0xdde3('0x5f')],null))['then'](respondWithResult(_0xff0c68,null))['catch'](handleError(_0xff0c68,null));};exports[_0xdde3('0x61')]=function(_0x3a36a3,_0x38e3d1){return db['User'][_0xdde3('0x61')]()[_0xdde3('0x21')](respondWithResult(_0x38e3d1,null))[_0xdde3('0x5a')](handleError(_0x38e3d1,null));};exports[_0xdde3('0x62')]=function(_0x505c68,_0x3561a4){return db[_0xdde3('0x48')][_0xdde3('0x60')]({'where':{'id':_0x505c68[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x3561a4,null))[_0xdde3('0x21')](function(_0x4c2262){if(_0x4c2262){return _0x4c2262[_0xdde3('0x62')](_0x505c68[_0xdde3('0x5f')][_0xdde3('0x63')],_[_0xdde3('0x64')](_0x505c68[_0xdde3('0x5f')],[_0xdde3('0x63'),'id'])||{});}})[_0xdde3('0x21')](respondWithResult(_0x3561a4,null))['catch'](handleError(_0x3561a4,null));};function validateUser(_0x4db6ab){return new Promise(function(_0x2dbf1f,_0xfbe7ad){if(_0x4db6ab[_0xdde3('0x65')])return _0x2dbf1f(_0x4db6ab);return db[_0xdde3('0x66')][_0xdde3('0x67')](0x1)['then'](function(_0x7db854){if(_0x7db854['securePassword'])authService['validatePasswordPattern'](_0x4db6ab[_0xdde3('0x42')]);db['User']['max'](_0xdde3('0x65'))[_0xdde3('0x21')](function(_0x248073){if(_[_0xdde3('0x68')](_0x248073)){_0x4db6ab['internal']=_0x7db854[_0xdde3('0x69')]||0x1;return;}if(_[_0xdde3('0x68')](_0x7db854[_0xdde3('0x69')])||_0x7db854[_0xdde3('0x69')]===_0x248073){_0x4db6ab[_0xdde3('0x65')]=_0x248073+0x1;return;}if(_0x7db854[_0xdde3('0x69')]>_0x248073){_0x4db6ab['internal']=_0x7db854[_0xdde3('0x69')];return;}return db['sequelize'][_0xdde3('0x4b')](_0xdde3('0x6a'),{'type':db[_0xdde3('0x6b')][_0xdde3('0x6c')][_0xdde3('0x6d')]})[_0xdde3('0x21')](function(_0x4d6414){if(_0x4d6414&&_0x4d6414[_0xdde3('0x6e')]){for(var _0x27c7d8=0x0,_0x29b589=_0x4d6414[_0xdde3('0x6e')];_0x27c7d8<_0x29b589&&_['isNil'](_0x4db6ab[_0xdde3('0x65')]);_0x27c7d8++){if(_0x7db854[_0xdde3('0x69')]<=_0x4d6414[_0x27c7d8][_0xdde3('0x6f')]){_0x4db6ab['internal']=_0x4d6414[_0x27c7d8][_0xdde3('0x6f')];}else if(_0x7db854[_0xdde3('0x69')]>_0x4d6414[_0x27c7d8][_0xdde3('0x6f')]&&_0x7db854[_0xdde3('0x69')]<=_0x4d6414[_0x27c7d8]['to']){_0x4db6ab[_0xdde3('0x65')]=_0x7db854[_0xdde3('0x69')];}}}if(_[_0xdde3('0x68')](_0x4db6ab[_0xdde3('0x65')])){_0x4db6ab[_0xdde3('0x65')]=_0x248073+0x1;}return _0x2dbf1f(_0x4db6ab);});});})[_0xdde3('0x5a')](function(_0x1825e9){_0xfbe7ad(_0x1825e9);});});}function updateUser(_0x10d3ff){return new Promise(function(_0x349819,_0x28a7be){try{if(_0x10d3ff[_0xdde3('0x70')]){_0x10d3ff[_0xdde3('0x71')]=_0x10d3ff[_0xdde3('0x65')];_0x10d3ff[_0xdde3('0x72')]={'mailbox':_0x10d3ff[_0xdde3('0x65')],'password':_0x10d3ff[_0xdde3('0x42')],'fullname':_0x10d3ff['fullname'],'email':_0x10d3ff[_0xdde3('0x73')]};}if(_0x10d3ff[_0xdde3('0x2b')]==='agent'){if(!_0x10d3ff[_0xdde3('0x74')])_0x10d3ff['permissions']=[_0xdde3('0x75'),_0xdde3('0x76'),_0xdde3('0x77'),_0xdde3('0x78'),'110',_0xdde3('0x79'),_0xdde3('0x7a'),'106','107',_0xdde3('0x7b'),_0xdde3('0x7c'),_0xdde3('0x7d'),_0xdde3('0x7e'),_0xdde3('0x7f'),_0xdde3('0x80')];}_0x349819(_0x10d3ff);}catch(_0x379235){_0x28a7be(_0x379235);}});}exports['create']=function(_0x825be5,_0x42520e){if(_0x825be5['user'][_0xdde3('0x2b')]==='agent')throw new Error(_0xdde3('0x81'));if(_0x825be5['body'][_0xdde3('0x2b')]===_0xdde3('0x31')&&_0x825be5[_0xdde3('0x31')]['role']!==_0xdde3('0x82')){throw new Error(_0xdde3('0x83'));}if(_0x825be5['body'][_0xdde3('0x2b')]===_0xdde3('0x82')&&_0x825be5['user'][_0xdde3('0x2b')]!=='admin'){throw new Error(_0xdde3('0x84'));}return licenseUtil[_0xdde3('0x85')]([_0x825be5['body']])[_0xdde3('0x21')](function(){return validateUser(_0x825be5['body']);})[_0xdde3('0x21')](function(_0x3f4375){return updateUser(_0x3f4375)[_0xdde3('0x21')](function(_0x337693){if(_0x337693[_0xdde3('0x2b')]===_0xdde3('0x82')){_0x337693['settingsEnabled']=_0x825be5[_0xdde3('0x31')][_0xdde3('0x86')];delete _0x337693[_0xdde3('0x87')];}return _0x337693;});})[_0xdde3('0x21')](function(_0x36962f){return db[_0xdde3('0x48')][_0xdde3('0x88')](_0x36962f,{'include':[{'model':db[_0xdde3('0x72')],'as':'VoiceMail'}]});})['then'](function(_0x467276){if(_0x825be5['body'][_0xdde3('0x2b')]==='user')return _0x467276;if(_0x825be5[_0xdde3('0x31')][_0xdde3('0x2b')]!=='user')return _0x467276;return db[_0xdde3('0x89')][_0xdde3('0x60')]({'where':{'name':_0x467276['role']==='agent'?'Agents':'Telephones','userProfileId':_0x825be5[_0xdde3('0x31')]['userProfileId']},'raw':!![]})['then'](function(_0x2dd3c8){if(!_0x2dd3c8||_0x2dd3c8[_0xdde3('0x8a')]!=0x0)return _0x467276;return db[_0xdde3('0x39')]['create']({'name':_0x467276[_0xdde3('0x38')],'resourceId':_0x467276['id'],'type':_0x2dd3c8['name'],'sectionId':_0x2dd3c8['id']},{})[_0xdde3('0x21')](function(){return _0x467276;});})[_0xdde3('0x5a')](function(_0x644ae){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x644ae);throw _0x644ae;});})[_0xdde3('0x21')](respondWithResult(_0x42520e,0xc9))[_0xdde3('0x5a')](handleError(_0x42520e,null));};exports[_0xdde3('0x8b')]=function(_0x4da451,_0x219356){var _0x16b72d=_0x4da451['body'];var _0x413cfa=[];if(_0x4da451['user'][_0xdde3('0x2b')]===_0xdde3('0x2c'))throw new Error('Unauthorized');if(_[_0xdde3('0x8c')](_0x16b72d,['role',_0xdde3('0x31')])&&_0x4da451[_0xdde3('0x31')]['role']!==_0xdde3('0x82')){throw new Error(_0xdde3('0x83'));}if(_[_0xdde3('0x8c')](_0x16b72d,['role',_0xdde3('0x82')])&&_0x4da451['user'][_0xdde3('0x2b')]!==_0xdde3('0x82')){throw new Error(_0xdde3('0x8d'));}return licenseUtil[_0xdde3('0x85')](_0x16b72d)['then'](function(){return validateUser(_0x16b72d[0x0]);})[_0xdde3('0x21')](function(){for(var _0x3bd38b=0x1;_0x3bd38b<_0x16b72d[_0xdde3('0x6e')];_0x3bd38b++){var _0x536da8=_0x16b72d[_0x3bd38b-0x1][_0xdde3('0x65')];if(!_0x16b72d[_0x3bd38b][_0xdde3('0x65')])_0x16b72d[_0x3bd38b][_0xdde3('0x65')]=_0x536da8+0x1;_0x413cfa['push'](validateUser(_0x16b72d[_0x3bd38b]));}return Promise[_0xdde3('0x5e')](_0x413cfa);})[_0xdde3('0x21')](function(){_0x413cfa=[];for(var _0xd8a7a0=0x0;_0xd8a7a0<_0x16b72d['length'];_0xd8a7a0++){_0x413cfa[_0xdde3('0x50')](updateUser(_0x16b72d[_0xd8a7a0]));}return Promise['all'](_0x413cfa);})[_0xdde3('0x21')](function(){_0x413cfa=_0x16b72d[_0xdde3('0x35')](function(_0x1b43b3){return db[_0xdde3('0x48')][_0xdde3('0x88')](_0x1b43b3,{'include':[{'model':db[_0xdde3('0x72')],'as':_0xdde3('0x72')}]})[_0xdde3('0x21')](function(_0x4d1e3c){_0x1b43b3['id']=_0x4d1e3c['id'];return _0x1b43b3;});});return Promise[_0xdde3('0x5e')](_0x413cfa);})['then'](function(_0x3fea84){if(_0x4da451['body'][_0xdde3('0x2b')]==='user')return _0x3fea84;if(_0x4da451[_0xdde3('0x31')][_0xdde3('0x2b')]!=='user')return _0x3fea84;var _0x1b3279=_[_0xdde3('0x8c')](_0x3fea84,function(_0x1f837c){return _0x1f837c[_0xdde3('0x2b')]===_0xdde3('0x2c')||_0x1f837c[_0xdde3('0x2b')]==='telephone';});if(!_0x1b3279)return _0x3fea84;return db[_0xdde3('0x89')][_0xdde3('0x51')]({'where':{'name':{'$or':[_0xdde3('0x32'),_0xdde3('0x33')]},'userProfileId':_0x4da451[_0xdde3('0x31')]['userProfileId']},'raw':!![]})[_0xdde3('0x21')](function(_0x88ea5c){if(_['isEmpty'](_0x88ea5c)||!_['some'](_0x88ea5c,[_0xdde3('0x8a'),0x0]))return _0x3fea84;_0x413cfa=[];var _0x254a51=_(_0x88ea5c)[_0xdde3('0x35')](function(_0x4d18e8){if(_0x4d18e8[_0xdde3('0x8a')]===0x1)return;return _0x4d18e8[_0xdde3('0x38')]==='Agents'?_0xdde3('0x2c'):_0xdde3('0x8e');})['compact']()[_0xdde3('0x36')]();for(var _0x580b52=0x0;_0x580b52<_0x3fea84['length'];_0x580b52++){if(!_['includes'](_0x254a51,_0x3fea84[_0x580b52][_0xdde3('0x2b')]))return;var _0x334a29=_0x3fea84[_0x580b52][_0xdde3('0x2b')]===_0xdde3('0x2c')?_0xdde3('0x32'):_0xdde3('0x33');_0x413cfa[_0xdde3('0x50')](db['UserProfileResource']['create']({'name':_0x3fea84[_0x580b52][_0xdde3('0x38')],'resourceId':_0x3fea84[_0x580b52]['id'],'type':_0x334a29,'sectionId':_['find'](_0x88ea5c,[_0xdde3('0x38'),_0x334a29])['id']},{}));}return Promise['all'](_0x413cfa);});})['then'](respondWithResult(_0x219356,0xc9))[_0xdde3('0x5a')](handleError(_0x219356,null));};exports[_0xdde3('0x8f')]=function(_0x2759d7,_0x597071){if(_0x2759d7[_0xdde3('0x5f')]['id']){delete _0x2759d7[_0xdde3('0x5f')]['id'];}return db[_0xdde3('0x48')][_0xdde3('0x60')]({'where':{'id':_0x2759d7['params']['id']}})['then'](function(_0x21f55c){if(!_0x21f55c)return null;if(_0x21f55c['id']===_0x2759d7['user']['id']){if(!_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x90')]||!_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x91')]){throw new db[(_0xdde3('0x92'))][(_0xdde3('0x93'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x21f55c['authenticate'](_0x2759d7['body'][_0xdde3('0x90')])){throw new db[(_0xdde3('0x92'))][(_0xdde3('0x93'))](_0xdde3('0x94'));}if(_0x2759d7['body'][_0xdde3('0x90')]===_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x91')]){throw new db[(_0xdde3('0x92'))]['ValidationError'](_0xdde3('0x95'));}}else if(_0x2759d7[_0xdde3('0x31')][_0xdde3('0x2b')]===_0xdde3('0x82')){if(!_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x91')]){throw new db['Sequelize'][(_0xdde3('0x93'))](_0xdde3('0x96'));}}else if(_0x2759d7[_0xdde3('0x31')][_0xdde3('0x2b')]==='user'){if(!_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x91')]){throw new db['Sequelize'][(_0xdde3('0x93'))](_0xdde3('0x96'));}if(_0x21f55c[_0xdde3('0x2b')]!=='agent'){throw new db[(_0xdde3('0x92'))][(_0xdde3('0x93'))]('Unauthorized');}}else{throw new db[(_0xdde3('0x92'))]['ValidationError'](_0xdde3('0x81'));}return _0x21f55c;})[_0xdde3('0x21')](handleEntityNotFound(_0x597071,null))[_0xdde3('0x21')](function(_0x4848f9){return db['Setting'][_0xdde3('0x97')]({'attributes':['id','securePassword',_0xdde3('0x98'),_0xdde3('0x99')]})[_0xdde3('0x21')](function(_0x573ad8){if(_0x573ad8[_0xdde3('0x9a')])authService['validatePasswordPattern'](_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x91')]);if(!_0x573ad8[_0xdde3('0x98')]||!_0x4848f9[_0xdde3('0x44')])return _0x4848f9;authService[_0xdde3('0x9b')](_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x91')],_0x4848f9['previousPasswords'],_0x573ad8[_0xdde3('0x99')]);return _0x4848f9;})[_0xdde3('0x21')](saveUpdates({'password':_0x2759d7[_0xdde3('0x5f')]['newPassword'],'passwordResetAt':_0x2759d7['user']['id']==_0x2759d7['params']['id']?moment():null,'previousPasswords':authService[_0xdde3('0x9c')](_0x2759d7[_0xdde3('0x5f')][_0xdde3('0x91')],_0x4848f9[_0xdde3('0x44')])},null));})[_0xdde3('0x21')](respondWithResult(_0x597071,null))[_0xdde3('0x5a')](handleError(_0x597071,null));};exports[_0xdde3('0x9d')]=function(_0x504f71,_0x582364){var _0x164f42=_0x504f71[_0xdde3('0x5f')][_0xdde3('0x9e')];return db[_0xdde3('0x48')][_0xdde3('0x60')]({'where':{'id':_0x504f71[_0xdde3('0x5c')]['id']},'attributes':['id','name',_0xdde3('0x2b'),_0xdde3('0x9f'),_0xdde3('0xa0'),'voicePause',_0xdde3('0xa1')]})['then'](handleEntityNotFound(_0x582364,null))[_0xdde3('0x21')](function(_0x1406f9){if(_0x1406f9){if(!utils[_0xdde3('0xa2')](_0x164f42)){throw new db[(_0xdde3('0x92'))][(_0xdde3('0x93'))](_0xdde3('0xa3'));}return _0x1406f9[_0xdde3('0xa4')+_[_0xdde3('0xa5')](_0x164f42[_0xdde3('0xa6')]())+'Queues'](_0x504f71[_0xdde3('0x5f')][_0xdde3('0x63')],{'penalty':_0x504f71[_0xdde3('0x5f')][_0xdde3('0xa7')]||0x0})[_0xdde3('0xa8')](function(_0x234fe2){for(var _0x255f8e=0x0;_0x255f8e<_0x504f71['body'][_0xdde3('0x63')]['length'];_0x255f8e+=0x1){var _0x3a9c92={'UserId':Number(_0x504f71[_0xdde3('0x5c')]['id'])};_0x3a9c92[_['capitalize'](_0x164f42[_0xdde3('0xa6')]())+_0xdde3('0xa9')]=Number(_0x504f71[_0xdde3('0x5f')][_0xdde3('0x63')][_0x255f8e]);socket[_0xdde3('0x2d')](_0xdde3('0x31')+_[_0xdde3('0xa5')](_0x164f42['toLowerCase']())+'Queue:save',_0x3a9c92);}return _0x234fe2;})['then'](function(){if(_0x164f42==='voice'){return db[_0xdde3('0xaa')]['findAll']({'where':{'id':_0x504f71[_0xdde3('0x5f')][_0xdde3('0x63')]||[]},'raw':!![],'attributes':['id',_0xdde3('0x38')]});}})[_0xdde3('0x21')](function(_0x4d240b){var _0x20e713=_0x1406f9['get']({'plain':!![]});var _0x4e1b61=[];if(_0x164f42===_0xdde3('0xab')&&_0x20e713[_0xdde3('0x2b')]===_0xdde3('0x2c')&&_0x20e713[_0xdde3('0x9f')]){for(let _0x5f28d2=0x0;_0x5f28d2<_0x4d240b[_0xdde3('0x6e')];_0x5f28d2+=0x1){_0x4e1b61[_0xdde3('0x50')]({'membername':_0x20e713[_0xdde3('0x38')],'UserId':_0x20e713['id'],'queue_name':_0x4d240b[_0x5f28d2][_0xdde3('0x38')],'VoiceQueueId':_0x4d240b[_0x5f28d2]['id'],'interface':_[_0xdde3('0x68')](_0x20e713[_0xdde3('0xa1')])?util[_0xdde3('0xac')](_0xdde3('0xad'),_0x20e713[_0xdde3('0x38')]):_0x20e713['interface'],'paused':_0x20e713['voicePause']||![],'penalty':_0x504f71[_0xdde3('0x5f')]['penalty']||0x0});}return Promise['all'](_0x4e1b61[_0xdde3('0x35')](function(_0x567756){return db[_0xdde3('0xae')]['upsert'](_0x567756);}));}return _0x1406f9;});}})['then'](respondWithStatusCode(_0x582364,null))[_0xdde3('0x5a')](handleError(_0x582364,null));};exports['removeQueues']=function(_0x2057be,_0x22ccd4){var _0x92366,_0x408ed9;return db[_0xdde3('0x48')][_0xdde3('0x60')]({'where':{'id':_0x2057be[_0xdde3('0x5c')]['id']},'attributes':['id',_0xdde3('0x38'),_0xdde3('0x2b')]})['then'](handleEntityNotFound(_0x22ccd4,null))['then'](function(_0x58e4ff){if(_0x58e4ff){_0x92366=_0x58e4ff;if(!_0x2057be[_0xdde3('0x4b')][_0xdde3('0x9e')]||!utils['isValidChannel'](_0x2057be[_0xdde3('0x4b')]['channel'])){throw new db[(_0xdde3('0x92'))]['ValidationError'](_0xdde3('0xa3'));}return _0x58e4ff[_0xdde3('0xaf')+_[_0xdde3('0xa5')](_0x2057be['query']['channel'][_0xdde3('0xa6')]())+_0xdde3('0xb0')](_0x2057be[_0xdde3('0x4b')][_0xdde3('0x63')]);}})[_0xdde3('0x21')](function(_0x55e9c9){if(_[_0xdde3('0xb1')](_0x2057be[_0xdde3('0x4b')]['ids'])){for(var _0x44dbfc=0x0;_0x44dbfc<_0x2057be[_0xdde3('0x4b')][_0xdde3('0x63')][_0xdde3('0x6e')];_0x44dbfc+=0x1){_0x408ed9={'UserId':Number(_0x2057be['params']['id'])};_0x408ed9[_[_0xdde3('0xa5')](_0x2057be['query'][_0xdde3('0x9e')][_0xdde3('0xa6')]())+_0xdde3('0xa9')]=Number(_0x2057be[_0xdde3('0x4b')][_0xdde3('0x63')][_0x44dbfc]);socket[_0xdde3('0x2d')](_0xdde3('0x31')+_[_0xdde3('0xa5')](_0x2057be[_0xdde3('0x4b')][_0xdde3('0x9e')][_0xdde3('0xa6')]())+_0xdde3('0xb2'),_0x408ed9);}}else{_0x408ed9={'UserId':Number(_0x2057be[_0xdde3('0x5c')]['id'])};_0x408ed9[_['capitalize'](_0x2057be['query'][_0xdde3('0x9e')][_0xdde3('0xa6')]())+_0xdde3('0xa9')]=Number(_0x2057be[_0xdde3('0x4b')][_0xdde3('0x63')]);socket[_0xdde3('0x2d')]('user'+_['capitalize'](_0x2057be[_0xdde3('0x4b')][_0xdde3('0x9e')][_0xdde3('0xa6')]())+_0xdde3('0xb2'),_0x408ed9);}return _0x55e9c9;})[_0xdde3('0x21')](function(){if(_0x2057be['query'][_0xdde3('0x9e')]==='voice'){return db['UserVoiceQueueRt'][_0xdde3('0x3a')]({'where':{'UserId':_0x2057be['params']['id'],'VoiceQueueId':_0x2057be['query'][_0xdde3('0x63')]},'individualHooks':!![]})[_0xdde3('0x21')](function(){return _0x92366;});}return _0x92366;})[_0xdde3('0x21')](respondWithStatusCode(_0x22ccd4,null))['catch'](handleError(_0x22ccd4,null));};exports['addAvatar']=function(_0x5b0d66,_0x343a10){_0x5b0d66[_0xdde3('0x5f')][_0xdde3('0xb3')]=_0x5b0d66[_0xdde3('0xb4')]['filename'];return db['User'][_0xdde3('0x60')]({'where':{'id':_0x5b0d66['params']['id']}})['then'](handleEntityNotFound(_0x343a10,null))['then'](saveUpdates(_0x5b0d66['body'],null))[_0xdde3('0x21')](respondWithResult(_0x343a10,null))[_0xdde3('0x5a')](handleError(_0x343a10,null));};exports[_0xdde3('0xb5')]=function(_0x3e54f2,_0x4ad7c0){var _0x4457e4=path[_0xdde3('0xb6')](config[_0xdde3('0xb7')],_0xdde3('0xb8'));return db[_0xdde3('0x48')][_0xdde3('0x60')]({'where':{'id':_0x3e54f2[_0xdde3('0x5c')]['id']},'attributes':['id',_0xdde3('0xb3')],'raw':!![]})[_0xdde3('0x21')](handleEntityNotFound(_0x4ad7c0,null))[_0xdde3('0x21')](function(_0x41fb9e){if(_0x41fb9e){if(_['isNil'](_0x41fb9e['userpic'])){return _0x4ad7c0[_0xdde3('0xb9')](_0x4457e4);}else{if(!fs[_0xdde3('0xba')](path['join'](config[_0xdde3('0xb7')],'server/files/images/',_0x41fb9e[_0xdde3('0xb3')]))){return _0x4ad7c0[_0xdde3('0xb9')](_0x4457e4);}return _0x4ad7c0[_0xdde3('0xb9')](path[_0xdde3('0xb6')](config[_0xdde3('0xb7')],_0xdde3('0xbb'),_0x41fb9e[_0xdde3('0xb3')]));}}})['catch'](handleError(_0x4ad7c0,null));};exports[_0xdde3('0xbc')]=function(_0x43c6c5,_0x25b9ae){return db[_0xdde3('0x48')]['find']({'where':{'id':_0x43c6c5[_0xdde3('0x5c')]['id']},'attributes':['id']})[_0xdde3('0x21')](handleEntityNotFound(_0x25b9ae,null))[_0xdde3('0x21')](function(_0x3beda4){var _0x107646=[];values=_0x3beda4[_0xdde3('0x56')];_0x107646[_0xdde3('0x50')](get_open_tabs('chat',_0x3beda4['dataValues']));_0x107646[_0xdde3('0x50')](get_open_tabs('sms',_0x3beda4['dataValues']));_0x107646[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x58'),_0x3beda4[_0xdde3('0x56')]));_0x107646[_0xdde3('0x50')](get_open_tabs('whatsapp',_0x3beda4[_0xdde3('0x56')]));_0x107646[_0xdde3('0x50')](get_open_tabs(_0xdde3('0x55'),_0x3beda4[_0xdde3('0x56')]));_0x107646[_0xdde3('0x50')](get_open_tabs('mail',_0x3beda4[_0xdde3('0x56')]));return Promise[_0xdde3('0x5e')](_0x107646);})[_0xdde3('0x21')](function(_0x418b38){if(_0x418b38){var _0x5ee10a=_['map'](values[_0xdde3('0xbd')],function(_0x442be3){return{'channel':'CHAT','id':_0x442be3['id'],'createdAt':_0x442be3[_0xdde3('0xbe')]};});var _0xa8ebb3=_['map'](values['FaxOpenTabs'],function(_0x294e16){return{'channel':_0xdde3('0xbf'),'id':_0x294e16['id'],'createdAt':_0x294e16['createdAt']};});var _0x543a24=_[_0xdde3('0x35')](values[_0xdde3('0xc0')],function(_0x1f9db7){return{'channel':_0xdde3('0xc1'),'id':_0x1f9db7['id'],'createdAt':_0x1f9db7[_0xdde3('0xbe')]};});var _0xe5ea3a=_['map'](values[_0xdde3('0xc2')],function(_0x14beab){return{'channel':_0xdde3('0xc3'),'id':_0x14beab['id'],'createdAt':_0x14beab[_0xdde3('0xbe')]};});var _0x30e516=_[_0xdde3('0x35')](values[_0xdde3('0xc4')],function(_0x3371ee){return{'channel':'SMS','id':_0x3371ee['id'],'createdAt':_0x3371ee[_0xdde3('0xbe')]};});var _0x304bf6=_[_0xdde3('0x35')](values['WhatsappOpenTabs'],function(_0x52366a){return{'channel':_0xdde3('0xc5'),'id':_0x52366a['id'],'createdAt':_0x52366a[_0xdde3('0xbe')]};});var _0x10f3a8=_[_0xdde3('0xc6')](_0x5ee10a,_0xa8ebb3,_0x543a24,_0xe5ea3a,_0x30e516,_0x304bf6);var _0x51c2d4={'count':_0x10f3a8[_0xdde3('0x6e')],'rows':_0x10f3a8};return _0x51c2d4;}else return null;})[_0xdde3('0x21')](respondWithResult(_0x25b9ae,null))[_0xdde3('0x5a')](handleError(_0x25b9ae,null));};exports[_0xdde3('0xc7')]=function(_0x2fdbee,_0x407236){var _0x3c3e39={};return db['User']['findOne']({'where':{'id':_0x2fdbee['params']['id']}})['then'](function(_0xa310c9){if(!_0xa310c9){throw new APINotFoundError(util[_0xdde3('0xac')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2fdbee['params']['id']));}return contacts[_0xdde3('0x61')]();})[_0xdde3('0x21')](function(_0x3e6f8e){_0x2fdbee[_0xdde3('0x4b')][_0xdde3('0x48')]=_0x2fdbee[_0xdde3('0x5c')]['id'];_0x3c3e39=qs[_0xdde3('0x47')](_0x3e6f8e,_0x2fdbee);if(_0x2fdbee['query'][_0xdde3('0xc8')](_0xdde3('0x49'))){_0x3c3e39[_0xdde3('0x4a')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xdde3('0xc9')],'as':_0xdde3('0xca'),'attributes':['id',_0xdde3('0x38'),'color'],'where':_0x2fdbee[_0xdde3('0x4b')][_0xdde3('0xcb')]?{'id':_0x2fdbee['query']['tag']}:undefined,'required':_0x2fdbee[_0xdde3('0x4b')][_0xdde3('0xcb')]?!![]:![]}];}return contacts[_0xdde3('0x51')](_0x2fdbee[_0xdde3('0x4b')],_0x2fdbee['user'],_0x3c3e39,_0x3e6f8e);})[_0xdde3('0x21')](respondWithFilteredResult(_0x407236,_0x3c3e39))[_0xdde3('0x5a')](APIHandleError(_0x407236));};exports[_0xdde3('0xcc')]=function(_0x1625de,_0x16ed80){var _0x4dc93b;var _0x1365e9={};var _0x4f5e9e;return db[_0xdde3('0x48')]['findOne']({'where':{'id':_0x1625de[_0xdde3('0x5c')]['id']},'attributes':['id',_0xdde3('0x38'),_0xdde3('0x2b')]})[_0xdde3('0x21')](handleEntityNotFound(_0x16ed80,null))[_0xdde3('0x21')](function(_0x732aa6){if(!utils[_0xdde3('0xa2')](_0x1625de[_0xdde3('0x4b')][_0xdde3('0x9e')])){throw new db['Sequelize']['ValidationError'](_0xdde3('0xa3'));}_0x4dc93b=_0x732aa6;var _0x1a6f84={};_0x1a6f84[_0xdde3('0xcd')]=_[_0xdde3('0xce')](db[_[_0xdde3('0xa5')](_0x1625de[_0xdde3('0x4b')][_0xdde3('0x9e')])+_0xdde3('0xcf')][_0xdde3('0x3e')]);_0x1a6f84[_0xdde3('0x4b')]=_[_0xdde3('0xce')](_0x1625de[_0xdde3('0x4b')]);_0x1a6f84[_0xdde3('0xd0')]=_['intersection'](_0x1a6f84[_0xdde3('0xcd')],_0x1a6f84['query']);_0x1365e9[_0xdde3('0x4f')]=_['intersection'](_0x1a6f84[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x1625de[_0xdde3('0x4b')]['fields']));_0x1365e9[_0xdde3('0x4f')]=_0x1365e9[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x1365e9[_0xdde3('0x4f')]:_0x1a6f84[_0xdde3('0xcd')];_0x1365e9[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x1625de[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x1365e9[_0xdde3('0xd4')]=qs['filters'](_[_0xdde3('0xd5')](_0x1625de[_0xdde3('0x4b')],_0x1a6f84[_0xdde3('0xd0')]));if(_0x1625de[_0xdde3('0x4b')][_0xdde3('0x41')]){_0x1365e9[_0xdde3('0xd4')]=_[_0xdde3('0xd6')](_0x1365e9[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x1365e9[_0xdde3('0x4f')],function(_0x2f7537){var _0x182176={};_0x182176[_0x2f7537]={'$like':'%'+_0x1625de[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x182176;})});}_0x1365e9=_[_0xdde3('0xd6')]({},_0x1365e9,_0x1625de[_0xdde3('0x5d')]);switch(_0x4dc93b['role']){case _0xdde3('0x82'):return db[_[_0xdde3('0xa5')](_0x1625de[_0xdde3('0x4b')][_0xdde3('0x9e')])+_0xdde3('0xcf')][_0xdde3('0x51')](_0x1365e9);case _0xdde3('0x31'):case'agent':return _0x4dc93b[_0xdde3('0x2f')+_[_0xdde3('0xa5')](_0x1625de[_0xdde3('0x4b')][_0xdde3('0x9e')])+'Queues'](_0x1365e9);default:throw new db[(_0xdde3('0x92'))][(_0xdde3('0x93'))]('Unknown\x20role');}})[_0xdde3('0x21')](function(_0x3fa3d5){_0x4f5e9e=_0x3fa3d5[_0xdde3('0x6e')];if(!_0x1625de[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x1365e9[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0x1625de[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0x1365e9[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x1625de['query']['offset']);}switch(_0x4dc93b['role']){case _0xdde3('0x82'):return db[_['capitalize'](_0x1625de[_0xdde3('0x4b')][_0xdde3('0x9e')])+'Queue'][_0xdde3('0x51')](_0x1365e9);case _0xdde3('0x31'):case _0xdde3('0x2c'):return _0x4dc93b['get'+_[_0xdde3('0xa5')](_0x1625de[_0xdde3('0x4b')][_0xdde3('0x9e')])+_0xdde3('0xb0')](_0x1365e9);}})[_0xdde3('0x21')](function(_0x13d0d3){return{'count':_0x4f5e9e,'rows':_0x13d0d3};})[_0xdde3('0x21')](respondWithResult(_0x16ed80,null))[_0xdde3('0x5a')](handleError(_0x16ed80,null));};exports['getVoiceQueuesRt']=function(_0xf6e9f0,_0x55e301){var _0x10e210={};var _0x2afbe0={};var _0x3c4c00;var _0x4998b2;return db[_0xdde3('0x48')]['findOne']({'where':{'id':_0xf6e9f0[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x55e301,null))['then'](function(_0x45b85f){if(_0x45b85f){_0x3c4c00=_0x45b85f;_0x2afbe0[_0xdde3('0xcd')]=_['keys'](db[_0xdde3('0xae')][_0xdde3('0x3e')]);_0x2afbe0[_0xdde3('0x4b')]=_['keys'](_0xf6e9f0[_0xdde3('0x4b')]);_0x2afbe0[_0xdde3('0xd0')]=_['intersection'](_0x2afbe0[_0xdde3('0xcd')],_0x2afbe0[_0xdde3('0x4b')]);_0x10e210[_0xdde3('0x4f')]=_[_0xdde3('0xd8')](_0x2afbe0[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0xf6e9f0['query']['fields']));_0x10e210['attributes']=_0x10e210[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x10e210['attributes']:_0x2afbe0[_0xdde3('0xcd')];_0x10e210[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0xf6e9f0[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x10e210[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_[_0xdde3('0xd5')](_0xf6e9f0['query'],_0x2afbe0[_0xdde3('0xd0')]));if(_0xf6e9f0[_0xdde3('0x4b')][_0xdde3('0x41')]){_0x10e210[_0xdde3('0xd4')]=_[_0xdde3('0xd6')](_0x10e210['where'],{'$or':_[_0xdde3('0x35')](_0x10e210[_0xdde3('0x4f')],function(_0x30b09c){var _0x4c4c70={};_0x4c4c70[_0x30b09c]={'$like':'%'+_0xf6e9f0[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x4c4c70;})});}_0x10e210=_['merge']({},_0x10e210,_0xf6e9f0[_0xdde3('0x5d')]);return _0x3c4c00[_0xdde3('0xd9')](_0x10e210);}})['then'](function(_0x550a9d){if(_0x550a9d){_0x4998b2=_0x550a9d[_0xdde3('0x6e')];if(!_0xf6e9f0[_0xdde3('0x4b')][_0xdde3('0xc8')]('nolimit')){_0x10e210[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0xf6e9f0['query'][_0xdde3('0x1c')]);_0x10e210[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0xf6e9f0['query'][_0xdde3('0x1b')]);}return _0x3c4c00[_0xdde3('0xd9')](_0x10e210);}})['then'](function(_0x4da2a0){if(_0x4da2a0){return _0x4da2a0?{'count':_0x4998b2,'rows':_0x4da2a0}:null;}})[_0xdde3('0x21')](respondWithResult(_0x55e301,null))[_0xdde3('0x5a')](handleError(_0x55e301,null));};exports[_0xdde3('0xda')]=function(_0x43d96f,_0x44fde0){var _0xaadb3={};var _0x5ccd10={};var _0x59b684;var _0x3dfef3;return db['User']['findOne']({'where':{'id':_0x43d96f[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x44fde0,null))[_0xdde3('0x21')](function(_0x2ff5c0){if(_0x2ff5c0){_0x59b684=_0x2ff5c0;_0x5ccd10[_0xdde3('0xcd')]=_[_0xdde3('0xce')](db['ChatGroup'][_0xdde3('0x3e')]);_0x5ccd10[_0xdde3('0x4b')]=_[_0xdde3('0xce')](_0x43d96f[_0xdde3('0x4b')]);_0x5ccd10[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x5ccd10[_0xdde3('0xcd')],_0x5ccd10[_0xdde3('0x4b')]);_0xaadb3[_0xdde3('0x4f')]=_['intersection'](_0x5ccd10[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x43d96f[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0xaadb3[_0xdde3('0x4f')]=_0xaadb3[_0xdde3('0x4f')]['length']?_0xaadb3[_0xdde3('0x4f')]:_0x5ccd10[_0xdde3('0xcd')];_0xaadb3[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x43d96f[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0xaadb3[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_[_0xdde3('0xd5')](_0x43d96f[_0xdde3('0x4b')],_0x5ccd10[_0xdde3('0xd0')]));if(_0x43d96f[_0xdde3('0x4b')]['filter']){_0xaadb3['where']=_[_0xdde3('0xd6')](_0xaadb3['where'],{'$or':_[_0xdde3('0x35')](_0xaadb3[_0xdde3('0x4f')],function(_0x236060){var _0xe3f39b={};_0xe3f39b[_0x236060]={'$like':'%'+_0x43d96f[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0xe3f39b;})});}_0xaadb3=_[_0xdde3('0xd6')]({},_0xaadb3,_0x43d96f['options']);return _0x59b684[_0xdde3('0xda')](_0xaadb3);}})['then'](function(_0x3bfc82){if(_0x3bfc82){_0x3dfef3=_0x3bfc82['length'];if(!_0x43d96f[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0xaadb3[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0x43d96f[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0xaadb3[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x43d96f[_0xdde3('0x4b')][_0xdde3('0x1b')]);}return _0x59b684['getGroups'](_0xaadb3);}})[_0xdde3('0x21')](function(_0x499bfa){if(_0x499bfa){return _0x499bfa?{'count':_0x3dfef3,'rows':_0x499bfa}:null;}})[_0xdde3('0x21')](respondWithResult(_0x44fde0,null))['catch'](handleError(_0x44fde0,null));};exports['getRecordings']=function(_0x5b10a4,_0x293620){var _0x51bddb={'raw':!![],'where':{}};var _0xc51531={};var _0x33ef46={'count':0x0,'rows':[]};return db[_0xdde3('0x48')][_0xdde3('0x97')]({'where':{'id':_0x5b10a4[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x293620,null))[_0xdde3('0x21')](function(_0x5a9b18){if(_0x5a9b18){_0xc51531[_0xdde3('0xcd')]=_[_0xdde3('0xce')](db[_0xdde3('0xdb')][_0xdde3('0x3e')]);_0xc51531[_0xdde3('0x4b')]=_[_0xdde3('0xce')](_0x5b10a4[_0xdde3('0x4b')]);_0xc51531[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0xc51531[_0xdde3('0xcd')],_0xc51531[_0xdde3('0x4b')]);_0x51bddb[_0xdde3('0x4f')]=_['intersection'](_0xc51531[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x5b10a4[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0x51bddb[_0xdde3('0x4f')]=_0x51bddb[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x51bddb['attributes']:_0xc51531['model'];if(!_0x5b10a4[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x51bddb[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0x5b10a4[_0xdde3('0x4b')]['limit']);_0x51bddb[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x5b10a4['query'][_0xdde3('0x1b')]);}_0x51bddb[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x5b10a4[_0xdde3('0x4b')]['sort']);_0x51bddb[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_[_0xdde3('0xd5')](_0x5b10a4[_0xdde3('0x4b')],_0xc51531['filters']));_0x51bddb['where'][_0xdde3('0xdc')]=_0x5a9b18['id'];if(_0x5b10a4['query'][_0xdde3('0x41')]){_0x51bddb[_0xdde3('0xd4')]=_[_0xdde3('0xd6')](_0x51bddb[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x51bddb['attributes'],function(_0x155b77){var _0x2fe843={};_0x2fe843[_0x155b77]={'$like':'%'+_0x5b10a4[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x2fe843;})});}_0x51bddb=_[_0xdde3('0xd6')]({},_0x51bddb,_0x5b10a4[_0xdde3('0x5d')]);return db[_0xdde3('0xdb')]['count']({'where':_0x51bddb[_0xdde3('0xd4')]})[_0xdde3('0x21')](function(_0x53a45f){_0x33ef46['count']=_0x53a45f;if(_0x5b10a4[_0xdde3('0x4b')]['includeAll']){_0x51bddb[_0xdde3('0x4a')]=[{'all':!![]}];}return db[_0xdde3('0xdb')][_0xdde3('0x51')](_0x51bddb);})[_0xdde3('0x21')](function(_0x1810b0){_0x33ef46['rows']=_0x1810b0;return _0x33ef46;});}})[_0xdde3('0x21')](respondWithFilteredResult(_0x293620,_0x51bddb))[_0xdde3('0x5a')](handleError(_0x293620,null));};exports['getScreenRecordings']=function(_0x327a69,_0x193f1e){var _0x37ea7a={'raw':!![],'where':{}};var _0x3e1f1f={};var _0x2398ba={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x327a69[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x193f1e,null))[_0xdde3('0x21')](function(_0x3c7064){if(_0x3c7064){_0x3e1f1f[_0xdde3('0xcd')]=_[_0xdde3('0xce')](db[_0xdde3('0xdd')][_0xdde3('0x3e')]);_0x3e1f1f[_0xdde3('0x4b')]=_[_0xdde3('0xce')](_0x327a69[_0xdde3('0x4b')]);_0x3e1f1f[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x3e1f1f['model'],_0x3e1f1f[_0xdde3('0x4b')]);_0x37ea7a['attributes']=_[_0xdde3('0xd8')](_0x3e1f1f[_0xdde3('0xcd')],qs['fields'](_0x327a69['query'][_0xdde3('0xd1')]));_0x37ea7a['attributes']=_0x37ea7a[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x37ea7a['attributes']:_0x3e1f1f[_0xdde3('0xcd')];if(!_0x327a69['query'][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x37ea7a['limit']=qs[_0xdde3('0x1c')](_0x327a69[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0x37ea7a[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x327a69[_0xdde3('0x4b')][_0xdde3('0x1b')]);}_0x37ea7a[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x327a69[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x37ea7a['where']=qs[_0xdde3('0xd0')](_['pick'](_0x327a69['query'],_0x3e1f1f[_0xdde3('0xd0')]));_0x37ea7a['where']['UserId']=_0x3c7064['id'];if(_0x327a69['query'][_0xdde3('0x41')]){_0x37ea7a['where']=_[_0xdde3('0xd6')](_0x37ea7a[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x37ea7a[_0xdde3('0x4f')],function(_0x47e7c5){var _0x459dfe={};_0x459dfe[_0x47e7c5]={'$like':'%'+_0x327a69[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x459dfe;})});}_0x37ea7a=_[_0xdde3('0xd6')]({},_0x37ea7a,_0x327a69[_0xdde3('0x5d')]);return db[_0xdde3('0xdd')][_0xdde3('0x1e')]({'where':_0x37ea7a[_0xdde3('0xd4')]})[_0xdde3('0x21')](function(_0x43d181){_0x2398ba[_0xdde3('0x1e')]=_0x43d181;if(_0x327a69[_0xdde3('0x4b')]['includeAll']){_0x37ea7a[_0xdde3('0x4a')]=[{'all':!![]}];}return db[_0xdde3('0xdd')]['findAll'](_0x37ea7a);})[_0xdde3('0x21')](function(_0x44f5f2){_0x2398ba[_0xdde3('0x54')]=_0x44f5f2;return _0x2398ba;});}})[_0xdde3('0x21')](respondWithFilteredResult(_0x193f1e,_0x37ea7a))[_0xdde3('0x5a')](handleError(_0x193f1e,null));};exports[_0xdde3('0xde')]=function(_0x175d88,_0x2ba8d7){var _0x1db0e9={};var _0xedf91c={};var _0x4466bc;var _0x361ff3;return db['User'][_0xdde3('0x97')]({'where':{'id':_0x175d88[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x2ba8d7,null))[_0xdde3('0x21')](function(_0x36e289){if(_0x36e289){_0x4466bc=_0x36e289;_0xedf91c[_0xdde3('0xcd')]=_[_0xdde3('0xce')](db[_0xdde3('0xdf')]['rawAttributes']);_0xedf91c['query']=_[_0xdde3('0xce')](_0x175d88[_0xdde3('0x4b')]);_0xedf91c['filters']=_['intersection'](_0xedf91c[_0xdde3('0xcd')],_0xedf91c[_0xdde3('0x4b')]);_0x1db0e9[_0xdde3('0x4f')]=_[_0xdde3('0xd8')](_0xedf91c[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x175d88[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0x1db0e9[_0xdde3('0x4f')]=_0x1db0e9[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x1db0e9[_0xdde3('0x4f')]:_0xedf91c[_0xdde3('0xcd')];_0x1db0e9[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x175d88[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x1db0e9[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_['pick'](_0x175d88[_0xdde3('0x4b')],_0xedf91c[_0xdde3('0xd0')]));if(_0x175d88[_0xdde3('0x4b')][_0xdde3('0x41')]){_0x1db0e9['where']=_[_0xdde3('0xd6')](_0x1db0e9[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x1db0e9[_0xdde3('0x4f')],function(_0x500040){var _0x2c8f0d={};_0x2c8f0d[_0x500040]={'$like':'%'+_0x175d88[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x2c8f0d;})});}_0x1db0e9=_[_0xdde3('0xd6')]({},_0x1db0e9,_0x175d88[_0xdde3('0x5d')]);return _0x4466bc[_0xdde3('0xde')](_0x1db0e9);}})['then'](function(_0x2a73fd){if(_0x2a73fd){_0x361ff3=_0x2a73fd['length'];if(!_0x175d88['query']['hasOwnProperty']('nolimit')){_0x1db0e9[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0x175d88[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0x1db0e9[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x175d88[_0xdde3('0x4b')][_0xdde3('0x1b')]);}return _0x4466bc[_0xdde3('0xde')](_0x1db0e9);}})[_0xdde3('0x21')](function(_0x11e81d){if(_0x11e81d){return _0x11e81d?{'count':_0x361ff3,'rows':_0x11e81d}:null;}})['then'](respondWithResult(_0x2ba8d7,null))[_0xdde3('0x5a')](handleError(_0x2ba8d7,null));};exports[_0xdde3('0xe0')]=function(_0x13d520,_0x5d8ef7){var _0x52607e={};var _0x2b1d97={};var _0x4c21a3;var _0x36742a;return db[_0xdde3('0x48')][_0xdde3('0x97')]({'where':{'id':_0x13d520[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x5d8ef7,null))[_0xdde3('0x21')](function(_0x56a236){if(_0x56a236){_0x4c21a3=_0x56a236;_0x2b1d97['model']=_[_0xdde3('0xce')](db[_0xdde3('0xe1')][_0xdde3('0x3e')]);_0x2b1d97[_0xdde3('0x4b')]=_[_0xdde3('0xce')](_0x13d520[_0xdde3('0x4b')]);_0x2b1d97[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x2b1d97[_0xdde3('0xcd')],_0x2b1d97[_0xdde3('0x4b')]);_0x52607e[_0xdde3('0x4f')]=_[_0xdde3('0xd8')](_0x2b1d97['model'],qs['fields'](_0x13d520['query']['fields']));_0x52607e[_0xdde3('0x4f')]=_0x52607e['attributes'][_0xdde3('0x6e')]?_0x52607e[_0xdde3('0x4f')]:_0x2b1d97[_0xdde3('0xcd')];_0x52607e[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x13d520['query'][_0xdde3('0xd3')]);_0x52607e['where']=qs['filters'](_[_0xdde3('0xd5')](_0x13d520[_0xdde3('0x4b')],_0x2b1d97[_0xdde3('0xd0')]));if(_0x13d520[_0xdde3('0x4b')][_0xdde3('0x41')]){_0x52607e['where']=_[_0xdde3('0xd6')](_0x52607e[_0xdde3('0xd4')],{'$or':_['map'](_0x52607e[_0xdde3('0x4f')],function(_0x23d967){var _0x2265db={};_0x2265db[_0x23d967]={'$like':'%'+_0x13d520['query'][_0xdde3('0x41')]+'%'};return _0x2265db;})});}_0x52607e=_[_0xdde3('0xd6')]({},_0x52607e,_0x13d520['options']);return _0x4c21a3[_0xdde3('0xe0')](_0x52607e);}})[_0xdde3('0x21')](function(_0x55e7f2){if(_0x55e7f2){_0x36742a=_0x55e7f2[_0xdde3('0x6e')];if(!_0x13d520[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x52607e[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0x13d520[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0x52607e[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x13d520[_0xdde3('0x4b')][_0xdde3('0x1b')]);}return _0x4c21a3[_0xdde3('0xe0')](_0x52607e);}})[_0xdde3('0x21')](function(_0x2f708d){if(_0x2f708d){return _0x2f708d?{'count':_0x36742a,'rows':_0x2f708d}:null;}})[_0xdde3('0x21')](respondWithResult(_0x5d8ef7,null))[_0xdde3('0x5a')](handleError(_0x5d8ef7,null));};exports[_0xdde3('0xe2')]=function(_0x4b83bd,_0x4df78b){var _0x19391c={'raw':!![],'where':{}};var _0x15b025={};var _0xb09808={'count':0x0,'rows':[]};return db['User'][_0xdde3('0x97')]({'where':{'id':_0x4b83bd[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x4df78b,null))[_0xdde3('0x21')](function(_0x1df5d5){if(_0x1df5d5){_0x15b025['model']=_['keys'](db['MailInteraction'][_0xdde3('0x3e')]);_0x15b025[_0xdde3('0x4b')]=_['keys'](_0x4b83bd[_0xdde3('0x4b')]);_0x15b025[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x15b025[_0xdde3('0xcd')],_0x15b025[_0xdde3('0x4b')]);_0x19391c[_0xdde3('0x4f')]=_['intersection'](_0x15b025[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x4b83bd[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0x19391c[_0xdde3('0x4f')]=_0x19391c[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x19391c[_0xdde3('0x4f')]:_0x15b025[_0xdde3('0xcd')];if(!_0x4b83bd[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x19391c[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0x4b83bd[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0x19391c[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x4b83bd['query'][_0xdde3('0x1b')]);}_0x19391c[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x4b83bd[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x19391c['where']=qs[_0xdde3('0xd0')](_['pick'](_0x4b83bd[_0xdde3('0x4b')],_0x15b025[_0xdde3('0xd0')]));_0x19391c[_0xdde3('0xd4')][_0xdde3('0xdc')]=_0x1df5d5['id'];if(_0x4b83bd[_0xdde3('0x4b')][_0xdde3('0x41')]){_0x19391c['where']=_[_0xdde3('0xd6')](_0x19391c[_0xdde3('0xd4')],{'$or':_['map'](_0x19391c[_0xdde3('0x4f')],function(_0x41ab81){var _0x4014e={};_0x4014e[_0x41ab81]={'$like':'%'+_0x4b83bd[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x4014e;})});}_0x19391c=_[_0xdde3('0xd6')]({},_0x19391c,_0x4b83bd['options']);return db['MailInteraction'][_0xdde3('0x1e')]({'where':_0x19391c[_0xdde3('0xd4')]})['then'](function(_0x1503e2){_0xb09808['count']=_0x1503e2;if(_0x4b83bd[_0xdde3('0x4b')]['includeAll']){_0x19391c[_0xdde3('0x4a')]=[{'all':!![]}];}return db[_0xdde3('0xe3')][_0xdde3('0x51')](_0x19391c);})[_0xdde3('0x21')](function(_0x4d608c){_0xb09808[_0xdde3('0x54')]=_0x4d608c;return _0xb09808;});}})['then'](respondWithFilteredResult(_0x4df78b,_0x19391c))[_0xdde3('0x5a')](handleError(_0x4df78b,null));};exports['getSmsInteractions']=function(_0x36348,_0x1481a2){var _0x2f1ca7={};var _0x96024c={};var _0x4e5e6c;var _0x39f3c7;return db[_0xdde3('0x48')]['findOne']({'where':{'id':_0x36348[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x1481a2,null))[_0xdde3('0x21')](function(_0x41c95a){if(_0x41c95a){_0x4e5e6c=_0x41c95a;_0x96024c[_0xdde3('0xcd')]=_[_0xdde3('0xce')](db[_0xdde3('0xe4')][_0xdde3('0x3e')]);_0x96024c['query']=_[_0xdde3('0xce')](_0x36348[_0xdde3('0x4b')]);_0x96024c[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x96024c[_0xdde3('0xcd')],_0x96024c['query']);_0x2f1ca7[_0xdde3('0x4f')]=_['intersection'](_0x96024c[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x36348[_0xdde3('0x4b')]['fields']));_0x2f1ca7['attributes']=_0x2f1ca7['attributes'][_0xdde3('0x6e')]?_0x2f1ca7['attributes']:_0x96024c['model'];_0x2f1ca7[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x36348[_0xdde3('0x4b')]['sort']);_0x2f1ca7[_0xdde3('0xd4')]=qs['filters'](_[_0xdde3('0xd5')](_0x36348[_0xdde3('0x4b')],_0x96024c[_0xdde3('0xd0')]));if(_0x36348[_0xdde3('0x4b')]['filter']){_0x2f1ca7[_0xdde3('0xd4')]=_[_0xdde3('0xd6')](_0x2f1ca7[_0xdde3('0xd4')],{'$or':_['map'](_0x2f1ca7['attributes'],function(_0x1db3d4){var _0x161624={};_0x161624[_0x1db3d4]={'$like':'%'+_0x36348[_0xdde3('0x4b')]['filter']+'%'};return _0x161624;})});}_0x2f1ca7=_[_0xdde3('0xd6')]({},_0x2f1ca7,_0x36348[_0xdde3('0x5d')]);return _0x4e5e6c['getSmsInteractions'](_0x2f1ca7);}})[_0xdde3('0x21')](function(_0x21781a){if(_0x21781a){_0x39f3c7=_0x21781a['length'];if(!_0x36348[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x2f1ca7[_0xdde3('0x1c')]=qs['limit'](_0x36348['query'][_0xdde3('0x1c')]);_0x2f1ca7[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x36348['query']['offset']);}return _0x4e5e6c['getSmsInteractions'](_0x2f1ca7);}})[_0xdde3('0x21')](function(_0x332c18){if(_0x332c18){return _0x332c18?{'count':_0x39f3c7,'rows':_0x332c18}:null;}})[_0xdde3('0x21')](respondWithResult(_0x1481a2,null))[_0xdde3('0x5a')](handleError(_0x1481a2,null));};exports['getFaxInteractions']=function(_0x19f6af,_0x4c446d){var _0x6c5cae={};var _0x3236e3={};var _0x2cff3a;var _0x4f6f82;return db[_0xdde3('0x48')][_0xdde3('0x97')]({'where':{'id':_0x19f6af[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x4c446d,null))[_0xdde3('0x21')](function(_0x1ddb16){if(_0x1ddb16){_0x2cff3a=_0x1ddb16;_0x3236e3[_0xdde3('0xcd')]=_['keys'](db['FaxInteraction'][_0xdde3('0x3e')]);_0x3236e3['query']=_['keys'](_0x19f6af[_0xdde3('0x4b')]);_0x3236e3['filters']=_['intersection'](_0x3236e3[_0xdde3('0xcd')],_0x3236e3[_0xdde3('0x4b')]);_0x6c5cae['attributes']=_[_0xdde3('0xd8')](_0x3236e3[_0xdde3('0xcd')],qs['fields'](_0x19f6af[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0x6c5cae[_0xdde3('0x4f')]=_0x6c5cae[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x6c5cae[_0xdde3('0x4f')]:_0x3236e3['model'];_0x6c5cae[_0xdde3('0xd2')]=qs['sort'](_0x19f6af[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x6c5cae[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_[_0xdde3('0xd5')](_0x19f6af[_0xdde3('0x4b')],_0x3236e3[_0xdde3('0xd0')]));if(_0x19f6af['query'][_0xdde3('0x41')]){_0x6c5cae[_0xdde3('0xd4')]=_['merge'](_0x6c5cae[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x6c5cae['attributes'],function(_0x2fb737){var _0x302091={};_0x302091[_0x2fb737]={'$like':'%'+_0x19f6af[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x302091;})});}_0x6c5cae=_[_0xdde3('0xd6')]({},_0x6c5cae,_0x19f6af[_0xdde3('0x5d')]);return _0x2cff3a[_0xdde3('0xe5')](_0x6c5cae);}})[_0xdde3('0x21')](function(_0x4f6f7c){if(_0x4f6f7c){_0x4f6f82=_0x4f6f7c[_0xdde3('0x6e')];if(!_0x19f6af['query'][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x6c5cae[_0xdde3('0x1c')]=qs[_0xdde3('0x1c')](_0x19f6af['query'][_0xdde3('0x1c')]);_0x6c5cae[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x19f6af[_0xdde3('0x4b')][_0xdde3('0x1b')]);}return _0x2cff3a['getFaxInteractions'](_0x6c5cae);}})[_0xdde3('0x21')](function(_0x107bed){if(_0x107bed){return _0x107bed?{'count':_0x4f6f82,'rows':_0x107bed}:null;}})['then'](respondWithResult(_0x4c446d,null))[_0xdde3('0x5a')](handleError(_0x4c446d,null));};exports['getWhatsappInteractions']=function(_0x5a4229,_0x37ead3){var _0x3a487b={};var _0x106b5d={};var _0x4bbc2b;var _0xcec4dd;return db[_0xdde3('0x48')][_0xdde3('0x97')]({'where':{'id':_0x5a4229[_0xdde3('0x5c')]['id']}})['then'](handleEntityNotFound(_0x37ead3,null))[_0xdde3('0x21')](function(_0x169f47){if(_0x169f47){_0x4bbc2b=_0x169f47;_0x106b5d[_0xdde3('0xcd')]=_['keys'](db[_0xdde3('0xe6')]['rawAttributes']);_0x106b5d[_0xdde3('0x4b')]=_['keys'](_0x5a4229['query']);_0x106b5d[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x106b5d[_0xdde3('0xcd')],_0x106b5d['query']);_0x3a487b[_0xdde3('0x4f')]=_[_0xdde3('0xd8')](_0x106b5d[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x5a4229[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0x3a487b['attributes']=_0x3a487b['attributes']['length']?_0x3a487b[_0xdde3('0x4f')]:_0x106b5d[_0xdde3('0xcd')];_0x3a487b[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x5a4229[_0xdde3('0x4b')]['sort']);_0x3a487b[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_[_0xdde3('0xd5')](_0x5a4229[_0xdde3('0x4b')],_0x106b5d['filters']));if(_0x5a4229['query'][_0xdde3('0x41')]){_0x3a487b[_0xdde3('0xd4')]=_[_0xdde3('0xd6')](_0x3a487b[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x3a487b['attributes'],function(_0xbc7e01){var _0x2c218c={};_0x2c218c[_0xbc7e01]={'$like':'%'+_0x5a4229[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x2c218c;})});}_0x3a487b=_[_0xdde3('0xd6')]({},_0x3a487b,_0x5a4229['options']);return _0x4bbc2b['getWhatsappInteractions'](_0x3a487b);}})[_0xdde3('0x21')](function(_0x475199){if(_0x475199){_0xcec4dd=_0x475199[_0xdde3('0x6e')];if(!_0x5a4229[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x3a487b['limit']=qs[_0xdde3('0x1c')](_0x5a4229[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0x3a487b[_0xdde3('0x1b')]=qs['offset'](_0x5a4229['query']['offset']);}return _0x4bbc2b[_0xdde3('0xe7')](_0x3a487b);}})['then'](function(_0x5e6f9e){if(_0x5e6f9e){return _0x5e6f9e?{'count':_0xcec4dd,'rows':_0x5e6f9e}:null;}})['then'](respondWithResult(_0x37ead3,null))['catch'](handleError(_0x37ead3,null));};exports['login']=function(_0x17dbc5,_0x557866,_0x1fadd8){var _0x1336fe;var _0x5701f5;var _0x11f067;var _0x13a8d2=!_[_0xdde3('0x68')](_0x17dbc5[_0xdde3('0x5c')]['id'])?_0x17dbc5[_0xdde3('0x5c')]['id']:!_[_0xdde3('0x68')](_0x17dbc5['user']['id'])?_0x17dbc5['user']['id']:null;return db[_0xdde3('0x48')][_0xdde3('0x60')]({'where':{'id':_0x13a8d2,'role':{'$or':[_0xdde3('0x82'),_0xdde3('0x31'),_0xdde3('0x2c')]}},'attributes':['id',_0xdde3('0x38'),'phone',_0xdde3('0xe8'),'role',_0xdde3('0x65'),_0xdde3('0xa0')]})[_0xdde3('0x21')](function(_0x173c0c){if(_0x173c0c){if(_0x173c0c[_0xdde3('0x2b')]===_0xdde3('0x2c')){_0x1336fe=_0x173c0c;if(_0x17dbc5['body'][_0xdde3('0xa1')]){_0x11f067=util[_0xdde3('0xac')](_0xdde3('0xe9'),_0x1336fe[_0x17dbc5[_0xdde3('0x5f')][_0xdde3('0xa1')]]);}else if(_0x17dbc5[_0xdde3('0x5f')]['intrf']){_0x11f067=util[_0xdde3('0xac')](_0xdde3('0xad'),_0x17dbc5[_0xdde3('0x5f')]['intrf']);}else{_0x11f067=util[_0xdde3('0xac')]('SIP/%s',_0x1336fe['name']);}socket['to'](util[_0xdde3('0xac')](_0xdde3('0xea'),_0x1336fe[_0xdde3('0x38')]))['emit'](_0xdde3('0xeb'),{'user':{'id':_0x1336fe['id'],'name':_0x1336fe[_0xdde3('0x38')]},'ip':_0x17dbc5['headers'][_0xdde3('0xec')]||_0x17dbc5['connection'][_0xdde3('0xed')]||_0x17dbc5[_0xdde3('0xee')]['remoteAddress']||_0x17dbc5[_0xdde3('0xef')][_0xdde3('0xee')][_0xdde3('0xed')]});return db[_0xdde3('0xae')]['destroy']({'where':{'membername':_0x1336fe[_0xdde3('0x38')]},'individualHooks':!![]});}}else{throw new db[(_0xdde3('0x92'))][(_0xdde3('0x93'))](_0xdde3('0xf0'));}})[_0xdde3('0x21')](function(){if(_0x1336fe){return _0x1336fe[_0xdde3('0xf1')]({'raw':!![]});}})['then'](function(_0x4baeff){if(_0x1336fe){if(_0x4baeff){_0x5701f5=_0x4baeff;if(_0x5701f5['length']){var _0x34eb31=_0x5701f5[_0xdde3('0x35')](function(_0x37bfdf){var _0x49b93d={'membername':_0x1336fe[_0xdde3('0x38')],'UserId':_0x1336fe['id'],'queue_name':_0x37bfdf[_0xdde3('0x38')],'VoiceQueueId':_0x37bfdf['id'],'interface':_0x11f067,'paused':_0x1336fe[_0xdde3('0xa0')]||![],'penalty':_0x37bfdf[_0xdde3('0xf2')]||0x0};return db[_0xdde3('0xae')]['upsert'](_0x49b93d);});return Promise[_0xdde3('0x5e')](_0x34eb31);}}}})[_0xdde3('0x21')](function(){if(_0x1336fe){return db[_0xdde3('0xf3')][_0xdde3('0x51')]({'where':{'membername':_0x1336fe[_0xdde3('0x38')],'exitAt':null}});}})['then'](function(_0x70ae58){if(_0x1336fe){var _0x4e500a=[];_0x70ae58[_0xdde3('0xf4')](function(_0x1b66d3){_0x4e500a[_0xdde3('0x50')](_0x1b66d3[_0xdde3('0x2a')]({'exitAt':moment()[_0xdde3('0xac')](_0xdde3('0xf5'))}));});return Promise[_0xdde3('0x5e')](_0x4e500a);}})[_0xdde3('0x21')](function(){if(_0x1336fe){var _0x3ba6fd=[];var _0x2276c5=[];var _0x2aa794=utils[_0xdde3('0xf6')]();var _0x55fdde={'membername':_0x1336fe[_0xdde3('0x38')],'interface':_0x11f067,'enterAt':moment()[_0xdde3('0xac')](_0xdde3('0xf5')),'role':_0x1336fe[_0xdde3('0x2b')],'internal':_0x1336fe[_0xdde3('0x65')]};_0x2aa794[_0xdde3('0xf4')](function(_0x55662e){_0x3ba6fd[_0xdde3('0x50')](_[_0xdde3('0xd6')]({'channel':_0x55662e,'type':_0xdde3('0xf7'),'data1':_0x17dbc5[_0xdde3('0x5f')][_0xdde3('0xf8')],'data2':_0x11f067},_0x55fdde));if(_0x1336fe[_0xdde3('0xa0')]){_0x2276c5['push'](_[_0xdde3('0xd6')]({'channel':_0x55662e,'type':_0xdde3('0xf9'),'data1':_0xdde3('0xfa')},_0x55fdde));}});return db['MemberReport'][_0xdde3('0x8b')](_0x3ba6fd[_0xdde3('0xc6')](_0x2276c5),{'individualHooks':!![]});}})[_0xdde3('0x21')](function(){if(_0x1336fe){return _0x1336fe[_0xdde3('0x2a')]({'online':!![],'lastLoginAt':moment()[_0xdde3('0xac')](_0xdde3('0xf5')),'voicePause':_0x1336fe[_0xdde3('0xa0')]||![],'mailPause':_0x1336fe[_0xdde3('0xa0')]||![],'chatPause':_0x1336fe[_0xdde3('0xa0')]||![],'faxPause':_0x1336fe['loginInPause']||![],'smsPause':_0x1336fe['loginInPause']||![],'openchannelPause':_0x1336fe[_0xdde3('0xa0')]||![],'whatsappPause':_0x1336fe['loginInPause']||![],'pauseType':_0x1336fe[_0xdde3('0xa0')]?'LOGININPAUSE':null,'interface':_0x11f067,'lastPauseAt':moment()[_0xdde3('0xac')](_0xdde3('0xf5'))});}})[_0xdde3('0x21')](function(_0x1c4af5){if(_0x17dbc5['isMiddleware']){return _0x1fadd8();}else{return Promise[_0xdde3('0xfb')](_0x1c4af5)['then'](respondWithResult(_0x557866,null));}})[_0xdde3('0x5a')](handleError(_0x557866,null));};exports[_0xdde3('0xfc')]=function(_0x1302d1,_0x219810){var _0x5a3f24;return db[_0xdde3('0x48')]['find']({'where':{'id':_0x1302d1[_0xdde3('0x5c')]['id'],'role':'agent'},'attributes':['id',_0xdde3('0x38'),_0xdde3('0x2b')]})[_0xdde3('0x21')](handleEntityNotFound(_0x219810,null))['then'](function(_0x2e911f){if(_0x2e911f){_0x5a3f24=_0x2e911f;return db[_0xdde3('0xae')]['destroy']({'where':{'membername':_0x5a3f24['name']},'individualHooks':!![]});}})[_0xdde3('0x21')](function(){return db['MemberReport'][_0xdde3('0x51')]({'where':{'membername':_0x5a3f24[_0xdde3('0x38')],'exitAt':null}});})['then'](function(_0x1c9e8d){var _0x258ce3=[];_0x1c9e8d[_0xdde3('0xf4')](function(_0x50be1f){_0x258ce3[_0xdde3('0x50')](_0x50be1f[_0xdde3('0x2a')]({'exitAt':moment()[_0xdde3('0xac')](_0xdde3('0xf5'))}));});return Promise[_0xdde3('0x5e')](_0x258ce3);})[_0xdde3('0x21')](function(){return _0x5a3f24[_0xdde3('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xdde3('0x21')](respondWithResult(_0x219810,null))[_0xdde3('0x5a')](handleError(_0x219810,null));};exports[_0xdde3('0xfd')]=function(_0x5e078a,_0x3cef71){var _0x5d792d;return db[_0xdde3('0xae')][_0xdde3('0x2a')]({'paused':0x1},{'where':{'UserId':_0x5e078a[_0xdde3('0x5c')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xdde3('0x48')][_0xdde3('0x60')]({'where':{'id':_0x5e078a['params']['id'],'role':_0xdde3('0x2c')},'attributes':['id','name','role',_0xdde3('0x65'),_0xdde3('0xa1'),_0xdde3('0x9f')]});})['then'](handleEntityNotFound(_0x3cef71,null))[_0xdde3('0x21')](function(_0x5121c6){if(_0x5121c6){_0x5d792d=_0x5121c6;return respondWithRpcPromise('QueuePause','pause',{'id':_0x5d792d['id'],'name':_0x5d792d[_0xdde3('0x38')],'pause':!![]});}})['then'](function(){if(_0x5d792d){return db[_0xdde3('0xf3')][_0xdde3('0x51')]({'where':{'membername':_0x5d792d['name'],'type':_0xdde3('0xf9'),'exitAt':null}});}})[_0xdde3('0x21')](function(_0x1fd25b){if(_0x1fd25b[_0xdde3('0x6e')]){var _0x1ef334=moment()[_0xdde3('0xac')](_0xdde3('0xf5'));for(var _0x29d0fc=0x0,_0x156043=_0x1fd25b[_0xdde3('0x6e')];_0x29d0fc<_0x156043;_0x29d0fc++){_0x1fd25b[_0x29d0fc]['updateAttributes']({'exitAt':_0x1ef334});}}})[_0xdde3('0x21')](function(){var _0x484ad0=[];var _0x5b26d9=utils['getChannels']();_0x5b26d9[_0xdde3('0xf4')](function(_0x3540a5){_0x484ad0[_0xdde3('0x50')]({'channel':_0x3540a5,'membername':_0x5d792d[_0xdde3('0x38')],'interface':_[_0xdde3('0x68')](_0x5d792d[_0xdde3('0xa1')])?util[_0xdde3('0xac')](_0xdde3('0xad'),_0x5d792d[_0xdde3('0x38')]):_0x5d792d[_0xdde3('0xa1')],'type':_0xdde3('0xf9'),'enterAt':moment()[_0xdde3('0xac')](_0xdde3('0xf5')),'data1':_0x5e078a[_0xdde3('0x5f')][_0xdde3('0x3f')]||_0xdde3('0xfe'),'role':_0x5d792d[_0xdde3('0x2b')],'internal':_0x5d792d[_0xdde3('0x65')]});});return db[_0xdde3('0xf3')][_0xdde3('0x8b')](_0x484ad0,{'individualHooks':!![]});})[_0xdde3('0x21')](function(){return _0x5d792d['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5e078a[_0xdde3('0x5f')][_0xdde3('0x3f')]||_0xdde3('0xfe'),'lastPauseAt':moment()[_0xdde3('0xac')](_0xdde3('0xf5'))});})[_0xdde3('0x21')](respondWithResult(_0x3cef71,null))[_0xdde3('0x5a')](handleError(_0x3cef71,null));};exports[_0xdde3('0xff')]=function(_0x5332b7,_0xbeaddf){if(_0x5332b7[_0xdde3('0x5f')][_0xdde3('0x9e')]&&!utils[_0xdde3('0xa2')](_0x5332b7[_0xdde3('0x5f')]['channel'])){throw new APIBadRequestError(util[_0xdde3('0xac')](_0xdde3('0x100'),_0x5332b7['body'][_0xdde3('0x9e')]));}return db[_0xdde3('0x48')]['find']({'where':{'id':_0x5332b7[_0xdde3('0x5c')]['id']},'attributes':['id',_0xdde3('0x38'),'role',_0xdde3('0x65'),_0xdde3('0xa1'),_0xdde3('0x9f'),_0xdde3('0x101'),_0xdde3('0x102'),_0xdde3('0x103'),_0xdde3('0x104'),_0xdde3('0x105'),_0xdde3('0x106'),_0xdde3('0x107'),_0xdde3('0x108'),_0xdde3('0x109')]})[_0xdde3('0x21')](function(_0x4702d5){if(!_0x4702d5){throw new APINotFoundError(util[_0xdde3('0xac')](_0xdde3('0x10a'),_0x5332b7[_0xdde3('0x5c')]['id']));}return _0x4702d5['unpause'](_0x5332b7['body'][_0xdde3('0x9e')]);})['then'](respondWithResult(_0xbeaddf,null))[_0xdde3('0x5a')](APIHandleError(_0xbeaddf));};exports[_0xdde3('0x10b')]=function(_0x2a2484,_0x2e7230){var _0x232fc9={};var _0x4f4811={};var _0x392f6c;var _0x30bd0a;return db[_0xdde3('0x48')][_0xdde3('0x97')]({'where':{'id':_0x2a2484[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x2e7230,null))[_0xdde3('0x21')](function(_0x889b27){if(_0x889b27){_0x392f6c=_0x889b27;_0x4f4811[_0xdde3('0xcd')]=_['keys'](db[_0xdde3('0x10c')][_0xdde3('0x3e')]);_0x4f4811['query']=_['keys'](_0x2a2484[_0xdde3('0x4b')]);_0x4f4811[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x4f4811[_0xdde3('0xcd')],_0x4f4811[_0xdde3('0x4b')]);_0x232fc9[_0xdde3('0x4f')]=_[_0xdde3('0xd8')](_0x4f4811[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x2a2484[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0x232fc9[_0xdde3('0x4f')]=_0x232fc9[_0xdde3('0x4f')]['length']?_0x232fc9[_0xdde3('0x4f')]:_0x4f4811[_0xdde3('0xcd')];_0x232fc9[_0xdde3('0xd2')]=qs['sort'](_0x2a2484['query'][_0xdde3('0xd3')]);_0x232fc9[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_[_0xdde3('0xd5')](_0x2a2484[_0xdde3('0x4b')],_0x4f4811[_0xdde3('0xd0')]));if(_0x2a2484['query'][_0xdde3('0x41')]){_0x232fc9[_0xdde3('0xd4')]=_['merge'](_0x232fc9[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x232fc9[_0xdde3('0x4f')],function(_0x5e4d30){var _0x213295={};_0x213295[_0x5e4d30]={'$like':'%'+_0x2a2484[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x213295;})});}_0x232fc9=_[_0xdde3('0xd6')]({},_0x232fc9,_0x2a2484[_0xdde3('0x5d')]);return _0x392f6c[_0xdde3('0x10b')](_0x232fc9);}})[_0xdde3('0x21')](function(_0x41744e){if(_0x41744e){_0x30bd0a=_0x41744e[_0xdde3('0x6e')];if(!_0x2a2484['query']['hasOwnProperty'](_0xdde3('0xd7'))){_0x232fc9[_0xdde3('0x1c')]=qs['limit'](_0x2a2484[_0xdde3('0x4b')][_0xdde3('0x1c')]);_0x232fc9[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x2a2484[_0xdde3('0x4b')]['offset']);}return _0x392f6c['getTeams'](_0x232fc9);}})[_0xdde3('0x21')](function(_0x29b114){if(_0x29b114){return _0x29b114?{'count':_0x30bd0a,'rows':_0x29b114}:null;}})[_0xdde3('0x21')](respondWithResult(_0x2e7230,null))['catch'](handleError(_0x2e7230,null));};exports[_0xdde3('0x10d')]=function(_0x70b567,_0x5dcacb){var _0x1586be=_0x70b567[_0xdde3('0x5c')]['id'];var _0x193619=_0x70b567[_0xdde3('0x5f')]?_0x70b567[_0xdde3('0x5f')][_0xdde3('0x63')]:null;var _0x573175=[];return Promise[_0xdde3('0xfb')]()[_0xdde3('0x21')](function(){if(!_0x193619)throw new APIBadRequestError(_0xdde3('0x10e'));})['then'](function(){return db[_0xdde3('0x48')][_0xdde3('0x97')]({'where':{'id':_0x1586be}});})['then'](function(_0x45bce5){if(!_0x45bce5)throw new APINotFoundError(util[_0xdde3('0xac')]('User\x20with\x20id\x20%s\x20not\x20found',_0x70b567[_0xdde3('0x5c')]['id']));return db[_0xdde3('0x6b')][_0xdde3('0x10f')](function(_0x11478e){return _0x45bce5[_0xdde3('0x10d')](_0x193619,{'transaction':_0x11478e})[_0xdde3('0x21')](function(){return db[_0xdde3('0x10c')][_0xdde3('0x51')]({'where':{'id':{'$in':_0x193619}}});})[_0xdde3('0x21')](function(_0x2893d8){var _0x4e0e9c=_[_0xdde3('0x35')](_0x2893d8,function(_0x1c855a){return _0x1c855a[_0xdde3('0x110')]();});return Promise[_0xdde3('0x5e')](_0x4e0e9c);})['then'](function(_0x43021a){_0x573175=_['flattenDeep'](_0x43021a);var _0x5087e8=_[_0xdde3('0x35')](_0x573175,function(_0x487458){return _0x487458[_0xdde3('0x111')](_0x45bce5['id'],{'transaction':_0x11478e});});return Promise['all'](_0x5087e8);})[_0xdde3('0x21')](function(){if(!_0x45bce5['online'])return;var _0x2732b0=_[_0xdde3('0x41')](_0x573175,function(_0x142df3){return _0x142df3[_0xdde3('0x112')](_0xdde3('0x9e'))===_0xdde3('0x113');});var _0xce47b3=_[_0xdde3('0x35')](_0x2732b0,function(_0x42d943){return db['UserVoiceQueueRt'][_0xdde3('0x114')]({'membername':_0x45bce5[_0xdde3('0x38')],'UserId':_0x45bce5['id'],'queue_name':_0x42d943[_0xdde3('0x38')],'VoiceQueueId':_0x42d943['id'],'interface':_[_0xdde3('0x68')](_0x45bce5[_0xdde3('0xa1')])?util[_0xdde3('0xac')](_0xdde3('0xad'),_0x45bce5['name']):_0x45bce5[_0xdde3('0xa1')],'paused':_0x45bce5[_0xdde3('0x101')]||![],'penalty':_0x45bce5[_0xdde3('0xa7')]},{'transaction':_0x11478e});});return Promise[_0xdde3('0x5e')](_0xce47b3);})[_0xdde3('0x21')](function(){return db[_0xdde3('0x115')][_0xdde3('0x51')]({'where':{'teamId':{'$in':_0x193619}}});})[_0xdde3('0x21')](function(_0x2b2a9b){var _0xcfbc4=_[_0xdde3('0x35')](_0x2b2a9b,function(_0x57fa2f){return db['UserVoicePrefix'][_0xdde3('0x88')]({'UserId':_0x45bce5['id'],'VoicePrefixId':_0x57fa2f[_0xdde3('0x116')]},{'transaction':_0x11478e});});return Promise[_0xdde3('0x5e')](_0xcfbc4);});});})[_0xdde3('0x21')](function(){for(var _0x1c8b4b=0x0;_0x1c8b4b<_0x573175[_0xdde3('0x6e')];_0x1c8b4b++){var _0x169af3=_0x573175[_0x1c8b4b]['getDataValue']('channel');var _0x557f1f=_0x169af3+_0xdde3('0xa9');socket['emit'](_0xdde3('0x31')+_0x169af3+_0xdde3('0x117'),{'UserId':_0x1586be,['queueField']:_0x573175[_0x1c8b4b]['id']});}})[_0xdde3('0x21')](respondWithStatusCode(_0x5dcacb,null))[_0xdde3('0x5a')](APIHandleError(_0x5dcacb));};exports[_0xdde3('0x118')]=function(_0x4bbae1,_0x2d0cda){var _0x4ee520=_0x4bbae1[_0xdde3('0x5c')]['id'];var _0x2a0abd=null;if(_0x4bbae1['query'][_0xdde3('0x63')]){_0x2a0abd=_[_0xdde3('0xb1')](_0x4bbae1[_0xdde3('0x4b')]['ids'])?_0x4bbae1[_0xdde3('0x4b')]['ids']:[_0x4bbae1['query']['ids']];}var _0x5c105e=[];return Promise[_0xdde3('0xfb')]()[_0xdde3('0x21')](function(){if(!_0x2a0abd)throw new APIBadRequestError(_0xdde3('0x119'));})[_0xdde3('0x21')](function(){return db['User'][_0xdde3('0x97')]({'where':{'id':_0x4ee520}});})[_0xdde3('0x21')](function(_0x326a6f){if(!_0x326a6f)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x4bbae1[_0xdde3('0x5c')]['id']));return db[_0xdde3('0x6b')][_0xdde3('0x10f')](function(_0x194510){return _0x326a6f['removeTeams'](_0x2a0abd,{'transaction':_0x194510})[_0xdde3('0x21')](function(){return db[_0xdde3('0x10c')][_0xdde3('0x51')]({'where':{'id':{'$in':_0x2a0abd}}});})['then'](function(_0x2ea0df){var _0x3a5489=_['map'](_0x2ea0df,function(_0x5cb7cd){return _0x5cb7cd['getAssociatedQueues']();});return Promise[_0xdde3('0x5e')](_0x3a5489);})['then'](function(_0x42620d){_0x5c105e=_[_0xdde3('0x11a')](_0x42620d);var _0x4b8352=_[_0xdde3('0x35')](_0x5c105e,function(_0x20ba97){return _0x20ba97['removeAgent'](_0x326a6f['id'],{'transaction':_0x194510});});return Promise[_0xdde3('0x5e')](_0x4b8352);})[_0xdde3('0x21')](function(){if(!_0x326a6f[_0xdde3('0x9f')])return;var _0x3947f1=_[_0xdde3('0x41')](_0x5c105e,function(_0x1835a9){return _0x1835a9[_0xdde3('0x112')]('channel')==='Voice';});var _0x2a32b8=_[_0xdde3('0x35')](_0x3947f1,function(_0xf08fb7){return db['UserVoiceQueueRt'][_0xdde3('0x3a')]({'where':{'VoiceQueueId':_0xf08fb7['id'],'UserId':_0x326a6f['id']},'transaction':_0x194510});});return Promise[_0xdde3('0x5e')](_0x2a32b8);})[_0xdde3('0x21')](function(){return db[_0xdde3('0x115')][_0xdde3('0x51')]({'where':{'teamId':{'$in':_0x2a0abd}}});})[_0xdde3('0x21')](function(_0xfdf8c6){var _0x48d6cf=_[_0xdde3('0x35')](_0xfdf8c6,function(_0x32320b){return db['UserVoicePrefix'][_0xdde3('0x3a')]({'where':{'UserId':_0x326a6f['id'],'VoicePrefixId':_0x32320b['VoicePrefixId']}},{'transaction':_0x194510});});return Promise['all'](_0x48d6cf);});});})[_0xdde3('0x21')](function(){for(var _0x3945b1=0x0;_0x3945b1<_0x5c105e[_0xdde3('0x6e')];_0x3945b1++){var _0x1ef16c=_0x5c105e[_0x3945b1][_0xdde3('0x112')]('channel');var _0x3468e0=_0x1ef16c+'QueueId';socket[_0xdde3('0x2d')](_0xdde3('0x31')+_0x1ef16c+_0xdde3('0xb2'),{'UserId':_0x4ee520,['queueField']:_0x5c105e[_0x3945b1]['id']});}})[_0xdde3('0x21')](respondWithStatusCode(_0x2d0cda,null))[_0xdde3('0x5a')](APIHandleError(_0x2d0cda));};exports[_0xdde3('0x11b')]=function(_0x1e2204,_0x35fc9c){var _0x45e32b={};var _0x4d5b17={};var _0x42af80;var _0x109b5a;return db[_0xdde3('0x48')]['findOne']({'where':{'id':_0x1e2204['params']['id']}})['then'](handleEntityNotFound(_0x35fc9c,null))[_0xdde3('0x21')](function(_0x999d3b){if(_0x999d3b){_0x42af80=_0x999d3b;_0x4d5b17['model']=_[_0xdde3('0xce')](db[_0xdde3('0x11c')]['rawAttributes']);_0x4d5b17['query']=_['keys'](_0x1e2204['query']);_0x4d5b17[_0xdde3('0xd0')]=_['intersection'](_0x4d5b17['model'],_0x4d5b17[_0xdde3('0x4b')]);_0x45e32b['attributes']=_[_0xdde3('0xd8')](_0x4d5b17[_0xdde3('0xcd')],qs[_0xdde3('0xd1')](_0x1e2204['query'][_0xdde3('0xd1')]));_0x45e32b[_0xdde3('0x4f')]=_0x45e32b[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x45e32b[_0xdde3('0x4f')]:_0x4d5b17[_0xdde3('0xcd')];_0x45e32b[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x1e2204[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x45e32b[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_['pick'](_0x1e2204[_0xdde3('0x4b')],_0x4d5b17[_0xdde3('0xd0')]));if(_0x1e2204['query'][_0xdde3('0x41')]){_0x45e32b[_0xdde3('0xd4')]=_[_0xdde3('0xd6')](_0x45e32b[_0xdde3('0xd4')],{'$or':_[_0xdde3('0x35')](_0x45e32b[_0xdde3('0x4f')],function(_0xbdad2d){var _0x50a0b3={};_0x50a0b3[_0xbdad2d]={'$like':'%'+_0x1e2204[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x50a0b3;})});}_0x45e32b=_[_0xdde3('0xd6')]({},_0x45e32b,_0x1e2204[_0xdde3('0x5d')]);return _0x42af80[_0xdde3('0x11b')](_0x45e32b);}})[_0xdde3('0x21')](function(_0x48e7ea){if(_0x48e7ea){_0x109b5a=_0x48e7ea[_0xdde3('0x6e')];if(!_0x1e2204[_0xdde3('0x4b')][_0xdde3('0xc8')](_0xdde3('0xd7'))){_0x45e32b['limit']=qs[_0xdde3('0x1c')](_0x1e2204[_0xdde3('0x4b')]['limit']);_0x45e32b[_0xdde3('0x1b')]=qs[_0xdde3('0x1b')](_0x1e2204['query']['offset']);}return _0x42af80[_0xdde3('0x11b')](_0x45e32b);}})[_0xdde3('0x21')](function(_0x1fecdf){if(_0x1fecdf){return _0x1fecdf?{'count':_0x109b5a,'rows':_0x1fecdf}:null;}})[_0xdde3('0x21')](respondWithResult(_0x35fc9c,null))[_0xdde3('0x5a')](handleError(_0x35fc9c,null));};exports['getAgents']=function(_0x57cf77,_0x4e826f){var _0x5b39a8={};var _0x2cb653={};var _0x122e05;return db[_0xdde3('0x48')]['findOne']({'where':{'id':_0x57cf77[_0xdde3('0x5c')]['id']}})[_0xdde3('0x21')](handleEntityNotFound(_0x4e826f,null))[_0xdde3('0x21')](function(_0x22287c){if(_0x22287c){_0x122e05=_0x22287c;_0x2cb653[_0xdde3('0xcd')]=_[_0xdde3('0xce')](db[_0xdde3('0x48')][_0xdde3('0x3e')]);_0x2cb653['query']=_[_0xdde3('0xce')](_0x57cf77[_0xdde3('0x4b')]);_0x2cb653[_0xdde3('0xd0')]=_[_0xdde3('0xd8')](_0x2cb653[_0xdde3('0xcd')],_0x2cb653[_0xdde3('0x4b')]);_0x5b39a8[_0xdde3('0x4f')]=_['intersection'](_0x2cb653[_0xdde3('0xcd')],qs['fields'](_0x57cf77[_0xdde3('0x4b')][_0xdde3('0xd1')]));_0x5b39a8[_0xdde3('0x4f')]=_0x5b39a8[_0xdde3('0x4f')][_0xdde3('0x6e')]?_0x5b39a8['attributes']:_0x2cb653[_0xdde3('0xcd')];_0x5b39a8[_0xdde3('0xd2')]=qs[_0xdde3('0xd3')](_0x57cf77[_0xdde3('0x4b')][_0xdde3('0xd3')]);_0x5b39a8[_0xdde3('0xd4')]=qs[_0xdde3('0xd0')](_[_0xdde3('0xd5')](_0x57cf77[_0xdde3('0x4b')],_0x2cb653[_0xdde3('0xd0')]));if(_0x57cf77['query'][_0xdde3('0x41')]){_0x5b39a8['where']=_[_0xdde3('0xd6')](_0x5b39a8['where'],{'$or':_[_0xdde3('0x35')](_0x5b39a8[_0xdde3('0x4f')],function(_0x1e3abf){var _0x1e4471={};_0x1e4471[_0x1e3abf]={'$like':'%'+_0x57cf77[_0xdde3('0x4b')][_0xdde3('0x41')]+'%'};return _0x1e4471;})});}_0x5b39a8[_0xdde3('0xcd')]=db[_0xdde3('0x48')];_0x5b39a8['as']='Agents';_0x5b39a8=_[_0xdde3('0xd6')]({},_0x5b39a8,_0x57cf77['options']);return _0x122e05[_0xdde3('0xf1')]({'include':[_0x5b39a8]});}})[_0xdde3('0x21')](function(_0x49007c){if(_0x49007c){var _0x57e442={},_0x4a1024=[];for(var _0xaeaf6=0x0;_0xaeaf6<_0x49007c['length'];_0xaeaf6+=0x1){for(var _0x373688=0x0,_0x4b7842;_0x373688<_0x49007c[_0xaeaf6][_0xdde3('0x32')][_0xdde3('0x6e')];_0x373688+=0x1){_0x4b7842=_0x49007c[_0xaeaf6][_0xdde3('0x32')][_0x373688][_0xdde3('0x2f')]({'plain':!![]});_0x57e442[_0x4b7842['id']]=_0x4b7842;}}_0x57e442=_[_0xdde3('0x11d')](_0x57e442);for(var _0x30498a=qs[_0xdde3('0x1b')](_0x57cf77['query'][_0xdde3('0x1b')]);_0x30498a<_0x57e442[_0xdde3('0x6e')]&&_0x4a1024[_0xdde3('0x6e')]=_0x489a0b[_0x3db9('0x52')]){throw new Error(_0x3db9('0x53'));}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return db[_0x3db9('0x27')]['destroy']({'where':{'membername':_0x4c4cf2[_0x3db9('0x21')]},'individualHooks':!![]});}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return _0x4c4cf2['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x2f631c){if(_0x4c4cf2){if(_0x2f631c){var _0x70d675=[];_0x14d68c=_0x2f631c;if(_0x14d68c['length']){for(var _0x4c505b=0x0;_0x4c505b<_0x14d68c[_0x3db9('0x2b')];_0x4c505b++){_0x70d675[_0x3db9('0x49')](db[_0x3db9('0x27')][_0x3db9('0x54')]({'membername':_0x4c4cf2[_0x3db9('0x21')],'UserId':_0x4c4cf2['id'],'queue_name':_0x14d68c[_0x4c505b][_0x3db9('0x21')],'VoiceQueueId':_0x14d68c[_0x4c505b]['id'],'interface':_0x3c2720,'paused':_0x4c4cf2[_0x3db9('0x4e')]||![],'penalty':_0x14d68c[_0x4c505b][_0x3db9('0x55')]||0x0}));}return BPromise['all'](_0x70d675);}}}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return db[_0x3db9('0x29')][_0x3db9('0xd')]({'where':{'membername':_0x4c4cf2[_0x3db9('0x21')],'exitAt':null}});}})[_0x3db9('0x14')](function(_0x1410c2){if(_0x4c4cf2){if(_0x1410c2&&_0x1410c2[_0x3db9('0x2b')]){var _0x3a59a6=[];_0x1410c2[_0x3db9('0x2d')](function(_0x383515){_0x3a59a6['push'](_0x383515[_0x3db9('0x28')]({'exitAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c'))}));});return BPromise['all'](_0x3a59a6);}}})['then'](function(){if(_0x4c4cf2){var _0x5db6ef=[];var _0xc2f61e=[];var _0x2ca18a=utils[_0x3db9('0x56')]();var _0x147775={'membername':_0x4c4cf2[_0x3db9('0x21')],'interface':_0x3c2720,'enterAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c')),'role':_0x4c4cf2['role'],'internal':_0x4c4cf2[_0x3db9('0x31')]};_0x2ca18a[_0x3db9('0x2d')](function(_0x1f493c){_0x5db6ef[_0x3db9('0x49')](_['merge']({'channel':_0x1f493c,'type':_0x3db9('0x57'),'data1':_0x3db9('0x58'),'data2':_0x3c2720},_0x147775));if(_0x4c4cf2[_0x3db9('0x4e')]){_0xc2f61e[_0x3db9('0x49')](_[_0x3db9('0x59')]({'channel':_0x1f493c,'type':_0x3db9('0x2a'),'data1':_0x3db9('0x5a')},_0x147775));}});return db['MemberReport'][_0x3db9('0x33')](_0x5db6ef[_0x3db9('0x5b')](_0xc2f61e),{'individualHooks':!![]});}})[_0x3db9('0x14')](function(){if(_0x4c4cf2){return _0x4c4cf2['update']({'online':!![],'lastLoginAt':moment()[_0x3db9('0x24')](_0x3db9('0x2c')),'voicePause':_0x4c4cf2['loginInPause']||![],'mailPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'chatPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'faxPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'smsPause':_0x4c4cf2[_0x3db9('0x4e')]||![],'openchannelPause':_0x4c4cf2['loginInPause']||![],'pauseType':_0x4c4cf2[_0x3db9('0x4e')]?_0x3db9('0x5a'):null,'lastPauseAt':moment()[_0x3db9('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x3c2720});}})['then'](function(_0x681cf9){_0x3c944b(_0x681cf9);})[_0x3db9('0x19')](function(_0xadd713){_0x44ec67(_0x567088[_0x3db9('0x1a')](0x1f4,_0xadd713['message']));});});}; \ No newline at end of file +var _0x8895=['resolve','isValidChannel','channel','findOne','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','params','system','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','all','merge','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','defaults','redis','localhost','register','User','findAll','options','raw','where','attributes','limit','include','model','map','then','info','GetUser','debug','stringify','error','message','find','catch','PauseUser','name','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','MemberReport','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','body','type','role','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8895,0x1d3));var _0x5889=function(_0xee58c6,_0x1436dd){_0xee58c6=_0xee58c6-0x0;var _0x2edf40=_0x8895[_0xee58c6];return _0x2edf40;};'use strict';var _=require(_0x5889('0x0'));var util=require(_0x5889('0x1'));var moment=require(_0x5889('0x2'));var BPromise=require(_0x5889('0x3'));var Redis=require(_0x5889('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5889('0x5'))(_0x5889('0x6'));var config=require('../../config/environment');config['redis']=_[_0x5889('0x7')](config[_0x5889('0x8')],{'host':_0x5889('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5889('0x8')]));require('./user.socket')[_0x5889('0xa')](socket);exports['GetUser']=function(_0x25a7d5){var _0x2263a5=this;return new Promise(function(_0x3facc3,_0xe3a2b9){return db[_0x5889('0xb')][_0x5889('0xc')]({'raw':_0x25a7d5[_0x5889('0xd')]?_0x25a7d5[_0x5889('0xd')][_0x5889('0xe')]===undefined?!![]:![]:!![],'where':_0x25a7d5['options']?_0x25a7d5[_0x5889('0xd')][_0x5889('0xf')]||null:null,'attributes':_0x25a7d5['options']?_0x25a7d5[_0x5889('0xd')][_0x5889('0x10')]||null:null,'limit':_0x25a7d5[_0x5889('0xd')]?_0x25a7d5[_0x5889('0xd')][_0x5889('0x11')]||null:null,'include':_0x25a7d5[_0x5889('0xd')]?_0x25a7d5[_0x5889('0xd')][_0x5889('0x12')]?_['map'](_0x25a7d5[_0x5889('0xd')][_0x5889('0x12')],function(_0x15df4d){return{'model':db[_0x15df4d[_0x5889('0x13')]],'as':_0x15df4d['as'],'attributes':_0x15df4d[_0x5889('0x10')],'include':_0x15df4d[_0x5889('0x12')]?_[_0x5889('0x14')](_0x15df4d['include'],function(_0x1b2416){return{'model':db[_0x1b2416[_0x5889('0x13')]],'as':_0x1b2416['as'],'attributes':_0x1b2416[_0x5889('0x10')],'include':_0x1b2416[_0x5889('0x12')]?_['map'](_0x1b2416[_0x5889('0x12')],function(_0x59ccd0){return{'model':db[_0x59ccd0[_0x5889('0x13')]],'as':_0x59ccd0['as'],'attributes':_0x59ccd0[_0x5889('0x10')]};}):[]};}):[]};}):[]:[]})[_0x5889('0x15')](function(_0x4436a1){logger[_0x5889('0x16')](_0x5889('0x17'),_0x25a7d5);logger[_0x5889('0x18')](_0x5889('0x17'),_0x25a7d5,JSON[_0x5889('0x19')](_0x4436a1));_0x3facc3(_0x4436a1);})['catch'](function(_0x2fb62e){logger[_0x5889('0x1a')](_0x5889('0x17'),_0x2fb62e[_0x5889('0x1b')],_0x25a7d5);_0xe3a2b9(_0x2263a5[_0x5889('0x1a')](0x1f4,_0x2fb62e[_0x5889('0x1b')]));});});};exports['ShowUser']=function(_0x392764){var _0x5147c1=this;return new Promise(function(_0x2073ac,_0x1993c7){return db['User'][_0x5889('0x1c')]({'raw':_0x392764[_0x5889('0xd')]?_0x392764[_0x5889('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x392764['options']?_0x392764[_0x5889('0xd')][_0x5889('0xf')]||null:null,'attributes':_0x392764['options']?_0x392764[_0x5889('0xd')][_0x5889('0x10')]||null:null,'include':_0x392764[_0x5889('0xd')]?_0x392764[_0x5889('0xd')]['include']?_[_0x5889('0x14')](_0x392764[_0x5889('0xd')][_0x5889('0x12')],function(_0x6dc143){return{'model':db[_0x6dc143[_0x5889('0x13')]],'as':_0x6dc143['as'],'attributes':_0x6dc143['attributes'],'include':_0x6dc143[_0x5889('0x12')]?_[_0x5889('0x14')](_0x6dc143[_0x5889('0x12')],function(_0x267191){return{'model':db[_0x267191[_0x5889('0x13')]],'as':_0x267191['as'],'attributes':_0x267191[_0x5889('0x10')],'include':_0x267191[_0x5889('0x12')]?_[_0x5889('0x14')](_0x267191[_0x5889('0x12')],function(_0x557beb){return{'model':db[_0x557beb[_0x5889('0x13')]],'as':_0x557beb['as'],'attributes':_0x557beb[_0x5889('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58628d){logger['info']('ShowUser',_0x392764);logger[_0x5889('0x18')]('ShowUser',_0x392764,JSON[_0x5889('0x19')](_0x58628d));_0x2073ac(_0x58628d);})[_0x5889('0x1d')](function(_0x300af2){logger[_0x5889('0x1a')]('ShowUser',_0x300af2[_0x5889('0x1b')],_0x392764);_0x1993c7(_0x5147c1[_0x5889('0x1a')](0x1f4,_0x300af2[_0x5889('0x1b')]));});});};exports[_0x5889('0x1e')]=function(_0x31f48e){var _0x22c5af;return db[_0x5889('0xb')][_0x5889('0x1c')]({'where':_0x31f48e[_0x5889('0xd')]['where']||{},'attributes':['id',_0x5889('0x1f'),'role',_0x5889('0x20'),_0x5889('0x21')]})[_0x5889('0x15')](function(_0x1a38dc){if(!_0x1a38dc){throw new Error(util[_0x5889('0x22')](_0x5889('0x23'),_0x31f48e['params']['id']));}_0x22c5af=_0x1a38dc;return db[_0x5889('0x24')][_0x5889('0x25')]({'paused':0x1},{'where':{'UserId':_0x22c5af['id']},'individualHooks':!![]});})['then'](function(){return db[_0x5889('0x26')][_0x5889('0xc')]({'where':{'membername':_0x22c5af[_0x5889('0x1f')],'type':'PAUSE','exitAt':null}});})[_0x5889('0x15')](function(_0x4492fb){if(_0x4492fb&&_0x4492fb[_0x5889('0x27')]){var _0x2d1dfd=moment()[_0x5889('0x22')](_0x5889('0x28'));for(var _0x55ee85=0x0,_0x108b77=_0x4492fb[_0x5889('0x27')];_0x55ee85<_0x108b77;_0x55ee85++){_0x4492fb[_0x55ee85][_0x5889('0x29')]({'exitAt':_0x2d1dfd});}}})[_0x5889('0x15')](function(){var _0x26fa73=[];var _0x369d57=utils[_0x5889('0x2a')]();_0x369d57[_0x5889('0x2b')](function(_0x478cbb){_0x26fa73[_0x5889('0x2c')]({'channel':_0x478cbb,'membername':_0x22c5af[_0x5889('0x1f')],'interface':_[_0x5889('0x2d')](_0x22c5af[_0x5889('0x21')])?util['format'](_0x5889('0x2e'),_0x22c5af['name']):_0x22c5af[_0x5889('0x21')],'type':_0x5889('0x2f'),'enterAt':moment()[_0x5889('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x31f48e[_0x5889('0x30')][_0x5889('0x31')]||'DEFAULT\x20PAUSE','role':_0x22c5af[_0x5889('0x32')],'internal':_0x22c5af[_0x5889('0x20')],'uniqueid':_0x31f48e['body'][_0x5889('0x33')]||null});});return db['MemberReport'][_0x5889('0x34')](_0x26fa73,{'individualHooks':!![]});})[_0x5889('0x15')](function(){return _0x22c5af[_0x5889('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x31f48e[_0x5889('0x30')][_0x5889('0x31')]||_0x5889('0x35'),'lastPauseAt':moment()[_0x5889('0x22')](_0x5889('0x28'))});})[_0x5889('0x1d')](function(_0x94ffde){throw _0x94ffde;});};exports[_0x5889('0x36')]=function(_0x4cbeff){return Promise[_0x5889('0x37')]()[_0x5889('0x15')](function(){if(_0x4cbeff[_0x5889('0x30')]['channel']&&!utils[_0x5889('0x38')](_0x4cbeff[_0x5889('0x30')][_0x5889('0x39')])){throw new Error(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x4cbeff[_0x5889('0x30')]['channel']));}return db[_0x5889('0xb')][_0x5889('0x3a')]({'where':_0x4cbeff['options'][_0x5889('0xf')]||{},'attributes':['id',_0x5889('0x1f'),'role',_0x5889('0x20'),_0x5889('0x21'),'online',_0x5889('0x3b'),_0x5889('0x3c'),_0x5889('0x3d'),_0x5889('0x3e'),_0x5889('0x3f'),_0x5889('0x40'),_0x5889('0x41'),_0x5889('0x42'),_0x5889('0x43')]});})[_0x5889('0x15')](function(_0x3dcac6){if(!_0x3dcac6){throw new Error(util[_0x5889('0x22')]('User\x20with\x20id\x20%s\x20not\x20found',_0x4cbeff[_0x5889('0x44')]['id']));}return _0x3dcac6['unpause'](_0x4cbeff['body'][_0x5889('0x39')],_0x5889('0x45'));})[_0x5889('0x1d')](function(_0x1a9208){throw _0x1a9208;});};exports[_0x5889('0x46')]=function(_0x1c197b){var _0x165a7a=this;return new Promise(function(_0x4efa0d,_0x4cef84){var _0xc7f6b6;return db[_0x5889('0xb')]['findOne']({'where':_0x1c197b[_0x5889('0xd')]['where']||{},'attributes':['id','name']})['then'](function(_0x2a2804){if(_0x2a2804){_0xc7f6b6=_0x2a2804;return db[_0x5889('0x24')][_0x5889('0x47')]({'where':{'membername':_0xc7f6b6['name']},'individualHooks':!![]});}})[_0x5889('0x15')](function(){if(_0xc7f6b6){return db[_0x5889('0x26')]['findAll']({'where':{'membername':_0xc7f6b6['name'],'exitAt':null}});}})[_0x5889('0x15')](function(_0x10a77e){if(_0xc7f6b6){if(_0x10a77e&&_0x10a77e[_0x5889('0x27')]){var _0x32ee2f=[];_0x10a77e[_0x5889('0x2b')](function(_0x89835b){_0x32ee2f[_0x5889('0x2c')](_0x89835b[_0x5889('0x25')]({'exitAt':moment()[_0x5889('0x22')](_0x5889('0x28'))}));});return BPromise['all'](_0x32ee2f);}}})[_0x5889('0x15')](function(){if(_0xc7f6b6){return _0xc7f6b6[_0x5889('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x53cfc8){_0x4efa0d(_0x53cfc8);})[_0x5889('0x1d')](function(_0x43f85f){_0x4cef84(_0x165a7a['error'](0x1f4,_0x43f85f[_0x5889('0x1b')]));});});};exports[_0x5889('0x48')]=function(_0x2be732){var _0x7f6ef9=this;return new Promise(function(_0x36e1c3,_0x1033f2){var _0x3b0c9c;var _0x3348ae;var _0x5d1dc6;var _0x91782f;return db[_0x5889('0xb')][_0x5889('0x3a')]({'where':_0x2be732[_0x5889('0xd')][_0x5889('0xf')]||{},'attributes':['id',_0x5889('0x1f'),_0x5889('0x32'),_0x5889('0x49'),_0x5889('0x4a'),_0x5889('0x20'),_0x5889('0x4b'),_0x5889('0x21')]})[_0x5889('0x15')](function(_0x586347){if(_0x586347){_0x3b0c9c=_0x586347;_0x91782f=_0x2be732[_0x5889('0x30')][_0x5889('0x21')]?_0x2be732[_0x5889('0x30')][_0x5889('0x21')]:util[_0x5889('0x22')]('SIP/%s',_0x3b0c9c['name']);return db[_0x5889('0xb')][_0x5889('0x4c')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3b0c9c['id']}}});}})[_0x5889('0x15')](function(_0x1a5f84){if(_0x1a5f84){_0x5d1dc6=_0x1a5f84;return require(_0x5889('0x4d'))['getLicense']();}})['then'](function(_0x1774bb){if(_0x1774bb&&_0x1774bb[_0x5889('0x4e')]&&_0x5d1dc6>=_0x1774bb[_0x5889('0x4e')]){throw new Error(_0x5889('0x4f'));}})[_0x5889('0x15')](function(){if(_0x3b0c9c){return db[_0x5889('0x24')][_0x5889('0x47')]({'where':{'membername':_0x3b0c9c[_0x5889('0x1f')]},'individualHooks':!![]});}})[_0x5889('0x15')](function(){if(_0x3b0c9c){return _0x3b0c9c['getVoiceQueues']({'raw':!![]});}})[_0x5889('0x15')](function(_0x17ecc0){if(_0x3b0c9c){if(_0x17ecc0){var _0x30fe95=[];_0x3348ae=_0x17ecc0;if(_0x3348ae[_0x5889('0x27')]){for(var _0x3f9e7e=0x0;_0x3f9e7e<_0x3348ae[_0x5889('0x27')];_0x3f9e7e++){_0x30fe95[_0x5889('0x2c')](db['UserVoiceQueueRt'][_0x5889('0x50')]({'membername':_0x3b0c9c['name'],'UserId':_0x3b0c9c['id'],'queue_name':_0x3348ae[_0x3f9e7e]['name'],'VoiceQueueId':_0x3348ae[_0x3f9e7e]['id'],'interface':_0x91782f,'paused':_0x3b0c9c['loginInPause']||![],'penalty':_0x3348ae[_0x3f9e7e][_0x5889('0x51')]||0x0}));}return BPromise['all'](_0x30fe95);}}}})[_0x5889('0x15')](function(){if(_0x3b0c9c){return db[_0x5889('0x26')][_0x5889('0xc')]({'where':{'membername':_0x3b0c9c[_0x5889('0x1f')],'exitAt':null}});}})[_0x5889('0x15')](function(_0x338425){if(_0x3b0c9c){if(_0x338425&&_0x338425[_0x5889('0x27')]){var _0x190089=[];_0x338425[_0x5889('0x2b')](function(_0x2c86a2){_0x190089[_0x5889('0x2c')](_0x2c86a2[_0x5889('0x25')]({'exitAt':moment()[_0x5889('0x22')](_0x5889('0x28'))}));});return BPromise[_0x5889('0x52')](_0x190089);}}})['then'](function(){if(_0x3b0c9c){var _0x4de242=[];var _0x1a0c7b=[];var _0x43be1b=utils['getChannels']();var _0x4fceca={'membername':_0x3b0c9c[_0x5889('0x1f')],'interface':_0x91782f,'enterAt':moment()[_0x5889('0x22')](_0x5889('0x28')),'role':_0x3b0c9c[_0x5889('0x32')],'internal':_0x3b0c9c['internal']};_0x43be1b[_0x5889('0x2b')](function(_0x155188){_0x4de242[_0x5889('0x2c')](_[_0x5889('0x53')]({'channel':_0x155188,'type':'LOGIN','data1':_0x5889('0x54'),'data2':_0x91782f},_0x4fceca));if(_0x3b0c9c[_0x5889('0x4b')]){_0x1a0c7b[_0x5889('0x2c')](_[_0x5889('0x53')]({'channel':_0x155188,'type':_0x5889('0x2f'),'data1':_0x5889('0x55')},_0x4fceca));}});return db['MemberReport'][_0x5889('0x34')](_0x4de242[_0x5889('0x56')](_0x1a0c7b),{'individualHooks':!![]});}})[_0x5889('0x15')](function(){if(_0x3b0c9c){return _0x3b0c9c[_0x5889('0x25')]({'online':!![],'lastLoginAt':moment()[_0x5889('0x22')](_0x5889('0x28')),'voicePause':_0x3b0c9c['loginInPause']||![],'mailPause':_0x3b0c9c[_0x5889('0x4b')]||![],'chatPause':_0x3b0c9c[_0x5889('0x4b')]||![],'faxPause':_0x3b0c9c['loginInPause']||![],'smsPause':_0x3b0c9c['loginInPause']||![],'openchannelPause':_0x3b0c9c['loginInPause']||![],'pauseType':_0x3b0c9c[_0x5889('0x4b')]?_0x5889('0x55'):null,'lastPauseAt':moment()[_0x5889('0x22')](_0x5889('0x28')),'interface':_0x91782f});}})[_0x5889('0x15')](function(_0x1d5586){_0x36e1c3(_0x1d5586);})[_0x5889('0x1d')](function(_0x2ff4a1){_0x1033f2(_0x7f6ef9['error'](0x1f4,_0x2ff4a1[_0x5889('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 46bfe8f..5c54f2f 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 _0x9e1f=['emit','removeListener','length','user:','./user.events','save','remove','update'];(function(_0x155477,_0x466414){var _0xaf1051=function(_0x1ab88f){while(--_0x1ab88f){_0x155477['push'](_0x155477['shift']());}};_0xaf1051(++_0x466414);}(_0x9e1f,0x14c));var _0xf9e1=function(_0x4cde0a,_0x2d1444){_0x4cde0a=_0x4cde0a-0x0;var _0x33a5e3=_0x9e1f[_0x4cde0a];return _0x33a5e3;};'use strict';var UserEvents=require(_0xf9e1('0x0'));var events=[_0xf9e1('0x1'),_0xf9e1('0x2'),_0xf9e1('0x3')];function createListener(_0x42fcfa,_0x3ea72b){return function(_0x2d3036){_0x3ea72b[_0xf9e1('0x4')](_0x42fcfa,_0x2d3036);};}function removeListener(_0x59e202,_0x32085a){return function(){UserEvents[_0xf9e1('0x5')](_0x59e202,_0x32085a);};}exports['register']=function(_0x5e79b5){for(var _0x5d45b5=0x0,_0x510a8f=events[_0xf9e1('0x6')];_0x5d45b5<_0x510a8f;_0x5d45b5++){var _0xb402af=events[_0x5d45b5];var _0x4e381c=createListener(_0xf9e1('0x7')+_0xb402af,_0x5e79b5);UserEvents['on'](_0xb402af,_0x4e381c);}}; \ No newline at end of file +var _0xb140=['save','remove','update','removeListener','user:','./user.events'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0xb140,0xdd));var _0x0b14=function(_0x74a76c,_0x87c60d){_0x74a76c=_0x74a76c-0x0;var _0x3d8e25=_0xb140[_0x74a76c];return _0x3d8e25;};'use strict';var UserEvents=require(_0x0b14('0x0'));var events=[_0x0b14('0x1'),_0x0b14('0x2'),_0x0b14('0x3')];function createListener(_0x1a5d7f,_0x30367b){return function(_0x78f1a){_0x30367b['emit'](_0x1a5d7f,_0x78f1a);};}function removeListener(_0x3fcac4,_0x2190d2){return function(){UserEvents[_0x0b14('0x4')](_0x3fcac4,_0x2190d2);};}exports['register']=function(_0x3fc07d){for(var _0x3ac111=0x0,_0x5e26ca=events['length'];_0x3ac111<_0x5e26ca;_0x3ac111++){var _0x180573=events[_0x3ac111];var _0x9d4c85=createListener(_0x0b14('0x5')+_0x180573,_0x3fc07d);UserEvents['on'](_0x180573,_0x9d4c85);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 8e69dad..c5c224a 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x483227,_0x4531da){var _0x2f414a=function(_0x31eebd){while(--_0x31eebd){_0x483227['push'](_0x483227['shift']());}};_0x2f414a(++_0x4531da);}(_0xe706,0xa3));var _0x6e70=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xe706[_0x2c1dcd];return _0x158ce5;};'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 +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2373a7,_0x563294){var _0xa04d6e=function(_0x155732){while(--_0x155732){_0x2373a7['push'](_0x2373a7['shift']());}};_0xa04d6e(++_0x563294);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xcb91[_0x1db831];return _0x39ba56;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index b87d291..6a9d131 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 _0x02d8=['INTEGER','sequelize','exports'];(function(_0x4b4dad,_0x1edae3){var _0x11f09f=function(_0x57c9db){while(--_0x57c9db){_0x4b4dad['push'](_0x4b4dad['shift']());}};_0x11f09f(++_0x1edae3);}(_0x02d8,0x1e4));var _0x802d=function(_0x54300a,_0x5cf0bd){_0x54300a=_0x54300a-0x0;var _0x4f4436=_0x02d8[_0x54300a];return _0x4f4436;};'use strict';var Sequelize=require(_0x802d('0x0'));module[_0x802d('0x1')]={'penalty':{'type':Sequelize[_0x802d('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x45d5=['INTEGER','sequelize','exports'];(function(_0x58cdd8,_0x8d1935){var _0x197e69=function(_0x406daf){while(--_0x406daf){_0x58cdd8['push'](_0x58cdd8['shift']());}};_0x197e69(++_0x8d1935);}(_0x45d5,0x1e7));var _0x545d=function(_0x23498d,_0x510aef){_0x23498d=_0x23498d-0x0;var _0x8c736f=_0x45d5[_0x23498d];return _0x8c736f;};'use strict';var Sequelize=require(_0x545d('0x0'));module[_0x545d('0x1')]={'penalty':{'type':Sequelize[_0x545d('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 11a00d3..df06f1d 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 _0x0711=['rimraf','../../config/environment','exports','define','UserChatQueue','util','../../config/logger','moment','bluebird','path'];(function(_0x5db1ce,_0x57ab66){var _0xb62cbb=function(_0x33b753){while(--_0x33b753){_0x5db1ce['push'](_0x5db1ce['shift']());}};_0xb62cbb(++_0x57ab66);}(_0x0711,0xb9));var _0x1071=function(_0x479352,_0x2d82af){_0x479352=_0x479352-0x0;var _0x4adad5=_0x0711[_0x479352];return _0x4adad5;};'use strict';var _=require('lodash');var util=require(_0x1071('0x0'));var logger=require(_0x1071('0x1'))('api');var moment=require(_0x1071('0x2'));var BPromise=require(_0x1071('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1071('0x4'));var rimraf=require(_0x1071('0x5'));var config=require(_0x1071('0x6'));var attributes=require('./userChatQueue.attributes');module[_0x1071('0x7')]=function(_0x3cae97,_0x3d3a77){return _0x3cae97[_0x1071('0x8')](_0x1071('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9793=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x2d9839,_0x4e9a93){var _0x2e8615=function(_0x3531ed){while(--_0x3531ed){_0x2d9839['push'](_0x2d9839['shift']());}};_0x2e8615(++_0x4e9a93);}(_0x9793,0xb4));var _0x3979=function(_0x31b1b2,_0x6b3bdf){_0x31b1b2=_0x31b1b2-0x0;var _0x3f9289=_0x9793[_0x31b1b2];return _0x3f9289;};'use strict';var _=require(_0x3979('0x0'));var util=require(_0x3979('0x1'));var logger=require('../../config/logger')(_0x3979('0x2'));var moment=require(_0x3979('0x3'));var BPromise=require(_0x3979('0x4'));var rp=require(_0x3979('0x5'));var fs=require('fs');var path=require(_0x3979('0x6'));var rimraf=require(_0x3979('0x7'));var config=require(_0x3979('0x8'));var attributes=require(_0x3979('0x9'));module['exports']=function(_0x3e87ca,_0x1b93a4){return _0x3e87ca[_0x3979('0xa')](_0x3979('0xb'),attributes,{'tableName':_0x3979('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 eb78918..a031e6a 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 _0xf893=['info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x5011f6,_0x44401a){var _0x177c13=function(_0x500ef6){while(--_0x500ef6){_0x5011f6['push'](_0x5011f6['shift']());}};_0x177c13(++_0x44401a);}(_0xf893,0xc6));var _0x3f89=function(_0x48dae8,_0x516087){_0x48dae8=_0x48dae8-0x0;var _0x10ef93=_0xf893[_0x48dae8];return _0x10ef93;};'use strict';var _=require(_0x3f89('0x0'));var util=require(_0x3f89('0x1'));var moment=require(_0x3f89('0x2'));var BPromise=require(_0x3f89('0x3'));var rs=require(_0x3f89('0x4'));var fs=require('fs');var Redis=require(_0x3f89('0x5'));var db=require(_0x3f89('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3f89('0x7'))(_0x3f89('0x8'));var config=require(_0x3f89('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3f89('0xa')][_0x3f89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e864a,_0x237509,_0x39a1d6){return new BPromise(function(_0x67d781,_0x142f08){return client['request'](_0x1e864a,_0x39a1d6)['then'](function(_0x18b956){logger[_0x3f89('0xc')](_0x3f89('0xd'),_0x237509,_0x3f89('0xe'));logger[_0x3f89('0xf')](_0x3f89('0x10'),_0x237509,_0x3f89('0xe'),JSON[_0x3f89('0x11')](_0x18b956));if(_0x18b956[_0x3f89('0x12')]){if(_0x18b956[_0x3f89('0x12')]['code']===0x1f4){logger[_0x3f89('0x12')](_0x3f89('0xd'),_0x237509,_0x18b956[_0x3f89('0x12')][_0x3f89('0x13')]);return _0x142f08(_0x18b956[_0x3f89('0x12')]['message']);}logger[_0x3f89('0x12')](_0x3f89('0xd'),_0x237509,_0x18b956['error'][_0x3f89('0x13')]);return _0x67d781(_0x18b956[_0x3f89('0x12')][_0x3f89('0x13')]);}else{logger[_0x3f89('0xc')](_0x3f89('0xd'),_0x237509,_0x3f89('0xe'));_0x67d781(_0x18b956['result'][_0x3f89('0x13')]);}})[_0x3f89('0x14')](function(_0x2ad626){logger[_0x3f89('0x12')](_0x3f89('0xd'),_0x237509,_0x2ad626);_0x142f08(_0x2ad626);});});} \ No newline at end of file +var _0xd3d3=['../../config/logger','../../config/environment','jayson/promise','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','ioredis'];(function(_0x38be1c,_0x3b659e){var _0x2fd6ca=function(_0x493778){while(--_0x493778){_0x38be1c['push'](_0x38be1c['shift']());}};_0x2fd6ca(++_0x3b659e);}(_0xd3d3,0xda));var _0x3d3d=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xd3d3[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x3d3d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3d3d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d3d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d3d('0x3'))('rpc');var config=require(_0x3d3d('0x4'));var jayson=require(_0x3d3d('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2006bc,_0x58ac18,_0x5a66aa){return new BPromise(function(_0x4552ad,_0xd80fb9){return client['request'](_0x2006bc,_0x5a66aa)[_0x3d3d('0x6')](function(_0x5ae48b){logger[_0x3d3d('0x7')](_0x3d3d('0x8'),_0x58ac18,_0x3d3d('0x9'));logger[_0x3d3d('0xa')](_0x3d3d('0xb'),_0x58ac18,'request\x20sent',JSON[_0x3d3d('0xc')](_0x5ae48b));if(_0x5ae48b['error']){if(_0x5ae48b[_0x3d3d('0xd')][_0x3d3d('0xe')]===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x58ac18,_0x5ae48b[_0x3d3d('0xd')][_0x3d3d('0xf')]);return _0xd80fb9(_0x5ae48b[_0x3d3d('0xd')][_0x3d3d('0xf')]);}logger['error'](_0x3d3d('0x8'),_0x58ac18,_0x5ae48b[_0x3d3d('0xd')][_0x3d3d('0xf')]);return _0x4552ad(_0x5ae48b['error'][_0x3d3d('0xf')]);}else{logger[_0x3d3d('0x7')](_0x3d3d('0x8'),_0x58ac18,'request\x20sent');_0x4552ad(_0x5ae48b['result'][_0x3d3d('0xf')]);}})[_0x3d3d('0x10')](function(_0x1ab163){logger[_0x3d3d('0xd')](_0x3d3d('0x8'),_0x58ac18,_0x1ab163);_0xd80fb9(_0x1ab163);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 794fe76..030cb94 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x483e4a,_0x32aa45){var _0x31fba5=function(_0x345bc9){while(--_0x345bc9){_0x483e4a['push'](_0x483e4a['shift']());}};_0x31fba5(++_0x32aa45);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x170bc8,_0x5066f5){var _0x342273=function(_0x55481c){while(--_0x55481c){_0x170bc8['push'](_0x170bc8['shift']());}};_0x342273(++_0x5066f5);}(_0xedd9,0xfc));var _0x9edd=function(_0x3af04b,_0x4343a0){_0x3af04b=_0x3af04b-0x0;var _0x45c918=_0xedd9[_0x3af04b];return _0x45c918;};'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 diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 522bea6..4c696a3 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 _0xb23d=['STRING','sequelize','exports','INTEGER'];(function(_0x16916f,_0x1655ee){var _0x536d2a=function(_0x8cdc62){while(--_0x8cdc62){_0x16916f['push'](_0x16916f['shift']());}};_0x536d2a(++_0x1655ee);}(_0xb23d,0x79));var _0xdb23=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xb23d[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xdb23('0x0'));module[_0xdb23('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdb23('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdb23('0x3')]}}; \ No newline at end of file +var _0xef63=['STRING','sequelize','exports','INTEGER'];(function(_0x1ecefd,_0x8ceb9e){var _0x225204=function(_0x27ab6a){while(--_0x27ab6a){_0x1ecefd['push'](_0x1ecefd['shift']());}};_0x225204(++_0x8ceb9e);}(_0xef63,0x1b1));var _0x3ef6=function(_0x2db376,_0x1dde3b){_0x2db376=_0x2db376-0x0;var _0x41bbaf=_0xef63[_0x2db376];return _0x41bbaf;};'use strict';var Sequelize=require(_0x3ef6('0x0'));module[_0x3ef6('0x1')]={'penalty':{'type':Sequelize[_0x3ef6('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3ef6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3ef6('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 668098f..fa0bcdc 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 _0x339c=['lodash','moment','bluebird','request-promise','./userFaxQueue.attributes','define','UserFaxQueue'];(function(_0x8e9007,_0x3a3608){var _0xefcbe7=function(_0x426364){while(--_0x426364){_0x8e9007['push'](_0x8e9007['shift']());}};_0xefcbe7(++_0x3a3608);}(_0x339c,0xa8));var _0xc339=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x339c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc339('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc339('0x1'));var BPromise=require(_0xc339('0x2'));var rp=require(_0xc339('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc339('0x4'));module['exports']=function(_0x2a755e,_0xeb1de5){return _0x2a755e[_0xc339('0x5')](_0xc339('0x6'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdf7=['exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x442e99,_0xda935a){var _0x3d0b8e=function(_0x30a77b){while(--_0x30a77b){_0x442e99['push'](_0x442e99['shift']());}};_0x3d0b8e(++_0xda935a);}(_0xcdf7,0x177));var _0x7cdf=function(_0x2c93a8,_0x1f0025){_0x2c93a8=_0x2c93a8-0x0;var _0x3dfc91=_0xcdf7[_0x2c93a8];return _0x3dfc91;};'use strict';var _=require(_0x7cdf('0x0'));var util=require(_0x7cdf('0x1'));var logger=require(_0x7cdf('0x2'))(_0x7cdf('0x3'));var moment=require(_0x7cdf('0x4'));var BPromise=require(_0x7cdf('0x5'));var rp=require(_0x7cdf('0x6'));var fs=require('fs');var path=require(_0x7cdf('0x7'));var rimraf=require('rimraf');var config=require(_0x7cdf('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x7cdf('0x9')]=function(_0x199017,_0x25411c){return _0x199017['define'](_0x7cdf('0xa'),attributes,{'tableName':_0x7cdf('0xb'),'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 0748133..03e76dd 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 _0x9dbf=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird'];(function(_0x24cf9e,_0x43de5e){var _0x221d86=function(_0x221e39){while(--_0x221e39){_0x24cf9e['push'](_0x24cf9e['shift']());}};_0x221d86(++_0x43de5e);}(_0x9dbf,0x18c));var _0xf9db=function(_0x28dbf1,_0x32eb60){_0x28dbf1=_0x28dbf1-0x0;var _0x523449=_0x9dbf[_0x28dbf1];return _0x523449;};'use strict';var _=require(_0xf9db('0x0'));var util=require(_0xf9db('0x1'));var moment=require('moment');var BPromise=require(_0xf9db('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf9db('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9db('0x4'))(_0xf9db('0x5'));var config=require(_0xf9db('0x6'));var jayson=require(_0xf9db('0x7'));var client=jayson[_0xf9db('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x156b07,_0x4ab594,_0x479129){return new BPromise(function(_0x13e29a,_0x4e91fa){return client[_0xf9db('0x9')](_0x156b07,_0x479129)['then'](function(_0x318e25){logger[_0xf9db('0xa')](_0xf9db('0xb'),_0x4ab594,'request\x20sent');logger['debug'](_0xf9db('0xc'),_0x4ab594,_0xf9db('0xd'),JSON[_0xf9db('0xe')](_0x318e25));if(_0x318e25[_0xf9db('0xf')]){if(_0x318e25[_0xf9db('0xf')]['code']===0x1f4){logger['error'](_0xf9db('0xb'),_0x4ab594,_0x318e25[_0xf9db('0xf')][_0xf9db('0x10')]);return _0x4e91fa(_0x318e25[_0xf9db('0xf')]['message']);}logger[_0xf9db('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x4ab594,_0x318e25['error'][_0xf9db('0x10')]);return _0x13e29a(_0x318e25['error'][_0xf9db('0x10')]);}else{logger['info'](_0xf9db('0xb'),_0x4ab594,_0xf9db('0xd'));_0x13e29a(_0x318e25[_0xf9db('0x11')][_0xf9db('0x10')]);}})[_0xf9db('0x12')](function(_0x5bdbc1){logger[_0xf9db('0xf')](_0xf9db('0xb'),_0x4ab594,_0x5bdbc1);_0x4e91fa(_0x5bdbc1);});});} \ No newline at end of file +var _0xf2d2=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0xf2d2,0xb9));var _0x2f2d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf2d2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2f2d('0x0'));var util=require(_0x2f2d('0x1'));var moment=require(_0x2f2d('0x2'));var BPromise=require(_0x2f2d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f2d('0x4'));var db=require(_0x2f2d('0x5'))['db'];var utils=require(_0x2f2d('0x6'));var logger=require(_0x2f2d('0x7'))(_0x2f2d('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f2d('0x9'));var client=jayson['client'][_0x2f2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fd6f6,_0x49d144,_0x34b312){return new BPromise(function(_0x17d092,_0x169799){return client[_0x2f2d('0xb')](_0x3fd6f6,_0x34b312)['then'](function(_0x574544){logger[_0x2f2d('0xc')](_0x2f2d('0xd'),_0x49d144,_0x2f2d('0xe'));logger[_0x2f2d('0xf')](_0x2f2d('0x10'),_0x49d144,_0x2f2d('0xe'),JSON[_0x2f2d('0x11')](_0x574544));if(_0x574544[_0x2f2d('0x12')]){if(_0x574544['error']['code']===0x1f4){logger['error'](_0x2f2d('0xd'),_0x49d144,_0x574544[_0x2f2d('0x12')][_0x2f2d('0x13')]);return _0x169799(_0x574544[_0x2f2d('0x12')][_0x2f2d('0x13')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x49d144,_0x574544[_0x2f2d('0x12')]['message']);return _0x17d092(_0x574544[_0x2f2d('0x12')][_0x2f2d('0x13')]);}else{logger[_0x2f2d('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x49d144,_0x2f2d('0xe'));_0x17d092(_0x574544[_0x2f2d('0x14')]['message']);}})[_0x2f2d('0x15')](function(_0x29add7){logger[_0x2f2d('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x49d144,_0x29add7);_0x169799(_0x29add7);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 90a7d33..399f27c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xa2d364,_0x1efedb){var _0x2fa762=function(_0x2cc3ae){while(--_0x2cc3ae){_0xa2d364['push'](_0xa2d364['shift']());}};_0x2fa762(++_0x1efedb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0xcb91[_0x33080e];return _0x407395;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x31408c,_0x365b43){var _0x253c34=function(_0x4464e3){while(--_0x4464e3){_0x31408c['push'](_0x31408c['shift']());}};_0x253c34(++_0x365b43);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index bd0d597..4b70000 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 _0x6cca=['sequelize','exports'];(function(_0xa7c4a7,_0x1a39a2){var _0x4d5e31=function(_0x594859){while(--_0x594859){_0xa7c4a7['push'](_0xa7c4a7['shift']());}};_0x4d5e31(++_0x1a39a2);}(_0x6cca,0x10e));var _0xa6cc=function(_0x57a3f6,_0x5e7507){_0x57a3f6=_0x57a3f6-0x0;var _0x69ab14=_0x6cca[_0x57a3f6];return _0x69ab14;};'use strict';var Sequelize=require(_0xa6cc('0x0'));module[_0xa6cc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x7d2f=['exports','INTEGER'];(function(_0xc36dad,_0x44723e){var _0x133b50=function(_0x371ddc){while(--_0x371ddc){_0xc36dad['push'](_0xc36dad['shift']());}};_0x133b50(++_0x44723e);}(_0x7d2f,0xba));var _0xf7d2=function(_0x1813e7,_0x2eb397){_0x1813e7=_0x1813e7-0x0;var _0x1fd03a=_0x7d2f[_0x1813e7];return _0x1fd03a;};'use strict';var Sequelize=require('sequelize');module[_0xf7d2('0x0')]={'penalty':{'type':Sequelize[_0xf7d2('0x1')],'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 847a944..8c5c6be 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 _0x4ebd=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','../../config/logger','api'];(function(_0x21ef8f,_0x538a41){var _0x587ee9=function(_0x5881b1){while(--_0x5881b1){_0x21ef8f['push'](_0x21ef8f['shift']());}};_0x587ee9(++_0x538a41);}(_0x4ebd,0x1a1));var _0xd4eb=function(_0x324aa3,_0x366772){_0x324aa3=_0x324aa3-0x0;var _0x201115=_0x4ebd[_0x324aa3];return _0x201115;};'use strict';var _=require(_0xd4eb('0x0'));var util=require('util');var logger=require(_0xd4eb('0x1'))(_0xd4eb('0x2'));var moment=require(_0xd4eb('0x3'));var BPromise=require(_0xd4eb('0x4'));var rp=require(_0xd4eb('0x5'));var fs=require('fs');var path=require(_0xd4eb('0x6'));var rimraf=require(_0xd4eb('0x7'));var config=require(_0xd4eb('0x8'));var attributes=require(_0xd4eb('0x9'));module[_0xd4eb('0xa')]=function(_0x661f04,_0x58a738){return _0x661f04[_0xd4eb('0xb')](_0xd4eb('0xc'),attributes,{'tableName':_0xd4eb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc14=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define','user_has_mail_queues'];(function(_0x2a37a4,_0x464b98){var _0x29d935=function(_0xff7180){while(--_0xff7180){_0x2a37a4['push'](_0x2a37a4['shift']());}};_0x29d935(++_0x464b98);}(_0xfc14,0xea));var _0x4fc1=function(_0x3c1b97,_0x2e45b0){_0x3c1b97=_0x3c1b97-0x0;var _0x893e37=_0xfc14[_0x3c1b97];return _0x893e37;};'use strict';var _=require('lodash');var util=require(_0x4fc1('0x0'));var logger=require(_0x4fc1('0x1'))('api');var moment=require(_0x4fc1('0x2'));var BPromise=require('bluebird');var rp=require(_0x4fc1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fc1('0x4'));var config=require(_0x4fc1('0x5'));var attributes=require(_0x4fc1('0x6'));module['exports']=function(_0x87e54c,_0x127ada){return _0x87e54c[_0x4fc1('0x7')]('UserMailQueue',attributes,{'tableName':_0x4fc1('0x8'),'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 a01d19c..2444b1b 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 _0x3e74=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','info','catch','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x2305e1,_0x11ae74){var _0x5e8522=function(_0x475b5e){while(--_0x475b5e){_0x2305e1['push'](_0x2305e1['shift']());}};_0x5e8522(++_0x11ae74);}(_0x3e74,0x175));var _0x43e7=function(_0xc0f735,_0x3b0a2c){_0xc0f735=_0xc0f735-0x0;var _0x495432=_0x3e74[_0xc0f735];return _0x495432;};'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']('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('UserMailQueue,\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')]('UserMailQueue,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1b9f5a,_0x4543b0){var _0x4a5969=function(_0x571bb3){while(--_0x571bb3){_0x1b9f5a['push'](_0x1b9f5a['shift']());}};_0x4a5969(++_0x4543b0);}(_0x6aa7,0x178));var _0x76aa=function(_0x150ea1,_0x44a069){_0x150ea1=_0x150ea1-0x0;var _0x41fa25=_0x6aa7[_0x150ea1];return _0x41fa25;};'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/userNotification/index.js b/server/api/userNotification/index.js index 2471539..3740bae 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 _0x2408=['../../components/interaction/service','../../config/environment','./userNotification.controller','post','sendUserNotification','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0xf4f343,_0x41fe4a){var _0x4cda68=function(_0x3850e6){while(--_0x3850e6){_0xf4f343['push'](_0xf4f343['shift']());}};_0x4cda68(++_0x41fe4a);}(_0x2408,0xa0));var _0x8240=function(_0x327e31,_0x513316){_0x327e31=_0x327e31-0x0;var _0x3dffe9=_0x2408[_0x327e31];return _0x3dffe9;};'use strict';var multer=require(_0x8240('0x0'));var util=require('util');var path=require(_0x8240('0x1'));var timeout=require(_0x8240('0x2'));var express=require(_0x8240('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8240('0x4'));var interaction=require(_0x8240('0x5'));var config=require(_0x8240('0x6'));var controller=require(_0x8240('0x7'));router[_0x8240('0x8')]('/',auth['isAuthenticated'](),controller[_0x8240('0x9')]);module[_0x8240('0xa')]=router; \ No newline at end of file +var _0x3433=['../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x3433,0x17f));var _0x3343=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x3433[_0x13e758];return _0x5b53c3;};'use strict';var multer=require(_0x3343('0x0'));var util=require(_0x3343('0x1'));var path=require(_0x3343('0x2'));var timeout=require(_0x3343('0x3'));var express=require(_0x3343('0x4'));var router=express[_0x3343('0x5')]();var fs_extra=require(_0x3343('0x6'));var auth=require(_0x3343('0x7'));var interaction=require(_0x3343('0x8'));var config=require(_0x3343('0x9'));var controller=require('./userNotification.controller');router[_0x3343('0xa')]('/',auth[_0x3343('0xb')](),controller[_0x3343('0xc')]);module[_0x3343('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3e01676..3318151 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 _0xa5fc=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x2a983b,_0x88f5f2){var _0x3ee5be=function(_0x1519c2){while(--_0x1519c2){_0x2a983b['push'](_0x2a983b['shift']());}};_0x3ee5be(++_0x88f5f2);}(_0xa5fc,0x1ad));var _0xca5f=function(_0x606c92,_0x38b720){_0x606c92=_0x606c92-0x0;var _0xaaa72a=_0xa5fc[_0x606c92];return _0xaaa72a;};'use strict';var Sequelize=require(_0xca5f('0x0'));module['exports']={'body':{'type':Sequelize[_0xca5f('0x1')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xca5f('0x1')]},'recipientsDescription':{'type':Sequelize[_0xca5f('0x2')]},'beep':{'type':Sequelize[_0xca5f('0x3')]}}; \ No newline at end of file +var _0x6f33=['TEXT','STRING','BOOLEAN','exports'];(function(_0x546e79,_0x234028){var _0x5c0726=function(_0x488631){while(--_0x488631){_0x546e79['push'](_0x546e79['shift']());}};_0x5c0726(++_0x234028);}(_0x6f33,0x1bf));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x36f3('0x0')]={'body':{'type':Sequelize[_0x36f3('0x1')]},'senderName':{'type':Sequelize[_0x36f3('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x36f3('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 546a756..23d3138 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 _0xbe62=['ValidationError','body','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','voicequeue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','UserNotification','create','forEach','emit','catch','html','TemplateId','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','union','ids','queue','push','all','flatten','findOne','getAgents','map','eml-format','rimraf','fast-json-patch','moment','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','sendUserNotification','hasOwnProperty','text','Sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbe62,0x86));var _0x2be6=function(_0x239580,_0x2c1e3f){_0x239580=_0x239580-0x0;var _0x4fe920=_0xbe62[_0x239580];return _0x4fe920;};'use strict';var emlformat=require(_0x2be6('0x0'));var rimraf=require(_0x2be6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2be6('0x2'));var rp=require('request-promise');var moment=require(_0x2be6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2be6('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2be6('0x5'));var fs=require('fs');var fs_extra=require(_0x2be6('0x6'));var _=require(_0x2be6('0x7'));var squel=require(_0x2be6('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2be6('0x9'));var toCsv=require(_0x2be6('0xa'));var querystring=require(_0x2be6('0xb'));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(_0x2be6('0xc'));var logger=require(_0x2be6('0xd'))(_0x2be6('0xe'));var utils=require(_0x2be6('0xf'));var config=require(_0x2be6('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2be6('0x11'))['db'];config[_0x2be6('0x12')]=_[_0x2be6('0x13')](config[_0x2be6('0x12')],{'host':_0x2be6('0x14'),'port':0x18eb});var socket=require(_0x2be6('0x15'))(new Redis(config[_0x2be6('0x12')]));require(_0x2be6('0x16'))['register'](socket);function respondWithStatusCode(_0x5ac1da,_0x26427a){_0x26427a=_0x26427a||0xcc;return function(_0x40bb2e){if(_0x40bb2e){return _0x5ac1da[_0x2be6('0x17')](_0x26427a);}return _0x5ac1da[_0x2be6('0x18')](_0x26427a)[_0x2be6('0x19')]();};}function respondWithResult(_0x4dee01,_0x2b3400){_0x2b3400=_0x2b3400||0xc8;return function(_0x3502ad){if(_0x3502ad){return _0x4dee01[_0x2be6('0x18')](_0x2b3400)[_0x2be6('0x1a')](_0x3502ad);}};}function respondWithFilteredResult(_0x29ba2e,_0x450fa6){return function(_0x15277f){if(_0x15277f){var _0x37451b=typeof _0x450fa6[_0x2be6('0x1b')]===_0x2be6('0x1c')&&typeof _0x450fa6[_0x2be6('0x1d')]==='undefined';var _0x55e2f6=_0x15277f[_0x2be6('0x1e')];var _0x5c664d=_0x37451b?0x0:_0x450fa6[_0x2be6('0x1b')];var _0x2f655f=_0x37451b?_0x15277f['count']:_0x450fa6[_0x2be6('0x1b')]+_0x450fa6[_0x2be6('0x1d')];var _0x108329;if(_0x2f655f>=_0x55e2f6){_0x2f655f=_0x55e2f6;_0x108329=0xc8;}else{_0x108329=0xce;}_0x29ba2e[_0x2be6('0x18')](_0x108329);return _0x29ba2e[_0x2be6('0x1f')]('Content-Range',_0x5c664d+'-'+_0x2f655f+'/'+_0x55e2f6)[_0x2be6('0x1a')](_0x15277f);}return null;};}function patchUpdates(_0x34ad65){return function(_0x414dd3){try{jsonpatch[_0x2be6('0x20')](_0x414dd3,_0x34ad65,!![]);}catch(_0x4ce7a0){return BPromise[_0x2be6('0x21')](_0x4ce7a0);}return _0x414dd3[_0x2be6('0x22')]();};}function saveUpdates(_0x38dc89,_0x48ccca){return function(_0xa73a4){if(_0xa73a4){return _0xa73a4['update'](_0x38dc89)[_0x2be6('0x23')](function(_0x472e5c){return _0x472e5c;});}return null;};}function removeEntity(_0x236426,_0x40eb4a){return function(_0x10dea5){if(_0x10dea5){return _0x10dea5[_0x2be6('0x24')]()[_0x2be6('0x23')](function(){_0x236426[_0x2be6('0x18')](0xcc)[_0x2be6('0x19')]();});}};}function handleEntityNotFound(_0x2b9e46,_0x37d63a){return function(_0x171464){if(!_0x171464){_0x2b9e46[_0x2be6('0x17')](0x194);}return _0x171464;};}function handleError(_0x534b4c,_0x3497cf){_0x3497cf=_0x3497cf||0x1f4;return function(_0x50d79a){logger['error'](_0x50d79a[_0x2be6('0x25')]);if(_0x50d79a[_0x2be6('0x26')]){delete _0x50d79a[_0x2be6('0x26')];}_0x534b4c[_0x2be6('0x18')](_0x3497cf)[_0x2be6('0x27')](_0x50d79a);};}exports[_0x2be6('0x28')]=function(_0x1abd87,_0x3dfb6b,_0x37a341){if(!_0x1abd87['body'][_0x2be6('0x29')](_0x2be6('0x2a'))&&!_0x1abd87['body']['hasOwnProperty']('TemplateId')){throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x29')]('TemplateId')&&!_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x29')](_0x2be6('0x2e'))){throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))](_0x2be6('0x2f'));}if(!_0x1abd87['body'][_0x2be6('0x29')](_0x2be6('0x30'))){throw new db[(_0x2be6('0x2b'))]['ValidationError'](_0x2be6('0x31'));}else{try{var _0x43e23d=JSON['parse'](_0x1abd87['body'][_0x2be6('0x30')]);}catch(_0x240b66){logger[_0x2be6('0x32')](_0x240b66);throw new db[(_0x2be6('0x2b'))]['ValidationError'](_0x2be6('0x33'));}var _0x459b4a=[_0x2be6('0x34'),_0x2be6('0x35'),'mailqueue','openchannelqueue','smsqueue',_0x2be6('0x36'),'whatsappqueue',_0x2be6('0x37'),_0x2be6('0x38')];if(_[_0x2be6('0x39')](_0x43e23d,function(_0x385af0){return!_[_0x2be6('0x3a')](_0x459b4a,_0x385af0[_0x2be6('0x3b')][_0x2be6('0x3c')]());})){throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))](_0x2be6('0x3d'));}}}var _0x2c2a5a={};_0x2c2a5a[_0x2be6('0x3e')]=_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x29')](_0x2be6('0x3e'))?_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x3e')]:_0x1abd87['user'][_0x2be6('0x3f')];_0x2c2a5a[_0x2be6('0x40')]=_[_0x2be6('0x41')](_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x40')])?null:_0x1abd87[_0x2be6('0x2d')]['recipientsDescription'];_0x2c2a5a[_0x2be6('0x42')]=_0x1abd87[_0x2be6('0x2d')][_0x2be6('0x42')]||![];_0x2c2a5a[_0x2be6('0x43')]=_0x1abd87['user']['id'];return getContent(_0x1abd87[_0x2be6('0x2d')])[_0x2be6('0x23')](function(_0x63e311){_0x2c2a5a['body']=_0x63e311;return getRecipients(_0x43e23d);})['then'](function(_0x41c244){_0x2c2a5a[_0x2be6('0x44')]=_['sortBy'](_0x41c244)[_0x2be6('0x45')](',');return db[_0x2be6('0x46')]['transaction'](function(_0x4d0c37){return db[_0x2be6('0x47')][_0x2be6('0x48')](_0x2c2a5a,{'raw':!![],'transaction':_0x4d0c37})['then'](function(_0x2f4d75){var _0x5089db={'sender':_0x2c2a5a['senderName'],'description':_0x2c2a5a['recipientsDescription'],'content':_0x2c2a5a[_0x2be6('0x2d')],'beep':_0x2c2a5a[_0x2be6('0x42')]};_0x41c244[_0x2be6('0x49')](function(_0x508b01){_0x5089db['recipient']=_0x508b01;socket[_0x2be6('0x4a')]('userNotification:send',_0x5089db);});return _0x2f4d75;});});})[_0x2be6('0x23')](respondWithResult(_0x3dfb6b,0xc9))[_0x2be6('0x4b')](handleError(_0x3dfb6b,null));};function getContent(_0x25a585){return new BPromise(function(_0x57e735,_0x32f636){if(_0x25a585[_0x2be6('0x2a')]){_0x57e735(_0x25a585[_0x2be6('0x2a')]);return;}return db['Template']['findOne']({'attributes':[_0x2be6('0x4c')],'where':{'id':_0x25a585[_0x2be6('0x4d')]},'raw':!![]})[_0x2be6('0x23')](function(_0x3f80a4){if(!_0x3f80a4)throw new db[(_0x2be6('0x2b'))][(_0x2be6('0x2c'))](_0x2be6('0x4e'));var _0x446f22=Mustache['render'](_0x3f80a4[_0x2be6('0x4c')],_0x25a585['view']);_0x57e735(_0x446f22);})[_0x2be6('0x4b')](function(_0x3d132b){_0x32f636(_0x3d132b);});});}function getRecipients(_0x5475d2){return new BPromise(function(_0x1ae0a4,_0x11c083){var _0x15552a=[];var _0xeeaa00=[];_0x5475d2[_0x2be6('0x49')](function(_0x577416){var _0x183548=_[_0x2be6('0x4f')](_0x577416[_0x2be6('0x3b')][_0x2be6('0x3c')]());if(_0x183548==='User'){_0x15552a=_[_0x2be6('0x50')](_0x15552a,_0x577416[_0x2be6('0x51')]);}else{if(_[_0x2be6('0x3a')](_0x183548,_0x2be6('0x52')))_0x183548=_0x183548['replace'](_0x2be6('0x52'),'Queue');_0x577416['ids']['forEach'](function(_0x20e4bc){_0xeeaa00[_0x2be6('0x53')](getAgents(_0x183548,_0x20e4bc));});}});return BPromise[_0x2be6('0x54')](_0xeeaa00)[_0x2be6('0x23')](function(_0x48a196){_0x15552a=_['union'](_0x15552a,_[_0x2be6('0x55')](_0x48a196));_0x1ae0a4(_0x15552a);})['catch'](function(_0x1ecb10){_0x11c083(_0x1ecb10);});});}function getAgents(_0x5b6d26,_0x274566){return new BPromise(function(_0xe56a62,_0x229734){return db[_0x5b6d26][_0x2be6('0x56')]({'where':{'id':_0x274566}})[_0x2be6('0x23')](function(_0x58e613){return _0x58e613[_0x2be6('0x57')]({'attributes':['id'],'raw':!![]})[_0x2be6('0x23')](function(_0x5278c9){var _0x4ecf95=_[_0x2be6('0x58')](_0x5278c9,'id');_0xe56a62(_0x4ecf95);});})[_0x2be6('0x4b')](function(_0x3f8451){_0x229734(_0x3f8451);});});} \ No newline at end of file +var _0xf162=['Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','text','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','ids','queue','push','all','flatten','findOne','getAgents','map','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','sendUserNotification','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf162,0x1d6));var _0x2f16=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf162[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x2f16('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2f16('0x1'));var rp=require(_0x2f16('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2f16('0x3'));var util=require(_0x2f16('0x4'));var path=require(_0x2f16('0x5'));var sox=require(_0x2f16('0x6'));var csv=require(_0x2f16('0x7'));var ejs=require(_0x2f16('0x8'));var fs=require('fs');var fs_extra=require(_0x2f16('0x9'));var _=require(_0x2f16('0xa'));var squel=require(_0x2f16('0xb'));var crypto=require(_0x2f16('0xc'));var jsforce=require(_0x2f16('0xd'));var deskjs=require(_0x2f16('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2f16('0xf'));var Papa=require(_0x2f16('0x10'));var Redis=require(_0x2f16('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2f16('0x12'));var hardwareService=require(_0x2f16('0x13'));var logger=require(_0x2f16('0x14'))(_0x2f16('0x15'));var utils=require(_0x2f16('0x16'));var config=require(_0x2f16('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f16('0x18'))['db'];config['redis']=_[_0x2f16('0x19')](config[_0x2f16('0x1a')],{'host':_0x2f16('0x1b'),'port':0x18eb});var socket=require(_0x2f16('0x1c'))(new Redis(config[_0x2f16('0x1a')]));require(_0x2f16('0x1d'))[_0x2f16('0x1e')](socket);function respondWithStatusCode(_0x536912,_0x26e9aa){_0x26e9aa=_0x26e9aa||0xcc;return function(_0x38faa8){if(_0x38faa8){return _0x536912[_0x2f16('0x1f')](_0x26e9aa);}return _0x536912[_0x2f16('0x20')](_0x26e9aa)[_0x2f16('0x21')]();};}function respondWithResult(_0xcc2805,_0x3c2782){_0x3c2782=_0x3c2782||0xc8;return function(_0x9c1dd5){if(_0x9c1dd5){return _0xcc2805[_0x2f16('0x20')](_0x3c2782)[_0x2f16('0x22')](_0x9c1dd5);}};}function respondWithFilteredResult(_0x72577c,_0x1b5a45){return function(_0x37b384){if(_0x37b384){var _0x4da791=typeof _0x1b5a45[_0x2f16('0x23')]===_0x2f16('0x24')&&typeof _0x1b5a45[_0x2f16('0x25')]===_0x2f16('0x24');var _0x5b5f03=_0x37b384[_0x2f16('0x26')];var _0x572d6c=_0x4da791?0x0:_0x1b5a45['offset'];var _0x84df1b=_0x4da791?_0x37b384[_0x2f16('0x26')]:_0x1b5a45[_0x2f16('0x23')]+_0x1b5a45[_0x2f16('0x25')];var _0x5bbab9;if(_0x84df1b>=_0x5b5f03){_0x84df1b=_0x5b5f03;_0x5bbab9=0xc8;}else{_0x5bbab9=0xce;}_0x72577c['status'](_0x5bbab9);return _0x72577c[_0x2f16('0x27')](_0x2f16('0x28'),_0x572d6c+'-'+_0x84df1b+'/'+_0x5b5f03)[_0x2f16('0x22')](_0x37b384);}return null;};}function patchUpdates(_0x11c193){return function(_0x38bc4b){try{jsonpatch[_0x2f16('0x29')](_0x38bc4b,_0x11c193,!![]);}catch(_0x5d3a4f){return BPromise[_0x2f16('0x2a')](_0x5d3a4f);}return _0x38bc4b[_0x2f16('0x2b')]();};}function saveUpdates(_0x4696e5,_0x289634){return function(_0x3097a0){if(_0x3097a0){return _0x3097a0[_0x2f16('0x2c')](_0x4696e5)['then'](function(_0x5275fb){return _0x5275fb;});}return null;};}function removeEntity(_0x10a91b,_0x30b6dc){return function(_0x281520){if(_0x281520){return _0x281520[_0x2f16('0x2d')]()[_0x2f16('0x2e')](function(){_0x10a91b[_0x2f16('0x20')](0xcc)[_0x2f16('0x21')]();});}};}function handleEntityNotFound(_0x282887,_0x84aac6){return function(_0x1c67ac){if(!_0x1c67ac){_0x282887['sendStatus'](0x194);}return _0x1c67ac;};}function handleError(_0x2d1904,_0x5e298e){_0x5e298e=_0x5e298e||0x1f4;return function(_0xb3cd20){logger['error'](_0xb3cd20[_0x2f16('0x2f')]);if(_0xb3cd20[_0x2f16('0x30')]){delete _0xb3cd20['name'];}_0x2d1904[_0x2f16('0x20')](_0x5e298e)[_0x2f16('0x31')](_0xb3cd20);};}exports[_0x2f16('0x32')]=function(_0x5e0d90,_0x15c517,_0x477eab){if(!_0x5e0d90['body'][_0x2f16('0x33')]('text')&&!_0x5e0d90['body'][_0x2f16('0x33')](_0x2f16('0x34'))){throw new db['Sequelize'][(_0x2f16('0x35'))](_0x2f16('0x36'));}else{if(_0x5e0d90['body'][_0x2f16('0x33')]('TemplateId')&&!_0x5e0d90[_0x2f16('0x37')][_0x2f16('0x33')](_0x2f16('0x38'))){throw new db['Sequelize'][(_0x2f16('0x35'))](_0x2f16('0x39'));}if(!_0x5e0d90['body'][_0x2f16('0x33')](_0x2f16('0x3a'))){throw new db[(_0x2f16('0x3b'))][(_0x2f16('0x35'))](_0x2f16('0x3c'));}else{try{var _0x8d4331=JSON[_0x2f16('0x3d')](_0x5e0d90['body'][_0x2f16('0x3a')]);}catch(_0x1fef5a){logger[_0x2f16('0x3e')](_0x1fef5a);throw new db['Sequelize'][(_0x2f16('0x35'))](_0x2f16('0x3f'));}var _0xeebb78=[_0x2f16('0x40'),_0x2f16('0x41'),'mailqueue',_0x2f16('0x42'),_0x2f16('0x43'),_0x2f16('0x44'),_0x2f16('0x45'),'team',_0x2f16('0x46')];if(_[_0x2f16('0x47')](_0x8d4331,function(_0x5492f1){return!_[_0x2f16('0x48')](_0xeebb78,_0x5492f1[_0x2f16('0x49')][_0x2f16('0x4a')]());})){throw new db['Sequelize'][(_0x2f16('0x35'))](_0x2f16('0x4b'));}}}var _0x363761={};_0x363761['senderName']=_0x5e0d90[_0x2f16('0x37')]['hasOwnProperty'](_0x2f16('0x4c'))?_0x5e0d90[_0x2f16('0x37')][_0x2f16('0x4c')]:_0x5e0d90[_0x2f16('0x46')][_0x2f16('0x4d')];_0x363761[_0x2f16('0x4e')]=_[_0x2f16('0x4f')](_0x5e0d90[_0x2f16('0x37')][_0x2f16('0x4e')])?null:_0x5e0d90[_0x2f16('0x37')][_0x2f16('0x4e')];_0x363761[_0x2f16('0x50')]=_0x5e0d90[_0x2f16('0x37')][_0x2f16('0x50')]||![];_0x363761[_0x2f16('0x51')]=_0x5e0d90['user']['id'];return getContent(_0x5e0d90[_0x2f16('0x37')])[_0x2f16('0x2e')](function(_0x915aac){_0x363761[_0x2f16('0x37')]=_0x915aac;return getRecipients(_0x8d4331);})[_0x2f16('0x2e')](function(_0xa969ad){_0x363761[_0x2f16('0x52')]=_[_0x2f16('0x53')](_0xa969ad)[_0x2f16('0x54')](',');return db[_0x2f16('0x55')][_0x2f16('0x56')](function(_0x5607db){return db[_0x2f16('0x57')]['create'](_0x363761,{'raw':!![],'transaction':_0x5607db})['then'](function(_0x13d186){var _0x47db82={'sender':_0x363761[_0x2f16('0x4c')],'description':_0x363761[_0x2f16('0x4e')],'content':_0x363761[_0x2f16('0x37')],'beep':_0x363761[_0x2f16('0x50')]};_0xa969ad[_0x2f16('0x58')](function(_0x4e641c){_0x47db82[_0x2f16('0x59')]=_0x4e641c;socket[_0x2f16('0x5a')](_0x2f16('0x5b'),_0x47db82);});return _0x13d186;});});})[_0x2f16('0x2e')](respondWithResult(_0x15c517,0xc9))[_0x2f16('0x5c')](handleError(_0x15c517,null));};function getContent(_0x385a6b){return new BPromise(function(_0x155f51,_0x3bc3ff){if(_0x385a6b['text']){_0x155f51(_0x385a6b[_0x2f16('0x5d')]);return;}return db['Template']['findOne']({'attributes':[_0x2f16('0x5e')],'where':{'id':_0x385a6b['TemplateId']},'raw':!![]})['then'](function(_0x27a753){if(!_0x27a753)throw new db[(_0x2f16('0x3b'))][(_0x2f16('0x35'))](_0x2f16('0x5f'));var _0x2ad7b1=Mustache[_0x2f16('0x60')](_0x27a753[_0x2f16('0x5e')],_0x385a6b[_0x2f16('0x38')]);_0x155f51(_0x2ad7b1);})[_0x2f16('0x5c')](function(_0x36e4be){_0x3bc3ff(_0x36e4be);});});}function getRecipients(_0x31c46b){return new BPromise(function(_0x25ebe0,_0x473a24){var _0x542feb=[];var _0x40e408=[];_0x31c46b[_0x2f16('0x58')](function(_0x33ca89){var _0x4d44f4=_[_0x2f16('0x61')](_0x33ca89[_0x2f16('0x49')]['toLowerCase']());if(_0x4d44f4==='User'){_0x542feb=_['union'](_0x542feb,_0x33ca89[_0x2f16('0x62')]);}else{if(_['includes'](_0x4d44f4,'queue'))_0x4d44f4=_0x4d44f4['replace'](_0x2f16('0x63'),'Queue');_0x33ca89['ids'][_0x2f16('0x58')](function(_0x43e052){_0x40e408[_0x2f16('0x64')](getAgents(_0x4d44f4,_0x43e052));});}});return BPromise[_0x2f16('0x65')](_0x40e408)[_0x2f16('0x2e')](function(_0x541c52){_0x542feb=_['union'](_0x542feb,_[_0x2f16('0x66')](_0x541c52));_0x25ebe0(_0x542feb);})['catch'](function(_0x4c7fc4){_0x473a24(_0x4c7fc4);});});}function getAgents(_0x113246,_0x1e0071){return new BPromise(function(_0x399636,_0xa48e5b){return db[_0x113246][_0x2f16('0x67')]({'where':{'id':_0x1e0071}})[_0x2f16('0x2e')](function(_0x11e6a5){return _0x11e6a5[_0x2f16('0x68')]({'attributes':['id'],'raw':!![]})[_0x2f16('0x2e')](function(_0x3aafa2){var _0x435c92=_[_0x2f16('0x69')](_0x3aafa2,'id');_0x399636(_0x435c92);});})[_0x2f16('0x5c')](function(_0xe84c14){_0xa48e5b(_0xe84c14);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 10fb1b3..d7bc767 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 _0xbbe9=['update','emit','hasOwnProperty','exports','events','UserNotification','setMaxListeners','save'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xbbe9,0xdc));var _0x9bbe=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xbbe9[_0x88cd7b];return _0x56fcc8;};'use strict';var EventEmitter=require(_0x9bbe('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x9bbe('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x9bbe('0x2')](0x0);var events={'afterCreate':_0x9bbe('0x3'),'afterUpdate':_0x9bbe('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2eb564){return function(_0x48916e,_0x1347b0,_0x552353){UserNotificationEvents[_0x9bbe('0x5')](_0x2eb564+':'+_0x48916e['id'],_0x48916e);UserNotificationEvents[_0x9bbe('0x5')](_0x2eb564,_0x48916e);_0x552353(null);};}for(var e in events){if(events[_0x9bbe('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x9bbe('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x46dc=['hook','exports','events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty'];(function(_0x4976c7,_0x4e3fb8){var _0x3bd68b=function(_0xd2b6da){while(--_0xd2b6da){_0x4976c7['push'](_0x4976c7['shift']());}};_0x3bd68b(++_0x4e3fb8);}(_0x46dc,0x17e));var _0xc46d=function(_0x3cfcee,_0x1defe8){_0x3cfcee=_0x3cfcee-0x0;var _0x156879=_0x46dc[_0x3cfcee];return _0x156879;};'use strict';var EventEmitter=require(_0xc46d('0x0'));var UserNotification=require(_0xc46d('0x1'))['db'][_0xc46d('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc46d('0x3'),'afterUpdate':_0xc46d('0x4'),'afterDestroy':_0xc46d('0x5')};function emitEvent(_0x15f1fa){return function(_0x398484,_0x35eed7,_0x4a2d9b){UserNotificationEvents[_0xc46d('0x6')](_0x15f1fa+':'+_0x398484['id'],_0x398484);UserNotificationEvents['emit'](_0x15f1fa,_0x398484);_0x4a2d9b(null);};}for(var e in events){if(events[_0xc46d('0x7')](e)){var event=events[e];UserNotification[_0xc46d('0x8')](e,emitEvent(event));}}module[_0xc46d('0x9')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 26f6ec3..4c846bb 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 _0x4592=['rimraf','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x44e4e1,_0x5637b2){var _0x300cd2=function(_0x189eeb){while(--_0x189eeb){_0x44e4e1['push'](_0x44e4e1['shift']());}};_0x300cd2(++_0x5637b2);}(_0x4592,0x18f));var _0x2459=function(_0x55484c,_0x195095){_0x55484c=_0x55484c-0x0;var _0x20835e=_0x4592[_0x55484c];return _0x20835e;};'use strict';var _=require(_0x2459('0x0'));var util=require(_0x2459('0x1'));var logger=require(_0x2459('0x2'))(_0x2459('0x3'));var moment=require('moment');var BPromise=require(_0x2459('0x4'));var rp=require(_0x2459('0x5'));var fs=require('fs');var path=require(_0x2459('0x6'));var rimraf=require(_0x2459('0x7'));var config=require('../../config/environment');var attributes=require('./userNotification.attributes');module[_0x2459('0x8')]=function(_0x1ca8ea,_0x20a871){return _0x1ca8ea[_0x2459('0x9')](_0x2459('0xa'),attributes,{'tableName':_0x2459('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2459('0xc'),'collate':_0x2459('0xd')});}; \ No newline at end of file +var _0xde91=['../../config/logger','bluebird','request-promise','path','../../config/environment','exports','UserNotification','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xde91,0x171));var _0x1de9=function(_0x3a19d4,_0x3f19a4){_0x3a19d4=_0x3a19d4-0x0;var _0x5b858b=_0xde91[_0x3a19d4];return _0x5b858b;};'use strict';var _=require('lodash');var util=require(_0x1de9('0x0'));var logger=require(_0x1de9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1de9('0x2'));var rp=require(_0x1de9('0x3'));var fs=require('fs');var path=require(_0x1de9('0x4'));var rimraf=require('rimraf');var config=require(_0x1de9('0x5'));var attributes=require('./userNotification.attributes');module[_0x1de9('0x6')]=function(_0x1bef21,_0x1bff69){return _0x1bef21['define'](_0x1de9('0x7'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1de9('0x8'),'collate':_0x1de9('0x9')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index e4ecd54..021f1d2 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 _0x6841=['socket.io-emitter','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x2bf5bd,_0x120787){var _0xc810c0=function(_0xba9dd3){while(--_0xba9dd3){_0x2bf5bd['push'](_0x2bf5bd['shift']());}};_0xc810c0(++_0x120787);}(_0x6841,0x1c1));var _0x1684=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x6841[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x1684('0x0'));var util=require(_0x1684('0x1'));var moment=require(_0x1684('0x2'));var BPromise=require(_0x1684('0x3'));var rs=require(_0x1684('0x4'));var fs=require('fs');var Redis=require(_0x1684('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1684('0x6'));var logger=require(_0x1684('0x7'))(_0x1684('0x8'));var config=require(_0x1684('0x9'));var jayson=require(_0x1684('0xa'));var client=jayson[_0x1684('0xb')][_0x1684('0xc')]({'port':0x232a});config[_0x1684('0xd')]=_['defaults'](config[_0x1684('0xd')],{'host':_0x1684('0xe'),'port':0x18eb});var socket=require(_0x1684('0xf'))(new Redis(config[_0x1684('0xd')]));require(_0x1684('0x10'))['register'](socket);function respondWithRpcPromise(_0x4f9ed1,_0x278034,_0x376926){return new BPromise(function(_0x539c6a,_0x46669f){return client[_0x1684('0x11')](_0x4f9ed1,_0x376926)[_0x1684('0x12')](function(_0x17eea3){logger[_0x1684('0x13')](_0x1684('0x14'),_0x278034,'request\x20sent');logger[_0x1684('0x15')](_0x1684('0x16'),_0x278034,_0x1684('0x17'),JSON[_0x1684('0x18')](_0x17eea3));if(_0x17eea3[_0x1684('0x19')]){if(_0x17eea3[_0x1684('0x19')][_0x1684('0x1a')]===0x1f4){logger[_0x1684('0x19')]('UserNotification,\x20%s,\x20%s',_0x278034,_0x17eea3[_0x1684('0x19')][_0x1684('0x1b')]);return _0x46669f(_0x17eea3[_0x1684('0x19')]['message']);}logger[_0x1684('0x19')](_0x1684('0x14'),_0x278034,_0x17eea3['error']['message']);return _0x539c6a(_0x17eea3[_0x1684('0x19')][_0x1684('0x1b')]);}else{logger[_0x1684('0x13')](_0x1684('0x14'),_0x278034,_0x1684('0x17'));_0x539c6a(_0x17eea3[_0x1684('0x1c')][_0x1684('0x1b')]);}})['catch'](function(_0x5e8ecd){logger[_0x1684('0x19')](_0x1684('0x14'),_0x278034,_0x5e8ecd);_0x46669f(_0x5e8ecd);});});} \ No newline at end of file +var _0x6813=['then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0x6813,0x14a));var _0x3681=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6813[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3681('0x0'));var util=require(_0x3681('0x1'));var moment=require('moment');var BPromise=require(_0x3681('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3681('0x3'));var db=require(_0x3681('0x4'))['db'];var utils=require(_0x3681('0x5'));var logger=require(_0x3681('0x6'))(_0x3681('0x7'));var config=require(_0x3681('0x8'));var jayson=require(_0x3681('0x9'));var client=jayson[_0x3681('0xa')][_0x3681('0xb')]({'port':0x232a});config[_0x3681('0xc')]=_[_0x3681('0xd')](config[_0x3681('0xc')],{'host':_0x3681('0xe'),'port':0x18eb});var socket=require(_0x3681('0xf'))(new Redis(config[_0x3681('0xc')]));require('./userNotification.socket')[_0x3681('0x10')](socket);function respondWithRpcPromise(_0x28893e,_0x570183,_0x4749e3){return new BPromise(function(_0x4a4c93,_0x25183b){return client[_0x3681('0x11')](_0x28893e,_0x4749e3)[_0x3681('0x12')](function(_0x1c9583){logger['info'](_0x3681('0x13'),_0x570183,_0x3681('0x14'));logger[_0x3681('0x15')](_0x3681('0x16'),_0x570183,_0x3681('0x14'),JSON[_0x3681('0x17')](_0x1c9583));if(_0x1c9583[_0x3681('0x18')]){if(_0x1c9583[_0x3681('0x18')][_0x3681('0x19')]===0x1f4){logger[_0x3681('0x18')]('UserNotification,\x20%s,\x20%s',_0x570183,_0x1c9583[_0x3681('0x18')][_0x3681('0x1a')]);return _0x25183b(_0x1c9583['error'][_0x3681('0x1a')]);}logger[_0x3681('0x18')](_0x3681('0x13'),_0x570183,_0x1c9583['error']['message']);return _0x4a4c93(_0x1c9583['error']['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x570183,_0x3681('0x14'));_0x4a4c93(_0x1c9583[_0x3681('0x1b')][_0x3681('0x1a')]);}})[_0x3681('0x1c')](function(_0x314a0b){logger[_0x3681('0x18')](_0x3681('0x13'),_0x570183,_0x314a0b);_0x25183b(_0x314a0b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index f1b0fc5..4db8032 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 _0x145f=['userNotification:','emit','register'];(function(_0x3c6bdb,_0x4af4e0){var _0x310f9c=function(_0x2d0fc1){while(--_0x2d0fc1){_0x3c6bdb['push'](_0x3c6bdb['shift']());}};_0x310f9c(++_0x4af4e0);}(_0x145f,0xa9));var _0xf145=function(_0x2f625b,_0x5699cb){_0x2f625b=_0x2f625b-0x0;var _0x2300f8=_0x145f[_0x2f625b];return _0x2300f8;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save','remove','update'];function createListener(_0x245e92,_0x2bc76c){return function(_0x3124c7){_0x2bc76c[_0xf145('0x0')](_0x245e92,_0x3124c7);};}function removeListener(_0x452019,_0x100930){return function(){UserNotificationEvents['removeListener'](_0x452019,_0x100930);};}exports[_0xf145('0x1')]=function(_0xe7bfca){for(var _0x75e8cd=0x0,_0x222c59=events['length'];_0x75e8cd<_0x222c59;_0x75e8cd++){var _0x1c3293=events[_0x75e8cd];var _0x1f897e=createListener(_0xf145('0x2')+_0x1c3293,_0xe7bfca);UserNotificationEvents['on'](_0x1c3293,_0x1f897e);}}; \ No newline at end of file +var _0x25c1=['register','length','userNotification:','./userNotification.events','remove','update','emit'];(function(_0x487d93,_0x1443b2){var _0xa6ba2a=function(_0x6dfbb9){while(--_0x6dfbb9){_0x487d93['push'](_0x487d93['shift']());}};_0xa6ba2a(++_0x1443b2);}(_0x25c1,0x88));var _0x125c=function(_0x11ce2d,_0x512d87){_0x11ce2d=_0x11ce2d-0x0;var _0x1a1019=_0x25c1[_0x11ce2d];return _0x1a1019;};'use strict';var UserNotificationEvents=require(_0x125c('0x0'));var events=['save',_0x125c('0x1'),_0x125c('0x2')];function createListener(_0x447150,_0x514a21){return function(_0x3cdc44){_0x514a21[_0x125c('0x3')](_0x447150,_0x3cdc44);};}function removeListener(_0x384734,_0x2ec0c3){return function(){UserNotificationEvents['removeListener'](_0x384734,_0x2ec0c3);};}exports[_0x125c('0x4')]=function(_0xb59ad7){for(var _0x387fce=0x0,_0x1b1249=events[_0x125c('0x5')];_0x387fce<_0x1b1249;_0x387fce++){var _0xcf8d82=events[_0x387fce];var _0x42b570=createListener(_0x125c('0x6')+_0xcf8d82,_0xb59ad7);UserNotificationEvents['on'](_0xcf8d82,_0x42b570);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index b0be375..e776619 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x453a17,_0x469ca7){var _0x575722=function(_0x27609a){while(--_0x27609a){_0x453a17['push'](_0x453a17['shift']());}};_0x575722(++_0x469ca7);}(_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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x49f30d,_0x50300a){var _0x2c75fa=function(_0x3a880a){while(--_0x3a880a){_0x49f30d['push'](_0x49f30d['shift']());}};_0x2c75fa(++_0x50300a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index a6759e4..6dfb1de 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 _0x29e0=['sequelize','exports','INTEGER'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x29e0,0x1c8));var _0x029e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x029e('0x0'));module[_0x029e('0x1')]={'penalty':{'type':Sequelize[_0x029e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8d37=['sequelize','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8d37,0xbc));var _0x78d3=function(_0x3911ff,_0x5b57be){_0x3911ff=_0x3911ff-0x0;var _0x5aacc6=_0x8d37[_0x3911ff];return _0x5aacc6;};'use strict';var Sequelize=require(_0x78d3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x78d3('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 5835c82..bd88d05 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 _0xfda1=['path','rimraf','../../config/environment','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment'];(function(_0x14cd3d,_0x2ac662){var _0xb005f5=function(_0x476a98){while(--_0x476a98){_0x14cd3d['push'](_0x14cd3d['shift']());}};_0xb005f5(++_0x2ac662);}(_0xfda1,0xa6));var _0x1fda=function(_0x5ac0ce,_0x2a79f2){_0x5ac0ce=_0x5ac0ce-0x0;var _0x136050=_0xfda1[_0x5ac0ce];return _0x136050;};'use strict';var _=require(_0x1fda('0x0'));var util=require(_0x1fda('0x1'));var logger=require('../../config/logger')(_0x1fda('0x2'));var moment=require(_0x1fda('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fda('0x4'));var rimraf=require(_0x1fda('0x5'));var config=require(_0x1fda('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x1fda('0x7')]=function(_0x1cfc93,_0x42ce2d){return _0x1cfc93['define'](_0x1fda('0x8'),attributes,{'tableName':_0x1fda('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a97=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x50d640,_0x1e1d43){var _0x59f6fe=function(_0x449976){while(--_0x449976){_0x50d640['push'](_0x50d640['shift']());}};_0x59f6fe(++_0x1e1d43);}(_0x0a97,0x164));var _0x70a9=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0a97[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x70a9('0x0'));var util=require(_0x70a9('0x1'));var logger=require(_0x70a9('0x2'))('api');var moment=require(_0x70a9('0x3'));var BPromise=require(_0x70a9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x70a9('0x5'));var rimraf=require(_0x70a9('0x6'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x70a9('0x7')]=function(_0x56eeab,_0x522679){return _0x56eeab[_0x70a9('0x8')](_0x70a9('0x9'),attributes,{'tableName':_0x70a9('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 c7fe3ed..23d0c45 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 _0x4dfd=['http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d5d10,_0xd00682){var _0x5c3431=function(_0xac06ad){while(--_0xac06ad){_0x4d5d10['push'](_0x4d5d10['shift']());}};_0x5c3431(++_0xd00682);}(_0x4dfd,0x139));var _0xd4df=function(_0x4a7999,_0x26e231){_0x4a7999=_0x4a7999-0x0;var _0x48efae=_0x4dfd[_0x4a7999];return _0x48efae;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd4df('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4df('0x1'));var db=require(_0xd4df('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd4df('0x3'));var config=require(_0xd4df('0x4'));var jayson=require(_0xd4df('0x5'));var client=jayson[_0xd4df('0x6')][_0xd4df('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd2b138,_0x226da3,_0x205c42){return new BPromise(function(_0x328f42,_0x13cce8){return client[_0xd4df('0x8')](_0xd2b138,_0x205c42)['then'](function(_0x276d48){logger[_0xd4df('0x9')](_0xd4df('0xa'),_0x226da3,_0xd4df('0xb'));logger[_0xd4df('0xc')](_0xd4df('0xd'),_0x226da3,'request\x20sent',JSON[_0xd4df('0xe')](_0x276d48));if(_0x276d48[_0xd4df('0xf')]){if(_0x276d48[_0xd4df('0xf')][_0xd4df('0x10')]===0x1f4){logger[_0xd4df('0xf')](_0xd4df('0xa'),_0x226da3,_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);return _0x13cce8(_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);}logger[_0xd4df('0xf')](_0xd4df('0xa'),_0x226da3,_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);return _0x328f42(_0x276d48[_0xd4df('0xf')][_0xd4df('0x11')]);}else{logger[_0xd4df('0x9')](_0xd4df('0xa'),_0x226da3,'request\x20sent');_0x328f42(_0x276d48[_0xd4df('0x12')]['message']);}})[_0xd4df('0x13')](function(_0x52419e){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x226da3,_0x52419e);_0x13cce8(_0x52419e);});});} \ No newline at end of file +var _0xfcb7=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x5d8940,_0x52c352){var _0x2830b0=function(_0x580916){while(--_0x580916){_0x5d8940['push'](_0x5d8940['shift']());}};_0x2830b0(++_0x52c352);}(_0xfcb7,0x8c));var _0x7fcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfcb7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fcb('0x0'));var util=require(_0x7fcb('0x1'));var moment=require(_0x7fcb('0x2'));var BPromise=require('bluebird');var rs=require(_0x7fcb('0x3'));var fs=require('fs');var Redis=require(_0x7fcb('0x4'));var db=require(_0x7fcb('0x5'))['db'];var utils=require(_0x7fcb('0x6'));var logger=require(_0x7fcb('0x7'))(_0x7fcb('0x8'));var config=require(_0x7fcb('0x9'));var jayson=require(_0x7fcb('0xa'));var client=jayson['client'][_0x7fcb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x216ae8,_0x46732c,_0x374faf){return new BPromise(function(_0x21cd92,_0x511fe8){return client[_0x7fcb('0xc')](_0x216ae8,_0x374faf)[_0x7fcb('0xd')](function(_0x4922fe){logger[_0x7fcb('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x46732c,'request\x20sent');logger['debug'](_0x7fcb('0xf'),_0x46732c,'request\x20sent',JSON[_0x7fcb('0x10')](_0x4922fe));if(_0x4922fe[_0x7fcb('0x11')]){if(_0x4922fe['error']['code']===0x1f4){logger[_0x7fcb('0x11')](_0x7fcb('0x12'),_0x46732c,_0x4922fe[_0x7fcb('0x11')][_0x7fcb('0x13')]);return _0x511fe8(_0x4922fe[_0x7fcb('0x11')][_0x7fcb('0x13')]);}logger['error'](_0x7fcb('0x12'),_0x46732c,_0x4922fe[_0x7fcb('0x11')]['message']);return _0x21cd92(_0x4922fe[_0x7fcb('0x11')][_0x7fcb('0x13')]);}else{logger[_0x7fcb('0xe')](_0x7fcb('0x12'),_0x46732c,'request\x20sent');_0x21cd92(_0x4922fe['result'][_0x7fcb('0x13')]);}})['catch'](function(_0xa79849){logger[_0x7fcb('0x11')](_0x7fcb('0x12'),_0x46732c,_0xa79849);_0x511fe8(_0xa79849);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index d9f5a6d..b50f44f 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 _0x4f02=['fs-extra','../../components/auth/service','./userProfile.controller','get','isAuthenticated','index','describe','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','/:id','update','destroy','removeSections','delete','removeResources','multer','path','connect-timeout','Router'];(function(_0x462441,_0x30def6){var _0x5ae334=function(_0x4e639d){while(--_0x4e639d){_0x462441['push'](_0x462441['shift']());}};_0x5ae334(++_0x30def6);}(_0x4f02,0x184));var _0x24f0=function(_0x2a3f20,_0x28826a){_0x2a3f20=_0x2a3f20-0x0;var _0x4c483a=_0x4f02[_0x2a3f20];return _0x4c483a;};'use strict';var multer=require(_0x24f0('0x0'));var util=require('util');var path=require(_0x24f0('0x1'));var timeout=require(_0x24f0('0x2'));var express=require('express');var router=express[_0x24f0('0x3')]();var fs_extra=require(_0x24f0('0x4'));var auth=require(_0x24f0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x24f0('0x6'));router[_0x24f0('0x7')]('/',auth[_0x24f0('0x8')](),controller[_0x24f0('0x9')]);router['get']('/describe',auth[_0x24f0('0x8')](),controller[_0x24f0('0xa')]);router['get']('/:id',auth[_0x24f0('0x8')](),controller['show']);router[_0x24f0('0x7')](_0x24f0('0xb'),auth[_0x24f0('0x8')](),controller[_0x24f0('0xc')]);router[_0x24f0('0x7')](_0x24f0('0xd'),auth[_0x24f0('0x8')](),controller[_0x24f0('0xe')]);router[_0x24f0('0xf')]('/',auth[_0x24f0('0x8')](),controller[_0x24f0('0x10')]);router[_0x24f0('0xf')](_0x24f0('0x11'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x12')]);router[_0x24f0('0xf')](_0x24f0('0xb'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x13')]);router[_0x24f0('0xf')](_0x24f0('0xd'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x14')]);router[_0x24f0('0x15')](_0x24f0('0x16'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x17')]);router['delete']('/:id',auth[_0x24f0('0x8')](),controller[_0x24f0('0x18')]);router['delete'](_0x24f0('0xb'),auth[_0x24f0('0x8')](),controller[_0x24f0('0x19')]);router[_0x24f0('0x1a')]('/:id/resources',auth[_0x24f0('0x8')](),controller[_0x24f0('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xc4e8=['post','create','/:id/clone','clone','addSections','addResources','update','delete','destroy','/:id/resources','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','getResources'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0xc4e8,0xe3));var _0x8c4e=function(_0x23e702,_0x3e915c){_0x23e702=_0x23e702-0x0;var _0x1f4ed5=_0xc4e8[_0x23e702];return _0x1f4ed5;};'use strict';var multer=require(_0x8c4e('0x0'));var util=require(_0x8c4e('0x1'));var path=require(_0x8c4e('0x2'));var timeout=require(_0x8c4e('0x3'));var express=require('express');var router=express[_0x8c4e('0x4')]();var fs_extra=require(_0x8c4e('0x5'));var auth=require(_0x8c4e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c4e('0x7'));var controller=require(_0x8c4e('0x8'));router[_0x8c4e('0x9')]('/',auth[_0x8c4e('0xa')](),controller[_0x8c4e('0xb')]);router[_0x8c4e('0x9')]('/describe',auth[_0x8c4e('0xa')](),controller[_0x8c4e('0xc')]);router[_0x8c4e('0x9')](_0x8c4e('0xd'),auth[_0x8c4e('0xa')](),controller[_0x8c4e('0xe')]);router['get']('/:id/sections',auth[_0x8c4e('0xa')](),controller['getSections']);router[_0x8c4e('0x9')]('/:id/resources',auth[_0x8c4e('0xa')](),controller[_0x8c4e('0xf')]);router[_0x8c4e('0x10')]('/',auth['isAuthenticated'](),controller[_0x8c4e('0x11')]);router[_0x8c4e('0x10')](_0x8c4e('0x12'),auth[_0x8c4e('0xa')](),controller[_0x8c4e('0x13')]);router[_0x8c4e('0x10')]('/:id/sections',auth[_0x8c4e('0xa')](),controller[_0x8c4e('0x14')]);router['post']('/:id/resources',auth[_0x8c4e('0xa')](),controller[_0x8c4e('0x15')]);router['put']('/:id',auth[_0x8c4e('0xa')](),controller[_0x8c4e('0x16')]);router[_0x8c4e('0x17')]('/:id',auth[_0x8c4e('0xa')](),controller[_0x8c4e('0x18')]);router[_0x8c4e('0x17')]('/:id/sections',auth['isAuthenticated'](),controller['removeSections']);router[_0x8c4e('0x17')](_0x8c4e('0x19'),auth['isAuthenticated'](),controller['removeResources']);module[_0x8c4e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index cb381c0..c59253e 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 _0xb8cd=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x37f2a7,_0x4c881c){var _0x5d6541=function(_0x5ed84a){while(--_0x5ed84a){_0x37f2a7['push'](_0x37f2a7['shift']());}};_0x5d6541(++_0x4c881c);}(_0xb8cd,0x19b));var _0xdb8c=function(_0x7c913e,_0x504057){_0x7c913e=_0x7c913e-0x0;var _0x2e44bb=_0xb8cd[_0x7c913e];return _0x2e44bb;};'use strict';var Sequelize=require(_0xdb8c('0x0'));module[_0xdb8c('0x1')]={'name':{'type':Sequelize[_0xdb8c('0x2')],'allowNull':![],'unique':_0xdb8c('0x3')},'crudPermissions':{'type':Sequelize[_0xdb8c('0x2')],'set':function(_0x4a21a7){this[_0xdb8c('0x4')](_0xdb8c('0x5'),_0x4a21a7?_0x4a21a7[_0xdb8c('0x6')](''):[]);},'get':function(){return this[_0xdb8c('0x7')](_0xdb8c('0x5'))?this[_0xdb8c('0x7')](_0xdb8c('0x5'))[_0xdb8c('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xdb8c('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdb8c('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4797=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','split'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0x4797,0x121));var _0x7479=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4797[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x7479('0x0'));module[_0x7479('0x1')]={'name':{'type':Sequelize[_0x7479('0x2')],'allowNull':![],'unique':_0x7479('0x3')},'crudPermissions':{'type':Sequelize[_0x7479('0x2')],'set':function(_0x2d87d0){this[_0x7479('0x4')](_0x7479('0x5'),_0x2d87d0?_0x2d87d0['join'](''):[]);},'get':function(){return this['getDataValue'](_0x7479('0x5'))?this['getDataValue'](_0x7479('0x5'))[_0x7479('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x7479('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x7479('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x7479('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x7479('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x7479('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7479('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x7479('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7479('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index bb98b51..4facd13 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 _0xe893=['sendStatus','error','stack','name','send','UserProfile','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','clone','rawAttributes','get','omit','createdAt','updatedAt','crudPermissions','transaction','body','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','sequelize','push','removeSections','enabled','includes','subsections','concat','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','then'];(function(_0xe1269d,_0x57b7c3){var _0x261ca1=function(_0x13b234){while(--_0x13b234){_0xe1269d['push'](_0xe1269d['shift']());}};_0x261ca1(++_0x57b7c3);}(_0xe893,0x134));var _0x3e89=function(_0xc3e938,_0x11b0bf){_0xc3e938=_0xc3e938-0x0;var _0x5360ca=_0xe893[_0xc3e938];return _0x5360ca;};'use strict';var emlformat=require(_0x3e89('0x0'));var rimraf=require(_0x3e89('0x1'));var zipdir=require(_0x3e89('0x2'));var jsonpatch=require(_0x3e89('0x3'));var rp=require(_0x3e89('0x4'));var moment=require(_0x3e89('0x5'));var BPromise=require(_0x3e89('0x6'));var Mustache=require(_0x3e89('0x7'));var util=require('util');var path=require(_0x3e89('0x8'));var sox=require(_0x3e89('0x9'));var csv=require(_0x3e89('0xa'));var ejs=require(_0x3e89('0xb'));var fs=require('fs');var fs_extra=require(_0x3e89('0xc'));var _=require('lodash');var squel=require(_0x3e89('0xd'));var crypto=require(_0x3e89('0xe'));var jsforce=require(_0x3e89('0xf'));var deskjs=require(_0x3e89('0x10'));var toCsv=require(_0x3e89('0xa'));var querystring=require('querystring');var Papa=require(_0x3e89('0x11'));var Redis=require(_0x3e89('0x12'));var authService=require(_0x3e89('0x13'));var qs=require(_0x3e89('0x14'));var as=require(_0x3e89('0x15'));var hardwareService=require(_0x3e89('0x16'));var logger=require(_0x3e89('0x17'))('api');var utils=require(_0x3e89('0x18'));var config=require(_0x3e89('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e89('0x1a'))['db'];config[_0x3e89('0x1b')]=_[_0x3e89('0x1c')](config['redis'],{'host':_0x3e89('0x1d'),'port':0x18eb});var socket=require(_0x3e89('0x1e'))(new Redis(config['redis']));require(_0x3e89('0x1f'))[_0x3e89('0x20')](socket);function respondWithStatusCode(_0x4bc434,_0xabac5d){_0xabac5d=_0xabac5d||0xcc;return function(_0x5d11e0){if(_0x5d11e0){return _0x4bc434['sendStatus'](_0xabac5d);}return _0x4bc434[_0x3e89('0x21')](_0xabac5d)[_0x3e89('0x22')]();};}function respondWithResult(_0xbd48e8,_0x374413){_0x374413=_0x374413||0xc8;return function(_0xf50b96){if(_0xf50b96){return _0xbd48e8['status'](_0x374413)[_0x3e89('0x23')](_0xf50b96);}};}function respondWithFilteredResult(_0x4dbb7b,_0x1b16f4){return function(_0x526fd3){if(_0x526fd3){var _0x16e64c=typeof _0x1b16f4[_0x3e89('0x24')]===_0x3e89('0x25')&&typeof _0x1b16f4[_0x3e89('0x26')]===_0x3e89('0x25');var _0x47feca=_0x526fd3['count'];var _0x3a1eb4=_0x16e64c?0x0:_0x1b16f4[_0x3e89('0x24')];var _0xd5bc8f=_0x16e64c?_0x526fd3['count']:_0x1b16f4['offset']+_0x1b16f4[_0x3e89('0x26')];var _0x58b38a;if(_0xd5bc8f>=_0x47feca){_0xd5bc8f=_0x47feca;_0x58b38a=0xc8;}else{_0x58b38a=0xce;}_0x4dbb7b[_0x3e89('0x21')](_0x58b38a);return _0x4dbb7b[_0x3e89('0x27')](_0x3e89('0x28'),_0x3a1eb4+'-'+_0xd5bc8f+'/'+_0x47feca)['json'](_0x526fd3);}return null;};}function patchUpdates(_0x3bb1de){return function(_0x406c14){try{jsonpatch[_0x3e89('0x29')](_0x406c14,_0x3bb1de,!![]);}catch(_0x511644){return BPromise['reject'](_0x511644);}return _0x406c14[_0x3e89('0x2a')]();};}function saveUpdates(_0x448bd3,_0x48e6ee){return function(_0x8711ed){if(_0x8711ed){return _0x8711ed[_0x3e89('0x2b')](_0x448bd3)['then'](function(_0x394948){return _0x394948;});}return null;};}function removeEntity(_0x370208,_0x314eee){return function(_0x4c476b){if(_0x4c476b){return _0x4c476b[_0x3e89('0x2c')]()[_0x3e89('0x2d')](function(){_0x370208[_0x3e89('0x21')](0xcc)[_0x3e89('0x22')]();});}};}function handleEntityNotFound(_0x441cd4,_0x527478){return function(_0x80c58e){if(!_0x80c58e){_0x441cd4[_0x3e89('0x2e')](0x194);}return _0x80c58e;};}function handleError(_0x560eff,_0x27fe04){_0x27fe04=_0x27fe04||0x1f4;return function(_0x43f344){logger[_0x3e89('0x2f')](_0x43f344[_0x3e89('0x30')]);if(_0x43f344[_0x3e89('0x31')]){delete _0x43f344[_0x3e89('0x31')];}_0x560eff[_0x3e89('0x21')](_0x27fe04)[_0x3e89('0x32')](_0x43f344);};}exports['index']=function(_0x4e8646,_0x44a6ef){var _0x6201e6={},_0x4643fb={},_0x8f7765={'count':0x0,'rows':[]};var _0x44a76b=_['map'](db[_0x3e89('0x33')]['rawAttributes'],function(_0x570555){return{'name':_0x570555[_0x3e89('0x34')],'type':_0x570555[_0x3e89('0x35')][_0x3e89('0x36')]};});_0x4643fb[_0x3e89('0x37')]=_[_0x3e89('0x38')](_0x44a76b,_0x3e89('0x31'));_0x4643fb[_0x3e89('0x39')]=_[_0x3e89('0x3a')](_0x4e8646[_0x3e89('0x39')]);_0x4643fb[_0x3e89('0x3b')]=_[_0x3e89('0x3c')](_0x4643fb['model'],_0x4643fb['query']);_0x6201e6[_0x3e89('0x3d')]=_[_0x3e89('0x3c')](_0x4643fb[_0x3e89('0x37')],qs[_0x3e89('0x3e')](_0x4e8646[_0x3e89('0x39')]['fields']));_0x6201e6[_0x3e89('0x3d')]=_0x6201e6[_0x3e89('0x3d')][_0x3e89('0x3f')]?_0x6201e6[_0x3e89('0x3d')]:_0x4643fb[_0x3e89('0x37')];if(!_0x4e8646[_0x3e89('0x39')][_0x3e89('0x40')](_0x3e89('0x41'))){_0x6201e6[_0x3e89('0x26')]=qs['limit'](_0x4e8646['query']['limit']);_0x6201e6['offset']=qs[_0x3e89('0x24')](_0x4e8646[_0x3e89('0x39')][_0x3e89('0x24')]);}_0x6201e6[_0x3e89('0x42')]=qs[_0x3e89('0x43')](_0x4e8646[_0x3e89('0x39')]['sort']);_0x6201e6['where']=qs[_0x3e89('0x3b')](_[_0x3e89('0x44')](_0x4e8646[_0x3e89('0x39')],_0x4643fb[_0x3e89('0x3b')]),_0x44a76b);if(_0x4e8646['query'][_0x3e89('0x45')]){_0x6201e6[_0x3e89('0x46')]=_[_0x3e89('0x47')](_0x6201e6[_0x3e89('0x46')],{'$or':_[_0x3e89('0x38')](_0x44a76b,function(_0x4938d4){if(_0x4938d4[_0x3e89('0x35')]!==_0x3e89('0x48')){var _0x57ce58={};_0x57ce58[_0x4938d4[_0x3e89('0x31')]]={'$like':'%'+_0x4e8646[_0x3e89('0x39')]['filter']+'%'};return _0x57ce58;}})});}_0x6201e6=_[_0x3e89('0x47')]({},_0x6201e6,_0x4e8646[_0x3e89('0x49')]);var _0x3c6d56={'where':_0x6201e6[_0x3e89('0x46')]};return db[_0x3e89('0x33')][_0x3e89('0x4a')](_0x3c6d56)['then'](function(_0x42e821){_0x8f7765[_0x3e89('0x4a')]=_0x42e821;if(_0x4e8646[_0x3e89('0x39')][_0x3e89('0x4b')]){_0x6201e6[_0x3e89('0x4c')]=[{'all':!![]}];}return db[_0x3e89('0x33')][_0x3e89('0x4d')](_0x6201e6);})[_0x3e89('0x2d')](function(_0x6950d6){_0x8f7765[_0x3e89('0x4e')]=_0x6950d6;return _0x8f7765;})[_0x3e89('0x2d')](respondWithFilteredResult(_0x44a6ef,_0x6201e6))['catch'](handleError(_0x44a6ef,null));};exports[_0x3e89('0x4f')]=function(_0x332752,_0x121753){var _0x59e04a={'raw':![],'where':{'id':_0x332752[_0x3e89('0x50')]['id']}},_0xeeaa12={};_0xeeaa12['model']=_[_0x3e89('0x3a')](db[_0x3e89('0x33')]['rawAttributes']);_0xeeaa12[_0x3e89('0x39')]=_[_0x3e89('0x3a')](_0x332752['query']);_0xeeaa12['filters']=_[_0x3e89('0x3c')](_0xeeaa12[_0x3e89('0x37')],_0xeeaa12[_0x3e89('0x39')]);_0x59e04a[_0x3e89('0x3d')]=_[_0x3e89('0x3c')](_0xeeaa12[_0x3e89('0x37')],qs['fields'](_0x332752[_0x3e89('0x39')][_0x3e89('0x3e')]));_0x59e04a['attributes']=_0x59e04a[_0x3e89('0x3d')]['length']?_0x59e04a['attributes']:_0xeeaa12[_0x3e89('0x37')];if(_0x332752[_0x3e89('0x39')][_0x3e89('0x4b')]){_0x59e04a[_0x3e89('0x4c')]=[{'all':!![]}];}_0x59e04a=_[_0x3e89('0x47')]({},_0x59e04a,_0x332752['options']);return db[_0x3e89('0x33')][_0x3e89('0x51')](_0x59e04a)[_0x3e89('0x2d')](handleEntityNotFound(_0x121753,null))[_0x3e89('0x2d')](respondWithResult(_0x121753,null))[_0x3e89('0x52')](handleError(_0x121753,null));};exports[_0x3e89('0x53')]=function(_0x524043,_0xf0118){return db['UserProfile'][_0x3e89('0x53')](_0x524043['body'],{})[_0x3e89('0x2d')](respondWithResult(_0xf0118,0xc9))[_0x3e89('0x52')](handleError(_0xf0118,null));};exports[_0x3e89('0x54')]=function(_0x3f7326,_0x454607){var _0x38fac7={'where':{'id':_0x3f7326[_0x3e89('0x50')]['id']}},_0x40316f={};_0x40316f[_0x3e89('0x37')]=_[_0x3e89('0x3a')](db[_0x3e89('0x33')][_0x3e89('0x55')]);_0x38fac7['attributes']=_['intersection'](_0x40316f[_0x3e89('0x37')],qs[_0x3e89('0x3e')](_0x3f7326[_0x3e89('0x39')][_0x3e89('0x3e')]));_0x38fac7['attributes']=_0x38fac7[_0x3e89('0x3d')][_0x3e89('0x3f')]?_0x38fac7[_0x3e89('0x3d')]:_0x40316f[_0x3e89('0x37')];if(_0x3f7326[_0x3e89('0x39')][_0x3e89('0x4b')]){_0x38fac7[_0x3e89('0x4c')]=[{'all':!![]}];}_0x38fac7=_[_0x3e89('0x47')]({},_0x38fac7,_0x3f7326[_0x3e89('0x49')]);return db[_0x3e89('0x33')][_0x3e89('0x51')](_0x38fac7)[_0x3e89('0x2d')](handleEntityNotFound(_0x454607,null))[_0x3e89('0x2d')](function(_0x29cb27){if(_0x29cb27){var _0x193013=_0x29cb27[_0x3e89('0x56')]({'plain':!![]});_0x193013=qs[_0x3e89('0x57')](_0x193013,['id',_0x3e89('0x58'),_0x3e89('0x59'),_0x3e89('0x5a')]);_0x3f7326['body']=_[_0x3e89('0x57')](_0x3f7326['body'],['id',_0x3e89('0x58'),_0x3e89('0x59')]);return db['sequelize'][_0x3e89('0x5b')](function(_0x7bb0a){return db[_0x3e89('0x33')][_0x3e89('0x53')](_[_0x3e89('0x47')](_0x193013,_0x3f7326[_0x3e89('0x5c')]),{'include':_0x3f7326['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x7bb0a})[_0x3e89('0x2d')](function(_0x3ee0c2){var _0x35f1d2=_0x3ee0c2[_0x3e89('0x56')]({'plain':!![]});return db[_0x3e89('0x5d')][_0x3e89('0x4d')]({'where':{'userProfileId':_0x3f7326[_0x3e89('0x50')]['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x11407f){if(_0x11407f){return BPromise[_0x3e89('0x5e')](_0x11407f,function(_0x447482){return new BPromise(function(_0x329b45,_0x50b4d6){if(_0x447482[_0x3e89('0x5f')]===null||_0x447482[_0x3e89('0x5f')]===0x1)_0x329b45(null);return db[_0x3e89('0x60')][_0x3e89('0x4d')]({'where':{'sectionId':_0x447482['id']},'raw':!![]})['then'](function(_0xa8b420){var _0x1ada7c=_[_0x3e89('0x38')](_0xa8b420,function(_0x16d072){return qs[_0x3e89('0x57')](_0x16d072,['id','createdAt',_0x3e89('0x59'),_0x3e89('0x61')]);});_0x329b45(_0x1ada7c);})[_0x3e89('0x52')](function(_0x3fc67e){_0x50b4d6(_0x3fc67e);});})['then'](function(_0x10572e){var _0xb6381=qs[_0x3e89('0x57')](_0x447482,['id',_0x3e89('0x58'),'updatedAt']);_0xb6381[_0x3e89('0x62')]=_0x35f1d2['id'];if(_0x10572e)_0xb6381[_0x3e89('0x63')]=_0x10572e;return _0xb6381;})[_0x3e89('0x2d')](function(_0x47c476){return db['UserProfileSection'][_0x3e89('0x53')](_0x47c476,{'include':[{'model':db[_0x3e89('0x60')],'as':_0x3e89('0x63')}],'raw':!![],'transaction':_0x7bb0a});});})[_0x3e89('0x2d')](function(){return _0x35f1d2;});}});});});}})[_0x3e89('0x2d')](respondWithResult(_0x454607,0xc9))[_0x3e89('0x52')](handleError(_0x454607,null));};exports[_0x3e89('0x2b')]=function(_0x27d2b1,_0x219790){if(_0x27d2b1[_0x3e89('0x5c')]['id']){delete _0x27d2b1[_0x3e89('0x5c')]['id'];}return db[_0x3e89('0x33')][_0x3e89('0x51')]({'where':{'id':_0x27d2b1[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0x219790,null))[_0x3e89('0x2d')](saveUpdates(_0x27d2b1[_0x3e89('0x5c')],null))[_0x3e89('0x2d')](respondWithResult(_0x219790,null))[_0x3e89('0x52')](handleError(_0x219790,null));};exports['destroy']=function(_0xf771ac,_0x418a47){return db[_0x3e89('0x33')][_0x3e89('0x51')]({'where':{'id':_0xf771ac[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0x418a47,null))[_0x3e89('0x2d')](removeEntity(_0x418a47,null))[_0x3e89('0x52')](handleError(_0x418a47,null));};exports[_0x3e89('0x64')]=function(_0x394d76,_0x4afe69){return db['UserProfile'][_0x3e89('0x64')]()[_0x3e89('0x2d')](respondWithResult(_0x4afe69,null))[_0x3e89('0x52')](handleError(_0x4afe69,null));};exports['addSections']=function(_0xa61ac8,_0x5b76de){var _0x41d747=_0xa61ac8[_0x3e89('0x5c')];return db[_0x3e89('0x33')]['find']({'where':{'id':_0xa61ac8['params']['id']}})['then'](handleEntityNotFound(_0x5b76de,null))[_0x3e89('0x2d')](function(_0x59ff36){if(_0x59ff36){return db[_0x3e89('0x65')]['transaction'](function(_0x53f0a3){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0xa61ac8[_0x3e89('0x50')]['id'],'sectionId':_[_0x3e89('0x38')](_0x41d747,function(_0x480c1f){return _0x480c1f[_0x3e89('0x61')];})},'transaction':_0x53f0a3})[_0x3e89('0x2d')](function(){var _0x455b87=_[_0x3e89('0x38')](_0x41d747,function(_0x1222e0){_0x1222e0[_0x3e89('0x62')]=_0xa61ac8['params']['id'];return _0x1222e0;});var _0x5c29cc=[];return BPromise[_0x3e89('0x5e')](_0x455b87,function(_0x5b9dac){return db[_0x3e89('0x5d')]['create'](_0x5b9dac,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x53f0a3})['then'](function(_0x398792){_0x5c29cc[_0x3e89('0x66')](_0x398792['get']({'plain':!![]}));});})['then'](function(){return _0x5c29cc;});});});}})[_0x3e89('0x2d')](function(_0x44d0da){return _0x44d0da;})[_0x3e89('0x2d')](respondWithResult(_0x5b76de,null))['catch'](handleError(_0x5b76de,null));};exports[_0x3e89('0x67')]=function(_0x28b2bf,_0x1b7f49){var _0x9fc489;return db[_0x3e89('0x33')]['find']({'where':{'id':_0x28b2bf[_0x3e89('0x50')]['id']},'attributes':['id',_0x3e89('0x31')]})[_0x3e89('0x2d')](handleEntityNotFound(_0x1b7f49,null))[_0x3e89('0x2d')](function(_0x44b113){if(_0x44b113){_0x9fc489=_0x44b113;return db['UserProfileSection'][_0x3e89('0x2c')]({'where':{'userProfileId':_0x28b2bf[_0x3e89('0x50')]['id'],'sectionId':_0x28b2bf[_0x3e89('0x39')]['ids']}});}})[_0x3e89('0x2d')](function(){return _0x9fc489;})[_0x3e89('0x2d')](respondWithStatusCode(_0x1b7f49,null))[_0x3e89('0x52')](handleError(_0x1b7f49,null));};exports['getSections']=function(_0x2b49d3,_0xdbabcb){var _0x32bc02=[];var _0x33f54a=[];return db[_0x3e89('0x5d')][_0x3e89('0x4d')]({'where':{'userProfileId':_0x2b49d3[_0x3e89('0x50')]['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x1f9974){_0x32bc02=_[_0x3e89('0x45')](_0x1f9974,function(_0x54384c){return _0x54384c[_0x3e89('0x68')]===0x1||_[_0x3e89('0x69')]([0x3eb,0x709],_0x54384c[_0x3e89('0x61')]);});if(!_['isEmpty'](_0x32bc02)){return _['map'](_0x32bc02,function(_0x2f5247){return _0x2f5247['sectionId'];});}else{return;}})[_0x3e89('0x2d')](function(_0xcbe9d6){if(_0xcbe9d6)_0x33f54a=_0xcbe9d6;if(_['includes'](_0x33f54a,0x64)){var _0x399626=_[_0x3e89('0x51')](_0x32bc02,{'sectionId':0x64});return hasDefaultDashboard(_0x399626)[_0x3e89('0x2d')](function(_0x2a6c4a){return _[_0x3e89('0x38')](_0x32bc02,function(_0x436c34){if(_0x436c34[_0x3e89('0x61')]===0x64){_0x436c34[_0x3e89('0x6a')]=_0x2a6c4a;}return _0x436c34;});});}else{return;}})[_0x3e89('0x2d')](function(_0x4b8f39){if(_0x4b8f39)_0x32bc02=_0x4b8f39;if(_[_0x3e89('0x69')](_0x33f54a,0x3eb)){var _0x103e6e=_['find'](_0x32bc02,{'sectionId':0x3eb});return getCustomDashboards(_0x103e6e)[_0x3e89('0x2d')](function(_0x1022ec){return _[_0x3e89('0x38')](_0x32bc02,function(_0x462cf3){if(_0x103e6e[_0x3e89('0x68')]){if(_0x462cf3[_0x3e89('0x61')]===0x3eb){_0x462cf3['subsections']=_0x1022ec;}}else{if(_0x462cf3[_0x3e89('0x61')]===0x64){if(!_0x462cf3[_0x3e89('0x6a')]){_0x462cf3['subsections']=[];}_0x462cf3['subsections']=_0x462cf3[_0x3e89('0x6a')][_0x3e89('0x6b')](_0x1022ec);}}return _0x462cf3;});});}else{return;}})[_0x3e89('0x2d')](function(_0x527232){if(_0x527232)_0x32bc02=_0x527232;if(_[_0x3e89('0x69')](_0x33f54a,0x709)){var _0x597e30=_['find'](_0x32bc02,{'sectionId':0x709});return getPlugins(_0x597e30)[_0x3e89('0x2d')](function(_0x150994){if(_0x597e30[_0x3e89('0x68')]){return _['map'](_0x32bc02,function(_0x2d65a3){if(_0x2d65a3['sectionId']===0x709){_0x2d65a3[_0x3e89('0x6a')]=_0x150994;}return _0x2d65a3;});}else{var _0x4968ee={'sectionId':0x76c,'enabled':0x1,'subsections':_0x150994};var _0x2ccd28=_[_0x3e89('0x38')](_0x32bc02);_0x2ccd28['push'](_0x4968ee);return _0x2ccd28;}});}else{return;}})[_0x3e89('0x2d')](function(_0x4f33d1){if(_0x4f33d1)_0x32bc02=_0x4f33d1;return _['filter'](_0x32bc02,[_0x3e89('0x68'),0x1]);})[_0x3e89('0x2d')](respondWithResult(_0xdbabcb,null))[_0x3e89('0x52')](handleError(_0xdbabcb,null));};function hasDefaultDashboard(_0x658f9f){var _0x1416f8=[0x65];return new BPromise(function(_0x3c29c4,_0xe6c58d){try{if(_0x658f9f['autoAssociation']){_0x3c29c4(_0x1416f8);}else{return db[_0x3e89('0x60')][_0x3e89('0x6c')]({'where':{'sectionId':_0x658f9f['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x299827){_0x299827?_0x3c29c4(_0x1416f8):_0x3c29c4();});}}catch(_0x373fac){_0xe6c58d(_0x373fac);}});}function getCustomDashboards(_0x2dc496){var _0x1ddcd8=[];return new BPromise(function(_0x2cc7ed,_0x49eae1){try{if(_0x2dc496[_0x3e89('0x5f')]){return db['Dashboard']['findAll']({'raw':!![]})['then'](function(_0x2258a8){_0x2258a8[_0x3e89('0x6d')](function(_0x1d4f51){_0x1ddcd8[_0x3e89('0x66')](_0x1d4f51['id']+0x1869f);});_0x2cc7ed(_0x1ddcd8);});}else{return db[_0x3e89('0x60')][_0x3e89('0x4d')]({'where':{'sectionId':_0x2dc496['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x2b3118){_0x2b3118[_0x3e89('0x6d')](function(_0x381aab){_0x1ddcd8['push'](_0x381aab[_0x3e89('0x6e')]+0x1869f);});_0x2cc7ed(_0x1ddcd8);});}}catch(_0x11a2a7){_0x49eae1(_0x11a2a7);}});}function getPlugins(_0x5076dc){var _0x199456=[];return new BPromise(function(_0x5def74,_0x3e5056){try{if(_0x5076dc[_0x3e89('0x5f')]){return db[_0x3e89('0x6f')][_0x3e89('0x4d')]({'raw':!![]})[_0x3e89('0x2d')](function(_0x2a7318){_0x2a7318[_0x3e89('0x6d')](function(_0x145e0f){_0x199456[_0x3e89('0x66')](_0x145e0f['id']+0x15b38);});_0x5def74(_0x199456);});}else{return db[_0x3e89('0x60')]['findAll']({'where':{'sectionId':_0x5076dc['id']},'raw':!![]})[_0x3e89('0x2d')](function(_0x4920de){_0x4920de[_0x3e89('0x6d')](function(_0x67743e){_0x199456[_0x3e89('0x66')](_0x67743e[_0x3e89('0x6e')]+0x15b38);});_0x5def74(_0x199456);});}}catch(_0xd0a65f){_0x3e5056(_0xd0a65f);}});}exports[_0x3e89('0x70')]=function(_0xd91e33,_0x2dbe02){return db[_0x3e89('0x33')][_0x3e89('0x51')]({'where':{'id':_0xd91e33[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0x2dbe02,null))[_0x3e89('0x2d')](function(_0x1961e2){if(_0x1961e2){return db[_0x3e89('0x65')][_0x3e89('0x5b')](function(_0x251660){return db[_0x3e89('0x5d')][_0x3e89('0x4d')]({'where':{'userProfileId':_0xd91e33[_0x3e89('0x50')]['id']},'attributes':['id'],'raw':!![]})[_0x3e89('0x2d')](function(_0x1b4c56){if(_0x1b4c56){return db[_0x3e89('0x5d')][_0x3e89('0x2c')]({'where':{'userProfileId':_0xd91e33[_0x3e89('0x50')]['id'],'id':_[_0x3e89('0x38')](_0x1b4c56,function(_0x14cf91){return _0x14cf91['id'];})},'transaction':_0x251660});}})[_0x3e89('0x2d')](function(_0x4558b6){var _0x49f41d=_['map'](_0xd91e33[_0x3e89('0x5c')],function(_0x4558c7){_0x4558c7[_0x3e89('0x62')]=_0xd91e33[_0x3e89('0x50')]['id'];return _0x4558c7;});return db['UserProfileSection'][_0x3e89('0x71')](_0x49f41d,{'raw':!![],'transaction':_0x251660});})[_0x3e89('0x2d')](function(_0x52189a){var _0x532ebb=_[_0x3e89('0x45')](_[_0x3e89('0x38')](_0x52189a,function(_0x486f58){return _0x486f58[_0x3e89('0x56')]({'plain':!![]});}),{'includeAll':![]});if(_0x532ebb){return db[_0x3e89('0x5d')]['findAll']({'where':{'userProfileId':_0xd91e33[_0x3e89('0x50')]['id'],'sectionId':_[_0x3e89('0x38')](_0x532ebb,function(_0x38570b){return _0x38570b[_0x3e89('0x61')];})},'attributes':['id',_0x3e89('0x61')],'raw':!![]})[_0x3e89('0x2d')](function(_0x54d61c){var _0x57d9e0=_[_0x3e89('0x38')](_0xd91e33['body'],function(_0x3fb475){_0x3fb475['userProfileId']=_0xd91e33['params']['id'];return _0x3fb475;});return db[_0x3e89('0x60')][_0x3e89('0x71')](_0x57d9e0,{'raw':!![],'transaction':_0x251660});});}})[_0x3e89('0x52')](handleError(_0x2dbe02,null));});}})[_0x3e89('0x2d')](function(_0x5b307b){var _0x3737e6=_[_0x3e89('0x38')](_0x5b307b,function(_0x310d14){return _0x310d14[_0x3e89('0x56')]({'plain':!![]});});})['then'](respondWithResult(_0x2dbe02,null))['catch'](handleError(_0x2dbe02,null));};exports['removeResources']=function(_0x3e00ff,_0xc73613,_0x4063b5){return db[_0x3e89('0x33')]['find']({'where':{'id':_0x3e00ff['params']['id']}})[_0x3e89('0x2d')](handleEntityNotFound(_0xc73613,null))[_0x3e89('0x2d')](function(_0x3032e8){if(_0x3032e8){return _0x3032e8['removeResources'](_0x3e00ff[_0x3e89('0x39')]['ids']);}})[_0x3e89('0x2d')](respondWithStatusCode(_0xc73613,null))[_0x3e89('0x52')](handleError(_0xc73613,null));};exports[_0x3e89('0x72')]=function(_0x36780b,_0xaf59af){var _0x15cd3e={};if(!_0x36780b[_0x3e89('0x39')][_0x3e89('0x73')])throw new Error(_0x3e89('0x74'));if(!_0x36780b[_0x3e89('0x39')]['hasOwnProperty'](_0x3e89('0x41'))){_0x15cd3e[_0x3e89('0x26')]=qs[_0x3e89('0x26')](_0x36780b[_0x3e89('0x39')]['limit']);_0x15cd3e[_0x3e89('0x24')]=qs['offset'](_0x36780b[_0x3e89('0x39')][_0x3e89('0x24')]);}return db['UserProfile'][_0x3e89('0x51')]({'where':{'id':_0x36780b[_0x3e89('0x50')]['id']}})[_0x3e89('0x2d')](function(_0x5b56b8){if(!_0x5b56b8)throw new Error(_0x3e89('0x75')+_0x36780b[_0x3e89('0x50')]['id']);return db[_0x3e89('0x33')]['getResources'](_0x36780b);})[_0x3e89('0x2d')](respondWithFilteredResult(_0xaf59af,_0x15cd3e))[_0x3e89('0x52')](handleError(_0xaf59af,null));}; \ No newline at end of file +var _0xed38=['sectionId','Resources','describe','addSections','userProfileId','push','ids','getSections','includes','isEmpty','subsections','concat','enabled','findOne','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','error','name','send','index','map','UserProfile','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','params','find','catch','create','body','clone','rawAttributes','omit','createdAt','updatedAt','crudPermissions','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource'];(function(_0x3f3a12,_0x5dcc45){var _0xdf4127=function(_0x550455){while(--_0x550455){_0x3f3a12['push'](_0x3f3a12['shift']());}};_0xdf4127(++_0x5dcc45);}(_0xed38,0x89));var _0x8ed3=function(_0x3151dc,_0x28100c){_0x3151dc=_0x3151dc-0x0;var _0xeb7595=_0xed38[_0x3151dc];return _0xeb7595;};'use strict';var emlformat=require(_0x8ed3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ed3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8ed3('0x2'));var moment=require('moment');var BPromise=require(_0x8ed3('0x3'));var Mustache=require('mustache');var util=require(_0x8ed3('0x4'));var path=require('path');var sox=require(_0x8ed3('0x5'));var csv=require(_0x8ed3('0x6'));var ejs=require(_0x8ed3('0x7'));var fs=require('fs');var fs_extra=require(_0x8ed3('0x8'));var _=require(_0x8ed3('0x9'));var squel=require(_0x8ed3('0xa'));var crypto=require(_0x8ed3('0xb'));var jsforce=require(_0x8ed3('0xc'));var deskjs=require(_0x8ed3('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8ed3('0xe'));var Papa=require('papaparse');var Redis=require(_0x8ed3('0xf'));var authService=require(_0x8ed3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ed3('0x11'));var hardwareService=require(_0x8ed3('0x12'));var logger=require(_0x8ed3('0x13'))(_0x8ed3('0x14'));var utils=require(_0x8ed3('0x15'));var config=require(_0x8ed3('0x16'));var licenseUtil=require(_0x8ed3('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8ed3('0x18')](config[_0x8ed3('0x19')],{'host':_0x8ed3('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ed3('0x19')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x517b89,_0x1bd907){_0x1bd907=_0x1bd907||0xcc;return function(_0x3f64fe){if(_0x3f64fe){return _0x517b89[_0x8ed3('0x1b')](_0x1bd907);}return _0x517b89[_0x8ed3('0x1c')](_0x1bd907)[_0x8ed3('0x1d')]();};}function respondWithResult(_0x3d4328,_0x3ec992){_0x3ec992=_0x3ec992||0xc8;return function(_0x325bda){if(_0x325bda){return _0x3d4328['status'](_0x3ec992)[_0x8ed3('0x1e')](_0x325bda);}};}function respondWithFilteredResult(_0x35b07,_0x301269){return function(_0x46ef8e){if(_0x46ef8e){var _0x16f2f4=typeof _0x301269[_0x8ed3('0x1f')]===_0x8ed3('0x20')&&typeof _0x301269[_0x8ed3('0x21')]===_0x8ed3('0x20');var _0x364275=_0x46ef8e['count'];var _0x261631=_0x16f2f4?0x0:_0x301269[_0x8ed3('0x1f')];var _0x33aeb3=_0x16f2f4?_0x46ef8e[_0x8ed3('0x22')]:_0x301269[_0x8ed3('0x1f')]+_0x301269[_0x8ed3('0x21')];var _0x32d63b;if(_0x33aeb3>=_0x364275){_0x33aeb3=_0x364275;_0x32d63b=0xc8;}else{_0x32d63b=0xce;}_0x35b07[_0x8ed3('0x1c')](_0x32d63b);return _0x35b07[_0x8ed3('0x23')]('Content-Range',_0x261631+'-'+_0x33aeb3+'/'+_0x364275)[_0x8ed3('0x1e')](_0x46ef8e);}return null;};}function patchUpdates(_0x4bb6e5){return function(_0x6322c9){try{jsonpatch['apply'](_0x6322c9,_0x4bb6e5,!![]);}catch(_0x324828){return BPromise[_0x8ed3('0x24')](_0x324828);}return _0x6322c9[_0x8ed3('0x25')]();};}function saveUpdates(_0x50c4d2,_0x3d6f5d){return function(_0x32593f){if(_0x32593f){return _0x32593f[_0x8ed3('0x26')](_0x50c4d2)['then'](function(_0x263faa){return _0x263faa;});}return null;};}function removeEntity(_0x18c79e,_0x51a4d3){return function(_0x2c38cb){if(_0x2c38cb){return _0x2c38cb[_0x8ed3('0x27')]()['then'](function(){_0x18c79e[_0x8ed3('0x1c')](0xcc)[_0x8ed3('0x1d')]();});}};}function handleEntityNotFound(_0x196757,_0x4d3eea){return function(_0x1bf251){if(!_0x1bf251){_0x196757['sendStatus'](0x194);}return _0x1bf251;};}function handleError(_0x4b3a03,_0x3a93fe){_0x3a93fe=_0x3a93fe||0x1f4;return function(_0x5e146e){logger[_0x8ed3('0x28')](_0x5e146e['stack']);if(_0x5e146e[_0x8ed3('0x29')]){delete _0x5e146e[_0x8ed3('0x29')];}_0x4b3a03[_0x8ed3('0x1c')](_0x3a93fe)[_0x8ed3('0x2a')](_0x5e146e);};}exports[_0x8ed3('0x2b')]=function(_0x4eee14,_0x28c2){var _0x56f6cd={},_0x25c91b={},_0xcf50c2={'count':0x0,'rows':[]};var _0x1eb092=_[_0x8ed3('0x2c')](db[_0x8ed3('0x2d')]['rawAttributes'],function(_0x46b85f){return{'name':_0x46b85f[_0x8ed3('0x2e')],'type':_0x46b85f[_0x8ed3('0x2f')]['key']};});_0x25c91b[_0x8ed3('0x30')]=_[_0x8ed3('0x2c')](_0x1eb092,'name');_0x25c91b['query']=_[_0x8ed3('0x31')](_0x4eee14[_0x8ed3('0x32')]);_0x25c91b['filters']=_[_0x8ed3('0x33')](_0x25c91b[_0x8ed3('0x30')],_0x25c91b[_0x8ed3('0x32')]);_0x56f6cd[_0x8ed3('0x34')]=_[_0x8ed3('0x33')](_0x25c91b[_0x8ed3('0x30')],qs[_0x8ed3('0x35')](_0x4eee14['query'][_0x8ed3('0x35')]));_0x56f6cd[_0x8ed3('0x34')]=_0x56f6cd['attributes'][_0x8ed3('0x36')]?_0x56f6cd['attributes']:_0x25c91b[_0x8ed3('0x30')];if(!_0x4eee14[_0x8ed3('0x32')][_0x8ed3('0x37')](_0x8ed3('0x38'))){_0x56f6cd[_0x8ed3('0x21')]=qs[_0x8ed3('0x21')](_0x4eee14[_0x8ed3('0x32')]['limit']);_0x56f6cd[_0x8ed3('0x1f')]=qs[_0x8ed3('0x1f')](_0x4eee14[_0x8ed3('0x32')]['offset']);}_0x56f6cd['order']=qs['sort'](_0x4eee14[_0x8ed3('0x32')][_0x8ed3('0x39')]);_0x56f6cd[_0x8ed3('0x3a')]=qs[_0x8ed3('0x3b')](_[_0x8ed3('0x3c')](_0x4eee14[_0x8ed3('0x32')],_0x25c91b[_0x8ed3('0x3b')]),_0x1eb092);if(_0x4eee14['query'][_0x8ed3('0x3d')]){_0x56f6cd[_0x8ed3('0x3a')]=_[_0x8ed3('0x3e')](_0x56f6cd[_0x8ed3('0x3a')],{'$or':_[_0x8ed3('0x2c')](_0x1eb092,function(_0x349843){if(_0x349843[_0x8ed3('0x2f')]!==_0x8ed3('0x3f')){var _0x287a89={};_0x287a89[_0x349843['name']]={'$like':'%'+_0x4eee14[_0x8ed3('0x32')][_0x8ed3('0x3d')]+'%'};return _0x287a89;}})});}_0x56f6cd=_[_0x8ed3('0x3e')]({},_0x56f6cd,_0x4eee14[_0x8ed3('0x40')]);var _0x42cdd0={'where':_0x56f6cd[_0x8ed3('0x3a')]};return db[_0x8ed3('0x2d')][_0x8ed3('0x22')](_0x42cdd0)[_0x8ed3('0x41')](function(_0x415302){_0xcf50c2['count']=_0x415302;if(_0x4eee14[_0x8ed3('0x32')][_0x8ed3('0x42')]){_0x56f6cd[_0x8ed3('0x43')]=[{'all':!![]}];}return db[_0x8ed3('0x2d')][_0x8ed3('0x44')](_0x56f6cd);})[_0x8ed3('0x41')](function(_0x29aebc){_0xcf50c2[_0x8ed3('0x45')]=_0x29aebc;return _0xcf50c2;})[_0x8ed3('0x41')](respondWithFilteredResult(_0x28c2,_0x56f6cd))['catch'](handleError(_0x28c2,null));};exports['show']=function(_0x37c96f,_0x3f9d91){var _0x4958ed={'raw':![],'where':{'id':_0x37c96f[_0x8ed3('0x46')]['id']}},_0x21ea57={};_0x21ea57['model']=_[_0x8ed3('0x31')](db['UserProfile']['rawAttributes']);_0x21ea57[_0x8ed3('0x32')]=_[_0x8ed3('0x31')](_0x37c96f[_0x8ed3('0x32')]);_0x21ea57[_0x8ed3('0x3b')]=_['intersection'](_0x21ea57[_0x8ed3('0x30')],_0x21ea57['query']);_0x4958ed[_0x8ed3('0x34')]=_[_0x8ed3('0x33')](_0x21ea57[_0x8ed3('0x30')],qs[_0x8ed3('0x35')](_0x37c96f[_0x8ed3('0x32')][_0x8ed3('0x35')]));_0x4958ed[_0x8ed3('0x34')]=_0x4958ed[_0x8ed3('0x34')][_0x8ed3('0x36')]?_0x4958ed[_0x8ed3('0x34')]:_0x21ea57[_0x8ed3('0x30')];if(_0x37c96f[_0x8ed3('0x32')]['includeAll']){_0x4958ed[_0x8ed3('0x43')]=[{'all':!![]}];}_0x4958ed=_[_0x8ed3('0x3e')]({},_0x4958ed,_0x37c96f[_0x8ed3('0x40')]);return db['UserProfile'][_0x8ed3('0x47')](_0x4958ed)[_0x8ed3('0x41')](handleEntityNotFound(_0x3f9d91,null))['then'](respondWithResult(_0x3f9d91,null))[_0x8ed3('0x48')](handleError(_0x3f9d91,null));};exports[_0x8ed3('0x49')]=function(_0x32d571,_0x5554cc){return db[_0x8ed3('0x2d')]['create'](_0x32d571[_0x8ed3('0x4a')],{})[_0x8ed3('0x41')](respondWithResult(_0x5554cc,0xc9))[_0x8ed3('0x48')](handleError(_0x5554cc,null));};exports[_0x8ed3('0x4b')]=function(_0x1b154a,_0x240d41){var _0x465640={'where':{'id':_0x1b154a[_0x8ed3('0x46')]['id']}},_0x440102={};_0x440102[_0x8ed3('0x30')]=_[_0x8ed3('0x31')](db[_0x8ed3('0x2d')][_0x8ed3('0x4c')]);_0x465640[_0x8ed3('0x34')]=_[_0x8ed3('0x33')](_0x440102[_0x8ed3('0x30')],qs[_0x8ed3('0x35')](_0x1b154a[_0x8ed3('0x32')][_0x8ed3('0x35')]));_0x465640[_0x8ed3('0x34')]=_0x465640[_0x8ed3('0x34')][_0x8ed3('0x36')]?_0x465640[_0x8ed3('0x34')]:_0x440102[_0x8ed3('0x30')];if(_0x1b154a['query'][_0x8ed3('0x42')]){_0x465640[_0x8ed3('0x43')]=[{'all':!![]}];}_0x465640=_[_0x8ed3('0x3e')]({},_0x465640,_0x1b154a['options']);return db[_0x8ed3('0x2d')]['find'](_0x465640)[_0x8ed3('0x41')](handleEntityNotFound(_0x240d41,null))[_0x8ed3('0x41')](function(_0x3a89b4){if(_0x3a89b4){var _0x3d15a2=_0x3a89b4['get']({'plain':!![]});_0x3d15a2=qs[_0x8ed3('0x4d')](_0x3d15a2,['id',_0x8ed3('0x4e'),_0x8ed3('0x4f'),_0x8ed3('0x50')]);_0x1b154a['body']=_['omit'](_0x1b154a[_0x8ed3('0x4a')],['id',_0x8ed3('0x4e'),_0x8ed3('0x4f')]);return db['sequelize'][_0x8ed3('0x51')](function(_0x3d1aaf){return db[_0x8ed3('0x2d')][_0x8ed3('0x49')](_[_0x8ed3('0x3e')](_0x3d15a2,_0x1b154a['body']),{'include':_0x1b154a['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x3d1aaf})[_0x8ed3('0x41')](function(_0x89330f){var _0x57d6b4=_0x89330f[_0x8ed3('0x52')]({'plain':!![]});return db[_0x8ed3('0x53')][_0x8ed3('0x44')]({'where':{'userProfileId':_0x1b154a['params']['id']},'raw':!![]})['then'](function(_0x3c121a){if(_0x3c121a){return BPromise[_0x8ed3('0x54')](_0x3c121a,function(_0x410ca6){return new BPromise(function(_0x474b0b,_0x2f39bb){if(_0x410ca6[_0x8ed3('0x55')]===null||_0x410ca6[_0x8ed3('0x55')]===0x1)_0x474b0b(null);return db[_0x8ed3('0x56')][_0x8ed3('0x44')]({'where':{'sectionId':_0x410ca6['id']},'raw':!![]})[_0x8ed3('0x41')](function(_0x4524b1){var _0x40dedb=_[_0x8ed3('0x2c')](_0x4524b1,function(_0x3ddb1e){return qs['omit'](_0x3ddb1e,['id',_0x8ed3('0x4e'),_0x8ed3('0x4f'),_0x8ed3('0x57')]);});_0x474b0b(_0x40dedb);})[_0x8ed3('0x48')](function(_0x5f455a){_0x2f39bb(_0x5f455a);});})[_0x8ed3('0x41')](function(_0x288a08){var _0x5496a7=qs['omit'](_0x410ca6,['id',_0x8ed3('0x4e'),_0x8ed3('0x4f')]);_0x5496a7['userProfileId']=_0x57d6b4['id'];if(_0x288a08)_0x5496a7[_0x8ed3('0x58')]=_0x288a08;return _0x5496a7;})['then'](function(_0x60bdeb){return db['UserProfileSection'][_0x8ed3('0x49')](_0x60bdeb,{'include':[{'model':db[_0x8ed3('0x56')],'as':_0x8ed3('0x58')}],'raw':!![],'transaction':_0x3d1aaf});});})['then'](function(){return _0x57d6b4;});}});});});}})['then'](respondWithResult(_0x240d41,0xc9))[_0x8ed3('0x48')](handleError(_0x240d41,null));};exports[_0x8ed3('0x26')]=function(_0x33dbe7,_0x4bdf5b){if(_0x33dbe7['body']['id']){delete _0x33dbe7[_0x8ed3('0x4a')]['id'];}return db['UserProfile'][_0x8ed3('0x47')]({'where':{'id':_0x33dbe7[_0x8ed3('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bdf5b,null))[_0x8ed3('0x41')](saveUpdates(_0x33dbe7['body'],null))['then'](respondWithResult(_0x4bdf5b,null))[_0x8ed3('0x48')](handleError(_0x4bdf5b,null));};exports['destroy']=function(_0x46c020,_0x14cb0f){return db[_0x8ed3('0x2d')][_0x8ed3('0x47')]({'where':{'id':_0x46c020[_0x8ed3('0x46')]['id']}})[_0x8ed3('0x41')](handleEntityNotFound(_0x14cb0f,null))[_0x8ed3('0x41')](removeEntity(_0x14cb0f,null))['catch'](handleError(_0x14cb0f,null));};exports[_0x8ed3('0x59')]=function(_0x222f22,_0x5cc50d){return db[_0x8ed3('0x2d')][_0x8ed3('0x59')]()[_0x8ed3('0x41')](respondWithResult(_0x5cc50d,null))[_0x8ed3('0x48')](handleError(_0x5cc50d,null));};exports[_0x8ed3('0x5a')]=function(_0x3c976e,_0x59453b){var _0x103251=_0x3c976e[_0x8ed3('0x4a')];return db['UserProfile']['find']({'where':{'id':_0x3c976e[_0x8ed3('0x46')]['id']}})['then'](handleEntityNotFound(_0x59453b,null))[_0x8ed3('0x41')](function(_0x104586){if(_0x104586){return db['sequelize'][_0x8ed3('0x51')](function(_0x36fc0a){return db[_0x8ed3('0x53')][_0x8ed3('0x27')]({'where':{'userProfileId':_0x3c976e['params']['id'],'sectionId':_[_0x8ed3('0x2c')](_0x103251,function(_0xc78edc){return _0xc78edc['sectionId'];})},'transaction':_0x36fc0a})[_0x8ed3('0x41')](function(){var _0x1d15a4=_['map'](_0x103251,function(_0x2460d7){_0x2460d7[_0x8ed3('0x5b')]=_0x3c976e['params']['id'];return _0x2460d7;});var _0x412b75=[];return BPromise[_0x8ed3('0x54')](_0x1d15a4,function(_0x4ce79d){return db['UserProfileSection'][_0x8ed3('0x49')](_0x4ce79d,{'include':[{'model':db['UserProfileResource'],'as':_0x8ed3('0x58')}],'raw':!![],'transaction':_0x36fc0a})['then'](function(_0x2dcb4e){_0x412b75[_0x8ed3('0x5c')](_0x2dcb4e['get']({'plain':!![]}));});})[_0x8ed3('0x41')](function(){return _0x412b75;});});});}})[_0x8ed3('0x41')](function(_0x5513fc){return _0x5513fc;})[_0x8ed3('0x41')](respondWithResult(_0x59453b,null))[_0x8ed3('0x48')](handleError(_0x59453b,null));};exports['removeSections']=function(_0x529382,_0x2e3448){var _0x1e0d41;return db[_0x8ed3('0x2d')]['find']({'where':{'id':_0x529382[_0x8ed3('0x46')]['id']},'attributes':['id',_0x8ed3('0x29')]})[_0x8ed3('0x41')](handleEntityNotFound(_0x2e3448,null))['then'](function(_0x2ee91f){if(_0x2ee91f){_0x1e0d41=_0x2ee91f;return db[_0x8ed3('0x53')][_0x8ed3('0x27')]({'where':{'userProfileId':_0x529382[_0x8ed3('0x46')]['id'],'sectionId':_0x529382[_0x8ed3('0x32')][_0x8ed3('0x5d')]}});}})[_0x8ed3('0x41')](function(){return _0x1e0d41;})['then'](respondWithStatusCode(_0x2e3448,null))['catch'](handleError(_0x2e3448,null));};exports[_0x8ed3('0x5e')]=function(_0x1e8f19,_0x4656c0){var _0x4045a3=[];var _0x55164=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1e8f19[_0x8ed3('0x46')]['id']},'raw':!![]})['then'](function(_0x2001d5){_0x4045a3=_[_0x8ed3('0x3d')](_0x2001d5,function(_0x578ce9){return _0x578ce9['enabled']===0x1||_[_0x8ed3('0x5f')]([0x3eb,0x709],_0x578ce9[_0x8ed3('0x57')]);});if(!_[_0x8ed3('0x60')](_0x4045a3)){return _['map'](_0x4045a3,function(_0x805c64){return _0x805c64[_0x8ed3('0x57')];});}else{return;}})[_0x8ed3('0x41')](function(_0x3420bf){if(_0x3420bf)_0x55164=_0x3420bf;if(_[_0x8ed3('0x5f')](_0x55164,0x64)){var _0x15758f=_[_0x8ed3('0x47')](_0x4045a3,{'sectionId':0x64});return hasDefaultDashboard(_0x15758f)['then'](function(_0x4719c1){return _[_0x8ed3('0x2c')](_0x4045a3,function(_0x328e17){if(_0x328e17[_0x8ed3('0x57')]===0x64){_0x328e17[_0x8ed3('0x61')]=_0x4719c1;}return _0x328e17;});});}else{return;}})['then'](function(_0x4c648b){if(_0x4c648b)_0x4045a3=_0x4c648b;if(_['includes'](_0x55164,0x3eb)){var _0x2c3fc0=_['find'](_0x4045a3,{'sectionId':0x3eb});return getCustomDashboards(_0x2c3fc0)[_0x8ed3('0x41')](function(_0x5b341c){return _[_0x8ed3('0x2c')](_0x4045a3,function(_0xd2235){if(_0x2c3fc0['enabled']){if(_0xd2235[_0x8ed3('0x57')]===0x3eb){_0xd2235[_0x8ed3('0x61')]=_0x5b341c;}}else{if(_0xd2235[_0x8ed3('0x57')]===0x64){if(!_0xd2235[_0x8ed3('0x61')]){_0xd2235[_0x8ed3('0x61')]=[];}_0xd2235[_0x8ed3('0x61')]=_0xd2235[_0x8ed3('0x61')][_0x8ed3('0x62')](_0x5b341c);}}return _0xd2235;});});}else{return;}})[_0x8ed3('0x41')](function(_0x4ae843){if(_0x4ae843)_0x4045a3=_0x4ae843;if(_['includes'](_0x55164,0x709)){var _0x27d12a=_[_0x8ed3('0x47')](_0x4045a3,{'sectionId':0x709});return getPlugins(_0x27d12a)[_0x8ed3('0x41')](function(_0x4f237f){if(_0x27d12a[_0x8ed3('0x63')]){return _['map'](_0x4045a3,function(_0x37158e){if(_0x37158e[_0x8ed3('0x57')]===0x709){_0x37158e['subsections']=_0x4f237f;}return _0x37158e;});}else{var _0x1b7de9={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4f237f};var _0x119c4b=_[_0x8ed3('0x2c')](_0x4045a3);_0x119c4b[_0x8ed3('0x5c')](_0x1b7de9);return _0x119c4b;}});}else{return;}})[_0x8ed3('0x41')](function(_0x27f700){if(_0x27f700)_0x4045a3=_0x27f700;return _[_0x8ed3('0x3d')](_0x4045a3,[_0x8ed3('0x63'),0x1]);})[_0x8ed3('0x41')](respondWithResult(_0x4656c0,null))['catch'](handleError(_0x4656c0,null));};function hasDefaultDashboard(_0x41f2e4){var _0x561c90=[0x65];return new BPromise(function(_0x5be71d,_0x2700aa){try{if(_0x41f2e4[_0x8ed3('0x55')]){_0x5be71d(_0x561c90);}else{return db['UserProfileResource'][_0x8ed3('0x64')]({'where':{'sectionId':_0x41f2e4['id']},'raw':!![]})[_0x8ed3('0x41')](function(_0x31b39c){_0x31b39c?_0x5be71d(_0x561c90):_0x5be71d();});}}catch(_0xc23371){_0x2700aa(_0xc23371);}});}function getCustomDashboards(_0x47e5be){var _0x412477=[];return new BPromise(function(_0x6e8427,_0x3c77ff){try{if(_0x47e5be[_0x8ed3('0x55')]){return db[_0x8ed3('0x65')][_0x8ed3('0x44')]({'raw':!![]})['then'](function(_0x306856){_0x306856[_0x8ed3('0x66')](function(_0xcb76df){_0x412477[_0x8ed3('0x5c')](_0xcb76df['id']+0x1869f);});_0x6e8427(_0x412477);});}else{return db[_0x8ed3('0x56')][_0x8ed3('0x44')]({'where':{'sectionId':_0x47e5be['id']},'raw':!![]})[_0x8ed3('0x41')](function(_0x142128){_0x142128[_0x8ed3('0x66')](function(_0x3e3920){_0x412477['push'](_0x3e3920['resourceId']+0x1869f);});_0x6e8427(_0x412477);});}}catch(_0x2f8d6d){_0x3c77ff(_0x2f8d6d);}});}function getPlugins(_0x2d7923){var _0x232654=[];return new BPromise(function(_0x587ec5,_0x3b52a2){try{if(_0x2d7923['autoAssociation']){return db[_0x8ed3('0x67')]['findAll']({'raw':!![]})[_0x8ed3('0x41')](function(_0x569c87){_0x569c87[_0x8ed3('0x66')](function(_0x5ec975){_0x232654['push'](_0x5ec975['id']+0x15b38);});_0x587ec5(_0x232654);});}else{return db['UserProfileResource'][_0x8ed3('0x44')]({'where':{'sectionId':_0x2d7923['id']},'raw':!![]})['then'](function(_0x523b23){_0x523b23[_0x8ed3('0x66')](function(_0xe3c9ee){_0x232654[_0x8ed3('0x5c')](_0xe3c9ee[_0x8ed3('0x68')]+0x15b38);});_0x587ec5(_0x232654);});}}catch(_0x393454){_0x3b52a2(_0x393454);}});}exports[_0x8ed3('0x69')]=function(_0x3b69d0,_0x55867f){return db[_0x8ed3('0x2d')][_0x8ed3('0x47')]({'where':{'id':_0x3b69d0[_0x8ed3('0x46')]['id']}})[_0x8ed3('0x41')](handleEntityNotFound(_0x55867f,null))['then'](function(_0x840446){if(_0x840446){return db['sequelize'][_0x8ed3('0x51')](function(_0x4fced7){return db[_0x8ed3('0x53')][_0x8ed3('0x44')]({'where':{'userProfileId':_0x3b69d0[_0x8ed3('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x8ed3('0x41')](function(_0x4a1260){if(_0x4a1260){return db[_0x8ed3('0x53')]['destroy']({'where':{'userProfileId':_0x3b69d0[_0x8ed3('0x46')]['id'],'id':_['map'](_0x4a1260,function(_0x364d14){return _0x364d14['id'];})},'transaction':_0x4fced7});}})[_0x8ed3('0x41')](function(_0x10c240){var _0x43678b=_[_0x8ed3('0x2c')](_0x3b69d0[_0x8ed3('0x4a')],function(_0x5b702c){_0x5b702c['userProfileId']=_0x3b69d0[_0x8ed3('0x46')]['id'];return _0x5b702c;});return db[_0x8ed3('0x53')]['bulkCreate'](_0x43678b,{'raw':!![],'transaction':_0x4fced7});})[_0x8ed3('0x41')](function(_0x275ec8){var _0x50603e=_['filter'](_[_0x8ed3('0x2c')](_0x275ec8,function(_0x24026f){return _0x24026f[_0x8ed3('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x50603e){return db[_0x8ed3('0x53')][_0x8ed3('0x44')]({'where':{'userProfileId':_0x3b69d0['params']['id'],'sectionId':_[_0x8ed3('0x2c')](_0x50603e,function(_0x5a041f){return _0x5a041f[_0x8ed3('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x8ed3('0x41')](function(_0x16697d){var _0x193c0d=_['map'](_0x3b69d0[_0x8ed3('0x4a')],function(_0x1fa813){_0x1fa813[_0x8ed3('0x5b')]=_0x3b69d0[_0x8ed3('0x46')]['id'];return _0x1fa813;});return db[_0x8ed3('0x56')][_0x8ed3('0x6a')](_0x193c0d,{'raw':!![],'transaction':_0x4fced7});});}})[_0x8ed3('0x48')](handleError(_0x55867f,null));});}})['then'](function(_0x555fe8){var _0x2ea1f2=_[_0x8ed3('0x2c')](_0x555fe8,function(_0xb59bfa){return _0xb59bfa[_0x8ed3('0x52')]({'plain':!![]});});})['then'](respondWithResult(_0x55867f,null))[_0x8ed3('0x48')](handleError(_0x55867f,null));};exports[_0x8ed3('0x6b')]=function(_0x40040b,_0x36f3e5,_0x219078){return db[_0x8ed3('0x2d')][_0x8ed3('0x47')]({'where':{'id':_0x40040b[_0x8ed3('0x46')]['id']}})[_0x8ed3('0x41')](handleEntityNotFound(_0x36f3e5,null))['then'](function(_0x24f538){if(_0x24f538){return _0x24f538[_0x8ed3('0x6b')](_0x40040b[_0x8ed3('0x32')][_0x8ed3('0x5d')]);}})[_0x8ed3('0x41')](respondWithStatusCode(_0x36f3e5,null))[_0x8ed3('0x48')](handleError(_0x36f3e5,null));};exports['getResources']=function(_0xcf028a,_0x834089){var _0x192aea={};if(!_0xcf028a['query'][_0x8ed3('0x6c')])throw new Error(_0x8ed3('0x6d'));if(!_0xcf028a['query'][_0x8ed3('0x37')]('nolimit')){_0x192aea[_0x8ed3('0x21')]=qs[_0x8ed3('0x21')](_0xcf028a[_0x8ed3('0x32')][_0x8ed3('0x21')]);_0x192aea[_0x8ed3('0x1f')]=qs[_0x8ed3('0x1f')](_0xcf028a[_0x8ed3('0x32')][_0x8ed3('0x1f')]);}return db[_0x8ed3('0x2d')][_0x8ed3('0x47')]({'where':{'id':_0xcf028a[_0x8ed3('0x46')]['id']}})[_0x8ed3('0x41')](function(_0x49809f){if(!_0x49809f)throw new Error(_0x8ed3('0x6e')+_0xcf028a[_0x8ed3('0x46')]['id']);return db['UserProfile'][_0x8ed3('0x6f')](_0xcf028a);})[_0x8ed3('0x41')](respondWithFilteredResult(_0x834089,_0x192aea))[_0x8ed3('0x48')](handleError(_0x834089,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index bc81065..715b6d2 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 _0xe785=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe785,0x128));var _0x5e78=function(_0x2b1b85,_0x3ecdb5){_0x2b1b85=_0x2b1b85-0x0;var _0x53cc7a=_0xe785[_0x2b1b85];return _0x53cc7a;};'use strict';var EventEmitter=require(_0x5e78('0x0'));var UserProfile=require(_0x5e78('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x5e78('0x2')](0x0);var events={'afterCreate':_0x5e78('0x3'),'afterUpdate':_0x5e78('0x4'),'afterDestroy':_0x5e78('0x5')};function emitEvent(_0x4d8317){return function(_0x4c0243,_0x55fadd,_0x4565a4){UserProfileEvents[_0x5e78('0x6')](_0x4d8317+':'+_0x4c0243['id'],_0x4c0243);UserProfileEvents[_0x5e78('0x6')](_0x4d8317,_0x4c0243);_0x4565a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x5e78('0x7')]=UserProfileEvents; \ No newline at end of file +var _0xd663=['update','remove','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x566416,_0x5f0533){var _0x11a8d7=function(_0x41b25f){while(--_0x41b25f){_0x566416['push'](_0x566416['shift']());}};_0x11a8d7(++_0x5f0533);}(_0xd663,0x1ed));var _0x3d66=function(_0x5e2c56,_0x4b57d4){_0x5e2c56=_0x5e2c56-0x0;var _0x485a69=_0xd663[_0x5e2c56];return _0x485a69;};'use strict';var EventEmitter=require(_0x3d66('0x0'));var UserProfile=require(_0x3d66('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3d66('0x2')](0x0);var events={'afterCreate':_0x3d66('0x3'),'afterUpdate':_0x3d66('0x4'),'afterDestroy':_0x3d66('0x5')};function emitEvent(_0xb5a453){return function(_0x4e9001,_0x28d76b,_0x533dcc){UserProfileEvents['emit'](_0xb5a453+':'+_0x4e9001['id'],_0x4e9001);UserProfileEvents['emit'](_0xb5a453,_0x4e9001);_0x533dcc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x3d66('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 216261a..ee78e2b 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 _0x0dce=['Team','voicequeues','users','agents','telephones','User','Users','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','query','section','isEmpty','push','UserProfileSection','find','params','all','ignore','length','autoAssociation','rawAttributes','model','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','rows','ids','customSorting','extraQueryConditions','count','CmContact','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','openchannel','lodash','squel','exports','models','filter','field','findAll','then','associatedResources','map','value','resolve','AnalyticExtractedReport','type','resourceId','toLowerCase','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','JscriptyProject','contacts','ListId','companies','globalcustomfields','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','Agents','membername','role','Telephones','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0dce,0x1e3));var _0xe0dc=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x0dce[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xe0dc('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0xe0dc('0x1'));module[_0xe0dc('0x2')]=function(_0x12c386){var _0x40bb5a=_0x12c386[_0xe0dc('0x3')];function _0x9dfe7b(_0x5c05d4,_0x484109){return new Promise(function(_0x5d485d,_0x257e90){if(!_0x484109)return _0x5d485d(null);var _0x3f4aa1=_0x484109[_0xe0dc('0x4')]?{[_0x484109[_0xe0dc('0x4')][_0xe0dc('0x5')]]:_0x484109[_0xe0dc('0x4')]['value']}:undefined;return _0x40bb5a[_0x5c05d4][_0xe0dc('0x6')]({'where':_0x3f4aa1,'raw':!![]})[_0xe0dc('0x7')](function(_0x108a7f){_0x484109[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x108a7f,'id');_0x5d485d(_0x484109);})['catch'](function(_0x57a65b){_0x257e90(_0x57a65b);});});}function _0xa9e1a4(_0x489789,_0x330eee){return new Promise(function(_0x5eb753,_0xe438b9){var _0x11b28a=_0x489789['filter']?{[_0x489789['filter'][_0xe0dc('0x5')]]:_0x489789['filter'][_0xe0dc('0xa')]}:undefined;return _0x40bb5a[_0x489789['model']]['findAll']({'where':_0x11b28a,'raw':!![]})[_0xe0dc('0x7')](function(_0x576ac4){_0x330eee[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x576ac4,function(_0x4a5515){return _0x4a5515['name'];});_0x5eb753(_0x330eee);})['catch'](function(_0x3536f0){_0xe438b9(_0x3536f0);});});}function _0x1c23af(_0x597e5a,_0x3a622a,_0x5306be){if(!_0x3a622a)return Promise[_0xe0dc('0xb')](null);return new Promise(function(_0x532825,_0x56d044){return _0x40bb5a['UserProfileResource'][_0xe0dc('0x6')]({'where':{'sectionId':_0x3a622a['id']},'raw':!![]})['then'](function(_0x6239ae){if(_0x597e5a[_0xe0dc('0x5')]&&_0x597e5a[_0xe0dc('0x5')]!=='id'){_0x3a622a[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x6239ae,function(_0x3774e8){return _0x3774e8[_0x597e5a[_0xe0dc('0x5')]];});}else{if(_0x5306be===_0xe0dc('0xc')){_0x3a622a['associatedResources']=_['map'](_0x6239ae,function(_0x5ca167){return{'id':_0x5ca167['resourceId'],'type':_0x5ca167[_0xe0dc('0xd')]};});}else{_0x3a622a[_0xe0dc('0x8')]=_[_0xe0dc('0x9')](_0x6239ae,function(_0x168d6){return _0x168d6[_0xe0dc('0xe')];});}}_0x532825(_0x3a622a);})['catch'](function(_0x317243){_0x56d044(_0x317243);});});}function _0x335978(_0x1ad215,_0x419618){var _0x285e20={'parentSections':[]};switch(_0x1ad215[_0xe0dc('0xf')]()){case'squareprojects':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x11');break;case'odbc':_0x285e20['childModel']=_0xe0dc('0x12');break;case _0xe0dc('0x13'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x14');_0x285e20[_0xe0dc('0x15')]=[{'name':_0xe0dc('0x16'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x18')}];break;case'projects':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x19');break;case _0xe0dc('0x1a'):_0x285e20[_0xe0dc('0x10')]='CmContact';_0x285e20[_0xe0dc('0x15')]=[{'name':'Lists','field':'id','foreignKey':_0xe0dc('0x1b')}];break;case'lists':_0x285e20['childModel']='CmList';break;case _0xe0dc('0x1c'):_0x285e20[_0xe0dc('0x10')]='CmCompany';break;case _0xe0dc('0x1d'):_0x285e20[_0xe0dc('0x10')]='CmCustomField';break;case _0xe0dc('0x1e'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x1f');break;case _0xe0dc('0x20'):_0x285e20['childModel']='ChatWebsite';break;case'faxqueues':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x21');break;case _0xe0dc('0x22'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x23');break;case _0xe0dc('0x24'):case _0xe0dc('0x25'):case'outboundroutes':_0x285e20[_0xe0dc('0x10')]='VoiceExtension';break;case _0xe0dc('0x26'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x27');break;case _0xe0dc('0x28'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x29');break;case'voicerecordings':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x2a');_0x285e20['parentSections']=[{'name':_0xe0dc('0x2b'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x2c'),'model':'User','filter':{'field':_0xe0dc('0x2d'),'value':['agent']}},{'name':_0xe0dc('0x2e'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x2c'),'model':'User','filter':{'field':_0xe0dc('0x2d'),'value':['telephone']}},{'name':_0xe0dc('0x2f'),'field':_0xe0dc('0x17'),'foreignKey':_0xe0dc('0x30'),'model':_0xe0dc('0x31'),'filter':{'field':'type','value':[_0xe0dc('0x32')]}},{'name':_0xe0dc('0x33'),'field':_0xe0dc('0x17'),'foreignKey':'queue','model':_0xe0dc('0x31'),'filter':{'field':_0xe0dc('0xd'),'value':[_0xe0dc('0x34')]}}];break;case'musiconholds':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x35');break;case _0xe0dc('0x36'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x37');break;case'voiceprefixes':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x38');break;case _0xe0dc('0x39'):_0x285e20[_0xe0dc('0x10')]='Campaign';break;case'mailqueues':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3a');break;case _0xe0dc('0x3b'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3c');break;case'mailsubstatuses':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3d');break;case _0xe0dc('0x3e'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x3f');break;case'openchannelaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x40');break;case _0xe0dc('0x41'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x42');break;case'smsaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x43');break;case _0xe0dc('0x44'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x45');break;case _0xe0dc('0x46'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x47');break;case'teams':_0x285e20['childModel']=_0xe0dc('0x48');break;case _0xe0dc('0x49'):case'queuecampaigns':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x31');if(_0x419618){_0x285e20['parentSections']=[{'name':'VoiceQueues'},{'name':_0xe0dc('0x33')}];}break;case _0xe0dc('0x4a'):case _0xe0dc('0x4b'):case _0xe0dc('0x4c'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x4d');if(_0x419618){_0x285e20[_0xe0dc('0x15')]=[{'name':_0xe0dc('0x4e'),'filter':{'field':'role','value':['admin','user']},'ignore':!![]},{'name':_0xe0dc('0x2b')},{'name':_0xe0dc('0x2e')}];}break;case'zendeskaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x4f');break;case _0xe0dc('0x50'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x51');break;case _0xe0dc('0x52'):_0x285e20[_0xe0dc('0x10')]='FreshdeskAccount';break;case _0xe0dc('0x53'):_0x285e20[_0xe0dc('0x10')]='SugarcrmAccount';break;case'deskaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x54');break;case'zohoaccounts':_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x55');break;case _0xe0dc('0x56'):_0x285e20[_0xe0dc('0x10')]='User';break;case _0xe0dc('0x57'):_0x285e20['childModel']=_0xe0dc('0x58');break;case _0xe0dc('0x59'):_0x285e20['childModel']='Disposition';break;case _0xe0dc('0x5a'):_0x285e20['childModel']=_0xe0dc('0x5b');break;case _0xe0dc('0x5c'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x5d');break;case _0xe0dc('0x5e'):_0x285e20[_0xe0dc('0x10')]='Pause';break;case _0xe0dc('0x5f'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x60');break;case _0xe0dc('0x61'):_0x285e20[_0xe0dc('0x10')]='Sound';break;case _0xe0dc('0x62'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x63');break;case _0xe0dc('0x64'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x65');break;case _0xe0dc('0x66'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x67');break;case _0xe0dc('0x68'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x69');break;case _0xe0dc('0x6a'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0x6b');break;case _0xe0dc('0x6c'):_0x285e20['childModel']=_0xe0dc('0x6d');break;case _0xe0dc('0x6e'):_0x285e20[_0xe0dc('0x10')]=_0xe0dc('0xc');_0x285e20['parentSections']=[{'name':_0xe0dc('0x6f'),'field':'id','foreignKey':_0xe0dc('0x70')}];break;case _0xe0dc('0x71'):_0x285e20['childModel']='AnalyticMetric';break;}return _0x285e20;}function _0xd7682f(_0x3e1ade,_0x2fb2a3){var _0x52ea45=_0x3e1ade[_0xe0dc('0x72')](0x0)[_0xe0dc('0x73')]()+_0x3e1ade['slice'](0x1);var _0x3de8f9={'type':_0x40bb5a['Sequelize'][_0xe0dc('0x74')][_0xe0dc('0x75')],'raw':!![]};return new Promise(function(_0x523fc4,_0x52f0f4){var _0x239cb7=squel[_0xe0dc('0x76')]()['field'](_0xe0dc('0x77')+_0x52ea45+_0xe0dc('0x78'),'id')[_0xe0dc('0x5')](_0xe0dc('0x79'))['from'](_0xe0dc('0x7a')+_0x3e1ade+'_interactions','ui')['where'](_0xe0dc('0x7b'),_0x2fb2a3['id']);return _0x40bb5a[_0xe0dc('0x7c')]['query'](_0x239cb7[_0xe0dc('0x7d')](),_0x3de8f9)[_0xe0dc('0x7')](function(_0x586f2d){_0x2fb2a3[_0x52ea45+_0xe0dc('0x7e')]=_0x586f2d;_0x523fc4(_0x586f2d);})['catch'](function(_0x42c4ab){_0x52f0f4(_0x42c4ab);});});}return _0x12c386['define'](_0xe0dc('0x7f'),attributes,{'tableName':_0xe0dc('0x80'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x59745e){var _0xe6da35=require(_0xe0dc('0x81'));var _0x4102e0={'raw':_0x59745e['query'][_0xe0dc('0x82')],'where':{}};var _0xe8ed70={};var _0x1a7d41={'count':0x0,'rows':[]};var _0x2eb66c=_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x84')];var _0x1c87e2=_0x59745e[_0xe0dc('0x83')]['mergeResources']||![];var _0x2fa6c3=_0x335978(_0x2eb66c,_0x1c87e2);if(!_0x2fa6c3[_0xe0dc('0x10')])throw new Error('Invalid\x20section\x20\x27'+_0x2eb66c+'\x27');var _0x54b5c4=[{'name':_0x2eb66c}];if(!_[_0xe0dc('0x85')](_0x2fa6c3[_0xe0dc('0x15')]))_0x54b5c4=_0x2fa6c3[_0xe0dc('0x15')];var _0x32f985=[];for(var _0x132c5d=0x0;_0x132c5d<_0x54b5c4['length'];_0x132c5d++){_0x32f985[_0xe0dc('0x86')](_0x40bb5a[_0xe0dc('0x87')][_0xe0dc('0x88')]({'where':{'userProfileId':_0x59745e[_0xe0dc('0x89')]['id'],'name':_0x54b5c4[_0x132c5d]['name']},'raw':!![]}));}return Promise[_0xe0dc('0x8a')](_0x32f985)[_0xe0dc('0x7')](function(_0x5de7f0){var _0x5204fe=_[_0xe0dc('0x4')](_0x5de7f0,function(_0x221e4d){return _0x221e4d?_0x221e4d:undefined;});var _0xbc8e2a=_[_0xe0dc('0x4')](_0x54b5c4,[_0xe0dc('0x8b'),!![]]);var _0x402974=_['isEmpty'](_0x5204fe)&&_[_0xe0dc('0x85')](_0xbc8e2a)?null:_['union'](_0xbc8e2a,_0x5204fe);if(!_0x402974)return null;var _0x4d889e=[];for(var _0x326379=0x0;_0x326379<_0x402974[_0xe0dc('0x8c')];_0x326379++){var _0xc9aff6=_[_0xe0dc('0x88')](_0x54b5c4,function(_0x17e131){return _0x402974[_0x326379]?_0x17e131[_0xe0dc('0x17')]===_0x402974[_0x326379][_0xe0dc('0x17')]:null;});if(_0xc9aff6){if(_0x402974[_0x326379][_0xe0dc('0x8b')]){_0x4d889e[_0xe0dc('0x86')](_0x9dfe7b(_0x2fa6c3[_0xe0dc('0x10')],_0x402974[_0x326379]));}else{if(!_0x402974[_0x326379][_0xe0dc('0x8d')]){_0x4d889e[_0xe0dc('0x86')](_0x1c23af(_0xc9aff6,_0x402974[_0x326379],_0x2fa6c3[_0xe0dc('0x10')]));}else{if(_0xc9aff6['model']){_0x4d889e[_0xe0dc('0x86')](_0xa9e1a4(_0xc9aff6,_0x402974[_0x326379]));}}}}}return Promise[_0xe0dc('0x8a')](_0x4d889e);})[_0xe0dc('0x7')](function(_0x595847){var _0x1d8f58=_0x595847;var _0x15e69b=null;if(_0x1d8f58){_0x15e69b=_0x1d8f58[_0xe0dc('0x8c')]===0x1?_0x1d8f58[0x0]:null;}if(!_0x15e69b&&!_0x1d8f58)return _0x1a7d41;var _0x42b3ea=_0x40bb5a[_0x2fa6c3[_0xe0dc('0x10')]][_0xe0dc('0x8e')];_0xe8ed70[_0xe0dc('0x8f')]=_['keys'](_0x42b3ea);_0xe8ed70[_0xe0dc('0x83')]=_[_0xe0dc('0x90')](_0x59745e[_0xe0dc('0x83')]);_0xe8ed70['filters']=_[_0xe0dc('0x91')](_0xe8ed70[_0xe0dc('0x8f')],_0xe8ed70['query']);_0x4102e0[_0xe0dc('0x92')]=_['intersection'](_0xe8ed70['model'],_0xe6da35[_0xe0dc('0x93')](_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x93')]));_0x4102e0[_0xe0dc('0x92')]=_0x4102e0[_0xe0dc('0x92')][_0xe0dc('0x8c')]?_0x4102e0['attributes']:_0xe8ed70[_0xe0dc('0x8f')];if(!_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x94')](_0xe0dc('0x95'))){_0x4102e0[_0xe0dc('0x96')]=_0xe6da35[_0xe0dc('0x96')](_0x59745e[_0xe0dc('0x83')]['limit']);_0x4102e0[_0xe0dc('0x97')]=_0xe6da35['offset'](_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x97')]);}_0x4102e0[_0xe0dc('0x98')]=_0xe6da35['sort'](_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x99')]);_0x4102e0[_0xe0dc('0x9a')]=_0xe6da35[_0xe0dc('0x9b')](_[_0xe0dc('0x9c')](_0x59745e['query'],_0xe8ed70['filters']));if(_0x59745e[_0xe0dc('0x83')][_0xe0dc('0x4')]){_0x4102e0[_0xe0dc('0x9a')]=_[_0xe0dc('0x9d')](_0x4102e0[_0xe0dc('0x9a')],{'$or':_['map'](_0x42b3ea,function(_0xf4bd5c){if(_0xf4bd5c[_0xe0dc('0xd')][_0xe0dc('0x9e')]!==_0xe0dc('0x9f')){var _0x530f5f={};_0x530f5f[_0xf4bd5c[_0xe0dc('0x5')]]={'$like':'%'+_0x59745e[_0xe0dc('0x83')]['filter']+'%'};return _0x530f5f;}})});}var _0x5607c0=[];var _0x4c5f45=null;var _0x2709f9={};if(_0x15e69b){_0x4c5f45=_[_0xe0dc('0x88')](_0x54b5c4,[_0xe0dc('0x17'),_0x15e69b['name']]);if(_0x4c5f45['field']){_0x2709f9={};if(_0x2fa6c3[_0xe0dc('0x10')]===_0xe0dc('0xc')){_0x2709f9[_0x4c5f45[_0xe0dc('0xa0')]]=_[_0xe0dc('0x9')](_0x15e69b[_0xe0dc('0x8')],'id');}else{_0x2709f9[_0x4c5f45[_0xe0dc('0xa0')]]=_0x15e69b['associatedResources'];}_0x5607c0[_0xe0dc('0x86')](_0x2709f9);}else{_0x4102e0[_0xe0dc('0x9a')]['id']=_0x15e69b[_0xe0dc('0x8')];}}else{for(var _0x4e61ff=0x0;_0x4e61ff<_0x1d8f58[_0xe0dc('0x8c')];_0x4e61ff++){_0x4c5f45=_[_0xe0dc('0x88')](_0x54b5c4,[_0xe0dc('0x17'),_0x1d8f58[_0x4e61ff][_0xe0dc('0x17')]]);if(_0x4c5f45['field']){_0x2709f9={};_0x2709f9[_0x4c5f45[_0xe0dc('0xa0')]]=_0x1d8f58[_0x4e61ff][_0xe0dc('0x8')];_0x5607c0[_0xe0dc('0x86')](_0x2709f9);}else{if(!_0x4102e0[_0xe0dc('0x9a')]['id'])_0x4102e0[_0xe0dc('0x9a')]['id']=[];_0x1d8f58[_0x4e61ff][_0xe0dc('0x8')]['forEach'](function(_0x403fa4){_0x4102e0[_0xe0dc('0x9a')]['id'][_0xe0dc('0x86')](_0x403fa4);});}}}if(!_[_0xe0dc('0x85')](_0x5607c0)){_0x4102e0[_0xe0dc('0x9a')]=_[_0xe0dc('0x9d')](_0x4102e0[_0xe0dc('0x9a')],{'$and':{'$or':_0x5607c0}});}_0x4102e0=_[_0xe0dc('0x9d')]({},_0x4102e0,_0x59745e[_0xe0dc('0xa1')]);if(_0x15e69b&&!_0x15e69b['autoAssociation']&&_0x2fa6c3[_0xe0dc('0x10')]==='AnalyticExtractedReport'){if(_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xa2')]){_0x4102e0[_0xe0dc('0xa3')]=[{'all':!![]}];}return _0x40bb5a[_0x2fa6c3[_0xe0dc('0x10')]][_0xe0dc('0x6')](_0x4102e0)[_0xe0dc('0x7')](function(_0x6b81e1){var _0x160d29=[];_0x6b81e1[_0xe0dc('0xa4')](function(_0x4b6ae4){var _0x3b1113;switch(_0x4b6ae4[_0xe0dc('0xa5')]){case _0xe0dc('0xa6'):_0x3b1113=_['find'](_0x15e69b[_0xe0dc('0x8')],function(_0x5f1e33){return _0x5f1e33['id']===_0x4b6ae4['reportId']&&_0x5f1e33[_0xe0dc('0xd')]===_0xe0dc('0xa7');});break;case _0xe0dc('0xa8'):_0x3b1113=_[_0xe0dc('0x88')](_0x15e69b[_0xe0dc('0x8')],function(_0x2dcb15){return _0x2dcb15['id']===_0x4b6ae4[_0xe0dc('0x70')]&&_0x2dcb15[_0xe0dc('0xd')]==='CustomReports';});break;}if(_0x3b1113)_0x160d29[_0xe0dc('0x86')](_0x4b6ae4);});_0x1a7d41['count']=_0x160d29['length'];_0x1a7d41[_0xe0dc('0xa9')]=_0x160d29;return _0x1a7d41;});}else{if(!_[_0xe0dc('0x85')](_0x59745e[_0xe0dc('0x83')]['ids'])){_0x4102e0[_0xe0dc('0x9a')]['id']=_0x4102e0[_0xe0dc('0x9a')]['id']?_['intersection'](_0x4102e0['where']['id'],_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xaa')]):_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xaa')];if(_0x59745e['query'][_0xe0dc('0xab')]){_0x4102e0['order']=_0x59745e[_0xe0dc('0x83')]['customSorting'];}}if(_0x59745e['query'][_0xe0dc('0xac')]){_0x4102e0['where']=_[_0xe0dc('0x9d')](_0x4102e0['where'],{'$and':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xac')]});}return _0x40bb5a[_0x2fa6c3['childModel']]['count']({'where':_0x4102e0['where']})['then'](function(_0x124a5c){_0x1a7d41[_0xe0dc('0xad')]=_0x124a5c;if(_0x59745e[_0xe0dc('0x83')]['includeAll']){if(_0x2fa6c3[_0xe0dc('0x10')]===_0xe0dc('0xae')){_0x4102e0['include']=[{'model':_0x40bb5a[_0xe0dc('0x63')],'as':_0xe0dc('0xaf'),'attributes':['id',_0xe0dc('0x17'),_0xe0dc('0xb0')],'required':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb1')]?!![]:![]},{'model':_0x40bb5a[_0xe0dc('0x63')],'as':'ThroughTags','attributes':['id',_0xe0dc('0x17'),_0xe0dc('0xb0')],'through':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb1')]?{'attributes':[],'where':{'TagId':_0x59745e['query']['tag']||undefined}}:{},'required':_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb1')]?!![]:![]}];}else{_0x4102e0['include']=[{'all':!![]}];}}return _0x40bb5a[_0x2fa6c3[_0xe0dc('0x10')]][_0xe0dc('0x6')](_0x4102e0);})[_0xe0dc('0x7')](function(_0x12410f){_0x1a7d41['rows']=_0x12410f;if(_0x2eb66c===_0xe0dc('0x2b')&&_0x59745e[_0xe0dc('0x83')][_0xe0dc('0xb2')]===_0xe0dc('0xb3')){var _0x8a0e8d=[];for(var _0x1ae677=0x0;_0x1ae677<_0x1a7d41[_0xe0dc('0xa9')]['length'];_0x1ae677++){_0x8a0e8d[_0xe0dc('0x86')](_0xd7682f(_0xe0dc('0xb4'),_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677][_0xe0dc('0xb5')]));_0x8a0e8d['push'](_0xd7682f(_0xe0dc('0xb6'),_0x1a7d41['rows'][_0x1ae677][_0xe0dc('0xb5')]));_0x8a0e8d['push'](_0xd7682f(_0xe0dc('0xb7'),_0x1a7d41['rows'][_0x1ae677]['dataValues']));_0x8a0e8d['push'](_0xd7682f('mail',_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677]['dataValues']));_0x8a0e8d[_0xe0dc('0x86')](_0xd7682f(_0xe0dc('0xb8'),_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677][_0xe0dc('0xb5')]));_0x8a0e8d[_0xe0dc('0x86')](_0xd7682f('whatsapp',_0x1a7d41[_0xe0dc('0xa9')][_0x1ae677]['dataValues']));}return Promise['all'](_0x8a0e8d)['then'](function(){return _0x1a7d41;});}return _0x1a7d41;});}});}}});}; \ No newline at end of file +var _0x5c0e=['Plugin','AnalyticExtractedReport','Reports','metrics','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','InteractionId','ui.createdAt','from','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','ignore','union','autoAssociation','all','rawAttributes','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','key','VIRTUAL','foreignKey','includeAll','include','findAll','forEach','reportType','default','reportId','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','openchannel','lodash','./userProfile.attributes','squel','models','filter','field','value','then','associatedResources','map','catch','name','resolve','resourceId','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareRecording','parentSections','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','type','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','smsqueues','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','role','admin','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Tag','triggers','Trunk','variables','Variable','plugins'];(function(_0x1b817e,_0x180865){var _0x288232=function(_0x374da1){while(--_0x374da1){_0x1b817e['push'](_0x1b817e['shift']());}};_0x288232(++_0x180865);}(_0x5c0e,0x10a));var _0xe5c0=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x5c0e[_0x374ccf];return _0x443cde;};'use strict';var _=require(_0xe5c0('0x0'));var attributes=require(_0xe5c0('0x1'));var squel=require(_0xe5c0('0x2'));module['exports']=function(_0x5d50ed){var _0x34276d=_0x5d50ed[_0xe5c0('0x3')];function _0x3bbaa4(_0x53407f,_0x36fa90){return new Promise(function(_0x3b7e15,_0x420c34){if(!_0x36fa90)return _0x3b7e15(null);var _0x562242=_0x36fa90[_0xe5c0('0x4')]?{[_0x36fa90[_0xe5c0('0x4')][_0xe5c0('0x5')]]:_0x36fa90[_0xe5c0('0x4')][_0xe5c0('0x6')]}:undefined;return _0x34276d[_0x53407f]['findAll']({'where':_0x562242,'raw':!![]})[_0xe5c0('0x7')](function(_0x3b38ab){_0x36fa90[_0xe5c0('0x8')]=_[_0xe5c0('0x9')](_0x3b38ab,'id');_0x3b7e15(_0x36fa90);})[_0xe5c0('0xa')](function(_0x239161){_0x420c34(_0x239161);});});}function _0x1242f0(_0x2551e3,_0x50fe2d){return new Promise(function(_0xf64f45,_0x49aa80){var _0x351bc2=_0x2551e3[_0xe5c0('0x4')]?{[_0x2551e3[_0xe5c0('0x4')][_0xe5c0('0x5')]]:_0x2551e3[_0xe5c0('0x4')][_0xe5c0('0x6')]}:undefined;return _0x34276d[_0x2551e3['model']]['findAll']({'where':_0x351bc2,'raw':!![]})[_0xe5c0('0x7')](function(_0x24e6b6){_0x50fe2d[_0xe5c0('0x8')]=_[_0xe5c0('0x9')](_0x24e6b6,function(_0x2327b1){return _0x2327b1[_0xe5c0('0xb')];});_0xf64f45(_0x50fe2d);})[_0xe5c0('0xa')](function(_0x279f0b){_0x49aa80(_0x279f0b);});});}function _0x136b0f(_0x54afb3,_0x21d0c8,_0x2e428e){if(!_0x21d0c8)return Promise[_0xe5c0('0xc')](null);return new Promise(function(_0x1dbb46,_0x50933f){return _0x34276d['UserProfileResource']['findAll']({'where':{'sectionId':_0x21d0c8['id']},'raw':!![]})['then'](function(_0x5d1a17){if(_0x54afb3[_0xe5c0('0x5')]&&_0x54afb3[_0xe5c0('0x5')]!=='id'){_0x21d0c8[_0xe5c0('0x8')]=_[_0xe5c0('0x9')](_0x5d1a17,function(_0x51e8d0){return _0x51e8d0[_0x54afb3[_0xe5c0('0x5')]];});}else{if(_0x2e428e==='AnalyticExtractedReport'){_0x21d0c8[_0xe5c0('0x8')]=_['map'](_0x5d1a17,function(_0x2f8012){return{'id':_0x2f8012[_0xe5c0('0xd')],'type':_0x2f8012['type']};});}else{_0x21d0c8['associatedResources']=_[_0xe5c0('0x9')](_0x5d1a17,function(_0x516b32){return _0x516b32[_0xe5c0('0xd')];});}}_0x1dbb46(_0x21d0c8);})[_0xe5c0('0xa')](function(_0x17fb14){_0x50933f(_0x17fb14);});});}function _0x2c9cf3(_0x38d240,_0xa77405){var _0x1276ef={'parentSections':[]};switch(_0x38d240[_0xe5c0('0xe')]()){case _0xe5c0('0xf'):_0x1276ef['childModel']=_0xe5c0('0x10');break;case _0xe5c0('0x11'):_0x1276ef['childModel']='SquareOdbc';break;case'squarerecordings':_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x13');_0x1276ef[_0xe5c0('0x14')]=[{'name':'SquareProjects','field':_0xe5c0('0xb'),'foreignKey':_0xe5c0('0x15')}];break;case _0xe5c0('0x16'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x17');break;case _0xe5c0('0x18'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x19');_0x1276ef[_0xe5c0('0x14')]=[{'name':_0xe5c0('0x1a'),'field':'id','foreignKey':_0xe5c0('0x1b')}];break;case _0xe5c0('0x1c'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x1d');break;case _0xe5c0('0x1e'):_0x1276ef['childModel']=_0xe5c0('0x1f');break;case _0xe5c0('0x20'):_0x1276ef[_0xe5c0('0x12')]='CmCustomField';break;case _0xe5c0('0x21'):_0x1276ef['childModel']=_0xe5c0('0x22');break;case _0xe5c0('0x23'):_0x1276ef[_0xe5c0('0x12')]='ChatWebsite';break;case _0xe5c0('0x24'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x25');break;case _0xe5c0('0x26'):_0x1276ef[_0xe5c0('0x12')]='FaxAccount';break;case'inboundroutes':case _0xe5c0('0x27'):case _0xe5c0('0x28'):_0x1276ef['childModel']=_0xe5c0('0x29');break;case _0xe5c0('0x2a'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x2b');break;case'voicemails':_0x1276ef['childModel']=_0xe5c0('0x2c');break;case _0xe5c0('0x2d'):_0x1276ef['childModel']=_0xe5c0('0x2e');_0x1276ef[_0xe5c0('0x14')]=[{'name':_0xe5c0('0x2f'),'field':_0xe5c0('0xb'),'foreignKey':_0xe5c0('0x30'),'model':_0xe5c0('0x31'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':_0xe5c0('0xb'),'foreignKey':_0xe5c0('0x30'),'model':'User','filter':{'field':'role','value':[_0xe5c0('0x32')]}},{'name':_0xe5c0('0x33'),'field':_0xe5c0('0xb'),'foreignKey':_0xe5c0('0x34'),'model':_0xe5c0('0x35'),'filter':{'field':'type','value':['inbound']}},{'name':_0xe5c0('0x36'),'field':_0xe5c0('0xb'),'foreignKey':_0xe5c0('0x34'),'model':'VoiceQueue','filter':{'field':_0xe5c0('0x37'),'value':['outbound']}}];break;case'musiconholds':_0x1276ef['childModel']=_0xe5c0('0x38');break;case'chanspies':_0x1276ef['childModel']=_0xe5c0('0x39');break;case _0xe5c0('0x3a'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x3b');break;case _0xe5c0('0x3c'):_0x1276ef[_0xe5c0('0x12')]='Campaign';break;case _0xe5c0('0x3d'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x3e');break;case'mailaccounts':_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x3f');break;case _0xe5c0('0x40'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x41');break;case _0xe5c0('0x42'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x43');break;case'openchannelaccounts':_0x1276ef[_0xe5c0('0x12')]='OpenchannelAccount';break;case _0xe5c0('0x44'):_0x1276ef[_0xe5c0('0x12')]='SmsQueue';break;case'smsaccounts':_0x1276ef['childModel']=_0xe5c0('0x45');break;case _0xe5c0('0x46'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x47');break;case _0xe5c0('0x48'):_0x1276ef['childModel']=_0xe5c0('0x49');break;case _0xe5c0('0x4a'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x4b');break;case _0xe5c0('0x4c'):case _0xe5c0('0x4d'):_0x1276ef['childModel']=_0xe5c0('0x35');if(_0xa77405){_0x1276ef[_0xe5c0('0x14')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xe5c0('0x4e'):case'agents':case _0xe5c0('0x4f'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x31');if(_0xa77405){_0x1276ef[_0xe5c0('0x14')]=[{'name':_0xe5c0('0x50'),'filter':{'field':_0xe5c0('0x51'),'value':[_0xe5c0('0x52'),_0xe5c0('0x53')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xe5c0('0x54'):_0x1276ef[_0xe5c0('0x12')]='ZendeskAccount';break;case _0xe5c0('0x55'):_0x1276ef['childModel']='SalesforceAccount';break;case _0xe5c0('0x56'):_0x1276ef['childModel']='FreshdeskAccount';break;case'sugarcrmaccounts':_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x57');break;case _0xe5c0('0x58'):_0x1276ef[_0xe5c0('0x12')]='DeskAccount';break;case _0xe5c0('0x59'):_0x1276ef['childModel']=_0xe5c0('0x5a');break;case _0xe5c0('0x5b'):_0x1276ef['childModel']=_0xe5c0('0x31');break;case _0xe5c0('0x5c'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x5d');break;case _0xe5c0('0x5e'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x5f');break;case _0xe5c0('0x60'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x61');break;case _0xe5c0('0x62'):_0x1276ef['childModel']=_0xe5c0('0x63');break;case _0xe5c0('0x64'):_0x1276ef[_0xe5c0('0x12')]='Pause';break;case _0xe5c0('0x65'):_0x1276ef['childModel']=_0xe5c0('0x66');break;case _0xe5c0('0x67'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x68');break;case _0xe5c0('0x69'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x6a');break;case'templates':_0x1276ef[_0xe5c0('0x12')]='Template';break;case _0xe5c0('0x6b'):_0x1276ef[_0xe5c0('0x12')]='Trigger';break;case'trunks':_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x6c');break;case _0xe5c0('0x6d'):_0x1276ef['childModel']=_0xe5c0('0x6e');break;case _0xe5c0('0x6f'):_0x1276ef[_0xe5c0('0x12')]=_0xe5c0('0x70');break;case'extractedreports':_0x1276ef['childModel']=_0xe5c0('0x71');_0x1276ef[_0xe5c0('0x14')]=[{'name':_0xe5c0('0x72'),'field':'id','foreignKey':'reportId'}];break;case _0xe5c0('0x73'):_0x1276ef['childModel']='AnalyticMetric';break;}return _0x1276ef;}function _0x27e6fa(_0x2eab07,_0x1da163){var _0x4d9386=_0x2eab07[_0xe5c0('0x74')](0x0)[_0xe5c0('0x75')]()+_0x2eab07[_0xe5c0('0x76')](0x1);var _0x284cd8={'type':_0x34276d[_0xe5c0('0x77')][_0xe5c0('0x78')][_0xe5c0('0x79')],'raw':!![]};return new Promise(function(_0x413b98,_0x4f1b93){var _0x563627=squel['select']()['field']('ui.'+_0x4d9386+_0xe5c0('0x7a'),'id')[_0xe5c0('0x5')](_0xe5c0('0x7b'))[_0xe5c0('0x7c')]('user_has_'+_0x2eab07+'_interactions','ui')['where'](_0xe5c0('0x7d'),_0x1da163['id']);return _0x34276d[_0xe5c0('0x7e')][_0xe5c0('0x7f')](_0x563627[_0xe5c0('0x80')](),_0x284cd8)['then'](function(_0x3ce573){_0x1da163[_0x4d9386+_0xe5c0('0x81')]=_0x3ce573;_0x413b98(_0x3ce573);})[_0xe5c0('0xa')](function(_0x3879d3){_0x4f1b93(_0x3879d3);});});}return _0x5d50ed[_0xe5c0('0x82')](_0xe5c0('0x83'),attributes,{'tableName':_0xe5c0('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1e1dcf){var _0xa75174=require(_0xe5c0('0x85'));var _0x31e4f2={'raw':_0x1e1dcf['query'][_0xe5c0('0x86')],'where':{}};var _0x525a07={};var _0x9a9029={'count':0x0,'rows':[]};var _0x361651=_0x1e1dcf[_0xe5c0('0x7f')]['section'];var _0x2a874f=_0x1e1dcf[_0xe5c0('0x7f')]['mergeResources']||![];var _0x4e206b=_0x2c9cf3(_0x361651,_0x2a874f);if(!_0x4e206b['childModel'])throw new Error(_0xe5c0('0x87')+_0x361651+'\x27');var _0x76e0c3=[{'name':_0x361651}];if(!_[_0xe5c0('0x88')](_0x4e206b[_0xe5c0('0x14')]))_0x76e0c3=_0x4e206b['parentSections'];var _0x24ed5b=[];for(var _0x18fbf4=0x0;_0x18fbf4<_0x76e0c3[_0xe5c0('0x89')];_0x18fbf4++){_0x24ed5b[_0xe5c0('0x8a')](_0x34276d[_0xe5c0('0x8b')][_0xe5c0('0x8c')]({'where':{'userProfileId':_0x1e1dcf[_0xe5c0('0x8d')]['id'],'name':_0x76e0c3[_0x18fbf4]['name']},'raw':!![]}));}return Promise['all'](_0x24ed5b)[_0xe5c0('0x7')](function(_0x138a82){var _0x2d046f=_[_0xe5c0('0x4')](_0x138a82,function(_0x5a0678){return _0x5a0678?_0x5a0678:undefined;});var _0x538b88=_[_0xe5c0('0x4')](_0x76e0c3,[_0xe5c0('0x8e'),!![]]);var _0x5c1034=_[_0xe5c0('0x88')](_0x2d046f)&&_['isEmpty'](_0x538b88)?null:_[_0xe5c0('0x8f')](_0x538b88,_0x2d046f);if(!_0x5c1034)return null;var _0x163f5c=[];for(var _0x416418=0x0;_0x416418<_0x5c1034[_0xe5c0('0x89')];_0x416418++){var _0x5743bd=_['find'](_0x76e0c3,function(_0x28a9dc){return _0x5c1034[_0x416418]?_0x28a9dc[_0xe5c0('0xb')]===_0x5c1034[_0x416418][_0xe5c0('0xb')]:null;});if(_0x5743bd){if(_0x5c1034[_0x416418][_0xe5c0('0x8e')]){_0x163f5c[_0xe5c0('0x8a')](_0x3bbaa4(_0x4e206b[_0xe5c0('0x12')],_0x5c1034[_0x416418]));}else{if(!_0x5c1034[_0x416418][_0xe5c0('0x90')]){_0x163f5c[_0xe5c0('0x8a')](_0x136b0f(_0x5743bd,_0x5c1034[_0x416418],_0x4e206b[_0xe5c0('0x12')]));}else{if(_0x5743bd['model']){_0x163f5c['push'](_0x1242f0(_0x5743bd,_0x5c1034[_0x416418]));}}}}}return Promise[_0xe5c0('0x91')](_0x163f5c);})[_0xe5c0('0x7')](function(_0x44c084){var _0x20338a=_0x44c084;var _0x36bcd7=null;if(_0x20338a){_0x36bcd7=_0x20338a[_0xe5c0('0x89')]===0x1?_0x20338a[0x0]:null;}if(!_0x36bcd7&&!_0x20338a)return _0x9a9029;var _0x54784d=_0x34276d[_0x4e206b['childModel']][_0xe5c0('0x92')];_0x525a07['model']=_[_0xe5c0('0x93')](_0x54784d);_0x525a07[_0xe5c0('0x7f')]=_[_0xe5c0('0x93')](_0x1e1dcf['query']);_0x525a07[_0xe5c0('0x94')]=_[_0xe5c0('0x95')](_0x525a07[_0xe5c0('0x96')],_0x525a07[_0xe5c0('0x7f')]);_0x31e4f2[_0xe5c0('0x97')]=_[_0xe5c0('0x95')](_0x525a07[_0xe5c0('0x96')],_0xa75174[_0xe5c0('0x98')](_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0x98')]));_0x31e4f2[_0xe5c0('0x97')]=_0x31e4f2[_0xe5c0('0x97')]['length']?_0x31e4f2[_0xe5c0('0x97')]:_0x525a07[_0xe5c0('0x96')];if(!_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0x99')](_0xe5c0('0x9a'))){_0x31e4f2[_0xe5c0('0x9b')]=_0xa75174[_0xe5c0('0x9b')](_0x1e1dcf['query'][_0xe5c0('0x9b')]);_0x31e4f2['offset']=_0xa75174['offset'](_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0x9c')]);}_0x31e4f2[_0xe5c0('0x9d')]=_0xa75174[_0xe5c0('0x9e')](_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0x9e')]);_0x31e4f2[_0xe5c0('0x9f')]=_0xa75174[_0xe5c0('0x94')](_['pick'](_0x1e1dcf['query'],_0x525a07[_0xe5c0('0x94')]));if(_0x1e1dcf['query'][_0xe5c0('0x4')]){_0x31e4f2['where']=_[_0xe5c0('0xa0')](_0x31e4f2[_0xe5c0('0x9f')],{'$or':_[_0xe5c0('0x9')](_0x54784d,function(_0x258974){if(_0x258974[_0xe5c0('0x37')][_0xe5c0('0xa1')]!==_0xe5c0('0xa2')){var _0x1b2904={};_0x1b2904[_0x258974[_0xe5c0('0x5')]]={'$like':'%'+_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0x4')]+'%'};return _0x1b2904;}})});}var _0x5f0c95=[];var _0x40514d=null;var _0x4c8722={};if(_0x36bcd7){_0x40514d=_[_0xe5c0('0x8c')](_0x76e0c3,[_0xe5c0('0xb'),_0x36bcd7['name']]);if(_0x40514d[_0xe5c0('0x5')]){_0x4c8722={};if(_0x4e206b[_0xe5c0('0x12')]===_0xe5c0('0x71')){_0x4c8722[_0x40514d[_0xe5c0('0xa3')]]=_[_0xe5c0('0x9')](_0x36bcd7['associatedResources'],'id');}else{_0x4c8722[_0x40514d['foreignKey']]=_0x36bcd7[_0xe5c0('0x8')];}_0x5f0c95[_0xe5c0('0x8a')](_0x4c8722);}else{_0x31e4f2[_0xe5c0('0x9f')]['id']=_0x36bcd7[_0xe5c0('0x8')];}}else{for(var _0x54aa7e=0x0;_0x54aa7e<_0x20338a[_0xe5c0('0x89')];_0x54aa7e++){_0x40514d=_[_0xe5c0('0x8c')](_0x76e0c3,[_0xe5c0('0xb'),_0x20338a[_0x54aa7e]['name']]);if(_0x40514d[_0xe5c0('0x5')]){_0x4c8722={};_0x4c8722[_0x40514d[_0xe5c0('0xa3')]]=_0x20338a[_0x54aa7e][_0xe5c0('0x8')];_0x5f0c95['push'](_0x4c8722);}else{if(!_0x31e4f2['where']['id'])_0x31e4f2[_0xe5c0('0x9f')]['id']=[];_0x20338a[_0x54aa7e][_0xe5c0('0x8')]['forEach'](function(_0x12159b){_0x31e4f2[_0xe5c0('0x9f')]['id']['push'](_0x12159b);});}}}if(!_['isEmpty'](_0x5f0c95)){_0x31e4f2[_0xe5c0('0x9f')]=_[_0xe5c0('0xa0')](_0x31e4f2[_0xe5c0('0x9f')],{'$and':{'$or':_0x5f0c95}});}_0x31e4f2=_[_0xe5c0('0xa0')]({},_0x31e4f2,_0x1e1dcf['options']);if(_0x36bcd7&&!_0x36bcd7[_0xe5c0('0x90')]&&_0x4e206b[_0xe5c0('0x12')]===_0xe5c0('0x71')){if(_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xa4')]){_0x31e4f2[_0xe5c0('0xa5')]=[{'all':!![]}];}return _0x34276d[_0x4e206b[_0xe5c0('0x12')]][_0xe5c0('0xa6')](_0x31e4f2)['then'](function(_0x3498ba){var _0x527ea4=[];_0x3498ba[_0xe5c0('0xa7')](function(_0x3de3cb){var _0x555031;switch(_0x3de3cb[_0xe5c0('0xa8')]){case _0xe5c0('0xa9'):_0x555031=_[_0xe5c0('0x8c')](_0x36bcd7[_0xe5c0('0x8')],function(_0x3964dd){return _0x3964dd['id']===_0x3de3cb[_0xe5c0('0xaa')]&&_0x3964dd['type']===_0xe5c0('0xab');});break;case _0xe5c0('0xac'):_0x555031=_[_0xe5c0('0x8c')](_0x36bcd7[_0xe5c0('0x8')],function(_0x54af82){return _0x54af82['id']===_0x3de3cb[_0xe5c0('0xaa')]&&_0x54af82[_0xe5c0('0x37')]==='CustomReports';});break;}if(_0x555031)_0x527ea4[_0xe5c0('0x8a')](_0x3de3cb);});_0x9a9029[_0xe5c0('0xad')]=_0x527ea4[_0xe5c0('0x89')];_0x9a9029[_0xe5c0('0xae')]=_0x527ea4;return _0x9a9029;});}else{if(!_[_0xe5c0('0x88')](_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xaf')])){_0x31e4f2[_0xe5c0('0x9f')]['id']=_0x31e4f2[_0xe5c0('0x9f')]['id']?_['intersection'](_0x31e4f2['where']['id'],_0x1e1dcf['query'][_0xe5c0('0xaf')]):_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xaf')];if(_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xb0')]){_0x31e4f2[_0xe5c0('0x9d')]=_0x1e1dcf[_0xe5c0('0x7f')]['customSorting'];}}if(_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xb1')]){_0x31e4f2['where']=_[_0xe5c0('0xa0')](_0x31e4f2[_0xe5c0('0x9f')],{'$and':_0x1e1dcf[_0xe5c0('0x7f')]['extraQueryConditions']});}return _0x34276d[_0x4e206b['childModel']]['count']({'where':_0x31e4f2['where']})[_0xe5c0('0x7')](function(_0x4e4518){_0x9a9029[_0xe5c0('0xad')]=_0x4e4518;if(_0x1e1dcf[_0xe5c0('0x7f')]['includeAll']){if(_0x4e206b[_0xe5c0('0x12')]==='CmContact'){_0x31e4f2[_0xe5c0('0xa5')]=[{'model':_0x34276d[_0xe5c0('0x6a')],'as':_0xe5c0('0xb2'),'attributes':['id',_0xe5c0('0xb'),_0xe5c0('0xb3')],'required':_0x1e1dcf['query'][_0xe5c0('0xb4')]?!![]:![]},{'model':_0x34276d[_0xe5c0('0x6a')],'as':_0xe5c0('0xb5'),'attributes':['id','name',_0xe5c0('0xb3')],'through':_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xb4')]?{'attributes':[],'where':{'TagId':_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xb4')]||undefined}}:{},'required':_0x1e1dcf[_0xe5c0('0x7f')]['tag']?!![]:![]}];}else{_0x31e4f2[_0xe5c0('0xa5')]=[{'all':!![]}];}}return _0x34276d[_0x4e206b[_0xe5c0('0x12')]]['findAll'](_0x31e4f2);})['then'](function(_0x473451){_0x9a9029[_0xe5c0('0xae')]=_0x473451;if(_0x361651===_0xe5c0('0x2f')&&_0x1e1dcf[_0xe5c0('0x7f')][_0xe5c0('0xb6')]===_0xe5c0('0xb7')){var _0x457d20=[];for(var _0x296151=0x0;_0x296151<_0x9a9029[_0xe5c0('0xae')][_0xe5c0('0x89')];_0x296151++){_0x457d20[_0xe5c0('0x8a')](_0x27e6fa(_0xe5c0('0xb8'),_0x9a9029[_0xe5c0('0xae')][_0x296151][_0xe5c0('0xb9')]));_0x457d20[_0xe5c0('0x8a')](_0x27e6fa(_0xe5c0('0xba'),_0x9a9029[_0xe5c0('0xae')][_0x296151]['dataValues']));_0x457d20[_0xe5c0('0x8a')](_0x27e6fa(_0xe5c0('0xbb'),_0x9a9029[_0xe5c0('0xae')][_0x296151][_0xe5c0('0xb9')]));_0x457d20[_0xe5c0('0x8a')](_0x27e6fa('mail',_0x9a9029[_0xe5c0('0xae')][_0x296151]['dataValues']));_0x457d20[_0xe5c0('0x8a')](_0x27e6fa(_0xe5c0('0xbc'),_0x9a9029['rows'][_0x296151][_0xe5c0('0xb9')]));_0x457d20[_0xe5c0('0x8a')](_0x27e6fa('whatsapp',_0x9a9029[_0xe5c0('0xae')][_0x296151][_0xe5c0('0xb9')]));}return Promise['all'](_0x457d20)['then'](function(){return _0x9a9029;});}return _0x9a9029;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index fb9e564..9598120 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 _0xf61e=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\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','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x5a9cb4,_0x18ac0c){var _0x480931=function(_0x5d7e69){while(--_0x5d7e69){_0x5a9cb4['push'](_0x5a9cb4['shift']());}};_0x480931(++_0x18ac0c);}(_0xf61e,0x191));var _0xef61=function(_0x384ddd,_0x3aaf88){_0x384ddd=_0x384ddd-0x0;var _0x355ee6=_0xf61e[_0x384ddd];return _0x355ee6;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});config[_0xef61('0xd')]=_['defaults'](config[_0xef61('0xd')],{'host':_0xef61('0xe'),'port':0x18eb});var socket=require(_0xef61('0xf'))(new Redis(config['redis']));require('./userProfile.socket')[_0xef61('0x10')](socket);function respondWithRpcPromise(_0x2e28c7,_0x1ab79d,_0x11181b){return new BPromise(function(_0x2af74c,_0xdcd707){return client[_0xef61('0x11')](_0x2e28c7,_0x11181b)[_0xef61('0x12')](function(_0x237f43){logger[_0xef61('0x13')](_0xef61('0x14'),_0x1ab79d,_0xef61('0x15'));logger[_0xef61('0x16')](_0xef61('0x17'),_0x1ab79d,'request\x20sent',JSON[_0xef61('0x18')](_0x237f43));if(_0x237f43['error']){if(_0x237f43[_0xef61('0x19')][_0xef61('0x1a')]===0x1f4){logger[_0xef61('0x19')](_0xef61('0x14'),_0x1ab79d,_0x237f43['error'][_0xef61('0x1b')]);return _0xdcd707(_0x237f43[_0xef61('0x19')][_0xef61('0x1b')]);}logger[_0xef61('0x19')]('UserProfile,\x20%s,\x20%s',_0x1ab79d,_0x237f43[_0xef61('0x19')][_0xef61('0x1b')]);return _0x2af74c(_0x237f43['error'][_0xef61('0x1b')]);}else{logger[_0xef61('0x13')](_0xef61('0x14'),_0x1ab79d,_0xef61('0x15'));_0x2af74c(_0x237f43[_0xef61('0x1c')][_0xef61('0x1b')]);}})[_0xef61('0x1d')](function(_0x55f887){logger[_0xef61('0x19')](_0xef61('0x14'),_0x1ab79d,_0x55f887);_0xdcd707(_0x55f887);});});} \ No newline at end of file +var _0x078a=['info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','request','then'];(function(_0x592e40,_0x2ed011){var _0x5d4288=function(_0x366e87){while(--_0x366e87){_0x592e40['push'](_0x592e40['shift']());}};_0x5d4288(++_0x2ed011);}(_0x078a,0x12d));var _0xa078=function(_0x5f1b1e,_0x299f3f){_0x5f1b1e=_0x5f1b1e-0x0;var _0x5170ca=_0x078a[_0x5f1b1e];return _0x5170ca;};'use strict';var _=require(_0xa078('0x0'));var util=require(_0xa078('0x1'));var moment=require(_0xa078('0x2'));var BPromise=require(_0xa078('0x3'));var rs=require(_0xa078('0x4'));var fs=require('fs');var Redis=require(_0xa078('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa078('0x6'));var logger=require(_0xa078('0x7'))(_0xa078('0x8'));var config=require('../../config/environment');var jayson=require(_0xa078('0x9'));var client=jayson['client'][_0xa078('0xa')]({'port':0x232a});config[_0xa078('0xb')]=_[_0xa078('0xc')](config[_0xa078('0xb')],{'host':_0xa078('0xd'),'port':0x18eb});var socket=require(_0xa078('0xe'))(new Redis(config[_0xa078('0xb')]));require(_0xa078('0xf'))['register'](socket);function respondWithRpcPromise(_0x158b08,_0x52eee7,_0x347943){return new BPromise(function(_0x1607f4,_0x5b3c33){return client[_0xa078('0x10')](_0x158b08,_0x347943)[_0xa078('0x11')](function(_0x2ace5f){logger[_0xa078('0x12')](_0xa078('0x13'),_0x52eee7,'request\x20sent');logger[_0xa078('0x14')](_0xa078('0x15'),_0x52eee7,_0xa078('0x16'),JSON[_0xa078('0x17')](_0x2ace5f));if(_0x2ace5f[_0xa078('0x18')]){if(_0x2ace5f[_0xa078('0x18')][_0xa078('0x19')]===0x1f4){logger[_0xa078('0x18')](_0xa078('0x13'),_0x52eee7,_0x2ace5f[_0xa078('0x18')][_0xa078('0x1a')]);return _0x5b3c33(_0x2ace5f[_0xa078('0x18')]['message']);}logger[_0xa078('0x18')](_0xa078('0x13'),_0x52eee7,_0x2ace5f[_0xa078('0x18')]['message']);return _0x1607f4(_0x2ace5f[_0xa078('0x18')][_0xa078('0x1a')]);}else{logger['info'](_0xa078('0x13'),_0x52eee7,_0xa078('0x16'));_0x1607f4(_0x2ace5f[_0xa078('0x1b')]['message']);}})[_0xa078('0x1c')](function(_0x257add){logger[_0xa078('0x18')](_0xa078('0x13'),_0x52eee7,_0x257add);_0x5b3c33(_0x257add);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3899926..f42a208 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 _0x1fd6=['register','length','userProfile:','save','remove','emit','removeListener'];(function(_0x3939f8,_0x436924){var _0x2ac221=function(_0x37cb33){while(--_0x37cb33){_0x3939f8['push'](_0x3939f8['shift']());}};_0x2ac221(++_0x436924);}(_0x1fd6,0x1c3));var _0x61fd=function(_0x4758b7,_0x313703){_0x4758b7=_0x4758b7-0x0;var _0x1c6af0=_0x1fd6[_0x4758b7];return _0x1c6af0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x61fd('0x0'),_0x61fd('0x1'),'update'];function createListener(_0x116676,_0x322bf3){return function(_0xe4ac74){_0x322bf3[_0x61fd('0x2')](_0x116676,_0xe4ac74);};}function removeListener(_0x12e84c,_0x4c9096){return function(){UserProfileEvents[_0x61fd('0x3')](_0x12e84c,_0x4c9096);};}exports[_0x61fd('0x4')]=function(_0x5bcbe3){for(var _0x182ec7=0x0,_0x2d2e31=events[_0x61fd('0x5')];_0x182ec7<_0x2d2e31;_0x182ec7++){var _0x129305=events[_0x182ec7];var _0x32b608=createListener(_0x61fd('0x6')+_0x129305,_0x5bcbe3);UserProfileEvents['on'](_0x129305,_0x32b608);}}; \ No newline at end of file +var _0x41fd=['./userProfile.events','save','remove','update','emit','removeListener','register','userProfile:'];(function(_0x432371,_0x1585b1){var _0x493384=function(_0x49765b){while(--_0x49765b){_0x432371['push'](_0x432371['shift']());}};_0x493384(++_0x1585b1);}(_0x41fd,0x158));var _0xd41f=function(_0x341540,_0x2aef97){_0x341540=_0x341540-0x0;var _0x94eba2=_0x41fd[_0x341540];return _0x94eba2;};'use strict';var UserProfileEvents=require(_0xd41f('0x0'));var events=[_0xd41f('0x1'),_0xd41f('0x2'),_0xd41f('0x3')];function createListener(_0x32c847,_0x52c070){return function(_0x194b33){_0x52c070[_0xd41f('0x4')](_0x32c847,_0x194b33);};}function removeListener(_0x24b76f,_0x69c882){return function(){UserProfileEvents[_0xd41f('0x5')](_0x24b76f,_0x69c882);};}exports[_0xd41f('0x6')]=function(_0x2bf305){for(var _0x3ff893=0x0,_0x1c6db8=events['length'];_0x3ff893<_0x1c6db8;_0x3ff893++){var _0x379256=events[_0x3ff893];var _0x239dee=createListener(_0xd41f('0x7')+_0x379256,_0x2bf305);UserProfileEvents['on'](_0x379256,_0x239dee);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index aed9076..b54402d 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 _0xe5f7=['get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x5ef55a,_0x2a03b1){var _0x20ae40=function(_0x46ce81){while(--_0x46ce81){_0x5ef55a['push'](_0x5ef55a['shift']());}};_0x20ae40(++_0x2a03b1);}(_0xe5f7,0xa5));var _0x7e5f=function(_0x55fdfa,_0x1ccfe3){_0x55fdfa=_0x55fdfa-0x0;var _0x1a23f9=_0xe5f7[_0x55fdfa];return _0x1a23f9;};'use strict';var multer=require('multer');var util=require(_0x7e5f('0x0'));var path=require(_0x7e5f('0x1'));var timeout=require(_0x7e5f('0x2'));var express=require(_0x7e5f('0x3'));var router=express['Router']();var fs_extra=require(_0x7e5f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e5f('0x5'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x7e5f('0x6')]('/',auth[_0x7e5f('0x7')](),controller[_0x7e5f('0x8')]);router[_0x7e5f('0x6')](_0x7e5f('0x9'),auth[_0x7e5f('0x7')](),controller[_0x7e5f('0xa')]);router[_0x7e5f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7e5f('0xb')]);router[_0x7e5f('0xc')]('/',auth[_0x7e5f('0x7')](),controller[_0x7e5f('0xd')]);router['put'](_0x7e5f('0xe'),auth['isAuthenticated'](),controller[_0x7e5f('0xf')]);router[_0x7e5f('0x10')](_0x7e5f('0xe'),auth[_0x7e5f('0x7')](),controller[_0x7e5f('0x11')]);module[_0x7e5f('0x12')]=router; \ No newline at end of file +var _0x4167=['index','/describe','/:id','post','put','update','delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3c4e97,_0x26e8cf){var _0x3f6f88=function(_0x17c84f){while(--_0x17c84f){_0x3c4e97['push'](_0x3c4e97['shift']());}};_0x3f6f88(++_0x26e8cf);}(_0x4167,0x86));var _0x7416=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4167[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7416('0x0'));var path=require(_0x7416('0x1'));var timeout=require('connect-timeout');var express=require(_0x7416('0x2'));var router=express[_0x7416('0x3')]();var fs_extra=require(_0x7416('0x4'));var auth=require(_0x7416('0x5'));var interaction=require(_0x7416('0x6'));var config=require(_0x7416('0x7'));var controller=require('./userProfileResource.controller');router[_0x7416('0x8')]('/',auth[_0x7416('0x9')](),controller[_0x7416('0xa')]);router[_0x7416('0x8')](_0x7416('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7416('0x8')](_0x7416('0xc'),auth[_0x7416('0x9')](),controller['show']);router[_0x7416('0xd')]('/',auth[_0x7416('0x9')](),controller['create']);router[_0x7416('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7416('0xf')]);router[_0x7416('0x10')](_0x7416('0xc'),auth[_0x7416('0x9')](),controller['destroy']);module[_0x7416('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index d45c6f2..c9900fd 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 _0xb827=['INTEGER','sequelize','exports','STRING'];(function(_0x262b32,_0x279676){var _0xcf633b=function(_0xf6e237){while(--_0xf6e237){_0x262b32['push'](_0x262b32['shift']());}};_0xcf633b(++_0x279676);}(_0xb827,0x81));var _0x7b82=function(_0x3b3cee,_0x4a3190){_0x3b3cee=_0x3b3cee-0x0;var _0x5e4cbf=_0xb827[_0x3b3cee];return _0x5e4cbf;};'use strict';var Sequelize=require(_0x7b82('0x0'));module[_0x7b82('0x1')]={'name':{'type':Sequelize[_0x7b82('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7b82('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x7f57=['STRING','INTEGER','sequelize','exports'];(function(_0x4f415d,_0x2c2219){var _0x4ba7c7=function(_0x17639c){while(--_0x17639c){_0x4f415d['push'](_0x4f415d['shift']());}};_0x4ba7c7(++_0x2c2219);}(_0x7f57,0xf2));var _0x77f5=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7f57[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require(_0x77f5('0x0'));module[_0x77f5('0x1')]={'name':{'type':Sequelize[_0x77f5('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x77f5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x77f5('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4fff9a3..059bc36 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 _0xe2fe=['find','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','UserProfileResource','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x4eb30f,_0x2bfad8){var _0xc26a9a=function(_0x3a0418){while(--_0x3a0418){_0x4eb30f['push'](_0x4eb30f['shift']());}};_0xc26a9a(++_0x2bfad8);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['UserProfileResource']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['UserProfileResource']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));};exports[_0xee2f('0x40')]=function(_0x3acae6,_0x2a450f){return db[_0xee2f('0x23')][_0xee2f('0x40')]()[_0xee2f('0x1c')](respondWithResult(_0x2a450f,null))[_0xee2f('0x3b')](handleError(_0x2a450f,null));}; \ No newline at end of file +var _0x8e3f=['save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','filter','options','UserProfileResource','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','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/environment','../../config/license/util','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40ae02,_0x41f85e){_0x41f85e=_0x41f85e||0xcc;return function(_0x336790){if(_0x336790){return _0x40ae02[_0xf8e3('0x1a')](_0x41f85e);}return _0x40ae02['status'](_0x41f85e)[_0xf8e3('0x1b')]();};}function respondWithResult(_0xa856f5,_0x2fe631){_0x2fe631=_0x2fe631||0xc8;return function(_0x4af736){if(_0x4af736){return _0xa856f5[_0xf8e3('0x1c')](_0x2fe631)['json'](_0x4af736);}};}function respondWithFilteredResult(_0x1ec773,_0x40c196){return function(_0x460629){if(_0x460629){var _0x570ee3=typeof _0x40c196['offset']===_0xf8e3('0x1d')&&typeof _0x40c196[_0xf8e3('0x1e')]===_0xf8e3('0x1d');var _0x3b01ac=_0x460629[_0xf8e3('0x1f')];var _0x11d4cc=_0x570ee3?0x0:_0x40c196[_0xf8e3('0x20')];var _0x2e27e3=_0x570ee3?_0x460629[_0xf8e3('0x1f')]:_0x40c196[_0xf8e3('0x20')]+_0x40c196['limit'];var _0x20cc64;if(_0x2e27e3>=_0x3b01ac){_0x2e27e3=_0x3b01ac;_0x20cc64=0xc8;}else{_0x20cc64=0xce;}_0x1ec773[_0xf8e3('0x1c')](_0x20cc64);return _0x1ec773[_0xf8e3('0x21')](_0xf8e3('0x22'),_0x11d4cc+'-'+_0x2e27e3+'/'+_0x3b01ac)[_0xf8e3('0x23')](_0x460629);}return null;};}function patchUpdates(_0x11c58e){return function(_0x1cae53){try{jsonpatch[_0xf8e3('0x24')](_0x1cae53,_0x11c58e,!![]);}catch(_0x5b99b1){return BPromise[_0xf8e3('0x25')](_0x5b99b1);}return _0x1cae53[_0xf8e3('0x26')]();};}function saveUpdates(_0x3c636d,_0xccbcc0){return function(_0x4a1e5f){if(_0x4a1e5f){return _0x4a1e5f[_0xf8e3('0x27')](_0x3c636d)['then'](function(_0x286059){return _0x286059;});}return null;};}function removeEntity(_0x225a1b,_0x33d526){return function(_0x2dc856){if(_0x2dc856){return _0x2dc856[_0xf8e3('0x28')]()[_0xf8e3('0x29')](function(){_0x225a1b['status'](0xcc)[_0xf8e3('0x1b')]();});}};}function handleEntityNotFound(_0x2fc674,_0x3373ca){return function(_0x417b42){if(!_0x417b42){_0x2fc674[_0xf8e3('0x1a')](0x194);}return _0x417b42;};}function handleError(_0x3b41a1,_0x2963ed){_0x2963ed=_0x2963ed||0x1f4;return function(_0x157a2d){logger['error'](_0x157a2d[_0xf8e3('0x2a')]);if(_0x157a2d[_0xf8e3('0x2b')]){delete _0x157a2d[_0xf8e3('0x2b')];}_0x3b41a1[_0xf8e3('0x1c')](_0x2963ed)[_0xf8e3('0x2c')](_0x157a2d);};}exports[_0xf8e3('0x2d')]=function(_0x16485e,_0xfaf15d){var _0x4f2ae9={},_0x21e1c0={},_0x243e28={'count':0x0,'rows':[]};var _0x492694=_[_0xf8e3('0x2e')](db['UserProfileResource'][_0xf8e3('0x2f')],function(_0x10cf28){return{'name':_0x10cf28[_0xf8e3('0x30')],'type':_0x10cf28[_0xf8e3('0x31')][_0xf8e3('0x32')]};});_0x21e1c0[_0xf8e3('0x33')]=_[_0xf8e3('0x2e')](_0x492694,_0xf8e3('0x2b'));_0x21e1c0['query']=_[_0xf8e3('0x34')](_0x16485e[_0xf8e3('0x35')]);_0x21e1c0['filters']=_['intersection'](_0x21e1c0['model'],_0x21e1c0[_0xf8e3('0x35')]);_0x4f2ae9['attributes']=_[_0xf8e3('0x36')](_0x21e1c0[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x16485e[_0xf8e3('0x35')]['fields']));_0x4f2ae9['attributes']=_0x4f2ae9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0x4f2ae9[_0xf8e3('0x38')]:_0x21e1c0[_0xf8e3('0x33')];if(!_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x3a')]('nolimit')){_0x4f2ae9[_0xf8e3('0x1e')]=qs['limit'](_0x16485e['query'][_0xf8e3('0x1e')]);_0x4f2ae9[_0xf8e3('0x20')]=qs[_0xf8e3('0x20')](_0x16485e[_0xf8e3('0x35')]['offset']);}_0x4f2ae9['order']=qs[_0xf8e3('0x3b')](_0x16485e[_0xf8e3('0x35')]['sort']);_0x4f2ae9[_0xf8e3('0x3c')]=qs[_0xf8e3('0x3d')](_[_0xf8e3('0x3e')](_0x16485e[_0xf8e3('0x35')],_0x21e1c0['filters']),_0x492694);if(_0x16485e['query']['filter']){_0x4f2ae9[_0xf8e3('0x3c')]=_[_0xf8e3('0x3f')](_0x4f2ae9[_0xf8e3('0x3c')],{'$or':_[_0xf8e3('0x2e')](_0x492694,function(_0x53160a){if(_0x53160a[_0xf8e3('0x31')]!=='VIRTUAL'){var _0x20909b={};_0x20909b[_0x53160a[_0xf8e3('0x2b')]]={'$like':'%'+_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x40')]+'%'};return _0x20909b;}})});}_0x4f2ae9=_[_0xf8e3('0x3f')]({},_0x4f2ae9,_0x16485e[_0xf8e3('0x41')]);var _0x82e778={'where':_0x4f2ae9[_0xf8e3('0x3c')]};return db[_0xf8e3('0x42')]['count'](_0x82e778)[_0xf8e3('0x29')](function(_0x537089){_0x243e28[_0xf8e3('0x1f')]=_0x537089;if(_0x16485e[_0xf8e3('0x35')][_0xf8e3('0x43')]){_0x4f2ae9[_0xf8e3('0x44')]=[{'all':!![]}];}return db[_0xf8e3('0x42')][_0xf8e3('0x45')](_0x4f2ae9);})[_0xf8e3('0x29')](function(_0x2f05b7){_0x243e28['rows']=_0x2f05b7;return _0x243e28;})[_0xf8e3('0x29')](respondWithFilteredResult(_0xfaf15d,_0x4f2ae9))[_0xf8e3('0x46')](handleError(_0xfaf15d,null));};exports[_0xf8e3('0x47')]=function(_0x382dbb,_0x6dd110){var _0xe7fcb9={'raw':![],'where':{'id':_0x382dbb[_0xf8e3('0x48')]['id']}},_0x792190={};_0x792190['model']=_['keys'](db['UserProfileResource'][_0xf8e3('0x2f')]);_0x792190[_0xf8e3('0x35')]=_['keys'](_0x382dbb[_0xf8e3('0x35')]);_0x792190['filters']=_[_0xf8e3('0x36')](_0x792190[_0xf8e3('0x33')],_0x792190['query']);_0xe7fcb9[_0xf8e3('0x38')]=_['intersection'](_0x792190[_0xf8e3('0x33')],qs[_0xf8e3('0x37')](_0x382dbb['query'][_0xf8e3('0x37')]));_0xe7fcb9[_0xf8e3('0x38')]=_0xe7fcb9[_0xf8e3('0x38')][_0xf8e3('0x39')]?_0xe7fcb9['attributes']:_0x792190['model'];if(_0x382dbb['query'][_0xf8e3('0x43')]){_0xe7fcb9[_0xf8e3('0x44')]=[{'all':!![]}];}_0xe7fcb9=_[_0xf8e3('0x3f')]({},_0xe7fcb9,_0x382dbb['options']);return db[_0xf8e3('0x42')]['find'](_0xe7fcb9)[_0xf8e3('0x29')](handleEntityNotFound(_0x6dd110,null))[_0xf8e3('0x29')](respondWithResult(_0x6dd110,null))['catch'](handleError(_0x6dd110,null));};exports['create']=function(_0x128234,_0x2939e6){return db[_0xf8e3('0x42')][_0xf8e3('0x49')](_0x128234[_0xf8e3('0x4a')],{})[_0xf8e3('0x29')](respondWithResult(_0x2939e6,0xc9))[_0xf8e3('0x46')](handleError(_0x2939e6,null));};exports[_0xf8e3('0x27')]=function(_0xdc2430,_0x81898e){if(_0xdc2430[_0xf8e3('0x4a')]['id']){delete _0xdc2430['body']['id'];}return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0xdc2430[_0xf8e3('0x48')]['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x81898e,null))[_0xf8e3('0x29')](saveUpdates(_0xdc2430[_0xf8e3('0x4a')],null))['then'](respondWithResult(_0x81898e,null))[_0xf8e3('0x46')](handleError(_0x81898e,null));};exports[_0xf8e3('0x28')]=function(_0x39caae,_0x3e60a6){return db[_0xf8e3('0x42')][_0xf8e3('0x4b')]({'where':{'id':_0x39caae['params']['id']}})[_0xf8e3('0x29')](handleEntityNotFound(_0x3e60a6,null))[_0xf8e3('0x29')](removeEntity(_0x3e60a6,null))[_0xf8e3('0x46')](handleError(_0x3e60a6,null));};exports[_0xf8e3('0x4c')]=function(_0x113404,_0x2fef16){return db['UserProfileResource'][_0xf8e3('0x4c')]()[_0xf8e3('0x29')](respondWithResult(_0x2fef16,null))[_0xf8e3('0x46')](handleError(_0x2fef16,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 17bf411..f384be3 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 _0xc79c=['rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0xc79c,0x89));var _0xcc79=function(_0x59cda0,_0x23471b){_0x59cda0=_0x59cda0-0x0;var _0xe8f9cf=_0xc79c[_0x59cda0];return _0xe8f9cf;};'use strict';var _=require(_0xcc79('0x0'));var util=require('util');var logger=require(_0xcc79('0x1'))(_0xcc79('0x2'));var moment=require(_0xcc79('0x3'));var BPromise=require(_0xcc79('0x4'));var rp=require(_0xcc79('0x5'));var fs=require('fs');var path=require(_0xcc79('0x6'));var rimraf=require(_0xcc79('0x7'));var config=require(_0xcc79('0x8'));var attributes=require(_0xcc79('0x9'));module[_0xcc79('0xa')]=function(_0x3c4be4,_0x4bd010){return _0x3c4be4[_0xcc79('0xb')](_0xcc79('0xc'),attributes,{'tableName':_0xcc79('0xd'),'paranoid':![],'indexes':[{'name':_0xcc79('0xe'),'fields':['resourceId',_0xcc79('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x229a=['exports','UserProfileResource','resourceId','sectionId','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4f9fe8,_0x3c5524){var _0x188463=function(_0x2a0929){while(--_0x2a0929){_0x4f9fe8['push'](_0x4f9fe8['shift']());}};_0x188463(++_0x3c5524);}(_0x229a,0xd5));var _0xa229=function(_0x493c9d,_0x555253){_0x493c9d=_0x493c9d-0x0;var _0x2a924c=_0x229a[_0x493c9d];return _0x2a924c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa229('0x0'));var moment=require(_0xa229('0x1'));var BPromise=require(_0xa229('0x2'));var rp=require(_0xa229('0x3'));var fs=require('fs');var path=require(_0xa229('0x4'));var rimraf=require(_0xa229('0x5'));var config=require(_0xa229('0x6'));var attributes=require('./userProfileResource.attributes');module[_0xa229('0x7')]=function(_0x36b64a,_0x2e0df5){return _0x36b64a['define'](_0xa229('0x8'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xa229('0x9'),_0xa229('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 0b8fc96..68923bf 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 _0xe709=['http','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x5a8316,_0x36874b){var _0x325d0b=function(_0x1ea7c5){while(--_0x1ea7c5){_0x5a8316['push'](_0x5a8316['shift']());}};_0x325d0b(++_0x36874b);}(_0xe709,0x1cc));var _0x9e70=function(_0x1f763a,_0x4ee000){_0x1f763a=_0x1f763a-0x0;var _0x1bf405=_0xe709[_0x1f763a];return _0x1bf405;};'use strict';var _=require(_0x9e70('0x0'));var util=require(_0x9e70('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9e70('0x2'));var fs=require('fs');var Redis=require(_0x9e70('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e70('0x4'));var logger=require('../../config/logger')(_0x9e70('0x5'));var config=require('../../config/environment');var jayson=require(_0x9e70('0x6'));var client=jayson[_0x9e70('0x7')][_0x9e70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6693dd,_0x15a5f8,_0x4b7c6d){return new BPromise(function(_0x5dea4a,_0x14ef00){return client['request'](_0x6693dd,_0x4b7c6d)[_0x9e70('0x9')](function(_0x4152de){logger[_0x9e70('0xa')](_0x9e70('0xb'),_0x15a5f8,'request\x20sent');logger[_0x9e70('0xc')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x15a5f8,_0x9e70('0xd'),JSON[_0x9e70('0xe')](_0x4152de));if(_0x4152de[_0x9e70('0xf')]){if(_0x4152de[_0x9e70('0xf')]['code']===0x1f4){logger[_0x9e70('0xf')](_0x9e70('0xb'),_0x15a5f8,_0x4152de[_0x9e70('0xf')][_0x9e70('0x10')]);return _0x14ef00(_0x4152de[_0x9e70('0xf')][_0x9e70('0x10')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x15a5f8,_0x4152de[_0x9e70('0xf')]['message']);return _0x5dea4a(_0x4152de[_0x9e70('0xf')][_0x9e70('0x10')]);}else{logger['info'](_0x9e70('0xb'),_0x15a5f8,_0x9e70('0xd'));_0x5dea4a(_0x4152de[_0x9e70('0x11')]['message']);}})['catch'](function(_0x298778){logger[_0x9e70('0xf')](_0x9e70('0xb'),_0x15a5f8,_0x298778);_0x14ef00(_0x298778);});});} \ No newline at end of file +var _0x35e6=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0xf6f6d9,_0x32e950){var _0x55b36b=function(_0x4423f1){while(--_0x4423f1){_0xf6f6d9['push'](_0xf6f6d9['shift']());}};_0x55b36b(++_0x32e950);}(_0x35e6,0x192));var _0x635e=function(_0x527e09,_0x3f042f){_0x527e09=_0x527e09-0x0;var _0xe432cb=_0x35e6[_0x527e09];return _0xe432cb;};'use strict';var _=require(_0x635e('0x0'));var util=require(_0x635e('0x1'));var moment=require('moment');var BPromise=require(_0x635e('0x2'));var rs=require(_0x635e('0x3'));var fs=require('fs');var Redis=require(_0x635e('0x4'));var db=require(_0x635e('0x5'))['db'];var utils=require(_0x635e('0x6'));var logger=require(_0x635e('0x7'))('rpc');var config=require(_0x635e('0x8'));var jayson=require(_0x635e('0x9'));var client=jayson[_0x635e('0xa')][_0x635e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd2b6,_0xc46f99,_0xc81644){return new BPromise(function(_0x55ed30,_0x27913c){return client['request'](_0x2dd2b6,_0xc81644)[_0x635e('0xc')](function(_0x100acc){logger[_0x635e('0xd')](_0x635e('0xe'),_0xc46f99,_0x635e('0xf'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0xc46f99,'request\x20sent',JSON[_0x635e('0x10')](_0x100acc));if(_0x100acc[_0x635e('0x11')]){if(_0x100acc[_0x635e('0x11')][_0x635e('0x12')]===0x1f4){logger[_0x635e('0x11')](_0x635e('0xe'),_0xc46f99,_0x100acc['error']['message']);return _0x27913c(_0x100acc[_0x635e('0x11')][_0x635e('0x13')]);}logger['error'](_0x635e('0xe'),_0xc46f99,_0x100acc[_0x635e('0x11')][_0x635e('0x13')]);return _0x55ed30(_0x100acc[_0x635e('0x11')][_0x635e('0x13')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0xc46f99,_0x635e('0xf'));_0x55ed30(_0x100acc[_0x635e('0x14')]['message']);}})[_0x635e('0x15')](function(_0xa7e0fb){logger[_0x635e('0x11')]('UserProfileResource,\x20%s,\x20%s',_0xc46f99,_0xa7e0fb);_0x27913c(_0xa7e0fb);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 991193f..a04fed1 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 _0x0b2c=['express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','multer','util','path','connect-timeout'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x0b2c,0x18c));var _0xc0b2=function(_0x1c2186,_0x17eef7){_0x1c2186=_0x1c2186-0x0;var _0x109c8a=_0x0b2c[_0x1c2186];return _0x109c8a;};'use strict';var multer=require(_0xc0b2('0x0'));var util=require(_0xc0b2('0x1'));var path=require(_0xc0b2('0x2'));var timeout=require(_0xc0b2('0x3'));var express=require(_0xc0b2('0x4'));var router=express[_0xc0b2('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0b2('0x6'));var config=require(_0xc0b2('0x7'));var controller=require(_0xc0b2('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc0b2('0x9')]);router[_0xc0b2('0xa')](_0xc0b2('0xb'),auth[_0xc0b2('0xc')](),controller[_0xc0b2('0xd')]);router[_0xc0b2('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc0b2('0xe')]('/',auth[_0xc0b2('0xc')](),controller[_0xc0b2('0xf')]);router[_0xc0b2('0x10')](_0xc0b2('0x11'),auth['isAuthenticated'](),controller[_0xc0b2('0x12')]);router[_0xc0b2('0x13')](_0xc0b2('0x11'),auth[_0xc0b2('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x894b=['get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./userProfileSection.controller','index'];(function(_0x612267,_0x363a1f){var _0x46b502=function(_0x32791a){while(--_0x32791a){_0x612267['push'](_0x612267['shift']());}};_0x46b502(++_0x363a1f);}(_0x894b,0x10f));var _0xb894=function(_0x307e15,_0x2d1c7a){_0x307e15=_0x307e15-0x0;var _0x1e202c=_0x894b[_0x307e15];return _0x1e202c;};'use strict';var multer=require(_0xb894('0x0'));var util=require(_0xb894('0x1'));var path=require(_0xb894('0x2'));var timeout=require('connect-timeout');var express=require(_0xb894('0x3'));var router=express[_0xb894('0x4')]();var fs_extra=require(_0xb894('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb894('0x6'));var controller=require(_0xb894('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb894('0x8')]);router[_0xb894('0x9')]('/describe',auth[_0xb894('0xa')](),controller[_0xb894('0xb')]);router[_0xb894('0x9')](_0xb894('0xc'),auth['isAuthenticated'](),controller[_0xb894('0xd')]);router[_0xb894('0xe')]('/',auth[_0xb894('0xa')](),controller[_0xb894('0xf')]);router[_0xb894('0x10')]('/:id',auth[_0xb894('0xa')](),controller[_0xb894('0x11')]);router['delete'](_0xb894('0xc'),auth['isAuthenticated'](),controller[_0xb894('0x12')]);module[_0xb894('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index eb3e709..46a61df 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 _0x0b0e=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0xbfed7d,_0x5098c5){var _0x1d2fca=function(_0x24a177){while(--_0x24a177){_0xbfed7d['push'](_0xbfed7d['shift']());}};_0x1d2fca(++_0x5098c5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x0b0e[_0x378720];return _0x47920a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe0b0('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe0b0('0x1')],'set':function(_0x28040c){this[_0xe0b0('0x4')](_0xe0b0('0x5'),_0x28040c?_0x28040c[_0xe0b0('0x6')](''):[]);},'get':function(){return this[_0xe0b0('0x7')](_0xe0b0('0x5'))?this[_0xe0b0('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file +var _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x4f98c3,_0x3d107f){var _0x13ad99=function(_0x15826f){while(--_0x15826f){_0x4f98c3['push'](_0x4f98c3['shift']());}};_0x13ad99(++_0x3d107f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e1bb554..41d73a0 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 _0x4ff9=['find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','findAll','catch','params','include','options','create','body'];(function(_0x5d92b1,_0x2125b2){var _0x442728=function(_0x3faf16){while(--_0x3faf16){_0x5d92b1['push'](_0x5d92b1['shift']());}};_0x442728(++_0x2125b2);}(_0x4ff9,0x132));var _0x94ff=function(_0x211125,_0xdfd2df){_0x211125=_0x211125-0x0;var _0x3bccc2=_0x4ff9[_0x211125];return _0x3bccc2;};'use strict';var emlformat=require(_0x94ff('0x0'));var rimraf=require(_0x94ff('0x1'));var zipdir=require(_0x94ff('0x2'));var jsonpatch=require(_0x94ff('0x3'));var rp=require(_0x94ff('0x4'));var moment=require(_0x94ff('0x5'));var BPromise=require(_0x94ff('0x6'));var Mustache=require(_0x94ff('0x7'));var util=require(_0x94ff('0x8'));var path=require(_0x94ff('0x9'));var sox=require(_0x94ff('0xa'));var csv=require(_0x94ff('0xb'));var ejs=require(_0x94ff('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94ff('0xd'));var squel=require(_0x94ff('0xe'));var crypto=require(_0x94ff('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x94ff('0xb'));var querystring=require(_0x94ff('0x10'));var Papa=require(_0x94ff('0x11'));var Redis=require(_0x94ff('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x94ff('0x13'));var hardwareService=require(_0x94ff('0x14'));var logger=require(_0x94ff('0x15'))(_0x94ff('0x16'));var utils=require(_0x94ff('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x94ff('0x18'));var db=require(_0x94ff('0x19'))['db'];function respondWithStatusCode(_0xe809db,_0x5a2148){_0x5a2148=_0x5a2148||0xcc;return function(_0x2978ea){if(_0x2978ea){return _0xe809db[_0x94ff('0x1a')](_0x5a2148);}return _0xe809db[_0x94ff('0x1b')](_0x5a2148)[_0x94ff('0x1c')]();};}function respondWithResult(_0x56736c,_0x101378){_0x101378=_0x101378||0xc8;return function(_0x595d70){if(_0x595d70){return _0x56736c[_0x94ff('0x1b')](_0x101378)['json'](_0x595d70);}};}function respondWithFilteredResult(_0x270acd,_0x193b2e){return function(_0x3404de){if(_0x3404de){var _0x3fb30f=typeof _0x193b2e[_0x94ff('0x1d')]===_0x94ff('0x1e')&&typeof _0x193b2e['limit']===_0x94ff('0x1e');var _0x3474de=_0x3404de[_0x94ff('0x1f')];var _0x2a7b7d=_0x3fb30f?0x0:_0x193b2e[_0x94ff('0x1d')];var _0x533933=_0x3fb30f?_0x3404de[_0x94ff('0x1f')]:_0x193b2e[_0x94ff('0x1d')]+_0x193b2e['limit'];var _0x31c0f6;if(_0x533933>=_0x3474de){_0x533933=_0x3474de;_0x31c0f6=0xc8;}else{_0x31c0f6=0xce;}_0x270acd['status'](_0x31c0f6);return _0x270acd[_0x94ff('0x20')](_0x94ff('0x21'),_0x2a7b7d+'-'+_0x533933+'/'+_0x3474de)[_0x94ff('0x22')](_0x3404de);}return null;};}function patchUpdates(_0x38669a){return function(_0x4a9a06){try{jsonpatch['apply'](_0x4a9a06,_0x38669a,!![]);}catch(_0x368e90){return BPromise[_0x94ff('0x23')](_0x368e90);}return _0x4a9a06[_0x94ff('0x24')]();};}function saveUpdates(_0x3b870d,_0x5ed281){return function(_0x5c1d05){if(_0x5c1d05){return _0x5c1d05[_0x94ff('0x25')](_0x3b870d)[_0x94ff('0x26')](function(_0xcca30e){return _0xcca30e;});}return null;};}function removeEntity(_0x428bf4,_0x399ff5){return function(_0x59d4d5){if(_0x59d4d5){return _0x59d4d5[_0x94ff('0x27')]()[_0x94ff('0x26')](function(){_0x428bf4['status'](0xcc)[_0x94ff('0x1c')]();});}};}function handleEntityNotFound(_0x1a2b7e,_0x1d843b){return function(_0x558fbe){if(!_0x558fbe){_0x1a2b7e[_0x94ff('0x1a')](0x194);}return _0x558fbe;};}function handleError(_0x1d0e34,_0x54ccfd){_0x54ccfd=_0x54ccfd||0x1f4;return function(_0xd60d72){logger[_0x94ff('0x28')](_0xd60d72[_0x94ff('0x29')]);if(_0xd60d72[_0x94ff('0x2a')]){delete _0xd60d72[_0x94ff('0x2a')];}_0x1d0e34['status'](_0x54ccfd)[_0x94ff('0x2b')](_0xd60d72);};}exports[_0x94ff('0x2c')]=function(_0x48397e,_0x177e4b){var _0x2e8c8c={},_0x35c623={},_0x1e8506={'count':0x0,'rows':[]};var _0x1a7534=_[_0x94ff('0x2d')](db[_0x94ff('0x2e')][_0x94ff('0x2f')],function(_0x1a7df6){return{'name':_0x1a7df6[_0x94ff('0x30')],'type':_0x1a7df6['type']['key']};});_0x35c623['model']=_[_0x94ff('0x2d')](_0x1a7534,_0x94ff('0x2a'));_0x35c623[_0x94ff('0x31')]=_[_0x94ff('0x32')](_0x48397e[_0x94ff('0x31')]);_0x35c623[_0x94ff('0x33')]=_[_0x94ff('0x34')](_0x35c623[_0x94ff('0x35')],_0x35c623[_0x94ff('0x31')]);_0x2e8c8c[_0x94ff('0x36')]=_['intersection'](_0x35c623[_0x94ff('0x35')],qs[_0x94ff('0x37')](_0x48397e[_0x94ff('0x31')][_0x94ff('0x37')]));_0x2e8c8c[_0x94ff('0x36')]=_0x2e8c8c['attributes'][_0x94ff('0x38')]?_0x2e8c8c[_0x94ff('0x36')]:_0x35c623[_0x94ff('0x35')];if(!_0x48397e[_0x94ff('0x31')]['hasOwnProperty']('nolimit')){_0x2e8c8c[_0x94ff('0x39')]=qs['limit'](_0x48397e['query'][_0x94ff('0x39')]);_0x2e8c8c[_0x94ff('0x1d')]=qs['offset'](_0x48397e['query'][_0x94ff('0x1d')]);}_0x2e8c8c[_0x94ff('0x3a')]=qs[_0x94ff('0x3b')](_0x48397e['query']['sort']);_0x2e8c8c[_0x94ff('0x3c')]=qs['filters'](_[_0x94ff('0x3d')](_0x48397e[_0x94ff('0x31')],_0x35c623[_0x94ff('0x33')]),_0x1a7534);if(_0x48397e['query']['filter']){_0x2e8c8c['where']=_['merge'](_0x2e8c8c[_0x94ff('0x3c')],{'$or':_['map'](_0x1a7534,function(_0x25ccc9){if(_0x25ccc9[_0x94ff('0x3e')]!==_0x94ff('0x3f')){var _0xce9375={};_0xce9375[_0x25ccc9['name']]={'$like':'%'+_0x48397e[_0x94ff('0x31')][_0x94ff('0x40')]+'%'};return _0xce9375;}})});}_0x2e8c8c=_[_0x94ff('0x41')]({},_0x2e8c8c,_0x48397e['options']);var _0xefda72={'where':_0x2e8c8c[_0x94ff('0x3c')]};return db['UserProfileSection'][_0x94ff('0x1f')](_0xefda72)[_0x94ff('0x26')](function(_0x38ef9c){_0x1e8506[_0x94ff('0x1f')]=_0x38ef9c;if(_0x48397e[_0x94ff('0x31')][_0x94ff('0x42')]){_0x2e8c8c['include']=[{'all':!![]}];}return db[_0x94ff('0x2e')][_0x94ff('0x43')](_0x2e8c8c);})[_0x94ff('0x26')](function(_0x3015bb){_0x1e8506['rows']=_0x3015bb;return _0x1e8506;})['then'](respondWithFilteredResult(_0x177e4b,_0x2e8c8c))[_0x94ff('0x44')](handleError(_0x177e4b,null));};exports['show']=function(_0x105758,_0x87a6dd){var _0x20c237={'raw':![],'where':{'id':_0x105758[_0x94ff('0x45')]['id']}},_0x4538e4={};_0x4538e4[_0x94ff('0x35')]=_[_0x94ff('0x32')](db['UserProfileSection'][_0x94ff('0x2f')]);_0x4538e4['query']=_[_0x94ff('0x32')](_0x105758[_0x94ff('0x31')]);_0x4538e4[_0x94ff('0x33')]=_[_0x94ff('0x34')](_0x4538e4[_0x94ff('0x35')],_0x4538e4[_0x94ff('0x31')]);_0x20c237['attributes']=_['intersection'](_0x4538e4[_0x94ff('0x35')],qs[_0x94ff('0x37')](_0x105758['query'][_0x94ff('0x37')]));_0x20c237[_0x94ff('0x36')]=_0x20c237[_0x94ff('0x36')][_0x94ff('0x38')]?_0x20c237[_0x94ff('0x36')]:_0x4538e4[_0x94ff('0x35')];if(_0x105758['query'][_0x94ff('0x42')]){_0x20c237[_0x94ff('0x46')]=[{'all':!![]}];}_0x20c237=_[_0x94ff('0x41')]({},_0x20c237,_0x105758[_0x94ff('0x47')]);return db[_0x94ff('0x2e')]['find'](_0x20c237)['then'](handleEntityNotFound(_0x87a6dd,null))[_0x94ff('0x26')](respondWithResult(_0x87a6dd,null))[_0x94ff('0x44')](handleError(_0x87a6dd,null));};exports[_0x94ff('0x48')]=function(_0x29cf03,_0x405d5a){return db['UserProfileSection'][_0x94ff('0x48')](_0x29cf03[_0x94ff('0x49')],{})[_0x94ff('0x26')](respondWithResult(_0x405d5a,0xc9))[_0x94ff('0x44')](handleError(_0x405d5a,null));};exports[_0x94ff('0x25')]=function(_0x5020b0,_0x216a3f){if(_0x5020b0[_0x94ff('0x49')]['id']){delete _0x5020b0[_0x94ff('0x49')]['id'];}return db[_0x94ff('0x2e')][_0x94ff('0x4a')]({'where':{'id':_0x5020b0[_0x94ff('0x45')]['id']}})[_0x94ff('0x26')](handleEntityNotFound(_0x216a3f,null))['then'](saveUpdates(_0x5020b0[_0x94ff('0x49')],null))['then'](respondWithResult(_0x216a3f,null))['catch'](handleError(_0x216a3f,null));};exports[_0x94ff('0x27')]=function(_0x8ee990,_0x18beb7){return db[_0x94ff('0x2e')][_0x94ff('0x4a')]({'where':{'id':_0x8ee990[_0x94ff('0x45')]['id']}})[_0x94ff('0x26')](handleEntityNotFound(_0x18beb7,null))[_0x94ff('0x26')](removeEntity(_0x18beb7,null))[_0x94ff('0x44')](handleError(_0x18beb7,null));};exports[_0x94ff('0x4b')]=function(_0x336f7d,_0x350de3){return db[_0x94ff('0x2e')][_0x94ff('0x4b')]()[_0x94ff('0x26')](respondWithResult(_0x350de3,null))['catch'](handleError(_0x350de3,null));}; \ No newline at end of file +var _0x9220=['json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','map','UserProfileSection','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','rawAttributes','length','include','find','body','describe','eml-format','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1456c0,_0x25d8a3){var _0x40c06f=function(_0x358049){while(--_0x358049){_0x1456c0['push'](_0x1456c0['shift']());}};_0x40c06f(++_0x25d8a3);}(_0x9220,0x76));var _0x0922=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x9220[_0x616290];return _0x453879;};'use strict';var emlformat=require(_0x0922('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0922('0x1'));var rp=require(_0x0922('0x2'));var moment=require(_0x0922('0x3'));var BPromise=require(_0x0922('0x4'));var Mustache=require(_0x0922('0x5'));var util=require(_0x0922('0x6'));var path=require(_0x0922('0x7'));var sox=require(_0x0922('0x8'));var csv=require(_0x0922('0x9'));var ejs=require(_0x0922('0xa'));var fs=require('fs');var fs_extra=require(_0x0922('0xb'));var _=require(_0x0922('0xc'));var squel=require(_0x0922('0xd'));var crypto=require(_0x0922('0xe'));var jsforce=require(_0x0922('0xf'));var deskjs=require(_0x0922('0x10'));var toCsv=require(_0x0922('0x9'));var querystring=require(_0x0922('0x11'));var Papa=require(_0x0922('0x12'));var Redis=require('ioredis');var authService=require(_0x0922('0x13'));var qs=require(_0x0922('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0922('0x15'));var logger=require(_0x0922('0x16'))(_0x0922('0x17'));var utils=require(_0x0922('0x18'));var config=require(_0x0922('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0922('0x1a'))['db'];function respondWithStatusCode(_0x24c4e4,_0x5ce07c){_0x5ce07c=_0x5ce07c||0xcc;return function(_0x427812){if(_0x427812){return _0x24c4e4[_0x0922('0x1b')](_0x5ce07c);}return _0x24c4e4[_0x0922('0x1c')](_0x5ce07c)[_0x0922('0x1d')]();};}function respondWithResult(_0x21cdc9,_0x5d2b44){_0x5d2b44=_0x5d2b44||0xc8;return function(_0x56c664){if(_0x56c664){return _0x21cdc9[_0x0922('0x1c')](_0x5d2b44)[_0x0922('0x1e')](_0x56c664);}};}function respondWithFilteredResult(_0x91fb02,_0x6bf0a8){return function(_0x272d6e){if(_0x272d6e){var _0x381199=typeof _0x6bf0a8[_0x0922('0x1f')]===_0x0922('0x20')&&typeof _0x6bf0a8['limit']===_0x0922('0x20');var _0x2de932=_0x272d6e[_0x0922('0x21')];var _0x2628b5=_0x381199?0x0:_0x6bf0a8[_0x0922('0x1f')];var _0x53c423=_0x381199?_0x272d6e[_0x0922('0x21')]:_0x6bf0a8[_0x0922('0x1f')]+_0x6bf0a8['limit'];var _0x4015e4;if(_0x53c423>=_0x2de932){_0x53c423=_0x2de932;_0x4015e4=0xc8;}else{_0x4015e4=0xce;}_0x91fb02['status'](_0x4015e4);return _0x91fb02[_0x0922('0x22')](_0x0922('0x23'),_0x2628b5+'-'+_0x53c423+'/'+_0x2de932)[_0x0922('0x1e')](_0x272d6e);}return null;};}function patchUpdates(_0xe3e59c){return function(_0x1a2814){try{jsonpatch[_0x0922('0x24')](_0x1a2814,_0xe3e59c,!![]);}catch(_0x5ec491){return BPromise[_0x0922('0x25')](_0x5ec491);}return _0x1a2814[_0x0922('0x26')]();};}function saveUpdates(_0x47e42f,_0x5451f4){return function(_0x2efefd){if(_0x2efefd){return _0x2efefd['update'](_0x47e42f)['then'](function(_0x58f80e){return _0x58f80e;});}return null;};}function removeEntity(_0xefe1fb,_0x215325){return function(_0x28d1cb){if(_0x28d1cb){return _0x28d1cb[_0x0922('0x27')]()[_0x0922('0x28')](function(){_0xefe1fb[_0x0922('0x1c')](0xcc)[_0x0922('0x1d')]();});}};}function handleEntityNotFound(_0x4052ce,_0xd6c2d4){return function(_0x14057f){if(!_0x14057f){_0x4052ce[_0x0922('0x1b')](0x194);}return _0x14057f;};}function handleError(_0x570ed0,_0x5ea8ed){_0x5ea8ed=_0x5ea8ed||0x1f4;return function(_0xdac59){logger[_0x0922('0x29')](_0xdac59['stack']);if(_0xdac59[_0x0922('0x2a')]){delete _0xdac59[_0x0922('0x2a')];}_0x570ed0['status'](_0x5ea8ed)[_0x0922('0x2b')](_0xdac59);};}exports['index']=function(_0x467d26,_0x138e7e){var _0x2c7054={},_0x10defd={},_0x37276a={'count':0x0,'rows':[]};var _0x53f3ec=_[_0x0922('0x2c')](db[_0x0922('0x2d')]['rawAttributes'],function(_0x1f2862){return{'name':_0x1f2862['fieldName'],'type':_0x1f2862[_0x0922('0x2e')][_0x0922('0x2f')]};});_0x10defd[_0x0922('0x30')]=_[_0x0922('0x2c')](_0x53f3ec,_0x0922('0x2a'));_0x10defd['query']=_[_0x0922('0x31')](_0x467d26[_0x0922('0x32')]);_0x10defd[_0x0922('0x33')]=_['intersection'](_0x10defd['model'],_0x10defd['query']);_0x2c7054[_0x0922('0x34')]=_[_0x0922('0x35')](_0x10defd['model'],qs['fields'](_0x467d26[_0x0922('0x32')][_0x0922('0x36')]));_0x2c7054[_0x0922('0x34')]=_0x2c7054[_0x0922('0x34')]['length']?_0x2c7054[_0x0922('0x34')]:_0x10defd[_0x0922('0x30')];if(!_0x467d26[_0x0922('0x32')][_0x0922('0x37')]('nolimit')){_0x2c7054['limit']=qs['limit'](_0x467d26[_0x0922('0x32')][_0x0922('0x38')]);_0x2c7054[_0x0922('0x1f')]=qs[_0x0922('0x1f')](_0x467d26[_0x0922('0x32')]['offset']);}_0x2c7054['order']=qs[_0x0922('0x39')](_0x467d26[_0x0922('0x32')][_0x0922('0x39')]);_0x2c7054[_0x0922('0x3a')]=qs[_0x0922('0x33')](_[_0x0922('0x3b')](_0x467d26[_0x0922('0x32')],_0x10defd[_0x0922('0x33')]),_0x53f3ec);if(_0x467d26[_0x0922('0x32')][_0x0922('0x3c')]){_0x2c7054['where']=_[_0x0922('0x3d')](_0x2c7054['where'],{'$or':_[_0x0922('0x2c')](_0x53f3ec,function(_0x3ec9b0){if(_0x3ec9b0[_0x0922('0x2e')]!=='VIRTUAL'){var _0x46780b={};_0x46780b[_0x3ec9b0['name']]={'$like':'%'+_0x467d26['query']['filter']+'%'};return _0x46780b;}})});}_0x2c7054=_['merge']({},_0x2c7054,_0x467d26[_0x0922('0x3e')]);var _0x492eab={'where':_0x2c7054[_0x0922('0x3a')]};return db[_0x0922('0x2d')][_0x0922('0x21')](_0x492eab)[_0x0922('0x28')](function(_0x214b8c){_0x37276a['count']=_0x214b8c;if(_0x467d26[_0x0922('0x32')][_0x0922('0x3f')]){_0x2c7054['include']=[{'all':!![]}];}return db[_0x0922('0x2d')]['findAll'](_0x2c7054);})[_0x0922('0x28')](function(_0x171af0){_0x37276a[_0x0922('0x40')]=_0x171af0;return _0x37276a;})['then'](respondWithFilteredResult(_0x138e7e,_0x2c7054))[_0x0922('0x41')](handleError(_0x138e7e,null));};exports[_0x0922('0x42')]=function(_0x3a4de6,_0x1fbf04){var _0x514650={'raw':![],'where':{'id':_0x3a4de6[_0x0922('0x43')]['id']}},_0x1f1cc1={};_0x1f1cc1['model']=_[_0x0922('0x31')](db[_0x0922('0x2d')][_0x0922('0x44')]);_0x1f1cc1['query']=_['keys'](_0x3a4de6['query']);_0x1f1cc1[_0x0922('0x33')]=_[_0x0922('0x35')](_0x1f1cc1[_0x0922('0x30')],_0x1f1cc1[_0x0922('0x32')]);_0x514650['attributes']=_[_0x0922('0x35')](_0x1f1cc1[_0x0922('0x30')],qs['fields'](_0x3a4de6[_0x0922('0x32')][_0x0922('0x36')]));_0x514650[_0x0922('0x34')]=_0x514650['attributes'][_0x0922('0x45')]?_0x514650[_0x0922('0x34')]:_0x1f1cc1[_0x0922('0x30')];if(_0x3a4de6['query']['includeAll']){_0x514650[_0x0922('0x46')]=[{'all':!![]}];}_0x514650=_[_0x0922('0x3d')]({},_0x514650,_0x3a4de6[_0x0922('0x3e')]);return db[_0x0922('0x2d')][_0x0922('0x47')](_0x514650)[_0x0922('0x28')](handleEntityNotFound(_0x1fbf04,null))[_0x0922('0x28')](respondWithResult(_0x1fbf04,null))[_0x0922('0x41')](handleError(_0x1fbf04,null));};exports['create']=function(_0x759cc4,_0xb94b3d){return db[_0x0922('0x2d')]['create'](_0x759cc4[_0x0922('0x48')],{})['then'](respondWithResult(_0xb94b3d,0xc9))[_0x0922('0x41')](handleError(_0xb94b3d,null));};exports['update']=function(_0x178c1d,_0x577866){if(_0x178c1d[_0x0922('0x48')]['id']){delete _0x178c1d['body']['id'];}return db[_0x0922('0x2d')][_0x0922('0x47')]({'where':{'id':_0x178c1d['params']['id']}})[_0x0922('0x28')](handleEntityNotFound(_0x577866,null))['then'](saveUpdates(_0x178c1d[_0x0922('0x48')],null))[_0x0922('0x28')](respondWithResult(_0x577866,null))[_0x0922('0x41')](handleError(_0x577866,null));};exports['destroy']=function(_0x2c3d6c,_0x4106a2){return db['UserProfileSection'][_0x0922('0x47')]({'where':{'id':_0x2c3d6c[_0x0922('0x43')]['id']}})[_0x0922('0x28')](handleEntityNotFound(_0x4106a2,null))[_0x0922('0x28')](removeEntity(_0x4106a2,null))[_0x0922('0x41')](handleError(_0x4106a2,null));};exports['describe']=function(_0x5ccdbb,_0x4ba581){return db[_0x0922('0x2d')][_0x0922('0x49')]()[_0x0922('0x28')](respondWithResult(_0x4ba581,null))['catch'](handleError(_0x4ba581,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e21d68b..32e5f32 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 _0x71df=['UserProfileSection','userProfileId','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x71df,0x6a));var _0xf71d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf71d('0x0'));var util=require(_0xf71d('0x1'));var logger=require(_0xf71d('0x2'))(_0xf71d('0x3'));var moment=require('moment');var BPromise=require(_0xf71d('0x4'));var rp=require(_0xf71d('0x5'));var fs=require('fs');var path=require(_0xf71d('0x6'));var rimraf=require(_0xf71d('0x7'));var config=require(_0xf71d('0x8'));var attributes=require('./userProfileSection.attributes');module[_0xf71d('0x9')]=function(_0x1d421b,_0x16a08e){return _0x1d421b[_0xf71d('0xa')](_0xf71d('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId',_0xf71d('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x27d3=['api','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x4c8fd1,_0xc3a2ad){var _0x512295=function(_0x551268){while(--_0x551268){_0x4c8fd1['push'](_0x4c8fd1['shift']());}};_0x512295(++_0xc3a2ad);}(_0x27d3,0xa7));var _0x327d=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x27d3[_0x2112d4];return _0x434972;};'use strict';var _=require(_0x327d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x327d('0x1'));var moment=require(_0x327d('0x2'));var BPromise=require('bluebird');var rp=require(_0x327d('0x3'));var fs=require('fs');var path=require(_0x327d('0x4'));var rimraf=require(_0x327d('0x5'));var config=require(_0x327d('0x6'));var attributes=require(_0x327d('0x7'));module[_0x327d('0x8')]=function(_0x202a11,_0x130a43){return _0x202a11['define'](_0x327d('0x9'),attributes,{'tableName':_0x327d('0xa'),'paranoid':![],'indexes':[{'name':_0x327d('0xb'),'fields':[_0x327d('0xc'),_0x327d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 25563b2..f761ec9 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 _0x0946=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','result','lodash','bluebird'];(function(_0x594ece,_0x2a1f27){var _0x471bc4=function(_0x31941c){while(--_0x31941c){_0x594ece['push'](_0x594ece['shift']());}};_0x471bc4(++_0x2a1f27);}(_0x0946,0xf5));var _0x6094=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x0946[_0x2e913b];return _0x173899;};'use strict';var _=require(_0x6094('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6094('0x1'));var rs=require(_0x6094('0x2'));var fs=require('fs');var Redis=require(_0x6094('0x3'));var db=require(_0x6094('0x4'))['db'];var utils=require(_0x6094('0x5'));var logger=require(_0x6094('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6094('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x306a82,_0x483ece,_0x1700f5){return new BPromise(function(_0x401912,_0x306daf){return client['request'](_0x306a82,_0x1700f5)[_0x6094('0x8')](function(_0x9844f2){logger[_0x6094('0x9')]('UserProfileSection,\x20%s,\x20%s',_0x483ece,_0x6094('0xa'));logger[_0x6094('0xb')](_0x6094('0xc'),_0x483ece,_0x6094('0xa'),JSON[_0x6094('0xd')](_0x9844f2));if(_0x9844f2['error']){if(_0x9844f2[_0x6094('0xe')][_0x6094('0xf')]===0x1f4){logger[_0x6094('0xe')](_0x6094('0x10'),_0x483ece,_0x9844f2[_0x6094('0xe')][_0x6094('0x11')]);return _0x306daf(_0x9844f2[_0x6094('0xe')][_0x6094('0x11')]);}logger[_0x6094('0xe')](_0x6094('0x10'),_0x483ece,_0x9844f2[_0x6094('0xe')]['message']);return _0x401912(_0x9844f2['error'][_0x6094('0x11')]);}else{logger['info'](_0x6094('0x10'),_0x483ece,_0x6094('0xa'));_0x401912(_0x9844f2[_0x6094('0x12')][_0x6094('0x11')]);}})['catch'](function(_0x4ba8c5){logger[_0x6094('0xe')](_0x6094('0x10'),_0x483ece,_0x4ba8c5);_0x306daf(_0x4ba8c5);});});} \ No newline at end of file +var _0x63cb=['UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x63cb,0x158));var _0xb63c=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x63cb[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xb63c('0x0'));var util=require(_0xb63c('0x1'));var moment=require(_0xb63c('0x2'));var BPromise=require(_0xb63c('0x3'));var rs=require(_0xb63c('0x4'));var fs=require('fs');var Redis=require(_0xb63c('0x5'));var db=require(_0xb63c('0x6'))['db'];var utils=require(_0xb63c('0x7'));var logger=require(_0xb63c('0x8'))(_0xb63c('0x9'));var config=require(_0xb63c('0xa'));var jayson=require(_0xb63c('0xb'));var client=jayson[_0xb63c('0xc')][_0xb63c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5089c3,_0x2c061c,_0x501f9f){return new BPromise(function(_0xb80c53,_0x416bf2){return client[_0xb63c('0xe')](_0x5089c3,_0x501f9f)['then'](function(_0x27890e){logger[_0xb63c('0xf')](_0xb63c('0x10'),_0x2c061c,'request\x20sent');logger[_0xb63c('0x11')](_0xb63c('0x12'),_0x2c061c,_0xb63c('0x13'),JSON['stringify'](_0x27890e));if(_0x27890e[_0xb63c('0x14')]){if(_0x27890e['error'][_0xb63c('0x15')]===0x1f4){logger[_0xb63c('0x14')](_0xb63c('0x10'),_0x2c061c,_0x27890e[_0xb63c('0x14')][_0xb63c('0x16')]);return _0x416bf2(_0x27890e[_0xb63c('0x14')][_0xb63c('0x16')]);}logger[_0xb63c('0x14')](_0xb63c('0x10'),_0x2c061c,_0x27890e[_0xb63c('0x14')][_0xb63c('0x16')]);return _0xb80c53(_0x27890e[_0xb63c('0x14')][_0xb63c('0x16')]);}else{logger[_0xb63c('0xf')](_0xb63c('0x10'),_0x2c061c,_0xb63c('0x13'));_0xb80c53(_0x27890e['result'][_0xb63c('0x16')]);}})[_0xb63c('0x17')](function(_0x59b490){logger['error'](_0xb63c('0x10'),_0x2c061c,_0x59b490);_0x416bf2(_0x59b490);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c8cd18d..03c41be 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2e92c2,_0x381855){var _0x37105f=function(_0x33a8b0){while(--_0x33a8b0){_0x2e92c2['push'](_0x2e92c2['shift']());}};_0x37105f(++_0x381855);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x32b425,_0xad2119){var _0x2ed879=function(_0x1f5c7a){while(--_0x1f5c7a){_0x32b425['push'](_0x32b425['shift']());}};_0x2ed879(++_0xad2119);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e00270c..0415ca6 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 _0x090a=['INTEGER','exports'];(function(_0x3984e0,_0x2230da){var _0x31bc48=function(_0x3e38c1){while(--_0x3e38c1){_0x3984e0['push'](_0x3984e0['shift']());}};_0x31bc48(++_0x2230da);}(_0x090a,0xf3));var _0xa090=function(_0x547acc,_0xa242f3){_0x547acc=_0x547acc-0x0;var _0x57d92f=_0x090a[_0x547acc];return _0x57d92f;};'use strict';var Sequelize=require('sequelize');module[_0xa090('0x0')]={'penalty':{'type':Sequelize[_0xa090('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1b4e=['sequelize','exports','INTEGER'];(function(_0x2e0e96,_0x52a2dc){var _0x56c085=function(_0x416c63){while(--_0x416c63){_0x2e0e96['push'](_0x2e0e96['shift']());}};_0x56c085(++_0x52a2dc);}(_0x1b4e,0x1ad));var _0xe1b4=function(_0x3d2cd2,_0x554af7){_0x3d2cd2=_0x3d2cd2-0x0;var _0x3afdf6=_0x1b4e[_0x3d2cd2];return _0x3afdf6;};'use strict';var Sequelize=require(_0xe1b4('0x0'));module[_0xe1b4('0x1')]={'penalty':{'type':Sequelize[_0xe1b4('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 70e51e8..4bcad1f 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 _0xb511=['rimraf','../../config/environment','exports','define','UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb511,0x165));var _0x1b51=function(_0x4402fd,_0x17a258){_0x4402fd=_0x4402fd-0x0;var _0x27bc3b=_0xb511[_0x4402fd];return _0x27bc3b;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6455=['request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4e7ad4,_0x232fd2){var _0x57ef9e=function(_0x1a7edf){while(--_0x1a7edf){_0x4e7ad4['push'](_0x4e7ad4['shift']());}};_0x57ef9e(++_0x232fd2);}(_0x6455,0x97));var _0x5645=function(_0x1aa845,_0x555da5){_0x1aa845=_0x1aa845-0x0;var _0x550a3d=_0x6455[_0x1aa845];return _0x550a3d;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'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 dcbd126..971b077 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 _0xe0c9=['../../mysqldb','../../config/utils','jayson/promise','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0xe0c9,0x12c));var _0x9e0c=function(_0x390818,_0x4b49cf){_0x390818=_0x390818-0x0;var _0x3d532c=_0xe0c9[_0x390818];return _0x3d532c;};'use strict';var _=require(_0x9e0c('0x0'));var util=require('util');var moment=require(_0x9e0c('0x1'));var BPromise=require(_0x9e0c('0x2'));var rs=require(_0x9e0c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e0c('0x4'))['db'];var utils=require(_0x9e0c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9e0c('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a304e,_0x5a5d99,_0x1e228d){return new BPromise(function(_0x3c7754,_0x4e4a8c){return client[_0x9e0c('0x7')](_0x2a304e,_0x1e228d)[_0x9e0c('0x8')](function(_0x921d17){logger[_0x9e0c('0x9')](_0x9e0c('0xa'),_0x5a5d99,_0x9e0c('0xb'));logger[_0x9e0c('0xc')](_0x9e0c('0xd'),_0x5a5d99,'request\x20sent',JSON[_0x9e0c('0xe')](_0x921d17));if(_0x921d17['error']){if(_0x921d17[_0x9e0c('0xf')][_0x9e0c('0x10')]===0x1f4){logger[_0x9e0c('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x5a5d99,_0x921d17[_0x9e0c('0xf')][_0x9e0c('0x11')]);return _0x4e4a8c(_0x921d17[_0x9e0c('0xf')]['message']);}logger['error'](_0x9e0c('0xa'),_0x5a5d99,_0x921d17[_0x9e0c('0xf')][_0x9e0c('0x11')]);return _0x3c7754(_0x921d17[_0x9e0c('0xf')]['message']);}else{logger[_0x9e0c('0x9')](_0x9e0c('0xa'),_0x5a5d99,_0x9e0c('0xb'));_0x3c7754(_0x921d17[_0x9e0c('0x12')][_0x9e0c('0x11')]);}})['catch'](function(_0x4ff23b){logger[_0x9e0c('0xf')](_0x9e0c('0xa'),_0x5a5d99,_0x4ff23b);_0x4e4a8c(_0x4ff23b);});});} \ No newline at end of file +var _0x581d=['client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x581d,0x66));var _0xd581=function(_0x47e4be,_0x31e514){_0x47e4be=_0x47e4be-0x0;var _0xefd11=_0x581d[_0x47e4be];return _0xefd11;};'use strict';var _=require(_0xd581('0x0'));var util=require(_0xd581('0x1'));var moment=require('moment');var BPromise=require(_0xd581('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd581('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd581('0x4'));var logger=require(_0xd581('0x5'))('rpc');var config=require(_0xd581('0x6'));var jayson=require(_0xd581('0x7'));var client=jayson[_0xd581('0x8')][_0xd581('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f699f,_0x2bc5a1,_0x5021c3){return new BPromise(function(_0x19eb51,_0x4700b6){return client[_0xd581('0xa')](_0x4f699f,_0x5021c3)['then'](function(_0x44f90e){logger[_0xd581('0xb')](_0xd581('0xc'),_0x2bc5a1,_0xd581('0xd'));logger[_0xd581('0xe')](_0xd581('0xf'),_0x2bc5a1,_0xd581('0xd'),JSON[_0xd581('0x10')](_0x44f90e));if(_0x44f90e[_0xd581('0x11')]){if(_0x44f90e[_0xd581('0x11')][_0xd581('0x12')]===0x1f4){logger[_0xd581('0x11')](_0xd581('0xc'),_0x2bc5a1,_0x44f90e[_0xd581('0x11')]['message']);return _0x4700b6(_0x44f90e[_0xd581('0x11')][_0xd581('0x13')]);}logger['error'](_0xd581('0xc'),_0x2bc5a1,_0x44f90e[_0xd581('0x11')][_0xd581('0x13')]);return _0x19eb51(_0x44f90e[_0xd581('0x11')]['message']);}else{logger[_0xd581('0xb')](_0xd581('0xc'),_0x2bc5a1,_0xd581('0xd'));_0x19eb51(_0x44f90e[_0xd581('0x14')][_0xd581('0x13')]);}})[_0xd581('0x15')](function(_0x2565e3){logger[_0xd581('0x11')](_0xd581('0xc'),_0x2bc5a1,_0x2565e3);_0x4700b6(_0x2565e3);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2c18788..39b28af 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 _0x5ec4=['sequelize'];(function(_0x127cb6,_0x1eebf1){var _0x19a8e4=function(_0x420761){while(--_0x420761){_0x127cb6['push'](_0x127cb6['shift']());}};_0x19a8e4(++_0x1eebf1);}(_0x5ec4,0x1e8));var _0x45ec=function(_0x233e5a,_0x446c1e){_0x233e5a=_0x233e5a-0x0;var _0x236256=_0x5ec4[_0x233e5a];return _0x236256;};'use strict';var Sequelize=require(_0x45ec('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x918b=['exports','INTEGER'];(function(_0x4bfc9f,_0x3635d8){var _0x22627f=function(_0x1e2aaf){while(--_0x1e2aaf){_0x4bfc9f['push'](_0x4bfc9f['shift']());}};_0x22627f(++_0x3635d8);}(_0x918b,0x1dc));var _0xb918=function(_0x1c31f4,_0x8e8aeb){_0x1c31f4=_0x1c31f4-0x0;var _0x5a3f66=_0x918b[_0x1c31f4];return _0x5a3f66;};'use strict';var Sequelize=require('sequelize');module[_0xb918('0x0')]={'UserId':{'type':Sequelize[_0xb918('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 353b9eb..c6622f8 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(_0x302398,_0x485eb1){var _0x2a9515=function(_0x2a3791){while(--_0x2a3791){_0x302398['push'](_0x302398['shift']());}};_0x2a9515(++_0x485eb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x4820df,_0x158dd4){var _0x8886ae=function(_0x425dda){while(--_0x425dda){_0x4820df['push'](_0x4820df['shift']());}};_0x8886ae(++_0x158dd4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'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 ecc82b9..4a13ecf 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x23b9ef,_0x3aaf51){var _0x2c7cf6=function(_0x295dc2){while(--_0x295dc2){_0x23b9ef['push'](_0x23b9ef['shift']());}};_0x2c7cf6(++_0x3aaf51);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x15fb4d,_0x37b59f){var _0x2d49ca=function(_0x1b9512){while(--_0x1b9512){_0x15fb4d['push'](_0x15fb4d['shift']());}};_0x2d49ca(++_0x37b59f);}(_0xe706,0xa3));var _0x6e70=function(_0x2cf818,_0x1cd613){_0x2cf818=_0x2cf818-0x0;var _0x4c1fc7=_0xe706[_0x2cf818];return _0x4c1fc7;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ef519c3..d0e52c0 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 _0xe321=['INTEGER','sequelize','exports'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xe321,0x100));var _0x1e32=function(_0x305dd9,_0x512697){_0x305dd9=_0x305dd9-0x0;var _0x20a140=_0xe321[_0x305dd9];return _0x20a140;};'use strict';var Sequelize=require(_0x1e32('0x0'));module[_0x1e32('0x1')]={'penalty':{'type':Sequelize[_0x1e32('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4917=['INTEGER'];(function(_0x22bd5e,_0x316e73){var _0x3b5777=function(_0x453249){while(--_0x453249){_0x22bd5e['push'](_0x22bd5e['shift']());}};_0x3b5777(++_0x316e73);}(_0x4917,0x141));var _0x7491=function(_0x464a17,_0x463917){_0x464a17=_0x464a17-0x0;var _0x236b0e=_0x4917[_0x464a17];return _0x236b0e;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x7491('0x0')],'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 6c9a9aa..9d00676 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 _0xa6eb=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6eb,0x154));var _0xba6e=function(_0x595029,_0x53e1e6){_0x595029=_0x595029-0x0;var _0x3a9ecd=_0xa6eb[_0x595029];return _0x3a9ecd;};'use strict';var _=require(_0xba6e('0x0'));var util=require(_0xba6e('0x1'));var logger=require(_0xba6e('0x2'))(_0xba6e('0x3'));var moment=require(_0xba6e('0x4'));var BPromise=require(_0xba6e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba6e('0x6'));var rimraf=require('rimraf');var config=require(_0xba6e('0x7'));var attributes=require(_0xba6e('0x8'));module['exports']=function(_0x314db8,_0x507898){return _0x314db8['define'](_0xba6e('0x9'),attributes,{'tableName':_0xba6e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47dc=['request-promise','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','bluebird'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x47dc,0x10a));var _0xc47d=function(_0x41b5cb,_0x4e8d48){_0x41b5cb=_0x41b5cb-0x0;var _0x407c26=_0x47dc[_0x41b5cb];return _0x407c26;};'use strict';var _=require('lodash');var util=require(_0xc47d('0x0'));var logger=require(_0xc47d('0x1'))(_0xc47d('0x2'));var moment=require('moment');var BPromise=require(_0xc47d('0x3'));var rp=require(_0xc47d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc47d('0x5'));var attributes=require(_0xc47d('0x6'));module[_0xc47d('0x7')]=function(_0x3fc58d,_0xb9e972){return _0x3fc58d['define'](_0xc47d('0x8'),attributes,{'tableName':_0xc47d('0x9'),'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 43d2cc9..763df2d 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 _0xa583=['debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0xa583,0xbb));var _0x3a58=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa583[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x3a58('0x0'));var util=require('util');var moment=require(_0x3a58('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a58('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3a58('0x3'));var logger=require(_0x3a58('0x4'))('rpc');var config=require(_0x3a58('0x5'));var jayson=require(_0x3a58('0x6'));var client=jayson['client'][_0x3a58('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4c425b,_0x21afb7,_0x34d681){return new BPromise(function(_0x221935,_0x16a739){return client[_0x3a58('0x8')](_0x4c425b,_0x34d681)[_0x3a58('0x9')](function(_0x31c433){logger[_0x3a58('0xa')](_0x3a58('0xb'),_0x21afb7,_0x3a58('0xc'));logger[_0x3a58('0xd')](_0x3a58('0xe'),_0x21afb7,_0x3a58('0xc'),JSON['stringify'](_0x31c433));if(_0x31c433[_0x3a58('0xf')]){if(_0x31c433[_0x3a58('0xf')][_0x3a58('0x10')]===0x1f4){logger['error'](_0x3a58('0xb'),_0x21afb7,_0x31c433[_0x3a58('0xf')][_0x3a58('0x11')]);return _0x16a739(_0x31c433['error'][_0x3a58('0x11')]);}logger[_0x3a58('0xf')](_0x3a58('0xb'),_0x21afb7,_0x31c433[_0x3a58('0xf')]['message']);return _0x221935(_0x31c433[_0x3a58('0xf')][_0x3a58('0x11')]);}else{logger['info'](_0x3a58('0xb'),_0x21afb7,_0x3a58('0xc'));_0x221935(_0x31c433[_0x3a58('0x12')][_0x3a58('0x11')]);}})[_0x3a58('0x13')](function(_0x1d292b){logger[_0x3a58('0xf')](_0x3a58('0xb'),_0x21afb7,_0x1d292b);_0x16a739(_0x1d292b);});});} \ No newline at end of file +var _0x63f9=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message'];(function(_0x50ed15,_0x1581d4){var _0x473226=function(_0xe8235b){while(--_0xe8235b){_0x50ed15['push'](_0x50ed15['shift']());}};_0x473226(++_0x1581d4);}(_0x63f9,0x161));var _0x963f=function(_0x509773,_0x12434e){_0x509773=_0x509773-0x0;var _0x194f82=_0x63f9[_0x509773];return _0x194f82;};'use strict';var _=require(_0x963f('0x0'));var util=require('util');var moment=require(_0x963f('0x1'));var BPromise=require(_0x963f('0x2'));var rs=require(_0x963f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x963f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x963f('0x5'));var config=require(_0x963f('0x6'));var jayson=require(_0x963f('0x7'));var client=jayson[_0x963f('0x8')][_0x963f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d3fbb,_0x78eca7,_0x57725e){return new BPromise(function(_0xff9ee4,_0x137aa0){return client[_0x963f('0xa')](_0x3d3fbb,_0x57725e)[_0x963f('0xb')](function(_0x37be2e){logger[_0x963f('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x78eca7,_0x963f('0xd'));logger[_0x963f('0xe')](_0x963f('0xf'),_0x78eca7,_0x963f('0xd'),JSON[_0x963f('0x10')](_0x37be2e));if(_0x37be2e['error']){if(_0x37be2e[_0x963f('0x11')][_0x963f('0x12')]===0x1f4){logger['error'](_0x963f('0x13'),_0x78eca7,_0x37be2e['error'][_0x963f('0x14')]);return _0x137aa0(_0x37be2e[_0x963f('0x11')]['message']);}logger[_0x963f('0x11')](_0x963f('0x13'),_0x78eca7,_0x37be2e[_0x963f('0x11')]['message']);return _0xff9ee4(_0x37be2e[_0x963f('0x11')][_0x963f('0x14')]);}else{logger['info'](_0x963f('0x13'),_0x78eca7,_0x963f('0xd'));_0xff9ee4(_0x37be2e['result'][_0x963f('0x14')]);}})[_0x963f('0x15')](function(_0x1e5fb7){logger['error'](_0x963f('0x13'),_0x78eca7,_0x1e5fb7);_0x137aa0(_0x1e5fb7);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index bef0f58..597f7ef 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x19e46e,_0x1682a1){var _0x5e9c0c=function(_0x47d27b){while(--_0x47d27b){_0x19e46e['push'](_0x19e46e['shift']());}};_0x5e9c0c(++_0x1682a1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xcb91[_0x352e09];return _0x1b7094;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4ce35c,_0x308e76){var _0x4eac15=function(_0x5ae7b0){while(--_0x5ae7b0){_0x4ce35c['push'](_0x4ce35c['shift']());}};_0x4eac15(++_0x308e76);}(_0x70e0,0x17b));var _0x070e=function(_0x551b6f,_0x5bf136){_0x551b6f=_0x551b6f-0x0;var _0x5ccb20=_0x70e0[_0x551b6f];return _0x5ccb20;};'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 2326fa5..66a6148 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 _0x24e0=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x1392dd,_0x110510){var _0x5be451=function(_0x2e1f70){while(--_0x2e1f70){_0x1392dd['push'](_0x1392dd['shift']());}};_0x5be451(++_0x110510);}(_0x24e0,0xe8));var _0x024e=function(_0x4ee3a1,_0x11a38c){_0x4ee3a1=_0x4ee3a1-0x0;var _0x538821=_0x24e0[_0x4ee3a1];return _0x538821;};'use strict';var Sequelize=require(_0x024e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x024e('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x024e('0x2')},'membername':{'type':Sequelize[_0x024e('0x3')],'allowNull':![],'comment':_0x024e('0x2')},'UserId':{'type':Sequelize[_0x024e('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x024e('0x4'),'comment':_0x024e('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x024e('0x3')],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x024e('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x024e('0x1')](0xb),'defaultValue':0x0,'comment':_0x024e('0x2')}}; \ No newline at end of file +var _0x501b=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x501b,0xd2));var _0xb501=function(_0x719235,_0x41971c){_0x719235=_0x719235-0x0;var _0x48c54c=_0x501b[_0x719235];return _0x48c54c;};'use strict';var Sequelize=require(_0xb501('0x0'));module[_0xb501('0x1')]={'uniqueid':{'type':Sequelize[_0xb501('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xb501('0x3')},'membername':{'type':Sequelize[_0xb501('0x4')],'allowNull':![],'comment':_0xb501('0x3')},'UserId':{'type':Sequelize[_0xb501('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xb501('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xb501('0x3')},'VoiceQueueId':{'type':Sequelize[_0xb501('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xb501('0x4')],'allowNull':![],'unique':_0xb501('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xb501('0x2')](0xb),'defaultValue':0x0,'comment':_0xb501('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xb501('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 3781ad5..89272f2 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 _0xf2e4=['update','emit','hasOwnProperty','hook','events','UserVoiceQueueRt','save'];(function(_0x538460,_0x350ff4){var _0x15e57c=function(_0x1dd909){while(--_0x1dd909){_0x538460['push'](_0x538460['shift']());}};_0x15e57c(++_0x350ff4);}(_0xf2e4,0x13f));var _0x4f2e=function(_0x2f25fe,_0x17cb7a){_0x2f25fe=_0x2f25fe-0x0;var _0x2bd94f=_0xf2e4[_0x2f25fe];return _0x2bd94f;};'use strict';var EventEmitter=require(_0x4f2e('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x4f2e('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f2e('0x2'),'afterUpdate':_0x4f2e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x1cb46e){return function(_0x103a91,_0x437e6c,_0x2ba62a){UserVoiceQueueRtEvents[_0x4f2e('0x4')](_0x1cb46e+':'+_0x103a91['id'],_0x103a91);UserVoiceQueueRtEvents[_0x4f2e('0x4')](_0x1cb46e,_0x103a91);_0x2ba62a(null);};}for(var e in events){if(events[_0x4f2e('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x4f2e('0x6')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x074f=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports'];(function(_0x3128af,_0xfd2d5e){var _0x37ca57=function(_0x2e3405){while(--_0x2e3405){_0x3128af['push'](_0x3128af['shift']());}};_0x37ca57(++_0xfd2d5e);}(_0x074f,0xe7));var _0xf074=function(_0x1933e5,_0x46fbdd){_0x1933e5=_0x1933e5-0x0;var _0x4d9ab6=_0x074f[_0x1933e5];return _0x4d9ab6;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xf074('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xf074('0x1')](0x0);var events={'afterCreate':_0xf074('0x2'),'afterUpdate':_0xf074('0x3'),'afterDestroy':_0xf074('0x4')};function emitEvent(_0x3fa3ad){return function(_0x4f2134,_0x3bae5c,_0x3abde7){UserVoiceQueueRtEvents[_0xf074('0x5')](_0x3fa3ad+':'+_0x4f2134['id'],_0x4f2134);UserVoiceQueueRtEvents[_0xf074('0x5')](_0x3fa3ad,_0x4f2134);_0x3abde7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xf074('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index aa7fe07..bf9b17f 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 _0xd20e=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x2644f8,_0x40977c){var _0x233fea=function(_0x308f49){while(--_0x308f49){_0x2644f8['push'](_0x2644f8['shift']());}};_0x233fea(++_0x40977c);}(_0xd20e,0x1b9));var _0xed20=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xd20e[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0xed20('0x0'));var util=require(_0xed20('0x1'));var logger=require(_0xed20('0x2'))('api');var moment=require(_0xed20('0x3'));var BPromise=require(_0xed20('0x4'));var rp=require(_0xed20('0x5'));var fs=require('fs');var path=require(_0xed20('0x6'));var rimraf=require(_0xed20('0x7'));var config=require(_0xed20('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module[_0xed20('0x9')]=function(_0x3a5f1f,_0x7c0fb3){return _0x3a5f1f[_0xed20('0xa')](_0xed20('0xb'),attributes,{'tableName':_0xed20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4cb8=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','lodash','api','moment','bluebird'];(function(_0x3b1330,_0x48a7ef){var _0x341058=function(_0x1a6438){while(--_0x1a6438){_0x3b1330['push'](_0x3b1330['shift']());}};_0x341058(++_0x48a7ef);}(_0x4cb8,0x18c));var _0x84cb=function(_0x2e0ab5,_0x454b73){_0x2e0ab5=_0x2e0ab5-0x0;var _0x464953=_0x4cb8[_0x2e0ab5];return _0x464953;};'use strict';var _=require(_0x84cb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x84cb('0x1'));var moment=require(_0x84cb('0x2'));var BPromise=require(_0x84cb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84cb('0x4'));var rimraf=require(_0x84cb('0x5'));var config=require(_0x84cb('0x6'));var attributes=require(_0x84cb('0x7'));module['exports']=function(_0xde6e26,_0x4e4705){return _0xde6e26['define']('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','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 dd4c1c4..883a24c 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 _0x0b46=['debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent'];(function(_0x4c03ef,_0x589748){var _0x556965=function(_0x17d7a2){while(--_0x17d7a2){_0x4c03ef['push'](_0x4c03ef['shift']());}};_0x556965(++_0x589748);}(_0x0b46,0x138));var _0x60b4=function(_0x45521d,_0x169dfe){_0x45521d=_0x45521d-0x0;var _0x24f9ed=_0x0b46[_0x45521d];return _0x24f9ed;};'use strict';var _=require(_0x60b4('0x0'));var util=require(_0x60b4('0x1'));var moment=require(_0x60b4('0x2'));var BPromise=require(_0x60b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x60b4('0x5'))('rpc');var config=require(_0x60b4('0x6'));var jayson=require(_0x60b4('0x7'));var client=jayson[_0x60b4('0x8')][_0x60b4('0x9')]({'port':0x232a});config[_0x60b4('0xa')]=_[_0x60b4('0xb')](config[_0x60b4('0xa')],{'host':_0x60b4('0xc'),'port':0x18eb});var socket=require(_0x60b4('0xd'))(new Redis(config[_0x60b4('0xa')]));require(_0x60b4('0xe'))[_0x60b4('0xf')](socket);function respondWithRpcPromise(_0x55896a,_0x3bbeac,_0x5c997a){return new BPromise(function(_0x4d4cf9,_0x324eca){return client[_0x60b4('0x10')](_0x55896a,_0x5c997a)[_0x60b4('0x11')](function(_0x39f7db){logger[_0x60b4('0x12')](_0x60b4('0x13'),_0x3bbeac,_0x60b4('0x14'));logger[_0x60b4('0x15')](_0x60b4('0x16'),_0x3bbeac,'request\x20sent',JSON[_0x60b4('0x17')](_0x39f7db));if(_0x39f7db[_0x60b4('0x18')]){if(_0x39f7db[_0x60b4('0x18')][_0x60b4('0x19')]===0x1f4){logger[_0x60b4('0x18')](_0x60b4('0x13'),_0x3bbeac,_0x39f7db[_0x60b4('0x18')][_0x60b4('0x1a')]);return _0x324eca(_0x39f7db[_0x60b4('0x18')]['message']);}logger[_0x60b4('0x18')](_0x60b4('0x13'),_0x3bbeac,_0x39f7db[_0x60b4('0x18')]['message']);return _0x4d4cf9(_0x39f7db[_0x60b4('0x18')][_0x60b4('0x1a')]);}else{logger[_0x60b4('0x12')](_0x60b4('0x13'),_0x3bbeac,_0x60b4('0x14'));_0x4d4cf9(_0x39f7db[_0x60b4('0x1b')][_0x60b4('0x1a')]);}})[_0x60b4('0x1c')](function(_0x56d625){logger['error'](_0x60b4('0x13'),_0x3bbeac,_0x56d625);_0x324eca(_0x56d625);});});}exports[_0x60b4('0x1d')]=function(_0x23d5bb){var _0x4dace7=this;return new Promise(function(_0xf1e278,_0x23b4d6){return db['UserVoiceQueueRt']['findAll']({'raw':_0x23d5bb[_0x60b4('0x1e')]?_0x23d5bb[_0x60b4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x23d5bb[_0x60b4('0x1e')]?_0x23d5bb[_0x60b4('0x1e')][_0x60b4('0x1f')]||null:null,'attributes':[[db[_0x60b4('0x20')]['fn'](_0x60b4('0x21'),db[_0x60b4('0x20')]['fn']('IF',db[_0x60b4('0x20')][_0x60b4('0x22')](_0x60b4('0x23')))),_0x60b4('0x24')]]})['then'](function(_0x1b4fbb){logger['info'](_0x60b4('0x1d'),_0x23d5bb);logger[_0x60b4('0x15')]('GetVoiceQueueRtPauses',_0x23d5bb,JSON['stringify'](_0x1b4fbb));_0xf1e278(_0x1b4fbb);})[_0x60b4('0x1c')](function(_0x27b083){logger[_0x60b4('0x18')](_0x60b4('0x1d'),_0x27b083[_0x60b4('0x1a')],_0x23d5bb);_0x23b4d6(_0x4dace7[_0x60b4('0x18')](0x1f4,_0x27b083[_0x60b4('0x1a')]));});});}; \ No newline at end of file +var _0xaea9=['UserVoiceQueueRt','findAll','options','raw','where','sequelize','literal','outboundQueuePauses','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetVoiceQueueRtPauses'];(function(_0x4121d1,_0x4289d7){var _0x19bd71=function(_0x311123){while(--_0x311123){_0x4121d1['push'](_0x4121d1['shift']());}};_0x19bd71(++_0x4289d7);}(_0xaea9,0x189));var _0x9aea=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xaea9[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x9aea('0x0'));var util=require(_0x9aea('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9aea('0x2'));var fs=require('fs');var Redis=require(_0x9aea('0x3'));var db=require(_0x9aea('0x4'))['db'];var utils=require(_0x9aea('0x5'));var logger=require('../../config/logger')(_0x9aea('0x6'));var config=require('../../config/environment');var jayson=require(_0x9aea('0x7'));var client=jayson[_0x9aea('0x8')][_0x9aea('0x9')]({'port':0x232a});config[_0x9aea('0xa')]=_[_0x9aea('0xb')](config[_0x9aea('0xa')],{'host':_0x9aea('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9aea('0xa')]));require(_0x9aea('0xd'))[_0x9aea('0xe')](socket);function respondWithRpcPromise(_0x5f20cb,_0xf46758,_0x1ff0ff){return new BPromise(function(_0x356d76,_0x3a3343){return client['request'](_0x5f20cb,_0x1ff0ff)[_0x9aea('0xf')](function(_0x4e5916){logger['info'](_0x9aea('0x10'),_0xf46758,_0x9aea('0x11'));logger[_0x9aea('0x12')](_0x9aea('0x13'),_0xf46758,'request\x20sent',JSON[_0x9aea('0x14')](_0x4e5916));if(_0x4e5916[_0x9aea('0x15')]){if(_0x4e5916[_0x9aea('0x15')][_0x9aea('0x16')]===0x1f4){logger['error'](_0x9aea('0x10'),_0xf46758,_0x4e5916[_0x9aea('0x15')][_0x9aea('0x17')]);return _0x3a3343(_0x4e5916['error'][_0x9aea('0x17')]);}logger[_0x9aea('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xf46758,_0x4e5916['error'][_0x9aea('0x17')]);return _0x356d76(_0x4e5916[_0x9aea('0x15')][_0x9aea('0x17')]);}else{logger[_0x9aea('0x18')](_0x9aea('0x10'),_0xf46758,_0x9aea('0x11'));_0x356d76(_0x4e5916['result']['message']);}})[_0x9aea('0x19')](function(_0x361506){logger[_0x9aea('0x15')](_0x9aea('0x10'),_0xf46758,_0x361506);_0x3a3343(_0x361506);});});}exports[_0x9aea('0x1a')]=function(_0x489213){var _0x6541fa=this;return new Promise(function(_0x5946a0,_0x1829ce){return db[_0x9aea('0x1b')][_0x9aea('0x1c')]({'raw':_0x489213['options']?_0x489213[_0x9aea('0x1d')][_0x9aea('0x1e')]===undefined?!![]:![]:!![],'where':_0x489213[_0x9aea('0x1d')]?_0x489213[_0x9aea('0x1d')][_0x9aea('0x1f')]||null:null,'attributes':[[db[_0x9aea('0x20')]['fn']('COUNT',db[_0x9aea('0x20')]['fn']('IF',db[_0x9aea('0x20')][_0x9aea('0x21')]('`paused`\x20=\x201,\x201,\x20null'))),_0x9aea('0x22')]]})[_0x9aea('0xf')](function(_0xb3a575){logger[_0x9aea('0x18')](_0x9aea('0x1a'),_0x489213);logger['debug'](_0x9aea('0x1a'),_0x489213,JSON[_0x9aea('0x14')](_0xb3a575));_0x5946a0(_0xb3a575);})[_0x9aea('0x19')](function(_0x1560b4){logger['error'](_0x9aea('0x1a'),_0x1560b4[_0x9aea('0x17')],_0x489213);_0x1829ce(_0x6541fa[_0x9aea('0x15')](0x1f4,_0x1560b4[_0x9aea('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index d38b941..29e1085 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 _0xb182=['userVoiceQueueRt:','save','remove','update','emit','removeListener','register','length'];(function(_0x908eb6,_0x59199b){var _0x511a09=function(_0x376c8b){while(--_0x376c8b){_0x908eb6['push'](_0x908eb6['shift']());}};_0x511a09(++_0x59199b);}(_0xb182,0x121));var _0x2b18=function(_0x507965,_0x4944f4){_0x507965=_0x507965-0x0;var _0x3608fc=_0xb182[_0x507965];return _0x3608fc;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x2b18('0x0'),_0x2b18('0x1'),_0x2b18('0x2')];function createListener(_0x4bc3a7,_0x4874ee){return function(_0x3b0f5c){_0x4874ee[_0x2b18('0x3')](_0x4bc3a7,_0x3b0f5c);};}function removeListener(_0x36ffa7,_0x4b2145){return function(){UserVoiceQueueRtEvents[_0x2b18('0x4')](_0x36ffa7,_0x4b2145);};}exports[_0x2b18('0x5')]=function(_0x22eae8){for(var _0x31236f=0x0,_0x3444c2=events[_0x2b18('0x6')];_0x31236f<_0x3444c2;_0x31236f++){var _0xcfa0=events[_0x31236f];var _0x5d08d8=createListener(_0x2b18('0x7')+_0xcfa0,_0x22eae8);UserVoiceQueueRtEvents['on'](_0xcfa0,_0x5d08d8);}}; \ No newline at end of file +var _0x6333=['removeListener','register','length','update'];(function(_0x1b495b,_0x4d8ba5){var _0x3530b6=function(_0x51970b){while(--_0x51970b){_0x1b495b['push'](_0x1b495b['shift']());}};_0x3530b6(++_0x4d8ba5);}(_0x6333,0x83));var _0x3633=function(_0x732ae7,_0xe6ba9e){_0x732ae7=_0x732ae7-0x0;var _0x3282fc=_0x6333[_0x732ae7];return _0x3282fc;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove',_0x3633('0x0')];function createListener(_0x528e8c,_0x2c7f7e){return function(_0x31ea34){_0x2c7f7e['emit'](_0x528e8c,_0x31ea34);};}function removeListener(_0x3e0961,_0x5cb6c6){return function(){UserVoiceQueueRtEvents[_0x3633('0x1')](_0x3e0961,_0x5cb6c6);};}exports[_0x3633('0x2')]=function(_0x566b21){for(var _0x547e6d=0x0,_0x23c014=events[_0x3633('0x3')];_0x547e6d<_0x23c014;_0x547e6d++){var _0x272da5=events[_0x547e6d];var _0x5c35ba=createListener('userVoiceQueueRt:'+_0x272da5,_0x566b21);UserVoiceQueueRtEvents['on'](_0x272da5,_0x5c35ba);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 2a3aaf0..5c9794e 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xc06663,_0x3866e2){var _0x11f397=function(_0x75d71c){while(--_0x75d71c){_0xc06663['push'](_0xc06663['shift']());}};_0x11f397(++_0x3866e2);}(_0x70e0,0x17b));var _0x070e=function(_0x3d5987,_0x2f5509){_0x3d5987=_0x3d5987-0x0;var _0x2a6ac6=_0x70e0[_0x3d5987];return _0x2a6ac6;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xdabac3,_0x16a9be){var _0x3c06aa=function(_0x4a334d){while(--_0x4a334d){_0xdabac3['push'](_0xdabac3['shift']());}};_0x3c06aa(++_0x16a9be);}(_0xedd9,0xfc));var _0x9edd=function(_0x9d4413,_0x221b32){_0x9d4413=_0x9d4413-0x0;var _0x2c7037=_0xedd9[_0x9d4413];return _0x2c7037;};'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 diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index f1be972..25da0d7 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 _0xda05=['exports','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xda05,0x179));var _0x5da0=function(_0x373364,_0x198227){_0x373364=_0x373364-0x0;var _0x12d42b=_0xda05[_0x373364];return _0x12d42b;};'use strict';var Sequelize=require(_0x5da0('0x0'));module[_0x5da0('0x1')]={'penalty':{'type':Sequelize[_0x5da0('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8d37=['sequelize','INTEGER'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x8d37,0xbc));var _0x78d3=function(_0x19090d,_0x2c61d8){_0x19090d=_0x19090d-0x0;var _0x440fcc=_0x8d37[_0x19090d];return _0x440fcc;};'use strict';var Sequelize=require(_0x78d3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x78d3('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 faa4bc6..7784bb6 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 _0xd611=['util','api','bluebird','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x5e4a86,_0x409c5b){var _0x2fa725=function(_0x480f98){while(--_0x480f98){_0x5e4a86['push'](_0x5e4a86['shift']());}};_0x2fa725(++_0x409c5b);}(_0xd611,0xf2));var _0x1d61=function(_0x56928f,_0x229473){_0x56928f=_0x56928f-0x0;var _0x159b5d=_0xd611[_0x56928f];return _0x159b5d;};'use strict';var _=require(_0x1d61('0x0'));var util=require(_0x1d61('0x1'));var logger=require('../../config/logger')(_0x1d61('0x2'));var moment=require('moment');var BPromise=require(_0x1d61('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1d61('0x4'));var attributes=require(_0x1d61('0x5'));module[_0x1d61('0x6')]=function(_0xb6fa3a,_0x3a611c){return _0xb6fa3a['define'](_0x1d61('0x7'),attributes,{'tableName':_0x1d61('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0053=['bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','moment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x0053,0xe6));var _0x3005=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0053[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3005('0x0'));var util=require(_0x3005('0x1'));var logger=require(_0x3005('0x2'))('api');var moment=require(_0x3005('0x3'));var BPromise=require(_0x3005('0x4'));var rp=require(_0x3005('0x5'));var fs=require('fs');var path=require(_0x3005('0x6'));var rimraf=require(_0x3005('0x7'));var config=require(_0x3005('0x8'));var attributes=require(_0x3005('0x9'));module['exports']=function(_0x37d943,_0x1bbf2c){return _0x37d943[_0x3005('0xa')](_0x3005('0xb'),attributes,{'tableName':_0x3005('0xc'),'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 c540c60..1cd0978 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 _0xd671=['error','UserWhatsappQueue,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xcdc039,_0x4b9153){var _0x50a58d=function(_0x3b2f0e){while(--_0x3b2f0e){_0xcdc039['push'](_0xcdc039['shift']());}};_0x50a58d(++_0x4b9153);}(_0xd671,0x1be));var _0x1d67=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0xd671[_0x1aab74];return _0x396af2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d67('0x0'));var BPromise=require(_0x1d67('0x1'));var rs=require(_0x1d67('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d67('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d67('0x4'))('rpc');var config=require(_0x1d67('0x5'));var jayson=require(_0x1d67('0x6'));var client=jayson['client'][_0x1d67('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2152c5,_0x2dac72,_0x167a2b){return new BPromise(function(_0x46156c,_0x45156f){return client[_0x1d67('0x8')](_0x2152c5,_0x167a2b)[_0x1d67('0x9')](function(_0x52ca83){logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,_0x1d67('0xa'));logger[_0x1d67('0xb')](_0x1d67('0xc'),_0x2dac72,_0x1d67('0xa'),JSON[_0x1d67('0xd')](_0x52ca83));if(_0x52ca83[_0x1d67('0xe')]){if(_0x52ca83[_0x1d67('0xe')]['code']===0x1f4){logger[_0x1d67('0xe')](_0x1d67('0xf'),_0x2dac72,_0x52ca83[_0x1d67('0xe')][_0x1d67('0x10')]);return _0x45156f(_0x52ca83[_0x1d67('0xe')][_0x1d67('0x10')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,_0x52ca83[_0x1d67('0xe')][_0x1d67('0x10')]);return _0x46156c(_0x52ca83['error'][_0x1d67('0x10')]);}else{logger[_0x1d67('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,'request\x20sent');_0x46156c(_0x52ca83[_0x1d67('0x12')]['message']);}})[_0x1d67('0x13')](function(_0x50a8cf){logger[_0x1d67('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x2dac72,_0x50a8cf);_0x45156f(_0x50a8cf);});});} \ No newline at end of file +var _0x0254=['request','then','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x299984,_0x383734){var _0xae48c9=function(_0x836ac6){while(--_0x836ac6){_0x299984['push'](_0x299984['shift']());}};_0xae48c9(++_0x383734);}(_0x0254,0x17c));var _0x4025=function(_0x2ce6f3,_0x288572){_0x2ce6f3=_0x2ce6f3-0x0;var _0x357c3b=_0x0254[_0x2ce6f3];return _0x357c3b;};'use strict';var _=require(_0x4025('0x0'));var util=require('util');var moment=require(_0x4025('0x1'));var BPromise=require('bluebird');var rs=require(_0x4025('0x2'));var fs=require('fs');var Redis=require(_0x4025('0x3'));var db=require(_0x4025('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4025('0x5'))(_0x4025('0x6'));var config=require(_0x4025('0x7'));var jayson=require(_0x4025('0x8'));var client=jayson[_0x4025('0x9')][_0x4025('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f1b7c,_0x553c0f,_0x28cea5){return new BPromise(function(_0x1dc777,_0x13b40d){return client[_0x4025('0xb')](_0x1f1b7c,_0x28cea5)[_0x4025('0xc')](function(_0x516faf){logger[_0x4025('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x553c0f,'request\x20sent');logger[_0x4025('0xe')](_0x4025('0xf'),_0x553c0f,_0x4025('0x10'),JSON['stringify'](_0x516faf));if(_0x516faf[_0x4025('0x11')]){if(_0x516faf[_0x4025('0x11')][_0x4025('0x12')]===0x1f4){logger[_0x4025('0x11')](_0x4025('0x13'),_0x553c0f,_0x516faf['error']['message']);return _0x13b40d(_0x516faf[_0x4025('0x11')][_0x4025('0x14')]);}logger[_0x4025('0x11')](_0x4025('0x13'),_0x553c0f,_0x516faf[_0x4025('0x11')][_0x4025('0x14')]);return _0x1dc777(_0x516faf[_0x4025('0x11')][_0x4025('0x14')]);}else{logger[_0x4025('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x553c0f,_0x4025('0x10'));_0x1dc777(_0x516faf[_0x4025('0x15')][_0x4025('0x14')]);}})[_0x4025('0x16')](function(_0x78e6f1){logger[_0x4025('0x11')](_0x4025('0x13'),_0x553c0f,_0x78e6f1);_0x13b40d(_0x78e6f1);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index ca057d1..4120dc5 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 _0xe630=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x59ec54,_0x512650){var _0x1fe7c9=function(_0xe2093d){while(--_0xe2093d){_0x59ec54['push'](_0x59ec54['shift']());}};_0x1fe7c9(++_0x512650);}(_0xe630,0x149));var _0x0e63=function(_0x4eaccd,_0x1f69cb){_0x4eaccd=_0x4eaccd-0x0;var _0x87556=_0xe630[_0x4eaccd];return _0x87556;};'use strict';var multer=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var path=require('path');var timeout=require(_0x0e63('0x2'));var express=require(_0x0e63('0x3'));var router=express[_0x0e63('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e63('0x5'));var interaction=require(_0x0e63('0x6'));var config=require(_0x0e63('0x7'));var controller=require('./variable.controller');router[_0x0e63('0x8')]('/',auth[_0x0e63('0x9')](),controller[_0x0e63('0xa')]);router[_0x0e63('0x8')](_0x0e63('0xb'),auth['isAuthenticated'](),controller[_0x0e63('0xc')]);router[_0x0e63('0xd')]('/',auth[_0x0e63('0x9')](),controller[_0x0e63('0xe')]);router[_0x0e63('0xf')](_0x0e63('0xb'),auth[_0x0e63('0x9')](),controller[_0x0e63('0x10')]);router[_0x0e63('0x11')](_0x0e63('0xb'),auth[_0x0e63('0x9')](),controller['destroy']);module[_0x0e63('0x12')]=router; \ No newline at end of file +var _0x6597=['show','post','create','/:id','delete','exports','multer','util','path','express','fs-extra','./variable.controller','get','isAuthenticated','index'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x6597,0x16e));var _0x7659=function(_0x46d131,_0x333fe2){_0x46d131=_0x46d131-0x0;var _0x119311=_0x6597[_0x46d131];return _0x119311;};'use strict';var multer=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var path=require(_0x7659('0x2'));var timeout=require('connect-timeout');var express=require(_0x7659('0x3'));var router=express['Router']();var fs_extra=require(_0x7659('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7659('0x5'));router[_0x7659('0x6')]('/',auth[_0x7659('0x7')](),controller[_0x7659('0x8')]);router[_0x7659('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7659('0x9')]);router[_0x7659('0xa')]('/',auth[_0x7659('0x7')](),controller[_0x7659('0xb')]);router['put'](_0x7659('0xc'),auth[_0x7659('0x7')](),controller['update']);router[_0x7659('0xd')]('/:id',auth[_0x7659('0x7')](),controller['destroy']);module[_0x7659('0xe')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 972733a..42abda8 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 _0x95b2=['sequelize','exports','STRING','name'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x95b2,0x144));var _0x295b=function(_0x7e41cf,_0x683202){_0x7e41cf=_0x7e41cf-0x0;var _0x44cefe=_0x95b2[_0x7e41cf];return _0x44cefe;};'use strict';var Sequelize=require(_0x295b('0x0'));module[_0x295b('0x1')]={'name':{'type':Sequelize[_0x295b('0x2')],'unique':_0x295b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x295b('0x2')]}}; \ No newline at end of file +var _0x8375=['exports','STRING','name'];(function(_0xafa655,_0x224e25){var _0x2c6704=function(_0x5c568b){while(--_0x5c568b){_0xafa655['push'](_0xafa655['shift']());}};_0x2c6704(++_0x224e25);}(_0x8375,0x132));var _0x5837=function(_0x5d5f5a,_0x2513d6){_0x5d5f5a=_0x5d5f5a-0x0;var _0x4c468f=_0x8375[_0x5d5f5a];return _0x4c468f;};'use strict';var Sequelize=require('sequelize');module[_0x5837('0x0')]={'name':{'type':Sequelize[_0x5837('0x1')],'unique':_0x5837('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5837('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 73ef295..24ae75f 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 _0x9c1c=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','jsforce','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','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Variables','UserProfileResource','error','name','send','index','map','Variable','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','rows','catch','show','params','keys','rawAttributes','filters','include','find','create','role','user','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c1c,0xa6));var _0xc9c1=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0x9c1c[_0x45346d];return _0x5ce7ca;};'use strict';var emlformat=require(_0xc9c1('0x0'));var rimraf=require(_0xc9c1('0x1'));var zipdir=require(_0xc9c1('0x2'));var jsonpatch=require(_0xc9c1('0x3'));var rp=require(_0xc9c1('0x4'));var moment=require('moment');var BPromise=require(_0xc9c1('0x5'));var Mustache=require(_0xc9c1('0x6'));var util=require(_0xc9c1('0x7'));var path=require(_0xc9c1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc9c1('0x9'));var squel=require(_0xc9c1('0xa'));var crypto=require('crypto');var jsforce=require(_0xc9c1('0xb'));var deskjs=require(_0xc9c1('0xc'));var toCsv=require(_0xc9c1('0xd'));var querystring=require(_0xc9c1('0xe'));var Papa=require(_0xc9c1('0xf'));var Redis=require(_0xc9c1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc9c1('0x11'));var as=require(_0xc9c1('0x12'));var hardwareService=require(_0xc9c1('0x13'));var logger=require(_0xc9c1('0x14'))('api');var utils=require(_0xc9c1('0x15'));var config=require(_0xc9c1('0x16'));var licenseUtil=require(_0xc9c1('0x17'));var db=require(_0xc9c1('0x18'))['db'];function respondWithStatusCode(_0x55df3b,_0x17cb21){_0x17cb21=_0x17cb21||0xcc;return function(_0xdd0728){if(_0xdd0728){return _0x55df3b[_0xc9c1('0x19')](_0x17cb21);}return _0x55df3b[_0xc9c1('0x1a')](_0x17cb21)[_0xc9c1('0x1b')]();};}function respondWithResult(_0x3f2af1,_0xd7d87e){_0xd7d87e=_0xd7d87e||0xc8;return function(_0x1230b7){if(_0x1230b7){return _0x3f2af1[_0xc9c1('0x1a')](_0xd7d87e)['json'](_0x1230b7);}};}function respondWithFilteredResult(_0x3da33e,_0x3da264){return function(_0x3eb497){if(_0x3eb497){var _0x3981ed=typeof _0x3da264[_0xc9c1('0x1c')]===_0xc9c1('0x1d')&&typeof _0x3da264['limit']===_0xc9c1('0x1d');var _0x2d715b=_0x3eb497[_0xc9c1('0x1e')];var _0x3cc5c6=_0x3981ed?0x0:_0x3da264['offset'];var _0x145a2e=_0x3981ed?_0x3eb497[_0xc9c1('0x1e')]:_0x3da264['offset']+_0x3da264[_0xc9c1('0x1f')];var _0x22c664;if(_0x145a2e>=_0x2d715b){_0x145a2e=_0x2d715b;_0x22c664=0xc8;}else{_0x22c664=0xce;}_0x3da33e[_0xc9c1('0x1a')](_0x22c664);return _0x3da33e[_0xc9c1('0x20')](_0xc9c1('0x21'),_0x3cc5c6+'-'+_0x145a2e+'/'+_0x2d715b)[_0xc9c1('0x22')](_0x3eb497);}return null;};}function patchUpdates(_0x24fcc1){return function(_0x390469){try{jsonpatch[_0xc9c1('0x23')](_0x390469,_0x24fcc1,!![]);}catch(_0x948b8a){return BPromise[_0xc9c1('0x24')](_0x948b8a);}return _0x390469['save']();};}function saveUpdates(_0x42a455,_0x567bbc){return function(_0x496e4a){if(_0x496e4a){return _0x496e4a[_0xc9c1('0x25')](_0x42a455)[_0xc9c1('0x26')](function(_0x348767){return _0x348767;});}return null;};}function removeEntity(_0x105d1d,_0x39b374){return function(_0x35a3d6){if(_0x35a3d6){return _0x35a3d6[_0xc9c1('0x27')]()[_0xc9c1('0x26')](function(){var _0x3f1744=_0x35a3d6[_0xc9c1('0x28')]({'plain':!![]});var _0x46f324=_0xc9c1('0x29');return db[_0xc9c1('0x2a')][_0xc9c1('0x27')]({'where':{'type':_0x46f324,'resourceId':_0x3f1744['id']}})[_0xc9c1('0x26')](function(){return _0x35a3d6;});})[_0xc9c1('0x26')](function(){_0x105d1d[_0xc9c1('0x1a')](0xcc)[_0xc9c1('0x1b')]();});}};}function handleEntityNotFound(_0x4ac9df,_0x19f7a4){return function(_0x3ef67b){if(!_0x3ef67b){_0x4ac9df[_0xc9c1('0x19')](0x194);}return _0x3ef67b;};}function handleError(_0x1061d0,_0x1ea05a){_0x1ea05a=_0x1ea05a||0x1f4;return function(_0x3aba50){logger[_0xc9c1('0x2b')](_0x3aba50['stack']);if(_0x3aba50[_0xc9c1('0x2c')]){delete _0x3aba50[_0xc9c1('0x2c')];}_0x1061d0[_0xc9c1('0x1a')](_0x1ea05a)[_0xc9c1('0x2d')](_0x3aba50);};}exports[_0xc9c1('0x2e')]=function(_0x4722c9,_0x2662b0){var _0x6a0fbd={},_0x355b9f={},_0x5744f8={'count':0x0,'rows':[]};var _0x2fa9fc=_[_0xc9c1('0x2f')](db[_0xc9c1('0x30')]['rawAttributes'],function(_0x603216){return{'name':_0x603216[_0xc9c1('0x31')],'type':_0x603216['type'][_0xc9c1('0x32')]};});_0x355b9f[_0xc9c1('0x33')]=_[_0xc9c1('0x2f')](_0x2fa9fc,_0xc9c1('0x2c'));_0x355b9f[_0xc9c1('0x34')]=_['keys'](_0x4722c9[_0xc9c1('0x34')]);_0x355b9f['filters']=_['intersection'](_0x355b9f[_0xc9c1('0x33')],_0x355b9f[_0xc9c1('0x34')]);_0x6a0fbd['attributes']=_[_0xc9c1('0x35')](_0x355b9f[_0xc9c1('0x33')],qs[_0xc9c1('0x36')](_0x4722c9['query']['fields']));_0x6a0fbd[_0xc9c1('0x37')]=_0x6a0fbd[_0xc9c1('0x37')][_0xc9c1('0x38')]?_0x6a0fbd[_0xc9c1('0x37')]:_0x355b9f['model'];if(!_0x4722c9[_0xc9c1('0x34')][_0xc9c1('0x39')]('nolimit')){_0x6a0fbd[_0xc9c1('0x1f')]=qs[_0xc9c1('0x1f')](_0x4722c9[_0xc9c1('0x34')]['limit']);_0x6a0fbd[_0xc9c1('0x1c')]=qs['offset'](_0x4722c9[_0xc9c1('0x34')][_0xc9c1('0x1c')]);}_0x6a0fbd[_0xc9c1('0x3a')]=qs[_0xc9c1('0x3b')](_0x4722c9['query']['sort']);_0x6a0fbd[_0xc9c1('0x3c')]=qs['filters'](_[_0xc9c1('0x3d')](_0x4722c9[_0xc9c1('0x34')],_0x355b9f['filters']),_0x2fa9fc);if(_0x4722c9['query'][_0xc9c1('0x3e')]){_0x6a0fbd[_0xc9c1('0x3c')]=_[_0xc9c1('0x3f')](_0x6a0fbd['where'],{'$or':_['map'](_0x2fa9fc,function(_0x28ceb1){if(_0x28ceb1[_0xc9c1('0x40')]!=='VIRTUAL'){var _0x2d0c9e={};_0x2d0c9e[_0x28ceb1[_0xc9c1('0x2c')]]={'$like':'%'+_0x4722c9['query'][_0xc9c1('0x3e')]+'%'};return _0x2d0c9e;}})});}_0x6a0fbd=_[_0xc9c1('0x3f')]({},_0x6a0fbd,_0x4722c9[_0xc9c1('0x41')]);var _0x37e088={'where':_0x6a0fbd[_0xc9c1('0x3c')]};return db[_0xc9c1('0x30')][_0xc9c1('0x1e')](_0x37e088)['then'](function(_0x5b1e57){_0x5744f8[_0xc9c1('0x1e')]=_0x5b1e57;if(_0x4722c9['query']['includeAll']){_0x6a0fbd['include']=[{'all':!![]}];}return db[_0xc9c1('0x30')]['findAll'](_0x6a0fbd);})[_0xc9c1('0x26')](function(_0x51c8c9){_0x5744f8[_0xc9c1('0x42')]=_0x51c8c9;return _0x5744f8;})[_0xc9c1('0x26')](respondWithFilteredResult(_0x2662b0,_0x6a0fbd))[_0xc9c1('0x43')](handleError(_0x2662b0,null));};exports[_0xc9c1('0x44')]=function(_0x478418,_0x3482ba){var _0x251f70={'raw':!![],'where':{'id':_0x478418[_0xc9c1('0x45')]['id']}},_0x38f395={};_0x38f395[_0xc9c1('0x33')]=_[_0xc9c1('0x46')](db['Variable'][_0xc9c1('0x47')]);_0x38f395['query']=_[_0xc9c1('0x46')](_0x478418['query']);_0x38f395[_0xc9c1('0x48')]=_[_0xc9c1('0x35')](_0x38f395[_0xc9c1('0x33')],_0x38f395['query']);_0x251f70[_0xc9c1('0x37')]=_['intersection'](_0x38f395[_0xc9c1('0x33')],qs[_0xc9c1('0x36')](_0x478418[_0xc9c1('0x34')][_0xc9c1('0x36')]));_0x251f70[_0xc9c1('0x37')]=_0x251f70[_0xc9c1('0x37')][_0xc9c1('0x38')]?_0x251f70['attributes']:_0x38f395[_0xc9c1('0x33')];if(_0x478418[_0xc9c1('0x34')]['includeAll']){_0x251f70[_0xc9c1('0x49')]=[{'all':!![]}];}_0x251f70=_[_0xc9c1('0x3f')]({},_0x251f70,_0x478418[_0xc9c1('0x41')]);return db[_0xc9c1('0x30')][_0xc9c1('0x4a')](_0x251f70)[_0xc9c1('0x26')](handleEntityNotFound(_0x3482ba,null))[_0xc9c1('0x26')](respondWithResult(_0x3482ba,null))[_0xc9c1('0x43')](handleError(_0x3482ba,null));};exports[_0xc9c1('0x4b')]=function(_0x356e49,_0x5957ff){return db[_0xc9c1('0x30')][_0xc9c1('0x4b')](_0x356e49['body'],{})[_0xc9c1('0x26')](function(_0x2a4800){var _0x16501c=_0x356e49['user'][_0xc9c1('0x28')]({'plain':!![]});if(!_0x16501c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16501c[_0xc9c1('0x4c')]===_0xc9c1('0x4d')){var _0x266a4c=_0x2a4800[_0xc9c1('0x28')]({'plain':!![]});var _0x2ff67d=_0xc9c1('0x29');return db['UserProfileSection'][_0xc9c1('0x4a')]({'where':{'name':_0x2ff67d,'userProfileId':_0x16501c[_0xc9c1('0x4e')]},'raw':!![]})[_0xc9c1('0x26')](function(_0x4d0d78){if(_0x4d0d78&&_0x4d0d78[_0xc9c1('0x4f')]===0x0){return db[_0xc9c1('0x2a')][_0xc9c1('0x4b')]({'name':_0x266a4c['name'],'resourceId':_0x266a4c['id'],'type':_0x4d0d78['name'],'sectionId':_0x4d0d78['id']},{})['then'](function(){return _0x2a4800;});}else{return _0x2a4800;}})['catch'](function(_0x445340){logger['error'](_0xc9c1('0x50'),_0x445340);throw _0x445340;});}return _0x2a4800;})['then'](respondWithResult(_0x5957ff,0xc9))[_0xc9c1('0x43')](handleError(_0x5957ff,null));};exports[_0xc9c1('0x25')]=function(_0xef1c33,_0x3f922e){if(_0xef1c33[_0xc9c1('0x51')]['id']){delete _0xef1c33['body']['id'];}return db[_0xc9c1('0x30')][_0xc9c1('0x4a')]({'where':{'id':_0xef1c33[_0xc9c1('0x45')]['id']}})[_0xc9c1('0x26')](handleEntityNotFound(_0x3f922e,null))[_0xc9c1('0x26')](saveUpdates(_0xef1c33[_0xc9c1('0x51')],null))[_0xc9c1('0x26')](respondWithResult(_0x3f922e,null))[_0xc9c1('0x43')](handleError(_0x3f922e,null));};exports['destroy']=function(_0x4639e1,_0x5a14f4){return db['Variable'][_0xc9c1('0x4a')]({'where':{'id':_0x4639e1[_0xc9c1('0x45')]['id']}})[_0xc9c1('0x26')](handleEntityNotFound(_0x5a14f4,null))[_0xc9c1('0x26')](removeEntity(_0x5a14f4,null))[_0xc9c1('0x43')](handleError(_0x5a14f4,null));}; \ No newline at end of file +var _0xbe6b=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','reject','save','update','then','get','Variables','UserProfileResource','destroy','end','error','stack','name','send','index','map','Variable','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','user'];(function(_0x5a3e79,_0x5d9753){var _0x5582c3=function(_0x577988){while(--_0x577988){_0x5a3e79['push'](_0x5a3e79['shift']());}};_0x5582c3(++_0x5d9753);}(_0xbe6b,0x18c));var _0xbbe6=function(_0x1a9d7b,_0x1fc191){_0x1a9d7b=_0x1a9d7b-0x0;var _0x23c002=_0xbe6b[_0x1a9d7b];return _0x23c002;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbbe6('0x0'));var zipdir=require(_0xbbe6('0x1'));var jsonpatch=require(_0xbbe6('0x2'));var rp=require('request-promise');var moment=require(_0xbbe6('0x3'));var BPromise=require(_0xbbe6('0x4'));var Mustache=require('mustache');var util=require(_0xbbe6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xbbe6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbbe6('0x7'));var _=require(_0xbbe6('0x8'));var squel=require('squel');var crypto=require(_0xbbe6('0x9'));var jsforce=require(_0xbbe6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xbbe6('0x6'));var querystring=require(_0xbbe6('0xb'));var Papa=require(_0xbbe6('0xc'));var Redis=require(_0xbbe6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbbe6('0xe'));var as=require(_0xbbe6('0xf'));var hardwareService=require(_0xbbe6('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xbbe6('0x11'));var licenseUtil=require(_0xbbe6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x420655,_0x741197){_0x741197=_0x741197||0xcc;return function(_0x269d6f){if(_0x269d6f){return _0x420655[_0xbbe6('0x13')](_0x741197);}return _0x420655[_0xbbe6('0x14')](_0x741197)['end']();};}function respondWithResult(_0x5dcb5d,_0x54d9ec){_0x54d9ec=_0x54d9ec||0xc8;return function(_0x5b1817){if(_0x5b1817){return _0x5dcb5d[_0xbbe6('0x14')](_0x54d9ec)[_0xbbe6('0x15')](_0x5b1817);}};}function respondWithFilteredResult(_0x177bd7,_0xe4bcd5){return function(_0x5eacf8){if(_0x5eacf8){var _0x35df56=typeof _0xe4bcd5['offset']===_0xbbe6('0x16')&&typeof _0xe4bcd5['limit']===_0xbbe6('0x16');var _0x51a7e8=_0x5eacf8['count'];var _0x590a7c=_0x35df56?0x0:_0xe4bcd5[_0xbbe6('0x17')];var _0xf9e94f=_0x35df56?_0x5eacf8[_0xbbe6('0x18')]:_0xe4bcd5[_0xbbe6('0x17')]+_0xe4bcd5[_0xbbe6('0x19')];var _0x3f1775;if(_0xf9e94f>=_0x51a7e8){_0xf9e94f=_0x51a7e8;_0x3f1775=0xc8;}else{_0x3f1775=0xce;}_0x177bd7[_0xbbe6('0x14')](_0x3f1775);return _0x177bd7[_0xbbe6('0x1a')](_0xbbe6('0x1b'),_0x590a7c+'-'+_0xf9e94f+'/'+_0x51a7e8)[_0xbbe6('0x15')](_0x5eacf8);}return null;};}function patchUpdates(_0x440cfd){return function(_0x370522){try{jsonpatch['apply'](_0x370522,_0x440cfd,!![]);}catch(_0x22d291){return BPromise[_0xbbe6('0x1c')](_0x22d291);}return _0x370522[_0xbbe6('0x1d')]();};}function saveUpdates(_0x14dce3,_0x38c366){return function(_0x4eaca2){if(_0x4eaca2){return _0x4eaca2[_0xbbe6('0x1e')](_0x14dce3)[_0xbbe6('0x1f')](function(_0x58fa48){return _0x58fa48;});}return null;};}function removeEntity(_0x1ec69f,_0x2743ce){return function(_0x1ce9ef){if(_0x1ce9ef){return _0x1ce9ef['destroy']()[_0xbbe6('0x1f')](function(){var _0x3450fc=_0x1ce9ef[_0xbbe6('0x20')]({'plain':!![]});var _0x5e4a0a=_0xbbe6('0x21');return db[_0xbbe6('0x22')][_0xbbe6('0x23')]({'where':{'type':_0x5e4a0a,'resourceId':_0x3450fc['id']}})['then'](function(){return _0x1ce9ef;});})['then'](function(){_0x1ec69f[_0xbbe6('0x14')](0xcc)[_0xbbe6('0x24')]();});}};}function handleEntityNotFound(_0x4d2bc7,_0x302290){return function(_0x315f84){if(!_0x315f84){_0x4d2bc7['sendStatus'](0x194);}return _0x315f84;};}function handleError(_0x21ed0b,_0x482dca){_0x482dca=_0x482dca||0x1f4;return function(_0x31b657){logger[_0xbbe6('0x25')](_0x31b657[_0xbbe6('0x26')]);if(_0x31b657[_0xbbe6('0x27')]){delete _0x31b657[_0xbbe6('0x27')];}_0x21ed0b[_0xbbe6('0x14')](_0x482dca)[_0xbbe6('0x28')](_0x31b657);};}exports[_0xbbe6('0x29')]=function(_0x48e84a,_0x2a61b3){var _0x33fed1={},_0x2df202={},_0xc6838e={'count':0x0,'rows':[]};var _0xdd4a75=_[_0xbbe6('0x2a')](db[_0xbbe6('0x2b')]['rawAttributes'],function(_0x59996f){return{'name':_0x59996f['fieldName'],'type':_0x59996f[_0xbbe6('0x2c')][_0xbbe6('0x2d')]};});_0x2df202['model']=_[_0xbbe6('0x2a')](_0xdd4a75,'name');_0x2df202[_0xbbe6('0x2e')]=_[_0xbbe6('0x2f')](_0x48e84a['query']);_0x2df202[_0xbbe6('0x30')]=_['intersection'](_0x2df202['model'],_0x2df202[_0xbbe6('0x2e')]);_0x33fed1[_0xbbe6('0x31')]=_[_0xbbe6('0x32')](_0x2df202[_0xbbe6('0x33')],qs['fields'](_0x48e84a[_0xbbe6('0x2e')][_0xbbe6('0x34')]));_0x33fed1[_0xbbe6('0x31')]=_0x33fed1[_0xbbe6('0x31')][_0xbbe6('0x35')]?_0x33fed1[_0xbbe6('0x31')]:_0x2df202[_0xbbe6('0x33')];if(!_0x48e84a[_0xbbe6('0x2e')][_0xbbe6('0x36')]('nolimit')){_0x33fed1[_0xbbe6('0x19')]=qs['limit'](_0x48e84a['query'][_0xbbe6('0x19')]);_0x33fed1[_0xbbe6('0x17')]=qs[_0xbbe6('0x17')](_0x48e84a[_0xbbe6('0x2e')][_0xbbe6('0x17')]);}_0x33fed1['order']=qs[_0xbbe6('0x37')](_0x48e84a['query'][_0xbbe6('0x37')]);_0x33fed1[_0xbbe6('0x38')]=qs['filters'](_[_0xbbe6('0x39')](_0x48e84a['query'],_0x2df202[_0xbbe6('0x30')]),_0xdd4a75);if(_0x48e84a[_0xbbe6('0x2e')]['filter']){_0x33fed1[_0xbbe6('0x38')]=_[_0xbbe6('0x3a')](_0x33fed1[_0xbbe6('0x38')],{'$or':_['map'](_0xdd4a75,function(_0x42402f){if(_0x42402f[_0xbbe6('0x2c')]!==_0xbbe6('0x3b')){var _0x21c037={};_0x21c037[_0x42402f[_0xbbe6('0x27')]]={'$like':'%'+_0x48e84a[_0xbbe6('0x2e')][_0xbbe6('0x3c')]+'%'};return _0x21c037;}})});}_0x33fed1=_[_0xbbe6('0x3a')]({},_0x33fed1,_0x48e84a[_0xbbe6('0x3d')]);var _0x188985={'where':_0x33fed1[_0xbbe6('0x38')]};return db['Variable'][_0xbbe6('0x18')](_0x188985)[_0xbbe6('0x1f')](function(_0x20002e){_0xc6838e[_0xbbe6('0x18')]=_0x20002e;if(_0x48e84a['query'][_0xbbe6('0x3e')]){_0x33fed1['include']=[{'all':!![]}];}return db[_0xbbe6('0x2b')]['findAll'](_0x33fed1);})[_0xbbe6('0x1f')](function(_0x40e4df){_0xc6838e[_0xbbe6('0x3f')]=_0x40e4df;return _0xc6838e;})['then'](respondWithFilteredResult(_0x2a61b3,_0x33fed1))[_0xbbe6('0x40')](handleError(_0x2a61b3,null));};exports[_0xbbe6('0x41')]=function(_0x55f060,_0x269275){var _0x3419e1={'raw':!![],'where':{'id':_0x55f060[_0xbbe6('0x42')]['id']}},_0x40274b={};_0x40274b['model']=_[_0xbbe6('0x2f')](db[_0xbbe6('0x2b')][_0xbbe6('0x43')]);_0x40274b[_0xbbe6('0x2e')]=_[_0xbbe6('0x2f')](_0x55f060[_0xbbe6('0x2e')]);_0x40274b[_0xbbe6('0x30')]=_['intersection'](_0x40274b[_0xbbe6('0x33')],_0x40274b[_0xbbe6('0x2e')]);_0x3419e1[_0xbbe6('0x31')]=_[_0xbbe6('0x32')](_0x40274b['model'],qs[_0xbbe6('0x34')](_0x55f060[_0xbbe6('0x2e')]['fields']));_0x3419e1[_0xbbe6('0x31')]=_0x3419e1[_0xbbe6('0x31')]['length']?_0x3419e1[_0xbbe6('0x31')]:_0x40274b['model'];if(_0x55f060[_0xbbe6('0x2e')][_0xbbe6('0x3e')]){_0x3419e1['include']=[{'all':!![]}];}_0x3419e1=_[_0xbbe6('0x3a')]({},_0x3419e1,_0x55f060[_0xbbe6('0x3d')]);return db['Variable'][_0xbbe6('0x44')](_0x3419e1)[_0xbbe6('0x1f')](handleEntityNotFound(_0x269275,null))['then'](respondWithResult(_0x269275,null))[_0xbbe6('0x40')](handleError(_0x269275,null));};exports['create']=function(_0x2c98a5,_0x49be47){return db[_0xbbe6('0x2b')][_0xbbe6('0x45')](_0x2c98a5[_0xbbe6('0x46')],{})[_0xbbe6('0x1f')](function(_0x577ea7){var _0x21a2e2=_0x2c98a5[_0xbbe6('0x47')]['get']({'plain':!![]});if(!_0x21a2e2)throw new Error(_0xbbe6('0x48'));if(_0x21a2e2[_0xbbe6('0x49')]===_0xbbe6('0x47')){var _0x2f48f5=_0x577ea7[_0xbbe6('0x20')]({'plain':!![]});var _0x3e7898=_0xbbe6('0x21');return db[_0xbbe6('0x4a')][_0xbbe6('0x44')]({'where':{'name':_0x3e7898,'userProfileId':_0x21a2e2[_0xbbe6('0x4b')]},'raw':!![]})[_0xbbe6('0x1f')](function(_0x1de4fc){if(_0x1de4fc&&_0x1de4fc[_0xbbe6('0x4c')]===0x0){return db[_0xbbe6('0x22')][_0xbbe6('0x45')]({'name':_0x2f48f5[_0xbbe6('0x27')],'resourceId':_0x2f48f5['id'],'type':_0x1de4fc['name'],'sectionId':_0x1de4fc['id']},{})['then'](function(){return _0x577ea7;});}else{return _0x577ea7;}})[_0xbbe6('0x40')](function(_0x47bac8){logger[_0xbbe6('0x25')](_0xbbe6('0x4d'),_0x47bac8);throw _0x47bac8;});}return _0x577ea7;})[_0xbbe6('0x1f')](respondWithResult(_0x49be47,0xc9))[_0xbbe6('0x40')](handleError(_0x49be47,null));};exports[_0xbbe6('0x1e')]=function(_0x2cb7a3,_0x2ae4b7){if(_0x2cb7a3[_0xbbe6('0x46')]['id']){delete _0x2cb7a3[_0xbbe6('0x46')]['id'];}return db['Variable']['find']({'where':{'id':_0x2cb7a3[_0xbbe6('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ae4b7,null))['then'](saveUpdates(_0x2cb7a3[_0xbbe6('0x46')],null))['then'](respondWithResult(_0x2ae4b7,null))[_0xbbe6('0x40')](handleError(_0x2ae4b7,null));};exports['destroy']=function(_0x3eff4e,_0x3444a9){return db[_0xbbe6('0x2b')][_0xbbe6('0x44')]({'where':{'id':_0x3eff4e[_0xbbe6('0x42')]['id']}})[_0xbbe6('0x1f')](handleEntityNotFound(_0x3444a9,null))['then'](removeEntity(_0x3444a9,null))[_0xbbe6('0x40')](handleError(_0x3444a9,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5857ccc..e41b46f 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 _0xd87c=['./variable.attributes','exports','Variable','tools_variables','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e4ea5,_0x5bebd8){var _0x498d23=function(_0x39045f){while(--_0x39045f){_0x3e4ea5['push'](_0x3e4ea5['shift']());}};_0x498d23(++_0x5bebd8);}(_0xd87c,0xba));var _0xcd87=function(_0x1942e7,_0x1c975c){_0x1942e7=_0x1942e7-0x0;var _0xa6551f=_0xd87c[_0x1942e7];return _0xa6551f;};'use strict';var _=require(_0xcd87('0x0'));var util=require(_0xcd87('0x1'));var logger=require(_0xcd87('0x2'))(_0xcd87('0x3'));var moment=require('moment');var BPromise=require(_0xcd87('0x4'));var rp=require(_0xcd87('0x5'));var fs=require('fs');var path=require(_0xcd87('0x6'));var rimraf=require(_0xcd87('0x7'));var config=require(_0xcd87('0x8'));var attributes=require(_0xcd87('0x9'));module[_0xcd87('0xa')]=function(_0x5ba8c2,_0xae76b7){return _0x5ba8c2['define'](_0xcd87('0xb'),attributes,{'tableName':_0xcd87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3b3=['../../config/environment','define','Variable','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xfc9d62,_0x4c0a49){var _0xb6bf90=function(_0x42ba0a){while(--_0x42ba0a){_0xfc9d62['push'](_0xfc9d62['shift']());}};_0xb6bf90(++_0x4c0a49);}(_0xd3b3,0x1c6));var _0x3d3b=function(_0x34c26b,_0x5e279b){_0x34c26b=_0x34c26b-0x0;var _0x2f9f58=_0xd3b3[_0x34c26b];return _0x2f9f58;};'use strict';var _=require(_0x3d3b('0x0'));var util=require(_0x3d3b('0x1'));var logger=require(_0x3d3b('0x2'))(_0x3d3b('0x3'));var moment=require(_0x3d3b('0x4'));var BPromise=require(_0x3d3b('0x5'));var rp=require(_0x3d3b('0x6'));var fs=require('fs');var path=require(_0x3d3b('0x7'));var rimraf=require('rimraf');var config=require(_0x3d3b('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x1edebe,_0x409111){return _0x1edebe[_0x3d3b('0x9')](_0x3d3b('0xa'),attributes,{'tableName':'tools_variables','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 2a1de7f..958f29d 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 _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowVariable','options','where','include','map','attributes'];(function(_0x188006,_0x451d6f){var _0x1675a7=function(_0x48c37c){while(--_0x48c37c){_0x188006['push'](_0x188006['shift']());}};_0x1675a7(++_0x451d6f);}(_0x814b,0x1a2));var _0xb814=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x814b[_0x470b0a];return _0x4463f6;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Variable,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['Variable']['find']({'raw':_0x55ba16[_0xb814('0x19')]?_0x55ba16['options']['raw']===undefined?!![]:![]:!![],'where':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1a')]||null:null,'attributes':_0x55ba16['options']?_0x55ba16[_0xb814('0x19')]['attributes']||null:null,'include':_0x55ba16[_0xb814('0x19')]?_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x55ba16[_0xb814('0x19')][_0xb814('0x1b')],function(_0x1f5d40){return{'model':db[_0x1f5d40['model']],'as':_0x1f5d40['as'],'attributes':_0x1f5d40[_0xb814('0x1d')],'include':_0x1f5d40['include']?_[_0xb814('0x1c')](_0x1f5d40[_0xb814('0x1b')],function(_0x31c7ec){return{'model':db[_0x31c7ec[_0xb814('0x1e')]],'as':_0x31c7ec['as'],'attributes':_0x31c7ec[_0xb814('0x1d')],'include':_0x31c7ec[_0xb814('0x1b')]?_[_0xb814('0x1c')](_0x31c7ec['include'],function(_0x392222){return{'model':db[_0x392222[_0xb814('0x1e')]],'as':_0x392222['as'],'attributes':_0x392222[_0xb814('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb814('0xd')](function(_0x32ed56){logger[_0xb814('0xe')](_0xb814('0x18'),_0x55ba16);logger[_0xb814('0x11')]('ShowVariable',_0x55ba16,JSON[_0xb814('0x1f')](_0x32ed56));_0xfac75b(_0x32ed56);})[_0xb814('0x17')](function(_0x52ed64){logger[_0xb814('0x13')](_0xb814('0x18'),_0x52ed64[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x52ed64[_0xb814('0x15')]));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xa41a,0x6b));var _0xaa41=function(_0x377222,_0x153da6){_0x377222=_0x377222-0x0;var _0x31ef1f=_0xa41a[_0x377222];return _0x31ef1f;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index b42fa50..48b40ab 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 _0xd132=['index','isAuthenticated','canUpdate','get','/pull','pull','/restart','restart','/migrations','migrations','express','Router','../../components/auth/service'];(function(_0x4fc5df,_0x3acaab){var _0x4a18f5=function(_0x241409){while(--_0x241409){_0x4fc5df['push'](_0x4fc5df['shift']());}};_0x4a18f5(++_0x3acaab);}(_0xd132,0x142));var _0x2d13=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd132[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x2d13('0x0'));var router=express[_0x2d13('0x1')]();var auth=require(_0x2d13('0x2'));var controller=require('./version.controller');router['get']('/',controller[_0x2d13('0x3')]);router['get']('/fetch',auth[_0x2d13('0x4')](),auth[_0x2d13('0x5')](),controller['fetch']);router[_0x2d13('0x6')]('/reset',auth[_0x2d13('0x4')](),auth[_0x2d13('0x5')](),controller['reset']);router['get'](_0x2d13('0x7'),auth[_0x2d13('0x4')](),auth[_0x2d13('0x5')](),controller[_0x2d13('0x8')]);router[_0x2d13('0x6')](_0x2d13('0x9'),auth[_0x2d13('0x4')](),controller[_0x2d13('0xa')]);router['get'](_0x2d13('0xb'),controller[_0x2d13('0xc')]);module['exports']=router; \ No newline at end of file +var _0x906d=['/fetch','canUpdate','fetch','isAuthenticated','/pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller','index','get'];(function(_0x2e748c,_0x55ec8e){var _0x37e219=function(_0x38c784){while(--_0x38c784){_0x2e748c['push'](_0x2e748c['shift']());}};_0x37e219(++_0x55ec8e);}(_0x906d,0x64));var _0xd906=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x906d[_0x119cd8];return _0x7072a3;};'use strict';var express=require(_0xd906('0x0'));var router=express[_0xd906('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd906('0x2'));router['get']('/',controller[_0xd906('0x3')]);router[_0xd906('0x4')](_0xd906('0x5'),auth['isAuthenticated'](),auth[_0xd906('0x6')](),controller[_0xd906('0x7')]);router[_0xd906('0x4')]('/reset',auth[_0xd906('0x8')](),auth[_0xd906('0x6')](),controller['reset']);router['get'](_0xd906('0x9'),auth[_0xd906('0x8')](),auth[_0xd906('0x6')](),controller['pull']);router[_0xd906('0x4')](_0xd906('0xa'),auth[_0xd906('0x8')](),controller[_0xd906('0xb')]);router['get'](_0xd906('0xc'),controller[_0xd906('0xd')]);module[_0xd906('0xe')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 9fd5050..3ef00e0 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 _0x5838=['json','fetch','origin','master','error','info','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','length','replace','push','sort','sequelize','Migration','getQueryInterface','constructor','server','map','.js','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','root','exports','query','tags','latest','2.0.0','status'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x5838,0x1af));var _0x8583=function(_0x3dacd6,_0x42f69a){_0x3dacd6=_0x3dacd6-0x0;var _0x1e723f=_0x5838[_0x3dacd6];return _0x1e723f;};'use strict';var Umzug=require(_0x8583('0x0'));var path=require(_0x8583('0x1'));var fs=require('fs');var _=require(_0x8583('0x2'));var pkginfo=require(_0x8583('0x3'))(module,_0x8583('0x4'));var compareVersions=require(_0x8583('0x5'));var exec=require(_0x8583('0x6'))[_0x8583('0x7')];var db=require(_0x8583('0x8'))['db'];var config=require(_0x8583('0x9'));var pm2=require('../../config/pm2');var logger=require(_0x8583('0xa'))(_0x8583('0xb'));var git=require('simple-git')(config[_0x8583('0xc')]);exports['index']=function(_0x338dfd,_0x24e150){var _0x2668c9={'current':module[_0x8583('0xd')][_0x8583('0x4')],'phonebar':0x2};if(_0x338dfd[_0x8583('0xe')]&&_0x338dfd[_0x8583('0xe')]['latest']){return git['fetch']()[_0x8583('0xf')](function(_0x2083c4,_0x4985ea){_0x2668c9[_0x8583('0x10')]=(_0x2083c4?module[_0x8583('0xd')]['version']:_0x4985ea['latest'])||_0x8583('0x11');return _0x24e150[_0x8583('0x12')](0xc8)['json'](_0x2668c9);});}else{return _0x24e150[_0x8583('0x12')](0xc8)[_0x8583('0x13')](_0x2668c9);}};exports[_0x8583('0x14')]=function(_0x1ad93f,_0x3fb0f7){return git[_0x8583('0x14')]([_0x8583('0x15'),_0x8583('0x16')],function(_0x3635b8){if(_0x3635b8){logger[_0x8583('0x17')](_0x3635b8);return _0x3fb0f7[_0x8583('0x12')](0x1f4)['json'](_0x3635b8);}logger[_0x8583('0x18')]('git\x20fetch');return _0x3fb0f7[_0x8583('0x12')](0xc8)[_0x8583('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x8583('0x19')]=function(_0x3a9931,_0x2d4da9){return git[_0x8583('0x19')]([_0x8583('0x1a'),'FETCH_HEAD'],function(_0x491420){if(_0x491420){logger['error'](_0x491420);return _0x2d4da9[_0x8583('0x12')](0x1f4)['json'](_0x491420);}logger[_0x8583('0x18')](_0x8583('0x1b'));return _0x2d4da9['status'](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x8583('0x1c')]=function(_0x251c80,_0x17692d){exec(_0x8583('0x1d'),function(_0x25c205,_0x2bdc73,_0x3f054c){logger[_0x8583('0x18')](_0x2bdc73);logger['info'](_0x3f054c);if(_0x25c205){logger[_0x8583('0x17')](_0x25c205);return _0x17692d[_0x8583('0x12')](0x1f4)[_0x8583('0x13')](_0x25c205);}return _0x17692d['status'](0xc8)[_0x8583('0x13')]({'output':_0x2bdc73});});};exports[_0x8583('0x1e')]=function(_0x235e35,_0x2fcb65){return pm2['restart']('motion2')[_0x8583('0x1f')](function(_0x3b0b58){logger['info']('pm2\x20restart\x20motion\x20%s',_0x3b0b58);return _0x2fcb65[_0x8583('0x12')](0xc8)['json']({'output':_0x8583('0x20')});})[_0x8583('0x21')](function(_0x5c9296){logger[_0x8583('0x17')](_0x5c9296);return _0x2fcb65[_0x8583('0x12')](0x1f4)[_0x8583('0x13')](_0x5c9296);});};exports[_0x8583('0x22')]=function(_0x3222fb,_0x432c38){var _0xfc7e99=fs['readdirSync'](path[_0x8583('0x23')](config[_0x8583('0xc')],'server','migrations'));var _0x172213=[];for(var _0xa0abd2=0x0;_0xa0abd2<_0xfc7e99[_0x8583('0x24')];_0xa0abd2++){var _0x1ec986=_0xfc7e99[_0xa0abd2][_0x8583('0x25')]('.js','');if(compareVersions(module[_0x8583('0xd')][_0x8583('0x4')],_0x1ec986)===-0x1){_0x172213[_0x8583('0x26')](_0x1ec986);}}if(_0x172213[_0x8583('0x24')]){var _0x498cec=_0x172213[_0x8583('0x27')](compareVersions);var _0x2fb3de=new Umzug({'storage':_0x8583('0x28'),'storageOptions':{'model':db['Migration'],'modelName':_0x8583('0x29'),'columnName':_0x8583('0x4')},'migrations':{'params':[db['sequelize'][_0x8583('0x2a')](),db[_0x8583('0x28')][_0x8583('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x8583('0x23')](config[_0x8583('0xc')],_0x8583('0x2c'),_0x8583('0x22')),'pattern':/\.js$/}});_0x2fb3de['up']({'migrations':_[_0x8583('0x2d')](_0x498cec,function(_0x157da8){return _0x157da8+_0x8583('0x2e');})})[_0x8583('0x1f')](function(){return _0x432c38[_0x8583('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8583('0xd')][_0x8583('0x4')]+_0x8583('0x2f')+_[_0x8583('0x30')](_0x498cec),'migrations':_[_0x8583('0x23')](_0x498cec)});})[_0x8583('0x21')](function(_0x39e0b9){if(_0x39e0b9 instanceof db[_0x8583('0x28')]['UniqueConstraintError']){return _0x432c38[_0x8583('0x12')](0xc8)[_0x8583('0x13')]({'output':_0x8583('0x31')});}else{return _0x432c38['status'](0x1f4)[_0x8583('0x13')](_0x39e0b9);}});}else{return _0x432c38['status'](0xc8)[_0x8583('0x13')]({'output':_0x8583('0x31')});}}; \ No newline at end of file +var _0x627c=['catch','migrations','readdirSync','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','index','exports','query','fetch','tags','latest','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully'];(function(_0x3a2c7f,_0x3a342f){var _0x116c28=function(_0x353f63){while(--_0x353f63){_0x3a2c7f['push'](_0x3a2c7f['shift']());}};_0x116c28(++_0x3a342f);}(_0x627c,0x1de));var _0xc627=function(_0x17bfb9,_0x861521){_0x17bfb9=_0x17bfb9-0x0;var _0x3cdf20=_0x627c[_0x17bfb9];return _0x3cdf20;};'use strict';var Umzug=require('umzug');var path=require(_0xc627('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xc627('0x1'))(module,_0xc627('0x2'));var compareVersions=require(_0xc627('0x3'));var exec=require(_0xc627('0x4'))[_0xc627('0x5')];var db=require(_0xc627('0x6'))['db'];var config=require(_0xc627('0x7'));var pm2=require('../../config/pm2');var logger=require(_0xc627('0x8'))(_0xc627('0x9'));var git=require(_0xc627('0xa'))(config['root']);exports[_0xc627('0xb')]=function(_0x11e5e4,_0x4dbcb8){var _0x2892c8={'current':module[_0xc627('0xc')][_0xc627('0x2')],'phonebar':0x2};if(_0x11e5e4[_0xc627('0xd')]&&_0x11e5e4[_0xc627('0xd')]['latest']){return git[_0xc627('0xe')]()[_0xc627('0xf')](function(_0x20aae0,_0x12146){_0x2892c8['latest']=(_0x20aae0?module[_0xc627('0xc')][_0xc627('0x2')]:_0x12146[_0xc627('0x10')])||_0xc627('0x11');return _0x4dbcb8[_0xc627('0x12')](0xc8)[_0xc627('0x13')](_0x2892c8);});}else{return _0x4dbcb8[_0xc627('0x12')](0xc8)['json'](_0x2892c8);}};exports['fetch']=function(_0xfe6def,_0x45bab1){return git[_0xc627('0xe')]([_0xc627('0x14'),_0xc627('0x15')],function(_0x3e7b93){if(_0x3e7b93){logger[_0xc627('0x16')](_0x3e7b93);return _0x45bab1[_0xc627('0x12')](0x1f4)[_0xc627('0x13')](_0x3e7b93);}logger[_0xc627('0x17')](_0xc627('0x18'));return _0x45bab1[_0xc627('0x12')](0xc8)[_0xc627('0x13')]({'output':_0xc627('0x19')});});};exports[_0xc627('0x1a')]=function(_0x36eecd,_0x38c507){return git[_0xc627('0x1a')]([_0xc627('0x1b'),_0xc627('0x1c')],function(_0xf00595){if(_0xf00595){logger[_0xc627('0x16')](_0xf00595);return _0x38c507[_0xc627('0x12')](0x1f4)[_0xc627('0x13')](_0xf00595);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x38c507[_0xc627('0x12')](0xc8)[_0xc627('0x13')]({'output':'git\x20reset\x20--hard'});});};exports[_0xc627('0x1d')]=function(_0x3d524a,_0x2d2476){exec(_0xc627('0x1e'),function(_0x21ead4,_0x2fc4a3,_0x2705a9){logger[_0xc627('0x17')](_0x2fc4a3);logger['info'](_0x2705a9);if(_0x21ead4){logger[_0xc627('0x16')](_0x21ead4);return _0x2d2476[_0xc627('0x12')](0x1f4)[_0xc627('0x13')](_0x21ead4);}return _0x2d2476['status'](0xc8)[_0xc627('0x13')]({'output':_0x2fc4a3});});};exports[_0xc627('0x1f')]=function(_0x506951,_0x321623){return pm2[_0xc627('0x1f')](_0xc627('0x20'))['then'](function(_0x20baff){logger[_0xc627('0x17')](_0xc627('0x21'),_0x20baff);return _0x321623[_0xc627('0x12')](0xc8)['json']({'output':_0xc627('0x22')});})[_0xc627('0x23')](function(_0x561b50){logger['error'](_0x561b50);return _0x321623[_0xc627('0x12')](0x1f4)[_0xc627('0x13')](_0x561b50);});};exports[_0xc627('0x24')]=function(_0x46a21f,_0x4a1ed9){var _0x5d7a0f=fs[_0xc627('0x25')](path['join'](config[_0xc627('0x26')],_0xc627('0x27'),_0xc627('0x24')));var _0x15463d=[];for(var _0x4d95b9=0x0;_0x4d95b9<_0x5d7a0f[_0xc627('0x28')];_0x4d95b9++){var _0x4b7fd5=_0x5d7a0f[_0x4d95b9][_0xc627('0x29')](_0xc627('0x2a'),'');if(compareVersions(module[_0xc627('0xc')][_0xc627('0x2')],_0x4b7fd5)===-0x1){_0x15463d[_0xc627('0x2b')](_0x4b7fd5);}}if(_0x15463d[_0xc627('0x28')]){var _0x2f8def=_0x15463d[_0xc627('0x2c')](compareVersions);var _0x27b28b=new Umzug({'storage':_0xc627('0x2d'),'storageOptions':{'model':db[_0xc627('0x2e')],'modelName':_0xc627('0x2e'),'columnName':_0xc627('0x2')},'migrations':{'params':[db[_0xc627('0x2d')][_0xc627('0x2f')](),db[_0xc627('0x2d')][_0xc627('0x30')],function(){throw new Error(_0xc627('0x31'));}],'path':path[_0xc627('0x32')](config[_0xc627('0x26')],_0xc627('0x27'),_0xc627('0x24')),'pattern':/\.js$/}});_0x27b28b['up']({'migrations':_[_0xc627('0x33')](_0x2f8def,function(_0x424f90){return _0x424f90+_0xc627('0x2a');})})[_0xc627('0x34')](function(){return _0x4a1ed9[_0xc627('0x12')](0xc8)['json']({'output':_0xc627('0x35')+module[_0xc627('0xc')][_0xc627('0x2')]+_0xc627('0x36')+_[_0xc627('0x37')](_0x2f8def),'migrations':_[_0xc627('0x32')](_0x2f8def)});})['catch'](function(_0x389948){if(_0x389948 instanceof db[_0xc627('0x2d')]['UniqueConstraintError']){return _0x4a1ed9[_0xc627('0x12')](0xc8)[_0xc627('0x13')]({'output':_0xc627('0x38')});}else{return _0x4a1ed9[_0xc627('0x12')](0x1f4)[_0xc627('0x13')](_0x389948);}});}else{return _0x4a1ed9[_0xc627('0x12')](0xc8)['json']({'output':_0xc627('0x38')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 77dc613..7cb4054 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 _0x4c2c=['describe','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x4c2c,0xa7));var _0xc4c2=function(_0x13cdd0,_0x3a3ca7){_0x13cdd0=_0x13cdd0-0x0;var _0x2fcc49=_0x4c2c[_0x13cdd0];return _0x2fcc49;};'use strict';var multer=require(_0xc4c2('0x0'));var util=require(_0xc4c2('0x1'));var path=require(_0xc4c2('0x2'));var timeout=require(_0xc4c2('0x3'));var express=require(_0xc4c2('0x4'));var router=express[_0xc4c2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc4c2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc4c2('0x7'));var controller=require(_0xc4c2('0x8'));router[_0xc4c2('0x9')]('/',auth[_0xc4c2('0xa')](),controller[_0xc4c2('0xb')]);router['get'](_0xc4c2('0xc'),auth[_0xc4c2('0xa')](),controller[_0xc4c2('0xd')]);router[_0xc4c2('0x9')](_0xc4c2('0xe'),auth[_0xc4c2('0xa')](),controller[_0xc4c2('0xf')]);router['post']('/',auth[_0xc4c2('0xa')](),controller[_0xc4c2('0x10')]);router[_0xc4c2('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xc4c2('0xe'),auth[_0xc4c2('0xa')](),controller[_0xc4c2('0x12')]);module[_0xc4c2('0x13')]=router; \ No newline at end of file +var _0x3847=['../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x113a9b,_0x525a06){var _0x4cc43a=function(_0x4e173d){while(--_0x4e173d){_0x113a9b['push'](_0x113a9b['shift']());}};_0x4cc43a(++_0x525a06);}(_0x3847,0x1d8));var _0x7384=function(_0x3e6ee0,_0x57887e){_0x3e6ee0=_0x3e6ee0-0x0;var _0xf59027=_0x3847[_0x3e6ee0];return _0xf59027;};'use strict';var multer=require('multer');var util=require(_0x7384('0x0'));var path=require(_0x7384('0x1'));var timeout=require(_0x7384('0x2'));var express=require(_0x7384('0x3'));var router=express[_0x7384('0x4')]();var fs_extra=require(_0x7384('0x5'));var auth=require(_0x7384('0x6'));var interaction=require(_0x7384('0x7'));var config=require(_0x7384('0x8'));var controller=require(_0x7384('0x9'));router[_0x7384('0xa')]('/',auth[_0x7384('0xb')](),controller[_0x7384('0xc')]);router[_0x7384('0xa')](_0x7384('0xd'),auth['isAuthenticated'](),controller[_0x7384('0xe')]);router[_0x7384('0xa')](_0x7384('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x7384('0x10')]('/',auth[_0x7384('0xb')](),controller[_0x7384('0x11')]);router['put'](_0x7384('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7384('0xf'),auth[_0x7384('0xb')](),controller[_0x7384('0x12')]);module[_0x7384('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index bda83f8..59c9b71 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 _0x6ac2=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x292f52,_0x4fcc08){var _0xfdcc8=function(_0x2f85cb){while(--_0x2f85cb){_0x292f52['push'](_0x292f52['shift']());}};_0xfdcc8(++_0x4fcc08);}(_0x6ac2,0x184));var _0x26ac=function(_0xe493d9,_0x333e74){_0xe493d9=_0xe493d9-0x0;var _0x59e028=_0x6ac2[_0xe493d9];return _0x59e028;};'use strict';var Sequelize=require(_0x26ac('0x0'));module['exports']={'type':{'type':Sequelize[_0x26ac('0x1')]},'uniqueid':{'type':Sequelize[_0x26ac('0x1')]},'calleridnum':{'type':Sequelize[_0x26ac('0x1')]},'calleridname':{'type':Sequelize[_0x26ac('0x1')]},'queue':{'type':Sequelize[_0x26ac('0x1')]},'interface':{'type':Sequelize[_0x26ac('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x26ac('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x26ac('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x26ac('0x2')]},'agentdumpAt':{'type':Sequelize[_0x26ac('0x2')]},'holdtime':{'type':Sequelize[_0x26ac('0x3')]},'agentcomplete':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x26ac('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x26ac('0x1')]},'lastevent':{'type':Sequelize[_0x26ac('0x1')]},'channel':{'type':Sequelize[_0x26ac('0x1')]},'channelstate':{'type':Sequelize[_0x26ac('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x26ac('0x1')]},'connectedlinename':{'type':Sequelize[_0x26ac('0x1')]},'language':{'type':Sequelize[_0x26ac('0x1')]},'accountcode':{'type':Sequelize[_0x26ac('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x26ac('0x1')]},'destchannel':{'type':Sequelize[_0x26ac('0x1')]},'destchannelstate':{'type':Sequelize[_0x26ac('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x26ac('0x1')]},'destcalleridnum':{'type':Sequelize[_0x26ac('0x1')]},'destcalleridname':{'type':Sequelize[_0x26ac('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x26ac('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x26ac('0x1')]},'destaccountcode':{'type':Sequelize[_0x26ac('0x1')]},'destcontext':{'type':Sequelize[_0x26ac('0x1')]},'destexten':{'type':Sequelize[_0x26ac('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x26ac('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x26ac('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x26ac('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x26ac('0x1')],'comment':_0x26ac('0x5')},'transferexten':{'type':Sequelize[_0x26ac('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x26ac('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3fce=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3fce,0x121));var _0xe3fc=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x3fce[_0x29ae80];return _0x5d6d71;};'use strict';var Sequelize=require('sequelize');module[_0xe3fc('0x0')]={'type':{'type':Sequelize[_0xe3fc('0x1')]},'uniqueid':{'type':Sequelize[_0xe3fc('0x1')]},'calleridnum':{'type':Sequelize[_0xe3fc('0x1')]},'calleridname':{'type':Sequelize[_0xe3fc('0x1')]},'queue':{'type':Sequelize[_0xe3fc('0x1')]},'interface':{'type':Sequelize[_0xe3fc('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xe3fc('0x2')]},'agentdumpAt':{'type':Sequelize[_0xe3fc('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xe3fc('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe3fc('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xe3fc('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe3fc('0x4')]},'reason':{'type':Sequelize[_0xe3fc('0x1')]},'lastevent':{'type':Sequelize[_0xe3fc('0x1')]},'channel':{'type':Sequelize[_0xe3fc('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xe3fc('0x1')]},'connectedlinename':{'type':Sequelize[_0xe3fc('0x1')]},'language':{'type':Sequelize[_0xe3fc('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe3fc('0x1')]},'exten':{'type':Sequelize[_0xe3fc('0x1')]},'priority':{'type':Sequelize[_0xe3fc('0x1')]},'destchannel':{'type':Sequelize[_0xe3fc('0x1')]},'destchannelstate':{'type':Sequelize[_0xe3fc('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xe3fc('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe3fc('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe3fc('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xe3fc('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe3fc('0x1')]},'destcontext':{'type':Sequelize[_0xe3fc('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xe3fc('0x1')]},'destuniqueid':{'type':Sequelize[_0xe3fc('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe3fc('0x1')],'comment':_0xe3fc('0x5')},'transferexten':{'type':Sequelize[_0xe3fc('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'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 82fc912..fcd4c9c 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(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 b39a150..2e2a527 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 _0x304b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util'];(function(_0x3c7183,_0x143d94){var _0x244146=function(_0x4d6857){while(--_0x4d6857){_0x3c7183['push'](_0x3c7183['shift']());}};_0x244146(++_0x143d94);}(_0x304b,0xfb));var _0xb304=function(_0x2452e7,_0x14ba7c){_0x2452e7=_0x2452e7-0x0;var _0x6181c3=_0x304b[_0x2452e7];return _0x6181c3;};'use strict';var _=require('lodash');var util=require(_0xb304('0x0'));var logger=require(_0xb304('0x1'))(_0xb304('0x2'));var moment=require(_0xb304('0x3'));var BPromise=require(_0xb304('0x4'));var rp=require(_0xb304('0x5'));var fs=require('fs');var path=require(_0xb304('0x6'));var rimraf=require(_0xb304('0x7'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0xb304('0x8')]=function(_0x301a2e,_0x1eef78){return _0x301a2e[_0xb304('0x9')](_0xb304('0xa'),attributes,{'tableName':_0xb304('0xb'),'paranoid':![],'indexes':[{'fields':[_0xb304('0xc'),_0xb304('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x885a=['./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x885a,0x180));var _0xa885=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x885a[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xa885('0xc'),_0xa885('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 470b840..5769b9d 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 _0x115c=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','update','where','limit','UpdateVoiceAgentReport','util','moment','bluebird'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x115c,0x1ec));var _0xc115=function(_0x4399ca,_0x53d282){_0x4399ca=_0x4399ca-0x0;var _0x1661f6=_0x115c[_0x4399ca];return _0x1661f6;};'use strict';var _=require('lodash');var util=require(_0xc115('0x0'));var moment=require(_0xc115('0x1'));var BPromise=require(_0xc115('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc115('0x3'));var db=require(_0xc115('0x4'))['db'];var utils=require(_0xc115('0x5'));var logger=require('../../config/logger')(_0xc115('0x6'));var config=require(_0xc115('0x7'));var jayson=require(_0xc115('0x8'));var client=jayson[_0xc115('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f73e5,_0x391fd7,_0x39a79b){return new BPromise(function(_0x4f309d,_0x48560a){return client[_0xc115('0xa')](_0x1f73e5,_0x39a79b)[_0xc115('0xb')](function(_0x4159f9){logger['info'](_0xc115('0xc'),_0x391fd7,_0xc115('0xd'));logger[_0xc115('0xe')](_0xc115('0xf'),_0x391fd7,_0xc115('0xd'),JSON[_0xc115('0x10')](_0x4159f9));if(_0x4159f9[_0xc115('0x11')]){if(_0x4159f9['error'][_0xc115('0x12')]===0x1f4){logger[_0xc115('0x11')](_0xc115('0xc'),_0x391fd7,_0x4159f9[_0xc115('0x11')][_0xc115('0x13')]);return _0x48560a(_0x4159f9[_0xc115('0x11')]['message']);}logger[_0xc115('0x11')](_0xc115('0xc'),_0x391fd7,_0x4159f9[_0xc115('0x11')][_0xc115('0x13')]);return _0x4f309d(_0x4159f9['error'][_0xc115('0x13')]);}else{logger[_0xc115('0x14')](_0xc115('0xc'),_0x391fd7,_0xc115('0xd'));_0x4f309d(_0x4159f9[_0xc115('0x15')][_0xc115('0x13')]);}})[_0xc115('0x16')](function(_0x18f11c){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x391fd7,_0x18f11c);_0x48560a(_0x18f11c);});});}exports[_0xc115('0x17')]=function(_0x459102){var _0x540226=this;return new Promise(function(_0x598f69,_0x34a2b8){return db[_0xc115('0x18')][_0xc115('0x19')](_0x459102[_0xc115('0x1a')],{'raw':_0x459102[_0xc115('0x1b')]?_0x459102[_0xc115('0x1b')][_0xc115('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x510896){logger['info'](_0xc115('0x17'),_0x459102);logger[_0xc115('0xe')]('CreateVoiceAgentReport',_0x459102,JSON['stringify'](_0x510896));_0x598f69(_0x510896);})[_0xc115('0x16')](function(_0x400310){logger[_0xc115('0x11')]('CreateVoiceAgentReport',_0x400310[_0xc115('0x13')],_0x459102);_0x34a2b8(_0x540226[_0xc115('0x11')](0x1f4,_0x400310['message']));});});};exports['UpdateVoiceAgentReport']=function(_0xde4d30){var _0x62a8c3=this;return new Promise(function(_0xaf7d26,_0x4744d7){return db[_0xc115('0x18')][_0xc115('0x1d')](_0xde4d30[_0xc115('0x1a')],{'raw':_0xde4d30['options']?_0xde4d30['options'][_0xc115('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xde4d30[_0xc115('0x1b')]?_0xde4d30[_0xc115('0x1b')][_0xc115('0x1e')]||null:null,'attributes':_0xde4d30[_0xc115('0x1b')]?_0xde4d30[_0xc115('0x1b')]['attributes']||null:null,'limit':_0xde4d30[_0xc115('0x1b')]?_0xde4d30[_0xc115('0x1b')][_0xc115('0x1f')]||null:null})[_0xc115('0xb')](function(_0x478561){logger[_0xc115('0x14')]('UpdateVoiceAgentReport',_0xde4d30);logger[_0xc115('0xe')](_0xc115('0x20'),_0xde4d30,JSON[_0xc115('0x10')](_0x478561));_0xaf7d26(_0x478561);})[_0xc115('0x16')](function(_0x34d640){logger['error'](_0xc115('0x20'),_0x34d640[_0xc115('0x13')],_0xde4d30);_0x4744d7(_0x62a8c3['error'](0x1f4,_0x34d640[_0xc115('0x13')]));});});}; \ No newline at end of file +var _0x69c3=['CreateVoiceAgentReport','UpdateVoiceAgentReport','VoiceAgentReport','options','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','VoiceAgentReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','body','raw','then','debug'];(function(_0x189e54,_0x4bb31d){var _0x58db6d=function(_0x4d1798){while(--_0x4d1798){_0x189e54['push'](_0x189e54['shift']());}};_0x58db6d(++_0x4bb31d);}(_0x69c3,0x1d1));var _0x369c=function(_0x5b82e9,_0x382fe1){_0x5b82e9=_0x5b82e9-0x0;var _0x204239=_0x69c3[_0x5b82e9];return _0x204239;};'use strict';var _=require('lodash');var util=require(_0x369c('0x0'));var moment=require(_0x369c('0x1'));var BPromise=require(_0x369c('0x2'));var rs=require(_0x369c('0x3'));var fs=require('fs');var Redis=require(_0x369c('0x4'));var db=require(_0x369c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x369c('0x6'))(_0x369c('0x7'));var config=require(_0x369c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x369c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x330b08,_0x58cc1d,_0x19bde8){return new BPromise(function(_0x2c3885,_0x34e642){return client['request'](_0x330b08,_0x19bde8)['then'](function(_0x1dc8e6){logger['info'](_0x369c('0xa'),_0x58cc1d,'request\x20sent');logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x58cc1d,'request\x20sent',JSON[_0x369c('0xb')](_0x1dc8e6));if(_0x1dc8e6[_0x369c('0xc')]){if(_0x1dc8e6[_0x369c('0xc')]['code']===0x1f4){logger[_0x369c('0xc')](_0x369c('0xa'),_0x58cc1d,_0x1dc8e6['error']['message']);return _0x34e642(_0x1dc8e6[_0x369c('0xc')][_0x369c('0xd')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x58cc1d,_0x1dc8e6[_0x369c('0xc')][_0x369c('0xd')]);return _0x2c3885(_0x1dc8e6[_0x369c('0xc')]['message']);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x58cc1d,_0x369c('0xe'));_0x2c3885(_0x1dc8e6[_0x369c('0xf')]['message']);}})[_0x369c('0x10')](function(_0x571ece){logger[_0x369c('0xc')](_0x369c('0xa'),_0x58cc1d,_0x571ece);_0x34e642(_0x571ece);});});}exports['CreateVoiceAgentReport']=function(_0x39e0cb){var _0x199ac9=this;return new Promise(function(_0xafb0b0,_0x46badb){return db['VoiceAgentReport']['create'](_0x39e0cb[_0x369c('0x11')],{'raw':_0x39e0cb['options']?_0x39e0cb['options'][_0x369c('0x12')]===undefined?!![]:![]:!![]})[_0x369c('0x13')](function(_0x1a2600){logger['info']('CreateVoiceAgentReport',_0x39e0cb);logger[_0x369c('0x14')](_0x369c('0x15'),_0x39e0cb,JSON[_0x369c('0xb')](_0x1a2600));_0xafb0b0(_0x1a2600);})[_0x369c('0x10')](function(_0xb51cb5){logger[_0x369c('0xc')]('CreateVoiceAgentReport',_0xb51cb5['message'],_0x39e0cb);_0x46badb(_0x199ac9[_0x369c('0xc')](0x1f4,_0xb51cb5['message']));});});};exports[_0x369c('0x16')]=function(_0x131d88){var _0x9a37ef=this;return new Promise(function(_0x3516ce,_0x16eeb4){return db[_0x369c('0x17')]['update'](_0x131d88[_0x369c('0x11')],{'raw':_0x131d88[_0x369c('0x18')]?_0x131d88[_0x369c('0x18')][_0x369c('0x12')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x131d88[_0x369c('0x18')]?_0x131d88[_0x369c('0x18')][_0x369c('0x19')]||null:null,'attributes':_0x131d88[_0x369c('0x18')]?_0x131d88[_0x369c('0x18')][_0x369c('0x1a')]||null:null,'limit':_0x131d88[_0x369c('0x18')]?_0x131d88[_0x369c('0x18')]['limit']||null:null})[_0x369c('0x13')](function(_0x274726){logger['info'](_0x369c('0x16'),_0x131d88);logger[_0x369c('0x14')](_0x369c('0x16'),_0x131d88,JSON[_0x369c('0xb')](_0x274726));_0x3516ce(_0x274726);})[_0x369c('0x10')](function(_0x57adb4){logger['error'](_0x369c('0x16'),_0x57adb4[_0x369c('0xd')],_0x131d88);_0x16eeb4(_0x9a37ef[_0x369c('0xc')](0x1f4,_0x57adb4[_0x369c('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 39af881..704f92c 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 _0xb458=['./voiceCallReport.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(_0xf15036,_0x52e137){var _0x2985dd=function(_0x2d2dca){while(--_0x2d2dca){_0xf15036['push'](_0xf15036['shift']());}};_0x2985dd(++_0x52e137);}(_0xb458,0x103));var _0x8b45=function(_0x3b5383,_0xccef3){_0x3b5383=_0x3b5383-0x0;var _0x3fc014=_0xb458[_0x3b5383];return _0x3fc014;};'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 _0xadb8=['/describe','describe','post','/:id','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','get'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0xadb8,0x1d0));var _0x8adb=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0xadb8[_0x3e531a];return _0x3c2574;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8adb('0x0'));var timeout=require('connect-timeout');var express=require(_0x8adb('0x1'));var router=express[_0x8adb('0x2')]();var fs_extra=require(_0x8adb('0x3'));var auth=require(_0x8adb('0x4'));var interaction=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var controller=require(_0x8adb('0x7'));router['get']('/',auth[_0x8adb('0x8')](),controller[_0x8adb('0x9')]);router[_0x8adb('0xa')](_0x8adb('0xb'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xc')]);router[_0x8adb('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8adb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8adb('0xe'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xf')]);router[_0x8adb('0x10')](_0x8adb('0xe'),auth[_0x8adb('0x8')](),controller[_0x8adb('0x11')]);module[_0x8adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index a305b17..f42f0fe 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 _0x4892=['exports','ENUM','outbound','inbound-fax','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize'];(function(_0x18f7e0,_0x40d5e3){var _0x3ceeae=function(_0x300935){while(--_0x300935){_0x18f7e0['push'](_0x18f7e0['shift']());}};_0x3ceeae(++_0x40d5e3);}(_0x4892,0x1ee));var _0x2489=function(_0x381101,_0x5f2efb){_0x381101=_0x381101-0x0;var _0x10e22e=_0x4892[_0x381101];return _0x10e22e;};'use strict';var Sequelize=require(_0x2489('0x0'));module[_0x2489('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2489('0x2')]('inbound','internal',_0x2489('0x3'),_0x2489('0x4'),_0x2489('0x5'),_0x2489('0x6'))},'tag':{'type':Sequelize[_0x2489('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x2489('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x2489('0x7')]},'callerid':{'type':Sequelize[_0x2489('0x7')]},'channel':{'type':Sequelize[_0x2489('0x7')]},'destinationchannel':{'type':Sequelize[_0x2489('0x7')]},'lastapplication':{'type':Sequelize[_0x2489('0x7')]},'lastdata':{'type':Sequelize[_0x2489('0x8')]},'starttime':{'type':Sequelize[_0x2489('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x2489('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x2489('0xa')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2489('0x7')]},'amaflags':{'type':Sequelize[_0x2489('0x7')]},'userfield':{'type':Sequelize[_0x2489('0x7')]},'userDisposition':{'type':Sequelize[_0x2489('0x7')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2489('0x7')]},'prefix':{'type':Sequelize[_0x2489('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x2489('0x7')]}}; \ No newline at end of file +var _0xa5c9=['exports','STRING','ENUM','outbound','inbound-fax','TEXT','DATE','INTEGER','sequelize'];(function(_0x28f0e2,_0x515a04){var _0x2d397a=function(_0x587bcb){while(--_0x587bcb){_0x28f0e2['push'](_0x28f0e2['shift']());}};_0x2d397a(++_0x515a04);}(_0xa5c9,0x143));var _0x9a5c=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xa5c9[_0xd578cb];return _0x775533;};'use strict';var Sequelize=require(_0x9a5c('0x0'));module[_0x9a5c('0x1')]={'uniqueid':{'type':Sequelize[_0x9a5c('0x2')]},'type':{'type':Sequelize[_0x9a5c('0x3')]('inbound','internal',_0x9a5c('0x4'),_0x9a5c('0x5'),'outbound-fax','dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9a5c('0x2')]},'source':{'type':Sequelize[_0x9a5c('0x2')]},'destination':{'type':Sequelize[_0x9a5c('0x2')]},'destinationcontext':{'type':Sequelize[_0x9a5c('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9a5c('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x9a5c('0x2')]},'lastdata':{'type':Sequelize[_0x9a5c('0x6')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x9a5c('0x7')]},'answertime':{'type':Sequelize[_0x9a5c('0x7')]},'endtime':{'type':Sequelize[_0x9a5c('0x7')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x9a5c('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9a5c('0x2')]},'amaflags':{'type':Sequelize[_0x9a5c('0x2')]},'userfield':{'type':Sequelize[_0x9a5c('0x2')]},'userDisposition':{'type':Sequelize[_0x9a5c('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x9a5c('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x9a5c('0x2')]},'note':{'type':Sequelize[_0x9a5c('0x2')]},'prefix':{'type':Sequelize[_0x9a5c('0x2')]},'routeid':{'type':Sequelize[_0x9a5c('0x8')]},'sipcallid':{'type':Sequelize[_0x9a5c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 690b5cb..38ec536 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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x4e024f,_0x5654c6){_0x4e024f=_0x4e024f-0x0;var _0x25acfd=_0x2032[_0x4e024f];return _0x25acfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 7586406..2b3ca7c 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 _0x332a=['report_call','uniqueid','util','api','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x332a,0x199));var _0xa332=function(_0x2151c7,_0x13f5fb){_0x2151c7=_0x2151c7-0x0;var _0x1154ac=_0x332a[_0x2151c7];return _0x1154ac;};'use strict';var _=require('lodash');var util=require(_0xa332('0x0'));var logger=require('../../config/logger')(_0xa332('0x1'));var moment=require('moment');var BPromise=require(_0xa332('0x2'));var rp=require(_0xa332('0x3'));var fs=require('fs');var path=require(_0xa332('0x4'));var rimraf=require('rimraf');var config=require(_0xa332('0x5'));var attributes=require(_0xa332('0x6'));module[_0xa332('0x7')]=function(_0x5bd4e8,_0x2f6487){return _0x5bd4e8['define'](_0xa332('0x8'),attributes,{'tableName':_0xa332('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa332('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9164=['uniqueid','lodash','../../config/logger','moment','path','../../config/environment','exports','define','VoiceCallReport','report_call'];(function(_0x1c2e3e,_0x16dc28){var _0x26adbd=function(_0x562282){while(--_0x562282){_0x1c2e3e['push'](_0x1c2e3e['shift']());}};_0x26adbd(++_0x16dc28);}(_0x9164,0x1cd));var _0x4916=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9164[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4916('0x0'));var util=require('util');var logger=require(_0x4916('0x1'))('api');var moment=require(_0x4916('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4916('0x3'));var rimraf=require('rimraf');var config=require(_0x4916('0x4'));var attributes=require('./voiceCallReport.attributes');module[_0x4916('0x5')]=function(_0x426edc,_0x1ff768){return _0x426edc[_0x4916('0x6')](_0x4916('0x7'),attributes,{'tableName':_0x4916('0x8'),'paranoid':![],'indexes':[{'fields':[_0x4916('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 62cd452..a3270cf 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 _0x7269=['model','GetVoiceCallReport','stringify','CreateVoiceCallReport','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','map'];(function(_0x5c69d4,_0x2dc7f7){var _0x4fe92e=function(_0x4674d3){while(--_0x4674d3){_0x5c69d4['push'](_0x5c69d4['shift']());}};_0x4fe92e(++_0x2dc7f7);}(_0x7269,0x12f));var _0x9726=function(_0x8176cf,_0x33513c){_0x8176cf=_0x8176cf-0x0;var _0x1b4a96=_0x7269[_0x8176cf];return _0x1b4a96;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var moment=require(_0x9726('0x2'));var BPromise=require(_0x9726('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9726('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9726('0x5'))(_0x9726('0x6'));var config=require(_0x9726('0x7'));var jayson=require(_0x9726('0x8'));var client=jayson[_0x9726('0x9')][_0x9726('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208c46,_0x37c45b,_0x26a050){return new BPromise(function(_0x139725,_0x872dc1){return client[_0x9726('0xb')](_0x208c46,_0x26a050)[_0x9726('0xc')](function(_0x16eba2){logger['info'](_0x9726('0xd'),_0x37c45b,_0x9726('0xe'));logger[_0x9726('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x37c45b,_0x9726('0xe'),JSON['stringify'](_0x16eba2));if(_0x16eba2['error']){if(_0x16eba2[_0x9726('0x10')]['code']===0x1f4){logger[_0x9726('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x37c45b,_0x16eba2[_0x9726('0x10')][_0x9726('0x11')]);return _0x872dc1(_0x16eba2['error'][_0x9726('0x11')]);}logger[_0x9726('0x10')](_0x9726('0xd'),_0x37c45b,_0x16eba2[_0x9726('0x10')][_0x9726('0x11')]);return _0x139725(_0x16eba2[_0x9726('0x10')][_0x9726('0x11')]);}else{logger[_0x9726('0x12')](_0x9726('0xd'),_0x37c45b,_0x9726('0xe'));_0x139725(_0x16eba2[_0x9726('0x13')]['message']);}})[_0x9726('0x14')](function(_0x453599){logger['error'](_0x9726('0xd'),_0x37c45b,_0x453599);_0x872dc1(_0x453599);});});}exports['GetVoiceCallReport']=function(_0xb8dc08){var _0x3333d5=this;return new Promise(function(_0x38acc3,_0xefce2f){return db[_0x9726('0x15')][_0x9726('0x16')]({'raw':_0xb8dc08['options']?_0xb8dc08['options'][_0x9726('0x17')]===undefined?!![]:![]:!![],'where':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x19')]||null:null,'attributes':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x1a')]||null:null,'limit':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x1b')]||null:null,'include':_0xb8dc08[_0x9726('0x18')]?_0xb8dc08[_0x9726('0x18')][_0x9726('0x1c')]?_[_0x9726('0x1d')](_0xb8dc08[_0x9726('0x18')][_0x9726('0x1c')],function(_0x16600e){return{'model':db[_0x16600e['model']],'as':_0x16600e['as'],'attributes':_0x16600e[_0x9726('0x1a')],'include':_0x16600e[_0x9726('0x1c')]?_[_0x9726('0x1d')](_0x16600e[_0x9726('0x1c')],function(_0x44d2d3){return{'model':db[_0x44d2d3[_0x9726('0x1e')]],'as':_0x44d2d3['as'],'attributes':_0x44d2d3['attributes'],'include':_0x44d2d3[_0x9726('0x1c')]?_[_0x9726('0x1d')](_0x44d2d3[_0x9726('0x1c')],function(_0x4c1716){return{'model':db[_0x4c1716['model']],'as':_0x4c1716['as'],'attributes':_0x4c1716[_0x9726('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9726('0xc')](function(_0x5a9596){logger[_0x9726('0x12')](_0x9726('0x1f'),_0xb8dc08);logger[_0x9726('0xf')]('GetVoiceCallReport',_0xb8dc08,JSON[_0x9726('0x20')](_0x5a9596));_0x38acc3(_0x5a9596);})[_0x9726('0x14')](function(_0xcda9ea){logger[_0x9726('0x10')](_0x9726('0x1f'),_0xcda9ea[_0x9726('0x11')],_0xb8dc08);_0xefce2f(_0x3333d5[_0x9726('0x10')](0x1f4,_0xcda9ea[_0x9726('0x11')]));});});};exports[_0x9726('0x21')]=function(_0x4af457){var _0x183efd=this;return new Promise(function(_0x1393c2,_0x4aa386){return db[_0x9726('0x15')]['create'](_0x4af457[_0x9726('0x22')],{'raw':_0x4af457[_0x9726('0x18')]?_0x4af457['options'][_0x9726('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x164497){logger['info'](_0x9726('0x21'),_0x4af457);logger['debug']('CreateVoiceCallReport',_0x4af457,JSON[_0x9726('0x20')](_0x164497));_0x1393c2(_0x164497);})['catch'](function(_0x1c3d51){logger[_0x9726('0x10')](_0x9726('0x21'),_0x1c3d51[_0x9726('0x11')],_0x4af457);_0x4aa386(_0x183efd[_0x9726('0x10')](0x1f4,_0x1c3d51[_0x9726('0x11')]));});});};exports[_0x9726('0x23')]=function(_0x13eec7){var _0x5589dc=this;return new Promise(function(_0x495e9e,_0x3c534){return db[_0x9726('0x15')][_0x9726('0x24')](_0x13eec7['body'],{'raw':_0x13eec7[_0x9726('0x18')]?_0x13eec7[_0x9726('0x18')][_0x9726('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13eec7[_0x9726('0x18')]?_0x13eec7['options'][_0x9726('0x19')]||null:null,'attributes':_0x13eec7['options']?_0x13eec7['options'][_0x9726('0x1a')]||null:null,'limit':_0x13eec7[_0x9726('0x18')]?_0x13eec7[_0x9726('0x18')][_0x9726('0x1b')]||null:null})['then'](function(_0x4fc5c7){logger['info'](_0x9726('0x23'),_0x13eec7);logger[_0x9726('0xf')](_0x9726('0x23'),_0x13eec7,JSON[_0x9726('0x20')](_0x4fc5c7));_0x495e9e(_0x4fc5c7);})['catch'](function(_0x19e5fd){logger['error'](_0x9726('0x23'),_0x19e5fd[_0x9726('0x11')],_0x13eec7);_0x3c534(_0x5589dc[_0x9726('0x10')](0x1f4,_0x19e5fd['message']));});});}; \ No newline at end of file +var _0xa9da=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','update','body','UpdateVoiceCallReport','lodash','util'];(function(_0x36ff48,_0x3fc943){var _0x485d93=function(_0x5cb220){while(--_0x5cb220){_0x36ff48['push'](_0x36ff48['shift']());}};_0x485d93(++_0x3fc943);}(_0xa9da,0x1d2));var _0xaa9d=function(_0x3dc483,_0x56fbe4){_0x3dc483=_0x3dc483-0x0;var _0x3518fa=_0xa9da[_0x3dc483];return _0x3518fa;};'use strict';var _=require(_0xaa9d('0x0'));var util=require(_0xaa9d('0x1'));var moment=require(_0xaa9d('0x2'));var BPromise=require(_0xaa9d('0x3'));var rs=require(_0xaa9d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa9d('0x5'));var logger=require(_0xaa9d('0x6'))(_0xaa9d('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa9d('0x8'));var client=jayson[_0xaa9d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e399d,_0x22b6ff,_0x5b88b2){return new BPromise(function(_0x344e4b,_0xce0e7f){return client[_0xaa9d('0xa')](_0x5e399d,_0x5b88b2)[_0xaa9d('0xb')](function(_0x45b3ab){logger[_0xaa9d('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x22b6ff,_0xaa9d('0xd'));logger[_0xaa9d('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x22b6ff,_0xaa9d('0xd'),JSON[_0xaa9d('0xf')](_0x45b3ab));if(_0x45b3ab[_0xaa9d('0x10')]){if(_0x45b3ab[_0xaa9d('0x10')]['code']===0x1f4){logger[_0xaa9d('0x10')](_0xaa9d('0x11'),_0x22b6ff,_0x45b3ab[_0xaa9d('0x10')][_0xaa9d('0x12')]);return _0xce0e7f(_0x45b3ab[_0xaa9d('0x10')][_0xaa9d('0x12')]);}logger[_0xaa9d('0x10')](_0xaa9d('0x11'),_0x22b6ff,_0x45b3ab['error']['message']);return _0x344e4b(_0x45b3ab[_0xaa9d('0x10')][_0xaa9d('0x12')]);}else{logger[_0xaa9d('0xc')](_0xaa9d('0x11'),_0x22b6ff,_0xaa9d('0xd'));_0x344e4b(_0x45b3ab[_0xaa9d('0x13')][_0xaa9d('0x12')]);}})[_0xaa9d('0x14')](function(_0xd77db9){logger[_0xaa9d('0x10')](_0xaa9d('0x11'),_0x22b6ff,_0xd77db9);_0xce0e7f(_0xd77db9);});});}exports[_0xaa9d('0x15')]=function(_0x2eec2a){var _0x26b7ca=this;return new Promise(function(_0x1333a6,_0x33719a){return db[_0xaa9d('0x16')][_0xaa9d('0x17')]({'raw':_0x2eec2a[_0xaa9d('0x18')]?_0x2eec2a[_0xaa9d('0x18')][_0xaa9d('0x19')]===undefined?!![]:![]:!![],'where':_0x2eec2a[_0xaa9d('0x18')]?_0x2eec2a[_0xaa9d('0x18')][_0xaa9d('0x1a')]||null:null,'attributes':_0x2eec2a[_0xaa9d('0x18')]?_0x2eec2a['options'][_0xaa9d('0x1b')]||null:null,'limit':_0x2eec2a[_0xaa9d('0x18')]?_0x2eec2a['options'][_0xaa9d('0x1c')]||null:null,'include':_0x2eec2a['options']?_0x2eec2a[_0xaa9d('0x18')][_0xaa9d('0x1d')]?_[_0xaa9d('0x1e')](_0x2eec2a['options']['include'],function(_0x5c91f7){return{'model':db[_0x5c91f7['model']],'as':_0x5c91f7['as'],'attributes':_0x5c91f7[_0xaa9d('0x1b')],'include':_0x5c91f7[_0xaa9d('0x1d')]?_[_0xaa9d('0x1e')](_0x5c91f7[_0xaa9d('0x1d')],function(_0x1d44e6){return{'model':db[_0x1d44e6[_0xaa9d('0x1f')]],'as':_0x1d44e6['as'],'attributes':_0x1d44e6[_0xaa9d('0x1b')],'include':_0x1d44e6[_0xaa9d('0x1d')]?_['map'](_0x1d44e6[_0xaa9d('0x1d')],function(_0x2fd504){return{'model':db[_0x2fd504[_0xaa9d('0x1f')]],'as':_0x2fd504['as'],'attributes':_0x2fd504[_0xaa9d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaa9d('0xb')](function(_0x31aae8){logger['info'](_0xaa9d('0x15'),_0x2eec2a);logger[_0xaa9d('0xe')]('GetVoiceCallReport',_0x2eec2a,JSON[_0xaa9d('0xf')](_0x31aae8));_0x1333a6(_0x31aae8);})[_0xaa9d('0x14')](function(_0x48a1d8){logger[_0xaa9d('0x10')](_0xaa9d('0x15'),_0x48a1d8[_0xaa9d('0x12')],_0x2eec2a);_0x33719a(_0x26b7ca[_0xaa9d('0x10')](0x1f4,_0x48a1d8[_0xaa9d('0x12')]));});});};exports['CreateVoiceCallReport']=function(_0x322ab3){var _0x890cc4=this;return new Promise(function(_0x358e64,_0x10934a){return db['VoiceCallReport']['create'](_0x322ab3['body'],{'raw':_0x322ab3[_0xaa9d('0x18')]?_0x322ab3[_0xaa9d('0x18')][_0xaa9d('0x19')]===undefined?!![]:![]:!![]})[_0xaa9d('0xb')](function(_0x5c7454){logger[_0xaa9d('0xc')](_0xaa9d('0x20'),_0x322ab3);logger[_0xaa9d('0xe')](_0xaa9d('0x20'),_0x322ab3,JSON['stringify'](_0x5c7454));_0x358e64(_0x5c7454);})[_0xaa9d('0x14')](function(_0x3c0dab){logger[_0xaa9d('0x10')](_0xaa9d('0x20'),_0x3c0dab[_0xaa9d('0x12')],_0x322ab3);_0x10934a(_0x890cc4[_0xaa9d('0x10')](0x1f4,_0x3c0dab['message']));});});};exports['UpdateVoiceCallReport']=function(_0x1de811){var _0x2cdfab=this;return new Promise(function(_0x1d17e2,_0x124456){return db[_0xaa9d('0x16')][_0xaa9d('0x21')](_0x1de811[_0xaa9d('0x22')],{'raw':_0x1de811['options']?_0x1de811['options'][_0xaa9d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1de811[_0xaa9d('0x18')]?_0x1de811[_0xaa9d('0x18')][_0xaa9d('0x1a')]||null:null,'attributes':_0x1de811['options']?_0x1de811[_0xaa9d('0x18')][_0xaa9d('0x1b')]||null:null,'limit':_0x1de811[_0xaa9d('0x18')]?_0x1de811[_0xaa9d('0x18')][_0xaa9d('0x1c')]||null:null})[_0xaa9d('0xb')](function(_0x1f2eb1){logger[_0xaa9d('0xc')]('UpdateVoiceCallReport',_0x1de811);logger['debug']('UpdateVoiceCallReport',_0x1de811,JSON[_0xaa9d('0xf')](_0x1f2eb1));_0x1d17e2(_0x1f2eb1);})[_0xaa9d('0x14')](function(_0x1eaacb){logger[_0xaa9d('0x10')](_0xaa9d('0x23'),_0x1eaacb[_0xaa9d('0x12')],_0x1de811);_0x124456(_0x2cdfab[_0xaa9d('0x10')](0x1f4,_0x1eaacb['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index ac0a499..9dd0b8c 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 _0xbdc2=['isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','get'];(function(_0x13bc9b,_0x2313f7){var _0x11fd5e=function(_0x4e20ed){while(--_0x4e20ed){_0x13bc9b['push'](_0x13bc9b['shift']());}};_0x11fd5e(++_0x2313f7);}(_0xbdc2,0x1e4));var _0x2bdc=function(_0x406c07,_0x188e1b){_0x406c07=_0x406c07-0x0;var _0x38722c=_0xbdc2[_0x406c07];return _0x38722c;};'use strict';var multer=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var path=require(_0x2bdc('0x2'));var timeout=require(_0x2bdc('0x3'));var express=require(_0x2bdc('0x4'));var router=express['Router']();var fs_extra=require(_0x2bdc('0x5'));var auth=require(_0x2bdc('0x6'));var interaction=require(_0x2bdc('0x7'));var config=require('../../config/environment');var controller=require(_0x2bdc('0x8'));router[_0x2bdc('0x9')]('/',auth[_0x2bdc('0xa')](),controller[_0x2bdc('0xb')]);router[_0x2bdc('0x9')](_0x2bdc('0xc'),auth[_0x2bdc('0xa')](),controller[_0x2bdc('0xd')]);router[_0x2bdc('0xe')]('/',auth['isAuthenticated'](),controller[_0x2bdc('0xf')]);router[_0x2bdc('0x10')](_0x2bdc('0xc'),auth['isAuthenticated'](),controller[_0x2bdc('0x11')]);router['delete'](_0x2bdc('0xc'),auth[_0x2bdc('0xa')](),controller['destroy']);module[_0x2bdc('0x12')]=router; \ No newline at end of file +var _0x76fa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x51ab83,_0x2721b9){var _0x14b6de=function(_0x243483){while(--_0x243483){_0x51ab83['push'](_0x51ab83['shift']());}};_0x14b6de(++_0x2721b9);}(_0x76fa,0x175));var _0xa76f=function(_0x50bc77,_0x4a4f2a){_0x50bc77=_0x50bc77-0x0;var _0x177b82=_0x76fa[_0x50bc77];return _0x177b82;};'use strict';var multer=require(_0xa76f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa76f('0x1'));var express=require(_0xa76f('0x2'));var router=express[_0xa76f('0x3')]();var fs_extra=require(_0xa76f('0x4'));var auth=require(_0xa76f('0x5'));var interaction=require(_0xa76f('0x6'));var config=require(_0xa76f('0x7'));var controller=require(_0xa76f('0x8'));router[_0xa76f('0x9')]('/',auth['isAuthenticated'](),controller[_0xa76f('0xa')]);router['get'](_0xa76f('0xb'),auth[_0xa76f('0xc')](),controller[_0xa76f('0xd')]);router[_0xa76f('0xe')]('/',auth[_0xa76f('0xc')](),controller[_0xa76f('0xf')]);router[_0xa76f('0x10')](_0xa76f('0xb'),auth[_0xa76f('0xc')](),controller[_0xa76f('0x11')]);router[_0xa76f('0x12')](_0xa76f('0xb'),auth[_0xa76f('0xc')](),controller[_0xa76f('0x13')]);module[_0xa76f('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 0bbcd13..b8dd014 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 _0x1fe7=['name','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x62ad32,_0x10cdd9){var _0x46d4a3=function(_0x4fa08e){while(--_0x4fa08e){_0x62ad32['push'](_0x62ad32['shift']());}};_0x46d4a3(++_0x10cdd9);}(_0x1fe7,0xb2));var _0x71fe=function(_0x25ce8f,_0x45588c){_0x25ce8f=_0x25ce8f-0x0;var _0x5e03f4=_0x1fe7[_0x25ce8f];return _0x5e03f4;};'use strict';var Sequelize=require(_0x71fe('0x0'));module['exports']={'name':{'type':Sequelize[_0x71fe('0x1')]},'prefix':{'type':Sequelize[_0x71fe('0x1')],'unique':_0x71fe('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x71fe('0x1')],'set':function(_0xcd769){this[_0x71fe('0x3')](_0x71fe('0x4'),_0xcd769?_0xcd769[_0x71fe('0x5')](''):[]);},'get':function(){return this[_0x71fe('0x6')](_0x71fe('0x4'))?this['getDataValue'](_0x71fe('0x4'))[_0x71fe('0x7')](''):[];}},'auth':{'type':Sequelize[_0x71fe('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x71fe('0x1')]},'description':{'type':Sequelize[_0x71fe('0x1')]}}; \ No newline at end of file +var _0xfd24=['options','split','BOOLEAN','sequelize','exports','STRING','name','join','getDataValue'];(function(_0x5a4526,_0x521684){var _0x4d5f94=function(_0x240bd6){while(--_0x240bd6){_0x5a4526['push'](_0x5a4526['shift']());}};_0x4d5f94(++_0x521684);}(_0xfd24,0x16b));var _0x4fd2=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xfd24[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0x4fd2('0x0'));module[_0x4fd2('0x1')]={'name':{'type':Sequelize[_0x4fd2('0x2')]},'prefix':{'type':Sequelize[_0x4fd2('0x2')],'unique':_0x4fd2('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x4fd2('0x2')],'set':function(_0x494357){this['setDataValue']('options',_0x494357?_0x494357[_0x4fd2('0x4')](''):[]);},'get':function(){return this[_0x4fd2('0x5')](_0x4fd2('0x6'))?this['getDataValue']('options')[_0x4fd2('0x7')](''):[];}},'auth':{'type':Sequelize[_0x4fd2('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x4fd2('0x2')]},'record':{'type':Sequelize[_0x4fd2('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4fd2('0x2')]},'description':{'type':Sequelize[_0x4fd2('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 5c640da..7ac7bcb 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 _0xdf0c=['options','includeAll','VoiceChanSpy','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5f027c,_0x37ff66){var _0x202e3d=function(_0x5152ed){while(--_0x5152ed){_0x5f027c['push'](_0x5f027c['shift']());}};_0x202e3d(++_0x37ff66);}(_0xdf0c,0x1ab));var _0xcdf0=function(_0x536ae6,_0x48ce92){_0x536ae6=_0x536ae6-0x0;var _0x31cfb0=_0xdf0c[_0x536ae6];return _0x31cfb0;};'use strict';var emlformat=require(_0xcdf0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcdf0('0x1'));var jsonpatch=require(_0xcdf0('0x2'));var rp=require(_0xcdf0('0x3'));var moment=require(_0xcdf0('0x4'));var BPromise=require(_0xcdf0('0x5'));var Mustache=require(_0xcdf0('0x6'));var util=require(_0xcdf0('0x7'));var path=require('path');var sox=require(_0xcdf0('0x8'));var csv=require(_0xcdf0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdf0('0xa'));var _=require(_0xcdf0('0xb'));var squel=require(_0xcdf0('0xc'));var crypto=require('crypto');var jsforce=require(_0xcdf0('0xd'));var deskjs=require(_0xcdf0('0xe'));var toCsv=require(_0xcdf0('0x9'));var querystring=require(_0xcdf0('0xf'));var Papa=require('papaparse');var Redis=require(_0xcdf0('0x10'));var authService=require(_0xcdf0('0x11'));var qs=require(_0xcdf0('0x12'));var as=require(_0xcdf0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcdf0('0x14'))(_0xcdf0('0x15'));var utils=require(_0xcdf0('0x16'));var config=require(_0xcdf0('0x17'));var licenseUtil=require(_0xcdf0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f874,_0x3da121){_0x3da121=_0x3da121||0xcc;return function(_0x3a402a){if(_0x3a402a){return _0x12f874['sendStatus'](_0x3da121);}return _0x12f874[_0xcdf0('0x19')](_0x3da121)['end']();};}function respondWithResult(_0x56ea53,_0x29429b){_0x29429b=_0x29429b||0xc8;return function(_0x2c654c){if(_0x2c654c){return _0x56ea53['status'](_0x29429b)[_0xcdf0('0x1a')](_0x2c654c);}};}function respondWithFilteredResult(_0x325972,_0x25d136){return function(_0x22acb4){if(_0x22acb4){var _0x14df00=typeof _0x25d136[_0xcdf0('0x1b')]===_0xcdf0('0x1c')&&typeof _0x25d136[_0xcdf0('0x1d')]===_0xcdf0('0x1c');var _0x434df2=_0x22acb4[_0xcdf0('0x1e')];var _0x1323df=_0x14df00?0x0:_0x25d136[_0xcdf0('0x1b')];var _0x1c4515=_0x14df00?_0x22acb4['count']:_0x25d136[_0xcdf0('0x1b')]+_0x25d136[_0xcdf0('0x1d')];var _0x5d74fb;if(_0x1c4515>=_0x434df2){_0x1c4515=_0x434df2;_0x5d74fb=0xc8;}else{_0x5d74fb=0xce;}_0x325972[_0xcdf0('0x19')](_0x5d74fb);return _0x325972[_0xcdf0('0x1f')](_0xcdf0('0x20'),_0x1323df+'-'+_0x1c4515+'/'+_0x434df2)[_0xcdf0('0x1a')](_0x22acb4);}return null;};}function patchUpdates(_0xcf6826){return function(_0x32e860){try{jsonpatch[_0xcdf0('0x21')](_0x32e860,_0xcf6826,!![]);}catch(_0x2c4eb8){return BPromise['reject'](_0x2c4eb8);}return _0x32e860[_0xcdf0('0x22')]();};}function saveUpdates(_0x4c57d4,_0x4e08d6){return function(_0x1a3c71){if(_0x1a3c71){return _0x1a3c71[_0xcdf0('0x23')](_0x4c57d4)[_0xcdf0('0x24')](function(_0x517b97){return _0x517b97;});}return null;};}function removeEntity(_0x2359d2,_0x37bb32){return function(_0x446a8f){if(_0x446a8f){return _0x446a8f[_0xcdf0('0x25')]()[_0xcdf0('0x24')](function(){var _0x2eb11a=_0x446a8f[_0xcdf0('0x26')]({'plain':!![]});var _0x18e3f5='ChanSpies';return db[_0xcdf0('0x27')][_0xcdf0('0x25')]({'where':{'type':_0x18e3f5,'resourceId':_0x2eb11a['id']}})[_0xcdf0('0x24')](function(){return _0x446a8f;});})['then'](function(){_0x2359d2[_0xcdf0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30ec87,_0x2b1214){return function(_0x4f8d1f){if(!_0x4f8d1f){_0x30ec87[_0xcdf0('0x28')](0x194);}return _0x4f8d1f;};}function handleError(_0x549ee3,_0x2f10f7){_0x2f10f7=_0x2f10f7||0x1f4;return function(_0x466432){logger[_0xcdf0('0x29')](_0x466432[_0xcdf0('0x2a')]);if(_0x466432[_0xcdf0('0x2b')]){delete _0x466432[_0xcdf0('0x2b')];}_0x549ee3[_0xcdf0('0x19')](_0x2f10f7)[_0xcdf0('0x2c')](_0x466432);};}exports[_0xcdf0('0x2d')]=function(_0x4f5b10,_0x5abc1c){var _0x215b67={},_0x489add={},_0x4078b0={'count':0x0,'rows':[]};var _0x5bccaa=_[_0xcdf0('0x2e')](db['VoiceChanSpy'][_0xcdf0('0x2f')],function(_0x2d2380){return{'name':_0x2d2380[_0xcdf0('0x30')],'type':_0x2d2380[_0xcdf0('0x31')][_0xcdf0('0x32')]};});_0x489add[_0xcdf0('0x33')]=_[_0xcdf0('0x2e')](_0x5bccaa,'name');_0x489add[_0xcdf0('0x34')]=_[_0xcdf0('0x35')](_0x4f5b10[_0xcdf0('0x34')]);_0x489add[_0xcdf0('0x36')]=_['intersection'](_0x489add['model'],_0x489add['query']);_0x215b67[_0xcdf0('0x37')]=_[_0xcdf0('0x38')](_0x489add[_0xcdf0('0x33')],qs[_0xcdf0('0x39')](_0x4f5b10['query'][_0xcdf0('0x39')]));_0x215b67[_0xcdf0('0x37')]=_0x215b67[_0xcdf0('0x37')][_0xcdf0('0x3a')]?_0x215b67[_0xcdf0('0x37')]:_0x489add[_0xcdf0('0x33')];if(!_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x3b')](_0xcdf0('0x3c'))){_0x215b67['limit']=qs[_0xcdf0('0x1d')](_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x1d')]);_0x215b67[_0xcdf0('0x1b')]=qs['offset'](_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x1b')]);}_0x215b67['order']=qs[_0xcdf0('0x3d')](_0x4f5b10['query'][_0xcdf0('0x3d')]);_0x215b67[_0xcdf0('0x3e')]=qs[_0xcdf0('0x36')](_['pick'](_0x4f5b10['query'],_0x489add['filters']),_0x5bccaa);if(_0x4f5b10['query'][_0xcdf0('0x3f')]){_0x215b67['where']=_[_0xcdf0('0x40')](_0x215b67['where'],{'$or':_[_0xcdf0('0x2e')](_0x5bccaa,function(_0x183461){if(_0x183461[_0xcdf0('0x31')]!=='VIRTUAL'){var _0x528c76={};_0x528c76[_0x183461[_0xcdf0('0x2b')]]={'$like':'%'+_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x3f')]+'%'};return _0x528c76;}})});}_0x215b67=_[_0xcdf0('0x40')]({},_0x215b67,_0x4f5b10[_0xcdf0('0x41')]);var _0x1a81ad={'where':_0x215b67[_0xcdf0('0x3e')]};return db['VoiceChanSpy'][_0xcdf0('0x1e')](_0x1a81ad)['then'](function(_0x1d6783){_0x4078b0[_0xcdf0('0x1e')]=_0x1d6783;if(_0x4f5b10[_0xcdf0('0x34')][_0xcdf0('0x42')]){_0x215b67['include']=[{'all':!![]}];}return db[_0xcdf0('0x43')]['findAll'](_0x215b67);})[_0xcdf0('0x24')](function(_0x43a7f){_0x4078b0[_0xcdf0('0x44')]=_0x43a7f;return _0x4078b0;})[_0xcdf0('0x24')](respondWithFilteredResult(_0x5abc1c,_0x215b67))[_0xcdf0('0x45')](handleError(_0x5abc1c,null));};exports[_0xcdf0('0x46')]=function(_0x279df5,_0x30ce09){var _0x1fef81={'raw':![],'where':{'id':_0x279df5[_0xcdf0('0x47')]['id']}},_0x16f1c5={};_0x16f1c5[_0xcdf0('0x33')]=_[_0xcdf0('0x35')](db[_0xcdf0('0x43')][_0xcdf0('0x2f')]);_0x16f1c5['query']=_[_0xcdf0('0x35')](_0x279df5[_0xcdf0('0x34')]);_0x16f1c5['filters']=_[_0xcdf0('0x38')](_0x16f1c5[_0xcdf0('0x33')],_0x16f1c5[_0xcdf0('0x34')]);_0x1fef81['attributes']=_[_0xcdf0('0x38')](_0x16f1c5[_0xcdf0('0x33')],qs[_0xcdf0('0x39')](_0x279df5[_0xcdf0('0x34')]['fields']));_0x1fef81[_0xcdf0('0x37')]=_0x1fef81[_0xcdf0('0x37')][_0xcdf0('0x3a')]?_0x1fef81[_0xcdf0('0x37')]:_0x16f1c5[_0xcdf0('0x33')];if(_0x279df5['query']['includeAll']){_0x1fef81[_0xcdf0('0x48')]=[{'all':!![]}];}_0x1fef81=_[_0xcdf0('0x40')]({},_0x1fef81,_0x279df5[_0xcdf0('0x41')]);return db['VoiceChanSpy'][_0xcdf0('0x49')](_0x1fef81)[_0xcdf0('0x24')](handleEntityNotFound(_0x30ce09,null))[_0xcdf0('0x24')](respondWithResult(_0x30ce09,null))[_0xcdf0('0x45')](handleError(_0x30ce09,null));};exports[_0xcdf0('0x4a')]=function(_0x95f7d1,_0x374b37){return db[_0xcdf0('0x43')][_0xcdf0('0x4a')](_0x95f7d1[_0xcdf0('0x4b')],{})[_0xcdf0('0x24')](function(_0x524851){var _0x13195d=_0x95f7d1[_0xcdf0('0x4c')][_0xcdf0('0x26')]({'plain':!![]});if(!_0x13195d)throw new Error(_0xcdf0('0x4d'));if(_0x13195d[_0xcdf0('0x4e')]===_0xcdf0('0x4c')){var _0x33bc14=_0x524851[_0xcdf0('0x26')]({'plain':!![]});var _0x394f95=_0xcdf0('0x4f');return db[_0xcdf0('0x50')][_0xcdf0('0x49')]({'where':{'name':_0x394f95,'userProfileId':_0x13195d['userProfileId']},'raw':!![]})[_0xcdf0('0x24')](function(_0x2dd30b){if(_0x2dd30b&&_0x2dd30b[_0xcdf0('0x51')]===0x0){return db[_0xcdf0('0x27')][_0xcdf0('0x4a')]({'name':_0x33bc14[_0xcdf0('0x2b')],'resourceId':_0x33bc14['id'],'type':_0x2dd30b['name'],'sectionId':_0x2dd30b['id']},{})[_0xcdf0('0x24')](function(){return _0x524851;});}else{return _0x524851;}})['catch'](function(_0x5784a0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5784a0);throw _0x5784a0;});}return _0x524851;})[_0xcdf0('0x24')](respondWithResult(_0x374b37,0xc9))['catch'](handleError(_0x374b37,null));};exports[_0xcdf0('0x23')]=function(_0x310c50,_0x3893e5){if(_0x310c50[_0xcdf0('0x4b')]['id']){delete _0x310c50[_0xcdf0('0x4b')]['id'];}return db[_0xcdf0('0x43')][_0xcdf0('0x49')]({'where':{'id':_0x310c50[_0xcdf0('0x47')]['id']}})[_0xcdf0('0x24')](handleEntityNotFound(_0x3893e5,null))[_0xcdf0('0x24')](saveUpdates(_0x310c50['body'],null))[_0xcdf0('0x24')](respondWithResult(_0x3893e5,null))[_0xcdf0('0x45')](handleError(_0x3893e5,null));};exports[_0xcdf0('0x25')]=function(_0x18216f,_0x3b72e9){return db[_0xcdf0('0x43')][_0xcdf0('0x49')]({'where':{'id':_0x18216f[_0xcdf0('0x47')]['id']}})[_0xcdf0('0x24')](handleEntityNotFound(_0x3b72e9,null))['then'](removeEntity(_0x3b72e9,null))[_0xcdf0('0x45')](handleError(_0x3b72e9,null));}; \ No newline at end of file +var _0x6f7a=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','ChanSpies','destroy','then','sendStatus','error','stack','name','send','index','VoiceChanSpy','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x53c43a,_0x293e7c){var _0xb00b70=function(_0x2fd3f6){while(--_0x2fd3f6){_0x53c43a['push'](_0x53c43a['shift']());}};_0xb00b70(++_0x293e7c);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x382b44,_0x271b34){_0x382b44=_0x382b44-0x0;var _0x3ebae6=_0x6f7a[_0x382b44];return _0x3ebae6;};'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(){var _0x2f4907=_0x28263e['get']({'plain':!![]});var _0x47ef97=_0xa6f7('0x23');return db['UserProfileResource'][_0xa6f7('0x24')]({'where':{'type':_0x47ef97,'resourceId':_0x2f4907['id']}})[_0xa6f7('0x25')](function(){return _0x28263e;});})[_0xa6f7('0x25')](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)[_0xa6f7('0x1a')]();});}};}function handleEntityNotFound(_0x4b8d2b,_0x51db47){return function(_0x1c419b){if(!_0x1c419b){_0x4b8d2b[_0xa6f7('0x26')](0x194);}return _0x1c419b;};}function handleError(_0x55d45a,_0x267917){_0x267917=_0x267917||0x1f4;return function(_0x27babb){logger[_0xa6f7('0x27')](_0x27babb[_0xa6f7('0x28')]);if(_0x27babb[_0xa6f7('0x29')]){delete _0x27babb[_0xa6f7('0x29')];}_0x55d45a[_0xa6f7('0x19')](_0x267917)[_0xa6f7('0x2a')](_0x27babb);};}exports[_0xa6f7('0x2b')]=function(_0x3dee2e,_0x40b0f8){var _0x278bad={},_0x52f9c1={},_0x442ccf={'count':0x0,'rows':[]};var _0x42dc49=_['map'](db[_0xa6f7('0x2c')][_0xa6f7('0x2d')],function(_0x4d79d8){return{'name':_0x4d79d8['fieldName'],'type':_0x4d79d8[_0xa6f7('0x2e')][_0xa6f7('0x2f')]};});_0x52f9c1[_0xa6f7('0x30')]=_[_0xa6f7('0x31')](_0x42dc49,_0xa6f7('0x29'));_0x52f9c1['query']=_['keys'](_0x3dee2e[_0xa6f7('0x32')]);_0x52f9c1['filters']=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],_0x52f9c1[_0xa6f7('0x32')]);_0x278bad[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],qs['fields'](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x35')]));_0x278bad[_0xa6f7('0x34')]=_0x278bad['attributes'][_0xa6f7('0x36')]?_0x278bad['attributes']:_0x52f9c1[_0xa6f7('0x30')];if(!_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x37')]('nolimit')){_0x278bad[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x1d')]);_0x278bad[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x3dee2e['query'][_0xa6f7('0x1e')]);}_0x278bad[_0xa6f7('0x38')]=qs[_0xa6f7('0x39')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x39')]);_0x278bad[_0xa6f7('0x3a')]=qs[_0xa6f7('0x3b')](_[_0xa6f7('0x3c')](_0x3dee2e['query'],_0x52f9c1[_0xa6f7('0x3b')]),_0x42dc49);if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x3d')]){_0x278bad['where']=_[_0xa6f7('0x3e')](_0x278bad[_0xa6f7('0x3a')],{'$or':_['map'](_0x42dc49,function(_0x39349a){if(_0x39349a[_0xa6f7('0x2e')]!==_0xa6f7('0x3f')){var _0x14d532={};_0x14d532[_0x39349a[_0xa6f7('0x29')]]={'$like':'%'+_0x3dee2e['query'][_0xa6f7('0x3d')]+'%'};return _0x14d532;}})});}_0x278bad=_[_0xa6f7('0x3e')]({},_0x278bad,_0x3dee2e[_0xa6f7('0x40')]);var _0x1b8bf3={'where':_0x278bad[_0xa6f7('0x3a')]};return db[_0xa6f7('0x2c')][_0xa6f7('0x1f')](_0x1b8bf3)[_0xa6f7('0x25')](function(_0x5646b9){_0x442ccf['count']=_0x5646b9;if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x41')]){_0x278bad[_0xa6f7('0x42')]=[{'all':!![]}];}return db[_0xa6f7('0x2c')][_0xa6f7('0x43')](_0x278bad);})[_0xa6f7('0x25')](function(_0x21fdd7){_0x442ccf[_0xa6f7('0x44')]=_0x21fdd7;return _0x442ccf;})[_0xa6f7('0x25')](respondWithFilteredResult(_0x40b0f8,_0x278bad))[_0xa6f7('0x45')](handleError(_0x40b0f8,null));};exports['show']=function(_0x41917c,_0x30be3b){var _0x4d5846={'raw':![],'where':{'id':_0x41917c[_0xa6f7('0x46')]['id']}},_0x22d500={};_0x22d500[_0xa6f7('0x30')]=_[_0xa6f7('0x47')](db['VoiceChanSpy'][_0xa6f7('0x2d')]);_0x22d500['query']=_['keys'](_0x41917c[_0xa6f7('0x32')]);_0x22d500[_0xa6f7('0x3b')]=_[_0xa6f7('0x33')](_0x22d500[_0xa6f7('0x30')],_0x22d500[_0xa6f7('0x32')]);_0x4d5846[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x22d500['model'],qs[_0xa6f7('0x35')](_0x41917c[_0xa6f7('0x32')]['fields']));_0x4d5846[_0xa6f7('0x34')]=_0x4d5846[_0xa6f7('0x34')][_0xa6f7('0x36')]?_0x4d5846['attributes']:_0x22d500[_0xa6f7('0x30')];if(_0x41917c['query'][_0xa6f7('0x41')]){_0x4d5846[_0xa6f7('0x42')]=[{'all':!![]}];}_0x4d5846=_[_0xa6f7('0x3e')]({},_0x4d5846,_0x41917c['options']);return db['VoiceChanSpy'][_0xa6f7('0x48')](_0x4d5846)['then'](handleEntityNotFound(_0x30be3b,null))[_0xa6f7('0x25')](respondWithResult(_0x30be3b,null))['catch'](handleError(_0x30be3b,null));};exports['create']=function(_0x1e7089,_0x2e3a04){return db[_0xa6f7('0x2c')][_0xa6f7('0x49')](_0x1e7089[_0xa6f7('0x4a')],{})[_0xa6f7('0x25')](function(_0x5d9b6f){var _0x4032fc=_0x1e7089[_0xa6f7('0x4b')]['get']({'plain':!![]});if(!_0x4032fc)throw new Error(_0xa6f7('0x4c'));if(_0x4032fc['role']===_0xa6f7('0x4b')){var _0x59091a=_0x5d9b6f['get']({'plain':!![]});var _0x60eacc=_0xa6f7('0x23');return db[_0xa6f7('0x4d')][_0xa6f7('0x48')]({'where':{'name':_0x60eacc,'userProfileId':_0x4032fc[_0xa6f7('0x4e')]},'raw':!![]})['then'](function(_0x340d3f){if(_0x340d3f&&_0x340d3f[_0xa6f7('0x4f')]===0x0){return db['UserProfileResource'][_0xa6f7('0x49')]({'name':_0x59091a['name'],'resourceId':_0x59091a['id'],'type':_0x340d3f[_0xa6f7('0x29')],'sectionId':_0x340d3f['id']},{})[_0xa6f7('0x25')](function(){return _0x5d9b6f;});}else{return _0x5d9b6f;}})[_0xa6f7('0x45')](function(_0x55369a){logger[_0xa6f7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55369a);throw _0x55369a;});}return _0x5d9b6f;})[_0xa6f7('0x25')](respondWithResult(_0x2e3a04,0xc9))[_0xa6f7('0x45')](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x50')]=function(_0x1dcb45,_0xa6bff9){if(_0x1dcb45['body']['id']){delete _0x1dcb45['body']['id'];}return db[_0xa6f7('0x2c')][_0xa6f7('0x48')]({'where':{'id':_0x1dcb45[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0xa6bff9,null))['then'](saveUpdates(_0x1dcb45[_0xa6f7('0x4a')],null))[_0xa6f7('0x25')](respondWithResult(_0xa6bff9,null))[_0xa6f7('0x45')](handleError(_0xa6bff9,null));};exports[_0xa6f7('0x24')]=function(_0x1b33a5,_0x39538e){return db['VoiceChanSpy'][_0xa6f7('0x48')]({'where':{'id':_0x1b33a5[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x39538e,null))['then'](removeEntity(_0x39538e,null))[_0xa6f7('0x45')](handleError(_0x39538e,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index d0902a6..027972a 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 _0xd5e0=['length','internal','concat','User','findAll','agent','exports','models','define','VoiceChanSpy','then','catch','VoiceExtension','destroy','bulkCreate','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor'];(function(_0x1ef2e3,_0x380ec2){var _0x173e11=function(_0x574cb9){while(--_0x574cb9){_0x1ef2e3['push'](_0x1ef2e3['shift']());}};_0x173e11(++_0x380ec2);}(_0xd5e0,0x127));var _0x0d5e=function(_0x3fe7ac,_0x23f335){_0x3fe7ac=_0x3fe7ac-0x0;var _0x453e35=_0xd5e0[_0x3fe7ac];return _0x453e35;};'use strict';var _=require(_0x0d5e('0x0'));var util=require(_0x0d5e('0x1'));var BPromise=require('bluebird');var attributes=require(_0x0d5e('0x2'));var getUserApplications=function(_0x4873b9,_0x3206ed,_0x24458c){var _0x124320=0x1;var _0x2325b2=[];var _0x55903d={'context':_0x3206ed[_0x0d5e('0x3')]||_0x0d5e('0x4'),'exten':util[_0x0d5e('0x5')](_0x0d5e('0x6'),_0x4873b9[_0x0d5e('0x7')],_0x24458c),'type':_0x0d5e('0x8'),'isApp':![],'ChanSpyId':_0x4873b9['id'],'UserId':_0x3206ed['id']};_0x2325b2[_0x0d5e('0x9')](_[_0x0d5e('0xa')]({'app':_0x0d5e('0xb'),'appdata':util[_0x0d5e('0x5')](_0x0d5e('0xc'),_0x0d5e('0xd')),'priority':_0x124320++},_0x55903d));if(_0x4873b9[_0x0d5e('0xe')]){_0x2325b2['push'](_[_0x0d5e('0xa')]({'app':'MixMonitor','appdata':util[_0x0d5e('0x5')](_0x0d5e('0xf'),_0x4873b9[_0x0d5e('0x10')]),'priority':_0x124320++},_0x55903d));}if(_0x4873b9[_0x0d5e('0x11')]){_0x2325b2[_0x0d5e('0x9')](_['merge']({'app':_0x0d5e('0x12'),'appdata':_0x4873b9['password'],'priority':_0x124320++},_0x55903d));}_0x2325b2['push'](_['merge']({'app':_0x0d5e('0x13'),'appdata':util[_0x0d5e('0x5')](_0x0d5e('0x14'),_0x3206ed[_0x0d5e('0x15')],_0x4873b9[_0x0d5e('0x16')]?_0x4873b9['options'][_0x0d5e('0x17')](''):''),'priority':_0x124320++},_0x55903d));if(_0x4873b9[_0x0d5e('0xe')]){_0x2325b2[_0x0d5e('0x9')](_[_0x0d5e('0xa')]({'app':_0x0d5e('0x18'),'priority':_0x124320++},_0x55903d));}return _0x2325b2;};var getChanSpyApplications=function(_0x23731b,_0x52c630){var _0x9269fb=[];for(var _0x472db1=0x0,_0x111c86=0x1;_0x472db1<_0x52c630[_0x0d5e('0x19')];_0x472db1++,_0x111c86=0x1){_0x9269fb=_0x9269fb['concat'](getUserApplications(_0x23731b,_0x52c630[_0x472db1],_0x52c630[_0x472db1][_0x0d5e('0x1a')]));if(_0x52c630[_0x472db1]['internal']!=_0x52c630[_0x472db1][_0x0d5e('0x15')]){_0x9269fb=_0x9269fb[_0x0d5e('0x1b')](getUserApplications(_0x23731b,_0x52c630[_0x472db1],_0x52c630[_0x472db1][_0x0d5e('0x15')]));}}return _0x9269fb;};var getChanSpyPromise=function(_0x26f58b,_0xf0a20){return new BPromise(function(_0xd1a93a,_0x3ad5da){return _0x26f58b[_0x0d5e('0x1c')][_0x0d5e('0x1d')]({'attributes':['id',_0x0d5e('0x15'),_0x0d5e('0x1a')],'where':{'role':_0x0d5e('0x1e'),'chanspy':!![]},'raw':!![]})['then'](function(_0x7d5221){if(_0x7d5221){return _0xd1a93a(getChanSpyApplications(_0xf0a20,_0x7d5221));}return _0xd1a93a([]);})['catch'](function(_0xfe2063){_0x3ad5da(_0xfe2063);});});};module[_0x0d5e('0x1f')]=function(_0x13ce68,_0xa6142a){var _0x3f2abc=_0x13ce68[_0x0d5e('0x20')];return _0x13ce68[_0x0d5e('0x21')](_0x0d5e('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x102497,_0x4de713,_0x442505){return getChanSpyPromise(_0x3f2abc,_0x102497)[_0x0d5e('0x23')](function(_0x6572e5){if(_0x6572e5&&_0x6572e5[_0x0d5e('0x19')]){return _0x3f2abc['VoiceExtension']['bulkCreate'](_0x6572e5);}})[_0x0d5e('0x23')](function(){_0x442505();})[_0x0d5e('0x24')](function(_0x326d35){_0x442505(_0x326d35);});},'afterUpdate':function(_0x2d3e45,_0x2368ff,_0x1b854f){return _0x3f2abc[_0x0d5e('0x25')][_0x0d5e('0x26')]({'where':{'ChanSpyId':_0x2d3e45['id']}})[_0x0d5e('0x23')](function(){return getChanSpyPromise(_0x3f2abc,_0x2d3e45);})[_0x0d5e('0x23')](function(_0x5c0330){if(_0x5c0330&&_0x5c0330['length']){return _0x3f2abc[_0x0d5e('0x25')][_0x0d5e('0x27')](_0x5c0330);}})[_0x0d5e('0x23')](function(){_0x1b854f();})['catch'](function(_0x249537){_0x1b854f(_0x249537);});},'afterDestroy':function(_0x2f6407,_0x54b006,_0x1a3926){return _0x3f2abc[_0x0d5e('0x25')][_0x0d5e('0x26')]({'where':{'ChanSpyId':_0x2f6407['id']}})[_0x0d5e('0x23')](function(){_0x1a3926();})[_0x0d5e('0x24')](function(_0x5cfab6){_0x1a3926(_0x5cfab6);});}}});}; \ No newline at end of file +var _0xaa31=['StopMixMonitor','length','concat','internal','name','findAll','agent','then','exports','models','VoiceChanSpy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','push','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join'];(function(_0x29526e,_0x3d1d66){var _0x2cd91d=function(_0x277f43){while(--_0x277f43){_0x29526e['push'](_0x29526e['shift']());}};_0x2cd91d(++_0x3d1d66);}(_0xaa31,0x16e));var _0x1aa3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xaa31[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x1aa3('0x0'));var util=require(_0x1aa3('0x1'));var BPromise=require(_0x1aa3('0x2'));var attributes=require(_0x1aa3('0x3'));var getUserApplications=function(_0x5c7f86,_0x210f0a,_0xb9b7e){var _0x2ecd68=0x1;var _0x26eca5=[];var _0x4cd563={'context':_0x210f0a[_0x1aa3('0x4')]||_0x1aa3('0x5'),'exten':util[_0x1aa3('0x6')](_0x1aa3('0x7'),_0x5c7f86[_0x1aa3('0x8')],_0xb9b7e),'type':'system','isApp':![],'ChanSpyId':_0x5c7f86['id'],'UserId':_0x210f0a['id']};_0x26eca5[_0x1aa3('0x9')](_['merge']({'app':'Set','appdata':util[_0x1aa3('0x6')](_0x1aa3('0xa'),_0x1aa3('0xb')),'priority':_0x2ecd68++},_0x4cd563));if(_0x5c7f86[_0x1aa3('0xc')]){_0x26eca5[_0x1aa3('0x9')](_[_0x1aa3('0xd')]({'app':_0x1aa3('0xe'),'appdata':util[_0x1aa3('0x6')](_0x1aa3('0xf'),_0x5c7f86[_0x1aa3('0x10')]),'priority':_0x2ecd68++},_0x4cd563));}if(_0x5c7f86[_0x1aa3('0x11')]){_0x26eca5['push'](_[_0x1aa3('0xd')]({'app':_0x1aa3('0x12'),'appdata':_0x5c7f86[_0x1aa3('0x13')],'priority':_0x2ecd68++},_0x4cd563));}_0x26eca5[_0x1aa3('0x9')](_[_0x1aa3('0xd')]({'app':_0x1aa3('0x14'),'appdata':util[_0x1aa3('0x6')](_0x1aa3('0x15'),_0x210f0a['name'],_0x5c7f86[_0x1aa3('0x16')]?_0x5c7f86['options'][_0x1aa3('0x17')](''):''),'priority':_0x2ecd68++},_0x4cd563));if(_0x5c7f86[_0x1aa3('0xc')]){_0x26eca5['push'](_['merge']({'app':_0x1aa3('0x18'),'priority':_0x2ecd68++},_0x4cd563));}return _0x26eca5;};var getChanSpyApplications=function(_0x1d9d50,_0x4e03c4){var _0x20e079=[];for(var _0x23d790=0x0,_0x481de8=0x1;_0x23d790<_0x4e03c4[_0x1aa3('0x19')];_0x23d790++,_0x481de8=0x1){_0x20e079=_0x20e079[_0x1aa3('0x1a')](getUserApplications(_0x1d9d50,_0x4e03c4[_0x23d790],_0x4e03c4[_0x23d790]['internal']));if(_0x4e03c4[_0x23d790][_0x1aa3('0x1b')]!=_0x4e03c4[_0x23d790][_0x1aa3('0x1c')]){_0x20e079=_0x20e079['concat'](getUserApplications(_0x1d9d50,_0x4e03c4[_0x23d790],_0x4e03c4[_0x23d790]['name']));}}return _0x20e079;};var getChanSpyPromise=function(_0x266778,_0x391b5a){return new BPromise(function(_0x33e66b,_0x495b7c){return _0x266778['User'][_0x1aa3('0x1d')]({'attributes':['id',_0x1aa3('0x1c'),_0x1aa3('0x1b')],'where':{'role':_0x1aa3('0x1e'),'chanspy':!![]},'raw':!![]})[_0x1aa3('0x1f')](function(_0xcc6185){if(_0xcc6185){return _0x33e66b(getChanSpyApplications(_0x391b5a,_0xcc6185));}return _0x33e66b([]);})['catch'](function(_0x2c0863){_0x495b7c(_0x2c0863);});});};module[_0x1aa3('0x20')]=function(_0x3be7ee,_0x20a5dd){var _0x358003=_0x3be7ee[_0x1aa3('0x21')];return _0x3be7ee['define'](_0x1aa3('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x43540f,_0x1cc94f,_0x32a865){return getChanSpyPromise(_0x358003,_0x43540f)[_0x1aa3('0x1f')](function(_0x163790){if(_0x163790&&_0x163790['length']){return _0x358003[_0x1aa3('0x23')][_0x1aa3('0x24')](_0x163790);}})[_0x1aa3('0x1f')](function(){_0x32a865();})[_0x1aa3('0x25')](function(_0x272dc7){_0x32a865(_0x272dc7);});},'afterUpdate':function(_0x1219eb,_0x3b612d,_0x4a0f99){return _0x358003['VoiceExtension'][_0x1aa3('0x26')]({'where':{'ChanSpyId':_0x1219eb['id']}})[_0x1aa3('0x1f')](function(){return getChanSpyPromise(_0x358003,_0x1219eb);})[_0x1aa3('0x1f')](function(_0xa89796){if(_0xa89796&&_0xa89796[_0x1aa3('0x19')]){return _0x358003[_0x1aa3('0x23')][_0x1aa3('0x24')](_0xa89796);}})[_0x1aa3('0x1f')](function(){_0x4a0f99();})['catch'](function(_0x180f84){_0x4a0f99(_0x180f84);});},'afterDestroy':function(_0x366411,_0x9742da,_0x26306d){return _0x358003[_0x1aa3('0x23')]['destroy']({'where':{'ChanSpyId':_0x366411['id']}})[_0x1aa3('0x1f')](function(){_0x26306d();})[_0x1aa3('0x25')](function(_0x11d7cc){_0x26306d(_0x11d7cc);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 564a394..d7413db 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 _0x0102=['info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0102,0x186));var _0x2010=function(_0x5b57ac,_0x5bad7e){_0x5b57ac=_0x5b57ac-0x0;var _0x539795=_0x0102[_0x5b57ac];return _0x539795;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var moment=require(_0x2010('0x1'));var BPromise=require(_0x2010('0x2'));var rs=require(_0x2010('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2010('0x4'));var jayson=require(_0x2010('0x5'));var client=jayson[_0x2010('0x6')][_0x2010('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4eeb67,_0x453fc0,_0x495d98){return new BPromise(function(_0x4728c0,_0x160e41){return client['request'](_0x4eeb67,_0x495d98)[_0x2010('0x8')](function(_0x3c2d98){logger[_0x2010('0x9')](_0x2010('0xa'),_0x453fc0,_0x2010('0xb'));logger[_0x2010('0xc')](_0x2010('0xd'),_0x453fc0,_0x2010('0xb'),JSON[_0x2010('0xe')](_0x3c2d98));if(_0x3c2d98[_0x2010('0xf')]){if(_0x3c2d98[_0x2010('0xf')][_0x2010('0x10')]===0x1f4){logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);return _0x160e41(_0x3c2d98['error']['message']);}logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);return _0x4728c0(_0x3c2d98[_0x2010('0xf')][_0x2010('0x11')]);}else{logger['info'](_0x2010('0xa'),_0x453fc0,_0x2010('0xb'));_0x4728c0(_0x3c2d98['result'][_0x2010('0x11')]);}})[_0x2010('0x12')](function(_0x410889){logger[_0x2010('0xf')](_0x2010('0xa'),_0x453fc0,_0x410889);_0x160e41(_0x410889);});});} \ No newline at end of file +var _0xc6d8=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x1ef750,_0x5c36f1){var _0x5b9b9d=function(_0x341b4c){while(--_0x341b4c){_0x1ef750['push'](_0x1ef750['shift']());}};_0x5b9b9d(++_0x5c36f1);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2153a2,_0x2054f0){_0x2153a2=_0x2153a2-0x0;var _0x23fcc6=_0xc6d8[_0x2153a2];return _0x23fcc6;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('VoiceChanSpy,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 043316d..e645384 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 _0x644f=['../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','/:id','post','create','put','update','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x24c405,_0x56d6fb){var _0x383aef=function(_0x20da69){while(--_0x20da69){_0x24c405['push'](_0x24c405['shift']());}};_0x383aef(++_0x56d6fb);}(_0x644f,0x82));var _0xf644=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x644f[_0x4da356];return _0x321b07;};'use strict';var multer=require(_0xf644('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf644('0x1'));var express=require(_0xf644('0x2'));var router=express['Router']();var fs_extra=require(_0xf644('0x3'));var auth=require(_0xf644('0x4'));var interaction=require(_0xf644('0x5'));var config=require('../../config/environment');var controller=require(_0xf644('0x6'));router[_0xf644('0x7')]('/',auth[_0xf644('0x8')](),controller['index']);router['get'](_0xf644('0x9'),auth[_0xf644('0x8')](),controller['show']);router[_0xf644('0xa')]('/',auth[_0xf644('0x8')](),controller[_0xf644('0xb')]);router[_0xf644('0xc')](_0xf644('0x9'),auth[_0xf644('0x8')](),controller[_0xf644('0xd')]);router['delete']('/:id',auth[_0xf644('0x8')](),controller['destroy']);module[_0xf644('0xe')]=router; \ No newline at end of file +var _0x998c=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','get','/:id','show','post','put','delete','destroy','exports','multer','util'];(function(_0x578275,_0xe7ae46){var _0xf78041=function(_0x13148c){while(--_0x13148c){_0x578275['push'](_0x578275['shift']());}};_0xf78041(++_0xe7ae46);}(_0x998c,0x142));var _0xc998=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x998c[_0xb0fe92];return _0x41787f;};'use strict';var multer=require(_0xc998('0x0'));var util=require(_0xc998('0x1'));var path=require(_0xc998('0x2'));var timeout=require(_0xc998('0x3'));var express=require('express');var router=express[_0xc998('0x4')]();var fs_extra=require(_0xc998('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc998('0x6'));var config=require(_0xc998('0x7'));var controller=require(_0xc998('0x8'));router['get']('/',auth[_0xc998('0x9')](),controller['index']);router[_0xc998('0xa')](_0xc998('0xb'),auth[_0xc998('0x9')](),controller[_0xc998('0xc')]);router[_0xc998('0xd')]('/',auth[_0xc998('0x9')](),controller['create']);router[_0xc998('0xe')](_0xc998('0xb'),auth[_0xc998('0x9')](),controller['update']);router[_0xc998('0xf')](_0xc998('0xb'),auth[_0xc998('0x9')](),controller[_0xc998('0x10')]);module[_0xc998('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 59794d0..56ebe53 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 _0x9c61=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x1ee49d,_0x4dd730){var _0x392de7=function(_0x31a99f){while(--_0x31a99f){_0x1ee49d['push'](_0x1ee49d['shift']());}};_0x392de7(++_0x4dd730);}(_0x9c61,0x16c));var _0x19c6=function(_0x2b38a6,_0x4fbc47){_0x2b38a6=_0x2b38a6-0x0;var _0x118544=_0x9c61[_0x2b38a6];return _0x118544;};'use strict';var Sequelize=require(_0x19c6('0x0'));module[_0x19c6('0x1')]={'name':{'type':Sequelize[_0x19c6('0x2')],'unique':_0x19c6('0x3')},'description':{'type':Sequelize[_0x19c6('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x19c6('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4ebb=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4ebb,0x1a3));var _0xb4eb=function(_0x128310,_0x318fb0){_0x128310=_0x128310-0x0;var _0x41cac5=_0x4ebb[_0x128310];return _0x41cac5;};'use strict';var Sequelize=require(_0xb4eb('0x0'));module[_0xb4eb('0x1')]={'name':{'type':Sequelize[_0xb4eb('0x2')],'unique':_0xb4eb('0x3')},'description':{'type':Sequelize[_0xb4eb('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb4eb('0x4')],'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 ed01b54..a34303d 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 _0xb000=['moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','get','Contexts','destroy','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','params','length','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload','utf8','rimraf','fast-json-patch'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0xb000,0x1ed));var _0x0b00=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0xb000[_0x4d521e];return _0x3beb42;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b00('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b00('0x1'));var rp=require('request-promise');var moment=require(_0x0b00('0x2'));var BPromise=require(_0x0b00('0x3'));var Mustache=require(_0x0b00('0x4'));var util=require('util');var path=require(_0x0b00('0x5'));var sox=require(_0x0b00('0x6'));var csv=require(_0x0b00('0x7'));var ejs=require(_0x0b00('0x8'));var fs=require('fs');var fs_extra=require(_0x0b00('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0b00('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0b00('0x7'));var querystring=require(_0x0b00('0xb'));var Papa=require(_0x0b00('0xc'));var Redis=require('ioredis');var authService=require(_0x0b00('0xd'));var qs=require(_0x0b00('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b00('0xf'));var logger=require(_0x0b00('0x10'))(_0x0b00('0x11'));var utils=require(_0x0b00('0x12'));var config=require(_0x0b00('0x13'));var licenseUtil=require(_0x0b00('0x14'));var db=require(_0x0b00('0x15'))['db'];var jayson=require(_0x0b00('0x16'));var client=jayson[_0x0b00('0x17')][_0x0b00('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4018da,_0x41db47,_0x23b690,_0x32c5a0){return new BPromise(function(_0x26629a,_0x186cc8){var _0x47dc71=_0x32c5a0||client;return _0x47dc71['request'](_0x4018da,_0x23b690)[_0x0b00('0x19')](function(_0x24342c){logger[_0x0b00('0x1a')]('VoiceContext,\x20%s,\x20%s',_0x41db47,_0x0b00('0x1b'));logger[_0x0b00('0x1c')](_0x0b00('0x1d'),_0x41db47,_0x0b00('0x1b'),JSON[_0x0b00('0x1e')](_0x24342c));if(_0x24342c['error']){if(_0x24342c[_0x0b00('0x1f')]['code']===0x1f4){logger[_0x0b00('0x1f')](_0x0b00('0x20'),_0x41db47,_0x24342c['error'][_0x0b00('0x21')]);return _0x186cc8(_0x24342c[_0x0b00('0x1f')][_0x0b00('0x21')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x41db47,_0x24342c['error'][_0x0b00('0x21')]);return _0x26629a(_0x24342c['error'][_0x0b00('0x21')]);}else{logger[_0x0b00('0x1a')](_0x0b00('0x20'),_0x41db47,_0x0b00('0x1b'));_0x26629a(_0x24342c[_0x0b00('0x22')][_0x0b00('0x21')]);}})[_0x0b00('0x23')](function(_0x5e483f){logger[_0x0b00('0x1f')](_0x0b00('0x20'),_0x41db47,_0x5e483f);_0x186cc8(_0x5e483f);});});}function respondWithStatusCode(_0x5dca68,_0x579d0a){_0x579d0a=_0x579d0a||0xcc;return function(_0x2e805e){if(_0x2e805e){return _0x5dca68[_0x0b00('0x24')](_0x579d0a);}return _0x5dca68[_0x0b00('0x25')](_0x579d0a)[_0x0b00('0x26')]();};}function respondWithResult(_0x1150ed,_0x10af30){_0x10af30=_0x10af30||0xc8;return function(_0x3d68f0){if(_0x3d68f0){return _0x1150ed[_0x0b00('0x25')](_0x10af30)[_0x0b00('0x27')](_0x3d68f0);}};}function respondWithFilteredResult(_0x10944f,_0x1e6963){return function(_0x1c64d5){if(_0x1c64d5){var _0x4cc42a=typeof _0x1e6963['offset']===_0x0b00('0x28')&&typeof _0x1e6963[_0x0b00('0x29')]==='undefined';var _0xb5a3b0=_0x1c64d5[_0x0b00('0x2a')];var _0x1c2d6c=_0x4cc42a?0x0:_0x1e6963[_0x0b00('0x2b')];var _0x259880=_0x4cc42a?_0x1c64d5[_0x0b00('0x2a')]:_0x1e6963[_0x0b00('0x2b')]+_0x1e6963[_0x0b00('0x29')];var _0x1507e5;if(_0x259880>=_0xb5a3b0){_0x259880=_0xb5a3b0;_0x1507e5=0xc8;}else{_0x1507e5=0xce;}_0x10944f[_0x0b00('0x25')](_0x1507e5);return _0x10944f[_0x0b00('0x2c')]('Content-Range',_0x1c2d6c+'-'+_0x259880+'/'+_0xb5a3b0)['json'](_0x1c64d5);}return null;};}function patchUpdates(_0x3a38aa){return function(_0x33148a){try{jsonpatch[_0x0b00('0x2d')](_0x33148a,_0x3a38aa,!![]);}catch(_0x5c613c){return BPromise['reject'](_0x5c613c);}return _0x33148a[_0x0b00('0x2e')]();};}function saveUpdates(_0x4d4d9e,_0x4bb4c9){return function(_0x4eabb1){if(_0x4eabb1){return _0x4eabb1[_0x0b00('0x2f')](_0x4d4d9e)[_0x0b00('0x19')](function(_0x27176c){return _0x27176c;});}return null;};}function removeEntity(_0x306133,_0x387086){return function(_0x1f230d){if(_0x1f230d){return _0x1f230d['destroy']()[_0x0b00('0x19')](function(){var _0x10b6dd=_0x1f230d[_0x0b00('0x30')]({'plain':!![]});var _0x1ae5d5=_0x0b00('0x31');return db['UserProfileResource'][_0x0b00('0x32')]({'where':{'type':_0x1ae5d5,'resourceId':_0x10b6dd['id']}})[_0x0b00('0x19')](function(){return _0x1f230d;});})[_0x0b00('0x19')](function(){_0x306133[_0x0b00('0x25')](0xcc)[_0x0b00('0x26')]();});}};}function handleEntityNotFound(_0x1a6108,_0x1f1a75){return function(_0x2add9a){if(!_0x2add9a){_0x1a6108[_0x0b00('0x24')](0x194);}return _0x2add9a;};}function handleError(_0x3bab20,_0x1b3977){_0x1b3977=_0x1b3977||0x1f4;return function(_0x1d82c2){logger[_0x0b00('0x1f')](_0x1d82c2[_0x0b00('0x33')]);if(_0x1d82c2['name']){delete _0x1d82c2[_0x0b00('0x34')];}_0x3bab20['status'](_0x1b3977)[_0x0b00('0x35')](_0x1d82c2);};}exports[_0x0b00('0x36')]=function(_0x2b91ea,_0x3a8d0f){var _0x34d5d9={},_0x19e76b={},_0x4f9102={'count':0x0,'rows':[]};var _0x51c608=_[_0x0b00('0x37')](db[_0x0b00('0x38')][_0x0b00('0x39')],function(_0xf5d525){return{'name':_0xf5d525[_0x0b00('0x3a')],'type':_0xf5d525[_0x0b00('0x3b')][_0x0b00('0x3c')]};});_0x19e76b[_0x0b00('0x3d')]=_[_0x0b00('0x37')](_0x51c608,_0x0b00('0x34'));_0x19e76b[_0x0b00('0x3e')]=_[_0x0b00('0x3f')](_0x2b91ea[_0x0b00('0x3e')]);_0x19e76b[_0x0b00('0x40')]=_[_0x0b00('0x41')](_0x19e76b['model'],_0x19e76b[_0x0b00('0x3e')]);_0x34d5d9[_0x0b00('0x42')]=_[_0x0b00('0x41')](_0x19e76b['model'],qs[_0x0b00('0x43')](_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x43')]));_0x34d5d9[_0x0b00('0x42')]=_0x34d5d9[_0x0b00('0x42')]['length']?_0x34d5d9['attributes']:_0x19e76b[_0x0b00('0x3d')];if(!_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x44')]('nolimit')){_0x34d5d9['limit']=qs[_0x0b00('0x29')](_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x29')]);_0x34d5d9[_0x0b00('0x2b')]=qs[_0x0b00('0x2b')](_0x2b91ea[_0x0b00('0x3e')]['offset']);}_0x34d5d9[_0x0b00('0x45')]=qs[_0x0b00('0x46')](_0x2b91ea['query'][_0x0b00('0x46')]);_0x34d5d9[_0x0b00('0x47')]=qs[_0x0b00('0x40')](_['pick'](_0x2b91ea[_0x0b00('0x3e')],_0x19e76b[_0x0b00('0x40')]),_0x51c608);if(_0x2b91ea['query'][_0x0b00('0x48')]){_0x34d5d9[_0x0b00('0x47')]=_[_0x0b00('0x49')](_0x34d5d9[_0x0b00('0x47')],{'$or':_[_0x0b00('0x37')](_0x51c608,function(_0x4d8a0e){if(_0x4d8a0e[_0x0b00('0x3b')]!==_0x0b00('0x4a')){var _0x5c7811={};_0x5c7811[_0x4d8a0e[_0x0b00('0x34')]]={'$like':'%'+_0x2b91ea[_0x0b00('0x3e')]['filter']+'%'};return _0x5c7811;}})});}_0x34d5d9=_[_0x0b00('0x49')]({},_0x34d5d9,_0x2b91ea[_0x0b00('0x4b')]);var _0x2676cb={'where':_0x34d5d9[_0x0b00('0x47')]};return db[_0x0b00('0x38')]['count'](_0x2676cb)[_0x0b00('0x19')](function(_0x1f44e9){_0x4f9102[_0x0b00('0x2a')]=_0x1f44e9;if(_0x2b91ea[_0x0b00('0x3e')][_0x0b00('0x4c')]){_0x34d5d9['include']=[{'all':!![]}];}return db[_0x0b00('0x38')]['findAll'](_0x34d5d9);})[_0x0b00('0x19')](function(_0x19e1ca){_0x4f9102[_0x0b00('0x4d')]=_0x19e1ca;return _0x4f9102;})[_0x0b00('0x19')](respondWithFilteredResult(_0x3a8d0f,_0x34d5d9))[_0x0b00('0x23')](handleError(_0x3a8d0f,null));};exports['show']=function(_0xb49c6f,_0x12ee54){var _0x2c9155={'raw':![],'where':{'id':_0xb49c6f[_0x0b00('0x4e')]['id']}},_0xe11c6e={};_0xe11c6e[_0x0b00('0x3d')]=_[_0x0b00('0x3f')](db[_0x0b00('0x38')][_0x0b00('0x39')]);_0xe11c6e[_0x0b00('0x3e')]=_['keys'](_0xb49c6f[_0x0b00('0x3e')]);_0xe11c6e[_0x0b00('0x40')]=_[_0x0b00('0x41')](_0xe11c6e[_0x0b00('0x3d')],_0xe11c6e[_0x0b00('0x3e')]);_0x2c9155[_0x0b00('0x42')]=_[_0x0b00('0x41')](_0xe11c6e['model'],qs[_0x0b00('0x43')](_0xb49c6f[_0x0b00('0x3e')][_0x0b00('0x43')]));_0x2c9155[_0x0b00('0x42')]=_0x2c9155['attributes'][_0x0b00('0x4f')]?_0x2c9155[_0x0b00('0x42')]:_0xe11c6e[_0x0b00('0x3d')];if(_0xb49c6f[_0x0b00('0x3e')][_0x0b00('0x4c')]){_0x2c9155['include']=[{'all':!![]}];}_0x2c9155=_[_0x0b00('0x49')]({},_0x2c9155,_0xb49c6f[_0x0b00('0x4b')]);return db[_0x0b00('0x38')][_0x0b00('0x50')](_0x2c9155)[_0x0b00('0x19')](handleEntityNotFound(_0x12ee54,null))['then'](respondWithResult(_0x12ee54,null))[_0x0b00('0x23')](handleError(_0x12ee54,null));};exports[_0x0b00('0x51')]=function(_0x262b15,_0x5d3150,_0x16c4cc){var _0x431b2d;return db[_0x0b00('0x38')][_0x0b00('0x51')](_0x262b15[_0x0b00('0x52')],{'raw':!![]})[_0x0b00('0x19')](function(_0x8dd9ea){_0x431b2d=_0x8dd9ea;return db['VoiceContext'][_0x0b00('0x53')]({'raw':!![]});})['then'](function(_0x48dd09){var _0x59065b=fs[_0x0b00('0x54')](path[_0x0b00('0x55')](config[_0x0b00('0x56')],_0x0b00('0x57')),'utf8');var _0x168282=ejs[_0x0b00('0x58')](_0x59065b,{'contexts':_0x48dd09||[]});fs[_0x0b00('0x59')](_0x0b00('0x5a'),_0x168282);})[_0x0b00('0x19')](function(){return respondWithRpcPromise('Reload',_0x0b00('0x51'),{'module':_0x0b00('0x5b')});})[_0x0b00('0x19')](function(){var _0x191fa0=_0x262b15[_0x0b00('0x5c')]['get']({'plain':!![]});if(!_0x191fa0)throw new Error(_0x0b00('0x5d'));if(_0x191fa0['role']===_0x0b00('0x5c')){var _0x20c13d=_0x431b2d[_0x0b00('0x30')]({'plain':!![]});return db['UserProfileSection'][_0x0b00('0x50')]({'where':{'name':'Contexts','userProfileId':_0x191fa0['userProfileId']},'raw':!![]})[_0x0b00('0x19')](function(_0x23314c){if(_0x23314c&&_0x23314c[_0x0b00('0x5e')]===0x0){return db[_0x0b00('0x5f')][_0x0b00('0x51')]({'name':_0x20c13d[_0x0b00('0x34')],'resourceId':_0x20c13d['id'],'type':_0x23314c[_0x0b00('0x34')],'sectionId':_0x23314c['id']},{})[_0x0b00('0x19')](function(){return _0x431b2d;});}else{return _0x431b2d;}})[_0x0b00('0x23')](function(_0x264604){logger[_0x0b00('0x1f')](_0x0b00('0x60'),_0x264604);throw _0x264604;});}return _0x431b2d;})[_0x0b00('0x19')](respondWithResult(_0x5d3150,0xc9))[_0x0b00('0x23')](handleError(_0x5d3150,null));};exports[_0x0b00('0x2f')]=function(_0x313296,_0x5e14a9,_0x40ac5d){var _0x55e611;return db[_0x0b00('0x38')][_0x0b00('0x50')]({'where':{'id':_0x313296[_0x0b00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5e14a9,null))['then'](saveUpdates(_0x313296[_0x0b00('0x52')],null))['then'](function(_0x2a606a){if(_0x2a606a){_0x55e611=_0x2a606a;return db[_0x0b00('0x38')][_0x0b00('0x53')]({'raw':!![]});}})[_0x0b00('0x19')](function(_0x55e661){var _0x48a8b9=fs[_0x0b00('0x54')](path[_0x0b00('0x55')](config[_0x0b00('0x56')],_0x0b00('0x57')),'utf8');var _0x49a05a=ejs[_0x0b00('0x58')](_0x48a8b9,{'contexts':_0x55e661||[]});fs[_0x0b00('0x59')](_0x0b00('0x5a'),_0x49a05a);})[_0x0b00('0x19')](function(){return respondWithRpcPromise(_0x0b00('0x61'),_0x0b00('0x2f'),{'module':_0x0b00('0x5b')});})[_0x0b00('0x19')](function(){return _0x55e611;})[_0x0b00('0x19')](respondWithResult(_0x5e14a9,null))[_0x0b00('0x23')](handleError(_0x5e14a9,null));};exports[_0x0b00('0x32')]=function(_0x41f562,_0x5b8e40,_0x16034f){var _0x3b2391;return db['VoiceContext'][_0x0b00('0x50')]({'where':{'id':_0x41f562[_0x0b00('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5b8e40,null))[_0x0b00('0x19')](removeEntity(_0x5b8e40,null))['then'](function(){return db['VoiceContext'][_0x0b00('0x53')]({'raw':!![]});})['then'](function(_0x44c038){var _0x1eda67=fs[_0x0b00('0x54')](path[_0x0b00('0x55')](config[_0x0b00('0x56')],_0x0b00('0x57')),_0x0b00('0x62'));var _0x247be4=ejs[_0x0b00('0x58')](_0x1eda67,{'contexts':_0x44c038});fs['writeFileSync'](_0x0b00('0x5a'),_0x247be4);return respondWithRpcPromise('Reload',_0x0b00('0x32'),{'module':_0x0b00('0x5b')});})[_0x0b00('0x23')](handleError(_0x5b8e40,null));}; \ No newline at end of file +var _0x6bde=['Content-Range','apply','reject','save','destroy','get','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceContext','includeAll','params','include','options','find','create','findAll','readFileSync','root','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','update','body','join','server/files/templates/context.ejs','render','writeFileSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','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','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x6bde,0x109));var _0xe6bd=function(_0x57d89c,_0x5f14dd){_0x57d89c=_0x57d89c-0x0;var _0x575fb9=_0x6bde[_0x57d89c];return _0x575fb9;};'use strict';var emlformat=require(_0xe6bd('0x0'));var rimraf=require(_0xe6bd('0x1'));var zipdir=require(_0xe6bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6bd('0x3'));var moment=require(_0xe6bd('0x4'));var BPromise=require(_0xe6bd('0x5'));var Mustache=require('mustache');var util=require(_0xe6bd('0x6'));var path=require(_0xe6bd('0x7'));var sox=require(_0xe6bd('0x8'));var csv=require(_0xe6bd('0x9'));var ejs=require(_0xe6bd('0xa'));var fs=require('fs');var fs_extra=require(_0xe6bd('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe6bd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe6bd('0xd'));var toCsv=require(_0xe6bd('0x9'));var querystring=require(_0xe6bd('0xe'));var Papa=require('papaparse');var Redis=require(_0xe6bd('0xf'));var authService=require(_0xe6bd('0x10'));var qs=require(_0xe6bd('0x11'));var as=require(_0xe6bd('0x12'));var hardwareService=require(_0xe6bd('0x13'));var logger=require('../../config/logger')(_0xe6bd('0x14'));var utils=require('../../config/utils');var config=require(_0xe6bd('0x15'));var licenseUtil=require(_0xe6bd('0x16'));var db=require(_0xe6bd('0x17'))['db'];var jayson=require(_0xe6bd('0x18'));var client=jayson[_0xe6bd('0x19')][_0xe6bd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4d1e5b,_0x3bcd97,_0x518dc3,_0x29c862){return new BPromise(function(_0x5b17c2,_0x2b3955){var _0x54e7df=_0x29c862||client;return _0x54e7df[_0xe6bd('0x1b')](_0x4d1e5b,_0x518dc3)[_0xe6bd('0x1c')](function(_0x3e6404){logger[_0xe6bd('0x1d')](_0xe6bd('0x1e'),_0x3bcd97,_0xe6bd('0x1f'));logger[_0xe6bd('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3bcd97,'request\x20sent',JSON[_0xe6bd('0x21')](_0x3e6404));if(_0x3e6404[_0xe6bd('0x22')]){if(_0x3e6404[_0xe6bd('0x22')][_0xe6bd('0x23')]===0x1f4){logger[_0xe6bd('0x22')](_0xe6bd('0x1e'),_0x3bcd97,_0x3e6404[_0xe6bd('0x22')][_0xe6bd('0x24')]);return _0x2b3955(_0x3e6404[_0xe6bd('0x22')][_0xe6bd('0x24')]);}logger[_0xe6bd('0x22')](_0xe6bd('0x1e'),_0x3bcd97,_0x3e6404['error'][_0xe6bd('0x24')]);return _0x5b17c2(_0x3e6404[_0xe6bd('0x22')][_0xe6bd('0x24')]);}else{logger[_0xe6bd('0x1d')](_0xe6bd('0x1e'),_0x3bcd97,_0xe6bd('0x1f'));_0x5b17c2(_0x3e6404['result'][_0xe6bd('0x24')]);}})[_0xe6bd('0x25')](function(_0x33bf54){logger[_0xe6bd('0x22')](_0xe6bd('0x1e'),_0x3bcd97,_0x33bf54);_0x2b3955(_0x33bf54);});});}function respondWithStatusCode(_0x5c3f5e,_0x16f81b){_0x16f81b=_0x16f81b||0xcc;return function(_0x5877b8){if(_0x5877b8){return _0x5c3f5e[_0xe6bd('0x26')](_0x16f81b);}return _0x5c3f5e[_0xe6bd('0x27')](_0x16f81b)[_0xe6bd('0x28')]();};}function respondWithResult(_0x3c44b6,_0x2925eb){_0x2925eb=_0x2925eb||0xc8;return function(_0x275c44){if(_0x275c44){return _0x3c44b6[_0xe6bd('0x27')](_0x2925eb)[_0xe6bd('0x29')](_0x275c44);}};}function respondWithFilteredResult(_0x125d86,_0x217bee){return function(_0x24c80d){if(_0x24c80d){var _0x55c606=typeof _0x217bee[_0xe6bd('0x2a')]==='undefined'&&typeof _0x217bee[_0xe6bd('0x2b')]===_0xe6bd('0x2c');var _0x40ecaf=_0x24c80d[_0xe6bd('0x2d')];var _0x294dd4=_0x55c606?0x0:_0x217bee[_0xe6bd('0x2a')];var _0x527244=_0x55c606?_0x24c80d['count']:_0x217bee[_0xe6bd('0x2a')]+_0x217bee[_0xe6bd('0x2b')];var _0xb78227;if(_0x527244>=_0x40ecaf){_0x527244=_0x40ecaf;_0xb78227=0xc8;}else{_0xb78227=0xce;}_0x125d86['status'](_0xb78227);return _0x125d86[_0xe6bd('0x2e')](_0xe6bd('0x2f'),_0x294dd4+'-'+_0x527244+'/'+_0x40ecaf)[_0xe6bd('0x29')](_0x24c80d);}return null;};}function patchUpdates(_0x4696b1){return function(_0x38ac0e){try{jsonpatch[_0xe6bd('0x30')](_0x38ac0e,_0x4696b1,!![]);}catch(_0x108ba9){return BPromise[_0xe6bd('0x31')](_0x108ba9);}return _0x38ac0e[_0xe6bd('0x32')]();};}function saveUpdates(_0xcac46e,_0x466083){return function(_0x2d73d5){if(_0x2d73d5){return _0x2d73d5['update'](_0xcac46e)[_0xe6bd('0x1c')](function(_0x21bc5e){return _0x21bc5e;});}return null;};}function removeEntity(_0x31e35f,_0x5994fe){return function(_0x4a98ae){if(_0x4a98ae){return _0x4a98ae[_0xe6bd('0x33')]()[_0xe6bd('0x1c')](function(){var _0x1451ed=_0x4a98ae[_0xe6bd('0x34')]({'plain':!![]});var _0xc14e25='Contexts';return db[_0xe6bd('0x35')][_0xe6bd('0x33')]({'where':{'type':_0xc14e25,'resourceId':_0x1451ed['id']}})[_0xe6bd('0x1c')](function(){return _0x4a98ae;});})[_0xe6bd('0x1c')](function(){_0x31e35f[_0xe6bd('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4cba7,_0x53118f){return function(_0x15c91f){if(!_0x15c91f){_0xf4cba7[_0xe6bd('0x26')](0x194);}return _0x15c91f;};}function handleError(_0x4e612c,_0x366886){_0x366886=_0x366886||0x1f4;return function(_0x4cc809){logger[_0xe6bd('0x22')](_0x4cc809['stack']);if(_0x4cc809[_0xe6bd('0x36')]){delete _0x4cc809[_0xe6bd('0x36')];}_0x4e612c[_0xe6bd('0x27')](_0x366886)[_0xe6bd('0x37')](_0x4cc809);};}exports[_0xe6bd('0x38')]=function(_0x1b2335,_0x696e0d){var _0x5f5415={},_0x45bf5c={},_0x1e1abf={'count':0x0,'rows':[]};var _0x289422=_[_0xe6bd('0x39')](db['VoiceContext'][_0xe6bd('0x3a')],function(_0x21160b){return{'name':_0x21160b[_0xe6bd('0x3b')],'type':_0x21160b[_0xe6bd('0x3c')][_0xe6bd('0x3d')]};});_0x45bf5c[_0xe6bd('0x3e')]=_['map'](_0x289422,_0xe6bd('0x36'));_0x45bf5c[_0xe6bd('0x3f')]=_[_0xe6bd('0x40')](_0x1b2335[_0xe6bd('0x3f')]);_0x45bf5c[_0xe6bd('0x41')]=_[_0xe6bd('0x42')](_0x45bf5c[_0xe6bd('0x3e')],_0x45bf5c[_0xe6bd('0x3f')]);_0x5f5415[_0xe6bd('0x43')]=_['intersection'](_0x45bf5c[_0xe6bd('0x3e')],qs[_0xe6bd('0x44')](_0x1b2335['query'][_0xe6bd('0x44')]));_0x5f5415[_0xe6bd('0x43')]=_0x5f5415[_0xe6bd('0x43')][_0xe6bd('0x45')]?_0x5f5415['attributes']:_0x45bf5c['model'];if(!_0x1b2335['query'][_0xe6bd('0x46')](_0xe6bd('0x47'))){_0x5f5415[_0xe6bd('0x2b')]=qs[_0xe6bd('0x2b')](_0x1b2335[_0xe6bd('0x3f')]['limit']);_0x5f5415[_0xe6bd('0x2a')]=qs[_0xe6bd('0x2a')](_0x1b2335[_0xe6bd('0x3f')][_0xe6bd('0x2a')]);}_0x5f5415['order']=qs[_0xe6bd('0x48')](_0x1b2335['query'][_0xe6bd('0x48')]);_0x5f5415[_0xe6bd('0x49')]=qs[_0xe6bd('0x41')](_[_0xe6bd('0x4a')](_0x1b2335[_0xe6bd('0x3f')],_0x45bf5c[_0xe6bd('0x41')]),_0x289422);if(_0x1b2335['query'][_0xe6bd('0x4b')]){_0x5f5415['where']=_[_0xe6bd('0x4c')](_0x5f5415[_0xe6bd('0x49')],{'$or':_['map'](_0x289422,function(_0xd1e922){if(_0xd1e922[_0xe6bd('0x3c')]!==_0xe6bd('0x4d')){var _0x4b0b96={};_0x4b0b96[_0xd1e922[_0xe6bd('0x36')]]={'$like':'%'+_0x1b2335[_0xe6bd('0x3f')][_0xe6bd('0x4b')]+'%'};return _0x4b0b96;}})});}_0x5f5415=_[_0xe6bd('0x4c')]({},_0x5f5415,_0x1b2335['options']);var _0x476b99={'where':_0x5f5415[_0xe6bd('0x49')]};return db[_0xe6bd('0x4e')]['count'](_0x476b99)['then'](function(_0x351db1){_0x1e1abf[_0xe6bd('0x2d')]=_0x351db1;if(_0x1b2335['query'][_0xe6bd('0x4f')]){_0x5f5415['include']=[{'all':!![]}];}return db[_0xe6bd('0x4e')]['findAll'](_0x5f5415);})[_0xe6bd('0x1c')](function(_0x85e10b){_0x1e1abf['rows']=_0x85e10b;return _0x1e1abf;})['then'](respondWithFilteredResult(_0x696e0d,_0x5f5415))['catch'](handleError(_0x696e0d,null));};exports['show']=function(_0x14b6e2,_0x1c4eb4){var _0x230fb6={'raw':![],'where':{'id':_0x14b6e2[_0xe6bd('0x50')]['id']}},_0x59f351={};_0x59f351[_0xe6bd('0x3e')]=_['keys'](db[_0xe6bd('0x4e')][_0xe6bd('0x3a')]);_0x59f351[_0xe6bd('0x3f')]=_['keys'](_0x14b6e2['query']);_0x59f351['filters']=_[_0xe6bd('0x42')](_0x59f351['model'],_0x59f351['query']);_0x230fb6[_0xe6bd('0x43')]=_['intersection'](_0x59f351[_0xe6bd('0x3e')],qs[_0xe6bd('0x44')](_0x14b6e2[_0xe6bd('0x3f')][_0xe6bd('0x44')]));_0x230fb6[_0xe6bd('0x43')]=_0x230fb6[_0xe6bd('0x43')][_0xe6bd('0x45')]?_0x230fb6[_0xe6bd('0x43')]:_0x59f351[_0xe6bd('0x3e')];if(_0x14b6e2['query'][_0xe6bd('0x4f')]){_0x230fb6[_0xe6bd('0x51')]=[{'all':!![]}];}_0x230fb6=_[_0xe6bd('0x4c')]({},_0x230fb6,_0x14b6e2[_0xe6bd('0x52')]);return db[_0xe6bd('0x4e')][_0xe6bd('0x53')](_0x230fb6)[_0xe6bd('0x1c')](handleEntityNotFound(_0x1c4eb4,null))[_0xe6bd('0x1c')](respondWithResult(_0x1c4eb4,null))[_0xe6bd('0x25')](handleError(_0x1c4eb4,null));};exports[_0xe6bd('0x54')]=function(_0x3deae1,_0x463b93,_0x11ae18){var _0x193d87;return db[_0xe6bd('0x4e')][_0xe6bd('0x54')](_0x3deae1['body'],{'raw':!![]})['then'](function(_0x509722){_0x193d87=_0x509722;return db[_0xe6bd('0x4e')][_0xe6bd('0x55')]({'raw':!![]});})['then'](function(_0x5c29a4){var _0x133d6a=fs[_0xe6bd('0x56')](path['join'](config[_0xe6bd('0x57')],'server/files/templates/context.ejs'),_0xe6bd('0x58'));var _0x6ac88a=ejs['render'](_0x133d6a,{'contexts':_0x5c29a4||[]});fs['writeFileSync'](_0xe6bd('0x59'),_0x6ac88a);})[_0xe6bd('0x1c')](function(){return respondWithRpcPromise(_0xe6bd('0x5a'),_0xe6bd('0x54'),{'module':_0xe6bd('0x5b')});})['then'](function(){var _0x521fff=_0x3deae1[_0xe6bd('0x5c')][_0xe6bd('0x34')]({'plain':!![]});if(!_0x521fff)throw new Error(_0xe6bd('0x5d'));if(_0x521fff[_0xe6bd('0x5e')]===_0xe6bd('0x5c')){var _0x10ca6b=_0x193d87[_0xe6bd('0x34')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe6bd('0x5f'),'userProfileId':_0x521fff[_0xe6bd('0x60')]},'raw':!![]})[_0xe6bd('0x1c')](function(_0x246a71){if(_0x246a71&&_0x246a71[_0xe6bd('0x61')]===0x0){return db[_0xe6bd('0x35')]['create']({'name':_0x10ca6b[_0xe6bd('0x36')],'resourceId':_0x10ca6b['id'],'type':_0x246a71['name'],'sectionId':_0x246a71['id']},{})['then'](function(){return _0x193d87;});}else{return _0x193d87;}})['catch'](function(_0x1b0d69){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b0d69);throw _0x1b0d69;});}return _0x193d87;})[_0xe6bd('0x1c')](respondWithResult(_0x463b93,0xc9))['catch'](handleError(_0x463b93,null));};exports[_0xe6bd('0x62')]=function(_0x321f58,_0x5ca2ff,_0x1d0eaf){var _0x365714;return db['VoiceContext'][_0xe6bd('0x53')]({'where':{'id':_0x321f58[_0xe6bd('0x50')]['id']}})[_0xe6bd('0x1c')](handleEntityNotFound(_0x5ca2ff,null))[_0xe6bd('0x1c')](saveUpdates(_0x321f58[_0xe6bd('0x63')],null))['then'](function(_0x189d63){if(_0x189d63){_0x365714=_0x189d63;return db[_0xe6bd('0x4e')][_0xe6bd('0x55')]({'raw':!![]});}})[_0xe6bd('0x1c')](function(_0x4321e3){var _0xcb8d30=fs[_0xe6bd('0x56')](path[_0xe6bd('0x64')](config['root'],_0xe6bd('0x65')),'utf8');var _0x2537a9=ejs[_0xe6bd('0x66')](_0xcb8d30,{'contexts':_0x4321e3||[]});fs[_0xe6bd('0x67')](_0xe6bd('0x59'),_0x2537a9);})[_0xe6bd('0x1c')](function(){return respondWithRpcPromise(_0xe6bd('0x5a'),_0xe6bd('0x62'),{'module':_0xe6bd('0x5b')});})[_0xe6bd('0x1c')](function(){return _0x365714;})[_0xe6bd('0x1c')](respondWithResult(_0x5ca2ff,null))['catch'](handleError(_0x5ca2ff,null));};exports[_0xe6bd('0x33')]=function(_0x42c403,_0x1f92f6,_0x27dff2){var _0x1690a4;return db[_0xe6bd('0x4e')][_0xe6bd('0x53')]({'where':{'id':_0x42c403[_0xe6bd('0x50')]['id']}})[_0xe6bd('0x1c')](handleEntityNotFound(_0x1f92f6,null))[_0xe6bd('0x1c')](removeEntity(_0x1f92f6,null))[_0xe6bd('0x1c')](function(){return db[_0xe6bd('0x4e')][_0xe6bd('0x55')]({'raw':!![]});})[_0xe6bd('0x1c')](function(_0x527e5f){var _0x38a7c0=fs[_0xe6bd('0x56')](path['join'](config[_0xe6bd('0x57')],'server/files/templates/context.ejs'),_0xe6bd('0x58'));var _0x5922df=ejs['render'](_0x38a7c0,{'contexts':_0x527e5f});fs['writeFileSync'](_0xe6bd('0x59'),_0x5922df);return respondWithRpcPromise(_0xe6bd('0x5a'),_0xe6bd('0x33'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1f92f6,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 74265dd..94c8af2 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 _0x3289=['api','moment','request-promise','path','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','util','../../config/logger'];(function(_0xa73b26,_0x5b7718){var _0x219726=function(_0x5aa615){while(--_0x5aa615){_0xa73b26['push'](_0xa73b26['shift']());}};_0x219726(++_0x5b7718);}(_0x3289,0xcf));var _0x9328=function(_0xe9797d,_0x5eb0a6){_0xe9797d=_0xe9797d-0x0;var _0x17ce4f=_0x3289[_0xe9797d];return _0x17ce4f;};'use strict';var _=require('lodash');var util=require(_0x9328('0x0'));var logger=require(_0x9328('0x1'))(_0x9328('0x2'));var moment=require(_0x9328('0x3'));var BPromise=require('bluebird');var rp=require(_0x9328('0x4'));var fs=require('fs');var path=require(_0x9328('0x5'));var rimraf=require('rimraf');var config=require(_0x9328('0x6'));var attributes=require(_0x9328('0x7'));module['exports']=function(_0x415748,_0x1208fc){return _0x415748[_0x9328('0x8')](_0x9328('0x9'),attributes,{'tableName':_0x9328('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37a7=['path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash','util','moment','bluebird','request-promise'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x37a7,0x73));var _0x737a=function(_0x2f28bb,_0x578d3e){_0x2f28bb=_0x2f28bb-0x0;var _0x43a4ed=_0x37a7[_0x2f28bb];return _0x43a4ed;};'use strict';var _=require(_0x737a('0x0'));var util=require(_0x737a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x737a('0x2'));var BPromise=require(_0x737a('0x3'));var rp=require(_0x737a('0x4'));var fs=require('fs');var path=require(_0x737a('0x5'));var rimraf=require(_0x737a('0x6'));var config=require(_0x737a('0x7'));var attributes=require(_0x737a('0x8'));module[_0x737a('0x9')]=function(_0x4b5a14,_0x5746b4){return _0x4b5a14[_0x737a('0xa')](_0x737a('0xb'),attributes,{'tableName':'voice_contexts','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 8468bde..3a5e7bd 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 _0xe0dd=['../../config/utils','../../config/logger','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe0dd,0x163));var _0xde0d=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xe0dd[_0x1a8bbc];return _0x212fc2;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x323200,_0x3ce23c,_0x33a644){return new BPromise(function(_0x570b78,_0x25f0fe){return client['request'](_0x323200,_0x33a644)[_0xde0d('0xa')](function(_0x5e6588){logger[_0xde0d('0xb')](_0xde0d('0xc'),_0x3ce23c,_0xde0d('0xd'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3ce23c,'request\x20sent',JSON[_0xde0d('0xe')](_0x5e6588));if(_0x5e6588[_0xde0d('0xf')]){if(_0x5e6588[_0xde0d('0xf')]['code']===0x1f4){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x25f0fe(_0x5e6588[_0xde0d('0xf')][_0xde0d('0x10')]);}logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x5e6588['error'][_0xde0d('0x10')]);return _0x570b78(_0x5e6588['error'][_0xde0d('0x10')]);}else{logger['info'](_0xde0d('0xc'),_0x3ce23c,'request\x20sent');_0x570b78(_0x5e6588[_0xde0d('0x11')][_0xde0d('0x10')]);}})[_0xde0d('0x12')](function(_0x228666){logger[_0xde0d('0xf')](_0xde0d('0xc'),_0x3ce23c,_0x228666);_0x25f0fe(_0x228666);});});} \ No newline at end of file +var _0x063e=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','request\x20sent'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x063e,0x111));var _0xe063=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x063e[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xe063('0x0'));var util=require(_0xe063('0x1'));var moment=require(_0xe063('0x2'));var BPromise=require(_0xe063('0x3'));var rs=require(_0xe063('0x4'));var fs=require('fs');var Redis=require(_0xe063('0x5'));var db=require(_0xe063('0x6'))['db'];var utils=require(_0xe063('0x7'));var logger=require(_0xe063('0x8'))(_0xe063('0x9'));var config=require(_0xe063('0xa'));var jayson=require(_0xe063('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x561d7b,_0x3a046c,_0x661f34){return new BPromise(function(_0x1c48ea,_0x5b10ce){return client[_0xe063('0xc')](_0x561d7b,_0x661f34)[_0xe063('0xd')](function(_0x4bb52b){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3a046c,_0xe063('0xe'));logger[_0xe063('0xf')](_0xe063('0x10'),_0x3a046c,'request\x20sent',JSON[_0xe063('0x11')](_0x4bb52b));if(_0x4bb52b[_0xe063('0x12')]){if(_0x4bb52b[_0xe063('0x12')][_0xe063('0x13')]===0x1f4){logger[_0xe063('0x12')](_0xe063('0x14'),_0x3a046c,_0x4bb52b[_0xe063('0x12')][_0xe063('0x15')]);return _0x5b10ce(_0x4bb52b[_0xe063('0x12')][_0xe063('0x15')]);}logger[_0xe063('0x12')](_0xe063('0x14'),_0x3a046c,_0x4bb52b['error']['message']);return _0x1c48ea(_0x4bb52b['error'][_0xe063('0x15')]);}else{logger['info'](_0xe063('0x14'),_0x3a046c,_0xe063('0xe'));_0x1c48ea(_0x4bb52b[_0xe063('0x16')][_0xe063('0x15')]);}})[_0xe063('0x17')](function(_0x29f4ae){logger[_0xe063('0x12')](_0xe063('0x14'),_0x3a046c,_0x29f4ae);_0x5b10ce(_0x29f4ae);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 48a5d2d..f65bf4d 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 _0x9034=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','post','create','/:id','update','delete','destroy','exports','multer','path'];(function(_0x22f33b,_0x291308){var _0x2d63e7=function(_0x1007c6){while(--_0x1007c6){_0x22f33b['push'](_0x22f33b['shift']());}};_0x2d63e7(++_0x291308);}(_0x9034,0x178));var _0x4903=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9034[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x4903('0x0'));var util=require('util');var path=require(_0x4903('0x1'));var timeout=require(_0x4903('0x2'));var express=require(_0x4903('0x3'));var router=express[_0x4903('0x4')]();var fs_extra=require(_0x4903('0x5'));var auth=require(_0x4903('0x6'));var interaction=require(_0x4903('0x7'));var config=require('../../config/environment');var controller=require(_0x4903('0x8'));router[_0x4903('0x9')]('/',auth[_0x4903('0xa')](),controller[_0x4903('0xb')]);router[_0x4903('0x9')](_0x4903('0xc'),auth['isAuthenticated'](),controller[_0x4903('0xd')]);router['get']('/:id',auth[_0x4903('0xa')](),controller['show']);router[_0x4903('0xe')]('/',auth[_0x4903('0xa')](),controller[_0x4903('0xf')]);router['put'](_0x4903('0x10'),auth[_0x4903('0xa')](),controller[_0x4903('0x11')]);router[_0x4903('0x12')](_0x4903('0x10'),auth[_0x4903('0xa')](),controller[_0x4903('0x13')]);module[_0x4903('0x14')]=router; \ No newline at end of file +var _0x8f1d=['../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0xf1568d,_0x17582b){var _0x5541b2=function(_0x4ffb3c){while(--_0x4ffb3c){_0xf1568d['push'](_0xf1568d['shift']());}};_0x5541b2(++_0x17582b);}(_0x8f1d,0x72));var _0xd8f1=function(_0x4474c2,_0x59cf02){_0x4474c2=_0x4474c2-0x0;var _0x435fbb=_0x8f1d[_0x4474c2];return _0x435fbb;};'use strict';var multer=require(_0xd8f1('0x0'));var util=require(_0xd8f1('0x1'));var path=require('path');var timeout=require(_0xd8f1('0x2'));var express=require(_0xd8f1('0x3'));var router=express[_0xd8f1('0x4')]();var fs_extra=require(_0xd8f1('0x5'));var auth=require(_0xd8f1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd8f1('0x7'));var controller=require(_0xd8f1('0x8'));router[_0xd8f1('0x9')]('/',auth[_0xd8f1('0xa')](),controller['index']);router[_0xd8f1('0x9')](_0xd8f1('0xb'),auth[_0xd8f1('0xa')](),controller[_0xd8f1('0xc')]);router[_0xd8f1('0x9')]('/:id',auth[_0xd8f1('0xa')](),controller[_0xd8f1('0xd')]);router[_0xd8f1('0xe')]('/',auth[_0xd8f1('0xa')](),controller[_0xd8f1('0xf')]);router[_0xd8f1('0x10')](_0xd8f1('0x11'),auth[_0xd8f1('0xa')](),controller['update']);router[_0xd8f1('0x12')]('/:id',auth[_0xd8f1('0xa')](),controller[_0xd8f1('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 8e36e31..e26d2f0 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 _0x008c=['INTEGER','DATE','sequelize','exports','STRING'];(function(_0x16c96c,_0x34e82a){var _0x51cc58=function(_0x519d95){while(--_0x519d95){_0x16c96c['push'](_0x16c96c['shift']());}};_0x51cc58(++_0x34e82a);}(_0x008c,0x188));var _0xc008=function(_0x2f2ff5,_0x352b1c){_0x2f2ff5=_0x2f2ff5-0x0;var _0x1df50c=_0x008c[_0x2f2ff5];return _0x1df50c;};'use strict';var Sequelize=require(_0xc008('0x0'));module[_0xc008('0x1')]={'privilege':{'type':Sequelize[_0xc008('0x2')]},'channel':{'type':Sequelize[_0xc008('0x2')]},'channelstate':{'type':Sequelize[_0xc008('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc008('0x2')]},'calleridname':{'type':Sequelize[_0xc008('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'connectedlinename':{'type':Sequelize[_0xc008('0x2')]},'language':{'type':Sequelize[_0xc008('0x2')]},'accountcode':{'type':Sequelize[_0xc008('0x2')]},'context':{'type':Sequelize[_0xc008('0x2')]},'exten':{'type':Sequelize[_0xc008('0x2')]},'priority':{'type':Sequelize[_0xc008('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc008('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc008('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc008('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xc008('0x2')]},'destexten':{'type':Sequelize[_0xc008('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xc008('0x2')]},'destlinkedid':{'type':Sequelize[_0xc008('0x2')]},'dialstring':{'type':Sequelize[_0xc008('0x2')]},'dialstatus':{'type':Sequelize[_0xc008('0x2')]},'starttime':{'type':Sequelize[_0xc008('0x4')]},'answertime':{'type':Sequelize[_0xc008('0x4')]},'endtime':{'type':Sequelize[_0xc008('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xc008('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xc008('0x3')]},'billableseconds':{'type':Sequelize[_0xc008('0x3')]}}; \ No newline at end of file +var _0x55ca=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x3dc785,_0x5bd728){var _0x345e94=function(_0x54ffcb){while(--_0x54ffcb){_0x3dc785['push'](_0x3dc785['shift']());}};_0x345e94(++_0x5bd728);}(_0x55ca,0x126));var _0xa55c=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0x55ca[_0x51f4fc];return _0x4d96fc;};'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 6746b67..8adcf4e 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 _0x7a04=['map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','VoiceDialReport','includeAll','include','findAll','rows','catch','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','count','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x378f5d,_0x9da6a2){var _0x457218=function(_0x2c13a1){while(--_0x2c13a1){_0x378f5d['push'](_0x378f5d['shift']());}};_0x457218(++_0x9da6a2);}(_0x7a04,0x14a));var _0x47a0=function(_0x3e8bf8,_0x4e76d6){_0x3e8bf8=_0x3e8bf8-0x0;var _0x3391ce=_0x7a04[_0x3e8bf8];return _0x3391ce;};'use strict';var emlformat=require(_0x47a0('0x0'));var rimraf=require(_0x47a0('0x1'));var zipdir=require(_0x47a0('0x2'));var jsonpatch=require(_0x47a0('0x3'));var rp=require(_0x47a0('0x4'));var moment=require('moment');var BPromise=require(_0x47a0('0x5'));var Mustache=require(_0x47a0('0x6'));var util=require('util');var path=require(_0x47a0('0x7'));var sox=require(_0x47a0('0x8'));var csv=require(_0x47a0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a0('0xa'));var _=require(_0x47a0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x47a0('0xc'));var deskjs=require(_0x47a0('0xd'));var toCsv=require(_0x47a0('0x9'));var querystring=require('querystring');var Papa=require(_0x47a0('0xe'));var Redis=require(_0x47a0('0xf'));var authService=require(_0x47a0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x47a0('0x11'));var hardwareService=require(_0x47a0('0x12'));var logger=require('../../config/logger')(_0x47a0('0x13'));var utils=require('../../config/utils');var config=require(_0x47a0('0x14'));var licenseUtil=require(_0x47a0('0x15'));var db=require(_0x47a0('0x16'))['db'];function respondWithStatusCode(_0x204f63,_0x40730f){_0x40730f=_0x40730f||0xcc;return function(_0x5cb32e){if(_0x5cb32e){return _0x204f63['sendStatus'](_0x40730f);}return _0x204f63['status'](_0x40730f)[_0x47a0('0x17')]();};}function respondWithResult(_0x55f734,_0x5938e7){_0x5938e7=_0x5938e7||0xc8;return function(_0x17ae43){if(_0x17ae43){return _0x55f734[_0x47a0('0x18')](_0x5938e7)[_0x47a0('0x19')](_0x17ae43);}};}function respondWithFilteredResult(_0x49e41e,_0x207fbb){return function(_0x21ee34){if(_0x21ee34){var _0x308066=typeof _0x207fbb[_0x47a0('0x1a')]==='undefined'&&typeof _0x207fbb['limit']==='undefined';var _0x1a57cc=_0x21ee34[_0x47a0('0x1b')];var _0x4a99ec=_0x308066?0x0:_0x207fbb[_0x47a0('0x1a')];var _0x2520f3=_0x308066?_0x21ee34['count']:_0x207fbb[_0x47a0('0x1a')]+_0x207fbb[_0x47a0('0x1c')];var _0x236e90;if(_0x2520f3>=_0x1a57cc){_0x2520f3=_0x1a57cc;_0x236e90=0xc8;}else{_0x236e90=0xce;}_0x49e41e[_0x47a0('0x18')](_0x236e90);return _0x49e41e[_0x47a0('0x1d')](_0x47a0('0x1e'),_0x4a99ec+'-'+_0x2520f3+'/'+_0x1a57cc)[_0x47a0('0x19')](_0x21ee34);}return null;};}function patchUpdates(_0x537d3f){return function(_0x4d6e1b){try{jsonpatch[_0x47a0('0x1f')](_0x4d6e1b,_0x537d3f,!![]);}catch(_0x51957f){return BPromise['reject'](_0x51957f);}return _0x4d6e1b[_0x47a0('0x20')]();};}function saveUpdates(_0x340e3c,_0x3f55f6){return function(_0x22d3f0){if(_0x22d3f0){return _0x22d3f0[_0x47a0('0x21')](_0x340e3c)[_0x47a0('0x22')](function(_0x22d86a){return _0x22d86a;});}return null;};}function removeEntity(_0x3d25e3,_0x1576f9){return function(_0x3ccabf){if(_0x3ccabf){return _0x3ccabf['destroy']()['then'](function(){_0x3d25e3[_0x47a0('0x18')](0xcc)[_0x47a0('0x17')]();});}};}function handleEntityNotFound(_0x262b3c,_0x55a1cc){return function(_0xc2a0a4){if(!_0xc2a0a4){_0x262b3c[_0x47a0('0x23')](0x194);}return _0xc2a0a4;};}function handleError(_0x54ab43,_0x176361){_0x176361=_0x176361||0x1f4;return function(_0x2341c2){logger[_0x47a0('0x24')](_0x2341c2[_0x47a0('0x25')]);if(_0x2341c2[_0x47a0('0x26')]){delete _0x2341c2['name'];}_0x54ab43[_0x47a0('0x18')](_0x176361)[_0x47a0('0x27')](_0x2341c2);};}exports['index']=function(_0x1015bd,_0x1b391f){var _0x37fc89={},_0x365050={},_0x4100a3={'count':0x0,'rows':[]};var _0x2880f1=_[_0x47a0('0x28')](db['VoiceDialReport'][_0x47a0('0x29')],function(_0x42ad2b){return{'name':_0x42ad2b[_0x47a0('0x2a')],'type':_0x42ad2b['type'][_0x47a0('0x2b')]};});_0x365050['model']=_[_0x47a0('0x28')](_0x2880f1,_0x47a0('0x26'));_0x365050['query']=_[_0x47a0('0x2c')](_0x1015bd['query']);_0x365050[_0x47a0('0x2d')]=_[_0x47a0('0x2e')](_0x365050[_0x47a0('0x2f')],_0x365050[_0x47a0('0x30')]);_0x37fc89[_0x47a0('0x31')]=_[_0x47a0('0x2e')](_0x365050[_0x47a0('0x2f')],qs['fields'](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x32')]));_0x37fc89[_0x47a0('0x31')]=_0x37fc89[_0x47a0('0x31')][_0x47a0('0x33')]?_0x37fc89[_0x47a0('0x31')]:_0x365050[_0x47a0('0x2f')];if(!_0x1015bd[_0x47a0('0x30')][_0x47a0('0x34')](_0x47a0('0x35'))){_0x37fc89[_0x47a0('0x1c')]=qs[_0x47a0('0x1c')](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x1c')]);_0x37fc89[_0x47a0('0x1a')]=qs['offset'](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x1a')]);}_0x37fc89[_0x47a0('0x36')]=qs[_0x47a0('0x37')](_0x1015bd[_0x47a0('0x30')][_0x47a0('0x37')]);_0x37fc89['where']=qs[_0x47a0('0x2d')](_[_0x47a0('0x38')](_0x1015bd[_0x47a0('0x30')],_0x365050[_0x47a0('0x2d')]),_0x2880f1);if(_0x1015bd[_0x47a0('0x30')][_0x47a0('0x39')]){_0x37fc89[_0x47a0('0x3a')]=_[_0x47a0('0x3b')](_0x37fc89[_0x47a0('0x3a')],{'$or':_[_0x47a0('0x28')](_0x2880f1,function(_0x79ee80){if(_0x79ee80[_0x47a0('0x3c')]!==_0x47a0('0x3d')){var _0x3b3dd1={};_0x3b3dd1[_0x79ee80[_0x47a0('0x26')]]={'$like':'%'+_0x1015bd[_0x47a0('0x30')]['filter']+'%'};return _0x3b3dd1;}})});}_0x37fc89=_['merge']({},_0x37fc89,_0x1015bd[_0x47a0('0x3e')]);var _0x1eae67={'where':_0x37fc89['where']};return db[_0x47a0('0x3f')][_0x47a0('0x1b')](_0x1eae67)[_0x47a0('0x22')](function(_0x3a89b0){_0x4100a3[_0x47a0('0x1b')]=_0x3a89b0;if(_0x1015bd[_0x47a0('0x30')][_0x47a0('0x40')]){_0x37fc89[_0x47a0('0x41')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x47a0('0x42')](_0x37fc89);})[_0x47a0('0x22')](function(_0x54728e){_0x4100a3[_0x47a0('0x43')]=_0x54728e;return _0x4100a3;})[_0x47a0('0x22')](respondWithFilteredResult(_0x1b391f,_0x37fc89))[_0x47a0('0x44')](handleError(_0x1b391f,null));};exports['show']=function(_0x4a9824,_0x4ac4e2){var _0x1d1431={'raw':!![],'where':{'id':_0x4a9824[_0x47a0('0x45')]['id']}},_0x8553c6={};_0x8553c6[_0x47a0('0x2f')]=_['keys'](db[_0x47a0('0x3f')][_0x47a0('0x29')]);_0x8553c6[_0x47a0('0x30')]=_[_0x47a0('0x2c')](_0x4a9824[_0x47a0('0x30')]);_0x8553c6['filters']=_[_0x47a0('0x2e')](_0x8553c6[_0x47a0('0x2f')],_0x8553c6[_0x47a0('0x30')]);_0x1d1431[_0x47a0('0x31')]=_[_0x47a0('0x2e')](_0x8553c6[_0x47a0('0x2f')],qs['fields'](_0x4a9824[_0x47a0('0x30')][_0x47a0('0x32')]));_0x1d1431['attributes']=_0x1d1431['attributes'][_0x47a0('0x33')]?_0x1d1431['attributes']:_0x8553c6[_0x47a0('0x2f')];if(_0x4a9824[_0x47a0('0x30')][_0x47a0('0x40')]){_0x1d1431[_0x47a0('0x41')]=[{'all':!![]}];}_0x1d1431=_[_0x47a0('0x3b')]({},_0x1d1431,_0x4a9824[_0x47a0('0x3e')]);return db[_0x47a0('0x3f')]['find'](_0x1d1431)[_0x47a0('0x22')](handleEntityNotFound(_0x4ac4e2,null))[_0x47a0('0x22')](respondWithResult(_0x4ac4e2,null))[_0x47a0('0x44')](handleError(_0x4ac4e2,null));};exports[_0x47a0('0x46')]=function(_0x4be4b6,_0x5e2405){return db['VoiceDialReport'][_0x47a0('0x46')](_0x4be4b6[_0x47a0('0x47')],{})['then'](respondWithResult(_0x5e2405,0xc9))['catch'](handleError(_0x5e2405,null));};exports[_0x47a0('0x21')]=function(_0x19ed11,_0x4177ac){if(_0x19ed11[_0x47a0('0x47')]['id']){delete _0x19ed11['body']['id'];}return db['VoiceDialReport'][_0x47a0('0x48')]({'where':{'id':_0x19ed11['params']['id']}})[_0x47a0('0x22')](handleEntityNotFound(_0x4177ac,null))[_0x47a0('0x22')](saveUpdates(_0x19ed11[_0x47a0('0x47')],null))[_0x47a0('0x22')](respondWithResult(_0x4177ac,null))[_0x47a0('0x44')](handleError(_0x4177ac,null));};exports['destroy']=function(_0x3267d4,_0x22d78c){return db['VoiceDialReport'][_0x47a0('0x48')]({'where':{'id':_0x3267d4['params']['id']}})[_0x47a0('0x22')](handleEntityNotFound(_0x22d78c,null))['then'](removeEntity(_0x22d78c,null))[_0x47a0('0x44')](handleError(_0x22d78c,null));};exports[_0x47a0('0x49')]=function(_0x32e230,_0x1c0457){return db['VoiceDialReport']['describe']()[_0x47a0('0x22')](respondWithResult(_0x1c0457,null))[_0x47a0('0x44')](handleError(_0x1c0457,null));}; \ No newline at end of file +var _0x9239=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','includeAll','include','findAll','catch','show','length','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x33975c,_0x50d085){var _0x1c15ab=function(_0x54e8bc){while(--_0x54e8bc){_0x33975c['push'](_0x33975c['shift']());}};_0x1c15ab(++_0x50d085);}(_0x9239,0x1f1));var _0x9923=function(_0x43c699,_0x1a6c31){_0x43c699=_0x43c699-0x0;var _0x3edace=_0x9239[_0x43c699];return _0x3edace;};'use strict';var emlformat=require(_0x9923('0x0'));var rimraf=require(_0x9923('0x1'));var zipdir=require(_0x9923('0x2'));var jsonpatch=require(_0x9923('0x3'));var rp=require(_0x9923('0x4'));var moment=require(_0x9923('0x5'));var BPromise=require(_0x9923('0x6'));var Mustache=require(_0x9923('0x7'));var util=require(_0x9923('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9923('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9923('0xa'));var squel=require(_0x9923('0xb'));var crypto=require('crypto');var jsforce=require(_0x9923('0xc'));var deskjs=require(_0x9923('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9923('0xe'));var Papa=require(_0x9923('0xf'));var Redis=require(_0x9923('0x10'));var authService=require(_0x9923('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9923('0x12'));var hardwareService=require(_0x9923('0x13'));var logger=require(_0x9923('0x14'))('api');var utils=require(_0x9923('0x15'));var config=require(_0x9923('0x16'));var licenseUtil=require(_0x9923('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548a09,_0x43004b){_0x43004b=_0x43004b||0xcc;return function(_0x57cbc5){if(_0x57cbc5){return _0x548a09[_0x9923('0x18')](_0x43004b);}return _0x548a09[_0x9923('0x19')](_0x43004b)['end']();};}function respondWithResult(_0x2c06d9,_0x204a8b){_0x204a8b=_0x204a8b||0xc8;return function(_0xc9e196){if(_0xc9e196){return _0x2c06d9['status'](_0x204a8b)[_0x9923('0x1a')](_0xc9e196);}};}function respondWithFilteredResult(_0x56ccfa,_0x4f2d78){return function(_0x5e0b94){if(_0x5e0b94){var _0x33d4b=typeof _0x4f2d78[_0x9923('0x1b')]==='undefined'&&typeof _0x4f2d78[_0x9923('0x1c')]===_0x9923('0x1d');var _0x2d0828=_0x5e0b94['count'];var _0x114880=_0x33d4b?0x0:_0x4f2d78[_0x9923('0x1b')];var _0x5991c9=_0x33d4b?_0x5e0b94[_0x9923('0x1e')]:_0x4f2d78[_0x9923('0x1b')]+_0x4f2d78[_0x9923('0x1c')];var _0x502804;if(_0x5991c9>=_0x2d0828){_0x5991c9=_0x2d0828;_0x502804=0xc8;}else{_0x502804=0xce;}_0x56ccfa['status'](_0x502804);return _0x56ccfa[_0x9923('0x1f')](_0x9923('0x20'),_0x114880+'-'+_0x5991c9+'/'+_0x2d0828)['json'](_0x5e0b94);}return null;};}function patchUpdates(_0x52ebfc){return function(_0x11741d){try{jsonpatch[_0x9923('0x21')](_0x11741d,_0x52ebfc,!![]);}catch(_0x31d460){return BPromise[_0x9923('0x22')](_0x31d460);}return _0x11741d[_0x9923('0x23')]();};}function saveUpdates(_0x67ebd9,_0x341b72){return function(_0xb73d4){if(_0xb73d4){return _0xb73d4[_0x9923('0x24')](_0x67ebd9)[_0x9923('0x25')](function(_0x1ada42){return _0x1ada42;});}return null;};}function removeEntity(_0x313fd4,_0x2a65f1){return function(_0xc14a82){if(_0xc14a82){return _0xc14a82[_0x9923('0x26')]()[_0x9923('0x25')](function(){_0x313fd4[_0x9923('0x19')](0xcc)[_0x9923('0x27')]();});}};}function handleEntityNotFound(_0x2b6929,_0x1279c4){return function(_0x30f112){if(!_0x30f112){_0x2b6929[_0x9923('0x18')](0x194);}return _0x30f112;};}function handleError(_0x56a254,_0xf8fed5){_0xf8fed5=_0xf8fed5||0x1f4;return function(_0x12466a){logger['error'](_0x12466a['stack']);if(_0x12466a[_0x9923('0x28')]){delete _0x12466a[_0x9923('0x28')];}_0x56a254[_0x9923('0x19')](_0xf8fed5)[_0x9923('0x29')](_0x12466a);};}exports['index']=function(_0x570d0c,_0x5c5e91){var _0x28ee8a={},_0x3cbedf={},_0x4f62da={'count':0x0,'rows':[]};var _0x4af159=_[_0x9923('0x2a')](db[_0x9923('0x2b')][_0x9923('0x2c')],function(_0x527d69){return{'name':_0x527d69[_0x9923('0x2d')],'type':_0x527d69['type'][_0x9923('0x2e')]};});_0x3cbedf[_0x9923('0x2f')]=_[_0x9923('0x2a')](_0x4af159,_0x9923('0x28'));_0x3cbedf[_0x9923('0x30')]=_[_0x9923('0x31')](_0x570d0c[_0x9923('0x30')]);_0x3cbedf['filters']=_[_0x9923('0x32')](_0x3cbedf[_0x9923('0x2f')],_0x3cbedf['query']);_0x28ee8a[_0x9923('0x33')]=_['intersection'](_0x3cbedf[_0x9923('0x2f')],qs[_0x9923('0x34')](_0x570d0c['query'][_0x9923('0x34')]));_0x28ee8a['attributes']=_0x28ee8a[_0x9923('0x33')]['length']?_0x28ee8a[_0x9923('0x33')]:_0x3cbedf[_0x9923('0x2f')];if(!_0x570d0c[_0x9923('0x30')][_0x9923('0x35')](_0x9923('0x36'))){_0x28ee8a['limit']=qs[_0x9923('0x1c')](_0x570d0c[_0x9923('0x30')][_0x9923('0x1c')]);_0x28ee8a[_0x9923('0x1b')]=qs[_0x9923('0x1b')](_0x570d0c[_0x9923('0x30')][_0x9923('0x1b')]);}_0x28ee8a['order']=qs[_0x9923('0x37')](_0x570d0c[_0x9923('0x30')][_0x9923('0x37')]);_0x28ee8a[_0x9923('0x38')]=qs[_0x9923('0x39')](_['pick'](_0x570d0c['query'],_0x3cbedf[_0x9923('0x39')]),_0x4af159);if(_0x570d0c[_0x9923('0x30')]['filter']){_0x28ee8a['where']=_[_0x9923('0x3a')](_0x28ee8a[_0x9923('0x38')],{'$or':_['map'](_0x4af159,function(_0x451b0e){if(_0x451b0e[_0x9923('0x3b')]!==_0x9923('0x3c')){var _0x291e51={};_0x291e51[_0x451b0e['name']]={'$like':'%'+_0x570d0c[_0x9923('0x30')][_0x9923('0x3d')]+'%'};return _0x291e51;}})});}_0x28ee8a=_['merge']({},_0x28ee8a,_0x570d0c['options']);var _0x43e08d={'where':_0x28ee8a[_0x9923('0x38')]};return db[_0x9923('0x2b')][_0x9923('0x1e')](_0x43e08d)[_0x9923('0x25')](function(_0x594f38){_0x4f62da[_0x9923('0x1e')]=_0x594f38;if(_0x570d0c[_0x9923('0x30')][_0x9923('0x3e')]){_0x28ee8a[_0x9923('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x9923('0x40')](_0x28ee8a);})['then'](function(_0x4ce5af){_0x4f62da['rows']=_0x4ce5af;return _0x4f62da;})['then'](respondWithFilteredResult(_0x5c5e91,_0x28ee8a))[_0x9923('0x41')](handleError(_0x5c5e91,null));};exports[_0x9923('0x42')]=function(_0x474877,_0x31d7bc){var _0x5e0b58={'raw':!![],'where':{'id':_0x474877['params']['id']}},_0x38ea73={};_0x38ea73[_0x9923('0x2f')]=_['keys'](db['VoiceDialReport'][_0x9923('0x2c')]);_0x38ea73[_0x9923('0x30')]=_[_0x9923('0x31')](_0x474877[_0x9923('0x30')]);_0x38ea73[_0x9923('0x39')]=_[_0x9923('0x32')](_0x38ea73['model'],_0x38ea73[_0x9923('0x30')]);_0x5e0b58['attributes']=_[_0x9923('0x32')](_0x38ea73['model'],qs['fields'](_0x474877['query'][_0x9923('0x34')]));_0x5e0b58[_0x9923('0x33')]=_0x5e0b58['attributes'][_0x9923('0x43')]?_0x5e0b58[_0x9923('0x33')]:_0x38ea73['model'];if(_0x474877[_0x9923('0x30')][_0x9923('0x3e')]){_0x5e0b58['include']=[{'all':!![]}];}_0x5e0b58=_[_0x9923('0x3a')]({},_0x5e0b58,_0x474877[_0x9923('0x44')]);return db['VoiceDialReport'][_0x9923('0x45')](_0x5e0b58)[_0x9923('0x25')](handleEntityNotFound(_0x31d7bc,null))['then'](respondWithResult(_0x31d7bc,null))[_0x9923('0x41')](handleError(_0x31d7bc,null));};exports[_0x9923('0x46')]=function(_0x33a655,_0x203cc1){return db[_0x9923('0x2b')]['create'](_0x33a655[_0x9923('0x47')],{})['then'](respondWithResult(_0x203cc1,0xc9))['catch'](handleError(_0x203cc1,null));};exports[_0x9923('0x24')]=function(_0x1fb988,_0x57ae07){if(_0x1fb988[_0x9923('0x47')]['id']){delete _0x1fb988[_0x9923('0x47')]['id'];}return db[_0x9923('0x2b')][_0x9923('0x45')]({'where':{'id':_0x1fb988[_0x9923('0x48')]['id']}})[_0x9923('0x25')](handleEntityNotFound(_0x57ae07,null))[_0x9923('0x25')](saveUpdates(_0x1fb988[_0x9923('0x47')],null))[_0x9923('0x25')](respondWithResult(_0x57ae07,null))[_0x9923('0x41')](handleError(_0x57ae07,null));};exports[_0x9923('0x26')]=function(_0x477aea,_0x27bfe0){return db['VoiceDialReport'][_0x9923('0x45')]({'where':{'id':_0x477aea['params']['id']}})[_0x9923('0x25')](handleEntityNotFound(_0x27bfe0,null))[_0x9923('0x25')](removeEntity(_0x27bfe0,null))[_0x9923('0x41')](handleError(_0x27bfe0,null));};exports[_0x9923('0x49')]=function(_0xc920b6,_0x42f582){return db[_0x9923('0x2b')][_0x9923('0x49')]()[_0x9923('0x25')](respondWithResult(_0x42f582,null))[_0x9923('0x41')](handleError(_0x42f582,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 099b6ab..4ef1ae2 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 _0xecd0=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x499eaf,_0x560a5a){var _0x2fa121=function(_0x286a7b){while(--_0x286a7b){_0x499eaf['push'](_0x499eaf['shift']());}};_0x2fa121(++_0x560a5a);}(_0xecd0,0x162));var _0x0ecd=function(_0x4d6bfd,_0x8d79ff){_0x4d6bfd=_0x4d6bfd-0x0;var _0x243a46=_0xecd0[_0x4d6bfd];return _0x243a46;};'use strict';var _=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var logger=require(_0x0ecd('0x2'))(_0x0ecd('0x3'));var moment=require(_0x0ecd('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ecd('0x5'));var fs=require('fs');var path=require(_0x0ecd('0x6'));var rimraf=require(_0x0ecd('0x7'));var config=require(_0x0ecd('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x0ecd('0x9')]=function(_0x1cde06,_0xff2f1c){return _0x1cde06[_0x0ecd('0xa')](_0x0ecd('0xb'),attributes,{'tableName':_0x0ecd('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0ecd('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x661c=['./voiceDialReport.attributes','exports','define','report_dial','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xc3b507,_0x3bf129){var _0x38e577=function(_0x2467f8){while(--_0x2467f8){_0xc3b507['push'](_0xc3b507['shift']());}};_0x38e577(++_0x3bf129);}(_0x661c,0x122));var _0xc661=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x661c[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0xc661('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc661('0x1'));var moment=require('moment');var BPromise=require(_0xc661('0x2'));var rp=require(_0xc661('0x3'));var fs=require('fs');var path=require(_0xc661('0x4'));var rimraf=require(_0xc661('0x5'));var config=require(_0xc661('0x6'));var attributes=require(_0xc661('0x7'));module[_0xc661('0x8')]=function(_0x502716,_0x4de875){return _0x502716[_0xc661('0x9')]('VoiceDialReport',attributes,{'tableName':_0xc661('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 31b243d..20078fd 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 _0xa785=['raw','then','VoiceDialReport','attributes','limit','UpdateVoiceDialReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','request\x20sent','stringify','error','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','create','body','options'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa785,0x114));var _0x5a78=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xa785[_0x575a38];return _0x5a7bdd;};'use strict';var _=require('lodash');var util=require(_0x5a78('0x0'));var moment=require(_0x5a78('0x1'));var BPromise=require(_0x5a78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a78('0x3'));var db=require(_0x5a78('0x4'))['db'];var utils=require(_0x5a78('0x5'));var logger=require(_0x5a78('0x6'))('rpc');var config=require(_0x5a78('0x7'));var jayson=require(_0x5a78('0x8'));var client=jayson[_0x5a78('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bfe78,_0x3f4d65,_0xfb5198){return new BPromise(function(_0x25c8ec,_0x506e91){return client[_0x5a78('0xa')](_0x4bfe78,_0xfb5198)['then'](function(_0x401a92){logger[_0x5a78('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x3f4d65,'request\x20sent');logger[_0x5a78('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x3f4d65,_0x5a78('0xd'),JSON[_0x5a78('0xe')](_0x401a92));if(_0x401a92['error']){if(_0x401a92['error']['code']===0x1f4){logger[_0x5a78('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3f4d65,_0x401a92[_0x5a78('0xf')][_0x5a78('0x10')]);return _0x506e91(_0x401a92[_0x5a78('0xf')]['message']);}logger[_0x5a78('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x3f4d65,_0x401a92[_0x5a78('0xf')][_0x5a78('0x10')]);return _0x25c8ec(_0x401a92[_0x5a78('0xf')][_0x5a78('0x10')]);}else{logger[_0x5a78('0xb')](_0x5a78('0x11'),_0x3f4d65,'request\x20sent');_0x25c8ec(_0x401a92[_0x5a78('0x12')][_0x5a78('0x10')]);}})[_0x5a78('0x13')](function(_0x597779){logger['error'](_0x5a78('0x11'),_0x3f4d65,_0x597779);_0x506e91(_0x597779);});});}exports[_0x5a78('0x14')]=function(_0x49ac85){var _0x2b3e12=this;return new Promise(function(_0x2560bd,_0x36a941){return db['VoiceDialReport'][_0x5a78('0x15')](_0x49ac85[_0x5a78('0x16')],{'raw':_0x49ac85['options']?_0x49ac85[_0x5a78('0x17')][_0x5a78('0x18')]===undefined?!![]:![]:!![]})[_0x5a78('0x19')](function(_0x4e1b65){logger[_0x5a78('0xb')](_0x5a78('0x14'),_0x49ac85);logger[_0x5a78('0xc')](_0x5a78('0x14'),_0x49ac85,JSON[_0x5a78('0xe')](_0x4e1b65));_0x2560bd(_0x4e1b65);})[_0x5a78('0x13')](function(_0x3f25d3){logger[_0x5a78('0xf')]('CreateVoiceDialReport',_0x3f25d3[_0x5a78('0x10')],_0x49ac85);_0x36a941(_0x2b3e12['error'](0x1f4,_0x3f25d3['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3ee3b0){var _0x3148a9=this;return new Promise(function(_0x547587,_0x3f2e87){return db[_0x5a78('0x1a')]['update'](_0x3ee3b0[_0x5a78('0x16')],{'raw':_0x3ee3b0[_0x5a78('0x17')]?_0x3ee3b0[_0x5a78('0x17')][_0x5a78('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ee3b0[_0x5a78('0x17')]?_0x3ee3b0['options']['where']||null:null,'attributes':_0x3ee3b0[_0x5a78('0x17')]?_0x3ee3b0[_0x5a78('0x17')][_0x5a78('0x1b')]||null:null,'limit':_0x3ee3b0['options']?_0x3ee3b0['options'][_0x5a78('0x1c')]||null:null})[_0x5a78('0x19')](function(_0x362edf){logger[_0x5a78('0xb')]('UpdateVoiceDialReport',_0x3ee3b0);logger[_0x5a78('0xc')]('UpdateVoiceDialReport',_0x3ee3b0,JSON[_0x5a78('0xe')](_0x362edf));_0x547587(_0x362edf);})[_0x5a78('0x13')](function(_0x5c741e){logger[_0x5a78('0xf')](_0x5a78('0x1d'),_0x5c741e[_0x5a78('0x10')],_0x3ee3b0);_0x3f2e87(_0x3148a9['error'](0x1f4,_0x5c741e[_0x5a78('0x10')]));});});}; \ No newline at end of file +var _0x5a7d=['UpdateVoiceDialReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','debug','stringify','update','where','attributes','limit'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x5a7d,0x8d));var _0xd5a7=function(_0x56bcff,_0x158e5f){_0x56bcff=_0x56bcff-0x0;var _0x340351=_0x5a7d[_0x56bcff];return _0x340351;};'use strict';var _=require(_0xd5a7('0x0'));var util=require(_0xd5a7('0x1'));var moment=require(_0xd5a7('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5a7('0x3'));var fs=require('fs');var Redis=require(_0xd5a7('0x4'));var db=require(_0xd5a7('0x5'))['db'];var utils=require(_0xd5a7('0x6'));var logger=require(_0xd5a7('0x7'))(_0xd5a7('0x8'));var config=require(_0xd5a7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd5a7('0xa')][_0xd5a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x249d28,_0x1d1851,_0x34c4ea){return new BPromise(function(_0x4ccefa,_0x308f44){return client[_0xd5a7('0xc')](_0x249d28,_0x34c4ea)[_0xd5a7('0xd')](function(_0x22ae47){logger[_0xd5a7('0xe')](_0xd5a7('0xf'),_0x1d1851,_0xd5a7('0x10'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1d1851,_0xd5a7('0x10'),JSON['stringify'](_0x22ae47));if(_0x22ae47[_0xd5a7('0x11')]){if(_0x22ae47[_0xd5a7('0x11')][_0xd5a7('0x12')]===0x1f4){logger[_0xd5a7('0x11')](_0xd5a7('0xf'),_0x1d1851,_0x22ae47[_0xd5a7('0x11')][_0xd5a7('0x13')]);return _0x308f44(_0x22ae47['error']['message']);}logger['error'](_0xd5a7('0xf'),_0x1d1851,_0x22ae47[_0xd5a7('0x11')]['message']);return _0x4ccefa(_0x22ae47['error'][_0xd5a7('0x13')]);}else{logger[_0xd5a7('0xe')](_0xd5a7('0xf'),_0x1d1851,_0xd5a7('0x10'));_0x4ccefa(_0x22ae47[_0xd5a7('0x14')]['message']);}})[_0xd5a7('0x15')](function(_0x39d9ee){logger[_0xd5a7('0x11')](_0xd5a7('0xf'),_0x1d1851,_0x39d9ee);_0x308f44(_0x39d9ee);});});}exports[_0xd5a7('0x16')]=function(_0x55f7c7){var _0x2d3247=this;return new Promise(function(_0x2da3f9,_0x5380da){return db[_0xd5a7('0x17')][_0xd5a7('0x18')](_0x55f7c7[_0xd5a7('0x19')],{'raw':_0x55f7c7[_0xd5a7('0x1a')]?_0x55f7c7[_0xd5a7('0x1a')][_0xd5a7('0x1b')]===undefined?!![]:![]:!![]})[_0xd5a7('0xd')](function(_0x12e7f8){logger[_0xd5a7('0xe')](_0xd5a7('0x16'),_0x55f7c7);logger[_0xd5a7('0x1c')](_0xd5a7('0x16'),_0x55f7c7,JSON[_0xd5a7('0x1d')](_0x12e7f8));_0x2da3f9(_0x12e7f8);})['catch'](function(_0x5e1575){logger[_0xd5a7('0x11')](_0xd5a7('0x16'),_0x5e1575[_0xd5a7('0x13')],_0x55f7c7);_0x5380da(_0x2d3247[_0xd5a7('0x11')](0x1f4,_0x5e1575[_0xd5a7('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x3d8737){var _0x276314=this;return new Promise(function(_0x4499d4,_0x247133){return db[_0xd5a7('0x17')][_0xd5a7('0x1e')](_0x3d8737[_0xd5a7('0x19')],{'raw':_0x3d8737['options']?_0x3d8737['options'][_0xd5a7('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d8737[_0xd5a7('0x1a')]?_0x3d8737['options'][_0xd5a7('0x1f')]||null:null,'attributes':_0x3d8737['options']?_0x3d8737[_0xd5a7('0x1a')][_0xd5a7('0x20')]||null:null,'limit':_0x3d8737[_0xd5a7('0x1a')]?_0x3d8737['options'][_0xd5a7('0x21')]||null:null})[_0xd5a7('0xd')](function(_0x21b18){logger[_0xd5a7('0xe')](_0xd5a7('0x22'),_0x3d8737);logger[_0xd5a7('0x1c')](_0xd5a7('0x22'),_0x3d8737,JSON[_0xd5a7('0x1d')](_0x21b18));_0x4499d4(_0x21b18);})['catch'](function(_0x4e17d6){logger['error'](_0xd5a7('0x22'),_0x4e17d6[_0xd5a7('0x13')],_0x3d8737);_0x247133(_0x276314['error'](0x1f4,_0x4e17d6[_0xd5a7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index ffa62bd..14b913d 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 _0xed7a=['exports','multer','util','Router','../../components/interaction/service','index','get','/:id','isAuthenticated','create','/:id/applications','addApplications','update'];(function(_0x254d47,_0x50ae3b){var _0x377bd0=function(_0x3c31bb){while(--_0x3c31bb){_0x254d47['push'](_0x254d47['shift']());}};_0x377bd0(++_0x50ae3b);}(_0xed7a,0x1e2));var _0xaed7=function(_0xf5a812,_0x108dff){_0xf5a812=_0xf5a812-0x0;var _0x2d048f=_0xed7a[_0xf5a812];return _0x2d048f;};'use strict';var multer=require(_0xaed7('0x0'));var util=require(_0xaed7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xaed7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaed7('0x3'));var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaed7('0x4')]);router[_0xaed7('0x5')](_0xaed7('0x6'),auth[_0xaed7('0x7')](),controller['show']);router['post']('/',auth[_0xaed7('0x7')](),controller[_0xaed7('0x8')]);router['post'](_0xaed7('0x9'),auth[_0xaed7('0x7')](),controller[_0xaed7('0xa')]);router['put'](_0xaed7('0x6'),auth[_0xaed7('0x7')](),controller[_0xaed7('0xb')]);router['delete'](_0xaed7('0x6'),auth[_0xaed7('0x7')](),controller['destroy']);module[_0xaed7('0xc')]=router; \ No newline at end of file +var _0xae3f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','/:id/applications','addApplications','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x157306,_0x24483b){var _0x46efc5=function(_0x242c0c){while(--_0x242c0c){_0x157306['push'](_0x157306['shift']());}};_0x46efc5(++_0x24483b);}(_0xae3f,0x170));var _0xfae3=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xae3f[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0xfae3('0x0'));var util=require(_0xfae3('0x1'));var path=require(_0xfae3('0x2'));var timeout=require(_0xfae3('0x3'));var express=require(_0xfae3('0x4'));var router=express[_0xfae3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfae3('0x6'));var interaction=require(_0xfae3('0x7'));var config=require(_0xfae3('0x8'));var controller=require('./voiceExtension.controller');router[_0xfae3('0x9')]('/',auth[_0xfae3('0xa')](),controller[_0xfae3('0xb')]);router[_0xfae3('0x9')]('/:id',auth[_0xfae3('0xa')](),controller[_0xfae3('0xc')]);router[_0xfae3('0xd')]('/',auth['isAuthenticated'](),controller[_0xfae3('0xe')]);router['post'](_0xfae3('0xf'),auth[_0xfae3('0xa')](),controller[_0xfae3('0x10')]);router[_0xfae3('0x11')](_0xfae3('0x12'),auth[_0xfae3('0xa')](),controller[_0xfae3('0x13')]);router[_0xfae3('0x14')](_0xfae3('0x12'),auth[_0xfae3('0xa')](),controller['destroy']);module[_0xfae3('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 39de1d2..3b9e214 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 _0x74da=['system','*,*,*,*','BOOLEAN','INTEGER','wav','getDataValue','exten','STRING','compositeIndex','NoOp','ENUM','outbound','internal','outbound-fax'];(function(_0xaa62a,_0x45d113){var _0x47ce4a=function(_0x2391bf){while(--_0x2391bf){_0xaa62a['push'](_0xaa62a['shift']());}};_0x47ce4a(++_0x45d113);}(_0x74da,0x69));var _0xa74d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x74da[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize[_0xa74d('0x0')],'allowNull':![],'unique':_0xa74d('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa74d('0x0')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xa74d('0x1')},'tag':{'type':Sequelize[_0xa74d('0x0')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa74d('0x2')},'appdata':{'type':Sequelize[_0xa74d('0x0')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xa74d('0x3')]('inbound',_0xa74d('0x4'),_0xa74d('0x5'),'inbound-fax',_0xa74d('0x6'),_0xa74d('0x7'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xa74d('0x0')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa74d('0x8')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa74d('0x0')],'defaultValue':null},'callerID':{'type':Sequelize[_0xa74d('0x0')],'allowNull':!![]},'record':{'type':Sequelize[_0xa74d('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xa74d('0xa')]},'recordingFormat':{'type':Sequelize[_0xa74d('0x0')],'defaultValue':_0xa74d('0xb')},'answer':{'type':Sequelize[_0xa74d('0x9')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x403778){return this[_0xa74d('0xc')](_0xa74d('0xd'));}},'alias':{'type':Sequelize[_0xa74d('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0xccbf=['NoOp','ENUM','inbound','outbound','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','exports','STRING','compositeIndex'];(function(_0x4b6f15,_0x3740ad){var _0x2e3064=function(_0x22c300){while(--_0x22c300){_0x4b6f15['push'](_0x4b6f15['shift']());}};_0x2e3064(++_0x3740ad);}(_0xccbf,0x1bc));var _0xfccb=function(_0x508b78,_0x88dc32){_0x508b78=_0x508b78-0x0;var _0x3bb4a7=_0xccbf[_0x508b78];return _0x3bb4a7;};'use strict';var Sequelize=require(_0xfccb('0x0'));module[_0xfccb('0x1')]={'context':{'type':Sequelize[_0xfccb('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xfccb('0x2')],'allowNull':![],'unique':_0xfccb('0x3')},'priority':{'type':Sequelize[_0xfccb('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xfccb('0x3')},'tag':{'type':Sequelize[_0xfccb('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfccb('0x4')},'appdata':{'type':Sequelize[_0xfccb('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xfccb('0x5')](_0xfccb('0x6'),_0xfccb('0x7'),'internal','inbound-fax',_0xfccb('0x8'),_0xfccb('0x9'),_0xfccb('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfccb('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xfccb('0xb')]},'isApp':{'type':Sequelize[_0xfccb('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xfccb('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xfccb('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xfccb('0xb')]},'recordingFormat':{'type':Sequelize[_0xfccb('0x2')],'defaultValue':_0xfccb('0xd')},'answer':{'type':Sequelize[_0xfccb('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xfccb('0xe')],'get':function(_0x497963){return this[_0xfccb('0xf')]('exten');}},'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 b31b222..34ad5ed 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 _0xa6b5=['UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','alias','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','findAndCountAll','finally','send','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','destroy','then','get','InboundRoutes','inbound','outbound','InternalRoutes','internal','filter','ignore','type','find','value','name','UserProfileResource','error','stack','index','map','VoiceExtension','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','startsWith','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes'];(function(_0x2d3ee5,_0x186a57){var _0x526b12=function(_0x18de6b){while(--_0x18de6b){_0x2d3ee5['push'](_0x2d3ee5['shift']());}};_0x526b12(++_0x186a57);}(_0xa6b5,0x127));var _0x5a6b=function(_0x593aa2,_0x598431){_0x593aa2=_0x593aa2-0x0;var _0x2a7c4b=_0xa6b5[_0x593aa2];return _0x2a7c4b;};'use strict';var _=require(_0x5a6b('0x0'));var Redis=require(_0x5a6b('0x1'));var qs=require(_0x5a6b('0x2'));var logger=require('../../config/logger')(_0x5a6b('0x3'));var config=require(_0x5a6b('0x4'));var db=require(_0x5a6b('0x5'))['db'];config[_0x5a6b('0x6')]=_[_0x5a6b('0x7')](config[_0x5a6b('0x6')],{'host':_0x5a6b('0x8'),'port':0x18eb});var socket=require(_0x5a6b('0x9'))(new Redis(config[_0x5a6b('0x6')]));require(_0x5a6b('0xa'))[_0x5a6b('0xb')](socket);function respondWithStatusCode(_0x23a658,_0x4f2707){_0x4f2707=_0x4f2707||0xcc;return function(_0x5ce4b7){if(_0x5ce4b7){return _0x23a658[_0x5a6b('0xc')](_0x4f2707);}return _0x23a658[_0x5a6b('0xd')](_0x4f2707)[_0x5a6b('0xe')]();};}function respondWithResult(_0xbd2bd,_0x505e1c){_0x505e1c=_0x505e1c||0xc8;return function(_0x130200){if(_0x130200){return _0xbd2bd[_0x5a6b('0xd')](_0x505e1c)['json'](_0x130200);}};}function respondWithFilteredResult(_0x28a662,_0x2a225b){return function(_0x3b17c7){if(_0x3b17c7){var _0x3cf0ff=typeof _0x2a225b[_0x5a6b('0xf')]===_0x5a6b('0x10')&&typeof _0x2a225b[_0x5a6b('0x11')]===_0x5a6b('0x10');var _0x1c3e47=_0x3b17c7[_0x5a6b('0x12')];var _0x4330ad=_0x3cf0ff?0x0:_0x2a225b[_0x5a6b('0xf')];var _0xd2cd33=_0x3cf0ff?_0x3b17c7[_0x5a6b('0x12')]:_0x2a225b['offset']+_0x2a225b[_0x5a6b('0x11')];var _0x366755;if(_0xd2cd33>=_0x1c3e47){_0xd2cd33=_0x1c3e47;_0x366755=0xc8;}else{_0x366755=0xce;}_0x28a662[_0x5a6b('0xd')](_0x366755);return _0x28a662[_0x5a6b('0x13')](_0x5a6b('0x14'),_0x4330ad+'-'+_0xd2cd33+'/'+_0x1c3e47)[_0x5a6b('0x15')](_0x3b17c7);}return null;};}function removeEntity(_0x5803d2){return function(_0x3caa32){if(_0x3caa32){return _0x3caa32[_0x5a6b('0x16')]()[_0x5a6b('0x17')](function(){var _0x19e36c=_0x3caa32[_0x5a6b('0x18')]({'plain':!![]});var _0x580c75=[{'name':_0x5a6b('0x19'),'value':_0x5a6b('0x1a'),'ignore':![]},{'name':'OutboundRoutes','value':_0x5a6b('0x1b'),'ignore':![]},{'name':_0x5a6b('0x1c'),'value':_0x5a6b('0x1d'),'ignore':![]}];var _0x5c254f=_(_0x580c75)[_0x5a6b('0x1e')](_0x5a6b('0x1f'))['map']('value')['value']();if(_['includes'](_0x5c254f,_0x19e36c[_0x5a6b('0x20')])){return;}var _0x2bbad2=_[_0x5a6b('0x21')](_0x580c75,[_0x5a6b('0x22'),_0x19e36c[_0x5a6b('0x20')]])[_0x5a6b('0x23')];return db[_0x5a6b('0x24')][_0x5a6b('0x16')]({'where':{'type':_0x2bbad2,'resourceId':_0x19e36c['id']}})[_0x5a6b('0x17')](function(){return _0x3caa32;});})[_0x5a6b('0x17')](function(){_0x5803d2[_0x5a6b('0xd')](0xcc)[_0x5a6b('0xe')]();});}};}function handleEntityNotFound(_0x59ad83){return function(_0x59bf54){if(!_0x59bf54){_0x59ad83[_0x5a6b('0xc')](0x194);}return _0x59bf54;};}function handleError(_0x3bc47e,_0xe4acb5){_0xe4acb5=_0xe4acb5||0x1f4;return function(_0x4a6ac4){logger[_0x5a6b('0x25')](_0x4a6ac4[_0x5a6b('0x26')]);if(_0x4a6ac4[_0x5a6b('0x23')]){delete _0x4a6ac4[_0x5a6b('0x23')];}_0x3bc47e[_0x5a6b('0xd')](_0xe4acb5)['send'](_0x4a6ac4);};}exports[_0x5a6b('0x27')]=function(_0x5754c5,_0x22bc9c){var _0x2f1b96={},_0x275edd={},_0x4c6f65={'count':0x0,'rows':[]};var _0x9280a8=_[_0x5a6b('0x28')](db[_0x5a6b('0x29')][_0x5a6b('0x2a')],function(_0x13a193){return{'name':_0x13a193['fieldName'],'type':_0x13a193[_0x5a6b('0x20')]['key']};});_0x275edd[_0x5a6b('0x2b')]=_['map'](_0x9280a8,_0x5a6b('0x23'));_0x275edd[_0x5a6b('0x2c')]=_[_0x5a6b('0x2d')](_0x5754c5[_0x5a6b('0x2c')]);_0x275edd[_0x5a6b('0x2e')]=_[_0x5a6b('0x2f')](_0x275edd['model'],_0x275edd[_0x5a6b('0x2c')]);_0x2f1b96['attributes']=_[_0x5a6b('0x2f')](_0x275edd[_0x5a6b('0x2b')],qs[_0x5a6b('0x30')](_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x30')]));_0x2f1b96[_0x5a6b('0x31')]=_0x2f1b96[_0x5a6b('0x31')][_0x5a6b('0x32')]?_0x2f1b96[_0x5a6b('0x31')]:_0x275edd[_0x5a6b('0x2b')];if(!_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x33')](_0x5a6b('0x34'))){_0x2f1b96[_0x5a6b('0x11')]=qs['limit'](_0x5754c5[_0x5a6b('0x2c')]['limit']);_0x2f1b96[_0x5a6b('0xf')]=qs[_0x5a6b('0xf')](_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0xf')]);}_0x2f1b96[_0x5a6b('0x35')]=qs[_0x5a6b('0x36')](_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x36')]);_0x2f1b96[_0x5a6b('0x37')]=qs[_0x5a6b('0x2e')](_[_0x5a6b('0x38')](_0x5754c5['query'],_0x275edd[_0x5a6b('0x2e')]),_0x9280a8);if(_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x1e')]){_0x2f1b96['where']=_[_0x5a6b('0x39')](_0x2f1b96[_0x5a6b('0x37')],{'$or':_[_0x5a6b('0x28')](_0x9280a8,function(_0x4b8e2a){if(_0x4b8e2a['type']!==_0x5a6b('0x3a')){var _0x17b411={};_0x17b411[_0x4b8e2a['name']]={'$like':'%'+_0x5754c5['query']['filter']+'%'};return _0x17b411;}})});}_0x2f1b96=_[_0x5a6b('0x39')]({},_0x2f1b96,_0x5754c5['options']);var _0x4bc758={'where':_0x2f1b96[_0x5a6b('0x37')]};return db[_0x5a6b('0x29')][_0x5a6b('0x12')](_0x4bc758)[_0x5a6b('0x17')](function(_0x5b59d4){_0x4c6f65[_0x5a6b('0x12')]=_0x5b59d4;if(_0x5754c5[_0x5a6b('0x2c')][_0x5a6b('0x3b')]){_0x2f1b96['include']=[{'all':!![]}];}return db[_0x5a6b('0x29')][_0x5a6b('0x3c')](_0x2f1b96);})[_0x5a6b('0x17')](function(_0x42368e){_0x4c6f65['rows']=_0x42368e;return _0x4c6f65;})[_0x5a6b('0x17')](respondWithFilteredResult(_0x22bc9c,_0x2f1b96))[_0x5a6b('0x3d')](handleError(_0x22bc9c,null));};exports[_0x5a6b('0x3e')]=function(_0x5c8550,_0x5b990c){var _0x53ae29={'raw':![],'where':{'id':_0x5c8550[_0x5a6b('0x3f')]['id']}},_0x4c5ded={};_0x4c5ded['model']=_[_0x5a6b('0x2d')](db['VoiceExtension'][_0x5a6b('0x2a')]);_0x4c5ded[_0x5a6b('0x2c')]=_[_0x5a6b('0x2d')](_0x5c8550['query']);_0x4c5ded[_0x5a6b('0x2e')]=_[_0x5a6b('0x2f')](_0x4c5ded['model'],_0x4c5ded['query']);_0x53ae29['attributes']=_['intersection'](_0x4c5ded[_0x5a6b('0x2b')],qs[_0x5a6b('0x30')](_0x5c8550['query'][_0x5a6b('0x30')]));_0x53ae29[_0x5a6b('0x31')]=_0x53ae29[_0x5a6b('0x31')][_0x5a6b('0x32')]?_0x53ae29[_0x5a6b('0x31')]:_0x4c5ded['model'];if(_0x5c8550[_0x5a6b('0x2c')][_0x5a6b('0x3b')]){_0x53ae29[_0x5a6b('0x40')]=[{'all':!![]}];}_0x53ae29=_['merge']({},_0x53ae29,_0x5c8550[_0x5a6b('0x41')]);return db[_0x5a6b('0x29')][_0x5a6b('0x21')](_0x53ae29)[_0x5a6b('0x17')](handleEntityNotFound(_0x5b990c,null))['then'](respondWithResult(_0x5b990c,null))['catch'](handleError(_0x5b990c,null));};exports[_0x5a6b('0x16')]=function(_0x149282,_0x125133){return db[_0x5a6b('0x29')][_0x5a6b('0x21')]({'where':{'id':_0x149282[_0x5a6b('0x3f')]['id']}})[_0x5a6b('0x17')](handleEntityNotFound(_0x125133,null))[_0x5a6b('0x17')](removeEntity(_0x125133,null))[_0x5a6b('0x3d')](handleError(_0x125133,null));};exports['create']=function(_0x364770,_0x108edf){if(_0x364770['body'][_0x5a6b('0x20')]==='outbound'&&!_[_0x5a6b('0x42')](_0x364770[_0x5a6b('0x43')][_0x5a6b('0x44')],'_')){_0x364770[_0x5a6b('0x43')]['exten']='_'[_0x5a6b('0x45')](_0x364770[_0x5a6b('0x43')][_0x5a6b('0x44')]);}return db[_0x5a6b('0x29')]['create'](_0x364770[_0x5a6b('0x43')],{'raw':![]})[_0x5a6b('0x17')](function(_0x40a4e0){var _0x24b2d8=_0x364770['user']['get']({'plain':!![]});if(!_0x24b2d8)throw new Error(_0x5a6b('0x46'));if(_0x24b2d8[_0x5a6b('0x47')]==='user'){var _0xb1ec4d=_0x40a4e0['get']({'plain':!![]});var _0x23c9c2=[{'name':_0x5a6b('0x19'),'value':_0x5a6b('0x1a')},{'name':_0x5a6b('0x48'),'value':_0x5a6b('0x1b')},{'name':'InternalRoutes','value':_0x5a6b('0x1d')}];var _0x2e8a19=_['find'](_0x23c9c2,[_0x5a6b('0x22'),_0xb1ec4d[_0x5a6b('0x20')]])[_0x5a6b('0x23')];return db[_0x5a6b('0x49')][_0x5a6b('0x21')]({'where':{'name':_0x2e8a19,'userProfileId':_0x24b2d8['userProfileId']},'raw':!![]})[_0x5a6b('0x17')](function(_0x32cc1f){if(_0x32cc1f&&_0x32cc1f['autoAssociation']===0x0){return db[_0x5a6b('0x24')][_0x5a6b('0x4a')]({'name':_0xb1ec4d['name'],'resourceId':_0xb1ec4d['id'],'type':_0x32cc1f[_0x5a6b('0x23')],'sectionId':_0x32cc1f['id']},{})['then'](function(){return _0x40a4e0;});}else{return _0x40a4e0;}})[_0x5a6b('0x3d')](function(_0x4befa8){logger[_0x5a6b('0x25')](_0x5a6b('0x4b'),_0x4befa8);throw _0x4befa8;});}return _0x40a4e0;})[_0x5a6b('0x17')](respondWithResult(_0x108edf,0xc9))['catch'](handleError(_0x108edf,null));};exports[_0x5a6b('0x4c')]=function(_0x5f1ae0,_0x279a8a){if(_0x5f1ae0[_0x5a6b('0x43')]['id']){delete _0x5f1ae0[_0x5a6b('0x43')]['id'];}return db['VoiceExtension'][_0x5a6b('0x21')]({'where':{'id':_0x5f1ae0[_0x5a6b('0x3f')]['id']}})[_0x5a6b('0x17')](handleEntityNotFound(_0x279a8a,null))[_0x5a6b('0x17')](function(_0x47e3b5){if(_0x47e3b5){return db[_0x5a6b('0x29')][_0x5a6b('0x4c')](_[_0x5a6b('0x38')](_0x5f1ae0[_0x5a6b('0x43')],[_0x5a6b('0x44'),_0x5a6b('0x4d'),'description',_0x5a6b('0x4e'),_0x5a6b('0x4f'),'mandatoryDisposition',_0x5a6b('0x50')]),{'where':{'context':_0x47e3b5[_0x5a6b('0x4d')],'exten':_0x47e3b5[_0x5a6b('0x44')]},'individualHooks':!![]})[_0x5a6b('0x17')](function(_0x508568){return _0x508568;});}return null;})[_0x5a6b('0x17')](respondWithStatusCode(_0x279a8a,null))[_0x5a6b('0x3d')](handleError(_0x279a8a,null));};exports[_0x5a6b('0x51')]=function(_0x146390,_0x792d72){var _0x35a16b=_0x146390['params']['id'];var _0x515e69=_0x146390[_0x5a6b('0x43')];var _0x1af648=0xc8;var _0x2b2556=null;return db[_0x5a6b('0x52')]['transaction']({'isolationLevel':db[_0x5a6b('0x52')]['Transaction'][_0x5a6b('0x53')][_0x5a6b('0x54')]},function(_0x4786b7){return db[_0x5a6b('0x29')][_0x5a6b('0x55')]({'where':{'id':_0x35a16b},'transaction':_0x4786b7})[_0x5a6b('0x17')](function(_0x10f181){if(_0x10f181){return db['VoiceExtension'][_0x5a6b('0x16')]({'where':{'VoiceExtensionId':_0x35a16b},'transaction':_0x4786b7})[_0x5a6b('0x17')](function(){var _0x1925b2=_[_0x5a6b('0x28')](_0x515e69,function(_0x83bc5a){_0x83bc5a[_0x5a6b('0x56')]=_0x35a16b;_0x83bc5a[_0x5a6b('0x57')]=!![];return _0x83bc5a;});return _0x10f181['createRouting'](_0x1925b2);})['then'](function(_0x3e5ea3){return db[_0x5a6b('0x29')][_0x5a6b('0x58')](_0x3e5ea3,{'transaction':_0x4786b7});});}else{_0x1af648=0x194;_0x2b2556=[];}});})[_0x5a6b('0x17')](function(){if(_0x1af648!==0x194){return db[_0x5a6b('0x29')][_0x5a6b('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x35a16b},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x2a5cec){_0x2b2556=_0x2a5cec;});}})['catch'](function(_0x228e87){_0x1af648=0x1f4;logger['error'](_0x228e87[_0x5a6b('0x26')]);if(_0x228e87[_0x5a6b('0x23')]){delete _0x228e87[_0x5a6b('0x23')];}_0x2b2556=_0x228e87;})[_0x5a6b('0x5a')](function(){if(_0x2b2556===null){_0x792d72[_0x5a6b('0xc')](_0x1af648);}else{if(_0x1af648===0x1f4){_0x792d72[_0x5a6b('0xd')](_0x1af648)[_0x5a6b('0x5b')](_0x2b2556);}else{_0x792d72['status'](_0x1af648)[_0x5a6b('0x15')](_0x2b2556);}}});}; \ No newline at end of file +var _0xd089=['undefined','count','limit','set','Content-Range','json','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','options','includeAll','findAll','catch','show','length','include','params','body','startsWith','exten','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','transaction','Transaction','ISOLATION_LEVELS','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset'];(function(_0x5b456b,_0x13eb78){var _0xf93f97=function(_0x316167){while(--_0x316167){_0x5b456b['push'](_0x5b456b['shift']());}};_0xf93f97(++_0x13eb78);}(_0xd089,0xab));var _0x9d08=function(_0xd21bad,_0x125eb0){_0xd21bad=_0xd21bad-0x0;var _0x4aca91=_0xd089[_0xd21bad];return _0x4aca91;};'use strict';var _=require(_0x9d08('0x0'));var Redis=require(_0x9d08('0x1'));var qs=require(_0x9d08('0x2'));var logger=require(_0x9d08('0x3'))('api');var config=require(_0x9d08('0x4'));var db=require(_0x9d08('0x5'))['db'];config[_0x9d08('0x6')]=_[_0x9d08('0x7')](config[_0x9d08('0x6')],{'host':_0x9d08('0x8'),'port':0x18eb});var socket=require(_0x9d08('0x9'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x213f87,_0x5a08b6){_0x5a08b6=_0x5a08b6||0xcc;return function(_0x21f220){if(_0x21f220){return _0x213f87[_0x9d08('0xa')](_0x5a08b6);}return _0x213f87[_0x9d08('0xb')](_0x5a08b6)['end']();};}function respondWithResult(_0x14de03,_0x4b5307){_0x4b5307=_0x4b5307||0xc8;return function(_0x3f9f41){if(_0x3f9f41){return _0x14de03[_0x9d08('0xb')](_0x4b5307)['json'](_0x3f9f41);}};}function respondWithFilteredResult(_0x5f4ce3,_0x377ba2){return function(_0x1c9070){if(_0x1c9070){var _0x3665fa=typeof _0x377ba2[_0x9d08('0xc')]===_0x9d08('0xd')&&typeof _0x377ba2['limit']===_0x9d08('0xd');var _0x36bc50=_0x1c9070['count'];var _0x10629f=_0x3665fa?0x0:_0x377ba2[_0x9d08('0xc')];var _0x37bf03=_0x3665fa?_0x1c9070[_0x9d08('0xe')]:_0x377ba2['offset']+_0x377ba2[_0x9d08('0xf')];var _0x9de844;if(_0x37bf03>=_0x36bc50){_0x37bf03=_0x36bc50;_0x9de844=0xc8;}else{_0x9de844=0xce;}_0x5f4ce3['status'](_0x9de844);return _0x5f4ce3[_0x9d08('0x10')](_0x9d08('0x11'),_0x10629f+'-'+_0x37bf03+'/'+_0x36bc50)[_0x9d08('0x12')](_0x1c9070);}return null;};}function removeEntity(_0x140816){return function(_0x10e789){if(_0x10e789){return _0x10e789[_0x9d08('0x13')]()[_0x9d08('0x14')](function(){var _0x514592=_0x10e789[_0x9d08('0x15')]({'plain':!![]});var _0x55542f=[{'name':_0x9d08('0x16'),'value':'inbound','ignore':![]},{'name':_0x9d08('0x17'),'value':_0x9d08('0x18'),'ignore':![]},{'name':_0x9d08('0x19'),'value':_0x9d08('0x1a'),'ignore':![]}];var _0x3096ad=_(_0x55542f)[_0x9d08('0x1b')](_0x9d08('0x1c'))[_0x9d08('0x1d')](_0x9d08('0x1e'))[_0x9d08('0x1e')]();if(_[_0x9d08('0x1f')](_0x3096ad,_0x514592[_0x9d08('0x20')])){return;}var _0xfa58f8=_[_0x9d08('0x21')](_0x55542f,['value',_0x514592[_0x9d08('0x20')]])[_0x9d08('0x22')];return db['UserProfileResource'][_0x9d08('0x13')]({'where':{'type':_0xfa58f8,'resourceId':_0x514592['id']}})[_0x9d08('0x14')](function(){return _0x10e789;});})[_0x9d08('0x14')](function(){_0x140816[_0x9d08('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x389d47){return function(_0x2342e5){if(!_0x2342e5){_0x389d47['sendStatus'](0x194);}return _0x2342e5;};}function handleError(_0x54700d,_0x52b071){_0x52b071=_0x52b071||0x1f4;return function(_0x58a5b2){logger[_0x9d08('0x23')](_0x58a5b2['stack']);if(_0x58a5b2['name']){delete _0x58a5b2[_0x9d08('0x22')];}_0x54700d['status'](_0x52b071)[_0x9d08('0x24')](_0x58a5b2);};}exports[_0x9d08('0x25')]=function(_0x3cceca,_0x55dd75){var _0x345146={},_0x140a5c={},_0x4cfb73={'count':0x0,'rows':[]};var _0x4f4b9c=_['map'](db[_0x9d08('0x26')][_0x9d08('0x27')],function(_0x5880dd){return{'name':_0x5880dd[_0x9d08('0x28')],'type':_0x5880dd[_0x9d08('0x20')][_0x9d08('0x29')]};});_0x140a5c[_0x9d08('0x2a')]=_[_0x9d08('0x1d')](_0x4f4b9c,_0x9d08('0x22'));_0x140a5c[_0x9d08('0x2b')]=_[_0x9d08('0x2c')](_0x3cceca[_0x9d08('0x2b')]);_0x140a5c['filters']=_['intersection'](_0x140a5c[_0x9d08('0x2a')],_0x140a5c[_0x9d08('0x2b')]);_0x345146['attributes']=_[_0x9d08('0x2d')](_0x140a5c[_0x9d08('0x2a')],qs['fields'](_0x3cceca['query'][_0x9d08('0x2e')]));_0x345146[_0x9d08('0x2f')]=_0x345146['attributes']['length']?_0x345146[_0x9d08('0x2f')]:_0x140a5c[_0x9d08('0x2a')];if(!_0x3cceca[_0x9d08('0x2b')]['hasOwnProperty'](_0x9d08('0x30'))){_0x345146['limit']=qs[_0x9d08('0xf')](_0x3cceca['query'][_0x9d08('0xf')]);_0x345146[_0x9d08('0xc')]=qs[_0x9d08('0xc')](_0x3cceca[_0x9d08('0x2b')][_0x9d08('0xc')]);}_0x345146[_0x9d08('0x31')]=qs[_0x9d08('0x32')](_0x3cceca['query']['sort']);_0x345146[_0x9d08('0x33')]=qs[_0x9d08('0x34')](_[_0x9d08('0x35')](_0x3cceca[_0x9d08('0x2b')],_0x140a5c[_0x9d08('0x34')]),_0x4f4b9c);if(_0x3cceca[_0x9d08('0x2b')][_0x9d08('0x1b')]){_0x345146[_0x9d08('0x33')]=_['merge'](_0x345146['where'],{'$or':_[_0x9d08('0x1d')](_0x4f4b9c,function(_0x1e01de){if(_0x1e01de['type']!=='VIRTUAL'){var _0x6b68ea={};_0x6b68ea[_0x1e01de[_0x9d08('0x22')]]={'$like':'%'+_0x3cceca[_0x9d08('0x2b')][_0x9d08('0x1b')]+'%'};return _0x6b68ea;}})});}_0x345146=_[_0x9d08('0x36')]({},_0x345146,_0x3cceca[_0x9d08('0x37')]);var _0x44b44f={'where':_0x345146[_0x9d08('0x33')]};return db[_0x9d08('0x26')][_0x9d08('0xe')](_0x44b44f)[_0x9d08('0x14')](function(_0x35c438){_0x4cfb73[_0x9d08('0xe')]=_0x35c438;if(_0x3cceca[_0x9d08('0x2b')][_0x9d08('0x38')]){_0x345146['include']=[{'all':!![]}];}return db[_0x9d08('0x26')][_0x9d08('0x39')](_0x345146);})['then'](function(_0x174d92){_0x4cfb73['rows']=_0x174d92;return _0x4cfb73;})[_0x9d08('0x14')](respondWithFilteredResult(_0x55dd75,_0x345146))[_0x9d08('0x3a')](handleError(_0x55dd75,null));};exports[_0x9d08('0x3b')]=function(_0x433691,_0x445ba8){var _0x255cad={'raw':![],'where':{'id':_0x433691['params']['id']}},_0x7dc65b={};_0x7dc65b[_0x9d08('0x2a')]=_[_0x9d08('0x2c')](db[_0x9d08('0x26')]['rawAttributes']);_0x7dc65b[_0x9d08('0x2b')]=_[_0x9d08('0x2c')](_0x433691[_0x9d08('0x2b')]);_0x7dc65b[_0x9d08('0x34')]=_[_0x9d08('0x2d')](_0x7dc65b[_0x9d08('0x2a')],_0x7dc65b[_0x9d08('0x2b')]);_0x255cad[_0x9d08('0x2f')]=_[_0x9d08('0x2d')](_0x7dc65b[_0x9d08('0x2a')],qs[_0x9d08('0x2e')](_0x433691[_0x9d08('0x2b')]['fields']));_0x255cad['attributes']=_0x255cad[_0x9d08('0x2f')][_0x9d08('0x3c')]?_0x255cad[_0x9d08('0x2f')]:_0x7dc65b[_0x9d08('0x2a')];if(_0x433691[_0x9d08('0x2b')][_0x9d08('0x38')]){_0x255cad[_0x9d08('0x3d')]=[{'all':!![]}];}_0x255cad=_[_0x9d08('0x36')]({},_0x255cad,_0x433691[_0x9d08('0x37')]);return db[_0x9d08('0x26')][_0x9d08('0x21')](_0x255cad)['then'](handleEntityNotFound(_0x445ba8,null))[_0x9d08('0x14')](respondWithResult(_0x445ba8,null))[_0x9d08('0x3a')](handleError(_0x445ba8,null));};exports[_0x9d08('0x13')]=function(_0x1e5525,_0x1b3b08){return db[_0x9d08('0x26')][_0x9d08('0x21')]({'where':{'id':_0x1e5525[_0x9d08('0x3e')]['id']}})[_0x9d08('0x14')](handleEntityNotFound(_0x1b3b08,null))[_0x9d08('0x14')](removeEntity(_0x1b3b08,null))[_0x9d08('0x3a')](handleError(_0x1b3b08,null));};exports['create']=function(_0xac787a,_0xb3b12d){if(_0xac787a[_0x9d08('0x3f')][_0x9d08('0x20')]===_0x9d08('0x18')&&!_[_0x9d08('0x40')](_0xac787a[_0x9d08('0x3f')][_0x9d08('0x41')],'_')){_0xac787a['body'][_0x9d08('0x41')]='_'['concat'](_0xac787a[_0x9d08('0x3f')]['exten']);}return db[_0x9d08('0x26')][_0x9d08('0x42')](_0xac787a['body'],{'raw':![]})[_0x9d08('0x14')](function(_0x2ebabc){var _0x2a7481=_0xac787a[_0x9d08('0x43')][_0x9d08('0x15')]({'plain':!![]});if(!_0x2a7481)throw new Error(_0x9d08('0x44'));if(_0x2a7481[_0x9d08('0x45')]===_0x9d08('0x43')){var _0x155192=_0x2ebabc[_0x9d08('0x15')]({'plain':!![]});var _0x2da13d=[{'name':_0x9d08('0x16'),'value':_0x9d08('0x46')},{'name':'OutboundRoutes','value':_0x9d08('0x18')},{'name':_0x9d08('0x19'),'value':'internal'}];var _0x29d974=_[_0x9d08('0x21')](_0x2da13d,[_0x9d08('0x1e'),_0x155192[_0x9d08('0x20')]])[_0x9d08('0x22')];return db[_0x9d08('0x47')]['find']({'where':{'name':_0x29d974,'userProfileId':_0x2a7481[_0x9d08('0x48')]},'raw':!![]})['then'](function(_0x54d82b){if(_0x54d82b&&_0x54d82b[_0x9d08('0x49')]===0x0){return db['UserProfileResource'][_0x9d08('0x42')]({'name':_0x155192[_0x9d08('0x22')],'resourceId':_0x155192['id'],'type':_0x54d82b['name'],'sectionId':_0x54d82b['id']},{})[_0x9d08('0x14')](function(){return _0x2ebabc;});}else{return _0x2ebabc;}})['catch'](function(_0x87d81d){logger[_0x9d08('0x23')](_0x9d08('0x4a'),_0x87d81d);throw _0x87d81d;});}return _0x2ebabc;})[_0x9d08('0x14')](respondWithResult(_0xb3b12d,0xc9))[_0x9d08('0x3a')](handleError(_0xb3b12d,null));};exports[_0x9d08('0x4b')]=function(_0x2d1db1,_0x35c7b0){if(_0x2d1db1[_0x9d08('0x3f')]['id']){delete _0x2d1db1[_0x9d08('0x3f')]['id'];}return db[_0x9d08('0x26')][_0x9d08('0x21')]({'where':{'id':_0x2d1db1[_0x9d08('0x3e')]['id']}})[_0x9d08('0x14')](handleEntityNotFound(_0x35c7b0,null))[_0x9d08('0x14')](function(_0x20e74c){if(_0x20e74c){return db[_0x9d08('0x26')]['update'](_['pick'](_0x2d1db1[_0x9d08('0x3f')],['exten',_0x9d08('0x4c'),_0x9d08('0x4d'),_0x9d08('0x4e'),_0x9d08('0x4f'),_0x9d08('0x50'),_0x9d08('0x51')]),{'where':{'context':_0x20e74c[_0x9d08('0x4c')],'exten':_0x20e74c['exten']},'individualHooks':!![]})[_0x9d08('0x14')](function(_0x413c7c){return _0x413c7c;});}return null;})[_0x9d08('0x14')](respondWithStatusCode(_0x35c7b0,null))[_0x9d08('0x3a')](handleError(_0x35c7b0,null));};exports['addApplications']=function(_0x23ab3c,_0x2d0055){var _0x71ee36=_0x23ab3c[_0x9d08('0x3e')]['id'];var _0x313e71=_0x23ab3c[_0x9d08('0x3f')];var _0x1e0512=0xc8;var _0x4eac70=null;return db[_0x9d08('0x52')][_0x9d08('0x53')]({'isolationLevel':db[_0x9d08('0x52')][_0x9d08('0x54')][_0x9d08('0x55')]['READ_COMMITTED']},function(_0x690fb8){return db[_0x9d08('0x26')]['findOne']({'where':{'id':_0x71ee36},'transaction':_0x690fb8})[_0x9d08('0x14')](function(_0x40e485){if(_0x40e485){return db[_0x9d08('0x26')][_0x9d08('0x13')]({'where':{'VoiceExtensionId':_0x71ee36},'transaction':_0x690fb8})[_0x9d08('0x14')](function(){var _0x4f4d7d=_[_0x9d08('0x1d')](_0x313e71,function(_0x4eb9b0){_0x4eb9b0['VoiceExtensionId']=_0x71ee36;_0x4eb9b0[_0x9d08('0x56')]=!![];return _0x4eb9b0;});return _0x40e485[_0x9d08('0x57')](_0x4f4d7d);})[_0x9d08('0x14')](function(_0x37a707){return db[_0x9d08('0x26')][_0x9d08('0x58')](_0x37a707,{'transaction':_0x690fb8});});}else{_0x1e0512=0x194;_0x4eac70=[];}});})[_0x9d08('0x14')](function(){if(_0x1e0512!==0x194){return db[_0x9d08('0x26')][_0x9d08('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x71ee36},'order':_0x9d08('0x5a')})[_0x9d08('0x14')](function(_0x4652b3){_0x4eac70=_0x4652b3;});}})[_0x9d08('0x3a')](function(_0x2cbd07){_0x1e0512=0x1f4;logger[_0x9d08('0x23')](_0x2cbd07[_0x9d08('0x5b')]);if(_0x2cbd07[_0x9d08('0x22')]){delete _0x2cbd07['name'];}_0x4eac70=_0x2cbd07;})['finally'](function(){if(_0x4eac70===null){_0x2d0055[_0x9d08('0xa')](_0x1e0512);}else{if(_0x1e0512===0x1f4){_0x2d0055[_0x9d08('0xb')](_0x1e0512)['send'](_0x4eac70);}else{_0x2d0055[_0x9d08('0xb')](_0x1e0512)[_0x9d08('0x12')](_0x4eac70);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2b10ec6..26f0957 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 _0x6fdd=['save','update','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x42b8ad,_0x5f0671){var _0x1802fa=function(_0x583e40){while(--_0x583e40){_0x42b8ad['push'](_0x42b8ad['shift']());}};_0x1802fa(++_0x5f0671);}(_0x6fdd,0xe4));var _0xd6fd=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0x6fdd[_0x1af98d];return _0x3553ea;};'use strict';var EventEmitter=require(_0xd6fd('0x0'));var VoiceExtension=require(_0xd6fd('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd6fd('0x2')](0x0);var events={'afterCreate':_0xd6fd('0x3'),'afterUpdate':_0xd6fd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x507082){return function(_0x16055d,_0x4b3d27,_0x5aab79){VoiceExtensionEvents['emit'](_0x507082+':'+_0x16055d['id'],_0x16055d);VoiceExtensionEvents['emit'](_0x507082,_0x16055d);_0x5aab79(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xd6fd('0x5')](e,emitEvent(event));}}module[_0xd6fd('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x74ed=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x14eed8,_0x4b11c9){var _0x31956d=function(_0x27e244){while(--_0x27e244){_0x14eed8['push'](_0x14eed8['shift']());}};_0x31956d(++_0x4b11c9);}(_0x74ed,0xc9));var _0xd74e=function(_0x2c9731,_0x318505){_0x2c9731=_0x2c9731-0x0;var _0x1d0057=_0x74ed[_0x2c9731];return _0x1d0057;};'use strict';var EventEmitter=require(_0xd74e('0x0'));var VoiceExtension=require(_0xd74e('0x1'))['db'][_0xd74e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xd74e('0x3')](0x0);var events={'afterCreate':_0xd74e('0x4'),'afterUpdate':_0xd74e('0x5'),'afterDestroy':_0xd74e('0x6')};function emitEvent(_0x2b1bc7){return function(_0x48cbc3,_0x554d2f,_0x373b8e){VoiceExtensionEvents[_0xd74e('0x7')](_0x2b1bc7+':'+_0x48cbc3['id'],_0x48cbc3);VoiceExtensionEvents['emit'](_0x2b1bc7,_0x48cbc3);_0x373b8e(null);};}for(var e in events){if(events[_0xd74e('0x8')](e)){var event=events[e];VoiceExtension[_0xd74e('0x9')](e,emitEvent(event));}}module[_0xd74e('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 79e454b..8fb88bd 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 _0xea15=['IntervalId','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer','queue','playback','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','agi','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','then','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','exten','alias','NoOp','inbound','CDR(routeid)=','push','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','none','recordingFormat','trunk','timeout','url','split','length','name','param','phone','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval'];(function(_0x18e987,_0x5d2624){var _0x258534=function(_0x534e88){while(--_0x534e88){_0x18e987['push'](_0x18e987['shift']());}};_0x258534(++_0x5d2624);}(_0xea15,0x1c9));var _0x5ea1=function(_0x2e1675,_0x270807){_0x2e1675=_0x2e1675-0x0;var _0x2735b5=_0xea15[_0x2e1675];return _0x2735b5;};'use strict';var _=require(_0x5ea1('0x0'));var attributes=require(_0x5ea1('0x1'));module[_0x5ea1('0x2')]=function(_0x49215a){var _0xfa23a2=_0x49215a[_0x5ea1('0x3')];function _0x2ae52c(_0xc288d5){var _0x3ad150=0x2;var _0x1d4fff=[{'type':_0xc288d5[_0x5ea1('0x4')],'app':_0x5ea1('0x5'),'appdata':'CDR(type)='+_0xc288d5['type'],'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']},{'type':_0xc288d5[_0x5ea1('0x4')],'app':_0xc288d5[_0x5ea1('0x8')]?_0x5ea1('0x5'):_0x5ea1('0x9'),'appdata':_0xc288d5['alias']?'CDR(routeAlias)='+_0xc288d5[_0x5ea1('0x8')]:'No\x20alias\x20set','context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']}];if(_0xc288d5[_0x5ea1('0x4')]===_0x5ea1('0xa')){_0x1d4fff['push']({'type':'inbound','app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xb')+_0xc288d5['id'],'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']});}_0x1d4fff[_0x5ea1('0xc')]({'type':_0xc288d5[_0x5ea1('0x4')],'app':_0x5ea1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']},{'type':_0xc288d5[_0x5ea1('0x4')],'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xd'),'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']},{'type':_0xc288d5['type'],'app':'Set','appdata':_0x5ea1('0xe'),'context':_0xc288d5[_0x5ea1('0x6')],'exten':_0xc288d5[_0x5ea1('0x7')],'priority':_0x3ad150++,'VoiceExtensionId':_0xc288d5['id']});return _0x1d4fff;}function _0x175c3e(_0xf9b2c){var _0x416518=0x2;var _0x4afed7=[{'type':_0x5ea1('0xf'),'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0x10'),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':_0xf9b2c['alias']?_0x5ea1('0x5'):_0x5ea1('0x9'),'appdata':_0xf9b2c['alias']?_0x5ea1('0x11')+_0xf9b2c[_0x5ea1('0x8')]:_0x5ea1('0x12'),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':'Set','appdata':'CDR(destination)='+(_0xf9b2c[_0x5ea1('0x13')]?_0x5ea1('0x14')+_0xf9b2c[_0x5ea1('0x13')]+'}':_0x5ea1('0x15')),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xb')+_0xf9b2c['id'],'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':'ExecIf','appdata':_0x5ea1('0x16')+(_0x416518+0x2)+_0x5ea1('0x17')+(_0x416518+0x1)+')','context':_0xf9b2c['context'],'exten':_0xf9b2c['exten'],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':'Set','appdata':_0xf9b2c[_0x5ea1('0x13')]?_0x5ea1('0x18')+_0xf9b2c['cutdigits']+'}':_0x5ea1('0x19'),'context':_0xf9b2c['context'],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':_0x5ea1('0x5'),'appdata':_0x5ea1('0xd'),'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':_0x5ea1('0x5'),'appdata':'MONITOR_OPTIONS=ab','context':_0xf9b2c['context'],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':_0x5ea1('0xf'),'app':_0x5ea1('0x5'),'appdata':_0x5ea1('0x1a')+_0xf9b2c['id'],'context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']}];if(_0xf9b2c[_0x5ea1('0x1b')]('recordingFormat')&&_0xf9b2c['recordingFormat']!==_0x5ea1('0x1c')){_0x4afed7['push']({'type':'outbound','app':_0x5ea1('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']},{'type':'outbound','app':_0x5ea1('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xf9b2c[_0x5ea1('0x1d')]||'wav','context':_0xf9b2c[_0x5ea1('0x6')],'exten':_0xf9b2c[_0x5ea1('0x7')],'priority':_0x416518++,'VoiceExtensionId':_0xf9b2c['id']});}return _0x4afed7;}function _0x570e75(_0x3d4fd7,_0xe7d914){var _0x16b687=[{'name':_0x5ea1('0x1e'),'param':0x0},{'name':_0x5ea1('0x1f'),'param':0x1},{'name':'options','param':0x2},{'name':_0x5ea1('0x20'),'param':0x3}];var _0xf15aa3={};var _0x3d5931=_0xe7d914[_0x5ea1('0x21')](',');var _0x4ea82b=[];for(var _0xec7b4a=0x0;_0xec7b4a<_0x16b687[_0x5ea1('0x22')];_0xec7b4a++){switch(_0x16b687[_0xec7b4a][_0x5ea1('0x23')]){case'trunk':_0xf15aa3[_0x5ea1('0x1e')]=_0x3d5931[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]][_0x5ea1('0x21')]('/')[0x1];_0xf15aa3[_0x5ea1('0x25')]=_0x3d5931[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]][_0x5ea1('0x21')]('/')[0x2];_0xf15aa3['prefix']=_0xf15aa3['phone']?_0xf15aa3[_0x5ea1('0x25')][_0x5ea1('0x21')]('$')[0x0]:undefined;_0xf15aa3[_0x5ea1('0x25')]=_0x3d4fd7['cutdigits']?(_0xf15aa3['prefix']||'')+_0x5ea1('0x14')+_0x3d4fd7[_0x5ea1('0x13')]+'}':(_0xf15aa3[_0x5ea1('0x26')]||'')+_0x5ea1('0x15');_0x4ea82b[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]]=['SIP',_0xf15aa3[_0x5ea1('0x1e')],_0xf15aa3[_0x5ea1('0x25')]][_0x5ea1('0x27')]('/');break;case _0x5ea1('0x28'):_0xf15aa3[_0x5ea1('0x28')]=_0x3d5931[_0x16b687[_0xec7b4a]['param']];if(_0x3d4fd7[_0x5ea1('0x1d')]!==_0x5ea1('0x1c')){if(_0xf15aa3[_0x5ea1('0x28')][_0x5ea1('0x29')](_0x5ea1('0x2a'))<0x0){_0xf15aa3[_0x5ea1('0x28')]+=_0x5ea1('0x2a');}}else{_0xf15aa3[_0x5ea1('0x28')]=_0xf15aa3['options'][_0x5ea1('0x2b')](_0x5ea1('0x2a'),'');}_0x4ea82b[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]]=_0xf15aa3['options'];break;default:_0x4ea82b[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]]=_0x3d5931[_0x16b687[_0xec7b4a][_0x5ea1('0x24')]];}}return _0x4ea82b['join'](',');}function _0x146868(_0x58a5cc,_0x515f91,_0x5827c1){return new Promise(function(_0x34f512,_0x42d634){var _0x514651=[];if(_['isEmpty'](_0x515f91))return _0x34f512(_0x514651);_0xfa23a2[_0x5ea1('0x2c')][_0x5ea1('0x2d')]({'attributes':['id',_0x5ea1('0x2e'),_0x5ea1('0x2f')],'raw':!![]})['then'](function(_0x318dd4){for(var _0x25d7ab=0x0,_0x3c16f5=0x0;_0x25d7ab<_0x515f91[_0x5ea1('0x22')];_0x25d7ab++,_0x3c16f5=0x0){var _0x917a61=_0x515f91[_0x25d7ab];var _0x3e1610=[];var _0x814933=[];delete _0x917a61['id'];if(_0x917a61[_0x5ea1('0x2e')]!==_0x5ea1('0x30')){_0x917a61[_0x5ea1('0x31')]=[_0x917a61[_0x5ea1('0x2e')]];}else{_0x917a61[_0x5ea1('0x31')]=_0x917a61['IntervalId']?_[_0x5ea1('0x32')](_[_0x5ea1('0x33')](_0x318dd4,{'IntervalId':_0x917a61[_0x5ea1('0x2f')]}),_0x5ea1('0x2e')):[];}_0x917a61['context']=_0x58a5cc[_0x5ea1('0x6')];_0x917a61[_0x5ea1('0x7')]=_0x58a5cc['exten'];if(_0x917a61[_0x5ea1('0x4')])_0x917a61[_0x5ea1('0x4')]=_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')]();if(_0x58a5cc['type']===_0x5ea1('0xf')){if(_0x917a61[_0x5ea1('0x1b')]('tag')&&_0x917a61[_0x5ea1('0x35')]&&_0x917a61[_0x5ea1('0x35')]!=='--'){_0x3e1610['push']({'type':_0x917a61['type'][_0x5ea1('0x34')](),'app':'Set','appdata':_0x5ea1('0x36')+_0x917a61['tag'],'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61['intervals'][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':_0x5ea1('0x37'),'appdata':_0x5ea1('0x38')+(_0x917a61['callerID']?_0x5ea1('0x39')+_0x917a61[_0x5ea1('0x3a')]+')':'NoOp(No\x20number\x20available)'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}else{if(_0x917a61['hasOwnProperty'](_0x5ea1('0x3b'))){if([_0x5ea1('0x3c'),_0x5ea1('0x3d')]['includes'](_0x917a61['app'][_0x5ea1('0x34')]())&&_0x917a61[_0x5ea1('0x3e')]!==_0x5ea1('0x3f')){if(_0x917a61[_0x5ea1('0x3b')]){_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61['type']['toLowerCase'](),'app':_0x5ea1('0x37'),'appdata':_0x5ea1('0x40'),'context':_0x58a5cc['context'],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')]['length']+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':'Set','appdata':_0x5ea1('0x41'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}else{_0x3e1610['push']({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':_0x5ea1('0x37'),'appdata':_0x5ea1('0x42'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc['exten'],'priority':_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61['type'][_0x5ea1('0x34')](),'app':'Set','appdata':_0x5ea1('0x43'),'context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc[_0x5ea1('0x7')],'priority':_0x917a61[_0x5ea1('0x31')]['length']+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}}}}for(var _0x16b3aa=0x0;_0x16b3aa<_0x917a61['intervals'][_0x5ea1('0x22')];_0x16b3aa++){var _0x223e4d=_0x5827c1+_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')];var _0x1af856=_0x16b3aa===_0x917a61[_0x5ea1('0x31')][_0x5ea1('0x22')]-0x1?_0x5827c1+_0x3e1610['length']+_0x814933[_0x5ea1('0x22')]+0x2:_0x5827c1+_0x16b3aa+0x1;_0x3e1610[_0x5ea1('0x44')](_0x16b3aa,0x0,{'type':_0x58a5cc[_0x5ea1('0x4')],'app':_0x5ea1('0x45'),'appdata':_0x917a61[_0x5ea1('0x31')][_0x16b3aa]+'?'+_0x58a5cc[_0x5ea1('0x6')]+_0x5ea1('0x46')+_0x223e4d+':'+_0x58a5cc['context']+_0x5ea1('0x46')+_0x1af856,'exten':_0x58a5cc['exten'],'context':_0x58a5cc[_0x5ea1('0x6')],'priority':_0x5827c1+_0x16b3aa,'VoiceExtensionId':_0x58a5cc['id']});}if(_0x917a61[_0x5ea1('0x3e')]===_0x5ea1('0x47')){_0x917a61[_0x5ea1('0x48')]=_0x570e75(_0x58a5cc,_0x917a61['appdata']);}if(_0x917a61[_0x5ea1('0x3e')]===_0x5ea1('0x49')){_0x3e1610[_0x5ea1('0xc')]({'type':_0x917a61[_0x5ea1('0x4')][_0x5ea1('0x34')](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x58a5cc[_0x5ea1('0x6')],'exten':_0x58a5cc['exten'],'priority':_0x917a61[_0x5ea1('0x31')]['length']+_0x5827c1+_0x3c16f5++,'VoiceExtensionId':_0x58a5cc['id']});}_0x917a61[_0x5ea1('0x4a')]=_0x3e1610[_0x5ea1('0x22')]?_[_0x5ea1('0x4b')](_0x3e1610)[_0x5ea1('0x4a')]+0x1:_0x5827c1;_0x514651=_[_0x5ea1('0x4c')](_0x514651,_0x3e1610,[_0x917a61],_0x814933);_0x5827c1=_['last'](_0x514651)[_0x5ea1('0x4a')]+0x1;}return _0x34f512(_0x514651);})[_0x5ea1('0x4d')](function(_0x464170){_0x42d634(_0x464170);});});}return _0x49215a[_0x5ea1('0x4e')](_0x5ea1('0x4f'),attributes,{'tableName':_0x5ea1('0x50'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4cfe96){var _0x20ff7c=this[_0x5ea1('0x51')]({'plain':!![]});var _0x17965f=_0x20ff7c['type']===_0x5ea1('0xf')?_0x175c3e(_0x20ff7c):_0x2ae52c(_0x20ff7c);return _0x146868(_0x20ff7c,_0x4cfe96,_[_0x5ea1('0x4b')](_0x17965f)[_0x5ea1('0x4a')]+0x1)[_0x5ea1('0x52')](function(_0x5f5d0d){var _0x25792b=_[_0x5ea1('0x4c')](_0x17965f,_0x5f5d0d);_0x25792b[_0x5ea1('0xc')]({'type':_0x20ff7c[_0x5ea1('0x4')],'app':_0x5ea1('0x53'),'exten':_0x20ff7c[_0x5ea1('0x7')],'context':_0x20ff7c[_0x5ea1('0x6')],'priority':_[_0x5ea1('0x4b')](_0x25792b)['priority']+0x1,'VoiceExtensionId':_0x20ff7c['id']});return _0x25792b;});}}});}; \ No newline at end of file +var _0xf6d8=['queue','playback','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice',',${EXTEN},','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','last','concat','priority','catch','define','VoiceExtension','voice_extensions','then','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','none','wav','timeout','options','url','length','split','phone','prefix','SIP','trunk','join','param','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','interval','IntervalId','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','answer'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf6d8,0xb4));var _0x8f6d=function(_0x362e6d,_0x4d40b0){_0x362e6d=_0x362e6d-0x0;var _0x416d99=_0xf6d8[_0x362e6d];return _0x416d99;};'use strict';var _=require(_0x8f6d('0x0'));var attributes=require(_0x8f6d('0x1'));module[_0x8f6d('0x2')]=function(_0x2f16a9){var _0x569061=_0x2f16a9[_0x8f6d('0x3')];function _0x145474(_0x554429){var _0x299f2e=0x2;var _0x1ec708=[{'type':_0x554429[_0x8f6d('0x4')],'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x6')+_0x554429['type'],'context':_0x554429['context'],'exten':_0x554429[_0x8f6d('0x7')],'priority':_0x299f2e++,'VoiceExtensionId':_0x554429['id']},{'type':_0x554429['type'],'app':_0x554429[_0x8f6d('0x8')]?_0x8f6d('0x5'):_0x8f6d('0x9'),'appdata':_0x554429[_0x8f6d('0x8')]?_0x8f6d('0xa')+_0x554429['alias']:_0x8f6d('0xb'),'context':_0x554429[_0x8f6d('0xc')],'exten':_0x554429[_0x8f6d('0x7')],'priority':_0x299f2e++,'VoiceExtensionId':_0x554429['id']}];if(_0x554429[_0x8f6d('0x4')]===_0x8f6d('0xd')){_0x1ec708['push']({'type':'inbound','app':_0x8f6d('0x5'),'appdata':'CDR(routeid)='+_0x554429['id'],'context':_0x554429[_0x8f6d('0xc')],'exten':_0x554429[_0x8f6d('0x7')],'priority':_0x299f2e++,'VoiceExtensionId':_0x554429['id']});}_0x1ec708[_0x8f6d('0xe')]({'type':_0x554429['type'],'app':_0x8f6d('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x554429['context'],'exten':_0x554429[_0x8f6d('0x7')],'priority':_0x299f2e++,'VoiceExtensionId':_0x554429['id']},{'type':_0x554429['type'],'app':_0x8f6d('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x554429[_0x8f6d('0xc')],'exten':_0x554429[_0x8f6d('0x7')],'priority':_0x299f2e++,'VoiceExtensionId':_0x554429['id']},{'type':_0x554429[_0x8f6d('0x4')],'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0xf'),'context':_0x554429['context'],'exten':_0x554429[_0x8f6d('0x7')],'priority':_0x299f2e++,'VoiceExtensionId':_0x554429['id']});return _0x1ec708;}function _0x37b7a7(_0x15d9bd){var _0x24d68b=0x2;var _0xc457b8=[{'type':'outbound','app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x10'),'context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':_0x8f6d('0x11'),'app':_0x15d9bd['alias']?_0x8f6d('0x5'):_0x8f6d('0x9'),'appdata':_0x15d9bd[_0x8f6d('0x8')]?'CDR(routeAlias)='+_0x15d9bd[_0x8f6d('0x8')]:_0x8f6d('0xb'),'context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':_0x8f6d('0x11'),'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x12')+(_0x15d9bd[_0x8f6d('0x13')]?_0x8f6d('0x14')+_0x15d9bd[_0x8f6d('0x13')]+'}':_0x8f6d('0x15')),'context':_0x15d9bd['context'],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':'outbound','app':_0x8f6d('0x5'),'appdata':'CDR(routeid)='+_0x15d9bd['id'],'context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd['exten'],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':'outbound','app':_0x8f6d('0x16'),'appdata':_0x8f6d('0x17')+(_0x24d68b+0x2)+'):Goto('+(_0x24d68b+0x1)+')','context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd['exten'],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':_0x8f6d('0x11'),'app':'Set','appdata':_0x15d9bd[_0x8f6d('0x13')]?_0x8f6d('0x18')+_0x15d9bd[_0x8f6d('0x13')]+'}':_0x8f6d('0x19'),'context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':_0x8f6d('0x11'),'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x1a'),'context':_0x15d9bd['context'],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':_0x8f6d('0x11'),'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x1b'),'context':_0x15d9bd['context'],'exten':_0x15d9bd['exten'],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':_0x8f6d('0x11'),'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0xf'),'context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':_0x8f6d('0x11'),'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x1c')+_0x15d9bd['id'],'context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']}];if(_0x15d9bd['hasOwnProperty'](_0x8f6d('0x1d'))&&_0x15d9bd[_0x8f6d('0x1d')]!==_0x8f6d('0x1e')){_0xc457b8[_0x8f6d('0xe')]({'type':_0x8f6d('0x11'),'app':_0x8f6d('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']},{'type':'outbound','app':_0x8f6d('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x15d9bd[_0x8f6d('0x1d')]||_0x8f6d('0x1f'),'context':_0x15d9bd[_0x8f6d('0xc')],'exten':_0x15d9bd[_0x8f6d('0x7')],'priority':_0x24d68b++,'VoiceExtensionId':_0x15d9bd['id']});}return _0xc457b8;}function _0x15dae9(_0x3149bb,_0xe92604){var _0x20305e=[{'name':'trunk','param':0x0},{'name':_0x8f6d('0x20'),'param':0x1},{'name':_0x8f6d('0x21'),'param':0x2},{'name':_0x8f6d('0x22'),'param':0x3}];var _0x486029={};var _0xb225e5=_0xe92604['split'](',');var _0x42f8ad=[];for(var _0x38f00c=0x0;_0x38f00c<_0x20305e[_0x8f6d('0x23')];_0x38f00c++){switch(_0x20305e[_0x38f00c]['name']){case'trunk':_0x486029['trunk']=_0xb225e5[_0x20305e[_0x38f00c]['param']][_0x8f6d('0x24')]('/')[0x1];_0x486029[_0x8f6d('0x25')]=_0xb225e5[_0x20305e[_0x38f00c]['param']][_0x8f6d('0x24')]('/')[0x2];_0x486029[_0x8f6d('0x26')]=_0x486029[_0x8f6d('0x25')]?_0x486029[_0x8f6d('0x25')][_0x8f6d('0x24')]('$')[0x0]:undefined;_0x486029[_0x8f6d('0x25')]=_0x3149bb[_0x8f6d('0x13')]?(_0x486029[_0x8f6d('0x26')]||'')+_0x8f6d('0x14')+_0x3149bb['cutdigits']+'}':(_0x486029[_0x8f6d('0x26')]||'')+_0x8f6d('0x15');_0x42f8ad[_0x20305e[_0x38f00c]['param']]=[_0x8f6d('0x27'),_0x486029[_0x8f6d('0x28')],_0x486029[_0x8f6d('0x25')]][_0x8f6d('0x29')]('/');break;case'options':_0x486029[_0x8f6d('0x21')]=_0xb225e5[_0x20305e[_0x38f00c][_0x8f6d('0x2a')]];if(_0x3149bb[_0x8f6d('0x1d')]!=='none'){if(_0x486029[_0x8f6d('0x21')][_0x8f6d('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x486029['options']+=_0x8f6d('0x2c');}}else{_0x486029['options']=_0x486029[_0x8f6d('0x21')][_0x8f6d('0x2d')]('U(xcally-mixmonitor-context)','');}_0x42f8ad[_0x20305e[_0x38f00c][_0x8f6d('0x2a')]]=_0x486029[_0x8f6d('0x21')];break;default:_0x42f8ad[_0x20305e[_0x38f00c][_0x8f6d('0x2a')]]=_0xb225e5[_0x20305e[_0x38f00c]['param']];}}return _0x42f8ad[_0x8f6d('0x29')](',');}function _0x289aa2(_0x402656,_0x21f295,_0xedc45){return new Promise(function(_0x4d2372,_0x18541f){var _0x55d74f=[];if(_['isEmpty'](_0x21f295))return _0x4d2372(_0x55d74f);_0x569061[_0x8f6d('0x2e')][_0x8f6d('0x2f')]({'attributes':['id',_0x8f6d('0x30'),_0x8f6d('0x31')],'raw':!![]})['then'](function(_0x57f6ed){for(var _0x160ada=0x0,_0x1c47ed=0x0;_0x160ada<_0x21f295[_0x8f6d('0x23')];_0x160ada++,_0x1c47ed=0x0){var _0x5b4c3e=_0x21f295[_0x160ada];var _0x5aa5e6=[];var _0x3e9fd5=[];delete _0x5b4c3e['id'];if(_0x5b4c3e[_0x8f6d('0x30')]!=='*,*,*,*'){_0x5b4c3e[_0x8f6d('0x32')]=[_0x5b4c3e[_0x8f6d('0x30')]];}else{_0x5b4c3e[_0x8f6d('0x32')]=_0x5b4c3e[_0x8f6d('0x31')]?_[_0x8f6d('0x33')](_[_0x8f6d('0x34')](_0x57f6ed,{'IntervalId':_0x5b4c3e['IntervalId']}),_0x8f6d('0x30')):[];}_0x5b4c3e[_0x8f6d('0xc')]=_0x402656[_0x8f6d('0xc')];_0x5b4c3e[_0x8f6d('0x7')]=_0x402656[_0x8f6d('0x7')];if(_0x5b4c3e[_0x8f6d('0x4')])_0x5b4c3e[_0x8f6d('0x4')]=_0x5b4c3e['type'][_0x8f6d('0x35')]();if(_0x402656[_0x8f6d('0x4')]===_0x8f6d('0x11')){if(_0x5b4c3e[_0x8f6d('0x36')](_0x8f6d('0x37'))&&_0x5b4c3e['tag']&&_0x5b4c3e[_0x8f6d('0x37')]!=='--'){_0x5aa5e6['push']({'type':_0x5b4c3e[_0x8f6d('0x4')]['toLowerCase'](),'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x38')+_0x5b4c3e[_0x8f6d('0x37')],'context':_0x402656[_0x8f6d('0xc')],'exten':_0x402656[_0x8f6d('0x7')],'priority':_0x5b4c3e[_0x8f6d('0x32')][_0x8f6d('0x23')]+_0xedc45+_0x1c47ed++,'VoiceExtensionId':_0x402656['id']});}_0x5aa5e6['push']({'type':_0x5b4c3e['type'][_0x8f6d('0x35')](),'app':_0x8f6d('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x5b4c3e[_0x8f6d('0x39')]?'Set(CALLERID(all)='+_0x5b4c3e[_0x8f6d('0x39')]+')':_0x8f6d('0x3a')),'context':_0x402656['context'],'exten':_0x402656[_0x8f6d('0x7')],'priority':_0x5b4c3e[_0x8f6d('0x32')][_0x8f6d('0x23')]+_0xedc45+_0x1c47ed++,'VoiceExtensionId':_0x402656['id']});}else{if(_0x5b4c3e['hasOwnProperty'](_0x8f6d('0x3b'))){if([_0x8f6d('0x3c'),_0x8f6d('0x3d')][_0x8f6d('0x3e')](_0x5b4c3e[_0x8f6d('0x3f')][_0x8f6d('0x35')]())&&_0x5b4c3e[_0x8f6d('0x40')]!=='custom'){if(_0x5b4c3e['answer']){_0x5aa5e6[_0x8f6d('0xe')]({'type':_0x5b4c3e['type'][_0x8f6d('0x35')](),'app':'ExecIf','appdata':_0x8f6d('0x41'),'context':_0x402656['context'],'exten':_0x402656['exten'],'priority':_0x5b4c3e[_0x8f6d('0x32')][_0x8f6d('0x23')]+_0xedc45+_0x1c47ed++,'VoiceExtensionId':_0x402656['id']});_0x5aa5e6['push']({'type':_0x5b4c3e['type'][_0x8f6d('0x35')](),'app':_0x8f6d('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x402656['context'],'exten':_0x402656['exten'],'priority':_0x5b4c3e[_0x8f6d('0x32')][_0x8f6d('0x23')]+_0xedc45+_0x1c47ed++,'VoiceExtensionId':_0x402656['id']});}else{_0x5aa5e6[_0x8f6d('0xe')]({'type':_0x5b4c3e[_0x8f6d('0x4')][_0x8f6d('0x35')](),'app':_0x8f6d('0x16'),'appdata':_0x8f6d('0x42'),'context':_0x402656['context'],'exten':_0x402656[_0x8f6d('0x7')],'priority':_0x5b4c3e[_0x8f6d('0x32')][_0x8f6d('0x23')]+_0xedc45+_0x1c47ed++,'VoiceExtensionId':_0x402656['id']});_0x5aa5e6[_0x8f6d('0xe')]({'type':_0x5b4c3e['type'][_0x8f6d('0x35')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x402656[_0x8f6d('0xc')],'exten':_0x402656['exten'],'priority':_0x5b4c3e['intervals'][_0x8f6d('0x23')]+_0xedc45+_0x1c47ed++,'VoiceExtensionId':_0x402656['id']});}}}}for(var _0x5dc219=0x0;_0x5dc219<_0x5b4c3e['intervals']['length'];_0x5dc219++){var _0x97ebf9=_0xedc45+_0x5b4c3e['intervals']['length'];var _0x122fd0=_0x5dc219===_0x5b4c3e[_0x8f6d('0x32')][_0x8f6d('0x23')]-0x1?_0xedc45+_0x5aa5e6['length']+_0x3e9fd5[_0x8f6d('0x23')]+0x2:_0xedc45+_0x5dc219+0x1;_0x5aa5e6[_0x8f6d('0x43')](_0x5dc219,0x0,{'type':_0x402656[_0x8f6d('0x4')],'app':'GotoIfTime','appdata':_0x5b4c3e[_0x8f6d('0x32')][_0x5dc219]+'?'+_0x402656[_0x8f6d('0xc')]+_0x8f6d('0x44')+_0x97ebf9+':'+_0x402656['context']+_0x8f6d('0x44')+_0x122fd0,'exten':_0x402656[_0x8f6d('0x7')],'context':_0x402656[_0x8f6d('0xc')],'priority':_0xedc45+_0x5dc219,'VoiceExtensionId':_0x402656['id']});}if(_0x5b4c3e[_0x8f6d('0x40')]==='outboundDial'){_0x5b4c3e[_0x8f6d('0x45')]=_0x15dae9(_0x402656,_0x5b4c3e[_0x8f6d('0x45')]);}if(_0x5b4c3e[_0x8f6d('0x40')]===_0x8f6d('0x46')){_0x5aa5e6[_0x8f6d('0xe')]({'type':_0x5b4c3e[_0x8f6d('0x4')][_0x8f6d('0x35')](),'app':_0x8f6d('0x5'),'appdata':_0x8f6d('0x47'),'context':_0x402656['context'],'exten':_0x402656['exten'],'priority':_0x5b4c3e[_0x8f6d('0x32')][_0x8f6d('0x23')]+_0xedc45+_0x1c47ed++,'VoiceExtensionId':_0x402656['id']});}_0x5b4c3e['priority']=_0x5aa5e6['length']?_[_0x8f6d('0x48')](_0x5aa5e6)['priority']+0x1:_0xedc45;_0x55d74f=_[_0x8f6d('0x49')](_0x55d74f,_0x5aa5e6,[_0x5b4c3e],_0x3e9fd5);_0xedc45=_['last'](_0x55d74f)[_0x8f6d('0x4a')]+0x1;}return _0x4d2372(_0x55d74f);})[_0x8f6d('0x4b')](function(_0x39401e){_0x18541f(_0x39401e);});});}return _0x2f16a9[_0x8f6d('0x4c')](_0x8f6d('0x4d'),attributes,{'tableName':_0x8f6d('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5279cb){var _0x3c9455=this['get']({'plain':!![]});var _0x336710=_0x3c9455['type']==='outbound'?_0x37b7a7(_0x3c9455):_0x145474(_0x3c9455);return _0x289aa2(_0x3c9455,_0x5279cb,_[_0x8f6d('0x48')](_0x336710)[_0x8f6d('0x4a')]+0x1)[_0x8f6d('0x4f')](function(_0x4845cd){var _0x4843a8=_[_0x8f6d('0x49')](_0x336710,_0x4845cd);_0x4843a8[_0x8f6d('0xe')]({'type':_0x3c9455[_0x8f6d('0x4')],'app':'Hangup','exten':_0x3c9455['exten'],'context':_0x3c9455[_0x8f6d('0xc')],'priority':_[_0x8f6d('0x48')](_0x4843a8)[_0x8f6d('0x4a')]+0x1,'VoiceExtensionId':_0x3c9455['id']});return _0x4843a8;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index cf45714..8e0a427 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 _0x714c=['redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','debug','request\x20sent','stringify','error','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','model','map','then','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x49008c,_0x51ea8a){var _0x1ab017=function(_0x2589ec){while(--_0x2589ec){_0x49008c['push'](_0x49008c['shift']());}};_0x1ab017(++_0x51ea8a);}(_0x714c,0x18d));var _0xc714=function(_0x4a3acd,_0x4bf641){_0x4a3acd=_0x4a3acd-0x0;var _0x3efdaa=_0x714c[_0x4a3acd];return _0x3efdaa;};'use strict';var _=require('lodash');var util=require(_0xc714('0x0'));var moment=require(_0xc714('0x1'));var BPromise=require(_0xc714('0x2'));var rs=require(_0xc714('0x3'));var fs=require('fs');var Redis=require(_0xc714('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc714('0x5'));var logger=require(_0xc714('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc714('0x7'));var client=jayson[_0xc714('0x8')][_0xc714('0x9')]({'port':0x232a});config[_0xc714('0xa')]=_['defaults'](config['redis'],{'host':_0xc714('0xb'),'port':0x18eb});var socket=require(_0xc714('0xc'))(new Redis(config[_0xc714('0xa')]));require(_0xc714('0xd'))[_0xc714('0xe')](socket);function respondWithRpcPromise(_0x5b6aa5,_0x226622,_0x34a03f){return new BPromise(function(_0x3438b4,_0x263f56){return client[_0xc714('0xf')](_0x5b6aa5,_0x34a03f)['then'](function(_0xaa2acc){logger[_0xc714('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x226622,'request\x20sent');logger[_0xc714('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x226622,_0xc714('0x12'),JSON[_0xc714('0x13')](_0xaa2acc));if(_0xaa2acc[_0xc714('0x14')]){if(_0xaa2acc[_0xc714('0x14')]['code']===0x1f4){logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);return _0x263f56(_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);}logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0xaa2acc['error']['message']);return _0x3438b4(_0xaa2acc[_0xc714('0x14')][_0xc714('0x16')]);}else{logger[_0xc714('0x10')](_0xc714('0x15'),_0x226622,_0xc714('0x12'));_0x3438b4(_0xaa2acc[_0xc714('0x17')][_0xc714('0x16')]);}})[_0xc714('0x18')](function(_0x50a84a){logger[_0xc714('0x14')](_0xc714('0x15'),_0x226622,_0x50a84a);_0x263f56(_0x50a84a);});});}exports[_0xc714('0x19')]=function(_0x29c3ab){var _0x5bc067=this;return new Promise(function(_0x751c4d,_0xc9787a){return db[_0xc714('0x1a')][_0xc714('0x1b')]({'raw':_0x29c3ab[_0xc714('0x1c')]?_0x29c3ab['options'][_0xc714('0x1d')]===undefined?!![]:![]:!![],'where':_0x29c3ab['options']?_0x29c3ab[_0xc714('0x1c')][_0xc714('0x1e')]||null:null,'attributes':_0x29c3ab[_0xc714('0x1c')]?_0x29c3ab[_0xc714('0x1c')][_0xc714('0x1f')]||null:null,'limit':_0x29c3ab['options']?_0x29c3ab['options'][_0xc714('0x20')]||null:null,'include':_0x29c3ab['options']?_0x29c3ab[_0xc714('0x1c')][_0xc714('0x21')]?_['map'](_0x29c3ab['options'][_0xc714('0x21')],function(_0x306dd0){return{'model':db[_0x306dd0[_0xc714('0x22')]],'as':_0x306dd0['as'],'attributes':_0x306dd0[_0xc714('0x1f')],'include':_0x306dd0[_0xc714('0x21')]?_['map'](_0x306dd0[_0xc714('0x21')],function(_0x431a00){return{'model':db[_0x431a00['model']],'as':_0x431a00['as'],'attributes':_0x431a00[_0xc714('0x1f')],'include':_0x431a00[_0xc714('0x21')]?_[_0xc714('0x23')](_0x431a00['include'],function(_0x4e6b70){return{'model':db[_0x4e6b70[_0xc714('0x22')]],'as':_0x4e6b70['as'],'attributes':_0x4e6b70['attributes']};}):[]};}):[]};}):[]:[]})[_0xc714('0x24')](function(_0x1d51b5){logger['info'](_0xc714('0x19'),_0x29c3ab);logger[_0xc714('0x11')]('GetVoiceExtension',_0x29c3ab,JSON[_0xc714('0x13')](_0x1d51b5));_0x751c4d(_0x1d51b5);})[_0xc714('0x18')](function(_0x4a947c){logger[_0xc714('0x14')](_0xc714('0x19'),_0x4a947c[_0xc714('0x16')],_0x29c3ab);_0xc9787a(_0x5bc067[_0xc714('0x14')](0x1f4,_0x4a947c[_0xc714('0x16')]));});});}; \ No newline at end of file +var _0xa786=['catch','VoiceExtension','options','raw','attributes','include','map','model','debug','GetVoiceExtension','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xeef5ad,_0xf6e1c7){var _0xdd8699=function(_0x5ca2fe){while(--_0x5ca2fe){_0xeef5ad['push'](_0xeef5ad['shift']());}};_0xdd8699(++_0xf6e1c7);}(_0xa786,0x1d2));var _0x6a78=function(_0x178f92,_0x4a35d5){_0x178f92=_0x178f92-0x0;var _0x2b0a2d=_0xa786[_0x178f92];return _0x2b0a2d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a78('0x0'));var BPromise=require(_0x6a78('0x1'));var rs=require(_0x6a78('0x2'));var fs=require('fs');var Redis=require(_0x6a78('0x3'));var db=require(_0x6a78('0x4'))['db'];var utils=require(_0x6a78('0x5'));var logger=require(_0x6a78('0x6'))('rpc');var config=require(_0x6a78('0x7'));var jayson=require(_0x6a78('0x8'));var client=jayson[_0x6a78('0x9')][_0x6a78('0xa')]({'port':0x232a});config[_0x6a78('0xb')]=_[_0x6a78('0xc')](config[_0x6a78('0xb')],{'host':_0x6a78('0xd'),'port':0x18eb});var socket=require(_0x6a78('0xe'))(new Redis(config[_0x6a78('0xb')]));require(_0x6a78('0xf'))[_0x6a78('0x10')](socket);function respondWithRpcPromise(_0x306116,_0x2fb93e,_0x2ff853){return new BPromise(function(_0x2641ed,_0x3c414c){return client[_0x6a78('0x11')](_0x306116,_0x2ff853)[_0x6a78('0x12')](function(_0x595e3e){logger['info'](_0x6a78('0x13'),_0x2fb93e,_0x6a78('0x14'));logger['debug'](_0x6a78('0x15'),_0x2fb93e,_0x6a78('0x14'),JSON[_0x6a78('0x16')](_0x595e3e));if(_0x595e3e[_0x6a78('0x17')]){if(_0x595e3e[_0x6a78('0x17')][_0x6a78('0x18')]===0x1f4){logger[_0x6a78('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x2fb93e,_0x595e3e['error']['message']);return _0x3c414c(_0x595e3e[_0x6a78('0x17')][_0x6a78('0x19')]);}logger[_0x6a78('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x2fb93e,_0x595e3e[_0x6a78('0x17')][_0x6a78('0x19')]);return _0x2641ed(_0x595e3e['error'][_0x6a78('0x19')]);}else{logger[_0x6a78('0x1a')](_0x6a78('0x13'),_0x2fb93e,_0x6a78('0x14'));_0x2641ed(_0x595e3e[_0x6a78('0x1b')][_0x6a78('0x19')]);}})[_0x6a78('0x1c')](function(_0x3c3e5d){logger['error'](_0x6a78('0x13'),_0x2fb93e,_0x3c3e5d);_0x3c414c(_0x3c3e5d);});});}exports['GetVoiceExtension']=function(_0x216365){var _0xee82ac=this;return new Promise(function(_0x2ae9c5,_0x5d135e){return db[_0x6a78('0x1d')]['findAll']({'raw':_0x216365[_0x6a78('0x1e')]?_0x216365['options'][_0x6a78('0x1f')]===undefined?!![]:![]:!![],'where':_0x216365['options']?_0x216365[_0x6a78('0x1e')]['where']||null:null,'attributes':_0x216365['options']?_0x216365['options'][_0x6a78('0x20')]||null:null,'limit':_0x216365[_0x6a78('0x1e')]?_0x216365[_0x6a78('0x1e')]['limit']||null:null,'include':_0x216365[_0x6a78('0x1e')]?_0x216365[_0x6a78('0x1e')][_0x6a78('0x21')]?_[_0x6a78('0x22')](_0x216365['options'][_0x6a78('0x21')],function(_0x5ba74f){return{'model':db[_0x5ba74f[_0x6a78('0x23')]],'as':_0x5ba74f['as'],'attributes':_0x5ba74f[_0x6a78('0x20')],'include':_0x5ba74f[_0x6a78('0x21')]?_[_0x6a78('0x22')](_0x5ba74f['include'],function(_0x3eb79f){return{'model':db[_0x3eb79f[_0x6a78('0x23')]],'as':_0x3eb79f['as'],'attributes':_0x3eb79f['attributes'],'include':_0x3eb79f[_0x6a78('0x21')]?_['map'](_0x3eb79f[_0x6a78('0x21')],function(_0x48c692){return{'model':db[_0x48c692[_0x6a78('0x23')]],'as':_0x48c692['as'],'attributes':_0x48c692[_0x6a78('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31ca28){logger[_0x6a78('0x1a')]('GetVoiceExtension',_0x216365);logger[_0x6a78('0x24')](_0x6a78('0x25'),_0x216365,JSON['stringify'](_0x31ca28));_0x2ae9c5(_0x31ca28);})[_0x6a78('0x1c')](function(_0x86d08f){logger[_0x6a78('0x17')](_0x6a78('0x25'),_0x86d08f[_0x6a78('0x19')],_0x216365);_0x5d135e(_0xee82ac[_0x6a78('0x17')](0x1f4,_0x86d08f[_0x6a78('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 6f284e3..f2a7910 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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x59cf90,_0x2a8e36){var _0x2c33f5=function(_0x204b74){while(--_0x204b74){_0x59cf90['push'](_0x59cf90['shift']());}};_0x2c33f5(++_0x2a8e36);}(_0x4975,0x86));var _0x5497=function(_0x35140b,_0x33295c){_0x35140b=_0x35140b-0x0;var _0x12338a=_0x4975[_0x35140b];return _0x12338a;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x2f72fa,_0x5a8ffc){var _0x59dc51=function(_0x52e038){while(--_0x52e038){_0x2f72fa['push'](_0x2f72fa['shift']());}};_0x59dc51(++_0x5a8ffc);}(_0xabce,0x103));var _0xeabc=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xabce[_0x42245d];return _0x4b211a;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 1fa0e6c..0d5369f 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 _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','post','create','update'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0xadb5,0xad));var _0x5adb=function(_0x44a32b,_0x4657aa){_0x44a32b=_0x44a32b-0x0;var _0x24ab81=_0xadb5[_0x44a32b];return _0x24ab81;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./voiceMail.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file +var _0x6050=['/:id/messages','isAuthenticated','getMessages','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','show','get'];(function(_0x414ee5,_0xb262f8){var _0x8e5120=function(_0x57d660){while(--_0x57d660){_0x414ee5['push'](_0x414ee5['shift']());}};_0x8e5120(++_0xb262f8);}(_0x6050,0x196));var _0x0605=function(_0x2d13de,_0x4133bd){_0x2d13de=_0x2d13de-0x0;var _0x115519=_0x6050[_0x2d13de];return _0x115519;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0605('0x6'));var interaction=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var controller=require('./voiceMail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0605('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0605('0xa')]);router[_0x0605('0xb')](_0x0605('0xc'),auth[_0x0605('0xd')](),controller[_0x0605('0xe')]);router['post']('/',auth[_0x0605('0xd')](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x12')]);router[_0x0605('0x13')](_0x0605('0x11'),auth[_0x0605('0xd')](),controller[_0x0605('0x14')]);module[_0x0605('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index d3dc681..353b74b 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 _0xea2d=['INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','contest_mailbox','STRING','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0xea2d,0x195));var _0xdea2=function(_0x273400,_0x46f576){_0x273400=_0x273400-0x0;var _0x39f3da=_0xea2d[_0x273400];return _0x39f3da;};'use strict';var Sequelize=require(_0xdea2('0x0'));module[_0xdea2('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xdea2('0x2')},'mailbox':{'type':Sequelize[_0xdea2('0x3')],'defaultValue':'','allowNull':![],'unique':_0xdea2('0x2')},'password':{'type':Sequelize[_0xdea2('0x3')]},'fullname':{'type':Sequelize[_0xdea2('0x3')]},'email':{'type':Sequelize[_0xdea2('0x3')],'validate':{'isEmail':!![]},'set':function(_0x15638a){this[_0xdea2('0x4')](_0xdea2('0x5'),typeof _0x15638a===_0xdea2('0x6')&&_0x15638a['trim']()?_0x15638a[_0xdea2('0x7')]():null);}},'pager':{'type':Sequelize[_0xdea2('0x3')]},'tz':{'type':Sequelize[_0xdea2('0x3')],'defaultValue':_0xdea2('0x8')},'attach':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xdea2('0x3')]},'review':{'type':Sequelize[_0xdea2('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xdea2('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xdea2('0x9')](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0xdea2('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xdea2('0xa'),'no'),'defaultValue':_0xdea2('0xa'),'allowNull':![]},'stamp':{'type':_0xdea2('0xc')},'emailsubject':{'type':Sequelize[_0xdea2('0x3')]},'emailbody':{'type':Sequelize[_0xdea2('0x3')]},'maxsecs':{'type':Sequelize[_0xdea2('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xdea2('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xdea2('0xe')],'get':function(){return this['getDataValue'](_0xdea2('0xf'))+_0xdea2('0x10')+this[_0xdea2('0x11')](_0xdea2('0x12'));}}}; \ No newline at end of file +var _0xb0b6=['STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','sequelize'];(function(_0x5e47b9,_0x1c57c0){var _0x49e0b2=function(_0x2d9de0){while(--_0x2d9de0){_0x5e47b9['push'](_0x5e47b9['shift']());}};_0x49e0b2(++_0x1c57c0);}(_0xb0b6,0xd7));var _0x6b0b=function(_0x349815,_0x26525a){_0x349815=_0x349815-0x0;var _0x594f2c=_0xb0b6[_0x349815];return _0x594f2c;};'use strict';var Sequelize=require(_0x6b0b('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x6b0b('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x6b0b('0x2'),'unique':_0x6b0b('0x3')},'mailbox':{'type':Sequelize[_0x6b0b('0x1')],'defaultValue':'','allowNull':![],'unique':_0x6b0b('0x3')},'password':{'type':Sequelize[_0x6b0b('0x1')]},'fullname':{'type':Sequelize[_0x6b0b('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x56fba4){this[_0x6b0b('0x4')](_0x6b0b('0x5'),typeof _0x56fba4===_0x6b0b('0x6')&&_0x56fba4[_0x6b0b('0x7')]()?_0x56fba4[_0x6b0b('0x7')]():null);}},'pager':{'type':Sequelize[_0x6b0b('0x1')]},'tz':{'type':Sequelize[_0x6b0b('0x1')],'defaultValue':_0x6b0b('0x8')},'attach':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':_0x6b0b('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x6b0b('0xa'),'no'),'defaultValue':_0x6b0b('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x6b0b('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x6b0b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':_0x6b0b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6b0b('0x9')](_0x6b0b('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x6b0b('0xc')},'emailsubject':{'type':Sequelize[_0x6b0b('0x1')]},'emailbody':{'type':Sequelize[_0x6b0b('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6b0b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6b0b('0xe')],'get':function(){return this[_0x6b0b('0xf')]('fullname')+_0x6b0b('0x10')+this[_0x6b0b('0xf')](_0x6b0b('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3b17bf1..339438f 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 _0x7d25=['then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','findOne','VoiceMailMessage','nolimit','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','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','undefined','count','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x213964,_0x4fb8a3){var _0x5bf88e=function(_0x3916cc){while(--_0x3916cc){_0x213964['push'](_0x213964['shift']());}};_0x5bf88e(++_0x4fb8a3);}(_0x7d25,0x8a));var _0x57d2=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x7d25[_0x25d386];return _0x857f4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];function respondWithStatusCode(_0x43d7fb,_0x32c33a){_0x32c33a=_0x32c33a||0xcc;return function(_0x28428b){if(_0x28428b){return _0x43d7fb[_0x57d2('0x17')](_0x32c33a);}return _0x43d7fb[_0x57d2('0x18')](_0x32c33a)[_0x57d2('0x19')]();};}function respondWithResult(_0x1ba57e,_0x4086f3){_0x4086f3=_0x4086f3||0xc8;return function(_0x5382d9){if(_0x5382d9){return _0x1ba57e['status'](_0x4086f3)[_0x57d2('0x1a')](_0x5382d9);}};}function respondWithFilteredResult(_0x148ef3,_0x4ec4b1){return function(_0x8cf637){if(_0x8cf637){var _0x319489=typeof _0x4ec4b1['offset']===_0x57d2('0x1b')&&typeof _0x4ec4b1['limit']===_0x57d2('0x1b');var _0x4b4fe0=_0x8cf637[_0x57d2('0x1c')];var _0x7d4cf1=_0x319489?0x0:_0x4ec4b1[_0x57d2('0x1d')];var _0x4a94e3=_0x319489?_0x8cf637['count']:_0x4ec4b1[_0x57d2('0x1d')]+_0x4ec4b1[_0x57d2('0x1e')];var _0x2662cd;if(_0x4a94e3>=_0x4b4fe0){_0x4a94e3=_0x4b4fe0;_0x2662cd=0xc8;}else{_0x2662cd=0xce;}_0x148ef3[_0x57d2('0x18')](_0x2662cd);return _0x148ef3['set'](_0x57d2('0x1f'),_0x7d4cf1+'-'+_0x4a94e3+'/'+_0x4b4fe0)[_0x57d2('0x1a')](_0x8cf637);}return null;};}function patchUpdates(_0x55191e){return function(_0x5f3fd5){try{jsonpatch[_0x57d2('0x20')](_0x5f3fd5,_0x55191e,!![]);}catch(_0x326d49){return BPromise[_0x57d2('0x21')](_0x326d49);}return _0x5f3fd5[_0x57d2('0x22')]();};}function saveUpdates(_0x386196,_0x803c25){return function(_0x32c7c8){if(_0x32c7c8){return _0x32c7c8[_0x57d2('0x23')](_0x386196)[_0x57d2('0x24')](function(_0x26718e){return _0x26718e;});}return null;};}function removeEntity(_0x46a4d1,_0x456fe1){return function(_0x12ff19){if(_0x12ff19){return _0x12ff19[_0x57d2('0x25')]()['then'](function(){var _0x424ddc=_0x12ff19[_0x57d2('0x26')]({'plain':!![]});var _0x3c7de8=_0x57d2('0x27');return db[_0x57d2('0x28')]['destroy']({'where':{'type':_0x3c7de8,'resourceId':_0x424ddc['id']}})[_0x57d2('0x24')](function(){return _0x12ff19;});})[_0x57d2('0x24')](function(){_0x46a4d1[_0x57d2('0x18')](0xcc)[_0x57d2('0x19')]();});}};}function handleEntityNotFound(_0x18d500,_0x4b3d8e){return function(_0x9bdb11){if(!_0x9bdb11){_0x18d500['sendStatus'](0x194);}return _0x9bdb11;};}function handleError(_0x1ae5ff,_0x15f1ba){_0x15f1ba=_0x15f1ba||0x1f4;return function(_0x277426){logger[_0x57d2('0x29')](_0x277426[_0x57d2('0x2a')]);if(_0x277426[_0x57d2('0x2b')]){delete _0x277426[_0x57d2('0x2b')];}_0x1ae5ff[_0x57d2('0x18')](_0x15f1ba)[_0x57d2('0x2c')](_0x277426);};}exports[_0x57d2('0x2d')]=function(_0x574589,_0x4e9178){var _0x3da926={},_0x26e052={},_0x3e017c={'count':0x0,'rows':[]};var _0x484597=_[_0x57d2('0x2e')](db[_0x57d2('0x2f')][_0x57d2('0x30')],function(_0x290c2d){return{'name':_0x290c2d[_0x57d2('0x31')],'type':_0x290c2d[_0x57d2('0x32')][_0x57d2('0x33')]};});_0x26e052[_0x57d2('0x34')]=_[_0x57d2('0x2e')](_0x484597,'name');_0x26e052[_0x57d2('0x35')]=_[_0x57d2('0x36')](_0x574589['query']);_0x26e052[_0x57d2('0x37')]=_[_0x57d2('0x38')](_0x26e052['model'],_0x26e052[_0x57d2('0x35')]);_0x3da926[_0x57d2('0x39')]=_[_0x57d2('0x38')](_0x26e052[_0x57d2('0x34')],qs[_0x57d2('0x3a')](_0x574589['query']['fields']));_0x3da926['attributes']=_0x3da926['attributes'][_0x57d2('0x3b')]?_0x3da926[_0x57d2('0x39')]:_0x26e052[_0x57d2('0x34')];if(!_0x574589[_0x57d2('0x35')][_0x57d2('0x3c')]('nolimit')){_0x3da926[_0x57d2('0x1e')]=qs['limit'](_0x574589[_0x57d2('0x35')][_0x57d2('0x1e')]);_0x3da926[_0x57d2('0x1d')]=qs['offset'](_0x574589[_0x57d2('0x35')][_0x57d2('0x1d')]);}_0x3da926['order']=qs[_0x57d2('0x3d')](_0x574589[_0x57d2('0x35')][_0x57d2('0x3d')]);_0x3da926[_0x57d2('0x3e')]=qs[_0x57d2('0x37')](_[_0x57d2('0x3f')](_0x574589['query'],_0x26e052[_0x57d2('0x37')]),_0x484597);if(_0x574589['query'][_0x57d2('0x40')]){_0x3da926[_0x57d2('0x3e')]=_[_0x57d2('0x41')](_0x3da926[_0x57d2('0x3e')],{'$or':_[_0x57d2('0x2e')](_0x484597,function(_0x512dbf){if(_0x512dbf[_0x57d2('0x32')]!==_0x57d2('0x42')){var _0x4f6955={};_0x4f6955[_0x512dbf[_0x57d2('0x2b')]]={'$like':'%'+_0x574589[_0x57d2('0x35')][_0x57d2('0x40')]+'%'};return _0x4f6955;}})});}_0x3da926=_['merge']({},_0x3da926,_0x574589[_0x57d2('0x43')]);var _0x2fe0cd={'where':_0x3da926[_0x57d2('0x3e')]};return db[_0x57d2('0x2f')]['count'](_0x2fe0cd)['then'](function(_0x11a2ec){_0x3e017c[_0x57d2('0x1c')]=_0x11a2ec;if(_0x574589[_0x57d2('0x35')]['includeAll']){_0x3da926['include']=[{'all':!![]}];}return db[_0x57d2('0x2f')]['findAll'](_0x3da926);})[_0x57d2('0x24')](function(_0x1bb8ad){_0x3e017c[_0x57d2('0x44')]=_0x1bb8ad;return _0x3e017c;})[_0x57d2('0x24')](respondWithFilteredResult(_0x4e9178,_0x3da926))[_0x57d2('0x45')](handleError(_0x4e9178,null));};exports['show']=function(_0x13216b,_0x1c069a){var _0x53ab43={'raw':!![],'where':{'id':_0x13216b['params']['id']}},_0x775f8c={};_0x775f8c[_0x57d2('0x34')]=_[_0x57d2('0x36')](db[_0x57d2('0x2f')][_0x57d2('0x30')]);_0x775f8c['query']=_['keys'](_0x13216b[_0x57d2('0x35')]);_0x775f8c['filters']=_['intersection'](_0x775f8c[_0x57d2('0x34')],_0x775f8c['query']);_0x53ab43['attributes']=_[_0x57d2('0x38')](_0x775f8c['model'],qs[_0x57d2('0x3a')](_0x13216b['query'][_0x57d2('0x3a')]));_0x53ab43['attributes']=_0x53ab43['attributes'][_0x57d2('0x3b')]?_0x53ab43[_0x57d2('0x39')]:_0x775f8c[_0x57d2('0x34')];if(_0x13216b[_0x57d2('0x35')][_0x57d2('0x46')]){_0x53ab43[_0x57d2('0x47')]=[{'all':!![]}];}_0x53ab43=_['merge']({},_0x53ab43,_0x13216b[_0x57d2('0x43')]);return db[_0x57d2('0x2f')][_0x57d2('0x48')](_0x53ab43)[_0x57d2('0x24')](handleEntityNotFound(_0x1c069a,null))[_0x57d2('0x24')](respondWithResult(_0x1c069a,null))[_0x57d2('0x45')](handleError(_0x1c069a,null));};exports[_0x57d2('0x49')]=function(_0x406375,_0x51f172){return db[_0x57d2('0x2f')][_0x57d2('0x49')](_0x406375['body'],{})[_0x57d2('0x24')](function(_0x5b06f7){var _0x59a6eb=_0x406375[_0x57d2('0x4a')][_0x57d2('0x26')]({'plain':!![]});if(!_0x59a6eb)throw new Error(_0x57d2('0x4b'));if(_0x59a6eb[_0x57d2('0x4c')]==='user'){var _0x265d24=_0x5b06f7[_0x57d2('0x26')]({'plain':!![]});var _0x51b535='Voicemails';return db[_0x57d2('0x4d')][_0x57d2('0x48')]({'where':{'name':_0x51b535,'userProfileId':_0x59a6eb[_0x57d2('0x4e')]},'raw':!![]})[_0x57d2('0x24')](function(_0x3092c8){if(_0x3092c8&&_0x3092c8[_0x57d2('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x265d24['name'],'resourceId':_0x265d24['id'],'type':_0x3092c8[_0x57d2('0x2b')],'sectionId':_0x3092c8['id']},{})['then'](function(){return _0x5b06f7;});}else{return _0x5b06f7;}})[_0x57d2('0x45')](function(_0x2ef710){logger['error'](_0x57d2('0x50'),_0x2ef710);throw _0x2ef710;});}return _0x5b06f7;})[_0x57d2('0x24')](respondWithResult(_0x51f172,0xc9))[_0x57d2('0x45')](handleError(_0x51f172,null));};exports['update']=function(_0x10d4e5,_0x224b7d){if(_0x10d4e5[_0x57d2('0x51')]['id']){delete _0x10d4e5[_0x57d2('0x51')]['id'];}return db[_0x57d2('0x2f')][_0x57d2('0x48')]({'where':{'id':_0x10d4e5[_0x57d2('0x52')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x224b7d,null))[_0x57d2('0x24')](saveUpdates(_0x10d4e5['body'],null))[_0x57d2('0x24')](respondWithResult(_0x224b7d,null))[_0x57d2('0x45')](handleError(_0x224b7d,null));};exports[_0x57d2('0x25')]=function(_0x5e3289,_0x7b334f){return db[_0x57d2('0x2f')][_0x57d2('0x48')]({'where':{'id':_0x5e3289['params']['id']}})['then'](handleEntityNotFound(_0x7b334f,null))['then'](removeEntity(_0x7b334f,null))[_0x57d2('0x45')](handleError(_0x7b334f,null));};exports['getMessages']=function(_0x682542,_0x4cdae5,_0x3111a2){return db['VoiceMail'][_0x57d2('0x53')]({'where':{'id':_0x682542[_0x57d2('0x52')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x4cdae5,null))['then'](function(_0x5985e4){var _0xd5b87e;var _0x2c1710={},_0x3b57fa={};_0x3b57fa[_0x57d2('0x34')]=_[_0x57d2('0x36')](db[_0x57d2('0x54')]['rawAttributes']);_0x3b57fa['query']=_[_0x57d2('0x36')](_0x682542[_0x57d2('0x35')]);_0x3b57fa[_0x57d2('0x37')]=_[_0x57d2('0x38')](_0x3b57fa['model'],_0x3b57fa['query']);_0x2c1710[_0x57d2('0x39')]=_[_0x57d2('0x38')](_0x3b57fa['model'],qs[_0x57d2('0x3a')](_0x682542[_0x57d2('0x35')][_0x57d2('0x3a')]));_0x2c1710[_0x57d2('0x39')]=_0x2c1710['attributes']['length']?_0x2c1710['attributes']:_0x3b57fa['model'];if(!_0x682542[_0x57d2('0x35')][_0x57d2('0x3c')](_0x57d2('0x55'))){_0x2c1710[_0x57d2('0x1e')]=qs[_0x57d2('0x1e')](_0x682542[_0x57d2('0x35')][_0x57d2('0x1e')]);_0x2c1710['offset']=qs[_0x57d2('0x1d')](_0x682542['query'][_0x57d2('0x1d')]);}_0x2c1710['order']=qs[_0x57d2('0x3d')](_0x682542[_0x57d2('0x35')][_0x57d2('0x3d')]);_0x2c1710[_0x57d2('0x3e')]=qs[_0x57d2('0x37')](_[_0x57d2('0x3f')](_0x682542['query'],_0x3b57fa[_0x57d2('0x37')]));if(_0x682542[_0x57d2('0x35')][_0x57d2('0x40')]){_0x2c1710[_0x57d2('0x3e')]=_[_0x57d2('0x41')](_0x2c1710[_0x57d2('0x3e')],{'$or':_[_0x57d2('0x2e')](_0x2c1710[_0x57d2('0x39')],function(_0x10141e){var _0x59c4e4={};_0x59c4e4[_0x10141e]={'$like':'%'+_0x682542[_0x57d2('0x35')]['filter']+'%'};return _0x59c4e4;})});}_0x2c1710['where']=_['merge'](_0x2c1710[_0x57d2('0x3e')],{'mailboxuser':_0x5985e4['mailbox']});_0x2c1710=_[_0x57d2('0x41')]({},_0x2c1710,_0x682542[_0x57d2('0x43')]);return db['VoiceMailMessage'][_0x57d2('0x56')](_0x2c1710)[_0x57d2('0x24')](respondWithFilteredResult(_0x4cdae5,_0x2c1710));})[_0x57d2('0x45')](handleError(_0x4cdae5,null));}; \ No newline at end of file +var _0x087b=['catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','destroy','getMessages','findOne','hasOwnProperty','order','mailbox','VoiceMailMessage','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','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','end','json','offset','limit','undefined','count','set','apply','reject','save','then','error','stack','name','send','index','VoiceMail','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','options','includeAll','include','findAll','show','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x087b,0x11a));var _0xb087=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x087b[_0x1a7846];return _0x48049;};'use strict';var emlformat=require(_0xb087('0x0'));var rimraf=require(_0xb087('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb087('0x2'));var moment=require('moment');var BPromise=require(_0xb087('0x3'));var Mustache=require(_0xb087('0x4'));var util=require(_0xb087('0x5'));var path=require(_0xb087('0x6'));var sox=require(_0xb087('0x7'));var csv=require(_0xb087('0x8'));var ejs=require(_0xb087('0x9'));var fs=require('fs');var fs_extra=require(_0xb087('0xa'));var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x8'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb087('0x1a'))['db'];function respondWithStatusCode(_0x31f977,_0x323656){_0x323656=_0x323656||0xcc;return function(_0x51ceaa){if(_0x51ceaa){return _0x31f977[_0xb087('0x1b')](_0x323656);}return _0x31f977[_0xb087('0x1c')](_0x323656)[_0xb087('0x1d')]();};}function respondWithResult(_0x46410b,_0x11784c){_0x11784c=_0x11784c||0xc8;return function(_0x12d0db){if(_0x12d0db){return _0x46410b[_0xb087('0x1c')](_0x11784c)[_0xb087('0x1e')](_0x12d0db);}};}function respondWithFilteredResult(_0x24e1a3,_0x16d0b7){return function(_0x5193a4){if(_0x5193a4){var _0x43e576=typeof _0x16d0b7[_0xb087('0x1f')]==='undefined'&&typeof _0x16d0b7[_0xb087('0x20')]===_0xb087('0x21');var _0x2e9e74=_0x5193a4['count'];var _0x330005=_0x43e576?0x0:_0x16d0b7[_0xb087('0x1f')];var _0x17200d=_0x43e576?_0x5193a4[_0xb087('0x22')]:_0x16d0b7['offset']+_0x16d0b7[_0xb087('0x20')];var _0x28428e;if(_0x17200d>=_0x2e9e74){_0x17200d=_0x2e9e74;_0x28428e=0xc8;}else{_0x28428e=0xce;}_0x24e1a3[_0xb087('0x1c')](_0x28428e);return _0x24e1a3[_0xb087('0x23')]('Content-Range',_0x330005+'-'+_0x17200d+'/'+_0x2e9e74)['json'](_0x5193a4);}return null;};}function patchUpdates(_0x5ea3dc){return function(_0x49450a){try{jsonpatch[_0xb087('0x24')](_0x49450a,_0x5ea3dc,!![]);}catch(_0x17be8e){return BPromise[_0xb087('0x25')](_0x17be8e);}return _0x49450a[_0xb087('0x26')]();};}function saveUpdates(_0x1fb765,_0x258b4c){return function(_0x31ae01){if(_0x31ae01){return _0x31ae01['update'](_0x1fb765)[_0xb087('0x27')](function(_0x466397){return _0x466397;});}return null;};}function removeEntity(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(_0x3ad74e){return _0x3ad74e['destroy']()[_0xb087('0x27')](function(){var _0xdd4216=_0x3ad74e['get']({'plain':!![]});var _0x5a2dc6='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5a2dc6,'resourceId':_0xdd4216['id']}})[_0xb087('0x27')](function(){return _0x3ad74e;});})[_0xb087('0x27')](function(){_0x1de654[_0xb087('0x1c')](0xcc)[_0xb087('0x1d')]();});}};}function handleEntityNotFound(_0xd9ec66,_0xb72173){return function(_0xf3f41f){if(!_0xf3f41f){_0xd9ec66[_0xb087('0x1b')](0x194);}return _0xf3f41f;};}function handleError(_0x6cfb22,_0x1551c3){_0x1551c3=_0x1551c3||0x1f4;return function(_0x18058c){logger[_0xb087('0x28')](_0x18058c[_0xb087('0x29')]);if(_0x18058c[_0xb087('0x2a')]){delete _0x18058c['name'];}_0x6cfb22[_0xb087('0x1c')](_0x1551c3)[_0xb087('0x2b')](_0x18058c);};}exports[_0xb087('0x2c')]=function(_0x15c9ac,_0x22d441){var _0xa6d90c={},_0x2e1c57={},_0x13fb2f={'count':0x0,'rows':[]};var _0x53a535=_['map'](db[_0xb087('0x2d')][_0xb087('0x2e')],function(_0x4cb5a8){return{'name':_0x4cb5a8[_0xb087('0x2f')],'type':_0x4cb5a8[_0xb087('0x30')][_0xb087('0x31')]};});_0x2e1c57[_0xb087('0x32')]=_[_0xb087('0x33')](_0x53a535,_0xb087('0x2a'));_0x2e1c57[_0xb087('0x34')]=_[_0xb087('0x35')](_0x15c9ac[_0xb087('0x34')]);_0x2e1c57[_0xb087('0x36')]=_[_0xb087('0x37')](_0x2e1c57[_0xb087('0x32')],_0x2e1c57['query']);_0xa6d90c[_0xb087('0x38')]=_['intersection'](_0x2e1c57[_0xb087('0x32')],qs[_0xb087('0x39')](_0x15c9ac[_0xb087('0x34')][_0xb087('0x39')]));_0xa6d90c[_0xb087('0x38')]=_0xa6d90c[_0xb087('0x38')][_0xb087('0x3a')]?_0xa6d90c[_0xb087('0x38')]:_0x2e1c57[_0xb087('0x32')];if(!_0x15c9ac['query']['hasOwnProperty'](_0xb087('0x3b'))){_0xa6d90c[_0xb087('0x20')]=qs[_0xb087('0x20')](_0x15c9ac[_0xb087('0x34')][_0xb087('0x20')]);_0xa6d90c['offset']=qs[_0xb087('0x1f')](_0x15c9ac[_0xb087('0x34')]['offset']);}_0xa6d90c['order']=qs[_0xb087('0x3c')](_0x15c9ac[_0xb087('0x34')][_0xb087('0x3c')]);_0xa6d90c['where']=qs[_0xb087('0x36')](_[_0xb087('0x3d')](_0x15c9ac[_0xb087('0x34')],_0x2e1c57[_0xb087('0x36')]),_0x53a535);if(_0x15c9ac[_0xb087('0x34')]['filter']){_0xa6d90c[_0xb087('0x3e')]=_['merge'](_0xa6d90c[_0xb087('0x3e')],{'$or':_['map'](_0x53a535,function(_0x52a98f){if(_0x52a98f[_0xb087('0x30')]!=='VIRTUAL'){var _0xed47c4={};_0xed47c4[_0x52a98f['name']]={'$like':'%'+_0x15c9ac[_0xb087('0x34')]['filter']+'%'};return _0xed47c4;}})});}_0xa6d90c=_[_0xb087('0x3f')]({},_0xa6d90c,_0x15c9ac[_0xb087('0x40')]);var _0x364b1d={'where':_0xa6d90c[_0xb087('0x3e')]};return db[_0xb087('0x2d')][_0xb087('0x22')](_0x364b1d)[_0xb087('0x27')](function(_0x5e7690){_0x13fb2f[_0xb087('0x22')]=_0x5e7690;if(_0x15c9ac['query'][_0xb087('0x41')]){_0xa6d90c[_0xb087('0x42')]=[{'all':!![]}];}return db['VoiceMail'][_0xb087('0x43')](_0xa6d90c);})[_0xb087('0x27')](function(_0x7650c5){_0x13fb2f['rows']=_0x7650c5;return _0x13fb2f;})[_0xb087('0x27')](respondWithFilteredResult(_0x22d441,_0xa6d90c))['catch'](handleError(_0x22d441,null));};exports[_0xb087('0x44')]=function(_0x32b9d3,_0x5e7f45){var _0x38cb9d={'raw':!![],'where':{'id':_0x32b9d3['params']['id']}},_0x302ce7={};_0x302ce7[_0xb087('0x32')]=_[_0xb087('0x35')](db['VoiceMail'][_0xb087('0x2e')]);_0x302ce7[_0xb087('0x34')]=_[_0xb087('0x35')](_0x32b9d3[_0xb087('0x34')]);_0x302ce7['filters']=_['intersection'](_0x302ce7[_0xb087('0x32')],_0x302ce7[_0xb087('0x34')]);_0x38cb9d[_0xb087('0x38')]=_[_0xb087('0x37')](_0x302ce7[_0xb087('0x32')],qs[_0xb087('0x39')](_0x32b9d3['query']['fields']));_0x38cb9d[_0xb087('0x38')]=_0x38cb9d['attributes'][_0xb087('0x3a')]?_0x38cb9d[_0xb087('0x38')]:_0x302ce7[_0xb087('0x32')];if(_0x32b9d3[_0xb087('0x34')]['includeAll']){_0x38cb9d[_0xb087('0x42')]=[{'all':!![]}];}_0x38cb9d=_['merge']({},_0x38cb9d,_0x32b9d3[_0xb087('0x40')]);return db[_0xb087('0x2d')][_0xb087('0x45')](_0x38cb9d)[_0xb087('0x27')](handleEntityNotFound(_0x5e7f45,null))[_0xb087('0x27')](respondWithResult(_0x5e7f45,null))['catch'](handleError(_0x5e7f45,null));};exports[_0xb087('0x46')]=function(_0xb15e28,_0x588d96){return db['VoiceMail'][_0xb087('0x46')](_0xb15e28['body'],{})['then'](function(_0x1c9f8f){var _0x341665=_0xb15e28['user'][_0xb087('0x47')]({'plain':!![]});if(!_0x341665)throw new Error(_0xb087('0x48'));if(_0x341665[_0xb087('0x49')]==='user'){var _0x5ba160=_0x1c9f8f[_0xb087('0x47')]({'plain':!![]});var _0x54862a='Voicemails';return db[_0xb087('0x4a')][_0xb087('0x45')]({'where':{'name':_0x54862a,'userProfileId':_0x341665[_0xb087('0x4b')]},'raw':!![]})[_0xb087('0x27')](function(_0x2bf92f){if(_0x2bf92f&&_0x2bf92f[_0xb087('0x4c')]===0x0){return db[_0xb087('0x4d')][_0xb087('0x46')]({'name':_0x5ba160[_0xb087('0x2a')],'resourceId':_0x5ba160['id'],'type':_0x2bf92f[_0xb087('0x2a')],'sectionId':_0x2bf92f['id']},{})[_0xb087('0x27')](function(){return _0x1c9f8f;});}else{return _0x1c9f8f;}})[_0xb087('0x4e')](function(_0x55e653){logger[_0xb087('0x28')](_0xb087('0x4f'),_0x55e653);throw _0x55e653;});}return _0x1c9f8f;})['then'](respondWithResult(_0x588d96,0xc9))[_0xb087('0x4e')](handleError(_0x588d96,null));};exports[_0xb087('0x50')]=function(_0x343830,_0x1c91e8){if(_0x343830[_0xb087('0x51')]['id']){delete _0x343830[_0xb087('0x51')]['id'];}return db[_0xb087('0x2d')][_0xb087('0x45')]({'where':{'id':_0x343830[_0xb087('0x52')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x1c91e8,null))[_0xb087('0x27')](saveUpdates(_0x343830['body'],null))[_0xb087('0x27')](respondWithResult(_0x1c91e8,null))['catch'](handleError(_0x1c91e8,null));};exports[_0xb087('0x53')]=function(_0x575cc4,_0xf0b592){return db[_0xb087('0x2d')][_0xb087('0x45')]({'where':{'id':_0x575cc4[_0xb087('0x52')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0xf0b592,null))[_0xb087('0x27')](removeEntity(_0xf0b592,null))[_0xb087('0x4e')](handleError(_0xf0b592,null));};exports[_0xb087('0x54')]=function(_0x3f3091,_0x323e0a,_0x300e9b){return db[_0xb087('0x2d')][_0xb087('0x55')]({'where':{'id':_0x3f3091[_0xb087('0x52')]['id']}})[_0xb087('0x27')](handleEntityNotFound(_0x323e0a,null))[_0xb087('0x27')](function(_0x217f26){var _0x3185c4;var _0x40ff74={},_0xe3cb2={};_0xe3cb2[_0xb087('0x32')]=_[_0xb087('0x35')](db['VoiceMailMessage'][_0xb087('0x2e')]);_0xe3cb2[_0xb087('0x34')]=_[_0xb087('0x35')](_0x3f3091['query']);_0xe3cb2[_0xb087('0x36')]=_[_0xb087('0x37')](_0xe3cb2['model'],_0xe3cb2[_0xb087('0x34')]);_0x40ff74[_0xb087('0x38')]=_[_0xb087('0x37')](_0xe3cb2['model'],qs[_0xb087('0x39')](_0x3f3091[_0xb087('0x34')][_0xb087('0x39')]));_0x40ff74[_0xb087('0x38')]=_0x40ff74[_0xb087('0x38')][_0xb087('0x3a')]?_0x40ff74[_0xb087('0x38')]:_0xe3cb2[_0xb087('0x32')];if(!_0x3f3091['query'][_0xb087('0x56')](_0xb087('0x3b'))){_0x40ff74[_0xb087('0x20')]=qs['limit'](_0x3f3091[_0xb087('0x34')]['limit']);_0x40ff74['offset']=qs[_0xb087('0x1f')](_0x3f3091[_0xb087('0x34')]['offset']);}_0x40ff74[_0xb087('0x57')]=qs['sort'](_0x3f3091[_0xb087('0x34')][_0xb087('0x3c')]);_0x40ff74['where']=qs['filters'](_[_0xb087('0x3d')](_0x3f3091['query'],_0xe3cb2['filters']));if(_0x3f3091[_0xb087('0x34')]['filter']){_0x40ff74[_0xb087('0x3e')]=_['merge'](_0x40ff74[_0xb087('0x3e')],{'$or':_[_0xb087('0x33')](_0x40ff74[_0xb087('0x38')],function(_0x2a6b2e){var _0x4e1683={};_0x4e1683[_0x2a6b2e]={'$like':'%'+_0x3f3091[_0xb087('0x34')]['filter']+'%'};return _0x4e1683;})});}_0x40ff74[_0xb087('0x3e')]=_['merge'](_0x40ff74[_0xb087('0x3e')],{'mailboxuser':_0x217f26[_0xb087('0x58')]});_0x40ff74=_[_0xb087('0x3f')]({},_0x40ff74,_0x3f3091['options']);return db[_0xb087('0x59')]['findAndCountAll'](_0x40ff74)[_0xb087('0x27')](respondWithFilteredResult(_0x323e0a,_0x40ff74));})[_0xb087('0x4e')](handleError(_0x323e0a,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f1213aa..07d0a54 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 _0x9aed=['VoiceMail','voice_voicemail','mailbox','context','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x33bac1,_0x373708){var _0x5672e7=function(_0x51fbd4){while(--_0x51fbd4){_0x33bac1['push'](_0x33bac1['shift']());}};_0x5672e7(++_0x373708);}(_0x9aed,0xfb));var _0xd9ae=function(_0x467b54,_0x38b806){_0x467b54=_0x467b54-0x0;var _0xf6d29c=_0x9aed[_0x467b54];return _0xf6d29c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd9ae('0x0'))(_0xd9ae('0x1'));var moment=require(_0xd9ae('0x2'));var BPromise=require('bluebird');var rp=require(_0xd9ae('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9ae('0x4'));var config=require(_0xd9ae('0x5'));var attributes=require(_0xd9ae('0x6'));module[_0xd9ae('0x7')]=function(_0x36f1b4,_0x22899d){return _0x36f1b4[_0xd9ae('0x8')](_0xd9ae('0x9'),attributes,{'tableName':_0xd9ae('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xd9ae('0xb'),_0xd9ae('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca44=['moment','bluebird','request-promise','path','rimraf','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','lodash','util','../../config/logger','api'];(function(_0x2991ec,_0x1fc255){var _0x1b1cff=function(_0x24828){while(--_0x24828){_0x2991ec['push'](_0x2991ec['shift']());}};_0x1b1cff(++_0x1fc255);}(_0xca44,0x184));var _0x4ca4=function(_0x2383bc,_0x25dbf8){_0x2383bc=_0x2383bc-0x0;var _0x4628a7=_0xca44[_0x2383bc];return _0x4628a7;};'use strict';var _=require(_0x4ca4('0x0'));var util=require(_0x4ca4('0x1'));var logger=require(_0x4ca4('0x2'))(_0x4ca4('0x3'));var moment=require(_0x4ca4('0x4'));var BPromise=require(_0x4ca4('0x5'));var rp=require(_0x4ca4('0x6'));var fs=require('fs');var path=require(_0x4ca4('0x7'));var rimraf=require(_0x4ca4('0x8'));var config=require('../../config/environment');var attributes=require(_0x4ca4('0x9'));module['exports']=function(_0x378520,_0x428c29){return _0x378520[_0x4ca4('0xa')](_0x4ca4('0xb'),attributes,{'tableName':_0x4ca4('0xc'),'paranoid':![],'indexes':[{'name':_0x4ca4('0xd'),'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 7394ee7..46591f0 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 _0xf702=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ece5b,_0x1c2a47){var _0x145190=function(_0x2714c2){while(--_0x2714c2){_0x2ece5b['push'](_0x2ece5b['shift']());}};_0x145190(++_0x1c2a47);}(_0xf702,0xee));var _0x2f70=function(_0x3fabf1,_0x3c9e46){_0x3fabf1=_0x3fabf1-0x0;var _0x270ae5=_0xf702[_0x3fabf1];return _0x270ae5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f70('0x0'));var BPromise=require(_0x2f70('0x1'));var rs=require(_0x2f70('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f70('0x3'))['db'];var utils=require(_0x2f70('0x4'));var logger=require(_0x2f70('0x5'))(_0x2f70('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2f70('0x7')][_0x2f70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1cd5ca,_0x1c002c,_0x2418e1){return new BPromise(function(_0x169125,_0x4c4edc){return client[_0x2f70('0x9')](_0x1cd5ca,_0x2418e1)[_0x2f70('0xa')](function(_0x22cec6){logger['info'](_0x2f70('0xb'),_0x1c002c,_0x2f70('0xc'));logger[_0x2f70('0xd')](_0x2f70('0xe'),_0x1c002c,'request\x20sent',JSON[_0x2f70('0xf')](_0x22cec6));if(_0x22cec6[_0x2f70('0x10')]){if(_0x22cec6['error'][_0x2f70('0x11')]===0x1f4){logger[_0x2f70('0x10')](_0x2f70('0xb'),_0x1c002c,_0x22cec6['error']['message']);return _0x4c4edc(_0x22cec6[_0x2f70('0x10')][_0x2f70('0x12')]);}logger[_0x2f70('0x10')](_0x2f70('0xb'),_0x1c002c,_0x22cec6[_0x2f70('0x10')][_0x2f70('0x12')]);return _0x169125(_0x22cec6[_0x2f70('0x10')][_0x2f70('0x12')]);}else{logger['info'](_0x2f70('0xb'),_0x1c002c,_0x2f70('0xc'));_0x169125(_0x22cec6[_0x2f70('0x13')][_0x2f70('0x12')]);}})[_0x2f70('0x14')](function(_0x8648e9){logger['error'](_0x2f70('0xb'),_0x1c002c,_0x8648e9);_0x4c4edc(_0x8648e9);});});} \ No newline at end of file +var _0x93b7=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x276a5f,_0x5ccf39){var _0x486264=function(_0x2845c0){while(--_0x2845c0){_0x276a5f['push'](_0x276a5f['shift']());}};_0x486264(++_0x5ccf39);}(_0x93b7,0x1e4));var _0x793b=function(_0x19a72c,_0x2229cb){_0x19a72c=_0x19a72c-0x0;var _0x3c6199=_0x93b7[_0x19a72c];return _0x3c6199;};'use strict';var _=require(_0x793b('0x0'));var util=require(_0x793b('0x1'));var moment=require(_0x793b('0x2'));var BPromise=require(_0x793b('0x3'));var rs=require(_0x793b('0x4'));var fs=require('fs');var Redis=require(_0x793b('0x5'));var db=require(_0x793b('0x6'))['db'];var utils=require(_0x793b('0x7'));var logger=require(_0x793b('0x8'))(_0x793b('0x9'));var config=require(_0x793b('0xa'));var jayson=require(_0x793b('0xb'));var client=jayson[_0x793b('0xc')][_0x793b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x324d91,_0x24ca43,_0x4435f0){return new BPromise(function(_0x5b32dd,_0x4c8f2e){return client[_0x793b('0xe')](_0x324d91,_0x4435f0)[_0x793b('0xf')](function(_0x11dcdf){logger[_0x793b('0x10')](_0x793b('0x11'),_0x24ca43,'request\x20sent');logger[_0x793b('0x12')](_0x793b('0x13'),_0x24ca43,_0x793b('0x14'),JSON[_0x793b('0x15')](_0x11dcdf));if(_0x11dcdf[_0x793b('0x16')]){if(_0x11dcdf['error']['code']===0x1f4){logger[_0x793b('0x16')](_0x793b('0x11'),_0x24ca43,_0x11dcdf[_0x793b('0x16')][_0x793b('0x17')]);return _0x4c8f2e(_0x11dcdf['error']['message']);}logger[_0x793b('0x16')](_0x793b('0x11'),_0x24ca43,_0x11dcdf[_0x793b('0x16')][_0x793b('0x17')]);return _0x5b32dd(_0x11dcdf[_0x793b('0x16')][_0x793b('0x17')]);}else{logger[_0x793b('0x10')](_0x793b('0x11'),_0x24ca43,_0x793b('0x14'));_0x5b32dd(_0x11dcdf[_0x793b('0x18')]['message']);}})[_0x793b('0x19')](function(_0x27c156){logger[_0x793b('0x16')](_0x793b('0x11'),_0x24ca43,_0x27c156);_0x4c8f2e(_0x27c156);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 17bcb55..532bf64 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 _0xcc1f=['express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','show','download','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x15bad3,_0x1f9b15){var _0x53a2be=function(_0x31052f){while(--_0x31052f){_0x15bad3['push'](_0x15bad3['shift']());}};_0x53a2be(++_0x1f9b15);}(_0xcc1f,0xb1));var _0xfcc1=function(_0x292b87,_0x14a94e){_0x292b87=_0x292b87-0x0;var _0x3f2d5f=_0xcc1f[_0x292b87];return _0x3f2d5f;};'use strict';var multer=require(_0xfcc1('0x0'));var util=require(_0xfcc1('0x1'));var path=require('path');var timeout=require(_0xfcc1('0x2'));var express=require(_0xfcc1('0x3'));var router=express[_0xfcc1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfcc1('0x5'));var config=require(_0xfcc1('0x6'));var controller=require(_0xfcc1('0x7'));router[_0xfcc1('0x8')]('/',auth[_0xfcc1('0x9')](),controller['index']);router[_0xfcc1('0x8')]('/:id',auth[_0xfcc1('0x9')](),controller[_0xfcc1('0xa')]);router[_0xfcc1('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xfcc1('0xb')]);router[_0xfcc1('0xc')]('/',auth[_0xfcc1('0x9')](),controller[_0xfcc1('0xd')]);router[_0xfcc1('0xe')](_0xfcc1('0xf'),auth['isAuthenticated'](),controller[_0xfcc1('0x10')]);router[_0xfcc1('0x11')](_0xfcc1('0xf'),auth[_0xfcc1('0x9')](),controller[_0xfcc1('0x12')]);module[_0xfcc1('0x13')]=router; \ No newline at end of file +var _0x9fe9=['../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x520725,_0x2714f2){var _0x197db4=function(_0xf3958b){while(--_0xf3958b){_0x520725['push'](_0x520725['shift']());}};_0x197db4(++_0x2714f2);}(_0x9fe9,0xa1));var _0x99fe=function(_0x3b36df,_0x3a1ac8){_0x3b36df=_0x3b36df-0x0;var _0x27c050=_0x9fe9[_0x3b36df];return _0x27c050;};'use strict';var multer=require(_0x99fe('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x99fe('0x1'));var express=require(_0x99fe('0x2'));var router=express[_0x99fe('0x3')]();var fs_extra=require(_0x99fe('0x4'));var auth=require(_0x99fe('0x5'));var interaction=require(_0x99fe('0x6'));var config=require(_0x99fe('0x7'));var controller=require(_0x99fe('0x8'));router[_0x99fe('0x9')]('/',auth[_0x99fe('0xa')](),controller[_0x99fe('0xb')]);router['get'](_0x99fe('0xc'),auth[_0x99fe('0xa')](),controller[_0x99fe('0xd')]);router[_0x99fe('0x9')]('/:id/download',auth[_0x99fe('0xa')](),controller['download']);router[_0x99fe('0xe')]('/',auth[_0x99fe('0xa')](),controller[_0x99fe('0xf')]);router[_0x99fe('0x10')]('/:id',auth[_0x99fe('0xa')](),controller[_0x99fe('0x11')]);router[_0x99fe('0x12')]('/:id',auth[_0x99fe('0xa')](),controller[_0x99fe('0x13')]);module[_0x99fe('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index fd66657..f2f1aab 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 _0x080e=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x500861,_0x488886){var _0x3919fd=function(_0x2a0323){while(--_0x2a0323){_0x500861['push'](_0x500861['shift']());}};_0x3919fd(++_0x488886);}(_0x080e,0x16a));var _0xe080=function(_0x30e33c,_0x2db57e){_0x30e33c=_0x30e33c-0x0;var _0x1ca401=_0x080e[_0x30e33c];return _0x1ca401;};'use strict';var Sequelize=require(_0xe080('0x0'));module[_0xe080('0x1')]={'name':{'type':Sequelize[_0xe080('0x2')],'get':function(_0x751a0f){return this[_0xe080('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xe080('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe080('0x5')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xe080('0x6')](_0xe080('0x7'))}}; \ No newline at end of file +var _0x9d98=['getDataValue','INTEGER','STRING','long','literal','exports','VIRTUAL'];(function(_0x5230b7,_0x5c4ca2){var _0x22694c=function(_0x53df69){while(--_0x53df69){_0x5230b7['push'](_0x5230b7['shift']());}};_0x22694c(++_0x5c4ca2);}(_0x9d98,0x1e1));var _0x89d9=function(_0x3860b6,_0x2c7203){_0x3860b6=_0x3860b6-0x0;var _0xb1ef0b=_0x9d98[_0x3860b6];return _0xb1ef0b;};'use strict';var Sequelize=require('sequelize');module[_0x89d9('0x0')]={'name':{'type':Sequelize[_0x89d9('0x1')],'get':function(_0x3d9908){return this[_0x89d9('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x89d9('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x89d9('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x89d9('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x89d9('0x6')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 5b5499a..c9435a7 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 _0x2df9=['find','create','update','body','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','then','error','stack','name','send','index','map','VoiceMailMessage','rawAttributes','model','differenceBy','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include'];(function(_0x4b7535,_0x16bfe7){var _0x4f86a5=function(_0x25c065){while(--_0x25c065){_0x4b7535['push'](_0x4b7535['shift']());}};_0x4f86a5(++_0x16bfe7);}(_0x2df9,0xb0));var _0x92df=function(_0x10bf5e,_0x58cf66){_0x10bf5e=_0x10bf5e-0x0;var _0x14520d=_0x2df9[_0x10bf5e];return _0x14520d;};'use strict';var emlformat=require(_0x92df('0x0'));var rimraf=require(_0x92df('0x1'));var zipdir=require(_0x92df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92df('0x3'));var moment=require(_0x92df('0x4'));var BPromise=require(_0x92df('0x5'));var Mustache=require(_0x92df('0x6'));var util=require('util');var path=require('path');var sox=require(_0x92df('0x7'));var csv=require(_0x92df('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x92df('0x9'));var squel=require(_0x92df('0xa'));var crypto=require(_0x92df('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x92df('0xc'));var toCsv=require(_0x92df('0x8'));var querystring=require(_0x92df('0xd'));var Papa=require(_0x92df('0xe'));var Redis=require(_0x92df('0xf'));var authService=require(_0x92df('0x10'));var qs=require(_0x92df('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x92df('0x12'));var logger=require(_0x92df('0x13'))(_0x92df('0x14'));var utils=require(_0x92df('0x15'));var config=require(_0x92df('0x16'));var licenseUtil=require(_0x92df('0x17'));var db=require(_0x92df('0x18'))['db'];function respondWithStatusCode(_0x43feeb,_0x18108b){_0x18108b=_0x18108b||0xcc;return function(_0x196249){if(_0x196249){return _0x43feeb[_0x92df('0x19')](_0x18108b);}return _0x43feeb[_0x92df('0x1a')](_0x18108b)[_0x92df('0x1b')]();};}function respondWithResult(_0x4e0e5f,_0x19bcab){_0x19bcab=_0x19bcab||0xc8;return function(_0x2f2737){if(_0x2f2737){return _0x4e0e5f[_0x92df('0x1a')](_0x19bcab)['json'](_0x2f2737);}};}function respondWithFilteredResult(_0xe207e0,_0x28c584){return function(_0x510efe){if(_0x510efe){var _0x475ddd=typeof _0x28c584[_0x92df('0x1c')]===_0x92df('0x1d')&&typeof _0x28c584[_0x92df('0x1e')]===_0x92df('0x1d');var _0x47d642=_0x510efe[_0x92df('0x1f')];var _0x2f136f=_0x475ddd?0x0:_0x28c584[_0x92df('0x1c')];var _0x4f1155=_0x475ddd?_0x510efe['count']:_0x28c584[_0x92df('0x1c')]+_0x28c584['limit'];var _0x875d45;if(_0x4f1155>=_0x47d642){_0x4f1155=_0x47d642;_0x875d45=0xc8;}else{_0x875d45=0xce;}_0xe207e0[_0x92df('0x1a')](_0x875d45);return _0xe207e0[_0x92df('0x20')](_0x92df('0x21'),_0x2f136f+'-'+_0x4f1155+'/'+_0x47d642)[_0x92df('0x22')](_0x510efe);}return null;};}function patchUpdates(_0x23e76f){return function(_0xbd580){try{jsonpatch[_0x92df('0x23')](_0xbd580,_0x23e76f,!![]);}catch(_0x19306a){return BPromise['reject'](_0x19306a);}return _0xbd580[_0x92df('0x24')]();};}function saveUpdates(_0x35b94c,_0x280186){return function(_0x2efb39){if(_0x2efb39){return _0x2efb39['update'](_0x35b94c)['then'](function(_0x2d790a){return _0x2d790a;});}return null;};}function removeEntity(_0x1a8a00,_0x3bd59d){return function(_0x4fdf23){if(_0x4fdf23){return _0x4fdf23[_0x92df('0x25')]()[_0x92df('0x26')](function(){_0x1a8a00[_0x92df('0x1a')](0xcc)[_0x92df('0x1b')]();});}};}function handleEntityNotFound(_0x6040c7,_0x383431){return function(_0x55222c){if(!_0x55222c){_0x6040c7[_0x92df('0x19')](0x194);}return _0x55222c;};}function handleError(_0xf145a1,_0x364ac8){_0x364ac8=_0x364ac8||0x1f4;return function(_0x163d59){logger[_0x92df('0x27')](_0x163d59[_0x92df('0x28')]);if(_0x163d59[_0x92df('0x29')]){delete _0x163d59[_0x92df('0x29')];}_0xf145a1['status'](_0x364ac8)[_0x92df('0x2a')](_0x163d59);};}exports[_0x92df('0x2b')]=function(_0x57e64f,_0x4d8cec){var _0x5e206a={},_0x270e18={},_0x44ce79={'count':0x0,'rows':[]};var _0x2e76f6=_[_0x92df('0x2c')](db[_0x92df('0x2d')][_0x92df('0x2e')],function(_0x335165){return{'name':_0x335165['fieldName'],'type':_0x335165['type']['key']};});_0x270e18[_0x92df('0x2f')]=_[_0x92df('0x30')](_[_0x92df('0x2c')](_0x2e76f6,_0x92df('0x29')),[_0x92df('0x29')]);_0x270e18[_0x92df('0x31')]=_[_0x92df('0x32')](_0x57e64f[_0x92df('0x31')]);_0x270e18[_0x92df('0x33')]=_[_0x92df('0x34')](_0x270e18['model'],_0x270e18[_0x92df('0x31')]);_0x5e206a[_0x92df('0x35')]=_['intersection'](_0x270e18[_0x92df('0x2f')],qs['fields'](_0x57e64f[_0x92df('0x31')]['fields']));_0x5e206a[_0x92df('0x35')]=_0x5e206a[_0x92df('0x35')][_0x92df('0x36')]?_0x5e206a[_0x92df('0x35')]:_0x270e18[_0x92df('0x2f')];if(!_0x57e64f[_0x92df('0x31')][_0x92df('0x37')]('nolimit')){_0x5e206a['limit']=qs['limit'](_0x57e64f[_0x92df('0x31')][_0x92df('0x1e')]);_0x5e206a[_0x92df('0x1c')]=qs[_0x92df('0x1c')](_0x57e64f[_0x92df('0x31')]['offset']);}_0x5e206a['order']=qs['sort'](_0x57e64f[_0x92df('0x31')][_0x92df('0x38')]);_0x5e206a[_0x92df('0x39')]=qs[_0x92df('0x33')](_[_0x92df('0x3a')](_0x57e64f[_0x92df('0x31')],_0x270e18[_0x92df('0x33')]),_0x2e76f6);if(_0x57e64f[_0x92df('0x31')][_0x92df('0x3b')]){_0x5e206a[_0x92df('0x39')]=_[_0x92df('0x3c')](_0x5e206a[_0x92df('0x39')],{'$or':_['map'](_0x2e76f6,function(_0xd4f8d0){if(_0xd4f8d0['type']!==_0x92df('0x3d')){var _0x4caa61={};_0x4caa61[_0xd4f8d0[_0x92df('0x29')]]={'$like':'%'+_0x57e64f[_0x92df('0x31')]['filter']+'%'};return _0x4caa61;}})});}_0x5e206a=_['merge']({},_0x5e206a,_0x57e64f['options']);var _0x45dd16={'where':_0x5e206a[_0x92df('0x39')]};return db[_0x92df('0x2d')][_0x92df('0x1f')](_0x45dd16)[_0x92df('0x26')](function(_0x17206a){_0x44ce79[_0x92df('0x1f')]=_0x17206a;if(_0x57e64f['query'][_0x92df('0x3e')]){_0x5e206a['include']=[{'all':!![]}];}return db[_0x92df('0x2d')][_0x92df('0x3f')](_0x5e206a);})[_0x92df('0x26')](function(_0x3e85a1){_0x44ce79[_0x92df('0x40')]=_0x3e85a1;return _0x44ce79;})[_0x92df('0x26')](respondWithFilteredResult(_0x4d8cec,_0x5e206a))[_0x92df('0x41')](handleError(_0x4d8cec,null));};exports[_0x92df('0x42')]=function(_0x242c35,_0x358b9e){var _0x4f027d={'raw':!![],'where':{'id':_0x242c35[_0x92df('0x43')]['id']}},_0x2d6a85={};_0x2d6a85[_0x92df('0x2f')]=_[_0x92df('0x32')](db['VoiceMailMessage']['rawAttributes']);_0x2d6a85[_0x92df('0x31')]=_[_0x92df('0x32')](_0x242c35[_0x92df('0x31')]);_0x2d6a85[_0x92df('0x33')]=_[_0x92df('0x34')](_0x2d6a85[_0x92df('0x2f')],_0x2d6a85['query']);_0x4f027d[_0x92df('0x35')]=_[_0x92df('0x34')](_0x2d6a85[_0x92df('0x2f')],qs[_0x92df('0x44')](_0x242c35[_0x92df('0x31')][_0x92df('0x44')]));_0x4f027d['attributes']=_0x4f027d[_0x92df('0x35')]['length']?_0x4f027d[_0x92df('0x35')]:_0x2d6a85[_0x92df('0x2f')];if(_0x242c35['query'][_0x92df('0x3e')]){_0x4f027d[_0x92df('0x45')]=[{'all':!![]}];}_0x4f027d=_['merge']({},_0x4f027d,_0x242c35['options']);return db['VoiceMailMessage'][_0x92df('0x46')](_0x4f027d)[_0x92df('0x26')](handleEntityNotFound(_0x358b9e,null))[_0x92df('0x26')](respondWithResult(_0x358b9e,null))[_0x92df('0x41')](handleError(_0x358b9e,null));};exports[_0x92df('0x47')]=function(_0x2c6981,_0x455c23){return db[_0x92df('0x2d')]['create'](_0x2c6981['body'],{})['then'](respondWithResult(_0x455c23,0xc9))[_0x92df('0x41')](handleError(_0x455c23,null));};exports[_0x92df('0x48')]=function(_0x39c4fb,_0x5453b1){if(_0x39c4fb[_0x92df('0x49')]['id']){delete _0x39c4fb['body']['id'];}return db[_0x92df('0x2d')]['find']({'where':{'id':_0x39c4fb[_0x92df('0x43')]['id']}})['then'](handleEntityNotFound(_0x5453b1,null))[_0x92df('0x26')](saveUpdates(_0x39c4fb['body'],null))[_0x92df('0x26')](respondWithResult(_0x5453b1,null))['catch'](handleError(_0x5453b1,null));};exports[_0x92df('0x25')]=function(_0x12f62b,_0x1a771f){return db[_0x92df('0x2d')][_0x92df('0x46')]({'where':{'id':_0x12f62b[_0x92df('0x43')]['id']}})[_0x92df('0x26')](handleEntityNotFound(_0x1a771f,null))[_0x92df('0x26')](removeEntity(_0x1a771f,null))[_0x92df('0x41')](handleError(_0x1a771f,null));};exports[_0x92df('0x4a')]=function(_0x56e3af,_0xb6c2d3,_0x4b1113){return db['VoiceMailMessage'][_0x92df('0x46')]({'where':{'id':_0x56e3af['params']['id']},'attributes':['id','recording',_0x92df('0x4b')]})['then'](handleEntityNotFound(_0xb6c2d3,null))[_0x92df('0x26')](function(_0x4bb4ea){if(_0x4bb4ea){if(!_0x4bb4ea[_0x92df('0x4c')]){throw new db[(_0x92df('0x4d'))][(_0x92df('0x4e'))](_0x92df('0x4f'));}var _0x37ce10={'Content-Type':_0x92df('0x50'),'Content-Disposition':'attachment'};if(_0x4bb4ea['msg_id']){_0x37ce10['Content-Disposition']='attachment;\x20filename=\x22'+_0x4bb4ea[_0x92df('0x4b')]+_0x92df('0x51');}_0xb6c2d3[_0x92df('0x20')](_0x37ce10);return _0xb6c2d3[_0x92df('0x2a')](new Buffer(_0x4bb4ea[_0x92df('0x4c')]));}})[_0x92df('0x41')](handleError(_0xb6c2d3,null));}; \ No newline at end of file +var _0x9e63=['rows','catch','show','rawAttributes','intersection','create','body','find','params','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceMailMessage','fieldName','key','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x464ee7,_0x1f0c1a){var _0x4c9ae3=function(_0x5ef5ff){while(--_0x5ef5ff){_0x464ee7['push'](_0x464ee7['shift']());}};_0x4c9ae3(++_0x1f0c1a);}(_0x9e63,0x106));var _0x39e6=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x9e63[_0x47b58b];return _0x46bebe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x39e6('0x0'));var zipdir=require(_0x39e6('0x1'));var jsonpatch=require(_0x39e6('0x2'));var rp=require('request-promise');var moment=require(_0x39e6('0x3'));var BPromise=require(_0x39e6('0x4'));var Mustache=require('mustache');var util=require(_0x39e6('0x5'));var path=require(_0x39e6('0x6'));var sox=require(_0x39e6('0x7'));var csv=require(_0x39e6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39e6('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x39e6('0xa'));var jsforce=require(_0x39e6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x39e6('0x8'));var querystring=require(_0x39e6('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x39e6('0xd'));var as=require(_0x39e6('0xe'));var hardwareService=require(_0x39e6('0xf'));var logger=require(_0x39e6('0x10'))(_0x39e6('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x39e6('0x12'))['db'];function respondWithStatusCode(_0x3b36be,_0x59f9f7){_0x59f9f7=_0x59f9f7||0xcc;return function(_0x182d48){if(_0x182d48){return _0x3b36be[_0x39e6('0x13')](_0x59f9f7);}return _0x3b36be[_0x39e6('0x14')](_0x59f9f7)[_0x39e6('0x15')]();};}function respondWithResult(_0x5a58c1,_0x4da910){_0x4da910=_0x4da910||0xc8;return function(_0x585da5){if(_0x585da5){return _0x5a58c1[_0x39e6('0x14')](_0x4da910)['json'](_0x585da5);}};}function respondWithFilteredResult(_0xeb59e,_0x1f4796){return function(_0x1498a1){if(_0x1498a1){var _0x524473=typeof _0x1f4796[_0x39e6('0x16')]===_0x39e6('0x17')&&typeof _0x1f4796[_0x39e6('0x18')]===_0x39e6('0x17');var _0x586087=_0x1498a1[_0x39e6('0x19')];var _0xbe2f32=_0x524473?0x0:_0x1f4796[_0x39e6('0x16')];var _0x471e16=_0x524473?_0x1498a1[_0x39e6('0x19')]:_0x1f4796[_0x39e6('0x16')]+_0x1f4796['limit'];var _0x3a9c89;if(_0x471e16>=_0x586087){_0x471e16=_0x586087;_0x3a9c89=0xc8;}else{_0x3a9c89=0xce;}_0xeb59e[_0x39e6('0x14')](_0x3a9c89);return _0xeb59e[_0x39e6('0x1a')]('Content-Range',_0xbe2f32+'-'+_0x471e16+'/'+_0x586087)[_0x39e6('0x1b')](_0x1498a1);}return null;};}function patchUpdates(_0x2c833d){return function(_0x2cda87){try{jsonpatch[_0x39e6('0x1c')](_0x2cda87,_0x2c833d,!![]);}catch(_0xa90936){return BPromise[_0x39e6('0x1d')](_0xa90936);}return _0x2cda87[_0x39e6('0x1e')]();};}function saveUpdates(_0x47c2ed,_0x4cc30f){return function(_0x3c56e8){if(_0x3c56e8){return _0x3c56e8[_0x39e6('0x1f')](_0x47c2ed)[_0x39e6('0x20')](function(_0x37c193){return _0x37c193;});}return null;};}function removeEntity(_0x21ce6c,_0x36034f){return function(_0xf78902){if(_0xf78902){return _0xf78902[_0x39e6('0x21')]()['then'](function(){_0x21ce6c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4db8,_0x5ed714){return function(_0x50cea3){if(!_0x50cea3){_0x2a4db8[_0x39e6('0x13')](0x194);}return _0x50cea3;};}function handleError(_0x35095a,_0x3c296a){_0x3c296a=_0x3c296a||0x1f4;return function(_0x533f37){logger[_0x39e6('0x22')](_0x533f37[_0x39e6('0x23')]);if(_0x533f37[_0x39e6('0x24')]){delete _0x533f37['name'];}_0x35095a[_0x39e6('0x14')](_0x3c296a)[_0x39e6('0x25')](_0x533f37);};}exports['index']=function(_0x5e4928,_0x477a59){var _0x36ad1d={},_0x28d7fc={},_0x13cbbd={'count':0x0,'rows':[]};var _0x5e30ec=_[_0x39e6('0x26')](db[_0x39e6('0x27')]['rawAttributes'],function(_0x4325a7){return{'name':_0x4325a7[_0x39e6('0x28')],'type':_0x4325a7['type'][_0x39e6('0x29')]};});_0x28d7fc[_0x39e6('0x2a')]=_['differenceBy'](_[_0x39e6('0x26')](_0x5e30ec,_0x39e6('0x24')),[_0x39e6('0x24')]);_0x28d7fc[_0x39e6('0x2b')]=_[_0x39e6('0x2c')](_0x5e4928[_0x39e6('0x2b')]);_0x28d7fc[_0x39e6('0x2d')]=_['intersection'](_0x28d7fc[_0x39e6('0x2a')],_0x28d7fc['query']);_0x36ad1d['attributes']=_['intersection'](_0x28d7fc[_0x39e6('0x2a')],qs['fields'](_0x5e4928[_0x39e6('0x2b')][_0x39e6('0x2e')]));_0x36ad1d[_0x39e6('0x2f')]=_0x36ad1d[_0x39e6('0x2f')]['length']?_0x36ad1d[_0x39e6('0x2f')]:_0x28d7fc[_0x39e6('0x2a')];if(!_0x5e4928[_0x39e6('0x2b')][_0x39e6('0x30')](_0x39e6('0x31'))){_0x36ad1d[_0x39e6('0x18')]=qs[_0x39e6('0x18')](_0x5e4928[_0x39e6('0x2b')][_0x39e6('0x18')]);_0x36ad1d[_0x39e6('0x16')]=qs[_0x39e6('0x16')](_0x5e4928['query'][_0x39e6('0x16')]);}_0x36ad1d[_0x39e6('0x32')]=qs[_0x39e6('0x33')](_0x5e4928[_0x39e6('0x2b')][_0x39e6('0x33')]);_0x36ad1d[_0x39e6('0x34')]=qs[_0x39e6('0x2d')](_[_0x39e6('0x35')](_0x5e4928['query'],_0x28d7fc[_0x39e6('0x2d')]),_0x5e30ec);if(_0x5e4928[_0x39e6('0x2b')][_0x39e6('0x36')]){_0x36ad1d[_0x39e6('0x34')]=_['merge'](_0x36ad1d[_0x39e6('0x34')],{'$or':_[_0x39e6('0x26')](_0x5e30ec,function(_0xef75fc){if(_0xef75fc[_0x39e6('0x37')]!==_0x39e6('0x38')){var _0x2f8002={};_0x2f8002[_0xef75fc[_0x39e6('0x24')]]={'$like':'%'+_0x5e4928[_0x39e6('0x2b')][_0x39e6('0x36')]+'%'};return _0x2f8002;}})});}_0x36ad1d=_[_0x39e6('0x39')]({},_0x36ad1d,_0x5e4928[_0x39e6('0x3a')]);var _0x3ad0b1={'where':_0x36ad1d[_0x39e6('0x34')]};return db[_0x39e6('0x27')][_0x39e6('0x19')](_0x3ad0b1)[_0x39e6('0x20')](function(_0x5cbb69){_0x13cbbd[_0x39e6('0x19')]=_0x5cbb69;if(_0x5e4928[_0x39e6('0x2b')][_0x39e6('0x3b')]){_0x36ad1d[_0x39e6('0x3c')]=[{'all':!![]}];}return db[_0x39e6('0x27')][_0x39e6('0x3d')](_0x36ad1d);})[_0x39e6('0x20')](function(_0x3942ca){_0x13cbbd[_0x39e6('0x3e')]=_0x3942ca;return _0x13cbbd;})[_0x39e6('0x20')](respondWithFilteredResult(_0x477a59,_0x36ad1d))[_0x39e6('0x3f')](handleError(_0x477a59,null));};exports[_0x39e6('0x40')]=function(_0x1be671,_0x4db725){var _0xd0ccc9={'raw':!![],'where':{'id':_0x1be671['params']['id']}},_0x2511e1={};_0x2511e1[_0x39e6('0x2a')]=_[_0x39e6('0x2c')](db[_0x39e6('0x27')][_0x39e6('0x41')]);_0x2511e1[_0x39e6('0x2b')]=_[_0x39e6('0x2c')](_0x1be671[_0x39e6('0x2b')]);_0x2511e1[_0x39e6('0x2d')]=_['intersection'](_0x2511e1[_0x39e6('0x2a')],_0x2511e1[_0x39e6('0x2b')]);_0xd0ccc9[_0x39e6('0x2f')]=_[_0x39e6('0x42')](_0x2511e1[_0x39e6('0x2a')],qs[_0x39e6('0x2e')](_0x1be671[_0x39e6('0x2b')][_0x39e6('0x2e')]));_0xd0ccc9[_0x39e6('0x2f')]=_0xd0ccc9[_0x39e6('0x2f')]['length']?_0xd0ccc9[_0x39e6('0x2f')]:_0x2511e1[_0x39e6('0x2a')];if(_0x1be671[_0x39e6('0x2b')]['includeAll']){_0xd0ccc9['include']=[{'all':!![]}];}_0xd0ccc9=_[_0x39e6('0x39')]({},_0xd0ccc9,_0x1be671['options']);return db[_0x39e6('0x27')]['find'](_0xd0ccc9)[_0x39e6('0x20')](handleEntityNotFound(_0x4db725,null))[_0x39e6('0x20')](respondWithResult(_0x4db725,null))['catch'](handleError(_0x4db725,null));};exports[_0x39e6('0x43')]=function(_0x20efb6,_0xe1107b){return db['VoiceMailMessage'][_0x39e6('0x43')](_0x20efb6[_0x39e6('0x44')],{})['then'](respondWithResult(_0xe1107b,0xc9))[_0x39e6('0x3f')](handleError(_0xe1107b,null));};exports['update']=function(_0x3c3e94,_0x190c94){if(_0x3c3e94[_0x39e6('0x44')]['id']){delete _0x3c3e94['body']['id'];}return db[_0x39e6('0x27')][_0x39e6('0x45')]({'where':{'id':_0x3c3e94[_0x39e6('0x46')]['id']}})[_0x39e6('0x20')](handleEntityNotFound(_0x190c94,null))['then'](saveUpdates(_0x3c3e94['body'],null))[_0x39e6('0x20')](respondWithResult(_0x190c94,null))['catch'](handleError(_0x190c94,null));};exports[_0x39e6('0x21')]=function(_0x29748f,_0x4e0dc4){return db[_0x39e6('0x27')]['find']({'where':{'id':_0x29748f['params']['id']}})[_0x39e6('0x20')](handleEntityNotFound(_0x4e0dc4,null))[_0x39e6('0x20')](removeEntity(_0x4e0dc4,null))[_0x39e6('0x3f')](handleError(_0x4e0dc4,null));};exports[_0x39e6('0x47')]=function(_0x257abe,_0x2def6c,_0x2f987e){return db[_0x39e6('0x27')][_0x39e6('0x45')]({'where':{'id':_0x257abe['params']['id']},'attributes':['id',_0x39e6('0x48'),_0x39e6('0x49')]})[_0x39e6('0x20')](handleEntityNotFound(_0x2def6c,null))['then'](function(_0x86eebc){if(_0x86eebc){if(!_0x86eebc[_0x39e6('0x48')]){throw new db[(_0x39e6('0x4a'))]['ValidationError'](_0x39e6('0x4b'));}var _0x5adc74={'Content-Type':_0x39e6('0x4c'),'Content-Disposition':_0x39e6('0x4d')};if(_0x86eebc[_0x39e6('0x49')]){_0x5adc74[_0x39e6('0x4e')]=_0x39e6('0x4f')+_0x86eebc[_0x39e6('0x49')]+_0x39e6('0x50');}_0x2def6c[_0x39e6('0x1a')](_0x5adc74);return _0x2def6c[_0x39e6('0x25')](new Buffer(_0x86eebc['recording']));}})[_0x39e6('0x3f')](handleError(_0x2def6c,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index d1d01df..7e21764 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 _0x229a=['request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x1661a2,_0x23b437){var _0x15786f=function(_0x269357){while(--_0x269357){_0x1661a2['push'](_0x1661a2['shift']());}};_0x15786f(++_0x23b437);}(_0x229a,0x1a9));var _0xa229=function(_0x2172ef,_0x46b33c){_0x2172ef=_0x2172ef-0x0;var _0x2b877e=_0x229a[_0x2172ef];return _0x2b877e;};'use strict';var _=require(_0xa229('0x0'));var util=require(_0xa229('0x1'));var logger=require(_0xa229('0x2'))(_0xa229('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa229('0x4'));var fs=require('fs');var path=require(_0xa229('0x5'));var rimraf=require(_0xa229('0x6'));var config=require(_0xa229('0x7'));var attributes=require(_0xa229('0x8'));module[_0xa229('0x9')]=function(_0x911c3a,_0x41583a){return _0x911c3a['define'](_0xa229('0xa'),attributes,{'tableName':_0xa229('0xb'),'paranoid':![],'indexes':[{'name':_0xa229('0xc'),'fields':[_0xa229('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x8ad4=['moment','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','dir','lodash','../../config/logger','api'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0x8ad4,0x1aa));var _0x48ad=function(_0x44e0a2,_0x59d296){_0x44e0a2=_0x44e0a2-0x0;var _0x518791=_0x8ad4[_0x44e0a2];return _0x518791;};'use strict';var _=require(_0x48ad('0x0'));var util=require('util');var logger=require(_0x48ad('0x1'))(_0x48ad('0x2'));var moment=require(_0x48ad('0x3'));var BPromise=require('bluebird');var rp=require(_0x48ad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48ad('0x5'));var config=require(_0x48ad('0x6'));var attributes=require(_0x48ad('0x7'));module['exports']=function(_0x29b9f3,_0x306ca2){return _0x29b9f3[_0x48ad('0x8')](_0x48ad('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x48ad('0xa'),'fields':[_0x48ad('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c9ea47f..958be56 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 _0x55cc=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x55cc,0x102));var _0xc55c=function(_0x596888,_0x254727){_0x596888=_0x596888-0x0;var _0x231f9b=_0x55cc[_0x596888];return _0x231f9b;};'use strict';var _=require(_0xc55c('0x0'));var util=require(_0xc55c('0x1'));var moment=require(_0xc55c('0x2'));var BPromise=require(_0xc55c('0x3'));var rs=require(_0xc55c('0x4'));var fs=require('fs');var Redis=require(_0xc55c('0x5'));var db=require(_0xc55c('0x6'))['db'];var utils=require(_0xc55c('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc55c('0x8'));var jayson=require(_0xc55c('0x9'));var client=jayson[_0xc55c('0xa')][_0xc55c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2957aa,_0x1a7243,_0x19cefb){return new BPromise(function(_0x3c38a4,_0x5b5a0a){return client[_0xc55c('0xc')](_0x2957aa,_0x19cefb)['then'](function(_0x50b534){logger[_0xc55c('0xd')](_0xc55c('0xe'),_0x1a7243,'request\x20sent');logger[_0xc55c('0xf')](_0xc55c('0x10'),_0x1a7243,_0xc55c('0x11'),JSON['stringify'](_0x50b534));if(_0x50b534['error']){if(_0x50b534[_0xc55c('0x12')][_0xc55c('0x13')]===0x1f4){logger[_0xc55c('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x1a7243,_0x50b534[_0xc55c('0x12')][_0xc55c('0x14')]);return _0x5b5a0a(_0x50b534['error']['message']);}logger['error'](_0xc55c('0xe'),_0x1a7243,_0x50b534['error'][_0xc55c('0x14')]);return _0x3c38a4(_0x50b534['error'][_0xc55c('0x14')]);}else{logger[_0xc55c('0xd')](_0xc55c('0xe'),_0x1a7243,_0xc55c('0x11'));_0x3c38a4(_0x50b534[_0xc55c('0x15')][_0xc55c('0x14')]);}})[_0xc55c('0x16')](function(_0x26a3c0){logger[_0xc55c('0x12')](_0xc55c('0xe'),_0x1a7243,_0x26a3c0);_0x5b5a0a(_0x26a3c0);});});} \ No newline at end of file +var _0x25d9=['http','request','then','info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceMailMessage,\x20%s,\x20%s','catch','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e48a6,_0x3b7abd){var _0x539fb7=function(_0x268350){while(--_0x268350){_0x2e48a6['push'](_0x2e48a6['shift']());}};_0x539fb7(++_0x3b7abd);}(_0x25d9,0x1db));var _0x925d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x25d9[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x925d('0x0'));var moment=require('moment');var BPromise=require(_0x925d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x925d('0x2'))['db'];var utils=require(_0x925d('0x3'));var logger=require(_0x925d('0x4'))(_0x925d('0x5'));var config=require(_0x925d('0x6'));var jayson=require(_0x925d('0x7'));var client=jayson[_0x925d('0x8')][_0x925d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29c9c3,_0x5bff1c,_0x6bd1e){return new BPromise(function(_0x47b839,_0x5919db){return client[_0x925d('0xa')](_0x29c9c3,_0x6bd1e)[_0x925d('0xb')](function(_0x4569d3){logger[_0x925d('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x5bff1c,'request\x20sent');logger[_0x925d('0xd')](_0x925d('0xe'),_0x5bff1c,_0x925d('0xf'),JSON[_0x925d('0x10')](_0x4569d3));if(_0x4569d3[_0x925d('0x11')]){if(_0x4569d3[_0x925d('0x11')][_0x925d('0x12')]===0x1f4){logger[_0x925d('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x5bff1c,_0x4569d3['error'][_0x925d('0x13')]);return _0x5919db(_0x4569d3[_0x925d('0x11')][_0x925d('0x13')]);}logger['error'](_0x925d('0x14'),_0x5bff1c,_0x4569d3['error'][_0x925d('0x13')]);return _0x47b839(_0x4569d3[_0x925d('0x11')][_0x925d('0x13')]);}else{logger[_0x925d('0xc')](_0x925d('0x14'),_0x5bff1c,_0x925d('0xf'));_0x47b839(_0x4569d3['result'][_0x925d('0x13')]);}})[_0x925d('0x15')](function(_0x2ab6a1){logger[_0x925d('0x11')](_0x925d('0x14'),_0x5bff1c,_0x2ab6a1);_0x5919db(_0x2ab6a1);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 5789fc3..c0acf0b 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 _0x89cd=['removeSound','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','isAuthenticated','show','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','delete','destroy'];(function(_0x2d9934,_0x1d52dd){var _0x356d35=function(_0x21584e){while(--_0x21584e){_0x2d9934['push'](_0x2d9934['shift']());}};_0x356d35(++_0x1d52dd);}(_0x89cd,0x182));var _0xd89c=function(_0x1db76,_0x1e047c){_0x1db76=_0x1db76-0x0;var _0x49f54d=_0x89cd[_0x1db76];return _0x49f54d;};'use strict';var multer=require(_0xd89c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd89c('0x1'));var express=require('express');var router=express[_0xd89c('0x2')]();var fs_extra=require(_0xd89c('0x3'));var auth=require(_0xd89c('0x4'));var interaction=require(_0xd89c('0x5'));var config=require(_0xd89c('0x6'));var controller=require(_0xd89c('0x7'));router[_0xd89c('0x8')]('/',auth['isAuthenticated'](),controller[_0xd89c('0x9')]);router[_0xd89c('0x8')]('/:id',auth[_0xd89c('0xa')](),controller[_0xd89c('0xb')]);router[_0xd89c('0x8')](_0xd89c('0xc'),auth[_0xd89c('0xa')](),controller[_0xd89c('0xd')]);router[_0xd89c('0xe')]('/',auth[_0xd89c('0xa')](),controller[_0xd89c('0xf')]);router[_0xd89c('0xe')](_0xd89c('0xc'),auth[_0xd89c('0xa')](),controller[_0xd89c('0x10')]);router[_0xd89c('0x11')](_0xd89c('0x12'),auth['isAuthenticated'](),controller[_0xd89c('0x13')]);router[_0xd89c('0x14')](_0xd89c('0x12'),auth[_0xd89c('0xa')](),controller[_0xd89c('0x15')]);router[_0xd89c('0x14')]('/:id/sounds/:id2',auth[_0xd89c('0xa')](),controller[_0xd89c('0x16')]);module[_0xd89c('0x17')]=router; \ No newline at end of file +var _0x25c2=['post','create','/:id/sounds','put','update','delete','/:id/sounds/:id2','removeSound','path','connect-timeout','express','../../components/auth/service','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','getSounds'];(function(_0x4ecaa5,_0x32ea4f){var _0x57b312=function(_0x46f2fe){while(--_0x46f2fe){_0x4ecaa5['push'](_0x4ecaa5['shift']());}};_0x57b312(++_0x32ea4f);}(_0x25c2,0xa0));var _0x225c=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x25c2[_0x40220a];return _0x3903cc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x225c('0x0'));var timeout=require(_0x225c('0x1'));var express=require(_0x225c('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x225c('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x225c('0x4'));router['get']('/',auth[_0x225c('0x5')](),controller[_0x225c('0x6')]);router[_0x225c('0x7')](_0x225c('0x8'),auth['isAuthenticated'](),controller[_0x225c('0x9')]);router['get']('/:id/sounds',auth[_0x225c('0x5')](),controller[_0x225c('0xa')]);router[_0x225c('0xb')]('/',auth[_0x225c('0x5')](),controller[_0x225c('0xc')]);router[_0x225c('0xb')](_0x225c('0xd'),auth[_0x225c('0x5')](),controller['addSound']);router[_0x225c('0xe')](_0x225c('0x8'),auth[_0x225c('0x5')](),controller[_0x225c('0xf')]);router[_0x225c('0x10')]('/:id',auth[_0x225c('0x5')](),controller['destroy']);router[_0x225c('0x10')](_0x225c('0x11'),auth[_0x225c('0x5')](),controller[_0x225c('0x12')]);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 bec6e37..463d68f 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 _0x8be6=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3','mp3'];(function(_0x2f7d18,_0x44bea6){var _0x425175=function(_0x4b6787){while(--_0x4b6787){_0x2f7d18['push'](_0x2f7d18['shift']());}};_0x425175(++_0x44bea6);}(_0x8be6,0x1a3));var _0x68be=function(_0x289828,_0x19d51f){_0x289828=_0x289828-0x0;var _0x2f08b8=_0x8be6[_0x289828];return _0x2f08b8;};'use strict';var Sequelize=require(_0x68be('0x0'));module[_0x68be('0x1')]={'name':{'type':Sequelize[_0x68be('0x2')],'allowNull':![],'unique':_0x68be('0x3')},'mode':{'type':Sequelize[_0x68be('0x4')](_0x68be('0x5'),_0x68be('0x6'),_0x68be('0x7'),'quietmp3nb',_0x68be('0x8'),_0x68be('0x9')),'allowNull':!![],'defaultValue':_0x68be('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x68be('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x68be('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x68be('0x2')],'allowNull':!![],'defaultValue':_0x68be('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x68be('0xb')},'defaultEntry':{'type':Sequelize[_0x68be('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2f21=['name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','alpha','exports','STRING'];(function(_0x11f858,_0x4ac922){var _0x58252c=function(_0x443e38){while(--_0x443e38){_0x11f858['push'](_0x11f858['shift']());}};_0x58252c(++_0x4ac922);}(_0x2f21,0x120));var _0x12f2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x2f21[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require('sequelize');module[_0x12f2('0x0')]={'name':{'type':Sequelize[_0x12f2('0x1')],'allowNull':![],'unique':_0x12f2('0x2')},'mode':{'type':Sequelize[_0x12f2('0x3')](_0x12f2('0x4'),_0x12f2('0x5'),'mp3nb',_0x12f2('0x6'),_0x12f2('0x7'),_0x12f2('0x8')),'allowNull':!![],'defaultValue':_0x12f2('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x12f2('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x12f2('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x12f2('0x1')],'allowNull':!![],'defaultValue':_0x12f2('0x9')},'format':{'type':Sequelize[_0x12f2('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'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 175181a..7268b2d 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 _0x5f69=['bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','error','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','length','catch','body','params','create','sequelize','transaction','mode','directory','join','root','server/files/moh','files','mkdirSync','0777','user','UserProfileSection','userProfileId','autoAssociation','unlinkSync','rmdirSync','Sequelize','message','find','findOne','save_name','converted_format','server/files/sounds/converted','extname','format','%s.%s','symlinkSync','ValidationError','removeSound','id2','createdAt','getSounds','Sound','hasOwnProperty','eml-format','zip-dir','request-promise','moment'];(function(_0x3699a9,_0x2201d1){var _0x443d2a=function(_0x17fb05){while(--_0x17fb05){_0x3699a9['push'](_0x3699a9['shift']());}};_0x443d2a(++_0x2201d1);}(_0x5f69,0x1a0));var _0x95f6=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0x5f69[_0x5af59e];return _0x4240df;};'use strict';var emlformat=require(_0x95f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95f6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95f6('0x2'));var moment=require(_0x95f6('0x3'));var BPromise=require(_0x95f6('0x4'));var Mustache=require('mustache');var util=require(_0x95f6('0x5'));var path=require('path');var sox=require(_0x95f6('0x6'));var csv=require(_0x95f6('0x7'));var ejs=require(_0x95f6('0x8'));var fs=require('fs');var fs_extra=require(_0x95f6('0x9'));var _=require(_0x95f6('0xa'));var squel=require(_0x95f6('0xb'));var crypto=require('crypto');var jsforce=require(_0x95f6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x95f6('0x7'));var querystring=require(_0x95f6('0xd'));var Papa=require(_0x95f6('0xe'));var Redis=require(_0x95f6('0xf'));var authService=require(_0x95f6('0x10'));var qs=require(_0x95f6('0x11'));var as=require(_0x95f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95f6('0x13'))('api');var utils=require(_0x95f6('0x14'));var config=require(_0x95f6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d06db,_0x59c1f6){_0x59c1f6=_0x59c1f6||0xcc;return function(_0x5846b7){if(_0x5846b7){return _0x2d06db[_0x95f6('0x16')](_0x59c1f6);}return _0x2d06db[_0x95f6('0x17')](_0x59c1f6)[_0x95f6('0x18')]();};}function respondWithResult(_0x3cd05e,_0x2caa35){_0x2caa35=_0x2caa35||0xc8;return function(_0x15c6f8){if(_0x15c6f8){return _0x3cd05e[_0x95f6('0x17')](_0x2caa35)['json'](_0x15c6f8);}};}function respondWithFilteredResult(_0x13a35e,_0x1f5003){return function(_0x28df51){if(_0x28df51){var _0x288ac2=typeof _0x1f5003[_0x95f6('0x19')]===_0x95f6('0x1a')&&typeof _0x1f5003[_0x95f6('0x1b')]===_0x95f6('0x1a');var _0x37ae2c=_0x28df51[_0x95f6('0x1c')];var _0x321d8a=_0x288ac2?0x0:_0x1f5003['offset'];var _0x1b41a9=_0x288ac2?_0x28df51[_0x95f6('0x1c')]:_0x1f5003[_0x95f6('0x19')]+_0x1f5003[_0x95f6('0x1b')];var _0x3470f3;if(_0x1b41a9>=_0x37ae2c){_0x1b41a9=_0x37ae2c;_0x3470f3=0xc8;}else{_0x3470f3=0xce;}_0x13a35e[_0x95f6('0x17')](_0x3470f3);return _0x13a35e['set'](_0x95f6('0x1d'),_0x321d8a+'-'+_0x1b41a9+'/'+_0x37ae2c)[_0x95f6('0x1e')](_0x28df51);}return null;};}function patchUpdates(_0x5e0e32){return function(_0x9c2bd3){try{jsonpatch[_0x95f6('0x1f')](_0x9c2bd3,_0x5e0e32,!![]);}catch(_0x13eb44){return BPromise[_0x95f6('0x20')](_0x13eb44);}return _0x9c2bd3[_0x95f6('0x21')]();};}function saveUpdates(_0x42a704,_0x33dc09){return function(_0x2f9580){if(_0x2f9580){return _0x2f9580[_0x95f6('0x22')](_0x42a704)['then'](function(_0x289b85){return _0x289b85;});}return null;};}function removeEntity(_0x43145d,_0x2d4276){return function(_0x355b5a){if(_0x355b5a){return _0x355b5a[_0x95f6('0x23')]()[_0x95f6('0x24')](function(){var _0x9dd53a=_0x355b5a[_0x95f6('0x25')]({'plain':!![]});var _0x45f202=_0x95f6('0x26');return db[_0x95f6('0x27')][_0x95f6('0x23')]({'where':{'type':_0x45f202,'resourceId':_0x9dd53a['id']}})[_0x95f6('0x24')](function(){return _0x355b5a;});})['then'](function(){_0x43145d[_0x95f6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x265831,_0x119b1c){return function(_0x3e6795){if(!_0x3e6795){_0x265831['sendStatus'](0x194);}return _0x3e6795;};}function handleError(_0x15e2e5,_0x1fc1d8){_0x1fc1d8=_0x1fc1d8||0x1f4;return function(_0x46b1d7){logger[_0x95f6('0x28')](_0x46b1d7['stack']);if(_0x46b1d7[_0x95f6('0x29')]){delete _0x46b1d7['name'];}_0x15e2e5[_0x95f6('0x17')](_0x1fc1d8)['send'](_0x46b1d7);};}exports[_0x95f6('0x2a')]=function(_0x36648a,_0x18d9f1){var _0x96ed65={},_0x5dd2d3={},_0x4f2b76={'count':0x0,'rows':[]};var _0x2ee4bc=_[_0x95f6('0x2b')](db[_0x95f6('0x2c')][_0x95f6('0x2d')],function(_0x5e2296){return{'name':_0x5e2296[_0x95f6('0x2e')],'type':_0x5e2296[_0x95f6('0x2f')][_0x95f6('0x30')]};});_0x5dd2d3[_0x95f6('0x31')]=_[_0x95f6('0x2b')](_0x2ee4bc,_0x95f6('0x29'));_0x5dd2d3['query']=_[_0x95f6('0x32')](_0x36648a['query']);_0x5dd2d3[_0x95f6('0x33')]=_[_0x95f6('0x34')](_0x5dd2d3[_0x95f6('0x31')],_0x5dd2d3[_0x95f6('0x35')]);_0x96ed65[_0x95f6('0x36')]=_[_0x95f6('0x34')](_0x5dd2d3[_0x95f6('0x31')],qs[_0x95f6('0x37')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x37')]));_0x96ed65[_0x95f6('0x36')]=_0x96ed65[_0x95f6('0x36')]['length']?_0x96ed65[_0x95f6('0x36')]:_0x5dd2d3['model'];if(!_0x36648a['query']['hasOwnProperty']('nolimit')){_0x96ed65[_0x95f6('0x1b')]=qs[_0x95f6('0x1b')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x1b')]);_0x96ed65[_0x95f6('0x19')]=qs[_0x95f6('0x19')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x19')]);}_0x96ed65[_0x95f6('0x38')]=qs[_0x95f6('0x39')](_0x36648a[_0x95f6('0x35')][_0x95f6('0x39')]);delete _0x36648a['query'][_0x95f6('0x39')];_0x96ed65[_0x95f6('0x3a')]=qs['filters'](_[_0x95f6('0x3b')](_0x36648a['query'],_0x5dd2d3[_0x95f6('0x33')]),_0x2ee4bc);if(_0x36648a['query'][_0x95f6('0x3c')]){_0x96ed65['where']=_[_0x95f6('0x3d')](_0x96ed65[_0x95f6('0x3a')],{'$or':_[_0x95f6('0x2b')](_0x2ee4bc,function(_0x173df9){if(_0x173df9[_0x95f6('0x2f')]!==_0x95f6('0x3e')){var _0x5bf85b={};_0x5bf85b[_0x173df9[_0x95f6('0x29')]]={'$like':'%'+_0x36648a[_0x95f6('0x35')][_0x95f6('0x3c')]+'%'};return _0x5bf85b;}})});}_0x96ed65=_[_0x95f6('0x3d')]({},_0x96ed65,_0x36648a[_0x95f6('0x3f')]);var _0x9d6e1f={'where':_0x96ed65[_0x95f6('0x3a')]};return db[_0x95f6('0x2c')][_0x95f6('0x1c')](_0x9d6e1f)[_0x95f6('0x24')](function(_0xb725d4){_0x4f2b76[_0x95f6('0x1c')]=_0xb725d4;if(_0x36648a[_0x95f6('0x35')][_0x95f6('0x40')]){_0x96ed65['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x95f6('0x41')](_0x96ed65);})[_0x95f6('0x24')](function(_0x14edd2){_0x4f2b76['rows']=_0x14edd2;return _0x4f2b76;})[_0x95f6('0x24')](respondWithFilteredResult(_0x18d9f1,_0x96ed65))['catch'](handleError(_0x18d9f1,null));};exports['show']=function(_0x151193,_0x467986){var _0x5742e9={'raw':![],'where':{'id':_0x151193['params']['id']}},_0x178f23={};_0x178f23[_0x95f6('0x31')]=_[_0x95f6('0x32')](db[_0x95f6('0x2c')][_0x95f6('0x2d')]);_0x178f23[_0x95f6('0x35')]=_['keys'](_0x151193['query']);_0x178f23[_0x95f6('0x33')]=_[_0x95f6('0x34')](_0x178f23[_0x95f6('0x31')],_0x178f23[_0x95f6('0x35')]);_0x5742e9[_0x95f6('0x36')]=_[_0x95f6('0x34')](_0x178f23[_0x95f6('0x31')],qs[_0x95f6('0x37')](_0x151193[_0x95f6('0x35')][_0x95f6('0x37')]));_0x5742e9[_0x95f6('0x36')]=_0x5742e9[_0x95f6('0x36')][_0x95f6('0x42')]?_0x5742e9['attributes']:_0x178f23[_0x95f6('0x31')];if(_0x151193[_0x95f6('0x35')][_0x95f6('0x40')]){_0x5742e9['include']=[{'all':!![]}];}_0x5742e9=_['merge']({},_0x5742e9,_0x151193[_0x95f6('0x3f')]);return db[_0x95f6('0x2c')]['find'](_0x5742e9)['then'](handleEntityNotFound(_0x467986,null))[_0x95f6('0x24')](respondWithResult(_0x467986,null))[_0x95f6('0x43')](handleError(_0x467986,null));};exports[_0x95f6('0x22')]=function(_0x19c85c,_0x3380bb){if(_0x19c85c[_0x95f6('0x44')]['id']){delete _0x19c85c['body']['id'];}return db[_0x95f6('0x2c')]['find']({'where':{'id':_0x19c85c[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](handleEntityNotFound(_0x3380bb,null))['then'](saveUpdates(_0x19c85c[_0x95f6('0x44')],null))['then'](respondWithResult(_0x3380bb,null))[_0x95f6('0x43')](handleError(_0x3380bb,null));};exports[_0x95f6('0x46')]=function(_0x5e73d0,_0x5dc503,_0x55da60){return db[_0x95f6('0x47')][_0x95f6('0x48')](function(_0x36e877){if(_0x5e73d0['body'][_0x95f6('0x49')]==='files'){_0x5e73d0[_0x95f6('0x44')][_0x95f6('0x4a')]=path[_0x95f6('0x4b')](config[_0x95f6('0x4c')],_0x95f6('0x4d'),_0x5e73d0['body'][_0x95f6('0x29')]);}return db['VoiceMusicOnHold'][_0x95f6('0x46')](_0x5e73d0[_0x95f6('0x44')],{'transaction':_0x36e877})['then'](function(_0x59d881){if(_0x5e73d0['body'][_0x95f6('0x49')]===_0x95f6('0x4e')){fs[_0x95f6('0x4f')](_0x59d881[_0x95f6('0x4a')],parseInt(_0x95f6('0x50'),0x8));}var _0xcacf7f=_0x5e73d0[_0x95f6('0x51')][_0x95f6('0x25')]({'plain':!![]});if(!_0xcacf7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcacf7f['role']==='user'){var _0xcd1a3b=_0x59d881[_0x95f6('0x25')]({'plain':!![]});return db[_0x95f6('0x52')]['find']({'where':{'name':_0x95f6('0x26'),'userProfileId':_0xcacf7f[_0x95f6('0x53')]},'raw':!![]})['then'](function(_0x36959c){if(_0x36959c&&_0x36959c[_0x95f6('0x54')]===0x0){return db['UserProfileResource'][_0x95f6('0x46')]({'name':_0xcd1a3b[_0x95f6('0x29')],'resourceId':_0xcd1a3b['id'],'type':_0x36959c[_0x95f6('0x29')],'sectionId':_0x36959c['id']},{})[_0x95f6('0x24')](function(){return _0x59d881;});}else{return _0x59d881;}})['catch'](function(_0x20f4c4){logger[_0x95f6('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20f4c4);});}return _0x59d881;});})[_0x95f6('0x24')](respondWithResult(_0x5dc503,0xc9))['catch'](handleError(_0x5dc503,null));};exports[_0x95f6('0x23')]=function(_0x18c704,_0x44ee88,_0x4c291c){var _0x1f60a8;return db[_0x95f6('0x2c')]['find']({'where':{'id':_0x18c704[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](function(_0xb3944c){if(_0xb3944c){return db['sequelize'][_0x95f6('0x48')](function(_0x54d1a7){return _0xb3944c[_0x95f6('0x23')]({'transaction':_0x54d1a7,'raw':!![]})['then'](function(_0x3c4c09){if(_0x3c4c09[_0x95f6('0x4a')]){fs['readdirSync'](_0x3c4c09[_0x95f6('0x4a')])['forEach'](function(_0x12a0d8){fs[_0x95f6('0x55')](path[_0x95f6('0x4b')](_0x3c4c09[_0x95f6('0x4a')],_0x12a0d8));});fs[_0x95f6('0x56')](_0x3c4c09[_0x95f6('0x4a')]);}return _0x3c4c09;});})[_0x95f6('0x43')](function(_0x3c673c){throw new db[(_0x95f6('0x57'))]['ValidationError'](_0x3c673c[_0x95f6('0x58')]);});}})[_0x95f6('0x24')](handleEntityNotFound(_0x44ee88,null))['then'](removeEntity(_0x44ee88,null))[_0x95f6('0x43')](handleError(_0x44ee88,null));};exports['addSound']=function(_0x526df1,_0x3c068f,_0x7dcc48){return db[_0x95f6('0x47')][_0x95f6('0x48')](function(_0x471ca7){var _0x4173c0;return db[_0x95f6('0x2c')][_0x95f6('0x59')]({'where':{'id':_0x526df1[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](function(_0x2bb1a0){if(_0x2bb1a0){_0x4173c0=_0x2bb1a0;return _0x2bb1a0['addSound'](_0x526df1['body']['id'],{'transaction':_0x471ca7});}})[_0x95f6('0x24')](function(_0x5b49ca){if(_0x5b49ca){return db['Sound'][_0x95f6('0x5a')]({'where':{'id':_0x526df1['body']['id']},'attributes':['id',_0x95f6('0x29'),_0x95f6('0x5b'),_0x95f6('0x5c'),'createdAt'],'raw':!![]});}})['then'](function(_0x248489){if(_0x248489){var _0x1c8793=path[_0x95f6('0x4b')](config[_0x95f6('0x4c')],_0x95f6('0x5d'),util['format']('%s.%s',path['basename'](_0x248489[_0x95f6('0x5b')],path[_0x95f6('0x5e')](_0x248489['save_name'])),_0x248489[_0x95f6('0x5c')]));var _0x2860d3=path[_0x95f6('0x4b')](config[_0x95f6('0x4c')],_0x95f6('0x4d'),_0x4173c0[_0x95f6('0x29')],util[_0x95f6('0x5f')](_0x95f6('0x60'),_0x248489['name'],_0x248489[_0x95f6('0x5c')]));fs[_0x95f6('0x61')](_0x1c8793,_0x2860d3);return _0x248489;}})['catch'](function(_0x66a7b5){throw new db['Sequelize'][(_0x95f6('0x62'))](_0x66a7b5[_0x95f6('0x58')]);});})[_0x95f6('0x24')](handleEntityNotFound(_0x3c068f,null))[_0x95f6('0x24')](respondWithResult(_0x3c068f,0xc9))[_0x95f6('0x43')](handleError(_0x3c068f,null));};exports['removeSound']=function(_0x8de355,_0x427372,_0x4bc984){return db['sequelize'][_0x95f6('0x48')](function(_0x3ffe41){var _0x251831;return db[_0x95f6('0x2c')][_0x95f6('0x5a')]({'where':{'id':_0x8de355[_0x95f6('0x45')]['id']}})[_0x95f6('0x24')](handleEntityNotFound(_0x427372,null))[_0x95f6('0x24')](function(_0x74ce90){if(_0x74ce90){_0x251831=_0x74ce90;return _0x74ce90[_0x95f6('0x63')](_0x8de355[_0x95f6('0x45')][_0x95f6('0x64')]);}})[_0x95f6('0x24')](function(_0x54bce5){if(_0x54bce5){return db['Sound'][_0x95f6('0x5a')]({'where':{'id':_0x8de355[_0x95f6('0x45')]['id2']},'attributes':['id',_0x95f6('0x29'),_0x95f6('0x5b'),_0x95f6('0x5c'),_0x95f6('0x65')],'raw':!![]});}})[_0x95f6('0x24')](function(_0x156a59){if(_0x156a59){fs[_0x95f6('0x55')](path['join'](_0x251831[_0x95f6('0x4a')],util['format'](_0x95f6('0x60'),_0x156a59[_0x95f6('0x29')],_0x156a59[_0x95f6('0x5c')])));return _0x156a59;}})[_0x95f6('0x43')](function(_0x4dc132){throw new db[(_0x95f6('0x57'))]['ValidationError'](_0x4dc132[_0x95f6('0x58')]);});})['then'](handleEntityNotFound(_0x427372,null))[_0x95f6('0x24')](respondWithStatusCode(_0x427372,0xcc))[_0x95f6('0x43')](handleError(_0x427372,null));};exports[_0x95f6('0x66')]=function(_0x2ee688,_0x22ea23,_0x39164e){var _0x45d84a={};var _0x37c890={};var _0x4fcc93;var _0x5b50b3;return db[_0x95f6('0x2c')][_0x95f6('0x5a')]({'where':{'id':_0x2ee688['params']['id']}})[_0x95f6('0x24')](handleEntityNotFound(_0x22ea23,null))[_0x95f6('0x24')](function(_0x42a282){if(_0x42a282){_0x4fcc93=_0x42a282;_0x37c890[_0x95f6('0x31')]=_[_0x95f6('0x32')](db[_0x95f6('0x67')][_0x95f6('0x2d')]);_0x37c890[_0x95f6('0x35')]=_[_0x95f6('0x32')](_0x2ee688['query']);_0x37c890[_0x95f6('0x33')]=_[_0x95f6('0x34')](_0x37c890[_0x95f6('0x31')],_0x37c890[_0x95f6('0x35')]);_0x45d84a[_0x95f6('0x36')]=_['intersection'](_0x37c890['model'],qs[_0x95f6('0x37')](_0x2ee688['query'][_0x95f6('0x37')]));_0x45d84a[_0x95f6('0x36')]=_0x45d84a[_0x95f6('0x36')][_0x95f6('0x42')]?_0x45d84a['attributes']:_0x37c890[_0x95f6('0x31')];_0x45d84a[_0x95f6('0x38')]=qs['sort'](_0x2ee688[_0x95f6('0x35')]['sort']);_0x45d84a['where']=qs[_0x95f6('0x33')](_['pick'](_0x2ee688[_0x95f6('0x35')],_0x37c890[_0x95f6('0x33')]));if(_0x2ee688[_0x95f6('0x35')][_0x95f6('0x3c')]){_0x45d84a['where']=_[_0x95f6('0x3d')](_0x45d84a[_0x95f6('0x3a')],{'$or':_['map'](_0x45d84a[_0x95f6('0x36')],function(_0x122ff6){var _0x1c2eda={};_0x1c2eda[_0x122ff6]={'$like':'%'+_0x2ee688[_0x95f6('0x35')][_0x95f6('0x3c')]+'%'};return _0x1c2eda;})});}_0x45d84a=_['merge']({},_0x45d84a,_0x2ee688[_0x95f6('0x3f')]);return _0x4fcc93[_0x95f6('0x66')](_0x45d84a);}})[_0x95f6('0x24')](function(_0x9652fc){if(_0x9652fc){_0x5b50b3=_0x9652fc[_0x95f6('0x42')];if(!_0x2ee688[_0x95f6('0x35')][_0x95f6('0x68')]('nolimit')){_0x45d84a['limit']=qs[_0x95f6('0x1b')](_0x2ee688[_0x95f6('0x35')][_0x95f6('0x1b')]);_0x45d84a['offset']=qs[_0x95f6('0x19')](_0x2ee688[_0x95f6('0x35')][_0x95f6('0x19')]);}return _0x4fcc93[_0x95f6('0x66')](_0x45d84a);}})[_0x95f6('0x24')](function(_0x4ebecb){if(_0x4ebecb){return _0x4ebecb?{'count':_0x5b50b3,'rows':_0x4ebecb}:null;}})['then'](respondWithResult(_0x22ea23,null))['catch'](handleError(_0x22ea23,null));}; \ No newline at end of file +var _0x43b6=['../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','get','MusicOnHolds','sendStatus','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','body','create','transaction','mode','directory','join','root','server/files/moh','files','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','symlinkSync','id2','getSounds','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x5a5320,_0x3e36dd){var _0x16c157=function(_0x3010d5){while(--_0x3010d5){_0x5a5320['push'](_0x5a5320['shift']());}};_0x16c157(++_0x3e36dd);}(_0x43b6,0xd3));var _0x643b=function(_0x148bc0,_0xf5cfdc){_0x148bc0=_0x148bc0-0x0;var _0x34d7d0=_0x43b6[_0x148bc0];return _0x34d7d0;};'use strict';var emlformat=require(_0x643b('0x0'));var rimraf=require(_0x643b('0x1'));var zipdir=require(_0x643b('0x2'));var jsonpatch=require(_0x643b('0x3'));var rp=require(_0x643b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x643b('0x5'));var util=require(_0x643b('0x6'));var path=require(_0x643b('0x7'));var sox=require(_0x643b('0x8'));var csv=require(_0x643b('0x9'));var ejs=require(_0x643b('0xa'));var fs=require('fs');var fs_extra=require(_0x643b('0xb'));var _=require('lodash');var squel=require(_0x643b('0xc'));var crypto=require('crypto');var jsforce=require(_0x643b('0xd'));var deskjs=require(_0x643b('0xe'));var toCsv=require(_0x643b('0x9'));var querystring=require(_0x643b('0xf'));var Papa=require(_0x643b('0x10'));var Redis=require(_0x643b('0x11'));var authService=require(_0x643b('0x12'));var qs=require(_0x643b('0x13'));var as=require(_0x643b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x643b('0x15'))(_0x643b('0x16'));var utils=require(_0x643b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x643b('0x18'));var db=require(_0x643b('0x19'))['db'];function respondWithStatusCode(_0x454a60,_0x2a297d){_0x2a297d=_0x2a297d||0xcc;return function(_0x118303){if(_0x118303){return _0x454a60['sendStatus'](_0x2a297d);}return _0x454a60[_0x643b('0x1a')](_0x2a297d)[_0x643b('0x1b')]();};}function respondWithResult(_0x35899b,_0x3a3af1){_0x3a3af1=_0x3a3af1||0xc8;return function(_0x3375ab){if(_0x3375ab){return _0x35899b[_0x643b('0x1a')](_0x3a3af1)[_0x643b('0x1c')](_0x3375ab);}};}function respondWithFilteredResult(_0x12dc73,_0x210fb2){return function(_0x204ff3){if(_0x204ff3){var _0x568384=typeof _0x210fb2['offset']===_0x643b('0x1d')&&typeof _0x210fb2[_0x643b('0x1e')]===_0x643b('0x1d');var _0x177abb=_0x204ff3[_0x643b('0x1f')];var _0x29a838=_0x568384?0x0:_0x210fb2['offset'];var _0x15e445=_0x568384?_0x204ff3[_0x643b('0x1f')]:_0x210fb2['offset']+_0x210fb2[_0x643b('0x1e')];var _0x423c07;if(_0x15e445>=_0x177abb){_0x15e445=_0x177abb;_0x423c07=0xc8;}else{_0x423c07=0xce;}_0x12dc73[_0x643b('0x1a')](_0x423c07);return _0x12dc73['set']('Content-Range',_0x29a838+'-'+_0x15e445+'/'+_0x177abb)[_0x643b('0x1c')](_0x204ff3);}return null;};}function patchUpdates(_0x267b43){return function(_0x457bda){try{jsonpatch[_0x643b('0x20')](_0x457bda,_0x267b43,!![]);}catch(_0x27cde4){return BPromise[_0x643b('0x21')](_0x27cde4);}return _0x457bda[_0x643b('0x22')]();};}function saveUpdates(_0x29ffec,_0x1fa0d9){return function(_0x3e04ac){if(_0x3e04ac){return _0x3e04ac[_0x643b('0x23')](_0x29ffec)[_0x643b('0x24')](function(_0x1ed04b){return _0x1ed04b;});}return null;};}function removeEntity(_0x52d609,_0x1cc6eb){return function(_0x5a4a4b){if(_0x5a4a4b){return _0x5a4a4b[_0x643b('0x25')]()[_0x643b('0x24')](function(){var _0x5442f2=_0x5a4a4b[_0x643b('0x26')]({'plain':!![]});var _0x4ec272=_0x643b('0x27');return db['UserProfileResource'][_0x643b('0x25')]({'where':{'type':_0x4ec272,'resourceId':_0x5442f2['id']}})[_0x643b('0x24')](function(){return _0x5a4a4b;});})[_0x643b('0x24')](function(){_0x52d609[_0x643b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e8f21,_0x102b6f){return function(_0x12e425){if(!_0x12e425){_0x2e8f21[_0x643b('0x28')](0x194);}return _0x12e425;};}function handleError(_0x169740,_0x1a6870){_0x1a6870=_0x1a6870||0x1f4;return function(_0x34eec7){logger[_0x643b('0x29')](_0x34eec7['stack']);if(_0x34eec7[_0x643b('0x2a')]){delete _0x34eec7[_0x643b('0x2a')];}_0x169740[_0x643b('0x1a')](_0x1a6870)[_0x643b('0x2b')](_0x34eec7);};}exports[_0x643b('0x2c')]=function(_0x460134,_0x364389){var _0x489790={},_0x487c1a={},_0x455faa={'count':0x0,'rows':[]};var _0x2c93ad=_[_0x643b('0x2d')](db[_0x643b('0x2e')][_0x643b('0x2f')],function(_0x41fd29){return{'name':_0x41fd29[_0x643b('0x30')],'type':_0x41fd29[_0x643b('0x31')][_0x643b('0x32')]};});_0x487c1a[_0x643b('0x33')]=_[_0x643b('0x2d')](_0x2c93ad,_0x643b('0x2a'));_0x487c1a[_0x643b('0x34')]=_[_0x643b('0x35')](_0x460134['query']);_0x487c1a[_0x643b('0x36')]=_['intersection'](_0x487c1a[_0x643b('0x33')],_0x487c1a[_0x643b('0x34')]);_0x489790['attributes']=_[_0x643b('0x37')](_0x487c1a['model'],qs[_0x643b('0x38')](_0x460134[_0x643b('0x34')][_0x643b('0x38')]));_0x489790['attributes']=_0x489790[_0x643b('0x39')][_0x643b('0x3a')]?_0x489790[_0x643b('0x39')]:_0x487c1a['model'];if(!_0x460134[_0x643b('0x34')]['hasOwnProperty'](_0x643b('0x3b'))){_0x489790[_0x643b('0x1e')]=qs[_0x643b('0x1e')](_0x460134['query'][_0x643b('0x1e')]);_0x489790[_0x643b('0x3c')]=qs['offset'](_0x460134[_0x643b('0x34')][_0x643b('0x3c')]);}_0x489790[_0x643b('0x3d')]=qs[_0x643b('0x3e')](_0x460134[_0x643b('0x34')][_0x643b('0x3e')]);delete _0x460134[_0x643b('0x34')][_0x643b('0x3e')];_0x489790[_0x643b('0x3f')]=qs[_0x643b('0x36')](_[_0x643b('0x40')](_0x460134[_0x643b('0x34')],_0x487c1a[_0x643b('0x36')]),_0x2c93ad);if(_0x460134[_0x643b('0x34')]['filter']){_0x489790[_0x643b('0x3f')]=_['merge'](_0x489790[_0x643b('0x3f')],{'$or':_[_0x643b('0x2d')](_0x2c93ad,function(_0x350750){if(_0x350750['type']!==_0x643b('0x41')){var _0x10476b={};_0x10476b[_0x350750[_0x643b('0x2a')]]={'$like':'%'+_0x460134[_0x643b('0x34')][_0x643b('0x42')]+'%'};return _0x10476b;}})});}_0x489790=_[_0x643b('0x43')]({},_0x489790,_0x460134['options']);var _0x4a80a0={'where':_0x489790[_0x643b('0x3f')]};return db[_0x643b('0x2e')]['count'](_0x4a80a0)[_0x643b('0x24')](function(_0x3b6a27){_0x455faa[_0x643b('0x1f')]=_0x3b6a27;if(_0x460134[_0x643b('0x34')][_0x643b('0x44')]){_0x489790[_0x643b('0x45')]=[{'all':!![]}];}return db[_0x643b('0x2e')][_0x643b('0x46')](_0x489790);})[_0x643b('0x24')](function(_0x220bf9){_0x455faa[_0x643b('0x47')]=_0x220bf9;return _0x455faa;})[_0x643b('0x24')](respondWithFilteredResult(_0x364389,_0x489790))[_0x643b('0x48')](handleError(_0x364389,null));};exports[_0x643b('0x49')]=function(_0x51f46c,_0x21ee4b){var _0x956ec1={'raw':![],'where':{'id':_0x51f46c[_0x643b('0x4a')]['id']}},_0x533a4a={};_0x533a4a[_0x643b('0x33')]=_['keys'](db[_0x643b('0x2e')][_0x643b('0x2f')]);_0x533a4a[_0x643b('0x34')]=_[_0x643b('0x35')](_0x51f46c[_0x643b('0x34')]);_0x533a4a[_0x643b('0x36')]=_[_0x643b('0x37')](_0x533a4a['model'],_0x533a4a['query']);_0x956ec1[_0x643b('0x39')]=_[_0x643b('0x37')](_0x533a4a[_0x643b('0x33')],qs[_0x643b('0x38')](_0x51f46c[_0x643b('0x34')][_0x643b('0x38')]));_0x956ec1[_0x643b('0x39')]=_0x956ec1[_0x643b('0x39')]['length']?_0x956ec1[_0x643b('0x39')]:_0x533a4a['model'];if(_0x51f46c['query'][_0x643b('0x44')]){_0x956ec1[_0x643b('0x45')]=[{'all':!![]}];}_0x956ec1=_[_0x643b('0x43')]({},_0x956ec1,_0x51f46c[_0x643b('0x4b')]);return db[_0x643b('0x2e')]['find'](_0x956ec1)[_0x643b('0x24')](handleEntityNotFound(_0x21ee4b,null))[_0x643b('0x24')](respondWithResult(_0x21ee4b,null))[_0x643b('0x48')](handleError(_0x21ee4b,null));};exports[_0x643b('0x23')]=function(_0x503ee6,_0x1acf61){if(_0x503ee6[_0x643b('0x4c')]['id']){delete _0x503ee6[_0x643b('0x4c')]['id'];}return db[_0x643b('0x2e')]['find']({'where':{'id':_0x503ee6[_0x643b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1acf61,null))['then'](saveUpdates(_0x503ee6[_0x643b('0x4c')],null))[_0x643b('0x24')](respondWithResult(_0x1acf61,null))[_0x643b('0x48')](handleError(_0x1acf61,null));};exports[_0x643b('0x4d')]=function(_0x9b6220,_0x7052a2,_0x3648b5){return db['sequelize'][_0x643b('0x4e')](function(_0x223482){if(_0x9b6220[_0x643b('0x4c')][_0x643b('0x4f')]==='files'){_0x9b6220[_0x643b('0x4c')][_0x643b('0x50')]=path[_0x643b('0x51')](config[_0x643b('0x52')],_0x643b('0x53'),_0x9b6220['body'][_0x643b('0x2a')]);}return db['VoiceMusicOnHold']['create'](_0x9b6220[_0x643b('0x4c')],{'transaction':_0x223482})[_0x643b('0x24')](function(_0x4b13e4){if(_0x9b6220[_0x643b('0x4c')][_0x643b('0x4f')]===_0x643b('0x54')){fs[_0x643b('0x55')](_0x4b13e4[_0x643b('0x50')],parseInt(_0x643b('0x56'),0x8));}var _0x444119=_0x9b6220['user'][_0x643b('0x26')]({'plain':!![]});if(!_0x444119)throw new Error(_0x643b('0x57'));if(_0x444119[_0x643b('0x58')]===_0x643b('0x59')){var _0xd53e3e=_0x4b13e4[_0x643b('0x26')]({'plain':!![]});return db[_0x643b('0x5a')][_0x643b('0x5b')]({'where':{'name':_0x643b('0x27'),'userProfileId':_0x444119[_0x643b('0x5c')]},'raw':!![]})[_0x643b('0x24')](function(_0x311224){if(_0x311224&&_0x311224[_0x643b('0x5d')]===0x0){return db['UserProfileResource'][_0x643b('0x4d')]({'name':_0xd53e3e[_0x643b('0x2a')],'resourceId':_0xd53e3e['id'],'type':_0x311224[_0x643b('0x2a')],'sectionId':_0x311224['id']},{})[_0x643b('0x24')](function(){return _0x4b13e4;});}else{return _0x4b13e4;}})[_0x643b('0x48')](function(_0x3cd228){logger[_0x643b('0x29')](_0x643b('0x5e'),_0x3cd228);});}return _0x4b13e4;});})['then'](respondWithResult(_0x7052a2,0xc9))[_0x643b('0x48')](handleError(_0x7052a2,null));};exports[_0x643b('0x25')]=function(_0x4767b8,_0x5a070c,_0x3f4f93){var _0x3c8c33;return db[_0x643b('0x2e')][_0x643b('0x5b')]({'where':{'id':_0x4767b8[_0x643b('0x4a')]['id']}})[_0x643b('0x24')](function(_0x5b7cb0){if(_0x5b7cb0){return db[_0x643b('0x5f')][_0x643b('0x4e')](function(_0x46712a){return _0x5b7cb0[_0x643b('0x25')]({'transaction':_0x46712a,'raw':!![]})[_0x643b('0x24')](function(_0x37541d){if(_0x37541d[_0x643b('0x50')]){fs[_0x643b('0x60')](_0x37541d['directory'])[_0x643b('0x61')](function(_0x207d27){fs[_0x643b('0x62')](path['join'](_0x37541d[_0x643b('0x50')],_0x207d27));});fs[_0x643b('0x63')](_0x37541d['directory']);}return _0x37541d;});})[_0x643b('0x48')](function(_0xf875e8){throw new db[(_0x643b('0x64'))][(_0x643b('0x65'))](_0xf875e8[_0x643b('0x66')]);});}})[_0x643b('0x24')](handleEntityNotFound(_0x5a070c,null))['then'](removeEntity(_0x5a070c,null))[_0x643b('0x48')](handleError(_0x5a070c,null));};exports['addSound']=function(_0x5650c6,_0x2c0c72,_0x28481d){return db[_0x643b('0x5f')][_0x643b('0x4e')](function(_0x28402d){var _0x85b90c;return db['VoiceMusicOnHold'][_0x643b('0x5b')]({'where':{'id':_0x5650c6[_0x643b('0x4a')]['id']}})[_0x643b('0x24')](function(_0x335947){if(_0x335947){_0x85b90c=_0x335947;return _0x335947['addSound'](_0x5650c6[_0x643b('0x4c')]['id'],{'transaction':_0x28402d});}})[_0x643b('0x24')](function(_0x14dad7){if(_0x14dad7){return db[_0x643b('0x67')][_0x643b('0x68')]({'where':{'id':_0x5650c6['body']['id']},'attributes':['id',_0x643b('0x2a'),'save_name',_0x643b('0x69'),_0x643b('0x6a')],'raw':!![]});}})[_0x643b('0x24')](function(_0x426707){if(_0x426707){var _0x1cea6f=path[_0x643b('0x51')](config[_0x643b('0x52')],_0x643b('0x6b'),util[_0x643b('0x6c')](_0x643b('0x6d'),path[_0x643b('0x6e')](_0x426707[_0x643b('0x6f')],path[_0x643b('0x70')](_0x426707[_0x643b('0x6f')])),_0x426707[_0x643b('0x69')]));var _0x4d0f40=path[_0x643b('0x51')](config['root'],_0x643b('0x53'),_0x85b90c[_0x643b('0x2a')],util['format']('%s.%s',_0x426707[_0x643b('0x2a')],_0x426707[_0x643b('0x69')]));fs[_0x643b('0x71')](_0x1cea6f,_0x4d0f40);return _0x426707;}})[_0x643b('0x48')](function(_0x567f88){throw new db['Sequelize'][(_0x643b('0x65'))](_0x567f88[_0x643b('0x66')]);});})[_0x643b('0x24')](handleEntityNotFound(_0x2c0c72,null))[_0x643b('0x24')](respondWithResult(_0x2c0c72,0xc9))['catch'](handleError(_0x2c0c72,null));};exports['removeSound']=function(_0x192bbd,_0x1f1a47,_0xb01eba){return db[_0x643b('0x5f')]['transaction'](function(_0x56e1db){var _0x24f889;return db['VoiceMusicOnHold'][_0x643b('0x68')]({'where':{'id':_0x192bbd[_0x643b('0x4a')]['id']}})[_0x643b('0x24')](handleEntityNotFound(_0x1f1a47,null))[_0x643b('0x24')](function(_0x10eaf1){if(_0x10eaf1){_0x24f889=_0x10eaf1;return _0x10eaf1['removeSound'](_0x192bbd[_0x643b('0x4a')][_0x643b('0x72')]);}})[_0x643b('0x24')](function(_0x41d409){if(_0x41d409){return db['Sound']['findOne']({'where':{'id':_0x192bbd[_0x643b('0x4a')]['id2']},'attributes':['id',_0x643b('0x2a'),_0x643b('0x6f'),_0x643b('0x69'),_0x643b('0x6a')],'raw':!![]});}})[_0x643b('0x24')](function(_0x902d6){if(_0x902d6){fs[_0x643b('0x62')](path[_0x643b('0x51')](_0x24f889[_0x643b('0x50')],util[_0x643b('0x6c')](_0x643b('0x6d'),_0x902d6[_0x643b('0x2a')],_0x902d6['converted_format'])));return _0x902d6;}})['catch'](function(_0x3e4c07){throw new db[(_0x643b('0x64'))][(_0x643b('0x65'))](_0x3e4c07[_0x643b('0x66')]);});})[_0x643b('0x24')](handleEntityNotFound(_0x1f1a47,null))[_0x643b('0x24')](respondWithStatusCode(_0x1f1a47,0xcc))['catch'](handleError(_0x1f1a47,null));};exports['getSounds']=function(_0x5b4bbb,_0x2de022,_0x47ba5b){var _0x69a39={};var _0x1244b6={};var _0x40998c;var _0x365956;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x5b4bbb[_0x643b('0x4a')]['id']}})[_0x643b('0x24')](handleEntityNotFound(_0x2de022,null))[_0x643b('0x24')](function(_0x3b9c8c){if(_0x3b9c8c){_0x40998c=_0x3b9c8c;_0x1244b6[_0x643b('0x33')]=_[_0x643b('0x35')](db[_0x643b('0x67')][_0x643b('0x2f')]);_0x1244b6['query']=_['keys'](_0x5b4bbb[_0x643b('0x34')]);_0x1244b6['filters']=_[_0x643b('0x37')](_0x1244b6[_0x643b('0x33')],_0x1244b6[_0x643b('0x34')]);_0x69a39[_0x643b('0x39')]=_[_0x643b('0x37')](_0x1244b6[_0x643b('0x33')],qs[_0x643b('0x38')](_0x5b4bbb[_0x643b('0x34')]['fields']));_0x69a39['attributes']=_0x69a39[_0x643b('0x39')][_0x643b('0x3a')]?_0x69a39[_0x643b('0x39')]:_0x1244b6['model'];_0x69a39[_0x643b('0x3d')]=qs[_0x643b('0x3e')](_0x5b4bbb[_0x643b('0x34')][_0x643b('0x3e')]);_0x69a39['where']=qs['filters'](_[_0x643b('0x40')](_0x5b4bbb['query'],_0x1244b6[_0x643b('0x36')]));if(_0x5b4bbb['query'][_0x643b('0x42')]){_0x69a39[_0x643b('0x3f')]=_[_0x643b('0x43')](_0x69a39[_0x643b('0x3f')],{'$or':_[_0x643b('0x2d')](_0x69a39[_0x643b('0x39')],function(_0x38e2ae){var _0x5bd07b={};_0x5bd07b[_0x38e2ae]={'$like':'%'+_0x5b4bbb[_0x643b('0x34')]['filter']+'%'};return _0x5bd07b;})});}_0x69a39=_[_0x643b('0x43')]({},_0x69a39,_0x5b4bbb[_0x643b('0x4b')]);return _0x40998c[_0x643b('0x73')](_0x69a39);}})[_0x643b('0x24')](function(_0x256d95){if(_0x256d95){_0x365956=_0x256d95[_0x643b('0x3a')];if(!_0x5b4bbb[_0x643b('0x34')][_0x643b('0x74')](_0x643b('0x3b'))){_0x69a39[_0x643b('0x1e')]=qs[_0x643b('0x1e')](_0x5b4bbb[_0x643b('0x34')]['limit']);_0x69a39[_0x643b('0x3c')]=qs[_0x643b('0x3c')](_0x5b4bbb[_0x643b('0x34')]['offset']);}return _0x40998c[_0x643b('0x73')](_0x69a39);}})['then'](function(_0x14b581){if(_0x14b581){return _0x14b581?{'count':_0x365956,'rows':_0x14b581}:null;}})['then'](respondWithResult(_0x2de022,null))['catch'](handleError(_0x2de022,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 06ecb71..1d7035a 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 _0x4cd6=['VoiceMusicOnHold','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define'];(function(_0x4293e1,_0x1733b2){var _0x52a215=function(_0x54f88f){while(--_0x54f88f){_0x4293e1['push'](_0x4293e1['shift']());}};_0x52a215(++_0x1733b2);}(_0x4cd6,0x14b));var _0x64cd=function(_0x359532,_0x5492d9){_0x359532=_0x359532-0x0;var _0x5147b0=_0x4cd6[_0x359532];return _0x5147b0;};'use strict';var _=require(_0x64cd('0x0'));var util=require('util');var logger=require(_0x64cd('0x1'))(_0x64cd('0x2'));var moment=require(_0x64cd('0x3'));var BPromise=require(_0x64cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x64cd('0x5'));var rimraf=require(_0x64cd('0x6'));var config=require(_0x64cd('0x7'));var attributes=require(_0x64cd('0x8'));module['exports']=function(_0x511cf0,_0x5a9e14){return _0x511cf0[_0x64cd('0x9')](_0x64cd('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe780=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe780,0x90));var _0x0e78=function(_0x132fab,_0x38f620){_0x132fab=_0x132fab-0x0;var _0x2ec568=_0xe780[_0x132fab];return _0x2ec568;};'use strict';var _=require('lodash');var util=require(_0x0e78('0x0'));var logger=require(_0x0e78('0x1'))(_0x0e78('0x2'));var moment=require(_0x0e78('0x3'));var BPromise=require(_0x0e78('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e78('0x5'));var rimraf=require(_0x0e78('0x6'));var config=require(_0x0e78('0x7'));var attributes=require(_0x0e78('0x8'));module[_0x0e78('0x9')]=function(_0x778f2a,_0x2a7cac){return _0x778f2a['define'](_0x0e78('0xa'),attributes,{'tableName':_0x0e78('0xb'),'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 5e8b18a..0fcd534 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x250765,_0x4504ee){var _0x295c23=function(_0x31dcf7){while(--_0x31dcf7){_0x250765['push'](_0x250765['shift']());}};_0x295c23(++_0x4504ee);}(_0x70e0,0x17b));var _0x070e=function(_0x5bb9ae,_0x23c56d){_0x5bb9ae=_0x5bb9ae-0x0;var _0x4ad9cd=_0x70e0[_0x5bb9ae];return _0x4ad9cd;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x13950f,_0x64aca){var _0x1ea304=function(_0x160a45){while(--_0x160a45){_0x13950f['push'](_0x13950f['shift']());}};_0x1ea304(++_0x64aca);}(_0xe706,0xa3));var _0x6e70=function(_0x37ded3,_0x371ebb){_0x37ded3=_0x37ded3-0x0;var _0x51e49e=_0xe706[_0x37ded3];return _0x51e49e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 70f991b..d819ddd 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 _0x046e=['post','addAgents','addTeams','put','update','delete','destroy','removeAgents','/:id/teams','removeTeams','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','/:id/users','getAgents','getTeams'];(function(_0x5f078b,_0x16efd9){var _0x595c54=function(_0x2f86ab){while(--_0x2f86ab){_0x5f078b['push'](_0x5f078b['shift']());}};_0x595c54(++_0x16efd9);}(_0x046e,0x1b4));var _0xe046=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x046e[_0x47e7dd];return _0x38501f;};'use strict';var multer=require(_0xe046('0x0'));var util=require('util');var path=require(_0xe046('0x1'));var timeout=require('connect-timeout');var express=require(_0xe046('0x2'));var router=express[_0xe046('0x3')]();var fs_extra=require(_0xe046('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe046('0x5'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0xe046('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe046('0x6')]('/describe',auth[_0xe046('0x7')](),controller[_0xe046('0x8')]);router['get'](_0xe046('0x9'),auth[_0xe046('0x7')](),controller[_0xe046('0xa')]);router[_0xe046('0x6')](_0xe046('0xb'),auth[_0xe046('0x7')](),controller[_0xe046('0xc')]);router[_0xe046('0x6')]('/:id/teams',auth[_0xe046('0x7')](),controller[_0xe046('0xd')]);router[_0xe046('0xe')]('/',auth[_0xe046('0x7')](),controller['create']);router[_0xe046('0xe')](_0xe046('0xb'),auth['isAuthenticated'](),controller[_0xe046('0xf')]);router[_0xe046('0xe')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe046('0x10')]);router[_0xe046('0x11')]('/:id',auth[_0xe046('0x7')](),controller[_0xe046('0x12')]);router[_0xe046('0x13')](_0xe046('0x9'),auth[_0xe046('0x7')](),controller[_0xe046('0x14')]);router[_0xe046('0x13')]('/:id/users',auth[_0xe046('0x7')](),controller[_0xe046('0x15')]);router['delete'](_0xe046('0x16'),auth[_0xe046('0x7')](),controller[_0xe046('0x17')]);module[_0xe046('0x18')]=router; \ No newline at end of file +var _0x3d3e=['/describe','isAuthenticated','describe','/:id','show','/:id/users','/:id/teams','getTeams','create','addAgents','post','put','update','removeAgents','delete','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./voicePrefix.controller','index','get'];(function(_0x19feb1,_0x286c60){var _0x337cbc=function(_0x4f00fe){while(--_0x4f00fe){_0x19feb1['push'](_0x19feb1['shift']());}};_0x337cbc(++_0x286c60);}(_0x3d3e,0x155));var _0xe3d3=function(_0x29d915,_0x3c17f9){_0x29d915=_0x29d915-0x0;var _0x3eb1f0=_0x3d3e[_0x29d915];return _0x3eb1f0;};'use strict';var multer=require(_0xe3d3('0x0'));var util=require(_0xe3d3('0x1'));var path=require(_0xe3d3('0x2'));var timeout=require('connect-timeout');var express=require(_0xe3d3('0x3'));var router=express[_0xe3d3('0x4')]();var fs_extra=require(_0xe3d3('0x5'));var auth=require(_0xe3d3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe3d3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe3d3('0x8')]);router[_0xe3d3('0x9')](_0xe3d3('0xa'),auth[_0xe3d3('0xb')](),controller[_0xe3d3('0xc')]);router[_0xe3d3('0x9')](_0xe3d3('0xd'),auth[_0xe3d3('0xb')](),controller[_0xe3d3('0xe')]);router[_0xe3d3('0x9')](_0xe3d3('0xf'),auth[_0xe3d3('0xb')](),controller['getAgents']);router['get'](_0xe3d3('0x10'),auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x11')]);router['post']('/',auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x12')]);router['post']('/:id/users',auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x13')]);router[_0xe3d3('0x14')](_0xe3d3('0x10'),auth[_0xe3d3('0xb')](),controller['addTeams']);router[_0xe3d3('0x15')](_0xe3d3('0xd'),auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x16')]);router['delete'](_0xe3d3('0xd'),auth[_0xe3d3('0xb')](),controller['destroy']);router['delete']('/:id/users',auth[_0xe3d3('0xb')](),controller[_0xe3d3('0x17')]);router[_0xe3d3('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe3d3('0x19')]);module[_0xe3d3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 4960d99..1e05be5 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 _0x63b2=['system-','getDataValue','STRING','name','VIRTUAL'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x63b2,0xe3));var _0x263b=function(_0x1e71b8,_0x2710a7){_0x1e71b8=_0x1e71b8-0x0;var _0x46ba7d=_0x63b2[_0x1e71b8];return _0x46ba7d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x263b('0x0')],'allowNull':![],'unique':_0x263b('0x1')},'prefix':{'type':Sequelize[_0x263b('0x2')],'get':function(_0x29f4b0){return _0x263b('0x3')+this[_0x263b('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x263b('0x0')]},'callerIdAll':{'type':Sequelize[_0x263b('0x0')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd571=['VIRTUAL','system-','getDataValue','exports','STRING'];(function(_0x2cc0c5,_0x47a192){var _0x4ec66e=function(_0x1b8cde){while(--_0x1b8cde){_0x2cc0c5['push'](_0x2cc0c5['shift']());}};_0x4ec66e(++_0x47a192);}(_0xd571,0x1c5));var _0x1d57=function(_0x580bae,_0x1f2c51){_0x580bae=_0x580bae-0x0;var _0x754b61=_0xd571[_0x580bae];return _0x754b61;};'use strict';var Sequelize=require('sequelize');module[_0x1d57('0x0')]={'name':{'type':Sequelize[_0x1d57('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x1d57('0x2')],'get':function(_0x3d0922){return _0x1d57('0x3')+this[_0x1d57('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x1d57('0x1')]},'callerIdAll':{'type':Sequelize[_0x1d57('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index f1e20f8..a32f55e 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 _0x8e3f=['charAt','update','system-','findById','addAgents','ids','omit','userVoicePrefix:save','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','online','voicePause','interface','flatMap','get','Agents','addTeams','each','UserVoicePrefix','forEach','Team','select','field','tq.TeamId','join','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','includes','all','union','compact','removeTeams','isEmpty','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','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/environment','../../config/license/util','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','findAll','catch','includeAll','include','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:'];(function(_0x440694,_0x45baf6){var _0x51ab3c=function(_0x810225){while(--_0x810225){_0x440694['push'](_0x440694['shift']());}};_0x51ab3c(++_0x45baf6);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8e3f[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xf8e3('0x0'));var rimraf=require(_0xf8e3('0x1'));var zipdir=require(_0xf8e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8e3('0x3'));var moment=require(_0xf8e3('0x4'));var BPromise=require(_0xf8e3('0x5'));var Mustache=require('mustache');var util=require(_0xf8e3('0x6'));var path=require(_0xf8e3('0x7'));var sox=require('sox');var csv=require(_0xf8e3('0x8'));var ejs=require(_0xf8e3('0x9'));var fs=require('fs');var fs_extra=require(_0xf8e3('0xa'));var _=require(_0xf8e3('0xb'));var squel=require('squel');var crypto=require(_0xf8e3('0xc'));var jsforce=require(_0xf8e3('0xd'));var deskjs=require(_0xf8e3('0xe'));var toCsv=require(_0xf8e3('0x8'));var querystring=require(_0xf8e3('0xf'));var Papa=require(_0xf8e3('0x10'));var Redis=require(_0xf8e3('0x11'));var authService=require(_0xf8e3('0x12'));var qs=require(_0xf8e3('0x13'));var as=require(_0xf8e3('0x14'));var hardwareService=require(_0xf8e3('0x15'));var logger=require(_0xf8e3('0x16'))('api');var utils=require(_0xf8e3('0x17'));var config=require(_0xf8e3('0x18'));var licenseUtil=require(_0xf8e3('0x19'));var db=require('../../mysqldb')['db'];config[_0xf8e3('0x1a')]=_[_0xf8e3('0x1b')](config[_0xf8e3('0x1a')],{'host':_0xf8e3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8e3('0x1a')]));require(_0xf8e3('0x1d'))[_0xf8e3('0x1e')](socket);function respondWithStatusCode(_0x4af736,_0x44f631){_0x44f631=_0x44f631||0xcc;return function(_0x5136c6){if(_0x5136c6){return _0x4af736[_0xf8e3('0x1f')](_0x44f631);}return _0x4af736[_0xf8e3('0x20')](_0x44f631)[_0xf8e3('0x21')]();};}function respondWithResult(_0x570ee3,_0x529c92){_0x529c92=_0x529c92||0xc8;return function(_0x564f43){if(_0x564f43){return _0x570ee3[_0xf8e3('0x20')](_0x529c92)[_0xf8e3('0x22')](_0x564f43);}};}function respondWithFilteredResult(_0x3b01ac,_0x110a78){return function(_0x11d4cc){if(_0x11d4cc){var _0x7a81c3=typeof _0x110a78[_0xf8e3('0x23')]===_0xf8e3('0x24')&&typeof _0x110a78[_0xf8e3('0x25')]==='undefined';var _0x20cc64=_0x11d4cc[_0xf8e3('0x26')];var _0x24e8d6=_0x7a81c3?0x0:_0x110a78[_0xf8e3('0x23')];var _0x3128ad=_0x7a81c3?_0x11d4cc[_0xf8e3('0x26')]:_0x110a78[_0xf8e3('0x23')]+_0x110a78[_0xf8e3('0x25')];var _0x5b99b1;if(_0x3128ad>=_0x20cc64){_0x3128ad=_0x20cc64;_0x5b99b1=0xc8;}else{_0x5b99b1=0xce;}_0x3b01ac[_0xf8e3('0x20')](_0x5b99b1);return _0x3b01ac[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x24e8d6+'-'+_0x3128ad+'/'+_0x20cc64)[_0xf8e3('0x22')](_0x11d4cc);}return null;};}function patchUpdates(_0x4a1e5f){return function(_0x39df34){try{jsonpatch['apply'](_0x39df34,_0x4a1e5f,!![]);}catch(_0x286059){return BPromise[_0xf8e3('0x29')](_0x286059);}return _0x39df34[_0xf8e3('0x2a')]();};}function saveUpdates(_0x2dc856,_0x1f4b68){return function(_0x3ac384){if(_0x3ac384){return _0x3ac384['update'](_0x2dc856)[_0xf8e3('0x2b')](function(_0x2fc674){return _0x2fc674;});}return null;};}function removeEntity(_0x3373ca,_0x417b42){return function(_0x1f1363){if(_0x1f1363){return _0x1f1363[_0xf8e3('0x2c')]()[_0xf8e3('0x2b')](function(){var _0x157a2d=_0x1f1363['get']({'plain':!![]});var _0x356e0a=_0xf8e3('0x2d');return db[_0xf8e3('0x2e')][_0xf8e3('0x2c')]({'where':{'type':_0x356e0a,'resourceId':_0x157a2d['id']}})[_0xf8e3('0x2b')](function(){return _0x1f1363;});})[_0xf8e3('0x2b')](function(){_0x3373ca[_0xf8e3('0x20')](0xcc)[_0xf8e3('0x21')]();});}};}function handleEntityNotFound(_0x4f2ae9,_0x21e1c0){return function(_0x243e28){if(!_0x243e28){_0x4f2ae9[_0xf8e3('0x1f')](0x194);}return _0x243e28;};}function handleError(_0x28b2f2,_0x567153){_0x567153=_0x567153||0x1f4;return function(_0x2e507c){logger[_0xf8e3('0x2f')](_0x2e507c[_0xf8e3('0x30')]);if(_0x2e507c[_0xf8e3('0x31')]){delete _0x2e507c[_0xf8e3('0x31')];}_0x28b2f2[_0xf8e3('0x20')](_0x567153)[_0xf8e3('0x32')](_0x2e507c);};}exports[_0xf8e3('0x33')]=function(_0x50ad3f,_0x2c07bf){var _0x527337={},_0x4acd6c={},_0x5d2dd5={'count':0x0,'rows':[]};var _0x5cc1ed=_[_0xf8e3('0x34')](db['VoicePrefix'][_0xf8e3('0x35')],function(_0x41faaa){return{'name':_0x41faaa[_0xf8e3('0x36')],'type':_0x41faaa[_0xf8e3('0x37')]['key']};});_0x4acd6c['model']=_[_0xf8e3('0x34')](_0x5cc1ed,_0xf8e3('0x31'));_0x4acd6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x50ad3f[_0xf8e3('0x38')]);_0x4acd6c[_0xf8e3('0x3a')]=_['intersection'](_0x4acd6c[_0xf8e3('0x3b')],_0x4acd6c['query']);_0x527337['attributes']=_[_0xf8e3('0x3c')](_0x4acd6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x50ad3f[_0xf8e3('0x38')]['fields']));_0x527337['attributes']=_0x527337[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x527337['attributes']:_0x4acd6c[_0xf8e3('0x3b')];if(!_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x40')](_0xf8e3('0x41'))){_0x527337['limit']=qs['limit'](_0x50ad3f['query'][_0xf8e3('0x25')]);_0x527337[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x50ad3f[_0xf8e3('0x38')]['offset']);}_0x527337[_0xf8e3('0x42')]=qs['sort'](_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x527337[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x50ad3f[_0xf8e3('0x38')],_0x4acd6c[_0xf8e3('0x3a')]),_0x5cc1ed);if(_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x527337['where']=_[_0xf8e3('0x47')](_0x527337['where'],{'$or':_[_0xf8e3('0x34')](_0x5cc1ed,function(_0x1e8917){if(_0x1e8917[_0xf8e3('0x37')]!==_0xf8e3('0x48')){var _0x64bfc6={};_0x64bfc6[_0x1e8917[_0xf8e3('0x31')]]={'$like':'%'+_0x50ad3f[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x64bfc6;}})});}_0x527337=_['merge']({},_0x527337,_0x50ad3f[_0xf8e3('0x49')]);var _0x108b81={'where':_0x527337[_0xf8e3('0x44')]};return db[_0xf8e3('0x4a')][_0xf8e3('0x26')](_0x108b81)[_0xf8e3('0x2b')](function(_0x792190){_0x5d2dd5[_0xf8e3('0x26')]=_0x792190;if(_0x50ad3f['query']['includeAll']){_0x527337['include']=[{'all':!![]}];}return db[_0xf8e3('0x4a')][_0xf8e3('0x4b')](_0x527337);})['then'](function(_0x181908){_0x5d2dd5['rows']=_0x181908;return _0x5d2dd5;})[_0xf8e3('0x2b')](respondWithFilteredResult(_0x2c07bf,_0x527337))[_0xf8e3('0x4c')](handleError(_0x2c07bf,null));};exports['show']=function(_0x1fb64d,_0x4b0791){var _0x679519={'raw':![],'where':{'id':_0x1fb64d['params']['id']}},_0x6875a6={};_0x6875a6[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db[_0xf8e3('0x4a')][_0xf8e3('0x35')]);_0x6875a6['query']=_['keys'](_0x1fb64d['query']);_0x6875a6[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x6875a6[_0xf8e3('0x3b')],_0x6875a6['query']);_0x679519[_0xf8e3('0x3e')]=_['intersection'](_0x6875a6[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x1fb64d['query']['fields']));_0x679519[_0xf8e3('0x3e')]=_0x679519[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x679519[_0xf8e3('0x3e')]:_0x6875a6[_0xf8e3('0x3b')];if(_0x1fb64d[_0xf8e3('0x38')][_0xf8e3('0x4d')]){_0x679519[_0xf8e3('0x4e')]=[{'all':!![]}];}_0x679519=_[_0xf8e3('0x47')]({},_0x679519,_0x1fb64d[_0xf8e3('0x49')]);return db[_0xf8e3('0x4a')]['find'](_0x679519)[_0xf8e3('0x2b')](handleEntityNotFound(_0x4b0791,null))[_0xf8e3('0x2b')](respondWithResult(_0x4b0791,null))[_0xf8e3('0x4c')](handleError(_0x4b0791,null));};exports[_0xf8e3('0x2c')]=function(_0x385a8f,_0x3256e6){return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x385a8f[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3256e6,null))[_0xf8e3('0x2b')](removeEntity(_0x3256e6,null))[_0xf8e3('0x4c')](handleError(_0x3256e6,null));};exports[_0xf8e3('0x51')]=function(_0x5855f2,_0x260f67){return db[_0xf8e3('0x4a')][_0xf8e3('0x51')]()[_0xf8e3('0x2b')](respondWithResult(_0x260f67,null))[_0xf8e3('0x4c')](handleError(_0x260f67,null));};exports[_0xf8e3('0x52')]=function(_0x5990fc,_0x394e45){var _0x1f425f;return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x452b00){return db['VoicePrefix'][_0xf8e3('0x52')](_0x5990fc[_0xf8e3('0x55')],{'transaction':_0x452b00})[_0xf8e3('0x2b')](function(_0x53c897){_0x1f425f=_0x53c897['get']({'plain':!![]});return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x1f425f[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x58ad2f){return createVoicePrefixExtensions(_0x1f425f,_0x58ad2f,_0x452b00);});});})[_0xf8e3('0x2b')](function(){var _0x16bddb=_0x5990fc['user']['get']({'plain':!![]});if(!_0x16bddb)throw new Error(_0xf8e3('0x58'));if(_0x16bddb[_0xf8e3('0x59')]===_0xf8e3('0x5a')){var _0x505477=_0x1f425f;return db['UserProfileSection']['find']({'where':{'name':_0xf8e3('0x2d'),'userProfileId':_0x16bddb[_0xf8e3('0x5b')]},'raw':!![]})['then'](function(_0x4937fc){if(_0x4937fc&&_0x4937fc['autoAssociation']===0x0){return db[_0xf8e3('0x2e')][_0xf8e3('0x52')]({'name':_0x505477['name'],'resourceId':_0x505477['id'],'type':_0x4937fc[_0xf8e3('0x31')],'sectionId':_0x4937fc['id']},{})[_0xf8e3('0x2b')](function(){return _0x1f425f;});}else{return _0x1f425f;}})[_0xf8e3('0x4c')](function(_0x560f42){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560f42);throw _0x560f42;});}return _0x1f425f;})['then'](respondWithResult(_0x394e45,null))[_0xf8e3('0x4c')](handleError(_0x394e45,null));};function Extension(_0x3b120a,_0x3ef144,_0x447efe,_0x442349){this[_0xf8e3('0x5c')]=_0xf8e3('0x5d');this[_0xf8e3('0x5e')]=_0x3b120a;this[_0xf8e3('0x5f')]=_0x447efe;this['type']='system';this[_0xf8e3('0x60')]=_0xf8e3('0x61');this[_0xf8e3('0x62')]=_0x3ef144;this['appdata']=_0x442349;}function createVoicePrefixExtensions(_0x234b06,_0x131c0b,_0x4879c7){return new BPromise(function(_0x48bb3f,_0x256cd5){var _0x4763eb=new Extension(formatPrefixName(_0x234b06[_0xf8e3('0x63')]),0x1,_0xf8e3('0x64'),'Voice\x20Prefix');_0x4763eb['VoicePrefixId']=_0x234b06['id'];return db[_0xf8e3('0x56')][_0xf8e3('0x52')](_0x4763eb,{'transaction':_0x4879c7})[_0xf8e3('0x2b')](function(_0x392d99){var _0x4f1ddb=_0x392d99['get']({'plain':!![]});var _0x324ad5=_[_0xf8e3('0x34')](addVoicePrefixExtensions(_0x234b06,_0x131c0b),function(_0x56a07e){_0x56a07e[_0xf8e3('0x57')]=_0x4f1ddb['id'];_0x56a07e[_0xf8e3('0x65')]=_0x234b06['id'];return _0x56a07e;});return db[_0xf8e3('0x56')][_0xf8e3('0x66')](_0x324ad5,{'transaction':_0x4879c7})['then'](function(_0x11ebb2){if(!_0x11ebb2){return _0x256cd5('Extensions\x20creation\x20failed');}else{return _0x48bb3f(_0x11ebb2);}})[_0xf8e3('0x4c')](function(_0x1cad38){return _0x256cd5(_0x1cad38);});});;});};function addVoicePrefixExtensions(_0x5cbdc6,_0x2ec4f6){var _0x31568b=[];var _0x55418c=formatPrefixName(_0x5cbdc6[_0xf8e3('0x63')]);_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x2,_0xf8e3('0x68'),_0xf8e3('0x69')+_0x5cbdc6['name']));if(_0x5cbdc6[_0xf8e3('0x6a')]){_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x68'),_0xf8e3('0x6b')+_0x5cbdc6[_0xf8e3('0x6a')]));}else{_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x3,_0xf8e3('0x64'),_0xf8e3('0x6c')));}_0x31568b[_0xf8e3('0x67')](new Extension(_0x55418c,0x4,_0xf8e3('0x6d'),_0x2ec4f6[_0xf8e3('0x5c')]+','+_0xf8e3('0x6e')+(0x8+_0x5cbdc6['name']['length'])+'}'+','+0x1));return _0x31568b;}function formatPrefixName(_0x2f6cf4){var _0x32eaab='_';for(var _0x5ccdb2=0x0;_0x5ccdb2<_0x2f6cf4[_0xf8e3('0x3f')];_0x5ccdb2++){if(_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)=='-'){_0x32eaab+=_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2);}else{_0x32eaab+='['+_0x2f6cf4[_0xf8e3('0x6f')](_0x5ccdb2)+']';}}_0x32eaab+='.';return _0x32eaab;}exports[_0xf8e3('0x70')]=function(_0x5804eb,_0x3e501c,_0x1dcd23){var _0x52e996=_0x5804eb[_0xf8e3('0x55')];_0x52e996['prefix']=_0xf8e3('0x71')+_0x52e996['name']+'-';return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x45361d){return db[_0xf8e3('0x4a')][_0xf8e3('0x70')](_0x52e996,{'where':{'id':_0x52e996['id']},'transaction':_0x45361d})['then'](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x2c')]({'where':{'VoicePrefixId':_0x52e996['id']},'transaction':_0x45361d})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x56')][_0xf8e3('0x4f')]({'where':{'id':_0x52e996[_0xf8e3('0x57')]},'raw':!![]})[_0xf8e3('0x2b')](function(_0x2ccd34){return createVoicePrefixExtensions(_0x52e996,_0x2ccd34,_0x45361d);});});});})[_0xf8e3('0x2b')](function(){return db[_0xf8e3('0x4a')][_0xf8e3('0x72')](_0x52e996['id']);})[_0xf8e3('0x2b')](respondWithResult(_0x3e501c,null))['catch'](handleError(_0x3e501c,null));};exports[_0xf8e3('0x73')]=function(_0x280f06,_0x3dc049,_0x4b69db){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x280f06[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x3dc049,null))[_0xf8e3('0x2b')](function(_0x40174a){if(_0x40174a){return _0x40174a[_0xf8e3('0x73')](_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')],_[_0xf8e3('0x75')](_0x280f06[_0xf8e3('0x55')],[_0xf8e3('0x74'),'id'])||{})['spread'](function(_0x118cc6){for(var _0xf7cb3a=0x0;_0xf7cb3a<_0x280f06[_0xf8e3('0x55')][_0xf8e3('0x74')]['length'];_0xf7cb3a+=0x1){socket['emit'](_0xf8e3('0x76'),{'UserId':Number(_0x280f06[_0xf8e3('0x55')]['ids'][_0xf7cb3a]),'VoicePrefixId':Number(_0x280f06['params']['id'])});}return _0x118cc6;});}})[_0xf8e3('0x2b')](respondWithResult(_0x3dc049,null))[_0xf8e3('0x4c')](handleError(_0x3dc049,null));};exports['removeAgents']=function(_0x2a2c6,_0xca5962,_0x16e69a){return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x2a2c6['params']['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xca5962,null))[_0xf8e3('0x2b')](function(_0x54db4e){if(_0x54db4e){return _0x54db4e['removeAgents'](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])[_0xf8e3('0x2b')](function(){if(_[_0xf8e3('0x77')](_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')])){for(var _0x3823b9=0x0;_0x3823b9<_0x2a2c6[_0xf8e3('0x38')]['ids'][_0xf8e3('0x3f')];_0x3823b9+=0x1){socket[_0xf8e3('0x78')](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')][_0x3823b9]),'VoicePrefixId':Number(_0x2a2c6[_0xf8e3('0x50')]['id'])});}}else{socket['emit'](_0xf8e3('0x79'),{'UserId':Number(_0x2a2c6[_0xf8e3('0x38')][_0xf8e3('0x74')]),'VoicePrefixId':Number(_0x2a2c6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xca5962,null))[_0xf8e3('0x4c')](handleError(_0xca5962,null));};exports[_0xf8e3('0x7a')]=function(_0x25805c,_0xc01ac,_0x4659ed){var _0x5b8840={};var _0x25bf6c={};var _0x1f5a80;var _0x1bfe33;return db[_0xf8e3('0x4a')][_0xf8e3('0x7b')]({'where':{'id':_0x25805c[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0xc01ac,null))[_0xf8e3('0x2b')](function(_0x40b66c){if(_0x40b66c){_0x1f5a80=_0x40b66c;_0x25bf6c['model']=_[_0xf8e3('0x39')](db[_0xf8e3('0x7c')][_0xf8e3('0x35')]);_0x25bf6c[_0xf8e3('0x38')]=_[_0xf8e3('0x39')](_0x25805c[_0xf8e3('0x38')]);_0x25bf6c[_0xf8e3('0x3a')]=_['intersection'](_0x25bf6c['model'],_0x25bf6c[_0xf8e3('0x38')]);_0x5b8840[_0xf8e3('0x3e')]=_['intersection'](_0x25bf6c[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x5b8840[_0xf8e3('0x3e')]=_0x5b8840[_0xf8e3('0x3e')][_0xf8e3('0x3f')]?_0x5b8840['attributes']:_0x25bf6c[_0xf8e3('0x3b')];_0x5b8840[_0xf8e3('0x42')]=qs[_0xf8e3('0x43')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x43')]);_0x5b8840[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x25805c[_0xf8e3('0x38')],_0x25bf6c[_0xf8e3('0x3a')]));if(_0x25805c[_0xf8e3('0x38')]['filter']){_0x5b8840['where']=_[_0xf8e3('0x47')](_0x5b8840['where'],{'$or':_[_0xf8e3('0x34')](_0x5b8840['attributes'],function(_0x1a3843){var _0x1b2249={};_0x1b2249[_0x1a3843]={'$like':'%'+_0x25805c[_0xf8e3('0x38')]['filter']+'%'};return _0x1b2249;})});}_0x5b8840=_[_0xf8e3('0x47')]({},_0x5b8840,_0x25805c[_0xf8e3('0x49')]);return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x3619cd){if(_0x3619cd){_0x1bfe33=_0x3619cd['length'];if(!_0x25805c[_0xf8e3('0x38')]['hasOwnProperty'](_0xf8e3('0x41'))){_0x5b8840[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x25805c[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x5b8840[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x25805c['query'][_0xf8e3('0x23')]);}return _0x1f5a80[_0xf8e3('0x7a')](_0x5b8840);}})[_0xf8e3('0x2b')](function(_0x1a9ba6){if(_0x1a9ba6){return _0x1a9ba6?{'count':_0x1bfe33,'rows':_0x1a9ba6}:null;}})['then'](respondWithResult(_0xc01ac,null))[_0xf8e3('0x4c')](handleError(_0xc01ac,null));};exports[_0xf8e3('0x7d')]=function(_0x3f7c0e,_0x2da8fb,_0x22fa2f){var _0x18fbd2={};var _0x477589={};var _0x1bb12c;var _0x4a5ad8;return db['VoicePrefix'][_0xf8e3('0x7b')]({'where':{'id':_0x3f7c0e[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](handleEntityNotFound(_0x2da8fb,null))[_0xf8e3('0x2b')](function(_0x131625){if(_0x131625){_0x1bb12c=_0x131625;_0x477589[_0xf8e3('0x3b')]=_[_0xf8e3('0x39')](db['Team'][_0xf8e3('0x35')]);_0x477589['query']=_[_0xf8e3('0x39')](_0x3f7c0e[_0xf8e3('0x38')]);_0x477589[_0xf8e3('0x3a')]=_[_0xf8e3('0x3c')](_0x477589['model'],_0x477589[_0xf8e3('0x38')]);_0x18fbd2['attributes']=_['intersection'](_0x477589[_0xf8e3('0x3b')],qs[_0xf8e3('0x3d')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x3d')]));_0x18fbd2['attributes']=_0x18fbd2['attributes'][_0xf8e3('0x3f')]?_0x18fbd2[_0xf8e3('0x3e')]:_0x477589['model'];_0x18fbd2['order']=qs[_0xf8e3('0x43')](_0x3f7c0e[_0xf8e3('0x38')]['sort']);_0x18fbd2[_0xf8e3('0x44')]=qs[_0xf8e3('0x3a')](_[_0xf8e3('0x45')](_0x3f7c0e[_0xf8e3('0x38')],_0x477589[_0xf8e3('0x3a')]));if(_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]){_0x18fbd2['where']=_[_0xf8e3('0x47')](_0x18fbd2[_0xf8e3('0x44')],{'$or':_['map'](_0x18fbd2[_0xf8e3('0x3e')],function(_0x4a8866){var _0x1ca81d={};_0x1ca81d[_0x4a8866]={'$like':'%'+_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x46')]+'%'};return _0x1ca81d;})});}_0x18fbd2=_['merge']({},_0x18fbd2,_0x3f7c0e[_0xf8e3('0x49')]);return _0x1bb12c['getTeams'](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x41ca1b){if(_0x41ca1b){_0x4a5ad8=_0x41ca1b[_0xf8e3('0x3f')];if(!_0x3f7c0e[_0xf8e3('0x38')]['hasOwnProperty']('nolimit')){_0x18fbd2[_0xf8e3('0x25')]=qs[_0xf8e3('0x25')](_0x3f7c0e[_0xf8e3('0x38')][_0xf8e3('0x25')]);_0x18fbd2[_0xf8e3('0x23')]=qs[_0xf8e3('0x23')](_0x3f7c0e['query'][_0xf8e3('0x23')]);}return _0x1bb12c[_0xf8e3('0x7d')](_0x18fbd2);}})[_0xf8e3('0x2b')](function(_0x348e59){if(_0x348e59){return _0x348e59?{'count':_0x4a5ad8,'rows':_0x348e59}:null;}})['then'](respondWithResult(_0x2da8fb,null))[_0xf8e3('0x4c')](handleError(_0x2da8fb,null));};exports['addTeams']=function(_0x3b51c7,_0xf88bb2,_0x4b27e3){var _0x108168=_0x3b51c7['body'][_0xf8e3('0x74')];var _0x3fba66;return db['Team'][_0xf8e3('0x4b')]({'where':{'id':_0x108168},'attributes':['id'],'include':[{'model':db[_0xf8e3('0x7c')],'as':'Agents','attributes':['id',_0xf8e3('0x31'),_0xf8e3('0x7e'),_0xf8e3('0x7f'),_0xf8e3('0x80')],'raw':!![]}]})[_0xf8e3('0x2b')](function(_0x3b79e1){if(_0x3b79e1){_0x3fba66=_0x3b79e1;var _0x13f467=_[_0xf8e3('0x81')](_0x3b79e1,function(_0x29c04b){var _0x271ed0=_0x29c04b[_0xf8e3('0x82')]({'plain':!![]});return _0x271ed0[_0xf8e3('0x83')];});return db['VoicePrefix'][_0xf8e3('0x4f')]({'where':{'id':_0x3b51c7[_0xf8e3('0x50')]['id']}})[_0xf8e3('0x2b')](function(_0x48230e){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x7e83fd){return _0x48230e[_0xf8e3('0x84')](_0x108168,{'transaction':_0x7e83fd})[_0xf8e3('0x2b')](function(){return BPromise[_0xf8e3('0x85')](_0x3fba66,function(_0x6d4c09){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x6d4c09['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},{'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){return BPromise['each'](_0x13f467,function(_0x1a85cf){return db[_0xf8e3('0x86')]['findOrCreate']({'where':{'UserId':_0x1a85cf['id'],'VoicePrefixId':_0x3b51c7[_0xf8e3('0x50')]['id']},'transaction':_0x7e83fd});});})[_0xf8e3('0x2b')](function(){_0x13f467[_0xf8e3('0x87')](function(_0x27d0b6){socket[_0xf8e3('0x78')]('userVoicePrefix:save',{'UserId':_0x27d0b6['id'],'VoicePrefixId':_0x48230e['id']});});});});});}})[_0xf8e3('0x2b')](respondWithStatusCode(_0xf88bb2,null))[_0xf8e3('0x4c')](handleError(_0xf88bb2,null));};exports['removeTeams']=function(_0x4f02bb,_0x237eb6,_0xd9e796){return db[_0xf8e3('0x88')][_0xf8e3('0x4b')]({'where':{'id':_0x4f02bb[_0xf8e3('0x38')][_0xf8e3('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf8e3('0x83'),'attributes':['id'],'raw':!![]}]})[_0xf8e3('0x2b')](handleEntityNotFound(_0x237eb6,null))['then'](function(_0x5ae078){var _0x512d8d=_[_0xf8e3('0x34')](_0x5ae078,'id');var _0x186e42=[];var _0x417af2=[];var _0x29f5d0=squel[_0xf8e3('0x89')]();_0x29f5d0[_0xf8e3('0x8a')](_0xf8e3('0x8b'))['from']('team_has_voice_prefixes','tq')[_0xf8e3('0x8c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf8e3('0x44')](_0xf8e3('0x8d'),_0x4f02bb['params']['id']);for(var _0x1cff32=0x0;_0x1cff32<_0x5ae078[_0xf8e3('0x3f')];_0x1cff32+=0x1){let _0x876d0c=_0x5ae078[_0x1cff32];for(var _0x2c4060=0x0;_0x2c4060<_0x876d0c[_0xf8e3('0x83')][_0xf8e3('0x3f')];_0x2c4060+=0x1){let _0x1b8e99=_0x876d0c[_0xf8e3('0x83')][_0x2c4060];var _0x107896=_0x29f5d0[_0xf8e3('0x8e')]();_0x107896[_0xf8e3('0x44')](_0xf8e3('0x8f'),_0x1b8e99['id']);_0x417af2[_0xf8e3('0x67')](db[_0xf8e3('0x53')][_0xf8e3('0x38')](_0x107896['toString'](),{'type':db[_0xf8e3('0x53')][_0xf8e3('0x90')]['SELECT']})[_0xf8e3('0x2b')](function(_0x4e8329){if(_0x4e8329['length']===0x1){return _0x1b8e99['id'];}else{var _0x5a66ee=_[_0xf8e3('0x91')](_[_0xf8e3('0x34')](_0x4e8329,'TeamId'),function(_0x207393){return _[_0xf8e3('0x92')](_0x512d8d,_0x207393);});if(_0x5a66ee){return _0x1b8e99['id'];}}}));}}return BPromise[_0xf8e3('0x93')](_0x417af2)['then'](function(_0x3a39a8){_0x186e42=_(_0x186e42)[_0xf8e3('0x94')](_0x3a39a8)[_0xf8e3('0x95')]()['value']();return db[_0xf8e3('0x4a')][_0xf8e3('0x4f')]({'where':{'id':_0x4f02bb[_0xf8e3('0x50')]['id']}})['then'](function(_0x42d800){return db[_0xf8e3('0x53')][_0xf8e3('0x54')](function(_0x13782d){return _0x42d800[_0xf8e3('0x96')](_0x4f02bb[_0xf8e3('0x38')]['ids'],{'transaction':_0x13782d})[_0xf8e3('0x2b')](function(){if(!_[_0xf8e3('0x97')](_0x186e42)){return _0x42d800['removeAgents'](_0x186e42,{'transaction':_0x13782d});}})[_0xf8e3('0x2b')](function(){_0x186e42[_0xf8e3('0x87')](function(_0xcf534f){socket[_0xf8e3('0x78')]('userVoicePrefix:remove',{'UserId':_0xcf534f,'VoicePrefixId':_0x42d800['id']});});});});});});})[_0xf8e3('0x2b')](respondWithStatusCode(_0x237eb6,null))['catch'](handleError(_0x237eb6,null));}; \ No newline at end of file +var _0x3de3=['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','redis','localhost','./voicePrefix.socket','register','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','VoicePrefixes','UserProfileResource','destroy','end','error','stack','name','send','index','map','VoicePrefix','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','intersection','find','params','describe','create','transaction','body','get','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','callerIdAll','No\x20callerid\x20available','push','goto','${EXTEN:','charAt','system-','findById','ids','omit','spread','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','emit','getAgents','findOne','User','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto'];(function(_0x21302e,_0x421afd){var _0x596d4a=function(_0x5a1c8a){while(--_0x5a1c8a){_0x21302e['push'](_0x21302e['shift']());}};_0x596d4a(++_0x421afd);}(_0x3de3,0x1ce));var _0x33de=function(_0x33524c,_0x3006c4){_0x33524c=_0x33524c-0x0;var _0x1d4dcd=_0x3de3[_0x33524c];return _0x1d4dcd;};'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'];config[_0x33de('0x19')]=_['defaults'](config[_0x33de('0x19')],{'host':_0x33de('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x33de('0x1b'))[_0x33de('0x1c')](socket);function respondWithStatusCode(_0x2b3748,_0x57a2a1){_0x57a2a1=_0x57a2a1||0xcc;return function(_0x57aa73){if(_0x57aa73){return _0x2b3748[_0x33de('0x1d')](_0x57a2a1);}return _0x2b3748[_0x33de('0x1e')](_0x57a2a1)['end']();};}function respondWithResult(_0x4ff69f,_0x185849){_0x185849=_0x185849||0xc8;return function(_0x16c050){if(_0x16c050){return _0x4ff69f[_0x33de('0x1e')](_0x185849)['json'](_0x16c050);}};}function respondWithFilteredResult(_0x2db887,_0x1203cf){return function(_0x52cfa0){if(_0x52cfa0){var _0x2815a7=typeof _0x1203cf[_0x33de('0x1f')]==='undefined'&&typeof _0x1203cf['limit']===_0x33de('0x20');var _0x52d718=_0x52cfa0[_0x33de('0x21')];var _0x2f0529=_0x2815a7?0x0:_0x1203cf[_0x33de('0x1f')];var _0x315c9b=_0x2815a7?_0x52cfa0[_0x33de('0x21')]:_0x1203cf[_0x33de('0x1f')]+_0x1203cf[_0x33de('0x22')];var _0x493263;if(_0x315c9b>=_0x52d718){_0x315c9b=_0x52d718;_0x493263=0xc8;}else{_0x493263=0xce;}_0x2db887['status'](_0x493263);return _0x2db887[_0x33de('0x23')]('Content-Range',_0x2f0529+'-'+_0x315c9b+'/'+_0x52d718)[_0x33de('0x24')](_0x52cfa0);}return null;};}function patchUpdates(_0x4cd8db){return function(_0x28ed17){try{jsonpatch[_0x33de('0x25')](_0x28ed17,_0x4cd8db,!![]);}catch(_0x575e88){return BPromise[_0x33de('0x26')](_0x575e88);}return _0x28ed17['save']();};}function saveUpdates(_0x67d040,_0x5c602d){return function(_0x62743b){if(_0x62743b){return _0x62743b[_0x33de('0x27')](_0x67d040)[_0x33de('0x28')](function(_0x5b79d7){return _0x5b79d7;});}return null;};}function removeEntity(_0x3bdba4,_0x2d206b){return function(_0x140979){if(_0x140979){return _0x140979['destroy']()[_0x33de('0x28')](function(){var _0x5585a2=_0x140979['get']({'plain':!![]});var _0x1c8de9=_0x33de('0x29');return db[_0x33de('0x2a')][_0x33de('0x2b')]({'where':{'type':_0x1c8de9,'resourceId':_0x5585a2['id']}})[_0x33de('0x28')](function(){return _0x140979;});})[_0x33de('0x28')](function(){_0x3bdba4[_0x33de('0x1e')](0xcc)[_0x33de('0x2c')]();});}};}function handleEntityNotFound(_0x59bc3b,_0x5ae0e8){return function(_0x2755e6){if(!_0x2755e6){_0x59bc3b[_0x33de('0x1d')](0x194);}return _0x2755e6;};}function handleError(_0xaeaec5,_0x451ff5){_0x451ff5=_0x451ff5||0x1f4;return function(_0x167cec){logger[_0x33de('0x2d')](_0x167cec[_0x33de('0x2e')]);if(_0x167cec['name']){delete _0x167cec[_0x33de('0x2f')];}_0xaeaec5[_0x33de('0x1e')](_0x451ff5)[_0x33de('0x30')](_0x167cec);};}exports[_0x33de('0x31')]=function(_0x49e857,_0xe5dc68){var _0xf5d78a={},_0x5a9c43={},_0x5d2da4={'count':0x0,'rows':[]};var _0x57fcf3=_[_0x33de('0x32')](db[_0x33de('0x33')]['rawAttributes'],function(_0x1d0194){return{'name':_0x1d0194['fieldName'],'type':_0x1d0194['type'][_0x33de('0x34')]};});_0x5a9c43[_0x33de('0x35')]=_[_0x33de('0x32')](_0x57fcf3,_0x33de('0x2f'));_0x5a9c43[_0x33de('0x36')]=_[_0x33de('0x37')](_0x49e857[_0x33de('0x36')]);_0x5a9c43[_0x33de('0x38')]=_['intersection'](_0x5a9c43[_0x33de('0x35')],_0x5a9c43['query']);_0xf5d78a[_0x33de('0x39')]=_['intersection'](_0x5a9c43['model'],qs[_0x33de('0x3a')](_0x49e857[_0x33de('0x36')][_0x33de('0x3a')]));_0xf5d78a[_0x33de('0x39')]=_0xf5d78a[_0x33de('0x39')][_0x33de('0x3b')]?_0xf5d78a['attributes']:_0x5a9c43[_0x33de('0x35')];if(!_0x49e857[_0x33de('0x36')][_0x33de('0x3c')](_0x33de('0x3d'))){_0xf5d78a[_0x33de('0x22')]=qs[_0x33de('0x22')](_0x49e857[_0x33de('0x36')]['limit']);_0xf5d78a[_0x33de('0x1f')]=qs[_0x33de('0x1f')](_0x49e857[_0x33de('0x36')][_0x33de('0x1f')]);}_0xf5d78a[_0x33de('0x3e')]=qs[_0x33de('0x3f')](_0x49e857[_0x33de('0x36')]['sort']);_0xf5d78a[_0x33de('0x40')]=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x49e857[_0x33de('0x36')],_0x5a9c43[_0x33de('0x38')]),_0x57fcf3);if(_0x49e857[_0x33de('0x36')]['filter']){_0xf5d78a[_0x33de('0x40')]=_['merge'](_0xf5d78a[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x57fcf3,function(_0x4da2a5){if(_0x4da2a5[_0x33de('0x42')]!==_0x33de('0x43')){var _0x15918c={};_0x15918c[_0x4da2a5[_0x33de('0x2f')]]={'$like':'%'+_0x49e857[_0x33de('0x36')][_0x33de('0x44')]+'%'};return _0x15918c;}})});}_0xf5d78a=_[_0x33de('0x45')]({},_0xf5d78a,_0x49e857[_0x33de('0x46')]);var _0x48e0fc={'where':_0xf5d78a['where']};return db['VoicePrefix'][_0x33de('0x21')](_0x48e0fc)[_0x33de('0x28')](function(_0x20d04f){_0x5d2da4[_0x33de('0x21')]=_0x20d04f;if(_0x49e857['query'][_0x33de('0x47')]){_0xf5d78a['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x33de('0x48')](_0xf5d78a);})[_0x33de('0x28')](function(_0x384b12){_0x5d2da4[_0x33de('0x49')]=_0x384b12;return _0x5d2da4;})[_0x33de('0x28')](respondWithFilteredResult(_0xe5dc68,_0xf5d78a))[_0x33de('0x4a')](handleError(_0xe5dc68,null));};exports[_0x33de('0x4b')]=function(_0x49b067,_0x3b5530){var _0x5de38b={'raw':![],'where':{'id':_0x49b067['params']['id']}},_0x2fbca6={};_0x2fbca6[_0x33de('0x35')]=_[_0x33de('0x37')](db['VoicePrefix'][_0x33de('0x4c')]);_0x2fbca6[_0x33de('0x36')]=_[_0x33de('0x37')](_0x49b067['query']);_0x2fbca6['filters']=_[_0x33de('0x4d')](_0x2fbca6[_0x33de('0x35')],_0x2fbca6['query']);_0x5de38b['attributes']=_[_0x33de('0x4d')](_0x2fbca6['model'],qs['fields'](_0x49b067['query'][_0x33de('0x3a')]));_0x5de38b[_0x33de('0x39')]=_0x5de38b[_0x33de('0x39')][_0x33de('0x3b')]?_0x5de38b['attributes']:_0x2fbca6['model'];if(_0x49b067[_0x33de('0x36')][_0x33de('0x47')]){_0x5de38b['include']=[{'all':!![]}];}_0x5de38b=_[_0x33de('0x45')]({},_0x5de38b,_0x49b067[_0x33de('0x46')]);return db[_0x33de('0x33')][_0x33de('0x4e')](_0x5de38b)[_0x33de('0x28')](handleEntityNotFound(_0x3b5530,null))['then'](respondWithResult(_0x3b5530,null))[_0x33de('0x4a')](handleError(_0x3b5530,null));};exports[_0x33de('0x2b')]=function(_0x4fe3a2,_0x302573){return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x4fe3a2[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x302573,null))[_0x33de('0x28')](removeEntity(_0x302573,null))[_0x33de('0x4a')](handleError(_0x302573,null));};exports[_0x33de('0x50')]=function(_0x24e428,_0x1b4397){return db['VoicePrefix'][_0x33de('0x50')]()[_0x33de('0x28')](respondWithResult(_0x1b4397,null))[_0x33de('0x4a')](handleError(_0x1b4397,null));};exports[_0x33de('0x51')]=function(_0xe6d59,_0x3fe65d){var _0x5c91e7;return db['sequelize'][_0x33de('0x52')](function(_0x32042e){return db[_0x33de('0x33')]['create'](_0xe6d59[_0x33de('0x53')],{'transaction':_0x32042e})[_0x33de('0x28')](function(_0x379224){_0x5c91e7=_0x379224[_0x33de('0x54')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x5c91e7[_0x33de('0x55')]},'raw':!![]})[_0x33de('0x28')](function(_0x232da5){return createVoicePrefixExtensions(_0x5c91e7,_0x232da5,_0x32042e);});});})[_0x33de('0x28')](function(){var _0x379784=_0xe6d59['user']['get']({'plain':!![]});if(!_0x379784)throw new Error(_0x33de('0x56'));if(_0x379784[_0x33de('0x57')]===_0x33de('0x58')){var _0x7112db=_0x5c91e7;return db[_0x33de('0x59')][_0x33de('0x4e')]({'where':{'name':_0x33de('0x29'),'userProfileId':_0x379784[_0x33de('0x5a')]},'raw':!![]})[_0x33de('0x28')](function(_0x5de12f){if(_0x5de12f&&_0x5de12f[_0x33de('0x5b')]===0x0){return db[_0x33de('0x2a')][_0x33de('0x51')]({'name':_0x7112db['name'],'resourceId':_0x7112db['id'],'type':_0x5de12f[_0x33de('0x2f')],'sectionId':_0x5de12f['id']},{})['then'](function(){return _0x5c91e7;});}else{return _0x5c91e7;}})['catch'](function(_0x4dae6d){logger['error'](_0x33de('0x5c'),_0x4dae6d);throw _0x4dae6d;});}return _0x5c91e7;})[_0x33de('0x28')](respondWithResult(_0x3fe65d,null))['catch'](handleError(_0x3fe65d,null));};function Extension(_0x397179,_0x232840,_0x56542f,_0x42c8b9){this[_0x33de('0x5d')]='from-sip';this[_0x33de('0x5e')]=_0x397179;this[_0x33de('0x5f')]=_0x56542f;this[_0x33de('0x42')]=_0x33de('0x60');this[_0x33de('0x61')]=_0x33de('0x62');this[_0x33de('0x63')]=_0x232840;this['appdata']=_0x42c8b9;}function createVoicePrefixExtensions(_0x533863,_0x409e2e,_0x49516d){return new BPromise(function(_0x2af340,_0x3eef03){var _0x4ca20f=new Extension(formatPrefixName(_0x533863[_0x33de('0x64')]),0x1,'NoOp',_0x33de('0x65'));_0x4ca20f[_0x33de('0x66')]=_0x533863['id'];return db['VoiceExtension']['create'](_0x4ca20f,{'transaction':_0x49516d})[_0x33de('0x28')](function(_0x1b2d6f){var _0x17845c=_0x1b2d6f[_0x33de('0x54')]({'plain':!![]});var _0x24d936=_['map'](addVoicePrefixExtensions(_0x533863,_0x409e2e),function(_0x221038){_0x221038[_0x33de('0x55')]=_0x17845c['id'];_0x221038['VoicePrefixId']=_0x533863['id'];return _0x221038;});return db[_0x33de('0x67')][_0x33de('0x68')](_0x24d936,{'transaction':_0x49516d})['then'](function(_0x151551){if(!_0x151551){return _0x3eef03(_0x33de('0x69'));}else{return _0x2af340(_0x151551);}})['catch'](function(_0x4aa203){return _0x3eef03(_0x4aa203);});});;});};function addVoicePrefixExtensions(_0xc2504a,_0x55d7ef){var _0x31a511=[];var _0x4803b8=formatPrefixName(_0xc2504a[_0x33de('0x64')]);_0x31a511['push'](new Extension(_0x4803b8,0x2,'Set','CDR(prefix)='+_0xc2504a['name']));if(_0xc2504a['callerIdAll']){_0x31a511['push'](new Extension(_0x4803b8,0x3,_0x33de('0x6a'),'PREFIX-CALLERIDALL='+_0xc2504a[_0x33de('0x6b')]));}else{_0x31a511['push'](new Extension(_0x4803b8,0x3,'NoOp',_0x33de('0x6c')));}_0x31a511[_0x33de('0x6d')](new Extension(_0x4803b8,0x4,_0x33de('0x6e'),_0x55d7ef[_0x33de('0x5d')]+','+_0x33de('0x6f')+(0x8+_0xc2504a[_0x33de('0x2f')][_0x33de('0x3b')])+'}'+','+0x1));return _0x31a511;}function formatPrefixName(_0x659652){var _0x4893d2='_';for(var _0x297a84=0x0;_0x297a84<_0x659652['length'];_0x297a84++){if(_0x659652[_0x33de('0x70')](_0x297a84)=='-'){_0x4893d2+=_0x659652[_0x33de('0x70')](_0x297a84);}else{_0x4893d2+='['+_0x659652[_0x33de('0x70')](_0x297a84)+']';}}_0x4893d2+='.';return _0x4893d2;}exports[_0x33de('0x27')]=function(_0x8a9729,_0x3f5d52,_0x2a6004){var _0x355b7d=_0x8a9729[_0x33de('0x53')];_0x355b7d[_0x33de('0x64')]=_0x33de('0x71')+_0x355b7d['name']+'-';return db['sequelize'][_0x33de('0x52')](function(_0x1179f6){return db[_0x33de('0x33')][_0x33de('0x27')](_0x355b7d,{'where':{'id':_0x355b7d['id']},'transaction':_0x1179f6})[_0x33de('0x28')](function(){return db[_0x33de('0x67')][_0x33de('0x2b')]({'where':{'VoicePrefixId':_0x355b7d['id']},'transaction':_0x1179f6})[_0x33de('0x28')](function(){return db[_0x33de('0x67')][_0x33de('0x4e')]({'where':{'id':_0x355b7d['VoiceExtensionId']},'raw':!![]})[_0x33de('0x28')](function(_0x43eb19){return createVoicePrefixExtensions(_0x355b7d,_0x43eb19,_0x1179f6);});});});})[_0x33de('0x28')](function(){return db[_0x33de('0x33')][_0x33de('0x72')](_0x355b7d['id']);})[_0x33de('0x28')](respondWithResult(_0x3f5d52,null))['catch'](handleError(_0x3f5d52,null));};exports['addAgents']=function(_0x558c26,_0x1370ac,_0x2d2b02){return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x558c26['params']['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x1370ac,null))[_0x33de('0x28')](function(_0x484827){if(_0x484827){return _0x484827['addAgents'](_0x558c26['body'][_0x33de('0x73')],_[_0x33de('0x74')](_0x558c26[_0x33de('0x53')],[_0x33de('0x73'),'id'])||{})[_0x33de('0x75')](function(_0x545555){for(var _0x2e6389=0x0;_0x2e6389<_0x558c26['body'][_0x33de('0x73')][_0x33de('0x3b')];_0x2e6389+=0x1){socket['emit'](_0x33de('0x76'),{'UserId':Number(_0x558c26[_0x33de('0x53')]['ids'][_0x2e6389]),'VoicePrefixId':Number(_0x558c26[_0x33de('0x4f')]['id'])});}return _0x545555;});}})['then'](respondWithResult(_0x1370ac,null))['catch'](handleError(_0x1370ac,null));};exports[_0x33de('0x77')]=function(_0x2ef94d,_0x3fbbaf,_0x46e3d6){return db[_0x33de('0x33')]['find']({'where':{'id':_0x2ef94d[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x3fbbaf,null))[_0x33de('0x28')](function(_0x1e0637){if(_0x1e0637){return _0x1e0637['removeAgents'](_0x2ef94d[_0x33de('0x36')][_0x33de('0x73')])[_0x33de('0x28')](function(){if(_['isArray'](_0x2ef94d['query']['ids'])){for(var _0x586c51=0x0;_0x586c51<_0x2ef94d['query'][_0x33de('0x73')][_0x33de('0x3b')];_0x586c51+=0x1){socket['emit'](_0x33de('0x78'),{'UserId':Number(_0x2ef94d['query']['ids'][_0x586c51]),'VoicePrefixId':Number(_0x2ef94d[_0x33de('0x4f')]['id'])});}}else{socket[_0x33de('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x2ef94d[_0x33de('0x36')][_0x33de('0x73')]),'VoicePrefixId':Number(_0x2ef94d['params']['id'])});}});}})[_0x33de('0x28')](respondWithStatusCode(_0x3fbbaf,null))['catch'](handleError(_0x3fbbaf,null));};exports[_0x33de('0x7a')]=function(_0x1d060d,_0x487dac,_0x30d749){var _0x2cd94f={};var _0x53ec24={};var _0x4fa42c;var _0x130bbd;return db[_0x33de('0x33')][_0x33de('0x7b')]({'where':{'id':_0x1d060d[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x487dac,null))[_0x33de('0x28')](function(_0x4ef18b){if(_0x4ef18b){_0x4fa42c=_0x4ef18b;_0x53ec24[_0x33de('0x35')]=_[_0x33de('0x37')](db[_0x33de('0x7c')][_0x33de('0x4c')]);_0x53ec24[_0x33de('0x36')]=_[_0x33de('0x37')](_0x1d060d[_0x33de('0x36')]);_0x53ec24[_0x33de('0x38')]=_[_0x33de('0x4d')](_0x53ec24[_0x33de('0x35')],_0x53ec24[_0x33de('0x36')]);_0x2cd94f[_0x33de('0x39')]=_[_0x33de('0x4d')](_0x53ec24[_0x33de('0x35')],qs[_0x33de('0x3a')](_0x1d060d[_0x33de('0x36')]['fields']));_0x2cd94f[_0x33de('0x39')]=_0x2cd94f[_0x33de('0x39')][_0x33de('0x3b')]?_0x2cd94f[_0x33de('0x39')]:_0x53ec24[_0x33de('0x35')];_0x2cd94f['order']=qs[_0x33de('0x3f')](_0x1d060d[_0x33de('0x36')][_0x33de('0x3f')]);_0x2cd94f[_0x33de('0x40')]=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x1d060d[_0x33de('0x36')],_0x53ec24[_0x33de('0x38')]));if(_0x1d060d[_0x33de('0x36')][_0x33de('0x44')]){_0x2cd94f['where']=_['merge'](_0x2cd94f[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x2cd94f[_0x33de('0x39')],function(_0xa0b337){var _0x5b8928={};_0x5b8928[_0xa0b337]={'$like':'%'+_0x1d060d[_0x33de('0x36')][_0x33de('0x44')]+'%'};return _0x5b8928;})});}_0x2cd94f=_[_0x33de('0x45')]({},_0x2cd94f,_0x1d060d['options']);return _0x4fa42c['getAgents'](_0x2cd94f);}})[_0x33de('0x28')](function(_0xe6b940){if(_0xe6b940){_0x130bbd=_0xe6b940[_0x33de('0x3b')];if(!_0x1d060d['query'][_0x33de('0x3c')](_0x33de('0x3d'))){_0x2cd94f[_0x33de('0x22')]=qs['limit'](_0x1d060d[_0x33de('0x36')][_0x33de('0x22')]);_0x2cd94f['offset']=qs[_0x33de('0x1f')](_0x1d060d['query'][_0x33de('0x1f')]);}return _0x4fa42c[_0x33de('0x7a')](_0x2cd94f);}})['then'](function(_0x42546c){if(_0x42546c){return _0x42546c?{'count':_0x130bbd,'rows':_0x42546c}:null;}})[_0x33de('0x28')](respondWithResult(_0x487dac,null))[_0x33de('0x4a')](handleError(_0x487dac,null));};exports['getTeams']=function(_0x52b4e2,_0x48a039,_0xfb0042){var _0x5f46d7={};var _0x5817e3={};var _0x3df0d3;var _0xebf05f;return db[_0x33de('0x33')][_0x33de('0x7b')]({'where':{'id':_0x52b4e2['params']['id']}})[_0x33de('0x28')](handleEntityNotFound(_0x48a039,null))[_0x33de('0x28')](function(_0x27072a){if(_0x27072a){_0x3df0d3=_0x27072a;_0x5817e3['model']=_[_0x33de('0x37')](db[_0x33de('0x7d')][_0x33de('0x4c')]);_0x5817e3[_0x33de('0x36')]=_[_0x33de('0x37')](_0x52b4e2[_0x33de('0x36')]);_0x5817e3[_0x33de('0x38')]=_[_0x33de('0x4d')](_0x5817e3[_0x33de('0x35')],_0x5817e3[_0x33de('0x36')]);_0x5f46d7[_0x33de('0x39')]=_[_0x33de('0x4d')](_0x5817e3[_0x33de('0x35')],qs[_0x33de('0x3a')](_0x52b4e2[_0x33de('0x36')][_0x33de('0x3a')]));_0x5f46d7[_0x33de('0x39')]=_0x5f46d7[_0x33de('0x39')][_0x33de('0x3b')]?_0x5f46d7['attributes']:_0x5817e3[_0x33de('0x35')];_0x5f46d7[_0x33de('0x3e')]=qs[_0x33de('0x3f')](_0x52b4e2[_0x33de('0x36')][_0x33de('0x3f')]);_0x5f46d7['where']=qs[_0x33de('0x38')](_[_0x33de('0x41')](_0x52b4e2[_0x33de('0x36')],_0x5817e3[_0x33de('0x38')]));if(_0x52b4e2[_0x33de('0x36')][_0x33de('0x44')]){_0x5f46d7[_0x33de('0x40')]=_[_0x33de('0x45')](_0x5f46d7[_0x33de('0x40')],{'$or':_[_0x33de('0x32')](_0x5f46d7['attributes'],function(_0x3af223){var _0x258238={};_0x258238[_0x3af223]={'$like':'%'+_0x52b4e2['query'][_0x33de('0x44')]+'%'};return _0x258238;})});}_0x5f46d7=_[_0x33de('0x45')]({},_0x5f46d7,_0x52b4e2['options']);return _0x3df0d3['getTeams'](_0x5f46d7);}})['then'](function(_0x1f1bd4){if(_0x1f1bd4){_0xebf05f=_0x1f1bd4['length'];if(!_0x52b4e2[_0x33de('0x36')][_0x33de('0x3c')]('nolimit')){_0x5f46d7[_0x33de('0x22')]=qs['limit'](_0x52b4e2[_0x33de('0x36')][_0x33de('0x22')]);_0x5f46d7[_0x33de('0x1f')]=qs[_0x33de('0x1f')](_0x52b4e2[_0x33de('0x36')]['offset']);}return _0x3df0d3[_0x33de('0x7e')](_0x5f46d7);}})[_0x33de('0x28')](function(_0x24dcfe){if(_0x24dcfe){return _0x24dcfe?{'count':_0xebf05f,'rows':_0x24dcfe}:null;}})['then'](respondWithResult(_0x48a039,null))[_0x33de('0x4a')](handleError(_0x48a039,null));};exports[_0x33de('0x7f')]=function(_0x24af54,_0x2baee6,_0x56fadb){var _0x5ce00e=_0x24af54[_0x33de('0x53')][_0x33de('0x73')];var _0x2127ab;return db[_0x33de('0x7d')][_0x33de('0x48')]({'where':{'id':_0x5ce00e},'attributes':['id'],'include':[{'model':db[_0x33de('0x7c')],'as':_0x33de('0x80'),'attributes':['id',_0x33de('0x2f'),_0x33de('0x81'),_0x33de('0x82'),_0x33de('0x83')],'raw':!![]}]})[_0x33de('0x28')](function(_0x371e4d){if(_0x371e4d){_0x2127ab=_0x371e4d;var _0x17d367=_[_0x33de('0x84')](_0x371e4d,function(_0x21a70f){var _0x5e11f1=_0x21a70f[_0x33de('0x54')]({'plain':!![]});return _0x5e11f1[_0x33de('0x80')];});return db[_0x33de('0x33')][_0x33de('0x4e')]({'where':{'id':_0x24af54[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](function(_0x5120f5){return db[_0x33de('0x85')][_0x33de('0x52')](function(_0x51b000){return _0x5120f5[_0x33de('0x7f')](_0x5ce00e,{'transaction':_0x51b000})[_0x33de('0x28')](function(){return BPromise[_0x33de('0x86')](_0x2127ab,function(_0x131d87){return db[_0x33de('0x87')][_0x33de('0x88')]({'TeamId':_0x131d87['id'],'VoicePrefixId':_0x24af54[_0x33de('0x4f')]['id']},{'transaction':_0x51b000});});})['then'](function(){return BPromise['each'](_0x17d367,function(_0x446257){return db[_0x33de('0x89')]['findOrCreate']({'where':{'UserId':_0x446257['id'],'VoicePrefixId':_0x24af54[_0x33de('0x4f')]['id']},'transaction':_0x51b000});});})[_0x33de('0x28')](function(){_0x17d367[_0x33de('0x8a')](function(_0xf06806){socket[_0x33de('0x79')]('userVoicePrefix:save',{'UserId':_0xf06806['id'],'VoicePrefixId':_0x5120f5['id']});});});});});}})[_0x33de('0x28')](respondWithStatusCode(_0x2baee6,null))[_0x33de('0x4a')](handleError(_0x2baee6,null));};exports[_0x33de('0x8b')]=function(_0x1f5872,_0x38d880,_0x40758b){return db[_0x33de('0x7d')][_0x33de('0x48')]({'where':{'id':_0x1f5872[_0x33de('0x36')][_0x33de('0x73')]},'attributes':['id'],'include':[{'model':db[_0x33de('0x7c')],'as':_0x33de('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x38d880,null))[_0x33de('0x28')](function(_0xd41b76){var _0x24fa73=_['map'](_0xd41b76,'id');var _0x93313d=[];var _0x3c854d=[];var _0x3e00b7=squel['select']();_0x3e00b7['field'](_0x33de('0x8c'))['from'](_0x33de('0x8d'),'tq')[_0x33de('0x8e')](_0x33de('0x8f'),'ut',_0x33de('0x90'))[_0x33de('0x40')](_0x33de('0x91'),_0x1f5872[_0x33de('0x4f')]['id']);for(var _0x23b8e9=0x0;_0x23b8e9<_0xd41b76[_0x33de('0x3b')];_0x23b8e9+=0x1){let _0x64836b=_0xd41b76[_0x23b8e9];for(var _0x72b745=0x0;_0x72b745<_0x64836b[_0x33de('0x80')]['length'];_0x72b745+=0x1){let _0x4eacef=_0x64836b[_0x33de('0x80')][_0x72b745];var _0x13cd17=_0x3e00b7[_0x33de('0x92')]();_0x13cd17[_0x33de('0x40')]('ut.UserId\x20=\x20?',_0x4eacef['id']);_0x3c854d[_0x33de('0x6d')](db['sequelize']['query'](_0x13cd17[_0x33de('0x93')](),{'type':db[_0x33de('0x85')][_0x33de('0x94')][_0x33de('0x95')]})[_0x33de('0x28')](function(_0x251b71){if(_0x251b71['length']===0x1){return _0x4eacef['id'];}else{var _0x341b23=_[_0x33de('0x96')](_[_0x33de('0x32')](_0x251b71,_0x33de('0x97')),function(_0x29eda7){return _[_0x33de('0x98')](_0x24fa73,_0x29eda7);});if(_0x341b23){return _0x4eacef['id'];}}}));}}return BPromise[_0x33de('0x99')](_0x3c854d)['then'](function(_0x572532){_0x93313d=_(_0x93313d)[_0x33de('0x9a')](_0x572532)[_0x33de('0x9b')]()[_0x33de('0x9c')]();return db[_0x33de('0x33')]['find']({'where':{'id':_0x1f5872[_0x33de('0x4f')]['id']}})[_0x33de('0x28')](function(_0x24edf8){return db['sequelize'][_0x33de('0x52')](function(_0x1ad90f){return _0x24edf8['removeTeams'](_0x1f5872['query'][_0x33de('0x73')],{'transaction':_0x1ad90f})[_0x33de('0x28')](function(){if(!_[_0x33de('0x9d')](_0x93313d)){return _0x24edf8['removeAgents'](_0x93313d,{'transaction':_0x1ad90f});}})[_0x33de('0x28')](function(){_0x93313d[_0x33de('0x8a')](function(_0x4d56df){socket[_0x33de('0x79')](_0x33de('0x78'),{'UserId':_0x4d56df,'VoicePrefixId':_0x24edf8['id']});});});});});});})['then'](respondWithStatusCode(_0x38d880,null))['catch'](handleError(_0x38d880,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index b1e16b2..ec95d0b 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 _0x0361=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x0361,0x190));var _0x1036=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0361[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0x1036('0x0'));var VoicePrefix=require(_0x1036('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1036('0x2')](0x0);var events={'afterCreate':_0x1036('0x3'),'afterUpdate':_0x1036('0x4'),'afterDestroy':_0x1036('0x5')};function emitEvent(_0x357d82){return function(_0x395afb,_0x2bcaa0,_0x116c3f){VoicePrefixEvents[_0x1036('0x6')](_0x357d82+':'+_0x395afb['id'],_0x395afb);VoicePrefixEvents[_0x1036('0x6')](_0x357d82,_0x395afb);_0x116c3f(null);};}for(var e in events){if(events[_0x1036('0x7')](e)){var event=events[e];VoicePrefix[_0x1036('0x8')](e,emitEvent(event));}}module[_0x1036('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x9c03=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x9c03,0x81));var _0x39c0=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9c03[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x39c0('0x0'));var VoicePrefix=require(_0x39c0('0x1'))['db'][_0x39c0('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x39c0('0x3')](0x0);var events={'afterCreate':_0x39c0('0x4'),'afterUpdate':_0x39c0('0x5'),'afterDestroy':_0x39c0('0x6')};function emitEvent(_0x24d835){return function(_0x202978,_0x66d330,_0x1bbd4a){VoicePrefixEvents[_0x39c0('0x7')](_0x24d835+':'+_0x202978['id'],_0x202978);VoicePrefixEvents[_0x39c0('0x7')](_0x24d835,_0x202978);_0x1bbd4a(null);};}for(var e in events){if(events[_0x39c0('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x39c0('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 8cc4c80..fbd276d 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 _0xb21e=['exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','request-promise','../../config/environment'];(function(_0x4de824,_0x29c7c0){var _0x1fd5f7=function(_0xc1aa1e){while(--_0xc1aa1e){_0x4de824['push'](_0x4de824['shift']());}};_0x1fd5f7(++_0x29c7c0);}(_0xb21e,0x109));var _0xeb21=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xb21e[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0xeb21('0x0'));var util=require(_0xeb21('0x1'));var logger=require(_0xeb21('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeb21('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeb21('0x4'));var attributes=require('./voicePrefix.attributes');module[_0xeb21('0x5')]=function(_0x7f055b,_0x4ade45){return _0x7f055b[_0xeb21('0x6')](_0xeb21('0x7'),attributes,{'tableName':_0xeb21('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0e6=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xa0e6,0x14e));var _0x6a0e=function(_0x4d2390,_0x4b72b1){_0x4d2390=_0x4d2390-0x0;var _0x24b4aa=_0xa0e6[_0x4d2390];return _0x24b4aa;};'use strict';var _=require(_0x6a0e('0x0'));var util=require(_0x6a0e('0x1'));var logger=require(_0x6a0e('0x2'))(_0x6a0e('0x3'));var moment=require(_0x6a0e('0x4'));var BPromise=require(_0x6a0e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a0e('0x6'));var rimraf=require(_0x6a0e('0x7'));var config=require(_0x6a0e('0x8'));var attributes=require(_0x6a0e('0x9'));module[_0x6a0e('0xa')]=function(_0x54305a,_0x57660e){return _0x54305a[_0x6a0e('0xb')](_0x6a0e('0xc'),attributes,{'tableName':_0x6a0e('0xd'),'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 b5bd57c..f6a05bd 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 _0x65cb=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x39d3a2,_0x530277){var _0x5d6754=function(_0x48b53f){while(--_0x48b53f){_0x39d3a2['push'](_0x39d3a2['shift']());}};_0x5d6754(++_0x530277);}(_0x65cb,0xa4));var _0xb65c=function(_0x3bb487,_0x54fb9c){_0x3bb487=_0x3bb487-0x0;var _0x1e9fd9=_0x65cb[_0x3bb487];return _0x1e9fd9;};'use strict';var _=require(_0xb65c('0x0'));var util=require('util');var moment=require(_0xb65c('0x1'));var BPromise=require(_0xb65c('0x2'));var rs=require(_0xb65c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb65c('0x4'))['db'];var utils=require(_0xb65c('0x5'));var logger=require(_0xb65c('0x6'))(_0xb65c('0x7'));var config=require(_0xb65c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb65c('0x9')][_0xb65c('0xa')]({'port':0x232a});config[_0xb65c('0xb')]=_[_0xb65c('0xc')](config[_0xb65c('0xb')],{'host':_0xb65c('0xd'),'port':0x18eb});var socket=require(_0xb65c('0xe'))(new Redis(config[_0xb65c('0xb')]));require('./voicePrefix.socket')[_0xb65c('0xf')](socket);function respondWithRpcPromise(_0x2d9bb1,_0x19e32e,_0xd9b29a){return new BPromise(function(_0x5dec0c,_0x131587){return client['request'](_0x2d9bb1,_0xd9b29a)[_0xb65c('0x10')](function(_0x1697b1){logger[_0xb65c('0x11')](_0xb65c('0x12'),_0x19e32e,_0xb65c('0x13'));logger[_0xb65c('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x19e32e,_0xb65c('0x13'),JSON[_0xb65c('0x15')](_0x1697b1));if(_0x1697b1[_0xb65c('0x16')]){if(_0x1697b1[_0xb65c('0x16')][_0xb65c('0x17')]===0x1f4){logger[_0xb65c('0x16')](_0xb65c('0x12'),_0x19e32e,_0x1697b1['error'][_0xb65c('0x18')]);return _0x131587(_0x1697b1[_0xb65c('0x16')]['message']);}logger[_0xb65c('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x19e32e,_0x1697b1[_0xb65c('0x16')][_0xb65c('0x18')]);return _0x5dec0c(_0x1697b1[_0xb65c('0x16')][_0xb65c('0x18')]);}else{logger[_0xb65c('0x11')](_0xb65c('0x12'),_0x19e32e,_0xb65c('0x13'));_0x5dec0c(_0x1697b1[_0xb65c('0x19')][_0xb65c('0x18')]);}})[_0xb65c('0x1a')](function(_0x3fa3bc){logger[_0xb65c('0x16')](_0xb65c('0x12'),_0x19e32e,_0x3fa3bc);_0x131587(_0x3fa3bc);});});} \ No newline at end of file +var _0x5430=['moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util'];(function(_0xc1f074,_0x5d68e3){var _0x51cd4d=function(_0x349fc1){while(--_0x349fc1){_0xc1f074['push'](_0xc1f074['shift']());}};_0x51cd4d(++_0x5d68e3);}(_0x5430,0x10c));var _0x0543=function(_0x5f4655,_0x5923d0){_0x5f4655=_0x5f4655-0x0;var _0x1293d2=_0x5430[_0x5f4655];return _0x1293d2;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var moment=require(_0x0543('0x2'));var BPromise=require(_0x0543('0x3'));var rs=require(_0x0543('0x4'));var fs=require('fs');var Redis=require(_0x0543('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0543('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0543('0x7'));var client=jayson[_0x0543('0x8')][_0x0543('0x9')]({'port':0x232a});config[_0x0543('0xa')]=_[_0x0543('0xb')](config['redis'],{'host':_0x0543('0xc'),'port':0x18eb});var socket=require(_0x0543('0xd'))(new Redis(config[_0x0543('0xa')]));require(_0x0543('0xe'))[_0x0543('0xf')](socket);function respondWithRpcPromise(_0x94b9e7,_0x56003c,_0x1ed7cc){return new BPromise(function(_0x1ac048,_0x52c9b7){return client[_0x0543('0x10')](_0x94b9e7,_0x1ed7cc)[_0x0543('0x11')](function(_0x2bb810){logger[_0x0543('0x12')](_0x0543('0x13'),_0x56003c,_0x0543('0x14'));logger[_0x0543('0x15')](_0x0543('0x16'),_0x56003c,_0x0543('0x14'),JSON[_0x0543('0x17')](_0x2bb810));if(_0x2bb810[_0x0543('0x18')]){if(_0x2bb810[_0x0543('0x18')]['code']===0x1f4){logger[_0x0543('0x18')](_0x0543('0x13'),_0x56003c,_0x2bb810['error']['message']);return _0x52c9b7(_0x2bb810[_0x0543('0x18')][_0x0543('0x19')]);}logger[_0x0543('0x18')](_0x0543('0x13'),_0x56003c,_0x2bb810[_0x0543('0x18')]['message']);return _0x1ac048(_0x2bb810[_0x0543('0x18')][_0x0543('0x19')]);}else{logger[_0x0543('0x12')](_0x0543('0x13'),_0x56003c,_0x0543('0x14'));_0x1ac048(_0x2bb810[_0x0543('0x1a')][_0x0543('0x19')]);}})['catch'](function(_0x37b084){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x56003c,_0x37b084);_0x52c9b7(_0x37b084);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 0b3d15c..0d85fac 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 _0xad8a=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update'];(function(_0x365cb1,_0x101d17){var _0x4c5156=function(_0x4ccaa4){while(--_0x4ccaa4){_0x365cb1['push'](_0x365cb1['shift']());}};_0x4c5156(++_0x101d17);}(_0xad8a,0xb0));var _0xaad8=function(_0x48e8f0,_0xdf9933){_0x48e8f0=_0x48e8f0-0x0;var _0x57c2ae=_0xad8a[_0x48e8f0];return _0x57c2ae;};'use strict';var VoicePrefixEvents=require(_0xaad8('0x0'));var events=[_0xaad8('0x1'),_0xaad8('0x2'),_0xaad8('0x3')];function createListener(_0x158aa2,_0x4848a7){return function(_0x201fbe){_0x4848a7[_0xaad8('0x4')](_0x158aa2,_0x201fbe);};}function removeListener(_0x398fde,_0x58f2c5){return function(){VoicePrefixEvents[_0xaad8('0x5')](_0x398fde,_0x58f2c5);};}exports[_0xaad8('0x6')]=function(_0x22c799){for(var _0xeb5d15=0x0,_0x95aef9=events[_0xaad8('0x7')];_0xeb5d15<_0x95aef9;_0xeb5d15++){var _0x28f3a1=events[_0xeb5d15];var _0xf3a6c7=createListener(_0xaad8('0x8')+_0x28f3a1,_0x22c799);VoicePrefixEvents['on'](_0x28f3a1,_0xf3a6c7);}}; \ No newline at end of file +var _0x8ec7=['voicePrefix:','./voicePrefix.events','save','update','emit','removeListener','register','length'];(function(_0x2168f,_0x389196){var _0x12f192=function(_0x4318ef){while(--_0x4318ef){_0x2168f['push'](_0x2168f['shift']());}};_0x12f192(++_0x389196);}(_0x8ec7,0x1f1));var _0x78ec=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x8ec7[_0xd7b0a4];return _0x184e9e;};'use strict';var VoicePrefixEvents=require(_0x78ec('0x0'));var events=[_0x78ec('0x1'),'remove',_0x78ec('0x2')];function createListener(_0x53115d,_0x47d4c9){return function(_0x1271a1){_0x47d4c9[_0x78ec('0x3')](_0x53115d,_0x1271a1);};}function removeListener(_0x5d3971,_0x207477){return function(){VoicePrefixEvents[_0x78ec('0x4')](_0x5d3971,_0x207477);};}exports[_0x78ec('0x5')]=function(_0x1f4732){for(var _0xef2f90=0x0,_0x5d2780=events[_0x78ec('0x6')];_0xef2f90<_0x5d2780;_0xef2f90++){var _0x4ca55e=events[_0xef2f90];var _0x372108=createListener(_0x78ec('0x7')+_0x4ca55e,_0x1f4732);VoicePrefixEvents['on'](_0x4ca55e,_0x372108);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index c4b5412..7ca35a7 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0xb10b,0x12a));var _0xbb10=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0xb10b[_0x2a0fc4];return _0x531d00;};'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('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=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(_0xab724d,_0x17c711){var _0x4804e4=function(_0x3031a3){while(--_0x3031a3){_0xab724d['push'](_0xab724d['shift']());}};_0x4804e4(++_0x17c711);}(_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'));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 b153fe1..2cb21b6 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 _0x170a=['#AMD\x20Initial\x20Silence','#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)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','inbound','outbound','default','ENUM','ringall','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','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)','#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\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','Active/Disactive\x20AMD'];(function(_0x5e146f,_0x5c04f9){var _0x44ce4d=function(_0xb4744f){while(--_0xb4744f){_0x5e146f['push'](_0x5e146f['shift']());}};_0x44ce4d(++_0x5c04f9);}(_0x170a,0x190));var _0xa170=function(_0xf144bb,_0x197773){_0xf144bb=_0xf144bb-0x0;var _0x559e85=_0x170a[_0xf144bb];return _0x559e85;};'use strict';var Sequelize=require(_0xa170('0x0'));module[_0xa170('0x1')]={'name':{'type':Sequelize[_0xa170('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xa170('0x3'),_0xa170('0x4')),'allowNull':![],'defaultValue':_0xa170('0x3')},'musiconhold':{'type':Sequelize[_0xa170('0x2')],'defaultValue':_0xa170('0x5')},'announce':{'type':Sequelize[_0xa170('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xa170('0x6')]('rr',_0xa170('0x7'),'leastrecent','fewestcalls',_0xa170('0x8'),_0xa170('0x9'),'linear',_0xa170('0xa'),'rrordered'),'allowNull':![],'defaultValue':_0xa170('0x7'),'set':function(_0x216f0c){this[_0xa170('0xb')](_0xa170('0xc'),_0x216f0c?_0x216f0c:_0xa170('0x9'));},'get':function(){var _0x41b90c=this[_0xa170('0xd')]('type');var _0x349ad3=this[_0xa170('0xd')](_0xa170('0xe'));var _0x12e632=this[_0xa170('0xd')](_0xa170('0xc'));if(_0x41b90c===_0xa170('0x4')){if(_0x349ad3===_0xa170('0xf')){return null;}if(_0x349ad3===_0xa170('0x10')&&![_0xa170('0x9'),_0xa170('0x11')][_0xa170('0x12')](_0x12e632)){this[_0xa170('0xb')](_0xa170('0xc'),_0xa170('0x9'));}}return _0x12e632;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa170('0x13')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':_0xa170('0x14')},'autopause':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa170('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xa170('0x6')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xa170('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xa170('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':_0xa170('0x14')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xa170('0x14'),'no',_0xa170('0x15')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa170('0x6')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xa170('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa170('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa170('0x2')]},'queue_youarenext':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa170('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa170('0x2')]},'queue_quantity1':{'type':Sequelize[_0xa170('0x2')]},'queue_quantity2':{'type':Sequelize[_0xa170('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xa170('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xa170('0x16')],'set':function(_0x246cc3){this[_0xa170('0xb')](_0xa170('0x17'),_0x246cc3?_0x246cc3[_0xa170('0x18')](','):[]);},'get':function(){return this[_0xa170('0xd')]('periodic_announce')?this[_0xa170('0xd')](_0xa170('0x17'))[_0xa170('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0xa170('0x2')],'defaultValue':'yes','set':function(_0x32c834){this[_0xa170('0xb')](_0xa170('0x1a'),_0x32c834?_0x32c834[_0xa170('0x18')](','):undefined);},'get':function(){return this[_0xa170('0xd')]('joinempty')?this[_0xa170('0xd')](_0xa170('0x1a'))[_0xa170('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xa170('0x2')],'defaultValue':'no','set':function(_0x58e09e){this[_0xa170('0xb')](_0xa170('0x1b'),_0x58e09e?_0x58e09e[_0xa170('0x18')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this['getDataValue'](_0xa170('0x1b'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa170('0x6')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xa170('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa170('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':0x0,'set':function(_0x402116){this[_0xa170('0xb')](_0xa170('0x1d'),_0x402116);if(_0x402116){if(this['getDataValue'](_0xa170('0x1e'))<0x2){this[_0xa170('0xb')](_0xa170('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa170('0x1f')},'dialMethod':{'type':Sequelize[_0xa170('0x6')]('preview',_0xa170('0x20'),_0xa170('0x21'),'predictive',_0xa170('0x10')),'defaultValue':_0xa170('0x20'),'comment':_0xa170('0x22')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xa170('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa170('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xa170('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa170('0x25')},'dialPowerLevel':{'type':Sequelize[_0xa170('0x26')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x27'),'dropRate'),'defaultValue':_0xa170('0x28'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa170('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa170('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa170('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa170('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xa170('0x2c'),'comment':_0xa170('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x2e')},'dialQueueProject':{'type':Sequelize[_0xa170('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa170('0x23')],'defaultValue':0x3,'comment':_0xa170('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x33')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa170('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa170('0x2')],'defaultValue':_0xa170('0x35')},'dialPrefix':{'type':Sequelize[_0xa170('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x36'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':0x0,'comment':_0xa170('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xa170('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa170('0x38')},'dialAMDGreeting':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa170('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa170('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xa170('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa170('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa170('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa170('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa170('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa170('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa170('0x13')](0x9)[_0xa170('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xa170('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':0x0,'comment':_0xa170('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa170('0x6')](_0xa170('0x40'),_0xa170('0x41')),'defaultValue':_0xa170('0x40')},'dialQueueProject2':{'type':Sequelize[_0xa170('0x2')],'comment':_0xa170('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa170('0x43')},'dialCutDigit':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa170('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa170('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)[_0xa170('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xa170('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa170('0x13')](0x5)[_0xa170('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa170('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xa170('0x49')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17a036){if(!_0x17a036)this[_0xa170('0xb')](_0xa170('0x4a'),null);this[_0xa170('0xb')](_0xa170('0x4b'),_0x17a036);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xa170('0x13')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa170('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0x87b1=['name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','ringall','setDataValue','type','getDataValue','dialMethod','strategy','preview','booked','includes','INTEGER','yes','once','TEXT','periodic_announce','split','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','Dial\x20Method.','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','dropRate','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#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)','ASC','DESC','Random\x20Last\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\x20(min:1,\x20max:999)','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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING'];(function(_0xe1150a,_0x199580){var _0xf98e7c=function(_0x524855){while(--_0x524855){_0xe1150a['push'](_0xe1150a['shift']());}};_0xf98e7c(++_0x199580);}(_0x87b1,0x1ab));var _0x187b=function(_0x28a170,_0x3d378e){_0x28a170=_0x28a170-0x0;var _0x841074=_0x87b1[_0x28a170];return _0x841074;};'use strict';var Sequelize=require(_0x187b('0x0'));module[_0x187b('0x1')]={'name':{'type':Sequelize[_0x187b('0x2')],'allowNull':![],'unique':_0x187b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x5'),_0x187b('0x6')),'allowNull':![],'defaultValue':_0x187b('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x187b('0x7')},'announce':{'type':Sequelize[_0x187b('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x187b('0x4')]('rr','ringall',_0x187b('0x8'),_0x187b('0x9'),_0x187b('0xa'),_0x187b('0xb'),_0x187b('0xc'),_0x187b('0xd'),'rrordered'),'allowNull':![],'defaultValue':_0x187b('0xe'),'set':function(_0x4fd08d){this[_0x187b('0xf')]('strategy',_0x4fd08d?_0x4fd08d:_0x187b('0xb'));},'get':function(){var _0x39d8ac=this['getDataValue'](_0x187b('0x10'));var _0x1afcf2=this[_0x187b('0x11')](_0x187b('0x12'));var _0xd79a03=this[_0x187b('0x11')](_0x187b('0x13'));if(_0x39d8ac==='outbound'){if(_0x1afcf2===_0x187b('0x14')){return null;}if(_0x1afcf2===_0x187b('0x15')&&![_0x187b('0xb'),'roundrobin'][_0x187b('0x16')](_0xd79a03)){this['setDataValue'](_0x187b('0x13'),_0x187b('0xb'));}}return _0xd79a03;}},'servicelevel':{'type':Sequelize[_0x187b('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x187b('0x17')](0xb)},'timeout':{'type':Sequelize[_0x187b('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x187b('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x187b('0x2')]},'weight':{'type':Sequelize[_0x187b('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':_0x187b('0x18')},'autopause':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x187b('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x187b('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x187b('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x187b('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x187b('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x187b('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x187b('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x187b('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x187b('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x187b('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':_0x187b('0x18')},'announce_holdtime':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no',_0x187b('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x187b('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x187b('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x187b('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x187b('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x187b('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x187b('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x187b('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x187b('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x187b('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x187b('0x2')]},'queue_quantity1':{'type':Sequelize[_0x187b('0x2')]},'queue_quantity2':{'type':Sequelize[_0x187b('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x187b('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x187b('0x1a')],'set':function(_0x1ae1f1){this['setDataValue'](_0x187b('0x1b'),_0x1ae1f1?_0x1ae1f1['join'](','):[]);},'get':function(){return this[_0x187b('0x11')](_0x187b('0x1b'))?this[_0x187b('0x11')](_0x187b('0x1b'))[_0x187b('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x187b('0x2')],'defaultValue':'yes','set':function(_0x14a3c6){this[_0x187b('0xf')]('joinempty',_0x14a3c6?_0x14a3c6[_0x187b('0x1d')](','):undefined);},'get':function(){return this[_0x187b('0x11')](_0x187b('0x1e'))?this[_0x187b('0x11')](_0x187b('0x1e'))[_0x187b('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x187b('0x2')],'defaultValue':'no','set':function(_0x530a49){this[_0x187b('0xf')]('leavewhenempty',_0x530a49?_0x530a49[_0x187b('0x1d')](','):undefined);},'get':function(){return this['getDataValue'](_0x187b('0x1f'))?this[_0x187b('0x11')](_0x187b('0x1f'))[_0x187b('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x187b('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x187b('0x20')],'defaultValue':0x0,'set':function(_0x4e9179){this[_0x187b('0xf')](_0x187b('0x21'),_0x4e9179);if(_0x4e9179){if(this['getDataValue'](_0x187b('0x22'))<0x2){this[_0x187b('0xf')](_0x187b('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x187b('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x14'),_0x187b('0x23'),_0x187b('0x24'),'predictive',_0x187b('0x15')),'defaultValue':'progressive','comment':_0x187b('0x25')},'dialLimitChannel':{'type':Sequelize[_0x187b('0x17')](0x4)[_0x187b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x187b('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x187b('0x27')},'dialPowerLevel':{'type':Sequelize[_0x187b('0x28')](0x2)[_0x187b('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x187b('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x2a'),_0x187b('0x2b')),'defaultValue':_0x187b('0x2b'),'comment':_0x187b('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x187b('0x28')](0x2)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x187b('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x187b('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x187b('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x187b('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x187b('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x2f')},'dialQueueOptions':{'type':Sequelize[_0x187b('0x2')],'defaultValue':_0x187b('0x30'),'comment':_0x187b('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x32')},'dialQueueProject':{'type':Sequelize[_0x187b('0x2')],'comment':_0x187b('0x33')},'dialCongestionMaxRetry':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x187b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x187b('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x36')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x187b('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x187b('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x187b('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x187b('0x2')],'defaultValue':_0x187b('0x38')},'dialPrefix':{'type':Sequelize[_0x187b('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x187b('0x4')](_0x187b('0x39'),_0x187b('0x3a'),_0x187b('0x3b')),'defaultValue':_0x187b('0x39')},'dialAMDActive':{'type':Sequelize[_0x187b('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x187b('0x17')](0x9)[_0x187b('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x187b('0x3c')},'dialAMDGreeting':{'type':Sequelize[_0x187b('0x17')](0x9)[_0x187b('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x187b('0x3d')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x187b('0x17')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x187b('0x17')](0x9)[_0x187b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x187b('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x187b('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x187b('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x187b('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x187b('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x187b('0x17')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x187b('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x187b('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x187b('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x187b('0x17')](0x9)[_0x187b('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x187b('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x187b('0x17')](0x5)[_0x187b('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x187b('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x187b('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x187b('0x4')]('DESC',_0x187b('0x45')),'defaultValue':_0x187b('0x46')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x187b('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x187b('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x187b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x187b('0x47')},'dialCutDigit':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x187b('0x17')](0x5)[_0x187b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x187b('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x187b('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x4a')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x187b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x187b('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x187b('0x17')](0x5)[_0x187b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x187b('0x4d')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x4e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x187b('0x17')](0x5)[_0x187b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x187b('0x4f')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x187b('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x187b('0x50')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x187b('0x17')](0x5)[_0x187b('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x187b('0x51')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x187b('0x17')],'allowNull':!![],'comment':_0x187b('0x52')},'mandatoryDisposition':{'type':Sequelize[_0x187b('0x20')],'defaultValue':![],'comment':_0x187b('0x53'),'set':function(_0x2e1e17){if(!_0x2e1e17)this[_0x187b('0xf')](_0x187b('0x54'),null);this[_0x187b('0xf')](_0x187b('0x55'),_0x2e1e17);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x187b('0x17')](0x3)[_0x187b('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index b06f99d..3ddfda2 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 _0x3e74=['phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','into','fromQuery','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','util','lodash','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','end','json','offset','undefined','count','limit','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','UserProfileResource','sendStatus','stack','name','status','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','catch','show','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','clone','params','keys','omit','updatedAt','createdAt','outbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','hasOwnProperty','nolimit','sort','filters','pick','VoiceQueueId','options','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','removeAgents','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','phone','scheduledAt','field','ContactId','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0xa7bcf9,_0x39c50e){var _0x3ce383=function(_0x41e0a7){while(--_0x41e0a7){_0xa7bcf9['push'](_0xa7bcf9['shift']());}};_0x3ce383(++_0x39c50e);}(_0x3e74,0x175));var _0x43e7=function(_0x14653d,_0x1a47b6){_0x14653d=_0x14653d-0x0;var _0x463ed2=_0x3e74[_0x14653d];return _0x463ed2;};'use strict';var moment=require(_0x43e7('0x0'));var BPromise=require('bluebird');var util=require(_0x43e7('0x1'));var _=require(_0x43e7('0x2'));var squel=require(_0x43e7('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0x4'))('api');var config=require(_0x43e7('0x5'));var db=require(_0x43e7('0x6'))['db'];config[_0x43e7('0x7')]=_[_0x43e7('0x8')](config[_0x43e7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x43e7('0x9'))(new Redis(config[_0x43e7('0x7')]));require(_0x43e7('0xa'))[_0x43e7('0xb')](socket);function respondWithStatusCode(_0x21f491,_0x516b4d){_0x516b4d=_0x516b4d||0xcc;return function(_0x212c6c){if(_0x212c6c){return _0x21f491['sendStatus'](_0x516b4d);}return _0x21f491['status'](_0x516b4d)[_0x43e7('0xc')]();};}function respondWithResult(_0x4139c9,_0x5c34f4){_0x5c34f4=_0x5c34f4||0xc8;return function(_0x2803d9){if(_0x2803d9){return _0x4139c9['status'](_0x5c34f4)[_0x43e7('0xd')](_0x2803d9);}};}function respondWithFilteredResult(_0x37302c,_0x4ebc8e){return function(_0x3eb206){if(_0x3eb206){var _0xc960ea=typeof _0x4ebc8e[_0x43e7('0xe')]===_0x43e7('0xf')&&typeof _0x4ebc8e['limit']==='undefined';var _0x2fcb36=_0x3eb206[_0x43e7('0x10')];var _0x44b0bd=_0xc960ea?0x0:_0x4ebc8e['offset'];var _0x5e641c=_0xc960ea?_0x3eb206[_0x43e7('0x10')]:_0x4ebc8e[_0x43e7('0xe')]+_0x4ebc8e[_0x43e7('0x11')];var _0x328445;if(_0x5e641c>=_0x2fcb36){_0x5e641c=_0x2fcb36;_0x328445=0xc8;}else{_0x328445=0xce;}_0x37302c['status'](_0x328445);return _0x37302c['set'](_0x43e7('0x12'),_0x44b0bd+'-'+_0x5e641c+'/'+_0x2fcb36)[_0x43e7('0xd')](_0x3eb206);}return null;};}function saveUpdates(_0x273a32){return function(_0x5d346f){if(_0x5d346f){return _0x5d346f['update'](_0x273a32)[_0x43e7('0x13')](function(_0x1ca758){return _0x1ca758;});}return null;};}function removeEntity(_0x9037d3){return function(_0x140657){if(_0x140657){return _0x140657[_0x43e7('0x14')]()[_0x43e7('0x13')](function(){var _0x619236=_0x140657[_0x43e7('0x15')]({'plain':!![]});var _0x2377a3=[{'name':_0x43e7('0x16'),'value':_0x43e7('0x17'),'ignore':![]},{'name':_0x43e7('0x18'),'value':'outbound','ignore':![]}];var _0xef1a5a=_(_0x2377a3)[_0x43e7('0x19')]('ignore')[_0x43e7('0x1a')](_0x43e7('0x1b'))[_0x43e7('0x1b')]();if(_[_0x43e7('0x1c')](_0xef1a5a,_0x619236[_0x43e7('0x1d')])){return;}var _0x2f4cb4=_['find'](_0x2377a3,[_0x43e7('0x1b'),_0x619236['type']])['name'];return db[_0x43e7('0x1e')][_0x43e7('0x14')]({'where':{'type':_0x2f4cb4,'resourceId':_0x619236['id']}})['then'](function(){return _0x140657;});})[_0x43e7('0x13')](function(){_0x9037d3['status'](0xcc)[_0x43e7('0xc')]();});}};}function handleEntityNotFound(_0x5c5e67){return function(_0x1af208){if(!_0x1af208){_0x5c5e67[_0x43e7('0x1f')](0x194);}return _0x1af208;};}function handleError(_0x20888b,_0x405f85){_0x405f85=_0x405f85||0x1f4;return function(_0x51f4d7){logger['error'](_0x51f4d7[_0x43e7('0x20')]);if(_0x51f4d7['name']){delete _0x51f4d7[_0x43e7('0x21')];}_0x20888b[_0x43e7('0x22')](_0x405f85)[_0x43e7('0x23')](_0x51f4d7);};}exports[_0x43e7('0x24')]=function(_0x5087d7,_0x33a1a5){var _0x4690a6={};var _0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x1a')](db[_0x43e7('0x25')][_0x43e7('0x26')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x27')],'type':_0x31b2a6[_0x43e7('0x1d')][_0x43e7('0x28')]};});_0x4690a6=qs[_0x43e7('0x29')](_0x50f9f5,_0x5087d7);var _0x2bde44={'where':_0x4690a6[_0x43e7('0x2a')]};return db['VoiceQueue'][_0x43e7('0x10')](_0x2bde44)[_0x43e7('0x13')](function(_0x3b8f78){_0x45b675[_0x43e7('0x10')]=_0x3b8f78;_0x4690a6[_0x43e7('0x2b')]=qs['include'](_0x5087d7[_0x43e7('0x2c')]);return db[_0x43e7('0x25')][_0x43e7('0x2d')](_0x4690a6);})[_0x43e7('0x13')](function(_0x4c61b9){_0x45b675['rows']=_0x4c61b9;return _0x45b675;})['then'](respondWithFilteredResult(_0x33a1a5,_0x4690a6))[_0x43e7('0x2e')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x2f')]=function(_0x117c07,_0x234fe6){var _0x108313={'raw':![],'where':{'id':_0x117c07['params']['id']}},_0xde7ed={};_0xde7ed['model']=_['keys'](db['VoiceQueue']['rawAttributes']);_0xde7ed['query']=_['keys'](_0x117c07[_0x43e7('0x2c')]);_0xde7ed['filters']=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],_0xde7ed[_0x43e7('0x2c')]);_0x108313[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x117c07['query']['fields']));_0x108313['attributes']=_0x108313[_0x43e7('0x32')][_0x43e7('0x34')]?_0x108313[_0x43e7('0x32')]:_0xde7ed[_0x43e7('0x31')];if(_0x117c07[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x108313[_0x43e7('0x2b')]=[{'all':!![]}];}_0x108313=_[_0x43e7('0x36')]({},_0x108313,_0x117c07['options']);return db[_0x43e7('0x25')][_0x43e7('0x37')](_0x108313)['then'](handleEntityNotFound(_0x234fe6,null))[_0x43e7('0x13')](respondWithResult(_0x234fe6,null))['catch'](handleError(_0x234fe6,null));};exports[_0x43e7('0x38')]=function(_0x2ad008,_0x1c6f45){return db[_0x43e7('0x25')][_0x43e7('0x38')](_0x2ad008[_0x43e7('0x39')],{})['then'](function(_0x574a93){var _0x30dfa9=_0x2ad008[_0x43e7('0x3a')][_0x43e7('0x15')]({'plain':!![]});if(!_0x30dfa9)throw new Error(_0x43e7('0x3b'));if(_0x30dfa9[_0x43e7('0x3c')]==='user'){var _0x32a451=_0x574a93[_0x43e7('0x15')]({'plain':!![]});var _0x575439=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':_0x43e7('0x18'),'value':'outbound'}];var _0x3d81ae=_[_0x43e7('0x37')](_0x575439,[_0x43e7('0x1b'),_0x32a451[_0x43e7('0x1d')]])['name'];return db['UserProfileSection'][_0x43e7('0x37')]({'where':{'name':_0x3d81ae,'userProfileId':_0x30dfa9[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x36b770){if(_0x36b770&&_0x36b770['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32a451[_0x43e7('0x21')],'resourceId':_0x32a451['id'],'type':_0x36b770['name'],'sectionId':_0x36b770['id']},{})[_0x43e7('0x13')](function(){return _0x574a93;});}else{return _0x574a93;}})['catch'](function(_0x5b28db){logger[_0x43e7('0x3e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b28db);throw _0x5b28db;});}return _0x574a93;})[_0x43e7('0x13')](respondWithResult(_0x1c6f45,0xc9))[_0x43e7('0x2e')](handleError(_0x1c6f45,null));};exports[_0x43e7('0x3f')]=function(_0x99b9e1,_0x4fc5e8){var _0x91f1e4={'where':{'id':_0x99b9e1[_0x43e7('0x40')]['id']}},_0x2b9046={};_0x2b9046[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x25')]['rawAttributes']);_0x91f1e4['attributes']=_[_0x43e7('0x30')](_0x2b9046[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x99b9e1['query']['fields']));_0x91f1e4['attributes']=_0x91f1e4[_0x43e7('0x32')][_0x43e7('0x34')]?_0x91f1e4['attributes']:_0x2b9046[_0x43e7('0x31')];if(_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x91f1e4['include']=[{'all':!![]}];}_0x91f1e4=_['merge']({},_0x91f1e4,_0x99b9e1['options']);return db['VoiceQueue'][_0x43e7('0x37')](_0x91f1e4)[_0x43e7('0x13')](handleEntityNotFound(_0x4fc5e8,null))['then'](function(_0x23e7cb){if(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x15')]({'plain':!![]});_0x82d32f=qs[_0x43e7('0x42')](_0x82d32f,['id','createdAt',_0x43e7('0x43')]);_0x99b9e1['body']=_['omit'](_0x99b9e1[_0x43e7('0x39')],['id',_0x43e7('0x44'),_0x43e7('0x43')]);return db[_0x43e7('0x25')][_0x43e7('0x38')](_[_0x43e7('0x36')](_0x82d32f,_0x99b9e1[_0x43e7('0x39')]),{'include':_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]?[{'all':!![]}]:undefined})[_0x43e7('0x13')](function(_0x58dfd0){var _0x119d34=_0x99b9e1[_0x43e7('0x3a')]['get']({'plain':!![]});if(!_0x119d34)throw new Error(_0x43e7('0x3b'));if(_0x119d34['role']===_0x43e7('0x3a')){var _0x520857=_0x58dfd0[_0x43e7('0x15')]({'plain':!![]});var _0x1f561f=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x43e7('0x45')}];var _0x2ab7ee=_[_0x43e7('0x37')](_0x1f561f,[_0x43e7('0x1b'),_0x520857[_0x43e7('0x1d')]])[_0x43e7('0x21')];return db[_0x43e7('0x46')][_0x43e7('0x37')]({'where':{'name':_0x2ab7ee,'userProfileId':_0x119d34[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x312306){if(_0x312306&&_0x312306['autoAssociation']===0x0){return db[_0x43e7('0x1e')][_0x43e7('0x38')]({'name':_0x520857['name'],'resourceId':_0x520857['id'],'type':_0x312306[_0x43e7('0x21')],'sectionId':_0x312306['id']},{})[_0x43e7('0x13')](function(){return _0x58dfd0;});}else{return _0x58dfd0;}})[_0x43e7('0x2e')](function(_0x558d54){logger['error'](_0x43e7('0x47'),_0x558d54);throw _0x558d54;});}return _0x58dfd0;});}})[_0x43e7('0x13')](respondWithResult(_0x4fc5e8,0xc9))['catch'](handleError(_0x4fc5e8,null));};exports[_0x43e7('0x48')]=function(_0x54506d,_0x49a6ce){if(_0x54506d[_0x43e7('0x39')]['id']){delete _0x54506d[_0x43e7('0x39')]['id'];}return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x54506d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a6ce,null))[_0x43e7('0x13')](saveUpdates(_0x54506d[_0x43e7('0x39')],null))['then'](respondWithResult(_0x49a6ce,null))[_0x43e7('0x2e')](handleError(_0x49a6ce,null));};exports[_0x43e7('0x14')]=function(_0x296a0d,_0x5bb536){return db['VoiceQueue']['find']({'where':{'id':_0x296a0d[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x5bb536,null))[_0x43e7('0x13')](removeEntity(_0x5bb536,null))[_0x43e7('0x2e')](handleError(_0x5bb536,null));};exports['getHoppers']=function(_0x5a50fc,_0x1b27da){var _0x8b50bb={'raw':![],'where':{}};var _0x140438={};var _0x5dd349={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x5a50fc[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1b27da,null))[_0x43e7('0x13')](function(_0x3369b8){if(_0x3369b8){_0x140438[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x4a')][_0x43e7('0x26')]);_0x140438[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x5a50fc['query']);_0x140438['filters']=_[_0x43e7('0x30')](_0x140438['model'],_0x140438['query']);_0x8b50bb['attributes']=_[_0x43e7('0x30')](_0x140438[_0x43e7('0x31')],qs['fields'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x8b50bb[_0x43e7('0x32')]=_0x8b50bb['attributes'][_0x43e7('0x34')]?_0x8b50bb[_0x43e7('0x32')]:_0x140438[_0x43e7('0x31')];if(!_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x8b50bb[_0x43e7('0x11')]=qs['limit'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x8b50bb[_0x43e7('0xe')]=qs['offset'](_0x5a50fc['query'][_0x43e7('0xe')]);}_0x8b50bb['order']=qs['sort'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x8b50bb['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x5a50fc[_0x43e7('0x2c')],_0x140438[_0x43e7('0x4e')]));_0x8b50bb[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x3369b8['id'];if(_0x5a50fc[_0x43e7('0x2c')]['filter']){_0x8b50bb[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x8b50bb['where'],{'$or':_[_0x43e7('0x1a')](_0x8b50bb['attributes'],function(_0x26ee52){var _0x248936={};_0x248936[_0x26ee52]={'$like':'%'+_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x248936;})});}_0x8b50bb=_['merge']({},_0x8b50bb,_0x5a50fc[_0x43e7('0x51')]);return db[_0x43e7('0x4a')][_0x43e7('0x10')]({'where':_0x8b50bb['where']})[_0x43e7('0x13')](function(_0x38fa5b){_0x5dd349[_0x43e7('0x10')]=_0x38fa5b;if(_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x8b50bb['include']=[{'all':!![]}];}return db[_0x43e7('0x4a')][_0x43e7('0x2d')](_0x8b50bb);})[_0x43e7('0x13')](function(_0x2499ef){_0x5dd349[_0x43e7('0x52')]=_0x2499ef;return _0x5dd349;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x1b27da,_0x8b50bb))[_0x43e7('0x2e')](handleError(_0x1b27da,null));};exports['getHopperHistories']=function(_0x499ee9,_0x405faa){var _0x536477={'raw':!![],'where':{}};var _0x550036={};var _0x5b98bf={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x499ee9[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x405faa,null))[_0x43e7('0x13')](function(_0x1ae0c8){if(_0x1ae0c8){_0x550036['model']=_[_0x43e7('0x41')](db[_0x43e7('0x53')][_0x43e7('0x26')]);_0x550036['query']=_[_0x43e7('0x41')](_0x499ee9[_0x43e7('0x2c')]);_0x550036[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x550036[_0x43e7('0x31')],_0x550036[_0x43e7('0x2c')]);_0x536477[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x550036['model'],qs['fields'](_0x499ee9['query'][_0x43e7('0x33')]));_0x536477[_0x43e7('0x32')]=_0x536477['attributes'][_0x43e7('0x34')]?_0x536477[_0x43e7('0x32')]:_0x550036[_0x43e7('0x31')];if(!_0x499ee9[_0x43e7('0x2c')]['hasOwnProperty']('nolimit')){_0x536477['limit']=qs[_0x43e7('0x11')](_0x499ee9[_0x43e7('0x2c')]['limit']);_0x536477['offset']=qs[_0x43e7('0xe')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x536477['order']=qs[_0x43e7('0x4d')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x536477[_0x43e7('0x2a')]=qs['filters'](_[_0x43e7('0x4f')](_0x499ee9['query'],_0x550036[_0x43e7('0x4e')]));_0x536477[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1ae0c8['id'];if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x536477[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x536477['where'],{'$or':_[_0x43e7('0x1a')](_0x536477[_0x43e7('0x32')],function(_0x1aea4e){var _0x6fb694={};_0x6fb694[_0x1aea4e]={'$like':'%'+_0x499ee9['query']['filter']+'%'};return _0x6fb694;})});}_0x536477=_['merge']({},_0x536477,_0x499ee9[_0x43e7('0x51')]);return db['CmHopperHistory'][_0x43e7('0x10')]({'where':_0x536477[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x7387f6){_0x5b98bf[_0x43e7('0x10')]=_0x7387f6;if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x536477[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x53')][_0x43e7('0x2d')](_0x536477);})[_0x43e7('0x13')](function(_0x5b3565){_0x5b98bf[_0x43e7('0x52')]=_0x5b3565;return _0x5b98bf;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x405faa,_0x536477))[_0x43e7('0x2e')](handleError(_0x405faa,null));};exports[_0x43e7('0x54')]=function(_0x206e54,_0x4ea4a9){var _0x5e04ec={'raw':!![],'where':{}};var _0x162a27={};var _0x3e3c82={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x206e54[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ea4a9,null))['then'](function(_0x1e869a){if(_0x1e869a){_0x162a27[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x55')][_0x43e7('0x26')]);_0x162a27['query']=_['keys'](_0x206e54[_0x43e7('0x2c')]);_0x162a27[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],_0x162a27['query']);_0x5e04ec[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x206e54['query'][_0x43e7('0x33')]));_0x5e04ec[_0x43e7('0x32')]=_0x5e04ec[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5e04ec[_0x43e7('0x32')]:_0x162a27['model'];if(!_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0x5e04ec[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5e04ec['offset']=qs[_0x43e7('0xe')](_0x206e54['query'][_0x43e7('0xe')]);}_0x5e04ec[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5e04ec[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x206e54[_0x43e7('0x2c')],_0x162a27['filters']));_0x5e04ec[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1e869a['id'];if(_0x206e54[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x5e04ec['where']=_['merge'](_0x5e04ec[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5e04ec[_0x43e7('0x32')],function(_0x4d30f7){var _0x12e7a8={};_0x12e7a8[_0x4d30f7]={'$like':'%'+_0x206e54['query']['filter']+'%'};return _0x12e7a8;})});}_0x5e04ec=_['merge']({},_0x5e04ec,_0x206e54[_0x43e7('0x51')]);return db['CmHopperFinal'][_0x43e7('0x10')]({'where':_0x5e04ec[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x2fea54){_0x3e3c82[_0x43e7('0x10')]=_0x2fea54;if(_0x206e54['query']['includeAll']){_0x5e04ec[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x55')]['findAll'](_0x5e04ec);})[_0x43e7('0x13')](function(_0x10fd28){_0x3e3c82[_0x43e7('0x52')]=_0x10fd28;return _0x3e3c82;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x4ea4a9,_0x5e04ec))[_0x43e7('0x2e')](handleError(_0x4ea4a9,null));};exports[_0x43e7('0x57')]=function(_0x399253,_0x32e698){var _0x39ce5e={'raw':!![],'where':{}};var _0x284617={};var _0x610819={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x399253[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x32e698,null))[_0x43e7('0x13')](function(_0x3286b1){if(_0x3286b1){_0x284617[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x58')][_0x43e7('0x26')]);_0x284617[_0x43e7('0x2c')]=_['keys'](_0x399253[_0x43e7('0x2c')]);_0x284617[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x284617[_0x43e7('0x31')],_0x284617['query']);_0x39ce5e[_0x43e7('0x32')]=_['intersection'](_0x284617[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x399253[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x39ce5e[_0x43e7('0x32')]=_0x39ce5e[_0x43e7('0x32')]['length']?_0x39ce5e[_0x43e7('0x32')]:_0x284617[_0x43e7('0x31')];if(!_0x399253[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x39ce5e['limit']=qs['limit'](_0x399253[_0x43e7('0x2c')]['limit']);_0x39ce5e[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x399253[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x39ce5e['order']=qs['sort'](_0x399253['query'][_0x43e7('0x4d')]);_0x39ce5e['where']=qs['filters'](_['pick'](_0x399253[_0x43e7('0x2c')],_0x284617[_0x43e7('0x4e')]));_0x39ce5e['where'][_0x43e7('0x50')]=_0x3286b1['id'];if(_0x399253['query'][_0x43e7('0x19')]){_0x39ce5e[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x39ce5e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x39ce5e['attributes'],function(_0x1f4162){var _0x449cb4={};_0x449cb4[_0x1f4162]={'$like':'%'+_0x399253[_0x43e7('0x2c')]['filter']+'%'};return _0x449cb4;})});}_0x39ce5e=_['merge']({},_0x39ce5e,_0x399253[_0x43e7('0x51')]);return db[_0x43e7('0x58')][_0x43e7('0x10')]({'where':_0x39ce5e[_0x43e7('0x2a')]})['then'](function(_0x385cc1){_0x610819[_0x43e7('0x10')]=_0x385cc1;if(_0x399253[_0x43e7('0x2c')]['includeAll']){_0x39ce5e[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x58')][_0x43e7('0x2d')](_0x39ce5e);})[_0x43e7('0x13')](function(_0x541ce8){_0x610819[_0x43e7('0x52')]=_0x541ce8;return _0x610819;});}})['then'](respondWithFilteredResult(_0x32e698,_0x39ce5e))[_0x43e7('0x2e')](handleError(_0x32e698,null));};exports[_0x43e7('0x59')]=function(_0x47f29f,_0x4e5484){var _0xc62dc9={};var _0x1480c6={};var _0x21d001;var _0x4600e5;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x47f29f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x4e5484,null))[_0x43e7('0x13')](function(_0xfc577b){if(_0xfc577b){_0x21d001=_0xfc577b;_0x1480c6[_0x43e7('0x31')]=_['keys'](db[_0x43e7('0x5a')]['rawAttributes']);_0x1480c6[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x47f29f[_0x43e7('0x2c')]);_0x1480c6['filters']=_[_0x43e7('0x30')](_0x1480c6[_0x43e7('0x31')],_0x1480c6[_0x43e7('0x2c')]);_0xc62dc9[_0x43e7('0x32')]=_['intersection'](_0x1480c6[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x47f29f['query']['fields']));_0xc62dc9['attributes']=_0xc62dc9[_0x43e7('0x32')][_0x43e7('0x34')]?_0xc62dc9[_0x43e7('0x32')]:_0x1480c6[_0x43e7('0x31')];_0xc62dc9[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0xc62dc9['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x47f29f[_0x43e7('0x2c')],_0x1480c6[_0x43e7('0x4e')]));if(_0x47f29f['query']['filter']){_0xc62dc9[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0xc62dc9[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0xc62dc9['attributes'],function(_0x2f529b){var _0x427cec={};_0x427cec[_0x2f529b]={'$like':'%'+_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x427cec;})});}_0xc62dc9=_[_0x43e7('0x36')]({},_0xc62dc9,_0x47f29f[_0x43e7('0x51')]);return _0x21d001['getTeams'](_0xc62dc9);}})[_0x43e7('0x13')](function(_0x52c974){if(_0x52c974){_0x4600e5=_0x52c974['length'];if(!_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0xc62dc9['limit']=qs[_0x43e7('0x11')](_0x47f29f[_0x43e7('0x2c')]['limit']);_0xc62dc9[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x21d001['getTeams'](_0xc62dc9);}})['then'](function(_0x2a084b){if(_0x2a084b){return _0x2a084b?{'count':_0x4600e5,'rows':_0x2a084b}:null;}})[_0x43e7('0x13')](respondWithResult(_0x4e5484,null))[_0x43e7('0x2e')](handleError(_0x4e5484,null));};exports['addTeams']=function(_0x49de67,_0x298239){var _0xf682ec=_0x49de67[_0x43e7('0x39')][_0x43e7('0x5b')];var _0x1e247f=_[_0x43e7('0x1a')](_0xf682ec,'id');return db[_0x43e7('0x5a')][_0x43e7('0x2d')]({'where':{'id':_0x1e247f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]}]})[_0x43e7('0x13')](function(_0x44fee0){if(_0x44fee0){var _0x41d130=_[_0x43e7('0x5e')](_0x44fee0,function(_0x5e87d6){var _0x21039a=_0x5e87d6[_0x43e7('0x15')]({'plain':!![]});_0x21039a[_0x43e7('0x5f')][_0x43e7('0x60')](function(_0x59f68a){_0x59f68a[_0x43e7('0x61')]=_[_0x43e7('0x37')](_0xf682ec,{'id':_0x21039a['id']})[_0x43e7('0x61')];});return _0x21039a[_0x43e7('0x5f')];});return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x49de67[_0x43e7('0x40')]['id']}})['then'](function(_0xc9356c){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0x3637d9){return _0xc9356c[_0x43e7('0x64')](_0x1e247f,{'transaction':_0x3637d9})['then'](function(){return BPromise[_0x43e7('0x65')](_0xf682ec,function(_0x25ddf8){return db['TeamVoiceQueue'][_0x43e7('0x66')]({'TeamId':_0x25ddf8['id'],'VoiceQueueId':_0x49de67[_0x43e7('0x40')]['id'],'penalty':_0x25ddf8['penalty']},{'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_0x41d130,function(_0x110154){return db[_0x43e7('0x67')][_0x43e7('0x68')]({'where':{'UserId':_0x110154['id'],'VoiceQueueId':_0x49de67['params']['id']},'defaults':{'penalty':_0x110154[_0x43e7('0x61')]},'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_['filter'](_0x41d130,{'online':!![]}),function(_0x32b788){return db[_0x43e7('0x69')]['upsert']({'membername':_0x32b788[_0x43e7('0x21')],'UserId':_0x32b788['id'],'queue_name':_0xc9356c[_0x43e7('0x21')],'VoiceQueueId':_0xc9356c['id'],'interface':_[_0x43e7('0x6a')](_0x32b788[_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x32b788['name']):_0x32b788[_0x43e7('0x5d')],'paused':_0x32b788[_0x43e7('0x6d')]||![],'penalty':_0x32b788[_0x43e7('0x61')]},{'transaction':_0x3637d9});});})['then'](function(){_0x41d130[_0x43e7('0x60')](function(_0x21901c){socket[_0x43e7('0x6e')](_0x43e7('0x6f'),{'UserId':_0x21901c['id'],'VoiceQueueId':_0xc9356c['id']});});});});});}})[_0x43e7('0x13')](respondWithStatusCode(_0x298239,null))[_0x43e7('0x2e')](handleError(_0x298239,null));};exports[_0x43e7('0x70')]=function(_0x1896b3,_0x4345a5){return db['Team'][_0x43e7('0x2d')]({'where':{'id':_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')]},'attributes':['id'],'include':[{'model':db[_0x43e7('0x72')],'as':_0x43e7('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x43e7('0x13')](handleEntityNotFound(_0x4345a5,null))[_0x43e7('0x13')](function(_0x3e8631){var _0x51e17c=_[_0x43e7('0x1a')](_0x3e8631,'id');var _0x6246c4=[];var _0xd0dca2=[];var _0xa721ba=squel[_0x43e7('0x73')]();_0xa721ba['field'](_0x43e7('0x74'))[_0x43e7('0x75')](_0x43e7('0x76'),'tq')[_0x43e7('0x77')](_0x43e7('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x1896b3[_0x43e7('0x40')]['id']);for(var _0x339826=0x0;_0x339826<_0x3e8631[_0x43e7('0x34')];_0x339826+=0x1){let _0xc28ac6=_0x3e8631[_0x339826];for(var _0x4b0abd=0x0;_0x4b0abd<_0xc28ac6[_0x43e7('0x5f')][_0x43e7('0x34')];_0x4b0abd+=0x1){let _0x41d636=_0xc28ac6[_0x43e7('0x5f')][_0x4b0abd];var _0x19bdf7=_0xa721ba[_0x43e7('0x3f')]();_0x19bdf7[_0x43e7('0x2a')](_0x43e7('0x79'),_0x41d636['id']);_0xd0dca2[_0x43e7('0x7a')](db[_0x43e7('0x62')][_0x43e7('0x2c')](_0x19bdf7['toString'](),{'type':db['sequelize'][_0x43e7('0x7b')]['SELECT']})['then'](function(_0x4a0d5d){if(_0x4a0d5d[_0x43e7('0x34')]===0x1){return _0x41d636['id'];}else{var _0x5eae45=_[_0x43e7('0x7c')](_['map'](_0x4a0d5d,'TeamId'),function(_0x55f1df){return _[_0x43e7('0x1c')](_0x51e17c,_0x55f1df);});if(_0x5eae45){return _0x41d636['id'];}}}));}}return BPromise[_0x43e7('0x7d')](_0xd0dca2)[_0x43e7('0x13')](function(_0xd6ebb0){_0x6246c4=_(_0x6246c4)[_0x43e7('0x7e')](_0xd6ebb0)[_0x43e7('0x7f')]()[_0x43e7('0x1b')]();return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1896b3[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](function(_0x2a1218){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0xe14e67){return _0x2a1218[_0x43e7('0x70')](_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')],{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){if(!_[_0x43e7('0x80')](_0x6246c4)){return _0x2a1218['removeAgents'](_0x6246c4,{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x1896b3[_0x43e7('0x40')]['id'],'UserId':_0x6246c4},'transaction':_0xe14e67});});}})[_0x43e7('0x13')](function(){_0x6246c4[_0x43e7('0x60')](function(_0x32b33c){socket['emit'](_0x43e7('0x81'),{'UserId':_0x32b33c,'VoiceQueueId':_0x2a1218['id']});});});});});});})[_0x43e7('0x13')](respondWithStatusCode(_0x4345a5,null))['catch'](handleError(_0x4345a5,null));};exports[_0x43e7('0x82')]=function(_0x1a520e,_0xb4cf23){var _0x559145,_0x22b824;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1a520e[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0xb4cf23,null))['then'](function(_0x33b63b){if(_0x33b63b){_0x22b824=_0x33b63b;return _0x33b63b[_0x43e7('0x82')](_0x1a520e['body'][_0x43e7('0x71')],_['omit'](_0x1a520e['body'],['ids','id'])||{})['spread'](function(_0x255113){for(var _0x451fb5=0x0;_0x451fb5<_0x1a520e[_0x43e7('0x39')][_0x43e7('0x71')]['length'];_0x451fb5+=0x1){socket['emit'](_0x43e7('0x6f'),{'UserId':Number(_0x1a520e['body'][_0x43e7('0x71')][_0x451fb5]),'VoiceQueueId':Number(_0x1a520e['params']['id'])});}return _0x255113;});}})[_0x43e7('0x13')](function(_0x4cf7e9){_0x559145=_0x4cf7e9||[];if(_0x22b824){return db['User']['findAll']({'where':{'id':_0x1a520e['body'][_0x43e7('0x71')]},'attributes':['id',_0x43e7('0x21'),_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]});}})[_0x43e7('0x13')](function(_0x517289){if(!_['isEmpty'](_0x517289)){var _0x25fd39=[];for(var _0xb2aca0=0x0;_0xb2aca0<_0x517289[_0x43e7('0x34')];_0xb2aca0++){if(_0x517289[_0xb2aca0][_0x43e7('0x5c')]){_0x25fd39['push'](db[_0x43e7('0x69')]['upsert']({'membername':_0x517289[_0xb2aca0][_0x43e7('0x21')],'UserId':_0x517289[_0xb2aca0]['id'],'queue_name':_0x22b824[_0x43e7('0x21')],'VoiceQueueId':_0x22b824['id'],'interface':_[_0x43e7('0x6a')](_0x517289[_0xb2aca0][_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x517289[_0xb2aca0][_0x43e7('0x21')]):_0x517289[_0xb2aca0]['interface'],'paused':_0x517289[_0xb2aca0][_0x43e7('0x6d')]||![],'penalty':_0x1a520e[_0x43e7('0x39')]['penalty']||0x0}));}}return BPromise[_0x43e7('0x7d')](_0x25fd39);}})[_0x43e7('0x13')](function(){return _0x559145;})[_0x43e7('0x13')](respondWithResult(_0xb4cf23,null))[_0x43e7('0x2e')](handleError(_0xb4cf23,null));};exports[_0x43e7('0x83')]=function(_0x4fd17e,_0x3fd573){return db['VoiceQueue'][_0x43e7('0x37')]({'where':{'id':_0x4fd17e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3fd573,null))[_0x43e7('0x13')](function(_0x4446cb){if(_0x4446cb){return _0x4446cb[_0x43e7('0x83')](_0x4fd17e[_0x43e7('0x2c')]['ids'])[_0x43e7('0x13')](function(){if(_['isArray'](_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')])){for(var _0x34d476=0x0;_0x34d476<_0x4fd17e['query'][_0x43e7('0x71')][_0x43e7('0x34')];_0x34d476+=0x1){socket[_0x43e7('0x6e')](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')]['ids'][_0x34d476]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}}else{socket['emit'](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}});}})[_0x43e7('0x13')](function(_0x34ed9e){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x4fd17e[_0x43e7('0x40')]['id'],'UserId':_0x4fd17e['query'][_0x43e7('0x71')]}})[_0x43e7('0x13')](function(){return _0x34ed9e;});})[_0x43e7('0x13')](respondWithStatusCode(_0x3fd573,null))[_0x43e7('0x2e')](handleError(_0x3fd573,null));};exports[_0x43e7('0x84')]=function(_0xf9178f,_0x3bb7ab){var _0x2be8c7={};var _0x2bb14d={};var _0x57f7ea;var _0x240478;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0xf9178f[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bb7ab,null))[_0x43e7('0x13')](function(_0x381e47){if(_0x381e47){_0x57f7ea=_0x381e47;_0x2bb14d['model']=_[_0x43e7('0x41')](db[_0x43e7('0x72')][_0x43e7('0x26')]);_0x2bb14d[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0xf9178f[_0x43e7('0x2c')]);_0x2bb14d[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2bb14d['model'],_0x2bb14d[_0x43e7('0x2c')]);_0x2be8c7[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2bb14d['model'],qs[_0x43e7('0x33')](_0xf9178f[_0x43e7('0x2c')]['fields']));_0x2be8c7[_0x43e7('0x32')]=_0x2be8c7[_0x43e7('0x32')]['length']?_0x2be8c7[_0x43e7('0x32')]:_0x2bb14d[_0x43e7('0x31')];_0x2be8c7[_0x43e7('0x56')]=qs['sort'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x2be8c7['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0xf9178f[_0x43e7('0x2c')],_0x2bb14d[_0x43e7('0x4e')]));if(_0xf9178f['query']['filter']){_0x2be8c7[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x2be8c7[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x2be8c7['attributes'],function(_0x1e6245){var _0x36860d={};_0x36860d[_0x1e6245]={'$like':'%'+_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x36860d;})});}_0x2be8c7=_['merge']({},_0x2be8c7,_0xf9178f[_0x43e7('0x51')]);return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x3ff5d6){if(_0x3ff5d6){_0x240478=_0x3ff5d6[_0x43e7('0x34')];if(!_0xf9178f['query']['hasOwnProperty']('nolimit')){_0x2be8c7[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0xf9178f[_0x43e7('0x2c')]['limit']);_0x2be8c7[_0x43e7('0xe')]=qs['offset'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x249a8d){if(_0x249a8d){return _0x249a8d?{'count':_0x240478,'rows':_0x249a8d}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3bb7ab,null))['catch'](handleError(_0x3bb7ab,null));};exports[_0x43e7('0x85')]=function(_0x202421,_0x12e4a3){var _0x16ca0e={};var _0x2f467b={};var _0x7f43b5;var _0x4637f6;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x202421[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x12e4a3,null))[_0x43e7('0x13')](function(_0x24e9a7){if(_0x24e9a7){_0x7f43b5=_0x24e9a7;_0x2f467b['model']=_[_0x43e7('0x41')](db[_0x43e7('0x69')]['rawAttributes']);_0x2f467b[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x202421['query']);_0x2f467b[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],_0x2f467b['query']);_0x16ca0e['attributes']=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x16ca0e[_0x43e7('0x32')]=_0x16ca0e[_0x43e7('0x32')][_0x43e7('0x34')]?_0x16ca0e['attributes']:_0x2f467b[_0x43e7('0x31')];_0x16ca0e[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x16ca0e[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x202421[_0x43e7('0x2c')],_0x2f467b[_0x43e7('0x4e')]));if(_0x202421[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x16ca0e['where']=_[_0x43e7('0x36')](_0x16ca0e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x16ca0e[_0x43e7('0x32')],function(_0x49f43c){var _0xad02f6={};_0xad02f6[_0x49f43c]={'$like':'%'+_0x202421['query'][_0x43e7('0x19')]+'%'};return _0xad02f6;})});}_0x16ca0e=_['merge']({},_0x16ca0e,_0x202421[_0x43e7('0x51')]);return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})[_0x43e7('0x13')](function(_0x4a500c){if(_0x4a500c){_0x4637f6=_0x4a500c[_0x43e7('0x34')];if(!_0x202421[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x16ca0e['limit']=qs[_0x43e7('0x11')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x16ca0e[_0x43e7('0xe')]=qs['offset'](_0x202421[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})['then'](function(_0x12c4f9){return _0x12c4f9?{'count':_0x4637f6,'rows':_0x12c4f9}:null;})[_0x43e7('0x13')](respondWithResult(_0x12e4a3,null))[_0x43e7('0x2e')](handleError(_0x12e4a3,null));};exports[_0x43e7('0x86')]=function(_0x77c2f,_0x1e4a25){var _0x5790b5={};var _0x3f057e={};var _0x505287;var _0x221938;return db[_0x43e7('0x25')]['findOne']({'where':{'id':_0x77c2f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1e4a25,null))['then'](function(_0x46aa47){if(_0x46aa47){_0x505287=_0x46aa47;_0x3f057e[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x87')]['rawAttributes']);_0x3f057e['query']=_[_0x43e7('0x41')](_0x77c2f[_0x43e7('0x2c')]);_0x3f057e[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x3f057e[_0x43e7('0x31')],_0x3f057e[_0x43e7('0x2c')]);_0x5790b5[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x3f057e['model'],qs[_0x43e7('0x33')](_0x77c2f[_0x43e7('0x2c')]['fields']));_0x5790b5[_0x43e7('0x32')]=_0x5790b5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5790b5[_0x43e7('0x32')]:_0x3f057e[_0x43e7('0x31')];_0x5790b5[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x77c2f['query'][_0x43e7('0x4d')]);_0x5790b5['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x77c2f['query'],_0x3f057e[_0x43e7('0x4e')]));if(_0x77c2f['query'][_0x43e7('0x19')]){_0x5790b5[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5790b5['where'],{'$or':_['map'](_0x5790b5[_0x43e7('0x32')],function(_0xcfecd2){var _0x4cd879={};_0x4cd879[_0xcfecd2]={'$like':'%'+_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x4cd879;})});}_0x5790b5=_[_0x43e7('0x36')]({},_0x5790b5,_0x77c2f['options']);return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0xb2eb62){if(_0xb2eb62){_0x221938=_0xb2eb62['length'];if(!_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x5790b5[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x77c2f[_0x43e7('0x2c')]['limit']);_0x5790b5[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x77c2f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0x34ab5a){if(_0x34ab5a){return _0x34ab5a?{'count':_0x221938,'rows':_0x34ab5a}:null;}})[_0x43e7('0x13')](respondWithResult(_0x1e4a25,null))[_0x43e7('0x2e')](handleError(_0x1e4a25,null));};exports[_0x43e7('0x88')]=function(_0x13133c,_0x288d6a){var _0x47ef9d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x56598f,_0x280668;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x13133c[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x288d6a,null))[_0x43e7('0x13')](function(_0x51dc07){if(_0x51dc07){_0x280668=_0x51dc07;return _0x51dc07['addLists'](_0x13133c[_0x43e7('0x39')][_0x43e7('0x71')],_['omit'](_0x13133c['body'],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x58a783){var _0x3d6659;_0x56598f=_0x58a783||[];var _0x57bcab=[];if(_0x58a783){for(var _0x5f4023=0x0;_0x5f4023<_0x58a783[_0x43e7('0x34')];_0x5f4023+=0x1){var _0x2be66d=_0x58a783[_0x5f4023]['get']({'plain':!![]});_0x280668['dialCheckDuplicateType']=_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]?_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]:_0x280668['dialCheckDuplicateType'];switch(_0x280668[_0x43e7('0x8a')]){case _0x43e7('0x8b'):_0x3d6659=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8d'),'ContactId','ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')]('phone',_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))['field'](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')]['toString']())[_0x43e7('0x2a')]('phone\x20IS\x20NOT\x20NULL')[_0x43e7('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x43e7('0x73')]()['field'](_0x43e7('0x95'))[_0x43e7('0x75')](_0x43e7('0x96'))[_0x43e7('0x2a')](_0x43e7('0x97'),_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]()))[_0x43e7('0x2a')](_0x43e7('0x98'),squel[_0x43e7('0x73')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x43e7('0x99'))['where']('VoiceQueueId\x20=\x20?',_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;case _0x43e7('0x9a'):_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0x99'))[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),'ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel['select']()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))['field'](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))['where'](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e'))['where'](_0x43e7('0x98'),squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x9f'))['from']('cm_hopper')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x13133c['params']['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;default:_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper')[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),'createdAt','updatedAt'],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))['field']('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),'ListId')[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))[_0x43e7('0x75')]('cm_contacts')[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();}_0x57bcab['push'](db['sequelize'][_0x43e7('0x2c')](_0x3d6659));}return BPromise[_0x43e7('0x7d')](_0x57bcab);}})[_0x43e7('0x13')](function(){var _0x3ac223=[];var _0x486780=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0xa1'))[_0x43e7('0x9d')]([_0x43e7('0xa2'),_0x43e7('0x8c'),_0x43e7('0xa3'),'createdAt',_0x43e7('0x43')],squel['select']()['field']('h.id')[_0x43e7('0x8e')](_0x43e7('0xa4'))[_0x43e7('0x8e')](_0x43e7('0xa5'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0xa6'),'ci')['join'](_0x43e7('0x99'),'h',_0x43e7('0xa7'))[_0x43e7('0x2a')](_0x43e7('0xa8'),_0x47ef9d)['where']('ci.ItemClass=?',_0x43e7('0xa9')))[_0x43e7('0x91')]();_0x3ac223['push'](db['sequelize'][_0x43e7('0x2c')](_0x486780));return BPromise[_0x43e7('0x7d')](_0x3ac223);})[_0x43e7('0x13')](function(){return _0x56598f;})[_0x43e7('0x13')](respondWithResult(_0x288d6a,null))[_0x43e7('0x2e')](handleError(_0x288d6a,null));};exports[_0x43e7('0xaa')]=function(_0x71807e,_0x314259){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x71807e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x314259,null))[_0x43e7('0x13')](function(_0x2613fc){if(_0x2613fc){return _0x2613fc[_0x43e7('0xaa')](_0x71807e['query'][_0x43e7('0x71')]);}})['then'](function(_0x17b298){if(_0x17b298){return db[_0x43e7('0x4a')][_0x43e7('0x14')]({'where':{'ListId':_0x71807e[_0x43e7('0x2c')]['ids'],'VoiceQueueId':_0x71807e['params']['id']}})[_0x43e7('0x13')](function(){return _0x17b298;});}})['then'](respondWithStatusCode(_0x314259,null))[_0x43e7('0x2e')](handleError(_0x314259,null));};exports[_0x43e7('0xab')]=function(_0x44c536,_0x3a9550){var _0x5dcd3f={};var _0x2e7f00={};var _0x2627e2;var _0x591517;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x44c536[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3a9550,null))[_0x43e7('0x13')](function(_0x5e042f){if(_0x5e042f){_0x2627e2=_0x5e042f;_0x2e7f00['model']=_[_0x43e7('0x41')](db[_0x43e7('0x87')][_0x43e7('0x26')]);_0x2e7f00[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x44c536[_0x43e7('0x2c')]);_0x2e7f00[_0x43e7('0x4e')]=_['intersection'](_0x2e7f00[_0x43e7('0x31')],_0x2e7f00[_0x43e7('0x2c')]);_0x5dcd3f[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2e7f00[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x5dcd3f[_0x43e7('0x32')]=_0x5dcd3f[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5dcd3f[_0x43e7('0x32')]:_0x2e7f00[_0x43e7('0x31')];_0x5dcd3f[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5dcd3f['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x44c536[_0x43e7('0x2c')],_0x2e7f00[_0x43e7('0x4e')]));if(_0x44c536[_0x43e7('0x2c')]['filter']){_0x5dcd3f[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5dcd3f[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5dcd3f[_0x43e7('0x32')],function(_0x5278fd){var _0x84b4f4={};_0x84b4f4[_0x5278fd]={'$like':'%'+_0x44c536['query']['filter']+'%'};return _0x84b4f4;})});}_0x5dcd3f=_['merge']({},_0x5dcd3f,_0x44c536[_0x43e7('0x51')]);return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x4ee587){if(_0x4ee587){_0x591517=_0x4ee587[_0x43e7('0x34')];if(!_0x44c536[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x5dcd3f[_0x43e7('0x11')]=qs['limit'](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5dcd3f[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x44c536[_0x43e7('0x2c')]['offset']);}return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x3b641e){if(_0x3b641e){return _0x3b641e?{'count':_0x591517,'rows':_0x3b641e}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3a9550,null))[_0x43e7('0x2e')](handleError(_0x3a9550,null));};exports['addBlackLists']=function(_0x5b046d,_0x4a0427){var _0xc3460c;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x5b046d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a0427,null))[_0x43e7('0x13')](function(_0x19c1d2){if(_0x19c1d2){return _0x19c1d2[_0x43e7('0xac')](_0x5b046d['body'][_0x43e7('0x71')],_['omit'](_0x5b046d[_0x43e7('0x39')],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x40cc83){var _0x148d72;_0xc3460c=_0x40cc83||[];var _0x1ceb94=[];if(_0x40cc83){for(var _0x19c29b=0x0;_0x19c29b<_0x40cc83[_0x43e7('0x34')];_0x19c29b+=0x1){var _0x38a8db=_0x40cc83[_0x19c29b]['get']({'plain':!![]});_0x148d72=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper_black')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('id','ContactId')[_0x43e7('0x8e')](_0x38a8db['CmListId'][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x5b046d[_0x43e7('0x40')]['id']['toString'](),_0x43e7('0x50'))[_0x43e7('0x8e')]('NOW()',_0x43e7('0x44'))[_0x43e7('0x8e')](_0x43e7('0xad'),_0x43e7('0x43'))[_0x43e7('0x75')](_0x43e7('0x93'))[_0x43e7('0x2a')]('deletedAt\x20IS\x20NULL')[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x38a8db[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();_0x1ceb94[_0x43e7('0x7a')](db[_0x43e7('0x62')]['query'](_0x148d72));}return BPromise[_0x43e7('0x7d')](_0x1ceb94);}})['then'](function(){return _0xc3460c;})[_0x43e7('0x13')](respondWithResult(_0x4a0427,null))[_0x43e7('0x2e')](handleError(_0x4a0427,null));};exports[_0x43e7('0xae')]=function(_0x1dc579,_0x6d9fb){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1dc579['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x6d9fb,null))['then'](function(_0x59ca95){if(_0x59ca95){return _0x59ca95[_0x43e7('0xae')](_0x1dc579['query']['ids']);}})[_0x43e7('0x13')](function(_0x759eb5){if(_0x759eb5){return db[_0x43e7('0x58')][_0x43e7('0x14')]({'where':{'ListId':_0x1dc579['query'][_0x43e7('0x71')],'VoiceQueueId':_0x1dc579['params']['id']}})[_0x43e7('0x13')](function(){return _0x759eb5;});}})[_0x43e7('0x13')](respondWithStatusCode(_0x6d9fb,null))[_0x43e7('0x2e')](handleError(_0x6d9fb,null));}; \ No newline at end of file +var _0x8ef6=['select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','into','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','VoiceQueues','inbound','outbound','ignore','map','value','find','type','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','getOptions','include','query','findAll','rows','catch','show','model','keys','intersection','attributes','fields','length','merge','options','create','body','user','get','role','QueueCampaigns','UserProfileSection','userProfileId','clone','includeAll','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getHoppers','findOne','CmHopper','filters','hasOwnProperty','order','sort','where','pick','filter','getHopperHistories','CmHopperHistory','nolimit','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids'];(function(_0x505e54,_0x24bc05){var _0x17f538=function(_0x687a0a){while(--_0x687a0a){_0x505e54['push'](_0x505e54['shift']());}};_0x17f538(++_0x24bc05);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5299a3,_0x13df1b){_0x5299a3=_0x5299a3-0x0;var _0x2b9474=_0x8ef6[_0x5299a3];return _0x2b9474;};'use strict';var moment=require(_0x68ef('0x0'));var BPromise=require(_0x68ef('0x1'));var util=require(_0x68ef('0x2'));var _=require(_0x68ef('0x3'));var squel=require(_0x68ef('0x4'));var Redis=require(_0x68ef('0x5'));var qs=require(_0x68ef('0x6'));var logger=require('../../config/logger')(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var db=require(_0x68ef('0x9'))['db'];config[_0x68ef('0xa')]=_['defaults'](config['redis'],{'host':_0x68ef('0xb'),'port':0x18eb});var socket=require(_0x68ef('0xc'))(new Redis(config[_0x68ef('0xa')]));require('./voiceQueue.socket')[_0x68ef('0xd')](socket);function respondWithStatusCode(_0x31007e,_0x1bee73){_0x1bee73=_0x1bee73||0xcc;return function(_0x22ae26){if(_0x22ae26){return _0x31007e[_0x68ef('0xe')](_0x1bee73);}return _0x31007e[_0x68ef('0xf')](_0x1bee73)[_0x68ef('0x10')]();};}function respondWithResult(_0x23da00,_0x1f6747){_0x1f6747=_0x1f6747||0xc8;return function(_0x255c85){if(_0x255c85){return _0x23da00[_0x68ef('0xf')](_0x1f6747)[_0x68ef('0x11')](_0x255c85);}};}function respondWithFilteredResult(_0x582a79,_0x1aa045){return function(_0x46356f){if(_0x46356f){var _0x1e117a=typeof _0x1aa045[_0x68ef('0x12')]===_0x68ef('0x13')&&typeof _0x1aa045[_0x68ef('0x14')]==='undefined';var _0x3b48dd=_0x46356f[_0x68ef('0x15')];var _0x2657c5=_0x1e117a?0x0:_0x1aa045['offset'];var _0x22fe96=_0x1e117a?_0x46356f[_0x68ef('0x15')]:_0x1aa045[_0x68ef('0x12')]+_0x1aa045['limit'];var _0x35493d;if(_0x22fe96>=_0x3b48dd){_0x22fe96=_0x3b48dd;_0x35493d=0xc8;}else{_0x35493d=0xce;}_0x582a79[_0x68ef('0xf')](_0x35493d);return _0x582a79[_0x68ef('0x16')](_0x68ef('0x17'),_0x2657c5+'-'+_0x22fe96+'/'+_0x3b48dd)['json'](_0x46356f);}return null;};}function saveUpdates(_0x2ada1c){return function(_0x54139e){if(_0x54139e){return _0x54139e['update'](_0x2ada1c)[_0x68ef('0x18')](function(_0x404870){return _0x404870;});}return null;};}function removeEntity(_0x4ade0d){return function(_0x527870){if(_0x527870){return _0x527870[_0x68ef('0x19')]()[_0x68ef('0x18')](function(){var _0x318514=_0x527870['get']({'plain':!![]});var _0x1dc49c=[{'name':_0x68ef('0x1a'),'value':_0x68ef('0x1b'),'ignore':![]},{'name':'QueueCampaigns','value':_0x68ef('0x1c'),'ignore':![]}];var _0x3be4c0=_(_0x1dc49c)['filter'](_0x68ef('0x1d'))[_0x68ef('0x1e')](_0x68ef('0x1f'))['value']();if(_['includes'](_0x3be4c0,_0x318514['type'])){return;}var _0x26018d=_[_0x68ef('0x20')](_0x1dc49c,[_0x68ef('0x1f'),_0x318514[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x23')][_0x68ef('0x19')]({'where':{'type':_0x26018d,'resourceId':_0x318514['id']}})[_0x68ef('0x18')](function(){return _0x527870;});})[_0x68ef('0x18')](function(){_0x4ade0d[_0x68ef('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178460){return function(_0x57f9ee){if(!_0x57f9ee){_0x178460['sendStatus'](0x194);}return _0x57f9ee;};}function handleError(_0x55d8b0,_0x1a7ce1){_0x1a7ce1=_0x1a7ce1||0x1f4;return function(_0x268f32){logger[_0x68ef('0x24')](_0x268f32[_0x68ef('0x25')]);if(_0x268f32['name']){delete _0x268f32['name'];}_0x55d8b0[_0x68ef('0xf')](_0x1a7ce1)[_0x68ef('0x26')](_0x268f32);};}exports[_0x68ef('0x27')]=function(_0x263b30,_0x22ef25){var _0x201884={};var _0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x28')][_0x68ef('0x29')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x21')]['key']};});_0x201884=qs[_0x68ef('0x2a')](_0x4579cb,_0x263b30);var _0x17588a={'where':_0x201884['where']};return db['VoiceQueue'][_0x68ef('0x15')](_0x17588a)[_0x68ef('0x18')](function(_0x4b8fc8){_0x26288a[_0x68ef('0x15')]=_0x4b8fc8;_0x201884[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x263b30[_0x68ef('0x2c')]);return db['VoiceQueue'][_0x68ef('0x2d')](_0x201884);})[_0x68ef('0x18')](function(_0x5f137b){_0x26288a[_0x68ef('0x2e')]=_0x5f137b;return _0x26288a;})['then'](respondWithFilteredResult(_0x22ef25,_0x201884))[_0x68ef('0x2f')](handleError(_0x22ef25,null));};exports[_0x68ef('0x30')]=function(_0x4973c2,_0x24c2c9){var _0x4a0763={'raw':![],'where':{'id':_0x4973c2['params']['id']}},_0x38c2f8={};_0x38c2f8[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x28')]['rawAttributes']);_0x38c2f8[_0x68ef('0x2c')]=_['keys'](_0x4973c2[_0x68ef('0x2c')]);_0x38c2f8['filters']=_[_0x68ef('0x33')](_0x38c2f8[_0x68ef('0x31')],_0x38c2f8[_0x68ef('0x2c')]);_0x4a0763[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x38c2f8[_0x68ef('0x31')],qs['fields'](_0x4973c2[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4a0763[_0x68ef('0x34')]=_0x4a0763['attributes'][_0x68ef('0x36')]?_0x4a0763[_0x68ef('0x34')]:_0x38c2f8[_0x68ef('0x31')];if(_0x4973c2['query']['includeAll']){_0x4a0763[_0x68ef('0x2b')]=[{'all':!![]}];}_0x4a0763=_[_0x68ef('0x37')]({},_0x4a0763,_0x4973c2[_0x68ef('0x38')]);return db[_0x68ef('0x28')][_0x68ef('0x20')](_0x4a0763)[_0x68ef('0x18')](handleEntityNotFound(_0x24c2c9,null))[_0x68ef('0x18')](respondWithResult(_0x24c2c9,null))['catch'](handleError(_0x24c2c9,null));};exports[_0x68ef('0x39')]=function(_0xd7f9ca,_0x2f6ee0){return db[_0x68ef('0x28')]['create'](_0xd7f9ca[_0x68ef('0x3a')],{})[_0x68ef('0x18')](function(_0xcf595d){var _0x410c10=_0xd7f9ca[_0x68ef('0x3b')][_0x68ef('0x3c')]({'plain':!![]});if(!_0x410c10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410c10[_0x68ef('0x3d')]===_0x68ef('0x3b')){var _0xf5010c=_0xcf595d[_0x68ef('0x3c')]({'plain':!![]});var _0x449f3c=[{'name':_0x68ef('0x1a'),'value':_0x68ef('0x1b')},{'name':_0x68ef('0x3e'),'value':_0x68ef('0x1c')}];var _0x531096=_[_0x68ef('0x20')](_0x449f3c,[_0x68ef('0x1f'),_0xf5010c[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x3f')][_0x68ef('0x20')]({'where':{'name':_0x531096,'userProfileId':_0x410c10[_0x68ef('0x40')]},'raw':!![]})['then'](function(_0xb3d396){if(_0xb3d396&&_0xb3d396['autoAssociation']===0x0){return db[_0x68ef('0x23')][_0x68ef('0x39')]({'name':_0xf5010c[_0x68ef('0x22')],'resourceId':_0xf5010c['id'],'type':_0xb3d396[_0x68ef('0x22')],'sectionId':_0xb3d396['id']},{})['then'](function(){return _0xcf595d;});}else{return _0xcf595d;}})[_0x68ef('0x2f')](function(_0x5a8231){logger[_0x68ef('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a8231);throw _0x5a8231;});}return _0xcf595d;})[_0x68ef('0x18')](respondWithResult(_0x2f6ee0,0xc9))[_0x68ef('0x2f')](handleError(_0x2f6ee0,null));};exports[_0x68ef('0x41')]=function(_0x5c4a66,_0x59b148){var _0x4044d5={'where':{'id':_0x5c4a66['params']['id']}},_0x399055={};_0x399055['model']=_['keys'](db[_0x68ef('0x28')][_0x68ef('0x29')]);_0x4044d5[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x399055[_0x68ef('0x31')],qs['fields'](_0x5c4a66['query'][_0x68ef('0x35')]));_0x4044d5[_0x68ef('0x34')]=_0x4044d5[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4044d5['attributes']:_0x399055[_0x68ef('0x31')];if(_0x5c4a66[_0x68ef('0x2c')][_0x68ef('0x42')]){_0x4044d5[_0x68ef('0x2b')]=[{'all':!![]}];}_0x4044d5=_['merge']({},_0x4044d5,_0x5c4a66['options']);return db[_0x68ef('0x28')][_0x68ef('0x20')](_0x4044d5)['then'](handleEntityNotFound(_0x59b148,null))[_0x68ef('0x18')](function(_0x12fff3){if(_0x12fff3){var _0x3a82a0=_0x12fff3[_0x68ef('0x3c')]({'plain':!![]});_0x3a82a0=qs[_0x68ef('0x43')](_0x3a82a0,['id','createdAt',_0x68ef('0x44')]);_0x5c4a66[_0x68ef('0x3a')]=_[_0x68ef('0x43')](_0x5c4a66['body'],['id',_0x68ef('0x45'),_0x68ef('0x44')]);return db[_0x68ef('0x28')]['create'](_[_0x68ef('0x37')](_0x3a82a0,_0x5c4a66['body']),{'include':_0x5c4a66['query'][_0x68ef('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x39dd21){var _0xb33afd=_0x5c4a66[_0x68ef('0x3b')][_0x68ef('0x3c')]({'plain':!![]});if(!_0xb33afd)throw new Error(_0x68ef('0x46'));if(_0xb33afd[_0x68ef('0x3d')]===_0x68ef('0x3b')){var _0x1d1d6e=_0x39dd21[_0x68ef('0x3c')]({'plain':!![]});var _0x247915=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x68ef('0x3e'),'value':_0x68ef('0x1c')}];var _0x317b79=_[_0x68ef('0x20')](_0x247915,[_0x68ef('0x1f'),_0x1d1d6e[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x3f')][_0x68ef('0x20')]({'where':{'name':_0x317b79,'userProfileId':_0xb33afd['userProfileId']},'raw':!![]})['then'](function(_0x42a4b2){if(_0x42a4b2&&_0x42a4b2['autoAssociation']===0x0){return db[_0x68ef('0x23')]['create']({'name':_0x1d1d6e[_0x68ef('0x22')],'resourceId':_0x1d1d6e['id'],'type':_0x42a4b2[_0x68ef('0x22')],'sectionId':_0x42a4b2['id']},{})['then'](function(){return _0x39dd21;});}else{return _0x39dd21;}})[_0x68ef('0x2f')](function(_0x4e097e){logger[_0x68ef('0x24')](_0x68ef('0x47'),_0x4e097e);throw _0x4e097e;});}return _0x39dd21;});}})[_0x68ef('0x18')](respondWithResult(_0x59b148,0xc9))[_0x68ef('0x2f')](handleError(_0x59b148,null));};exports[_0x68ef('0x48')]=function(_0x3d81c8,_0x5c347c){if(_0x3d81c8[_0x68ef('0x3a')]['id']){delete _0x3d81c8[_0x68ef('0x3a')]['id'];}return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x3d81c8[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x5c347c,null))['then'](saveUpdates(_0x3d81c8[_0x68ef('0x3a')],null))[_0x68ef('0x18')](respondWithResult(_0x5c347c,null))['catch'](handleError(_0x5c347c,null));};exports[_0x68ef('0x19')]=function(_0x114d9f,_0x3d3087){return db['VoiceQueue'][_0x68ef('0x20')]({'where':{'id':_0x114d9f['params']['id']}})['then'](handleEntityNotFound(_0x3d3087,null))[_0x68ef('0x18')](removeEntity(_0x3d3087,null))['catch'](handleError(_0x3d3087,null));};exports[_0x68ef('0x4a')]=function(_0x47c1d5,_0x100a20){var _0x9e8554={'raw':![],'where':{}};var _0x304405={};var _0x3fbd39={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x47c1d5['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x100a20,null))['then'](function(_0x2cbd99){if(_0x2cbd99){_0x304405['model']=_[_0x68ef('0x32')](db[_0x68ef('0x4c')][_0x68ef('0x29')]);_0x304405[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x47c1d5[_0x68ef('0x2c')]);_0x304405[_0x68ef('0x4d')]=_['intersection'](_0x304405[_0x68ef('0x31')],_0x304405[_0x68ef('0x2c')]);_0x9e8554[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x304405[_0x68ef('0x31')],qs['fields'](_0x47c1d5[_0x68ef('0x2c')]['fields']));_0x9e8554[_0x68ef('0x34')]=_0x9e8554['attributes']['length']?_0x9e8554[_0x68ef('0x34')]:_0x304405[_0x68ef('0x31')];if(!_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x4e')]('nolimit')){_0x9e8554[_0x68ef('0x14')]=qs['limit'](_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x9e8554[_0x68ef('0x12')]=qs['offset'](_0x47c1d5['query'][_0x68ef('0x12')]);}_0x9e8554[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x47c1d5[_0x68ef('0x2c')]['sort']);_0x9e8554[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x47c1d5[_0x68ef('0x2c')],_0x304405['filters']));_0x9e8554[_0x68ef('0x51')]['VoiceQueueId']=_0x2cbd99['id'];if(_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x9e8554[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x9e8554[_0x68ef('0x51')],{'$or':_['map'](_0x9e8554[_0x68ef('0x34')],function(_0x2caed7){var _0x147695={};_0x147695[_0x2caed7]={'$like':'%'+_0x47c1d5['query'][_0x68ef('0x53')]+'%'};return _0x147695;})});}_0x9e8554=_['merge']({},_0x9e8554,_0x47c1d5[_0x68ef('0x38')]);return db['CmHopper']['count']({'where':_0x9e8554[_0x68ef('0x51')]})[_0x68ef('0x18')](function(_0x38c117){_0x3fbd39[_0x68ef('0x15')]=_0x38c117;if(_0x47c1d5['query'][_0x68ef('0x42')]){_0x9e8554[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x4c')]['findAll'](_0x9e8554);})[_0x68ef('0x18')](function(_0x2db826){_0x3fbd39[_0x68ef('0x2e')]=_0x2db826;return _0x3fbd39;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0x100a20,_0x9e8554))[_0x68ef('0x2f')](handleError(_0x100a20,null));};exports[_0x68ef('0x54')]=function(_0x139557,_0xfe72dc){var _0x156ce3={'raw':!![],'where':{}};var _0x11feff={};var _0x454999={'count':0x0,'rows':[]};return db[_0x68ef('0x28')]['findOne']({'where':{'id':_0x139557[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0xfe72dc,null))['then'](function(_0x513c69){if(_0x513c69){_0x11feff[_0x68ef('0x31')]=_['keys'](db[_0x68ef('0x55')][_0x68ef('0x29')]);_0x11feff['query']=_['keys'](_0x139557[_0x68ef('0x2c')]);_0x11feff['filters']=_[_0x68ef('0x33')](_0x11feff['model'],_0x11feff[_0x68ef('0x2c')]);_0x156ce3['attributes']=_[_0x68ef('0x33')](_0x11feff[_0x68ef('0x31')],qs['fields'](_0x139557[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x156ce3[_0x68ef('0x34')]=_0x156ce3[_0x68ef('0x34')]['length']?_0x156ce3[_0x68ef('0x34')]:_0x11feff[_0x68ef('0x31')];if(!_0x139557['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x156ce3[_0x68ef('0x14')]=qs['limit'](_0x139557[_0x68ef('0x2c')]['limit']);_0x156ce3[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x139557['query']['offset']);}_0x156ce3['order']=qs['sort'](_0x139557[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x156ce3[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x139557[_0x68ef('0x2c')],_0x11feff[_0x68ef('0x4d')]));_0x156ce3[_0x68ef('0x51')][_0x68ef('0x57')]=_0x513c69['id'];if(_0x139557[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x156ce3[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x156ce3['where'],{'$or':_[_0x68ef('0x1e')](_0x156ce3['attributes'],function(_0x791181){var _0x5b39a8={};_0x5b39a8[_0x791181]={'$like':'%'+_0x139557['query'][_0x68ef('0x53')]+'%'};return _0x5b39a8;})});}_0x156ce3=_[_0x68ef('0x37')]({},_0x156ce3,_0x139557[_0x68ef('0x38')]);return db[_0x68ef('0x55')]['count']({'where':_0x156ce3['where']})[_0x68ef('0x18')](function(_0x308997){_0x454999[_0x68ef('0x15')]=_0x308997;if(_0x139557['query'][_0x68ef('0x42')]){_0x156ce3[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x55')][_0x68ef('0x2d')](_0x156ce3);})['then'](function(_0x214e89){_0x454999[_0x68ef('0x2e')]=_0x214e89;return _0x454999;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0xfe72dc,_0x156ce3))[_0x68ef('0x2f')](handleError(_0xfe72dc,null));};exports[_0x68ef('0x58')]=function(_0x346049,_0x489ca6){var _0x2a72e8={'raw':!![],'where':{}};var _0x49844f={};var _0xea97f4={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x346049[_0x68ef('0x49')]['id']}})['then'](handleEntityNotFound(_0x489ca6,null))[_0x68ef('0x18')](function(_0x4c47ab){if(_0x4c47ab){_0x49844f[_0x68ef('0x31')]=_[_0x68ef('0x32')](db['CmHopperFinal']['rawAttributes']);_0x49844f[_0x68ef('0x2c')]=_['keys'](_0x346049[_0x68ef('0x2c')]);_0x49844f['filters']=_[_0x68ef('0x33')](_0x49844f[_0x68ef('0x31')],_0x49844f[_0x68ef('0x2c')]);_0x2a72e8[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x49844f[_0x68ef('0x31')],qs['fields'](_0x346049[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x2a72e8[_0x68ef('0x34')]=_0x2a72e8[_0x68ef('0x34')][_0x68ef('0x36')]?_0x2a72e8[_0x68ef('0x34')]:_0x49844f[_0x68ef('0x31')];if(!_0x346049['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x2a72e8[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x346049[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x2a72e8[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x346049[_0x68ef('0x2c')]['offset']);}_0x2a72e8[_0x68ef('0x4f')]=qs['sort'](_0x346049['query']['sort']);_0x2a72e8[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x346049['query'],_0x49844f['filters']));_0x2a72e8['where'][_0x68ef('0x57')]=_0x4c47ab['id'];if(_0x346049[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x2a72e8[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x2a72e8[_0x68ef('0x51')],{'$or':_['map'](_0x2a72e8[_0x68ef('0x34')],function(_0x2c7f18){var _0x1bdacc={};_0x1bdacc[_0x2c7f18]={'$like':'%'+_0x346049[_0x68ef('0x2c')]['filter']+'%'};return _0x1bdacc;})});}_0x2a72e8=_[_0x68ef('0x37')]({},_0x2a72e8,_0x346049[_0x68ef('0x38')]);return db[_0x68ef('0x59')][_0x68ef('0x15')]({'where':_0x2a72e8[_0x68ef('0x51')]})[_0x68ef('0x18')](function(_0x6ca6f4){_0xea97f4[_0x68ef('0x15')]=_0x6ca6f4;if(_0x346049['query'][_0x68ef('0x42')]){_0x2a72e8[_0x68ef('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x68ef('0x2d')](_0x2a72e8);})[_0x68ef('0x18')](function(_0x1b9028){_0xea97f4[_0x68ef('0x2e')]=_0x1b9028;return _0xea97f4;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0x489ca6,_0x2a72e8))[_0x68ef('0x2f')](handleError(_0x489ca6,null));};exports[_0x68ef('0x5a')]=function(_0x2e626c,_0x3b1781){var _0x159169={'raw':!![],'where':{}};var _0x29522c={};var _0x37bf89={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x2e626c[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x3b1781,null))[_0x68ef('0x18')](function(_0x24af15){if(_0x24af15){_0x29522c['model']=_[_0x68ef('0x32')](db[_0x68ef('0x5b')][_0x68ef('0x29')]);_0x29522c[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x2e626c['query']);_0x29522c[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x29522c['model'],_0x29522c[_0x68ef('0x2c')]);_0x159169['attributes']=_['intersection'](_0x29522c['model'],qs['fields'](_0x2e626c[_0x68ef('0x2c')]['fields']));_0x159169[_0x68ef('0x34')]=_0x159169['attributes']['length']?_0x159169['attributes']:_0x29522c[_0x68ef('0x31')];if(!_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x159169[_0x68ef('0x14')]=qs['limit'](_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x159169[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x2e626c['query'][_0x68ef('0x12')]);}_0x159169['order']=qs['sort'](_0x2e626c['query'][_0x68ef('0x50')]);_0x159169[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x2e626c[_0x68ef('0x2c')],_0x29522c[_0x68ef('0x4d')]));_0x159169[_0x68ef('0x51')][_0x68ef('0x57')]=_0x24af15['id'];if(_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x159169[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x159169['where'],{'$or':_['map'](_0x159169['attributes'],function(_0x25e698){var _0x1cad59={};_0x1cad59[_0x25e698]={'$like':'%'+_0x2e626c[_0x68ef('0x2c')]['filter']+'%'};return _0x1cad59;})});}_0x159169=_[_0x68ef('0x37')]({},_0x159169,_0x2e626c['options']);return db[_0x68ef('0x5b')][_0x68ef('0x15')]({'where':_0x159169[_0x68ef('0x51')]})['then'](function(_0x304260){_0x37bf89[_0x68ef('0x15')]=_0x304260;if(_0x2e626c['query'][_0x68ef('0x42')]){_0x159169[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x5b')][_0x68ef('0x2d')](_0x159169);})[_0x68ef('0x18')](function(_0x23126a){_0x37bf89[_0x68ef('0x2e')]=_0x23126a;return _0x37bf89;});}})['then'](respondWithFilteredResult(_0x3b1781,_0x159169))[_0x68ef('0x2f')](handleError(_0x3b1781,null));};exports[_0x68ef('0x5c')]=function(_0x5a262d,_0x28cad4){var _0x424e46={};var _0x46c87e={};var _0x20a131;var _0x1b8250;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x5a262d['params']['id']}})['then'](handleEntityNotFound(_0x28cad4,null))[_0x68ef('0x18')](function(_0x4dcf9e){if(_0x4dcf9e){_0x20a131=_0x4dcf9e;_0x46c87e[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x5d')][_0x68ef('0x29')]);_0x46c87e[_0x68ef('0x2c')]=_['keys'](_0x5a262d[_0x68ef('0x2c')]);_0x46c87e[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x46c87e[_0x68ef('0x31')],_0x46c87e['query']);_0x424e46['attributes']=_[_0x68ef('0x33')](_0x46c87e[_0x68ef('0x31')],qs[_0x68ef('0x35')](_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x424e46[_0x68ef('0x34')]=_0x424e46[_0x68ef('0x34')][_0x68ef('0x36')]?_0x424e46[_0x68ef('0x34')]:_0x46c87e[_0x68ef('0x31')];_0x424e46[_0x68ef('0x4f')]=qs['sort'](_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x424e46[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x5a262d[_0x68ef('0x2c')],_0x46c87e[_0x68ef('0x4d')]));if(_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x424e46[_0x68ef('0x51')]=_['merge'](_0x424e46['where'],{'$or':_[_0x68ef('0x1e')](_0x424e46[_0x68ef('0x34')],function(_0x3ef9e2){var _0x12ef69={};_0x12ef69[_0x3ef9e2]={'$like':'%'+_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x53')]+'%'};return _0x12ef69;})});}_0x424e46=_[_0x68ef('0x37')]({},_0x424e46,_0x5a262d['options']);return _0x20a131[_0x68ef('0x5c')](_0x424e46);}})[_0x68ef('0x18')](function(_0x11c717){if(_0x11c717){_0x1b8250=_0x11c717[_0x68ef('0x36')];if(!_0x5a262d['query'][_0x68ef('0x4e')]('nolimit')){_0x424e46[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x5a262d[_0x68ef('0x2c')]['limit']);_0x424e46['offset']=qs[_0x68ef('0x12')](_0x5a262d['query'][_0x68ef('0x12')]);}return _0x20a131['getTeams'](_0x424e46);}})[_0x68ef('0x18')](function(_0x426274){if(_0x426274){return _0x426274?{'count':_0x1b8250,'rows':_0x426274}:null;}})['then'](respondWithResult(_0x28cad4,null))['catch'](handleError(_0x28cad4,null));};exports[_0x68ef('0x5e')]=function(_0x1d429a,_0x4d96a9){var _0xf9f2c4=_0x1d429a[_0x68ef('0x3a')][_0x68ef('0x5f')];var _0x4ae311=_['map'](_0xf9f2c4,'id');return db[_0x68ef('0x5d')]['findAll']({'where':{'id':_0x4ae311},'attributes':['id'],'include':[{'model':db[_0x68ef('0x60')],'as':_0x68ef('0x61'),'attributes':['id',_0x68ef('0x22'),_0x68ef('0x62'),_0x68ef('0x63'),_0x68ef('0x64')],'raw':!![]}]})['then'](function(_0x48f3f6){if(_0x48f3f6){var _0x453f91=_[_0x68ef('0x65')](_0x48f3f6,function(_0x8eb711){var _0x39ab6a=_0x8eb711[_0x68ef('0x3c')]({'plain':!![]});_0x39ab6a['Agents'][_0x68ef('0x66')](function(_0x428fd5){_0x428fd5[_0x68ef('0x67')]=_[_0x68ef('0x20')](_0xf9f2c4,{'id':_0x39ab6a['id']})[_0x68ef('0x67')];});return _0x39ab6a[_0x68ef('0x61')];});return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x1d429a['params']['id']}})[_0x68ef('0x18')](function(_0x261ce6){return db[_0x68ef('0x68')][_0x68ef('0x69')](function(_0x2138cd){return _0x261ce6[_0x68ef('0x5e')](_0x4ae311,{'transaction':_0x2138cd})['then'](function(){return BPromise[_0x68ef('0x6a')](_0xf9f2c4,function(_0x13fae2){return db[_0x68ef('0x6b')][_0x68ef('0x6c')]({'TeamId':_0x13fae2['id'],'VoiceQueueId':_0x1d429a[_0x68ef('0x49')]['id'],'penalty':_0x13fae2['penalty']},{'transaction':_0x2138cd});});})[_0x68ef('0x18')](function(){return BPromise[_0x68ef('0x6a')](_0x453f91,function(_0x5d156e){return db['UserVoiceQueue'][_0x68ef('0x6d')]({'where':{'UserId':_0x5d156e['id'],'VoiceQueueId':_0x1d429a[_0x68ef('0x49')]['id']},'defaults':{'penalty':_0x5d156e[_0x68ef('0x67')]},'transaction':_0x2138cd});});})['then'](function(){return BPromise['each'](_[_0x68ef('0x53')](_0x453f91,{'online':!![]}),function(_0x10a3f9){return db[_0x68ef('0x6e')][_0x68ef('0x6c')]({'membername':_0x10a3f9[_0x68ef('0x22')],'UserId':_0x10a3f9['id'],'queue_name':_0x261ce6[_0x68ef('0x22')],'VoiceQueueId':_0x261ce6['id'],'interface':_[_0x68ef('0x6f')](_0x10a3f9[_0x68ef('0x64')])?util[_0x68ef('0x70')](_0x68ef('0x71'),_0x10a3f9[_0x68ef('0x22')]):_0x10a3f9[_0x68ef('0x64')],'paused':_0x10a3f9[_0x68ef('0x63')]||![],'penalty':_0x10a3f9[_0x68ef('0x67')]},{'transaction':_0x2138cd});});})['then'](function(){_0x453f91['forEach'](function(_0x503219){socket[_0x68ef('0x72')](_0x68ef('0x73'),{'UserId':_0x503219['id'],'VoiceQueueId':_0x261ce6['id']});});});});});}})[_0x68ef('0x18')](respondWithStatusCode(_0x4d96a9,null))['catch'](handleError(_0x4d96a9,null));};exports[_0x68ef('0x74')]=function(_0x3713e0,_0x5af5d0){return db['Team'][_0x68ef('0x2d')]({'where':{'id':_0x3713e0[_0x68ef('0x2c')][_0x68ef('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68ef('0x61'),'attributes':['id'],'raw':!![]}]})[_0x68ef('0x18')](handleEntityNotFound(_0x5af5d0,null))[_0x68ef('0x18')](function(_0x48959f){var _0x1bb11f=_['map'](_0x48959f,'id');var _0x211d51=[];var _0x3e37e3=[];var _0x5168cd=squel[_0x68ef('0x76')]();_0x5168cd[_0x68ef('0x77')](_0x68ef('0x78'))[_0x68ef('0x79')](_0x68ef('0x7a'),'tq')[_0x68ef('0x7b')](_0x68ef('0x7c'),'ut',_0x68ef('0x7d'))[_0x68ef('0x51')]('VoiceQueueId\x20=\x20?',_0x3713e0[_0x68ef('0x49')]['id']);for(var _0x121a0f=0x0;_0x121a0f<_0x48959f[_0x68ef('0x36')];_0x121a0f+=0x1){let _0x465198=_0x48959f[_0x121a0f];for(var _0x3e3775=0x0;_0x3e3775<_0x465198[_0x68ef('0x61')][_0x68ef('0x36')];_0x3e3775+=0x1){let _0x4906d2=_0x465198['Agents'][_0x3e3775];var _0x1e8577=_0x5168cd['clone']();_0x1e8577[_0x68ef('0x51')](_0x68ef('0x7e'),_0x4906d2['id']);_0x3e37e3[_0x68ef('0x7f')](db[_0x68ef('0x68')]['query'](_0x1e8577[_0x68ef('0x80')](),{'type':db[_0x68ef('0x68')][_0x68ef('0x81')]['SELECT']})[_0x68ef('0x18')](function(_0xe82f3a){if(_0xe82f3a['length']===0x1){return _0x4906d2['id'];}else{var _0x3c3933=_[_0x68ef('0x82')](_['map'](_0xe82f3a,'TeamId'),function(_0x522ef7){return _[_0x68ef('0x83')](_0x1bb11f,_0x522ef7);});if(_0x3c3933){return _0x4906d2['id'];}}}));}}return BPromise[_0x68ef('0x84')](_0x3e37e3)[_0x68ef('0x18')](function(_0x3e92e0){_0x211d51=_(_0x211d51)[_0x68ef('0x85')](_0x3e92e0)[_0x68ef('0x86')]()[_0x68ef('0x1f')]();return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x3713e0['params']['id']}})[_0x68ef('0x18')](function(_0x62a830){return db['sequelize'][_0x68ef('0x69')](function(_0x2374fa){return _0x62a830[_0x68ef('0x74')](_0x3713e0['query'][_0x68ef('0x75')],{'transaction':_0x2374fa})['then'](function(){if(!_[_0x68ef('0x87')](_0x211d51)){return _0x62a830[_0x68ef('0x88')](_0x211d51,{'transaction':_0x2374fa})[_0x68ef('0x18')](function(){return db[_0x68ef('0x6e')][_0x68ef('0x19')]({'where':{'VoiceQueueId':_0x3713e0[_0x68ef('0x49')]['id'],'UserId':_0x211d51},'transaction':_0x2374fa});});}})[_0x68ef('0x18')](function(){_0x211d51[_0x68ef('0x66')](function(_0x491464){socket[_0x68ef('0x72')](_0x68ef('0x89'),{'UserId':_0x491464,'VoiceQueueId':_0x62a830['id']});});});});});});})['then'](respondWithStatusCode(_0x5af5d0,null))[_0x68ef('0x2f')](handleError(_0x5af5d0,null));};exports[_0x68ef('0x8a')]=function(_0x430ef5,_0x1d3499){var _0x2b1686,_0x51c52b;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x430ef5[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x1d3499,null))[_0x68ef('0x18')](function(_0x5548b1){if(_0x5548b1){_0x51c52b=_0x5548b1;return _0x5548b1[_0x68ef('0x8a')](_0x430ef5['body']['ids'],_[_0x68ef('0x43')](_0x430ef5[_0x68ef('0x3a')],[_0x68ef('0x75'),'id'])||{})[_0x68ef('0x8b')](function(_0x32e1e3){for(var _0x150e0d=0x0;_0x150e0d<_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')]['length'];_0x150e0d+=0x1){socket[_0x68ef('0x72')](_0x68ef('0x73'),{'UserId':Number(_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')][_0x150e0d]),'VoiceQueueId':Number(_0x430ef5[_0x68ef('0x49')]['id'])});}return _0x32e1e3;});}})[_0x68ef('0x18')](function(_0x39302e){_0x2b1686=_0x39302e||[];if(_0x51c52b){return db[_0x68ef('0x60')][_0x68ef('0x2d')]({'where':{'id':_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')]},'attributes':['id',_0x68ef('0x22'),'online',_0x68ef('0x63'),_0x68ef('0x64')],'raw':!![]});}})[_0x68ef('0x18')](function(_0xe4c314){if(!_['isEmpty'](_0xe4c314)){var _0xc5163d=[];for(var _0xb342e5=0x0;_0xb342e5<_0xe4c314[_0x68ef('0x36')];_0xb342e5++){if(_0xe4c314[_0xb342e5]['online']){_0xc5163d[_0x68ef('0x7f')](db['UserVoiceQueueRt'][_0x68ef('0x6c')]({'membername':_0xe4c314[_0xb342e5][_0x68ef('0x22')],'UserId':_0xe4c314[_0xb342e5]['id'],'queue_name':_0x51c52b[_0x68ef('0x22')],'VoiceQueueId':_0x51c52b['id'],'interface':_[_0x68ef('0x6f')](_0xe4c314[_0xb342e5][_0x68ef('0x64')])?util['format']('SIP/%s',_0xe4c314[_0xb342e5]['name']):_0xe4c314[_0xb342e5][_0x68ef('0x64')],'paused':_0xe4c314[_0xb342e5][_0x68ef('0x63')]||![],'penalty':_0x430ef5['body'][_0x68ef('0x67')]||0x0}));}}return BPromise[_0x68ef('0x84')](_0xc5163d);}})[_0x68ef('0x18')](function(){return _0x2b1686;})[_0x68ef('0x18')](respondWithResult(_0x1d3499,null))[_0x68ef('0x2f')](handleError(_0x1d3499,null));};exports[_0x68ef('0x88')]=function(_0x34edc4,_0x1576ac){return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x34edc4[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x1576ac,null))[_0x68ef('0x18')](function(_0x31b61d){if(_0x31b61d){return _0x31b61d[_0x68ef('0x88')](_0x34edc4[_0x68ef('0x2c')]['ids'])[_0x68ef('0x18')](function(){if(_[_0x68ef('0x8c')](_0x34edc4['query'][_0x68ef('0x75')])){for(var _0x1774a9=0x0;_0x1774a9<_0x34edc4[_0x68ef('0x2c')][_0x68ef('0x75')][_0x68ef('0x36')];_0x1774a9+=0x1){socket[_0x68ef('0x72')](_0x68ef('0x89'),{'UserId':Number(_0x34edc4['query']['ids'][_0x1774a9]),'VoiceQueueId':Number(_0x34edc4[_0x68ef('0x49')]['id'])});}}else{socket[_0x68ef('0x72')]('userVoiceQueue:remove',{'UserId':Number(_0x34edc4[_0x68ef('0x2c')]['ids']),'VoiceQueueId':Number(_0x34edc4[_0x68ef('0x49')]['id'])});}});}})['then'](function(_0x3054e8){return db[_0x68ef('0x6e')][_0x68ef('0x19')]({'where':{'VoiceQueueId':_0x34edc4[_0x68ef('0x49')]['id'],'UserId':_0x34edc4[_0x68ef('0x2c')][_0x68ef('0x75')]}})[_0x68ef('0x18')](function(){return _0x3054e8;});})[_0x68ef('0x18')](respondWithStatusCode(_0x1576ac,null))['catch'](handleError(_0x1576ac,null));};exports[_0x68ef('0x8d')]=function(_0x60a1e7,_0x3bd9f2){var _0x3dd5f7={};var _0x35eba3={};var _0x18e166;var _0x3a6e25;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x60a1e7['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x3bd9f2,null))[_0x68ef('0x18')](function(_0x33ec8e){if(_0x33ec8e){_0x18e166=_0x33ec8e;_0x35eba3['model']=_[_0x68ef('0x32')](db[_0x68ef('0x60')][_0x68ef('0x29')]);_0x35eba3[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x60a1e7[_0x68ef('0x2c')]);_0x35eba3[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x35eba3[_0x68ef('0x31')],_0x35eba3[_0x68ef('0x2c')]);_0x3dd5f7[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x35eba3[_0x68ef('0x31')],qs[_0x68ef('0x35')](_0x60a1e7[_0x68ef('0x2c')]['fields']));_0x3dd5f7[_0x68ef('0x34')]=_0x3dd5f7[_0x68ef('0x34')]['length']?_0x3dd5f7[_0x68ef('0x34')]:_0x35eba3['model'];_0x3dd5f7[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x3dd5f7[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x60a1e7[_0x68ef('0x2c')],_0x35eba3[_0x68ef('0x4d')]));if(_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x3dd5f7[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x3dd5f7['where'],{'$or':_[_0x68ef('0x1e')](_0x3dd5f7[_0x68ef('0x34')],function(_0x2cf7d3){var _0x154c78={};_0x154c78[_0x2cf7d3]={'$like':'%'+_0x60a1e7['query'][_0x68ef('0x53')]+'%'};return _0x154c78;})});}_0x3dd5f7=_[_0x68ef('0x37')]({},_0x3dd5f7,_0x60a1e7[_0x68ef('0x38')]);return _0x18e166['getAgents'](_0x3dd5f7);}})[_0x68ef('0x18')](function(_0x225067){if(_0x225067){_0x3a6e25=_0x225067[_0x68ef('0x36')];if(!_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x3dd5f7[_0x68ef('0x14')]=qs['limit'](_0x60a1e7['query'][_0x68ef('0x14')]);_0x3dd5f7[_0x68ef('0x12')]=qs['offset'](_0x60a1e7['query'][_0x68ef('0x12')]);}return _0x18e166[_0x68ef('0x8d')](_0x3dd5f7);}})[_0x68ef('0x18')](function(_0x1e1738){if(_0x1e1738){return _0x1e1738?{'count':_0x3a6e25,'rows':_0x1e1738}:null;}})[_0x68ef('0x18')](respondWithResult(_0x3bd9f2,null))[_0x68ef('0x2f')](handleError(_0x3bd9f2,null));};exports[_0x68ef('0x8e')]=function(_0x13db31,_0x58800b){var _0x4cc80a={};var _0x3452d1={};var _0x1c5b4a;var _0x33dd03;return db['VoiceQueue'][_0x68ef('0x4b')]({'where':{'id':_0x13db31[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x58800b,null))[_0x68ef('0x18')](function(_0x535c5c){if(_0x535c5c){_0x1c5b4a=_0x535c5c;_0x3452d1['model']=_[_0x68ef('0x32')](db[_0x68ef('0x6e')][_0x68ef('0x29')]);_0x3452d1['query']=_[_0x68ef('0x32')](_0x13db31[_0x68ef('0x2c')]);_0x3452d1[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x3452d1[_0x68ef('0x31')],_0x3452d1[_0x68ef('0x2c')]);_0x4cc80a[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x3452d1[_0x68ef('0x31')],qs['fields'](_0x13db31[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4cc80a['attributes']=_0x4cc80a[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4cc80a[_0x68ef('0x34')]:_0x3452d1[_0x68ef('0x31')];_0x4cc80a['order']=qs[_0x68ef('0x50')](_0x13db31[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x4cc80a['where']=qs[_0x68ef('0x4d')](_['pick'](_0x13db31['query'],_0x3452d1['filters']));if(_0x13db31[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x4cc80a['where']=_[_0x68ef('0x37')](_0x4cc80a['where'],{'$or':_['map'](_0x4cc80a[_0x68ef('0x34')],function(_0x103585){var _0xa28738={};_0xa28738[_0x103585]={'$like':'%'+_0x13db31[_0x68ef('0x2c')][_0x68ef('0x53')]+'%'};return _0xa28738;})});}_0x4cc80a=_[_0x68ef('0x37')]({},_0x4cc80a,_0x13db31[_0x68ef('0x38')]);return _0x1c5b4a[_0x68ef('0x8e')](_0x4cc80a);}})[_0x68ef('0x18')](function(_0xcd5609){if(_0xcd5609){_0x33dd03=_0xcd5609[_0x68ef('0x36')];if(!_0x13db31['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x4cc80a['limit']=qs[_0x68ef('0x14')](_0x13db31['query'][_0x68ef('0x14')]);_0x4cc80a[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x13db31['query'][_0x68ef('0x12')]);}return _0x1c5b4a[_0x68ef('0x8e')](_0x4cc80a);}})[_0x68ef('0x18')](function(_0x799597){return _0x799597?{'count':_0x33dd03,'rows':_0x799597}:null;})[_0x68ef('0x18')](respondWithResult(_0x58800b,null))[_0x68ef('0x2f')](handleError(_0x58800b,null));};exports['getLists']=function(_0x5e4ec4,_0x40c6ec){var _0x4a45f9={};var _0x16ba3d={};var _0x405008;var _0x3ecec3;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x5e4ec4[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x40c6ec,null))[_0x68ef('0x18')](function(_0x4d4bfa){if(_0x4d4bfa){_0x405008=_0x4d4bfa;_0x16ba3d[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x8f')]['rawAttributes']);_0x16ba3d[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x5e4ec4[_0x68ef('0x2c')]);_0x16ba3d[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x16ba3d[_0x68ef('0x31')],_0x16ba3d[_0x68ef('0x2c')]);_0x4a45f9[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x16ba3d['model'],qs['fields'](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4a45f9['attributes']=_0x4a45f9[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4a45f9['attributes']:_0x16ba3d['model'];_0x4a45f9['order']=qs['sort'](_0x5e4ec4[_0x68ef('0x2c')]['sort']);_0x4a45f9[_0x68ef('0x51')]=qs['filters'](_[_0x68ef('0x52')](_0x5e4ec4[_0x68ef('0x2c')],_0x16ba3d['filters']));if(_0x5e4ec4['query']['filter']){_0x4a45f9[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x4a45f9[_0x68ef('0x51')],{'$or':_['map'](_0x4a45f9[_0x68ef('0x34')],function(_0x4898ad){var _0x22a810={};_0x22a810[_0x4898ad]={'$like':'%'+_0x5e4ec4['query'][_0x68ef('0x53')]+'%'};return _0x22a810;})});}_0x4a45f9=_[_0x68ef('0x37')]({},_0x4a45f9,_0x5e4ec4[_0x68ef('0x38')]);return _0x405008[_0x68ef('0x90')](_0x4a45f9);}})[_0x68ef('0x18')](function(_0x3f9113){if(_0x3f9113){_0x3ecec3=_0x3f9113[_0x68ef('0x36')];if(!_0x5e4ec4['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x4a45f9[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x4a45f9[_0x68ef('0x12')]=qs['offset'](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x12')]);}return _0x405008[_0x68ef('0x90')](_0x4a45f9);}})[_0x68ef('0x18')](function(_0x2a93bf){if(_0x2a93bf){return _0x2a93bf?{'count':_0x3ecec3,'rows':_0x2a93bf}:null;}})[_0x68ef('0x18')](respondWithResult(_0x40c6ec,null))[_0x68ef('0x2f')](handleError(_0x40c6ec,null));};exports[_0x68ef('0x91')]=function(_0x2d0bf5,_0x40da26){var _0x202e78=moment()[_0x68ef('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x253b31,_0x14b845;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x2d0bf5['params']['id']}})['then'](handleEntityNotFound(_0x40da26,null))['then'](function(_0x2e6bcf){if(_0x2e6bcf){_0x14b845=_0x2e6bcf;return _0x2e6bcf[_0x68ef('0x91')](_0x2d0bf5[_0x68ef('0x3a')][_0x68ef('0x75')],_['omit'](_0x2d0bf5['body'],['ids','id'])||{});}return null;})[_0x68ef('0x8b')](function(_0x12dbe5){var _0x547e6d;_0x253b31=_0x12dbe5||[];var _0x575f73=[];if(_0x12dbe5){for(var _0x6dc883=0x0;_0x6dc883<_0x12dbe5[_0x68ef('0x36')];_0x6dc883+=0x1){var _0x1dcc3e=_0x12dbe5[_0x6dc883][_0x68ef('0x3c')]({'plain':!![]});_0x14b845[_0x68ef('0x92')]=_0x2d0bf5[_0x68ef('0x3a')][_0x68ef('0x92')]?_0x2d0bf5['body'][_0x68ef('0x92')]:_0x14b845[_0x68ef('0x92')];switch(_0x14b845[_0x68ef('0x92')]){case _0x68ef('0x93'):_0x547e6d=squel[_0x68ef('0x94')]()['into'](_0x68ef('0x95'))[_0x68ef('0x96')](['phone',_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),_0x68ef('0x57'),'createdAt',_0x68ef('0x44')],squel['select']()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))[_0x68ef('0x77')]('id','ContactId')['field'](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),'ListId')['field'](_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0x9c'))[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f'))[_0x68ef('0x51')](_0x68ef('0xa0'),squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa1'))[_0x68ef('0x79')]('cm_hopper_final')['where'](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')]()))[_0x68ef('0x51')]('phone\x20NOT\x20IN\x20(?)',squel[_0x68ef('0x76')]()[_0x68ef('0x77')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x68ef('0x51')](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id']['toString']())))[_0x68ef('0x80')]();break;case'onlyIfOpen':_0x547e6d=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0x95'))[_0x68ef('0x96')]([_0x68ef('0x9a'),_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),_0x68ef('0x57'),_0x68ef('0x45'),_0x68ef('0x44')],squel[_0x68ef('0x76')]()['field'](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))[_0x68ef('0x77')]('id',_0x68ef('0x98'))['field'](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),_0x68ef('0x99'))[_0x68ef('0x77')](_0x2d0bf5['params']['id']['toString'](),_0x68ef('0x57'))['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))[_0x68ef('0x79')](_0x68ef('0x9c'))[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f'))[_0x68ef('0x51')](_0x68ef('0xa0'),squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa4'))[_0x68ef('0x79')]('cm_hopper')['where'](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')]())))[_0x68ef('0x80')]();break;default:_0x547e6d=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')]('cm_hopper')[_0x68ef('0x96')]([_0x68ef('0x9a'),_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),'VoiceQueueId','createdAt',_0x68ef('0x44')],squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))['field']('id','ContactId')[_0x68ef('0x77')](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),'ListId')[_0x68ef('0x77')](_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0x9c'))['where'](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e['CmListId'][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f')))[_0x68ef('0x80')]();}_0x575f73[_0x68ef('0x7f')](db[_0x68ef('0x68')][_0x68ef('0x2c')](_0x547e6d));}return BPromise[_0x68ef('0x84')](_0x575f73);}})[_0x68ef('0x18')](function(){var _0x54b4cc=[];var _0x59637f=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0xa5'))['fromQuery']([_0x68ef('0xa6'),_0x68ef('0x9a'),_0x68ef('0xa7'),'createdAt','updatedAt'],squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa8'))[_0x68ef('0x77')](_0x68ef('0xa9'))[_0x68ef('0x77')]('ci.OrderBy+1')['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0xaa'),'ci')[_0x68ef('0x7b')](_0x68ef('0x95'),'h',_0x68ef('0xab'))[_0x68ef('0x51')]('h.scheduledat=?',_0x202e78)[_0x68ef('0x51')](_0x68ef('0xac'),_0x68ef('0xad')))['toString']();_0x54b4cc[_0x68ef('0x7f')](db[_0x68ef('0x68')][_0x68ef('0x2c')](_0x59637f));return BPromise[_0x68ef('0x84')](_0x54b4cc);})[_0x68ef('0x18')](function(){return _0x253b31;})[_0x68ef('0x18')](respondWithResult(_0x40da26,null))[_0x68ef('0x2f')](handleError(_0x40da26,null));};exports[_0x68ef('0xae')]=function(_0x58d5da,_0x1873b5){return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x58d5da[_0x68ef('0x49')]['id']}})['then'](handleEntityNotFound(_0x1873b5,null))[_0x68ef('0x18')](function(_0x351b99){if(_0x351b99){return _0x351b99[_0x68ef('0xae')](_0x58d5da[_0x68ef('0x2c')][_0x68ef('0x75')]);}})['then'](function(_0x5b41f0){if(_0x5b41f0){return db[_0x68ef('0x4c')]['destroy']({'where':{'ListId':_0x58d5da['query'][_0x68ef('0x75')],'VoiceQueueId':_0x58d5da[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](function(){return _0x5b41f0;});}})[_0x68ef('0x18')](respondWithStatusCode(_0x1873b5,null))[_0x68ef('0x2f')](handleError(_0x1873b5,null));};exports[_0x68ef('0xaf')]=function(_0x3ee069,_0x5f49e9){var _0x40cd91={};var _0x848118={};var _0x794d1e;var _0x266f6c;return db[_0x68ef('0x28')]['findOne']({'where':{'id':_0x3ee069[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x5f49e9,null))[_0x68ef('0x18')](function(_0x2b5994){if(_0x2b5994){_0x794d1e=_0x2b5994;_0x848118[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x8f')][_0x68ef('0x29')]);_0x848118['query']=_[_0x68ef('0x32')](_0x3ee069[_0x68ef('0x2c')]);_0x848118[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x848118[_0x68ef('0x31')],_0x848118[_0x68ef('0x2c')]);_0x40cd91[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x848118['model'],qs[_0x68ef('0x35')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x40cd91[_0x68ef('0x34')]=_0x40cd91[_0x68ef('0x34')]['length']?_0x40cd91[_0x68ef('0x34')]:_0x848118[_0x68ef('0x31')];_0x40cd91[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x40cd91[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x3ee069[_0x68ef('0x2c')],_0x848118[_0x68ef('0x4d')]));if(_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x40cd91['where']=_[_0x68ef('0x37')](_0x40cd91[_0x68ef('0x51')],{'$or':_[_0x68ef('0x1e')](_0x40cd91[_0x68ef('0x34')],function(_0x124eda){var _0x4b738d={};_0x4b738d[_0x124eda]={'$like':'%'+_0x3ee069[_0x68ef('0x2c')]['filter']+'%'};return _0x4b738d;})});}_0x40cd91=_['merge']({},_0x40cd91,_0x3ee069[_0x68ef('0x38')]);return _0x794d1e['getBlackLists'](_0x40cd91);}})['then'](function(_0x4210c0){if(_0x4210c0){_0x266f6c=_0x4210c0['length'];if(!_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x40cd91[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x40cd91[_0x68ef('0x12')]=qs['offset'](_0x3ee069['query'][_0x68ef('0x12')]);}return _0x794d1e[_0x68ef('0xaf')](_0x40cd91);}})[_0x68ef('0x18')](function(_0x23946d){if(_0x23946d){return _0x23946d?{'count':_0x266f6c,'rows':_0x23946d}:null;}})[_0x68ef('0x18')](respondWithResult(_0x5f49e9,null))[_0x68ef('0x2f')](handleError(_0x5f49e9,null));};exports[_0x68ef('0xb0')]=function(_0xcc1765,_0x29662c){var _0x1185bd;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0xcc1765['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x29662c,null))['then'](function(_0x30876d){if(_0x30876d){return _0x30876d[_0x68ef('0xb0')](_0xcc1765[_0x68ef('0x3a')][_0x68ef('0x75')],_['omit'](_0xcc1765[_0x68ef('0x3a')],[_0x68ef('0x75'),'id'])||{});}return null;})[_0x68ef('0x8b')](function(_0x295b66){var _0x3455b5;_0x1185bd=_0x295b66||[];var _0xbf2168=[];if(_0x295b66){for(var _0x4cf8b6=0x0;_0x4cf8b6<_0x295b66[_0x68ef('0x36')];_0x4cf8b6+=0x1){var _0x4e3f0a=_0x295b66[_0x4cf8b6][_0x68ef('0x3c')]({'plain':!![]});_0x3455b5=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0xb1'))[_0x68ef('0x96')]([_0x68ef('0x9a'),'ContactId','ListId','VoiceQueueId',_0x68ef('0x45'),_0x68ef('0x44')],squel['select']()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('id','ContactId')[_0x68ef('0x77')](_0x4e3f0a[_0x68ef('0x9b')][_0x68ef('0x80')](),_0x68ef('0x99'))[_0x68ef('0x77')](_0xcc1765[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')](_0x68ef('0xb2'),'createdAt')[_0x68ef('0x77')](_0x68ef('0xb2'),_0x68ef('0x44'))[_0x68ef('0x79')]('cm_contacts')[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x4e3f0a['CmListId'][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f')))['toString']();_0xbf2168['push'](db['sequelize'][_0x68ef('0x2c')](_0x3455b5));}return BPromise['all'](_0xbf2168);}})['then'](function(){return _0x1185bd;})[_0x68ef('0x18')](respondWithResult(_0x29662c,null))['catch'](handleError(_0x29662c,null));};exports[_0x68ef('0xb3')]=function(_0x398899,_0x8dd212){return db[_0x68ef('0x28')]['find']({'where':{'id':_0x398899[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x8dd212,null))[_0x68ef('0x18')](function(_0x57d305){if(_0x57d305){return _0x57d305[_0x68ef('0xb3')](_0x398899[_0x68ef('0x2c')][_0x68ef('0x75')]);}})['then'](function(_0x4c6756){if(_0x4c6756){return db[_0x68ef('0x5b')]['destroy']({'where':{'ListId':_0x398899[_0x68ef('0x2c')]['ids'],'VoiceQueueId':_0x398899['params']['id']}})['then'](function(){return _0x4c6756;});}})[_0x68ef('0x18')](respondWithStatusCode(_0x8dd212,null))[_0x68ef('0x2f')](handleError(_0x8dd212,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 77249de..f31569f 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 _0xe7d2=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','VoiceQueue','save'];(function(_0x15266d,_0x2abd66){var _0x54771a=function(_0x1b69d5){while(--_0x1b69d5){_0x15266d['push'](_0x15266d['shift']());}};_0x54771a(++_0x2abd66);}(_0xe7d2,0x195));var _0x2e7d=function(_0x275cdc,_0x99b11f){_0x275cdc=_0x275cdc-0x0;var _0x1b3eed=_0xe7d2[_0x275cdc];return _0x1b3eed;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x2e7d('0x0'))['db'][_0x2e7d('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e7d('0x2'),'afterUpdate':_0x2e7d('0x3'),'afterDestroy':_0x2e7d('0x4')};function emitEvent(_0x521c1d){return function(_0x547d27,_0x54c43c,_0xf2274){VoiceQueueEvents[_0x2e7d('0x5')](_0x521c1d+':'+_0x547d27['id'],_0x547d27);VoiceQueueEvents[_0x2e7d('0x5')](_0x521c1d,_0x547d27);_0xf2274(null);};}for(var e in events){if(events[_0x2e7d('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x2e7d('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x956f=['VoiceQueue','save','update','emit','exports','events','../../mysqldb'];(function(_0x2cb236,_0x47d67b){var _0x5e7acf=function(_0x5b4771){while(--_0x5b4771){_0x2cb236['push'](_0x2cb236['shift']());}};_0x5e7acf(++_0x47d67b);}(_0x956f,0xc9));var _0xf956=function(_0x382ca6,_0x1aaf79){_0x382ca6=_0x382ca6-0x0;var _0x295a6c=_0x956f[_0x382ca6];return _0x295a6c;};'use strict';var EventEmitter=require(_0xf956('0x0'));var VoiceQueue=require(_0xf956('0x1'))['db'][_0xf956('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf956('0x3'),'afterUpdate':_0xf956('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d37fa){return function(_0x506ab3,_0x28b92b,_0x36e529){VoiceQueueEvents[_0xf956('0x5')](_0x3d37fa+':'+_0x506ab3['id'],_0x506ab3);VoiceQueueEvents['emit'](_0x3d37fa,_0x506ab3);_0x36e529(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xf956('0x6')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5d41443..9f81d6c 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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x3ab3d2,_0x1bf174){var _0x1adb58=function(_0xd57d20){while(--_0xd57d20){_0x3ab3d2['push'](_0x3ab3d2['shift']());}};_0x1adb58(++_0x1bf174);}(_0x34e8,0x12c));var _0x834e=function(_0x4da60a,_0x497fdb){_0x4da60a=_0x4da60a-0x0;var _0x375946=_0x34e8[_0x4da60a];return _0x375946;};'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 _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x4bade4,_0x129a03){var _0x442589=function(_0x54c5b4){while(--_0x54c5b4){_0x4bade4['push'](_0x4bade4['shift']());}};_0x442589(++_0x129a03);}(_0x34e8,0x12c));var _0x834e=function(_0x30ff62,_0x1e58c1){_0x30ff62=_0x30ff62-0x0;var _0x59eefb=_0x34e8[_0x30ff62];return _0x59eefb;};'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/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 3d61bb0..c6fcc2f 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 _0x73dc=['http','redis','defaults','localhost','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','attributes','limit','include','map','model','debug','find','where','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client'];(function(_0x8d372,_0x3b1a31){var _0x55c9e5=function(_0x460fd2){while(--_0x460fd2){_0x8d372['push'](_0x8d372['shift']());}};_0x55c9e5(++_0x3b1a31);}(_0x73dc,0x173));var _0xc73d=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x73dc[_0x1f1e31];return _0x229b56;};'use strict';var _=require('lodash');var util=require(_0xc73d('0x0'));var moment=require(_0xc73d('0x1'));var BPromise=require(_0xc73d('0x2'));var rs=require(_0xc73d('0x3'));var fs=require('fs');var Redis=require(_0xc73d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc73d('0x5'));var logger=require(_0xc73d('0x6'))(_0xc73d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc73d('0x8')][_0xc73d('0x9')]({'port':0x232a});config[_0xc73d('0xa')]=_[_0xc73d('0xb')](config[_0xc73d('0xa')],{'host':_0xc73d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc73d('0xa')]));require(_0xc73d('0xd'))['register'](socket);function respondWithRpcPromise(_0x4049d5,_0x9d5fcb,_0x480a61){return new BPromise(function(_0x255b61,_0xc05de4){return client[_0xc73d('0xe')](_0x4049d5,_0x480a61)[_0xc73d('0xf')](function(_0x54a8b4){logger[_0xc73d('0x10')](_0xc73d('0x11'),_0x9d5fcb,_0xc73d('0x12'));logger['debug'](_0xc73d('0x13'),_0x9d5fcb,_0xc73d('0x12'),JSON[_0xc73d('0x14')](_0x54a8b4));if(_0x54a8b4[_0xc73d('0x15')]){if(_0x54a8b4['error']['code']===0x1f4){logger[_0xc73d('0x15')](_0xc73d('0x11'),_0x9d5fcb,_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);return _0xc05de4(_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);}logger[_0xc73d('0x15')](_0xc73d('0x11'),_0x9d5fcb,_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);return _0x255b61(_0x54a8b4[_0xc73d('0x15')][_0xc73d('0x16')]);}else{logger[_0xc73d('0x10')](_0xc73d('0x11'),_0x9d5fcb,_0xc73d('0x12'));_0x255b61(_0x54a8b4[_0xc73d('0x17')]['message']);}})[_0xc73d('0x18')](function(_0x377bf2){logger[_0xc73d('0x15')](_0xc73d('0x11'),_0x9d5fcb,_0x377bf2);_0xc05de4(_0x377bf2);});});}exports[_0xc73d('0x19')]=function(_0x31bc95){var _0x22d1a7=this;return new Promise(function(_0xbb4b0e,_0x4277ab){return db[_0xc73d('0x1a')]['findAll']({'raw':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1c')]===undefined?!![]:![]:!![],'where':_0x31bc95['options']?_0x31bc95['options']['where']||null:null,'attributes':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1d')]||null:null,'limit':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1e')]||null:null,'include':_0x31bc95[_0xc73d('0x1b')]?_0x31bc95[_0xc73d('0x1b')][_0xc73d('0x1f')]?_[_0xc73d('0x20')](_0x31bc95['options'][_0xc73d('0x1f')],function(_0x3a06eb){return{'model':db[_0x3a06eb[_0xc73d('0x21')]],'as':_0x3a06eb['as'],'attributes':_0x3a06eb[_0xc73d('0x1d')],'include':_0x3a06eb['include']?_[_0xc73d('0x20')](_0x3a06eb[_0xc73d('0x1f')],function(_0x4c6c97){return{'model':db[_0x4c6c97[_0xc73d('0x21')]],'as':_0x4c6c97['as'],'attributes':_0x4c6c97[_0xc73d('0x1d')],'include':_0x4c6c97[_0xc73d('0x1f')]?_['map'](_0x4c6c97[_0xc73d('0x1f')],function(_0x46be35){return{'model':db[_0x46be35[_0xc73d('0x21')]],'as':_0x46be35['as'],'attributes':_0x46be35[_0xc73d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc73d('0xf')](function(_0x5dda1b){logger['info'](_0xc73d('0x19'),_0x31bc95);logger[_0xc73d('0x22')](_0xc73d('0x19'),_0x31bc95,JSON[_0xc73d('0x14')](_0x5dda1b));_0xbb4b0e(_0x5dda1b);})[_0xc73d('0x18')](function(_0x5306a4){logger[_0xc73d('0x15')]('GetVoiceQueue',_0x5306a4[_0xc73d('0x16')],_0x31bc95);_0x4277ab(_0x22d1a7[_0xc73d('0x15')](0x1f4,_0x5306a4['message']));});});};exports['ShowVoiceQueue']=function(_0x1819a3){var _0xfc65b5=this;return new Promise(function(_0x363a54,_0x545df7){return db[_0xc73d('0x1a')][_0xc73d('0x23')]({'raw':_0x1819a3['options']?_0x1819a3[_0xc73d('0x1b')][_0xc73d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1819a3[_0xc73d('0x1b')]?_0x1819a3['options'][_0xc73d('0x24')]||null:null,'attributes':_0x1819a3[_0xc73d('0x1b')]?_0x1819a3['options'][_0xc73d('0x1d')]||null:null,'include':_0x1819a3[_0xc73d('0x1b')]?_0x1819a3['options']['include']?_[_0xc73d('0x20')](_0x1819a3[_0xc73d('0x1b')][_0xc73d('0x1f')],function(_0x1f8bb3){return{'model':db[_0x1f8bb3[_0xc73d('0x21')]],'as':_0x1f8bb3['as'],'attributes':_0x1f8bb3[_0xc73d('0x1d')],'include':_0x1f8bb3['include']?_[_0xc73d('0x20')](_0x1f8bb3[_0xc73d('0x1f')],function(_0x4b64db){return{'model':db[_0x4b64db[_0xc73d('0x21')]],'as':_0x4b64db['as'],'attributes':_0x4b64db[_0xc73d('0x1d')],'include':_0x4b64db[_0xc73d('0x1f')]?_[_0xc73d('0x20')](_0x4b64db['include'],function(_0x2d676f){return{'model':db[_0x2d676f[_0xc73d('0x21')]],'as':_0x2d676f['as'],'attributes':_0x2d676f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x563577){logger[_0xc73d('0x10')](_0xc73d('0x25'),_0x1819a3);logger[_0xc73d('0x22')](_0xc73d('0x25'),_0x1819a3,JSON[_0xc73d('0x14')](_0x563577));_0x363a54(_0x563577);})[_0xc73d('0x18')](function(_0x1c847b){logger['error']('ShowVoiceQueue',_0x1c847b[_0xc73d('0x16')],_0x1819a3);_0x545df7(_0xfc65b5[_0xc73d('0x15')](0x1f4,_0x1c847b[_0xc73d('0x16')]));});});}; \ No newline at end of file +var _0x6568=['include','map','model','stringify','ShowVoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit'];(function(_0x28a3ec,_0x4c11c0){var _0x47ea11=function(_0x4a4671){while(--_0x4a4671){_0x28a3ec['push'](_0x28a3ec['shift']());}};_0x47ea11(++_0x4c11c0);}(_0x6568,0x72));var _0x8656=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6568[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x8656('0x0'));var util=require(_0x8656('0x1'));var moment=require(_0x8656('0x2'));var BPromise=require(_0x8656('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8656('0x4'));var db=require(_0x8656('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8656('0x6'))(_0x8656('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8656('0x8')]['http']({'port':0x232a});config['redis']=_[_0x8656('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8656('0xa'))(new Redis(config['redis']));require(_0x8656('0xb'))[_0x8656('0xc')](socket);function respondWithRpcPromise(_0x1b4365,_0x50c248,_0x10ca53){return new BPromise(function(_0x2149da,_0x1465db){return client[_0x8656('0xd')](_0x1b4365,_0x10ca53)[_0x8656('0xe')](function(_0x8c7b59){logger[_0x8656('0xf')](_0x8656('0x10'),_0x50c248,_0x8656('0x11'));logger[_0x8656('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x50c248,_0x8656('0x11'),JSON['stringify'](_0x8c7b59));if(_0x8c7b59['error']){if(_0x8c7b59[_0x8656('0x13')][_0x8656('0x14')]===0x1f4){logger[_0x8656('0x13')](_0x8656('0x10'),_0x50c248,_0x8c7b59[_0x8656('0x13')][_0x8656('0x15')]);return _0x1465db(_0x8c7b59[_0x8656('0x13')][_0x8656('0x15')]);}logger[_0x8656('0x13')](_0x8656('0x10'),_0x50c248,_0x8c7b59[_0x8656('0x13')][_0x8656('0x15')]);return _0x2149da(_0x8c7b59[_0x8656('0x13')][_0x8656('0x15')]);}else{logger[_0x8656('0xf')](_0x8656('0x10'),_0x50c248,_0x8656('0x11'));_0x2149da(_0x8c7b59['result'][_0x8656('0x15')]);}})[_0x8656('0x16')](function(_0x21d0bf){logger[_0x8656('0x13')](_0x8656('0x10'),_0x50c248,_0x21d0bf);_0x1465db(_0x21d0bf);});});}exports[_0x8656('0x17')]=function(_0x46e27b){var _0x1c24a8=this;return new Promise(function(_0x16f548,_0x5cf9d2){return db[_0x8656('0x18')][_0x8656('0x19')]({'raw':_0x46e27b[_0x8656('0x1a')]?_0x46e27b['options']['raw']===undefined?!![]:![]:!![],'where':_0x46e27b['options']?_0x46e27b[_0x8656('0x1a')][_0x8656('0x1b')]||null:null,'attributes':_0x46e27b[_0x8656('0x1a')]?_0x46e27b[_0x8656('0x1a')][_0x8656('0x1c')]||null:null,'limit':_0x46e27b[_0x8656('0x1a')]?_0x46e27b['options'][_0x8656('0x1d')]||null:null,'include':_0x46e27b[_0x8656('0x1a')]?_0x46e27b[_0x8656('0x1a')][_0x8656('0x1e')]?_[_0x8656('0x1f')](_0x46e27b[_0x8656('0x1a')][_0x8656('0x1e')],function(_0xc1cf60){return{'model':db[_0xc1cf60[_0x8656('0x20')]],'as':_0xc1cf60['as'],'attributes':_0xc1cf60[_0x8656('0x1c')],'include':_0xc1cf60[_0x8656('0x1e')]?_[_0x8656('0x1f')](_0xc1cf60[_0x8656('0x1e')],function(_0xb14a8){return{'model':db[_0xb14a8[_0x8656('0x20')]],'as':_0xb14a8['as'],'attributes':_0xb14a8[_0x8656('0x1c')],'include':_0xb14a8[_0x8656('0x1e')]?_[_0x8656('0x1f')](_0xb14a8[_0x8656('0x1e')],function(_0x319b23){return{'model':db[_0x319b23[_0x8656('0x20')]],'as':_0x319b23['as'],'attributes':_0x319b23['attributes']};}):[]};}):[]};}):[]:[]})[_0x8656('0xe')](function(_0xe72d7d){logger[_0x8656('0xf')]('GetVoiceQueue',_0x46e27b);logger[_0x8656('0x12')](_0x8656('0x17'),_0x46e27b,JSON[_0x8656('0x21')](_0xe72d7d));_0x16f548(_0xe72d7d);})[_0x8656('0x16')](function(_0x518804){logger[_0x8656('0x13')](_0x8656('0x17'),_0x518804[_0x8656('0x15')],_0x46e27b);_0x5cf9d2(_0x1c24a8[_0x8656('0x13')](0x1f4,_0x518804['message']));});});};exports[_0x8656('0x22')]=function(_0x3ba406){var _0x37edcc=this;return new Promise(function(_0xa3d6f3,_0xcd9aea){return db[_0x8656('0x18')][_0x8656('0x23')]({'raw':_0x3ba406['options']?_0x3ba406[_0x8656('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3ba406['options']?_0x3ba406[_0x8656('0x1a')][_0x8656('0x1b')]||null:null,'attributes':_0x3ba406[_0x8656('0x1a')]?_0x3ba406[_0x8656('0x1a')][_0x8656('0x1c')]||null:null,'include':_0x3ba406['options']?_0x3ba406[_0x8656('0x1a')][_0x8656('0x1e')]?_[_0x8656('0x1f')](_0x3ba406[_0x8656('0x1a')][_0x8656('0x1e')],function(_0x28ad66){return{'model':db[_0x28ad66[_0x8656('0x20')]],'as':_0x28ad66['as'],'attributes':_0x28ad66[_0x8656('0x1c')],'include':_0x28ad66['include']?_[_0x8656('0x1f')](_0x28ad66['include'],function(_0x189050){return{'model':db[_0x189050[_0x8656('0x20')]],'as':_0x189050['as'],'attributes':_0x189050[_0x8656('0x1c')],'include':_0x189050[_0x8656('0x1e')]?_[_0x8656('0x1f')](_0x189050[_0x8656('0x1e')],function(_0x113afd){return{'model':db[_0x113afd[_0x8656('0x20')]],'as':_0x113afd['as'],'attributes':_0x113afd[_0x8656('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8656('0xe')](function(_0x47c42e){logger[_0x8656('0xf')](_0x8656('0x22'),_0x3ba406);logger[_0x8656('0x12')]('ShowVoiceQueue',_0x3ba406,JSON[_0x8656('0x21')](_0x47c42e));_0xa3d6f3(_0x47c42e);})[_0x8656('0x16')](function(_0x1b8974){logger[_0x8656('0x13')](_0x8656('0x22'),_0x1b8974[_0x8656('0x15')],_0x3ba406);_0xcd9aea(_0x37edcc[_0x8656('0x13')](0x1f4,_0x1b8974['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 1cc1c0a..e5fd104 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 _0xea96=['removeListener','length','save','remove','emit'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xea96,0x75));var _0x6ea9=function(_0x5461be,_0x2c7dd9){_0x5461be=_0x5461be-0x0;var _0x15f2a0=_0xea96[_0x5461be];return _0x15f2a0;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x6ea9('0x0'),_0x6ea9('0x1'),'update'];function createListener(_0x1b66d7,_0x1a3388){return function(_0x477003){_0x1a3388[_0x6ea9('0x2')](_0x1b66d7,_0x477003);};}function removeListener(_0x1dbde4,_0x379951){return function(){VoiceQueueEvents[_0x6ea9('0x3')](_0x1dbde4,_0x379951);};}exports['register']=function(_0xfdc330){for(var _0x410e64=0x0,_0x24a5d3=events[_0x6ea9('0x4')];_0x410e64<_0x24a5d3;_0x410e64++){var _0x475fd6=events[_0x410e64];var _0x321a5e=createListener('voiceQueue:'+_0x475fd6,_0xfdc330);VoiceQueueEvents['on'](_0x475fd6,_0x321a5e);}}; \ No newline at end of file +var _0x4d31=['register','length','voiceQueue:','save','update','emit','removeListener'];(function(_0x136ad3,_0x37ee64){var _0x5508c8=function(_0x2168ef){while(--_0x2168ef){_0x136ad3['push'](_0x136ad3['shift']());}};_0x5508c8(++_0x37ee64);}(_0x4d31,0xf1));var _0x14d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d31[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x14d3('0x0'),'remove',_0x14d3('0x1')];function createListener(_0xaf6f9e,_0x41244f){return function(_0x38d9eb){_0x41244f[_0x14d3('0x2')](_0xaf6f9e,_0x38d9eb);};}function removeListener(_0x26dd4a,_0x319df1){return function(){VoiceQueueEvents[_0x14d3('0x3')](_0x26dd4a,_0x319df1);};}exports[_0x14d3('0x4')]=function(_0x38be61){for(var _0x1e798f=0x0,_0x2fdd86=events[_0x14d3('0x5')];_0x1e798f<_0x2fdd86;_0x1e798f++){var _0x489f15=events[_0x1e798f];var _0x8a55bb=createListener(_0x14d3('0x6')+_0x489f15,_0x38be61);VoiceQueueEvents['on'](_0x489f15,_0x8a55bb);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 250fdea..08a2f35 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 _0xc80a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','delete','exports','path','connect-timeout','fs-extra'];(function(_0xd9eec,_0xcad946){var _0x4fb6de=function(_0x1722b6){while(--_0x1722b6){_0xd9eec['push'](_0xd9eec['shift']());}};_0x4fb6de(++_0xcad946);}(_0xc80a,0xd5));var _0xac80=function(_0x4cbe98,_0x576f7b){_0x4cbe98=_0x4cbe98-0x0;var _0x49c755=_0xc80a[_0x4cbe98];return _0x49c755;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xac80('0x0'));var timeout=require(_0xac80('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xac80('0x2'));var auth=require(_0xac80('0x3'));var interaction=require(_0xac80('0x4'));var config=require(_0xac80('0x5'));var controller=require('./voiceQueueReport.controller');router[_0xac80('0x6')]('/',auth[_0xac80('0x7')](),controller['index']);router[_0xac80('0x6')](_0xac80('0x8'),auth[_0xac80('0x7')](),controller[_0xac80('0x9')]);router['get'](_0xac80('0xa'),auth[_0xac80('0x7')](),controller[_0xac80('0xb')]);router[_0xac80('0x6')](_0xac80('0xc'),auth['isAuthenticated'](),controller[_0xac80('0xd')]);router[_0xac80('0xe')]('/',auth[_0xac80('0x7')](),controller[_0xac80('0xf')]);router['put'](_0xac80('0xc'),auth[_0xac80('0x7')](),controller['update']);router[_0xac80('0x10')](_0xac80('0xc'),auth[_0xac80('0x7')](),controller['destroy']);module[_0xac80('0x11')]=router; \ No newline at end of file +var _0x8e7a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','express'];(function(_0xbaf1b,_0x21ea7d){var _0x7ee631=function(_0xd5ca07){while(--_0xd5ca07){_0xbaf1b['push'](_0xbaf1b['shift']());}};_0x7ee631(++_0x21ea7d);}(_0x8e7a,0xdf));var _0xa8e7=function(_0x2b5d75,_0x12888c){_0x2b5d75=_0x2b5d75-0x0;var _0x446bb2=_0x8e7a[_0x2b5d75];return _0x446bb2;};'use strict';var multer=require(_0xa8e7('0x0'));var util=require(_0xa8e7('0x1'));var path=require(_0xa8e7('0x2'));var timeout=require(_0xa8e7('0x3'));var express=require(_0xa8e7('0x4'));var router=express[_0xa8e7('0x5')]();var fs_extra=require(_0xa8e7('0x6'));var auth=require(_0xa8e7('0x7'));var interaction=require(_0xa8e7('0x8'));var config=require(_0xa8e7('0x9'));var controller=require('./voiceQueueReport.controller');router[_0xa8e7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa8e7('0xa')](_0xa8e7('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa8e7('0xa')]('/index',auth[_0xa8e7('0xc')](),controller['getVoiceQueuesReport']);router[_0xa8e7('0xa')](_0xa8e7('0xd'),auth[_0xa8e7('0xc')](),controller[_0xa8e7('0xe')]);router[_0xa8e7('0xf')]('/',auth['isAuthenticated'](),controller[_0xa8e7('0x10')]);router[_0xa8e7('0x11')](_0xa8e7('0xd'),auth[_0xa8e7('0xc')](),controller['update']);router[_0xa8e7('0x12')](_0xa8e7('0xd'),auth[_0xa8e7('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 918070d..75b8e36 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 _0x38e5=['DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x333702,_0x3cf636){var _0x21d999=function(_0xca1c7c){while(--_0xca1c7c){_0x333702['push'](_0x333702['shift']());}};_0x21d999(++_0x3cf636);}(_0x38e5,0x177));var _0x538e=function(_0x2550b0,_0x2548d7){_0x2550b0=_0x2550b0-0x0;var _0x45c3fa=_0x38e5[_0x2550b0];return _0x45c3fa;};'use strict';var Sequelize=require(_0x538e('0x0'));var moment=require('moment');module[_0x538e('0x1')]={'type':{'type':Sequelize[_0x538e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x538e('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x538e('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x538e('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x538e('0x3')],'set':function(_0x2aa2ba){var _0x2b26fb=moment(_0x2aa2ba);var _0x36fc21=moment(this[_0x538e('0x4')](_0x538e('0x5')))['format'](_0x538e('0x6'));var _0x4480dc=_0x2b26fb['diff'](_0x36fc21,_0x538e('0x7'));this[_0x538e('0x8')]('queuecallerleaveAt',_0x2aa2ba);this['setDataValue'](_0x538e('0x9'),_0x4480dc||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x538e('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x538e('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x538e('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x538e('0x2')],'comment':_0x538e('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x538e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x538e('0x2')]},'connectedlinename':{'type':Sequelize[_0x538e('0x2')]},'accountcode':{'type':Sequelize[_0x538e('0x2')]},'context':{'type':Sequelize[_0x538e('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x538e('0xa')]},'mohtime':{'type':Sequelize[_0x538e('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x538e('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x538e('0x2')]},'transfer':{'type':Sequelize[_0x538e('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x538e('0x2')],'comment':_0x538e('0xd')},'transferexten':{'type':Sequelize[_0x538e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x538e('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x538e('0x2')]},'thirdDisposition':{'type':Sequelize[_0x538e('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x538e('0xa')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x57c2=['diff','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x443337,_0x47051c){var _0x1aa11a=function(_0x1452f5){while(--_0x1452f5){_0x443337['push'](_0x443337['shift']());}};_0x1aa11a(++_0x47051c);}(_0x57c2,0x198));var _0x257c=function(_0x53c057,_0xfa6941){_0x53c057=_0x53c057-0x0;var _0x593b09=_0x57c2[_0x53c057];return _0x593b09;};'use strict';var Sequelize=require(_0x257c('0x0'));var moment=require(_0x257c('0x1'));module[_0x257c('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x257c('0x3')]},'calleridname':{'type':Sequelize[_0x257c('0x3')]},'queue':{'type':Sequelize[_0x257c('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x257c('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x257c('0x4')],'set':function(_0x517fb0){var _0x598b1d=moment(_0x517fb0);var _0x781e65=moment(this[_0x257c('0x5')](_0x257c('0x6')))[_0x257c('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x22d263=_0x598b1d[_0x257c('0x8')](_0x781e65,'seconds');this['setDataValue'](_0x257c('0x9'),_0x517fb0);this[_0x257c('0xa')](_0x257c('0xb'),_0x22d263||null);}},'position':{'type':Sequelize[_0x257c('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x257c('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x257c('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x257c('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x257c('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x257c('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x257c('0x3')],'comment':_0x257c('0xe')},'originalposition':{'type':Sequelize[_0x257c('0xc')]},'channel':{'type':Sequelize[_0x257c('0x3')]},'connectedlinenum':{'type':Sequelize[_0x257c('0x3')]},'connectedlinename':{'type':Sequelize[_0x257c('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x257c('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x257c('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x257c('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x257c('0xf')},'transferexten':{'type':Sequelize[_0x257c('0x3')]},'transferuniqueid':{'type':Sequelize[_0x257c('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x257c('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x257c('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 063c1d7..1ac7ecf 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 _0x8191=['localhost','./voiceQueueReport.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VoiceQueueReport','include','findAll','show','params','includeAll','options','find','catch','create','body','destroy','describe','getVoiceQueuesReport','rows','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis'];(function(_0x46dc29,_0x18c45a){var _0x4bbb8d=function(_0x2bc823){while(--_0x2bc823){_0x46dc29['push'](_0x46dc29['shift']());}};_0x4bbb8d(++_0x18c45a);}(_0x8191,0xcf));var _0x1819=function(_0x23a079,_0xb8c9aa){_0x23a079=_0x23a079-0x0;var _0x53f2a5=_0x8191[_0x23a079];return _0x53f2a5;};'use strict';var emlformat=require(_0x1819('0x0'));var rimraf=require(_0x1819('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1819('0x2'));var moment=require('moment');var BPromise=require(_0x1819('0x3'));var Mustache=require(_0x1819('0x4'));var util=require('util');var path=require(_0x1819('0x5'));var sox=require('sox');var csv=require(_0x1819('0x6'));var ejs=require(_0x1819('0x7'));var fs=require('fs');var fs_extra=require(_0x1819('0x8'));var _=require(_0x1819('0x9'));var squel=require('squel');var crypto=require(_0x1819('0xa'));var jsforce=require(_0x1819('0xb'));var deskjs=require(_0x1819('0xc'));var toCsv=require(_0x1819('0x6'));var querystring=require(_0x1819('0xd'));var Papa=require(_0x1819('0xe'));var Redis=require(_0x1819('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1819('0x10'));var as=require(_0x1819('0x11'));var hardwareService=require(_0x1819('0x12'));var logger=require(_0x1819('0x13'))(_0x1819('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1819('0x15'));var db=require(_0x1819('0x16'))['db'];config[_0x1819('0x17')]=_['defaults'](config[_0x1819('0x17')],{'host':_0x1819('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1819('0x17')]));require(_0x1819('0x19'))['register'](socket);function respondWithStatusCode(_0x1c9957,_0x47f7fd){_0x47f7fd=_0x47f7fd||0xcc;return function(_0x278fa7){if(_0x278fa7){return _0x1c9957[_0x1819('0x1a')](_0x47f7fd);}return _0x1c9957[_0x1819('0x1b')](_0x47f7fd)['end']();};}function respondWithResult(_0x3dcf95,_0x5c96b5){_0x5c96b5=_0x5c96b5||0xc8;return function(_0xf2d6e7){if(_0xf2d6e7){return _0x3dcf95['status'](_0x5c96b5)[_0x1819('0x1c')](_0xf2d6e7);}};}function respondWithFilteredResult(_0x4cbc70,_0x2a86de){return function(_0x2a835b){if(_0x2a835b){var _0x1830be=typeof _0x2a86de[_0x1819('0x1d')]==='undefined'&&typeof _0x2a86de['limit']===_0x1819('0x1e');var _0x1c0288=_0x2a835b['count'];var _0x2d4ac8=_0x1830be?0x0:_0x2a86de[_0x1819('0x1d')];var _0x263b41=_0x1830be?_0x2a835b[_0x1819('0x1f')]:_0x2a86de[_0x1819('0x1d')]+_0x2a86de[_0x1819('0x20')];var _0x18d2fd;if(_0x263b41>=_0x1c0288){_0x263b41=_0x1c0288;_0x18d2fd=0xc8;}else{_0x18d2fd=0xce;}_0x4cbc70['status'](_0x18d2fd);return _0x4cbc70[_0x1819('0x21')](_0x1819('0x22'),_0x2d4ac8+'-'+_0x263b41+'/'+_0x1c0288)['json'](_0x2a835b);}return null;};}function patchUpdates(_0x3659a7){return function(_0x3227a8){try{jsonpatch[_0x1819('0x23')](_0x3227a8,_0x3659a7,!![]);}catch(_0x111719){return BPromise['reject'](_0x111719);}return _0x3227a8['save']();};}function saveUpdates(_0x2de419,_0x2a7c59){return function(_0x421634){if(_0x421634){return _0x421634[_0x1819('0x24')](_0x2de419)[_0x1819('0x25')](function(_0x237f57){return _0x237f57;});}return null;};}function removeEntity(_0x1dc8db,_0x331f0c){return function(_0x4d6dc4){if(_0x4d6dc4){return _0x4d6dc4['destroy']()['then'](function(){_0x1dc8db[_0x1819('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x81db80,_0x477589){return function(_0x14832c){if(!_0x14832c){_0x81db80['sendStatus'](0x194);}return _0x14832c;};}function handleError(_0x2be4d4,_0x278c6b){_0x278c6b=_0x278c6b||0x1f4;return function(_0x222b71){logger['error'](_0x222b71[_0x1819('0x26')]);if(_0x222b71[_0x1819('0x27')]){delete _0x222b71[_0x1819('0x27')];}_0x2be4d4['status'](_0x278c6b)[_0x1819('0x28')](_0x222b71);};}exports['index']=function(_0x396bed,_0x5c99e2){var _0x50f783={},_0x19362a={},_0x1267cf={'count':0x0,'rows':[]};var _0x1150e1=_['map'](db['VoiceQueueReport'][_0x1819('0x29')],function(_0x5e6ba6){return{'name':_0x5e6ba6[_0x1819('0x2a')],'type':_0x5e6ba6[_0x1819('0x2b')][_0x1819('0x2c')]};});_0x19362a[_0x1819('0x2d')]=_[_0x1819('0x2e')](_0x1150e1,_0x1819('0x27'));_0x19362a['query']=_[_0x1819('0x2f')](_0x396bed[_0x1819('0x30')]);_0x19362a[_0x1819('0x31')]=_[_0x1819('0x32')](_0x19362a[_0x1819('0x2d')],_0x19362a['query']);_0x50f783[_0x1819('0x33')]=_[_0x1819('0x32')](_0x19362a[_0x1819('0x2d')],qs['fields'](_0x396bed['query'][_0x1819('0x34')]));_0x50f783[_0x1819('0x33')]=_0x50f783[_0x1819('0x33')][_0x1819('0x35')]?_0x50f783[_0x1819('0x33')]:_0x19362a[_0x1819('0x2d')];if(!_0x396bed['query'][_0x1819('0x36')](_0x1819('0x37'))){_0x50f783['limit']=qs[_0x1819('0x20')](_0x396bed[_0x1819('0x30')][_0x1819('0x20')]);_0x50f783[_0x1819('0x1d')]=qs[_0x1819('0x1d')](_0x396bed['query'][_0x1819('0x1d')]);}_0x50f783['order']=qs[_0x1819('0x38')](_0x396bed[_0x1819('0x30')][_0x1819('0x38')]);_0x50f783[_0x1819('0x39')]=qs[_0x1819('0x31')](_[_0x1819('0x3a')](_0x396bed[_0x1819('0x30')],_0x19362a['filters']),_0x1150e1);if(_0x396bed['query'][_0x1819('0x3b')]){_0x50f783['where']=_[_0x1819('0x3c')](_0x50f783['where'],{'$or':_[_0x1819('0x2e')](_0x1150e1,function(_0x54f326){if(_0x54f326[_0x1819('0x2b')]!==_0x1819('0x3d')){var _0x58677f={};_0x58677f[_0x54f326['name']]={'$like':'%'+_0x396bed[_0x1819('0x30')][_0x1819('0x3b')]+'%'};return _0x58677f;}})});}_0x50f783=_['merge']({},_0x50f783,_0x396bed['options']);var _0xb6e1d7={'where':_0x50f783['where']};return db[_0x1819('0x3e')][_0x1819('0x1f')](_0xb6e1d7)[_0x1819('0x25')](function(_0xab9f30){_0x1267cf[_0x1819('0x1f')]=_0xab9f30;if(_0x396bed['query']['includeAll']){_0x50f783[_0x1819('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x1819('0x40')](_0x50f783);})[_0x1819('0x25')](function(_0x149c9c){_0x1267cf['rows']=_0x149c9c;return _0x1267cf;})[_0x1819('0x25')](respondWithFilteredResult(_0x5c99e2,_0x50f783))['catch'](handleError(_0x5c99e2,null));};exports[_0x1819('0x41')]=function(_0x160d84,_0x2c0380){var _0x2a2f15={'raw':![],'where':{'id':_0x160d84[_0x1819('0x42')]['id']}},_0x5c0594={};_0x5c0594[_0x1819('0x2d')]=_[_0x1819('0x2f')](db['VoiceQueueReport'][_0x1819('0x29')]);_0x5c0594[_0x1819('0x30')]=_['keys'](_0x160d84[_0x1819('0x30')]);_0x5c0594['filters']=_['intersection'](_0x5c0594[_0x1819('0x2d')],_0x5c0594[_0x1819('0x30')]);_0x2a2f15[_0x1819('0x33')]=_['intersection'](_0x5c0594[_0x1819('0x2d')],qs['fields'](_0x160d84[_0x1819('0x30')][_0x1819('0x34')]));_0x2a2f15[_0x1819('0x33')]=_0x2a2f15[_0x1819('0x33')]['length']?_0x2a2f15[_0x1819('0x33')]:_0x5c0594['model'];if(_0x160d84[_0x1819('0x30')][_0x1819('0x43')]){_0x2a2f15[_0x1819('0x3f')]=[{'all':!![]}];}_0x2a2f15=_[_0x1819('0x3c')]({},_0x2a2f15,_0x160d84[_0x1819('0x44')]);return db[_0x1819('0x3e')][_0x1819('0x45')](_0x2a2f15)[_0x1819('0x25')](handleEntityNotFound(_0x2c0380,null))[_0x1819('0x25')](respondWithResult(_0x2c0380,null))[_0x1819('0x46')](handleError(_0x2c0380,null));};exports[_0x1819('0x47')]=function(_0x4b7f85,_0x315802){return db['VoiceQueueReport'][_0x1819('0x47')](_0x4b7f85[_0x1819('0x48')],{})[_0x1819('0x25')](respondWithResult(_0x315802,0xc9))[_0x1819('0x46')](handleError(_0x315802,null));};exports['update']=function(_0x5888d8,_0x5991ef){if(_0x5888d8[_0x1819('0x48')]['id']){delete _0x5888d8[_0x1819('0x48')]['id'];}return db[_0x1819('0x3e')][_0x1819('0x45')]({'where':{'id':_0x5888d8['params']['id']}})[_0x1819('0x25')](handleEntityNotFound(_0x5991ef,null))[_0x1819('0x25')](saveUpdates(_0x5888d8[_0x1819('0x48')],null))[_0x1819('0x25')](respondWithResult(_0x5991ef,null))[_0x1819('0x46')](handleError(_0x5991ef,null));};exports[_0x1819('0x49')]=function(_0x3e9609,_0x36a5be){return db[_0x1819('0x3e')][_0x1819('0x45')]({'where':{'id':_0x3e9609[_0x1819('0x42')]['id']}})[_0x1819('0x25')](handleEntityNotFound(_0x36a5be,null))['then'](removeEntity(_0x36a5be,null))[_0x1819('0x46')](handleError(_0x36a5be,null));};exports['describe']=function(_0xe7fe19,_0xd18a45){return db[_0x1819('0x3e')][_0x1819('0x4a')]()[_0x1819('0x25')](respondWithResult(_0xd18a45,null))[_0x1819('0x46')](handleError(_0xd18a45,null));};exports[_0x1819('0x4b')]=function(_0x2649f0,_0x2898be){var _0x366ed0={},_0x22aa4f={},_0x3cbdd3={'count':0x0,'rows':[]};_0x22aa4f[_0x1819('0x2d')]=_[_0x1819('0x2f')](db[_0x1819('0x3e')]['rawAttributes']);_0x22aa4f[_0x1819('0x30')]=_[_0x1819('0x2f')](_0x2649f0[_0x1819('0x30')]);_0x22aa4f[_0x1819('0x31')]=_[_0x1819('0x32')](_0x22aa4f[_0x1819('0x2d')],_0x22aa4f[_0x1819('0x30')]);_0x366ed0['attributes']=_[_0x1819('0x32')](_0x22aa4f[_0x1819('0x2d')],qs[_0x1819('0x34')](_0x2649f0[_0x1819('0x30')]['fields']));_0x366ed0[_0x1819('0x33')]=_0x366ed0[_0x1819('0x33')][_0x1819('0x35')]?_0x366ed0[_0x1819('0x33')]:_0x22aa4f[_0x1819('0x2d')];if(!_0x2649f0[_0x1819('0x30')]['hasOwnProperty'](_0x1819('0x37'))){_0x366ed0[_0x1819('0x20')]=qs['limit'](_0x2649f0['query'][_0x1819('0x20')]);_0x366ed0[_0x1819('0x1d')]=qs[_0x1819('0x1d')](_0x2649f0['query'][_0x1819('0x1d')]);}_0x366ed0['order']=qs['sort'](_0x2649f0[_0x1819('0x30')][_0x1819('0x38')]);_0x366ed0[_0x1819('0x39')]=qs[_0x1819('0x31')](_['pick'](_0x2649f0[_0x1819('0x30')],_0x22aa4f[_0x1819('0x31')]));if(_0x2649f0[_0x1819('0x30')][_0x1819('0x3b')]){_0x366ed0[_0x1819('0x39')]=_[_0x1819('0x3c')](_0x366ed0[_0x1819('0x39')],{'$or':_[_0x1819('0x2e')](_0x366ed0[_0x1819('0x33')],function(_0x2c6994){var _0x1c9eed={};_0x1c9eed[_0x2c6994]={'$like':'%'+_0x2649f0[_0x1819('0x30')][_0x1819('0x3b')]+'%'};return _0x1c9eed;})});}_0x366ed0=_[_0x1819('0x3c')]({},_0x366ed0,_0x2649f0['options']);var _0x2abdb9={'where':_0x366ed0['where']};return db[_0x1819('0x3e')][_0x1819('0x1f')](_0x2abdb9)[_0x1819('0x25')](function(_0x2ebbeb){_0x3cbdd3[_0x1819('0x1f')]=_0x2ebbeb;if(_0x2649f0[_0x1819('0x30')]['includeAll']){_0x366ed0[_0x1819('0x3f')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x366ed0);})['then'](function(_0x502b61){_0x3cbdd3[_0x1819('0x4c')]=_0x502b61;return _0x3cbdd3;})[_0x1819('0x25')](respondWithFilteredResult(_0x2898be,_0x366ed0,_0x1819('0x4b')))['catch'](handleError(_0x2898be,null,_0x1819('0x4b')));}; \ No newline at end of file +var _0x8e46=['merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','destroy','describe','getVoiceQueuesReport','nolimit','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','end','error','stack','name','send','index','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','filter'];(function(_0x18f90b,_0x231462){var _0x54f950=function(_0x22f120){while(--_0x22f120){_0x18f90b['push'](_0x18f90b['shift']());}};_0x54f950(++_0x231462);}(_0x8e46,0x114));var _0x68e4=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x8e46[_0x5400a1];return _0x4006c7;};'use strict';var emlformat=require(_0x68e4('0x0'));var rimraf=require(_0x68e4('0x1'));var zipdir=require(_0x68e4('0x2'));var jsonpatch=require(_0x68e4('0x3'));var rp=require(_0x68e4('0x4'));var moment=require('moment');var BPromise=require(_0x68e4('0x5'));var Mustache=require(_0x68e4('0x6'));var util=require('util');var path=require(_0x68e4('0x7'));var sox=require(_0x68e4('0x8'));var csv=require('to-csv');var ejs=require(_0x68e4('0x9'));var fs=require('fs');var fs_extra=require(_0x68e4('0xa'));var _=require(_0x68e4('0xb'));var squel=require(_0x68e4('0xc'));var crypto=require(_0x68e4('0xd'));var jsforce=require(_0x68e4('0xe'));var deskjs=require(_0x68e4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x68e4('0x10'));var Papa=require(_0x68e4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x68e4('0x12'));var as=require(_0x68e4('0x13'));var hardwareService=require(_0x68e4('0x14'));var logger=require(_0x68e4('0x15'))(_0x68e4('0x16'));var utils=require(_0x68e4('0x17'));var config=require(_0x68e4('0x18'));var licenseUtil=require(_0x68e4('0x19'));var db=require(_0x68e4('0x1a'))['db'];config[_0x68e4('0x1b')]=_[_0x68e4('0x1c')](config[_0x68e4('0x1b')],{'host':_0x68e4('0x1d'),'port':0x18eb});var socket=require(_0x68e4('0x1e'))(new Redis(config[_0x68e4('0x1b')]));require('./voiceQueueReport.socket')[_0x68e4('0x1f')](socket);function respondWithStatusCode(_0x434bca,_0x46ed6e){_0x46ed6e=_0x46ed6e||0xcc;return function(_0x2a46b7){if(_0x2a46b7){return _0x434bca[_0x68e4('0x20')](_0x46ed6e);}return _0x434bca[_0x68e4('0x21')](_0x46ed6e)['end']();};}function respondWithResult(_0x10b9e3,_0x339352){_0x339352=_0x339352||0xc8;return function(_0x17c0a3){if(_0x17c0a3){return _0x10b9e3[_0x68e4('0x21')](_0x339352)[_0x68e4('0x22')](_0x17c0a3);}};}function respondWithFilteredResult(_0x1d37a6,_0x227339){return function(_0x10037c){if(_0x10037c){var _0xe81115=typeof _0x227339[_0x68e4('0x23')]===_0x68e4('0x24')&&typeof _0x227339[_0x68e4('0x25')]===_0x68e4('0x24');var _0x1dddd1=_0x10037c[_0x68e4('0x26')];var _0x5cf0e3=_0xe81115?0x0:_0x227339[_0x68e4('0x23')];var _0x400c41=_0xe81115?_0x10037c['count']:_0x227339[_0x68e4('0x23')]+_0x227339[_0x68e4('0x25')];var _0x36cfc2;if(_0x400c41>=_0x1dddd1){_0x400c41=_0x1dddd1;_0x36cfc2=0xc8;}else{_0x36cfc2=0xce;}_0x1d37a6[_0x68e4('0x21')](_0x36cfc2);return _0x1d37a6['set'](_0x68e4('0x27'),_0x5cf0e3+'-'+_0x400c41+'/'+_0x1dddd1)[_0x68e4('0x22')](_0x10037c);}return null;};}function patchUpdates(_0x5a07ff){return function(_0x39488b){try{jsonpatch['apply'](_0x39488b,_0x5a07ff,!![]);}catch(_0x7b9b13){return BPromise[_0x68e4('0x28')](_0x7b9b13);}return _0x39488b[_0x68e4('0x29')]();};}function saveUpdates(_0x5b0387,_0x3e7efe){return function(_0x16752e){if(_0x16752e){return _0x16752e[_0x68e4('0x2a')](_0x5b0387)[_0x68e4('0x2b')](function(_0x5514da){return _0x5514da;});}return null;};}function removeEntity(_0x1fb11c,_0x139787){return function(_0x4012ca){if(_0x4012ca){return _0x4012ca['destroy']()['then'](function(){_0x1fb11c[_0x68e4('0x21')](0xcc)[_0x68e4('0x2c')]();});}};}function handleEntityNotFound(_0x369d1d,_0x5d132b){return function(_0x2e7d31){if(!_0x2e7d31){_0x369d1d['sendStatus'](0x194);}return _0x2e7d31;};}function handleError(_0x2dfeec,_0xd2fba7){_0xd2fba7=_0xd2fba7||0x1f4;return function(_0x337b5a){logger[_0x68e4('0x2d')](_0x337b5a[_0x68e4('0x2e')]);if(_0x337b5a[_0x68e4('0x2f')]){delete _0x337b5a[_0x68e4('0x2f')];}_0x2dfeec['status'](_0xd2fba7)[_0x68e4('0x30')](_0x337b5a);};}exports[_0x68e4('0x31')]=function(_0x2cd768,_0x6975fe){var _0x44b8d1={},_0x3d8aa2={},_0x1943e8={'count':0x0,'rows':[]};var _0x224f88=_['map'](db['VoiceQueueReport']['rawAttributes'],function(_0x324550){return{'name':_0x324550['fieldName'],'type':_0x324550['type']['key']};});_0x3d8aa2[_0x68e4('0x32')]=_[_0x68e4('0x33')](_0x224f88,'name');_0x3d8aa2['query']=_[_0x68e4('0x34')](_0x2cd768['query']);_0x3d8aa2[_0x68e4('0x35')]=_[_0x68e4('0x36')](_0x3d8aa2['model'],_0x3d8aa2[_0x68e4('0x37')]);_0x44b8d1['attributes']=_[_0x68e4('0x36')](_0x3d8aa2[_0x68e4('0x32')],qs[_0x68e4('0x38')](_0x2cd768[_0x68e4('0x37')][_0x68e4('0x38')]));_0x44b8d1[_0x68e4('0x39')]=_0x44b8d1['attributes'][_0x68e4('0x3a')]?_0x44b8d1[_0x68e4('0x39')]:_0x3d8aa2[_0x68e4('0x32')];if(!_0x2cd768[_0x68e4('0x37')][_0x68e4('0x3b')]('nolimit')){_0x44b8d1[_0x68e4('0x25')]=qs[_0x68e4('0x25')](_0x2cd768['query']['limit']);_0x44b8d1[_0x68e4('0x23')]=qs[_0x68e4('0x23')](_0x2cd768[_0x68e4('0x37')][_0x68e4('0x23')]);}_0x44b8d1[_0x68e4('0x3c')]=qs[_0x68e4('0x3d')](_0x2cd768[_0x68e4('0x37')][_0x68e4('0x3d')]);_0x44b8d1[_0x68e4('0x3e')]=qs[_0x68e4('0x35')](_['pick'](_0x2cd768['query'],_0x3d8aa2[_0x68e4('0x35')]),_0x224f88);if(_0x2cd768[_0x68e4('0x37')][_0x68e4('0x3f')]){_0x44b8d1[_0x68e4('0x3e')]=_[_0x68e4('0x40')](_0x44b8d1[_0x68e4('0x3e')],{'$or':_[_0x68e4('0x33')](_0x224f88,function(_0x5eed07){if(_0x5eed07[_0x68e4('0x41')]!==_0x68e4('0x42')){var _0x4e67a7={};_0x4e67a7[_0x5eed07['name']]={'$like':'%'+_0x2cd768[_0x68e4('0x37')][_0x68e4('0x3f')]+'%'};return _0x4e67a7;}})});}_0x44b8d1=_['merge']({},_0x44b8d1,_0x2cd768['options']);var _0x5a59f7={'where':_0x44b8d1['where']};return db[_0x68e4('0x43')][_0x68e4('0x26')](_0x5a59f7)[_0x68e4('0x2b')](function(_0x592d5d){_0x1943e8[_0x68e4('0x26')]=_0x592d5d;if(_0x2cd768[_0x68e4('0x37')][_0x68e4('0x44')]){_0x44b8d1[_0x68e4('0x45')]=[{'all':!![]}];}return db[_0x68e4('0x43')][_0x68e4('0x46')](_0x44b8d1);})[_0x68e4('0x2b')](function(_0x59abd8){_0x1943e8[_0x68e4('0x47')]=_0x59abd8;return _0x1943e8;})[_0x68e4('0x2b')](respondWithFilteredResult(_0x6975fe,_0x44b8d1))[_0x68e4('0x48')](handleError(_0x6975fe,null));};exports[_0x68e4('0x49')]=function(_0x24b840,_0x1f5b2c){var _0x37a062={'raw':![],'where':{'id':_0x24b840[_0x68e4('0x4a')]['id']}},_0x2860c0={};_0x2860c0[_0x68e4('0x32')]=_['keys'](db[_0x68e4('0x43')][_0x68e4('0x4b')]);_0x2860c0['query']=_[_0x68e4('0x34')](_0x24b840[_0x68e4('0x37')]);_0x2860c0['filters']=_[_0x68e4('0x36')](_0x2860c0[_0x68e4('0x32')],_0x2860c0[_0x68e4('0x37')]);_0x37a062[_0x68e4('0x39')]=_[_0x68e4('0x36')](_0x2860c0[_0x68e4('0x32')],qs[_0x68e4('0x38')](_0x24b840[_0x68e4('0x37')][_0x68e4('0x38')]));_0x37a062['attributes']=_0x37a062[_0x68e4('0x39')][_0x68e4('0x3a')]?_0x37a062[_0x68e4('0x39')]:_0x2860c0[_0x68e4('0x32')];if(_0x24b840['query'][_0x68e4('0x44')]){_0x37a062['include']=[{'all':!![]}];}_0x37a062=_[_0x68e4('0x40')]({},_0x37a062,_0x24b840[_0x68e4('0x4c')]);return db[_0x68e4('0x43')][_0x68e4('0x4d')](_0x37a062)[_0x68e4('0x2b')](handleEntityNotFound(_0x1f5b2c,null))[_0x68e4('0x2b')](respondWithResult(_0x1f5b2c,null))[_0x68e4('0x48')](handleError(_0x1f5b2c,null));};exports[_0x68e4('0x4e')]=function(_0x43c61d,_0x28cd6b){return db['VoiceQueueReport'][_0x68e4('0x4e')](_0x43c61d[_0x68e4('0x4f')],{})[_0x68e4('0x2b')](respondWithResult(_0x28cd6b,0xc9))[_0x68e4('0x48')](handleError(_0x28cd6b,null));};exports['update']=function(_0x32b20d,_0x437d8c){if(_0x32b20d[_0x68e4('0x4f')]['id']){delete _0x32b20d[_0x68e4('0x4f')]['id'];}return db[_0x68e4('0x43')]['find']({'where':{'id':_0x32b20d['params']['id']}})[_0x68e4('0x2b')](handleEntityNotFound(_0x437d8c,null))[_0x68e4('0x2b')](saveUpdates(_0x32b20d[_0x68e4('0x4f')],null))[_0x68e4('0x2b')](respondWithResult(_0x437d8c,null))[_0x68e4('0x48')](handleError(_0x437d8c,null));};exports[_0x68e4('0x50')]=function(_0x43e651,_0x284aff){return db[_0x68e4('0x43')][_0x68e4('0x4d')]({'where':{'id':_0x43e651[_0x68e4('0x4a')]['id']}})[_0x68e4('0x2b')](handleEntityNotFound(_0x284aff,null))[_0x68e4('0x2b')](removeEntity(_0x284aff,null))[_0x68e4('0x48')](handleError(_0x284aff,null));};exports[_0x68e4('0x51')]=function(_0x184794,_0xa8fdc8){return db[_0x68e4('0x43')]['describe']()[_0x68e4('0x2b')](respondWithResult(_0xa8fdc8,null))[_0x68e4('0x48')](handleError(_0xa8fdc8,null));};exports[_0x68e4('0x52')]=function(_0x252845,_0x12d7dd){var _0x30d8d4={},_0x41c3d3={},_0x590efa={'count':0x0,'rows':[]};_0x41c3d3[_0x68e4('0x32')]=_[_0x68e4('0x34')](db[_0x68e4('0x43')][_0x68e4('0x4b')]);_0x41c3d3[_0x68e4('0x37')]=_[_0x68e4('0x34')](_0x252845[_0x68e4('0x37')]);_0x41c3d3[_0x68e4('0x35')]=_['intersection'](_0x41c3d3[_0x68e4('0x32')],_0x41c3d3[_0x68e4('0x37')]);_0x30d8d4[_0x68e4('0x39')]=_[_0x68e4('0x36')](_0x41c3d3[_0x68e4('0x32')],qs[_0x68e4('0x38')](_0x252845[_0x68e4('0x37')][_0x68e4('0x38')]));_0x30d8d4[_0x68e4('0x39')]=_0x30d8d4[_0x68e4('0x39')][_0x68e4('0x3a')]?_0x30d8d4[_0x68e4('0x39')]:_0x41c3d3[_0x68e4('0x32')];if(!_0x252845[_0x68e4('0x37')][_0x68e4('0x3b')](_0x68e4('0x53'))){_0x30d8d4['limit']=qs[_0x68e4('0x25')](_0x252845[_0x68e4('0x37')]['limit']);_0x30d8d4[_0x68e4('0x23')]=qs[_0x68e4('0x23')](_0x252845['query'][_0x68e4('0x23')]);}_0x30d8d4['order']=qs[_0x68e4('0x3d')](_0x252845[_0x68e4('0x37')][_0x68e4('0x3d')]);_0x30d8d4[_0x68e4('0x3e')]=qs[_0x68e4('0x35')](_[_0x68e4('0x54')](_0x252845[_0x68e4('0x37')],_0x41c3d3[_0x68e4('0x35')]));if(_0x252845[_0x68e4('0x37')][_0x68e4('0x3f')]){_0x30d8d4[_0x68e4('0x3e')]=_[_0x68e4('0x40')](_0x30d8d4[_0x68e4('0x3e')],{'$or':_[_0x68e4('0x33')](_0x30d8d4[_0x68e4('0x39')],function(_0x413320){var _0x4d9491={};_0x4d9491[_0x413320]={'$like':'%'+_0x252845[_0x68e4('0x37')][_0x68e4('0x3f')]+'%'};return _0x4d9491;})});}_0x30d8d4=_[_0x68e4('0x40')]({},_0x30d8d4,_0x252845[_0x68e4('0x4c')]);var _0x375fd8={'where':_0x30d8d4[_0x68e4('0x3e')]};return db['VoiceQueueReport'][_0x68e4('0x26')](_0x375fd8)[_0x68e4('0x2b')](function(_0x402883){_0x590efa[_0x68e4('0x26')]=_0x402883;if(_0x252845[_0x68e4('0x37')][_0x68e4('0x44')]){_0x30d8d4['include']=[{'all':!![]}];}return db[_0x68e4('0x43')][_0x68e4('0x46')](_0x30d8d4);})[_0x68e4('0x2b')](function(_0x6789a2){_0x590efa[_0x68e4('0x47')]=_0x6789a2;return _0x590efa;})[_0x68e4('0x2b')](respondWithFilteredResult(_0x12d7dd,_0x30d8d4,_0x68e4('0x52')))[_0x68e4('0x48')](handleError(_0x12d7dd,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 7f3eb3b..852035b 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 _0xeeae=['VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x24eac2,_0x3a17d3){var _0x366c0f=function(_0x4b0f33){while(--_0x4b0f33){_0x24eac2['push'](_0x24eac2['shift']());}};_0x366c0f(++_0x3a17d3);}(_0xeeae,0xf1));var _0xeeea=function(_0x3994a8,_0x2a4600){_0x3994a8=_0x3994a8-0x0;var _0x5790ba=_0xeeae[_0x3994a8];return _0x5790ba;};'use strict';var EventEmitter=require(_0xeeea('0x0'));var VoiceQueueReport=require(_0xeeea('0x1'))['db'][_0xeeea('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xeeea('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeeea('0x4'),'afterDestroy':_0xeeea('0x5')};function emitEvent(_0x4e0eb9){return function(_0x28bb,_0x24d8d8,_0x3d669a){VoiceQueueReportEvents[_0xeeea('0x6')](_0x4e0eb9+':'+_0x28bb['id'],_0x28bb);VoiceQueueReportEvents['emit'](_0x4e0eb9,_0x28bb);_0x3d669a(null);};}for(var e in events){if(events[_0xeeea('0x7')](e)){var event=events[e];VoiceQueueReport[_0xeeea('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x863e=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x1d9ee8,_0x4bf847){var _0x430830=function(_0x3ff15a){while(--_0x3ff15a){_0x1d9ee8['push'](_0x1d9ee8['shift']());}};_0x430830(++_0x4bf847);}(_0x863e,0x12d));var _0xe863=function(_0x6b1c0b,_0x311005){_0x6b1c0b=_0x6b1c0b-0x0;var _0x591064=_0x863e[_0x6b1c0b];return _0x591064;};'use strict';var EventEmitter=require(_0xe863('0x0'));var VoiceQueueReport=require(_0xe863('0x1'))['db'][_0xe863('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe863('0x3')](0x0);var events={'afterCreate':_0xe863('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x343584){return function(_0x34a59f,_0x3e8f72,_0x22a226){VoiceQueueReportEvents[_0xe863('0x5')](_0x343584+':'+_0x34a59f['id'],_0x34a59f);VoiceQueueReportEvents['emit'](_0x343584,_0x34a59f);_0x22a226(null);};}for(var e in events){if(events[_0xe863('0x6')](e)){var event=events[e];VoiceQueueReport[_0xe863('0x7')](e,emitEvent(event));}}module[_0xe863('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ed55e96..dbb0f08 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 _0xf32b=['VoiceQueueReport','uniqueid','calleridnum','lodash','util','api','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x2ade97,_0x27cf01){var _0x5b3bac=function(_0x33ea52){while(--_0x33ea52){_0x2ade97['push'](_0x2ade97['shift']());}};_0x5b3bac(++_0x27cf01);}(_0xf32b,0x7c));var _0xbf32=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf32b[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xbf32('0x0'));var util=require(_0xbf32('0x1'));var logger=require('../../config/logger')(_0xbf32('0x2'));var moment=require('moment');var BPromise=require(_0xbf32('0x3'));var rp=require(_0xbf32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf32('0x5'));var attributes=require('./voiceQueueReport.attributes');module[_0xbf32('0x6')]=function(_0x229471,_0x4190b3){return _0x229471[_0xbf32('0x7')](_0xbf32('0x8'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xbf32('0x9')]},{'fields':[_0xbf32('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54bb=['define','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports'];(function(_0x502a7f,_0x1ae080){var _0x144aff=function(_0x9c075d){while(--_0x9c075d){_0x502a7f['push'](_0x502a7f['shift']());}};_0x144aff(++_0x1ae080);}(_0x54bb,0xa0));var _0xb54b=function(_0x5293a1,_0x351c64){_0x5293a1=_0x5293a1-0x0;var _0x5085aa=_0x54bb[_0x5293a1];return _0x5085aa;};'use strict';var _=require(_0xb54b('0x0'));var util=require(_0xb54b('0x1'));var logger=require(_0xb54b('0x2'))(_0xb54b('0x3'));var moment=require(_0xb54b('0x4'));var BPromise=require(_0xb54b('0x5'));var rp=require(_0xb54b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0xb54b('0x7')]=function(_0x19696e,_0x4cf8fc){return _0x19696e[_0xb54b('0x8')](_0xb54b('0x9'),attributes,{'tableName':_0xb54b('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xb54b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index c15acb9..26eea8c 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 _0x5ea5=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','limit','include','map','model','attributes','catch','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x10bae6,_0x41d85f){var _0x251123=function(_0x548886){while(--_0x548886){_0x10bae6['push'](_0x10bae6['shift']());}};_0x251123(++_0x41d85f);}(_0x5ea5,0xaf));var _0x55ea=function(_0x5dcb2f,_0x402ca3){_0x5dcb2f=_0x5dcb2f-0x0;var _0x2cf625=_0x5ea5[_0x5dcb2f];return _0x2cf625;};'use strict';var _=require(_0x55ea('0x0'));var util=require(_0x55ea('0x1'));var moment=require(_0x55ea('0x2'));var BPromise=require(_0x55ea('0x3'));var rs=require(_0x55ea('0x4'));var fs=require('fs');var Redis=require(_0x55ea('0x5'));var db=require(_0x55ea('0x6'))['db'];var utils=require(_0x55ea('0x7'));var logger=require(_0x55ea('0x8'))(_0x55ea('0x9'));var config=require(_0x55ea('0xa'));var jayson=require(_0x55ea('0xb'));var client=jayson[_0x55ea('0xc')][_0x55ea('0xd')]({'port':0x232a});config[_0x55ea('0xe')]=_[_0x55ea('0xf')](config[_0x55ea('0xe')],{'host':_0x55ea('0x10'),'port':0x18eb});var socket=require(_0x55ea('0x11'))(new Redis(config[_0x55ea('0xe')]));require(_0x55ea('0x12'))[_0x55ea('0x13')](socket);function respondWithRpcPromise(_0x53f347,_0x231794,_0x422b1f){return new BPromise(function(_0x1256cf,_0x3d0bf9){return client['request'](_0x53f347,_0x422b1f)[_0x55ea('0x14')](function(_0x3124d9){logger[_0x55ea('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x231794,_0x55ea('0x16'));logger[_0x55ea('0x17')](_0x55ea('0x18'),_0x231794,_0x55ea('0x16'),JSON[_0x55ea('0x19')](_0x3124d9));if(_0x3124d9[_0x55ea('0x1a')]){if(_0x3124d9['error'][_0x55ea('0x1b')]===0x1f4){logger[_0x55ea('0x1a')]('VoiceQueueReport,\x20%s,\x20%s',_0x231794,_0x3124d9[_0x55ea('0x1a')][_0x55ea('0x1c')]);return _0x3d0bf9(_0x3124d9['error']['message']);}logger[_0x55ea('0x1a')](_0x55ea('0x1d'),_0x231794,_0x3124d9[_0x55ea('0x1a')][_0x55ea('0x1c')]);return _0x1256cf(_0x3124d9['error']['message']);}else{logger[_0x55ea('0x15')](_0x55ea('0x1d'),_0x231794,_0x55ea('0x16'));_0x1256cf(_0x3124d9[_0x55ea('0x1e')][_0x55ea('0x1c')]);}})['catch'](function(_0xd7e99f){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x231794,_0xd7e99f);_0x3d0bf9(_0xd7e99f);});});}exports[_0x55ea('0x1f')]=function(_0x5b7378){var _0x1ef1b6=this;return new Promise(function(_0x599f1d,_0x2d17a9){return db[_0x55ea('0x20')][_0x55ea('0x21')]({'raw':_0x5b7378[_0x55ea('0x22')]?_0x5b7378[_0x55ea('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x5b7378['options']?_0x5b7378[_0x55ea('0x22')][_0x55ea('0x23')]||null:null,'attributes':_0x5b7378['options']?_0x5b7378[_0x55ea('0x22')]['attributes']||null:null,'limit':_0x5b7378[_0x55ea('0x22')]?_0x5b7378[_0x55ea('0x22')][_0x55ea('0x24')]||null:null,'include':_0x5b7378[_0x55ea('0x22')]?_0x5b7378[_0x55ea('0x22')][_0x55ea('0x25')]?_[_0x55ea('0x26')](_0x5b7378[_0x55ea('0x22')]['include'],function(_0x22a09f){return{'model':db[_0x22a09f[_0x55ea('0x27')]],'as':_0x22a09f['as'],'attributes':_0x22a09f[_0x55ea('0x28')],'include':_0x22a09f[_0x55ea('0x25')]?_[_0x55ea('0x26')](_0x22a09f[_0x55ea('0x25')],function(_0x9d0f4){return{'model':db[_0x9d0f4[_0x55ea('0x27')]],'as':_0x9d0f4['as'],'attributes':_0x9d0f4[_0x55ea('0x28')],'include':_0x9d0f4['include']?_[_0x55ea('0x26')](_0x9d0f4['include'],function(_0x18415d){return{'model':db[_0x18415d[_0x55ea('0x27')]],'as':_0x18415d['as'],'attributes':_0x18415d['attributes']};}):[]};}):[]};}):[]:[]})[_0x55ea('0x14')](function(_0x101a16){logger[_0x55ea('0x15')]('GetVoiceQueueReport',_0x5b7378);logger[_0x55ea('0x17')](_0x55ea('0x1f'),_0x5b7378,JSON[_0x55ea('0x19')](_0x101a16));_0x599f1d(_0x101a16);})[_0x55ea('0x29')](function(_0x1d2f72){logger[_0x55ea('0x1a')](_0x55ea('0x1f'),_0x1d2f72[_0x55ea('0x1c')],_0x5b7378);_0x2d17a9(_0x1ef1b6[_0x55ea('0x1a')](0x1f4,_0x1d2f72[_0x55ea('0x1c')]));});});};exports[_0x55ea('0x2a')]=function(_0x2a8ad3){var _0xd12893=this;return new Promise(function(_0x4b1d85,_0x56a082){return db[_0x55ea('0x20')][_0x55ea('0x2b')](_0x2a8ad3[_0x55ea('0x2c')],{'raw':_0x2a8ad3['options']?_0x2a8ad3['options'][_0x55ea('0x2d')]===undefined?!![]:![]:!![]})['then'](function(_0x7c7a1f){logger[_0x55ea('0x15')]('CreateVoiceQueueReport',_0x2a8ad3);logger[_0x55ea('0x17')](_0x55ea('0x2a'),_0x2a8ad3,JSON[_0x55ea('0x19')](_0x7c7a1f));_0x4b1d85(_0x7c7a1f);})['catch'](function(_0x18c780){logger[_0x55ea('0x1a')](_0x55ea('0x2a'),_0x18c780[_0x55ea('0x1c')],_0x2a8ad3);_0x56a082(_0xd12893[_0x55ea('0x1a')](0x1f4,_0x18c780[_0x55ea('0x1c')]));});});};exports[_0x55ea('0x2e')]=function(_0x55139c){var _0x2e228f=this;return new Promise(function(_0x4bfa0a,_0x3c2038){return db['VoiceQueueReport']['update'](_0x55139c[_0x55ea('0x2c')],{'raw':_0x55139c[_0x55ea('0x22')]?_0x55139c[_0x55ea('0x22')][_0x55ea('0x2d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55139c[_0x55ea('0x22')]?_0x55139c[_0x55ea('0x22')][_0x55ea('0x23')]||null:null,'attributes':_0x55139c[_0x55ea('0x22')]?_0x55139c['options'][_0x55ea('0x28')]||null:null,'limit':_0x55139c[_0x55ea('0x22')]?_0x55139c[_0x55ea('0x22')][_0x55ea('0x24')]||null:null})[_0x55ea('0x14')](function(_0x51b95e){logger[_0x55ea('0x15')](_0x55ea('0x2e'),_0x55139c);logger[_0x55ea('0x17')](_0x55ea('0x2e'),_0x55139c,JSON[_0x55ea('0x19')](_0x51b95e));_0x4bfa0a(_0x51b95e);})[_0x55ea('0x29')](function(_0x4a7f5f){logger[_0x55ea('0x1a')](_0x55ea('0x2e'),_0x4a7f5f['message'],_0x55139c);_0x3c2038(_0x2e228f['error'](0x1f4,_0x4a7f5f[_0x55ea('0x1c')]));});});}; \ No newline at end of file +var _0x68fe=['findAll','options','where','attributes','limit','include','map','model','then','info','GetVoiceQueueReport','debug','catch','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceQueueReport'];(function(_0x4f8a4f,_0x2724f8){var _0x11446e=function(_0x2140ec){while(--_0x2140ec){_0x4f8a4f['push'](_0x4f8a4f['shift']());}};_0x11446e(++_0x2724f8);}(_0x68fe,0x16a));var _0xe68f=function(_0x34236b,_0x1027af){_0x34236b=_0x34236b-0x0;var _0x1f8de9=_0x68fe[_0x34236b];return _0x1f8de9;};'use strict';var _=require(_0xe68f('0x0'));var util=require(_0xe68f('0x1'));var moment=require(_0xe68f('0x2'));var BPromise=require(_0xe68f('0x3'));var rs=require(_0xe68f('0x4'));var fs=require('fs');var Redis=require(_0xe68f('0x5'));var db=require(_0xe68f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe68f('0x7'))('rpc');var config=require(_0xe68f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe68f('0x9')]['http']({'port':0x232a});config[_0xe68f('0xa')]=_[_0xe68f('0xb')](config[_0xe68f('0xa')],{'host':_0xe68f('0xc'),'port':0x18eb});var socket=require(_0xe68f('0xd'))(new Redis(config['redis']));require(_0xe68f('0xe'))[_0xe68f('0xf')](socket);function respondWithRpcPromise(_0x4de35f,_0x45ddc0,_0x196b5d){return new BPromise(function(_0x5ee51c,_0x115df4){return client['request'](_0x4de35f,_0x196b5d)['then'](function(_0x5d42b7){logger['info'](_0xe68f('0x10'),_0x45ddc0,_0xe68f('0x11'));logger['debug'](_0xe68f('0x12'),_0x45ddc0,'request\x20sent',JSON[_0xe68f('0x13')](_0x5d42b7));if(_0x5d42b7['error']){if(_0x5d42b7[_0xe68f('0x14')][_0xe68f('0x15')]===0x1f4){logger['error'](_0xe68f('0x10'),_0x45ddc0,_0x5d42b7['error'][_0xe68f('0x16')]);return _0x115df4(_0x5d42b7[_0xe68f('0x14')]['message']);}logger[_0xe68f('0x14')](_0xe68f('0x10'),_0x45ddc0,_0x5d42b7['error'][_0xe68f('0x16')]);return _0x5ee51c(_0x5d42b7['error'][_0xe68f('0x16')]);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x45ddc0,'request\x20sent');_0x5ee51c(_0x5d42b7[_0xe68f('0x17')][_0xe68f('0x16')]);}})['catch'](function(_0x2d5864){logger[_0xe68f('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x45ddc0,_0x2d5864);_0x115df4(_0x2d5864);});});}exports['GetVoiceQueueReport']=function(_0x4ea0b0){var _0x113594=this;return new Promise(function(_0x2ecd25,_0x5ea34e){return db[_0xe68f('0x18')][_0xe68f('0x19')]({'raw':_0x4ea0b0['options']?_0x4ea0b0[_0xe68f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4ea0b0[_0xe68f('0x1a')]?_0x4ea0b0[_0xe68f('0x1a')][_0xe68f('0x1b')]||null:null,'attributes':_0x4ea0b0['options']?_0x4ea0b0['options'][_0xe68f('0x1c')]||null:null,'limit':_0x4ea0b0[_0xe68f('0x1a')]?_0x4ea0b0[_0xe68f('0x1a')][_0xe68f('0x1d')]||null:null,'include':_0x4ea0b0[_0xe68f('0x1a')]?_0x4ea0b0[_0xe68f('0x1a')][_0xe68f('0x1e')]?_[_0xe68f('0x1f')](_0x4ea0b0[_0xe68f('0x1a')][_0xe68f('0x1e')],function(_0x232da0){return{'model':db[_0x232da0[_0xe68f('0x20')]],'as':_0x232da0['as'],'attributes':_0x232da0[_0xe68f('0x1c')],'include':_0x232da0[_0xe68f('0x1e')]?_[_0xe68f('0x1f')](_0x232da0[_0xe68f('0x1e')],function(_0x332d58){return{'model':db[_0x332d58[_0xe68f('0x20')]],'as':_0x332d58['as'],'attributes':_0x332d58['attributes'],'include':_0x332d58[_0xe68f('0x1e')]?_['map'](_0x332d58[_0xe68f('0x1e')],function(_0x37a46c){return{'model':db[_0x37a46c[_0xe68f('0x20')]],'as':_0x37a46c['as'],'attributes':_0x37a46c[_0xe68f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe68f('0x21')](function(_0x1387bf){logger[_0xe68f('0x22')](_0xe68f('0x23'),_0x4ea0b0);logger[_0xe68f('0x24')](_0xe68f('0x23'),_0x4ea0b0,JSON[_0xe68f('0x13')](_0x1387bf));_0x2ecd25(_0x1387bf);})[_0xe68f('0x25')](function(_0x1517a3){logger[_0xe68f('0x14')](_0xe68f('0x23'),_0x1517a3[_0xe68f('0x16')],_0x4ea0b0);_0x5ea34e(_0x113594['error'](0x1f4,_0x1517a3[_0xe68f('0x16')]));});});};exports[_0xe68f('0x26')]=function(_0x3df16d){var _0x42326f=this;return new Promise(function(_0x226abd,_0x2633fc){return db[_0xe68f('0x18')]['create'](_0x3df16d[_0xe68f('0x27')],{'raw':_0x3df16d[_0xe68f('0x1a')]?_0x3df16d['options'][_0xe68f('0x28')]===undefined?!![]:![]:!![]})[_0xe68f('0x21')](function(_0x455c33){logger[_0xe68f('0x22')](_0xe68f('0x26'),_0x3df16d);logger[_0xe68f('0x24')]('CreateVoiceQueueReport',_0x3df16d,JSON['stringify'](_0x455c33));_0x226abd(_0x455c33);})[_0xe68f('0x25')](function(_0x4d2a91){logger[_0xe68f('0x14')](_0xe68f('0x26'),_0x4d2a91[_0xe68f('0x16')],_0x3df16d);_0x2633fc(_0x42326f[_0xe68f('0x14')](0x1f4,_0x4d2a91[_0xe68f('0x16')]));});});};exports[_0xe68f('0x29')]=function(_0x42324e){var _0x513599=this;return new Promise(function(_0x3c1616,_0x24154c){return db[_0xe68f('0x18')][_0xe68f('0x2a')](_0x42324e['body'],{'raw':_0x42324e['options']?_0x42324e[_0xe68f('0x1a')][_0xe68f('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42324e['options']?_0x42324e[_0xe68f('0x1a')][_0xe68f('0x1b')]||null:null,'attributes':_0x42324e['options']?_0x42324e[_0xe68f('0x1a')]['attributes']||null:null,'limit':_0x42324e[_0xe68f('0x1a')]?_0x42324e['options'][_0xe68f('0x1d')]||null:null})[_0xe68f('0x21')](function(_0x25fb24){logger['info'](_0xe68f('0x29'),_0x42324e);logger['debug']('UpdateVoiceQueueReport',_0x42324e,JSON[_0xe68f('0x13')](_0x25fb24));_0x3c1616(_0x25fb24);})[_0xe68f('0x25')](function(_0x4ab44c){logger[_0xe68f('0x14')](_0xe68f('0x29'),_0x4ab44c['message'],_0x42324e);_0x24154c(_0x513599[_0xe68f('0x14')](0x1f4,_0x4ab44c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 25a95dd..8d5b827 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 _0x56e7=['emit','removeListener','length','save','remove'];(function(_0x59f3ab,_0x258e30){var _0x42a631=function(_0x3304ca){while(--_0x3304ca){_0x59f3ab['push'](_0x59f3ab['shift']());}};_0x42a631(++_0x258e30);}(_0x56e7,0x7b));var _0x756e=function(_0x4c6e29,_0x1cbe74){_0x4c6e29=_0x4c6e29-0x0;var _0x4bc9d9=_0x56e7[_0x4c6e29];return _0x4bc9d9;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x756e('0x0'),_0x756e('0x1'),'update'];function createListener(_0x2eadee,_0x3efe5c){return function(_0x46a672){_0x3efe5c[_0x756e('0x2')](_0x2eadee,_0x46a672);};}function removeListener(_0x11ce5f,_0x38546a){return function(){VoiceQueueReportEvents[_0x756e('0x3')](_0x11ce5f,_0x38546a);};}exports['register']=function(_0x3b3b8f){for(var _0x404189=0x0,_0x26519d=events[_0x756e('0x4')];_0x404189<_0x26519d;_0x404189++){var _0x5c8589=events[_0x404189];var _0x1c6a22=createListener('voiceQueueReport:'+_0x5c8589,_0x3b3b8f);VoiceQueueReportEvents['on'](_0x5c8589,_0x1c6a22);}}; \ No newline at end of file +var _0x83f7=['save','remove','emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x3833d0,_0x3dc86d){var _0x28f997=function(_0x1db3b6){while(--_0x1db3b6){_0x3833d0['push'](_0x3833d0['shift']());}};_0x28f997(++_0x3dc86d);}(_0x83f7,0x84));var _0x783f=function(_0x5ef86e,_0x169d33){_0x5ef86e=_0x5ef86e-0x0;var _0x252ea7=_0x83f7[_0x5ef86e];return _0x252ea7;};'use strict';var VoiceQueueReportEvents=require(_0x783f('0x0'));var events=[_0x783f('0x1'),_0x783f('0x2'),'update'];function createListener(_0x1e0c61,_0x52cbc8){return function(_0x598176){_0x52cbc8[_0x783f('0x3')](_0x1e0c61,_0x598176);};}function removeListener(_0x256e54,_0x5a28fa){return function(){VoiceQueueReportEvents[_0x783f('0x4')](_0x256e54,_0x5a28fa);};}exports[_0x783f('0x5')]=function(_0x47606e){for(var _0x2841e4=0x0,_0x25ab5f=events['length'];_0x2841e4<_0x25ab5f;_0x2841e4++){var _0x197e0b=events[_0x2841e4];var _0x2fd0ec=createListener(_0x783f('0x6')+_0x197e0b,_0x47606e);VoiceQueueReportEvents['on'](_0x197e0b,_0x2fd0ec);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c5683cc..b1dff06 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 _0xa31e=['create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post'];(function(_0x406e90,_0x82f8d8){var _0x3d66ff=function(_0x55c1ca){while(--_0x55c1ca){_0x406e90['push'](_0x406e90['shift']());}};_0x3d66ff(++_0x82f8d8);}(_0xa31e,0x11f));var _0xea31=function(_0xaff1bd,_0x5380c4){_0xaff1bd=_0xaff1bd-0x0;var _0x52ad89=_0xa31e[_0xaff1bd];return _0x52ad89;};'use strict';var multer=require(_0xea31('0x0'));var util=require(_0xea31('0x1'));var path=require(_0xea31('0x2'));var timeout=require(_0xea31('0x3'));var express=require(_0xea31('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xea31('0x5'));var interaction=require(_0xea31('0x6'));var config=require('../../config/environment');var controller=require(_0xea31('0x7'));router[_0xea31('0x8')]('/',auth[_0xea31('0x9')](),controller[_0xea31('0xa')]);router[_0xea31('0x8')]('/:id',auth[_0xea31('0x9')](),controller[_0xea31('0xb')]);router[_0xea31('0xc')]('/',auth[_0xea31('0x9')](),controller[_0xea31('0xd')]);router[_0xea31('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xea31('0xf')]);router[_0xea31('0x10')](_0xea31('0x11'),auth[_0xea31('0x9')](),controller[_0xea31('0x12')]);module[_0xea31('0x13')]=router; \ No newline at end of file +var _0x5eff=['show','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5eff,0x76));var _0xf5ef=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x5eff[_0x1b2ff7];return _0x31656a;};'use strict';var multer=require(_0xf5ef('0x0'));var util=require(_0xf5ef('0x1'));var path=require(_0xf5ef('0x2'));var timeout=require('connect-timeout');var express=require(_0xf5ef('0x3'));var router=express[_0xf5ef('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf5ef('0x5'));var interaction=require(_0xf5ef('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueuesLog.controller');router[_0xf5ef('0x7')]('/',auth[_0xf5ef('0x8')](),controller['index']);router[_0xf5ef('0x7')](_0xf5ef('0x9'),auth['isAuthenticated'](),controller[_0xf5ef('0xa')]);router['post']('/',auth[_0xf5ef('0x8')](),controller['create']);router[_0xf5ef('0xb')](_0xf5ef('0x9'),auth[_0xf5ef('0x8')](),controller[_0xf5ef('0xc')]);router[_0xf5ef('0xd')](_0xf5ef('0x9'),auth[_0xf5ef('0x8')](),controller[_0xf5ef('0xe')]);module[_0xf5ef('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index fcd2ff6..170a09e 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 _0x0eaf=['moment','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x3675d0,_0xb4df80){var _0xf72c35=function(_0x288e75){while(--_0x288e75){_0x3675d0['push'](_0x3675d0['shift']());}};_0xf72c35(++_0xb4df80);}(_0x0eaf,0x162));var _0xf0ea=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0eaf[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0xf0ea('0x0'));var moment=require(_0xf0ea('0x1'));module['exports']={'time':{'type':Sequelize[_0xf0ea('0x2')]},'callid':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf0ea('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xf0ea('0x3')](_0xf0ea('0x4'))}}; \ No newline at end of file +var _0xbe40=['STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports'];(function(_0x138975,_0x319d77){var _0x2ff39a=function(_0x2a1a21){while(--_0x2a1a21){_0x138975['push'](_0x138975['shift']());}};_0x2ff39a(++_0x319d77);}(_0xbe40,0x12a));var _0x0be4=function(_0x2764eb,_0x5aa354){_0x2764eb=_0x2764eb-0x0;var _0x4d4103=_0xbe40[_0x2764eb];return _0x4d4103;};'use strict';var Sequelize=require(_0x0be4('0x0'));var moment=require(_0x0be4('0x1'));module[_0x0be4('0x2')]={'time':{'type':Sequelize[_0x0be4('0x3')]},'callid':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0be4('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x0be4('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x0be4('0x5')](_0x0be4('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 3bfb35d..f28879f 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 _0xe897=['end','sendStatus','stack','name','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','options','VoiceQueuesLog','includeAll','findAll','rows','show','params','include','find','catch','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then'];(function(_0xcc6f57,_0x140c81){var _0x1a9702=function(_0x2e8f27){while(--_0x2e8f27){_0xcc6f57['push'](_0xcc6f57['shift']());}};_0x1a9702(++_0x140c81);}(_0xe897,0x14a));var _0x7e89=function(_0x5c20e0,_0x1972d7){_0x5c20e0=_0x5c20e0-0x0;var _0x5e4074=_0xe897[_0x5c20e0];return _0x5e4074;};'use strict';var emlformat=require(_0x7e89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7e89('0x1'));var rp=require(_0x7e89('0x2'));var moment=require(_0x7e89('0x3'));var BPromise=require(_0x7e89('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7e89('0x5'));var csv=require(_0x7e89('0x6'));var ejs=require(_0x7e89('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e89('0x8'));var squel=require(_0x7e89('0x9'));var crypto=require(_0x7e89('0xa'));var jsforce=require(_0x7e89('0xb'));var deskjs=require(_0x7e89('0xc'));var toCsv=require(_0x7e89('0x6'));var querystring=require('querystring');var Papa=require(_0x7e89('0xd'));var Redis=require(_0x7e89('0xe'));var authService=require(_0x7e89('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7e89('0x10'));var hardwareService=require(_0x7e89('0x11'));var logger=require(_0x7e89('0x12'))(_0x7e89('0x13'));var utils=require(_0x7e89('0x14'));var config=require(_0x7e89('0x15'));var licenseUtil=require(_0x7e89('0x16'));var db=require(_0x7e89('0x17'))['db'];function respondWithStatusCode(_0x39386a,_0x30542f){_0x30542f=_0x30542f||0xcc;return function(_0x5b8d17){if(_0x5b8d17){return _0x39386a['sendStatus'](_0x30542f);}return _0x39386a[_0x7e89('0x18')](_0x30542f)['end']();};}function respondWithResult(_0x4ac69a,_0x3740fc){_0x3740fc=_0x3740fc||0xc8;return function(_0x427fd3){if(_0x427fd3){return _0x4ac69a['status'](_0x3740fc)[_0x7e89('0x19')](_0x427fd3);}};}function respondWithFilteredResult(_0x29ada7,_0x292268){return function(_0x48eb96){if(_0x48eb96){var _0x31db73=typeof _0x292268[_0x7e89('0x1a')]===_0x7e89('0x1b')&&typeof _0x292268['limit']===_0x7e89('0x1b');var _0x593da7=_0x48eb96[_0x7e89('0x1c')];var _0x4118ea=_0x31db73?0x0:_0x292268[_0x7e89('0x1a')];var _0x498188=_0x31db73?_0x48eb96['count']:_0x292268[_0x7e89('0x1a')]+_0x292268[_0x7e89('0x1d')];var _0x153224;if(_0x498188>=_0x593da7){_0x498188=_0x593da7;_0x153224=0xc8;}else{_0x153224=0xce;}_0x29ada7['status'](_0x153224);return _0x29ada7['set'](_0x7e89('0x1e'),_0x4118ea+'-'+_0x498188+'/'+_0x593da7)[_0x7e89('0x19')](_0x48eb96);}return null;};}function patchUpdates(_0x39bcdb){return function(_0x49c2d6){try{jsonpatch[_0x7e89('0x1f')](_0x49c2d6,_0x39bcdb,!![]);}catch(_0x44b419){return BPromise[_0x7e89('0x20')](_0x44b419);}return _0x49c2d6['save']();};}function saveUpdates(_0x16a4ae,_0x1b999f){return function(_0x6081){if(_0x6081){return _0x6081[_0x7e89('0x21')](_0x16a4ae)[_0x7e89('0x22')](function(_0x37f767){return _0x37f767;});}return null;};}function removeEntity(_0x5943b7,_0x244f56){return function(_0x34c3b2){if(_0x34c3b2){return _0x34c3b2['destroy']()[_0x7e89('0x22')](function(){_0x5943b7[_0x7e89('0x18')](0xcc)[_0x7e89('0x23')]();});}};}function handleEntityNotFound(_0x4fb385,_0xdb6988){return function(_0x4f7fcd){if(!_0x4f7fcd){_0x4fb385[_0x7e89('0x24')](0x194);}return _0x4f7fcd;};}function handleError(_0x291e48,_0x4bd59d){_0x4bd59d=_0x4bd59d||0x1f4;return function(_0x11b19e){logger['error'](_0x11b19e[_0x7e89('0x25')]);if(_0x11b19e[_0x7e89('0x26')]){delete _0x11b19e[_0x7e89('0x26')];}_0x291e48[_0x7e89('0x18')](_0x4bd59d)[_0x7e89('0x27')](_0x11b19e);};}exports[_0x7e89('0x28')]=function(_0x2af136,_0x131fee){var _0x11f609={},_0x3df9f2={},_0x3bf58c={'count':0x0,'rows':[]};var _0x3f32b7=_['map'](db['VoiceQueuesLog'][_0x7e89('0x29')],function(_0x182f67){return{'name':_0x182f67['fieldName'],'type':_0x182f67[_0x7e89('0x2a')][_0x7e89('0x2b')]};});_0x3df9f2[_0x7e89('0x2c')]=_['map'](_0x3f32b7,'name');_0x3df9f2[_0x7e89('0x2d')]=_[_0x7e89('0x2e')](_0x2af136[_0x7e89('0x2d')]);_0x3df9f2[_0x7e89('0x2f')]=_[_0x7e89('0x30')](_0x3df9f2[_0x7e89('0x2c')],_0x3df9f2[_0x7e89('0x2d')]);_0x11f609[_0x7e89('0x31')]=_['intersection'](_0x3df9f2[_0x7e89('0x2c')],qs[_0x7e89('0x32')](_0x2af136[_0x7e89('0x2d')]['fields']));_0x11f609[_0x7e89('0x31')]=_0x11f609[_0x7e89('0x31')][_0x7e89('0x33')]?_0x11f609[_0x7e89('0x31')]:_0x3df9f2['model'];if(!_0x2af136[_0x7e89('0x2d')][_0x7e89('0x34')](_0x7e89('0x35'))){_0x11f609[_0x7e89('0x1d')]=qs[_0x7e89('0x1d')](_0x2af136[_0x7e89('0x2d')][_0x7e89('0x1d')]);_0x11f609[_0x7e89('0x1a')]=qs[_0x7e89('0x1a')](_0x2af136[_0x7e89('0x2d')][_0x7e89('0x1a')]);}_0x11f609[_0x7e89('0x36')]=qs[_0x7e89('0x37')](_0x2af136[_0x7e89('0x2d')][_0x7e89('0x37')]);_0x11f609['where']=qs[_0x7e89('0x2f')](_[_0x7e89('0x38')](_0x2af136[_0x7e89('0x2d')],_0x3df9f2['filters']),_0x3f32b7);if(_0x2af136[_0x7e89('0x2d')][_0x7e89('0x39')]){_0x11f609['where']=_[_0x7e89('0x3a')](_0x11f609[_0x7e89('0x3b')],{'$or':_[_0x7e89('0x3c')](_0x3f32b7,function(_0x173dbe){if(_0x173dbe[_0x7e89('0x2a')]!=='VIRTUAL'){var _0x222eff={};_0x222eff[_0x173dbe[_0x7e89('0x26')]]={'$like':'%'+_0x2af136['query'][_0x7e89('0x39')]+'%'};return _0x222eff;}})});}_0x11f609=_[_0x7e89('0x3a')]({},_0x11f609,_0x2af136[_0x7e89('0x3d')]);var _0x27bf30={'where':_0x11f609[_0x7e89('0x3b')]};return db[_0x7e89('0x3e')][_0x7e89('0x1c')](_0x27bf30)['then'](function(_0x309f88){_0x3bf58c[_0x7e89('0x1c')]=_0x309f88;if(_0x2af136['query'][_0x7e89('0x3f')]){_0x11f609['include']=[{'all':!![]}];}return db[_0x7e89('0x3e')][_0x7e89('0x40')](_0x11f609);})[_0x7e89('0x22')](function(_0x5c3f74){_0x3bf58c[_0x7e89('0x41')]=_0x5c3f74;return _0x3bf58c;})['then'](respondWithFilteredResult(_0x131fee,_0x11f609))['catch'](handleError(_0x131fee,null));};exports[_0x7e89('0x42')]=function(_0xba4d30,_0x22d164){var _0x19ba51={'raw':!![],'where':{'id':_0xba4d30[_0x7e89('0x43')]['id']}},_0x2b2552={};_0x2b2552[_0x7e89('0x2c')]=_[_0x7e89('0x2e')](db[_0x7e89('0x3e')][_0x7e89('0x29')]);_0x2b2552[_0x7e89('0x2d')]=_[_0x7e89('0x2e')](_0xba4d30[_0x7e89('0x2d')]);_0x2b2552[_0x7e89('0x2f')]=_[_0x7e89('0x30')](_0x2b2552[_0x7e89('0x2c')],_0x2b2552[_0x7e89('0x2d')]);_0x19ba51[_0x7e89('0x31')]=_[_0x7e89('0x30')](_0x2b2552[_0x7e89('0x2c')],qs[_0x7e89('0x32')](_0xba4d30[_0x7e89('0x2d')]['fields']));_0x19ba51[_0x7e89('0x31')]=_0x19ba51[_0x7e89('0x31')]['length']?_0x19ba51[_0x7e89('0x31')]:_0x2b2552[_0x7e89('0x2c')];if(_0xba4d30[_0x7e89('0x2d')][_0x7e89('0x3f')]){_0x19ba51[_0x7e89('0x44')]=[{'all':!![]}];}_0x19ba51=_[_0x7e89('0x3a')]({},_0x19ba51,_0xba4d30[_0x7e89('0x3d')]);return db[_0x7e89('0x3e')][_0x7e89('0x45')](_0x19ba51)[_0x7e89('0x22')](handleEntityNotFound(_0x22d164,null))[_0x7e89('0x22')](respondWithResult(_0x22d164,null))[_0x7e89('0x46')](handleError(_0x22d164,null));};exports['create']=function(_0x7d9b40,_0x16f7cd){return db[_0x7e89('0x3e')][_0x7e89('0x47')](_0x7d9b40[_0x7e89('0x48')],{})[_0x7e89('0x22')](respondWithResult(_0x16f7cd,0xc9))[_0x7e89('0x46')](handleError(_0x16f7cd,null));};exports[_0x7e89('0x21')]=function(_0x2bf4f6,_0x3feef3){if(_0x2bf4f6[_0x7e89('0x48')]['id']){delete _0x2bf4f6[_0x7e89('0x48')]['id'];}return db['VoiceQueuesLog'][_0x7e89('0x45')]({'where':{'id':_0x2bf4f6[_0x7e89('0x43')]['id']}})[_0x7e89('0x22')](handleEntityNotFound(_0x3feef3,null))[_0x7e89('0x22')](saveUpdates(_0x2bf4f6[_0x7e89('0x48')],null))['then'](respondWithResult(_0x3feef3,null))[_0x7e89('0x46')](handleError(_0x3feef3,null));};exports['destroy']=function(_0x3ac0ac,_0x51b9ef){return db[_0x7e89('0x3e')][_0x7e89('0x45')]({'where':{'id':_0x3ac0ac[_0x7e89('0x43')]['id']}})['then'](handleEntityNotFound(_0x51b9ef,null))[_0x7e89('0x22')](removeEntity(_0x51b9ef,null))[_0x7e89('0x46')](handleError(_0x51b9ef,null));}; \ No newline at end of file +var _0xf24c=['json','offset','undefined','count','set','Content-Range','apply','save','update','then','end','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','include','rows','catch','show','params','create','body','destroy','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x420307,_0x52b133){var _0x66f53c=function(_0x5f3c89){while(--_0x5f3c89){_0x420307['push'](_0x420307['shift']());}};_0x66f53c(++_0x52b133);}(_0xf24c,0xd0));var _0xcf24=function(_0x534cba,_0x1f6a7f){_0x534cba=_0x534cba-0x0;var _0x2d98b4=_0xf24c[_0x534cba];return _0x2d98b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcf24('0x0'));var zipdir=require(_0xcf24('0x1'));var jsonpatch=require(_0xcf24('0x2'));var rp=require(_0xcf24('0x3'));var moment=require(_0xcf24('0x4'));var BPromise=require(_0xcf24('0x5'));var Mustache=require(_0xcf24('0x6'));var util=require('util');var path=require(_0xcf24('0x7'));var sox=require(_0xcf24('0x8'));var csv=require('to-csv');var ejs=require(_0xcf24('0x9'));var fs=require('fs');var fs_extra=require(_0xcf24('0xa'));var _=require(_0xcf24('0xb'));var squel=require(_0xcf24('0xc'));var crypto=require(_0xcf24('0xd'));var jsforce=require(_0xcf24('0xe'));var deskjs=require(_0xcf24('0xf'));var toCsv=require(_0xcf24('0x10'));var querystring=require(_0xcf24('0x11'));var Papa=require('papaparse');var Redis=require(_0xcf24('0x12'));var authService=require(_0xcf24('0x13'));var qs=require(_0xcf24('0x14'));var as=require(_0xcf24('0x15'));var hardwareService=require(_0xcf24('0x16'));var logger=require(_0xcf24('0x17'))(_0xcf24('0x18'));var utils=require(_0xcf24('0x19'));var config=require(_0xcf24('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xcf24('0x1b'))['db'];function respondWithStatusCode(_0x47c2bf,_0x129eae){_0x129eae=_0x129eae||0xcc;return function(_0x1632ad){if(_0x1632ad){return _0x47c2bf['sendStatus'](_0x129eae);}return _0x47c2bf[_0xcf24('0x1c')](_0x129eae)['end']();};}function respondWithResult(_0x8fecde,_0x298068){_0x298068=_0x298068||0xc8;return function(_0x1ae3e7){if(_0x1ae3e7){return _0x8fecde[_0xcf24('0x1c')](_0x298068)[_0xcf24('0x1d')](_0x1ae3e7);}};}function respondWithFilteredResult(_0x2685d9,_0x114a41){return function(_0xe21e47){if(_0xe21e47){var _0x5aa6ac=typeof _0x114a41[_0xcf24('0x1e')]===_0xcf24('0x1f')&&typeof _0x114a41['limit']===_0xcf24('0x1f');var _0x5bf560=_0xe21e47[_0xcf24('0x20')];var _0x1494e3=_0x5aa6ac?0x0:_0x114a41[_0xcf24('0x1e')];var _0x3862c6=_0x5aa6ac?_0xe21e47['count']:_0x114a41[_0xcf24('0x1e')]+_0x114a41['limit'];var _0x41d27e;if(_0x3862c6>=_0x5bf560){_0x3862c6=_0x5bf560;_0x41d27e=0xc8;}else{_0x41d27e=0xce;}_0x2685d9['status'](_0x41d27e);return _0x2685d9[_0xcf24('0x21')](_0xcf24('0x22'),_0x1494e3+'-'+_0x3862c6+'/'+_0x5bf560)[_0xcf24('0x1d')](_0xe21e47);}return null;};}function patchUpdates(_0x576a00){return function(_0x1ee552){try{jsonpatch[_0xcf24('0x23')](_0x1ee552,_0x576a00,!![]);}catch(_0x47b126){return BPromise['reject'](_0x47b126);}return _0x1ee552[_0xcf24('0x24')]();};}function saveUpdates(_0x3a59f8,_0x931683){return function(_0x2b99cd){if(_0x2b99cd){return _0x2b99cd[_0xcf24('0x25')](_0x3a59f8)[_0xcf24('0x26')](function(_0x430416){return _0x430416;});}return null;};}function removeEntity(_0x4c81aa,_0x2efc42){return function(_0x3e3953){if(_0x3e3953){return _0x3e3953['destroy']()[_0xcf24('0x26')](function(){_0x4c81aa[_0xcf24('0x1c')](0xcc)[_0xcf24('0x27')]();});}};}function handleEntityNotFound(_0x54290d,_0xedef79){return function(_0x371a9){if(!_0x371a9){_0x54290d['sendStatus'](0x194);}return _0x371a9;};}function handleError(_0x136f59,_0x513718){_0x513718=_0x513718||0x1f4;return function(_0x383c9b){logger['error'](_0x383c9b[_0xcf24('0x28')]);if(_0x383c9b[_0xcf24('0x29')]){delete _0x383c9b[_0xcf24('0x29')];}_0x136f59[_0xcf24('0x1c')](_0x513718)[_0xcf24('0x2a')](_0x383c9b);};}exports[_0xcf24('0x2b')]=function(_0x1430e1,_0x439e64){var _0x54790e={},_0x214823={},_0x317db8={'count':0x0,'rows':[]};var _0x22fbe8=_['map'](db['VoiceQueuesLog'][_0xcf24('0x2c')],function(_0x566952){return{'name':_0x566952[_0xcf24('0x2d')],'type':_0x566952[_0xcf24('0x2e')][_0xcf24('0x2f')]};});_0x214823[_0xcf24('0x30')]=_[_0xcf24('0x31')](_0x22fbe8,_0xcf24('0x29'));_0x214823[_0xcf24('0x32')]=_[_0xcf24('0x33')](_0x1430e1[_0xcf24('0x32')]);_0x214823[_0xcf24('0x34')]=_['intersection'](_0x214823[_0xcf24('0x30')],_0x214823[_0xcf24('0x32')]);_0x54790e[_0xcf24('0x35')]=_[_0xcf24('0x36')](_0x214823[_0xcf24('0x30')],qs['fields'](_0x1430e1[_0xcf24('0x32')][_0xcf24('0x37')]));_0x54790e[_0xcf24('0x35')]=_0x54790e[_0xcf24('0x35')][_0xcf24('0x38')]?_0x54790e['attributes']:_0x214823[_0xcf24('0x30')];if(!_0x1430e1['query'][_0xcf24('0x39')](_0xcf24('0x3a'))){_0x54790e[_0xcf24('0x3b')]=qs[_0xcf24('0x3b')](_0x1430e1[_0xcf24('0x32')]['limit']);_0x54790e['offset']=qs['offset'](_0x1430e1[_0xcf24('0x32')][_0xcf24('0x1e')]);}_0x54790e[_0xcf24('0x3c')]=qs[_0xcf24('0x3d')](_0x1430e1[_0xcf24('0x32')][_0xcf24('0x3d')]);_0x54790e[_0xcf24('0x3e')]=qs[_0xcf24('0x34')](_[_0xcf24('0x3f')](_0x1430e1[_0xcf24('0x32')],_0x214823[_0xcf24('0x34')]),_0x22fbe8);if(_0x1430e1[_0xcf24('0x32')][_0xcf24('0x40')]){_0x54790e[_0xcf24('0x3e')]=_[_0xcf24('0x41')](_0x54790e[_0xcf24('0x3e')],{'$or':_[_0xcf24('0x31')](_0x22fbe8,function(_0xeaacbb){if(_0xeaacbb[_0xcf24('0x2e')]!==_0xcf24('0x42')){var _0x5edd26={};_0x5edd26[_0xeaacbb[_0xcf24('0x29')]]={'$like':'%'+_0x1430e1[_0xcf24('0x32')][_0xcf24('0x40')]+'%'};return _0x5edd26;}})});}_0x54790e=_[_0xcf24('0x41')]({},_0x54790e,_0x1430e1[_0xcf24('0x43')]);var _0x1c9ca2={'where':_0x54790e['where']};return db[_0xcf24('0x44')][_0xcf24('0x20')](_0x1c9ca2)[_0xcf24('0x26')](function(_0x52274f){_0x317db8[_0xcf24('0x20')]=_0x52274f;if(_0x1430e1['query'][_0xcf24('0x45')]){_0x54790e[_0xcf24('0x46')]=[{'all':!![]}];}return db[_0xcf24('0x44')]['findAll'](_0x54790e);})['then'](function(_0x105f36){_0x317db8[_0xcf24('0x47')]=_0x105f36;return _0x317db8;})[_0xcf24('0x26')](respondWithFilteredResult(_0x439e64,_0x54790e))[_0xcf24('0x48')](handleError(_0x439e64,null));};exports[_0xcf24('0x49')]=function(_0xb7e984,_0x5bd3e1){var _0x162f21={'raw':!![],'where':{'id':_0xb7e984[_0xcf24('0x4a')]['id']}},_0x41400e={};_0x41400e['model']=_[_0xcf24('0x33')](db[_0xcf24('0x44')][_0xcf24('0x2c')]);_0x41400e['query']=_[_0xcf24('0x33')](_0xb7e984[_0xcf24('0x32')]);_0x41400e[_0xcf24('0x34')]=_[_0xcf24('0x36')](_0x41400e[_0xcf24('0x30')],_0x41400e[_0xcf24('0x32')]);_0x162f21['attributes']=_['intersection'](_0x41400e['model'],qs[_0xcf24('0x37')](_0xb7e984[_0xcf24('0x32')][_0xcf24('0x37')]));_0x162f21[_0xcf24('0x35')]=_0x162f21[_0xcf24('0x35')]['length']?_0x162f21['attributes']:_0x41400e[_0xcf24('0x30')];if(_0xb7e984[_0xcf24('0x32')][_0xcf24('0x45')]){_0x162f21['include']=[{'all':!![]}];}_0x162f21=_[_0xcf24('0x41')]({},_0x162f21,_0xb7e984[_0xcf24('0x43')]);return db[_0xcf24('0x44')]['find'](_0x162f21)[_0xcf24('0x26')](handleEntityNotFound(_0x5bd3e1,null))[_0xcf24('0x26')](respondWithResult(_0x5bd3e1,null))[_0xcf24('0x48')](handleError(_0x5bd3e1,null));};exports[_0xcf24('0x4b')]=function(_0x31b7cf,_0x1bd36c){return db[_0xcf24('0x44')][_0xcf24('0x4b')](_0x31b7cf[_0xcf24('0x4c')],{})[_0xcf24('0x26')](respondWithResult(_0x1bd36c,0xc9))[_0xcf24('0x48')](handleError(_0x1bd36c,null));};exports[_0xcf24('0x25')]=function(_0x1dea95,_0x2fb678){if(_0x1dea95['body']['id']){delete _0x1dea95['body']['id'];}return db[_0xcf24('0x44')]['find']({'where':{'id':_0x1dea95['params']['id']}})[_0xcf24('0x26')](handleEntityNotFound(_0x2fb678,null))[_0xcf24('0x26')](saveUpdates(_0x1dea95[_0xcf24('0x4c')],null))['then'](respondWithResult(_0x2fb678,null))[_0xcf24('0x48')](handleError(_0x2fb678,null));};exports[_0xcf24('0x4d')]=function(_0x577c7b,_0x3c3e91){return db[_0xcf24('0x44')][_0xcf24('0x4e')]({'where':{'id':_0x577c7b['params']['id']}})['then'](handleEntityNotFound(_0x3c3e91,null))[_0xcf24('0x26')](removeEntity(_0x3c3e91,null))[_0xcf24('0x48')](handleError(_0x3c3e91,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7381a5a..903cc5a 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 _0x7ad3=['event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x4abe86,_0x21d158){var _0x13edeb=function(_0x5285ae){while(--_0x5285ae){_0x4abe86['push'](_0x4abe86['shift']());}};_0x13edeb(++_0x21d158);}(_0x7ad3,0xc2));var _0x37ad=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x7ad3[_0xf16b1];return _0x26f94d;};'use strict';var _=require(_0x37ad('0x0'));var util=require(_0x37ad('0x1'));var logger=require(_0x37ad('0x2'))(_0x37ad('0x3'));var moment=require(_0x37ad('0x4'));var BPromise=require(_0x37ad('0x5'));var rp=require(_0x37ad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37ad('0x7'));var config=require(_0x37ad('0x8'));var attributes=require(_0x37ad('0x9'));module['exports']=function(_0x55be30,_0x34f0f7){return _0x55be30[_0x37ad('0xa')](_0x37ad('0xb'),attributes,{'tableName':_0x37ad('0xc'),'paranoid':![],'indexes':[{'name':_0x37ad('0xd'),'fields':[_0x37ad('0xe'),_0x37ad('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb4f2=['moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','util','../../config/logger','api'];(function(_0x39786e,_0x45deea){var _0x3e3a6e=function(_0xde68ea){while(--_0xde68ea){_0x39786e['push'](_0x39786e['shift']());}};_0x3e3a6e(++_0x45deea);}(_0xb4f2,0x1eb));var _0x2b4f=function(_0x127a9f,_0x24a160){_0x127a9f=_0x127a9f-0x0;var _0x22ef9b=_0xb4f2[_0x127a9f];return _0x22ef9b;};'use strict';var _=require(_0x2b4f('0x0'));var util=require(_0x2b4f('0x1'));var logger=require(_0x2b4f('0x2'))(_0x2b4f('0x3'));var moment=require(_0x2b4f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2b4f('0x5'));var fs=require('fs');var path=require(_0x2b4f('0x6'));var rimraf=require(_0x2b4f('0x7'));var config=require(_0x2b4f('0x8'));var attributes=require(_0x2b4f('0x9'));module['exports']=function(_0xb3c554,_0x5613ca){return _0xb3c554[_0x2b4f('0xa')](_0x2b4f('0xb'),attributes,{'tableName':_0x2b4f('0xc'),'paranoid':![],'indexes':[{'name':_0x2b4f('0xd'),'fields':['event',_0x2b4f('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 d515a5a..cf88a2a 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 _0xbf82=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring'];(function(_0x887ccf,_0x3cb4d3){var _0x5b9bd4=function(_0xff5b){while(--_0xff5b){_0x887ccf['push'](_0x887ccf['shift']());}};_0x5b9bd4(++_0x3cb4d3);}(_0xbf82,0x1cb));var _0x2bf8=function(_0x35406f,_0x5b190b){_0x35406f=_0x35406f-0x0;var _0x756488=_0xbf82[_0x35406f];return _0x756488;};'use strict';var _=require(_0x2bf8('0x0'));var util=require('util');var moment=require(_0x2bf8('0x1'));var BPromise=require('bluebird');var rs=require(_0x2bf8('0x2'));var fs=require('fs');var Redis=require(_0x2bf8('0x3'));var db=require(_0x2bf8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2bf8('0x5'));var config=require(_0x2bf8('0x6'));var jayson=require(_0x2bf8('0x7'));var client=jayson[_0x2bf8('0x8')][_0x2bf8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a3818,_0x586bd5,_0x1c57e9){return new BPromise(function(_0x5c1944,_0x130e6d){return client[_0x2bf8('0xa')](_0x5a3818,_0x1c57e9)[_0x2bf8('0xb')](function(_0x596d31){logger[_0x2bf8('0xc')](_0x2bf8('0xd'),_0x586bd5,_0x2bf8('0xe'));logger[_0x2bf8('0xf')](_0x2bf8('0x10'),_0x586bd5,_0x2bf8('0xe'),JSON[_0x2bf8('0x11')](_0x596d31));if(_0x596d31[_0x2bf8('0x12')]){if(_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x13')]===0x1f4){logger[_0x2bf8('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x586bd5,_0x596d31[_0x2bf8('0x12')]['message']);return _0x130e6d(_0x596d31[_0x2bf8('0x12')]['message']);}logger['error'](_0x2bf8('0xd'),_0x586bd5,_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x14')]);return _0x5c1944(_0x596d31[_0x2bf8('0x12')][_0x2bf8('0x14')]);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x586bd5,_0x2bf8('0xe'));_0x5c1944(_0x596d31[_0x2bf8('0x15')][_0x2bf8('0x14')]);}})['catch'](function(_0x15c040){logger[_0x2bf8('0x12')](_0x2bf8('0xd'),_0x586bd5,_0x15c040);_0x130e6d(_0x15c040);});});} \ No newline at end of file +var _0x6a72=['message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xc36d01,_0x3bf1a6){var _0xecb231=function(_0x2fb301){while(--_0x2fb301){_0xc36d01['push'](_0xc36d01['shift']());}};_0xecb231(++_0x3bf1a6);}(_0x6a72,0x118));var _0x26a7=function(_0x33ab57,_0x449de8){_0x33ab57=_0x33ab57-0x0;var _0x3af8ce=_0x6a72[_0x33ab57];return _0x3af8ce;};'use strict';var _=require(_0x26a7('0x0'));var util=require(_0x26a7('0x1'));var moment=require(_0x26a7('0x2'));var BPromise=require('bluebird');var rs=require(_0x26a7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26a7('0x4'))['db'];var utils=require(_0x26a7('0x5'));var logger=require(_0x26a7('0x6'))(_0x26a7('0x7'));var config=require(_0x26a7('0x8'));var jayson=require(_0x26a7('0x9'));var client=jayson[_0x26a7('0xa')][_0x26a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ae95c,_0x20e058,_0x46dbc0){return new BPromise(function(_0x5115c5,_0x7fa77b){return client[_0x26a7('0xc')](_0x4ae95c,_0x46dbc0)[_0x26a7('0xd')](function(_0x274dbf){logger['info'](_0x26a7('0xe'),_0x20e058,_0x26a7('0xf'));logger['debug']('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x20e058,_0x26a7('0xf'),JSON[_0x26a7('0x10')](_0x274dbf));if(_0x274dbf[_0x26a7('0x11')]){if(_0x274dbf['error'][_0x26a7('0x12')]===0x1f4){logger[_0x26a7('0x11')](_0x26a7('0xe'),_0x20e058,_0x274dbf[_0x26a7('0x11')][_0x26a7('0x13')]);return _0x7fa77b(_0x274dbf['error'][_0x26a7('0x13')]);}logger['error'](_0x26a7('0xe'),_0x20e058,_0x274dbf[_0x26a7('0x11')][_0x26a7('0x13')]);return _0x5115c5(_0x274dbf[_0x26a7('0x11')][_0x26a7('0x13')]);}else{logger[_0x26a7('0x14')](_0x26a7('0xe'),_0x20e058,_0x26a7('0xf'));_0x5115c5(_0x274dbf[_0x26a7('0x15')][_0x26a7('0x13')]);}})[_0x26a7('0x16')](function(_0x19ed18){logger[_0x26a7('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x20e058,_0x19ed18);_0x7fa77b(_0x19ed18);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index c194a09..103e843 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 _0x0c3d=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x428eb2,_0x20f989){var _0x20fc49=function(_0x6b45ea){while(--_0x6b45ea){_0x428eb2['push'](_0x428eb2['shift']());}};_0x20fc49(++_0x20f989);}(_0x0c3d,0x169));var _0xd0c3=function(_0x321df4,_0x3efec5){_0x321df4=_0x321df4-0x0;var _0x50d06c=_0x0c3d[_0x321df4];return _0x50d06c;};'use strict';var multer=require('multer');var util=require(_0xd0c3('0x0'));var path=require(_0xd0c3('0x1'));var timeout=require(_0xd0c3('0x2'));var express=require(_0xd0c3('0x3'));var router=express[_0xd0c3('0x4')]();var fs_extra=require(_0xd0c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0c3('0x6'));var config=require(_0xd0c3('0x7'));var controller=require(_0xd0c3('0x8'));router[_0xd0c3('0x9')]('/',auth[_0xd0c3('0xa')](),controller[_0xd0c3('0xb')]);router[_0xd0c3('0x9')](_0xd0c3('0xc'),auth[_0xd0c3('0xa')](),controller['describe']);router[_0xd0c3('0x9')](_0xd0c3('0xd'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0xe')]);router[_0xd0c3('0x9')]('/:id/download',auth[_0xd0c3('0xa')](),controller['download']);router[_0xd0c3('0x9')](_0xd0c3('0xf'),controller[_0xd0c3('0x10')]);router[_0xd0c3('0x9')](_0xd0c3('0x11'),auth['isAuthenticated'](),controller[_0xd0c3('0x12')]);router[_0xd0c3('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd0c3('0x13')](_0xd0c3('0x11'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0x14')]);router[_0xd0c3('0x15')](_0xd0c3('0xd'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0x16')]);router[_0xd0c3('0x17')](_0xd0c3('0xd'),auth[_0xd0c3('0xa')](),controller[_0xd0c3('0x18')]);module[_0xd0c3('0x19')]=router; \ No newline at end of file +var _0xd773=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy'];(function(_0x194f09,_0x5c3a4f){var _0x26e13f=function(_0x4fecfc){while(--_0x4fecfc){_0x194f09['push'](_0x194f09['shift']());}};_0x26e13f(++_0x5c3a4f);}(_0xd773,0xe1));var _0x3d77=function(_0x4a0f6e,_0x31a636){_0x4a0f6e=_0x4a0f6e-0x0;var _0x361ff6=_0xd773[_0x4a0f6e];return _0x361ff6;};'use strict';var multer=require(_0x3d77('0x0'));var util=require(_0x3d77('0x1'));var path=require(_0x3d77('0x2'));var timeout=require(_0x3d77('0x3'));var express=require(_0x3d77('0x4'));var router=express[_0x3d77('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3d77('0x6'));var interaction=require(_0x3d77('0x7'));var config=require(_0x3d77('0x8'));var controller=require(_0x3d77('0x9'));router[_0x3d77('0xa')]('/',auth[_0x3d77('0xb')](),controller['index']);router[_0x3d77('0xa')](_0x3d77('0xc'),auth[_0x3d77('0xb')](),controller['describe']);router['get'](_0x3d77('0xd'),auth[_0x3d77('0xb')](),controller[_0x3d77('0xe')]);router[_0x3d77('0xa')](_0x3d77('0xf'),auth[_0x3d77('0xb')](),controller[_0x3d77('0x10')]);router[_0x3d77('0xa')](_0x3d77('0x11'),controller[_0x3d77('0x12')]);router[_0x3d77('0xa')](_0x3d77('0x13'),auth['isAuthenticated'](),controller[_0x3d77('0x14')]);router[_0x3d77('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3d77('0x15')]('/:id/transcribe',auth[_0x3d77('0xb')](),controller[_0x3d77('0x16')]);router[_0x3d77('0x17')](_0x3d77('0xd'),auth['isAuthenticated'](),controller[_0x3d77('0x18')]);router[_0x3d77('0x19')](_0x3d77('0xd'),auth['isAuthenticated'](),controller[_0x3d77('0x1a')]);module[_0x3d77('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index fe286ea..b936fe0 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(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 ea1073d..c73cb41 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 _0x75f3=['runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','map','type','key','model','differenceBy','format','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','VoiceRecording','include','rows','catch','show','params','rawAttributes','includeAll','merge','options','create','body','describe','uniqueid','find','value','%s.cypher','recording','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','../../components/encryptor','sequelize','MD5','col','$and','push','decryptFile','secrets','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeAccountId','transcribeRegion','language','ValidationError','Transcribe\x20not\x20configured','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment'];(function(_0xead5f0,_0x30581c){var _0x73c2a6=function(_0x27f32d){while(--_0x27f32d){_0xead5f0['push'](_0xead5f0['shift']());}};_0x73c2a6(++_0x30581c);}(_0x75f3,0x139));var _0x375f=function(_0x5a55bc,_0x395e40){_0x5a55bc=_0x5a55bc-0x0;var _0x100906=_0x75f3[_0x5a55bc];return _0x100906;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x375f('0x0'));var zipdir=require(_0x375f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x375f('0x2'));var BPromise=require(_0x375f('0x3'));var Mustache=require('mustache');var util=require(_0x375f('0x4'));var path=require(_0x375f('0x5'));var sox=require(_0x375f('0x6'));var csv=require('to-csv');var ejs=require(_0x375f('0x7'));var fs=require('fs');var fs_extra=require(_0x375f('0x8'));var _=require(_0x375f('0x9'));var squel=require(_0x375f('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x375f('0xb'));var toCsv=require(_0x375f('0xc'));var querystring=require(_0x375f('0xd'));var Papa=require(_0x375f('0xe'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x375f('0xf'));var authService=require(_0x375f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x375f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x375f('0x12'))(_0x375f('0x13'));var utils=require('../../config/utils');var config=require(_0x375f('0x14'));var licenseUtil=require(_0x375f('0x15'));var db=require(_0x375f('0x16'))['db'];function respondWithStatusCode(_0x1bca50,_0x5a3eb1){_0x5a3eb1=_0x5a3eb1||0xcc;return function(_0x3c2ca3){if(_0x3c2ca3){return _0x1bca50[_0x375f('0x17')](_0x5a3eb1);}return _0x1bca50[_0x375f('0x18')](_0x5a3eb1)[_0x375f('0x19')]();};}function respondWithResult(_0x2c6445,_0x4479){_0x4479=_0x4479||0xc8;return function(_0x44cd4b){if(_0x44cd4b){return _0x2c6445['status'](_0x4479)[_0x375f('0x1a')](_0x44cd4b);}};}function respondWithFilteredResult(_0x362bf0,_0xac5520){return function(_0x3f0c8e){if(_0x3f0c8e){var _0x4dc375=typeof _0xac5520[_0x375f('0x1b')]===_0x375f('0x1c')&&typeof _0xac5520[_0x375f('0x1d')]===_0x375f('0x1c');var _0x3f542d=_0x3f0c8e[_0x375f('0x1e')];var _0x21440e=_0x4dc375?0x0:_0xac5520['offset'];var _0x4a9460=_0x4dc375?_0x3f0c8e[_0x375f('0x1e')]:_0xac5520['offset']+_0xac5520[_0x375f('0x1d')];var _0x43b680;if(_0x4a9460>=_0x3f542d){_0x4a9460=_0x3f542d;_0x43b680=0xc8;}else{_0x43b680=0xce;}_0x362bf0[_0x375f('0x18')](_0x43b680);return _0x362bf0[_0x375f('0x1f')]('Content-Range',_0x21440e+'-'+_0x4a9460+'/'+_0x3f542d)[_0x375f('0x1a')](_0x3f0c8e);}return null;};}function patchUpdates(_0x2cb196){return function(_0x473fa5){try{jsonpatch[_0x375f('0x20')](_0x473fa5,_0x2cb196,!![]);}catch(_0x5a047c){return BPromise[_0x375f('0x21')](_0x5a047c);}return _0x473fa5[_0x375f('0x22')]();};}function saveUpdates(_0x5d41d2,_0x14d72f){return function(_0x40e1d0){if(_0x40e1d0){return _0x40e1d0[_0x375f('0x23')](_0x5d41d2)[_0x375f('0x24')](function(_0x285697){return _0x285697;});}return null;};}function removeEntity(_0x1b3d9e,_0x46a38e){return function(_0x2e742e){if(_0x2e742e){return _0x2e742e[_0x375f('0x25')]()[_0x375f('0x24')](function(){_0x1b3d9e[_0x375f('0x18')](0xcc)[_0x375f('0x19')]();});}};}function handleEntityNotFound(_0x52edcc,_0x136ec7){return function(_0x4d7811){if(!_0x4d7811){_0x52edcc[_0x375f('0x17')](0x194);}return _0x4d7811;};}function handleError(_0x5b56ad,_0x173d30){_0x173d30=_0x173d30||0x1f4;return function(_0x42a50c){logger[_0x375f('0x26')](_0x42a50c['stack']);if(_0x42a50c[_0x375f('0x27')]){delete _0x42a50c[_0x375f('0x27')];}_0x5b56ad[_0x375f('0x18')](_0x173d30)[_0x375f('0x28')](_0x42a50c);};}exports['index']=function(_0x50a850,_0x195fe8){var _0x2f650e={},_0x2c7526={},_0x29bac9={'count':0x0,'rows':[]};var _0xbf39ac=_[_0x375f('0x29')](db['VoiceRecording']['rawAttributes'],function(_0xbf2762){return{'name':_0xbf2762['fieldName'],'type':_0xbf2762[_0x375f('0x2a')][_0x375f('0x2b')]};});_0x2c7526[_0x375f('0x2c')]=_[_0x375f('0x2d')](_['map'](_0xbf39ac,_0x375f('0x27')),[_0x375f('0x2e')]);_0x2c7526['query']=_[_0x375f('0x2f')](_0x50a850['query']);_0x2c7526[_0x375f('0x30')]=_['intersection'](_0x2c7526['model'],_0x2c7526[_0x375f('0x31')]);_0x2f650e[_0x375f('0x32')]=_[_0x375f('0x33')](_0x2c7526[_0x375f('0x2c')],qs[_0x375f('0x34')](_0x50a850[_0x375f('0x31')][_0x375f('0x34')]));_0x2f650e['attributes']=_0x2f650e[_0x375f('0x32')][_0x375f('0x35')]?_0x2f650e[_0x375f('0x32')]:_0x2c7526['model'];if(!_0x50a850[_0x375f('0x31')][_0x375f('0x36')](_0x375f('0x37'))){_0x2f650e[_0x375f('0x1d')]=qs[_0x375f('0x1d')](_0x50a850[_0x375f('0x31')][_0x375f('0x1d')]);_0x2f650e['offset']=qs[_0x375f('0x1b')](_0x50a850[_0x375f('0x31')][_0x375f('0x1b')]);}_0x2f650e[_0x375f('0x38')]=qs[_0x375f('0x39')](_0x50a850['query'][_0x375f('0x39')]);_0x2f650e[_0x375f('0x3a')]=qs[_0x375f('0x30')](_[_0x375f('0x3b')](_0x50a850[_0x375f('0x31')],_0x2c7526[_0x375f('0x30')]),_0xbf39ac);if(_0x50a850['query'][_0x375f('0x3c')]){_0x2f650e['where']=_['merge'](_0x2f650e[_0x375f('0x3a')],{'$or':_[_0x375f('0x29')](_0xbf39ac,function(_0x1a6369){if(_0x1a6369[_0x375f('0x2a')]!==_0x375f('0x3d')){var _0x2314e2={};_0x2314e2[_0x1a6369[_0x375f('0x27')]]={'$like':'%'+_0x50a850[_0x375f('0x31')][_0x375f('0x3c')]+'%'};return _0x2314e2;}})});}_0x2f650e=_['merge']({},_0x2f650e,_0x50a850['options']);var _0x1804d5={'where':_0x2f650e[_0x375f('0x3a')]};return db[_0x375f('0x3e')][_0x375f('0x1e')](_0x1804d5)[_0x375f('0x24')](function(_0x1d6944){_0x29bac9[_0x375f('0x1e')]=_0x1d6944;if(_0x50a850[_0x375f('0x31')]['includeAll']){_0x2f650e[_0x375f('0x3f')]=[{'all':!![]}];}return db[_0x375f('0x3e')]['findAll'](_0x2f650e);})['then'](function(_0x1ad061){_0x29bac9[_0x375f('0x40')]=_0x1ad061;return _0x29bac9;})['then'](respondWithFilteredResult(_0x195fe8,_0x2f650e))[_0x375f('0x41')](handleError(_0x195fe8,null));};exports[_0x375f('0x42')]=function(_0xcefe4a,_0x4b0771){var _0x3261f7={'raw':![],'where':{'id':_0xcefe4a[_0x375f('0x43')]['id']}},_0x3d0873={};_0x3d0873[_0x375f('0x2c')]=_[_0x375f('0x2f')](db[_0x375f('0x3e')][_0x375f('0x44')]);_0x3d0873[_0x375f('0x31')]=_[_0x375f('0x2f')](_0xcefe4a['query']);_0x3d0873[_0x375f('0x30')]=_[_0x375f('0x33')](_0x3d0873[_0x375f('0x2c')],_0x3d0873[_0x375f('0x31')]);_0x3261f7[_0x375f('0x32')]=_['intersection'](_0x3d0873['model'],qs[_0x375f('0x34')](_0xcefe4a[_0x375f('0x31')]['fields']));_0x3261f7[_0x375f('0x32')]=_0x3261f7['attributes'][_0x375f('0x35')]?_0x3261f7[_0x375f('0x32')]:_0x3d0873[_0x375f('0x2c')];if(_0xcefe4a[_0x375f('0x31')][_0x375f('0x45')]){_0x3261f7[_0x375f('0x3f')]=[{'all':!![]}];}_0x3261f7=_[_0x375f('0x46')]({},_0x3261f7,_0xcefe4a[_0x375f('0x47')]);return db['VoiceRecording']['find'](_0x3261f7)['then'](handleEntityNotFound(_0x4b0771,null))['then'](respondWithResult(_0x4b0771,null))['catch'](handleError(_0x4b0771,null));};exports[_0x375f('0x48')]=function(_0x42f153,_0x20dade){return db[_0x375f('0x3e')][_0x375f('0x48')](_0x42f153['body'],{})[_0x375f('0x24')](respondWithResult(_0x20dade,0xc9))[_0x375f('0x41')](handleError(_0x20dade,null));};exports['update']=function(_0x5e9d04,_0x45a4c4){if(_0x5e9d04[_0x375f('0x49')]['id']){delete _0x5e9d04['body']['id'];}return db[_0x375f('0x3e')]['find']({'where':{'id':_0x5e9d04[_0x375f('0x43')]['id']}})['then'](handleEntityNotFound(_0x45a4c4,null))[_0x375f('0x24')](saveUpdates(_0x5e9d04[_0x375f('0x49')],null))[_0x375f('0x24')](respondWithResult(_0x45a4c4,null))[_0x375f('0x41')](handleError(_0x45a4c4,null));};exports[_0x375f('0x4a')]=function(_0x1c9dfd,_0x43ef3a){return db[_0x375f('0x3e')]['describe']()['then'](respondWithResult(_0x43ef3a,null))['catch'](handleError(_0x43ef3a,null));};exports['download']=function(_0x1bbf45,_0x57db1c,_0x4f4046){var _0x551134=require('../../components/encryptor');var _0x3576e4=![];var _0x41eff5={};if(_0x1bbf45[_0x375f('0x31')]['type']&&_0x1bbf45[_0x375f('0x31')][_0x375f('0x2a')]==='uniqueid'){_0x41eff5[_0x375f('0x4b')]=_0x1bbf45[_0x375f('0x43')]['id'];}else{_0x41eff5['id']=_0x1bbf45[_0x375f('0x43')]['id'];}return db[_0x375f('0x3e')][_0x375f('0x4c')]({'where':_0x41eff5,'attributes':['id','value'],'raw':!![]})[_0x375f('0x24')](handleEntityNotFound(_0x57db1c,null))[_0x375f('0x24')](function(_0x305700){if(_0x305700){var _0x169104=_0x305700[_0x375f('0x4d')];var _0x5bc015=util[_0x375f('0x2e')](_0x375f('0x4e'),_0x169104);if(fs['existsSync'](_0x5bc015)){_0x3576e4=!![];return _0x551134['decryptFile'](_0x5bc015,_0x169104,config['secrets'][_0x375f('0x4f')])['then'](function(){return _0x305700;});}return _0x305700;}})['then'](function(_0x49f3ad){if(_0x49f3ad){var _0x1660b5=_0x49f3ad[_0x375f('0x4d')];if(!fs[_0x375f('0x50')](_0x1660b5)){throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x52'));}if(_0x49f3ad[_0x375f('0x53')]){return _0x57db1c[_0x375f('0x54')](_0x1660b5,_0x49f3ad['filename']+path[_0x375f('0x55')](_0x1660b5),function(){if(_0x3576e4){fs[_0x375f('0x56')](_0x1660b5);}});}else{return _0x57db1c[_0x375f('0x54')](_0x1660b5,function(_0x239992){if(_0x3576e4){fs[_0x375f('0x56')](_0x1660b5);}});}}})[_0x375f('0x41')](function(_0x573d02){if(_0x573d02[_0x375f('0x57')]===_0x375f('0x52')){_0x57db1c[_0x375f('0x18')](0x194)[_0x375f('0x28')]('Not\x20found');}else{return handleError(_0x57db1c,null);}});};exports['downloads']=function(_0xb221d2,_0x31e43c,_0x5ea021){var _0x53dc91=require(_0x375f('0x58'));var _0x478077=![];var _0x76c2c8={'$and':[db['sequelize'][_0x375f('0x3a')](db[_0x375f('0x59')]['fn'](_0x375f('0x5a'),db['sequelize'][_0x375f('0x5b')]('uniqueid')),_0xb221d2[_0x375f('0x31')]['token'])]};if(_0xb221d2[_0x375f('0x31')][_0x375f('0x2a')]&&_0xb221d2['query'][_0x375f('0x2a')]===_0x375f('0x4b')){_0x76c2c8[_0x375f('0x5c')][_0x375f('0x5d')]({'uniqueid':_0xb221d2[_0x375f('0x43')]['id']});}else{_0x76c2c8[_0x375f('0x5c')][_0x375f('0x5d')]({'id':_0xb221d2[_0x375f('0x43')]['id']});}return db[_0x375f('0x3e')][_0x375f('0x4c')]({'where':_0x76c2c8,'attributes':['id',_0x375f('0x4d')],'raw':!![]})[_0x375f('0x24')](handleEntityNotFound(_0x31e43c,null))[_0x375f('0x24')](function(_0x12c5e6){if(_0x12c5e6){var _0x13c014=util[_0x375f('0x2e')]('%s.cypher',_0x12c5e6['value']);if(fs['existsSync'](_0x13c014)){_0x478077=!![];return _0x53dc91[_0x375f('0x5e')](_0x13c014,_0x12c5e6[_0x375f('0x4d')],config[_0x375f('0x5f')][_0x375f('0x4f')])[_0x375f('0x24')](function(){return _0x12c5e6;});}return _0x12c5e6;}})['then'](function(_0xd5154){if(_0xd5154){if(!fs[_0x375f('0x50')](_0xd5154[_0x375f('0x4d')])){throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x52'));}if(_0xd5154[_0x375f('0x53')]){return _0x31e43c[_0x375f('0x54')](_0xd5154['value'],_0xd5154[_0x375f('0x53')]+path[_0x375f('0x55')](_0xd5154[_0x375f('0x4d')]),function(){if(_0x478077){fs['unlink'](_0xd5154[_0x375f('0x4d')]);}});}else{return _0x31e43c[_0x375f('0x54')](_0xd5154[_0x375f('0x4d')],function(_0x51bb69){if(_0x478077){fs[_0x375f('0x56')](_0xd5154[_0x375f('0x4d')]);}});}}})[_0x375f('0x41')](handleError(_0x31e43c,null));};exports[_0x375f('0x25')]=function(_0x57f2ac,_0x184102){return db[_0x375f('0x3e')]['find']({'where':{'id':_0x57f2ac[_0x375f('0x43')]['id']}})[_0x375f('0x24')](function(_0x4c54b7){if(_[_0x375f('0x60')](_0x4c54b7)){throw new ReferenceError(_0x375f('0x61'));}return _0x4c54b7;})[_0x375f('0x24')](function(_0x4fa3b8){var _0x5667ce=_0x4fa3b8[_0x375f('0x4d')];logger[_0x375f('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x5667ce);if(!_[_0x375f('0x60')](_0x4fa3b8['value'])&&fs['existsSync'](_0x5667ce)){logger[_0x375f('0x62')](_0x375f('0x63')+_0x5667ce+_0x375f('0x64'));fs[_0x375f('0x65')](_0x5667ce);}_0x5667ce=_0x5667ce+_0x375f('0x66');if(!_[_0x375f('0x60')](_0x4fa3b8[_0x375f('0x4d')])&&fs['existsSync'](_0x5667ce)){logger['info']('File:\x20\x22'+_0x5667ce+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x375f('0x65')](_0x5667ce);}return _0x4fa3b8;})[_0x375f('0x24')](function(_0x5c9df1){if(!_0x5c9df1)throw new InternalError();return _0x5c9df1[_0x375f('0x25')]();})[_0x375f('0x24')](function(){_0x184102['status'](0xcc)[_0x375f('0x19')]();})[_0x375f('0x41')](handleError(_0x184102,null));};function getBucketslist(_0x1407e0,_0xb84f88,_0x25528){return new Promise(function(_0x4e95e6,_0x4c4c22){var _0x2acf6f=new AWS['S3']({'accessKeyId':_0xb84f88,'secretAccessKey':_0x1407e0,'region':_0x25528});_0x2acf6f['listBuckets']({},function(_0x5262c8,_0x574148){if(_0x5262c8){return _0x4c4c22(_0x5262c8);}else{return _0x4e95e6(_0x574148);}});});}function createBucket(_0x520cfa,_0x5968e3,_0x1e2ebb,_0x3acec0){return new Promise(function(_0x24524e,_0x3162b1){var _0x50137=new AWS['S3']({'accessKeyId':_0x5968e3,'secretAccessKey':_0x520cfa,'region':_0x1e2ebb});_0x50137['createBucket']({'Bucket':_0x3acec0},function(_0x3eb83f,_0x20a351){if(_0x3eb83f){return _0x3162b1(_0x3eb83f);}else{return _0x24524e(_0x20a351);}});});}function uploadFile(_0x1e55bf,_0x576e1a,_0x50c4b7,_0x345abf,_0x5a243a,_0x204f06){return new Promise(function(_0x4002db,_0x17d91f){var _0x517dc7=new AWS['S3']({'accessKeyId':_0x576e1a,'secretAccessKey':_0x1e55bf,'region':_0x50c4b7});_0x517dc7[_0x375f('0x67')]({'Bucket':_0x345abf,'Key':_0x5a243a,'Body':_0x204f06},function(_0x24e5f1,_0x4ed315){if(_0x24e5f1){return _0x17d91f(_0x24e5f1);}else{return _0x4002db(_0x4ed315);}});});}function startTranscribe(_0x1b3124,_0x15ff91,_0x8271b8,_0x19ef8a,_0x2e3399,_0x1ca39f){return new Promise(function(_0x543099,_0x1fd92e){var _0x3e5130=new AWS[(_0x375f('0x68'))]({'accessKeyId':_0x15ff91,'secretAccessKey':_0x1b3124,'region':_0x8271b8});_0x3e5130['startTranscriptionJob']({'TranscriptionJobName':_0x19ef8a,'LanguageCode':_0x2e3399,'Media':{'MediaFileUri':_0x1ca39f}},function(_0x2e5976,_0x1e99e1){if(_0x2e5976){return _0x1fd92e(_0x2e5976);}else{return _0x543099(_0x1e99e1);}});});}function transcribe(_0x360ea6,_0x2153e2,_0x5e8b36,_0x19d2f1,_0xa5d7b5,_0x58835e,_0x444cd9){return new Promise(function(_0x5985a7,_0x16151a){var _0x458caa={};logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x69'),_0x360ea6,_0xa5d7b5));return uploadFile(_0x2153e2,_0x5e8b36,_0x19d2f1,_0xa5d7b5,path[_0x375f('0x6a')](_0x58835e),fs[_0x375f('0x6b')](_0x58835e))[_0x375f('0x24')](function(_0x1561f9){logger[_0x375f('0x62')](util[_0x375f('0x2e')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x360ea6,_0xa5d7b5,_0x1561f9[_0x375f('0x6c')]));_0x458caa['bucket']=_0x1561f9[_0x375f('0x6d')];_0x458caa[_0x375f('0x6e')]=_0x1561f9[_0x375f('0x6c')];logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x6f'),_0x360ea6));return startTranscribe(_0x2153e2,_0x5e8b36,_0x19d2f1,uuidv4(),_0x444cd9,_0x1561f9[_0x375f('0x6c')]);})[_0x375f('0x24')](function(_0x56f3ea){logger['info'](util[_0x375f('0x2e')](_0x375f('0x70'),_0x360ea6,_0x56f3ea['TranscriptionJob'][_0x375f('0x71')]));_0x458caa[_0x375f('0x72')]=_0x56f3ea[_0x375f('0x73')][_0x375f('0x71')];_0x458caa[_0x375f('0x74')]=_0x56f3ea[_0x375f('0x73')][_0x375f('0x75')];return _0x5985a7(_0x458caa);})['catch'](function(_0x54e538){return _0x16151a(_0x54e538);});});}exports[_0x375f('0x76')]=function(_0x4076a2,_0x55f947,_0x1d6b6b){var _0x2a6953;var _0x2cdf93;var _0x1f749e;var _0x693f2d=require('../../components/encryptor');return db['VoiceRecording']['findOne']({'where':{'id':_0x4076a2[_0x375f('0x43')]['id']}})[_0x375f('0x24')](function(_0x169baa){if(_0x169baa){var _0x22af3b=util['format'](_0x375f('0x4e'),_0x169baa[_0x375f('0x4d')]);if(fs[_0x375f('0x50')](_0x22af3b)){cypher=!![];return _0x693f2d[_0x375f('0x5e')](_0x22af3b,_0x169baa[_0x375f('0x4d')],config['secrets'][_0x375f('0x4f')])[_0x375f('0x24')](function(){return _0x169baa;});}return _0x169baa;}})[_0x375f('0x24')](function(_0x273b90){if(!_0x273b90){throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x77'));}_0x2cdf93=_0x273b90;return db[_0x375f('0x78')][_0x375f('0x79')]({'where':{'id':0x1}});})[_0x375f('0x24')](handleEntityNotFound(_0x55f947,null))['then'](function(_0x5bf255){if(_0x5bf255){_0x2a6953=_0x5bf255;if(!_0x2a6953['transcribe']||!_0x2a6953[_0x375f('0x7a')]||!_0x2a6953[_0x375f('0x7b')]||!_0x2a6953[_0x375f('0x7c')]||!_0x2a6953['bucket']){throw new db[(_0x375f('0x51'))][(_0x375f('0x7d'))](_0x375f('0x7e'));}if(_0x4076a2[_0x375f('0x49')]['runSentiment']&&(!_0x2a6953[_0x375f('0x7f')]||!_0x2a6953['sentimentAccountId']||!_0x2a6953[_0x375f('0x80')]||!_0x2a6953['language']||!_0x2a6953[_0x375f('0x81')])){throw new db[(_0x375f('0x51'))][(_0x375f('0x7d'))](_0x375f('0x82'));}return db[_0x375f('0x83')]['findOne']({'where':{'id':_0x2a6953['transcribeAccountId']}});}})[_0x375f('0x24')](function(_0x3c002c){if(!_0x3c002c){throw new db['Sequelize'][(_0x375f('0x7d'))](_0x375f('0x84'));}if(!_0x3c002c[_0x375f('0x85')]||!_0x3c002c[_0x375f('0x86')]){throw new db['Sequelize'][(_0x375f('0x7d'))](_0x375f('0x87'));}_0x1f749e=_0x3c002c;return getBucketslist(_0x1f749e['data1'],_0x1f749e[_0x375f('0x86')],_0x2a6953[_0x375f('0x7b')]);})[_0x375f('0x24')](function(_0x2a827d){if(_0x2a827d&&_0x2a827d[_0x375f('0x88')]){var _0x5efdf3=_[_0x375f('0x4c')](_0x2a827d[_0x375f('0x88')],function(_0x32c1e3){return _0x32c1e3[_0x375f('0x89')]===_0x2a6953[_0x375f('0x81')];});if(!_0x5efdf3){logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x8a'),_0x4076a2[_0x375f('0x43')]['id'],_0x2a6953[_0x375f('0x81')]));return createBucket(_0x1f749e[_0x375f('0x85')],_0x1f749e['data2'],_0x2a6953[_0x375f('0x7b')],_0x2a6953['bucket']);}logger[_0x375f('0x62')](util[_0x375f('0x2e')](_0x375f('0x8b'),_0x4076a2[_0x375f('0x43')]['id'],_0x2a6953[_0x375f('0x81')]));return;}})[_0x375f('0x24')](function(_0x1f6e2b){if(_0x2cdf93[_0x375f('0x74')]===_0x375f('0x8c')){return transcribe(_0x4076a2[_0x375f('0x43')]['id'],_0x1f749e[_0x375f('0x85')],_0x1f749e['data2'],_0x2a6953['transcribeRegion'],_0x2a6953[_0x375f('0x81')],_0x2cdf93[_0x375f('0x4d')],_0x2a6953[_0x375f('0x7c')]);}else{logger[_0x375f('0x62')](util[_0x375f('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4076a2[_0x375f('0x43')]['id']));return{'transcribeStatus':_0x375f('0x8d')};}})[_0x375f('0x24')](function(_0x229918){if(_0x229918){_0x229918[_0x375f('0x8e')]=_0x4076a2[_0x375f('0x49')][_0x375f('0x8f')];return _0x2cdf93[_0x375f('0x90')](_0x229918);}})[_0x375f('0x24')](respondWithResult(_0x55f947,null))['catch'](handleError(_0x55f947,null));};function writeFile(_0x329579,_0x1a5c47){return new Promise(function(_0x2f5015,_0x28ff1d){fs[_0x375f('0x91')](_0x1a5c47,_0x329579,function(_0x266f32,_0x2c18e4){if(_0x266f32){return _0x28ff1d(_0x266f32);}else{return _0x2f5015(_0x2c18e4);}});});}exports[_0x375f('0x92')]=function(_0x913dd8,_0x147602,_0x230cfd){return db[_0x375f('0x3e')]['findOne']({'where':{'id':_0x913dd8[_0x375f('0x43')]['id']}})['then'](handleEntityNotFound(_0x147602))[_0x375f('0x24')](function(_0x3372e9){if(_0x3372e9&&_0x3372e9[_0x375f('0x93')]){var _0x3151cc=_0x3372e9[_0x375f('0x93')];var _0xdd0526=config[_0x375f('0x94')]+_0x375f('0x95')+_0x3372e9['id']+_0x375f('0x96');if(fs[_0x375f('0x50')](_0xdd0526)){return _0xdd0526;}return writeFile(_0x3151cc,_0xdd0526)[_0x375f('0x24')](function(){return _0xdd0526;});}else{throw new db[(_0x375f('0x51'))]['ValidationError'](_0x375f('0x97'));}})['then'](function(_0x1d7fdb){return _0x147602[_0x375f('0x54')](_0x1d7fdb);})[_0x375f('0x41')](handleError(_0x147602));}; \ No newline at end of file +var _0x11a8=['listBuckets','createBucket','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','eml-format','zip-dir','moment','bluebird','sox','to-csv','lodash','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','error','stack','name','index','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','map','format','query','keys','filters','intersection','attributes','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','then','rows','catch','show','params','fields','length','includeAll','find','create','body','describe','download','../../components/encryptor','uniqueid','existsSync','decryptFile','secrets','recording','value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','MD5','sequelize','col','token','push','$and','%s.cypher','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0x11a8,0x149));var _0x811a=function(_0x3183c6,_0x41f576){_0x3183c6=_0x3183c6-0x0;var _0x18b04e=_0x11a8[_0x3183c6];return _0x18b04e;};'use strict';var emlformat=require(_0x811a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x811a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x811a('0x2'));var BPromise=require(_0x811a('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x811a('0x4'));var csv=require(_0x811a('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x811a('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x811a('0x7'));var deskjs=require(_0x811a('0x8'));var toCsv=require(_0x811a('0x5'));var querystring=require(_0x811a('0x9'));var Papa=require('papaparse');var AWS=require(_0x811a('0xa'));var uuidv4=require(_0x811a('0xb'));var Redis=require(_0x811a('0xc'));var authService=require(_0x811a('0xd'));var qs=require(_0x811a('0xe'));var as=require(_0x811a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x811a('0x10'))(_0x811a('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x811a('0x12'));var db=require(_0x811a('0x13'))['db'];function respondWithStatusCode(_0x440939,_0x1f89ae){_0x1f89ae=_0x1f89ae||0xcc;return function(_0x5dddf1){if(_0x5dddf1){return _0x440939[_0x811a('0x14')](_0x1f89ae);}return _0x440939[_0x811a('0x15')](_0x1f89ae)[_0x811a('0x16')]();};}function respondWithResult(_0x181284,_0x4f916a){_0x4f916a=_0x4f916a||0xc8;return function(_0x591ff8){if(_0x591ff8){return _0x181284['status'](_0x4f916a)[_0x811a('0x17')](_0x591ff8);}};}function respondWithFilteredResult(_0x1bea1b,_0x5e7a80){return function(_0x2ecbfb){if(_0x2ecbfb){var _0xcbbc00=typeof _0x5e7a80[_0x811a('0x18')]===_0x811a('0x19')&&typeof _0x5e7a80[_0x811a('0x1a')]===_0x811a('0x19');var _0x3340d2=_0x2ecbfb[_0x811a('0x1b')];var _0x2e8384=_0xcbbc00?0x0:_0x5e7a80[_0x811a('0x18')];var _0x127ee5=_0xcbbc00?_0x2ecbfb[_0x811a('0x1b')]:_0x5e7a80[_0x811a('0x18')]+_0x5e7a80[_0x811a('0x1a')];var _0x11291a;if(_0x127ee5>=_0x3340d2){_0x127ee5=_0x3340d2;_0x11291a=0xc8;}else{_0x11291a=0xce;}_0x1bea1b[_0x811a('0x15')](_0x11291a);return _0x1bea1b[_0x811a('0x1c')]('Content-Range',_0x2e8384+'-'+_0x127ee5+'/'+_0x3340d2)[_0x811a('0x17')](_0x2ecbfb);}return null;};}function patchUpdates(_0x142677){return function(_0x543b38){try{jsonpatch[_0x811a('0x1d')](_0x543b38,_0x142677,!![]);}catch(_0x20b159){return BPromise['reject'](_0x20b159);}return _0x543b38[_0x811a('0x1e')]();};}function saveUpdates(_0x1adcc6,_0x4e994c){return function(_0x139c67){if(_0x139c67){return _0x139c67[_0x811a('0x1f')](_0x1adcc6)['then'](function(_0x13ad2f){return _0x13ad2f;});}return null;};}function removeEntity(_0x544d01,_0x165098){return function(_0x39212b){if(_0x39212b){return _0x39212b['destroy']()['then'](function(){_0x544d01[_0x811a('0x15')](0xcc)[_0x811a('0x16')]();});}};}function handleEntityNotFound(_0x13b24e,_0x213f24){return function(_0x531dad){if(!_0x531dad){_0x13b24e[_0x811a('0x14')](0x194);}return _0x531dad;};}function handleError(_0x4fe58b,_0xc74bc8){_0xc74bc8=_0xc74bc8||0x1f4;return function(_0x5892a5){logger[_0x811a('0x20')](_0x5892a5[_0x811a('0x21')]);if(_0x5892a5['name']){delete _0x5892a5[_0x811a('0x22')];}_0x4fe58b[_0x811a('0x15')](_0xc74bc8)['send'](_0x5892a5);};}exports[_0x811a('0x23')]=function(_0x2cc092,_0x3e50a8){var _0x3a1243={},_0x4aaf72={},_0x46fbf0={'count':0x0,'rows':[]};var _0x3fcb22=_['map'](db[_0x811a('0x24')][_0x811a('0x25')],function(_0x19f83d){return{'name':_0x19f83d[_0x811a('0x26')],'type':_0x19f83d[_0x811a('0x27')]['key']};});_0x4aaf72[_0x811a('0x28')]=_[_0x811a('0x29')](_[_0x811a('0x2a')](_0x3fcb22,'name'),[_0x811a('0x2b')]);_0x4aaf72[_0x811a('0x2c')]=_[_0x811a('0x2d')](_0x2cc092[_0x811a('0x2c')]);_0x4aaf72[_0x811a('0x2e')]=_[_0x811a('0x2f')](_0x4aaf72[_0x811a('0x28')],_0x4aaf72['query']);_0x3a1243[_0x811a('0x30')]=_['intersection'](_0x4aaf72[_0x811a('0x28')],qs['fields'](_0x2cc092[_0x811a('0x2c')]['fields']));_0x3a1243['attributes']=_0x3a1243[_0x811a('0x30')]['length']?_0x3a1243[_0x811a('0x30')]:_0x4aaf72[_0x811a('0x28')];if(!_0x2cc092[_0x811a('0x2c')]['hasOwnProperty'](_0x811a('0x31'))){_0x3a1243[_0x811a('0x1a')]=qs['limit'](_0x2cc092['query'][_0x811a('0x1a')]);_0x3a1243[_0x811a('0x18')]=qs[_0x811a('0x18')](_0x2cc092['query']['offset']);}_0x3a1243['order']=qs[_0x811a('0x32')](_0x2cc092['query'][_0x811a('0x32')]);_0x3a1243['where']=qs[_0x811a('0x2e')](_[_0x811a('0x33')](_0x2cc092[_0x811a('0x2c')],_0x4aaf72[_0x811a('0x2e')]),_0x3fcb22);if(_0x2cc092[_0x811a('0x2c')][_0x811a('0x34')]){_0x3a1243[_0x811a('0x35')]=_[_0x811a('0x36')](_0x3a1243[_0x811a('0x35')],{'$or':_[_0x811a('0x2a')](_0x3fcb22,function(_0x344b46){if(_0x344b46['type']!==_0x811a('0x37')){var _0x1ba1ec={};_0x1ba1ec[_0x344b46[_0x811a('0x22')]]={'$like':'%'+_0x2cc092['query'][_0x811a('0x34')]+'%'};return _0x1ba1ec;}})});}_0x3a1243=_['merge']({},_0x3a1243,_0x2cc092[_0x811a('0x38')]);var _0x316fcf={'where':_0x3a1243['where']};return db[_0x811a('0x24')][_0x811a('0x1b')](_0x316fcf)['then'](function(_0x439ed8){_0x46fbf0['count']=_0x439ed8;if(_0x2cc092['query']['includeAll']){_0x3a1243[_0x811a('0x39')]=[{'all':!![]}];}return db[_0x811a('0x24')][_0x811a('0x3a')](_0x3a1243);})[_0x811a('0x3b')](function(_0x25d2c4){_0x46fbf0[_0x811a('0x3c')]=_0x25d2c4;return _0x46fbf0;})[_0x811a('0x3b')](respondWithFilteredResult(_0x3e50a8,_0x3a1243))[_0x811a('0x3d')](handleError(_0x3e50a8,null));};exports[_0x811a('0x3e')]=function(_0x1eb03a,_0x25d9e6){var _0x56fc55={'raw':![],'where':{'id':_0x1eb03a[_0x811a('0x3f')]['id']}},_0x4155f9={};_0x4155f9[_0x811a('0x28')]=_[_0x811a('0x2d')](db[_0x811a('0x24')][_0x811a('0x25')]);_0x4155f9[_0x811a('0x2c')]=_[_0x811a('0x2d')](_0x1eb03a[_0x811a('0x2c')]);_0x4155f9['filters']=_[_0x811a('0x2f')](_0x4155f9[_0x811a('0x28')],_0x4155f9['query']);_0x56fc55[_0x811a('0x30')]=_['intersection'](_0x4155f9['model'],qs['fields'](_0x1eb03a[_0x811a('0x2c')][_0x811a('0x40')]));_0x56fc55[_0x811a('0x30')]=_0x56fc55[_0x811a('0x30')][_0x811a('0x41')]?_0x56fc55['attributes']:_0x4155f9['model'];if(_0x1eb03a[_0x811a('0x2c')][_0x811a('0x42')]){_0x56fc55['include']=[{'all':!![]}];}_0x56fc55=_[_0x811a('0x36')]({},_0x56fc55,_0x1eb03a[_0x811a('0x38')]);return db[_0x811a('0x24')][_0x811a('0x43')](_0x56fc55)[_0x811a('0x3b')](handleEntityNotFound(_0x25d9e6,null))['then'](respondWithResult(_0x25d9e6,null))['catch'](handleError(_0x25d9e6,null));};exports[_0x811a('0x44')]=function(_0x4dbfbf,_0x281461){return db['VoiceRecording'][_0x811a('0x44')](_0x4dbfbf[_0x811a('0x45')],{})[_0x811a('0x3b')](respondWithResult(_0x281461,0xc9))[_0x811a('0x3d')](handleError(_0x281461,null));};exports['update']=function(_0x522443,_0x1f382a){if(_0x522443[_0x811a('0x45')]['id']){delete _0x522443[_0x811a('0x45')]['id'];}return db[_0x811a('0x24')][_0x811a('0x43')]({'where':{'id':_0x522443['params']['id']}})['then'](handleEntityNotFound(_0x1f382a,null))['then'](saveUpdates(_0x522443[_0x811a('0x45')],null))[_0x811a('0x3b')](respondWithResult(_0x1f382a,null))['catch'](handleError(_0x1f382a,null));};exports[_0x811a('0x46')]=function(_0x584ec5,_0xa87025){return db[_0x811a('0x24')][_0x811a('0x46')]()[_0x811a('0x3b')](respondWithResult(_0xa87025,null))['catch'](handleError(_0xa87025,null));};exports[_0x811a('0x47')]=function(_0x1d4757,_0x24e993,_0x45dc4f){var _0xebff7d=require(_0x811a('0x48'));var _0x1a24bc=![];var _0xb017e5={};if(_0x1d4757[_0x811a('0x2c')][_0x811a('0x27')]&&_0x1d4757[_0x811a('0x2c')][_0x811a('0x27')]==='uniqueid'){_0xb017e5[_0x811a('0x49')]=_0x1d4757[_0x811a('0x3f')]['id'];}else{_0xb017e5['id']=_0x1d4757[_0x811a('0x3f')]['id'];}return db[_0x811a('0x24')][_0x811a('0x43')]({'where':_0xb017e5,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x24e993,null))[_0x811a('0x3b')](function(_0x341147){if(_0x341147){var _0x591b4b=_0x341147['value'];var _0x589a2f=util['format']('%s.cypher',_0x591b4b);if(fs[_0x811a('0x4a')](_0x589a2f)){_0x1a24bc=!![];return _0xebff7d[_0x811a('0x4b')](_0x589a2f,_0x591b4b,config[_0x811a('0x4c')][_0x811a('0x4d')])['then'](function(){return _0x341147;});}return _0x341147;}})[_0x811a('0x3b')](function(_0x40ba9e){if(_0x40ba9e){var _0x4e92e8=_0x40ba9e[_0x811a('0x4e')];if(!fs[_0x811a('0x4a')](_0x4e92e8)){throw new db[(_0x811a('0x4f'))][(_0x811a('0x50'))](_0x811a('0x51'));}if(_0x40ba9e[_0x811a('0x52')]){return _0x24e993['download'](_0x4e92e8,_0x40ba9e[_0x811a('0x52')]+path[_0x811a('0x53')](_0x4e92e8),function(){if(_0x1a24bc){fs[_0x811a('0x54')](_0x4e92e8);}});}else{return _0x24e993['download'](_0x4e92e8,function(_0x4f3993){if(_0x1a24bc){fs['unlink'](_0x4e92e8);}});}}})[_0x811a('0x3d')](function(_0x4cc0a5){if(_0x4cc0a5[_0x811a('0x55')]===_0x811a('0x51')){_0x24e993['status'](0x194)[_0x811a('0x56')](_0x811a('0x57'));}else{return handleError(_0x24e993,null);}});};exports['downloads']=function(_0x2b9982,_0x284d02,_0x53e1d7){var _0x25cfdd=require(_0x811a('0x48'));var _0x43c359=![];var _0x449be6={'$and':[db['sequelize'][_0x811a('0x35')](db['sequelize']['fn'](_0x811a('0x58'),db[_0x811a('0x59')][_0x811a('0x5a')]('uniqueid')),_0x2b9982['query'][_0x811a('0x5b')])]};if(_0x2b9982[_0x811a('0x2c')][_0x811a('0x27')]&&_0x2b9982[_0x811a('0x2c')][_0x811a('0x27')]===_0x811a('0x49')){_0x449be6['$and'][_0x811a('0x5c')]({'uniqueid':_0x2b9982['params']['id']});}else{_0x449be6[_0x811a('0x5d')][_0x811a('0x5c')]({'id':_0x2b9982[_0x811a('0x3f')]['id']});}return db['VoiceRecording'][_0x811a('0x43')]({'where':_0x449be6,'attributes':['id',_0x811a('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x284d02,null))['then'](function(_0x1c0f6f){if(_0x1c0f6f){var _0x5b0cbe=util[_0x811a('0x2b')](_0x811a('0x5e'),_0x1c0f6f[_0x811a('0x4e')]);if(fs[_0x811a('0x4a')](_0x5b0cbe)){_0x43c359=!![];return _0x25cfdd[_0x811a('0x4b')](_0x5b0cbe,_0x1c0f6f[_0x811a('0x4e')],config[_0x811a('0x4c')][_0x811a('0x4d')])[_0x811a('0x3b')](function(){return _0x1c0f6f;});}return _0x1c0f6f;}})['then'](function(_0x423950){if(_0x423950){if(!fs['existsSync'](_0x423950['value'])){throw new db[(_0x811a('0x4f'))]['ValidationError'](_0x811a('0x51'));}if(_0x423950[_0x811a('0x52')]){return _0x284d02[_0x811a('0x47')](_0x423950['value'],_0x423950[_0x811a('0x52')]+path[_0x811a('0x53')](_0x423950['value']),function(){if(_0x43c359){fs['unlink'](_0x423950[_0x811a('0x4e')]);}});}else{return _0x284d02['download'](_0x423950[_0x811a('0x4e')],function(_0x510c11){if(_0x43c359){fs['unlink'](_0x423950[_0x811a('0x4e')]);}});}}})['catch'](handleError(_0x284d02,null));};exports[_0x811a('0x5f')]=function(_0x47d844,_0x2c1720){return db[_0x811a('0x24')][_0x811a('0x43')]({'where':{'id':_0x47d844['params']['id']}})[_0x811a('0x3b')](function(_0xf56f14){if(_[_0x811a('0x60')](_0xf56f14)){throw new ReferenceError(_0x811a('0x61'));}return _0xf56f14;})[_0x811a('0x3b')](function(_0x539d6b){var _0x3b8975=_0x539d6b[_0x811a('0x4e')];logger[_0x811a('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x3b8975);if(!_[_0x811a('0x60')](_0x539d6b['value'])&&fs[_0x811a('0x4a')](_0x3b8975)){logger[_0x811a('0x62')](_0x811a('0x63')+_0x3b8975+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3b8975);}_0x3b8975=_0x3b8975+_0x811a('0x64');if(!_[_0x811a('0x60')](_0x539d6b[_0x811a('0x4e')])&&fs[_0x811a('0x4a')](_0x3b8975)){logger[_0x811a('0x62')](_0x811a('0x63')+_0x3b8975+_0x811a('0x65'));fs[_0x811a('0x66')](_0x3b8975);}return _0x539d6b;})[_0x811a('0x3b')](function(_0x3269ce){if(!_0x3269ce)throw new InternalError();return _0x3269ce[_0x811a('0x5f')]();})[_0x811a('0x3b')](function(){_0x2c1720['status'](0xcc)[_0x811a('0x16')]();})[_0x811a('0x3d')](handleError(_0x2c1720,null));};function getBucketslist(_0x227df0,_0x362f2b,_0x39d7ab){return new Promise(function(_0x12b8d2,_0x4cd937){var _0x175593=new AWS['S3']({'accessKeyId':_0x362f2b,'secretAccessKey':_0x227df0,'region':_0x39d7ab});_0x175593[_0x811a('0x67')]({},function(_0x1070b1,_0x47ddb6){if(_0x1070b1){return _0x4cd937(_0x1070b1);}else{return _0x12b8d2(_0x47ddb6);}});});}function createBucket(_0x39585d,_0x59d9a1,_0x140e80,_0x1d8219){return new Promise(function(_0x4b63df,_0x4702cc){var _0x378d0e=new AWS['S3']({'accessKeyId':_0x59d9a1,'secretAccessKey':_0x39585d,'region':_0x140e80});_0x378d0e[_0x811a('0x68')]({'Bucket':_0x1d8219},function(_0x136d44,_0x454879){if(_0x136d44){return _0x4702cc(_0x136d44);}else{return _0x4b63df(_0x454879);}});});}function uploadFile(_0x3f9e2d,_0x1de019,_0xea4160,_0x3cb709,_0x1cdb55,_0x39997f){return new Promise(function(_0x3d6bb9,_0xa37864){var _0x422f1f=new AWS['S3']({'accessKeyId':_0x1de019,'secretAccessKey':_0x3f9e2d,'region':_0xea4160});_0x422f1f['upload']({'Bucket':_0x3cb709,'Key':_0x1cdb55,'Body':_0x39997f},function(_0x40dc4e,_0x409f3e){if(_0x40dc4e){return _0xa37864(_0x40dc4e);}else{return _0x3d6bb9(_0x409f3e);}});});}function startTranscribe(_0x165c95,_0x419a60,_0x176373,_0x200e01,_0x122c49,_0x2ee298){return new Promise(function(_0x379b0a,_0x65712d){var _0x277ccc=new AWS[(_0x811a('0x69'))]({'accessKeyId':_0x419a60,'secretAccessKey':_0x165c95,'region':_0x176373});_0x277ccc[_0x811a('0x6a')]({'TranscriptionJobName':_0x200e01,'LanguageCode':_0x122c49,'Media':{'MediaFileUri':_0x2ee298}},function(_0x31f5c4,_0x549401){if(_0x31f5c4){return _0x65712d(_0x31f5c4);}else{return _0x379b0a(_0x549401);}});});}function transcribe(_0x42da97,_0x31d5cb,_0x2380b4,_0x1043af,_0x5cfe32,_0x2ba399,_0x3df44a){return new Promise(function(_0x3bc095,_0xefd139){var _0x2f61f3={};logger['info'](util[_0x811a('0x2b')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x42da97,_0x5cfe32));return uploadFile(_0x31d5cb,_0x2380b4,_0x1043af,_0x5cfe32,path[_0x811a('0x6b')](_0x2ba399),fs['readFileSync'](_0x2ba399))[_0x811a('0x3b')](function(_0x15b9ba){logger[_0x811a('0x62')](util[_0x811a('0x2b')](_0x811a('0x6c'),_0x42da97,_0x5cfe32,_0x15b9ba[_0x811a('0x6d')]));_0x2f61f3['bucket']=_0x15b9ba[_0x811a('0x6e')];_0x2f61f3['location']=_0x15b9ba[_0x811a('0x6d')];logger['info'](util[_0x811a('0x2b')](_0x811a('0x6f'),_0x42da97));return startTranscribe(_0x31d5cb,_0x2380b4,_0x1043af,uuidv4(),_0x3df44a,_0x15b9ba['Location']);})['then'](function(_0x5768c5){logger[_0x811a('0x62')](util[_0x811a('0x2b')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x42da97,_0x5768c5[_0x811a('0x70')][_0x811a('0x71')]));_0x2f61f3[_0x811a('0x72')]=_0x5768c5[_0x811a('0x70')][_0x811a('0x71')];_0x2f61f3[_0x811a('0x73')]=_0x5768c5['TranscriptionJob'][_0x811a('0x74')];return _0x3bc095(_0x2f61f3);})[_0x811a('0x3d')](function(_0x5af41d){return _0xefd139(_0x5af41d);});});}exports[_0x811a('0x75')]=function(_0x1232b5,_0xcc3f5f,_0x359a44){var _0x2466c1;var _0x480d3d;var _0x828edf;var _0x3c47fa=require(_0x811a('0x48'));return db[_0x811a('0x24')][_0x811a('0x76')]({'where':{'id':_0x1232b5['params']['id']}})[_0x811a('0x3b')](function(_0x59cc24){if(_0x59cc24){var _0xf96a5=util[_0x811a('0x2b')](_0x811a('0x5e'),_0x59cc24[_0x811a('0x4e')]);if(fs[_0x811a('0x4a')](_0xf96a5)){cypher=!![];return _0x3c47fa[_0x811a('0x4b')](_0xf96a5,_0x59cc24[_0x811a('0x4e')],config[_0x811a('0x4c')][_0x811a('0x4d')])[_0x811a('0x3b')](function(){return _0x59cc24;});}return _0x59cc24;}})['then'](function(_0x273e21){if(!_0x273e21){throw new db['Sequelize']['ValidationError'](_0x811a('0x77'));}_0x480d3d=_0x273e21;return db[_0x811a('0x78')]['findOne']({'where':{'id':0x1}});})[_0x811a('0x3b')](handleEntityNotFound(_0xcc3f5f,null))[_0x811a('0x3b')](function(_0x21e09f){if(_0x21e09f){_0x2466c1=_0x21e09f;if(!_0x2466c1['transcribe']||!_0x2466c1[_0x811a('0x79')]||!_0x2466c1[_0x811a('0x7a')]||!_0x2466c1[_0x811a('0x7b')]||!_0x2466c1[_0x811a('0x7c')]){throw new db[(_0x811a('0x4f'))][(_0x811a('0x50'))]('Transcribe\x20not\x20configured');}if(_0x1232b5[_0x811a('0x45')][_0x811a('0x7d')]&&(!_0x2466c1[_0x811a('0x7e')]||!_0x2466c1[_0x811a('0x7f')]||!_0x2466c1['sentimentRegion']||!_0x2466c1[_0x811a('0x7b')]||!_0x2466c1[_0x811a('0x7c')])){throw new db[(_0x811a('0x4f'))]['ValidationError'](_0x811a('0x80'));}return db[_0x811a('0x81')][_0x811a('0x76')]({'where':{'id':_0x2466c1[_0x811a('0x79')]}});}})['then'](function(_0x62547f){if(!_0x62547f){throw new db[(_0x811a('0x4f'))]['ValidationError'](_0x811a('0x82'));}if(!_0x62547f[_0x811a('0x83')]||!_0x62547f[_0x811a('0x84')]){throw new db[(_0x811a('0x4f'))][(_0x811a('0x50'))](_0x811a('0x85'));}_0x828edf=_0x62547f;return getBucketslist(_0x828edf[_0x811a('0x83')],_0x828edf['data2'],_0x2466c1[_0x811a('0x7a')]);})[_0x811a('0x3b')](function(_0x30ac12){if(_0x30ac12&&_0x30ac12[_0x811a('0x86')]){var _0x2edaad=_[_0x811a('0x43')](_0x30ac12[_0x811a('0x86')],function(_0x5ea4d7){return _0x5ea4d7[_0x811a('0x87')]===_0x2466c1[_0x811a('0x7c')];});if(!_0x2edaad){logger[_0x811a('0x62')](util[_0x811a('0x2b')](_0x811a('0x88'),_0x1232b5[_0x811a('0x3f')]['id'],_0x2466c1[_0x811a('0x7c')]));return createBucket(_0x828edf[_0x811a('0x83')],_0x828edf[_0x811a('0x84')],_0x2466c1['transcribeRegion'],_0x2466c1[_0x811a('0x7c')]);}logger[_0x811a('0x62')](util['format'](_0x811a('0x89'),_0x1232b5[_0x811a('0x3f')]['id'],_0x2466c1[_0x811a('0x7c')]));return;}})[_0x811a('0x3b')](function(_0x12a777){if(_0x480d3d[_0x811a('0x73')]==='NEW'){return transcribe(_0x1232b5[_0x811a('0x3f')]['id'],_0x828edf[_0x811a('0x83')],_0x828edf[_0x811a('0x84')],_0x2466c1[_0x811a('0x7a')],_0x2466c1[_0x811a('0x7c')],_0x480d3d[_0x811a('0x4e')],_0x2466c1[_0x811a('0x7b')]);}else{logger[_0x811a('0x62')](util[_0x811a('0x2b')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x1232b5[_0x811a('0x3f')]['id']));return{'transcribeStatus':_0x811a('0x8a')};}})['then'](function(_0x368d22){if(_0x368d22){_0x368d22['tempSentiment']=_0x1232b5['body']['runSentiment'];return _0x480d3d[_0x811a('0x8b')](_0x368d22);}})[_0x811a('0x3b')](respondWithResult(_0xcc3f5f,null))['catch'](handleError(_0xcc3f5f,null));};function writeFile(_0x5f235d,_0x6bcb0b){return new Promise(function(_0x540a37,_0x295c3e){fs[_0x811a('0x8c')](_0x6bcb0b,_0x5f235d,function(_0x148bad,_0xdb3e1){if(_0x148bad){return _0x295c3e(_0x148bad);}else{return _0x540a37(_0xdb3e1);}});});}exports[_0x811a('0x8d')]=function(_0x1ed05e,_0xbfeb5e,_0x1b2690){return db[_0x811a('0x24')][_0x811a('0x76')]({'where':{'id':_0x1ed05e[_0x811a('0x3f')]['id']}})[_0x811a('0x3b')](handleEntityNotFound(_0xbfeb5e))['then'](function(_0x485052){if(_0x485052&&_0x485052[_0x811a('0x8e')]){var _0x5e039c=_0x485052['fileText'];var _0x55423e=config['root']+_0x811a('0x8f')+_0x485052['id']+'.txt';if(fs[_0x811a('0x4a')](_0x55423e)){return _0x55423e;}return writeFile(_0x5e039c,_0x55423e)['then'](function(){return _0x55423e;});}else{throw new db['Sequelize'][(_0x811a('0x50'))]('Transcript\x20not\x20available');}})[_0x811a('0x3b')](function(_0x788cab){return _0xbfeb5e[_0x811a('0x47')](_0x788cab);})[_0x811a('0x3d')](handleError(_0xbfeb5e));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 4805524..83548fb 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 _0x8eeb=['uniqueid','transcribeStatus','./voiceRecording.attributes','VoiceRecording','voice_recordings'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x8eeb,0x183));var _0xb8ee=function(_0x45ac8d,_0x39a7dc){_0x45ac8d=_0x45ac8d-0x0;var _0x46642a=_0x8eeb[_0x45ac8d];return _0x46642a;};'use strict';var attributes=require(_0xb8ee('0x0'));module['exports']=function(_0x464dec,_0x2b3ac1){return _0x464dec['define'](_0xb8ee('0x1'),attributes,{'tableName':_0xb8ee('0x2'),'paranoid':![],'indexes':[{'name':_0xb8ee('0x3'),'fields':[_0xb8ee('0x3')]},{'name':_0xb8ee('0x4'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0xfaa4=['define','VoiceRecording','uniqueid','transcribeStatus','./voiceRecording.attributes','exports'];(function(_0x4b2672,_0x39f6ab){var _0x1bf5d7=function(_0x297edf){while(--_0x297edf){_0x4b2672['push'](_0x4b2672['shift']());}};_0x1bf5d7(++_0x39f6ab);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x17e47b,_0x21abfe){_0x17e47b=_0x17e47b-0x0;var _0x978d5a=_0xfaa4[_0x17e47b];return _0x978d5a;};'use strict';var attributes=require(_0x4faa('0x0'));module[_0x4faa('0x1')]=function(_0x28b375,_0x39ba1a){return _0x28b375[_0x4faa('0x2')](_0x4faa('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x4faa('0x4'),'fields':[_0x4faa('0x4')]},{'name':_0x4faa('0x5'),'fields':[_0x4faa('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 4b2f1da..be8f1fc 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 _0x9f0e=['format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','limit','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','existsSync','value'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9f0e,0x116));var _0xe9f0=function(_0x443ad5,_0x3e213a){_0x443ad5=_0x443ad5-0x0;var _0x4fba27=_0x9f0e[_0x443ad5];return _0x4fba27;};'use strict';var _=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var moment=require(_0xe9f0('0x2'));var BPromise=require(_0xe9f0('0x3'));var rs=require(_0xe9f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x5'));var logger=require(_0xe9f0('0x6'))(_0xe9f0('0x7'));var config=require(_0xe9f0('0x8'));var jayson=require(_0xe9f0('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a17b3,_0x167198,_0xe64a79){return new BPromise(function(_0x4be6a6,_0xf4a256){return client[_0xe9f0('0xa')](_0x3a17b3,_0xe64a79)[_0xe9f0('0xb')](function(_0x3386a8){logger[_0xe9f0('0xc')](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));logger[_0xe9f0('0xf')](_0xe9f0('0x10'),_0x167198,'request\x20sent',JSON[_0xe9f0('0x11')](_0x3386a8));if(_0x3386a8[_0xe9f0('0x12')]){if(_0x3386a8[_0xe9f0('0x12')]['code']===0x1f4){logger[_0xe9f0('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x167198,_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);return _0xf4a256(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}logger['error'](_0xe9f0('0xd'),_0x167198,_0x3386a8['error'][_0xe9f0('0x13')]);return _0x4be6a6(_0x3386a8[_0xe9f0('0x12')][_0xe9f0('0x13')]);}else{logger['info'](_0xe9f0('0xd'),_0x167198,_0xe9f0('0xe'));_0x4be6a6(_0x3386a8[_0xe9f0('0x14')]['message']);}})[_0xe9f0('0x15')](function(_0x1e16e0){logger[_0xe9f0('0x12')](_0xe9f0('0xd'),_0x167198,_0x1e16e0);_0xf4a256(_0x1e16e0);});});}exports[_0xe9f0('0x16')]=function(_0x2ab12b){var _0x3da237=this;return new Promise(function(_0x59bf5a,_0x15a33b){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0x2ab12b['body'],{'raw':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options'][_0xe9f0('0x1b')]||null:null,'attributes':_0x2ab12b[_0xe9f0('0x19')]?_0x2ab12b['options']['attributes']||null:null,'limit':_0x2ab12b['options']?_0x2ab12b[_0xe9f0('0x19')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0xb')](function(_0x316cdf){logger[_0xe9f0('0xc')]('UpdateVoiceRecording',_0x2ab12b);logger[_0xe9f0('0xf')](_0xe9f0('0x16'),_0x2ab12b,JSON[_0xe9f0('0x11')](_0x316cdf));_0x59bf5a(_0x316cdf);})[_0xe9f0('0x15')](function(_0x3ca991){logger[_0xe9f0('0x12')](_0xe9f0('0x16'),_0x3ca991[_0xe9f0('0x13')],_0x2ab12b);_0x15a33b(_0x3da237[_0xe9f0('0x12')](0x1f4,_0x3ca991[_0xe9f0('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x371095){var _0x27541f=this;return new Promise(function(_0x2ddfba,_0x1a8478){var _0x4cf1b1=require(_0xe9f0('0x1d'));var _0x2613fd;return db[_0xe9f0('0x1e')][_0xe9f0('0x1f')]({'attributes':['id',_0xe9f0('0x20')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x130f96){_0x2613fd=_0x130f96;return db[_0xe9f0('0x17')][_0xe9f0('0x21')](_0x371095[_0xe9f0('0x22')]);})[_0xe9f0('0xb')](function(_0xd19788){if(_0x2613fd[_0xe9f0('0x20')]&&fs[_0xe9f0('0x23')](_0xd19788[_0xe9f0('0x24')])){var _0x3dbe49=util[_0xe9f0('0x25')](_0xe9f0('0x26'),_0xd19788[_0xe9f0('0x24')]);return _0x4cf1b1[_0xe9f0('0x27')](_0xd19788[_0xe9f0('0x24')],_0x3dbe49,config[_0xe9f0('0x28')][_0xe9f0('0x29')])[_0xe9f0('0xb')](function(){fs[_0xe9f0('0x2a')](_0xd19788[_0xe9f0('0x24')]);logger[_0xe9f0('0xc')](_0xe9f0('0x2b'));return _0xd19788;});}return _0xd19788;})[_0xe9f0('0xb')](function(_0x3611c0){logger['info']('CreateVoiceRecording',_0x371095);logger['debug'](_0xe9f0('0x2c'),_0x371095,JSON['stringify'](_0x3611c0));_0x2ddfba(_0x3611c0);})[_0xe9f0('0x15')](function(_0xc5fa13){logger['error'](_0xe9f0('0x2c'),_0xc5fa13['message'],_0x371095);_0x1a8478(_0x27541f['error'](0x1f4,_0xc5fa13['message']));});});}; \ No newline at end of file +var _0xbff5=['catch','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','%s.cypher','encryptFile','value','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','update','options','raw','where','attributes','then','UpdateVoiceRecording','debug'];(function(_0x5b50ae,_0x7da7e1){var _0x84eb56=function(_0xad6b38){while(--_0xad6b38){_0x5b50ae['push'](_0x5b50ae['shift']());}};_0x84eb56(++_0x7da7e1);}(_0xbff5,0x1bc));var _0x5bff=function(_0x291fb0,_0x577551){_0x291fb0=_0x291fb0-0x0;var _0x19e9f6=_0xbff5[_0x291fb0];return _0x19e9f6;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}exports['UpdateVoiceRecording']=function(_0xc9fbc3){var _0x279c22=this;return new Promise(function(_0x36653b,_0x32cf60){return db['VoiceRecording'][_0x5bff('0x15')](_0xc9fbc3['body'],{'raw':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3['options'][_0x5bff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'attributes':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x19')]||null:null,'limit':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')]['limit']||null:null})[_0x5bff('0x1a')](function(_0x263cf5){logger[_0x5bff('0x13')](_0x5bff('0x1b'),_0xc9fbc3);logger[_0x5bff('0x1c')](_0x5bff('0x1b'),_0xc9fbc3,JSON[_0x5bff('0xf')](_0x263cf5));_0x36653b(_0x263cf5);})[_0x5bff('0x1d')](function(_0x5e2ae8){logger['error'](_0x5bff('0x1b'),_0x5e2ae8['message'],_0xc9fbc3);_0x32cf60(_0x279c22[_0x5bff('0x10')](0x1f4,_0x5e2ae8[_0x5bff('0x12')]));});});};exports[_0x5bff('0x1e')]=function(_0x6f18f1){var _0xfa361d=this;return new Promise(function(_0x1140eb,_0x271f3c){var _0xedba9d=require('../../components/encryptor');var _0x4df57a;return db[_0x5bff('0x1f')][_0x5bff('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5bff('0x1a')](function(_0x588078){_0x4df57a=_0x588078;return db['VoiceRecording'][_0x5bff('0x21')](_0x6f18f1['body']);})[_0x5bff('0x1a')](function(_0x64e22){if(_0x4df57a[_0x5bff('0x22')]&&fs[_0x5bff('0x23')](_0x64e22['value'])){var _0x71783=util['format'](_0x5bff('0x24'),_0x64e22['value']);return _0xedba9d[_0x5bff('0x25')](_0x64e22[_0x5bff('0x26')],_0x71783,config[_0x5bff('0x27')][_0x5bff('0x28')])[_0x5bff('0x1a')](function(){fs[_0x5bff('0x29')](_0x64e22['value']);logger[_0x5bff('0x13')](_0x5bff('0x2a'));return _0x64e22;});}return _0x64e22;})[_0x5bff('0x1a')](function(_0x42fe4a){logger[_0x5bff('0x13')](_0x5bff('0x1e'),_0x6f18f1);logger[_0x5bff('0x1c')](_0x5bff('0x1e'),_0x6f18f1,JSON['stringify'](_0x42fe4a));_0x1140eb(_0x42fe4a);})[_0x5bff('0x1d')](function(_0x16042d){logger[_0x5bff('0x10')](_0x5bff('0x1e'),_0x16042d['message'],_0x6f18f1);_0x271f3c(_0xfa361d[_0x5bff('0x10')](0x1f4,_0x16042d[_0x5bff('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 0845131..e95f369 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 _0x22e2=['./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','create','put','/:id','update','destroy','multer','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4fbde2,_0x364951){var _0x2bce29=function(_0x3a97c9){while(--_0x3a97c9){_0x4fbde2['push'](_0x4fbde2['shift']());}};_0x2bce29(++_0x364951);}(_0x22e2,0x6b));var _0x222e=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x22e2[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0x222e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x222e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x222e('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x222e('0x3'));var config=require(_0x222e('0x4'));var controller=require(_0x222e('0x5'));router[_0x222e('0x6')]('/',auth[_0x222e('0x7')](),controller[_0x222e('0x8')]);router[_0x222e('0x6')](_0x222e('0x9'),auth['isAuthenticated'](),controller[_0x222e('0xa')]);router[_0x222e('0x6')]('/:id',auth[_0x222e('0x7')](),controller['show']);router['post']('/',auth[_0x222e('0x7')](),controller[_0x222e('0xb')]);router[_0x222e('0xc')](_0x222e('0xd'),auth[_0x222e('0x7')](),controller[_0x222e('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x222e('0xf')]);module['exports']=router; \ No newline at end of file +var _0x54fd=['isAuthenticated','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x1c309c,_0x5d8058){var _0x504e71=function(_0x45b7e8){while(--_0x45b7e8){_0x1c309c['push'](_0x1c309c['shift']());}};_0x504e71(++_0x5d8058);}(_0x54fd,0xd9));var _0xd54f=function(_0x3bf81f,_0x5703ec){_0x3bf81f=_0x3bf81f-0x0;var _0x373554=_0x54fd[_0x3bf81f];return _0x373554;};'use strict';var multer=require('multer');var util=require(_0xd54f('0x0'));var path=require(_0xd54f('0x1'));var timeout=require(_0xd54f('0x2'));var express=require('express');var router=express[_0xd54f('0x3')]();var fs_extra=require(_0xd54f('0x4'));var auth=require(_0xd54f('0x5'));var interaction=require(_0xd54f('0x6'));var config=require(_0xd54f('0x7'));var controller=require('./voiceTransferReport.controller');router[_0xd54f('0x8')]('/',auth['isAuthenticated'](),controller[_0xd54f('0x9')]);router[_0xd54f('0x8')](_0xd54f('0xa'),auth[_0xd54f('0xb')](),controller['describe']);router[_0xd54f('0x8')]('/:id',auth[_0xd54f('0xb')](),controller['show']);router[_0xd54f('0xc')]('/',auth[_0xd54f('0xb')](),controller[_0xd54f('0xd')]);router[_0xd54f('0xe')](_0xd54f('0xf'),auth[_0xd54f('0xb')](),controller['update']);router[_0xd54f('0x10')](_0xd54f('0xf'),auth[_0xd54f('0xb')](),controller[_0xd54f('0x11')]);module[_0xd54f('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index a02d840..01b4bb5 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 _0x3071=['STRING','moment','exports','ENUM','attended'];(function(_0x2bfb31,_0xdd9aae){var _0x2b00ce=function(_0x3ddbfa){while(--_0x3ddbfa){_0x2bfb31['push'](_0x2bfb31['shift']());}};_0x2b00ce(++_0xdd9aae);}(_0x3071,0x1c8));var _0x1307=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x3071[_0x3a78a0];return _0x48e917;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1307('0x0'));module[_0x1307('0x1')]={'type':{'type':Sequelize[_0x1307('0x2')]('blind',_0x1307('0x3'))},'result':{'type':Sequelize[_0x1307('0x4')]},'transfererchannel':{'type':Sequelize[_0x1307('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1307('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1307('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x1307('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x1307('0x4')]},'transferercontext':{'type':Sequelize[_0x1307('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1307('0x4')]},'transfereechannel':{'type':Sequelize[_0x1307('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x1307('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1307('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1307('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1307('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x1307('0x4')]},'extension':{'type':Sequelize[_0x1307('0x4')]}}; \ No newline at end of file +var _0xd982=['attended','STRING','sequelize','moment','exports','ENUM'];(function(_0x5c0dcb,_0x16cd83){var _0x183a0e=function(_0xfb292d){while(--_0xfb292d){_0x5c0dcb['push'](_0x5c0dcb['shift']());}};_0x183a0e(++_0x16cd83);}(_0xd982,0xce));var _0x2d98=function(_0x406582,_0x1afa9e){_0x406582=_0x406582-0x0;var _0x22cd64=_0xd982[_0x406582];return _0x22cd64;};'use strict';var Sequelize=require(_0x2d98('0x0'));var moment=require(_0x2d98('0x1'));module[_0x2d98('0x2')]={'type':{'type':Sequelize[_0x2d98('0x3')]('blind',_0x2d98('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x2d98('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x2d98('0x5')]},'transferercalleridname':{'type':Sequelize[_0x2d98('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2d98('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x2d98('0x5')]},'transfererexten':{'type':Sequelize[_0x2d98('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x2d98('0x5')]},'transfereechannel':{'type':Sequelize[_0x2d98('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2d98('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x2d98('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x2d98('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x2d98('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x2d98('0x5')]},'transfereecontext':{'type':Sequelize[_0x2d98('0x5')]},'transfereeexten':{'type':Sequelize[_0x2d98('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x2d98('0x5')]},'isexternal':{'type':Sequelize[_0x2d98('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x2d98('0x5')]},'extension':{'type':Sequelize[_0x2d98('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 3129880..8c2437c 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 _0xcf9f=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','model','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','intersection','attributes','fields','VoiceTransferReport','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xcf9f,0x16c));var _0xfcf9=function(_0x1418a5,_0x19c106){_0x1418a5=_0x1418a5-0x0;var _0x22c849=_0xcf9f[_0x1418a5];return _0x22c849;};'use strict';var emlformat=require(_0xfcf9('0x0'));var rimraf=require(_0xfcf9('0x1'));var zipdir=require(_0xfcf9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcf9('0x3'));var moment=require(_0xfcf9('0x4'));var BPromise=require(_0xfcf9('0x5'));var Mustache=require(_0xfcf9('0x6'));var util=require(_0xfcf9('0x7'));var path=require(_0xfcf9('0x8'));var sox=require(_0xfcf9('0x9'));var csv=require(_0xfcf9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcf9('0xb'));var _=require(_0xfcf9('0xc'));var squel=require('squel');var crypto=require(_0xfcf9('0xd'));var jsforce=require(_0xfcf9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfcf9('0xa'));var querystring=require(_0xfcf9('0xf'));var Papa=require(_0xfcf9('0x10'));var Redis=require('ioredis');var authService=require(_0xfcf9('0x11'));var qs=require(_0xfcf9('0x12'));var as=require(_0xfcf9('0x13'));var hardwareService=require(_0xfcf9('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfcf9('0x15'));var config=require(_0xfcf9('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcf9('0x17'))['db'];function respondWithStatusCode(_0xe951e7,_0x10102e){_0x10102e=_0x10102e||0xcc;return function(_0x715b73){if(_0x715b73){return _0xe951e7[_0xfcf9('0x18')](_0x10102e);}return _0xe951e7[_0xfcf9('0x19')](_0x10102e)['end']();};}function respondWithResult(_0x1a6fe4,_0xdea654){_0xdea654=_0xdea654||0xc8;return function(_0x2eb6e0){if(_0x2eb6e0){return _0x1a6fe4[_0xfcf9('0x19')](_0xdea654)['json'](_0x2eb6e0);}};}function respondWithFilteredResult(_0x3b8d59,_0x3eece3){return function(_0x2ffab3){if(_0x2ffab3){var _0x71c1fd=typeof _0x3eece3[_0xfcf9('0x1a')]===_0xfcf9('0x1b')&&typeof _0x3eece3['limit']==='undefined';var _0x60597b=_0x2ffab3[_0xfcf9('0x1c')];var _0x916043=_0x71c1fd?0x0:_0x3eece3[_0xfcf9('0x1a')];var _0x95340d=_0x71c1fd?_0x2ffab3['count']:_0x3eece3['offset']+_0x3eece3[_0xfcf9('0x1d')];var _0x5c163c;if(_0x95340d>=_0x60597b){_0x95340d=_0x60597b;_0x5c163c=0xc8;}else{_0x5c163c=0xce;}_0x3b8d59[_0xfcf9('0x19')](_0x5c163c);return _0x3b8d59[_0xfcf9('0x1e')](_0xfcf9('0x1f'),_0x916043+'-'+_0x95340d+'/'+_0x60597b)[_0xfcf9('0x20')](_0x2ffab3);}return null;};}function patchUpdates(_0x5d60b7){return function(_0x53e079){try{jsonpatch[_0xfcf9('0x21')](_0x53e079,_0x5d60b7,!![]);}catch(_0x4ed4af){return BPromise['reject'](_0x4ed4af);}return _0x53e079[_0xfcf9('0x22')]();};}function saveUpdates(_0x35b84b,_0x4acdff){return function(_0x5d98d5){if(_0x5d98d5){return _0x5d98d5[_0xfcf9('0x23')](_0x35b84b)['then'](function(_0x25265f){return _0x25265f;});}return null;};}function removeEntity(_0x118233,_0x45614a){return function(_0x406014){if(_0x406014){return _0x406014[_0xfcf9('0x24')]()[_0xfcf9('0x25')](function(){_0x118233[_0xfcf9('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x402113,_0x177e82){return function(_0x37494b){if(!_0x37494b){_0x402113[_0xfcf9('0x18')](0x194);}return _0x37494b;};}function handleError(_0x54adde,_0x229f35){_0x229f35=_0x229f35||0x1f4;return function(_0x35cd64){logger[_0xfcf9('0x26')](_0x35cd64[_0xfcf9('0x27')]);if(_0x35cd64[_0xfcf9('0x28')]){delete _0x35cd64[_0xfcf9('0x28')];}_0x54adde[_0xfcf9('0x19')](_0x229f35)[_0xfcf9('0x29')](_0x35cd64);};}exports[_0xfcf9('0x2a')]=function(_0xb4abd1,_0x3e3ae3){var _0x3b9088={},_0x2e9bbd={},_0x3b176e={'count':0x0,'rows':[]};var _0x44f3d1=_[_0xfcf9('0x2b')](db['VoiceTransferReport']['rawAttributes'],function(_0x764077){return{'name':_0x764077[_0xfcf9('0x2c')],'type':_0x764077[_0xfcf9('0x2d')][_0xfcf9('0x2e')]};});_0x2e9bbd['model']=_[_0xfcf9('0x2b')](_0x44f3d1,_0xfcf9('0x28'));_0x2e9bbd['query']=_[_0xfcf9('0x2f')](_0xb4abd1[_0xfcf9('0x30')]);_0x2e9bbd[_0xfcf9('0x31')]=_['intersection'](_0x2e9bbd['model'],_0x2e9bbd[_0xfcf9('0x30')]);_0x3b9088['attributes']=_['intersection'](_0x2e9bbd[_0xfcf9('0x32')],qs['fields'](_0xb4abd1[_0xfcf9('0x30')]['fields']));_0x3b9088['attributes']=_0x3b9088['attributes'][_0xfcf9('0x33')]?_0x3b9088['attributes']:_0x2e9bbd[_0xfcf9('0x32')];if(!_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x34')]('nolimit')){_0x3b9088['limit']=qs[_0xfcf9('0x1d')](_0xb4abd1[_0xfcf9('0x30')]['limit']);_0x3b9088['offset']=qs[_0xfcf9('0x1a')](_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x1a')]);}_0x3b9088[_0xfcf9('0x35')]=qs['sort'](_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x36')]);_0x3b9088[_0xfcf9('0x37')]=qs[_0xfcf9('0x31')](_[_0xfcf9('0x38')](_0xb4abd1[_0xfcf9('0x30')],_0x2e9bbd[_0xfcf9('0x31')]),_0x44f3d1);if(_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x39')]){_0x3b9088[_0xfcf9('0x37')]=_[_0xfcf9('0x3a')](_0x3b9088['where'],{'$or':_['map'](_0x44f3d1,function(_0x2d063a){if(_0x2d063a['type']!==_0xfcf9('0x3b')){var _0x323d8c={};_0x323d8c[_0x2d063a[_0xfcf9('0x28')]]={'$like':'%'+_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x39')]+'%'};return _0x323d8c;}})});}_0x3b9088=_[_0xfcf9('0x3a')]({},_0x3b9088,_0xb4abd1['options']);var _0x44e1ab={'where':_0x3b9088[_0xfcf9('0x37')]};return db['VoiceTransferReport'][_0xfcf9('0x1c')](_0x44e1ab)[_0xfcf9('0x25')](function(_0x199208){_0x3b176e[_0xfcf9('0x1c')]=_0x199208;if(_0xb4abd1[_0xfcf9('0x30')][_0xfcf9('0x3c')]){_0x3b9088[_0xfcf9('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xfcf9('0x3e')](_0x3b9088);})[_0xfcf9('0x25')](function(_0x802770){_0x3b176e[_0xfcf9('0x3f')]=_0x802770;return _0x3b176e;})[_0xfcf9('0x25')](respondWithFilteredResult(_0x3e3ae3,_0x3b9088))['catch'](handleError(_0x3e3ae3,null));};exports[_0xfcf9('0x40')]=function(_0x1a537d,_0x57f79e){var _0x3db653={'raw':!![],'where':{'id':_0x1a537d['params']['id']}},_0x21c82c={};_0x21c82c['model']=_[_0xfcf9('0x2f')](db['VoiceTransferReport'][_0xfcf9('0x41')]);_0x21c82c[_0xfcf9('0x30')]=_[_0xfcf9('0x2f')](_0x1a537d[_0xfcf9('0x30')]);_0x21c82c[_0xfcf9('0x31')]=_[_0xfcf9('0x42')](_0x21c82c['model'],_0x21c82c[_0xfcf9('0x30')]);_0x3db653[_0xfcf9('0x43')]=_[_0xfcf9('0x42')](_0x21c82c['model'],qs[_0xfcf9('0x44')](_0x1a537d['query'][_0xfcf9('0x44')]));_0x3db653[_0xfcf9('0x43')]=_0x3db653['attributes'][_0xfcf9('0x33')]?_0x3db653[_0xfcf9('0x43')]:_0x21c82c[_0xfcf9('0x32')];if(_0x1a537d[_0xfcf9('0x30')][_0xfcf9('0x3c')]){_0x3db653[_0xfcf9('0x3d')]=[{'all':!![]}];}_0x3db653=_[_0xfcf9('0x3a')]({},_0x3db653,_0x1a537d['options']);return db[_0xfcf9('0x45')]['find'](_0x3db653)[_0xfcf9('0x25')](handleEntityNotFound(_0x57f79e,null))[_0xfcf9('0x25')](respondWithResult(_0x57f79e,null))[_0xfcf9('0x46')](handleError(_0x57f79e,null));};exports[_0xfcf9('0x47')]=function(_0x23c226,_0x34fc5e){return db[_0xfcf9('0x45')][_0xfcf9('0x47')](_0x23c226[_0xfcf9('0x48')],{})[_0xfcf9('0x25')](respondWithResult(_0x34fc5e,0xc9))[_0xfcf9('0x46')](handleError(_0x34fc5e,null));};exports[_0xfcf9('0x23')]=function(_0x26eec4,_0x2ab9eb){if(_0x26eec4[_0xfcf9('0x48')]['id']){delete _0x26eec4[_0xfcf9('0x48')]['id'];}return db[_0xfcf9('0x45')][_0xfcf9('0x49')]({'where':{'id':_0x26eec4[_0xfcf9('0x4a')]['id']}})[_0xfcf9('0x25')](handleEntityNotFound(_0x2ab9eb,null))[_0xfcf9('0x25')](saveUpdates(_0x26eec4[_0xfcf9('0x48')],null))[_0xfcf9('0x25')](respondWithResult(_0x2ab9eb,null))[_0xfcf9('0x46')](handleError(_0x2ab9eb,null));};exports[_0xfcf9('0x24')]=function(_0x239d97,_0x36c24b){return db[_0xfcf9('0x45')][_0xfcf9('0x49')]({'where':{'id':_0x239d97['params']['id']}})[_0xfcf9('0x25')](handleEntityNotFound(_0x36c24b,null))[_0xfcf9('0x25')](removeEntity(_0x36c24b,null))[_0xfcf9('0x46')](handleError(_0x36c24b,null));};exports[_0xfcf9('0x4b')]=function(_0x4c4786,_0x3a9ab4){return db[_0xfcf9('0x45')][_0xfcf9('0x4b')]()[_0xfcf9('0x25')](respondWithResult(_0x3a9ab4,null))['catch'](handleError(_0x3a9ab4,null));}; \ No newline at end of file +var _0x9f4e=['body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','send','map','VoiceTransferReport','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','options','create'];(function(_0x494965,_0x48ace5){var _0x3e682e=function(_0x463373){while(--_0x463373){_0x494965['push'](_0x494965['shift']());}};_0x3e682e(++_0x48ace5);}(_0x9f4e,0x91));var _0xe9f4=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9f4e[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0xe9f4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe9f4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe9f4('0x2'));var moment=require(_0xe9f4('0x3'));var BPromise=require(_0xe9f4('0x4'));var Mustache=require(_0xe9f4('0x5'));var util=require(_0xe9f4('0x6'));var path=require(_0xe9f4('0x7'));var sox=require('sox');var csv=require(_0xe9f4('0x8'));var ejs=require(_0xe9f4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f4('0xa'));var squel=require(_0xe9f4('0xb'));var crypto=require('crypto');var jsforce=require(_0xe9f4('0xc'));var deskjs=require(_0xe9f4('0xd'));var toCsv=require(_0xe9f4('0x8'));var querystring=require('querystring');var Papa=require(_0xe9f4('0xe'));var Redis=require(_0xe9f4('0xf'));var authService=require(_0xe9f4('0x10'));var qs=require(_0xe9f4('0x11'));var as=require(_0xe9f4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9f4('0x13'))(_0xe9f4('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe9f4('0x15'));var db=require(_0xe9f4('0x16'))['db'];function respondWithStatusCode(_0x2ee461,_0x44c160){_0x44c160=_0x44c160||0xcc;return function(_0x5b114b){if(_0x5b114b){return _0x2ee461[_0xe9f4('0x17')](_0x44c160);}return _0x2ee461[_0xe9f4('0x18')](_0x44c160)[_0xe9f4('0x19')]();};}function respondWithResult(_0x3c2ed4,_0x48f40c){_0x48f40c=_0x48f40c||0xc8;return function(_0x14e4a1){if(_0x14e4a1){return _0x3c2ed4[_0xe9f4('0x18')](_0x48f40c)[_0xe9f4('0x1a')](_0x14e4a1);}};}function respondWithFilteredResult(_0x55cb17,_0x2a0abd){return function(_0x11bdc6){if(_0x11bdc6){var _0x92b14d=typeof _0x2a0abd[_0xe9f4('0x1b')]===_0xe9f4('0x1c')&&typeof _0x2a0abd[_0xe9f4('0x1d')]===_0xe9f4('0x1c');var _0x29a3c5=_0x11bdc6[_0xe9f4('0x1e')];var _0x2a16cb=_0x92b14d?0x0:_0x2a0abd['offset'];var _0x141e00=_0x92b14d?_0x11bdc6[_0xe9f4('0x1e')]:_0x2a0abd[_0xe9f4('0x1b')]+_0x2a0abd[_0xe9f4('0x1d')];var _0xf3e9f2;if(_0x141e00>=_0x29a3c5){_0x141e00=_0x29a3c5;_0xf3e9f2=0xc8;}else{_0xf3e9f2=0xce;}_0x55cb17[_0xe9f4('0x18')](_0xf3e9f2);return _0x55cb17[_0xe9f4('0x1f')](_0xe9f4('0x20'),_0x2a16cb+'-'+_0x141e00+'/'+_0x29a3c5)[_0xe9f4('0x1a')](_0x11bdc6);}return null;};}function patchUpdates(_0x774f74){return function(_0x20f29d){try{jsonpatch['apply'](_0x20f29d,_0x774f74,!![]);}catch(_0x44b8da){return BPromise[_0xe9f4('0x21')](_0x44b8da);}return _0x20f29d['save']();};}function saveUpdates(_0x2ad646,_0x30131a){return function(_0x15eea2){if(_0x15eea2){return _0x15eea2[_0xe9f4('0x22')](_0x2ad646)[_0xe9f4('0x23')](function(_0x1fd635){return _0x1fd635;});}return null;};}function removeEntity(_0x175562,_0x1bc1de){return function(_0x41da7d){if(_0x41da7d){return _0x41da7d[_0xe9f4('0x24')]()[_0xe9f4('0x23')](function(){_0x175562[_0xe9f4('0x18')](0xcc)[_0xe9f4('0x19')]();});}};}function handleEntityNotFound(_0x54acb7,_0x379f00){return function(_0x2e7afe){if(!_0x2e7afe){_0x54acb7[_0xe9f4('0x17')](0x194);}return _0x2e7afe;};}function handleError(_0x3df55c,_0x36b60a){_0x36b60a=_0x36b60a||0x1f4;return function(_0xf1953c){logger[_0xe9f4('0x25')](_0xf1953c['stack']);if(_0xf1953c[_0xe9f4('0x26')]){delete _0xf1953c[_0xe9f4('0x26')];}_0x3df55c['status'](_0x36b60a)[_0xe9f4('0x27')](_0xf1953c);};}exports['index']=function(_0x443c23,_0x3842bb){var _0x528ddd={},_0x2199f5={},_0x3c3a03={'count':0x0,'rows':[]};var _0x1706f9=_[_0xe9f4('0x28')](db[_0xe9f4('0x29')]['rawAttributes'],function(_0x2b6c91){return{'name':_0x2b6c91[_0xe9f4('0x2a')],'type':_0x2b6c91[_0xe9f4('0x2b')]['key']};});_0x2199f5[_0xe9f4('0x2c')]=_['map'](_0x1706f9,_0xe9f4('0x26'));_0x2199f5[_0xe9f4('0x2d')]=_[_0xe9f4('0x2e')](_0x443c23[_0xe9f4('0x2d')]);_0x2199f5['filters']=_[_0xe9f4('0x2f')](_0x2199f5[_0xe9f4('0x2c')],_0x2199f5[_0xe9f4('0x2d')]);_0x528ddd[_0xe9f4('0x30')]=_[_0xe9f4('0x2f')](_0x2199f5[_0xe9f4('0x2c')],qs[_0xe9f4('0x31')](_0x443c23[_0xe9f4('0x2d')][_0xe9f4('0x31')]));_0x528ddd['attributes']=_0x528ddd[_0xe9f4('0x30')]['length']?_0x528ddd[_0xe9f4('0x30')]:_0x2199f5[_0xe9f4('0x2c')];if(!_0x443c23[_0xe9f4('0x2d')][_0xe9f4('0x32')](_0xe9f4('0x33'))){_0x528ddd[_0xe9f4('0x1d')]=qs[_0xe9f4('0x1d')](_0x443c23[_0xe9f4('0x2d')][_0xe9f4('0x1d')]);_0x528ddd['offset']=qs[_0xe9f4('0x1b')](_0x443c23[_0xe9f4('0x2d')]['offset']);}_0x528ddd['order']=qs['sort'](_0x443c23['query'][_0xe9f4('0x34')]);_0x528ddd[_0xe9f4('0x35')]=qs[_0xe9f4('0x36')](_['pick'](_0x443c23[_0xe9f4('0x2d')],_0x2199f5['filters']),_0x1706f9);if(_0x443c23[_0xe9f4('0x2d')]['filter']){_0x528ddd[_0xe9f4('0x35')]=_[_0xe9f4('0x37')](_0x528ddd[_0xe9f4('0x35')],{'$or':_[_0xe9f4('0x28')](_0x1706f9,function(_0x568517){if(_0x568517[_0xe9f4('0x2b')]!==_0xe9f4('0x38')){var _0x45c9cf={};_0x45c9cf[_0x568517[_0xe9f4('0x26')]]={'$like':'%'+_0x443c23[_0xe9f4('0x2d')][_0xe9f4('0x39')]+'%'};return _0x45c9cf;}})});}_0x528ddd=_[_0xe9f4('0x37')]({},_0x528ddd,_0x443c23['options']);var _0xb8faba={'where':_0x528ddd[_0xe9f4('0x35')]};return db['VoiceTransferReport'][_0xe9f4('0x1e')](_0xb8faba)[_0xe9f4('0x23')](function(_0x35faba){_0x3c3a03[_0xe9f4('0x1e')]=_0x35faba;if(_0x443c23['query'][_0xe9f4('0x3a')]){_0x528ddd[_0xe9f4('0x3b')]=[{'all':!![]}];}return db[_0xe9f4('0x29')]['findAll'](_0x528ddd);})[_0xe9f4('0x23')](function(_0x2b0319){_0x3c3a03[_0xe9f4('0x3c')]=_0x2b0319;return _0x3c3a03;})[_0xe9f4('0x23')](respondWithFilteredResult(_0x3842bb,_0x528ddd))[_0xe9f4('0x3d')](handleError(_0x3842bb,null));};exports[_0xe9f4('0x3e')]=function(_0x2bbc03,_0x920a95){var _0x5c1be4={'raw':!![],'where':{'id':_0x2bbc03[_0xe9f4('0x3f')]['id']}},_0x4472d0={};_0x4472d0['model']=_[_0xe9f4('0x2e')](db[_0xe9f4('0x29')][_0xe9f4('0x40')]);_0x4472d0[_0xe9f4('0x2d')]=_[_0xe9f4('0x2e')](_0x2bbc03[_0xe9f4('0x2d')]);_0x4472d0[_0xe9f4('0x36')]=_['intersection'](_0x4472d0[_0xe9f4('0x2c')],_0x4472d0['query']);_0x5c1be4['attributes']=_[_0xe9f4('0x2f')](_0x4472d0[_0xe9f4('0x2c')],qs[_0xe9f4('0x31')](_0x2bbc03[_0xe9f4('0x2d')][_0xe9f4('0x31')]));_0x5c1be4['attributes']=_0x5c1be4['attributes'][_0xe9f4('0x41')]?_0x5c1be4[_0xe9f4('0x30')]:_0x4472d0[_0xe9f4('0x2c')];if(_0x2bbc03['query']['includeAll']){_0x5c1be4['include']=[{'all':!![]}];}_0x5c1be4=_[_0xe9f4('0x37')]({},_0x5c1be4,_0x2bbc03[_0xe9f4('0x42')]);return db[_0xe9f4('0x29')]['find'](_0x5c1be4)[_0xe9f4('0x23')](handleEntityNotFound(_0x920a95,null))[_0xe9f4('0x23')](respondWithResult(_0x920a95,null))[_0xe9f4('0x3d')](handleError(_0x920a95,null));};exports['create']=function(_0x2fa599,_0x585350){return db[_0xe9f4('0x29')][_0xe9f4('0x43')](_0x2fa599[_0xe9f4('0x44')],{})['then'](respondWithResult(_0x585350,0xc9))[_0xe9f4('0x3d')](handleError(_0x585350,null));};exports['update']=function(_0x1a39d1,_0x1c524d){if(_0x1a39d1[_0xe9f4('0x44')]['id']){delete _0x1a39d1[_0xe9f4('0x44')]['id'];}return db[_0xe9f4('0x29')][_0xe9f4('0x45')]({'where':{'id':_0x1a39d1['params']['id']}})[_0xe9f4('0x23')](handleEntityNotFound(_0x1c524d,null))[_0xe9f4('0x23')](saveUpdates(_0x1a39d1[_0xe9f4('0x44')],null))[_0xe9f4('0x23')](respondWithResult(_0x1c524d,null))[_0xe9f4('0x3d')](handleError(_0x1c524d,null));};exports[_0xe9f4('0x24')]=function(_0x40641d,_0x7c7471){return db[_0xe9f4('0x29')]['find']({'where':{'id':_0x40641d[_0xe9f4('0x3f')]['id']}})[_0xe9f4('0x23')](handleEntityNotFound(_0x7c7471,null))[_0xe9f4('0x23')](removeEntity(_0x7c7471,null))[_0xe9f4('0x3d')](handleError(_0x7c7471,null));};exports['describe']=function(_0xf6bca9,_0x540cfc){return db[_0xe9f4('0x29')][_0xe9f4('0x46')]()[_0xe9f4('0x23')](respondWithResult(_0x540cfc,null))[_0xe9f4('0x3d')](handleError(_0x540cfc,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 2fd73d9..247ae6c 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 _0xde1a=['../../config/logger','moment','request-promise','rimraf','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','util'];(function(_0x39ce42,_0x433108){var _0x350573=function(_0x4ecc4a){while(--_0x4ecc4a){_0x39ce42['push'](_0x39ce42['shift']());}};_0x350573(++_0x433108);}(_0xde1a,0x7d));var _0xade1=function(_0x428a14,_0x510f26){_0x428a14=_0x428a14-0x0;var _0x73b385=_0xde1a[_0x428a14];return _0x73b385;};'use strict';var _=require('lodash');var util=require(_0xade1('0x0'));var logger=require(_0xade1('0x1'))('api');var moment=require(_0xade1('0x2'));var BPromise=require('bluebird');var rp=require(_0xade1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xade1('0x4'));var config=require('../../config/environment');var attributes=require(_0xade1('0x5'));module['exports']=function(_0xbefc0d,_0x537e99){return _0xbefc0d[_0xade1('0x6')](_0xade1('0x7'),attributes,{'tableName':_0xade1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f4a=['path','rimraf','../../config/environment','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x7f4a,0x7b));var _0xa7f4=function(_0x1c14ae,_0x25ecce){_0x1c14ae=_0x1c14ae-0x0;var _0x24c7cf=_0x7f4a[_0x1c14ae];return _0x24c7cf;};'use strict';var _=require(_0xa7f4('0x0'));var util=require(_0xa7f4('0x1'));var logger=require(_0xa7f4('0x2'))(_0xa7f4('0x3'));var moment=require(_0xa7f4('0x4'));var BPromise=require(_0xa7f4('0x5'));var rp=require(_0xa7f4('0x6'));var fs=require('fs');var path=require(_0xa7f4('0x7'));var rimraf=require(_0xa7f4('0x8'));var config=require(_0xa7f4('0x9'));var attributes=require('./voiceTransferReport.attributes');module[_0xa7f4('0xa')]=function(_0x103074,_0x34cf88){return _0x103074[_0xa7f4('0xb')](_0xa7f4('0xc'),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 aa5f92a..c99bf6d 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 _0x86af=['../../config/logger','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','lodash','moment','randomstring','ioredis'];(function(_0x163e8c,_0x563bda){var _0x295821=function(_0x1be529){while(--_0x1be529){_0x163e8c['push'](_0x163e8c['shift']());}};_0x295821(++_0x563bda);}(_0x86af,0x80));var _0xf86a=function(_0x57d953,_0x312449){_0x57d953=_0x57d953-0x0;var _0x11924a=_0x86af[_0x57d953];return _0x11924a;};'use strict';var _=require(_0xf86a('0x0'));var util=require('util');var moment=require(_0xf86a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf86a('0x2'));var fs=require('fs');var Redis=require(_0xf86a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf86a('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf86a('0x5'));var client=jayson[_0xf86a('0x6')][_0xf86a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7b3800,_0xa016fb,_0x2da30e){return new BPromise(function(_0x24f55b,_0x51251e){return client[_0xf86a('0x8')](_0x7b3800,_0x2da30e)[_0xf86a('0x9')](function(_0x28949e){logger['info'](_0xf86a('0xa'),_0xa016fb,_0xf86a('0xb'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xa016fb,'request\x20sent',JSON[_0xf86a('0xc')](_0x28949e));if(_0x28949e[_0xf86a('0xd')]){if(_0x28949e[_0xf86a('0xd')][_0xf86a('0xe')]===0x1f4){logger[_0xf86a('0xd')](_0xf86a('0xa'),_0xa016fb,_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);return _0x51251e(_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);}logger[_0xf86a('0xd')](_0xf86a('0xa'),_0xa016fb,_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);return _0x24f55b(_0x28949e[_0xf86a('0xd')][_0xf86a('0xf')]);}else{logger[_0xf86a('0x10')](_0xf86a('0xa'),_0xa016fb,'request\x20sent');_0x24f55b(_0x28949e['result'][_0xf86a('0xf')]);}})[_0xf86a('0x11')](function(_0x7191dc){logger[_0xf86a('0xd')](_0xf86a('0xa'),_0xa016fb,_0x7191dc);_0x51251e(_0x7191dc);});});}exports[_0xf86a('0x12')]=function(_0x21ad6b){var _0x518ff6=this;return new Promise(function(_0x1019d1,_0x38cddb){return db[_0xf86a('0x13')]['create'](_0x21ad6b[_0xf86a('0x14')],{'raw':_0x21ad6b[_0xf86a('0x15')]?_0x21ad6b[_0xf86a('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xf86a('0x9')](function(_0x29ac8a){logger[_0xf86a('0x10')]('CreateVoiceTransferReport',_0x21ad6b);logger['debug'](_0xf86a('0x12'),_0x21ad6b,JSON[_0xf86a('0xc')](_0x29ac8a));_0x1019d1(_0x29ac8a);})[_0xf86a('0x11')](function(_0x186972){logger[_0xf86a('0xd')](_0xf86a('0x12'),_0x186972[_0xf86a('0xf')],_0x21ad6b);_0x38cddb(_0x518ff6['error'](0x1f4,_0x186972[_0xf86a('0xf')]));});});}; \ No newline at end of file +var _0x5377=['then','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','debug','stringify','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request'];(function(_0x32bd5,_0x4fcab6){var _0x3f4a6f=function(_0x2b75b5){while(--_0x2b75b5){_0x32bd5['push'](_0x32bd5['shift']());}};_0x3f4a6f(++_0x4fcab6);}(_0x5377,0x115));var _0x7537=function(_0x59d55e,_0x50e2ef){_0x59d55e=_0x59d55e-0x0;var _0x31eb62=_0x5377[_0x59d55e];return _0x31eb62;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7537('0x0'));var BPromise=require(_0x7537('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7537('0x2'));var db=require(_0x7537('0x3'))['db'];var utils=require(_0x7537('0x4'));var logger=require(_0x7537('0x5'))('rpc');var config=require(_0x7537('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7537('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf8bf2c,_0x5b815a,_0x3abc7e){return new BPromise(function(_0x144c0d,_0x57dd3a){return client[_0x7537('0x8')](_0xf8bf2c,_0x3abc7e)[_0x7537('0x9')](function(_0x244e3f){logger['info'](_0x7537('0xa'),_0x5b815a,'request\x20sent');logger['debug'](_0x7537('0xb'),_0x5b815a,_0x7537('0xc'),JSON['stringify'](_0x244e3f));if(_0x244e3f[_0x7537('0xd')]){if(_0x244e3f[_0x7537('0xd')][_0x7537('0xe')]===0x1f4){logger[_0x7537('0xd')](_0x7537('0xa'),_0x5b815a,_0x244e3f[_0x7537('0xd')][_0x7537('0xf')]);return _0x57dd3a(_0x244e3f[_0x7537('0xd')][_0x7537('0xf')]);}logger[_0x7537('0xd')](_0x7537('0xa'),_0x5b815a,_0x244e3f[_0x7537('0xd')]['message']);return _0x144c0d(_0x244e3f[_0x7537('0xd')][_0x7537('0xf')]);}else{logger['info'](_0x7537('0xa'),_0x5b815a,_0x7537('0xc'));_0x144c0d(_0x244e3f['result'][_0x7537('0xf')]);}})[_0x7537('0x10')](function(_0x1e0115){logger[_0x7537('0xd')](_0x7537('0xa'),_0x5b815a,_0x1e0115);_0x57dd3a(_0x1e0115);});});}exports[_0x7537('0x11')]=function(_0x4abb00){var _0x3d04ce=this;return new Promise(function(_0x2e84a6,_0x3b1444){return db[_0x7537('0x12')][_0x7537('0x13')](_0x4abb00[_0x7537('0x14')],{'raw':_0x4abb00[_0x7537('0x15')]?_0x4abb00[_0x7537('0x15')][_0x7537('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1decf5){logger[_0x7537('0x17')]('CreateVoiceTransferReport',_0x4abb00);logger[_0x7537('0x18')](_0x7537('0x11'),_0x4abb00,JSON[_0x7537('0x19')](_0x1decf5));_0x2e84a6(_0x1decf5);})[_0x7537('0x10')](function(_0x18ab2c){logger[_0x7537('0xd')](_0x7537('0x11'),_0x18ab2c[_0x7537('0xf')],_0x4abb00);_0x3b1444(_0x3d04ce[_0x7537('0xd')](0x1f4,_0x18ab2c[_0x7537('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 8d46622..10b1418 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 _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xcb91[_0x95411e];return _0x2c8718;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file +var _0xaa88=['/hold','/unhold','/calls','calls','transfer','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer'];(function(_0x18af4b,_0x175b3c){var _0x1935c5=function(_0x16c212){while(--_0x16c212){_0x18af4b['push'](_0x18af4b['shift']());}};_0x1935c5(++_0x175b3c);}(_0xaa88,0x137));var _0x8aa8=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0xaa88[_0x1646fa];return _0x5a47a5;};'use strict';var express=require(_0x8aa8('0x0'));var router=express[_0x8aa8('0x1')]();var auth=require(_0x8aa8('0x2'));var controller=require(_0x8aa8('0x3'));router['post'](_0x8aa8('0x4'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x7')]);router[_0x8aa8('0x8')](_0x8aa8('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x8aa8('0xa')]);router['post'](_0x8aa8('0xb'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0xc')]);router['post'](_0x8aa8('0xd'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['hold']);router[_0x8aa8('0x8')](_0x8aa8('0xe'),auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller['unhold']);router[_0x8aa8('0x8')](_0x8aa8('0xf'),auth['isAuthenticated'](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x10')]);router[_0x8aa8('0x8')]('/transfer',auth[_0x8aa8('0x5')](),auth[_0x8aa8('0x6')](),controller[_0x8aa8('0x11')]);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 876fdc0..a11a81d 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 _0x76dc=['agent','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','originate','info','body','length','json','userId','callerId','format','user:%s','webbar:originate','originate\x20executed!','hangup','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','filter','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','http','ioredis','redis','defaults','socket.io-emitter','validate','string','callNumber\x20is\x20required','userId\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','catch','User','findOne'];(function(_0x829d5d,_0x520c80){var _0x13df56=function(_0x1acdb4){while(--_0x1acdb4){_0x829d5d['push'](_0x829d5d['shift']());}};_0x13df56(++_0x520c80);}(_0x76dc,0x1f2));var _0xc76d=function(_0x4b150e,_0x192d6d){_0x4b150e=_0x4b150e-0x0;var _0x17d1ae=_0x76dc[_0x4b150e];return _0x17d1ae;};'use strict';var path=require(_0xc76d('0x0'));var fs=require('fs');var _=require(_0xc76d('0x1'));var db=require(_0xc76d('0x2'))['db'];var config=require(_0xc76d('0x3'));var util=require('util');var BPromise=require(_0xc76d('0x4'));var jayson=require(_0xc76d('0x5'));var amiClient=jayson['client'][_0xc76d('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xc76d('0x7'));config[_0xc76d('0x8')]=_[_0xc76d('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc76d('0xa'))(new Redis(config[_0xc76d('0x8')]));var Schema=require(_0xc76d('0xb'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0xd')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xc76d('0xc')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x10')]},'transferNumber':{'type':_0xc76d('0xc'),'required':[!![],_0xc76d('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]},'sessionId':{'type':_0xc76d('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xc76d('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xc76d('0xf'),'required':[!![],_0xc76d('0xe')]}});function emit(_0x6f94e,_0x5c680c,_0x32e0a8){logger['info'](_0x6f94e,_0x5c680c,JSON['stringify'](_0x32e0a8));io['to'](_0x6f94e)[_0xc76d('0x12')](_0x5c680c,_0x32e0a8);}function handleError(_0x31b032){return function(_0x339623){console[_0xc76d('0x13')](_0xc76d('0x14'),_0x339623,_0x339623 instanceof RangeError);logger['error'](_0x339623[_0xc76d('0x15')]);if(_0x339623 instanceof RangeError){if(_0x339623[_0xc76d('0x16')]){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x194)[_0xc76d('0x18')](_0x339623);}else{if(_0x339623['name']){delete _0x339623[_0xc76d('0x16')];}_0x31b032[_0xc76d('0x17')](0x1f4)['send'](_0x339623);}};}function checkError(){return function(_0x455371){if(!_0x455371){throw new RangeError(_0xc76d('0x19'));}return _0x455371;};}function respondWithRpcPromise(_0x191e97,_0xb89876){return new BPromise(function(_0x18f546,_0x3d357b){var _0x42b89c=amiClient;return _0x42b89c[_0xc76d('0x1a')](_0x191e97,_0xb89876)[_0xc76d('0x1b')](function(_0x20e09c){if(_0x20e09c[_0xc76d('0x1c')]){if(_0x20e09c['error'][_0xc76d('0x1d')]===0x1f4){return _0x3d357b(_0x20e09c[_0xc76d('0x1c')]['message']);}return _0x18f546(_0x20e09c[_0xc76d('0x1c')][_0xc76d('0x1e')]);}else{_0x18f546(_0x20e09c['result']);}})[_0xc76d('0x1f')](function(_0x476aee){_0x3d357b(_0x476aee);});});}function getAgent(_0x2cd06e){return db[_0xc76d('0x20')][_0xc76d('0x21')]({'where':{'id':_0x2cd06e,'role':_0xc76d('0x22')}})[_0xc76d('0x1b')](checkError());}function getAgentCheckSession(_0x59ebd1,_0x59dabf){return new BPromise(function(_0x285430,_0x287ae4){var _0x5069ea=respondWithRpcPromise(_0xc76d('0x23'));var _0x52a79a=getAgent(_0x59ebd1);Promise[_0xc76d('0x24')]([_0x5069ea,_0x52a79a])['then'](function(_0x2039f4){var _0x5cf2e4=_0x2039f4[0x0];var _0x13b468=_0x2039f4[0x1];var _0x18a7fa=_['filter'](_0x5cf2e4[_0xc76d('0x25')],function(_0x1c68f3){return _0x1c68f3[_0xc76d('0x26')]==_0x13b468['id']&&_0x1c68f3[_0xc76d('0x27')]==_0x59dabf;});if(_0x18a7fa['length']==0x1){_0x285430(_0x13b468);}else{_0x287ae4(new RangeError(_0xc76d('0x28')+_0x59dabf+'\x20not\x20found!'));}});});}exports[_0xc76d('0x29')]=function(_0x5e9233,_0x30769f){logger[_0xc76d('0x2a')]('originate\x20fired:',_0x5e9233['body']);var _0x5eca19=originateValidation['validate'](_0x5e9233[_0xc76d('0x2b')]);if(_0x5eca19[_0xc76d('0x2c')]>0x0){return _0x30769f[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x5eca19);}var _0x1b2ed1=_0x5e9233['body'][_0xc76d('0x2e')];var _0x55e825=_0x5e9233[_0xc76d('0x2b')]['callNumber'];var _0x1bef44=_0x5e9233[_0xc76d('0x2b')][_0xc76d('0x2f')];var _0x20fe33=_0x5e9233[_0xc76d('0x2b')]['callbackUrl'];return getAgent(_0x1b2ed1)[_0xc76d('0x1b')](function(_0x371306){logger[_0xc76d('0x2a')]('entityFound:',_0x371306[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x371306['name']),_0xc76d('0x32'),{'callNumber':_0x55e825,'callerId':_0x1bef44,'callbackUrl':_0x20fe33});return _0x30769f[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x33')});})[_0xc76d('0x1f')](handleError(_0x30769f));};exports[_0xc76d('0x34')]=function(_0x579d93,_0x518945){logger[_0xc76d('0x2a')]('hangup\x20fired:',_0x579d93[_0xc76d('0x2b')]);var _0x359f38=hangupValidation[_0xc76d('0xb')](_0x579d93[_0xc76d('0x2b')]);if(_0x359f38['length']>0x0){return _0x518945['status'](0x190)[_0xc76d('0x2d')](_0x359f38);}var _0x20a456=_0x579d93[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x410029=_0x579d93['body'][_0xc76d('0x27')];return getAgent(_0x20a456)[_0xc76d('0x1b')](function(_0x321989){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x321989[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x321989[_0xc76d('0x16')]),_0xc76d('0x36'),{'sessionId':_0x410029});return _0x518945['status'](0xc8)['json']({'error':![],'message':_0xc76d('0x37')});})[_0xc76d('0x1f')](handleError(_0x518945));};exports[_0xc76d('0x38')]=function(_0x27bdff,_0x4ae994){logger['info'](_0xc76d('0x39'),_0x27bdff[_0xc76d('0x2b')]);var _0x3e471e=answerValidation[_0xc76d('0xb')](_0x27bdff[_0xc76d('0x2b')]);if(_0x3e471e[_0xc76d('0x2c')]>0x0){return _0x4ae994[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x3e471e);}var _0x50e922=_0x27bdff[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x1bf8a0=_0x27bdff[_0xc76d('0x2b')]['sessionId'];return getAgent(_0x50e922)['then'](function(_0x4bf591){logger['info']('entityFound:',_0x4bf591['name']);emit(util['format'](_0xc76d('0x31'),_0x4bf591[_0xc76d('0x16')]),_0xc76d('0x3a'),{'sessionId':_0x1bf8a0});return _0x4ae994[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3b')});})[_0xc76d('0x1f')](handleError(_0x4ae994));};exports[_0xc76d('0x3c')]=function(_0x555f14,_0x462214){logger[_0xc76d('0x2a')](_0xc76d('0x3d'),_0x555f14[_0xc76d('0x2b')]);var _0xb9cca2=holdValidation[_0xc76d('0xb')](_0x555f14[_0xc76d('0x2b')]);if(_0xb9cca2[_0xc76d('0x2c')]>0x0){return _0x462214[_0xc76d('0x17')](0x190)['json'](_0xb9cca2);}var _0x5b41d3=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x2e')];var _0x2fa905=_0x555f14[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x5b41d3)['then'](function(_0x25fc9d){logger[_0xc76d('0x2a')]('entityFound:',_0x25fc9d['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x25fc9d['name']),_0xc76d('0x3e'),{'sessionId':_0x2fa905});return _0x462214[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x3f')});})[_0xc76d('0x1f')](handleError(_0x462214));};exports[_0xc76d('0x40')]=function(_0x25a549,_0x10b1b0){logger[_0xc76d('0x2a')](_0xc76d('0x41'),_0x25a549['body']);var _0x4efd83=unholdValidation[_0xc76d('0xb')](_0x25a549[_0xc76d('0x2b')]);if(_0x4efd83['length']>0x0){return _0x10b1b0[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x4efd83);}var _0x506b03=_0x25a549[_0xc76d('0x2b')]['userId'];var _0xe90d83=_0x25a549[_0xc76d('0x2b')][_0xc76d('0x27')];return getAgent(_0x506b03)[_0xc76d('0x1b')](function(_0x14ef42){logger['info']('entityFound:',_0x14ef42['name']);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x14ef42[_0xc76d('0x16')]),_0xc76d('0x42'),{'sessionId':_0xe90d83});return _0x10b1b0[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':'unhold\x20executed!'});})[_0xc76d('0x1f')](handleError(_0x10b1b0));};exports[_0xc76d('0x43')]=function(_0x5e66d9,_0x1a49d5){logger[_0xc76d('0x2a')]('calls\x20fired:',_0x1a49d5[_0xc76d('0x2b')]);var _0x463cbe=callsValidation[_0xc76d('0xb')](_0x5e66d9[_0xc76d('0x2b')]);if(_0x463cbe[_0xc76d('0x2c')]>0x0){return _0x1a49d5[_0xc76d('0x17')](0x190)['json'](_0x463cbe);}var _0x91b25b=_0x5e66d9[_0xc76d('0x2b')]['userId'];var _0x5f3973=respondWithRpcPromise(_0xc76d('0x23'));var _0x5ddcc6=getAgent(_0x91b25b);return Promise[_0xc76d('0x24')]([_0x5f3973,_0x5ddcc6])[_0xc76d('0x1b')](function(_0x12b287){var _0xfe2be1=_0x12b287[0x0];var _0x254128=_0x12b287[0x1];var _0x4746a5=_[_0xc76d('0x44')](_0xfe2be1[_0xc76d('0x25')],function(_0x3ada89){return _0x3ada89[_0xc76d('0x26')]==_0x254128['id'];});return _0x1a49d5[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'count':_0x4746a5[_0xc76d('0x2c')],'rows':_0x4746a5});})[_0xc76d('0x1f')](handleError(_0x1a49d5));};exports['conference']=function(_0x3054e0,_0xa0aa45){logger[_0xc76d('0x2a')](_0xc76d('0x45'),_0x3054e0[_0xc76d('0x2b')]);var _0x5ce99d=conferenceValidation[_0xc76d('0xb')](_0x3054e0[_0xc76d('0x2b')]);if(_0x5ce99d['length']>0x0){return _0xa0aa45['status'](0x190)['json'](_0x5ce99d);}var _0x382db6=_0x3054e0[_0xc76d('0x2b')][_0xc76d('0x2e')];return getAgent(_0x382db6)[_0xc76d('0x1b')](function(_0x2ba812){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x2ba812[_0xc76d('0x16')]);emit(util['format'](_0xc76d('0x31'),_0x2ba812['name']),'webbar:conference');return _0xa0aa45[_0xc76d('0x17')](0xc8)[_0xc76d('0x2d')]({'error':![],'message':_0xc76d('0x46')});})['catch'](handleError(_0xa0aa45));};exports[_0xc76d('0x47')]=function(_0x57068d,_0x48ccf7){logger['info'](_0xc76d('0x48'),_0x57068d[_0xc76d('0x2b')]);var _0x513623=transferValidation[_0xc76d('0xb')](_0x57068d[_0xc76d('0x2b')]);if(_0x513623[_0xc76d('0x2c')]>0x0){return _0x48ccf7[_0xc76d('0x17')](0x190)[_0xc76d('0x2d')](_0x513623);}var _0xa81af6=_0x57068d[_0xc76d('0x2b')]['userId'];var _0x5035fd=_0x57068d['body'][_0xc76d('0x27')];var _0x2e742f=_0x57068d[_0xc76d('0x2b')][_0xc76d('0x49')];return getAgent(_0xa81af6)[_0xc76d('0x1b')](function(_0x49f876){logger[_0xc76d('0x2a')](_0xc76d('0x35'),_0x49f876[_0xc76d('0x16')]);emit(util[_0xc76d('0x30')](_0xc76d('0x31'),_0x49f876[_0xc76d('0x16')]),_0xc76d('0x4a'),{'sessionId':_0x5035fd,'transferNumber':_0x2e742f});return _0x48ccf7[_0xc76d('0x17')](0xc8)['json']({'error':![],'message':_0xc76d('0x4b')});})['catch'](handleError(_0x48ccf7));}; \ No newline at end of file +var _0x54f3=['sessionId\x20is\x20required','transferNumber\x20is\x20required','number','info','stringify','emit','log','error','stack','name','status','send','request','then','code','message','result','findOne','agent','all','filter','rows','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','catch','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','sessionId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','UserId','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','bluebird','http','../../config/logger','webbarapi','defaults','localhost','socket.io-emitter','redis','validate','userId\x20is\x20required','callNumber\x20is\x20required','string'];(function(_0x3942d1,_0x4506de){var _0x3dc5b7=function(_0x238127){while(--_0x238127){_0x3942d1['push'](_0x3942d1['shift']());}};_0x3dc5b7(++_0x4506de);}(_0x54f3,0x120));var _0x354f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x54f3[_0x40a045];return _0x1a687c;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x354f('0x0'));var db=require(_0x354f('0x1'))['db'];var config=require(_0x354f('0x2'));var util=require(_0x354f('0x3'));var BPromise=require(_0x354f('0x4'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x354f('0x5')]({'port':0x232a});var logger=require(_0x354f('0x6'))(_0x354f('0x7'));var Redis=require('ioredis');config['redis']=_[_0x354f('0x8')](config['redis'],{'host':_0x354f('0x9'),'port':0x18eb});var io=require(_0x354f('0xa'))(new Redis(config[_0x354f('0xb')]));var Schema=require(_0x354f('0xc'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'callNumber':{'type':'string','required':[!![],_0x354f('0xe')]},'callerId':{'type':_0x354f('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':[!![],_0x354f('0x10')]},'transferNumber':{'type':_0x354f('0xf'),'required':[!![],_0x354f('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x354f('0x12'),'required':[!![],_0x354f('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x354f('0x12'),'required':[!![],_0x354f('0xd')]},'sessionId':{'type':_0x354f('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x354f('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x354f('0x12'),'required':[!![],_0x354f('0xd')]}});function emit(_0x4cc0e9,_0x588741,_0x1a02eb){logger[_0x354f('0x13')](_0x4cc0e9,_0x588741,JSON[_0x354f('0x14')](_0x1a02eb));io['to'](_0x4cc0e9)[_0x354f('0x15')](_0x588741,_0x1a02eb);}function handleError(_0x3703bb){return function(_0x36402d){console[_0x354f('0x16')]('handleError:',_0x36402d,_0x36402d instanceof RangeError);logger[_0x354f('0x17')](_0x36402d[_0x354f('0x18')]);if(_0x36402d instanceof RangeError){if(_0x36402d[_0x354f('0x19')]){delete _0x36402d['name'];}_0x3703bb[_0x354f('0x1a')](0x194)['send'](_0x36402d);}else{if(_0x36402d[_0x354f('0x19')]){delete _0x36402d[_0x354f('0x19')];}_0x3703bb['status'](0x1f4)[_0x354f('0x1b')](_0x36402d);}};}function checkError(){return function(_0x39898c){if(!_0x39898c){throw new RangeError('NotFound');}return _0x39898c;};}function respondWithRpcPromise(_0x4c2c4f,_0x25ea69){return new BPromise(function(_0x574753,_0x52e7cb){var _0xa6050f=amiClient;return _0xa6050f[_0x354f('0x1c')](_0x4c2c4f,_0x25ea69)[_0x354f('0x1d')](function(_0x2f4277){if(_0x2f4277[_0x354f('0x17')]){if(_0x2f4277[_0x354f('0x17')][_0x354f('0x1e')]===0x1f4){return _0x52e7cb(_0x2f4277['error'][_0x354f('0x1f')]);}return _0x574753(_0x2f4277['error']['message']);}else{_0x574753(_0x2f4277[_0x354f('0x20')]);}})['catch'](function(_0x4b1820){_0x52e7cb(_0x4b1820);});});}function getAgent(_0xdb861e){return db['User'][_0x354f('0x21')]({'where':{'id':_0xdb861e,'role':_0x354f('0x22')}})['then'](checkError());}function getAgentCheckSession(_0x73c95e,_0x3c5c38){return new BPromise(function(_0x1467e7,_0x4c62c3){var _0x1a968d=respondWithRpcPromise('VoiceChannels');var _0x227d9b=getAgent(_0x73c95e);Promise[_0x354f('0x23')]([_0x1a968d,_0x227d9b])[_0x354f('0x1d')](function(_0x2816cf){var _0x596b48=_0x2816cf[0x0];var _0x21c121=_0x2816cf[0x1];var _0xb50aec=_[_0x354f('0x24')](_0x596b48[_0x354f('0x25')],function(_0x223464){return _0x223464['UserId']==_0x21c121['id']&&_0x223464['sessionId']==_0x3c5c38;});if(_0xb50aec[_0x354f('0x26')]==0x1){_0x1467e7(_0x21c121);}else{_0x4c62c3(new RangeError(_0x354f('0x27')+_0x3c5c38+_0x354f('0x28')));}});});}exports[_0x354f('0x29')]=function(_0x5c38d7,_0x576a95){logger[_0x354f('0x13')](_0x354f('0x2a'),_0x5c38d7[_0x354f('0x2b')]);var _0x8ef91e=originateValidation['validate'](_0x5c38d7[_0x354f('0x2b')]);if(_0x8ef91e[_0x354f('0x26')]>0x0){return _0x576a95[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x8ef91e);}var _0x4cd19e=_0x5c38d7['body'][_0x354f('0x2d')];var _0xc3b77d=_0x5c38d7[_0x354f('0x2b')][_0x354f('0x2e')];var _0x33bd5a=_0x5c38d7[_0x354f('0x2b')][_0x354f('0x2f')];var _0xf3b83b=_0x5c38d7[_0x354f('0x2b')][_0x354f('0x30')];return getAgent(_0x4cd19e)[_0x354f('0x1d')](function(_0x4d59f3){logger[_0x354f('0x13')]('entityFound:',_0x4d59f3[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x4d59f3[_0x354f('0x19')]),_0x354f('0x33'),{'callNumber':_0xc3b77d,'callerId':_0x33bd5a,'callbackUrl':_0xf3b83b});return _0x576a95[_0x354f('0x1a')](0xc8)['json']({'error':![],'message':_0x354f('0x34')});})[_0x354f('0x35')](handleError(_0x576a95));};exports['hangup']=function(_0x89dcb6,_0x944fda){logger[_0x354f('0x13')]('hangup\x20fired:',_0x89dcb6[_0x354f('0x2b')]);var _0x269871=hangupValidation[_0x354f('0xc')](_0x89dcb6[_0x354f('0x2b')]);if(_0x269871['length']>0x0){return _0x944fda[_0x354f('0x1a')](0x190)['json'](_0x269871);}var _0x2f6873=_0x89dcb6[_0x354f('0x2b')][_0x354f('0x2d')];var _0x22682a=_0x89dcb6[_0x354f('0x2b')]['sessionId'];return getAgent(_0x2f6873)['then'](function(_0x162a10){logger[_0x354f('0x13')](_0x354f('0x36'),_0x162a10[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x162a10['name']),_0x354f('0x37'),{'sessionId':_0x22682a});return _0x944fda[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':_0x354f('0x38')});})['catch'](handleError(_0x944fda));};exports[_0x354f('0x39')]=function(_0x46956e,_0x3a7180){logger[_0x354f('0x13')](_0x354f('0x3a'),_0x46956e[_0x354f('0x2b')]);var _0x5f33b2=answerValidation[_0x354f('0xc')](_0x46956e[_0x354f('0x2b')]);if(_0x5f33b2[_0x354f('0x26')]>0x0){return _0x3a7180['status'](0x190)['json'](_0x5f33b2);}var _0x7835a0=_0x46956e[_0x354f('0x2b')][_0x354f('0x2d')];var _0x3b34ca=_0x46956e[_0x354f('0x2b')][_0x354f('0x3b')];return getAgent(_0x7835a0)[_0x354f('0x1d')](function(_0x445b7d){logger['info'](_0x354f('0x36'),_0x445b7d[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x445b7d[_0x354f('0x19')]),_0x354f('0x3c'),{'sessionId':_0x3b34ca});return _0x3a7180[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':_0x354f('0x3d')});})['catch'](handleError(_0x3a7180));};exports[_0x354f('0x3e')]=function(_0x577fa6,_0x5503d6){logger['info'](_0x354f('0x3f'),_0x577fa6[_0x354f('0x2b')]);var _0x4d26a9=holdValidation[_0x354f('0xc')](_0x577fa6[_0x354f('0x2b')]);if(_0x4d26a9[_0x354f('0x26')]>0x0){return _0x5503d6['status'](0x190)['json'](_0x4d26a9);}var _0x178313=_0x577fa6[_0x354f('0x2b')][_0x354f('0x2d')];var _0x1d6952=_0x577fa6[_0x354f('0x2b')][_0x354f('0x3b')];return getAgent(_0x178313)['then'](function(_0x55f2c9){logger[_0x354f('0x13')]('entityFound:',_0x55f2c9[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x55f2c9['name']),'webbar:hold',{'sessionId':_0x1d6952});return _0x5503d6[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':'hold\x20executed!'});})[_0x354f('0x35')](handleError(_0x5503d6));};exports[_0x354f('0x40')]=function(_0xf71a4f,_0x2dd012){logger[_0x354f('0x13')](_0x354f('0x41'),_0xf71a4f[_0x354f('0x2b')]);var _0x4deff4=unholdValidation[_0x354f('0xc')](_0xf71a4f[_0x354f('0x2b')]);if(_0x4deff4[_0x354f('0x26')]>0x0){return _0x2dd012[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x4deff4);}var _0x4bb00c=_0xf71a4f[_0x354f('0x2b')][_0x354f('0x2d')];var _0x576e1d=_0xf71a4f['body'][_0x354f('0x3b')];return getAgent(_0x4bb00c)[_0x354f('0x1d')](function(_0x54914c){logger['info'](_0x354f('0x36'),_0x54914c[_0x354f('0x19')]);emit(util['format'](_0x354f('0x32'),_0x54914c[_0x354f('0x19')]),_0x354f('0x42'),{'sessionId':_0x576e1d});return _0x2dd012[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':_0x354f('0x43')});})[_0x354f('0x35')](handleError(_0x2dd012));};exports['calls']=function(_0x2ca633,_0x4535cb){logger[_0x354f('0x13')](_0x354f('0x44'),_0x4535cb['body']);var _0x2edb7c=callsValidation[_0x354f('0xc')](_0x2ca633[_0x354f('0x2b')]);if(_0x2edb7c[_0x354f('0x26')]>0x0){return _0x4535cb['status'](0x190)[_0x354f('0x2c')](_0x2edb7c);}var _0x1e9558=_0x2ca633[_0x354f('0x2b')][_0x354f('0x2d')];var _0x58c25f=respondWithRpcPromise(_0x354f('0x45'));var _0x16a32f=getAgent(_0x1e9558);return Promise[_0x354f('0x23')]([_0x58c25f,_0x16a32f])[_0x354f('0x1d')](function(_0x6164f7){var _0x294518=_0x6164f7[0x0];var _0x3d32de=_0x6164f7[0x1];var _0x3f1770=_[_0x354f('0x24')](_0x294518[_0x354f('0x25')],function(_0x102f91){return _0x102f91[_0x354f('0x46')]==_0x3d32de['id'];});return _0x4535cb[_0x354f('0x1a')](0xc8)['json']({'count':_0x3f1770[_0x354f('0x26')],'rows':_0x3f1770});})[_0x354f('0x35')](handleError(_0x4535cb));};exports['conference']=function(_0x575b76,_0xa3d1cb){logger['info'](_0x354f('0x47'),_0x575b76[_0x354f('0x2b')]);var _0x2e08e2=conferenceValidation[_0x354f('0xc')](_0x575b76[_0x354f('0x2b')]);if(_0x2e08e2[_0x354f('0x26')]>0x0){return _0xa3d1cb[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x2e08e2);}var _0x5dbf67=_0x575b76[_0x354f('0x2b')][_0x354f('0x2d')];return getAgent(_0x5dbf67)[_0x354f('0x1d')](function(_0x583d97){logger[_0x354f('0x13')](_0x354f('0x36'),_0x583d97[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x583d97[_0x354f('0x19')]),'webbar:conference');return _0xa3d1cb[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0x354f('0x35')](handleError(_0xa3d1cb));};exports[_0x354f('0x48')]=function(_0x1c8401,_0x1088d2){logger['info'](_0x354f('0x49'),_0x1c8401['body']);var _0x4b9a9f=transferValidation[_0x354f('0xc')](_0x1c8401[_0x354f('0x2b')]);if(_0x4b9a9f[_0x354f('0x26')]>0x0){return _0x1088d2[_0x354f('0x1a')](0x190)[_0x354f('0x2c')](_0x4b9a9f);}var _0x4ca3df=_0x1c8401['body'][_0x354f('0x2d')];var _0x41b1a5=_0x1c8401[_0x354f('0x2b')][_0x354f('0x3b')];var _0x5681d9=_0x1c8401[_0x354f('0x2b')][_0x354f('0x4a')];return getAgent(_0x4ca3df)['then'](function(_0x1139b8){logger[_0x354f('0x13')](_0x354f('0x36'),_0x1139b8[_0x354f('0x19')]);emit(util[_0x354f('0x31')](_0x354f('0x32'),_0x1139b8[_0x354f('0x19')]),_0x354f('0x4b'),{'sessionId':_0x41b1a5,'transferNumber':_0x5681d9});return _0x1088d2[_0x354f('0x1a')](0xc8)[_0x354f('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x354f('0x35')](handleError(_0x1088d2));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 59442a0..362e50a 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 _0xc18e=['notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','/:id/dispositions','addDisposition','addAnswer','addAgents','addApplications','/:id/notify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc18e,0x17d));var _0xec18=function(_0x5cbd7b,_0x207439){_0x5cbd7b=_0x5cbd7b-0x0;var _0x3fdfb8=_0xc18e[_0x5cbd7b];return _0x3fdfb8;};'use strict';var multer=require(_0xec18('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec18('0x1'));var express=require(_0xec18('0x2'));var router=express['Router']();var fs_extra=require(_0xec18('0x3'));var auth=require(_0xec18('0x4'));var interaction=require(_0xec18('0x5'));var config=require('../../config/environment');var controller=require(_0xec18('0x6'));router[_0xec18('0x7')]('/',auth[_0xec18('0x8')](),controller[_0xec18('0x9')]);router['get'](_0xec18('0xa'),auth[_0xec18('0x8')](),controller['describe']);router[_0xec18('0x7')](_0xec18('0xb'),auth[_0xec18('0x8')](),controller[_0xec18('0xc')]);router['get']('/:id/dispositions',auth[_0xec18('0x8')](),controller['getDispositions']);router[_0xec18('0x7')](_0xec18('0xd'),auth[_0xec18('0x8')](),controller[_0xec18('0xe')]);router[_0xec18('0x7')](_0xec18('0xf'),auth[_0xec18('0x8')](),controller[_0xec18('0x10')]);router['get'](_0xec18('0x11'),auth[_0xec18('0x8')](),controller[_0xec18('0x12')]);router['post']('/',auth[_0xec18('0x8')](),controller['create']);router[_0xec18('0x13')](_0xec18('0x14'),auth['isAuthenticated'](),controller[_0xec18('0x15')]);router[_0xec18('0x13')]('/:id/canned_answers',auth[_0xec18('0x8')](),controller[_0xec18('0x16')]);router['post'](_0xec18('0xf'),auth[_0xec18('0x8')](),controller[_0xec18('0x17')]);router[_0xec18('0x13')]('/:id/applications',auth[_0xec18('0x8')](),controller[_0xec18('0x18')]);router['post'](_0xec18('0x19'),controller[_0xec18('0x1a')]);router['post'](_0xec18('0x1b'),auth[_0xec18('0x8')](),controller[_0xec18('0x1c')]);router[_0xec18('0x1d')](_0xec18('0xb'),auth[_0xec18('0x8')](),controller[_0xec18('0x1e')]);router[_0xec18('0x1f')](_0xec18('0xb'),auth[_0xec18('0x8')](),controller[_0xec18('0x20')]);router[_0xec18('0x1f')]('/:id/dispositions',auth[_0xec18('0x8')](),controller[_0xec18('0x21')]);router[_0xec18('0x1f')](_0xec18('0xd'),auth[_0xec18('0x8')](),controller[_0xec18('0x22')]);router[_0xec18('0x1f')](_0xec18('0xf'),auth[_0xec18('0x8')](),controller[_0xec18('0x23')]);module[_0xec18('0x24')]=router; \ No newline at end of file +var _0xf434=['addApplications','/:id/notify','notify','send','/:id','update','delete','destroy','removeDispositions','removeAnswers','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','/:id/canned_answers','addAgents'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xf434,0xc3));var _0x4f43=function(_0xe0727,_0x1e25c5){_0xe0727=_0xe0727-0x0;var _0x380a0d=_0xf434[_0xe0727];return _0x380a0d;};'use strict';var multer=require(_0x4f43('0x0'));var util=require(_0x4f43('0x1'));var path=require(_0x4f43('0x2'));var timeout=require(_0x4f43('0x3'));var express=require(_0x4f43('0x4'));var router=express['Router']();var fs_extra=require(_0x4f43('0x5'));var auth=require(_0x4f43('0x6'));var interaction=require(_0x4f43('0x7'));var config=require(_0x4f43('0x8'));var controller=require(_0x4f43('0x9'));router['get']('/',auth[_0x4f43('0xa')](),controller[_0x4f43('0xb')]);router[_0x4f43('0xc')](_0x4f43('0xd'),auth['isAuthenticated'](),controller[_0x4f43('0xe')]);router[_0x4f43('0xc')]('/:id',auth[_0x4f43('0xa')](),controller[_0x4f43('0xf')]);router[_0x4f43('0xc')](_0x4f43('0x10'),auth[_0x4f43('0xa')](),controller[_0x4f43('0x11')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4f43('0x12')]);router[_0x4f43('0xc')](_0x4f43('0x13'),auth[_0x4f43('0xa')](),controller['getAgents']);router[_0x4f43('0xc')](_0x4f43('0x14'),auth['isAuthenticated'](),controller[_0x4f43('0x15')]);router[_0x4f43('0x16')]('/',auth[_0x4f43('0xa')](),controller[_0x4f43('0x17')]);router['post'](_0x4f43('0x10'),auth[_0x4f43('0xa')](),controller[_0x4f43('0x18')]);router[_0x4f43('0x16')](_0x4f43('0x19'),auth[_0x4f43('0xa')](),controller['addAnswer']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x4f43('0x1a')]);router['post'](_0x4f43('0x14'),auth[_0x4f43('0xa')](),controller[_0x4f43('0x1b')]);router['post'](_0x4f43('0x1c'),controller[_0x4f43('0x1d')]);router[_0x4f43('0x16')]('/:id/send',auth[_0x4f43('0xa')](),controller[_0x4f43('0x1e')]);router['put'](_0x4f43('0x1f'),auth['isAuthenticated'](),controller[_0x4f43('0x20')]);router[_0x4f43('0x21')]('/:id',auth[_0x4f43('0xa')](),controller[_0x4f43('0x22')]);router[_0x4f43('0x21')](_0x4f43('0x10'),auth[_0x4f43('0xa')](),controller[_0x4f43('0x23')]);router[_0x4f43('0x21')](_0x4f43('0x19'),auth[_0x4f43('0xa')](),controller[_0x4f43('0x24')]);router[_0x4f43('0x21')](_0x4f43('0x13'),auth[_0x4f43('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index c6a20e7..d19c236 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 _0x84dc=['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','randomstring','STRING','generate','ENUM'];(function(_0x4be563,_0x371f7d){var _0xa7d890=function(_0xe80d67){while(--_0xe80d67){_0x4be563['push'](_0x4be563['shift']());}};_0xa7d890(++_0x371f7d);}(_0x84dc,0x182));var _0xc84d=function(_0x970939,_0x4691e9){_0x970939=_0x970939-0x0;var _0xc783b1=_0x84dc[_0x970939];return _0xc783b1;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc84d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xc84d('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc84d('0x2')]();}},'phone':{'type':Sequelize[_0xc84d('0x1')]},'type':{'type':Sequelize[_0xc84d('0x3')]('twilio',_0xc84d('0x4'))},'accountSid':{'type':Sequelize[_0xc84d('0x1')]},'baseUrl':{'type':Sequelize[_0xc84d('0x1')]},'authToken':{'type':Sequelize[_0xc84d('0x1')]},'notificationTemplate':{'type':Sequelize[_0xc84d('0x5')],'defaultValue':function(){return _0xc84d('0x6');}},'notificationSound':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc84d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc84d('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xc84d('0x7')],'defaultValue':![],'comment':_0xc84d('0xa'),'set':function(_0x3473bb){if(!_0x3473bb){this[_0xc84d('0xb')](_0xc84d('0xc'),null);}this[_0xc84d('0xb')]('mandatoryDisposition',_0x3473bb);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf6d8=['sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x1b30c4,_0x5cd2d9){var _0x1a180a=function(_0x4b2cf9){while(--_0x4b2cf9){_0x1b30c4['push'](_0x1b30c4['shift']());}};_0x1a180a(++_0x5cd2d9);}(_0xf6d8,0xb4));var _0x8f6d=function(_0x43a7fd,_0xb2af6a){_0x43a7fd=_0x43a7fd-0x0;var _0x8547b0=_0xf6d8[_0x43a7fd];return _0x8547b0;};'use strict';var Sequelize=require(_0x8f6d('0x0'));var rs=require(_0x8f6d('0x1'));module[_0x8f6d('0x2')]={'name':{'type':Sequelize[_0x8f6d('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x8f6d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x8f6d('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x8f6d('0x4')]();}},'phone':{'type':Sequelize[_0x8f6d('0x3')]},'type':{'type':Sequelize[_0x8f6d('0x5')](_0x8f6d('0x6'),_0x8f6d('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x8f6d('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8f6d('0x8');}},'notificationSound':{'type':Sequelize[_0x8f6d('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8f6d('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8f6d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8f6d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8f6d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8f6d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8f6d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8f6d('0xa')],'comment':_0x8f6d('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x39c285){if(!_0x39c285){this['setDataValue'](_0x8f6d('0xc'),null);}this[_0x8f6d('0xd')](_0x8f6d('0xe'),_0x39c285);}},'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 8a4e848..d1522cf 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 _0x6bea=['map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','hasOwnProperty','sort','removeDispositions','ids','CannedAnswer','findOne','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','whatsapp','account','sinch','statuses','read','WhatsappMessage','timestamp','Applications','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','mobile','twilio','From','replace','whatsapp:','Body','MessageSid','from','notifications','messageId','message_id','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','list','Contacts','contact','WhatsappInteraction','interaction','autoclose','applications','unmanaged','*,*,*,*','created','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','dataValues','Messages','push','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','WhatsappAccounts','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause'];(function(_0x5a0df0,_0x31aae9){var _0x2213d6=function(_0x2bba43){while(--_0x2bba43){_0x5a0df0['push'](_0x5a0df0['shift']());}};_0x2213d6(++_0x31aae9);}(_0x6bea,0x85));var _0xa6be=function(_0xa0f903,_0x4402b1){_0xa0f903=_0xa0f903-0x0;var _0x36ebd1=_0x6bea[_0xa0f903];return _0x36ebd1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa6be('0x0'));var zipdir=require(_0xa6be('0x1'));var jsonpatch=require(_0xa6be('0x2'));var rp=require(_0xa6be('0x3'));var moment=require(_0xa6be('0x4'));var BPromise=require(_0xa6be('0x5'));var Mustache=require(_0xa6be('0x6'));var util=require(_0xa6be('0x7'));var path=require(_0xa6be('0x8'));var sox=require('sox');var csv=require(_0xa6be('0x9'));var ejs=require(_0xa6be('0xa'));var fs=require('fs');var fs_extra=require(_0xa6be('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6be('0xc'));var toCsv=require(_0xa6be('0x9'));var querystring=require(_0xa6be('0xd'));var Papa=require(_0xa6be('0xe'));var Redis=require(_0xa6be('0xf'));var authService=require(_0xa6be('0x10'));var qs=require(_0xa6be('0x11'));var as=require(_0xa6be('0x12'));var hardwareService=require(_0xa6be('0x13'));var logger=require(_0xa6be('0x14'))('api');var utils=require(_0xa6be('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa6be('0x16'))['db'];config['redis']=_[_0xa6be('0x17')](config[_0xa6be('0x18')],{'host':_0xa6be('0x19'),'port':0x18eb});var socket=require(_0xa6be('0x1a'))(new Redis(config[_0xa6be('0x18')]));require(_0xa6be('0x1b'))[_0xa6be('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa6be('0x1d')][_0xa6be('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5b3896,_0x21b314,_0x1f8c5b,_0x332f00){return new BPromise(function(_0x37e813,_0x48ee96){var _0xfdb50d=_0x332f00||client;return _0xfdb50d['request'](_0x5b3896,_0x1f8c5b)[_0xa6be('0x1f')](function(_0x10a7b6){logger[_0xa6be('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x21b314,_0xa6be('0x21'));logger[_0xa6be('0x22')](_0xa6be('0x23'),_0x21b314,_0xa6be('0x21'),JSON[_0xa6be('0x24')](_0x10a7b6));if(_0x10a7b6[_0xa6be('0x25')]){if(_0x10a7b6['error'][_0xa6be('0x26')]===0x1f4){logger['error'](_0xa6be('0x27'),_0x21b314,_0x10a7b6[_0xa6be('0x25')]['message']);return _0x48ee96(_0x10a7b6[_0xa6be('0x25')][_0xa6be('0x28')]);}logger[_0xa6be('0x25')](_0xa6be('0x27'),_0x21b314,_0x10a7b6['error']['message']);return _0x37e813(_0x10a7b6['error'][_0xa6be('0x28')]);}else{logger[_0xa6be('0x20')](_0xa6be('0x27'),_0x21b314,_0xa6be('0x21'));_0x37e813(_0x10a7b6['result'][_0xa6be('0x28')]);}})['catch'](function(_0x5de3c1){logger['error'](_0xa6be('0x27'),_0x21b314,_0x5de3c1);_0x48ee96(_0x5de3c1);});});}function respondWithStatusCode(_0x2936c8,_0x43ae30){_0x43ae30=_0x43ae30||0xcc;return function(_0x4dca0c){if(_0x4dca0c){return _0x2936c8[_0xa6be('0x29')](_0x43ae30);}return _0x2936c8['status'](_0x43ae30)['end']();};}function respondWithResult(_0xc0cf5f,_0x4c729b){_0x4c729b=_0x4c729b||0xc8;return function(_0x90c6ad){if(_0x90c6ad){return _0xc0cf5f[_0xa6be('0x2a')](_0x4c729b)[_0xa6be('0x2b')](_0x90c6ad);}};}function respondWithFilteredResult(_0x341592,_0x80ea58){return function(_0xd88815){if(_0xd88815){var _0x567eb3=typeof _0x80ea58[_0xa6be('0x2c')]===_0xa6be('0x2d')&&typeof _0x80ea58[_0xa6be('0x2e')]===_0xa6be('0x2d');var _0x1e187f=_0xd88815[_0xa6be('0x2f')];var _0x2ba4a0=_0x567eb3?0x0:_0x80ea58[_0xa6be('0x2c')];var _0x25575b=_0x567eb3?_0xd88815[_0xa6be('0x2f')]:_0x80ea58[_0xa6be('0x2c')]+_0x80ea58['limit'];var _0x59e2a9;if(_0x25575b>=_0x1e187f){_0x25575b=_0x1e187f;_0x59e2a9=0xc8;}else{_0x59e2a9=0xce;}_0x341592['status'](_0x59e2a9);return _0x341592[_0xa6be('0x30')](_0xa6be('0x31'),_0x2ba4a0+'-'+_0x25575b+'/'+_0x1e187f)[_0xa6be('0x2b')](_0xd88815);}return null;};}function patchUpdates(_0x2f9b44){return function(_0x15fde2){try{jsonpatch[_0xa6be('0x32')](_0x15fde2,_0x2f9b44,!![]);}catch(_0x190449){return BPromise['reject'](_0x190449);}return _0x15fde2[_0xa6be('0x33')]();};}function saveUpdates(_0x5023a1,_0x1291c4){return function(_0x4ae577){if(_0x4ae577){return _0x4ae577[_0xa6be('0x34')](_0x5023a1)[_0xa6be('0x1f')](function(_0x209581){return _0x209581;});}return null;};}function removeEntity(_0xee8d79,_0x2eb77a){return function(_0x1c75f6){if(_0x1c75f6){return _0x1c75f6['destroy']()['then'](function(){var _0x2f0d22=_0x1c75f6[_0xa6be('0x35')]({'plain':!![]});var _0x47e4e8=_0xa6be('0x36');return db['UserProfileResource'][_0xa6be('0x37')]({'where':{'type':_0x47e4e8,'resourceId':_0x2f0d22['id']}})[_0xa6be('0x1f')](function(){return _0x1c75f6;});})['then'](function(){_0xee8d79['status'](0xcc)[_0xa6be('0x38')]();});}};}function handleEntityNotFound(_0x269b33,_0x6c5628){return function(_0x5c0548){if(!_0x5c0548){_0x269b33[_0xa6be('0x29')](0x194);}return _0x5c0548;};}function handleError(_0xde9e5d,_0x4df7e7){_0x4df7e7=_0x4df7e7||0x1f4;return function(_0x228c58){logger[_0xa6be('0x25')](_0x228c58[_0xa6be('0x39')]);if(_0x228c58[_0xa6be('0x3a')]){delete _0x228c58['name'];}_0xde9e5d[_0xa6be('0x2a')](_0x4df7e7)[_0xa6be('0x3b')](_0x228c58);};}exports[_0xa6be('0x3c')]=function(_0x3de933,_0xb0c4d8){var _0x51cfb6={'include':[{'model':db[_0xa6be('0x3d')],'as':_0xa6be('0x3e')}]},_0x4c5496={},_0x11536c={'count':0x0,'rows':[]};var _0x593257=_[_0xa6be('0x3f')](db[_0xa6be('0x40')][_0xa6be('0x41')],function(_0x1c353a){return{'name':_0x1c353a[_0xa6be('0x42')],'type':_0x1c353a[_0xa6be('0x43')][_0xa6be('0x44')]};});_0x4c5496[_0xa6be('0x45')]=_[_0xa6be('0x3f')](_0x593257,_0xa6be('0x3a'));_0x4c5496[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x3de933[_0xa6be('0x46')]);_0x4c5496['filters']=_[_0xa6be('0x48')](_0x4c5496[_0xa6be('0x45')],_0x4c5496[_0xa6be('0x46')]);_0x51cfb6[_0xa6be('0x49')]=_[_0xa6be('0x48')](_0x4c5496[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x3de933[_0xa6be('0x46')]['fields']));_0x51cfb6[_0xa6be('0x49')]=_0x51cfb6['attributes'][_0xa6be('0x4b')]?_0x51cfb6[_0xa6be('0x49')]:_0x4c5496['model'];if(!_0x3de933[_0xa6be('0x46')]['hasOwnProperty'](_0xa6be('0x4c'))){_0x51cfb6[_0xa6be('0x2e')]=qs[_0xa6be('0x2e')](_0x3de933[_0xa6be('0x46')][_0xa6be('0x2e')]);_0x51cfb6['offset']=qs[_0xa6be('0x2c')](_0x3de933[_0xa6be('0x46')][_0xa6be('0x2c')]);}_0x51cfb6[_0xa6be('0x4d')]=qs['sort'](_0x3de933['query']['sort']);_0x51cfb6['where']=qs[_0xa6be('0x4e')](_[_0xa6be('0x4f')](_0x3de933['query'],_0x4c5496[_0xa6be('0x4e')]),_0x593257);if(_0x3de933[_0xa6be('0x46')]['filter']){_0x51cfb6[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0x51cfb6[_0xa6be('0x50')],{'$or':_[_0xa6be('0x3f')](_0x593257,function(_0x4da24a){if(_0x4da24a['type']!==_0xa6be('0x52')){var _0x5ea515={};_0x5ea515[_0x4da24a[_0xa6be('0x3a')]]={'$like':'%'+_0x3de933['query'][_0xa6be('0x53')]+'%'};return _0x5ea515;}})});}_0x51cfb6=_['merge']({},_0x51cfb6,_0x3de933[_0xa6be('0x54')]);var _0x441687={'where':_0x51cfb6[_0xa6be('0x50')]};return db['WhatsappAccount'][_0xa6be('0x2f')](_0x441687)[_0xa6be('0x1f')](function(_0x2aa167){_0x11536c[_0xa6be('0x2f')]=_0x2aa167;if(_0x3de933['query'][_0xa6be('0x55')]){_0x51cfb6[_0xa6be('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xa6be('0x57')](_0x51cfb6);})[_0xa6be('0x1f')](function(_0x46c35f){_0x11536c[_0xa6be('0x58')]=_0x46c35f;return _0x11536c;})['then'](respondWithFilteredResult(_0xb0c4d8,_0x51cfb6))[_0xa6be('0x59')](handleError(_0xb0c4d8,null));};exports['show']=function(_0x34228e,_0x1458a6){var _0x30737b={'raw':![],'where':{'id':_0x34228e[_0xa6be('0x5a')]['id']},'include':[{'model':db[_0xa6be('0x3d')],'as':_0xa6be('0x3e')}]},_0x4bf1c4={};_0x4bf1c4[_0xa6be('0x45')]=_['keys'](db[_0xa6be('0x40')][_0xa6be('0x41')]);_0x4bf1c4['query']=_[_0xa6be('0x47')](_0x34228e[_0xa6be('0x46')]);_0x4bf1c4['filters']=_['intersection'](_0x4bf1c4['model'],_0x4bf1c4[_0xa6be('0x46')]);_0x30737b[_0xa6be('0x49')]=_[_0xa6be('0x48')](_0x4bf1c4[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x34228e['query'][_0xa6be('0x4a')]));_0x30737b[_0xa6be('0x49')]=_0x30737b[_0xa6be('0x49')][_0xa6be('0x4b')]?_0x30737b[_0xa6be('0x49')]:_0x4bf1c4[_0xa6be('0x45')];if(_0x34228e[_0xa6be('0x46')][_0xa6be('0x55')]){_0x30737b['include']=[{'all':!![]}];}_0x30737b=_[_0xa6be('0x51')]({},_0x30737b,_0x34228e['options']);return db[_0xa6be('0x40')][_0xa6be('0x5b')](_0x30737b)['then'](handleEntityNotFound(_0x1458a6,null))[_0xa6be('0x1f')](respondWithResult(_0x1458a6,null))[_0xa6be('0x59')](handleError(_0x1458a6,null));};exports[_0xa6be('0x5c')]=function(_0x74e947,_0x3c03b8){return db[_0xa6be('0x40')][_0xa6be('0x5c')](_0x74e947[_0xa6be('0x5d')],{})[_0xa6be('0x1f')](function(_0x30d74e){var _0x19bff4=_0x74e947[_0xa6be('0x5e')][_0xa6be('0x35')]({'plain':!![]});if(!_0x19bff4)throw new Error(_0xa6be('0x5f'));if(_0x19bff4[_0xa6be('0x60')]===_0xa6be('0x5e')){var _0x3d3623=_0x30d74e[_0xa6be('0x35')]({'plain':!![]});var _0x209596='WhatsappAccounts';return db[_0xa6be('0x61')][_0xa6be('0x5b')]({'where':{'name':_0x209596,'userProfileId':_0x19bff4['userProfileId']},'raw':!![]})[_0xa6be('0x1f')](function(_0x2659d2){if(_0x2659d2&&_0x2659d2[_0xa6be('0x62')]===0x0){return db[_0xa6be('0x63')]['create']({'name':_0x3d3623[_0xa6be('0x3a')],'resourceId':_0x3d3623['id'],'type':_0x2659d2['name'],'sectionId':_0x2659d2['id']},{})[_0xa6be('0x1f')](function(){return _0x30d74e;});}else{return _0x30d74e;}})[_0xa6be('0x59')](function(_0x5b84da){logger[_0xa6be('0x25')](_0xa6be('0x64'),_0x5b84da);throw _0x5b84da;});}return _0x30d74e;})['then'](respondWithResult(_0x3c03b8,0xc9))[_0xa6be('0x59')](handleError(_0x3c03b8,null));};exports[_0xa6be('0x34')]=function(_0x1ec733,_0x300233){if(_0x1ec733[_0xa6be('0x5d')]['id']){delete _0x1ec733[_0xa6be('0x5d')]['id'];}return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x1ec733[_0xa6be('0x5a')]['id']},'include':[{'model':db[_0xa6be('0x3d')],'as':_0xa6be('0x3e')}]})[_0xa6be('0x1f')](handleEntityNotFound(_0x300233,null))[_0xa6be('0x1f')](saveUpdates(_0x1ec733[_0xa6be('0x5d')],null))['then'](respondWithResult(_0x300233,null))[_0xa6be('0x59')](handleError(_0x300233,null));};exports[_0xa6be('0x37')]=function(_0x3e6046,_0x374114){return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x3e6046[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x374114,null))[_0xa6be('0x1f')](removeEntity(_0x374114,null))[_0xa6be('0x59')](handleError(_0x374114,null));};exports['describe']=function(_0x491665,_0x3ca173){return db[_0xa6be('0x40')][_0xa6be('0x65')]()['then'](respondWithResult(_0x3ca173,null))[_0xa6be('0x59')](handleError(_0x3ca173,null));};exports[_0xa6be('0x66')]=function(_0x483b8d,_0x4a244e,_0x593760){if(_0x483b8d[_0xa6be('0x5d')]['id']){delete _0x483b8d[_0xa6be('0x5d')]['id'];}return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x483b8d[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x4a244e,null))[_0xa6be('0x1f')](function(_0x4abdc6){if(_0x4abdc6){_0x483b8d['body'][_0xa6be('0x67')]=_0x4abdc6['id'];return db[_0xa6be('0x68')][_0xa6be('0x5c')](_0x483b8d['body']);}})['then'](respondWithResult(_0x4a244e,null))[_0xa6be('0x59')](handleError(_0x4a244e,null));};exports[_0xa6be('0x69')]=function(_0x590663,_0x12f44a,_0x39d0df){var _0x39b3b8={'raw':![],'where':{}};var _0x30ebd9={};var _0x49e20a={'count':0x0,'rows':[]};return db[_0xa6be('0x40')]['findOne']({'where':{'id':_0x590663[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x12f44a,null))[_0xa6be('0x1f')](function(_0x131481){if(_0x131481){_0x30ebd9['model']=_['keys'](db[_0xa6be('0x68')][_0xa6be('0x41')]);_0x30ebd9[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x590663['query']);_0x30ebd9[_0xa6be('0x4e')]=_['intersection'](_0x30ebd9['model'],_0x30ebd9[_0xa6be('0x46')]);_0x39b3b8[_0xa6be('0x49')]=_['intersection'](_0x30ebd9[_0xa6be('0x45')],qs['fields'](_0x590663[_0xa6be('0x46')][_0xa6be('0x4a')]));_0x39b3b8[_0xa6be('0x49')]=_0x39b3b8[_0xa6be('0x49')][_0xa6be('0x4b')]?_0x39b3b8[_0xa6be('0x49')]:_0x30ebd9[_0xa6be('0x45')];if(!_0x590663[_0xa6be('0x46')][_0xa6be('0x6a')]('nolimit')){_0x39b3b8['limit']=qs[_0xa6be('0x2e')](_0x590663[_0xa6be('0x46')][_0xa6be('0x2e')]);_0x39b3b8['offset']=qs[_0xa6be('0x2c')](_0x590663['query'][_0xa6be('0x2c')]);}_0x39b3b8['order']=qs[_0xa6be('0x6b')](_0x590663['query'][_0xa6be('0x6b')]);_0x39b3b8['where']=qs['filters'](_[_0xa6be('0x4f')](_0x590663[_0xa6be('0x46')],_0x30ebd9[_0xa6be('0x4e')]));_0x39b3b8[_0xa6be('0x50')]['WhatsappAccountId']=_0x131481['id'];if(_0x590663[_0xa6be('0x46')][_0xa6be('0x53')]){_0x39b3b8[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0x39b3b8['where'],{'$or':_[_0xa6be('0x3f')](_0x39b3b8[_0xa6be('0x49')],function(_0x52d626){var _0x5c8edc={};_0x5c8edc[_0x52d626]={'$like':'%'+_0x590663[_0xa6be('0x46')]['filter']+'%'};return _0x5c8edc;})});}_0x39b3b8=_[_0xa6be('0x51')]({},_0x39b3b8,_0x590663[_0xa6be('0x54')]);return db[_0xa6be('0x68')]['count']({'where':_0x39b3b8[_0xa6be('0x50')]})[_0xa6be('0x1f')](function(_0x2686c7){_0x49e20a[_0xa6be('0x2f')]=_0x2686c7;if(_0x590663[_0xa6be('0x46')][_0xa6be('0x55')]){_0x39b3b8[_0xa6be('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x39b3b8);})['then'](function(_0x170272){_0x49e20a[_0xa6be('0x58')]=_0x170272;return _0x49e20a;});}})[_0xa6be('0x1f')](respondWithFilteredResult(_0x12f44a,_0x39b3b8))[_0xa6be('0x59')](handleError(_0x12f44a,null));};exports['removeDispositions']=function(_0x317fda,_0x43026b,_0x25fefe){return db[_0xa6be('0x40')]['find']({'where':{'id':_0x317fda[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x43026b,null))['then'](function(_0x278719){if(_0x278719){return _0x278719[_0xa6be('0x6c')](_0x317fda[_0xa6be('0x46')][_0xa6be('0x6d')]);}})['then'](respondWithStatusCode(_0x43026b,null))[_0xa6be('0x59')](handleError(_0x43026b,null));};exports['addAnswer']=function(_0x506363,_0x269387,_0xe0eb60){if(_0x506363[_0xa6be('0x5d')]['id']){delete _0x506363[_0xa6be('0x5d')]['id'];}return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x506363[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x269387,null))['then'](function(_0x378ed9){if(_0x378ed9){_0x506363[_0xa6be('0x5d')][_0xa6be('0x67')]=_0x378ed9['id'];return db[_0xa6be('0x6e')][_0xa6be('0x5c')](_0x506363['body']);}})['then'](respondWithResult(_0x269387,null))['catch'](handleError(_0x269387,null));};exports['getAnswers']=function(_0x2effb2,_0x5a5f28,_0x333a21){var _0x406767={'raw':![],'where':{}};var _0xc7e9c3={};var _0x59b3d6={'count':0x0,'rows':[]};return db[_0xa6be('0x40')][_0xa6be('0x6f')]({'where':{'id':_0x2effb2['params']['id']}})['then'](handleEntityNotFound(_0x5a5f28,null))[_0xa6be('0x1f')](function(_0x34f1b2){if(_0x34f1b2){_0xc7e9c3[_0xa6be('0x45')]=_[_0xa6be('0x47')](db[_0xa6be('0x6e')][_0xa6be('0x41')]);_0xc7e9c3[_0xa6be('0x46')]=_['keys'](_0x2effb2[_0xa6be('0x46')]);_0xc7e9c3[_0xa6be('0x4e')]=_[_0xa6be('0x48')](_0xc7e9c3['model'],_0xc7e9c3[_0xa6be('0x46')]);_0x406767[_0xa6be('0x49')]=_[_0xa6be('0x48')](_0xc7e9c3[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x2effb2[_0xa6be('0x46')]['fields']));_0x406767['attributes']=_0x406767[_0xa6be('0x49')][_0xa6be('0x4b')]?_0x406767[_0xa6be('0x49')]:_0xc7e9c3['model'];if(!_0x2effb2[_0xa6be('0x46')][_0xa6be('0x6a')](_0xa6be('0x4c'))){_0x406767[_0xa6be('0x2e')]=qs[_0xa6be('0x2e')](_0x2effb2[_0xa6be('0x46')][_0xa6be('0x2e')]);_0x406767[_0xa6be('0x2c')]=qs[_0xa6be('0x2c')](_0x2effb2[_0xa6be('0x46')][_0xa6be('0x2c')]);}_0x406767[_0xa6be('0x4d')]=qs['sort'](_0x2effb2[_0xa6be('0x46')]['sort']);_0x406767['where']=qs['filters'](_[_0xa6be('0x4f')](_0x2effb2[_0xa6be('0x46')],_0xc7e9c3[_0xa6be('0x4e')]));_0x406767[_0xa6be('0x50')][_0xa6be('0x67')]=_0x34f1b2['id'];if(_0x2effb2[_0xa6be('0x46')]['filter']){_0x406767['where']=_[_0xa6be('0x51')](_0x406767[_0xa6be('0x50')],{'$or':_['map'](_0x406767['attributes'],function(_0x485e6c){var _0x2f42c1={};_0x2f42c1[_0x485e6c]={'$like':'%'+_0x2effb2[_0xa6be('0x46')]['filter']+'%'};return _0x2f42c1;})});}_0x406767=_[_0xa6be('0x51')]({},_0x406767,_0x2effb2['options']);return db[_0xa6be('0x6e')][_0xa6be('0x2f')]({'where':_0x406767[_0xa6be('0x50')]})[_0xa6be('0x1f')](function(_0x27d34c){_0x59b3d6['count']=_0x27d34c;if(_0x2effb2[_0xa6be('0x46')][_0xa6be('0x55')]){_0x406767[_0xa6be('0x56')]=[{'all':!![]}];}return db[_0xa6be('0x6e')][_0xa6be('0x57')](_0x406767);})[_0xa6be('0x1f')](function(_0x177884){_0x59b3d6['rows']=_0x177884;return _0x59b3d6;});}})['then'](respondWithFilteredResult(_0x5a5f28,_0x406767))[_0xa6be('0x59')](handleError(_0x5a5f28,null));};exports['removeAnswers']=function(_0x2129dd,_0x1d1342,_0x5e0c93){return db['WhatsappAccount'][_0xa6be('0x5b')]({'where':{'id':_0x2129dd[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x1d1342,null))[_0xa6be('0x1f')](function(_0xc682c8){if(_0xc682c8){return _0xc682c8['removeAnswers'](_0x2129dd[_0xa6be('0x46')][_0xa6be('0x6d')]);}})['then'](respondWithStatusCode(_0x1d1342,null))[_0xa6be('0x59')](handleError(_0x1d1342,null));};exports['addAgents']=function(_0x32fcac,_0x4b7135,_0x2244e1){return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x32fcac[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x4b7135,null))[_0xa6be('0x1f')](function(_0x17494b){if(_0x17494b){return _0x17494b[_0xa6be('0x70')](_0x32fcac[_0xa6be('0x5d')][_0xa6be('0x6d')],_[_0xa6be('0x71')](_0x32fcac['body'],[_0xa6be('0x6d'),'id'])||{})[_0xa6be('0x72')](function(_0x547b87){for(var _0x5142d5=0x0;_0x5142d5<_0x32fcac['body'][_0xa6be('0x6d')]['length'];_0x5142d5+=0x1){socket[_0xa6be('0x73')](_0xa6be('0x74'),{'UserId':Number(_0x32fcac['body']['ids'][_0x5142d5]),'WhatsappAccountId':Number(_0x32fcac['params']['id'])});}return _0x547b87;});}})['then'](respondWithResult(_0x4b7135,null))['catch'](handleError(_0x4b7135,null));};exports[_0xa6be('0x75')]=function(_0x1c2629,_0xbaeca6,_0x58ab7b){return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x1c2629[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0xbaeca6,null))[_0xa6be('0x1f')](function(_0x3770ab){if(_0x3770ab){return _0x3770ab[_0xa6be('0x75')](_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')])[_0xa6be('0x1f')](function(){if(_[_0xa6be('0x76')](_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')])){for(var _0x2b634a=0x0;_0x2b634a<_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')][_0xa6be('0x4b')];_0x2b634a+=0x1){socket[_0xa6be('0x73')](_0xa6be('0x77'),{'UserId':Number(_0x1c2629[_0xa6be('0x46')][_0xa6be('0x6d')][_0x2b634a]),'WhatsappAccountId':Number(_0x1c2629[_0xa6be('0x5a')]['id'])});}}else{socket[_0xa6be('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0x1c2629[_0xa6be('0x46')]['ids']),'WhatsappAccountId':Number(_0x1c2629[_0xa6be('0x5a')]['id'])});}});}})[_0xa6be('0x1f')](respondWithStatusCode(_0xbaeca6,null))[_0xa6be('0x59')](handleError(_0xbaeca6,null));};exports[_0xa6be('0x78')]=function(_0x41a018,_0x2c2828,_0x45bd3e){var _0x33871b={};var _0x2075d0={};var _0x1f7f00;var _0x15edaf;return db[_0xa6be('0x40')]['findOne']({'where':{'id':_0x41a018[_0xa6be('0x5a')]['id']}})[_0xa6be('0x1f')](handleEntityNotFound(_0x2c2828,null))[_0xa6be('0x1f')](function(_0x4a89a5){if(_0x4a89a5){_0x1f7f00=_0x4a89a5;_0x2075d0[_0xa6be('0x45')]=_[_0xa6be('0x47')](db[_0xa6be('0x79')][_0xa6be('0x41')]);_0x2075d0[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x41a018[_0xa6be('0x46')]);_0x2075d0[_0xa6be('0x4e')]=_['intersection'](_0x2075d0[_0xa6be('0x45')],_0x2075d0[_0xa6be('0x46')]);_0x33871b['attributes']=_[_0xa6be('0x48')](_0x2075d0[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x41a018['query']['fields']));_0x33871b[_0xa6be('0x49')]=_0x33871b['attributes'][_0xa6be('0x4b')]?_0x33871b[_0xa6be('0x49')]:_0x2075d0[_0xa6be('0x45')];_0x33871b['order']=qs[_0xa6be('0x6b')](_0x41a018['query']['sort']);_0x33871b[_0xa6be('0x50')]=qs[_0xa6be('0x4e')](_[_0xa6be('0x4f')](_0x41a018[_0xa6be('0x46')],_0x2075d0[_0xa6be('0x4e')]));if(_0x41a018[_0xa6be('0x46')][_0xa6be('0x53')]){_0x33871b[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0x33871b['where'],{'$or':_['map'](_0x33871b[_0xa6be('0x49')],function(_0x58c579){var _0x577f37={};_0x577f37[_0x58c579]={'$like':'%'+_0x41a018[_0xa6be('0x46')][_0xa6be('0x53')]+'%'};return _0x577f37;})});}_0x33871b=_[_0xa6be('0x51')]({},_0x33871b,_0x41a018[_0xa6be('0x54')]);return _0x1f7f00['getAgents'](_0x33871b);}})[_0xa6be('0x1f')](function(_0x349fcf){if(_0x349fcf){_0x15edaf=_0x349fcf[_0xa6be('0x4b')];if(!_0x41a018[_0xa6be('0x46')]['hasOwnProperty'](_0xa6be('0x4c'))){_0x33871b['limit']=qs[_0xa6be('0x2e')](_0x41a018[_0xa6be('0x46')]['limit']);_0x33871b[_0xa6be('0x2c')]=qs[_0xa6be('0x2c')](_0x41a018['query'][_0xa6be('0x2c')]);}return _0x1f7f00[_0xa6be('0x78')](_0x33871b);}})['then'](function(_0x4d98ba){if(_0x4d98ba){return _0x4d98ba?{'count':_0x15edaf,'rows':_0x4d98ba}:null;}})['then'](respondWithResult(_0x2c2828,null))[_0xa6be('0x59')](handleError(_0x2c2828,null));};exports[_0xa6be('0x7a')]=function(_0x42ea95,_0x58b127){var _0x2af365=_0x42ea95['params']['id'];var _0x315c3b=_0x42ea95[_0xa6be('0x5d')];var _0x2da743=0xc8;var _0xb49efb=null;return db['sequelize'][_0xa6be('0x7b')]({'isolationLevel':db['sequelize'][_0xa6be('0x7c')]['ISOLATION_LEVELS'][_0xa6be('0x7d')]},function(_0x1449e7){return db[_0xa6be('0x40')][_0xa6be('0x6f')]({'where':{'id':_0x2af365},'transaction':_0x1449e7})[_0xa6be('0x1f')](function(_0x4866cb){if(_0x4866cb){return db['WhatsappApplication'][_0xa6be('0x37')]({'where':{'WhatsappAccountId':_0x2af365},'transaction':_0x1449e7})[_0xa6be('0x1f')](function(){var _0x31d5bd=_['map'](_0x315c3b,function(_0x260266){_0x260266[_0xa6be('0x67')]=_0x2af365;return _0x260266;});return db[_0xa6be('0x7e')][_0xa6be('0x7f')](_0x31d5bd,{'transaction':_0x1449e7});});}else{_0x2da743=0x194;_0xb49efb=[];}});})[_0xa6be('0x1f')](function(){if(_0x2da743!==0x194){return db[_0xa6be('0x7e')][_0xa6be('0x80')]({'where':{'WhatsappAccountId':_0x2af365},'order':'priority'})['then'](function(_0x2e0cb0){_0xb49efb=_0x2e0cb0;});}})[_0xa6be('0x59')](function(_0x566b52){_0x2da743=0x1f4;logger[_0xa6be('0x25')](_0x566b52[_0xa6be('0x39')]);if(_0x566b52['name']){delete _0x566b52[_0xa6be('0x3a')];}_0xb49efb=_0x566b52;})[_0xa6be('0x81')](function(){if(_0xb49efb===null){_0x58b127['sendStatus'](_0x2da743);}else{if(_0x2da743===0x1f4){_0x58b127[_0xa6be('0x2a')](_0x2da743)[_0xa6be('0x3b')](_0xb49efb);}else{_0x58b127[_0xa6be('0x2a')](_0x2da743)[_0xa6be('0x2b')](_0xb49efb);}}});};exports[_0xa6be('0x82')]=function(_0x5208c2,_0x516bcf,_0x51a035){var _0xc7ade6={};var _0x5f266e={};var _0x5dbe21;var _0x13a46b;return db[_0xa6be('0x40')][_0xa6be('0x6f')]({'where':{'id':_0x5208c2[_0xa6be('0x5a')]['id']}})['then'](handleEntityNotFound(_0x516bcf,null))['then'](function(_0x232774){if(_0x232774){_0x5dbe21=_0x232774;_0x5f266e[_0xa6be('0x45')]=_[_0xa6be('0x47')](db[_0xa6be('0x7e')][_0xa6be('0x41')]);_0x5f266e[_0xa6be('0x46')]=_[_0xa6be('0x47')](_0x5208c2['query']);_0x5f266e[_0xa6be('0x4e')]=_[_0xa6be('0x48')](_0x5f266e[_0xa6be('0x45')],_0x5f266e[_0xa6be('0x46')]);_0xc7ade6['attributes']=_['intersection'](_0x5f266e[_0xa6be('0x45')],qs[_0xa6be('0x4a')](_0x5208c2[_0xa6be('0x46')][_0xa6be('0x4a')]));_0xc7ade6[_0xa6be('0x49')]=_0xc7ade6[_0xa6be('0x49')]['length']?_0xc7ade6[_0xa6be('0x49')]:_0x5f266e['model'];_0xc7ade6[_0xa6be('0x4d')]=qs[_0xa6be('0x6b')](_0x5208c2[_0xa6be('0x46')][_0xa6be('0x6b')]);_0xc7ade6[_0xa6be('0x50')]=qs[_0xa6be('0x4e')](_[_0xa6be('0x4f')](_0x5208c2[_0xa6be('0x46')],_0x5f266e[_0xa6be('0x4e')]));if(_0x5208c2[_0xa6be('0x46')][_0xa6be('0x53')]){_0xc7ade6[_0xa6be('0x50')]=_[_0xa6be('0x51')](_0xc7ade6[_0xa6be('0x50')],{'$or':_[_0xa6be('0x3f')](_0xc7ade6[_0xa6be('0x49')],function(_0x5c50d8){var _0x1fc5a8={};_0x1fc5a8[_0x5c50d8]={'$like':'%'+_0x5208c2[_0xa6be('0x46')]['filter']+'%'};return _0x1fc5a8;})});}_0xc7ade6=_[_0xa6be('0x51')]({},_0xc7ade6,_0x5208c2[_0xa6be('0x54')]);return _0x5dbe21[_0xa6be('0x82')](_0xc7ade6);}})[_0xa6be('0x1f')](function(_0x2aafd9){if(_0x2aafd9){_0x13a46b=_0x2aafd9[_0xa6be('0x4b')];if(!_0x5208c2[_0xa6be('0x46')]['hasOwnProperty'](_0xa6be('0x4c'))){_0xc7ade6[_0xa6be('0x2e')]=qs[_0xa6be('0x2e')](_0x5208c2[_0xa6be('0x46')][_0xa6be('0x2e')]);_0xc7ade6[_0xa6be('0x2c')]=qs[_0xa6be('0x2c')](_0x5208c2['query'][_0xa6be('0x2c')]);}return _0x5dbe21[_0xa6be('0x82')](_0xc7ade6);}})['then'](function(_0x69666f){if(_0x69666f){return _0x69666f?{'count':_0x13a46b,'rows':_0x69666f}:null;}})[_0xa6be('0x1f')](respondWithResult(_0x516bcf,null))['catch'](handleError(_0x516bcf,null));};exports['notify']=function(_0x3ec4e3,_0x2d8705,_0x372ed5){var _0x15efe5={'channel':_0xa6be('0x83')};var _0x375f3f=[];var _0x163bfb=[];var _0x4b85e8={};return db[_0xa6be('0x40')][_0xa6be('0x5b')]({'where':{'id':_0x3ec4e3['params']['id']},'include':[{'model':db[_0xa6be('0x7e')],'as':'Applications'}]})[_0xa6be('0x1f')](handleEntityNotFound(_0x2d8705,null))[_0xa6be('0x1f')](function(_0x1f19a6){_0x15efe5['account']=_0x1f19a6;if(_0x15efe5[_0xa6be('0x84')]&&_0x15efe5['account'][_0xa6be('0x43')]===_0xa6be('0x85')&&_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x86')]){if(_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x86')]['length']===0x0)return;if(_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x86')][0x0]['state']!==_0xa6be('0x87'))return;return db[_0xa6be('0x88')][_0xa6be('0x34')]({'read':!![],'readAt':_0x3ec4e3['body'][_0xa6be('0x86')][0x0][_0xa6be('0x89')]},{'where':{'messageId':_0x3ec4e3['body']['statuses'][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x4bb415){return _0x2d8705[_0xa6be('0x2a')](0xc8)[_0xa6be('0x2b')](_0x4bb415);});}_0x15efe5['applications']=_['orderBy'](_0x1f19a6[_0xa6be('0x8a')],[_0xa6be('0x8b')],['asc']);if(_0x15efe5[_0xa6be('0x84')][_0xa6be('0x8a')]){delete _0x15efe5[_0xa6be('0x84')]['Applications'];}return db[_0xa6be('0x8c')][_0xa6be('0x65')]()[_0xa6be('0x1f')](function(_0x5c10d3){if(!_0x5c10d3){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0x8f'));}_0x375f3f=_['difference'](_[_0xa6be('0x47')](_0x5c10d3),[_0xa6be('0x90'),_0xa6be('0x91')]);_0x163bfb=_[_0xa6be('0x92')](_[_0xa6be('0x47')](_0x5c10d3),[_0xa6be('0x90'),_0xa6be('0x91'),'CompanyId',_0xa6be('0x93')]);_0x15efe5['body']={'mapKey':_0xa6be('0x94')};if(_0x15efe5['account']&&_0x15efe5[_0xa6be('0x84')]['type']===_0xa6be('0x95')){_0x15efe5[_0xa6be('0x5d')]['from']=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x96')][_0xa6be('0x97')](_0xa6be('0x98'),'');_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x99')];_0x15efe5[_0xa6be('0x5d')]['messageId']=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9a')];}if(_0x15efe5['account']&&_0x15efe5[_0xa6be('0x84')][_0xa6be('0x43')]===_0xa6be('0x85')){_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x9b')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9c')][0x0][_0xa6be('0x9b')];_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9c')][0x0]['message'][_0xa6be('0x5d')];_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x9d')]=_0x3ec4e3[_0xa6be('0x5d')][_0xa6be('0x9c')][0x0][_0xa6be('0x9e')];}if(_0x15efe5[_0xa6be('0x5d')]['id']){delete _0x15efe5[_0xa6be('0x5d')]['id'];}if(_[_0xa6be('0x9f')](_0x15efe5['body'][_0xa6be('0x9b')])){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0xa0'));}if(_[_0xa6be('0x9f')](_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')])||_0x15efe5['body'][_0xa6be('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa6be('0x9f')](_0x15efe5[_0xa6be('0x5d')][_0xa6be('0xa1')])){throw new db['Sequelize'][(_0xa6be('0x8e'))](_0xa6be('0xa2')+_0x163bfb);}if(!_[_0xa6be('0xa3')](_0x163bfb,_0x15efe5[_0xa6be('0x5d')][_0xa6be('0xa1')])){throw new db[(_0xa6be('0x8d'))]['ValidationError'](_0xa6be('0xa4')+_0x163bfb);}_0x4b85e8[_0x15efe5[_0xa6be('0x5d')]['mapKey']]=_0x15efe5[_0xa6be('0x5d')]['from'];return db['CmList'][_0xa6be('0x5b')]({'where':{'id':_0x15efe5[_0xa6be('0x84')][_0xa6be('0x93')]},'include':[{'model':db[_0xa6be('0x8c')],'as':'Contacts','where':_0x4b85e8,'limit':0x1,'order':[[_0xa6be('0x91'),_0xa6be('0xa5')]]}]});})['then'](handleEntityNotFound(_0x2d8705,null))[_0xa6be('0x1f')](function(_0x4846ee){if(_0x4846ee){_0x15efe5[_0xa6be('0xa6')]=_[_0xa6be('0x71')](_0x4846ee,['Contacts']);if(_0x4846ee[_0xa6be('0xa7')]['length']){return _0x4846ee['Contacts'][0x0];}var _0x115791=_[_0xa6be('0x17')](_0x15efe5['body'],{'firstName':_0x15efe5[_0xa6be('0x5d')]['from'],'ListId':_0x4846ee['id']});_0x115791[_0x15efe5[_0xa6be('0x5d')][_0xa6be('0xa1')]]=_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x9b')];return db['CmContact'][_0xa6be('0x5c')](_0x115791,{'fields':_0x375f3f,'raw':!![]});}})[_0xa6be('0x1f')](handleEntityNotFound(_0x2d8705,null))[_0xa6be('0x1f')](function(_0x3ace7a){if(_0x3ace7a){_0x15efe5[_0xa6be('0xa8')]=_0x3ace7a;var _0x1f6fe5={'ContactId':_0x3ace7a['id'],'phone':_0x15efe5[_0xa6be('0x5d')]['from'],'WhatsappAccountId':_0x3ec4e3['params']['id']};var _0x1d9796={'ContactId':_0x3ace7a['id'],'WhatsappAccountId':_0x3ec4e3[_0xa6be('0x5a')]['id'],'closed':![]};return db[_0xa6be('0xa9')][_0xa6be('0x5b')]({'where':_0x1d9796})['then'](function(_0x8d4403){if(_0x8d4403){return[_0x8d4403,![]];}return db[_0xa6be('0xa9')][_0xa6be('0x5c')](_0x1f6fe5)[_0xa6be('0x1f')](function(_0x478eee){return[_0x478eee,!![]];});});}})[_0xa6be('0x72')](function(_0x1b3cb2,_0x4f6942){_0x15efe5[_0xa6be('0xaa')]=_0x1b3cb2['get']({'plain':!![]});_0x15efe5['interaction']['created']=![];if(_0x4f6942){if(_0x15efe5[_0xa6be('0x84')][_0xa6be('0xab')]){_0x15efe5['applications']['push']({'id':0x0,'priority':_0x15efe5[_0xa6be('0xac')][_0xa6be('0x4b')]+0x1,'app':'close','appdata':_0xa6be('0xad'),'interval':_0xa6be('0xae')});}_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xaf')]=!![];}return db[_0xa6be('0x88')]['create']({'phone':_0x15efe5['body'][_0xa6be('0x9b')],'messageId':_0x15efe5[_0xa6be('0x5d')]['messageId'],'body':_0x15efe5[_0xa6be('0x5d')][_0xa6be('0x5d')],'WhatsappAccountId':_0x3ec4e3['params']['id'],'WhatsappInteractionId':_0x1b3cb2['id'],'direction':'in','ContactId':_0x1b3cb2['ContactId'],'AttachmentId':_0x15efe5['body']['AttachmentId']});})[_0xa6be('0x1f')](function(_0x423469){_0x15efe5[_0xa6be('0x28')]=_0x423469;if(!_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xb0')])return;return db[_0xa6be('0x79')][_0xa6be('0x5b')]({'attributes':['id',_0xa6be('0x3a')],'where':{'id':_0x15efe5[_0xa6be('0xaa')]['UserId']}});})[_0xa6be('0x1f')](function(_0x34aad4){if(_0x34aad4){_0x15efe5['applications'][_0xa6be('0xb1')]({'id':0x0,'priority':0x0,'app':_0xa6be('0xb2'),'appdata':_0x34aad4[_0xa6be('0x3a')]+','+(_0x15efe5[_0xa6be('0x84')][_0xa6be('0xb3')]||0xa),'interval':'*,*,*,*'});}if(!_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xb4')])return;return db[_0xa6be('0xb5')]['find']({'attributes':['id',_0xa6be('0x3a')],'where':{'id':_0x15efe5[_0xa6be('0xaa')][_0xa6be('0xb4')]}});})['then'](function(_0x495250){if(_0x495250){_0x15efe5['applications'][_0xa6be('0xb1')]({'id':0x0,'priority':0x1,'app':_0xa6be('0xb6'),'appdata':_0x495250['name']+','+(_0x15efe5[_0xa6be('0x84')][_0xa6be('0xb7')]||0x12c),'interval':_0xa6be('0xae')});}return respondWithRpcPromise('Start',_0xa6be('0xb8'),_0x15efe5);})['then'](function(_0x5c1f08){if(_0x5c1f08){var _0x57a4e5=0xc8;var _0x326994=_0xa6be('0xb9');logger[_0xa6be('0x20')](_0xa6be('0x23'),_0x326994,_0x57a4e5,'entity\x20found');logger[_0xa6be('0x22')](_0xa6be('0xba'),_0x326994,_0x57a4e5,'entity\x20found',JSON[_0xa6be('0x24')](_0x5c1f08));if(_0x15efe5['account']['type']===_0xa6be('0x95')){return _0x2d8705['status'](_0x57a4e5)['set'](_0xa6be('0xbb'),_0xa6be('0xbc'))[_0xa6be('0x3b')]('\x0a');}else{return _0x2d8705[_0xa6be('0x2a')](_0x57a4e5)['json'](_0x5c1f08);}}});})[_0xa6be('0x59')](handleError(_0x2d8705,null));};exports[_0xa6be('0x3b')]=function(_0x52283b,_0x57181d,_0x483ffa){var _0x37e6b9,_0x169d5f,_0x2a4d81;if(_[_0xa6be('0x9f')](_0x52283b[_0xa6be('0x5d')][_0xa6be('0x5d')])||_0x52283b[_0xa6be('0x5d')]['body']===''){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0xbd'));}if(_[_0xa6be('0x9f')](_0x52283b[_0xa6be('0x5d')]['to'])){throw new db[(_0xa6be('0x8d'))][(_0xa6be('0x8e'))](_0xa6be('0xbe'));}_0x37e6b9=_0x52283b[_0xa6be('0x5d')]['to'];return db['WhatsappAccount'][_0xa6be('0x5b')]({'where':{'id':_0x52283b[_0xa6be('0x5a')]['id']},'include':[{'model':db[_0xa6be('0xbf')],'as':'List','include':[{'model':db[_0xa6be('0x8c')],'as':_0xa6be('0xa7'),'where':{'mobile':_0x37e6b9},'limit':0x1,'order':[[_0xa6be('0x91'),'DESC']]}]}]})[_0xa6be('0x1f')](handleEntityNotFound(_0x57181d,null))[_0xa6be('0x1f')](function(_0x5727b4){if(_0x5727b4&&_0x5727b4[_0xa6be('0xc0')]){_0x169d5f=_0x5727b4['get']({'plain':!![]});if(_0x169d5f[_0xa6be('0xc0')]&&_0x169d5f['List'][_0xa6be('0xa7')][_0xa6be('0x4b')]){return _0x169d5f[_0xa6be('0xc0')][_0xa6be('0xa7')][0x0];}return db[_0xa6be('0x8c')][_0xa6be('0x5c')](_[_0xa6be('0x17')](_0x52283b[_0xa6be('0x5d')],{'firstName':_0x37e6b9,'mobile':_0x37e6b9,'phone':_0x37e6b9,'ListId':_0x169d5f[_0xa6be('0x93')]}));}})['then'](handleEntityNotFound(_0x57181d,null))[_0xa6be('0x1f')](function(_0x1ecec4){if(_0x1ecec4){_0x2a4d81=_0x1ecec4;return db[_0xa6be('0xa9')][_0xa6be('0x5b')]({'where':{'ContactId':_0x2a4d81['id'],'closed':![],'WhatsappAccountId':_0x169d5f['id']}})['then'](function(_0x2a2ed9){if(_0x2a2ed9){return[_0x2a2ed9,![]];}return db['WhatsappInteraction'][_0xa6be('0x5c')]({'UserId':_0x52283b[_0xa6be('0x5e')]['id'],'ContactId':_0x2a4d81['id'],'WhatsappAccountId':_0x169d5f['id'],'phone':_0x37e6b9,'firstMsgDirection':'out','Messages':[_[_0xa6be('0x51')](_0x52283b['body'],{'read':![],'body':_0x52283b[_0xa6be('0x5d')][_0xa6be('0x5d')],'phone':_0x37e6b9,'WhatsappAccountId':_0x169d5f['id'],'UserId':_0x52283b[_0xa6be('0x5e')]['id'],'ContactId':_0x2a4d81['id']})]},{'include':[{'model':db[_0xa6be('0x88')],'as':'Messages'}]})[_0xa6be('0x1f')](function(_0x543bfe){return[_0x543bfe,!![]];});});}})[_0xa6be('0x72')](function(_0x48a37b,_0x3e0a11){if(_0x3e0a11){return _0x48a37b;}return db[_0xa6be('0x88')][_0xa6be('0x5c')](_['merge'](_0x52283b[_0xa6be('0x5d')],{'read':![],'body':_0x52283b['body'][_0xa6be('0x5d')],'phone':_0x37e6b9,'WhatsappAccountId':_0x169d5f['id'],'WhatsappInteractionId':_0x48a37b['id'],'UserId':_0x52283b[_0xa6be('0x5e')]['id'],'ContactId':_0x2a4d81['id']}))[_0xa6be('0x1f')](function(_0x1a05d9){_0x48a37b[_0xa6be('0xc1')][_0xa6be('0xc2')]=[];_0x48a37b[_0xa6be('0xc1')][_0xa6be('0xc2')][_0xa6be('0xc3')](_0x1a05d9['dataValues']);return _0x48a37b;});})[_0xa6be('0x1f')](respondWithResult(_0x57181d,null))[_0xa6be('0x59')](handleError(_0x57181d,null));}; \ No newline at end of file +var _0x8b54=['queueId','WhatsappQueue','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','set','Content-Type','text/xml','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','WhatsappAccount,\x20%s,\x20%s','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','WhatsappAccount','includeAll','include','rows','show','keys','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','describe','addDisposition','WhatsappAccountId','getDispositions','Disposition','nolimit','order','pick','removeDispositions','getAnswers','findOne','CannedAnswer','findAll','removeAnswers','ids','addAgents','omit','spread','emit','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','from','notifications','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','WhatsappInteraction','interaction','autoclose','push','close','*,*,*,*','created','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent'];(function(_0x4a0552,_0x4d462b){var _0x35afa7=function(_0x180670){while(--_0x180670){_0x4a0552['push'](_0x4a0552['shift']());}};_0x35afa7(++_0x4d462b);}(_0x8b54,0x1a8));var _0x48b5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b54[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x48b5('0x0'));var rimraf=require(_0x48b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x48b5('0x2'));var rp=require(_0x48b5('0x3'));var moment=require('moment');var BPromise=require(_0x48b5('0x4'));var Mustache=require(_0x48b5('0x5'));var util=require('util');var path=require('path');var sox=require(_0x48b5('0x6'));var csv=require(_0x48b5('0x7'));var ejs=require(_0x48b5('0x8'));var fs=require('fs');var fs_extra=require(_0x48b5('0x9'));var _=require('lodash');var squel=require(_0x48b5('0xa'));var crypto=require(_0x48b5('0xb'));var jsforce=require(_0x48b5('0xc'));var deskjs=require(_0x48b5('0xd'));var toCsv=require(_0x48b5('0x7'));var querystring=require(_0x48b5('0xe'));var Papa=require(_0x48b5('0xf'));var Redis=require(_0x48b5('0x10'));var authService=require(_0x48b5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x48b5('0x12'));var hardwareService=require(_0x48b5('0x13'));var logger=require('../../config/logger')(_0x48b5('0x14'));var utils=require('../../config/utils');var config=require(_0x48b5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x48b5('0x16'))['db'];config[_0x48b5('0x17')]=_[_0x48b5('0x18')](config[_0x48b5('0x17')],{'host':_0x48b5('0x19'),'port':0x18eb});var socket=require(_0x48b5('0x1a'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x48b5('0x1b')](socket);var jayson=require(_0x48b5('0x1c'));var client=jayson[_0x48b5('0x1d')][_0x48b5('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x2833f9,_0x298007,_0x42b86a,_0x47a13e){return new BPromise(function(_0x176e3a,_0x493ea1){var _0xeadc27=_0x47a13e||client;return _0xeadc27[_0x48b5('0x1f')](_0x2833f9,_0x42b86a)['then'](function(_0x506f24){logger[_0x48b5('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x298007,'request\x20sent');logger[_0x48b5('0x21')](_0x48b5('0x22'),_0x298007,_0x48b5('0x23'),JSON['stringify'](_0x506f24));if(_0x506f24['error']){if(_0x506f24[_0x48b5('0x24')][_0x48b5('0x25')]===0x1f4){logger[_0x48b5('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x298007,_0x506f24[_0x48b5('0x24')]['message']);return _0x493ea1(_0x506f24['error'][_0x48b5('0x26')]);}logger[_0x48b5('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x298007,_0x506f24[_0x48b5('0x24')][_0x48b5('0x26')]);return _0x176e3a(_0x506f24[_0x48b5('0x24')][_0x48b5('0x26')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x298007,_0x48b5('0x23'));_0x176e3a(_0x506f24[_0x48b5('0x27')][_0x48b5('0x26')]);}})[_0x48b5('0x28')](function(_0x1fea8d){logger[_0x48b5('0x24')](_0x48b5('0x29'),_0x298007,_0x1fea8d);_0x493ea1(_0x1fea8d);});});}function respondWithStatusCode(_0x2c1a91,_0x101d6e){_0x101d6e=_0x101d6e||0xcc;return function(_0x43f037){if(_0x43f037){return _0x2c1a91[_0x48b5('0x2a')](_0x101d6e);}return _0x2c1a91['status'](_0x101d6e)[_0x48b5('0x2b')]();};}function respondWithResult(_0xe9414e,_0x262c92){_0x262c92=_0x262c92||0xc8;return function(_0xab94ca){if(_0xab94ca){return _0xe9414e[_0x48b5('0x2c')](_0x262c92)['json'](_0xab94ca);}};}function respondWithFilteredResult(_0x59ac33,_0x4bf408){return function(_0x25cee5){if(_0x25cee5){var _0x45b12b=typeof _0x4bf408[_0x48b5('0x2d')]==='undefined'&&typeof _0x4bf408[_0x48b5('0x2e')]===_0x48b5('0x2f');var _0x10671c=_0x25cee5[_0x48b5('0x30')];var _0x260ab2=_0x45b12b?0x0:_0x4bf408['offset'];var _0x5ab4d2=_0x45b12b?_0x25cee5['count']:_0x4bf408[_0x48b5('0x2d')]+_0x4bf408[_0x48b5('0x2e')];var _0x39dd3a;if(_0x5ab4d2>=_0x10671c){_0x5ab4d2=_0x10671c;_0x39dd3a=0xc8;}else{_0x39dd3a=0xce;}_0x59ac33['status'](_0x39dd3a);return _0x59ac33['set'](_0x48b5('0x31'),_0x260ab2+'-'+_0x5ab4d2+'/'+_0x10671c)[_0x48b5('0x32')](_0x25cee5);}return null;};}function patchUpdates(_0x4cd5a2){return function(_0x5afc53){try{jsonpatch[_0x48b5('0x33')](_0x5afc53,_0x4cd5a2,!![]);}catch(_0x2634a1){return BPromise[_0x48b5('0x34')](_0x2634a1);}return _0x5afc53[_0x48b5('0x35')]();};}function saveUpdates(_0x4c9e53,_0x40cc69){return function(_0xff3a66){if(_0xff3a66){return _0xff3a66[_0x48b5('0x36')](_0x4c9e53)['then'](function(_0x2ccb51){return _0x2ccb51;});}return null;};}function removeEntity(_0x2c29e2,_0x4414c6){return function(_0x3aecac){if(_0x3aecac){return _0x3aecac['destroy']()[_0x48b5('0x37')](function(){var _0x3ff270=_0x3aecac[_0x48b5('0x38')]({'plain':!![]});var _0x28016a=_0x48b5('0x39');return db[_0x48b5('0x3a')][_0x48b5('0x3b')]({'where':{'type':_0x28016a,'resourceId':_0x3ff270['id']}})[_0x48b5('0x37')](function(){return _0x3aecac;});})['then'](function(){_0x2c29e2[_0x48b5('0x2c')](0xcc)[_0x48b5('0x2b')]();});}};}function handleEntityNotFound(_0x5829c7,_0xb8ce0d){return function(_0x40e3ce){if(!_0x40e3ce){_0x5829c7[_0x48b5('0x2a')](0x194);}return _0x40e3ce;};}function handleError(_0x450d92,_0x1b84da){_0x1b84da=_0x1b84da||0x1f4;return function(_0x5a83cb){logger['error'](_0x5a83cb[_0x48b5('0x3c')]);if(_0x5a83cb[_0x48b5('0x3d')]){delete _0x5a83cb[_0x48b5('0x3d')];}_0x450d92[_0x48b5('0x2c')](_0x1b84da)[_0x48b5('0x3e')](_0x5a83cb);};}exports[_0x48b5('0x3f')]=function(_0x3e62b1,_0x3ccf84){var _0xd308bc={'include':[{'model':db[_0x48b5('0x40')],'as':_0x48b5('0x41')}]},_0x8aa174={},_0x3d01b1={'count':0x0,'rows':[]};var _0xb05e5e=_['map'](db['WhatsappAccount'][_0x48b5('0x42')],function(_0x158939){return{'name':_0x158939['fieldName'],'type':_0x158939[_0x48b5('0x43')][_0x48b5('0x44')]};});_0x8aa174[_0x48b5('0x45')]=_[_0x48b5('0x46')](_0xb05e5e,_0x48b5('0x3d'));_0x8aa174[_0x48b5('0x47')]=_['keys'](_0x3e62b1['query']);_0x8aa174[_0x48b5('0x48')]=_[_0x48b5('0x49')](_0x8aa174[_0x48b5('0x45')],_0x8aa174[_0x48b5('0x47')]);_0xd308bc[_0x48b5('0x4a')]=_[_0x48b5('0x49')](_0x8aa174['model'],qs['fields'](_0x3e62b1[_0x48b5('0x47')][_0x48b5('0x4b')]));_0xd308bc[_0x48b5('0x4a')]=_0xd308bc[_0x48b5('0x4a')][_0x48b5('0x4c')]?_0xd308bc[_0x48b5('0x4a')]:_0x8aa174[_0x48b5('0x45')];if(!_0x3e62b1[_0x48b5('0x47')][_0x48b5('0x4d')]('nolimit')){_0xd308bc[_0x48b5('0x2e')]=qs[_0x48b5('0x2e')](_0x3e62b1[_0x48b5('0x47')]['limit']);_0xd308bc[_0x48b5('0x2d')]=qs[_0x48b5('0x2d')](_0x3e62b1[_0x48b5('0x47')][_0x48b5('0x2d')]);}_0xd308bc['order']=qs[_0x48b5('0x4e')](_0x3e62b1[_0x48b5('0x47')]['sort']);_0xd308bc[_0x48b5('0x4f')]=qs['filters'](_['pick'](_0x3e62b1['query'],_0x8aa174[_0x48b5('0x48')]),_0xb05e5e);if(_0x3e62b1[_0x48b5('0x47')][_0x48b5('0x50')]){_0xd308bc[_0x48b5('0x4f')]=_[_0x48b5('0x51')](_0xd308bc[_0x48b5('0x4f')],{'$or':_[_0x48b5('0x46')](_0xb05e5e,function(_0x2a3b42){if(_0x2a3b42[_0x48b5('0x43')]!==_0x48b5('0x52')){var _0x3c4b2f={};_0x3c4b2f[_0x2a3b42[_0x48b5('0x3d')]]={'$like':'%'+_0x3e62b1['query']['filter']+'%'};return _0x3c4b2f;}})});}_0xd308bc=_['merge']({},_0xd308bc,_0x3e62b1[_0x48b5('0x53')]);var _0x4a3701={'where':_0xd308bc[_0x48b5('0x4f')]};return db[_0x48b5('0x54')][_0x48b5('0x30')](_0x4a3701)[_0x48b5('0x37')](function(_0x555f91){_0x3d01b1[_0x48b5('0x30')]=_0x555f91;if(_0x3e62b1['query'][_0x48b5('0x55')]){_0xd308bc[_0x48b5('0x56')]=[{'all':!![]}];}return db[_0x48b5('0x54')]['findAll'](_0xd308bc);})['then'](function(_0x289b23){_0x3d01b1[_0x48b5('0x57')]=_0x289b23;return _0x3d01b1;})['then'](respondWithFilteredResult(_0x3ccf84,_0xd308bc))[_0x48b5('0x28')](handleError(_0x3ccf84,null));};exports[_0x48b5('0x58')]=function(_0xd53363,_0x1668d7){var _0x2791c3={'raw':![],'where':{'id':_0xd53363['params']['id']},'include':[{'model':db['Pause'],'as':_0x48b5('0x41')}]},_0x5e19a6={};_0x5e19a6[_0x48b5('0x45')]=_[_0x48b5('0x59')](db[_0x48b5('0x54')][_0x48b5('0x42')]);_0x5e19a6[_0x48b5('0x47')]=_[_0x48b5('0x59')](_0xd53363[_0x48b5('0x47')]);_0x5e19a6[_0x48b5('0x48')]=_[_0x48b5('0x49')](_0x5e19a6[_0x48b5('0x45')],_0x5e19a6[_0x48b5('0x47')]);_0x2791c3['attributes']=_['intersection'](_0x5e19a6[_0x48b5('0x45')],qs['fields'](_0xd53363[_0x48b5('0x47')]['fields']));_0x2791c3['attributes']=_0x2791c3[_0x48b5('0x4a')]['length']?_0x2791c3[_0x48b5('0x4a')]:_0x5e19a6[_0x48b5('0x45')];if(_0xd53363[_0x48b5('0x47')][_0x48b5('0x55')]){_0x2791c3[_0x48b5('0x56')]=[{'all':!![]}];}_0x2791c3=_[_0x48b5('0x51')]({},_0x2791c3,_0xd53363['options']);return db[_0x48b5('0x54')]['find'](_0x2791c3)[_0x48b5('0x37')](handleEntityNotFound(_0x1668d7,null))[_0x48b5('0x37')](respondWithResult(_0x1668d7,null))[_0x48b5('0x28')](handleError(_0x1668d7,null));};exports[_0x48b5('0x5a')]=function(_0x562367,_0x11bc06){return db['WhatsappAccount'][_0x48b5('0x5a')](_0x562367['body'],{})[_0x48b5('0x37')](function(_0x1bc3f3){var _0xf0ca1c=_0x562367[_0x48b5('0x5b')][_0x48b5('0x38')]({'plain':!![]});if(!_0xf0ca1c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf0ca1c[_0x48b5('0x5c')]===_0x48b5('0x5b')){var _0x16bfe6=_0x1bc3f3['get']({'plain':!![]});var _0x4304b9=_0x48b5('0x39');return db[_0x48b5('0x5d')][_0x48b5('0x5e')]({'where':{'name':_0x4304b9,'userProfileId':_0xf0ca1c[_0x48b5('0x5f')]},'raw':!![]})[_0x48b5('0x37')](function(_0x3d8e80){if(_0x3d8e80&&_0x3d8e80[_0x48b5('0x60')]===0x0){return db[_0x48b5('0x3a')]['create']({'name':_0x16bfe6['name'],'resourceId':_0x16bfe6['id'],'type':_0x3d8e80[_0x48b5('0x3d')],'sectionId':_0x3d8e80['id']},{})[_0x48b5('0x37')](function(){return _0x1bc3f3;});}else{return _0x1bc3f3;}})['catch'](function(_0x4d97f2){logger['error'](_0x48b5('0x61'),_0x4d97f2);throw _0x4d97f2;});}return _0x1bc3f3;})[_0x48b5('0x37')](respondWithResult(_0x11bc06,0xc9))['catch'](handleError(_0x11bc06,null));};exports['update']=function(_0x3fb0b2,_0x3d8f15){if(_0x3fb0b2['body']['id']){delete _0x3fb0b2['body']['id'];}return db[_0x48b5('0x54')]['find']({'where':{'id':_0x3fb0b2[_0x48b5('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x48b5('0x37')](handleEntityNotFound(_0x3d8f15,null))['then'](saveUpdates(_0x3fb0b2[_0x48b5('0x63')],null))[_0x48b5('0x37')](respondWithResult(_0x3d8f15,null))[_0x48b5('0x28')](handleError(_0x3d8f15,null));};exports[_0x48b5('0x3b')]=function(_0x3b1bc4,_0x236454){return db[_0x48b5('0x54')][_0x48b5('0x5e')]({'where':{'id':_0x3b1bc4[_0x48b5('0x62')]['id']}})[_0x48b5('0x37')](handleEntityNotFound(_0x236454,null))[_0x48b5('0x37')](removeEntity(_0x236454,null))[_0x48b5('0x28')](handleError(_0x236454,null));};exports[_0x48b5('0x64')]=function(_0x4550ff,_0x2507c0){return db['WhatsappAccount'][_0x48b5('0x64')]()[_0x48b5('0x37')](respondWithResult(_0x2507c0,null))[_0x48b5('0x28')](handleError(_0x2507c0,null));};exports[_0x48b5('0x65')]=function(_0x31cc3f,_0x31b5b5,_0x473215){if(_0x31cc3f[_0x48b5('0x63')]['id']){delete _0x31cc3f[_0x48b5('0x63')]['id'];}return db[_0x48b5('0x54')][_0x48b5('0x5e')]({'where':{'id':_0x31cc3f[_0x48b5('0x62')]['id']}})[_0x48b5('0x37')](handleEntityNotFound(_0x31b5b5,null))['then'](function(_0x2951fb){if(_0x2951fb){_0x31cc3f[_0x48b5('0x63')][_0x48b5('0x66')]=_0x2951fb['id'];return db['Disposition'][_0x48b5('0x5a')](_0x31cc3f[_0x48b5('0x63')]);}})[_0x48b5('0x37')](respondWithResult(_0x31b5b5,null))['catch'](handleError(_0x31b5b5,null));};exports[_0x48b5('0x67')]=function(_0x2801ac,_0x457c51,_0x4413fa){var _0x52ca70={'raw':![],'where':{}};var _0x52764d={};var _0x19030d={'count':0x0,'rows':[]};return db[_0x48b5('0x54')]['findOne']({'where':{'id':_0x2801ac['params']['id']}})['then'](handleEntityNotFound(_0x457c51,null))[_0x48b5('0x37')](function(_0x4d1b95){if(_0x4d1b95){_0x52764d[_0x48b5('0x45')]=_[_0x48b5('0x59')](db[_0x48b5('0x68')][_0x48b5('0x42')]);_0x52764d[_0x48b5('0x47')]=_['keys'](_0x2801ac['query']);_0x52764d[_0x48b5('0x48')]=_['intersection'](_0x52764d['model'],_0x52764d[_0x48b5('0x47')]);_0x52ca70[_0x48b5('0x4a')]=_['intersection'](_0x52764d['model'],qs[_0x48b5('0x4b')](_0x2801ac['query'][_0x48b5('0x4b')]));_0x52ca70[_0x48b5('0x4a')]=_0x52ca70[_0x48b5('0x4a')][_0x48b5('0x4c')]?_0x52ca70['attributes']:_0x52764d['model'];if(!_0x2801ac['query'][_0x48b5('0x4d')](_0x48b5('0x69'))){_0x52ca70[_0x48b5('0x2e')]=qs['limit'](_0x2801ac[_0x48b5('0x47')][_0x48b5('0x2e')]);_0x52ca70[_0x48b5('0x2d')]=qs[_0x48b5('0x2d')](_0x2801ac[_0x48b5('0x47')][_0x48b5('0x2d')]);}_0x52ca70[_0x48b5('0x6a')]=qs[_0x48b5('0x4e')](_0x2801ac[_0x48b5('0x47')][_0x48b5('0x4e')]);_0x52ca70[_0x48b5('0x4f')]=qs[_0x48b5('0x48')](_[_0x48b5('0x6b')](_0x2801ac[_0x48b5('0x47')],_0x52764d['filters']));_0x52ca70[_0x48b5('0x4f')][_0x48b5('0x66')]=_0x4d1b95['id'];if(_0x2801ac[_0x48b5('0x47')][_0x48b5('0x50')]){_0x52ca70['where']=_[_0x48b5('0x51')](_0x52ca70[_0x48b5('0x4f')],{'$or':_['map'](_0x52ca70[_0x48b5('0x4a')],function(_0x281c0b){var _0x96bec8={};_0x96bec8[_0x281c0b]={'$like':'%'+_0x2801ac['query'][_0x48b5('0x50')]+'%'};return _0x96bec8;})});}_0x52ca70=_[_0x48b5('0x51')]({},_0x52ca70,_0x2801ac['options']);return db[_0x48b5('0x68')][_0x48b5('0x30')]({'where':_0x52ca70[_0x48b5('0x4f')]})[_0x48b5('0x37')](function(_0x5cbbeb){_0x19030d[_0x48b5('0x30')]=_0x5cbbeb;if(_0x2801ac[_0x48b5('0x47')][_0x48b5('0x55')]){_0x52ca70[_0x48b5('0x56')]=[{'all':!![]}];}return db[_0x48b5('0x68')]['findAll'](_0x52ca70);})['then'](function(_0x4d0411){_0x19030d[_0x48b5('0x57')]=_0x4d0411;return _0x19030d;});}})[_0x48b5('0x37')](respondWithFilteredResult(_0x457c51,_0x52ca70))['catch'](handleError(_0x457c51,null));};exports['removeDispositions']=function(_0x4e4dcd,_0x53e940,_0x407028){return db['WhatsappAccount'][_0x48b5('0x5e')]({'where':{'id':_0x4e4dcd['params']['id']}})[_0x48b5('0x37')](handleEntityNotFound(_0x53e940,null))[_0x48b5('0x37')](function(_0x207042){if(_0x207042){return _0x207042[_0x48b5('0x6c')](_0x4e4dcd['query']['ids']);}})[_0x48b5('0x37')](respondWithStatusCode(_0x53e940,null))['catch'](handleError(_0x53e940,null));};exports['addAnswer']=function(_0x110d99,_0x3861ed,_0x58efd6){if(_0x110d99[_0x48b5('0x63')]['id']){delete _0x110d99[_0x48b5('0x63')]['id'];}return db[_0x48b5('0x54')]['find']({'where':{'id':_0x110d99[_0x48b5('0x62')]['id']}})['then'](handleEntityNotFound(_0x3861ed,null))[_0x48b5('0x37')](function(_0x1d0702){if(_0x1d0702){_0x110d99[_0x48b5('0x63')][_0x48b5('0x66')]=_0x1d0702['id'];return db['CannedAnswer'][_0x48b5('0x5a')](_0x110d99[_0x48b5('0x63')]);}})[_0x48b5('0x37')](respondWithResult(_0x3861ed,null))[_0x48b5('0x28')](handleError(_0x3861ed,null));};exports[_0x48b5('0x6d')]=function(_0x53d0f1,_0x13d0ea,_0x3cbf9e){var _0x27876c={'raw':![],'where':{}};var _0x1e6155={};var _0x29860e={'count':0x0,'rows':[]};return db[_0x48b5('0x54')][_0x48b5('0x6e')]({'where':{'id':_0x53d0f1[_0x48b5('0x62')]['id']}})[_0x48b5('0x37')](handleEntityNotFound(_0x13d0ea,null))[_0x48b5('0x37')](function(_0x195ddd){if(_0x195ddd){_0x1e6155['model']=_[_0x48b5('0x59')](db['CannedAnswer'][_0x48b5('0x42')]);_0x1e6155['query']=_[_0x48b5('0x59')](_0x53d0f1[_0x48b5('0x47')]);_0x1e6155[_0x48b5('0x48')]=_[_0x48b5('0x49')](_0x1e6155[_0x48b5('0x45')],_0x1e6155[_0x48b5('0x47')]);_0x27876c[_0x48b5('0x4a')]=_[_0x48b5('0x49')](_0x1e6155['model'],qs['fields'](_0x53d0f1[_0x48b5('0x47')][_0x48b5('0x4b')]));_0x27876c[_0x48b5('0x4a')]=_0x27876c[_0x48b5('0x4a')]['length']?_0x27876c['attributes']:_0x1e6155[_0x48b5('0x45')];if(!_0x53d0f1[_0x48b5('0x47')]['hasOwnProperty'](_0x48b5('0x69'))){_0x27876c['limit']=qs[_0x48b5('0x2e')](_0x53d0f1[_0x48b5('0x47')][_0x48b5('0x2e')]);_0x27876c[_0x48b5('0x2d')]=qs[_0x48b5('0x2d')](_0x53d0f1[_0x48b5('0x47')][_0x48b5('0x2d')]);}_0x27876c['order']=qs[_0x48b5('0x4e')](_0x53d0f1[_0x48b5('0x47')]['sort']);_0x27876c[_0x48b5('0x4f')]=qs[_0x48b5('0x48')](_['pick'](_0x53d0f1[_0x48b5('0x47')],_0x1e6155[_0x48b5('0x48')]));_0x27876c[_0x48b5('0x4f')]['WhatsappAccountId']=_0x195ddd['id'];if(_0x53d0f1['query'][_0x48b5('0x50')]){_0x27876c[_0x48b5('0x4f')]=_[_0x48b5('0x51')](_0x27876c['where'],{'$or':_['map'](_0x27876c[_0x48b5('0x4a')],function(_0x1540e8){var _0x5d4f5e={};_0x5d4f5e[_0x1540e8]={'$like':'%'+_0x53d0f1[_0x48b5('0x47')][_0x48b5('0x50')]+'%'};return _0x5d4f5e;})});}_0x27876c=_[_0x48b5('0x51')]({},_0x27876c,_0x53d0f1[_0x48b5('0x53')]);return db[_0x48b5('0x6f')][_0x48b5('0x30')]({'where':_0x27876c[_0x48b5('0x4f')]})[_0x48b5('0x37')](function(_0x2b3030){_0x29860e[_0x48b5('0x30')]=_0x2b3030;if(_0x53d0f1['query']['includeAll']){_0x27876c[_0x48b5('0x56')]=[{'all':!![]}];}return db[_0x48b5('0x6f')][_0x48b5('0x70')](_0x27876c);})[_0x48b5('0x37')](function(_0x2b2858){_0x29860e[_0x48b5('0x57')]=_0x2b2858;return _0x29860e;});}})['then'](respondWithFilteredResult(_0x13d0ea,_0x27876c))[_0x48b5('0x28')](handleError(_0x13d0ea,null));};exports[_0x48b5('0x71')]=function(_0x1cb5b2,_0x48a34f,_0x34e88a){return db[_0x48b5('0x54')]['find']({'where':{'id':_0x1cb5b2['params']['id']}})['then'](handleEntityNotFound(_0x48a34f,null))['then'](function(_0x13dd35){if(_0x13dd35){return _0x13dd35[_0x48b5('0x71')](_0x1cb5b2[_0x48b5('0x47')][_0x48b5('0x72')]);}})[_0x48b5('0x37')](respondWithStatusCode(_0x48a34f,null))['catch'](handleError(_0x48a34f,null));};exports[_0x48b5('0x73')]=function(_0x2a27f0,_0x1cbbc0,_0x3f4800){return db[_0x48b5('0x54')][_0x48b5('0x5e')]({'where':{'id':_0x2a27f0[_0x48b5('0x62')]['id']}})['then'](handleEntityNotFound(_0x1cbbc0,null))[_0x48b5('0x37')](function(_0x561666){if(_0x561666){return _0x561666['addAgents'](_0x2a27f0['body'][_0x48b5('0x72')],_[_0x48b5('0x74')](_0x2a27f0[_0x48b5('0x63')],[_0x48b5('0x72'),'id'])||{})[_0x48b5('0x75')](function(_0x4d5ed6){for(var _0x1b0592=0x0;_0x1b0592<_0x2a27f0[_0x48b5('0x63')][_0x48b5('0x72')][_0x48b5('0x4c')];_0x1b0592+=0x1){socket[_0x48b5('0x76')]('userWhatsappAccount:save',{'UserId':Number(_0x2a27f0[_0x48b5('0x63')][_0x48b5('0x72')][_0x1b0592]),'WhatsappAccountId':Number(_0x2a27f0[_0x48b5('0x62')]['id'])});}return _0x4d5ed6;});}})['then'](respondWithResult(_0x1cbbc0,null))[_0x48b5('0x28')](handleError(_0x1cbbc0,null));};exports['removeAgents']=function(_0x2c7efa,_0x292e43,_0x1cd3ba){return db[_0x48b5('0x54')]['find']({'where':{'id':_0x2c7efa[_0x48b5('0x62')]['id']}})[_0x48b5('0x37')](handleEntityNotFound(_0x292e43,null))['then'](function(_0x428d7e){if(_0x428d7e){return _0x428d7e[_0x48b5('0x77')](_0x2c7efa[_0x48b5('0x47')][_0x48b5('0x72')])[_0x48b5('0x37')](function(){if(_[_0x48b5('0x78')](_0x2c7efa[_0x48b5('0x47')][_0x48b5('0x72')])){for(var _0x2414af=0x0;_0x2414af<_0x2c7efa['query'][_0x48b5('0x72')][_0x48b5('0x4c')];_0x2414af+=0x1){socket[_0x48b5('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x2c7efa['query'][_0x48b5('0x72')][_0x2414af]),'WhatsappAccountId':Number(_0x2c7efa[_0x48b5('0x62')]['id'])});}}else{socket[_0x48b5('0x76')](_0x48b5('0x79'),{'UserId':Number(_0x2c7efa[_0x48b5('0x47')][_0x48b5('0x72')]),'WhatsappAccountId':Number(_0x2c7efa[_0x48b5('0x62')]['id'])});}});}})[_0x48b5('0x37')](respondWithStatusCode(_0x292e43,null))[_0x48b5('0x28')](handleError(_0x292e43,null));};exports[_0x48b5('0x7a')]=function(_0xc3f676,_0xe0eac3,_0x7c3b75){var _0x6f0f77={};var _0x1c1415={};var _0x10bdcc;var _0x341423;return db['WhatsappAccount'][_0x48b5('0x6e')]({'where':{'id':_0xc3f676[_0x48b5('0x62')]['id']}})[_0x48b5('0x37')](handleEntityNotFound(_0xe0eac3,null))[_0x48b5('0x37')](function(_0x5f3b2d){if(_0x5f3b2d){_0x10bdcc=_0x5f3b2d;_0x1c1415[_0x48b5('0x45')]=_[_0x48b5('0x59')](db['User']['rawAttributes']);_0x1c1415['query']=_[_0x48b5('0x59')](_0xc3f676[_0x48b5('0x47')]);_0x1c1415[_0x48b5('0x48')]=_[_0x48b5('0x49')](_0x1c1415['model'],_0x1c1415[_0x48b5('0x47')]);_0x6f0f77[_0x48b5('0x4a')]=_[_0x48b5('0x49')](_0x1c1415['model'],qs['fields'](_0xc3f676[_0x48b5('0x47')]['fields']));_0x6f0f77['attributes']=_0x6f0f77['attributes']['length']?_0x6f0f77[_0x48b5('0x4a')]:_0x1c1415[_0x48b5('0x45')];_0x6f0f77[_0x48b5('0x6a')]=qs[_0x48b5('0x4e')](_0xc3f676['query']['sort']);_0x6f0f77[_0x48b5('0x4f')]=qs['filters'](_[_0x48b5('0x6b')](_0xc3f676['query'],_0x1c1415[_0x48b5('0x48')]));if(_0xc3f676[_0x48b5('0x47')][_0x48b5('0x50')]){_0x6f0f77[_0x48b5('0x4f')]=_[_0x48b5('0x51')](_0x6f0f77['where'],{'$or':_['map'](_0x6f0f77['attributes'],function(_0x373e0d){var _0x26989d={};_0x26989d[_0x373e0d]={'$like':'%'+_0xc3f676[_0x48b5('0x47')][_0x48b5('0x50')]+'%'};return _0x26989d;})});}_0x6f0f77=_[_0x48b5('0x51')]({},_0x6f0f77,_0xc3f676[_0x48b5('0x53')]);return _0x10bdcc[_0x48b5('0x7a')](_0x6f0f77);}})[_0x48b5('0x37')](function(_0x32d606){if(_0x32d606){_0x341423=_0x32d606['length'];if(!_0xc3f676['query']['hasOwnProperty'](_0x48b5('0x69'))){_0x6f0f77[_0x48b5('0x2e')]=qs[_0x48b5('0x2e')](_0xc3f676['query'][_0x48b5('0x2e')]);_0x6f0f77[_0x48b5('0x2d')]=qs[_0x48b5('0x2d')](_0xc3f676[_0x48b5('0x47')][_0x48b5('0x2d')]);}return _0x10bdcc[_0x48b5('0x7a')](_0x6f0f77);}})[_0x48b5('0x37')](function(_0x25eab4){if(_0x25eab4){return _0x25eab4?{'count':_0x341423,'rows':_0x25eab4}:null;}})[_0x48b5('0x37')](respondWithResult(_0xe0eac3,null))['catch'](handleError(_0xe0eac3,null));};exports[_0x48b5('0x7b')]=function(_0x3eba0,_0xa96f5b){var _0x24b357=_0x3eba0[_0x48b5('0x62')]['id'];var _0x303e9b=_0x3eba0[_0x48b5('0x63')];var _0x34bd7a=0xc8;var _0x35fcd2=null;return db[_0x48b5('0x7c')][_0x48b5('0x7d')]({'isolationLevel':db[_0x48b5('0x7c')][_0x48b5('0x7e')][_0x48b5('0x7f')][_0x48b5('0x80')]},function(_0x369673){return db['WhatsappAccount'][_0x48b5('0x6e')]({'where':{'id':_0x24b357},'transaction':_0x369673})[_0x48b5('0x37')](function(_0x1971be){if(_0x1971be){return db[_0x48b5('0x81')][_0x48b5('0x3b')]({'where':{'WhatsappAccountId':_0x24b357},'transaction':_0x369673})[_0x48b5('0x37')](function(){var _0x1214c0=_[_0x48b5('0x46')](_0x303e9b,function(_0x3c51ee){_0x3c51ee['WhatsappAccountId']=_0x24b357;return _0x3c51ee;});return db[_0x48b5('0x81')][_0x48b5('0x82')](_0x1214c0,{'transaction':_0x369673});});}else{_0x34bd7a=0x194;_0x35fcd2=[];}});})[_0x48b5('0x37')](function(){if(_0x34bd7a!==0x194){return db[_0x48b5('0x81')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x24b357},'order':_0x48b5('0x83')})[_0x48b5('0x37')](function(_0x2c6bcd){_0x35fcd2=_0x2c6bcd;});}})['catch'](function(_0xcc3744){_0x34bd7a=0x1f4;logger[_0x48b5('0x24')](_0xcc3744[_0x48b5('0x3c')]);if(_0xcc3744[_0x48b5('0x3d')]){delete _0xcc3744[_0x48b5('0x3d')];}_0x35fcd2=_0xcc3744;})[_0x48b5('0x84')](function(){if(_0x35fcd2===null){_0xa96f5b[_0x48b5('0x2a')](_0x34bd7a);}else{if(_0x34bd7a===0x1f4){_0xa96f5b['status'](_0x34bd7a)[_0x48b5('0x3e')](_0x35fcd2);}else{_0xa96f5b[_0x48b5('0x2c')](_0x34bd7a)['json'](_0x35fcd2);}}});};exports['getApplications']=function(_0x32008b,_0x2cb487,_0x56a172){var _0x3531c1={};var _0x52e4db={};var _0x5798e1;var _0xf9bb9b;return db[_0x48b5('0x54')][_0x48b5('0x6e')]({'where':{'id':_0x32008b[_0x48b5('0x62')]['id']}})[_0x48b5('0x37')](handleEntityNotFound(_0x2cb487,null))[_0x48b5('0x37')](function(_0x32dbaa){if(_0x32dbaa){_0x5798e1=_0x32dbaa;_0x52e4db[_0x48b5('0x45')]=_[_0x48b5('0x59')](db[_0x48b5('0x81')][_0x48b5('0x42')]);_0x52e4db['query']=_['keys'](_0x32008b[_0x48b5('0x47')]);_0x52e4db['filters']=_['intersection'](_0x52e4db[_0x48b5('0x45')],_0x52e4db[_0x48b5('0x47')]);_0x3531c1['attributes']=_['intersection'](_0x52e4db[_0x48b5('0x45')],qs['fields'](_0x32008b[_0x48b5('0x47')]['fields']));_0x3531c1[_0x48b5('0x4a')]=_0x3531c1['attributes'][_0x48b5('0x4c')]?_0x3531c1['attributes']:_0x52e4db['model'];_0x3531c1[_0x48b5('0x6a')]=qs[_0x48b5('0x4e')](_0x32008b[_0x48b5('0x47')][_0x48b5('0x4e')]);_0x3531c1[_0x48b5('0x4f')]=qs[_0x48b5('0x48')](_[_0x48b5('0x6b')](_0x32008b['query'],_0x52e4db['filters']));if(_0x32008b[_0x48b5('0x47')][_0x48b5('0x50')]){_0x3531c1[_0x48b5('0x4f')]=_[_0x48b5('0x51')](_0x3531c1[_0x48b5('0x4f')],{'$or':_[_0x48b5('0x46')](_0x3531c1[_0x48b5('0x4a')],function(_0x1bcb4f){var _0x149114={};_0x149114[_0x1bcb4f]={'$like':'%'+_0x32008b['query'][_0x48b5('0x50')]+'%'};return _0x149114;})});}_0x3531c1=_[_0x48b5('0x51')]({},_0x3531c1,_0x32008b[_0x48b5('0x53')]);return _0x5798e1['getApplications'](_0x3531c1);}})[_0x48b5('0x37')](function(_0x23b797){if(_0x23b797){_0xf9bb9b=_0x23b797[_0x48b5('0x4c')];if(!_0x32008b['query'][_0x48b5('0x4d')](_0x48b5('0x69'))){_0x3531c1[_0x48b5('0x2e')]=qs['limit'](_0x32008b['query']['limit']);_0x3531c1[_0x48b5('0x2d')]=qs[_0x48b5('0x2d')](_0x32008b[_0x48b5('0x47')][_0x48b5('0x2d')]);}return _0x5798e1[_0x48b5('0x85')](_0x3531c1);}})[_0x48b5('0x37')](function(_0x9cd698){if(_0x9cd698){return _0x9cd698?{'count':_0xf9bb9b,'rows':_0x9cd698}:null;}})[_0x48b5('0x37')](respondWithResult(_0x2cb487,null))[_0x48b5('0x28')](handleError(_0x2cb487,null));};exports[_0x48b5('0x86')]=function(_0x2a8145,_0x48582f,_0x87c6c1){var _0x28a81a={'channel':_0x48b5('0x87')};var _0x542b12=[];var _0x1f36f3=[];var _0x419740={};return db[_0x48b5('0x54')][_0x48b5('0x5e')]({'where':{'id':_0x2a8145['params']['id']},'include':[{'model':db[_0x48b5('0x81')],'as':_0x48b5('0x88')}]})['then'](handleEntityNotFound(_0x48582f,null))[_0x48b5('0x37')](function(_0x477865){_0x28a81a['account']=_0x477865;if(_0x28a81a[_0x48b5('0x89')]&&_0x28a81a[_0x48b5('0x89')][_0x48b5('0x43')]===_0x48b5('0x8a')&&_0x2a8145[_0x48b5('0x63')][_0x48b5('0x8b')]){if(_0x2a8145[_0x48b5('0x63')][_0x48b5('0x8b')][_0x48b5('0x4c')]===0x0)return;if(_0x2a8145['body'][_0x48b5('0x8b')][0x0][_0x48b5('0x8c')]!=='read')return;return db[_0x48b5('0x8d')][_0x48b5('0x36')]({'read':!![],'readAt':_0x2a8145[_0x48b5('0x63')][_0x48b5('0x8b')][0x0][_0x48b5('0x8e')]},{'where':{'messageId':_0x2a8145[_0x48b5('0x63')][_0x48b5('0x8b')][0x0][_0x48b5('0x8f')]},'individualHooks':!![]})['then'](function(_0x617fb8){return _0x48582f[_0x48b5('0x2c')](0xc8)[_0x48b5('0x32')](_0x617fb8);});}_0x28a81a[_0x48b5('0x90')]=_[_0x48b5('0x91')](_0x477865[_0x48b5('0x88')],[_0x48b5('0x83')],[_0x48b5('0x92')]);if(_0x28a81a[_0x48b5('0x89')]['Applications']){delete _0x28a81a[_0x48b5('0x89')][_0x48b5('0x88')];}return db[_0x48b5('0x93')][_0x48b5('0x64')]()[_0x48b5('0x37')](function(_0x4b255a){if(!_0x4b255a){throw new db[(_0x48b5('0x94'))]['ValidationError'](_0x48b5('0x95'));}_0x542b12=_[_0x48b5('0x96')](_[_0x48b5('0x59')](_0x4b255a),[_0x48b5('0x97'),'updatedAt']);_0x1f36f3=_[_0x48b5('0x96')](_[_0x48b5('0x59')](_0x4b255a),['createdAt',_0x48b5('0x98'),_0x48b5('0x99'),_0x48b5('0x9a')]);_0x28a81a[_0x48b5('0x63')]={'mapKey':_0x48b5('0x9b')};if(_0x28a81a[_0x48b5('0x89')]&&_0x28a81a[_0x48b5('0x89')][_0x48b5('0x43')]===_0x48b5('0x9c')){_0x28a81a['body']['from']=_0x2a8145[_0x48b5('0x63')][_0x48b5('0x9d')][_0x48b5('0x9e')](_0x48b5('0x9f'),'');_0x28a81a[_0x48b5('0x63')][_0x48b5('0x63')]=_0x2a8145[_0x48b5('0x63')][_0x48b5('0xa0')];_0x28a81a[_0x48b5('0x63')][_0x48b5('0xa1')]=_0x2a8145[_0x48b5('0x63')][_0x48b5('0xa2')];}if(_0x28a81a[_0x48b5('0x89')]&&_0x28a81a[_0x48b5('0x89')][_0x48b5('0x43')]===_0x48b5('0x8a')){_0x28a81a[_0x48b5('0x63')][_0x48b5('0xa3')]=_0x2a8145['body'][_0x48b5('0xa4')][0x0][_0x48b5('0xa3')];_0x28a81a[_0x48b5('0x63')][_0x48b5('0x63')]=_0x2a8145[_0x48b5('0x63')]['notifications'][0x0][_0x48b5('0x26')][_0x48b5('0x63')];_0x28a81a[_0x48b5('0x63')][_0x48b5('0xa1')]=_0x2a8145[_0x48b5('0x63')][_0x48b5('0xa4')][0x0][_0x48b5('0x8f')];}if(_0x28a81a[_0x48b5('0x63')]['id']){delete _0x28a81a['body']['id'];}if(_['isNil'](_0x28a81a[_0x48b5('0x63')][_0x48b5('0xa3')])){throw new db[(_0x48b5('0x94'))][(_0x48b5('0xa5'))](_0x48b5('0xa6'));}if(_[_0x48b5('0xa7')](_0x28a81a[_0x48b5('0x63')][_0x48b5('0x63')])||_0x28a81a[_0x48b5('0x63')]['body']===''){throw new db[(_0x48b5('0x94'))][(_0x48b5('0xa5'))](_0x48b5('0xa8'));}if(_[_0x48b5('0xa7')](_0x28a81a[_0x48b5('0x63')]['mapKey'])){throw new db[(_0x48b5('0x94'))][(_0x48b5('0xa5'))](_0x48b5('0xa9')+_0x1f36f3);}if(!_['includes'](_0x1f36f3,_0x28a81a[_0x48b5('0x63')]['mapKey'])){throw new db[(_0x48b5('0x94'))][(_0x48b5('0xa5'))](_0x48b5('0xaa')+_0x1f36f3);}_0x419740[_0x28a81a['body'][_0x48b5('0xab')]]=_0x28a81a[_0x48b5('0x63')]['from'];return db[_0x48b5('0xac')][_0x48b5('0x5e')]({'where':{'id':_0x28a81a['account'][_0x48b5('0x9a')]},'include':[{'model':db['CmContact'],'as':_0x48b5('0xad'),'where':_0x419740,'limit':0x1,'order':[[_0x48b5('0x98'),_0x48b5('0xae')]]}]});})['then'](handleEntityNotFound(_0x48582f,null))[_0x48b5('0x37')](function(_0x1d458d){if(_0x1d458d){_0x28a81a['list']=_['omit'](_0x1d458d,[_0x48b5('0xad')]);if(_0x1d458d[_0x48b5('0xad')]['length']){return _0x1d458d[_0x48b5('0xad')][0x0];}var _0x524be4=_[_0x48b5('0x18')](_0x28a81a[_0x48b5('0x63')],{'firstName':_0x28a81a[_0x48b5('0x63')][_0x48b5('0xa3')],'ListId':_0x1d458d['id']});_0x524be4[_0x28a81a[_0x48b5('0x63')][_0x48b5('0xab')]]=_0x28a81a['body'][_0x48b5('0xa3')];return db['CmContact'][_0x48b5('0x5a')](_0x524be4,{'fields':_0x542b12,'raw':!![]});}})[_0x48b5('0x37')](handleEntityNotFound(_0x48582f,null))[_0x48b5('0x37')](function(_0x2355d7){if(_0x2355d7){_0x28a81a['contact']=_0x2355d7;var _0xa8d8b5={'ContactId':_0x2355d7['id'],'phone':_0x28a81a[_0x48b5('0x63')][_0x48b5('0xa3')],'WhatsappAccountId':_0x2a8145[_0x48b5('0x62')]['id']};var _0x127113={'ContactId':_0x2355d7['id'],'WhatsappAccountId':_0x2a8145[_0x48b5('0x62')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x48b5('0x5e')]({'where':_0x127113})['then'](function(_0x1a807c){if(_0x1a807c){return[_0x1a807c,![]];}return db[_0x48b5('0xaf')][_0x48b5('0x5a')](_0xa8d8b5)[_0x48b5('0x37')](function(_0x2458a0){return[_0x2458a0,!![]];});});}})[_0x48b5('0x75')](function(_0x339221,_0x1b7b40){_0x28a81a[_0x48b5('0xb0')]=_0x339221[_0x48b5('0x38')]({'plain':!![]});_0x28a81a[_0x48b5('0xb0')]['created']=![];if(_0x1b7b40){if(_0x28a81a[_0x48b5('0x89')][_0x48b5('0xb1')]){_0x28a81a[_0x48b5('0x90')][_0x48b5('0xb2')]({'id':0x0,'priority':_0x28a81a['applications'][_0x48b5('0x4c')]+0x1,'app':_0x48b5('0xb3'),'appdata':'unmanaged','interval':_0x48b5('0xb4')});}_0x28a81a[_0x48b5('0xb0')][_0x48b5('0xb5')]=!![];}return db[_0x48b5('0x8d')][_0x48b5('0x5a')]({'phone':_0x28a81a['body'][_0x48b5('0xa3')],'messageId':_0x28a81a[_0x48b5('0x63')][_0x48b5('0xa1')],'body':_0x28a81a[_0x48b5('0x63')][_0x48b5('0x63')],'WhatsappAccountId':_0x2a8145['params']['id'],'WhatsappInteractionId':_0x339221['id'],'direction':'in','ContactId':_0x339221['ContactId'],'AttachmentId':_0x28a81a[_0x48b5('0x63')][_0x48b5('0xb6')]});})[_0x48b5('0x37')](function(_0x5f4df9){_0x28a81a[_0x48b5('0x26')]=_0x5f4df9;if(!_0x28a81a[_0x48b5('0xb0')][_0x48b5('0xb7')])return;return db[_0x48b5('0xb8')]['find']({'attributes':['id',_0x48b5('0x3d')],'where':{'id':_0x28a81a[_0x48b5('0xb0')][_0x48b5('0xb7')]}});})[_0x48b5('0x37')](function(_0x257854){if(_0x257854){_0x28a81a[_0x48b5('0x90')][_0x48b5('0xb9')]({'id':0x0,'priority':0x0,'app':_0x48b5('0xba'),'appdata':_0x257854[_0x48b5('0x3d')]+','+(_0x28a81a[_0x48b5('0x89')][_0x48b5('0xbb')]||0xa),'interval':_0x48b5('0xb4')});}if(!_0x28a81a[_0x48b5('0xb0')][_0x48b5('0xbc')])return;return db[_0x48b5('0xbd')]['find']({'attributes':['id',_0x48b5('0x3d')],'where':{'id':_0x28a81a[_0x48b5('0xb0')][_0x48b5('0xbc')]}});})[_0x48b5('0x37')](function(_0x36a851){if(_0x36a851){_0x28a81a[_0x48b5('0x90')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x36a851['name']+','+(_0x28a81a[_0x48b5('0x89')]['waitForTheAssignedQueue']||0x12c),'interval':_0x48b5('0xb4')});}return respondWithRpcPromise(_0x48b5('0xbe'),_0x48b5('0xbf'),_0x28a81a);})['then'](function(_0x131fb6){if(_0x131fb6){var _0x197183=0xc8;var _0x51fa42=_0x48b5('0xc0');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x51fa42,_0x197183,_0x48b5('0xc1'));logger['debug'](_0x48b5('0xc2'),_0x51fa42,_0x197183,_0x48b5('0xc1'),JSON[_0x48b5('0xc3')](_0x131fb6));if(_0x28a81a[_0x48b5('0x89')][_0x48b5('0x43')]===_0x48b5('0x9c')){return _0x48582f['status'](_0x197183)[_0x48b5('0xc4')](_0x48b5('0xc5'),_0x48b5('0xc6'))[_0x48b5('0x3e')]('\x0a');}else{return _0x48582f['status'](_0x197183)['json'](_0x131fb6);}}});})[_0x48b5('0x28')](handleError(_0x48582f,null));};exports[_0x48b5('0x3e')]=function(_0x1e0069,_0x5d5e21,_0x2150b9){var _0x4a54cc,_0x3b311b,_0x5bfb89;if(_[_0x48b5('0xa7')](_0x1e0069[_0x48b5('0x63')][_0x48b5('0x63')])||_0x1e0069[_0x48b5('0x63')][_0x48b5('0x63')]===''){throw new db[(_0x48b5('0x94'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x48b5('0xa7')](_0x1e0069[_0x48b5('0x63')]['to'])){throw new db[(_0x48b5('0x94'))][(_0x48b5('0xa5'))](_0x48b5('0xc7'));}_0x4a54cc=_0x1e0069[_0x48b5('0x63')]['to'];return db['WhatsappAccount'][_0x48b5('0x5e')]({'where':{'id':_0x1e0069[_0x48b5('0x62')]['id']},'include':[{'model':db[_0x48b5('0xac')],'as':_0x48b5('0xc8'),'include':[{'model':db['CmContact'],'as':_0x48b5('0xad'),'where':{'mobile':_0x4a54cc},'limit':0x1,'order':[[_0x48b5('0x98'),'DESC']]}]}]})[_0x48b5('0x37')](handleEntityNotFound(_0x5d5e21,null))[_0x48b5('0x37')](function(_0x34f477){if(_0x34f477&&_0x34f477[_0x48b5('0xc8')]){_0x3b311b=_0x34f477['get']({'plain':!![]});if(_0x3b311b['List']&&_0x3b311b[_0x48b5('0xc8')][_0x48b5('0xad')][_0x48b5('0x4c')]){return _0x3b311b[_0x48b5('0xc8')][_0x48b5('0xad')][0x0];}return db['CmContact']['create'](_[_0x48b5('0x18')](_0x1e0069[_0x48b5('0x63')],{'firstName':_0x4a54cc,'mobile':_0x4a54cc,'phone':_0x4a54cc,'ListId':_0x3b311b[_0x48b5('0x9a')]}));}})[_0x48b5('0x37')](handleEntityNotFound(_0x5d5e21,null))[_0x48b5('0x37')](function(_0x386c9b){if(_0x386c9b){_0x5bfb89=_0x386c9b;return db[_0x48b5('0xaf')][_0x48b5('0x5e')]({'where':{'ContactId':_0x5bfb89['id'],'closed':![],'WhatsappAccountId':_0x3b311b['id']}})[_0x48b5('0x37')](function(_0x54fef1){if(_0x54fef1){return[_0x54fef1,![]];}return db['WhatsappInteraction'][_0x48b5('0x5a')]({'UserId':_0x1e0069[_0x48b5('0x5b')]['id'],'ContactId':_0x5bfb89['id'],'WhatsappAccountId':_0x3b311b['id'],'phone':_0x4a54cc,'firstMsgDirection':_0x48b5('0xc9'),'Messages':[_[_0x48b5('0x51')](_0x1e0069[_0x48b5('0x63')],{'read':![],'body':_0x1e0069[_0x48b5('0x63')][_0x48b5('0x63')],'phone':_0x4a54cc,'WhatsappAccountId':_0x3b311b['id'],'UserId':_0x1e0069[_0x48b5('0x5b')]['id'],'ContactId':_0x5bfb89['id']})]},{'include':[{'model':db[_0x48b5('0x8d')],'as':_0x48b5('0xca')}]})[_0x48b5('0x37')](function(_0x2ea4ef){return[_0x2ea4ef,!![]];});});}})[_0x48b5('0x75')](function(_0x448783,_0x4ad855){if(_0x4ad855){return _0x448783;}return db[_0x48b5('0x8d')]['create'](_[_0x48b5('0x51')](_0x1e0069[_0x48b5('0x63')],{'read':![],'body':_0x1e0069['body'][_0x48b5('0x63')],'phone':_0x4a54cc,'WhatsappAccountId':_0x3b311b['id'],'WhatsappInteractionId':_0x448783['id'],'UserId':_0x1e0069[_0x48b5('0x5b')]['id'],'ContactId':_0x5bfb89['id']}))[_0x48b5('0x37')](function(_0x6b8241){_0x448783[_0x48b5('0xcb')]['Messages']=[];_0x448783[_0x48b5('0xcb')][_0x48b5('0xca')]['push'](_0x6b8241[_0x48b5('0xcb')]);return _0x448783;});})[_0x48b5('0x37')](respondWithResult(_0x5d5e21,null))['catch'](handleError(_0x5d5e21,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 65ffbd4..cfb915c 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 _0x98d6=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x41e7d0,_0x5b933e){var _0x309df5=function(_0x37fb5d){while(--_0x37fb5d){_0x41e7d0['push'](_0x41e7d0['shift']());}};_0x309df5(++_0x5b933e);}(_0x98d6,0xf2));var _0x698d=function(_0x6ac0e6,_0x3ea3f4){_0x6ac0e6=_0x6ac0e6-0x0;var _0x3c39a1=_0x98d6[_0x6ac0e6];return _0x3c39a1;};'use strict';var EventEmitter=require(_0x698d('0x0'));var WhatsappAccount=require(_0x698d('0x1'))['db'][_0x698d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x698d('0x3')};function emitEvent(_0x420170){return function(_0x4943c9,_0x1b85eb,_0x4cbca0){WhatsappAccountEvents[_0x698d('0x4')](_0x420170+':'+_0x4943c9['id'],_0x4943c9);WhatsappAccountEvents[_0x698d('0x4')](_0x420170,_0x4943c9);_0x4cbca0(null);};}for(var e in events){if(events[_0x698d('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x698d('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x3677=['emit','hasOwnProperty','save'];(function(_0x20fce2,_0x2bd715){var _0x525e30=function(_0x2f2812){while(--_0x2f2812){_0x20fce2['push'](_0x20fce2['shift']());}};_0x525e30(++_0x2bd715);}(_0x3677,0x170));var _0x7367=function(_0x51d234,_0x59b32f){_0x51d234=_0x51d234-0x0;var _0x4c9770=_0x3677[_0x51d234];return _0x4c9770;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7367('0x0'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x55785d){return function(_0x1f014c,_0x414e15,_0xbbce34){WhatsappAccountEvents['emit'](_0x55785d+':'+_0x1f014c['id'],_0x1f014c);WhatsappAccountEvents[_0x7367('0x1')](_0x55785d,_0x1f014c);_0xbbce34(null);};}for(var e in events){if(events[_0x7367('0x2')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index a28a55d..54e419f 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 _0x4db2=['util','api','moment','bluebird','request-promise','../../config/environment','exports','define','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4db2,0x1b8));var _0x24db=function(_0x32f26d,_0x2c0b5d){_0x32f26d=_0x32f26d-0x0;var _0x5d9ddc=_0x4db2[_0x32f26d];return _0x5d9ddc;};'use strict';var _=require(_0x24db('0x0'));var util=require(_0x24db('0x1'));var logger=require('../../config/logger')(_0x24db('0x2'));var moment=require(_0x24db('0x3'));var BPromise=require(_0x24db('0x4'));var rp=require(_0x24db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x24db('0x6'));var attributes=require('./whatsappAccount.attributes');module[_0x24db('0x7')]=function(_0x50bc8a,_0x265a00){return _0x50bc8a[_0x24db('0x8')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52e7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api'];(function(_0xdcca54,_0x4b2b61){var _0x453197=function(_0x806f6a){while(--_0x806f6a){_0xdcca54['push'](_0xdcca54['shift']());}};_0x453197(++_0x4b2b61);}(_0x52e7,0x99));var _0x752e=function(_0x39b68b,_0x4ad96d){_0x39b68b=_0x39b68b-0x0;var _0xae091f=_0x52e7[_0x39b68b];return _0xae091f;};'use strict';var _=require(_0x752e('0x0'));var util=require('util');var logger=require(_0x752e('0x1'))(_0x752e('0x2'));var moment=require(_0x752e('0x3'));var BPromise=require(_0x752e('0x4'));var rp=require(_0x752e('0x5'));var fs=require('fs');var path=require(_0x752e('0x6'));var rimraf=require(_0x752e('0x7'));var config=require(_0x752e('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0x752e('0x9')]=function(_0x174cbd,_0x444d8d){return _0x174cbd[_0x752e('0xa')](_0x752e('0xb'),attributes,{'tableName':_0x752e('0xc'),'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 e6136a6..0e3b8de 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 _0xa1e4=['include','map','model','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','ShowWhatsappAccount','WhatsappAccount','where','options','attributes'];(function(_0x19b744,_0x4e7f0f){var _0x54fcf1=function(_0xb2c3ee){while(--_0xb2c3ee){_0x19b744['push'](_0x19b744['shift']());}};_0x54fcf1(++_0x4e7f0f);}(_0xa1e4,0xcf));var _0x4a1e=function(_0x418f0b,_0xe47fcf){_0x418f0b=_0x418f0b-0x0;var _0x4c0491=_0xa1e4[_0x418f0b];return _0x4c0491;};'use strict';var _=require(_0x4a1e('0x0'));var util=require(_0x4a1e('0x1'));var moment=require(_0x4a1e('0x2'));var BPromise=require(_0x4a1e('0x3'));var rs=require(_0x4a1e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4a1e('0x5'));var logger=require(_0x4a1e('0x6'))('rpc');var config=require(_0x4a1e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4a1e('0x8')]({'port':0x232a});config[_0x4a1e('0x9')]=_[_0x4a1e('0xa')](config[_0x4a1e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a1e('0xb'))(new Redis(config['redis']));require(_0x4a1e('0xc'))[_0x4a1e('0xd')](socket);function respondWithRpcPromise(_0x3539ed,_0xd54415,_0x9b061d){return new BPromise(function(_0x11071b,_0x114861){return client[_0x4a1e('0xe')](_0x3539ed,_0x9b061d)[_0x4a1e('0xf')](function(_0x5ca05e){logger[_0x4a1e('0x10')](_0x4a1e('0x11'),_0xd54415,'request\x20sent');logger[_0x4a1e('0x12')](_0x4a1e('0x13'),_0xd54415,'request\x20sent',JSON[_0x4a1e('0x14')](_0x5ca05e));if(_0x5ca05e['error']){if(_0x5ca05e[_0x4a1e('0x15')][_0x4a1e('0x16')]===0x1f4){logger[_0x4a1e('0x15')](_0x4a1e('0x11'),_0xd54415,_0x5ca05e[_0x4a1e('0x15')][_0x4a1e('0x17')]);return _0x114861(_0x5ca05e[_0x4a1e('0x15')][_0x4a1e('0x17')]);}logger[_0x4a1e('0x15')](_0x4a1e('0x11'),_0xd54415,_0x5ca05e[_0x4a1e('0x15')]['message']);return _0x11071b(_0x5ca05e['error']['message']);}else{logger['info'](_0x4a1e('0x11'),_0xd54415,_0x4a1e('0x18'));_0x11071b(_0x5ca05e['result'][_0x4a1e('0x17')]);}})[_0x4a1e('0x19')](function(_0x591b2b){logger[_0x4a1e('0x15')](_0x4a1e('0x11'),_0xd54415,_0x591b2b);_0x114861(_0x591b2b);});});}exports[_0x4a1e('0x1a')]=function(_0x2e518b){var _0x267a80=this;return new Promise(function(_0x309011,_0x31b351){return db[_0x4a1e('0x1b')]['find']({'raw':_0x2e518b['options']?_0x2e518b['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e518b['options']?_0x2e518b['options'][_0x4a1e('0x1c')]||null:null,'attributes':_0x2e518b[_0x4a1e('0x1d')]?_0x2e518b[_0x4a1e('0x1d')][_0x4a1e('0x1e')]||null:null,'include':_0x2e518b[_0x4a1e('0x1d')]?_0x2e518b[_0x4a1e('0x1d')][_0x4a1e('0x1f')]?_[_0x4a1e('0x20')](_0x2e518b[_0x4a1e('0x1d')][_0x4a1e('0x1f')],function(_0x327114){return{'model':db[_0x327114['model']],'as':_0x327114['as'],'attributes':_0x327114[_0x4a1e('0x1e')],'include':_0x327114[_0x4a1e('0x1f')]?_['map'](_0x327114['include'],function(_0x1dc3f6){return{'model':db[_0x1dc3f6[_0x4a1e('0x21')]],'as':_0x1dc3f6['as'],'attributes':_0x1dc3f6[_0x4a1e('0x1e')],'include':_0x1dc3f6[_0x4a1e('0x1f')]?_[_0x4a1e('0x20')](_0x1dc3f6['include'],function(_0x8f4c73){return{'model':db[_0x8f4c73[_0x4a1e('0x21')]],'as':_0x8f4c73['as'],'attributes':_0x8f4c73[_0x4a1e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a1e('0xf')](function(_0x2f680f){logger[_0x4a1e('0x10')](_0x4a1e('0x1a'),_0x2e518b);logger['debug'](_0x4a1e('0x1a'),_0x2e518b,JSON[_0x4a1e('0x14')](_0x2f680f));_0x309011(_0x2f680f);})[_0x4a1e('0x19')](function(_0x84c84e){logger[_0x4a1e('0x15')](_0x4a1e('0x1a'),_0x84c84e[_0x4a1e('0x17')],_0x2e518b);_0x31b351(_0x267a80[_0x4a1e('0x15')](0x1f4,_0x84c84e[_0x4a1e('0x17')]));});});}; \ No newline at end of file +var _0x6f08=['redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x6f08,0x197));var _0x86f0=function(_0x250c85,_0x37320e){_0x250c85=_0x250c85-0x0;var _0x10df12=_0x6f08[_0x250c85];return _0x10df12;};'use strict';var _=require(_0x86f0('0x0'));var util=require(_0x86f0('0x1'));var moment=require(_0x86f0('0x2'));var BPromise=require(_0x86f0('0x3'));var rs=require(_0x86f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86f0('0x5'))['db'];var utils=require(_0x86f0('0x6'));var logger=require(_0x86f0('0x7'))(_0x86f0('0x8'));var config=require(_0x86f0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x86f0('0xa')]({'port':0x232a});config[_0x86f0('0xb')]=_[_0x86f0('0xc')](config[_0x86f0('0xb')],{'host':_0x86f0('0xd'),'port':0x18eb});var socket=require(_0x86f0('0xe'))(new Redis(config[_0x86f0('0xb')]));require(_0x86f0('0xf'))['register'](socket);function respondWithRpcPromise(_0x337757,_0x234d8c,_0x2180f5){return new BPromise(function(_0x19e75e,_0x559423){return client[_0x86f0('0x10')](_0x337757,_0x2180f5)[_0x86f0('0x11')](function(_0x4605ff){logger[_0x86f0('0x12')](_0x86f0('0x13'),_0x234d8c,_0x86f0('0x14'));logger[_0x86f0('0x15')](_0x86f0('0x16'),_0x234d8c,_0x86f0('0x14'),JSON[_0x86f0('0x17')](_0x4605ff));if(_0x4605ff[_0x86f0('0x18')]){if(_0x4605ff[_0x86f0('0x18')][_0x86f0('0x19')]===0x1f4){logger[_0x86f0('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x234d8c,_0x4605ff[_0x86f0('0x18')][_0x86f0('0x1a')]);return _0x559423(_0x4605ff[_0x86f0('0x18')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x234d8c,_0x4605ff[_0x86f0('0x18')][_0x86f0('0x1a')]);return _0x19e75e(_0x4605ff['error'][_0x86f0('0x1a')]);}else{logger[_0x86f0('0x12')](_0x86f0('0x13'),_0x234d8c,_0x86f0('0x14'));_0x19e75e(_0x4605ff[_0x86f0('0x1b')]['message']);}})[_0x86f0('0x1c')](function(_0x37f2c2){logger[_0x86f0('0x18')](_0x86f0('0x13'),_0x234d8c,_0x37f2c2);_0x559423(_0x37f2c2);});});}exports[_0x86f0('0x1d')]=function(_0x1036ad){var _0x3a08a2=this;return new Promise(function(_0x1dfd75,_0x361674){return db[_0x86f0('0x1e')][_0x86f0('0x1f')]({'raw':_0x1036ad['options']?_0x1036ad['options']['raw']===undefined?!![]:![]:!![],'where':_0x1036ad['options']?_0x1036ad[_0x86f0('0x20')][_0x86f0('0x21')]||null:null,'attributes':_0x1036ad[_0x86f0('0x20')]?_0x1036ad[_0x86f0('0x20')][_0x86f0('0x22')]||null:null,'include':_0x1036ad[_0x86f0('0x20')]?_0x1036ad[_0x86f0('0x20')][_0x86f0('0x23')]?_[_0x86f0('0x24')](_0x1036ad[_0x86f0('0x20')][_0x86f0('0x23')],function(_0x234d6b){return{'model':db[_0x234d6b[_0x86f0('0x25')]],'as':_0x234d6b['as'],'attributes':_0x234d6b[_0x86f0('0x22')],'include':_0x234d6b['include']?_[_0x86f0('0x24')](_0x234d6b['include'],function(_0x53882a){return{'model':db[_0x53882a['model']],'as':_0x53882a['as'],'attributes':_0x53882a[_0x86f0('0x22')],'include':_0x53882a['include']?_[_0x86f0('0x24')](_0x53882a[_0x86f0('0x23')],function(_0x5520a4){return{'model':db[_0x5520a4[_0x86f0('0x25')]],'as':_0x5520a4['as'],'attributes':_0x5520a4['attributes']};}):[]};}):[]};}):[]:[]})[_0x86f0('0x11')](function(_0xd26843){logger[_0x86f0('0x12')]('ShowWhatsappAccount',_0x1036ad);logger[_0x86f0('0x15')](_0x86f0('0x1d'),_0x1036ad,JSON[_0x86f0('0x17')](_0xd26843));_0x1dfd75(_0xd26843);})[_0x86f0('0x1c')](function(_0x30a11b){logger[_0x86f0('0x18')](_0x86f0('0x1d'),_0x30a11b[_0x86f0('0x1a')],_0x1036ad);_0x361674(_0x3a08a2['error'](0x1f4,_0x30a11b['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 3554523..1d8b4a2 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 _0xcd6a=['register','length','whatsappAccount:','save','remove','update'];(function(_0xb6b285,_0x596e01){var _0x11393c=function(_0x506469){while(--_0x506469){_0xb6b285['push'](_0xb6b285['shift']());}};_0x11393c(++_0x596e01);}(_0xcd6a,0x1b3));var _0xacd6=function(_0x91af23,_0x363f57){_0x91af23=_0x91af23-0x0;var _0x9ced06=_0xcd6a[_0x91af23];return _0x9ced06;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xacd6('0x0'),_0xacd6('0x1'),_0xacd6('0x2')];function createListener(_0x343cd8,_0x377b14){return function(_0x1f6f96){_0x377b14['emit'](_0x343cd8,_0x1f6f96);};}function removeListener(_0x5225fc,_0x776b4){return function(){WhatsappAccountEvents['removeListener'](_0x5225fc,_0x776b4);};}exports[_0xacd6('0x3')]=function(_0x3c4c1e){for(var _0x2d22e6=0x0,_0xbbf453=events[_0xacd6('0x4')];_0x2d22e6<_0xbbf453;_0x2d22e6++){var _0xc170a6=events[_0x2d22e6];var _0x4e3baf=createListener(_0xacd6('0x5')+_0xc170a6,_0x3c4c1e);WhatsappAccountEvents['on'](_0xc170a6,_0x4e3baf);}}; \ No newline at end of file +var _0x0347=['length','whatsappAccount:','save','remove','update','removeListener'];(function(_0x1eaf9,_0x53fb28){var _0x395ef9=function(_0x49f2a5){while(--_0x49f2a5){_0x1eaf9['push'](_0x1eaf9['shift']());}};_0x395ef9(++_0x53fb28);}(_0x0347,0x17c));var _0x7034=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0347[_0x2b4411];return _0x8e41ef;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x7034('0x0'),_0x7034('0x1'),_0x7034('0x2')];function createListener(_0x1b85f9,_0x2c335a){return function(_0x1104ee){_0x2c335a['emit'](_0x1b85f9,_0x1104ee);};}function removeListener(_0x139c6f,_0x3cfd3b){return function(){WhatsappAccountEvents[_0x7034('0x3')](_0x139c6f,_0x3cfd3b);};}exports['register']=function(_0x2eb832){for(var _0x2200ff=0x0,_0x7063dd=events[_0x7034('0x4')];_0x2200ff<_0x7063dd;_0x2200ff++){var _0x5aee66=events[_0x2200ff];var _0x5e1469=createListener(_0x7034('0x5')+_0x5aee66,_0x2eb832);WhatsappAccountEvents['on'](_0x5aee66,_0x5e1469);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index e88eec8..175001b 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 _0xb56a=['express','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path'];(function(_0x2c1841,_0x505204){var _0x28d148=function(_0x5be79f){while(--_0x5be79f){_0x2c1841['push'](_0x2c1841['shift']());}};_0x28d148(++_0x505204);}(_0xb56a,0xfc));var _0xab56=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xb56a[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xab56('0x0'));var util=require(_0xab56('0x1'));var path=require(_0xab56('0x2'));var timeout=require('connect-timeout');var express=require(_0xab56('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab56('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xab56('0x5'));var controller=require(_0xab56('0x6'));router[_0xab56('0x7')]('/',auth[_0xab56('0x8')](),controller[_0xab56('0x9')]);router[_0xab56('0x7')](_0xab56('0xa'),auth[_0xab56('0x8')](),controller[_0xab56('0xb')]);router[_0xab56('0xc')]('/',auth[_0xab56('0x8')](),controller['create']);router[_0xab56('0xd')](_0xab56('0xa'),auth[_0xab56('0x8')](),controller[_0xab56('0xe')]);router[_0xab56('0xf')](_0xab56('0xa'),auth[_0xab56('0x8')](),controller['destroy']);module[_0xab56('0x10')]=router; \ No newline at end of file +var _0xf84b=['./whatsappApplication.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1dd3ed,_0x108587){var _0x2f61f1=function(_0x4af2db){while(--_0x4af2db){_0x1dd3ed['push'](_0x1dd3ed['shift']());}};_0x2f61f1(++_0x108587);}(_0xf84b,0x172));var _0xbf84=function(_0x2ca779,_0x472379){_0x2ca779=_0x2ca779-0x0;var _0x5b25eb=_0xf84b[_0x2ca779];return _0x5b25eb;};'use strict';var multer=require(_0xbf84('0x0'));var util=require(_0xbf84('0x1'));var path=require('path');var timeout=require(_0xbf84('0x2'));var express=require(_0xbf84('0x3'));var router=express[_0xbf84('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf84('0x5'));var interaction=require(_0xbf84('0x6'));var config=require(_0xbf84('0x7'));var controller=require(_0xbf84('0x8'));router[_0xbf84('0x9')]('/',auth[_0xbf84('0xa')](),controller['index']);router['get'](_0xbf84('0xb'),auth[_0xbf84('0xa')](),controller[_0xbf84('0xc')]);router[_0xbf84('0xd')]('/',auth[_0xbf84('0xa')](),controller['create']);router[_0xbf84('0xe')](_0xbf84('0xb'),auth[_0xbf84('0xa')](),controller[_0xbf84('0xf')]);router['delete']('/:id',auth[_0xbf84('0xa')](),controller[_0xbf84('0x10')]);module[_0xbf84('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index b140847..52733bf 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 _0x7dea=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x17a871,_0x4a74dc){var _0x4b75fa=function(_0x330eef){while(--_0x330eef){_0x17a871['push'](_0x17a871['shift']());}};_0x4b75fa(++_0x4a74dc);}(_0x7dea,0x16b));var _0xa7de=function(_0x5cd577,_0x52484f){_0x5cd577=_0x5cd577-0x0;var _0x4803cb=_0x7dea[_0x5cd577];return _0x4803cb;};'use strict';var Sequelize=require(_0xa7de('0x0'));module[_0xa7de('0x1')]={'priority':{'type':Sequelize[_0xa7de('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa7de('0x3')],'allowNull':![],'defaultValue':_0xa7de('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0e31=['exports','STRING','*,*,*,*','sequelize'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x0e31,0x93));var _0x10e3=function(_0x407d0f,_0x5cafa2){_0x407d0f=_0x407d0f-0x0;var _0xdeeb73=_0x0e31[_0x407d0f];return _0xdeeb73;};'use strict';var Sequelize=require(_0x10e3('0x0'));module[_0x10e3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x10e3('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x10e3('0x2')]},'interval':{'type':Sequelize[_0x10e3('0x2')],'defaultValue':_0x10e3('0x3')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 844fc3c..b9d9b0c 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 _0xb7de=['end','undefined','limit','count','offset','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1a137b,_0x39260d){var _0x2a433e=function(_0x25db91){while(--_0x25db91){_0x1a137b['push'](_0x1a137b['shift']());}};_0x2a433e(++_0x39260d);}(_0xb7de,0xc7));var _0xeb7d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xb7de[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xeb7d('0x0'));var rimraf=require(_0xeb7d('0x1'));var zipdir=require(_0xeb7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeb7d('0x3'));var moment=require(_0xeb7d('0x4'));var BPromise=require(_0xeb7d('0x5'));var Mustache=require(_0xeb7d('0x6'));var util=require(_0xeb7d('0x7'));var path=require('path');var sox=require(_0xeb7d('0x8'));var csv=require(_0xeb7d('0x9'));var ejs=require(_0xeb7d('0xa'));var fs=require('fs');var fs_extra=require(_0xeb7d('0xb'));var _=require(_0xeb7d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xeb7d('0xd'));var deskjs=require(_0xeb7d('0xe'));var toCsv=require(_0xeb7d('0x9'));var querystring=require(_0xeb7d('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb7d('0x10'));var authService=require(_0xeb7d('0x11'));var qs=require(_0xeb7d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb7d('0x13'))('api');var utils=require(_0xeb7d('0x14'));var config=require(_0xeb7d('0x15'));var licenseUtil=require(_0xeb7d('0x16'));var db=require(_0xeb7d('0x17'))['db'];function respondWithStatusCode(_0x4583fa,_0x57eb05){_0x57eb05=_0x57eb05||0xcc;return function(_0x598828){if(_0x598828){return _0x4583fa[_0xeb7d('0x18')](_0x57eb05);}return _0x4583fa[_0xeb7d('0x19')](_0x57eb05)[_0xeb7d('0x1a')]();};}function respondWithResult(_0x1dafff,_0xb418){_0xb418=_0xb418||0xc8;return function(_0x5f29b0){if(_0x5f29b0){return _0x1dafff[_0xeb7d('0x19')](_0xb418)['json'](_0x5f29b0);}};}function respondWithFilteredResult(_0x284575,_0x45131f){return function(_0x35186c){if(_0x35186c){var _0x56dce2=typeof _0x45131f['offset']===_0xeb7d('0x1b')&&typeof _0x45131f[_0xeb7d('0x1c')]==='undefined';var _0x501111=_0x35186c[_0xeb7d('0x1d')];var _0x298c8d=_0x56dce2?0x0:_0x45131f['offset'];var _0x1bfa8a=_0x56dce2?_0x35186c[_0xeb7d('0x1d')]:_0x45131f[_0xeb7d('0x1e')]+_0x45131f[_0xeb7d('0x1c')];var _0x215a75;if(_0x1bfa8a>=_0x501111){_0x1bfa8a=_0x501111;_0x215a75=0xc8;}else{_0x215a75=0xce;}_0x284575[_0xeb7d('0x19')](_0x215a75);return _0x284575[_0xeb7d('0x1f')](_0xeb7d('0x20'),_0x298c8d+'-'+_0x1bfa8a+'/'+_0x501111)[_0xeb7d('0x21')](_0x35186c);}return null;};}function patchUpdates(_0x52324c){return function(_0x1507f5){try{jsonpatch['apply'](_0x1507f5,_0x52324c,!![]);}catch(_0xf2807d){return BPromise[_0xeb7d('0x22')](_0xf2807d);}return _0x1507f5[_0xeb7d('0x23')]();};}function saveUpdates(_0x5beab9,_0x19ad4f){return function(_0x1b68e8){if(_0x1b68e8){return _0x1b68e8['update'](_0x5beab9)[_0xeb7d('0x24')](function(_0x374f35){return _0x374f35;});}return null;};}function removeEntity(_0x431dc0,_0x3666db){return function(_0x3c58ba){if(_0x3c58ba){return _0x3c58ba[_0xeb7d('0x25')]()[_0xeb7d('0x24')](function(){_0x431dc0['status'](0xcc)[_0xeb7d('0x1a')]();});}};}function handleEntityNotFound(_0x392ba1,_0x1331ca){return function(_0x10f02c){if(!_0x10f02c){_0x392ba1[_0xeb7d('0x18')](0x194);}return _0x10f02c;};}function handleError(_0x3bf975,_0x1a2374){_0x1a2374=_0x1a2374||0x1f4;return function(_0x529986){logger[_0xeb7d('0x26')](_0x529986[_0xeb7d('0x27')]);if(_0x529986[_0xeb7d('0x28')]){delete _0x529986[_0xeb7d('0x28')];}_0x3bf975[_0xeb7d('0x19')](_0x1a2374)[_0xeb7d('0x29')](_0x529986);};}exports[_0xeb7d('0x2a')]=function(_0x310f25,_0x26592c){var _0x4c19c2={},_0x3387ab={},_0x3fcff4={'count':0x0,'rows':[]};var _0x9abd4b=_[_0xeb7d('0x2b')](db[_0xeb7d('0x2c')][_0xeb7d('0x2d')],function(_0x26118c){return{'name':_0x26118c[_0xeb7d('0x2e')],'type':_0x26118c[_0xeb7d('0x2f')][_0xeb7d('0x30')]};});_0x3387ab[_0xeb7d('0x31')]=_[_0xeb7d('0x2b')](_0x9abd4b,_0xeb7d('0x28'));_0x3387ab[_0xeb7d('0x32')]=_[_0xeb7d('0x33')](_0x310f25[_0xeb7d('0x32')]);_0x3387ab[_0xeb7d('0x34')]=_[_0xeb7d('0x35')](_0x3387ab[_0xeb7d('0x31')],_0x3387ab[_0xeb7d('0x32')]);_0x4c19c2[_0xeb7d('0x36')]=_[_0xeb7d('0x35')](_0x3387ab[_0xeb7d('0x31')],qs[_0xeb7d('0x37')](_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x37')]));_0x4c19c2[_0xeb7d('0x36')]=_0x4c19c2[_0xeb7d('0x36')][_0xeb7d('0x38')]?_0x4c19c2[_0xeb7d('0x36')]:_0x3387ab[_0xeb7d('0x31')];if(!_0x310f25['query'][_0xeb7d('0x39')](_0xeb7d('0x3a'))){_0x4c19c2[_0xeb7d('0x1c')]=qs[_0xeb7d('0x1c')](_0x310f25[_0xeb7d('0x32')]['limit']);_0x4c19c2[_0xeb7d('0x1e')]=qs[_0xeb7d('0x1e')](_0x310f25['query'][_0xeb7d('0x1e')]);}_0x4c19c2[_0xeb7d('0x3b')]=qs[_0xeb7d('0x3c')](_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x3c')]);_0x4c19c2[_0xeb7d('0x3d')]=qs[_0xeb7d('0x34')](_['pick'](_0x310f25[_0xeb7d('0x32')],_0x3387ab['filters']),_0x9abd4b);if(_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x3e')]){_0x4c19c2[_0xeb7d('0x3d')]=_[_0xeb7d('0x3f')](_0x4c19c2[_0xeb7d('0x3d')],{'$or':_[_0xeb7d('0x2b')](_0x9abd4b,function(_0x398527){if(_0x398527[_0xeb7d('0x2f')]!==_0xeb7d('0x40')){var _0x3db105={};_0x3db105[_0x398527[_0xeb7d('0x28')]]={'$like':'%'+_0x310f25[_0xeb7d('0x32')][_0xeb7d('0x3e')]+'%'};return _0x3db105;}})});}_0x4c19c2=_[_0xeb7d('0x3f')]({},_0x4c19c2,_0x310f25[_0xeb7d('0x41')]);var _0x5ed81c={'where':_0x4c19c2['where']};return db[_0xeb7d('0x2c')][_0xeb7d('0x1d')](_0x5ed81c)[_0xeb7d('0x24')](function(_0x1589f6){_0x3fcff4[_0xeb7d('0x1d')]=_0x1589f6;if(_0x310f25[_0xeb7d('0x32')]['includeAll']){_0x4c19c2[_0xeb7d('0x42')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xeb7d('0x43')](_0x4c19c2);})[_0xeb7d('0x24')](function(_0x2b6f97){_0x3fcff4[_0xeb7d('0x44')]=_0x2b6f97;return _0x3fcff4;})[_0xeb7d('0x24')](respondWithFilteredResult(_0x26592c,_0x4c19c2))['catch'](handleError(_0x26592c,null));};exports[_0xeb7d('0x45')]=function(_0x512c95,_0x5ba7ca){var _0x46babd={'raw':!![],'where':{'id':_0x512c95[_0xeb7d('0x46')]['id']}},_0x3152ba={};_0x3152ba[_0xeb7d('0x31')]=_[_0xeb7d('0x33')](db[_0xeb7d('0x2c')]['rawAttributes']);_0x3152ba[_0xeb7d('0x32')]=_[_0xeb7d('0x33')](_0x512c95['query']);_0x3152ba[_0xeb7d('0x34')]=_['intersection'](_0x3152ba[_0xeb7d('0x31')],_0x3152ba[_0xeb7d('0x32')]);_0x46babd['attributes']=_[_0xeb7d('0x35')](_0x3152ba[_0xeb7d('0x31')],qs[_0xeb7d('0x37')](_0x512c95['query'][_0xeb7d('0x37')]));_0x46babd[_0xeb7d('0x36')]=_0x46babd['attributes'][_0xeb7d('0x38')]?_0x46babd[_0xeb7d('0x36')]:_0x3152ba[_0xeb7d('0x31')];if(_0x512c95[_0xeb7d('0x32')]['includeAll']){_0x46babd[_0xeb7d('0x42')]=[{'all':!![]}];}_0x46babd=_[_0xeb7d('0x3f')]({},_0x46babd,_0x512c95[_0xeb7d('0x41')]);return db[_0xeb7d('0x2c')][_0xeb7d('0x47')](_0x46babd)['then'](handleEntityNotFound(_0x5ba7ca,null))[_0xeb7d('0x24')](respondWithResult(_0x5ba7ca,null))[_0xeb7d('0x48')](handleError(_0x5ba7ca,null));};exports['create']=function(_0x50433c,_0x490652){return db[_0xeb7d('0x2c')][_0xeb7d('0x49')](_0x50433c['body'],{})[_0xeb7d('0x24')](respondWithResult(_0x490652,0xc9))[_0xeb7d('0x48')](handleError(_0x490652,null));};exports['update']=function(_0x396df0,_0x4f6188){if(_0x396df0['body']['id']){delete _0x396df0[_0xeb7d('0x4a')]['id'];}return db[_0xeb7d('0x2c')][_0xeb7d('0x47')]({'where':{'id':_0x396df0[_0xeb7d('0x46')]['id']}})[_0xeb7d('0x24')](handleEntityNotFound(_0x4f6188,null))[_0xeb7d('0x24')](saveUpdates(_0x396df0[_0xeb7d('0x4a')],null))['then'](respondWithResult(_0x4f6188,null))[_0xeb7d('0x48')](handleError(_0x4f6188,null));};exports['destroy']=function(_0x249ee5,_0x30e777){return db[_0xeb7d('0x2c')][_0xeb7d('0x47')]({'where':{'id':_0x249ee5[_0xeb7d('0x46')]['id']}})['then'](handleEntityNotFound(_0x30e777,null))['then'](removeEntity(_0x30e777,null))[_0xeb7d('0x48')](handleError(_0x30e777,null));}; \ No newline at end of file +var _0xe0dc=['apply','update','then','error','stack','name','index','map','WhatsappApplication','rawAttributes','fieldName','model','query','keys','intersection','attributes','nolimit','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0xf1d879,_0x239f90){var _0x474dc1=function(_0x142be4){while(--_0x142be4){_0xf1d879['push'](_0xf1d879['shift']());}};_0x474dc1(++_0x239f90);}(_0xe0dc,0x190));var _0xce0d=function(_0x4d5672,_0x4517e7){_0x4d5672=_0x4d5672-0x0;var _0x4a7aec=_0xe0dc[_0x4d5672];return _0x4a7aec;};'use strict';var emlformat=require(_0xce0d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xce0d('0x1'));var jsonpatch=require(_0xce0d('0x2'));var rp=require('request-promise');var moment=require(_0xce0d('0x3'));var BPromise=require(_0xce0d('0x4'));var Mustache=require(_0xce0d('0x5'));var util=require(_0xce0d('0x6'));var path=require('path');var sox=require(_0xce0d('0x7'));var csv=require('to-csv');var ejs=require(_0xce0d('0x8'));var fs=require('fs');var fs_extra=require(_0xce0d('0x9'));var _=require(_0xce0d('0xa'));var squel=require(_0xce0d('0xb'));var crypto=require(_0xce0d('0xc'));var jsforce=require(_0xce0d('0xd'));var deskjs=require(_0xce0d('0xe'));var toCsv=require(_0xce0d('0xf'));var querystring=require(_0xce0d('0x10'));var Papa=require(_0xce0d('0x11'));var Redis=require(_0xce0d('0x12'));var authService=require(_0xce0d('0x13'));var qs=require(_0xce0d('0x14'));var as=require(_0xce0d('0x15'));var hardwareService=require(_0xce0d('0x16'));var logger=require(_0xce0d('0x17'))(_0xce0d('0x18'));var utils=require(_0xce0d('0x19'));var config=require(_0xce0d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xce0d('0x1b'))['db'];function respondWithStatusCode(_0x419b8a,_0x2a802c){_0x2a802c=_0x2a802c||0xcc;return function(_0x29a87c){if(_0x29a87c){return _0x419b8a[_0xce0d('0x1c')](_0x2a802c);}return _0x419b8a[_0xce0d('0x1d')](_0x2a802c)[_0xce0d('0x1e')]();};}function respondWithResult(_0x178400,_0x18a96e){_0x18a96e=_0x18a96e||0xc8;return function(_0xfba354){if(_0xfba354){return _0x178400[_0xce0d('0x1d')](_0x18a96e)[_0xce0d('0x1f')](_0xfba354);}};}function respondWithFilteredResult(_0x2a2f69,_0x3bedc2){return function(_0xef9e5f){if(_0xef9e5f){var _0x176c81=typeof _0x3bedc2[_0xce0d('0x20')]===_0xce0d('0x21')&&typeof _0x3bedc2[_0xce0d('0x22')]===_0xce0d('0x21');var _0x2044df=_0xef9e5f[_0xce0d('0x23')];var _0x1dc8aa=_0x176c81?0x0:_0x3bedc2[_0xce0d('0x20')];var _0x3378f2=_0x176c81?_0xef9e5f[_0xce0d('0x23')]:_0x3bedc2[_0xce0d('0x20')]+_0x3bedc2[_0xce0d('0x22')];var _0x37aae8;if(_0x3378f2>=_0x2044df){_0x3378f2=_0x2044df;_0x37aae8=0xc8;}else{_0x37aae8=0xce;}_0x2a2f69[_0xce0d('0x1d')](_0x37aae8);return _0x2a2f69[_0xce0d('0x24')](_0xce0d('0x25'),_0x1dc8aa+'-'+_0x3378f2+'/'+_0x2044df)[_0xce0d('0x1f')](_0xef9e5f);}return null;};}function patchUpdates(_0x1fb46d){return function(_0x8388e3){try{jsonpatch[_0xce0d('0x26')](_0x8388e3,_0x1fb46d,!![]);}catch(_0x16788f){return BPromise['reject'](_0x16788f);}return _0x8388e3['save']();};}function saveUpdates(_0xa0277a,_0x4da3f6){return function(_0x2727c2){if(_0x2727c2){return _0x2727c2[_0xce0d('0x27')](_0xa0277a)[_0xce0d('0x28')](function(_0x58d7c5){return _0x58d7c5;});}return null;};}function removeEntity(_0x1ff817,_0x542d3d){return function(_0x298f3e){if(_0x298f3e){return _0x298f3e['destroy']()[_0xce0d('0x28')](function(){_0x1ff817[_0xce0d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x516609,_0x31300f){return function(_0x201167){if(!_0x201167){_0x516609[_0xce0d('0x1c')](0x194);}return _0x201167;};}function handleError(_0x41b228,_0xdab05c){_0xdab05c=_0xdab05c||0x1f4;return function(_0x4cbaf4){logger[_0xce0d('0x29')](_0x4cbaf4[_0xce0d('0x2a')]);if(_0x4cbaf4[_0xce0d('0x2b')]){delete _0x4cbaf4['name'];}_0x41b228[_0xce0d('0x1d')](_0xdab05c)['send'](_0x4cbaf4);};}exports[_0xce0d('0x2c')]=function(_0x1eb234,_0x328842){var _0x435fd2={},_0x1a7f8c={},_0x3c4ec8={'count':0x0,'rows':[]};var _0x2c9c1b=_[_0xce0d('0x2d')](db[_0xce0d('0x2e')][_0xce0d('0x2f')],function(_0x4171cb){return{'name':_0x4171cb[_0xce0d('0x30')],'type':_0x4171cb['type']['key']};});_0x1a7f8c[_0xce0d('0x31')]=_[_0xce0d('0x2d')](_0x2c9c1b,_0xce0d('0x2b'));_0x1a7f8c[_0xce0d('0x32')]=_[_0xce0d('0x33')](_0x1eb234['query']);_0x1a7f8c['filters']=_[_0xce0d('0x34')](_0x1a7f8c[_0xce0d('0x31')],_0x1a7f8c['query']);_0x435fd2['attributes']=_['intersection'](_0x1a7f8c[_0xce0d('0x31')],qs['fields'](_0x1eb234['query']['fields']));_0x435fd2[_0xce0d('0x35')]=_0x435fd2['attributes']['length']?_0x435fd2['attributes']:_0x1a7f8c['model'];if(!_0x1eb234['query']['hasOwnProperty'](_0xce0d('0x36'))){_0x435fd2[_0xce0d('0x22')]=qs[_0xce0d('0x22')](_0x1eb234[_0xce0d('0x32')][_0xce0d('0x22')]);_0x435fd2[_0xce0d('0x20')]=qs[_0xce0d('0x20')](_0x1eb234[_0xce0d('0x32')][_0xce0d('0x20')]);}_0x435fd2['order']=qs[_0xce0d('0x37')](_0x1eb234[_0xce0d('0x32')]['sort']);_0x435fd2[_0xce0d('0x38')]=qs[_0xce0d('0x39')](_['pick'](_0x1eb234['query'],_0x1a7f8c[_0xce0d('0x39')]),_0x2c9c1b);if(_0x1eb234[_0xce0d('0x32')][_0xce0d('0x3a')]){_0x435fd2[_0xce0d('0x38')]=_[_0xce0d('0x3b')](_0x435fd2['where'],{'$or':_['map'](_0x2c9c1b,function(_0x27d599){if(_0x27d599[_0xce0d('0x3c')]!=='VIRTUAL'){var _0x4d4297={};_0x4d4297[_0x27d599[_0xce0d('0x2b')]]={'$like':'%'+_0x1eb234[_0xce0d('0x32')][_0xce0d('0x3a')]+'%'};return _0x4d4297;}})});}_0x435fd2=_[_0xce0d('0x3b')]({},_0x435fd2,_0x1eb234[_0xce0d('0x3d')]);var _0x1cfa6c={'where':_0x435fd2['where']};return db[_0xce0d('0x2e')][_0xce0d('0x23')](_0x1cfa6c)[_0xce0d('0x28')](function(_0x18a56f){_0x3c4ec8[_0xce0d('0x23')]=_0x18a56f;if(_0x1eb234[_0xce0d('0x32')][_0xce0d('0x3e')]){_0x435fd2[_0xce0d('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0xce0d('0x40')](_0x435fd2);})['then'](function(_0x6352f9){_0x3c4ec8[_0xce0d('0x41')]=_0x6352f9;return _0x3c4ec8;})[_0xce0d('0x28')](respondWithFilteredResult(_0x328842,_0x435fd2))[_0xce0d('0x42')](handleError(_0x328842,null));};exports[_0xce0d('0x43')]=function(_0x4abd42,_0x118d68){var _0x1d19ed={'raw':!![],'where':{'id':_0x4abd42[_0xce0d('0x44')]['id']}},_0x5457d8={};_0x5457d8['model']=_[_0xce0d('0x33')](db[_0xce0d('0x2e')][_0xce0d('0x2f')]);_0x5457d8['query']=_[_0xce0d('0x33')](_0x4abd42[_0xce0d('0x32')]);_0x5457d8['filters']=_['intersection'](_0x5457d8[_0xce0d('0x31')],_0x5457d8[_0xce0d('0x32')]);_0x1d19ed[_0xce0d('0x35')]=_[_0xce0d('0x34')](_0x5457d8[_0xce0d('0x31')],qs['fields'](_0x4abd42['query']['fields']));_0x1d19ed[_0xce0d('0x35')]=_0x1d19ed[_0xce0d('0x35')][_0xce0d('0x45')]?_0x1d19ed[_0xce0d('0x35')]:_0x5457d8[_0xce0d('0x31')];if(_0x4abd42[_0xce0d('0x32')][_0xce0d('0x3e')]){_0x1d19ed['include']=[{'all':!![]}];}_0x1d19ed=_['merge']({},_0x1d19ed,_0x4abd42[_0xce0d('0x3d')]);return db[_0xce0d('0x2e')][_0xce0d('0x46')](_0x1d19ed)[_0xce0d('0x28')](handleEntityNotFound(_0x118d68,null))[_0xce0d('0x28')](respondWithResult(_0x118d68,null))[_0xce0d('0x42')](handleError(_0x118d68,null));};exports[_0xce0d('0x47')]=function(_0x47daa0,_0x362827){return db['WhatsappApplication']['create'](_0x47daa0[_0xce0d('0x48')],{})[_0xce0d('0x28')](respondWithResult(_0x362827,0xc9))[_0xce0d('0x42')](handleError(_0x362827,null));};exports['update']=function(_0x641547,_0x36f502){if(_0x641547['body']['id']){delete _0x641547[_0xce0d('0x48')]['id'];}return db[_0xce0d('0x2e')][_0xce0d('0x46')]({'where':{'id':_0x641547[_0xce0d('0x44')]['id']}})[_0xce0d('0x28')](handleEntityNotFound(_0x36f502,null))[_0xce0d('0x28')](saveUpdates(_0x641547[_0xce0d('0x48')],null))[_0xce0d('0x28')](respondWithResult(_0x36f502,null))[_0xce0d('0x42')](handleError(_0x36f502,null));};exports['destroy']=function(_0x327487,_0x4438e3){return db[_0xce0d('0x2e')][_0xce0d('0x46')]({'where':{'id':_0x327487['params']['id']}})[_0xce0d('0x28')](handleEntityNotFound(_0x4438e3,null))[_0xce0d('0x28')](removeEntity(_0x4438e3,null))['catch'](handleError(_0x4438e3,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 5411c8a..8b47114 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 _0xe132=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappApplication'];(function(_0x265a87,_0x4e1c17){var _0x29f0b0=function(_0x491da){while(--_0x491da){_0x265a87['push'](_0x265a87['shift']());}};_0x29f0b0(++_0x4e1c17);}(_0xe132,0x162));var _0x2e13=function(_0xda657f,_0x479eef){_0xda657f=_0xda657f-0x0;var _0xf35c65=_0xe132[_0xda657f];return _0xf35c65;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e13('0xb'),'collate':_0x2e13('0xc')});}; \ No newline at end of file +var _0x207c=['bluebird','request-promise','path','../../config/environment','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x369cd0,_0x472d1e){var _0x16692d=function(_0x4b8338){while(--_0x4b8338){_0x369cd0['push'](_0x369cd0['shift']());}};_0x16692d(++_0x472d1e);}(_0x207c,0x1e8));var _0xc207=function(_0x38490b,_0x108ad7){_0x38490b=_0x38490b-0x0;var _0x197661=_0x207c[_0x38490b];return _0x197661;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require('rimraf');var config=require(_0xc207('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x55023e,_0xc88789){return _0x55023e[_0xc207('0x8')](_0xc207('0x9'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc207('0xa'),'collate':_0xc207('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 1077e2f..ff44b22 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 _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0xf136bc,_0x4cb677){var _0x447aa6=function(_0x5c6f9b){while(--_0x5c6f9b){_0xf136bc['push'](_0xf136bc['shift']());}};_0x447aa6(++_0x4cb677);}(_0xda55,0x6d));var _0x5da5=function(_0x4d72aa,_0x5752e3){_0x4d72aa=_0x4d72aa-0x0;var _0x22c759=_0xda55[_0x4d72aa];return _0x22c759;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});} \ No newline at end of file +var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3b418f,_0x5463e2){var _0x136223=function(_0xe58731){while(--_0xe58731){_0x3b418f['push'](_0x3b418f['shift']());}};_0x136223(++_0x5463e2);}(_0x70e0,0x17b));var _0x070e=function(_0x5b8850,_0x1749d8){_0x5b8850=_0x5b8850-0x0;var _0xeecf4c=_0x70e0[_0x5b8850];return _0xeecf4c;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index bdc0152..01c39e7 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 _0x4317=['./whatsappInteraction.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2fb0a7,_0x3cb9aa){var _0x502664=function(_0x3ae7fc){while(--_0x3ae7fc){_0x2fb0a7['push'](_0x2fb0a7['shift']());}};_0x502664(++_0x3cb9aa);}(_0x4317,0x7c));var _0x7431=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4317[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x7431('0x0'));var path=require(_0x7431('0x1'));var timeout=require(_0x7431('0x2'));var express=require('express');var router=express[_0x7431('0x3')]();var fs_extra=require(_0x7431('0x4'));var auth=require(_0x7431('0x5'));var interaction=require(_0x7431('0x6'));var config=require(_0x7431('0x7'));var controller=require(_0x7431('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7431('0x9')]);router[_0x7431('0xa')](_0x7431('0xb'),auth[_0x7431('0xc')](),controller[_0x7431('0xd')]);router[_0x7431('0xa')](_0x7431('0xe'),auth[_0x7431('0xc')](),controller[_0x7431('0xf')]);router[_0x7431('0xa')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x11')]);router[_0x7431('0xa')](_0x7431('0x12'),auth[_0x7431('0xc')](),controller[_0x7431('0x13')]);router[_0x7431('0x14')]('/',auth[_0x7431('0xc')](),controller[_0x7431('0x15')]);router[_0x7431('0x14')](_0x7431('0x10'),auth[_0x7431('0xc')](),controller[_0x7431('0x16')]);router['post'](_0x7431('0x17'),auth[_0x7431('0xc')](),interaction[_0x7431('0x18')]('whatsapp',_0x7431('0x19')),controller[_0x7431('0x1a')]);router[_0x7431('0x1b')]('/:id',auth[_0x7431('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0x7431('0x1c')]);router[_0x7431('0x1d')](_0x7431('0xe'),auth[_0x7431('0xc')](),interaction['tracked']('whatsapp',_0x7431('0x1e')),controller[_0x7431('0x1f')]);router[_0x7431('0x1d')](_0x7431('0x17'),auth[_0x7431('0xc')](),controller[_0x7431('0x20')]);module['exports']=router; \ No newline at end of file +var _0x723e=['../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x178fcd,_0x353a2f){var _0x25a77c=function(_0x3ef32d){while(--_0x3ef32d){_0x178fcd['push'](_0x178fcd['shift']());}};_0x25a77c(++_0x353a2f);}(_0x723e,0x179));var _0xe723=function(_0x3f4027,_0x221cbb){_0x3f4027=_0x3f4027-0x0;var _0x4aea2e=_0x723e[_0x3f4027];return _0x4aea2e;};'use strict';var multer=require('multer');var util=require(_0xe723('0x0'));var path=require(_0xe723('0x1'));var timeout=require(_0xe723('0x2'));var express=require(_0xe723('0x3'));var router=express[_0xe723('0x4')]();var fs_extra=require(_0xe723('0x5'));var auth=require(_0xe723('0x6'));var interaction=require(_0xe723('0x7'));var config=require(_0xe723('0x8'));var controller=require(_0xe723('0x9'));router['get']('/',auth[_0xe723('0xa')](),controller[_0xe723('0xb')]);router[_0xe723('0xc')](_0xe723('0xd'),auth[_0xe723('0xa')](),controller[_0xe723('0xe')]);router[_0xe723('0xc')](_0xe723('0xf'),auth['isAuthenticated'](),controller[_0xe723('0x10')]);router[_0xe723('0xc')](_0xe723('0x11'),auth['isAuthenticated'](),controller[_0xe723('0x12')]);router[_0xe723('0xc')](_0xe723('0x13'),auth['isAuthenticated'](),controller[_0xe723('0x14')]);router[_0xe723('0x15')]('/',auth[_0xe723('0xa')](),controller[_0xe723('0x16')]);router[_0xe723('0x15')]('/:id/messages',auth[_0xe723('0xa')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xe723('0x17')](_0xe723('0x18'),_0xe723('0x19')),controller[_0xe723('0x1a')]);router[_0xe723('0x1b')]('/:id',auth[_0xe723('0xa')](),interaction[_0xe723('0x17')](_0xe723('0x18'),_0xe723('0x1c')),controller[_0xe723('0x1d')]);router[_0xe723('0x1e')](_0xe723('0xf'),auth[_0xe723('0xa')](),interaction[_0xe723('0x17')](_0xe723('0x18'),_0xe723('0x1f')),controller[_0xe723('0x20')]);router[_0xe723('0x1e')](_0xe723('0x21'),auth['isAuthenticated'](),controller['removeTags']);module[_0xe723('0x22')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index aba7006..080618f 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 _0x7d14=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x4ec445,_0x1a61bd){var _0x20e5e=function(_0x5e389e){while(--_0x5e389e){_0x4ec445['push'](_0x4ec445['shift']());}};_0x20e5e(++_0x1a61bd);}(_0x7d14,0x6d));var _0x47d1=function(_0x211616,_0x27ec1f){_0x211616=_0x211616-0x0;var _0x1e3fae=_0x7d14[_0x211616];return _0x1e3fae;};'use strict';var Sequelize=require(_0x47d1('0x0'));var moment=require(_0x47d1('0x1'));module['exports']={'closed':{'type':Sequelize[_0x47d1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x47d1('0x3')]},'disposition':{'type':Sequelize[_0x47d1('0x4')]},'secondDisposition':{'type':Sequelize[_0x47d1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x47d1('0x4')]},'phone':{'type':Sequelize[_0x47d1('0x4')]},'read1stAt':{'type':Sequelize[_0x47d1('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x47d1('0x5')]('in',_0x47d1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x47d1('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe820=['sequelize','exports','STRING','ENUM','out','DATE','INTEGER'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0xe820,0xd2));var _0x0e82=function(_0x1fadf1,_0x3d615d){_0x1fadf1=_0x1fadf1-0x0;var _0x20748f=_0xe820[_0x1fadf1];return _0x20748f;};'use strict';var Sequelize=require(_0x0e82('0x0'));var moment=require('moment');module[_0x0e82('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0e82('0x2')]},'secondDisposition':{'type':Sequelize[_0x0e82('0x2')]},'thirdDisposition':{'type':Sequelize[_0x0e82('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0e82('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x0e82('0x3')]('in',_0x0e82('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0e82('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x0e82('0x3')]('in',_0x0e82('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x0e82('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index db7562c..98d6899 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 _0xa33b=['transcript-','Whatsapp','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','WhatsappInteraction','rawAttributes','fieldName','type','key','findAll','whatsapp','catch','keys','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','create','body','params','find','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','WhatsappInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','spread','Tag','color','whatsappInteractionTags:save','removeTags','unix','toString','root','server','tmp','join','files','attachments','push','User','Contact','lastName','createdAt','direction','secret','WhatsappAccount','Account','Owner','fullname','get','N.A.','closed','disposition','Attachment','existsSync','createReadStream','createWriteStream','out','System','firstName','basename','read','value','renderFile','views','downloadInteraction.ejs'];(function(_0x2e5f98,_0x5c9cb1){var _0x17ad74=function(_0x3520e8){while(--_0x3520e8){_0x2e5f98['push'](_0x2e5f98['shift']());}};_0x17ad74(++_0x5c9cb1);}(_0xa33b,0x83));var _0xba33=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xa33b[_0x565c49];return _0x20ca34;};'use strict';var rimraf=require(_0xba33('0x0'));var zipdir=require(_0xba33('0x1'));var moment=require(_0xba33('0x2'));var BPromise=require(_0xba33('0x3'));var util=require(_0xba33('0x4'));var path=require(_0xba33('0x5'));var ejs=require(_0xba33('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xba33('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xba33('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xba33('0x9'))(_0xba33('0xa'));var config=require(_0xba33('0xb'));var db=require(_0xba33('0xc'))['db'];config[_0xba33('0xd')]=_[_0xba33('0xe')](config[_0xba33('0xd')],{'host':_0xba33('0xf'),'port':0x18eb});var socket=require(_0xba33('0x10'))(new Redis(config[_0xba33('0xd')]));require(_0xba33('0x11'))[_0xba33('0x12')](socket);function respondWithStatusCode(_0x57aea5,_0x58d6bc){_0x58d6bc=_0x58d6bc||0xcc;return function(_0x4afcaa){if(_0x4afcaa){return _0x57aea5[_0xba33('0x13')](_0x58d6bc);}return _0x57aea5['status'](_0x58d6bc)[_0xba33('0x14')]();};}function respondWithResult(_0x30cf8d,_0x3c938a){_0x3c938a=_0x3c938a||0xc8;return function(_0x4853c2){if(_0x4853c2){return _0x30cf8d[_0xba33('0x15')](_0x3c938a)[_0xba33('0x16')](_0x4853c2);}};}function respondWithFilteredResult(_0x370c06,_0x27a2ff){return function(_0x35d3aa){if(_0x35d3aa){var _0x3b5196=typeof _0x27a2ff[_0xba33('0x17')]===_0xba33('0x18')&&typeof _0x27a2ff[_0xba33('0x19')]===_0xba33('0x18');var _0x168a66=_0x35d3aa['count'];var _0x5205c9=_0x3b5196?0x0:_0x27a2ff[_0xba33('0x17')];var _0x16f1e5=_0x3b5196?_0x35d3aa[_0xba33('0x1a')]:_0x27a2ff[_0xba33('0x17')]+_0x27a2ff['limit'];var _0x2b7a29;if(_0x16f1e5>=_0x168a66){_0x16f1e5=_0x168a66;_0x2b7a29=0xc8;}else{_0x2b7a29=0xce;}_0x370c06['status'](_0x2b7a29);return _0x370c06[_0xba33('0x1b')](_0xba33('0x1c'),_0x5205c9+'-'+_0x16f1e5+'/'+_0x168a66)[_0xba33('0x16')](_0x35d3aa);}return null;};}function saveUpdates(_0x2c5780){return function(_0x4fe26f){if(_0x4fe26f){return _0x4fe26f[_0xba33('0x1d')](_0x2c5780)[_0xba33('0x1e')](function(_0x9cc69f){return _0x9cc69f;});}return null;};}function removeEntity(_0x2e5cdd){return function(_0x3cbbf2){if(_0x3cbbf2){return _0x3cbbf2[_0xba33('0x1f')]()[_0xba33('0x1e')](function(){_0x2e5cdd['status'](0xcc)[_0xba33('0x14')]();});}};}function handleEntityNotFound(_0x3161f0){return function(_0x120808){if(!_0x120808){_0x3161f0[_0xba33('0x13')](0x194);}return _0x120808;};}function handleError(_0x345e25,_0x75ccb){_0x75ccb=_0x75ccb||0x1f4;return function(_0x1341c7){logger[_0xba33('0x20')](_0x1341c7[_0xba33('0x21')]);if(_0x1341c7[_0xba33('0x22')]){delete _0x1341c7[_0xba33('0x22')];}_0x345e25[_0xba33('0x15')](_0x75ccb)[_0xba33('0x23')](_0x1341c7);};}exports['index']=function(_0x4324ff,_0x2c6960){var _0x1f0c38={};var _0x362def=_[_0xba33('0x24')](db[_0xba33('0x25')][_0xba33('0x26')],function(_0x4f074b){return{'name':_0x4f074b[_0xba33('0x27')],'type':_0x4f074b[_0xba33('0x28')][_0xba33('0x29')]};});_0x1f0c38=qs['getOptions'](_0x362def,_0x4324ff);return interaction[_0xba33('0x2a')](_0xba33('0x2b'),_0x4324ff['query'],_0x4324ff['user'],_0x1f0c38,_0x362def)[_0xba33('0x1e')](respondWithFilteredResult(_0x2c6960,_0x1f0c38))[_0xba33('0x2c')](handleError(_0x2c6960,null));};exports['show']=function(_0x143185,_0x407c29){var _0x3f9cbe={'raw':![],'where':{'id':_0x143185['params']['id']}},_0xf6c654={};_0xf6c654['model']=_[_0xba33('0x2d')](db[_0xba33('0x25')]['rawAttributes']);_0xf6c654[_0xba33('0x2e')]=_[_0xba33('0x2d')](_0x143185['query']);_0xf6c654[_0xba33('0x2f')]=_[_0xba33('0x30')](_0xf6c654[_0xba33('0x31')],_0xf6c654[_0xba33('0x2e')]);_0x3f9cbe[_0xba33('0x32')]=_[_0xba33('0x30')](_0xf6c654[_0xba33('0x31')],qs[_0xba33('0x33')](_0x143185[_0xba33('0x2e')][_0xba33('0x33')]));_0x3f9cbe[_0xba33('0x32')]=_0x3f9cbe[_0xba33('0x32')][_0xba33('0x34')]?_0x3f9cbe['attributes']:_0xf6c654['model'];if(_0x143185[_0xba33('0x2e')][_0xba33('0x35')]){_0x3f9cbe[_0xba33('0x36')]=[{'all':!![]}];}_0x3f9cbe=_[_0xba33('0x37')]({},_0x3f9cbe,_0x143185['options']);return db[_0xba33('0x25')]['find'](_0x3f9cbe)[_0xba33('0x1e')](handleEntityNotFound(_0x407c29,null))[_0xba33('0x1e')](respondWithResult(_0x407c29,null))[_0xba33('0x2c')](handleError(_0x407c29,null));};exports[_0xba33('0x38')]=function(_0x48148d,_0x34d5eb){return db[_0xba33('0x25')][_0xba33('0x38')](_0x48148d[_0xba33('0x39')],{})[_0xba33('0x1e')](respondWithResult(_0x34d5eb,0xc9))[_0xba33('0x2c')](handleError(_0x34d5eb,null));};exports['update']=function(_0x533396,_0x35c755){if(_0x533396['body']['id']){delete _0x533396['body']['id'];}return db[_0xba33('0x25')]['find']({'where':{'id':_0x533396[_0xba33('0x3a')]['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x35c755,null))[_0xba33('0x1e')](saveUpdates(_0x533396[_0xba33('0x39')],null))[_0xba33('0x1e')](respondWithResult(_0x35c755,null))[_0xba33('0x2c')](handleError(_0x35c755,null));};exports[_0xba33('0x1f')]=function(_0x436d08,_0x289026){return db[_0xba33('0x25')][_0xba33('0x3b')]({'where':{'id':_0x436d08['params']['id']}})['then'](handleEntityNotFound(_0x289026,null))[_0xba33('0x1e')](removeEntity(_0x289026,null))[_0xba33('0x2c')](handleError(_0x289026,null));};exports[_0xba33('0x3c')]=function(_0x2cdccf,_0x5b3f68){return db[_0xba33('0x25')][_0xba33('0x3c')]()[_0xba33('0x1e')](respondWithResult(_0x5b3f68,null))[_0xba33('0x2c')](handleError(_0x5b3f68,null));};exports['addMessage']=function(_0x167519,_0x1bf885){return db[_0xba33('0x3d')]['find']({'where':{'id':_0x167519[_0xba33('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1bf885,null))[_0xba33('0x1e')](function(_0x4e3eff){if(_0x4e3eff){return _0x4e3eff[_0xba33('0x3e')](_0x167519[_0xba33('0x39')][_0xba33('0x3f')],_[_0xba33('0x40')](_0x167519[_0xba33('0x39')],[_0xba33('0x3f'),'id'])||{});}})['then'](respondWithResult(_0x1bf885,null))[_0xba33('0x2c')](handleError(_0x1bf885,null));};exports[_0xba33('0x41')]=function(_0x55321a,_0x16b387){var _0x4a24eb={'raw':![],'where':{}};var _0xf45131={};var _0xbd0ca={'count':0x0,'rows':[]};return db[_0xba33('0x25')][_0xba33('0x42')]({'where':{'id':_0x55321a['params']['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x16b387,null))[_0xba33('0x1e')](function(_0x4e3449){if(_0x4e3449){_0xf45131[_0xba33('0x31')]=_[_0xba33('0x2d')](db['WhatsappMessage'][_0xba33('0x26')]);_0xf45131[_0xba33('0x2e')]=_[_0xba33('0x2d')](_0x55321a['query']);_0xf45131['filters']=_[_0xba33('0x30')](_0xf45131[_0xba33('0x31')],_0xf45131['query']);_0x4a24eb[_0xba33('0x32')]=_['intersection'](_0xf45131['model'],qs[_0xba33('0x33')](_0x55321a[_0xba33('0x2e')]['fields']));_0x4a24eb[_0xba33('0x32')]=_0x4a24eb[_0xba33('0x32')][_0xba33('0x34')]?_0x4a24eb['attributes']:_0xf45131[_0xba33('0x31')];if(!_0x55321a[_0xba33('0x2e')][_0xba33('0x43')](_0xba33('0x44'))){_0x4a24eb[_0xba33('0x19')]=qs['limit'](_0x55321a[_0xba33('0x2e')][_0xba33('0x19')]);_0x4a24eb[_0xba33('0x17')]=qs['offset'](_0x55321a[_0xba33('0x2e')]['offset']);}_0x4a24eb[_0xba33('0x45')]=qs[_0xba33('0x46')](_0x55321a[_0xba33('0x2e')][_0xba33('0x46')]);_0x4a24eb[_0xba33('0x47')]=qs[_0xba33('0x2f')](_['pick'](_0x55321a['query'],_0xf45131[_0xba33('0x2f')]));_0x4a24eb['where'][_0xba33('0x48')]=_0x4e3449['id'];if(_0x55321a[_0xba33('0x2e')][_0xba33('0x49')]){_0x4a24eb['where']=_[_0xba33('0x37')](_0x4a24eb[_0xba33('0x47')],{'$or':_['map'](_0x4a24eb[_0xba33('0x32')],function(_0x448867){var _0x245772={};_0x245772[_0x448867]={'$like':'%'+_0x55321a[_0xba33('0x2e')]['filter']+'%'};return _0x245772;})});}if(_0x55321a[_0xba33('0x2e')][_0xba33('0x4a')]){var _0x1d63c1=_0x55321a['query']['$gte']['split'](',');var _0x8d0a6d={};_0x8d0a6d[_0x1d63c1[0x0]]={'$gte':moment(_0x1d63c1[0x1])[_0xba33('0x4b')](_0xba33('0x4c'))};_0x4a24eb[_0xba33('0x47')]=_['merge'](_0x4a24eb[_0xba33('0x47')],_0x8d0a6d);}_0x4a24eb=_[_0xba33('0x37')]({},_0x4a24eb,_0x55321a[_0xba33('0x4d')]);return db[_0xba33('0x3d')][_0xba33('0x1a')]({'where':_0x4a24eb[_0xba33('0x47')]})['then'](function(_0x3995e1){_0xbd0ca['count']=_0x3995e1;if(_0x55321a[_0xba33('0x2e')]['includeAll']){_0x4a24eb[_0xba33('0x36')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xba33('0x2a')](_0x4a24eb);})['then'](function(_0x40725d){_0xbd0ca[_0xba33('0x4e')]=_0x40725d;return _0xbd0ca;});}})[_0xba33('0x1e')](respondWithFilteredResult(_0x16b387,_0x4a24eb))[_0xba33('0x2c')](handleError(_0x16b387,null));};exports[_0xba33('0x4f')]=function(_0x51fd24,_0x1ea4f1){return db[_0xba33('0x25')][_0xba33('0x3b')]({'where':{'id':_0x51fd24[_0xba33('0x3a')]['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x1ea4f1,null))[_0xba33('0x1e')](function(_0x50ea23){if(_0x50ea23){return _0x50ea23['setTags'](_0x51fd24[_0xba33('0x39')][_0xba33('0x3f')],_[_0xba33('0x40')](_0x51fd24[_0xba33('0x39')],[_0xba33('0x3f'),'id'])||{})[_0xba33('0x50')](function(){return db[_0xba33('0x51')][_0xba33('0x2a')]({'attributes':['id',_0xba33('0x22'),_0xba33('0x52')],'where':{'id':_0x51fd24[_0xba33('0x39')][_0xba33('0x3f')]}});})[_0xba33('0x1e')](function(_0x272cca){socket['emit'](_0xba33('0x53'),{'id':Number(_0x51fd24[_0xba33('0x3a')]['id']),'tags':_0x272cca||[]});return{'id':Number(_0x51fd24['params']['id']),'tags':_0x272cca||[]};});}})[_0xba33('0x1e')](respondWithResult(_0x1ea4f1,null))[_0xba33('0x2c')](handleError(_0x1ea4f1,null));};exports['removeTags']=function(_0x5715a5,_0x3d32ba){return db[_0xba33('0x25')]['find']({'where':{'id':_0x5715a5[_0xba33('0x3a')]['id']}})[_0xba33('0x1e')](handleEntityNotFound(_0x3d32ba,null))['then'](function(_0xfe16a9){if(_0xfe16a9){return _0xfe16a9[_0xba33('0x54')](_0x5715a5[_0xba33('0x2e')][_0xba33('0x3f')]);}})[_0xba33('0x1e')](respondWithStatusCode(_0x3d32ba,null))[_0xba33('0x2c')](handleError(_0x3d32ba,null));};exports['download']=function(_0x18b54a,_0x3fd579){var _0x2697fd=moment()[_0xba33('0x55')]()[_0xba33('0x56')]();var _0xe435a4=path['join'](config[_0xba33('0x57')],_0xba33('0x58'),'files',_0xba33('0x59'));var _0x32af03=path[_0xba33('0x5a')](config[_0xba33('0x57')],_0xba33('0x58'),_0xba33('0x5b'),_0xba33('0x5c'));var _0x9f285=path[_0xba33('0x5a')](_0xe435a4,_0x2697fd);var _0x369cb3=util[_0xba33('0x4b')]('transcript-%d-%s.zip',_0x18b54a[_0xba33('0x3a')]['id'],_0x2697fd);var _0x44adcf=path[_0xba33('0x5a')](_0xe435a4,_0x369cb3);var _0x5d2d9f=[];_0x5d2d9f[_0xba33('0x5d')]({'model':db[_0xba33('0x5e')],'as':_0xba33('0x5e'),'attributes':['id','fullname'],'raw':!![]});_0x5d2d9f['push']({'model':db['CmContact'],'as':_0xba33('0x5f'),'attributes':['id','firstName',_0xba33('0x60')],'raw':!![]});if(_0x18b54a[_0xba33('0x2e')][_0xba33('0x5c')]){_0x5d2d9f[_0xba33('0x5d')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x2f86dd=[{'model':db[_0xba33('0x3d')],'as':'Messages','attributes':['id',_0xba33('0x39'),_0xba33('0x61'),_0xba33('0x62'),_0xba33('0x63'),'read'],'include':_0x5d2d9f}];_0x2f86dd['push']({'model':db[_0xba33('0x64')],'as':_0xba33('0x65'),'attributes':['id',_0xba33('0x22')]});_0x2f86dd[_0xba33('0x5d')]({'model':db[_0xba33('0x5e')],'as':_0xba33('0x66'),'attributes':['id',_0xba33('0x67')]});return db['WhatsappInteraction'][_0xba33('0x3b')]({'where':{'id':_0x18b54a[_0xba33('0x3a')]['id']},'include':_0x2f86dd})[_0xba33('0x1e')](handleEntityNotFound(_0x3fd579,null))[_0xba33('0x1e')](function(_0x1254c8){if(_0x1254c8){var _0xa96287=_0x1254c8[_0xba33('0x68')]({'plain':!![]});fs['mkdirSync'](_0x9f285);var _0xb8efc1={'channel':'Whatsapp','account':_0xa96287[_0xba33('0x65')][_0xba33('0x22')],'agent':_0xa96287[_0xba33('0x66')]?_0xa96287['Owner'][_0xba33('0x67')]:_0xba33('0x69'),'createdAt':moment(_0xa96287[_0xba33('0x61')])[_0xba33('0x4b')](_0xba33('0x4c'))[_0xba33('0x56')](),'closedAt':_0xa96287[_0xba33('0x6a')]?moment(_0xa96287['closedAt'])['format'](_0xba33('0x4c'))['toString']():'','disposition':_0xa96287[_0xba33('0x6b')],'messages':_(_0xa96287['Messages'])[_0xba33('0x49')]({'secret':![]})[_0xba33('0x24')](function(_0x3e60c6){if(_0x3e60c6[_0xba33('0x6c')]){var _0x4f0931=path['join'](_0x32af03,_0x3e60c6[_0xba33('0x6c')]['basename']);if(fs[_0xba33('0x6d')](_0x4f0931)){fs[_0xba33('0x6e')](_0x4f0931)['pipe'](fs[_0xba33('0x6f')](path[_0xba33('0x5a')](_0x9f285,_0x3e60c6[_0xba33('0x6c')]['basename'])));}}return{'date':moment(_0x3e60c6['createdAt'])[_0xba33('0x4b')](_0xba33('0x4c'))[_0xba33('0x56')](),'sender':_0x3e60c6[_0xba33('0x62')]===_0xba33('0x70')?_0x3e60c6['User']?_0x3e60c6[_0xba33('0x5e')][_0xba33('0x67')]:_0xba33('0x71'):_0x3e60c6[_0xba33('0x5f')][_0xba33('0x72')]+(_0x3e60c6['Contact'][_0xba33('0x60')]?'\x20'+_0x3e60c6[_0xba33('0x5f')][_0xba33('0x60')]:''),'body':_0x3e60c6[_0xba33('0x6c')]?_0x3e60c6[_0xba33('0x6c')][_0xba33('0x73')]:_0x3e60c6[_0xba33('0x39')],'direction':_0x3e60c6[_0xba33('0x62')]===_0xba33('0x70')?'A':'C','secret':_0x3e60c6[_0xba33('0x63')],'read':_0x3e60c6[_0xba33('0x74')],'attachment':_0x3e60c6[_0xba33('0x6c')]};})[_0xba33('0x75')]()};return ejs[_0xba33('0x76')](path[_0xba33('0x5a')](config[_0xba33('0x57')],_0xba33('0x58'),_0xba33('0x77'),_0xba33('0x78')),{'interaction':_0xb8efc1})[_0xba33('0x1e')](function(_0x3129e4){var _0x3c4cb5=path[_0xba33('0x5a')](_0x9f285,_0xba33('0x79')+_0xa96287['id']+'-'+_0x2697fd+'.pdf');var _0x213a90={'path':_0x3c4cb5,'channel':_0xba33('0x7a'),'interactionId':_0xa96287['id']};return pdf[_0xba33('0x7b')](_0x3129e4,_0x213a90);})[_0xba33('0x1e')](function(){return new BPromise(function(_0x3da591,_0x564ca1){zipdir(_0x9f285,{'saveTo':_0x44adcf},function(_0xda98a6,_0x28cd1e){if(_0xda98a6)return _0x564ca1(_0xda98a6);return _0x3da591(_0x28cd1e);});})['then'](function(){return new BPromise(function(_0x49c8f4,_0x170f09){rimraf(_0x9f285,function(_0x143f89){if(_0x143f89)_0x170f09(_0x143f89);return _0x49c8f4();});});})['then'](function(){return _0x3fd579['download'](_0x44adcf,_0x369cb3,function(_0x7c5276){if(_0x7c5276){console['log'](_0xba33('0x7c'),_0x7c5276);}else{fs[_0xba33('0x7d')](_0x44adcf);}});});});}else{return _0x3fd579[_0xba33('0x13')](0xc8);}})[_0xba33('0x2c')](handleError(_0x3fd579,null));}; \ No newline at end of file +var _0x03e9=['setTags','omit','spread','Tag','findAll','color','emit','whatsappInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition','existsSync','createReadStream','basename','direction','out','System','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','status','json','offset','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','index','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','whatsapp','query','user','catch','params','model','keys','intersection','attributes','fields','length','include','merge','create','body','find','describe','WhatsappMessage','addMessage','ids','getMessages','findOne','filters','nolimit','limit','sort','where','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags'];(function(_0x555e88,_0x2c4080){var _0x2143d7=function(_0x4ecc9a){while(--_0x4ecc9a){_0x555e88['push'](_0x555e88['shift']());}};_0x2143d7(++_0x2c4080);}(_0x03e9,0x13f));var _0x903e=function(_0x56f622,_0x1c6221){_0x56f622=_0x56f622-0x0;var _0x4873dc=_0x03e9[_0x56f622];return _0x4873dc;};'use strict';var rimraf=require(_0x903e('0x0'));var zipdir=require(_0x903e('0x1'));var moment=require('moment');var BPromise=require(_0x903e('0x2'));var util=require(_0x903e('0x3'));var path=require(_0x903e('0x4'));var ejs=require(_0x903e('0x5'));var fs=require('fs');var _=require(_0x903e('0x6'));var Redis=require(_0x903e('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x903e('0x8'));var pdf=require(_0x903e('0x9'));var logger=require(_0x903e('0xa'))(_0x903e('0xb'));var config=require(_0x903e('0xc'));var db=require(_0x903e('0xd'))['db'];config[_0x903e('0xe')]=_[_0x903e('0xf')](config['redis'],{'host':_0x903e('0x10'),'port':0x18eb});var socket=require(_0x903e('0x11'))(new Redis(config[_0x903e('0xe')]));require(_0x903e('0x12'))['register'](socket);function respondWithStatusCode(_0x270222,_0x5e7235){_0x5e7235=_0x5e7235||0xcc;return function(_0x2632af){if(_0x2632af){return _0x270222['sendStatus'](_0x5e7235);}return _0x270222[_0x903e('0x13')](_0x5e7235)['end']();};}function respondWithResult(_0x3b2ed4,_0x34573e){_0x34573e=_0x34573e||0xc8;return function(_0x523b34){if(_0x523b34){return _0x3b2ed4[_0x903e('0x13')](_0x34573e)[_0x903e('0x14')](_0x523b34);}};}function respondWithFilteredResult(_0x1ff9a4,_0x34fd15){return function(_0x168af3){if(_0x168af3){var _0x5c9c43=typeof _0x34fd15[_0x903e('0x15')]==='undefined'&&typeof _0x34fd15['limit']==='undefined';var _0xc55d6a=_0x168af3[_0x903e('0x16')];var _0x2d492d=_0x5c9c43?0x0:_0x34fd15[_0x903e('0x15')];var _0x2b62f0=_0x5c9c43?_0x168af3[_0x903e('0x16')]:_0x34fd15['offset']+_0x34fd15['limit'];var _0x1ec775;if(_0x2b62f0>=_0xc55d6a){_0x2b62f0=_0xc55d6a;_0x1ec775=0xc8;}else{_0x1ec775=0xce;}_0x1ff9a4[_0x903e('0x13')](_0x1ec775);return _0x1ff9a4[_0x903e('0x17')](_0x903e('0x18'),_0x2d492d+'-'+_0x2b62f0+'/'+_0xc55d6a)[_0x903e('0x14')](_0x168af3);}return null;};}function saveUpdates(_0x8b8e36){return function(_0x121d5a){if(_0x121d5a){return _0x121d5a[_0x903e('0x19')](_0x8b8e36)[_0x903e('0x1a')](function(_0x4ea776){return _0x4ea776;});}return null;};}function removeEntity(_0x250602){return function(_0x372641){if(_0x372641){return _0x372641[_0x903e('0x1b')]()['then'](function(){_0x250602[_0x903e('0x13')](0xcc)[_0x903e('0x1c')]();});}};}function handleEntityNotFound(_0x206b16){return function(_0x504025){if(!_0x504025){_0x206b16[_0x903e('0x1d')](0x194);}return _0x504025;};}function handleError(_0x539fbf,_0x4e7e0e){_0x4e7e0e=_0x4e7e0e||0x1f4;return function(_0x3e9756){logger[_0x903e('0x1e')](_0x3e9756[_0x903e('0x1f')]);if(_0x3e9756[_0x903e('0x20')]){delete _0x3e9756[_0x903e('0x20')];}_0x539fbf['status'](_0x4e7e0e)['send'](_0x3e9756);};}exports[_0x903e('0x21')]=function(_0x2ca311,_0x1083c5){var _0x578276={};var _0x4df371=_['map'](db[_0x903e('0x22')][_0x903e('0x23')],function(_0x532d24){return{'name':_0x532d24[_0x903e('0x24')],'type':_0x532d24[_0x903e('0x25')][_0x903e('0x26')]};});_0x578276=qs[_0x903e('0x27')](_0x4df371,_0x2ca311);return interaction['findAll'](_0x903e('0x28'),_0x2ca311[_0x903e('0x29')],_0x2ca311[_0x903e('0x2a')],_0x578276,_0x4df371)['then'](respondWithFilteredResult(_0x1083c5,_0x578276))[_0x903e('0x2b')](handleError(_0x1083c5,null));};exports['show']=function(_0x3f6587,_0x4abd28){var _0xb4e297={'raw':![],'where':{'id':_0x3f6587[_0x903e('0x2c')]['id']}},_0x19651d={};_0x19651d[_0x903e('0x2d')]=_[_0x903e('0x2e')](db[_0x903e('0x22')][_0x903e('0x23')]);_0x19651d[_0x903e('0x29')]=_[_0x903e('0x2e')](_0x3f6587['query']);_0x19651d['filters']=_[_0x903e('0x2f')](_0x19651d['model'],_0x19651d[_0x903e('0x29')]);_0xb4e297[_0x903e('0x30')]=_[_0x903e('0x2f')](_0x19651d[_0x903e('0x2d')],qs[_0x903e('0x31')](_0x3f6587[_0x903e('0x29')][_0x903e('0x31')]));_0xb4e297[_0x903e('0x30')]=_0xb4e297[_0x903e('0x30')][_0x903e('0x32')]?_0xb4e297[_0x903e('0x30')]:_0x19651d['model'];if(_0x3f6587[_0x903e('0x29')]['includeAll']){_0xb4e297[_0x903e('0x33')]=[{'all':!![]}];}_0xb4e297=_[_0x903e('0x34')]({},_0xb4e297,_0x3f6587['options']);return db[_0x903e('0x22')]['find'](_0xb4e297)[_0x903e('0x1a')](handleEntityNotFound(_0x4abd28,null))['then'](respondWithResult(_0x4abd28,null))[_0x903e('0x2b')](handleError(_0x4abd28,null));};exports[_0x903e('0x35')]=function(_0x4f0192,_0x5aa600){return db[_0x903e('0x22')]['create'](_0x4f0192[_0x903e('0x36')],{})[_0x903e('0x1a')](respondWithResult(_0x5aa600,0xc9))[_0x903e('0x2b')](handleError(_0x5aa600,null));};exports[_0x903e('0x19')]=function(_0x5ebf3c,_0x255c97){if(_0x5ebf3c[_0x903e('0x36')]['id']){delete _0x5ebf3c['body']['id'];}return db[_0x903e('0x22')][_0x903e('0x37')]({'where':{'id':_0x5ebf3c[_0x903e('0x2c')]['id']}})[_0x903e('0x1a')](handleEntityNotFound(_0x255c97,null))[_0x903e('0x1a')](saveUpdates(_0x5ebf3c['body'],null))[_0x903e('0x1a')](respondWithResult(_0x255c97,null))[_0x903e('0x2b')](handleError(_0x255c97,null));};exports[_0x903e('0x1b')]=function(_0xd1924a,_0x1d78ac){return db[_0x903e('0x22')][_0x903e('0x37')]({'where':{'id':_0xd1924a[_0x903e('0x2c')]['id']}})[_0x903e('0x1a')](handleEntityNotFound(_0x1d78ac,null))[_0x903e('0x1a')](removeEntity(_0x1d78ac,null))[_0x903e('0x2b')](handleError(_0x1d78ac,null));};exports[_0x903e('0x38')]=function(_0x4c2d27,_0x5202f3){return db[_0x903e('0x22')][_0x903e('0x38')]()[_0x903e('0x1a')](respondWithResult(_0x5202f3,null))['catch'](handleError(_0x5202f3,null));};exports['addMessage']=function(_0x2c5a11,_0x3256ef){return db[_0x903e('0x39')][_0x903e('0x37')]({'where':{'id':_0x2c5a11[_0x903e('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3256ef,null))[_0x903e('0x1a')](function(_0x459907){if(_0x459907){return _0x459907[_0x903e('0x3a')](_0x2c5a11[_0x903e('0x36')][_0x903e('0x3b')],_['omit'](_0x2c5a11[_0x903e('0x36')],[_0x903e('0x3b'),'id'])||{});}})[_0x903e('0x1a')](respondWithResult(_0x3256ef,null))[_0x903e('0x2b')](handleError(_0x3256ef,null));};exports[_0x903e('0x3c')]=function(_0x20db3f,_0x4e3adf){var _0x4e9ba9={'raw':![],'where':{}};var _0xed66e6={};var _0x565835={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x903e('0x3d')]({'where':{'id':_0x20db3f[_0x903e('0x2c')]['id']}})[_0x903e('0x1a')](handleEntityNotFound(_0x4e3adf,null))[_0x903e('0x1a')](function(_0x2d6ee3){if(_0x2d6ee3){_0xed66e6[_0x903e('0x2d')]=_[_0x903e('0x2e')](db[_0x903e('0x39')][_0x903e('0x23')]);_0xed66e6[_0x903e('0x29')]=_[_0x903e('0x2e')](_0x20db3f[_0x903e('0x29')]);_0xed66e6[_0x903e('0x3e')]=_[_0x903e('0x2f')](_0xed66e6['model'],_0xed66e6[_0x903e('0x29')]);_0x4e9ba9[_0x903e('0x30')]=_['intersection'](_0xed66e6['model'],qs['fields'](_0x20db3f[_0x903e('0x29')][_0x903e('0x31')]));_0x4e9ba9[_0x903e('0x30')]=_0x4e9ba9[_0x903e('0x30')]['length']?_0x4e9ba9[_0x903e('0x30')]:_0xed66e6[_0x903e('0x2d')];if(!_0x20db3f[_0x903e('0x29')]['hasOwnProperty'](_0x903e('0x3f'))){_0x4e9ba9['limit']=qs[_0x903e('0x40')](_0x20db3f[_0x903e('0x29')][_0x903e('0x40')]);_0x4e9ba9[_0x903e('0x15')]=qs[_0x903e('0x15')](_0x20db3f['query'][_0x903e('0x15')]);}_0x4e9ba9['order']=qs[_0x903e('0x41')](_0x20db3f['query'][_0x903e('0x41')]);_0x4e9ba9[_0x903e('0x42')]=qs[_0x903e('0x3e')](_['pick'](_0x20db3f['query'],_0xed66e6[_0x903e('0x3e')]));_0x4e9ba9[_0x903e('0x42')][_0x903e('0x43')]=_0x2d6ee3['id'];if(_0x20db3f[_0x903e('0x29')][_0x903e('0x44')]){_0x4e9ba9[_0x903e('0x42')]=_['merge'](_0x4e9ba9[_0x903e('0x42')],{'$or':_[_0x903e('0x45')](_0x4e9ba9[_0x903e('0x30')],function(_0x1c20ed){var _0x5e330c={};_0x5e330c[_0x1c20ed]={'$like':'%'+_0x20db3f[_0x903e('0x29')][_0x903e('0x44')]+'%'};return _0x5e330c;})});}if(_0x20db3f['query'][_0x903e('0x46')]){var _0x48a275=_0x20db3f['query'][_0x903e('0x46')][_0x903e('0x47')](',');var _0x2498f7={};_0x2498f7[_0x48a275[0x0]]={'$gte':moment(_0x48a275[0x1])[_0x903e('0x48')](_0x903e('0x49'))};_0x4e9ba9[_0x903e('0x42')]=_[_0x903e('0x34')](_0x4e9ba9[_0x903e('0x42')],_0x2498f7);}_0x4e9ba9=_[_0x903e('0x34')]({},_0x4e9ba9,_0x20db3f['options']);return db[_0x903e('0x39')][_0x903e('0x16')]({'where':_0x4e9ba9[_0x903e('0x42')]})[_0x903e('0x1a')](function(_0x416d33){_0x565835[_0x903e('0x16')]=_0x416d33;if(_0x20db3f['query'][_0x903e('0x4a')]){_0x4e9ba9[_0x903e('0x33')]=[{'all':!![]}];}return db[_0x903e('0x39')]['findAll'](_0x4e9ba9);})[_0x903e('0x1a')](function(_0x1e2dcb){_0x565835[_0x903e('0x4b')]=_0x1e2dcb;return _0x565835;});}})[_0x903e('0x1a')](respondWithFilteredResult(_0x4e3adf,_0x4e9ba9))[_0x903e('0x2b')](handleError(_0x4e3adf,null));};exports[_0x903e('0x4c')]=function(_0x53dcce,_0x306b51){return db[_0x903e('0x22')][_0x903e('0x37')]({'where':{'id':_0x53dcce[_0x903e('0x2c')]['id']}})[_0x903e('0x1a')](handleEntityNotFound(_0x306b51,null))[_0x903e('0x1a')](function(_0x2fb8b0){if(_0x2fb8b0){return _0x2fb8b0[_0x903e('0x4d')](_0x53dcce['body'][_0x903e('0x3b')],_[_0x903e('0x4e')](_0x53dcce[_0x903e('0x36')],[_0x903e('0x3b'),'id'])||{})[_0x903e('0x4f')](function(){return db[_0x903e('0x50')][_0x903e('0x51')]({'attributes':['id',_0x903e('0x20'),_0x903e('0x52')],'where':{'id':_0x53dcce['body'][_0x903e('0x3b')]}});})[_0x903e('0x1a')](function(_0x5412bf){socket[_0x903e('0x53')](_0x903e('0x54'),{'id':Number(_0x53dcce['params']['id']),'tags':_0x5412bf||[]});return{'id':Number(_0x53dcce[_0x903e('0x2c')]['id']),'tags':_0x5412bf||[]};});}})[_0x903e('0x1a')](respondWithResult(_0x306b51,null))[_0x903e('0x2b')](handleError(_0x306b51,null));};exports[_0x903e('0x55')]=function(_0x57ca03,_0x3d9952){return db[_0x903e('0x22')][_0x903e('0x37')]({'where':{'id':_0x57ca03['params']['id']}})[_0x903e('0x1a')](handleEntityNotFound(_0x3d9952,null))['then'](function(_0x52a9b2){if(_0x52a9b2){return _0x52a9b2[_0x903e('0x55')](_0x57ca03[_0x903e('0x29')]['ids']);}})['then'](respondWithStatusCode(_0x3d9952,null))[_0x903e('0x2b')](handleError(_0x3d9952,null));};exports['download']=function(_0x41969f,_0x4d8d45){var _0x235389=moment()[_0x903e('0x56')]()[_0x903e('0x57')]();var _0x2b4ede=path[_0x903e('0x58')](config[_0x903e('0x59')],_0x903e('0x5a'),_0x903e('0x5b'),_0x903e('0x5c'));var _0x2caf08=path[_0x903e('0x58')](config['root'],_0x903e('0x5a'),_0x903e('0x5b'),_0x903e('0x5d'));var _0x4419bc=path['join'](_0x2b4ede,_0x235389);var _0xe263d2=util[_0x903e('0x48')](_0x903e('0x5e'),_0x41969f[_0x903e('0x2c')]['id'],_0x235389);var _0x32b580=path[_0x903e('0x58')](_0x2b4ede,_0xe263d2);var _0x30260b=[];_0x30260b[_0x903e('0x5f')]({'model':db['User'],'as':_0x903e('0x60'),'attributes':['id',_0x903e('0x61')],'raw':!![]});_0x30260b[_0x903e('0x5f')]({'model':db[_0x903e('0x62')],'as':_0x903e('0x63'),'attributes':['id',_0x903e('0x64'),_0x903e('0x65')],'raw':!![]});if(_0x41969f[_0x903e('0x29')][_0x903e('0x5d')]){_0x30260b[_0x903e('0x5f')]({'model':db[_0x903e('0x66')],'as':_0x903e('0x66'),'raw':!![]});}var _0x14ed40=[{'model':db['WhatsappMessage'],'as':_0x903e('0x67'),'attributes':['id',_0x903e('0x36'),_0x903e('0x68'),'direction',_0x903e('0x69'),'read'],'include':_0x30260b}];_0x14ed40[_0x903e('0x5f')]({'model':db[_0x903e('0x6a')],'as':_0x903e('0x6b'),'attributes':['id',_0x903e('0x20')]});_0x14ed40[_0x903e('0x5f')]({'model':db[_0x903e('0x60')],'as':_0x903e('0x6c'),'attributes':['id',_0x903e('0x61')]});return db[_0x903e('0x22')][_0x903e('0x37')]({'where':{'id':_0x41969f[_0x903e('0x2c')]['id']},'include':_0x14ed40})[_0x903e('0x1a')](handleEntityNotFound(_0x4d8d45,null))[_0x903e('0x1a')](function(_0x682b05){if(_0x682b05){var _0x128c3f=_0x682b05[_0x903e('0x6d')]({'plain':!![]});fs[_0x903e('0x6e')](_0x4419bc);var _0x27170f={'channel':_0x903e('0x6f'),'account':_0x128c3f[_0x903e('0x6b')][_0x903e('0x20')],'agent':_0x128c3f['Owner']?_0x128c3f[_0x903e('0x6c')][_0x903e('0x61')]:_0x903e('0x70'),'createdAt':moment(_0x128c3f['createdAt'])[_0x903e('0x48')](_0x903e('0x49'))[_0x903e('0x57')](),'closedAt':_0x128c3f[_0x903e('0x71')]?moment(_0x128c3f[_0x903e('0x72')])['format'](_0x903e('0x49'))[_0x903e('0x57')]():'','disposition':_0x128c3f[_0x903e('0x73')],'messages':_(_0x128c3f[_0x903e('0x67')])[_0x903e('0x44')]({'secret':![]})[_0x903e('0x45')](function(_0xa3bd69){if(_0xa3bd69['Attachment']){var _0x816619=path['join'](_0x2caf08,_0xa3bd69['Attachment']['basename']);if(fs[_0x903e('0x74')](_0x816619)){fs[_0x903e('0x75')](_0x816619)['pipe'](fs['createWriteStream'](path['join'](_0x4419bc,_0xa3bd69[_0x903e('0x66')][_0x903e('0x76')])));}}return{'date':moment(_0xa3bd69[_0x903e('0x68')])[_0x903e('0x48')](_0x903e('0x49'))[_0x903e('0x57')](),'sender':_0xa3bd69[_0x903e('0x77')]===_0x903e('0x78')?_0xa3bd69[_0x903e('0x60')]?_0xa3bd69['User'][_0x903e('0x61')]:_0x903e('0x79'):_0xa3bd69[_0x903e('0x63')][_0x903e('0x64')]+(_0xa3bd69['Contact']['lastName']?'\x20'+_0xa3bd69['Contact']['lastName']:''),'body':_0xa3bd69[_0x903e('0x66')]?_0xa3bd69[_0x903e('0x66')][_0x903e('0x76')]:_0xa3bd69[_0x903e('0x36')],'direction':_0xa3bd69['direction']==='out'?'A':'C','secret':_0xa3bd69[_0x903e('0x69')],'read':_0xa3bd69[_0x903e('0x7a')],'attachment':_0xa3bd69['Attachment']};})[_0x903e('0x7b')]()};return ejs[_0x903e('0x7c')](path['join'](config['root'],_0x903e('0x5a'),_0x903e('0x7d'),_0x903e('0x7e')),{'interaction':_0x27170f})[_0x903e('0x1a')](function(_0x26709b){var _0x3ba7e5=path[_0x903e('0x58')](_0x4419bc,_0x903e('0x7f')+_0x128c3f['id']+'-'+_0x235389+_0x903e('0x80'));var _0x1d6550={'path':_0x3ba7e5,'channel':_0x903e('0x6f'),'interactionId':_0x128c3f['id']};return pdf[_0x903e('0x81')](_0x26709b,_0x1d6550);})['then'](function(){return new BPromise(function(_0x1c1586,_0x5da611){zipdir(_0x4419bc,{'saveTo':_0x32b580},function(_0x2d78ab,_0xc079a4){if(_0x2d78ab)return _0x5da611(_0x2d78ab);return _0x1c1586(_0xc079a4);});})[_0x903e('0x1a')](function(){return new BPromise(function(_0x1f2741,_0x137a6e){rimraf(_0x4419bc,function(_0x2e9da1){if(_0x2e9da1)_0x137a6e(_0x2e9da1);return _0x1f2741();});});})[_0x903e('0x1a')](function(){return _0x4d8d45['download'](_0x32b580,_0xe263d2,function(_0x23875c){if(_0x23875c){console['log'](_0x903e('0x82'),_0x23875c);}else{fs[_0x903e('0x83')](_0x32b580);}});});});}else{return _0x4d8d45[_0x903e('0x1d')](0xc8);}})[_0x903e('0x2b')](handleError(_0x4d8d45,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 79b932f..eb9c068 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 _0x1c8a=['map','findAll','length','emit','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','save','remove','getUsers','then','setDataValue','Users'];(function(_0x536149,_0x1c05e7){var _0x2c01fb=function(_0x10d9e6){while(--_0x10d9e6){_0x536149['push'](_0x536149['shift']());}};_0x2c01fb(++_0x1c05e7);}(_0x1c8a,0x140));var _0xa1c8=function(_0x553808,_0x2ce312){_0x553808=_0x553808-0x0;var _0x17f5cd=_0x1c8a[_0x553808];return _0x17f5cd;};'use strict';var EventEmitter=require(_0xa1c8('0x0'));var WhatsappInteraction=require(_0xa1c8('0x1'))['db'][_0xa1c8('0x2')];var WhatsappMessage=require(_0xa1c8('0x1'))['db'][_0xa1c8('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa1c8('0x4'),'afterUpdate':'update','afterDestroy':_0xa1c8('0x5')};function emitEvent(_0x1cdee0){return function(_0x4668e8,_0x559330,_0x331282){_0x4668e8[_0xa1c8('0x6')]({'attributes':['id'],'raw':!![]})[_0xa1c8('0x7')](function(_0x57d2d4){_0x4668e8[_0xa1c8('0x8')](_0xa1c8('0x9'),_0x57d2d4[_0xa1c8('0xa')](function(_0x4a5d71){return{'id':_0x4a5d71['id']};}));return WhatsappMessage[_0xa1c8('0xb')]({'where':{'WhatsappInteractionId':_0x4668e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa1c8('0x7')](function(_0x6e2ad7){_0x4668e8['setDataValue']('unreadMessages',_0x6e2ad7[_0xa1c8('0xc')]);WhatsappInteractionEvents['emit'](_0x1cdee0+':'+_0x4668e8['id'],_0x4668e8);WhatsappInteractionEvents[_0xa1c8('0xd')](_0x1cdee0,_0x4668e8);_0x331282(null);})['catch'](_0x331282(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xa1c8('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x8696=['map','findAll','then','unreadMessages','length','emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update','setDataValue','Users'];(function(_0x15b450,_0x17f299){var _0x1a9c28=function(_0x1666f6){while(--_0x1666f6){_0x15b450['push'](_0x15b450['shift']());}};_0x1a9c28(++_0x17f299);}(_0x8696,0x143));var _0x6869=function(_0x342348,_0x49eb0a){_0x342348=_0x342348-0x0;var _0x52e34d=_0x8696[_0x342348];return _0x52e34d;};'use strict';var EventEmitter=require(_0x6869('0x0'));var WhatsappInteraction=require(_0x6869('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x6869('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x6869('0x2')](0x0);var events={'afterCreate':_0x6869('0x3'),'afterUpdate':_0x6869('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46c26d){return function(_0x578644,_0x3d847c,_0x45542c){_0x578644['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xa00fe5){_0x578644[_0x6869('0x5')](_0x6869('0x6'),_0xa00fe5[_0x6869('0x7')](function(_0x773daa){return{'id':_0x773daa['id']};}));return WhatsappMessage[_0x6869('0x8')]({'where':{'WhatsappInteractionId':_0x578644['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6869('0x9')](function(_0x594cb1){_0x578644[_0x6869('0x5')](_0x6869('0xa'),_0x594cb1[_0x6869('0xb')]);WhatsappInteractionEvents[_0x6869('0xc')](_0x46c26d+':'+_0x578644['id'],_0x578644);WhatsappInteractionEvents['emit'](_0x46c26d,_0x578644);_0x45542c(null);})['catch'](_0x45542c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x6869('0xd')](e,emitEvent(event));}}module[_0x6869('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 507c68f..c824079 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 _0xae1b=['util','api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x22704a,_0x48adf9){var _0x3c6406=function(_0x31e2c4){while(--_0x31e2c4){_0x22704a['push'](_0x22704a['shift']());}};_0x3c6406(++_0x48adf9);}(_0xae1b,0x96));var _0xbae1=function(_0x31a38b,_0x2c9b1c){_0x31a38b=_0x31a38b-0x0;var _0x5968bb=_0xae1b[_0x31a38b];return _0x5968bb;};'use strict';var _=require('lodash');var util=require(_0xbae1('0x0'));var logger=require('../../config/logger')(_0xbae1('0x1'));var moment=require(_0xbae1('0x2'));var BPromise=require(_0xbae1('0x3'));var rp=require(_0xbae1('0x4'));var fs=require('fs');var path=require(_0xbae1('0x5'));var rimraf=require(_0xbae1('0x6'));var config=require('../../config/environment');var attributes=require(_0xbae1('0x7'));module[_0xbae1('0x8')]=function(_0x5b8d9d,_0x447cd9){return _0x5b8d9d['define'](_0xbae1('0x9'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f0ff5,_0x340ff9,_0x5d81d3){if(_0x3f0ff5[_0xbae1('0xa')](_0xbae1('0xb'))){_0x3f0ff5[_0xbae1('0xc')]=moment()[_0xbae1('0xd')](_0xbae1('0xe'));}_0x5d81d3(null,_0x3f0ff5);}}});}; \ No newline at end of file +var _0x6dad=['moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x138088,_0x24976c){var _0x53270c=function(_0x3ebcf2){while(--_0x3ebcf2){_0x138088['push'](_0x138088['shift']());}};_0x53270c(++_0x24976c);}(_0x6dad,0x77));var _0xd6da=function(_0x36c90a,_0x21c9af){_0x36c90a=_0x36c90a-0x0;var _0x401077=_0x6dad[_0x36c90a];return _0x401077;};'use strict';var _=require(_0xd6da('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd6da('0x1'));var BPromise=require(_0xd6da('0x2'));var rp=require(_0xd6da('0x3'));var fs=require('fs');var path=require(_0xd6da('0x4'));var rimraf=require('rimraf');var config=require(_0xd6da('0x5'));var attributes=require(_0xd6da('0x6'));module[_0xd6da('0x7')]=function(_0x2052ee,_0x3ba6d7){return _0x2052ee[_0xd6da('0x8')](_0xd6da('0x9'),attributes,{'tableName':_0xd6da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x121797,_0x144390,_0x39eda7){if(_0x121797[_0xd6da('0xb')](_0xd6da('0xc'))){_0x121797['closedAt']=moment()[_0xd6da('0xd')](_0xd6da('0xe'));}_0x39eda7(null,_0x121797);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 081758e..8d2f8dc 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 _0x7f49=['redis','defaults','localhost','socket.io-emitter','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateWhatsappInteraction','update','body','options','where','attributes','limit','then','find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2b2341,_0x492d7e){var _0x163e45=function(_0x4dd247){while(--_0x4dd247){_0x2b2341['push'](_0x2b2341['shift']());}};_0x163e45(++_0x492d7e);}(_0x7f49,0x94));var _0x97f4=function(_0x520d52,_0x2c25d4){_0x520d52=_0x520d52-0x0;var _0x19e694=_0x7f49[_0x520d52];return _0x19e694;};'use strict';var _=require('lodash');var util=require(_0x97f4('0x0'));var moment=require(_0x97f4('0x1'));var BPromise=require(_0x97f4('0x2'));var rs=require(_0x97f4('0x3'));var fs=require('fs');var Redis=require(_0x97f4('0x4'));var db=require(_0x97f4('0x5'))['db'];var utils=require(_0x97f4('0x6'));var logger=require(_0x97f4('0x7'))(_0x97f4('0x8'));var config=require(_0x97f4('0x9'));var jayson=require(_0x97f4('0xa'));var client=jayson['client'][_0x97f4('0xb')]({'port':0x232a});config[_0x97f4('0xc')]=_[_0x97f4('0xd')](config['redis'],{'host':_0x97f4('0xe'),'port':0x18eb});var socket=require(_0x97f4('0xf'))(new Redis(config[_0x97f4('0xc')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x5b570f,_0x594124,_0x340d27){return new BPromise(function(_0x5908a2,_0x1afe56){return client[_0x97f4('0x10')](_0x5b570f,_0x340d27)['then'](function(_0x3a7357){logger[_0x97f4('0x11')](_0x97f4('0x12'),_0x594124,_0x97f4('0x13'));logger[_0x97f4('0x14')](_0x97f4('0x15'),_0x594124,_0x97f4('0x13'),JSON[_0x97f4('0x16')](_0x3a7357));if(_0x3a7357[_0x97f4('0x17')]){if(_0x3a7357[_0x97f4('0x17')][_0x97f4('0x18')]===0x1f4){logger[_0x97f4('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x594124,_0x3a7357['error']['message']);return _0x1afe56(_0x3a7357['error'][_0x97f4('0x19')]);}logger[_0x97f4('0x17')](_0x97f4('0x12'),_0x594124,_0x3a7357[_0x97f4('0x17')][_0x97f4('0x19')]);return _0x5908a2(_0x3a7357[_0x97f4('0x17')][_0x97f4('0x19')]);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x594124,_0x97f4('0x13'));_0x5908a2(_0x3a7357['result'][_0x97f4('0x19')]);}})['catch'](function(_0x29718a){logger[_0x97f4('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x594124,_0x29718a);_0x1afe56(_0x29718a);});});}exports[_0x97f4('0x1a')]=function(_0x596a3f){var _0x4d92e9=this;return new Promise(function(_0x40f8ab,_0x5539d5){return db['WhatsappInteraction'][_0x97f4('0x1b')](_0x596a3f[_0x97f4('0x1c')],{'raw':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f['options'][_0x97f4('0x1e')]||null:null,'attributes':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f[_0x97f4('0x1d')][_0x97f4('0x1f')]||null:null,'limit':_0x596a3f[_0x97f4('0x1d')]?_0x596a3f['options'][_0x97f4('0x20')]||null:null})[_0x97f4('0x21')](function(_0x50d5f7){logger[_0x97f4('0x11')]('UpdateWhatsappInteraction',_0x596a3f);logger[_0x97f4('0x14')](_0x97f4('0x1a'),_0x596a3f,JSON['stringify'](_0x50d5f7));_0x40f8ab(_0x50d5f7);})['catch'](function(_0x368d3c){logger[_0x97f4('0x17')]('UpdateWhatsappInteraction',_0x368d3c[_0x97f4('0x19')],_0x596a3f);_0x5539d5(_0x4d92e9[_0x97f4('0x17')](0x1f4,_0x368d3c['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0xcfb2b1){return new Promise(function(_0x40e3a8,_0xf2a6c2){return db['WhatsappInteraction'][_0x97f4('0x22')]({'where':_0xcfb2b1[_0x97f4('0x1d')]?_0xcfb2b1[_0x97f4('0x1d')][_0x97f4('0x1e')]||null:null})['then'](function(_0x44040d){if(_0x44040d){return _0x44040d[_0x97f4('0x23')](_0xcfb2b1[_0x97f4('0x1c')][_0x97f4('0x24')],_[_0x97f4('0x25')](_0xcfb2b1[_0x97f4('0x1c')],[_0x97f4('0x24'),'id'])||{});}})[_0x97f4('0x26')](function(_0x5ebc1b){logger[_0x97f4('0x11')](_0x97f4('0x27'),_0xcfb2b1);logger['debug'](_0x97f4('0x27'),_0xcfb2b1,JSON[_0x97f4('0x16')](_0x5ebc1b));_0x40e3a8(_0x5ebc1b);})['catch'](function(_0x58244e){logger[_0x97f4('0x17')](_0x97f4('0x27'),_0x58244e[_0x97f4('0x19')],_0xcfb2b1);_0xf2a6c2(_this[_0x97f4('0x17')](0x1f4,_0x58244e[_0x97f4('0x19')]));});});}; \ No newline at end of file +var _0xe577=['UpdateWhatsappInteraction','stringify','AddTagsToWhatsappInteraction','find','where','addTags','ids','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','WhatsappInteraction','body','options','attributes','limit','then'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe577,0x167));var _0x7e57=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xe577[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x7e57('0x0'));var util=require('util');var moment=require(_0x7e57('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e57('0x2'));var fs=require('fs');var Redis=require(_0x7e57('0x3'));var db=require(_0x7e57('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7e57('0x5'))(_0x7e57('0x6'));var config=require(_0x7e57('0x7'));var jayson=require(_0x7e57('0x8'));var client=jayson[_0x7e57('0x9')][_0x7e57('0xa')]({'port':0x232a});config[_0x7e57('0xb')]=_[_0x7e57('0xc')](config[_0x7e57('0xb')],{'host':_0x7e57('0xd'),'port':0x18eb});var socket=require(_0x7e57('0xe'))(new Redis(config[_0x7e57('0xb')]));require(_0x7e57('0xf'))['register'](socket);function respondWithRpcPromise(_0x5a1216,_0x3f6072,_0x457818){return new BPromise(function(_0xedf11e,_0x12cafd){return client['request'](_0x5a1216,_0x457818)['then'](function(_0x1e70df){logger[_0x7e57('0x10')](_0x7e57('0x11'),_0x3f6072,_0x7e57('0x12'));logger[_0x7e57('0x13')](_0x7e57('0x14'),_0x3f6072,_0x7e57('0x12'),JSON['stringify'](_0x1e70df));if(_0x1e70df[_0x7e57('0x15')]){if(_0x1e70df[_0x7e57('0x15')][_0x7e57('0x16')]===0x1f4){logger['error'](_0x7e57('0x11'),_0x3f6072,_0x1e70df[_0x7e57('0x15')][_0x7e57('0x17')]);return _0x12cafd(_0x1e70df['error'][_0x7e57('0x17')]);}logger[_0x7e57('0x15')](_0x7e57('0x11'),_0x3f6072,_0x1e70df[_0x7e57('0x15')][_0x7e57('0x17')]);return _0xedf11e(_0x1e70df[_0x7e57('0x15')]['message']);}else{logger[_0x7e57('0x10')](_0x7e57('0x11'),_0x3f6072,_0x7e57('0x12'));_0xedf11e(_0x1e70df['result'][_0x7e57('0x17')]);}})[_0x7e57('0x18')](function(_0x9e7bf8){logger[_0x7e57('0x15')](_0x7e57('0x11'),_0x3f6072,_0x9e7bf8);_0x12cafd(_0x9e7bf8);});});}exports['UpdateWhatsappInteraction']=function(_0x53497b){var _0x2f225c=this;return new Promise(function(_0x35a807,_0x74d0aa){return db[_0x7e57('0x19')]['update'](_0x53497b[_0x7e57('0x1a')],{'raw':_0x53497b[_0x7e57('0x1b')]?_0x53497b[_0x7e57('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53497b['options']?_0x53497b['options']['where']||null:null,'attributes':_0x53497b[_0x7e57('0x1b')]?_0x53497b['options'][_0x7e57('0x1c')]||null:null,'limit':_0x53497b[_0x7e57('0x1b')]?_0x53497b['options'][_0x7e57('0x1d')]||null:null})[_0x7e57('0x1e')](function(_0xbb5633){logger['info']('UpdateWhatsappInteraction',_0x53497b);logger[_0x7e57('0x13')](_0x7e57('0x1f'),_0x53497b,JSON[_0x7e57('0x20')](_0xbb5633));_0x35a807(_0xbb5633);})['catch'](function(_0x2d079c){logger['error'](_0x7e57('0x1f'),_0x2d079c[_0x7e57('0x17')],_0x53497b);_0x74d0aa(_0x2f225c[_0x7e57('0x15')](0x1f4,_0x2d079c[_0x7e57('0x17')]));});});};exports[_0x7e57('0x21')]=function(_0x361aa0){return new Promise(function(_0x28ec05,_0x19ce31){return db['WhatsappInteraction'][_0x7e57('0x22')]({'where':_0x361aa0[_0x7e57('0x1b')]?_0x361aa0[_0x7e57('0x1b')][_0x7e57('0x23')]||null:null})[_0x7e57('0x1e')](function(_0x5e18c8){if(_0x5e18c8){return _0x5e18c8[_0x7e57('0x24')](_0x361aa0['body'][_0x7e57('0x25')],_['omit'](_0x361aa0[_0x7e57('0x1a')],[_0x7e57('0x25'),'id'])||{});}})['spread'](function(_0x2fd052){logger[_0x7e57('0x10')](_0x7e57('0x26'),_0x361aa0);logger[_0x7e57('0x13')](_0x7e57('0x26'),_0x361aa0,JSON[_0x7e57('0x20')](_0x2fd052));_0x28ec05(_0x2fd052);})['catch'](function(_0x1cffa1){logger[_0x7e57('0x15')](_0x7e57('0x26'),_0x1cffa1['message'],_0x361aa0);_0x19ce31(_this[_0x7e57('0x15')](0x1f4,_0x1cffa1[_0x7e57('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index a879397..3777248 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 _0x7d90=['register','length','whatsappInteraction:','./whatsappInteraction.events','emit'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x7d90,0x13e));var _0x07d9=function(_0x4ef28d,_0x4e1cfb){_0x4ef28d=_0x4ef28d-0x0;var _0x498b67=_0x7d90[_0x4ef28d];return _0x498b67;};'use strict';var WhatsappInteractionEvents=require(_0x07d9('0x0'));var events=['save','remove','update'];function createListener(_0x28adc8,_0x4df263){return function(_0x1d517b){_0x4df263[_0x07d9('0x1')](_0x28adc8,_0x1d517b);};}function removeListener(_0x18e10e,_0x469b80){return function(){WhatsappInteractionEvents['removeListener'](_0x18e10e,_0x469b80);};}exports[_0x07d9('0x2')]=function(_0x735ef1){for(var _0x27a83c=0x0,_0x5ee9a3=events[_0x07d9('0x3')];_0x27a83c<_0x5ee9a3;_0x27a83c++){var _0x5938d6=events[_0x27a83c];var _0x21fbdc=createListener(_0x07d9('0x4')+_0x5938d6,_0x735ef1);WhatsappInteractionEvents['on'](_0x5938d6,_0x21fbdc);}}; \ No newline at end of file +var _0xe3a5=['remove','update','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x4ee9ec,_0x1af482){var _0x59ee18=function(_0x2a7b4b){while(--_0x2a7b4b){_0x4ee9ec['push'](_0x4ee9ec['shift']());}};_0x59ee18(++_0x1af482);}(_0xe3a5,0x1ef));var _0x5e3a=function(_0x19df01,_0x92e857){_0x19df01=_0x19df01-0x0;var _0x3f8137=_0xe3a5[_0x19df01];return _0x3f8137;};'use strict';var WhatsappInteractionEvents=require(_0x5e3a('0x0'));var events=[_0x5e3a('0x1'),_0x5e3a('0x2'),_0x5e3a('0x3')];function createListener(_0x192680,_0x54e42b){return function(_0x1af9a5){_0x54e42b['emit'](_0x192680,_0x1af9a5);};}function removeListener(_0x467d0e,_0x58c88f){return function(){WhatsappInteractionEvents[_0x5e3a('0x4')](_0x467d0e,_0x58c88f);};}exports['register']=function(_0x4f141c){for(var _0x499f8d=0x0,_0x47bebd=events[_0x5e3a('0x5')];_0x499f8d<_0x47bebd;_0x499f8d++){var _0x218dd6=events[_0x499f8d];var _0x10ade1=createListener(_0x5e3a('0x6')+_0x218dd6,_0x4f141c);WhatsappInteractionEvents['on'](_0x218dd6,_0x10ade1);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 5f9047c..b404f45 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 _0x0cdb=['tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','show','post'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0x0cdb,0xbc));var _0xb0cd=function(_0x5adfa9,_0x4b835d){_0x5adfa9=_0x5adfa9-0x0;var _0x458f41=_0x0cdb[_0x5adfa9];return _0x458f41;};'use strict';var multer=require(_0xb0cd('0x0'));var util=require(_0xb0cd('0x1'));var path=require(_0xb0cd('0x2'));var timeout=require(_0xb0cd('0x3'));var express=require(_0xb0cd('0x4'));var router=express[_0xb0cd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb0cd('0x6'));var interaction=require(_0xb0cd('0x7'));var config=require(_0xb0cd('0x8'));var controller=require('./whatsappMessage.controller');router['get']('/',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0xa')]);router[_0xb0cd('0xb')]('/describe',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0xc')]);router[_0xb0cd('0xb')]('/:id',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0xd')]);router[_0xb0cd('0xe')]('/',auth[_0xb0cd('0x9')](),interaction[_0xb0cd('0xf')](_0xb0cd('0x10'),_0xb0cd('0x11')),controller[_0xb0cd('0x12')]);router['post'](_0xb0cd('0x13'),controller['status']);router[_0xb0cd('0x14')](_0xb0cd('0x15'),auth[_0xb0cd('0x9')](),controller[_0xb0cd('0x16')]);router[_0xb0cd('0x14')](_0xb0cd('0x17'),auth[_0xb0cd('0x9')](),controller[_0xb0cd('0x18')]);router[_0xb0cd('0x14')](_0xb0cd('0x19'),auth[_0xb0cd('0x9')](),controller['reject']);router[_0xb0cd('0x1a')]('/:id',auth[_0xb0cd('0x9')](),controller[_0xb0cd('0x1b')]);module[_0xb0cd('0x1c')]=router; \ No newline at end of file +var _0x13ea=['tracked','whatsapp','whatsappmessage:create','/:id/status','status','update','put','/:id/accept','accept','/:id/reject','reject','delete','/:id','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x3cb465,_0x36d920){var _0x4e197b=function(_0x25fd7d){while(--_0x25fd7d){_0x3cb465['push'](_0x3cb465['shift']());}};_0x4e197b(++_0x36d920);}(_0x13ea,0x11c));var _0xa13e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x13ea[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0xa13e('0x0'));var util=require(_0xa13e('0x1'));var path=require(_0xa13e('0x2'));var timeout=require(_0xa13e('0x3'));var express=require(_0xa13e('0x4'));var router=express['Router']();var fs_extra=require(_0xa13e('0x5'));var auth=require(_0xa13e('0x6'));var interaction=require(_0xa13e('0x7'));var config=require(_0xa13e('0x8'));var controller=require(_0xa13e('0x9'));router[_0xa13e('0xa')]('/',auth[_0xa13e('0xb')](),controller[_0xa13e('0xc')]);router['get'](_0xa13e('0xd'),auth[_0xa13e('0xb')](),controller[_0xa13e('0xe')]);router[_0xa13e('0xa')]('/:id',auth[_0xa13e('0xb')](),controller[_0xa13e('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa13e('0x10')](_0xa13e('0x11'),_0xa13e('0x12')),controller['create']);router['post'](_0xa13e('0x13'),controller[_0xa13e('0x14')]);router['put']('/:id',auth[_0xa13e('0xb')](),controller[_0xa13e('0x15')]);router[_0xa13e('0x16')](_0xa13e('0x17'),auth[_0xa13e('0xb')](),controller[_0xa13e('0x18')]);router[_0xa13e('0x16')](_0xa13e('0x19'),auth[_0xa13e('0xb')](),controller[_0xa13e('0x1a')]);router[_0xa13e('0x1b')](_0xa13e('0x1c'),auth[_0xa13e('0xb')](),controller['destroy']);module[_0xa13e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index da9c67e..4737553 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 _0x92e0=['ENUM','out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x92e0,0x154));var _0x092e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x92e0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x092e('0x0'));module['exports']={'body':{'type':Sequelize[_0x092e('0x1')](_0x092e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x092e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x092e('0x4')]('in',_0x092e('0x5')),'defaultValue':_0x092e('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x092e('0x6')](0xbe)},'phone':{'type':Sequelize[_0x092e('0x6')]},'readAt':{'type':Sequelize[_0x092e('0x7')]},'secret':{'type':Sequelize[_0x092e('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xffc1=['ENUM','out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x42fe9c,_0x8ea8df){var _0xe8737f=function(_0x14c22c){while(--_0x14c22c){_0x42fe9c['push'](_0x42fe9c['shift']());}};_0xe8737f(++_0x8ea8df);}(_0xffc1,0x1b4));var _0x1ffc=function(_0x36f13f,_0x3b653d){_0x36f13f=_0x36f13f-0x0;var _0x554e71=_0xffc1[_0x36f13f];return _0x554e71;};'use strict';var Sequelize=require(_0x1ffc('0x0'));module['exports']={'body':{'type':Sequelize[_0x1ffc('0x1')](_0x1ffc('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1ffc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1ffc('0x4')]('in',_0x1ffc('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x1ffc('0x6')]},'readAt':{'type':Sequelize[_0x1ffc('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1ffc('0x6')]},'providerResponse':{'type':Sequelize[_0x1ffc('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 929a145..0696bc0 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 _0x25bf=['reject','RejectMessage','SELECT','interface','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappMessage.socket','jayson/promise','http','client','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','stack','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','length','nolimit','order','sort','filters','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','fields','find','body','describe','../../config/logger','accept','whatsapp','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0x25bf,0x91));var _0xf25b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x25bf[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf25b('0x0'));var zipdir=require(_0xf25b('0x1'));var jsonpatch=require(_0xf25b('0x2'));var rp=require('request-promise');var moment=require(_0xf25b('0x3'));var BPromise=require(_0xf25b('0x4'));var Mustache=require('mustache');var util=require(_0xf25b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf25b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf25b('0x7'));var squel=require('squel');var crypto=require(_0xf25b('0x8'));var jsforce=require(_0xf25b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xf25b('0x6'));var querystring=require(_0xf25b('0xa'));var Papa=require(_0xf25b('0xb'));var Redis=require(_0xf25b('0xc'));var authService=require(_0xf25b('0xd'));var qs=require(_0xf25b('0xe'));var as=require(_0xf25b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf25b('0x10'))['db'];config[_0xf25b('0x11')]=_['defaults'](config[_0xf25b('0x11')],{'host':_0xf25b('0x12'),'port':0x18eb});var socket=require(_0xf25b('0x13'))(new Redis(config[_0xf25b('0x11')]));require(_0xf25b('0x14'))['register'](socket);var jayson=require(_0xf25b('0x15'));var client=jayson['client'][_0xf25b('0x16')]({'port':0x232c});var client9002=jayson[_0xf25b('0x17')][_0xf25b('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x3b5ff1,_0x3b6e19,_0x4f5f50,_0x339465){return new BPromise(function(_0x2385ea,_0x3cae0a){var _0x276889=_0x339465||client;return _0x276889['request'](_0x3b5ff1,_0x4f5f50)[_0xf25b('0x18')](function(_0x5cc2ba){logger[_0xf25b('0x19')](_0xf25b('0x1a'),_0x3b6e19,_0xf25b('0x1b'));logger[_0xf25b('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x3b6e19,_0xf25b('0x1b'),JSON[_0xf25b('0x1d')](_0x5cc2ba));if(_0x5cc2ba[_0xf25b('0x1e')]){if(_0x5cc2ba['error'][_0xf25b('0x1f')]===0x1f4){logger[_0xf25b('0x1e')](_0xf25b('0x1a'),_0x3b6e19,_0x5cc2ba[_0xf25b('0x1e')][_0xf25b('0x20')]);return _0x3cae0a(_0x5cc2ba[_0xf25b('0x1e')][_0xf25b('0x20')]);}logger[_0xf25b('0x1e')]('WhatsappMessage,\x20%s,\x20%s',_0x3b6e19,_0x5cc2ba[_0xf25b('0x1e')]['message']);return _0x2385ea(_0x5cc2ba[_0xf25b('0x1e')][_0xf25b('0x20')]);}else{logger['info'](_0xf25b('0x1a'),_0x3b6e19,_0xf25b('0x1b'));_0x2385ea(_0x5cc2ba[_0xf25b('0x21')][_0xf25b('0x20')]);}})[_0xf25b('0x22')](function(_0x2d73b6){logger[_0xf25b('0x1e')](_0xf25b('0x1a'),_0x3b6e19,_0x2d73b6);_0x3cae0a(_0x2d73b6);});});}function respondWithStatusCode(_0x1a6f46,_0xd4a55a){_0xd4a55a=_0xd4a55a||0xcc;return function(_0x45cc2a){if(_0x45cc2a){return _0x1a6f46[_0xf25b('0x23')](_0xd4a55a);}return _0x1a6f46[_0xf25b('0x24')](_0xd4a55a)[_0xf25b('0x25')]();};}function respondWithResult(_0x545231,_0x2d4d0c){_0x2d4d0c=_0x2d4d0c||0xc8;return function(_0x3f780d){if(_0x3f780d){return _0x545231[_0xf25b('0x24')](_0x2d4d0c)[_0xf25b('0x26')](_0x3f780d);}};}function respondWithFilteredResult(_0x5d1155,_0x5633e6){return function(_0x4236d4){if(_0x4236d4){var _0x33d2a6=typeof _0x5633e6[_0xf25b('0x27')]===_0xf25b('0x28')&&typeof _0x5633e6[_0xf25b('0x29')]===_0xf25b('0x28');var _0x108246=_0x4236d4[_0xf25b('0x2a')];var _0x25bbb5=_0x33d2a6?0x0:_0x5633e6[_0xf25b('0x27')];var _0x181f62=_0x33d2a6?_0x4236d4[_0xf25b('0x2a')]:_0x5633e6['offset']+_0x5633e6[_0xf25b('0x29')];var _0x9519cc;if(_0x181f62>=_0x108246){_0x181f62=_0x108246;_0x9519cc=0xc8;}else{_0x9519cc=0xce;}_0x5d1155[_0xf25b('0x24')](_0x9519cc);return _0x5d1155['set'](_0xf25b('0x2b'),_0x25bbb5+'-'+_0x181f62+'/'+_0x108246)[_0xf25b('0x26')](_0x4236d4);}return null;};}function patchUpdates(_0x18a003){return function(_0x5299fc){try{jsonpatch['apply'](_0x5299fc,_0x18a003,!![]);}catch(_0x3f7e19){return BPromise['reject'](_0x3f7e19);}return _0x5299fc[_0xf25b('0x2c')]();};}function saveUpdates(_0x198cdd,_0x5dfc4e){return function(_0x36c031){if(_0x36c031){return _0x36c031[_0xf25b('0x2d')](_0x198cdd)[_0xf25b('0x18')](function(_0x55b056){return _0x55b056;});}return null;};}function removeEntity(_0x5537da,_0x1ad584){return function(_0x5401d0){if(_0x5401d0){return _0x5401d0[_0xf25b('0x2e')]()[_0xf25b('0x18')](function(){_0x5537da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cbe97,_0x3a7497){return function(_0xde6e9b){if(!_0xde6e9b){_0x5cbe97['sendStatus'](0x194);}return _0xde6e9b;};}function handleError(_0x529fc4,_0x2d1149){_0x2d1149=_0x2d1149||0x1f4;return function(_0xb1e6ce){logger[_0xf25b('0x1e')](_0xb1e6ce[_0xf25b('0x2f')]);if(_0xb1e6ce['name']){delete _0xb1e6ce['name'];}_0x529fc4['status'](_0x2d1149)['send'](_0xb1e6ce);};}exports['index']=function(_0x3d1852,_0x284917){var _0x10befa={},_0x13fffc={},_0x1282a6={'count':0x0,'rows':[]};var _0x2da9c9=_[_0xf25b('0x30')](db[_0xf25b('0x31')][_0xf25b('0x32')],function(_0x5b2847){return{'name':_0x5b2847[_0xf25b('0x33')],'type':_0x5b2847[_0xf25b('0x34')][_0xf25b('0x35')]};});_0x13fffc[_0xf25b('0x36')]=_[_0xf25b('0x30')](_0x2da9c9,_0xf25b('0x37'));_0x13fffc[_0xf25b('0x38')]=_[_0xf25b('0x39')](_0x3d1852['query']);_0x13fffc['filters']=_[_0xf25b('0x3a')](_0x13fffc[_0xf25b('0x36')],_0x13fffc[_0xf25b('0x38')]);_0x10befa[_0xf25b('0x3b')]=_[_0xf25b('0x3a')](_0x13fffc[_0xf25b('0x36')],qs['fields'](_0x3d1852[_0xf25b('0x38')]['fields']));_0x10befa[_0xf25b('0x3b')]=_0x10befa[_0xf25b('0x3b')][_0xf25b('0x3c')]?_0x10befa[_0xf25b('0x3b')]:_0x13fffc[_0xf25b('0x36')];if(!_0x3d1852['query']['hasOwnProperty'](_0xf25b('0x3d'))){_0x10befa[_0xf25b('0x29')]=qs[_0xf25b('0x29')](_0x3d1852['query']['limit']);_0x10befa['offset']=qs['offset'](_0x3d1852[_0xf25b('0x38')][_0xf25b('0x27')]);}_0x10befa[_0xf25b('0x3e')]=qs[_0xf25b('0x3f')](_0x3d1852[_0xf25b('0x38')][_0xf25b('0x3f')]);_0x10befa['where']=qs[_0xf25b('0x40')](_[_0xf25b('0x41')](_0x3d1852['query'],_0x13fffc[_0xf25b('0x40')]),_0x2da9c9);if(_0x3d1852[_0xf25b('0x38')][_0xf25b('0x42')]){_0x10befa['where']=_[_0xf25b('0x43')](_0x10befa[_0xf25b('0x44')],{'$or':_['map'](_0x2da9c9,function(_0x119f4c){if(_0x119f4c[_0xf25b('0x34')]!=='VIRTUAL'){var _0x286990={};_0x286990[_0x119f4c[_0xf25b('0x37')]]={'$like':'%'+_0x3d1852['query'][_0xf25b('0x42')]+'%'};return _0x286990;}})});}_0x10befa=_[_0xf25b('0x43')]({},_0x10befa,_0x3d1852[_0xf25b('0x45')]);var _0x1c25cf={'where':_0x10befa[_0xf25b('0x44')]};return db[_0xf25b('0x31')][_0xf25b('0x2a')](_0x1c25cf)['then'](function(_0x4d8887){_0x1282a6['count']=_0x4d8887;if(_0x3d1852[_0xf25b('0x38')][_0xf25b('0x46')]){_0x10befa[_0xf25b('0x47')]=[{'all':!![]}];}return db[_0xf25b('0x31')][_0xf25b('0x48')](_0x10befa);})[_0xf25b('0x18')](function(_0x25a584){_0x1282a6[_0xf25b('0x49')]=_0x25a584;return _0x1282a6;})['then'](respondWithFilteredResult(_0x284917,_0x10befa))[_0xf25b('0x22')](handleError(_0x284917,null));};exports[_0xf25b('0x4a')]=function(_0x3a9d0c,_0x31aa5a){var _0x305bfe={'raw':!![],'where':{'id':_0x3a9d0c[_0xf25b('0x4b')]['id']}},_0x208c94={};_0x208c94[_0xf25b('0x36')]=_[_0xf25b('0x39')](db[_0xf25b('0x31')]['rawAttributes']);_0x208c94['query']=_[_0xf25b('0x39')](_0x3a9d0c[_0xf25b('0x38')]);_0x208c94[_0xf25b('0x40')]=_[_0xf25b('0x3a')](_0x208c94['model'],_0x208c94[_0xf25b('0x38')]);_0x305bfe[_0xf25b('0x3b')]=_[_0xf25b('0x3a')](_0x208c94[_0xf25b('0x36')],qs[_0xf25b('0x4c')](_0x3a9d0c[_0xf25b('0x38')][_0xf25b('0x4c')]));_0x305bfe[_0xf25b('0x3b')]=_0x305bfe[_0xf25b('0x3b')]['length']?_0x305bfe['attributes']:_0x208c94[_0xf25b('0x36')];if(_0x3a9d0c[_0xf25b('0x38')]['includeAll']){_0x305bfe['include']=[{'all':!![]}];}_0x305bfe=_[_0xf25b('0x43')]({},_0x305bfe,_0x3a9d0c[_0xf25b('0x45')]);return db[_0xf25b('0x31')][_0xf25b('0x4d')](_0x305bfe)[_0xf25b('0x18')](handleEntityNotFound(_0x31aa5a,null))['then'](respondWithResult(_0x31aa5a,null))[_0xf25b('0x22')](handleError(_0x31aa5a,null));};exports['create']=function(_0x4a1833,_0x18e5ce){return db[_0xf25b('0x31')]['create'](_0x4a1833[_0xf25b('0x4e')],{})[_0xf25b('0x18')](respondWithResult(_0x18e5ce,0xc9))['catch'](handleError(_0x18e5ce,null));};exports['update']=function(_0x5d8355,_0x31f5ad){if(_0x5d8355['body']['id']){delete _0x5d8355[_0xf25b('0x4e')]['id'];}return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x5d8355['params']['id']}})[_0xf25b('0x18')](handleEntityNotFound(_0x31f5ad,null))['then'](saveUpdates(_0x5d8355[_0xf25b('0x4e')],null))[_0xf25b('0x18')](respondWithResult(_0x31f5ad,null))[_0xf25b('0x22')](handleError(_0x31f5ad,null));};exports['destroy']=function(_0x40332a,_0x40d829){return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x40332a[_0xf25b('0x4b')]['id']}})[_0xf25b('0x18')](handleEntityNotFound(_0x40d829,null))['then'](removeEntity(_0x40d829,null))[_0xf25b('0x22')](handleError(_0x40d829,null));};exports[_0xf25b('0x4f')]=function(_0x5db884,_0x59e22e){return db[_0xf25b('0x31')][_0xf25b('0x4f')]()[_0xf25b('0x18')](respondWithResult(_0x59e22e,null))[_0xf25b('0x22')](handleError(_0x59e22e,null));};var interaction_log=require(_0xf25b('0x50'))('whatsapp-interactions');exports[_0xf25b('0x51')]=function(_0x38e085,_0x2df5dd,_0x1c7ce6){var _0x4da744={'agent':{},'channel':_0xf25b('0x52')};if(_0x38e085[_0xf25b('0x4e')]['id']){delete _0x38e085[_0xf25b('0x4e')]['id'];}_0x38e085[_0xf25b('0x4e')]['read']=!![];_0x38e085[_0xf25b('0x4e')][_0xf25b('0x53')]=moment()[_0xf25b('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')]=_0x38e085['body'][_0xf25b('0x55')]||_0x38e085[_0xf25b('0x56')]['id'];_0x4da744[_0xf25b('0x57')]['id']=_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')];return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x38e085['params']['id'],'UserId':null}})[_0xf25b('0x18')](handleEntityNotFound(_0x2df5dd,null))[_0xf25b('0x18')](saveUpdates(_0x38e085[_0xf25b('0x4e')],null))[_0xf25b('0x18')](function(_0x9d47cc){if(_0x9d47cc){_0x4da744[_0xf25b('0x20')]=_0x9d47cc[_0xf25b('0x58')]({'plain':!![]});return db[_0xf25b('0x59')][_0xf25b('0x4d')]({'where':{'id':_0x9d47cc[_0xf25b('0x5a')]}});}return null;})[_0xf25b('0x18')](handleEntityNotFound(_0x2df5dd,null))[_0xf25b('0x18')](function(_0x4660f7){if(_0x4660f7){return _0x4660f7['update']({'UserId':_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')],'read1stAt':_['isNil'](_0x4660f7[_0xf25b('0x5b')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xf25b('0x18')](function(_0x1b5745){if(_0x1b5745){_0x4da744[_0xf25b('0x5c')]=_0x1b5745[_0xf25b('0x58')]({'plain':!![]});interaction_log['info'](_0xf25b('0x5d'),_0x38e085[_0xf25b('0x56')]['id'],_0x38e085['user'][_0xf25b('0x37')],_0x38e085[_0xf25b('0x56')][_0xf25b('0x5e')],_0x4da744[_0xf25b('0x5c')]['id'],_0x38e085[_0xf25b('0x4e')]?JSON[_0xf25b('0x1d')](_0x38e085[_0xf25b('0x4e')]):_0xf25b('0x5f'));return respondWithRpcPromise(_0xf25b('0x60'),_0xf25b('0x61'),_0x4da744);}return null;})[_0xf25b('0x18')](function(_0x29c011){var _0xa2c69a=_0xf25b('0x62')+_0x29c011['message'][_0xf25b('0x63')];return db[_0xf25b('0x64')][_0xf25b('0x38')](_0xa2c69a,{'type':db[_0xf25b('0x65')][_0xf25b('0x66')]['SELECT'],'raw':!![]})['then'](function(_0x53ee18){return _0x53ee18;});})['then'](function(_0x32a011){if(_0x32a011){_0x4da744[_0xf25b('0x20')][_0xf25b('0x67')]=_0x32a011[0x0];if(!_0x38e085['body'][_0xf25b('0x55')])return;return db[_0xf25b('0x68')][_0xf25b('0x4d')]({'where':{'id':_0x38e085[_0xf25b('0x4e')][_0xf25b('0x55')],'role':'agent'},'attributes':['id',_0xf25b('0x37'),'fullname',_0xf25b('0x69'),_0xf25b('0x6a')],'raw':!![]});}return null;})[_0xf25b('0x18')](function(_0x53c9af){if(!_0x53c9af)return null;_0x4da744[_0xf25b('0x20')][_0xf25b('0x57')]=_0x53c9af;return _0x4da744;})[_0xf25b('0x18')](function(_0x438865){if(_0x438865){if(_0x38e085[_0xf25b('0x4e')][_0xf25b('0x6b')]){_0x4da744[_0xf25b('0x20')]['interface']=util[_0xf25b('0x54')](_0xf25b('0x6c'),_0x38e085[_0xf25b('0x56')][_0xf25b('0x37')]);_0x4da744[_0xf25b('0x20')][_0xf25b('0x6d')]=_0x4da744[_0xf25b('0x6d')];_0x4da744['message'][_0xf25b('0x6e')]=_0x4da744[_0xf25b('0x6d')];_0x4da744[_0xf25b('0x20')][_0xf25b('0x6f')]=_0xf25b('0x51');return respondWithRpcPromise('EventManager',_0xf25b('0x70'),{'event':_0xf25b('0x71'),'message':_0x4da744['message']},client9002)['then'](function(){return _0x4da744;});}return _0x4da744;}return null;})[_0xf25b('0x18')](respondWithResult(_0x2df5dd,null))[_0xf25b('0x22')](handleError(_0x2df5dd,null));};var interaction_log=require(_0xf25b('0x50'))(_0xf25b('0x72'));exports[_0xf25b('0x73')]=function(_0x139325,_0x2bfee9,_0x30a529){var _0x16bde2={'agent':{},'channel':_0xf25b('0x52')};if(_0x139325[_0xf25b('0x4e')]['id']){delete _0x139325[_0xf25b('0x4e')]['id'];}_0x139325['body'][_0xf25b('0x55')]=_0x139325[_0xf25b('0x4e')]['UserId']||_0x139325[_0xf25b('0x56')]['id'];_0x16bde2['agent']['id']=_0x139325[_0xf25b('0x4e')]['UserId'];return db[_0xf25b('0x31')]['find']({'where':{'id':_0x139325[_0xf25b('0x4b')]['id'],'UserId':null}})[_0xf25b('0x18')](handleEntityNotFound(_0x2bfee9,null))['then'](function(_0x2d6329){if(_0x2d6329){_0x16bde2[_0xf25b('0x20')]=_0x2d6329[_0xf25b('0x58')]({'plain':!![]});return db[_0xf25b('0x59')]['find']({'where':{'id':_0x2d6329[_0xf25b('0x5a')]}});}return null;})['then'](handleEntityNotFound(_0x2bfee9,null))['then'](function(_0xeb5b35){if(_0xeb5b35){_0x16bde2[_0xf25b('0x5c')]=_0xeb5b35[_0xf25b('0x58')]({'plain':!![]});interaction_log[_0xf25b('0x19')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x139325[_0xf25b('0x56')]['id'],_0x139325['user'][_0xf25b('0x37')],_0x139325[_0xf25b('0x56')]['role'],_0x16bde2[_0xf25b('0x5c')]['id'],_0x139325[_0xf25b('0x4e')]?JSON['stringify'](_0x139325[_0xf25b('0x4e')]):'null');return respondWithRpcPromise(_0xf25b('0x74'),'rejectMessage',_0x16bde2);}return null;})[_0xf25b('0x18')](function(_0x1495f7){var _0x5b37c9=_0xf25b('0x62')+_0x1495f7[_0xf25b('0x20')][_0xf25b('0x63')];return db[_0xf25b('0x64')][_0xf25b('0x38')](_0x5b37c9,{'type':db['Sequelize'][_0xf25b('0x66')][_0xf25b('0x75')],'raw':!![]})[_0xf25b('0x18')](function(_0x26714f){return _0x26714f;});})[_0xf25b('0x18')](function(_0x286d9b){if(_0x286d9b){_0x16bde2[_0xf25b('0x20')][_0xf25b('0x67')]=_0x286d9b[0x0];if(!_0x139325[_0xf25b('0x4e')]['UserId'])return;return db[_0xf25b('0x68')][_0xf25b('0x4d')]({'where':{'id':_0x139325['body']['UserId'],'role':_0xf25b('0x57')},'attributes':['id',_0xf25b('0x37'),'fullname','email',_0xf25b('0x6a')],'raw':!![]});}return null;})[_0xf25b('0x18')](function(_0x1350fa){if(!_0x1350fa)return null;_0x16bde2[_0xf25b('0x20')][_0xf25b('0x57')]=_0x1350fa;return _0x16bde2;})['then'](function(_0x2d09bb){if(_0x2d09bb){_0x2d09bb[_0xf25b('0x20')][_0xf25b('0x76')]=util[_0xf25b('0x54')](_0xf25b('0x6c'),_0x139325['user'][_0xf25b('0x37')]);_0x2d09bb['message'][_0xf25b('0x6d')]=_0x16bde2[_0xf25b('0x6d')];_0x2d09bb[_0xf25b('0x20')][_0xf25b('0x6e')]=_0x16bde2[_0xf25b('0x6d')];_0x2d09bb[_0xf25b('0x20')][_0xf25b('0x6f')]='reject';respondWithRpcPromise(_0xf25b('0x70'),'EventManager',{'event':_0xf25b('0x77'),'message':_0x2d09bb['message']},client9002);return _0x16bde2;}return null;})[_0xf25b('0x18')](respondWithResult(_0x2bfee9,null))['catch'](handleError(_0x2bfee9,null));};exports[_0xf25b('0x24')]=function(_0x2e44dc,_0x4c86f2,_0x3e0344){if(_0x2e44dc[_0xf25b('0x4e')]['id']){delete _0x2e44dc[_0xf25b('0x4e')]['id'];}var _0x5731b6;return db[_0xf25b('0x31')][_0xf25b('0x4d')]({'where':{'id':_0x2e44dc['params']['id']}})[_0xf25b('0x18')](handleEntityNotFound(_0x4c86f2,null))[_0xf25b('0x18')](function(_0x50fd5f){if(_0x50fd5f){_0x5731b6=_0x50fd5f;return db[_0xf25b('0x78')][_0xf25b('0x4d')]({'where':{'id':_0x50fd5f[_0xf25b('0x79')]}});}})[_0xf25b('0x18')](handleEntityNotFound(_0x4c86f2,null))['then'](function(_0x1c58e6){if(_0x1c58e6){logger[_0xf25b('0x1c')](_0xf25b('0x7a'),'status',_0xf25b('0x7b'),_0x1c58e6[_0xf25b('0x34')],util[_0xf25b('0x7c')](_0x2e44dc[_0xf25b('0x4e')],{'showHidden':![],'depth':null}));switch(_0x1c58e6[_0xf25b('0x34')]){case _0xf25b('0x7d'):if(_0x2e44dc[_0xf25b('0x4e')][_0xf25b('0x7e')]&&_0x2e44dc[_0xf25b('0x4e')][_0xf25b('0x7e')]===_0x5731b6['messageId']&&_0x2e44dc[_0xf25b('0x4e')]['MessageStatus']&&_0x2e44dc[_0xf25b('0x4e')][_0xf25b('0x7f')]===_0xf25b('0x80')){return _0x5731b6[_0xf25b('0x2d')]({'read':!![]});}else{logger[_0xf25b('0x1e')](_0xf25b('0x81'),'status',_0xf25b('0x7d'),util[_0xf25b('0x7c')](_0x2e44dc['body'],{'showHidden':![],'depth':null}));}break;}return _0x5731b6;}})[_0xf25b('0x18')](respondWithResult(_0x4c86f2,null))[_0xf25b('0x22')](handleError(_0x4c86f2,null));}; \ No newline at end of file +var _0x6da6=['accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','role','null','acceptMessage','ContactId','Sequelize','SELECT','contact','fullname','email','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','User','internal','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','twilio','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','client','http','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','sendStatus','stack','name','send','index','map','WhatsappMessage','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','create','body','params','describe','whatsapp-interactions'];(function(_0x54381d,_0x247b2c){var _0x5308a7=function(_0x3ef056){while(--_0x3ef056){_0x54381d['push'](_0x54381d['shift']());}};_0x5308a7(++_0x247b2c);}(_0x6da6,0xbf));var _0x66da=function(_0xc4f906,_0x2076b0){_0xc4f906=_0xc4f906-0x0;var _0xed62b8=_0x6da6[_0xc4f906];return _0xed62b8;};'use strict';var emlformat=require(_0x66da('0x0'));var rimraf=require(_0x66da('0x1'));var zipdir=require(_0x66da('0x2'));var jsonpatch=require(_0x66da('0x3'));var rp=require(_0x66da('0x4'));var moment=require(_0x66da('0x5'));var BPromise=require(_0x66da('0x6'));var Mustache=require(_0x66da('0x7'));var util=require(_0x66da('0x8'));var path=require('path');var sox=require(_0x66da('0x9'));var csv=require(_0x66da('0xa'));var ejs=require(_0x66da('0xb'));var fs=require('fs');var fs_extra=require(_0x66da('0xc'));var _=require(_0x66da('0xd'));var squel=require(_0x66da('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x66da('0xf'));var toCsv=require('to-csv');var querystring=require(_0x66da('0x10'));var Papa=require(_0x66da('0x11'));var Redis=require('ioredis');var authService=require(_0x66da('0x12'));var qs=require(_0x66da('0x13'));var as=require(_0x66da('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x66da('0x15'))('api');var utils=require(_0x66da('0x16'));var config=require(_0x66da('0x17'));var licenseUtil=require(_0x66da('0x18'));var db=require(_0x66da('0x19'))['db'];config[_0x66da('0x1a')]=_[_0x66da('0x1b')](config['redis'],{'host':_0x66da('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66da('0x1a')]));require(_0x66da('0x1d'))[_0x66da('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x66da('0x1f')][_0x66da('0x20')]({'port':0x232c});var client9002=jayson[_0x66da('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2221,_0x517b39,_0xc22ed6,_0x5406cb){return new BPromise(function(_0x4c49d6,_0x389138){var _0x448b08=_0x5406cb||client;return _0x448b08['request'](_0x1b2221,_0xc22ed6)['then'](function(_0x12aa77){logger[_0x66da('0x21')](_0x66da('0x22'),_0x517b39,_0x66da('0x23'));logger[_0x66da('0x24')](_0x66da('0x25'),_0x517b39,_0x66da('0x23'),JSON[_0x66da('0x26')](_0x12aa77));if(_0x12aa77['error']){if(_0x12aa77[_0x66da('0x27')][_0x66da('0x28')]===0x1f4){logger['error'](_0x66da('0x22'),_0x517b39,_0x12aa77[_0x66da('0x27')][_0x66da('0x29')]);return _0x389138(_0x12aa77['error'][_0x66da('0x29')]);}logger['error'](_0x66da('0x22'),_0x517b39,_0x12aa77[_0x66da('0x27')][_0x66da('0x29')]);return _0x4c49d6(_0x12aa77['error']['message']);}else{logger[_0x66da('0x21')]('WhatsappMessage,\x20%s,\x20%s',_0x517b39,_0x66da('0x23'));_0x4c49d6(_0x12aa77[_0x66da('0x2a')]['message']);}})[_0x66da('0x2b')](function(_0x1412e2){logger['error'](_0x66da('0x22'),_0x517b39,_0x1412e2);_0x389138(_0x1412e2);});});}function respondWithStatusCode(_0x26304f,_0x1ee23b){_0x1ee23b=_0x1ee23b||0xcc;return function(_0x16b8c0){if(_0x16b8c0){return _0x26304f['sendStatus'](_0x1ee23b);}return _0x26304f[_0x66da('0x2c')](_0x1ee23b)[_0x66da('0x2d')]();};}function respondWithResult(_0x53d9a9,_0x9a5885){_0x9a5885=_0x9a5885||0xc8;return function(_0x3e11a7){if(_0x3e11a7){return _0x53d9a9[_0x66da('0x2c')](_0x9a5885)[_0x66da('0x2e')](_0x3e11a7);}};}function respondWithFilteredResult(_0x508570,_0x470f86){return function(_0x392ee4){if(_0x392ee4){var _0x1bccbd=typeof _0x470f86[_0x66da('0x2f')]===_0x66da('0x30')&&typeof _0x470f86[_0x66da('0x31')]===_0x66da('0x30');var _0x5769f1=_0x392ee4[_0x66da('0x32')];var _0x460483=_0x1bccbd?0x0:_0x470f86[_0x66da('0x2f')];var _0x3460f3=_0x1bccbd?_0x392ee4[_0x66da('0x32')]:_0x470f86[_0x66da('0x2f')]+_0x470f86['limit'];var _0xa12d2b;if(_0x3460f3>=_0x5769f1){_0x3460f3=_0x5769f1;_0xa12d2b=0xc8;}else{_0xa12d2b=0xce;}_0x508570[_0x66da('0x2c')](_0xa12d2b);return _0x508570[_0x66da('0x33')](_0x66da('0x34'),_0x460483+'-'+_0x3460f3+'/'+_0x5769f1)[_0x66da('0x2e')](_0x392ee4);}return null;};}function patchUpdates(_0x186f6c){return function(_0x8350d1){try{jsonpatch[_0x66da('0x35')](_0x8350d1,_0x186f6c,!![]);}catch(_0x14ebe3){return BPromise[_0x66da('0x36')](_0x14ebe3);}return _0x8350d1['save']();};}function saveUpdates(_0x4eef8d,_0x437d08){return function(_0xf1afd9){if(_0xf1afd9){return _0xf1afd9[_0x66da('0x37')](_0x4eef8d)['then'](function(_0x40a6db){return _0x40a6db;});}return null;};}function removeEntity(_0x2ee22c,_0x38d771){return function(_0x5144e1){if(_0x5144e1){return _0x5144e1[_0x66da('0x38')]()[_0x66da('0x39')](function(){_0x2ee22c[_0x66da('0x2c')](0xcc)[_0x66da('0x2d')]();});}};}function handleEntityNotFound(_0x4654ae,_0x50d507){return function(_0x8e43db){if(!_0x8e43db){_0x4654ae[_0x66da('0x3a')](0x194);}return _0x8e43db;};}function handleError(_0x2f910f,_0x24b132){_0x24b132=_0x24b132||0x1f4;return function(_0x3c308f){logger[_0x66da('0x27')](_0x3c308f[_0x66da('0x3b')]);if(_0x3c308f['name']){delete _0x3c308f[_0x66da('0x3c')];}_0x2f910f['status'](_0x24b132)[_0x66da('0x3d')](_0x3c308f);};}exports[_0x66da('0x3e')]=function(_0x2b84e0,_0x5f36ff){var _0x59f2f5={},_0x3270f3={},_0x4d2d0d={'count':0x0,'rows':[]};var _0x551444=_[_0x66da('0x3f')](db[_0x66da('0x40')]['rawAttributes'],function(_0x477bae){return{'name':_0x477bae['fieldName'],'type':_0x477bae[_0x66da('0x41')][_0x66da('0x42')]};});_0x3270f3[_0x66da('0x43')]=_[_0x66da('0x3f')](_0x551444,_0x66da('0x3c'));_0x3270f3[_0x66da('0x44')]=_['keys'](_0x2b84e0[_0x66da('0x44')]);_0x3270f3[_0x66da('0x45')]=_['intersection'](_0x3270f3[_0x66da('0x43')],_0x3270f3['query']);_0x59f2f5[_0x66da('0x46')]=_[_0x66da('0x47')](_0x3270f3[_0x66da('0x43')],qs['fields'](_0x2b84e0[_0x66da('0x44')][_0x66da('0x48')]));_0x59f2f5[_0x66da('0x46')]=_0x59f2f5[_0x66da('0x46')][_0x66da('0x49')]?_0x59f2f5[_0x66da('0x46')]:_0x3270f3['model'];if(!_0x2b84e0[_0x66da('0x44')][_0x66da('0x4a')](_0x66da('0x4b'))){_0x59f2f5['limit']=qs[_0x66da('0x31')](_0x2b84e0[_0x66da('0x44')][_0x66da('0x31')]);_0x59f2f5[_0x66da('0x2f')]=qs[_0x66da('0x2f')](_0x2b84e0[_0x66da('0x44')]['offset']);}_0x59f2f5[_0x66da('0x4c')]=qs[_0x66da('0x4d')](_0x2b84e0[_0x66da('0x44')][_0x66da('0x4d')]);_0x59f2f5[_0x66da('0x4e')]=qs[_0x66da('0x45')](_[_0x66da('0x4f')](_0x2b84e0[_0x66da('0x44')],_0x3270f3[_0x66da('0x45')]),_0x551444);if(_0x2b84e0[_0x66da('0x44')][_0x66da('0x50')]){_0x59f2f5['where']=_[_0x66da('0x51')](_0x59f2f5[_0x66da('0x4e')],{'$or':_[_0x66da('0x3f')](_0x551444,function(_0x2e3bc6){if(_0x2e3bc6[_0x66da('0x41')]!==_0x66da('0x52')){var _0x4ac392={};_0x4ac392[_0x2e3bc6[_0x66da('0x3c')]]={'$like':'%'+_0x2b84e0[_0x66da('0x44')][_0x66da('0x50')]+'%'};return _0x4ac392;}})});}_0x59f2f5=_[_0x66da('0x51')]({},_0x59f2f5,_0x2b84e0[_0x66da('0x53')]);var _0x19f991={'where':_0x59f2f5[_0x66da('0x4e')]};return db[_0x66da('0x40')][_0x66da('0x32')](_0x19f991)[_0x66da('0x39')](function(_0x3ac298){_0x4d2d0d[_0x66da('0x32')]=_0x3ac298;if(_0x2b84e0['query'][_0x66da('0x54')]){_0x59f2f5[_0x66da('0x55')]=[{'all':!![]}];}return db[_0x66da('0x40')][_0x66da('0x56')](_0x59f2f5);})['then'](function(_0x30e3d2){_0x4d2d0d[_0x66da('0x57')]=_0x30e3d2;return _0x4d2d0d;})['then'](respondWithFilteredResult(_0x5f36ff,_0x59f2f5))[_0x66da('0x2b')](handleError(_0x5f36ff,null));};exports[_0x66da('0x58')]=function(_0x21f3aa,_0x1cb330){var _0x25a982={'raw':!![],'where':{'id':_0x21f3aa['params']['id']}},_0x297daa={};_0x297daa[_0x66da('0x43')]=_[_0x66da('0x59')](db[_0x66da('0x40')][_0x66da('0x5a')]);_0x297daa[_0x66da('0x44')]=_[_0x66da('0x59')](_0x21f3aa['query']);_0x297daa[_0x66da('0x45')]=_[_0x66da('0x47')](_0x297daa[_0x66da('0x43')],_0x297daa[_0x66da('0x44')]);_0x25a982['attributes']=_[_0x66da('0x47')](_0x297daa['model'],qs[_0x66da('0x48')](_0x21f3aa['query'][_0x66da('0x48')]));_0x25a982['attributes']=_0x25a982[_0x66da('0x46')][_0x66da('0x49')]?_0x25a982[_0x66da('0x46')]:_0x297daa[_0x66da('0x43')];if(_0x21f3aa[_0x66da('0x44')]['includeAll']){_0x25a982[_0x66da('0x55')]=[{'all':!![]}];}_0x25a982=_[_0x66da('0x51')]({},_0x25a982,_0x21f3aa['options']);return db[_0x66da('0x40')][_0x66da('0x5b')](_0x25a982)[_0x66da('0x39')](handleEntityNotFound(_0x1cb330,null))[_0x66da('0x39')](respondWithResult(_0x1cb330,null))['catch'](handleError(_0x1cb330,null));};exports[_0x66da('0x5c')]=function(_0x332cc9,_0x416d60){return db[_0x66da('0x40')][_0x66da('0x5c')](_0x332cc9[_0x66da('0x5d')],{})[_0x66da('0x39')](respondWithResult(_0x416d60,0xc9))['catch'](handleError(_0x416d60,null));};exports[_0x66da('0x37')]=function(_0x4a4cd1,_0x1194c8){if(_0x4a4cd1['body']['id']){delete _0x4a4cd1[_0x66da('0x5d')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x4a4cd1[_0x66da('0x5e')]['id']}})[_0x66da('0x39')](handleEntityNotFound(_0x1194c8,null))[_0x66da('0x39')](saveUpdates(_0x4a4cd1[_0x66da('0x5d')],null))[_0x66da('0x39')](respondWithResult(_0x1194c8,null))[_0x66da('0x2b')](handleError(_0x1194c8,null));};exports[_0x66da('0x38')]=function(_0x5f224a,_0x51088a){return db['WhatsappMessage'][_0x66da('0x5b')]({'where':{'id':_0x5f224a['params']['id']}})['then'](handleEntityNotFound(_0x51088a,null))[_0x66da('0x39')](removeEntity(_0x51088a,null))[_0x66da('0x2b')](handleError(_0x51088a,null));};exports[_0x66da('0x5f')]=function(_0x43aad8,_0x400ddf){return db[_0x66da('0x40')][_0x66da('0x5f')]()[_0x66da('0x39')](respondWithResult(_0x400ddf,null))[_0x66da('0x2b')](handleError(_0x400ddf,null));};var interaction_log=require(_0x66da('0x15'))(_0x66da('0x60'));exports[_0x66da('0x61')]=function(_0x373646,_0x27eabe,_0x1e2bb0){var _0x4304e0={'agent':{},'channel':_0x66da('0x62')};if(_0x373646[_0x66da('0x5d')]['id']){delete _0x373646['body']['id'];}_0x373646[_0x66da('0x5d')][_0x66da('0x63')]=!![];_0x373646[_0x66da('0x5d')][_0x66da('0x64')]=moment()[_0x66da('0x65')](_0x66da('0x66'));_0x373646[_0x66da('0x5d')][_0x66da('0x67')]=_0x373646[_0x66da('0x5d')][_0x66da('0x67')]||_0x373646[_0x66da('0x68')]['id'];_0x4304e0['agent']['id']=_0x373646[_0x66da('0x5d')][_0x66da('0x67')];return db[_0x66da('0x40')]['find']({'where':{'id':_0x373646[_0x66da('0x5e')]['id'],'UserId':null}})[_0x66da('0x39')](handleEntityNotFound(_0x27eabe,null))[_0x66da('0x39')](saveUpdates(_0x373646[_0x66da('0x5d')],null))['then'](function(_0x3f0c9d){if(_0x3f0c9d){_0x4304e0[_0x66da('0x29')]=_0x3f0c9d[_0x66da('0x69')]({'plain':!![]});return db[_0x66da('0x6a')][_0x66da('0x5b')]({'where':{'id':_0x3f0c9d[_0x66da('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x27eabe,null))[_0x66da('0x39')](function(_0x130aee){if(_0x130aee){return _0x130aee[_0x66da('0x37')]({'UserId':_0x373646['body'][_0x66da('0x67')],'read1stAt':_[_0x66da('0x6c')](_0x130aee[_0x66da('0x6d')])?moment()[_0x66da('0x65')](_0x66da('0x66')):undefined});}return null;})[_0x66da('0x39')](function(_0x2c6547){if(_0x2c6547){_0x4304e0[_0x66da('0x6e')]=_0x2c6547[_0x66da('0x69')]({'plain':!![]});interaction_log[_0x66da('0x21')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x373646[_0x66da('0x68')]['id'],_0x373646[_0x66da('0x68')][_0x66da('0x3c')],_0x373646[_0x66da('0x68')][_0x66da('0x6f')],_0x4304e0[_0x66da('0x6e')]['id'],_0x373646[_0x66da('0x5d')]?JSON['stringify'](_0x373646[_0x66da('0x5d')]):_0x66da('0x70'));return respondWithRpcPromise('AcceptMessage',_0x66da('0x71'),_0x4304e0);}return null;})['then'](function(_0x44cbd2){var _0x390ac3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x44cbd2[_0x66da('0x29')][_0x66da('0x72')];return db['sequelize']['query'](_0x390ac3,{'type':db[_0x66da('0x73')]['QueryTypes'][_0x66da('0x74')],'raw':!![]})[_0x66da('0x39')](function(_0x4ae211){return _0x4ae211;});})['then'](function(_0x58bde2){if(_0x58bde2){_0x4304e0[_0x66da('0x29')][_0x66da('0x75')]=_0x58bde2[0x0];if(!_0x373646[_0x66da('0x5d')][_0x66da('0x67')])return;return db['User'][_0x66da('0x5b')]({'where':{'id':_0x373646[_0x66da('0x5d')][_0x66da('0x67')],'role':'agent'},'attributes':['id','name',_0x66da('0x76'),_0x66da('0x77'),'internal'],'raw':!![]});}return null;})[_0x66da('0x39')](function(_0x1ddf8b){if(!_0x1ddf8b)return null;_0x4304e0[_0x66da('0x29')][_0x66da('0x78')]=_0x1ddf8b;return _0x4304e0;})['then'](function(_0x4d6280){if(_0x4d6280){if(_0x373646[_0x66da('0x5d')][_0x66da('0x79')]){_0x4304e0[_0x66da('0x29')][_0x66da('0x7a')]=util[_0x66da('0x65')](_0x66da('0x7b'),_0x373646[_0x66da('0x68')][_0x66da('0x3c')]);_0x4304e0['message'][_0x66da('0x7c')]=_0x4304e0[_0x66da('0x7c')];_0x4304e0['message'][_0x66da('0x7d')]=_0x4304e0[_0x66da('0x7c')];_0x4304e0[_0x66da('0x29')][_0x66da('0x7e')]='accept';return respondWithRpcPromise(_0x66da('0x7f'),_0x66da('0x7f'),{'event':'acceptmessage','message':_0x4304e0['message']},client9002)[_0x66da('0x39')](function(){return _0x4304e0;});}return _0x4304e0;}return null;})[_0x66da('0x39')](respondWithResult(_0x27eabe,null))['catch'](handleError(_0x27eabe,null));};var interaction_log=require(_0x66da('0x15'))('whatsapp-interactions');exports['reject']=function(_0x13446f,_0xe825d3,_0x27695e){var _0x4c1bb7={'agent':{},'channel':'whatsapp'};if(_0x13446f['body']['id']){delete _0x13446f[_0x66da('0x5d')]['id'];}_0x13446f['body']['UserId']=_0x13446f['body']['UserId']||_0x13446f['user']['id'];_0x4c1bb7[_0x66da('0x78')]['id']=_0x13446f[_0x66da('0x5d')][_0x66da('0x67')];return db[_0x66da('0x40')][_0x66da('0x5b')]({'where':{'id':_0x13446f[_0x66da('0x5e')]['id'],'UserId':null}})[_0x66da('0x39')](handleEntityNotFound(_0xe825d3,null))['then'](function(_0xa8ca){if(_0xa8ca){_0x4c1bb7[_0x66da('0x29')]=_0xa8ca[_0x66da('0x69')]({'plain':!![]});return db[_0x66da('0x6a')][_0x66da('0x5b')]({'where':{'id':_0xa8ca[_0x66da('0x6b')]}});}return null;})[_0x66da('0x39')](handleEntityNotFound(_0xe825d3,null))[_0x66da('0x39')](function(_0x24f036){if(_0x24f036){_0x4c1bb7[_0x66da('0x6e')]=_0x24f036[_0x66da('0x69')]({'plain':!![]});interaction_log[_0x66da('0x21')](_0x66da('0x80'),_0x13446f['user']['id'],_0x13446f[_0x66da('0x68')][_0x66da('0x3c')],_0x13446f[_0x66da('0x68')]['role'],_0x4c1bb7[_0x66da('0x6e')]['id'],_0x13446f['body']?JSON[_0x66da('0x26')](_0x13446f[_0x66da('0x5d')]):'null');return respondWithRpcPromise('RejectMessage',_0x66da('0x81'),_0x4c1bb7);}return null;})[_0x66da('0x39')](function(_0x3057ce){var _0x165305=_0x66da('0x82')+_0x3057ce[_0x66da('0x29')][_0x66da('0x72')];return db[_0x66da('0x83')][_0x66da('0x44')](_0x165305,{'type':db[_0x66da('0x73')][_0x66da('0x84')][_0x66da('0x74')],'raw':!![]})['then'](function(_0xaf3cd0){return _0xaf3cd0;});})[_0x66da('0x39')](function(_0x37b557){if(_0x37b557){_0x4c1bb7[_0x66da('0x29')][_0x66da('0x75')]=_0x37b557[0x0];if(!_0x13446f[_0x66da('0x5d')][_0x66da('0x67')])return;return db[_0x66da('0x85')][_0x66da('0x5b')]({'where':{'id':_0x13446f['body']['UserId'],'role':_0x66da('0x78')},'attributes':['id',_0x66da('0x3c'),'fullname',_0x66da('0x77'),_0x66da('0x86')],'raw':!![]});}return null;})['then'](function(_0x4b2093){if(!_0x4b2093)return null;_0x4c1bb7[_0x66da('0x29')][_0x66da('0x78')]=_0x4b2093;return _0x4c1bb7;})[_0x66da('0x39')](function(_0xf62e42){if(_0xf62e42){_0xf62e42[_0x66da('0x29')][_0x66da('0x7a')]=util['format'](_0x66da('0x7b'),_0x13446f[_0x66da('0x68')][_0x66da('0x3c')]);_0xf62e42[_0x66da('0x29')][_0x66da('0x7c')]=_0x4c1bb7[_0x66da('0x7c')];_0xf62e42[_0x66da('0x29')]['motionChannel']=_0x4c1bb7[_0x66da('0x7c')];_0xf62e42[_0x66da('0x29')][_0x66da('0x7e')]=_0x66da('0x36');respondWithRpcPromise(_0x66da('0x7f'),'EventManager',{'event':_0x66da('0x87'),'message':_0xf62e42[_0x66da('0x29')]},client9002);return _0x4c1bb7;}return null;})[_0x66da('0x39')](respondWithResult(_0xe825d3,null))[_0x66da('0x2b')](handleError(_0xe825d3,null));};exports[_0x66da('0x2c')]=function(_0x584f4b,_0x25e79c,_0x571869){if(_0x584f4b[_0x66da('0x5d')]['id']){delete _0x584f4b[_0x66da('0x5d')]['id'];}var _0x8d4eb9;return db[_0x66da('0x40')][_0x66da('0x5b')]({'where':{'id':_0x584f4b[_0x66da('0x5e')]['id']}})[_0x66da('0x39')](handleEntityNotFound(_0x25e79c,null))['then'](function(_0x3e7a00){if(_0x3e7a00){_0x8d4eb9=_0x3e7a00;return db[_0x66da('0x88')][_0x66da('0x5b')]({'where':{'id':_0x3e7a00['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x25e79c,null))[_0x66da('0x39')](function(_0x1c3680){if(_0x1c3680){logger[_0x66da('0x24')](_0x66da('0x89'),_0x66da('0x2c'),_0x66da('0x8a'),_0x1c3680['type'],util[_0x66da('0x8b')](_0x584f4b[_0x66da('0x5d')],{'showHidden':![],'depth':null}));switch(_0x1c3680[_0x66da('0x41')]){case'twilio':if(_0x584f4b['body']['MessageSid']&&_0x584f4b[_0x66da('0x5d')][_0x66da('0x8c')]===_0x8d4eb9[_0x66da('0x8d')]&&_0x584f4b[_0x66da('0x5d')]['MessageStatus']&&_0x584f4b[_0x66da('0x5d')][_0x66da('0x8e')]==='read'){return _0x8d4eb9['update']({'read':!![]});}else{logger[_0x66da('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x66da('0x2c'),_0x66da('0x8f'),util[_0x66da('0x8b')](_0x584f4b['body'],{'showHidden':![],'depth':null}));}break;}return _0x8d4eb9;}})[_0x66da('0x39')](respondWithResult(_0x25e79c,null))[_0x66da('0x2b')](handleError(_0x25e79c,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 8010713..7906e06 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 _0x9c00=['emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x470366,_0x51f083){var _0x4987dd=function(_0x4ec213){while(--_0x4ec213){_0x470366['push'](_0x470366['shift']());}};_0x4987dd(++_0x51f083);}(_0x9c00,0x1a0));var _0x09c0=function(_0x5c956b,_0xa87d11){_0x5c956b=_0x5c956b-0x0;var _0xaff46a=_0x9c00[_0x5c956b];return _0xaff46a;};'use strict';var EventEmitter=require(_0x09c0('0x0'));var WhatsappMessage=require(_0x09c0('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x09c0('0x2'),'afterUpdate':_0x09c0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x220c0c){return function(_0x2c702c,_0x2ed715,_0x2fd03e){WhatsappMessageEvents[_0x09c0('0x4')](_0x220c0c+':'+_0x2c702c['id'],_0x2c702c);WhatsappMessageEvents['emit'](_0x220c0c,_0x2c702c);_0x2fd03e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x09c0('0x5')](e,emitEvent(event));}}module[_0x09c0('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x57f8=['emit','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x343901,_0x2619c2){var _0x3e5c88=function(_0xdd6e20){while(--_0xdd6e20){_0x343901['push'](_0x343901['shift']());}};_0x3e5c88(++_0x2619c2);}(_0x57f8,0x198));var _0x857f=function(_0x2bfb31,_0xdd9aae){_0x2bfb31=_0x2bfb31-0x0;var _0x2b00ce=_0x57f8[_0x2bfb31];return _0x2b00ce;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x857f('0x0'))['db'][_0x857f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x857f('0x2')](0x0);var events={'afterCreate':_0x857f('0x3'),'afterUpdate':_0x857f('0x4'),'afterDestroy':_0x857f('0x5')};function emitEvent(_0x2ff336){return function(_0x6f054b,_0x318050,_0xced48e){WhatsappMessageEvents[_0x857f('0x6')](_0x2ff336+':'+_0x6f054b['id'],_0x6f054b);WhatsappMessageEvents[_0x857f('0x6')](_0x2ff336,_0x6f054b);_0xced48e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x857f('0x7')](e,emitEvent(event));}}module[_0x857f('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 e58af6e..9a23619 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 _0xa404=['/messages/','text','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','util','../../config/logger','moment','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','secret','UserId','WhatsappInteraction','WhatsappInteractionId','update','catch','out','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa404,0x159));var _0x4a40=function(_0x4e0e24,_0x5bddc3){_0x4e0e24=_0x4e0e24-0x0;var _0x4847a4=_0xa404[_0x4e0e24];return _0x4847a4;};'use strict';var _=require(_0x4a40('0x0'));var util=require(_0x4a40('0x1'));var logger=require(_0x4a40('0x2'))('api');var moment=require(_0x4a40('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fetch=require(_0x4a40('0x4'));var fs=require('fs');var path=require(_0x4a40('0x5'));var rimraf=require('rimraf');var config=require(_0x4a40('0x6'));var attributes=require(_0x4a40('0x7'));module[_0x4a40('0x8')]=function(_0x44fcae,_0x1be9d0){return _0x44fcae[_0x4a40('0x9')](_0x4a40('0xa'),attributes,{'tableName':_0x4a40('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x4a40('0xc'),'fields':[_0x4a40('0xd')],'type':_0x4a40('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xe0d330,_0x499080,_0x1a61bc){var _0x32181b=_0x44fcae['models'];var _0x29f2d9=_0xe0d330[_0x4a40('0xf')]({'plain':!![]});if(_0x29f2d9[_0x4a40('0x10')][_0x4a40('0x11')]()==='in'||_0x29f2d9[_0x4a40('0x10')][_0x4a40('0x11')]()==='out'&&!_0x29f2d9[_0x4a40('0x12')]&&!_['isNil'](_0x29f2d9[_0x4a40('0x13')])){_0x32181b[_0x4a40('0x14')]['findOne']({'where':{'id':_0x29f2d9[_0x4a40('0x15')]}})['then'](function(_0x11ffec){if(_0x11ffec){_0x11ffec[_0x4a40('0x16')]({'lastMsgAt':_0x29f2d9['createdAt'],'lastMsgDirection':_0x29f2d9['direction'][_0x4a40('0x11')]()});}})[_0x4a40('0x17')](function(_0x1cd9ce){console['error'](_0x1cd9ce);});}if(_0x29f2d9[_0x4a40('0x10')]===_0x4a40('0x18')&&!_0x29f2d9[_0x4a40('0x12')]){var _0x2c20a5;_0x32181b['WhatsappAccount']['find']({'where':{'id':_0x29f2d9[_0x4a40('0x19')]},'raw':!![]})['then'](function(_0x257f77){_0x2c20a5=_0x257f77;if(_0x2c20a5&&_0x2c20a5['type']){switch(_0x2c20a5[_0x4a40('0x1a')]){case _0x4a40('0x1b'):var _0x8e811c=require(_0x4a40('0x1b'));if(_0x2c20a5[_0x4a40('0x1c')]&&_0x2c20a5['authToken']&&_0x2c20a5[_0x4a40('0x1d')]){var _0x49866c=new _0x8e811c(_0x2c20a5[_0x4a40('0x1c')],_0x2c20a5[_0x4a40('0x1e')]);_0x49866c[_0x4a40('0x1f')][_0x4a40('0x20')]({'body':_0x29f2d9[_0x4a40('0xd')],'to':_0x4a40('0x21')+_0x29f2d9[_0x4a40('0x1d')],'from':'whatsapp:'+_0x2c20a5[_0x4a40('0x1d')],'statusCallback':_0x2c20a5[_0x4a40('0x22')]+_0x4a40('0x23')+_0x29f2d9['id']+_0x4a40('0x24')+_0x2c20a5[_0x4a40('0x25')]})[_0x4a40('0x26')](function(_0x3edcf7){if(_0x3edcf7[_0x4a40('0x27')]){return _0xe0d330[_0x4a40('0x16')]({'messageId':_0x3edcf7[_0x4a40('0x27')]});}})[_0x4a40('0x17')](function(_0x2fe056){logger[_0x4a40('0x28')](_0x4a40('0x29'),_0x4a40('0x2a'),_0x4a40('0x1b'),util[_0x4a40('0x2b')](_0x2fe056,{'showHidden':![],'depth':null}));});}else{logger[_0x4a40('0x28')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4a40('0x2a'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x4a40('0x2c'):var _0x31fbe7=_0x2c20a5[_0x4a40('0x1c')];var _0x24de73=_0x2c20a5[_0x4a40('0x1e')];var _0x5d9005=_0x2c20a5[_0x4a40('0x2d')]+_0x4a40('0x2e')+_0x31fbe7+_0x4a40('0x2f');var _0x1fef7e={'to':[_0x29f2d9[_0x4a40('0x1d')]],'message':{'type':_0x4a40('0x30'),'text':_0x29f2d9[_0x4a40('0xd')]}};var _0x33896c={'method':'POST','uri':_0x5d9005,'headers':{'Authorization':_0x4a40('0x31')+_0x24de73,'Content-Type':_0x4a40('0x32')},'body':_0x1fef7e,'json':!![]};rp(_0x33896c)['then'](function(_0x17cef3){if(_0x17cef3[_0x4a40('0x33')][0x0][_0x4a40('0x34')]){return _0xe0d330[_0x4a40('0x16')]({'messageId':_0x17cef3[_0x4a40('0x33')][0x0][_0x4a40('0x34')]});}})[_0x4a40('0x17')](function(_0x5ee268){logger['err'](_0x4a40('0x35'),_0x5ee268);});break;}}})[_0x4a40('0x36')](function(){_0x1a61bc();});}else{_0x1a61bc();}}},'charset':_0x4a40('0x37'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb021=['application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','messageId','fti_whatsapp_messages','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','catch','error','out','WhatsappAccount','find','type','twilio','accountSid','authToken','create','body','whatsapp:','phone','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','baseUrl','POST'];(function(_0x5672c5,_0x209143){var _0x382ddf=function(_0x108f7c){while(--_0x108f7c){_0x5672c5['push'](_0x5672c5['shift']());}};_0x382ddf(++_0x209143);}(_0xb021,0xec));var _0x1b02=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0xb021[_0x31c5e9];return _0x517a8d;};'use strict';var _=require(_0x1b02('0x0'));var util=require(_0x1b02('0x1'));var logger=require(_0x1b02('0x2'))(_0x1b02('0x3'));var moment=require(_0x1b02('0x4'));var BPromise=require(_0x1b02('0x5'));var rp=require('request-promise');var fetch=require(_0x1b02('0x6'));var fs=require('fs');var path=require(_0x1b02('0x7'));var rimraf=require(_0x1b02('0x8'));var config=require(_0x1b02('0x9'));var attributes=require(_0x1b02('0xa'));module[_0x1b02('0xb')]=function(_0x2661ff,_0x416b32){return _0x2661ff[_0x1b02('0xc')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x1b02('0xd'),'fields':[_0x1b02('0xd')]},{'name':_0x1b02('0xe'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b14b1,_0xecc589,_0x23bbff){var _0x528777=_0x2661ff[_0x1b02('0xf')];var _0x1f7ecf=_0x2b14b1[_0x1b02('0x10')]({'plain':!![]});if(_0x1f7ecf[_0x1b02('0x11')][_0x1b02('0x12')]()==='in'||_0x1f7ecf[_0x1b02('0x11')]['toLowerCase']()==='out'&&!_0x1f7ecf[_0x1b02('0x13')]&&!_[_0x1b02('0x14')](_0x1f7ecf[_0x1b02('0x15')])){_0x528777[_0x1b02('0x16')]['findOne']({'where':{'id':_0x1f7ecf[_0x1b02('0x17')]}})[_0x1b02('0x18')](function(_0x2bc146){if(_0x2bc146){_0x2bc146[_0x1b02('0x19')]({'lastMsgAt':_0x1f7ecf[_0x1b02('0x1a')],'lastMsgDirection':_0x1f7ecf[_0x1b02('0x11')][_0x1b02('0x12')]()});}})[_0x1b02('0x1b')](function(_0x5b9214){console[_0x1b02('0x1c')](_0x5b9214);});}if(_0x1f7ecf[_0x1b02('0x11')]===_0x1b02('0x1d')&&!_0x1f7ecf[_0x1b02('0x13')]){var _0x2cf085;_0x528777[_0x1b02('0x1e')][_0x1b02('0x1f')]({'where':{'id':_0x1f7ecf['WhatsappAccountId']},'raw':!![]})[_0x1b02('0x18')](function(_0x560604){_0x2cf085=_0x560604;if(_0x2cf085&&_0x2cf085['type']){switch(_0x2cf085[_0x1b02('0x20')]){case _0x1b02('0x21'):var _0x1036e6=require(_0x1b02('0x21'));if(_0x2cf085[_0x1b02('0x22')]&&_0x2cf085['authToken']&&_0x2cf085['phone']){var _0x1b8eab=new _0x1036e6(_0x2cf085[_0x1b02('0x22')],_0x2cf085[_0x1b02('0x23')]);_0x1b8eab['messages'][_0x1b02('0x24')]({'body':_0x1f7ecf[_0x1b02('0x25')],'to':_0x1b02('0x26')+_0x1f7ecf[_0x1b02('0x27')],'from':'whatsapp:'+_0x2cf085['phone'],'statusCallback':_0x2cf085[_0x1b02('0x28')]+_0x1b02('0x29')+_0x1f7ecf['id']+'/status?token='+_0x2cf085[_0x1b02('0x2a')]})[_0x1b02('0x18')](function(_0x3a60a2){if(_0x3a60a2[_0x1b02('0x2b')]){return _0x2b14b1['update']({'messageId':_0x3a60a2['sid']});}})[_0x1b02('0x1b')](function(_0x424fc8){logger[_0x1b02('0x1c')](_0x1b02('0x2c'),_0x1b02('0x2d'),_0x1b02('0x21'),util[_0x1b02('0x2e')](_0x424fc8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1b02('0x2c'),_0x1b02('0x2d'),_0x1b02('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'sinch':var _0x4300f8=_0x2cf085[_0x1b02('0x22')];var _0x42a6e6=_0x2cf085[_0x1b02('0x23')];var _0x5cf596=_0x2cf085[_0x1b02('0x2f')]+'/whatsapp/v1/'+_0x4300f8+'/messages/';var _0x35c03e={'to':[_0x1f7ecf[_0x1b02('0x27')]],'message':{'type':'text','text':_0x1f7ecf[_0x1b02('0x25')]}};var _0x405c8b={'method':_0x1b02('0x30'),'uri':_0x5cf596,'headers':{'Authorization':'Bearer\x20'+_0x42a6e6,'Content-Type':_0x1b02('0x31')},'body':_0x35c03e,'json':!![]};rp(_0x405c8b)[_0x1b02('0x18')](function(_0x36d9a5){if(_0x36d9a5[_0x1b02('0x32')][0x0][_0x1b02('0x33')]){return _0x2b14b1['update']({'messageId':_0x36d9a5[_0x1b02('0x32')][0x0]['message_id']});}})['catch'](function(_0x51fc4a){logger[_0x1b02('0x34')](_0x1b02('0x35'),_0x51fc4a);});break;}}})[_0x1b02('0x36')](function(){_0x23bbff();});}else{_0x23bbff();}}},'charset':_0x1b02('0x37'),'collate':_0x1b02('0x38')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 8a33fd0..511515a 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 _0xa9bc=['../../config/environment','jayson/promise','client','http','redis','defaults','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','code','error','message','catch','WhatsappMessage','create','body','raw','CreateWhatsappMessage','debug','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x444e1f,_0x48bb7d){var _0x2de7c9=function(_0x463e7e){while(--_0x463e7e){_0x444e1f['push'](_0x444e1f['shift']());}};_0x2de7c9(++_0x48bb7d);}(_0xa9bc,0xcb));var _0xca9b=function(_0x42e0f3,_0x1bbc1a){_0x42e0f3=_0x42e0f3-0x0;var _0x4e2aa4=_0xa9bc[_0x42e0f3];return _0x4e2aa4;};'use strict';var _=require('lodash');var util=require(_0xca9b('0x0'));var moment=require(_0xca9b('0x1'));var BPromise=require('bluebird');var rs=require(_0xca9b('0x2'));var fs=require('fs');var Redis=require(_0xca9b('0x3'));var db=require(_0xca9b('0x4'))['db'];var utils=require(_0xca9b('0x5'));var logger=require('../../config/logger')(_0xca9b('0x6'));var config=require(_0xca9b('0x7'));var jayson=require(_0xca9b('0x8'));var client=jayson[_0xca9b('0x9')][_0xca9b('0xa')]({'port':0x232a});config[_0xca9b('0xb')]=_[_0xca9b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1052f5,_0x2117a8,_0x490939){return new BPromise(function(_0x4da9d2,_0x36f453){return client[_0xca9b('0xd')](_0x1052f5,_0x490939)[_0xca9b('0xe')](function(_0xafd779){logger[_0xca9b('0xf')](_0xca9b('0x10'),_0x2117a8,_0xca9b('0x11'));logger['debug'](_0xca9b('0x12'),_0x2117a8,_0xca9b('0x11'),JSON['stringify'](_0xafd779));if(_0xafd779['error']){if(_0xafd779['error'][_0xca9b('0x13')]===0x1f4){logger[_0xca9b('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x2117a8,_0xafd779['error'][_0xca9b('0x15')]);return _0x36f453(_0xafd779[_0xca9b('0x14')]['message']);}logger[_0xca9b('0x14')](_0xca9b('0x10'),_0x2117a8,_0xafd779[_0xca9b('0x14')][_0xca9b('0x15')]);return _0x4da9d2(_0xafd779['error'][_0xca9b('0x15')]);}else{logger[_0xca9b('0xf')](_0xca9b('0x10'),_0x2117a8,'request\x20sent');_0x4da9d2(_0xafd779['result'][_0xca9b('0x15')]);}})[_0xca9b('0x16')](function(_0x3c90e3){logger[_0xca9b('0x14')](_0xca9b('0x10'),_0x2117a8,_0x3c90e3);_0x36f453(_0x3c90e3);});});}exports['CreateWhatsappMessage']=function(_0x112081){var _0x39ba44=this;return new Promise(function(_0x542fa6,_0x30598b){return db[_0xca9b('0x17')][_0xca9b('0x18')](_0x112081[_0xca9b('0x19')],{'raw':_0x112081['options']?_0x112081['options'][_0xca9b('0x1a')]===undefined?!![]:![]:!![]})[_0xca9b('0xe')](function(_0x427277){logger[_0xca9b('0xf')](_0xca9b('0x1b'),_0x112081);logger[_0xca9b('0x1c')](_0xca9b('0x1b'),_0x112081,JSON[_0xca9b('0x1d')](_0x427277));_0x542fa6(_0x427277);})[_0xca9b('0x16')](function(_0x56c2eb){logger['error']('CreateWhatsappMessage',_0x56c2eb['message'],_0x112081);_0x30598b(_0x39ba44['error'](0x1f4,_0x56c2eb[_0xca9b('0x15')]));});});}; \ No newline at end of file +var _0x1a8f=['../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3f87ce,_0x4abd6c){var _0x8d7035=function(_0x5aa071){while(--_0x5aa071){_0x3f87ce['push'](_0x3f87ce['shift']());}};_0x8d7035(++_0x4abd6c);}(_0x1a8f,0x1a8));var _0xf1a8=function(_0x5a1cf3,_0x161eca){_0x5a1cf3=_0x5a1cf3-0x0;var _0x24d3cc=_0x1a8f[_0x5a1cf3];return _0x24d3cc;};'use strict';var _=require(_0xf1a8('0x0'));var util=require(_0xf1a8('0x1'));var moment=require(_0xf1a8('0x2'));var BPromise=require(_0xf1a8('0x3'));var rs=require(_0xf1a8('0x4'));var fs=require('fs');var Redis=require(_0xf1a8('0x5'));var db=require(_0xf1a8('0x6'))['db'];var utils=require(_0xf1a8('0x7'));var logger=require(_0xf1a8('0x8'))(_0xf1a8('0x9'));var config=require(_0xf1a8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf1a8('0xb')][_0xf1a8('0xc')]({'port':0x232a});config[_0xf1a8('0xd')]=_[_0xf1a8('0xe')](config[_0xf1a8('0xd')],{'host':_0xf1a8('0xf'),'port':0x18eb});var socket=require(_0xf1a8('0x10'))(new Redis(config[_0xf1a8('0xd')]));require(_0xf1a8('0x11'))['register'](socket);function respondWithRpcPromise(_0x4d6714,_0x4740db,_0x1e6223){return new BPromise(function(_0x3ece3f,_0x48c9ea){return client[_0xf1a8('0x12')](_0x4d6714,_0x1e6223)[_0xf1a8('0x13')](function(_0x1f81e3){logger['info'](_0xf1a8('0x14'),_0x4740db,_0xf1a8('0x15'));logger[_0xf1a8('0x16')](_0xf1a8('0x17'),_0x4740db,_0xf1a8('0x15'),JSON[_0xf1a8('0x18')](_0x1f81e3));if(_0x1f81e3[_0xf1a8('0x19')]){if(_0x1f81e3[_0xf1a8('0x19')][_0xf1a8('0x1a')]===0x1f4){logger['error'](_0xf1a8('0x14'),_0x4740db,_0x1f81e3['error'][_0xf1a8('0x1b')]);return _0x48c9ea(_0x1f81e3[_0xf1a8('0x19')][_0xf1a8('0x1b')]);}logger['error'](_0xf1a8('0x14'),_0x4740db,_0x1f81e3[_0xf1a8('0x19')][_0xf1a8('0x1b')]);return _0x3ece3f(_0x1f81e3[_0xf1a8('0x19')][_0xf1a8('0x1b')]);}else{logger[_0xf1a8('0x1c')](_0xf1a8('0x14'),_0x4740db,_0xf1a8('0x15'));_0x3ece3f(_0x1f81e3[_0xf1a8('0x1d')][_0xf1a8('0x1b')]);}})[_0xf1a8('0x1e')](function(_0x2f83e3){logger[_0xf1a8('0x19')](_0xf1a8('0x14'),_0x4740db,_0x2f83e3);_0x48c9ea(_0x2f83e3);});});}exports[_0xf1a8('0x1f')]=function(_0x5218b1){var _0x37c2ba=this;return new Promise(function(_0x354ab2,_0x431e62){return db[_0xf1a8('0x20')][_0xf1a8('0x21')](_0x5218b1['body'],{'raw':_0x5218b1[_0xf1a8('0x22')]?_0x5218b1['options'][_0xf1a8('0x23')]===undefined?!![]:![]:!![]})[_0xf1a8('0x13')](function(_0x221d1f){logger[_0xf1a8('0x1c')](_0xf1a8('0x1f'),_0x5218b1);logger['debug'](_0xf1a8('0x1f'),_0x5218b1,JSON[_0xf1a8('0x18')](_0x221d1f));_0x354ab2(_0x221d1f);})[_0xf1a8('0x1e')](function(_0x4c2c15){logger[_0xf1a8('0x19')](_0xf1a8('0x1f'),_0x4c2c15['message'],_0x5218b1);_0x431e62(_0x37c2ba['error'](0x1f4,_0x4c2c15[_0xf1a8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 8ad6490..944f900 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 _0x7210=['removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x136816,_0x47d424){var _0x3c6038=function(_0x182b9a){while(--_0x182b9a){_0x136816['push'](_0x136816['shift']());}};_0x3c6038(++_0x47d424);}(_0x7210,0x11b));var _0x0721=function(_0x5277df,_0x4f836e){_0x5277df=_0x5277df-0x0;var _0x34249e=_0x7210[_0x5277df];return _0x34249e;};'use strict';var WhatsappMessageEvents=require(_0x0721('0x0'));var events=[_0x0721('0x1'),_0x0721('0x2'),_0x0721('0x3')];function createListener(_0xbf1307,_0x49bab2){return function(_0x220ebf){_0x49bab2[_0x0721('0x4')](_0xbf1307,_0x220ebf);};}function removeListener(_0x3153b4,_0x1aadf2){return function(){WhatsappMessageEvents[_0x0721('0x5')](_0x3153b4,_0x1aadf2);};}exports[_0x0721('0x6')]=function(_0x107828){for(var _0xad5504=0x0,_0x244741=events[_0x0721('0x7')];_0xad5504<_0x244741;_0xad5504++){var _0x381d1a=events[_0xad5504];var _0x1c0503=createListener(_0x0721('0x8')+_0x381d1a,_0x107828);WhatsappMessageEvents['on'](_0x381d1a,_0x1c0503);}}; \ No newline at end of file +var _0x5486=['whatsappMessage:','save','update','emit','register','length'];(function(_0x17f716,_0x4a06c7){var _0x31f0de=function(_0x5476e4){while(--_0x5476e4){_0x17f716['push'](_0x17f716['shift']());}};_0x31f0de(++_0x4a06c7);}(_0x5486,0x1e7));var _0x6548=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5486[_0x14add3];return _0x4a174f;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x6548('0x0'),'remove',_0x6548('0x1')];function createListener(_0x58dad7,_0x4b1314){return function(_0x9a900f){_0x4b1314[_0x6548('0x2')](_0x58dad7,_0x9a900f);};}function removeListener(_0x35ffef,_0x1a7032){return function(){WhatsappMessageEvents['removeListener'](_0x35ffef,_0x1a7032);};}exports[_0x6548('0x3')]=function(_0x6a19fc){for(var _0x5c6e41=0x0,_0x40a186=events[_0x6548('0x4')];_0x5c6e41<_0x40a186;_0x5c6e41++){var _0x543401=events[_0x5c6e41];var _0x54b7b9=createListener(_0x6548('0x5')+_0x543401,_0x6a19fc);WhatsappMessageEvents['on'](_0x543401,_0x54b7b9);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 976a712..aa0b817 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 _0xd12d=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/users','post','addTeams','delete','destroy','/:id/teams','removeAgents','multer','util','path'];(function(_0x487095,_0x1b9abd){var _0x1add4b=function(_0x37d822){while(--_0x37d822){_0x487095['push'](_0x487095['shift']());}};_0x1add4b(++_0x1b9abd);}(_0xd12d,0xa5));var _0xdd12=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xd12d[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0xdd12('0x0'));var util=require(_0xdd12('0x1'));var path=require(_0xdd12('0x2'));var timeout=require(_0xdd12('0x3'));var express=require(_0xdd12('0x4'));var router=express[_0xdd12('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdd12('0x6'));var interaction=require(_0xdd12('0x7'));var config=require('../../config/environment');var controller=require(_0xdd12('0x8'));router[_0xdd12('0x9')]('/',auth['isAuthenticated'](),controller[_0xdd12('0xa')]);router[_0xdd12('0x9')](_0xdd12('0xb'),auth[_0xdd12('0xc')](),controller[_0xdd12('0xd')]);router[_0xdd12('0x9')](_0xdd12('0xe'),auth[_0xdd12('0xc')](),controller[_0xdd12('0xf')]);router[_0xdd12('0x9')](_0xdd12('0x10'),auth[_0xdd12('0xc')](),controller['getMembers']);router[_0xdd12('0x9')]('/:id/teams',auth[_0xdd12('0xc')](),controller['getTeams']);router[_0xdd12('0x9')](_0xdd12('0x11'),auth[_0xdd12('0xc')](),controller['getAgents']);router[_0xdd12('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdd12('0x12')]('/:id/teams',auth[_0xdd12('0xc')](),controller[_0xdd12('0x13')]);router[_0xdd12('0x12')](_0xdd12('0x11'),auth[_0xdd12('0xc')](),controller['addAgents']);router['put'](_0xdd12('0xe'),auth[_0xdd12('0xc')](),controller['update']);router[_0xdd12('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xdd12('0x15')]);router[_0xdd12('0x14')](_0xdd12('0x16'),auth[_0xdd12('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xdd12('0xc')](),controller[_0xdd12('0x17')]);module['exports']=router; \ No newline at end of file +var _0x109b=['post','create','/:id/teams','addTeams','addAgents','put','/:id','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/users','getAgents'];(function(_0x4812bd,_0x476c0e){var _0x36581c=function(_0x4330e9){while(--_0x4330e9){_0x4812bd['push'](_0x4812bd['shift']());}};_0x36581c(++_0x476c0e);}(_0x109b,0x175));var _0xb109=function(_0x48776a,_0x9af593){_0x48776a=_0x48776a-0x0;var _0x5d344b=_0x109b[_0x48776a];return _0x5d344b;};'use strict';var multer=require(_0xb109('0x0'));var util=require(_0xb109('0x1'));var path=require(_0xb109('0x2'));var timeout=require(_0xb109('0x3'));var express=require(_0xb109('0x4'));var router=express[_0xb109('0x5')]();var fs_extra=require(_0xb109('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb109('0x7'));var config=require(_0xb109('0x8'));var controller=require(_0xb109('0x9'));router[_0xb109('0xa')]('/',auth[_0xb109('0xb')](),controller[_0xb109('0xc')]);router['get'](_0xb109('0xd'),auth[_0xb109('0xb')](),controller[_0xb109('0xe')]);router[_0xb109('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb109('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xb109('0xa')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0xb109('0xa')](_0xb109('0xf'),auth['isAuthenticated'](),controller[_0xb109('0x10')]);router[_0xb109('0x11')]('/',auth[_0xb109('0xb')](),controller[_0xb109('0x12')]);router[_0xb109('0x11')](_0xb109('0x13'),auth[_0xb109('0xb')](),controller[_0xb109('0x14')]);router[_0xb109('0x11')](_0xb109('0xf'),auth[_0xb109('0xb')](),controller[_0xb109('0x15')]);router[_0xb109('0x16')](_0xb109('0x17'),auth[_0xb109('0xb')](),controller[_0xb109('0x18')]);router[_0xb109('0x19')](_0xb109('0x17'),auth[_0xb109('0xb')](),controller[_0xb109('0x1a')]);router[_0xb109('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb109('0x1b')]);router[_0xb109('0x19')](_0xb109('0xf'),auth['isAuthenticated'](),controller[_0xb109('0x1c')]);module[_0xb109('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index d20e1b1..3ea9e4c 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 _0xc68d=['exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2b0236,_0x3df5c5){var _0x253418=function(_0x276405){while(--_0x276405){_0x2b0236['push'](_0x2b0236['shift']());}};_0x253418(++_0x3df5c5);}(_0xc68d,0x17a));var _0xdc68=function(_0x53990b,_0x369927){_0x53990b=_0x53990b-0x0;var _0x5196cf=_0xc68d[_0x53990b];return _0x5196cf;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'name':{'type':Sequelize[_0xdc68('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc68('0x2')](_0xdc68('0x3'),_0xdc68('0x4'),_0xdc68('0x5'))},'description':{'type':Sequelize[_0xdc68('0x1')]}}; \ No newline at end of file +var _0xb43b=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x5076e9,_0x22454a){var _0x2a0de1=function(_0x5b6895){while(--_0x5b6895){_0x5076e9['push'](_0x5076e9['shift']());}};_0x2a0de1(++_0x22454a);}(_0xb43b,0xbf));var _0xbb43=function(_0x270e0d,_0x331d1f){_0x270e0d=_0x270e0d-0x0;var _0x364dd2=_0xb43b[_0x270e0d];return _0x364dd2;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb43('0x1')],'unique':_0xbb43('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xbb43('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbb43('0x4')](_0xbb43('0x5'),_0xbb43('0x6'),_0xbb43('0x7'))},'description':{'type':Sequelize[_0xbb43('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index d0e0cb7..8f1ebdc 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 _0x85ac=['getAgents','bluebird','util','lodash','squel','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','get','error','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','include','query','findAll','rows','show','params','model','keys','attributes','intersection','fields','length','includeAll','merge','options','find','catch','create','body','role','user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','order','sort','where','filters','pick','WhatsappQueueId','filter','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','Agents','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','includes','all','union','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x85ac,0x17b));var _0xc85a=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x85ac[_0x411add];return _0x238242;};'use strict';var BPromise=require(_0xc85a('0x0'));var util=require(_0xc85a('0x1'));var _=require(_0xc85a('0x2'));var squel=require(_0xc85a('0x3'));var Redis=require(_0xc85a('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0xc85a('0x5'))('api');var config=require(_0xc85a('0x6'));var db=require(_0xc85a('0x7'))['db'];config[_0xc85a('0x8')]=_[_0xc85a('0x9')](config[_0xc85a('0x8')],{'host':_0xc85a('0xa'),'port':0x18eb});var socket=require(_0xc85a('0xb'))(new Redis(config[_0xc85a('0x8')]));require(_0xc85a('0xc'))[_0xc85a('0xd')](socket);function respondWithStatusCode(_0x4dc753,_0x45b5cf){_0x45b5cf=_0x45b5cf||0xcc;return function(_0x40abfd){if(_0x40abfd){return _0x4dc753[_0xc85a('0xe')](_0x45b5cf);}return _0x4dc753[_0xc85a('0xf')](_0x45b5cf)[_0xc85a('0x10')]();};}function respondWithResult(_0x592bea,_0x5adf75){_0x5adf75=_0x5adf75||0xc8;return function(_0x2eee85){if(_0x2eee85){return _0x592bea[_0xc85a('0xf')](_0x5adf75)[_0xc85a('0x11')](_0x2eee85);}};}function respondWithFilteredResult(_0x30479a,_0x5d38b4){return function(_0x11dbfe){if(_0x11dbfe){var _0x5b7f83=typeof _0x5d38b4['offset']===_0xc85a('0x12')&&typeof _0x5d38b4['limit']==='undefined';var _0x3ce9c0=_0x11dbfe[_0xc85a('0x13')];var _0x2707e2=_0x5b7f83?0x0:_0x5d38b4[_0xc85a('0x14')];var _0x32c19d=_0x5b7f83?_0x11dbfe['count']:_0x5d38b4[_0xc85a('0x14')]+_0x5d38b4[_0xc85a('0x15')];var _0x2ba782;if(_0x32c19d>=_0x3ce9c0){_0x32c19d=_0x3ce9c0;_0x2ba782=0xc8;}else{_0x2ba782=0xce;}_0x30479a[_0xc85a('0xf')](_0x2ba782);return _0x30479a[_0xc85a('0x16')](_0xc85a('0x17'),_0x2707e2+'-'+_0x32c19d+'/'+_0x3ce9c0)[_0xc85a('0x11')](_0x11dbfe);}return null;};}function saveUpdates(_0x420ee2){return function(_0x5020b6){if(_0x5020b6){return _0x5020b6[_0xc85a('0x18')](_0x420ee2)[_0xc85a('0x19')](function(_0x8e007d){return _0x8e007d;});}return null;};}function removeEntity(_0x8ac10b){return function(_0x5f0977){if(_0x5f0977){return _0x5f0977[_0xc85a('0x1a')]()[_0xc85a('0x19')](function(){var _0x2d946e=_0x5f0977[_0xc85a('0x1b')]({'plain':!![]});var _0xd4a04b='WhatsappQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xd4a04b,'resourceId':_0x2d946e['id']}})[_0xc85a('0x19')](function(){return _0x5f0977;});})['then'](function(){_0x8ac10b[_0xc85a('0xf')](0xcc)[_0xc85a('0x10')]();});}};}function handleEntityNotFound(_0x47af39){return function(_0x2f70dc){if(!_0x2f70dc){_0x47af39['sendStatus'](0x194);}return _0x2f70dc;};}function handleError(_0x25008a,_0x4c362a){_0x4c362a=_0x4c362a||0x1f4;return function(_0xc567de){logger[_0xc85a('0x1c')](_0xc567de[_0xc85a('0x1d')]);if(_0xc567de[_0xc85a('0x1e')]){delete _0xc567de['name'];}_0x25008a[_0xc85a('0xf')](_0x4c362a)[_0xc85a('0x1f')](_0xc567de);};}exports['index']=function(_0xd394ba,_0x42050c){var _0x1d1b79={};var _0x52dd66={'count':0x0,'rows':[]};var _0x1a396f=_[_0xc85a('0x20')](db[_0xc85a('0x21')][_0xc85a('0x22')],function(_0x5ae303){return{'name':_0x5ae303[_0xc85a('0x23')],'type':_0x5ae303[_0xc85a('0x24')][_0xc85a('0x25')]};});_0x1d1b79=qs['getOptions'](_0x1a396f,_0xd394ba);var _0x51525a={'where':_0x1d1b79['where']};return db[_0xc85a('0x21')][_0xc85a('0x13')](_0x51525a)[_0xc85a('0x19')](function(_0x469529){_0x52dd66[_0xc85a('0x13')]=_0x469529;_0x1d1b79[_0xc85a('0x26')]=qs[_0xc85a('0x26')](_0xd394ba[_0xc85a('0x27')]);return db[_0xc85a('0x21')][_0xc85a('0x28')](_0x1d1b79);})[_0xc85a('0x19')](function(_0x736f7a){_0x52dd66[_0xc85a('0x29')]=_0x736f7a;return _0x52dd66;})[_0xc85a('0x19')](respondWithFilteredResult(_0x42050c,_0x1d1b79))['catch'](handleError(_0x42050c,null));};exports[_0xc85a('0x2a')]=function(_0x437d6a,_0x1c4566){var _0x5610b9={'raw':!![],'where':{'id':_0x437d6a[_0xc85a('0x2b')]['id']}},_0x1ed734={};_0x1ed734[_0xc85a('0x2c')]=_['keys'](db[_0xc85a('0x21')][_0xc85a('0x22')]);_0x1ed734['query']=_[_0xc85a('0x2d')](_0x437d6a[_0xc85a('0x27')]);_0x1ed734['filters']=_['intersection'](_0x1ed734[_0xc85a('0x2c')],_0x1ed734['query']);_0x5610b9[_0xc85a('0x2e')]=_[_0xc85a('0x2f')](_0x1ed734[_0xc85a('0x2c')],qs[_0xc85a('0x30')](_0x437d6a['query'][_0xc85a('0x30')]));_0x5610b9[_0xc85a('0x2e')]=_0x5610b9[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x5610b9[_0xc85a('0x2e')]:_0x1ed734['model'];if(_0x437d6a[_0xc85a('0x27')][_0xc85a('0x32')]){_0x5610b9[_0xc85a('0x26')]=[{'all':!![]}];}_0x5610b9=_[_0xc85a('0x33')]({},_0x5610b9,_0x437d6a[_0xc85a('0x34')]);return db[_0xc85a('0x21')][_0xc85a('0x35')](_0x5610b9)[_0xc85a('0x19')](handleEntityNotFound(_0x1c4566,null))[_0xc85a('0x19')](respondWithResult(_0x1c4566,null))[_0xc85a('0x36')](handleError(_0x1c4566,null));};exports[_0xc85a('0x37')]=function(_0x28943a,_0x5ce135){return db['WhatsappQueue']['create'](_0x28943a[_0xc85a('0x38')],{})['then'](function(_0x3318cf){var _0x4a434e=_0x28943a['user'][_0xc85a('0x1b')]({'plain':!![]});if(!_0x4a434e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a434e[_0xc85a('0x39')]===_0xc85a('0x3a')){var _0x3bd295=_0x3318cf[_0xc85a('0x1b')]({'plain':!![]});var _0x478aa8=_0xc85a('0x3b');return db[_0xc85a('0x3c')][_0xc85a('0x35')]({'where':{'name':_0x478aa8,'userProfileId':_0x4a434e[_0xc85a('0x3d')]},'raw':!![]})['then'](function(_0x5ad108){if(_0x5ad108&&_0x5ad108[_0xc85a('0x3e')]===0x0){return db[_0xc85a('0x3f')]['create']({'name':_0x3bd295[_0xc85a('0x1e')],'resourceId':_0x3bd295['id'],'type':_0x5ad108[_0xc85a('0x1e')],'sectionId':_0x5ad108['id']},{})[_0xc85a('0x19')](function(){return _0x3318cf;});}else{return _0x3318cf;}})[_0xc85a('0x36')](function(_0x395723){logger[_0xc85a('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x395723);throw _0x395723;});}return _0x3318cf;})['then'](respondWithResult(_0x5ce135,0xc9))[_0xc85a('0x36')](handleError(_0x5ce135,null));};exports[_0xc85a('0x18')]=function(_0x410855,_0x99408f){if(_0x410855[_0xc85a('0x38')]['id']){delete _0x410855[_0xc85a('0x38')]['id'];}return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x410855['params']['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x99408f,null))[_0xc85a('0x19')](saveUpdates(_0x410855[_0xc85a('0x38')],null))['then'](respondWithResult(_0x99408f,null))[_0xc85a('0x36')](handleError(_0x99408f,null));};exports[_0xc85a('0x1a')]=function(_0x5c5987,_0xc521ef){return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x5c5987['params']['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0xc521ef,null))['then'](removeEntity(_0xc521ef,null))[_0xc85a('0x36')](handleError(_0xc521ef,null));};exports[_0xc85a('0x40')]=function(_0x416d1a,_0x3349b3){return db[_0xc85a('0x21')][_0xc85a('0x40')]()[_0xc85a('0x19')](respondWithResult(_0x3349b3,null))['catch'](handleError(_0x3349b3,null));};exports[_0xc85a('0x41')]=function(_0x5351c3,_0x2c0d50){var _0x2c6843={'raw':!![],'where':{}},_0x816a7c={},_0x28fe31;return db[_0xc85a('0x21')][_0xc85a('0x42')]({'where':{'id':_0x5351c3['params']['id']}})['then'](handleEntityNotFound(_0x2c0d50,null))[_0xc85a('0x19')](function(_0x4f7730){if(_0x4f7730){_0x28fe31=_0x4f7730[_0xc85a('0x1b')]({'plain':!![]});_0x816a7c['model']=_[_0xc85a('0x2d')](db[_0xc85a('0x43')][_0xc85a('0x22')]);_0x816a7c[_0xc85a('0x27')]=_[_0xc85a('0x2d')](_0x5351c3[_0xc85a('0x27')]);_0x816a7c['filters']=_['intersection'](_0x816a7c[_0xc85a('0x2c')],_0x816a7c[_0xc85a('0x27')]);_0x2c6843[_0xc85a('0x2e')]=_['intersection'](_0x816a7c[_0xc85a('0x2c')],qs[_0xc85a('0x30')](_0x5351c3[_0xc85a('0x27')]['fields']));_0x2c6843['attributes']=_0x2c6843[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x2c6843[_0xc85a('0x2e')]:_0x816a7c[_0xc85a('0x2c')];if(!_0x5351c3[_0xc85a('0x27')][_0xc85a('0x44')](_0xc85a('0x45'))){_0x2c6843[_0xc85a('0x15')]=qs['limit'](_0x5351c3[_0xc85a('0x27')]['limit']);_0x2c6843[_0xc85a('0x14')]=qs[_0xc85a('0x14')](_0x5351c3[_0xc85a('0x27')]['offset']);}_0x2c6843[_0xc85a('0x46')]=qs['sort'](_0x5351c3[_0xc85a('0x27')][_0xc85a('0x47')]);_0x2c6843[_0xc85a('0x48')]=qs[_0xc85a('0x49')](_[_0xc85a('0x4a')](_0x5351c3[_0xc85a('0x27')],_0x816a7c[_0xc85a('0x49')]));_0x2c6843['where'][_0xc85a('0x4b')]=_0x4f7730['id'];if(_0x5351c3[_0xc85a('0x27')][_0xc85a('0x4c')]){_0x2c6843[_0xc85a('0x48')]=_[_0xc85a('0x33')](_0x2c6843['where'],{'$or':_[_0xc85a('0x20')](_0x2c6843[_0xc85a('0x2e')],function(_0x3532a7){var _0x5cefa3={};_0x5cefa3[_0x3532a7]={'$like':'%'+_0x5351c3[_0xc85a('0x27')][_0xc85a('0x4c')]+'%'};return _0x5cefa3;})});}_0x2c6843=_['merge']({},_0x2c6843,_0x5351c3[_0xc85a('0x34')]);return db[_0xc85a('0x43')][_0xc85a('0x28')](_0x2c6843);}})[_0xc85a('0x19')](function(_0x293ff0){if(_0x293ff0){return db[_0xc85a('0x4d')][_0xc85a('0x4e')]({'where':{'id':_[_0xc85a('0x20')](_0x293ff0,_0xc85a('0x4f')),'role':_0xc85a('0x50')},'attributes':['id',_0xc85a('0x1e'),'whatsappPause',_0xc85a('0x51'),_0xc85a('0x52')]});}})[_0xc85a('0x19')](function(_0xd89301){if(_0xd89301){return{'count':_0xd89301['count'],'rows':_[_0xc85a('0x20')](_0xd89301[_0xc85a('0x29')],function(_0x367ca8){return{'membername':_0x367ca8[_0xc85a('0x1e')],'UserId':_0x367ca8['id'],'queue_name':_0x28fe31[_0xc85a('0x1e')],'WhatsappQueueId':_0x28fe31['id'],'interface':util[_0xc85a('0x53')](_0xc85a('0x54'),_0xc85a('0x55'),_0x367ca8['name']),'penalty':0x0,'paused':_0x367ca8['whatsappPause'],'createdAt':_0x367ca8[_0xc85a('0x52')],'updatedAt':_0x367ca8[_0xc85a('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc85a('0x19')](respondWithFilteredResult(_0x2c0d50,_0x2c6843))[_0xc85a('0x36')](handleError(_0x2c0d50,null));};exports['getTeams']=function(_0x115ba3,_0x241d5e){var _0x2ec90d={};var _0x243288={};var _0x4ba3f1;var _0xee926b;return db['WhatsappQueue'][_0xc85a('0x42')]({'where':{'id':_0x115ba3['params']['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x241d5e,null))[_0xc85a('0x19')](function(_0x1f58cf){if(_0x1f58cf){_0x4ba3f1=_0x1f58cf;_0x243288[_0xc85a('0x2c')]=_[_0xc85a('0x2d')](db[_0xc85a('0x56')]['rawAttributes']);_0x243288[_0xc85a('0x27')]=_['keys'](_0x115ba3[_0xc85a('0x27')]);_0x243288[_0xc85a('0x49')]=_['intersection'](_0x243288[_0xc85a('0x2c')],_0x243288[_0xc85a('0x27')]);_0x2ec90d['attributes']=_[_0xc85a('0x2f')](_0x243288['model'],qs[_0xc85a('0x30')](_0x115ba3[_0xc85a('0x27')][_0xc85a('0x30')]));_0x2ec90d['attributes']=_0x2ec90d[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x2ec90d[_0xc85a('0x2e')]:_0x243288[_0xc85a('0x2c')];_0x2ec90d['order']=qs[_0xc85a('0x47')](_0x115ba3['query'][_0xc85a('0x47')]);_0x2ec90d['where']=qs['filters'](_[_0xc85a('0x4a')](_0x115ba3[_0xc85a('0x27')],_0x243288['filters']));if(_0x115ba3[_0xc85a('0x27')][_0xc85a('0x4c')]){_0x2ec90d['where']=_[_0xc85a('0x33')](_0x2ec90d[_0xc85a('0x48')],{'$or':_[_0xc85a('0x20')](_0x2ec90d['attributes'],function(_0x301aaa){var _0x3b04f0={};_0x3b04f0[_0x301aaa]={'$like':'%'+_0x115ba3[_0xc85a('0x27')][_0xc85a('0x4c')]+'%'};return _0x3b04f0;})});}_0x2ec90d=_['merge']({},_0x2ec90d,_0x115ba3[_0xc85a('0x34')]);return _0x4ba3f1['getTeams'](_0x2ec90d);}})[_0xc85a('0x19')](function(_0x269ff9){if(_0x269ff9){_0xee926b=_0x269ff9['length'];if(!_0x115ba3[_0xc85a('0x27')][_0xc85a('0x44')]('nolimit')){_0x2ec90d[_0xc85a('0x15')]=qs[_0xc85a('0x15')](_0x115ba3[_0xc85a('0x27')]['limit']);_0x2ec90d['offset']=qs[_0xc85a('0x14')](_0x115ba3[_0xc85a('0x27')]['offset']);}return _0x4ba3f1[_0xc85a('0x57')](_0x2ec90d);}})[_0xc85a('0x19')](function(_0x31a52e){if(_0x31a52e){return _0x31a52e?{'count':_0xee926b,'rows':_0x31a52e}:null;}})[_0xc85a('0x19')](respondWithResult(_0x241d5e,null))[_0xc85a('0x36')](handleError(_0x241d5e,null));};exports[_0xc85a('0x58')]=function(_0x75899c,_0x2d3f70){var _0x256ac9=_0x75899c[_0xc85a('0x38')][_0xc85a('0x59')];return db['Team'][_0xc85a('0x28')]({'where':{'id':_0x256ac9},'attributes':['id'],'include':[{'model':db[_0xc85a('0x4d')],'as':'Agents','attributes':['id',_0xc85a('0x1e'),_0xc85a('0x5a'),'voicePause',_0xc85a('0x5b')],'raw':!![]}]})[_0xc85a('0x19')](function(_0x45a58c){if(_0x45a58c){var _0xf8af2c=_[_0xc85a('0x5c')](_0x45a58c,function(_0x3894fd){var _0x25442c=_0x3894fd[_0xc85a('0x1b')]({'plain':!![]});return _0x25442c['Agents'];});return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x75899c[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](function(_0x10d4a4){return db[_0xc85a('0x5d')][_0xc85a('0x5e')](function(_0x144db8){return _0x10d4a4[_0xc85a('0x58')](_0x256ac9,{'transaction':_0x144db8})[_0xc85a('0x19')](function(){return BPromise[_0xc85a('0x5f')](_0xf8af2c,function(_0x2f2d0e){return db[_0xc85a('0x43')][_0xc85a('0x60')]({'where':{'UserId':_0x2f2d0e['id'],'WhatsappQueueId':_0x75899c[_0xc85a('0x2b')]['id']},'transaction':_0x144db8});});})[_0xc85a('0x19')](function(){_0xf8af2c['forEach'](function(_0x2254ab){socket[_0xc85a('0x61')]('userWhatsappQueue:save',{'UserId':_0x2254ab['id'],'WhatsappQueueId':_0x10d4a4['id']});});});});});}})[_0xc85a('0x19')](respondWithStatusCode(_0x2d3f70,null))['catch'](handleError(_0x2d3f70,null));};exports[_0xc85a('0x62')]=function(_0x27d71b,_0x366394){return db[_0xc85a('0x56')][_0xc85a('0x28')]({'where':{'id':_0x27d71b[_0xc85a('0x27')][_0xc85a('0x59')]},'attributes':['id'],'include':[{'model':db[_0xc85a('0x4d')],'as':_0xc85a('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x366394,null))['then'](function(_0x5d1c3c){var _0x28e740=_[_0xc85a('0x20')](_0x5d1c3c,'id');var _0x3dbd77=[];var _0xfb801e=[];var _0xe14fca=squel[_0xc85a('0x64')]();_0xe14fca[_0xc85a('0x65')](_0xc85a('0x66'))[_0xc85a('0x67')](_0xc85a('0x68'),'tq')[_0xc85a('0x69')](_0xc85a('0x6a'),'ut',_0xc85a('0x6b'))['where'](_0xc85a('0x6c'),_0x27d71b[_0xc85a('0x2b')]['id']);for(var _0x171419=0x0;_0x171419<_0x5d1c3c[_0xc85a('0x31')];_0x171419+=0x1){let _0x9af1cf=_0x5d1c3c[_0x171419];for(var _0x25ceaa=0x0;_0x25ceaa<_0x9af1cf[_0xc85a('0x63')]['length'];_0x25ceaa+=0x1){let _0x45812b=_0x9af1cf[_0xc85a('0x63')][_0x25ceaa];var _0x38a164=_0xe14fca[_0xc85a('0x6d')]();_0x38a164[_0xc85a('0x48')]('ut.UserId\x20=\x20?',_0x45812b['id']);_0xfb801e[_0xc85a('0x6e')](db[_0xc85a('0x5d')]['query'](_0x38a164[_0xc85a('0x6f')](),{'type':db[_0xc85a('0x5d')][_0xc85a('0x70')]['SELECT']})[_0xc85a('0x19')](function(_0x30deea){if(_0x30deea[_0xc85a('0x31')]===0x1){return _0x45812b['id'];}else{var _0x40385d=_[_0xc85a('0x71')](_[_0xc85a('0x20')](_0x30deea,_0xc85a('0x72')),function(_0x3dfec6){return _[_0xc85a('0x73')](_0x28e740,_0x3dfec6);});if(_0x40385d){return _0x45812b['id'];}}}));}}return BPromise[_0xc85a('0x74')](_0xfb801e)[_0xc85a('0x19')](function(_0x30c920){_0x3dbd77=_(_0x3dbd77)[_0xc85a('0x75')](_0x30c920)['compact']()['value']();return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x27d71b[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](function(_0x35b4da){return db['sequelize'][_0xc85a('0x5e')](function(_0x1a0e1b){return _0x35b4da[_0xc85a('0x62')](_0x27d71b['query'][_0xc85a('0x59')],{'transaction':_0x1a0e1b})[_0xc85a('0x19')](function(){if(!_[_0xc85a('0x76')](_0x3dbd77)){return _0x35b4da[_0xc85a('0x77')](_0x3dbd77,{'transaction':_0x1a0e1b});}})[_0xc85a('0x19')](function(){_0x3dbd77['forEach'](function(_0x2299fa){socket['emit'](_0xc85a('0x78'),{'UserId':_0x2299fa,'WhatsappQueueId':_0x35b4da['id']});});});});});});})[_0xc85a('0x19')](respondWithStatusCode(_0x366394,null))[_0xc85a('0x36')](handleError(_0x366394,null));};exports[_0xc85a('0x79')]=function(_0x4ca062,_0x4f71f2){return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x4ca062[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x4f71f2,null))[_0xc85a('0x19')](function(_0x1d6bc7){if(_0x1d6bc7){return _0x1d6bc7[_0xc85a('0x79')](_0x4ca062[_0xc85a('0x38')]['ids'],_[_0xc85a('0x7a')](_0x4ca062[_0xc85a('0x38')],[_0xc85a('0x59'),'id'])||{})[_0xc85a('0x7b')](function(_0x1fe446){for(var _0x13dfd0=0x0;_0x13dfd0<_0x4ca062['body']['ids'][_0xc85a('0x31')];_0x13dfd0+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0x4ca062[_0xc85a('0x38')]['ids'][_0x13dfd0]),'WhatsappQueueId':Number(_0x4ca062[_0xc85a('0x2b')]['id'])});}return _0x1fe446;});}})[_0xc85a('0x19')](respondWithResult(_0x4f71f2,null))[_0xc85a('0x36')](handleError(_0x4f71f2,null));};exports[_0xc85a('0x77')]=function(_0x484ebf,_0x4faf4a){return db[_0xc85a('0x21')][_0xc85a('0x35')]({'where':{'id':_0x484ebf[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x4faf4a,null))['then'](function(_0x39766f){if(_0x39766f){return _0x39766f['removeAgents'](_0x484ebf[_0xc85a('0x27')]['ids'])['then'](function(){if(_[_0xc85a('0x7c')](_0x484ebf[_0xc85a('0x27')][_0xc85a('0x59')])){for(var _0x217b68=0x0;_0x217b68<_0x484ebf['query'][_0xc85a('0x59')][_0xc85a('0x31')];_0x217b68+=0x1){socket[_0xc85a('0x61')]('userWhatsappQueue:remove',{'UserId':Number(_0x484ebf[_0xc85a('0x27')][_0xc85a('0x59')][_0x217b68]),'WhatsappQueueId':Number(_0x484ebf[_0xc85a('0x2b')]['id'])});}}else{socket['emit'](_0xc85a('0x78'),{'UserId':Number(_0x484ebf[_0xc85a('0x27')]['ids']),'WhatsappQueueId':Number(_0x484ebf['params']['id'])});}});}})[_0xc85a('0x19')](respondWithStatusCode(_0x4faf4a,null))[_0xc85a('0x36')](handleError(_0x4faf4a,null));};exports[_0xc85a('0x7d')]=function(_0x2e5c28,_0x2a4c96){var _0x28ef07={};var _0x2266b7={};var _0x4cd20e;var _0x2c8b9a;return db[_0xc85a('0x21')][_0xc85a('0x42')]({'where':{'id':_0x2e5c28[_0xc85a('0x2b')]['id']}})[_0xc85a('0x19')](handleEntityNotFound(_0x2a4c96,null))[_0xc85a('0x19')](function(_0x3e3edc){if(_0x3e3edc){_0x4cd20e=_0x3e3edc;_0x2266b7[_0xc85a('0x2c')]=_[_0xc85a('0x2d')](db[_0xc85a('0x4d')][_0xc85a('0x22')]);_0x2266b7[_0xc85a('0x27')]=_[_0xc85a('0x2d')](_0x2e5c28['query']);_0x2266b7[_0xc85a('0x49')]=_[_0xc85a('0x2f')](_0x2266b7[_0xc85a('0x2c')],_0x2266b7['query']);_0x28ef07[_0xc85a('0x2e')]=_['intersection'](_0x2266b7[_0xc85a('0x2c')],qs[_0xc85a('0x30')](_0x2e5c28['query'][_0xc85a('0x30')]));_0x28ef07['attributes']=_0x28ef07[_0xc85a('0x2e')][_0xc85a('0x31')]?_0x28ef07[_0xc85a('0x2e')]:_0x2266b7[_0xc85a('0x2c')];_0x28ef07['order']=qs[_0xc85a('0x47')](_0x2e5c28[_0xc85a('0x27')]['sort']);_0x28ef07['where']=qs[_0xc85a('0x49')](_[_0xc85a('0x4a')](_0x2e5c28['query'],_0x2266b7[_0xc85a('0x49')]));if(_0x2e5c28['query'][_0xc85a('0x4c')]){_0x28ef07[_0xc85a('0x48')]=_['merge'](_0x28ef07['where'],{'$or':_['map'](_0x28ef07[_0xc85a('0x2e')],function(_0x661e50){var _0xb8a3b3={};_0xb8a3b3[_0x661e50]={'$like':'%'+_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x4c')]+'%'};return _0xb8a3b3;})});}_0x28ef07=_['merge']({},_0x28ef07,_0x2e5c28[_0xc85a('0x34')]);return _0x4cd20e['getAgents'](_0x28ef07);}})[_0xc85a('0x19')](function(_0x50e160){if(_0x50e160){_0x2c8b9a=_0x50e160[_0xc85a('0x31')];if(!_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x44')]('nolimit')){_0x28ef07[_0xc85a('0x15')]=qs[_0xc85a('0x15')](_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x15')]);_0x28ef07[_0xc85a('0x14')]=qs[_0xc85a('0x14')](_0x2e5c28[_0xc85a('0x27')][_0xc85a('0x14')]);}return _0x4cd20e[_0xc85a('0x7d')](_0x28ef07);}})[_0xc85a('0x19')](function(_0x12d9f3){if(_0x12d9f3){return _0x12d9f3?{'count':_0x2c8b9a,'rows':_0x12d9f3}:null;}})[_0xc85a('0x19')](respondWithResult(_0x2a4c96,null))[_0xc85a('0x36')](handleError(_0x2a4c96,null));}; \ No newline at end of file +var _0xfd3b=['addAgents','spread','userWhatsappQueue:save','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','send','index','map','WhatsappQueue','rawAttributes','key','getOptions','where','include','query','findAll','catch','params','model','keys','intersection','attributes','fields','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','filters','length','hasOwnProperty','nolimit','order','sort','pick','merge','filter','User','findAndCountAll','agent','createdAt','rows','format','%s/%s','SIP','whatsappPause','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','removeTeams','ids','select','field','tq.TeamId','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','emit','userWhatsappQueue:remove'];(function(_0x29b17e,_0x45fac6){var _0x3452e9=function(_0x3050a2){while(--_0x3050a2){_0x29b17e['push'](_0x29b17e['shift']());}};_0x3452e9(++_0x45fac6);}(_0xfd3b,0x170));var _0xbfd3=function(_0x3a7261,_0x3ee28e){_0x3a7261=_0x3a7261-0x0;var _0x3fdf33=_0xfd3b[_0x3a7261];return _0x3fdf33;};'use strict';var BPromise=require(_0xbfd3('0x0'));var util=require(_0xbfd3('0x1'));var _=require(_0xbfd3('0x2'));var squel=require(_0xbfd3('0x3'));var Redis=require(_0xbfd3('0x4'));var qs=require(_0xbfd3('0x5'));var logger=require(_0xbfd3('0x6'))(_0xbfd3('0x7'));var config=require('../../config/environment');var db=require(_0xbfd3('0x8'))['db'];config[_0xbfd3('0x9')]=_[_0xbfd3('0xa')](config[_0xbfd3('0x9')],{'host':_0xbfd3('0xb'),'port':0x18eb});var socket=require(_0xbfd3('0xc'))(new Redis(config['redis']));require(_0xbfd3('0xd'))[_0xbfd3('0xe')](socket);function respondWithStatusCode(_0x3b8fd5,_0x520d0e){_0x520d0e=_0x520d0e||0xcc;return function(_0x59810b){if(_0x59810b){return _0x3b8fd5[_0xbfd3('0xf')](_0x520d0e);}return _0x3b8fd5['status'](_0x520d0e)[_0xbfd3('0x10')]();};}function respondWithResult(_0x2f3ef9,_0x373c10){_0x373c10=_0x373c10||0xc8;return function(_0x5bee33){if(_0x5bee33){return _0x2f3ef9[_0xbfd3('0x11')](_0x373c10)['json'](_0x5bee33);}};}function respondWithFilteredResult(_0x3986d7,_0x179007){return function(_0x2cccf7){if(_0x2cccf7){var _0x252ef5=typeof _0x179007[_0xbfd3('0x12')]===_0xbfd3('0x13')&&typeof _0x179007[_0xbfd3('0x14')]===_0xbfd3('0x13');var _0x4c3525=_0x2cccf7[_0xbfd3('0x15')];var _0x10bf8b=_0x252ef5?0x0:_0x179007[_0xbfd3('0x12')];var _0x19a4c5=_0x252ef5?_0x2cccf7[_0xbfd3('0x15')]:_0x179007[_0xbfd3('0x12')]+_0x179007[_0xbfd3('0x14')];var _0xb03106;if(_0x19a4c5>=_0x4c3525){_0x19a4c5=_0x4c3525;_0xb03106=0xc8;}else{_0xb03106=0xce;}_0x3986d7[_0xbfd3('0x11')](_0xb03106);return _0x3986d7['set']('Content-Range',_0x10bf8b+'-'+_0x19a4c5+'/'+_0x4c3525)['json'](_0x2cccf7);}return null;};}function saveUpdates(_0x1937b2){return function(_0x5e77a5){if(_0x5e77a5){return _0x5e77a5[_0xbfd3('0x16')](_0x1937b2)[_0xbfd3('0x17')](function(_0x54fd60){return _0x54fd60;});}return null;};}function removeEntity(_0x5d8ddd){return function(_0x4222d1){if(_0x4222d1){return _0x4222d1[_0xbfd3('0x18')]()[_0xbfd3('0x17')](function(){var _0x55562e=_0x4222d1[_0xbfd3('0x19')]({'plain':!![]});var _0x41f8cf=_0xbfd3('0x1a');return db[_0xbfd3('0x1b')][_0xbfd3('0x18')]({'where':{'type':_0x41f8cf,'resourceId':_0x55562e['id']}})[_0xbfd3('0x17')](function(){return _0x4222d1;});})[_0xbfd3('0x17')](function(){_0x5d8ddd['status'](0xcc)[_0xbfd3('0x10')]();});}};}function handleEntityNotFound(_0x1206f8){return function(_0x1205bd){if(!_0x1205bd){_0x1206f8[_0xbfd3('0xf')](0x194);}return _0x1205bd;};}function handleError(_0x124fb9,_0x567481){_0x567481=_0x567481||0x1f4;return function(_0x2f488f){logger[_0xbfd3('0x1c')](_0x2f488f['stack']);if(_0x2f488f['name']){delete _0x2f488f['name'];}_0x124fb9[_0xbfd3('0x11')](_0x567481)[_0xbfd3('0x1d')](_0x2f488f);};}exports[_0xbfd3('0x1e')]=function(_0x1bda14,_0x5be9df){var _0x2cd86f={};var _0x3e84ed={'count':0x0,'rows':[]};var _0x29c80c=_[_0xbfd3('0x1f')](db[_0xbfd3('0x20')][_0xbfd3('0x21')],function(_0x5b6efe){return{'name':_0x5b6efe['fieldName'],'type':_0x5b6efe['type'][_0xbfd3('0x22')]};});_0x2cd86f=qs[_0xbfd3('0x23')](_0x29c80c,_0x1bda14);var _0x39741e={'where':_0x2cd86f[_0xbfd3('0x24')]};return db[_0xbfd3('0x20')][_0xbfd3('0x15')](_0x39741e)[_0xbfd3('0x17')](function(_0x2ca752){_0x3e84ed[_0xbfd3('0x15')]=_0x2ca752;_0x2cd86f[_0xbfd3('0x25')]=qs[_0xbfd3('0x25')](_0x1bda14[_0xbfd3('0x26')]);return db['WhatsappQueue'][_0xbfd3('0x27')](_0x2cd86f);})[_0xbfd3('0x17')](function(_0x147003){_0x3e84ed['rows']=_0x147003;return _0x3e84ed;})[_0xbfd3('0x17')](respondWithFilteredResult(_0x5be9df,_0x2cd86f))[_0xbfd3('0x28')](handleError(_0x5be9df,null));};exports['show']=function(_0x3ea5be,_0x284698){var _0x2cab1f={'raw':!![],'where':{'id':_0x3ea5be[_0xbfd3('0x29')]['id']}},_0xaf56d3={};_0xaf56d3[_0xbfd3('0x2a')]=_[_0xbfd3('0x2b')](db['WhatsappQueue']['rawAttributes']);_0xaf56d3[_0xbfd3('0x26')]=_[_0xbfd3('0x2b')](_0x3ea5be[_0xbfd3('0x26')]);_0xaf56d3['filters']=_[_0xbfd3('0x2c')](_0xaf56d3[_0xbfd3('0x2a')],_0xaf56d3[_0xbfd3('0x26')]);_0x2cab1f[_0xbfd3('0x2d')]=_[_0xbfd3('0x2c')](_0xaf56d3[_0xbfd3('0x2a')],qs[_0xbfd3('0x2e')](_0x3ea5be[_0xbfd3('0x26')][_0xbfd3('0x2e')]));_0x2cab1f[_0xbfd3('0x2d')]=_0x2cab1f['attributes']['length']?_0x2cab1f[_0xbfd3('0x2d')]:_0xaf56d3[_0xbfd3('0x2a')];if(_0x3ea5be[_0xbfd3('0x26')][_0xbfd3('0x2f')]){_0x2cab1f[_0xbfd3('0x25')]=[{'all':!![]}];}_0x2cab1f=_['merge']({},_0x2cab1f,_0x3ea5be[_0xbfd3('0x30')]);return db[_0xbfd3('0x20')][_0xbfd3('0x31')](_0x2cab1f)[_0xbfd3('0x17')](handleEntityNotFound(_0x284698,null))[_0xbfd3('0x17')](respondWithResult(_0x284698,null))[_0xbfd3('0x28')](handleError(_0x284698,null));};exports[_0xbfd3('0x32')]=function(_0x327dab,_0x4d8e33){return db[_0xbfd3('0x20')][_0xbfd3('0x32')](_0x327dab['body'],{})[_0xbfd3('0x17')](function(_0x308641){var _0xd31ea7=_0x327dab['user']['get']({'plain':!![]});if(!_0xd31ea7)throw new Error(_0xbfd3('0x33'));if(_0xd31ea7[_0xbfd3('0x34')]===_0xbfd3('0x35')){var _0x388d76=_0x308641['get']({'plain':!![]});var _0xdf85da=_0xbfd3('0x1a');return db[_0xbfd3('0x36')][_0xbfd3('0x31')]({'where':{'name':_0xdf85da,'userProfileId':_0xd31ea7[_0xbfd3('0x37')]},'raw':!![]})[_0xbfd3('0x17')](function(_0x46c3e3){if(_0x46c3e3&&_0x46c3e3['autoAssociation']===0x0){return db[_0xbfd3('0x1b')][_0xbfd3('0x32')]({'name':_0x388d76[_0xbfd3('0x38')],'resourceId':_0x388d76['id'],'type':_0x46c3e3[_0xbfd3('0x38')],'sectionId':_0x46c3e3['id']},{})['then'](function(){return _0x308641;});}else{return _0x308641;}})[_0xbfd3('0x28')](function(_0x5407bf){logger[_0xbfd3('0x1c')](_0xbfd3('0x39'),_0x5407bf);throw _0x5407bf;});}return _0x308641;})[_0xbfd3('0x17')](respondWithResult(_0x4d8e33,0xc9))['catch'](handleError(_0x4d8e33,null));};exports[_0xbfd3('0x16')]=function(_0x314797,_0x2c4bb6){if(_0x314797[_0xbfd3('0x3a')]['id']){delete _0x314797[_0xbfd3('0x3a')]['id'];}return db[_0xbfd3('0x20')][_0xbfd3('0x31')]({'where':{'id':_0x314797[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](handleEntityNotFound(_0x2c4bb6,null))[_0xbfd3('0x17')](saveUpdates(_0x314797[_0xbfd3('0x3a')],null))['then'](respondWithResult(_0x2c4bb6,null))[_0xbfd3('0x28')](handleError(_0x2c4bb6,null));};exports[_0xbfd3('0x18')]=function(_0x1477a5,_0x17e2c0){return db[_0xbfd3('0x20')][_0xbfd3('0x31')]({'where':{'id':_0x1477a5[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](handleEntityNotFound(_0x17e2c0,null))[_0xbfd3('0x17')](removeEntity(_0x17e2c0,null))['catch'](handleError(_0x17e2c0,null));};exports['describe']=function(_0x162b31,_0x429105){return db[_0xbfd3('0x20')][_0xbfd3('0x3b')]()[_0xbfd3('0x17')](respondWithResult(_0x429105,null))[_0xbfd3('0x28')](handleError(_0x429105,null));};exports[_0xbfd3('0x3c')]=function(_0x589638,_0x14d2cc){var _0x1deb60={'raw':!![],'where':{}},_0x6c2912={},_0x139d3e;return db[_0xbfd3('0x20')][_0xbfd3('0x3d')]({'where':{'id':_0x589638[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](handleEntityNotFound(_0x14d2cc,null))[_0xbfd3('0x17')](function(_0x4ce85c){if(_0x4ce85c){_0x139d3e=_0x4ce85c[_0xbfd3('0x19')]({'plain':!![]});_0x6c2912['model']=_['keys'](db[_0xbfd3('0x3e')][_0xbfd3('0x21')]);_0x6c2912[_0xbfd3('0x26')]=_[_0xbfd3('0x2b')](_0x589638['query']);_0x6c2912[_0xbfd3('0x3f')]=_[_0xbfd3('0x2c')](_0x6c2912[_0xbfd3('0x2a')],_0x6c2912[_0xbfd3('0x26')]);_0x1deb60['attributes']=_['intersection'](_0x6c2912['model'],qs[_0xbfd3('0x2e')](_0x589638['query'][_0xbfd3('0x2e')]));_0x1deb60['attributes']=_0x1deb60['attributes'][_0xbfd3('0x40')]?_0x1deb60[_0xbfd3('0x2d')]:_0x6c2912[_0xbfd3('0x2a')];if(!_0x589638['query'][_0xbfd3('0x41')](_0xbfd3('0x42'))){_0x1deb60[_0xbfd3('0x14')]=qs['limit'](_0x589638[_0xbfd3('0x26')][_0xbfd3('0x14')]);_0x1deb60[_0xbfd3('0x12')]=qs[_0xbfd3('0x12')](_0x589638['query'][_0xbfd3('0x12')]);}_0x1deb60[_0xbfd3('0x43')]=qs[_0xbfd3('0x44')](_0x589638[_0xbfd3('0x26')][_0xbfd3('0x44')]);_0x1deb60[_0xbfd3('0x24')]=qs[_0xbfd3('0x3f')](_[_0xbfd3('0x45')](_0x589638[_0xbfd3('0x26')],_0x6c2912['filters']));_0x1deb60[_0xbfd3('0x24')]['WhatsappQueueId']=_0x4ce85c['id'];if(_0x589638[_0xbfd3('0x26')]['filter']){_0x1deb60['where']=_[_0xbfd3('0x46')](_0x1deb60[_0xbfd3('0x24')],{'$or':_['map'](_0x1deb60[_0xbfd3('0x2d')],function(_0x540b45){var _0x1c8456={};_0x1c8456[_0x540b45]={'$like':'%'+_0x589638[_0xbfd3('0x26')][_0xbfd3('0x47')]+'%'};return _0x1c8456;})});}_0x1deb60=_['merge']({},_0x1deb60,_0x589638[_0xbfd3('0x30')]);return db[_0xbfd3('0x3e')][_0xbfd3('0x27')](_0x1deb60);}})[_0xbfd3('0x17')](function(_0x23b112){if(_0x23b112){return db[_0xbfd3('0x48')][_0xbfd3('0x49')]({'where':{'id':_[_0xbfd3('0x1f')](_0x23b112,'UserId'),'role':_0xbfd3('0x4a')},'attributes':['id','name','whatsappPause','updatedAt',_0xbfd3('0x4b')]});}})[_0xbfd3('0x17')](function(_0x418d33){if(_0x418d33){return{'count':_0x418d33['count'],'rows':_[_0xbfd3('0x1f')](_0x418d33[_0xbfd3('0x4c')],function(_0x6da4da){return{'membername':_0x6da4da[_0xbfd3('0x38')],'UserId':_0x6da4da['id'],'queue_name':_0x139d3e['name'],'WhatsappQueueId':_0x139d3e['id'],'interface':util[_0xbfd3('0x4d')](_0xbfd3('0x4e'),_0xbfd3('0x4f'),_0x6da4da[_0xbfd3('0x38')]),'penalty':0x0,'paused':_0x6da4da[_0xbfd3('0x50')],'createdAt':_0x6da4da[_0xbfd3('0x4b')],'updatedAt':_0x6da4da[_0xbfd3('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbfd3('0x17')](respondWithFilteredResult(_0x14d2cc,_0x1deb60))[_0xbfd3('0x28')](handleError(_0x14d2cc,null));};exports['getTeams']=function(_0x261cd6,_0x82398e){var _0x1a5b07={};var _0x438f22={};var _0x430a7b;var _0x410826;return db[_0xbfd3('0x20')][_0xbfd3('0x3d')]({'where':{'id':_0x261cd6[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](handleEntityNotFound(_0x82398e,null))[_0xbfd3('0x17')](function(_0x1598f4){if(_0x1598f4){_0x430a7b=_0x1598f4;_0x438f22[_0xbfd3('0x2a')]=_['keys'](db[_0xbfd3('0x52')][_0xbfd3('0x21')]);_0x438f22[_0xbfd3('0x26')]=_[_0xbfd3('0x2b')](_0x261cd6[_0xbfd3('0x26')]);_0x438f22[_0xbfd3('0x3f')]=_['intersection'](_0x438f22['model'],_0x438f22[_0xbfd3('0x26')]);_0x1a5b07[_0xbfd3('0x2d')]=_[_0xbfd3('0x2c')](_0x438f22[_0xbfd3('0x2a')],qs[_0xbfd3('0x2e')](_0x261cd6['query'][_0xbfd3('0x2e')]));_0x1a5b07[_0xbfd3('0x2d')]=_0x1a5b07[_0xbfd3('0x2d')][_0xbfd3('0x40')]?_0x1a5b07[_0xbfd3('0x2d')]:_0x438f22[_0xbfd3('0x2a')];_0x1a5b07[_0xbfd3('0x43')]=qs[_0xbfd3('0x44')](_0x261cd6[_0xbfd3('0x26')][_0xbfd3('0x44')]);_0x1a5b07[_0xbfd3('0x24')]=qs[_0xbfd3('0x3f')](_['pick'](_0x261cd6[_0xbfd3('0x26')],_0x438f22[_0xbfd3('0x3f')]));if(_0x261cd6[_0xbfd3('0x26')][_0xbfd3('0x47')]){_0x1a5b07[_0xbfd3('0x24')]=_['merge'](_0x1a5b07[_0xbfd3('0x24')],{'$or':_[_0xbfd3('0x1f')](_0x1a5b07['attributes'],function(_0x58efb7){var _0x1c9996={};_0x1c9996[_0x58efb7]={'$like':'%'+_0x261cd6[_0xbfd3('0x26')][_0xbfd3('0x47')]+'%'};return _0x1c9996;})});}_0x1a5b07=_[_0xbfd3('0x46')]({},_0x1a5b07,_0x261cd6['options']);return _0x430a7b[_0xbfd3('0x53')](_0x1a5b07);}})[_0xbfd3('0x17')](function(_0x532c96){if(_0x532c96){_0x410826=_0x532c96[_0xbfd3('0x40')];if(!_0x261cd6[_0xbfd3('0x26')][_0xbfd3('0x41')](_0xbfd3('0x42'))){_0x1a5b07[_0xbfd3('0x14')]=qs[_0xbfd3('0x14')](_0x261cd6[_0xbfd3('0x26')][_0xbfd3('0x14')]);_0x1a5b07[_0xbfd3('0x12')]=qs['offset'](_0x261cd6['query'][_0xbfd3('0x12')]);}return _0x430a7b['getTeams'](_0x1a5b07);}})[_0xbfd3('0x17')](function(_0x402e33){if(_0x402e33){return _0x402e33?{'count':_0x410826,'rows':_0x402e33}:null;}})[_0xbfd3('0x17')](respondWithResult(_0x82398e,null))['catch'](handleError(_0x82398e,null));};exports[_0xbfd3('0x54')]=function(_0x1cf332,_0x2a94ec){var _0x550024=_0x1cf332['body']['ids'];return db[_0xbfd3('0x52')]['findAll']({'where':{'id':_0x550024},'attributes':['id'],'include':[{'model':db[_0xbfd3('0x48')],'as':_0xbfd3('0x55'),'attributes':['id',_0xbfd3('0x38'),_0xbfd3('0x56'),_0xbfd3('0x57'),_0xbfd3('0x58')],'raw':!![]}]})[_0xbfd3('0x17')](function(_0x3c7bd8){if(_0x3c7bd8){var _0x2520aa=_[_0xbfd3('0x59')](_0x3c7bd8,function(_0x57e43e){var _0x5d2bc2=_0x57e43e[_0xbfd3('0x19')]({'plain':!![]});return _0x5d2bc2[_0xbfd3('0x55')];});return db[_0xbfd3('0x20')][_0xbfd3('0x31')]({'where':{'id':_0x1cf332[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](function(_0x37dac8){return db[_0xbfd3('0x5a')][_0xbfd3('0x5b')](function(_0x29a74e){return _0x37dac8['addTeams'](_0x550024,{'transaction':_0x29a74e})[_0xbfd3('0x17')](function(){return BPromise['each'](_0x2520aa,function(_0x447e7c){return db[_0xbfd3('0x3e')]['findOrCreate']({'where':{'UserId':_0x447e7c['id'],'WhatsappQueueId':_0x1cf332[_0xbfd3('0x29')]['id']},'transaction':_0x29a74e});});})[_0xbfd3('0x17')](function(){_0x2520aa['forEach'](function(_0x5338f6){socket['emit']('userWhatsappQueue:save',{'UserId':_0x5338f6['id'],'WhatsappQueueId':_0x37dac8['id']});});});});});}})['then'](respondWithStatusCode(_0x2a94ec,null))[_0xbfd3('0x28')](handleError(_0x2a94ec,null));};exports[_0xbfd3('0x5c')]=function(_0x4981d5,_0x2bd799){return db['Team'][_0xbfd3('0x27')]({'where':{'id':_0x4981d5[_0xbfd3('0x26')][_0xbfd3('0x5d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbfd3('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2bd799,null))['then'](function(_0x342a38){var _0x50d1bd=_[_0xbfd3('0x1f')](_0x342a38,'id');var _0x45f73f=[];var _0x4eebe2=[];var _0x57425e=squel[_0xbfd3('0x5e')]();_0x57425e[_0xbfd3('0x5f')](_0xbfd3('0x60'))['from'](_0xbfd3('0x61'),'tq')[_0xbfd3('0x62')]('user_has_teams','ut',_0xbfd3('0x63'))[_0xbfd3('0x24')]('WhatsappQueueId\x20=\x20?',_0x4981d5['params']['id']);for(var _0x37aeba=0x0;_0x37aeba<_0x342a38[_0xbfd3('0x40')];_0x37aeba+=0x1){let _0x376908=_0x342a38[_0x37aeba];for(var _0x3f57f9=0x0;_0x3f57f9<_0x376908[_0xbfd3('0x55')]['length'];_0x3f57f9+=0x1){let _0x487567=_0x376908[_0xbfd3('0x55')][_0x3f57f9];var _0xa304c=_0x57425e[_0xbfd3('0x64')]();_0xa304c[_0xbfd3('0x24')](_0xbfd3('0x65'),_0x487567['id']);_0x4eebe2['push'](db['sequelize'][_0xbfd3('0x26')](_0xa304c[_0xbfd3('0x66')](),{'type':db['sequelize'][_0xbfd3('0x67')][_0xbfd3('0x68')]})[_0xbfd3('0x17')](function(_0x4c97e0){if(_0x4c97e0[_0xbfd3('0x40')]===0x1){return _0x487567['id'];}else{var _0x267517=_[_0xbfd3('0x69')](_[_0xbfd3('0x1f')](_0x4c97e0,_0xbfd3('0x6a')),function(_0x5f19ea){return _[_0xbfd3('0x6b')](_0x50d1bd,_0x5f19ea);});if(_0x267517){return _0x487567['id'];}}}));}}return BPromise['all'](_0x4eebe2)[_0xbfd3('0x17')](function(_0x5b34be){_0x45f73f=_(_0x45f73f)[_0xbfd3('0x6c')](_0x5b34be)[_0xbfd3('0x6d')]()[_0xbfd3('0x6e')]();return db[_0xbfd3('0x20')][_0xbfd3('0x31')]({'where':{'id':_0x4981d5[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](function(_0x45a6e6){return db[_0xbfd3('0x5a')][_0xbfd3('0x5b')](function(_0x362e75){return _0x45a6e6['removeTeams'](_0x4981d5[_0xbfd3('0x26')][_0xbfd3('0x5d')],{'transaction':_0x362e75})[_0xbfd3('0x17')](function(){if(!_[_0xbfd3('0x6f')](_0x45f73f)){return _0x45a6e6[_0xbfd3('0x70')](_0x45f73f,{'transaction':_0x362e75});}})['then'](function(){_0x45f73f[_0xbfd3('0x71')](function(_0x1d76c8){socket[_0xbfd3('0x72')](_0xbfd3('0x73'),{'UserId':_0x1d76c8,'WhatsappQueueId':_0x45a6e6['id']});});});});});});})[_0xbfd3('0x17')](respondWithStatusCode(_0x2bd799,null))[_0xbfd3('0x28')](handleError(_0x2bd799,null));};exports[_0xbfd3('0x74')]=function(_0x3b11eb,_0x541c04){return db[_0xbfd3('0x20')]['find']({'where':{'id':_0x3b11eb[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](handleEntityNotFound(_0x541c04,null))[_0xbfd3('0x17')](function(_0x2df7e0){if(_0x2df7e0){return _0x2df7e0['addAgents'](_0x3b11eb[_0xbfd3('0x3a')]['ids'],_['omit'](_0x3b11eb[_0xbfd3('0x3a')],[_0xbfd3('0x5d'),'id'])||{})[_0xbfd3('0x75')](function(_0x1f4a1a){for(var _0x36d78b=0x0;_0x36d78b<_0x3b11eb['body']['ids'][_0xbfd3('0x40')];_0x36d78b+=0x1){socket['emit'](_0xbfd3('0x76'),{'UserId':Number(_0x3b11eb['body'][_0xbfd3('0x5d')][_0x36d78b]),'WhatsappQueueId':Number(_0x3b11eb[_0xbfd3('0x29')]['id'])});}return _0x1f4a1a;});}})[_0xbfd3('0x17')](respondWithResult(_0x541c04,null))[_0xbfd3('0x28')](handleError(_0x541c04,null));};exports[_0xbfd3('0x70')]=function(_0x416322,_0x5ecd34){return db[_0xbfd3('0x20')][_0xbfd3('0x31')]({'where':{'id':_0x416322[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](handleEntityNotFound(_0x5ecd34,null))[_0xbfd3('0x17')](function(_0x249e44){if(_0x249e44){return _0x249e44[_0xbfd3('0x70')](_0x416322['query'][_0xbfd3('0x5d')])[_0xbfd3('0x17')](function(){if(_[_0xbfd3('0x77')](_0x416322[_0xbfd3('0x26')]['ids'])){for(var _0x4db798=0x0;_0x4db798<_0x416322[_0xbfd3('0x26')][_0xbfd3('0x5d')][_0xbfd3('0x40')];_0x4db798+=0x1){socket[_0xbfd3('0x72')](_0xbfd3('0x73'),{'UserId':Number(_0x416322[_0xbfd3('0x26')][_0xbfd3('0x5d')][_0x4db798]),'WhatsappQueueId':Number(_0x416322[_0xbfd3('0x29')]['id'])});}}else{socket['emit'](_0xbfd3('0x73'),{'UserId':Number(_0x416322[_0xbfd3('0x26')]['ids']),'WhatsappQueueId':Number(_0x416322[_0xbfd3('0x29')]['id'])});}});}})[_0xbfd3('0x17')](respondWithStatusCode(_0x5ecd34,null))[_0xbfd3('0x28')](handleError(_0x5ecd34,null));};exports[_0xbfd3('0x78')]=function(_0x24203c,_0x4758d4){var _0x46b55b={};var _0x3a37bf={};var _0x58d8a9;var _0x22e834;return db['WhatsappQueue'][_0xbfd3('0x3d')]({'where':{'id':_0x24203c[_0xbfd3('0x29')]['id']}})[_0xbfd3('0x17')](handleEntityNotFound(_0x4758d4,null))[_0xbfd3('0x17')](function(_0x21b4e4){if(_0x21b4e4){_0x58d8a9=_0x21b4e4;_0x3a37bf[_0xbfd3('0x2a')]=_['keys'](db[_0xbfd3('0x48')][_0xbfd3('0x21')]);_0x3a37bf[_0xbfd3('0x26')]=_['keys'](_0x24203c[_0xbfd3('0x26')]);_0x3a37bf[_0xbfd3('0x3f')]=_[_0xbfd3('0x2c')](_0x3a37bf['model'],_0x3a37bf[_0xbfd3('0x26')]);_0x46b55b['attributes']=_[_0xbfd3('0x2c')](_0x3a37bf['model'],qs[_0xbfd3('0x2e')](_0x24203c[_0xbfd3('0x26')][_0xbfd3('0x2e')]));_0x46b55b[_0xbfd3('0x2d')]=_0x46b55b[_0xbfd3('0x2d')][_0xbfd3('0x40')]?_0x46b55b[_0xbfd3('0x2d')]:_0x3a37bf[_0xbfd3('0x2a')];_0x46b55b['order']=qs[_0xbfd3('0x44')](_0x24203c[_0xbfd3('0x26')][_0xbfd3('0x44')]);_0x46b55b[_0xbfd3('0x24')]=qs['filters'](_[_0xbfd3('0x45')](_0x24203c[_0xbfd3('0x26')],_0x3a37bf['filters']));if(_0x24203c['query'][_0xbfd3('0x47')]){_0x46b55b[_0xbfd3('0x24')]=_[_0xbfd3('0x46')](_0x46b55b[_0xbfd3('0x24')],{'$or':_[_0xbfd3('0x1f')](_0x46b55b[_0xbfd3('0x2d')],function(_0x4ee398){var _0x26e0d0={};_0x26e0d0[_0x4ee398]={'$like':'%'+_0x24203c[_0xbfd3('0x26')]['filter']+'%'};return _0x26e0d0;})});}_0x46b55b=_[_0xbfd3('0x46')]({},_0x46b55b,_0x24203c[_0xbfd3('0x30')]);return _0x58d8a9[_0xbfd3('0x78')](_0x46b55b);}})[_0xbfd3('0x17')](function(_0x25878c){if(_0x25878c){_0x22e834=_0x25878c[_0xbfd3('0x40')];if(!_0x24203c[_0xbfd3('0x26')][_0xbfd3('0x41')](_0xbfd3('0x42'))){_0x46b55b[_0xbfd3('0x14')]=qs[_0xbfd3('0x14')](_0x24203c[_0xbfd3('0x26')][_0xbfd3('0x14')]);_0x46b55b[_0xbfd3('0x12')]=qs['offset'](_0x24203c[_0xbfd3('0x26')]['offset']);}return _0x58d8a9[_0xbfd3('0x78')](_0x46b55b);}})['then'](function(_0x175d8c){if(_0x175d8c){return _0x175d8c?{'count':_0x22e834,'rows':_0x175d8c}:null;}})[_0xbfd3('0x17')](respondWithResult(_0x4758d4,null))[_0xbfd3('0x28')](handleError(_0x4758d4,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 4c8baad..f8c38f9 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 _0x75e7=['save','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x75e7,0x8c));var _0x775e=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x75e7[_0x266618];return _0x54dbf5;};'use strict';var EventEmitter=require(_0x775e('0x0'));var WhatsappQueue=require(_0x775e('0x1'))['db'][_0x775e('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x775e('0x3')](0x0);var events={'afterCreate':_0x775e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x379153){return function(_0x946218,_0x2edf50,_0x4dc751){WhatsappQueueEvents[_0x775e('0x5')](_0x379153+':'+_0x946218['id'],_0x946218);WhatsappQueueEvents[_0x775e('0x5')](_0x379153,_0x946218);_0x4dc751(null);};}for(var e in events){if(events[_0x775e('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x775e('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xa9a6=['WhatsappQueue','setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x49a1b6,_0x5c9e25){var _0x1612e6=function(_0x8e0186){while(--_0x8e0186){_0x49a1b6['push'](_0x49a1b6['shift']());}};_0x1612e6(++_0x5c9e25);}(_0xa9a6,0x1bf));var _0x6a9a=function(_0x184f64,_0xb0e5d2){_0x184f64=_0x184f64-0x0;var _0x393499=_0xa9a6[_0x184f64];return _0x393499;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x6a9a('0x0'))['db'][_0x6a9a('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6a9a('0x2')](0x0);var events={'afterCreate':_0x6a9a('0x3'),'afterUpdate':'update','afterDestroy':_0x6a9a('0x4')};function emitEvent(_0x2e318a){return function(_0x2e5490,_0x1b742f,_0x42f6b3){WhatsappQueueEvents[_0x6a9a('0x5')](_0x2e318a+':'+_0x2e5490['id'],_0x2e5490);WhatsappQueueEvents[_0x6a9a('0x5')](_0x2e318a,_0x2e5490);_0x42f6b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x6a9a('0x6')](e,emitEvent(event));}}module[_0x6a9a('0x7')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 003bc76..ac729a9 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 _0x8fd7=['../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','path','rimraf'];(function(_0x4eff15,_0x3b0788){var _0x42d69f=function(_0x7625bb){while(--_0x7625bb){_0x4eff15['push'](_0x4eff15['shift']());}};_0x42d69f(++_0x3b0788);}(_0x8fd7,0x1bc));var _0x78fd=function(_0x37a539,_0x134810){_0x37a539=_0x37a539-0x0;var _0x5067b1=_0x8fd7[_0x37a539];return _0x5067b1;};'use strict';var _=require('lodash');var util=require(_0x78fd('0x0'));var logger=require(_0x78fd('0x1'))(_0x78fd('0x2'));var moment=require(_0x78fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x78fd('0x4'));var rimraf=require(_0x78fd('0x5'));var config=require(_0x78fd('0x6'));var attributes=require(_0x78fd('0x7'));module['exports']=function(_0x16fba6,_0x2b1a33){return _0x16fba6['define'](_0x78fd('0x8'),attributes,{'tableName':_0x78fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc3c=['../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2a7c2d,_0x20816f){var _0xc257a=function(_0x2e1498){while(--_0x2e1498){_0x2a7c2d['push'](_0x2a7c2d['shift']());}};_0xc257a(++_0x20816f);}(_0xbc3c,0x1f3));var _0xcbc3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbc3c[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xcbc3('0x0'));var util=require('util');var logger=require(_0xcbc3('0x1'))(_0xcbc3('0x2'));var moment=require(_0xcbc3('0x3'));var BPromise=require(_0xcbc3('0x4'));var rp=require(_0xcbc3('0x5'));var fs=require('fs');var path=require(_0xcbc3('0x6'));var rimraf=require(_0xcbc3('0x7'));var config=require(_0xcbc3('0x8'));var attributes=require(_0xcbc3('0x9'));module['exports']=function(_0xd272ea,_0x107bd4){return _0xd272ea[_0xcbc3('0xa')](_0xcbc3('0xb'),attributes,{'tableName':_0xcbc3('0xc'),'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 69ab108..1abb3d6 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 _0xdd11=['map','model','catch','ShowWhatsappQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xdd11,0x165));var _0x1dd1=function(_0x1cd577,_0x180f2a){_0x1cd577=_0x1cd577-0x0;var _0x790837=_0xdd11[_0x1cd577];return _0x790837;};'use strict';var _=require(_0x1dd1('0x0'));var util=require(_0x1dd1('0x1'));var moment=require(_0x1dd1('0x2'));var BPromise=require(_0x1dd1('0x3'));var rs=require(_0x1dd1('0x4'));var fs=require('fs');var Redis=require(_0x1dd1('0x5'));var db=require(_0x1dd1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dd1('0x7'))(_0x1dd1('0x8'));var config=require(_0x1dd1('0x9'));var jayson=require(_0x1dd1('0xa'));var client=jayson[_0x1dd1('0xb')][_0x1dd1('0xc')]({'port':0x232a});config[_0x1dd1('0xd')]=_[_0x1dd1('0xe')](config[_0x1dd1('0xd')],{'host':_0x1dd1('0xf'),'port':0x18eb});var socket=require(_0x1dd1('0x10'))(new Redis(config[_0x1dd1('0xd')]));require(_0x1dd1('0x11'))[_0x1dd1('0x12')](socket);function respondWithRpcPromise(_0x197981,_0x1dbefc,_0x3a0d98){return new BPromise(function(_0x26c02e,_0x3e8917){return client['request'](_0x197981,_0x3a0d98)[_0x1dd1('0x13')](function(_0x595ae1){logger[_0x1dd1('0x14')](_0x1dd1('0x15'),_0x1dbefc,_0x1dd1('0x16'));logger[_0x1dd1('0x17')](_0x1dd1('0x18'),_0x1dbefc,'request\x20sent',JSON[_0x1dd1('0x19')](_0x595ae1));if(_0x595ae1[_0x1dd1('0x1a')]){if(_0x595ae1[_0x1dd1('0x1a')][_0x1dd1('0x1b')]===0x1f4){logger[_0x1dd1('0x1a')](_0x1dd1('0x15'),_0x1dbefc,_0x595ae1[_0x1dd1('0x1a')][_0x1dd1('0x1c')]);return _0x3e8917(_0x595ae1[_0x1dd1('0x1a')]['message']);}logger['error'](_0x1dd1('0x15'),_0x1dbefc,_0x595ae1[_0x1dd1('0x1a')]['message']);return _0x26c02e(_0x595ae1['error'][_0x1dd1('0x1c')]);}else{logger['info'](_0x1dd1('0x15'),_0x1dbefc,_0x1dd1('0x16'));_0x26c02e(_0x595ae1[_0x1dd1('0x1d')][_0x1dd1('0x1c')]);}})['catch'](function(_0x44ccfb){logger[_0x1dd1('0x1a')]('WhatsappQueue,\x20%s,\x20%s',_0x1dbefc,_0x44ccfb);_0x3e8917(_0x44ccfb);});});}exports[_0x1dd1('0x1e')]=function(_0x48687e){var _0x38548a=this;return new Promise(function(_0x65a184,_0x1b3005){return db[_0x1dd1('0x1f')][_0x1dd1('0x20')]({'raw':_0x48687e[_0x1dd1('0x21')]?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x22')]===undefined?!![]:![]:!![],'where':_0x48687e['options']?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x23')]||null:null,'attributes':_0x48687e['options']?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x24')]||null:null,'limit':_0x48687e['options']?_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x25')]||null:null,'include':_0x48687e[_0x1dd1('0x21')]?_0x48687e['options'][_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x48687e[_0x1dd1('0x21')][_0x1dd1('0x26')],function(_0x2babbd){return{'model':db[_0x2babbd['model']],'as':_0x2babbd['as'],'attributes':_0x2babbd[_0x1dd1('0x24')],'include':_0x2babbd[_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x2babbd[_0x1dd1('0x26')],function(_0x576c16){return{'model':db[_0x576c16[_0x1dd1('0x28')]],'as':_0x576c16['as'],'attributes':_0x576c16[_0x1dd1('0x24')],'include':_0x576c16['include']?_['map'](_0x576c16['include'],function(_0x4707fe){return{'model':db[_0x4707fe[_0x1dd1('0x28')]],'as':_0x4707fe['as'],'attributes':_0x4707fe[_0x1dd1('0x24')]};}):[]};}):[]};}):[]:[]})[_0x1dd1('0x13')](function(_0x54ddda){logger['info'](_0x1dd1('0x1e'),_0x48687e);logger[_0x1dd1('0x17')]('GetWhatsappQueue',_0x48687e,JSON['stringify'](_0x54ddda));_0x65a184(_0x54ddda);})[_0x1dd1('0x29')](function(_0xf6b8f2){logger[_0x1dd1('0x1a')](_0x1dd1('0x1e'),_0xf6b8f2[_0x1dd1('0x1c')],_0x48687e);_0x1b3005(_0x38548a['error'](0x1f4,_0xf6b8f2[_0x1dd1('0x1c')]));});});};exports[_0x1dd1('0x2a')]=function(_0x233f17){var _0x55160a=this;return new Promise(function(_0x1a4057,_0xa49937){return db[_0x1dd1('0x1f')][_0x1dd1('0x2b')]({'raw':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')][_0x1dd1('0x22')]===undefined?!![]:![]:!![],'where':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')]['where']||null:null,'attributes':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')][_0x1dd1('0x24')]||null:null,'include':_0x233f17[_0x1dd1('0x21')]?_0x233f17[_0x1dd1('0x21')][_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x233f17[_0x1dd1('0x21')]['include'],function(_0x1a8fb5){return{'model':db[_0x1a8fb5[_0x1dd1('0x28')]],'as':_0x1a8fb5['as'],'attributes':_0x1a8fb5[_0x1dd1('0x24')],'include':_0x1a8fb5[_0x1dd1('0x26')]?_[_0x1dd1('0x27')](_0x1a8fb5[_0x1dd1('0x26')],function(_0x4e0fa5){return{'model':db[_0x4e0fa5['model']],'as':_0x4e0fa5['as'],'attributes':_0x4e0fa5[_0x1dd1('0x24')],'include':_0x4e0fa5['include']?_[_0x1dd1('0x27')](_0x4e0fa5[_0x1dd1('0x26')],function(_0x497217){return{'model':db[_0x497217[_0x1dd1('0x28')]],'as':_0x497217['as'],'attributes':_0x497217[_0x1dd1('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x345f23){logger[_0x1dd1('0x14')](_0x1dd1('0x2a'),_0x233f17);logger[_0x1dd1('0x17')](_0x1dd1('0x2a'),_0x233f17,JSON['stringify'](_0x345f23));_0x1a4057(_0x345f23);})['catch'](function(_0x42ae95){logger[_0x1dd1('0x1a')](_0x1dd1('0x2a'),_0x42ae95['message'],_0x233f17);_0xa49937(_0x55160a[_0x1dd1('0x1a')](0x1f4,_0x42ae95[_0x1dd1('0x1c')]));});});}; \ No newline at end of file +var _0xb39d=['request\x20sent','debug','stringify','error','code','message','info','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','include','map','model','catch','find','ShowWhatsappQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','WhatsappQueue,\x20%s,\x20%s'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xb39d,0x184));var _0xdb39=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xb39d[_0x1b6311];return _0x25aab6;};'use strict';var _=require(_0xdb39('0x0'));var util=require('util');var moment=require(_0xdb39('0x1'));var BPromise=require(_0xdb39('0x2'));var rs=require(_0xdb39('0x3'));var fs=require('fs');var Redis=require(_0xdb39('0x4'));var db=require(_0xdb39('0x5'))['db'];var utils=require(_0xdb39('0x6'));var logger=require(_0xdb39('0x7'))(_0xdb39('0x8'));var config=require(_0xdb39('0x9'));var jayson=require(_0xdb39('0xa'));var client=jayson[_0xdb39('0xb')][_0xdb39('0xc')]({'port':0x232a});config['redis']=_[_0xdb39('0xd')](config[_0xdb39('0xe')],{'host':_0xdb39('0xf'),'port':0x18eb});var socket=require(_0xdb39('0x10'))(new Redis(config['redis']));require(_0xdb39('0x11'))[_0xdb39('0x12')](socket);function respondWithRpcPromise(_0x302980,_0x145c47,_0x4971b0){return new BPromise(function(_0x171b92,_0x310cbf){return client[_0xdb39('0x13')](_0x302980,_0x4971b0)[_0xdb39('0x14')](function(_0x4da62d){logger['info'](_0xdb39('0x15'),_0x145c47,_0xdb39('0x16'));logger[_0xdb39('0x17')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x145c47,_0xdb39('0x16'),JSON[_0xdb39('0x18')](_0x4da62d));if(_0x4da62d[_0xdb39('0x19')]){if(_0x4da62d[_0xdb39('0x19')][_0xdb39('0x1a')]===0x1f4){logger[_0xdb39('0x19')](_0xdb39('0x15'),_0x145c47,_0x4da62d[_0xdb39('0x19')][_0xdb39('0x1b')]);return _0x310cbf(_0x4da62d['error'][_0xdb39('0x1b')]);}logger['error'](_0xdb39('0x15'),_0x145c47,_0x4da62d[_0xdb39('0x19')]['message']);return _0x171b92(_0x4da62d[_0xdb39('0x19')][_0xdb39('0x1b')]);}else{logger[_0xdb39('0x1c')](_0xdb39('0x15'),_0x145c47,_0xdb39('0x16'));_0x171b92(_0x4da62d['result'][_0xdb39('0x1b')]);}})['catch'](function(_0x2b798d){logger[_0xdb39('0x19')](_0xdb39('0x15'),_0x145c47,_0x2b798d);_0x310cbf(_0x2b798d);});});}exports[_0xdb39('0x1d')]=function(_0x3a0936){var _0x1ba886=this;return new Promise(function(_0x16b69b,_0x2e4e56){return db[_0xdb39('0x1e')]['findAll']({'raw':_0x3a0936[_0xdb39('0x1f')]?_0x3a0936[_0xdb39('0x1f')][_0xdb39('0x20')]===undefined?!![]:![]:!![],'where':_0x3a0936['options']?_0x3a0936[_0xdb39('0x1f')][_0xdb39('0x21')]||null:null,'attributes':_0x3a0936['options']?_0x3a0936[_0xdb39('0x1f')][_0xdb39('0x22')]||null:null,'limit':_0x3a0936['options']?_0x3a0936['options']['limit']||null:null,'include':_0x3a0936['options']?_0x3a0936['options'][_0xdb39('0x23')]?_[_0xdb39('0x24')](_0x3a0936[_0xdb39('0x1f')]['include'],function(_0x5d491d){return{'model':db[_0x5d491d[_0xdb39('0x25')]],'as':_0x5d491d['as'],'attributes':_0x5d491d['attributes'],'include':_0x5d491d['include']?_[_0xdb39('0x24')](_0x5d491d[_0xdb39('0x23')],function(_0x60e9cb){return{'model':db[_0x60e9cb[_0xdb39('0x25')]],'as':_0x60e9cb['as'],'attributes':_0x60e9cb[_0xdb39('0x22')],'include':_0x60e9cb[_0xdb39('0x23')]?_[_0xdb39('0x24')](_0x60e9cb['include'],function(_0x4efd4c){return{'model':db[_0x4efd4c[_0xdb39('0x25')]],'as':_0x4efd4c['as'],'attributes':_0x4efd4c[_0xdb39('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28bdb0){logger[_0xdb39('0x1c')](_0xdb39('0x1d'),_0x3a0936);logger['debug'](_0xdb39('0x1d'),_0x3a0936,JSON[_0xdb39('0x18')](_0x28bdb0));_0x16b69b(_0x28bdb0);})[_0xdb39('0x26')](function(_0x5307ef){logger['error'](_0xdb39('0x1d'),_0x5307ef[_0xdb39('0x1b')],_0x3a0936);_0x2e4e56(_0x1ba886[_0xdb39('0x19')](0x1f4,_0x5307ef[_0xdb39('0x1b')]));});});};exports['ShowWhatsappQueue']=function(_0x21f8f8){var _0x524e5f=this;return new Promise(function(_0x36c3e0,_0x1d6fbf){return db[_0xdb39('0x1e')][_0xdb39('0x27')]({'raw':_0x21f8f8[_0xdb39('0x1f')]?_0x21f8f8[_0xdb39('0x1f')][_0xdb39('0x20')]===undefined?!![]:![]:!![],'where':_0x21f8f8[_0xdb39('0x1f')]?_0x21f8f8[_0xdb39('0x1f')][_0xdb39('0x21')]||null:null,'attributes':_0x21f8f8[_0xdb39('0x1f')]?_0x21f8f8[_0xdb39('0x1f')][_0xdb39('0x22')]||null:null,'include':_0x21f8f8[_0xdb39('0x1f')]?_0x21f8f8['options'][_0xdb39('0x23')]?_['map'](_0x21f8f8[_0xdb39('0x1f')][_0xdb39('0x23')],function(_0x57e93e){return{'model':db[_0x57e93e[_0xdb39('0x25')]],'as':_0x57e93e['as'],'attributes':_0x57e93e[_0xdb39('0x22')],'include':_0x57e93e[_0xdb39('0x23')]?_[_0xdb39('0x24')](_0x57e93e[_0xdb39('0x23')],function(_0x696621){return{'model':db[_0x696621['model']],'as':_0x696621['as'],'attributes':_0x696621[_0xdb39('0x22')],'include':_0x696621['include']?_[_0xdb39('0x24')](_0x696621['include'],function(_0x3659da){return{'model':db[_0x3659da[_0xdb39('0x25')]],'as':_0x3659da['as'],'attributes':_0x3659da['attributes']};}):[]};}):[]};}):[]:[]})[_0xdb39('0x14')](function(_0x4dd42a){logger[_0xdb39('0x1c')](_0xdb39('0x28'),_0x21f8f8);logger[_0xdb39('0x17')]('ShowWhatsappQueue',_0x21f8f8,JSON[_0xdb39('0x18')](_0x4dd42a));_0x36c3e0(_0x4dd42a);})[_0xdb39('0x26')](function(_0x5a8d3e){logger[_0xdb39('0x19')](_0xdb39('0x28'),_0x5a8d3e[_0xdb39('0x1b')],_0x21f8f8);_0x1d6fbf(_0x524e5f[_0xdb39('0x19')](0x1f4,_0x5a8d3e[_0xdb39('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 07527cf..91e6920 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 _0x278c=['length','whatsappQueue:','./whatsappQueue.events','save','remove','emit','removeListener','register'];(function(_0x389fb1,_0x431673){var _0x3d3520=function(_0x2dcab7){while(--_0x2dcab7){_0x389fb1['push'](_0x389fb1['shift']());}};_0x3d3520(++_0x431673);}(_0x278c,0xb2));var _0xc278=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x278c[_0x57a50d];return _0x1b25b3;};'use strict';var WhatsappQueueEvents=require(_0xc278('0x0'));var events=[_0xc278('0x1'),_0xc278('0x2'),'update'];function createListener(_0x35c8da,_0x19c77f){return function(_0xc95563){_0x19c77f[_0xc278('0x3')](_0x35c8da,_0xc95563);};}function removeListener(_0x4b0f40,_0x574a4a){return function(){WhatsappQueueEvents[_0xc278('0x4')](_0x4b0f40,_0x574a4a);};}exports[_0xc278('0x5')]=function(_0x574f54){for(var _0x2f4634=0x0,_0x2a5704=events[_0xc278('0x6')];_0x2f4634<_0x2a5704;_0x2f4634++){var _0x46e3a8=events[_0x2f4634];var _0x497785=createListener(_0xc278('0x7')+_0x46e3a8,_0x574f54);WhatsappQueueEvents['on'](_0x46e3a8,_0x497785);}}; \ No newline at end of file +var _0xb31f=['whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1ad99b,_0x54f63b){var _0xd12b80=function(_0x3df08b){while(--_0x3df08b){_0x1ad99b['push'](_0x1ad99b['shift']());}};_0xd12b80(++_0x54f63b);}(_0xb31f,0x196));var _0xfb31=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xb31f[_0x158f01];return _0x5ef74e;};'use strict';var WhatsappQueueEvents=require(_0xfb31('0x0'));var events=[_0xfb31('0x1'),_0xfb31('0x2'),_0xfb31('0x3')];function createListener(_0x14bcf6,_0x1c5fcd){return function(_0x142a14){_0x1c5fcd[_0xfb31('0x4')](_0x14bcf6,_0x142a14);};}function removeListener(_0x33e745,_0x162d04){return function(){WhatsappQueueEvents[_0xfb31('0x5')](_0x33e745,_0x162d04);};}exports[_0xfb31('0x6')]=function(_0x265c61){for(var _0xc53a6f=0x0,_0x20ff9a=events[_0xfb31('0x7')];_0xc53a6f<_0x20ff9a;_0xc53a6f++){var _0x45fe2f=events[_0xc53a6f];var _0x4cca7f=createListener(_0xfb31('0x8')+_0x45fe2f,_0x265c61);WhatsappQueueEvents['on'](_0x45fe2f,_0x4cca7f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 4374d44..b474217 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 _0x8b3f=['index','/describe','describe','/:id','show','create','delete','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8b3f,0xac));var _0xf8b3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8b3f[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0xf8b3('0x0'));var util=require('util');var path=require(_0xf8b3('0x1'));var timeout=require(_0xf8b3('0x2'));var express=require(_0xf8b3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf8b3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf8b3('0x5'));var controller=require('./whatsappQueueReport.controller');router[_0xf8b3('0x6')]('/',auth[_0xf8b3('0x7')](),controller[_0xf8b3('0x8')]);router['get'](_0xf8b3('0x9'),auth['isAuthenticated'](),controller[_0xf8b3('0xa')]);router[_0xf8b3('0x6')](_0xf8b3('0xb'),auth['isAuthenticated'](),controller[_0xf8b3('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf8b3('0xd')]);router['put'](_0xf8b3('0xb'),auth[_0xf8b3('0x7')](),controller['update']);router[_0xf8b3('0xe')](_0xf8b3('0xb'),auth[_0xf8b3('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfd0b=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x32b9c9,_0x5881e6){var _0x1a837f=function(_0x2edd85){while(--_0x2edd85){_0x32b9c9['push'](_0x32b9c9['shift']());}};_0x1a837f(++_0x5881e6);}(_0xfd0b,0xbe));var _0xbfd0=function(_0x3291c8,_0x31d97b){_0x3291c8=_0x3291c8-0x0;var _0x444d41=_0xfd0b[_0x3291c8];return _0x444d41;};'use strict';var multer=require(_0xbfd0('0x0'));var util=require(_0xbfd0('0x1'));var path=require('path');var timeout=require(_0xbfd0('0x2'));var express=require(_0xbfd0('0x3'));var router=express[_0xbfd0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbfd0('0x5'));var interaction=require(_0xbfd0('0x6'));var config=require(_0xbfd0('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0xbfd0('0x8')]('/',auth[_0xbfd0('0x9')](),controller['index']);router[_0xbfd0('0x8')](_0xbfd0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xbfd0('0x8')](_0xbfd0('0xb'),auth['isAuthenticated'](),controller[_0xbfd0('0xc')]);router['post']('/',auth[_0xbfd0('0x9')](),controller[_0xbfd0('0xd')]);router[_0xbfd0('0xe')]('/:id',auth[_0xbfd0('0x9')](),controller[_0xbfd0('0xf')]);router[_0xbfd0('0x10')](_0xbfd0('0xb'),auth[_0xbfd0('0x9')](),controller[_0xbfd0('0x11')]);module[_0xbfd0('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 5edab22..8dde28b 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(_0x2a5d4b,_0x45e559){var _0x35dcbe=function(_0x5a778d){while(--_0x5a778d){_0x2a5d4b['push'](_0x2a5d4b['shift']());}};_0x35dcbe(++_0x45e559);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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(_0x2dd93b,_0x30065b){var _0x25abe3=function(_0x1d28d6){while(--_0x1d28d6){_0x2dd93b['push'](_0x2dd93b['shift']());}};_0x25abe3(++_0x30065b);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 a9e2f4b..4059121 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 _0x1c9a=['eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','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','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe'];(function(_0x421446,_0x19af26){var _0x40e2a6=function(_0x254616){while(--_0x254616){_0x421446['push'](_0x421446['shift']());}};_0x40e2a6(++_0x19af26);}(_0x1c9a,0x98));var _0xa1c9=function(_0xdef90f,_0x9d4c48){_0xdef90f=_0xdef90f-0x0;var _0x3d4e1f=_0x1c9a[_0xdef90f];return _0x3d4e1f;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var hardwareService=require(_0xa1c9('0x12'));var logger=require(_0xa1c9('0x13'))(_0xa1c9('0x14'));var utils=require(_0xa1c9('0x15'));var config=require(_0xa1c9('0x16'));var licenseUtil=require(_0xa1c9('0x17'));var db=require(_0xa1c9('0x18'))['db'];function respondWithStatusCode(_0x17ee28,_0x57e2a8){_0x57e2a8=_0x57e2a8||0xcc;return function(_0x341233){if(_0x341233){return _0x17ee28[_0xa1c9('0x19')](_0x57e2a8);}return _0x17ee28[_0xa1c9('0x1a')](_0x57e2a8)[_0xa1c9('0x1b')]();};}function respondWithResult(_0x13f4e9,_0x4c70dd){_0x4c70dd=_0x4c70dd||0xc8;return function(_0x335dda){if(_0x335dda){return _0x13f4e9[_0xa1c9('0x1a')](_0x4c70dd)[_0xa1c9('0x1c')](_0x335dda);}};}function respondWithFilteredResult(_0xd9bca1,_0x2d825c){return function(_0x1bbc94){if(_0x1bbc94){var _0x44ab5b=typeof _0x2d825c[_0xa1c9('0x1d')]===_0xa1c9('0x1e')&&typeof _0x2d825c[_0xa1c9('0x1f')]==='undefined';var _0x11ca10=_0x1bbc94[_0xa1c9('0x20')];var _0x224ae4=_0x44ab5b?0x0:_0x2d825c['offset'];var _0x2fb81e=_0x44ab5b?_0x1bbc94['count']:_0x2d825c[_0xa1c9('0x1d')]+_0x2d825c[_0xa1c9('0x1f')];var _0x204d54;if(_0x2fb81e>=_0x11ca10){_0x2fb81e=_0x11ca10;_0x204d54=0xc8;}else{_0x204d54=0xce;}_0xd9bca1['status'](_0x204d54);return _0xd9bca1[_0xa1c9('0x21')](_0xa1c9('0x22'),_0x224ae4+'-'+_0x2fb81e+'/'+_0x11ca10)[_0xa1c9('0x1c')](_0x1bbc94);}return null;};}function patchUpdates(_0x4edf37){return function(_0x41e6d2){try{jsonpatch[_0xa1c9('0x23')](_0x41e6d2,_0x4edf37,!![]);}catch(_0x4c6dbb){return BPromise[_0xa1c9('0x24')](_0x4c6dbb);}return _0x41e6d2[_0xa1c9('0x25')]();};}function saveUpdates(_0x9f201f,_0x4d05d0){return function(_0x29f1b1){if(_0x29f1b1){return _0x29f1b1[_0xa1c9('0x26')](_0x9f201f)[_0xa1c9('0x27')](function(_0x23a461){return _0x23a461;});}return null;};}function removeEntity(_0x24a5da,_0x4a0a0c){return function(_0x50b16b){if(_0x50b16b){return _0x50b16b[_0xa1c9('0x28')]()['then'](function(){_0x24a5da[_0xa1c9('0x1a')](0xcc)[_0xa1c9('0x1b')]();});}};}function handleEntityNotFound(_0x1c6f37,_0x3059eb){return function(_0x339ed1){if(!_0x339ed1){_0x1c6f37['sendStatus'](0x194);}return _0x339ed1;};}function handleError(_0x1925e7,_0x3ca2a8){_0x3ca2a8=_0x3ca2a8||0x1f4;return function(_0x20cbe1){logger['error'](_0x20cbe1[_0xa1c9('0x29')]);if(_0x20cbe1[_0xa1c9('0x2a')]){delete _0x20cbe1[_0xa1c9('0x2a')];}_0x1925e7['status'](_0x3ca2a8)[_0xa1c9('0x2b')](_0x20cbe1);};}exports[_0xa1c9('0x2c')]=function(_0x594137,_0x38936f){var _0x48ce34={},_0xdf6d0c={},_0x2404c3={'count':0x0,'rows':[]};var _0x88ba11=_[_0xa1c9('0x2d')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')],function(_0x42fcb2){return{'name':_0x42fcb2[_0xa1c9('0x30')],'type':_0x42fcb2['type']['key']};});_0xdf6d0c[_0xa1c9('0x31')]=_[_0xa1c9('0x2d')](_0x88ba11,_0xa1c9('0x2a'));_0xdf6d0c[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x594137['query']);_0xdf6d0c['filters']=_['intersection'](_0xdf6d0c[_0xa1c9('0x31')],_0xdf6d0c[_0xa1c9('0x32')]);_0x48ce34[_0xa1c9('0x34')]=_[_0xa1c9('0x35')](_0xdf6d0c[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x594137[_0xa1c9('0x32')]['fields']));_0x48ce34[_0xa1c9('0x34')]=_0x48ce34['attributes'][_0xa1c9('0x37')]?_0x48ce34['attributes']:_0xdf6d0c[_0xa1c9('0x31')];if(!_0x594137[_0xa1c9('0x32')][_0xa1c9('0x38')]('nolimit')){_0x48ce34[_0xa1c9('0x1f')]=qs[_0xa1c9('0x1f')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1f')]);_0x48ce34['offset']=qs['offset'](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x1d')]);}_0x48ce34[_0xa1c9('0x39')]=qs[_0xa1c9('0x3a')](_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3a')]);_0x48ce34[_0xa1c9('0x3b')]=qs[_0xa1c9('0x3c')](_[_0xa1c9('0x3d')](_0x594137[_0xa1c9('0x32')],_0xdf6d0c['filters']),_0x88ba11);if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]){_0x48ce34[_0xa1c9('0x3b')]=_[_0xa1c9('0x3f')](_0x48ce34[_0xa1c9('0x3b')],{'$or':_[_0xa1c9('0x2d')](_0x88ba11,function(_0x5011a3){if(_0x5011a3[_0xa1c9('0x40')]!==_0xa1c9('0x41')){var _0x29d871={};_0x29d871[_0x5011a3['name']]={'$like':'%'+_0x594137[_0xa1c9('0x32')][_0xa1c9('0x3e')]+'%'};return _0x29d871;}})});}_0x48ce34=_['merge']({},_0x48ce34,_0x594137[_0xa1c9('0x42')]);var _0x25502f={'where':_0x48ce34['where']};return db['WhatsappQueueReport'][_0xa1c9('0x20')](_0x25502f)[_0xa1c9('0x27')](function(_0x34a6b8){_0x2404c3[_0xa1c9('0x20')]=_0x34a6b8;if(_0x594137[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x48ce34[_0xa1c9('0x44')]=[{'all':!![]}];}return db[_0xa1c9('0x2e')][_0xa1c9('0x45')](_0x48ce34);})[_0xa1c9('0x27')](function(_0x5ac71f){_0x2404c3['rows']=_0x5ac71f;return _0x2404c3;})[_0xa1c9('0x27')](respondWithFilteredResult(_0x38936f,_0x48ce34))[_0xa1c9('0x46')](handleError(_0x38936f,null));};exports['show']=function(_0x30ce3b,_0x102a33){var _0x43de42={'raw':!![],'where':{'id':_0x30ce3b[_0xa1c9('0x47')]['id']}},_0x36c846={};_0x36c846[_0xa1c9('0x31')]=_[_0xa1c9('0x33')](db[_0xa1c9('0x2e')][_0xa1c9('0x2f')]);_0x36c846[_0xa1c9('0x32')]=_[_0xa1c9('0x33')](_0x30ce3b['query']);_0x36c846[_0xa1c9('0x3c')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],_0x36c846['query']);_0x43de42[_0xa1c9('0x34')]=_['intersection'](_0x36c846[_0xa1c9('0x31')],qs[_0xa1c9('0x36')](_0x30ce3b['query'][_0xa1c9('0x36')]));_0x43de42[_0xa1c9('0x34')]=_0x43de42['attributes'][_0xa1c9('0x37')]?_0x43de42[_0xa1c9('0x34')]:_0x36c846[_0xa1c9('0x31')];if(_0x30ce3b[_0xa1c9('0x32')][_0xa1c9('0x43')]){_0x43de42[_0xa1c9('0x44')]=[{'all':!![]}];}_0x43de42=_['merge']({},_0x43de42,_0x30ce3b[_0xa1c9('0x42')]);return db[_0xa1c9('0x2e')][_0xa1c9('0x48')](_0x43de42)[_0xa1c9('0x27')](handleEntityNotFound(_0x102a33,null))[_0xa1c9('0x27')](respondWithResult(_0x102a33,null))['catch'](handleError(_0x102a33,null));};exports['create']=function(_0x4cf00a,_0x15329c){return db[_0xa1c9('0x2e')][_0xa1c9('0x49')](_0x4cf00a['body'],{})[_0xa1c9('0x27')](respondWithResult(_0x15329c,0xc9))[_0xa1c9('0x46')](handleError(_0x15329c,null));};exports['update']=function(_0x43ee79,_0x4bdf5d){if(_0x43ee79['body']['id']){delete _0x43ee79[_0xa1c9('0x4a')]['id'];}return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x43ee79[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x4bdf5d,null))[_0xa1c9('0x27')](saveUpdates(_0x43ee79[_0xa1c9('0x4a')],null))[_0xa1c9('0x27')](respondWithResult(_0x4bdf5d,null))[_0xa1c9('0x46')](handleError(_0x4bdf5d,null));};exports[_0xa1c9('0x28')]=function(_0x2b2065,_0x1bed85){return db[_0xa1c9('0x2e')][_0xa1c9('0x48')]({'where':{'id':_0x2b2065[_0xa1c9('0x47')]['id']}})[_0xa1c9('0x27')](handleEntityNotFound(_0x1bed85,null))[_0xa1c9('0x27')](removeEntity(_0x1bed85,null))[_0xa1c9('0x46')](handleError(_0x1bed85,null));};exports[_0xa1c9('0x4b')]=function(_0x4a968e,_0x55dc05){return db[_0xa1c9('0x2e')][_0xa1c9('0x4b')]()[_0xa1c9('0x27')](respondWithResult(_0x55dc05,null))[_0xa1c9('0x46')](handleError(_0x55dc05,null));}; \ No newline at end of file +var _0xe2cf=['body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','WhatsappQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x55b07e,_0x12269d){var _0x5f1d50=function(_0x37c6cb){while(--_0x37c6cb){_0x55b07e['push'](_0x55b07e['shift']());}};_0x5f1d50(++_0x12269d);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x58176f,_0x55a4e5){_0x58176f=_0x58176f-0x0;var _0x14ccb0=_0xe2cf[_0x58176f];return _0x14ccb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe2c('0x1'));var rp=require('request-promise');var moment=require(_0xfe2c('0x2'));var BPromise=require(_0xfe2c('0x3'));var Mustache=require(_0xfe2c('0x4'));var util=require(_0xfe2c('0x5'));var path=require('path');var sox=require(_0xfe2c('0x6'));var csv=require(_0xfe2c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe2c('0x8'));var squel=require(_0xfe2c('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe2c('0xa'));var toCsv=require(_0xfe2c('0x7'));var querystring=require(_0xfe2c('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe2c('0xc'));var qs=require(_0xfe2c('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe2c('0xe'));var logger=require(_0xfe2c('0xf'))(_0xfe2c('0x10'));var utils=require(_0xfe2c('0x11'));var config=require(_0xfe2c('0x12'));var licenseUtil=require(_0xfe2c('0x13'));var db=require(_0xfe2c('0x14'))['db'];function respondWithStatusCode(_0x4af8b7,_0x5e7389){_0x5e7389=_0x5e7389||0xcc;return function(_0x59ecf8){if(_0x59ecf8){return _0x4af8b7['sendStatus'](_0x5e7389);}return _0x4af8b7[_0xfe2c('0x15')](_0x5e7389)['end']();};}function respondWithResult(_0x5a6ad5,_0x38ba2c){_0x38ba2c=_0x38ba2c||0xc8;return function(_0x4d0a10){if(_0x4d0a10){return _0x5a6ad5[_0xfe2c('0x15')](_0x38ba2c)[_0xfe2c('0x16')](_0x4d0a10);}};}function respondWithFilteredResult(_0x522692,_0x5039cb){return function(_0x1a4684){if(_0x1a4684){var _0x3b3ebd=typeof _0x5039cb[_0xfe2c('0x17')]===_0xfe2c('0x18')&&typeof _0x5039cb['limit']===_0xfe2c('0x18');var _0x96a3a3=_0x1a4684[_0xfe2c('0x19')];var _0x23242b=_0x3b3ebd?0x0:_0x5039cb[_0xfe2c('0x17')];var _0x13f233=_0x3b3ebd?_0x1a4684['count']:_0x5039cb[_0xfe2c('0x17')]+_0x5039cb[_0xfe2c('0x1a')];var _0x1d7852;if(_0x13f233>=_0x96a3a3){_0x13f233=_0x96a3a3;_0x1d7852=0xc8;}else{_0x1d7852=0xce;}_0x522692[_0xfe2c('0x15')](_0x1d7852);return _0x522692['set'](_0xfe2c('0x1b'),_0x23242b+'-'+_0x13f233+'/'+_0x96a3a3)['json'](_0x1a4684);}return null;};}function patchUpdates(_0x4e9137){return function(_0x408f31){try{jsonpatch[_0xfe2c('0x1c')](_0x408f31,_0x4e9137,!![]);}catch(_0x4bf7c0){return BPromise[_0xfe2c('0x1d')](_0x4bf7c0);}return _0x408f31[_0xfe2c('0x1e')]();};}function saveUpdates(_0x5e609f,_0x1bd50e){return function(_0x5dd54b){if(_0x5dd54b){return _0x5dd54b[_0xfe2c('0x1f')](_0x5e609f)[_0xfe2c('0x20')](function(_0x8b5c0d){return _0x8b5c0d;});}return null;};}function removeEntity(_0x298819,_0x360928){return function(_0x2ee3b3){if(_0x2ee3b3){return _0x2ee3b3['destroy']()[_0xfe2c('0x20')](function(){_0x298819[_0xfe2c('0x15')](0xcc)[_0xfe2c('0x21')]();});}};}function handleEntityNotFound(_0x26448c,_0x3486b5){return function(_0x10afde){if(!_0x10afde){_0x26448c['sendStatus'](0x194);}return _0x10afde;};}function handleError(_0x205da8,_0x5e8abf){_0x5e8abf=_0x5e8abf||0x1f4;return function(_0x16daf3){logger[_0xfe2c('0x22')](_0x16daf3[_0xfe2c('0x23')]);if(_0x16daf3['name']){delete _0x16daf3[_0xfe2c('0x24')];}_0x205da8[_0xfe2c('0x15')](_0x5e8abf)['send'](_0x16daf3);};}exports[_0xfe2c('0x25')]=function(_0x1b6eb7,_0x3352e8){var _0x53a8c1={},_0x170026={},_0x1b7c91={'count':0x0,'rows':[]};var _0x55aed7=_['map'](db[_0xfe2c('0x26')][_0xfe2c('0x27')],function(_0x1a5e15){return{'name':_0x1a5e15[_0xfe2c('0x28')],'type':_0x1a5e15[_0xfe2c('0x29')]['key']};});_0x170026[_0xfe2c('0x2a')]=_[_0xfe2c('0x2b')](_0x55aed7,_0xfe2c('0x24'));_0x170026[_0xfe2c('0x2c')]=_[_0xfe2c('0x2d')](_0x1b6eb7[_0xfe2c('0x2c')]);_0x170026[_0xfe2c('0x2e')]=_[_0xfe2c('0x2f')](_0x170026[_0xfe2c('0x2a')],_0x170026[_0xfe2c('0x2c')]);_0x53a8c1[_0xfe2c('0x30')]=_[_0xfe2c('0x2f')](_0x170026['model'],qs[_0xfe2c('0x31')](_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x31')]));_0x53a8c1['attributes']=_0x53a8c1[_0xfe2c('0x30')][_0xfe2c('0x32')]?_0x53a8c1['attributes']:_0x170026[_0xfe2c('0x2a')];if(!_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x33')]('nolimit')){_0x53a8c1[_0xfe2c('0x1a')]=qs[_0xfe2c('0x1a')](_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x1a')]);_0x53a8c1[_0xfe2c('0x17')]=qs[_0xfe2c('0x17')](_0x1b6eb7[_0xfe2c('0x2c')]['offset']);}_0x53a8c1['order']=qs[_0xfe2c('0x34')](_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x34')]);_0x53a8c1[_0xfe2c('0x35')]=qs['filters'](_[_0xfe2c('0x36')](_0x1b6eb7['query'],_0x170026[_0xfe2c('0x2e')]),_0x55aed7);if(_0x1b6eb7[_0xfe2c('0x2c')]['filter']){_0x53a8c1[_0xfe2c('0x35')]=_['merge'](_0x53a8c1['where'],{'$or':_[_0xfe2c('0x2b')](_0x55aed7,function(_0x3d3b5e){if(_0x3d3b5e[_0xfe2c('0x29')]!==_0xfe2c('0x37')){var _0xae2808={};_0xae2808[_0x3d3b5e[_0xfe2c('0x24')]]={'$like':'%'+_0x1b6eb7[_0xfe2c('0x2c')][_0xfe2c('0x38')]+'%'};return _0xae2808;}})});}_0x53a8c1=_[_0xfe2c('0x39')]({},_0x53a8c1,_0x1b6eb7[_0xfe2c('0x3a')]);var _0x222335={'where':_0x53a8c1['where']};return db[_0xfe2c('0x26')][_0xfe2c('0x19')](_0x222335)[_0xfe2c('0x20')](function(_0x55ea45){_0x1b7c91['count']=_0x55ea45;if(_0x1b6eb7['query'][_0xfe2c('0x3b')]){_0x53a8c1[_0xfe2c('0x3c')]=[{'all':!![]}];}return db[_0xfe2c('0x26')][_0xfe2c('0x3d')](_0x53a8c1);})['then'](function(_0x1ed30b){_0x1b7c91[_0xfe2c('0x3e')]=_0x1ed30b;return _0x1b7c91;})[_0xfe2c('0x20')](respondWithFilteredResult(_0x3352e8,_0x53a8c1))[_0xfe2c('0x3f')](handleError(_0x3352e8,null));};exports[_0xfe2c('0x40')]=function(_0x48e361,_0x5a8d4e){var _0xeb04b9={'raw':!![],'where':{'id':_0x48e361[_0xfe2c('0x41')]['id']}},_0x6055dd={};_0x6055dd['model']=_['keys'](db[_0xfe2c('0x26')][_0xfe2c('0x27')]);_0x6055dd['query']=_[_0xfe2c('0x2d')](_0x48e361[_0xfe2c('0x2c')]);_0x6055dd[_0xfe2c('0x2e')]=_[_0xfe2c('0x2f')](_0x6055dd['model'],_0x6055dd[_0xfe2c('0x2c')]);_0xeb04b9[_0xfe2c('0x30')]=_[_0xfe2c('0x2f')](_0x6055dd[_0xfe2c('0x2a')],qs[_0xfe2c('0x31')](_0x48e361[_0xfe2c('0x2c')][_0xfe2c('0x31')]));_0xeb04b9[_0xfe2c('0x30')]=_0xeb04b9['attributes'][_0xfe2c('0x32')]?_0xeb04b9['attributes']:_0x6055dd[_0xfe2c('0x2a')];if(_0x48e361[_0xfe2c('0x2c')][_0xfe2c('0x3b')]){_0xeb04b9[_0xfe2c('0x3c')]=[{'all':!![]}];}_0xeb04b9=_['merge']({},_0xeb04b9,_0x48e361['options']);return db['WhatsappQueueReport']['find'](_0xeb04b9)['then'](handleEntityNotFound(_0x5a8d4e,null))[_0xfe2c('0x20')](respondWithResult(_0x5a8d4e,null))['catch'](handleError(_0x5a8d4e,null));};exports['create']=function(_0x22adee,_0x5d76be){return db[_0xfe2c('0x26')]['create'](_0x22adee[_0xfe2c('0x42')],{})[_0xfe2c('0x20')](respondWithResult(_0x5d76be,0xc9))[_0xfe2c('0x3f')](handleError(_0x5d76be,null));};exports[_0xfe2c('0x1f')]=function(_0x3cfda2,_0x57ad76){if(_0x3cfda2[_0xfe2c('0x42')]['id']){delete _0x3cfda2[_0xfe2c('0x42')]['id'];}return db[_0xfe2c('0x26')]['find']({'where':{'id':_0x3cfda2[_0xfe2c('0x41')]['id']}})[_0xfe2c('0x20')](handleEntityNotFound(_0x57ad76,null))['then'](saveUpdates(_0x3cfda2['body'],null))['then'](respondWithResult(_0x57ad76,null))[_0xfe2c('0x3f')](handleError(_0x57ad76,null));};exports[_0xfe2c('0x43')]=function(_0x47023e,_0x2e0012){return db[_0xfe2c('0x26')]['find']({'where':{'id':_0x47023e[_0xfe2c('0x41')]['id']}})[_0xfe2c('0x20')](handleEntityNotFound(_0x2e0012,null))[_0xfe2c('0x20')](removeEntity(_0x2e0012,null))['catch'](handleError(_0x2e0012,null));};exports['describe']=function(_0x3e7c9f,_0xa711b0){return db[_0xfe2c('0x26')][_0xfe2c('0x44')]()[_0xfe2c('0x20')](respondWithResult(_0xa711b0,null))[_0xfe2c('0x3f')](handleError(_0xa711b0,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index dc07f65..f57e858 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 _0x544f=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x525d18,_0x28770d){var _0x2cb12e=function(_0x31ebea){while(--_0x31ebea){_0x525d18['push'](_0x525d18['shift']());}};_0x2cb12e(++_0x28770d);}(_0x544f,0x198));var _0xf544=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x544f[_0x271060];return _0x40540b;};'use strict';var _=require('lodash');var util=require(_0xf544('0x0'));var logger=require(_0xf544('0x1'))(_0xf544('0x2'));var moment=require(_0xf544('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf544('0x4'));var rimraf=require(_0xf544('0x5'));var config=require(_0xf544('0x6'));var attributes=require(_0xf544('0x7'));module[_0xf544('0x8')]=function(_0x2c81cc,_0xc43285){return _0x2c81cc['define'](_0xf544('0x9'),attributes,{'tableName':_0xf544('0xa'),'paranoid':![],'indexes':[{'name':_0xf544('0xb'),'fields':[_0xf544('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x74cf=['bluebird','path','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','../../config/logger','api','moment'];(function(_0x1a80da,_0x1b532b){var _0x1c1df0=function(_0x21476f){while(--_0x21476f){_0x1a80da['push'](_0x1a80da['shift']());}};_0x1c1df0(++_0x1b532b);}(_0x74cf,0xe2));var _0xf74c=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x74cf[_0x2341c6];return _0x54c34d;};'use strict';var _=require('lodash');var util=require(_0xf74c('0x0'));var logger=require(_0xf74c('0x1'))(_0xf74c('0x2'));var moment=require(_0xf74c('0x3'));var BPromise=require(_0xf74c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf74c('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x5d68bb,_0x3a5206){return _0x5d68bb[_0xf74c('0x6')](_0xf74c('0x7'),attributes,{'tableName':_0xf74c('0x8'),'paranoid':![],'indexes':[{'name':_0xf74c('0x9'),'fields':[_0xf74c('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 042152d..b1c7234 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 _0x75cd=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','where','attributes','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x418ba6,_0x4c26fe){var _0x4b5a49=function(_0x3394d0){while(--_0x3394d0){_0x418ba6['push'](_0x418ba6['shift']());}};_0x4b5a49(++_0x4c26fe);}(_0x75cd,0x83));var _0xd75c=function(_0x352784,_0x12c933){_0x352784=_0x352784-0x0;var _0xada026=_0x75cd[_0x352784];return _0xada026;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd75c('0x0'));var BPromise=require(_0xd75c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd75c('0x2'));var db=require(_0xd75c('0x3'))['db'];var utils=require(_0xd75c('0x4'));var logger=require(_0xd75c('0x5'))(_0xd75c('0x6'));var config=require('../../config/environment');var jayson=require(_0xd75c('0x7'));var client=jayson['client'][_0xd75c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x102d3b,_0x194444,_0x258d74){return new BPromise(function(_0x1f7f42,_0x1df1fb){return client['request'](_0x102d3b,_0x258d74)['then'](function(_0x229fef){logger['info'](_0xd75c('0x9'),_0x194444,_0xd75c('0xa'));logger[_0xd75c('0xb')](_0xd75c('0xc'),_0x194444,_0xd75c('0xa'),JSON[_0xd75c('0xd')](_0x229fef));if(_0x229fef['error']){if(_0x229fef[_0xd75c('0xe')][_0xd75c('0xf')]===0x1f4){logger[_0xd75c('0xe')](_0xd75c('0x9'),_0x194444,_0x229fef[_0xd75c('0xe')][_0xd75c('0x10')]);return _0x1df1fb(_0x229fef['error'][_0xd75c('0x10')]);}logger[_0xd75c('0xe')](_0xd75c('0x9'),_0x194444,_0x229fef[_0xd75c('0xe')]['message']);return _0x1f7f42(_0x229fef[_0xd75c('0xe')][_0xd75c('0x10')]);}else{logger[_0xd75c('0x11')](_0xd75c('0x9'),_0x194444,'request\x20sent');_0x1f7f42(_0x229fef[_0xd75c('0x12')][_0xd75c('0x10')]);}})[_0xd75c('0x13')](function(_0x35ee71){logger[_0xd75c('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x194444,_0x35ee71);_0x1df1fb(_0x35ee71);});});}exports[_0xd75c('0x14')]=function(_0x3bee62){var _0x27b9ca=this;return new Promise(function(_0x581452,_0x1db808){return db[_0xd75c('0x15')][_0xd75c('0x16')](_0x3bee62[_0xd75c('0x17')],{'raw':_0x3bee62[_0xd75c('0x18')]?_0x3bee62[_0xd75c('0x18')][_0xd75c('0x19')]===undefined?!![]:![]:!![]})[_0xd75c('0x1a')](function(_0xaca1b3){logger[_0xd75c('0x11')](_0xd75c('0x14'),_0x3bee62);logger[_0xd75c('0xb')](_0xd75c('0x14'),_0x3bee62,JSON[_0xd75c('0xd')](_0xaca1b3));_0x581452(_0xaca1b3);})['catch'](function(_0x2e9782){logger['error']('CreateWhatsappQueueReport',_0x2e9782['message'],_0x3bee62);_0x1db808(_0x27b9ca['error'](0x1f4,_0x2e9782['message']));});});};exports[_0xd75c('0x1b')]=function(_0x44f3b1){var _0x362d5b=this;return new Promise(function(_0x16e963,_0xaa9fde){return db[_0xd75c('0x15')]['update'](_0x44f3b1[_0xd75c('0x17')],{'raw':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1['options'][_0xd75c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1[_0xd75c('0x18')][_0xd75c('0x1c')]||null:null,'attributes':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1[_0xd75c('0x18')][_0xd75c('0x1d')]||null:null,'limit':_0x44f3b1[_0xd75c('0x18')]?_0x44f3b1['options']['limit']||null:null})[_0xd75c('0x1a')](function(_0x3b8247){logger['info'](_0xd75c('0x1b'),_0x44f3b1);logger['debug'](_0xd75c('0x1b'),_0x44f3b1,JSON[_0xd75c('0xd')](_0x3b8247));_0x16e963(_0x3b8247);})[_0xd75c('0x13')](function(_0x11b485){logger[_0xd75c('0xe')]('UpdateWhatsappQueueReport',_0x11b485[_0xd75c('0x10')],_0x44f3b1);_0xaa9fde(_0x362d5b[_0xd75c('0xe')](0x1f4,_0x11b485['message']));});});}; \ No newline at end of file +var _0x6491=['info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','catch','UpdateWhatsappQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x50f6c4,_0x5e39d6){var _0x3e90c2=function(_0x48a075){while(--_0x48a075){_0x50f6c4['push'](_0x50f6c4['shift']());}};_0x3e90c2(++_0x5e39d6);}(_0x6491,0xd1));var _0x1649=function(_0x21e097,_0x45bd35){_0x21e097=_0x21e097-0x0;var _0x4838b3=_0x6491[_0x21e097];return _0x4838b3;};'use strict';var _=require(_0x1649('0x0'));var util=require(_0x1649('0x1'));var moment=require(_0x1649('0x2'));var BPromise=require(_0x1649('0x3'));var rs=require(_0x1649('0x4'));var fs=require('fs');var Redis=require(_0x1649('0x5'));var db=require(_0x1649('0x6'))['db'];var utils=require(_0x1649('0x7'));var logger=require(_0x1649('0x8'))('rpc');var config=require(_0x1649('0x9'));var jayson=require(_0x1649('0xa'));var client=jayson[_0x1649('0xb')][_0x1649('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a8159,_0x48c9cc,_0x39308e){return new BPromise(function(_0xf24e2b,_0x12ca0d){return client[_0x1649('0xd')](_0x5a8159,_0x39308e)[_0x1649('0xe')](function(_0x2321db){logger[_0x1649('0xf')](_0x1649('0x10'),_0x48c9cc,'request\x20sent');logger[_0x1649('0x11')](_0x1649('0x12'),_0x48c9cc,_0x1649('0x13'),JSON[_0x1649('0x14')](_0x2321db));if(_0x2321db[_0x1649('0x15')]){if(_0x2321db[_0x1649('0x15')][_0x1649('0x16')]===0x1f4){logger[_0x1649('0x15')]('WhatsappQueueReport,\x20%s,\x20%s',_0x48c9cc,_0x2321db[_0x1649('0x15')][_0x1649('0x17')]);return _0x12ca0d(_0x2321db[_0x1649('0x15')][_0x1649('0x17')]);}logger['error'](_0x1649('0x10'),_0x48c9cc,_0x2321db['error'][_0x1649('0x17')]);return _0xf24e2b(_0x2321db[_0x1649('0x15')][_0x1649('0x17')]);}else{logger[_0x1649('0xf')](_0x1649('0x10'),_0x48c9cc,'request\x20sent');_0xf24e2b(_0x2321db[_0x1649('0x18')]['message']);}})['catch'](function(_0x54e954){logger[_0x1649('0x15')](_0x1649('0x10'),_0x48c9cc,_0x54e954);_0x12ca0d(_0x54e954);});});}exports[_0x1649('0x19')]=function(_0x3a6d17){var _0x15f279=this;return new Promise(function(_0x398aa4,_0x34d9dc){return db[_0x1649('0x1a')]['create'](_0x3a6d17[_0x1649('0x1b')],{'raw':_0x3a6d17[_0x1649('0x1c')]?_0x3a6d17[_0x1649('0x1c')][_0x1649('0x1d')]===undefined?!![]:![]:!![]})[_0x1649('0xe')](function(_0xf11c25){logger[_0x1649('0xf')](_0x1649('0x19'),_0x3a6d17);logger['debug']('CreateWhatsappQueueReport',_0x3a6d17,JSON['stringify'](_0xf11c25));_0x398aa4(_0xf11c25);})[_0x1649('0x1e')](function(_0x228006){logger[_0x1649('0x15')]('CreateWhatsappQueueReport',_0x228006[_0x1649('0x17')],_0x3a6d17);_0x34d9dc(_0x15f279[_0x1649('0x15')](0x1f4,_0x228006[_0x1649('0x17')]));});});};exports[_0x1649('0x1f')]=function(_0x3050a6){var _0xd2bdd3=this;return new Promise(function(_0x10c8d3,_0x4a4561){return db[_0x1649('0x1a')]['update'](_0x3050a6[_0x1649('0x1b')],{'raw':_0x3050a6[_0x1649('0x1c')]?_0x3050a6[_0x1649('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3050a6[_0x1649('0x1c')]?_0x3050a6[_0x1649('0x1c')]['where']||null:null,'attributes':_0x3050a6['options']?_0x3050a6[_0x1649('0x1c')]['attributes']||null:null,'limit':_0x3050a6['options']?_0x3050a6[_0x1649('0x1c')]['limit']||null:null})['then'](function(_0x485a20){logger[_0x1649('0xf')](_0x1649('0x1f'),_0x3050a6);logger[_0x1649('0x11')](_0x1649('0x1f'),_0x3050a6,JSON['stringify'](_0x485a20));_0x10c8d3(_0x485a20);})[_0x1649('0x1e')](function(_0x236d6a){logger[_0x1649('0x15')]('UpdateWhatsappQueueReport',_0x236d6a[_0x1649('0x17')],_0x3050a6);_0x4a4561(_0xd2bdd3[_0x1649('0x15')](0x1f4,_0x236d6a[_0x1649('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 8e81508..0d5906e 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 _0x491c=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','multer','connect-timeout'];(function(_0x4da0d5,_0x321a2f){var _0x462021=function(_0x14ffdf){while(--_0x14ffdf){_0x4da0d5['push'](_0x4da0d5['shift']());}};_0x462021(++_0x321a2f);}(_0x491c,0x19c));var _0xc491=function(_0x2b0997,_0x2bcb81){_0x2b0997=_0x2b0997-0x0;var _0x4af610=_0x491c[_0x2b0997];return _0x4af610;};'use strict';var multer=require(_0xc491('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc491('0x1'));var express=require(_0xc491('0x2'));var router=express[_0xc491('0x3')]();var fs_extra=require(_0xc491('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc491('0x5'));var config=require(_0xc491('0x6'));var controller=require(_0xc491('0x7'));router['get']('/',auth[_0xc491('0x8')](),controller[_0xc491('0x9')]);router['get'](_0xc491('0xa'),auth[_0xc491('0x8')](),controller['describe']);router['get'](_0xc491('0xb'),auth[_0xc491('0x8')](),controller[_0xc491('0xc')]);router[_0xc491('0xd')]('/',auth[_0xc491('0x8')](),controller[_0xc491('0xe')]);router['put'](_0xc491('0xb'),auth[_0xc491('0x8')](),controller[_0xc491('0xf')]);router[_0xc491('0x10')](_0xc491('0xb'),auth[_0xc491('0x8')](),controller[_0xc491('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4b1a=['show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe'];(function(_0x486d7c,_0x25f99d){var _0x2bc318=function(_0x494474){while(--_0x494474){_0x486d7c['push'](_0x486d7c['shift']());}};_0x2bc318(++_0x25f99d);}(_0x4b1a,0x1d4));var _0xa4b1=function(_0x1cd881,_0x103b8c){_0x1cd881=_0x1cd881-0x0;var _0x2fc47d=_0x4b1a[_0x1cd881];return _0x2fc47d;};'use strict';var multer=require('multer');var util=require(_0xa4b1('0x0'));var path=require(_0xa4b1('0x1'));var timeout=require(_0xa4b1('0x2'));var express=require('express');var router=express[_0xa4b1('0x3')]();var fs_extra=require(_0xa4b1('0x4'));var auth=require(_0xa4b1('0x5'));var interaction=require(_0xa4b1('0x6'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0xa4b1('0x7')]('/',auth[_0xa4b1('0x8')](),controller[_0xa4b1('0x9')]);router[_0xa4b1('0x7')](_0xa4b1('0xa'),auth[_0xa4b1('0x8')](),controller[_0xa4b1('0xb')]);router[_0xa4b1('0x7')]('/:id',auth[_0xa4b1('0x8')](),controller[_0xa4b1('0xc')]);router[_0xa4b1('0xd')]('/',auth[_0xa4b1('0x8')](),controller[_0xa4b1('0xe')]);router[_0xa4b1('0xf')](_0xa4b1('0x10'),auth[_0xa4b1('0x8')](),controller[_0xa4b1('0x11')]);router[_0xa4b1('0x12')](_0xa4b1('0x10'),auth[_0xa4b1('0x8')](),controller['destroy']);module[_0xa4b1('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 76f67ee..dcbb547 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 _0xb240=['STRING','ENUM','account','agent','queue','DATE','sequelize','exports'];(function(_0x309b09,_0xe4c181){var _0x7b38d7=function(_0x3c2277){while(--_0x3c2277){_0x309b09['push'](_0x309b09['shift']());}};_0x7b38d7(++_0xe4c181);}(_0xb240,0x7e));var _0x0b24=function(_0x25f199,_0x4098ad){_0x25f199=_0x25f199-0x0;var _0x29aeda=_0xb240[_0x25f199];return _0x29aeda;};'use strict';var Sequelize=require(_0x0b24('0x0'));module[_0x0b24('0x1')]={'uniqueid':{'type':Sequelize[_0x0b24('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0b24('0x3')](_0x0b24('0x4'),_0x0b24('0x5'),_0x0b24('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0b24('0x7')]}}; \ No newline at end of file +var _0xd070=['queue','DATE','sequelize','STRING','ENUM','account','agent'];(function(_0x2c3bd1,_0x56a6e4){var _0x9e4419=function(_0x105346){while(--_0x105346){_0x2c3bd1['push'](_0x2c3bd1['shift']());}};_0x9e4419(++_0x56a6e4);}(_0xd070,0x8e));var _0x0d07=function(_0x4408de,_0x450ebc){_0x4408de=_0x4408de-0x0;var _0xc944d6=_0xd070[_0x4408de];return _0xc944d6;};'use strict';var Sequelize=require(_0x0d07('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0d07('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0d07('0x2')](_0x0d07('0x3'),_0x0d07('0x4'),_0x0d07('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0d07('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 60572af..f16a264 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 _0xce62=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','name','send','WhatsappTransferReport','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xa7b03c,_0xbd313){var _0x4faafb=function(_0x32ded1){while(--_0x32ded1){_0xa7b03c['push'](_0xa7b03c['shift']());}};_0x4faafb(++_0xbd313);}(_0xce62,0x83));var _0x2ce6=function(_0x3e0b93,_0x540d89){_0x3e0b93=_0x3e0b93-0x0;var _0x21532a=_0xce62[_0x3e0b93];return _0x21532a;};'use strict';var emlformat=require(_0x2ce6('0x0'));var rimraf=require(_0x2ce6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ce6('0x2'));var rp=require(_0x2ce6('0x3'));var moment=require(_0x2ce6('0x4'));var BPromise=require(_0x2ce6('0x5'));var Mustache=require(_0x2ce6('0x6'));var util=require(_0x2ce6('0x7'));var path=require('path');var sox=require(_0x2ce6('0x8'));var csv=require(_0x2ce6('0x9'));var ejs=require(_0x2ce6('0xa'));var fs=require('fs');var fs_extra=require(_0x2ce6('0xb'));var _=require(_0x2ce6('0xc'));var squel=require(_0x2ce6('0xd'));var crypto=require('crypto');var jsforce=require(_0x2ce6('0xe'));var deskjs=require(_0x2ce6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2ce6('0x10'));var Papa=require(_0x2ce6('0x11'));var Redis=require(_0x2ce6('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2ce6('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ce6('0x14'))('api');var utils=require(_0x2ce6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2ce6('0x16'));var db=require(_0x2ce6('0x17'))['db'];function respondWithStatusCode(_0x225f16,_0x2479b2){_0x2479b2=_0x2479b2||0xcc;return function(_0xc50d0d){if(_0xc50d0d){return _0x225f16[_0x2ce6('0x18')](_0x2479b2);}return _0x225f16[_0x2ce6('0x19')](_0x2479b2)[_0x2ce6('0x1a')]();};}function respondWithResult(_0x5d6d69,_0x4517c4){_0x4517c4=_0x4517c4||0xc8;return function(_0x5b06c1){if(_0x5b06c1){return _0x5d6d69[_0x2ce6('0x19')](_0x4517c4)[_0x2ce6('0x1b')](_0x5b06c1);}};}function respondWithFilteredResult(_0x157e52,_0x5dec62){return function(_0x312a6e){if(_0x312a6e){var _0x109981=typeof _0x5dec62[_0x2ce6('0x1c')]===_0x2ce6('0x1d')&&typeof _0x5dec62[_0x2ce6('0x1e')]===_0x2ce6('0x1d');var _0x23a707=_0x312a6e[_0x2ce6('0x1f')];var _0x353894=_0x109981?0x0:_0x5dec62[_0x2ce6('0x1c')];var _0x4f9ceb=_0x109981?_0x312a6e[_0x2ce6('0x1f')]:_0x5dec62[_0x2ce6('0x1c')]+_0x5dec62[_0x2ce6('0x1e')];var _0x54e172;if(_0x4f9ceb>=_0x23a707){_0x4f9ceb=_0x23a707;_0x54e172=0xc8;}else{_0x54e172=0xce;}_0x157e52[_0x2ce6('0x19')](_0x54e172);return _0x157e52[_0x2ce6('0x20')](_0x2ce6('0x21'),_0x353894+'-'+_0x4f9ceb+'/'+_0x23a707)[_0x2ce6('0x1b')](_0x312a6e);}return null;};}function patchUpdates(_0x3b55c0){return function(_0x593672){try{jsonpatch[_0x2ce6('0x22')](_0x593672,_0x3b55c0,!![]);}catch(_0x4947d7){return BPromise['reject'](_0x4947d7);}return _0x593672[_0x2ce6('0x23')]();};}function saveUpdates(_0x2b80bd,_0x30a221){return function(_0x4f84b2){if(_0x4f84b2){return _0x4f84b2[_0x2ce6('0x24')](_0x2b80bd)[_0x2ce6('0x25')](function(_0x1e11b1){return _0x1e11b1;});}return null;};}function removeEntity(_0x437864,_0x5a4656){return function(_0x37536a){if(_0x37536a){return _0x37536a[_0x2ce6('0x26')]()[_0x2ce6('0x25')](function(){_0x437864[_0x2ce6('0x19')](0xcc)[_0x2ce6('0x1a')]();});}};}function handleEntityNotFound(_0x366ada,_0x14c642){return function(_0x52d520){if(!_0x52d520){_0x366ada['sendStatus'](0x194);}return _0x52d520;};}function handleError(_0x4eb918,_0x22bf7b){_0x22bf7b=_0x22bf7b||0x1f4;return function(_0x2df836){logger['error'](_0x2df836['stack']);if(_0x2df836[_0x2ce6('0x27')]){delete _0x2df836[_0x2ce6('0x27')];}_0x4eb918[_0x2ce6('0x19')](_0x22bf7b)[_0x2ce6('0x28')](_0x2df836);};}exports['index']=function(_0x481cd2,_0x909ada){var _0xa78201={},_0x2fd596={},_0x55308c={'count':0x0,'rows':[]};var _0x541a2d=_['map'](db[_0x2ce6('0x29')]['rawAttributes'],function(_0x17047f){return{'name':_0x17047f[_0x2ce6('0x2a')],'type':_0x17047f[_0x2ce6('0x2b')][_0x2ce6('0x2c')]};});_0x2fd596[_0x2ce6('0x2d')]=_['map'](_0x541a2d,_0x2ce6('0x27'));_0x2fd596[_0x2ce6('0x2e')]=_[_0x2ce6('0x2f')](_0x481cd2[_0x2ce6('0x2e')]);_0x2fd596['filters']=_[_0x2ce6('0x30')](_0x2fd596[_0x2ce6('0x2d')],_0x2fd596[_0x2ce6('0x2e')]);_0xa78201['attributes']=_[_0x2ce6('0x30')](_0x2fd596[_0x2ce6('0x2d')],qs[_0x2ce6('0x31')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x31')]));_0xa78201[_0x2ce6('0x32')]=_0xa78201['attributes'][_0x2ce6('0x33')]?_0xa78201['attributes']:_0x2fd596['model'];if(!_0x481cd2['query'][_0x2ce6('0x34')](_0x2ce6('0x35'))){_0xa78201[_0x2ce6('0x1e')]=qs[_0x2ce6('0x1e')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x1e')]);_0xa78201[_0x2ce6('0x1c')]=qs[_0x2ce6('0x1c')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x1c')]);}_0xa78201[_0x2ce6('0x36')]=qs[_0x2ce6('0x37')](_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x37')]);_0xa78201[_0x2ce6('0x38')]=qs[_0x2ce6('0x39')](_['pick'](_0x481cd2[_0x2ce6('0x2e')],_0x2fd596[_0x2ce6('0x39')]),_0x541a2d);if(_0x481cd2[_0x2ce6('0x2e')][_0x2ce6('0x3a')]){_0xa78201['where']=_[_0x2ce6('0x3b')](_0xa78201['where'],{'$or':_[_0x2ce6('0x3c')](_0x541a2d,function(_0x409a36){if(_0x409a36[_0x2ce6('0x2b')]!==_0x2ce6('0x3d')){var _0x15c1a5={};_0x15c1a5[_0x409a36[_0x2ce6('0x27')]]={'$like':'%'+_0x481cd2[_0x2ce6('0x2e')]['filter']+'%'};return _0x15c1a5;}})});}_0xa78201=_['merge']({},_0xa78201,_0x481cd2[_0x2ce6('0x3e')]);var _0x10f398={'where':_0xa78201['where']};return db['WhatsappTransferReport'][_0x2ce6('0x1f')](_0x10f398)[_0x2ce6('0x25')](function(_0x5b74e4){_0x55308c[_0x2ce6('0x1f')]=_0x5b74e4;if(_0x481cd2['query'][_0x2ce6('0x3f')]){_0xa78201[_0x2ce6('0x40')]=[{'all':!![]}];}return db[_0x2ce6('0x29')][_0x2ce6('0x41')](_0xa78201);})[_0x2ce6('0x25')](function(_0x369bca){_0x55308c[_0x2ce6('0x42')]=_0x369bca;return _0x55308c;})[_0x2ce6('0x25')](respondWithFilteredResult(_0x909ada,_0xa78201))[_0x2ce6('0x43')](handleError(_0x909ada,null));};exports['show']=function(_0x5d9cf2,_0x757ff9){var _0x41fe90={'raw':!![],'where':{'id':_0x5d9cf2['params']['id']}},_0x471f91={};_0x471f91[_0x2ce6('0x2d')]=_['keys'](db[_0x2ce6('0x29')]['rawAttributes']);_0x471f91[_0x2ce6('0x2e')]=_[_0x2ce6('0x2f')](_0x5d9cf2[_0x2ce6('0x2e')]);_0x471f91[_0x2ce6('0x39')]=_[_0x2ce6('0x30')](_0x471f91['model'],_0x471f91['query']);_0x41fe90[_0x2ce6('0x32')]=_[_0x2ce6('0x30')](_0x471f91[_0x2ce6('0x2d')],qs[_0x2ce6('0x31')](_0x5d9cf2[_0x2ce6('0x2e')][_0x2ce6('0x31')]));_0x41fe90[_0x2ce6('0x32')]=_0x41fe90['attributes'][_0x2ce6('0x33')]?_0x41fe90[_0x2ce6('0x32')]:_0x471f91[_0x2ce6('0x2d')];if(_0x5d9cf2[_0x2ce6('0x2e')]['includeAll']){_0x41fe90[_0x2ce6('0x40')]=[{'all':!![]}];}_0x41fe90=_[_0x2ce6('0x3b')]({},_0x41fe90,_0x5d9cf2[_0x2ce6('0x3e')]);return db[_0x2ce6('0x29')][_0x2ce6('0x44')](_0x41fe90)[_0x2ce6('0x25')](handleEntityNotFound(_0x757ff9,null))[_0x2ce6('0x25')](respondWithResult(_0x757ff9,null))['catch'](handleError(_0x757ff9,null));};exports[_0x2ce6('0x45')]=function(_0x26df8c,_0x5b8826){return db[_0x2ce6('0x29')][_0x2ce6('0x45')](_0x26df8c[_0x2ce6('0x46')],{})[_0x2ce6('0x25')](respondWithResult(_0x5b8826,0xc9))[_0x2ce6('0x43')](handleError(_0x5b8826,null));};exports[_0x2ce6('0x24')]=function(_0x2df960,_0x77449e){if(_0x2df960['body']['id']){delete _0x2df960[_0x2ce6('0x46')]['id'];}return db[_0x2ce6('0x29')][_0x2ce6('0x44')]({'where':{'id':_0x2df960['params']['id']}})[_0x2ce6('0x25')](handleEntityNotFound(_0x77449e,null))[_0x2ce6('0x25')](saveUpdates(_0x2df960[_0x2ce6('0x46')],null))[_0x2ce6('0x25')](respondWithResult(_0x77449e,null))[_0x2ce6('0x43')](handleError(_0x77449e,null));};exports['destroy']=function(_0x5151c2,_0x28efa9){return db[_0x2ce6('0x29')][_0x2ce6('0x44')]({'where':{'id':_0x5151c2[_0x2ce6('0x47')]['id']}})[_0x2ce6('0x25')](handleEntityNotFound(_0x28efa9,null))[_0x2ce6('0x25')](removeEntity(_0x28efa9,null))['catch'](handleError(_0x28efa9,null));};exports[_0x2ce6('0x48')]=function(_0x35f40a,_0x540488){return db[_0x2ce6('0x29')][_0x2ce6('0x48')]()[_0x2ce6('0x25')](respondWithResult(_0x540488,null))[_0x2ce6('0x43')](handleError(_0x540488,null));}; \ No newline at end of file +var _0x39b8=['filter','VIRTUAL','merge','options','then','include','findAll','rows','params','keys','includeAll','body','catch','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','undefined','count','offset','limit','Content-Range','json','apply','reject','save','destroy','end','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x39b8,0x12b));var _0x839b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x39b8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x839b('0x0'));var zipdir=require(_0x839b('0x1'));var jsonpatch=require(_0x839b('0x2'));var rp=require(_0x839b('0x3'));var moment=require('moment');var BPromise=require(_0x839b('0x4'));var Mustache=require(_0x839b('0x5'));var util=require('util');var path=require(_0x839b('0x6'));var sox=require('sox');var csv=require(_0x839b('0x7'));var ejs=require(_0x839b('0x8'));var fs=require('fs');var fs_extra=require(_0x839b('0x9'));var _=require(_0x839b('0xa'));var squel=require(_0x839b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x839b('0x7'));var querystring=require(_0x839b('0xc'));var Papa=require(_0x839b('0xd'));var Redis=require('ioredis');var authService=require(_0x839b('0xe'));var qs=require(_0x839b('0xf'));var as=require(_0x839b('0x10'));var hardwareService=require(_0x839b('0x11'));var logger=require('../../config/logger')(_0x839b('0x12'));var utils=require(_0x839b('0x13'));var config=require(_0x839b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1609bf,_0x20b62b){_0x20b62b=_0x20b62b||0xcc;return function(_0x2b9df1){if(_0x2b9df1){return _0x1609bf[_0x839b('0x15')](_0x20b62b);}return _0x1609bf['status'](_0x20b62b)['end']();};}function respondWithResult(_0x1115f7,_0x397c8){_0x397c8=_0x397c8||0xc8;return function(_0x49d767){if(_0x49d767){return _0x1115f7[_0x839b('0x16')](_0x397c8)['json'](_0x49d767);}};}function respondWithFilteredResult(_0x50ae7b,_0x2da779){return function(_0x17be5d){if(_0x17be5d){var _0x3e577b=typeof _0x2da779['offset']===_0x839b('0x17')&&typeof _0x2da779['limit']===_0x839b('0x17');var _0x434823=_0x17be5d[_0x839b('0x18')];var _0x1c678f=_0x3e577b?0x0:_0x2da779[_0x839b('0x19')];var _0x3324ab=_0x3e577b?_0x17be5d[_0x839b('0x18')]:_0x2da779[_0x839b('0x19')]+_0x2da779[_0x839b('0x1a')];var _0x15a72e;if(_0x3324ab>=_0x434823){_0x3324ab=_0x434823;_0x15a72e=0xc8;}else{_0x15a72e=0xce;}_0x50ae7b[_0x839b('0x16')](_0x15a72e);return _0x50ae7b['set'](_0x839b('0x1b'),_0x1c678f+'-'+_0x3324ab+'/'+_0x434823)[_0x839b('0x1c')](_0x17be5d);}return null;};}function patchUpdates(_0x4b8568){return function(_0x152950){try{jsonpatch[_0x839b('0x1d')](_0x152950,_0x4b8568,!![]);}catch(_0xec5b6f){return BPromise[_0x839b('0x1e')](_0xec5b6f);}return _0x152950[_0x839b('0x1f')]();};}function saveUpdates(_0x1d4a3e,_0x4e3480){return function(_0x24f17f){if(_0x24f17f){return _0x24f17f['update'](_0x1d4a3e)['then'](function(_0x21f8d5){return _0x21f8d5;});}return null;};}function removeEntity(_0xd2e374,_0x2a206c){return function(_0x3af294){if(_0x3af294){return _0x3af294[_0x839b('0x20')]()['then'](function(){_0xd2e374[_0x839b('0x16')](0xcc)[_0x839b('0x21')]();});}};}function handleEntityNotFound(_0x539695,_0x49fd2d){return function(_0x593ecb){if(!_0x593ecb){_0x539695[_0x839b('0x15')](0x194);}return _0x593ecb;};}function handleError(_0x169b50,_0xc5cf56){_0xc5cf56=_0xc5cf56||0x1f4;return function(_0x28b70d){logger[_0x839b('0x22')](_0x28b70d[_0x839b('0x23')]);if(_0x28b70d[_0x839b('0x24')]){delete _0x28b70d[_0x839b('0x24')];}_0x169b50[_0x839b('0x16')](_0xc5cf56)['send'](_0x28b70d);};}exports[_0x839b('0x25')]=function(_0xa64441,_0x491d07){var _0x51f24a={},_0x5205c1={},_0x37afaa={'count':0x0,'rows':[]};var _0x595dbc=_[_0x839b('0x26')](db[_0x839b('0x27')][_0x839b('0x28')],function(_0x316cb8){return{'name':_0x316cb8[_0x839b('0x29')],'type':_0x316cb8[_0x839b('0x2a')][_0x839b('0x2b')]};});_0x5205c1[_0x839b('0x2c')]=_['map'](_0x595dbc,'name');_0x5205c1[_0x839b('0x2d')]=_['keys'](_0xa64441[_0x839b('0x2d')]);_0x5205c1[_0x839b('0x2e')]=_[_0x839b('0x2f')](_0x5205c1[_0x839b('0x2c')],_0x5205c1[_0x839b('0x2d')]);_0x51f24a[_0x839b('0x30')]=_[_0x839b('0x2f')](_0x5205c1[_0x839b('0x2c')],qs[_0x839b('0x31')](_0xa64441['query'][_0x839b('0x31')]));_0x51f24a[_0x839b('0x30')]=_0x51f24a[_0x839b('0x30')][_0x839b('0x32')]?_0x51f24a[_0x839b('0x30')]:_0x5205c1[_0x839b('0x2c')];if(!_0xa64441[_0x839b('0x2d')][_0x839b('0x33')](_0x839b('0x34'))){_0x51f24a['limit']=qs[_0x839b('0x1a')](_0xa64441[_0x839b('0x2d')][_0x839b('0x1a')]);_0x51f24a[_0x839b('0x19')]=qs[_0x839b('0x19')](_0xa64441['query']['offset']);}_0x51f24a[_0x839b('0x35')]=qs[_0x839b('0x36')](_0xa64441[_0x839b('0x2d')][_0x839b('0x36')]);_0x51f24a[_0x839b('0x37')]=qs[_0x839b('0x2e')](_['pick'](_0xa64441[_0x839b('0x2d')],_0x5205c1['filters']),_0x595dbc);if(_0xa64441['query'][_0x839b('0x38')]){_0x51f24a[_0x839b('0x37')]=_['merge'](_0x51f24a[_0x839b('0x37')],{'$or':_[_0x839b('0x26')](_0x595dbc,function(_0xdd43e2){if(_0xdd43e2['type']!==_0x839b('0x39')){var _0x4a98c5={};_0x4a98c5[_0xdd43e2['name']]={'$like':'%'+_0xa64441[_0x839b('0x2d')][_0x839b('0x38')]+'%'};return _0x4a98c5;}})});}_0x51f24a=_[_0x839b('0x3a')]({},_0x51f24a,_0xa64441[_0x839b('0x3b')]);var _0x1274d0={'where':_0x51f24a['where']};return db[_0x839b('0x27')][_0x839b('0x18')](_0x1274d0)[_0x839b('0x3c')](function(_0x401dcf){_0x37afaa['count']=_0x401dcf;if(_0xa64441[_0x839b('0x2d')]['includeAll']){_0x51f24a[_0x839b('0x3d')]=[{'all':!![]}];}return db[_0x839b('0x27')][_0x839b('0x3e')](_0x51f24a);})[_0x839b('0x3c')](function(_0x278702){_0x37afaa[_0x839b('0x3f')]=_0x278702;return _0x37afaa;})[_0x839b('0x3c')](respondWithFilteredResult(_0x491d07,_0x51f24a))['catch'](handleError(_0x491d07,null));};exports['show']=function(_0x154f5a,_0x387af1){var _0x3c084c={'raw':!![],'where':{'id':_0x154f5a[_0x839b('0x40')]['id']}},_0x405a2a={};_0x405a2a[_0x839b('0x2c')]=_['keys'](db['WhatsappTransferReport']['rawAttributes']);_0x405a2a[_0x839b('0x2d')]=_[_0x839b('0x41')](_0x154f5a['query']);_0x405a2a[_0x839b('0x2e')]=_[_0x839b('0x2f')](_0x405a2a[_0x839b('0x2c')],_0x405a2a[_0x839b('0x2d')]);_0x3c084c[_0x839b('0x30')]=_[_0x839b('0x2f')](_0x405a2a['model'],qs[_0x839b('0x31')](_0x154f5a[_0x839b('0x2d')][_0x839b('0x31')]));_0x3c084c['attributes']=_0x3c084c[_0x839b('0x30')][_0x839b('0x32')]?_0x3c084c['attributes']:_0x405a2a[_0x839b('0x2c')];if(_0x154f5a[_0x839b('0x2d')][_0x839b('0x42')]){_0x3c084c[_0x839b('0x3d')]=[{'all':!![]}];}_0x3c084c=_[_0x839b('0x3a')]({},_0x3c084c,_0x154f5a[_0x839b('0x3b')]);return db[_0x839b('0x27')]['find'](_0x3c084c)[_0x839b('0x3c')](handleEntityNotFound(_0x387af1,null))[_0x839b('0x3c')](respondWithResult(_0x387af1,null))['catch'](handleError(_0x387af1,null));};exports['create']=function(_0x5b277f,_0x33bfd7){return db[_0x839b('0x27')]['create'](_0x5b277f[_0x839b('0x43')],{})[_0x839b('0x3c')](respondWithResult(_0x33bfd7,0xc9))[_0x839b('0x44')](handleError(_0x33bfd7,null));};exports['update']=function(_0x11697b,_0x3ffa65){if(_0x11697b[_0x839b('0x43')]['id']){delete _0x11697b[_0x839b('0x43')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x11697b['params']['id']}})[_0x839b('0x3c')](handleEntityNotFound(_0x3ffa65,null))[_0x839b('0x3c')](saveUpdates(_0x11697b[_0x839b('0x43')],null))[_0x839b('0x3c')](respondWithResult(_0x3ffa65,null))[_0x839b('0x44')](handleError(_0x3ffa65,null));};exports[_0x839b('0x20')]=function(_0x364da8,_0x44eec3){return db[_0x839b('0x27')][_0x839b('0x45')]({'where':{'id':_0x364da8[_0x839b('0x40')]['id']}})[_0x839b('0x3c')](handleEntityNotFound(_0x44eec3,null))[_0x839b('0x3c')](removeEntity(_0x44eec3,null))[_0x839b('0x44')](handleError(_0x44eec3,null));};exports[_0x839b('0x46')]=function(_0xe121de,_0x116e1f){return db[_0x839b('0x27')]['describe']()[_0x839b('0x3c')](respondWithResult(_0x116e1f,null))[_0x839b('0x44')](handleError(_0x116e1f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 727b5c4..d40d552 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 _0xb07c=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','request-promise','path','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x63ad57,_0x4f865c){var _0x108db3=function(_0x15876c){while(--_0x15876c){_0x63ad57['push'](_0x63ad57['shift']());}};_0x108db3(++_0x4f865c);}(_0xb07c,0x1d2));var _0xcb07=function(_0x214680,_0x45bb74){_0x214680=_0x214680-0x0;var _0x507da9=_0xb07c[_0x214680];return _0x507da9;};'use strict';var _=require('lodash');var util=require(_0xcb07('0x0'));var logger=require(_0xcb07('0x1'))(_0xcb07('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb07('0x3'));var fs=require('fs');var path=require(_0xcb07('0x4'));var rimraf=require('rimraf');var config=require(_0xcb07('0x5'));var attributes=require(_0xcb07('0x6'));module['exports']=function(_0x41fc92,_0x3398b9){return _0x41fc92[_0xcb07('0x7')](_0xcb07('0x8'),attributes,{'tableName':_0xcb07('0x9'),'paranoid':![],'indexes':[{'name':_0xcb07('0xa'),'fields':[_0xcb07('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ff2=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8ff2,0x12b));var _0x28ff=function(_0x549e99,_0x598709){_0x549e99=_0x549e99-0x0;var _0x4b585e=_0x8ff2[_0x549e99];return _0x4b585e;};'use strict';var _=require(_0x28ff('0x0'));var util=require('util');var logger=require(_0x28ff('0x1'))(_0x28ff('0x2'));var moment=require(_0x28ff('0x3'));var BPromise=require(_0x28ff('0x4'));var rp=require(_0x28ff('0x5'));var fs=require('fs');var path=require(_0x28ff('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x28ff('0x7'));module[_0x28ff('0x8')]=function(_0x2bc1c3,_0x3d8dd6){return _0x2bc1c3[_0x28ff('0x9')](_0x28ff('0xa'),attributes,{'tableName':_0x28ff('0xb'),'paranoid':![],'indexes':[{'name':_0x28ff('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 4bf90d1..fe21090 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 _0x2be3=['request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http'];(function(_0x331fbf,_0x3ae8ff){var _0x44c7b7=function(_0x50ecbd){while(--_0x50ecbd){_0x331fbf['push'](_0x331fbf['shift']());}};_0x44c7b7(++_0x3ae8ff);}(_0x2be3,0x1da));var _0x32be=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2be3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x32be('0x0'));var util=require(_0x32be('0x1'));var moment=require(_0x32be('0x2'));var BPromise=require(_0x32be('0x3'));var rs=require(_0x32be('0x4'));var fs=require('fs');var Redis=require(_0x32be('0x5'));var db=require(_0x32be('0x6'))['db'];var utils=require(_0x32be('0x7'));var logger=require('../../config/logger')(_0x32be('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x32be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x914270,_0x1aea50,_0x1c0ec2){return new BPromise(function(_0x54d97,_0x5770be){return client[_0x32be('0xa')](_0x914270,_0x1c0ec2)[_0x32be('0xb')](function(_0x13d2a3){logger['info'](_0x32be('0xc'),_0x1aea50,'request\x20sent');logger[_0x32be('0xd')](_0x32be('0xe'),_0x1aea50,'request\x20sent',JSON[_0x32be('0xf')](_0x13d2a3));if(_0x13d2a3[_0x32be('0x10')]){if(_0x13d2a3[_0x32be('0x10')][_0x32be('0x11')]===0x1f4){logger[_0x32be('0x10')](_0x32be('0xc'),_0x1aea50,_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);return _0x5770be(_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);}logger[_0x32be('0x10')](_0x32be('0xc'),_0x1aea50,_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);return _0x54d97(_0x13d2a3[_0x32be('0x10')][_0x32be('0x12')]);}else{logger[_0x32be('0x13')](_0x32be('0xc'),_0x1aea50,_0x32be('0x14'));_0x54d97(_0x13d2a3[_0x32be('0x15')][_0x32be('0x12')]);}})['catch'](function(_0x13ca6c){logger[_0x32be('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x1aea50,_0x13ca6c);_0x5770be(_0x13ca6c);});});} \ No newline at end of file +var _0x2560=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','lodash'];(function(_0x16797e,_0x485d85){var _0x333c87=function(_0x1fec46){while(--_0x1fec46){_0x16797e['push'](_0x16797e['shift']());}};_0x333c87(++_0x485d85);}(_0x2560,0x1ed));var _0x0256=function(_0x58f96b,_0x1c90f3){_0x58f96b=_0x58f96b-0x0;var _0x220e35=_0x2560[_0x58f96b];return _0x220e35;};'use strict';var _=require(_0x0256('0x0'));var util=require(_0x0256('0x1'));var moment=require(_0x0256('0x2'));var BPromise=require('bluebird');var rs=require(_0x0256('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0256('0x4'))['db'];var utils=require(_0x0256('0x5'));var logger=require(_0x0256('0x6'))('rpc');var config=require(_0x0256('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0256('0x8')][_0x0256('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d45a5,_0xe978a7,_0x1c4712){return new BPromise(function(_0x34e52a,_0x1e5d64){return client[_0x0256('0xa')](_0x3d45a5,_0x1c4712)[_0x0256('0xb')](function(_0x1079e0){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0xe978a7,_0x0256('0xc'));logger[_0x0256('0xd')](_0x0256('0xe'),_0xe978a7,'request\x20sent',JSON[_0x0256('0xf')](_0x1079e0));if(_0x1079e0['error']){if(_0x1079e0[_0x0256('0x10')]['code']===0x1f4){logger[_0x0256('0x10')](_0x0256('0x11'),_0xe978a7,_0x1079e0[_0x0256('0x10')][_0x0256('0x12')]);return _0x1e5d64(_0x1079e0[_0x0256('0x10')][_0x0256('0x12')]);}logger[_0x0256('0x10')](_0x0256('0x11'),_0xe978a7,_0x1079e0[_0x0256('0x10')][_0x0256('0x12')]);return _0x34e52a(_0x1079e0[_0x0256('0x10')]['message']);}else{logger['info'](_0x0256('0x11'),_0xe978a7,_0x0256('0xc'));_0x34e52a(_0x1079e0['result'][_0x0256('0x12')]);}})['catch'](function(_0x421b24){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0xe978a7,_0x421b24);_0x1e5d64(_0x421b24);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index e84a9dc..7f89ac9 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5a7=['name','Online\x20apps:','online','Offline\x20apps:','status','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env'];(function(_0x244985,_0x33e109){var _0x360400=function(_0x4a1182){while(--_0x4a1182){_0x244985['push'](_0x244985['shift']());}};_0x360400(++_0x33e109);}(_0xf5a7,0x133));var _0x7f5a=function(_0x3c19f7,_0x206c1f){_0x3c19f7=_0x3c19f7-0x0;var _0x3df9da=_0xf5a7[_0x3c19f7];return _0x3df9da;};'use strict';var _=require(_0x7f5a('0x0'));var db=require(_0x7f5a('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0x7f5a('0x2'));var rpc=require(_0x7f5a('0x3'));var config=require(_0x7f5a('0x4'));var logger=require(_0x7f5a('0x5'))(_0x7f5a('0x6'));var pm2=require(_0x7f5a('0x7'));var pm2Config=require(_0x7f5a('0x8'));var schedule=require(_0x7f5a('0x9'));var chat=require(_0x7f5a('0xa'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x7f5a('0xb'));var provider=require(_0x7f5a('0xc'));function main(){return db['sequelize'][_0x7f5a('0xd')]()[_0x7f5a('0xe')](function(){if(config[_0x7f5a('0xf')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x7f5a('0x10')]();})[_0x7f5a('0xe')](function(){return rpc['listen']();})['then'](function(_0x438daa){logger[_0x7f5a('0x11')](_0x438daa);return chat['start']();})['then'](function(){return whatsapp[_0x7f5a('0x12')]();})[_0x7f5a('0xe')](function(){return schedule[_0x7f5a('0x12')]();})[_0x7f5a('0xe')](function(){return transcribe[_0x7f5a('0x12')]();})[_0x7f5a('0xe')](function(){return provider['start']();})[_0x7f5a('0xe')](function(_0x405223){logger[_0x7f5a('0x11')](_0x405223);return pm2[_0x7f5a('0x12')](pm2Config);})[_0x7f5a('0xe')](function(_0x2a25ab){var _0x117772=_0x2a25ab[_0x7f5a('0x13')](function(_0x4ce5c2){return typeof _0x4ce5c2[_0x7f5a('0x14')]===_0x7f5a('0x15')&&_0x4ce5c2['exitCode']>=0x0;});if(_0x117772[_0x7f5a('0x16')]>0x0){throw new Error(_0x117772[_0x7f5a('0x16')]+_0x7f5a('0x17')+_[_0x7f5a('0x18')](_0x117772,function(_0x568857){return'\x22'+_0x568857[_0x7f5a('0x19')][_0x7f5a('0x1a')]+'\x22';}));}logger[_0x7f5a('0x11')](_0x7f5a('0x1b'),_['map'](_[_0x7f5a('0x13')](_0x2a25ab,{'status':_0x7f5a('0x1c')}),'name')['join']());logger[_0x7f5a('0x11')](_0x7f5a('0x1d'),_[_0x7f5a('0x18')](_[_0x7f5a('0x13')](_0x2a25ab,function(_0x208a6e){return _0x208a6e[_0x7f5a('0x1e')]!==_0x7f5a('0x1c');}),_0x7f5a('0x1a'))['join']()||'None');console[_0x7f5a('0x1f')]('App\x20Ready!');})[_0x7f5a('0x20')](function(_0x5ae49e){console[_0x7f5a('0x1f')](_0x7f5a('0x21'),_0x5ae49e);logger[_0x7f5a('0x22')](_0x7f5a('0x23'),_0x5ae49e);process[_0x7f5a('0x24')](0x1);});}main(); \ No newline at end of file +var _0x24ce=['seedDB','default','listen','info','start','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','status','online','App\x20Ready!','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./config/license','./rpc','app','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then'];(function(_0x4a48dd,_0x54e0ef){var _0x138b0c=function(_0x52d588){while(--_0x52d588){_0x4a48dd['push'](_0x4a48dd['shift']());}};_0x138b0c(++_0x54e0ef);}(_0x24ce,0x1de));var _0xe24c=function(_0x46752c,_0x1e23dc){_0x46752c=_0x46752c-0x0;var _0x40b99c=_0x24ce[_0x46752c];return _0x40b99c;};'use strict';var _=require('lodash');var db=require(_0xe24c('0x0'))['db'];var seedDb=require(_0xe24c('0x1'));var checkLicense=require(_0xe24c('0x2'));var rpc=require(_0xe24c('0x3'));var config=require('./config/environment');var logger=require('./config/logger')(_0xe24c('0x4'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0xe24c('0x5'));var chat=require(_0xe24c('0x6'));var whatsapp=require(_0xe24c('0x7'));var transcribe=require(_0xe24c('0x8'));var provider=require(_0xe24c('0x9'));function main(){return db['sequelize'][_0xe24c('0xa')]()[_0xe24c('0xb')](function(){if(config[_0xe24c('0xc')]){return seedDb[_0xe24c('0xd')]();}})[_0xe24c('0xb')](function(){return checkLicense[_0xe24c('0xd')]();})[_0xe24c('0xb')](function(){return rpc[_0xe24c('0xe')]();})[_0xe24c('0xb')](function(_0x7b13c){logger[_0xe24c('0xf')](_0x7b13c);return chat[_0xe24c('0x10')]();})[_0xe24c('0xb')](function(){return whatsapp['start']();})[_0xe24c('0xb')](function(){return schedule['start']();})[_0xe24c('0xb')](function(){return transcribe['start']();})[_0xe24c('0xb')](function(){return provider[_0xe24c('0x10')]();})['then'](function(_0x572824){logger['info'](_0x572824);return pm2[_0xe24c('0x10')](pm2Config);})['then'](function(_0x1cb6c0){var _0x3446cf=_0x1cb6c0[_0xe24c('0x11')](function(_0x33979b){return typeof _0x33979b['exitCode']===_0xe24c('0x12')&&_0x33979b[_0xe24c('0x13')]>=0x0;});if(_0x3446cf[_0xe24c('0x14')]>0x0){throw new Error(_0x3446cf[_0xe24c('0x14')]+_0xe24c('0x15')+_[_0xe24c('0x16')](_0x3446cf,function(_0xbd9e1d){return'\x22'+_0xbd9e1d[_0xe24c('0x17')][_0xe24c('0x18')]+'\x22';}));}logger[_0xe24c('0xf')](_0xe24c('0x19'),_[_0xe24c('0x16')](_[_0xe24c('0x11')](_0x1cb6c0,{'status':'online'}),_0xe24c('0x18'))[_0xe24c('0x1a')]());logger[_0xe24c('0xf')]('Offline\x20apps:',_[_0xe24c('0x16')](_[_0xe24c('0x11')](_0x1cb6c0,function(_0x2462f2){return _0x2462f2[_0xe24c('0x1b')]!==_0xe24c('0x1c');}),_0xe24c('0x18'))['join']()||'None');console['log'](_0xe24c('0x1d'));})['catch'](function(_0x5d307c){console[_0xe24c('0x1e')](_0xe24c('0x1f'),_0x5d307c);logger[_0xe24c('0x20')](_0xe24c('0x21'),_0x5d307c);process[_0xe24c('0x22')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 627f941..8db817a 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 _0x3c01=['User','find','json','Wrong\x20credentials.','catch','Bearer','status','Unknown\x20authorization\x20format','apikey','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','getLicense','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','apiKeyIat','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','unshift','join','promisify','sign','secret','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','crypto','util','secrets','session','role','fullname','name','internal','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','user','ChatInteraction','findOne','params','closed','disposition','then','query','forceDownload','unmanaged','Unmanaged.','Forbidden.','use','authorization','headers'];(function(_0xd41ece,_0x241cdb){var _0x5e2da2=function(_0x1ecd01){while(--_0x1ecd01){_0xd41ece['push'](_0xd41ece['shift']());}};_0x5e2da2(++_0x241cdb);}(_0x3c01,0xc3));var _0x13c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3c01[_0x14add3];return _0x4a174f;};'use strict';var db=require(_0x13c0('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x13c0('0x1'));var encryptor=require(_0x13c0('0x2'));var _=require(_0x13c0('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x13c0('0x4'));var compose=require(_0x13c0('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0x13c0('0x6'));var BPromise=require('bluebird');var util=require(_0x13c0('0x7'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x13c0('0x8')][_0x13c0('0x9')]});var userAttributes=['id',_0x13c0('0xa'),_0x13c0('0xb'),_0x13c0('0xc'),_0x13c0('0xd'),'email',_0x13c0('0xe'),'permissions','md5secret',_0x13c0('0xf'),_0x13c0('0x10'),_0x13c0('0x11'),_0x13c0('0x12'),_0x13c0('0x13'),_0x13c0('0x14'),_0x13c0('0x15'),_0x13c0('0x16'),_0x13c0('0x17'),'lastPauseAt',_0x13c0('0x18'),_0x13c0('0x19'),_0x13c0('0x1a'),'alias',_0x13c0('0x1b'),_0x13c0('0x1c'),'phoneBarDnd',_0x13c0('0x1d'),'phoneBarEnableDtmfTone',_0x13c0('0x1e'),_0x13c0('0x1f'),_0x13c0('0x20'),_0x13c0('0x21'),_0x13c0('0x22'),'hotdesk','interface','userProfileId',_0x13c0('0x23'),_0x13c0('0x24'),'wssPort',_0x13c0('0x25'),_0x13c0('0x26'),_0x13c0('0x27'),_0x13c0('0x28'),_0x13c0('0x29'),_0x13c0('0x2a'),'chatAutoanswerDelay',_0x13c0('0x2b'),_0x13c0('0x2c'),_0x13c0('0x2d'),_0x13c0('0x2e'),'openchannelAutoanswer','openchannelAutoanswerDelay',_0x13c0('0x2f'),_0x13c0('0x30'),'whatsappAutoanswer',_0x13c0('0x31'),'messengerSoundNotification'];exports[_0x13c0('0x32')]=function(){return this[_0x13c0('0x33')](!![])['use'](function(_0x271f92,_0x4c62fe,_0xa43e42){if(_0x271f92[_0x13c0('0x34')]){_0xa43e42();}else{return db[_0x13c0('0x35')][_0x13c0('0x36')]({'where':{'id':_0x271f92[_0x13c0('0x37')]['id']},'attributes':['id',_0x13c0('0x38'),_0x13c0('0x39')],'raw':!![]})[_0x13c0('0x3a')](function(_0x15e4a3){if(_0x15e4a3&&_0x15e4a3[_0x13c0('0x38')]&&!_0x271f92[_0x13c0('0x3b')][_0x13c0('0x3c')]){return _0x4c62fe['status'](_0x15e4a3[_0x13c0('0x39')]===_0x13c0('0x3d')?0x195:0x193)['json']({'message':_0x15e4a3['disposition']===_0x13c0('0x3d')?_0x13c0('0x3e'):_0x13c0('0x3f')});}else{_0xa43e42();}})['catch'](function(_0x19a9aa){_0xa43e42(_0x19a9aa);});}});};exports[_0x13c0('0x33')]=function isAuthenticated(_0x1c6efd){return compose()[_0x13c0('0x40')](function(_0x74fff4,_0x3dfe37,_0x119ad2){var _0x32f4fd;if(_0x74fff4['headers'][_0x13c0('0x41')]){if(_['startsWith'](_0x74fff4[_0x13c0('0x42')][_0x13c0('0x41')],'Basic')){var _0x3fce88=basicAuth(_0x74fff4);db[_0x13c0('0x43')][_0x13c0('0x44')]({'where':{'name':_0x3fce88[_0x13c0('0xc')]}})['then'](function(_0x1a3692){if(!_0x1a3692||!_0x1a3692['authenticate'](_0x3fce88['pass'])){return _0x3dfe37['status'](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x46')});}_0x74fff4['user']={'id':_0x1a3692['id']};_0x119ad2();})[_0x13c0('0x47')](function(_0x5ad24c){_0x119ad2(_0x5ad24c);});}else if(_['startsWith'](_0x74fff4['headers'][_0x13c0('0x41')],_0x13c0('0x48'))){validateJwt(_0x74fff4,_0x3dfe37,_0x119ad2);}else{if(_0x1c6efd){_0x119ad2();}else{return _0x3dfe37[_0x13c0('0x49')](0x193)[_0x13c0('0x45')]({'message':_0x13c0('0x4a')});}}}else if(_0x74fff4['query'][_0x13c0('0x4b')]){try{var _0x19e77c={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x74fff4[_0x13c0('0x3b')]['apikey'],_0x19e77c)[_0x13c0('0x3a')](function(_0x19d106){return db[_0x13c0('0x43')]['find']({'where':{'id':_0x19d106[_0x13c0('0x4c')]}})[_0x13c0('0x3a')](function(_0x356753){_0x32f4fd=_0x356753;return db[_0x13c0('0x4d')][_0x13c0('0x36')]({'where':{'id':0x1},'attributes':[_0x13c0('0x4e'),_0x13c0('0x4f')],'raw':!![]});})[_0x13c0('0x3a')](function(_0x2bfd71){if(!_0x32f4fd||!_[_0x13c0('0x50')](_0x32f4fd[_0x13c0('0x51')],_0x19d106[_0x13c0('0x52')])){return _0x3dfe37[_0x13c0('0x49')](0x191)['json']({'message':_0x13c0('0x53')});}if(_0x32f4fd[_0x13c0('0x54')]){return _0x3dfe37[_0x13c0('0x49')](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x55')});}if(_0x32f4fd['blocked']){if(_0x2bfd71[_0x13c0('0x4f')]>0x0){if(moment(_0x32f4fd[_0x13c0('0x56')])[_0x13c0('0x57')](_0x2bfd71[_0x13c0('0x4f')],_0x13c0('0x58'))>moment()){return _0x3dfe37[_0x13c0('0x49')](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x55')});}}else{return _0x3dfe37[_0x13c0('0x49')](0x191)['json']({'message':_0x13c0('0x55')});}}_0x74fff4[_0x13c0('0x34')]={'id':_0x32f4fd['id']};_0x119ad2();});})[_0x13c0('0x47')](function(){return _0x3dfe37[_0x13c0('0x49')](0x191)[_0x13c0('0x45')]({'message':_0x13c0('0x55')});});}catch(_0x36847c){_0x119ad2(_0x36847c);}}else if(_0x1c6efd){_0x119ad2();}else{return _0x3dfe37[_0x13c0('0x49')](0x193)['json']({'message':_0x13c0('0x4a')});}})[_0x13c0('0x40')](function(_0x58c36b,_0x3ca621,_0x3fc344){if(_0x58c36b['user']){db[_0x13c0('0x43')][_0x13c0('0x44')]({'where':{'id':_0x58c36b['user']['id']},'attributes':userAttributes})[_0x13c0('0x3a')](function(_0x15b747){if(!_0x15b747){return _0x3ca621[_0x13c0('0x49')](0x194)[_0x13c0('0x45')]({'message':_0x13c0('0x59')});}_0x58c36b['user']=_0x15b747;_0x3fc344();})[_0x13c0('0x47')](function(_0xe9a66c){_0x3fc344(_0xe9a66c);});}else if(_0x1c6efd){_0x3fc344();}else{return _0x3ca621['status'](0x194)[_0x13c0('0x45')]({'message':_0x13c0('0x5a')});}});};exports[_0x13c0('0x5b')]=function canUpdate(){return compose()[_0x13c0('0x40')](function(_0x8dc662,_0x2e009e,_0x3ecac9){return licenseUtil['getLicense']()['then'](function(_0x3a0ac3){if(_0x3a0ac3['update']){_0x3ecac9();}else{return _0x2e009e[_0x13c0('0x49')](0x193)[_0x13c0('0x45')]({'message':_0x13c0('0x5c')});}})[_0x13c0('0x47')](function(_0x1196eb){_0x3ecac9(_0x1196eb);});});};exports[_0x13c0('0x5d')]=function isWebrtcLicence(){return compose()[_0x13c0('0x40')](function(_0x49edaa,_0x3ee8d1,_0x4a9f71){return licenseUtil[_0x13c0('0x5e')]()[_0x13c0('0x3a')](function(_0x590ea6){if(_0x590ea6['webrtc']){_0x4a9f71();}else{return _0x3ee8d1['status'](0x193)[_0x13c0('0x45')]({'message':_0x13c0('0x5c')});}})[_0x13c0('0x47')](function(_0x43114f){_0x4a9f71(_0x43114f);});});};exports['isMiddleware']=function(_0x219cc0,_0x2fed15,_0x4dcb9a){_0x219cc0[_0x13c0('0x5f')]=!![];return _0x4dcb9a();};exports[_0x13c0('0x60')]=function signToken(_0x54f2c3){return signJwt(_0x54f2c3);};exports['setTokenCookie']=function(_0x1c18f0,_0x112465){if(!_0x1c18f0[_0x13c0('0x34')]){return _0x112465[_0x13c0('0x49')](0x194)[_0x13c0('0x45')]({'message':_0x13c0('0x61')});}var _0x3ea6cf={'payload':{'id':_0x1c18f0[_0x13c0('0x34')]['id'],'role':_0x1c18f0[_0x13c0('0x34')][_0x13c0('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3ea6cf)[_0x13c0('0x3a')](function(_0x521e66){_0x112465['cookie'](_0x13c0('0x62'),_0x521e66);_0x112465[_0x13c0('0x63')]('/dashboards/general');})[_0x13c0('0x47')](function(_0x3c56c6){return _0x112465['status'](0x1f4)[_0x13c0('0x64')](_0x3c56c6);});};exports['retrieveApiKey']=function(_0x4c4371){if(_[_0x13c0('0x65')](_0x4c4371[_0x13c0('0x51')])||_['isNil'](_0x4c4371['apiKeyIat'])){return null;}else{return createJwt(_0x4c4371);}};exports['generateApiKey']=function(_0x301b71){_0x301b71['apiKeyNonce']=generateNonce();_0x301b71[_0x13c0('0x66')]=generateIssuedAt();return createJwt(_0x301b71);};exports[_0x13c0('0x67')]=function(_0x1b7bea,_0x362924){var _0x2f0e43=_0x1b7bea['query'][_0x13c0('0x4b')];if(_0x2f0e43){var _0x114491={'nonce':_0x362924[_0x13c0('0x51')],'iat':_0x362924[_0x13c0('0x66')],'audience':hardwareConf[_0x13c0('0x68')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2f0e43,_0x114491)[_0x13c0('0x3a')](function(){return generateApiKey(_0x362924);});}else{throw{'message':_0x13c0('0x69')};}};exports['validatePasswordPattern']=function(_0x3b24f7){var _0x2bb5e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2bb5e0[_0x13c0('0x6a')](_0x3b24f7))throw new db[(_0x13c0('0x6b'))][(_0x13c0('0x6c'))](_0x13c0('0x6d'));return;};exports[_0x13c0('0x6e')]=function(_0x3be502,_0xaf107,_0x189c3a){var _0x3befd6=encryptor[_0x13c0('0x6f')](_0xaf107)[_0x13c0('0x70')](',');for(var _0x56510d=0x0;_0x56510d<_0x189c3a;_0x56510d++){if(!_0x3befd6[_0x56510d])break;if(_0x3be502[_0x13c0('0x71')]()===_0x3befd6[_0x56510d][_0x13c0('0x71')]()){var _0x429516=util[_0x13c0('0x72')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x189c3a);if(_0x189c3a===0x1){_0x429516=_0x13c0('0x73');}throw new db['Sequelize']['ValidationError'](_0x429516);}}return;};exports[_0x13c0('0x74')]=function(_0x2a279a,_0x38566){var _0xf97d6f=_0x38566?encryptor[_0x13c0('0x6f')](_0x38566)['split'](','):[];if(_0xf97d6f['length']===0x5){_0xf97d6f[_0x13c0('0x75')](-0x1,0x1);}_0xf97d6f[_0x13c0('0x76')](_0x2a279a);return encryptor['encryptString'](_0xf97d6f[_0x13c0('0x77')](','));};function signJwt(_0x12ff22){var _0x43a994=BPromise[_0x13c0('0x78')](jwt[_0x13c0('0x79')],{'context':jwt});var _0x5516d9=_0x12ff22[_0x13c0('0x7a')]||config['secrets'][_0x13c0('0x9')];return new BPromise(function(_0x101503,_0x5ea00d){_0x43a994(_0x12ff22['payload'],_0x5516d9,_0x12ff22[_0x13c0('0x7b')])['then'](function(_0x4494da){_0x101503(_0x4494da);})['catch'](function(_0x434182){_0x5ea00d(_0x434182);});});}function verifyJwt(_0xf3f837,_0x462b7b,_0x2d3158){var _0x28cf4a=BPromise[_0x13c0('0x78')](jwt[_0x13c0('0x7c')],{'context':jwt});var _0x4099dc=_0x2d3158||config['secrets'][_0x13c0('0x9')];return new BPromise(function(_0x5360c4,_0x2a4ff3){_0x28cf4a(_0xf3f837,_0x4099dc,_0x462b7b)[_0x13c0('0x3a')](function(_0x1fd9c8){_0x5360c4(_0x1fd9c8);})[_0x13c0('0x47')](function(_0x3cb936){_0x2a4ff3(_0x3cb936);});});}function generateNonce(){return crypto[_0x13c0('0x7d')](0x10)[_0x13c0('0x7e')](_0x13c0('0x7f'));}function generateIssuedAt(){return Math[_0x13c0('0x80')](Date[_0x13c0('0x81')]()/0x3e8)['toString']();}function createJwt(_0x214557){var _0x40492e={'payload':{'iat':_0x214557[_0x13c0('0x66')],'nonce':_0x214557[_0x13c0('0x51')]},'options':{'algorithm':_0x13c0('0x82'),'subject':_0x214557['id'][_0x13c0('0x7e')](),'issuer':hardwareConf[_0x13c0('0x68')](),'audience':hardwareConf[_0x13c0('0x68')]()}};return signJwt(_0x40492e)[_0x13c0('0x3a')](function(_0x20285d){return{'iat':_0x214557[_0x13c0('0x66')],'nonce':_0x214557[_0x13c0('0x51')],'token':_0x20285d};});} \ No newline at end of file +var _0x6a17=['lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','query','forceDownload','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','find','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','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','unshift','encryptString','join','promisify','secrets','payload','options','toString','floor','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','smsPause','openchannelPause','pauseType','showWebBar'];(function(_0x5c7883,_0x2d0e2e){var _0x2e4777=function(_0x86e0cc){while(--_0x86e0cc){_0x5c7883['push'](_0x5c7883['shift']());}};_0x2e4777(++_0x2d0e2e);}(_0x6a17,0x101));var _0x76a1=function(_0x1a6f40,_0x471da3){_0x1a6f40=_0x1a6f40-0x0;var _0x2dfb96=_0x6a17[_0x1a6f40];return _0x2dfb96;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x76a1('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x76a1('0x1'));var encryptor=require(_0x76a1('0x2'));var _=require(_0x76a1('0x3'));var jwt=require(_0x76a1('0x4'));var expressJwt=require(_0x76a1('0x5'));var compose=require(_0x76a1('0x6'));var basicAuth=require(_0x76a1('0x7'));var crypto=require('crypto');var BPromise=require(_0x76a1('0x8'));var util=require('util');var moment=require(_0x76a1('0x9'));var validateJwt=expressJwt({'secret':config['secrets'][_0x76a1('0xa')]});var userAttributes=['id',_0x76a1('0xb'),_0x76a1('0xc'),_0x76a1('0xd'),_0x76a1('0xe'),_0x76a1('0xf'),_0x76a1('0x10'),_0x76a1('0x11'),_0x76a1('0x12'),'voicePause','chatPause','mailPause','faxPause',_0x76a1('0x13'),_0x76a1('0x14'),_0x76a1('0x15'),_0x76a1('0x16'),_0x76a1('0x17'),_0x76a1('0x18'),_0x76a1('0x19'),_0x76a1('0x1a'),_0x76a1('0x1b'),'alias','phoneBarAutoAnswer',_0x76a1('0x1c'),_0x76a1('0x1d'),_0x76a1('0x1e'),'phoneBarEnableDtmfTone',_0x76a1('0x1f'),_0x76a1('0x20'),_0x76a1('0x21'),_0x76a1('0x22'),_0x76a1('0x23'),_0x76a1('0x24'),_0x76a1('0x25'),_0x76a1('0x26'),'privacyEnabled',_0x76a1('0x27'),_0x76a1('0x28'),_0x76a1('0x29'),_0x76a1('0x2a'),_0x76a1('0x2b'),_0x76a1('0x2c'),_0x76a1('0x2d'),_0x76a1('0x2e'),_0x76a1('0x2f'),_0x76a1('0x30'),_0x76a1('0x31'),_0x76a1('0x32'),_0x76a1('0x33'),_0x76a1('0x34'),'openchannelAutoanswerDelay',_0x76a1('0x35'),'faxAutoanswerDelay',_0x76a1('0x36'),_0x76a1('0x37'),'messengerSoundNotification'];exports[_0x76a1('0x38')]=function(){return this[_0x76a1('0x39')](!![])[_0x76a1('0x3a')](function(_0x2c8674,_0x29fe61,_0x29f66c){if(_0x2c8674[_0x76a1('0x3b')]){_0x29f66c();}else{return db[_0x76a1('0x3c')][_0x76a1('0x3d')]({'where':{'id':_0x2c8674[_0x76a1('0x3e')]['id']},'attributes':['id',_0x76a1('0x3f'),_0x76a1('0x40')],'raw':!![]})[_0x76a1('0x41')](function(_0x374a53){if(_0x374a53&&_0x374a53['closed']&&!_0x2c8674[_0x76a1('0x42')][_0x76a1('0x43')]){return _0x29fe61[_0x76a1('0x44')](_0x374a53[_0x76a1('0x40')]===_0x76a1('0x45')?0x195:0x193)[_0x76a1('0x46')]({'message':_0x374a53[_0x76a1('0x40')]===_0x76a1('0x45')?_0x76a1('0x47'):_0x76a1('0x48')});}else{_0x29f66c();}})[_0x76a1('0x49')](function(_0x318855){_0x29f66c(_0x318855);});}});};exports[_0x76a1('0x39')]=function isAuthenticated(_0x58e944){return compose()[_0x76a1('0x3a')](function(_0x3e3f22,_0x224480,_0x9ead85){var _0x1b5739;if(_0x3e3f22[_0x76a1('0x4a')][_0x76a1('0x4b')]){if(_[_0x76a1('0x4c')](_0x3e3f22[_0x76a1('0x4a')][_0x76a1('0x4b')],_0x76a1('0x4d'))){var _0x5ef4fc=basicAuth(_0x3e3f22);db[_0x76a1('0x4e')]['find']({'where':{'name':_0x5ef4fc[_0x76a1('0xd')]}})[_0x76a1('0x41')](function(_0x1bec2d){if(!_0x1bec2d||!_0x1bec2d[_0x76a1('0x4f')](_0x5ef4fc['pass'])){return _0x224480[_0x76a1('0x44')](0x191)[_0x76a1('0x46')]({'message':_0x76a1('0x50')});}_0x3e3f22[_0x76a1('0x3b')]={'id':_0x1bec2d['id']};_0x9ead85();})['catch'](function(_0x33832b){_0x9ead85(_0x33832b);});}else if(_[_0x76a1('0x4c')](_0x3e3f22[_0x76a1('0x4a')]['authorization'],_0x76a1('0x51'))){validateJwt(_0x3e3f22,_0x224480,_0x9ead85);}else{if(_0x58e944){_0x9ead85();}else{return _0x224480[_0x76a1('0x44')](0x193)[_0x76a1('0x46')]({'message':_0x76a1('0x52')});}}}else if(_0x3e3f22[_0x76a1('0x42')][_0x76a1('0x53')]){try{var _0x186dcb={'audience':hardwareConf[_0x76a1('0x54')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x3e3f22[_0x76a1('0x42')][_0x76a1('0x53')],_0x186dcb)['then'](function(_0x29bd44){return db['User'][_0x76a1('0x55')]({'where':{'id':_0x29bd44['sub']}})[_0x76a1('0x41')](function(_0x4409f3){_0x1b5739=_0x4409f3;return db[_0x76a1('0x56')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x76a1('0x57')],'raw':!![]});})[_0x76a1('0x41')](function(_0x372d9c){if(!_0x1b5739||!_[_0x76a1('0x58')](_0x1b5739[_0x76a1('0x59')],_0x29bd44[_0x76a1('0x5a')])){return _0x224480[_0x76a1('0x44')](0x191)[_0x76a1('0x46')]({'message':_0x76a1('0x5b')});}if(_0x1b5739[_0x76a1('0x5c')]){return _0x224480[_0x76a1('0x44')](0x191)[_0x76a1('0x46')]({'message':_0x76a1('0x5d')});}if(_0x1b5739['blocked']){if(_0x372d9c[_0x76a1('0x57')]>0x0){if(moment(_0x1b5739[_0x76a1('0x5e')])['add'](_0x372d9c[_0x76a1('0x57')],'minutes')>moment()){return _0x224480[_0x76a1('0x44')](0x191)[_0x76a1('0x46')]({'message':_0x76a1('0x5d')});}}else{return _0x224480[_0x76a1('0x44')](0x191)[_0x76a1('0x46')]({'message':_0x76a1('0x5d')});}}_0x3e3f22[_0x76a1('0x3b')]={'id':_0x1b5739['id']};_0x9ead85();});})[_0x76a1('0x49')](function(){return _0x224480[_0x76a1('0x44')](0x191)[_0x76a1('0x46')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x4a79c){_0x9ead85(_0x4a79c);}}else if(_0x58e944){_0x9ead85();}else{return _0x224480['status'](0x193)[_0x76a1('0x46')]({'message':'Unknown\x20authorization\x20format'});}})[_0x76a1('0x3a')](function(_0x5ed183,_0x3953c4,_0x1e4ce5){if(_0x5ed183[_0x76a1('0x3b')]){db[_0x76a1('0x4e')][_0x76a1('0x55')]({'where':{'id':_0x5ed183[_0x76a1('0x3b')]['id']},'attributes':userAttributes})['then'](function(_0xc06a53){if(!_0xc06a53){return _0x3953c4['status'](0x194)['json']({'message':'User\x20not\x20found.'});}_0x5ed183['user']=_0xc06a53;_0x1e4ce5();})[_0x76a1('0x49')](function(_0xa7b06b){_0x1e4ce5(_0xa7b06b);});}else if(_0x58e944){_0x1e4ce5();}else{return _0x3953c4['status'](0x194)[_0x76a1('0x46')]({'message':_0x76a1('0x5f')});}});};exports[_0x76a1('0x60')]=function canUpdate(){return compose()[_0x76a1('0x3a')](function(_0x2a6faf,_0x240b91,_0x5720a4){return licenseUtil[_0x76a1('0x61')]()['then'](function(_0x147924){if(_0x147924['update']){_0x5720a4();}else{return _0x240b91[_0x76a1('0x44')](0x193)[_0x76a1('0x46')]({'message':_0x76a1('0x62')});}})[_0x76a1('0x49')](function(_0x4e90ff){_0x5720a4(_0x4e90ff);});});};exports[_0x76a1('0x63')]=function isWebrtcLicence(){return compose()['use'](function(_0x1a141,_0x510f52,_0x3a5fe0){return licenseUtil[_0x76a1('0x61')]()[_0x76a1('0x41')](function(_0x1e099f){if(_0x1e099f[_0x76a1('0x64')]){_0x3a5fe0();}else{return _0x510f52['status'](0x193)[_0x76a1('0x46')]({'message':_0x76a1('0x62')});}})[_0x76a1('0x49')](function(_0x3c4fd8){_0x3a5fe0(_0x3c4fd8);});});};exports[_0x76a1('0x65')]=function(_0x3b994f,_0x1052bb,_0x3ca529){_0x3b994f['isMiddleware']=!![];return _0x3ca529();};exports[_0x76a1('0x66')]=function signToken(_0x22368a){return signJwt(_0x22368a);};exports[_0x76a1('0x67')]=function(_0x3ae377,_0x56dfde){if(!_0x3ae377[_0x76a1('0x3b')]){return _0x56dfde[_0x76a1('0x44')](0x194)[_0x76a1('0x46')]({'message':_0x76a1('0x68')});}var _0x31231f={'payload':{'id':_0x3ae377[_0x76a1('0x3b')]['id'],'role':_0x3ae377[_0x76a1('0x3b')][_0x76a1('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x31231f)['then'](function(_0x43ede7){_0x56dfde[_0x76a1('0x69')](_0x76a1('0x6a'),_0x43ede7);_0x56dfde[_0x76a1('0x6b')](_0x76a1('0x6c'));})[_0x76a1('0x49')](function(_0x503403){return _0x56dfde[_0x76a1('0x44')](0x1f4)[_0x76a1('0x6d')](_0x503403);});};exports[_0x76a1('0x6e')]=function(_0x1a5334){if(_['isNil'](_0x1a5334[_0x76a1('0x59')])||_[_0x76a1('0x6f')](_0x1a5334[_0x76a1('0x70')])){return null;}else{return createJwt(_0x1a5334);}};exports[_0x76a1('0x71')]=function(_0x48c47a){_0x48c47a[_0x76a1('0x59')]=generateNonce();_0x48c47a[_0x76a1('0x70')]=generateIssuedAt();return createJwt(_0x48c47a);};exports[_0x76a1('0x72')]=function(_0x24936f,_0x2c334b){var _0x46948c=_0x24936f['query']['apikey'];if(_0x46948c){var _0x2bbb24={'nonce':_0x2c334b[_0x76a1('0x59')],'iat':_0x2c334b['apiKeyIat'],'audience':hardwareConf[_0x76a1('0x54')](),'issuer':hardwareConf[_0x76a1('0x54')]()};return verifyJwt(_0x46948c,_0x2bbb24)[_0x76a1('0x41')](function(){return generateApiKey(_0x2c334b);});}else{throw{'message':_0x76a1('0x73')};}};exports[_0x76a1('0x74')]=function(_0x2b95b9){var _0x2269d8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2269d8[_0x76a1('0x75')](_0x2b95b9))throw new db[(_0x76a1('0x76'))][(_0x76a1('0x77'))](_0x76a1('0x78'));return;};exports[_0x76a1('0x79')]=function(_0x274b97,_0x424adb,_0x39a5ad){var _0x2a3eda=encryptor[_0x76a1('0x7a')](_0x424adb)[_0x76a1('0x7b')](',');for(var _0x3ad3dd=0x0;_0x3ad3dd<_0x39a5ad;_0x3ad3dd++){if(!_0x2a3eda[_0x3ad3dd])break;if(_0x274b97[_0x76a1('0x7c')]()===_0x2a3eda[_0x3ad3dd]['toLowerCase']()){var _0x228465=util[_0x76a1('0x7d')](_0x76a1('0x7e'),_0x39a5ad);if(_0x39a5ad===0x1){_0x228465=_0x76a1('0x7f');}throw new db['Sequelize'][(_0x76a1('0x77'))](_0x228465);}}return;};exports[_0x76a1('0x80')]=function(_0x11d727,_0x496c10){var _0x52608b=_0x496c10?encryptor[_0x76a1('0x7a')](_0x496c10)['split'](','):[];if(_0x52608b[_0x76a1('0x81')]===0x5){_0x52608b[_0x76a1('0x82')](-0x1,0x1);}_0x52608b[_0x76a1('0x83')](_0x11d727);return encryptor[_0x76a1('0x84')](_0x52608b[_0x76a1('0x85')](','));};function signJwt(_0x43fd98){var _0xbe0082=BPromise[_0x76a1('0x86')](jwt['sign'],{'context':jwt});var _0x17f27b=_0x43fd98['secret']||config[_0x76a1('0x87')][_0x76a1('0xa')];return new BPromise(function(_0x3a946c,_0x61e17){_0xbe0082(_0x43fd98[_0x76a1('0x88')],_0x17f27b,_0x43fd98[_0x76a1('0x89')])['then'](function(_0x3491a0){_0x3a946c(_0x3491a0);})['catch'](function(_0x5486a9){_0x61e17(_0x5486a9);});});}function verifyJwt(_0x127068,_0x40a112,_0x14a1d0){var _0x2567d6=BPromise[_0x76a1('0x86')](jwt['verify'],{'context':jwt});var _0x223320=_0x14a1d0||config[_0x76a1('0x87')][_0x76a1('0xa')];return new BPromise(function(_0x1863df,_0x25c29c){_0x2567d6(_0x127068,_0x223320,_0x40a112)[_0x76a1('0x41')](function(_0x50edda){_0x1863df(_0x50edda);})[_0x76a1('0x49')](function(_0x44462a){_0x25c29c(_0x44462a);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x76a1('0x8a')]('hex');}function generateIssuedAt(){return Math[_0x76a1('0x8b')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x482ae4){var _0x10da62={'payload':{'iat':_0x482ae4['apiKeyIat'],'nonce':_0x482ae4[_0x76a1('0x59')]},'options':{'algorithm':'HS512','subject':_0x482ae4['id']['toString'](),'issuer':hardwareConf[_0x76a1('0x54')](),'audience':hardwareConf[_0x76a1('0x54')]()}};return signJwt(_0x10da62)['then'](function(_0x1cda85){return{'iat':_0x482ae4[_0x76a1('0x70')],'nonce':_0x482ae4[_0x76a1('0x59')],'token':_0x1cda85};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 192c2fb..96b04b5 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 _0xa305=['countFilteredContacts','count','User','buildContactsQuery','fields','getFilteredContacts','describe','keys','cf_','CmCustomField','slice','all','length','fieldType','type','catch','./sql-utils','../../mysqldb','findAll','resolve','getContactsSubquery','then','search','parseQueryParameters','where','filter','user','clause','tags','skip','checkListsRestrictions','ids','tag'];(function(_0xbaa6ac,_0x5caae1){var _0x586879=function(_0x23c5fe){while(--_0x23c5fe){_0xbaa6ac['push'](_0xbaa6ac['shift']());}};_0x586879(++_0x5caae1);}(_0xa305,0x139));var _0x5a30=function(_0x141a9f,_0x583251){_0x141a9f=_0x141a9f-0x0;var _0x111641=_0xa305[_0x141a9f];return _0x111641;};'use strict';var _=require('lodash');var sqlUtils=require(_0x5a30('0x0'));var db=require(_0x5a30('0x1'))['db'];exports[_0x5a30('0x2')]=function(_0x349189,_0x91a3d5,_0x4b8ee8,_0x19085f){var _0x28a844={'count':0x0,'rows':[]};var _0xdef9cd=sqlUtils['skipContactsQuery'](_0x91a3d5,_0x349189);if(_0xdef9cd){return Promise[_0x5a30('0x3')](_0x28a844);}var _0xcdb7e2=sqlUtils[_0x5a30('0x4')]();var _0x62ebb2={};var _0x6cd36f=![];var _0x4f05c4=![];return Promise['resolve']()[_0x5a30('0x5')](function(){if(_0x349189[_0x5a30('0x6')]){return sqlUtils['parseAdvancedSearchFilter'](_0x349189[_0x5a30('0x6')],_0x19085f);}else{return sqlUtils[_0x5a30('0x7')](_0x349189,_0x19085f);}})[_0x5a30('0x5')](function(_0x5b42a4){_0xcdb7e2['where'](_0x5b42a4['default']);_0xcdb7e2[_0x5a30('0x8')](_0x5b42a4['fields']);_0xcdb7e2['where'](_0x5b42a4[_0x5a30('0x9')]);_0xcdb7e2['where'](_0x5b42a4[_0x5a30('0xa')][_0x5a30('0xb')]);_0x62ebb2=_0x5b42a4[_0x5a30('0xc')];_0x4f05c4=_0x5b42a4[_0x5a30('0xa')][_0x5a30('0xd')];return sqlUtils[_0x5a30('0xe')](_0x91a3d5,_0x349189,_0x4f05c4);})[_0x5a30('0x5')](function(_0xe33553){_0xcdb7e2[_0x5a30('0x8')](_0xe33553);var _0x182ead=_0x349189[_0x5a30('0x6')]?_0x62ebb2[_0x5a30('0xf')]:_0x349189[_0x5a30('0x10')];_0x6cd36f=_0x182ead?!![]:![];return sqlUtils[_0x5a30('0x11')](_0xcdb7e2,_0x182ead);})[_0x5a30('0x5')](function(_0x568b71){_0x28a844['count']=_0x568b71;if(_0x28a844[_0x5a30('0x12')]===0x0){return;}if(_0x349189[_0x5a30('0x13')]){_0x4f05c4=!![];}return sqlUtils[_0x5a30('0x14')](_0xcdb7e2,_0x349189[_0x5a30('0x15')],_0x4b8ee8,_0x6cd36f,_0x62ebb2[_0x5a30('0xb')],_0x4f05c4);})[_0x5a30('0x5')](function(_0x2c31d6){if(!_0x2c31d6){return[];}return sqlUtils[_0x5a30('0x16')](_0x2c31d6,_0x349189,_0x4b8ee8);})[_0x5a30('0x5')](function(_0x46f7d6){_0x28a844['rows']=_0x46f7d6;return _0x28a844;})['catch'](function(_0x2c7711){throw _0x2c7711;});};exports[_0x5a30('0x17')]=function(){var _0x1e2a29={};var _0x47ff07=[];return db['CmContact'][_0x5a30('0x17')]()[_0x5a30('0x5')](function(_0x271968){_0x1e2a29=_0x271968;var _0x21973d=Object[_0x5a30('0x18')](_0x1e2a29)[_0x5a30('0x9')](function(_0x3340c6){return _['startsWith'](_0x3340c6,_0x5a30('0x19'))?_0x3340c6:undefined;});var _0x324a91=_0x21973d['map'](function(_0x4d7c5c){return db[_0x5a30('0x1a')]['findOne']({'where':{'id':_0x4d7c5c[_0x5a30('0x1b')](0x3)},'raw':!![]});});return Promise[_0x5a30('0x1c')](_0x324a91);})[_0x5a30('0x5')](function(_0x5b9995){for(var _0x2715f6=0x0;_0x2715f6<_0x5b9995[_0x5a30('0x1d')];_0x2715f6++){if(_0x5b9995[_0x2715f6]){var _0x460ac7=_0x5a30('0x19')+_0x5b9995[_0x2715f6]['id'];_0x1e2a29[_0x460ac7][_0x5a30('0x1e')]=_0x5b9995[_0x2715f6][_0x5a30('0x1f')];}}_0x47ff07=_['map'](Object[_0x5a30('0x18')](_0x1e2a29),function(_0xd8f9e7){return{'name':_0xd8f9e7,'type':_0x1e2a29[_0xd8f9e7][_0x5a30('0x1f')]};});return _0x47ff07;})[_0x5a30('0x20')](function(_0x4a55b4){throw _0x4a55b4;});}; \ No newline at end of file +var _0xf8ab=['User','buildContactsQuery','rows','catch','describe','CmContact','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','keys','lodash','./sql-utils','../../mysqldb','resolve','search','parseAdvancedSearchFilter','where','default','fields','filter','user','clause','tags','skip','checkListsRestrictions','then','ids','tag','countFilteredContacts','count'];(function(_0x3286c9,_0x559343){var _0x14bab5=function(_0x49189a){while(--_0x49189a){_0x3286c9['push'](_0x3286c9['shift']());}};_0x14bab5(++_0x559343);}(_0xf8ab,0xe1));var _0xbf8a=function(_0x1cb71a,_0x524748){_0x1cb71a=_0x1cb71a-0x0;var _0x51e78a=_0xf8ab[_0x1cb71a];return _0x51e78a;};'use strict';var _=require(_0xbf8a('0x0'));var sqlUtils=require(_0xbf8a('0x1'));var db=require(_0xbf8a('0x2'))['db'];exports['findAll']=function(_0x569eef,_0xd50f31,_0x10367d,_0x431fe3){var _0x16cc75={'count':0x0,'rows':[]};var _0x51bc23=sqlUtils['skipContactsQuery'](_0xd50f31,_0x569eef);if(_0x51bc23){return Promise[_0xbf8a('0x3')](_0x16cc75);}var _0x289522=sqlUtils['getContactsSubquery']();var _0x570bb6={};var _0x4b4541=![];var _0xe109d2=![];return Promise[_0xbf8a('0x3')]()['then'](function(){if(_0x569eef[_0xbf8a('0x4')]){return sqlUtils[_0xbf8a('0x5')](_0x569eef[_0xbf8a('0x4')],_0x431fe3);}else{return sqlUtils['parseQueryParameters'](_0x569eef,_0x431fe3);}})['then'](function(_0x31dce3){_0x289522[_0xbf8a('0x6')](_0x31dce3[_0xbf8a('0x7')]);_0x289522[_0xbf8a('0x6')](_0x31dce3[_0xbf8a('0x8')]);_0x289522[_0xbf8a('0x6')](_0x31dce3[_0xbf8a('0x9')]);_0x289522[_0xbf8a('0x6')](_0x31dce3[_0xbf8a('0xa')][_0xbf8a('0xb')]);_0x570bb6=_0x31dce3[_0xbf8a('0xc')];_0xe109d2=_0x31dce3['user'][_0xbf8a('0xd')];return sqlUtils[_0xbf8a('0xe')](_0xd50f31,_0x569eef,_0xe109d2);})[_0xbf8a('0xf')](function(_0x477ef5){_0x289522['where'](_0x477ef5);var _0x5505b9=_0x569eef[_0xbf8a('0x4')]?_0x570bb6[_0xbf8a('0x10')]:_0x569eef[_0xbf8a('0x11')];_0x4b4541=_0x5505b9?!![]:![];return sqlUtils[_0xbf8a('0x12')](_0x289522,_0x5505b9);})[_0xbf8a('0xf')](function(_0x1065ae){_0x16cc75['count']=_0x1065ae;if(_0x16cc75[_0xbf8a('0x13')]===0x0){return;}if(_0x569eef[_0xbf8a('0x14')]){_0xe109d2=!![];}return sqlUtils[_0xbf8a('0x15')](_0x289522,_0x569eef[_0xbf8a('0x8')],_0x10367d,_0x4b4541,_0x570bb6['clause'],_0xe109d2);})[_0xbf8a('0xf')](function(_0x21e261){if(!_0x21e261){return[];}return sqlUtils['getFilteredContacts'](_0x21e261,_0x569eef,_0x10367d);})['then'](function(_0x1515fb){_0x16cc75[_0xbf8a('0x16')]=_0x1515fb;return _0x16cc75;})[_0xbf8a('0x17')](function(_0x40157b){throw _0x40157b;});};exports[_0xbf8a('0x18')]=function(){var _0x5233d2={};var _0x518476=[];return db[_0xbf8a('0x19')][_0xbf8a('0x18')]()[_0xbf8a('0xf')](function(_0x3a000f){_0x5233d2=_0x3a000f;var _0x4a49e1=Object['keys'](_0x5233d2)[_0xbf8a('0x9')](function(_0x276ad4){return _['startsWith'](_0x276ad4,_0xbf8a('0x1a'))?_0x276ad4:undefined;});var _0x65fb61=_0x4a49e1[_0xbf8a('0x1b')](function(_0x3faefc){return db[_0xbf8a('0x1c')][_0xbf8a('0x1d')]({'where':{'id':_0x3faefc[_0xbf8a('0x1e')](0x3)},'raw':!![]});});return Promise[_0xbf8a('0x1f')](_0x65fb61);})['then'](function(_0x495aea){for(var _0x193f41=0x0;_0x193f41<_0x495aea['length'];_0x193f41++){if(_0x495aea[_0x193f41]){var _0x3a26e1='cf_'+_0x495aea[_0x193f41]['id'];_0x5233d2[_0x3a26e1][_0xbf8a('0x20')]=_0x495aea[_0x193f41][_0xbf8a('0x21')];}}_0x518476=_[_0xbf8a('0x1b')](Object[_0xbf8a('0x22')](_0x5233d2),function(_0x1be734){return{'name':_0x1be734,'type':_0x5233d2[_0x1be734][_0xbf8a('0x21')]};});return _0x518476;})[_0xbf8a('0x17')](function(_0x3a8c51){throw _0x3a8c51;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index fc1c419..841a043 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 _0xb5d3=['DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','sequelize','query','Tags','clone','COUNT(*)','c.id','isEmpty','toString','exports','squel','../parsers/qs','../../mysqldb','agent','search','ListId','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','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)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','DATE','text','value','Tag','map','tags','clause','and','user','uc.UserId\x20=\x20?','skip','some','compact','Contact','User','c.ListId\x20IN\x20?','concat','\x20=\x20?','resolve','then','fields','tag','filter','getLists','attributes','group','limit','offset','subqry.id','having','order'];(function(_0x35ce58,_0x2c51ac){var _0x2a0b40=function(_0x426abb){while(--_0x426abb){_0x35ce58['push'](_0x35ce58['shift']());}};_0x2a0b40(++_0x2c51ac);}(_0xb5d3,0x146));var _0x3b5d=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xb5d3[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require('lodash');var squel=require(_0x3b5d('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x3b5d('0x1'));var utils=require('../interaction/utils');var db=require(_0x3b5d('0x2'))['db'];function skipContactsQuery(_0x51734d,_0x292140){var _0x50dbcc=![];if(_0x51734d['role']===_0x3b5d('0x3')&&!_0x292140[_0x3b5d('0x4')]&&!_0x292140[_0x3b5d('0x5')]&&_0x292140['autocomplete']!=='true'){_0x50dbcc=!![];}return _0x50dbcc;}function getContactsSubquery(){return squel[_0x3b5d('0x6')]()[_0x3b5d('0x7')](_0x3b5d('0x8'),'c')[_0x3b5d('0x9')](_0x3b5d('0xa'));}function applyJoinClauses(_0x561e1b,_0x1bbad3){var _0x214333=_0x1bbad3?'c':_0x3b5d('0xb');_0x561e1b[_0x3b5d('0xc')](_0x3b5d('0xd'),'uc',_0x3b5d('0xe')+_0x214333+_0x3b5d('0xf'))[_0x3b5d('0xc')](_0x3b5d('0x10'),'ct',_0x3b5d('0x11')+_0x214333+_0x3b5d('0xf'))[_0x3b5d('0xc')](_0x3b5d('0x12'),'t',_0x3b5d('0x13'));return _0x561e1b;}function addFieldsToQuery(_0x15a789,_0x520117,_0x3398d4,_0x4d9875,_0x24d206){var _0x3d6ecb=_0x24d206?'c':_0x3b5d('0xb');if(!_0x520117){_0x520117=['id',_0x3b5d('0x14'),_0x3b5d('0x15'),'phone',_0x3b5d('0x16'),_0x3b5d('0x17'),'email',_0x3b5d('0x5'),'CompanyId',_0x3b5d('0x18'),_0x3b5d('0x19'),_0x3b5d('0x1a'),_0x3b5d('0x1b')];}else if(!_0x520117[_0x3b5d('0x1c')]('id')){_0x520117[_0x3b5d('0x1d')]('id');}var _0x4c1a9b=_0x3398d4&&_0x24d206||!_0x3398d4&&!_0x24d206;if(_0x4d9875){_0x4c1a9b=_0x4d9875&&_0x24d206||!_0x4d9875&&!_0x24d206;}_0x520117[_0x3b5d('0x1e')](function(_0x1316e0){if(_0x1316e0===_0x3b5d('0x1b')){if(_0x4c1a9b){_0x15a789[_0x3b5d('0x1f')](_0x3b5d('0x20'),_0x1316e0);}else if(_0x3398d4||_0x4d9875){_0x15a789[_0x3b5d('0x1f')](_0x3d6ecb+'.'+_0x1316e0);}}else{_0x15a789[_0x3b5d('0x1f')](_0x3d6ecb+'.'+_0x1316e0);}});return _0x15a789;}function getSqlClauses(){var _0x5bd121={'default':squel[_0x3b5d('0x21')](),'fields':squel[_0x3b5d('0x21')](),'filter':squel[_0x3b5d('0x21')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x3b5d('0x21')](),'skip':![]}};return _0x5bd121;}function parseTagParameter(_0x2ba91b){var _0x3e4f47=squel[_0x3b5d('0x21')]();if(_0x2ba91b){var _0x4fdafd=utils[_0x3b5d('0x22')](_0x2ba91b);_0x4fdafd[_0x3b5d('0x1e')](function(_0x5c7fcf){_0x3e4f47['or'](_0x3b5d('0x23'),'%,'+_0x5c7fcf+',%');});}return _0x3e4f47;}function parseSearchFilter(_0x40dca2){var _0x497127=squel[_0x3b5d('0x21')]();if(_0x40dca2){var _0x1cc179=_0x40dca2[_0x3b5d('0x24')]('\x5c','\x5c\x5c')[_0x3b5d('0x24')](/'/g,'\x27\x27');if(_0x1cc179[_0x3b5d('0x25')]('\x20')[_0x3b5d('0x26')]>0x1){_0x497127['or'](_0x3b5d('0x27'),qs['getFullTextValue'](_0x1cc179,!![]),null);}else{if(qs[_0x3b5d('0x28')](_0x1cc179)){_0x497127['or'](_0x3b5d('0x29'),_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2a'),_0x1cc179+'%');_0x497127['or']('c.mobile\x20LIKE\x20?',_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2b'),_0x1cc179+'%');}else if(qs[_0x3b5d('0x2c')](_0x1cc179)){_0x497127['or']('c.email\x20LIKE\x20?',_0x1cc179+'%');}else{_0x497127['or'](_0x3b5d('0x2d'),'%'+_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2e'),'%'+_0x1cc179+'%');_0x497127['or'](_0x3b5d('0x2f'),'%'+_0x1cc179+'%');}}}return _0x497127;}function parseAdvancedSearchFilter(_0x3e576c,_0x42aafd){var _0x568266=getSqlClauses();var _0x559ef6=as['parseSearch'](_0x3e576c);var _0x4f4e6f=_0x559ef6[_0x3b5d('0x30')];for(var _0x70be7c=0x0;_0x70be7c<_0x559ef6[_0x3b5d('0x31')][_0x3b5d('0x26')];_0x70be7c++){var _0x4c28bf=_0x559ef6[_0x3b5d('0x31')][_0x70be7c];var _0x4b315a='c';var _0x43a513=_[_0x3b5d('0x32')](_0x42aafd,[_0x3b5d('0x33'),_0x4c28bf[_0x3b5d('0x1f')]]);if(_0x43a513){if(_0x4c28bf[_0x3b5d('0x1f')]===_0x3b5d('0x34')||_0x43a513[_0x3b5d('0x35')]===_0x3b5d('0x36')){_0x4c28bf['castTo']=_0x3b5d('0x37');}var _0x40a62d=as['buildExpression'](_0x4b315a,_0x43a513['type'],_0x4c28bf);_0x568266['default'][_0x4f4e6f](_0x40a62d[_0x3b5d('0x38')],_0x40a62d[_0x3b5d('0x39')]['start'],_0x40a62d[_0x3b5d('0x39')]['end']);}else{if(_0x4c28bf[_0x3b5d('0x1f')]===_0x3b5d('0x3a')){var _0x36e81b=_0x4c28bf[_0x3b5d('0x39')]['split'](',')[_0x3b5d('0x3b')](function(_0x55ecce){return Number(_0x55ecce);});var _0x49c40f=parseTagParameter(_0x36e81b);_0x568266[_0x3b5d('0x3c')][_0x3b5d('0x3d')][_0x3b5d('0x3e')](_0x49c40f);_0x568266[_0x3b5d('0x3c')]['ids']=_0x36e81b;}else if(_0x4c28bf[_0x3b5d('0x1f')]==='User'){_0x568266[_0x3b5d('0x3f')][_0x3b5d('0x3d')][_0x3b5d('0x3e')](_0x3b5d('0x40'),_0x4c28bf[_0x3b5d('0x39')]);_0x568266[_0x3b5d('0x3f')][_0x3b5d('0x41')]=!![];}}}return _0x568266;}function parseModelFields(_0x755a63,_0x1d24e7){var _0x29eebe=squel[_0x3b5d('0x21')]();var _0x112bc9=_(_0x755a63)['keys']()[_0x3b5d('0x3b')](function(_0x4ed650){return _[_0x3b5d('0x42')](_0x1d24e7,[_0x3b5d('0x33'),_0x4ed650])?_0x4ed650:undefined;})[_0x3b5d('0x43')]()['value']();if(_0x755a63[_0x3b5d('0x44')]){_0x112bc9[_0x3b5d('0x1d')](_0x3b5d('0x44'));}if(_0x755a63[_0x3b5d('0x45')]){_0x112bc9['push'](_0x3b5d('0x45'));}if(_0x112bc9['length']>0x0){_0x112bc9[_0x3b5d('0x1e')](function(_0x5cf346){if(_0x5cf346===_0x3b5d('0x5')){_0x29eebe['and'](_0x3b5d('0x46'),[][_0x3b5d('0x47')](_0x755a63[_0x5cf346]));}else if(_0x5cf346===_0x3b5d('0x44')){var _0x47eee2='%'+_0x755a63[_0x5cf346]+'%';_0x29eebe['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x47eee2);}else if(_0x5cf346===_0x3b5d('0x45')){_0x29eebe[_0x3b5d('0x3e')](_0x3b5d('0x40'),_0x755a63[_0x5cf346]);}else{_0x29eebe[_0x3b5d('0x3e')]('c.'+_0x5cf346+_0x3b5d('0x48'),_0x755a63[_0x5cf346]);}});}return _0x29eebe;}function parseQueryParameters(_0x388814,_0x1ff7c7){var _0x435a93=getSqlClauses();return Promise[_0x3b5d('0x49')]()[_0x3b5d('0x4a')](function(){return parseModelFields(_0x388814,_0x1ff7c7);})['then'](function(_0x46a36f){_0x435a93[_0x3b5d('0x4b')][_0x3b5d('0x3e')](_0x46a36f);return parseTagParameter(_0x388814[_0x3b5d('0x4c')]);})[_0x3b5d('0x4a')](function(_0x39378){_0x435a93['tags'][_0x3b5d('0x3d')][_0x3b5d('0x3e')](_0x39378);return parseSearchFilter(_0x388814[_0x3b5d('0x4d')]);})['then'](function(_0x799e56){_0x435a93[_0x3b5d('0x4d')]=_0x799e56;return _0x435a93;});}function checkListsRestrictions(_0x262095,_0x2691d1,_0x4b3ed9){var _0x4249e6=squel[_0x3b5d('0x21')]();return Promise[_0x3b5d('0x49')]()[_0x3b5d('0x4a')](function(){if(_0x2691d1['search']&&_0x262095['role']===_0x3b5d('0x3')&&!_0x4b3ed9){return _0x262095[_0x3b5d('0x4e')]({'attributes':['id'],'raw':!![]});}})[_0x3b5d('0x4a')](function(_0x51ed0f){if(_0x51ed0f){if(_0x51ed0f[_0x3b5d('0x26')]===0x0){_0x4249e6[_0x3b5d('0x3e')]('c.ListId\x20IS\x20NULL');}else{_0x4249e6[_0x3b5d('0x3e')](_0x3b5d('0x46'),_[_0x3b5d('0x3b')](_0x51ed0f,'id'));}}})[_0x3b5d('0x4a')](function(){return _0x4249e6;});}function buildContactsQuery(_0x3364bd,_0x2fbf29,_0x748ca1,_0x2c5c2a,_0x255d85,_0x35961a){if(_0x2fbf29){_0x2fbf29=_0x748ca1[_0x3b5d('0x4f')];}_0x3364bd=addFieldsToQuery(_0x3364bd,_0x2fbf29,_0x2c5c2a,_0x35961a,!![]);var _0x13d6c6=squel[_0x3b5d('0x6')]();_0x13d6c6=addFieldsToQuery(_0x13d6c6,_0x2fbf29,_0x2c5c2a,_0x35961a,![]);if(_0x2c5c2a||_0x35961a){_0x3364bd=applyJoinClauses(_0x3364bd,!![]);_0x3364bd[_0x3b5d('0x50')]('c.id');if(_0x748ca1[_0x3b5d('0x51')]){_0x13d6c6['limit'](_0x748ca1[_0x3b5d('0x51')]);}if(_0x748ca1[_0x3b5d('0x52')]){_0x13d6c6[_0x3b5d('0x52')](_0x748ca1[_0x3b5d('0x52')]);}}else{_0x13d6c6=applyJoinClauses(_0x13d6c6,![]);_0x13d6c6[_0x3b5d('0x50')](_0x3b5d('0x53'));if(_0x748ca1[_0x3b5d('0x51')]){_0x3364bd[_0x3b5d('0x51')](_0x748ca1['limit']);}if(_0x748ca1[_0x3b5d('0x52')]){_0x3364bd['offset'](_0x748ca1[_0x3b5d('0x52')]);}}_0x13d6c6[_0x3b5d('0x54')](_0x255d85);if(_0x748ca1['order']){_0x748ca1[_0x3b5d('0x55')][_0x3b5d('0x1e')](function(_0x2f7da5){_0x3364bd['order']('c.'+_0x2f7da5[0x0],_0x2f7da5[0x1]===_0x3b5d('0x56')?![]:!![]);_0x13d6c6['order'](_0x3b5d('0x57')+_0x2f7da5[0x0],_0x2f7da5[0x1]===_0x3b5d('0x56')?![]:!![]);});}_0x13d6c6[_0x3b5d('0x7')](_0x3364bd,_0x3b5d('0xb'));return _0x13d6c6;}function getFilteredContacts(_0x1ceea5){var _0x1a8951=[];return db[_0x3b5d('0x3a')][_0x3b5d('0x58')]({'attributes':['id',_0x3b5d('0x33'),_0x3b5d('0x59')],'raw':!![]})[_0x3b5d('0x4a')](function(_0x547aca){_0x1a8951=_[_0x3b5d('0x5a')](_0x547aca,'id');var _0x48c82b={'type':db[_0x3b5d('0x5b')][_0x3b5d('0x5c')][_0x3b5d('0x5d')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3b5d('0x5e')][_0x3b5d('0x5f')](_0x1ceea5['toString'](),_0x48c82b);})[_0x3b5d('0x4a')](function(_0x43b1d4){_0x43b1d4[_0x3b5d('0x1e')](function(_0x5066e4){if(_0x5066e4[_0x3b5d('0x1b')]){_0x5066e4[_0x3b5d('0x60')]=[];_0x5066e4[_0x3b5d('0x1b')][_0x3b5d('0x25')](',')[_0x3b5d('0x1e')](function(_0x34b263){_0x5066e4['Tags'][_0x3b5d('0x1d')](_0x1a8951[_0x34b263]);});}delete _0x5066e4[_0x3b5d('0x1b')];});return _0x43b1d4;});}function countFilteredContacts(_0x208fc1,_0x17f0c0){var _0xb28905=_0x208fc1[_0x3b5d('0x61')]();_0xb28905[_0x3b5d('0x1f')](_0x3b5d('0x62'));_0xb28905=applyJoinClauses(_0xb28905,!![]);_0x208fc1[_0x3b5d('0x50')](_0x3b5d('0x63'));var _0x14a872=utils[_0x3b5d('0x22')](_0x17f0c0);if(!_[_0x3b5d('0x64')](_0x14a872)){_0xb28905[_0x3b5d('0x9')]('t.id\x20IN\x20?',_0x14a872);}var _0x29a36f={'type':db[_0x3b5d('0x5b')]['QueryTypes'][_0x3b5d('0x5d')],'raw':!![]};return db['sequelize'][_0x3b5d('0x5f')](_0xb28905[_0x3b5d('0x65')](),_0x29a36f)['then'](function(_0xa0e583){return _0xa0e583[0x0][_0x3b5d('0x62')];});}module[_0x3b5d('0x66')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x1ca6=['SELECT','sequelize','exports','lodash','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','mobile','email','CompanyId','updatedAt','TagIds','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','DATE','buildExpression','type','default','text','value','start','end','Tag','split','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','Contact','c.ListId\x20IN\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','select','c.id','limit','offset','group','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?'];(function(_0x36976d,_0x8b0ddc){var _0x2ad159=function(_0x513c04){while(--_0x513c04){_0x36976d['push'](_0x36976d['shift']());}};_0x2ad159(++_0x8b0ddc);}(_0x1ca6,0xd9));var _0x61ca=function(_0x5ba280,_0x178f07){_0x5ba280=_0x5ba280-0x0;var _0x57fd68=_0x1ca6[_0x5ba280];return _0x57fd68;};'use strict';var _=require(_0x61ca('0x0'));var squel=require('squel');var as=require(_0x61ca('0x1'));var qs=require('../parsers/qs');var utils=require(_0x61ca('0x2'));var db=require(_0x61ca('0x3'))['db'];function skipContactsQuery(_0x3e1de0,_0x4bf6c2){var _0x5df499=![];if(_0x3e1de0[_0x61ca('0x4')]===_0x61ca('0x5')&&!_0x4bf6c2[_0x61ca('0x6')]&&!_0x4bf6c2[_0x61ca('0x7')]&&_0x4bf6c2[_0x61ca('0x8')]!==_0x61ca('0x9')){_0x5df499=!![];}return _0x5df499;}function getContactsSubquery(){return squel['select']()[_0x61ca('0xa')](_0x61ca('0xb'),'c')[_0x61ca('0xc')](_0x61ca('0xd'));}function applyJoinClauses(_0x8e5527,_0xb4261b){var _0x3c9bd3=_0xb4261b?'c':'subqry';_0x8e5527[_0x61ca('0xe')](_0x61ca('0xf'),'uc',_0x61ca('0x10')+_0x3c9bd3+_0x61ca('0x11'))['left_join'](_0x61ca('0x12'),'ct',_0x61ca('0x13')+_0x3c9bd3+'.id')[_0x61ca('0xe')]('tools_tags','t',_0x61ca('0x14'));return _0x8e5527;}function addFieldsToQuery(_0x1bd805,_0x3208ec,_0x537d85,_0x5e4db1,_0x4080c5){var _0x36d0b2=_0x4080c5?'c':_0x61ca('0x15');if(!_0x3208ec){_0x3208ec=['id',_0x61ca('0x16'),_0x61ca('0x17'),'phone',_0x61ca('0x18'),'fax',_0x61ca('0x19'),_0x61ca('0x7'),_0x61ca('0x1a'),'createdAt',_0x61ca('0x1b'),'deletedAt',_0x61ca('0x1c')];}else if(!_0x3208ec[_0x61ca('0x1d')]('id')){_0x3208ec[_0x61ca('0x1e')]('id');}var _0x1aeae2=_0x537d85&&_0x4080c5||!_0x537d85&&!_0x4080c5;if(_0x5e4db1){_0x1aeae2=_0x5e4db1&&_0x4080c5||!_0x5e4db1&&!_0x4080c5;}_0x3208ec[_0x61ca('0x1f')](function(_0x3719dc){if(_0x3719dc===_0x61ca('0x1c')){if(_0x1aeae2){_0x1bd805['field'](_0x61ca('0x20'),_0x3719dc);}else if(_0x537d85||_0x5e4db1){_0x1bd805[_0x61ca('0x21')](_0x36d0b2+'.'+_0x3719dc);}}else{_0x1bd805[_0x61ca('0x21')](_0x36d0b2+'.'+_0x3719dc);}});return _0x1bd805;}function getSqlClauses(){var _0x3950be={'default':squel[_0x61ca('0x22')](),'fields':squel[_0x61ca('0x22')](),'filter':squel[_0x61ca('0x22')](),'tags':{'clause':squel[_0x61ca('0x22')](),'ids':null},'user':{'clause':squel[_0x61ca('0x22')](),'skip':![]}};return _0x3950be;}function parseTagParameter(_0x3267c5){var _0x3fe937=squel[_0x61ca('0x22')]();if(_0x3267c5){var _0x53350a=utils[_0x61ca('0x23')](_0x3267c5);_0x53350a[_0x61ca('0x1f')](function(_0x4d5adf){_0x3fe937['or'](_0x61ca('0x24'),'%,'+_0x4d5adf+',%');});}return _0x3fe937;}function parseSearchFilter(_0x1fa152){var _0x34e453=squel[_0x61ca('0x22')]();if(_0x1fa152){var _0xb46c6c=_0x1fa152[_0x61ca('0x25')]('\x5c','\x5c\x5c')[_0x61ca('0x25')](/'/g,'\x27\x27');if(_0xb46c6c['split']('\x20')[_0x61ca('0x26')]>0x1){_0x34e453['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xb46c6c,!![]),null);}else{if(qs['isNumeric'](_0xb46c6c)){_0x34e453['or'](_0x61ca('0x27'),_0xb46c6c+'%');_0x34e453['or'](_0x61ca('0x28'),_0xb46c6c+'%');_0x34e453['or']('c.mobile\x20LIKE\x20?',_0xb46c6c+'%');_0x34e453['or']('c.fax\x20LIKE\x20?',_0xb46c6c+'%');}else if(qs[_0x61ca('0x29')](_0xb46c6c)){_0x34e453['or'](_0x61ca('0x2a'),_0xb46c6c+'%');}else{_0x34e453['or'](_0x61ca('0x2b'),'%'+_0xb46c6c+'%');_0x34e453['or'](_0x61ca('0x2c'),'%'+_0xb46c6c+'%');_0x34e453['or'](_0x61ca('0x2a'),'%'+_0xb46c6c+'%');}}}return _0x34e453;}function parseAdvancedSearchFilter(_0x56361c,_0x15468f){var _0x36f0c1=getSqlClauses();var _0x593054=as[_0x61ca('0x2d')](_0x56361c);var _0x9c7be6=_0x593054['sqlOperator'];for(var _0x8f4ac1=0x0;_0x8f4ac1<_0x593054[_0x61ca('0x2e')][_0x61ca('0x26')];_0x8f4ac1++){var _0x16d19d=_0x593054[_0x61ca('0x2e')][_0x8f4ac1];var _0x3c8fad='c';var _0x294508=_['find'](_0x15468f,[_0x61ca('0x2f'),_0x16d19d[_0x61ca('0x21')]]);if(_0x294508){if(_0x16d19d[_0x61ca('0x21')]===_0x61ca('0x30')||_0x294508[_0x61ca('0x31')]===_0x61ca('0x32')){_0x16d19d['castTo']=_0x61ca('0x33');}var _0x1703bd=as[_0x61ca('0x34')](_0x3c8fad,_0x294508[_0x61ca('0x35')],_0x16d19d);_0x36f0c1[_0x61ca('0x36')][_0x9c7be6](_0x1703bd[_0x61ca('0x37')],_0x1703bd[_0x61ca('0x38')][_0x61ca('0x39')],_0x1703bd[_0x61ca('0x38')][_0x61ca('0x3a')]);}else{if(_0x16d19d['field']===_0x61ca('0x3b')){var _0x43bf49=_0x16d19d[_0x61ca('0x38')][_0x61ca('0x3c')](',')[_0x61ca('0x3d')](function(_0x122c34){return Number(_0x122c34);});var _0x57a7f5=parseTagParameter(_0x43bf49);_0x36f0c1[_0x61ca('0x3e')][_0x61ca('0x3f')][_0x61ca('0x40')](_0x57a7f5);_0x36f0c1[_0x61ca('0x3e')][_0x61ca('0x41')]=_0x43bf49;}else if(_0x16d19d[_0x61ca('0x21')]===_0x61ca('0x42')){_0x36f0c1[_0x61ca('0x43')][_0x61ca('0x3f')][_0x61ca('0x40')](_0x61ca('0x44'),_0x16d19d[_0x61ca('0x38')]);_0x36f0c1['user'][_0x61ca('0x45')]=!![];}}}return _0x36f0c1;}function parseModelFields(_0x2be6a1,_0xf68988){var _0x58b429=squel[_0x61ca('0x22')]();var _0x43f048=_(_0x2be6a1)[_0x61ca('0x46')]()['map'](function(_0x40480d){return _['some'](_0xf68988,[_0x61ca('0x2f'),_0x40480d])?_0x40480d:undefined;})['compact']()[_0x61ca('0x38')]();if(_0x2be6a1['Contact']){_0x43f048[_0x61ca('0x1e')](_0x61ca('0x47'));}if(_0x2be6a1[_0x61ca('0x42')]){_0x43f048[_0x61ca('0x1e')]('User');}if(_0x43f048['length']>0x0){_0x43f048['forEach'](function(_0x3fbebb){if(_0x3fbebb===_0x61ca('0x7')){_0x58b429[_0x61ca('0x40')](_0x61ca('0x48'),[]['concat'](_0x2be6a1[_0x3fbebb]));}else if(_0x3fbebb===_0x61ca('0x47')){var _0x501c93='%'+_0x2be6a1[_0x3fbebb]+'%';_0x58b429['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x501c93);}else if(_0x3fbebb===_0x61ca('0x42')){_0x58b429[_0x61ca('0x40')](_0x61ca('0x44'),_0x2be6a1[_0x3fbebb]);}else{_0x58b429[_0x61ca('0x40')]('c.'+_0x3fbebb+_0x61ca('0x49'),_0x2be6a1[_0x3fbebb]);}});}return _0x58b429;}function parseQueryParameters(_0x495196,_0x47cd50){var _0xf48701=getSqlClauses();return Promise[_0x61ca('0x4a')]()[_0x61ca('0x4b')](function(){return parseModelFields(_0x495196,_0x47cd50);})[_0x61ca('0x4b')](function(_0x4e1e5d){_0xf48701[_0x61ca('0x4c')][_0x61ca('0x40')](_0x4e1e5d);return parseTagParameter(_0x495196[_0x61ca('0x4d')]);})[_0x61ca('0x4b')](function(_0x305cef){_0xf48701[_0x61ca('0x3e')][_0x61ca('0x3f')][_0x61ca('0x40')](_0x305cef);return parseSearchFilter(_0x495196[_0x61ca('0x4e')]);})['then'](function(_0xae89b3){_0xf48701['filter']=_0xae89b3;return _0xf48701;});}function checkListsRestrictions(_0x26f658,_0x19b536,_0x302fef){var _0xfb1ed9=squel[_0x61ca('0x22')]();return Promise[_0x61ca('0x4a')]()[_0x61ca('0x4b')](function(){if(_0x19b536[_0x61ca('0x6')]&&_0x26f658[_0x61ca('0x4')]==='agent'&&!_0x302fef){return _0x26f658[_0x61ca('0x4f')]({'attributes':['id'],'raw':!![]});}})[_0x61ca('0x4b')](function(_0x1ba344){if(_0x1ba344){if(_0x1ba344[_0x61ca('0x26')]===0x0){_0xfb1ed9[_0x61ca('0x40')](_0x61ca('0x50'));}else{_0xfb1ed9[_0x61ca('0x40')](_0x61ca('0x48'),_[_0x61ca('0x3d')](_0x1ba344,'id'));}}})['then'](function(){return _0xfb1ed9;});}function buildContactsQuery(_0x2192dc,_0x479417,_0x4c3a45,_0x2383c9,_0x1b898d,_0x5c2ccb){if(_0x479417){_0x479417=_0x4c3a45[_0x61ca('0x51')];}_0x2192dc=addFieldsToQuery(_0x2192dc,_0x479417,_0x2383c9,_0x5c2ccb,!![]);var _0x1bfde6=squel[_0x61ca('0x52')]();_0x1bfde6=addFieldsToQuery(_0x1bfde6,_0x479417,_0x2383c9,_0x5c2ccb,![]);if(_0x2383c9||_0x5c2ccb){_0x2192dc=applyJoinClauses(_0x2192dc,!![]);_0x2192dc['group'](_0x61ca('0x53'));if(_0x4c3a45[_0x61ca('0x54')]){_0x1bfde6['limit'](_0x4c3a45[_0x61ca('0x54')]);}if(_0x4c3a45[_0x61ca('0x55')]){_0x1bfde6['offset'](_0x4c3a45[_0x61ca('0x55')]);}}else{_0x1bfde6=applyJoinClauses(_0x1bfde6,![]);_0x1bfde6[_0x61ca('0x56')]('subqry.id');if(_0x4c3a45[_0x61ca('0x54')]){_0x2192dc[_0x61ca('0x54')](_0x4c3a45['limit']);}if(_0x4c3a45[_0x61ca('0x55')]){_0x2192dc[_0x61ca('0x55')](_0x4c3a45[_0x61ca('0x55')]);}}_0x1bfde6[_0x61ca('0x57')](_0x1b898d);if(_0x4c3a45[_0x61ca('0x58')]){_0x4c3a45[_0x61ca('0x58')][_0x61ca('0x1f')](function(_0x497c5d){_0x2192dc['order']('c.'+_0x497c5d[0x0],_0x497c5d[0x1]===_0x61ca('0x59')?![]:!![]);_0x1bfde6[_0x61ca('0x58')](_0x61ca('0x5a')+_0x497c5d[0x0],_0x497c5d[0x1]===_0x61ca('0x59')?![]:!![]);});}_0x1bfde6['from'](_0x2192dc,_0x61ca('0x15'));return _0x1bfde6;}function getFilteredContacts(_0x1607fb){var _0x5cdcf2=[];return db['Tag'][_0x61ca('0x5b')]({'attributes':['id',_0x61ca('0x2f'),_0x61ca('0x5c')],'raw':!![]})[_0x61ca('0x4b')](function(_0xc4771b){_0x5cdcf2=_[_0x61ca('0x5d')](_0xc4771b,'id');var _0xb1d4ce={'type':db[_0x61ca('0x5e')][_0x61ca('0x5f')]['SELECT'],'model':db[_0x61ca('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x61ca('0x61')](_0x1607fb[_0x61ca('0x62')](),_0xb1d4ce);})['then'](function(_0x289252){_0x289252[_0x61ca('0x1f')](function(_0x187b49){if(_0x187b49[_0x61ca('0x1c')]){_0x187b49[_0x61ca('0x63')]=[];_0x187b49[_0x61ca('0x1c')][_0x61ca('0x3c')](',')['forEach'](function(_0x5a0c71){_0x187b49[_0x61ca('0x63')][_0x61ca('0x1e')](_0x5cdcf2[_0x5a0c71]);});}delete _0x187b49[_0x61ca('0x1c')];});return _0x289252;});}function countFilteredContacts(_0x34f45d,_0x3995a5){var _0x4b4459=_0x34f45d[_0x61ca('0x64')]();_0x4b4459[_0x61ca('0x21')](_0x61ca('0x65'));_0x4b4459=applyJoinClauses(_0x4b4459,!![]);_0x34f45d[_0x61ca('0x56')](_0x61ca('0x53'));var _0x13b7b2=utils[_0x61ca('0x23')](_0x3995a5);if(!_[_0x61ca('0x66')](_0x13b7b2)){_0x4b4459['where'](_0x61ca('0x67'),_0x13b7b2);}var _0x5bcf2d={'type':db[_0x61ca('0x5e')]['QueryTypes'][_0x61ca('0x68')],'raw':!![]};return db[_0x61ca('0x69')][_0x61ca('0x61')](_0x4b4459[_0x61ca('0x62')](),_0x5bcf2d)[_0x61ca('0x4b')](function(_0x5e4dbc){return _0x5e4dbc[0x0][_0x61ca('0x65')];});}module[_0x61ca('0x6a')]={'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 0034ada..d67230b 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 _0x38c7=['close','createReadStream','createWriteStream','createDecipher','unlink','encryptString','secret','base64','decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createCipher','update','binary','end','final','write'];(function(_0x29166b,_0x3c0f7a){var _0x3d1ff2=function(_0x3611cd){while(--_0x3611cd){_0x29166b['push'](_0x29166b['shift']());}};_0x3d1ff2(++_0x3c0f7a);}(_0x38c7,0x122));var _0x738c=function(_0x3e7139,_0x37bab7){_0x3e7139=_0x3e7139-0x0;var _0x1004e3=_0x38c7[_0x3e7139];return _0x1004e3;};'use strict';var crypto=require(_0x738c('0x0'));var fs=require('fs');var BPromise=require(_0x738c('0x1'));var _=require(_0x738c('0x2'));var config=require(_0x738c('0x3'));var logger=require(_0x738c('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x738c('0x5')][_0x738c('0x6')],'algorithm':_0x738c('0x7')};const fileOptions={'algorithm':_0x738c('0x8')};if(config[_0x738c('0x9')]&&config[_0x738c('0x9')][_0x738c('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt']['algorithm']);if(isSupported){fileOptions['algorithm']=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x738c('0xb')](config[_0x738c('0x9')][_0x738c('0xa')],_0x738c('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2c8834){return AES_SUPPORTED_RX[_0x738c('0xd')](_0x2c8834);}function getSupportedCiphers(){return crypto[_0x738c('0xe')]()[_0x738c('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x6430d3){return getSupportedCiphers()[_0x738c('0x10')](_0x6430d3)>-0x1;}function combineOptions(_0x57c884){var _0x2de2ce={};for(var _0x4164b5 in fileOptions){if(fileOptions[_0x738c('0x11')](_0x4164b5)){_0x2de2ce[_0x4164b5]=fileOptions[_0x4164b5];}}if(_0x57c884){for(var _0x2e1f5c in _0x57c884){if(_0x57c884[_0x738c('0x11')](_0x2e1f5c)){_0x2de2ce[_0x2e1f5c]=_0x57c884[_0x2e1f5c];}}}return _0x2de2ce;}exports[_0x738c('0x12')]=function(_0x47fbba,_0x1243aa,_0x3fe9e6,_0x4676cb){return new BPromise(function(_0x314ec6,_0x7f0034){_0x4676cb=combineOptions(_0x4676cb);var _0x857816=new Buffer(_0x3fe9e6);var _0x24881b=fs['createReadStream'](_0x47fbba);var _0xaab29d=fs['createWriteStream'](_0x1243aa);var _0x275c4b=crypto[_0x738c('0x13')](_0x4676cb['algorithm'],_0x857816);_0x24881b['on']('data',function(_0xf3ae93){var _0x109c66=new Buffer(_0x275c4b[_0x738c('0x14')](_0xf3ae93),_0x738c('0x15'));_0xaab29d['write'](_0x109c66);});_0x24881b['on'](_0x738c('0x16'),function(){try{var _0x2ee9cd=new Buffer(_0x275c4b[_0x738c('0x17')](_0x738c('0x15')),_0x738c('0x15'));_0xaab29d[_0x738c('0x18')](_0x2ee9cd);_0xaab29d['end']();_0xaab29d['on'](_0x738c('0x19'),function(){return _0x314ec6(_0x1243aa);});}catch(_0x6df9d1){fs['unlink'](_0x1243aa);return _0x7f0034(_0x6df9d1);}});});};exports['decryptFile']=function(_0x221442,_0x3552af,_0x3493a9,_0x515863){return new BPromise(function(_0x13891a,_0x221d60){_0x515863=combineOptions(_0x515863);var _0x168ca0=new Buffer(_0x3493a9);var _0x548621=fs[_0x738c('0x1a')](_0x221442);var _0x472b7a=fs[_0x738c('0x1b')](_0x3552af);var _0x4bc3b6=crypto[_0x738c('0x1c')](_0x515863['algorithm'],_0x168ca0);_0x548621['on']('data',function(_0x22f07b){var _0x44433c=new Buffer(_0x4bc3b6[_0x738c('0x14')](_0x22f07b),'binary');_0x472b7a['write'](_0x44433c);});_0x548621['on'](_0x738c('0x16'),function(){try{var _0xf1f5b2=new Buffer(_0x4bc3b6[_0x738c('0x17')](_0x738c('0x15')),_0x738c('0x15'));_0x472b7a[_0x738c('0x18')](_0xf1f5b2);_0x472b7a[_0x738c('0x16')]();_0x472b7a['on'](_0x738c('0x19'),function(){return _0x13891a(_0x3552af);});}catch(_0x3ff995){fs[_0x738c('0x1d')](_0x3552af);return _0x221d60(_0x3ff995);}});});};exports[_0x738c('0x1e')]=function(_0x570109,_0x424dd4,_0x538750){var _0x267916=_0x538750||stringOptions['algorithm'];var _0x48b32c=_0x424dd4||stringOptions[_0x738c('0x1f')];var _0x3f263a=crypto[_0x738c('0x13')](_0x267916,_0x48b32c);var _0x2ac64e=_0x3f263a[_0x738c('0x14')](_0x570109,'utf8',_0x738c('0x20'));_0x2ac64e+=_0x3f263a['final']('base64');return _0x2ac64e;};exports[_0x738c('0x21')]=function(_0x47cb2a,_0x159fec,_0x25cec9){var _0x342e60=_0x25cec9||stringOptions[_0x738c('0xa')];var _0x1828cd=_0x159fec||stringOptions[_0x738c('0x1f')];var _0xdf7ced=crypto[_0x738c('0x1c')](_0x342e60,_0x1828cd);var _0x2ad6ac=_0xdf7ced[_0x738c('0x14')](_0x47cb2a,'base64',_0x738c('0x22'));_0x2ad6ac+=_0xdf7ced[_0x738c('0x17')]('utf8');return _0x2ad6ac;}; \ No newline at end of file +var _0x2329=['createWriteStream','unlink','secret','createCipher','utf8','decryptString','update','base64','final','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','filter','hasOwnProperty','encryptFile','createReadStream','data','binary','write','end','close'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2329,0x9a));var _0x9232=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2329[_0x122ef9];return _0x42fba0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x9232('0x0'));var logger=require(_0x9232('0x1'))(_0x9232('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x9232('0x3')][_0x9232('0x4')],'algorithm':_0x9232('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0x9232('0x6')]&&config[_0x9232('0x6')][_0x9232('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x9232('0x7')]);if(isSupported){fileOptions['algorithm']=config[_0x9232('0x6')][_0x9232('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9232('0x8')](',\x20');logger[_0x9232('0x9')](config[_0x9232('0x6')]['algorithm'],_0x9232('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x50897c){return AES_SUPPORTED_RX['test'](_0x50897c);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x9232('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x3218ef){return getSupportedCiphers()['indexOf'](_0x3218ef)>-0x1;}function combineOptions(_0x5d9969){var _0x37e124={};for(var _0x14b9b0 in fileOptions){if(fileOptions[_0x9232('0xc')](_0x14b9b0)){_0x37e124[_0x14b9b0]=fileOptions[_0x14b9b0];}}if(_0x5d9969){for(var _0x32ef8c in _0x5d9969){if(_0x5d9969[_0x9232('0xc')](_0x32ef8c)){_0x37e124[_0x32ef8c]=_0x5d9969[_0x32ef8c];}}}return _0x37e124;}exports[_0x9232('0xd')]=function(_0x30f9d0,_0x530e92,_0x58aa28,_0x1e4783){return new BPromise(function(_0x293fb2,_0x29c1f7){_0x1e4783=combineOptions(_0x1e4783);var _0x54b111=new Buffer(_0x58aa28);var _0x406daf=fs[_0x9232('0xe')](_0x30f9d0);var _0x3d1c8c=fs['createWriteStream'](_0x530e92);var _0x333a0d=crypto['createCipher'](_0x1e4783['algorithm'],_0x54b111);_0x406daf['on'](_0x9232('0xf'),function(_0x534868){var _0x156f3f=new Buffer(_0x333a0d['update'](_0x534868),_0x9232('0x10'));_0x3d1c8c[_0x9232('0x11')](_0x156f3f);});_0x406daf['on'](_0x9232('0x12'),function(){try{var _0x20a470=new Buffer(_0x333a0d['final'](_0x9232('0x10')),_0x9232('0x10'));_0x3d1c8c[_0x9232('0x11')](_0x20a470);_0x3d1c8c[_0x9232('0x12')]();_0x3d1c8c['on'](_0x9232('0x13'),function(){return _0x293fb2(_0x530e92);});}catch(_0x4ffd81){fs['unlink'](_0x530e92);return _0x29c1f7(_0x4ffd81);}});});};exports['decryptFile']=function(_0x58a056,_0x16a20e,_0x5466e4,_0x49f999){return new BPromise(function(_0x248094,_0x75f950){_0x49f999=combineOptions(_0x49f999);var _0x1ecb10=new Buffer(_0x5466e4);var _0x4f97ff=fs[_0x9232('0xe')](_0x58a056);var _0x3a7566=fs[_0x9232('0x14')](_0x16a20e);var _0x6c1765=crypto['createDecipher'](_0x49f999[_0x9232('0x7')],_0x1ecb10);_0x4f97ff['on'](_0x9232('0xf'),function(_0x33effd){var _0x486cbb=new Buffer(_0x6c1765['update'](_0x33effd),_0x9232('0x10'));_0x3a7566[_0x9232('0x11')](_0x486cbb);});_0x4f97ff['on'](_0x9232('0x12'),function(){try{var _0x4703b1=new Buffer(_0x6c1765['final'](_0x9232('0x10')),_0x9232('0x10'));_0x3a7566['write'](_0x4703b1);_0x3a7566[_0x9232('0x12')]();_0x3a7566['on']('close',function(){return _0x248094(_0x16a20e);});}catch(_0x1270ae){fs[_0x9232('0x15')](_0x16a20e);return _0x75f950(_0x1270ae);}});});};exports['encryptString']=function(_0x440988,_0x57dc10,_0x32d88d){var _0x5f1718=_0x32d88d||stringOptions['algorithm'];var _0x5bfdc4=_0x57dc10||stringOptions[_0x9232('0x16')];var _0x158d77=crypto[_0x9232('0x17')](_0x5f1718,_0x5bfdc4);var _0x4781f0=_0x158d77['update'](_0x440988,_0x9232('0x18'),'base64');_0x4781f0+=_0x158d77['final']('base64');return _0x4781f0;};exports[_0x9232('0x19')]=function(_0x3bbd5f,_0x4a9670,_0x5562bd){var _0x44c209=_0x5562bd||stringOptions[_0x9232('0x7')];var _0x457dc2=_0x4a9670||stringOptions[_0x9232('0x16')];var _0x491c9c=crypto['createDecipher'](_0x44c209,_0x457dc2);var _0x23533b=_0x491c9c[_0x9232('0x1a')](_0x3bbd5f,_0x9232('0x1b'),_0x9232('0x18'));_0x23533b+=_0x491c9c[_0x9232('0x1c')]('utf8');return _0x23533b;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 0eb777a..11a39ed 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 _0x3c5d=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../config/logger','argv','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeCsv','then','query','sequelize','SELECT','num','Empty','split','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','mkdirSync','join','each','csv','%s.%s','writeFileSync','zip','CSV','Completed','catch'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x3c5d,0x1ac));var _0xd3c5=function(_0x5d076a,_0x3c2cf4){_0x5d076a=_0x5d076a-0x0;var _0x42e67e=_0x3c5d[_0x5d076a];return _0x42e67e;};'use strict';var util=require(_0xd3c5('0x0'));var path=require(_0xd3c5('0x1'));var _=require(_0xd3c5('0x2'));var csv=require(_0xd3c5('0x3'));var fs=require('fs');var BPromise=require(_0xd3c5('0x4'));var zipdir=require(_0xd3c5('0x5'));var rimraf=require(_0xd3c5('0x6'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xd3c5('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd3c5('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd3c5('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x77ad2c,_0x8f7b37){var _0x16d1c9={'status':_0x77ad2c};var _0x10dabc={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8f7b37){_0x16d1c9['savename']=_0x8f7b37;}return db['AnalyticExtractedReport'][_0xd3c5('0x9')](_0x16d1c9,_0x10dabc);}function main(){var _0x2d2bc6=0x1388;var _0x1f3880;logger[_0xd3c5('0xa')](util[_0xd3c5('0xb')](_0xd3c5('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xd3c5('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd3c5('0xe')]})[_0xd3c5('0xf')](function(_0x239979){if(_0x239979){_0x1f3880=_0x239979;_0x2d2bc6=_0x1f3880[_0xd3c5('0xe')]||0x1388;}})[_0xd3c5('0xf')](function(){return dbH['sequelize'][_0xd3c5('0x10')](util[_0xd3c5('0xb')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd3c5('0x11')]['QueryTypes'][_0xd3c5('0x12')]});})[_0xd3c5('0xf')](function(_0x1bfbb5){if(!_0x1bfbb5[0x0][_0xd3c5('0x13')]){return analyticExtractedReport(_0xd3c5('0x14'));}var _0xeb7180=[];var _0x11ef72=0x0;if(_0x1f3880[_0xd3c5('0x15')]){if(_0x1bfbb5&&_0x1bfbb5[_0xd3c5('0x16')]){var _0x17502b=_[_0xd3c5('0x17')](_0x1bfbb5[0x0]['num']/_0x2d2bc6);var _0x4336f1=Number[_0xd3c5('0x18')](_0x1bfbb5[0x0]['num']/_0x2d2bc6)?_0x1bfbb5[0x0][_0xd3c5('0x13')]%_0x2d2bc6:0x0;_0x17502b[_0xd3c5('0x19')](function(_0xf232fe){if(_0xf232fe>0x0){_0x11ef72+=_0x2d2bc6;}_0xeb7180[_0xd3c5('0x1a')](dbH[_0xd3c5('0x11')]['query'](util[_0xd3c5('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2d2bc6,_0x11ef72),{'type':dbH[_0xd3c5('0x11')]['QueryTypes']['SELECT']}));});if(_0x4336f1>0x0){_0x11ef72+=_0x2d2bc6;_0xeb7180['push'](dbH[_0xd3c5('0x11')][_0xd3c5('0x10')](util[_0xd3c5('0xb')](_0xd3c5('0x1b'),QUERY,_0x4336f1,_0x11ef72),{'type':dbH['sequelize'][_0xd3c5('0x1c')]['SELECT']}));}}}else{_0xeb7180[_0xd3c5('0x1a')](dbH[_0xd3c5('0x11')][_0xd3c5('0x10')](QUERY,{'type':dbH[_0xd3c5('0x11')][_0xd3c5('0x1c')]['SELECT']}));}var _0x5e9551=path[_0xd3c5('0x1d')](PATH);var _0x5bab42=path[_0xd3c5('0x1e')](PATH,'.csv');var _0x44534a=_0x1f3880[_0xd3c5('0x15')]&&_0xeb7180[_0xd3c5('0x16')]>0x1;var _0x55d250=[];if(!fs[_0xd3c5('0x1f')](path['join'](_0x5e9551,_0x5bab42))&&_0x44534a){fs[_0xd3c5('0x20')](path[_0xd3c5('0x21')](_0x5e9551,_0x5bab42));}return BPromise[_0xd3c5('0x22')](_0xeb7180,function(_0x154aa6){_0x55d250[_0xd3c5('0x1a')](_0x154aa6);})[_0xd3c5('0xf')](function(){for(var _0x359ad9=0x0;_0x359ad9<_0x55d250[_0xd3c5('0x16')];_0x359ad9+=0x1){var _0x3ac166;var _0x42291f=_0x55d250[_0x359ad9];if(_0x44534a){_0x3ac166=path[_0xd3c5('0x21')](_0x5e9551,_0x5bab42,util['format']('%s%d.%s',_0x5bab42,_0x359ad9,_0xd3c5('0x23')));}else{_0x3ac166=path['join'](_0x5e9551,util[_0xd3c5('0xb')](_0xd3c5('0x24'),_0x5bab42,_0xd3c5('0x23')));}fs[_0xd3c5('0x25')](_0x3ac166,csv(_0x42291f));}})[_0xd3c5('0xf')](function(){if(_0x44534a){return new Promise(function(_0x34a3b4){zipdir(path[_0xd3c5('0x21')](_0x5e9551,_0x5bab42),{'saveTo':path[_0xd3c5('0x21')](_0x5e9551,util[_0xd3c5('0xb')](_0xd3c5('0x24'),_0x5bab42,_0xd3c5('0x26')))},function(_0x29cc50,_0x21b4f5){rimraf(path['join'](_0x5e9551,_0x5bab42),function(){});_0x34a3b4('zip\x20finished');});});}})['then'](function(){logger[_0xd3c5('0xa')](util[_0xd3c5('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xd3c5('0x27')));return analyticExtractedReport(_0xd3c5('0x28'),_0x44534a?util['format'](_0xd3c5('0x24'),_0x5bab42,_0x44534a?_0xd3c5('0x26'):_0xd3c5('0x23')):null);});})[_0xd3c5('0x29')](function(_0x123d9f){logger[_0xd3c5('0xa')](util[_0xd3c5('0xb')](_0xd3c5('0x2a'),EXTRACTED_REPORT_ID,_0xd3c5('0x27')),util[_0xd3c5('0x2b')](_0x123d9f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd3c5('0x2c'));})[_0xd3c5('0x2d')](function(){process[_0xd3c5('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x99c9=['find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','range','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','info','inspect','finally','exit','util','path','bluebird','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x27e551,_0x27edb1){var _0x27076e=function(_0x1f7083){while(--_0x1f7083){_0x27e551['push'](_0x27e551['shift']());}};_0x27076e(++_0x27edb1);}(_0x99c9,0x165));var _0x999c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x99c9[_0x36ed48];return _0x51c63a;};'use strict';var util=require(_0x999c('0x0'));var path=require(_0x999c('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x999c('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x999c('0x3'));var db=require(_0x999c('0x4'))['db'];var dbH=require(_0x999c('0x4'))['dbH'];var logger=require(_0x999c('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x999c('0x6')][0x2]);var QUERY=process[_0x999c('0x6')][0x3];var PATH=process[_0x999c('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5e640a,_0x1b776e){var _0x4711b8={'status':_0x5e640a};var _0x195b1b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b776e){_0x4711b8['savename']=_0x1b776e;}return db[_0x999c('0x7')]['update'](_0x4711b8,_0x195b1b);}function main(){var _0xe77a01=0x1388;var _0x559f59;logger['info'](util[_0x999c('0x8')](_0x999c('0x9'),EXTRACTED_REPORT_ID,_0x999c('0xa')));return db['Setting'][_0x999c('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x999c('0xc'),_0x999c('0xd')]})[_0x999c('0xe')](function(_0x44cb43){if(_0x44cb43){_0x559f59=_0x44cb43;_0xe77a01=_0x559f59['splitSizeCsv']||0x1388;}})[_0x999c('0xe')](function(){return dbH[_0x999c('0xf')][_0x999c('0x10')](util[_0x999c('0x8')](_0x999c('0x11'),QUERY),{'type':dbH[_0x999c('0xf')][_0x999c('0x12')]['SELECT']});})['then'](function(_0x179c19){if(!_0x179c19[0x0][_0x999c('0x13')]){return analyticExtractedReport(_0x999c('0x14'));}var _0xfde64b=[];var _0x4c5b97=0x0;if(_0x559f59[_0x999c('0xc')]){if(_0x179c19&&_0x179c19[_0x999c('0x15')]){var _0x2633b4=_[_0x999c('0x16')](_0x179c19[0x0][_0x999c('0x13')]/_0xe77a01);var _0x2c21cd=Number[_0x999c('0x17')](_0x179c19[0x0][_0x999c('0x13')]/_0xe77a01)?_0x179c19[0x0][_0x999c('0x13')]%_0xe77a01:0x0;_0x2633b4['forEach'](function(_0x4dd0bd){if(_0x4dd0bd>0x0){_0x4c5b97+=_0xe77a01;}_0xfde64b[_0x999c('0x18')](dbH[_0x999c('0xf')][_0x999c('0x10')](util[_0x999c('0x8')](_0x999c('0x19'),QUERY,_0xe77a01,_0x4c5b97),{'type':dbH[_0x999c('0xf')][_0x999c('0x12')]['SELECT']}));});if(_0x2c21cd>0x0){_0x4c5b97+=_0xe77a01;_0xfde64b[_0x999c('0x18')](dbH['sequelize'][_0x999c('0x10')](util[_0x999c('0x8')](_0x999c('0x19'),QUERY,_0x2c21cd,_0x4c5b97),{'type':dbH[_0x999c('0xf')][_0x999c('0x12')][_0x999c('0x1a')]}));}}}else{_0xfde64b['push'](dbH[_0x999c('0xf')]['query'](QUERY,{'type':dbH[_0x999c('0xf')][_0x999c('0x12')]['SELECT']}));}var _0x3eb3bb=path[_0x999c('0x1b')](PATH);var _0x200669=path[_0x999c('0x1c')](PATH,_0x999c('0x1d'));var _0x19d4b6=_0x559f59[_0x999c('0xc')]&&_0xfde64b[_0x999c('0x15')]>0x1;var _0x5eba6c=[];if(!fs[_0x999c('0x1e')](path[_0x999c('0x1f')](_0x3eb3bb,_0x200669))&&_0x19d4b6){fs[_0x999c('0x20')](path[_0x999c('0x1f')](_0x3eb3bb,_0x200669));}return BPromise[_0x999c('0x21')](_0xfde64b,function(_0x3a846f){_0x5eba6c['push'](_0x3a846f);})[_0x999c('0xe')](function(){for(var _0xaac654=0x0;_0xaac654<_0x5eba6c['length'];_0xaac654+=0x1){var _0x16d02e;var _0x5af2ba=_0x5eba6c[_0xaac654];if(_0x19d4b6){_0x16d02e=path[_0x999c('0x1f')](_0x3eb3bb,_0x200669,util['format'](_0x999c('0x22'),_0x200669,_0xaac654,_0x999c('0x23')));}else{_0x16d02e=path['join'](_0x3eb3bb,util[_0x999c('0x8')](_0x999c('0x24'),_0x200669,'csv'));}fs[_0x999c('0x25')](_0x16d02e,csv(_0x5af2ba));}})['then'](function(){if(_0x19d4b6){return new Promise(function(_0x4acddb){zipdir(path[_0x999c('0x1f')](_0x3eb3bb,_0x200669),{'saveTo':path[_0x999c('0x1f')](_0x3eb3bb,util[_0x999c('0x8')]('%s.%s',_0x200669,'zip'))},function(_0x5ee010,_0x30f85d){rimraf(path['join'](_0x3eb3bb,_0x200669),function(){});_0x4acddb(_0x999c('0x26'));});});}})[_0x999c('0xe')](function(){logger['info'](util[_0x999c('0x8')](_0x999c('0x27'),EXTRACTED_REPORT_ID,_0x999c('0xa')));return analyticExtractedReport('Completed',_0x19d4b6?util[_0x999c('0x8')](_0x999c('0x24'),_0x200669,_0x19d4b6?_0x999c('0x28'):_0x999c('0x23')):null);});})[_0x999c('0x29')](function(_0x1581d0){logger[_0x999c('0x2a')](util[_0x999c('0x8')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x999c('0xa')),util[_0x999c('0x2b')](_0x1581d0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x999c('0x2c')](function(){process[_0x999c('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 8790344..b92e9df 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 _0x4308=['join','mkdirSync','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','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','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','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','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','tableHeader','pick','map','toString','fill','length','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','footer','Arial','num','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf'];(function(_0x1944af,_0xad10c8){var _0x350b4f=function(_0x70dc62){while(--_0x70dc62){_0x1944af['push'](_0x1944af['shift']());}};_0x350b4f(++_0xad10c8);}(_0x4308,0x1c7));var _0x8430=function(_0x3344d5,_0x3936a4){_0x3344d5=_0x3344d5-0x0;var _0xff1fcb=_0x4308[_0x3344d5];return _0xff1fcb;};'use strict';var _=require(_0x8430('0x0'));var fs=require('fs');var util=require(_0x8430('0x1'));var path=require(_0x8430('0x2'));var moment=require(_0x8430('0x3'));var htmlToPdfmake=require(_0x8430('0x4'));var PdfPrinter=require(_0x8430('0x5'));var zipdir=require(_0x8430('0x6'));var rimraf=require(_0x8430('0x7'));var JSDOM=require(_0x8430('0x8'))[_0x8430('0x9')];var window=new JSDOM('')[_0x8430('0xa')];var BPromise=require(_0x8430('0xb'));var db=require(_0x8430('0xc'))['db'];var dbH=require('../../mysqldb')[_0x8430('0xd')];var logger=require('../../config/logger')(_0x8430('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x8430('0xf')][0x2]);var QUERY=process[_0x8430('0xf')][0x3];var PATH=process[_0x8430('0xf')][0x4];var NAME=process[_0x8430('0xf')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3ad658,_0x582772){var _0x7f6aed={'status':_0x3ad658};var _0x125248={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x582772){_0x7f6aed['savename']=_0x582772;}return db[_0x8430('0x10')][_0x8430('0x11')](_0x7f6aed,_0x125248);}function getHeaders(_0x4398a2){return _['map'](_0x4398a2,function(_0x4f06f5){return{'text':_0x4f06f5,'style':_0x8430('0x12')};});}function getRows(_0x55cb5d,_0x4b2a3f){return _['map'](_0x4b2a3f,function(_0xf7ffd6){return _(_0xf7ffd6)[_0x8430('0x13')](_0x55cb5d)[_0x8430('0x14')](function(_0x448131){return _0x448131?_[_0x8430('0x15')](_0x448131):'';})['value']();});}function createTable(_0x145d13,_0x3c5f5c){var _0x9892af={'widths':_[_0x8430('0x16')](Array(_0x145d13[_0x8430('0x17')]),0x91),'heights':function(_0x5d3f01){return _0x5d3f01===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x551ebe=getHeaders(_0x145d13);_0x9892af['body'][_0x8430('0x18')](_0x551ebe);var _0x595712=getRows(_0x145d13,_0x3c5f5c);_0x9892af['body']=_0x9892af['body'][_0x8430('0x19')](_0x595712);return _0x9892af;}function createTables(_0xa54578){var _0x2f1cfe=[];var _0x59a766=_['chunk'](Object[_0x8430('0x1a')](_0xa54578[0x0]),0x5);_0x59a766[_0x8430('0x1b')](function(_0x500c65){_0x2f1cfe['push'](createTable(_0x500c65,_0xa54578));});return _0x2f1cfe;}function getPDFDocDefinition(_0x363dbe){var _0x2957a3=util[_0x8430('0x1c')](_0x8430('0x1d'),NAME,EXTRACTED_REPORT[_0x8430('0x1e')],moment(EXTRACTED_REPORT[_0x8430('0x1f')])[_0x8430('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x8430('0x20')])['format'](FORMAT));var _0x5bb47b=[];for(var _0x3f8589=0x0;_0x3f8589<_0x363dbe[_0x8430('0x17')];_0x3f8589++){var _0x264947=[];if(_0x3f8589===0x0){_0x264947[_0x8430('0x18')]({'text':_0x2957a3,'style':_0x8430('0x21')});}var _0x280a77={'table':_0x363dbe[_0x3f8589]};if(_0x3f8589>0x0){_0x280a77['pageBreak']=_0x8430('0x22');_0x280a77[_0x8430('0x23')]=[0x0,0x46,0x0,0x0];}_0x264947[_0x8430('0x18')](_0x280a77);_0x5bb47b['push'](_0x264947);}return{'pageSize':'A4','pageOrientation':_0x8430('0x24'),'content':_0x5bb47b,'footer':function(_0x317045,_0xe60fb5){return{'text':_0x317045[_0x8430('0x15')]()+'\x20/\x20'+_0xe60fb5,'style':_0x8430('0x25')};},'defaultStyle':{'font':_0x8430('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x20a459){var _0x280316=0x1388;var _0x398427;if(!_0x20a459[0x0][_0x8430('0x27')]){return analyticExtractedReport('Empty');}return db[_0x8430('0x28')][_0x8430('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8430('0x2a'),_0x8430('0x2b')]})[_0x8430('0x2c')](function(_0x20bd95){if(_0x20bd95){_0x398427=_0x20bd95;_0x280316=_0x398427['splitSizePdf']||0x3e8;}})[_0x8430('0x2c')](function(){var _0x3b2976=[];var _0x1f86c4=0x0;if(_0x398427['split']){if(_0x20a459&&_0x20a459[_0x8430('0x17')]){var _0x31878a=_[_0x8430('0x2d')](_0x20a459[0x0][_0x8430('0x27')]/_0x280316);var _0x4c7b45=Number[_0x8430('0x2e')](_0x20a459[0x0]['num']/_0x280316)?_0x20a459[0x0][_0x8430('0x27')]%_0x280316:0x0;_0x31878a[_0x8430('0x1b')](function(_0x54ea04){if(_0x54ea04>0x0){_0x1f86c4+=_0x280316;}_0x3b2976[_0x8430('0x18')](dbH[_0x8430('0x2f')][_0x8430('0x30')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x280316,_0x1f86c4),{'type':dbH['sequelize'][_0x8430('0x31')][_0x8430('0x32')]}));});if(_0x4c7b45>0x0){_0x1f86c4+=_0x280316;_0x3b2976['push'](dbH['sequelize'][_0x8430('0x30')](util[_0x8430('0x1c')](_0x8430('0x33'),QUERY,_0x4c7b45,_0x1f86c4),{'type':dbH[_0x8430('0x2f')]['QueryTypes'][_0x8430('0x32')]}));}}}else{_0x3b2976[_0x8430('0x18')](dbH[_0x8430('0x2f')]['query'](QUERY,{'type':dbH[_0x8430('0x2f')][_0x8430('0x31')][_0x8430('0x32')]}));}var _0x5f4ae4=path[_0x8430('0x34')](PATH);var _0x29ffaf=path[_0x8430('0x35')](PATH,_0x8430('0x36'));var _0x123566=_0x398427[_0x8430('0x2a')]&&_0x3b2976['length']>0x1;var _0x31fb85=[];if(!fs['existsSync'](path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf))&&_0x123566){fs[_0x8430('0x38')](path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf));}return BPromise['each'](_0x3b2976,function(_0x392b6c){_0x31fb85[_0x8430('0x18')](_0x392b6c);})[_0x8430('0x2c')](function(){var _0x22de28=[];for(var _0x13308d=0x0;_0x13308d<_0x31fb85[_0x8430('0x17')];_0x13308d+=0x1){var _0x9d0d3d=_0x31fb85[_0x13308d];var _0x34eef2=createTables(_[_0x8430('0x39')](_0x9d0d3d));var _0x2aa54c;var _0x4cf4bf=getPDFDocDefinition(_0x34eef2);var _0xdb9387=getPDFPrinter();var _0x125533=_0xdb9387[_0x8430('0x3a')](_0x4cf4bf);if(_0x123566){_0x2aa54c=path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf,util['format'](_0x8430('0x3b'),_0x29ffaf,_0x13308d,_0x8430('0x3c')));}else{_0x2aa54c=path['join'](_0x5f4ae4,util[_0x8430('0x1c')]('%s.%s',_0x29ffaf,_0x8430('0x3c')));}_0x22de28[_0x8430('0x18')](writePDFDocument(_0x125533,_0x2aa54c));}return Promise[_0x8430('0x3d')](_0x22de28);})[_0x8430('0x2c')](function(){if(_0x123566){return new Promise(function(_0x58cd66){zipdir(path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf),{'saveTo':path[_0x8430('0x37')](_0x5f4ae4,util[_0x8430('0x1c')](_0x8430('0x3e'),_0x29ffaf,_0x8430('0x3f')))},function(){rimraf(path[_0x8430('0x37')](_0x5f4ae4,_0x29ffaf),function(){});_0x58cd66(_0x8430('0x40'));});});}})[_0x8430('0x2c')](function(){if(!_0x123566)return;rimraf(path['join'](_0x5f4ae4,_0x29ffaf),function(){});})[_0x8430('0x2c')](function(){logger[_0x8430('0x41')](util[_0x8430('0x1c')](_0x8430('0x42'),EXTRACTED_REPORT_ID,_0x8430('0x43')));return analyticExtractedReport(_0x8430('0x44'),_0x123566?util[_0x8430('0x1c')](_0x8430('0x3e'),_0x29ffaf,_0x123566?_0x8430('0x3f'):_0x8430('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x8430('0x1c')](_0x8430('0x45'),EXTRACTED_REPORT_ID,_0x8430('0x43')));return db[_0x8430('0x10')][_0x8430('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x116b4e){EXTRACTED_REPORT=_0x116b4e;return dbH[_0x8430('0x2f')][_0x8430('0x30')](util['format'](_0x8430('0x47'),QUERY),{'type':dbH[_0x8430('0x2f')][_0x8430('0x31')][_0x8430('0x32')]});})['then'](extractReport)[_0x8430('0x48')](function(_0x593f76){logger[_0x8430('0x41')](util[_0x8430('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8430('0x43')),util['inspect'](_0x593f76,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8430('0x49'));})[_0x8430('0x4a')](function(){process[_0x8430('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x19f401=new PdfPrinter({'Arial':{'normal':__dirname+_0x8430('0x4c'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x8430('0x4d'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x19f401;}function getPDFDocDefinitionFromHTML(_0x249d19,_0x2c1ac7){var _0x9fd6a=util[_0x8430('0x1c')]('%s\x20#%d',_0x2c1ac7['channel'],_0x2c1ac7[_0x8430('0x4e')]);var _0x37dd3d=moment()[_0x8430('0x1c')](_0x8430('0x4f'))[_0x8430('0x15')]();var _0x41bafb=htmlToPdfmake(_0x249d19,{'window':window,'tableAutoSize':!![]});return{'content':[_0x41bafb],'defaultStyle':{'font':_0x8430('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8430('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x8430('0x50')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x8430('0x21')}];},'footer':function(_0x5d1265,_0x1a047d){return[{'text':util[_0x8430('0x1c')](_0x8430('0x51'),_0x9fd6a,_0x5d1265,_0x1a047d,_0x37dd3d),'style':_0x8430('0x25')}];}};}function writePDFDocument(_0x2186eb,_0x5d822f){return new Promise(function(_0x3a113d,_0x253dce){var _0x5e848d=_0x2186eb['pipe'](fs['createWriteStream'](_0x5d822f));_0x5e848d['on'](_0x8430('0x52'),function(){_0x3a113d(_0x8430('0x52'));});_0x5e848d['on'](_0x8430('0x53'),function(_0x8755b6){_0x253dce(_0x8755b6);});_0x2186eb[_0x8430('0x54')]();});}exports['createPdfFromHTML']=function(_0x4b7be6,_0x42c8e7){var _0x1acced=getPDFPrinter();var _0x5dafe0=getPDFDocDefinitionFromHTML(_0x4b7be6,_0x42c8e7);var _0x2951cb=_0x1acced[_0x8430('0x3a')](_0x5dafe0);return writePDFDocument(_0x2951cb,_0x42c8e7[_0x8430('0x2')])[_0x8430('0x48')](function(_0x2a99a7){throw _0x2a99a7;});}; \ No newline at end of file +var _0x9f33=['startDate','endDate','format','header','pageBreak','before','landscape','toString','\x20/\x20','footer','Arial','black','num','Empty','find','split','splitSizePdf','then','range','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','sequelize','QueryTypes','dirname','basename','.pdf','existsSync','join','%s%d.%s','pdf','all','%s.%s','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','html-to-pdfmake','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','tableHeader','map','value','fill','length','auto','body','concat','chunk','keys','forEach','push','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name'];(function(_0x6f37c4,_0x2e8330){var _0x1d1b5d=function(_0x3535e4){while(--_0x3535e4){_0x6f37c4['push'](_0x6f37c4['shift']());}};_0x1d1b5d(++_0x2e8330);}(_0x9f33,0x147));var _0x39f3=function(_0x47964d,_0x3ba889){_0x47964d=_0x47964d-0x0;var _0x4b2d70=_0x9f33[_0x47964d];return _0x4b2d70;};'use strict';var _=require(_0x39f3('0x0'));var fs=require('fs');var util=require(_0x39f3('0x1'));var path=require(_0x39f3('0x2'));var moment=require(_0x39f3('0x3'));var htmlToPdfmake=require(_0x39f3('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x39f3('0x5'));var JSDOM=require(_0x39f3('0x6'))[_0x39f3('0x7')];var window=new JSDOM('')[_0x39f3('0x8')];var BPromise=require('bluebird');var db=require(_0x39f3('0x9'))['db'];var dbH=require('../../mysqldb')[_0x39f3('0xa')];var logger=require('../../config/logger')(_0x39f3('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0x39f3('0xc')][0x2]);var QUERY=process[_0x39f3('0xc')][0x3];var PATH=process[_0x39f3('0xc')][0x4];var NAME=process[_0x39f3('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x260408,_0x54efb6){var _0xf716d7={'status':_0x260408};var _0x365fe3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54efb6){_0xf716d7[_0x39f3('0xd')]=_0x54efb6;}return db[_0x39f3('0xe')]['update'](_0xf716d7,_0x365fe3);}function getHeaders(_0x17f3a1){return _['map'](_0x17f3a1,function(_0x2ce36c){return{'text':_0x2ce36c,'style':_0x39f3('0xf')};});}function getRows(_0x29b34e,_0x1437e6){return _[_0x39f3('0x10')](_0x1437e6,function(_0x5ce77a){return _(_0x5ce77a)['pick'](_0x29b34e)['map'](function(_0x2f68af){return _0x2f68af?_['toString'](_0x2f68af):'';})[_0x39f3('0x11')]();});}function createTable(_0x4799ec,_0x10940d){var _0x1f1308={'widths':_[_0x39f3('0x12')](Array(_0x4799ec[_0x39f3('0x13')]),0x91),'heights':function(_0x3470e9){return _0x3470e9===0x0?_0x39f3('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x174165=getHeaders(_0x4799ec);_0x1f1308['body']['push'](_0x174165);var _0x5b9459=getRows(_0x4799ec,_0x10940d);_0x1f1308[_0x39f3('0x15')]=_0x1f1308[_0x39f3('0x15')][_0x39f3('0x16')](_0x5b9459);return _0x1f1308;}function createTables(_0x5c523d){var _0x27d2ec=[];var _0x2b24d1=_[_0x39f3('0x17')](Object[_0x39f3('0x18')](_0x5c523d[0x0]),0x5);_0x2b24d1[_0x39f3('0x19')](function(_0x237b41){_0x27d2ec[_0x39f3('0x1a')](createTable(_0x237b41,_0x5c523d));});return _0x27d2ec;}function getPDFDocDefinition(_0x821ebb){var _0xc87ba5=util['format'](_0x39f3('0x1b'),NAME,EXTRACTED_REPORT[_0x39f3('0x1c')],moment(EXTRACTED_REPORT[_0x39f3('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x39f3('0x1e')])[_0x39f3('0x1f')](FORMAT));var _0x8a5610=[];for(var _0xa6b507=0x0;_0xa6b507<_0x821ebb['length'];_0xa6b507++){var _0x525184=[];if(_0xa6b507===0x0){_0x525184[_0x39f3('0x1a')]({'text':_0xc87ba5,'style':_0x39f3('0x20')});}var _0x11ce36={'table':_0x821ebb[_0xa6b507]};if(_0xa6b507>0x0){_0x11ce36[_0x39f3('0x21')]=_0x39f3('0x22');_0x11ce36['margin']=[0x0,0x46,0x0,0x0];}_0x525184[_0x39f3('0x1a')](_0x11ce36);_0x8a5610[_0x39f3('0x1a')](_0x525184);}return{'pageSize':'A4','pageOrientation':_0x39f3('0x23'),'content':_0x8a5610,'footer':function(_0x392cf2,_0x403e8e){return{'text':_0x392cf2[_0x39f3('0x24')]()+_0x39f3('0x25')+_0x403e8e,'style':_0x39f3('0x26')};},'defaultStyle':{'font':_0x39f3('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x39f3('0x28')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ec5e3){var _0x42c80b=0x1388;var _0x2d3359;if(!_0x2ec5e3[0x0][_0x39f3('0x29')]){return analyticExtractedReport(_0x39f3('0x2a'));}return db['Setting'][_0x39f3('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x39f3('0x2c'),_0x39f3('0x2d')]})[_0x39f3('0x2e')](function(_0x58e968){if(_0x58e968){_0x2d3359=_0x58e968;_0x42c80b=_0x2d3359[_0x39f3('0x2d')]||0x3e8;}})[_0x39f3('0x2e')](function(){var _0x9e8862=[];var _0x4164ad=0x0;if(_0x2d3359[_0x39f3('0x2c')]){if(_0x2ec5e3&&_0x2ec5e3[_0x39f3('0x13')]){var _0xb20966=_[_0x39f3('0x2f')](_0x2ec5e3[0x0][_0x39f3('0x29')]/_0x42c80b);var _0x467711=Number['isInteger'](_0x2ec5e3[0x0][_0x39f3('0x29')]/_0x42c80b)?_0x2ec5e3[0x0][_0x39f3('0x29')]%_0x42c80b:0x0;_0xb20966['forEach'](function(_0x3abb16){if(_0x3abb16>0x0){_0x4164ad+=_0x42c80b;}_0x9e8862[_0x39f3('0x1a')](dbH['sequelize'][_0x39f3('0x30')](util[_0x39f3('0x1f')](_0x39f3('0x31'),QUERY,_0x42c80b,_0x4164ad),{'type':dbH['sequelize']['QueryTypes'][_0x39f3('0x32')]}));});if(_0x467711>0x0){_0x4164ad+=_0x42c80b;_0x9e8862[_0x39f3('0x1a')](dbH[_0x39f3('0x33')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x467711,_0x4164ad),{'type':dbH[_0x39f3('0x33')][_0x39f3('0x34')][_0x39f3('0x32')]}));}}}else{_0x9e8862[_0x39f3('0x1a')](dbH[_0x39f3('0x33')][_0x39f3('0x30')](QUERY,{'type':dbH[_0x39f3('0x33')][_0x39f3('0x34')][_0x39f3('0x32')]}));}var _0x181aa4=path[_0x39f3('0x35')](PATH);var _0x12227b=path[_0x39f3('0x36')](PATH,_0x39f3('0x37'));var _0x8d0792=_0x2d3359[_0x39f3('0x2c')]&&_0x9e8862[_0x39f3('0x13')]>0x1;var _0x1e1cc3=[];if(!fs[_0x39f3('0x38')](path[_0x39f3('0x39')](_0x181aa4,_0x12227b))&&_0x8d0792){fs['mkdirSync'](path[_0x39f3('0x39')](_0x181aa4,_0x12227b));}return BPromise['each'](_0x9e8862,function(_0x3e29c7){_0x1e1cc3[_0x39f3('0x1a')](_0x3e29c7);})[_0x39f3('0x2e')](function(){var _0x123eac=[];for(var _0x12a05a=0x0;_0x12a05a<_0x1e1cc3['length'];_0x12a05a+=0x1){var _0x54f722=_0x1e1cc3[_0x12a05a];var _0x118022=createTables(_['flatten'](_0x54f722));var _0x562b62;var _0x9dde9f=getPDFDocDefinition(_0x118022);var _0x26f9eb=getPDFPrinter();var _0x47f3cd=_0x26f9eb['createPdfKitDocument'](_0x9dde9f);if(_0x8d0792){_0x562b62=path[_0x39f3('0x39')](_0x181aa4,_0x12227b,util[_0x39f3('0x1f')](_0x39f3('0x3a'),_0x12227b,_0x12a05a,_0x39f3('0x3b')));}else{_0x562b62=path[_0x39f3('0x39')](_0x181aa4,util[_0x39f3('0x1f')]('%s.%s',_0x12227b,_0x39f3('0x3b')));}_0x123eac[_0x39f3('0x1a')](writePDFDocument(_0x47f3cd,_0x562b62));}return Promise[_0x39f3('0x3c')](_0x123eac);})[_0x39f3('0x2e')](function(){if(_0x8d0792){return new Promise(function(_0x6d481a){zipdir(path[_0x39f3('0x39')](_0x181aa4,_0x12227b),{'saveTo':path[_0x39f3('0x39')](_0x181aa4,util[_0x39f3('0x1f')](_0x39f3('0x3d'),_0x12227b,_0x39f3('0x3e')))},function(){rimraf(path[_0x39f3('0x39')](_0x181aa4,_0x12227b),function(){});_0x6d481a(_0x39f3('0x3f'));});});}})[_0x39f3('0x2e')](function(){if(!_0x8d0792)return;rimraf(path[_0x39f3('0x39')](_0x181aa4,_0x12227b),function(){});})[_0x39f3('0x2e')](function(){logger[_0x39f3('0x40')](util[_0x39f3('0x1f')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x39f3('0x41')));return analyticExtractedReport(_0x39f3('0x42'),_0x8d0792?util[_0x39f3('0x1f')]('%s.%s',_0x12227b,_0x8d0792?'zip':_0x39f3('0x3b')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x39f3('0x40')](util[_0x39f3('0x1f')](_0x39f3('0x43'),EXTRACTED_REPORT_ID,_0x39f3('0x41')));return db[_0x39f3('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xa0ad63){EXTRACTED_REPORT=_0xa0ad63;return dbH['sequelize'][_0x39f3('0x30')](util[_0x39f3('0x1f')](_0x39f3('0x44'),QUERY),{'type':dbH[_0x39f3('0x33')][_0x39f3('0x34')]['SELECT']});})['then'](extractReport)[_0x39f3('0x45')](function(_0x7d5b72){logger['info'](util[_0x39f3('0x1f')](_0x39f3('0x46'),EXTRACTED_REPORT_ID,_0x39f3('0x41')),util[_0x39f3('0x47')](_0x7d5b72,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x39f3('0x48'));})[_0x39f3('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2479dc=new PdfPrinter({'Arial':{'normal':__dirname+_0x39f3('0x4a'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x39f3('0x4b'),'bolditalics':__dirname+_0x39f3('0x4c')}});return _0x2479dc;}function getPDFDocDefinitionFromHTML(_0xd5301b,_0x1542b3){var _0xec6d5e=util['format'](_0x39f3('0x4d'),_0x1542b3['channel'],_0x1542b3['interactionId']);var _0x1be188=moment()[_0x39f3('0x1f')](_0x39f3('0x4e'))['toString']();var _0x5a6321=htmlToPdfmake(_0xd5301b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5a6321],'defaultStyle':{'font':_0x39f3('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x39f3('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x39f3('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x39f3('0x4f')}},'header':function(){return[{'text':_0x39f3('0x50'),'style':_0x39f3('0x20')}];},'footer':function(_0x31b993,_0x5f0c51){return[{'text':util[_0x39f3('0x1f')](_0x39f3('0x51'),_0xec6d5e,_0x31b993,_0x5f0c51,_0x1be188),'style':_0x39f3('0x26')}];}};}function writePDFDocument(_0x5a485f,_0x305f97){return new Promise(function(_0x8d862f,_0x38a11a){var _0x2e4174=_0x5a485f[_0x39f3('0x52')](fs[_0x39f3('0x53')](_0x305f97));_0x2e4174['on'](_0x39f3('0x54'),function(){_0x8d862f(_0x39f3('0x54'));});_0x2e4174['on'](_0x39f3('0x55'),function(_0xd04458){_0x38a11a(_0xd04458);});_0x5a485f[_0x39f3('0x56')]();});}exports[_0x39f3('0x57')]=function(_0x495d8c,_0x37684c){var _0x3cf4f3=getPDFPrinter();var _0x2aa8fd=getPDFDocDefinitionFromHTML(_0x495d8c,_0x37684c);var _0x92cb7c=_0x3cf4f3[_0x39f3('0x58')](_0x2aa8fd);return writePDFDocument(_0x92cb7c,_0x37684c['path'])['catch'](function(_0x5a51dc){throw _0x5a51dc;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 8c9bbf2..4a749a6 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 _0xf485=['%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','length','existsSync','join','each','%s%d.%s','xlsx','%s.%s','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','XLSX','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','forEach','push','sequelize','query'];(function(_0x4e591,_0xa82efc){var _0x28d148=function(_0x400af9){while(--_0x400af9){_0x4e591['push'](_0x4e591['shift']());}};_0x28d148(++_0xa82efc);}(_0xf485,0xd1));var _0x5f48=function(_0xa9134c,_0x6e1e0a){_0xa9134c=_0xa9134c-0x0;var _0x3e168b=_0xf485[_0xa9134c];return _0x3e168b;};'use strict';var util=require(_0x5f48('0x0'));var path=require(_0x5f48('0x1'));var _=require(_0x5f48('0x2'));var fs=require('fs');var json2xls=require(_0x5f48('0x3'));var BPromise=require(_0x5f48('0x4'));var zipdir=require(_0x5f48('0x5'));var rimraf=require('rimraf');var db=require(_0x5f48('0x6'))['db'];var dbH=require(_0x5f48('0x6'))['dbH'];var logger=require(_0x5f48('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5f48('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x5f48('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x126cb7,_0x3c6f45){var _0x5866e5={'status':_0x126cb7};var _0x3fb7e5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3c6f45){_0x5866e5[_0x5f48('0x9')]=_0x3c6f45;}return db[_0x5f48('0xa')]['update'](_0x5866e5,_0x3fb7e5);}function main(){var _0x24aead=0x1388;var _0x2b51a2;logger[_0x5f48('0xb')](util[_0x5f48('0xc')](_0x5f48('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x5f48('0xe')][_0x5f48('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5f48('0x10'),_0x5f48('0x11')]})[_0x5f48('0x12')](function(_0x32681b){if(_0x32681b){_0x2b51a2=_0x32681b;_0x24aead=_0x2b51a2[_0x5f48('0x11')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x5f48('0xc')](_0x5f48('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x5f48('0x14')]});})['then'](function(_0x2c7bdf){if(!_0x2c7bdf[0x0]['num']){return analyticExtractedReport('Empty');}var _0x561b8e=[];var _0x576fc5=0x0;if(_0x2b51a2[_0x5f48('0x10')]){if(_0x2c7bdf&&_0x2c7bdf['length']){var _0x24ce1b=_['range'](_0x2c7bdf[0x0][_0x5f48('0x15')]/_0x24aead);var _0x24beb3=Number['isInteger'](_0x2c7bdf[0x0][_0x5f48('0x15')]/_0x24aead)?_0x2c7bdf[0x0][_0x5f48('0x15')]%_0x24aead:0x0;_0x24ce1b[_0x5f48('0x16')](function(_0x5763af){if(_0x5763af>0x0){_0x576fc5+=_0x24aead;}_0x561b8e[_0x5f48('0x17')](dbH[_0x5f48('0x18')][_0x5f48('0x19')](util[_0x5f48('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24aead,_0x576fc5),{'type':dbH[_0x5f48('0x18')]['QueryTypes'][_0x5f48('0x14')]}));});if(_0x24beb3>0x0){_0x576fc5+=_0x24aead;_0x561b8e[_0x5f48('0x17')](dbH[_0x5f48('0x18')]['query'](util[_0x5f48('0xc')](_0x5f48('0x1a'),QUERY,_0x24beb3,_0x576fc5),{'type':dbH['sequelize']['QueryTypes'][_0x5f48('0x14')]}));}}}else{_0x561b8e[_0x5f48('0x17')](dbH[_0x5f48('0x18')][_0x5f48('0x19')](QUERY,{'type':dbH['sequelize'][_0x5f48('0x1b')][_0x5f48('0x14')]}));}var _0x53cb99=path[_0x5f48('0x1c')](PATH);var _0x384dcd=path[_0x5f48('0x1d')](PATH,_0x5f48('0x1e'));var _0x2dd1ec=_0x2b51a2['split']&&_0x561b8e[_0x5f48('0x1f')]>0x1;var _0x26e782=[];if(!fs[_0x5f48('0x20')](path['join'](_0x53cb99,_0x384dcd))&&_0x2dd1ec){fs['mkdirSync'](path[_0x5f48('0x21')](_0x53cb99,_0x384dcd));}return BPromise[_0x5f48('0x22')](_0x561b8e,function(_0x1132fb){_0x26e782[_0x5f48('0x17')](_0x1132fb);})[_0x5f48('0x12')](function(){for(var _0x54981b=0x0;_0x54981b<_0x26e782[_0x5f48('0x1f')];_0x54981b+=0x1){var _0x348f3d;var _0x2f4a73=_0x26e782[_0x54981b];if(_0x2dd1ec){_0x348f3d=path[_0x5f48('0x21')](_0x53cb99,_0x384dcd,util[_0x5f48('0xc')](_0x5f48('0x23'),_0x384dcd,_0x54981b,_0x5f48('0x24')));}else{_0x348f3d=path[_0x5f48('0x21')](_0x53cb99,util[_0x5f48('0xc')](_0x5f48('0x25'),_0x384dcd,_0x5f48('0x24')));}fs['writeFileSync'](_0x348f3d,json2xls(_0x2f4a73),'binary');}})[_0x5f48('0x12')](function(){if(_0x2dd1ec){return new Promise(function(_0x17f6a5){zipdir(path[_0x5f48('0x21')](_0x53cb99,_0x384dcd),{'saveTo':path[_0x5f48('0x21')](_0x53cb99,util[_0x5f48('0xc')](_0x5f48('0x25'),_0x384dcd,'zip'))},function(_0x2b5cd6,_0x44b284){rimraf(path[_0x5f48('0x21')](_0x53cb99,_0x384dcd),function(){});_0x17f6a5('zip\x20finished');});});}})[_0x5f48('0x12')](function(){logger[_0x5f48('0xb')](util[_0x5f48('0xc')](_0x5f48('0x26'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x5f48('0x27'),_0x2dd1ec?util[_0x5f48('0xc')](_0x5f48('0x25'),_0x384dcd,_0x2dd1ec?'zip':_0x5f48('0x24')):null);});})[_0x5f48('0x28')](function(_0x33c41b){logger[_0x5f48('0xb')](util[_0x5f48('0xc')](_0x5f48('0x29'),EXTRACTED_REPORT_ID,_0x5f48('0x2a')),util[_0x5f48('0x2b')](_0x33c41b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5f48('0x2c'));})[_0x5f48('0x2d')](function(){process[_0x5f48('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x3e2a=['lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','query','format','sequelize','num','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','length','join','each','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','path'];(function(_0xd368f1,_0xaefc28){var _0x2f27c1=function(_0x1c2d60){while(--_0x1c2d60){_0xd368f1['push'](_0xd368f1['shift']());}};_0x2f27c1(++_0xaefc28);}(_0x3e2a,0x10c));var _0xa3e2=function(_0x131fa2,_0x2e48d2){_0x131fa2=_0x131fa2-0x0;var _0x28a429=_0x3e2a[_0x131fa2];return _0x28a429;};'use strict';var util=require(_0xa3e2('0x0'));var path=require(_0xa3e2('0x1'));var _=require(_0xa3e2('0x2'));var fs=require('fs');var json2xls=require(_0xa3e2('0x3'));var BPromise=require(_0xa3e2('0x4'));var zipdir=require(_0xa3e2('0x5'));var rimraf=require(_0xa3e2('0x6'));var db=require(_0xa3e2('0x7'))['db'];var dbH=require(_0xa3e2('0x7'))['dbH'];var logger=require(_0xa3e2('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa3e2('0x9')][0x2]);var QUERY=process[_0xa3e2('0x9')][0x3];var PATH=process[_0xa3e2('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xb5d12b,_0x1ef5bd){var _0x51fc2d={'status':_0xb5d12b};var _0xb676f7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ef5bd){_0x51fc2d[_0xa3e2('0xa')]=_0x1ef5bd;}return db['AnalyticExtractedReport'][_0xa3e2('0xb')](_0x51fc2d,_0xb676f7);}function main(){var _0x3482d3=0x1388;var _0x522cdb;logger['info'](util['format'](_0xa3e2('0xc'),EXTRACTED_REPORT_ID,_0xa3e2('0xd')));return db[_0xa3e2('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa3e2('0xf'),_0xa3e2('0x10')]})[_0xa3e2('0x11')](function(_0x48627f){if(_0x48627f){_0x522cdb=_0x48627f;_0x3482d3=_0x522cdb[_0xa3e2('0x10')]||0x1388;}})[_0xa3e2('0x11')](function(){return dbH['sequelize'][_0xa3e2('0x12')](util[_0xa3e2('0x13')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa3e2('0x14')]['QueryTypes']['SELECT']});})[_0xa3e2('0x11')](function(_0x27e259){if(!_0x27e259[0x0][_0xa3e2('0x15')]){return analyticExtractedReport('Empty');}var _0x2dd399=[];var _0x596293=0x0;if(_0x522cdb[_0xa3e2('0xf')]){if(_0x27e259&&_0x27e259['length']){var _0x152de3=_[_0xa3e2('0x16')](_0x27e259[0x0][_0xa3e2('0x15')]/_0x3482d3);var _0x2486c1=Number[_0xa3e2('0x17')](_0x27e259[0x0][_0xa3e2('0x15')]/_0x3482d3)?_0x27e259[0x0]['num']%_0x3482d3:0x0;_0x152de3[_0xa3e2('0x18')](function(_0xd6151a){if(_0xd6151a>0x0){_0x596293+=_0x3482d3;}_0x2dd399[_0xa3e2('0x19')](dbH[_0xa3e2('0x14')][_0xa3e2('0x12')](util[_0xa3e2('0x13')](_0xa3e2('0x1a'),QUERY,_0x3482d3,_0x596293),{'type':dbH[_0xa3e2('0x14')][_0xa3e2('0x1b')]['SELECT']}));});if(_0x2486c1>0x0){_0x596293+=_0x3482d3;_0x2dd399[_0xa3e2('0x19')](dbH['sequelize'][_0xa3e2('0x12')](util[_0xa3e2('0x13')](_0xa3e2('0x1a'),QUERY,_0x2486c1,_0x596293),{'type':dbH['sequelize'][_0xa3e2('0x1b')][_0xa3e2('0x1c')]}));}}}else{_0x2dd399['push'](dbH[_0xa3e2('0x14')][_0xa3e2('0x12')](QUERY,{'type':dbH[_0xa3e2('0x14')]['QueryTypes']['SELECT']}));}var _0x4f07fe=path[_0xa3e2('0x1d')](PATH);var _0x32c1e7=path[_0xa3e2('0x1e')](PATH,'.xlsx');var _0x4e9854=_0x522cdb[_0xa3e2('0xf')]&&_0x2dd399[_0xa3e2('0x1f')]>0x1;var _0xd5af7b=[];if(!fs['existsSync'](path['join'](_0x4f07fe,_0x32c1e7))&&_0x4e9854){fs['mkdirSync'](path[_0xa3e2('0x20')](_0x4f07fe,_0x32c1e7));}return BPromise[_0xa3e2('0x21')](_0x2dd399,function(_0x2bfa82){_0xd5af7b[_0xa3e2('0x19')](_0x2bfa82);})[_0xa3e2('0x11')](function(){for(var _0x217d0b=0x0;_0x217d0b<_0xd5af7b[_0xa3e2('0x1f')];_0x217d0b+=0x1){var _0x2d6d88;var _0x1535a8=_0xd5af7b[_0x217d0b];if(_0x4e9854){_0x2d6d88=path[_0xa3e2('0x20')](_0x4f07fe,_0x32c1e7,util[_0xa3e2('0x13')]('%s%d.%s',_0x32c1e7,_0x217d0b,_0xa3e2('0x22')));}else{_0x2d6d88=path['join'](_0x4f07fe,util[_0xa3e2('0x13')](_0xa3e2('0x23'),_0x32c1e7,'xlsx'));}fs[_0xa3e2('0x24')](_0x2d6d88,json2xls(_0x1535a8),_0xa3e2('0x25'));}})['then'](function(){if(_0x4e9854){return new Promise(function(_0x23efe9){zipdir(path[_0xa3e2('0x20')](_0x4f07fe,_0x32c1e7),{'saveTo':path[_0xa3e2('0x20')](_0x4f07fe,util[_0xa3e2('0x13')](_0xa3e2('0x23'),_0x32c1e7,_0xa3e2('0x26')))},function(_0x43cacb,_0x1d4266){rimraf(path['join'](_0x4f07fe,_0x32c1e7),function(){});_0x23efe9(_0xa3e2('0x27'));});});}})[_0xa3e2('0x11')](function(){logger[_0xa3e2('0x28')](util[_0xa3e2('0x13')](_0xa3e2('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport('Completed',_0x4e9854?util[_0xa3e2('0x13')](_0xa3e2('0x23'),_0x32c1e7,_0x4e9854?_0xa3e2('0x26'):'xlsx'):null);});})[_0xa3e2('0x2a')](function(_0x17e287){logger[_0xa3e2('0x28')](util['format'](_0xa3e2('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x17e287,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa3e2('0x2c'));})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 24a4681..f859213 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 _0xc9cf=['push','Set','format','CDR(type)=%s','type','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','CDR(destination)=','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','cutdigits','CDR(prefix)=noprefix','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','intervals','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','sortBy','catch','lodash','util','findAll','then','models','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension'];(function(_0x55db7e,_0x33cb14){var _0x4744f9=function(_0x565137){while(--_0x565137){_0x55db7e['push'](_0x55db7e['shift']());}};_0x4744f9(++_0x33cb14);}(_0xc9cf,0x106));var _0xfc9c=function(_0x4a8072,_0x435bab){_0x4a8072=_0x4a8072-0x0;var _0x11a4fe=_0xc9cf[_0x4a8072];return _0x11a4fe;};'use strict';var _=require(_0xfc9c('0x0'));var util=require(_0xfc9c('0x1'));function rewrite(_0x170715,_0x459efb){var _0x45a166=this;return _0x170715['models']['Interval'][_0xfc9c('0x2')]({'raw':!![]})[_0xfc9c('0x3')](function(_0x510b63){_0x45a166['intervals']=_0x510b63;return _0x170715[_0xfc9c('0x4')][_0xfc9c('0x5')][_0xfc9c('0x2')]({'where':{'IntervalId':_0x459efb[_0xfc9c('0x6')]},'raw':!![]});})['then'](function(_0x271634){return _0x170715[_0xfc9c('0x4')]['VoiceExtension'][_0xfc9c('0x2')]({'where':{'exten':{'$in':_[_0xfc9c('0x7')](_[_0xfc9c('0x8')](_0x271634,_0xfc9c('0x9')))}},'order':[{'raw':_0xfc9c('0xa')}],'raw':!![]});})['then'](function(_0x58557b){var _0x72fb61=_[_0xfc9c('0xb')](_0x58557b,{'priority':'1'});var _0x3da82c=_[_0xfc9c('0xb')](_0x58557b,{'isApp':0x1});var _0x4c15a8=_[_0xfc9c('0xc')](_0x3da82c,_0xfc9c('0x9'));var _0x1b581e=[_0xfc9c('0xd'),_0xfc9c('0xe')];var _0x3b03cd=[];var _0x1682b3=[];for(var _0x5198f2 in _0x4c15a8){if(_0x4c15a8[_0xfc9c('0xf')](_0x5198f2)){_0x45a166['priority']=0x2;_0x45a166[_0xfc9c('0x10')]=[];_0x45a166[_0xfc9c('0x11')]=_['find'](_0x72fb61,{'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')]});_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':_0xfc9c('0x13'),'appdata':util[_0xfc9c('0x14')](_0xfc9c('0x15'),_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')]),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});if(_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')]===_0xfc9c('0x1a')){_0x45a166['extensions']['push']({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x1b')+_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')],'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}else if(_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')]==='outbound'){if(_0x45a166['extension']){_0x45a166['extensions'][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x1c')+(_0x45a166[_0xfc9c('0x11')]['cutdigits']?_0xfc9c('0x1d')+_0x45a166[_0xfc9c('0x11')]['cutdigits']+'}':'${EXTEN}'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x1b')+_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')],'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});var _0x3b1d86=_0x45a166[_0xfc9c('0x18')]++;_0x45a166['extensions'][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':_0xfc9c('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3b1d86+0x2)+_0xfc9c('0x1f')+(_0x3b1d86+0x1)+')','context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x3b1d86,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});if(_0x45a166[_0xfc9c('0x11')]){_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':_0xfc9c('0x13'),'appdata':_0x45a166[_0xfc9c('0x11')]['cutdigits']?_0xfc9c('0x20')+_0x45a166[_0xfc9c('0x11')][_0xfc9c('0x21')]+'}':_0xfc9c('0x22'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0]['exten'],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0]['VoiceExtensionId']});}_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':'Set','appdata':'outboundrouteid='+_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')],'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0]['VoiceExtensionId']});if(_0x45a166[_0xfc9c('0x11')]&&_0x45a166[_0xfc9c('0x11')][_0xfc9c('0xf')]('recordingFormat')&&_0x45a166[_0xfc9c('0x11')][_0xfc9c('0x23')]!==_0xfc9c('0x24')){_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4c15a8[_0x5198f2][0x0]['context'],'exten':_0x4c15a8[_0x5198f2][0x0]['exten'],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0]['VoiceExtensionId']});_0x45a166[_0xfc9c('0x10')]['push']({'type':_0x4c15a8[_0x5198f2][0x0]['type'],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x45a166[_0xfc9c('0x11')]['recordingFormat']||_0xfc9c('0x25'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}}_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':'Set','appdata':_0xfc9c('0x26'),'context':_0x4c15a8[_0x5198f2][0x0]['context'],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166['priority']++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});_0x45a166[_0xfc9c('0x10')]['push']({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':'Set','appdata':_0xfc9c('0x27'),'context':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x17')],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});_0x45a166[_0xfc9c('0x10')][_0xfc9c('0x12')]({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x28'),'context':_0x4c15a8[_0x5198f2][0x0]['context'],'exten':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x9')],'priority':_0x45a166[_0xfc9c('0x18')]++,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});for(var _0x45a3af=0x0,_0x15e8b6=0x0;_0x45a3af<_0x4c15a8[_0x5198f2][_0xfc9c('0x29')];_0x45a3af+=0x1,_0x15e8b6=0x0){var _0x413597=_0x4c15a8[_0x5198f2][_0x45a3af];if(_0x413597[_0xfc9c('0x16')]){_0x413597[_0xfc9c('0x16')]=_0x413597['type'][_0xfc9c('0x2a')]();}var _0x5bdc3b=[];var _0x21734d=[];delete _0x413597['id'];delete _0x413597[_0xfc9c('0x2b')];delete _0x413597[_0xfc9c('0x2c')];var _0x54cee6=_0x413597['interval']!==_0xfc9c('0x2d')?[_0x413597[_0xfc9c('0x2e')]]:_0x413597[_0xfc9c('0x6')]?_[_0xfc9c('0x8')](_['filter'](_0x45a166[_0xfc9c('0x2f')],{'IntervalId':_0x413597[_0xfc9c('0x6')]}),'interval'):[];if(_0x413597['hasOwnProperty'](_0xfc9c('0x30'))){if(_0x413597[_0xfc9c('0x30')]&&_0x413597['tag']!=='--'){_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x31')+_0x413597[_0xfc9c('0x30')],'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597['exten'],'priority':_0x54cee6['length']+_0x45a166['priority']+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}}if(_0x413597[_0xfc9c('0x16')]==='outbound'&&_0x413597['hasOwnProperty']('callerID')){if(_0x413597['callerID']){_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597['type'],'app':'ExecIf','appdata':_0xfc9c('0x32')+_0x413597[_0xfc9c('0x33')]+')','context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6['length']+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}else{_0x5bdc3b['push']({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x1e'),'appdata':_0xfc9c('0x34'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6['length']+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597['VoiceExtensionId']});}}if(_0x413597['hasOwnProperty'](_0xfc9c('0x35'))){if(_0x1b581e['indexOf'](_0x413597['app']['toLowerCase']())>=0x0&&_0x413597[_0xfc9c('0x36')]!==_0xfc9c('0x37')){if(_0x413597[_0xfc9c('0x35')]){_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597['type'],'app':'ExecIf','appdata':_0xfc9c('0x38'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6[_0xfc9c('0x29')]+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x13'),'appdata':_0xfc9c('0x39'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597['exten'],'priority':_0x54cee6['length']+_0x45a166['priority']+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}else{_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x1e'),'appdata':_0xfc9c('0x3a'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597['exten'],'priority':_0x54cee6[_0xfc9c('0x29')]+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});_0x5bdc3b[_0xfc9c('0x12')]({'type':_0x413597[_0xfc9c('0x16')],'app':'Set','appdata':_0xfc9c('0x3b'),'context':_0x413597[_0xfc9c('0x17')],'exten':_0x413597[_0xfc9c('0x9')],'priority':_0x54cee6[_0xfc9c('0x29')]+_0x45a166[_0xfc9c('0x18')]+_0x15e8b6++,'VoiceExtensionId':_0x413597[_0xfc9c('0x19')]});}}}for(var _0x18e410=0x0;_0x18e410<_0x54cee6[_0xfc9c('0x29')];_0x18e410+=0x1){var _0x453c95=_0x45a166['priority']+_0x54cee6[_0xfc9c('0x29')];var _0x39af90=_0x18e410===_0x54cee6['length']-0x1?_0x45a166['priority']+_0x5bdc3b['length']+_0x21734d['length']+0x2:_0x45a166[_0xfc9c('0x18')]+_0x18e410+0x1;_0x5bdc3b[_0xfc9c('0x3c')](_0x18e410,0x0,{'type':_0x413597[_0xfc9c('0x16')],'app':_0xfc9c('0x3d'),'appdata':_0x54cee6[_0x18e410]+'?'+_0x413597[_0xfc9c('0x17')]+_0xfc9c('0x3e')+_0x453c95+':'+_0x413597[_0xfc9c('0x17')]+_0xfc9c('0x3e')+_0x39af90,'exten':_0x413597['exten'],'context':_0x413597[_0xfc9c('0x17')],'priority':_0x45a166[_0xfc9c('0x18')]+_0x18e410,'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});}_0x413597[_0xfc9c('0x18')]=_0x5bdc3b[_0xfc9c('0x29')]?_['last'](_0x5bdc3b)['priority']+0x1:_0x45a166[_0xfc9c('0x18')];_0x45a166[_0xfc9c('0x18')]=(_0x21734d[_0xfc9c('0x29')]?_[_0xfc9c('0x3f')](_0x21734d)[_0xfc9c('0x18')]:_0x413597['priority'])+0x1;_0x45a166[_0xfc9c('0x10')]=_[_0xfc9c('0x40')](_0x45a166[_0xfc9c('0x10')],_0x5bdc3b,[_0x413597],_0x21734d);}_0x45a166[_0xfc9c('0x10')]['push']({'type':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x16')],'app':_0xfc9c('0x41'),'exten':_0x4c15a8[_0x5198f2][0x0]['exten'],'context':_0x4c15a8[_0x5198f2][0x0]['context'],'priority':_0x45a166['priority'],'VoiceExtensionId':_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]});_0x3b03cd[_0xfc9c('0x12')](_0x4c15a8[_0x5198f2][0x0][_0xfc9c('0x19')]);_0x1682b3=_[_0xfc9c('0x40')](_0x1682b3,_0x45a166[_0xfc9c('0x10')]);}}return _0x170715['transaction'](function(_0x4973d6){return _0x170715[_0xfc9c('0x4')][_0xfc9c('0x5')][_0xfc9c('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x3b03cd}},'transaction':_0x4973d6})[_0xfc9c('0x3')](function(_0x45d28e){return _0x170715[_0xfc9c('0x4')][_0xfc9c('0x5')][_0xfc9c('0x43')](_[_0xfc9c('0x44')](_0x1682b3,_0xfc9c('0x18')),{'transaction':_0x4973d6});});});})[_0xfc9c('0x45')](function(_0x1375e4){console['error'](_0x1375e4);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x056f=['recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','context','VoiceExtensionId','type','CDR(routeid)=','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid='];(function(_0x3c4f40,_0x302e0b){var _0x12032f=function(_0x159d92){while(--_0x159d92){_0x3c4f40['push'](_0x3c4f40['shift']());}};_0x12032f(++_0x302e0b);}(_0x056f,0x198));var _0xf056=function(_0x47570e,_0x3d39ca){_0x47570e=_0x47570e-0x0;var _0x3d1c66=_0x056f[_0x47570e];return _0x3d1c66;};'use strict';var _=require(_0xf056('0x0'));var util=require(_0xf056('0x1'));function rewrite(_0xee00cf,_0x21c6ab){var _0x86300c=this;return _0xee00cf[_0xf056('0x2')][_0xf056('0x3')][_0xf056('0x4')]({'raw':!![]})[_0xf056('0x5')](function(_0xb13d0d){_0x86300c[_0xf056('0x6')]=_0xb13d0d;return _0xee00cf['models'][_0xf056('0x7')][_0xf056('0x4')]({'where':{'IntervalId':_0x21c6ab['IntervalId']},'raw':!![]});})[_0xf056('0x5')](function(_0x59ead8){return _0xee00cf[_0xf056('0x2')][_0xf056('0x7')][_0xf056('0x4')]({'where':{'exten':{'$in':_[_0xf056('0x8')](_[_0xf056('0x9')](_0x59ead8,_0xf056('0xa')))}},'order':[{'raw':_0xf056('0xb')}],'raw':!![]});})[_0xf056('0x5')](function(_0x146d28){var _0x55ec14=_[_0xf056('0xc')](_0x146d28,{'priority':'1'});var _0x19b8d5=_[_0xf056('0xc')](_0x146d28,{'isApp':0x1});var _0x18aa0f=_[_0xf056('0xd')](_0x19b8d5,_0xf056('0xa'));var _0x505a28=[_0xf056('0xe'),_0xf056('0xf')];var _0x4d1ed6=[];var _0x49b08a=[];for(var _0x565b43 in _0x18aa0f){if(_0x18aa0f[_0xf056('0x10')](_0x565b43)){_0x86300c[_0xf056('0x11')]=0x2;_0x86300c[_0xf056('0x12')]=[];_0x86300c[_0xf056('0x13')]=_[_0xf056('0x14')](_0x55ec14,{'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')]});_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0]['type'],'app':_0xf056('0x16'),'appdata':util[_0xf056('0x17')]('CDR(type)=%s',_0x18aa0f[_0x565b43][0x0]['type']),'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});if(_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')]==='inbound'){_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x1b')+_0x18aa0f[_0x565b43][0x0]['VoiceExtensionId'],'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});}else if(_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')]===_0xf056('0x1c')){if(_0x86300c['extension']){_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0]['type'],'app':_0xf056('0x16'),'appdata':'CDR(destination)='+(_0x86300c['extension'][_0xf056('0x1d')]?_0xf056('0x1e')+_0x86300c[_0xf056('0x13')][_0xf056('0x1d')]+'}':_0xf056('0x1f')),'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0]['VoiceExtensionId']});}_0x86300c[_0xf056('0x12')]['push']({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x1b')+_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')],'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'priority':_0x86300c['priority']++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0]['VoiceExtensionId']});var _0x13049e=_0x86300c[_0xf056('0x11')]++;_0x86300c['extensions'][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x13049e+0x2)+_0xf056('0x21')+(_0x13049e+0x1)+')','context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'priority':_0x13049e,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});if(_0x86300c[_0xf056('0x13')]){_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':'Set','appdata':_0x86300c[_0xf056('0x13')][_0xf056('0x1d')]?_0xf056('0x22')+_0x86300c[_0xf056('0x13')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0]['exten'],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});}_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x23')+_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')],'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0]['exten'],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});if(_0x86300c[_0xf056('0x13')]&&_0x86300c[_0xf056('0x13')][_0xf056('0x10')](_0xf056('0x24'))&&_0x86300c[_0xf056('0x13')][_0xf056('0x24')]!==_0xf056('0x25')){_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x26'),'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x27')+_0x86300c['extension'][_0xf056('0x24')]||_0xf056('0x28'),'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0]['exten'],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});}}_0x86300c['extensions']['push']({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x29'),'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0]['exten'],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});_0x86300c[_0xf056('0x12')]['push']({'type':_0x18aa0f[_0x565b43][0x0]['type'],'app':_0xf056('0x16'),'appdata':_0xf056('0x2a'),'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x2b'),'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'exten':_0x18aa0f[_0x565b43][0x0]['exten'],'priority':_0x86300c[_0xf056('0x11')]++,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0]['VoiceExtensionId']});for(var _0x1a5fdd=0x0,_0xf3c5b8=0x0;_0x1a5fdd<_0x18aa0f[_0x565b43]['length'];_0x1a5fdd+=0x1,_0xf3c5b8=0x0){var _0x150383=_0x18aa0f[_0x565b43][_0x1a5fdd];if(_0x150383['type']){_0x150383[_0xf056('0x1a')]=_0x150383[_0xf056('0x1a')][_0xf056('0x2c')]();}var _0x2b1c61=[];var _0x16e806=[];delete _0x150383['id'];delete _0x150383['createdAt'];delete _0x150383[_0xf056('0x2d')];var _0x34899e=_0x150383[_0xf056('0x2e')]!==_0xf056('0x2f')?[_0x150383[_0xf056('0x2e')]]:_0x150383[_0xf056('0x30')]?_[_0xf056('0x9')](_[_0xf056('0xc')](_0x86300c[_0xf056('0x6')],{'IntervalId':_0x150383['IntervalId']}),_0xf056('0x2e')):[];if(_0x150383['hasOwnProperty']('tag')){if(_0x150383[_0xf056('0x31')]&&_0x150383['tag']!=='--'){_0x2b1c61[_0xf056('0x15')]({'type':_0x150383[_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':_0xf056('0x32')+_0x150383['tag'],'context':_0x150383[_0xf056('0x18')],'exten':_0x150383[_0xf056('0xa')],'priority':_0x34899e[_0xf056('0x33')]+_0x86300c[_0xf056('0x11')]+_0xf3c5b8++,'VoiceExtensionId':_0x150383[_0xf056('0x19')]});}}if(_0x150383[_0xf056('0x1a')]===_0xf056('0x1c')&&_0x150383[_0xf056('0x10')]('callerID')){if(_0x150383['callerID']){_0x2b1c61[_0xf056('0x15')]({'type':_0x150383[_0xf056('0x1a')],'app':'ExecIf','appdata':_0xf056('0x34')+_0x150383[_0xf056('0x35')]+')','context':_0x150383['context'],'exten':_0x150383[_0xf056('0xa')],'priority':_0x34899e[_0xf056('0x33')]+_0x86300c[_0xf056('0x11')]+_0xf3c5b8++,'VoiceExtensionId':_0x150383['VoiceExtensionId']});}else{_0x2b1c61[_0xf056('0x15')]({'type':_0x150383['type'],'app':_0xf056('0x20'),'appdata':_0xf056('0x36'),'context':_0x150383['context'],'exten':_0x150383['exten'],'priority':_0x34899e['length']+_0x86300c[_0xf056('0x11')]+_0xf3c5b8++,'VoiceExtensionId':_0x150383[_0xf056('0x19')]});}}if(_0x150383[_0xf056('0x10')](_0xf056('0x37'))){if(_0x505a28[_0xf056('0x38')](_0x150383[_0xf056('0x39')][_0xf056('0x2c')]())>=0x0&&_0x150383[_0xf056('0x3a')]!=='custom'){if(_0x150383[_0xf056('0x37')]){_0x2b1c61[_0xf056('0x15')]({'type':_0x150383[_0xf056('0x1a')],'app':_0xf056('0x20'),'appdata':_0xf056('0x3b'),'context':_0x150383['context'],'exten':_0x150383[_0xf056('0xa')],'priority':_0x34899e[_0xf056('0x33')]+_0x86300c['priority']+_0xf3c5b8++,'VoiceExtensionId':_0x150383[_0xf056('0x19')]});_0x2b1c61[_0xf056('0x15')]({'type':_0x150383['type'],'app':_0xf056('0x16'),'appdata':_0xf056('0x3c'),'context':_0x150383[_0xf056('0x18')],'exten':_0x150383[_0xf056('0xa')],'priority':_0x34899e[_0xf056('0x33')]+_0x86300c[_0xf056('0x11')]+_0xf3c5b8++,'VoiceExtensionId':_0x150383[_0xf056('0x19')]});}else{_0x2b1c61[_0xf056('0x15')]({'type':_0x150383[_0xf056('0x1a')],'app':_0xf056('0x20'),'appdata':_0xf056('0x3d'),'context':_0x150383[_0xf056('0x18')],'exten':_0x150383[_0xf056('0xa')],'priority':_0x34899e['length']+_0x86300c[_0xf056('0x11')]+_0xf3c5b8++,'VoiceExtensionId':_0x150383[_0xf056('0x19')]});_0x2b1c61['push']({'type':_0x150383[_0xf056('0x1a')],'app':_0xf056('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x150383[_0xf056('0x18')],'exten':_0x150383['exten'],'priority':_0x34899e['length']+_0x86300c[_0xf056('0x11')]+_0xf3c5b8++,'VoiceExtensionId':_0x150383['VoiceExtensionId']});}}}for(var _0x19f604=0x0;_0x19f604<_0x34899e[_0xf056('0x33')];_0x19f604+=0x1){var _0x1f9c5e=_0x86300c[_0xf056('0x11')]+_0x34899e[_0xf056('0x33')];var _0x508f59=_0x19f604===_0x34899e[_0xf056('0x33')]-0x1?_0x86300c[_0xf056('0x11')]+_0x2b1c61[_0xf056('0x33')]+_0x16e806[_0xf056('0x33')]+0x2:_0x86300c['priority']+_0x19f604+0x1;_0x2b1c61[_0xf056('0x3e')](_0x19f604,0x0,{'type':_0x150383[_0xf056('0x1a')],'app':_0xf056('0x3f'),'appdata':_0x34899e[_0x19f604]+'?'+_0x150383[_0xf056('0x18')]+_0xf056('0x40')+_0x1f9c5e+':'+_0x150383[_0xf056('0x18')]+',${EXTEN},'+_0x508f59,'exten':_0x150383['exten'],'context':_0x150383[_0xf056('0x18')],'priority':_0x86300c['priority']+_0x19f604,'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]});}_0x150383[_0xf056('0x11')]=_0x2b1c61[_0xf056('0x33')]?_[_0xf056('0x41')](_0x2b1c61)[_0xf056('0x11')]+0x1:_0x86300c[_0xf056('0x11')];_0x86300c[_0xf056('0x11')]=(_0x16e806[_0xf056('0x33')]?_['last'](_0x16e806)[_0xf056('0x11')]:_0x150383[_0xf056('0x11')])+0x1;_0x86300c[_0xf056('0x12')]=_['concat'](_0x86300c[_0xf056('0x12')],_0x2b1c61,[_0x150383],_0x16e806);}_0x86300c[_0xf056('0x12')][_0xf056('0x15')]({'type':_0x18aa0f[_0x565b43][0x0][_0xf056('0x1a')],'app':'Hangup','exten':_0x18aa0f[_0x565b43][0x0][_0xf056('0xa')],'context':_0x18aa0f[_0x565b43][0x0][_0xf056('0x18')],'priority':_0x86300c[_0xf056('0x11')],'VoiceExtensionId':_0x18aa0f[_0x565b43][0x0]['VoiceExtensionId']});_0x4d1ed6[_0xf056('0x15')](_0x18aa0f[_0x565b43][0x0][_0xf056('0x19')]);_0x49b08a=_[_0xf056('0x42')](_0x49b08a,_0x86300c[_0xf056('0x12')]);}}return _0xee00cf[_0xf056('0x43')](function(_0xc6fcc3){return _0xee00cf[_0xf056('0x2')][_0xf056('0x7')][_0xf056('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x4d1ed6}},'transaction':_0xc6fcc3})['then'](function(_0x2df146){return _0xee00cf[_0xf056('0x2')][_0xf056('0x7')][_0xf056('0x45')](_[_0xf056('0x46')](_0x49b08a,'priority'),{'transaction':_0xc6fcc3});});});})[_0xf056('0x47')](function(_0x5f2b67){console[_0xf056('0x48')](_0x5f2b67);});}exports[_0xf056('0x49')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c9215e6..c147b94 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 _0xa07a=['calleridnum','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','get','dialCheckDuplicateType','always','sequelize','VoiceQueueId','query','all','BlackLists','Campaign','Lists','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','papaparse','../../../mysqldb','../../../config/environment','redis','defaults','localhost','socket.io-emitter','argv','Missing\x20filepath\x20parameter!','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','find','Duplicate\x20Contact','CmContact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','insert','into','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','str'];(function(_0x4028d3,_0x1c7484){var _0x30337e=function(_0x161214){while(--_0x161214){_0x4028d3['push'](_0x4028d3['shift']());}};_0x30337e(++_0x1c7484);}(_0xa07a,0x103));var _0xaa07=function(_0x558734,_0xf91751){_0x558734=_0x558734-0x0;var _0x3d7732=_0xa07a[_0x558734];return _0x3d7732;};'use strict';var BPromise=require(_0xaa07('0x0'));var util=require(_0xaa07('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xaa07('0x2'));var Redis=require('ioredis');var db=require(_0xaa07('0x3'))['db'];var config=require(_0xaa07('0x4'));var logger=require('../../../config/logger')('api');config[_0xaa07('0x5')]=_[_0xaa07('0x6')](config[_0xaa07('0x5')],{'host':_0xaa07('0x7'),'port':0x18eb});var socket=require(_0xaa07('0x8'))(new Redis(config[_0xaa07('0x5')]));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xaa07('0x9')][0x2]||process['argv'][0x2]==='undefined'||process[_0xaa07('0x9')][0x2]==='null'){throw new Error(_0xaa07('0xa'));}var FILEPATH=process['argv'][0x2];if(!process[_0xaa07('0x9')][0x3]||process['argv'][0x3]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x3]===_0xaa07('0xc')||!process[_0xaa07('0x9')][0x4]||process[_0xaa07('0x9')][0x4]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x4]===_0xaa07('0xc')){throw new Error(_0xaa07('0xd'));}var FIELDS=_[_0xaa07('0xe')](process[_0xaa07('0x9')][0x3]['split'](','),process[_0xaa07('0x9')][0x4][_0xaa07('0xf')](','));if(!process[_0xaa07('0x9')][0x5]||process[_0xaa07('0x9')][0x5]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x5]==='null'){throw new Error(_0xaa07('0x10'));}var LISTID=process[_0xaa07('0x9')][0x5];var COMPANYID=process[_0xaa07('0x9')][0x6]&&process[_0xaa07('0x9')][0x6]!==_0xaa07('0xb')&&process[_0xaa07('0x9')][0x6]!==_0xaa07('0xc')?process[_0xaa07('0x9')][0x6]:null;var DUPLICATES=process[_0xaa07('0x9')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0xaa07('0x9')][0x7]!==_0xaa07('0xc')?process['argv'][0x7]:null;if(!process[_0xaa07('0x9')][0x8]||process[_0xaa07('0x9')][0x8]===_0xaa07('0xb')||process[_0xaa07('0x9')][0x8]===_0xaa07('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xaa07('0x9')][0x8];}catch(_0x56b976){logger['error'](_0x56b976);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(_0x3efc2b,_0x276395,_0x359e74,_0x3eefd4){var _0x4f9614={'message':_0x276395};_0x4f9614[_0x3efc2b]=!![];if(_0x359e74){_0x4f9614[_0xaa07('0x11')]=_0x359e74;}if(_0x3eefd4){_0x4f9614[_0xaa07('0x12')]=_0x3eefd4;}return _0x4f9614;}function isEmail(_0x599633){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))*$/[_0xaa07('0x13')](_0x599633);}function checkRow(_0x48138f,_0x3d8081,_0xe9e724){return new BPromise(function(_0x542ac8,_0x4f67fb){if(_[_0xaa07('0x14')](_0x48138f)){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x16'),null,_0xe9e724));}if(_0x48138f['errors']&&_0x48138f[_0xaa07('0x17')][_0xaa07('0x18')]){var _0x21a271=_[_0xaa07('0x19')](_0x48138f[_0xaa07('0x17')],_0xaa07('0x1a'))[_0xaa07('0x1b')](';');return _0x4f67fb(handleCheckRowError('error',_0x21a271,null,_0xe9e724));}var _0x44ec2a={};for(var _0x261421 in FIELDS){if(FIELDS[_0xaa07('0x1c')](_0x261421)&&FIELDS[_0x261421]){_0x44ec2a[_0x261421]=_0x48138f[_0xaa07('0x1d')][0x0][FIELDS[_0x261421]]||_0x48138f[_0xaa07('0x1d')][0x0]['\ufeff'+FIELDS[_0x261421]];}}if(!_0x44ec2a['firstName']){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x1e'),null,_0xe9e724));}if(!_0x44ec2a[_0xaa07('0x1f')]){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x20'),null,_0xe9e724));}if(_0x44ec2a[_0xaa07('0x21')]){var _0x27c63a=moment(_0x44ec2a[_0xaa07('0x21')],'YYYY-MM-DD');if(!_0x27c63a[_0xaa07('0x22')]()){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x23'),null,_0xe9e724));}}if(_0x44ec2a['email']){if(!isEmail(_0x44ec2a['email'])){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x24'),null,_0xe9e724));}}_0x44ec2a['ListId']=LISTID;_0x44ec2a['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xaa07('0x18')]&&_0x3d8081){var _0x41f357={};for(var _0x1c6c45=0x0,_0x599b75=DUPLICATES[_0xaa07('0x18')];_0x1c6c45<_0x599b75;_0x1c6c45+=0x1){_0x41f357[DUPLICATES[_0x1c6c45]]=_0x44ec2a[DUPLICATES[_0x1c6c45]];}var _0x1d8b84=_[_0xaa07('0x25')](_0x3d8081,_0x41f357);if(_0x1d8b84){return _0x4f67fb(handleCheckRowError('duplicate',_0xaa07('0x26'),_0x1d8b84,_0xe9e724));}}return db[_0xaa07('0x27')]['create'](_0x44ec2a,{'raw':!![],'hooks':![],'fields':_[_0xaa07('0x28')](_0x44ec2a)})[_0xaa07('0x29')](function(_0x5bd3df){if(DUPLICATES&&DUPLICATES[_0xaa07('0x18')]&&_0x3d8081){_0x3d8081[_0xaa07('0x2a')](_[_0xaa07('0x2b')](_0x44ec2a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5bd3df['id'];return _0x542ac8();})[_0xaa07('0x2c')](function(_0x1367c3){return _0x4f67fb(handleCheckRowError(_0xaa07('0x15'),_0xaa07('0x2d')+(_0x1367c3[_0xaa07('0x1a')]||JSON[_0xaa07('0x2e')](_0x1367c3)),null,_0xe9e724));});});}function checkHopper(){function _0x2fc500(){return function(_0x4de720){logger[_0xaa07('0x15')]('cmContact',_0xaa07('0x2f'),util['inspect'](_0x4de720,{'showHidden':![],'depth':null}));};}var _0x503c21=function(_0x560c56,_0x487954){var _0x453b92=squel[_0xaa07('0x30')]()[_0xaa07('0x31')]('cm_hopper')[_0xaa07('0x32')]([_0xaa07('0x1f'),_0xaa07('0x33'),_0xaa07('0x34'),_0xaa07('0x35'),_0x487954,'createdAt',_0xaa07('0x36')],squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x1f'),_0xaa07('0x1f'))[_0xaa07('0x38')](_0xaa07('0x39'),_0xaa07('0x33'))['field']('id','ContactId')[_0xaa07('0x38')](LISTID['toString'](),_0xaa07('0x35'))[_0xaa07('0x38')](_0x560c56['id'][_0xaa07('0x3a')](),_0x487954)[_0xaa07('0x38')]('NOW()',_0xaa07('0x3b'))[_0xaa07('0x38')](_0xaa07('0x39'),'updatedAt')[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))[_0xaa07('0x3e')](_0xaa07('0x40'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xaa07('0x41'),squel[_0xaa07('0x37')]()['field'](_0xaa07('0x1f'))[_0xaa07('0x3c')](_0xaa07('0x42'))[_0xaa07('0x3e')](_0x487954+'\x20=\x20?',_0x560c56['id']['toString']())))[_0xaa07('0x3a')]();return _0x453b92;};var _0x413ea8=function(_0x161004,_0x341a76){var _0x11e35d=squel[_0xaa07('0x30')]()['into'](_0xaa07('0x42'))['fromQuery'](['phone',_0xaa07('0x33'),_0xaa07('0x34'),_0xaa07('0x35'),_0x341a76,_0xaa07('0x3b'),_0xaa07('0x36')],squel[_0xaa07('0x37')]()['field'](_0xaa07('0x1f'),'phone')[_0xaa07('0x38')](_0xaa07('0x39'),_0xaa07('0x33'))[_0xaa07('0x38')]('id','ContactId')[_0xaa07('0x38')](LISTID[_0xaa07('0x3a')](),'ListId')[_0xaa07('0x38')](_0x161004['id'][_0xaa07('0x3a')](),_0x341a76)['field'](_0xaa07('0x39'),_0xaa07('0x3b'))[_0xaa07('0x38')]('NOW()',_0xaa07('0x36'))[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))['where'](_0xaa07('0x40'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xaa07('0x43')](hopperContacts))[_0xaa07('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xaa07('0x3e')](_0xaa07('0x41'),squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x44'))[_0xaa07('0x3c')](_0xaa07('0x45'))['where'](_0x341a76+_0xaa07('0x46'),_0x161004['id'][_0xaa07('0x3a')]()))['where'](_0xaa07('0x41'),squel['select']()[_0xaa07('0x38')]('phone')[_0xaa07('0x3c')](_0xaa07('0x42'))['where'](_0x341a76+'\x20=\x20?',_0x161004['id']['toString']())))[_0xaa07('0x3a')]();return _0x11e35d;};function _0x101a1f(_0x27918b,_0x43af75){var _0x15e98a=squel[_0xaa07('0x30')]()[_0xaa07('0x31')](_0xaa07('0x42'))[_0xaa07('0x32')]([_0xaa07('0x1f'),'scheduledAt',_0xaa07('0x34'),_0xaa07('0x35'),_0x43af75,_0xaa07('0x3b'),_0xaa07('0x36')],squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x1f'),_0xaa07('0x1f'))['field'](_0xaa07('0x39'),_0xaa07('0x33'))[_0xaa07('0x38')]('id','ContactId')[_0xaa07('0x38')](LISTID['toString'](),_0xaa07('0x35'))[_0xaa07('0x38')](_0x27918b['id'][_0xaa07('0x3a')](),_0x43af75)[_0xaa07('0x38')](_0xaa07('0x39'),'createdAt')[_0xaa07('0x38')](_0xaa07('0x39'),_0xaa07('0x36'))[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))['where'](_0xaa07('0x40'),LISTID[_0xaa07('0x3a')]())[_0xaa07('0x3e')](_0xaa07('0x47'),squel[_0xaa07('0x43')](hopperContacts))['where'](_0xaa07('0x48')))[_0xaa07('0x3a')]();return _0x15e98a;}function _0x4dae6e(_0x250927,_0x3dc5c7){var _0x38eadb=squel[_0xaa07('0x30')]()[_0xaa07('0x31')](_0xaa07('0x49'))[_0xaa07('0x32')]([_0xaa07('0x1f'),'ContactId',_0xaa07('0x35'),_0x3dc5c7,_0xaa07('0x3b'),_0xaa07('0x36')],squel[_0xaa07('0x37')]()[_0xaa07('0x38')](_0xaa07('0x1f'),_0xaa07('0x1f'))[_0xaa07('0x38')]('id',_0xaa07('0x34'))[_0xaa07('0x38')](LISTID['toString'](),_0xaa07('0x35'))[_0xaa07('0x38')](_0x250927['id'][_0xaa07('0x3a')](),_0x3dc5c7)['field']('NOW()','createdAt')['field']('NOW()',_0xaa07('0x36'))[_0xaa07('0x3c')](_0xaa07('0x3d'))[_0xaa07('0x3e')](_0xaa07('0x3f'))[_0xaa07('0x3e')](_0xaa07('0x40'),LISTID[_0xaa07('0x3a')]())[_0xaa07('0x3e')](_0xaa07('0x47'),squel[_0xaa07('0x43')](hopperContacts))[_0xaa07('0x3e')](_0xaa07('0x48')))['toString']();return _0x38eadb;}return db[_0xaa07('0x4a')][_0xaa07('0x4b')]({'where':{'type':_0xaa07('0x4c')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xaa07('0x4d')],'as':'Lists','where':{'id':LISTID}}]})[_0xaa07('0x29')](function(_0xaaffb5){var _0x30439e=[];if(_0xaaffb5){var _0xee4124;for(var _0x33eb78=0x0,_0x19e602;_0x33eb78<_0xaaffb5[_0xaa07('0x18')];_0x33eb78+=0x1){_0x19e602=_0xaaffb5[_0x33eb78][_0xaa07('0x4e')]({'plain':!![]});switch(_0x19e602[_0xaa07('0x4f')]){case _0xaa07('0x50'):_0x30439e[_0xaa07('0x2a')](db[_0xaa07('0x51')]['query'](_0x413ea8(_0x19e602,_0xaa07('0x52')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));break;case'onlyIfOpen':_0x30439e[_0xaa07('0x2a')](db[_0xaa07('0x51')]['query'](_0x503c21(_0x19e602,'VoiceQueueId'))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));break;default:_0x30439e[_0xaa07('0x2a')](db['sequelize'][_0xaa07('0x53')](_0x101a1f(_0x19e602,'VoiceQueueId'))[_0xaa07('0x29')](function(){})['catch'](_0x2fc500()));}}}return _0x30439e;})[_0xaa07('0x54')]()['then'](function(){return db[_0xaa07('0x4a')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xaa07('0x4d')],'as':_0xaa07('0x55'),'where':{'id':LISTID}}]})[_0xaa07('0x29')](function(_0x99865b){var _0xb2c72c=[];if(_0x99865b){var _0x7482a1;for(var _0x286089=0x0,_0x572b72;_0x286089<_0x99865b[_0xaa07('0x18')];_0x286089+=0x1){_0x572b72=_0x99865b[_0x286089][_0xaa07('0x4e')]({'plain':!![]});_0xb2c72c[_0xaa07('0x2a')](db['sequelize'][_0xaa07('0x53')](_0x4dae6e(_0x572b72,_0xaa07('0x52')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));}}return _0xb2c72c;})[_0xaa07('0x54')]();})[_0xaa07('0x29')](function(){return db[_0xaa07('0x56')][_0xaa07('0x4b')]({'attributes':['id',_0xaa07('0x4f')],'include':[{'model':db['CmList'],'as':_0xaa07('0x57'),'where':{'id':LISTID}}]})[_0xaa07('0x29')](function(_0x5c2971){var _0x176640=[];if(_0x5c2971){for(var _0x41fba1=0x0,_0x32aaba;_0x41fba1<_0x5c2971[_0xaa07('0x18')];_0x41fba1+=0x1){_0x32aaba=_0x5c2971[_0x41fba1][_0xaa07('0x4e')]({'plain':!![]});switch(_0x32aaba[_0xaa07('0x4f')]){case _0xaa07('0x50'):_0x176640[_0xaa07('0x2a')](db[_0xaa07('0x51')]['query'](_0x413ea8(_0x32aaba,_0xaa07('0x58')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));break;case _0xaa07('0x59'):_0x176640[_0xaa07('0x2a')](db[_0xaa07('0x51')][_0xaa07('0x53')](_0x503c21(_0x32aaba,_0xaa07('0x58')))['then'](function(){})['catch'](_0x2fc500()));break;default:_0x176640['push'](db['sequelize']['query'](_0x101a1f(_0x32aaba,_0xaa07('0x58')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));}}}return _0x176640;})[_0xaa07('0x54')]();})[_0xaa07('0x29')](function(){return db['Campaign'][_0xaa07('0x4b')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xaa07('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x260d01){var _0x4d6067=[];if(_0x260d01){for(var _0x609eeb=0x0,_0x18acf5;_0x609eeb<_0x260d01[_0xaa07('0x18')];_0x609eeb+=0x1){_0x18acf5=_0x260d01[_0x609eeb][_0xaa07('0x4e')]({'plain':!![]});_0x4d6067[_0xaa07('0x2a')](db['sequelize'][_0xaa07('0x53')](_0x4dae6e(_0x18acf5,_0xaa07('0x58')))[_0xaa07('0x29')](function(){})[_0xaa07('0x2c')](_0x2fc500()));}}return _0x4d6067;})[_0xaa07('0x54')]();})[_0xaa07('0x2c')](function(_0x2b2de4){logger[_0xaa07('0x15')](_0xaa07('0x5a'),_0xaa07('0x5b'),_0x2b2de4[_0xaa07('0x1a')]);});}var processPromises=function(_0x406849){return BPromise[_0xaa07('0x54')](promises)[_0xaa07('0x29')](function(_0x806ac7){})[_0xaa07('0x2c')](function(_0x1669cc){logger[_0xaa07('0x15')](_0xaa07('0x5c'),JSON[_0xaa07('0x2e')](_0x1669cc));})[_0xaa07('0x5d')](function(){socket[_0xaa07('0x5e')](_0xaa07('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x406849){return _0x406849[_0xaa07('0x60')]();}});};var endCsv=function(){return BPromise[_0xaa07('0x61')]()[_0xaa07('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0xaa07('0x29')](function(){socket[_0xaa07('0x5e')](_0xaa07('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xaa07('0x62')](FILEPATH);}catch(_0x357085){logger[_0xaa07('0x15')](_0xaa07('0x63'),JSON[_0xaa07('0x2e')](_0x357085));}finally{process[_0xaa07('0x64')](0x0);}});};process['on'](_0xaa07('0x65'),function(){logger[_0xaa07('0x66')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xaa07('0x61')]()[_0xaa07('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xaa07('0xf')](',');return db[_0xaa07('0x27')][_0xaa07('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xaa07('0x29')](function(_0x4ebf9f){var _0x25658d=fs[_0xaa07('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xaa07('0x68')](_0x25658d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x524659,_0x41c38a){total+=0x1;var _0x458cd9=total;promises[_0xaa07('0x2a')](checkRow(_0x524659,_0x4ebf9f,_0x458cd9)[_0xaa07('0x29')](function(){success+=0x1;})['catch'](function(_0xb47bcb){if(_0xb47bcb[_0xaa07('0x15')]){errors+=0x1;delete _0xb47bcb[_0xaa07('0x15')];}else if(_0xb47bcb[_0xaa07('0x69')]){duplicates+=0x1;delete _0xb47bcb[_0xaa07('0x69')];}rows[_0xaa07('0x2a')](_0xb47bcb);}));if(total%0xc8===0x0){_0x41c38a[_0xaa07('0x6a')]();return processPromises(_0x41c38a);}},'complete':function(){return processPromises()['then'](function(){logger[_0xaa07('0x66')](_0xaa07('0x6b'));endCsv();});},'error':function(_0x536bd6,_0x458be7){logger[_0xaa07('0x66')]('CSV\x20parse\x20error',JSON[_0xaa07('0x2e')](_0x536bd6));endCsv();}});})[_0xaa07('0x2c')](function(_0x385dae){logger[_0xaa07('0x15')](_0xaa07('0x6c'),JSON[_0xaa07('0x2e')](_0x385dae));});}main(); \ No newline at end of file +var _0x89b9=['../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','scheduledAt','ContactId','createdAt','select','field','toString','NOW()','updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','\x20=\x20?','ListId\x20=\x20?','str','calleridnum','cm_hopper_final','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','info','createReadStream','parse','duplicate','CSV\x20parse\x20error','bluebird','lodash','squel','papaparse','../../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89b9,0x1b3));var _0x989b=function(_0x22cbc6,_0x20269a){_0x22cbc6=_0x22cbc6-0x0;var _0xc13fd4=_0x89b9[_0x22cbc6];return _0xc13fd4;};'use strict';var BPromise=require(_0x989b('0x0'));var util=require('util');var _=require(_0x989b('0x1'));var fs=require('fs');var squel=require(_0x989b('0x2'));var Papa=require(_0x989b('0x3'));var Redis=require('ioredis');var db=require(_0x989b('0x4'))['db'];var config=require(_0x989b('0x5'));var logger=require(_0x989b('0x6'))(_0x989b('0x7'));config[_0x989b('0x8')]=_[_0x989b('0x9')](config[_0x989b('0x8')],{'host':_0x989b('0xa'),'port':0x18eb});var socket=require(_0x989b('0xb'))(new Redis(config[_0x989b('0x8')]));require(_0x989b('0xc'))[_0x989b('0xd')](socket);try{if(!process['argv'][0x2]||process[_0x989b('0xe')][0x2]==='undefined'||process[_0x989b('0xe')][0x2]===_0x989b('0xf')){throw new Error(_0x989b('0x10'));}var FILEPATH=process[_0x989b('0xe')][0x2];if(!process['argv'][0x3]||process[_0x989b('0xe')][0x3]==='undefined'||process[_0x989b('0xe')][0x3]===_0x989b('0xf')||!process['argv'][0x4]||process[_0x989b('0xe')][0x4]===_0x989b('0x11')||process[_0x989b('0xe')][0x4]===_0x989b('0xf')){throw new Error(_0x989b('0x12'));}var FIELDS=_[_0x989b('0x13')](process['argv'][0x3][_0x989b('0x14')](','),process['argv'][0x4][_0x989b('0x14')](','));if(!process[_0x989b('0xe')][0x5]||process['argv'][0x5]===_0x989b('0x11')||process[_0x989b('0xe')][0x5]===_0x989b('0xf')){throw new Error(_0x989b('0x15'));}var LISTID=process[_0x989b('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x989b('0xe')][0x6]!==_0x989b('0x11')&&process['argv'][0x6]!==_0x989b('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0x989b('0xe')][0x7]&&process[_0x989b('0xe')][0x7]!=='undefined'&&process[_0x989b('0xe')][0x7]!==_0x989b('0xf')?process['argv'][0x7]:null;if(!process[_0x989b('0xe')][0x8]||process[_0x989b('0xe')][0x8]===_0x989b('0x11')||process[_0x989b('0xe')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x4c35ed){logger[_0x989b('0x16')](_0x4c35ed);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(_0x37b4bd,_0x50ccc6,_0x2a3ed4,_0xe4e676){var _0x46e99a={'message':_0x50ccc6};_0x46e99a[_0x37b4bd]=!![];if(_0x2a3ed4){_0x46e99a[_0x989b('0x17')]=_0x2a3ed4;}if(_0xe4e676){_0x46e99a['index']=_0xe4e676;}return _0x46e99a;}function isEmail(_0x45f195){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))*$/[_0x989b('0x18')](_0x45f195);}function checkRow(_0x168d61,_0x1628e8,_0x20e0a5){return new BPromise(function(_0xb00dba,_0x3dc2c6){if(_[_0x989b('0x19')](_0x168d61)){return _0x3dc2c6(handleCheckRowError(_0x989b('0x16'),_0x989b('0x1a'),null,_0x20e0a5));}if(_0x168d61['errors']&&_0x168d61['errors'][_0x989b('0x1b')]){var _0x2b51d6=_[_0x989b('0x1c')](_0x168d61[_0x989b('0x1d')],_0x989b('0x1e'))[_0x989b('0x1f')](';');return _0x3dc2c6(handleCheckRowError('error',_0x2b51d6,null,_0x20e0a5));}var _0x30d66e={};for(var _0x4a468d in FIELDS){if(FIELDS[_0x989b('0x20')](_0x4a468d)&&FIELDS[_0x4a468d]){_0x30d66e[_0x4a468d]=_0x168d61[_0x989b('0x21')][0x0][FIELDS[_0x4a468d]]||_0x168d61['data'][0x0]['\ufeff'+FIELDS[_0x4a468d]];}}if(!_0x30d66e['firstName']){return _0x3dc2c6(handleCheckRowError(_0x989b('0x16'),_0x989b('0x22'),null,_0x20e0a5));}if(!_0x30d66e[_0x989b('0x23')]){return _0x3dc2c6(handleCheckRowError(_0x989b('0x16'),_0x989b('0x24'),null,_0x20e0a5));}if(_0x30d66e[_0x989b('0x25')]){var _0x3929eb=moment(_0x30d66e[_0x989b('0x25')],'YYYY-MM-DD');if(!_0x3929eb[_0x989b('0x26')]()){return _0x3dc2c6(handleCheckRowError(_0x989b('0x16'),_0x989b('0x27'),null,_0x20e0a5));}}if(_0x30d66e['email']){if(!isEmail(_0x30d66e[_0x989b('0x28')])){return _0x3dc2c6(handleCheckRowError(_0x989b('0x16'),_0x989b('0x29'),null,_0x20e0a5));}}_0x30d66e[_0x989b('0x2a')]=LISTID;_0x30d66e[_0x989b('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x1628e8){var _0x50eded={};for(var _0x5589da=0x0,_0xf0c8ae=DUPLICATES[_0x989b('0x1b')];_0x5589da<_0xf0c8ae;_0x5589da+=0x1){_0x50eded[DUPLICATES[_0x5589da]]=_0x30d66e[DUPLICATES[_0x5589da]];}var _0x18949e=_[_0x989b('0x2c')](_0x1628e8,_0x50eded);if(_0x18949e){return _0x3dc2c6(handleCheckRowError('duplicate',_0x989b('0x2d'),_0x18949e,_0x20e0a5));}}return db[_0x989b('0x2e')][_0x989b('0x2f')](_0x30d66e,{'raw':!![],'hooks':![],'fields':_[_0x989b('0x30')](_0x30d66e)})[_0x989b('0x31')](function(_0x57dc2){if(DUPLICATES&&DUPLICATES[_0x989b('0x1b')]&&_0x1628e8){_0x1628e8['push'](_[_0x989b('0x32')](_0x30d66e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x57dc2['id'];return _0xb00dba();})[_0x989b('0x33')](function(_0x564ce6){return _0x3dc2c6(handleCheckRowError(_0x989b('0x16'),_0x989b('0x34')+(_0x564ce6[_0x989b('0x1e')]||JSON[_0x989b('0x35')](_0x564ce6)),null,_0x20e0a5));});});}function checkHopper(){function _0xe7610e(){return function(_0x21102b){logger['error'](_0x989b('0x36'),_0x989b('0x37'),util[_0x989b('0x38')](_0x21102b,{'showHidden':![],'depth':null}));};}var _0x51b1ac=function(_0x458dd8,_0x414efa){var _0x5ad0b7=squel[_0x989b('0x39')]()[_0x989b('0x3a')]('cm_hopper')[_0x989b('0x3b')](['phone',_0x989b('0x3c'),_0x989b('0x3d'),_0x989b('0x2a'),_0x414efa,_0x989b('0x3e'),'updatedAt'],squel[_0x989b('0x3f')]()[_0x989b('0x40')](_0x989b('0x23'),_0x989b('0x23'))['field']('NOW()',_0x989b('0x3c'))['field']('id',_0x989b('0x3d'))[_0x989b('0x40')](LISTID[_0x989b('0x41')](),_0x989b('0x2a'))[_0x989b('0x40')](_0x458dd8['id']['toString'](),_0x414efa)[_0x989b('0x40')](_0x989b('0x42'),'createdAt')[_0x989b('0x40')]('NOW()',_0x989b('0x43'))['from'](_0x989b('0x44'))[_0x989b('0x45')](_0x989b('0x46'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x989b('0x45')](_0x989b('0x47'))[_0x989b('0x45')](_0x989b('0x48'),squel[_0x989b('0x3f')]()[_0x989b('0x40')](_0x989b('0x23'))[_0x989b('0x49')](_0x989b('0x4a'))[_0x989b('0x45')](_0x414efa+_0x989b('0x4b'),_0x458dd8['id']['toString']())))['toString']();return _0x5ad0b7;};var _0x52bd21=function(_0x4211a6,_0x5710d4){var _0x543aec=squel[_0x989b('0x39')]()[_0x989b('0x3a')]('cm_hopper')['fromQuery']([_0x989b('0x23'),'scheduledAt','ContactId',_0x989b('0x2a'),_0x5710d4,_0x989b('0x3e'),_0x989b('0x43')],squel['select']()[_0x989b('0x40')](_0x989b('0x23'),_0x989b('0x23'))[_0x989b('0x40')]('NOW()',_0x989b('0x3c'))[_0x989b('0x40')]('id',_0x989b('0x3d'))[_0x989b('0x40')](LISTID[_0x989b('0x41')](),_0x989b('0x2a'))[_0x989b('0x40')](_0x4211a6['id']['toString'](),_0x5710d4)[_0x989b('0x40')](_0x989b('0x42'),'createdAt')['field'](_0x989b('0x42'),'updatedAt')[_0x989b('0x49')](_0x989b('0x44'))[_0x989b('0x45')](_0x989b('0x46'))[_0x989b('0x45')](_0x989b('0x4c'),LISTID[_0x989b('0x41')]())[_0x989b('0x45')]('id\x20IN\x20?',squel[_0x989b('0x4d')](hopperContacts))[_0x989b('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x989b('0x45')](_0x989b('0x48'),squel['select']()[_0x989b('0x40')](_0x989b('0x4e'))[_0x989b('0x49')](_0x989b('0x4f'))[_0x989b('0x45')](_0x5710d4+_0x989b('0x4b'),_0x4211a6['id'][_0x989b('0x41')]()))[_0x989b('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x989b('0x3f')]()[_0x989b('0x40')](_0x989b('0x23'))[_0x989b('0x49')](_0x989b('0x4a'))[_0x989b('0x45')](_0x5710d4+_0x989b('0x4b'),_0x4211a6['id']['toString']())))['toString']();return _0x543aec;};function _0x1996e1(_0x583249,_0x3cb728){var _0x2e7557=squel[_0x989b('0x39')]()['into'](_0x989b('0x4a'))[_0x989b('0x3b')]([_0x989b('0x23'),_0x989b('0x3c'),'ContactId',_0x989b('0x2a'),_0x3cb728,'createdAt',_0x989b('0x43')],squel[_0x989b('0x3f')]()[_0x989b('0x40')](_0x989b('0x23'),'phone')[_0x989b('0x40')](_0x989b('0x42'),_0x989b('0x3c'))[_0x989b('0x40')]('id',_0x989b('0x3d'))[_0x989b('0x40')](LISTID[_0x989b('0x41')](),_0x989b('0x2a'))[_0x989b('0x40')](_0x583249['id'][_0x989b('0x41')](),_0x3cb728)[_0x989b('0x40')]('NOW()',_0x989b('0x3e'))[_0x989b('0x40')](_0x989b('0x42'),'updatedAt')[_0x989b('0x49')](_0x989b('0x44'))['where'](_0x989b('0x46'))[_0x989b('0x45')]('ListId\x20=\x20?',LISTID['toString']())[_0x989b('0x45')](_0x989b('0x50'),squel[_0x989b('0x4d')](hopperContacts))[_0x989b('0x45')](_0x989b('0x47')))[_0x989b('0x41')]();return _0x2e7557;}function _0x2bfcc4(_0x4bbb93,_0xa270cc){var _0x50bcc7=squel[_0x989b('0x39')]()[_0x989b('0x3a')]('cm_hopper_black')[_0x989b('0x3b')]([_0x989b('0x23'),'ContactId',_0x989b('0x2a'),_0xa270cc,'createdAt','updatedAt'],squel[_0x989b('0x3f')]()['field'](_0x989b('0x23'),'phone')[_0x989b('0x40')]('id',_0x989b('0x3d'))[_0x989b('0x40')](LISTID['toString'](),_0x989b('0x2a'))['field'](_0x4bbb93['id'][_0x989b('0x41')](),_0xa270cc)['field'](_0x989b('0x42'),_0x989b('0x3e'))[_0x989b('0x40')]('NOW()',_0x989b('0x43'))['from']('cm_contacts')[_0x989b('0x45')]('deletedAt\x20IS\x20NULL')[_0x989b('0x45')]('ListId\x20=\x20?',LISTID['toString']())[_0x989b('0x45')](_0x989b('0x50'),squel[_0x989b('0x4d')](hopperContacts))['where'](_0x989b('0x47')))['toString']();return _0x50bcc7;}return db[_0x989b('0x51')][_0x989b('0x52')]({'where':{'type':_0x989b('0x53')},'attributes':['id',_0x989b('0x54')],'include':[{'model':db[_0x989b('0x55')],'as':_0x989b('0x56'),'where':{'id':LISTID}}]})[_0x989b('0x31')](function(_0xee8777){var _0x5ee715=[];if(_0xee8777){var _0x52d076;for(var _0x19bde0=0x0,_0x2ea34c;_0x19bde0<_0xee8777[_0x989b('0x1b')];_0x19bde0+=0x1){_0x2ea34c=_0xee8777[_0x19bde0][_0x989b('0x57')]({'plain':!![]});switch(_0x2ea34c[_0x989b('0x54')]){case _0x989b('0x58'):_0x5ee715[_0x989b('0x59')](db[_0x989b('0x5a')][_0x989b('0x5b')](_0x52bd21(_0x2ea34c,_0x989b('0x5c')))[_0x989b('0x31')](function(){})[_0x989b('0x33')](_0xe7610e()));break;case _0x989b('0x5d'):_0x5ee715['push'](db[_0x989b('0x5a')]['query'](_0x51b1ac(_0x2ea34c,_0x989b('0x5c')))[_0x989b('0x31')](function(){})[_0x989b('0x33')](_0xe7610e()));break;default:_0x5ee715[_0x989b('0x59')](db[_0x989b('0x5a')][_0x989b('0x5b')](_0x1996e1(_0x2ea34c,_0x989b('0x5c')))[_0x989b('0x31')](function(){})['catch'](_0xe7610e()));}}}return _0x5ee715;})[_0x989b('0x5e')]()[_0x989b('0x31')](function(){return db[_0x989b('0x51')][_0x989b('0x52')]({'where':{'type':_0x989b('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x989b('0x5f'),'where':{'id':LISTID}}]})[_0x989b('0x31')](function(_0x2d9f99){var _0x2b24fb=[];if(_0x2d9f99){var _0x5e2a31;for(var _0x597014=0x0,_0x3dc6ae;_0x597014<_0x2d9f99[_0x989b('0x1b')];_0x597014+=0x1){_0x3dc6ae=_0x2d9f99[_0x597014]['get']({'plain':!![]});_0x2b24fb[_0x989b('0x59')](db['sequelize']['query'](_0x2bfcc4(_0x3dc6ae,_0x989b('0x5c')))[_0x989b('0x31')](function(){})['catch'](_0xe7610e()));}}return _0x2b24fb;})[_0x989b('0x5e')]();})[_0x989b('0x31')](function(){return db[_0x989b('0x60')][_0x989b('0x52')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x989b('0x55')],'as':_0x989b('0x56'),'where':{'id':LISTID}}]})[_0x989b('0x31')](function(_0x1ae532){var _0x3d7909=[];if(_0x1ae532){for(var _0x25eaba=0x0,_0x519370;_0x25eaba<_0x1ae532['length'];_0x25eaba+=0x1){_0x519370=_0x1ae532[_0x25eaba]['get']({'plain':!![]});switch(_0x519370[_0x989b('0x54')]){case _0x989b('0x58'):_0x3d7909['push'](db[_0x989b('0x5a')]['query'](_0x52bd21(_0x519370,_0x989b('0x61')))[_0x989b('0x31')](function(){})[_0x989b('0x33')](_0xe7610e()));break;case _0x989b('0x5d'):_0x3d7909['push'](db['sequelize'][_0x989b('0x5b')](_0x51b1ac(_0x519370,'CampaignId'))['then'](function(){})['catch'](_0xe7610e()));break;default:_0x3d7909[_0x989b('0x59')](db[_0x989b('0x5a')][_0x989b('0x5b')](_0x1996e1(_0x519370,_0x989b('0x61')))[_0x989b('0x31')](function(){})[_0x989b('0x33')](_0xe7610e()));}}}return _0x3d7909;})[_0x989b('0x5e')]();})['then'](function(){return db[_0x989b('0x60')][_0x989b('0x52')]({'attributes':['id'],'include':[{'model':db[_0x989b('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x989b('0x31')](function(_0x554ad8){var _0x2ddb6a=[];if(_0x554ad8){for(var _0x2c0dd5=0x0,_0x137a66;_0x2c0dd5<_0x554ad8['length'];_0x2c0dd5+=0x1){_0x137a66=_0x554ad8[_0x2c0dd5]['get']({'plain':!![]});_0x2ddb6a[_0x989b('0x59')](db[_0x989b('0x5a')][_0x989b('0x5b')](_0x2bfcc4(_0x137a66,_0x989b('0x61')))['then'](function(){})[_0x989b('0x33')](_0xe7610e()));}}return _0x2ddb6a;})[_0x989b('0x5e')]();})[_0x989b('0x33')](function(_0x1d1a18){logger['error'](_0x989b('0x62'),'generalCheckHopper',_0x1d1a18[_0x989b('0x1e')]);});}var processPromises=function(_0x57f809){return BPromise['all'](promises)[_0x989b('0x31')](function(_0x16ae2c){})[_0x989b('0x33')](function(_0x51a08a){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x989b('0x35')](_0x51a08a));})[_0x989b('0x63')](function(){socket[_0x989b('0x64')](_0x989b('0x65')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x57f809){return _0x57f809['resume']();}});};var endCsv=function(){return BPromise[_0x989b('0x66')]()[_0x989b('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x989b('0x31')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x44c0de){logger['error'](_0x989b('0x67'),JSON[_0x989b('0x35')](_0x44c0de));}finally{process[_0x989b('0x68')](0x0);}});};process['on']('SIGINT',function(){logger[_0x989b('0x69')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x989b('0x66')]()[_0x989b('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x989b('0x14')](',');return db[_0x989b('0x2e')][_0x989b('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x20696d){var _0x450bca=fs[_0x989b('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x989b('0x6b')](_0x450bca,{'header':!![],'skipEmptyLines':!![],'step':function(_0x558c0b,_0x4d1b74){total+=0x1;var _0x521b68=total;promises['push'](checkRow(_0x558c0b,_0x20696d,_0x521b68)[_0x989b('0x31')](function(){success+=0x1;})['catch'](function(_0x94b7ec){if(_0x94b7ec[_0x989b('0x16')]){errors+=0x1;delete _0x94b7ec[_0x989b('0x16')];}else if(_0x94b7ec['duplicate']){duplicates+=0x1;delete _0x94b7ec[_0x989b('0x6c')];}rows[_0x989b('0x59')](_0x94b7ec);}));if(total%0xc8===0x0){_0x4d1b74['pause']();return processPromises(_0x4d1b74);}},'complete':function(){return processPromises()[_0x989b('0x31')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x4693b6,_0x437782){logger[_0x989b('0x69')](_0x989b('0x6d'),JSON[_0x989b('0x35')](_0x4693b6));endCsv();}});})[_0x989b('0x33')](function(_0x4566c5){logger[_0x989b('0x16')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x989b('0x35')](_0x4566c5));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 7b8dc22..0cf362b 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 _0xcda7=['agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','emit','SystemError','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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','DROP\x20TABLE\x20','contactTypeId','VoiceQueueId','CampaignId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','each','finish','affectedRows','contact:import:','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','push','split','all','isNil','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','insert','.CmListId\x20=\x20?','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','updatedAt','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','scheduledAt',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','catch','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','timezones','dialTimezone','utcOffset','set','offset','main','stringify','send','binding','clone','root','server/files/tmp','keys','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber'];(function(_0x12a600,_0x4aa209){var _0x236c37=function(_0x54f71b){while(--_0x54f71b){_0x12a600['push'](_0x12a600['shift']());}};_0x236c37(++_0x4aa209);}(_0xcda7,0x199));var _0x7cda=function(_0x5cf17d,_0x16d5dd){_0x5cf17d=_0x5cf17d-0x0;var _0x53efb0=_0xcda7[_0x5cf17d];return _0x53efb0;};'use strict';var fs=require('fs');var path=require(_0x7cda('0x0'));var _=require(_0x7cda('0x1'));var Papa=require(_0x7cda('0x2'));var util=require(_0x7cda('0x3'));var BPromise=require(_0x7cda('0x4'));var moment=require(_0x7cda('0x5'));var squel=require(_0x7cda('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x7cda('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x7cda('0x8'))(_0x7cda('0x9'));config[_0x7cda('0xa')]=_[_0x7cda('0xb')](config[_0x7cda('0xa')],{'host':_0x7cda('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7cda('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x7cda('0xd')]('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()[_0x7cda('0xd')](_0x7cda('0xe'));function isEmail(_0x50830a){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))*$/[_0x7cda('0xf')](_0x50830a);}function selectNotIn(_0x5b2951,_0x3e3450,_0x5220cb,_0x3fa39d,_0x4beb45){return squel['select']()[_0x7cda('0x10')](_0x7cda('0x11'))[_0x7cda('0x12')](_0x3fa39d)[_0x7cda('0x13')](_0x3e3450,null,_0x3e3450+_0x7cda('0x14')+_0x3fa39d+'.'+_0x5220cb)[_0x7cda('0x15')](_0x3fa39d+'.'+_0x5220cb+_0x7cda('0x16')+_0x5b2951+'.'+_0x5220cb)[_0x7cda('0x15')](_0x3e3450+_0x7cda('0x17')+_0x4beb45[_0x7cda('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x63c618,_0x9b570d){promisesAdditionalPhones=[];return db['CmContact'][_0x7cda('0x18')]({'raw':!![],'attributes':['id',_0x7cda('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x7cda('0x1a')](function(_0xb188b7){if(_0xb188b7!==null){var _0x234645=[];for(var _0x33b34d=0x0;_0x33b34d<_0xb188b7[_0x7cda('0x1b')];_0x33b34d++){var _0x4d41ef=_0xb188b7[_0x33b34d];_0x234645[_0x7cda('0x1c')](insertAdditionalPhones(_0x4d41ef));}}Promise['all'](_0x234645)['then'](function(){_0x63c618({'val':0x1});});});});}function insertAdditionalPhones(_0x36bf3b){return new Promise(function(_0x1914eb,_0x22f67d){var _0x374724=_0x36bf3b[_0x7cda('0x19')];var _0x557154=_0x374724[_0x7cda('0x1d')](';');var _0x370467=[];orderBy=0x0;for(var _0x4f1c98=0x0;_0x4f1c98<_0x557154[_0x7cda('0x1b')];_0x4f1c98++){_0x370467[_0x7cda('0x1c')](splitAdditionalPhone(_0x36bf3b['id'],_0x557154[_0x4f1c98]));}Promise[_0x7cda('0x1e')](_0x370467)[_0x7cda('0x1a')](function(){_0x1914eb({'val':_0x557154[_0x7cda('0x1b')]});});});}function splitAdditionalPhone(_0x1418be,_0x107000){return new Promise(function(_0x418600,_0x10d811){var _0x57556e=_0x107000[_0x7cda('0x1d')](':');var _0xd91f6c=_0x57556e[0x0];var _0x2e638d=_0x57556e[0x1];if(!_[_0x7cda('0x1f')](_0x2e638d)){var _0x129422=_0x2e638d[_0x7cda('0x1d')]('|');var _0x486107=[];for(var _0x43f12c=0x0;_0x43f12c<_0x129422['length'];_0x43f12c++){if(_0x129422[_0x43f12c]!==''){var _0x51390b=_[_0x7cda('0x20')](promisesAdditionalPhones,{'contactId':_0x1418be,'phone':_0x129422[_0x43f12c]});if(_0x51390b[_0x7cda('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x7cda('0x1c')]({'contactId':_0x1418be,'contactTypeId':_0xd91f6c,'phone':_0x129422[_0x43f12c],'orderBy':orderBy});}}}_0x418600({'ok':0x1});}else _0x418600({'res':0x0});});}function createAdditionalPhone(_0x1e28e1,_0x1ae91e,_0x36b45e,_0x4dc96a){var _0x5be44e='';var _0x4a1238='';var _0x342f80=_0x36b45e[_0x7cda('0x1d')]('§');_0x5be44e=_0x342f80[0x0];if(_0x342f80[_0x7cda('0x1b')]==0x2)_0x4a1238=_0x342f80[0x1];return new Promise(function(_0x20fd07,_0x229d94){return db[_0x7cda('0x21')][_0x7cda('0x22')]({'where':{'CmContactId':_0x1e28e1,'item':_0x5be44e}})[_0x7cda('0x1a')](function(_0x27ccc0){if(_0x27ccc0){return db[_0x7cda('0x21')][_0x7cda('0x23')]({'ItemTypeId':_0x1ae91e,'description':_0x4a1238,'OrderBy':_0x4dc96a},{'where':{'CmContactId':_0x1e28e1,'item':_0x5be44e}})[_0x7cda('0x1a')](function(_0x5d1cc9){_0x20fd07({'res':'updated'});});}else{return db[_0x7cda('0x21')][_0x7cda('0x24')]({'CmContactId':_0x1e28e1,'item':_0x5be44e,'description':_0x4a1238,'ItemTypeId':_0x1ae91e,'OrderBy':_0x4dc96a,'ItemClass':_0x7cda('0x25')})[_0x7cda('0x1a')](function(_0x156564){_0x20fd07({'res':_0x7cda('0x26')});});}});});}function insertCmHopper(_0x2546b8,_0x43b0f2,_0x247878,_0x16ccff,_0x522471){var _0x4c7fad=[_0x7cda('0x27'),_0x7cda('0x28'),_0x7cda('0x29'),_0x7cda('0x2a'),_0x43b0f2+'.'+_0x16ccff,_0x7cda('0x2b'),_0x7cda('0x2c'),_0x7cda('0x2d'),_0x7cda('0x2e'),'\x22'+_0x522471+'\x22'];return squel['insert']()[_0x7cda('0x2f')](_0x7cda('0x30'))[_0x7cda('0x31')]([_0x7cda('0x11'),_0x7cda('0x32'),_0x7cda('0x33'),_0x7cda('0x34'),_0x16ccff,_0x7cda('0x35'),'updatedAt',_0x7cda('0x36'),_0x7cda('0x37'),_0x7cda('0x38')],squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x4c7fad)[_0x7cda('0x12')](_0x43b0f2)[_0x7cda('0x13')](_0x7cda('0x3b'),null,_0x7cda('0x3c')+_0x43b0f2+_0x7cda('0x3d'))[_0x7cda('0x13')](_0x247878,null,_0x247878+_0x7cda('0x14')+_0x43b0f2+'.'+_0x16ccff)['where'](_0x43b0f2+'.CmListId\x20=\x20?',_0x2546b8)[_0x7cda('0x15')](_0x7cda('0x3e'),NOW)[_0x7cda('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x43b0f2,_0x247878,_0x16ccff,'cm_hopper',[_0x7cda('0x3f'),_0x7cda('0x40')]))['where'](_0x7cda('0x41'),selectNotIn(_0x43b0f2,_0x247878,_0x16ccff,_0x7cda('0x30'),[_0x7cda('0x3f')])))[_0x7cda('0x42')]();}function insertCmHopperBlack(_0x4f482f,_0x1ba558,_0x43bcc7,_0x51a65c){var _0x5c51bb=[_0x7cda('0x27'),'cm_contacts.id',_0x7cda('0x2a'),_0x1ba558+'.'+_0x51a65c,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x7cda('0x43')]()[_0x7cda('0x2f')]('cm_hopper_black')[_0x7cda('0x31')]([_0x7cda('0x11'),_0x7cda('0x33'),_0x7cda('0x34'),_0x51a65c,_0x7cda('0x35'),'updatedAt'],squel['select']()['fields'](_0x5c51bb)[_0x7cda('0x12')](_0x1ba558)[_0x7cda('0x13')](_0x7cda('0x3b'),null,_0x7cda('0x3c')+_0x1ba558+_0x7cda('0x3d'))['join'](_0x43bcc7,null,_0x43bcc7+'.id\x20=\x20'+_0x1ba558+'.'+_0x51a65c)[_0x7cda('0x15')](_0x1ba558+_0x7cda('0x44'),_0x4f482f)[_0x7cda('0x15')](_0x7cda('0x3e'),NOW)[_0x7cda('0x15')](_0x7cda('0x41'),squel[_0x7cda('0x39')]()[_0x7cda('0x10')](_0x7cda('0x11'))[_0x7cda('0x12')](_0x7cda('0x45'))[_0x7cda('0x15')](_0x7cda('0x46'),_0x4f482f)[_0x7cda('0x15')](_0x51a65c+_0x7cda('0x16')+_0x1ba558+'.'+_0x51a65c)))[_0x7cda('0x42')]();}function insertTzCmHopper(_0x5d762d,_0x249a3b,_0xcfb2e6,_0x58310c,_0x5061a7,_0x4e74c9){var _0x1205aa=[_0x7cda('0x27'),_0x7cda('0x47')+_0x4e74c9+_0x7cda('0x48'),_0x7cda('0x29'),_0x7cda('0x2a'),_0x249a3b+'.'+_0x58310c,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x7cda('0x2e'),'\x22'+_0x5061a7+'\x22'];var _0x566132=squel['insert']()['into'](_0x7cda('0x30'))['fromQuery']([_0x7cda('0x11'),'scheduledat',_0x7cda('0x33'),_0x7cda('0x34'),_0x58310c,_0x7cda('0x35'),_0x7cda('0x49'),_0x7cda('0x36'),_0x7cda('0x37'),_0x7cda('0x38')],squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x1205aa)[_0x7cda('0x12')](_0x249a3b)[_0x7cda('0x13')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x249a3b+_0x7cda('0x3d'))['join'](_0xcfb2e6,null,_0xcfb2e6+_0x7cda('0x14')+_0x249a3b+'.'+_0x58310c)[_0x7cda('0x13')](_0x4e74c9,null,_0x4e74c9+_0x7cda('0x14')+_0x249a3b+'.'+_0x58310c)[_0x7cda('0x15')](_0x249a3b+'.CmListId\x20=\x20?',_0x5d762d)[_0x7cda('0x15')](_0x7cda('0x3e'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x249a3b,_0xcfb2e6,_0x58310c,'cm_hopper',[_0x7cda('0x3f'),_0x7cda('0x40')]))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x249a3b,_0xcfb2e6,_0x58310c,_0x7cda('0x30'),[_0x7cda('0x3f')])))['toString']();return _0x566132;}function insertTzCmHopperBlack(_0x3fac04,_0x2eb80e,_0x1b62ba,_0x23e030){var _0x56ccbe=[_0x7cda('0x27'),_0x7cda('0x29'),'cm_contacts.ListId',_0x2eb80e+'.'+_0x23e030,'cm_contacts.createdAt',_0x7cda('0x2c')];return squel[_0x7cda('0x43')]()[_0x7cda('0x2f')](_0x7cda('0x45'))['fromQuery']([_0x7cda('0x11'),_0x7cda('0x33'),_0x7cda('0x34'),_0x23e030,_0x7cda('0x35'),_0x7cda('0x49')],squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x56ccbe)[_0x7cda('0x12')](_0x2eb80e)['join'](_0x7cda('0x3b'),null,_0x7cda('0x3c')+_0x2eb80e+_0x7cda('0x3d'))['join'](_0x1b62ba,null,_0x1b62ba+_0x7cda('0x14')+_0x2eb80e+'.'+_0x23e030)['where'](_0x2eb80e+_0x7cda('0x44'),_0x3fac04)['where'](_0x7cda('0x3e'),NOW)[_0x7cda('0x15')](_0x7cda('0x41'),squel['select']()[_0x7cda('0x10')](_0x7cda('0x11'))[_0x7cda('0x12')]('cm_hopper_black')[_0x7cda('0x15')](_0x7cda('0x46'),_0x3fac04)[_0x7cda('0x15')](_0x23e030+_0x7cda('0x16')+_0x2eb80e+'.'+_0x23e030)))[_0x7cda('0x42')]();}function insertCmHopperAdditionalPhones(_0x4cda20){var _0x318017=['cm_hopper.id',_0x7cda('0x4a'),_0x7cda('0x4b'),_0x7cda('0x4c'),_0x7cda('0x4d')];return squel[_0x7cda('0x43')]()['into'](_0x7cda('0x4e'))[_0x7cda('0x31')]([_0x7cda('0x4f'),_0x7cda('0x11'),_0x7cda('0x50'),_0x7cda('0x35'),_0x7cda('0x49')],squel['select']()['fields'](_0x318017)[_0x7cda('0x12')](_0x7cda('0x30'))['join']('cm_contacts',null,_0x7cda('0x51'))['join']('cm_contact_has_items',null,_0x7cda('0x52'))['where']('cm_hopper.ListId\x20=\x20?',_0x4cda20)['where'](_0x7cda('0x3e'),NOW))[_0x7cda('0x42')]();}function insertCmContact(_0x5eae5a,_0x3e0d94,_0xa06064,_0xead4de){var _0x224c65=_[_0x7cda('0x53')](_['keys'](_0xead4de),[_0x7cda('0x34'),'CompanyId',_0x7cda('0x35'),_0x7cda('0x49'),_0x7cda('0x54')]);return squel['insert']()[_0x7cda('0x2f')](_0x7cda('0x3b'))['fromQuery'](_0x224c65,squel[_0x7cda('0x39')]()[_0x7cda('0x3a')](_0x224c65)[_0x7cda('0x12')](_0x3e0d94)[_0x7cda('0x15')]('('+_0xa06064[_0x7cda('0x13')](',')+_0x7cda('0x55'),squel['select']()[_0x7cda('0x3a')](_0xa06064)[_0x7cda('0x12')](_0x7cda('0x3b'))['where'](_0x7cda('0x46'),_0x5eae5a)[_0x7cda('0x15')](_0x7cda('0x56')))[_0x7cda('0x15')](_0x7cda('0x57'),squel['select']()[_0x7cda('0x10')](_0x7cda('0x58'),_0x7cda('0x59'))[_0x7cda('0x12')](_0x3e0d94)[_0x7cda('0x5a')](_0xa06064[_0x7cda('0x13')](','))))['toString']();}function handleStop(){logger[_0x7cda('0x5b')](_0x7cda('0x5c'));stopped=!![];}function handleUncaughtException(_0x398285){logger[_0x7cda('0x5d')](_0x398285[_0x7cda('0x5e')]);process[_0x7cda('0x5f')](0x1);}function handleError(_0x4c6b8a,_0x435e97){stats[_0x7cda('0x60')][_0x7cda('0x1c')]({'name':_0x435e97[_0x7cda('0x61')],'message':_0x435e97['message'],'row':_0x4c6b8a});}function handleQuery(_0x477cc1){logger[_0x7cda('0x5b')](_0x477cc1);return db[_0x7cda('0x62')][_0x7cda('0x63')](_0x477cc1)[_0x7cda('0x64')](function(_0x4a923b){results[_0x7cda('0x1c')](_0x4a923b);})[_0x7cda('0x65')](function(_0x26bdd8){logger[_0x7cda('0x5d')](_0x26bdd8[_0x7cda('0x5e')]);});}function updateTzCampaigns(_0x2b40d1){return new Promise(function(_0x1123f4,_0x12b44c){var _0x5dc482=squel[_0x7cda('0x39')]()['fields'](['campaigns.id',_0x7cda('0x66')])[_0x7cda('0x12')](_0x7cda('0x67'))[_0x7cda('0x13')](_0x7cda('0x68'),null,_0x7cda('0x69'))[_0x7cda('0x15')](_0x7cda('0x6a')+_0x2b40d1);db['sequelize'][_0x7cda('0x63')](_0x5dc482[_0x7cda('0x42')]())[_0x7cda('0x64')](function(_0x493ea9){var _0x15e9e9=[];for(var _0x61020f=0x0;_0x61020f<_0x493ea9[_0x7cda('0x1b')];_0x61020f++){_0x15e9e9[_0x7cda('0x1c')](getTimezoneData(_0x493ea9[_0x61020f],tmp_campaigns));}BPromise[_0x7cda('0x1e')](_0x15e9e9)[_0x7cda('0x1a')](function(){_0x1123f4({'val':0x1});});})[_0x7cda('0x65')](function(_0x162448){logger[_0x7cda('0x5d')](_0x162448[_0x7cda('0x5e')]);_0x1123f4({'val':0x0});});});}function updateTzVoiceQueues(_0x1b2854){return new Promise(function(_0x3e3640,_0x2c1e72){var _0x104063=squel[_0x7cda('0x39')]()['fields'](['voice_queues.id',_0x7cda('0x6b')])[_0x7cda('0x12')](_0x7cda('0x6c'))['join'](_0x7cda('0x6d'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where']('voice_queues_has_cm_lists.CmListId='+_0x1b2854);db[_0x7cda('0x62')][_0x7cda('0x63')](_0x104063['toString']())[_0x7cda('0x64')](function(_0x450b99){var _0x2c87bf=[];for(var _0x11fddc=0x0;_0x11fddc<_0x450b99[_0x7cda('0x1b')];_0x11fddc++){_0x2c87bf[_0x7cda('0x1c')](getTimezoneData(_0x450b99[_0x11fddc],tmp_voice_queues));}BPromise['all'](_0x2c87bf)[_0x7cda('0x1a')](function(){_0x3e3640({'val':0x1});});})['catch'](function(_0x74b824){logger[_0x7cda('0x5d')](_0x74b824[_0x7cda('0x5e')]);_0x3e3640({'val':0x0});});});}function getTimezoneData(_0x300530,_0x26ccfb){return new Promise(function(_0x2abe9c,_0x38b923){var _0x5b78cf=shared[_0x7cda('0x6e')];var _0x43270a=_0x5b78cf[_0x300530[_0x7cda('0x6f')]];if(_[_0x7cda('0x1f')](_0x43270a)){_0x2abe9c({'ret':0x1});}else{var _0x3c190b=_0x43270a[_0x7cda('0x70')];var _0x33253b=squel[_0x7cda('0x43')]()['into'](_0x26ccfb)[_0x7cda('0x71')]('id',_0x300530['id'])[_0x7cda('0x71')](_0x7cda('0x72'),_0x3c190b)[_0x7cda('0x71')](_0x7cda('0x6f'),_0x300530[_0x7cda('0x6f')])[_0x7cda('0x42')]();return db[_0x7cda('0x62')][_0x7cda('0x63')](_0x33253b)[_0x7cda('0x64')](function(_0xa1c4b5){_0x2abe9c({'ret':0x1});})[_0x7cda('0x65')](function(_0x41d76d){logger[_0x7cda('0x5d')](_0x41d76d[_0x7cda('0x5e')]);_0x38b923({'ret':0x1});});}});}function handleTZQuery(_0x37b485){logger[_0x7cda('0x5b')](_0x37b485);return db[_0x7cda('0x62')]['query'](_0x37b485)[_0x7cda('0x64')](function(_0x286b14){})[_0x7cda('0x65')](function(_0x468421){logger[_0x7cda('0x5d')](_0x468421[_0x7cda('0x5e')]);});}function main(_0x1a14f8,_0x16cb19,_0x5170b5,_0x563b3f){logger[_0x7cda('0x5b')](_0x7cda('0x73'),_0x1a14f8,JSON[_0x7cda('0x74')](_0x16cb19));process[_0x7cda('0x75')]('start');var _0x2b1c10=_0x16cb19[_0x7cda('0x76')];var _0x32a498=_[_0x7cda('0x77')](_0x2b1c10);var _0x4e1e39=_0x16cb19['socket_timestamp'];var _0x23b496=path[_0x7cda('0x13')](config[_0x7cda('0x78')],_0x7cda('0x79'),_0x4e1e39+'.csv');hasTZ=_[_0x7cda('0x7a')](_0x2b1c10)[_0x7cda('0x7b')]('dialTimezone');var _0x414827=_[_0x7cda('0x7a')](_0x2b1c10)['join']();logger['info'](_0x7cda('0x7c'),_0x414827);db[_0x7cda('0x7d')][_0x7cda('0x18')]({'raw':!![],'attributes':['id',_0x7cda('0x7e')]})[_0x7cda('0x1a')](function(_0x51ad86){for(var _0x592858=0x0;_0x592858<_0x51ad86[_0x7cda('0x1b')];_0x592858++){if(_0x51ad86[_0x592858]['name']in _0x2b1c10){contactItemTypes[_0x7cda('0x1c')](_0x51ad86[_0x592858]);delete _0x32a498[_0x51ad86[_0x592858]['name']];hasAdditionalPhones=!![];}for(var _0x21479c in _0x2b1c10){if(_0x51ad86[_0x592858][_0x7cda('0x7e')]+_0x7cda('0x7f')===_0x21479c){phoneDescriptions[_0x7cda('0x1c')]({'itemTypeId':_0x51ad86[_0x592858]['id'],'description':_0x21479c});delete _0x32a498[_0x21479c];}}}if(hasAdditionalPhones)_0x32a498['AdditionalPhones']='';var _0x1e78ff=_[_0x7cda('0x7a')](_0x32a498)[_0x7cda('0x13')]();logger[_0x7cda('0x5b')](_0x7cda('0x7c'),_0x1e78ff);fs[_0x7cda('0x80')](_0x23b496,_0x1e78ff+'\x0a');Papa[_0x7cda('0x81')](fs[_0x7cda('0x82')](_0x1a14f8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x98849,_0x57f159){try{for(var _0x5a13ae=0x0,_0x108aa1=[];_0x5a13ae<_0x98849[_0x7cda('0x83')][_0x7cda('0x1b')];_0x5a13ae++){stats[_0x7cda('0x84')]+=0x1;if(_0x98849[_0x7cda('0x60')][_0x5a13ae]){handleError(_0x98849[_0x7cda('0x83')][_0x5a13ae],_0x98849[_0x7cda('0x60')][_0x5a13ae]);}else{var _0x501732=[];var _0x13cc09=[];var _0x462ae8={};for(var _0x1dcf04 in _0x2b1c10){let _0x39b156=contactItemTypes[_0x7cda('0x85')](_0x311512=>_0x311512[_0x7cda('0x7e')]===_0x1dcf04);let _0x21636b=contactItemTypes[_0x7cda('0x85')](_0x4e99f5=>_0x4e99f5['name']+_0x7cda('0x7f')===_0x1dcf04);if(_['isNil'](_0x39b156)&&_[_0x7cda('0x1f')](_0x21636b)){if(_0x2b1c10[_0x7cda('0x86')](_0x1dcf04)){if(_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x1dcf04]]){var _0x5acfbb=_[_0x7cda('0x87')](_0x98849['data'][_0x5a13ae][_0x2b1c10[_0x1dcf04]][_0x7cda('0x88')](/"/g,'\x27'));switch(_0x1dcf04){case'scheduledat':var _0x4c22c6=moment(_0x5acfbb,_0x7cda('0xe'),!![]);if(_0x4c22c6['isValid']()){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');}else{_0x501732[_0x7cda('0x1c')](_0x7cda('0x89'));}break;case _0x7cda('0x36'):var _0x48f4e2=parseInt(_0x5acfbb);_0x5acfbb=_[_0x7cda('0x8a')](_0x48f4e2)||_0x48f4e2<0x0||_0x48f4e2>0x4?_0x563b3f?0x3:0x2:_0x48f4e2;_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');break;case _0x7cda('0x37'):var _0x41c013=parseInt(_0x5acfbb);if(_[_0x7cda('0x8b')](_0x41c013)&&_[_0x7cda('0x7b')](_0x5170b5,_0x41c013)){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x41c013+'\x22');}else{_0x501732['push'](_0x7cda('0x8c'));}break;case'email':if(isEmail(_0x5acfbb)){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');}else{_0x501732['push'](_0x7cda('0x8d'));}break;case _0x7cda('0x8e'):var _0x56545c=moment(_0x5acfbb,_0x7cda('0x8f'),!![]);if(_0x56545c['isValid']()){_0x108aa1['push']('\x22'+_0x5acfbb+'\x22');}else{_0x501732[_0x7cda('0x1c')](_0x7cda('0x90'));}break;case _0x7cda('0x6f'):var _0x44779b=shared[_0x7cda('0x6e')];var _0x208d8f=_0x44779b[_0x5acfbb];if(!_[_0x7cda('0x1f')](_0x208d8f)){var _0x3d73bf=_0x208d8f[_0x7cda('0x70')];_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x3d73bf+'\x22');}break;default:_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x5acfbb+'\x22');}}else{switch(_0x1dcf04){case _0x7cda('0x91'):case _0x7cda('0x11'):_0x501732[_0x7cda('0x1c')](_0x1dcf04+_0x7cda('0x92'));break;default:_0x108aa1[_0x7cda('0x1c')]('\x22\x22');}}}}else{var _0x5a582a='';if(!_[_0x7cda('0x1f')](_0x39b156)){if(!_0x462ae8['hasOwnProperty'](_0x39b156['id'])){if(!_[_0x7cda('0x1f')](_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x1dcf04]])){var _0x5acfbb=_['trim'](_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x1dcf04]][_0x7cda('0x88')](/"/g,'\x27'));var _0x35b1f2=phoneDescriptions[_0x7cda('0x85')](_0x40ee33=>_0x40ee33['itemTypeId']===_0x39b156['id']);if(!_[_0x7cda('0x1f')](_0x35b1f2)){var _0x2dd8cf=_[_0x7cda('0x87')](_0x98849[_0x7cda('0x83')][_0x5a13ae][_0x2b1c10[_0x35b1f2[_0x7cda('0x93')]]]['replace'](/"/g,'\x27'));if(!_[_0x7cda('0x1f')](_0x2dd8cf))_0x5acfbb=_0x5acfbb+'§'+_0x2dd8cf;}if(_0x5a582a=='')_0x5a582a=_0x5acfbb;else _0x5a582a+='|'+_0x5acfbb;}_0x13cc09['push'](_0x39b156['id']+':'+_0x5a582a);_0x462ae8[_0x39b156['id']]=0x1;}}}}if(hasAdditionalPhones){_0x108aa1[_0x7cda('0x1c')]('\x22'+_0x13cc09[_0x7cda('0x13')](';')+'\x22');}if(_0x501732[_0x7cda('0x1b')]){handleError(_0x98849['data'][_0x5a13ae],{'code':_0x7cda('0x94'),'message':_0x501732[_0x7cda('0x13')]()});}else{fs[_0x7cda('0x95')](_0x23b496,_0x108aa1[_0x7cda('0x13')]()+'\x0a');}_0x108aa1=[];}if(!(stats['rows']%0xc8)){socket[_0x7cda('0x96')]('contact:import:'+_0x4e1e39,stats);stats[_0x7cda('0x60')]=[];}}if(stopped){logger[_0x7cda('0x5b')]('Abort\x20parser');_0x57f159['abort']();}}catch(_0x146417){handleError(_0x98849[_0x7cda('0x83')][_0x5a13ae],{'code':_0x7cda('0x97'),'message':_0x146417['message']});logger['error']('step',_0x146417[_0x7cda('0x5e')]);}},'complete':function(){try{var _0x4a841d=[];var _0x3d3ab5=[];var _0x12a6f4=_0x7cda('0x3b');if(_0x16cb19[_0x7cda('0x98')]&&_0x16cb19[_0x7cda('0x98')][_0x7cda('0x1b')]){_0x12a6f4='cm_contacts_'+_0x4e1e39;_0x4a841d[_0x7cda('0x1c')](_0x7cda('0x99')+_0x12a6f4+_0x7cda('0x9a'));}tmp_campaigns=_0x7cda('0x9b')+_0x4e1e39;tmp_voice_queues=_0x7cda('0x9c')+_0x4e1e39;_0x3d3ab5['push'](_0x7cda('0x99')+tmp_campaigns+_0x7cda('0x9d'));_0x3d3ab5[_0x7cda('0x1c')](_0x7cda('0x99')+tmp_voice_queues+_0x7cda('0x9d'));BPromise['each'](_0x3d3ab5,handleTZQuery)[_0x7cda('0x1a')](function(_0x4e3ba4){updateTzCampaigns(_0x16cb19[_0x7cda('0x34')])[_0x7cda('0x1a')](function(_0x5a5e61){updateTzVoiceQueues(_0x16cb19[_0x7cda('0x34')])['then'](function(_0x9a0828){if(hasTZ)_0x1e78ff=_0x1e78ff[_0x7cda('0x88')](_0x7cda('0x6f'),_0x7cda('0x9e'));var _0x1d9f7c=util['format'](_0x7cda('0x9f'),_0x23b496,_0x12a6f4,_0x1e78ff,_0x16cb19[_0x7cda('0x34')],_0x16cb19['CompanyId']||null,NOW,NOW);if(_[_0x7cda('0x1f')](_0x2b1c10[_0x7cda('0x32')])){_0x1d9f7c+=',\x20scheduledAt\x20=\x20NOW()';}_0x4a841d[_0x7cda('0x1c')](_0x1d9f7c);if(_0x16cb19[_0x7cda('0x98')]&&_0x16cb19[_0x7cda('0x98')][_0x7cda('0x1b')]){_0x4a841d[_0x7cda('0x1c')](insertCmContact(_0x16cb19[_0x7cda('0x34')],_0x12a6f4,_0x16cb19[_0x7cda('0x98')],_0x2b1c10));_0x4a841d[_0x7cda('0x1c')](_0x7cda('0xa0')+_0x12a6f4+';');}BPromise['each'](_0x4a841d,handleQuery)['then'](function(_0x4beae4){BPromise[_0x7cda('0x1e')]([handleAdditionalPhones()])[_0x7cda('0x1a')](function(){_0x4a841d=[];for(var _0x181915=0x0;_0x181915\x20\x20');}var _0x4b8f2a=path[_0x7cda('0x13')](config[_0x7cda('0x78')],'server/files/tmp',process[_0x7cda('0xac')][0x2]);if(!fs[_0x7cda('0xad')](_0x4b8f2a)){throw new Error(_0x7cda('0xae'));}var _0x369599={};try{_0x369599=JSON[_0x7cda('0x81')](process[_0x7cda('0xac')][0x3]);if(!_0x369599[_0x7cda('0x76')]){throw new Error(_0x7cda('0xaf'));}if(!_0x369599[_0x7cda('0x76')]['phone']){throw new Error(_0x7cda('0xb0'));}if(!_0x369599['binding'][_0x7cda('0x91')]){throw new Error(_0x7cda('0xb1'));}var _0x286a32=0x0;if(_0x369599['binding']['UserId']){_0x286a32=0x1;}if(!_0x369599[_0x7cda('0x34')]){throw new Error(_0x7cda('0xb2'));}}catch(_0x34b98b){throw new Error('body\x20id\x20mandatory');}var _0x30b1c0=[];try{_0x30b1c0=_[_0x7cda('0xb3')](JSON[_0x7cda('0x81')](process[_0x7cda('0xac')][0x4]),'id');}catch(_0x5a6ba9){logger[_0x7cda('0x5b')](_0x7cda('0xb4'));}main(_0x4b8f2a,_0x369599,_0x30b1c0,_0x286a32);}validate();process['on'](_0x7cda('0xb5'),handleStop);process['on'](_0x7cda('0xb6'),handleUncaughtException); \ No newline at end of file +var _0xb71c=['parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','then','length','push','all','AdditionalPhones','split','isNil','filter','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_hopper_black','fromQuery','ContactId','cm_contacts.ListId\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','into','cm_hopper_additional_phones','CmHopperId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','message','exit','errors','query','catch','error','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','sequelize','timezones','dialTimezone','set','main','stringify','start','binding','socket_timestamp','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','createReadStream','data','rows','find','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email\x20wrong\x20format','dateOfBirth','utcOffset','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','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','each','contactTypeId','orderBy','voice_queues','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync'];(function(_0x26879e,_0x4c5bb5){var _0x28fff2=function(_0x4bd42a){while(--_0x4bd42a){_0x26879e['push'](_0x26879e['shift']());}};_0x28fff2(++_0x4c5bb5);}(_0xb71c,0xc6));var _0xcb71=function(_0x34fed1,_0x39bca9){_0x34fed1=_0x34fed1-0x0;var _0x2e71ac=_0xb71c[_0x34fed1];return _0x2e71ac;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xcb71('0x0'));var Papa=require(_0xcb71('0x1'));var util=require(_0xcb71('0x2'));var BPromise=require(_0xcb71('0x3'));var moment=require(_0xcb71('0x4'));var squel=require(_0xcb71('0x5'));var Redis=require(_0xcb71('0x6'));var db=require(_0xcb71('0x7'))['db'];var config=require(_0xcb71('0x8'));var shared=require('../../../config/environment/shared');var logger=require(_0xcb71('0x9'))(_0xcb71('0xa'));config[_0xcb71('0xb')]=_['defaults'](config[_0xcb71('0xb')],{'host':_0xcb71('0xc'),'port':0x18eb});var socket=require(_0xcb71('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xcb71('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xcb71('0xf')](_0xcb71('0xe'));function isEmail(_0x20e22e){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))*$/[_0xcb71('0x10')](_0x20e22e);}function selectNotIn(_0x4a7f2b,_0x3f067b,_0x5c4e31,_0x120c30,_0x107bf2){return squel[_0xcb71('0x11')]()[_0xcb71('0x12')](_0xcb71('0x13'))[_0xcb71('0x14')](_0x120c30)[_0xcb71('0x15')](_0x3f067b,null,_0x3f067b+'.id\x20=\x20'+_0x120c30+'.'+_0x5c4e31)[_0xcb71('0x16')](_0x120c30+'.'+_0x5c4e31+_0xcb71('0x17')+_0x4a7f2b+'.'+_0x5c4e31)[_0xcb71('0x16')](_0x3f067b+_0xcb71('0x18')+_0x107bf2['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1fabfb,_0x5ab018){promisesAdditionalPhones=[];return db['CmContact'][_0xcb71('0x19')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xcb71('0x1a')](function(_0x5955f3){if(_0x5955f3!==null){var _0x36edb5=[];for(var _0x2cb700=0x0;_0x2cb700<_0x5955f3[_0xcb71('0x1b')];_0x2cb700++){var _0x58dddf=_0x5955f3[_0x2cb700];_0x36edb5[_0xcb71('0x1c')](insertAdditionalPhones(_0x58dddf));}}Promise[_0xcb71('0x1d')](_0x36edb5)[_0xcb71('0x1a')](function(){_0x1fabfb({'val':0x1});});});});}function insertAdditionalPhones(_0x2a450b){return new Promise(function(_0x837249,_0x147fda){var _0x432470=_0x2a450b[_0xcb71('0x1e')];var _0x400a36=_0x432470[_0xcb71('0x1f')](';');var _0x4c7c44=[];orderBy=0x0;for(var _0x56d094=0x0;_0x56d094<_0x400a36[_0xcb71('0x1b')];_0x56d094++){_0x4c7c44[_0xcb71('0x1c')](splitAdditionalPhone(_0x2a450b['id'],_0x400a36[_0x56d094]));}Promise['all'](_0x4c7c44)[_0xcb71('0x1a')](function(){_0x837249({'val':_0x400a36[_0xcb71('0x1b')]});});});}function splitAdditionalPhone(_0x112061,_0x4c086f){return new Promise(function(_0x309177,_0x572c1f){var _0x394da9=_0x4c086f[_0xcb71('0x1f')](':');var _0x137cb2=_0x394da9[0x0];var _0x53f67f=_0x394da9[0x1];if(!_[_0xcb71('0x20')](_0x53f67f)){var _0x32548d=_0x53f67f[_0xcb71('0x1f')]('|');var _0x2118fd=[];for(var _0x54a261=0x0;_0x54a261<_0x32548d['length'];_0x54a261++){if(_0x32548d[_0x54a261]!==''){var _0x4ecea2=_[_0xcb71('0x21')](promisesAdditionalPhones,{'contactId':_0x112061,'phone':_0x32548d[_0x54a261]});if(_0x4ecea2[_0xcb71('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0xcb71('0x1c')]({'contactId':_0x112061,'contactTypeId':_0x137cb2,'phone':_0x32548d[_0x54a261],'orderBy':orderBy});}}}_0x309177({'ok':0x1});}else _0x309177({'res':0x0});});}function createAdditionalPhone(_0x543b1b,_0x30b2c7,_0x877b16,_0x3e951a){var _0x3f700f='';var _0x3eaf33='';var _0x5b6849=_0x877b16['split']('§');_0x3f700f=_0x5b6849[0x0];if(_0x5b6849[_0xcb71('0x1b')]==0x2)_0x3eaf33=_0x5b6849[0x1];return new Promise(function(_0x53f276,_0x3eced1){return db[_0xcb71('0x22')]['findOne']({'where':{'CmContactId':_0x543b1b,'item':_0x3f700f}})[_0xcb71('0x1a')](function(_0x50ec01){if(_0x50ec01){return db[_0xcb71('0x22')][_0xcb71('0x23')]({'ItemTypeId':_0x30b2c7,'description':_0x3eaf33,'OrderBy':_0x3e951a},{'where':{'CmContactId':_0x543b1b,'item':_0x3f700f}})['then'](function(_0x4a1442){_0x53f276({'res':_0xcb71('0x24')});});}else{return db[_0xcb71('0x22')][_0xcb71('0x25')]({'CmContactId':_0x543b1b,'item':_0x3f700f,'description':_0x3eaf33,'ItemTypeId':_0x30b2c7,'OrderBy':_0x3e951a,'ItemClass':_0xcb71('0x26')})[_0xcb71('0x1a')](function(_0x421303){_0x53f276({'res':_0xcb71('0x27')});});}});});}function insertCmHopper(_0x91d811,_0x495d53,_0x3524fd,_0x58eae4,_0xc2e1d4){var _0x28d93a=[_0xcb71('0x28'),_0xcb71('0x29'),'cm_contacts.id','cm_contacts.ListId',_0x495d53+'.'+_0x58eae4,'cm_contacts.createdAt',_0xcb71('0x2a'),_0xcb71('0x2b'),_0xcb71('0x2c'),'\x22'+_0xc2e1d4+'\x22'];return squel[_0xcb71('0x2d')]()['into']('cm_hopper')['fromQuery'](['phone','scheduledat','ContactId',_0xcb71('0x2e'),_0x58eae4,_0xcb71('0x2f'),_0xcb71('0x30'),_0xcb71('0x31'),_0xcb71('0x32'),_0xcb71('0x33')],squel[_0xcb71('0x11')]()[_0xcb71('0x34')](_0x28d93a)[_0xcb71('0x14')](_0x495d53)[_0xcb71('0x15')](_0xcb71('0x35'),null,'cm_contacts.ListId\x20=\x20'+_0x495d53+_0xcb71('0x36'))['join'](_0x3524fd,null,_0x3524fd+_0xcb71('0x37')+_0x495d53+'.'+_0x58eae4)[_0xcb71('0x16')](_0x495d53+_0xcb71('0x38'),_0x91d811)['where'](_0xcb71('0x39'),NOW)[_0xcb71('0x16')](_0xcb71('0x3a'),selectNotIn(_0x495d53,_0x3524fd,_0x58eae4,_0xcb71('0x3b'),['\x22always\x22',_0xcb71('0x3c')]))[_0xcb71('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x495d53,_0x3524fd,_0x58eae4,_0xcb71('0x3b'),[_0xcb71('0x3d')])))[_0xcb71('0x3e')]();}function insertCmHopperBlack(_0x3df30d,_0x16c00c,_0xc1bae4,_0x3b285e){var _0x872bd=[_0xcb71('0x28'),_0xcb71('0x3f'),_0xcb71('0x40'),_0x16c00c+'.'+_0x3b285e,_0xcb71('0x41'),_0xcb71('0x2a')];return squel[_0xcb71('0x2d')]()['into'](_0xcb71('0x42'))[_0xcb71('0x43')]([_0xcb71('0x13'),_0xcb71('0x44'),_0xcb71('0x2e'),_0x3b285e,_0xcb71('0x2f'),_0xcb71('0x30')],squel[_0xcb71('0x11')]()[_0xcb71('0x34')](_0x872bd)['from'](_0x16c00c)['join'](_0xcb71('0x35'),null,_0xcb71('0x45')+_0x16c00c+_0xcb71('0x36'))['join'](_0xc1bae4,null,_0xc1bae4+_0xcb71('0x37')+_0x16c00c+'.'+_0x3b285e)[_0xcb71('0x16')](_0x16c00c+_0xcb71('0x38'),_0x3df30d)[_0xcb71('0x16')](_0xcb71('0x39'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xcb71('0x11')]()['field'](_0xcb71('0x13'))[_0xcb71('0x14')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x3df30d)[_0xcb71('0x16')](_0x3b285e+_0xcb71('0x17')+_0x16c00c+'.'+_0x3b285e)))[_0xcb71('0x3e')]();}function insertTzCmHopper(_0x2fbb0c,_0x148332,_0x5a6bca,_0x152e22,_0x5ddc56,_0x582393){var _0x5b51eb=[_0xcb71('0x28'),_0xcb71('0x46')+_0x582393+_0xcb71('0x47'),'cm_contacts.id',_0xcb71('0x40'),_0x148332+'.'+_0x152e22,_0xcb71('0x41'),_0xcb71('0x2a'),_0xcb71('0x2b'),_0xcb71('0x2c'),'\x22'+_0x5ddc56+'\x22'];var _0x5ac284=squel[_0xcb71('0x2d')]()['into'](_0xcb71('0x3b'))['fromQuery']([_0xcb71('0x13'),'scheduledat',_0xcb71('0x44'),_0xcb71('0x2e'),_0x152e22,_0xcb71('0x2f'),_0xcb71('0x30'),_0xcb71('0x31'),_0xcb71('0x32'),_0xcb71('0x33')],squel[_0xcb71('0x11')]()[_0xcb71('0x34')](_0x5b51eb)[_0xcb71('0x14')](_0x148332)['join'](_0xcb71('0x35'),null,_0xcb71('0x45')+_0x148332+_0xcb71('0x36'))[_0xcb71('0x15')](_0x5a6bca,null,_0x5a6bca+_0xcb71('0x37')+_0x148332+'.'+_0x152e22)[_0xcb71('0x15')](_0x582393,null,_0x582393+'.id\x20=\x20'+_0x148332+'.'+_0x152e22)['where'](_0x148332+_0xcb71('0x38'),_0x2fbb0c)[_0xcb71('0x16')](_0xcb71('0x39'),NOW)[_0xcb71('0x16')](_0xcb71('0x3a'),selectNotIn(_0x148332,_0x5a6bca,_0x152e22,_0xcb71('0x3b'),[_0xcb71('0x3d'),_0xcb71('0x3c')]))[_0xcb71('0x16')](_0xcb71('0x3a'),selectNotIn(_0x148332,_0x5a6bca,_0x152e22,_0xcb71('0x3b'),[_0xcb71('0x3d')])))[_0xcb71('0x3e')]();return _0x5ac284;}function insertTzCmHopperBlack(_0x292fc6,_0x3ee338,_0x47c7ae,_0x78510c){var _0xf8b53b=[_0xcb71('0x28'),_0xcb71('0x3f'),'cm_contacts.ListId',_0x3ee338+'.'+_0x78510c,_0xcb71('0x41'),_0xcb71('0x2a')];return squel[_0xcb71('0x2d')]()['into']('cm_hopper_black')[_0xcb71('0x43')](['phone',_0xcb71('0x44'),_0xcb71('0x2e'),_0x78510c,_0xcb71('0x2f'),_0xcb71('0x30')],squel[_0xcb71('0x11')]()[_0xcb71('0x34')](_0xf8b53b)[_0xcb71('0x14')](_0x3ee338)[_0xcb71('0x15')](_0xcb71('0x35'),null,_0xcb71('0x45')+_0x3ee338+_0xcb71('0x36'))['join'](_0x47c7ae,null,_0x47c7ae+_0xcb71('0x37')+_0x3ee338+'.'+_0x78510c)[_0xcb71('0x16')](_0x3ee338+_0xcb71('0x38'),_0x292fc6)['where'](_0xcb71('0x39'),NOW)[_0xcb71('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xcb71('0x12')](_0xcb71('0x13'))['from'](_0xcb71('0x42'))['where']('ListId\x20=\x20?',_0x292fc6)[_0xcb71('0x16')](_0x78510c+_0xcb71('0x17')+_0x3ee338+'.'+_0x78510c)))['toString']();}function insertCmHopperAdditionalPhones(_0x3c019c){var _0x58c4ca=[_0xcb71('0x48'),_0xcb71('0x49'),'cm_contact_has_items.OrderBy',_0xcb71('0x4a'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xcb71('0x4b')](_0xcb71('0x4c'))[_0xcb71('0x43')]([_0xcb71('0x4d'),'phone','OrderBy',_0xcb71('0x2f'),_0xcb71('0x30')],squel[_0xcb71('0x11')]()['fields'](_0x58c4ca)[_0xcb71('0x14')](_0xcb71('0x3b'))[_0xcb71('0x15')]('cm_contacts',null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xcb71('0x15')](_0xcb71('0x4e'),null,_0xcb71('0x4f'))[_0xcb71('0x16')](_0xcb71('0x50'),_0x3c019c)[_0xcb71('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW))['toString']();}function insertCmContact(_0x10fa59,_0x516317,_0x59f410,_0x1cf4c9){var _0x48959c=_[_0xcb71('0x51')](_[_0xcb71('0x52')](_0x1cf4c9),['ListId',_0xcb71('0x53'),'createdAt',_0xcb71('0x30'),_0xcb71('0x54')]);return squel[_0xcb71('0x2d')]()[_0xcb71('0x4b')](_0xcb71('0x35'))[_0xcb71('0x43')](_0x48959c,squel[_0xcb71('0x11')]()[_0xcb71('0x34')](_0x48959c)[_0xcb71('0x14')](_0x516317)[_0xcb71('0x16')]('('+_0x59f410[_0xcb71('0x15')](',')+_0xcb71('0x55'),squel[_0xcb71('0x11')]()[_0xcb71('0x34')](_0x59f410)[_0xcb71('0x14')](_0xcb71('0x35'))[_0xcb71('0x16')](_0xcb71('0x56'),_0x10fa59)[_0xcb71('0x16')](_0xcb71('0x57')))[_0xcb71('0x16')](_0xcb71('0x58'),squel[_0xcb71('0x11')]()[_0xcb71('0x12')](_0xcb71('0x59'),'min_id')[_0xcb71('0x14')](_0x516317)[_0xcb71('0x5a')](_0x59f410['join'](','))))[_0xcb71('0x3e')]();}function handleStop(){logger[_0xcb71('0x5b')](_0xcb71('0x5c'));stopped=!![];}function handleUncaughtException(_0x1fd876){logger['error'](_0x1fd876[_0xcb71('0x5d')]);process[_0xcb71('0x5e')](0x1);}function handleError(_0x2170cb,_0x1614c0){stats[_0xcb71('0x5f')][_0xcb71('0x1c')]({'name':_0x1614c0['code'],'message':_0x1614c0[_0xcb71('0x5d')],'row':_0x2170cb});}function handleQuery(_0x46d6df){logger['info'](_0x46d6df);return db['sequelize'][_0xcb71('0x60')](_0x46d6df)['spread'](function(_0x4a3a53){results[_0xcb71('0x1c')](_0x4a3a53);})[_0xcb71('0x61')](function(_0x1f705d){logger[_0xcb71('0x62')](_0x1f705d[_0xcb71('0x5d')]);});}function updateTzCampaigns(_0x5620ef){return new Promise(function(_0x3c3b99,_0x5c9266){var _0x3a7b45=squel[_0xcb71('0x11')]()[_0xcb71('0x34')]([_0xcb71('0x63'),_0xcb71('0x64')])[_0xcb71('0x14')](_0xcb71('0x65'))['join'](_0xcb71('0x66'),null,_0xcb71('0x67'))['where'](_0xcb71('0x68')+_0x5620ef);db['sequelize']['query'](_0x3a7b45['toString']())[_0xcb71('0x69')](function(_0x3ac46d){var _0x2eedda=[];for(var _0x4ee2b7=0x0;_0x4ee2b7<_0x3ac46d['length'];_0x4ee2b7++){_0x2eedda[_0xcb71('0x1c')](getTimezoneData(_0x3ac46d[_0x4ee2b7],tmp_campaigns));}BPromise[_0xcb71('0x1d')](_0x2eedda)[_0xcb71('0x1a')](function(){_0x3c3b99({'val':0x1});});})['catch'](function(_0x5d1b28){logger[_0xcb71('0x62')](_0x5d1b28['message']);_0x3c3b99({'val':0x0});});});}function updateTzVoiceQueues(_0x1bcb37){return new Promise(function(_0x332286,_0x22c378){var _0x3e9625=squel[_0xcb71('0x11')]()['fields']([_0xcb71('0x6a'),_0xcb71('0x6b')])['from']('voice_queues')[_0xcb71('0x15')](_0xcb71('0x6c'),null,_0xcb71('0x6d'))[_0xcb71('0x16')]('voice_queues_has_cm_lists.CmListId='+_0x1bcb37);db[_0xcb71('0x6e')][_0xcb71('0x60')](_0x3e9625[_0xcb71('0x3e')]())['spread'](function(_0x10a139){var _0x4db387=[];for(var _0x33224d=0x0;_0x33224d<_0x10a139[_0xcb71('0x1b')];_0x33224d++){_0x4db387[_0xcb71('0x1c')](getTimezoneData(_0x10a139[_0x33224d],tmp_voice_queues));}BPromise[_0xcb71('0x1d')](_0x4db387)[_0xcb71('0x1a')](function(){_0x332286({'val':0x1});});})[_0xcb71('0x61')](function(_0x222b32){logger[_0xcb71('0x62')](_0x222b32['message']);_0x332286({'val':0x0});});});}function getTimezoneData(_0x752a01,_0x2325b6){return new Promise(function(_0x27cdf3,_0x5ada58){var _0x42970d=shared[_0xcb71('0x6f')];var _0x4ed23f=_0x42970d[_0x752a01[_0xcb71('0x70')]];if(_[_0xcb71('0x20')](_0x4ed23f)){_0x27cdf3({'ret':0x1});}else{var _0x4edb95=_0x4ed23f['utcOffset'];var _0x210407=squel[_0xcb71('0x2d')]()[_0xcb71('0x4b')](_0x2325b6)[_0xcb71('0x71')]('id',_0x752a01['id'])['set']('offset',_0x4edb95)['set']('dialTimezone',_0x752a01[_0xcb71('0x70')])[_0xcb71('0x3e')]();return db[_0xcb71('0x6e')][_0xcb71('0x60')](_0x210407)[_0xcb71('0x69')](function(_0x485ab4){_0x27cdf3({'ret':0x1});})[_0xcb71('0x61')](function(_0x3a5519){logger[_0xcb71('0x62')](_0x3a5519['message']);_0x5ada58({'ret':0x1});});}});}function handleTZQuery(_0x512edb){logger['info'](_0x512edb);return db[_0xcb71('0x6e')][_0xcb71('0x60')](_0x512edb)[_0xcb71('0x69')](function(_0x520ea6){})[_0xcb71('0x61')](function(_0x3c5599){logger['error'](_0x3c5599[_0xcb71('0x5d')]);});}function main(_0xcdda25,_0x36a342,_0xd79ce5,_0x442476){logger[_0xcb71('0x5b')](_0xcb71('0x72'),_0xcdda25,JSON[_0xcb71('0x73')](_0x36a342));process['send'](_0xcb71('0x74'));var _0xc18a=_0x36a342[_0xcb71('0x75')];var _0x57cda3=_['clone'](_0xc18a);var _0x6908ad=_0x36a342[_0xcb71('0x76')];var _0xa9d644=path[_0xcb71('0x15')](config['root'],_0xcb71('0x77'),_0x6908ad+_0xcb71('0x78'));hasTZ=_[_0xcb71('0x52')](_0xc18a)[_0xcb71('0x79')](_0xcb71('0x70'));var _0x11af39=_[_0xcb71('0x52')](_0xc18a)['join']();logger[_0xcb71('0x5b')](_0xcb71('0x7a'),_0x11af39);db[_0xcb71('0x7b')][_0xcb71('0x19')]({'raw':!![],'attributes':['id','name']})[_0xcb71('0x1a')](function(_0x566682){for(var _0x1213a5=0x0;_0x1213a5<_0x566682['length'];_0x1213a5++){if(_0x566682[_0x1213a5][_0xcb71('0x7c')]in _0xc18a){contactItemTypes[_0xcb71('0x1c')](_0x566682[_0x1213a5]);delete _0x57cda3[_0x566682[_0x1213a5][_0xcb71('0x7c')]];hasAdditionalPhones=!![];}for(var _0x4c5cff in _0xc18a){if(_0x566682[_0x1213a5][_0xcb71('0x7c')]+_0xcb71('0x7d')===_0x4c5cff){phoneDescriptions[_0xcb71('0x1c')]({'itemTypeId':_0x566682[_0x1213a5]['id'],'description':_0x4c5cff});delete _0x57cda3[_0x4c5cff];}}}if(hasAdditionalPhones)_0x57cda3[_0xcb71('0x1e')]='';var _0x308fda=_[_0xcb71('0x52')](_0x57cda3)[_0xcb71('0x15')]();logger[_0xcb71('0x5b')](_0xcb71('0x7a'),_0x308fda);fs[_0xcb71('0x7e')](_0xa9d644,_0x308fda+'\x0a');Papa['parse'](fs[_0xcb71('0x7f')](_0xcdda25),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3e732e,_0x1c1665){try{for(var _0x1acae1=0x0,_0x3b58f1=[];_0x1acae1<_0x3e732e[_0xcb71('0x80')]['length'];_0x1acae1++){stats[_0xcb71('0x81')]+=0x1;if(_0x3e732e['errors'][_0x1acae1]){handleError(_0x3e732e[_0xcb71('0x80')][_0x1acae1],_0x3e732e[_0xcb71('0x5f')][_0x1acae1]);}else{var _0x34dcec=[];var _0x306915=[];var _0x5a2f52={};for(var _0x532dec in _0xc18a){let _0xc378e9=contactItemTypes[_0xcb71('0x82')](_0xc06a9c=>_0xc06a9c[_0xcb71('0x7c')]===_0x532dec);let _0x3a435=contactItemTypes[_0xcb71('0x82')](_0x314d6f=>_0x314d6f[_0xcb71('0x7c')]+'_description'===_0x532dec);if(_[_0xcb71('0x20')](_0xc378e9)&&_['isNil'](_0x3a435)){if(_0xc18a[_0xcb71('0x83')](_0x532dec)){if(_0x3e732e['data'][_0x1acae1][_0xc18a[_0x532dec]]){var _0x2ede4c=_[_0xcb71('0x84')](_0x3e732e[_0xcb71('0x80')][_0x1acae1][_0xc18a[_0x532dec]][_0xcb71('0x85')](/"/g,'\x27'));switch(_0x532dec){case _0xcb71('0x86'):var _0x23bb9b=moment(_0x2ede4c,_0xcb71('0xe'),!![]);if(_0x23bb9b[_0xcb71('0x87')]()){_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x2ede4c+'\x22');}else{_0x34dcec[_0xcb71('0x1c')](_0xcb71('0x88'));}break;case _0xcb71('0x31'):var _0x50d85f=parseInt(_0x2ede4c);_0x2ede4c=_[_0xcb71('0x89')](_0x50d85f)||_0x50d85f<0x0||_0x50d85f>0x4?_0x442476?0x3:0x2:_0x50d85f;_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x2ede4c+'\x22');break;case _0xcb71('0x32'):var _0x351fc1=parseInt(_0x2ede4c);if(_[_0xcb71('0x8a')](_0x351fc1)&&_[_0xcb71('0x79')](_0xd79ce5,_0x351fc1)){_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x351fc1+'\x22');}else{_0x34dcec[_0xcb71('0x1c')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x2ede4c)){_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x2ede4c+'\x22');}else{_0x34dcec[_0xcb71('0x1c')](_0xcb71('0x8b'));}break;case _0xcb71('0x8c'):var _0x5edcc4=moment(_0x2ede4c,'YYYY-MM-DD',!![]);if(_0x5edcc4[_0xcb71('0x87')]()){_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x2ede4c+'\x22');}else{_0x34dcec[_0xcb71('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0xcb71('0x70'):var _0x34a23e=shared['timezones'];var _0x49e05d=_0x34a23e[_0x2ede4c];if(!_[_0xcb71('0x20')](_0x49e05d)){var _0x1c8c48=_0x49e05d[_0xcb71('0x8d')];_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x2ede4c+'\x22');_0x3b58f1['push']('\x22'+_0x1c8c48+'\x22');}break;default:_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x2ede4c+'\x22');}}else{switch(_0x532dec){case _0xcb71('0x8e'):case'phone':_0x34dcec[_0xcb71('0x1c')](_0x532dec+_0xcb71('0x8f'));break;default:_0x3b58f1[_0xcb71('0x1c')]('\x22\x22');}}}}else{var _0x5d9537='';if(!_['isNil'](_0xc378e9)){if(!_0x5a2f52[_0xcb71('0x83')](_0xc378e9['id'])){if(!_[_0xcb71('0x20')](_0x3e732e[_0xcb71('0x80')][_0x1acae1][_0xc18a[_0x532dec]])){var _0x2ede4c=_[_0xcb71('0x84')](_0x3e732e[_0xcb71('0x80')][_0x1acae1][_0xc18a[_0x532dec]][_0xcb71('0x85')](/"/g,'\x27'));var _0x4743cd=phoneDescriptions['find'](_0x392b3c=>_0x392b3c[_0xcb71('0x90')]===_0xc378e9['id']);if(!_[_0xcb71('0x20')](_0x4743cd)){var _0x7ccdc8=_['trim'](_0x3e732e[_0xcb71('0x80')][_0x1acae1][_0xc18a[_0x4743cd[_0xcb71('0x91')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x7ccdc8))_0x2ede4c=_0x2ede4c+'§'+_0x7ccdc8;}if(_0x5d9537=='')_0x5d9537=_0x2ede4c;else _0x5d9537+='|'+_0x2ede4c;}_0x306915[_0xcb71('0x1c')](_0xc378e9['id']+':'+_0x5d9537);_0x5a2f52[_0xc378e9['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3b58f1[_0xcb71('0x1c')]('\x22'+_0x306915[_0xcb71('0x15')](';')+'\x22');}if(_0x34dcec[_0xcb71('0x1b')]){handleError(_0x3e732e[_0xcb71('0x80')][_0x1acae1],{'code':_0xcb71('0x92'),'message':_0x34dcec[_0xcb71('0x15')]()});}else{fs[_0xcb71('0x93')](_0xa9d644,_0x3b58f1[_0xcb71('0x15')]()+'\x0a');}_0x3b58f1=[];}if(!(stats[_0xcb71('0x81')]%0xc8)){socket[_0xcb71('0x94')](_0xcb71('0x95')+_0x6908ad,stats);stats[_0xcb71('0x5f')]=[];}}if(stopped){logger[_0xcb71('0x5b')](_0xcb71('0x96'));_0x1c1665[_0xcb71('0x97')]();}}catch(_0x57a714){handleError(_0x3e732e[_0xcb71('0x80')][_0x1acae1],{'code':_0xcb71('0x98'),'message':_0x57a714[_0xcb71('0x5d')]});logger[_0xcb71('0x62')](_0xcb71('0x99'),_0x57a714[_0xcb71('0x5d')]);}},'complete':function(){try{var _0x4ce95b=[];var _0x282f16=[];var _0x489317=_0xcb71('0x35');if(_0x36a342['duplicates']&&_0x36a342[_0xcb71('0x9a')][_0xcb71('0x1b')]){_0x489317=_0xcb71('0x9b')+_0x6908ad;_0x4ce95b[_0xcb71('0x1c')](_0xcb71('0x9c')+_0x489317+_0xcb71('0x9d'));}tmp_campaigns=_0xcb71('0x9e')+_0x6908ad;tmp_voice_queues='voice_queues_'+_0x6908ad;_0x282f16[_0xcb71('0x1c')](_0xcb71('0x9c')+tmp_campaigns+_0xcb71('0x9f'));_0x282f16[_0xcb71('0x1c')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0xcb71('0x9f'));BPromise['each'](_0x282f16,handleTZQuery)[_0xcb71('0x1a')](function(_0x3a20f9){updateTzCampaigns(_0x36a342['ListId'])['then'](function(_0x2ca264){updateTzVoiceQueues(_0x36a342['ListId'])[_0xcb71('0x1a')](function(_0x4b9e9f){if(hasTZ)_0x308fda=_0x308fda['replace'](_0xcb71('0x70'),_0xcb71('0xa0'));var _0x4edd80=util[_0xcb71('0xf')](_0xcb71('0xa1'),_0xa9d644,_0x489317,_0x308fda,_0x36a342[_0xcb71('0x2e')],_0x36a342[_0xcb71('0x53')]||null,NOW,NOW);if(_[_0xcb71('0x20')](_0xc18a[_0xcb71('0x86')])){_0x4edd80+=_0xcb71('0xa2');}_0x4ce95b[_0xcb71('0x1c')](_0x4edd80);if(_0x36a342[_0xcb71('0x9a')]&&_0x36a342[_0xcb71('0x9a')][_0xcb71('0x1b')]){_0x4ce95b[_0xcb71('0x1c')](insertCmContact(_0x36a342[_0xcb71('0x2e')],_0x489317,_0x36a342[_0xcb71('0x9a')],_0xc18a));_0x4ce95b['push'](_0xcb71('0xa3')+_0x489317+';');}BPromise[_0xcb71('0xa4')](_0x4ce95b,handleQuery)['then'](function(_0x323b87){BPromise[_0xcb71('0x1d')]([handleAdditionalPhones()])[_0xcb71('0x1a')](function(){_0x4ce95b=[];for(var _0x37cccf=0x0;_0x37cccf\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','sequelize','query','select\x20*\x20from\x20','length','AdditionalPhones','push','all','then','catch','message','split','CmContactHasItem','update','create','PHONE','inserted','CmContact','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','into','cm_hopper','fromQuery','ListId','createdAt','updatedAt','priority','recallme','fields','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','toString','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','insert','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','findAll','name','header','writeFileSync','parse','createReadStream','data','rows','isNil','hasOwnProperty','isValid','isNaN','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','trim','description','replace','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','\x20LIKE\x20cm_contacts;','CIS\x20len','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','scheduledat',',\x20scheduledAt\x20=\x20NOW()','contact','orderBy','each','affectedRows','unlink'];(function(_0x20fadb,_0x11f5b2){var _0x1f4708=function(_0x8ea21e){while(--_0x8ea21e){_0x20fadb['push'](_0x20fadb['shift']());}};_0x1f4708(++_0x11f5b2);}(_0x199d,0x13d));var _0xd199=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0x199d[_0x4ac60a];return _0x4b22e8;};'use strict';var fs=require('fs');var path=require(_0xd199('0x0'));var _=require(_0xd199('0x1'));var Papa=require(_0xd199('0x2'));var util=require(_0xd199('0x3'));var BPromise=require(_0xd199('0x4'));var moment=require('moment');var squel=require(_0xd199('0x5'));var Redis=require('ioredis');var db=require(_0xd199('0x6'))['db'];var config=require(_0xd199('0x7'));var logger=require(_0xd199('0x8'))('import');config[_0xd199('0x9')]=_[_0xd199('0xa')](config['redis'],{'host':_0xd199('0xb'),'port':0x18eb});var socket=require(_0xd199('0xc'))(new Redis(config[_0xd199('0x9')]));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()['format'](_0xd199('0xd'));var tempTableName=_0xd199('0xe')+moment()[_0xd199('0xf')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x44b187){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))*$/[_0xd199('0x10')](_0x44b187);}function selectNotIn(_0x49c25e,_0x32c5bc,_0x58a748,_0x438a3f,_0x98e9af){return squel[_0xd199('0x11')]()[_0xd199('0x12')](_0xd199('0x13'))[_0xd199('0x14')](_0x438a3f)[_0xd199('0x15')](_0x32c5bc,null,_0x32c5bc+_0xd199('0x16')+_0x438a3f+'.'+_0x58a748)[_0xd199('0x17')](_0x438a3f+'.'+_0x58a748+_0xd199('0x18')+_0x49c25e+'.'+_0x58a748)[_0xd199('0x17')](_0x32c5bc+'.dialCheckDuplicateType\x20IN\x20('+_0x98e9af[_0xd199('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5e6160,_0x3568b7){promisesAdditionalPhones=[];promisesContact=[];return db[_0xd199('0x19')][_0xd199('0x1a')](_0xd199('0x1b')+tempTableName)['spread'](function(_0x1e8132){if(_0x1e8132!==null){var _0xe48c1b=[];for(var _0x1251a6=0x0;_0x1251a6<_0x1e8132[_0xd199('0x1c')];_0x1251a6++){var _0x4354d1=_0x1e8132[_0x1251a6];if(!_['isNil'](_0x4354d1[_0xd199('0x13')])){if(!_['isNil'](_0x4354d1[_0xd199('0x1d')]))_0xe48c1b[_0xd199('0x1e')](insertAdditionalPhones(_0x4354d1));promisesContact[_0xd199('0x1e')]({'contact':_0x4354d1});}}}Promise[_0xd199('0x1f')](_0xe48c1b)[_0xd199('0x20')](function(){_0x5e6160({'val':0x1});});})[_0xd199('0x21')](function(_0x2c7fa6){logger['error'](_0x2c7fa6[_0xd199('0x22')]);});});}function insertAdditionalPhones(_0x132733){return new Promise(function(_0xce732f,_0x1a4570){var _0x487ace=_0x132733[_0xd199('0x1d')];if(_['isNil'](_0x487ace))_0x1a4570({'val':0x0});else{var _0x558744=_0x487ace[_0xd199('0x23')](';');var _0x19e6b1=[];orderBy=0x0;for(var _0x102912=0x0;_0x102912<_0x558744['length'];_0x102912++){_0x19e6b1['push'](splitAdditionalPhone(_0x132733['id'],_0x558744[_0x102912]));}Promise[_0xd199('0x1f')](_0x19e6b1)[_0xd199('0x20')](function(){_0xce732f({'val':_0x558744['length']});});}});}function splitAdditionalPhone(_0x3297d6,_0x429a37){return new Promise(function(_0x2d5beb,_0x11a57f){var _0x360753=_0x429a37[_0xd199('0x23')](':');var _0xdb19ca=_0x360753[0x0];var _0x3f5b4c=_0x360753[0x1];if(_0x3f5b4c!==''){var _0x59408c=_0x3f5b4c['split']('|');var _0x5a29cd=[];for(var _0x2dd652=0x0;_0x2dd652<_0x59408c[_0xd199('0x1c')];_0x2dd652++){if(_0x59408c[_0x2dd652]!==''){var _0x9df93b=_['filter'](promisesAdditionalPhones,{'contactId':_0x3297d6,'phone':_0x59408c[_0x2dd652]});if(_0x9df93b['length']==0x0){orderBy++;promisesAdditionalPhones[_0xd199('0x1e')]({'contactId':_0x3297d6,'contactTypeId':_0xdb19ca,'phone':_0x59408c[_0x2dd652],'orderBy':orderBy});}}}_0x2d5beb({'ok':0x1});}else _0x2d5beb({'res':0x0});});}function createAdditionalPhone(_0x46c586,_0x2a3bb4,_0x263390,_0x232b5d){var _0x18f61d='';var _0x3c1269='';var _0x1bcbe1=_0x263390[_0xd199('0x23')]('§');_0x18f61d=_0x1bcbe1[0x0];if(_0x1bcbe1[_0xd199('0x1c')]==0x2)_0x3c1269=_0x1bcbe1[0x1];return new Promise(function(_0x564110,_0x1caa61){return db['CmContactHasItem']['findOne']({'where':{'CmContactId':_0x46c586,'item':_0x18f61d}})[_0xd199('0x20')](function(_0x444380){if(_0x444380){return db[_0xd199('0x24')][_0xd199('0x25')]({'ItemTypeId':_0x2a3bb4,'description':_0x3c1269,'OrderBy':_0x232b5d},{'where':{'CmContactId':_0x46c586,'item':_0x18f61d}})[_0xd199('0x20')](function(_0x364343){_0x564110({'res':'updated'});});}else{return db[_0xd199('0x24')][_0xd199('0x26')]({'CmContactId':_0x46c586,'item':_0x18f61d,'ItemTypeId':_0x2a3bb4,'description':_0x3c1269,'OrderBy':_0x232b5d,'ItemClass':_0xd199('0x27')})[_0xd199('0x20')](function(_0x50ab5b){_0x564110({'res':_0xd199('0x28')});});}});});}function updateContact(_0x13aabd){return new Promise(function(_0x5a9bf4,_0x4df41d){var _0x584af8=_0x13aabd['id'];delete _0x13aabd['id'];return db[_0xd199('0x29')][_0xd199('0x25')](_0x13aabd,{'where':{'id':_0x584af8}})[_0xd199('0x20')](function(_0x542ad9){updatedRows+=0x1;return db['CmHopper'][_0xd199('0x25')]({'phone':_0x13aabd['phone']},{'where':{'ContactId':_0x584af8}})[_0xd199('0x20')](function(_0x31f34d){_0x5a9bf4({'ret':'OK'});});});});}function insertCmHopper(_0x3abae,_0x3a5032,_0x52dac9,_0x2ea308,_0x38a98a){var _0x17c945=[_0xd199('0x2a'),_0xd199('0x2b'),_0xd199('0x2c'),_0xd199('0x2d'),_0x3a5032+'.'+_0x2ea308,_0xd199('0x2e'),'cm_contacts.updatedAt','cm_contacts.priority',_0xd199('0x2f'),'\x22'+_0x38a98a+'\x22'];return squel['insert']()[_0xd199('0x30')](_0xd199('0x31'))[_0xd199('0x32')]([_0xd199('0x13'),'scheduledat','ContactId',_0xd199('0x33'),_0x2ea308,_0xd199('0x34'),_0xd199('0x35'),_0xd199('0x36'),'UserId',_0xd199('0x37')],squel[_0xd199('0x11')]()[_0xd199('0x38')](_0x17c945)[_0xd199('0x14')](_0x3a5032)[_0xd199('0x15')](_0xd199('0x39'),null,_0xd199('0x3a')+_0x3a5032+_0xd199('0x3b'))[_0xd199('0x15')](_0x52dac9,null,_0x52dac9+'.id\x20=\x20'+_0x3a5032+'.'+_0x2ea308)['where'](_0x3a5032+_0xd199('0x3c'),_0x3abae)[_0xd199('0x17')](_0xd199('0x3d'),NOW)[_0xd199('0x17')](_0xd199('0x3e'),selectNotIn(_0x3a5032,_0x52dac9,_0x2ea308,_0xd199('0x31'),[_0xd199('0x3f'),_0xd199('0x40')]))[_0xd199('0x17')](_0xd199('0x3e'),selectNotIn(_0x3a5032,_0x52dac9,_0x2ea308,_0xd199('0x31'),[_0xd199('0x3f')])))[_0xd199('0x41')]();}function insertCmHopperBlack(_0x56208a,_0x97eeae,_0x54dcd4,_0x14874d){var _0x2dbd25=[_0xd199('0x2a'),_0xd199('0x2c'),_0xd199('0x2d'),_0x97eeae+'.'+_0x14874d,_0xd199('0x2e'),'cm_contacts.updatedAt'];return squel['insert']()[_0xd199('0x30')](_0xd199('0x42'))[_0xd199('0x32')]([_0xd199('0x13'),'ContactId',_0xd199('0x33'),_0x14874d,_0xd199('0x34'),_0xd199('0x35')],squel[_0xd199('0x11')]()[_0xd199('0x38')](_0x2dbd25)[_0xd199('0x14')](_0x97eeae)[_0xd199('0x15')]('cm_contacts',null,_0xd199('0x3a')+_0x97eeae+'.CmListId')['join'](_0x54dcd4,null,_0x54dcd4+_0xd199('0x16')+_0x97eeae+'.'+_0x14874d)[_0xd199('0x17')](_0x97eeae+_0xd199('0x3c'),_0x56208a)[_0xd199('0x17')](_0xd199('0x3d'),NOW)['where'](_0xd199('0x3e'),squel[_0xd199('0x11')]()['field'](_0xd199('0x13'))[_0xd199('0x14')]('cm_hopper_black')[_0xd199('0x17')](_0xd199('0x43'),_0x56208a)[_0xd199('0x17')](_0x14874d+_0xd199('0x44'),_0x97eeae+'.'+_0x14874d)))[_0xd199('0x41')]();}function insertCmHopperAdditionalPhones(_0x1f81b4){var _0xcc9ca1=[_0xd199('0x45'),_0xd199('0x46'),_0xd199('0x47'),'cm_contact_has_items.createdAt',_0xd199('0x48')];return squel[_0xd199('0x49')]()[_0xd199('0x30')]('cm_hopper_additional_phones')[_0xd199('0x32')](['CmHopperId',_0xd199('0x13'),_0xd199('0x4a'),'createdAt',_0xd199('0x35')],squel[_0xd199('0x11')]()[_0xd199('0x38')](_0xcc9ca1)['from'](_0xd199('0x31'))[_0xd199('0x15')](_0xd199('0x39'),null,_0xd199('0x4b'))[_0xd199('0x15')](_0xd199('0x4c'),null,_0xd199('0x4d'))[_0xd199('0x17')](_0xd199('0x4e'),_0x1f81b4)[_0xd199('0x17')](_0xd199('0x3d'),NOW))[_0xd199('0x41')]();}function insertCmContact(_0xc8a5d0,_0x465916,_0xeb7da3,_0x21ceeb){var _0x40ddde=_[_0xd199('0x4f')](_[_0xd199('0x50')](_0x21ceeb),[_0xd199('0x33'),_0xd199('0x51'),'createdAt',_0xd199('0x35')]);return squel[_0xd199('0x49')]()[_0xd199('0x30')]('cm_contacts')[_0xd199('0x32')](_0x40ddde,squel['select']()['fields'](_0x40ddde)[_0xd199('0x14')](_0x465916)[_0xd199('0x17')]('('+_0xeb7da3[_0xd199('0x15')](',')+_0xd199('0x52'),squel[_0xd199('0x11')]()[_0xd199('0x38')](_0xeb7da3)[_0xd199('0x14')]('cm_contacts')[_0xd199('0x17')](_0xd199('0x43'),_0xc8a5d0))[_0xd199('0x17')](_0xd199('0x53'),squel[_0xd199('0x11')]()[_0xd199('0x12')]('MIN(id)',_0xd199('0x54'))[_0xd199('0x14')](_0x465916)[_0xd199('0x55')](_0xeb7da3[_0xd199('0x15')](','))))['toString']();}function handleStop(){logger[_0xd199('0x56')](_0xd199('0x57'));stopped=!![];}function handleUncaughtException(_0xa0d838){logger[_0xd199('0x58')](_0xa0d838[_0xd199('0x22')]);process[_0xd199('0x59')](0x1);}function handleError(_0x38e6e7,_0xcaf641){stats[_0xd199('0x5a')][_0xd199('0x1e')]({'name':_0xcaf641[_0xd199('0x5b')],'message':_0xcaf641[_0xd199('0x22')],'row':_0x38e6e7});}function handleQuery(_0x12ae3a){logger[_0xd199('0x56')](_0x12ae3a);return db['sequelize'][_0xd199('0x1a')](_0x12ae3a)['spread'](function(_0x3dd8d4){results[_0xd199('0x1e')](_0x3dd8d4);})[_0xd199('0x21')](function(_0x3e291e){logger[_0xd199('0x58')](_0x3e291e[_0xd199('0x22')]);});}function main(_0x172a68,_0x593f52,_0x599152,_0x1198c8){logger[_0xd199('0x56')]('main',_0x172a68,JSON[_0xd199('0x5c')](_0x593f52));process[_0xd199('0x5d')]('start');var _0x563e68=_0x593f52[_0xd199('0x5e')];var _0x5379ef=_['clone'](_0x563e68);var _0x65317a=_0x593f52[_0xd199('0x5f')];var _0x19dbdb=path[_0xd199('0x15')](config[_0xd199('0x60')],_0xd199('0x61'),_0x65317a+_0xd199('0x62'));logger[_0xd199('0x56')]('body',_0x593f52);db['ContactItemType'][_0xd199('0x63')]({'raw':!![],'attributes':['id','name']})[_0xd199('0x20')](function(_0x4481f0){for(var _0x17d43c=0x0;_0x17d43c<_0x4481f0[_0xd199('0x1c')];_0x17d43c++){if(_0x4481f0[_0x17d43c][_0xd199('0x64')]in _0x563e68){contactItemTypes['push'](_0x4481f0[_0x17d43c]);delete _0x5379ef[_0x4481f0[_0x17d43c][_0xd199('0x64')]];hasAdditionalPhones=!![];}for(var _0x10c518 in _0x563e68){if(_0x4481f0[_0x17d43c][_0xd199('0x64')]+'_description'===_0x10c518){phoneDescriptions[_0xd199('0x1e')]({'itemTypeId':_0x4481f0[_0x17d43c]['id'],'description':_0x10c518});delete _0x5379ef[_0x10c518];}}}if(hasAdditionalPhones)_0x5379ef[_0xd199('0x1d')]='';var _0x120305=_[_0xd199('0x50')](_0x5379ef)['join']();logger['info'](_0xd199('0x65'),_0x120305);fs[_0xd199('0x66')](_0x19dbdb,_0x120305+'\x0a');Papa[_0xd199('0x67')](fs[_0xd199('0x68')](_0x172a68),{'header':!![],'skipEmptyLines':!![],'step':function(_0x40c228,_0x2b2459){try{for(var _0x45ff63=0x0,_0xa865f9=[];_0x45ff63<_0x40c228[_0xd199('0x69')][_0xd199('0x1c')];_0x45ff63++){stats[_0xd199('0x6a')]+=0x1;if(_0x40c228[_0xd199('0x5a')][_0x45ff63]){handleError(_0x40c228[_0xd199('0x69')][_0x45ff63],_0x40c228[_0xd199('0x5a')][_0x45ff63]);}else{var _0x47d716=[];var _0x25257b=[];var _0x569792={};for(var _0x15a83c in _0x563e68){let _0x58c09c=contactItemTypes['find'](_0x2ad791=>_0x2ad791['name']===_0x15a83c);let _0x12cb71=contactItemTypes['find'](_0x7d8a18=>_0x7d8a18[_0xd199('0x64')]+'_description'===_0x15a83c);if(_[_0xd199('0x6b')](_0x58c09c)&&_[_0xd199('0x6b')](_0x12cb71)){if(_0x563e68[_0xd199('0x6c')](_0x15a83c)){if(_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x15a83c]]){var _0x30c6c4=_['trim'](_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x15a83c]]['replace'](/"/g,'\x27'));switch(_0x15a83c){case'scheduledat':var _0x4cf1e6=moment(_0x30c6c4,_0xd199('0xd'),!![]);if(_0x4cf1e6[_0xd199('0x6d')]()){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}else{_0x47d716['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xd199('0x36'):var _0x44db8f=parseInt(_0x30c6c4);_0x30c6c4=_[_0xd199('0x6e')](_0x44db8f)||_0x44db8f<0x0||_0x44db8f>0x4?_0x1198c8?0x3:0x2:_0x44db8f;_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');break;case _0xd199('0x6f'):var _0x1105c0=parseInt(_0x30c6c4);if(_[_0xd199('0x70')](_0x1105c0)&&_[_0xd199('0x71')](_0x599152,_0x1105c0)){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x1105c0+'\x22');}else{_0x47d716[_0xd199('0x1e')](_0xd199('0x72'));}break;case _0xd199('0x73'):if(isEmail(_0x30c6c4)){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}else{_0x47d716[_0xd199('0x1e')](_0xd199('0x74'));}break;case _0xd199('0x75'):var _0x1952fd=moment(_0x30c6c4,'YYYY-MM-DD',!![]);if(_0x1952fd[_0xd199('0x6d')]()){_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}else{_0x47d716[_0xd199('0x1e')](_0xd199('0x76'));}break;default:_0xa865f9[_0xd199('0x1e')]('\x22'+_0x30c6c4+'\x22');}}else{switch(_0x15a83c){case _0xd199('0x77'):case'phone':_0x47d716[_0xd199('0x1e')](_0x15a83c+_0xd199('0x78'));break;default:_0xa865f9[_0xd199('0x1e')]('\x22\x22');}}}}else{var _0x164793='';if(!_['isNil'](_0x58c09c)){if(!_0x569792[_0xd199('0x6c')](_0x58c09c['id'])){for(var _0x1211d7=0x0;_0x1211d7<_0x563e68[_0x15a83c][_0xd199('0x1c')];_0x1211d7++){var _0x30c6c4=_['trim'](_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x15a83c][_0x1211d7]]['replace'](/"/g,'\x27'));var _0x1214dc=phoneDescriptions['find'](_0x328cfb=>_0x328cfb[_0xd199('0x79')]===_0x58c09c['id']);if(!_[_0xd199('0x6b')](_0x1214dc)){var _0x54a4ef=_[_0xd199('0x7a')](_0x40c228[_0xd199('0x69')][_0x45ff63][_0x563e68[_0x1214dc[_0xd199('0x7b')]][0x0]][_0xd199('0x7c')](/"/g,'\x27'));if(!_[_0xd199('0x6b')](_0x54a4ef))_0x30c6c4=_0x30c6c4+'§'+_0x54a4ef;}if(_0x164793=='')_0x164793=_0x30c6c4;else _0x164793+='|'+_0x30c6c4;}_0x25257b[_0xd199('0x1e')](_0x58c09c['id']+':'+_0x164793);_0x569792[_0x58c09c['id']]=0x1;}}}}if(hasAdditionalPhones){_0xa865f9['push']('\x22'+_0x25257b[_0xd199('0x15')](';')+'\x22');}if(_0x47d716[_0xd199('0x1c')]){handleError(_0x40c228[_0xd199('0x69')][_0x45ff63],{'code':_0xd199('0x7d'),'message':_0x47d716[_0xd199('0x15')]()});}else{fs[_0xd199('0x7e')](_0x19dbdb,_0xa865f9['join']()+'\x0a');}_0xa865f9=[];}if(!(stats['rows']%0xc8)){socket[_0xd199('0x7f')](_0xd199('0x80')+_0x65317a,stats);stats[_0xd199('0x5a')]=[];}}if(stopped){logger['info'](_0xd199('0x81'));_0x2b2459['abort']();}}catch(_0x512f00){handleError(_0x40c228[_0xd199('0x69')][_0x45ff63],{'code':_0xd199('0x82'),'message':_0x512f00[_0xd199('0x22')]});logger[_0xd199('0x58')](_0xd199('0x83'),_0x512f00[_0xd199('0x22')]);}},'complete':function(){try{var _0x2d9624=[];var _0x45a92d=tempTableName;_0x2d9624[_0xd199('0x1e')]('CREATE\x20TABLE\x20'+_0x45a92d+_0xd199('0x84'));logger['info'](_0xd199('0x85'),contactItemTypes[_0xd199('0x1c')]);var _0x29388c=util[_0xd199('0xf')](_0xd199('0x86'),_0x19dbdb,_0x45a92d,_0x120305,_0x593f52['ListId'],_0x593f52['CompanyId']||null,NOW,NOW);if(_[_0xd199('0x6b')](_0x563e68[_0xd199('0x87')])){_0x29388c+=_0xd199('0x88');}_0x2d9624['push'](_0x29388c);BPromise['each'](_0x2d9624,handleQuery)['then'](function(_0x16f184){BPromise[_0xd199('0x1f')]([handleAdditionalPhones()])[_0xd199('0x20')](function(){_0x2d9624=[];for(var _0xd23b5a=0x0;_0xd23b5a_0x4b6866[_0xd38f('0x69')]===_0x7dbf86);let _0x5b5834=contactItemTypes[_0xd38f('0x6d')](_0x2f7fff=>_0x2f7fff[_0xd38f('0x69')]+'_description'===_0x7dbf86);if(_['isNil'](_0x390510)&&_[_0xd38f('0x1b')](_0x5b5834)){if(_0x36235b[_0xd38f('0x6e')](_0x7dbf86)){if(_0x6981e7['data'][_0x144d7b][_0x36235b[_0x7dbf86]]){var _0x39120f=_['trim'](_0x6981e7[_0xd38f('0x6b')][_0x144d7b][_0x36235b[_0x7dbf86]][_0xd38f('0x6f')](/"/g,'\x27'));switch(_0x7dbf86){case _0xd38f('0x32'):var _0x360651=moment(_0x39120f,_0xd38f('0xd'),!![]);if(_0x360651[_0xd38f('0x70')]()){_0x42632b[_0xd38f('0x1d')]('\x22'+_0x39120f+'\x22');}else{_0xbcbcd2['push'](_0xd38f('0x71'));}break;case _0xd38f('0x35'):var _0x2996ce=parseInt(_0x39120f);_0x39120f=_[_0xd38f('0x72')](_0x2996ce)||_0x2996ce<0x0||_0x2996ce>0x4?_0x4dc302?0x3:0x2:_0x2996ce;_0x42632b[_0xd38f('0x1d')]('\x22'+_0x39120f+'\x22');break;case _0xd38f('0x73'):var _0x568d55=parseInt(_0x39120f);if(_[_0xd38f('0x74')](_0x568d55)&&_[_0xd38f('0x75')](_0x3d03e3,_0x568d55)){_0x42632b[_0xd38f('0x1d')]('\x22'+_0x568d55+'\x22');}else{_0xbcbcd2[_0xd38f('0x1d')](_0xd38f('0x76'));}break;case _0xd38f('0x77'):if(isEmail(_0x39120f)){_0x42632b[_0xd38f('0x1d')]('\x22'+_0x39120f+'\x22');}else{_0xbcbcd2[_0xd38f('0x1d')](_0xd38f('0x78'));}break;case _0xd38f('0x79'):var _0x2a08ba=moment(_0x39120f,_0xd38f('0x7a'),!![]);if(_0x2a08ba[_0xd38f('0x70')]()){_0x42632b[_0xd38f('0x1d')]('\x22'+_0x39120f+'\x22');}else{_0xbcbcd2['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x42632b[_0xd38f('0x1d')]('\x22'+_0x39120f+'\x22');}}else{switch(_0x7dbf86){case _0xd38f('0x7b'):case'phone':_0xbcbcd2[_0xd38f('0x1d')](_0x7dbf86+'\x20not\x20specified');break;default:_0x42632b[_0xd38f('0x1d')]('\x22\x22');}}}}else{var _0x3f055b='';if(!_['isNil'](_0x390510)){if(!_0x20a3af[_0xd38f('0x6e')](_0x390510['id'])){for(var _0x1bbaa8=0x0;_0x1bbaa8<_0x36235b[_0x7dbf86][_0xd38f('0x1a')];_0x1bbaa8++){var _0x39120f=_[_0xd38f('0x7c')](_0x6981e7[_0xd38f('0x6b')][_0x144d7b][_0x36235b[_0x7dbf86][_0x1bbaa8]][_0xd38f('0x6f')](/"/g,'\x27'));var _0x2b4f9a=phoneDescriptions['find'](_0x18f4cb=>_0x18f4cb[_0xd38f('0x7d')]===_0x390510['id']);if(!_[_0xd38f('0x1b')](_0x2b4f9a)){var _0x41f3a3=_[_0xd38f('0x7c')](_0x6981e7[_0xd38f('0x6b')][_0x144d7b][_0x36235b[_0x2b4f9a['description']][0x0]][_0xd38f('0x6f')](/"/g,'\x27'));if(!_[_0xd38f('0x1b')](_0x41f3a3))_0x39120f=_0x39120f+'§'+_0x41f3a3;}if(_0x3f055b=='')_0x3f055b=_0x39120f;else _0x3f055b+='|'+_0x39120f;}_0x4248a9[_0xd38f('0x1d')](_0x390510['id']+':'+_0x3f055b);_0x20a3af[_0x390510['id']]=0x1;}}}}if(hasAdditionalPhones){_0x42632b[_0xd38f('0x1d')]('\x22'+_0x4248a9[_0xd38f('0x16')](';')+'\x22');}if(_0xbcbcd2[_0xd38f('0x1a')]){handleError(_0x6981e7[_0xd38f('0x6b')][_0x144d7b],{'code':'SystemRow','message':_0xbcbcd2[_0xd38f('0x16')]()});}else{fs['appendFileSync'](_0x4854f6,_0x42632b[_0xd38f('0x16')]()+'\x0a');}_0x42632b=[];}if(!(stats[_0xd38f('0x6c')]%0xc8)){socket[_0xd38f('0x7e')](_0xd38f('0x7f')+_0x1f2646,stats);stats[_0xd38f('0x5c')]=[];}}if(stopped){logger[_0xd38f('0x58')]('Abort\x20parser');_0xfd42fd['abort']();}}catch(_0x454998){handleError(_0x6981e7[_0xd38f('0x6b')][_0x144d7b],{'code':_0xd38f('0x80'),'message':_0x454998[_0xd38f('0x21')]});logger[_0xd38f('0x5a')](_0xd38f('0x81'),_0x454998[_0xd38f('0x21')]);}},'complete':function(){try{var _0x53b1ec=[];var _0x98ddd2=tempTableName;_0x53b1ec[_0xd38f('0x1d')](_0xd38f('0x82')+_0x98ddd2+'\x20LIKE\x20cm_contacts;');logger['info'](_0xd38f('0x83'),contactItemTypes[_0xd38f('0x1a')]);var _0x4a10ec=util['format'](_0xd38f('0x84'),_0x4854f6,_0x98ddd2,_0xa43962,_0x50386d[_0xd38f('0x41')],_0x50386d[_0xd38f('0x51')]||null,NOW,NOW);if(_[_0xd38f('0x1b')](_0x36235b[_0xd38f('0x32')])){_0x4a10ec+=',\x20scheduledAt\x20=\x20NOW()';}_0x53b1ec[_0xd38f('0x1d')](_0x4a10ec);BPromise['each'](_0x53b1ec,handleQuery)[_0xd38f('0x1f')](function(_0x1f22b6){BPromise[_0xd38f('0x1e')]([handleAdditionalPhones()])[_0xd38f('0x1f')](function(){_0x53b1ec=[];for(var _0xa522b2=0x0;_0xa522b2\x20\x20');}var _0x2c7e3a=path['join'](config['root'],_0xd38f('0x64'),process['argv'][0x2]);if(!fs[_0xd38f('0x8e')](_0x2c7e3a)){throw new Error(_0xd38f('0x8f'));}var _0x470008={};try{_0x470008=JSON['parse'](process['argv'][0x3]);if(!_0x470008[_0xd38f('0x90')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0x1010ed=0x0;if(_0x470008['binding'][_0xd38f('0x73')]){_0x1010ed=0x1;}if(!_0x470008[_0xd38f('0x41')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0xcf7781){throw new Error(_0xd38f('0x91'));}var _0x23f0b7=[];try{_0x23f0b7=_['map'](JSON['parse'](process[_0xd38f('0x8d')][0x4]),'id');}catch(_0x945cb5){logger[_0xd38f('0x58')](_0xd38f('0x92'));}main(_0x2c7e3a,_0x470008,_0x23f0b7,_0x1010ed);}validate();process['on']('SIGINT',handleStop);process['on'](_0xd38f('0x93'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 5df7b22..8789df5 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff79=['voice','inbound','push','variable','calleridnum','outbound','destcalleridnum','keyValue','Caller\x20Number','Caller\x20Name','queue','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','membername','UniqueId','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase'];(function(_0xb4244e,_0xed0ddf){var _0x69db99=function(_0x885177){while(--_0x885177){_0xb4244e['push'](_0xb4244e['shift']());}};_0x69db99(++_0xed0ddf);}(_0xff79,0x9d));var _0x9ff7=function(_0x59e3be,_0x1c8d31){_0x59e3be=_0x59e3be-0x0;var _0x2faba2=_0xff79[_0x59e3be];return _0x2faba2;};'use strict';exports['getSubjects']=function(_0x4cfc50,_0x35b854){var _0x744df3=[{'type':_0x9ff7('0x0'),'content':_0x9ff7('0x1'),'variableName':null}];switch(_0x4cfc50[_0x9ff7('0x2')]()){case _0x9ff7('0x3'):switch(_0x35b854[_0x9ff7('0x2')]()){case _0x9ff7('0x4'):_0x744df3[_0x9ff7('0x5')]({'type':'variable','content':'','variableName':'queue'});_0x744df3[_0x9ff7('0x5')]({'type':_0x9ff7('0x6'),'content':'','variableName':_0x9ff7('0x7')});break;case _0x9ff7('0x8'):_0x744df3[_0x9ff7('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0x744df3['push']({'type':_0x9ff7('0x6'),'content':'','variableName':_0x9ff7('0x9')});break;}}return _0x744df3;};exports['getDescriptions']=function(_0xf72302,_0x115243){var _0x156e2=[];switch(_0xf72302[_0x9ff7('0x2')]()){case'voice':switch(_0x115243[_0x9ff7('0x2')]()){case'inbound':_0x156e2=[{'type':_0x9ff7('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0xb'),'keyType':_0x9ff7('0x6'),'variableName':_0x9ff7('0x7')},{'type':'keyValue','content':'','key':_0x9ff7('0xc'),'keyType':_0x9ff7('0x6'),'variableName':'calleridname'},{'type':_0x9ff7('0xa'),'content':'','key':'Call\x20To','keyType':'variable','variableName':'destexten'},{'type':_0x9ff7('0xa'),'content':'','key':'Queue','keyType':'variable','variableName':_0x9ff7('0xd')},{'type':_0x9ff7('0xa'),'content':'','key':'UniqueId','keyType':_0x9ff7('0x6'),'variableName':'uniqueid'},{'type':_0x9ff7('0xa'),'content':'','key':'Date','keyType':'variable','variableName':_0x9ff7('0xe')},{'type':'string','content':_0x9ff7('0xf'),'key':null,'keyType':null,'variableName':null},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x10'),'keyType':_0x9ff7('0x6'),'variableName':_0x9ff7('0x11')},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x12'),'keyType':_0x9ff7('0x6'),'variableName':_0x9ff7('0x9')},{'type':_0x9ff7('0x0'),'content':_0x9ff7('0x13'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x9ff7('0x14'),'keyType':_0x9ff7('0x6'),'variableName':_0x9ff7('0xe')},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x15'),'keyType':'variable','variableName':_0x9ff7('0x16')},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x17'),'keyType':'variable','variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0x9ff7('0x6'),'variableName':_0x9ff7('0x18')},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x19'),'keyType':'variable','variableName':_0x9ff7('0x1a')}];break;case'outbound':_0x156e2=[{'type':_0x9ff7('0x0'),'content':_0x9ff7('0x1b'),'variableName':null},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x1c'),'keyType':_0x9ff7('0x6'),'keyContent':'','variableName':_0x9ff7('0x9')},{'type':_0x9ff7('0xa'),'content':'','key':'Member\x20Name','keyType':_0x9ff7('0x6'),'keyContent':'','variableName':_0x9ff7('0x1d')},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x9ff7('0x1f')},{'type':'keyValue','content':'','key':'Date','keyType':_0x9ff7('0x6'),'keyContent':'','variableName':_0x9ff7('0x20')},{'type':_0x9ff7('0x0'),'content':_0x9ff7('0x13')},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x21'),'keyType':'variable','keyContent':'','variableName':_0x9ff7('0x22')},{'type':_0x9ff7('0xa'),'content':'','key':_0x9ff7('0x23'),'keyType':_0x9ff7('0x6'),'keyContent':'','variableName':_0x9ff7('0x24')},{'type':_0x9ff7('0xa'),'content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x9ff7('0x25')},{'type':'keyValue','content':'','key':_0x9ff7('0x26'),'keyType':_0x9ff7('0x6'),'keyContent':'','variableName':_0x9ff7('0x27')}];break;}}return _0x156e2;}; \ No newline at end of file +var _0x70a3=['***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','push','variable','queue','calleridnum','outbound','destcalleridnum','voice','inbound','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','holdtime','Talk\x20Time','talktime','Called\x20Number','membername'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x70a3,0x1da));var _0x370a=function(_0x311599,_0x1f9944){_0x311599=_0x311599-0x0;var _0x19b81c=_0x70a3[_0x311599];return _0x19b81c;};'use strict';exports['getSubjects']=function(_0x302dbd,_0xb77555){var _0x4c2042=[{'type':_0x370a('0x0'),'content':_0x370a('0x1'),'variableName':null}];switch(_0x302dbd['toLowerCase']()){case'voice':switch(_0xb77555[_0x370a('0x2')]()){case'inbound':_0x4c2042[_0x370a('0x3')]({'type':_0x370a('0x4'),'content':'','variableName':_0x370a('0x5')});_0x4c2042[_0x370a('0x3')]({'type':_0x370a('0x4'),'content':'','variableName':_0x370a('0x6')});break;case _0x370a('0x7'):_0x4c2042[_0x370a('0x3')]({'type':_0x370a('0x0'),'content':'Outbound\x20Call','variableName':null});_0x4c2042[_0x370a('0x3')]({'type':_0x370a('0x4'),'content':'','variableName':_0x370a('0x8')});break;}}return _0x4c2042;};exports['getDescriptions']=function(_0x1245ae,_0x3b06ff){var _0x2f32f8=[];switch(_0x1245ae[_0x370a('0x2')]()){case _0x370a('0x9'):switch(_0x3b06ff['toLowerCase']()){case _0x370a('0xa'):_0x2f32f8=[{'type':_0x370a('0x0'),'content':_0x370a('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x370a('0xc'),'keyType':_0x370a('0x4'),'variableName':_0x370a('0x6')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0xe'),'keyType':'variable','variableName':'calleridname'},{'type':'keyValue','content':'','key':_0x370a('0xf'),'keyType':_0x370a('0x4'),'variableName':_0x370a('0x10')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x11'),'keyType':'variable','variableName':_0x370a('0x5')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x12'),'keyType':_0x370a('0x4'),'variableName':_0x370a('0x13')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x14'),'keyType':_0x370a('0x4'),'variableName':_0x370a('0x15')},{'type':_0x370a('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x16'),'keyType':'variable','variableName':_0x370a('0x17')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x18'),'keyType':'variable','variableName':'destcalleridnum'},{'type':_0x370a('0x0'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x19'),'keyType':_0x370a('0x4'),'variableName':_0x370a('0x15')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x1a'),'keyType':_0x370a('0x4'),'variableName':_0x370a('0x1b')},{'type':_0x370a('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x370a('0x4'),'variableName':'agentcompleteAt'},{'type':_0x370a('0xd'),'content':'','key':'Hold\x20Time','keyType':_0x370a('0x4'),'variableName':_0x370a('0x1c')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x1d'),'keyType':_0x370a('0x4'),'variableName':_0x370a('0x1e')}];break;case _0x370a('0x7'):_0x2f32f8=[{'type':_0x370a('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x1f'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x370a('0xd'),'content':'','key':'Member\x20Name','keyType':_0x370a('0x4'),'keyContent':'','variableName':_0x370a('0x20')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x12'),'keyType':_0x370a('0x4'),'keyContent':'','variableName':_0x370a('0x13')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x14'),'keyType':_0x370a('0x4'),'keyContent':'','variableName':'starttime'},{'type':_0x370a('0x0'),'content':_0x370a('0x21')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x22'),'keyType':_0x370a('0x4'),'keyContent':'','variableName':_0x370a('0x23')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x24'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':_0x370a('0xd'),'content':'','key':'Duration','keyType':_0x370a('0x4'),'keyContent':'','variableName':_0x370a('0x25')},{'type':_0x370a('0xd'),'content':'','key':_0x370a('0x26'),'keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x2f32f8;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 3430572..75136c9 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e75=['parseAdvancedSearchFilter','parseQueryParameters','then','where','default','fields','filter','user','having','read','group','i.id','ids','tag','countFilteredInteractions','count','length','clause','contactName','order','DESC','closed','getClosedOrderClause','getFilteredInteractions','catch','tracked','clone','body','omit','html','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','search'];(function(_0x2f279c,_0x62e591){var _0x2e9122=function(_0x27a125){while(--_0x27a125){_0x2f279c['push'](_0x2f279c['shift']());}};_0x2e9122(++_0x62e591);}(_0x3e75,0x161));var _0x53e7=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x3e75[_0x49aa7d];return _0xdd0d26;};'use strict';var _=require(_0x53e7('0x0'));var sqlUtils=require(_0x53e7('0x1'));var utils=require(_0x53e7('0x2'));exports[_0x53e7('0x3')]=function(_0x1e1c3f,_0x3d4360,_0x1910a8,_0xf8067b,_0x59d701){var _0x499b06={'count':0x0,'rows':[]};var _0x2a0ec8=sqlUtils[_0x53e7('0x4')](_0x1e1c3f,_0x1910a8,_0x3d4360);if(_0x2a0ec8){return Promise[_0x53e7('0x5')](_0x499b06);}var _0x1230f5=sqlUtils['getInteractionsQuery'](_0x1e1c3f);var _0xa0e3c5={};return Promise[_0x53e7('0x5')]()['then'](function(){if(_0x3d4360[_0x53e7('0x6')]){return sqlUtils[_0x53e7('0x7')](_0x3d4360[_0x53e7('0x6')],_0x59d701);}else{return sqlUtils[_0x53e7('0x8')](_0x1e1c3f,_0x3d4360,_0x59d701);}})[_0x53e7('0x9')](function(_0x5d7f1a){_0x1230f5[_0x53e7('0xa')](_0x5d7f1a['body']);_0x1230f5[_0x53e7('0xa')](_0x5d7f1a['contact']);_0x1230f5[_0x53e7('0xa')](_0x5d7f1a[_0x53e7('0xb')]);_0x1230f5['where'](_0x5d7f1a[_0x53e7('0xc')]);_0x1230f5[_0x53e7('0xa')](_0x5d7f1a[_0x53e7('0xd')]);_0x1230f5[_0x53e7('0xa')](_0x5d7f1a[_0x53e7('0xe')]);_0x1230f5[_0x53e7('0xf')](_0x5d7f1a[_0x53e7('0x10')]);_0xa0e3c5=_0x5d7f1a['tags'];return sqlUtils['checkAccountsRestrictions'](_0x1e1c3f,_0x1910a8,_0x3d4360);})[_0x53e7('0x9')](function(_0x435b1b){_0x1230f5[_0x53e7('0xa')](_0x435b1b);_0x1230f5[_0x53e7('0x11')](_0x53e7('0x12'));var _0x1a1ee1=_0x3d4360[_0x53e7('0x6')]?_0xa0e3c5[_0x53e7('0x13')]:_0x3d4360[_0x53e7('0x14')];return sqlUtils[_0x53e7('0x15')](_0x1230f5,_0x1a1ee1);})['then'](function(_0x798743){_0x499b06[_0x53e7('0x16')]=_0x798743[_0x53e7('0x17')];if(_0x499b06[_0x53e7('0x16')]===0x0){return[];}_0x1230f5[_0x53e7('0xf')](_0xa0e3c5[_0x53e7('0x18')]);if(_0xf8067b['order']){_0xf8067b['order']['forEach'](function(_0x30f007){var _0x100669=_0x30f007[0x0]===_0x53e7('0x19')?_0x30f007[0x0]:'i.'+_0x30f007[0x0];_0x1230f5[_0x53e7('0x1a')](_0x100669,_0x30f007[0x1]===_0x53e7('0x1b')?![]:!![]);if(_0x30f007[0x0]===_0x53e7('0x1c')){var _0x48e76b=sqlUtils[_0x53e7('0x1d')](_0x1e1c3f,_0x3d4360);_0x1230f5[_0x53e7('0x1a')](_0x48e76b,_0x30f007[0x1]===_0x53e7('0x1b')?![]:!![]);}});}return sqlUtils[_0x53e7('0x1e')](_0x1e1c3f,_0x1230f5,_0x3d4360,_0xf8067b);})['then'](function(_0xf98b42){_0x499b06['rows']=_0xf98b42;return _0x499b06;})[_0x53e7('0x1f')](function(_0x48d8da){throw _0x48d8da;});};exports[_0x53e7('0x20')]=function(_0x3d3e3d,_0x375b6c){return function(_0x2d8d82,_0x626b5a,_0xacb023){var _0x56b314=_0x2d8d82[_0x53e7('0xe')];var _0x3a35bd={};var _0x42b6dc=_0x2d8d82['query'];if(_0x3a35bd){_0x3a35bd=_[_0x53e7('0x21')](_0x2d8d82[_0x53e7('0x22')]);_0x3a35bd=_[_0x53e7('0x23')](_0x3a35bd,[_0x53e7('0x22'),_0x53e7('0x24'),'phone',_0x53e7('0x25'),_0x53e7('0x26')]);}utils[_0x53e7('0x27')](_0x56b314,_0x3a35bd,_0x42b6dc,_0x3d3e3d,_0x375b6c);_0xacb023(null);};}; \ No newline at end of file +var _0xdd15=['order','forEach','contactName','DESC','closed','getClosedOrderClause','rows','catch','tracked','body','html','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','parseAdvancedSearchFilter','search','parseQueryParameters','where','contact','default','fields','user','tags','checkAccountsRestrictions','group','ids','tag','countFilteredInteractions','count','length','having','clause'];(function(_0x13852b,_0x725eb3){var _0x506ca1=function(_0x72e0c8){while(--_0x72e0c8){_0x13852b['push'](_0x13852b['shift']());}};_0x506ca1(++_0x725eb3);}(_0xdd15,0x1d2));var _0x5dd1=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xdd15[_0x3430aa];return _0x2ac5c;};'use strict';var _=require(_0x5dd1('0x0'));var sqlUtils=require(_0x5dd1('0x1'));var utils=require(_0x5dd1('0x2'));exports[_0x5dd1('0x3')]=function(_0x573597,_0x4cb035,_0x454ebb,_0x2377c7,_0x58906e){var _0x506bff={'count':0x0,'rows':[]};var _0x30a724=sqlUtils[_0x5dd1('0x4')](_0x573597,_0x454ebb,_0x4cb035);if(_0x30a724){return Promise[_0x5dd1('0x5')](_0x506bff);}var _0x263cc8=sqlUtils[_0x5dd1('0x6')](_0x573597);var _0x4617c3={};return Promise[_0x5dd1('0x5')]()[_0x5dd1('0x7')](function(){if(_0x4cb035['search']){return sqlUtils[_0x5dd1('0x8')](_0x4cb035[_0x5dd1('0x9')],_0x58906e);}else{return sqlUtils[_0x5dd1('0xa')](_0x573597,_0x4cb035,_0x58906e);}})[_0x5dd1('0x7')](function(_0x140032){_0x263cc8[_0x5dd1('0xb')](_0x140032['body']);_0x263cc8[_0x5dd1('0xb')](_0x140032[_0x5dd1('0xc')]);_0x263cc8[_0x5dd1('0xb')](_0x140032[_0x5dd1('0xd')]);_0x263cc8[_0x5dd1('0xb')](_0x140032[_0x5dd1('0xe')]);_0x263cc8['where'](_0x140032['filter']);_0x263cc8[_0x5dd1('0xb')](_0x140032[_0x5dd1('0xf')]);_0x263cc8['having'](_0x140032['read']);_0x4617c3=_0x140032[_0x5dd1('0x10')];return sqlUtils[_0x5dd1('0x11')](_0x573597,_0x454ebb,_0x4cb035);})[_0x5dd1('0x7')](function(_0x5bacb2){_0x263cc8[_0x5dd1('0xb')](_0x5bacb2);_0x263cc8[_0x5dd1('0x12')]('i.id');var _0x47765b=_0x4cb035[_0x5dd1('0x9')]?_0x4617c3[_0x5dd1('0x13')]:_0x4cb035[_0x5dd1('0x14')];return sqlUtils[_0x5dd1('0x15')](_0x263cc8,_0x47765b);})[_0x5dd1('0x7')](function(_0x244bfb){_0x506bff[_0x5dd1('0x16')]=_0x244bfb[_0x5dd1('0x17')];if(_0x506bff[_0x5dd1('0x16')]===0x0){return[];}_0x263cc8[_0x5dd1('0x18')](_0x4617c3[_0x5dd1('0x19')]);if(_0x2377c7[_0x5dd1('0x1a')]){_0x2377c7[_0x5dd1('0x1a')][_0x5dd1('0x1b')](function(_0x51e912){var _0x53cc4b=_0x51e912[0x0]===_0x5dd1('0x1c')?_0x51e912[0x0]:'i.'+_0x51e912[0x0];_0x263cc8[_0x5dd1('0x1a')](_0x53cc4b,_0x51e912[0x1]===_0x5dd1('0x1d')?![]:!![]);if(_0x51e912[0x0]===_0x5dd1('0x1e')){var _0x1e75d9=sqlUtils[_0x5dd1('0x1f')](_0x573597,_0x4cb035);_0x263cc8['order'](_0x1e75d9,_0x51e912[0x1]===_0x5dd1('0x1d')?![]:!![]);}});}return sqlUtils['getFilteredInteractions'](_0x573597,_0x263cc8,_0x4cb035,_0x2377c7);})[_0x5dd1('0x7')](function(_0x31f3bf){_0x506bff[_0x5dd1('0x20')]=_0x31f3bf;return _0x506bff;})[_0x5dd1('0x21')](function(_0x442e34){throw _0x442e34;});};exports[_0x5dd1('0x22')]=function(_0x3146f7,_0x5b0c77){return function(_0x459758,_0x24d887,_0x50e5f5){var _0x2294cf=_0x459758['user'];var _0x5af0a5={};var _0x185dd7=_0x459758['query'];if(_0x5af0a5){_0x5af0a5=_['clone'](_0x459758[_0x5dd1('0x23')]);_0x5af0a5=_['omit'](_0x5af0a5,[_0x5dd1('0x23'),_0x5dd1('0x24'),_0x5dd1('0x25'),_0x5dd1('0x26'),_0x5dd1('0x27')]);}utils[_0x5dd1('0x28')](_0x2294cf,_0x5af0a5,_0x185dd7,_0x3146f7,_0x5b0c77);_0x50e5f5(null);};}; \ No newline at end of file diff --git a/server/components/interaction/sql-utils.js b/server/components/interaction/sql-utils.js index ff2d6fe..7b0dfc9 100644 --- a/server/components/interaction/sql-utils.js +++ b/server/components/interaction/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42c1=['MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','name','buildExpression','text','value','start','unreadMessages','Contact','operator','$substring','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','end','tags','clause','and','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','body','plainBody','keys','some','compact','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','tag','filter','chat','Websites','Accounts','agent','\x20IS\x20NOT\x20NULL','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','capitalize','Interaction','Sequelize','QueryTypes','SELECT','sequelize','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.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.closed','i.lastMsgAt','i.subject','i.secondDisposition','i.thirdDisposition','i.to','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.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','Setting','findOne','enableEmailPreview','all','clone','exports','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','search','select','field','from','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','ui.','left_join','users','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?'];(function(_0x472bc0,_0x2918f1){var _0x19e4b2=function(_0x1e304f){while(--_0x1e304f){_0x472bc0['push'](_0x472bc0['shift']());}};_0x19e4b2(++_0x2918f1);}(_0x42c1,0x1bc));var _0x142c=function(_0x48dfb8,_0x2a7d76){_0x48dfb8=_0x48dfb8-0x0;var _0xe1547b=_0x42c1[_0x48dfb8];return _0xe1547b;};'use strict';var _=require('lodash');var squel=require(_0x142c('0x0'));var as=require(_0x142c('0x1'));var qs=require(_0x142c('0x2'));var updateInteraction=require('./update-interaction')[_0x142c('0x3')];var utils=require(_0x142c('0x4'));var db=require(_0x142c('0x5'))['db'];function skipInteractionsQuery(_0x3dd5ba,_0x275e69,_0x2a2d47){var _0x382cec=![];var _0x3053a1=utils[_0x142c('0x6')](_0x3dd5ba);if(_0x275e69[_0x142c('0x7')]==='agent'&&!_0x2a2d47[_0x142c('0x8')]&&!_0x2a2d47[_0x3053a1]){_0x382cec=!![];}return _0x382cec;}function getTagsQuery(){return squel[_0x142c('0x9')]()[_0x142c('0xa')]('id')[_0x142c('0xa')]('name')['field']('color')[_0x142c('0xb')](_0x142c('0xc'));}function getUsersQuery(_0x20fee3,_0xf6c50f){var _0x270dfa=utils[_0x142c('0xd')](_0x20fee3);var _0x1ab590=_0x142c('0xe')+_0x20fee3+'_interactions';var _0x33fb22=squel['select']()[_0x142c('0xa')](_0x142c('0xf'))[_0x142c('0xa')](_0x142c('0x10'))[_0x142c('0xa')](_0x142c('0x11')+_0x270dfa)[_0x142c('0xb')](_0x1ab590,'ui')[_0x142c('0x12')](_0x142c('0x13'),'u','u.id\x20=\x20ui.UserId');if(_0xf6c50f[_0x142c('0x14')]>0x0){_0x33fb22[_0x142c('0x15')](_0x142c('0x11')+_0x270dfa+_0x142c('0x16'),_[_0x142c('0x17')](_0xf6c50f,'id'));}return _0x33fb22;}function getInteractionsQuery(_0x4ef47e){var _0x3ea5b1=utils[_0x142c('0x18')](_0x4ef47e);var _0x3a2728=utils['getAccountFK'](_0x4ef47e);var _0x40c8b5=utils[_0x142c('0xd')](_0x4ef47e);return squel[_0x142c('0x9')]()[_0x142c('0xb')](_0x3ea5b1[_0x142c('0x19')],'i')[_0x142c('0x12')](_0x142c('0x1a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x142c('0x12')]('users','o',_0x142c('0x1b'))[_0x142c('0x12')](_0x3ea5b1[_0x142c('0x1c')],'a',_0x142c('0x1d')+_0x3a2728)[_0x142c('0x12')](_0x3ea5b1[_0x142c('0x1e')],'me',_0x142c('0x1f')+_0x40c8b5+'\x20=\x20i.id')[_0x142c('0x12')](_0x3ea5b1['interactionsTags'],'it',_0x142c('0x20')+_0x40c8b5+_0x142c('0x21'))['left_join'](_0x142c('0xc'),'t',_0x142c('0x22'));}function getSqlClauses(){var _0xd8ae2b={'body':squel['expr'](),'contact':squel[_0x142c('0x23')](),'default':squel[_0x142c('0x23')](),'fields':squel[_0x142c('0x23')](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x142c('0x23')]()};return _0xd8ae2b;}function parseTagParameter(_0x1f1c3b){var _0x1b6679=squel[_0x142c('0x23')]();if(_0x1f1c3b){var _0x1c4a52=utils[_0x142c('0x24')](_0x1f1c3b);_0x1c4a52[_0x142c('0x25')](function(_0x15bf27){_0x1b6679['or'](_0x142c('0x26'),'%,'+_0x15bf27+',%');});}return _0x1b6679;}function parseReadParameter(_0x25b3b5){var _0x27f90e='';if(_0x25b3b5){_0x27f90e='unreadMessages\x20{OPERATOR}\x200';if(_0x25b3b5==='1'){_0x27f90e=_0x27f90e[_0x142c('0x27')](_0x142c('0x28'),'=');}else{_0x27f90e=_0x27f90e[_0x142c('0x27')](_0x142c('0x28'),'>');}}return _0x27f90e;}function parseSearchFilter(_0x3695df,_0x4c6510){var _0x38c90c=squel[_0x142c('0x23')]();if(_0x4c6510){var _0x28eb58=_0x4c6510[_0x142c('0x27')]('\x5c','\x5c\x5c')[_0x142c('0x27')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x28eb58)){_0x38c90c['or'](_0x142c('0x29'),_0x28eb58+'%');if([_0x142c('0x2a'),_0x142c('0x2b')][_0x142c('0x2c')](_0x3695df)){_0x38c90c['or'](_0x142c('0x2d'),_0x28eb58+'%');}else if(_0x3695df==='fax'){_0x38c90c['or'](_0x142c('0x2e'),_0x28eb58+'%');}else if(_0x3695df==='openchannel'){_0x38c90c['or'](_0x142c('0x2f'),_0x28eb58+'%');}}else if(_0x3695df===_0x142c('0x30')&&qs[_0x142c('0x31')](_0x28eb58)){_0x38c90c['or'](_0x142c('0x32'),_0x28eb58+'%');}else{if(_0x3695df==='mail'){_0x38c90c['or'](_0x142c('0x33'),qs[_0x142c('0x34')](_0x28eb58,!![]))['or'](_0x142c('0x35'),qs['getFullTextValue'](_0x28eb58));}else if(_0x3695df!==_0x142c('0x36')){_0x38c90c['or'](_0x142c('0x37'),qs[_0x142c('0x34')](_0x28eb58));}_0x38c90c['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x142c('0x34')](_0x28eb58,!![]),null);}}return _0x38c90c;}function parseAdvancedSearchFilter(_0x39725a,_0x50f871){var _0x192ada=getSqlClauses();var _0x311f00=as[_0x142c('0x38')](_0x39725a);var _0x2de65e=_0x311f00[_0x142c('0x39')];for(var _0x327021=0x0;_0x327021<_0x311f00[_0x142c('0x3a')][_0x142c('0x14')];_0x327021++){var _0xfe520e=_0x311f00[_0x142c('0x3a')][_0x327021];var _0x2e52a4='i';var _0xbf6add=_['find'](_0x50f871,[_0x142c('0x3b'),_0xfe520e['field']]);if(_0xbf6add){var _0x10ccce=as[_0x142c('0x3c')](_0x2e52a4,_0xbf6add['type'],_0xfe520e);_0x192ada['default'][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x3f')],_0x10ccce[_0x142c('0x3e')]['end']);}else{switch(_0xfe520e['field']){case _0x142c('0x40'):var _0x5bbaca=parseReadParameter(_0xfe520e[_0x142c('0x3e')]);_0x192ada['read']['and'](_0x5bbaca);break;case _0x142c('0x41'):if(_0xfe520e[_0x142c('0x42')]===_0x142c('0x43')){if(_0xfe520e['value'][_0x142c('0x44')]('\x20')['length']>0x1){_0x192ada[_0x142c('0x45')][_0x2de65e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x142c('0x34')](_0xfe520e[_0x142c('0x3e')],!![]),null);}else{var _0x10376a='%'+_0xfe520e['value']+'%';_0x192ada[_0x142c('0x45')][_0x2de65e](_0x142c('0x46'),_0x10376a,_0x10376a,_0x10376a);}}else{_0xbf6add=_[_0x142c('0x47')](_0x50f871,[_0x142c('0x3b'),_0x142c('0x48')]);_0xfe520e[_0x142c('0xa')]='ContactId';_0x10ccce=as[_0x142c('0x3c')](_0x2e52a4,_0xbf6add['type'],_0xfe520e);_0x192ada[_0x142c('0x45')][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x3f')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x49')]);}break;case'Tag':var _0xccc9b4=_0xfe520e[_0x142c('0x3e')][_0x142c('0x44')](',')[_0x142c('0x17')](function(_0xc2e446){return Number(_0xc2e446);});var _0x526607=parseTagParameter(_0xccc9b4);_0x192ada[_0x142c('0x4a')][_0x142c('0x4b')][_0x142c('0x4c')](_0x526607);_0x192ada['tags']['ids']=_0xccc9b4;break;case _0x142c('0x4d'):if(_0xfe520e[_0x142c('0x42')]===_0x142c('0x43')){_0x192ada['user'][_0x2de65e](_0x142c('0x4e'),'%'+_0xfe520e[_0x142c('0x3e')]+'%',null);}else{_0xbf6add=_['find'](_0x50f871,[_0x142c('0x3b'),'UserId']);_0xfe520e[_0x142c('0xa')]=_0x142c('0x4f');_0x10ccce=as[_0x142c('0x3c')](_0x2e52a4,_0xbf6add[_0x142c('0x50')],_0xfe520e);_0x192ada['user'][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')]['start'],_0x10ccce[_0x142c('0x3e')][_0x142c('0x49')]);}break;case _0x142c('0x51'):case _0x142c('0x52'):_0x10ccce=as[_0x142c('0x3c')]('me',null,_0xfe520e);_0x192ada['body'][_0x2de65e](_0x10ccce[_0x142c('0x3d')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x3f')],_0x10ccce[_0x142c('0x3e')][_0x142c('0x49')]);break;}}}return _0x192ada;}function parseModelFields(_0x4db21d,_0x47ab0e,_0x287e82){var _0x6ce1fa=utils['getAccountFK'](_0x4db21d);var _0x862226=squel[_0x142c('0x23')]();var _0x18f04b=_(_0x47ab0e)[_0x142c('0x53')]()[_0x142c('0x17')](function(_0x188bd5){return _[_0x142c('0x54')](_0x287e82,['name',_0x188bd5])?_0x188bd5:undefined;})[_0x142c('0x55')]()[_0x142c('0x3e')]();if(_0x18f04b[_0x142c('0x14')]>0x0){_0x18f04b[_0x142c('0x25')](function(_0x4f05c3){if(_0x4f05c3===_0x6ce1fa){_0x862226['and']('i.'+_0x6ce1fa+_0x142c('0x16'),[][_0x142c('0x56')](_0x47ab0e[_0x4f05c3]));}else if(_0x4f05c3===_0x142c('0x57')){var _0x19bef4=JSON[_0x142c('0x58')](_0x47ab0e[_0x4f05c3])['$gte'];var _0x299580=JSON['parse'](_0x47ab0e[_0x4f05c3])[_0x142c('0x59')];_0x862226[_0x142c('0x4c')](_0x142c('0x5a'),_0x19bef4,_0x299580);}else{if(_0x47ab0e[_0x4f05c3]==='null'){_0x862226[_0x142c('0x4c')]('i.'+_0x4f05c3+_0x142c('0x5b'));}else{_0x862226[_0x142c('0x4c')]('i.'+_0x4f05c3+_0x142c('0x5c'),_0x47ab0e[_0x4f05c3]);}}});}return _0x862226;}function parseQueryParameters(_0x446eb2,_0x20e116,_0x3fc900){var _0x1dbd13=getSqlClauses();return Promise[_0x142c('0x5d')]()[_0x142c('0x5e')](function(){return parseModelFields(_0x446eb2,_0x20e116,_0x3fc900);})[_0x142c('0x5e')](function(_0x4fd614){_0x1dbd13[_0x142c('0x5f')]['and'](_0x4fd614);return parseReadParameter(_0x20e116['read']);})[_0x142c('0x5e')](function(_0x200fd5){_0x1dbd13[_0x142c('0x60')][_0x142c('0x4c')](_0x200fd5);return parseTagParameter(_0x20e116[_0x142c('0x61')]);})[_0x142c('0x5e')](function(_0x8cdca6){_0x1dbd13['tags'][_0x142c('0x4b')]['and'](_0x8cdca6);return parseSearchFilter(_0x446eb2,_0x20e116[_0x142c('0x62')]);})[_0x142c('0x5e')](function(_0x48f849){_0x1dbd13[_0x142c('0x62')]=_0x48f849;return _0x1dbd13;});}function checkAccountsRestrictions(_0x5c67d9,_0x16425d,_0x549209){var _0x206498=utils['getAccountFK'](_0x5c67d9);var _0x46634d='get'+_['capitalize'](_0x5c67d9)+(_0x5c67d9===_0x142c('0x63')?_0x142c('0x64'):_0x142c('0x65'));var _0x4fa5a6=squel['expr']();return Promise['resolve']()['then'](function(){if(_0x549209['search']&&_0x16425d[_0x142c('0x7')]===_0x142c('0x66')){return _0x16425d[_0x46634d]({'attributes':['id'],'raw':!![]});}})[_0x142c('0x5e')](function(_0x45df6b){if(_0x45df6b){if(_0x45df6b['length']===0x0){_0x4fa5a6[_0x142c('0x4c')]('i.'+_0x206498+'\x20IS\x20NULL');}else{_0x4fa5a6[_0x142c('0x4c')]('i.'+_0x206498+_0x142c('0x16'),_[_0x142c('0x17')](_0x45df6b,'id'));}}else if(!_0x549209[_0x206498]){_0x4fa5a6[_0x142c('0x4c')]('i.'+_0x206498+_0x142c('0x67'));}})[_0x142c('0x5e')](function(){return _0x4fa5a6;});}function getClosedOrderClause(_0x1b86f9,_0x18396c){var _0x4d470c='';var _0x84e18d=['i.thirdDisposition','i.secondDisposition',_0x142c('0x68')];if(_0x1b86f9==='mail'){_0x84e18d[_0x142c('0x69')](_0x142c('0x6a'));}if(_0x18396c[_0x142c('0x6b')]==='0'&&_0x1b86f9===_0x142c('0x30')){_0x4d470c=_0x142c('0x6a');}else{if(_0x18396c[_0x142c('0x6b')]==='1'){_0x84e18d[_0x142c('0x6c')]();}_0x4d470c=_0x142c('0x6d')+_0x84e18d[_0x142c('0x6e')](',\x20')+')';}return _0x4d470c;}function getFilteredInteractions(_0x370fda,_0x30f067,_0xc1483b,_0x1744e4){var _0x196eeb=utils[_0x142c('0xd')](_0x370fda);var _0x3877b9=_[_0x142c('0x6f')](_0x370fda)+_0x142c('0x70');var _0x18ed5d=[];var _0x148271=getTagsQuery();var _0x5471da={'type':db[_0x142c('0x71')][_0x142c('0x72')][_0x142c('0x73')],'raw':!![]};var _0x25bdf0=[];var _0x16aa00=[];return db[_0x142c('0x74')]['query'](_0x148271[_0x142c('0x75')](),_0x5471da)[_0x142c('0x5e')](function(_0x341689){_0x18ed5d=_[_0x142c('0x76')](_0x341689,'id');_0x5471da=_[_0x142c('0x77')](_0x5471da,{'model':db[_0x3877b9],'mapToModel':!![],'nest':!![]});if(_0xc1483b[_0x142c('0x5f')]){_0x1744e4[_0x142c('0x78')][_0x142c('0x25')](function(_0x49b9fb){_0x30f067[_0x142c('0xa')]('i.'+_0x49b9fb);});}else{_0x30f067[_0x142c('0xa')](_0x142c('0x79'),_0x142c('0x40'));_0x30f067[_0x142c('0xa')](_0x142c('0x7a'),_0x142c('0x7b'));_0x30f067['field'](_0x142c('0x7c'),'Account.mandatoryDisposition');if(_0x370fda===_0x142c('0x30')){_0x30f067[_0x142c('0xa')](_0x142c('0x7d'),_0x142c('0x7e'));_0x30f067[_0x142c('0xa')](_0x142c('0x7f'),_0x142c('0x80'));_0x30f067[_0x142c('0xa')]('i.id');_0x30f067[_0x142c('0xa')]('i.createdAt');_0x30f067[_0x142c('0xa')]('i.updatedAt');_0x30f067[_0x142c('0xa')](_0x142c('0x81'));_0x30f067[_0x142c('0xa')]('i.closedAt');_0x30f067['field']('i.attach');_0x30f067[_0x142c('0xa')](_0x142c('0x82'));_0x30f067['field']('i.lastMsgDirection');_0x30f067[_0x142c('0xa')](_0x142c('0x83'));_0x30f067['field']('i.disposition');_0x30f067['field'](_0x142c('0x84'));_0x30f067['field'](_0x142c('0x85'));_0x30f067['field']('i.substatus');_0x30f067[_0x142c('0xa')](_0x142c('0x86'));_0x30f067[_0x142c('0xa')]('i.ContactId');_0x30f067['field'](_0x142c('0x87'));_0x30f067[_0x142c('0xa')](_0x142c('0x88'));}else if(_0x370fda===_0x142c('0x89')){_0x30f067[_0x142c('0xa')](_0x142c('0x8a'),'contactName');}else{_0x30f067[_0x142c('0xa')](_0x142c('0x8b'),_0x142c('0x80'));}if(_0x370fda!==_0x142c('0x30')){_0x30f067[_0x142c('0xa')](_0x142c('0x8c'));}_0x30f067[_0x142c('0xa')](_0x142c('0x8d'),_0x142c('0x8e'));_0x30f067[_0x142c('0xa')](_0x142c('0x8f'),'Contact.lastName');_0x30f067[_0x142c('0xa')](_0x142c('0x90'),_0x142c('0x91'));_0x30f067[_0x142c('0xa')](_0x142c('0x92'),_0x142c('0x93'));_0x30f067[_0x142c('0xa')](_0x142c('0x94'),_0x142c('0x95'));_0x30f067[_0x142c('0xa')](_0x142c('0x96'),_0x142c('0x97'));_0x30f067[_0x142c('0xa')]('o.fullname',_0x142c('0x98'));_0x30f067['field']('o.internal',_0x142c('0x99'));_0x30f067['field'](_0x142c('0x9a'),_0x142c('0x9b'));}if(_0x1744e4[_0x142c('0x9c')]){_0x30f067[_0x142c('0x9c')](_0x1744e4['limit']);}if(_0x1744e4['offset']){_0x30f067[_0x142c('0x9d')](_0x1744e4['offset']);}return db['sequelize'][_0x142c('0x9e')](_0x30f067[_0x142c('0x75')](),_0x5471da);})['then'](function(_0x2d5e19){_0x25bdf0=_0x2d5e19;var _0x1390e7=getUsersQuery(_0x370fda,_0x25bdf0);return db[_0x142c('0x74')][_0x142c('0x9e')](_0x1390e7[_0x142c('0x75')](),_0x5471da);})[_0x142c('0x5e')](function(_0x4db3f4){_0x16aa00=_['groupBy'](_0x4db3f4,_0x196eeb);if(_0x370fda===_0x142c('0x30')){return db[_0x142c('0x9f')][_0x142c('0xa0')]({'attributes':[_0x142c('0xa1')],'raw':!![]});}})[_0x142c('0x5e')](function(_0x396ced){var _0x5a98e4=_0x396ced?_0x396ced[_0x142c('0xa1')]:undefined;var _0x2e67ed=_0x25bdf0[_0x142c('0x17')](function(_0x55987d){return updateInteraction(_0x55987d,_0x18ed5d,_0x16aa00,_0x5a98e4);});return Promise[_0x142c('0xa2')](_0x2e67ed);});}function countFilteredInteractions(_0x5e97f1,_0x4697e8){var _0x11b1c3=_0x5e97f1[_0x142c('0xa3')]();_0x11b1c3['field']('COUNT(*)');_0x11b1c3[_0x142c('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x142c('0x40'));var _0x31d749=utils[_0x142c('0x24')](_0x4697e8);if(!_['isEmpty'](_0x31d749)){_0x11b1c3['where']('t.id\x20IN\x20?',_0x31d749);}var _0x1ded54={'type':db[_0x142c('0x71')][_0x142c('0x72')][_0x142c('0x73')],'raw':!![]};return db['sequelize']['query'](_0x11b1c3['toString'](),_0x1ded54);}module[_0x142c('0xa4')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x937a=['keys','some','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','then','tag','filter','get','chat','Websites','Accounts','resolve','role','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','Account.key','a.mandatoryDisposition','a.email','Account.email','contactName','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.MailAccountId','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.*','c.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','COUNT(*)','t.id\x20IN\x20?','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','../../mysqldb','getAccountFK','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','where','\x20IN\x20?','map','getInteractionsTables','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','messages','\x20=\x20i.id','interactionsTags','it.','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','sqlOperator','conditions','length','find','buildExpression','type','default','text','value','start','end','read','and','operator','$substring','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','split','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId'];(function(_0x4c59e0,_0x4ce660){var _0xc69b7a=function(_0x56f400){while(--_0x56f400){_0x4c59e0['push'](_0x4c59e0['shift']());}};_0xc69b7a(++_0x4ce660);}(_0x937a,0xe7));var _0xa937=function(_0x345a1b,_0x189c9e){_0x345a1b=_0x345a1b-0x0;var _0x1b24ec=_0x937a[_0x345a1b];return _0x1b24ec;};'use strict';var _=require(_0xa937('0x0'));var squel=require(_0xa937('0x1'));var as=require(_0xa937('0x2'));var qs=require(_0xa937('0x3'));var updateInteraction=require(_0xa937('0x4'))['updateInteraction'];var utils=require('./utils');var db=require(_0xa937('0x5'))['db'];function skipInteractionsQuery(_0x34091b,_0x496c47,_0x3f6403){var _0x55e286=![];var _0x545e12=utils[_0xa937('0x6')](_0x34091b);if(_0x496c47['role']===_0xa937('0x7')&&!_0x3f6403[_0xa937('0x8')]&&!_0x3f6403[_0x545e12]){_0x55e286=!![];}return _0x55e286;}function getTagsQuery(){return squel[_0xa937('0x9')]()[_0xa937('0xa')]('id')[_0xa937('0xa')](_0xa937('0xb'))[_0xa937('0xa')](_0xa937('0xc'))[_0xa937('0xd')](_0xa937('0xe'));}function getUsersQuery(_0x117426,_0x3ed614){var _0x2d42ec=utils[_0xa937('0xf')](_0x117426);var _0x121a98=_0xa937('0x10')+_0x117426+_0xa937('0x11');var _0x52434a=squel['select']()['field'](_0xa937('0x12'))['field'](_0xa937('0x13'))[_0xa937('0xa')](_0xa937('0x14')+_0x2d42ec)[_0xa937('0xd')](_0x121a98,'ui')[_0xa937('0x15')](_0xa937('0x16'),'u',_0xa937('0x17'));if(_0x3ed614['length']>0x0){_0x52434a[_0xa937('0x18')](_0xa937('0x14')+_0x2d42ec+_0xa937('0x19'),_[_0xa937('0x1a')](_0x3ed614,'id'));}return _0x52434a;}function getInteractionsQuery(_0x2daf76){var _0x3ecd3b=utils[_0xa937('0x1b')](_0x2daf76);var _0x4eb3da=utils[_0xa937('0x6')](_0x2daf76);var _0x273df2=utils[_0xa937('0xf')](_0x2daf76);return squel[_0xa937('0x9')]()[_0xa937('0xd')](_0x3ecd3b['interactions'],'i')['left_join'](_0xa937('0x1c'),'c',_0xa937('0x1d'))['left_join'](_0xa937('0x16'),'o',_0xa937('0x1e'))[_0xa937('0x15')](_0x3ecd3b['accounts'],'a','a.id\x20=\x20i.'+_0x4eb3da)[_0xa937('0x15')](_0x3ecd3b[_0xa937('0x1f')],'me','me.'+_0x273df2+_0xa937('0x20'))[_0xa937('0x15')](_0x3ecd3b[_0xa937('0x21')],'it',_0xa937('0x22')+_0x273df2+_0xa937('0x20'))[_0xa937('0x15')]('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x5c2cf6={'body':squel['expr'](),'contact':squel['expr'](),'default':squel[_0xa937('0x23')](),'fields':squel['expr'](),'filter':squel[_0xa937('0x23')](),'read':squel[_0xa937('0x23')](),'tags':{'clause':squel[_0xa937('0x23')](),'ids':null},'user':squel[_0xa937('0x23')]()};return _0x5c2cf6;}function parseTagParameter(_0x25d609){var _0x2880e1=squel[_0xa937('0x23')]();if(_0x25d609){var _0x4526b0=utils[_0xa937('0x24')](_0x25d609);_0x4526b0[_0xa937('0x25')](function(_0xf92ff1){_0x2880e1['or'](_0xa937('0x26'),'%,'+_0xf92ff1+',%');});}return _0x2880e1;}function parseReadParameter(_0x5412e4){var _0x31bf22='';if(_0x5412e4){_0x31bf22='unreadMessages\x20{OPERATOR}\x200';if(_0x5412e4==='1'){_0x31bf22=_0x31bf22[_0xa937('0x27')](_0xa937('0x28'),'=');}else{_0x31bf22=_0x31bf22[_0xa937('0x27')](_0xa937('0x28'),'>');}}return _0x31bf22;}function parseSearchFilter(_0x170fcf,_0x25677b){var _0x3f533a=squel[_0xa937('0x23')]();if(_0x25677b){var _0x3164ee=_0x25677b[_0xa937('0x27')]('\x5c','\x5c\x5c')[_0xa937('0x27')](/'/g,'\x27\x27');if(qs[_0xa937('0x29')](_0x3164ee)){_0x3f533a['or'](_0xa937('0x2a'),_0x3164ee+'%');if([_0xa937('0x2b'),_0xa937('0x2c')]['includes'](_0x170fcf)){_0x3f533a['or']('i.phone\x20LIKE\x20?',_0x3164ee+'%');}else if(_0x170fcf==='fax'){_0x3f533a['or'](_0xa937('0x2d'),_0x3164ee+'%');}else if(_0x170fcf===_0xa937('0x2e')){_0x3f533a['or'](_0xa937('0x2f'),_0x3164ee+'%');}}else if(_0x170fcf==='mail'&&qs[_0xa937('0x30')](_0x3164ee)){_0x3f533a['or'](_0xa937('0x31'),_0x3164ee+'%');}else{if(_0x170fcf===_0xa937('0x32')){_0x3f533a['or'](_0xa937('0x33'),qs[_0xa937('0x34')](_0x3164ee,!![]))['or'](_0xa937('0x35'),qs[_0xa937('0x34')](_0x3164ee));}else if(_0x170fcf!=='fax'){_0x3f533a['or'](_0xa937('0x36'),qs[_0xa937('0x34')](_0x3164ee));}_0x3f533a['or'](_0xa937('0x37'),qs[_0xa937('0x34')](_0x3164ee,!![]),null);}}return _0x3f533a;}function parseAdvancedSearchFilter(_0x4b2744,_0x2f01e4){var _0xf73629=getSqlClauses();var _0x48ae12=as[_0xa937('0x38')](_0x4b2744);var _0x5567e1=_0x48ae12[_0xa937('0x39')];for(var _0x528fc4=0x0;_0x528fc4<_0x48ae12[_0xa937('0x3a')][_0xa937('0x3b')];_0x528fc4++){var _0x12351d=_0x48ae12[_0xa937('0x3a')][_0x528fc4];var _0x4fd30e='i';var _0x4e67f9=_[_0xa937('0x3c')](_0x2f01e4,[_0xa937('0xb'),_0x12351d['field']]);if(_0x4e67f9){var _0x201809=as[_0xa937('0x3d')](_0x4fd30e,_0x4e67f9[_0xa937('0x3e')],_0x12351d);_0xf73629[_0xa937('0x3f')][_0x5567e1](_0x201809[_0xa937('0x40')],_0x201809[_0xa937('0x41')][_0xa937('0x42')],_0x201809[_0xa937('0x41')][_0xa937('0x43')]);}else{switch(_0x12351d[_0xa937('0xa')]){case'unreadMessages':var _0x11d89e=parseReadParameter(_0x12351d[_0xa937('0x41')]);_0xf73629[_0xa937('0x44')][_0xa937('0x45')](_0x11d89e);break;case'Contact':if(_0x12351d[_0xa937('0x46')]===_0xa937('0x47')){if(_0x12351d['value']['split']('\x20')[_0xa937('0x3b')]>0x1){_0xf73629['contact'][_0x5567e1](_0xa937('0x37'),qs['getFullTextValue'](_0x12351d[_0xa937('0x41')],!![]),null);}else{var _0x125bee='%'+_0x12351d[_0xa937('0x41')]+'%';_0xf73629[_0xa937('0x48')][_0x5567e1](_0xa937('0x49'),_0x125bee,_0x125bee,_0x125bee);}}else{_0x4e67f9=_[_0xa937('0x3c')](_0x2f01e4,[_0xa937('0xb'),_0xa937('0x4a')]);_0x12351d[_0xa937('0xa')]=_0xa937('0x4a');_0x201809=as[_0xa937('0x3d')](_0x4fd30e,_0x4e67f9[_0xa937('0x3e')],_0x12351d);_0xf73629[_0xa937('0x48')][_0x5567e1](_0x201809[_0xa937('0x40')],_0x201809[_0xa937('0x41')][_0xa937('0x42')],_0x201809[_0xa937('0x41')][_0xa937('0x43')]);}break;case'Tag':var _0x4ac822=_0x12351d[_0xa937('0x41')][_0xa937('0x4b')](',')[_0xa937('0x1a')](function(_0x90f9a5){return Number(_0x90f9a5);});var _0x190609=parseTagParameter(_0x4ac822);_0xf73629[_0xa937('0x4c')][_0xa937('0x4d')][_0xa937('0x45')](_0x190609);_0xf73629[_0xa937('0x4c')][_0xa937('0x4e')]=_0x4ac822;break;case _0xa937('0x4f'):if(_0x12351d[_0xa937('0x46')]===_0xa937('0x47')){_0xf73629[_0xa937('0x50')][_0x5567e1](_0xa937('0x51'),'%'+_0x12351d[_0xa937('0x41')]+'%',null);}else{_0x4e67f9=_[_0xa937('0x3c')](_0x2f01e4,['name',_0xa937('0x52')]);_0x12351d['field']=_0xa937('0x52');_0x201809=as['buildExpression'](_0x4fd30e,_0x4e67f9[_0xa937('0x3e')],_0x12351d);_0xf73629[_0xa937('0x50')][_0x5567e1](_0x201809['text'],_0x201809['value'][_0xa937('0x42')],_0x201809[_0xa937('0x41')]['end']);}break;case'body':case'plainBody':_0x201809=as[_0xa937('0x3d')]('me',null,_0x12351d);_0xf73629['body'][_0x5567e1](_0x201809[_0xa937('0x40')],_0x201809[_0xa937('0x41')][_0xa937('0x42')],_0x201809[_0xa937('0x41')]['end']);break;}}}return _0xf73629;}function parseModelFields(_0x11d903,_0x1a926a,_0x19a8ba){var _0x1a2e20=utils[_0xa937('0x6')](_0x11d903);var _0x452c49=squel[_0xa937('0x23')]();var _0x3fe9ab=_(_0x1a926a)[_0xa937('0x53')]()[_0xa937('0x1a')](function(_0x52bfa5){return _[_0xa937('0x54')](_0x19a8ba,[_0xa937('0xb'),_0x52bfa5])?_0x52bfa5:undefined;})['compact']()[_0xa937('0x41')]();if(_0x3fe9ab[_0xa937('0x3b')]>0x0){_0x3fe9ab[_0xa937('0x25')](function(_0x5714a6){if(_0x5714a6===_0x1a2e20){_0x452c49[_0xa937('0x45')]('i.'+_0x1a2e20+_0xa937('0x19'),[][_0xa937('0x55')](_0x1a926a[_0x5714a6]));}else if(_0x5714a6===_0xa937('0x56')){var _0x51ae7a=JSON['parse'](_0x1a926a[_0x5714a6])['$gte'];var _0x3eaa90=JSON[_0xa937('0x57')](_0x1a926a[_0x5714a6])[_0xa937('0x58')];_0x452c49[_0xa937('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51ae7a,_0x3eaa90);}else{if(_0x1a926a[_0x5714a6]===_0xa937('0x59')){_0x452c49['and']('i.'+_0x5714a6+_0xa937('0x5a'));}else{_0x452c49[_0xa937('0x45')]('i.'+_0x5714a6+_0xa937('0x5b'),_0x1a926a[_0x5714a6]);}}});}return _0x452c49;}function parseQueryParameters(_0x5c8912,_0x830dd4,_0x318aa1){var _0x168cdb=getSqlClauses();return Promise['resolve']()[_0xa937('0x5c')](function(){return parseModelFields(_0x5c8912,_0x830dd4,_0x318aa1);})[_0xa937('0x5c')](function(_0x3a9195){_0x168cdb['fields']['and'](_0x3a9195);return parseReadParameter(_0x830dd4[_0xa937('0x44')]);})['then'](function(_0x223946){_0x168cdb[_0xa937('0x44')][_0xa937('0x45')](_0x223946);return parseTagParameter(_0x830dd4[_0xa937('0x5d')]);})['then'](function(_0x786229){_0x168cdb[_0xa937('0x4c')][_0xa937('0x4d')][_0xa937('0x45')](_0x786229);return parseSearchFilter(_0x5c8912,_0x830dd4[_0xa937('0x5e')]);})[_0xa937('0x5c')](function(_0x439c2b){_0x168cdb['filter']=_0x439c2b;return _0x168cdb;});}function checkAccountsRestrictions(_0x2e0236,_0x1cd41a,_0x485edc){var _0x41e64e=utils['getAccountFK'](_0x2e0236);var _0x4403c5=_0xa937('0x5f')+_['capitalize'](_0x2e0236)+(_0x2e0236===_0xa937('0x60')?_0xa937('0x61'):_0xa937('0x62'));var _0x37adbd=squel['expr']();return Promise[_0xa937('0x63')]()[_0xa937('0x5c')](function(){if(_0x485edc[_0xa937('0x8')]&&_0x1cd41a[_0xa937('0x64')]===_0xa937('0x7')){return _0x1cd41a[_0x4403c5]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4c928f){if(_0x4c928f){if(_0x4c928f[_0xa937('0x3b')]===0x0){_0x37adbd['and']('i.'+_0x41e64e+_0xa937('0x5a'));}else{_0x37adbd['and']('i.'+_0x41e64e+_0xa937('0x19'),_[_0xa937('0x1a')](_0x4c928f,'id'));}}else if(!_0x485edc[_0x41e64e]){_0x37adbd[_0xa937('0x45')]('i.'+_0x41e64e+'\x20IS\x20NOT\x20NULL');}})[_0xa937('0x5c')](function(){return _0x37adbd;});}function getClosedOrderClause(_0x319ed8,_0x595781){var _0x5cc310='';var _0x3c39b6=[_0xa937('0x65'),_0xa937('0x66'),_0xa937('0x67')];if(_0x319ed8===_0xa937('0x32')){_0x3c39b6[_0xa937('0x68')](_0xa937('0x69'));}if(_0x595781[_0xa937('0x6a')]==='0'&&_0x319ed8===_0xa937('0x32')){_0x5cc310=_0xa937('0x69');}else{if(_0x595781['closed']==='1'){_0x3c39b6['shift']();}_0x5cc310=_0xa937('0x6b')+_0x3c39b6[_0xa937('0x6c')](',\x20')+')';}return _0x5cc310;}function getFilteredInteractions(_0x546f9f,_0x381a5f,_0x2ca2dd,_0x385fa3){var _0x4674cc=utils['getInteractionFK'](_0x546f9f);var _0x3a359c=_['capitalize'](_0x546f9f)+_0xa937('0x6d');var _0x4722b2=[];var _0x3cb5de=getTagsQuery();var _0x1c562a={'type':db[_0xa937('0x6e')][_0xa937('0x6f')][_0xa937('0x70')],'raw':!![]};var _0x188337=[];var _0x4e53d2=[];return db[_0xa937('0x71')][_0xa937('0x72')](_0x3cb5de[_0xa937('0x73')](),_0x1c562a)[_0xa937('0x5c')](function(_0x9734a9){_0x4722b2=_[_0xa937('0x74')](_0x9734a9,'id');_0x1c562a=_[_0xa937('0x75')](_0x1c562a,{'model':db[_0x3a359c],'mapToModel':!![],'nest':!![]});if(_0x2ca2dd[_0xa937('0x76')]){_0x385fa3[_0xa937('0x77')][_0xa937('0x25')](function(_0x160f11){_0x381a5f['field']('i.'+_0x160f11);});}else{_0x381a5f[_0xa937('0xa')](_0xa937('0x78'),_0xa937('0x79'));_0x381a5f[_0xa937('0xa')]('a.key',_0xa937('0x7a'));_0x381a5f[_0xa937('0xa')](_0xa937('0x7b'),'Account.mandatoryDisposition');if(_0x546f9f===_0xa937('0x32')){_0x381a5f[_0xa937('0xa')](_0xa937('0x7c'),_0xa937('0x7d'));_0x381a5f[_0xa937('0xa')]('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',_0xa937('0x7e'));_0x381a5f['field']('i.id');_0x381a5f[_0xa937('0xa')]('i.createdAt');_0x381a5f['field'](_0xa937('0x7f'));_0x381a5f[_0xa937('0xa')](_0xa937('0x80'));_0x381a5f[_0xa937('0xa')](_0xa937('0x81'));_0x381a5f[_0xa937('0xa')](_0xa937('0x82'));_0x381a5f['field']('i.lastMsgAt');_0x381a5f[_0xa937('0xa')](_0xa937('0x83'));_0x381a5f['field']('i.subject');_0x381a5f['field'](_0xa937('0x67'));_0x381a5f[_0xa937('0xa')](_0xa937('0x66'));_0x381a5f['field'](_0xa937('0x65'));_0x381a5f[_0xa937('0xa')](_0xa937('0x69'));_0x381a5f[_0xa937('0xa')]('i.to');_0x381a5f[_0xa937('0xa')]('i.ContactId');_0x381a5f[_0xa937('0xa')](_0xa937('0x84'));_0x381a5f[_0xa937('0xa')]('i.UserId');}else if(_0x546f9f===_0xa937('0x2e')){_0x381a5f[_0xa937('0xa')](_0xa937('0x85'),'contactName');}else{_0x381a5f['field'](_0xa937('0x86'),_0xa937('0x7e'));}if(_0x546f9f!==_0xa937('0x32')){_0x381a5f['field'](_0xa937('0x87'));}_0x381a5f[_0xa937('0xa')](_0xa937('0x88'),'Contact.firstName');_0x381a5f[_0xa937('0xa')](_0xa937('0x89'),'Contact.lastName');_0x381a5f[_0xa937('0xa')]('c.email',_0xa937('0x8a'));_0x381a5f[_0xa937('0xa')](_0xa937('0x8b'),_0xa937('0x8c'));_0x381a5f[_0xa937('0xa')](_0xa937('0x8d'),_0xa937('0x8e'));_0x381a5f[_0xa937('0xa')](_0xa937('0x8f'),'Contact.fax');_0x381a5f[_0xa937('0xa')]('o.fullname',_0xa937('0x90'));_0x381a5f[_0xa937('0xa')](_0xa937('0x91'),_0xa937('0x92'));_0x381a5f['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa937('0x93'));}if(_0x385fa3['limit']){_0x381a5f['limit'](_0x385fa3[_0xa937('0x94')]);}if(_0x385fa3[_0xa937('0x95')]){_0x381a5f[_0xa937('0x95')](_0x385fa3[_0xa937('0x95')]);}return db[_0xa937('0x71')][_0xa937('0x72')](_0x381a5f[_0xa937('0x73')](),_0x1c562a);})[_0xa937('0x5c')](function(_0x557d6c){_0x188337=_0x557d6c;var _0x3b817f=getUsersQuery(_0x546f9f,_0x188337);return db[_0xa937('0x71')][_0xa937('0x72')](_0x3b817f[_0xa937('0x73')](),_0x1c562a);})[_0xa937('0x5c')](function(_0x1da7e2){_0x4e53d2=_[_0xa937('0x96')](_0x1da7e2,_0x4674cc);if(_0x546f9f===_0xa937('0x32')){return db[_0xa937('0x97')][_0xa937('0x98')]({'attributes':[_0xa937('0x99')],'raw':!![]});}})[_0xa937('0x5c')](function(_0x5c7bf7){var _0x4dab7b=_0x5c7bf7?_0x5c7bf7['enableEmailPreview']:undefined;var _0x4a9be8=_0x188337[_0xa937('0x1a')](function(_0x30a8bf){return updateInteraction(_0x30a8bf,_0x4722b2,_0x4e53d2,_0x4dab7b);});return Promise[_0xa937('0x9a')](_0x4a9be8);});}function countFilteredInteractions(_0x56cc53,_0x1caa71){var _0x2aa256=_0x56cc53['clone']();_0x2aa256['field'](_0xa937('0x9b'));_0x2aa256['field'](_0xa937('0x78'),_0xa937('0x79'));var _0x10008c=utils[_0xa937('0x24')](_0x1caa71);if(!_['isEmpty'](_0x10008c)){_0x2aa256[_0xa937('0x18')](_0xa937('0x9c'),_0x10008c);}var _0x4320e9={'type':db[_0xa937('0x6e')][_0xa937('0x6f')][_0xa937('0x70')],'raw':!![]};return db['sequelize'][_0xa937('0x72')](_0x2aa256['toString'](),_0x4320e9);}module['exports']={'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 2232045..a2eff10 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 _0x3a72=['abandoned','disposition','unmanaged','UserId','plainBody','trimStart','catch','updateInteraction','then','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','waiting','talking','answered','total'];(function(_0x16d644,_0x46545e){var _0xf808cc=function(_0x4024ef){while(--_0x4024ef){_0x16d644['push'](_0x16d644['shift']());}};_0xf808cc(++_0x46545e);}(_0x3a72,0x140));var _0x23a7=function(_0x2e759c,_0x53617e){_0x2e759c=_0x2e759c-0x0;var _0x7d6016=_0x3a72[_0x2e759c];return _0x7d6016;};'use strict';var _=require(_0x23a7('0x0'));var db=require(_0x23a7('0x1'))['db'];function getInteractionUsers(_0x3dd8d0,_0x1519d8){return new Promise(function(_0x1d5c77,_0x4cb3f3){try{var _0x3699c0=[];if(_0x1519d8[_0x3dd8d0]){_0x3699c0=_0x1519d8[_0x3dd8d0][_0x23a7('0x2')](function(_0x983654){return{'id':_0x983654['id'],'fullname':_0x983654[_0x23a7('0x3')]};});}return _0x1d5c77(_0x3699c0);}catch(_0x556896){_0x4cb3f3(_0x556896);}});}function getInteractionTags(_0x3f87ef,_0x3eeeb3){var _0x2da7ac=[];if(_0x3f87ef){_0x3f87ef[_0x23a7('0x4')](',')[_0x23a7('0x5')](function(_0x240004){_0x2da7ac['push'](_0x3eeeb3[_0x240004]);});}return _0x2da7ac;}function updateWaitingCounter(_0x277737){if(_0x277737[_0x23a7('0x6')]){_0x277737[_0x23a7('0x6')]-=0x1;}}function updateInteractionCounters(_0x338341){_0x338341[_0x23a7('0x6')]=0x0;_0x338341[_0x23a7('0x7')]=0x0;_0x338341[_0x23a7('0x8')]=0x0;_0x338341['unmanaged']=0x0;_0x338341['abandoned']=0x0;_0x338341[_0x23a7('0x9')]=0x0;if(_0x338341['closed']){if(_0x338341['disposition']==='abandoned'){_0x338341[_0x23a7('0xa')]+=0x1;updateWaitingCounter(_0x338341);}if(_0x338341['UserId']){_0x338341[_0x23a7('0x8')]+=0x1;if(_0x338341[_0x23a7('0x7')]){_0x338341['talking']-=0x1;}}else{if(_0x338341[_0x23a7('0xb')]){_0x338341[_0x23a7('0xc')]+=0x1;updateWaitingCounter(_0x338341);}}}else{if(!_0x338341['UserId']){_0x338341[_0x23a7('0x6')]+=0x1;}if(_0x338341[_0x23a7('0xd')]){_0x338341[_0x23a7('0x7')]+=0x1;updateWaitingCounter(_0x338341);}}_0x338341[_0x23a7('0x9')]+=0x1;return _0x338341;}function getLastMessageText(_0x253abb){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x253abb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x23a7('0xe')],'order':'-id','raw':!![]})['then'](function(_0xb32d79){if(_0xb32d79&&_0xb32d79['plainBody']){_0x253abb['lastMsgText']=_[_0x23a7('0xf')](_0xb32d79[_0x23a7('0xe')]);}return _0x253abb;})[_0x23a7('0x10')](function(_0x5e8151){throw _0x5e8151;});}exports[_0x23a7('0x11')]=function(_0x2749b8,_0x5bf000,_0x59724b,_0x5adc01){return new Promise(function(_0x12e271,_0x5e1ed9){return getInteractionUsers(_0x2749b8['id'],_0x59724b)[_0x23a7('0x12')](function(_0x452828){_0x2749b8[_0x23a7('0x13')]=_0x452828;return getInteractionTags(_0x2749b8[_0x23a7('0x14')],_0x5bf000);})[_0x23a7('0x12')](function(_0x489ae0){_0x2749b8[_0x23a7('0x15')]=_0x489ae0;delete _0x2749b8[_0x23a7('0x14')];return updateInteractionCounters(_0x2749b8);})[_0x23a7('0x12')](function(_0x3fd223){if(_0x5adc01){return getLastMessageText(_0x3fd223);}else{return _0x3fd223;}})[_0x23a7('0x12')](function(_0x1d6a8f){_0x12e271(_0x1d6a8f);})[_0x23a7('0x10')](function(_0x445c4e){_0x5e1ed9(_0x445c4e);});});}; \ No newline at end of file +var _0x0c0b=['fullname','split','forEach','push','waiting','answered','unmanaged','abandoned','total','closed','UserId','talking','disposition','MailMessage','out','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','TagIds','Tags','../../mysqldb','map'];(function(_0x1156ce,_0x50f233){var _0x2b6d72=function(_0x36a033){while(--_0x36a033){_0x1156ce['push'](_0x1156ce['shift']());}};_0x2b6d72(++_0x50f233);}(_0x0c0b,0x94));var _0xb0c0=function(_0x52290a,_0x47f455){_0x52290a=_0x52290a-0x0;var _0x3eb06f=_0x0c0b[_0x52290a];return _0x3eb06f;};'use strict';var _=require('lodash');var db=require(_0xb0c0('0x0'))['db'];function getInteractionUsers(_0x5f00a5,_0x2d0274){return new Promise(function(_0x4282fc,_0x16cd29){try{var _0x56f266=[];if(_0x2d0274[_0x5f00a5]){_0x56f266=_0x2d0274[_0x5f00a5][_0xb0c0('0x1')](function(_0x2078ce){return{'id':_0x2078ce['id'],'fullname':_0x2078ce[_0xb0c0('0x2')]};});}return _0x4282fc(_0x56f266);}catch(_0x506e3c){_0x16cd29(_0x506e3c);}});}function getInteractionTags(_0x1d2d02,_0x434422){var _0x1d1edf=[];if(_0x1d2d02){_0x1d2d02[_0xb0c0('0x3')](',')[_0xb0c0('0x4')](function(_0x132731){_0x1d1edf[_0xb0c0('0x5')](_0x434422[_0x132731]);});}return _0x1d1edf;}function updateWaitingCounter(_0x11d370){if(_0x11d370[_0xb0c0('0x6')]){_0x11d370[_0xb0c0('0x6')]-=0x1;}}function updateInteractionCounters(_0x33e769){_0x33e769[_0xb0c0('0x6')]=0x0;_0x33e769['talking']=0x0;_0x33e769[_0xb0c0('0x7')]=0x0;_0x33e769[_0xb0c0('0x8')]=0x0;_0x33e769[_0xb0c0('0x9')]=0x0;_0x33e769[_0xb0c0('0xa')]=0x0;if(_0x33e769[_0xb0c0('0xb')]){if(_0x33e769['disposition']==='abandoned'){_0x33e769[_0xb0c0('0x9')]+=0x1;updateWaitingCounter(_0x33e769);}if(_0x33e769[_0xb0c0('0xc')]){_0x33e769[_0xb0c0('0x7')]+=0x1;if(_0x33e769[_0xb0c0('0xd')]){_0x33e769[_0xb0c0('0xd')]-=0x1;}}else{if(_0x33e769[_0xb0c0('0xe')]){_0x33e769['unmanaged']+=0x1;updateWaitingCounter(_0x33e769);}}}else{if(!_0x33e769[_0xb0c0('0xc')]){_0x33e769[_0xb0c0('0x6')]+=0x1;}if(_0x33e769[_0xb0c0('0xc')]){_0x33e769[_0xb0c0('0xd')]+=0x1;updateWaitingCounter(_0x33e769);}}_0x33e769[_0xb0c0('0xa')]+=0x1;return _0x33e769;}function getLastMessageText(_0x320aa9){return db[_0xb0c0('0xf')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x320aa9['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb0c0('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb0c0('0x11')],'order':'-id','raw':!![]})[_0xb0c0('0x12')](function(_0x3fff68){if(_0x3fff68&&_0x3fff68['plainBody']){_0x320aa9[_0xb0c0('0x13')]=_[_0xb0c0('0x14')](_0x3fff68[_0xb0c0('0x11')]);}return _0x320aa9;})[_0xb0c0('0x15')](function(_0x1405f5){throw _0x1405f5;});}exports[_0xb0c0('0x16')]=function(_0x3894e2,_0x3b7733,_0x3572d9,_0x2a764a){return new Promise(function(_0x4f88ee,_0x229db9){return getInteractionUsers(_0x3894e2['id'],_0x3572d9)[_0xb0c0('0x12')](function(_0x255c6d){_0x3894e2['Users']=_0x255c6d;return getInteractionTags(_0x3894e2[_0xb0c0('0x17')],_0x3b7733);})[_0xb0c0('0x12')](function(_0x39a943){_0x3894e2[_0xb0c0('0x18')]=_0x39a943;delete _0x3894e2['TagIds'];return updateInteractionCounters(_0x3894e2);})[_0xb0c0('0x12')](function(_0x7aa18c){if(_0x2a764a){return getLastMessageText(_0x7aa18c);}else{return _0x7aa18c;}})[_0xb0c0('0x12')](function(_0x549ed3){_0x4f88ee(_0x549ed3);})[_0xb0c0('0x15')](function(_0x53e15d){_0x229db9(_0x53e15d);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index aecb09c..29afc50 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 _0xe81c=['whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x4dbf18,_0x3a4db9){var _0x24e5df=function(_0x4a243d){while(--_0x4a243d){_0x4dbf18['push'](_0x4dbf18['shift']());}};_0x24e5df(++_0x3a4db9);}(_0xe81c,0x64));var _0xce81=function(_0x2f8a7c,_0x3f65fd){_0x2f8a7c=_0x2f8a7c-0x0;var _0x257e01=_0xe81c[_0x2f8a7c];return _0x257e01;};'use strict';var _=require(_0xce81('0x0'));var db=require(_0xce81('0x1'))['db'];var loggers={'openchannel':require(_0xce81('0x2'))(_0xce81('0x3')),'mail':require(_0xce81('0x2'))(_0xce81('0x4')),'fax':require('../../config/logger')(_0xce81('0x5')),'sms':require(_0xce81('0x2'))(_0xce81('0x6')),'chat':require('../../config/logger')(_0xce81('0x7')),'whatsapp':require(_0xce81('0x2'))(_0xce81('0x8'))};function getAccountFK(_0x1e5f63){return _[_0xce81('0x9')](_0x1e5f63)+(_0x1e5f63===_0xce81('0xa')?_0xce81('0xb'):_0xce81('0xc'))+'Id';}function getInteractionFK(_0x6098d1){return _[_0xce81('0x9')](_0x6098d1)+_0xce81('0xd');}function getInteractionId(_0x36c5c4,_0x7a3a8e,_0x26961e){if(_0x36c5c4&&_0x36c5c4[_[_0xce81('0xe')](_0x26961e)+'InteractionId']){return _0x36c5c4[_[_0xce81('0xe')](_0x26961e)+_0xce81('0xd')];}else if(_0x36c5c4&&_0x36c5c4['id']){return _0x36c5c4['id'];}else if(_0x7a3a8e&&_0x7a3a8e['id']){return _0x7a3a8e['id'];}else{return _0xce81('0xf');}}function getInteractionsTables(_0x563aff){return{'accounts':_0x563aff+'_'+(_0x563aff===_0xce81('0xa')?_0xce81('0x10'):_0xce81('0x11')),'interactions':_0x563aff+_0xce81('0x12'),'interactionsTags':_0x563aff+_0xce81('0x13'),'messages':_0x563aff+_0xce81('0x14'),'userInteractions':_0xce81('0x15')+_0x563aff+_0xce81('0x12')};}function getSelectedTags(_0x26fa0e){var _0x58bd3e=[];if(_0x26fa0e){_0x58bd3e=Array[_0xce81('0x16')](_0x26fa0e)?_0x26fa0e:[_0x26fa0e];}return _0x58bd3e;}function log(_0x7b98fc,_0x357ef1,_0x56e36e,_0x4ba2f6,_0x3da5c5,_0x502979){loggers[_0x3da5c5['toLowerCase']()][_0x7b98fc](_0xce81('0x17'),_0x502979[_0xce81('0x18')](),_0x357ef1?_0x357ef1['id']:null,_0x357ef1?_0x357ef1[_0xce81('0x19')]:null,_0x357ef1?_0x357ef1[_0xce81('0x1a')]:null,getInteractionId(_0x56e36e,_0x4ba2f6,_0x3da5c5),_0x56e36e?JSON[_0xce81('0x1b')](_0x56e36e):_0xce81('0x1c'));}function updateUser(_0x206065,_0x5c74e5,_0x29675a,_0x48a4ca,_0x192ef7){db[_[_0xce81('0xe')](_0x48a4ca)+_0xce81('0x1d')][_0xce81('0x1e')]({'where':{'id':getInteractionId(_0x5c74e5,_0x29675a,_0x48a4ca)}})[_0xce81('0x1f')](function(_0x3ee79a){if(_0x3ee79a){return _0x3ee79a['update']({'UserId':_0x206065?_0x206065['id']:null});}})[_0xce81('0x1f')](function(_0x4a7607){if(_0x4a7607){log(_0xce81('0x20'),_0x206065,_0x5c74e5,_0x29675a,_0x48a4ca,_0x192ef7);}})[_0xce81('0x21')](function(){log(_0xce81('0x22'),_0x206065,_0x5c74e5,_0x29675a,_0x48a4ca,_0x192ef7);});}module[_0xce81('0x23')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x9343=['exports','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','whatsapp-interactions','chat','Website','Account','capitalize','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_messages','user_has_','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','findOne','then','update'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x9343,0xe1));var _0x3934=function(_0x1fc83c,_0x57f51e){_0x1fc83c=_0x1fc83c-0x0;var _0x4ae99e=_0x9343[_0x1fc83c];return _0x4ae99e;};'use strict';var _=require('lodash');var db=require(_0x3934('0x0'))['db'];var loggers={'openchannel':require(_0x3934('0x1'))(_0x3934('0x2')),'mail':require(_0x3934('0x1'))(_0x3934('0x3')),'fax':require(_0x3934('0x1'))('fax-interactions'),'sms':require(_0x3934('0x1'))(_0x3934('0x4')),'chat':require(_0x3934('0x1'))('chat-interactions'),'whatsapp':require(_0x3934('0x1'))(_0x3934('0x5'))};function getAccountFK(_0x15bc9c){return _['capitalize'](_0x15bc9c)+(_0x15bc9c===_0x3934('0x6')?_0x3934('0x7'):_0x3934('0x8'))+'Id';}function getInteractionFK(_0x4cd221){return _[_0x3934('0x9')](_0x4cd221)+_0x3934('0xa');}function getInteractionId(_0x595aeb,_0x402c07,_0x21ea17){if(_0x595aeb&&_0x595aeb[_[_0x3934('0xb')](_0x21ea17)+'InteractionId']){return _0x595aeb[_[_0x3934('0xb')](_0x21ea17)+_0x3934('0xa')];}else if(_0x595aeb&&_0x595aeb['id']){return _0x595aeb['id'];}else if(_0x402c07&&_0x402c07['id']){return _0x402c07['id'];}else{return _0x3934('0xc');}}function getInteractionsTables(_0x2271c6){return{'accounts':_0x2271c6+'_'+(_0x2271c6==='chat'?_0x3934('0xd'):_0x3934('0xe')),'interactions':_0x2271c6+_0x3934('0xf'),'interactionsTags':_0x2271c6+'_interaction_has_tags','messages':_0x2271c6+_0x3934('0x10'),'userInteractions':_0x3934('0x11')+_0x2271c6+'_interactions'};}function getSelectedTags(_0xfa6d34){var _0x975c06=[];if(_0xfa6d34){_0x975c06=Array['isArray'](_0xfa6d34)?_0xfa6d34:[_0xfa6d34];}return _0x975c06;}function log(_0x5b2df3,_0x19f62a,_0x2bddea,_0x19c7ed,_0x9a7526,_0x56d95f){loggers[_0x9a7526['toLowerCase']()][_0x5b2df3](_0x3934('0x12'),_0x56d95f[_0x3934('0x13')](),_0x19f62a?_0x19f62a['id']:null,_0x19f62a?_0x19f62a['name']:null,_0x19f62a?_0x19f62a[_0x3934('0x14')]:null,getInteractionId(_0x2bddea,_0x19c7ed,_0x9a7526),_0x2bddea?JSON[_0x3934('0x15')](_0x2bddea):_0x3934('0x16'));}function updateUser(_0x47fcf3,_0x4223f0,_0x19ea1f,_0x1ab95c,_0x3d4108){db[_['upperFirst'](_0x1ab95c)+_0x3934('0x17')][_0x3934('0x18')]({'where':{'id':getInteractionId(_0x4223f0,_0x19ea1f,_0x1ab95c)}})[_0x3934('0x19')](function(_0xc5113b){if(_0xc5113b){return _0xc5113b[_0x3934('0x1a')]({'UserId':_0x47fcf3?_0x47fcf3['id']:null});}})[_0x3934('0x19')](function(_0x18c1fa){if(_0x18c1fa){log('info',_0x47fcf3,_0x4223f0,_0x19ea1f,_0x1ab95c,_0x3d4108);}})['catch'](function(){log('error',_0x47fcf3,_0x4223f0,_0x19ea1f,_0x1ab95c,_0x3d4108);});}module[_0x3934('0x1b')]={'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 2396600..c43755f 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 _0xede3=['final','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64'];(function(_0x5dc9b0,_0x1f01db){var _0xe22637=function(_0x18eb84){while(--_0x18eb84){_0x5dc9b0['push'](_0x5dc9b0['shift']());}};_0xe22637(++_0x1f01db);}(_0xede3,0x1e3));var _0x3ede=function(_0x29f9f1,_0x2d497b){_0x29f9f1=_0x29f9f1-0x0;var _0x4930fb=_0xede3[_0x29f9f1];return _0x4930fb;};'use strict';var crypto=require('crypto');var util=require(_0x3ede('0x0'));var compose=require(_0x3ede('0x1'));var db=require(_0x3ede('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x3f0b7e,_0x437b9b){if(_0x3f0b7e&&_0x437b9b){if(_0x437b9b['data1']&&_0x437b9b['license']){var _0x59f7cd=_0x437b9b['data1'];var _0x12d846=_0x437b9b[_0x3ede('0x3')];var _0x1eaace=_0x59f7cd[_0x3ede('0x4')]('-')[0x4];var _0x2a55af=_0x59f7cd[_0x3ede('0x4')]('-')[0x0];var _0x297c8c=crypto[_0x3ede('0x5')](_0x3ede('0x6'),util[_0x3ede('0x7')](_0x3ede('0x8'),_0x1eaace,_0x59f7cd,_0x2a55af));var _0x312c40=_0x297c8c[_0x3ede('0x9')](_0x12d846,_0x3ede('0xa'),'utf8');_0x312c40+=_0x297c8c[_0x3ede('0xb')]('utf8');var _0x15aeb6=JSON[_0x3ede('0xc')](_0x312c40);return _0x15aeb6[_0x3ede('0xd')](_0x3f0b7e)?_0x15aeb6[_0x3f0b7e]:null;}}return null;}function isLimit(_0x37090c,_0x4c0d25,_0x5d2790,_0x4d6480){var _0x52fa3e=_0x4c0d25;return compose()[_0x3ede('0xe')](function(_0x3bbc41,_0x3d520b,_0x5d9841){return db['License'][_0x3ede('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x3ede('0x10')](function(_0x490459){var _0x17eb36=getValueFromLicense(_0x37090c,_0x490459);return _0x17eb36?_0x17eb36:_0x52fa3e;})[_0x3ede('0x10')](function(_0x41e75e){_0x52fa3e=_0x41e75e;return _0x5d2790[_0x3ede('0x11')](_0x4d6480);})[_0x3ede('0x10')](function(_0x1713e3){if(_0x1713e3>=_0x52fa3e){return _0x3d520b[_0x3ede('0x12')](0x193)[_0x3ede('0x13')]({'message':util[_0x3ede('0x7')](_0x3ede('0x14'),_0x37090c)});}_0x5d9841();})[_0x3ede('0x15')](function(_0x2458ff){_0x5d9841(_0x2458ff);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x3ede('0x16')],{'where':{'$or':[{'role':_0x3ede('0x17')},{'role':_0x3ede('0x18')}]}});}exports[_0x3ede('0x19')]=isUserLimit; \ No newline at end of file +var _0x555a=['composable-middleware','../../mysqldb','../../config/environment','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','hasOwnProperty','use','License','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','util'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0x555a,0x1a8));var _0xa555=function(_0x2daf33,_0x362615){_0x2daf33=_0x2daf33-0x0;var _0xa9462d=_0x555a[_0x2daf33];return _0xa9462d;};'use strict';var crypto=require('crypto');var util=require(_0xa555('0x0'));var compose=require(_0xa555('0x1'));var db=require(_0xa555('0x2'))['db'];var config=require(_0xa555('0x3'));function getValueFromLicense(_0x62c18d,_0x5d64b8){if(_0x62c18d&&_0x5d64b8){if(_0x5d64b8[_0xa555('0x4')]&&_0x5d64b8['license']){var _0x45cf96=_0x5d64b8['data1'];var _0xe4b4ca=_0x5d64b8['license'];var _0x1ab6b2=_0x45cf96['split']('-')[0x4];var _0xdf9a70=_0x45cf96[_0xa555('0x5')]('-')[0x0];var _0x30e594=crypto[_0xa555('0x6')](_0xa555('0x7'),util[_0xa555('0x8')](_0xa555('0x9'),_0x1ab6b2,_0x45cf96,_0xdf9a70));var _0x57cc45=_0x30e594[_0xa555('0xa')](_0xe4b4ca,_0xa555('0xb'),'utf8');_0x57cc45+=_0x30e594[_0xa555('0xc')](_0xa555('0xd'));var _0x1021a5=JSON['parse'](_0x57cc45);return _0x1021a5[_0xa555('0xe')](_0x62c18d)?_0x1021a5[_0x62c18d]:null;}}return null;}function isLimit(_0x499a6f,_0x1ff26c,_0x16f6be,_0x2c28c9){var _0x47293f=_0x1ff26c;return compose()[_0xa555('0xf')](function(_0x371b88,_0x88c58e,_0x959266){return db[_0xa555('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x54d546){var _0x55f26a=getValueFromLicense(_0x499a6f,_0x54d546);return _0x55f26a?_0x55f26a:_0x47293f;})['then'](function(_0x47aab0){_0x47293f=_0x47aab0;return _0x16f6be['count'](_0x2c28c9);})[_0xa555('0x11')](function(_0x4d3b77){if(_0x4d3b77>=_0x47293f){return _0x88c58e['status'](0x193)[_0xa555('0x12')]({'message':util[_0xa555('0x8')](_0xa555('0x13'),_0x499a6f)});}_0x959266();})[_0xa555('0x14')](function(_0x5b34ca){_0x959266(_0x5b34ca);});});}function isUserLimit(){return isLimit(_0xa555('0x15'),0x1,db[_0xa555('0x16')],{'where':{'$or':[{'role':_0xa555('0x17')},{'role':'user'}]}});}exports[_0xa555('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 1593b5c..ffe406c 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 _0x6730=['field','\x20AS\x20','text','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','shift','pop','DATE','utcOffset','hours','add','moment','parseSearch','sqlOperator','startsWith','and','replace','[$or]','split','length','slice','forEach','match','filter','indexOf','push','buildExpression','operator','$eq','$between','value','includes','$gt','$lte','days','format','YYYY-MM-DD','castTo','CAST('];(function(_0x3a069c,_0x24a39a){var _0x314dd4=function(_0x45434f){while(--_0x45434f){_0x3a069c['push'](_0x3a069c['shift']());}};_0x314dd4(++_0x24a39a);}(_0x6730,0x122));var _0x0673=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0x6730[_0x35b2a1];return _0x6023da;};'use strict';var _=require('lodash');var moment=require(_0x0673('0x0'));exports[_0x0673('0x1')]=function(_0x376199){var _0x33ef23={'conditions':[]};_0x33ef23[_0x0673('0x2')]=_[_0x0673('0x3')](_0x376199,'[$or]')?'or':_0x0673('0x4');var _0x3df1e8=_0x376199[_0x0673('0x5')]('[$and]','')['replace'](_0x0673('0x6'),'')[_0x0673('0x7')]('||');for(var _0x36bf9c=0x0;_0x36bf9c<_0x3df1e8[_0x0673('0x8')];_0x36bf9c++){var _0x1d72a9=_0x3df1e8[_0x36bf9c]['split'](':=');var _0x30937=_0x1d72a9[0x0];var _0x5f5423=_0x1d72a9[_0x0673('0x9')](0x1);_0x5f5423[_0x0673('0xa')](function(_0x19bed5){var _0x1547ed=_0x19bed5[_0x0673('0x7')]('[')['shift']();var _0x588b37=_0x19bed5[_0x0673('0xb')](/\[(.*?)\]/g);_0x588b37[_0x0673('0xa')](function(_0x3e3611){var _0x254a5b=_0x3e3611['split']('[')[_0x0673('0xc')](function(_0x46436c){return _0x46436c[_0x0673('0xd')](']')>-0x1;})['map'](function(_0x2d7a18){return _0x2d7a18[_0x0673('0x7')](']')[0x0];})[0x0];_0x33ef23['conditions'][_0x0673('0xe')]({'field':_0x30937,'operator':_0x1547ed,'value':_0x254a5b});});});}return _0x33ef23;};exports[_0x0673('0xf')]=function(_0xc1467a,_0x49ec8c,_0x252cc8){var _0x57fed1={};if(_0x49ec8c==='DATE'){if(_0x252cc8[_0x0673('0x10')]===_0x0673('0x11')){_0x252cc8['operator']=_0x0673('0x12');_0x252cc8['value']+=','+_0x252cc8[_0x0673('0x13')];}else if(_[_0x0673('0x14')]([_0x0673('0x15'),_0x0673('0x16')],_0x252cc8['operator'])){_0x252cc8[_0x0673('0x13')]=moment(_0x252cc8[_0x0673('0x13')])['add'](0x1,_0x0673('0x17'))[_0x0673('0x18')](_0x0673('0x19'));}}if(_0x252cc8['castTo']){_0x49ec8c=_0x252cc8[_0x0673('0x1a')];_0x57fed1['text']=_0x0673('0x1b')+_0xc1467a+'.'+_0x252cc8[_0x0673('0x1c')]+_0x0673('0x1d')+_0x252cc8[_0x0673('0x1a')]+')\x20'+parseOperator(_0x252cc8[_0x0673('0x10')]);}else{_0x57fed1[_0x0673('0x1e')]=_0xc1467a+'.'+_0x252cc8[_0x0673('0x1c')]+'\x20'+parseOperator(_0x252cc8['operator']);}if(_[_0x0673('0x14')](['$ne','$notIn'],_0x252cc8[_0x0673('0x10')]))_0x57fed1[_0x0673('0x1e')]='('+_0x57fed1[_0x0673('0x1e')]+'\x20OR\x20'+_0xc1467a+'.'+_0x252cc8['field']+_0x0673('0x1f');_0x57fed1[_0x0673('0x13')]=parseValue(_0x49ec8c,_0x252cc8[_0x0673('0x10')],_0x252cc8[_0x0673('0x13')]);return _0x57fed1;};function parseOperator(_0x22b792){var _0x41941b;switch(_0x22b792){case'$in':_0x41941b=_0x0673('0x20');break;case _0x0673('0x21'):_0x41941b=_0x0673('0x22');break;case'$eq':_0x41941b='=\x20?';break;case _0x0673('0x23'):_0x41941b=_0x0673('0x24');break;case _0x0673('0x25'):case _0x0673('0x26'):case _0x0673('0x27'):_0x41941b=_0x0673('0x28');break;case _0x0673('0x29'):_0x41941b=_0x0673('0x2a');break;case _0x0673('0x15'):_0x41941b='>\x20?';break;case'$lte':_0x41941b=_0x0673('0x2b');break;case _0x0673('0x2c'):_0x41941b='>=\x20?';break;case _0x0673('0x12'):_0x41941b=_0x0673('0x2d');break;}return _0x41941b;}function parseValue(_0x261b20,_0x54e6e8,_0x1abbdc){var _0x357bf7={'start':undefined,'end':undefined};switch(_0x54e6e8){case'$in':case _0x0673('0x21'):_0x357bf7[_0x0673('0x2e')]=_0x1abbdc[_0x0673('0x7')](',');break;case _0x0673('0x25'):_0x357bf7[_0x0673('0x2e')]='%'+_0x1abbdc+'%';break;case'$startsWith':_0x357bf7[_0x0673('0x2e')]=_0x1abbdc+'%';break;case _0x0673('0x27'):_0x357bf7['start']='%'+_0x1abbdc;break;case _0x0673('0x12'):var _0x2d3ba2=_0x1abbdc[_0x0673('0x7')](',');var _0x1abbdc=_0x2d3ba2[_0x0673('0x2f')]();var _0x517c30=_0x2d3ba2[_0x0673('0x30')]();if(_0x261b20===_0x0673('0x31')){_0x1abbdc=moment(_0x1abbdc)['utcOffset'](0x0,!![])['format']();_0x517c30=moment(_0x517c30)[_0x0673('0x32')](0x0,!![])['add'](0x17,_0x0673('0x33'))[_0x0673('0x34')](0x3b,'minutes')['add'](0x3b,'seconds')['format']();}_0x357bf7={'start':_0x1abbdc,'end':_0x517c30};break;default:_0x357bf7['start']=_0x1abbdc;break;}return _0x357bf7;} \ No newline at end of file +var _0x5856=['YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','operator','text','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$lte','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','replace','[$and]','split','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','$eq','$between','value','includes','$gt','add','days','format'];(function(_0x4e9f20,_0x37ba77){var _0x57d043=function(_0xea2dbf){while(--_0xea2dbf){_0x4e9f20['push'](_0x4e9f20['shift']());}};_0x57d043(++_0x37ba77);}(_0x5856,0x1d7));var _0x6585=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x5856[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var moment=require(_0x6585('0x0'));exports[_0x6585('0x1')]=function(_0x489e11){var _0x3aaa78={'conditions':[]};_0x3aaa78[_0x6585('0x2')]=_[_0x6585('0x3')](_0x489e11,'[$or]')?'or':'and';var _0x10f980=_0x489e11[_0x6585('0x4')](_0x6585('0x5'),'')['replace']('[$or]','')[_0x6585('0x6')]('||');for(var _0x56dd59=0x0;_0x56dd59<_0x10f980['length'];_0x56dd59++){var _0x1ac7bf=_0x10f980[_0x56dd59][_0x6585('0x6')](':=');var _0x3ed2ae=_0x1ac7bf[0x0];var _0x558436=_0x1ac7bf[_0x6585('0x7')](0x1);_0x558436[_0x6585('0x8')](function(_0x55416f){var _0x18942c=_0x55416f[_0x6585('0x6')]('[')[_0x6585('0x9')]();var _0x542abe=_0x55416f[_0x6585('0xa')](/\[(.*?)\]/g);_0x542abe[_0x6585('0x8')](function(_0x5ba9fd){var _0x2dfb2d=_0x5ba9fd[_0x6585('0x6')]('[')[_0x6585('0xb')](function(_0xfade3d){return _0xfade3d[_0x6585('0xc')](']')>-0x1;})[_0x6585('0xd')](function(_0x5d718f){return _0x5d718f[_0x6585('0x6')](']')[0x0];})[0x0];_0x3aaa78['conditions'][_0x6585('0xe')]({'field':_0x3ed2ae,'operator':_0x18942c,'value':_0x2dfb2d});});});}return _0x3aaa78;};exports[_0x6585('0xf')]=function(_0x10a190,_0x5bc666,_0xd5f782){var _0x48c112={};if(_0x5bc666==='DATE'){if(_0xd5f782['operator']===_0x6585('0x10')){_0xd5f782['operator']=_0x6585('0x11');_0xd5f782['value']+=','+_0xd5f782[_0x6585('0x12')];}else if(_[_0x6585('0x13')]([_0x6585('0x14'),'$lte'],_0xd5f782['operator'])){_0xd5f782[_0x6585('0x12')]=moment(_0xd5f782['value'])[_0x6585('0x15')](0x1,_0x6585('0x16'))[_0x6585('0x17')](_0x6585('0x18'));}}if(_0xd5f782[_0x6585('0x19')]){_0x5bc666=_0xd5f782[_0x6585('0x19')];_0x48c112['text']=_0x6585('0x1a')+_0x10a190+'.'+_0xd5f782[_0x6585('0x1b')]+_0x6585('0x1c')+_0xd5f782[_0x6585('0x19')]+')\x20'+parseOperator(_0xd5f782[_0x6585('0x1d')]);}else{_0x48c112[_0x6585('0x1e')]=_0x10a190+'.'+_0xd5f782[_0x6585('0x1b')]+'\x20'+parseOperator(_0xd5f782['operator']);}if(_[_0x6585('0x13')]([_0x6585('0x1f'),_0x6585('0x20')],_0xd5f782['operator']))_0x48c112['text']='('+_0x48c112[_0x6585('0x1e')]+'\x20OR\x20'+_0x10a190+'.'+_0xd5f782[_0x6585('0x1b')]+_0x6585('0x21');_0x48c112['value']=parseValue(_0x5bc666,_0xd5f782[_0x6585('0x1d')],_0xd5f782[_0x6585('0x12')]);return _0x48c112;};function parseOperator(_0x395be6){var _0x36bc85;switch(_0x395be6){case _0x6585('0x22'):_0x36bc85=_0x6585('0x23');break;case _0x6585('0x20'):_0x36bc85=_0x6585('0x24');break;case _0x6585('0x10'):_0x36bc85='=\x20?';break;case'$ne':_0x36bc85=_0x6585('0x25');break;case _0x6585('0x26'):case _0x6585('0x27'):case _0x6585('0x28'):_0x36bc85=_0x6585('0x29');break;case _0x6585('0x2a'):_0x36bc85=_0x6585('0x2b');break;case _0x6585('0x14'):_0x36bc85=_0x6585('0x2c');break;case _0x6585('0x2d'):_0x36bc85=_0x6585('0x2e');break;case _0x6585('0x2f'):_0x36bc85='>=\x20?';break;case _0x6585('0x11'):_0x36bc85=_0x6585('0x30');break;}return _0x36bc85;}function parseValue(_0x75b09,_0x5c1d33,_0x16f662){var _0x3980c1={'start':undefined,'end':undefined};switch(_0x5c1d33){case'$in':case _0x6585('0x20'):_0x3980c1[_0x6585('0x31')]=_0x16f662[_0x6585('0x6')](',');break;case _0x6585('0x26'):_0x3980c1[_0x6585('0x31')]='%'+_0x16f662+'%';break;case _0x6585('0x27'):_0x3980c1[_0x6585('0x31')]=_0x16f662+'%';break;case _0x6585('0x28'):_0x3980c1[_0x6585('0x31')]='%'+_0x16f662;break;case _0x6585('0x11'):var _0x423865=_0x16f662[_0x6585('0x6')](',');var _0x16f662=_0x423865[_0x6585('0x9')]();var _0x3b7372=_0x423865[_0x6585('0x32')]();if(_0x75b09==='DATE'){_0x16f662=moment(_0x16f662)[_0x6585('0x33')](0x0,!![])['format']();_0x3b7372=moment(_0x3b7372)[_0x6585('0x33')](0x0,!![])[_0x6585('0x15')](0x17,_0x6585('0x34'))[_0x6585('0x15')](0x3b,_0x6585('0x35'))[_0x6585('0x15')](0x3b,_0x6585('0x36'))[_0x6585('0x17')]();}_0x3980c1={'start':_0x16f662,'end':_0x3b7372};break;default:_0x3980c1[_0x6585('0x31')]=_0x16f662;break;}return _0x3980c1;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 33efa59..2c6531d 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 _0x2467=['getOptions','query','$id','intersection','attributes','order','where','filter','includes','columns','value','merge','map','lower','options','include','lodash','moment','parse','keys','model','fields','raw','split','filters','find','type','isPlainObject','$gte','utc','format','subtract','name','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','substr','ASC','omit','isEmpty','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','push','join'];(function(_0x51f6f5,_0x431c1e){var _0x4e2624=function(_0x3866a7){while(--_0x3866a7){_0x51f6f5['push'](_0x51f6f5['shift']());}};_0x4e2624(++_0x431c1e);}(_0x2467,0xfc));var _0x7246=function(_0x1ab498,_0x376389){_0x1ab498=_0x1ab498-0x0;var _0x30520b=_0x2467[_0x1ab498];return _0x30520b;};'use strict';var _=require(_0x7246('0x0'));var sequelize=require('sequelize');var moment=require(_0x7246('0x1'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x199a4d){var _0x360599=['ne'];try{var _0x59b95e=JSON[_0x7246('0x2')](_0x199a4d);var _0x285847=Object[_0x7246('0x3')](_0x59b95e)[0x0];return _0x360599['includes'](_0x285847);}catch(_0x104568){return![];}}function getOperatorValue(_0x499f18){var _0x4d70a2=JSON[_0x7246('0x2')](_0x499f18);var _0xa56f31=Object[_0x7246('0x3')](_0x4d70a2)[0x0];var _0xbf003c=_0x4d70a2[_0xa56f31];return{['$'+_0xa56f31]:_0xbf003c};}function parseIncludeModel(_0x596a38){var _0x39c13e=JSON[_0x7246('0x2')](_0x596a38);return{'model':db[_0x39c13e[_0x7246('0x4')]],'as':_0x39c13e['alias'],'attributes':_0x39c13e[_0x7246('0x5')],'raw':_0x39c13e[_0x7246('0x6')]};}exports[_0x7246('0x5')]=function(_0x4dd0f8){var _0x5fff1c=null;if(_0x4dd0f8){_0x5fff1c=_0x4dd0f8[_0x7246('0x7')](',');}return _0x5fff1c;};exports[_0x7246('0x8')]=function(_0x80f61,_0x1a40bc){var _0x4386bc={};if(!_['isEmpty'](_0x80f61)){_['forOwn'](_0x80f61,function(_0x33f9d6,_0x446bce){try{if(_0x1a40bc){var _0x3252f0=_[_0x7246('0x9')](_0x1a40bc,{'name':_0x446bce})||{};if(hasSequelizeOperator(_0x33f9d6)){_0x4386bc[_0x446bce]=getOperatorValue(_0x33f9d6);}else if(_0x3252f0[_0x7246('0xa')]==='DATE'&&_[_0x7246('0xb')](_0x33f9d6)){var _0x2a5858=JSON[_0x7246('0x2')](_0x33f9d6);var _0x1e1a74={'$gte':moment(moment(_0x2a5858[_0x7246('0xc')])['format']('YYYY-MM-DD'))[_0x7246('0xd')]()['format'](),'$lte':moment(moment(_0x2a5858['$lte'])[_0x7246('0xe')]('YYYY-MM-DD'))[_0x7246('0xd')]()[_0x7246('0xf')](0x1,'s')[_0x7246('0xe')]()};_0x4386bc[_0x446bce]=_0x1e1a74;}else if(_0x3252f0[_0x7246('0x10')]==='uniqueid'){_0x4386bc[_0x446bce]=_0x33f9d6;}else{_0x4386bc[_0x446bce]=_[_0x7246('0x11')](_0x33f9d6)?_0x33f9d6:JSON[_0x7246('0x2')](_0x33f9d6);}}else{_0x4386bc[_0x446bce]=_[_0x7246('0x11')](_0x33f9d6)?_0x33f9d6:JSON[_0x7246('0x2')](_0x33f9d6);}}catch(_0x562bf6){_0x4386bc[_0x446bce]=_0x33f9d6[_0x7246('0x7')](',');}});}return _0x4386bc;};exports[_0x7246('0x12')]=function(_0x190ac1){_0x190ac1=parseInt(_0x190ac1,0xa);if(!_0x190ac1||_0x190ac1<0x0){_0x190ac1=LIMIT_VALUE;}return _0x190ac1;};exports[_0x7246('0x13')]=function(_0x595977){_0x595977=parseInt(_0x595977,0xa);if(!_0x595977||_0x595977<0x0){_0x595977=0x0;}return _0x595977;};exports[_0x7246('0x14')]=function(_0x1a5c9d){var _0x4b6795,_0x2e107a=null;if(_0x1a5c9d){_0x4b6795=_0x1a5c9d[_0x7246('0x7')](',');_0x2e107a=_['map'](_0x4b6795,function(_0x34665b){if(_0x34665b[_0x7246('0x15')]('-')===0x0){return[_0x34665b===_0x7246('0x16')?sequelize[_0x7246('0x17')](sequelize[_0x7246('0x18')](_0x7246('0x16')),_0x7246('0x19')):_0x34665b[_0x7246('0x1a')](0x1),'DESC'];}else{return[_0x34665b===_0x7246('0x16')?sequelize[_0x7246('0x17')](sequelize[_0x7246('0x18')](_0x7246('0x16')),_0x7246('0x19')):_0x34665b,_0x7246('0x1b')];}});}return _0x2e107a;};exports[_0x7246('0x1c')]=function(_0x11c327,_0x154dce){if(_[_0x7246('0x1d')](_0x11c327)){return _0x11c327;}if(_[_0x7246('0x11')](_0x11c327)){for(var _0x1f23fd=0x0;_0x1f23fd<_0x11c327[_0x7246('0x1e')];_0x1f23fd+=0x1){_0x11c327[_0x1f23fd]=this['omit'](_0x11c327[_0x1f23fd],_0x154dce);}return _0x11c327;}if(!_[_0x7246('0x1f')](_0x11c327)){return _0x11c327;}if(_[_0x7246('0x20')](_0x154dce)){_0x154dce=[_0x154dce];}if(!_[_0x7246('0x11')](_0x154dce)){return _0x11c327;}for(var _0x34e917=0x0;_0x34e917<_0x154dce[_0x7246('0x1e')];_0x34e917+=0x1){_['unset'](_0x11c327,_0x154dce[_0x34e917]);}for(var _0x4820e3 in _0x11c327){if(_0x11c327[_0x7246('0x21')](_0x4820e3)){_0x11c327[_0x4820e3]=this[_0x7246('0x1c')](_0x11c327[_0x4820e3],_0x154dce);}}return _0x11c327;};exports[_0x7246('0x22')]=function(_0x14c15e){return _0x14c15e[_0x7246('0x23')](RegExp(_0x7246('0x24')))?!![]:![];};exports['isEmail']=function(_0x198feb){return _0x198feb[_0x7246('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x7246('0x25')]=function(_0x968a2a,_0x25e5bb){var _0x27f1f6=[];var _0x4a6fd2=/[ `!@#$%^&*()_\-?~]/;var _0x40b1ab=_0x25e5bb?_0x7246('0x26'):_0x7246('0x27');_0x968a2a['split'](/[ ,]+/)['forEach'](function(_0x8e2b07){_0x8e2b07=_0x8e2b07[_0x7246('0x28')](/([^:]")"+/g,'$1');_0x8e2b07='+'+_0x8e2b07+'*';var _0x23e5c6=_0x8e2b07['match'](_0x4a6fd2);if(_0x23e5c6){_0x8e2b07='\x22'+_0x8e2b07+'\x22';}_0x27f1f6[_0x7246('0x29')](_0x8e2b07);});_0x40b1ab=_0x40b1ab[_0x7246('0x28')](_0x7246('0x27'),_0x27f1f6[_0x7246('0x2a')]('\x20'));return _0x40b1ab;};exports[_0x7246('0x2b')]=function(_0x163c2c,_0x12d7bf,_0x1fd769){var _0x496570={},_0x2ec8d0={};if(_0x12d7bf['query']['$id']){_0x12d7bf[_0x7246('0x2c')]['id']=_0x12d7bf[_0x7246('0x2c')][_0x7246('0x2d')];delete _0x12d7bf[_0x7246('0x2c')]['$id'];}_0x496570[_0x7246('0x4')]=_['map'](_0x163c2c,_0x7246('0x10'));_0x496570['query']=_[_0x7246('0x3')](_0x12d7bf['query']);_0x496570[_0x7246('0x8')]=_[_0x7246('0x2e')](_0x496570[_0x7246('0x4')],_0x496570[_0x7246('0x2c')]);_0x2ec8d0['attributes']=_[_0x7246('0x2e')](_0x496570['model'],this[_0x7246('0x5')](_0x12d7bf['query'][_0x7246('0x5')]));_0x2ec8d0[_0x7246('0x2f')]=_0x2ec8d0[_0x7246('0x2f')][_0x7246('0x1e')]?_0x2ec8d0[_0x7246('0x2f')]:_0x496570[_0x7246('0x4')];if(!_0x12d7bf[_0x7246('0x2c')][_0x7246('0x21')]('nolimit')){_0x2ec8d0[_0x7246('0x12')]=this['limit'](_0x12d7bf[_0x7246('0x2c')][_0x7246('0x12')]);_0x2ec8d0[_0x7246('0x13')]=this[_0x7246('0x13')](_0x12d7bf['query'][_0x7246('0x13')]);}_0x2ec8d0[_0x7246('0x30')]=this['sort'](_0x12d7bf['query'][_0x7246('0x14')]);_0x2ec8d0[_0x7246('0x31')]=this[_0x7246('0x8')](_['pick'](_0x12d7bf['query'],_0x496570['filters']),_0x163c2c);if(_0x12d7bf[_0x7246('0x2c')][_0x7246('0x32')]){var _0x2c4785=_0x163c2c;var _0x818001=_0x12d7bf['query']['filter'];if(typeof _0x818001==='object'){_0x2c4785=_[_0x7246('0x32')](_0x163c2c,function(_0x4b557f){return _[_0x7246('0x33')](_0x818001[_0x7246('0x34')],_0x4b557f[_0x7246('0x10')]);});_0x818001=_0x818001[_0x7246('0x35')];}_0x2ec8d0['where']=_[_0x7246('0x36')](_0x2ec8d0[_0x7246('0x31')],{'$or':_[_0x7246('0x37')](_0x2c4785,function(_0x5d7804){if(_0x5d7804[_0x7246('0xa')]!=='VIRTUAL'){if(_0x1fd769){return sequelize['where'](sequelize['fn'](_0x7246('0x38'),sequelize[_0x7246('0x18')](_0x5d7804[_0x7246('0x10')])),{'$like':sequelize['fn'](_0x7246('0x38'),'%'+_0x12d7bf[_0x7246('0x2c')][_0x7246('0x32')]+'%')});}else{var _0x5be66b={};_0x5be66b[_0x5d7804[_0x7246('0x10')]]={'$like':'%'+_0x12d7bf[_0x7246('0x2c')]['filter']+'%'};return _0x5be66b;}}})});}_0x2ec8d0=_['merge']({},_0x2ec8d0,_0x12d7bf[_0x7246('0x39')]);return _0x2ec8d0;};exports[_0x7246('0x3a')]=function(_0x4f17e6){var _0x3c2fda=[];if(_0x4f17e6['includeAll']){_0x3c2fda[_0x7246('0x29')]({'all':!![]});}else if(_0x4f17e6[_0x7246('0x3a')]){if(Array[_0x7246('0x11')](_0x4f17e6[_0x7246('0x3a')])){_0x3c2fda=Object[_0x7246('0x3')](_0x4f17e6[_0x7246('0x3a')])[_0x7246('0x37')](function(_0x409add){return parseIncludeModel(_0x4f17e6[_0x7246('0x3a')][_0x409add]);});}else{var _0xc1fcac=parseIncludeModel(_0x4f17e6[_0x7246('0x3a')]);_0x3c2fda[_0x7246('0x29')](_0xc1fcac);}}return _0x3c2fda;}; \ No newline at end of file +var _0xe437=['unsigned','substr','ASC','length','omit','isObject','isString','unset','hasOwnProperty','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','match','push','getOptions','query','$id','intersection','attributes','nolimit','order','where','pick','filter','object','columns','value','merge','VIRTUAL','lower','options','includeAll','include','lodash','sequelize','moment','parse','keys','includes','model','alias','fields','raw','split','filters','isEmpty','DATE','$gte','format','utc','$lte','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xe437,0x69));var _0x7e43=function(_0x378a29,_0x65d651){_0x378a29=_0x378a29-0x0;var _0x27af2f=_0xe437[_0x378a29];return _0x27af2f;};'use strict';var _=require(_0x7e43('0x0'));var sequelize=require(_0x7e43('0x1'));var moment=require(_0x7e43('0x2'));var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xeea975){var _0x3423d0=['ne'];try{var _0x11cb11=JSON[_0x7e43('0x3')](_0xeea975);var _0x427730=Object[_0x7e43('0x4')](_0x11cb11)[0x0];return _0x3423d0[_0x7e43('0x5')](_0x427730);}catch(_0x279b89){return![];}}function getOperatorValue(_0x494ce6){var _0x25752a=JSON[_0x7e43('0x3')](_0x494ce6);var _0xed5596=Object[_0x7e43('0x4')](_0x25752a)[0x0];var _0x4fac58=_0x25752a[_0xed5596];return{['$'+_0xed5596]:_0x4fac58};}function parseIncludeModel(_0x94fd3b){var _0x46ba95=JSON[_0x7e43('0x3')](_0x94fd3b);return{'model':db[_0x46ba95[_0x7e43('0x6')]],'as':_0x46ba95[_0x7e43('0x7')],'attributes':_0x46ba95[_0x7e43('0x8')],'raw':_0x46ba95[_0x7e43('0x9')]};}exports['fields']=function(_0x46febb){var _0x73e787=null;if(_0x46febb){_0x73e787=_0x46febb[_0x7e43('0xa')](',');}return _0x73e787;};exports[_0x7e43('0xb')]=function(_0x38c5fb,_0x3f558a){var _0x29a052={};if(!_[_0x7e43('0xc')](_0x38c5fb)){_['forOwn'](_0x38c5fb,function(_0x107643,_0x5a6670){try{if(_0x3f558a){var _0x53b301=_['find'](_0x3f558a,{'name':_0x5a6670})||{};if(hasSequelizeOperator(_0x107643)){_0x29a052[_0x5a6670]=getOperatorValue(_0x107643);}else if(_0x53b301['type']===_0x7e43('0xd')&&_['isPlainObject'](_0x107643)){var _0x538b66=JSON[_0x7e43('0x3')](_0x107643);var _0x33a369={'$gte':moment(moment(_0x538b66[_0x7e43('0xe')])[_0x7e43('0xf')]('YYYY-MM-DD'))[_0x7e43('0x10')]()[_0x7e43('0xf')](),'$lte':moment(moment(_0x538b66[_0x7e43('0x11')])[_0x7e43('0xf')](_0x7e43('0x12')))[_0x7e43('0x10')]()[_0x7e43('0x13')](0x1,'s')['format']()};_0x29a052[_0x5a6670]=_0x33a369;}else if(_0x53b301[_0x7e43('0x14')]===_0x7e43('0x15')){_0x29a052[_0x5a6670]=_0x107643;}else{_0x29a052[_0x5a6670]=_[_0x7e43('0x16')](_0x107643)?_0x107643:JSON[_0x7e43('0x3')](_0x107643);}}else{_0x29a052[_0x5a6670]=_[_0x7e43('0x16')](_0x107643)?_0x107643:JSON[_0x7e43('0x3')](_0x107643);}}catch(_0x3ad016){_0x29a052[_0x5a6670]=_0x107643[_0x7e43('0xa')](',');}});}return _0x29a052;};exports[_0x7e43('0x17')]=function(_0x5a8c53){_0x5a8c53=parseInt(_0x5a8c53,0xa);if(!_0x5a8c53||_0x5a8c53<0x0){_0x5a8c53=LIMIT_VALUE;}return _0x5a8c53;};exports[_0x7e43('0x18')]=function(_0x5b24f6){_0x5b24f6=parseInt(_0x5b24f6,0xa);if(!_0x5b24f6||_0x5b24f6<0x0){_0x5b24f6=0x0;}return _0x5b24f6;};exports[_0x7e43('0x19')]=function(_0x11c00f){var _0x493efb,_0x446659=null;if(_0x11c00f){_0x493efb=_0x11c00f[_0x7e43('0xa')](',');_0x446659=_[_0x7e43('0x1a')](_0x493efb,function(_0x4d9701){if(_0x4d9701[_0x7e43('0x1b')]('-')===0x0){return[_0x4d9701===_0x7e43('0x1c')?sequelize[_0x7e43('0x1d')](sequelize[_0x7e43('0x1e')]('priority'),_0x7e43('0x1f')):_0x4d9701[_0x7e43('0x20')](0x1),'DESC'];}else{return[_0x4d9701===_0x7e43('0x1c')?sequelize[_0x7e43('0x1d')](sequelize[_0x7e43('0x1e')](_0x7e43('0x1c')),'unsigned'):_0x4d9701,_0x7e43('0x21')];}});}return _0x446659;};exports['omit']=function(_0xbdea56,_0x10b6cd){if(_['isEmpty'](_0xbdea56)){return _0xbdea56;}if(_[_0x7e43('0x16')](_0xbdea56)){for(var _0x51725c=0x0;_0x51725c<_0xbdea56[_0x7e43('0x22')];_0x51725c+=0x1){_0xbdea56[_0x51725c]=this[_0x7e43('0x23')](_0xbdea56[_0x51725c],_0x10b6cd);}return _0xbdea56;}if(!_[_0x7e43('0x24')](_0xbdea56)){return _0xbdea56;}if(_[_0x7e43('0x25')](_0x10b6cd)){_0x10b6cd=[_0x10b6cd];}if(!_['isArray'](_0x10b6cd)){return _0xbdea56;}for(var _0x4ba760=0x0;_0x4ba760<_0x10b6cd[_0x7e43('0x22')];_0x4ba760+=0x1){_[_0x7e43('0x26')](_0xbdea56,_0x10b6cd[_0x4ba760]);}for(var _0x243ac4 in _0xbdea56){if(_0xbdea56[_0x7e43('0x27')](_0x243ac4)){_0xbdea56[_0x243ac4]=this[_0x7e43('0x23')](_0xbdea56[_0x243ac4],_0x10b6cd);}}return _0xbdea56;};exports['isNumeric']=function(_0x4e570d){return _0x4e570d['match'](RegExp(_0x7e43('0x28')))?!![]:![];};exports[_0x7e43('0x29')]=function(_0x2ba47d){return _0x2ba47d['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7e43('0x2a')]=function(_0x37e472,_0x1abf19){var _0x118833=[];var _0x30fd09=/[ `!@#$%^&*()_\-?~]/;var _0xc62f59=_0x1abf19?_0x7e43('0x2b'):_0x7e43('0x2c');_0x37e472[_0x7e43('0xa')](/[ ,]+/)[_0x7e43('0x2d')](function(_0x4173c2){_0x4173c2=_0x4173c2[_0x7e43('0x2e')](/([^:]")"+/g,'$1');_0x4173c2='+'+_0x4173c2+'*';var _0x1f6bc4=_0x4173c2[_0x7e43('0x2f')](_0x30fd09);if(_0x1f6bc4){_0x4173c2='\x22'+_0x4173c2+'\x22';}_0x118833[_0x7e43('0x30')](_0x4173c2);});_0xc62f59=_0xc62f59[_0x7e43('0x2e')](_0x7e43('0x2c'),_0x118833['join']('\x20'));return _0xc62f59;};exports[_0x7e43('0x31')]=function(_0x5e915d,_0x564b2f,_0x9c0905){var _0x1f9a1d={},_0xa1b84={};if(_0x564b2f[_0x7e43('0x32')][_0x7e43('0x33')]){_0x564b2f[_0x7e43('0x32')]['id']=_0x564b2f[_0x7e43('0x32')][_0x7e43('0x33')];delete _0x564b2f[_0x7e43('0x32')]['$id'];}_0x1f9a1d[_0x7e43('0x6')]=_[_0x7e43('0x1a')](_0x5e915d,'name');_0x1f9a1d[_0x7e43('0x32')]=_[_0x7e43('0x4')](_0x564b2f[_0x7e43('0x32')]);_0x1f9a1d['filters']=_[_0x7e43('0x34')](_0x1f9a1d['model'],_0x1f9a1d[_0x7e43('0x32')]);_0xa1b84[_0x7e43('0x35')]=_['intersection'](_0x1f9a1d['model'],this[_0x7e43('0x8')](_0x564b2f[_0x7e43('0x32')][_0x7e43('0x8')]));_0xa1b84[_0x7e43('0x35')]=_0xa1b84[_0x7e43('0x35')][_0x7e43('0x22')]?_0xa1b84[_0x7e43('0x35')]:_0x1f9a1d[_0x7e43('0x6')];if(!_0x564b2f[_0x7e43('0x32')][_0x7e43('0x27')](_0x7e43('0x36'))){_0xa1b84[_0x7e43('0x17')]=this[_0x7e43('0x17')](_0x564b2f[_0x7e43('0x32')]['limit']);_0xa1b84[_0x7e43('0x18')]=this['offset'](_0x564b2f[_0x7e43('0x32')]['offset']);}_0xa1b84[_0x7e43('0x37')]=this[_0x7e43('0x19')](_0x564b2f[_0x7e43('0x32')][_0x7e43('0x19')]);_0xa1b84[_0x7e43('0x38')]=this[_0x7e43('0xb')](_[_0x7e43('0x39')](_0x564b2f[_0x7e43('0x32')],_0x1f9a1d[_0x7e43('0xb')]),_0x5e915d);if(_0x564b2f['query'][_0x7e43('0x3a')]){var _0x1407dd=_0x5e915d;var _0x2dd4fc=_0x564b2f[_0x7e43('0x32')][_0x7e43('0x3a')];if(typeof _0x2dd4fc===_0x7e43('0x3b')){_0x1407dd=_[_0x7e43('0x3a')](_0x5e915d,function(_0x49f8e2){return _[_0x7e43('0x5')](_0x2dd4fc[_0x7e43('0x3c')],_0x49f8e2['name']);});_0x2dd4fc=_0x2dd4fc[_0x7e43('0x3d')];}_0xa1b84[_0x7e43('0x38')]=_[_0x7e43('0x3e')](_0xa1b84[_0x7e43('0x38')],{'$or':_[_0x7e43('0x1a')](_0x1407dd,function(_0x2475ad){if(_0x2475ad['type']!==_0x7e43('0x3f')){if(_0x9c0905){return sequelize[_0x7e43('0x38')](sequelize['fn'](_0x7e43('0x40'),sequelize[_0x7e43('0x1e')](_0x2475ad[_0x7e43('0x14')])),{'$like':sequelize['fn'](_0x7e43('0x40'),'%'+_0x564b2f[_0x7e43('0x32')][_0x7e43('0x3a')]+'%')});}else{var _0x424895={};_0x424895[_0x2475ad[_0x7e43('0x14')]]={'$like':'%'+_0x564b2f[_0x7e43('0x32')]['filter']+'%'};return _0x424895;}}})});}_0xa1b84=_[_0x7e43('0x3e')]({},_0xa1b84,_0x564b2f[_0x7e43('0x41')]);return _0xa1b84;};exports['include']=function(_0x2f44fb){var _0x1f1da8=[];if(_0x2f44fb[_0x7e43('0x42')]){_0x1f1da8[_0x7e43('0x30')]({'all':!![]});}else if(_0x2f44fb[_0x7e43('0x43')]){if(Array[_0x7e43('0x16')](_0x2f44fb[_0x7e43('0x43')])){_0x1f1da8=Object['keys'](_0x2f44fb[_0x7e43('0x43')])[_0x7e43('0x1a')](function(_0x205316){return parseIncludeModel(_0x2f44fb['include'][_0x205316]);});}else{var _0xd0b68f=parseIncludeModel(_0x2f44fb[_0x7e43('0x43')]);_0x1f1da8[_0x7e43('0x30')](_0xd0b68f);}}return _0x1f1da8;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 07d615e..aa4242f 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 _0x7fbe=['chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','*pause','getAgentStatus','isArray','map','getAgents','flatten','uniq','value','includes','busy','getAgentIdsByStatus','resolve','User','findAll','name','fullname','whatsappPause','pauseType','find','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','pick','filterAgentAttributes','role','mailStatus','openchannelStatusTime','smsStatusTime','chatCapacity','smsCurrentCapacity','onhold','routealias','../../mysqldb','client','http'];(function(_0x14ed4e,_0x3dcf54){var _0x5c3d8a=function(_0x284a91){while(--_0x284a91){_0x14ed4e['push'](_0x14ed4e['shift']());}};_0x5c3d8a(++_0x3dcf54);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x6b5f2e,_0x98ce11){_0x6b5f2e=_0x6b5f2e-0x0;var _0x572297=_0x7fbe[_0x6b5f2e];return _0x572297;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0xe7fb('0x0'))['db'];var amiClient=jayson[_0xe7fb('0x1')][_0xe7fb('0x2')]({'port':0x232a});var routingClient=jayson[_0xe7fb('0x1')][_0xe7fb('0x2')]({'port':0x232c});function isAgentPaused(_0x47625b,_0x11d2c4){var _0x4524ff=[_0x47625b[_0xe7fb('0x3')],_0x47625b[_0xe7fb('0x4')],_0x47625b[_0xe7fb('0x5')],_0x47625b[_0xe7fb('0x6')],_0x47625b[_0xe7fb('0x7')],_0x47625b[_0xe7fb('0x8')],_0x47625b['whatsappPause']];if(!_0x11d2c4)return _[_0xe7fb('0x9')](_0x4524ff);var _0x228f6b=_[_0xe7fb('0xa')](_0x4524ff);return _0x228f6b[_0xe7fb('0xb')]>0x0&&_0x228f6b['length']<_0x4524ff['length']?!![]:![];}function isIdle(_0x29edb2){return _0x29edb2===_0xe7fb('0xc')||_0x29edb2===_0xe7fb('0xd')||_0x29edb2===_0xe7fb('0xe')||_0x29edb2===_0xe7fb('0xf')||_[_0xe7fb('0x10')](_0x29edb2);}function isAgentIdle(_0x3e934b){if(_0x3e934b[_0xe7fb('0x11')]!==_0xe7fb('0xc')&&_0x3e934b[_0xe7fb('0x8')]){_0x3e934b[_0xe7fb('0x11')]=_0xe7fb('0x12');return![];}return _[_0xe7fb('0x9')]([_0x3e934b[_0xe7fb('0x13')],_0x3e934b[_0xe7fb('0x14')],_0x3e934b['mailStatus'],_0x3e934b[_0xe7fb('0x15')],_0x3e934b[_0xe7fb('0x16')],_0x3e934b['voiceStatus'],_0x3e934b[_0xe7fb('0x17')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xe7fb('0x18')]('Agents',{})[_0xe7fb('0x19')](function(_0x559129){if(_0x559129[_0xe7fb('0x1a')]){throw new Error(_0xe7fb('0x1b'));}var _0x12603d=_0x559129[_0xe7fb('0x1c')];return routingClient['request'](_0xe7fb('0x1d'),{})['then'](function(_0x293a47){if(_0x293a47['error']){throw new Error(_0xe7fb('0x1e'));}var _0x4708f7=_0x293a47[_0xe7fb('0x1c')];return _[_0xe7fb('0x1f')]({},_0x12603d,_0x4708f7);});})['catch'](function(_0x44466e){throw _0x44466e;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x11cae0){var _0x51f01f=_0xe7fb('0xd');if(isAgentPaused(_0x11cae0))_0x51f01f='pause';else if(isAgentPaused(_0x11cae0,!![]))_0x51f01f=_0xe7fb('0x20');else if(isAgentIdle(_0x11cae0))_0x51f01f=_0xe7fb('0xc');else _0x51f01f='busy';return _0x51f01f;}exports[_0xe7fb('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x4742bd,_0x3ae8f1){var _0x4dcb4b=_[_0xe7fb('0x22')](_0x4742bd)?_0x4742bd:[_0x4742bd];var _0x469ead=_['startCase'](_0x3ae8f1)+'Queue';var _0x52f08b=_[_0xe7fb('0x23')](_0x4dcb4b,function(_0x53c43a){return db[_0x469ead]['findOne']({'where':{'id':_0x53c43a}})[_0xe7fb('0x19')](function(_0x32e8b2){if(!_0x32e8b2)return[];return _0x32e8b2[_0xe7fb('0x24')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x52f08b)[_0xe7fb('0x19')](function(_0x2b69c4){var _0x390f32=_(_0x2b69c4)[_0xe7fb('0x25')]()[_0xe7fb('0x23')]('id')[_0xe7fb('0x26')]()[_0xe7fb('0x27')]();return _0x390f32;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5df9f2,_0x1086e6,_0x3bdee9){try{if(_0x1086e6[_0xe7fb('0xb')]>0x0){_0x5df9f2=_0x5df9f2['filter'](function(_0xb1f2f4){return _0x1086e6[_0xe7fb('0x28')](_0xb1f2f4['id']);});}var _0xd3fffe=_0x5df9f2[_0xe7fb('0xa')](function(_0x219554){var _0x1256d4=_0xe7fb('0x29');if(isAgentIdle(_0x219554)){_0x1256d4=_0xe7fb('0xc');}return _0x1256d4===_0x3bdee9;});return _['map'](_0xd3fffe,'id');}catch(_0x3d1fb5){throw _0x3d1fb5;}}exports[_0xe7fb('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x29d1ca,_0x547a04,_0x517d70){return Promise[_0xe7fb('0x2b')]()['then'](function(){if(_0x547a04[_0xe7fb('0xb')]>0x0){_0x29d1ca=_0x29d1ca[_0xe7fb('0xa')](function(_0xe49053){return _0x547a04[_0xe7fb('0x28')](_0xe49053['id']);});}return _0x29d1ca;})['then'](function(){return db[_0xe7fb('0x2c')][_0xe7fb('0x2d')]({'attributes':['id',_0xe7fb('0x2e'),_0xe7fb('0x2f'),_0xe7fb('0x3'),'faxPause',_0xe7fb('0x5'),_0xe7fb('0x6'),_0xe7fb('0x7'),_0xe7fb('0x8'),_0xe7fb('0x30'),_0xe7fb('0x31')],'where':{'id':{'$in':_[_0xe7fb('0x23')](_0x29d1ca,'id')}},'raw':!![]});})[_0xe7fb('0x19')](function(_0x389903){return _0x389903['map'](function(_0x44d8cf){var _0x29ef52=_[_0xe7fb('0x32')](_0x29d1ca,['id',_0x44d8cf['id']]);var _0x56e17b=filterAgentAttributes(_0x29ef52);_[_0xe7fb('0x1f')](_0x44d8cf,_0x56e17b);_0x44d8cf[_0xe7fb('0x33')]=getAgentStatus(_0x44d8cf);return _0x44d8cf;});})[_0xe7fb('0x19')](function(_0x1530b1){var _0x402ca3=sortAgentsByStatus(_0x1530b1,_0x517d70);return _[_0xe7fb('0x23')](_0x402ca3,'id');})[_0xe7fb('0x34')](function(_0xc4e271){throw _0xc4e271;});}exports[_0xe7fb('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xebfe1d){var _0x29c34a={'fields':[],'order':null};var _0x3c4f4b=_0xebfe1d[_0xe7fb('0x36')](',');_0x29c34a[_0xe7fb('0x37')]=_[_0xe7fb('0xa')](_0x3c4f4b,function(_0x41e2d1){if(!_0x41e2d1[_0xe7fb('0x28')](_0xe7fb('0x33'))){return!![];}_0x29c34a[_0xe7fb('0x38')]=_['startsWith'](_0x41e2d1,'-')?_0xe7fb('0x39'):_0xe7fb('0x3a');return![];});return _0x29c34a;}exports[_0xe7fb('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x444f98){if(!_0x444f98){_0x444f98='fullname,internal';}if(_0x444f98[_0xe7fb('0x28')](_0xe7fb('0x2f'))&&!_0x444f98[_0xe7fb('0x28')](_0xe7fb('0x3c'))){var _0x49fe9d=_0x444f98[_0xe7fb('0x3d')](0x0,_0x444f98[_0xe7fb('0x3e')](_0xe7fb('0x2f')));_0x444f98+=','+_0x49fe9d+_0xe7fb('0x3c');}return _0x444f98;}exports[_0xe7fb('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0xb729fc,_0x5c4243){var _0x4362c2=_0xb729fc[_0xe7fb('0x40')](function(_0x3a96cd,_0x4b263d){if(_0x3a96cd[_0xe7fb('0x33')]===_0x4b263d[_0xe7fb('0x33')]){if(_0x3a96cd['globalStatus']==='pause'){if(_0x5c4243==='DESC'){return(_0x3a96cd['pauseType']||'')<(_0x4b263d['pauseType']||'')||_0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()>_0x4b263d[_0xe7fb('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return(_0x3a96cd[_0xe7fb('0x31')]||'')<(_0x4b263d['pauseType']||'')||_0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()>_0x4b263d['fullname'][_0xe7fb('0x41')]()?-0x1:0x1;}}else{if(_0x5c4243===_0xe7fb('0x39')){return _0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()<_0x4b263d['fullname'][_0xe7fb('0x41')]()?0x1:-0x1;}else{return _0x3a96cd[_0xe7fb('0x2f')][_0xe7fb('0x41')]()<_0x4b263d['fullname'][_0xe7fb('0x41')]()?-0x1:0x1;}}}else{if(_0x5c4243===_0xe7fb('0x39')){return _0x3a96cd[_0xe7fb('0x33')]<_0x4b263d[_0xe7fb('0x33')]?0x1:-0x1;}else{return _0x3a96cd[_0xe7fb('0x33')]<_0x4b263d['globalStatus']?-0x1:0x1;}}});return _0x4362c2;}exports[_0xe7fb('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x4df4aa){var _0x2c72dd=[_0xe7fb('0x43'),_0xe7fb('0x44'),_0xe7fb('0x45'),_0xe7fb('0x46'),'pauseType',_0xe7fb('0x46'),'internal','address',_0xe7fb('0x3'),_0xe7fb('0x6'),_0xe7fb('0x5'),'smsPause',_0xe7fb('0x30'),_0xe7fb('0x4'),'voicePause','chatCapacity',_0xe7fb('0x47'),_0xe7fb('0x48'),_0xe7fb('0x49'),_0xe7fb('0x4a'),_0xe7fb('0x4b'),_0xe7fb('0x4c'),_0xe7fb('0x4d'),_0xe7fb('0x4e'),'smsCurrentCapacity',_0xe7fb('0x4f'),'faxCurrentCapacity',_0xe7fb('0x13'),_0xe7fb('0x15'),'mailStatus',_0xe7fb('0x16'),'whatsappStatus',_0xe7fb('0x14'),'voiceStatus',_0xe7fb('0x50'),'openchannelStatusTime',_0xe7fb('0x51'),'smsStatusTime',_0xe7fb('0x52'),_0xe7fb('0x53'),_0xe7fb('0x54'),_0xe7fb('0x55'),_0xe7fb('0x56'),_0xe7fb('0x57'),_0xe7fb('0x58'),'phoneBarEnableAutomaticScreenRecording','routealias'];var _0x20aa55=['chatPause','openchannelPause','mailPause','smsPause','whatsappPause',_0xe7fb('0x4'),_0xe7fb('0x8'),_0xe7fb('0x44')];var _0x1d2359=_(_0x4df4aa)['omit'](_0x20aa55)[_0xe7fb('0x59')](_0x2c72dd)[_0xe7fb('0x27')]();return _0x1d2359;}exports[_0xe7fb('0x5a')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name','fullname',_0xe7fb('0x5b'),_0xe7fb('0x3c'),_0xe7fb('0x44'),'globalStatus',_0xe7fb('0x43'),_0xe7fb('0x45'),_0xe7fb('0x31'),_0xe7fb('0x46'),'faxPause','chatPause',_0xe7fb('0x5'),_0xe7fb('0x6'),_0xe7fb('0x7'),_0xe7fb('0x8'),_0xe7fb('0x30'),'chatStatus',_0xe7fb('0x14'),_0xe7fb('0x5c'),_0xe7fb('0x15'),'smsStatus','voiceStatus',_0xe7fb('0x17'),_0xe7fb('0x50'),_0xe7fb('0x53'),_0xe7fb('0x51'),_0xe7fb('0x5d'),_0xe7fb('0x5e'),'voiceStatusTime',_0xe7fb('0x52'),_0xe7fb('0x5f'),_0xe7fb('0x4b'),_0xe7fb('0x48'),_0xe7fb('0x47'),_0xe7fb('0x49'),'whatsappCapacity',_0xe7fb('0x4c'),'faxCurrentCapacity',_0xe7fb('0x4e'),_0xe7fb('0x4d'),_0xe7fb('0x60'),_0xe7fb('0x4f'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording',_0xe7fb('0x56'),_0xe7fb('0x61'),_0xe7fb('0x55'),_0xe7fb('0x62'),_0xe7fb('0x57')];}exports['getRealtimeAgentsQueryFields']=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x6aa7=['getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','name','chatPause','pauseType','find','globalStatus','fields','order','startsWith','DESC','ASC','fullname,internal','fullname','internal','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','openchannelPause','faxPause','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','role','openchannelStatusTime','smsStatusTime','chatCurrentCapacity','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','onhold','getRealtimeAgentsQueryFields','lodash','../../mysqldb','client','http','mailPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','every','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','Agents','then','error','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','getAgents','all','flatten','uniq','value'];(function(_0x445019,_0x16d112){var _0x1837a3=function(_0x1fbf4f){while(--_0x1fbf4f){_0x445019['push'](_0x445019['shift']());}};_0x1837a3(++_0x16d112);}(_0x6aa7,0x178));var _0x76aa=function(_0xc3e68,_0x4b8a6d){_0xc3e68=_0xc3e68-0x0;var _0x2bb09b=_0x6aa7[_0xc3e68];return _0x2bb09b;};'use strict';var _=require(_0x76aa('0x0'));var jayson=require('jayson/promise');var db=require(_0x76aa('0x1'))['db'];var amiClient=jayson[_0x76aa('0x2')][_0x76aa('0x3')]({'port':0x232a});var routingClient=jayson[_0x76aa('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x13f62b,_0xef15ef){var _0x1d6e04=[_0x13f62b['chatPause'],_0x13f62b['faxPause'],_0x13f62b[_0x76aa('0x4')],_0x13f62b['openchannelPause'],_0x13f62b[_0x76aa('0x5')],_0x13f62b[_0x76aa('0x6')],_0x13f62b[_0x76aa('0x7')]];if(!_0xef15ef)return _['every'](_0x1d6e04);var _0x3dae33=_[_0x76aa('0x8')](_0x1d6e04);return _0x3dae33[_0x76aa('0x9')]>0x0&&_0x3dae33['length']<_0x1d6e04[_0x76aa('0x9')]?!![]:![];}function isIdle(_0x25856d){return _0x25856d===_0x76aa('0xa')||_0x25856d===_0x76aa('0xb')||_0x25856d===_0x76aa('0xc')||_0x25856d===_0x76aa('0xd')||_[_0x76aa('0xe')](_0x25856d);}function isAgentIdle(_0x8dc35c){if(_0x8dc35c[_0x76aa('0xf')]!==_0x76aa('0xa')&&_0x8dc35c['voicePause']){_0x8dc35c[_0x76aa('0xf')]='pause';return![];}return _[_0x76aa('0x10')]([_0x8dc35c[_0x76aa('0x11')],_0x8dc35c[_0x76aa('0x12')],_0x8dc35c[_0x76aa('0x13')],_0x8dc35c[_0x76aa('0x14')],_0x8dc35c['smsStatus'],_0x8dc35c['voiceStatus'],_0x8dc35c[_0x76aa('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x76aa('0x16'),{})[_0x76aa('0x17')](function(_0x5cf594){if(_0x5cf594[_0x76aa('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x328381=_0x5cf594['result'];return routingClient[_0x76aa('0x19')](_0x76aa('0x16'),{})[_0x76aa('0x17')](function(_0x21c16d){if(_0x21c16d[_0x76aa('0x18')]){throw new Error(_0x76aa('0x1a'));}var _0x496902=_0x21c16d['result'];return _[_0x76aa('0x1b')]({},_0x328381,_0x496902);});})[_0x76aa('0x1c')](function(_0xf0711){throw _0xf0711;});}exports[_0x76aa('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x15109b){var _0x191560=_0x76aa('0xb');if(isAgentPaused(_0x15109b))_0x191560=_0x76aa('0x1e');else if(isAgentPaused(_0x15109b,!![]))_0x191560=_0x76aa('0x1f');else if(isAgentIdle(_0x15109b))_0x191560='idle';else _0x191560=_0x76aa('0x20');return _0x191560;}exports[_0x76aa('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x338a6b,_0x5b3f55){var _0x41463a=_[_0x76aa('0x22')](_0x338a6b)?_0x338a6b:[_0x338a6b];var _0x31252f=_[_0x76aa('0x23')](_0x5b3f55)+_0x76aa('0x24');var _0xc1044c=_[_0x76aa('0x25')](_0x41463a,function(_0x3363b3){return db[_0x31252f][_0x76aa('0x26')]({'where':{'id':_0x3363b3}})[_0x76aa('0x17')](function(_0x37f1ab){if(!_0x37f1ab)return[];return _0x37f1ab[_0x76aa('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x76aa('0x28')](_0xc1044c)['then'](function(_0xb5e8a9){var _0x1d6d15=_(_0xb5e8a9)[_0x76aa('0x29')]()[_0x76aa('0x25')]('id')[_0x76aa('0x2a')]()[_0x76aa('0x2b')]();return _0x1d6d15;});}exports[_0x76aa('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x282d0a,_0xd12a99,_0x1bdc3d){try{if(_0xd12a99['length']>0x0){_0x282d0a=_0x282d0a[_0x76aa('0x8')](function(_0x5a8030){return _0xd12a99[_0x76aa('0x2d')](_0x5a8030['id']);});}var _0x365ff8=_0x282d0a[_0x76aa('0x8')](function(_0x1e90b9){var _0x1eecd9=_0x76aa('0x20');if(isAgentIdle(_0x1e90b9)){_0x1eecd9=_0x76aa('0xa');}return _0x1eecd9===_0x1bdc3d;});return _[_0x76aa('0x25')](_0x365ff8,'id');}catch(_0x19fd4f){throw _0x19fd4f;}}exports[_0x76aa('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5edcd8,_0x430ad6,_0x5532c7){return Promise[_0x76aa('0x2f')]()[_0x76aa('0x17')](function(){if(_0x430ad6[_0x76aa('0x9')]>0x0){_0x5edcd8=_0x5edcd8[_0x76aa('0x8')](function(_0x35a705){return _0x430ad6['includes'](_0x35a705['id']);});}return _0x5edcd8;})[_0x76aa('0x17')](function(){return db[_0x76aa('0x30')]['findAll']({'attributes':['id',_0x76aa('0x31'),'fullname',_0x76aa('0x32'),'faxPause',_0x76aa('0x4'),'openchannelPause','smsPause',_0x76aa('0x6'),_0x76aa('0x7'),_0x76aa('0x33')],'where':{'id':{'$in':_[_0x76aa('0x25')](_0x5edcd8,'id')}},'raw':!![]});})['then'](function(_0x592596){return _0x592596[_0x76aa('0x25')](function(_0x1c7b6f){var _0x58127c=_[_0x76aa('0x34')](_0x5edcd8,['id',_0x1c7b6f['id']]);var _0x23029e=filterAgentAttributes(_0x58127c);_['merge'](_0x1c7b6f,_0x23029e);_0x1c7b6f[_0x76aa('0x35')]=getAgentStatus(_0x1c7b6f);return _0x1c7b6f;});})['then'](function(_0x5086f5){var _0x4fdbde=sortAgentsByStatus(_0x5086f5,_0x5532c7);return _[_0x76aa('0x25')](_0x4fdbde,'id');})[_0x76aa('0x1c')](function(_0x127bc4){throw _0x127bc4;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x401c07){var _0x1c22f7={'fields':[],'order':null};var _0x2eea79=_0x401c07['split'](',');_0x1c22f7[_0x76aa('0x36')]=_[_0x76aa('0x8')](_0x2eea79,function(_0x2f7726){if(!_0x2f7726[_0x76aa('0x2d')](_0x76aa('0x35'))){return!![];}_0x1c22f7[_0x76aa('0x37')]=_[_0x76aa('0x38')](_0x2f7726,'-')?_0x76aa('0x39'):_0x76aa('0x3a');return![];});return _0x1c22f7;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x1525cb){if(!_0x1525cb){_0x1525cb=_0x76aa('0x3b');}if(_0x1525cb[_0x76aa('0x2d')](_0x76aa('0x3c'))&&!_0x1525cb[_0x76aa('0x2d')](_0x76aa('0x3d'))){var _0x572fdb=_0x1525cb['substring'](0x0,_0x1525cb[_0x76aa('0x3e')](_0x76aa('0x3c')));_0x1525cb+=','+_0x572fdb+_0x76aa('0x3d');}return _0x1525cb;}exports[_0x76aa('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x50599f,_0x174a14){var _0x403084=_0x50599f[_0x76aa('0x40')](function(_0x30cdcb,_0x1138b5){if(_0x30cdcb['globalStatus']===_0x1138b5[_0x76aa('0x35')]){if(_0x30cdcb['globalStatus']===_0x76aa('0x1e')){if(_0x174a14==='DESC'){return(_0x30cdcb['pauseType']||'')<(_0x1138b5['pauseType']||'')||_0x30cdcb[_0x76aa('0x3c')]['toLowerCase']()>_0x1138b5['fullname']['toLowerCase']()?0x1:-0x1;}else{return(_0x30cdcb[_0x76aa('0x33')]||'')<(_0x1138b5[_0x76aa('0x33')]||'')||_0x30cdcb[_0x76aa('0x3c')][_0x76aa('0x41')]()>_0x1138b5[_0x76aa('0x3c')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x174a14===_0x76aa('0x39')){return _0x30cdcb[_0x76aa('0x3c')][_0x76aa('0x41')]()<_0x1138b5[_0x76aa('0x3c')][_0x76aa('0x41')]()?0x1:-0x1;}else{return _0x30cdcb['fullname'][_0x76aa('0x41')]()<_0x1138b5[_0x76aa('0x3c')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x174a14===_0x76aa('0x39')){return _0x30cdcb['globalStatus']<_0x1138b5[_0x76aa('0x35')]?0x1:-0x1;}else{return _0x30cdcb[_0x76aa('0x35')]<_0x1138b5[_0x76aa('0x35')]?-0x1:0x1;}}});return _0x403084;}exports[_0x76aa('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x2d0bc4){var _0x3e0315=[_0x76aa('0x43'),_0x76aa('0x44'),_0x76aa('0x45'),_0x76aa('0x46'),'pauseType',_0x76aa('0x46'),'internal',_0x76aa('0x47'),_0x76aa('0x32'),_0x76aa('0x48'),_0x76aa('0x4'),'smsPause','whatsappPause',_0x76aa('0x49'),'voicePause',_0x76aa('0x4a'),_0x76aa('0x4b'),_0x76aa('0x4c'),_0x76aa('0x4d'),_0x76aa('0x4e'),_0x76aa('0x4f'),'chatCurrentCapacity','openchannelCurrentCapacity',_0x76aa('0x50'),_0x76aa('0x51'),_0x76aa('0x52'),_0x76aa('0x53'),_0x76aa('0x11'),_0x76aa('0x14'),'mailStatus',_0x76aa('0x54'),_0x76aa('0x15'),_0x76aa('0x12'),'voiceStatus',_0x76aa('0x55'),'openchannelStatusTime',_0x76aa('0x56'),'smsStatusTime',_0x76aa('0x57'),_0x76aa('0x58'),_0x76aa('0x59'),_0x76aa('0x5a'),_0x76aa('0x5b'),_0x76aa('0x5c'),_0x76aa('0x5d'),'phoneBarEnableAutomaticScreenRecording',_0x76aa('0x5e')];var _0x5eeaa5=[_0x76aa('0x32'),_0x76aa('0x48'),_0x76aa('0x4'),_0x76aa('0x5'),_0x76aa('0x7'),_0x76aa('0x49'),_0x76aa('0x6'),'online'];var _0x333a3a=_(_0x2d0bc4)[_0x76aa('0x5f')](_0x5eeaa5)[_0x76aa('0x60')](_0x3e0315)[_0x76aa('0x2b')]();return _0x333a3a;}exports['filterAgentAttributes']=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x76aa('0x31'),_0x76aa('0x3c'),_0x76aa('0x61'),_0x76aa('0x3d'),_0x76aa('0x44'),_0x76aa('0x35'),'userpic',_0x76aa('0x45'),_0x76aa('0x33'),_0x76aa('0x46'),_0x76aa('0x49'),_0x76aa('0x32'),_0x76aa('0x4'),_0x76aa('0x48'),'smsPause','voicePause',_0x76aa('0x7'),_0x76aa('0x11'),'faxStatus',_0x76aa('0x13'),_0x76aa('0x14'),'smsStatus',_0x76aa('0xf'),_0x76aa('0x15'),_0x76aa('0x55'),_0x76aa('0x58'),_0x76aa('0x56'),_0x76aa('0x62'),_0x76aa('0x63'),_0x76aa('0x59'),_0x76aa('0x57'),'chatCapacity',_0x76aa('0x4f'),'mailCapacity',_0x76aa('0x4b'),_0x76aa('0x4d'),_0x76aa('0x4e'),_0x76aa('0x64'),_0x76aa('0x53'),_0x76aa('0x50'),_0x76aa('0x65'),_0x76aa('0x51'),_0x76aa('0x52'),'phoneBarEnableScreenRecordingByAgent',_0x76aa('0x66'),_0x76aa('0x5b'),_0x76aa('0x67'),_0x76aa('0x5a'),_0x76aa('0x5e'),_0x76aa('0x5c')];}exports[_0x76aa('0x68')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 4204df9..84ac901 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 _0xf034=['map','paused','loggedInDb','loggedIn','available','busy','merge','pick','initializeQueues','lodash','util','waiting','inUse','invalid','onHold','ringing','ringInUse','talking','unavailable','unknown','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound'];(function(_0x18e626,_0x162d89){var _0x4aa088=function(_0x17f2a7){while(--_0x17f2a7){_0x18e626['push'](_0x18e626['shift']());}};_0x4aa088(++_0x162d89);}(_0xf034,0xea));var _0x4f03=function(_0x3aab06,_0x5d93e8){_0x3aab06=_0x3aab06-0x0;var _0x5727af=_0xf034[_0x3aab06];return _0x5727af;};'use strict';var _=require(_0x4f03('0x0'));var jayson=require('jayson/promise');var util=require(_0x4f03('0x1'));var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn','paused',_0x4f03('0x2')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x4f03('0x3'),_0x4f03('0x4'),'loggedInDb','notInUse',_0x4f03('0x5'),_0x4f03('0x6'),_0x4f03('0x7'),_0x4f03('0x8'),_0x4f03('0x9'),_0x4f03('0xa')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated','message','statusMessage','dialActive','dialMethod',_0x4f03('0xb'),_0x4f03('0xc'),_0x4f03('0xd'),_0x4f03('0xe'),_0x4f03('0xf'),_0x4f03('0x10'),_0x4f03('0x11'),_0x4f03('0x12'),_0x4f03('0x13'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls',_0x4f03('0x14'),'predictiveIntervalDroppedCallsTimeout',_0x4f03('0x15'),_0x4f03('0x16'),_0x4f03('0x17')];function getRealtimeQueues(_0x4b98cb,_0x2ce71f){var _0x327577=_0x2ce71f==='voice'?amiClient:routingClient;return _0x327577[_0x4f03('0x18')](_[_0x4f03('0x19')](_0x2ce71f)+_0x4f03('0x1a'),_0x4b98cb)[_0x4f03('0x1b')](function(_0x26c10d){if(_0x26c10d[_0x4f03('0x1c')])throw new Error(util[_0x4f03('0x1d')](_0x4f03('0x1e'),_0x2ce71f));return _0x26c10d['result'];})[_0x4f03('0x1f')](function(_0x20f2fa){throw _0x20f2fa;});}exports[_0x4f03('0x20')]=getRealtimeQueues;function initializeQueues(_0x473d00,_0x2a903a,_0x1cd185,_0x137215){var _0x35205a=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1cd185==='voice'){if(_0x137215===_0x4f03('0x21')){_0x35205a=_0x35205a[_0x4f03('0x22')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x137215===_0x4f03('0x23')){_0x35205a=_0x35205a[_0x4f03('0x22')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x473d00[_0x4f03('0x24')](function(_0x1c6b1b){var _0x2a151a=_0x1c6b1b['get']({'plain':!![]});_0x2a151a[_0x4f03('0x25')]=0x0;_0x2a151a[_0x4f03('0x26')]=0x0;_0x2a151a[_0x4f03('0x27')]=0x0;_0x2a151a[_0x4f03('0x28')]=0x0;_0x2a151a[_0x4f03('0x2')]=0x0;if(_0x1cd185==='voice'){_0x2a151a[_0x4f03('0x8')]=0x0;_0x2a151a[_0x4f03('0x29')]=0x0;if(_0x137215==='outbound'){_0x2a151a['pTalking']=0x0;_0x2a151a['originated']=0x0;}}var _0xeb44de=_['find'](_0x2a903a,['id',_0x2a151a['id']]);if(_0xeb44de){_[_0x4f03('0x2a')](_0x2a151a,_[_0x4f03('0x2b')](_0xeb44de,_0x35205a));}return _0x2a151a;});}exports[_0x4f03('0x2c')]=initializeQueues; \ No newline at end of file +var _0x7dc0=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','voice','inbound','concat','outbound','map','paused','find','pick','jayson/promise','util','client','http','available','loggedIn','waiting','inUse','loggedInDb','notInUse','onHold','ringInUse','talking','unknown','pTalking','originated','message','dialActive','dialMethod','startProgressive','erlangCalls'];(function(_0x12595c,_0x2e18b4){var _0x4d5db3=function(_0x12bc1d){while(--_0x12bc1d){_0x12595c['push'](_0x12595c['shift']());}};_0x4d5db3(++_0x2e18b4);}(_0x7dc0,0x134));var _0x07dc=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0x7dc0[_0x2ed7d1];return _0x38ae3c;};'use strict';var _=require('lodash');var jayson=require(_0x07dc('0x0'));var util=require(_0x07dc('0x1'));var amiClient=jayson[_0x07dc('0x2')][_0x07dc('0x3')]({'port':0x232a});var routingClient=jayson[_0x07dc('0x2')][_0x07dc('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x07dc('0x4'),_0x07dc('0x5'),'paused',_0x07dc('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x07dc('0x7'),'invalid',_0x07dc('0x8'),_0x07dc('0x9'),_0x07dc('0xa'),'ringing',_0x07dc('0xb'),_0x07dc('0xc'),'unavailable',_0x07dc('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x07dc('0xe'),_0x07dc('0xf'),_0x07dc('0x10'),'statusMessage',_0x07dc('0x11'),_0x07dc('0x12'),'Trunk','startPredictive',_0x07dc('0x13'),_0x07dc('0x14'),_0x07dc('0x15'),_0x07dc('0x16'),_0x07dc('0x17'),_0x07dc('0x18'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x07dc('0x19'),_0x07dc('0x1a'),'predictiveIntervalAnsweredCalls',_0x07dc('0x1b'),_0x07dc('0x1c'),_0x07dc('0x1d'),_0x07dc('0x1e')];function getRealtimeQueues(_0x12ca05,_0x1eab03){var _0x59d071=_0x1eab03==='voice'?amiClient:routingClient;return _0x59d071['request'](_[_0x07dc('0x1f')](_0x1eab03)+_0x07dc('0x20'),_0x12ca05)[_0x07dc('0x21')](function(_0x407394){if(_0x407394[_0x07dc('0x22')])throw new Error(util[_0x07dc('0x23')](_0x07dc('0x24'),_0x1eab03));return _0x407394[_0x07dc('0x25')];})[_0x07dc('0x26')](function(_0x16a6f4){throw _0x16a6f4;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x2b7357,_0xb5efbf,_0x3e4770,_0x31bdca){var _0x5a3bc8=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3e4770===_0x07dc('0x27')){if(_0x31bdca===_0x07dc('0x28')){_0x5a3bc8=_0x5a3bc8[_0x07dc('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x31bdca===_0x07dc('0x2a')){_0x5a3bc8=_0x5a3bc8[_0x07dc('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2b7357[_0x07dc('0x2b')](function(_0x579f0d){var _0xb4185c=_0x579f0d['get']({'plain':!![]});_0xb4185c[_0x07dc('0x2c')]=0x0;_0xb4185c[_0x07dc('0x8')]=0x0;_0xb4185c[_0x07dc('0x5')]=0x0;_0xb4185c[_0x07dc('0x4')]=0x0;_0xb4185c[_0x07dc('0x6')]=0x0;if(_0x3e4770==='voice'){_0xb4185c['talking']=0x0;_0xb4185c['busy']=0x0;if(_0x31bdca===_0x07dc('0x2a')){_0xb4185c['pTalking']=0x0;_0xb4185c['originated']=0x0;}}var _0x5e948f=_[_0x07dc('0x2d')](_0xb5efbf,['id',_0xb4185c['id']]);if(_0x5e948f){_['merge'](_0xb4185c,_[_0x07dc('0x2e')](_0x5e948f,_0x5a3bc8));}return _0xb4185c;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1551aad..13ebb5c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x58b301,_0x45e991){var _0x2171b3=function(_0x30b475){while(--_0x30b475){_0x58b301['push'](_0x58b301['shift']());}};_0x2171b3(++_0x45e991);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 +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(_0x1e660a,_0x5bb483){var _0x11507b=function(_0x4928d0){while(--_0x4928d0){_0x1e660a['push'](_0x1e660a['shift']());}};_0x11507b(++_0x5bb483);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 5fc3023..f9de1d8 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 _0x6a86=['md5','update','hex','getUuid','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','bimedia-machine-uuid','execSync','../environment','networkInterfaces','keys','length','filter','IPv4','internal','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','map','join'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x6a86,0xae));var _0x66a8=function(_0x4b8f56,_0x44bef0){_0x4b8f56=_0x4b8f56-0x0;var _0x4a4a44=_0x6a86[_0x4b8f56];return _0x4a4a44;};'use strict';var _=require(_0x66a8('0x0'));var os=require('os');var crypto=require(_0x66a8('0x1'));var machine=require(_0x66a8('0x2'));var exec=require('child_process')[_0x66a8('0x3')];var config=require(_0x66a8('0x4'));function getInterfaces(){var _0x3bf23f=[];var _0xea88ea=os[_0x66a8('0x5')]();var _0x12ed9d=_['orderBy'](_[_0x66a8('0x6')](_0xea88ea));for(var _0xe2ae29=0x0;_0xe2ae29<_0x12ed9d[_0x66a8('0x7')];_0xe2ae29++){var _0x3ce442=_0xea88ea[_0x12ed9d[_0xe2ae29]][_0x66a8('0x8')](function(_0x53245a){return _0x53245a['family']===_0x66a8('0x9')&&_0x53245a[_0x66a8('0xa')]===![];});_0x3bf23f=_0x3bf23f['concat'](_0x3ce442);}return _0x3bf23f;}function getFirstInterface(){var _0x4423b5=_[_0x66a8('0xb')](getInterfaces());return{'macAddress':_0x4423b5&&_0x4423b5[_0x66a8('0xc')]?_0x4423b5[_0x66a8('0xc')]:_0x66a8('0xd'),'ipAddress':_0x4423b5&&_0x4423b5['address']?_0x4423b5['address']:_0x66a8('0xe')};}exports[_0x66a8('0xf')]=getFirstInterface;function getCPUhash(){var _0x53917f=_['orderBy'](os['cpus']()[_0x66a8('0x10')](function(_0x5b0bbd){return _0x5b0bbd['model'];}))[_0x66a8('0x11')](':');return crypto['createHash'](_0x66a8('0x12'))[_0x66a8('0x13')](_0x53917f)['digest'](_0x66a8('0x14'));}exports[_0x66a8('0x15')]=function(){var _0x43571f=os['platform']();var _0x8afbf0=/[0-9a-f-]{36}/;if(config[_0x66a8('0x16')]&&_0x8afbf0[_0x66a8('0x17')](config['licenseToken'])){return config['licenseToken'];}else if(_0x43571f==='win32'){return exec(_0x66a8('0x18'),{'encoding':_0x66a8('0x19')})[_0x66a8('0x1a')]('\x0d\x0a','');}else{var _0x369751=getFirstInterface();var _0x38590d=getCPUhash();var _0x538a3e=_0x38590d+'|'+os[_0x66a8('0x1b')]()+'|'+_0x369751[_0x66a8('0x1c')]+'|'+_0x369751[_0x66a8('0x1d')];var _0xa60ff=crypto[_0x66a8('0x1e')](_0x66a8('0x12'))['update'](_0x538a3e)['digest']('hex');return _0xa60ff[_0x66a8('0x1f')](0x0,0x8)+'-'+_0xa60ff['substring'](0x8,0xc)+'-'+_0xa60ff[_0x66a8('0x1f')](0xc,0x10)+'-'+_0xa60ff[_0x66a8('0x1f')](0x10,0x14)+'-'+_0xa60ff[_0x66a8('0x1f')](0x14);}}; \ No newline at end of file +var _0xee76=['digest','hex','getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','filter','family','IPv4','internal','concat','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update'];(function(_0xdf5112,_0x41ca79){var _0x1dbddc=function(_0x4cae2f){while(--_0x4cae2f){_0xdf5112['push'](_0xdf5112['shift']());}};_0x1dbddc(++_0x41ca79);}(_0xee76,0x13c));var _0x6ee7=function(_0x5d2507,_0x556fac){_0x5d2507=_0x5d2507-0x0;var _0x198c07=_0xee76[_0x5d2507];return _0x198c07;};'use strict';var _=require(_0x6ee7('0x0'));var os=require('os');var crypto=require(_0x6ee7('0x1'));var machine=require(_0x6ee7('0x2'));var exec=require(_0x6ee7('0x3'))[_0x6ee7('0x4')];var config=require('../environment');function getInterfaces(){var _0x525a0d=[];var _0x315f8a=os[_0x6ee7('0x5')]();var _0x42ef65=_[_0x6ee7('0x6')](_['keys'](_0x315f8a));for(var _0x38dcf7=0x0;_0x38dcf7<_0x42ef65[_0x6ee7('0x7')];_0x38dcf7++){var _0x28abf4=_0x315f8a[_0x42ef65[_0x38dcf7]][_0x6ee7('0x8')](function(_0x2e42e1){return _0x2e42e1[_0x6ee7('0x9')]===_0x6ee7('0xa')&&_0x2e42e1[_0x6ee7('0xb')]===![];});_0x525a0d=_0x525a0d[_0x6ee7('0xc')](_0x28abf4);}return _0x525a0d;}function getFirstInterface(){var _0x261511=_['head'](getInterfaces());return{'macAddress':_0x261511&&_0x261511[_0x6ee7('0xd')]?_0x261511[_0x6ee7('0xd')]:'00:00:00:00:00:00','ipAddress':_0x261511&&_0x261511[_0x6ee7('0xe')]?_0x261511[_0x6ee7('0xe')]:_0x6ee7('0xf')};}exports[_0x6ee7('0x10')]=getFirstInterface;function getCPUhash(){var _0x4b161e=_[_0x6ee7('0x6')](os[_0x6ee7('0x11')]()[_0x6ee7('0x12')](function(_0x46f962){return _0x46f962[_0x6ee7('0x13')];}))[_0x6ee7('0x14')](':');return crypto[_0x6ee7('0x15')](_0x6ee7('0x16'))[_0x6ee7('0x17')](_0x4b161e)[_0x6ee7('0x18')](_0x6ee7('0x19'));}exports[_0x6ee7('0x1a')]=function(){var _0x38c6e3=os['platform']();var _0x272a3b=/[0-9a-f-]{36}/;if(config[_0x6ee7('0x1b')]&&_0x272a3b['test'](config[_0x6ee7('0x1b')])){return config[_0x6ee7('0x1b')];}else if(_0x38c6e3===_0x6ee7('0x1c')){return exec(_0x6ee7('0x1d'),{'encoding':_0x6ee7('0x1e')})[_0x6ee7('0x1f')]('\x0d\x0a','');}else{var _0x3b1af6=getFirstInterface();var _0x4ad51=getCPUhash();var _0x1fc5b2=_0x4ad51+'|'+os['hostname']()+'|'+_0x3b1af6[_0x6ee7('0x20')]+'|'+_0x3b1af6['ipAddress'];var _0x17cea2=crypto['createHash'](_0x6ee7('0x16'))[_0x6ee7('0x17')](_0x1fc5b2)[_0x6ee7('0x18')](_0x6ee7('0x19'));return _0x17cea2['substring'](0x0,0x8)+'-'+_0x17cea2[_0x6ee7('0x21')](0x8,0xc)+'-'+_0x17cea2['substring'](0xc,0x10)+'-'+_0x17cea2[_0x6ee7('0x21')](0x10,0x14)+'-'+_0x17cea2[_0x6ee7('0x21')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 0902b75..bf53506 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 _0xe424=['finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','request-promise','bluebird','version','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','update','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message'];(function(_0x190ca7,_0x2bc244){var _0x37fbb2=function(_0xf00d6a){while(--_0xf00d6a){_0x190ca7['push'](_0x190ca7['shift']());}};_0x37fbb2(++_0x2bc244);}(_0xe424,0xa6));var _0x4e42=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xe424[_0x40ac5e];return _0x2839d6;};'use strict';var util=require(_0x4e42('0x0'));var moment=require('moment');var rp=require(_0x4e42('0x1'));var BPromise=require(_0x4e42('0x2'));var pkginfo=require('pkginfo')(module,_0x4e42('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x4e42('0x4'));var hardware=require(_0x4e42('0x5'));var logger=require(_0x4e42('0x6'))(_0x4e42('0x7'));var HOST=_0x4e42('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x483b7d){return new BPromise(function(_0x32b130,_0x46aad8){var _0x5054a9=util['format'](_0x4e42('0x9'),HOST,_0x483b7d,module[_0x4e42('0xa')][_0x4e42('0x3')]);if(oldToken){_0x5054a9=util[_0x4e42('0xb')](_0x4e42('0xc'),HOST,_0x483b7d,module[_0x4e42('0xa')][_0x4e42('0x3')],oldToken);}var _0x40f544={'uri':_0x5054a9,'method':_0x4e42('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x40f544)[_0x4e42('0xe')](function(_0x3c2996){_0x32b130(_0x3c2996);})[_0x4e42('0xf')](function(_0x46f901){_0x46aad8(_0x46f901);});});}function manageLicense(_0x51de54,_0x45d5e8){var _0x1aa858=_0x45d5e8['get']({'plain':!![]});if(!isOldTokenSent&&_0x1aa858[_0x4e42('0x10')]!==_0x51de54&&!_0x1aa858[_0x4e42('0x11')]){oldToken=_0x1aa858['data1'];}httpRequest(_0x51de54)[_0x4e42('0xe')](function(_0x52d32d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x52d32d[_0x4e42('0x12')]){isOldTokenSent=![];if(!_0x1aa858['license']&&_0x1aa858[_0x4e42('0x7')]!=_0x52d32d[_0x4e42('0x7')]||_0x1aa858[_0x4e42('0x7')]&&_0x1aa858[_0x4e42('0x11')]){logger['info'](_0x4e42('0x13'));}if(_0x1aa858['license']&&!_0x1aa858[_0x4e42('0x11')]&&_0x1aa858['license']!=_0x52d32d[_0x4e42('0x7')]){logger[_0x4e42('0x14')](_0x4e42('0x15'));}if(_0x1aa858[_0x4e42('0x7')]&&!_0x1aa858[_0x4e42('0x11')]&&_0x1aa858['license']==_0x52d32d[_0x4e42('0x7')]){return _0x45d5e8;}return _0x45d5e8['update']({'data1':_0x51de54,'data2':null,'license':_0x52d32d['license']});}else{if(_0x52d32d['license']||_0x1aa858[_0x4e42('0x7')]){if(!_0x1aa858[_0x4e42('0x11')]){if(_0x1aa858[_0x4e42('0x10')]==_0x51de54){GRAY_PERIOD_REASON=_0x4e42('0x16');logger[_0x4e42('0x14')](_0x4e42('0x17'));}else{GRAY_PERIOD_REASON=_0x4e42('0x18');logger[_0x4e42('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1aa858[_0x4e42('0x10')],_0x51de54);}logger[_0x4e42('0x14')](_0x4e42('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x4e42('0xb')](_0x4e42('0x1a')));return _0x45d5e8[_0x4e42('0x1b')]({'data2':encryptor[_0x4e42('0x1c')](moment()[_0x4e42('0xb')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0x4e42('0x1d')](_0x1aa858['data2']),_0x4e42('0x1e'))>DAYS){logger[_0x4e42('0x14')](_0x4e42('0x1f'),moment()[_0x4e42('0xb')](_0x4e42('0x1a')));isOldTokenSent=![];return _0x45d5e8[_0x4e42('0x1b')]({'data1':_0x51de54,'data2':null,'license':null});}}}else{if(_0x1aa858['data1']!=_0x51de54){logger[_0x4e42('0x14')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x1aa858[_0x4e42('0x10')],_0x51de54);return _0x45d5e8['update']({'data1':_0x51de54,'data2':null,'license':null});}}}return _0x45d5e8;})[_0x4e42('0xe')](function(_0x12b866){_0x45d5e8=_0x12b866;})[_0x4e42('0xf')](function(_0x4e12c7){logger[_0x4e42('0x20')](_0x4e12c7[_0x4e42('0x21')]);})[_0x4e42('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x4e42('0x23')](),_0x45d5e8);},TIME);});}function defaultLicense(){var _0x56a505=hardware['getUuid']();if(_0x56a505){return db[_0x4e42('0x24')][_0x4e42('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x56a505}})[_0x4e42('0x26')](function(_0x226087,_0x510edd){logger[_0x4e42('0x14')](_0x4e42('0x27'),_0x56a505);manageLicense(_0x56a505,_0x226087);})[_0x4e42('0xf')](function(_0x577e37){logger[_0x4e42('0x20')](_0x577e37['message']);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x243e=['getUuid','License','findOrCreate','default','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','format','%s/api/servers/%s/check?version=%s','exports','version','GET','then','catch','get','data1','data2','license','info','update','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','encryptString','decryptString','error','finally'];(function(_0x1dacfe,_0x494b5a){var _0xd89649=function(_0xe673d3){while(--_0xe673d3){_0x1dacfe['push'](_0x1dacfe['shift']());}};_0xd89649(++_0x494b5a);}(_0x243e,0x190));var _0xe243=function(_0xa84391,_0x108455){_0xa84391=_0xa84391-0x0;var _0x5bdce2=_0x243e[_0xa84391];return _0x5bdce2;};'use strict';var util=require(_0xe243('0x0'));var moment=require(_0xe243('0x1'));var rp=require(_0xe243('0x2'));var BPromise=require(_0xe243('0x3'));var pkginfo=require(_0xe243('0x4'))(module,'version');var db=require(_0xe243('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xe243('0x6'));var logger=require('../logger')('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2b6287){return new BPromise(function(_0x15da37,_0x23aa2a){var _0x2430ee=util[_0xe243('0x7')](_0xe243('0x8'),HOST,_0x2b6287,module[_0xe243('0x9')][_0xe243('0xa')]);if(oldToken){_0x2430ee=util[_0xe243('0x7')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2b6287,module['exports'][_0xe243('0xa')],oldToken);}var _0x581de8={'uri':_0x2430ee,'method':_0xe243('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x581de8)[_0xe243('0xc')](function(_0x24c9bf){_0x15da37(_0x24c9bf);})[_0xe243('0xd')](function(_0x3d16cc){_0x23aa2a(_0x3d16cc);});});}function manageLicense(_0x3e7071,_0x9749e9){var _0x42a69d=_0x9749e9[_0xe243('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x42a69d[_0xe243('0xf')]!==_0x3e7071&&!_0x42a69d[_0xe243('0x10')]){oldToken=_0x42a69d[_0xe243('0xf')];}httpRequest(_0x3e7071)[_0xe243('0xc')](function(_0x3eb323){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3eb323['active']){isOldTokenSent=![];if(!_0x42a69d[_0xe243('0x11')]&&_0x42a69d[_0xe243('0x11')]!=_0x3eb323[_0xe243('0x11')]||_0x42a69d[_0xe243('0x11')]&&_0x42a69d[_0xe243('0x10')]){logger[_0xe243('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x42a69d[_0xe243('0x11')]&&!_0x42a69d['data2']&&_0x42a69d[_0xe243('0x11')]!=_0x3eb323[_0xe243('0x11')]){logger[_0xe243('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x42a69d[_0xe243('0x11')]&&!_0x42a69d[_0xe243('0x10')]&&_0x42a69d[_0xe243('0x11')]==_0x3eb323[_0xe243('0x11')]){return _0x9749e9;}return _0x9749e9[_0xe243('0x13')]({'data1':_0x3e7071,'data2':null,'license':_0x3eb323[_0xe243('0x11')]});}else{if(_0x3eb323[_0xe243('0x11')]||_0x42a69d[_0xe243('0x11')]){if(!_0x42a69d[_0xe243('0x10')]){if(_0x42a69d[_0xe243('0xf')]==_0x3e7071){GRAY_PERIOD_REASON='Disabled';logger[_0xe243('0x12')](_0xe243('0x14'));}else{GRAY_PERIOD_REASON='Changed';logger['info'](_0xe243('0x15'),_0x42a69d[_0xe243('0xf')],_0x3e7071);}logger['info'](_0xe243('0x16'),GRAY_PERIOD_REASON[_0xe243('0x17')](),moment()[_0xe243('0x7')](_0xe243('0x18')));return _0x9749e9[_0xe243('0x13')]({'data2':encryptor[_0xe243('0x19')](moment()['format'](_0xe243('0x18')))});}else{if(moment()['diff'](encryptor[_0xe243('0x1a')](_0x42a69d[_0xe243('0x10')]),'days')>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xe243('0x7')](_0xe243('0x18')));isOldTokenSent=![];return _0x9749e9[_0xe243('0x13')]({'data1':_0x3e7071,'data2':null,'license':null});}}}else{if(_0x42a69d[_0xe243('0xf')]!=_0x3e7071){logger[_0xe243('0x12')](_0xe243('0x15'),_0x42a69d['data1'],_0x3e7071);return _0x9749e9[_0xe243('0x13')]({'data1':_0x3e7071,'data2':null,'license':null});}}}return _0x9749e9;})['then'](function(_0x3187a9){_0x9749e9=_0x3187a9;})['catch'](function(_0x59cf46){logger[_0xe243('0x1b')](_0x59cf46['message']);})[_0xe243('0x1c')](function(){setTimeout(function(){manageLicense(hardware[_0xe243('0x1d')](),_0x9749e9);},TIME);});}function defaultLicense(){var _0x1a30af=hardware['getUuid']();if(_0x1a30af){return db[_0xe243('0x1e')][_0xe243('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x1a30af}})['spread'](function(_0x349a82,_0x5b9797){logger[_0xe243('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1a30af);manageLicense(_0x1a30af,_0x349a82);})[_0xe243('0xd')](function(_0x130d9e){logger[_0xe243('0x1b')](_0x130d9e['message']);});}}exports[_0xe243('0x20')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index c88d9c6..3d0e994 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 _0xd0b9=['parse','demo','machineUuid','gray','deadline','changed','disabled','message','findAll','role','sequelize','COUNT','col','count','user','users','forEach','admin','catch','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','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s'];(function(_0x1f203a,_0x114752){var _0x11c80f=function(_0x45c1b4){while(--_0x45c1b4){_0x1f203a['push'](_0x1f203a['shift']());}};_0x11c80f(++_0x114752);}(_0xd0b9,0x1be));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9d0b('0x0'));var _=require(_0x9d0b('0x1'));var moment=require('moment');var BPromise=require(_0x9d0b('0x2'));var hardware=require(_0x9d0b('0x3'));var encryptor=require(_0x9d0b('0x4'));var db=require(_0x9d0b('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9d0b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9d0b('0x7'),'machineUuid':hardware[_0x9d0b('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9d0b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9d0b('0x9'),'machineUuid':hardware[_0x9d0b('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x56c030){return new BPromise(function(_0x10b38a,_0x4a0094){return db[_0x9d0b('0xa')][_0x9d0b('0xb')](_[_0x9d0b('0xc')](_0x56c030,{'raw':!![],'where':{'id':0x1}}))[_0x9d0b('0xd')](function(_0x5e2418){return checkLicense(_0x5e2418,null);})[_0x9d0b('0xd')](function(_0x4885a8){_0x10b38a(_0x4885a8);return;})['catch'](function(_0x5e32ba){_0x4a0094(_0x5e32ba);});});}function checkLicense(_0x3a67d2,_0x24c13b){if(!_0x3a67d2){demoLicense[_0x9d0b('0xe')]=_0x3a67d2[_0x9d0b('0xf')];return demoLicense;}try{var _0x33188b=_0x24c13b||_0x3a67d2[_0x9d0b('0x10')];if(_[_0x9d0b('0x11')](_0x33188b)){throw new Error(_0x9d0b('0x12'));}var _0x2d7afd=_0x3a67d2[_0x9d0b('0xf')];var _0x3b4967=_0x3a67d2[_0x9d0b('0x13')];var _0x96d6ce=_0x2d7afd[_0x9d0b('0x14')]('-')[0x4];var _0x32eba3=_0x2d7afd[_0x9d0b('0x14')]('-')[0x0];var _0xd59bb=encryptor[_0x9d0b('0x15')](_0x33188b,util[_0x9d0b('0x16')](_0x9d0b('0x17'),_0x96d6ce,_0x2d7afd,_0x32eba3));var _0x3bb37d=JSON[_0x9d0b('0x18')](_0xd59bb);_0x3bb37d[_0x9d0b('0x19')]=![];_0x3bb37d[_0x9d0b('0xe')]=_0x2d7afd;_0x3bb37d[_0x9d0b('0x1a')]=hardware[_0x9d0b('0x8')]();if(_0x3b4967){var _0x149865=encryptor[_0x9d0b('0x15')](_0x3b4967);_0x3bb37d[_0x9d0b('0x1b')]=_0x149865;_0x3bb37d[_0x9d0b('0x1c')]=moment(_0x149865)['add'](0x7,'days')['format']();_0x3bb37d['grayReason']=_0x3bb37d['uuid']!=_0x3bb37d[_0x9d0b('0x1a')]?_0x9d0b('0x1d'):_0x9d0b('0x1e');}return _0x3bb37d;}catch(_0x5eb577){breakingLicense[_0x9d0b('0xe')]=_0x3a67d2[_0x9d0b('0xf')];breakingLicense[_0x9d0b('0x1f')]=_0x5eb577[_0x9d0b('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2ffa13,_0x1378aa){getLicense()[_0x9d0b('0xd')](function(_0x231354){return db['User'][_0x9d0b('0x20')]({'attributes':[_0x9d0b('0x21'),[db[_0x9d0b('0x22')]['fn'](_0x9d0b('0x23'),db[_0x9d0b('0x22')][_0x9d0b('0x24')]('role')),_0x9d0b('0x25')]],'group':_0x9d0b('0x21'),'where':{'role':{'$or':['admin',_0x9d0b('0x26'),'telephone']}},'raw':!![]})[_0x9d0b('0xd')](function(_0x1a5dcf){var _0x5ec1cc={'user':_0x231354[_0x9d0b('0x27')]||0x0,'telephone':_0x231354['telephones']||0x0};_0x1a5dcf[_0x9d0b('0x28')](function(_0x5c8fef){var _0x458aab=_0x5c8fef[_0x9d0b('0x21')]===_0x9d0b('0x29')?'user':_0x5c8fef[_0x9d0b('0x21')];_0x5ec1cc[_0x458aab]-=_0x5c8fef['count'];if(_0x5ec1cc[_0x458aab]<0x0)_0x5ec1cc[_0x458aab]=0x0;});_0x2ffa13(_0x5ec1cc);return;});})[_0x9d0b('0x2a')](function(_0x47d803){_0x1378aa(_0x47d803);});});}function checkUserLimits(_0x27dc7f){return new BPromise(function(_0x394c60,_0xb9f76e){getLimits()[_0x9d0b('0xd')](function(_0x328de2){var _0x43dc0e=_['pick'](_[_0x9d0b('0x2b')](_0x27dc7f,'role'),[_0x9d0b('0x29'),_0x9d0b('0x26'),_0x9d0b('0x2c')]);var _0x5aef0d=(_0x43dc0e['admin']||0x0)+(_0x43dc0e['user']||0x0);var _0x94fe3e=_0x43dc0e[_0x9d0b('0x2c')]||0x0;if(_0x5aef0d>_0x328de2[_0x9d0b('0x26')])return _0xb9f76e(_0x9d0b('0x2d'));if(_0x94fe3e>_0x328de2[_0x9d0b('0x2c')])return _0xb9f76e(_0x9d0b('0x2e'));return _0x394c60();})[_0x9d0b('0x2a')](function(_0x45d216){_0xb9f76e(_0x45d216);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x9872=['lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','data2','split','decryptString','demo','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','role','sequelize','COUNT','col','count','admin','user','telephone','users','telephones','pick','License\x20limit\x20reached\x20for\x20users','exports','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x9872,0x12c));var _0x2987=function(_0x2a8a97,_0x415200){_0x2a8a97=_0x2a8a97-0x0;var _0x96d61c=_0x9872[_0x2a8a97];return _0x96d61c;};'use strict';var util=require(_0x2987('0x0'));var _=require(_0x2987('0x1'));var moment=require(_0x2987('0x2'));var BPromise=require('bluebird');var hardware=require(_0x2987('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x2987('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2987('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x2987('0x6'),'machineUuid':hardware[_0x2987('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2987('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x2987('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x96c299){return new BPromise(function(_0xae04c,_0x576328){return db[_0x2987('0x9')][_0x2987('0xa')](_[_0x2987('0xb')](_0x96c299,{'raw':!![],'where':{'id':0x1}}))[_0x2987('0xc')](function(_0x2b3921){return checkLicense(_0x2b3921,null);})['then'](function(_0x17d9be){_0xae04c(_0x17d9be);return;})[_0x2987('0xd')](function(_0x48c566){_0x576328(_0x48c566);});});}function checkLicense(_0x5ae0eb,_0x44181f){if(!_0x5ae0eb){demoLicense[_0x2987('0xe')]=_0x5ae0eb['data1'];return demoLicense;}try{var _0x148dbf=_0x44181f||_0x5ae0eb['license'];if(_['isEmpty'](_0x148dbf)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2bbe66=_0x5ae0eb[_0x2987('0xf')];var _0x4092f3=_0x5ae0eb[_0x2987('0x10')];var _0x13d04c=_0x2bbe66[_0x2987('0x11')]('-')[0x4];var _0x4f5090=_0x2bbe66[_0x2987('0x11')]('-')[0x0];var _0x9250aa=encryptor[_0x2987('0x12')](_0x148dbf,util['format']('%s:%s:%s',_0x13d04c,_0x2bbe66,_0x4f5090));var _0x395363=JSON['parse'](_0x9250aa);_0x395363[_0x2987('0x13')]=![];_0x395363[_0x2987('0xe')]=_0x2bbe66;_0x395363['machineUuid']=hardware['getUuid']();if(_0x4092f3){var _0x258387=encryptor[_0x2987('0x12')](_0x4092f3);_0x395363[_0x2987('0x14')]=_0x258387;_0x395363[_0x2987('0x15')]=moment(_0x258387)[_0x2987('0x16')](0x7,_0x2987('0x17'))['format']();_0x395363[_0x2987('0x18')]=_0x395363[_0x2987('0xe')]!=_0x395363[_0x2987('0x19')]?_0x2987('0x1a'):_0x2987('0x1b');}return _0x395363;}catch(_0x1e81f0){breakingLicense[_0x2987('0xe')]=_0x5ae0eb['data1'];breakingLicense[_0x2987('0x1c')]=_0x1e81f0[_0x2987('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4a4cae,_0xada54a){getLicense()[_0x2987('0xc')](function(_0x3d7539){return db[_0x2987('0x1d')]['findAll']({'attributes':[_0x2987('0x1e'),[db[_0x2987('0x1f')]['fn'](_0x2987('0x20'),db['sequelize'][_0x2987('0x21')]('role')),_0x2987('0x22')]],'group':_0x2987('0x1e'),'where':{'role':{'$or':[_0x2987('0x23'),_0x2987('0x24'),_0x2987('0x25')]}},'raw':!![]})['then'](function(_0x39a773){var _0x2a79ad={'user':_0x3d7539[_0x2987('0x26')]||0x0,'telephone':_0x3d7539[_0x2987('0x27')]||0x0};_0x39a773['forEach'](function(_0x120513){var _0x2a3789=_0x120513[_0x2987('0x1e')]===_0x2987('0x23')?_0x2987('0x24'):_0x120513['role'];_0x2a79ad[_0x2a3789]-=_0x120513[_0x2987('0x22')];if(_0x2a79ad[_0x2a3789]<0x0)_0x2a79ad[_0x2a3789]=0x0;});_0x4a4cae(_0x2a79ad);return;});})['catch'](function(_0x186d0b){_0xada54a(_0x186d0b);});});}function checkUserLimits(_0x382cd1){return new BPromise(function(_0x2adde2,_0x5dfa8e){getLimits()[_0x2987('0xc')](function(_0x146021){var _0x5386d9=_[_0x2987('0x28')](_['countBy'](_0x382cd1,_0x2987('0x1e')),['admin',_0x2987('0x24'),_0x2987('0x25')]);var _0x38bca4=(_0x5386d9[_0x2987('0x23')]||0x0)+(_0x5386d9[_0x2987('0x24')]||0x0);var _0x592c26=_0x5386d9[_0x2987('0x25')]||0x0;if(_0x38bca4>_0x146021[_0x2987('0x24')])return _0x5dfa8e(_0x2987('0x29'));if(_0x592c26>_0x146021[_0x2987('0x25')])return _0x5dfa8e('License\x20limit\x20reached\x20for\x20telephones');return _0x2adde2();})[_0x2987('0xd')](function(_0x1073d1){_0x5dfa8e(_0x1073d1);});});}module[_0x2987('0x2a')]={'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 ea2baa8..491a3ad 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 _0x4888=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x3dacb8,_0x48eab5){var _0x16d5a0=function(_0x1397bf){while(--_0x1397bf){_0x3dacb8['push'](_0x3dacb8['shift']());}};_0x16d5a0(++_0x48eab5);}(_0x4888,0x198));var _0x8488=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0x4888[_0x408b34];return _0x1182aa;};'use strict';module['exports']={'DOMAIN':_0x8488('0x0'),'SESSION_SECRET':_0x8488('0x1'),'GOOGLE_ID':_0x8488('0x2'),'GOOGLE_SECRET':_0x8488('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x583c=['http://localhost:9000','myappanuglar-secret','app-id','exports'];(function(_0x38c218,_0xbe4d6e){var _0xece85f=function(_0x14ca9f){while(--_0x14ca9f){_0x38c218['push'](_0x38c218['shift']());}};_0xece85f(++_0xbe4d6e);}(_0x583c,0x12b));var _0xc583=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x583c[_0x2f62aa];return _0x1a341f;};'use strict';module[_0xc583('0x0')]={'DOMAIN':_0xc583('0x1'),'SESSION_SECRET':_0xc583('0x2'),'GOOGLE_ID':_0xc583('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index ef4011c..9a0a529 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5dd5=['exports','../utils/loggers','fileLogger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5dd5,0xb5));var _0x55dd=function(_0x2a3f4e,_0x2f10a2){_0x2a3f4e=_0x2a3f4e-0x0;var _0x1bc8f5=_0x5dd5[_0x2a3f4e];return _0x1bc8f5;};'use strict';var fileLogger=require(_0x55dd('0x0'))[_0x55dd('0x1')];module[_0x55dd('0x2')]=fileLogger; \ No newline at end of file +var _0x1dff=['../utils/loggers'];(function(_0x1c09d1,_0x5868eb){var _0x49045d=function(_0x2c8be8){while(--_0x2c8be8){_0x1c09d1['push'](_0x1c09d1['shift']());}};_0x49045d(++_0x5868eb);}(_0x1dff,0x105));var _0xf1df=function(_0x42ecb5,_0x20b4d2){_0x42ecb5=_0x42ecb5-0x0;var _0x487442=_0x1dff[_0x42ecb5];return _0x487442;};'use strict';var fileLogger=require(_0xf1df('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 85d56bc..e24cfb3 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 _0xabb9=['agi','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x5238d2,_0x494a90){var _0x5b61f2=function(_0x40fd10){while(--_0x40fd10){_0x5238d2['push'](_0x5238d2['shift']());}};_0x5b61f2(++_0x494a90);}(_0xabb9,0xca));var _0x9abb=function(_0x31575c,_0x15baba){_0x31575c=_0x31575c-0x0;var _0x461dee=_0xabb9[_0x31575c];return _0x461dee;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x9abb('0x0')](path[_0x9abb('0x1')](cfg[_0x9abb('0x2')],_0x9abb('0x3')))};var pm2config={'apps':[{'name':_0x9abb('0x4'),'script':path[_0x9abb('0x1')](__dirname,_0x9abb('0x5')),'env':env},{'name':_0x9abb('0x6'),'script':path[_0x9abb('0x1')](__dirname,_0x9abb('0x7')),'env':env},{'name':_0x9abb('0x8'),'script':path[_0x9abb('0x1')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x9abb('0x9'),'script':path[_0x9abb('0x1')](__dirname,_0x9abb('0xa')),'env':env},{'name':'routing','script':path['join'](__dirname,_0x9abb('0xb')),'env':env},{'name':_0x9abb('0xc'),'script':path['join'](__dirname,_0x9abb('0xd')),'env':env}]};module[_0x9abb('0xe')]=pm2config; \ No newline at end of file +var _0xcf35=['../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','root','legacy-libs','express','join','ami','../../services/ami/index.js'];(function(_0x17a716,_0x32e9bb){var _0x39dc1d=function(_0xd1021c){while(--_0xd1021c){_0x17a716['push'](_0x17a716['shift']());}};_0x39dc1d(++_0x32e9bb);}(_0xcf35,0x167));var _0x5cf3=function(_0x417a23,_0x2a228d){_0x417a23=_0x417a23-0x0;var _0x3aeb3f=_0xcf35[_0x417a23];return _0x3aeb3f;};'use strict';var path=require(_0x5cf3('0x0'));var cfg=require(_0x5cf3('0x1'));var env={'NODE_PATH':path[_0x5cf3('0x2')](path['join'](cfg[_0x5cf3('0x3')],_0x5cf3('0x4')))};var pm2config={'apps':[{'name':_0x5cf3('0x5'),'script':path[_0x5cf3('0x6')](__dirname,'../../services/express/index.js'),'env':env},{'name':_0x5cf3('0x7'),'script':path[_0x5cf3('0x6')](__dirname,_0x5cf3('0x8')),'env':env},{'name':'agi','script':path[_0x5cf3('0x6')](__dirname,_0x5cf3('0x9')),'env':env},{'name':'email','script':path[_0x5cf3('0x6')](__dirname,_0x5cf3('0xa')),'env':env},{'name':_0x5cf3('0xb'),'script':path[_0x5cf3('0x6')](__dirname,_0x5cf3('0xc')),'env':env},{'name':_0x5cf3('0xd'),'script':path[_0x5cf3('0x6')](__dirname,_0x5cf3('0xe')),'env':env}]};module[_0x5cf3('0xf')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 767fb19..6eb08fc 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 _0xa4e7=['describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list'];(function(_0x1a4b13,_0xb01d9b){var _0x5003b0=function(_0x5ec792){while(--_0x5ec792){_0x1a4b13['push'](_0x1a4b13['shift']());}};_0x5003b0(++_0xb01d9b);}(_0xa4e7,0x1d5));var _0x7a4e=function(_0x6bee5,_0x324237){_0x6bee5=_0x6bee5-0x0;var _0x458cda=_0xa4e7[_0x6bee5];return _0x458cda;};'use strict';var pm2=require(_0x7a4e('0x0'));var BPromise=require(_0x7a4e('0x1'));var config=require(_0x7a4e('0x2'));function connect(){return new BPromise(function(_0x173abd,_0x5f5295){return pm2[_0x7a4e('0x3')](function(_0x2e55ac){if(_0x2e55ac){return _0x5f5295(_0x2e55ac);}return _0x173abd(_0x7a4e('0x4'));});});};exports['start']=function(_0x363f26){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x3543d9,_0x749a45){return pm2[_0x7a4e('0x6')](_0x363f26,function(_0xf38a0a,_0x3a6c0f){if(_0xf38a0a){return _0x749a45(_0xf38a0a);}pm2[_0x7a4e('0x7')]();return _0x3543d9(_0x3a6c0f);});});});};exports[_0x7a4e('0x8')]=function(_0x1df0c5){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x5bc377,_0x4314ca){return pm2[_0x7a4e('0x8')](_0x1df0c5,function(_0x2d445b,_0x2e6ded){if(_0x2d445b){return _0x4314ca(_0x2d445b);}pm2[_0x7a4e('0x7')]();return _0x5bc377(_0x2e6ded);});});});};exports[_0x7a4e('0x9')]=function(_0x18cff7){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x18569c,_0x1f635f){return pm2[_0x7a4e('0x9')](_0x18cff7,function(_0x144ec2,_0x3a8677){if(_0x144ec2){return _0x1f635f(_0x144ec2);}pm2[_0x7a4e('0x7')]();return _0x18569c(_0x3a8677);});});});};exports[_0x7a4e('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x117fa8,_0x170ea8){return pm2[_0x7a4e('0xa')](function(_0x32b024,_0x3b4067){if(_0x32b024){return _0x170ea8(_0x32b024);}pm2[_0x7a4e('0x7')]();return _0x117fa8(_0x3b4067);});});});};exports['describe']=function(_0x4ada8d){return connect()['then'](function(){return new BPromise(function(_0x4d894c,_0x170e1f){return pm2[_0x7a4e('0xb')](_0x4ada8d,function(_0x10ab59,_0x315343){if(_0x10ab59){return _0x170e1f(_0x10ab59);}pm2[_0x7a4e('0x7')]();return _0x4d894c(_0x315343);});});});};exports[_0x7a4e('0xc')]=function(_0x547a3b){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x30d5dc,_0x3f6fbb){return pm2[_0x7a4e('0xc')](_0x547a3b,function(_0x221d7d,_0x536cd2){if(_0x221d7d){return _0x3f6fbb(_0x221d7d);}pm2['disconnect']();return _0x30d5dc(_0x536cd2);});});});};exports[_0x7a4e('0xd')]=function(){return connect()[_0x7a4e('0x5')](function(){return new BPromise(function(_0x4357ea,_0xd24c47){return pm2[_0x7a4e('0xd')](function(_0x14d037){if(_0x14d037){return _0xd24c47(_0x14d037);}return _0x4357ea(_0x7a4e('0xe'));});});});}; \ No newline at end of file +var _0x6039=['./config','connected','start','then','disconnect','stop','restart','list','delete','dump','pm2'];(function(_0x4cebe2,_0x35c51d){var _0x14538e=function(_0x1efa5d){while(--_0x1efa5d){_0x4cebe2['push'](_0x4cebe2['shift']());}};_0x14538e(++_0x35c51d);}(_0x6039,0xe6));var _0x9603=function(_0x1bdb05,_0x9b9e86){_0x1bdb05=_0x1bdb05-0x0;var _0x4ad236=_0x6039[_0x1bdb05];return _0x4ad236;};'use strict';var pm2=require(_0x9603('0x0'));var BPromise=require('bluebird');var config=require(_0x9603('0x1'));function connect(){return new BPromise(function(_0x3c412e,_0x1085b8){return pm2['connect'](function(_0x47241a){if(_0x47241a){return _0x1085b8(_0x47241a);}return _0x3c412e(_0x9603('0x2'));});});};exports[_0x9603('0x3')]=function(_0x2aa3d1){return connect()[_0x9603('0x4')](function(){return new BPromise(function(_0x542167,_0xff7f66){return pm2['start'](_0x2aa3d1,function(_0x41bbe0,_0x490c7c){if(_0x41bbe0){return _0xff7f66(_0x41bbe0);}pm2[_0x9603('0x5')]();return _0x542167(_0x490c7c);});});});};exports[_0x9603('0x6')]=function(_0x1a6797){return connect()['then'](function(){return new BPromise(function(_0x43ec4c,_0x72baa1){return pm2['stop'](_0x1a6797,function(_0xf40231,_0x48eb86){if(_0xf40231){return _0x72baa1(_0xf40231);}pm2['disconnect']();return _0x43ec4c(_0x48eb86);});});});};exports[_0x9603('0x7')]=function(_0x30251f){return connect()['then'](function(){return new BPromise(function(_0x87108c,_0x1fe1ac){return pm2[_0x9603('0x7')](_0x30251f,function(_0x5ae441,_0xa668e7){if(_0x5ae441){return _0x1fe1ac(_0x5ae441);}pm2[_0x9603('0x5')]();return _0x87108c(_0xa668e7);});});});};exports[_0x9603('0x8')]=function(){return connect()[_0x9603('0x4')](function(){return new BPromise(function(_0x252ff5,_0x52d82e){return pm2[_0x9603('0x8')](function(_0x29e2f3,_0x6e40ea){if(_0x29e2f3){return _0x52d82e(_0x29e2f3);}pm2[_0x9603('0x5')]();return _0x252ff5(_0x6e40ea);});});});};exports['describe']=function(_0xf35121){return connect()['then'](function(){return new BPromise(function(_0x440fcd,_0x272296){return pm2['describe'](_0xf35121,function(_0x1fd52e,_0x360717){if(_0x1fd52e){return _0x272296(_0x1fd52e);}pm2[_0x9603('0x5')]();return _0x440fcd(_0x360717);});});});};exports[_0x9603('0x9')]=function(_0x2bd95d){return connect()[_0x9603('0x4')](function(){return new BPromise(function(_0x5a4b6d,_0x941343){return pm2[_0x9603('0x9')](_0x2bd95d,function(_0x3d5075,_0x400d64){if(_0x3d5075){return _0x941343(_0x3d5075);}pm2[_0x9603('0x5')]();return _0x5a4b6d(_0x400d64);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x22ea0c,_0x54e47c){return pm2[_0x9603('0xa')](function(_0x18103e){if(_0x18103e){return _0x54e47c(_0x18103e);}return _0x22ea0c('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 4a788b8..c668567 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 _0xb0f3=['join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','redis','socket.io-emitter','Setting','chatTimeout','then','ChatInteraction','subtract','length','map','info'];(function(_0x1b68ba,_0x23687a){var _0xf49b11=function(_0x5732c6){while(--_0x5732c6){_0x1b68ba['push'](_0x1b68ba['shift']());}};_0xf49b11(++_0x23687a);}(_0xb0f3,0x8c));var _0x3b0f=function(_0x50a3e1,_0x43d894){_0x50a3e1=_0x50a3e1-0x0;var _0x3f5a7f=_0xb0f3[_0x50a3e1];return _0x3f5a7f;};'use strict';var _=require(_0x3b0f('0x0'));var moment=require(_0x3b0f('0x1'));var Redis=require(_0x3b0f('0x2'));var util=require(_0x3b0f('0x3'));var config=require('../../config/environment');var db=require(_0x3b0f('0x4'))['db'];var logger=require(_0x3b0f('0x5'))('schedule');config[_0x3b0f('0x6')]=_['defaults'](config[_0x3b0f('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3b0f('0x7'))(new Redis(config[_0x3b0f('0x6')]));function closeInteractions(){var _0x2d0f6b=0x0;var _0x739d05=[];return db[_0x3b0f('0x8')]['find']({'raw':!![],'attributes':['id',_0x3b0f('0x9')],'where':{'id':0x1}})[_0x3b0f('0xa')](function(_0x17c542){_0x2d0f6b=_0x17c542['chatTimeout'];if(_0x2d0f6b){return db[_0x3b0f('0xb')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x3b0f('0xc')](_0x17c542['chatTimeout'],'minutes')}}});}else{return[];}})[_0x3b0f('0xa')](function(_0x43efb2){if(_0x43efb2&&_0x43efb2[_0x3b0f('0xd')]){_0x739d05=_[_0x3b0f('0xe')](_0x43efb2||[],'id');logger[_0x3b0f('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x739d05[_0x3b0f('0x10')]());return db[_0x3b0f('0xb')][_0x3b0f('0x11')]({'closeReason':_0x3b0f('0x12'),'disposition':_0x3b0f('0x13'),'closed':!![],'closedAt':moment()['format'](_0x3b0f('0x14'))},{'where':{'id':_0x739d05}});}})[_0x3b0f('0xa')](function(){if(_0x739d05&&_0x739d05['length']){logger[_0x3b0f('0xf')](_0x3b0f('0x15'),_0x739d05[_0x3b0f('0x10')]());for(var _0x16ab27=0x0;_0x16ab27<_0x739d05['length'];_0x16ab27++){io['emit'](_0x3b0f('0x16'),{'id':_0x739d05[_0x16ab27],'closed':!![]});}}})['catch'](function(_0x4e09cd){logger['error'](_0x3b0f('0x17'),_0x4e09cd?util[_0x3b0f('0x18')](_0x4e09cd,{'showHidden':![],'depth':null}):'');});}exports[_0x3b0f('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xac35=['then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','inspect','start','ioredis','util','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout'];(function(_0x5f5650,_0x4b14ca){var _0x56b163=function(_0x33ad1f){while(--_0x33ad1f){_0x5f5650['push'](_0x5f5650['shift']());}};_0x56b163(++_0x4b14ca);}(_0xac35,0x1c5));var _0x5ac3=function(_0x17f4c8,_0x3aa345){_0x17f4c8=_0x17f4c8-0x0;var _0x288b47=_0xac35[_0x17f4c8];return _0x288b47;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x5ac3('0x0'));var util=require(_0x5ac3('0x1'));var config=require('../../config/environment');var db=require(_0x5ac3('0x2'))['db'];var logger=require(_0x5ac3('0x3'))('schedule');config[_0x5ac3('0x4')]=_[_0x5ac3('0x5')](config['redis'],{'host':_0x5ac3('0x6'),'port':0x18eb});var io=require(_0x5ac3('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x4ad50b=0x0;var _0x1ff223=[];return db[_0x5ac3('0x8')][_0x5ac3('0x9')]({'raw':!![],'attributes':['id',_0x5ac3('0xa')],'where':{'id':0x1}})[_0x5ac3('0xb')](function(_0x307b6b){_0x4ad50b=_0x307b6b[_0x5ac3('0xa')];if(_0x4ad50b){return db[_0x5ac3('0xc')][_0x5ac3('0xd')]({'raw':!![],'attributes':['id',_0x5ac3('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5ac3('0xf')](_0x307b6b[_0x5ac3('0xa')],_0x5ac3('0x10'))}}});}else{return[];}})[_0x5ac3('0xb')](function(_0x37d542){if(_0x37d542&&_0x37d542[_0x5ac3('0x11')]){_0x1ff223=_[_0x5ac3('0x12')](_0x37d542||[],'id');logger['info'](_0x5ac3('0x13'),_0x1ff223[_0x5ac3('0x14')]());return db[_0x5ac3('0xc')][_0x5ac3('0x15')]({'closeReason':_0x5ac3('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x5ac3('0x17')](_0x5ac3('0x18'))},{'where':{'id':_0x1ff223}});}})[_0x5ac3('0xb')](function(){if(_0x1ff223&&_0x1ff223[_0x5ac3('0x11')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1ff223[_0x5ac3('0x14')]());for(var _0x198eb0=0x0;_0x198eb0<_0x1ff223[_0x5ac3('0x11')];_0x198eb0++){io[_0x5ac3('0x19')](_0x5ac3('0x1a'),{'id':_0x1ff223[_0x198eb0],'closed':!![]});}}})['catch'](function(_0xe03a0e){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0xe03a0e?util[_0x5ac3('0x1b')](_0xe03a0e,{'showHidden':![],'depth':null}):'');});}exports[_0x5ac3('0x1c')]=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 4ec7b82..5386cae 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 _0x721f=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3c5426,_0x36b0f7){var _0x706015=function(_0x4d1d90){while(--_0x4d1d90){_0x3c5426['push'](_0x3c5426['shift']());}};_0x706015(++_0x36b0f7);}(_0x721f,0x180));var _0xf721=function(_0x1036b6,_0x5e3511){_0x1036b6=_0x1036b6-0x0;var _0x373faf=_0x721f[_0x1036b6];return _0x373faf;};'use strict';function start(){var _0x23f080=require(_0xf721('0x0'));return _0x23f080[_0xf721('0x1')]();}module[_0xf721('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x3f3e=['startAllRefreshIntervals','exports'];(function(_0x1de497,_0x5b2194){var _0x4f1c8f=function(_0x3a1364){while(--_0x3a1364){_0x1de497['push'](_0x1de497['shift']());}};_0x4f1c8f(++_0x5b2194);}(_0x3f3e,0x8a));var _0xe3f3=function(_0x5389e3,_0x4c7354){_0x5389e3=_0x5389e3-0x0;var _0x5e0f0a=_0x3f3e[_0x5389e3];return _0x5e0f0a;};'use strict';function start(){var _0x26bcd3=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x26bcd3[_0xe3f3('0x0')]();}module[_0xe3f3('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 f2fa551..3a8733d 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 _0x4a4d=['savename','%s.%s','basename','extname','zip','join','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','data','isNil','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','catch','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','keyBy','toString','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','stop','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports'];(function(_0x162167,_0x52203f){var _0x13fda6=function(_0x47848e){while(--_0x47848e){_0x162167['push'](_0x162167['shift']());}};_0x13fda6(++_0x52203f);}(_0x4a4d,0x90));var _0xd4a4=function(_0x3b7db2,_0x5edd58){_0x3b7db2=_0x3b7db2-0x0;var _0x3a819e=_0x4a4d[_0x3b7db2];return _0x3a819e;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xd4a4('0x0'));var _=require(_0xd4a4('0x1'));var moment=require(_0xd4a4('0x2'));var CronJobManager=require(_0xd4a4('0x3'));var jayson=require(_0xd4a4('0x4'));var BPromise=require(_0xd4a4('0x5'));var logger=require(_0xd4a4('0x6'))(_0xd4a4('0x7'));var db=require(_0xd4a4('0x8'))['db'];var analyticCustomReportController=require(_0xd4a4('0x9'));var analyticDefaultReportController=require(_0xd4a4('0xa'));var client=jayson[_0xd4a4('0xb')][_0xd4a4('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x400297,_0x566434){return function(){logger['info'](_0xd4a4('0xd'),_0x400297[_0xd4a4('0xe')]);var _0x15ce60=!![];var _0x509b99=_0x400297[_0xd4a4('0xf')][_0xd4a4('0x10')]();var _0x316790={'account':_0x509b99,'message':{'from':util[_0xd4a4('0x11')]('\x22%s\x22\x20<%s>',_0x400297[_0xd4a4('0xf')][_0xd4a4('0x12')],_0x400297[_0xd4a4('0xf')][_0xd4a4('0xe')]||_0x400297[_0xd4a4('0xf')][_0xd4a4('0x13')]['user']),'to':_0x400297['email'],'cc':_0x400297['cc'],'bcc':_0x400297[_0xd4a4('0x14')],'subject':util[_0xd4a4('0x11')](_0xd4a4('0x15'),_0x566434[_0xd4a4('0x12')],_0x400297[_0xd4a4('0x16')],_0x400297['subtractUnit'])}};var _0x2b11c8=path['join'](__dirname,_0xd4a4('0x17'));var _0x31134b=_0x566434[_0xd4a4('0x18')];var _0x29f4c3=util['format'](_0xd4a4('0x19'),path[_0xd4a4('0x1a')](_0x566434[_0xd4a4('0x18')],path[_0xd4a4('0x1b')](_0x566434[_0xd4a4('0x18')])),_0xd4a4('0x1c'));var _0x4ebb37=path[_0xd4a4('0x1d')](_0x2b11c8,_0x31134b);var _0x19249f=path['join'](_0x2b11c8,_0x29f4c3);if(fs['existsSync'](_0x4ebb37)){_0x566434['status']=_0xd4a4('0x1e');_0x316790['message'][_0xd4a4('0x1f')]=[{'filename':_0x31134b,'path':_0x4ebb37}];_0x316790[_0xd4a4('0x20')]['text']=util[_0xd4a4('0x11')](_0xd4a4('0x21'),JSON[_0xd4a4('0x22')](_0x566434,null,0x2));}else if(fs[_0xd4a4('0x23')](_0x19249f)){_0x566434['status']=_0xd4a4('0x1e');_0x316790[_0xd4a4('0x20')][_0xd4a4('0x1f')]=[{'filename':_0x29f4c3,'path':_0x19249f}];}else{_0x316790['message'][_0xd4a4('0x24')]=_0xd4a4('0x25');if(!_0x400297[_0xd4a4('0x26')]){_0x15ce60=![];logger[_0xd4a4('0x27')](_0xd4a4('0x28'));}}if(_0x15ce60){return client['request']('SendMail',_0x316790)[_0xd4a4('0x29')](function(_0x21d1d4){if(_0x21d1d4[_0xd4a4('0x2a')]){return logger[_0xd4a4('0x2a')](_0xd4a4('0x2b'),JSON[_0xd4a4('0x22')](_0x21d1d4));}return logger['info']('email\x20sent');})['catch'](function(_0x5bb5dd){return logger[_0xd4a4('0x2a')]('error\x20mail',JSON[_0xd4a4('0x22')](_0x5bb5dd));});}};}function handleError(){return function(_0x46176b){return logger['error'](JSON[_0xd4a4('0x22')](_0x46176b));};}function handleResult(_0x46870b){return function(_0x23d8b8){logger[_0xd4a4('0x27')](_0xd4a4('0x2c'),JSON[_0xd4a4('0x22')](_0x23d8b8));if(_0x46870b[_0xd4a4('0xf')]&&_0x46870b[_0xd4a4('0xf')][_0xd4a4('0x13')]&&!_['isNil'](_0x46870b[_0xd4a4('0xe')])){setTimeout(handleSendEmail(_0x46870b,_0x23d8b8),0x3c*0x3e8);}};}function handleJob(_0x52c769){return function(){try{if(_[_0xd4a4('0x2d')](_0x52c769['subtractNumber'])){return logger[_0xd4a4('0x27')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd4a4('0x2d')](_0x52c769[_0xd4a4('0x2e')])){return logger[_0xd4a4('0x27')]('subtractUnit\x20null\x20or\x20undefined');}var _0x1788fb={'startDate':moment()['subtract'](_0x52c769['subtractNumber'],_0x52c769[_0xd4a4('0x2e')])['format'](_0xd4a4('0x2f')),'endDate':moment()['format'](_0xd4a4('0x2f')),'type':'scheduled','output':_0x52c769[_0xd4a4('0x30')],'name':_0x52c769['name']};if(!_['isNil'](_0x52c769['DefaultReportId'])){logger[_0xd4a4('0x27')](_0xd4a4('0x31'),_0x52c769['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x52c769['DefaultReportId']},_0x1788fb)['then'](handleResult(_0x52c769))['catch'](handleError());}if(!_[_0xd4a4('0x2d')](_0x52c769[_0xd4a4('0x32')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x52c769[_0xd4a4('0x32')]);return analyticCustomReportController[_0xd4a4('0x33')]({'id':_0x52c769['CustomReportId']},_0x1788fb)[_0xd4a4('0x29')](handleResult(_0x52c769))[_0xd4a4('0x34')](handleError());}}catch(_0x4a4505){logger[_0xd4a4('0x2a')](JSON[_0xd4a4('0x22')](_0x4a4505));}return logger[_0xd4a4('0x27')]('no\x20report\x20id');};}function getJobs(_0x267648){var _0x3faaa8={};if(_0x267648){_0x3faaa8['id']=_0x267648;}return db[_0xd4a4('0x35')][_0xd4a4('0x36')]({'where':_0x3faaa8,'include':[{'model':db[_0xd4a4('0xf')],'attributes':['id','name','email'],'include':[{'model':db[_0xd4a4('0x37')],'as':_0xd4a4('0x13'),'include':[{'model':db['CloudProvider'],'as':_0xd4a4('0x38')}]}]}]})[_0xd4a4('0x29')](function(_0x4903cf){var _0xeede2d=_[_0xd4a4('0x39')](manager[_0xd4a4('0x3a')]);var _0xbd745e=_[_0xd4a4('0x3b')](_0x4903cf,function(_0x1d3610){return _0x1d3610['id']['toString']();});var _0x472e51=_[_0xd4a4('0x3c')](_0x4903cf,function(_0x38934f){return _0x38934f['id'][_0xd4a4('0x3d')]();});var _0x405e8f=_0x267648?_0xbd745e:_[_0xd4a4('0x3e')](_0xbd745e,_0xeede2d);var _0x349316=_[_0xd4a4('0x3f')](_0xbd745e,_0xeede2d);var _0x304ca4=_[_0xd4a4('0x3e')](_0xeede2d,_0xbd745e);var _0x1ee1e2;var _0x337da3;for(_0x1ee1e2=0x0;_0x1ee1e2<_0x304ca4[_0xd4a4('0x40')]&&!_0x267648;_0x1ee1e2+=0x1){_0x337da3=_0x304ca4[_0x1ee1e2][_0xd4a4('0x3d')]();if(manager[_0xd4a4('0x41')](_0x337da3)){manager['stop'](_0x337da3);manager[_0xd4a4('0x42')](_0x337da3);logger['info'](_0xd4a4('0x43'),_0x337da3);}}logger[_0xd4a4('0x27')](_0xd4a4('0x44'),JSON[_0xd4a4('0x22')](_0x405e8f));for(_0x1ee1e2=0x0;_0x1ee1e2<_0x405e8f[_0xd4a4('0x40')];_0x1ee1e2+=0x1){_0x337da3=_0x405e8f[_0x1ee1e2][_0xd4a4('0x3d')]();logger[_0xd4a4('0x27')](_0xd4a4('0x45'),_0x337da3);if(_0x267648){logger[_0xd4a4('0x27')](_0xd4a4('0x46'),_0x267648);logger['info'](JSON['stringify'](_0x472e51[_0x337da3]));BPromise['resolve']()[_0xd4a4('0x29')](handleJob(_0x472e51[_0x337da3]));logger[_0xd4a4('0x27')]('run\x20job',_0x472e51[_0x337da3][_0xd4a4('0x12')],_0x472e51[_0x337da3]['cron']);}else if(_0x472e51[_0x337da3][_0xd4a4('0x47')]&&_0x472e51[_0x337da3][_0xd4a4('0x48')]&&moment()[_0xd4a4('0x49')](_0x472e51[_0x337da3][_0xd4a4('0x4a')],_0x472e51[_0x337da3][_0xd4a4('0x4b')])){manager[_0xd4a4('0x4c')](_0x337da3,_0x472e51[_0x337da3][_0xd4a4('0x47')],handleJob(_0x472e51[_0x337da3]));manager[_0xd4a4('0x4d')](_0x337da3);logger[_0xd4a4('0x27')](_0xd4a4('0x4e'),_0x472e51[_0x337da3][_0xd4a4('0x12')],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}else if(manager[_0xd4a4('0x41')](_0x337da3)){manager['stop'](_0x337da3);manager[_0xd4a4('0x42')](_0x337da3);logger[_0xd4a4('0x27')](_0xd4a4('0x4f'),_0x472e51[_0x337da3]['name'],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}}for(_0x1ee1e2=0x0,_0x337da3;_0x1ee1e2<_0x349316[_0xd4a4('0x40')]&&!_0x267648;_0x1ee1e2+=0x1){_0x337da3=_0x349316[_0x1ee1e2][_0xd4a4('0x3d')]();if(manager[_0xd4a4('0x41')](_0x337da3)){if(_0x472e51[_0x337da3][_0xd4a4('0x47')]&&_0x472e51[_0x337da3][_0xd4a4('0x48')]&&moment()[_0xd4a4('0x49')](_0x472e51[_0x337da3][_0xd4a4('0x4a')],_0x472e51[_0x337da3]['endAt'])){manager[_0xd4a4('0x50')](_0x337da3,_0x472e51[_0x337da3][_0xd4a4('0x47')],handleJob(_0x472e51[_0x337da3]));logger['info'](_0xd4a4('0x51'),_0x472e51[_0x337da3]['name'],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}else{manager[_0xd4a4('0x52')](_0x337da3);manager[_0xd4a4('0x42')](_0x337da3);logger[_0xd4a4('0x27')](_0xd4a4('0x4f'),_0x472e51[_0x337da3][_0xd4a4('0x12')],_0x472e51[_0x337da3][_0xd4a4('0x47')]);}}}})[_0xd4a4('0x34')](function(_0x12e8e2){logger['error'](JSON[_0xd4a4('0x22')](_0x12e8e2));});}exports[_0xd4a4('0x53')]=function(_0x28b4a4){return getJobs(_0x28b4a4);};exports[_0xd4a4('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x06c5=['active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','exists','update','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','email','MailAccount','getSmtpOptions','format','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','basename','extname','zip','join','existsSync','status','Sent','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','stringify','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','email\x20sent','catch','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','CustomReportId','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','difference','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron'];(function(_0x103b56,_0x37e65b){var _0x45eeb2=function(_0x2a7e3b){while(--_0x2a7e3b){_0x103b56['push'](_0x103b56['shift']());}};_0x45eeb2(++_0x37e65b);}(_0x06c5,0x19f));var _0x506c=function(_0x436f4f,_0x111e20){_0x436f4f=_0x436f4f-0x0;var _0x98ab13=_0x06c5[_0x436f4f];return _0x98ab13;};'use strict';var fs=require('fs');var util=require(_0x506c('0x0'));var path=require(_0x506c('0x1'));var _=require(_0x506c('0x2'));var moment=require(_0x506c('0x3'));var CronJobManager=require(_0x506c('0x4'));var jayson=require(_0x506c('0x5'));var BPromise=require('bluebird');var logger=require(_0x506c('0x6'))('schedule');var db=require(_0x506c('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x506c('0x8'));var client=jayson[_0x506c('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26026d,_0x2ea253){return function(){logger[_0x506c('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x26026d[_0x506c('0xb')]);var _0x41edd3=!![];var _0x466834=_0x26026d[_0x506c('0xc')][_0x506c('0xd')]();var _0x3f9547={'account':_0x466834,'message':{'from':util[_0x506c('0xe')]('\x22%s\x22\x20<%s>',_0x26026d[_0x506c('0xc')][_0x506c('0xf')],_0x26026d[_0x506c('0xc')][_0x506c('0xb')]||_0x26026d['MailAccount']['Smtp']['user']),'to':_0x26026d[_0x506c('0xb')],'cc':_0x26026d['cc'],'bcc':_0x26026d[_0x506c('0x10')],'subject':util[_0x506c('0xe')](_0x506c('0x11'),_0x2ea253[_0x506c('0xf')],_0x26026d[_0x506c('0x12')],_0x26026d[_0x506c('0x13')])}};var _0x3bbe8b=path['join'](__dirname,_0x506c('0x14'));var _0x4413c0=_0x2ea253[_0x506c('0x15')];var _0x1c6755=util[_0x506c('0xe')]('%s.%s',path[_0x506c('0x16')](_0x2ea253['savename'],path[_0x506c('0x17')](_0x2ea253[_0x506c('0x15')])),_0x506c('0x18'));var _0x14279c=path[_0x506c('0x19')](_0x3bbe8b,_0x4413c0);var _0x4b0141=path[_0x506c('0x19')](_0x3bbe8b,_0x1c6755);if(fs[_0x506c('0x1a')](_0x14279c)){_0x2ea253[_0x506c('0x1b')]=_0x506c('0x1c');_0x3f9547[_0x506c('0x1d')][_0x506c('0x1e')]=[{'filename':_0x4413c0,'path':_0x14279c}];_0x3f9547[_0x506c('0x1d')][_0x506c('0x1f')]=util[_0x506c('0xe')](_0x506c('0x20'),JSON[_0x506c('0x21')](_0x2ea253,null,0x2));}else if(fs[_0x506c('0x1a')](_0x4b0141)){_0x2ea253['status']=_0x506c('0x1c');_0x3f9547[_0x506c('0x1d')]['attachments']=[{'filename':_0x1c6755,'path':_0x4b0141}];}else{_0x3f9547[_0x506c('0x1d')][_0x506c('0x1f')]=_0x506c('0x22');if(!_0x26026d[_0x506c('0x23')]){_0x41edd3=![];logger['info'](_0x506c('0x24'));}}if(_0x41edd3){return client[_0x506c('0x25')](_0x506c('0x26'),_0x3f9547)[_0x506c('0x27')](function(_0xb2f166){if(_0xb2f166[_0x506c('0x28')]){return logger[_0x506c('0x28')](_0x506c('0x29'),JSON[_0x506c('0x21')](_0xb2f166));}return logger['info'](_0x506c('0x2a'));})[_0x506c('0x2b')](function(_0x2c38b3){return logger[_0x506c('0x28')]('error\x20mail',JSON[_0x506c('0x21')](_0x2c38b3));});}};}function handleError(){return function(_0x59e724){return logger['error'](JSON[_0x506c('0x21')](_0x59e724));};}function handleResult(_0x261467){return function(_0x747d23){logger['info']('data',JSON[_0x506c('0x21')](_0x747d23));if(_0x261467[_0x506c('0xc')]&&_0x261467[_0x506c('0xc')][_0x506c('0x2c')]&&!_[_0x506c('0x2d')](_0x261467[_0x506c('0xb')])){setTimeout(handleSendEmail(_0x261467,_0x747d23),0x3c*0x3e8);}};}function handleJob(_0x44b9a0){return function(){try{if(_['isNil'](_0x44b9a0[_0x506c('0x12')])){return logger[_0x506c('0xa')](_0x506c('0x2e'));}if(_[_0x506c('0x2d')](_0x44b9a0[_0x506c('0x13')])){return logger[_0x506c('0xa')](_0x506c('0x2f'));}var _0x53888c={'startDate':moment()[_0x506c('0x30')](_0x44b9a0['subtractNumber'],_0x44b9a0[_0x506c('0x13')])[_0x506c('0xe')](_0x506c('0x31')),'endDate':moment()[_0x506c('0xe')](_0x506c('0x31')),'type':_0x506c('0x32'),'output':_0x44b9a0['output'],'name':_0x44b9a0[_0x506c('0xf')]};if(!_[_0x506c('0x2d')](_0x44b9a0[_0x506c('0x33')])){logger[_0x506c('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x44b9a0[_0x506c('0x33')]);return analyticDefaultReportController['runReport']({'id':_0x44b9a0[_0x506c('0x33')]},_0x53888c)['then'](handleResult(_0x44b9a0))[_0x506c('0x2b')](handleError());}if(!_['isNil'](_0x44b9a0[_0x506c('0x34')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x44b9a0[_0x506c('0x34')]);return analyticCustomReportController['runReport']({'id':_0x44b9a0[_0x506c('0x34')]},_0x53888c)['then'](handleResult(_0x44b9a0))[_0x506c('0x2b')](handleError());}}catch(_0x2dd918){logger[_0x506c('0x28')](JSON['stringify'](_0x2dd918));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x2c4334){var _0x196ce7={};if(_0x2c4334){_0x196ce7['id']=_0x2c4334;}return db['Schedule'][_0x506c('0x35')]({'where':_0x196ce7,'include':[{'model':db[_0x506c('0xc')],'attributes':['id','name',_0x506c('0xb')],'include':[{'model':db[_0x506c('0x36')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x506c('0x37')}]}]}]})[_0x506c('0x27')](function(_0x1918fe){var _0x355284=_[_0x506c('0x38')](manager[_0x506c('0x39')]);var _0x36ddea=_[_0x506c('0x3a')](_0x1918fe,function(_0x2ff40c){return _0x2ff40c['id']['toString']();});var _0x1a11e2=_['keyBy'](_0x1918fe,function(_0x5463f6){return _0x5463f6['id'][_0x506c('0x3b')]();});var _0x140e2f=_0x2c4334?_0x36ddea:_[_0x506c('0x3c')](_0x36ddea,_0x355284);var _0x460f1b=_['intersection'](_0x36ddea,_0x355284);var _0x222a94=_[_0x506c('0x3c')](_0x355284,_0x36ddea);var _0x8772f5;var _0x56be7e;for(_0x8772f5=0x0;_0x8772f5<_0x222a94[_0x506c('0x3d')]&&!_0x2c4334;_0x8772f5+=0x1){_0x56be7e=_0x222a94[_0x8772f5]['toString']();if(manager['exists'](_0x56be7e)){manager[_0x506c('0x3e')](_0x56be7e);manager[_0x506c('0x3f')](_0x56be7e);logger['info'](_0x506c('0x40'),_0x56be7e);}}logger['info'](_0x506c('0x41'),JSON[_0x506c('0x21')](_0x140e2f));for(_0x8772f5=0x0;_0x8772f5<_0x140e2f[_0x506c('0x3d')];_0x8772f5+=0x1){_0x56be7e=_0x140e2f[_0x8772f5][_0x506c('0x3b')]();logger[_0x506c('0xa')](_0x506c('0x42'),_0x56be7e);if(_0x2c4334){logger[_0x506c('0xa')](_0x506c('0x43'),_0x2c4334);logger[_0x506c('0xa')](JSON['stringify'](_0x1a11e2[_0x56be7e]));BPromise[_0x506c('0x44')]()[_0x506c('0x27')](handleJob(_0x1a11e2[_0x56be7e]));logger[_0x506c('0xa')](_0x506c('0x45'),_0x1a11e2[_0x56be7e][_0x506c('0xf')],_0x1a11e2[_0x56be7e]['cron']);}else if(_0x1a11e2[_0x56be7e][_0x506c('0x46')]&&_0x1a11e2[_0x56be7e][_0x506c('0x47')]&&moment()[_0x506c('0x48')](_0x1a11e2[_0x56be7e][_0x506c('0x49')],_0x1a11e2[_0x56be7e]['endAt'])){manager[_0x506c('0x4a')](_0x56be7e,_0x1a11e2[_0x56be7e][_0x506c('0x46')],handleJob(_0x1a11e2[_0x56be7e]));manager[_0x506c('0x4b')](_0x56be7e);logger['info'](_0x506c('0x4c'),_0x1a11e2[_0x56be7e][_0x506c('0xf')],_0x1a11e2[_0x56be7e][_0x506c('0x46')]);}else if(manager['exists'](_0x56be7e)){manager['stop'](_0x56be7e);manager['deleteJob'](_0x56be7e);logger['info'](_0x506c('0x4d'),_0x1a11e2[_0x56be7e][_0x506c('0xf')],_0x1a11e2[_0x56be7e][_0x506c('0x46')]);}}for(_0x8772f5=0x0,_0x56be7e;_0x8772f5<_0x460f1b['length']&&!_0x2c4334;_0x8772f5+=0x1){_0x56be7e=_0x460f1b[_0x8772f5][_0x506c('0x3b')]();if(manager[_0x506c('0x4e')](_0x56be7e)){if(_0x1a11e2[_0x56be7e][_0x506c('0x46')]&&_0x1a11e2[_0x56be7e]['active']&&moment()['isBetween'](_0x1a11e2[_0x56be7e][_0x506c('0x49')],_0x1a11e2[_0x56be7e]['endAt'])){manager[_0x506c('0x4f')](_0x56be7e,_0x1a11e2[_0x56be7e][_0x506c('0x46')],handleJob(_0x1a11e2[_0x56be7e]));logger[_0x506c('0xa')]('update\x20cron',_0x1a11e2[_0x56be7e]['name'],_0x1a11e2[_0x56be7e][_0x506c('0x46')]);}else{manager[_0x506c('0x3e')](_0x56be7e);manager[_0x506c('0x3f')](_0x56be7e);logger['info'](_0x506c('0x4d'),_0x1a11e2[_0x56be7e][_0x506c('0xf')],_0x1a11e2[_0x56be7e][_0x506c('0x46')]);}}}})['catch'](function(_0x42272b){logger['error'](JSON[_0x506c('0x21')](_0x42272b));});}exports[_0x506c('0x50')]=function(_0xc0f41c){return getJobs(_0xc0f41c);};exports['start']=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 19f2b1c..25d9dc0 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 _0x22a4=['util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','bucket','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','Transcript\x20not\x20available','Neutral','COMPLETED','catch','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','all','name','lodash','aws-sdk','request-promise'];(function(_0x216a28,_0x4f021e){var _0x4f4901=function(_0x285775){while(--_0x285775){_0x216a28['push'](_0x216a28['shift']());}};_0x4f4901(++_0x4f021e);}(_0x22a4,0x1cb));var _0x422a=function(_0x130ef2,_0x3cc896){_0x130ef2=_0x130ef2-0x0;var _0x1e7442=_0x22a4[_0x130ef2];return _0x1e7442;};var _=require(_0x422a('0x0'));var AWS=require(_0x422a('0x1'));var rp=require(_0x422a('0x2'));var util=require(_0x422a('0x3'));var BPromise=require(_0x422a('0x4'));var db=require(_0x422a('0x5'))['db'];var logger=require(_0x422a('0x6'))(_0x422a('0x7'));function getTranscriptionJob(_0x5457aa,_0x32dc33,_0x10cc65,_0x1d5d59){return new Promise(function(_0x33e51c,_0x28deaa){var _0x5e8fe2=new AWS[(_0x422a('0x8'))]({'accessKeyId':_0x32dc33,'secretAccessKey':_0x5457aa,'region':_0x10cc65});_0x5e8fe2[_0x422a('0x9')]({'TranscriptionJobName':_0x1d5d59},function(_0x23b1b0,_0x392224){if(_0x23b1b0){return _0x28deaa(_0x23b1b0);}else{return _0x33e51c(_0x392224);}});});}function sentiment(_0x3f785b,_0x3ad391,_0x317466,_0x29caa4,_0x4b76b7){return new Promise(function(_0x4fef05,_0x336959){var _0x2eed9c=new AWS[(_0x422a('0xa'))]({'accessKeyId':_0x3ad391,'secretAccessKey':_0x3f785b,'region':_0x317466});_0x2eed9c[_0x422a('0xb')]({'Text':_0x29caa4,'LanguageCode':_0x4b76b7[_0x422a('0xc')](0x0,0x2)},function(_0x1aa133,_0x48c0a2){if(_0x1aa133){return _0x336959(_0x1aa133);}else{return _0x4fef05(_0x48c0a2);}});});}function checkTranscribeJob(_0x489953,_0xebe70d,_0x4dbed1){var _0x5a0c59;return new BPromise(function(_0x5a1200,_0x30f24c){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0xf'),_0x489953['id'],_0x489953[_0x422a('0x10')]));return getTranscriptionJob(_0x4dbed1[_0x422a('0x11')],_0x4dbed1[_0x422a('0x12')],_0xebe70d[_0x422a('0x13')],_0x489953[_0x422a('0x10')])[_0x422a('0x14')](function(_0x30b6e9){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x15'),_0x489953['id'],_0x489953[_0x422a('0x10')],_0x30b6e9[_0x422a('0x16')][_0x422a('0x17')]));if(!_0x489953['fileText']){switch(_0x30b6e9[_0x422a('0x16')][_0x422a('0x17')]){case'COMPLETED':var _0x26bce9={'transcribeStatus':_0x30b6e9['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x30b6e9[_0x422a('0x16')][_0x422a('0x18')][_0x422a('0x19')]};logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x1a'),_0x489953['id']));return rp({'uri':_0x30b6e9[_0x422a('0x16')][_0x422a('0x18')]['TranscriptFileUri'],'json':!![]})[_0x422a('0x14')](function(_0x3284ed){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x1b'),_0x489953['id']));if(_0x3284ed&&_0x3284ed['results']&&_0x3284ed[_0x422a('0x1c')][_0x422a('0x1d')]&&_0x3284ed[_0x422a('0x1c')]['transcripts'][_0x422a('0x1e')]){_0x26bce9[_0x422a('0x1f')]='';for(var _0x1fd126=0x0;_0x1fd126<_0x3284ed[_0x422a('0x1c')][_0x422a('0x1d')][_0x422a('0x1e')];_0x1fd126++){_0x26bce9[_0x422a('0x1f')]+=_0x3284ed[_0x422a('0x1c')]['transcripts'][_0x1fd126][_0x422a('0x20')]+'';}}return _0x489953[_0x422a('0x21')](_0x26bce9);})['then'](function(){logger[_0x422a('0xd')](util['format'](_0x422a('0x22'),_0x489953['id']));if(!_0x489953[_0x422a('0x23')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xebe70d[_0x422a('0x26')]||!_0xebe70d[_0x422a('0x27')]||!_0xebe70d['sentimentRegion']||!_0xebe70d['language']||!_0xebe70d[_0x422a('0x28')]){throw new db[(_0x422a('0x24'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x26bce9['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0xebe70d['sentimentAccountId']===_0x4dbed1['id']){return _0x4dbed1;}else{return db[_0x422a('0x29')][_0x422a('0x2a')]({'where':{'id':_settings[_0x422a('0x27')]}});}})[_0x422a('0x14')](function(_0x30a1e3){if(!_0x30a1e3){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x2b'));}if(!_0x30a1e3[_0x422a('0x11')]||!_0x30a1e3[_0x422a('0x12')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x2c'));}_0x5a0c59=_0x30a1e3;logger['info'](util[_0x422a('0xe')](_0x422a('0x2d'),_0x489953['id']));return sentiment(_0x5a0c59[_0x422a('0x11')],_0x5a0c59[_0x422a('0x12')],_0xebe70d['sentimentRegion'],_0x26bce9[_0x422a('0x1f')],_0xebe70d['language']);})[_0x422a('0x14')](function(_0x100e45){logger['info'](util[_0x422a('0xe')](_0x422a('0x2e'),_0x489953['id']));return _0x489953['update']({'sentiment':_0x100e45[_0x422a('0x2f')],'sPositive':_0x100e45[_0x422a('0x30')][_0x422a('0x31')],'sNegative':_0x100e45[_0x422a('0x30')][_0x422a('0x32')],'sMixed':_0x100e45[_0x422a('0x30')][_0x422a('0x33')],'sNeutral':_0x100e45[_0x422a('0x30')]['Neutral']});})['then'](function(){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x22'),_0x489953['id']));_0x5a1200();});case'FAILED':return _0x489953[_0x422a('0x21')]({'transcribeStatus':_0x422a('0x34'),'failureReason':_0x30b6e9['TranscriptionJob']['FailureReason']})[_0x422a('0x14')](function(){logger['info'](util[_0x422a('0xe')](_0x422a('0x22'),_0x489953['id']));_0x5a1200();});default:logger[_0x422a('0xd')](util['format'](_0x422a('0x35'),_0x489953['id']));break;}}else{return BPromise[_0x422a('0x36')]()[_0x422a('0x14')](function(){if(!_0x489953['tempSentiment']){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x37'));}if(!_0xebe70d[_0x422a('0x26')]||!_0xebe70d['sentimentAccountId']||!_0xebe70d[_0x422a('0x38')]||!_0xebe70d[_0x422a('0x39')]||!_0xebe70d[_0x422a('0x28')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x489953[_0x422a('0x1f')]){throw new Error(_0x422a('0x3a'));}if(_0xebe70d[_0x422a('0x27')]===_0x4dbed1['id']){return _0x4dbed1;}else{return db[_0x422a('0x29')][_0x422a('0x2a')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x2b700d){if(!_0x2b700d){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x2b'));}if(!_0x2b700d[_0x422a('0x11')]||!_0x2b700d[_0x422a('0x12')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x2c'));}_0x5a0c59=_0x2b700d;logger['info'](util[_0x422a('0xe')](_0x422a('0x2d'),_0x489953['id']));return sentiment(_0x5a0c59[_0x422a('0x11')],_0x5a0c59[_0x422a('0x12')],_0xebe70d[_0x422a('0x38')],_0x489953[_0x422a('0x1f')],_0xebe70d[_0x422a('0x39')]);})['then'](function(_0x4127a5){logger[_0x422a('0xd')](util['format'](_0x422a('0x2e'),_0x489953['id']));return _0x489953[_0x422a('0x21')]({'sentiment':_0x4127a5[_0x422a('0x2f')],'sPositive':_0x4127a5[_0x422a('0x30')][_0x422a('0x31')],'sNegative':_0x4127a5[_0x422a('0x30')][_0x422a('0x32')],'sMixed':_0x4127a5['SentimentScore'][_0x422a('0x33')],'sNeutral':_0x4127a5[_0x422a('0x30')][_0x422a('0x3b')],'transcribeStatus':_0x422a('0x3c')});})[_0x422a('0x14')](function(){logger[_0x422a('0xd')](util[_0x422a('0xe')](_0x422a('0x22'),_0x489953['id']));_0x5a1200();});}})[_0x422a('0x3d')](function(_0x1a187b){if(_0x1a187b){if(!_0x1a187b['name']||_0x1a187b['name']!==_0x422a('0x3e')){logger[_0x422a('0x3f')](util['format'](_0x422a('0x40'),_0x489953['id']),util[_0x422a('0x41')](_0x1a187b,{'showHidden':![],'depth':null}));}}_0x5a1200();});});}function checkTranscribe(){var _0x41dd0a;var _0xf4ddc5;var _0x706497;return db[_0x422a('0x42')][_0x422a('0x43')]({'where':{'transcribeStatus':_0x422a('0x44')}})[_0x422a('0x14')](function(_0x3846bd){if(!_0x3846bd||!_0x3846bd['length']){throw new db['Sequelize'][(_0x422a('0x25'))](_0x422a('0x45'));}_0x41dd0a=_0x3846bd;return db['Setting'][_0x422a('0x2a')]({'where':{'id':0x1}});})[_0x422a('0x14')](function(_0x20b4d3){if(!_0x20b4d3){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x46'));}_0xf4ddc5=_0x20b4d3;if(!_0xf4ddc5[_0x422a('0x7')]||!_0xf4ddc5['transcribeAccountId']||!_0xf4ddc5[_0x422a('0x13')]||!_0xf4ddc5[_0x422a('0x39')]||!_0xf4ddc5[_0x422a('0x28')]){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x47'));}return db['CloudProvider']['findOne']({'where':{'id':_0xf4ddc5[_0x422a('0x48')]}});})[_0x422a('0x14')](function(_0x1ff3ad){if(!_0x1ff3ad){throw new db[(_0x422a('0x24'))][(_0x422a('0x25'))](_0x422a('0x2b'));}if(!_0x1ff3ad[_0x422a('0x11')]||!_0x1ff3ad[_0x422a('0x12')]){throw new db[(_0x422a('0x24'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x706497=_0x1ff3ad;var _0x58780a=[];_0x41dd0a[_0x422a('0x49')](function(_0x23372f){_0x58780a[_0x422a('0x4a')](checkTranscribeJob(_0x23372f,_0xf4ddc5,_0x706497));});return BPromise[_0x422a('0x4b')](_0x58780a);})['catch'](function(_0x3c04e6){if(_0x3c04e6){if(!_0x3c04e6[_0x422a('0x4c')]||_0x3c04e6[_0x422a('0x4c')]!==_0x422a('0x3e')){logger[_0x422a('0x3f')](util[_0x422a('0x41')](_0x3c04e6,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x3aa2=['FailureReason','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','Neutral','COMPLETED','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','forEach','push','catch','inspect','lodash','aws-sdk','util','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED'];(function(_0x45319d,_0x5a0653){var _0x20f076=function(_0x3da82c){while(--_0x3da82c){_0x45319d['push'](_0x45319d['shift']());}};_0x20f076(++_0x5a0653);}(_0x3aa2,0x13b));var _0x23aa=function(_0x5880d8,_0x30b0a5){_0x5880d8=_0x5880d8-0x0;var _0x88264a=_0x3aa2[_0x5880d8];return _0x88264a;};var _=require(_0x23aa('0x0'));var AWS=require(_0x23aa('0x1'));var rp=require('request-promise');var util=require(_0x23aa('0x2'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x23aa('0x3'))(_0x23aa('0x4'));function getTranscriptionJob(_0x556204,_0x38c0ab,_0x5b9038,_0x34a195){return new Promise(function(_0x24a89d,_0x4868c2){var _0x461bde=new AWS[(_0x23aa('0x5'))]({'accessKeyId':_0x38c0ab,'secretAccessKey':_0x556204,'region':_0x5b9038});_0x461bde[_0x23aa('0x6')]({'TranscriptionJobName':_0x34a195},function(_0x5f3efd,_0x41bfc5){if(_0x5f3efd){return _0x4868c2(_0x5f3efd);}else{return _0x24a89d(_0x41bfc5);}});});}function sentiment(_0x3e2a05,_0x23cd87,_0x5c2595,_0x4b8b1a,_0xb70adc){return new Promise(function(_0x5100f4,_0x3f9456){var _0x155c20=new AWS[(_0x23aa('0x7'))]({'accessKeyId':_0x23cd87,'secretAccessKey':_0x3e2a05,'region':_0x5c2595});_0x155c20[_0x23aa('0x8')]({'Text':_0x4b8b1a,'LanguageCode':_0xb70adc[_0x23aa('0x9')](0x0,0x2)},function(_0x459412,_0x402b42){if(_0x459412){return _0x3f9456(_0x459412);}else{return _0x5100f4(_0x402b42);}});});}function checkTranscribeJob(_0x5ed160,_0x4fdd70,_0x4f9c72){var _0x1f71ef;return new BPromise(function(_0x1c664b,_0x109649){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0xc'),_0x5ed160['id'],_0x5ed160[_0x23aa('0xd')]));return getTranscriptionJob(_0x4f9c72[_0x23aa('0xe')],_0x4f9c72['data2'],_0x4fdd70[_0x23aa('0xf')],_0x5ed160['transcribeName'])['then'](function(_0x3cbbde){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x10'),_0x5ed160['id'],_0x5ed160[_0x23aa('0xd')],_0x3cbbde[_0x23aa('0x11')]['TranscriptionJobStatus']));if(!_0x5ed160[_0x23aa('0x12')]){switch(_0x3cbbde[_0x23aa('0x11')]['TranscriptionJobStatus']){case'COMPLETED':var _0x4d660f={'transcribeStatus':_0x3cbbde['TranscriptionJob'][_0x23aa('0x13')],'fileUri':_0x3cbbde[_0x23aa('0x11')][_0x23aa('0x14')]['TranscriptFileUri']};logger[_0x23aa('0xa')](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x5ed160['id']));return rp({'uri':_0x3cbbde[_0x23aa('0x11')][_0x23aa('0x14')][_0x23aa('0x15')],'json':!![]})[_0x23aa('0x16')](function(_0x106bde){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x17'),_0x5ed160['id']));if(_0x106bde&&_0x106bde[_0x23aa('0x18')]&&_0x106bde['results'][_0x23aa('0x19')]&&_0x106bde[_0x23aa('0x18')][_0x23aa('0x19')][_0x23aa('0x1a')]){_0x4d660f['fileText']='';for(var _0x23771b=0x0;_0x23771b<_0x106bde['results'][_0x23aa('0x19')][_0x23aa('0x1a')];_0x23771b++){_0x4d660f[_0x23aa('0x12')]+=_0x106bde['results'][_0x23aa('0x19')][_0x23771b][_0x23aa('0x1b')]+'';}}return _0x5ed160[_0x23aa('0x1c')](_0x4d660f);})[_0x23aa('0x16')](function(){logger[_0x23aa('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5ed160['id']));if(!_0x5ed160[_0x23aa('0x1d')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x20'));}if(!_0x4fdd70[_0x23aa('0x21')]||!_0x4fdd70[_0x23aa('0x22')]||!_0x4fdd70[_0x23aa('0x23')]||!_0x4fdd70[_0x23aa('0x24')]||!_0x4fdd70[_0x23aa('0x25')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x26'));}if(!_0x4d660f[_0x23aa('0x12')]){throw new Error(_0x23aa('0x27'));}if(_0x4fdd70['sentimentAccountId']===_0x4f9c72['id']){return _0x4f9c72;}else{return db['CloudProvider'][_0x23aa('0x28')]({'where':{'id':_settings[_0x23aa('0x22')]}});}})[_0x23aa('0x16')](function(_0x49f23d){if(!_0x49f23d){throw new db['Sequelize'][(_0x23aa('0x1f'))](_0x23aa('0x29'));}if(!_0x49f23d[_0x23aa('0xe')]||!_0x49f23d['data2']){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x1f71ef=_0x49f23d;logger[_0x23aa('0xa')](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5ed160['id']));return sentiment(_0x1f71ef[_0x23aa('0xe')],_0x1f71ef[_0x23aa('0x2a')],_0x4fdd70['sentimentRegion'],_0x4d660f[_0x23aa('0x12')],_0x4fdd70[_0x23aa('0x24')]);})[_0x23aa('0x16')](function(_0x230a77){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x2b'),_0x5ed160['id']));return _0x5ed160['update']({'sentiment':_0x230a77[_0x23aa('0x2c')],'sPositive':_0x230a77[_0x23aa('0x2d')][_0x23aa('0x2e')],'sNegative':_0x230a77['SentimentScore']['Negative'],'sMixed':_0x230a77[_0x23aa('0x2d')][_0x23aa('0x2f')],'sNeutral':_0x230a77[_0x23aa('0x2d')]['Neutral']});})[_0x23aa('0x16')](function(){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x30'),_0x5ed160['id']));_0x1c664b();});case _0x23aa('0x31'):return _0x5ed160[_0x23aa('0x1c')]({'transcribeStatus':_0x23aa('0x31'),'failureReason':_0x3cbbde[_0x23aa('0x11')][_0x23aa('0x32')]})[_0x23aa('0x16')](function(){logger[_0x23aa('0xa')](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5ed160['id']));_0x1c664b();});default:logger['info'](util[_0x23aa('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x5ed160['id']));break;}}else{return BPromise['resolve']()[_0x23aa('0x16')](function(){if(!_0x5ed160['tempSentiment']){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x20'));}if(!_0x4fdd70['sentiment']||!_0x4fdd70[_0x23aa('0x22')]||!_0x4fdd70[_0x23aa('0x23')]||!_0x4fdd70[_0x23aa('0x24')]||!_0x4fdd70[_0x23aa('0x25')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x26'));}if(!_0x5ed160['fileText']){throw new Error(_0x23aa('0x27'));}if(_0x4fdd70['sentimentAccountId']===_0x4f9c72['id']){return _0x4f9c72;}else{return db[_0x23aa('0x33')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x284b94){if(!_0x284b94){throw new db['Sequelize']['ValidationError'](_0x23aa('0x29'));}if(!_0x284b94[_0x23aa('0xe')]||!_0x284b94[_0x23aa('0x2a')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x1f71ef=_0x284b94;logger['info'](util[_0x23aa('0xb')](_0x23aa('0x34'),_0x5ed160['id']));return sentiment(_0x1f71ef[_0x23aa('0xe')],_0x1f71ef['data2'],_0x4fdd70[_0x23aa('0x23')],_0x5ed160['fileText'],_0x4fdd70[_0x23aa('0x24')]);})[_0x23aa('0x16')](function(_0x26d37d){logger['info'](util[_0x23aa('0xb')](_0x23aa('0x2b'),_0x5ed160['id']));return _0x5ed160['update']({'sentiment':_0x26d37d[_0x23aa('0x2c')],'sPositive':_0x26d37d['SentimentScore'][_0x23aa('0x2e')],'sNegative':_0x26d37d[_0x23aa('0x2d')][_0x23aa('0x35')],'sMixed':_0x26d37d[_0x23aa('0x2d')][_0x23aa('0x2f')],'sNeutral':_0x26d37d['SentimentScore'][_0x23aa('0x36')],'transcribeStatus':_0x23aa('0x37')});})['then'](function(){logger[_0x23aa('0xa')](util[_0x23aa('0xb')](_0x23aa('0x30'),_0x5ed160['id']));_0x1c664b();});}})['catch'](function(_0xf69307){if(_0xf69307){if(!_0xf69307['name']||_0xf69307[_0x23aa('0x38')]!==_0x23aa('0x39')){logger[_0x23aa('0x3a')](util[_0x23aa('0xb')](_0x23aa('0x3b'),_0x5ed160['id']),util['inspect'](_0xf69307,{'showHidden':![],'depth':null}));}}_0x1c664b();});});}function checkTranscribe(){var _0x3b8ec3;var _0x72f912;var _0x5a6653;return db[_0x23aa('0x3c')][_0x23aa('0x3d')]({'where':{'transcribeStatus':_0x23aa('0x3e')}})[_0x23aa('0x16')](function(_0x29985c){if(!_0x29985c||!_0x29985c['length']){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x3f'));}_0x3b8ec3=_0x29985c;return db[_0x23aa('0x40')][_0x23aa('0x28')]({'where':{'id':0x1}});})[_0x23aa('0x16')](function(_0x318fb3){if(!_0x318fb3){throw new db[(_0x23aa('0x1e'))]['ValidationError'](_0x23aa('0x41'));}_0x72f912=_0x318fb3;if(!_0x72f912[_0x23aa('0x4')]||!_0x72f912[_0x23aa('0x42')]||!_0x72f912[_0x23aa('0xf')]||!_0x72f912['language']||!_0x72f912[_0x23aa('0x25')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x43'));}return db['CloudProvider']['findOne']({'where':{'id':_0x72f912[_0x23aa('0x42')]}});})[_0x23aa('0x16')](function(_0x3a9c00){if(!_0x3a9c00){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x29'));}if(!_0x3a9c00[_0x23aa('0xe')]||!_0x3a9c00[_0x23aa('0x2a')]){throw new db[(_0x23aa('0x1e'))][(_0x23aa('0x1f'))](_0x23aa('0x44'));}_0x5a6653=_0x3a9c00;var _0x243634=[];_0x3b8ec3[_0x23aa('0x45')](function(_0x1effd3){_0x243634[_0x23aa('0x46')](checkTranscribeJob(_0x1effd3,_0x72f912,_0x5a6653));});return BPromise['all'](_0x243634);})[_0x23aa('0x47')](function(_0x72d858){if(_0x72d858){if(!_0x72d858[_0x23aa('0x38')]||_0x72d858[_0x23aa('0x38')]!==_0x23aa('0x39')){logger[_0x23aa('0x3a')](util[_0x23aa('0x48')](_0x72d858,{'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 0e064df..b170034 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 _0xa10f=['catch','error','inspect','start','lodash','moment','ioredis','../logger','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update'];(function(_0x325532,_0x2ec103){var _0x172655=function(_0x5d7fb4){while(--_0x5d7fb4){_0x325532['push'](_0x325532['shift']());}};_0x172655(++_0x2ec103);}(_0xa10f,0x6c));var _0xfa10=function(_0x1688c6,_0x5e50d1){_0x1688c6=_0x1688c6-0x0;var _0x594d2b=_0xa10f[_0x1688c6];return _0x594d2b;};'use strict';var _=require(_0xfa10('0x0'));var moment=require(_0xfa10('0x1'));var Redis=require(_0xfa10('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xfa10('0x3'))(_0xfa10('0x4'));config[_0xfa10('0x5')]=_['defaults'](config[_0xfa10('0x5')],{'host':_0xfa10('0x6'),'port':0x18eb});var io=require(_0xfa10('0x7'))(new Redis(config['redis']));function closeInteractions(){var _0x472944=[];return db[_0xfa10('0x8')][_0xfa10('0x9')]({'raw':!![],'attributes':['id',_0xfa10('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xfa10('0xb')](0x18,'hours')}}})['then'](function(_0x13231c){if(_0x13231c&&_0x13231c[_0xfa10('0xc')]){_0x472944=_['map'](_0x13231c||[],'id');logger[_0xfa10('0xd')](_0xfa10('0xe'),_0x472944['join']());return db[_0xfa10('0x8')][_0xfa10('0xf')]({'closeReason':_0xfa10('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xfa10('0x11')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x472944}});}})[_0xfa10('0x12')](function(){if(_0x472944&&_0x472944[_0xfa10('0xc')]){logger[_0xfa10('0xd')](_0xfa10('0x13'),_0x472944['join']());for(var _0x228440=0x0;_0x228440<_0x472944[_0xfa10('0xc')];_0x228440++){io[_0xfa10('0x14')](_0xfa10('0x15'),{'id':_0x472944[_0x228440],'closed':!![]});}}})[_0xfa10('0x16')](function(_0xc377be){logger[_0xfa10('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xc377be?util[_0xfa10('0x18')](_0xc377be,{'showHidden':![],'depth':null}):'');});}exports[_0xfa10('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x83eb=['emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','YYYY-MM-DD\x20HH:mm:ss','then','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x83eb,0x1f2));var _0xb83e=function(_0x40226b,_0x532b6d){_0x40226b=_0x40226b-0x0;var _0x2db6c9=_0x83eb[_0x40226b];return _0x2db6c9;};'use strict';var _=require(_0xb83e('0x0'));var moment=require(_0xb83e('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xb83e('0x2'));var db=require(_0xb83e('0x3'))['db'];var logger=require(_0xb83e('0x4'))(_0xb83e('0x5'));config['redis']=_[_0xb83e('0x6')](config[_0xb83e('0x7')],{'host':_0xb83e('0x8'),'port':0x18eb});var io=require(_0xb83e('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x46083a=[];return db[_0xb83e('0xa')][_0xb83e('0xb')]({'raw':!![],'attributes':['id',_0xb83e('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xb83e('0xd'))}}})['then'](function(_0x40b21a){if(_0x40b21a&&_0x40b21a[_0xb83e('0xe')]){_0x46083a=_[_0xb83e('0xf')](_0x40b21a||[],'id');logger['info'](_0xb83e('0x10'),_0x46083a[_0xb83e('0x11')]());return db[_0xb83e('0xa')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0xb83e('0x12'))},{'where':{'id':_0x46083a}});}})[_0xb83e('0x13')](function(){if(_0x46083a&&_0x46083a[_0xb83e('0xe')]){logger[_0xb83e('0x14')](_0xb83e('0x15'),_0x46083a[_0xb83e('0x11')]());for(var _0x238eda=0x0;_0x238eda<_0x46083a[_0xb83e('0xe')];_0x238eda++){io[_0xb83e('0x16')](_0xb83e('0x17'),{'id':_0x46083a[_0x238eda],'closed':!![]});}}})['catch'](function(_0x1a941b){logger['error'](_0xb83e('0x18'),_0x1a941b?util[_0xb83e('0x19')](_0x1a941b,{'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 c408e38..e386b75 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x875c=['contacts1','CmHopper','bulkCreate','hopper1','contacts2','hopper2','catch','util','Innocenzo','innocenzo.biondo','@xcally.com','push','now','Biondo','CmContact','destroy','then','log','finished\x20populating'];(function(_0x1d47ab,_0x22343e){var _0x5ab5cc=function(_0x12b13f){while(--_0x12b13f){_0x1d47ab['push'](_0x1d47ab['shift']());}};_0x5ab5cc(++_0x22343e);}(_0x875c,0xd8));var _0xc875=function(_0x35eae1,_0x10be75){_0x35eae1=_0x35eae1-0x0;var _0x225e5c=_0x875c[_0x35eae1];return _0x225e5c;};'use strict';var util=require(_0xc875('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xc875('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xc875('0x2')+i+_0xc875('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xc875('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc875('0x5')](),'updatedAt':Date[_0xc875('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xc875('0x6')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xc875('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc875('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xc875('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc875('0x5')](),'updatedAt':Date[_0xc875('0x5')]()});}db[_0xc875('0x7')][_0xc875('0x8')]({'where':{}})[_0xc875('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0xc875('0x9')](function(){console[_0xc875('0xa')](_0xc875('0xb'),_0xc875('0xc'));return db[_0xc875('0xd')][_0xc875('0x8')]({'where':{}});})[_0xc875('0x9')](function(){return db[_0xc875('0xd')][_0xc875('0xe')](hopper);})[_0xc875('0x9')](function(){console[_0xc875('0xa')](_0xc875('0xb'),_0xc875('0xf'));return db['CmContact']['bulkCreate'](contacts2);})['then'](function(){console['log']('finished\x20populating',_0xc875('0x10'));return db[_0xc875('0xd')][_0xc875('0xe')](hopper2);})[_0xc875('0x9')](function(){console[_0xc875('0xa')](_0xc875('0xb'),_0xc875('0x11'));})[_0xc875('0x12')](function(_0x164fa4){console[_0xc875('0xa')](_0x164fa4);}); \ No newline at end of file +var _0x6759=['contacts1','CmHopper','hopper1','log','finished\x20populating','contacts2','catch','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x6759,0x128));var _0x9675=function(_0x21afde,_0x4454ce){_0x21afde=_0x21afde-0x0;var _0x33cde=_0x6759[_0x21afde];return _0x33cde;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9675('0x0')]({'id':i,'firstName':_0x9675('0x1')+i,'lastName':_0x9675('0x2')+i,'phone':0xf879fb460+i,'email':_0x9675('0x3')+i+_0x9675('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x9675('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9675('0x0')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9675('0x2')+i,'phone':0xf879fb460+i,'email':_0x9675('0x3')+i+_0x9675('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9675('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x9675('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9675('0x5')](),'updatedAt':Date[_0x9675('0x5')]()});}db[_0x9675('0x6')][_0x9675('0x7')]({'where':{}})[_0x9675('0x8')](function(){return db[_0x9675('0x6')][_0x9675('0x9')](contacts);})[_0x9675('0x8')](function(){console['log']('finished\x20populating',_0x9675('0xa'));return db[_0x9675('0xb')][_0x9675('0x7')]({'where':{}});})[_0x9675('0x8')](function(){return db[_0x9675('0xb')][_0x9675('0x9')](hopper);})[_0x9675('0x8')](function(){console['log']('finished\x20populating',_0x9675('0xc'));return db['CmContact'][_0x9675('0x9')](contacts2);})[_0x9675('0x8')](function(){console[_0x9675('0xd')](_0x9675('0xe'),_0x9675('0xf'));return db['CmHopper'][_0x9675('0x9')](hopper2);})[_0x9675('0x8')](function(){console[_0x9675('0xd')](_0x9675('0xe'),'hopper2');})[_0x9675('0x10')](function(_0x503ef8){console['log'](_0x503ef8);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 8d8f612..9627e8c 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x377f=['util','push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0x377f,0x143));var _0xf377=function(_0x535246,_0xb9ab72){_0x535246=_0x535246-0x0;var _0x43d339=_0x377f[_0x535246];return _0x43d339;};'use strict';var util=require(_0xf377('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf377('0x1')]({'name':util[_0xf377('0x2')](_0xf377('0x3'),'agent',i),'fullname':util['format'](_0xf377('0x3'),_0xf377('0x4'),i),'email':util[_0xf377('0x2')](_0xf377('0x5'),'agent',i),'role':_0xf377('0x4'),'password':_0xf377('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xf377('0x7'),'ws',_0xf377('0x8')],'disallow':[_0xf377('0x9')],'allow':['ulaw'],'defaultuser':util['format']('%s%s',_0xf377('0x4'),i),'encryption':_0xf377('0xa'),'avpf':_0xf377('0xa'),'force_avp':'yes','icesupport':_0xf377('0xa'),'dtlsenable':_0xf377('0xa'),'dtlsverify':'no','dtlscertfile':_0xf377('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf377('0xc'),'callerid':util['format'](_0xf377('0xd'),util[_0xf377('0x2')](_0xf377('0x3'),_0xf377('0x4'),i),0xfa0+i)});}db[_0xf377('0xe')]['bulkCreate'](users)[_0xf377('0xf')](function(){console[_0xf377('0x10')](_0xf377('0x11'));})[_0xf377('0x12')](function(_0x53f253){console[_0xf377('0x10')](_0x53f253);}); \ No newline at end of file +var _0x943d=['User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','agent','%s%s','%s%s@xcally.com','password','friend','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>'];(function(_0x29860d,_0x485a1f){var _0x31820a=function(_0x38a94){while(--_0x38a94){_0x29860d['push'](_0x29860d['shift']());}};_0x31820a(++_0x485a1f);}(_0x943d,0x1d4));var _0xd943=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x943d[_0x4409e7];return _0x24c751;};'use strict';var util=require(_0xd943('0x0'));var db=require(_0xd943('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd943('0x2')]({'name':util[_0xd943('0x3')]('%s%s',_0xd943('0x4'),i),'fullname':util[_0xd943('0x3')](_0xd943('0x5'),_0xd943('0x4'),i),'email':util[_0xd943('0x3')](_0xd943('0x6'),'agent',i),'role':_0xd943('0x4'),'password':_0xd943('0x7'),'internal':0xfa0+i,'type':_0xd943('0x8'),'transport':['udp','ws',_0xd943('0x9')],'disallow':[_0xd943('0xa')],'allow':[_0xd943('0xb')],'defaultuser':util['format'](_0xd943('0x5'),'agent',i),'encryption':_0xd943('0xc'),'avpf':'yes','force_avp':_0xd943('0xc'),'icesupport':_0xd943('0xc'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xd943('0xd'),'dtlssetup':'actpass','callerid':util['format'](_0xd943('0xe'),util[_0xd943('0x3')](_0xd943('0x5'),_0xd943('0x4'),i),0xfa0+i)});}db[_0xd943('0xf')][_0xd943('0x10')](users)[_0xd943('0x11')](function(){console[_0xd943('0x12')](_0xd943('0x13'));})[_0xd943('0x14')](function(_0xffe08a){console[_0xd943('0x12')](_0xffe08a);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index b4b6bb0..2c9b4d8 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d3d=['format','%s:queue:%s','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Campaign','user','Trunks','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','then','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','findAll','IvrCampaigns','map','resourceId'];(function(_0x496ca4,_0x7cc3fa){var _0x5e1e22=function(_0x5f03a1){while(--_0x5f03a1){_0x496ca4['push'](_0x496ca4['shift']());}};_0x5e1e22(++_0x7cc3fa);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var BPromise=require(_0xd3d3('0x1'));var db=require('../mysqldb')['db'];var config=require(_0xd3d3('0x2'));var queryQueues={'attributes':['id',_0xd3d3('0x3')],'include':[{'as':_0xd3d3('0x4'),'model':db[_0xd3d3('0x5')],'attributes':['id',_0xd3d3('0x3'),_0xd3d3('0x6')],'raw':!![],'where':{'role':_0xd3d3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xd3d3('0x3')],'where':{'role':_0xd3d3('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xd3d3('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xd3d3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd3d3('0x3'),_0xd3d3('0x9')],'where':{'type':_0xd3d3('0xa')}};function getAssociatedResources(_0x578050,_0x368895,_0x412054){return db[_0xd3d3('0xb')][_0xd3d3('0xc')]({'where':{'name':_0x578050,'userProfileId':_0x368895},'raw':!![]})['then'](function(_0x2c523f){if(_0x2c523f){if(_0x2c523f[_0xd3d3('0xd')]){switch(_0x578050){case _0xd3d3('0xe'):case _0xd3d3('0xf'):case _0xd3d3('0x10'):case _0xd3d3('0x11'):case'MailQueues':case _0xd3d3('0x12'):case'WhatsappQueues':return db[_0x412054]['findAll'](queryQueues);case'Telephones':return db[_0x412054][_0xd3d3('0x13')](queryTelephones);case'Trunks':return db[_0x412054]['findAll'](queryTrunks);case _0xd3d3('0x14'):return db[_0x412054][_0xd3d3('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0xd3d3('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x2c523f['id']},'raw':!![]})['then'](function(_0x364bb3){if(_0x364bb3){var _0x531cb3={'where':{'id':_[_0xd3d3('0x15')](_0x364bb3,_0xd3d3('0x16'))},'raw':!![]};switch(_0x412054){case _0xd3d3('0x5'):_0x531cb3['where'][_0xd3d3('0x6')]=_0xd3d3('0x8');break;case'Campaign':_0x531cb3['where'][_0xd3d3('0x9')]=_0xd3d3('0xa');break;}return db[_0x412054][_0xd3d3('0x13')](_0x531cb3);}else{return[];}});}}else{return[];}})['then'](function(_0x2ff74e){return _0x2ff74e;});}function joinOrLeaveQueues(_0x37fc96,_0x32d518,_0x5273ca,_0x53d62c){_0x37fc96[_0x32d518](util[_0xd3d3('0x17')](_0xd3d3('0x18'),_0x5273ca,_0x53d62c['name']));if(_0x53d62c[_0xd3d3('0x4')]){for(var _0x53ac55=0x0;_0x53ac55<_0x53d62c['Agents'][_0xd3d3('0x19')];_0x53ac55+=0x1){_0x37fc96[_0x32d518](util[_0xd3d3('0x17')](_0xd3d3('0x1a'),_0x53d62c[_0xd3d3('0x4')][_0x53ac55]['name']));}}}function joinOrLeave(_0x258207,_0x65b986,_0x133e41){var _0x358ecc;if(_0x258207[_0xd3d3('0x1b')][_0xd3d3('0x1c')]['id']){db[_0xd3d3('0x5')][_0xd3d3('0x1d')]({'attributes':['id',_0xd3d3('0x3'),_0xd3d3('0x6'),_0xd3d3('0x1e')],'where':{'id':_0x258207[_0xd3d3('0x1b')]['query']['id']},'include':[{'model':db[_0xd3d3('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xd3d3('0x20')],'as':_0xd3d3('0x21'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xd3d3('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xd3d3('0x23')],'as':_0xd3d3('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0xd3d3('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xd3d3('0x26')],'as':_0xd3d3('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x47688a){if(_0x47688a){_0x358ecc=_0x47688a;_0x258207[_0x65b986](util[_0xd3d3('0x17')](_0xd3d3('0x1a'),_0x47688a[_0xd3d3('0x3')]));var _0xd5ad91=[];switch(_0x47688a[_0xd3d3('0x6')]){case _0xd3d3('0x28'):_0x258207[_0x65b986](_0xd3d3('0x29'));_0x258207[_0x65b986](_0xd3d3('0x2a'));if(queryQueues[_0xd3d3('0x2b')](_0xd3d3('0x2c'))){delete queryQueues[_0xd3d3('0x2c')];}_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x2e')]['findAll'](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x2f')][_0xd3d3('0x13')](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x30')][_0xd3d3('0x13')](queryQueues));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x31')][_0xd3d3('0x13')](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x32')]['findAll'](queryQueues));_0xd5ad91['push'](db[_0xd3d3('0x33')]['findAll'](queryQueues));_0xd5ad91[_0xd3d3('0x2d')](db['WhatsappQueue'][_0xd3d3('0x13')](queryQueues));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x5')][_0xd3d3('0x13')](queryTelephones));_0xd5ad91[_0xd3d3('0x2d')](db['Trunk'][_0xd3d3('0x13')](queryTrunks));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x34')][_0xd3d3('0x13')](queryCampaigns));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x5')][_0xd3d3('0x13')](queryAgents));break;case _0xd3d3('0x35'):_0x258207[_0x65b986](_0xd3d3('0x29'));_0x258207[_0x65b986]('voice:outbound');_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0xe'),_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x2e')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources('ChatQueues',_0x47688a['userProfileId'],_0xd3d3('0x2f')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources('FaxQueues',_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x30')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0x11'),_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x31')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources('MailQueues',_0x47688a[_0xd3d3('0x1e')],_0xd3d3('0x32')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0x12'),_0x47688a[_0xd3d3('0x1e')],'OpenchannelQueue'));_0xd5ad91['push'](getAssociatedResources('WhatsappQueues',_0x47688a['userProfileId'],'WhatsappQueue'));_0xd5ad91['push'](getAssociatedResources('Telephones',_0x47688a['userProfileId'],_0xd3d3('0x5')));_0xd5ad91[_0xd3d3('0x2d')](getAssociatedResources(_0xd3d3('0x36'),_0x47688a[_0xd3d3('0x1e')],'Trunk'));_0xd5ad91['push'](getAssociatedResources('IvrCampaigns',_0x47688a[_0xd3d3('0x1e')],'Campaign'));_0xd5ad91[_0xd3d3('0x2d')](db[_0xd3d3('0x5')][_0xd3d3('0x13')](queryAgents));break;case _0xd3d3('0x7'):_0x258207[_0x65b986](_0xd3d3('0x29'));_0x258207[_0x65b986]('voice:outbound');_0xd5ad91[_0xd3d3('0x2d')](_0x47688a['getVoiceQueues']({'attributes':['id',_0xd3d3('0x3')]}));_0xd5ad91['push'](_0x47688a[_0xd3d3('0x37')]({'attributes':['id','name']}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x38')]({'attributes':['id','name']}));_0xd5ad91['push'](_0x47688a[_0xd3d3('0x39')]({'attributes':['id','name']}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x3a')]({'attributes':['id',_0xd3d3('0x3')]}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x3b')]({'attributes':['id','name']}));_0xd5ad91[_0xd3d3('0x2d')](_0x47688a[_0xd3d3('0x3c')]({'attributes':['id','name']}));break;}return BPromise['all'](_0xd5ad91);}})[_0xd3d3('0x3d')](function(_0xe5f0b2){if(_0xe5f0b2&&_0xe5f0b2[_0xd3d3('0x19')]){for(var _0xf78070=0x0;_0xf78070<_0xe5f0b2[_0xd3d3('0x19')];_0xf78070+=0x1){for(var _0x3938e3=0x0;_0x3938e3<_0xe5f0b2[_0xf78070]['length'];_0x3938e3+=0x1){switch(_0xf78070){case 0x0:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x3e'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x1:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x3f'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x2:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x40'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x3:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x41'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x4:joinOrLeaveQueues(_0x258207,_0x65b986,'mail',_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x5:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x42'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x6:joinOrLeaveQueues(_0x258207,_0x65b986,_0xd3d3('0x43'),_0xe5f0b2[_0xf78070][_0x3938e3]);break;case 0x7:if(_0x358ecc[_0xd3d3('0x6')]!==_0xd3d3('0x7'))_0x258207[_0x65b986](util[_0xd3d3('0x17')](_0xd3d3('0x44'),_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;case 0x8:if(_0x358ecc[_0xd3d3('0x6')]!==_0xd3d3('0x7'))_0x258207[_0x65b986](util[_0xd3d3('0x17')](_0xd3d3('0x45'),_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;case 0x9:if(_0x358ecc['role']!==_0xd3d3('0x7'))_0x258207[_0x65b986](util['format'](_0xd3d3('0x46'),_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x9')],_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;case 0xa:_0x258207[_0x65b986](util[_0xd3d3('0x17')]('user:%s',_0xe5f0b2[_0xf78070][_0x3938e3][_0xd3d3('0x3')]));break;}}}}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x3ba97c=_[_0xd3d3('0x15')](_0x358ecc[_0xd3d3('0x48')],'id');return _0x358ecc['removeChatInteractions'](_0x3ba97c)[_0xd3d3('0x3d')](function(){for(var _0x2f1033=0x0;_0x2f1033<_0x3ba97c[_0xd3d3('0x19')];_0x2f1033+=0x1){_0x133e41[_0xd3d3('0x49')](_0xd3d3('0x4a'),{'ChatInteractionId':Number(_0x3ba97c[_0x2f1033]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x182751=_[_0xd3d3('0x15')](_0x358ecc['MailInteractions'],'id');return _0x358ecc['removeMailInteractions'](_0x182751)['then'](function(){for(var _0x252023=0x0;_0x252023<_0x182751[_0xd3d3('0x19')];_0x252023+=0x1){_0x133e41[_0xd3d3('0x49')](_0xd3d3('0x4b'),{'MailInteractionId':Number(_0x182751[_0x252023]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986==='leave'){var _0x1c5977=_[_0xd3d3('0x15')](_0x358ecc[_0xd3d3('0x22')],'id');return _0x358ecc['removeFaxInteractions'](_0x1c5977)[_0xd3d3('0x3d')](function(){for(var _0x48e0d5=0x0;_0x48e0d5<_0x1c5977[_0xd3d3('0x19')];_0x48e0d5+=0x1){_0x133e41['emit'](_0xd3d3('0x4c'),{'FaxInteractionId':Number(_0x1c5977[_0x48e0d5]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x367d5e=_[_0xd3d3('0x15')](_0x358ecc['SmsInteractions'],'id');return _0x358ecc[_0xd3d3('0x4d')](_0x367d5e)['then'](function(){for(var _0x2c3a37=0x0;_0x2c3a37<_0x367d5e[_0xd3d3('0x19')];_0x2c3a37+=0x1){_0x133e41['emit'](_0xd3d3('0x4e'),{'SmsInteractionId':Number(_0x367d5e[_0x2c3a37]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0xfb1ca7=_['map'](_0x358ecc[_0xd3d3('0x25')],'id');return _0x358ecc[_0xd3d3('0x4f')](_0xfb1ca7)[_0xd3d3('0x3d')](function(){for(var _0x4e9941=0x0;_0x4e9941<_0xfb1ca7[_0xd3d3('0x19')];_0x4e9941+=0x1){_0x133e41[_0xd3d3('0x49')](_0xd3d3('0x50'),{'OpenchannelInteractionId':Number(_0xfb1ca7[_0x4e9941]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x3d')](function(){if(_0x65b986===_0xd3d3('0x47')){var _0x24d4e4=_[_0xd3d3('0x15')](_0x358ecc['WhatsappInteractions'],'id');return _0x358ecc['removeWhatsappInteractions'](_0x24d4e4)[_0xd3d3('0x3d')](function(){for(var _0x2a67ca=0x0;_0x2a67ca<_0x24d4e4[_0xd3d3('0x19')];_0x2a67ca+=0x1){_0x133e41['emit'](_0xd3d3('0x51'),{'WhatsappInteractionId':Number(_0x24d4e4[_0x2a67ca]),'UserId':Number(_0x358ecc['id'])});}});}})[_0xd3d3('0x52')](function(_0x185857){_0x258207['log'](_0x185857);});}}function onDisconnect(_0x31e000,_0x4b5d13){joinOrLeave(_0x31e000,_0xd3d3('0x47'),_0x4b5d13);}function onConnect(_0x57d754){joinOrLeave(_0x57d754,'join');}exports[_0xd3d3('0x53')]=function(_0x3b07be){_0x3b07be['on'](_0xd3d3('0x54'),function(_0x2d7e9b){_0x2d7e9b[_0xd3d3('0x55')](0x0);_0x2d7e9b[_0xd3d3('0x56')]=_0x2d7e9b[_0xd3d3('0x57')][_0xd3d3('0x54')][_0xd3d3('0x58')]+':'+_0x2d7e9b[_0xd3d3('0x57')][_0xd3d3('0x54')][_0xd3d3('0x59')];_0x2d7e9b[_0xd3d3('0x5a')]=new Date();_0x2d7e9b[_0xd3d3('0x5b')]=function(_0x12c2c4){console[_0xd3d3('0x5b')](_0xd3d3('0x5c')+_0x2d7e9b[_0xd3d3('0x5d')][_0xd3d3('0x3')]+'['+_0x2d7e9b[_0xd3d3('0x56')]+']',_0x12c2c4);};_0x2d7e9b['on'](_0xd3d3('0x5e'),function(){onDisconnect(_0x2d7e9b,_0x3b07be);_0x2d7e9b[_0xd3d3('0x5b')](_0xd3d3('0x5f'));});onConnect(_0x2d7e9b);_0x2d7e9b[_0xd3d3('0x5b')](_0xd3d3('0x60'));});}; \ No newline at end of file +var _0xd509=['User','name','agent','telephone','type','ivr','UserProfileSection','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','Trunks','findAll','IvrCampaigns','UserProfileResource','resourceId','then','map','where','role','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','userProfileId','VoiceQueue','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','mail','openchannel','whatsapp','telephone:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','bluebird','../mysqldb','./environment'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x9d50('0x0'));var db=require(_0x9d50('0x1'))['db'];var config=require(_0x9d50('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x9d50('0x3')],'attributes':['id',_0x9d50('0x4'),'role'],'raw':!![],'where':{'role':_0x9d50('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9d50('0x4')],'where':{'role':_0x9d50('0x6')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x9d50('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9d50('0x4'),_0x9d50('0x7')],'where':{'type':_0x9d50('0x8')}};function getAssociatedResources(_0x1102b6,_0x365064,_0x5380be){return db[_0x9d50('0x9')]['findOne']({'where':{'name':_0x1102b6,'userProfileId':_0x365064},'raw':!![]})['then'](function(_0x2de74f){if(_0x2de74f){if(_0x2de74f['autoAssociation']){switch(_0x1102b6){case _0x9d50('0xa'):case _0x9d50('0xb'):case _0x9d50('0xc'):case _0x9d50('0xd'):case _0x9d50('0xe'):case _0x9d50('0xf'):case _0x9d50('0x10'):return db[_0x5380be]['findAll'](queryQueues);case _0x9d50('0x11'):return db[_0x5380be]['findAll'](queryTelephones);case _0x9d50('0x12'):return db[_0x5380be][_0x9d50('0x13')](queryTrunks);case _0x9d50('0x14'):return db[_0x5380be][_0x9d50('0x13')](queryCampaigns);}}else{return db[_0x9d50('0x15')][_0x9d50('0x13')]({'attributes':[_0x9d50('0x16')],'where':{'sectionId':_0x2de74f['id']},'raw':!![]})[_0x9d50('0x17')](function(_0x25f253){if(_0x25f253){var _0x304b42={'where':{'id':_[_0x9d50('0x18')](_0x25f253,_0x9d50('0x16'))},'raw':!![]};switch(_0x5380be){case'User':_0x304b42[_0x9d50('0x19')][_0x9d50('0x1a')]=_0x9d50('0x6');break;case _0x9d50('0x1b'):_0x304b42[_0x9d50('0x19')][_0x9d50('0x7')]=_0x9d50('0x8');break;}return db[_0x5380be][_0x9d50('0x13')](_0x304b42);}else{return[];}});}}else{return[];}})[_0x9d50('0x17')](function(_0x2d5619){return _0x2d5619;});}function joinOrLeaveQueues(_0x2965a3,_0x161b40,_0x24415e,_0x7582d1){_0x2965a3[_0x161b40](util[_0x9d50('0x1c')](_0x9d50('0x1d'),_0x24415e,_0x7582d1[_0x9d50('0x4')]));if(_0x7582d1[_0x9d50('0x1e')]){for(var _0x40026b=0x0;_0x40026b<_0x7582d1[_0x9d50('0x1e')][_0x9d50('0x1f')];_0x40026b+=0x1){_0x2965a3[_0x161b40](util[_0x9d50('0x1c')](_0x9d50('0x20'),_0x7582d1['Agents'][_0x40026b][_0x9d50('0x4')]));}}}function joinOrLeave(_0xcb4fc8,_0x2a50f7,_0x1adf7d){var _0x12ae02;if(_0xcb4fc8[_0x9d50('0x21')][_0x9d50('0x22')]['id']){db[_0x9d50('0x3')][_0x9d50('0x23')]({'attributes':['id','name',_0x9d50('0x1a'),'userProfileId'],'where':{'id':_0xcb4fc8['handshake'][_0x9d50('0x22')]['id']},'include':[{'model':db[_0x9d50('0x24')],'as':_0x9d50('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x9d50('0x26')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9d50('0x27')],'as':_0x9d50('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x9d50('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x9d50('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x9d50('0x2b')],'as':_0x9d50('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3bd762){if(_0x3bd762){_0x12ae02=_0x3bd762;_0xcb4fc8[_0x2a50f7](util['format'](_0x9d50('0x20'),_0x3bd762[_0x9d50('0x4')]));var _0x1bb403=[];switch(_0x3bd762[_0x9d50('0x1a')]){case _0x9d50('0x2d'):_0xcb4fc8[_0x2a50f7](_0x9d50('0x2e'));_0xcb4fc8[_0x2a50f7](_0x9d50('0x2f'));if(queryQueues[_0x9d50('0x30')](_0x9d50('0x31'))){delete queryQueues['include'];}_0x1bb403[_0x9d50('0x32')](db['VoiceQueue']['findAll'](queryQueues));_0x1bb403[_0x9d50('0x32')](db[_0x9d50('0x33')][_0x9d50('0x13')](queryQueues));_0x1bb403['push'](db[_0x9d50('0x34')][_0x9d50('0x13')](queryQueues));_0x1bb403[_0x9d50('0x32')](db[_0x9d50('0x35')][_0x9d50('0x13')](queryQueues));_0x1bb403[_0x9d50('0x32')](db[_0x9d50('0x36')][_0x9d50('0x13')](queryQueues));_0x1bb403[_0x9d50('0x32')](db[_0x9d50('0x37')][_0x9d50('0x13')](queryQueues));_0x1bb403[_0x9d50('0x32')](db[_0x9d50('0x38')][_0x9d50('0x13')](queryQueues));_0x1bb403[_0x9d50('0x32')](db['User'][_0x9d50('0x13')](queryTelephones));_0x1bb403['push'](db[_0x9d50('0x39')]['findAll'](queryTrunks));_0x1bb403[_0x9d50('0x32')](db[_0x9d50('0x1b')][_0x9d50('0x13')](queryCampaigns));_0x1bb403[_0x9d50('0x32')](db[_0x9d50('0x3')]['findAll'](queryAgents));break;case _0x9d50('0x3a'):_0xcb4fc8[_0x2a50f7](_0x9d50('0x2e'));_0xcb4fc8[_0x2a50f7](_0x9d50('0x2f'));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0xa'),_0x3bd762[_0x9d50('0x3b')],_0x9d50('0x3c')));_0x1bb403[_0x9d50('0x32')](getAssociatedResources('ChatQueues',_0x3bd762[_0x9d50('0x3b')],'ChatQueue'));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0xc'),_0x3bd762[_0x9d50('0x3b')],_0x9d50('0x34')));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0xd'),_0x3bd762['userProfileId'],'SmsQueue'));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0xe'),_0x3bd762[_0x9d50('0x3b')],_0x9d50('0x36')));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0xf'),_0x3bd762[_0x9d50('0x3b')],_0x9d50('0x37')));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0x10'),_0x3bd762[_0x9d50('0x3b')],'WhatsappQueue'));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0x11'),_0x3bd762['userProfileId'],_0x9d50('0x3')));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0x12'),_0x3bd762[_0x9d50('0x3b')],_0x9d50('0x39')));_0x1bb403[_0x9d50('0x32')](getAssociatedResources(_0x9d50('0x14'),_0x3bd762['userProfileId'],'Campaign'));_0x1bb403['push'](db[_0x9d50('0x3')][_0x9d50('0x13')](queryAgents));break;case _0x9d50('0x5'):_0xcb4fc8[_0x2a50f7](_0x9d50('0x2e'));_0xcb4fc8[_0x2a50f7](_0x9d50('0x2f'));_0x1bb403['push'](_0x3bd762['getVoiceQueues']({'attributes':['id',_0x9d50('0x4')]}));_0x1bb403[_0x9d50('0x32')](_0x3bd762[_0x9d50('0x3d')]({'attributes':['id',_0x9d50('0x4')]}));_0x1bb403[_0x9d50('0x32')](_0x3bd762[_0x9d50('0x3e')]({'attributes':['id',_0x9d50('0x4')]}));_0x1bb403[_0x9d50('0x32')](_0x3bd762[_0x9d50('0x3f')]({'attributes':['id',_0x9d50('0x4')]}));_0x1bb403['push'](_0x3bd762[_0x9d50('0x40')]({'attributes':['id',_0x9d50('0x4')]}));_0x1bb403[_0x9d50('0x32')](_0x3bd762[_0x9d50('0x41')]({'attributes':['id',_0x9d50('0x4')]}));_0x1bb403['push'](_0x3bd762['getWhatsappQueues']({'attributes':['id',_0x9d50('0x4')]}));break;}return BPromise[_0x9d50('0x42')](_0x1bb403);}})[_0x9d50('0x17')](function(_0x32b6bd){if(_0x32b6bd&&_0x32b6bd[_0x9d50('0x1f')]){for(var _0x58cd38=0x0;_0x58cd38<_0x32b6bd[_0x9d50('0x1f')];_0x58cd38+=0x1){for(var _0x578819=0x0;_0x578819<_0x32b6bd[_0x58cd38]['length'];_0x578819+=0x1){switch(_0x58cd38){case 0x0:joinOrLeaveQueues(_0xcb4fc8,_0x2a50f7,_0x9d50('0x43'),_0x32b6bd[_0x58cd38][_0x578819]);break;case 0x1:joinOrLeaveQueues(_0xcb4fc8,_0x2a50f7,_0x9d50('0x44'),_0x32b6bd[_0x58cd38][_0x578819]);break;case 0x2:joinOrLeaveQueues(_0xcb4fc8,_0x2a50f7,'fax',_0x32b6bd[_0x58cd38][_0x578819]);break;case 0x3:joinOrLeaveQueues(_0xcb4fc8,_0x2a50f7,'sms',_0x32b6bd[_0x58cd38][_0x578819]);break;case 0x4:joinOrLeaveQueues(_0xcb4fc8,_0x2a50f7,_0x9d50('0x45'),_0x32b6bd[_0x58cd38][_0x578819]);break;case 0x5:joinOrLeaveQueues(_0xcb4fc8,_0x2a50f7,_0x9d50('0x46'),_0x32b6bd[_0x58cd38][_0x578819]);break;case 0x6:joinOrLeaveQueues(_0xcb4fc8,_0x2a50f7,_0x9d50('0x47'),_0x32b6bd[_0x58cd38][_0x578819]);break;case 0x7:if(_0x12ae02[_0x9d50('0x1a')]!=='agent')_0xcb4fc8[_0x2a50f7](util['format'](_0x9d50('0x48'),_0x32b6bd[_0x58cd38][_0x578819]['name']));break;case 0x8:if(_0x12ae02['role']!==_0x9d50('0x5'))_0xcb4fc8[_0x2a50f7](util[_0x9d50('0x1c')]('trunk:%s',_0x32b6bd[_0x58cd38][_0x578819]['name']));break;case 0x9:if(_0x12ae02[_0x9d50('0x1a')]!==_0x9d50('0x5'))_0xcb4fc8[_0x2a50f7](util[_0x9d50('0x1c')]('campaign:%s:%s',_0x32b6bd[_0x58cd38][_0x578819][_0x9d50('0x7')],_0x32b6bd[_0x58cd38][_0x578819][_0x9d50('0x4')]));break;case 0xa:_0xcb4fc8[_0x2a50f7](util['format'](_0x9d50('0x20'),_0x32b6bd[_0x58cd38][_0x578819]['name']));break;}}}}})[_0x9d50('0x17')](function(){if(_0x2a50f7==='leave'){var _0xdf25b1=_['map'](_0x12ae02[_0x9d50('0x25')],'id');return _0x12ae02[_0x9d50('0x49')](_0xdf25b1)[_0x9d50('0x17')](function(){for(var _0x1f2d0a=0x0;_0x1f2d0a<_0xdf25b1['length'];_0x1f2d0a+=0x1){_0x1adf7d[_0x9d50('0x4a')](_0x9d50('0x4b'),{'ChatInteractionId':Number(_0xdf25b1[_0x1f2d0a]),'UserId':Number(_0x12ae02['id'])});}});}})[_0x9d50('0x17')](function(){if(_0x2a50f7===_0x9d50('0x4c')){var _0x40f5ea=_[_0x9d50('0x18')](_0x12ae02[_0x9d50('0x4d')],'id');return _0x12ae02[_0x9d50('0x4e')](_0x40f5ea)[_0x9d50('0x17')](function(){for(var _0x482cc0=0x0;_0x482cc0<_0x40f5ea['length'];_0x482cc0+=0x1){_0x1adf7d[_0x9d50('0x4a')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x40f5ea[_0x482cc0]),'UserId':Number(_0x12ae02['id'])});}});}})[_0x9d50('0x17')](function(){if(_0x2a50f7===_0x9d50('0x4c')){var _0x4d469d=_['map'](_0x12ae02['FaxInteractions'],'id');return _0x12ae02[_0x9d50('0x4f')](_0x4d469d)[_0x9d50('0x17')](function(){for(var _0xdaac34=0x0;_0xdaac34<_0x4d469d[_0x9d50('0x1f')];_0xdaac34+=0x1){_0x1adf7d[_0x9d50('0x4a')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x4d469d[_0xdaac34]),'UserId':Number(_0x12ae02['id'])});}});}})[_0x9d50('0x17')](function(){if(_0x2a50f7==='leave'){var _0x331bc8=_[_0x9d50('0x18')](_0x12ae02[_0x9d50('0x29')],'id');return _0x12ae02[_0x9d50('0x50')](_0x331bc8)[_0x9d50('0x17')](function(){for(var _0x44f45d=0x0;_0x44f45d<_0x331bc8['length'];_0x44f45d+=0x1){_0x1adf7d[_0x9d50('0x4a')](_0x9d50('0x51'),{'SmsInteractionId':Number(_0x331bc8[_0x44f45d]),'UserId':Number(_0x12ae02['id'])});}});}})[_0x9d50('0x17')](function(){if(_0x2a50f7===_0x9d50('0x4c')){var _0x20289f=_[_0x9d50('0x18')](_0x12ae02[_0x9d50('0x2a')],'id');return _0x12ae02[_0x9d50('0x52')](_0x20289f)['then'](function(){for(var _0x2630ec=0x0;_0x2630ec<_0x20289f['length'];_0x2630ec+=0x1){_0x1adf7d['emit'](_0x9d50('0x53'),{'OpenchannelInteractionId':Number(_0x20289f[_0x2630ec]),'UserId':Number(_0x12ae02['id'])});}});}})['then'](function(){if(_0x2a50f7===_0x9d50('0x4c')){var _0x35f763=_['map'](_0x12ae02[_0x9d50('0x2c')],'id');return _0x12ae02[_0x9d50('0x54')](_0x35f763)['then'](function(){for(var _0x493396=0x0;_0x493396<_0x35f763[_0x9d50('0x1f')];_0x493396+=0x1){_0x1adf7d[_0x9d50('0x4a')](_0x9d50('0x55'),{'WhatsappInteractionId':Number(_0x35f763[_0x493396]),'UserId':Number(_0x12ae02['id'])});}});}})[_0x9d50('0x56')](function(_0xf13d1){_0xcb4fc8['log'](_0xf13d1);});}}function onDisconnect(_0x3f6ef6,_0x241713){joinOrLeave(_0x3f6ef6,'leave',_0x241713);}function onConnect(_0x445fb0){joinOrLeave(_0x445fb0,_0x9d50('0x57'));}exports[_0x9d50('0x58')]=function(_0x2b3273){_0x2b3273['on'](_0x9d50('0x59'),function(_0x67c3d4){_0x67c3d4[_0x9d50('0x5a')](0x0);_0x67c3d4[_0x9d50('0x5b')]=_0x67c3d4[_0x9d50('0x5c')][_0x9d50('0x59')][_0x9d50('0x5d')]+':'+_0x67c3d4['request']['connection'][_0x9d50('0x5e')];_0x67c3d4[_0x9d50('0x5f')]=new Date();_0x67c3d4[_0x9d50('0x60')]=function(_0x2c6d6d){console[_0x9d50('0x60')](_0x9d50('0x61')+_0x67c3d4[_0x9d50('0x62')][_0x9d50('0x4')]+'['+_0x67c3d4[_0x9d50('0x5b')]+']',_0x2c6d6d);};_0x67c3d4['on'](_0x9d50('0x63'),function(){onDisconnect(_0x67c3d4,_0x2b3273);_0x67c3d4['log'](_0x9d50('0x64'));});onConnect(_0x67c3d4);_0x67c3d4[_0x9d50('0x60')](_0x9d50('0x65'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index adbad1a..d85dfba 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 _0x9867=['Trigger,\x20%s','catch','get','motionChannel','event','direction','resolve','undefined','ContactId','sequelize','query','Sequelize','QueryTypes','UserId','format','SIP/%s','name','agent','channel','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','contact','interface','AfterCreate','changed','closed','substatus','SELECT','AfterUpdate','User','find','fullname','internal','length','hasOwnProperty','model','hook','toLowerCase','condition','util','../../mysqldb','../logger','triggers','client','http','Chat','afterCreate','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error'];(function(_0xb5a340,_0xcd07ce){var _0x2fb878=function(_0x472fb2){while(--_0x472fb2){_0xb5a340['push'](_0xb5a340['shift']());}};_0x2fb878(++_0xcd07ce);}(_0x9867,0x1a6));var _0x7986=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9867[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x7986('0x0'));var db=require(_0x7986('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x7986('0x2'))(_0x7986('0x3'));var client=jayson[_0x7986('0x4')][_0x7986('0x5')]({'port':0x232a});var triggers=[{'channel':_0x7986('0x6'),'model':'ChatInteraction','event':_0x7986('0x7'),'condition':_0x7986('0x8'),'callback':afterCreate},{'channel':_0x7986('0x6'),'model':_0x7986('0x9'),'event':_0x7986('0xa'),'condition':_0x7986('0xb'),'callback':afterUpdate},{'channel':_0x7986('0x6'),'model':_0x7986('0xc'),'event':_0x7986('0x7'),'condition':_0x7986('0xd'),'callback':afterCreateMessage},{'channel':_0x7986('0x6'),'model':_0x7986('0xe'),'event':_0x7986('0x7'),'condition':_0x7986('0xd'),'callback':afterCreateOfflineMessage},{'channel':_0x7986('0xf'),'model':_0x7986('0x10'),'event':'afterCreate','condition':_0x7986('0x8'),'callback':afterCreate},{'channel':_0x7986('0xf'),'model':_0x7986('0x10'),'event':'afterUpdate','condition':_0x7986('0xb'),'callback':afterUpdate},{'channel':_0x7986('0xf'),'model':_0x7986('0x11'),'event':_0x7986('0x7'),'condition':_0x7986('0xd'),'callback':afterCreateMessage},{'channel':_0x7986('0x12'),'model':_0x7986('0x13'),'event':_0x7986('0x7'),'condition':_0x7986('0x8'),'callback':afterCreate},{'channel':_0x7986('0x12'),'model':_0x7986('0x13'),'event':_0x7986('0xa'),'condition':_0x7986('0xb'),'callback':afterUpdate},{'channel':_0x7986('0x12'),'model':'WhatsappMessage','event':_0x7986('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7986('0x14'),'model':'FaxInteraction','event':_0x7986('0x7'),'condition':_0x7986('0x8'),'callback':afterCreate},{'channel':_0x7986('0x14'),'model':_0x7986('0x15'),'event':_0x7986('0xa'),'condition':_0x7986('0xb'),'callback':afterUpdate},{'channel':_0x7986('0x14'),'model':_0x7986('0x16'),'event':_0x7986('0x7'),'condition':_0x7986('0xd'),'callback':afterCreateMessage},{'channel':_0x7986('0x17'),'model':_0x7986('0x18'),'event':'afterCreate','condition':_0x7986('0x8'),'callback':afterCreate},{'channel':_0x7986('0x17'),'model':_0x7986('0x18'),'event':_0x7986('0xa'),'condition':_0x7986('0xb'),'callback':afterUpdate},{'channel':_0x7986('0x17'),'model':_0x7986('0x19'),'event':'afterCreate','condition':_0x7986('0xd'),'callback':afterCreateMessage},{'channel':_0x7986('0x1a'),'model':'OpenchannelInteraction','event':'afterCreate','condition':_0x7986('0x8'),'callback':afterCreate},{'channel':_0x7986('0x1a'),'model':_0x7986('0x1b'),'event':_0x7986('0xa'),'condition':_0x7986('0xb'),'callback':afterUpdate},{'channel':_0x7986('0x1a'),'model':_0x7986('0x1c'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x1871a7){return client[_0x7986('0x1d')](_0x7986('0x1e'),_0x1871a7)[_0x7986('0x1f')](function(_0x3c4565){logger[_0x7986('0x20')]('Trigger,\x20%s','EventManager',_0x3c4565);if(_0x3c4565[_0x7986('0x21')]){if(_0x3c4565[_0x7986('0x21')]['code']===0x1f4){logger[_0x7986('0x21')](_0x7986('0x22'),'EventManager',_0x3c4565[_0x7986('0x21')]);}}})[_0x7986('0x23')](function(_0x5b322d){logger[_0x7986('0x21')]('Trigger,\x20%s',_0x7986('0x1e'),_0x5b322d);});}function afterCreateMessage(_0x45b375){return function(_0x1e8578){_0x1e8578=_0x1e8578[_0x7986('0x24')]({'plain':!![]});_0x1e8578['channel']=_0x45b375;_0x1e8578[_0x7986('0x25')]=_0x45b375;_0x1e8578[_0x7986('0x26')]=_0x1e8578[_0x7986('0x27')];Promise[_0x7986('0x28')]()[_0x7986('0x1f')](function(){if(typeof _0x1e8578['ContactId']===_0x7986('0x29'))return null;var _0x34cd95='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1e8578[_0x7986('0x2a')];return db[_0x7986('0x2b')][_0x7986('0x2c')](_0x34cd95,{'type':db[_0x7986('0x2d')][_0x7986('0x2e')]['SELECT'],'raw':!![]});})[_0x7986('0x1f')](function(_0xdf9e97){if(_0xdf9e97){_0x1e8578['contact']=_0xdf9e97[0x0];}if(typeof _0x1e8578['UserId']===_0x7986('0x29'))return;return getAgent(_0x1e8578[_0x7986('0x2f')]);})[_0x7986('0x1f')](function(_0x599f58){if(_0x599f58){_0x1e8578['interface']=util[_0x7986('0x30')](_0x7986('0x31'),_0x599f58[_0x7986('0x32')]);_0x1e8578[_0x7986('0x33')]=_0x599f58;_0x1e8578[_0x7986('0x34')]=_0x45b375;return request({'event':_0x7986('0x35'),'message':_0x1e8578});}else{return request({'event':_0x7986('0x36'),'message':_0x1e8578});}})['catch'](function(_0x1ab91a){logger['error'](_0x7986('0x22'),_0x7986('0x37'),_0x1ab91a);});};}function afterCreateOfflineMessage(_0x51128a){return function(_0x29bd54){_0x29bd54=_0x29bd54[_0x7986('0x24')]({'plain':!![]});_0x29bd54[_0x7986('0x34')]=_0x51128a;_0x29bd54[_0x7986('0x25')]=_0x51128a;_0x29bd54[_0x7986('0x26')]=_0x7986('0x38');return request({'event':_0x29bd54[_0x7986('0x26')],'message':_0x29bd54});};}function afterCreate(_0x1cb194,_0x737e2){return function(_0x50e336){_0x50e336=_0x50e336[_0x7986('0x24')]({'plain':!![]});_0x50e336['channel']=_0x1cb194;_0x50e336[_0x7986('0x25')]=_0x1cb194;_0x50e336[_0x7986('0x26')]=_0x7986('0x39');Promise[_0x7986('0x28')]()[_0x7986('0x1f')](function(){var _0x5a110c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x50e336['ContactId'];return db['sequelize'][_0x7986('0x2c')](_0x5a110c,{'type':db[_0x7986('0x2d')][_0x7986('0x2e')]['SELECT'],'raw':!![]});})[_0x7986('0x1f')](function(_0xa2aba7){if(_0xa2aba7){_0x50e336[_0x7986('0x3a')]=_0xa2aba7[0x0];}if(typeof _0x50e336[_0x7986('0x2f')]===_0x7986('0x29'))return;return getAgent(_0x50e336['UserId']);})[_0x7986('0x1f')](function(_0x508d07){if(_0x508d07){_0x50e336[_0x7986('0x3b')]=util[_0x7986('0x30')](_0x7986('0x31'),_0x508d07[_0x7986('0x32')]);_0x50e336[_0x7986('0x33')]=_0x508d07;}return request({'event':_0x737e2,'message':_0x50e336});})[_0x7986('0x23')](function(_0x289b00){logger['error'](_0x7986('0x22'),_0x7986('0x3c'),_0x289b00);});};}function afterUpdate(_0x1f89d5){return function(_0x2c6860){var _0xadcbd6=_0x2c6860[_0x7986('0x3d')](_0x7986('0x3e'))&&_0x2c6860['closed'];var _0x55e0e0=_0x2c6860[_0x7986('0x3d')]('substatus');if(_0xadcbd6||_0x55e0e0){var _0xbe73bd=_0xadcbd6?_0x7986('0xb'):_0x7986('0x3f');var _0x2e8633=_0x2c6860[_0x7986('0x24')]({'plain':!![]});_0x2e8633['channel']=_0x1f89d5;_0x2e8633[_0x7986('0x25')]=_0x1f89d5;_0x2e8633[_0x7986('0x26')]=_0xadcbd6?_0x7986('0x3e'):_0x7986('0x3f');var _0x384795='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2e8633['ContactId'];return db['sequelize'][_0x7986('0x2c')](_0x384795,{'type':db['Sequelize'][_0x7986('0x2e')][_0x7986('0x40')],'raw':!![]})['then'](function(_0x222bce){if(_0x222bce){_0x2e8633[_0x7986('0x3a')]=_0x222bce[0x0];}if(typeof _0x2e8633[_0x7986('0x2f')]===_0x7986('0x29'))return;return getAgent(_0x2e8633['UserId']);})[_0x7986('0x1f')](function(_0x59efca){if(_0x59efca){_0x2e8633['interface']=util[_0x7986('0x30')](_0x7986('0x31'),_0x59efca['name']);_0x2e8633[_0x7986('0x33')]=_0x59efca;}return request({'event':_0xbe73bd,'message':_0x2e8633});})[_0x7986('0x23')](function(_0x13cc37){logger['error']('Trigger,\x20%s',_0x7986('0x41'),_0x13cc37);});}};}function getAgent(_0x40b2b9){return db[_0x7986('0x42')][_0x7986('0x43')]({'where':{'id':_0x40b2b9},'attributes':['id','name',_0x7986('0x44'),'email',_0x7986('0x45')],'raw':!![]})[_0x7986('0x1f')](function(_0x51520b){return _0x51520b;});}exports['default']=function(){for(var _0x2317ea=0x0;_0x2317ea=_0x2c4257['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x135fca(_0x2e032d);})[_0x5120('0x14')](function(_0x59d20d){_0x7fe809(_0x59d20d);});});}; \ No newline at end of file +var _0xc766=['getLicense','role','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','fax','whatsapp','openchannel','toLowerCase','includes','clearBlockUser','isUndefined','updateAttributes'];(function(_0x2eafef,_0xcc191a){var _0x424798=function(_0x2da6e1){while(--_0x2da6e1){_0x2eafef['push'](_0x2eafef['shift']());}};_0x424798(++_0xcc191a);}(_0xc766,0x152));var _0x6c76=function(_0x494b1e,_0x13e9b7){_0x494b1e=_0x494b1e-0x0;var _0x4ab0c6=_0xc766[_0x494b1e];return _0x4ab0c6;};'use strict';var _=require(_0x6c76('0x0'));var BPromise=require(_0x6c76('0x1'));var db=require(_0x6c76('0x2'))['db'];var util=require(_0x6c76('0x3'));var channels=[_0x6c76('0x4'),_0x6c76('0x5'),'chat',_0x6c76('0x6'),'sms',_0x6c76('0x7'),_0x6c76('0x8')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x5aa28a){_0x5aa28a=_0x5aa28a[_0x6c76('0x9')]();return _[_0x6c76('0xa')](channels,_0x5aa28a);};exports[_0x6c76('0xb')]=function(_0x55500e,_0x8e9c3f,_0x2d260a,_0x5784b0){var _0x17698c={'loginAttempts':_0x8e9c3f,'blocked':_0x2d260a};if(!_[_0x6c76('0xc')](_0x5784b0)){_0x17698c['blockedAt']=_0x5784b0;}return _0x55500e[_0x6c76('0xd')](_0x17698c);};exports[_0x6c76('0xe')]=function(_0x178326){return new BPromise(function(_0x199762,_0x3851f2){var _0x216e89=0x0;if(_0x178326[_0x6c76('0xf')]!=='agent'){_0x199762(_0x178326);}db['User'][_0x6c76('0x10')]({'where':{'role':_0x6c76('0x11'),'online':!![],'id':{'$ne':_0x178326['id']}}})['then'](function(_0x11ca06){_0x216e89=_0x11ca06;return util[_0x6c76('0xe')]();})[_0x6c76('0x12')](function(_0x2347b8){if(_0x2347b8&&_0x2347b8[_0x6c76('0x13')]&&_0x216e89>=_0x2347b8[_0x6c76('0x13')]){throw Error(_0x6c76('0x14'));}_0x199762(_0x178326);})[_0x6c76('0x15')](function(_0x571ce5){_0x3851f2(_0x571ce5);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index b952354..3c378bf 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc2e=['message','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Resource\x20Conflict','Conflict','Forbidden','error','statusMessage','status','send','exports','util','../config/logger','api'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xdc2e,0x17d));var _0xedc2=function(_0x25682f,_0x15397d){_0x25682f=_0x25682f-0x0;var _0x31d484=_0xdc2e[_0x25682f];return _0x31d484;};'use strict';var util=require(_0xedc2('0x0'));var logger=require(_0xedc2('0x1'))(_0xedc2('0x2'));var APIError=function(_0x25b570,_0x1e7472){this[_0xedc2('0x3')]=_0x25b570||_0xedc2('0x4');this[_0xedc2('0x5')]=_0x1e7472||_0xedc2('0x6');util[_0xedc2('0x7')](APIError,Error);};var APIBadRequestError=function(_0x5bbfb0){this[_0xedc2('0x3')]=_0x5bbfb0||_0xedc2('0x8');this[_0xedc2('0x5')]='Bad\x20Request';util[_0xedc2('0x7')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x1d7b4b){this['message']=_0x1d7b4b||'Forbidden';this[_0xedc2('0x5')]='Forbidden';util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x1bd620){this[_0xedc2('0x3')]=_0x1bd620||_0xedc2('0x9');this[_0xedc2('0x5')]=_0xedc2('0xa');util[_0xedc2('0x7')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x591127){this[_0xedc2('0x3')]=_0x591127||_0xedc2('0xb');this['name']=_0xedc2('0xc');this[_0xedc2('0xd')]=0x193;this[_0xedc2('0xe')]={'type':_0xedc2('0xf')};util[_0xedc2('0x7')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0xa64e1b){this[_0xedc2('0x3')]=_0xa64e1b||_0xedc2('0x10');this['name']=_0xedc2('0x11');util[_0xedc2('0x7')](APIBadRequestError,APIError);};function getStatusCode(_0x1b9cc1){switch(_0x1b9cc1){case _0xedc2('0x8'):return 0x190;case _0xedc2('0x12'),'Out\x20Of\x20Interval':return 0x193;case'Not\x20Found':return 0x194;case _0xedc2('0x11'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x2be93d){if(_0x2be93d===_0xedc2('0xc'))return _0x2be93d;return null;}function handleError(_0x36fb5e){return function(_0x5f391b){logger[_0xedc2('0x13')](_0x5f391b['stack']);var _0x12d931=getStatusCode(_0x5f391b[_0xedc2('0x5')]);var _0x5cd16e=getCustomStatusMessage(_0x5f391b[_0xedc2('0x5')]);if(_0x5f391b[_0xedc2('0x5')]){delete _0x5f391b[_0xedc2('0x5')];}if(_0x5cd16e){_0x36fb5e[_0xedc2('0x14')]=_0x5cd16e;}return _0x36fb5e[_0xedc2('0x15')](_0x12d931)[_0xedc2('0x16')](_0x5f391b);};}module[_0xedc2('0x17')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x7c71=['name','Error','inherits','Bad\x20Request','Forbidden','Not\x20Found','code','details','Resource\x20Conflict','Conflict','Out\x20Of\x20Interval','statusMessage','status','send','exports','util','message','Internal\x20Server\x20Error'];(function(_0x203028,_0x30f456){var _0x40f10d=function(_0x3af107){while(--_0x3af107){_0x203028['push'](_0x203028['shift']());}};_0x40f10d(++_0x30f456);}(_0x7c71,0xe7));var _0x17c7=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x7c71[_0x466e57];return _0x34df42;};'use strict';var util=require(_0x17c7('0x0'));var logger=require('../config/logger')('api');var APIError=function(_0x3c34c3,_0x131b65){this[_0x17c7('0x1')]=_0x3c34c3||_0x17c7('0x2');this[_0x17c7('0x3')]=_0x131b65||_0x17c7('0x4');util[_0x17c7('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5f0c52){this[_0x17c7('0x1')]=_0x5f0c52||_0x17c7('0x6');this['name']='Bad\x20Request';util[_0x17c7('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x1dbe7f){this[_0x17c7('0x1')]=_0x1dbe7f||'Forbidden';this[_0x17c7('0x3')]=_0x17c7('0x7');util['inherits'](APIForbiddenError,APIError);};var APINotFoundError=function(_0x362e9f){this[_0x17c7('0x1')]=_0x362e9f||'Entity\x20not\x20found';this['name']=_0x17c7('0x8');util[_0x17c7('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x3ac91a){this[_0x17c7('0x1')]=_0x3ac91a||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0x17c7('0x3')]='Out\x20Of\x20Interval';this[_0x17c7('0x9')]=0x193;this[_0x17c7('0xa')]={'type':'OutOfInterval'};util['inherits'](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x22bae8){this[_0x17c7('0x1')]=_0x22bae8||_0x17c7('0xb');this[_0x17c7('0x3')]=_0x17c7('0xc');util[_0x17c7('0x5')](APIBadRequestError,APIError);};function getStatusCode(_0x3e6504){switch(_0x3e6504){case _0x17c7('0x6'):return 0x190;case _0x17c7('0x7'),'Out\x20Of\x20Interval':return 0x193;case _0x17c7('0x8'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x189c55){if(_0x189c55===_0x17c7('0xd'))return _0x189c55;return null;}function handleError(_0x4f9451){return function(_0x5521c0){logger['error'](_0x5521c0['stack']);var _0x233548=getStatusCode(_0x5521c0['name']);var _0x5a04e1=getCustomStatusMessage(_0x5521c0[_0x17c7('0x3')]);if(_0x5521c0['name']){delete _0x5521c0[_0x17c7('0x3')];}if(_0x5a04e1){_0x4f9451[_0x17c7('0xe')]=_0x5a04e1;}return _0x4f9451[_0x17c7('0xf')](_0x233548)[_0x17c7('0x10')](_0x5521c0);};}module[_0x17c7('0x11')]={'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 fc05ef1..e7c22c1 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b50=['status','render','send','exports'];(function(_0x456c9d,_0x4c649a){var _0x20d174=function(_0x4372df){while(--_0x4372df){_0x456c9d['push'](_0x456c9d['shift']());}};_0x20d174(++_0x4c649a);}(_0x9b50,0x11b));var _0x09b5=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9b50[_0x5b644e];return _0x49c6bf;};'use strict';module[_0x09b5('0x0')][0x194]=function pageNotFound(_0x7ad0b9,_0x4dda50){var _0x26e4c9='404';var _0x3744c1=0x194;var _0x15caa4={'status':_0x3744c1};_0x4dda50[_0x09b5('0x1')](_0x15caa4[_0x09b5('0x1')]);_0x4dda50[_0x09b5('0x2')](_0x26e4c9,{},function(_0x2c028b,_0x2483f9){if(_0x2c028b){return _0x4dda50[_0x09b5('0x1')](_0x15caa4['status'])['json'](_0x15caa4);}_0x4dda50[_0x09b5('0x3')](_0x2483f9);});}; \ No newline at end of file +var _0xc526=['404','status','json','send'];(function(_0x3697f9,_0x570dcf){var _0x29f0df=function(_0xae1b9f){while(--_0xae1b9f){_0x3697f9['push'](_0x3697f9['shift']());}};_0x29f0df(++_0x570dcf);}(_0xc526,0x124));var _0x6c52=function(_0x12c29f,_0x234b62){_0x12c29f=_0x12c29f-0x0;var _0x1d1a80=_0xc526[_0x12c29f];return _0x1d1a80;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2a17c1,_0x5c333b){var _0x34f5aa=_0x6c52('0x0');var _0x3b4d94=0x194;var _0x54a05b={'status':_0x3b4d94};_0x5c333b[_0x6c52('0x1')](_0x54a05b['status']);_0x5c333b['render'](_0x34f5aa,{},function(_0x56f51f,_0x23a266){if(_0x56f51f){return _0x5c333b[_0x6c52('0x1')](_0x54a05b[_0x6c52('0x1')])[_0x6c52('0x2')](_0x54a05b);}_0x5c333b[_0x6c52('0x3')](_0x23a266);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index cac3941..160d186 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x38e7=['VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','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','Sound','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','userSetting','UserId','hasMany','Recordings','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','Hoppers','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueue','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','user_has_chat_websites','user_has_fax_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','Applications','Sounds','moh_has_sounds','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','Imap','Dispositions','Answers','Interactions','ListId','Template','TemplateId','user_has_mail_accounts','Agents','team_has_mail_queues','Teams','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','IntervalId','TagId','Items','FaxAccountId','List','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsApplication','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','ChatInternalMessage','ChatGroupId','Members','CompanyId','CmContactHasItem','CmContactId','HopperFinals','HopperHistories','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','ParentId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','SalesforceField','Subjects','SubjectId','DescriptionId','FieldId','AccountId','Description','VariableId','SugarcrmConfiguration','Descriptions','Subject','Field','DeskConfiguration','int_desk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','ServicenowConfiguration','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyProject','ProjectId','team_has_chat_queues','team_has_whatsapp_queues','TrunkBackupId','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToQueueId','user','Smtp','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','mysql','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model'];(function(_0x270c45,_0x2d8fa1){var _0x3cefdc=function(_0x543205){while(--_0x543205){_0x270c45['push'](_0x270c45['shift']());}};_0x3cefdc(++_0x2d8fa1);}(_0x38e7,0x1eb));var _0x738e=function(_0x189c9e,_0x1c3b55){_0x189c9e=_0x189c9e-0x0;var _0x3f38ca=_0x38e7[_0x189c9e];return _0x3f38ca;};'use strict';var config=require(_0x738e('0x0'));var Sequelize=require(_0x738e('0x1'));var _=require(_0x738e('0x2'));var jstz=require(_0x738e('0x3'));var timezone=jstz[_0x738e('0x4')]();config[_0x738e('0x1')]=_[_0x738e('0x5')](config[_0x738e('0x1')],{'database':_0x738e('0x6'),'username':_0x738e('0x7'),'password':_0x738e('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x738e('0x9')](),'define':{'charset':_0x738e('0xa'),'collate':_0x738e('0xb')}}});config[_0x738e('0xc')]=_[_0x738e('0x5')](config[_0x738e('0xc')],{'database':_0x738e('0x6'),'username':_0x738e('0x7'),'password':_0x738e('0x8'),'options':{'host':_0x738e('0xd'),'port':0xcea,'dialect':_0x738e('0xe'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x738e('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x738e('0x1')][_0x738e('0xf')],config['sequelize'][_0x738e('0x10')],config['sequelize'][_0x738e('0x11')],config[_0x738e('0x1')][_0x738e('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x738e('0xc')][_0x738e('0xf')],config[_0x738e('0xc')]['username'],config[_0x738e('0xc')][_0x738e('0x11')],config[_0x738e('0xc')][_0x738e('0x12')])};db[_0x738e('0x13')]=db[_0x738e('0x1')]['import'](_0x738e('0x14'));db[_0x738e('0x15')]=db['sequelize'][_0x738e('0x16')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x738e('0x17')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x18'));db[_0x738e('0x19')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/voiceExtension/voiceExtension.model');db[_0x738e('0x1a')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x1b'));db[_0x738e('0x1c')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x1d'));db[_0x738e('0x1e')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x1f'));db[_0x738e('0x20')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/screenRecording/screenRecording.model');db[_0x738e('0x21')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/voiceMail/voiceMail.model');db[_0x738e('0x22')]=db[_0x738e('0x1')]['import'](_0x738e('0x23'));db['VoiceCallReport']=db['sequelize'][_0x738e('0x16')](_0x738e('0x24'));db[_0x738e('0x25')]=db[_0x738e('0x1')]['import'](_0x738e('0x26'));db[_0x738e('0x27')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x28'));db[_0x738e('0x29')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x2a'));db[_0x738e('0x2b')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x2c'));db[_0x738e('0x2d')]=db[_0x738e('0x1')]['import'](_0x738e('0x2e'));db[_0x738e('0x2f')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x738e('0x30')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x31'));db[_0x738e('0x32')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/userChatQueue/userChatQueue.model');db[_0x738e('0x33')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x34'));db[_0x738e('0x35')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x36'));db[_0x738e('0x37')]=db[_0x738e('0x1')]['import'](_0x738e('0x38'));db[_0x738e('0x39')]=db[_0x738e('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x738e('0x3a')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x3b'));db[_0x738e('0x3c')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x738e('0x1')]['import'](_0x738e('0x3d'));db[_0x738e('0x3e')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x3f'));db['MailQueue']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x40'));db[_0x738e('0x41')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x42'));db[_0x738e('0x43')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x44'));db[_0x738e('0x45')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x46'));db[_0x738e('0x47')]=db['sequelize']['import']('../api/mailApplication/mailApplication.model');db[_0x738e('0x48')]=db['sequelize']['import'](_0x738e('0x49'));db[_0x738e('0x4a')]=db['sequelize']['import'](_0x738e('0x4b'));db[_0x738e('0x4c')]=db['sequelize'][_0x738e('0x16')]('../api/dashboardItem/dashboardItem.model');db[_0x738e('0x4d')]=db[_0x738e('0x1')]['import'](_0x738e('0x4e'));db[_0x738e('0x4f')]=db[_0x738e('0x1')]['import'](_0x738e('0x50'));db[_0x738e('0x51')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x52'));db[_0x738e('0x53')]=db['sequelize'][_0x738e('0x16')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db['sequelize'][_0x738e('0x16')](_0x738e('0x54'));db[_0x738e('0x55')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x56'));db[_0x738e('0x57')]=db['sequelize'][_0x738e('0x16')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db['sequelize'][_0x738e('0x16')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x738e('0x1')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x738e('0x58')]=db[_0x738e('0x1')]['import'](_0x738e('0x59'));db[_0x738e('0x5a')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x5b'));db['OpenchannelAccount']=db[_0x738e('0x1')]['import'](_0x738e('0x5c'));db[_0x738e('0x5d')]=db['sequelize'][_0x738e('0x16')]('../api/openchannelApplication/openchannelApplication.model');db[_0x738e('0x5e')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x5f'));db['OpenchannelMessage']=db['sequelize'][_0x738e('0x16')](_0x738e('0x60'));db[_0x738e('0x61')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x62'));db['ChatWebsite']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x738e('0x63')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x64'));db['ChatInteraction']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x65'));db['ChatMessage']=db[_0x738e('0x1')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0x738e('0x1')]['import'](_0x738e('0x66'));db['ChatQueue']=db['sequelize'][_0x738e('0x16')](_0x738e('0x67'));db[_0x738e('0x68')]=db[_0x738e('0x1')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x69'));db[_0x738e('0x6a')]=db[_0x738e('0x1')]['import'](_0x738e('0x6b'));db[_0x738e('0x6c')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x6d'));db[_0x738e('0x6e')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x6f'));db[_0x738e('0x70')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x71'));db[_0x738e('0x72')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0x738e('0x73')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x74'));db[_0x738e('0x75')]=db[_0x738e('0x1')]['import'](_0x738e('0x76'));db[_0x738e('0x77')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x78'));db[_0x738e('0x79')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x7a'));db[_0x738e('0x7b')]=db[_0x738e('0x1')]['import'](_0x738e('0x7c'));db[_0x738e('0x7d')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/cannedAnswer/cannedAnswer.model');db[_0x738e('0x7e')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x7f'));db[_0x738e('0x80')]=db[_0x738e('0x1')]['import']('../api/condition/condition.model');db[_0x738e('0x81')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x82'));db[_0x738e('0x83')]=db[_0x738e('0x1')]['import'](_0x738e('0x84'));db[_0x738e('0x85')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x86'));db[_0x738e('0x87')]=db[_0x738e('0x1')]['import'](_0x738e('0x88'));db[_0x738e('0x89')]=db[_0x738e('0x1')]['import'](_0x738e('0x8a'));db[_0x738e('0x8b')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/sound/sound.model');db[_0x738e('0x8c')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x8d'));db[_0x738e('0x8e')]=db['sequelize']['import'](_0x738e('0x8f'));db['CmContactHasItem']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x90'));db[_0x738e('0x91')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x92'));db['Template']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/template/template.model');db[_0x738e('0x93')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x94'));db[_0x738e('0x95')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x96'));db[_0x738e('0x97')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x98'));db[_0x738e('0x99')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x9a'));db[_0x738e('0x9b')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x9c'));db[_0x738e('0x9d')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x9e'));db[_0x738e('0x9f')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa0'));db[_0x738e('0xa1')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa2'));db[_0x738e('0xa3')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xa4'));db[_0x738e('0xa5')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa6'));db[_0x738e('0xa7')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xa8'));db[_0x738e('0xa9')]=db[_0x738e('0x1')]['import'](_0x738e('0xaa'));db['SalesforceField']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xab'));db[_0x738e('0xac')]=db['sequelize']['import'](_0x738e('0xad'));db['SugarcrmConfiguration']=db['sequelize'][_0x738e('0x16')](_0x738e('0xae'));db[_0x738e('0xaf')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xb0'));db[_0x738e('0xb1')]=db['sequelize'][_0x738e('0x16')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db['sequelize']['import'](_0x738e('0xb2'));db[_0x738e('0xb3')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xb4'));db[_0x738e('0xb5')]=db[_0x738e('0x1')]['import'](_0x738e('0xb6'));db[_0x738e('0xb7')]=db[_0x738e('0x1')]['import'](_0x738e('0xb8'));db[_0x738e('0xb9')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intZohoField/intZohoField.model');db[_0x738e('0xba')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xbb'));db[_0x738e('0xbc')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xbd'));db[_0x738e('0xbe')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xbf'));db['FreshdeskAccount']=db[_0x738e('0x1')]['import'](_0x738e('0xc0'));db['FreshdeskConfiguration']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xc1'));db['VtigerAccount']=db['sequelize'][_0x738e('0x16')](_0x738e('0xc2'));db[_0x738e('0xc3')]=db[_0x738e('0x1')]['import'](_0x738e('0xc4'));db[_0x738e('0xc5')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intVtigerField/intVtigerField.model');db[_0x738e('0xc6')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0x738e('0x1')]['import'](_0x738e('0xc7'));db[_0x738e('0xc8')]=db['sequelize']['import'](_0x738e('0xc9'));db['Dynamics365Account']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xca'));db['Dynamics365Configuration']=db[_0x738e('0x1')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db[_0x738e('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x738e('0xcb')]=db[_0x738e('0x1')]['import'](_0x738e('0xcc'));db['FreshsalesConfiguration']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xcd'));db[_0x738e('0xce')]=db[_0x738e('0x1')]['import'](_0x738e('0xcf'));db[_0x738e('0x97')]=db[_0x738e('0x1')]['import'](_0x738e('0x98'));db[_0x738e('0xd0')]=db[_0x738e('0x1')]['import'](_0x738e('0xd1'));db[_0x738e('0xd2')]=db['sequelize']['import'](_0x738e('0xd3'));db['ChatInternalMessage']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x738e('0xd4')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x738e('0xd5')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xd6'));db[_0x738e('0xd7')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xd8'));db[_0x738e('0xd9')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xda'));db[_0x738e('0xdb')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xdc'));db[_0x738e('0xdd')]=db[_0x738e('0x1')]['import']('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xde'));db[_0x738e('0xdf')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe0'));db[_0x738e('0xe1')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db['sequelize']['import']('../api/squareProject/squareProject.model');db['SquareRecording']=db['sequelize'][_0x738e('0x16')]('../api/squareRecording/squareRecording.model');db[_0x738e('0xe2')]=db['sequelize']['import'](_0x738e('0xe3'));db[_0x738e('0xe4')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe5'));db[_0x738e('0xe6')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe7'));db[_0x738e('0xe8')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xe9'));db[_0x738e('0xea')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xeb'));db[_0x738e('0xec')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xed'));db[_0x738e('0xee')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/plugin/plugin.model');db[_0x738e('0xef')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xf0'));db['ChatTransferReport']=db['sequelize'][_0x738e('0x16')]('../api/chatTransferReport/chatTransferReport.model');db[_0x738e('0xf1')]=db[_0x738e('0x1')]['import'](_0x738e('0xf2'));db[_0x738e('0xf3')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xf4'));db[_0x738e('0xf5')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xf6'));db['CmList']=db[_0x738e('0x1')][_0x738e('0x16')]('../api/cmList/cmList.model');db[_0x738e('0xf7')]=db[_0x738e('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x738e('0xf8')]=db[_0x738e('0x1')]['import'](_0x738e('0xf9'));db['UserProfileSection']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0xfa'));db[_0x738e('0xfb')]=db[_0x738e('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x738e('0x1')]['import']('../api/userNotification/userNotification.model');db[_0x738e('0xfc')]=db['sequelize']['import'](_0x738e('0xfd'));db[_0x738e('0xfe')]=db['sequelize'][_0x738e('0x16')](_0x738e('0xff'));db[_0x738e('0x100')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x101'));db[_0x738e('0x102')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x103'));db[_0x738e('0x104')]=db[_0x738e('0x1')]['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x738e('0x105')]=db['sequelize']['import'](_0x738e('0x106'));db[_0x738e('0x107')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x108'));db[_0x738e('0x109')]=db[_0x738e('0x1')]['import'](_0x738e('0x10a'));db['TeamVoiceQueue']=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x10b'));db[_0x738e('0x10c')]=db[_0x738e('0x1')][_0x738e('0x16')](_0x738e('0x10d'));db[_0x738e('0x10e')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x10f'));db[_0x738e('0x110')]=db[_0x738e('0x1')][_0x738e('0x16')]('../api/user-setting/user-setting.model');db[_0x738e('0x111')]=db['sequelize'][_0x738e('0x16')](_0x738e('0x112'));db[_0x738e('0x13')][_0x738e('0x113')](db[_0x738e('0x21')],{'as':_0x738e('0x21'),'onDelete':_0x738e('0x114'),'foreignKey':'UserId'});db['User'][_0x738e('0x113')](db['UserSetting'],{'as':_0x738e('0x115'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db['VoiceRecording'],{'as':_0x738e('0x118'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')]['hasMany'](db[_0x738e('0x119')],{'as':_0x738e('0x11a'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db['VoiceExtension'],{'as':_0x738e('0x11b'),'onDelete':_0x738e('0x114'),'hooks':!![]});db['User'][_0x738e('0x117')](db[_0x738e('0x72')],{'as':'HopperFinals','foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db[_0x738e('0x73')],{'as':_0x738e('0x11c'),'foreignKey':'UserId'});db[_0x738e('0x13')][_0x738e('0x117')](db['ReportAgentPreview'],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db['OpenchannelInteraction'],{'as':_0x738e('0x11d'),'foreignKey':_0x738e('0x116')});db['User']['hasMany'](db[_0x738e('0x11e')],{'as':_0x738e('0x11f'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db[_0x738e('0x120')],{'as':'SmsInteractions','foreignKey':_0x738e('0x116')});db[_0x738e('0x13')]['hasMany'](db['FaxInteraction'],{'as':_0x738e('0x121'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')][_0x738e('0x117')](db[_0x738e('0x43')],{'as':_0x738e('0x122'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x13')]['hasMany'](db[_0x738e('0x100')],{'as':_0x738e('0x123'),'foreignKey':_0x738e('0x116')});db['User'][_0x738e('0x117')](db[_0x738e('0x124')],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0x738e('0x13')]['hasMany'](db[_0x738e('0x6e')],{'as':_0x738e('0x125'),'foreignKey':_0x738e('0x116'),'onDelete':'SET\x20NULL'});db[_0x738e('0x13')][_0x738e('0x126')](db[_0x738e('0xf8')],{'as':_0x738e('0xf8'),'foreignKey':_0x738e('0x127')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x68')],{'as':_0x738e('0x129'),'through':_0x738e('0x12a')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x6c')],{'as':_0x738e('0x12b'),'through':'cm_user_has_contacts'});db['User']['belongsToMany'](db[_0x738e('0x12c')],{'as':_0x738e('0x12d'),'through':_0x738e('0x12e')});db[_0x738e('0x13')]['belongsToMany'](db['Team'],{'through':_0x738e('0x12f')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x43')],{'as':'MailInteractions','through':_0x738e('0x130')});db[_0x738e('0x13')][_0x738e('0x128')](db['ChatInteraction'],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0x738e('0x13')]['belongsToMany'](db[_0x738e('0x51')],{'as':_0x738e('0x121'),'through':_0x738e('0x131')});db[_0x738e('0x13')]['belongsToMany'](db['SmsInteraction'],{'as':_0x738e('0x132'),'through':_0x738e('0x133')});db[_0x738e('0x13')][_0x738e('0x128')](db['OpenchannelInteraction'],{'as':_0x738e('0x11d'),'through':'user_has_openchannel_interactions'});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x100')],{'as':_0x738e('0x123'),'through':_0x738e('0x134')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x1c')],{'as':_0x738e('0x135'),'through':'UserVoiceQueue','required':![]});db['User'][_0x738e('0x128')](db[_0x738e('0xf7')],{'as':_0x738e('0x136'),'through':_0x738e('0x10e'),'required':![]});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x137')],{'as':_0x738e('0x138'),'through':_0x738e('0x33'),'required':![]});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x139')],{'as':_0x738e('0x13a'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x13b')],{'as':_0x738e('0x13c'),'through':'UserFaxQueue','required':![]});db[_0x738e('0x13')]['belongsToMany'](db[_0x738e('0x5a')],{'as':_0x738e('0x13d'),'through':_0x738e('0x37'),'required':![]});db['User'][_0x738e('0x128')](db['OpenchannelQueue'],{'as':_0x738e('0x13e'),'through':_0x738e('0x39'),'required':![]});db[_0x738e('0x13')][_0x738e('0x128')](db['WhatsappQueue'],{'as':_0x738e('0x13f'),'through':_0x738e('0x3a'),'required':![]});db['User'][_0x738e('0x128')](db[_0x738e('0x12c')],{'through':_0x738e('0x12e')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x140')],{'as':'ChatWebsites','through':_0x738e('0x141')});db['User']['belongsToMany'](db[_0x738e('0x4d')],{'as':'FaxAccounts','through':_0x738e('0x142')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x3e')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x143')],{'as':_0x738e('0x144'),'through':_0x738e('0x145')});db[_0x738e('0x13')][_0x738e('0x128')](db[_0x738e('0x57')],{'as':_0x738e('0x146'),'through':_0x738e('0x147')});db['User']['belongsToMany'](db[_0x738e('0xfc')],{'as':_0x738e('0x148'),'through':_0x738e('0x149')});db[_0x738e('0x15')][_0x738e('0x117')](db[_0x738e('0x19')],{'as':_0x738e('0x14a'),'onDelete':_0x738e('0x114'),'foreignKey':'ChanSpyId'});db[_0x738e('0x17')][_0x738e('0x117')](db['VoiceExtension'],{'onDelete':_0x738e('0x114')});db[_0x738e('0x19')]['hasMany'](db[_0x738e('0x19')],{'as':_0x738e('0x14b'),'onDelete':_0x738e('0x114')});db[_0x738e('0x1a')]['belongsToMany'](db['Sound'],{'as':_0x738e('0x14c'),'through':_0x738e('0x14d')});db['VoiceQueue']['hasMany'](db[_0x738e('0x119')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')][_0x738e('0x117')](db['CmHopper'],{'as':_0x738e('0x125'),'foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')][_0x738e('0x117')](db[_0x738e('0x72')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x738e('0x14e')});db[_0x738e('0x1c')][_0x738e('0x117')](db['ReportAgentPreview'],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x14e')});db[_0x738e('0x1c')]['hasMany'](db[_0x738e('0x70')],{'as':_0x738e('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x738e('0x1c')][_0x738e('0x117')](db[_0x738e('0xd7')],{'as':_0x738e('0x150'),'foreignKey':_0x738e('0x14e')});db['VoiceQueue'][_0x738e('0x126')](db[_0x738e('0x2d')],{'as':'Trunk','foreignKey':_0x738e('0x151')});db[_0x738e('0x1c')][_0x738e('0x126')](db['Trunk'],{'as':_0x738e('0x152'),'foreignKey':'TrunkBackupId'});db[_0x738e('0x1c')][_0x738e('0x126')](db[_0x738e('0x81')],{'as':_0x738e('0x81'),'foreignKey':'IntervalId'});db[_0x738e('0x1c')]['belongsTo'](db[_0x738e('0x83')],{'as':_0x738e('0x153'),'foreignKey':_0x738e('0x154')});db['VoiceQueue']['belongsToMany'](db[_0x738e('0x12c')],{'as':_0x738e('0x12d'),'through':_0x738e('0x155')});db['VoiceQueue'][_0x738e('0x128')](db['User'],{'as':'Agents','through':'UserVoiceQueue'});db[_0x738e('0x1c')][_0x738e('0x128')](db[_0x738e('0xe4')],{'as':'Teams','through':_0x738e('0x156')});db[_0x738e('0x1c')][_0x738e('0x128')](db['CmList'],{'as':_0x738e('0x157'),'through':_0x738e('0x158')});db[_0x738e('0x1e')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13'),'foreignKey':'UserId'});db[_0x738e('0x20')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13'),'foreignKey':'UserId'});db[_0x738e('0x21')]['hasMany'](db[_0x738e('0x22')],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x15a'),'sourceKey':'mailbox'});db[_0x738e('0x22')][_0x738e('0x126')](db[_0x738e('0x21')],{'foreignKey':_0x738e('0x15a'),'targetKey':_0x738e('0x15b')});db[_0x738e('0x15c')][_0x738e('0x117')](db['VoiceQueueReport'],{'as':_0x738e('0x15d'),'foreignKey':'uniqueid','constraints':![]});db[_0x738e('0x15c')]['hasMany'](db[_0x738e('0x27')],{'as':_0x738e('0x15e'),'foreignKey':'uniqueid','constraints':![]});db[_0x738e('0x15c')]['belongsTo'](db[_0x738e('0x13')],{'as':'User','foreignKey':_0x738e('0x116')});db[_0x738e('0x15c')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db['MailServerIn']['belongsTo'](db[_0x738e('0x3e')],{'as':_0x738e('0x3e'),'foreignKey':_0x738e('0x161')});db['MailServerIn'][_0x738e('0x126')](db[_0x738e('0x109')],{'as':_0x738e('0x109'),'foreignKey':_0x738e('0x162'),'onDelete':_0x738e('0x163')});db[_0x738e('0x164')][_0x738e('0x126')](db[_0x738e('0x3e')],{'as':'MailAccount','foreignKey':_0x738e('0x161')});db[_0x738e('0x164')][_0x738e('0x126')](db[_0x738e('0x109')],{'as':_0x738e('0x109'),'foreignKey':_0x738e('0x162'),'onDelete':_0x738e('0x163')});db[_0x738e('0x3e')][_0x738e('0x113')](db[_0x738e('0x3c')],{'as':_0x738e('0x165'),'onDelete':'cascade'});db[_0x738e('0x3e')][_0x738e('0x113')](db[_0x738e('0x164')],{'as':'Smtp','onDelete':'cascade'});db[_0x738e('0x3e')][_0x738e('0x117')](db['Disposition'],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x161'),'onDelete':_0x738e('0x114')});db[_0x738e('0x3e')][_0x738e('0x117')](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x161')});db[_0x738e('0x3e')][_0x738e('0x117')](db[_0x738e('0x45')],{'as':_0x738e('0x159'),'foreignKey':_0x738e('0x161')});db['MailAccount'][_0x738e('0x117')](db['MailInteraction'],{'as':_0x738e('0x168')});db[_0x738e('0x3e')][_0x738e('0x117')](db[_0x738e('0x47')],{'as':_0x738e('0x14b'),'foreignKey':_0x738e('0x161'),'onDelete':_0x738e('0x114')});db[_0x738e('0x3e')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db[_0x738e('0x3e')][_0x738e('0x126')](db[_0x738e('0x16a')],{'as':'Template','foreignKey':_0x738e('0x16b')});db['MailAccount'][_0x738e('0x126')](db['Pause'],{'as':_0x738e('0x153'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x738e('0x3e')][_0x738e('0x128')](db['User'],{'as':'Agents','through':_0x738e('0x16c')});db['MailQueue'][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x33')});db[_0x738e('0x137')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x16e'),'as':_0x738e('0x16f')});db['MailInteraction'][_0x738e('0x117')](db['MailMessage'],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x170')});db[_0x738e('0x43')][_0x738e('0x126')](db[_0x738e('0x3e')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x161')});db[_0x738e('0x43')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':'ContactId'});db[_0x738e('0x43')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x43')]['belongsToMany'](db['Tag'],{'through':_0x738e('0x173'),'as':_0x738e('0x174')});db[_0x738e('0x43')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x173'),'as':_0x738e('0x175')});db[_0x738e('0x43')]['belongsToMany'](db['User'],{'as':_0x738e('0x176'),'through':_0x738e('0x130'),'foreignKey':_0x738e('0x170')});db['MailMessage']['hasMany'](db[_0x738e('0xec')],{'as':_0x738e('0x177'),'onDelete':_0x738e('0x114')});db[_0x738e('0x45')]['belongsTo'](db['User'],{'as':_0x738e('0x13')});db[_0x738e('0x45')][_0x738e('0x126')](db['CmContact'],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x15f')});db[_0x738e('0x45')]['belongsTo'](db[_0x738e('0x43')],{'as':_0x738e('0x178'),'foreignKey':_0x738e('0x170')});db[_0x738e('0x45')][_0x738e('0x126')](db[_0x738e('0x3e')],{'as':_0x738e('0x171'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x738e('0x126')](db[_0x738e('0x140')],{'as':'ChatWebsite','foreignKey':_0x738e('0x179')});db[_0x738e('0x45')][_0x738e('0x126')](db['ChatOfflineMessage'],{'as':_0x738e('0x17a'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x738e('0x126')](db[_0x738e('0x13')],{'onDelete':_0x738e('0x163')});db['MailApplication'][_0x738e('0x126')](db[_0x738e('0x137')],{'onDelete':'restrict'});db[_0x738e('0x47')][_0x738e('0x126')](db[_0x738e('0x3e')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x47')][_0x738e('0x126')](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0x47')][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':'restrict','foreignKey':_0x738e('0x17c')});db[_0x738e('0x48')][_0x738e('0x126')](db['MailAccount'],{});db['MailQueueReport'][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':'Contact','foreignKey':_0x738e('0x160')});db[_0x738e('0x48')]['belongsTo'](db[_0x738e('0x43')],{});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x45')],{});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x13')],{});db[_0x738e('0x48')][_0x738e('0x126')](db[_0x738e('0x137')],{});db[_0x738e('0x4a')]['hasMany'](db[_0x738e('0x4c')],{'as':_0x738e('0x17d'),'onDelete':'cascade'});db[_0x738e('0x4d')][_0x738e('0x117')](db['Disposition'],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x17e'),'onDelete':_0x738e('0x114')});db[_0x738e('0x4d')]['hasMany'](db[_0x738e('0x7d')],{'as':'Answers','foreignKey':_0x738e('0x17e')});db[_0x738e('0x4d')]['hasMany'](db[_0x738e('0x51')],{'as':'Interactions'});db[_0x738e('0x4d')][_0x738e('0x117')](db[_0x738e('0x4f')],{'as':'Applications','foreignKey':_0x738e('0x17e'),'onDelete':_0x738e('0x114')});db[_0x738e('0x4d')][_0x738e('0x117')](db[_0x738e('0x19')],{'as':'Exntensions','onDelete':'cascade'});db[_0x738e('0x4d')][_0x738e('0x117')](db[_0x738e('0x53')],{'as':_0x738e('0x159')});db[_0x738e('0x4d')]['belongsTo'](db[_0x738e('0x2d')],{'as':_0x738e('0x2d')});db['FaxAccount'][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db['FaxAccount'][_0x738e('0x126')](db[_0x738e('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x738e('0x154')});db[_0x738e('0x4d')][_0x738e('0x128')](db['User'],{'as':_0x738e('0x16d'),'through':_0x738e('0x142')});db[_0x738e('0x4f')]['belongsTo'](db['User'],{'onDelete':_0x738e('0x163')});db[_0x738e('0x4f')][_0x738e('0x126')](db[_0x738e('0x13b')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x4f')]['belongsTo'](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication'][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17c')});db[_0x738e('0x51')]['hasMany'](db[_0x738e('0x53')],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':'FaxInteractionId'});db[_0x738e('0x51')][_0x738e('0x126')](db[_0x738e('0x4d')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x17e')});db['FaxInteraction'][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x51')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':'UserId'});db['FaxInteraction'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x180'),'as':_0x738e('0x174')});db[_0x738e('0x51')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':'fax_interaction_has_tags','as':_0x738e('0x175')});db[_0x738e('0x51')]['belongsToMany'](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':'user_has_fax_interactions','foreignKey':_0x738e('0x181')});db[_0x738e('0x53')][_0x738e('0x126')](db['User'],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x13')});db[_0x738e('0x53')][_0x738e('0x126')](db[_0x738e('0x51')],{'as':_0x738e('0x178'),'foreignKey':_0x738e('0x181')});db[_0x738e('0x53')][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':_0x738e('0x114'),'as':'Contact'});db[_0x738e('0x53')][_0x738e('0x126')](db['Attachment'],{'as':_0x738e('0xec'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db[_0x738e('0x4d')],{'as':_0x738e('0x171'),'foreignKey':'FaxAccountId'});db[_0x738e('0x13b')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x35')});db[_0x738e('0x13b')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x182'),'as':_0x738e('0x16f')});db[_0x738e('0x55')]['belongsTo'](db['FaxAccount'],{});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x51')],{});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x53')],{});db[_0x738e('0x55')][_0x738e('0x126')](db['User'],{});db[_0x738e('0x55')][_0x738e('0x126')](db[_0x738e('0x13b')],{});db[_0x738e('0x57')][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':'SmsAccountId','onDelete':_0x738e('0x114')});db[_0x738e('0x57')][_0x738e('0x117')](db['CannedAnswer'],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x183')});db[_0x738e('0x57')][_0x738e('0x117')](db[_0x738e('0x58')],{'as':_0x738e('0x159'),'foreignKey':_0x738e('0x183')});db[_0x738e('0x57')][_0x738e('0x117')](db[_0x738e('0x120')],{'as':_0x738e('0x168')});db['SmsAccount']['hasMany'](db['SmsApplication'],{'as':'Applications','foreignKey':_0x738e('0x183'),'onDelete':_0x738e('0x114')});db[_0x738e('0x57')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x57')]['belongsTo'](db['Pause'],{'as':_0x738e('0x153'),'foreignKey':_0x738e('0x154')});db[_0x738e('0x57')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x147')});db[_0x738e('0x184')]['belongsTo'](db[_0x738e('0x13')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x184')][_0x738e('0x126')](db[_0x738e('0x5a')],{'onDelete':_0x738e('0x163')});db['SmsApplication'][_0x738e('0x126')](db[_0x738e('0x57')],{'onDelete':_0x738e('0x163')});db[_0x738e('0x184')]['belongsTo'](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17b')});db['SmsApplication']['belongsTo'](db[_0x738e('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x738e('0x120')][_0x738e('0x117')](db[_0x738e('0x58')],{'as':_0x738e('0x159'),'onDelete':_0x738e('0x114'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x738e('0x126')](db[_0x738e('0x57')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x183')});db['SmsInteraction']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x738e('0x160')});db[_0x738e('0x120')]['belongsTo'](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x120')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x185'),'as':'Tags'});db[_0x738e('0x120')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':'sms_interaction_has_tags','as':_0x738e('0x175')});db[_0x738e('0x120')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':_0x738e('0x133'),'foreignKey':_0x738e('0x186')});db[_0x738e('0x58')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13')});db[_0x738e('0x58')][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':'cascade','as':_0x738e('0x15f')});db[_0x738e('0x58')][_0x738e('0x126')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x738e('0x178'),'foreignKey':_0x738e('0x186')});db['SmsMessage']['belongsTo'](db['SmsAccount'],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x183')});db[_0x738e('0x5a')][_0x738e('0x128')](db['User'],{'as':_0x738e('0x16d'),'through':'UserSmsQueue','foreignKey':_0x738e('0x187')});db[_0x738e('0x5a')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x188'),'as':'Teams'});db[_0x738e('0x143')][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x189'),'onDelete':_0x738e('0x114')});db['OpenchannelAccount']['hasMany'](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x189')});db[_0x738e('0x143')]['hasMany'](db[_0x738e('0x5e')],{'as':_0x738e('0x168'),'foreignKey':_0x738e('0x189')});db[_0x738e('0x143')][_0x738e('0x117')](db[_0x738e('0x18a')],{'as':'Messages','foreignKey':_0x738e('0x189')});db[_0x738e('0x143')]['hasMany'](db['OpenchannelApplication'],{'as':_0x738e('0x14b'),'foreignKey':'OpenchannelAccountId','onDelete':_0x738e('0x114')});db[_0x738e('0x143')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db['OpenchannelAccount'][_0x738e('0x126')](db[_0x738e('0x83')],{'as':_0x738e('0x153'),'foreignKey':_0x738e('0x154')});db['OpenchannelAccount'][_0x738e('0x128')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x738e('0x5d')][_0x738e('0x126')](db[_0x738e('0x13')],{'onDelete':'restrict'});db[_0x738e('0x5d')][_0x738e('0x126')](db[_0x738e('0x61')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x738e('0x5d')]['belongsTo'](db[_0x738e('0x143')],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x189')});db[_0x738e('0x5d')][_0x738e('0x126')](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':'IntervalId'});db[_0x738e('0x5d')][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17c')});db['OpenchannelInteraction'][_0x738e('0x117')](db['OpenchannelMessage'],{'as':_0x738e('0x159'),'onDelete':'cascade','foreignKey':_0x738e('0x18b')});db[_0x738e('0x5e')][_0x738e('0x126')](db[_0x738e('0x143')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelInteraction'][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db['OpenchannelInteraction'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x18c'),'as':'Tags'});db['OpenchannelInteraction'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x18c'),'as':_0x738e('0x175')});db[_0x738e('0x5e')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':'user_has_openchannel_interactions','foreignKey':_0x738e('0x18b')});db['OpenchannelMessage'][_0x738e('0x126')](db['User'],{'onDelete':_0x738e('0x114'),'as':'User'});db[_0x738e('0x18a')][_0x738e('0x126')](db['CmContact'],{'onDelete':'cascade','as':_0x738e('0x15f')});db['OpenchannelMessage'][_0x738e('0x126')](db[_0x738e('0x5e')],{'onDelete':_0x738e('0x114'),'as':'Interaction','foreignKey':_0x738e('0x18b')});db['OpenchannelMessage'][_0x738e('0x126')](db[_0x738e('0xec')],{'as':_0x738e('0xec'),'foreignKey':_0x738e('0x18d')});db[_0x738e('0x18a')][_0x738e('0x126')](db[_0x738e('0x143')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue'][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x39'),'foreignKey':_0x738e('0x18e')});db[_0x738e('0x61')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x18f'),'as':_0x738e('0x16f')});db[_0x738e('0x140')]['hasMany'](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x738e('0x140')]['hasMany'](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x738e('0x117')](db[_0x738e('0x190')],{'as':_0x738e('0x191')});db[_0x738e('0x140')][_0x738e('0x117')](db[_0x738e('0x11e')],{'as':'Interactions'});db[_0x738e('0x140')][_0x738e('0x117')](db[_0x738e('0x63')],{'as':_0x738e('0x14b'),'foreignKey':_0x738e('0x179'),'onDelete':'cascade'});db[_0x738e('0x140')]['hasMany'](db[_0x738e('0x192')],{'as':_0x738e('0x159')});db[_0x738e('0x140')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x140')][_0x738e('0x126')](db['Interval'],{'as':_0x738e('0x81'),'foreignKey':_0x738e('0x17b')});db['ChatWebsite']['belongsTo'](db[_0x738e('0x3e')],{'as':'MailAccount','foreignKey':_0x738e('0x161')});db[_0x738e('0x140')]['belongsTo'](db[_0x738e('0x83')],{'as':_0x738e('0x153'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x738e('0x140')][_0x738e('0x128')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x738e('0x126')](db[_0x738e('0x143')],{});db['OpenchannelQueueReport'][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x193')]['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db['OpenchannelQueueReport']['belongsTo'](db[_0x738e('0x5e')],{});db[_0x738e('0x193')][_0x738e('0x126')](db[_0x738e('0x18a')],{});db[_0x738e('0x193')]['belongsTo'](db[_0x738e('0x13')],{});db[_0x738e('0x193')]['belongsTo'](db[_0x738e('0x61')],{});db['ChatApplication'][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x194'),'foreignKey':_0x738e('0x116'),'onDelete':'restrict'});db[_0x738e('0x63')][_0x738e('0x126')](db['ChatQueue'],{'as':_0x738e('0x195'),'foreignKey':_0x738e('0x196'),'onDelete':_0x738e('0x163')});db[_0x738e('0x63')][_0x738e('0x126')](db[_0x738e('0x140')],{'as':_0x738e('0x197'),'foreignKey':_0x738e('0x179'),'onDelete':_0x738e('0x163')});db[_0x738e('0x63')][_0x738e('0x126')](db['Tag'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17c')});db[_0x738e('0x11e')][_0x738e('0x117')](db['ChatMessage'],{'as':_0x738e('0x159'),'onDelete':'cascade','foreignKey':_0x738e('0x198')});db[_0x738e('0x11e')][_0x738e('0x126')](db[_0x738e('0x140')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x179')});db[_0x738e('0x11e')]['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x11e')]['belongsTo'](db[_0x738e('0x13')],{'as':'Owner','foreignKey':_0x738e('0x116')});db[_0x738e('0x11e')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x199'),'as':_0x738e('0x174')});db[_0x738e('0x11e')][_0x738e('0x128')](db['Tag'],{'through':_0x738e('0x199'),'as':_0x738e('0x175')});db[_0x738e('0x11e')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':_0x738e('0x19a'),'foreignKey':_0x738e('0x198')});db[_0x738e('0x192')][_0x738e('0x126')](db['User'],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x13')});db[_0x738e('0x192')][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':_0x738e('0x114'),'as':'Contact','foreignKey':_0x738e('0x160')});db['ChatMessage'][_0x738e('0x126')](db[_0x738e('0x11e')],{'onDelete':_0x738e('0x114'),'as':'Interaction','foreignKey':_0x738e('0x198')});db[_0x738e('0x192')]['belongsTo'](db[_0x738e('0xec')],{'as':_0x738e('0xec'),'foreignKey':_0x738e('0x18d')});db['ChatMessage'][_0x738e('0x126')](db[_0x738e('0x140')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x738e('0x17a')][_0x738e('0x117')](db[_0x738e('0xec')],{'as':_0x738e('0x177'),'foreignKey':_0x738e('0x19b'),'onDelete':_0x738e('0x114'),'hooks':!![]});db['ChatOfflineMessage'][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x17a')][_0x738e('0x126')](db[_0x738e('0x140')],{'as':_0x738e('0x171'),'foreignKey':'ChatWebsiteId'});db[_0x738e('0x139')][_0x738e('0x128')](db['User'],{'as':_0x738e('0x16d'),'through':_0x738e('0x32'),'hooks':!![]});db[_0x738e('0x139')][_0x738e('0x128')](db['Team'],{'through':'team_has_chat_queues','as':_0x738e('0x16f')});db[_0x738e('0x68')][_0x738e('0x117')](db[_0x738e('0x19c')],{'as':_0x738e('0x159'),'foreignKey':_0x738e('0x19d'),'onDelete':_0x738e('0x114')});db[_0x738e('0x68')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x19e'),'through':'chat_group_has_users'});db[_0x738e('0x190')][_0x738e('0x126')](db['ChatWebsite'],{'as':_0x738e('0x197'),'foreignKey':_0x738e('0x179')});db[_0x738e('0x6a')][_0x738e('0x117')](db['CmContact'],{'as':_0x738e('0x12b'),'foreignKey':_0x738e('0x19f')});db[_0x738e('0x6c')][_0x738e('0x117')](db[_0x738e('0x1a0')],{'as':'Phones','foreignKey':_0x738e('0x1a1')});db[_0x738e('0x6c')][_0x738e('0x117')](db[_0x738e('0x6e')],{'as':_0x738e('0x125'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x72')],{'as':_0x738e('0x1a2'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x73')],{'as':_0x738e('0x1a3'),'foreignKey':_0x738e('0x160')});db['CmContact'][_0x738e('0x117')](db['ReportAgentPreview'],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x160')});db['CmContact'][_0x738e('0x117')](db[_0x738e('0xd7')],{'as':_0x738e('0x150'),'foreignKey':_0x738e('0x160')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x5e')],{'as':_0x738e('0x11d'),'foreignKey':_0x738e('0x160'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0x738e('0x11e')],{'as':_0x738e('0x11f'),'foreignKey':'ContactId','onDelete':_0x738e('0x163')});db[_0x738e('0x6c')][_0x738e('0x117')](db[_0x738e('0x120')],{'as':_0x738e('0x132'),'foreignKey':_0x738e('0x160'),'onDelete':_0x738e('0x163')});db['CmContact'][_0x738e('0x117')](db[_0x738e('0x51')],{'as':_0x738e('0x121'),'foreignKey':_0x738e('0x160'),'onDelete':_0x738e('0x163')});db[_0x738e('0x6c')]['hasMany'](db[_0x738e('0x43')],{'as':'MailInteractions','foreignKey':_0x738e('0x160'),'onDelete':'restrict'});db[_0x738e('0x6c')][_0x738e('0x126')](db[_0x738e('0x6a')],{'as':_0x738e('0x1a4'),'foreignKey':'CompanyId'});db['CmContact'][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169'),'onDelete':_0x738e('0x114')});db['CmContact'][_0x738e('0x128')](db[_0x738e('0x13')],{'as':'Users','through':_0x738e('0x1a5')});db[_0x738e('0x6c')][_0x738e('0x128')](db[_0x738e('0x8c')],{'as':'Tags','through':_0x738e('0x1a6')});db[_0x738e('0x6c')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x1a6'),'as':_0x738e('0x175')});db['CmHopper'][_0x738e('0x117')](db[_0x738e('0x91')],{'as':_0x738e('0x1a7'),'foreignKey':_0x738e('0x1a8')});db[_0x738e('0x6e')][_0x738e('0x126')](db['CmContact'],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160'),'onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':'ListId','onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':'Agent','foreignKey':'UserId'});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x1c')],{'as':_0x738e('0x195'),'foreignKey':_0x738e('0x14e'),'onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0xe8')],{'as':_0x738e('0xe8'),'foreignKey':_0x738e('0x1a9'),'onDelete':_0x738e('0x114')});db[_0x738e('0x6e')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x1aa')});db['CmHopperBlack']['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160'),'onDelete':'cascade'});db[_0x738e('0x70')][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169'),'onDelete':_0x738e('0x114')});db[_0x738e('0x70')][_0x738e('0x126')](db['VoiceQueue'],{'as':_0x738e('0x195'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0x738e('0x70')][_0x738e('0x126')](db[_0x738e('0xe8')],{'as':_0x738e('0xe8'),'foreignKey':_0x738e('0x1a9'),'onDelete':_0x738e('0x114')});db['Automation']['hasMany'](db[_0x738e('0x80')],{'as':{'plural':_0x738e('0x1ab'),'singular':_0x738e('0x1ac')},'foreignKey':_0x738e('0x1ad'),'onDelete':'cascade','hooks':!![]});db[_0x738e('0x7b')]['hasMany'](db[_0x738e('0x80')],{'as':{'plural':'Any','singular':_0x738e('0x1ae')},'foreignKey':_0x738e('0x1af'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x7b')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x738e('0x114'),'hooks':!![]});db['Disposition'][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x1b0'),'onDelete':_0x738e('0x114')});db[_0x738e('0x81')][_0x738e('0x117')](db['Interval'],{'as':'Intervals','foreignKey':_0x738e('0x17b'),'onDelete':_0x738e('0x114'),'hooks':!![],'required':![]});db['Interval'][_0x738e('0x117')](db[_0x738e('0x19')],{'as':_0x738e('0x11b'),'foreignKey':_0x738e('0x17b'),'onDelete':_0x738e('0x163')});db['Interval'][_0x738e('0x117')](db['MailApplication'],{'as':_0x738e('0x1b1'),'foreignKey':'IntervalId'});db[_0x738e('0x81')]['hasMany'](db['ChatApplication'],{'as':_0x738e('0x1b2'),'foreignKey':'IntervalId'});db[_0x738e('0x81')][_0x738e('0x117')](db[_0x738e('0x4f')],{'as':_0x738e('0x1b3'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0x81')][_0x738e('0x117')](db[_0x738e('0x184')],{'as':'SmsApplications','foreignKey':_0x738e('0x17b')});db[_0x738e('0x89')][_0x738e('0x126')](db[_0x738e('0x3e')],{});db[_0x738e('0x89')][_0x738e('0x126')](db[_0x738e('0x9d')],{'foreignKey':_0x738e('0x1b4')});db[_0x738e('0x89')]['belongsTo'](db[_0x738e('0x9b')],{'foreignKey':_0x738e('0x1b5')});db[_0x738e('0x8b')][_0x738e('0x128')](db[_0x738e('0x1a')],{'as':_0x738e('0x1b6'),'through':_0x738e('0x14d'),'onDelete':_0x738e('0x163')});db['Tag']['belongsToMany'](db[_0x738e('0x6c')],{'through':'cm_contact_has_tags'});db['Tag'][_0x738e('0x128')](db[_0x738e('0x11e')],{'through':_0x738e('0x199')});db[_0x738e('0x8c')][_0x738e('0x128')](db[_0x738e('0x43')],{'through':_0x738e('0x173')});db[_0x738e('0x8c')]['belongsToMany'](db['SmsInteraction'],{'through':_0x738e('0x185')});db[_0x738e('0x8c')][_0x738e('0x128')](db[_0x738e('0x51')],{'through':_0x738e('0x180')});db[_0x738e('0x8c')][_0x738e('0x128')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x738e('0x8c')]['belongsToMany'](db[_0x738e('0x100')],{'through':_0x738e('0x1b7')});db[_0x738e('0x1a0')][_0x738e('0x126')](db['ContactItemType'],{'as':_0x738e('0x1b8'),'foreignKey':_0x738e('0x1b9')});db[_0x738e('0x91')][_0x738e('0x126')](db['CmHopper'],{'as':_0x738e('0x1ba'),'foreignKey':_0x738e('0x1a8')});db[_0x738e('0x1a0')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':'Contact','foreignKey':_0x738e('0x1a1')});db[_0x738e('0x93')]['hasMany'](db[_0x738e('0x80')],{'as':{'plural':_0x738e('0x1bb'),'singular':_0x738e('0x1bc')},'foreignKey':_0x738e('0x1bd'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x93')]['hasMany'](db[_0x738e('0x80')],{'as':{'plural':_0x738e('0x1be'),'singular':_0x738e('0x1bf')},'foreignKey':_0x738e('0x1c0'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x93')][_0x738e('0x117')](db['Action'],{'as':_0x738e('0x1c1'),'foreignKey':_0x738e('0x1c2'),'onDelete':_0x738e('0x114'),'hooks':!![]});db[_0x738e('0x9b')]['hasMany'](db[_0x738e('0xa3')],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1b5'),'hooks':!![]});db[_0x738e('0x9d')]['hasMany'](db[_0x738e('0xa3')],{'as':_0x738e('0x1c3'),'onDelete':'cascade','foreignKey':_0x738e('0x1b4')});db[_0x738e('0xa1')][_0x738e('0x117')](db[_0x738e('0xa3')],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x738e('0x126')](db[_0x738e('0xa1')],{'foreignKey':_0x738e('0x1c4')});db[_0x738e('0xa7')][_0x738e('0x117')](db[_0x738e('0xa9')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':'AccountId'});db[_0x738e('0xa9')][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':_0x738e('0x1c7'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c8')});db['SalesforceConfiguration'][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':'Descriptions','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db['SalesforceConfiguration'][_0x738e('0x117')](db['SalesforceField'],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xa9')][_0x738e('0x126')](db['SalesforceAccount'],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1c6')]['hasMany'](db[_0x738e('0x1c6')],{'as':'Subject','foreignKey':'SubjectId'});db['SalesforceField'][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x738e('0x117')](db[_0x738e('0x1c6')],{'as':'Field','foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1c6')]['belongsTo'](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db['SugarcrmAccount'][_0x738e('0x117')](db[_0x738e('0x1ce')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1ce')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':'Subjects','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1ce')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1cf'),'onDelete':'cascade','foreignKey':_0x738e('0x1c9')});db[_0x738e('0x1ce')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':'FieldId'});db[_0x738e('0x1ce')][_0x738e('0x126')](db[_0x738e('0xac')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xaf')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db[_0x738e('0xaf')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xaf')][_0x738e('0x117')](db[_0x738e('0xaf')],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xaf')]['belongsTo'](db[_0x738e('0x95')],{'as':'Variable','foreignKey':_0x738e('0x1cd')});db['DeskAccount'][_0x738e('0x117')](db[_0x738e('0x1d2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1d2')]['hasMany'](db[_0x738e('0xb3')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d2')][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1cf'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db['DeskConfiguration'][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1d2')][_0x738e('0x126')](db[_0x738e('0xb1')],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x1d3')});db['DeskField'][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1d0'),'foreignKey':_0x738e('0x1c8')});db[_0x738e('0xb3')][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db['DeskField'][_0x738e('0x117')](db[_0x738e('0xb3')],{'as':_0x738e('0x1d1'),'foreignKey':'FieldId'});db[_0x738e('0xb3')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xb5')]['hasMany'](db[_0x738e('0xb7')],{'as':_0x738e('0x1c5'),'onDelete':'cascade','foreignKey':_0x738e('0x1cb')});db[_0x738e('0xb7')][_0x738e('0x117')](db[_0x738e('0xb9')],{'as':_0x738e('0x1c7'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x738e('0x117')](db[_0x738e('0xb9')],{'as':_0x738e('0x1cf'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xb7')][_0x738e('0x117')](db['ZohoField'],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xb7')][_0x738e('0x126')](db['ZohoAccount'],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db[_0x738e('0xb9')]['hasMany'](db[_0x738e('0xb9')],{'as':_0x738e('0x1d0'),'foreignKey':_0x738e('0x1c8')});db['ZohoField'][_0x738e('0x117')](db[_0x738e('0xb9')],{'as':'Description','foreignKey':_0x738e('0x1c9')});db[_0x738e('0xb9')][_0x738e('0x117')](db['ZohoField'],{'as':'Field','foreignKey':_0x738e('0x1ca')});db['ZohoField'][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xba')][_0x738e('0x117')](db[_0x738e('0xbc')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xbc')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':'Subjects','foreignKey':_0x738e('0x1c8')});db[_0x738e('0xbc')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x738e('0xbc')]['hasMany'](db[_0x738e('0xbe')],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xbc')][_0x738e('0x126')](db[_0x738e('0xba')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xbc')][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0x738e('0xbe')][_0x738e('0x117')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x738e('0x1c8')});db[_0x738e('0xbe')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db[_0x738e('0xbe')][_0x738e('0x117')](db[_0x738e('0xbe')],{'as':'Field','foreignKey':'FieldId'});db[_0x738e('0xbe')]['belongsTo'](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0x1d4')]['hasMany'](db[_0x738e('0x1d5')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1d5')]['hasMany'](db['FreshdeskField'],{'as':_0x738e('0x1c7'),'onDelete':'cascade','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d5')][_0x738e('0x117')](db[_0x738e('0x1d6')],{'as':_0x738e('0x1cf'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0x1d5')][_0x738e('0x117')](db['FreshdeskField'],{'as':_0x738e('0x1c3'),'onDelete':_0x738e('0x114'),'foreignKey':'FieldId'});db[_0x738e('0x1d5')][_0x738e('0x126')](db[_0x738e('0x1d4')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db['FreshdeskConfiguration'][_0x738e('0x128')](db[_0x738e('0x8c')],{'through':_0x738e('0x1d7')});db[_0x738e('0x1d6')][_0x738e('0x117')](db[_0x738e('0x1d6')],{'as':'Subject','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d6')][_0x738e('0x117')](db[_0x738e('0x1d6')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db[_0x738e('0x1d6')]['hasMany'](db[_0x738e('0x1d6')],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1d6')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':'VariableId'});db['VtigerAccount']['hasMany'](db[_0x738e('0xc3')],{'as':'Configurations','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xc3')][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1c7'),'foreignKey':_0x738e('0x1c8')});db[_0x738e('0xc3')][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1cf'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xc3')][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xc3')]['belongsTo'](db[_0x738e('0x1d8')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db['VtigerField'][_0x738e('0x117')](db['VtigerField'],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db['VtigerField'][_0x738e('0x117')](db[_0x738e('0xc5')],{'as':_0x738e('0x1cc'),'foreignKey':'DescriptionId'});db[_0x738e('0xc5')][_0x738e('0x117')](db['VtigerField'],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0xc5')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xc6')][_0x738e('0x117')](db[_0x738e('0x1d9')],{'as':'Configurations','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1d9')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':'Subjects','foreignKey':_0x738e('0x1c8')});db[_0x738e('0x1d9')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':_0x738e('0x1cf'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0x1d9')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db['ServicenowConfiguration'][_0x738e('0x126')](db[_0x738e('0xc6')],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db[_0x738e('0xc8')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':'Subject','foreignKey':_0x738e('0x1c8')});db[_0x738e('0xc8')][_0x738e('0x117')](db[_0x738e('0xc8')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db[_0x738e('0xc8')]['hasMany'](db[_0x738e('0xc8')],{'as':'Field','foreignKey':_0x738e('0x1ca')});db['ServicenowField']['belongsTo'](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0x1da')]['hasMany'](db['Dynamics365Configuration'],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0x1da')][_0x738e('0x126')](db['CloudProvider'],{'as':_0x738e('0x109'),'foreignKey':_0x738e('0x162')});db[_0x738e('0x1db')]['hasMany'](db['Dynamics365Field'],{'as':_0x738e('0x1c7'),'onDelete':_0x738e('0x114'),'foreignKey':'SubjectId'});db[_0x738e('0x1db')][_0x738e('0x117')](db['Dynamics365Field'],{'as':_0x738e('0x1cf'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x738e('0x1db')][_0x738e('0x117')](db[_0x738e('0x1dc')],{'as':'Fields','onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1db')][_0x738e('0x126')](db['Dynamics365Account'],{'as':_0x738e('0x171'),'foreignKey':'AccountId'});db[_0x738e('0x1dc')][_0x738e('0x117')](db['Dynamics365Field'],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db[_0x738e('0x1dc')]['hasMany'](db[_0x738e('0x1dc')],{'as':'Description','foreignKey':_0x738e('0x1c9')});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':_0x738e('0x1d1'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1dc')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db[_0x738e('0xcb')][_0x738e('0x117')](db[_0x738e('0x1dd')],{'as':_0x738e('0x1c5'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1cb')});db['FreshsalesConfiguration'][_0x738e('0x117')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0x738e('0x1c8')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x738e('0x1cf'),'foreignKey':_0x738e('0x1c9')});db['FreshsalesConfiguration'][_0x738e('0x117')](db['FreshsalesField'],{'as':_0x738e('0x1c3'),'foreignKey':_0x738e('0x1ca')});db[_0x738e('0x1dd')][_0x738e('0x126')](db[_0x738e('0xcb')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x1cb')});db[_0x738e('0xce')][_0x738e('0x117')](db[_0x738e('0xce')],{'as':_0x738e('0x1d0'),'foreignKey':'SubjectId'});db[_0x738e('0xce')][_0x738e('0x117')](db[_0x738e('0xce')],{'as':_0x738e('0x1cc'),'foreignKey':_0x738e('0x1c9')});db['FreshsalesField'][_0x738e('0x117')](db['FreshsalesField'],{'as':_0x738e('0x1d1'),'foreignKey':'FieldId'});db[_0x738e('0xce')][_0x738e('0x126')](db[_0x738e('0x95')],{'as':_0x738e('0x95'),'foreignKey':_0x738e('0x1cd')});db['ChatQueueReport'][_0x738e('0x126')](db[_0x738e('0x140')],{});db[_0x738e('0xd2')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':'List','foreignKey':_0x738e('0x169')});db['ChatQueueReport'][_0x738e('0x126')](db['CmContact'],{'as':'Contact','foreignKey':_0x738e('0x160')});db[_0x738e('0xd2')][_0x738e('0x126')](db['ChatInteraction'],{});db[_0x738e('0xd2')][_0x738e('0x126')](db[_0x738e('0x192')],{});db[_0x738e('0xd2')][_0x738e('0x126')](db[_0x738e('0x13')],{});db['ChatQueueReport'][_0x738e('0x126')](db[_0x738e('0x139')],{});db['ChatInternalMessage'][_0x738e('0x126')](db[_0x738e('0x13')],{'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1de')});db['ChatInternalMessage']['belongsTo'](db[_0x738e('0x13')],{'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x1df')});db[_0x738e('0xd7')][_0x738e('0x117')](db[_0x738e('0xd5')],{'foreignKey':'SessionId','onDelete':_0x738e('0x114')});db[_0x738e('0xd7')][_0x738e('0x117')](db[_0x738e('0xd4')],{'foreignKey':_0x738e('0x1e0'),'onDelete':_0x738e('0x114')});db[_0x738e('0xd9')][_0x738e('0x126')](db[_0x738e('0x57')],{});db[_0x738e('0xd9')][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0xd9')]['belongsTo'](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':_0x738e('0x160')});db['SmsQueueReport'][_0x738e('0x126')](db[_0x738e('0x120')],{});db[_0x738e('0xd9')][_0x738e('0x126')](db[_0x738e('0x58')],{});db[_0x738e('0xd9')][_0x738e('0x126')](db['User'],{});db['SmsQueueReport'][_0x738e('0x126')](db[_0x738e('0x5a')],{});db[_0x738e('0x1e1')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x738e('0x1e2')});db[_0x738e('0x1e1')][_0x738e('0x117')](db[_0x738e('0xd5')],{'foreignKey':_0x738e('0x1e2')});db['JscriptyProject'][_0x738e('0x117')](db[_0x738e('0xd4')],{'foreignKey':'ProjectId'});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':'Agents','through':_0x738e('0x12f')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x1c')],{'through':_0x738e('0x156'),'as':_0x738e('0x135')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x137')],{'through':_0x738e('0x16e'),'as':_0x738e('0x138')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x139')],{'through':_0x738e('0x1e3'),'as':_0x738e('0x13a')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x13b')],{'through':_0x738e('0x182'),'as':_0x738e('0x13c')});db[_0x738e('0xe4')][_0x738e('0x128')](db[_0x738e('0x5a')],{'through':'team_has_sms_queues','as':_0x738e('0x13d')});db[_0x738e('0xe4')][_0x738e('0x128')](db['OpenchannelQueue'],{'through':_0x738e('0x18f'),'as':_0x738e('0x13e')});db['Team'][_0x738e('0x128')](db['WhatsappQueue'],{'through':_0x738e('0x1e4'),'as':_0x738e('0x13f')});db[_0x738e('0xe4')][_0x738e('0x128')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0x738e('0x136')});db[_0x738e('0xe8')][_0x738e('0x117')](db['CmHopper'],{'as':_0x738e('0x125'),'foreignKey':'CampaignId'});db[_0x738e('0xe8')][_0x738e('0x117')](db['CmHopperFinal'],{'as':_0x738e('0x1a2'),'foreignKey':_0x738e('0x1a9')});db[_0x738e('0xe8')]['hasMany'](db[_0x738e('0x73')],{'as':_0x738e('0x1a3'),'foreignKey':_0x738e('0x1a9')});db['Campaign'][_0x738e('0x117')](db[_0x738e('0x70')],{'as':_0x738e('0x14f'),'foreignKey':_0x738e('0x1a9')});db[_0x738e('0xe8')]['belongsTo'](db[_0x738e('0x2d')],{'as':'Trunk','foreignKey':_0x738e('0x151')});db[_0x738e('0xe8')][_0x738e('0x126')](db[_0x738e('0x2d')],{'as':_0x738e('0x152'),'foreignKey':_0x738e('0x1e5')});db[_0x738e('0xe8')]['belongsTo'](db[_0x738e('0x81')],{'as':_0x738e('0x81'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0xe8')][_0x738e('0x126')](db[_0x738e('0x1e6')],{'as':_0x738e('0x1e6'),'foreignKey':_0x738e('0x1e7')});db['Campaign'][_0x738e('0x128')](db[_0x738e('0x12c')],{'as':_0x738e('0x12d'),'through':_0x738e('0x1e8')});db[_0x738e('0xe8')][_0x738e('0x128')](db[_0x738e('0x12c')],{'as':_0x738e('0x157'),'through':_0x738e('0x1e9')});db[_0x738e('0xec')][_0x738e('0x126')](db[_0x738e('0x17a')],{'as':_0x738e('0x17a'),'foreignKey':_0x738e('0x19b')});db[_0x738e('0xef')][_0x738e('0x126')](db['MailMessage'],{});db[_0x738e('0xef')][_0x738e('0x126')](db['MailInteraction'],{});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x3e')],{'foreignKey':_0x738e('0x1ea'),'as':_0x738e('0x1eb')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':'FromUserId','as':_0x738e('0x1ec')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x137')],{'foreignKey':_0x738e('0x1ef'),'as':_0x738e('0x1f0')});db[_0x738e('0xef')][_0x738e('0x126')](db[_0x738e('0x3e')],{'foreignKey':'ToMailAccountId','as':_0x738e('0x1f1')});db[_0x738e('0x1f2')][_0x738e('0x126')](db[_0x738e('0x192')],{});db[_0x738e('0x1f2')][_0x738e('0x126')](db[_0x738e('0x11e')],{});db[_0x738e('0x1f2')]['belongsTo'](db[_0x738e('0x140')],{'foreignKey':_0x738e('0x1f3'),'as':_0x738e('0x1eb')});db[_0x738e('0x1f2')][_0x738e('0x126')](db['User'],{'foreignKey':_0x738e('0x1f4'),'as':_0x738e('0x1ec')});db['ChatTransferReport'][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':'ToUserId','as':_0x738e('0x1ee')});db[_0x738e('0x1f2')][_0x738e('0x126')](db[_0x738e('0x139')],{'foreignKey':_0x738e('0x1f5'),'as':_0x738e('0x1f0')});db['ChatTransferReport'][_0x738e('0x126')](db[_0x738e('0x140')],{'foreignKey':_0x738e('0x1f6'),'as':_0x738e('0x1f1')});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x53')],{});db[_0x738e('0xf1')]['belongsTo'](db[_0x738e('0x51')],{});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x4d')],{'foreignKey':_0x738e('0x1f7'),'as':'FromAccount'});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1f4'),'as':'FromAgent'});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db[_0x738e('0xf1')]['belongsTo'](db[_0x738e('0x13b')],{'foreignKey':_0x738e('0x1f8'),'as':_0x738e('0x1f0')});db[_0x738e('0xf1')][_0x738e('0x126')](db[_0x738e('0x4d')],{'foreignKey':'ToFaxAccountId','as':_0x738e('0x1f1')});db['OpenchannelTransferReport']['belongsTo'](db[_0x738e('0x18a')],{});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x5e')],{});db[_0x738e('0xf3')][_0x738e('0x126')](db[_0x738e('0x143')],{'foreignKey':_0x738e('0x1f9'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':'FromUserId','as':_0x738e('0x1ec')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x738e('0x1ed'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x61')],{'foreignKey':'ToOpenchannelQueueId','as':_0x738e('0x1f0')});db['OpenchannelTransferReport'][_0x738e('0x126')](db[_0x738e('0x143')],{'foreignKey':_0x738e('0x1fa'),'as':'ToAccount'});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x58')],{});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x120')],{});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x57')],{'foreignKey':_0x738e('0x1fb'),'as':_0x738e('0x1eb')});db[_0x738e('0xf5')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1f4'),'as':_0x738e('0x1ec')});db['SmsTransferReport'][_0x738e('0x126')](db['User'],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db['SmsTransferReport'][_0x738e('0x126')](db[_0x738e('0x5a')],{'foreignKey':_0x738e('0x1fc'),'as':_0x738e('0x1f0')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x738e('0x1fd'),'as':_0x738e('0x1f1')});db[_0x738e('0x12c')][_0x738e('0x117')](db[_0x738e('0x7e')],{'as':'Dispositions','foreignKey':_0x738e('0x169'),'onDelete':_0x738e('0x114')});db[_0x738e('0x12c')][_0x738e('0x117')](db[_0x738e('0x77')],{'as':_0x738e('0x1fe'),'foreignKey':_0x738e('0x169')});db['CmList']['hasMany'](db[_0x738e('0x6c')],{'as':_0x738e('0x12b'),'onDelete':_0x738e('0x114'),'foreignKey':_0x738e('0x169')});db['CmList'][_0x738e('0x117')](db[_0x738e('0x72')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x738e('0x12c')][_0x738e('0x117')](db['CmHopperHistory'],{'as':_0x738e('0x11c'),'foreignKey':'ListId'});db['CmList'][_0x738e('0x117')](db[_0x738e('0x75')],{'as':_0x738e('0x75'),'foreignKey':_0x738e('0x169')});db['CmList'][_0x738e('0x128')](db[_0x738e('0x1c')],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0x738e('0x12c')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':_0x738e('0x12e')});db['VoicePrefix'][_0x738e('0x117')](db['VoiceExtension'],{'as':_0x738e('0x11b'),'onDelete':_0x738e('0x114')});db[_0x738e('0xf7')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x16d'),'through':'UserVoicePrefix'});db['VoicePrefix'][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':_0x738e('0x10c'),'as':_0x738e('0x16f')});db[_0x738e('0xf8')]['hasMany'](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'foreignKey':_0x738e('0x127')});db['UserProfile'][_0x738e('0x117')](db[_0x738e('0x1ff')],{'as':_0x738e('0x200'),'foreignKey':_0x738e('0x127'),'onDelete':_0x738e('0x114')});db['UserProfileSection'][_0x738e('0x117')](db[_0x738e('0xfb')],{'as':_0x738e('0x201'),'foreignKey':'sectionId','onDelete':_0x738e('0x114')});db['WhatsappAccount'][_0x738e('0x117')](db['Disposition'],{'as':_0x738e('0x166'),'foreignKey':_0x738e('0x202'),'onDelete':'cascade'});db[_0x738e('0xfc')][_0x738e('0x117')](db[_0x738e('0x7d')],{'as':_0x738e('0x167'),'foreignKey':_0x738e('0x202')});db['WhatsappAccount']['hasMany'](db[_0x738e('0x102')],{'as':_0x738e('0x159'),'foreignKey':'WhatsappAccountId'});db[_0x738e('0xfc')][_0x738e('0x117')](db['WhatsappInteraction'],{'as':_0x738e('0x168')});db[_0x738e('0xfc')]['hasMany'](db[_0x738e('0xfe')],{'as':_0x738e('0x14b'),'foreignKey':_0x738e('0x202'),'onDelete':_0x738e('0x114')});db[_0x738e('0xfc')][_0x738e('0x126')](db['CmList'],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0xfc')][_0x738e('0x126')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x738e('0x154')});db['WhatsappAccount']['belongsToMany'](db['User'],{'as':_0x738e('0x16d'),'through':'user_has_whatsapp_accounts'});db[_0x738e('0xfe')][_0x738e('0x126')](db['User'],{'onDelete':'restrict'});db[_0x738e('0xfe')][_0x738e('0x126')](db[_0x738e('0x107')],{'onDelete':_0x738e('0x163')});db[_0x738e('0xfe')][_0x738e('0x126')](db[_0x738e('0xfc')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x738e('0x126')](db['Interval'],{'onDelete':_0x738e('0x163'),'foreignKey':_0x738e('0x17b')});db[_0x738e('0xfe')][_0x738e('0x126')](db[_0x738e('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db['WhatsappInteraction'][_0x738e('0x117')](db[_0x738e('0x102')],{'as':_0x738e('0x159'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x738e('0x126')](db[_0x738e('0xfc')],{'as':_0x738e('0x171'),'foreignKey':_0x738e('0x202')});db['WhatsappInteraction'][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':_0x738e('0x15f'),'foreignKey':'ContactId'});db[_0x738e('0x100')][_0x738e('0x126')](db['User'],{'as':_0x738e('0x172'),'foreignKey':_0x738e('0x116')});db[_0x738e('0x100')][_0x738e('0x128')](db['Tag'],{'through':_0x738e('0x1b7'),'as':'Tags'});db[_0x738e('0x100')]['belongsToMany'](db[_0x738e('0x8c')],{'through':_0x738e('0x1b7'),'as':_0x738e('0x175')});db[_0x738e('0x100')][_0x738e('0x128')](db[_0x738e('0x13')],{'as':_0x738e('0x176'),'through':_0x738e('0x134'),'foreignKey':_0x738e('0x203')});db[_0x738e('0x102')][_0x738e('0x126')](db[_0x738e('0x13')],{'as':_0x738e('0x13')});db['WhatsappMessage'][_0x738e('0x126')](db[_0x738e('0x6c')],{'onDelete':'cascade','as':_0x738e('0x15f')});db[_0x738e('0x102')]['belongsTo'](db[_0x738e('0x100')],{'onDelete':_0x738e('0x114'),'as':_0x738e('0x178'),'foreignKey':_0x738e('0x203')});db[_0x738e('0x102')][_0x738e('0x126')](db[_0x738e('0xfc')],{'as':_0x738e('0x171'),'foreignKey':'WhatsappAccountId'});db[_0x738e('0x104')][_0x738e('0x126')](db['WhatsappAccount'],{});db[_0x738e('0x104')][_0x738e('0x126')](db[_0x738e('0x12c')],{'as':_0x738e('0x17f'),'foreignKey':_0x738e('0x169')});db[_0x738e('0x104')][_0x738e('0x126')](db[_0x738e('0x6c')],{'as':'Contact','foreignKey':_0x738e('0x160')});db['WhatsappQueueReport'][_0x738e('0x126')](db[_0x738e('0x100')],{});db['WhatsappQueueReport'][_0x738e('0x126')](db['WhatsappQueue'],{});db[_0x738e('0x104')][_0x738e('0x126')](db['WhatsappMessage'],{});db[_0x738e('0x104')][_0x738e('0x126')](db[_0x738e('0x13')],{});db[_0x738e('0x105')]['belongsTo'](db[_0x738e('0x102')],{});db[_0x738e('0x105')][_0x738e('0x126')](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x738e('0x126')](db['WhatsappAccount'],{'foreignKey':_0x738e('0x204'),'as':_0x738e('0x1eb')});db[_0x738e('0x105')][_0x738e('0x126')](db[_0x738e('0xfc')],{'foreignKey':'ToWhatsappAccountId','as':_0x738e('0x1f1')});db[_0x738e('0x105')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x738e('0x205'),'as':_0x738e('0x1f0')});db['WhatsappTransferReport'][_0x738e('0x126')](db['User'],{'foreignKey':_0x738e('0x1f4'),'as':'FromAgent'});db[_0x738e('0x105')][_0x738e('0x126')](db[_0x738e('0x13')],{'foreignKey':_0x738e('0x1ed'),'as':_0x738e('0x1ee')});db[_0x738e('0x107')]['belongsToMany'](db['User'],{'as':_0x738e('0x16d'),'through':_0x738e('0x3a'),'foreignKey':'WhatsappQueueId'});db[_0x738e('0x107')][_0x738e('0x128')](db[_0x738e('0xe4')],{'through':'team_has_whatsapp_queues','as':_0x738e('0x16f')});db['UserSetting'][_0x738e('0x126')](db['User'],{'as':_0x738e('0x206'),'foreignKey':_0x738e('0x116'),'onDelete':_0x738e('0x114'),'hooks':!![]});db['CloudProvider'][_0x738e('0x113')](db[_0x738e('0x1da')],{'as':_0x738e('0x1da'),'onDelete':_0x738e('0x163')});db[_0x738e('0x109')][_0x738e('0x113')](db[_0x738e('0x3c')],{'as':_0x738e('0x165'),'onDelete':_0x738e('0x163')});db['CloudProvider'][_0x738e('0x113')](db[_0x738e('0x164')],{'as':_0x738e('0x207'),'onDelete':_0x738e('0x163')});module[_0x738e('0x208')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xd21b=['user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','WhatsappQueue','WhatsappQueues','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','VoiceMusicOnHold','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','belongsTo','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','QueueCalls','uniqueid','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Applications','TemplateId','team_has_mail_queues','Account','CmContact','Contact','Owner','mail_interaction_has_tags','Tag','ThroughTags','MailInteractionId','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','List','ListId','Dashboard','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','SmsAccountId','mandatoryDispositionPause','SmsQueue','SmsMessage','SmsInteractionId','Tags','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','UserOpenchannelQueue','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatQueueId','ChatMessage','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','Phones','Hoppers','Company','cm_contact_has_tags','CampaignId','OwnerId','All','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','CmContactHasItem','ItemType','ItemTypeId','Hopper','CmHopperId','CmContactId','AllCondition','AnyConditions','AnyCondition','Action','AnalyticCustomReport','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','int_desk_configuration_has_tags','Description','VtigerConfiguration','VtigerField','ServicenowConfiguration','FreshsalesConfiguration','ChatQueueReport','FromId','ToId','JscriptyAnswerReport','SessionId','ProjectId','team_has_openchannel_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','FromAgent','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','HopperHistory','Queues','VoicePrefix','Resources','sectionId','WhatsappAccountId','whatsapp_interaction_has_tags','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','lodash','jstz','determine','defaultsDeep','xcall','127.0.0.1','mysql','name','utf8','sequelizeHistory','xC@LL1234','utf8_general_ci','sequelize','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','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','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../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','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappApplication','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','VoiceMail','cascade','UserSetting','userSetting','hasMany','UserId','UserVoiceQueueRt','Extensions','CmHopperFinal','HopperFinals','OpenchannelInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteraction','WhatsappInteractions','CmHopper','SET\x20NULL','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions'];(function(_0x2fd8c4,_0x19c608){var _0x3178ee=function(_0x584625){while(--_0x584625){_0x2fd8c4['push'](_0x2fd8c4['shift']());}};_0x3178ee(++_0x19c608);}(_0xd21b,0xcf));var _0xbd21=function(_0x28f153,_0x4852ed){_0x28f153=_0x28f153-0x0;var _0x56b861=_0xd21b[_0x28f153];return _0x56b861;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xbd21('0x0'));var jstz=require(_0xbd21('0x1'));var timezone=jstz[_0xbd21('0x2')]();config['sequelize']=_[_0xbd21('0x3')](config['sequelize'],{'database':'motion2','username':_0xbd21('0x4'),'password':'xC@LL1234','options':{'host':_0xbd21('0x5'),'port':0xcea,'dialect':_0xbd21('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xbd21('0x7')](),'define':{'charset':_0xbd21('0x8'),'collate':'utf8_general_ci'}}});config[_0xbd21('0x9')]=_[_0xbd21('0x3')](config['sequelizeHistory'],{'database':'motion2','username':_0xbd21('0x4'),'password':_0xbd21('0xa'),'options':{'host':_0xbd21('0x5'),'port':0xcea,'dialect':_0xbd21('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xbd21('0x8'),'collate':_0xbd21('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbd21('0xc')]['database'],config[_0xbd21('0xc')]['username'],config[_0xbd21('0xc')]['password'],config['sequelize'][_0xbd21('0xd')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xbd21('0x9')]['database'],config['sequelizeHistory'][_0xbd21('0xe')],config[_0xbd21('0x9')]['password'],config[_0xbd21('0x9')]['options'])};db[_0xbd21('0xf')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x11'));db[_0xbd21('0x12')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x13'));db['VoiceContext']=db['sequelize']['import'](_0xbd21('0x14'));db[_0xbd21('0x15')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x16'));db['VoiceMusicOnHold']=db['sequelize']['import'](_0xbd21('0x17'));db[_0xbd21('0x18')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x19'));db[_0xbd21('0x1a')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x1b'));db['ScreenRecording']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x1c'));db['VoiceMail']=db[_0xbd21('0xc')]['import']('../api/voiceMail/voiceMail.model');db[_0xbd21('0x1d')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x1e'));db[_0xbd21('0x1f')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x20'));db[_0xbd21('0x21')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x22'));db[_0xbd21('0x23')]=db['sequelize'][_0xbd21('0x10')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xbd21('0x24')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x25'));db[_0xbd21('0x26')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x27'));db[_0xbd21('0x28')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/trunk/trunk.model');db[_0xbd21('0x29')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x2a'));db['UserVoiceQueueRt']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x2b'));db['UserVoiceQueue']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x2c'));db[_0xbd21('0x2d')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x2e'));db[_0xbd21('0x2f')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x30'));db[_0xbd21('0x31')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x32'));db['UserSmsQueue']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x33'));db['UserOpenchannelQueue']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x34'));db[_0xbd21('0x35')]=db[_0xbd21('0xc')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xbd21('0x36')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x37'));db[_0xbd21('0x38')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x39'));db[_0xbd21('0x3a')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x3b'));db['MailQueue']=db[_0xbd21('0xc')]['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x3c'));db[_0xbd21('0x3d')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x3e'));db[_0xbd21('0x3f')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x40'));db[_0xbd21('0x41')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x42'));db['Dashboard']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x43'));db[_0xbd21('0x44')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x45'));db[_0xbd21('0x46')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x47'));db[_0xbd21('0x48')]=db['sequelize']['import'](_0xbd21('0x49'));db[_0xbd21('0x4a')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x4b'));db[_0xbd21('0x4c')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x4d'));db[_0xbd21('0x4e')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x4f'));db[_0xbd21('0x50')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x51'));db['SmsAccount']=db['sequelize'][_0xbd21('0x10')]('../api/smsAccount/smsAccount.model');db[_0xbd21('0x52')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x53'));db[_0xbd21('0x54')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x55'));db['SmsMessage']=db[_0xbd21('0xc')]['import'](_0xbd21('0x56'));db['SmsQueue']=db['sequelize']['import']('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/openchannelAccount/openchannelAccount.model');db[_0xbd21('0x57')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x58'));db[_0xbd21('0x59')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x5a'));db[_0xbd21('0x5b')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x5c'));db[_0xbd21('0x5d')]=db[_0xbd21('0xc')]['import']('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x5e'));db[_0xbd21('0x5f')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xbd21('0x60')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x61'));db[_0xbd21('0x62')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x63'));db['ChatMessage']=db[_0xbd21('0xc')]['import']('../api/chatMessage/chatMessage.model');db[_0xbd21('0x64')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x65'));db[_0xbd21('0x66')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x67'));db[_0xbd21('0x68')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x69'));db[_0xbd21('0x6a')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x6b'));db[_0xbd21('0x6c')]=db[_0xbd21('0xc')]['import']('../api/cmCompany/cmCompany.model');db['CmContact']=db[_0xbd21('0xc')]['import'](_0xbd21('0x6d'));db['CmHopper']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x6e'));db[_0xbd21('0x6f')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x70'));db['CmHopperFinal']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x71'));db[_0xbd21('0x72')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x73'));db[_0xbd21('0x74')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x75'));db[_0xbd21('0x76')]=db['sequelize'][_0xbd21('0x10')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/action/action.model');db[_0xbd21('0x77')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x78'));db[_0xbd21('0x79')]=db[_0xbd21('0xc')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0xbd21('0x7a')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x7b'));db[_0xbd21('0x7c')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x7d'));db[_0xbd21('0x7e')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x7f'));db[_0xbd21('0x80')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x81'));db[_0xbd21('0x82')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/cdr/cdr.model');db[_0xbd21('0x83')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x84'));db[_0xbd21('0x85')]=db['sequelize']['import'](_0xbd21('0x86'));db[_0xbd21('0x87')]=db['sequelize'][_0xbd21('0x10')]('../api/sound/sound.model');db['Tag']=db[_0xbd21('0xc')]['import'](_0xbd21('0x88'));db[_0xbd21('0x89')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x8a'));db['CmContactHasItem']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x8b'));db[_0xbd21('0x8c')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x8d'));db[_0xbd21('0x8e')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/template/template.model');db[_0xbd21('0x8f')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x90'));db[_0xbd21('0x91')]=db[_0xbd21('0xc')]['import']('../api/variable/variable.model');db[_0xbd21('0x92')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x93'));db[_0xbd21('0x94')]=db[_0xbd21('0xc')]['import'](_0xbd21('0x95'));db['AnalyticCustomReport']=db['sequelize']['import'](_0xbd21('0x96'));db[_0xbd21('0x97')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x98'));db['AnalyticExtractedReport']=db['sequelize']['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xbd21('0x99')]=db['sequelize'][_0xbd21('0x10')]('../api/analyticMetric/analyticMetric.model');db[_0xbd21('0x9a')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x9b'));db[_0xbd21('0x9c')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x9d'));db[_0xbd21('0x9e')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x9f'));db['SalesforceConfiguration']=db[_0xbd21('0xc')]['import'](_0xbd21('0xa0'));db[_0xbd21('0xa1')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xa2'));db[_0xbd21('0xa3')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xa4'));db[_0xbd21('0xa5')]=db[_0xbd21('0xc')]['import'](_0xbd21('0xa6'));db[_0xbd21('0xa7')]=db[_0xbd21('0xc')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xbd21('0xa8')]=db[_0xbd21('0xc')]['import'](_0xbd21('0xa9'));db[_0xbd21('0xaa')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xbd21('0xab')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xac'));db[_0xbd21('0xad')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xae'));db[_0xbd21('0xaf')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xb0'));db[_0xbd21('0xb1')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xb2'));db[_0xbd21('0xb3')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xb4'));db[_0xbd21('0xb5')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xb6'));db[_0xbd21('0xb7')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xb8'));db[_0xbd21('0xb9')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xba'));db[_0xbd21('0xbb')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xbc'));db[_0xbd21('0xbd')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xbe'));db[_0xbd21('0xbf')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xc0'));db['VtigerConfiguration']=db[_0xbd21('0xc')]['import'](_0xbd21('0xc1'));db['VtigerField']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/intVtigerField/intVtigerField.model');db[_0xbd21('0xc2')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/intServicenowAccount/intServicenowAccount.model');db['ServicenowConfiguration']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xbd21('0xc3')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/intServicenowField/intServicenowField.model');db[_0xbd21('0xc4')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xc5'));db[_0xbd21('0xc6')]=db[_0xbd21('0xc')]['import'](_0xbd21('0xc7'));db[_0xbd21('0xc8')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xc9'));db[_0xbd21('0xca')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xcb'));db['FreshsalesConfiguration']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xcc'));db[_0xbd21('0xcd')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xce'));db[_0xbd21('0x92')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/integration/integration.model');db[_0xbd21('0xcf')]=db[_0xbd21('0xc')]['import']('../api/network/network.model');db['ChatQueueReport']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xd0'));db[_0xbd21('0xd1')]=db[_0xbd21('0xc')]['import'](_0xbd21('0xd2'));db['JscriptyAnswerReport']=db[_0xbd21('0xc')]['import'](_0xbd21('0xd3'));db[_0xbd21('0xd4')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xd5'));db[_0xbd21('0xd6')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xd7'));db[_0xbd21('0xd8')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xd9'));db['SquareReport']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db[_0xbd21('0xc')]['import'](_0xbd21('0xda'));db[_0xbd21('0xdb')]=db[_0xbd21('0xc')]['import'](_0xbd21('0xdc'));db[_0xbd21('0xdd')]=db['sequelize']['import'](_0xbd21('0xde'));db[_0xbd21('0xdf')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xe0'));db[_0xbd21('0xe1')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xe2'));db[_0xbd21('0xe3')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xe4'));db[_0xbd21('0xe5')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xe6'));db[_0xbd21('0xe7')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xe8'));db[_0xbd21('0xe9')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xea'));db[_0xbd21('0xeb')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xec'));db[_0xbd21('0xed')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xee'));db[_0xbd21('0xef')]=db['sequelize']['import'](_0xbd21('0xf0'));db['Plugin']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xf1'));db['MailTransferReport']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xf2'));db[_0xbd21('0xf3')]=db['sequelize'][_0xbd21('0x10')]('../api/chatTransferReport/chatTransferReport.model');db[_0xbd21('0xf4')]=db[_0xbd21('0xc')]['import'](_0xbd21('0xf5'));db['OpenchannelTransferReport']=db['sequelize'][_0xbd21('0x10')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xf6'));db['CmList']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xf7'));db[_0xbd21('0xf8')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/userProfile/userProfile.model');db[_0xbd21('0xf9')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0xfa'));db[_0xbd21('0xfb')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/userProfileResource/userProfileResource.model');db[_0xbd21('0xfc')]=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/whatsappAccount/whatsappAccount.model');db[_0xbd21('0xfd')]=db['sequelize']['import']('../api/whatsappApplication/whatsappApplication.model');db['WhatsappInteraction']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0xfe'));db[_0xbd21('0xff')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x100'));db[_0xbd21('0x101')]=db['sequelize'][_0xbd21('0x10')]('../api/whatsappQueueReport/whatsappQueueReport.model');db['WhatsappTransferReport']=db['sequelize']['import'](_0xbd21('0x102'));db['WhatsappQueue']=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x103'));db[_0xbd21('0x104')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x105'));db['TeamVoiceQueue']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xbd21('0x106')]=db[_0xbd21('0xc')][_0xbd21('0x10')](_0xbd21('0x107'));db[_0xbd21('0x108')]=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x109'));db['UserSetting']=db['sequelize'][_0xbd21('0x10')](_0xbd21('0x10a'));db['MailInteractionHasTag']=db[_0xbd21('0xc')][_0xbd21('0x10')]('../api/mailInteractionHasTag/mailInteractionHasTag.model');db['User'][_0xbd21('0x10b')](db[_0xbd21('0x10c')],{'as':_0xbd21('0x10c'),'onDelete':_0xbd21('0x10d'),'foreignKey':'UserId'});db[_0xbd21('0xf')][_0xbd21('0x10b')](db[_0xbd21('0x10e')],{'as':_0xbd21('0x10f'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0xbd21('0x110')](db[_0xbd21('0x1a')],{'as':'Recordings','foreignKey':_0xbd21('0x111')});db['User'][_0xbd21('0x110')](db[_0xbd21('0x112')],{'as':'VoiceQueuesRt','foreignKey':_0xbd21('0x111')});db[_0xbd21('0xf')][_0xbd21('0x110')](db[_0xbd21('0x15')],{'as':_0xbd21('0x113'),'onDelete':_0xbd21('0x10d'),'hooks':!![]});db['User'][_0xbd21('0x110')](db[_0xbd21('0x114')],{'as':_0xbd21('0x115'),'foreignKey':_0xbd21('0x111')});db[_0xbd21('0xf')]['hasMany'](db[_0xbd21('0x72')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0xbd21('0xf')][_0xbd21('0x110')](db['ReportAgentPreview'],{'as':_0xbd21('0x74'),'foreignKey':'UserId'});db[_0xbd21('0xf')]['hasMany'](db[_0xbd21('0x59')],{'as':_0xbd21('0x116'),'foreignKey':_0xbd21('0x111')});db[_0xbd21('0xf')][_0xbd21('0x110')](db[_0xbd21('0x62')],{'as':'ChatInteractions','foreignKey':_0xbd21('0x111')});db[_0xbd21('0xf')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xbd21('0xf')][_0xbd21('0x110')](db['FaxInteraction'],{'as':_0xbd21('0x117'),'foreignKey':_0xbd21('0x111')});db[_0xbd21('0xf')]['hasMany'](db[_0xbd21('0x118')],{'as':_0xbd21('0x119'),'foreignKey':_0xbd21('0x111')});db[_0xbd21('0xf')][_0xbd21('0x110')](db[_0xbd21('0x11a')],{'as':_0xbd21('0x11b'),'foreignKey':_0xbd21('0x111')});db['User'][_0xbd21('0x110')](db['UserNotification'],{'as':'UserNotifications','foreignKey':'SenderId'});db[_0xbd21('0xf')][_0xbd21('0x110')](db[_0xbd21('0x11c')],{'as':'Hoppers','foreignKey':_0xbd21('0x111'),'onDelete':_0xbd21('0x11d')});db['User']['belongsTo'](db[_0xbd21('0xf8')],{'as':'UserProfile','foreignKey':_0xbd21('0x11e')});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x68')],{'as':_0xbd21('0x120'),'through':_0xbd21('0x121')});db[_0xbd21('0xf')][_0xbd21('0x11f')](db['CmContact'],{'as':_0xbd21('0x122'),'through':_0xbd21('0x123')});db['User'][_0xbd21('0x11f')](db[_0xbd21('0x124')],{'as':_0xbd21('0x125'),'through':_0xbd21('0x126')});db['User'][_0xbd21('0x11f')](db[_0xbd21('0xe7')],{'through':_0xbd21('0x127')});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x118')],{'as':'MailInteractions','through':_0xbd21('0x128')});db[_0xbd21('0xf')][_0xbd21('0x11f')](db['ChatInteraction'],{'as':_0xbd21('0x129'),'through':_0xbd21('0x12a')});db['User'][_0xbd21('0x11f')](db[_0xbd21('0x4a')],{'as':_0xbd21('0x117'),'through':_0xbd21('0x12b')});db['User'][_0xbd21('0x11f')](db[_0xbd21('0x54')],{'as':_0xbd21('0x12c'),'through':_0xbd21('0x12d')});db[_0xbd21('0xf')]['belongsToMany'](db[_0xbd21('0x59')],{'as':_0xbd21('0x116'),'through':_0xbd21('0x12e')});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x11a')],{'as':_0xbd21('0x11b'),'through':_0xbd21('0x12f')});db['User'][_0xbd21('0x11f')](db[_0xbd21('0x18')],{'as':_0xbd21('0x130'),'through':'UserVoiceQueue','required':![]});db[_0xbd21('0xf')][_0xbd21('0x11f')](db['VoicePrefix'],{'as':_0xbd21('0x131'),'through':_0xbd21('0x108'),'required':![]});db[_0xbd21('0xf')]['belongsToMany'](db[_0xbd21('0x132')],{'as':'MailQueues','through':_0xbd21('0x2f'),'required':![]});db[_0xbd21('0xf')]['belongsToMany'](db[_0xbd21('0x66')],{'as':_0xbd21('0x133'),'through':_0xbd21('0x2d'),'required':![],'hooks':!![]});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x4e')],{'as':_0xbd21('0x134'),'through':_0xbd21('0x31'),'required':![]});db['User']['belongsToMany'](db['SmsQueue'],{'as':_0xbd21('0x135'),'through':_0xbd21('0x136'),'required':![]});db[_0xbd21('0xf')][_0xbd21('0x11f')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x137')],{'as':_0xbd21('0x138'),'through':_0xbd21('0x35'),'required':![]});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x124')],{'through':'cm_user_has_lists'});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x139')],{'as':_0xbd21('0x13a'),'through':'user_has_chat_websites'});db[_0xbd21('0xf')]['belongsToMany'](db[_0xbd21('0x46')],{'as':_0xbd21('0x13b'),'through':_0xbd21('0x13c')});db[_0xbd21('0xf')][_0xbd21('0x11f')](db['MailAccount'],{'as':_0xbd21('0x13d'),'through':_0xbd21('0x13e')});db['User'][_0xbd21('0x11f')](db[_0xbd21('0x13f')],{'as':'OpenchannelAccounts','through':_0xbd21('0x140')});db[_0xbd21('0xf')][_0xbd21('0x11f')](db[_0xbd21('0x141')],{'as':_0xbd21('0x142'),'through':_0xbd21('0x143')});db['User'][_0xbd21('0x11f')](db[_0xbd21('0x144')],{'as':_0xbd21('0x145'),'through':_0xbd21('0x146')});db[_0xbd21('0x12')][_0xbd21('0x110')](db[_0xbd21('0x15')],{'as':_0xbd21('0x147'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db['VoiceContext'][_0xbd21('0x110')](db[_0xbd21('0x15')],{'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x15')][_0xbd21('0x110')](db[_0xbd21('0x15')],{'as':'Applications','onDelete':_0xbd21('0x10d')});db[_0xbd21('0x148')]['belongsToMany'](db['Sound'],{'as':'Sounds','through':_0xbd21('0x149')});db[_0xbd21('0x18')][_0xbd21('0x110')](db[_0xbd21('0x112')],{'as':_0xbd21('0x14a'),'foreignKey':_0xbd21('0x14b')});db[_0xbd21('0x18')][_0xbd21('0x110')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xbd21('0x14b')});db[_0xbd21('0x18')][_0xbd21('0x110')](db[_0xbd21('0x114')],{'as':'HopperFinals','foreignKey':_0xbd21('0x14b')});db[_0xbd21('0x18')][_0xbd21('0x110')](db[_0xbd21('0x72')],{'as':_0xbd21('0x14c'),'foreignKey':_0xbd21('0x14b')});db[_0xbd21('0x18')][_0xbd21('0x110')](db[_0xbd21('0x74')],{'as':_0xbd21('0x74'),'foreignKey':_0xbd21('0x14b')});db[_0xbd21('0x18')]['hasMany'](db[_0xbd21('0x6f')],{'as':_0xbd21('0x14d'),'foreignKey':_0xbd21('0x14b')});db[_0xbd21('0x18')]['hasMany'](db[_0xbd21('0xd6')],{'as':_0xbd21('0x14e'),'foreignKey':_0xbd21('0x14b')});db[_0xbd21('0x18')]['belongsTo'](db[_0xbd21('0x28')],{'as':'Trunk','foreignKey':_0xbd21('0x14f')});db[_0xbd21('0x18')]['belongsTo'](db[_0xbd21('0x28')],{'as':_0xbd21('0x150'),'foreignKey':_0xbd21('0x151')});db[_0xbd21('0x18')][_0xbd21('0x152')](db[_0xbd21('0x7e')],{'as':_0xbd21('0x7e'),'foreignKey':_0xbd21('0x153')});db[_0xbd21('0x18')][_0xbd21('0x152')](db[_0xbd21('0x80')],{'as':'mandatoryDispositionPause','foreignKey':_0xbd21('0x154')});db['VoiceQueue']['belongsToMany'](db[_0xbd21('0x124')],{'as':_0xbd21('0x125'),'through':_0xbd21('0x155')});db['VoiceQueue'][_0xbd21('0x11f')](db['User'],{'as':_0xbd21('0x156'),'through':'UserVoiceQueue'});db[_0xbd21('0x18')]['belongsToMany'](db['Team'],{'as':_0xbd21('0x157'),'through':_0xbd21('0x158')});db['VoiceQueue'][_0xbd21('0x11f')](db['CmList'],{'as':'BlackLists','through':_0xbd21('0x159')});db[_0xbd21('0x1a')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':'User','foreignKey':_0xbd21('0x111')});db[_0xbd21('0x15a')]['belongsTo'](db['User'],{'as':_0xbd21('0xf'),'foreignKey':_0xbd21('0x111')});db['VoiceMail'][_0xbd21('0x110')](db['VoiceMailMessage'],{'as':_0xbd21('0x15b'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x15c'),'sourceKey':'mailbox'});db[_0xbd21('0x1d')]['belongsTo'](db[_0xbd21('0x10c')],{'foreignKey':_0xbd21('0x15c'),'targetKey':'mailbox'});db[_0xbd21('0x1f')][_0xbd21('0x110')](db[_0xbd21('0x24')],{'as':_0xbd21('0x15d'),'foreignKey':_0xbd21('0x15e'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xbd21('0x23')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xbd21('0x1f')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':'User','foreignKey':'UserId'});db[_0xbd21('0x1f')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x36')][_0xbd21('0x152')](db[_0xbd21('0x3a')],{'as':_0xbd21('0x3a'),'foreignKey':_0xbd21('0x160')});db[_0xbd21('0x36')]['belongsTo'](db['CloudProvider'],{'as':_0xbd21('0x104'),'foreignKey':_0xbd21('0x161'),'onDelete':'restrict'});db[_0xbd21('0x38')]['belongsTo'](db['MailAccount'],{'as':_0xbd21('0x3a'),'foreignKey':_0xbd21('0x160')});db[_0xbd21('0x38')]['belongsTo'](db[_0xbd21('0x104')],{'as':_0xbd21('0x104'),'foreignKey':'CloudProviderId','onDelete':_0xbd21('0x162')});db['MailAccount'][_0xbd21('0x10b')](db[_0xbd21('0x36')],{'as':_0xbd21('0x163'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x3a')][_0xbd21('0x10b')](db[_0xbd21('0x38')],{'as':_0xbd21('0x164'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x3a')][_0xbd21('0x110')](db['Disposition'],{'as':_0xbd21('0x165'),'foreignKey':'MailAccountId','onDelete':_0xbd21('0x10d')});db['MailAccount'][_0xbd21('0x110')](db[_0xbd21('0x79')],{'as':_0xbd21('0x166'),'foreignKey':_0xbd21('0x160')});db[_0xbd21('0x3a')][_0xbd21('0x110')](db[_0xbd21('0x3d')],{'as':'Messages','foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0xbd21('0x118')],{'as':'Interactions'});db['MailAccount'][_0xbd21('0x110')](db['MailApplication'],{'as':_0xbd21('0x167'),'foreignKey':_0xbd21('0x160'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x3a')][_0xbd21('0x152')](db['CmList'],{'as':'List','foreignKey':'ListId'});db['MailAccount'][_0xbd21('0x152')](db[_0xbd21('0x8e')],{'as':'Template','foreignKey':_0xbd21('0x168')});db['MailAccount'][_0xbd21('0x152')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xbd21('0x154')});db[_0xbd21('0x3a')]['belongsToMany'](db['User'],{'as':_0xbd21('0x156'),'through':_0xbd21('0x13e')});db[_0xbd21('0x132')][_0xbd21('0x11f')](db['User'],{'as':'Agents','through':_0xbd21('0x2f')});db['MailQueue']['belongsToMany'](db[_0xbd21('0xe7')],{'through':_0xbd21('0x169'),'as':_0xbd21('0x157')});db[_0xbd21('0x118')][_0xbd21('0x110')](db[_0xbd21('0x3d')],{'as':_0xbd21('0x15b'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction'][_0xbd21('0x152')](db[_0xbd21('0x3a')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x160')});db['MailInteraction'][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db['MailInteraction']['belongsTo'](db[_0xbd21('0xf')],{'as':_0xbd21('0x16d'),'foreignKey':_0xbd21('0x111')});db[_0xbd21('0x118')][_0xbd21('0x11f')](db['Tag'],{'through':_0xbd21('0x16e'),'as':'Tags'});db[_0xbd21('0x118')][_0xbd21('0x11f')](db[_0xbd21('0x16f')],{'through':_0xbd21('0x16e'),'as':_0xbd21('0x170')});db['MailInteraction'][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':'Users','through':_0xbd21('0x128'),'foreignKey':_0xbd21('0x171')});db[_0xbd21('0x3d')][_0xbd21('0x110')](db[_0xbd21('0xef')],{'as':_0xbd21('0x172'),'onDelete':_0xbd21('0x10d')});db['MailMessage'][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':_0xbd21('0xf')});db[_0xbd21('0x3d')]['belongsTo'](db[_0xbd21('0x16b')],{'onDelete':'cascade','as':'Contact'});db[_0xbd21('0x3d')][_0xbd21('0x152')](db[_0xbd21('0x118')],{'as':_0xbd21('0x173'),'foreignKey':_0xbd21('0x171')});db[_0xbd21('0x3d')][_0xbd21('0x152')](db[_0xbd21('0x3a')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x160')});db[_0xbd21('0x3d')]['belongsTo'](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0xbd21('0x174')});db[_0xbd21('0x3d')][_0xbd21('0x152')](db[_0xbd21('0x64')],{'as':_0xbd21('0x64'),'foreignKey':_0xbd21('0x175')});db[_0xbd21('0x3f')]['belongsTo'](db[_0xbd21('0xf')],{'onDelete':_0xbd21('0x162')});db[_0xbd21('0x3f')][_0xbd21('0x152')](db[_0xbd21('0x132')],{'onDelete':_0xbd21('0x162')});db[_0xbd21('0x3f')][_0xbd21('0x152')](db[_0xbd21('0x3a')],{'onDelete':_0xbd21('0x162')});db['MailApplication'][_0xbd21('0x152')](db[_0xbd21('0x7e')],{'onDelete':'restrict','foreignKey':_0xbd21('0x153')});db['MailApplication'][_0xbd21('0x152')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xbd21('0x176')});db[_0xbd21('0x41')][_0xbd21('0x152')](db[_0xbd21('0x3a')],{});db[_0xbd21('0x41')][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178')});db[_0xbd21('0x41')][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':'ContactId'});db[_0xbd21('0x41')][_0xbd21('0x152')](db[_0xbd21('0x118')],{});db['MailQueueReport']['belongsTo'](db[_0xbd21('0x3d')],{});db[_0xbd21('0x41')][_0xbd21('0x152')](db[_0xbd21('0xf')],{});db[_0xbd21('0x41')][_0xbd21('0x152')](db['MailQueue'],{});db[_0xbd21('0x179')][_0xbd21('0x110')](db['DashboardItem'],{'as':'Items','onDelete':'cascade'});db[_0xbd21('0x46')][_0xbd21('0x110')](db[_0xbd21('0x7a')],{'as':_0xbd21('0x165'),'foreignKey':_0xbd21('0x17a'),'onDelete':'cascade'});db[_0xbd21('0x46')][_0xbd21('0x110')](db[_0xbd21('0x79')],{'as':_0xbd21('0x166'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0xbd21('0x110')](db['FaxInteraction'],{'as':_0xbd21('0x17b')});db[_0xbd21('0x46')]['hasMany'](db[_0xbd21('0x48')],{'as':_0xbd21('0x167'),'foreignKey':'FaxAccountId','onDelete':_0xbd21('0x10d')});db[_0xbd21('0x46')][_0xbd21('0x110')](db[_0xbd21('0x15')],{'as':_0xbd21('0x17c'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x46')][_0xbd21('0x110')](db['FaxMessage'],{'as':_0xbd21('0x15b')});db[_0xbd21('0x46')][_0xbd21('0x152')](db[_0xbd21('0x28')],{'as':_0xbd21('0x28')});db['FaxAccount'][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178')});db[_0xbd21('0x46')][_0xbd21('0x152')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xbd21('0x46')][_0xbd21('0x11f')](db['User'],{'as':_0xbd21('0x156'),'through':_0xbd21('0x13c')});db[_0xbd21('0x48')][_0xbd21('0x152')](db['User'],{'onDelete':_0xbd21('0x162')});db[_0xbd21('0x48')][_0xbd21('0x152')](db[_0xbd21('0x4e')],{'onDelete':'restrict'});db[_0xbd21('0x48')][_0xbd21('0x152')](db[_0xbd21('0x46')],{'onDelete':_0xbd21('0x162')});db['FaxApplication'][_0xbd21('0x152')](db['Tag'],{'onDelete':_0xbd21('0x162'),'foreignKey':_0xbd21('0x176')});db['FaxInteraction'][_0xbd21('0x110')](db['FaxMessage'],{'as':_0xbd21('0x15b'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x17d')});db[_0xbd21('0x4a')]['belongsTo'](db[_0xbd21('0x46')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x17a')});db[_0xbd21('0x4a')]['belongsTo'](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db['FaxInteraction']['belongsTo'](db['User'],{'as':_0xbd21('0x16d'),'foreignKey':'UserId'});db[_0xbd21('0x4a')][_0xbd21('0x11f')](db['Tag'],{'through':_0xbd21('0x17e'),'as':'Tags'});db[_0xbd21('0x4a')][_0xbd21('0x11f')](db[_0xbd21('0x16f')],{'through':_0xbd21('0x17e'),'as':_0xbd21('0x170')});db[_0xbd21('0x4a')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x17f'),'through':_0xbd21('0x12b'),'foreignKey':'FaxInteractionId'});db[_0xbd21('0x4c')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0xf')});db[_0xbd21('0x4c')][_0xbd21('0x152')](db[_0xbd21('0x4a')],{'as':_0xbd21('0x173'),'foreignKey':_0xbd21('0x17d')});db[_0xbd21('0x4c')]['belongsTo'](db[_0xbd21('0x16b')],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0x16c')});db[_0xbd21('0x4c')][_0xbd21('0x152')](db[_0xbd21('0xef')],{'as':_0xbd21('0xef'),'foreignKey':_0xbd21('0x180')});db[_0xbd21('0x4c')][_0xbd21('0x152')](db[_0xbd21('0x46')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x17a')});db[_0xbd21('0x4e')][_0xbd21('0x11f')](db['User'],{'as':_0xbd21('0x156'),'through':_0xbd21('0x31')});db[_0xbd21('0x4e')]['belongsToMany'](db[_0xbd21('0xe7')],{'through':_0xbd21('0x181'),'as':_0xbd21('0x157')});db['FaxQueueReport'][_0xbd21('0x152')](db[_0xbd21('0x46')],{});db[_0xbd21('0x50')][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':'List','foreignKey':_0xbd21('0x178')});db['FaxQueueReport'][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x50')][_0xbd21('0x152')](db[_0xbd21('0x4a')],{});db['FaxQueueReport'][_0xbd21('0x152')](db[_0xbd21('0x4c')],{});db[_0xbd21('0x50')][_0xbd21('0x152')](db['User'],{});db['FaxQueueReport'][_0xbd21('0x152')](db[_0xbd21('0x4e')],{});db[_0xbd21('0x141')][_0xbd21('0x110')](db[_0xbd21('0x7a')],{'as':_0xbd21('0x165'),'foreignKey':_0xbd21('0x182'),'onDelete':'cascade'});db[_0xbd21('0x141')][_0xbd21('0x110')](db[_0xbd21('0x79')],{'as':_0xbd21('0x166'),'foreignKey':_0xbd21('0x182')});db[_0xbd21('0x141')][_0xbd21('0x110')](db['SmsMessage'],{'as':_0xbd21('0x15b'),'foreignKey':_0xbd21('0x182')});db[_0xbd21('0x141')][_0xbd21('0x110')](db['SmsInteraction'],{'as':_0xbd21('0x17b')});db[_0xbd21('0x141')][_0xbd21('0x110')](db['SmsApplication'],{'as':'Applications','foreignKey':'SmsAccountId','onDelete':'cascade'});db['SmsAccount'][_0xbd21('0x152')](db['CmList'],{'as':'List','foreignKey':_0xbd21('0x178')});db[_0xbd21('0x141')][_0xbd21('0x152')](db['Pause'],{'as':_0xbd21('0x183'),'foreignKey':_0xbd21('0x154')});db[_0xbd21('0x141')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x156'),'through':_0xbd21('0x143')});db[_0xbd21('0x52')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'onDelete':_0xbd21('0x162')});db[_0xbd21('0x52')]['belongsTo'](db[_0xbd21('0x184')],{'onDelete':'restrict'});db[_0xbd21('0x52')]['belongsTo'](db[_0xbd21('0x141')],{'onDelete':_0xbd21('0x162')});db['SmsApplication'][_0xbd21('0x152')](db[_0xbd21('0x7e')],{'onDelete':_0xbd21('0x162'),'foreignKey':_0xbd21('0x153')});db['SmsApplication'][_0xbd21('0x152')](db['Tag'],{'onDelete':_0xbd21('0x162'),'foreignKey':_0xbd21('0x176')});db['SmsInteraction']['hasMany'](db[_0xbd21('0x185')],{'as':_0xbd21('0x15b'),'onDelete':'cascade','foreignKey':_0xbd21('0x186')});db[_0xbd21('0x54')][_0xbd21('0x152')](db[_0xbd21('0x141')],{'as':_0xbd21('0x16a'),'foreignKey':'SmsAccountId'});db[_0xbd21('0x54')]['belongsTo'](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':'ContactId'});db[_0xbd21('0x54')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':'Owner','foreignKey':'UserId'});db[_0xbd21('0x54')][_0xbd21('0x11f')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0xbd21('0x187')});db[_0xbd21('0x54')][_0xbd21('0x11f')](db['Tag'],{'through':_0xbd21('0x188'),'as':_0xbd21('0x170')});db[_0xbd21('0x54')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x17f'),'through':_0xbd21('0x12d'),'foreignKey':_0xbd21('0x186')});db['SmsMessage']['belongsTo'](db['User'],{'as':_0xbd21('0xf')});db['SmsMessage'][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0x16c')});db[_0xbd21('0x185')][_0xbd21('0x152')](db['SmsInteraction'],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0x173'),'foreignKey':_0xbd21('0x186')});db['SmsMessage'][_0xbd21('0x152')](db[_0xbd21('0x141')],{'as':_0xbd21('0x16a'),'foreignKey':'SmsAccountId'});db['SmsQueue']['belongsToMany'](db[_0xbd21('0xf')],{'as':_0xbd21('0x156'),'through':'UserSmsQueue','foreignKey':_0xbd21('0x189')});db[_0xbd21('0x184')][_0xbd21('0x11f')](db['Team'],{'through':_0xbd21('0x18a'),'as':_0xbd21('0x157')});db['OpenchannelAccount'][_0xbd21('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0xbd21('0x10d')});db[_0xbd21('0x13f')][_0xbd21('0x110')](db[_0xbd21('0x79')],{'as':_0xbd21('0x166'),'foreignKey':_0xbd21('0x18b')});db[_0xbd21('0x13f')][_0xbd21('0x110')](db[_0xbd21('0x59')],{'as':'Interactions','foreignKey':_0xbd21('0x18b')});db[_0xbd21('0x13f')][_0xbd21('0x110')](db['OpenchannelMessage'],{'as':_0xbd21('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0xbd21('0x13f')][_0xbd21('0x110')](db[_0xbd21('0x57')],{'as':_0xbd21('0x167'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db[_0xbd21('0x13f')]['belongsTo'](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178')});db[_0xbd21('0x13f')]['belongsTo'](db['Pause'],{'as':_0xbd21('0x183'),'foreignKey':_0xbd21('0x154')});db[_0xbd21('0x13f')]['belongsToMany'](db[_0xbd21('0xf')],{'as':_0xbd21('0x156'),'through':'user_has_openchannel_accounts'});db[_0xbd21('0x57')][_0xbd21('0x152')](db['User'],{'onDelete':_0xbd21('0x162')});db[_0xbd21('0x57')][_0xbd21('0x152')](db[_0xbd21('0x5d')],{'onDelete':'restrict','foreignKey':_0xbd21('0x18c')});db[_0xbd21('0x57')]['belongsTo'](db[_0xbd21('0x13f')],{'onDelete':'restrict','foreignKey':_0xbd21('0x18b')});db[_0xbd21('0x57')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xbd21('0x57')]['belongsTo'](db[_0xbd21('0x16f')],{'onDelete':_0xbd21('0x162'),'foreignKey':_0xbd21('0x176')});db[_0xbd21('0x59')][_0xbd21('0x110')](db[_0xbd21('0x5b')],{'as':'Messages','onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x18d')});db[_0xbd21('0x59')][_0xbd21('0x152')](db[_0xbd21('0x13f')],{'as':'Account','foreignKey':_0xbd21('0x18b')});db['OpenchannelInteraction'][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x59')]['belongsTo'](db[_0xbd21('0xf')],{'as':_0xbd21('0x16d'),'foreignKey':_0xbd21('0x111')});db['OpenchannelInteraction'][_0xbd21('0x11f')](db['Tag'],{'through':_0xbd21('0x18e'),'as':_0xbd21('0x187')});db[_0xbd21('0x59')][_0xbd21('0x11f')](db[_0xbd21('0x16f')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0xbd21('0x59')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x17f'),'through':_0xbd21('0x12e'),'foreignKey':_0xbd21('0x18d')});db[_0xbd21('0x5b')][_0xbd21('0x152')](db['User'],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0xf')});db[_0xbd21('0x5b')][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'onDelete':'cascade','as':_0xbd21('0x16c')});db[_0xbd21('0x5b')][_0xbd21('0x152')](db['OpenchannelInteraction'],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0x173'),'foreignKey':_0xbd21('0x18d')});db[_0xbd21('0x5b')][_0xbd21('0x152')](db[_0xbd21('0xef')],{'as':_0xbd21('0xef'),'foreignKey':_0xbd21('0x180')});db[_0xbd21('0x5b')][_0xbd21('0x152')](db[_0xbd21('0x13f')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x18b')});db[_0xbd21('0x5d')]['belongsToMany'](db[_0xbd21('0xf')],{'as':_0xbd21('0x156'),'through':_0xbd21('0x18f'),'foreignKey':'OpenchannelQueueId'});db[_0xbd21('0x5d')][_0xbd21('0x11f')](db[_0xbd21('0xe7')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0xbd21('0x139')][_0xbd21('0x110')](db[_0xbd21('0x7a')],{'as':'Dispositions','foreignKey':'ChatWebsiteId','onDelete':_0xbd21('0x10d')});db['ChatWebsite']['hasMany'](db[_0xbd21('0x79')],{'as':'Answers','foreignKey':_0xbd21('0x174')});db[_0xbd21('0x139')][_0xbd21('0x110')](db['ChatProactiveAction'],{'as':_0xbd21('0x190')});db[_0xbd21('0x139')][_0xbd21('0x110')](db[_0xbd21('0x62')],{'as':_0xbd21('0x17b')});db[_0xbd21('0x139')][_0xbd21('0x110')](db['ChatApplication'],{'as':'Applications','foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0xbd21('0x139')]['hasMany'](db['ChatMessage'],{'as':_0xbd21('0x15b')});db['ChatWebsite'][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178')});db['ChatWebsite'][_0xbd21('0x152')](db['Interval'],{'as':_0xbd21('0x7e'),'foreignKey':'IntervalId'});db[_0xbd21('0x139')]['belongsTo'](db[_0xbd21('0x3a')],{'as':_0xbd21('0x3a'),'foreignKey':'MailAccountId'});db[_0xbd21('0x139')][_0xbd21('0x152')](db[_0xbd21('0x80')],{'as':_0xbd21('0x183'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xbd21('0x139')][_0xbd21('0x11f')](db['User'],{'as':_0xbd21('0x156'),'through':_0xbd21('0x191')});db[_0xbd21('0x5f')][_0xbd21('0x152')](db[_0xbd21('0x13f')],{});db[_0xbd21('0x5f')][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':'List','foreignKey':_0xbd21('0x178')});db['OpenchannelQueueReport']['belongsTo'](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':'ContactId'});db[_0xbd21('0x5f')][_0xbd21('0x152')](db[_0xbd21('0x59')],{});db[_0xbd21('0x5f')]['belongsTo'](db[_0xbd21('0x5b')],{});db[_0xbd21('0x5f')]['belongsTo'](db[_0xbd21('0xf')],{});db[_0xbd21('0x5f')]['belongsTo'](db[_0xbd21('0x5d')],{});db[_0xbd21('0x60')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':_0xbd21('0x192'),'foreignKey':_0xbd21('0x111'),'onDelete':_0xbd21('0x162')});db[_0xbd21('0x60')][_0xbd21('0x152')](db[_0xbd21('0x66')],{'as':_0xbd21('0x193'),'foreignKey':_0xbd21('0x194'),'onDelete':_0xbd21('0x162')});db[_0xbd21('0x60')][_0xbd21('0x152')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xbd21('0x174'),'onDelete':_0xbd21('0x162')});db['ChatApplication']['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0xbd21('0x176')});db[_0xbd21('0x62')][_0xbd21('0x110')](db[_0xbd21('0x195')],{'as':'Messages','onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x196')});db[_0xbd21('0x62')]['belongsTo'](db[_0xbd21('0x139')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x174')});db[_0xbd21('0x62')]['belongsTo'](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x62')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':_0xbd21('0x16d'),'foreignKey':'UserId'});db[_0xbd21('0x62')][_0xbd21('0x11f')](db[_0xbd21('0x16f')],{'through':_0xbd21('0x197'),'as':_0xbd21('0x187')});db[_0xbd21('0x62')][_0xbd21('0x11f')](db['Tag'],{'through':_0xbd21('0x197'),'as':_0xbd21('0x170')});db['ChatInteraction'][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x17f'),'through':_0xbd21('0x12a'),'foreignKey':_0xbd21('0x196')});db[_0xbd21('0x195')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0xf')});db[_0xbd21('0x195')]['belongsTo'](db[_0xbd21('0x16b')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x195')][_0xbd21('0x152')](db[_0xbd21('0x62')],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0x173'),'foreignKey':_0xbd21('0x196')});db[_0xbd21('0x195')][_0xbd21('0x152')](db[_0xbd21('0xef')],{'as':_0xbd21('0xef'),'foreignKey':_0xbd21('0x180')});db[_0xbd21('0x195')]['belongsTo'](db[_0xbd21('0x139')],{'as':_0xbd21('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0xbd21('0x64')][_0xbd21('0x110')](db[_0xbd21('0xef')],{'as':_0xbd21('0x172'),'foreignKey':_0xbd21('0x175'),'onDelete':'cascade','hooks':!![]});db[_0xbd21('0x64')][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x64')][_0xbd21('0x152')](db['ChatWebsite'],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x174')});db['ChatQueue'][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0xbd21('0x66')]['belongsToMany'](db['Team'],{'through':_0xbd21('0x198'),'as':'Teams'});db['ChatGroup'][_0xbd21('0x110')](db[_0xbd21('0xd1')],{'as':_0xbd21('0x15b'),'foreignKey':_0xbd21('0x199'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x68')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x14a'),'through':'chat_group_has_users'});db[_0xbd21('0x6a')][_0xbd21('0x152')](db[_0xbd21('0x139')],{'as':_0xbd21('0x19a'),'foreignKey':_0xbd21('0x174')});db[_0xbd21('0x6c')][_0xbd21('0x110')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x122'),'foreignKey':_0xbd21('0x19b')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db['CmContactHasItem'],{'as':_0xbd21('0x19c'),'foreignKey':'CmContactId'});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0x11c')],{'as':_0xbd21('0x19d'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0x114')],{'as':_0xbd21('0x115'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0x72')],{'as':_0xbd21('0x14c'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0x74')],{'as':'ReportAgentPreview','foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0xd6')],{'as':_0xbd21('0x14e'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0x59')],{'as':'OpenchannelInteractions','foreignKey':_0xbd21('0x15f'),'onDelete':_0xbd21('0x162')});db['CmContact'][_0xbd21('0x110')](db[_0xbd21('0x62')],{'as':_0xbd21('0x129'),'foreignKey':'ContactId','onDelete':_0xbd21('0x162')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0x54')],{'as':'SmsInteractions','foreignKey':_0xbd21('0x15f'),'onDelete':_0xbd21('0x162')});db[_0xbd21('0x16b')][_0xbd21('0x110')](db[_0xbd21('0x4a')],{'as':_0xbd21('0x117'),'foreignKey':_0xbd21('0x15f'),'onDelete':_0xbd21('0x162')});db[_0xbd21('0x16b')]['hasMany'](db[_0xbd21('0x118')],{'as':_0xbd21('0x119'),'foreignKey':'ContactId','onDelete':_0xbd21('0x162')});db[_0xbd21('0x16b')][_0xbd21('0x152')](db[_0xbd21('0x6c')],{'as':_0xbd21('0x19e'),'foreignKey':_0xbd21('0x19b')});db[_0xbd21('0x16b')][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x16b')][_0xbd21('0x11f')](db['User'],{'as':_0xbd21('0x17f'),'through':'cm_user_has_contacts'});db[_0xbd21('0x16b')]['belongsToMany'](db[_0xbd21('0x16f')],{'as':_0xbd21('0x187'),'through':_0xbd21('0x19f')});db['CmContact']['belongsToMany'](db[_0xbd21('0x16f')],{'through':'cm_contact_has_tags','as':_0xbd21('0x170')});db[_0xbd21('0x11c')]['hasMany'](db[_0xbd21('0x8c')],{'as':'AdditionalPhones','foreignKey':'CmHopperId'});db[_0xbd21('0x11c')][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xbd21('0x10d')});db[_0xbd21('0x11c')][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x11c')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':_0xbd21('0x192'),'foreignKey':_0xbd21('0x111')});db[_0xbd21('0x11c')][_0xbd21('0x152')](db['VoiceQueue'],{'as':_0xbd21('0x193'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xbd21('0x11c')]['belongsTo'](db['Campaign'],{'as':_0xbd21('0xeb'),'foreignKey':_0xbd21('0x1a0'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x11c')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':_0xbd21('0x16d'),'foreignKey':_0xbd21('0x1a1')});db[_0xbd21('0x6f')][_0xbd21('0x152')](db['CmContact'],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x6f')]['belongsTo'](db['CmList'],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x6f')][_0xbd21('0x152')](db[_0xbd21('0x18')],{'as':_0xbd21('0x193'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xbd21('0x6f')][_0xbd21('0x152')](db[_0xbd21('0xeb')],{'as':_0xbd21('0xeb'),'foreignKey':_0xbd21('0x1a0'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x77')][_0xbd21('0x110')](db[_0xbd21('0x7c')],{'as':{'plural':_0xbd21('0x1a2'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xbd21('0x77')][_0xbd21('0x110')](db[_0xbd21('0x7c')],{'as':{'plural':_0xbd21('0x1a3'),'singular':'OneAny'},'foreignKey':_0xbd21('0x1a4'),'onDelete':_0xbd21('0x10d'),'hooks':!![]});db[_0xbd21('0x77')]['hasMany'](db['Action'],{'as':_0xbd21('0x1a5'),'foreignKey':_0xbd21('0x1a6'),'onDelete':_0xbd21('0x10d'),'hooks':!![]});db[_0xbd21('0x7a')][_0xbd21('0x110')](db[_0xbd21('0x7a')],{'as':_0xbd21('0x165'),'foreignKey':_0xbd21('0x1a7'),'onDelete':'cascade'});db[_0xbd21('0x7e')][_0xbd21('0x110')](db[_0xbd21('0x7e')],{'as':_0xbd21('0x1a8'),'foreignKey':_0xbd21('0x153'),'onDelete':_0xbd21('0x10d'),'hooks':!![],'required':![]});db[_0xbd21('0x7e')][_0xbd21('0x110')](db[_0xbd21('0x15')],{'as':_0xbd21('0x113'),'foreignKey':'IntervalId','onDelete':_0xbd21('0x162')});db['Interval']['hasMany'](db[_0xbd21('0x3f')],{'as':'MailApplications','foreignKey':_0xbd21('0x153')});db['Interval'][_0xbd21('0x110')](db[_0xbd21('0x60')],{'as':_0xbd21('0x1a9'),'foreignKey':'IntervalId'});db[_0xbd21('0x7e')][_0xbd21('0x110')](db['FaxApplication'],{'as':_0xbd21('0x1aa'),'foreignKey':_0xbd21('0x153')});db[_0xbd21('0x7e')][_0xbd21('0x110')](db[_0xbd21('0x52')],{'as':_0xbd21('0x1ab'),'foreignKey':'IntervalId'});db[_0xbd21('0x85')][_0xbd21('0x152')](db[_0xbd21('0x3a')],{});db[_0xbd21('0x85')]['belongsTo'](db[_0xbd21('0x97')],{'foreignKey':_0xbd21('0x1ac')});db[_0xbd21('0x85')][_0xbd21('0x152')](db['AnalyticCustomReport'],{'foreignKey':_0xbd21('0x1ad')});db[_0xbd21('0x87')]['belongsToMany'](db[_0xbd21('0x148')],{'as':'Mohs','through':_0xbd21('0x149'),'onDelete':_0xbd21('0x162')});db['Tag'][_0xbd21('0x11f')](db[_0xbd21('0x16b')],{'through':_0xbd21('0x19f')});db[_0xbd21('0x16f')][_0xbd21('0x11f')](db[_0xbd21('0x62')],{'through':_0xbd21('0x197')});db[_0xbd21('0x16f')][_0xbd21('0x11f')](db[_0xbd21('0x118')],{'through':_0xbd21('0x16e')});db[_0xbd21('0x16f')]['belongsToMany'](db['SmsInteraction'],{'through':_0xbd21('0x188')});db['Tag'][_0xbd21('0x11f')](db[_0xbd21('0x4a')],{'through':'fax_interaction_has_tags'});db[_0xbd21('0x16f')][_0xbd21('0x11f')](db[_0xbd21('0x59')],{'through':_0xbd21('0x18e')});db[_0xbd21('0x16f')][_0xbd21('0x11f')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0xbd21('0x1ae')][_0xbd21('0x152')](db[_0xbd21('0x89')],{'as':_0xbd21('0x1af'),'foreignKey':_0xbd21('0x1b0')});db[_0xbd21('0x8c')][_0xbd21('0x152')](db[_0xbd21('0x11c')],{'as':_0xbd21('0x1b1'),'foreignKey':_0xbd21('0x1b2')});db['CmContactHasItem'][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x1b3')});db[_0xbd21('0x8f')][_0xbd21('0x110')](db[_0xbd21('0x7c')],{'as':{'plural':'AllConditions','singular':_0xbd21('0x1b4')},'foreignKey':'TriggerAllId','onDelete':_0xbd21('0x10d'),'hooks':!![]});db['Trigger'][_0xbd21('0x110')](db[_0xbd21('0x7c')],{'as':{'plural':_0xbd21('0x1b5'),'singular':_0xbd21('0x1b6')},'foreignKey':'TriggerAnyId','onDelete':_0xbd21('0x10d'),'hooks':!![]});db['Trigger'][_0xbd21('0x110')](db[_0xbd21('0x1b7')],{'as':_0xbd21('0x1a5'),'foreignKey':'TriggerId','onDelete':_0xbd21('0x10d'),'hooks':!![]});db[_0xbd21('0x1b8')][_0xbd21('0x110')](db['AnalyticFieldReport'],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xbd21('0x97')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1ac')});db[_0xbd21('0x99')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1ba')});db['AnalyticFieldReport'][_0xbd21('0x152')](db[_0xbd21('0x99')],{'foreignKey':_0xbd21('0x1ba')});db[_0xbd21('0x9e')][_0xbd21('0x110')](db[_0xbd21('0x1bb')],{'as':_0xbd21('0x1bc'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0x1bb')][_0xbd21('0x110')](db['SalesforceField'],{'as':_0xbd21('0x1be'),'onDelete':'cascade','foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0x1bb')]['hasMany'](db[_0xbd21('0xa1')],{'as':_0xbd21('0x1c0'),'onDelete':'cascade','foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0x1bb')][_0xbd21('0x110')](db[_0xbd21('0xa1')],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0x1bb')][_0xbd21('0x152')](db['SalesforceAccount'],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xa1')][_0xbd21('0x110')](db[_0xbd21('0xa1')],{'as':_0xbd21('0x1c3'),'foreignKey':'SubjectId'});db[_0xbd21('0xa1')][_0xbd21('0x110')](db[_0xbd21('0xa1')],{'as':'Description','foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xa1')][_0xbd21('0x110')](db[_0xbd21('0xa1')],{'as':'Field','foreignKey':'FieldId'});db[_0xbd21('0xa1')][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':'VariableId'});db[_0xbd21('0xa3')][_0xbd21('0x110')](db[_0xbd21('0xa5')],{'as':_0xbd21('0x1bc'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xa5')][_0xbd21('0x110')](db[_0xbd21('0xa7')],{'as':'Subjects','onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0xa5')]['hasMany'](db['SugarcrmField'],{'as':_0xbd21('0x1c0'),'onDelete':'cascade','foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xa5')][_0xbd21('0x110')](db[_0xbd21('0xa7')],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c2')});db['SugarcrmConfiguration'][_0xbd21('0x152')](db[_0xbd21('0xa3')],{'as':_0xbd21('0x16a'),'foreignKey':'AccountId'});db['SugarcrmField'][_0xbd21('0x110')](db[_0xbd21('0xa7')],{'as':_0xbd21('0x1c3'),'foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0xa7')][_0xbd21('0x110')](db[_0xbd21('0xa7')],{'as':'Description','foreignKey':_0xbd21('0x1c1')});db['SugarcrmField'][_0xbd21('0x110')](db['SugarcrmField'],{'as':_0xbd21('0x1c4'),'foreignKey':'FieldId'});db[_0xbd21('0xa7')][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':_0xbd21('0x1c5')});db['DeskAccount']['hasMany'](db[_0xbd21('0xaa')],{'as':_0xbd21('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xbd21('0xaa')][_0xbd21('0x110')](db[_0xbd21('0xab')],{'as':_0xbd21('0x1be'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0xaa')]['hasMany'](db[_0xbd21('0xab')],{'as':_0xbd21('0x1c0'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xaa')][_0xbd21('0x110')](db[_0xbd21('0xab')],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':'FieldId'});db[_0xbd21('0xaa')][_0xbd21('0x152')](db[_0xbd21('0xa8')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x1bd')});db['DeskConfiguration'][_0xbd21('0x11f')](db['Tag'],{'through':_0xbd21('0x1c6')});db['DeskField'][_0xbd21('0x110')](db[_0xbd21('0xab')],{'as':_0xbd21('0x1c3'),'foreignKey':_0xbd21('0x1bf')});db['DeskField'][_0xbd21('0x110')](db[_0xbd21('0xab')],{'as':_0xbd21('0x1c7'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xab')][_0xbd21('0x110')](db['DeskField'],{'as':_0xbd21('0x1c4'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0xab')][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':'Variable','foreignKey':_0xbd21('0x1c5')});db['ZohoAccount'][_0xbd21('0x110')](db[_0xbd21('0xaf')],{'as':_0xbd21('0x1bc'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xaf')][_0xbd21('0x110')](db[_0xbd21('0xb1')],{'as':_0xbd21('0x1be'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xbd21('0xaf')][_0xbd21('0x110')](db[_0xbd21('0xb1')],{'as':_0xbd21('0x1c0'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c1')});db['ZohoConfiguration'][_0xbd21('0x110')](db['ZohoField'],{'as':'Fields','onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c2')});db['ZohoConfiguration'][_0xbd21('0x152')](db[_0xbd21('0xad')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xb1')]['hasMany'](db[_0xbd21('0xb1')],{'as':_0xbd21('0x1c3'),'foreignKey':'SubjectId'});db[_0xbd21('0xb1')][_0xbd21('0x110')](db[_0xbd21('0xb1')],{'as':_0xbd21('0x1c7'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xb1')][_0xbd21('0x110')](db['ZohoField'],{'as':'Field','foreignKey':'FieldId'});db[_0xbd21('0xb1')][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':'VariableId'});db[_0xbd21('0xb3')][_0xbd21('0x110')](db[_0xbd21('0xb5')],{'as':_0xbd21('0x1bc'),'onDelete':'cascade','foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xb5')][_0xbd21('0x110')](db[_0xbd21('0xb7')],{'as':_0xbd21('0x1be'),'foreignKey':'SubjectId'});db[_0xbd21('0xb5')][_0xbd21('0x110')](db[_0xbd21('0xb7')],{'as':_0xbd21('0x1c0'),'foreignKey':_0xbd21('0x1c1')});db['ZendeskConfiguration']['hasMany'](db[_0xbd21('0xb7')],{'as':'Fields','foreignKey':'FieldId'});db[_0xbd21('0xb5')]['belongsTo'](db[_0xbd21('0xb3')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xb5')]['belongsToMany'](db[_0xbd21('0x16f')],{'through':'int_zendesk_configuration_has_tags'});db[_0xbd21('0xb7')]['hasMany'](db[_0xbd21('0xb7')],{'as':_0xbd21('0x1c3'),'foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0xb7')][_0xbd21('0x110')](db[_0xbd21('0xb7')],{'as':_0xbd21('0x1c7'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xb7')]['hasMany'](db[_0xbd21('0xb7')],{'as':_0xbd21('0x1c4'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0xb7')][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':_0xbd21('0x1c5')});db[_0xbd21('0xb9')][_0xbd21('0x110')](db[_0xbd21('0xbb')],{'as':_0xbd21('0x1bc'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xbd21('0xbb')][_0xbd21('0x110')](db[_0xbd21('0xbd')],{'as':_0xbd21('0x1be'),'onDelete':_0xbd21('0x10d'),'foreignKey':'SubjectId'});db[_0xbd21('0xbb')]['hasMany'](db[_0xbd21('0xbd')],{'as':_0xbd21('0x1c0'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xbb')][_0xbd21('0x110')](db['FreshdeskField'],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0xbb')][_0xbd21('0x152')](db[_0xbd21('0xb9')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xbb')][_0xbd21('0x11f')](db[_0xbd21('0x16f')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xbd21('0xbd')][_0xbd21('0x110')](db[_0xbd21('0xbd')],{'as':_0xbd21('0x1c3'),'foreignKey':'SubjectId'});db[_0xbd21('0xbd')][_0xbd21('0x110')](db[_0xbd21('0xbd')],{'as':'Description','foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xbd')][_0xbd21('0x110')](db['FreshdeskField'],{'as':_0xbd21('0x1c4'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0xbd')][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':'VariableId'});db[_0xbd21('0xbf')]['hasMany'](db[_0xbd21('0x1c8')],{'as':_0xbd21('0x1bc'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bd')});db['VtigerConfiguration'][_0xbd21('0x110')](db['VtigerField'],{'as':_0xbd21('0x1be'),'foreignKey':'SubjectId'});db[_0xbd21('0x1c8')][_0xbd21('0x110')](db[_0xbd21('0x1c9')],{'as':'Descriptions','foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0x1c8')]['hasMany'](db['VtigerField'],{'as':'Fields','foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0x1c8')]['belongsTo'](db[_0xbd21('0xbf')],{'as':'Account','foreignKey':'AccountId'});db[_0xbd21('0x1c9')][_0xbd21('0x110')](db[_0xbd21('0x1c9')],{'as':_0xbd21('0x1c3'),'foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0x1c9')][_0xbd21('0x110')](db[_0xbd21('0x1c9')],{'as':_0xbd21('0x1c7'),'foreignKey':'DescriptionId'});db[_0xbd21('0x1c9')]['hasMany'](db[_0xbd21('0x1c9')],{'as':_0xbd21('0x1c4'),'foreignKey':_0xbd21('0x1c2')});db['VtigerField'][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':_0xbd21('0x1c5')});db[_0xbd21('0xc2')][_0xbd21('0x110')](db['ServicenowConfiguration'],{'as':_0xbd21('0x1bc'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0x1ca')]['hasMany'](db[_0xbd21('0xc3')],{'as':_0xbd21('0x1be'),'foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0x1ca')][_0xbd21('0x110')](db[_0xbd21('0xc3')],{'as':_0xbd21('0x1c0'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0x1ca')]['hasMany'](db['ServicenowField'],{'as':_0xbd21('0x1b9'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0x1ca')]['belongsTo'](db[_0xbd21('0xc2')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xc3')][_0xbd21('0x110')](db['ServicenowField'],{'as':_0xbd21('0x1c3'),'foreignKey':_0xbd21('0x1bf')});db[_0xbd21('0xc3')][_0xbd21('0x110')](db[_0xbd21('0xc3')],{'as':_0xbd21('0x1c7'),'foreignKey':_0xbd21('0x1c1')});db['ServicenowField'][_0xbd21('0x110')](db['ServicenowField'],{'as':_0xbd21('0x1c4'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0xc3')]['belongsTo'](db[_0xbd21('0x91')],{'as':'Variable','foreignKey':'VariableId'});db[_0xbd21('0xc4')][_0xbd21('0x110')](db[_0xbd21('0xc6')],{'as':_0xbd21('0x1bc'),'onDelete':_0xbd21('0x10d'),'foreignKey':'AccountId'});db['Dynamics365Account'][_0xbd21('0x152')](db[_0xbd21('0x104')],{'as':_0xbd21('0x104'),'foreignKey':_0xbd21('0x161')});db['Dynamics365Configuration'][_0xbd21('0x110')](db[_0xbd21('0xc8')],{'as':'Subjects','onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1bf')});db['Dynamics365Configuration'][_0xbd21('0x110')](db['Dynamics365Field'],{'as':_0xbd21('0x1c0'),'onDelete':'cascade','foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xc6')]['hasMany'](db[_0xbd21('0xc8')],{'as':_0xbd21('0x1b9'),'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0xc6')]['belongsTo'](db[_0xbd21('0xc4')],{'as':'Account','foreignKey':_0xbd21('0x1bd')});db[_0xbd21('0xc8')]['hasMany'](db[_0xbd21('0xc8')],{'as':_0xbd21('0x1c3'),'foreignKey':'SubjectId'});db[_0xbd21('0xc8')][_0xbd21('0x110')](db['Dynamics365Field'],{'as':_0xbd21('0x1c7'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xc8')][_0xbd21('0x110')](db[_0xbd21('0xc8')],{'as':_0xbd21('0x1c4'),'foreignKey':_0xbd21('0x1c2')});db['Dynamics365Field'][_0xbd21('0x152')](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':_0xbd21('0x1c5')});db[_0xbd21('0xca')][_0xbd21('0x110')](db[_0xbd21('0x1cb')],{'as':_0xbd21('0x1bc'),'onDelete':_0xbd21('0x10d'),'foreignKey':'AccountId'});db[_0xbd21('0x1cb')]['hasMany'](db[_0xbd21('0xcd')],{'as':_0xbd21('0x1be'),'foreignKey':_0xbd21('0x1bf')});db['FreshsalesConfiguration']['hasMany'](db[_0xbd21('0xcd')],{'as':'Descriptions','foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0x1cb')][_0xbd21('0x110')](db[_0xbd21('0xcd')],{'as':_0xbd21('0x1b9'),'foreignKey':_0xbd21('0x1c2')});db[_0xbd21('0x1cb')][_0xbd21('0x152')](db[_0xbd21('0xca')],{'as':_0xbd21('0x16a'),'foreignKey':'AccountId'});db[_0xbd21('0xcd')][_0xbd21('0x110')](db[_0xbd21('0xcd')],{'as':'Subject','foreignKey':_0xbd21('0x1bf')});db['FreshsalesField']['hasMany'](db[_0xbd21('0xcd')],{'as':_0xbd21('0x1c7'),'foreignKey':_0xbd21('0x1c1')});db[_0xbd21('0xcd')][_0xbd21('0x110')](db[_0xbd21('0xcd')],{'as':_0xbd21('0x1c4'),'foreignKey':_0xbd21('0x1c2')});db['FreshsalesField']['belongsTo'](db[_0xbd21('0x91')],{'as':_0xbd21('0x91'),'foreignKey':_0xbd21('0x1c5')});db[_0xbd21('0x1cc')][_0xbd21('0x152')](db['ChatWebsite'],{});db[_0xbd21('0x1cc')][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178')});db['ChatQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xbd21('0x15f')});db['ChatQueueReport'][_0xbd21('0x152')](db[_0xbd21('0x62')],{});db[_0xbd21('0x1cc')][_0xbd21('0x152')](db[_0xbd21('0x195')],{});db['ChatQueueReport']['belongsTo'](db[_0xbd21('0xf')],{});db[_0xbd21('0x1cc')][_0xbd21('0x152')](db[_0xbd21('0x66')],{});db['ChatInternalMessage'][_0xbd21('0x152')](db[_0xbd21('0xf')],{'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1cd')});db['ChatInternalMessage'][_0xbd21('0x152')](db[_0xbd21('0xf')],{'onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x1ce')});db[_0xbd21('0xd6')][_0xbd21('0x110')](db[_0xbd21('0xd4')],{'foreignKey':'SessionId','onDelete':_0xbd21('0x10d')});db[_0xbd21('0xd6')]['hasMany'](db[_0xbd21('0x1cf')],{'foreignKey':_0xbd21('0x1d0'),'onDelete':_0xbd21('0x10d')});db['SmsQueueReport'][_0xbd21('0x152')](db[_0xbd21('0x141')],{});db['SmsQueueReport']['belongsTo'](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':'Contact','foreignKey':_0xbd21('0x15f')});db[_0xbd21('0xd8')][_0xbd21('0x152')](db[_0xbd21('0x54')],{});db[_0xbd21('0xd8')][_0xbd21('0x152')](db[_0xbd21('0x185')],{});db[_0xbd21('0xd8')][_0xbd21('0x152')](db[_0xbd21('0xf')],{});db['SmsQueueReport'][_0xbd21('0x152')](db['SmsQueue'],{});db[_0xbd21('0xdb')][_0xbd21('0x110')](db[_0xbd21('0xd6')],{'foreignKey':_0xbd21('0x1d1')});db[_0xbd21('0xdb')][_0xbd21('0x110')](db[_0xbd21('0xd4')],{'foreignKey':'ProjectId'});db[_0xbd21('0xdb')][_0xbd21('0x110')](db[_0xbd21('0x1cf')],{'foreignKey':_0xbd21('0x1d1')});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x156'),'through':_0xbd21('0x127')});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db[_0xbd21('0x18')],{'through':_0xbd21('0x158'),'as':_0xbd21('0x130')});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db[_0xbd21('0x132')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db[_0xbd21('0x66')],{'through':_0xbd21('0x198'),'as':_0xbd21('0x133')});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db[_0xbd21('0x4e')],{'through':'team_has_fax_queues','as':_0xbd21('0x134')});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db[_0xbd21('0x184')],{'through':_0xbd21('0x18a'),'as':_0xbd21('0x135')});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db[_0xbd21('0x5d')],{'through':_0xbd21('0x1d2'),'as':'OpenchannelQueues'});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db['WhatsappQueue'],{'through':_0xbd21('0x1d3'),'as':_0xbd21('0x138')});db[_0xbd21('0xe7')][_0xbd21('0x11f')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xbd21('0x131')});db[_0xbd21('0xeb')][_0xbd21('0x110')](db['CmHopper'],{'as':_0xbd21('0x19d'),'foreignKey':_0xbd21('0x1a0')});db[_0xbd21('0xeb')][_0xbd21('0x110')](db[_0xbd21('0x114')],{'as':_0xbd21('0x115'),'foreignKey':_0xbd21('0x1a0')});db[_0xbd21('0xeb')][_0xbd21('0x110')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xbd21('0xeb')][_0xbd21('0x110')](db[_0xbd21('0x6f')],{'as':_0xbd21('0x14d'),'foreignKey':_0xbd21('0x1a0')});db[_0xbd21('0xeb')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0xbd21('0x14f')});db[_0xbd21('0xeb')]['belongsTo'](db[_0xbd21('0x28')],{'as':_0xbd21('0x150'),'foreignKey':_0xbd21('0x151')});db[_0xbd21('0xeb')][_0xbd21('0x152')](db['Interval'],{'as':_0xbd21('0x7e'),'foreignKey':_0xbd21('0x153')});db[_0xbd21('0xeb')][_0xbd21('0x152')](db[_0xbd21('0xe1')],{'as':_0xbd21('0xe1'),'foreignKey':_0xbd21('0x1d4')});db['Campaign']['belongsToMany'](db['CmList'],{'as':_0xbd21('0x125'),'through':_0xbd21('0x1d5')});db[_0xbd21('0xeb')][_0xbd21('0x11f')](db['CmList'],{'as':_0xbd21('0x1d6'),'through':_0xbd21('0x1d7')});db['Attachment'][_0xbd21('0x152')](db[_0xbd21('0x64')],{'as':_0xbd21('0x64'),'foreignKey':_0xbd21('0x175')});db[_0xbd21('0x1d8')][_0xbd21('0x152')](db['MailMessage'],{});db[_0xbd21('0x1d8')][_0xbd21('0x152')](db[_0xbd21('0x118')],{});db[_0xbd21('0x1d8')][_0xbd21('0x152')](db[_0xbd21('0x3a')],{'foreignKey':_0xbd21('0x1d9'),'as':_0xbd21('0x1da')});db['MailTransferReport'][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1db'),'as':'FromAgent'});db[_0xbd21('0x1d8')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1dc'),'as':_0xbd21('0x1dd')});db[_0xbd21('0x1d8')][_0xbd21('0x152')](db[_0xbd21('0x132')],{'foreignKey':'ToMailQueueId','as':_0xbd21('0x1de')});db['MailTransferReport'][_0xbd21('0x152')](db[_0xbd21('0x3a')],{'foreignKey':'ToMailAccountId','as':_0xbd21('0x1df')});db[_0xbd21('0xf3')][_0xbd21('0x152')](db['ChatMessage'],{});db[_0xbd21('0xf3')]['belongsTo'](db[_0xbd21('0x62')],{});db[_0xbd21('0xf3')][_0xbd21('0x152')](db['ChatWebsite'],{'foreignKey':_0xbd21('0x1e0'),'as':'FromAccount'});db[_0xbd21('0xf3')]['belongsTo'](db['User'],{'foreignKey':_0xbd21('0x1db'),'as':_0xbd21('0x1e1')});db['ChatTransferReport'][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db['ChatTransferReport'][_0xbd21('0x152')](db[_0xbd21('0x66')],{'foreignKey':_0xbd21('0x1e2'),'as':_0xbd21('0x1de')});db['ChatTransferReport']['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xbd21('0x1e3'),'as':_0xbd21('0x1df')});db[_0xbd21('0xf4')]['belongsTo'](db[_0xbd21('0x4c')],{});db['FaxTransferReport'][_0xbd21('0x152')](db['FaxInteraction'],{});db[_0xbd21('0xf4')][_0xbd21('0x152')](db[_0xbd21('0x46')],{'foreignKey':'FromFaxAccountId','as':_0xbd21('0x1da')});db[_0xbd21('0xf4')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xbd21('0xf4')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1dc'),'as':_0xbd21('0x1dd')});db[_0xbd21('0xf4')][_0xbd21('0x152')](db[_0xbd21('0x4e')],{'foreignKey':_0xbd21('0x1e4'),'as':_0xbd21('0x1de')});db['FaxTransferReport'][_0xbd21('0x152')](db[_0xbd21('0x46')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db['OpenchannelTransferReport']['belongsTo'](db[_0xbd21('0x5b')],{});db[_0xbd21('0x1e5')]['belongsTo'](db[_0xbd21('0x59')],{});db[_0xbd21('0x1e5')][_0xbd21('0x152')](db[_0xbd21('0x13f')],{'foreignKey':_0xbd21('0x1e6'),'as':'FromAccount'});db['OpenchannelTransferReport'][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1db'),'as':'FromAgent'});db[_0xbd21('0x1e5')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1dc'),'as':'ToAgent'});db[_0xbd21('0x1e5')][_0xbd21('0x152')](db[_0xbd21('0x5d')],{'foreignKey':'ToOpenchannelQueueId','as':_0xbd21('0x1de')});db['OpenchannelTransferReport'][_0xbd21('0x152')](db['OpenchannelAccount'],{'foreignKey':_0xbd21('0x1e7'),'as':_0xbd21('0x1df')});db[_0xbd21('0x1e8')][_0xbd21('0x152')](db[_0xbd21('0x185')],{});db[_0xbd21('0x1e8')][_0xbd21('0x152')](db[_0xbd21('0x54')],{});db[_0xbd21('0x1e8')][_0xbd21('0x152')](db[_0xbd21('0x141')],{'foreignKey':_0xbd21('0x1e9'),'as':'FromAccount'});db[_0xbd21('0x1e8')]['belongsTo'](db['User'],{'foreignKey':_0xbd21('0x1db'),'as':'FromAgent'});db[_0xbd21('0x1e8')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1dc'),'as':_0xbd21('0x1dd')});db[_0xbd21('0x1e8')]['belongsTo'](db['SmsQueue'],{'foreignKey':'ToSmsQueueId','as':_0xbd21('0x1de')});db[_0xbd21('0x1e8')][_0xbd21('0x152')](db[_0xbd21('0x141')],{'foreignKey':'ToSmsAccountId','as':_0xbd21('0x1df')});db['CmList']['hasMany'](db['Disposition'],{'as':_0xbd21('0x165'),'foreignKey':'ListId','onDelete':_0xbd21('0x10d')});db['CmList'][_0xbd21('0x110')](db[_0xbd21('0x76')],{'as':'CustomFields','foreignKey':_0xbd21('0x178')});db[_0xbd21('0x124')]['hasMany'](db['CmContact'],{'as':'Contacts','onDelete':_0xbd21('0x10d'),'foreignKey':_0xbd21('0x178')});db[_0xbd21('0x124')]['hasMany'](db['CmHopperFinal'],{'as':_0xbd21('0x115'),'foreignKey':_0xbd21('0x178')});db['CmList']['hasMany'](db[_0xbd21('0x72')],{'as':_0xbd21('0x1ea'),'foreignKey':_0xbd21('0x178')});db[_0xbd21('0x124')][_0xbd21('0x110')](db[_0xbd21('0x74')],{'as':_0xbd21('0x74'),'foreignKey':'ListId'});db['CmList'][_0xbd21('0x11f')](db[_0xbd21('0x18')],{'as':_0xbd21('0x1eb'),'through':_0xbd21('0x155')});db[_0xbd21('0x124')]['belongsToMany'](db[_0xbd21('0xf')],{'as':_0xbd21('0x156'),'through':_0xbd21('0x126')});db[_0xbd21('0x1ec')][_0xbd21('0x110')](db[_0xbd21('0x15')],{'as':'Extensions','onDelete':_0xbd21('0x10d')});db[_0xbd21('0x1ec')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':'Agents','through':_0xbd21('0x108')});db[_0xbd21('0x1ec')][_0xbd21('0x11f')](db[_0xbd21('0xe7')],{'through':_0xbd21('0x106'),'as':_0xbd21('0x157')});db['UserProfile'][_0xbd21('0x110')](db[_0xbd21('0xf')],{'as':'Users','foreignKey':_0xbd21('0x11e')});db[_0xbd21('0xf8')][_0xbd21('0x110')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0xbd21('0x10d')});db[_0xbd21('0xf9')][_0xbd21('0x110')](db['UserProfileResource'],{'as':_0xbd21('0x1ed'),'foreignKey':_0xbd21('0x1ee'),'onDelete':_0xbd21('0x10d')});db['WhatsappAccount']['hasMany'](db['Disposition'],{'as':_0xbd21('0x165'),'foreignKey':_0xbd21('0x1ef'),'onDelete':_0xbd21('0x10d')});db[_0xbd21('0x144')]['hasMany'](db[_0xbd21('0x79')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0xbd21('0x144')][_0xbd21('0x110')](db[_0xbd21('0xff')],{'as':_0xbd21('0x15b'),'foreignKey':_0xbd21('0x1ef')});db[_0xbd21('0x144')][_0xbd21('0x110')](db[_0xbd21('0x11a')],{'as':_0xbd21('0x17b')});db[_0xbd21('0x144')][_0xbd21('0x110')](db[_0xbd21('0xfd')],{'as':_0xbd21('0x167'),'foreignKey':_0xbd21('0x1ef'),'onDelete':'cascade'});db[_0xbd21('0x144')][_0xbd21('0x152')](db[_0xbd21('0x124')],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178')});db[_0xbd21('0x144')][_0xbd21('0x152')](db[_0xbd21('0x80')],{'as':_0xbd21('0x183'),'foreignKey':_0xbd21('0x154')});db[_0xbd21('0x144')][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x156'),'through':_0xbd21('0x146')});db[_0xbd21('0xfd')]['belongsTo'](db[_0xbd21('0xf')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xbd21('0x152')](db[_0xbd21('0x137')],{'onDelete':_0xbd21('0x162')});db[_0xbd21('0xfd')]['belongsTo'](db[_0xbd21('0x144')],{'onDelete':_0xbd21('0x162')});db[_0xbd21('0xfd')][_0xbd21('0x152')](db[_0xbd21('0x7e')],{'onDelete':_0xbd21('0x162'),'foreignKey':_0xbd21('0x153')});db[_0xbd21('0xfd')][_0xbd21('0x152')](db[_0xbd21('0x16f')],{'onDelete':_0xbd21('0x162'),'foreignKey':'TagId'});db[_0xbd21('0x11a')][_0xbd21('0x110')](db['WhatsappMessage'],{'as':_0xbd21('0x15b'),'onDelete':_0xbd21('0x10d'),'foreignKey':'WhatsappInteractionId'});db[_0xbd21('0x11a')][_0xbd21('0x152')](db[_0xbd21('0x144')],{'as':'Account','foreignKey':_0xbd21('0x1ef')});db['WhatsappInteraction'][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x11a')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':_0xbd21('0x16d'),'foreignKey':_0xbd21('0x111')});db[_0xbd21('0x11a')]['belongsToMany'](db[_0xbd21('0x16f')],{'through':_0xbd21('0x1f0'),'as':_0xbd21('0x187')});db[_0xbd21('0x11a')][_0xbd21('0x11f')](db[_0xbd21('0x16f')],{'through':'whatsapp_interaction_has_tags','as':_0xbd21('0x170')});db['WhatsappInteraction'][_0xbd21('0x11f')](db[_0xbd21('0xf')],{'as':_0xbd21('0x17f'),'through':_0xbd21('0x12f'),'foreignKey':_0xbd21('0x1f1')});db['WhatsappMessage'][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':'User'});db[_0xbd21('0xff')][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'onDelete':'cascade','as':_0xbd21('0x16c')});db['WhatsappMessage'][_0xbd21('0x152')](db[_0xbd21('0x11a')],{'onDelete':_0xbd21('0x10d'),'as':_0xbd21('0x173'),'foreignKey':'WhatsappInteractionId'});db[_0xbd21('0xff')][_0xbd21('0x152')](db[_0xbd21('0x144')],{'as':_0xbd21('0x16a'),'foreignKey':_0xbd21('0x1ef')});db[_0xbd21('0x101')][_0xbd21('0x152')](db['WhatsappAccount'],{});db[_0xbd21('0x101')]['belongsTo'](db['CmList'],{'as':_0xbd21('0x177'),'foreignKey':_0xbd21('0x178')});db[_0xbd21('0x101')][_0xbd21('0x152')](db[_0xbd21('0x16b')],{'as':_0xbd21('0x16c'),'foreignKey':_0xbd21('0x15f')});db[_0xbd21('0x101')][_0xbd21('0x152')](db[_0xbd21('0x11a')],{});db[_0xbd21('0x101')]['belongsTo'](db[_0xbd21('0x137')],{});db[_0xbd21('0x101')][_0xbd21('0x152')](db[_0xbd21('0xff')],{});db[_0xbd21('0x101')][_0xbd21('0x152')](db[_0xbd21('0xf')],{});db[_0xbd21('0x1f2')][_0xbd21('0x152')](db[_0xbd21('0xff')],{});db[_0xbd21('0x1f2')][_0xbd21('0x152')](db[_0xbd21('0x11a')],{});db[_0xbd21('0x1f2')][_0xbd21('0x152')](db[_0xbd21('0x144')],{'foreignKey':_0xbd21('0x1f3'),'as':_0xbd21('0x1da')});db[_0xbd21('0x1f2')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xbd21('0x1f4'),'as':_0xbd21('0x1df')});db[_0xbd21('0x1f2')]['belongsTo'](db[_0xbd21('0x137')],{'foreignKey':_0xbd21('0x1f5'),'as':'ToQueue'});db[_0xbd21('0x1f2')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1db'),'as':_0xbd21('0x1e1')});db[_0xbd21('0x1f2')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'foreignKey':_0xbd21('0x1dc'),'as':_0xbd21('0x1dd')});db[_0xbd21('0x137')][_0xbd21('0x11f')](db['User'],{'as':_0xbd21('0x156'),'through':_0xbd21('0x35'),'foreignKey':_0xbd21('0x1f6')});db[_0xbd21('0x137')]['belongsToMany'](db[_0xbd21('0xe7')],{'through':_0xbd21('0x1d3'),'as':_0xbd21('0x157')});db[_0xbd21('0x10e')][_0xbd21('0x152')](db[_0xbd21('0xf')],{'as':_0xbd21('0x1f7'),'foreignKey':_0xbd21('0x111'),'onDelete':'cascade','hooks':!![]});db['CloudProvider'][_0xbd21('0x10b')](db[_0xbd21('0xc4')],{'as':_0xbd21('0xc4'),'onDelete':_0xbd21('0x162')});db[_0xbd21('0x104')][_0xbd21('0x10b')](db[_0xbd21('0x36')],{'as':_0xbd21('0x163'),'onDelete':_0xbd21('0x162')});db[_0xbd21('0x104')][_0xbd21('0x10b')](db[_0xbd21('0x38')],{'as':_0xbd21('0x164'),'onDelete':_0xbd21('0x162')});module[_0xbd21('0x1f8')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 51778a0..0a33a05 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe320=['/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','./api/userProfileSection','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/realtime','./api/realtime','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','./api/authGoogle','./api/authActiveDirectory','/api/jira','./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','/plugins','route','get','sendFile','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','./api/trigger','/api/variables','./api/variable','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport'];(function(_0x4d6e3f,_0x48e790){var _0x2f7002=function(_0x28fdaa){while(--_0x28fdaa){_0x4d6e3f['push'](_0x4d6e3f['shift']());}};_0x2f7002(++_0x48e790);}(_0xe320,0x174));var _0x0e32=function(_0xfb760d,_0x522b2a){_0xfb760d=_0xfb760d-0x0;var _0x3ece90=_0xe320[_0xfb760d];return _0x3ece90;};'use strict';var path=require(_0x0e32('0x0'));var express=require(_0x0e32('0x1'));var errors=require(_0x0e32('0x2'));var config=require(_0x0e32('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x0e32('0x4')];var clientSideLogs=require(_0x0e32('0x5'));exports[_0x0e32('0x6')]=function(_0x49c099){return setupLoggers(_0x49c099)['then'](function(){_0x49c099[_0x0e32('0x7')](_0x0e32('0x8'),require(_0x0e32('0x9')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa'),require(_0x0e32('0xb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc'),require('./api/voiceContext'));_0x49c099['use'](_0x0e32('0xd'),require(_0x0e32('0xe')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf'),require(_0x0e32('0x10')));_0x49c099[_0x0e32('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x11'),require(_0x0e32('0x12')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x13'),require(_0x0e32('0x14')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x15'),require(_0x0e32('0x16')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x17'),require(_0x0e32('0x18')));_0x49c099[_0x0e32('0x7')]('/api/voice/calls/reports',require(_0x0e32('0x19')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x1a'),require('./api/voiceDialReport'));_0x49c099['use'](_0x0e32('0x1b'),require(_0x0e32('0x1c')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x1d'),require(_0x0e32('0x1e')));_0x49c099[_0x0e32('0x7')]('/api/members/reports',require(_0x0e32('0x1f')));_0x49c099[_0x0e32('0x7')]('/api/trunks',require(_0x0e32('0x20')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x21'),require(_0x0e32('0x22')));_0x49c099['use'](_0x0e32('0x23'),require(_0x0e32('0x24')));_0x49c099['use'](_0x0e32('0x25'),require(_0x0e32('0x26')));_0x49c099[_0x0e32('0x7')]('/api/mail/queues',require(_0x0e32('0x27')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x28'),require(_0x0e32('0x29')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x2a'),require(_0x0e32('0x2b')));_0x49c099['use'](_0x0e32('0x2c'),require(_0x0e32('0x2d')));_0x49c099['use']('/api/mail/applications',require(_0x0e32('0x2e')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x2f'),require(_0x0e32('0x30')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x31'),require('./api/dashboard'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x32'),require('./api/dashboardItem'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x33'),require(_0x0e32('0x34')));_0x49c099[_0x0e32('0x7')]('/api/fax/applications',require(_0x0e32('0x35')));_0x49c099[_0x0e32('0x7')]('/api/fax/interactions',require('./api/faxInteraction'));_0x49c099['use'](_0x0e32('0x36'),require(_0x0e32('0x37')));_0x49c099['use'](_0x0e32('0x38'),require(_0x0e32('0x39')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3a'),require('./api/faxQueueReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3b'),require(_0x0e32('0x3c')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3d'),require(_0x0e32('0x3e')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x3f'),require(_0x0e32('0x40')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x41'),require('./api/smsMessage'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x42'),require(_0x0e32('0x43')));_0x49c099['use'](_0x0e32('0x44'),require(_0x0e32('0x45')));_0x49c099['use'](_0x0e32('0x46'),require(_0x0e32('0x47')));_0x49c099['use'](_0x0e32('0x48'),require(_0x0e32('0x49')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x4a'),require(_0x0e32('0x4b')));_0x49c099['use'](_0x0e32('0x4c'),require(_0x0e32('0x4d')));_0x49c099['use']('/api/chat/websites',require(_0x0e32('0x4e')));_0x49c099['use'](_0x0e32('0x4f'),require(_0x0e32('0x50')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x51'),require(_0x0e32('0x52')));_0x49c099[_0x0e32('0x7')]('/api/chat/interactions',require(_0x0e32('0x53')));_0x49c099[_0x0e32('0x7')]('/api/chat/messages',require(_0x0e32('0x54')));_0x49c099['use'](_0x0e32('0x55'),require(_0x0e32('0x56')));_0x49c099[_0x0e32('0x7')]('/api/chat/queues',require(_0x0e32('0x57')));_0x49c099[_0x0e32('0x7')]('/api/chat/groups',require(_0x0e32('0x58')));_0x49c099['use'](_0x0e32('0x59'),require(_0x0e32('0x5a')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x5b'),require(_0x0e32('0x5c')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x5d'),require(_0x0e32('0x5e')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x5f'),require(_0x0e32('0x60')));_0x49c099['use'](_0x0e32('0x61'),require(_0x0e32('0x62')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x63'),require('./api/cmHopperFinal'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x64'),require(_0x0e32('0x65')));_0x49c099['use'](_0x0e32('0x66'),require(_0x0e32('0x67')));_0x49c099[_0x0e32('0x7')]('/api/actions',require(_0x0e32('0x68')));_0x49c099['use'](_0x0e32('0x69'),require(_0x0e32('0x6a')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x6b'),require(_0x0e32('0x6c')));_0x49c099['use']('/api/dispositions',require(_0x0e32('0x6d')));_0x49c099['use'](_0x0e32('0x6e'),require('./api/condition'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x6f'),require('./api/interval'));_0x49c099[_0x0e32('0x7')]('/api/pauses',require(_0x0e32('0x70')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x71'),require(_0x0e32('0x72')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x73'),require('./api/voiceQueuesLog'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x74'),require(_0x0e32('0x75')));_0x49c099['use']('/api/sounds',require(_0x0e32('0x76')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x77'),require(_0x0e32('0x78')));_0x49c099['use']('/api/contact_item_types',require(_0x0e32('0x79')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x7a'),require(_0x0e32('0x7b')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x7c'),require(_0x0e32('0x7d')));_0x49c099['use']('/api/templates',require(_0x0e32('0x7e')));_0x49c099[_0x0e32('0x7')]('/api/triggers',require(_0x0e32('0x7f')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x80'),require(_0x0e32('0x81')));_0x49c099[_0x0e32('0x7')]('/api/integrations',require('./api/integration'));_0x49c099[_0x0e32('0x7')]('/api/integrations/reports',require(_0x0e32('0x82')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x83'),require('./api/analyticCustomReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x84'),require('./api/analyticDefaultReport'));_0x49c099['use'](_0x0e32('0x85'),require('./api/analyticExtractedReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x86'),require(_0x0e32('0x87')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x88'),require(_0x0e32('0x89')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x8a'),require('./api/analyticTreeReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x8b'),require(_0x0e32('0x8c')));_0x49c099['use'](_0x0e32('0x8d'),require('./api/intSalesforceConfiguration'));_0x49c099['use'](_0x0e32('0x8e'),require(_0x0e32('0x8f')));_0x49c099[_0x0e32('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x0e32('0x90')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x91'),require(_0x0e32('0x92')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x93'),require(_0x0e32('0x94')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x95'),require(_0x0e32('0x96')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x97'),require(_0x0e32('0x98')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x99'),require('./api/intDeskField'));_0x49c099[_0x0e32('0x7')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x49c099['use'](_0x0e32('0x9a'),require('./api/intZohoConfiguration'));_0x49c099['use'](_0x0e32('0x9b'),require(_0x0e32('0x9c')));_0x49c099['use']('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x49c099['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x49c099['use']('/api/integrations/zendesk/fields',require(_0x0e32('0x9d')));_0x49c099['use'](_0x0e32('0x9e'),require(_0x0e32('0x9f')));_0x49c099[_0x0e32('0x7')]('/api/integrations/freshdesk/configurations',require(_0x0e32('0xa0')));_0x49c099[_0x0e32('0x7')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa1'),require(_0x0e32('0xa2')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa3'),require(_0x0e32('0xa4')));_0x49c099[_0x0e32('0x7')]('/api/integrations/vtiger/fields',require(_0x0e32('0xa5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa6'),require(_0x0e32('0xa7')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xa8'),require('./api/intServicenowConfiguration'));_0x49c099['use'](_0x0e32('0xa9'),require('./api/intServicenowField'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xaa'),require(_0x0e32('0xab')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xac'),require(_0x0e32('0xad')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xae'),require(_0x0e32('0xaf')));_0x49c099['use']('/api/integrations/freshsales/accounts',require(_0x0e32('0xb0')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb1'),require(_0x0e32('0xb2')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb3'),require(_0x0e32('0xb4')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb5'),require('./api/network'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb6'),require(_0x0e32('0xb7')));_0x49c099['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xb8'),require(_0x0e32('0xb9')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xba'),require('./api/jscriptyQuestionReport'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xbb'),require(_0x0e32('0xbc')));_0x49c099['use'](_0x0e32('0xbd'),require(_0x0e32('0xbe')));_0x49c099['use'](_0x0e32('0xbf'),require(_0x0e32('0xc0')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc1'),require('./api/squareReportDetail'));_0x49c099[_0x0e32('0x7')]('/api/jscripty/projects',require(_0x0e32('0xc2')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc3'),require('./api/setting'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc4'),require(_0x0e32('0xc5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc6'),require(_0x0e32('0xc7')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xc8'),require(_0x0e32('0xc9')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xca'),require(_0x0e32('0xcb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xcc'),require(_0x0e32('0xcd')));_0x49c099['use'](_0x0e32('0xce'),require(_0x0e32('0xcf')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd0'),require(_0x0e32('0xd1')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd2'),require(_0x0e32('0xd3')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd4'),require(_0x0e32('0xd5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd6'),require(_0x0e32('0xd7')));_0x49c099[_0x0e32('0x7')]('/api/mail/reports/transfer',require(_0x0e32('0xd8')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xd9'),require(_0x0e32('0xda')));_0x49c099[_0x0e32('0x7')]('/api/fax/reports/transfer',require(_0x0e32('0xdb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xdc'),require(_0x0e32('0xdd')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xde'),require(_0x0e32('0xdf')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe0'),require('./api/cmList'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe1'),require(_0x0e32('0xe2')));_0x49c099[_0x0e32('0x7')]('/api/userProfiles',require(_0x0e32('0xe3')));_0x49c099[_0x0e32('0x7')]('/api/userProfile/sections',require(_0x0e32('0xe4')));_0x49c099[_0x0e32('0x7')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x49c099[_0x0e32('0x7')]('/api/userNotifications',require('./api/userNotification'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe5'),require(_0x0e32('0xe6')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe7'),require(_0x0e32('0xe8')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xe9'),require(_0x0e32('0xea')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xeb'),require(_0x0e32('0xec')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xed'),require(_0x0e32('0xee')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xef'),require(_0x0e32('0xf0')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf1'),require(_0x0e32('0xf2')));_0x49c099[_0x0e32('0x7')]('/api/cloudProviders',require('./api/cloudProvider'));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf3'),require(_0x0e32('0xf4')));_0x49c099[_0x0e32('0x7')]('/api/user-settings',require(_0x0e32('0xf5')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf6'),require(_0x0e32('0xf7')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xf8'),require(_0x0e32('0xf9')));_0x49c099[_0x0e32('0x7')]('/api/auth/google',require(_0x0e32('0xfa')));_0x49c099[_0x0e32('0x7')]('/api/auth/activedirectory',require(_0x0e32('0xfb')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xfc'),require(_0x0e32('0xfd')));_0x49c099[_0x0e32('0x7')](_0x0e32('0xfe'),require(_0x0e32('0xff')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x100'),require(_0x0e32('0x101')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x102'),require(_0x0e32('0x103')));_0x49c099[_0x0e32('0x7')](_0x0e32('0x104'),require(_0x0e32('0x105')));_0x49c099['use'](_0x0e32('0x106'),require('./api/webbar'));_0x49c099[_0x0e32('0x7')](_0x0e32('0x107'),clientSideLogs);_0x49c099['use'](_0x0e32('0x108'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x108'))));_0x49c099[_0x0e32('0x7')](_0x0e32('0x10c'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x10c'))));_0x49c099[_0x0e32('0x7')]('/demo',express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x10d'))));_0x49c099['use'](_0x0e32('0x10e'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],_0x0e32('0x10f'),_0x0e32('0x110'))));_0x49c099[_0x0e32('0x7')](_0x0e32('0x111'),express[_0x0e32('0x109')](path[_0x0e32('0x10a')](config[_0x0e32('0x10b')],'/server/files/plugins')));_0x49c099[_0x0e32('0x112')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x0e32('0x113')](errors[0x194]);_0x49c099[_0x0e32('0x112')]('/*')[_0x0e32('0x113')](function(_0x3cfd0b,_0x45015a){_0x45015a[_0x0e32('0x114')](path['resolve'](_0x49c099['get']('appPath')+_0x0e32('0x115')));});return _0x49c099;});}; \ No newline at end of file +var _0x7914=['./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','static','join','/apidoc','/www','/demo','root','/snippet','3.9.0','/plugins','/server/files/plugins','route','get','/index.html','express','./errors','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','use','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting'];(function(_0x19e291,_0x5052bc){var _0x5c816f=function(_0x4a9cdf){while(--_0x4a9cdf){_0x19e291['push'](_0x19e291['shift']());}};_0x5c816f(++_0x5052bc);}(_0x7914,0x136));var _0x4791=function(_0x5f0f2d,_0x2626a7){_0x5f0f2d=_0x5f0f2d-0x0;var _0x42bd75=_0x7914[_0x5f0f2d];return _0x42bd75;};'use strict';var path=require('path');var express=require(_0x4791('0x0'));var errors=require(_0x4791('0x1'));var config=require('./config/environment');var setupLoggers=require(_0x4791('0x2'))[_0x4791('0x3')];var clientSideLogs=require(_0x4791('0x4'));exports[_0x4791('0x5')]=function(_0x2bd076){return setupLoggers(_0x2bd076)[_0x4791('0x6')](function(){_0x2bd076['use'](_0x4791('0x7'),require(_0x4791('0x8')));_0x2bd076['use'](_0x4791('0x9'),require(_0x4791('0xa')));_0x2bd076[_0x4791('0xb')](_0x4791('0xc'),require('./api/voiceContext'));_0x2bd076['use'](_0x4791('0xd'),require('./api/voiceExtension'));_0x2bd076[_0x4791('0xb')](_0x4791('0xe'),require(_0x4791('0xf')));_0x2bd076[_0x4791('0xb')](_0x4791('0x10'),require(_0x4791('0x11')));_0x2bd076['use'](_0x4791('0x12'),require(_0x4791('0x13')));_0x2bd076['use'](_0x4791('0x14'),require(_0x4791('0x15')));_0x2bd076[_0x4791('0xb')](_0x4791('0x16'),require(_0x4791('0x17')));_0x2bd076[_0x4791('0xb')](_0x4791('0x18'),require('./api/voiceMailMessage'));_0x2bd076[_0x4791('0xb')](_0x4791('0x19'),require(_0x4791('0x1a')));_0x2bd076['use'](_0x4791('0x1b'),require(_0x4791('0x1c')));_0x2bd076[_0x4791('0xb')](_0x4791('0x1d'),require(_0x4791('0x1e')));_0x2bd076[_0x4791('0xb')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x2bd076['use'](_0x4791('0x1f'),require(_0x4791('0x20')));_0x2bd076['use']('/api/trunks',require(_0x4791('0x21')));_0x2bd076[_0x4791('0xb')](_0x4791('0x22'),require(_0x4791('0x23')));_0x2bd076[_0x4791('0xb')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x2bd076[_0x4791('0xb')](_0x4791('0x24'),require(_0x4791('0x25')));_0x2bd076['use'](_0x4791('0x26'),require(_0x4791('0x27')));_0x2bd076[_0x4791('0xb')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x2bd076[_0x4791('0xb')](_0x4791('0x28'),require(_0x4791('0x29')));_0x2bd076['use'](_0x4791('0x2a'),require('./api/mailMessage'));_0x2bd076['use'](_0x4791('0x2b'),require(_0x4791('0x2c')));_0x2bd076[_0x4791('0xb')](_0x4791('0x2d'),require(_0x4791('0x2e')));_0x2bd076[_0x4791('0xb')](_0x4791('0x2f'),require('./api/dashboard'));_0x2bd076[_0x4791('0xb')](_0x4791('0x30'),require(_0x4791('0x31')));_0x2bd076[_0x4791('0xb')]('/api/fax/accounts',require(_0x4791('0x32')));_0x2bd076['use']('/api/fax/applications',require(_0x4791('0x33')));_0x2bd076[_0x4791('0xb')]('/api/fax/interactions',require(_0x4791('0x34')));_0x2bd076[_0x4791('0xb')](_0x4791('0x35'),require(_0x4791('0x36')));_0x2bd076['use'](_0x4791('0x37'),require(_0x4791('0x38')));_0x2bd076[_0x4791('0xb')](_0x4791('0x39'),require('./api/faxQueueReport'));_0x2bd076[_0x4791('0xb')](_0x4791('0x3a'),require(_0x4791('0x3b')));_0x2bd076['use']('/api/sms/applications',require(_0x4791('0x3c')));_0x2bd076[_0x4791('0xb')]('/api/sms/interactions',require(_0x4791('0x3d')));_0x2bd076[_0x4791('0xb')]('/api/sms/messages',require(_0x4791('0x3e')));_0x2bd076[_0x4791('0xb')](_0x4791('0x3f'),require(_0x4791('0x40')));_0x2bd076['use']('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x2bd076[_0x4791('0xb')](_0x4791('0x41'),require(_0x4791('0x42')));_0x2bd076[_0x4791('0xb')]('/api/openchannel/interactions',require(_0x4791('0x43')));_0x2bd076['use']('/api/openchannel/messages',require('./api/openchannelMessage'));_0x2bd076[_0x4791('0xb')](_0x4791('0x44'),require(_0x4791('0x45')));_0x2bd076[_0x4791('0xb')](_0x4791('0x46'),require(_0x4791('0x47')));_0x2bd076[_0x4791('0xb')](_0x4791('0x48'),require(_0x4791('0x49')));_0x2bd076[_0x4791('0xb')](_0x4791('0x4a'),require(_0x4791('0x4b')));_0x2bd076[_0x4791('0xb')](_0x4791('0x4c'),require(_0x4791('0x4d')));_0x2bd076[_0x4791('0xb')](_0x4791('0x4e'),require(_0x4791('0x4f')));_0x2bd076[_0x4791('0xb')]('/api/chat/offline_messages',require(_0x4791('0x50')));_0x2bd076['use'](_0x4791('0x51'),require(_0x4791('0x52')));_0x2bd076['use'](_0x4791('0x53'),require(_0x4791('0x54')));_0x2bd076[_0x4791('0xb')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x2bd076[_0x4791('0xb')]('/api/cm/companies',require(_0x4791('0x55')));_0x2bd076[_0x4791('0xb')](_0x4791('0x56'),require(_0x4791('0x57')));_0x2bd076['use'](_0x4791('0x58'),require(_0x4791('0x59')));_0x2bd076[_0x4791('0xb')](_0x4791('0x5a'),require(_0x4791('0x5b')));_0x2bd076[_0x4791('0xb')](_0x4791('0x5c'),require(_0x4791('0x5d')));_0x2bd076[_0x4791('0xb')](_0x4791('0x5e'),require(_0x4791('0x5f')));_0x2bd076[_0x4791('0xb')](_0x4791('0x60'),require(_0x4791('0x61')));_0x2bd076[_0x4791('0xb')]('/api/actions',require(_0x4791('0x62')));_0x2bd076[_0x4791('0xb')](_0x4791('0x63'),require(_0x4791('0x64')));_0x2bd076[_0x4791('0xb')]('/api/canned_answers',require(_0x4791('0x65')));_0x2bd076[_0x4791('0xb')](_0x4791('0x66'),require(_0x4791('0x67')));_0x2bd076[_0x4791('0xb')](_0x4791('0x68'),require(_0x4791('0x69')));_0x2bd076[_0x4791('0xb')]('/api/intervals',require('./api/interval'));_0x2bd076[_0x4791('0xb')](_0x4791('0x6a'),require(_0x4791('0x6b')));_0x2bd076['use'](_0x4791('0x6c'),require('./api/cdr'));_0x2bd076[_0x4791('0xb')](_0x4791('0x6d'),require('./api/voiceQueuesLog'));_0x2bd076[_0x4791('0xb')](_0x4791('0x6e'),require(_0x4791('0x6f')));_0x2bd076['use'](_0x4791('0x70'),require(_0x4791('0x71')));_0x2bd076[_0x4791('0xb')](_0x4791('0x72'),require(_0x4791('0x73')));_0x2bd076[_0x4791('0xb')](_0x4791('0x74'),require('./api/contactItemType'));_0x2bd076[_0x4791('0xb')](_0x4791('0x75'),require(_0x4791('0x76')));_0x2bd076[_0x4791('0xb')](_0x4791('0x77'),require(_0x4791('0x78')));_0x2bd076['use']('/api/templates',require('./api/template'));_0x2bd076['use']('/api/triggers',require(_0x4791('0x79')));_0x2bd076[_0x4791('0xb')](_0x4791('0x7a'),require('./api/variable'));_0x2bd076['use']('/api/integrations',require(_0x4791('0x7b')));_0x2bd076['use'](_0x4791('0x7c'),require(_0x4791('0x7d')));_0x2bd076[_0x4791('0xb')](_0x4791('0x7e'),require('./api/analyticCustomReport'));_0x2bd076[_0x4791('0xb')](_0x4791('0x7f'),require(_0x4791('0x80')));_0x2bd076[_0x4791('0xb')](_0x4791('0x81'),require(_0x4791('0x82')));_0x2bd076[_0x4791('0xb')](_0x4791('0x83'),require(_0x4791('0x84')));_0x2bd076[_0x4791('0xb')](_0x4791('0x85'),require('./api/analyticFieldReport'));_0x2bd076[_0x4791('0xb')](_0x4791('0x86'),require(_0x4791('0x87')));_0x2bd076[_0x4791('0xb')](_0x4791('0x88'),require(_0x4791('0x89')));_0x2bd076['use'](_0x4791('0x8a'),require(_0x4791('0x8b')));_0x2bd076[_0x4791('0xb')](_0x4791('0x8c'),require(_0x4791('0x8d')));_0x2bd076[_0x4791('0xb')](_0x4791('0x8e'),require(_0x4791('0x8f')));_0x2bd076[_0x4791('0xb')](_0x4791('0x90'),require('./api/intSugarcrmConfiguration'));_0x2bd076[_0x4791('0xb')](_0x4791('0x91'),require(_0x4791('0x92')));_0x2bd076[_0x4791('0xb')]('/api/integrations/desk/accounts',require(_0x4791('0x93')));_0x2bd076[_0x4791('0xb')](_0x4791('0x94'),require(_0x4791('0x95')));_0x2bd076[_0x4791('0xb')](_0x4791('0x96'),require(_0x4791('0x97')));_0x2bd076[_0x4791('0xb')](_0x4791('0x98'),require('./api/intZohoAccount'));_0x2bd076[_0x4791('0xb')](_0x4791('0x99'),require(_0x4791('0x9a')));_0x2bd076[_0x4791('0xb')](_0x4791('0x9b'),require(_0x4791('0x9c')));_0x2bd076[_0x4791('0xb')](_0x4791('0x9d'),require(_0x4791('0x9e')));_0x2bd076[_0x4791('0xb')](_0x4791('0x9f'),require(_0x4791('0xa0')));_0x2bd076[_0x4791('0xb')]('/api/integrations/zendesk/fields',require(_0x4791('0xa1')));_0x2bd076[_0x4791('0xb')](_0x4791('0xa2'),require(_0x4791('0xa3')));_0x2bd076[_0x4791('0xb')](_0x4791('0xa4'),require(_0x4791('0xa5')));_0x2bd076[_0x4791('0xb')](_0x4791('0xa6'),require('./api/intFreshdeskField'));_0x2bd076[_0x4791('0xb')](_0x4791('0xa7'),require(_0x4791('0xa8')));_0x2bd076[_0x4791('0xb')](_0x4791('0xa9'),require(_0x4791('0xaa')));_0x2bd076[_0x4791('0xb')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x2bd076[_0x4791('0xb')](_0x4791('0xab'),require('./api/intServicenowAccount'));_0x2bd076['use'](_0x4791('0xac'),require(_0x4791('0xad')));_0x2bd076[_0x4791('0xb')]('/api/integrations/servicenow/fields',require(_0x4791('0xae')));_0x2bd076[_0x4791('0xb')]('/api/integrations/dynamics365/accounts',require(_0x4791('0xaf')));_0x2bd076[_0x4791('0xb')](_0x4791('0xb0'),require(_0x4791('0xb1')));_0x2bd076[_0x4791('0xb')](_0x4791('0xb2'),require(_0x4791('0xb3')));_0x2bd076['use'](_0x4791('0xb4'),require(_0x4791('0xb5')));_0x2bd076['use'](_0x4791('0xb6'),require('./api/intFreshsalesConfiguration'));_0x2bd076[_0x4791('0xb')]('/api/integrations/freshsales/fields',require(_0x4791('0xb7')));_0x2bd076[_0x4791('0xb')]('/api/networks',require(_0x4791('0xb8')));_0x2bd076[_0x4791('0xb')](_0x4791('0xb9'),require(_0x4791('0xba')));_0x2bd076['use'](_0x4791('0xbb'),require(_0x4791('0xbc')));_0x2bd076['use'](_0x4791('0xbd'),require('./api/jscriptyAnswerReport'));_0x2bd076[_0x4791('0xb')]('/api/jscripty/questions/reports',require(_0x4791('0xbe')));_0x2bd076[_0x4791('0xb')](_0x4791('0xbf'),require(_0x4791('0xc0')));_0x2bd076[_0x4791('0xb')]('/api/sms/reports/queue',require(_0x4791('0xc1')));_0x2bd076[_0x4791('0xb')](_0x4791('0xc2'),require(_0x4791('0xc3')));_0x2bd076['use'](_0x4791('0xc4'),require(_0x4791('0xc5')));_0x2bd076[_0x4791('0xb')](_0x4791('0xc6'),require('./api/jscriptyProject'));_0x2bd076['use'](_0x4791('0xc7'),require('./api/setting'));_0x2bd076[_0x4791('0xb')](_0x4791('0xc8'),require('./api/squareOdbc'));_0x2bd076[_0x4791('0xb')](_0x4791('0xc9'),require(_0x4791('0xca')));_0x2bd076[_0x4791('0xb')]('/api/square/recordings',require('./api/squareRecording'));_0x2bd076['use'](_0x4791('0xcb'),require(_0x4791('0xcc')));_0x2bd076[_0x4791('0xb')](_0x4791('0xcd'),require(_0x4791('0xce')));_0x2bd076['use'](_0x4791('0xcf'),require(_0x4791('0xd0')));_0x2bd076[_0x4791('0xb')](_0x4791('0xd1'),require('./api/campaign'));_0x2bd076[_0x4791('0xb')](_0x4791('0xd2'),require(_0x4791('0xd3')));_0x2bd076['use'](_0x4791('0xd4'),require(_0x4791('0xd5')));_0x2bd076[_0x4791('0xb')]('/api/plugins',require(_0x4791('0xd6')));_0x2bd076['use'](_0x4791('0xd7'),require('./api/mailTransferReport'));_0x2bd076[_0x4791('0xb')](_0x4791('0xd8'),require(_0x4791('0xd9')));_0x2bd076[_0x4791('0xb')](_0x4791('0xda'),require(_0x4791('0xdb')));_0x2bd076[_0x4791('0xb')](_0x4791('0xdc'),require('./api/openchannelTransferReport'));_0x2bd076['use']('/api/sms/reports/transfer',require(_0x4791('0xdd')));_0x2bd076['use'](_0x4791('0xde'),require(_0x4791('0xdf')));_0x2bd076[_0x4791('0xb')](_0x4791('0xe0'),require(_0x4791('0xe1')));_0x2bd076[_0x4791('0xb')](_0x4791('0xe2'),require(_0x4791('0xe3')));_0x2bd076[_0x4791('0xb')](_0x4791('0xe4'),require('./api/userProfileSection'));_0x2bd076['use'](_0x4791('0xe5'),require(_0x4791('0xe6')));_0x2bd076[_0x4791('0xb')](_0x4791('0xe7'),require(_0x4791('0xe8')));_0x2bd076[_0x4791('0xb')]('/api/whatsapp/accounts',require(_0x4791('0xe9')));_0x2bd076[_0x4791('0xb')]('/api/whatsapp/applications',require(_0x4791('0xea')));_0x2bd076[_0x4791('0xb')](_0x4791('0xeb'),require(_0x4791('0xec')));_0x2bd076[_0x4791('0xb')](_0x4791('0xed'),require(_0x4791('0xee')));_0x2bd076[_0x4791('0xb')](_0x4791('0xef'),require(_0x4791('0xf0')));_0x2bd076[_0x4791('0xb')]('/api/whatsapp/reports/transfer',require(_0x4791('0xf1')));_0x2bd076[_0x4791('0xb')](_0x4791('0xf2'),require(_0x4791('0xf3')));_0x2bd076[_0x4791('0xb')](_0x4791('0xf4'),require(_0x4791('0xf5')));_0x2bd076[_0x4791('0xb')](_0x4791('0xf6'),require(_0x4791('0xf7')));_0x2bd076[_0x4791('0xb')](_0x4791('0xf8'),require(_0x4791('0xf9')));_0x2bd076[_0x4791('0xb')]('/api/mail_interaction_has_tags',require(_0x4791('0xfa')));_0x2bd076[_0x4791('0xb')](_0x4791('0xfb'),require(_0x4791('0xfc')));_0x2bd076[_0x4791('0xb')](_0x4791('0xfd'),require(_0x4791('0xfe')));_0x2bd076[_0x4791('0xb')]('/api/auth/activedirectory',require(_0x4791('0xff')));_0x2bd076['use'](_0x4791('0x100'),require(_0x4791('0x101')));_0x2bd076[_0x4791('0xb')]('/api/rpc',require(_0x4791('0x102')));_0x2bd076[_0x4791('0xb')]('/api/version',require(_0x4791('0x103')));_0x2bd076[_0x4791('0xb')](_0x4791('0x104'),require(_0x4791('0x105')));_0x2bd076['use'](_0x4791('0x106'),require(_0x4791('0x107')));_0x2bd076[_0x4791('0xb')](_0x4791('0x108'),require(_0x4791('0x109')));_0x2bd076['use'](_0x4791('0x10a'),clientSideLogs);_0x2bd076[_0x4791('0xb')]('/apidoc',express[_0x4791('0x10b')](path[_0x4791('0x10c')](config['root'],_0x4791('0x10d'))));_0x2bd076['use'](_0x4791('0x10e'),express[_0x4791('0x10b')](path[_0x4791('0x10c')](config['root'],_0x4791('0x10e'))));_0x2bd076['use'](_0x4791('0x10f'),express[_0x4791('0x10b')](path[_0x4791('0x10c')](config[_0x4791('0x110')],_0x4791('0x10f'))));_0x2bd076[_0x4791('0xb')](_0x4791('0x111'),express[_0x4791('0x10b')](path['join'](config[_0x4791('0x110')],'snippet',_0x4791('0x112'))));_0x2bd076[_0x4791('0xb')](_0x4791('0x113'),express[_0x4791('0x10b')](path[_0x4791('0x10c')](config[_0x4791('0x110')],_0x4791('0x114'))));_0x2bd076[_0x4791('0x115')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x4791('0x116')](errors[0x194]);_0x2bd076[_0x4791('0x115')]('/*')[_0x4791('0x116')](function(_0x2e2d4d,_0x558ea5){_0x558ea5['sendFile'](path['resolve'](_0x2bd076[_0x4791('0x116')]('appPath')+_0x4791('0x117')));});return _0x2bd076;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 5ec9785..f3be5d3 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc97=['../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','listen','../config/triggers','default','jayson/promise','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc'];(function(_0xea089d,_0x26a88d){var _0x3950e6=function(_0x156b6e){while(--_0x156b6e){_0xea089d['push'](_0xea089d['shift']());}};_0x3950e6(++_0x26a88d);}(_0xdc97,0x13b));var _0x7dc9=function(_0x22c59f,_0x320bb1){_0x22c59f=_0x22c59f-0x0;var _0x1e56a3=_0xdc97[_0x22c59f];return _0x1e56a3;};'use strict';var jayson=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var config=require(_0x7dc9('0x2'));exports['listen']=function(){return new Promise(function(_0x2913e6,_0x4f5c88){var _0x228e39={};_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/user/user.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x4')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x5')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x6')));_0x228e39=_['merge'](_0x228e39,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x7')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x8')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x9')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xa')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xb')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/mailServerIn/mailServerIn.rpc'));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0xc')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/mailQueue/mailQueue.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xd')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xe')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0xf')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x10')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x11')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x12')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x13')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x14')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x15')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x16')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/smsAccount/smsAccount.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x17')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x18')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x19')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1a')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1b')));_0x228e39=_['merge'](_0x228e39,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1c')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x1d')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/chatInteraction/chatInteraction.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1e')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/chatQueue/chatQueue.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x1f')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/cmHopper/cmHopper.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x20')));_0x228e39=_['merge'](_0x228e39,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x21')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x22')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x23')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x24')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x25')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x26')));_0x228e39=_['merge'](_0x228e39,require('../api/variable/variable.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x228e39=_['merge'](_0x228e39,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x27')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x28')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x29')));_0x228e39=_['merge'](_0x228e39,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x2a')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x2b')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2c')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2d')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2e')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/squareReport/squareReport.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x2f')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x30')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x31')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x32')));_0x228e39=_['merge'](_0x228e39,require('../api/squareMessage/squareMessage.rpc'));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x33')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x34')));_0x228e39=_['merge'](_0x228e39,require(_0x7dc9('0x35')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x36')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x37')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x38')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x39')));_0x228e39=_[_0x7dc9('0x3')](_0x228e39,require(_0x7dc9('0x3a')));var _0x3a8d80=jayson['server'](_0x228e39)[_0x7dc9('0x3b')]();var _0x7cdd8d=config[_0x7dc9('0x3c')][_0x7dc9('0x3d')]||config['port']+0x1;var _0x3492e6=config[_0x7dc9('0x3c')]['ip']||_0x7dc9('0x3e');_0x3a8d80['on'](_0x7dc9('0x3f'),function(_0x295853){return _0x4f5c88(_0x295853);});_0x3a8d80[_0x7dc9('0x40')](_0x7cdd8d,_0x3492e6,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x3492e6,_0x7cdd8d);require(_0x7dc9('0x41'))[_0x7dc9('0x42')]();return _0x2913e6('RPC\x20listening\x20on\x20'+_0x3492e6+':'+_0x7cdd8d);});});}; \ No newline at end of file +var _0x1d50=['rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../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/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.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/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1d50,0x125));var _0x01d5=function(_0x3ae3ac,_0x4f71ba){_0x3ae3ac=_0x3ae3ac-0x0;var _0x48fc96=_0x1d50[_0x3ae3ac];return _0x48fc96;};'use strict';var jayson=require(_0x01d5('0x0'));var _=require('lodash');var config=require(_0x01d5('0x1'));exports[_0x01d5('0x2')]=function(){return new Promise(function(_0x4abed3,_0x5eccef){var _0x3ddbb8={};_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/user/user.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x4')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x5')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/voiceRecording/voiceRecording.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x6')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x7')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x8')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x9')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0xa')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0xb')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0xc')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0xd')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/mailAccount/mailAccount.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0xe')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0xf')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x10')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x11')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x12')));_0x3ddbb8=_['merge'](_0x3ddbb8,require('../api/faxApplication/faxApplication.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x13')));_0x3ddbb8=_['merge'](_0x3ddbb8,require('../api/faxMessage/faxMessage.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x14')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x15')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x16')));_0x3ddbb8=_['merge'](_0x3ddbb8,require('../api/smsInteraction/smsInteraction.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x17')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x18')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x19')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x1a')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x1b')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x1c')));_0x3ddbb8=_['merge'](_0x3ddbb8,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x1d')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x1e')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x1f')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x20')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x21')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x22')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x23')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x24')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x25')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x26')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x27')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x28')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x29')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x2a')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x2b')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x2c')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x2d')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x2e')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x2f')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x30')));_0x3ddbb8=_['merge'](_0x3ddbb8,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x31')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x32')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/setting/setting.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x33')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x34')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x35')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x36')));_0x3ddbb8=_['merge'](_0x3ddbb8,require(_0x01d5('0x37')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/attachment/attachment.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x38')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x39')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x3a')));_0x3ddbb8=_[_0x01d5('0x3')](_0x3ddbb8,require(_0x01d5('0x3b')));var _0x45742a=jayson[_0x01d5('0x3c')](_0x3ddbb8)[_0x01d5('0x3d')]();var _0x38563c=config[_0x01d5('0x3e')][_0x01d5('0x3f')]||config[_0x01d5('0x3f')]+0x1;var _0x216ded=config[_0x01d5('0x3e')]['ip']||_0x01d5('0x40');_0x45742a['on'](_0x01d5('0x41'),function(_0x140356){return _0x5eccef(_0x140356);});_0x45742a[_0x01d5('0x2')](_0x38563c,_0x216ded,function(){console[_0x01d5('0x42')](_0x01d5('0x43'),_0x216ded,_0x38563c);require(_0x01d5('0x44'))[_0x01d5('0x45')]();return _0x4abed3(_0x01d5('0x46')+_0x216ded+':'+_0x38563c);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index f6c5244..49aa52a 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 _0x71ab=['SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','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','exec','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','function','no\x20code','substr','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','command','write','destroy','inherits','sendRequest','sync','prototype','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber'];(function(_0x41dba8,_0x3d3f6e){var _0x2c5641=function(_0x46638c){while(--_0x46638c){_0x41dba8['push'](_0x41dba8['shift']());}};_0x2c5641(++_0x3d3f6e);}(_0x71ab,0x64));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var _=require(_0xb71a('0x0'));var EventEmitter=require('events')[_0xb71a('0x1')];var AGIReply=require('./reply');var AGIError=require(_0xb71a('0x2'));function AGIChannel(_0x3f0529){var _0x20fd9c=this,_0x4094b2=new AGIReply(),_0x37ce74=![],_0x3c6438={};EventEmitter[_0xb71a('0x3')](_0x20fd9c);_0x3f0529[_0xb71a('0x4')](_0xb71a('0x5'));_0x3f0529[_0xb71a('0x6')](0x8*0x3c*0x3c*0x3e8);_0x4094b2[_0xb71a('0x4')](_0xb71a('0x5'));_0x4094b2['on'](_0xb71a('0x7'),function(_0x471ab6){for(var _0x18c7a6 in _0x471ab6){_0x20fd9c[_0x18c7a6]=_0x471ab6[_0x18c7a6];}_0x20fd9c[_0xb71a('0x8')](_0xb71a('0x9'));});_0x4094b2['on'](_0xb71a('0xa'),function(_0x517eed){if(_0x517eed[_0xb71a('0xb')]()=='hangup'){_0x20fd9c[_0xb71a('0x8')](_0xb71a('0xc'));return;}if(_0x517eed[_0xb71a('0xd')](0x0,0xb)=='520-Invalid'){_0x37ce74=!![];}if(_0x37ce74){_0x3c6438['rx']+=_0x517eed+'\x0a';if(_0x517eed[_0xb71a('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x37ce74=![];}}else{_0x3c6438['rx']=_0x517eed;}if(_0x37ce74){return;}if(typeof _0x3c6438['cb']==_0xb71a('0xf')){var _0x50030d=_0x3c6438['rx'][_0xb71a('0xd')](0x0,0x3),_0x50b43b=null,_0x3346a5=null;_0x50030d=parseInt(_0x50030d);if(isNaN(_0x50030d)){_0x3c6438['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xb71a('0x10')});return;}if(_0x50030d!=0xc8){_0x3c6438['cb'](null,{'code':_0x50030d,'result':-0x1,'extra':'KO'});return;}_0x50b43b=_0x3c6438['rx'][_0xb71a('0xd')](0x4)['replace']('result=','');if(_0x50b43b['indexOf']('\x20')!=-0x1){_0x50b43b=_0x50b43b[_0xb71a('0x11')](0x0,_0x50b43b[_0xb71a('0x12')]('\x20'));}if(_[_0xb71a('0x13')](_0x50b43b,'-1')){_0x50b43b=parseInt(_0x50b43b);}_0x3346a5=_0x3c6438['rx'][_0xb71a('0x14')]('\x20');if(_0x3346a5[_0xb71a('0x15')]==0x3){_0x3346a5=_0x3346a5[0x2][_0xb71a('0xd')](0x1,_0x3346a5[0x2][_0xb71a('0x15')]-0x1);}else if(_0x3346a5[_0xb71a('0x15')]>0x3){var _0x7710a8=/\((.+)\)/;var _0x5588cf=_0x3c6438['rx'][_0xb71a('0x16')](_0x7710a8);if(_0x5588cf){_0x3346a5=_0x5588cf[0x1];}else{_0x3346a5=null;}}else{_0x3346a5=null;}_0x3c6438['cb'](null,{'code':_0x50030d,'result':_0x50b43b,'extra':_0x3346a5});}});_0x3f0529['on'](_0xb71a('0x17'),function(_0x374c8c){_0x20fd9c[_0xb71a('0x8')](_0xb71a('0x17'),new AGIError(_0xb71a('0x18'),_0x374c8c[_0xb71a('0x19')]));});_0x3f0529['on'](_0xb71a('0x1a'),function(){_0x20fd9c[_0xb71a('0x8')](_0xb71a('0x1a'),new AGIError(_0xb71a('0x1b')));});_0x3f0529['on']('timeout',function(){_0x20fd9c['emit'](_0xb71a('0x1c'),new AGIError(_0xb71a('0x1d')));_0x3f0529['destroy']();});_0x3f0529['pipe'](_0x4094b2);this[_0xb71a('0x1e')]=function(_0x4fe4fb,_0x76d6dc){var _0x4fe4fb=_0x4fe4fb||'',_0x76d6dc=typeof _0x76d6dc==_0xb71a('0xf')?_0x76d6dc:new Function();_0x3c6438={'tx':_0x4fe4fb,'rx':'','cb':_0x76d6dc};_0x3f0529[_0xb71a('0x1f')](_0x4fe4fb+'\x0a');},this[_0xb71a('0x1a')]=function(){_0x3f0529[_0xb71a('0x20')]();};}util[_0xb71a('0x21')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xb71a('0x22')]=function(_0x2c15bc){return this[_0xb71a('0x1e')][_0xb71a('0x23')](this,_0x2c15bc);};AGIChannel[_0xb71a('0x24')][_0xb71a('0x25')]=function(){return this[_0xb71a('0x22')](_0xb71a('0x26'));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x27')]=function(_0x45b849,_0x17f8b2,_0x160f0f){_0x45b849=_0x45b849===undefined?'beep':_0x45b849;_0x17f8b2=_0x17f8b2===undefined?'5':_0x17f8b2;_0x160f0f=_0x160f0f===undefined?'1':_0x160f0f;return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x29'),_0x45b849,_0x17f8b2*0x3e8,_0x160f0f));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x2a')]=function(_0x38178c){_0x38178c=_0x38178c||_0xb71a('0x2b');return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x2c'),_0x38178c));};AGIChannel[_0xb71a('0x24')]['exec']=function(_0x56f5a4,_0x3112d3){if(_['isArray'](_0x3112d3)){return this[_0xb71a('0x22')](util[_0xb71a('0x28')]('EXEC\x20%s\x20%s',_0x56f5a4,_0x3112d3[_0xb71a('0x2d')](',')));}return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x2e'),_0x56f5a4,_0x3112d3));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x2f')]=function(_0x5dd779){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x30'),_0x5dd779));};AGIChannel[_0xb71a('0x24')]['setExtension']=function(_0x2ea22a){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x31'),_0x2ea22a));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x32')]=function(_0x2962a0){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x33'),_0x2962a0));};AGIChannel['prototype']['hangup']=function(){return this[_0xb71a('0x22')](_0xb71a('0x34'));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x35')]=function(_0xb5d842,_0x247540){var _0x394b4f=_['isBoolean'](_0x247540)||_[_0xb71a('0x36')](_0x247540)?_0x247540['toString']():_0x247540;return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x37'),_0xb5d842,_0x394b4f?_0x394b4f[_0xb71a('0x38')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x39')]=function(_0x4694fd,_0x1fa15c){return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x3a'),_0x4694fd,_0x1fa15c));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x3b')]=function(_0x59c61a,_0x24a3af){return this['sendRequest'](util[_0xb71a('0x28')](_0xb71a('0x3c'),_0x59c61a,_0x24a3af));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x3d')]=function(_0xce7b8a,_0x18872b){return this['sendRequest'](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0xce7b8a,_0x18872b));};AGIChannel[_0xb71a('0x24')]['continueAt']=function(_0x2db5c9,_0x23f542,_0x155502){_0x23f542=_0x23f542||this[_0xb71a('0x3e')];_0x155502=_0x155502||0x1;this[_0xb71a('0x2f')](_0x2db5c9);this[_0xb71a('0x3f')](_0x23f542);this['setPriority'](_0x155502);return this[_0xb71a('0x2a')](util[_0xb71a('0x28')](_0xb71a('0x40'),_0x2db5c9,_0x23f542,_0x155502));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x41')]=function(_0x2f08d2){return this['sendRequest'](util[_0xb71a('0x28')](_0xb71a('0x42'),_0x2f08d2));};AGIChannel[_0xb71a('0x24')][_0xb71a('0x43')]=function(_0x3cb177,_0x8f97ff,_0x1d1c38,_0x48baae,_0x48db05,_0x2442f5){_0x8f97ff=_0x8f97ff||_0xb71a('0x44');_0x1d1c38=_0x1d1c38||'';_0x48baae=_0x48baae===undefined?-0x1:_0x48baae==='-1'?-0x1:_0x48baae*0x3e8;_0x48db05=_0x48db05===undefined?'':'s='+_0x48db05;_0x2442f5=_0x2442f5?_0xb71a('0x45'):'';return this[_0xb71a('0x22')](util['format'](_0xb71a('0x46'),_0x3cb177,_0x8f97ff,_0x1d1c38,_0x48baae,_0x2442f5,_0x48db05));};AGIChannel['prototype'][_0xb71a('0x47')]=function(_0x1d8793,_0x58e039){_0x58e039=_0x58e039||'';return this[_0xb71a('0x22')](util[_0xb71a('0x28')](_0xb71a('0x48'),_0x1d8793,_0x58e039));};AGIChannel[_0xb71a('0x24')]['agi']=function(_0x188896){return this[_0xb71a('0x49')](_0xb71a('0x4a'),_0x188896);};AGIChannel['prototype'][_0xb71a('0x4b')]=function(_0x1cd434){return this[_0xb71a('0x49')]('WAIT',_0x1cd434);};AGIChannel[_0xb71a('0x24')][_0xb71a('0x17')]=function(_0x2f6f6e,_0x1f29b7){this[_0xb71a('0x2a')](util['format'](_0xb71a('0x4c'),_0x2f6f6e['id'],_0x2f6f6e[_0xb71a('0x4d')],_0x1f29b7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xb71a('0x4e')]=AGIChannel; \ No newline at end of file +var _0xb501=['SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','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','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','EventEmitter','./error','call','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','replace','result=','indexOf','substr','startsWith','split','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sync','answer','sendRequest','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xb501,0x1ce));var _0x1b50=function(_0x445651,_0x13fb75){_0x445651=_0x445651-0x0;var _0x1f2984=_0xb501[_0x445651];return _0x1f2984;};'use strict';var util=require(_0x1b50('0x0'));var _=require('lodash');var EventEmitter=require(_0x1b50('0x1'))[_0x1b50('0x2')];var AGIReply=require('./reply');var AGIError=require(_0x1b50('0x3'));function AGIChannel(_0x1c0893){var _0x185118=this,_0x5f1581=new AGIReply(),_0x5140f2=![],_0x3c12a2={};EventEmitter[_0x1b50('0x4')](_0x185118);_0x1c0893[_0x1b50('0x5')](_0x1b50('0x6'));_0x1c0893['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5f1581[_0x1b50('0x5')](_0x1b50('0x6'));_0x5f1581['on'](_0x1b50('0x7'),function(_0x4eee85){for(var _0x261d74 in _0x4eee85){_0x185118[_0x261d74]=_0x4eee85[_0x261d74];}_0x185118[_0x1b50('0x8')](_0x1b50('0x9'));});_0x5f1581['on'](_0x1b50('0xa'),function(_0x30634f){if(_0x30634f['toLowerCase']()==_0x1b50('0xb')){_0x185118['emit'](_0x1b50('0xb'));return;}if(_0x30634f[_0x1b50('0xc')](0x0,0xb)==_0x1b50('0xd')){_0x5140f2=!![];}if(_0x5140f2){_0x3c12a2['rx']+=_0x30634f+'\x0a';if(_0x30634f['search'](_0x1b50('0xe'))!=-0x1){_0x5140f2=![];}}else{_0x3c12a2['rx']=_0x30634f;}if(_0x5140f2){return;}if(typeof _0x3c12a2['cb']==_0x1b50('0xf')){var _0x5890c4=_0x3c12a2['rx'][_0x1b50('0xc')](0x0,0x3),_0x2c4816=null,_0x472be5=null;_0x5890c4=parseInt(_0x5890c4);if(isNaN(_0x5890c4)){_0x3c12a2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x5890c4!=0xc8){_0x3c12a2['cb'](null,{'code':_0x5890c4,'result':-0x1,'extra':'KO'});return;}_0x2c4816=_0x3c12a2['rx'][_0x1b50('0xc')](0x4)[_0x1b50('0x10')](_0x1b50('0x11'),'');if(_0x2c4816[_0x1b50('0x12')]('\x20')!=-0x1){_0x2c4816=_0x2c4816[_0x1b50('0x13')](0x0,_0x2c4816[_0x1b50('0x12')]('\x20'));}if(_[_0x1b50('0x14')](_0x2c4816,'-1')){_0x2c4816=parseInt(_0x2c4816);}_0x472be5=_0x3c12a2['rx'][_0x1b50('0x15')]('\x20');if(_0x472be5['length']==0x3){_0x472be5=_0x472be5[0x2][_0x1b50('0xc')](0x1,_0x472be5[0x2][_0x1b50('0x16')]-0x1);}else if(_0x472be5['length']>0x3){var _0x42b090=/\((.+)\)/;var _0x1615fa=_0x3c12a2['rx'][_0x1b50('0x17')](_0x42b090);if(_0x1615fa){_0x472be5=_0x1615fa[0x1];}else{_0x472be5=null;}}else{_0x472be5=null;}_0x3c12a2['cb'](null,{'code':_0x5890c4,'result':_0x2c4816,'extra':_0x472be5});}});_0x1c0893['on']('error',function(_0x17c3e2){_0x185118[_0x1b50('0x8')](_0x1b50('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x17c3e2[_0x1b50('0x19')]));});_0x1c0893['on'](_0x1b50('0x1a'),function(){_0x185118['emit']('close',new AGIError(_0x1b50('0x1b')));});_0x1c0893['on']('timeout',function(){_0x185118['emit']('timeout',new AGIError(_0x1b50('0x1c')));_0x1c0893[_0x1b50('0x1d')]();});_0x1c0893[_0x1b50('0x1e')](_0x5f1581);this[_0x1b50('0x1f')]=function(_0x211a82,_0x52afb6){var _0x211a82=_0x211a82||'',_0x52afb6=typeof _0x52afb6==_0x1b50('0xf')?_0x52afb6:new Function();_0x3c12a2={'tx':_0x211a82,'rx':'','cb':_0x52afb6};_0x1c0893[_0x1b50('0x20')](_0x211a82+'\x0a');},this['close']=function(){_0x1c0893[_0x1b50('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1b50('0x21')]['sendRequest']=function(_0xd5e8f){return this[_0x1b50('0x1f')][_0x1b50('0x22')](this,_0xd5e8f);};AGIChannel['prototype'][_0x1b50('0x23')]=function(){return this[_0x1b50('0x24')]('ANSWER');};AGIChannel[_0x1b50('0x21')][_0x1b50('0x25')]=function(_0x9d148d,_0x186e28,_0x3bc4bc){_0x9d148d=_0x9d148d===undefined?_0x1b50('0x26'):_0x9d148d;_0x186e28=_0x186e28===undefined?'5':_0x186e28;_0x3bc4bc=_0x3bc4bc===undefined?'1':_0x3bc4bc;return this[_0x1b50('0x24')](util['format'](_0x1b50('0x27'),_0x9d148d,_0x186e28*0x3e8,_0x3bc4bc));};AGIChannel[_0x1b50('0x21')]['noop']=function(_0x162a5c){_0x162a5c=_0x162a5c||'NO\x20MESSAGE';return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x29'),_0x162a5c));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x2a')]=function(_0x24b09e,_0x31281b){if(_[_0x1b50('0x2b')](_0x31281b)){return this['sendRequest'](util[_0x1b50('0x28')](_0x1b50('0x2c'),_0x24b09e,_0x31281b['join'](',')));}return this[_0x1b50('0x24')](util['format']('EXEC\x20%s\x20%s',_0x24b09e,_0x31281b));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x2d')]=function(_0xe50065){return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x2e'),_0xe50065));};AGIChannel['prototype']['setExtension']=function(_0x39f811){return this[_0x1b50('0x24')](util['format'](_0x1b50('0x2f'),_0x39f811));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x30')]=function(_0xf295ff){return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x31'),_0xf295ff));};AGIChannel['prototype']['hangup']=function(){return this[_0x1b50('0x24')](_0x1b50('0x32'));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x33')]=function(_0x450ca8,_0x3b73cc){var _0xf8ef19=_['isBoolean'](_0x3b73cc)||_[_0x1b50('0x34')](_0x3b73cc)?_0x3b73cc[_0x1b50('0x35')]():_0x3b73cc;return this['sendRequest'](util['format'](_0x1b50('0x36'),_0x450ca8,_0xf8ef19?_0xf8ef19[_0x1b50('0x35')]()[_0x1b50('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x1b50('0x37')]=function(_0x11f8d7,_0x528667){return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x38'),_0x11f8d7,_0x528667));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x39')]=function(_0x1def42,_0x596881){return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x3a'),_0x1def42,_0x596881));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x3b')]=function(_0x33ec2f,_0x1dd77b){return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x3c'),_0x33ec2f,_0x1dd77b));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x3d')]=function(_0x20101a,_0x30ac3d,_0x40db27){_0x30ac3d=_0x30ac3d||this[_0x1b50('0x3e')];_0x40db27=_0x40db27||0x1;this[_0x1b50('0x2d')](_0x20101a);this['setExtension'](_0x30ac3d);this[_0x1b50('0x30')](_0x40db27);return this[_0x1b50('0x3f')](util[_0x1b50('0x28')](_0x1b50('0x40'),_0x20101a,_0x30ac3d,_0x40db27));};AGIChannel[_0x1b50('0x21')]['getVariable']=function(_0x4b9226){return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x41'),_0x4b9226));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x42')]=function(_0x1c00e8,_0x453e04,_0x1cb0d0,_0x215f09,_0x92e14f,_0x4b5a86){_0x453e04=_0x453e04||'wav';_0x1cb0d0=_0x1cb0d0||'';_0x215f09=_0x215f09===undefined?-0x1:_0x215f09==='-1'?-0x1:_0x215f09*0x3e8;_0x92e14f=_0x92e14f===undefined?'':'s='+_0x92e14f;_0x4b5a86=_0x4b5a86?_0x1b50('0x43'):'';return this['sendRequest'](util[_0x1b50('0x28')](_0x1b50('0x44'),_0x1c00e8,_0x453e04,_0x1cb0d0,_0x215f09,_0x4b5a86,_0x92e14f));};AGIChannel[_0x1b50('0x21')][_0x1b50('0x45')]=function(_0x5a9dfe,_0xb6933e){_0xb6933e=_0xb6933e||'';return this[_0x1b50('0x24')](util[_0x1b50('0x28')](_0x1b50('0x46'),_0x5a9dfe,_0xb6933e));};AGIChannel[_0x1b50('0x21')]['agi']=function(_0x25fc12){return this['exec']('AGI',_0x25fc12);};AGIChannel[_0x1b50('0x21')][_0x1b50('0x47')]=function(_0x1dd29d){return this['exec']('WAIT',_0x1dd29d);};AGIChannel[_0x1b50('0x21')][_0x1b50('0x18')]=function(_0x1fab59,_0xb1d970){this['noop'](util[_0x1b50('0x28')](_0x1b50('0x48'),_0x1fab59['id'],_0x1fab59[_0x1b50('0x49')],_0xb1d970));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 6762c06..9e6dc74 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 _0x50a1=['E_AGI_UNDEFINED','push','format','message','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.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x50a1,0x1ee));var _0x150a=function(_0x3d2ab5,_0x1a3553){_0x3d2ab5=_0x3d2ab5-0x0;var _0x421623=_0x50a1[_0x3d2ab5];return _0x421623;};'use strict';var util=require(_0x150a('0x0'));var error={'E_AGI_UNDEFINED':_0x150a('0x1'),'E_AGI_ARGUMENT_PORT':_0x150a('0x2'),'E_AGI_SERVER_ERROR':_0x150a('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x150a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x150a('0x5'),'E_AGI_SOCKET_ERROR':_0x150a('0x6'),'E_AGI_SOCKET_CLOSE':_0x150a('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x150a('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x150a('0x9')};function AGIError(_0x45ecf8){var _0x45ecf8=_0x45ecf8||null,_0x411b76=_0x411b76||[],_0x7ec2e0=0x1,_0x57e9b5='';if(!error[_0x45ecf8]){_0x45ecf8=_0x150a('0xa');}_0x411b76[_0x150a('0xb')](error[_0x45ecf8]);while(arguments[_0x7ec2e0]){_0x411b76['push'](arguments[_0x7ec2e0]);_0x7ec2e0++;}_0x57e9b5=util[_0x150a('0xc')]['apply'](util,_0x411b76);this[_0x150a('0xd')]=_0x57e9b5;this['name']=_0x45ecf8;}module['exports']=AGIError; \ No newline at end of file +var _0x670f=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','util','Undefined\x20error.'];(function(_0x963330,_0x3971cd){var _0x556065=function(_0x168947){while(--_0x168947){_0x963330['push'](_0x963330['shift']());}};_0x556065(++_0x3971cd);}(_0x670f,0x1d2));var _0xf670=function(_0x4a79d3,_0x1e53c9){_0x4a79d3=_0x4a79d3-0x0;var _0x11c6d5=_0x670f[_0x4a79d3];return _0x11c6d5;};'use strict';var util=require(_0xf670('0x0'));var error={'E_AGI_UNDEFINED':_0xf670('0x1'),'E_AGI_ARGUMENT_PORT':_0xf670('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xf670('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xf670('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xf670('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xf670('0x6'),'E_AGI_COMMAND_EMPTY':_0xf670('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xf670('0x8')};function AGIError(_0x29ca18){var _0x29ca18=_0x29ca18||null,_0x157390=_0x157390||[],_0x3223eb=0x1,_0x5298bd='';if(!error[_0x29ca18]){_0x29ca18='E_AGI_UNDEFINED';}_0x157390[_0xf670('0x9')](error[_0x29ca18]);while(arguments[_0x3223eb]){_0x157390[_0xf670('0x9')](arguments[_0x3223eb]);_0x3223eb++;}_0x5298bd=util[_0xf670('0xa')][_0xf670('0xb')](util,_0x157390);this[_0xf670('0xc')]=_0x5298bd;this['name']=_0x29ca18;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index c6d5d54..2e61ed8 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 _0x3d9c=['error','E_AGI_SERVER_ERROR','agi','parse','projectUpdate','exports','lodash','EventEmitter','redis','defaults','localhost','subscribe','emit'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x3d9c,0x7b));var _0xc3d9=function(_0x5c7fff,_0x4a16de){_0x5c7fff=_0x5c7fff-0x0;var _0x5db709=_0x3d9c[_0x5c7fff];return _0x5db709;};'use strict';var _=require(_0xc3d9('0x0'));var EventEmitter=require('events')[_0xc3d9('0x1')];var Redis=require('ioredis');var AGIError=require('./error');var config=require('../../config/environment');config[_0xc3d9('0x2')]=_[_0xc3d9('0x3')](config[_0xc3d9('0x2')],{'host':_0xc3d9('0x4'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc3d9('0x2')]);sub[_0xc3d9('0x5')]('agi',function(_0x366ced){if(_0x366ced)return eventEmitter[_0xc3d9('0x6')](_0xc3d9('0x7'),new AGIError(_0xc3d9('0x8'),_0x366ced));});sub['on']('message',function(_0x2967e4,_0x518131){if(_0x2967e4!==_0xc3d9('0x9'))return;try{var _0x3811c9=JSON[_0xc3d9('0xa')](_0x518131);eventEmitter[_0xc3d9('0x6')](_0xc3d9('0xb'),_0x3811c9);}catch(_0x27443f){eventEmitter[_0xc3d9('0x6')](_0xc3d9('0x7'),new AGIError(_0xc3d9('0x8'),_0x27443f));}});module[_0xc3d9('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xd06f=['message','parse','projectUpdate','exports','events','EventEmitter','ioredis','../../config/environment','redis','defaults','subscribe','agi','emit','error','E_AGI_SERVER_ERROR'];(function(_0x541adc,_0x92d9d1){var _0x120dce=function(_0x2b8983){while(--_0x2b8983){_0x541adc['push'](_0x541adc['shift']());}};_0x120dce(++_0x92d9d1);}(_0xd06f,0xc7));var _0xfd06=function(_0x54b7d1,_0x51504c){_0x54b7d1=_0x54b7d1-0x0;var _0x38ad9b=_0xd06f[_0x54b7d1];return _0x38ad9b;};'use strict';var _=require('lodash');var EventEmitter=require(_0xfd06('0x0'))[_0xfd06('0x1')];var Redis=require(_0xfd06('0x2'));var AGIError=require('./error');var config=require(_0xfd06('0x3'));config[_0xfd06('0x4')]=_[_0xfd06('0x5')](config[_0xfd06('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xfd06('0x4')]);sub[_0xfd06('0x6')](_0xfd06('0x7'),function(_0x583bde){if(_0x583bde)return eventEmitter[_0xfd06('0x8')](_0xfd06('0x9'),new AGIError(_0xfd06('0xa'),_0x583bde));});sub['on'](_0xfd06('0xb'),function(_0x2fd287,_0x4b95e8){if(_0x2fd287!=='agi')return;try{var _0x18d98e=JSON[_0xfd06('0xc')](_0x4b95e8);eventEmitter[_0xfd06('0x8')](_0xfd06('0xd'),_0x18d98e);}catch(_0x320ad4){eventEmitter[_0xfd06('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x320ad4));}});module[_0xfd06('0xe')]={'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 c723fd0..0cb85fe 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 _0xed01=['traverseBFS','info','no\x20vertex\x20found','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','getVertex'];(function(_0x170c27,_0x4f58b1){var _0x135072=function(_0x482c1a){while(--_0x482c1a){_0x170c27['push'](_0x170c27['shift']());}};_0x135072(++_0x4f58b1);}(_0xed01,0x1d1));var _0x1ed0=function(_0x32bbaa,_0x2bc8f3){_0x32bbaa=_0x32bbaa-0x0;var _0x34077b=_0xed01[_0x32bbaa];return _0x34077b;};'use strict';var _=require(_0x1ed0('0x0'));var logger=require(_0x1ed0('0x1'))(_0x1ed0('0x2'));var verticesWithRetry=[_0x1ed0('0x3'),_0x1ed0('0x4'),_0x1ed0('0x5')];var Graph=function(){this[_0x1ed0('0x6')]={};this[_0x1ed0('0x7')]={};this[_0x1ed0('0x8')]=0x0;};Graph[_0x1ed0('0x9')][_0x1ed0('0xa')]=function(_0x5df075){this[_0x1ed0('0x6')][_0x5df075['id']]=_0x5df075;this[_0x1ed0('0x7')][_0x5df075['id']]=[];};Graph[_0x1ed0('0x9')][_0x1ed0('0xb')]=function(_0x2f48bf,_0x8634cd,_0x4fe1b5){this[_0x1ed0('0x7')][_0x2f48bf][_0x1ed0('0xc')]({'target':_0x8634cd,'condition':_0x4fe1b5});this[_0x1ed0('0x8')]+=0x1;};Graph['prototype'][_0x1ed0('0xd')]=function(){return _[_0x1ed0('0xd')](this[_0x1ed0('0x6')]);};Graph[_0x1ed0('0x9')]['relations']=function(){return this[_0x1ed0('0x8')];};Graph[_0x1ed0('0x9')][_0x1ed0('0xe')]=function(_0x4f4210){return this[_0x1ed0('0x6')][_0x4f4210];};Graph[_0x1ed0('0x9')][_0x1ed0('0xf')]=function(_0x5e34d7,_0x425ddb){if(!this[_0x1ed0('0x6')][_0x5e34d7]){return logger[_0x1ed0('0x10')](_0x1ed0('0x11'));}var _0x34d9d2=_0x425ddb(this['vertices'][_0x5e34d7]);if(!_0x34d9d2){return logger[_0x1ed0('0x10')]('stop\x20traverse');}if(this[_0x1ed0('0x7')][_0x5e34d7][_0x1ed0('0x12')]===0x0){return logger['info'](_0x1ed0('0x13'));}for(var _0x1b9221=0x0,_0x229365=[],_0x241233=![];_0x1b9221\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','handleNotFound','production','initialize','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x234e,0x76));var _0xe234=function(_0x5d0ba7,_0x1790c0){_0x5d0ba7=_0x5d0ba7-0x0;var _0x3548e7=_0x234e[_0x5d0ba7];return _0x3548e7;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0xe234('0x0'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xe234('0x1'));var utilLicense=require(_0xe234('0x2'));var rpc=require(_0xe234('0x3'));var Project=require(_0xe234('0x4'));var AGIEmitter=require(_0xe234('0x5'))[_0xe234('0x6')];var projects=[];config[_0xe234('0x1')]=_[_0xe234('0x7')](config[_0xe234('0x1')],{'ip':_0xe234('0x8'),'port':0x11dd});AGIEmitter['on'](_0xe234('0x9'),projectUpdateHandler);function connectionHandler(_0x4251d5){process[_0xe234('0xa')](function(){syncho(function(){try{setChannelVariables(_0x4251d5);agiHandler(_0x4251d5);}catch(_0x53dedc){logger[_0xe234('0xb')](_0x53dedc[_0xe234('0xc')]);}});});}function projectUpdateHandler(_0x1dfee8){try{var _0x1071df=_[_0xe234('0xd')](projects,['id',_0x1dfee8['id']]);if(_0x1071df>-0x1){if(_0x1dfee8[_0xe234('0xe')]===!![]){projects[_0xe234('0xf')](_0x1071df,0x1);}else{projects[_0x1071df]=_0x1dfee8;}}else{projects[_0xe234('0x10')](_0x1dfee8);}}catch(_0x192463){logger[_0xe234('0xb')](_0x192463[_0xe234('0xc')]);}}function listeningHandler(){console[_0xe234('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe234('0x1')]['port']);logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x14'),config[_0xe234('0x1')]['ip'],config['agi'][_0xe234('0x15')]));}function errorHandler(_0x53a472){if(_0x53a472&&_0x53a472['name']&&_0x53a472[_0xe234('0x16')]){logger[_0xe234('0xb')](util['format'](_0xe234('0x17'),_0x53a472[_0xe234('0x18')],_0x53a472['message']));}else{logger['error'](util[_0xe234('0x13')](_0xe234('0x19'),_0x53a472[_0xe234('0xc')]));}}function closeHandler(){logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x1a'),this[_0xe234('0x1b')],this[_0xe234('0x1c')],this['callerid'],this[_0xe234('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x36096d){logger[_0xe234('0xb')](_0x36096d[_0xe234('0xc')]);}}function timeoutHandler(){logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x1e'),this[_0xe234('0x1b')],this[_0xe234('0x1c')],this[_0xe234('0x1f')],this[_0xe234('0x1d')],this[_0xe234('0x20')]));}function hangupHandler(){logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x21'),this[_0xe234('0x1b')],this[_0xe234('0x1c')],this[_0xe234('0x1f')],this[_0xe234('0x1d')],this[_0xe234('0x20')]));this[_0xe234('0x22')]=!![];}function createSquareReport(_0x553cb4,_0x23b495){rpc[_0xe234('0x23')](_0x553cb4)[_0xe234('0x24')](function(_0x5d2961){if(_0x23b495){_0x23b495(null,_0x5d2961);}})['catch'](function(_0x6ef881){if(_0x23b495){_0x23b495(null,_0x6ef881);}});}function setChannelVariables(_0x317be5){for(var _0x22054e in _0x317be5){if(_0x317be5['hasOwnProperty'](_0x22054e)){if(_0x22054e[_0xe234('0x25')]('agi_')===0x0){_0x317be5[_0x22054e[_0xe234('0x26')](0x4)]=_0x317be5[_0x22054e];delete _0x317be5[_0x22054e];}}}}function agiHandler(_0x555778){logger[_0xe234('0x27')](_0xe234('0x28'),JSON[_0xe234('0x29')](_0x555778,null,0x2));logger[_0xe234('0x12')](util[_0xe234('0x13')](_0xe234('0x2a'),_0x555778[_0xe234('0x1b')],_0x555778['calleridname'],_0x555778['callerid'],_0x555778[_0xe234('0x1d')],_0x555778['uniqueid']));_0x555778['on'](_0xe234('0xb'),errorHandler);_0x555778['on']('close',closeHandler);_0x555778['on'](_0xe234('0x2b'),timeoutHandler);_0x555778[_0xe234('0x22')]=![];_0x555778['on']('hangup',hangupHandler);var _0x1f0409=_['find'](projects,[_0xe234('0x18'),_0x555778[_0xe234('0x1b')]]);if(!_0x1f0409)return Project[_0xe234('0x2c')](_0x555778);if(!_0x1f0409[_0xe234('0x2d')])return Project['handleUnpublished'](_0x555778);return Project[_0xe234('0x2e')](_0x1f0409,_0x555778);}function main(){var _0x27489f;return utilLicense['getLicense']()[_0xe234('0x24')](function(_0x1768d0){if(!_0x1768d0)return;if(_0x1768d0['voice']){if(_0x1768d0[_0xe234('0x2f')]&&_0x1768d0[_0xe234('0x2f')]>0x0){logger['info'](util[_0xe234('0x13')](_0xe234('0x30'),_0x1768d0[_0xe234('0x2f')]));_0x27489f=_0x1768d0[_0xe234('0x2f')];}else{logger[_0xe234('0x12')](_0xe234('0x31'));}}else{logger[_0xe234('0x12')](_0xe234('0x32'));_0x27489f=-0x1;}})['then'](function(){return Project['getAll']();})[_0xe234('0x24')](function(_0x4c67c8){projects=_0x4c67c8;return;})[_0xe234('0x33')](function(_0x29dee6){logger[_0xe234('0xb')](_0xe234('0x34'),_0x29dee6[_0xe234('0xc')]);})[_0xe234('0x35')](function(){var _0x2dd4f2=require('./server')(config[_0xe234('0x1')][_0xe234('0x15')],config[_0xe234('0x1')]['ip'],_0x27489f);_0x2dd4f2['on'](_0xe234('0xb'),errorHandler);_0x2dd4f2['on'](_0xe234('0x36'),listeningHandler);_0x2dd4f2['on'](_0xe234('0x37'),connectionHandler);_0x2dd4f2['on'](_0xe234('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0x1e9a=['hangup','find','handleNotFound','production','handleUnpublished','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','arg_1','createSquareReport','then','catch','hasOwnProperty','indexOf','variables','close','timeout','evtHangup'];(function(_0x26e85f,_0x1b2ac7){var _0x25e814=function(_0x46f258){while(--_0x46f258){_0x26e85f['push'](_0x26e85f['shift']());}};_0x25e814(++_0x1b2ac7);}(_0x1e9a,0x1b3));var _0xa1e9=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x1e9a[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xa1e9('0x0'));var syncho=require(_0xa1e9('0x1'));var util=require(_0xa1e9('0x2'));var config=require(_0xa1e9('0x3'));var logger=require(_0xa1e9('0x4'))(_0xa1e9('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0xa1e9('0x6'));var AGIEmitter=require(_0xa1e9('0x7'))[_0xa1e9('0x8')];var projects=[];config['agi']=_[_0xa1e9('0x9')](config[_0xa1e9('0x5')],{'ip':_0xa1e9('0xa'),'port':0x11dd});AGIEmitter['on'](_0xa1e9('0xb'),projectUpdateHandler);function connectionHandler(_0x4556f8){process[_0xa1e9('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4556f8);agiHandler(_0x4556f8);}catch(_0x4855d2){logger[_0xa1e9('0xd')](_0x4855d2[_0xa1e9('0xe')]);}});});}function projectUpdateHandler(_0x14d6db){try{var _0x121a22=_[_0xa1e9('0xf')](projects,['id',_0x14d6db['id']]);if(_0x121a22>-0x1){if(_0x14d6db[_0xa1e9('0x10')]===!![]){projects[_0xa1e9('0x11')](_0x121a22,0x1);}else{projects[_0x121a22]=_0x14d6db;}}else{projects[_0xa1e9('0x12')](_0x14d6db);}}catch(_0x9adb8){logger[_0xa1e9('0xd')](_0x9adb8[_0xa1e9('0xe')]);}}function listeningHandler(){console[_0xa1e9('0x13')](_0xa1e9('0x14'),config[_0xa1e9('0x5')][_0xa1e9('0x15')]);logger[_0xa1e9('0x16')](util[_0xa1e9('0x17')](_0xa1e9('0x18'),config[_0xa1e9('0x5')]['ip'],config[_0xa1e9('0x5')][_0xa1e9('0x15')]));}function errorHandler(_0x175829){if(_0x175829&&_0x175829[_0xa1e9('0x19')]&&_0x175829['message']){logger['error'](util[_0xa1e9('0x17')](_0xa1e9('0x1a'),_0x175829[_0xa1e9('0x19')],_0x175829['message']));}else{logger[_0xa1e9('0xd')](util[_0xa1e9('0x17')](_0xa1e9('0x1b'),_0x175829[_0xa1e9('0xe')]));}}function closeHandler(){logger['info'](util[_0xa1e9('0x17')](_0xa1e9('0x1c'),this['arg_1'],this[_0xa1e9('0x1d')],this[_0xa1e9('0x1e')],this[_0xa1e9('0x1f')],this['uniqueid']));try{createSquareReport(this);}catch(_0x5d8015){logger[_0xa1e9('0xd')](_0x5d8015[_0xa1e9('0xe')]);}}function timeoutHandler(){logger['info'](util[_0xa1e9('0x17')](_0xa1e9('0x20'),this['arg_1'],this[_0xa1e9('0x1d')],this[_0xa1e9('0x1e')],this[_0xa1e9('0x1f')],this[_0xa1e9('0x21')]));}function hangupHandler(){logger[_0xa1e9('0x16')](util['format'](_0xa1e9('0x22'),this[_0xa1e9('0x23')],this[_0xa1e9('0x1d')],this[_0xa1e9('0x1e')],this[_0xa1e9('0x1f')],this[_0xa1e9('0x21')]));this['evtHangup']=!![];}function createSquareReport(_0x1a1308,_0x1f43a3){rpc[_0xa1e9('0x24')](_0x1a1308)[_0xa1e9('0x25')](function(_0x594cf5){if(_0x1f43a3){_0x1f43a3(null,_0x594cf5);}})[_0xa1e9('0x26')](function(_0x6fa5dd){if(_0x1f43a3){_0x1f43a3(null,_0x6fa5dd);}});}function setChannelVariables(_0x12256c){for(var _0x337370 in _0x12256c){if(_0x12256c[_0xa1e9('0x27')](_0x337370)){if(_0x337370[_0xa1e9('0x28')]('agi_')===0x0){_0x12256c[_0x337370['substring'](0x4)]=_0x12256c[_0x337370];delete _0x12256c[_0x337370];}}}}function agiHandler(_0x2bebb8){logger['debug'](_0xa1e9('0x29'),JSON['stringify'](_0x2bebb8,null,0x2));logger[_0xa1e9('0x16')](util[_0xa1e9('0x17')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2bebb8[_0xa1e9('0x23')],_0x2bebb8[_0xa1e9('0x1d')],_0x2bebb8[_0xa1e9('0x1e')],_0x2bebb8[_0xa1e9('0x1f')],_0x2bebb8[_0xa1e9('0x21')]));_0x2bebb8['on'](_0xa1e9('0xd'),errorHandler);_0x2bebb8['on'](_0xa1e9('0x2a'),closeHandler);_0x2bebb8['on'](_0xa1e9('0x2b'),timeoutHandler);_0x2bebb8[_0xa1e9('0x2c')]=![];_0x2bebb8['on'](_0xa1e9('0x2d'),hangupHandler);var _0x26612b=_[_0xa1e9('0x2e')](projects,['name',_0x2bebb8[_0xa1e9('0x23')]]);if(!_0x26612b)return Project[_0xa1e9('0x2f')](_0x2bebb8);if(!_0x26612b[_0xa1e9('0x30')])return Project[_0xa1e9('0x31')](_0x2bebb8);return Project[_0xa1e9('0x32')](_0x26612b,_0x2bebb8);}function main(){var _0x39eb82;return utilLicense['getLicense']()[_0xa1e9('0x25')](function(_0x3cccb6){if(!_0x3cccb6)return;if(_0x3cccb6[_0xa1e9('0x33')]){if(_0x3cccb6[_0xa1e9('0x34')]&&_0x3cccb6['callysquare']>0x0){logger[_0xa1e9('0x16')](util[_0xa1e9('0x17')]('[LICENSE]\x20CHANNELS:\x20%s',_0x3cccb6[_0xa1e9('0x34')]));_0x39eb82=_0x3cccb6[_0xa1e9('0x34')];}else{logger[_0xa1e9('0x16')](_0xa1e9('0x35'));}}else{logger['info'](_0xa1e9('0x36'));_0x39eb82=-0x1;}})['then'](function(){return Project[_0xa1e9('0x37')]();})[_0xa1e9('0x25')](function(_0x1d3d19){projects=_0x1d3d19;return;})[_0xa1e9('0x26')](function(_0x4a174c){logger[_0xa1e9('0xd')](_0xa1e9('0x38'),_0x4a174c[_0xa1e9('0xe')]);})[_0xa1e9('0x39')](function(){var _0x10be12=require(_0xa1e9('0x3a'))(config['agi'][_0xa1e9('0x15')],config[_0xa1e9('0x5')]['ip'],_0x39eb82);_0x10be12['on'](_0xa1e9('0xd'),errorHandler);_0x10be12['on']('listening',listeningHandler);_0x10be12['on'](_0xa1e9('0x3b'),connectionHandler);_0x10be12['on'](_0xa1e9('0x2a'),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 b24bb65..7379ba8 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 _0x3232=['error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','request','then'];(function(_0x45e667,_0x584cac){var _0x202af6=function(_0x157723){while(--_0x157723){_0x45e667['push'](_0x45e667['shift']());}};_0x202af6(++_0x584cac);}(_0x3232,0x7d));var _0x2323=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x3232[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0x2323('0x0'));var jayson=require(_0x2323('0x1'));var client=jayson[_0x2323('0x2')]['http']({'port':0x232b});function request(_0x279c9e,_0x17179a){return new BPromise(function(_0x55474a,_0x1735c9){return client[_0x2323('0x3')](_0x279c9e,_0x17179a)[_0x2323('0x4')](function(_0x35a137){if(_0x35a137[_0x2323('0x5')]){return _0x1735c9(_0x35a137[_0x2323('0x5')][_0x2323('0x6')]);}else{return _0x55474a(_0x35a137[_0x2323('0x7')]);}})['catch'](function(_0x5762ff){return _0x1735c9(_0x5762ff);});});}exports[_0x2323('0x8')]=function(_0x277284,_0x518fa4){return request(_0x2323('0x9'),{'account':_0x277284,'message':_0x518fa4});}; \ No newline at end of file +var _0x1dc0=['result','catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then','error','message'];(function(_0x2bc4ac,_0x557547){var _0x4099eb=function(_0x6ac4f1){while(--_0x6ac4f1){_0x2bc4ac['push'](_0x2bc4ac['shift']());}};_0x4099eb(++_0x557547);}(_0x1dc0,0x19b));var _0x01dc=function(_0x1b790d,_0x5e190e){_0x1b790d=_0x1b790d-0x0;var _0x2faa59=_0x1dc0[_0x1b790d];return _0x2faa59;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x01dc('0x0'));var client=jayson[_0x01dc('0x1')][_0x01dc('0x2')]({'port':0x232b});function request(_0x985863,_0x18bc82){return new BPromise(function(_0x44d498,_0x453444){return client[_0x01dc('0x3')](_0x985863,_0x18bc82)[_0x01dc('0x4')](function(_0x4ca5f4){if(_0x4ca5f4['error']){return _0x453444(_0x4ca5f4[_0x01dc('0x5')][_0x01dc('0x6')]);}else{return _0x44d498(_0x4ca5f4[_0x01dc('0x7')]);}})[_0x01dc('0x8')](function(_0x2a9582){return _0x453444(_0x2a9582);});});}exports[_0x01dc('0x9')]=function(_0x4f9f7d,_0x3cde98){return request(_0x01dc('0xa'),{'account':_0x4f9f7d,'message':_0x3cde98});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index ac5929b..9b733b9 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 _0x174c=['evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','stringify','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','exports','moment','xml2json','util','./rpc','./mailRpc','./graph','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','source','target','addEdge','toJson','inspect','production','start','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','arg_1','calleridname','callerid','dnid','clear','vertex','agicommand','gotoc','info','context','extension','priority','response','code','result'];(function(_0x11805c,_0x5bbf28){var _0x4140ab=function(_0x5d1d5a){while(--_0x5d1d5a){_0x11805c['push'](_0x11805c['shift']());}};_0x4140ab(++_0x5bbf28);}(_0x174c,0xff));var _0xc174=function(_0x5a51c1,_0x394c67){_0x5a51c1=_0x5a51c1-0x0;var _0x38f5fb=_0x174c[_0x5a51c1];return _0x38f5fb;};'use strict';var _=require('lodash');var moment=require(_0xc174('0x0'));var parser=require(_0xc174('0x1'));var util=require(_0xc174('0x2'));var logger=require('../../config/logger')('agi');var rpc=require(_0xc174('0x3'));var mailRpc=require(_0xc174('0x4'));var Graph=require(_0xc174('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xc174('0x6')]()[_0xc174('0x7')](function(_0x18f9dc){logger[_0xc174('0x8')](_0xc174('0x9'),_0x18f9dc[_0xc174('0xa')]);return[];});}function addVertex(_0x5b9455,_0x1971f3,_0x56d2a7){_0x1971f3['agicommand']=_0x56d2a7;if(_0x1971f3[_0xc174('0xb')](_0xc174('0xc'))){_0x1971f3[_0xc174('0xd')]=parseInt(_0x1971f3[_0xc174('0xc')],0xa);}_0x5b9455[_0xc174('0xe')](_['omit'](_0x1971f3,_0xc174('0xf')));}function initGraph(_0x20f527,_0x204643){var _0x4a1db2=new Graph();for(var _0x34698f in _0x20f527){if(_0x20f527[_0xc174('0xb')](_0x34698f)){if(_[_0xc174('0x10')](_0x20f527[_0x34698f])){for(var _0x5512e0=0x0;_0x5512e0<_0x20f527[_0x34698f][_0xc174('0x11')];_0x5512e0+=0x1){addVertex(_0x4a1db2,_0x20f527[_0x34698f][_0x5512e0],_0x34698f);}}else{addVertex(_0x4a1db2,_0x20f527[_0x34698f],_0x34698f);}}}for(var _0x257097=0x0;_0x257097<_0x204643[_0xc174('0x11')];_0x257097+=0x1){if(_0x204643[_0x257097][_0xc174('0x12')]&&_0x204643[_0x257097][_0xc174('0x13')]){_0x4a1db2[_0xc174('0x14')](_0x204643[_0x257097][_0xc174('0x12')],_0x204643[_0x257097][_0xc174('0x13')],_0x204643[_0x257097]['value']);}}return _0x4a1db2;}function getRoot(_0x50ea32){return parser[_0xc174('0x15')](_0x50ea32,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x2f2dee){return util[_0xc174('0x16')](_0x2f2dee,{'showHidden':![],'depth':null});}function initialize(_0x4753a7,_0x14a2b2){var _0x55b763=getRoot(_0x4753a7[_0xc174('0x17')]);if(!_0x55b763||!_0x55b763[_0xc174('0x18')])return;var _0x330dda,_0x39dcc8,_0x4a59ee;logger[_0xc174('0x19')](_0xc174('0x1a'),JSON['stringify'](_0x55b763,null,0x2));_0x14a2b2[_0xc174('0x1b')]=moment()['format'](_0xc174('0x1c'));_0x330dda=initGraph(_[_0xc174('0x1d')](_0x55b763,_0xc174('0xf')),_0x55b763['mxCell']);_0x39dcc8=new Vertices(_0x14a2b2,rpc,mailRpc);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x14a2b2[_0xc174('0x1e')],_0x14a2b2[_0xc174('0x1f')],_0x14a2b2[_0xc174('0x20')],_0x14a2b2[_0xc174('0x21')],_0x14a2b2['uniqueid']));_0x330dda['traverseBFS'](_0x55b763['start']['id'],function(_0x1f0a6e){try{_0x1f0a6e=_0x39dcc8[_0xc174('0x22')](_0x1f0a6e);logger[_0xc174('0x19')](_0xc174('0x23'),JSON['stringify'](_0x1f0a6e,null,0x2));if(_0x1f0a6e[_0xc174('0x24')]===_0xc174('0x25')){logger[_0xc174('0x26')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x14a2b2['context']=_0x1f0a6e[_0xc174('0x27')]||_0x14a2b2[_0xc174('0x27')];_0x14a2b2[_0xc174('0x28')]=_0x1f0a6e[_0xc174('0x28')];_0x14a2b2[_0xc174('0x29')]=_0x1f0a6e[_0xc174('0x29')]?_0x1f0a6e[_0xc174('0x29')]-0x1:0x1;return null;}else if(_0x1f0a6e&&_0x39dcc8[_0x1f0a6e[_0xc174('0x24')]]){_0x4a59ee=_0x39dcc8[_0x1f0a6e['agicommand']](_0x1f0a6e);logger['info'](_0xc174('0x2a'),JSON['stringify'](_0x4a59ee,null,0x2));if(_0x4a59ee&&_0x4a59ee[_0xc174('0x2b')]===AGI_CODE_SUCCESS&&_0x4a59ee[_0xc174('0x2c')]!==AGI_RESULT_ERROR&&!_0x14a2b2[_0xc174('0x2d')]){logger[_0xc174('0x19')](_0xc174('0x2a'),inspect(_0x4a59ee));return _[_0xc174('0x2e')](_0x4a59ee[_0xc174('0x2c')])?null:_0x4a59ee[_0xc174('0x2c')][_0xc174('0x2f')]();}else{logger[_0xc174('0x8')]('response',inspect(_0x4a59ee));return null;}}else{logger['error'](_0xc174('0x30'));return null;}}catch(_0x4b20a3){logger['error'](_0x4b20a3[_0xc174('0xa')]);return null;}});if(_0x55b763[_0xc174('0x31')]){logger[_0xc174('0x26')](util[_0xc174('0x32')](_0xc174('0x33'),_0x14a2b2[_0xc174('0x1e')],_0x14a2b2[_0xc174('0x1f')],_0x14a2b2['callerid'],_0x14a2b2[_0xc174('0x21')],_0x14a2b2[_0xc174('0x34')]));_0x330dda['traverseBFS'](_0x55b763['finally']['id'],function(_0x5a1ecd){try{_0x5a1ecd=_0x39dcc8['clear'](_0x5a1ecd);logger[_0xc174('0x19')](_0xc174('0x23'),JSON[_0xc174('0x35')](_0x5a1ecd,null,0x2));if(_0x5a1ecd&&_0x39dcc8[_0x5a1ecd['agicommand']]){_0x4a59ee=_0x39dcc8[_0x5a1ecd[_0xc174('0x24')]](_0x5a1ecd);if(_0x4a59ee){logger[_0xc174('0x19')](_0xc174('0x2a'),inspect(_0x4a59ee));return _['isUndefined'](_0x4a59ee[_0xc174('0x2c')])?null:_0x4a59ee[_0xc174('0x2c')][_0xc174('0x2f')]();}else{logger[_0xc174('0x8')]('response',inspect(_0x4a59ee));return null;}}else{logger['error'](_0xc174('0x30'));return null;}}catch(_0xc7612b){logger['error'](_0xc7612b[_0xc174('0xa')]);return null;}});}logger[_0xc174('0x26')](util['format'](_0xc174('0x36'),_0x14a2b2['arg_1'],_0x14a2b2['calleridname'],_0x14a2b2[_0xc174('0x20')],_0x14a2b2[_0xc174('0x21')],_0x14a2b2[_0xc174('0x34')]));logger[_0xc174('0x26')](util[_0xc174('0x32')](_0xc174('0x37'),_0x14a2b2['context'],_0x14a2b2['extension'],parseInt(_0x14a2b2[_0xc174('0x29')],0xa)+0x1));_0x14a2b2['continueAt'](_0x14a2b2[_0xc174('0x27')],_0x14a2b2[_0xc174('0x28')],parseInt(_0x14a2b2['priority'],0xa)+0x1);_0x14a2b2['close']();}function handleNotFound(_0x5b240e){logger[_0xc174('0x8')](util[_0xc174('0x32')]('Project\x20%s\x20not\x20found',_0x5b240e['arg_1']));_0x5b240e[_0xc174('0x38')](_0x5b240e['context'],_0x5b240e['extension'],parseInt(_0x5b240e['priority'],0xa)+0x1);_0x5b240e[_0xc174('0x39')]();}function handleUnpublished(_0x4b962a){logger[_0xc174('0x8')](util['format'](_0xc174('0x3a'),_0x4b962a[_0xc174('0x1e')]));_0x4b962a[_0xc174('0x38')](_0x4b962a['context'],_0x4b962a[_0xc174('0x28')],parseInt(_0x4b962a[_0xc174('0x29')],0xa)+0x1);_0x4b962a['close']();}module[_0xc174('0x3b')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x82d1=['./mailRpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','toJson','mxGraphModel','root','inspect','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','callerid','dnid','uniqueid','traverseBFS','start','clear','debug','vertex','context','extension','priority','response','stringify','code','result','evtHangup','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','Project\x20%s\x20not\x20found','continueAt','close','exports','lodash','moment','util','../../config/logger','./rpc'];(function(_0x4b902f,_0x527163){var _0x288a4=function(_0x3b1afc){while(--_0x3b1afc){_0x4b902f['push'](_0x4b902f['shift']());}};_0x288a4(++_0x527163);}(_0x82d1,0x1d3));var _0x182d=function(_0x432460,_0x5d446d){_0x432460=_0x432460-0x0;var _0x3fd04b=_0x82d1[_0x432460];return _0x3fd04b;};'use strict';var _=require(_0x182d('0x0'));var moment=require(_0x182d('0x1'));var parser=require('xml2json');var util=require(_0x182d('0x2'));var logger=require(_0x182d('0x3'))('agi');var rpc=require(_0x182d('0x4'));var mailRpc=require(_0x182d('0x5'));var Graph=require(_0x182d('0x6'));var Vertices=require(_0x182d('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x182d('0x8')]()['catch'](function(_0x474352){logger[_0x182d('0x9')](_0x182d('0xa'),_0x474352[_0x182d('0xb')]);return[];});}function addVertex(_0x1cedbb,_0x470bce,_0x5b215d){_0x470bce[_0x182d('0xc')]=_0x5b215d;if(_0x470bce[_0x182d('0xd')](_0x182d('0xe'))){_0x470bce[_0x182d('0xf')]=parseInt(_0x470bce[_0x182d('0xe')],0xa);}_0x1cedbb[_0x182d('0x10')](_[_0x182d('0x11')](_0x470bce,_0x182d('0x12')));}function initGraph(_0x1827c7,_0x1a3334){var _0x174efc=new Graph();for(var _0xc8f76b in _0x1827c7){if(_0x1827c7[_0x182d('0xd')](_0xc8f76b)){if(_['isArray'](_0x1827c7[_0xc8f76b])){for(var _0x3f92e0=0x0;_0x3f92e0<_0x1827c7[_0xc8f76b]['length'];_0x3f92e0+=0x1){addVertex(_0x174efc,_0x1827c7[_0xc8f76b][_0x3f92e0],_0xc8f76b);}}else{addVertex(_0x174efc,_0x1827c7[_0xc8f76b],_0xc8f76b);}}}for(var _0x4fc163=0x0;_0x4fc163<_0x1a3334[_0x182d('0x13')];_0x4fc163+=0x1){if(_0x1a3334[_0x4fc163][_0x182d('0x14')]&&_0x1a3334[_0x4fc163][_0x182d('0x15')]){_0x174efc['addEdge'](_0x1a3334[_0x4fc163][_0x182d('0x14')],_0x1a3334[_0x4fc163][_0x182d('0x15')],_0x1a3334[_0x4fc163]['value']);}}return _0x174efc;}function getRoot(_0x43ac69){return parser[_0x182d('0x16')](_0x43ac69,{'object':!![]})[_0x182d('0x17')][_0x182d('0x18')];}function inspect(_0x14f1fc){return util[_0x182d('0x19')](_0x14f1fc,{'showHidden':![],'depth':null});}function initialize(_0x14abb6,_0x37ab5b){var _0x5165bc=getRoot(_0x14abb6[_0x182d('0x1a')]);if(!_0x5165bc||!_0x5165bc['start'])return;var _0x471df4,_0x5dc693,_0x1af412;logger['debug'](_0x182d('0x18'),JSON['stringify'](_0x5165bc,null,0x2));_0x37ab5b[_0x182d('0x1b')]=moment()[_0x182d('0x1c')](_0x182d('0x1d'));_0x471df4=initGraph(_[_0x182d('0x11')](_0x5165bc,_0x182d('0x12')),_0x5165bc[_0x182d('0x12')]);_0x5dc693=new Vertices(_0x37ab5b,rpc,mailRpc);logger[_0x182d('0x1e')](util['format'](_0x182d('0x1f'),_0x37ab5b['arg_1'],_0x37ab5b['calleridname'],_0x37ab5b[_0x182d('0x20')],_0x37ab5b[_0x182d('0x21')],_0x37ab5b[_0x182d('0x22')]));_0x471df4[_0x182d('0x23')](_0x5165bc[_0x182d('0x24')]['id'],function(_0x18a4fd){try{_0x18a4fd=_0x5dc693[_0x182d('0x25')](_0x18a4fd);logger[_0x182d('0x26')](_0x182d('0x27'),JSON['stringify'](_0x18a4fd,null,0x2));if(_0x18a4fd['agicommand']==='gotoc'){logger[_0x182d('0x1e')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x37ab5b[_0x182d('0x28')]=_0x18a4fd[_0x182d('0x28')]||_0x37ab5b[_0x182d('0x28')];_0x37ab5b['extension']=_0x18a4fd[_0x182d('0x29')];_0x37ab5b[_0x182d('0x2a')]=_0x18a4fd[_0x182d('0x2a')]?_0x18a4fd[_0x182d('0x2a')]-0x1:0x1;return null;}else if(_0x18a4fd&&_0x5dc693[_0x18a4fd[_0x182d('0xc')]]){_0x1af412=_0x5dc693[_0x18a4fd[_0x182d('0xc')]](_0x18a4fd);logger[_0x182d('0x1e')](_0x182d('0x2b'),JSON[_0x182d('0x2c')](_0x1af412,null,0x2));if(_0x1af412&&_0x1af412[_0x182d('0x2d')]===AGI_CODE_SUCCESS&&_0x1af412[_0x182d('0x2e')]!==AGI_RESULT_ERROR&&!_0x37ab5b[_0x182d('0x2f')]){logger['debug']('response',inspect(_0x1af412));return _[_0x182d('0x30')](_0x1af412[_0x182d('0x2e')])?null:_0x1af412[_0x182d('0x2e')][_0x182d('0x31')]();}else{logger[_0x182d('0x9')]('response',inspect(_0x1af412));return null;}}else{logger[_0x182d('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x4747e8){logger[_0x182d('0x9')](_0x4747e8[_0x182d('0xb')]);return null;}});if(_0x5165bc[_0x182d('0x32')]){logger[_0x182d('0x1e')](util[_0x182d('0x1c')](_0x182d('0x33'),_0x37ab5b['arg_1'],_0x37ab5b['calleridname'],_0x37ab5b[_0x182d('0x20')],_0x37ab5b[_0x182d('0x21')],_0x37ab5b[_0x182d('0x22')]));_0x471df4[_0x182d('0x23')](_0x5165bc['finally']['id'],function(_0x153338){try{_0x153338=_0x5dc693[_0x182d('0x25')](_0x153338);logger[_0x182d('0x26')](_0x182d('0x27'),JSON['stringify'](_0x153338,null,0x2));if(_0x153338&&_0x5dc693[_0x153338['agicommand']]){_0x1af412=_0x5dc693[_0x153338['agicommand']](_0x153338);if(_0x1af412){logger[_0x182d('0x26')](_0x182d('0x2b'),inspect(_0x1af412));return _[_0x182d('0x30')](_0x1af412[_0x182d('0x2e')])?null:_0x1af412[_0x182d('0x2e')]['toString']();}else{logger[_0x182d('0x9')](_0x182d('0x2b'),inspect(_0x1af412));return null;}}else{logger['error'](_0x182d('0x34'));return null;}}catch(_0x387ad9){logger['error'](_0x387ad9[_0x182d('0xb')]);return null;}});}logger[_0x182d('0x1e')](util[_0x182d('0x1c')](_0x182d('0x35'),_0x37ab5b[_0x182d('0x36')],_0x37ab5b['calleridname'],_0x37ab5b['callerid'],_0x37ab5b[_0x182d('0x21')],_0x37ab5b[_0x182d('0x22')]));logger[_0x182d('0x1e')](util[_0x182d('0x1c')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x37ab5b[_0x182d('0x28')],_0x37ab5b[_0x182d('0x29')],parseInt(_0x37ab5b[_0x182d('0x2a')],0xa)+0x1));_0x37ab5b['continueAt'](_0x37ab5b[_0x182d('0x28')],_0x37ab5b[_0x182d('0x29')],parseInt(_0x37ab5b[_0x182d('0x2a')],0xa)+0x1);_0x37ab5b['close']();}function handleNotFound(_0x460531){logger['error'](util['format'](_0x182d('0x37'),_0x460531[_0x182d('0x36')]));_0x460531[_0x182d('0x38')](_0x460531['context'],_0x460531[_0x182d('0x29')],parseInt(_0x460531['priority'],0xa)+0x1);_0x460531[_0x182d('0x39')]();}function handleUnpublished(_0x6d8cbf){logger[_0x182d('0x9')](util[_0x182d('0x1c')]('Project\x20%s\x20not\x20published',_0x6d8cbf[_0x182d('0x36')]));_0x6d8cbf[_0x182d('0x38')](_0x6d8cbf[_0x182d('0x28')],_0x6d8cbf['extension'],parseInt(_0x6d8cbf[_0x182d('0x2a')],0xa)+0x1);_0x6d8cbf[_0x182d('0x39')]();}module[_0x182d('0x3a')]={'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 3b4ecbb..30bf180 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 _0x3176=['call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','split','trim','slice','length','emit','line','exports','util','stream','Transform'];(function(_0x118a4d,_0x1f8781){var _0x330686=function(_0x90a629){while(--_0x90a629){_0x118a4d['push'](_0x118a4d['shift']());}};_0x330686(++_0x1f8781);}(_0x3176,0x1d8));var _0x6317=function(_0x55403d,_0x2bf6fa){_0x55403d=_0x55403d-0x0;var _0x291e5a=_0x3176[_0x55403d];return _0x291e5a;};'use strict';var util=require(_0x6317('0x0'));var Transform=require(_0x6317('0x1'))[_0x6317('0x2')];function AGIReply(_0x131b0a){Transform[_0x6317('0x3')](this,_0x131b0a);this[_0x6317('0x4')]='';this[_0x6317('0x5')]=![];}util[_0x6317('0x6')](AGIReply,Transform);AGIReply[_0x6317('0x7')][_0x6317('0x8')]=function(_0x14cc52,_0x3540e8,_0x46f4c9){var _0x354521='\x0a',_0x1c95dc=['\x0a\x0a',_0x6317('0x9')],_0x2275a4=-0x1,_0x4afa7d=-0x1,_0x25c09c='',_0x2fa3c3=0x0,_0x416adc='',_0x540287='';this['_localBuffer']+=_0x14cc52['toString']();_0x416adc=this[_0x6317('0x4')];if(!this[_0x6317('0x5')]){_0x2fa3c3=0x0;while(_0x1c95dc[_0x2fa3c3]){while((_0x4afa7d=_0x416adc[_0x6317('0xa')](_0x1c95dc[_0x2fa3c3]))!=-0x1){_0x25c09c=_0x1c95dc[_0x2fa3c3];_0x540287=_0x416adc[_0x6317('0xb')](0x0,_0x4afa7d);_0x416adc=_0x416adc[_0x6317('0xb')](_0x4afa7d+_0x25c09c['length']);var _0x40a4a6=_0x540287[_0x6317('0xc')](_0x354521),_0x468be5=0x0,_0x4eaffc={},_0x359566='',_0x3f64fb='',_0x4aa69f=-0x1;while(_0x40a4a6[_0x468be5]){_0x4aa69f=_0x40a4a6[_0x468be5][_0x6317('0xa')](':');if(_0x4aa69f!=-0x1){_0x359566=_0x40a4a6[_0x468be5]['slice'](0x0,_0x4aa69f)[_0x6317('0xd')]();_0x3f64fb=_0x40a4a6[_0x468be5][_0x6317('0xe')](_0x4aa69f+0x1)[_0x6317('0xd')]();if(_0x359566[_0x6317('0xf')]>0x0){_0x4eaffc[_0x359566]=_0x3f64fb;}}else{}_0x468be5++;}this[_0x6317('0x10')]('headers',_0x4eaffc);this['_inBody']=!![];}_0x2fa3c3++;}this['_localBuffer']=_0x416adc;}else{while((_0x2275a4=_0x416adc[_0x6317('0xa')](_0x354521))!=-0x1){_0x540287=_0x416adc['substring'](0x0,_0x2275a4);this['emit'](_0x6317('0x11'),_0x540287);_0x416adc=_0x416adc['substring'](_0x2275a4+_0x354521['length']);}this[_0x6317('0x4')]=_0x416adc;}_0x46f4c9();};module[_0x6317('0x12')]=AGIReply; \ No newline at end of file +var _0x3856=['Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','trim','slice','emit','exports','util'];(function(_0x107562,_0x111892){var _0x3e111f=function(_0xf0a301){while(--_0xf0a301){_0x107562['push'](_0x107562['shift']());}};_0x3e111f(++_0x111892);}(_0x3856,0xfb));var _0x6385=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x3856[_0x338f73];return _0x163fdf;};'use strict';var util=require(_0x6385('0x0'));var Transform=require('stream')[_0x6385('0x1')];function AGIReply(_0x2e7209){Transform[_0x6385('0x2')](this,_0x2e7209);this[_0x6385('0x3')]='';this[_0x6385('0x4')]=![];}util[_0x6385('0x5')](AGIReply,Transform);AGIReply[_0x6385('0x6')][_0x6385('0x7')]=function(_0x5ae353,_0x1910cd,_0x414b44){var _0x4ce473='\x0a',_0x43f911=['\x0a\x0a',_0x6385('0x8')],_0x160021=-0x1,_0x1d3cdb=-0x1,_0x21a62c='',_0x421b28=0x0,_0x37673='',_0x48d955='';this[_0x6385('0x3')]+=_0x5ae353[_0x6385('0x9')]();_0x37673=this[_0x6385('0x3')];if(!this[_0x6385('0x4')]){_0x421b28=0x0;while(_0x43f911[_0x421b28]){while((_0x1d3cdb=_0x37673[_0x6385('0xa')](_0x43f911[_0x421b28]))!=-0x1){_0x21a62c=_0x43f911[_0x421b28];_0x48d955=_0x37673['substring'](0x0,_0x1d3cdb);_0x37673=_0x37673[_0x6385('0xb')](_0x1d3cdb+_0x21a62c[_0x6385('0xc')]);var _0x2d5a26=_0x48d955[_0x6385('0xd')](_0x4ce473),_0x3058ab=0x0,_0x2a53dc={},_0x3b9af1='',_0x4f8a37='',_0x5fcd91=-0x1;while(_0x2d5a26[_0x3058ab]){_0x5fcd91=_0x2d5a26[_0x3058ab][_0x6385('0xa')](':');if(_0x5fcd91!=-0x1){_0x3b9af1=_0x2d5a26[_0x3058ab]['slice'](0x0,_0x5fcd91)[_0x6385('0xe')]();_0x4f8a37=_0x2d5a26[_0x3058ab][_0x6385('0xf')](_0x5fcd91+0x1)['trim']();if(_0x3b9af1[_0x6385('0xc')]>0x0){_0x2a53dc[_0x3b9af1]=_0x4f8a37;}}else{}_0x3058ab++;}this['emit']('headers',_0x2a53dc);this[_0x6385('0x4')]=!![];}_0x421b28++;}this['_localBuffer']=_0x37673;}else{while((_0x160021=_0x37673[_0x6385('0xa')](_0x4ce473))!=-0x1){_0x48d955=_0x37673['substring'](0x0,_0x160021);this[_0x6385('0x10')]('line',_0x48d955);_0x37673=_0x37673[_0x6385('0xb')](_0x160021+_0x4ce473[_0x6385('0xc')]);}this[_0x6385('0x3')]=_0x37673;}_0x414b44();};module[_0x6385('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index fd48674..a49c9ed 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 _0xe0c3=['getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getIntervalById','ShowInterval','Interval','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','then','error','message','result','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3e0c('0x0'));var moment=require('moment');var jayson=require(_0x3e0c('0x1'));var client=jayson[_0x3e0c('0x2')][_0x3e0c('0x3')]({'port':0x2329});function request(_0x41c0bf,_0x27e01a){return new Promise(function(_0x410ec4,_0x31851c){return client[_0x3e0c('0x4')](_0x41c0bf,_0x27e01a)[_0x3e0c('0x5')](function(_0x511cfa){if(_0x511cfa['error']){return _0x31851c(_0x511cfa[_0x3e0c('0x6')][_0x3e0c('0x7')]);}else{return _0x410ec4(_0x511cfa[_0x3e0c('0x8')]);}})[_0x3e0c('0x9')](function(_0x29673d){return _0x31851c(_0x29673d);});});}exports[_0x3e0c('0xa')]=function(){return request(_0x3e0c('0xb'),{'options':{'raw':![],'attributes':['id',_0x3e0c('0xc'),_0x3e0c('0xd')]}});};exports[_0x3e0c('0xe')]=function(_0x9372d8){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x9372d8},'attributes':['production']}});};exports[_0x3e0c('0xf')]=function(_0x2a0b19){return request(_0x3e0c('0x10'),{'options':{'raw':![],'where':{'id':_0x2a0b19},'include':[{'model':_0x3e0c('0x11'),'as':_0x3e0c('0x12'),'include':[{'model':_0x3e0c('0x13'),'as':_0x3e0c('0x13')}]}],'attributes':['id','name',_0x3e0c('0x14')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x2589fc){return request(_0x3e0c('0x15'),{'options':{'where':{'id':_0x2589fc},'attributes':['name']}});};exports[_0x3e0c('0x16')]=function(_0x6d9c61){return request(_0x3e0c('0x17'),{'options':{'where':{'id':_0x6d9c61},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x18')]=function(_0x15a269){return request(_0x3e0c('0x19'),{'options':{'where':{'id':_0x15a269},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x1a')]=function(_0x42b1bd){return request(_0x3e0c('0x1b'),{'options':{'where':{'id':_0x42b1bd},'attributes':[_0x3e0c('0x1c')]}});};exports['getUserById']=function(_0x58c498){return request(_0x3e0c('0x1d'),{'options':{'where':{'id':_0x58c498},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x1e')]=function(_0x41b19f){return request(_0x3e0c('0x1f'),{'options':{'where':{'phone':_0x41b19f[_0x3e0c('0x20')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x2e4a4a){return request(_0x3e0c('0x21'),{'options':{'where':{'id':_0x2e4a4a},'attributes':[_0x3e0c('0xc')]}});};exports['getSoundById']=function(_0x60c48c){return request('ShowSound',{'options':{'where':{'id':_0x60c48c},'attributes':['save_name']}});};exports[_0x3e0c('0x22')]=function(_0x1f3bad){return request(_0x3e0c('0x23'),{'options':{'raw':![],'where':{'id':_0x1f3bad},'include':[{'model':_0x3e0c('0x24'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x3320c6){return request('ShowSmsAccount',{'options':{'where':{'id':_0x3320c6},'attributes':['id','name']}});};exports[_0x3e0c('0x25')]=function(_0x1769b1){return request(_0x3e0c('0x26'),{'body':_0x1769b1});};exports['createSquareDetailsReport']=function(_0x4272ee){return request(_0x3e0c('0x27'),{'body':_0x4272ee});};exports['createSquareReport']=function(_0x7dba09){return request(_0x3e0c('0x28'),{'body':_[_0x3e0c('0x29')](_0x7dba09,{'project_name':_0x7dba09[_0x3e0c('0x2a')],'prev_project_name':_0x7dba09['arg_2']||'','is_subproject':_0x7dba09[_0x3e0c('0x2b')]?!![]:![],'leaveAt':moment()[_0x3e0c('0x2c')](_0x3e0c('0x2d'))})});};exports[_0x3e0c('0x2e')]=function(_0x4c4bc3){return request(_0x3e0c('0x2f'),{'body':_0x4c4bc3});};exports['createSquareMessage']=function(_0x50de5c){return request(_0x3e0c('0x30'),{'body':_0x50de5c});};exports[_0x3e0c('0x31')]=function(_0x4d3ce2){return request(_0x3e0c('0x32'),{'options':{'raw':![],'where':{'phone':_0x4d3ce2[_0x3e0c('0x20')],'ListId':_0x4d3ce2[_0x3e0c('0x33')]}}})['then'](function(_0x44ecad){if(_0x44ecad){return _0x44ecad;}return request(_0x3e0c('0x34'),{'body':_0x4d3ce2});});};exports['getPauseById']=function(_0x1de9d9){return request(_0x3e0c('0x35'),{'options':{'where':{'id':_0x1de9d9},'attributes':[_0x3e0c('0xc')]}});};exports[_0x3e0c('0x36')]=function(_0x51b0e5,_0x345566){return request(_0x3e0c('0x37'),{'body':{'interface':_0x345566},'options':{'where':_0x51b0e5}});};exports[_0x3e0c('0x38')]=function(_0x5c8061,_0x1dcfe2,_0x1832c5){return request(_0x3e0c('0x39'),{'body':{'type':_0x1dcfe2,'uniqueid':_0x1832c5},'options':{'where':_0x5c8061}});};exports['agentUnpause']=function(_0x206bb2){return request(_0x3e0c('0x3a'),{'body':{},'options':{'where':_0x206bb2}});};exports[_0x3e0c('0x3b')]=function(_0x119409){return request(_0x3e0c('0x3c'),{'body':{},'options':{'where':_0x119409}});}; \ No newline at end of file +var _0x383a=['ShowSquareOdbc','dsn','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','getIntervalById','Interval','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','moment','jayson/promise','request','error','message','GetSquareProjects','getSquareProject','production','getMailAccountById','MailServerOut','CloudProvider','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x383a,0x1ad));var _0xa383=function(_0x2c396c,_0x4db177){_0x2c396c=_0x2c396c-0x0;var _0x26219b=_0x383a[_0x2c396c];return _0x26219b;};'use strict';var _=require('lodash');var moment=require(_0xa383('0x0'));var jayson=require(_0xa383('0x1'));var client=jayson['client']['http']({'port':0x2329});function request(_0x1e65e1,_0x5a053b){return new Promise(function(_0x15f485,_0x2d5b89){return client[_0xa383('0x2')](_0x1e65e1,_0x5a053b)['then'](function(_0x4d64f9){if(_0x4d64f9[_0xa383('0x3')]){return _0x2d5b89(_0x4d64f9[_0xa383('0x3')][_0xa383('0x4')]);}else{return _0x15f485(_0x4d64f9['result']);}})['catch'](function(_0x574ced){return _0x2d5b89(_0x574ced);});});}exports['getSquareProjects']=function(){return request(_0xa383('0x5'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0xa383('0x6')]=function(_0x3d63e4){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x3d63e4},'attributes':[_0xa383('0x7')]}});};exports[_0xa383('0x8')]=function(_0x4628c1){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4628c1},'include':[{'model':_0xa383('0x9'),'as':'Smtp','include':[{'model':'CloudProvider','as':_0xa383('0xa')}]}],'attributes':['id',_0xa383('0xb'),_0xa383('0xc')],'smtp':!![]}});};exports[_0xa383('0xd')]=function(_0x52edec){return request(_0xa383('0xe'),{'options':{'where':{'id':_0x52edec},'attributes':[_0xa383('0xb')]}});};exports[_0xa383('0xf')]=function(_0xdf9a86){return request(_0xa383('0x10'),{'options':{'where':{'id':_0xdf9a86},'attributes':[_0xa383('0xb')]}});};exports[_0xa383('0x11')]=function(_0x83a77a){return request('ShowVariable',{'options':{'where':{'id':_0x83a77a},'attributes':['name']}});};exports[_0xa383('0x12')]=function(_0x2d8794){return request(_0xa383('0x13'),{'options':{'where':{'id':_0x2d8794},'attributes':[_0xa383('0x14')]}});};exports['getUserById']=function(_0xb098f){return request('ShowUser',{'options':{'where':{'id':_0xb098f},'attributes':[_0xa383('0xb')]}});};exports[_0xa383('0x15')]=function(_0x2ccaf7){return request(_0xa383('0x16'),{'options':{'where':{'phone':_0x2ccaf7[_0xa383('0x17')]},'attributes':['id']}});};exports[_0xa383('0x18')]=function(_0x35e38f){return request(_0xa383('0x19'),{'options':{'where':{'id':_0x35e38f},'attributes':[_0xa383('0xb')]}});};exports[_0xa383('0x1a')]=function(_0x56de51){return request('ShowSound',{'options':{'where':{'id':_0x56de51},'attributes':['save_name']}});};exports[_0xa383('0x1b')]=function(_0x4109fc){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4109fc},'include':[{'model':_0xa383('0x1c'),'as':'Intervals'}]}});};exports[_0xa383('0x1d')]=function(_0x1f376f){return request('ShowSmsAccount',{'options':{'where':{'id':_0x1f376f},'attributes':['id',_0xa383('0xb')]}});};exports[_0xa383('0x1e')]=function(_0x4cc53b){return request(_0xa383('0x1f'),{'body':_0x4cc53b});};exports[_0xa383('0x20')]=function(_0x37bacb){return request(_0xa383('0x21'),{'body':_0x37bacb});};exports[_0xa383('0x22')]=function(_0x3c8e4c){return request('CreateSquareReport',{'body':_[_0xa383('0x23')](_0x3c8e4c,{'project_name':_0x3c8e4c[_0xa383('0x24')],'prev_project_name':_0x3c8e4c[_0xa383('0x25')]||'','is_subproject':_0x3c8e4c[_0xa383('0x25')]?!![]:![],'leaveAt':moment()[_0xa383('0x26')](_0xa383('0x27'))})});};exports[_0xa383('0x28')]=function(_0x32fec7){return request('CreateSquareRecording',{'body':_0x32fec7});};exports[_0xa383('0x29')]=function(_0x25ce4f){return request(_0xa383('0x2a'),{'body':_0x25ce4f});};exports[_0xa383('0x2b')]=function(_0x2640f4){return request(_0xa383('0x2c'),{'options':{'raw':![],'where':{'phone':_0x2640f4[_0xa383('0x17')],'ListId':_0x2640f4[_0xa383('0x2d')]}}})[_0xa383('0x2e')](function(_0x14c3f6){if(_0x14c3f6){return _0x14c3f6;}return request(_0xa383('0x2f'),{'body':_0x2640f4});});};exports['getPauseById']=function(_0x4d0ecb){return request(_0xa383('0x30'),{'options':{'where':{'id':_0x4d0ecb},'attributes':[_0xa383('0xb')]}});};exports[_0xa383('0x31')]=function(_0x5b46d4,_0x97193b){return request(_0xa383('0x32'),{'body':{'interface':_0x97193b},'options':{'where':_0x5b46d4}});};exports[_0xa383('0x33')]=function(_0x1394c5,_0x56866d,_0x32f851){return request(_0xa383('0x34'),{'body':{'type':_0x56866d,'uniqueid':_0x32f851},'options':{'where':_0x1394c5}});};exports[_0xa383('0x35')]=function(_0x110a19){return request('UnpauseUser',{'body':{},'options':{'where':_0x110a19}});};exports[_0xa383('0x36')]=function(_0x125eba){return request(_0xa383('0x37'),{'body':{},'options':{'where':_0x125eba}});}; \ 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 5b9a555..9be0645 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 _0x908e=['./polly','./lex'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0x908e,0x182));var _0xe908=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0x908e[_0x322522];return _0x293bcf;};var polly=require(_0xe908('0x0'));var lex=require(_0xe908('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xfc46=['./polly','exports'];(function(_0xf961f9,_0x24c7d2){var _0x18fd32=function(_0x4edda2){while(--_0x4edda2){_0xf961f9['push'](_0xf961f9['shift']());}};_0x18fd32(++_0x24c7d2);}(_0xfc46,0x9a));var _0x6fc4=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0xfc46[_0x3048ea];return _0x1a13c4;};var polly=require(_0x6fc4('0x0'));var lex=require('./lex');module[_0x6fc4('0x1')]={'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 968ca26..a9ec881 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 _0x9bde=['exports'];(function(_0x3c4bc1,_0x48e95d){var _0xe614b6=function(_0x9f1876){while(--_0x9f1876){_0x3c4bc1['push'](_0x3c4bc1['shift']());}};_0xe614b6(++_0x48e95d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x50bf32,_0x318a99){_0x50bf32=_0x50bf32-0x0;var _0x2f6b10=_0x9bde[_0x50bf32];return _0x2f6b10;};'use strict';var lex=require('./lib/api');module[_0xe9bd('0x0')]=function(_0x4defda,_0xc79e0b,_0x4c63ca,_0x51786f,_0x3005aa,_0x131f6a){return lex(_0x4defda,_0xc79e0b,_0x4c63ca,_0x51786f,_0x3005aa,_0x131f6a);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e){return lex(_0x2c1d27,_0x4c4c00,_0x4b5765,_0x29e4c8,_0x110824,_0x394a1e);}; \ 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 072a2fa..24e9366 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(_0xa086c2,_0x21cc9c){var _0x2b8e68=function(_0x822d93){while(--_0x822d93){_0xa086c2['push'](_0xa086c2['shift']());}};_0x2b8e68(++_0x21cc9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x1ed873,_0x2cf664){var _0x19736f=function(_0x13fb6e){while(--_0x13fb6e){_0x1ed873['push'](_0x1ed873['shift']());}};_0x19736f(++_0x2cf664);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 e06f561..adb4575 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 _0x2a3a=['exports'];(function(_0x5a44b7,_0x2170e9){var _0x33fefe=function(_0x17d856){while(--_0x17d856){_0x5a44b7['push'](_0x5a44b7['shift']());}};_0x33fefe(++_0x2170e9);}(_0x2a3a,0x6f));var _0xa2a3=function(_0x4b56cd,_0x500b69){_0x4b56cd=_0x4b56cd-0x0;var _0x5f4e10=_0x2a3a[_0x4b56cd];return _0x5f4e10;};'use strict';var polly=require('./lib/api');module[_0xa2a3('0x0')]=function(_0x5aa83b,_0x59a6dc,_0x124240,_0x1a3b91,_0x319150,_0x503c93,_0x5af94e){return polly(_0x5aa83b,_0x59a6dc,_0x124240,_0x1a3b91,_0x319150,_0x503c93,_0x5af94e);}; \ No newline at end of file +var _0x805c=['exports','./lib/api'];(function(_0x4b4277,_0x22676f){var _0x1ff405=function(_0x2fa9e2){while(--_0x2fa9e2){_0x4b4277['push'](_0x4b4277['shift']());}};_0x1ff405(++_0x22676f);}(_0x805c,0x6f));var _0xc805=function(_0x2c50c0,_0x1913f4){_0x2c50c0=_0x2c50c0-0x0;var _0x574a23=_0x805c[_0x2c50c0];return _0x574a23;};'use strict';var polly=require(_0xc805('0x0'));module[_0xc805('0x1')]=function(_0x15ccdf,_0x5d3fdd,_0xb98c9d,_0x476ece,_0x3e41c5,_0x26c7be,_0x7e6259){return polly(_0x15ccdf,_0x5d3fdd,_0xb98c9d,_0x476ece,_0x3e41c5,_0x26c7be,_0x7e6259);}; \ 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 b3d3fbb..2bb01de 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 _0x5acb=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x5c69e7,_0x5bd149){var _0x4286c6=function(_0x42931c){while(--_0x42931c){_0x5c69e7['push'](_0x5c69e7['shift']());}};_0x4286c6(++_0x5bd149);}(_0x5acb,0x1f4));var _0xb5ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5acb[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0xb5ac('0x0'));var BPromise=require(_0xb5ac('0x1'));var rs=require(_0xb5ac('0x2'));var AWS=require(_0xb5ac('0x3'));function pollyResult(_0x3d31b5,_0x34ad12,_0x117fd9){return new BPromise(function(_0x5abfd3,_0x67f9e2){_0x3d31b5[_0xb5ac('0x4')](_0x34ad12,function(_0x17a419,_0x5aed70){if(_0x17a419){_0x67f9e2(_0x17a419);}else if(_0x5aed70){if(_0x5aed70[_0xb5ac('0x5')]instanceof Buffer){fs[_0xb5ac('0x6')](_0x117fd9,_0x5aed70['AudioStream'],function(_0x89f0d5){if(_0x89f0d5){_0x67f9e2(_0x89f0d5);}else{_0x5abfd3();}});}else{_0x67f9e2(new Error(_0xb5ac('0x7')));}}else{_0x67f9e2(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xb5ac('0x8')]=function(_0x595635,_0x415ff7,_0x2d2856,_0x596c48,_0x262637,_0x453bbd,_0xfe3d63){var _0x2bba51=new AWS[(_0xb5ac('0x9'))]({'accessKeyId':_0x595635,'secretAccessKey':_0x415ff7,'region':_0x2d2856});var _0x56687c={'Text':_0x262637,'TextType':_0x453bbd||_0xb5ac('0xa'),'OutputFormat':'mp3','VoiceId':_0x596c48};return pollyResult(_0x2bba51,_0x56687c,_0xfe3d63);}; \ No newline at end of file +var _0x9f85=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','synthesizeSpeech'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9f85,0x9f));var _0x59f8=function(_0x58d722,_0x239a59){_0x58d722=_0x58d722-0x0;var _0x486753=_0x9f85[_0x58d722];return _0x486753;};'use strict';var fs=require('fs');var path=require(_0x59f8('0x0'));var BPromise=require(_0x59f8('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x1e0f16,_0x4db1d1,_0x2a081d){return new BPromise(function(_0x3d97cf,_0x3bb1f5){_0x1e0f16[_0x59f8('0x2')](_0x4db1d1,function(_0x1ab89c,_0x5b6f0b){if(_0x1ab89c){_0x3bb1f5(_0x1ab89c);}else if(_0x5b6f0b){if(_0x5b6f0b[_0x59f8('0x3')]instanceof Buffer){fs['writeFile'](_0x2a081d,_0x5b6f0b[_0x59f8('0x3')],function(_0x2f5bf7){if(_0x2f5bf7){_0x3bb1f5(_0x2f5bf7);}else{_0x3d97cf();}});}else{_0x3bb1f5(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x3bb1f5(new Error(_0x59f8('0x4')));}});});}module[_0x59f8('0x5')]=function(_0x262bfb,_0x53553e,_0x1e3eb2,_0xe335d3,_0x5b3ba7,_0x331d90,_0x5a50dd){var _0x51c41c=new AWS[(_0x59f8('0x6'))]({'accessKeyId':_0x262bfb,'secretAccessKey':_0x53553e,'region':_0x1e3eb2});var _0x4a6a9b={'Text':_0x5b3ba7,'TextType':_0x331d90||_0x59f8('0x7'),'OutputFormat':_0x59f8('0x8'),'VoiceId':_0xe335d3};return pollyResult(_0x51c41c,_0x4a6a9b,_0x5a50dd);}; \ 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 203c359..cca46cc 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 _0xa3eb=['exports','./lib/api'];(function(_0x39393e,_0x33106f){var _0x1b15b3=function(_0x55dc21){while(--_0x55dc21){_0x39393e['push'](_0x39393e['shift']());}};_0x1b15b3(++_0x33106f);}(_0xa3eb,0x18d));var _0xba3e=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xa3eb[_0xb0f7c3];return _0x28ea68;};'use strict';var asr=require(_0xba3e('0x0'));module[_0xba3e('0x1')]=function(_0x3f08a5,_0x29b29d,_0x402346,_0x3dfef0){return asr(_0x3f08a5,_0x29b29d,_0x402346);}; \ No newline at end of file +var _0xda32=['./lib/api','exports'];(function(_0x3fa5da,_0x5a5e40){var _0x47fa81=function(_0x221002){while(--_0x221002){_0x3fa5da['push'](_0x3fa5da['shift']());}};_0x47fa81(++_0x5a5e40);}(_0xda32,0x164));var _0x2da3=function(_0x4fbea9,_0x5d2484){_0x4fbea9=_0x4fbea9-0x0;var _0x3bc362=_0xda32[_0x4fbea9];return _0x3bc362;};'use strict';var asr=require(_0x2da3('0x0'));module[_0x2da3('0x1')]=function(_0x55d3b4,_0x449cc8,_0x250684,_0x98090d){return asr(_0x55d3b4,_0x449cc8,_0x250684);}; \ 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 ca81551..be176b4 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 _0x5645=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','POST','LINEAR16','8000','url','bluebird'];(function(_0x3bbdc6,_0x262329){var _0x50a293=function(_0x29a49a){while(--_0x29a49a){_0x3bbdc6['push'](_0x3bbdc6['shift']());}};_0x50a293(++_0x262329);}(_0x5645,0x19e));var _0x5564=function(_0x2adf46,_0xab375d){_0x2adf46=_0x2adf46-0x0;var _0x40fb40=_0x5645[_0x2adf46];return _0x40fb40;};'use strict';var url=require(_0x5564('0x0'));var BPromise=require(_0x5564('0x1'));var fs=require('fs');var host=_0x5564('0x2');module[_0x5564('0x3')]=function(_0x26c54d,_0x5ecd66,_0x241816){return new BPromise(function(_0x64ae4d,_0x1240cd){var _0x821a1a;if(typeof _0x26c54d!==_0x5564('0x4')||_0x26c54d[_0x5564('0x5')]===0x0){return _0x1240cd(_0x5564('0x6'));}if(typeof _0x5ecd66!==_0x5564('0x4')||_0x5ecd66[_0x5564('0x5')]===0x0){return _0x1240cd('key\x20should\x20be\x20a\x20string');}if(typeof _0x241816!=='undefined'&&(typeof _0x241816!==_0x5564('0x4')||_0x241816[_0x5564('0x5')]===0x0)){return _0x1240cd(_0x5564('0x7'));}try{_0x821a1a=fs[_0x5564('0x8')](_0x26c54d)[_0x5564('0x9')]('base64');}catch(_0x1ba45a){return _0x1240cd(_0x1ba45a);}return _0x64ae4d({'method':_0x5564('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x5ecd66,'body':{'config':{'encoding':_0x5564('0xb'),'sampleRateHertz':_0x5564('0xc'),'languageCode':_0x241816},'audio':{'content':_0x821a1a}},'json':!![]});});}; \ No newline at end of file +var _0x1094=['8000','url','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key='];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x1094,0x143));var _0x4109=function(_0x265003,_0xf0f023){_0x265003=_0x265003-0x0;var _0x33c743=_0x1094[_0x265003];return _0x33c743;};'use strict';var url=require(_0x4109('0x0'));var BPromise=require(_0x4109('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x4109('0x2')]=function(_0x52b156,_0x42557f,_0x32d6c3){return new BPromise(function(_0x308136,_0x181d79){var _0x36e917;if(typeof _0x52b156!=='string'||_0x52b156[_0x4109('0x3')]===0x0){return _0x181d79(_0x4109('0x4'));}if(typeof _0x42557f!==_0x4109('0x5')||_0x42557f[_0x4109('0x3')]===0x0){return _0x181d79(_0x4109('0x6'));}if(typeof _0x32d6c3!==_0x4109('0x7')&&(typeof _0x32d6c3!=='string'||_0x32d6c3[_0x4109('0x3')]===0x0)){return _0x181d79(_0x4109('0x8'));}try{_0x36e917=fs[_0x4109('0x9')](_0x52b156)[_0x4109('0xa')](_0x4109('0xb'));}catch(_0x4af1f9){return _0x181d79(_0x4af1f9);}return _0x308136({'method':'POST','uri':host+_0x4109('0xc')+_0x42557f,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x4109('0xd'),'languageCode':_0x32d6c3},'audio':{'content':_0x36e917}},'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 ea8c5a9..26a6fca 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 _0xbc18=['./asr'];(function(_0x5841ae,_0xd83e28){var _0x3fa6e9=function(_0x1e0ffc){while(--_0x1e0ffc){_0x5841ae['push'](_0x5841ae['shift']());}};_0x3fa6e9(++_0xd83e28);}(_0xbc18,0x171));var _0x8bc1=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0xbc18[_0x320b8e];return _0x55a10a;};var asr=require(_0x8bc1('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x53d0=['exports','./asr'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x53d0,0x73));var _0x053d=function(_0xdcc8b2,_0x3ef9c3){_0xdcc8b2=_0xdcc8b2-0x0;var _0x25eca9=_0x53d0[_0xdcc8b2];return _0x25eca9;};var asr=require(_0x053d('0x0'));module[_0x053d('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 5e7fb1a..b9562ac 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 _0x5109=['sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','request\x20to\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','protocol','\x20failed,\x20status\x20code\x20=\x20','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','voice','audioConfig','MP3','text:synthesize','POST','from','audioContent','writeFile','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','data','.mp3','goggleTTS\x20path','googleASR','alternatives','transcript','results','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','source','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','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'];(function(_0x14bbf3,_0xca820f){var _0x1b280c=function(_0x2a5314){while(--_0x2a5314){_0x14bbf3['push'](_0x14bbf3['shift']());}};_0x1b280c(++_0xca820f);}(_0x5109,0x12d));var _0x9510=function(_0x2c0125,_0x5edafe){_0x2c0125=_0x2c0125-0x0;var _0x30546b=_0x5109[_0x2c0125];return _0x30546b;};'use strict';var apiai=require(_0x9510('0x0'));var BPromise=require(_0x9510('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0x9510('0x2'));var md5=require(_0x9510('0x3'));var path=require(_0x9510('0x4'));var querystring=require('querystring');var rp=require(_0x9510('0x5'));var rs=require(_0x9510('0x6'));var sox=require(_0x9510('0x7'));var tts=require(_0x9510('0x8'));var urlParse=require(_0x9510('0x9'))['parse'];var util=require(_0x9510('0xa'));var aws=require(_0x9510('0xb'));var google=require(_0x9510('0xc'));var sestek=require(_0x9510('0xd'));var tilde=require(_0x9510('0xe'));var logger=require('../../../config/logger')(_0x9510('0xf'));var ISPEECH_API=_0x9510('0x10');function downloadFile(_0x2dcceb,_0x517382){return new BPromise(function(_0xc74ebf,_0x497ee6){var _0x4fa2c5=urlParse(_0x2dcceb);var _0xa75a27=_0x4fa2c5['protocol']===_0x9510('0x11')?https:http;var _0x455ff9={'host':_0x4fa2c5[_0x9510('0x12')],'path':_0x4fa2c5[_0x9510('0x4')],'headers':{'user-agent':_0x9510('0x13')}};_0xa75a27[_0x9510('0x14')](_0x455ff9,function(_0x1f36d2){if(_0x1f36d2['statusCode']!==0xc8){logger['error'](_0x9510('0x15')+_0x2dcceb+'\x20failed,\x20status\x20code\x20=\x20'+_0x1f36d2[_0x9510('0x16')]+'\x20('+_0x1f36d2[_0x9510('0x17')]+')');_0x497ee6(new Error(_0x9510('0x15')+_0x2dcceb+'\x20failed,\x20status\x20code\x20=\x20'+_0x1f36d2[_0x9510('0x16')]+'\x20('+_0x1f36d2[_0x9510('0x17')]+')'));return;}var _0x536333=fs[_0x9510('0x18')](_0x517382);_0x536333['on'](_0x9510('0x19'),function(){logger[_0x9510('0x1a')](_0x9510('0x1b'));_0x536333[_0x9510('0x1c')](_0xc74ebf);});_0x536333['on'](_0x9510('0x1d'),function(_0x3789e2){fs[_0x9510('0x1e')](_0x517382);logger['error'](_0x9510('0x1f'),_0x3789e2);_0x497ee6(_0x3789e2);});_0x1f36d2[_0x9510('0x20')](_0x536333);})['on'](_0x9510('0x1d'),function(_0x292dd9){logger[_0x9510('0x1d')](_0x292dd9);_0x497ee6(_0x292dd9);})[_0x9510('0x21')]();});}function uploadFile(_0x15d506){return new BPromise(function(_0x4fd4c5,_0x39810f){var _0x1717bf=urlParse(_0x15d506);var _0x214692=_0x1717bf[_0x9510('0x22')]===_0x9510('0x11')?https:http;var _0x2fa1d8={'host':_0x1717bf[_0x9510('0x12')],'path':_0x1717bf[_0x9510('0x4')],'headers':{'user-agent':_0x9510('0x13')}};_0x214692[_0x9510('0x14')](_0x2fa1d8,function(_0x760e53){if(_0x760e53[_0x9510('0x16')]!==0xc8){_0x39810f(new Error(_0x9510('0x15')+_0x15d506+_0x9510('0x23')+_0x760e53['statusCode']+'\x20('+_0x760e53[_0x9510('0x17')]+')'));return;}var _0xa13db4='';_0x760e53['on']('data',function(_0x2a3790){_0xa13db4+=_0x2a3790;});_0x760e53['on'](_0x9510('0x21'),function(){_0x4fd4c5(_0xa13db4);});})['on'](_0x9510('0x1d'),function(_0x2ff7c5){_0x39810f(_0x2ff7c5);})[_0x9510('0x21')]();});}function convertFile(_0x3699e0,_0x3db47e){return new BPromise(function(_0x3b2a20,_0x1fbd3a){var _0x3a693e=sox[_0x9510('0x24')](_0x3699e0,_0x3db47e,{'sampleRate':0x1f40,'format':_0x9510('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a693e['on'](_0x9510('0x1d'),function(_0x499d66){logger[_0x9510('0x1d')](_0x9510('0x26'),_0x499d66);_0x1fbd3a(_0x499d66);});_0x3a693e['on'](_0x9510('0x21'),function(){logger['info'](_0x9510('0x27'));_0x3b2a20();});_0x3a693e[_0x9510('0x28')]();});}function base64Decode(_0x39eb07,_0x2c25f0){var _0x74eb3f=path[_0x9510('0x29')](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+'.wav');fs[_0x9510('0x2c')](_0x74eb3f,_0x39eb07,_0x9510('0x2d'));return convertFile(_0x74eb3f,_0x2c25f0)[_0x9510('0x2e')](function(){try{fs[_0x9510('0x1e')](_0x74eb3f);fs[_0x9510('0x2f')](_0x2c25f0,_0x9510('0x30'));}catch(_0x5d72a9){logger[_0x9510('0x1d')](_0x5d72a9);}return _0x2c25f0[_0x9510('0x31')]('.')[0x0];});}function base64Encode(_0x14f1e6){var _0x1ecf95=fs[_0x9510('0x32')](_0x14f1e6);return new Buffer(_0x1ecf95)[_0x9510('0x33')](_0x9510('0x2d'));}exports['googleCloudTTS']=function(_0x55b4ed,_0x4c622e,_0x25a551,_0x4994f6,_0x560a8b,_0x329bee){var _0x429d19,_0x2d59c4;var _0x36ef83=_0x9510('0x34');var _0xb13b43=_0x9510('0x35')+_0x55b4ed;var _0x23a6ca={};if(_0x4c622e==='ssml'){_0x23a6ca['input']={'ssml':_0x25a551};}else{_0x23a6ca['input']={'text':_0x25a551};};_0x23a6ca[_0x9510('0x36')]={'languageCode':_0x4994f6,'ssmlGender':_0x560a8b};_0x23a6ca[_0x9510('0x37')]={'audioEncoding':_0x9510('0x38'),'sampleRateHertz':0x1f40};var _0x4bc90b={'url':_0x36ef83+_0x9510('0x39')+_0xb13b43,'method':_0x9510('0x3a'),'json':!![],'body':_0x23a6ca};return rp(_0x4bc90b)[_0x9510('0x2e')](function(_0x38155c){return new BPromise(function(_0x449e36,_0x114e98){_0x429d19=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x5e0689=Buffer[_0x9510('0x3b')](_0x38155c[_0x9510('0x3c')],_0x9510('0x2d'));return fs[_0x9510('0x3d')](_0x429d19,_0x5e0689,function(_0x540c60){_0x114e98(_0x540c60);},function(_0x113d43){fs[_0x9510('0x2f')](_0x429d19,'777');_0x449e36(_0x113d43);});});})['then'](function(_0x45c813){_0x2d59c4=path[_0x9510('0x29')](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+_0x9510('0x3e'));return convertFile(_0x429d19,_0x2d59c4);})['then'](function(){try{fs[_0x9510('0x1e')](_0x429d19);fs[_0x9510('0x2f')](_0x2d59c4,_0x9510('0x30'));}catch(_0x13bbbf){logger[_0x9510('0x1d')](_0x13bbbf);}logger[_0x9510('0x1a')](_0x9510('0x3f'),_0x2d59c4[_0x9510('0x31')]('.')[0x0]);return _0x2d59c4[_0x9510('0x31')]('.')[0x0];});};exports[_0x9510('0x40')]=function(_0x4f05dd,_0x1d8d65){var _0x2d520a=_0x9510('0x41');var _0x6c9234,_0xf23528;var _0x3ae3ee;var _0x300523={'encoding':_0x9510('0x42'),'method':'POST','timeout':0x2710,'url':_0x2d520a,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x9510('0x43')+encodeURIComponent(JSON[_0x9510('0x44')]([[[_0x9510('0x45'),JSON[_0x9510('0x44')]([_0x4f05dd,_0x1d8d65||'en',![],'null']),null,'generic']]]))};return rp(_0x300523)[_0x9510('0x2e')](function(_0x559e75){try{_0x3ae3ee=eval(_0x559e75[_0x9510('0x46')](0x5))[0x0][0x2];}catch(_0x154028){throw new Error('parse\x20response\x20failed:\x0a'+_0x559e75['data']);}if(!_0x3ae3ee){if(_0x4f05dd[_0x9510('0x47')]>0xc8){throw new Error(_0x9510('0x48'));}else{throw new Error(_0x9510('0x49')+_0x1d8d65+_0x9510('0x4a'));}}try{_0x3ae3ee=eval(_0x3ae3ee)[0x0];}catch(_0x26bb1d){throw new Error(_0x9510('0x4b')+res[_0x9510('0x4c')]);}const _0x20d409=_0x3ae3ee;_0x6c9234=path[_0x9510('0x29')](__dirname,'tmp',rs[_0x9510('0x2b')](0x4)+_0x9510('0x4d'));fs[_0x9510('0x2c')](_0x6c9234,_0x3ae3ee,{'encoding':'base64'});_0xf23528=path['resolve'](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+_0x9510('0x3e'));return convertFile(_0x6c9234,_0xf23528);})[_0x9510('0x2e')](function(){try{fs['unlink'](_0x6c9234);fs[_0x9510('0x2f')](_0xf23528,_0x9510('0x30'));}catch(_0x39ff2c){logger[_0x9510('0x1d')](_0x39ff2c);}logger['info'](_0x9510('0x4e'),_0xf23528[_0x9510('0x31')]('.')[0x0]);return _0xf23528[_0x9510('0x31')]('.')[0x0];});};exports[_0x9510('0x4f')]=function(_0x386fc9,_0x322c3d,_0x4eb18b){return google['asr'](_0x386fc9,_0x322c3d,_0x4eb18b)[_0x9510('0x2e')](function(_0x218008){logger[_0x9510('0x1a')](_0x218008['uri']);return rp(_0x218008);})['then'](function(_0x463020){var _0x1f950e='';var _0x301d91=0x0;try{fs['unlink'](_0x386fc9);}catch(_0x180b32){logger[_0x9510('0x1d')](_0x180b32);}if(_0x463020&&_0x463020['results']){_0x1f950e=_0x463020['results']['map'](function(_0x1c15fc){return _0x1c15fc&&_0x1c15fc[_0x9510('0x50')][0x0]&&_0x1c15fc[_0x9510('0x50')][0x0]['transcript']?_0x1c15fc[_0x9510('0x50')][0x0][_0x9510('0x51')]:'';})['join']('\x0a');_0x301d91=_0x463020[_0x9510('0x52')][_0x9510('0x53')](function(_0x234cc3){return _0x234cc3&&_0x234cc3[_0x9510('0x50')][0x0]&&_0x234cc3['alternatives'][0x0][_0x9510('0x54')]?_0x234cc3[_0x9510('0x50')][0x0][_0x9510('0x54')]:0x0;})['join']('\x0a');}logger['info'](_0x9510('0x55'),_0x1f950e);logger[_0x9510('0x1a')](_0x9510('0x56'),_0x301d91);return{'transcript':_0x1f950e,'confidence':_0x301d91};})[_0x9510('0x57')](function(_0x47187c){logger['error'](_0x9510('0x58'),_0x47187c[_0x9510('0x16')],_0x47187c[_0x9510('0x59')],_0x47187c[_0x9510('0x5a')]);});};exports[_0x9510('0x5b')]=function(_0x6cab15,_0x4aac2c,_0x408d83,_0x417829){var _0x3ecd46=apiai(_0x4aac2c,{'language':_0x417829||'en'});return _0x3ecd46[_0x9510('0x5c')](_0x408d83,{'sessionId':md5(_0x6cab15)})[_0x9510('0x2e')](function(_0x151eb7){logger['info'](JSON[_0x9510('0x44')](_0x151eb7));return{'source':_0x151eb7[_0x9510('0x5d')][_0x9510('0x5e')],'resolvedQuery':_0x151eb7[_0x9510('0x5d')]['resolvedQuery'],'action':_0x151eb7[_0x9510('0x5d')]['action'],'actionIncomplete':_0x151eb7['result'][_0x9510('0x5f')],'speech':_0x151eb7[_0x9510('0x5d')][_0x9510('0x60')][_0x9510('0x61')],'score':_0x151eb7[_0x9510('0x5d')][_0x9510('0x62')],'statusCode':_0x151eb7[_0x9510('0x63')][_0x9510('0x64')],'endConversation':_0x151eb7[_0x9510('0x5d')][_0x9510('0x65')][_0x9510('0x66')]||![],'isFallbackIntent':_0x151eb7[_0x9510('0x5d')]['metadata'][_0x9510('0x67')]};});};exports[_0x9510('0x68')]=function(_0x51c97b,_0x12ba76,_0x4ef522,_0x318c1e,_0x127ed2,_0x4c9061){var _0x4e8872=_0x318c1e[_0x9510('0x69')](/\\n/g,'\x0a');var _0x1df9c1={'credentials':{'private_key':_0x4e8872,'client_email':_0x4ef522}};var _0x465572=new dialogflow[(_0x9510('0x6a'))](_0x1df9c1);var _0x1f7630=_0x465572[_0x9510('0x6b')](_0x12ba76,md5(_0x51c97b));var _0x40ccd5={'session':_0x1f7630,'queryInput':{'text':{'text':_0x127ed2,'languageCode':_0x4c9061}}};return _0x465572['detectIntent'](_0x40ccd5)['then'](function(_0x58b3d0){if(_0x58b3d0&&_0x58b3d0['length']){logger['info'](_0x9510('0x6c'),JSON[_0x9510('0x44')](_0x58b3d0));var _0x5e2b9f=_0x58b3d0[0x0];if(_0x5e2b9f){var _0x515076={'action':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x6e')],'allRequiredParamsPresent':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x6f')],'endConversation':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x70')]&&_0x5e2b9f['queryResult'][_0x9510('0x70')][_0x9510('0x71')]?_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x70')][_0x9510('0x71')][_0x9510('0x72')][_0x9510('0x73')]:![],'fulfillmentText':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x74')],'intentName':_0x5e2b9f['queryResult'][_0x9510('0x75')][_0x9510('0x59')],'intentDisplayName':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x75')][_0x9510('0x76')],'isFallbackIntent':_0x5e2b9f[_0x9510('0x6d')]['intent'][_0x9510('0x77')],'languageCode':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x78')],'queryText':_0x5e2b9f[_0x9510('0x6d')][_0x9510('0x79')],'responseId':_0x5e2b9f['responseId'],'score':_0x5e2b9f['queryResult'][_0x9510('0x7a')],'speech':_0x5e2b9f[_0x9510('0x6d')]['fulfillmentText'],'providerResponse':JSON[_0x9510('0x44')](_0x58b3d0)};return _0x515076;}}});};exports[_0x9510('0x7b')]=function(_0x460e2f,_0x48a244,_0x389c32,_0x3baa9f){return tilde['asr'](_0x460e2f,_0x48a244,_0x389c32,_0x3baa9f)[_0x9510('0x2e')](function(_0x2449aa){try{fs[_0x9510('0x1e')](_0x460e2f);}catch(_0x469221){logger['error'](_0x469221);}logger[_0x9510('0x1a')](_0x9510('0x7c'),_0x2449aa[_0x9510('0x51')]);logger[_0x9510('0x1a')](_0x9510('0x7d'),_0x2449aa['confidence']);return _0x2449aa;});};exports[_0x9510('0x7e')]=function(_0x97eb1e,_0x3e3e03,_0x1cf785,_0x2fcc7e,_0x2406e0,_0x11b5d7){var _0x392800=path[_0x9510('0x29')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x3f35ed;return aws[_0x9510('0x7f')](_0x97eb1e,_0x3e3e03,_0x1cf785,_0x2fcc7e,_0x2406e0,_0x11b5d7,_0x392800)['then'](function(){_0x3f35ed=path[_0x9510('0x29')](__dirname,_0x9510('0x2a'),rs[_0x9510('0x2b')](0x4)+'.wav');return convertFile(_0x392800,_0x3f35ed);})['then'](function(){try{fs['unlink'](_0x392800);fs[_0x9510('0x2f')](_0x3f35ed,'777');}catch(_0x17441b){logger['error'](_0x17441b);}return _0x3f35ed[_0x9510('0x31')]('.')[0x0];});};exports['awsLex']=function(_0xc215f9,_0xd29ad,_0x36a836,_0x31b6f2,_0x5e3c57,_0x1ba409){return aws[_0x9510('0x80')](_0xc215f9,_0xd29ad,_0x36a836,_0x31b6f2,_0x5e3c57,_0x1ba409)['then'](function(_0x413e10){logger[_0x9510('0x1a')](JSON[_0x9510('0x44')](_0x413e10));return _0x413e10;});};exports[_0x9510('0x81')]=function(_0x200f44,_0x29a4ff,_0x22edd8,_0x2da611){var _0x3872a3=util[_0x9510('0x82')](_0x9510('0x83'),ISPEECH_API,_0x200f44,encodeURIComponent(_0x29a4ff),_0x22edd8,_0x2da611);var _0x3d3e8d=path['resolve'](__dirname,'tmp',rs[_0x9510('0x2b')](0x4)+_0x9510('0x4d'));var _0x45b57d;return downloadFile(_0x3872a3,_0x3d3e8d)['then'](function(){_0x45b57d=path['resolve'](__dirname,_0x9510('0x2a'),rs['generate'](0x4)+_0x9510('0x3e'));return convertFile(_0x3d3e8d,_0x45b57d);})[_0x9510('0x2e')](function(){try{fs[_0x9510('0x1e')](_0x3d3e8d);fs[_0x9510('0x2f')](_0x45b57d,_0x9510('0x30'));}catch(_0x70ad01){logger[_0x9510('0x1d')](_0x70ad01);}return _0x45b57d[_0x9510('0x31')]('.')[0x0];});};exports[_0x9510('0x84')]=function(_0x1b6dac,_0x2c1e71,_0x35e0d7,_0x451b4e){var _0x2c2c71=util[_0x9510('0x82')](_0x9510('0x85'),ISPEECH_API,_0x2c1e71,_0x35e0d7,base64Encode(_0x1b6dac),_0x451b4e?util[_0x9510('0x82')](_0x9510('0x86'),encodeURIComponent(_0x451b4e)):_0x9510('0x87'));return uploadFile(_0x2c2c71)[_0x9510('0x2e')](function(_0x5e380e){return querystring[_0x9510('0x88')](_0x5e380e);});};exports[_0x9510('0x89')]=function(_0x563b46,_0x2c46e8){return sestek[_0x9510('0x8a')](_0x563b46,_0x2c46e8)[_0x9510('0x2e')](function(_0x57213f){logger[_0x9510('0x1a')](JSON[_0x9510('0x44')](_0x57213f));var _0x302f27={'speech':_0x57213f[_0x9510('0x8b')],'action':_0x57213f['channelData']?_0x57213f[_0x9510('0x8c')][_0x9510('0x8d')]:undefined,'actiondata':_0x57213f[_0x9510('0x8c')]?_0x57213f['channelData'][_0x9510('0x8e')]:undefined};if(_0x57213f[_0x9510('0x8c')]&&_0x57213f[_0x9510('0x8c')][_0x9510('0x8f')]){return base64Decode(_0x57213f[_0x9510('0x8c')]['AudioFromTts'][_0x9510('0x90')],path['resolve'](__dirname,_0x9510('0x2a'),rs['generate'](0x4)+_0x9510('0x3e')))[_0x9510('0x2e')](function(_0x221545){_0x302f27[_0x9510('0x91')]=_0x221545;return _0x302f27;});}return _0x302f27;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x9b9a=['readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','POST','then','.mp3','from','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','generic','slice','length','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','goggleTTS\x20path','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent','replace','sessionPath','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','asr','Tilde\x20ASR\x20confidence','awsPolly','lex','ispeechTTS','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','querystring','randomstring','sox','google-tts-api','parse','util','./aws','./google','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','close','unlink','download\x20error','pipe','end','path','data','transcode','wav','error\x20convert','start','resolve','tmp','generate','.wav','base64','chmodSync','777','split'];(function(_0x24ea4f,_0x6c54cc){var _0x25fe14=function(_0xfa4487){while(--_0xfa4487){_0x24ea4f['push'](_0x24ea4f['shift']());}};_0x25fe14(++_0x6c54cc);}(_0x9b9a,0x1dc));var _0xa9b9=function(_0x166e2a,_0x5d3944){_0x166e2a=_0x166e2a-0x0;var _0x1b914b=_0x9b9a[_0x166e2a];return _0x1b914b;};'use strict';var apiai=require(_0xa9b9('0x0'));var BPromise=require(_0xa9b9('0x1'));var dialogflow=require(_0xa9b9('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xa9b9('0x3'));var md5=require(_0xa9b9('0x4'));var path=require('path');var querystring=require(_0xa9b9('0x5'));var rp=require('request-promise');var rs=require(_0xa9b9('0x6'));var sox=require(_0xa9b9('0x7'));var tts=require(_0xa9b9('0x8'));var urlParse=require('url')[_0xa9b9('0x9')];var util=require(_0xa9b9('0xa'));var aws=require(_0xa9b9('0xb'));var google=require(_0xa9b9('0xc'));var sestek=require('./sestek');var tilde=require(_0xa9b9('0xd'));var logger=require(_0xa9b9('0xe'))(_0xa9b9('0xf'));var ISPEECH_API=_0xa9b9('0x10');function downloadFile(_0x1a5310,_0x58bc40){return new BPromise(function(_0x5064e2,_0x4c6e56){var _0x253809=urlParse(_0x1a5310);var _0x26f192=_0x253809[_0xa9b9('0x11')]===_0xa9b9('0x12')?https:http;var _0x355cb8={'host':_0x253809['host'],'path':_0x253809['path'],'headers':{'user-agent':_0xa9b9('0x13')}};_0x26f192[_0xa9b9('0x14')](_0x355cb8,function(_0x1643cc){if(_0x1643cc[_0xa9b9('0x15')]!==0xc8){logger[_0xa9b9('0x16')]('request\x20to\x20'+_0x1a5310+_0xa9b9('0x17')+_0x1643cc[_0xa9b9('0x15')]+'\x20('+_0x1643cc[_0xa9b9('0x18')]+')');_0x4c6e56(new Error(_0xa9b9('0x19')+_0x1a5310+_0xa9b9('0x17')+_0x1643cc[_0xa9b9('0x15')]+'\x20('+_0x1643cc[_0xa9b9('0x18')]+')'));return;}var _0x46bc8b=fs[_0xa9b9('0x1a')](_0x58bc40);_0x46bc8b['on'](_0xa9b9('0x1b'),function(){logger[_0xa9b9('0x1c')]('finish\x20download\x20file');_0x46bc8b[_0xa9b9('0x1d')](_0x5064e2);});_0x46bc8b['on'](_0xa9b9('0x16'),function(_0xab2284){fs[_0xa9b9('0x1e')](_0x58bc40);logger[_0xa9b9('0x16')](_0xa9b9('0x1f'),_0xab2284);_0x4c6e56(_0xab2284);});_0x1643cc[_0xa9b9('0x20')](_0x46bc8b);})['on'](_0xa9b9('0x16'),function(_0x4c18ba){logger[_0xa9b9('0x16')](_0x4c18ba);_0x4c6e56(_0x4c18ba);})[_0xa9b9('0x21')]();});}function uploadFile(_0x58a42d){return new BPromise(function(_0x3707d7,_0x3f821f){var _0x71d613=urlParse(_0x58a42d);var _0x1a7b60=_0x71d613['protocol']===_0xa9b9('0x12')?https:http;var _0x4bd2d4={'host':_0x71d613['host'],'path':_0x71d613[_0xa9b9('0x22')],'headers':{'user-agent':_0xa9b9('0x13')}};_0x1a7b60[_0xa9b9('0x14')](_0x4bd2d4,function(_0x968bca){if(_0x968bca[_0xa9b9('0x15')]!==0xc8){_0x3f821f(new Error(_0xa9b9('0x19')+_0x58a42d+_0xa9b9('0x17')+_0x968bca[_0xa9b9('0x15')]+'\x20('+_0x968bca['statusMessage']+')'));return;}var _0x1d61f4='';_0x968bca['on'](_0xa9b9('0x23'),function(_0x2e672e){_0x1d61f4+=_0x2e672e;});_0x968bca['on'](_0xa9b9('0x21'),function(){_0x3707d7(_0x1d61f4);});})['on']('error',function(_0x21f14a){_0x3f821f(_0x21f14a);})[_0xa9b9('0x21')]();});}function convertFile(_0x186755,_0x344985){return new BPromise(function(_0x2c18e6,_0x583850){var _0x38b066=sox[_0xa9b9('0x24')](_0x186755,_0x344985,{'sampleRate':0x1f40,'format':_0xa9b9('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x38b066['on'](_0xa9b9('0x16'),function(_0x4f4d70){logger['error'](_0xa9b9('0x26'),_0x4f4d70);_0x583850(_0x4f4d70);});_0x38b066['on']('end',function(){logger[_0xa9b9('0x1c')]('finish\x20to\x20convert');_0x2c18e6();});_0x38b066[_0xa9b9('0x27')]();});}function base64Decode(_0x2f7624,_0x542b33){var _0x2de8cd=path[_0xa9b9('0x28')](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+_0xa9b9('0x2b'));fs['writeFileSync'](_0x2de8cd,_0x2f7624,_0xa9b9('0x2c'));return convertFile(_0x2de8cd,_0x542b33)['then'](function(){try{fs[_0xa9b9('0x1e')](_0x2de8cd);fs[_0xa9b9('0x2d')](_0x542b33,_0xa9b9('0x2e'));}catch(_0x6647b2){logger[_0xa9b9('0x16')](_0x6647b2);}return _0x542b33[_0xa9b9('0x2f')]('.')[0x0];});}function base64Encode(_0x5d9662){var _0x16c3f8=fs[_0xa9b9('0x30')](_0x5d9662);return new Buffer(_0x16c3f8)[_0xa9b9('0x31')](_0xa9b9('0x2c'));}exports['googleCloudTTS']=function(_0x5e6cb1,_0x488764,_0x5141f7,_0x12bf4f,_0x25c397,_0x4017cd){var _0x1d70a4,_0x4ea0f2;var _0xd8717f=_0xa9b9('0x32');var _0xd81ef6=_0xa9b9('0x33')+_0x5e6cb1;var _0x219df4={};if(_0x488764==='ssml'){_0x219df4[_0xa9b9('0x34')]={'ssml':_0x5141f7};}else{_0x219df4[_0xa9b9('0x34')]={'text':_0x5141f7};};_0x219df4[_0xa9b9('0x35')]={'languageCode':_0x12bf4f,'ssmlGender':_0x25c397};_0x219df4[_0xa9b9('0x36')]={'audioEncoding':_0xa9b9('0x37'),'sampleRateHertz':0x1f40};var _0x371b49={'url':_0xd8717f+'text:synthesize'+_0xd81ef6,'method':_0xa9b9('0x38'),'json':!![],'body':_0x219df4};return rp(_0x371b49)[_0xa9b9('0x39')](function(_0x52dcc1){return new BPromise(function(_0x1865ff,_0x16d4bb){_0x1d70a4=path['resolve'](__dirname,_0xa9b9('0x29'),rs['generate'](0x4)+_0xa9b9('0x3a'));var _0x422045=Buffer[_0xa9b9('0x3b')](_0x52dcc1['audioContent'],_0xa9b9('0x2c'));return fs[_0xa9b9('0x3c')](_0x1d70a4,_0x422045,function(_0x13292a){_0x16d4bb(_0x13292a);},function(_0x1bb5b8){fs[_0xa9b9('0x2d')](_0x1d70a4,_0xa9b9('0x2e'));_0x1865ff(_0x1bb5b8);});});})[_0xa9b9('0x39')](function(_0x18f86d){_0x4ea0f2=path[_0xa9b9('0x28')](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+_0xa9b9('0x2b'));return convertFile(_0x1d70a4,_0x4ea0f2);})[_0xa9b9('0x39')](function(){try{fs[_0xa9b9('0x1e')](_0x1d70a4);fs[_0xa9b9('0x2d')](_0x4ea0f2,_0xa9b9('0x2e'));}catch(_0x7bb999){logger[_0xa9b9('0x16')](_0x7bb999);}logger[_0xa9b9('0x1c')](_0xa9b9('0x3d'),_0x4ea0f2[_0xa9b9('0x2f')]('.')[0x0]);return _0x4ea0f2[_0xa9b9('0x2f')]('.')[0x0];});};exports[_0xa9b9('0x3e')]=function(_0x3df296,_0x228307){var _0xc3e92a=_0xa9b9('0x3f');var _0x5b3914,_0x14a18f;var _0x1b7c1e;var _0x237d79={'encoding':_0xa9b9('0x40'),'method':_0xa9b9('0x38'),'timeout':0x2710,'url':_0xc3e92a,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xa9b9('0x41')+encodeURIComponent(JSON[_0xa9b9('0x42')]([[[_0xa9b9('0x43'),JSON[_0xa9b9('0x42')]([_0x3df296,_0x228307||'en',![],'null']),null,_0xa9b9('0x44')]]]))};return rp(_0x237d79)[_0xa9b9('0x39')](function(_0x3f035a){try{_0x1b7c1e=eval(_0x3f035a[_0xa9b9('0x45')](0x5))[0x0][0x2];}catch(_0x1c06fa){throw new Error('parse\x20response\x20failed:\x0a'+_0x3f035a[_0xa9b9('0x23')]);}if(!_0x1b7c1e){if(_0x3df296[_0xa9b9('0x46')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xa9b9('0x47')+_0x228307+_0xa9b9('0x48'));}}try{_0x1b7c1e=eval(_0x1b7c1e)[0x0];}catch(_0x58ab1a){throw new Error(_0xa9b9('0x49')+res[_0xa9b9('0x23')]);}const _0x3bb0b6=_0x1b7c1e;_0x5b3914=path['resolve'](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+'.mp3');fs[_0xa9b9('0x4a')](_0x5b3914,_0x1b7c1e,{'encoding':_0xa9b9('0x2c')});_0x14a18f=path[_0xa9b9('0x28')](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+_0xa9b9('0x2b'));return convertFile(_0x5b3914,_0x14a18f);})['then'](function(){try{fs['unlink'](_0x5b3914);fs[_0xa9b9('0x2d')](_0x14a18f,'777');}catch(_0x361743){logger[_0xa9b9('0x16')](_0x361743);}logger[_0xa9b9('0x1c')](_0xa9b9('0x4b'),_0x14a18f['split']('.')[0x0]);return _0x14a18f[_0xa9b9('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x9cd09b,_0x1069f1,_0x5f36f5){return google['asr'](_0x9cd09b,_0x1069f1,_0x5f36f5)[_0xa9b9('0x39')](function(_0x37fee2){logger[_0xa9b9('0x1c')](_0x37fee2[_0xa9b9('0x4c')]);return rp(_0x37fee2);})[_0xa9b9('0x39')](function(_0x224d6e){var _0xc2054f='';var _0x16398c=0x0;try{fs['unlink'](_0x9cd09b);}catch(_0x1c2b44){logger[_0xa9b9('0x16')](_0x1c2b44);}if(_0x224d6e&&_0x224d6e[_0xa9b9('0x4d')]){_0xc2054f=_0x224d6e[_0xa9b9('0x4d')]['map'](function(_0x8ff041){return _0x8ff041&&_0x8ff041[_0xa9b9('0x4e')][0x0]&&_0x8ff041[_0xa9b9('0x4e')][0x0][_0xa9b9('0x4f')]?_0x8ff041[_0xa9b9('0x4e')][0x0]['transcript']:'';})[_0xa9b9('0x50')]('\x0a');_0x16398c=_0x224d6e['results'][_0xa9b9('0x51')](function(_0x2aef6c){return _0x2aef6c&&_0x2aef6c[_0xa9b9('0x4e')][0x0]&&_0x2aef6c[_0xa9b9('0x4e')][0x0]['confidence']?_0x2aef6c[_0xa9b9('0x4e')][0x0][_0xa9b9('0x52')]:0x0;})[_0xa9b9('0x50')]('\x0a');}logger[_0xa9b9('0x1c')]('googleASR\x20transcription',_0xc2054f);logger[_0xa9b9('0x1c')](_0xa9b9('0x53'),_0x16398c);return{'transcript':_0xc2054f,'confidence':_0x16398c};})[_0xa9b9('0x54')](function(_0x37b6c4){logger[_0xa9b9('0x16')](_0xa9b9('0x55'),_0x37b6c4[_0xa9b9('0x15')],_0x37b6c4[_0xa9b9('0x56')],_0x37b6c4[_0xa9b9('0x57')]);});};exports['googleDialogflow']=function(_0x2829b6,_0x3fe8bf,_0x544097,_0x1adf39){var _0x2edc60=apiai(_0x3fe8bf,{'language':_0x1adf39||'en'});return _0x2edc60['textRequest'](_0x544097,{'sessionId':md5(_0x2829b6)})[_0xa9b9('0x39')](function(_0x5b322a){logger['info'](JSON[_0xa9b9('0x42')](_0x5b322a));return{'source':_0x5b322a[_0xa9b9('0x58')][_0xa9b9('0x59')],'resolvedQuery':_0x5b322a['result'][_0xa9b9('0x5a')],'action':_0x5b322a[_0xa9b9('0x58')][_0xa9b9('0x5b')],'actionIncomplete':_0x5b322a[_0xa9b9('0x58')]['actionIncomplete'],'speech':_0x5b322a[_0xa9b9('0x58')][_0xa9b9('0x5c')]['speech'],'score':_0x5b322a[_0xa9b9('0x58')][_0xa9b9('0x5d')],'statusCode':_0x5b322a[_0xa9b9('0x5e')][_0xa9b9('0x5f')],'endConversation':_0x5b322a['result'][_0xa9b9('0x60')][_0xa9b9('0x61')]||![],'isFallbackIntent':_0x5b322a[_0xa9b9('0x58')][_0xa9b9('0x60')][_0xa9b9('0x62')]};});};exports['googleDialogflowV2']=function(_0x2d45ee,_0x320c96,_0x38c267,_0x3bf6ae,_0x345bb8,_0x27b70b){var _0x224bf0=_0x3bf6ae[_0xa9b9('0x63')](/\\n/g,'\x0a');var _0x5ab69a={'credentials':{'private_key':_0x224bf0,'client_email':_0x38c267}};var _0x24f2a6=new dialogflow['SessionsClient'](_0x5ab69a);var _0x3c2ff8=_0x24f2a6[_0xa9b9('0x64')](_0x320c96,md5(_0x2d45ee));var _0x5ea7b5={'session':_0x3c2ff8,'queryInput':{'text':{'text':_0x345bb8,'languageCode':_0x27b70b}}};return _0x24f2a6['detectIntent'](_0x5ea7b5)[_0xa9b9('0x39')](function(_0x1af341){if(_0x1af341&&_0x1af341['length']){logger['info'](_0xa9b9('0x65'),JSON[_0xa9b9('0x42')](_0x1af341));var _0x1b61ad=_0x1af341[0x0];if(_0x1b61ad){var _0x280bb4={'action':_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x5b')],'allRequiredParamsPresent':_0x1b61ad['queryResult']['allRequiredParamsPresent'],'endConversation':_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x67')]&&_0x1b61ad[_0xa9b9('0x66')]['diagnosticInfo']['fields']?_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x67')]['fields']['end_conversation']['boolValue']:![],'fulfillmentText':_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x68')],'intentName':_0x1b61ad['queryResult'][_0xa9b9('0x69')][_0xa9b9('0x56')],'intentDisplayName':_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x69')][_0xa9b9('0x6a')],'isFallbackIntent':_0x1b61ad[_0xa9b9('0x66')]['intent'][_0xa9b9('0x6b')],'languageCode':_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x6c')],'queryText':_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x6d')],'responseId':_0x1b61ad[_0xa9b9('0x6e')],'score':_0x1b61ad['queryResult'][_0xa9b9('0x6f')],'speech':_0x1b61ad[_0xa9b9('0x66')][_0xa9b9('0x68')],'providerResponse':JSON['stringify'](_0x1af341)};return _0x280bb4;}}});};exports[_0xa9b9('0x70')]=function(_0x196c46,_0x33694e,_0x533b14,_0x3cb12d){return tilde[_0xa9b9('0x71')](_0x196c46,_0x33694e,_0x533b14,_0x3cb12d)['then'](function(_0x139745){try{fs[_0xa9b9('0x1e')](_0x196c46);}catch(_0x3cd145){logger[_0xa9b9('0x16')](_0x3cd145);}logger[_0xa9b9('0x1c')]('Tilde\x20ASR\x20transcription',_0x139745[_0xa9b9('0x4f')]);logger[_0xa9b9('0x1c')](_0xa9b9('0x72'),_0x139745[_0xa9b9('0x52')]);return _0x139745;});};exports[_0xa9b9('0x73')]=function(_0x3503e8,_0x38894e,_0x146c4b,_0xc7ea7c,_0x5cb050,_0x2e3913){var _0x10323d=path[_0xa9b9('0x28')](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+'.mp3');var _0x56f976;return aws['polly'](_0x3503e8,_0x38894e,_0x146c4b,_0xc7ea7c,_0x5cb050,_0x2e3913,_0x10323d)[_0xa9b9('0x39')](function(){_0x56f976=path['resolve'](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+_0xa9b9('0x2b'));return convertFile(_0x10323d,_0x56f976);})[_0xa9b9('0x39')](function(){try{fs[_0xa9b9('0x1e')](_0x10323d);fs[_0xa9b9('0x2d')](_0x56f976,_0xa9b9('0x2e'));}catch(_0x2f338f){logger['error'](_0x2f338f);}return _0x56f976['split']('.')[0x0];});};exports['awsLex']=function(_0x5ce61d,_0x48bcd4,_0x21240b,_0x16f0b0,_0x4df11f,_0x1160aa){return aws[_0xa9b9('0x74')](_0x5ce61d,_0x48bcd4,_0x21240b,_0x16f0b0,_0x4df11f,_0x1160aa)['then'](function(_0x2a5edf){logger['info'](JSON[_0xa9b9('0x42')](_0x2a5edf));return _0x2a5edf;});};exports[_0xa9b9('0x75')]=function(_0x274df3,_0x207f9c,_0x2496cf,_0x16333c){var _0xdc52d9=util[_0xa9b9('0x76')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x274df3,encodeURIComponent(_0x207f9c),_0x2496cf,_0x16333c);var _0x351e3f=path[_0xa9b9('0x28')](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+_0xa9b9('0x3a'));var _0x1f90a4;return downloadFile(_0xdc52d9,_0x351e3f)[_0xa9b9('0x39')](function(){_0x1f90a4=path[_0xa9b9('0x28')](__dirname,_0xa9b9('0x29'),rs[_0xa9b9('0x2a')](0x4)+_0xa9b9('0x2b'));return convertFile(_0x351e3f,_0x1f90a4);})['then'](function(){try{fs[_0xa9b9('0x1e')](_0x351e3f);fs['chmodSync'](_0x1f90a4,'777');}catch(_0x14ae22){logger[_0xa9b9('0x16')](_0x14ae22);}return _0x1f90a4[_0xa9b9('0x2f')]('.')[0x0];});};exports[_0xa9b9('0x77')]=function(_0x178112,_0x1b8a01,_0x2d4bf6,_0x9f614b){var _0x4aecc8=util[_0xa9b9('0x76')](_0xa9b9('0x78'),ISPEECH_API,_0x1b8a01,_0x2d4bf6,base64Encode(_0x178112),_0x9f614b?util[_0xa9b9('0x76')](_0xa9b9('0x79'),encodeURIComponent(_0x9f614b)):'freeform=3');return uploadFile(_0x4aecc8)['then'](function(_0x289d14){return querystring[_0xa9b9('0x9')](_0x289d14);});};exports[_0xa9b9('0x7a')]=function(_0x285d37,_0x57c29b){return sestek['nda'](_0x285d37,_0x57c29b)[_0xa9b9('0x39')](function(_0x1a2c91){logger['info'](JSON[_0xa9b9('0x42')](_0x1a2c91));var _0x5b6acd={'speech':_0x1a2c91[_0xa9b9('0x7b')],'action':_0x1a2c91[_0xa9b9('0x7c')]?_0x1a2c91['channelData'][_0xa9b9('0x7d')]:undefined,'actiondata':_0x1a2c91[_0xa9b9('0x7c')]?_0x1a2c91['channelData'][_0xa9b9('0x7e')]:undefined};if(_0x1a2c91['channelData']&&_0x1a2c91['channelData'][_0xa9b9('0x7f')]){return base64Decode(_0x1a2c91[_0xa9b9('0x7c')][_0xa9b9('0x7f')][_0xa9b9('0x80')],path['resolve'](__dirname,'tmp',rs[_0xa9b9('0x2a')](0x4)+_0xa9b9('0x2b')))[_0xa9b9('0x39')](function(_0x3e4bbf){_0x5b6acd[_0xa9b9('0x81')]=_0x3e4bbf;return _0x5b6acd;});}return _0x5b6acd;});};exports[_0xa9b9('0x82')]=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 7776c22..9955e87 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 _0x7346=['./nda'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x7346,0x1a5));var _0x6734=function(_0xa4048d,_0x257703){_0xa4048d=_0xa4048d-0x0;var _0x1399da=_0x7346[_0xa4048d];return _0x1399da;};var nda=require(_0x6734('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x4a98=['./nda'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x4a98,0x112));var _0x84a9=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x4a98[_0x24875d];return _0x181471;};var nda=require(_0x84a9('0x0'));module['exports']={'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 c9f1864..6058724 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 _0x4584=['stringify','request-promise','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','project','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','body','CustomAction','custom_action_data','info'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x4584,0x1cf));var _0x4458=function(_0x4dd063,_0x386d0c){_0x4dd063=_0x4dd063-0x0;var _0x2b8747=_0x4584[_0x4dd063];return _0x2b8747;};'use strict';var rp=require(_0x4458('0x0'));var url=require('url');var logger=require(_0x4458('0x1'))(_0x4458('0x2'));module[_0x4458('0x3')]=function(_0x5340f5,_0x570b9c){var _0x18e5c6={'method':_0x4458('0x4'),'uri':url[_0x4458('0x5')](_0x570b9c[_0x4458('0x6')],_0x4458('0x7')),'form':{'grant_type':_0x4458('0x8'),'username':_0x570b9c[_0x4458('0x9')],'password':_0x570b9c[_0x4458('0x8')]},'json':!![]};return rp(_0x18e5c6)[_0x4458('0xa')](function(_0x51da14){var _0x14bb0f={'method':_0x4458('0x4'),'uri':url[_0x4458('0x5')](_0x570b9c[_0x4458('0xb')],_0x4458('0xc')),'body':{'type':_0x570b9c[_0x4458('0xd')]||_0x4458('0xe'),'channelId':_0x4458('0xf'),'conversation':{'id':_0x5340f5[_0x4458('0x10')]},'from':{'id':_0x5340f5['callerid'],'name':_0x5340f5[_0x4458('0x11')]},'recipient':{'id':_0x5340f5[_0x4458('0x12')],'name':_0x5340f5[_0x4458('0x13')]},'text':_0x570b9c[_0x4458('0x14')],'channelData':{}},'headers':{'Authorization':_0x4458('0x15')+_0x51da14['access_token']},'json':!![]};if(_0x570b9c[_0x4458('0x16')]){_0x14bb0f['body'][_0x4458('0x17')]['ProjectName']=_0x570b9c[_0x4458('0x16')];}if(_0x570b9c[_0x4458('0x18')]=='1'){_0x14bb0f['body']['channelData'][_0x4458('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4458('0x1a')};}if(_0x570b9c[_0x4458('0x1b')]){_0x14bb0f[_0x4458('0x1c')][_0x4458('0x17')][_0x4458('0x1d')]=_0x570b9c[_0x4458('0x1b')];if(_0x570b9c[_0x4458('0x1e')]){_0x14bb0f['body'][_0x4458('0x17')]['CustomActionData']=_0x570b9c[_0x4458('0x1e')];}}logger[_0x4458('0x1f')](JSON[_0x4458('0x20')](_0x14bb0f));return rp(_0x14bb0f);});}; \ No newline at end of file +var _0xb264=['extension','text','Bearer\x20','access_token','project','channelData','ProjectName','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','agi','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname'];(function(_0x3dc278,_0x19f377){var _0x434a99=function(_0x396364){while(--_0x396364){_0x3dc278['push'](_0x3dc278['shift']());}};_0x434a99(++_0x19f377);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require(_0x4b26('0x0'));var url=require(_0x4b26('0x1'));var logger=require('../../../../../config/logger')(_0x4b26('0x2'));module['exports']=function(_0x4f2b32,_0xa2bcef){var _0x44691e={'method':_0x4b26('0x3'),'uri':url[_0x4b26('0x4')](_0xa2bcef[_0x4b26('0x5')],_0x4b26('0x6')),'form':{'grant_type':_0x4b26('0x7'),'username':_0xa2bcef['username'],'password':_0xa2bcef[_0x4b26('0x7')]},'json':!![]};return rp(_0x44691e)[_0x4b26('0x8')](function(_0x5a8c67){var _0x1edb7c={'method':_0x4b26('0x3'),'uri':url[_0x4b26('0x4')](_0xa2bcef['ndassistant_url'],_0x4b26('0x9')),'body':{'type':_0xa2bcef[_0x4b26('0xa')]||_0x4b26('0xb'),'channelId':_0x4b26('0xc'),'conversation':{'id':_0x4f2b32[_0x4b26('0xd')]},'from':{'id':_0x4f2b32['callerid'],'name':_0x4f2b32[_0x4b26('0xe')]},'recipient':{'id':_0x4f2b32['dnid'],'name':_0x4f2b32[_0x4b26('0xf')]},'text':_0xa2bcef[_0x4b26('0x10')],'channelData':{}},'headers':{'Authorization':_0x4b26('0x11')+_0x5a8c67[_0x4b26('0x12')]},'json':!![]};if(_0xa2bcef[_0x4b26('0x13')]){_0x1edb7c['body'][_0x4b26('0x14')][_0x4b26('0x15')]=_0xa2bcef['project'];}if(_0xa2bcef['ndagenerate_audio']=='1'){_0x1edb7c[_0x4b26('0x16')]['channelData'][_0x4b26('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4b26('0x18')};}if(_0xa2bcef[_0x4b26('0x19')]){_0x1edb7c['body'][_0x4b26('0x14')][_0x4b26('0x1a')]=_0xa2bcef[_0x4b26('0x19')];if(_0xa2bcef[_0x4b26('0x1b')]){_0x1edb7c[_0x4b26('0x16')][_0x4b26('0x14')][_0x4b26('0x1c')]=_0xa2bcef[_0x4b26('0x1b')];}}logger[_0x4b26('0x1d')](JSON[_0x4b26('0x1e')](_0x1edb7c));return rp(_0x1edb7c);});}; \ 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 254efb3..b5aa37e 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0xbe7691,_0x2c2408,_0x2bbb96,_0x3a9e1b){return asr(_0xbe7691,_0x2c2408,_0x2bbb96,_0x3a9e1b);}; \ No newline at end of file +var _0x3240=['./lib/api','exports'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x3240,0x1ca));var _0x0324=function(_0x1df3a2,_0x1380cd){_0x1df3a2=_0x1df3a2-0x0;var _0x47b625=_0x3240[_0x1df3a2];return _0x47b625;};'use strict';var asr=require(_0x0324('0x0'));module[_0x0324('0x1')]=function(_0x57ea7c,_0x271504,_0x3fa249,_0x321ae6){return asr(_0x57ea7c,_0x271504,_0x3fa249,_0x321ae6);}; \ 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 a6be58d..f63034e 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 _0xcfa2=['Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','crypto','../../../../../../config/logger','info','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','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','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.','error'];(function(_0x5be92f,_0x140cb4){var _0x3d139f=function(_0x5f51f7){while(--_0x5f51f7){_0x5be92f['push'](_0x5be92f['shift']());}};_0x3d139f(++_0x140cb4);}(_0xcfa2,0x10f));var _0x2cfa=function(_0x568ef1,_0x239152){_0x568ef1=_0x568ef1-0x0;var _0x209ed6=_0xcfa2[_0x568ef1];return _0x209ed6;};'use strict';var BPromise=require(_0x2cfa('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x2cfa('0x1'));var logger=require(_0x2cfa('0x2'))('agi');module['exports']=function(_0x12c101,_0x50b7bd,_0x22c141,_0x138261){return new BPromise(function(_0x3fe813,_0x3d33af){logger[_0x2cfa('0x3')]('Tilde\x20URI',_0x138261||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x2fe77c=new WebSocket(_0x138261||_0x2cfa('0x4'),{'perMessageDeflate':![]});var _0x494bee='';var _0x4ec3d3='0';var _0x328ba5='1';var _0x3d6e9f=_0x2cfa('0x5');function _0x137367(_0x1efa64){var _0x1e5b44=crypto[_0x2cfa('0x6')](_0x2cfa('0x7'));_0x1e5b44['update'](_0x1efa64);return _0x1e5b44[_0x2cfa('0x8')](_0x2cfa('0x9'));}function _0x27db4a(){try{logger['info'](_0x2cfa('0xa'));var _0x2f750d=moment()[_0x2cfa('0xb')]();var _0x140641=_0x137367(_0x2f750d+_0x50b7bd+_0x22c141);_0x2fe77c[_0x2cfa('0xc')](JSON[_0x2cfa('0xd')]({'appID':_0x50b7bd,'timestamp':_0x2f750d,'appKey':_0x140641}));var _0x44c1a6=fs[_0x2cfa('0xe')](_0x12c101);_0x44c1a6['on'](_0x2cfa('0xf'),function(_0x1c177d){_0x2fe77c[_0x2cfa('0xc')](_0x1c177d);});_0x44c1a6['on'](_0x2cfa('0x10'),function(){_0x2fe77c[_0x2cfa('0xc')]('EOS');});}catch(_0x495193){logger['error'](_0x2cfa('0x11'),JSON[_0x2cfa('0xd')](_0x495193));_0x2fe77c[_0x2cfa('0x12')]();}}function _0x175d2b(_0x183755){try{if(_0x183755){var _0x35327e=JSON[_0x2cfa('0x13')](_0x183755);switch(_0x35327e[_0x2cfa('0x14')]){case 0x0:if(_0x35327e[_0x2cfa('0x15')]){if(_0x35327e[_0x2cfa('0x15')][_0x2cfa('0x16')]){logger['info'](_0x2cfa('0x17'),JSON['stringify'](_0x35327e['result'][_0x2cfa('0x18')]));_0x494bee=_0x35327e[_0x2cfa('0x15')]['hypotheses'][0x0][_0x2cfa('0x19')];_0x4ec3d3=_0x35327e[_0x2cfa('0x15')][_0x2cfa('0x18')][0x0][_0x2cfa('0x1a')];_0x328ba5='0';_0x3d6e9f=_0x2cfa('0x1b');_0x2fe77c[_0x2cfa('0x12')]();}}break;case 0x1:logger[_0x2cfa('0x3')](_0x2cfa('0x5'));_0x328ba5='1';_0x3d6e9f=_0x2cfa('0x5');break;case 0x2:logger[_0x2cfa('0x3')](_0x2cfa('0x1c'));_0x328ba5='2';_0x3d6e9f=_0x2cfa('0x1c');break;case 0x9:logger[_0x2cfa('0x3')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x328ba5='9';_0x3d6e9f=_0x2cfa('0x1d');break;case 0xa:logger[_0x2cfa('0x3')]('Authentication\x20failed.');_0x328ba5='10';_0x3d6e9f=_0x2cfa('0x1e');break;case 0xb:logger[_0x2cfa('0x3')](_0x2cfa('0x1f'));_0x328ba5='11';_0x3d6e9f=_0x2cfa('0x1f');}}}catch(_0x38f8cd){logger[_0x2cfa('0x20')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x2cfa('0xd')](_0x38f8cd));_0x2fe77c[_0x2cfa('0x12')]();}}function _0x1e67f7(){logger[_0x2cfa('0x3')](_0x2cfa('0x21'));_0x3fe813({'transcript':_0x494bee,'confidence':_0x4ec3d3,'status':_0x328ba5,'status_message':_0x3d6e9f});}function _0x2876c3(_0x5bc648){logger[_0x2cfa('0x20')](_0x2cfa('0x22'));if(!_[_0x2cfa('0x23')](_0x5bc648)){logger[_0x2cfa('0x20')](_[_0x2cfa('0x24')](_0x5bc648)?JSON[_0x2cfa('0xd')](_0x5bc648):_0x5bc648);}}_0x2fe77c['on'](_0x2cfa('0x25'),_0x27db4a);_0x2fe77c['on']('message',_0x175d2b);_0x2fe77c['on'](_0x2cfa('0x10'),_0x1e67f7);_0x2fe77c['on'](_0x2cfa('0x20'),_0x2876c3);});}; \ No newline at end of file +var _0x1c3f=['hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x1c3f,0x7e));var _0xf1c3=function(_0xb62d3,_0x5a007a){_0xb62d3=_0xb62d3-0x0;var _0x1c5d67=_0x1c3f[_0xb62d3];return _0x1c5d67;};'use strict';var BPromise=require(_0xf1c3('0x0'));var _=require(_0xf1c3('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf1c3('0x2'));var crypto=require(_0xf1c3('0x3'));var logger=require(_0xf1c3('0x4'))(_0xf1c3('0x5'));module[_0xf1c3('0x6')]=function(_0x361af6,_0x543bc9,_0x46db27,_0x5d8fe3){return new BPromise(function(_0x4f67e2,_0x5044bf){logger[_0xf1c3('0x7')](_0xf1c3('0x8'),_0x5d8fe3||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x31e83d=new WebSocket(_0x5d8fe3||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x35c607='';var _0x7c1d25='0';var _0xbc0382='1';var _0x3c02fc=_0xf1c3('0x9');function _0x94264e(_0x262952){var _0x2e6c55=crypto[_0xf1c3('0xa')]('sha1');_0x2e6c55[_0xf1c3('0xb')](_0x262952);return _0x2e6c55[_0xf1c3('0xc')](_0xf1c3('0xd'));}function _0x2f5d2c(){try{logger[_0xf1c3('0x7')](_0xf1c3('0xe'));var _0x5b117a=moment()[_0xf1c3('0xf')]();var _0x1e0c7e=_0x94264e(_0x5b117a+_0x543bc9+_0x46db27);_0x31e83d[_0xf1c3('0x10')](JSON[_0xf1c3('0x11')]({'appID':_0x543bc9,'timestamp':_0x5b117a,'appKey':_0x1e0c7e}));var _0x324b97=fs[_0xf1c3('0x12')](_0x361af6);_0x324b97['on']('data',function(_0x427302){_0x31e83d[_0xf1c3('0x10')](_0x427302);});_0x324b97['on']('close',function(){_0x31e83d['send'](_0xf1c3('0x13'));});}catch(_0x318a09){logger[_0xf1c3('0x14')](_0xf1c3('0x15'),JSON[_0xf1c3('0x11')](_0x318a09));_0x31e83d[_0xf1c3('0x16')]();}}function _0x20501c(_0x2493bc){try{if(_0x2493bc){var _0x1a7b2f=JSON[_0xf1c3('0x17')](_0x2493bc);switch(_0x1a7b2f['status']){case 0x0:if(_0x1a7b2f[_0xf1c3('0x18')]){if(_0x1a7b2f[_0xf1c3('0x18')][_0xf1c3('0x19')]){logger[_0xf1c3('0x7')]('Tilde\x20ASR\x20hypoteses',JSON[_0xf1c3('0x11')](_0x1a7b2f[_0xf1c3('0x18')][_0xf1c3('0x1a')]));_0x35c607=_0x1a7b2f[_0xf1c3('0x18')]['hypotheses'][0x0]['transcript'];_0x7c1d25=_0x1a7b2f[_0xf1c3('0x18')][_0xf1c3('0x1a')][0x0][_0xf1c3('0x1b')];_0xbc0382='0';_0x3c02fc=_0xf1c3('0x1c');_0x31e83d[_0xf1c3('0x16')]();}}break;case 0x1:logger[_0xf1c3('0x7')](_0xf1c3('0x9'));_0xbc0382='1';_0x3c02fc=_0xf1c3('0x9');break;case 0x2:logger[_0xf1c3('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0xbc0382='2';_0x3c02fc=_0xf1c3('0x1d');break;case 0x9:logger[_0xf1c3('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0xbc0382='9';_0x3c02fc='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xf1c3('0x7')](_0xf1c3('0x1e'));_0xbc0382='10';_0x3c02fc='Authentication\x20failed.';break;case 0xb:logger[_0xf1c3('0x7')](_0xf1c3('0x1f'));_0xbc0382='11';_0x3c02fc=_0xf1c3('0x1f');}}}catch(_0x499fd8){logger[_0xf1c3('0x14')](_0xf1c3('0x20'),JSON[_0xf1c3('0x11')](_0x499fd8));_0x31e83d[_0xf1c3('0x16')]();}}function _0x2cd687(){logger[_0xf1c3('0x7')](_0xf1c3('0x21'));_0x4f67e2({'transcript':_0x35c607,'confidence':_0x7c1d25,'status':_0xbc0382,'status_message':_0x3c02fc});}function _0x34d32d(_0x18bf67){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xf1c3('0x22')](_0x18bf67)){logger['error'](_['isObject'](_0x18bf67)?JSON['stringify'](_0x18bf67):_0x18bf67);}}_0x31e83d['on'](_0xf1c3('0x23'),_0x2f5d2c);_0x31e83d['on'](_0xf1c3('0x24'),_0x20501c);_0x31e83d['on'](_0xf1c3('0x25'),_0x2cd687);_0x31e83d['on'](_0xf1c3('0x14'),_0x34d32d);});}; \ 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 73fdda4..611dbf4 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 _0xe903=['exports'];(function(_0x900f0f,_0x1d9fc5){var _0x388aba=function(_0x595c75){while(--_0x595c75){_0x900f0f['push'](_0x900f0f['shift']());}};_0x388aba(++_0x1d9fc5);}(_0xe903,0x183));var _0x3e90=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xe903[_0x4baae2];return _0x1a2285;};var asr=require('./asr');module[_0x3e90('0x0')]={'asr':asr}; \ No newline at end of file +var _0xc874=['./asr','exports'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xc874,0x92));var _0x4c87=function(_0x2c27ed,_0x5c50f0){_0x2c27ed=_0x2c27ed-0x0;var _0x597bd1=_0xc874[_0x2c27ed];return _0x597bd1;};var asr=require(_0x4c87('0x0'));module[_0x4c87('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 77b69a8..980147e 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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 9143d14..b706911 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 _0x4b84=['project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','util','lodash','randomstring','request-promise','../../config/logger','agi','rawHeaders','menu','getsecretdigits','channel','rpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','save_name','getMailAccountById','sendMailMessage','mailRpc','getIntervals','getIntervalById','IntervalId','interval','Intervals','getSoundPath','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','context','extension','priority','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','callback','toString','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','toUpperCase','body','rawBody','parse','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','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','args','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','add','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','replace','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','variable\x20%s\x20set','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','hasOwnProperty','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','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','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','no\x20file\x20audio\x20selected','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','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_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','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','variable_value','START\x20CALLY\x20SQUARE','yes','Answer','subproject','project_id','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d'];(function(_0x51cce9,_0x2b6d62){var _0x32053b=function(_0x18d168){while(--_0x18d168){_0x51cce9['push'](_0x51cce9['shift']());}};_0x32053b(++_0x2b6d62);}(_0x4b84,0x1cc));var _0x44b8=function(_0x29d6e6,_0x264220){_0x29d6e6=_0x29d6e6-0x0;var _0xc75ff0=_0x4b84[_0x29d6e6];return _0xc75ff0;};'use strict';var fs=require('fs');var util=require(_0x44b8('0x0'));var _=require(_0x44b8('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x44b8('0x2'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x44b8('0x6'),'rawBody'];var verticesWithRetry=[_0x44b8('0x7'),'getdigits',_0x44b8('0x8')];var AGIVertices=function(_0x5a2353,_0x5034b6,_0x41d515){this[_0x44b8('0x9')]=_0x5a2353;this[_0x44b8('0xa')]=_0x5034b6;this['mailRpc']=_0x41d515;};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc')]=function(_0x4315f6,_0x9b6048){this[_0x44b8('0xa')][_0x44b8('0xd')](_0x4315f6)[_0x44b8('0xe')](function(_0x4ae8a1){_0x9b6048(null,_0x4ae8a1?_0x4ae8a1[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0x4bcc43){_0x9b6048(_0x4bcc43);});};AGIVertices[_0x44b8('0xb')]['getVoiceQueue']=function(_0x833ea3,_0x18d642){this['rpc'][_0x44b8('0x11')](_0x833ea3)['then'](function(_0x54fa95){_0x18d642(null,_0x54fa95?_0x54fa95[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0x1722da){_0x18d642(_0x1722da);});};AGIVertices[_0x44b8('0xb')]['getSquareProject']=function(_0x495c74,_0x5d6349){this[_0x44b8('0xa')]['getSquareProjectById'](_0x495c74)[_0x44b8('0xe')](function(_0x31651b){_0x5d6349(null,_0x31651b?_0x31651b['name']:![]);})[_0x44b8('0x10')](function(_0xe3de8f){_0x5d6349(_0xe3de8f);});};AGIVertices['prototype'][_0x44b8('0x12')]=function(_0x3f4688,_0x4b600f){this[_0x44b8('0xa')][_0x44b8('0x13')](_0x3f4688)[_0x44b8('0xe')](function(_0x235bdc){_0x4b600f(null,_0x235bdc?_0x235bdc[_0x44b8('0x14')]:![]);})[_0x44b8('0x10')](function(_0x452f2f){_0x4b600f(_0x452f2f);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x15')]=function(_0x1e0f2d,_0x1d642b){this[_0x44b8('0xa')]['getUserById'](_0x1e0f2d)[_0x44b8('0xe')](function(_0x3a8aa4){_0x1d642b(null,_0x3a8aa4?_0x3a8aa4[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0x305a5c){_0x1d642b(_0x305a5c);});};AGIVertices['prototype'][_0x44b8('0x16')]=function(_0x54677c,_0x41a922){this[_0x44b8('0xa')][_0x44b8('0x17')](_0x54677c)[_0x44b8('0xe')](function(_0x230a3d){_0x41a922(null,_0x230a3d?_0x230a3d['name']:![]);})[_0x44b8('0x10')](function(_0x502acf){_0x41a922(_0x502acf);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x18')]=function(_0x549a26,_0x17ac44){var _0x470f49=this;this[_0x44b8('0xa')]['getSoundById'](_0x549a26)[_0x44b8('0xe')](function(_0x242342){_0x17ac44(null,_0x242342?_0x470f49['getSoundPath'](_0x242342[_0x44b8('0x19')]):![]);})['catch'](function(_0xfb0028){_0x17ac44(_0xfb0028);});};AGIVertices['prototype']['getMailAccount']=function(_0x5948dc,_0x387293){this[_0x44b8('0xa')][_0x44b8('0x1a')](_0x5948dc)[_0x44b8('0xe')](function(_0x38cd17){_0x387293(null,_0x38cd17?_0x38cd17:![]);})[_0x44b8('0x10')](function(_0x2cf205){_0x387293(_0x2cf205);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1b')]=function(_0x28f918,_0x5e1129,_0x417d81){this[_0x44b8('0x1c')]['sendMailMessage'](_0x28f918,_0x5e1129)[_0x44b8('0xe')](function(){_0x417d81(null);})['catch'](function(_0x212983){_0x417d81(_0x212983);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1d')]=function(_0xb64609,_0x1b63a7){this['rpc'][_0x44b8('0x1e')](_0xb64609)[_0x44b8('0xe')](function(_0x26265f){if(_0x26265f){if(_0x26265f[_0x44b8('0x1f')]){_0x1b63a7(null,[_0x26265f[_0x44b8('0x20')]]);}else{_0x1b63a7(null,_['map'](_0x26265f[_0x44b8('0x21')],_0x44b8('0x20')));}}else{_0x1b63a7(null,![]);}})[_0x44b8('0x10')](function(_0x3e93af){_0x1b63a7(_0x3e93af);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x22')]=function(_0x2e8b88){return util[_0x44b8('0x23')](_0x44b8('0x24'),FILES_PATH,_0x2e8b88);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x25')]=function(_0xce304d,_0xa5ac3e,_0xae15f4){odbc[_0x44b8('0x26')](_0xce304d,function(_0x1becb0){if(_0x1becb0){logger[_0x44b8('0x27')](_0x44b8('0x28'),_0x1becb0);_0xae15f4(_0x1becb0);}else{logger[_0x44b8('0x29')](_0x44b8('0x2a'));odbc[_0x44b8('0x2b')](_0xa5ac3e,function(_0x282345,_0x59848c){if(_0x282345){logger[_0x44b8('0x29')](_0x44b8('0x2c'),_0xa5ac3e);_0xae15f4(_0x282345);}else{logger['info'](_0x44b8('0x2d'),_0xa5ac3e);odbc[_0x44b8('0x2e')](function(_0x6658be){if(_0x6658be){logger[_0x44b8('0x27')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x6658be);}_0xae15f4(null,_0x59848c);});}});}});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x2f')]=function(_0x3611b4,_0x1ee3cc){this[_0x44b8('0xa')][_0x44b8('0x30')](_0x3611b4)[_0x44b8('0xe')](function(_0x3581b8){_0x1ee3cc(null,_0x3581b8?_0x3581b8:![]);})[_0x44b8('0x10')](function(_0x3d1be1){_0x1ee3cc(_0x3d1be1);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x31')]=function(_0xd69398,_0x31f22f){this[_0x44b8('0xa')][_0x44b8('0x31')](_0xd69398)['then'](function(_0x12a0a4){_0x31f22f(null,_0x12a0a4);})[_0x44b8('0x10')](function(_0xbf444f){_0x31f22f(_0xbf444f);});};AGIVertices['prototype'][_0x44b8('0x32')]=function(_0x1054c5,_0x229cc9,_0x585a16){this[_0x44b8('0xa')][_0x44b8('0x32')]({'uniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'node':_0x1054c5[_0x44b8('0x34')],'application':_0x1054c5['agicommand'],'data':_0x229cc9||null,'project_name':this['channel'][_0x44b8('0x35')],'callerid':this[_0x44b8('0x9')][_0x44b8('0x36')]})[_0x44b8('0xe')](function(_0x43906b){if(_0x585a16){_0x585a16(null,_0x43906b);}})[_0x44b8('0x10')](function(_0x3fc41b){if(_0x585a16){_0x585a16(_0x3fc41b);}});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x37')]=function(_0xb55911,_0x197782,_0x2a9b2a,_0xc1b9de){this[_0x44b8('0xa')][_0x44b8('0x37')]({'uniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'callerid':this[_0x44b8('0x9')][_0x44b8('0x36')],'calleridname':this['channel']['calleridname'],'context':this[_0x44b8('0x9')][_0x44b8('0x38')],'extension':this[_0x44b8('0x9')][_0x44b8('0x39')],'priority':this[_0x44b8('0x9')][_0x44b8('0x3a')],'accountcode':this[_0x44b8('0x9')]['accountcode'],'dnid':this[_0x44b8('0x9')]['dnid'],'projectName':this[_0x44b8('0x9')][_0x44b8('0x35')],'saveName':_0x197782,'filename':_0xb55911[_0x44b8('0x3b')]||_0x197782,'savePath':_0x2a9b2a})[_0x44b8('0xe')](function(_0x103d57){_0xc1b9de(null,_0x103d57);})[_0x44b8('0x10')](function(_0x491600){_0xc1b9de(_0x491600);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x3c')]=function(_0x10602c,_0x25d266,_0x4ccc77,_0x4e4ed1,_0x2f549d){this[_0x44b8('0xa')][_0x44b8('0x3c')]({'uniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'body':_0x10602c,'direction':_0x25d266,'providerName':_0x4ccc77,'providerResponse':_0x4e4ed1})['then'](function(_0x19d95d){if(_0x2f549d){_0x2f549d(null,_0x19d95d);}})[_0x44b8('0x10')](function(_0x2c5c27){if(_0x2f549d){_0x2f549d(_0x2c5c27);}});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x3d')]=function(_0x57d0e2,_0x493840){this[_0x44b8('0xa')]['createCmContact']({'firstName':_[_0x44b8('0x3e')](_0x57d0e2['name'])||_[_0x44b8('0x3f')](_0x57d0e2[_0x44b8('0xf')])?_0x44b8('0x40')+Math[_0x44b8('0x41')]():_0x57d0e2[_0x44b8('0xf')],'lastName':_[_0x44b8('0x3e')](_0x57d0e2[_0x44b8('0x42')])||_['isNil'](_0x57d0e2[_0x44b8('0x42')])?null:_0x57d0e2[_0x44b8('0x42')],'phone':_0x57d0e2[_0x44b8('0x43')],'ListId':_0x57d0e2['list_id'],'scheduledat':_0x57d0e2[_0x44b8('0x44')],'callbackUniqueid':this[_0x44b8('0x9')][_0x44b8('0x33')],'tags':_0x44b8('0x45'),'description':'Callback\x20scheduled\x20at\x20'+_0x57d0e2[_0x44b8('0x44')][_0x44b8('0x46')](),'priority':_0x57d0e2['callback_priority']})[_0x44b8('0xe')](function(_0x19f22b){_0x493840(null,_0x19f22b);})[_0x44b8('0x10')](function(_0x3df6aa){_0x493840(_0x3df6aa);});};AGIVertices[_0x44b8('0xb')]['getPause']=function(_0x5b99a3,_0xc181d2){this[_0x44b8('0xa')][_0x44b8('0x47')](_0x5b99a3)[_0x44b8('0xe')](function(_0x765e45){_0xc181d2(null,_0x765e45?_0x765e45[_0x44b8('0xf')]:![]);})[_0x44b8('0x10')](function(_0xf0fb0d){_0xc181d2(_0xf0fb0d);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x48')]=function(_0x16c628,_0x3f7576,_0x5af3e6){var _0x1367ae={'role':_0x44b8('0x49')};_0x1367ae[_0x16c628]=this[_0x44b8('0x9')][_0x44b8('0x36')];this[_0x44b8('0xa')][_0x44b8('0x48')](_0x1367ae,_0x3f7576,this[_0x44b8('0x9')][_0x44b8('0x33')])[_0x44b8('0xe')](function(_0x2d6a31){_0x5af3e6(null,_[_0x44b8('0x3f')](_0x2d6a31)?![]:!![]);})[_0x44b8('0x10')](function(_0x1da152){logger[_0x44b8('0x27')](_0x1da152);_0x5af3e6(null,![]);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x4a')]=function(_0x25f91c,_0x20e563){var _0x4cf835={'role':_0x44b8('0x49')};_0x4cf835[_0x25f91c]=this[_0x44b8('0x9')][_0x44b8('0x36')];this[_0x44b8('0xa')][_0x44b8('0x4a')](_0x4cf835)[_0x44b8('0xe')](function(_0x2ecf65){_0x20e563(null,_['isNil'](_0x2ecf65)?![]:!![]);})[_0x44b8('0x10')](function(_0xc4d667){logger['error'](_0xc4d667);_0x20e563(null,![]);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x4b')]=function(_0x520929,_0x37e42e){var _0x454fe6={'role':_0x44b8('0x49')};_0x454fe6[_0x520929]=this['channel'][_0x44b8('0x36')];this['rpc'][_0x44b8('0x4b')](_0x454fe6)['then'](function(_0x176536){_0x37e42e(null,_[_0x44b8('0x3f')](_0x176536)?![]:!![]);})[_0x44b8('0x10')](function(_0xb64e26){logger[_0x44b8('0x27')](_0xb64e26);_0x37e42e(null,![]);});};AGIVertices[_0x44b8('0xb')]['agentLogin']=function(_0x2af6be,_0x4a08e8){var _0x458bdf={'role':_0x44b8('0x49')};_0x458bdf[_0x2af6be]=this['channel'][_0x44b8('0x36')];var _0x1ee26b=_0x2af6be!=_0x44b8('0x4c')?util[_0x44b8('0x23')](_0x44b8('0x4d'),_0x44b8('0x4e'),this[_0x44b8('0x9')][_0x44b8('0x36')]):undefined;this[_0x44b8('0xa')][_0x44b8('0x4f')](_0x458bdf,_0x1ee26b)[_0x44b8('0xe')](function(_0x27869f){_0x4a08e8(null,_['isNil'](_0x27869f)?![]:!![]);})[_0x44b8('0x10')](function(_0x4052a9){logger[_0x44b8('0x27')](_0x4052a9);_0x4a08e8(null,![]);});};AGIVertices['prototype'][_0x44b8('0x50')]=function(_0x5cc122,_0x5bff09){sh[_0x44b8('0x51')](_[_0x44b8('0x52')](_0x5cc122),function(_0xb89680,_0x3d80c3){var _0x44bb6b=_0x3d80c3['replace'](/(\r\n|\n|\r)/gm,'');_0x5bff09(null,_0x44bb6b);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x53')]=function(_0x279753,_0x270224){scripts[_0x44b8('0x53')](_0x279753[_0x44b8('0x54')],_0x279753[_0x44b8('0x55')]||_0x44b8('0x56'),_0x279753['text'],_0x279753[_0x44b8('0x57')]||_0x44b8('0x58'),_0x279753[_0x44b8('0x59')]||_0x44b8('0x5a'),_0x279753['audioEncoding']||'MP3')['then'](function(_0x118f89){_0x270224(null,_0x118f89);})[_0x44b8('0x10')](function(_0x1bee2e){_0x270224(_0x1bee2e);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x5b')]=function(_0x5beb66,_0x26745c){scripts['googleTTS'](_0x5beb66[_0x44b8('0x56')],_0x5beb66[_0x44b8('0x5c')]||'en',0x1)[_0x44b8('0xe')](function(_0x5da034){_0x26745c(null,_0x5da034);})['catch'](function(_0xb4c6dc){_0x26745c(_0xb4c6dc);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x5d')]=function(_0x536734,_0x1f5277){var _0x36f217={'uri':_0x536734[_0x44b8('0x5e')],'method':_0x536734[_0x44b8('0x5f')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x536734[_0x44b8('0x60')])==='number'&&parseInt(_0x536734[_0x44b8('0x60')])>=0x1?parseInt(_0x536734[_0x44b8('0x60')])*0x3e8:0x5*0x3e8};if(_[_0x44b8('0x61')]([_0x44b8('0x62'),_0x44b8('0x63')],_0x36f217['method'][_0x44b8('0x64')]())){try{_0x36f217[_0x44b8('0x65')]=_0x536734[_0x44b8('0x66')]?JSON[_0x44b8('0x67')](_0x536734[_0x44b8('0x66')]):{};}catch(_0x1bd9e9){logger[_0x44b8('0x27')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1bd9e9);}}try{_0x36f217[_0x44b8('0x68')]=_0x536734[_0x44b8('0x6')]?JSON['parse'](_0x536734[_0x44b8('0x6')]):{};}catch(_0xa19e5f){logger['error'](_0x44b8('0x69'),_0xa19e5f);}if(_0x536734['computedVariables']){try{var _0x56dccf=require(_0x536734[_0x44b8('0x6a')])[_0x44b8('0x6b')](this,_0x36f217);_0x36f217[_0x44b8('0x6c')]=Mustache['render'](_0x536734['url'],_0x56dccf,{},['$$','$$']);if(_0x36f217['headers']){_0x36f217[_0x44b8('0x68')]=JSON[_0x44b8('0x67')](Mustache[_0x44b8('0x6d')](JSON[_0x44b8('0x6e')](_0x36f217[_0x44b8('0x68')]),_0x56dccf,{},['$$','$$']));}if(_0x36f217[_0x44b8('0x65')]){_0x36f217[_0x44b8('0x65')]=JSON[_0x44b8('0x67')](Mustache['render'](JSON[_0x44b8('0x6e')](_0x36f217['body']),_0x56dccf,{},['$$','$$']));}}catch(_0x59e7b4){logger['error'](_0x44b8('0x6f'),_0x59e7b4);}}rp(_0x36f217)['then'](function(_0x2166df){var _0x1e37fd={'statusCode':_0x2166df[_0x44b8('0x70')]||0xc8,'statusMessage':_0x2166df[_0x44b8('0x71')]||'OK','headers':_0x2166df[_0x44b8('0x68')]||{},'body':_0x2166df[_0x44b8('0x65')]||{}};_0x1f5277(null,_0x1e37fd);})[_0x44b8('0x10')](function(_0x953f65){var _0x5e8e0b={'statusCode':_0x953f65[_0x44b8('0x70')]||0x1f4,'statusMessage':_0x953f65[_0x44b8('0x72')]||_0x44b8('0x73'),'headers':_0x953f65[_0x44b8('0x74')][_0x44b8('0x68')]||{},'body':_0x953f65[_0x44b8('0x74')][_0x44b8('0x65')]||{}};_0x1f5277(null,_0x5e8e0b);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x75')]=function(_0x5f4734,_0x4b45a7){scripts[_0x44b8('0x75')](this['channel'][_0x44b8('0x33')],_0x5f4734[_0x44b8('0x76')],_0x5f4734[_0x44b8('0x56')],_0x5f4734['dialogflow_language']||'en')['then'](function(_0x4b22e7){_0x4b45a7(null,_0x4b22e7);})[_0x44b8('0x10')](function(_0x4860af){_0x4b45a7(_0x4860af);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x77')]=function(_0xf18cb2,_0x322a49){scripts[_0x44b8('0x77')](this[_0x44b8('0x9')][_0x44b8('0x33')],_0xf18cb2[_0x44b8('0x78')],_0xf18cb2[_0x44b8('0x79')],_0xf18cb2[_0x44b8('0x7a')],_0xf18cb2[_0x44b8('0x56')],_0xf18cb2[_0x44b8('0x7b')]||'en')[_0x44b8('0xe')](function(_0x1abe3a){_0x322a49(null,_0x1abe3a);})['catch'](function(_0x410b3a){_0x322a49(_0x410b3a);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7c')]=function(_0x379b35,_0x45a6c3){scripts[_0x44b8('0x7c')](this[_0x44b8('0x9')],_0x379b35)[_0x44b8('0xe')](function(_0x39dc52){_0x45a6c3(null,_0x39dc52);})[_0x44b8('0x10')](function(_0x1774db){_0x45a6c3(_0x1774db);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7d')]=function(_0x4f9b68,_0xfb6160){scripts[_0x44b8('0x7d')](_0x4f9b68[_0x44b8('0x76')],_0x4f9b68['text'],_0x4f9b68['ispeech_tts_language']||_0x44b8('0x58'),_0x4f9b68[_0x44b8('0x7e')])[_0x44b8('0xe')](function(_0x57c4d7){_0xfb6160(null,_0x57c4d7);})[_0x44b8('0x10')](function(_0x419852){_0xfb6160(_0x419852);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7f')]=function(_0x1d7b07,_0x4695b3,_0x327f5a){scripts[_0x44b8('0x7f')](_0x4695b3,_0x1d7b07['key'],_0x1d7b07[_0x44b8('0x80')]||_0x44b8('0x58'),this[_0x44b8('0x81')](_0x1d7b07[_0x44b8('0x82')])?_0x1d7b07[_0x44b8('0x82')]:undefined)[_0x44b8('0xe')](function(_0x9d6d07){_0x327f5a(null,_0x9d6d07);})['catch'](function(_0x5c8ce9){_0x327f5a(_0x5c8ce9);});};AGIVertices['prototype'][_0x44b8('0x83')]=function(_0xc5f9ef,_0x2d74ee){scripts[_0x44b8('0x83')](_0xc5f9ef[_0x44b8('0x84')],_0xc5f9ef[_0x44b8('0x85')],_0xc5f9ef[_0x44b8('0x86')],_0xc5f9ef[_0x44b8('0x87')]||_0x44b8('0x88'),_0xc5f9ef['text'],_0xc5f9ef[_0x44b8('0x89')]||_0x44b8('0x56'))['then'](function(_0x4e204b){_0x2d74ee(null,_0x4e204b);})[_0x44b8('0x10')](function(_0x4ee9e3){_0x2d74ee(_0x4ee9e3);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x8a')]=function(_0x207164,_0x5e5e1d){scripts[_0x44b8('0x8a')](this[_0x44b8('0x9')][_0x44b8('0x33')],_0x207164[_0x44b8('0x84')],_0x207164['aws_secret_access_key'],_0x207164[_0x44b8('0x8b')],_0x207164['text'],_0x207164[_0x44b8('0x8c')])[_0x44b8('0xe')](function(_0x2d9d62){_0x5e5e1d(null,_0x2d9d62);})[_0x44b8('0x10')](function(_0x3fe77d){_0x5e5e1d(_0x3fe77d);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x8d')]=function(_0x5b3e72,_0x4d3b82,_0x563d7d){scripts[_0x44b8('0x8d')](_0x4d3b82,_0x5b3e72[_0x44b8('0x76')],_0x5b3e72[_0x44b8('0x8e')]||_0x44b8('0x58'))[_0x44b8('0xe')](function(_0x185b3c){_0x563d7d(null,_0x185b3c);})[_0x44b8('0x10')](function(_0x1236df){_0x563d7d(_0x1236df);});};AGIVertices[_0x44b8('0xb')][_0x44b8('0x8f')]=function(_0x32057a,_0x3dfb2c,_0x3cd117){scripts[_0x44b8('0x8f')](_0x3dfb2c,_0x32057a[_0x44b8('0x90')],_0x32057a[_0x44b8('0x91')],_0x32057a[_0x44b8('0x6c')])[_0x44b8('0xe')](function(_0x5cf8ba){_0x3cd117(null,_0x5cf8ba);})[_0x44b8('0x10')](function(_0x49aecf){_0x3cd117(_0x49aecf);});};AGIVertices[_0x44b8('0xb')]['clear']=function(_0x5db410){var _0x2e171b=_['includes'](verticesWithRetry,_0x5db410['agicommand'])?_0x5db410:_['clone'](_0x5db410);for(var _0x4aa919 in _0x2e171b){if(_0x2e171b['hasOwnProperty'](_0x4aa919)){if(_0x2e171b[_0x4aa919]&&_[_0x44b8('0x92')](_0x2e171b[_0x4aa919])){if(_[_0x44b8('0x61')](recursiveMapAttributes,_0x4aa919)){_0x2e171b[_0x4aa919]=this[_0x44b8('0x93')](_0x2e171b[_0x4aa919]);}else{_0x2e171b[_0x4aa919]=this[_0x44b8('0x94')](_0x2e171b[_0x4aa919]);}}}}return _0x2e171b;};AGIVertices['prototype'][_0x44b8('0x95')]=function(_0x416c89){for(var _0x5bcd22 in _0x416c89){if(_0x416c89['hasOwnProperty'](_0x5bcd22)){if(_[_0x44b8('0x96')](_0x416c89[_0x5bcd22])){this[_0x44b8('0x95')](_0x416c89[_0x5bcd22]);}else if(_[_0x44b8('0x97')](_0x416c89[_0x5bcd22])){for(var _0x507eda=0x0;_0x507eda<_0x416c89[_0x5bcd22][_0x44b8('0x98')];_0x507eda++){this[_0x44b8('0x95')](_0x416c89[_0x5bcd22][_0x507eda]);}}else if(_[_0x44b8('0x92')](_0x416c89[_0x5bcd22])){_0x416c89[_0x5bcd22]=this[_0x44b8('0x94')](_0x416c89[_0x5bcd22]);}}}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x99')]=function(_0x25f605,_0x16344b){for(var _0x21057f in _0x25f605){if(_0x25f605['hasOwnProperty'](_0x21057f)){if(_[_0x44b8('0x96')](_0x25f605[_0x21057f])){if(!_[_0x44b8('0x3e')](_0x25f605[_0x21057f])){this['saveRestApiResult'](_0x25f605[_0x21057f],util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x16344b,_0x21057f));}}else if(_[_0x44b8('0x97')](_0x25f605[_0x21057f])){for(var _0x4da0a5=0x0;_0x4da0a5<_0x25f605[_0x21057f][_0x44b8('0x98')];_0x4da0a5++){this['saveRestApiResult'](_0x25f605[_0x21057f][_0x4da0a5],util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x16344b,_0x21057f+'['+_0x4da0a5+']'));}}else{if(!_['isNil'](_0x25f605[_0x21057f])){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x16344b,_0x21057f),_0x25f605[_0x21057f]);}}}}};AGIVertices['prototype'][_0x44b8('0x93')]=function(_0xf73cde){try{var _0x10caca=JSON[_0x44b8('0x67')](_0xf73cde);this[_0x44b8('0x95')](_0x10caca);return JSON[_0x44b8('0x6e')](_0x10caca);}catch(_0x10a66a){return this[_0x44b8('0x94')](_0xf73cde);}};AGIVertices[_0x44b8('0xb')]['replaceAllVariables']=function(_0x53cbee){var _0x331e89=_0x53cbee[_0x44b8('0x9c')]('{');for(var _0x1d29cd=0x1;_0x1d29cd<_0x331e89[_0x44b8('0x98')];_0x1d29cd+=0x1){var _0x276c14=_0x331e89[_0x1d29cd]['split']('}');if(_0x276c14[_0x44b8('0x98')]>0x1){_0x53cbee=_0x53cbee['replaceAll']('{'+_0x276c14[0x0]+'}',this[_0x44b8('0x9')]['getVariable'](_0x276c14[0x0])[_0x44b8('0x9d')]||_0x276c14[0x0]);}}if(_0x331e89[_0x44b8('0x98')]===0x1){return _0x53cbee[_0x44b8('0x46')]();}return this[_0x44b8('0x94')](_0x53cbee);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x9e')]=function(_0x1ee7d1,_0x465ef7){var _0x1c7d88=this['channel'][_0x44b8('0xc')](_0x1ee7d1);if(_0x1c7d88[_0x44b8('0x9f')]===-0x1){return _0x1c7d88;}logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x465ef7,_0x1c7d88['extra']));return this['channel'][_0x44b8('0x9b')](_0x465ef7,_0x1c7d88['extra']);};AGIVertices['prototype'][_0x44b8('0x81')]=function(_0x317337){return _0x317337&&_0x317337!=='0'&&_0x317337!=='-1'&&_0x317337!=='';};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa0')]=function(_0x413dd9){this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x413dd9,'-');_0x413dd9[_0x44b8('0xa1')]=_0x413dd9['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa2')]=function(_0x1e2407){logger[_0x44b8('0x29')](util['format'](_0x44b8('0xa3'),_0x1e2407[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1e2407['text'])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0xa5'));}var _0x187213='\x22'+_0x1e2407[_0x44b8('0x56')]+'\x22';if(this[_0x44b8('0x81')](_0x1e2407['options'])){_0x187213+=','+_0x1e2407[_0x44b8('0x74')];}var _0x458cfc=this['channel'][_0x44b8('0x51')](_0x44b8('0xa6'),_0x187213);if(_0x458cfc[_0x44b8('0x9f')]===-0x1){return _0x458cfc;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')]('Executed\x20command\x20MRCPSynth\x20%s',_0x187213));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa7')]=function(_0x1eb1b7){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xa8'),_0x1eb1b7[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1eb1b7['grammar'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa9'));}var _0x42e772=_0x1eb1b7[_0x44b8('0xaa')];if(this[_0x44b8('0x81')](_0x1eb1b7['options'])){_0x42e772+=','+_0x1eb1b7['options'];}var _0x342125=this[_0x44b8('0x9')]['exec'](_0x44b8('0xab'),_0x42e772);if(_0x342125[_0x44b8('0x9f')]===-0x1){return _0x342125;}var _0x4e83b6=this[_0x44b8('0x9e')](_0x44b8('0xac'),_0x44b8('0xad'));if(_0x4e83b6[_0x44b8('0x9f')]===-0x1){return _0x4e83b6;}var _0x334522=this[_0x44b8('0x9e')](_0x44b8('0xae'),_0x44b8('0xaf'));if(_0x334522[_0x44b8('0x9f')]===-0x1){return _0x334522;}var _0x225f18=this[_0x44b8('0x9e')](_0x44b8('0xb0'),_0x44b8('0xb1'));if(_0x225f18[_0x44b8('0x9f')]===-0x1){return _0x225f18;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0xb2'),_0x42e772));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x5')]=function(_0x584768){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x584768[_0x44b8('0x34')]));return this['channel'][_0x44b8('0x5')]([_0x584768[_0x44b8('0xb3')],_0x584768[_0x44b8('0xb4')]]);};AGIVertices[_0x44b8('0xb')]['answer']=function(_0x4ff9c0){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4ff9c0['label']));if(this['isConfigured'](_0x4ff9c0[_0x44b8('0x60')])){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x4ff9c0['timeout']));var _0x28da8b=this[_0x44b8('0x9')][_0x44b8('0xb5')](_0x4ff9c0[_0x44b8('0x60')]);if(_0x28da8b[_0x44b8('0x9f')]===-0x1){return _0x28da8b;}}return this[_0x44b8('0x9')][_0x44b8('0xb6')]();};AGIVertices[_0x44b8('0xb')][_0x44b8('0x45')]=function(_0x4ed62f){logger[_0x44b8('0x29')](util['format'](_0x44b8('0xb7'),_0x4ed62f['label']));if(!this['isConfigured'](_0x4ed62f[_0x44b8('0xb8')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x4ed62f,_0x44b8('0xb9'));}_0x4ed62f[_0x44b8('0x44')]=moment();if(this[_0x44b8('0x81')](_0x4ed62f[_0x44b8('0xba')])){_0x4ed62f[_0x44b8('0x44')]=moment()[_0x44b8('0xbb')](_0x4ed62f['delay'],_0x44b8('0xbc'));}if(!this[_0x44b8('0x81')](_0x4ed62f[_0x44b8('0xbd')])){_0x4ed62f['callback_priority']=0x2;}this['createCmContact'][_0x44b8('0x6b')](this,_0x4ed62f);return this['channel'][_0x44b8('0xa4')](util['format'](_0x44b8('0xbe'),_0x4ed62f['phone'],_0x4ed62f['list_id'],_0x4ed62f[_0x44b8('0x44')]));};AGIVertices[_0x44b8('0xb')]['custom_app']=function(_0x32e08e){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xbf'),_0x32e08e[_0x44b8('0x34')]));var _0x57b73f=this[_0x44b8('0x9')]['exec'](_0x32e08e['application'],_0x32e08e['options']);if(_0x57b73f[_0x44b8('0x9f')]===-0x1){return _0x57b73f;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0xc0'),_0x32e08e['application'],_0x32e08e['options']));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc1')]=function(_0x51adc0){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x51adc0[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x51adc0['text'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}var _0x4edc9b='\x22'+_0x51adc0[_0x44b8('0x56')]+'\x22';if(this['isConfigured'](_0x51adc0[_0x44b8('0x74')])){_0x4edc9b+=','+_0x51adc0['options'];}var _0x5eedf4=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0xa6'),_0x4edc9b);if(_0x5eedf4[_0x44b8('0x9f')]===-0x1){return _0x5eedf4;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc2'),_0x4edc9b));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc3')]=function(_0x1b5352){logger['info'](util[_0x44b8('0x23')](_0x44b8('0xc4'),_0x1b5352[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1b5352[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}var _0x5c2adc='\x22'+_0x1b5352[_0x44b8('0x56')]+'\x22';if(this[_0x44b8('0x81')](_0x1b5352['options'])){_0x5c2adc+=','+_0x1b5352[_0x44b8('0x74')];}var _0x355a20=this[_0x44b8('0x9')]['exec']('MRCPSynth',_0x5c2adc);if(_0x355a20[_0x44b8('0x9f')]===-0x1){return _0x355a20;}return this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0xc2'),_0x5c2adc));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xc5')]=function(_0x2bccf9){logger[_0x44b8('0x29')](util['format'](_0x44b8('0xc6'),_0x2bccf9['label']));if(!this[_0x44b8('0x81')](_0x2bccf9[_0x44b8('0xaa')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa9'));}var _0x180c33=_0x2bccf9['grammar'];if(this[_0x44b8('0x81')](_0x2bccf9['options'])){_0x180c33+=','+_0x2bccf9[_0x44b8('0x74')];}var _0x1233a3=this['channel'][_0x44b8('0x51')]('MRCPRecog',_0x180c33);if(_0x1233a3[_0x44b8('0x9f')]===-0x1){return _0x1233a3;}var _0x371094=this[_0x44b8('0x9e')]('RECOG_CONFIDENCE()',_0x44b8('0xc7'));if(_0x371094[_0x44b8('0x9f')]===-0x1){return _0x371094;}var _0x4ff63e=this[_0x44b8('0x9e')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x4ff63e[_0x44b8('0x9f')]===-0x1){return _0x4ff63e;}var _0x4da59c=this[_0x44b8('0x9e')]('RECOG_INSTANCE()',_0x44b8('0xc8'));if(_0x4da59c[_0x44b8('0x9f')]===-0x1){return _0x4da59c;}return this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('Executed\x20command\x20MRCPRecog\x20%s',_0x180c33));};AGIVertices['prototype'][_0x44b8('0xc9')]=function(_0x440eb4){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x440eb4[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x440eb4[_0x44b8('0xaa')])){return this[_0x44b8('0x9')]['noop']('no\x20grammar\x20configured');}var _0xf7cbd8=_0x440eb4[_0x44b8('0xaa')];if(this[_0x44b8('0x81')](_0x440eb4['options'])){_0xf7cbd8+=','+_0x440eb4[_0x44b8('0x74')];}var _0x301770=this['channel'][_0x44b8('0x51')](_0x44b8('0xab'),_0xf7cbd8);if(_0x301770[_0x44b8('0x9f')]===-0x1){return _0x301770;}var _0x2cb698=this[_0x44b8('0x9e')](_0x44b8('0xac'),'SESTEK_ASR_CONFIDENCE');if(_0x2cb698['result']===-0x1){return _0x2cb698;}var _0x46382c=this['getAndSetVariable'](_0x44b8('0xae'),'SESTEK_ASR_TRANSCRIPT');if(_0x46382c[_0x44b8('0x9f')]===-0x1){return _0x46382c;}var _0x36d09c=this[_0x44b8('0x9e')](_0x44b8('0xb0'),_0x44b8('0xca'));if(_0x36d09c[_0x44b8('0x9f')]===-0x1){return _0x36d09c;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xb2'),_0xf7cbd8));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xcb')]=function(_0xb8404f){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xcc'),_0xb8404f['label']));if(!this[_0x44b8('0x81')](_0xb8404f['odbc_id'])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0xb8404f,_0x44b8('0xcd'));}var _0x10fd21=this[_0x44b8('0x12')][_0x44b8('0x6b')](this,_0xb8404f[_0x44b8('0xce')]);if(!_0x10fd21){return this['channel']['error'](_0xb8404f,_0x44b8('0xcf'));}if(!this[_0x44b8('0x81')](_0xb8404f[_0x44b8('0x2b')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0xb8404f,'no\x20query\x20configured');}var _0x32c4a4=_0xb8404f[_0x44b8('0x2b')][_0x44b8('0xd0')](/(\r\n|\n|\r)/gm,'\x20');this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('query:\x20%s',_0x32c4a4));var _0x4d07e=this[_0x44b8('0x25')][_0x44b8('0x6b')](this,_0x10fd21,_0x32c4a4);this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0xb8404f,_0x32c4a4);if(!this['isConfigured'](_0xb8404f['variable_id'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5ae640=this[_0x44b8('0xc')]['sync'](this,_0xb8404f[_0x44b8('0xd1')]);if(!_0x5ae640){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0xb8404f,_0x44b8('0xd2'));}var _0x3de181=this;_0x4d07e[_0x44b8('0xd3')](function(_0x249f6a,_0x42c8a5){Object['keys'](_0x249f6a)[_0x44b8('0xd3')](function(_0xf24cdd){_0x3de181[_0x44b8('0x9')]['setVariable'](util[_0x44b8('0x23')](_0x44b8('0xd4'),_0x5ae640,_0x42c8a5,_0xf24cdd),_0x249f6a[_0xf24cdd]);});});this['channel']['setVariable'](util['format']('%s_ROWS_COUNT',_0x5ae640),_0x4d07e[_0x44b8('0x98')]);return this['channel']['noop'](util[_0x44b8('0x23')](_0x44b8('0xd5'),_0x5ae640));};AGIVertices[_0x44b8('0xb')]['dial']=function(_0x36927e){logger['debug'](util[_0x44b8('0x23')](_0x44b8('0xd6'),_0x36927e[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x36927e['sip_id'])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x36927e,_0x44b8('0xd7'));}var _0x494697=this['getUser']['sync'](this,_0x36927e[_0x44b8('0xd8')]);if(!_0x494697){return this[_0x44b8('0x9')]['error'](_0x36927e,_0x44b8('0xd9'));}var _0x188744=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0xda'),[util[_0x44b8('0x23')](_0x44b8('0xdb'),_0x494697),_0x36927e[_0x44b8('0x60')],_0x36927e['opts'],_0x36927e[_0x44b8('0x5e')]]);if(_0x188744[_0x44b8('0x9f')]===-0x1){return _0x188744;}return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')]('Executed\x20command\x20%s',_0x44b8('0xda')));};AGIVertices['prototype'][_0x44b8('0xdc')]=function(_0x1978a9){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0xdd'),_0x1978a9[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1978a9[_0x44b8('0x76')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xde'));}if(!this[_0x44b8('0x81')](_0x1978a9['text'])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xa5'));}this['channel'][_0x44b8('0xdf')]=!![];this[_0x44b8('0x32')](_0x1978a9);this[_0x44b8('0x3c')](_0x1978a9[_0x44b8('0x56')],'in','','');this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('Trying\x20Dialogflow:\x20%s',_0x1978a9[_0x44b8('0x56')]));var _0x2ea253=this[_0x44b8('0x75')][_0x44b8('0x6b')](this,_0x1978a9);if(_0x2ea253){for(var _0x3ee44e in _0x2ea253){if(_0x2ea253[_0x44b8('0xe0')](_0x3ee44e)){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0xe1'),_0x3ee44e[_0x44b8('0x64')]()),_0x2ea253[_0x3ee44e]);}}this[_0x44b8('0x3c')](_0x2ea253[_0x44b8('0xe2')],_0x44b8('0xe3'),'dialogflow','');return this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0xe4'),_0x2ea253[_0x44b8('0xe2')]));}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x1978a9,_0x44b8('0xe5'));};AGIVertices['prototype'][_0x44b8('0xe6')]=function(_0x1c8718){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x1c8718[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x1c8718['dialogflowV2_project_id'])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this[_0x44b8('0x81')](_0x1c8718['client_email'])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0xe7'));}if(!this[_0x44b8('0x81')](_0x1c8718['private_key'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xe8'));}if(!this[_0x44b8('0x81')](_0x1c8718['dialogflowV2_language'])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xe9'));}if(!this[_0x44b8('0x81')](_0x1c8718['text'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xdf')]=!![];this['createSquareDetailsReport'](_0x1c8718);this['createSquareMessage'](_0x1c8718[_0x44b8('0x56')],'in','','');this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xea'),_0x1c8718[_0x44b8('0x56')]));var _0x1bed4f=this[_0x44b8('0x77')][_0x44b8('0x6b')](this,_0x1c8718);if(_0x1bed4f){for(var _0x157824 in _0x1bed4f){if(_0x1bed4f[_0x44b8('0xe0')](_0x157824)){if(_0x157824!==_0x44b8('0xeb')){this['channel']['setVariable'](util[_0x44b8('0x23')]('DIALOGFLOW_%s',_0x157824[_0x44b8('0x64')]()),_0x1bed4f[_0x157824]);}}}this[_0x44b8('0x3c')](_0x1bed4f[_0x44b8('0xe2')],'out',_0x44b8('0xe6'),_0x1bed4f[_0x44b8('0xeb')]);return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xec'),_0x1bed4f['speech']));}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x1c8718,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x44b8('0xb')][_0x44b8('0xed')]=function(_0x22edd7){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x22edd7[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x22edd7[_0x44b8('0xee')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xef'));}if(!this[_0x44b8('0x81')](_0x22edd7[_0x44b8('0xf0')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20username\x20configured');}if(!this[_0x44b8('0x81')](_0x22edd7[_0x44b8('0xf1')])){return this[_0x44b8('0x9')]['noop']('no\x20password\x20configured');}if(!this[_0x44b8('0x81')](_0x22edd7['ndassistant_url'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xdf')]=!![];this[_0x44b8('0x32')](_0x22edd7);this[_0x44b8('0x3c')](_0x22edd7['text'],'in','','');this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xf2'),_0x22edd7[_0x44b8('0x56')]));var _0x506731=this[_0x44b8('0x7c')]['sync'](this,_0x22edd7);if(_0x506731){for(var _0x4d88a6 in _0x506731){if(_0x506731[_0x44b8('0xe0')](_0x4d88a6)){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0xf3'),_0x4d88a6[_0x44b8('0x64')]()),_0x506731[_0x4d88a6]);}}this[_0x44b8('0x3c')](_0x506731['speech'],_0x44b8('0xe3'),_0x44b8('0xed'),'');if(_0x506731[_0x44b8('0xf4')]){this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xf5'),_0x506731[_0x44b8('0xf4')]));var _0x4dd93c=this[_0x44b8('0x9')][_0x44b8('0xf6')](_0x506731[_0x44b8('0xf4')]);try{fs['unlink'](_0x506731['audiofile']+'.wav');}catch(_0x4b3c64){logger['error'](_0x4b3c64);}return _0x4dd93c;}else{return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xf7'),_0x506731[_0x44b8('0xe2')]));}}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x22edd7,_0x44b8('0xf8'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0xf9')]=function(_0x16e1d6){logger['info'](util[_0x44b8('0x23')](_0x44b8('0xfa'),_0x16e1d6[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0xa4')]('end');};AGIVertices[_0x44b8('0xb')]['ext_dial']=function(_0x4033b5){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x4033b5[_0x44b8('0x34')]));var _0x964c3c='';if(_0x4033b5['trunk_id']){if(!this[_0x44b8('0x81')](_0x4033b5[_0x44b8('0xfb')])){return this[_0x44b8('0x9')]['error'](_0x4033b5,_0x44b8('0xfc'));}else{var _0x5495e6=parseInt(_0x4033b5[_0x44b8('0xfb')],0xa);if(isNaN(_0x5495e6)){_0x964c3c=_0x4033b5[_0x44b8('0xfb')];}else{_0x964c3c=this[_0x44b8('0x16')]['sync'](this,_0x4033b5[_0x44b8('0xfb')]);if(!_0x964c3c){return this['channel'][_0x44b8('0x27')](_0x4033b5,_0x44b8('0xfd'));}}}}else if(_0x4033b5[_0x44b8('0xfe')]){_0x964c3c=_0x4033b5[_0x44b8('0xfe')];}else{return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x4033b5,'no\x20trunk\x20selected');}var _0x3c0557=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0xda'),[util['format'](_0x44b8('0xff'),_0x964c3c,_0x4033b5[_0x44b8('0x43')]),_0x4033b5[_0x44b8('0x60')],_0x4033b5[_0x44b8('0x100')],_0x4033b5[_0x44b8('0x5e')]]);if(_0x3c0557[_0x44b8('0x9f')]===-0x1){return _0x3c0557;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x101'),_0x44b8('0xda')));};AGIVertices[_0x44b8('0xb')]['finally']=function(_0x2cf3ac){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x102'),_0x2cf3ac['label']));return this[_0x44b8('0x9')]['noop'](_0x44b8('0x103'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x104')]=function(_0x5baaa3){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x105'),_0x5baaa3[_0x44b8('0x34')]));if(_0x5baaa3[_0x44b8('0xa1')]===0x0){return this['maxRetry'](_0x5baaa3);}_0x5baaa3[_0x44b8('0xa1')]-=0x1;if(!this[_0x44b8('0x81')](_0x5baaa3[_0x44b8('0x106')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x5baaa3,'no\x20file\x20audio\x20selected');}var _0x422f56=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x5baaa3[_0x44b8('0x106')]);if(!_0x422f56){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x5baaa3,_0x44b8('0x107'));}if(!this['isConfigured'](_0x5baaa3['variable_id'])){return this['channel'][_0x44b8('0x27')](_0x44b8('0x108'));}var _0x46dd24=this['channel']['getData'](_0x422f56,_0x5baaa3[_0x44b8('0x109')],_0x5baaa3[_0x44b8('0x10a')]);var _0x452d24=_0x46dd24[_0x44b8('0x9f')]?_0x46dd24[_0x44b8('0x9f')]['toString']():'';logger['info']('test',JSON['stringify'](_0x46dd24));if(_0x46dd24[_0x44b8('0x9f')]===-0x1){this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,_0x452d24);return _0x46dd24;}else if(_0x46dd24[_0x44b8('0x9d')]===_0x44b8('0x60')){_0x46dd24[_0x44b8('0x9f')]=_0x452d24['length']>=parseInt(_0x5baaa3[_0x44b8('0x10b')])?'x':'i';}else{_0x46dd24['result']=_0x452d24[_0x44b8('0x98')]>=parseInt(_0x5baaa3[_0x44b8('0x10b')])&&_0x452d24[_0x44b8('0x98')]<=parseInt(_0x5baaa3['maxdigit'])?'x':'i';}var _0x529d41=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x5baaa3['variable_id']);if(!_0x529d41){return this['channel'][_0x44b8('0x27')](_0x5baaa3,_0x44b8('0xd2'));}this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x529d41,_0x452d24);if(this[_0x44b8('0x81')](_0x5baaa3['hiddendigitsnum'])){var _0x43f4c3=parseInt(_0x5baaa3[_0x44b8('0x10c')],0xa);var _0x150628=rs[_0x44b8('0x10d')]({'charset':'*','length':_0x43f4c3});var _0x12c9e7=_0x452d24[_0x44b8('0x98')];if(_0x12c9e7>0x0){if(_0x12c9e7>_0x43f4c3){this[_0x44b8('0x32')]['sync'](this,_0x5baaa3,_0x5baaa3[_0x44b8('0x10e')]===_0x44b8('0x10f')?_0x150628+_0x452d24[_0x44b8('0x110')](_0x43f4c3):_0x452d24[_0x44b8('0x110')](0x0,_0x12c9e7-_0x43f4c3)+_0x150628);}else{this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,rs['generate']({'charset':'*','length':_0x12c9e7}));}}else{this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,'');}}else{this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x5baaa3,_0x452d24);}return _0x46dd24;};AGIVertices['prototype'][_0x44b8('0x8')]=function(_0xa2a34b){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0xa2a34b['label']));return this[_0x44b8('0x104')](_0xa2a34b);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x111')]=function(_0x2468b0){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x112'),_0x2468b0[_0x44b8('0x34')]));this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x2468b0,_0x2468b0[_0x44b8('0x113')]);return this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x114'),_0x2468b0[_0x44b8('0x113')]));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x115')]=function(_0x773a46){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x116'),_0x773a46[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x773a46[_0x44b8('0x84')])||!this['isConfigured'](_0x773a46[_0x44b8('0x85')])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0x117'));}if(!this[_0x44b8('0x81')](_0x773a46[_0x44b8('0x56')])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x118'),_0x773a46[_0x44b8('0x56')]));var _0x37145d=this[_0x44b8('0x83')][_0x44b8('0x6b')](this,_0x773a46);if(_0x37145d){this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x119'),_0x37145d));var _0x5dd6a9=this[_0x44b8('0x9')]['streamFile'](_0x37145d);try{fs[_0x44b8('0x11a')](_0x37145d+_0x44b8('0x11b'));}catch(_0xc9881e){logger[_0x44b8('0x27')](_0xc9881e);}return _0x5dd6a9;}return this[_0x44b8('0x9')]['error'](_0x773a46,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x44b8('0x11c')]=function(_0x239d16){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x11d'),_0x239d16[_0x44b8('0x34')]));if(!this['isConfigured'](_0x239d16[_0x44b8('0x84')])||!this[_0x44b8('0x81')](_0x239d16['aws_secret_access_key'])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0x117'));}if(!this[_0x44b8('0x81')](_0x239d16['aws_bot_name'])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20bot\x20name\x20configured');}if(!this[_0x44b8('0x81')](_0x239d16[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20text\x20configured');}this[_0x44b8('0x9')][_0x44b8('0xdf')]=!![];this[_0x44b8('0x32')](_0x239d16);this[_0x44b8('0x3c')](_0x239d16[_0x44b8('0x56')],'in','','');this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0x11e'),_0x239d16[_0x44b8('0x56')]));var _0xca3c70=this['awsLex'][_0x44b8('0x6b')](this,_0x239d16);if(_0xca3c70){for(var _0x372015 in _0xca3c70){if(_0xca3c70['hasOwnProperty'](_0x372015)&&_[_0x44b8('0x92')](_0xca3c70[_0x372015])){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')]('AWS_LEX_%s',_0x372015[_0x44b8('0x64')]()),_0xca3c70[_0x372015]);}}if(_[_0x44b8('0x3f')](_0xca3c70[_0x44b8('0x72')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x44b8('0x3c')](_0xca3c70[_0x44b8('0x72')],'out',_0x44b8('0x11f'),'');return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('Amazon\x20Lex\x20Result\x20%s',_0xca3c70[_0x44b8('0x72')]));}}return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x239d16,_0x44b8('0x120'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x121')]=function(_0x87c4b1){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x122'),_0x87c4b1[_0x44b8('0x34')],_0x87c4b1[_0x44b8('0x60')]));if(!this['isConfigured'](_0x87c4b1[_0x44b8('0x76')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20key\x20configured');}var _0x55250c=_0x44b8('0x123');var _0x45e3ef=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,rs['generate'](0x4));var _0x3dca15=util[_0x44b8('0x23')]('%s.%s',_0x45e3ef,_0x55250c);var _0xd19a35=!![];if(_0x87c4b1[_0x44b8('0x125')]===_0x44b8('0x126')){_0xd19a35=![];}var _0x559b12=this[_0x44b8('0x9')][_0x44b8('0x127')](_0x45e3ef,_0x55250c,_0x87c4b1[_0x44b8('0x128')],_0x87c4b1[_0x44b8('0x60')],undefined,_0xd19a35);if(_0x559b12[_0x44b8('0x9f')]!==-0x1){this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('google\x20%s\x20file\x20created',_0x3dca15));var _0x2d2994=this[_0x44b8('0x8d')][_0x44b8('0x6b')](this,_0x87c4b1,_0x3dca15);if(_0x2d2994){for(var _0x3b9cd2 in _0x2d2994){if(_0x2d2994[_0x44b8('0xe0')](_0x3b9cd2)){this[_0x44b8('0x9')][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0x129'),_0x3b9cd2['toUpperCase']()),_0x2d2994[_0x3b9cd2]);}}return this['channel']['noop'](util['format'](_0x44b8('0x12a'),JSON[_0x44b8('0x6e')](_0x2d2994)));}}return _0x559b12;};AGIVertices['prototype'][_0x44b8('0x12b')]=function(_0x470c9e){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x12c'),_0x470c9e[_0x44b8('0x34')]));if(!this['isConfigured'](_0x470c9e[_0x44b8('0x90')])){return this['channel']['noop'](_0x44b8('0x12d'));}if(!this[_0x44b8('0x81')](_0x470c9e[_0x44b8('0x91')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20appsecret\x20configured');}var _0x3906b7=_0x44b8('0x123');var _0x19ddbe=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,rs[_0x44b8('0x10d')](0x4));var _0x3f4d24=util['format'](_0x44b8('0x9a'),_0x19ddbe,_0x3906b7);var _0x36bef1=!![];if(_0x470c9e[_0x44b8('0x125')]==='NOBEEP'){_0x36bef1=![];}var _0x2de514=this[_0x44b8('0x9')][_0x44b8('0x127')](_0x19ddbe,_0x3906b7,_0x470c9e[_0x44b8('0x128')],_0x470c9e[_0x44b8('0x60')],undefined,_0x36bef1);if(_0x2de514[_0x44b8('0x9f')]!==-0x1){this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0x12e'),_0x3f4d24));var _0x292592=this[_0x44b8('0x8f')][_0x44b8('0x6b')](this,_0x470c9e,_0x3f4d24);if(_0x292592){for(var _0x7c1aaa in _0x292592){if(_0x292592[_0x44b8('0xe0')](_0x7c1aaa)){this['channel'][_0x44b8('0x9b')](util[_0x44b8('0x23')]('TILDE_ASR_%s',_0x7c1aaa[_0x44b8('0x64')]()),_0x292592[_0x7c1aaa]);}}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')]('TildeASR\x20Result\x20%s',JSON[_0x44b8('0x6e')](_0x292592)));}}return _0x2de514;};AGIVertices['prototype']['gotoc']=function(_0x9a5734){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x12f'),_0x9a5734[_0x44b8('0x34')]));return this['channel']['continueAt'](_0x9a5734['context'],_0x9a5734[_0x44b8('0x39')],_0x9a5734[_0x44b8('0x3a')]);};AGIVertices['prototype'][_0x44b8('0x130')]=function(_0x154fe2){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x131'),_0x154fe2[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x154fe2[_0x44b8('0x132')])){return this[_0x44b8('0x9')]['error'](_0x154fe2,_0x44b8('0x133'));}try{var _0x1cc640=eval(_0x154fe2[_0x44b8('0x132')])?_0x44b8('0x134'):_0x44b8('0x135');this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('EVAL\x20CONDITION\x20%s\x20%s',_0x154fe2['condition'],_0x1cc640));return{'code':0xc8,'result':_0x1cc640};}catch(_0xca26a5){return{'code':0xc8,'result':_0x44b8('0x135')};}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x136')]=function(_0x3689d0){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x137'),_0x3689d0['label']));if(!this[_0x44b8('0x81')](_0x3689d0['interval_id'])){return this['channel'][_0x44b8('0x27')](_0x3689d0,_0x44b8('0x138'));}var _0x3af78a=this[_0x44b8('0x1d')]['sync'](this,_0x3689d0[_0x44b8('0x139')]);if(!_0x3af78a){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3689d0,_0x44b8('0x13a'));}for(var _0x175ae3=0x0;_0x175ae3<_0x3af78a[_0x44b8('0x98')];_0x175ae3+=0x1){var _0x3c53fa=this[_0x44b8('0x9')][_0x44b8('0xc')](util[_0x44b8('0x23')](_0x44b8('0x13b'),_0x3af78a[_0x175ae3]));if(_0x3c53fa[_0x44b8('0x9f')]===-0x1){return _0x3c53fa;}logger[_0x44b8('0x29')](util['format']('IFTIME\x20%s\x20%s',_0x3af78a[_0x175ae3],_0x3c53fa[_0x44b8('0x9d')]));if(_0x3c53fa[_0x44b8('0x9d')]===_0x44b8('0x134')){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],_0x44b8('0x134')));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],_0x44b8('0x135')));this['channel']['noop'](util[_0x44b8('0x23')](_0x44b8('0x13c'),_0x3af78a[_0x175ae3],_0x44b8('0x135')));}}return{'code':0xc8,'result':_0x44b8('0x135')};};AGIVertices[_0x44b8('0xb')][_0x44b8('0x13d')]=function(_0x2c1d36){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x13e'),_0x2c1d36[_0x44b8('0x34')]));return this['channel'][_0x44b8('0x13d')]();};AGIVertices[_0x44b8('0xb')][_0x44b8('0x13f')]=function(_0x4aec46){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x140'),_0x4aec46['label']));if(!this[_0x44b8('0x81')](_0x4aec46[_0x44b8('0x76')])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xde'));}var _0x3922b8='wav';var _0x40829b=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,rs['generate'](0x4));var _0x310c11=util[_0x44b8('0x23')](_0x44b8('0x9a'),_0x40829b,_0x3922b8);var _0x1d41c8=!![];if(_0x4aec46[_0x44b8('0x125')]===_0x44b8('0x126')){_0x1d41c8=![];}var _0x317eed=this[_0x44b8('0x9')]['recordFile'](_0x40829b,_0x3922b8,_0x4aec46[_0x44b8('0x128')],_0x4aec46[_0x44b8('0x60')],undefined,_0x1d41c8);if(_0x317eed[_0x44b8('0x9f')]!==-0x1){this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x141'),_0x310c11));var _0x549f1c=this[_0x44b8('0x7f')][_0x44b8('0x6b')](this,_0x4aec46,_0x310c11);if(_0x549f1c){for(var _0xb7dbe7 in _0x549f1c){if(_0x549f1c[_0x44b8('0xe0')](_0xb7dbe7)){this[_0x44b8('0x9')]['setVariable'](util['format'](_0x44b8('0x142'),_0xb7dbe7[_0x44b8('0x64')]()),_0x549f1c[_0xb7dbe7]);}}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x44b8('0x6e')](_0x549f1c)));}}return _0x317eed;};AGIVertices[_0x44b8('0xb')][_0x44b8('0x143')]=function(_0x16fd39){logger['info'](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x16fd39[_0x44b8('0x34')]));if(!this['isConfigured'](_0x16fd39[_0x44b8('0x76')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xde'));}if(!this['isConfigured'](_0x16fd39[_0x44b8('0x56')])){return this[_0x44b8('0x9')]['noop'](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x144'),_0x16fd39['text']));var _0x20cc34=this[_0x44b8('0x7d')][_0x44b8('0x6b')](this,_0x16fd39);if(_0x20cc34){this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x141'),_0x20cc34));var _0x48d8c0=this[_0x44b8('0x9')][_0x44b8('0xf6')](_0x20cc34,_0x16fd39[_0x44b8('0x128')]);try{fs['unlink'](_0x20cc34+_0x44b8('0x11b'));}catch(_0x26ed11){logger[_0x44b8('0x27')](_0x26ed11);}return _0x48d8c0;}return this['channel'][_0x44b8('0x27')](_0x16fd39,_0x44b8('0x145'));};AGIVertices['prototype']['login']=function(_0x1cbf9c){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x146'),_0x1cbf9c['label']));if(!this['isConfigured'](_0x1cbf9c[_0x44b8('0x147')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x1cbf9c,_0x44b8('0x148'));}logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x149'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x1cbf9c[_0x44b8('0x147')]));var _0x4af0af=this[_0x44b8('0x4f')][_0x44b8('0x6b')](this,_0x1cbf9c[_0x44b8('0x147')]);if(_0x4af0af){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x1cbf9c[_0x44b8('0x147')]));this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x14a'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x1cbf9c[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14b')};}else{logger['info'](util[_0x44b8('0x23')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x44b8('0x9')]['callerid'],_0x1cbf9c[_0x44b8('0x147')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this[_0x44b8('0x9')]['callerid'],_0x1cbf9c[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14d')};}};AGIVertices[_0x44b8('0xb')]['logout']=function(_0x2c7999){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14e'),_0x2c7999[_0x44b8('0x34')]));if(!this['isConfigured'](_0x2c7999['findBy'])){return this[_0x44b8('0x9')]['error'](_0x2c7999,'no\x20find\x20by\x20configured');}logger['info'](util[_0x44b8('0x23')](_0x44b8('0x149'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999[_0x44b8('0x147')]));var _0x15382e=this[_0x44b8('0x4b')]['sync'](this,_0x2c7999[_0x44b8('0x147')]);if(_0x15382e){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999[_0x44b8('0x147')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999['findBy']));return{'code':0xc8,'result':_0x44b8('0x14b')};}else{logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x2c7999['findBy']));this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this['channel'][_0x44b8('0x36')],_0x2c7999[_0x44b8('0x147')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['math']=function(_0x216348){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14f'),_0x216348[_0x44b8('0x34')]));if(!this['isConfigured'](_0x216348[_0x44b8('0x150')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x216348,_0x44b8('0x151'));}this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')]('math\x20%s',_0x216348[_0x44b8('0x150')]));var _0x20cac3=eval(_0x216348[_0x44b8('0x150')]);if(!this['isConfigured'](_0x216348[_0x44b8('0xd1')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x108'));}var _0x59e899=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x216348['variable_id']);if(!_0x59e899){return this['channel']['error'](_0x216348,_0x44b8('0xd2'));}if(_[_0x44b8('0x97')](_0x20cac3)){var _0xeacf3d=this;_0x20cac3[_0x44b8('0xd3')](function(_0xf330f1,_0x3c2c22){_0xeacf3d['channel'][_0x44b8('0x9b')](util[_0x44b8('0x23')](_0x44b8('0x152'),_0x59e899,_0x3c2c22),_0xf330f1);});return this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x153'),_0x59e899));}else{return this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x59e899,_0x20cac3);}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x7')]=function(_0x4ca814){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x4ca814[_0x44b8('0x34')]));if(_0x4ca814[_0x44b8('0xa1')]===0x0){return this[_0x44b8('0xa0')](_0x4ca814);}_0x4ca814[_0x44b8('0xa1')]-=0x1;if(!this[_0x44b8('0x81')](_0x4ca814[_0x44b8('0x106')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x4ca814,'no\x20file\x20audio\x20selected');}var _0x306e31=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x4ca814[_0x44b8('0x106')]);if(!_0x306e31){return this[_0x44b8('0x9')]['error'](_0x4ca814,'no\x20file\x20audio\x20found');}var _0xf26205=this[_0x44b8('0x9')][_0x44b8('0x154')](_0x306e31,_0x4ca814[_0x44b8('0x109')],_0x4ca814['digit']);var _0x3b5a69=_0xf26205['result'];if(_0xf26205[_0x44b8('0x9f')]===-0x1){this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x4ca814,'-1');return _0xf26205;}else if(_0xf26205[_0x44b8('0x9d')]===_0x44b8('0x60')){_0xf26205['result']=_0xf26205[_0x44b8('0x9f')][_0x44b8('0x98')]>0x0?_0xf26205['result']:'t';}else if(_[_0x44b8('0x3e')](_0xf26205[_0x44b8('0x9f')])){_0xf26205[_0x44b8('0x9f')]='#';_0x3b5a69='#';}if(!this['isConfigured'](_0x4ca814[_0x44b8('0xd1')])){this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x108'));}else{var _0x10567c=this[_0x44b8('0xc')]['sync'](this,_0x4ca814[_0x44b8('0xd1')]);if(!_0x10567c){return this[_0x44b8('0x9')]['error'](_0x4ca814,_0x44b8('0xd2'));}this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x10567c,_0x3b5a69);}this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x4ca814,_0x3b5a69);return _0xf26205;};AGIVertices[_0x44b8('0xb')][_0x44b8('0xa4')]=function(_0x4576b7){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x155'),_0x4576b7['label']));return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x4576b7[_0x44b8('0x156')]||_0x4576b7[_0x44b8('0x34')]);};AGIVertices['prototype'][_0x44b8('0x157')]=function(_0x47aa08){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x158'),_0x47aa08[_0x44b8('0x34')]));if(!this['isConfigured'](_0x47aa08['findBy'])){return this[_0x44b8('0x9')]['error'](_0x47aa08,_0x44b8('0x148'));}logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));var _0x169d87=this[_0x44b8('0x159')][_0x44b8('0x6b')](this,_0x47aa08[_0x44b8('0x15a')]);var _0x38d6d8=this[_0x44b8('0x48')]['sync'](this,_0x47aa08[_0x44b8('0x147')],_0x169d87);if(_0x38d6d8){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));return{'code':0xc8,'result':'success'};}else{logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14c'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));this['channel'][_0x44b8('0xa4')](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x47aa08[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14d')};}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x15b')]=function(_0x3e7cc3){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x3e7cc3[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x3e7cc3[_0x44b8('0x106')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3e7cc3,_0x44b8('0x15c'));}var _0x39d1b4=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x3e7cc3[_0x44b8('0x106')]);if(!_0x39d1b4){return this['channel'][_0x44b8('0x27')](_0x3e7cc3,_0x44b8('0x107'));}var _0x40cb99=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0x15d'),[_0x39d1b4,_0x3e7cc3[_0x44b8('0x100')]]);if(_0x40cb99[_0x44b8('0x9f')]===-0x1){return _0x40cb99;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util['format'](_0x44b8('0xc0'),'PLAYBACK',_0x39d1b4));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x15e')]=function(_0x24c7e9){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x15f'),_0x24c7e9[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x24c7e9[_0x44b8('0x160')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x24c7e9,_0x44b8('0x161'));}var _0x2cff2d='';var _0xec2b21=parseInt(_0x24c7e9[_0x44b8('0x160')],0xa);if(isNaN(_0xec2b21)){_0x2cff2d=_0x24c7e9[_0x44b8('0x160')];}else{_0x2cff2d=this['getVoiceQueue']['sync'](this,_0x24c7e9[_0x44b8('0x160')]);if(!_0x2cff2d){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x24c7e9,_0x44b8('0x162'));}}var _0x26377c='';if(this[_0x44b8('0x81')](_0x24c7e9[_0x44b8('0x106')])){var _0x521f5c=this[_0x44b8('0x18')][_0x44b8('0x6b')](this,_0x24c7e9['file_id']);if(_0x521f5c){_0x26377c=_0x521f5c;}}this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x24c7e9,_0x2cff2d);if(_0x24c7e9[_0x44b8('0x100')][_0x44b8('0x163')]('x')<0x0){_0x24c7e9[_0x44b8('0x100')]+='x';}if(_0x24c7e9[_0x44b8('0x100')]['indexOf']('X')<0x0){_0x24c7e9['opts']+='X';}this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x44b8('0x164'),_0x2cff2d?_0x2cff2d[_0x44b8('0x165')]():'');var _0x525eb7=this[_0x44b8('0x9')]['exec']('QUEUE',[_0x2cff2d,_0x24c7e9[_0x44b8('0x100')],_0x24c7e9[_0x44b8('0x5e')],_0x26377c,_0x24c7e9[_0x44b8('0x60')],_0x24c7e9[_0x44b8('0x5')],_0x24c7e9[_0x44b8('0x166')],_0x24c7e9[_0x44b8('0x167')],'',_0x24c7e9['position']]);if(_0x525eb7[_0x44b8('0x9f')]===-0x1){return _0x525eb7;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc0'),_0x44b8('0x168'),_0x2cff2d));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x169')]=function(_0x24ab51){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x16a'),_0x24ab51[_0x44b8('0x34')]));var _0x4be254=_0x24ab51['recordingFormat']||_0x44b8('0x123');var _0x159848=util[_0x44b8('0x23')]('%s_%s',this[_0x44b8('0x9')][_0x44b8('0x33')],rs[_0x44b8('0x10d')](0x5));var _0x454565=util[_0x44b8('0x23')]('%s/recordings/%s.%s',FILES_PATH,_0x159848,_0x4be254);var _0xb50fef=util[_0x44b8('0x23')](_0x44b8('0x124'),FILES_PATH,_0x159848);this[_0x44b8('0x37')][_0x44b8('0x6b')](this,_0x24ab51,_0x159848,_0x454565);this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x44b8('0x16b'),_0x159848);logger[_0x44b8('0x29')](_0x44b8('0x16c'),_0xb50fef,_0x4be254,_0x24ab51[_0x44b8('0x16d')],_0x24ab51[_0x44b8('0x60')]);return this[_0x44b8('0x9')][_0x44b8('0x127')](_0xb50fef,_0x4be254,_0x24ab51['escape_digits'],_0x24ab51['timeout'],undefined,!![]);};AGIVertices[_0x44b8('0xb')]['restapi']=function(_0x1f1b3b){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x1f1b3b[_0x44b8('0x34')]));if(!this['isConfigured'](_0x1f1b3b[_0x44b8('0x5e')])){return this['channel']['noop'](_0x44b8('0x16e'));}var _0x230623=this[_0x44b8('0x5d')][_0x44b8('0x6b')](this,_0x1f1b3b);logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x16f'),util[_0x44b8('0x170')](_0x230623,{'showHidden':![],'depth':null})));if(!this[_0x44b8('0x81')](_0x1f1b3b[_0x44b8('0xd1')])){return this['channel'][_0x44b8('0xa4')](_0x44b8('0x171'));}var _0x815569=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x1f1b3b[_0x44b8('0xd1')]);if(!_0x815569){return this['channel'][_0x44b8('0x27')](_0x1f1b3b,_0x44b8('0xd2'));}this[_0x44b8('0x9')]['setVariable'](util[_0x44b8('0x23')]('%s_STATUS_CODE',_0x815569),_0x230623[_0x44b8('0x70')]?_0x230623['statusCode']:'200');this[_0x44b8('0x9')][_0x44b8('0x9b')](util['format'](_0x44b8('0x172'),_0x815569),_0x230623['statusMessage']?_0x230623[_0x44b8('0x71')]:'OK');if(_0x230623[_0x44b8('0x65')]){try{this[_0x44b8('0x99')](_0x230623[_0x44b8('0x65')],_0x815569);}catch(_0x2b27c5){logger['error'](util[_0x44b8('0x23')](_0x44b8('0x173'),_0x815569));}}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xd5'),_0x815569));};AGIVertices['prototype']['saydigits']=function(_0x43fe5e){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x174'),_0x43fe5e[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0x175')](_0x43fe5e['digits'][_0x44b8('0xd0')](/\s+/g,''),_0x43fe5e[_0x44b8('0x16d')]);};AGIVertices[_0x44b8('0xb')]['saynumber']=function(_0x50244d){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x176'),_0x50244d[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0x177')](_0x50244d[_0x44b8('0x178')]['replace'](/\s+/g,''),_0x50244d[_0x44b8('0x16d')]);};AGIVertices[_0x44b8('0xb')][_0x44b8('0x179')]=function(_0x345d3d){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x17a'),_0x345d3d[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0x17b')](_0x345d3d[_0x44b8('0x56')],_0x345d3d[_0x44b8('0x16d')]);};AGIVertices['prototype']['sendMail']=function(_0x51dbd8){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x51dbd8[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x51dbd8[_0x44b8('0x17c')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x17d'));}var _0x38691f=this[_0x44b8('0x17e')][_0x44b8('0x6b')](this,_0x51dbd8[_0x44b8('0x17c')]);if(!_0x38691f||!_0x38691f[_0x44b8('0x17f')]){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x51dbd8,_0x44b8('0x180'));}var _0x3fce6a={'from':util[_0x44b8('0x23')](_0x44b8('0x181'),_0x38691f[_0x44b8('0xf')],_0x38691f[_0x44b8('0x182')]||_0x38691f[_0x44b8('0x17f')]['user']),'to':_0x51dbd8['to']||'','cc':_0x51dbd8['cc']||'','bcc':_0x51dbd8[_0x44b8('0x183')]||'','subject':_0x51dbd8['subject'],'html':_0x51dbd8['text'],'text':_0x51dbd8['text']};if(this[_0x44b8('0x81')](_0x51dbd8[_0x44b8('0x184')])){}logger[_0x44b8('0x185')]('sendMail\x20message',JSON[_0x44b8('0x6e')](_0x3fce6a));this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x51dbd8,_0x51dbd8[_0x44b8('0x17c')]);this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x186'),_0x38691f[_0x44b8('0xf')]));this[_0x44b8('0x1b')][_0x44b8('0x6b')](this,_0x38691f['smtpOptions'],_0x3fce6a);return this[_0x44b8('0x9')][_0x44b8('0xa4')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x44b8('0xb')][_0x44b8('0x187')]=function(_0x1e737b){logger['info'](util[_0x44b8('0x23')](_0x44b8('0x188'),_0x1e737b[_0x44b8('0x34')]));return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x189'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x18a')]=function(_0x735553){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x18b'),_0x735553[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x735553[_0x44b8('0x18c')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x18d'));}var _0x542e4f=this['getSmsAccount'][_0x44b8('0x6b')](this,_0x735553[_0x44b8('0x18c')]);if(!_0x542e4f){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x735553,'no\x20sms\x20account\x20found');}var _0x1a78a8={'body':_0x735553[_0x44b8('0x18e')],'phone':_0x735553['to']||'','SmsAccountId':_0x542e4f['id']};logger[_0x44b8('0x185')](_0x44b8('0x18f'),JSON[_0x44b8('0x6e')](_0x1a78a8));this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x735553,_0x735553['sms_account_id']);this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x190'),_0x542e4f[_0x44b8('0xf')]));this['createSmsMessage'][_0x44b8('0x6b')](this,_0x1a78a8);return this['channel'][_0x44b8('0xa4')](_0x44b8('0x191'));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x192')]=function(_0x774615){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x193'),_0x774615[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x774615[_0x44b8('0xd1')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x774615,'no\x20variable\x20selected');}var _0x2ede32=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x774615['variable_id']);if(!_0x2ede32){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x774615,_0x44b8('0xd2'));}return this[_0x44b8('0x9')][_0x44b8('0x9b')](_0x2ede32,_0x774615[_0x44b8('0x194')]);};AGIVertices[_0x44b8('0xb')]['start']=function(_0x1ffd7b){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20START\x20(%s)\x20block',_0x1ffd7b[_0x44b8('0x34')]));this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0x195'));var _0x519e52=this[_0x44b8('0x9')][_0x44b8('0xc')]('XMCS-UNIQUEID');if(!_[_0x44b8('0x3e')](_0x519e52[_0x44b8('0x9d')])){this[_0x44b8('0x9')][_0x44b8('0x33')]=_0x519e52['extra'];}if(_0x1ffd7b['answer']===_0x44b8('0x196')){this['channel'][_0x44b8('0xa4')](_0x44b8('0x197'));return this['channel'][_0x44b8('0xb6')]();}return this[_0x44b8('0x9')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x44b8('0x198')]=function(_0x3edc61){logger[_0x44b8('0x29')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x3edc61['label']));if(!this[_0x44b8('0x81')](_0x3edc61[_0x44b8('0x199')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3edc61,'no\x20subproject\x20selected');}var _0x31addc=this[_0x44b8('0x19a')][_0x44b8('0x6b')](this,_0x3edc61[_0x44b8('0x199')]);if(!this[_0x44b8('0x81')](_0x31addc)){return this['channel'][_0x44b8('0x27')](_0x3edc61,util[_0x44b8('0x23')](_0x44b8('0x19b'),_0x3edc61[_0x44b8('0x199')]));}if(_0x31addc===this[_0x44b8('0x9')]['arg_1']){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x3edc61,_0x44b8('0x19c'));}this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x3edc61,_0x31addc);var _0x4390fb=this[_0x44b8('0x9')][_0x44b8('0x51')](_0x44b8('0x19d'),util[_0x44b8('0x23')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x44b8('0x5')][_0x44b8('0x19e')]||_0x44b8('0x19f'),_0x31addc,this[_0x44b8('0x9')][_0x44b8('0x35')]));if(_0x4390fb[_0x44b8('0x9f')]===-0x1){return _0x4390fb;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc0'),'AGI',_0x31addc));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1a0')]=function(_0x467f72){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x1a1'),_0x467f72['label']));var _0x47d28a=this[_0x44b8('0x50')][_0x44b8('0x6b')](this,_0x467f72[_0x44b8('0xb3')]);this[_0x44b8('0x32')][_0x44b8('0x6b')](this,_0x467f72,_0x467f72[_0x44b8('0xb3')]);if(this[_0x44b8('0x81')](_0x467f72[_0x44b8('0xd1')])){var _0x43ee4a=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x467f72[_0x44b8('0xd1')]);if(_0x43ee4a){this[_0x44b8('0x9')]['setVariable'](_0x43ee4a,_0x47d28a);return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a2'),_0x467f72[_0x44b8('0xb3')],_0x43ee4a));}}return this['channel'][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a3'),_0x467f72['command']));};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1a4')]=function(_0x120e8b){logger[_0x44b8('0x29')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x120e8b[_0x44b8('0x34')]));_0x120e8b[_0x44b8('0x56')]=_0x120e8b[_0x44b8('0x56')][_0x44b8('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x120e8b[_0x44b8('0x54')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20apiKey\x20configured');}if(!this[_0x44b8('0x81')](_0x120e8b[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')](_0x44b8('0xa5'));}this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a5'),_0x120e8b[_0x44b8('0x56')]));var _0x418961=this['googleCloudTTS'][_0x44b8('0x6b')](this,_0x120e8b);if(_0x418961){this[_0x44b8('0x9')]['noop'](util[_0x44b8('0x23')](_0x44b8('0x1a6'),_0x418961));var _0x17c1f4=this[_0x44b8('0x9')]['streamFile'](_0x418961);try{fs[_0x44b8('0x11a')](_0x418961+'.wav');}catch(_0x3cda92){logger['error'](_0x3cda92);}return _0x17c1f4;}return this['channel'][_0x44b8('0x27')](_0x120e8b,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x44b8('0xb')]['tts']=function(_0x17db2d){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x1a7'),_0x17db2d['label']));_0x17db2d[_0x44b8('0x56')]=_0x17db2d[_0x44b8('0x56')][_0x44b8('0xd0')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x44b8('0x81')](_0x17db2d[_0x44b8('0x56')])){return this[_0x44b8('0x9')][_0x44b8('0xa4')]('no\x20text\x20configured');}this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x1a8'),_0x17db2d['text']));var _0x54cbce=this[_0x44b8('0x5b')]['sync'](this,_0x17db2d);if(_0x54cbce){this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0x1a9'),_0x54cbce));var _0x29904b=this[_0x44b8('0x9')]['streamFile'](_0x54cbce);try{fs[_0x44b8('0x11a')](_0x54cbce+_0x44b8('0x11b'));}catch(_0x48040c){logger[_0x44b8('0x27')](_0x48040c);}return _0x29904b;}return this['channel']['error'](_0x17db2d,_0x44b8('0x1aa'));};AGIVertices['prototype'][_0x44b8('0x1ab')]=function(_0x498cc6){logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x1ac'),_0x498cc6[_0x44b8('0x34')]));if(!this[_0x44b8('0x81')](_0x498cc6[_0x44b8('0x147')])){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x498cc6,_0x44b8('0x148'));}logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x149'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));var _0x4efee9=this['agentUnpause']['sync'](this,_0x498cc6[_0x44b8('0x147')]);if(_0x4efee9){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));this[_0x44b8('0x9')]['noop'](util['format'](_0x44b8('0x14a'),this['channel'][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14b')};}else{logger[_0x44b8('0x29')](util[_0x44b8('0x23')](_0x44b8('0x14c'),this[_0x44b8('0x9')][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));this[_0x44b8('0x9')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x44b8('0x9')][_0x44b8('0x36')],_0x498cc6[_0x44b8('0x147')]));return{'code':0xc8,'result':_0x44b8('0x14d')};}};AGIVertices[_0x44b8('0xb')][_0x44b8('0x1ad')]=function(_0x11231a){logger[_0x44b8('0x29')](util[_0x44b8('0x23')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x11231a[_0x44b8('0x34')]));var _0x1d10f6=this[_0x44b8('0x9')][_0x44b8('0x51')]('VOICEMAIL',[_0x11231a['mailbox'],_0x11231a[_0x44b8('0x74')]]);if(_0x1d10f6[_0x44b8('0x9f')]===-0x1){return _0x1d10f6;}return this[_0x44b8('0x9')][_0x44b8('0xa4')](util[_0x44b8('0x23')](_0x44b8('0xc0'),_0x44b8('0x1ae'),_0x11231a[_0x44b8('0x1af')]));};AGIVertices['prototype']['vswitch']=function(_0x41449b){logger[_0x44b8('0x29')](util['format'](_0x44b8('0x1b0'),_0x41449b[_0x44b8('0x34')]));if(!this['isConfigured'](_0x41449b[_0x44b8('0xd1')])){return this['channel'][_0x44b8('0x27')](_0x41449b,_0x44b8('0x1b1'));}var _0x29a8c5=this[_0x44b8('0xc')][_0x44b8('0x6b')](this,_0x41449b[_0x44b8('0xd1')]);if(!_0x29a8c5){return this[_0x44b8('0x9')][_0x44b8('0x27')](_0x41449b,_0x44b8('0xd2'));}var _0x32262e=this[_0x44b8('0x9')][_0x44b8('0xc')](_0x29a8c5);return{'code':0xc8,'result':_0x32262e[_0x44b8('0x9d')]?_0x32262e[_0x44b8('0x9d')]:'-'};};String[_0x44b8('0xb')][_0x44b8('0x1b2')]=function(_0x366cec,_0x5d70fd){return this[_0x44b8('0x9c')](_0x366cec)[_0x44b8('0x1b3')](_0x5d70fd);};module['exports']=AGIVertices; \ No newline at end of file +var _0xec39=['getSmsAccount','getSmsAccountById','createSmsMessage','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','agentPause','agent','uniqueid','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','method','timeout','number','includes','PUT','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceAllVariables','split','replaceAll','getVariable','toString','getAndSetVariable','sync','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','query:\x20%s','getQueryOdbc','createSquareDetailsReport','variable_id','forEach','%s[%s][%s]','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','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','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','extra','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','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','math\x20%s','operation','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','subject','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','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','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','agentUnpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s'];(function(_0xef34c5,_0xd17a9d){var _0x1de207=function(_0x3e8169){while(--_0x3e8169){_0xef34c5['push'](_0xef34c5['shift']());}};_0x1de207(++_0xd17a9d);}(_0xec39,0x19f));var _0x9ec3=function(_0x5e980c,_0x4d4656){_0x5e980c=_0x5e980c-0x0;var _0x31100a=_0xec39[_0x5e980c];return _0x31100a;};'use strict';var fs=require('fs');var util=require(_0x9ec3('0x0'));var _=require(_0x9ec3('0x1'));var sh=require(_0x9ec3('0x2'));var odbc=require(_0x9ec3('0x3'))();var rs=require(_0x9ec3('0x4'));var moment=require(_0x9ec3('0x5'));var Mustache=require(_0x9ec3('0x6'));var rp=require('request-promise');var logger=require(_0x9ec3('0x7'))(_0x9ec3('0x8'));var config=require(_0x9ec3('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x9ec3('0xa')];var verticesWithRetry=[_0x9ec3('0xb'),_0x9ec3('0xc'),'getsecretdigits'];var AGIVertices=function(_0x570a91,_0xb10fef,_0x2e49f3){this[_0x9ec3('0xd')]=_0x570a91;this[_0x9ec3('0xe')]=_0xb10fef;this[_0x9ec3('0xf')]=_0x2e49f3;};AGIVertices[_0x9ec3('0x10')]['getVariable']=function(_0x1a0555,_0xaa1307){this[_0x9ec3('0xe')][_0x9ec3('0x11')](_0x1a0555)[_0x9ec3('0x12')](function(_0x18ef85){_0xaa1307(null,_0x18ef85?_0x18ef85[_0x9ec3('0x13')]:![]);})['catch'](function(_0x2790dc){_0xaa1307(_0x2790dc);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x14')]=function(_0x4bb1b3,_0x2b9f69){this['rpc'][_0x9ec3('0x15')](_0x4bb1b3)[_0x9ec3('0x12')](function(_0xcbb897){_0x2b9f69(null,_0xcbb897?_0xcbb897[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0x2c0ad5){_0x2b9f69(_0x2c0ad5);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x17')]=function(_0x453010,_0x58dd6f){this[_0x9ec3('0xe')]['getSquareProjectById'](_0x453010)['then'](function(_0x2ae9bd){_0x58dd6f(null,_0x2ae9bd?_0x2ae9bd[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0xa3bade){_0x58dd6f(_0xa3bade);});};AGIVertices[_0x9ec3('0x10')]['getSquareOdbc']=function(_0x16e34d,_0x4a413c){this[_0x9ec3('0xe')]['getSquareOdbcById'](_0x16e34d)[_0x9ec3('0x12')](function(_0x28e31f){_0x4a413c(null,_0x28e31f?_0x28e31f[_0x9ec3('0x18')]:![]);})['catch'](function(_0x70227a){_0x4a413c(_0x70227a);});};AGIVertices['prototype'][_0x9ec3('0x19')]=function(_0x4a8c62,_0xcb54c){this[_0x9ec3('0xe')][_0x9ec3('0x1a')](_0x4a8c62)[_0x9ec3('0x12')](function(_0x36f64c){_0xcb54c(null,_0x36f64c?_0x36f64c[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0x5efa81){_0xcb54c(_0x5efa81);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1b')]=function(_0x484891,_0x3b11db){this[_0x9ec3('0xe')][_0x9ec3('0x1c')](_0x484891)[_0x9ec3('0x12')](function(_0x4782c9){_0x3b11db(null,_0x4782c9?_0x4782c9[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0xb99216){_0x3b11db(_0xb99216);});};AGIVertices['prototype'][_0x9ec3('0x1d')]=function(_0x2c9e39,_0x30abfb){var _0x1fd911=this;this['rpc'][_0x9ec3('0x1e')](_0x2c9e39)[_0x9ec3('0x12')](function(_0x141149){_0x30abfb(null,_0x141149?_0x1fd911[_0x9ec3('0x1f')](_0x141149[_0x9ec3('0x20')]):![]);})[_0x9ec3('0x16')](function(_0x3d67be){_0x30abfb(_0x3d67be);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x21')]=function(_0x15a602,_0xe21f81){this[_0x9ec3('0xe')][_0x9ec3('0x22')](_0x15a602)[_0x9ec3('0x12')](function(_0x2b7113){_0xe21f81(null,_0x2b7113?_0x2b7113:![]);})[_0x9ec3('0x16')](function(_0x2f4224){_0xe21f81(_0x2f4224);});};AGIVertices['prototype']['sendMailMessage']=function(_0x4c50fd,_0x1e86a7,_0x3c18a7){this[_0x9ec3('0xf')][_0x9ec3('0x23')](_0x4c50fd,_0x1e86a7)[_0x9ec3('0x12')](function(){_0x3c18a7(null);})[_0x9ec3('0x16')](function(_0x2891fc){_0x3c18a7(_0x2891fc);});};AGIVertices['prototype'][_0x9ec3('0x24')]=function(_0x22910c,_0x1f8962){this['rpc'][_0x9ec3('0x25')](_0x22910c)[_0x9ec3('0x12')](function(_0x5bb3db){if(_0x5bb3db){if(_0x5bb3db[_0x9ec3('0x26')]){_0x1f8962(null,[_0x5bb3db[_0x9ec3('0x27')]]);}else{_0x1f8962(null,_[_0x9ec3('0x28')](_0x5bb3db[_0x9ec3('0x29')],_0x9ec3('0x27')));}}else{_0x1f8962(null,![]);}})[_0x9ec3('0x16')](function(_0x29103d){_0x1f8962(_0x29103d);});};AGIVertices['prototype'][_0x9ec3('0x1f')]=function(_0x32581e){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x32581e);};AGIVertices[_0x9ec3('0x10')]['getQueryOdbc']=function(_0x338298,_0x1bd8a0,_0x1b9704){odbc[_0x9ec3('0x2a')](_0x338298,function(_0x57e954){if(_0x57e954){logger[_0x9ec3('0x2b')](_0x9ec3('0x2c'),_0x57e954);_0x1b9704(_0x57e954);}else{logger[_0x9ec3('0x2d')](_0x9ec3('0x2e'));odbc[_0x9ec3('0x2f')](_0x1bd8a0,function(_0x149bf1,_0x51a6ad){if(_0x149bf1){logger['info']('Error\x20executing\x20query\x20%s',_0x1bd8a0);_0x1b9704(_0x149bf1);}else{logger[_0x9ec3('0x2d')](_0x9ec3('0x30'),_0x1bd8a0);odbc[_0x9ec3('0x31')](function(_0x2ab229){if(_0x2ab229){logger[_0x9ec3('0x2b')](_0x9ec3('0x32'),_0x2ab229);}_0x1b9704(null,_0x51a6ad);});}});}});};AGIVertices['prototype'][_0x9ec3('0x33')]=function(_0x4241b1,_0x58ed33){this[_0x9ec3('0xe')][_0x9ec3('0x34')](_0x4241b1)[_0x9ec3('0x12')](function(_0x2bafea){_0x58ed33(null,_0x2bafea?_0x2bafea:![]);})['catch'](function(_0xc41a94){_0x58ed33(_0xc41a94);});};AGIVertices['prototype'][_0x9ec3('0x35')]=function(_0x3f6cbe,_0x3d16ce){this[_0x9ec3('0xe')][_0x9ec3('0x35')](_0x3f6cbe)['then'](function(_0x5ef1dc){_0x3d16ce(null,_0x5ef1dc);})[_0x9ec3('0x16')](function(_0x512e5c){_0x3d16ce(_0x512e5c);});};AGIVertices[_0x9ec3('0x10')]['createSquareDetailsReport']=function(_0x3d54e4,_0x4e279c,_0x14b1f1){this[_0x9ec3('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x9ec3('0xd')]['uniqueid'],'node':_0x3d54e4[_0x9ec3('0x36')],'application':_0x3d54e4[_0x9ec3('0x37')],'data':_0x4e279c||null,'project_name':this['channel'][_0x9ec3('0x38')],'callerid':this[_0x9ec3('0xd')][_0x9ec3('0x39')]})['then'](function(_0x42347e){if(_0x14b1f1){_0x14b1f1(null,_0x42347e);}})[_0x9ec3('0x16')](function(_0x551be3){if(_0x14b1f1){_0x14b1f1(_0x551be3);}});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x3a')]=function(_0x341b8d,_0xc0900b,_0x46ad5f,_0xd2b4a7){this[_0x9ec3('0xe')][_0x9ec3('0x3a')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x9ec3('0xd')][_0x9ec3('0x39')],'calleridname':this['channel'][_0x9ec3('0x3b')],'context':this[_0x9ec3('0xd')]['context'],'extension':this[_0x9ec3('0xd')][_0x9ec3('0x3c')],'priority':this[_0x9ec3('0xd')][_0x9ec3('0x3d')],'accountcode':this[_0x9ec3('0xd')][_0x9ec3('0x3e')],'dnid':this[_0x9ec3('0xd')][_0x9ec3('0x3f')],'projectName':this[_0x9ec3('0xd')][_0x9ec3('0x38')],'saveName':_0xc0900b,'filename':_0x341b8d[_0x9ec3('0x40')]||_0xc0900b,'savePath':_0x46ad5f})[_0x9ec3('0x12')](function(_0x284088){_0xd2b4a7(null,_0x284088);})['catch'](function(_0x60ac46){_0xd2b4a7(_0x60ac46);});};AGIVertices['prototype'][_0x9ec3('0x41')]=function(_0x1e7766,_0x7713b5,_0x58c812,_0x55c7e2,_0x53bb29){this[_0x9ec3('0xe')][_0x9ec3('0x41')]({'uniqueid':this[_0x9ec3('0xd')]['uniqueid'],'body':_0x1e7766,'direction':_0x7713b5,'providerName':_0x58c812,'providerResponse':_0x55c7e2})['then'](function(_0x5d48d1){if(_0x53bb29){_0x53bb29(null,_0x5d48d1);}})[_0x9ec3('0x16')](function(_0x25333a){if(_0x53bb29){_0x53bb29(_0x25333a);}});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x42')]=function(_0x3c837b,_0x38e099){this['rpc'][_0x9ec3('0x42')]({'firstName':_[_0x9ec3('0x43')](_0x3c837b[_0x9ec3('0x13')])||_[_0x9ec3('0x44')](_0x3c837b[_0x9ec3('0x13')])?_0x9ec3('0x45')+Math[_0x9ec3('0x46')]():_0x3c837b[_0x9ec3('0x13')],'lastName':_[_0x9ec3('0x43')](_0x3c837b[_0x9ec3('0x47')])||_[_0x9ec3('0x44')](_0x3c837b['lastName'])?null:_0x3c837b['lastName'],'phone':_0x3c837b[_0x9ec3('0x48')],'ListId':_0x3c837b[_0x9ec3('0x49')],'scheduledat':_0x3c837b['scheduledAt'],'callbackUniqueid':this[_0x9ec3('0xd')]['uniqueid'],'tags':'callback','description':_0x9ec3('0x4a')+_0x3c837b[_0x9ec3('0x4b')]['toString'](),'priority':_0x3c837b[_0x9ec3('0x4c')]})[_0x9ec3('0x12')](function(_0x13e9f1){_0x38e099(null,_0x13e9f1);})[_0x9ec3('0x16')](function(_0x38f161){_0x38e099(_0x38f161);});};AGIVertices['prototype'][_0x9ec3('0x4d')]=function(_0xa3153a,_0x5a8b24){this[_0x9ec3('0xe')]['getPauseById'](_0xa3153a)[_0x9ec3('0x12')](function(_0x1d7b7d){_0x5a8b24(null,_0x1d7b7d?_0x1d7b7d[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0x18813b){_0x5a8b24(_0x18813b);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x4e')]=function(_0x4d30aa,_0x5baa8c,_0x508c7f){var _0x41bbd7={'role':_0x9ec3('0x4f')};_0x41bbd7[_0x4d30aa]=this[_0x9ec3('0xd')][_0x9ec3('0x39')];this[_0x9ec3('0xe')][_0x9ec3('0x4e')](_0x41bbd7,_0x5baa8c,this[_0x9ec3('0xd')][_0x9ec3('0x50')])[_0x9ec3('0x12')](function(_0x1d41ff){_0x508c7f(null,_[_0x9ec3('0x44')](_0x1d41ff)?![]:!![]);})[_0x9ec3('0x16')](function(_0x1ac7ba){logger[_0x9ec3('0x2b')](_0x1ac7ba);_0x508c7f(null,![]);});};AGIVertices[_0x9ec3('0x10')]['agentUnpause']=function(_0x54fa71,_0x4f96d3){var _0xe85f62={'role':_0x9ec3('0x4f')};_0xe85f62[_0x54fa71]=this[_0x9ec3('0xd')][_0x9ec3('0x39')];this[_0x9ec3('0xe')]['agentUnpause'](_0xe85f62)[_0x9ec3('0x12')](function(_0x4842e0){_0x4f96d3(null,_[_0x9ec3('0x44')](_0x4842e0)?![]:!![]);})[_0x9ec3('0x16')](function(_0x1d0b50){logger[_0x9ec3('0x2b')](_0x1d0b50);_0x4f96d3(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x2cf716,_0x5e04f9){var _0x30dc77={'role':_0x9ec3('0x4f')};_0x30dc77[_0x2cf716]=this['channel'][_0x9ec3('0x39')];this['rpc'][_0x9ec3('0x51')](_0x30dc77)[_0x9ec3('0x12')](function(_0x401d93){_0x5e04f9(null,_[_0x9ec3('0x44')](_0x401d93)?![]:!![]);})[_0x9ec3('0x16')](function(_0x56f621){logger['error'](_0x56f621);_0x5e04f9(null,![]);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x52')]=function(_0x333e11,_0x3428d8){var _0x53c877={'role':'agent'};_0x53c877[_0x333e11]=this[_0x9ec3('0xd')][_0x9ec3('0x39')];var _0x16deb9=_0x333e11!=_0x9ec3('0x53')?util[_0x9ec3('0x54')](_0x9ec3('0x55'),_0x9ec3('0x56'),this['channel'][_0x9ec3('0x39')]):undefined;this[_0x9ec3('0xe')]['agentLogin'](_0x53c877,_0x16deb9)[_0x9ec3('0x12')](function(_0x4a1bd7){_0x3428d8(null,_[_0x9ec3('0x44')](_0x4a1bd7)?![]:!![]);})['catch'](function(_0x38506d){logger[_0x9ec3('0x2b')](_0x38506d);_0x3428d8(null,![]);});};AGIVertices[_0x9ec3('0x10')]['shellCommand']=function(_0x4e9f91,_0x379841){sh[_0x9ec3('0x57')](_['trim'](_0x4e9f91),function(_0x2fed2b,_0x299d23){var _0x3f3e2b=_0x299d23[_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'');_0x379841(null,_0x3f3e2b);});};AGIVertices[_0x9ec3('0x10')]['googleCloudTTS']=function(_0x2bcc6e,_0x27d979){scripts[_0x9ec3('0x59')](_0x2bcc6e[_0x9ec3('0x5a')],_0x2bcc6e[_0x9ec3('0x5b')]||_0x9ec3('0x5c'),_0x2bcc6e[_0x9ec3('0x5c')],_0x2bcc6e[_0x9ec3('0x5d')]||_0x9ec3('0x5e'),_0x2bcc6e[_0x9ec3('0x5f')]||_0x9ec3('0x60'),_0x2bcc6e[_0x9ec3('0x61')]||'MP3')[_0x9ec3('0x12')](function(_0x1d6a70){_0x27d979(null,_0x1d6a70);})['catch'](function(_0x2cc923){_0x27d979(_0x2cc923);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x62')]=function(_0x3d4f76,_0x253876){scripts[_0x9ec3('0x62')](_0x3d4f76[_0x9ec3('0x5c')],_0x3d4f76[_0x9ec3('0x63')]||'en',0x1)[_0x9ec3('0x12')](function(_0x5a147a){_0x253876(null,_0x5a147a);})[_0x9ec3('0x16')](function(_0x5261d0){_0x253876(_0x5261d0);});};AGIVertices['prototype']['restAPI']=function(_0xe1b497,_0x2edfe5){var _0x4881ff={'uri':_0xe1b497[_0x9ec3('0x64')],'method':_0xe1b497[_0x9ec3('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xe1b497[_0x9ec3('0x66')])===_0x9ec3('0x67')&&parseInt(_0xe1b497[_0x9ec3('0x66')])>=0x1?parseInt(_0xe1b497[_0x9ec3('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x9ec3('0x68')](['POST',_0x9ec3('0x69')],_0x4881ff[_0x9ec3('0x65')][_0x9ec3('0x6a')]())){try{_0x4881ff['body']=_0xe1b497[_0x9ec3('0xa')]?JSON[_0x9ec3('0x6b')](_0xe1b497[_0x9ec3('0xa')]):{};}catch(_0x15b7ec){logger[_0x9ec3('0x2b')](_0x9ec3('0x6c'),_0x15b7ec);}}try{_0x4881ff[_0x9ec3('0x6d')]=_0xe1b497[_0x9ec3('0x6e')]?JSON[_0x9ec3('0x6b')](_0xe1b497[_0x9ec3('0x6e')]):{};}catch(_0x3e0c77){logger[_0x9ec3('0x2b')](_0x9ec3('0x6f'),_0x3e0c77);}if(_0xe1b497[_0x9ec3('0x70')]){try{var _0xd43828=require(_0xe1b497[_0x9ec3('0x70')])['sync'](this,_0x4881ff);_0x4881ff[_0x9ec3('0x71')]=Mustache[_0x9ec3('0x72')](_0xe1b497[_0x9ec3('0x64')],_0xd43828,{},['$$','$$']);if(_0x4881ff[_0x9ec3('0x6d')]){_0x4881ff[_0x9ec3('0x6d')]=JSON[_0x9ec3('0x6b')](Mustache[_0x9ec3('0x72')](JSON[_0x9ec3('0x73')](_0x4881ff[_0x9ec3('0x6d')]),_0xd43828,{},['$$','$$']));}if(_0x4881ff['body']){_0x4881ff['body']=JSON[_0x9ec3('0x6b')](Mustache[_0x9ec3('0x72')](JSON[_0x9ec3('0x73')](_0x4881ff[_0x9ec3('0x74')]),_0xd43828,{},['$$','$$']));}}catch(_0x274845){logger[_0x9ec3('0x2b')](_0x9ec3('0x75'),_0x274845);}}rp(_0x4881ff)[_0x9ec3('0x12')](function(_0x2ec1a4){var _0x39bfdd={'statusCode':_0x2ec1a4[_0x9ec3('0x76')]||0xc8,'statusMessage':_0x2ec1a4['statusMessage']||'OK','headers':_0x2ec1a4['headers']||{},'body':_0x2ec1a4[_0x9ec3('0x74')]||{}};_0x2edfe5(null,_0x39bfdd);})['catch'](function(_0x15bc09){var _0x5cdec1={'statusCode':_0x15bc09[_0x9ec3('0x76')]||0x1f4,'statusMessage':_0x15bc09[_0x9ec3('0x77')]||_0x9ec3('0x78'),'headers':_0x15bc09['options'][_0x9ec3('0x6d')]||{},'body':_0x15bc09[_0x9ec3('0x79')][_0x9ec3('0x74')]||{}};_0x2edfe5(null,_0x5cdec1);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x7a')]=function(_0x2f0b22,_0x54258d){scripts[_0x9ec3('0x7a')](this['channel'][_0x9ec3('0x50')],_0x2f0b22[_0x9ec3('0x7b')],_0x2f0b22['text'],_0x2f0b22[_0x9ec3('0x7c')]||'en')['then'](function(_0x30e0cd){_0x54258d(null,_0x30e0cd);})[_0x9ec3('0x16')](function(_0x5df3a4){_0x54258d(_0x5df3a4);});};AGIVertices['prototype'][_0x9ec3('0x7d')]=function(_0xc2ba5b,_0x40cb7f){scripts[_0x9ec3('0x7d')](this[_0x9ec3('0xd')][_0x9ec3('0x50')],_0xc2ba5b[_0x9ec3('0x7e')],_0xc2ba5b[_0x9ec3('0x7f')],_0xc2ba5b['private_key'],_0xc2ba5b[_0x9ec3('0x5c')],_0xc2ba5b[_0x9ec3('0x80')]||'en')['then'](function(_0x1a760f){_0x40cb7f(null,_0x1a760f);})[_0x9ec3('0x16')](function(_0x4f2584){_0x40cb7f(_0x4f2584);});};AGIVertices[_0x9ec3('0x10')]['sestekNDA']=function(_0x839158,_0x5f2bcf){scripts['sestekNDA'](this[_0x9ec3('0xd')],_0x839158)[_0x9ec3('0x12')](function(_0x39339e){_0x5f2bcf(null,_0x39339e);})[_0x9ec3('0x16')](function(_0x586cc5){_0x5f2bcf(_0x586cc5);});};AGIVertices['prototype'][_0x9ec3('0x81')]=function(_0x56feee,_0x4485de){scripts[_0x9ec3('0x81')](_0x56feee['key'],_0x56feee['text'],_0x56feee[_0x9ec3('0x82')]||_0x9ec3('0x5e'),_0x56feee[_0x9ec3('0x83')])[_0x9ec3('0x12')](function(_0x3ceb8d){_0x4485de(null,_0x3ceb8d);})['catch'](function(_0x472e62){_0x4485de(_0x472e62);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x84')]=function(_0x3cb91d,_0x5cc4ee,_0x540df8){scripts[_0x9ec3('0x84')](_0x5cc4ee,_0x3cb91d[_0x9ec3('0x7b')],_0x3cb91d[_0x9ec3('0x85')]||_0x9ec3('0x5e'),this[_0x9ec3('0x86')](_0x3cb91d[_0x9ec3('0x87')])?_0x3cb91d['model']:undefined)[_0x9ec3('0x12')](function(_0x55c74e){_0x540df8(null,_0x55c74e);})[_0x9ec3('0x16')](function(_0x4216c8){_0x540df8(_0x4216c8);});};AGIVertices['prototype'][_0x9ec3('0x88')]=function(_0x1d36a7,_0x4fadc3){scripts[_0x9ec3('0x88')](_0x1d36a7[_0x9ec3('0x89')],_0x1d36a7['aws_secret_access_key'],_0x1d36a7['aws_polly_region'],_0x1d36a7[_0x9ec3('0x8a')]||_0x9ec3('0x8b'),_0x1d36a7[_0x9ec3('0x5c')],_0x1d36a7[_0x9ec3('0x8c')]||'text')[_0x9ec3('0x12')](function(_0x48c901){_0x4fadc3(null,_0x48c901);})[_0x9ec3('0x16')](function(_0x20bde9){_0x4fadc3(_0x20bde9);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x8d')]=function(_0x59b75e,_0x1f4137){scripts['awsLex'](this[_0x9ec3('0xd')]['uniqueid'],_0x59b75e[_0x9ec3('0x89')],_0x59b75e[_0x9ec3('0x8e')],_0x59b75e[_0x9ec3('0x8f')],_0x59b75e['text'],_0x59b75e[_0x9ec3('0x90')])['then'](function(_0x4b9178){_0x1f4137(null,_0x4b9178);})[_0x9ec3('0x16')](function(_0xd8dca8){_0x1f4137(_0xd8dca8);});};AGIVertices['prototype'][_0x9ec3('0x91')]=function(_0x491c73,_0x1608b7,_0x122853){scripts[_0x9ec3('0x91')](_0x1608b7,_0x491c73[_0x9ec3('0x7b')],_0x491c73[_0x9ec3('0x92')]||_0x9ec3('0x5e'))[_0x9ec3('0x12')](function(_0x39a344){_0x122853(null,_0x39a344);})[_0x9ec3('0x16')](function(_0x3386a6){_0x122853(_0x3386a6);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x93')]=function(_0x5ab726,_0x3e7b12,_0xde6002){scripts[_0x9ec3('0x93')](_0x3e7b12,_0x5ab726['appid'],_0x5ab726[_0x9ec3('0x94')],_0x5ab726['uri'])['then'](function(_0x5c47a0){_0xde6002(null,_0x5c47a0);})['catch'](function(_0x4571b6){_0xde6002(_0x4571b6);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x95')]=function(_0x1abda8){var _0x41f8e5=_[_0x9ec3('0x68')](verticesWithRetry,_0x1abda8['agicommand'])?_0x1abda8:_[_0x9ec3('0x96')](_0x1abda8);for(var _0x1b31d0 in _0x41f8e5){if(_0x41f8e5[_0x9ec3('0x97')](_0x1b31d0)){if(_0x41f8e5[_0x1b31d0]&&_[_0x9ec3('0x98')](_0x41f8e5[_0x1b31d0])){if(_[_0x9ec3('0x68')](recursiveMapAttributes,_0x1b31d0)){_0x41f8e5[_0x1b31d0]=this[_0x9ec3('0x99')](_0x41f8e5[_0x1b31d0]);}else{_0x41f8e5[_0x1b31d0]=this['replaceAllVariables'](_0x41f8e5[_0x1b31d0]);}}}}return _0x41f8e5;};AGIVertices['prototype'][_0x9ec3('0x9a')]=function(_0x2a3493){for(var _0x4ce718 in _0x2a3493){if(_0x2a3493[_0x9ec3('0x97')](_0x4ce718)){if(_[_0x9ec3('0x9b')](_0x2a3493[_0x4ce718])){this[_0x9ec3('0x9a')](_0x2a3493[_0x4ce718]);}else if(_[_0x9ec3('0x9c')](_0x2a3493[_0x4ce718])){for(var _0x311661=0x0;_0x311661<_0x2a3493[_0x4ce718][_0x9ec3('0x9d')];_0x311661++){this[_0x9ec3('0x9a')](_0x2a3493[_0x4ce718][_0x311661]);}}else if(_[_0x9ec3('0x98')](_0x2a3493[_0x4ce718])){_0x2a3493[_0x4ce718]=this['replaceAllVariables'](_0x2a3493[_0x4ce718]);}}}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x9e')]=function(_0x129ffe,_0x2afa71){for(var _0x465fce in _0x129ffe){if(_0x129ffe[_0x9ec3('0x97')](_0x465fce)){if(_[_0x9ec3('0x9b')](_0x129ffe[_0x465fce])){if(!_[_0x9ec3('0x43')](_0x129ffe[_0x465fce])){this[_0x9ec3('0x9e')](_0x129ffe[_0x465fce],util[_0x9ec3('0x54')]('%s.%s',_0x2afa71,_0x465fce));}}else if(_[_0x9ec3('0x9c')](_0x129ffe[_0x465fce])){for(var _0x21da07=0x0;_0x21da07<_0x129ffe[_0x465fce][_0x9ec3('0x9d')];_0x21da07++){this[_0x9ec3('0x9e')](_0x129ffe[_0x465fce][_0x21da07],util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x2afa71,_0x465fce+'['+_0x21da07+']'));}}else{if(!_[_0x9ec3('0x44')](_0x129ffe[_0x465fce])){this['channel'][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x2afa71,_0x465fce),_0x129ffe[_0x465fce]);}}}}};AGIVertices['prototype'][_0x9ec3('0x99')]=function(_0x240a88){try{var _0x4ddd4f=JSON[_0x9ec3('0x6b')](_0x240a88);this[_0x9ec3('0x9a')](_0x4ddd4f);return JSON[_0x9ec3('0x73')](_0x4ddd4f);}catch(_0x29e21a){return this['replaceAllVariables'](_0x240a88);}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xa1')]=function(_0x537330){var _0x1900a6=_0x537330[_0x9ec3('0xa2')]('{');for(var _0x1a0575=0x1;_0x1a0575<_0x1900a6[_0x9ec3('0x9d')];_0x1a0575+=0x1){var _0x266d3c=_0x1900a6[_0x1a0575]['split']('}');if(_0x266d3c[_0x9ec3('0x9d')]>0x1){_0x537330=_0x537330[_0x9ec3('0xa3')]('{'+_0x266d3c[0x0]+'}',this[_0x9ec3('0xd')][_0x9ec3('0xa4')](_0x266d3c[0x0])['extra']||_0x266d3c[0x0]);}}if(_0x1900a6[_0x9ec3('0x9d')]===0x1){return _0x537330[_0x9ec3('0xa5')]();}return this[_0x9ec3('0xa1')](_0x537330);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xa6')]=function(_0x4c7054,_0x3eec3e){var _0x50980d=this[_0x9ec3('0xd')][_0x9ec3('0xa4')](_0x4c7054);if(_0x50980d['result']===-0x1){return _0x50980d;}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3eec3e,_0x50980d['extra']));return this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x3eec3e,_0x50980d['extra']);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x86')]=function(_0x16bdf1){return _0x16bdf1&&_0x16bdf1!=='0'&&_0x16bdf1!=='-1'&&_0x16bdf1!=='';};AGIVertices[_0x9ec3('0x10')]['maxRetry']=function(_0x158a3a){this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x158a3a,'-');_0x158a3a[_0x9ec3('0xa8')]=_0x158a3a[_0x9ec3('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9ec3('0x10')]['mrcpsynth']=function(_0x12ccca){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xaa'),_0x12ccca[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x12ccca[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}var _0x2ab6b1='\x22'+_0x12ccca[_0x9ec3('0x5c')]+'\x22';if(this[_0x9ec3('0x86')](_0x12ccca[_0x9ec3('0x79')])){_0x2ab6b1+=','+_0x12ccca[_0x9ec3('0x79')];}var _0x1fc8e5=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xad'),_0x2ab6b1);if(_0x1fc8e5[_0x9ec3('0xae')]===-0x1){return _0x1fc8e5;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format'](_0x9ec3('0xaf'),_0x2ab6b1));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xb0')]=function(_0x226558){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xb1'),_0x226558['label']));if(!this[_0x9ec3('0x86')](_0x226558['grammar'])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0xb2'));}var _0x29b75e=_0x226558[_0x9ec3('0xb3')];if(this[_0x9ec3('0x86')](_0x226558[_0x9ec3('0x79')])){_0x29b75e+=','+_0x226558[_0x9ec3('0x79')];}var _0x26665b=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xb4'),_0x29b75e);if(_0x26665b[_0x9ec3('0xae')]===-0x1){return _0x26665b;}var _0x25d32e=this[_0x9ec3('0xa6')](_0x9ec3('0xb5'),_0x9ec3('0xb6'));if(_0x25d32e[_0x9ec3('0xae')]===-0x1){return _0x25d32e;}var _0xff2974=this[_0x9ec3('0xa6')](_0x9ec3('0xb7'),_0x9ec3('0xb8'));if(_0xff2974[_0x9ec3('0xae')]===-0x1){return _0xff2974;}var _0x4bcaee=this[_0x9ec3('0xa6')](_0x9ec3('0xb9'),_0x9ec3('0xba'));if(_0x4bcaee[_0x9ec3('0xae')]===-0x1){return _0x4bcaee;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xbb'),_0x29b75e));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x8')]=function(_0x26db44){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0xbc'),_0x26db44[_0x9ec3('0x36')]));return this['channel']['agi']([_0x26db44[_0x9ec3('0xbd')],_0x26db44[_0x9ec3('0xbe')]]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xbf')]=function(_0xf7e31e){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0xc0'),_0xf7e31e[_0x9ec3('0x36')]));if(this[_0x9ec3('0x86')](_0xf7e31e[_0x9ec3('0x66')])){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0xc1'),_0xf7e31e['timeout']));var _0x2f7884=this[_0x9ec3('0xd')][_0x9ec3('0xc2')](_0xf7e31e['timeout']);if(_0x2f7884[_0x9ec3('0xae')]===-0x1){return _0x2f7884;}}return this[_0x9ec3('0xd')][_0x9ec3('0xbf')]();};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xc3')]=function(_0x56943b){logger[_0x9ec3('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x56943b[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x56943b[_0x9ec3('0x49')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x56943b,_0x9ec3('0xc4'));}_0x56943b[_0x9ec3('0x4b')]=moment();if(this[_0x9ec3('0x86')](_0x56943b[_0x9ec3('0xc5')])){_0x56943b[_0x9ec3('0x4b')]=moment()[_0x9ec3('0xc6')](_0x56943b[_0x9ec3('0xc5')],_0x9ec3('0xc7'));}if(!this[_0x9ec3('0x86')](_0x56943b[_0x9ec3('0x4c')])){_0x56943b['callback_priority']=0x2;}this['createCmContact'][_0x9ec3('0xa7')](this,_0x56943b);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x56943b[_0x9ec3('0x48')],_0x56943b[_0x9ec3('0x49')],_0x56943b[_0x9ec3('0x4b')]));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xc8')]=function(_0x4a838f){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xc9'),_0x4a838f[_0x9ec3('0x36')]));var _0x141034=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x4a838f[_0x9ec3('0xca')],_0x4a838f[_0x9ec3('0x79')]);if(_0x141034[_0x9ec3('0xae')]===-0x1){return _0x141034;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('Executed\x20command\x20%s\x20%s',_0x4a838f['application'],_0x4a838f[_0x9ec3('0x79')]));};AGIVertices[_0x9ec3('0x10')]['lumenvoxtts']=function(_0x5ae9a9){logger[_0x9ec3('0x2d')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5ae9a9[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x5ae9a9[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('no\x20text\x20configured');}var _0x13ed62='\x22'+_0x5ae9a9[_0x9ec3('0x5c')]+'\x22';if(this[_0x9ec3('0x86')](_0x5ae9a9['options'])){_0x13ed62+=','+_0x5ae9a9[_0x9ec3('0x79')];}var _0x44d37d=this[_0x9ec3('0xd')][_0x9ec3('0x57')]('MRCPSynth',_0x13ed62);if(_0x44d37d['result']===-0x1){return _0x44d37d;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xaf'),_0x13ed62));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xcb')]=function(_0xa500f5){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xcc'),_0xa500f5[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0xa500f5['text'])){return this[_0x9ec3('0xd')]['noop']('no\x20text\x20configured');}var _0x145895='\x22'+_0xa500f5[_0x9ec3('0x5c')]+'\x22';if(this[_0x9ec3('0x86')](_0xa500f5[_0x9ec3('0x79')])){_0x145895+=','+_0xa500f5['options'];}var _0x1ea438=this[_0x9ec3('0xd')]['exec']('MRCPSynth',_0x145895);if(_0x1ea438[_0x9ec3('0xae')]===-0x1){return _0x1ea438;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('Executed\x20command\x20MRCPSynth\x20%s',_0x145895));};AGIVertices[_0x9ec3('0x10')]['lumenvoxasr']=function(_0x29e6cd){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xcd'),_0x29e6cd['label']));if(!this[_0x9ec3('0x86')](_0x29e6cd[_0x9ec3('0xb3')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xb2'));}var _0x27f467=_0x29e6cd[_0x9ec3('0xb3')];if(this[_0x9ec3('0x86')](_0x29e6cd[_0x9ec3('0x79')])){_0x27f467+=','+_0x29e6cd[_0x9ec3('0x79')];}var _0x482df8=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xb4'),_0x27f467);if(_0x482df8[_0x9ec3('0xae')]===-0x1){return _0x482df8;}var _0x2d3033=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9ec3('0xce'));if(_0x2d3033[_0x9ec3('0xae')]===-0x1){return _0x2d3033;}var _0x14b172=this['getAndSetVariable'](_0x9ec3('0xb7'),_0x9ec3('0xcf'));if(_0x14b172[_0x9ec3('0xae')]===-0x1){return _0x14b172;}var _0x55039d=this[_0x9ec3('0xa6')](_0x9ec3('0xb9'),'LUMENVOX_ASR_INSTANCE');if(_0x55039d['result']===-0x1){return _0x55039d;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xbb'),_0x27f467));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xd0')]=function(_0x4c8c59){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xd1'),_0x4c8c59[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4c8c59[_0x9ec3('0xb3')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xb2'));}var _0x465257=_0x4c8c59[_0x9ec3('0xb3')];if(this[_0x9ec3('0x86')](_0x4c8c59[_0x9ec3('0x79')])){_0x465257+=','+_0x4c8c59[_0x9ec3('0x79')];}var _0x40a753=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0xb4'),_0x465257);if(_0x40a753[_0x9ec3('0xae')]===-0x1){return _0x40a753;}var _0x3b3d76=this[_0x9ec3('0xa6')](_0x9ec3('0xb5'),_0x9ec3('0xd2'));if(_0x3b3d76[_0x9ec3('0xae')]===-0x1){return _0x3b3d76;}var _0x59aa74=this['getAndSetVariable'](_0x9ec3('0xb7'),'SESTEK_ASR_TRANSCRIPT');if(_0x59aa74[_0x9ec3('0xae')]===-0x1){return _0x59aa74;}var _0x5e30f8=this[_0x9ec3('0xa6')]('RECOG_INSTANCE()',_0x9ec3('0xd3'));if(_0x5e30f8['result']===-0x1){return _0x5e30f8;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0x465257));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xd4')]=function(_0x12eab9){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xd5'),_0x12eab9[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x12eab9[_0x9ec3('0xd6')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x12eab9,_0x9ec3('0xd7'));}var _0x1b6720=this[_0x9ec3('0xd8')][_0x9ec3('0xa7')](this,_0x12eab9[_0x9ec3('0xd6')]);if(!_0x1b6720){return this['channel'][_0x9ec3('0x2b')](_0x12eab9,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x12eab9[_0x9ec3('0x2f')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x12eab9,'no\x20query\x20configured');}var _0x22e517=_0x12eab9[_0x9ec3('0x2f')][_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xd9'),_0x22e517));var _0x57313b=this[_0x9ec3('0xda')][_0x9ec3('0xa7')](this,_0x1b6720,_0x22e517);this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x12eab9,_0x22e517);if(!this[_0x9ec3('0x86')](_0x12eab9[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2ecb7c=this[_0x9ec3('0xa4')]['sync'](this,_0x12eab9[_0x9ec3('0xdc')]);if(!_0x2ecb7c){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x12eab9,'no\x20variable\x20found');}var _0x121331=this;_0x57313b[_0x9ec3('0xdd')](function(_0x252d62,_0x48abe0){Object['keys'](_0x252d62)[_0x9ec3('0xdd')](function(_0x1e1165){_0x121331[_0x9ec3('0xd')]['setVariable'](util['format'](_0x9ec3('0xde'),_0x2ecb7c,_0x48abe0,_0x1e1165),_0x252d62[_0x1e1165]);});});this['channel'][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('%s_ROWS_COUNT',_0x2ecb7c),_0x57313b[_0x9ec3('0x9d')]);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('variable\x20%s\x20set',_0x2ecb7c));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xdf')]=function(_0x379199){logger[_0x9ec3('0xe0')](util[_0x9ec3('0x54')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x379199['label']));if(!this[_0x9ec3('0x86')](_0x379199[_0x9ec3('0xe1')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x379199,_0x9ec3('0xe2'));}var _0x3090e9=this[_0x9ec3('0x19')][_0x9ec3('0xa7')](this,_0x379199['sip_id']);if(!_0x3090e9){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x379199,_0x9ec3('0xe3'));}var _0x2e65cf=this[_0x9ec3('0xd')][_0x9ec3('0x57')]('DIAL',[util[_0x9ec3('0x54')](_0x9ec3('0xe4'),_0x3090e9),_0x379199[_0x9ec3('0x66')],_0x379199[_0x9ec3('0xe5')],_0x379199[_0x9ec3('0x64')]]);if(_0x2e65cf[_0x9ec3('0xae')]===-0x1){return _0x2e65cf;}return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0xe6'),_0x9ec3('0xe7')));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xe8')]=function(_0xd10e34){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xe9'),_0xd10e34['label']));if(!this[_0x9ec3('0x86')](_0xd10e34[_0x9ec3('0x7b')])){return this[_0x9ec3('0xd')]['noop']('no\x20key\x20configured');}if(!this[_0x9ec3('0x86')](_0xd10e34[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')][_0x9ec3('0xea')]=!![];this[_0x9ec3('0xdb')](_0xd10e34);this[_0x9ec3('0x41')](_0xd10e34[_0x9ec3('0x5c')],'in','','');this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xeb'),_0xd10e34[_0x9ec3('0x5c')]));var _0x16ad23=this[_0x9ec3('0x7a')][_0x9ec3('0xa7')](this,_0xd10e34);if(_0x16ad23){for(var _0xebc4a in _0x16ad23){if(_0x16ad23[_0x9ec3('0x97')](_0xebc4a)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('DIALOGFLOW_%s',_0xebc4a[_0x9ec3('0x6a')]()),_0x16ad23[_0xebc4a]);}}this[_0x9ec3('0x41')](_0x16ad23[_0x9ec3('0xec')],_0x9ec3('0xed'),_0x9ec3('0xe8'),'');return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format']('Dialogflow\x20Result\x20%s',_0x16ad23[_0x9ec3('0xec')]));}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0xd10e34,_0x9ec3('0xee'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xef')]=function(_0x3d6248){logger[_0x9ec3('0x2d')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3d6248['label']));if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0x7e')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xf0'));}if(!this['isConfigured'](_0x3d6248[_0x9ec3('0x7f')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xf1'));}if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0xf2')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xf3'));}if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0x80')])){return this['channel']['noop'](_0x9ec3('0xf4'));}if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0x5c')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x9ec3('0xd')][_0x9ec3('0xea')]=!![];this[_0x9ec3('0xdb')](_0x3d6248);this[_0x9ec3('0x41')](_0x3d6248[_0x9ec3('0x5c')],'in','','');this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0xf5'),_0x3d6248['text']));var _0x466fa3=this[_0x9ec3('0x7d')][_0x9ec3('0xa7')](this,_0x3d6248);if(_0x466fa3){for(var _0x59cefe in _0x466fa3){if(_0x466fa3[_0x9ec3('0x97')](_0x59cefe)){if(_0x59cefe!==_0x9ec3('0xf6')){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util['format'](_0x9ec3('0xf7'),_0x59cefe[_0x9ec3('0x6a')]()),_0x466fa3[_0x59cefe]);}}}this[_0x9ec3('0x41')](_0x466fa3[_0x9ec3('0xec')],_0x9ec3('0xed'),'dialogflowV2',_0x466fa3[_0x9ec3('0xf6')]);return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')]('DialogflowV2\x20Result\x20%s',_0x466fa3[_0x9ec3('0xec')]));}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x3d6248,_0x9ec3('0xf8'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xf9')]=function(_0x14b340){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xfa'),_0x14b340[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x14b340[_0x9ec3('0xfb')])){return this['channel'][_0x9ec3('0xab')](_0x9ec3('0xfc'));}if(!this[_0x9ec3('0x86')](_0x14b340['username'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xfd'));}if(!this[_0x9ec3('0x86')](_0x14b340[_0x9ec3('0xfe')])){return this[_0x9ec3('0xd')]['noop']('no\x20password\x20configured');}if(!this[_0x9ec3('0x86')](_0x14b340[_0x9ec3('0xff')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')][_0x9ec3('0xea')]=!![];this[_0x9ec3('0xdb')](_0x14b340);this[_0x9ec3('0x41')](_0x14b340['text'],'in','','');this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x100'),_0x14b340[_0x9ec3('0x5c')]));var _0x2e6b2c=this['sestekNDA'][_0x9ec3('0xa7')](this,_0x14b340);if(_0x2e6b2c){for(var _0x5ab381 in _0x2e6b2c){if(_0x2e6b2c[_0x9ec3('0x97')](_0x5ab381)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('SESTEK_NDA_%s',_0x5ab381[_0x9ec3('0x6a')]()),_0x2e6b2c[_0x5ab381]);}}this['createSquareMessage'](_0x2e6b2c['speech'],_0x9ec3('0xed'),_0x9ec3('0xf9'),'');if(_0x2e6b2c['audiofile']){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x101'),_0x2e6b2c[_0x9ec3('0x102')]));var _0x127863=this[_0x9ec3('0xd')][_0x9ec3('0x103')](_0x2e6b2c['audiofile']);try{fs[_0x9ec3('0x104')](_0x2e6b2c[_0x9ec3('0x102')]+_0x9ec3('0x105'));}catch(_0x526195){logger[_0x9ec3('0x2b')](_0x526195);}return _0x127863;}else{return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x106'),_0x2e6b2c[_0x9ec3('0xec')]));}}return this['channel'][_0x9ec3('0x2b')](_0x14b340,_0x9ec3('0x107'));};AGIVertices['prototype'][_0x9ec3('0x108')]=function(_0x13bb35){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x109'),_0x13bb35[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x108'));};AGIVertices[_0x9ec3('0x10')]['ext_dial']=function(_0x2273f9){logger['info'](util['format'](_0x9ec3('0x10a'),_0x2273f9[_0x9ec3('0x36')]));var _0x48f931='';if(_0x2273f9[_0x9ec3('0x10b')]){if(!this[_0x9ec3('0x86')](_0x2273f9[_0x9ec3('0x10b')])){return this['channel']['error'](_0x2273f9,_0x9ec3('0x10c'));}else{var _0x3b507a=parseInt(_0x2273f9[_0x9ec3('0x10b')],0xa);if(isNaN(_0x3b507a)){_0x48f931=_0x2273f9['trunk_id'];}else{_0x48f931=this[_0x9ec3('0x1b')][_0x9ec3('0xa7')](this,_0x2273f9['trunk_id']);if(!_0x48f931){return this[_0x9ec3('0xd')]['error'](_0x2273f9,_0x9ec3('0x10d'));}}}}else if(_0x2273f9[_0x9ec3('0x10e')]){_0x48f931=_0x2273f9[_0x9ec3('0x10e')];}else{return this[_0x9ec3('0xd')]['error'](_0x2273f9,_0x9ec3('0x10c'));}var _0x4ccbc1=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xe7'),[util[_0x9ec3('0x54')](_0x9ec3('0x10f'),_0x48f931,_0x2273f9[_0x9ec3('0x48')]),_0x2273f9[_0x9ec3('0x66')],_0x2273f9['opts'],_0x2273f9['url']]);if(_0x4ccbc1[_0x9ec3('0xae')]===-0x1){return _0x4ccbc1;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format'](_0x9ec3('0xe6'),_0x9ec3('0xe7')));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x110')]=function(_0x467d3f){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x111'),_0x467d3f[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('finally');};AGIVertices['prototype'][_0x9ec3('0xc')]=function(_0x14ad2b){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x112'),_0x14ad2b[_0x9ec3('0x36')]));if(_0x14ad2b['retry']===0x0){return this[_0x9ec3('0xa9')](_0x14ad2b);}_0x14ad2b['retry']-=0x1;if(!this['isConfigured'](_0x14ad2b[_0x9ec3('0x113')])){return this['channel'][_0x9ec3('0x2b')](_0x14ad2b,_0x9ec3('0x114'));}var _0x4f2998=this[_0x9ec3('0x1d')][_0x9ec3('0xa7')](this,_0x14ad2b['file_id']);if(!_0x4f2998){return this[_0x9ec3('0xd')]['error'](_0x14ad2b,'no\x20file\x20audio\x20found');}if(!this[_0x9ec3('0x86')](_0x14ad2b[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x14a34b=this[_0x9ec3('0xd')][_0x9ec3('0x115')](_0x4f2998,_0x14ad2b[_0x9ec3('0x116')],_0x14ad2b['maxdigit']);var _0x5b5284=_0x14a34b['result']?_0x14a34b[_0x9ec3('0xae')]['toString']():'';logger[_0x9ec3('0x2d')](_0x9ec3('0x117'),JSON[_0x9ec3('0x73')](_0x14a34b));if(_0x14a34b[_0x9ec3('0xae')]===-0x1){this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,_0x5b5284);return _0x14a34b;}else if(_0x14a34b['extra']===_0x9ec3('0x66')){_0x14a34b[_0x9ec3('0xae')]=_0x5b5284['length']>=parseInt(_0x14ad2b[_0x9ec3('0x118')])?'x':'i';}else{_0x14a34b['result']=_0x5b5284[_0x9ec3('0x9d')]>=parseInt(_0x14ad2b[_0x9ec3('0x118')])&&_0x5b5284[_0x9ec3('0x9d')]<=parseInt(_0x14ad2b['maxdigit'])?'x':'i';}var _0x56362b=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x14ad2b[_0x9ec3('0xdc')]);if(!_0x56362b){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x14ad2b,_0x9ec3('0x119'));}this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x56362b,_0x5b5284);if(this['isConfigured'](_0x14ad2b[_0x9ec3('0x11a')])){var _0x18f487=parseInt(_0x14ad2b[_0x9ec3('0x11a')],0xa);var _0x4b008e=rs[_0x9ec3('0x11b')]({'charset':'*','length':_0x18f487});var _0x407fca=_0x5b5284[_0x9ec3('0x9d')];if(_0x407fca>0x0){if(_0x407fca>_0x18f487){this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,_0x14ad2b[_0x9ec3('0x11c')]===_0x9ec3('0x11d')?_0x4b008e+_0x5b5284[_0x9ec3('0x11e')](_0x18f487):_0x5b5284[_0x9ec3('0x11e')](0x0,_0x407fca-_0x18f487)+_0x4b008e);}else{this[_0x9ec3('0xdb')]['sync'](this,_0x14ad2b,rs[_0x9ec3('0x11b')]({'charset':'*','length':_0x407fca}));}}else{this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,'');}}else{this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,_0x5b5284);}return _0x14a34b;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x11f')]=function(_0x33ecf3){logger['info'](util['format'](_0x9ec3('0x120'),_0x33ecf3[_0x9ec3('0x36')]));return this[_0x9ec3('0xc')](_0x33ecf3);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x121')]=function(_0x2aa113){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x122'),_0x2aa113['label']));this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x2aa113,_0x2aa113[_0x9ec3('0x123')]);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x124'),_0x2aa113[_0x9ec3('0x123')]));};AGIVertices[_0x9ec3('0x10')]['awspolly']=function(_0x40dd8e){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x125'),_0x40dd8e['label']));if(!this['isConfigured'](_0x40dd8e[_0x9ec3('0x89')])||!this['isConfigured'](_0x40dd8e['aws_secret_access_key'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x126'));}if(!this[_0x9ec3('0x86')](_0x40dd8e[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this['channel']['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x127'),_0x40dd8e['text']));var _0x454558=this[_0x9ec3('0x88')][_0x9ec3('0xa7')](this,_0x40dd8e);if(_0x454558){this['channel'][_0x9ec3('0xab')](util['format'](_0x9ec3('0x128'),_0x454558));var _0x3ae314=this[_0x9ec3('0xd')][_0x9ec3('0x103')](_0x454558);try{fs[_0x9ec3('0x104')](_0x454558+_0x9ec3('0x105'));}catch(_0x44054f){logger[_0x9ec3('0x2b')](_0x44054f);}return _0x3ae314;}return this['channel'][_0x9ec3('0x2b')](_0x40dd8e,_0x9ec3('0x129'));};AGIVertices['prototype'][_0x9ec3('0x12a')]=function(_0x4c49a1){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x12b'),_0x4c49a1[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4c49a1['aws_access_key_id'])||!this['isConfigured'](_0x4c49a1[_0x9ec3('0x8e')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x126'));}if(!this[_0x9ec3('0x86')](_0x4c49a1['aws_bot_name'])){return this['channel']['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x9ec3('0x86')](_0x4c49a1['text'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')]['bot']=!![];this[_0x9ec3('0xdb')](_0x4c49a1);this[_0x9ec3('0x41')](_0x4c49a1[_0x9ec3('0x5c')],'in','','');this['channel']['noop'](util[_0x9ec3('0x54')]('Trying\x20Amazon\x20Lex:\x20%s',_0x4c49a1['text']));var _0x529dc6=this[_0x9ec3('0x8d')][_0x9ec3('0xa7')](this,_0x4c49a1);if(_0x529dc6){for(var _0x15fefd in _0x529dc6){if(_0x529dc6['hasOwnProperty'](_0x15fefd)&&_[_0x9ec3('0x98')](_0x529dc6[_0x15fefd])){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('AWS_LEX_%s',_0x15fefd[_0x9ec3('0x6a')]()),_0x529dc6[_0x15fefd]);}}if(_[_0x9ec3('0x44')](_0x529dc6[_0x9ec3('0x77')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x12c'));}else{this[_0x9ec3('0x41')](_0x529dc6[_0x9ec3('0x77')],_0x9ec3('0xed'),'amazonlex','');return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x12d'),_0x529dc6[_0x9ec3('0x77')]));}}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4c49a1,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x12e')]=function(_0x5d36db){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x12f'),_0x5d36db[_0x9ec3('0x36')],_0x5d36db[_0x9ec3('0x66')]));if(!this['isConfigured'](_0x5d36db['key'])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x130'));}var _0x38de5b=_0x9ec3('0x131');var _0x5ce27b=util['format'](_0x9ec3('0x132'),FILES_PATH,rs['generate'](0x4));var _0x106242=util[_0x9ec3('0x54')]('%s.%s',_0x5ce27b,_0x38de5b);var _0x4f245b=!![];if(_0x5d36db['beep']===_0x9ec3('0x133')){_0x4f245b=![];}var _0x36e3f1=this[_0x9ec3('0xd')][_0x9ec3('0x134')](_0x5ce27b,_0x38de5b,_0x5d36db[_0x9ec3('0x135')],_0x5d36db[_0x9ec3('0x66')],undefined,_0x4f245b);if(_0x36e3f1[_0x9ec3('0xae')]!==-0x1){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x136'),_0x106242));var _0x21c57a=this[_0x9ec3('0x91')][_0x9ec3('0xa7')](this,_0x5d36db,_0x106242);if(_0x21c57a){for(var _0x709f6a in _0x21c57a){if(_0x21c57a[_0x9ec3('0x97')](_0x709f6a)){this[_0x9ec3('0xd')]['setVariable'](util[_0x9ec3('0x54')](_0x9ec3('0x137'),_0x709f6a[_0x9ec3('0x6a')]()),_0x21c57a[_0x709f6a]);}}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x138'),JSON['stringify'](_0x21c57a)));}}return _0x36e3f1;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x139')]=function(_0x1f4663){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x13a'),_0x1f4663[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x1f4663['appid'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x13b'));}if(!this[_0x9ec3('0x86')](_0x1f4663[_0x9ec3('0x94')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x13c'));}var _0x5d18e2=_0x9ec3('0x131');var _0x3c5229=util[_0x9ec3('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x9ec3('0x11b')](0x4));var _0x19f06a=util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x3c5229,_0x5d18e2);var _0x52fc43=!![];if(_0x1f4663['beep']==='NOBEEP'){_0x52fc43=![];}var _0x564056=this[_0x9ec3('0xd')][_0x9ec3('0x134')](_0x3c5229,_0x5d18e2,_0x1f4663[_0x9ec3('0x135')],_0x1f4663['timeout'],undefined,_0x52fc43);if(_0x564056[_0x9ec3('0xae')]!==-0x1){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x13d'),_0x19f06a));var _0x103b96=this['tildeASR'][_0x9ec3('0xa7')](this,_0x1f4663,_0x19f06a);if(_0x103b96){for(var _0x5ef8c5 in _0x103b96){if(_0x103b96[_0x9ec3('0x97')](_0x5ef8c5)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x13e'),_0x5ef8c5[_0x9ec3('0x6a')]()),_0x103b96[_0x5ef8c5]);}}return this['channel']['noop'](util['format'](_0x9ec3('0x13f'),JSON['stringify'](_0x103b96)));}}return _0x564056;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x140')]=function(_0x51be70){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x51be70[_0x9ec3('0x36')]));return this['channel'][_0x9ec3('0x141')](_0x51be70[_0x9ec3('0x142')],_0x51be70[_0x9ec3('0x3c')],_0x51be70[_0x9ec3('0x3d')]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x143')]=function(_0x51d704){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x144'),_0x51d704[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x51d704[_0x9ec3('0x145')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x51d704,_0x9ec3('0x146'));}try{var _0x1d5792=eval(_0x51d704[_0x9ec3('0x145')])?_0x9ec3('0x147'):_0x9ec3('0x148');this[_0x9ec3('0xd')]['noop'](util['format'](_0x9ec3('0x149'),_0x51d704[_0x9ec3('0x145')],_0x1d5792));return{'code':0xc8,'result':_0x1d5792};}catch(_0x5cf6db){return{'code':0xc8,'result':_0x9ec3('0x148')};}};AGIVertices['prototype'][_0x9ec3('0x14a')]=function(_0x21d95c){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x14b'),_0x21d95c[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x21d95c['interval_id'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x21d95c,_0x9ec3('0x14c'));}var _0x54ad8a=this[_0x9ec3('0x24')][_0x9ec3('0xa7')](this,_0x21d95c[_0x9ec3('0x14d')]);if(!_0x54ad8a){return this['channel'][_0x9ec3('0x2b')](_0x21d95c,_0x9ec3('0x14e'));}for(var _0x1e9e3e=0x0;_0x1e9e3e<_0x54ad8a[_0x9ec3('0x9d')];_0x1e9e3e+=0x1){var _0x46136a=this[_0x9ec3('0xd')]['getVariable'](util['format'](_0x9ec3('0x14f'),_0x54ad8a[_0x1e9e3e]));if(_0x46136a[_0x9ec3('0xae')]===-0x1){return _0x46136a;}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x46136a[_0x9ec3('0x151')]));if(_0x46136a['extra']==='true'){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x9ec3('0x147')));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x9ec3('0x147')));return{'code':0xc8,'result':_0x9ec3('0x147')};}else{logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x9ec3('0x148')));this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],'false'));}}return{'code':0xc8,'result':_0x9ec3('0x148')};};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x152')]=function(_0x5ddb5f){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x153'),_0x5ddb5f[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')][_0x9ec3('0x152')]();};AGIVertices['prototype'][_0x9ec3('0x154')]=function(_0x54b848){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x54b848[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x54b848[_0x9ec3('0x7b')])){return this['channel'][_0x9ec3('0xab')]('no\x20key\x20configured');}var _0x33347a=_0x9ec3('0x131');var _0x10aeae=util[_0x9ec3('0x54')](_0x9ec3('0x132'),FILES_PATH,rs['generate'](0x4));var _0x1ea25f=util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x10aeae,_0x33347a);var _0x21d022=!![];if(_0x54b848[_0x9ec3('0x155')]===_0x9ec3('0x133')){_0x21d022=![];}var _0x36d3ea=this['channel'][_0x9ec3('0x134')](_0x10aeae,_0x33347a,_0x54b848[_0x9ec3('0x135')],_0x54b848[_0x9ec3('0x66')],undefined,_0x21d022);if(_0x36d3ea[_0x9ec3('0xae')]!==-0x1){this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x156'),_0x1ea25f));var _0x41dbcc=this[_0x9ec3('0x84')]['sync'](this,_0x54b848,_0x1ea25f);if(_0x41dbcc){for(var _0x20dc08 in _0x41dbcc){if(_0x41dbcc[_0x9ec3('0x97')](_0x20dc08)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x157'),_0x20dc08[_0x9ec3('0x6a')]()),_0x41dbcc[_0x20dc08]);}}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x158'),JSON['stringify'](_0x41dbcc)));}}return _0x36d3ea;};AGIVertices['prototype'][_0x9ec3('0x159')]=function(_0x541fd1){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x541fd1[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x541fd1[_0x9ec3('0x7b')])){return this['channel'][_0x9ec3('0xab')]('no\x20key\x20configured');}if(!this[_0x9ec3('0x86')](_0x541fd1['text'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x15a'),_0x541fd1[_0x9ec3('0x5c')]));var _0x40f10b=this['ispeechTTS'][_0x9ec3('0xa7')](this,_0x541fd1);if(_0x40f10b){this['channel']['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x156'),_0x40f10b));var _0x4c185b=this['channel']['streamFile'](_0x40f10b,_0x541fd1[_0x9ec3('0x135')]);try{fs[_0x9ec3('0x104')](_0x40f10b+_0x9ec3('0x105'));}catch(_0x21eaa8){logger[_0x9ec3('0x2b')](_0x21eaa8);}return _0x4c185b;}return this[_0x9ec3('0xd')]['error'](_0x541fd1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x15b')]=function(_0x489958){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x15c'),_0x489958[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x489958[_0x9ec3('0x15d')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x489958,_0x9ec3('0x15e'));}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));var _0x137d02=this[_0x9ec3('0x52')][_0x9ec3('0xa7')](this,_0x489958[_0x9ec3('0x15d')]);if(_0x137d02){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')]['callerid'],_0x489958[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x162')]=function(_0x597476){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x163'),_0x597476['label']));if(!this['isConfigured'](_0x597476[_0x9ec3('0x15d')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x597476,'no\x20find\x20by\x20configured');}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x164'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));var _0xc18e08=this[_0x9ec3('0x51')][_0x9ec3('0xa7')](this,_0x597476['findBy']);if(_0xc18e08){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476['findBy']));this['channel']['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x165')};}else{logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x166')]=function(_0x5ae8fc){logger['info'](util[_0x9ec3('0x54')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5ae8fc[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x5ae8fc['operation'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x5ae8fc,'no\x20operation\x20configured');}this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format'](_0x9ec3('0x167'),_0x5ae8fc[_0x9ec3('0x168')]));var _0x417a73=eval(_0x5ae8fc[_0x9ec3('0x168')]);if(!this[_0x9ec3('0x86')](_0x5ae8fc[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x169'));}var _0x568065=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x5ae8fc[_0x9ec3('0xdc')]);if(!_0x568065){return this[_0x9ec3('0xd')]['error'](_0x5ae8fc,_0x9ec3('0x119'));}if(_[_0x9ec3('0x9c')](_0x417a73)){var _0x301159=this;_0x417a73[_0x9ec3('0xdd')](function(_0x1fbce6,_0x1af158){_0x301159[_0x9ec3('0xd')][_0x9ec3('0xa0')](util['format'](_0x9ec3('0x16a'),_0x568065,_0x1af158),_0x1fbce6);});return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('variable\x20%s[key]\x20set',_0x568065));}else{return this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x568065,_0x417a73);}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xb')]=function(_0x56dd18){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x16b'),_0x56dd18[_0x9ec3('0x36')]));if(_0x56dd18[_0x9ec3('0xa8')]===0x0){return this[_0x9ec3('0xa9')](_0x56dd18);}_0x56dd18[_0x9ec3('0xa8')]-=0x1;if(!this[_0x9ec3('0x86')](_0x56dd18['file_id'])){return this[_0x9ec3('0xd')]['error'](_0x56dd18,_0x9ec3('0x114'));}var _0x379aed=this['getSound'][_0x9ec3('0xa7')](this,_0x56dd18['file_id']);if(!_0x379aed){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x56dd18,_0x9ec3('0x16c'));}var _0x1aaf8c=this['channel'][_0x9ec3('0x115')](_0x379aed,_0x56dd18['response'],_0x56dd18[_0x9ec3('0x16d')]);var _0x53f208=_0x1aaf8c['result'];if(_0x1aaf8c[_0x9ec3('0xae')]===-0x1){this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x56dd18,'-1');return _0x1aaf8c;}else if(_0x1aaf8c[_0x9ec3('0x151')]===_0x9ec3('0x66')){_0x1aaf8c[_0x9ec3('0xae')]=_0x1aaf8c[_0x9ec3('0xae')][_0x9ec3('0x9d')]>0x0?_0x1aaf8c[_0x9ec3('0xae')]:'t';}else if(_[_0x9ec3('0x43')](_0x1aaf8c[_0x9ec3('0xae')])){_0x1aaf8c[_0x9ec3('0xae')]='#';_0x53f208='#';}if(!this['isConfigured'](_0x56dd18[_0x9ec3('0xdc')])){this['channel'][_0x9ec3('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x443a3b=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x56dd18['variable_id']);if(!_0x443a3b){return this['channel'][_0x9ec3('0x2b')](_0x56dd18,_0x9ec3('0x119'));}this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x443a3b,_0x53f208);}this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x56dd18,_0x53f208);return _0x1aaf8c;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xab')]=function(_0x3fa738){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x16e'),_0x3fa738[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')]['noop'](_0x3fa738[_0x9ec3('0x16f')]||_0x3fa738[_0x9ec3('0x36')]);};AGIVertices[_0x9ec3('0x10')]['pause']=function(_0x4a47a9){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x170'),_0x4a47a9[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4a47a9['findBy'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4a47a9,_0x9ec3('0x15e'));}logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x164'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x4a47a9[_0x9ec3('0x15d')]));var _0x43e876=this[_0x9ec3('0x4d')]['sync'](this,_0x4a47a9[_0x9ec3('0x171')]);var _0x782c27=this[_0x9ec3('0x4e')][_0x9ec3('0xa7')](this,_0x4a47a9[_0x9ec3('0x15d')],_0x43e876);if(_0x782c27){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x15f'),this[_0x9ec3('0xd')]['callerid'],_0x4a47a9[_0x9ec3('0x15d')]));this['channel'][_0x9ec3('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x4a47a9[_0x9ec3('0x15d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')]['callerid'],_0x4a47a9[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x4a47a9[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices['prototype'][_0x9ec3('0x172')]=function(_0x5c2973){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x173'),_0x5c2973[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x5c2973[_0x9ec3('0x113')])){return this['channel'][_0x9ec3('0x2b')](_0x5c2973,_0x9ec3('0x114'));}var _0x5e535c=this[_0x9ec3('0x1d')][_0x9ec3('0xa7')](this,_0x5c2973['file_id']);if(!_0x5e535c){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x5c2973,'no\x20file\x20audio\x20found');}var _0x2b2c24=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0x174'),[_0x5e535c,_0x5c2973[_0x9ec3('0xe5')]]);if(_0x2b2c24['result']===-0x1){return _0x2b2c24;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x175'),_0x9ec3('0x174'),_0x5e535c));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x176')]=function(_0x53f036){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x177'),_0x53f036[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x53f036[_0x9ec3('0x178')])){return this[_0x9ec3('0xd')]['error'](_0x53f036,_0x9ec3('0x179'));}var _0x5c1b38='';var _0x4a4ede=parseInt(_0x53f036[_0x9ec3('0x178')],0xa);if(isNaN(_0x4a4ede)){_0x5c1b38=_0x53f036['queue_id'];}else{_0x5c1b38=this['getVoiceQueue'][_0x9ec3('0xa7')](this,_0x53f036[_0x9ec3('0x178')]);if(!_0x5c1b38){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x53f036,_0x9ec3('0x17a'));}}var _0x1990c5='';if(this[_0x9ec3('0x86')](_0x53f036[_0x9ec3('0x113')])){var _0x30a67c=this['getSound'][_0x9ec3('0xa7')](this,_0x53f036[_0x9ec3('0x113')]);if(_0x30a67c){_0x1990c5=_0x30a67c;}}this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x53f036,_0x5c1b38);if(_0x53f036[_0x9ec3('0xe5')][_0x9ec3('0x17b')]('x')<0x0){_0x53f036[_0x9ec3('0xe5')]+='x';}if(_0x53f036['opts'][_0x9ec3('0x17b')]('X')<0x0){_0x53f036[_0x9ec3('0xe5')]+='X';}this[_0x9ec3('0xd')][_0x9ec3('0xa0')]('XMCS-QUEUE',_0x5c1b38?_0x5c1b38[_0x9ec3('0x17c')]():'');var _0x2b4869=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0x17d'),[_0x5c1b38,_0x53f036[_0x9ec3('0xe5')],_0x53f036['url'],_0x1990c5,_0x53f036[_0x9ec3('0x66')],_0x53f036[_0x9ec3('0x8')],_0x53f036[_0x9ec3('0x17e')],_0x53f036[_0x9ec3('0x17f')],'',_0x53f036[_0x9ec3('0x180')]]);if(_0x2b4869['result']===-0x1){return _0x2b4869;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x175'),'QUEUE',_0x5c1b38));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x181')]=function(_0x24c50e){logger['info'](util['format'](_0x9ec3('0x182'),_0x24c50e[_0x9ec3('0x36')]));var _0x5cc028=_0x24c50e[_0x9ec3('0x183')]||_0x9ec3('0x131');var _0x195eb6=util[_0x9ec3('0x54')](_0x9ec3('0x184'),this[_0x9ec3('0xd')][_0x9ec3('0x50')],rs[_0x9ec3('0x11b')](0x5));var _0x538a2b=util[_0x9ec3('0x54')](_0x9ec3('0x185'),FILES_PATH,_0x195eb6,_0x5cc028);var _0x11978d=util[_0x9ec3('0x54')]('%s/recordings/%s',FILES_PATH,_0x195eb6);this[_0x9ec3('0x3a')][_0x9ec3('0xa7')](this,_0x24c50e,_0x195eb6,_0x538a2b);this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x9ec3('0x186'),_0x195eb6);logger[_0x9ec3('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x11978d,_0x5cc028,_0x24c50e[_0x9ec3('0x187')],_0x24c50e[_0x9ec3('0x66')]);return this['channel'][_0x9ec3('0x134')](_0x11978d,_0x5cc028,_0x24c50e[_0x9ec3('0x187')],_0x24c50e['timeout'],undefined,!![]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x188')]=function(_0x15d92d){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x189'),_0x15d92d[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x15d92d[_0x9ec3('0x64')])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x18a'));}var _0xe067d9=this['restAPI'][_0x9ec3('0xa7')](this,_0x15d92d);logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Response:',util['inspect'](_0xe067d9,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x15d92d[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x18b'));}var _0x46173b=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x15d92d[_0x9ec3('0xdc')]);if(!_0x46173b){return this['channel'][_0x9ec3('0x2b')](_0x15d92d,_0x9ec3('0x119'));}this[_0x9ec3('0xd')]['setVariable'](util[_0x9ec3('0x54')](_0x9ec3('0x18c'),_0x46173b),_0xe067d9[_0x9ec3('0x76')]?_0xe067d9[_0x9ec3('0x76')]:_0x9ec3('0x18d'));this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x18e'),_0x46173b),_0xe067d9[_0x9ec3('0x18f')]?_0xe067d9['statusMessage']:'OK');if(_0xe067d9[_0x9ec3('0x74')]){try{this[_0x9ec3('0x9e')](_0xe067d9['body'],_0x46173b);}catch(_0x4a1d8c){logger[_0x9ec3('0x2b')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x46173b));}}return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x190'),_0x46173b));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x191')]=function(_0x1f30ec){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x192'),_0x1f30ec[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')]['sayDigits'](_0x1f30ec[_0x9ec3('0x193')][_0x9ec3('0x58')](/\s+/g,''),_0x1f30ec['escape_digits']);};AGIVertices['prototype'][_0x9ec3('0x194')]=function(_0x3aa3f0){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x195'),_0x3aa3f0['label']));return this[_0x9ec3('0xd')][_0x9ec3('0x196')](_0x3aa3f0['number']['replace'](/\s+/g,''),_0x3aa3f0['escape_digits']);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x197')]=function(_0x11aa1a){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x198'),_0x11aa1a[_0x9ec3('0x36')]));return this['channel'][_0x9ec3('0x199')](_0x11aa1a[_0x9ec3('0x5c')],_0x11aa1a['escape_digits']);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x19a')]=function(_0x27bc2d){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x27bc2d['label']));if(!this[_0x9ec3('0x86')](_0x27bc2d[_0x9ec3('0x19b')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('no\x20mail\x20account\x20configured');}var _0x3a2868=this[_0x9ec3('0x21')][_0x9ec3('0xa7')](this,_0x27bc2d[_0x9ec3('0x19b')]);if(!_0x3a2868||!_0x3a2868[_0x9ec3('0x19c')]){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x27bc2d,_0x9ec3('0x19d'));}var _0x3471e0={'from':util[_0x9ec3('0x54')](_0x9ec3('0x19e'),_0x3a2868['name'],_0x3a2868['email']||_0x3a2868[_0x9ec3('0x19c')][_0x9ec3('0x19f')]),'to':_0x27bc2d['to']||'','cc':_0x27bc2d['cc']||'','bcc':_0x27bc2d['bcc']||'','subject':_0x27bc2d[_0x9ec3('0x1a0')],'html':_0x27bc2d['text'],'text':_0x27bc2d[_0x9ec3('0x5c')]};if(this[_0x9ec3('0x86')](_0x27bc2d['template_id'])){}logger[_0x9ec3('0xe0')]('sendMail\x20message',JSON[_0x9ec3('0x73')](_0x3471e0));this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x27bc2d,_0x27bc2d[_0x9ec3('0x19b')]);this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1a1'),_0x3a2868['name']));this['sendMailMessage'][_0x9ec3('0xa7')](this,_0x3a2868['smtpOptions'],_0x3471e0);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1a2'));};AGIVertices[_0x9ec3('0x10')]['sendFax']=function(_0x3fa3ef){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1a3'),_0x3fa3ef[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x1a4'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1a5')]=function(_0x2221db){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1a6'),_0x2221db[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x2221db['sms_account_id'])){return this['channel'][_0x9ec3('0xab')]('no\x20sms\x20account\x20configured');}var _0x13f35e=this[_0x9ec3('0x33')][_0x9ec3('0xa7')](this,_0x2221db['sms_account_id']);if(!_0x13f35e){return this['channel'][_0x9ec3('0x2b')](_0x2221db,_0x9ec3('0x1a7'));}var _0x3f149f={'body':_0x2221db[_0x9ec3('0x1a8')],'phone':_0x2221db['to']||'','SmsAccountId':_0x13f35e['id']};logger[_0x9ec3('0xe0')](_0x9ec3('0x1a9'),JSON[_0x9ec3('0x73')](_0x3f149f));this[_0x9ec3('0xdb')]['sync'](this,_0x2221db,_0x2221db['sms_account_id']);this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1aa'),_0x13f35e[_0x9ec3('0x13')]));this[_0x9ec3('0x35')]['sync'](this,_0x3f149f);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1ab'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1ac')]=function(_0x353a24){logger['info'](util['format'](_0x9ec3('0x1ad'),_0x353a24['label']));if(!this[_0x9ec3('0x86')](_0x353a24[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x353a24,'no\x20variable\x20selected');}var _0x33d41d=this[_0x9ec3('0xa4')]['sync'](this,_0x353a24[_0x9ec3('0xdc')]);if(!_0x33d41d){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x353a24,_0x9ec3('0x119'));}return this['channel'][_0x9ec3('0xa0')](_0x33d41d,_0x353a24[_0x9ec3('0x1ae')]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1af')]=function(_0xddee15){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1b0'),_0xddee15[_0x9ec3('0x36')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1b1'));var _0x212f78=this[_0x9ec3('0xd')][_0x9ec3('0xa4')](_0x9ec3('0x1b2'));if(!_[_0x9ec3('0x43')](_0x212f78[_0x9ec3('0x151')])){this[_0x9ec3('0xd')]['uniqueid']=_0x212f78[_0x9ec3('0x151')];}if(_0xddee15['answer']===_0x9ec3('0x1b3')){this['channel'][_0x9ec3('0xab')](_0x9ec3('0x1b4'));return this[_0x9ec3('0xd')][_0x9ec3('0xbf')]();}return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x1b5'));};AGIVertices[_0x9ec3('0x10')]['subproject']=function(_0x4d918a){logger['info'](util['format'](_0x9ec3('0x1b6'),_0x4d918a[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4d918a['project_id'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4d918a,_0x9ec3('0x1b7'));}var _0x510ffc=this[_0x9ec3('0x17')][_0x9ec3('0xa7')](this,_0x4d918a['project_id']);if(!this[_0x9ec3('0x86')](_0x510ffc)){return this['channel'][_0x9ec3('0x2b')](_0x4d918a,util['format'](_0x9ec3('0x1b8'),_0x4d918a[_0x9ec3('0x1b9')]));}if(_0x510ffc===this[_0x9ec3('0xd')][_0x9ec3('0x38')]){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4d918a,_0x9ec3('0x1ba'));}this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x4d918a,_0x510ffc);var _0x330d3d=this[_0x9ec3('0xd')]['exec']('AGI',util[_0x9ec3('0x54')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x9ec3('0x8')]['host']||_0x9ec3('0x1bb'),_0x510ffc,this['channel']['arg_1']));if(_0x330d3d[_0x9ec3('0xae')]===-0x1){return _0x330d3d;}return this['channel']['noop'](util['format'](_0x9ec3('0x175'),'AGI',_0x510ffc));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1bc')]=function(_0x54b21d){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x1bd'),_0x54b21d[_0x9ec3('0x36')]));var _0x416181=this['shellCommand'][_0x9ec3('0xa7')](this,_0x54b21d[_0x9ec3('0xbd')]);this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x54b21d,_0x54b21d[_0x9ec3('0xbd')]);if(this[_0x9ec3('0x86')](_0x54b21d[_0x9ec3('0xdc')])){var _0x231289=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x54b21d[_0x9ec3('0xdc')]);if(_0x231289){this['channel'][_0x9ec3('0xa0')](_0x231289,_0x416181);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x54b21d[_0x9ec3('0xbd')],_0x231289));}}return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x1be'),_0x54b21d[_0x9ec3('0xbd')]));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1bf')]=function(_0x440133){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1c0'),_0x440133[_0x9ec3('0x36')]));_0x440133[_0x9ec3('0x5c')]=_0x440133['text'][_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9ec3('0x86')](_0x440133['apiKey'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1c1'));}if(!this[_0x9ec3('0x86')](_0x440133[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c2'),_0x440133[_0x9ec3('0x5c')]));var _0x293723=this[_0x9ec3('0x59')][_0x9ec3('0xa7')](this,_0x440133);if(_0x293723){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c3'),_0x293723));var _0x5d224a=this[_0x9ec3('0xd')][_0x9ec3('0x103')](_0x293723);try{fs['unlink'](_0x293723+_0x9ec3('0x105'));}catch(_0x5fd47f){logger[_0x9ec3('0x2b')](_0x5fd47f);}return _0x5d224a;}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x440133,_0x9ec3('0x1c4'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1c5')]=function(_0x1676a1){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1676a1[_0x9ec3('0x36')]));_0x1676a1[_0x9ec3('0x5c')]=_0x1676a1[_0x9ec3('0x5c')][_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1676a1['text'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('no\x20text\x20configured');}this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c6'),_0x1676a1[_0x9ec3('0x5c')]));var _0x2319e0=this['googleTTS'][_0x9ec3('0xa7')](this,_0x1676a1);if(_0x2319e0){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c7'),_0x2319e0));var _0x3bdc82=this['channel']['streamFile'](_0x2319e0);try{fs[_0x9ec3('0x104')](_0x2319e0+_0x9ec3('0x105'));}catch(_0x2105ec){logger[_0x9ec3('0x2b')](_0x2105ec);}return _0x3bdc82;}return this[_0x9ec3('0xd')]['error'](_0x1676a1,_0x9ec3('0x1c8'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1c9')]=function(_0x493194){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x493194[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x493194[_0x9ec3('0x15d')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x493194,_0x9ec3('0x15e'));}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x164'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));var _0x2ba433=this[_0x9ec3('0x1ca')]['sync'](this,_0x493194[_0x9ec3('0x15d')]);if(_0x2ba433){logger['info'](util['format'](_0x9ec3('0x15f'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')]['noop'](util['format'](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x165')};}else{logger['info'](util[_0x9ec3('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices[_0x9ec3('0x10')]['voicemail']=function(_0x25b582){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1cb'),_0x25b582[_0x9ec3('0x36')]));var _0xcc4749=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0x1cc'),[_0x25b582[_0x9ec3('0x1cd')],_0x25b582['options']]);if(_0xcc4749['result']===-0x1){return _0xcc4749;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x175'),'VOICEMAIL',_0x25b582[_0x9ec3('0x1cd')]));};AGIVertices['prototype'][_0x9ec3('0x1ce')]=function(_0x14907f){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x14907f[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x14907f['variable_id'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x14907f,_0x9ec3('0x1cf'));}var _0x1f2295=this['getVariable']['sync'](this,_0x14907f['variable_id']);if(!_0x1f2295){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x14907f,_0x9ec3('0x119'));}var _0x572d4f=this['channel'][_0x9ec3('0xa4')](_0x1f2295);return{'code':0xc8,'result':_0x572d4f[_0x9ec3('0x151')]?_0x572d4f[_0x9ec3('0x151')]:'-'};};String[_0x9ec3('0x10')][_0x9ec3('0xa3')]=function(_0x3b5384,_0xd42c2b){return this[_0x9ec3('0xa2')](_0x3b5384)[_0x9ec3('0x1d0')](_0xd42c2b);};module[_0x9ec3('0x1d1')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index d189b2b..ef0a745 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 _0x78c8=['syncAgentConnectPreview','milliseconds','seconds','prototype','lastPauseAt','timer','update','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','ACW','mandatoryDispositionPause','Action','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','YYYY-MM-DD\x20HH:mm:ss','updateAcw','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','pauseType','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','attended','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview'];(function(_0x3c1edb,_0x153e78){var _0x4cb05a=function(_0x22fb82){while(--_0x22fb82){_0x3c1edb['push'](_0x3c1edb['shift']());}};_0x4cb05a(++_0x153e78);}(_0x78c8,0x98));var _0x878c=function(_0x2c249a,_0x4a6096){_0x2c249a=_0x2c249a-0x0;var _0x3edb89=_0x78c8[_0x2c249a];return _0x3edb89;};'use strict';var _=require('lodash');var moment=require(_0x878c('0x0'));var ami=require('../ami');var logger=require(_0x878c('0x1'))(_0x878c('0x2'));var RpcUser=require(_0x878c('0x3'));var RpcVoiceAgentReport=require(_0x878c('0x4'));function Acw(_0x162b92){this[_0x878c('0x5')]=_0x162b92[_0x878c('0x5')];this[_0x878c('0x6')]=_0x162b92[_0x878c('0x6')];this[_0x878c('0x7')]=_0x162b92['timers'];this[_0x878c('0x8')]={};ami['on'](_0x878c('0x9'),this[_0x878c('0xa')][_0x878c('0xb')](this));ami['on'](_0x878c('0xc'),this[_0x878c('0xd')][_0x878c('0xb')](this));ami['on']('hangup',this[_0x878c('0xe')][_0x878c('0xb')](this));ami['on'](_0x878c('0xf'),this[_0x878c('0x10')][_0x878c('0xb')](this));ami['on'](_0x878c('0x11'),this[_0x878c('0x12')]['bind'](this));ami['on'](_0x878c('0x13'),this[_0x878c('0x14')][_0x878c('0xb')](this));ami['on'](_0x878c('0x15'),this[_0x878c('0x16')][_0x878c('0xb')](this));}function getDiff(_0x5a9cc9){var _0x3bf395=moment()[_0x878c('0x17')](0x0);var _0xec31aa=moment(_0x5a9cc9)['milliseconds'](0x0);return _0x3bf395['diff'](_0xec31aa,_0x878c('0x18'));}Acw[_0x878c('0x19')]['updateAcw']=function(_0x3ffc24,_0x2b3598){var _0xa27a31=this;var _0x3867ee=getDiff(_0xa27a31[_0x878c('0x7')][_0x3ffc24][_0x878c('0x1a')]);clearTimeout(_0xa27a31['timers'][_0x3ffc24][_0x878c('0x1b')]);_0xa27a31['timers'][_0x3ffc24][_0x878c('0x1b')]=![];return RpcVoiceAgentReport[_0x878c('0x1c')]({'acwtime':_0x3867ee},_0xa27a31['timers'][_0x3ffc24][_0x878c('0x1d')],_0x3ffc24)[_0x878c('0x1e')](function(_0x499ebc){logger[_0x878c('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x2b3598,_0x3867ee,_0x499ebc);})[_0x878c('0x20')](function(_0x30ca81){logger[_0x878c('0x21')](_0x878c('0x22'),_0x2b3598,_0x30ca81);})[_0x878c('0x23')](function(){delete _0xa27a31[_0x878c('0x7')][_0x3ffc24];});};Acw[_0x878c('0x19')][_0x878c('0x24')]=function(_0x3ab188){try{var _0x3d5413=this;var _0x2dbb49=this[_0x878c('0x8')][_0x3ab188][_0x878c('0x25')];var _0xa23c3c=this[_0x878c('0x8')][_0x3ab188][_0x878c('0x26')];var _0x18f3d5=this[_0x878c('0x5')][_0xa23c3c];var _0x2931cb=![];var _0x3675e5=_0x878c('0x27');if(_0x18f3d5['mandatoryDisposition']&&_0x18f3d5[_0x878c('0x28')]['name']){_0x2931cb=!![];_0x3675e5=_0x18f3d5[_0x878c('0x28')]['name'];}return ami[_0x878c('0x29')]({'action':'QueuePause','interface':_0x2dbb49,'paused':!![],'reason':_0x3675e5})[_0x878c('0x1e')](function(){if(_0x3d5413[_0x878c('0x6')][_0x2dbb49]){return RpcUser[_0x878c('0x2a')](_0x3d5413[_0x878c('0x6')][_0x2dbb49]['id'])[_0x878c('0x1e')](function(_0x8a7a0){if(!_0x8a7a0||_0x8a7a0[_0x878c('0x2b')]){logger[_0x878c('0x1f')](_0x878c('0x2c'),_0x3ab188,_0x2dbb49,_0xa23c3c);return;}logger[_0x878c('0x1f')](_0x878c('0x2d'),_0x3ab188,_0x2dbb49,_0xa23c3c);var _0x4f8678=_0x3d5413[_0x878c('0x8')][_0x3ab188]['attended']&&_0x3d5413[_0x878c('0x8')][_0x3ab188]['destlinkedid']?_0x3d5413['channels'][_0x3ab188][_0x878c('0x2e')]:_0x3ab188;return RpcUser['savePause'](_0x3d5413['agents'][_0x2dbb49],_0x3675e5,_0x4f8678)[_0x878c('0x1e')](function(_0xa187e3){_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x2f')]-=0x1;_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x30')]+=0x1;return _0xa187e3;});})[_0x878c('0x1e')](function(_0x42d256){if(_0x2931cb||!_0x42d256){return;}_0x3d5413[_0x878c('0x7')][_0x2dbb49]={};logger[_0x878c('0x1f')](_0x878c('0x31'),_0x3ab188,_0x3d5413['voiceQueues'][_0xa23c3c][_0x878c('0x32')],_0x2dbb49,_0xa23c3c);_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x1b')]=setTimeout(_0x3d5413['stopAcw'][_0x878c('0xb')](_0x3d5413,_0x2dbb49),_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x32')]*0x3e8);_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x1a')]=moment()['format'](_0x878c('0x33'));_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x1d')]=_0x3ab188;_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x26')]=_0xa23c3c;_0x3d5413[_0x878c('0x7')][_0x2dbb49][_0x878c('0x34')]=_0x3d5413[_0x878c('0x34')][_0x878c('0xb')](_0x3d5413,_0x2dbb49,_0x3ab188);});}})[_0x878c('0x20')](function(){logger['error'](_0x878c('0x31'),_0x3ab188,_0x3d5413[_0x878c('0x5')][_0xa23c3c][_0x878c('0x32')],_0x2dbb49,_0xa23c3c);})[_0x878c('0x23')](function(){delete _0x3d5413['channels'][_0x3ab188];});}catch(_0x5348c1){logger[_0x878c('0x21')]('[ACW][START]\x20%s',_0x5348c1[_0x878c('0x35')]);}};Acw[_0x878c('0x19')][_0x878c('0x36')]=function(_0x34f455){try{var _0x2b7b24=this;if(_0x2b7b24[_0x878c('0x7')][_0x34f455]){_0x2b7b24[_0x878c('0x7')][_0x34f455]['timer']=![];var _0x17fca6=_0x2b7b24['timers'][_0x34f455][_0x878c('0x1d')];var _0x426aa7=_0x2b7b24['timers'][_0x34f455]['queue'];var _0x566142=_0x2b7b24[_0x878c('0x5')][_0x426aa7][_0x878c('0x32')];logger[_0x878c('0x1f')](_0x878c('0x37'),_0x17fca6,_0x34f455);RpcUser['getAgent'](this[_0x878c('0x6')][_0x34f455]['id'])[_0x878c('0x1e')](function(_0x438eb7){if(_0x438eb7[_0x878c('0x38')]===_0x878c('0x27')){return RpcUser['saveUnpause'](_0x2b7b24[_0x878c('0x6')][_0x34f455]);}});RpcVoiceAgentReport[_0x878c('0x1c')]({'acwtime':_0x566142,'agentacw':!![]},_0x17fca6,_0x34f455)[_0x878c('0x1e')](function(_0x28bece){logger['info'](_0x878c('0x39'),_0x17fca6,_0x566142,_0x28bece);})['catch'](function(_0x2f9e0c){logger[_0x878c('0x21')](_0x878c('0x22'),_0x17fca6,_0x2f9e0c);});}else{logger[_0x878c('0x21')](_0x878c('0x3a'),_0x34f455);if(_0x2b7b24[_0x878c('0x7')]){logger[_0x878c('0x1f')](_0x878c('0x3b'),JSON[_0x878c('0x3c')](_0x2b7b24[_0x878c('0x7')]));}}}catch(_0x5c9c5b){logger[_0x878c('0x21')](_0x878c('0x3d'),_0x5c9c5b[_0x878c('0x35')]);}};Acw[_0x878c('0x19')]['syncAgentConnect']=function(_0x4913a0){try{if(this[_0x878c('0x5')][_0x4913a0[_0x878c('0x26')]]&&(this[_0x878c('0x5')][_0x4913a0['queue']]['acw']||this['voiceQueues'][_0x4913a0[_0x878c('0x26')]][_0x878c('0x3e')])){if(this['agents'][_0x4913a0['interface']]){this[_0x878c('0x8')][_0x4913a0['uniqueid']]={'queue':_0x4913a0[_0x878c('0x26')],'interface':_0x4913a0[_0x878c('0x25')],'destlinkedid':_0x4913a0[_0x878c('0x2e')]};}}}catch(_0x19cb79){logger[_0x878c('0x21')]('[ACW][syncAgentConnect]\x20%s',_0x19cb79[_0x878c('0x35')]);}};Acw[_0x878c('0x19')]['syncAgentConnectPreview']=function(_0x21b132){try{if(this[_0x878c('0x5')][_0x21b132[_0x878c('0x26')]]&&(this['voiceQueues'][_0x21b132[_0x878c('0x26')]]['acw']||this[_0x878c('0x5')][_0x21b132[_0x878c('0x26')]]['mandatoryDisposition'])){if(this['agents'][_0x21b132[_0x878c('0x25')]]){this[_0x878c('0x8')][_0x21b132[_0x878c('0x1d')]]={'queue':_0x21b132['queue'],'interface':_0x21b132[_0x878c('0x25')]};}}}catch(_0x4db14d){logger[_0x878c('0x21')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4db14d[_0x878c('0x35')]);}};Acw[_0x878c('0x19')][_0x878c('0xd')]=function(_0x32ee06){try{if(this[_0x878c('0x8')][_0x32ee06[_0x878c('0x1d')]]&&_[_0x878c('0x3f')](this['channels'][_0x32ee06['uniqueid']]['attended'])){logger[_0x878c('0x1f')](_0x878c('0x40'),_0x32ee06[_0x878c('0x1d')]);this[_0x878c('0x24')](_0x32ee06[_0x878c('0x1d')]);}else if(this[_0x878c('0x8')][_0x32ee06[_0x878c('0x41')]]&&_[_0x878c('0x3f')](this[_0x878c('0x8')][_0x32ee06['linkedid']][_0x878c('0x42')])){logger[_0x878c('0x1f')](_0x878c('0x43'),_0x32ee06[_0x878c('0x41')]);this[_0x878c('0x24')](_0x32ee06[_0x878c('0x41')]);}}catch(_0x3b211b){logger[_0x878c('0x21')](_0x878c('0x44'),_0x3b211b[_0x878c('0x35')]);}};Acw['prototype']['syncHangup']=function(_0x122922){try{if(this[_0x878c('0x8')][_0x122922[_0x878c('0x1d')]]&&this[_0x878c('0x8')][_0x122922['uniqueid']][_0x878c('0x42')]){logger[_0x878c('0x1f')](_0x878c('0x45'),_0x122922['uniqueid']);this[_0x878c('0x24')](_0x122922[_0x878c('0x1d')]);}else if(this[_0x878c('0x8')][_0x122922['linkedid']]&&this[_0x878c('0x8')][_0x122922['linkedid']]['attended']){logger[_0x878c('0x1f')](_0x878c('0x46'),_0x122922[_0x878c('0x41')]);this[_0x878c('0x24')](_0x122922[_0x878c('0x41')]);}}catch(_0x44a0a8){logger[_0x878c('0x21')](_0x878c('0x47'),_0x44a0a8[_0x878c('0x35')]);}};Acw[_0x878c('0x19')]['syncAttendedTransfer']=function(_0x5b824a){try{if(!_[_0x878c('0x48')](this['channels'][_0x5b824a[_0x878c('0x49')]])){this[_0x878c('0x24')](_0x5b824a[_0x878c('0x49')]);if(this['channels'][_0x5b824a[_0x878c('0x4a')]]){this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4a')]][_0x878c('0x42')]=!![];this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4b')]]=this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4a')]];delete this[_0x878c('0x8')][_0x5b824a['secondtransfereruniqueid']];}}else if(!_[_0x878c('0x48')](this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4b')]])){this['startAcw'](_0x5b824a['transfertargetuniqueid']);if(this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4c')]]){this['channels'][_0x5b824a[_0x878c('0x4c')]]['attended']=!![];this[_0x878c('0x8')][_0x5b824a[_0x878c('0x49')]]=this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4c')]];delete this[_0x878c('0x8')][_0x5b824a[_0x878c('0x4c')]];}}}catch(_0xeee390){logger[_0x878c('0x21')](_0x878c('0x4d'),_0xeee390[_0x878c('0x35')]);}};Acw[_0x878c('0x19')][_0x878c('0x14')]=function(_0x4a446b){try{if(this[_0x878c('0x8')][_0x4a446b[_0x878c('0x4e')]]){logger['info'](_0x878c('0x4f'),JSON['stringify'](_0x4a446b[_0x878c('0x4e')]));this[_0x878c('0x24')](_0x4a446b[_0x878c('0x4e')]);}else if(this[_0x878c('0x8')][_0x4a446b[_0x878c('0x50')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x878c('0x3c')](_0x4a446b[_0x878c('0x50')]));this[_0x878c('0x24')](_0x4a446b[_0x878c('0x50')]);}}catch(_0x38da83){logger['error'](_0x878c('0x51'),_0x38da83[_0x878c('0x35')]);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0xa1a09f){try{if(this[_0x878c('0x5')][_0xa1a09f[_0x878c('0x26')]]&&this[_0x878c('0x5')][_0xa1a09f['queue']][_0x878c('0x52')]===_0x878c('0x53')){if(this[_0x878c('0x6')][_0xa1a09f[_0x878c('0x25')]]){logger[_0x878c('0x1f')](_0x878c('0x54'),_0xa1a09f[_0x878c('0x1d')],_0xa1a09f[_0x878c('0x25')],_0xa1a09f[_0x878c('0x26')]);return RpcUser[_0x878c('0x55')](this['agents'][_0xa1a09f[_0x878c('0x25')]],'Auto-Pause',_0xa1a09f[_0x878c('0x1d')]);}}}catch(_0x1cf7be){logger['error'](_0x878c('0x56'),_0x1cf7be[_0x878c('0x35')]);}};module['exports']=Acw; \ No newline at end of file +var _0xd2e8=['channels','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','error','finally','startAcw','queue','ACW','name','mandatoryDispositionPause','QueuePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','catch','[ACW][START]\x20%s','stopAcw','getAgent','pauseType','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','stringify','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0xd2e8,0x151));var _0x8d2e=function(_0x1c3429,_0x11d159){_0x1c3429=_0x1c3429-0x0;var _0x1609bd=_0xd2e8[_0x1c3429];return _0x1609bd;};'use strict';var _=require('lodash');var moment=require(_0x8d2e('0x0'));var ami=require('../ami');var logger=require(_0x8d2e('0x1'))(_0x8d2e('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x8d2e('0x3'));function Acw(_0x231092){this[_0x8d2e('0x4')]=_0x231092[_0x8d2e('0x4')];this['agents']=_0x231092[_0x8d2e('0x5')];this[_0x8d2e('0x6')]=_0x231092[_0x8d2e('0x6')];this[_0x8d2e('0x7')]={};ami['on'](_0x8d2e('0x8'),this[_0x8d2e('0x9')]['bind'](this));ami['on']('hanguprequest',this[_0x8d2e('0xa')][_0x8d2e('0xb')](this));ami['on'](_0x8d2e('0xc'),this[_0x8d2e('0xd')][_0x8d2e('0xb')](this));ami['on'](_0x8d2e('0xe'),this['syncAgentRingNoAnswer']['bind'](this));ami['on']('attendedtransfer',this[_0x8d2e('0xf')][_0x8d2e('0xb')](this));ami['on'](_0x8d2e('0x10'),this[_0x8d2e('0x11')][_0x8d2e('0xb')](this));ami['on'](_0x8d2e('0x12'),this[_0x8d2e('0x13')][_0x8d2e('0xb')](this));}function getDiff(_0xc26e52){var _0x144127=moment()['milliseconds'](0x0);var _0x25694c=moment(_0xc26e52)[_0x8d2e('0x14')](0x0);return _0x144127[_0x8d2e('0x15')](_0x25694c,'seconds');}Acw[_0x8d2e('0x16')][_0x8d2e('0x17')]=function(_0x588197,_0x265f68){var _0x5b5e16=this;var _0x855493=getDiff(_0x5b5e16['timers'][_0x588197][_0x8d2e('0x18')]);clearTimeout(_0x5b5e16[_0x8d2e('0x6')][_0x588197][_0x8d2e('0x19')]);_0x5b5e16['timers'][_0x588197]['timer']=![];return RpcVoiceAgentReport[_0x8d2e('0x1a')]({'acwtime':_0x855493},_0x5b5e16['timers'][_0x588197][_0x8d2e('0x1b')],_0x588197)[_0x8d2e('0x1c')](function(_0x442b8e){logger[_0x8d2e('0x1d')](_0x8d2e('0x1e'),_0x265f68,_0x855493,_0x442b8e);})['catch'](function(_0x411484){logger[_0x8d2e('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x265f68,_0x411484);})[_0x8d2e('0x20')](function(){delete _0x5b5e16['timers'][_0x588197];});};Acw[_0x8d2e('0x16')][_0x8d2e('0x21')]=function(_0x29faa4){try{var _0x5b1735=this;var _0x4b15cb=this[_0x8d2e('0x7')][_0x29faa4]['interface'];var _0x20364c=this[_0x8d2e('0x7')][_0x29faa4][_0x8d2e('0x22')];var _0x472c09=this[_0x8d2e('0x4')][_0x20364c];var _0x3df392=![];var _0xa4b897=_0x8d2e('0x23');if(_0x472c09['mandatoryDisposition']&&_0x472c09['mandatoryDispositionPause'][_0x8d2e('0x24')]){_0x3df392=!![];_0xa4b897=_0x472c09[_0x8d2e('0x25')][_0x8d2e('0x24')];}return ami['Action']({'action':_0x8d2e('0x26'),'interface':_0x4b15cb,'paused':!![],'reason':_0xa4b897})[_0x8d2e('0x1c')](function(){if(_0x5b1735[_0x8d2e('0x5')][_0x4b15cb]){return RpcUser['getAgent'](_0x5b1735[_0x8d2e('0x5')][_0x4b15cb]['id'])[_0x8d2e('0x1c')](function(_0x36dd74){if(!_0x36dd74||_0x36dd74['voicePause']){logger[_0x8d2e('0x1d')](_0x8d2e('0x27'),_0x29faa4,_0x4b15cb,_0x20364c);return;}logger['info'](_0x8d2e('0x28'),_0x29faa4,_0x4b15cb,_0x20364c);var _0x544266=_0x5b1735[_0x8d2e('0x7')][_0x29faa4][_0x8d2e('0x29')]&&_0x5b1735[_0x8d2e('0x7')][_0x29faa4][_0x8d2e('0x2a')]?_0x5b1735['channels'][_0x29faa4][_0x8d2e('0x2a')]:_0x29faa4;return RpcUser['savePause'](_0x5b1735[_0x8d2e('0x5')][_0x4b15cb],_0xa4b897,_0x544266)[_0x8d2e('0x1c')](function(_0x526b61){_0x5b1735[_0x8d2e('0x4')][_0x20364c][_0x8d2e('0x2b')]-=0x1;_0x5b1735['voiceQueues'][_0x20364c][_0x8d2e('0x2c')]+=0x1;return _0x526b61;});})[_0x8d2e('0x1c')](function(_0x3d6664){if(_0x3df392||!_0x3d6664){return;}_0x5b1735['timers'][_0x4b15cb]={};logger[_0x8d2e('0x1d')](_0x8d2e('0x2d'),_0x29faa4,_0x5b1735[_0x8d2e('0x4')][_0x20364c][_0x8d2e('0x2e')],_0x4b15cb,_0x20364c);_0x5b1735['timers'][_0x4b15cb][_0x8d2e('0x19')]=setTimeout(_0x5b1735['stopAcw'][_0x8d2e('0xb')](_0x5b1735,_0x4b15cb),_0x5b1735[_0x8d2e('0x4')][_0x20364c][_0x8d2e('0x2e')]*0x3e8);_0x5b1735[_0x8d2e('0x6')][_0x4b15cb][_0x8d2e('0x18')]=moment()[_0x8d2e('0x2f')](_0x8d2e('0x30'));_0x5b1735[_0x8d2e('0x6')][_0x4b15cb][_0x8d2e('0x1b')]=_0x29faa4;_0x5b1735['timers'][_0x4b15cb][_0x8d2e('0x22')]=_0x20364c;_0x5b1735[_0x8d2e('0x6')][_0x4b15cb]['updateAcw']=_0x5b1735[_0x8d2e('0x17')][_0x8d2e('0xb')](_0x5b1735,_0x4b15cb,_0x29faa4);});}})[_0x8d2e('0x31')](function(){logger[_0x8d2e('0x1f')](_0x8d2e('0x2d'),_0x29faa4,_0x5b1735['voiceQueues'][_0x20364c]['acwTimeout'],_0x4b15cb,_0x20364c);})[_0x8d2e('0x20')](function(){delete _0x5b1735['channels'][_0x29faa4];});}catch(_0x1aeee8){logger[_0x8d2e('0x1f')](_0x8d2e('0x32'),_0x1aeee8['message']);}};Acw[_0x8d2e('0x16')][_0x8d2e('0x33')]=function(_0x1eab2d){try{var _0xa9c6c6=this;if(_0xa9c6c6[_0x8d2e('0x6')][_0x1eab2d]){_0xa9c6c6[_0x8d2e('0x6')][_0x1eab2d]['timer']=![];var _0x2870d5=_0xa9c6c6[_0x8d2e('0x6')][_0x1eab2d][_0x8d2e('0x1b')];var _0x519f4b=_0xa9c6c6[_0x8d2e('0x6')][_0x1eab2d][_0x8d2e('0x22')];var _0x22ca7d=_0xa9c6c6[_0x8d2e('0x4')][_0x519f4b]['acwTimeout'];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x2870d5,_0x1eab2d);RpcUser[_0x8d2e('0x34')](this[_0x8d2e('0x5')][_0x1eab2d]['id'])[_0x8d2e('0x1c')](function(_0x22df67){if(_0x22df67[_0x8d2e('0x35')]==='ACW'){return RpcUser['saveUnpause'](_0xa9c6c6[_0x8d2e('0x5')][_0x1eab2d]);}});RpcVoiceAgentReport[_0x8d2e('0x1a')]({'acwtime':_0x22ca7d,'agentacw':!![]},_0x2870d5,_0x1eab2d)[_0x8d2e('0x1c')](function(_0x1f33d2){logger[_0x8d2e('0x1d')]('[%s][UPDATE][ACWTIME:%s]',_0x2870d5,_0x22ca7d,_0x1f33d2);})[_0x8d2e('0x31')](function(_0x1fa9b7){logger['error'](_0x8d2e('0x36'),_0x2870d5,_0x1fa9b7);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1eab2d);if(_0xa9c6c6[_0x8d2e('0x6')]){logger[_0x8d2e('0x1d')](_0x8d2e('0x37'),JSON['stringify'](_0xa9c6c6['timers']));}}}catch(_0x1825dd){logger['error'](_0x8d2e('0x38'),_0x1825dd['message']);}};Acw[_0x8d2e('0x16')][_0x8d2e('0x9')]=function(_0x439278){try{if(this[_0x8d2e('0x4')][_0x439278[_0x8d2e('0x22')]]&&(this[_0x8d2e('0x4')][_0x439278[_0x8d2e('0x22')]][_0x8d2e('0x2')]||this[_0x8d2e('0x4')][_0x439278['queue']][_0x8d2e('0x39')])){if(this[_0x8d2e('0x5')][_0x439278[_0x8d2e('0x3a')]]){this[_0x8d2e('0x7')][_0x439278[_0x8d2e('0x1b')]]={'queue':_0x439278[_0x8d2e('0x22')],'interface':_0x439278[_0x8d2e('0x3a')],'destlinkedid':_0x439278['destlinkedid']};}}}catch(_0x55638b){logger[_0x8d2e('0x1f')](_0x8d2e('0x3b'),_0x55638b[_0x8d2e('0x3c')]);}};Acw[_0x8d2e('0x16')][_0x8d2e('0x13')]=function(_0x2c51cc){try{if(this[_0x8d2e('0x4')][_0x2c51cc[_0x8d2e('0x22')]]&&(this[_0x8d2e('0x4')][_0x2c51cc[_0x8d2e('0x22')]][_0x8d2e('0x2')]||this[_0x8d2e('0x4')][_0x2c51cc['queue']][_0x8d2e('0x39')])){if(this[_0x8d2e('0x5')][_0x2c51cc['interface']]){this[_0x8d2e('0x7')][_0x2c51cc[_0x8d2e('0x1b')]]={'queue':_0x2c51cc[_0x8d2e('0x22')],'interface':_0x2c51cc[_0x8d2e('0x3a')]};}}}catch(_0x107ab7){logger[_0x8d2e('0x1f')](_0x8d2e('0x3d'),_0x107ab7[_0x8d2e('0x3c')]);}};Acw[_0x8d2e('0x16')]['syncHangupRequest']=function(_0x530ce4){try{if(this[_0x8d2e('0x7')][_0x530ce4[_0x8d2e('0x1b')]]&&_[_0x8d2e('0x3e')](this[_0x8d2e('0x7')][_0x530ce4[_0x8d2e('0x1b')]]['attended'])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x530ce4[_0x8d2e('0x1b')]);this['startAcw'](_0x530ce4[_0x8d2e('0x1b')]);}else if(this[_0x8d2e('0x7')][_0x530ce4[_0x8d2e('0x3f')]]&&_['isUndefined'](this[_0x8d2e('0x7')][_0x530ce4[_0x8d2e('0x3f')]][_0x8d2e('0x29')])){logger[_0x8d2e('0x1d')](_0x8d2e('0x40'),_0x530ce4['linkedid']);this[_0x8d2e('0x21')](_0x530ce4[_0x8d2e('0x3f')]);}}catch(_0x33efd9){logger[_0x8d2e('0x1f')](_0x8d2e('0x41'),_0x33efd9[_0x8d2e('0x3c')]);}};Acw[_0x8d2e('0x16')][_0x8d2e('0xd')]=function(_0x464b5e){try{if(this[_0x8d2e('0x7')][_0x464b5e[_0x8d2e('0x1b')]]&&this['channels'][_0x464b5e[_0x8d2e('0x1b')]][_0x8d2e('0x29')]){logger[_0x8d2e('0x1d')](_0x8d2e('0x42'),_0x464b5e[_0x8d2e('0x1b')]);this[_0x8d2e('0x21')](_0x464b5e[_0x8d2e('0x1b')]);}else if(this[_0x8d2e('0x7')][_0x464b5e[_0x8d2e('0x3f')]]&&this[_0x8d2e('0x7')][_0x464b5e[_0x8d2e('0x3f')]][_0x8d2e('0x29')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x464b5e['linkedid']);this[_0x8d2e('0x21')](_0x464b5e[_0x8d2e('0x3f')]);}}catch(_0x21ce7d){logger[_0x8d2e('0x1f')](_0x8d2e('0x43'),_0x21ce7d[_0x8d2e('0x3c')]);}};Acw['prototype'][_0x8d2e('0xf')]=function(_0x1ec7c5){try{if(!_[_0x8d2e('0x44')](this['channels'][_0x1ec7c5['transfereeuniqueid']])){this[_0x8d2e('0x21')](_0x1ec7c5['transfereeuniqueid']);if(this['channels'][_0x1ec7c5[_0x8d2e('0x45')]]){this['channels'][_0x1ec7c5[_0x8d2e('0x45')]][_0x8d2e('0x29')]=!![];this[_0x8d2e('0x7')][_0x1ec7c5[_0x8d2e('0x46')]]=this[_0x8d2e('0x7')][_0x1ec7c5['secondtransfereruniqueid']];delete this[_0x8d2e('0x7')][_0x1ec7c5[_0x8d2e('0x45')]];}}else if(!_[_0x8d2e('0x44')](this[_0x8d2e('0x7')][_0x1ec7c5[_0x8d2e('0x46')]])){this[_0x8d2e('0x21')](_0x1ec7c5['transfertargetuniqueid']);if(this[_0x8d2e('0x7')][_0x1ec7c5[_0x8d2e('0x47')]]){this[_0x8d2e('0x7')][_0x1ec7c5[_0x8d2e('0x47')]]['attended']=!![];this[_0x8d2e('0x7')][_0x1ec7c5[_0x8d2e('0x48')]]=this[_0x8d2e('0x7')][_0x1ec7c5['origtransfereruniqueid']];delete this[_0x8d2e('0x7')][_0x1ec7c5[_0x8d2e('0x47')]];}}}catch(_0x4fd34f){logger[_0x8d2e('0x1f')](_0x8d2e('0x49'),_0x4fd34f['message']);}};Acw[_0x8d2e('0x16')][_0x8d2e('0x11')]=function(_0x13542e){try{if(this[_0x8d2e('0x7')][_0x13542e['transfereruniqueid']]){logger[_0x8d2e('0x1d')](_0x8d2e('0x4a'),JSON['stringify'](_0x13542e[_0x8d2e('0x4b')]));this[_0x8d2e('0x21')](_0x13542e['transfereruniqueid']);}else if(this['channels'][_0x13542e[_0x8d2e('0x4c')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x8d2e('0x4d')](_0x13542e[_0x8d2e('0x4c')]));this[_0x8d2e('0x21')](_0x13542e['transfererlinkedid']);}}catch(_0x1661c5){logger[_0x8d2e('0x1f')](_0x8d2e('0x4e'),_0x1661c5[_0x8d2e('0x3c')]);}};Acw[_0x8d2e('0x16')][_0x8d2e('0x4f')]=function(_0x4cc728){try{if(this[_0x8d2e('0x4')][_0x4cc728[_0x8d2e('0x22')]]&&this[_0x8d2e('0x4')][_0x4cc728['queue']][_0x8d2e('0x50')]===_0x8d2e('0x51')){if(this['agents'][_0x4cc728[_0x8d2e('0x3a')]]){logger[_0x8d2e('0x1d')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4cc728['uniqueid'],_0x4cc728['interface'],_0x4cc728['queue']);return RpcUser[_0x8d2e('0x52')](this[_0x8d2e('0x5')][_0x4cc728[_0x8d2e('0x3a')]],_0x8d2e('0x53'),_0x4cc728['uniqueid']);}}}catch(_0x1badf9){logger[_0x8d2e('0x1f')](_0x8d2e('0x54'),_0x1badf9[_0x8d2e('0x3c')]);}};module[_0x8d2e('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c904a1b..439c4cd 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 _0xaaa2=['actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','../../config/logger','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x344ade,_0x43e083){var _0x2d3cd6=function(_0x3b91d9){while(--_0x3b91d9){_0x344ade['push'](_0x344ade['shift']());}};_0x2d3cd6(++_0x43e083);}(_0xaaa2,0x1b8));var _0x2aaa=function(_0x791a0c,_0x30d85d){_0x791a0c=_0x791a0c-0x0;var _0x41e3b8=_0xaaa2[_0x791a0c];return _0x41e3b8;};'use strict';var Manager=require(_0x2aaa('0x0'));var BPromise=require('bluebird');var util=require('util');var logger=require(_0x2aaa('0x1'))(_0x2aaa('0x2'));var config=require(_0x2aaa('0x3'));var ami=new Manager(config[_0x2aaa('0x4')][_0x2aaa('0x5')],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x6')],config[_0x2aaa('0x4')]['password'],!![]);ami[_0x2aaa('0x7')]();ami[_0x2aaa('0x8')]=BPromise[_0x2aaa('0x9')](ami[_0x2aaa('0xa')]);function error(_0x165bc2){logger['error'](util[_0x2aaa('0xb')](_0x2aaa('0xc'),config['asterisk']['username'],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')],util[_0x2aaa('0xd')](_0x165bc2,![],null)));}function close(){logger[_0x2aaa('0xe')](util[_0x2aaa('0xb')](_0x2aaa('0xf'),config['asterisk']['username'],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')]));}ami[_0x2aaa('0x10')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x11')});};};ami[_0x2aaa('0x12')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x13')});};};ami[_0x2aaa('0x14')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x15')});};};ami[_0x2aaa('0x16')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x17')});};};ami[_0x2aaa('0x18')]=function(){return function(){return ami[_0x2aaa('0x8')]({'action':_0x2aaa('0x19')});};};function connect(){logger[_0x2aaa('0x1a')](util[_0x2aaa('0xb')](_0x2aaa('0x1b'),config['asterisk'][_0x2aaa('0x6')],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')]));ami[_0x2aaa('0x1c')](_0x2aaa('0xe'),error);ami[_0x2aaa('0x1c')](_0x2aaa('0x1d'),close);}ami['on'](_0x2aaa('0x1e'),connect);ami['on']('shutdown',function(_0x3741b0){logger[_0x2aaa('0x1a')](util[_0x2aaa('0xb')](_0x2aaa('0x1f'),config['asterisk'][_0x2aaa('0x6')],config['asterisk']['ip'],config[_0x2aaa('0x4')]['port'],util['inspect'](_0x3741b0,![],null)));});ami['on'](_0x2aaa('0x20'),function(){logger[_0x2aaa('0x1a')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x2aaa('0x4')][_0x2aaa('0x6')],config[_0x2aaa('0x4')]['ip'],config[_0x2aaa('0x4')][_0x2aaa('0x5')]));return Promise[_0x2aaa('0x21')]()[_0x2aaa('0x22')](ami[_0x2aaa('0x10')]())[_0x2aaa('0x22')](ami[_0x2aaa('0x12')]())['then'](ami[_0x2aaa('0x14')]())[_0x2aaa('0x22')](ami['actionQueueSummary']())['then'](ami[_0x2aaa('0x18')]())[_0x2aaa('0x23')](function(_0x5635a3){logger[_0x2aaa('0xe')](_0x2aaa('0x24'),util[_0x2aaa('0xd')](_0x5635a3,{'showHidden':![],'depth':null}));});});ami['once'](_0x2aaa('0xe'),error);ami[_0x2aaa('0x1c')]('close',close);module[_0x2aaa('0x25')]=ami; \ No newline at end of file +var _0x55a6=['connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','[ami.js][fullybooted]','inspect','exports','asterisk-manager','util','../../config/logger','ami','../../config/environment','port','asterisk','username','password','keepConnected','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close'];(function(_0x34688c,_0x28a920){var _0x5f1bfa=function(_0x345c23){while(--_0x345c23){_0x34688c['push'](_0x34688c['shift']());}};_0x5f1bfa(++_0x28a920);}(_0x55a6,0x123));var _0x655a=function(_0x486ec1,_0x4a432f){_0x486ec1=_0x486ec1-0x0;var _0x297c79=_0x55a6[_0x486ec1];return _0x297c79;};'use strict';var Manager=require(_0x655a('0x0'));var BPromise=require('bluebird');var util=require(_0x655a('0x1'));var logger=require(_0x655a('0x2'))(_0x655a('0x3'));var config=require(_0x655a('0x4'));var ami=new Manager(config['asterisk'][_0x655a('0x5')],config[_0x655a('0x6')]['ip'],config['asterisk'][_0x655a('0x7')],config['asterisk'][_0x655a('0x8')],!![]);ami[_0x655a('0x9')]();ami['Action']=BPromise[_0x655a('0xa')](ami[_0x655a('0xb')]);function error(_0x1ea1ab){logger[_0x655a('0xc')](util['format'](_0x655a('0xd'),config[_0x655a('0x6')]['username'],config[_0x655a('0x6')]['ip'],config['asterisk'][_0x655a('0x5')],util['inspect'](_0x1ea1ab,![],null)));}function close(){logger[_0x655a('0xc')](util[_0x655a('0xe')](_0x655a('0xf'),config['asterisk']['username'],config['asterisk']['ip'],config['asterisk'][_0x655a('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x655a('0x10')]({'action':_0x655a('0x11')});};};ami[_0x655a('0x12')]=function(){return function(){return ami[_0x655a('0x10')]({'action':_0x655a('0x13')});};};ami[_0x655a('0x14')]=function(){return function(){return ami[_0x655a('0x10')]({'action':_0x655a('0x15')});};};ami[_0x655a('0x16')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x655a('0x17')]=function(){return function(){return ami[_0x655a('0x10')]({'action':_0x655a('0x18')});};};function connect(){logger[_0x655a('0x19')](util['format'](_0x655a('0x1a'),config[_0x655a('0x6')][_0x655a('0x7')],config[_0x655a('0x6')]['ip'],config[_0x655a('0x6')][_0x655a('0x5')]));ami['once'](_0x655a('0xc'),error);ami[_0x655a('0x1b')](_0x655a('0x1c'),close);}ami['on'](_0x655a('0x1d'),connect);ami['on'](_0x655a('0x1e'),function(_0x130762){logger[_0x655a('0x19')](util[_0x655a('0xe')](_0x655a('0x1f'),config['asterisk'][_0x655a('0x7')],config[_0x655a('0x6')]['ip'],config[_0x655a('0x6')]['port'],util['inspect'](_0x130762,![],null)));});ami['on'](_0x655a('0x20'),function(){logger[_0x655a('0x19')](util['format'](_0x655a('0x21'),config[_0x655a('0x6')][_0x655a('0x7')],config['asterisk']['ip'],config['asterisk'][_0x655a('0x5')]));return Promise[_0x655a('0x22')]()[_0x655a('0x23')](ami[_0x655a('0x24')]())[_0x655a('0x23')](ami[_0x655a('0x12')]())[_0x655a('0x23')](ami[_0x655a('0x14')]())['then'](ami[_0x655a('0x16')]())[_0x655a('0x23')](ami[_0x655a('0x17')]())['catch'](function(_0xe50f27){logger[_0x655a('0xc')](_0x655a('0x25'),util[_0x655a('0x26')](_0xe50f27,{'showHidden':![],'depth':null}));});});ami[_0x655a('0x1b')](_0x655a('0xc'),error);ami[_0x655a('0x1b')](_0x655a('0x1c'),close);module[_0x655a('0x27')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8cec7a0..8b3099c 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 _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x550095,_0x1465f3){var _0x28eff9=function(_0x73d2e2){while(--_0x73d2e2){_0x550095['push'](_0x550095['shift']());}};_0x28eff9(++_0x1465f3);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1e59c8,_0x65ebb0){_0x1e59c8=_0x1e59c8-0x0;var _0x1006cc=_0x9ffd[_0x1e59c8];return _0x1006cc;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x70e0,0x17b));var _0x070e=function(_0x2b7823,_0xa4de2a){_0x2b7823=_0x2b7823-0x0;var _0x569742=_0x70e0[_0x2b7823];return _0x569742;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 90ec20b..38d814f 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 _0x9789=['voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','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','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','temp','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','message','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isEmpty','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:save','originated','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','SIP/%s','status','reachable','checkIsTrunkReachable','Trunk','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Failure','EMPTY_INTERVAL','ifTime','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','timezones','indexOf','true','catch','content','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','Global:\x20','Timezone:\x20','resetActiveCalls','undefined','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','\x20Interval\x20is\x20overtime:\x20','isGlobal','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','reason','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','state','statedesc','Drop','dropreason','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','countdropretry','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','Abandoned','channel','actionid','strategy','roundrobin','isNil','locked','paused','stateinterface','rrmemory','[Catch][Preview][syncQueueStatusComplete]','finally','rescheduleContact','queueBookedRR','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','idHopper','run','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','Normal\x20Clearing','[syncAgentComplete]','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','user:dialPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','Agent','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','isOutboundQueue','XMD-VOICEQUEUEID','Contact','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','TrunkBackup','xcally-motion-dialer','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][Abandoned]','dialMachineRetryFrequency','[callProgressDetecting]','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','dialAgentRejectRetryFrequency','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','erlangCalls','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','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalDroppedCallsTimeout','[CatchErlangB]','agentBusyFactor','predictiveIntervalPauses','busyFactor','milliseconds','[handlePredictive]','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\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','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','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','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\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','Umin\x20=\x20','util','uuid','ioredis','./utils','./utils/hopper','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queuesSummary','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name'];(function(_0x395097,_0x6babd0){var _0x19f253=function(_0x4ba8fa){while(--_0x4ba8fa){_0x395097['push'](_0x395097['shift']());}};_0x19f253(++_0x6babd0);}(_0x9789,0x1d0));var _0x9978=function(_0x5e7913,_0x3d4099){_0x5e7913=_0x5e7913-0x0;var _0x1d50a2=_0x9789[_0x5e7913];return _0x1d50a2;};'use strict';var util=require(_0x9978('0x0'));var _=require('lodash');var uuid=require(_0x9978('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require(_0x9978('0x2'));var utils=require(_0x9978('0x3'));var hopperUtils=require(_0x9978('0x4'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x9978('0x5'))(_0x9978('0x6'));var loggerBooked=require(_0x9978('0x5'))('booked');var loggerPredictive=require(_0x9978('0x5'))('predictive');var loggerPredictiveCalls=require(_0x9978('0x5'))(_0x9978('0x7'));var loggerSyncQueueSummary=require(_0x9978('0x5'))(_0x9978('0x8'));var ami=require(_0x9978('0x9'));config[_0x9978('0xa')]=_[_0x9978('0xb')](config['redis'],{'host':_0x9978('0xc'),'port':0x18eb});var io=require(_0x9978('0xd'))(new Redis(config['redis']));var cmHopper=require(_0x9978('0xe'));var voiceQueueRt=require(_0x9978('0xf'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x9978('0x10'));var Action=require(_0x9978('0x11'));var History=require(_0x9978('0x12'));var Final=require(_0x9978('0x13'));var AgentComplete=require(_0x9978('0x14'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require('./models/hangup');var ipAgi=process[_0x9978('0x15')][_0x9978('0x16')]||_0x9978('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x9978('0x18')][_0x9978('0x19')]=function(_0x36af60){this['tail']=this[_0x9978('0x1a')]?this['tail']['finally'](_0x36af60):_0x36af60();};function Dialer(_0x7bbee4,_0x132d7f){this[_0x9978('0x1b')]=new Sequence();this[_0x9978('0x1c')]=_0x132d7f;this[_0x9978('0x1d')]=_0x7bbee4[_0x9978('0x1d')];this[_0x9978('0x1e')]=_0x7bbee4[_0x9978('0x1e')];this['agents']=_0x7bbee4[_0x9978('0x1f')];this[_0x9978('0x20')]=_0x7bbee4[_0x9978('0x20')];this[_0x9978('0x21')]=config[_0x9978('0x21')]||0x2;this[_0x9978('0x22')]={};this[_0x9978('0x23')]={};this['contactsId']={};this[_0x9978('0x24')]={};this[_0x9978('0x25')]={};this[_0x9978('0x26')]={};this[_0x9978('0x27')]={};this['ivrOriginated']={};this[_0x9978('0x28')]={};this['queueBookedRR']={};this[_0x9978('0x29')]={};ami['on'](_0x9978('0x2a'),this[_0x9978('0x2b')]['bind'](this));ami['on'](_0x9978('0x2c'),this[_0x9978('0x2d')][_0x9978('0x2e')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x9978('0x2e')](this));ami['on']('agentcomplete',this[_0x9978('0x2f')][_0x9978('0x2e')](this));ami['on'](_0x9978('0x30'),this['syncQueueSummary'][_0x9978('0x2e')](this));ami['on'](_0x9978('0x31'),this[_0x9978('0x32')][_0x9978('0x2e')](this));ami['on']('hangup',this[_0x9978('0x33')]['bind'](this));ami['on']('newexten',this[_0x9978('0x34')][_0x9978('0x2e')](this));ami['on']('varset',this[_0x9978('0x35')][_0x9978('0x2e')](this));ami['on'](_0x9978('0x36'),this[_0x9978('0x37')]['bind'](this));ami['on'](_0x9978('0x38'),this[_0x9978('0x39')][_0x9978('0x2e')](this));this[_0x9978('0x3a')]();this['loopClearZombieChannels']();RpcSetting[_0x9978('0x3b')]()[_0x9978('0x3c')](function(_0x4afa57){previewRecallmeReminderInterval=_0x4afa57[_0x9978('0x3d')];});}function isNotNull(_0x3f1a4d){return _0x3f1a4d!==null&&!_[_0x9978('0x3e')](_0x3f1a4d);}function msgResponse(_0x476d4a,_0x233e01,_0x4aad7d){return{'action':_0x476d4a,'response':_0x233e01,'message':_0x4aad7d,'stack':_0x4aad7d};}function emit(_0x239830,_0x4c8df0,_0x5d380d){io['to'](_0x239830)[_0x9978('0x3f')](_0x4c8df0,_0x5d380d);}function emitOutboundVoiceQueueSummary(_0x2f3348){if(_0x2f3348[_0x9978('0x40')]==='outbound'){logger[_0x9978('0x41')](_0x9978('0x42'),util[_0x9978('0x43')](_0x2f3348,{'showHidden':![],'depth':null}));emit(util[_0x9978('0x44')](_0x9978('0x45'),_0x2f3348[_0x9978('0x46')]),_0x9978('0x47'),_0x2f3348);}}function checkGetDataPredictive(_0x2f8545){if(isNotNull(_0x2f8545)&&!_['isEmpty'](_0x2f8545)){loggerPredictive['info'](_0x9978('0x48'));loggerPredictive[_0x9978('0x49')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f8545[_0x9978('0x4a')]);loggerPredictive[_0x9978('0x49')](_0x9978('0x4b'),_0x2f8545['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x9978('0x49')](_0x9978('0x4c'),_0x2f8545['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x9978('0x4d'),_0x2f8545['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x9978('0x49')](_0x9978('0x4e'),_0x2f8545[_0x9978('0x4f')]);loggerPredictive[_0x9978('0x49')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f8545[_0x9978('0x50')]);loggerPredictive['info'](_0x9978('0x51'));if(_0x2f8545[_0x9978('0x4a')]>0x0){if(!_['isUndefined'](_0x2f8545['predictiveIntervalAvgTalktime'])&&_0x2f8545[_0x9978('0x50')]>0x0){return!![];}loggerPredictive['info'](_0x9978('0x52'));if(!_[_0x9978('0x3e')](_0x2f8545['predictiveIntervalAvgHoldtime'])&&_0x2f8545[_0x9978('0x4f')]>0x0){return!![];}loggerPredictive[_0x9978('0x49')](_0x9978('0x53'));}else{loggerPredictive['info'](_0x9978('0x54'));}}else{loggerPredictive[_0x9978('0x49')](_0x9978('0x55'));}return![];}function mergeDataErlangB(_0x5b20d0){return function(_0x40b9ff){loggerPredictive[_0x9978('0x49')](_0x9978('0x56'));loggerPredictive[_0x9978('0x49')](_0x9978('0x57'),_0x40b9ff['erlangCalls']);loggerPredictive['info'](_0x9978('0x58'),_0x40b9ff[_0x9978('0x59')]);loggerPredictive['info'](_0x9978('0x5a'),_0x40b9ff[_0x9978('0x5b')]);loggerPredictive['info'](_0x9978('0x5c'),_0x40b9ff['erlangBusyFactor']);loggerPredictive[_0x9978('0x49')](_0x9978('0x5a'),_0x40b9ff[_0x9978('0x5b')]);loggerPredictive['info'](_0x9978('0x51'));_[_0x9978('0x5d')](_0x5b20d0,_0x40b9ff);};}function ifInterval(_0x2c8c63,_0x2dafad){if(_['isUndefined'](_0x2dafad)){return![];}return utils[_0x9978('0x5e')](undefined,_0x2dafad)<_0x2c8c63*0x3c;}function clearPredictiveAttributes(_0x2ef85b){if(_0x2ef85b[_0x9978('0x27')]){_0x2ef85b[_0x9978('0x27')]=undefined;loggerPredictive[_0x9978('0x41')](_0x2ef85b['name'],_0x9978('0x5f'));}if(_0x2ef85b[_0x9978('0x26')]){_0x2ef85b[_0x9978('0x26')]=undefined;loggerPredictive[_0x9978('0x41')](_0x2ef85b[_0x9978('0x46')],'startPredictive\x20value\x20cleared');}if(_0x2ef85b[_0x9978('0x60')]){clearInterval(_0x2ef85b[_0x9978('0x60')]);_0x2ef85b[_0x9978('0x60')]=undefined;loggerPredictive['debug'](_0x2ef85b[_0x9978('0x46')],_0x9978('0x61'));}}function loggerCatchPredictive(_0x38cd8d,_0x297d96){return function(_0x54bba9){loggerPredictive[_0x9978('0x62')](_0x297d96[_0x9978('0x46')],_0x38cd8d);loggerPredictive[_0x9978('0x62')](_0x54bba9['stack']);clearPredictiveAttributes(_0x297d96);};}function loggerCatch(_0x4103f3){return function(_0x35b8aa){logger[_0x9978('0x62')](_0x4103f3,util[_0x9978('0x43')](_0x35b8aa,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x40fa51,_0x2bd447,_0xc488b2){return function(_0x2023f1){utils[_0x9978('0x63')](_0x2bd447,_0xc488b2,0x0);_0x2bd447[_0x9978('0x64')]=0x0;logger[_0x9978('0x62')](_0x40fa51,util[_0x9978('0x43')](_0x2023f1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xb347b9){return function(_0x48bf4c){if(isNotNull(_0x48bf4c)&&isNotNull(_0x48bf4c[0x0])){if(_0x48bf4c[0x0][_0x9978('0x65')]>0x0){_0xb347b9['message']=utils[_0x9978('0x66')][_0x9978('0x67')];logger['info']('[getContactDialer2][ReScheduled]'+_0xb347b9[_0x9978('0x46')],_0x48bf4c[0x0][_0x9978('0x65')],_0x9978('0x68'));}else{_0xb347b9['message']=utils[_0x9978('0x66')][_0x9978('0x69')];logger[_0x9978('0x49')](_0x9978('0x6a')+_0xb347b9[_0x9978('0x46')]);}}};}function createObjHistory(_0x16249b,_0x2a69b8,_0x16523d,_0x328e61,_0xf6e776){_0x16249b[_0x9978('0x6b')]=_0x16523d;var _0x41ff1a=new Action(_0x16249b,_0x2a69b8);var _0x3cb421=new History(_0x41ff1a);_0x3cb421['state']=_0x328e61;_0x3cb421['statedesc']=_0xf6e776;_0x3cb421[_0x9978('0x6c')]=_0x41ff1a[_0x9978('0x6d')];return _0x3cb421;}function unlockQueueStatus(_0xd99079,_0xfa705d){setTimeout(function(){if(_[_0x9978('0x3e')](_0xd99079[_0x9978('0x6e')])){loggerBooked[_0x9978('0x62')](_0x9978('0x6f'),_0xfa705d);}_0xd99079[_0x9978('0x6e')]=!![];loggerBooked[_0x9978('0x49')](_0x9978('0x70'),_0xfa705d,JSON[_0x9978('0x71')](_[_0x9978('0x72')](_0xd99079,['name',_0x9978('0x6e')])));},0x1f3);}function checkInterval(_0x16eb55){return function(){if(!isNotNull(_0x16eb55[_0x9978('0x73')])){_0x16eb55['message']=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x16eb55[_0x9978('0x46')]+_0x9978('0x74');}if(!isNotNull(_0x16eb55[_0x9978('0x73')][_0x9978('0x75')])){_0x16eb55[_0x9978('0x6b')]=utils['CAMPAIGN_STATUS'][_0x9978('0x76')];throw _0x16eb55[_0x9978('0x46')]+_0x9978('0x74');}if(!isNotNull(_[_0x9978('0x77')](_0x16eb55[_0x9978('0x73')][_0x9978('0x75')]))){_0x16eb55[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x76')];throw _0x16eb55[_0x9978('0x46')]+_0x9978('0x74');}};}function checkIsIVRCampaignActive(_0x1bd05c){return function(){if(!utils[_0x9978('0x78')](_0x1bd05c)){_0x1bd05c[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x79')];throw _0x1bd05c[_0x9978('0x46')]+_0x9978('0x7a');}};}function emitCampaignSummary(_0x137f71){if(utils[_0x9978('0x7b')](_0x137f71)){emit(util[_0x9978('0x44')]('campaign:ivr:%s',_0x137f71[_0x9978('0x46')]),_0x9978('0x7c'),_0x137f71);}}function loggerCatchQueueSummary(_0x27a309,_0x2600b2){return function(_0x6cd125){clearPredictiveAttributes(_0x2600b2);emitCampaignSummary(_0x2600b2);loggerSyncQueueSummary[_0x9978('0x41')](_0x27a309,util['inspect'](_0x6cd125,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x375a0a){if(_0x375a0a['sendMessageOneNotActive']){if(_0x375a0a[_0x9978('0x7d')]===0x0){_0x375a0a[_0x9978('0x7e')]=![];_0x375a0a[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x79')];loggerSyncQueueSummary[_0x9978('0x41')](_0x9978('0x7f'),_0x375a0a[_0x9978('0x46')],'is\x20not\x20active');}else{_0x375a0a['message']=utils[_0x9978('0x66')][_0x9978('0x80')];loggerSyncQueueSummary[_0x9978('0x41')](_0x9978('0x7f'),_0x375a0a[_0x9978('0x46')],_0x9978('0x81'));}emitCampaignSummary(_0x375a0a);}}function myreject(_0xa32f96){return function(_0x109579){return _0xa32f96(msgResponse(_0x9978('0x82'),_0x9978('0x83'),JSON['stringify'](_0x109579)));};}Dialer[_0x9978('0x18')][_0x9978('0x84')]=function(_0x30efd2){return!_['isUndefined'](_0x30efd2)&&_0x30efd2&&!_[_0x9978('0x3e')](_0x30efd2[_0x9978('0x46')])&&!_[_0x9978('0x3e')](_0x30efd2['active'])&&_0x30efd2['active']&&(this['trunks'][util[_0x9978('0x44')](_0x9978('0x85'),_0x30efd2[_0x9978('0x46')])][_0x9978('0x86')]===_0x9978('0x87')||this[_0x9978('0x20')][util[_0x9978('0x44')](_0x9978('0x85'),_0x30efd2[_0x9978('0x46')])]['status']==='unmonitored');};Dialer[_0x9978('0x18')][_0x9978('0x88')]=function(_0x3ef491){var _0x13f0f0=this;return function(){if(!_0x13f0f0[_0x9978('0x84')](_0x3ef491[_0x9978('0x89')])){if(!_0x13f0f0['isTrunkReachable'](_0x3ef491['TrunkBackup'])){_0x3ef491['message']=utils[_0x9978('0x66')]['TRUNK_NOT_REACHABLE'];throw _0x3ef491[_0x9978('0x46')]+_0x9978('0x8a');}}};};Dialer[_0x9978('0x18')][_0x9978('0x8b')]=function(_0x13f64c,_0x258ff1,_0x4ebd79,_0x4feab1){var _0x2390d5=this;return function(){var _0x4c77ea=!![];return _0x2390d5[_0x9978('0x8c')](_0x13f64c,_0x258ff1,_0x4ebd79,_0x4feab1,_0x4c77ea);};};Dialer[_0x9978('0x18')]['checkIfTimeIntervals']=function(_0x16f81a,_0x2749a3,_0xe50039,_0x3c8674){var _0x20b2ca=this;return function(){var _0x80beae=![];return _0x20b2ca['ifTimeIvr'](_0x16f81a[_0x9978('0x75')],_0x2749a3,_0xe50039,_0x3c8674,_0x80beae);};};Dialer['prototype'][_0x9978('0x8c')]=function(_0x4599b7,_0x21ca93,_0xd19f5c,_0x362b9b,_0x459c47){var _0x1f189b=[];return new Promise(function(_0x87d103,_0x4cad4d){if(!isNotNull(_0x4599b7)){_0x362b9b[_0x9978('0x6b')]=utils[_0x9978('0x66')]['NULL_INTERVAL'];return _0x4cad4d(msgResponse('ifTime',_0x9978('0x8d'),_0xd19f5c+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x9978('0x77')](_0x4599b7)){_0x362b9b[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x8e')];return _0x4cad4d(msgResponse(_0x9978('0x8f'),_0x9978('0x8d'),_0xd19f5c+_0x9978('0x90')));}if(_0x21ca93&&_['isUndefined'](config['timezones'][_0x21ca93])){_0x362b9b[_0x9978('0x6b')]=utils['CAMPAIGN_STATUS'][_0x9978('0x91')];return _0x4cad4d(msgResponse('ifTime','Failure',_0xd19f5c+_0x9978('0x92')+_0x21ca93));}if(_[_0x9978('0x93')](_0x4599b7)){for(var _0x362e21=0x0;_0x362e21<_0x4599b7[_0x9978('0x94')];_0x362e21+=0x1){_0x1f189b[_0x9978('0x95')](ami[_0x9978('0x96')]({'action':'command','command':util['format'](_0x9978('0x97'),_0x4599b7[_0x362e21]['interval'],!_[_0x9978('0x3e')](config[_0x9978('0x98')][_0x21ca93])?_0x21ca93:'')})[_0x9978('0x3c')](function(_0x595b47){return _0x595b47['content'][_0x9978('0x99')](_0x9978('0x9a'))>=0x0;})[_0x9978('0x9b')](myreject(_0x4cad4d)));}}else{_0x1f189b[_0x9978('0x95')](ami[_0x9978('0x96')]({'action':'command','command':util[_0x9978('0x44')](_0x9978('0x97'),_0x4599b7,!_[_0x9978('0x3e')](config['timezones'][_0x21ca93])?_0x21ca93:'')})['then'](function(_0x392cb3){return _0x392cb3[_0x9978('0x9c')][_0x9978('0x99')]('true')>=0x0;})[_0x9978('0x9b')](myreject(_0x4cad4d)));}Promise[_0x9978('0x9d')](_0x1f189b)[_0x9978('0x3c')](function(_0x3e8f09){var _0x330782=_[_0x9978('0x9e')](_0x3e8f09);if(_0x330782){return _0x87d103(_0x330782);}else{_0x362b9b[_0x9978('0x6b')]=_0x459c47?utils['CAMPAIGN_STATUS'][_0x9978('0x9f')]:utils[_0x9978('0x66')][_0x9978('0xa0')];return _0x4cad4d(msgResponse('[ifTime][promiseAll]','Failure',_0x9978('0xa1')+_0x459c47+'\x20'+_0xd19f5c+'\x20Interval\x20is\x20overtime:\x20'+util[_0x9978('0x43')](_0x4599b7,{'showHidden':![],'depth':null})+_0x9978('0xa2')+_0x21ca93));}})[_0x9978('0x9b')](function(_0xd0ab37){return _0x4cad4d(msgResponse(_0x9978('0x8f'),_0x9978('0x8d'),JSON['stringify'](_0xd0ab37)));});});};Dialer[_0x9978('0x18')]['loopCampaigns']=function(){var _0x265152=this;return cmHopper[_0x9978('0xa3')]({'active':![]},{'where':{'active':!![]}})[_0x9978('0x3c')](function(){setInterval(function(){_0x265152['syncCampaigns']();},0x3e8);});};Dialer[_0x9978('0x18')]['syncCampaigns']=function(){var _0x2b5c1a=this;var _0x59e272;for(var _0x247ad2 in this['campaigns']){if(typeof this['campaigns'][_0x247ad2]!==_0x9978('0xa4')){_0x59e272=this['campaigns'][_0x247ad2];if(utils['isIVRCampaign'](_0x59e272)&&utils[_0x9978('0x78')](_0x59e272)){_0x59e272['sendMessageOneNotActive']=!![];Promise[_0x9978('0xa5')]()[_0x9978('0x3c')](checkIsIVRCampaignActive(_0x59e272))[_0x9978('0x3c')](checkInterval(_0x59e272))[_0x9978('0x3c')](_0x2b5c1a[_0x9978('0x88')](_0x59e272))['then'](_0x2b5c1a[_0x9978('0x8b')](_0x59e272[_0x9978('0xa6')],_0x59e272[_0x9978('0xa7')],_0x59e272[_0x9978('0x46')],_0x59e272))[_0x9978('0x3c')](_0x2b5c1a[_0x9978('0xa8')](_0x59e272[_0x9978('0x73')],_0x59e272[_0x9978('0xa7')],_0x59e272[_0x9978('0x46')],_0x59e272))[_0x9978('0x3c')](_0x2b5c1a[_0x9978('0xa9')](_0x59e272))[_0x9978('0x9b')](loggerCatchQueueSummary(_0x9978('0xaa'),_0x59e272));}else{notSendMessagesCampaign(_0x59e272);}}}};Dialer[_0x9978('0x18')][_0x9978('0xab')]=function(_0xce591e){if(_0xce591e[_0x9978('0xac')]!=='predictive'){clearPredictiveAttributes(_0xce591e);}switch(_0xce591e[_0x9978('0xac')]){case'progressive':this[_0x9978('0xad')](_0xce591e,0x1);break;case _0x9978('0xae'):this[_0x9978('0xad')](_0xce591e,_0xce591e[_0x9978('0xaf')]);break;case _0x9978('0xb0'):this[_0x9978('0xb0')](_0xce591e);break;case'booked':this[_0x9978('0xad')](_0xce591e,0x1);break;default:logger[_0x9978('0x62')](_0x9978('0xb1'),_0xce591e[_0x9978('0x46')],_0x9978('0xb2'));}};Dialer[_0x9978('0x18')]['ifTime']=function(_0x4b182e,_0x38c9f3){var _0x443a86=_0x4b182e[_0x9978('0xa7')];var _0x36b6d7=_0x38c9f3?_0x4b182e[_0x9978('0xa6')]:_0x4b182e['Interval'][_0x9978('0x75')];logger[_0x9978('0xb3')](_0x9978('0xb4'),_0x36b6d7,_0x443a86,_0x4b182e['name'],util[_0x9978('0x44')](_0x9978('0xb5'),_0x4b182e[_0x9978('0x46')],_0x4b182e['id']));var _0x53e561=null;return Interval[_0x9978('0xb6')](_0x36b6d7,_0x443a86)[_0x9978('0x3c')](function(_0x577886){if(_0x577886===!![]){return _0x577886;}else{_0x4b182e['message']=_0x38c9f3?utils[_0x9978('0x66')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x9978('0x66')][_0x9978('0xa0')];_0x53e561=msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x38c9f3+'\x20'+_0x4b182e[_0x9978('0x46')]+_0x9978('0xb7')+util[_0x9978('0x43')](_0x36b6d7,{'showHidden':![],'depth':null})+_0x9978('0xa2')+_0x443a86);}if(_0x53e561!==null){logger[_0x9978('0xb3')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x53e561);_0x53e561[_0x9978('0xb8')]=_0x38c9f3;throw _0x53e561;}})[_0x9978('0x9b')](function(_0x5a5cb7){logger[_0x9978('0x62')]('AMI\x20IfTime',_0x5a5cb7);throw msgResponse(_0x9978('0x82'),_0x9978('0x83'),util[_0x9978('0x43')](_0x5a5cb7,{'showHidden':![],'depth':null}));});};Dialer[_0x9978('0x18')]['syncAgentConnect']=function(_0x579b14){if(this[_0x9978('0x1d')][_0x579b14[_0x9978('0xb9')]]){if(this['uniqueId'][_0x579b14[_0x9978('0xba')]]&&this[_0x9978('0x24')][_0x579b14[_0x9978('0xba')]][_0x9978('0x40')]!==_0x9978('0xbb')){this[_0x9978('0xbc')](this['voiceQueues'][_0x579b14[_0x9978('0xb9')]]);this[_0x9978('0x24')][_0x579b14[_0x9978('0xba')]][_0x9978('0xbd')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));}}};Dialer['prototype'][_0x9978('0x2f')]=function(_0x22da9f){var _0x1d3f24=this[_0x9978('0x24')][_0x22da9f[_0x9978('0xba')]];if(this[_0x9978('0x1d')][_0x22da9f[_0x9978('0xb9')]]){if(_0x1d3f24&&_0x1d3f24[_0x9978('0x40')]!=='ivr'){delete this['uniqueId'][_0x22da9f[_0x9978('0xba')]];this[_0x9978('0x1d')][_0x22da9f[_0x9978('0xb9')]]['outboundAnswerCallsDay']+=0x1;var _0x2d3d7d=new AgentComplete(_0x1d3f24,_0x22da9f);if(_0x22da9f[_0x9978('0xbf')]==='agent'){_0x2d3d7d[_0x9978('0xc0')]=this['voiceQueues'][_0x22da9f[_0x9978('0xb9')]][_0x9978('0xc1')]&&this['voiceQueues'][_0x22da9f[_0x9978('0xb9')]]['dialAgiAfterHangupAgent']?moment()['format'](_0x9978('0xbe')):undefined;}hopperUtils[_0x9978('0xc2')](_0x2d3d7d)['catch'](loggerCatch(_0x9978('0xc3')));hopperUtils[_0x9978('0xc4')](_0x2d3d7d)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x9978('0x18')]['syncQueueCallerAbandon']=function(_0x31aefc){var _0x57ec15=this[_0x9978('0x24')][_0x31aefc['uniqueid']];var _0x45d30a=this;var _0x2b3a7a=![];var _0x2353f3;var _0x2ba650;if(this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]]){if(_0x57ec15&&_0x57ec15[_0x9978('0x40')]!==_0x9978('0xbb')){delete this[_0x9978('0x24')][_0x31aefc['uniqueid']];this[_0x9978('0xbc')](this[_0x9978('0x1d')][_0x31aefc['queue']]);_0x57ec15[_0x9978('0xc5')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));var _0x1f0275=new QueueCallerAbandon(_0x57ec15,_0x31aefc);if(utils[_0x9978('0x5e')](_0x57ec15[_0x9978('0xc5')],_0x57ec15[_0x9978('0xc6')])>=_0x57ec15[_0x9978('0xc7')]){this[_0x9978('0x1d')][_0x31aefc['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xc8')]+=0x1;this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xc9')]+=0x1;_0x1f0275[_0x9978('0xca')]=0xa;_0x1f0275[_0x9978('0xcb')]=_0x9978('0xcc');_0x1f0275[_0x9978('0xcd')]='TIMEOUT';_0x1f0275['agiafterat']=this['voiceQueues'][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xc1')]?moment()[_0x9978('0x44')](_0x9978('0xbe')):undefined;_0x1f0275['countdropretry']+=0x1;_0x1f0275[_0x9978('0xce')]+=0x1;_0x2353f3=this[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xcf')];_0x2ba650=this[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xd0')];hopperUtils[_0x9978('0xd1')](_0x1f0275,_0x1f0275['state'],_0x57ec15['voiceQueue'])[_0x9978('0x3c')](function(_0x24c148){_0x2b3a7a=_0x24c148[_0x9978('0xd2')]==0x1;if(_0x1f0275[_0x9978('0xd3')]>=_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xd4')]){_0x45d30a[_0x9978('0xd5')](_0x1f0275,_0x24c148['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x1f0275[_0x9978('0xd3')],'scheduledat':moment()[_0x9978('0xd6')](_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xcf')],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x57ec15[_0x9978('0xd8')],'ListId':_0x57ec15[_0x9978('0xd9')],'VoiceQueueId':_0x57ec15[_0x9978('0xda')]||undefined,'CampaignId':_0x57ec15[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0xdc')));var _0x2940d9=new History(_0x1f0275);_0x2940d9['state']=0xa;_0x2940d9[_0x9978('0xcb')]=_0x9978('0xcc');_0x2940d9['starttime']=moment()['format'](_0x9978('0xbe'));_0x2940d9[_0x9978('0x6c')]=_0x2940d9[_0x9978('0x6d')];_0x2940d9[_0x9978('0xdd')]=_0x1f0275[_0x9978('0xdd')];_0x2940d9[_0x9978('0xde')]=_0x1f0275['calleridnum'];hopperUtils[_0x9978('0xc2')](_0x2940d9)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x9978('0x3c')](function(){if(_0x2b3a7a)hopperUtils[_0x9978('0xdf')](_0x1f0275,_0x2353f3,_0x2ba650)['then'](function(){return 0x1;});});}else{this[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xe0')]+=0x1;this[_0x9978('0x1d')][_0x31aefc['queue']][_0x9978('0xe1')]+=0x1;_0x1f0275['state']=0xb;_0x1f0275[_0x9978('0xcb')]='Abandoned';_0x1f0275[_0x9978('0xcd')]=_0x9978('0xe2');_0x1f0275[_0x9978('0xe3')]+=0x1;_0x1f0275[_0x9978('0xce')]+=0x1;_0x2353f3=this[_0x9978('0x1d')][_0x31aefc['queue']][_0x9978('0xe4')];_0x2ba650=this[_0x9978('0x1d')][_0x31aefc['queue']][_0x9978('0xd0')];hopperUtils[_0x9978('0xd1')](_0x1f0275,_0x1f0275[_0x9978('0xca')],_0x57ec15['voiceQueue'])[_0x9978('0x3c')](function(_0x5f59bf){if(_0x1f0275[_0x9978('0xe3')]>=_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xe5')]){_0x45d30a[_0x9978('0xd5')](_0x1f0275,_0x5f59bf[_0x9978('0xd2')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x1f0275[_0x9978('0xe3')],'scheduledat':moment()['add'](_0x45d30a[_0x9978('0x1d')][_0x31aefc[_0x9978('0xb9')]][_0x9978('0xe4')],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x57ec15[_0x9978('0xd8')],'ListId':_0x57ec15[_0x9978('0xd9')],'VoiceQueueId':_0x57ec15[_0x9978('0xda')]||undefined,'CampaignId':_0x57ec15[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x109952=new History(_0x1f0275);_0x109952[_0x9978('0xca')]=0xb;_0x109952[_0x9978('0xcb')]=_0x9978('0xe6');_0x109952[_0x9978('0x6d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x109952[_0x9978('0x6c')]=_0x109952[_0x9978('0x6d')];_0x109952['calleridname']=_0x1f0275[_0x9978('0xdd')];_0x109952[_0x9978('0xde')]=_0x1f0275[_0x9978('0xde')];hopperUtils[_0x9978('0xc2')](_0x109952)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0x9978('0x3c')](function(){if(_0x2b3a7a)hopperUtils['swapAdditionalPhones'](_0x1f0275,_0x2353f3,_0x2ba650)[_0x9978('0x3c')](function(){return 0x1;});});}}}};Dialer[_0x9978('0x18')][_0x9978('0x34')]=function(_0x550c1a){if(this[_0x9978('0x23')][_0x550c1a['uniqueid']]){this['actions'][_0x550c1a[_0x9978('0xba')]][_0x9978('0xe7')]=_0x550c1a[_0x9978('0xe7')];}if(this[_0x9978('0x24')][_0x550c1a['uniqueid']]){this['uniqueId'][_0x550c1a[_0x9978('0xba')]][_0x9978('0xe7')]=_0x550c1a[_0x9978('0xe7')];}};Dialer[_0x9978('0x18')][_0x9978('0x37')]=function(_0x24f219){if(!this['actions'][_0x24f219['actionid']]){return;}var _0x572cb9=this['voiceQueues'][this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]]['queue']][_0x9978('0xe9')]||'rrmemory';if(_0x572cb9===_0x9978('0xea')){if(this[_0x9978('0x23')][_0x24f219['actionid']]&&_[_0x9978('0xeb')](this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]][_0x9978('0xec')])&&_0x24f219[_0x9978('0x86')]==='1'&&_0x24f219[_0x9978('0xed')]==='0'){if(this[_0x9978('0x1f')][_0x24f219['stateinterface']]){if(!this[_0x9978('0x1f')][_0x24f219[_0x9978('0xee')]][_0x9978('0xec')]){this[_0x9978('0x1f')][_0x24f219[_0x9978('0xee')]][_0x9978('0xec')]=!![];this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]]['locked']=!![];this[_0x9978('0x23')][_0x24f219['actionid']]['stateinterface']=_0x24f219['stateinterface'];}}}}else if(_0x572cb9==='rrmemory'){if(this['actions'][_0x24f219[_0x9978('0xe8')]]){if(this['agents'][_0x24f219[_0x9978('0xee')]]){this['actions'][_0x24f219[_0x9978('0xe8')]][_0x9978('0xee')]=_0x24f219[_0x9978('0xee')];if(_[_0x9978('0xeb')](this[_0x9978('0x28')][this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]][_0x9978('0xb9')]])){this[_0x9978('0x28')][this['actions'][_0x24f219[_0x9978('0xe8')]][_0x9978('0xb9')]]=[];}this['queueBooked'][this[_0x9978('0x23')][_0x24f219[_0x9978('0xe8')]][_0x9978('0xb9')]][_0x9978('0x95')](_[_0x9978('0x5d')](_[_0x9978('0x72')](this['actions'][_0x24f219[_0x9978('0xe8')]],['idHopper','stateinterface']),{'status':_0x24f219[_0x9978('0x86')],'paused':_0x24f219['paused']}));}}}};Dialer[_0x9978('0x18')][_0x9978('0x39')]=function(_0x520ba1){if(!this[_0x9978('0x23')][_0x520ba1['actionid']]){return;}var _0x119286=this;var _0x3ee40d=this[_0x9978('0x1d')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]];var _0x1e7689=_0x3ee40d[_0x9978('0xe9')]||_0x9978('0xef');if(_0x1e7689===_0x9978('0xea')){if(this['actions'][_0x520ba1['actionid']]&&this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xee')]){this[_0x9978('0x1c')]['run'](this['actions'][_0x520ba1[_0x9978('0xe8')]]['idHopper'],this[_0x9978('0x23')][_0x520ba1['actionid']]['stateinterface'])[_0x9978('0x9b')](function(_0x5c670b){logger[_0x9978('0x62')](_0x9978('0xf0'),util[_0x9978('0x43')](_0x5c670b,{'showHidden':![],'depth':null}));})[_0x9978('0xf1')](function(){_0x119286[_0x9978('0xbc')](_0x119286[_0x9978('0x1d')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]);_0x119286[_0x9978('0x1f')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xee')]]['locked']=![];delete _0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]];unlockQueueStatus(_0x3ee40d);});}else{this[_0x9978('0xbc')](this[_0x9978('0x1d')][this['actions'][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]);hopperUtils[_0x9978('0xf2')]({'active':![],'ContactId':this[_0x9978('0x23')][_0x520ba1['actionid']]['ContactId'],'ListId':this[_0x9978('0x23')][_0x520ba1['actionid']]['ListId'],'VoiceQueueId':this['actions'][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xda')]||undefined,'CampaignId':this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xdb')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x9978('0x23')][_0x520ba1['actionid']];unlockQueueStatus(_0x3ee40d);}}else if(_0x1e7689==='rrmemory'){var _0x44a19a;if(this[_0x9978('0x23')][_0x520ba1['actionid']]&&!_['isEmpty'](this['queueBooked'][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]])){if(this[_0x9978('0xf3')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]]['queue']]){this[_0x9978('0xf3')][_0x119286[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]=this['queueBookedRR'][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]?this[_0x9978('0xf3')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]:this[_0x9978('0x28')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]]?this[_0x9978('0x28')][this[_0x9978('0x23')][_0x520ba1['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0x9978('0x28')][this['actions'][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]][_0x9978('0xf4')]=this[_0x9978('0xf3')][this[_0x9978('0x23')][_0x520ba1[_0x9978('0xe8')]][_0x9978('0xb9')]];for(var _0x3f40a5=0x0;_0x3f40a5=_0x11d3f9[_0x9978('0x11e')]){_0x432601[_0x9978('0x11f')](_0x57678d,_0x142917,_0x36489b,_0x9978('0x120'));}else{if(_0x57678d[_0x9978('0x117')]>=_0x11d3f9[_0x9978('0x121')]){_0x432601[_0x9978('0x122')](_0x57678d,_0x142917,_0x36489b,_0x9978('0x123'));}else{hopperUtils[_0x9978('0xf2')]({'active':![],'countmachineretry':_0x57678d[_0x9978('0x117')],'scheduledat':moment()[_0x9978('0xd6')](_0x11d3f9['dialMachineRetryFrequency'],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x57678d[_0x9978('0xd8')],'ListId':_0x57678d[_0x9978('0xd9')],'VoiceQueueId':_0x57678d[_0x9978('0xda')]||undefined,'CampaignId':_0x57678d[_0x9978('0xdb')]||undefined})['catch'](loggerCatch(_0x9978('0x124')));_0x142917({'reschedule':0x1});}}});}if(_0x14c63e['type']===_0x9978('0xbb')&&this[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]][_0x9978('0x108')]&&_0x4fee07[_0x9978('0x109')]===_0x9978('0x10a')){delete this['uniqueId'][_0x4fee07[_0x9978('0xba')]];this[_0x9978('0xbc')](this[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]]);_0x5c1761=new Hangup(_0x14c63e,_0x4fee07);_0x5c1761[_0x9978('0xca')]=0x12;_0x5c1761[_0x9978('0xcb')]='HangupInAMD';_0x5c1761['membername']=_0x9978('0x10f');ami[_0x9978('0x3f')](_0x9978('0x110'),ut[_0x9978('0x111')](_0x5c1761,_0x9978('0x112')));this['saveInDb'](_0x5c1761,'[syncHangupInAMDIvr][createHistory]',_0x9978('0x125'));}if(_0x14c63e[_0x9978('0x40')]===_0x9978('0xbb')&&this[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]]['dialAMDActive']&&_0x4fee07[_0x9978('0x109')]==='MACHINE'){return new Promise(function(_0x14f777,_0x691760){delete _0x432601[_0x9978('0x24')][_0x4fee07['uniqueid']];_0x432601['updateOriginated'](_0x432601[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]]);_0x432601[_0x9978('0x1e')][_0x14c63e[_0x9978('0xb9')]][_0x9978('0x10b')]+=0x1;_0x432601[_0x9978('0x1e')][_0x14c63e['queue']][_0x9978('0x10c')]+=0x1;var _0x5d5f69=_0x432601[_0x9978('0x1e')][_0x14c63e['queue']];var _0x240981=new Hangup(_0x14c63e,_0x4fee07);_0x240981[_0x9978('0xca')]=0x13;_0x240981[_0x9978('0xcb')]=_0x9978('0x116');_0x240981[_0x9978('0x10e')]=_0x9978('0x10f');_0x240981[_0x9978('0x117')]+=0x1;_0x240981['countglobal']+=0x1;_0x240981[_0x9978('0x112')]=!![];ami[_0x9978('0x3f')](_0x9978('0x110'),ut[_0x9978('0x111')](_0x240981,_0x9978('0x112')));hopperUtils[_0x9978('0xc2')](_0x240981)[_0x9978('0x9b')](loggerCatch(_0x9978('0x118')));if(_0x240981[_0x9978('0x119')]+_0x240981[_0x9978('0x11a')]+_0x240981[_0x9978('0x11b')]+_0x240981[_0x9978('0x11c')]+_0x240981[_0x9978('0xd3')]+_0x240981[_0x9978('0xe3')]+_0x240981[_0x9978('0x117')]+_0x240981['countagentrejectretry']>=_0x5d5f69[_0x9978('0x11e')]){_0x432601[_0x9978('0x11f')](_0x240981,_0x14f777,_0x691760,'reason19\x20machine....');}else{if(_0x240981[_0x9978('0x117')]>=_0x5d5f69[_0x9978('0x121')]){_0x432601[_0x9978('0x122')](_0x240981,_0x14f777,_0x691760,_0x9978('0x123'));}else{hopperUtils[_0x9978('0xf2')]({'active':![],'countmachineretry':_0x240981[_0x9978('0x117')],'scheduledat':moment()[_0x9978('0xd6')](_0x5d5f69['dialMachineRetryFrequency'],'minutes')[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0x240981['ContactId'],'ListId':_0x240981[_0x9978('0xd9')],'VoiceQueueId':_0x240981[_0x9978('0xda')]||undefined,'CampaignId':_0x240981[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch('[rescheduleContact][Machine]'));_0x14f777({'reschedule':0x1});}}});}}};Dialer[_0x9978('0x18')][_0x9978('0x33')]=function(_0x881225){var _0x12d161=this[_0x9978('0x24')][_0x881225['uniqueid']];var _0x3313b1;if(_0x12d161&&_0x12d161[_0x9978('0x40')]===_0x9978('0xbb')){delete this[_0x9978('0x24')][_0x881225['uniqueid']];this['updateOriginated'](this[_0x9978('0x1e')][_0x12d161[_0x9978('0xb9')]]);this[_0x9978('0x1e')][_0x12d161[_0x9978('0xb9')]][_0x9978('0x126')]+=0x1;_0x3313b1=new Hangup(_0x12d161,_0x881225);hopperUtils[_0x9978('0xc2')](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x127')));hopperUtils[_0x9978('0xc4')](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x128')));}if(_0x12d161&&_0x12d161[_0x9978('0x40')]!=='ivr'&&isNotNull(this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]['dialQueueProject'])){delete this['uniqueId'][_0x881225[_0x9978('0xba')]];this[_0x9978('0xbc')](this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]);this[_0x9978('0x1d')][_0x12d161['queue']][_0x9978('0x10b')]+=0x1;this[_0x9978('0x1d')][_0x12d161['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3313b1=new Hangup(_0x12d161,_0x881225);_0x3313b1[_0x9978('0xca')]=0x10;_0x3313b1['statedesc']=_0x9978('0x129');_0x3313b1[_0x9978('0x10e')]=_0x9978('0x12a');hopperUtils[_0x9978('0xc2')](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x127')));hopperUtils['moveContactManagedDialer'](_0x3313b1)[_0x9978('0x9b')](loggerCatch('[syncHangupIvr]'));}if(_0x12d161&&_0x12d161[_0x9978('0x40')]!==_0x9978('0xbb')&&!isNotNull(this['voiceQueues'][_0x12d161['queue']][_0x9978('0x12b')])){if(_0x881225['cause-txt']===_0x9978('0x12c')){delete this[_0x9978('0x24')][_0x881225['uniqueid']];this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]['outboundAnswerCallsDay']+=0x1;const _0x569075=new AgentComplete(_0x12d161,_0x881225);_0x569075[_0x9978('0xdb')]=this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]['id'];hopperUtils[_0x9978('0xc2')](_0x569075)['catch'](loggerCatch(_0x9978('0xc3')));hopperUtils[_0x9978('0xc4')](_0x569075)[_0x9978('0x9b')](loggerCatch(_0x9978('0x12d')));}else{delete this[_0x9978('0x24')][_0x881225[_0x9978('0xba')]];this[_0x9978('0xbc')](this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]]);this[_0x9978('0x1d')][_0x12d161[_0x9978('0xb9')]][_0x9978('0x12e')]+=0x1;_0x3313b1=new Hangup(_0x12d161,_0x881225);_0x3313b1[_0x9978('0xca')]=0xc;_0x3313b1[_0x9978('0xcb')]=_0x881225[_0x9978('0x12f')];_0x3313b1[_0x9978('0x10e')]=_0x9978('0x130');hopperUtils['createHistory'](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x127')));hopperUtils['moveContactManagedDialer'](_0x3313b1)[_0x9978('0x9b')](loggerCatch(_0x9978('0x128')));}}};Dialer['prototype'][_0x9978('0x8')]=function(_0x2ac8e7){var _0x352516=this;if(!_0x352516[_0x9978('0x29')][_0x2ac8e7[_0x9978('0x46')]]){_0x352516['queuesSummary'][_0x2ac8e7[_0x9978('0x46')]]={'running':![]};}else if(_0x352516['queuesSummary'][_0x2ac8e7[_0x9978('0x46')]][_0x9978('0x131')]===!![]){return;}else if(_0x352516[_0x9978('0x29')][_0x2ac8e7[_0x9978('0x46')]][_0x9978('0x131')]===![]){_0x352516['queuesSummary'][_0x2ac8e7[_0x9978('0x46')]][_0x9978('0x131')]=!![];}var _0x23a2fc=_0x352516[_0x9978('0x1d')][_0x2ac8e7[_0x9978('0x46')]];var _0x4ab2c7=_0x23a2fc[_0x9978('0x6b')]!==utils['CAMPAIGN_STATUS'][_0x9978('0x79')];var _0x49d600=utils[_0x9978('0x132')](_0x23a2fc);_0x23a2fc[_0x9978('0x133')]=utils['getQueueCampaignStatusMessage'](_0x23a2fc,_0x352516[_0x9978('0x20')]);Promise[_0x9978('0xa5')]()[_0x9978('0x3c')](function(){if(_0x23a2fc['statusMessage']===utils[_0x9978('0x66')][_0x9978('0x79')]){if(_0x4ab2c7){clearPredictiveAttributes(_0x23a2fc);_0x2ac8e7[_0x9978('0x26')]=undefined;_0x2ac8e7[_0x9978('0x27')]=undefined;}if(_0x23a2fc['statusMessage']===utils[_0x9978('0x66')]['INACTIVE']){_0x2ac8e7[_0x9978('0x134')]=0x0;_0x2ac8e7[_0x9978('0xed')]=0x0;_0x2ac8e7[_0x9978('0x135')]=0x0;_0x2ac8e7['talking']=0x0;_0x2ac8e7[_0x9978('0x136')]=0x0;}}else if(_0x23a2fc['statusMessage']===utils['CAMPAIGN_STATUS'][_0x9978('0x137')]&&!_0x49d600){return _0x352516[_0x9978('0x8f')](_0x23a2fc,!![])[_0x9978('0x3c')](function(){return _0x352516[_0x9978('0x8f')](_0x23a2fc,![]);})[_0x9978('0x3c')](function(){return _0x352516[_0x9978('0xab')](_0x23a2fc);})['catch'](function(_0x4e2d6f){loggerSyncQueueSummary[_0x9978('0x41')](_0x9978('0x138'),util['inspect'](_0x4e2d6f,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x23a2fc);});}else{clearPredictiveAttributes(_0x23a2fc);}})['then'](function(){var _0x5c987b=_0x2ac8e7[_0x9978('0x139')](_0x23a2fc);if(_0x5c987b||_0x23a2fc[_0x9978('0x13a')]){_0x23a2fc['queueSummaryCountersUpdated']=![];_0x2ac8e7['updateReportFromOutboundQueue'](_0x23a2fc);Object[_0x9978('0x13b')](_0x23a2fc,_0x2ac8e7);emitOutboundVoiceQueueSummary(_0x2ac8e7);}_0x352516[_0x9978('0x29')][_0x23a2fc[_0x9978('0x46')]][_0x9978('0x131')]=![];})[_0x9978('0x9b')](function(_0x4c50a6){logger[_0x9978('0x62')](_0x9978('0x138'),util['inspect'](_0x4c50a6,{'showHidden':![],'depth':null}));_0x352516[_0x9978('0x29')][_0x23a2fc[_0x9978('0x46')]][_0x9978('0x131')]=![];});};Dialer[_0x9978('0x18')][_0x9978('0x32')]=_[_0x9978('0x13c')](function(){var _0x2c9f3f=_[_0x9978('0x13d')](this['voiceQueues'],function(_0x4b620d){return _0x4b620d[_0x9978('0x13e')];});var _0x3002b7=_[_0x9978('0x13d')](this[_0x9978('0x1f')],function(_0x5e9922){return _0x5e9922['online']&&_0x5e9922[_0x9978('0x86')]===_0x9978('0x87');});if(_0x2c9f3f[_0x9978('0x94')]>0x0&&_0x3002b7['length']>0x0){return Promise[_0x9978('0xa5')]()[_0x9978('0x3c')](cmHopper[_0x9978('0x13f')](_[_0x9978('0x140')](_0x2c9f3f,'id'),previewRecallmeReminderInterval,_['map'](_0x3002b7,'id')))['then'](function(_0x5b692c){for(var _0x208b99=0x0;_0x208b99<_0x5b692c[_0x9978('0x94')];_0x208b99++){var _0x1818c2=_0x5b692c[_0x208b99]['Agent'][_0x9978('0x46')];if(_0x1818c2)io['to'](util['format']('user:%s',_0x1818c2))[_0x9978('0x3f')](_0x9978('0x141'),{'hopper':_0x5b692c[_0x208b99]});}})[_0x9978('0x9b')](function(_0x5a8fea){logger['error']('checkPreviewRecallReminder',_0x5a8fea);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9978('0x18')][_0x9978('0x142')]=function(){var _0x31245c=this;setInterval(function(){_0x31245c[_0x9978('0x143')](_0x31245c[_0x9978('0x24')],_0x9978('0x144'));_0x31245c[_0x9978('0x143')](_0x31245c[_0x9978('0x23')],_0x9978('0x145'));},0x32c8);};Dialer[_0x9978('0x18')][_0x9978('0x143')]=function(_0x1c861c,_0x5d2150){var _0x244a04=this;for(var _0x1a1a4a in _0x1c861c){if(typeof _0x1c861c[_0x1a1a4a]!==_0x9978('0xa4')){this['sequence'][_0x9978('0x19')](function(){if(!_[_0x9978('0xeb')](_0x1c861c[_0x1a1a4a])){return ami[_0x9978('0x96')]({'action':_0x9978('0x86'),'channel':_0x1c861c[_0x1a1a4a][_0x9978('0xe7')]})[_0x9978('0x9b')](function(_0x16bed5){if(_0x16bed5[_0x9978('0x6b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1c861c[_0x1a1a4a]&&_0x1c861c[_0x1a1a4a][_0x9978('0x40')]!=='ivr'){_0x244a04['updateOriginated'](_0x244a04['voiceQueues'][_0x1c861c[_0x1a1a4a]['queue']]);logger['error'](_0x9978('0x146'),_0x5d2150,_0x1a1a4a,_0x1c861c[_0x1a1a4a][_0x9978('0xb9')]);delete _0x1c861c[_0x1a1a4a];}if(_0x1c861c[_0x1a1a4a]&&_0x1c861c[_0x1a1a4a]['type']==='ivr'){_0x244a04['updateOriginated'](_0x244a04['campaigns'][_0x1c861c[_0x1a1a4a][_0x9978('0xb9')]]);logger[_0x9978('0x62')](_0x9978('0x147'),_0x5d2150,_0x1a1a4a,_0x1c861c[_0x1a1a4a][_0x9978('0xb9')]);delete _0x1c861c[_0x1a1a4a];}},0x2328);}});}});}}};Dialer[_0x9978('0x18')][_0x9978('0x148')]=function(_0xd0aaf0){return Promise['resolve']()[_0x9978('0x3c')](voiceQueueRt['getVoiceQueueRtPauses'](_0xd0aaf0))['catch'](loggerCatch(_0x9978('0x149')));};Dialer[_0x9978('0x18')][_0x9978('0xbc')]=function(_0x10a9e3){if(!_['isUndefined'](_0x10a9e3)&&_0x10a9e3!==null){if(typeof _0x10a9e3[_0x9978('0x7d')]!==_0x9978('0xa4')){if(_0x10a9e3[_0x9978('0x7d')]>0x0){_0x10a9e3[_0x9978('0x7d')]-=0x1;}else{logger[_0x9978('0x62')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x9978('0x62')](_0x9978('0x14a'));}};Dialer[_0x9978('0x18')][_0x9978('0x14b')]=function(_0x1734b3,_0x453ece){var _0x260c4f=this;return function(_0x3de10b){_0x260c4f[_0x9978('0xbc')](_0x453ece);logger[_0x9978('0x62')](_0x1734b3,util[_0x9978('0x43')](_0x3de10b,{'showHidden':![],'depth':null}));};};Dialer[_0x9978('0x18')][_0x9978('0x14c')]=function(_0xf9789f,_0x52a536,_0x32fc8a){var _0xaeb43={'state':0x19,'statedesc':'notFound'};this[_0x9978('0xbc')](_0x52a536);this['saveInDb'](_[_0x9978('0x5d')](_0xaeb43,_[_0x9978('0x72')](_0x32fc8a,[_0x9978('0xd8'),_0x9978('0xd9'),_0x9978('0x14d'),_0x9978('0xda'),_0x9978('0xdb')])),_0x9978('0x14e'),'[emptyContact]');logger[_0x9978('0x62')](_0xf9789f);};Dialer[_0x9978('0x18')]['saveInDb']=function(_0x5cacfe,_0x5293fb,_0x2b5904){hopperUtils['createHistory'](_0x5cacfe)[_0x9978('0x9b')](loggerCatch(_0x5293fb));hopperUtils[_0x9978('0xc4')](_0x5cacfe)[_0x9978('0x9b')](loggerCatch(_0x2b5904));};Dialer[_0x9978('0x18')][_0x9978('0xd5')]=function(_0x51373c,_0x1cadb2){hopperUtils[_0x9978('0xc2')](_0x51373c)[_0x9978('0x9b')](loggerCatch(_0x9978('0xc3')));if(_0x1cadb2==0x0){hopperUtils[_0x9978('0xc4')](_0x51373c)['catch'](loggerCatch(_0x9978('0x14f')));}};Dialer[_0x9978('0x18')][_0x9978('0x150')]=function(_0x1c8db2){return Promise['resolve']()['then'](cmHopper['handlePreviewRecallNotifications'](_0x1c8db2['id'],previewRecallmeReminderInterval))[_0x9978('0x3c')](function(_0x22bdbc){for(var _0x10bbd0=0x0;_0x10bbd0<_0x22bdbc[_0x9978('0x94')];_0x10bbd0++){var _0x99375f=_0x22bdbc[_0x10bbd0][_0x9978('0x151')]['name'];if(_0x99375f)io['to'](util[_0x9978('0x44')]('user:%s',_0x99375f))[_0x9978('0x3f')](_0x9978('0x141'),{'hopper':_0x22bdbc[_0x10bbd0]});}})[_0x9978('0x9b')](function(){});};Dialer[_0x9978('0x18')][_0x9978('0xa9')]=function(_0x5ae6dd){var _0x52a520=this;return function(){_0x52a520[_0x9978('0x152')](_0x5ae6dd);};};Dialer[_0x9978('0x18')][_0x9978('0x153')]=function(_0x310c1b,_0x5b5eb0){var _0x20539e=this;var _0x284875=uuid['v4']();this[_0x9978('0x23')][_0x284875]=new Action(_0x310c1b,_0x5b5eb0,_0x284875);return new Promise(function(_0x4e508b,_0x505133){if(_[_0x9978('0x3e')](_0x310c1b)&&typeof _0x310c1b!==_0x9978('0x154')){return _0x505133(msgResponse(_0x9978('0x155'),_0x9978('0x8d'),_0x9978('0x156')));}if(_[_0x9978('0x3e')](_0x5b5eb0[_0x9978('0x157')])||_0x5b5eb0[_0x9978('0x157')]===null){return _0x505133(msgResponse(_0x9978('0x155'),_0x9978('0x8d'),_0x9978('0x158')));}var _0x368ee7={'XMD-CALLERID':_0x20539e[_0x9978('0x23')][_0x284875][_0x9978('0x159')](),'XMD-AGI':_0x310c1b['dialQueueProject']?util['format'](_0x9978('0x15a'),ipAgi,_0x310c1b[_0x9978('0x12b')]):_0x9978('0x15b'),'XMD-AGIAFTER':_0x310c1b[_0x9978('0xc1')]?util[_0x9978('0x44')](_0x9978('0x15a'),ipAgi,_0x310c1b['dialQueueProject2']):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x310c1b)?util['format'](_0x9978('0x15c'),_0x310c1b[_0x9978('0x46')],_0x310c1b[_0x9978('0x15d')]||'',_0x310c1b[_0x9978('0x15e')]?'c':'',_0x310c1b['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x5b5eb0['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x20539e['actions'][_0x284875]['getCaller'](),'XMD-AMD':_0x310c1b[_0x9978('0x108')]?_0x9978('0x137'):_0x9978('0x15b'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x310c1b['dialAMDActive']){_0x368ee7[_0x9978('0x15f')]=_0x310c1b[_0x9978('0x160')]||0x9c4;_0x368ee7[_0x9978('0x161')]=_0x310c1b[_0x9978('0x162')]||0x5dc;_0x368ee7['XMD-AMDAFTERGREETINGSILENCE']=_0x310c1b['dialAMDAfterGreetingSilence']||0x320;_0x368ee7[_0x9978('0x163')]=_0x310c1b[_0x9978('0x164')]||0x1388;_0x368ee7['XMD-AMDMINWORDLENGTH']=_0x310c1b[_0x9978('0x165')]||0x64;_0x368ee7[_0x9978('0x166')]=_0x310c1b[_0x9978('0x167')]||0x32;_0x368ee7[_0x9978('0x168')]=_0x310c1b['dialAMDMaximumNumberOfWords']||0x3;_0x368ee7[_0x9978('0x169')]=_0x310c1b[_0x9978('0x16a')]||0x100;_0x368ee7[_0x9978('0x16b')]=_0x310c1b['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x9978('0x16c')](_0x310c1b)){_0x368ee7[_0x9978('0x16d')]=_0x5b5eb0['VoiceQueueId'];}else{_0x368ee7['XMD-CAMPAIGNID']=_0x5b5eb0[_0x9978('0xdb')];}var _0x4fec9d=utils['setXMDContactVariables'](_0x5b5eb0[_0x9978('0x16e')]);Object[_0x9978('0x13b')](_0x368ee7,_0x4fec9d);var _0x448d51=_0x20539e[_0x9978('0x84')](_0x310c1b[_0x9978('0x89')])?utils[_0x9978('0x16f')](_0x310c1b[_0x9978('0x89')][_0x9978('0x170')],_0x310c1b['dialOriginateCallerIdName'],_0x310c1b[_0x9978('0x171')]>0x0?utils['getCallerIdRandom'](_0x310c1b[_0x9978('0x172')],_0x310c1b[_0x9978('0x171')]):_0x310c1b['dialOriginateCallerIdNumber']):utils[_0x9978('0x16f')](_[_0x9978('0xeb')](_0x310c1b['TrunkBackup'])?_0x310c1b[_0x9978('0x89')][_0x9978('0x170')]:_0x310c1b['TrunkBackup']['callerid'],_0x310c1b[_0x9978('0x173')],_0x310c1b[_0x9978('0x171')]>0x0?utils[_0x9978('0x174')](_0x310c1b[_0x9978('0x172')],_0x310c1b['dialRandomLastDigitCallerIdNumber']):_0x310c1b[_0x9978('0x172')]);if(_0x448d51){_0x368ee7[_0x9978('0x175')]=_0x20539e[_0x9978('0x23')][_0x284875][_0x9978('0x176')]=utils[_0x9978('0x177')](_0x448d51);_0x368ee7[_0x9978('0x178')]=_0x5b5eb0['phone'];}_0x310c1b[_0x9978('0x179')]=_0x368ee7;return ami[_0x9978('0x96')]({'actionid':_0x284875,'action':_0x9978('0x155'),'channel':_0x20539e[_0x9978('0x84')](_0x310c1b[_0x9978('0x89')])?util[_0x9978('0x44')](_0x9978('0x17a'),_0x310c1b[_0x9978('0x89')]['name'],isNotNull(_0x310c1b[_0x9978('0x17b')])?_0x310c1b[_0x9978('0x17b')]['trim']()||'':'',_0x310c1b[_0x9978('0x17c')]>0x0?_0x5b5eb0[_0x9978('0x157')][_0x9978('0x17d')](_0x310c1b[_0x9978('0x17c')]):_0x5b5eb0[_0x9978('0x157')]):util[_0x9978('0x44')]('SIP/%s/%s%s',_['isNil'](_0x310c1b[_0x9978('0x17e')])?_0x310c1b[_0x9978('0x89')][_0x9978('0x46')]:_0x310c1b['TrunkBackup'][_0x9978('0x46')],isNotNull(_0x310c1b[_0x9978('0x17b')])?_0x310c1b[_0x9978('0x17b')]['trim']()||'':'',_0x310c1b['dialCutDigit']>0x0?_0x5b5eb0[_0x9978('0x157')][_0x9978('0x17d')](_0x310c1b[_0x9978('0x17c')]):_0x5b5eb0['phone']),'callerid':_0x448d51,'Exten':_0x9978('0x17f'),'Context':'from-sip','Priority':'1','variable':_0x368ee7,'timeout':(_0x310c1b['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x284875})['then'](function(_0x2bb797){return _0x4e508b(_0x2bb797);})[_0x9978('0x9b')](function(_0x3dd968){_0x310c1b[_0x9978('0x180')]+=0x1;var _0x50a424=new History(_0x20539e['actions'][_0x284875]);logger[_0x9978('0x62')](util['format'](_0x9978('0x181'),JSON['stringify'](_0x3dd968)));_0x50a424['state']=0xe;_0x50a424[_0x9978('0xcb')]=_0x9978('0x182');_0x50a424[_0x9978('0x6d')]=moment()[_0x9978('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x50a424['endtime']=_0x50a424['starttime'];hopperUtils[_0x9978('0xc2')](_0x50a424)[_0x9978('0x9b')](loggerCatch(_0x9978('0x183')));_0x20539e[_0x9978('0xc4')](_0x50a424)[_0x9978('0x9b')](loggerCatch(_0x9978('0x183')))[_0x9978('0xf1')](function(){delete _0x20539e['actions'][_0x284875];return _0x505133(msgResponse(_0x9978('0x155'),_0x9978('0x83'),_0x9978('0x184')));});});});};Dialer['prototype']['checkRetriveMax']=function(_0x59b8d2,_0x17a689,_0x5df043){var _0xa254d0=new History(_0x17a689);if(_0xa254d0['countbusyretry']+_0xa254d0['countcongestionretry']+_0xa254d0[_0x9978('0x11b')]+_0xa254d0[_0x9978('0x11c')]+_0xa254d0[_0x9978('0xd3')]+_0xa254d0['countabandonedretry']+_0xa254d0['countmachineretry']+_0xa254d0[_0x9978('0x11d')]>=_0x5df043[_0x9978('0x11e')]-0x1){return!![];}switch(_0x59b8d2){case 0x3:if(_0xa254d0[_0x9978('0x11b')]>=_0x5df043[_0x9978('0x185')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0xa254d0[_0x9978('0x11b')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0x186')],_0x9978('0xd7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x187')));break;case 0x5:if(_0xa254d0[_0x9978('0x119')]>=_0x5df043['dialBusyMaxRetry']-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countbusyretry':_0xa254d0[_0x9978('0x119')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0x188')],'minutes')[_0x9978('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x189')));break;case 0x8:if(_0xa254d0['countcongestionretry']>=_0x5df043[_0x9978('0x18a')]-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countcongestionretry':_0xa254d0['countcongestionretry']+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043['dialCongestionRetryFrequency'],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x18b')));break;case 0x0:if(_0xa254d0[_0x9978('0x11c')]>=_0x5df043[_0x9978('0x18c')]-0x1){return!![];}else{hopperUtils[_0x9978('0xf2')]({'active':![],'countnosuchnumberretry':_0xa254d0[_0x9978('0x11c')]+=0x1,'scheduledat':moment()['add'](_0x5df043['dialNoSuchNumberRetryFrequency'],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0xa254d0[_0x9978('0xd3')]>=_0x5df043['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countdropretry':_0xa254d0[_0x9978('0xd3')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0xcf')],_0x9978('0xd7'))[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0[_0x9978('0xd8')],'ListId':_0xa254d0['ListId'],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0xdc')));break;case 0xb:if(_0xa254d0[_0x9978('0xe3')]>=_0x5df043[_0x9978('0xe5')]-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countabandonedretry':_0xa254d0[_0x9978('0xe3')]+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043[_0x9978('0xe4')],_0x9978('0xd7'))['format'](_0x9978('0xbe')),'ContactId':_0xa254d0['ContactId'],'ListId':_0xa254d0['ListId'],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x18d')));break;case 0x13:if(_0xa254d0[_0x9978('0x117')]>=_0x5df043[_0x9978('0x121')]-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countmachineretry':_0xa254d0['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x5df043[_0x9978('0x18e')],_0x9978('0xd7'))[_0x9978('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa254d0['ContactId'],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0[_0x9978('0xda')]||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x124')));break;case 0x14:if(_0xa254d0[_0x9978('0x11d')]>=_0x5df043['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0x9978('0xf2')]({'active':![],'countagentrejectretry':_0xa254d0['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x9978('0xd6')](_0x5df043['dialAgentRejectRetryFrequency'],'minutes')[_0x9978('0x44')](_0x9978('0xbe')),'ContactId':_0xa254d0['ContactId'],'ListId':_0xa254d0[_0x9978('0xd9')],'VoiceQueueId':_0xa254d0['VoiceQueueId']||undefined,'CampaignId':_0xa254d0[_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x9978('0x18')][_0x9978('0x103')]=function(_0x58e7bf,_0x26492d,_0x2392b7){var _0x2b5245=this;var _0x14db51=new History(_0x58e7bf);var _0x4892a3=![];var _0x1dfeb9;var _0x29bc73;return new Promise(function(_0x259509,_0x1ce70c){if(_[_0x9978('0x3e')](_0x26492d)&&typeof _0x26492d!==_0x9978('0x154')){return _0x1ce70c(msgResponse('[callProgressDetecting]',_0x9978('0x8d'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x2392b7)&&typeof _0x2392b7!=='object'){return _0x1ce70c(msgResponse(_0x9978('0x18f'),'Failure','evt\x20is\x20undefine'));}hopperUtils[_0x9978('0xd1')](_0x14db51,_0x2392b7[_0x9978('0xbf')],_0x26492d)[_0x9978('0x3c')](function(_0x12730b){if(_0x12730b[_0x9978('0xd2')]==0x1)_0x4892a3=!![];switch(_0x2392b7[_0x9978('0xbf')]){case'0':_0x26492d['outboundNoSuchCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0x0;_0x14db51['statedesc']='NoSuchNumber';_0x14db51[_0x9978('0x11c')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;ami[_0x9978('0x3f')](_0x9978('0x190'),ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x191')));_0x1dfeb9=_0x26492d[_0x9978('0x192')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x118')));if(_0x2b5245['checkRetriveMax'](0x0,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11c')]>=_0x26492d[_0x9978('0x18c')]){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x193'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x193'));}}break;case'3':_0x26492d['outboundNoAnswerCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0x3;_0x14db51['statedesc']='NoAnswer';_0x14db51[_0x9978('0x11b')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;var _0x451e84=ut[_0x9978('0x194')](_0x58e7bf,_0x26492d);ami['emit'](_0x9978('0x195'),_0x451e84);_0x1dfeb9=_0x26492d[_0x9978('0x186')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x196')));if(_0x2b5245[_0x9978('0x197')](0x3,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11b')]>=_0x26492d['dialNoAnswerMaxRetry']){_0x2b5245['createStateFinal'](_0x14db51,_0x259509,_0x1ce70c,'reason\x203\x20ringing\x20no\x20answer');}else{_0x2b5245['stateGlobal'](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x198'));}}break;case'5':_0x26492d[_0x9978('0x199')]+=0x1;_0x14db51['state']=0x5;_0x14db51[_0x9978('0xcb')]=_0x9978('0x19a');_0x14db51[_0x9978('0x119')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;ami[_0x9978('0x3f')]('custom:agentbusy',ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x19b')));_0x1dfeb9=_0x26492d[_0x9978('0x188')];_0x29bc73=_0x26492d['callAdditionalPhoneAfterMin'];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x19c')));if(_0x2b5245[_0x9978('0x197')](0x5,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x119')]>=_0x26492d['dialBusyMaxRetry']){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x19d'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x19d'));}}break;case'8':_0x26492d[_0x9978('0x19e')]+=0x1;_0x14db51[_0x9978('0xca')]=0x8;_0x14db51[_0x9978('0xcb')]=_0x9978('0x19f');_0x14db51[_0x9978('0x11a')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;_0x1dfeb9=_0x26492d[_0x9978('0x1a0')];_0x29bc73=_0x26492d[_0x9978('0xd0')];ami[_0x9978('0x3f')](_0x9978('0x1a1'),ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x1a2')));hopperUtils['createHistory'](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x1a3')));if(_0x2b5245[_0x9978('0x197')](0x8,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11a')]>=_0x26492d['dialCongestionMaxRetry']){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a4'));}else{_0x2b5245['stateGlobal'](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a4'));}}break;case'11':_0x26492d['outboundAbandonedCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0xb;_0x14db51[_0x9978('0xcb')]='Abandoned';_0x14db51[_0x9978('0xe3')]+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;_0x1dfeb9=_0x26492d[_0x9978('0xe4')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch(_0x9978('0x1a5')));if(_0x2b5245[_0x9978('0x197')](0xb,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0xe3')]>=_0x26492d['dialAbandonedMaxRetry']){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a6'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1a6'));}}break;case'20':_0x26492d['outboundRejectCallsDay']+=0x1;_0x14db51[_0x9978('0xca')]=0x14;_0x14db51[_0x9978('0xcb')]=_0x9978('0x1a7');_0x14db51['countagentrejectretry']+=0x1;_0x14db51[_0x9978('0xce')]+=0x1;_0x1dfeb9=_0x26492d['dialAgentRejectRetryFrequency'];_0x29bc73=_0x26492d['callAdditionalPhoneAfterMin'];ami[_0x9978('0x3f')](_0x9978('0x1a8'),ut[_0x9978('0x111')](_0x58e7bf,_0x9978('0x1a9')));hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2b5245['checkRetriveMax'](0x14,_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51[_0x9978('0x11d')]>=_0x26492d[_0x9978('0x1aa')]){_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1ab'));}else{_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x9978('0x1ab'));}}break;default:_0x26492d[_0x9978('0x12e')]+=0x1;_0x14db51[_0x9978('0xca')]=0xc;_0x14db51[_0x9978('0xcb')]=_0x2392b7['reason'];_0x1dfeb9=_0x26492d[_0x9978('0x1ac')];_0x29bc73=_0x26492d[_0x9978('0xd0')];hopperUtils[_0x9978('0xc2')](_0x14db51)[_0x9978('0x9b')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x2b5245[_0x9978('0x197')](_0x2392b7['reason'],_0x58e7bf,_0x26492d)&&!_0x4892a3){if(_0x14db51['countbusyretry']+_0x14db51['countcongestionretry']+_0x14db51[_0x9978('0x11b')]+_0x14db51[_0x9978('0x11c')]+_0x14db51[_0x9978('0xd3')]+_0x14db51[_0x9978('0xe3')]+_0x14db51[_0x9978('0x117')]+_0x14db51[_0x9978('0x11d')]>=_0x26492d[_0x9978('0x11e')]){_0x2b5245[_0x9978('0x11f')](_0x14db51,_0x259509,_0x1ce70c,_0x2392b7['reason']);}else{_0x2b5245[_0x9978('0x122')](_0x14db51,_0x259509,_0x1ce70c,_0x2392b7['reason']);}}}})[_0x9978('0x3c')](function(){if(_0x4892a3){hopperUtils[_0x9978('0xdf')](_0x14db51,_0x1dfeb9,_0x29bc73)[_0x9978('0x3c')](function(){return _0x259509(0x1);});}});});};Dialer[_0x9978('0x18')][_0x9978('0x11f')]=function(_0x32433a,_0x561715,_0x291f17,_0x3feb46){var _0x14b261=new Final(_0x32433a);_0x14b261[_0x9978('0xca')]=0xf;_0x14b261[_0x9978('0xcb')]='Global';this['createStateFinal'](_0x14b261,_0x561715,_0x291f17,_0x3feb46);};Dialer['prototype'][_0x9978('0x122')]=function(_0x29c394,_0x523dec,_0x5b14b1,_0x1ec1dd){hopperUtils[_0x9978('0xc4')](_0x29c394)[_0x9978('0x3c')](function(){return _0x523dec(msgResponse(_0x9978('0x18f'),_0x9978('0x1ad'),_0x1ec1dd));})['catch'](function(){return _0x5b14b1(msgResponse(_0x9978('0x1ae'),_0x9978('0x8d'),_0x9978('0x1af')));});};Dialer['prototype'][_0x9978('0xb0')]=function(_0x292dc6){var _0x55e74d=_0x292dc6['dialPredictiveOptimizationPercentage']/0x64;var _0xaf432b=_0x292dc6[_0x9978('0xc8')]/(_0x292dc6[_0x9978('0xc8')]+_0x292dc6[_0x9978('0x10b')]);var _0x55bcbe=Math[_0x9978('0x1b0')](_0x292dc6[_0x9978('0x1b1')]*(_0x292dc6[_0x9978('0x1b2')]/0x64));var _0x235748=Math[_0x9978('0x1b0')](_0x292dc6[_0x9978('0x1b1')]*(_0x292dc6[_0x9978('0x1b3')]/0x64));var _0x40e39b=_0x292dc6['available']+_0x292dc6[_0x9978('0x1b4')];var _0x521aa9=Math[_0x9978('0x1b5')](_0x292dc6[_0x9978('0x1b6')]*_0x292dc6[_0x9978('0x5b')]*_0x292dc6[_0x9978('0x1b7')]*_0x292dc6[_0x9978('0x1b8')]);if(_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x27')])){if(!_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x26')])){_0x292dc6[_0x9978('0x26')]=undefined;loggerPredictive[_0x9978('0x62')](_0x9978('0x1b9'),_0x9978('0x1ba'));}if(!_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x60')])){loggerPredictive[_0x9978('0x62')](_0x9978('0x1b9'),_0x9978('0x1bb'));clearInterval(_0x292dc6[_0x9978('0x60')]);_0x292dc6[_0x9978('0x60')]=undefined;}_0x292dc6[_0x9978('0x27')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));loggerPredictive[_0x9978('0x49')](_0x292dc6['name'],_0x9978('0x1bc'),_0x292dc6[_0x9978('0x27')]);this[_0x9978('0xad')](_0x292dc6,0x1);}else if(ifInterval(_0x292dc6[_0x9978('0x1bd')],_0x292dc6[_0x9978('0x27')])){this['handlePower'](_0x292dc6,0x1);loggerPredictiveCalls[_0x9978('0x49')]('[startMethodPredictive][StartProgressive][Loop]',_0x292dc6[_0x9978('0x27')],_0x292dc6[_0x9978('0x46')]);_0x292dc6[_0x9978('0x1b6')]=0x0;_0x292dc6[_0x9978('0xc9')]=0x0;}else if(_0x55e74d<_0xaf432b&&_0x292dc6[_0x9978('0x1be')]===_0x9978('0x1bf')){clearPredictiveAttributes(_0x292dc6);loggerPredictive[_0x9978('0x49')](_0x9978('0x1c0'),_0x9978('0x1c1'),_0xaf432b,_0x9978('0x27'),_0x292dc6[_0x9978('0x46')]);}else if(_0x521aa9<_0x292dc6[_0x9978('0xc9')]&&_0x292dc6[_0x9978('0x1be')]===_0x9978('0x1bf')){clearPredictiveAttributes(_0x292dc6);loggerPredictive['info'](_0x9978('0x1c2'),_0x9978('0x1c3'),_0x521aa9,'Drop\x20in\x20this\x20interval',_0x292dc6[_0x9978('0xc9')],'startProgressive',_0x292dc6[_0x9978('0x46')]);}else if(!ifInterval(_0x292dc6[_0x9978('0x1bd')],_0x292dc6[_0x9978('0x27')])&&_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x26')])&&!_[_0x9978('0x3e')](_0x292dc6[_0x9978('0x27')])){_0x292dc6[_0x9978('0x26')]=moment()['format'](_0x9978('0xbe'));loggerPredictive[_0x9978('0x49')](_0x292dc6[_0x9978('0x46')],_0x9978('0x1c4'),_0x292dc6['startPredictive']);hopperUtils[_0x9978('0x1c5')](_0x292dc6['dialPredictiveInterval'])[_0x9978('0x3c')](this['getDataPredictive'](_0x292dc6))[_0x9978('0x3c')](mergeDataErlangB(_0x292dc6))[_0x9978('0x3c')](this[_0x9978('0x1c6')](_0x292dc6))[_0x9978('0x9b')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x292dc6));}else if(!ifInterval(_0x292dc6['dialPredictiveInterval'],_0x292dc6[_0x9978('0x26')])){_0x292dc6[_0x9978('0xc9')]=0x0;_0x292dc6[_0x9978('0x26')]=moment()[_0x9978('0x44')](_0x9978('0xbe'));loggerPredictive['info'](_0x292dc6[_0x9978('0x46')],_0x9978('0x1c7'),_0x292dc6['startPredictive']);clearInterval(_0x292dc6['handlePredictive']);_0x292dc6[_0x9978('0x60')]=undefined;hopperUtils[_0x9978('0x1c5')](_0x292dc6[_0x9978('0x1bd')])[_0x9978('0x3c')](this[_0x9978('0x1c8')](_0x292dc6))[_0x9978('0x3c')](mergeDataErlangB(_0x292dc6))['then'](this[_0x9978('0x1c6')](_0x292dc6))[_0x9978('0x9b')](loggerCatchPredictive(_0x9978('0x1c9'),_0x292dc6));}else if(_0x292dc6['predictiveIntervalAvailable']&&_0x40e39b<_0x292dc6[_0x9978('0x1b1')]-_0x235748){clearPredictiveAttributes(_0x292dc6);loggerPredictive[_0x9978('0x49')](_0x292dc6[_0x9978('0x46')],_0x9978('0x1ca'),_0x40e39b,_0x9978('0x1cb'),_0x292dc6[_0x9978('0x1b1')],'-',_0x235748,'=',_0x292dc6[_0x9978('0x1b1')]-_0x235748,')');}else if(_0x292dc6[_0x9978('0x1b1')]&&_0x40e39b>_0x292dc6['predictiveIntervalAvailable']+_0x55bcbe){clearPredictiveAttributes(_0x292dc6);loggerPredictive[_0x9978('0x49')](_0x292dc6['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x40e39b,_0x9978('0x1cc'),_0x292dc6[_0x9978('0x1b1')],'+',_0x55bcbe,'=',_0x292dc6[_0x9978('0x1b1')]+_0x55bcbe,')');}};Dialer[_0x9978('0x18')][_0x9978('0x1c8')]=function(_0xecb58d){var _0x1afc6d=this;return function(_0x10f556){return new Promise(function(_0x36211e,_0x2158a4){_['merge'](_0xecb58d,_0x10f556[0x0]);if(checkGetDataPredictive(_0x10f556[0x0])){var _0x24bd87=_0xecb58d[_0x9978('0x1b1')]=_0xecb58d[_0x9978('0x1b4')]+_0xecb58d['available'];var _0x5f235c=_0xecb58d[_0x9978('0x1bd')]*0x3c;var _0x43f430=_0x10f556[0x0][_0x9978('0x50')]+_0x10f556[0x0][_0x9978('0x4f')];var _0x41f7ea=(_0x10f556[0x0][_0x9978('0x1cd')]+_0x10f556[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x10f556[0x0][_0x9978('0xe0')])/_0x10f556[0x0][_0x9978('0x4a')];_0xecb58d[_0x9978('0x1b7')]=_0x41f7ea>0x0?_0x41f7ea:0x1;switch(_0xecb58d[_0x9978('0x1be')]){case _0x9978('0x1bf'):var _0x398bc0=_0xecb58d[_0x9978('0x1ce')]/0x64;return _0x1afc6d[_0x9978('0x1cf')](_0x24bd87,_0x5f235c,_0x43f430,_0x41f7ea,_0x398bc0)[_0x9978('0x3c')](function(_0x3d4745){return _0x36211e(_0x3d4745);});case'agentBusyFactor':var _0x2b1ecb=_0xecb58d['dialPredictiveOptimizationPercentage']/0x64;return _0x1afc6d['busyFactor'](_0x24bd87,_0x5f235c,_0x43f430,_0x41f7ea,_0x2b1ecb)[_0x9978('0x3c')](function(_0x2484ee){return _0x36211e(_0x2484ee);});default:return _0x2158a4(msgResponse(_0x9978('0x1d0'),_0x9978('0x8d'),_0x9978('0x1d1')));}}else{return _0x2158a4(msgResponse(_0x9978('0x1d0'),_0x9978('0x8d'),'check\x20failure'));}});};};Dialer['prototype'][_0x9978('0x1d2')]=function(_0x17dbd8){var _0x29b5e1=this;return function(_0x2a6539){return new Promise(function(_0x3ce2b8,_0x170148){_['merge'](_0x17dbd8,_0x2a6539[0x0]);if(checkGetDataPredictive(_0x2a6539[0x0])){loggerPredictive['info'](JSON[_0x9978('0x71')](_0x2a6539[0x0]));if(_0x17dbd8[_0x9978('0x1be')]==='dropRate'){return _0x29b5e1[_0x9978('0x148')](_0x17dbd8['id'])['then'](function(_0x42308e){var _0xe5f88f=_0x17dbd8[_0x9978('0x1d3')]-_0x42308e[0x0][_0x9978('0x1d4')];var _0x55ece4=_0x17dbd8[_0x9978('0x1bd')]*0x3c;var _0x280c65=_0x2a6539[0x0][_0x9978('0x50')]+_0x2a6539[0x0][_0x9978('0x4f')];var _0x2b330f=(_0x2a6539[0x0][_0x9978('0x1cd')]+_0x2a6539[0x0][_0x9978('0x1d5')]+_0x2a6539[0x0][_0x9978('0xe0')])/_0x2a6539[0x0][_0x9978('0x4a')];var _0xe70476=_0x17dbd8['dialPredictiveOptimizationPercentage']/0x64;_0x17dbd8['predictiveIntervalPauses']=_0x42308e[0x0][_0x9978('0x1d4')]||0x0;_0x17dbd8[_0x9978('0x1b7')]=_0x2b330f>0x0?_0x2b330f:0x1;return _0x29b5e1[_0x9978('0x1cf')](_0xe5f88f,_0x55ece4,_0x280c65,_0x2b330f,_0xe70476);})[_0x9978('0x3c')](function(_0x2bd3e9){return _0x3ce2b8(_0x2bd3e9);})[_0x9978('0x9b')](function(_0x3fd0f8){return _0x170148(msgResponse(_0x9978('0x1d6'),_0x9978('0x8d'),JSON['stringify'](_0x3fd0f8)));});}if(_0x17dbd8['dialPredictiveOptimization']===_0x9978('0x1d7')){return _0x29b5e1[_0x9978('0x148')](_0x17dbd8['id'])[_0x9978('0x3c')](function(_0x5a35aa){var _0x153c18=_0x17dbd8[_0x9978('0x1d3')]-_0x5a35aa[0x0][_0x9978('0x1d4')];var _0x4e9604=_0x17dbd8[_0x9978('0x1bd')]*0x3c;var _0x2edb29=_0x2a6539[0x0][_0x9978('0x50')]+_0x2a6539[0x0][_0x9978('0x4f')];var _0x46c020=(_0x2a6539[0x0][_0x9978('0x1cd')]+_0x2a6539[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2a6539[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2a6539[0x0]['predictiveIntervalTotalCalls'];var _0x1a9d71=_0x17dbd8['dialPredictiveOptimizationPercentage']/0x64;_0x17dbd8[_0x9978('0x1d8')]=_0x5a35aa[0x0][_0x9978('0x1d4')]||0x0;_0x17dbd8[_0x9978('0x1b7')]=_0x46c020>0x0?_0x46c020:0x1;return _0x29b5e1[_0x9978('0x1d9')](_0x153c18,_0x4e9604,_0x2edb29,_0x46c020,_0x1a9d71);})[_0x9978('0x3c')](function(_0x252640){return _0x3ce2b8(_0x252640);})['catch'](function(_0x429f2a){return _0x170148(msgResponse(_0x9978('0x1d6'),'Failure',JSON[_0x9978('0x71')](_0x429f2a)));});}}else{return _0x170148(msgResponse(_0x9978('0x1d0'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0x9978('0x1c6')]=function(_0x2549b6){var _0x17b625=this;return function(){var _0x2c8d05=0x0;var _0x25f546=Math['floor'](_0x2549b6['erlangCallToSecond']*0x3e8);if(_0x25f546>0x0){_0x25f546=_0x25f546<0x64?0x64:_0x25f546;loggerPredictive['info'](_0x2549b6[_0x9978('0x46')],'one\x20call\x20every:',_0x25f546,_0x9978('0x1da'));_0x2549b6[_0x9978('0x60')]=setInterval(function(){_0x17b625[_0x9978('0x60')](_0x2549b6);loggerPredictiveCalls[_0x9978('0x49')](_0x9978('0x1db'),_0x2c8d05+=0x1);},_0x25f546);}else{loggerPredictive[_0x9978('0x49')](_0x2549b6[_0x9978('0x46')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x9978('0x18')][_0x9978('0x1dc')]=function(_0x2e8b60,_0x24e3db){var _0x305e28=this;return function(_0x576aee){if(_[_0x9978('0x77')](_0x576aee)){if(_[_0x9978('0xeb')](_0x24e3db[_0x9978('0x14d')])||!_0x24e3db[_0x9978('0x1dd')]){if(_0x2e8b60[_0x9978('0xac')]===_0x9978('0x1de')){_0x2e8b60[_0x9978('0x6e')]=_['isUndefined'](_0x2e8b60[_0x9978('0x6e')])?!![]:_0x2e8b60['queueStatusComplete'];var _0x45878d=uuid['v4']();_0x305e28[_0x9978('0x23')][_0x45878d]=new Action(_0x2e8b60,_0x24e3db,_0x45878d);loggerBooked[_0x9978('0x49')](_0x9978('0x1df'),_0x45878d,_0x9978('0x1e0'),JSON[_0x9978('0x71')](_0x2e8b60[_0x9978('0x6e')]),_0x9978('0x1e1'),_0x2e8b60['name']);if(_0x2e8b60[_0x9978('0x6e')]){_0x2e8b60[_0x9978('0x6e')]=![];_0x305e28[_0x9978('0x28')][_0x305e28[_0x9978('0x23')][_0x45878d]['queue']]=[];ami[_0x9978('0x96')]({'actionid':_0x45878d,'action':_0x9978('0x1e2'),'queue':_0x2e8b60['name']})[_0x9978('0x9b')](function(){_0x305e28['updateOriginated'](_0x2e8b60);hopperUtils[_0x9978('0xf2')]({'active':![],'ContactId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd8')],'ListId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd9')],'VoiceQueueId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xda')]||undefined,'CampaignId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xdb')]||undefined})[_0x9978('0x9b')](loggerCatch(_0x9978('0x1e3')));delete _0x305e28['actions'][_0x45878d];});}else{loggerBooked['info'](_0x9978('0x1e4'),JSON['stringify'](_0x2e8b60[_0x9978('0x6e')]),'Queue:\x20',_0x2e8b60[_0x9978('0x46')]);_0x305e28[_0x9978('0xbc')](_0x2e8b60);hopperUtils[_0x9978('0xf2')]({'active':![],'ContactId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd8')],'ListId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xd9')],'VoiceQueueId':_0x305e28[_0x9978('0x23')][_0x45878d][_0x9978('0xda')]||undefined,'CampaignId':_0x305e28['actions'][_0x45878d][_0x9978('0xdb')]||undefined})['catch'](loggerCatch(_0x9978('0x1e3')));delete _0x305e28[_0x9978('0x23')][_0x45878d];}}else{return _0x305e28['actionOriginate'](_0x2e8b60,_0x24e3db);}}else{if(utils[_0x9978('0x5e')](undefined,_0x24e3db[_0x9978('0x1e5')])<_0x2e8b60[_0x9978('0x1e6')]*0x3c){if(_0x24e3db[_0x9978('0x151')]&&!_0x24e3db[_0x9978('0x151')][_0x9978('0x1e7')]){_0x305e28['preview'][_0x9978('0xf9')](_0x24e3db['id'])[_0x9978('0xf1')](function(){_0x305e28['updateOriginated'](_0x2e8b60);});}else{hopperUtils[_0x9978('0x1e8')]({'active':![]},_0x24e3db['id'],0x1)[_0x9978('0xf1')](function(){_0x305e28[_0x9978('0xbc')](_0x2e8b60);});}}else{_0x2e8b60[_0x9978('0x1e9')]+=0x1;_0x305e28[_0x9978('0xbc')](_0x2e8b60);if(_0x2e8b60[_0x9978('0x1ea')]){hopperUtils[_0x9978('0xf2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x24e3db[_0x9978('0xd8')],'ListId':_0x24e3db[_0x9978('0xd9')],'VoiceQueueId':_0x24e3db[_0x9978('0xda')]||undefined,'CampaignId':_0x24e3db[_0x9978('0xdb')]||undefined})['catch'](loggerCatch(_0x9978('0x1eb')));hopperUtils[_0x9978('0xc2')](createObjHistory(_0x2e8b60,_0x24e3db,utils['CAMPAIGN_STATUS'][_0x9978('0x1ec')],0x17,_0x9978('0x1ed')))[_0x9978('0x9b')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x305e28['saveInDb'](createObjHistory(_0x2e8b60,_0x24e3db,utils[_0x9978('0x66')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x9978('0x1ee'),_0x9978('0x1ef'));}}}}else{_0x2e8b60[_0x9978('0x1f0')]+=0x1;_0x305e28['saveInDb'](createObjHistory(_0x2e8b60,_0x24e3db,utils[_0x9978('0x66')]['BLACKLIST'],0xd,'Blacklist'),_0x9978('0x1f1'),_0x9978('0x1f2'));throw _0x9978('0x1f3');}};};Dialer[_0x9978('0x18')][_0x9978('0x152')]=function(_0x5f4206){var _0x22807b=this;var _0x1528e5=_0x5f4206[_0x9978('0x1f4')]-_0x5f4206[_0x9978('0x7d')];emitCampaignSummary(_0x5f4206);if(_0x1528e5>0x0&&_0x5f4206[_0x9978('0x64')]==0x0){if(_0x1528e5>this[_0x9978('0x21')]){_0x1528e5=this['maxNumberOriginate'];}_0x5f4206[_0x9978('0x64')]=0x1;hopperUtils[_0x9978('0x1f5')](_0x5f4206,_0x1528e5)[_0x9978('0x3c')](function(_0xd0f2c){_0x5f4206[_0x9978('0x64')]=0x0;if(_0xd0f2c){if(!utils[_0x9978('0x1f6')](_0xd0f2c)){_0x5f4206[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x69')];logger['info'](_0x9978('0x1f7')+_0x5f4206[_0x9978('0x46')]);}else{_0x5f4206[_0x9978('0x7d')]+=_0xd0f2c[_0x9978('0x94')];_0x5f4206[_0x9978('0x6b')]=utils[_0x9978('0x66')][_0x9978('0x1f8')];for(var _0x4fed34=0x0;_0x4fed34<_0xd0f2c['length'];_0x4fed34+=0x1){_0x5f4206['ivrTotalCallsDays']+=0x1;if(_[_0x9978('0xeb')](_0xd0f2c[_0x4fed34])||_['isNil'](_0xd0f2c[_0x4fed34][_0x9978('0x16e')])||_[_0x9978('0xeb')](_0xd0f2c[_0x4fed34][_0x9978('0x157')])){_0x22807b[_0x9978('0x14c')](_0x9978('0x1f9'),_0x5f4206,_0xd0f2c[_0x4fed34]);}else{hopperUtils[_0x9978('0x1fa')](_[_0x9978('0x72')](_0xd0f2c[_0x4fed34],['CampaignId',_0x9978('0x157')]))['then'](_0x22807b[_0x9978('0x1dc')](_0x5f4206,_0xd0f2c[_0x4fed34]))['catch'](_0x22807b[_0x9978('0x14b')](_0x9978('0x1fb'),_0x5f4206));}}}}})[_0x9978('0x9b')](loggerGetContactDialer(_0x9978('0x1fc'),_0x5f4206,_0x1528e5));}};Dialer[_0x9978('0x18')][_0x9978('0xad')]=function(_0x584309,_0x5dedac){var _0x312899=this;var _0x2c8dbc=[];if(_0x5dedac<0x1||_0x584309[_0x9978('0xac')]===_0x9978('0x1de')){_0x5dedac=0x1;}var _0x263400=Math['floor'](_0x584309[_0x9978('0x134')]*_0x5dedac)-_0x584309[_0x9978('0x7d')];if(_0x584309[_0x9978('0x1fd')]>0x0){var _0x5dbceb=_0x584309[_0x9978('0x1fd')]-_0x584309[_0x9978('0x7d')]-_0x584309[_0x9978('0x1b4')]-_0x584309[_0x9978('0x136')];if(_0x263400>_0x5dbceb){_0x263400=_0x5dbceb;}}if(_0x263400>0x0&&_0x584309[_0x9978('0x64')]==0x0){if(_0x584309[_0x9978('0xac')]===_0x9978('0x1de')){_0x263400=0x1;}if(_0x263400>this[_0x9978('0x21')]){_0x263400=this[_0x9978('0x21')];}for(var _0x3c3492 in this[_0x9978('0x1f')]){if(typeof this['agents'][_0x3c3492]!=='undefined'){if(this[_0x9978('0x1f')][_0x3c3492][_0x9978('0xca')]==='not_inuse'&&this[_0x9978('0x1f')][_0x3c3492][_0x9978('0x86')]===_0x9978('0x87')){_0x2c8dbc[_0x9978('0x95')](this[_0x9978('0x1f')][_0x3c3492]['id']);}}}_0x584309[_0x9978('0x64')]=0x1;hopperUtils[_0x9978('0x1fe')](_0x584309,_0x2c8dbc,_0x263400)['then'](function(_0x2d7d10){_0x584309['temp']=0x0;if(_0x2d7d10){if(!utils[_0x9978('0x1f6')](_0x2d7d10)){hopperUtils[_0x9978('0x1ff')](_0x584309)[_0x9978('0x3c')](sendMessageReschedule(_0x584309))[_0x9978('0x9b')](loggerCatch(_0x9978('0x200')));}else{_0x584309[_0x9978('0x7d')]+=_0x2d7d10[_0x9978('0x94')];_0x584309[_0x9978('0x6b')]=_0x584309[_0x9978('0xac')]==='booked'?utils[_0x9978('0x66')]['ACTIVE']:utils['CAMPAIGN_STATUS'][_0x9978('0x1f8')];for(var _0x333d89=0x0;_0x333d89<_0x2d7d10[_0x9978('0x94')];_0x333d89+=0x1){if(_[_0x9978('0xeb')](_0x2d7d10[_0x333d89])||_[_0x9978('0xeb')](_0x2d7d10[_0x333d89][_0x9978('0x16e')])||_['isNil'](_0x2d7d10[_0x333d89]['phone'])){_0x312899['emptyContact']('[actionOriginate]\x20',_0x584309,_0x2d7d10[_0x333d89]);}else{hopperUtils[_0x9978('0x201')](_['pick'](_0x2d7d10[_0x333d89],[_0x9978('0xda'),_0x9978('0x157')]))[_0x9978('0x3c')](_0x312899[_0x9978('0x1dc')](_0x584309,_0x2d7d10[_0x333d89]))['catch'](_0x312899['loggerHandler'](_0x9978('0x1f9'),_0x584309));}}}}})[_0x9978('0x9b')](loggerGetContactDialer('[getContactDialer2]',_0x584309,_0x263400));}};Dialer['prototype'][_0x9978('0x60')]=function(_0x33cc32){if(_0x33cc32[_0x9978('0x1fd')]>0x0){var _0x52abd8=_0x33cc32[_0x9978('0x1fd')]-_0x33cc32[_0x9978('0x7d')]-_0x33cc32[_0x9978('0x1b4')];if(_0x52abd8>0x0&&_0x33cc32[_0x9978('0x64')]==0x0){this[_0x9978('0x202')](_0x33cc32);}else{loggerPredictiveCalls[_0x9978('0x49')](_0x9978('0x203'));}}else{this[_0x9978('0x202')](_0x33cc32);}};Dialer[_0x9978('0x18')]['tryOriginatePredictive']=function(_0xd660b7){var _0x123839=this;var _0x209119=[];_0xd660b7[_0x9978('0x7d')]+=0x1;for(var _0x16c00f in this[_0x9978('0x1f')]){if(typeof this['agents'][_0x16c00f]!=='undefined'){if(this[_0x9978('0x1f')][_0x16c00f][_0x9978('0xca')]===_0x9978('0x204')&&this[_0x9978('0x1f')][_0x16c00f][_0x9978('0x86')]===_0x9978('0x87')){_0x209119[_0x9978('0x95')](this['agents'][_0x16c00f]['id']);}}}_0xd660b7[_0x9978('0x64')]=0x1;return this['getContactDialer'](_0xd660b7['id'],_0x209119,0x1,_0xd660b7['dialOrderByScheduledAt'],_0xd660b7)['then'](function(_0x4579b6){_0xd660b7[_0x9978('0x64')]=0x1;if(_0x4579b6){if(!utils[_0x9978('0x1f6')](_0x4579b6)){utils[_0x9978('0x63')](_0xd660b7,0x1,0x0);return hopperUtils['countReScheduled'](_0xd660b7)['then'](sendMessageReschedule(_0xd660b7))[_0x9978('0x9b')](loggerCatch(_0x9978('0x200')));}else{_0xd660b7['message']=utils['CAMPAIGN_STATUS'][_0x9978('0x1f8')];if(_[_0x9978('0xeb')](_0x4579b6[0x0])||_[_0x9978('0xeb')](_0x4579b6[0x0][_0x9978('0x16e')])||_[_0x9978('0xeb')](_0x4579b6[0x0][_0x9978('0x157')])){_0x123839[_0x9978('0x14c')](_0x9978('0x1f9'),_0xd660b7,_0x4579b6[0x0]);}else{return hopperUtils[_0x9978('0x201')](_[_0x9978('0x72')](_0x4579b6[0x0],[_0x9978('0xda'),_0x9978('0x157')]))[_0x9978('0x3c')](_0x123839[_0x9978('0x1dc')](_0xd660b7,_0x4579b6[0x0]))['catch'](_0x123839['loggerHandler'](_0x9978('0x205'),_0xd660b7));}}}})[_0x9978('0x9b')](loggerGetContactDialer(_0x9978('0x206'),_0xd660b7,0x1));};Dialer[_0x9978('0x18')][_0x9978('0x1cf')]=function(_0x51ba4c,_0x1bdc51,_0x36b646,_0x2b7769,_0x1450fa,_0x17d4a4){loggerPredictive[_0x9978('0x49')](_0x9978('0x207'));loggerPredictive[_0x9978('0x49')](_0x9978('0x208'),_0x51ba4c);loggerPredictive[_0x9978('0x49')](_0x9978('0x209'),_0x1bdc51);loggerPredictive[_0x9978('0x49')](_0x9978('0x20a'),_0x36b646);loggerPredictive[_0x9978('0x49')](_0x9978('0x20b'),_0x2b7769);loggerPredictive[_0x9978('0x49')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1450fa);loggerPredictive[_0x9978('0x49')](_0x9978('0x51'));return new Promise(function(_0x3a3719,_0x463479){if(_0x51ba4c<=0x0||isNaN(_0x51ba4c)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),'m\x20=\x20'+_0x51ba4c));}if(_0x36b646<=0x0||isNaN(_0x36b646)){return _0x463479(msgResponse(_0x9978('0x20c'),'Error',_0x9978('0x20d')+_0x36b646));}if(_0x2b7769<=0x0||isNaN(_0x2b7769)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),_0x9978('0x20e')+_0x2b7769));}if(_0x1bdc51<=0x0||isNaN(_0x1bdc51)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),_0x9978('0x20f')+_0x1bdc51));}if(_0x1450fa<=0x0||isNaN(_0x1450fa)){return _0x463479(msgResponse(_0x9978('0x20c'),_0x9978('0x83'),_0x9978('0x210')+_0x1450fa));}_0x17d4a4=_0x17d4a4||0x0;var _0x46c962=0x1/_0x36b646;var _0x18cfbb=0x0;var _0x43aa42=0x0;var _0x155a2a=0x0;var _0x5572cf=0x0;for(var _0x3f5085=0x0;_0x155a2a<_0x1450fa;_0x3f5085+=0x1){_0x43aa42=_0x3f5085/_0x1bdc51;_0x18cfbb=(_0x2b7769*_0x43aa42+_0x17d4a4)/_0x46c962;_0x155a2a=utils[_0x9978('0x211')](_0x18cfbb,_0x51ba4c);_0x5572cf=_0x18cfbb/_0x51ba4c*(0x1-utils[_0x9978('0x211')](_0x18cfbb,_0x51ba4c));}return _0x3a3719({'erlangCalls':_0x3f5085,'erlangCallToSecond':_0x1bdc51/_0x3f5085,'erlangAbandonmentRate':_0x155a2a,'erlangBusyFactor':_0x5572cf});});};Dialer[_0x9978('0x18')][_0x9978('0x1d9')]=function(_0x3ba3fe,_0x1ab5c0,_0x2bc419,_0x22adb0,_0x17b9fe,_0x42ee8e){loggerPredictive[_0x9978('0x49')](_0x9978('0x212'));loggerPredictive[_0x9978('0x49')](_0x9978('0x208'),_0x3ba3fe);loggerPredictive[_0x9978('0x49')](_0x9978('0x209'),_0x1ab5c0);loggerPredictive[_0x9978('0x49')]('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',_0x2bc419);loggerPredictive[_0x9978('0x49')](_0x9978('0x20b'),_0x22adb0);loggerPredictive[_0x9978('0x49')](_0x9978('0x213'),_0x17b9fe);loggerPredictive[_0x9978('0x49')](_0x9978('0x51'));return new Promise(function(_0x7b4b67,_0x350ddb){if(_0x3ba3fe<=0x0||isNaN(_0x3ba3fe)){return _0x350ddb(msgResponse(_0x9978('0x214'),_0x9978('0x83'),_0x9978('0x215')+_0x3ba3fe));}if(_0x2bc419<=0x0||isNaN(_0x2bc419)){return _0x350ddb(msgResponse('[busyFactor]','Error',_0x9978('0x20d')+_0x2bc419));}if(_0x22adb0<=0x0||isNaN(_0x22adb0)){return _0x350ddb(msgResponse(_0x9978('0x214'),_0x9978('0x83'),_0x9978('0x20e')+_0x22adb0));}if(_0x1ab5c0<=0x0||isNaN(_0x1ab5c0)){return _0x350ddb(msgResponse(_0x9978('0x214'),'Error',_0x9978('0x20f')+_0x1ab5c0));}if(_0x17b9fe<=0x0||isNaN(_0x17b9fe)){return _0x350ddb(msgResponse(_0x9978('0x214'),_0x9978('0x83'),_0x9978('0x216')+_0x17b9fe));}_0x42ee8e=_0x42ee8e||0x0;var _0x1adb34=0x1/_0x2bc419;var _0x284ba3=0x0;var _0x4e80f4=0x0;var _0x55a672=0x0;var _0x130f00=0x0;for(var _0x1f763a=0x0;_0x130f00<_0x17b9fe;_0x1f763a+=0x1){_0x4e80f4=_0x1f763a/_0x1ab5c0;_0x284ba3=(_0x22adb0*_0x4e80f4+_0x42ee8e)/_0x1adb34;_0x55a672=utils['erlangb'](_0x284ba3,_0x3ba3fe);_0x130f00=_0x284ba3/_0x3ba3fe*(0x1-utils[_0x9978('0x211')](_0x284ba3,_0x3ba3fe));}return _0x7b4b67({'erlangCalls':_0x1f763a,'erlangCallToSecond':_0x1ab5c0/_0x1f763a,'erlangAbandonmentRate':_0x55a672,'erlangBusyFactor':_0x130f00});});};module['exports']=Dialer; \ No newline at end of file +var _0x3c0a=['XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','variables','dialPrefix','trim','substring','dialCutDigit','SIP/%s/%s%s','from-sip','dialOriginateTimeout','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','stateGlobal','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','talking','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','getVoiceQueueRtPauses','loggedIn','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','checkContactEmpty','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[countReScheduled]\x20','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\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','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','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','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/final','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','emit','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice:queue:%s','name','isEmpty','info','-----\x20Stats\x20Predictive\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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\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\x20value\x20cleared','startPredictive','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','Interval','Intervals','\x20INTERVAL_IS_NULL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','iftime\x20%s,%s','interval','content','indexOf','true','catch','timezones','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','silly','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','syncAgentConnect','queue','uniqueId','uniqueid','type','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','dialDropMaxRetry','rescheduleContact','add','minutes','VoiceQueueId','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countglobal','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','countabandonedretry','ContactId','ListId','CampaignId','[rescheduleContact][Abandoned]','endtime','[syncAgentComplete][createHistory][11]','channel','strategy','actionid','isNil','stateinterface','locked','rrmemory','idHopper','paused','syncQueueStatusComplete','roundrobin','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','callProgressDetecting','variable','amdstatus','exten','dialAMDActive','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','MACHINE','Machine','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','value','HANGUP','saveInDb','[syncHangupInAMDIvr][createHistory]','countcongestionretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','moveContactManagedDialer','[syncHangupIvr]','Normal\x20Clearing','[syncAgentComplete][createHistory]','[syncAgentComplete]','outboundUnknownCallsDay','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','user:%s','launchHandleIvr','handleIvr','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialer','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x3c0a,0xaf));var _0xa3c0=function(_0x5961a0,_0x2c4f43){_0x5961a0=_0x5961a0-0x0;var _0x727878=_0x3c0a[_0x5961a0];return _0x727878;};'use strict';var util=require(_0xa3c0('0x0'));var _=require(_0xa3c0('0x1'));var uuid=require(_0xa3c0('0x2'));var moment=require(_0xa3c0('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xa3c0('0x4'));var hopperUtils=require(_0xa3c0('0x5'));var ut=require(_0xa3c0('0x6'));var config=require(_0xa3c0('0x7'));var logger=require(_0xa3c0('0x8'))('dialer');var loggerBooked=require('../../../config/logger')(_0xa3c0('0x9'));var loggerPredictive=require(_0xa3c0('0x8'))(_0xa3c0('0xa'));var loggerPredictiveCalls=require(_0xa3c0('0x8'))(_0xa3c0('0xb'));var loggerSyncQueueSummary=require(_0xa3c0('0x8'))(_0xa3c0('0xc'));var ami=require('../ami');config[_0xa3c0('0xd')]=_[_0xa3c0('0xe')](config['redis'],{'host':_0xa3c0('0xf'),'port':0x18eb});var io=require(_0xa3c0('0x10'))(new Redis(config['redis']));var cmHopper=require(_0xa3c0('0x11'));var voiceQueueRt=require(_0xa3c0('0x12'));var RpcSetting=require(_0xa3c0('0x13'));var Interval=require(_0xa3c0('0x14'));var Action=require('./models/action');var History=require(_0xa3c0('0x15'));var Final=require(_0xa3c0('0x16'));var AgentComplete=require(_0xa3c0('0x17'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0xa3c0('0x18'));var ipAgi=process[_0xa3c0('0x19')][_0xa3c0('0x1a')]||_0xa3c0('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xa3c0('0x1c')][_0xa3c0('0x1d')]=function(_0xedbef9){this[_0xa3c0('0x1e')]=this['tail']?this[_0xa3c0('0x1e')][_0xa3c0('0x1f')](_0xedbef9):_0xedbef9();};function Dialer(_0x35554e,_0x5c3eb0){this[_0xa3c0('0x20')]=new Sequence();this[_0xa3c0('0x21')]=_0x5c3eb0;this[_0xa3c0('0x22')]=_0x35554e[_0xa3c0('0x22')];this[_0xa3c0('0x23')]=_0x35554e[_0xa3c0('0x23')];this[_0xa3c0('0x24')]=_0x35554e[_0xa3c0('0x24')];this[_0xa3c0('0x25')]=_0x35554e[_0xa3c0('0x25')];this[_0xa3c0('0x26')]=config[_0xa3c0('0x26')]||0x2;this['channels']={};this[_0xa3c0('0x27')]={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0xa3c0('0x28')]={};this[_0xa3c0('0x29')]={};this[_0xa3c0('0x2a')]={};this[_0xa3c0('0x2b')]={};this[_0xa3c0('0x2c')]={};ami['on'](_0xa3c0('0x2d'),this['syncAgentConnect'][_0xa3c0('0x2e')](this));ami['on'](_0xa3c0('0x2f'),this[_0xa3c0('0x30')]['bind'](this));ami['on'](_0xa3c0('0x31'),this[_0xa3c0('0x32')][_0xa3c0('0x2e')](this));ami['on'](_0xa3c0('0x33'),this['syncAgentComplete']['bind'](this));ami['on'](_0xa3c0('0x34'),this[_0xa3c0('0xc')][_0xa3c0('0x2e')](this));ami['on'](_0xa3c0('0x35'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0xa3c0('0x36'),this[_0xa3c0('0x37')][_0xa3c0('0x2e')](this));ami['on'](_0xa3c0('0x38'),this[_0xa3c0('0x39')]['bind'](this));ami['on']('varset',this[_0xa3c0('0x3a')][_0xa3c0('0x2e')](this));ami['on'](_0xa3c0('0x3b'),this['syncQueueMember'][_0xa3c0('0x2e')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xa3c0('0x2e')](this));this[_0xa3c0('0x3c')]();this[_0xa3c0('0x3d')]();RpcSetting['getSettings']()[_0xa3c0('0x3e')](function(_0x398c17){previewRecallmeReminderInterval=_0x398c17[_0xa3c0('0x3f')];});}function isNotNull(_0x457a23){return _0x457a23!==null&&!_[_0xa3c0('0x40')](_0x457a23);}function msgResponse(_0x52485d,_0x364c24,_0xabf19e){return{'action':_0x52485d,'response':_0x364c24,'message':_0xabf19e,'stack':_0xabf19e};}function emit(_0x24ffee,_0x4cbf5a,_0x2b1b8c){io['to'](_0x24ffee)[_0xa3c0('0x41')](_0x4cbf5a,_0x2b1b8c);}function emitOutboundVoiceQueueSummary(_0x54f0a6){if(_0x54f0a6['type']===_0xa3c0('0x42')){logger[_0xa3c0('0x43')](_0xa3c0('0x44'),util[_0xa3c0('0x45')](_0x54f0a6,{'showHidden':![],'depth':null}));emit(util[_0xa3c0('0x46')](_0xa3c0('0x47'),_0x54f0a6[_0xa3c0('0x48')]),'voice_queue:save',_0x54f0a6);}}function checkGetDataPredictive(_0x44a872){if(isNotNull(_0x44a872)&&!_[_0xa3c0('0x49')](_0x44a872)){loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x4b'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44a872[_0xa3c0('0x4c')]);loggerPredictive['info'](_0xa3c0('0x4d'),_0x44a872[_0xa3c0('0x4e')]);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x4f'),_0x44a872[_0xa3c0('0x50')]);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x51'),_0x44a872[_0xa3c0('0x52')]);loggerPredictive[_0xa3c0('0x4a')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x44a872[_0xa3c0('0x53')]);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x54'),_0x44a872['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0xa3c0('0x55'));if(_0x44a872[_0xa3c0('0x4c')]>0x0){if(!_[_0xa3c0('0x40')](_0x44a872[_0xa3c0('0x56')])&&_0x44a872[_0xa3c0('0x56')]>0x0){return!![];}loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x57'));if(!_[_0xa3c0('0x40')](_0x44a872[_0xa3c0('0x53')])&&_0x44a872[_0xa3c0('0x53')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0xa3c0('0x58'));}}else{loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x59'));}return![];}function mergeDataErlangB(_0x8cddb3){return function(_0x316b19){loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x5a'));loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x5b'),_0x316b19[_0xa3c0('0x5c')]);loggerPredictive['info'](_0xa3c0('0x5d'),_0x316b19[_0xa3c0('0x5e')]);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x5f'),_0x316b19[_0xa3c0('0x60')]);loggerPredictive[_0xa3c0('0x4a')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x316b19[_0xa3c0('0x61')]);loggerPredictive[_0xa3c0('0x4a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x316b19[_0xa3c0('0x60')]);loggerPredictive[_0xa3c0('0x4a')]('---------------------------');_[_0xa3c0('0x62')](_0x8cddb3,_0x316b19);};}function ifInterval(_0x414cd9,_0x219207){if(_['isUndefined'](_0x219207)){return![];}return utils[_0xa3c0('0x63')](undefined,_0x219207)<_0x414cd9*0x3c;}function clearPredictiveAttributes(_0x263fcf){if(_0x263fcf[_0xa3c0('0x28')]){_0x263fcf[_0xa3c0('0x28')]=undefined;loggerPredictive[_0xa3c0('0x43')](_0x263fcf[_0xa3c0('0x48')],_0xa3c0('0x64'));}if(_0x263fcf[_0xa3c0('0x65')]){_0x263fcf['startPredictive']=undefined;loggerPredictive[_0xa3c0('0x43')](_0x263fcf[_0xa3c0('0x48')],'startPredictive\x20value\x20cleared');}if(_0x263fcf['handlePredictive']){clearInterval(_0x263fcf['handlePredictive']);_0x263fcf[_0xa3c0('0x66')]=undefined;loggerPredictive[_0xa3c0('0x43')](_0x263fcf[_0xa3c0('0x48')],_0xa3c0('0x67'));}}function loggerCatchPredictive(_0x2a0122,_0xe7bc7){return function(_0xf7a831){loggerPredictive[_0xa3c0('0x68')](_0xe7bc7[_0xa3c0('0x48')],_0x2a0122);loggerPredictive['error'](_0xf7a831[_0xa3c0('0x69')]);clearPredictiveAttributes(_0xe7bc7);};}function loggerCatch(_0x4a2e8d){return function(_0x12c0e8){logger[_0xa3c0('0x68')](_0x4a2e8d,util[_0xa3c0('0x45')](_0x12c0e8,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x2d5cd5,_0x560b67,_0x13af99){return function(_0x4281ee){utils['checkContactLowerLimitOriginate'](_0x560b67,_0x13af99,0x0);_0x560b67['temp']=0x0;logger['error'](_0x2d5cd5,util[_0xa3c0('0x45')](_0x4281ee,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5e3281){return function(_0x6b8bb){if(isNotNull(_0x6b8bb)&&isNotNull(_0x6b8bb[0x0])){if(_0x6b8bb[0x0][_0xa3c0('0x6a')]>0x0){_0x5e3281['message']=utils[_0xa3c0('0x6b')][_0xa3c0('0x6c')];logger[_0xa3c0('0x4a')](_0xa3c0('0x6d')+_0x5e3281[_0xa3c0('0x48')],_0x6b8bb[0x0]['contactsRescheduled'],'contacts');}else{_0x5e3281[_0xa3c0('0x6e')]=utils[_0xa3c0('0x6b')][_0xa3c0('0x6f')];logger[_0xa3c0('0x4a')](_0xa3c0('0x70')+_0x5e3281['name']);}}};}function createObjHistory(_0x9eaa1f,_0x7d23c2,_0x5cb7c0,_0x10032a,_0x5571e1){_0x9eaa1f[_0xa3c0('0x6e')]=_0x5cb7c0;var _0x3910fa=new Action(_0x9eaa1f,_0x7d23c2);var _0x2d4e20=new History(_0x3910fa);_0x2d4e20[_0xa3c0('0x71')]=_0x10032a;_0x2d4e20[_0xa3c0('0x72')]=_0x5571e1;_0x2d4e20['endtime']=_0x3910fa[_0xa3c0('0x73')];return _0x2d4e20;}function unlockQueueStatus(_0x1af7a3,_0x6f0360){setTimeout(function(){if(_[_0xa3c0('0x40')](_0x1af7a3[_0xa3c0('0x74')])){loggerBooked['error'](_0xa3c0('0x75'),_0x6f0360);}_0x1af7a3[_0xa3c0('0x74')]=!![];loggerBooked[_0xa3c0('0x4a')](_0xa3c0('0x76'),_0x6f0360,JSON[_0xa3c0('0x77')](_[_0xa3c0('0x78')](_0x1af7a3,[_0xa3c0('0x48'),_0xa3c0('0x74')])));},0x1f3);}function checkInterval(_0x2d093d){return function(){if(!isNotNull(_0x2d093d['Interval'])){_0x2d093d['message']=utils[_0xa3c0('0x6b')][_0xa3c0('0x79')];throw _0x2d093d[_0xa3c0('0x48')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x2d093d[_0xa3c0('0x7a')][_0xa3c0('0x7b')])){_0x2d093d['message']=utils[_0xa3c0('0x6b')][_0xa3c0('0x79')];throw _0x2d093d[_0xa3c0('0x48')]+_0xa3c0('0x7c');}if(!isNotNull(_[_0xa3c0('0x49')](_0x2d093d['Interval'][_0xa3c0('0x7b')]))){_0x2d093d['message']=utils[_0xa3c0('0x6b')][_0xa3c0('0x79')];throw _0x2d093d[_0xa3c0('0x48')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x5b100b){return function(){if(!utils[_0xa3c0('0x7d')](_0x5b100b)){_0x5b100b[_0xa3c0('0x6e')]=utils[_0xa3c0('0x6b')][_0xa3c0('0x7e')];throw _0x5b100b[_0xa3c0('0x48')]+_0xa3c0('0x7f');}};}function emitCampaignSummary(_0x4d9ab2){if(utils[_0xa3c0('0x80')](_0x4d9ab2)){emit(util[_0xa3c0('0x46')](_0xa3c0('0x81'),_0x4d9ab2[_0xa3c0('0x48')]),_0xa3c0('0x82'),_0x4d9ab2);}}function loggerCatchQueueSummary(_0x3caf4c,_0x7deeab){return function(_0x5c279a){clearPredictiveAttributes(_0x7deeab);emitCampaignSummary(_0x7deeab);loggerSyncQueueSummary[_0xa3c0('0x43')](_0x3caf4c,util[_0xa3c0('0x45')](_0x5c279a,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4593bc){if(_0x4593bc[_0xa3c0('0x83')]){if(_0x4593bc[_0xa3c0('0x84')]===0x0){_0x4593bc[_0xa3c0('0x83')]=![];_0x4593bc[_0xa3c0('0x6e')]=utils[_0xa3c0('0x6b')]['INACTIVE'];loggerSyncQueueSummary[_0xa3c0('0x43')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4593bc['name'],_0xa3c0('0x85'));}else{_0x4593bc[_0xa3c0('0x6e')]=utils['CAMPAIGN_STATUS'][_0xa3c0('0x86')];loggerSyncQueueSummary[_0xa3c0('0x43')](_0xa3c0('0x87'),_0x4593bc['name'],_0xa3c0('0x88'));}emitCampaignSummary(_0x4593bc);}}function myreject(_0x94dad8){return function(_0x1187e0){return _0x94dad8(msgResponse(_0xa3c0('0x89'),_0xa3c0('0x8a'),JSON[_0xa3c0('0x77')](_0x1187e0)));};}Dialer[_0xa3c0('0x1c')][_0xa3c0('0x8b')]=function(_0x36c8c5){return!_[_0xa3c0('0x40')](_0x36c8c5)&&_0x36c8c5&&!_[_0xa3c0('0x40')](_0x36c8c5[_0xa3c0('0x48')])&&!_[_0xa3c0('0x40')](_0x36c8c5[_0xa3c0('0x8c')])&&_0x36c8c5['active']&&(this[_0xa3c0('0x25')][util['format']('SIP/%s',_0x36c8c5[_0xa3c0('0x48')])][_0xa3c0('0x8d')]===_0xa3c0('0x8e')||this[_0xa3c0('0x25')][util[_0xa3c0('0x46')](_0xa3c0('0x8f'),_0x36c8c5['name'])][_0xa3c0('0x8d')]===_0xa3c0('0x90'));};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x91')]=function(_0x279cc3){var _0x48e8c9=this;return function(){if(!_0x48e8c9[_0xa3c0('0x8b')](_0x279cc3[_0xa3c0('0x92')])){if(!_0x48e8c9[_0xa3c0('0x8b')](_0x279cc3[_0xa3c0('0x93')])){_0x279cc3['message']=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x279cc3[_0xa3c0('0x48')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x94')]=function(_0x4806b0,_0x2eb28a,_0x4b07c9,_0x15fa95){var _0x52c41c=this;return function(){var _0x32de99=!![];return _0x52c41c[_0xa3c0('0x95')](_0x4806b0,_0x2eb28a,_0x4b07c9,_0x15fa95,_0x32de99);};};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x96')]=function(_0x1f91c1,_0x9340e7,_0x30c864,_0x1248b2){var _0x6b30c6=this;return function(){var _0x509563=![];return _0x6b30c6[_0xa3c0('0x95')](_0x1f91c1[_0xa3c0('0x7b')],_0x9340e7,_0x30c864,_0x1248b2,_0x509563);};};Dialer['prototype'][_0xa3c0('0x95')]=function(_0x53f380,_0x3448e7,_0x43e639,_0x288e41,_0xa17096){var _0x26712d=[];return new Promise(function(_0x86f40c,_0xce9b76){if(!isNotNull(_0x53f380)){_0x288e41[_0xa3c0('0x6e')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0xce9b76(msgResponse(_0xa3c0('0x97'),_0xa3c0('0x98'),_0x43e639+_0xa3c0('0x99')));}if(_[_0xa3c0('0x49')](_0x53f380)){_0x288e41['message']=utils[_0xa3c0('0x6b')][_0xa3c0('0x9a')];return _0xce9b76(msgResponse(_0xa3c0('0x97'),_0xa3c0('0x98'),_0x43e639+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3448e7&&_[_0xa3c0('0x40')](config['timezones'][_0x3448e7])){_0x288e41['message']=utils[_0xa3c0('0x6b')][_0xa3c0('0x9b')];return _0xce9b76(msgResponse(_0xa3c0('0x97'),_0xa3c0('0x98'),_0x43e639+_0xa3c0('0x9c')+_0x3448e7));}if(_[_0xa3c0('0x9d')](_0x53f380)){for(var _0x11369a=0x0;_0x11369a<_0x53f380[_0xa3c0('0x9e')];_0x11369a+=0x1){_0x26712d[_0xa3c0('0x9f')](ami[_0xa3c0('0xa0')]({'action':_0xa3c0('0xa1'),'command':util['format'](_0xa3c0('0xa2'),_0x53f380[_0x11369a][_0xa3c0('0xa3')],!_['isUndefined'](config['timezones'][_0x3448e7])?_0x3448e7:'')})[_0xa3c0('0x3e')](function(_0x37b36d){return _0x37b36d[_0xa3c0('0xa4')][_0xa3c0('0xa5')](_0xa3c0('0xa6'))>=0x0;})[_0xa3c0('0xa7')](myreject(_0xce9b76)));}}else{_0x26712d[_0xa3c0('0x9f')](ami[_0xa3c0('0xa0')]({'action':_0xa3c0('0xa1'),'command':util['format'](_0xa3c0('0xa2'),_0x53f380,!_[_0xa3c0('0x40')](config[_0xa3c0('0xa8')][_0x3448e7])?_0x3448e7:'')})[_0xa3c0('0x3e')](function(_0x50f460){return _0x50f460[_0xa3c0('0xa4')][_0xa3c0('0xa5')](_0xa3c0('0xa6'))>=0x0;})[_0xa3c0('0xa7')](myreject(_0xce9b76)));}Promise[_0xa3c0('0xa9')](_0x26712d)[_0xa3c0('0x3e')](function(_0x121c0d){var _0x265b1f=_[_0xa3c0('0xaa')](_0x121c0d);if(_0x265b1f){return _0x86f40c(_0x265b1f);}else{_0x288e41[_0xa3c0('0x6e')]=_0xa17096?utils[_0xa3c0('0x6b')][_0xa3c0('0xab')]:utils['CAMPAIGN_STATUS'][_0xa3c0('0xac')];return _0xce9b76(msgResponse(_0xa3c0('0xad'),_0xa3c0('0x98'),_0xa3c0('0xae')+_0xa17096+'\x20'+_0x43e639+_0xa3c0('0xaf')+util[_0xa3c0('0x45')](_0x53f380,{'showHidden':![],'depth':null})+_0xa3c0('0xb0')+_0x3448e7));}})['catch'](function(_0x9103f4){return _0xce9b76(msgResponse(_0xa3c0('0x97'),_0xa3c0('0x98'),JSON[_0xa3c0('0x77')](_0x9103f4)));});});};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x3c')]=function(){var _0x467af8=this;return cmHopper[_0xa3c0('0xb1')]({'active':![]},{'where':{'active':!![]}})[_0xa3c0('0x3e')](function(){setInterval(function(){_0x467af8[_0xa3c0('0xb2')]();},0x3e8);});};Dialer[_0xa3c0('0x1c')][_0xa3c0('0xb2')]=function(){var _0x7888c5=this;var _0x179c35;for(var _0x527677 in this[_0xa3c0('0x23')]){if(typeof this[_0xa3c0('0x23')][_0x527677]!==_0xa3c0('0xb3')){_0x179c35=this[_0xa3c0('0x23')][_0x527677];if(utils[_0xa3c0('0x80')](_0x179c35)&&utils[_0xa3c0('0x7d')](_0x179c35)){_0x179c35[_0xa3c0('0x83')]=!![];Promise[_0xa3c0('0xb4')]()[_0xa3c0('0x3e')](checkIsIVRCampaignActive(_0x179c35))[_0xa3c0('0x3e')](checkInterval(_0x179c35))[_0xa3c0('0x3e')](_0x7888c5[_0xa3c0('0x91')](_0x179c35))[_0xa3c0('0x3e')](_0x7888c5[_0xa3c0('0x94')](_0x179c35[_0xa3c0('0xb5')],_0x179c35[_0xa3c0('0xb6')],_0x179c35['name'],_0x179c35))['then'](_0x7888c5[_0xa3c0('0x96')](_0x179c35[_0xa3c0('0x7a')],_0x179c35[_0xa3c0('0xb6')],_0x179c35[_0xa3c0('0x48')],_0x179c35))[_0xa3c0('0x3e')](_0x7888c5['launchHandleIvr'](_0x179c35))[_0xa3c0('0xa7')](loggerCatchQueueSummary('[syncCampaigns]',_0x179c35));}else{notSendMessagesCampaign(_0x179c35);}}}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0xb7')]=function(_0x2c76df){if(_0x2c76df[_0xa3c0('0xb8')]!==_0xa3c0('0xa')){clearPredictiveAttributes(_0x2c76df);}switch(_0x2c76df[_0xa3c0('0xb8')]){case _0xa3c0('0xb9'):this[_0xa3c0('0xba')](_0x2c76df,0x1);break;case _0xa3c0('0xbb'):this['handlePower'](_0x2c76df,_0x2c76df[_0xa3c0('0xbc')]);break;case _0xa3c0('0xa'):this[_0xa3c0('0xa')](_0x2c76df);break;case _0xa3c0('0x9'):this[_0xa3c0('0xba')](_0x2c76df,0x1);break;default:logger['error']('Queue',_0x2c76df[_0xa3c0('0x48')],'method\x20not\x20recognized');}};Dialer[_0xa3c0('0x1c')]['ifTime']=function(_0x50d3c9,_0x1be558){var _0x4c0aac=_0x50d3c9['dialTimezone'];var _0x9c5869=_0x1be558?_0x50d3c9['dialGlobalInterval']:_0x50d3c9[_0xa3c0('0x7a')][_0xa3c0('0x7b')];logger[_0xa3c0('0xbd')]('Dialer::ifTime()',_0x9c5869,_0x4c0aac,_0x50d3c9['name'],util[_0xa3c0('0x46')]('Voice\x20Queue\x20%s\x20$s',_0x50d3c9[_0xa3c0('0x48')],_0x50d3c9['id']));var _0x17127a=null;return Interval[_0xa3c0('0xbe')](_0x9c5869,_0x4c0aac)[_0xa3c0('0x3e')](function(_0x1d52b9){if(_0x1d52b9===!![]){return _0x1d52b9;}else{_0x50d3c9[_0xa3c0('0x6e')]=_0x1be558?utils[_0xa3c0('0x6b')][_0xa3c0('0xab')]:utils[_0xa3c0('0x6b')]['OVERTIME_INTERVAL'];_0x17127a=msgResponse(_0xa3c0('0xad'),'Failure',_0xa3c0('0xae')+_0x1be558+'\x20'+_0x50d3c9[_0xa3c0('0x48')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0xa3c0('0x45')](_0x9c5869,{'showHidden':![],'depth':null})+_0xa3c0('0xb0')+_0x4c0aac);}if(_0x17127a!==null){logger[_0xa3c0('0xbd')](_0xa3c0('0xbf'),_0x17127a);_0x17127a[_0xa3c0('0xc0')]=_0x1be558;throw _0x17127a;}})[_0xa3c0('0xa7')](function(_0x229d93){logger['error'](_0xa3c0('0xc1'),_0x229d93);throw msgResponse(_0xa3c0('0x89'),_0xa3c0('0x8a'),util['inspect'](_0x229d93,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0xa3c0('0xc2')]=function(_0x3ac2ec){if(this['voiceQueues'][_0x3ac2ec[_0xa3c0('0xc3')]]){if(this['uniqueId'][_0x3ac2ec['uniqueid']]&&this[_0xa3c0('0xc4')][_0x3ac2ec[_0xa3c0('0xc5')]][_0xa3c0('0xc6')]!==_0xa3c0('0xc7')){this[_0xa3c0('0xc8')](this['voiceQueues'][_0x3ac2ec[_0xa3c0('0xc3')]]);this['uniqueId'][_0x3ac2ec['uniqueid']]['answertime']=moment()[_0xa3c0('0x46')](_0xa3c0('0xc9'));}}};Dialer[_0xa3c0('0x1c')]['syncAgentComplete']=function(_0x4b623b){var _0x10f743=this[_0xa3c0('0xc4')][_0x4b623b[_0xa3c0('0xc5')]];if(this[_0xa3c0('0x22')][_0x4b623b['queue']]){if(_0x10f743&&_0x10f743['type']!=='ivr'){delete this[_0xa3c0('0xc4')][_0x4b623b[_0xa3c0('0xc5')]];this[_0xa3c0('0x22')][_0x4b623b['queue']][_0xa3c0('0xca')]+=0x1;var _0x5b9908=new AgentComplete(_0x10f743,_0x4b623b);if(_0x4b623b[_0xa3c0('0xcb')]===_0xa3c0('0xcc')){_0x5b9908[_0xa3c0('0xcd')]=this[_0xa3c0('0x22')][_0x4b623b[_0xa3c0('0xc3')]][_0xa3c0('0xce')]&&this['voiceQueues'][_0x4b623b[_0xa3c0('0xc3')]][_0xa3c0('0xcf')]?moment()[_0xa3c0('0x46')](_0xa3c0('0xc9')):undefined;}hopperUtils[_0xa3c0('0xd0')](_0x5b9908)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x5b9908)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x30')]=function(_0x273261){var _0x2282a4=this[_0xa3c0('0xc4')][_0x273261[_0xa3c0('0xc5')]];var _0x1e99e9=this;var _0x210692=![];var _0x3d1596;var _0x2e4b7b;if(this[_0xa3c0('0x22')][_0x273261[_0xa3c0('0xc3')]]){if(_0x2282a4&&_0x2282a4['type']!==_0xa3c0('0xc7')){delete this[_0xa3c0('0xc4')][_0x273261[_0xa3c0('0xc5')]];this[_0xa3c0('0xc8')](this['voiceQueues'][_0x273261[_0xa3c0('0xc3')]]);_0x2282a4[_0xa3c0('0xd1')]=moment()[_0xa3c0('0x46')](_0xa3c0('0xc9'));var _0xb6d760=new QueueCallerAbandon(_0x2282a4,_0x273261);if(utils[_0xa3c0('0x63')](_0x2282a4[_0xa3c0('0xd1')],_0x2282a4['responsetime'])>=_0x2282a4[_0xa3c0('0xd2')]){this[_0xa3c0('0x22')][_0x273261['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xa3c0('0x22')][_0x273261[_0xa3c0('0xc3')]][_0xa3c0('0xd3')]+=0x1;this[_0xa3c0('0x22')][_0x273261[_0xa3c0('0xc3')]][_0xa3c0('0xd4')]+=0x1;_0xb6d760[_0xa3c0('0x71')]=0xa;_0xb6d760[_0xa3c0('0x72')]=_0xa3c0('0xd5');_0xb6d760[_0xa3c0('0xd6')]=_0xa3c0('0xd7');_0xb6d760['agiafterat']=this[_0xa3c0('0x22')][_0x273261['queue']][_0xa3c0('0xce')]?moment()[_0xa3c0('0x46')](_0xa3c0('0xc9')):undefined;_0xb6d760[_0xa3c0('0xd8')]+=0x1;_0xb6d760['countglobal']+=0x1;_0x3d1596=this[_0xa3c0('0x22')][_0x273261[_0xa3c0('0xc3')]][_0xa3c0('0xd9')];_0x2e4b7b=this[_0xa3c0('0x22')][_0x273261['queue']][_0xa3c0('0xda')];hopperUtils['verifyAdditionalPhones'](_0xb6d760,_0xb6d760[_0xa3c0('0x71')],_0x2282a4['voiceQueue'])['then'](function(_0x3ef9f4){_0x210692=_0x3ef9f4[_0xa3c0('0xdb')]==0x1;if(_0xb6d760[_0xa3c0('0xd8')]>=_0x1e99e9['voiceQueues'][_0x273261[_0xa3c0('0xc3')]][_0xa3c0('0xdc')]){_0x1e99e9['queueCallerAbandonCreateState'](_0xb6d760,_0x3ef9f4[_0xa3c0('0xdb')]);}else{hopperUtils[_0xa3c0('0xdd')]({'active':![],'countdropretry':_0xb6d760[_0xa3c0('0xd8')],'scheduledat':moment()[_0xa3c0('0xde')](_0x1e99e9[_0xa3c0('0x22')][_0x273261[_0xa3c0('0xc3')]][_0xa3c0('0xd9')],_0xa3c0('0xdf'))[_0xa3c0('0x46')](_0xa3c0('0xc9')),'ContactId':_0x2282a4['ContactId'],'ListId':_0x2282a4['ListId'],'VoiceQueueId':_0x2282a4[_0xa3c0('0xe0')]||undefined,'CampaignId':_0x2282a4['CampaignId']||undefined})[_0xa3c0('0xa7')](loggerCatch('[rescheduleContact][Drop]'));var _0x1c865a=new History(_0xb6d760);_0x1c865a[_0xa3c0('0x71')]=0xa;_0x1c865a[_0xa3c0('0x72')]=_0xa3c0('0xd5');_0x1c865a[_0xa3c0('0x73')]=moment()[_0xa3c0('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x1c865a['endtime']=_0x1c865a[_0xa3c0('0x73')];_0x1c865a[_0xa3c0('0xe1')]=_0xb6d760[_0xa3c0('0xe1')];_0x1c865a[_0xa3c0('0xe2')]=_0xb6d760['calleridnum'];hopperUtils[_0xa3c0('0xd0')](_0x1c865a)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0xe3')));}})['then'](function(){if(_0x210692)hopperUtils[_0xa3c0('0xe4')](_0xb6d760,_0x3d1596,_0x2e4b7b)[_0xa3c0('0x3e')](function(){return 0x1;});});}else{this['voiceQueues'][_0x273261['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xa3c0('0x22')][_0x273261['queue']][_0xa3c0('0xe5')]+=0x1;_0xb6d760['state']=0xb;_0xb6d760['statedesc']=_0xa3c0('0xe6');_0xb6d760[_0xa3c0('0xd6')]=_0xa3c0('0xe7');_0xb6d760['countabandonedretry']+=0x1;_0xb6d760[_0xa3c0('0xe8')]+=0x1;_0x3d1596=this[_0xa3c0('0x22')][_0x273261[_0xa3c0('0xc3')]][_0xa3c0('0xe9')];_0x2e4b7b=this[_0xa3c0('0x22')][_0x273261['queue']][_0xa3c0('0xda')];hopperUtils['verifyAdditionalPhones'](_0xb6d760,_0xb6d760['state'],_0x2282a4[_0xa3c0('0xea')])[_0xa3c0('0x3e')](function(_0x1d4c30){if(_0xb6d760['countabandonedretry']>=_0x1e99e9[_0xa3c0('0x22')][_0x273261['queue']][_0xa3c0('0xeb')]){_0x1e99e9['queueCallerAbandonCreateState'](_0xb6d760,_0x1d4c30[_0xa3c0('0xdb')]);}else{hopperUtils[_0xa3c0('0xdd')]({'active':![],'countabandonedretry':_0xb6d760[_0xa3c0('0xec')],'scheduledat':moment()[_0xa3c0('0xde')](_0x1e99e9['voiceQueues'][_0x273261[_0xa3c0('0xc3')]][_0xa3c0('0xe9')],_0xa3c0('0xdf'))[_0xa3c0('0x46')](_0xa3c0('0xc9')),'ContactId':_0x2282a4[_0xa3c0('0xed')],'ListId':_0x2282a4[_0xa3c0('0xee')],'VoiceQueueId':_0x2282a4[_0xa3c0('0xe0')]||undefined,'CampaignId':_0x2282a4[_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0xf0')));var _0x24ad64=new History(_0xb6d760);_0x24ad64['state']=0xb;_0x24ad64[_0xa3c0('0x72')]=_0xa3c0('0xe6');_0x24ad64[_0xa3c0('0x73')]=moment()[_0xa3c0('0x46')](_0xa3c0('0xc9'));_0x24ad64[_0xa3c0('0xf1')]=_0x24ad64[_0xa3c0('0x73')];_0x24ad64[_0xa3c0('0xe1')]=_0xb6d760['calleridname'];_0x24ad64['calleridnum']=_0xb6d760[_0xa3c0('0xe2')];hopperUtils['createHistory'](_0x24ad64)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0xf2')));}})[_0xa3c0('0x3e')](function(){if(_0x210692)hopperUtils['swapAdditionalPhones'](_0xb6d760,_0x3d1596,_0x2e4b7b)['then'](function(){return 0x1;});});}}}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x39')]=function(_0x105d78){if(this[_0xa3c0('0x27')][_0x105d78[_0xa3c0('0xc5')]]){this['actions'][_0x105d78[_0xa3c0('0xc5')]][_0xa3c0('0xf3')]=_0x105d78[_0xa3c0('0xf3')];}if(this[_0xa3c0('0xc4')][_0x105d78[_0xa3c0('0xc5')]]){this['uniqueId'][_0x105d78['uniqueid']][_0xa3c0('0xf3')]=_0x105d78[_0xa3c0('0xf3')];}};Dialer[_0xa3c0('0x1c')]['syncQueueMember']=function(_0x198efa){if(!this['actions'][_0x198efa['actionid']]){return;}var _0x5ab409=this[_0xa3c0('0x22')][this[_0xa3c0('0x27')][_0x198efa['actionid']][_0xa3c0('0xc3')]][_0xa3c0('0xf4')]||'rrmemory';if(_0x5ab409==='roundrobin'){if(this[_0xa3c0('0x27')][_0x198efa[_0xa3c0('0xf5')]]&&_[_0xa3c0('0xf6')](this[_0xa3c0('0x27')][_0x198efa[_0xa3c0('0xf5')]]['locked'])&&_0x198efa['status']==='1'&&_0x198efa['paused']==='0'){if(this[_0xa3c0('0x24')][_0x198efa[_0xa3c0('0xf7')]]){if(!this['agents'][_0x198efa['stateinterface']][_0xa3c0('0xf8')]){this['agents'][_0x198efa[_0xa3c0('0xf7')]][_0xa3c0('0xf8')]=!![];this[_0xa3c0('0x27')][_0x198efa['actionid']][_0xa3c0('0xf8')]=!![];this[_0xa3c0('0x27')][_0x198efa[_0xa3c0('0xf5')]][_0xa3c0('0xf7')]=_0x198efa['stateinterface'];}}}}else if(_0x5ab409===_0xa3c0('0xf9')){if(this[_0xa3c0('0x27')][_0x198efa[_0xa3c0('0xf5')]]){if(this[_0xa3c0('0x24')][_0x198efa[_0xa3c0('0xf7')]]){this[_0xa3c0('0x27')][_0x198efa['actionid']][_0xa3c0('0xf7')]=_0x198efa[_0xa3c0('0xf7')];if(_[_0xa3c0('0xf6')](this[_0xa3c0('0x2a')][this['actions'][_0x198efa['actionid']][_0xa3c0('0xc3')]])){this[_0xa3c0('0x2a')][this[_0xa3c0('0x27')][_0x198efa[_0xa3c0('0xf5')]]['queue']]=[];}this['queueBooked'][this['actions'][_0x198efa[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]][_0xa3c0('0x9f')](_[_0xa3c0('0x62')](_[_0xa3c0('0x78')](this[_0xa3c0('0x27')][_0x198efa[_0xa3c0('0xf5')]],[_0xa3c0('0xfa'),'stateinterface']),{'status':_0x198efa[_0xa3c0('0x8d')],'paused':_0x198efa[_0xa3c0('0xfb')]}));}}}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0xfc')]=function(_0x3ee725){if(!this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]]){return;}var _0x3048df=this;var _0x9a628d=this[_0xa3c0('0x22')][this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]];var _0x5761aa=_0x9a628d[_0xa3c0('0xf4')]||'rrmemory';if(_0x5761aa===_0xa3c0('0xfd')){if(this['actions'][_0x3ee725[_0xa3c0('0xf5')]]&&this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xf7')]){this[_0xa3c0('0x21')]['run'](this[_0xa3c0('0x27')][_0x3ee725['actionid']][_0xa3c0('0xfa')],this['actions'][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xf7')])[_0xa3c0('0xa7')](function(_0x2b472b){logger['error'](_0xa3c0('0xfe'),util[_0xa3c0('0x45')](_0x2b472b,{'showHidden':![],'depth':null}));})[_0xa3c0('0x1f')](function(){_0x3048df[_0xa3c0('0xc8')](_0x3048df[_0xa3c0('0x22')][_0x3048df[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]]);_0x3048df[_0xa3c0('0x24')][_0x3048df['actions'][_0x3ee725[_0xa3c0('0xf5')]]['stateinterface']][_0xa3c0('0xf8')]=![];delete _0x3048df[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]];unlockQueueStatus(_0x9a628d);});}else{this[_0xa3c0('0xc8')](this[_0xa3c0('0x22')][this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]]);hopperUtils[_0xa3c0('0xdd')]({'active':![],'ContactId':this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xed')],'ListId':this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xee')],'VoiceQueueId':this[_0xa3c0('0x27')][_0x3ee725['actionid']][_0xa3c0('0xe0')]||undefined,'CampaignId':this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xa3c0('0xff')));delete this['actions'][_0x3ee725[_0xa3c0('0xf5')]];unlockQueueStatus(_0x9a628d);}}else if(_0x5761aa===_0xa3c0('0xf9')){var _0x4b0efd;if(this[_0xa3c0('0x27')][_0x3ee725['actionid']]&&!_[_0xa3c0('0x49')](this[_0xa3c0('0x2a')][this[_0xa3c0('0x27')][_0x3ee725['actionid']][_0xa3c0('0xc3')]])){if(this[_0xa3c0('0x2b')][_0x3048df['actions'][_0x3ee725['actionid']]['queue']]){this[_0xa3c0('0x2b')][_0x3048df['actions'][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]]=this['queueBookedRR'][this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]]['queue']]?this['queueBookedRR'][this['actions'][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]]:this[_0xa3c0('0x2a')][this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]]?this['queueBooked'][this['actions'][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]][_0xa3c0('0x100')]=this['queueBookedRR'][this[_0xa3c0('0x27')][_0x3ee725[_0xa3c0('0xf5')]][_0xa3c0('0xc3')]];for(var _0x5186ff=0x0;_0x5186ff=_0x375d65[_0xa3c0('0x122')]){_0x146fb9['stateGlobal'](_0x59e574,_0x28614b,_0x4709a8,_0xa3c0('0x123'));}else{if(_0x59e574[_0xa3c0('0x11b')]>=_0x375d65[_0xa3c0('0x124')]){_0x146fb9[_0xa3c0('0x125')](_0x59e574,_0x28614b,_0x4709a8,_0xa3c0('0x126'));}else{hopperUtils[_0xa3c0('0xdd')]({'active':![],'countmachineretry':_0x59e574[_0xa3c0('0x11b')],'scheduledat':moment()[_0xa3c0('0xde')](_0x375d65[_0xa3c0('0x127')],'minutes')[_0xa3c0('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59e574[_0xa3c0('0xed')],'ListId':_0x59e574[_0xa3c0('0xee')],'VoiceQueueId':_0x59e574[_0xa3c0('0xe0')]||undefined,'CampaignId':_0x59e574[_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x128')));_0x28614b({'reschedule':0x1});}}});}if(_0x51a8c8[_0xa3c0('0xc6')]==='ivr'&&this['campaigns'][_0x51a8c8[_0xa3c0('0xc3')]][_0xa3c0('0x112')]&&_0x1b721e[_0xa3c0('0x129')]===_0xa3c0('0x12a')){delete this['uniqueId'][_0x1b721e[_0xa3c0('0xc5')]];this[_0xa3c0('0xc8')](this[_0xa3c0('0x23')][_0x51a8c8[_0xa3c0('0xc3')]]);_0x4414d3=new Hangup(_0x51a8c8,_0x1b721e);_0x4414d3[_0xa3c0('0x71')]=0x12;_0x4414d3[_0xa3c0('0x72')]=_0xa3c0('0x114');_0x4414d3[_0xa3c0('0x115')]='AMD';ami[_0xa3c0('0x41')](_0xa3c0('0x117'),ut[_0xa3c0('0x11c')](_0x4414d3,_0xa3c0('0x118')));this[_0xa3c0('0x12b')](_0x4414d3,_0xa3c0('0x12c'),'[syncHangupInAMDIvr]');}if(_0x51a8c8['type']===_0xa3c0('0xc7')&&this[_0xa3c0('0x23')][_0x51a8c8[_0xa3c0('0xc3')]][_0xa3c0('0x112')]&&_0x1b721e['value']===_0xa3c0('0x119')){return new Promise(function(_0x3d1b29,_0x5b7874){delete _0x146fb9['uniqueId'][_0x1b721e[_0xa3c0('0xc5')]];_0x146fb9['updateOriginated'](_0x146fb9[_0xa3c0('0x23')][_0x51a8c8[_0xa3c0('0xc3')]]);_0x146fb9[_0xa3c0('0x23')][_0x51a8c8['queue']][_0xa3c0('0xca')]+=0x1;_0x146fb9[_0xa3c0('0x23')][_0x51a8c8[_0xa3c0('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x5e95f4=_0x146fb9['campaigns'][_0x51a8c8['queue']];var _0xb566e2=new Hangup(_0x51a8c8,_0x1b721e);_0xb566e2[_0xa3c0('0x71')]=0x13;_0xb566e2[_0xa3c0('0x72')]='Machine';_0xb566e2[_0xa3c0('0x115')]=_0xa3c0('0x116');_0xb566e2[_0xa3c0('0x11b')]+=0x1;_0xb566e2[_0xa3c0('0xe8')]+=0x1;_0xb566e2[_0xa3c0('0x118')]=!![];ami['emit'](_0xa3c0('0x117'),ut[_0xa3c0('0x11c')](_0xb566e2,_0xa3c0('0x118')));hopperUtils['createHistory'](_0xb566e2)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x11d')));if(_0xb566e2[_0xa3c0('0x11e')]+_0xb566e2[_0xa3c0('0x12d')]+_0xb566e2['countnoanswerretry']+_0xb566e2['countnosuchnumberretry']+_0xb566e2[_0xa3c0('0xd8')]+_0xb566e2[_0xa3c0('0xec')]+_0xb566e2[_0xa3c0('0x11b')]+_0xb566e2[_0xa3c0('0x121')]>=_0x5e95f4[_0xa3c0('0x122')]){_0x146fb9['stateGlobal'](_0xb566e2,_0x3d1b29,_0x5b7874,_0xa3c0('0x123'));}else{if(_0xb566e2['countmachineretry']>=_0x5e95f4[_0xa3c0('0x124')]){_0x146fb9[_0xa3c0('0x125')](_0xb566e2,_0x3d1b29,_0x5b7874,'reason\x2019\x20machine....');}else{hopperUtils[_0xa3c0('0xdd')]({'active':![],'countmachineretry':_0xb566e2[_0xa3c0('0x11b')],'scheduledat':moment()[_0xa3c0('0xde')](_0x5e95f4[_0xa3c0('0x127')],_0xa3c0('0xdf'))[_0xa3c0('0x46')](_0xa3c0('0xc9')),'ContactId':_0xb566e2[_0xa3c0('0xed')],'ListId':_0xb566e2[_0xa3c0('0xee')],'VoiceQueueId':_0xb566e2[_0xa3c0('0xe0')]||undefined,'CampaignId':_0xb566e2['CampaignId']||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x128')));_0x3d1b29({'reschedule':0x1});}}});}}};Dialer[_0xa3c0('0x1c')]['syncHangup']=function(_0x115ed2){var _0x2810ab=this[_0xa3c0('0xc4')][_0x115ed2[_0xa3c0('0xc5')]];var _0x35e23a;if(_0x2810ab&&_0x2810ab[_0xa3c0('0xc6')]===_0xa3c0('0xc7')){delete this[_0xa3c0('0xc4')][_0x115ed2[_0xa3c0('0xc5')]];this[_0xa3c0('0xc8')](this[_0xa3c0('0x23')][_0x2810ab['queue']]);this[_0xa3c0('0x23')][_0x2810ab[_0xa3c0('0xc3')]][_0xa3c0('0x12e')]+=0x1;_0x35e23a=new Hangup(_0x2810ab,_0x115ed2);hopperUtils['createHistory'](_0x35e23a)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x12f')));hopperUtils['moveContactManagedDialer'](_0x35e23a)[_0xa3c0('0xa7')](loggerCatch('[syncHangupIvr]'));}if(_0x2810ab&&_0x2810ab[_0xa3c0('0xc6')]!==_0xa3c0('0xc7')&&isNotNull(this['voiceQueues'][_0x2810ab[_0xa3c0('0xc3')]][_0xa3c0('0x130')])){delete this[_0xa3c0('0xc4')][_0x115ed2[_0xa3c0('0xc5')]];this[_0xa3c0('0xc8')](this['voiceQueues'][_0x2810ab[_0xa3c0('0xc3')]]);this[_0xa3c0('0x22')][_0x2810ab[_0xa3c0('0xc3')]][_0xa3c0('0xca')]+=0x1;this['voiceQueues'][_0x2810ab[_0xa3c0('0xc3')]]['outboundAnswerAgiCallsDay']+=0x1;_0x35e23a=new Hangup(_0x2810ab,_0x115ed2);_0x35e23a[_0xa3c0('0x71')]=0x10;_0x35e23a['statedesc']=_0xa3c0('0x131');_0x35e23a[_0xa3c0('0x115')]=_0xa3c0('0x132');hopperUtils['createHistory'](_0x35e23a)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa3c0('0x133')](_0x35e23a)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x134')));}if(_0x2810ab&&_0x2810ab[_0xa3c0('0xc6')]!==_0xa3c0('0xc7')&&!isNotNull(this[_0xa3c0('0x22')][_0x2810ab[_0xa3c0('0xc3')]]['dialQueueProject'])){if(_0x115ed2['cause-txt']===_0xa3c0('0x135')){delete this[_0xa3c0('0xc4')][_0x115ed2[_0xa3c0('0xc5')]];this[_0xa3c0('0x22')][_0x2810ab[_0xa3c0('0xc3')]][_0xa3c0('0xca')]+=0x1;const _0x51e9af=new AgentComplete(_0x2810ab,_0x115ed2);_0x51e9af[_0xa3c0('0xef')]=this['voiceQueues'][_0x2810ab[_0xa3c0('0xc3')]]['id'];hopperUtils[_0xa3c0('0xd0')](_0x51e9af)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x136')));hopperUtils[_0xa3c0('0x133')](_0x51e9af)['catch'](loggerCatch(_0xa3c0('0x137')));}else{delete this[_0xa3c0('0xc4')][_0x115ed2[_0xa3c0('0xc5')]];this[_0xa3c0('0xc8')](this[_0xa3c0('0x22')][_0x2810ab[_0xa3c0('0xc3')]]);this['voiceQueues'][_0x2810ab['queue']][_0xa3c0('0x138')]+=0x1;_0x35e23a=new Hangup(_0x2810ab,_0x115ed2);_0x35e23a[_0xa3c0('0x71')]=0xc;_0x35e23a[_0xa3c0('0x72')]=_0x115ed2['cause-txt'];_0x35e23a[_0xa3c0('0x115')]='Unknow';hopperUtils[_0xa3c0('0xd0')](_0x35e23a)[_0xa3c0('0xa7')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0xa3c0('0x133')](_0x35e23a)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x134')));}}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0xc')]=function(_0x32dac9){var _0x960323=this;if(!_0x960323[_0xa3c0('0x2c')][_0x32dac9['name']]){_0x960323[_0xa3c0('0x2c')][_0x32dac9[_0xa3c0('0x48')]]={'running':![]};}else if(_0x960323[_0xa3c0('0x2c')][_0x32dac9[_0xa3c0('0x48')]][_0xa3c0('0x139')]===!![]){return;}else if(_0x960323[_0xa3c0('0x2c')][_0x32dac9['name']][_0xa3c0('0x139')]===![]){_0x960323[_0xa3c0('0x2c')][_0x32dac9['name']][_0xa3c0('0x139')]=!![];}var _0xcdd372=_0x960323[_0xa3c0('0x22')][_0x32dac9[_0xa3c0('0x48')]];var _0x323c8c=_0xcdd372[_0xa3c0('0x6e')]!==utils[_0xa3c0('0x6b')]['INACTIVE'];var _0x22b239=utils[_0xa3c0('0x13a')](_0xcdd372);_0xcdd372[_0xa3c0('0x13b')]=utils[_0xa3c0('0x13c')](_0xcdd372,_0x960323[_0xa3c0('0x25')]);Promise[_0xa3c0('0xb4')]()[_0xa3c0('0x3e')](function(){if(_0xcdd372[_0xa3c0('0x13b')]===utils[_0xa3c0('0x6b')]['INACTIVE']){if(_0x323c8c){clearPredictiveAttributes(_0xcdd372);_0x32dac9[_0xa3c0('0x65')]=undefined;_0x32dac9['startProgressive']=undefined;}if(_0xcdd372[_0xa3c0('0x13b')]===utils[_0xa3c0('0x6b')][_0xa3c0('0x7e')]){_0x32dac9[_0xa3c0('0x13d')]=0x0;_0x32dac9[_0xa3c0('0xfb')]=0x0;_0x32dac9[_0xa3c0('0x13e')]=0x0;_0x32dac9['talking']=0x0;_0x32dac9[_0xa3c0('0x13f')]=0x0;}}else if(_0xcdd372[_0xa3c0('0x13b')]===utils[_0xa3c0('0x6b')][_0xa3c0('0x140')]&&!_0x22b239){return _0x960323[_0xa3c0('0x97')](_0xcdd372,!![])[_0xa3c0('0x3e')](function(){return _0x960323[_0xa3c0('0x97')](_0xcdd372,![]);})[_0xa3c0('0x3e')](function(){return _0x960323[_0xa3c0('0xb7')](_0xcdd372);})[_0xa3c0('0xa7')](function(_0x4b9765){loggerSyncQueueSummary[_0xa3c0('0x43')](_0xa3c0('0x141'),util[_0xa3c0('0x45')](_0x4b9765,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xcdd372);});}else{clearPredictiveAttributes(_0xcdd372);}})['then'](function(){var _0x4cb294=_0x32dac9[_0xa3c0('0x142')](_0xcdd372);if(_0x4cb294||_0xcdd372[_0xa3c0('0x143')]){_0xcdd372[_0xa3c0('0x143')]=![];_0x32dac9[_0xa3c0('0x144')](_0xcdd372);Object[_0xa3c0('0x145')](_0xcdd372,_0x32dac9);emitOutboundVoiceQueueSummary(_0x32dac9);}_0x960323['queuesSummary'][_0xcdd372[_0xa3c0('0x48')]][_0xa3c0('0x139')]=![];})[_0xa3c0('0xa7')](function(_0x3c4efc){logger['error'](_0xa3c0('0x141'),util[_0xa3c0('0x45')](_0x3c4efc,{'showHidden':![],'depth':null}));_0x960323['queuesSummary'][_0xcdd372[_0xa3c0('0x48')]][_0xa3c0('0x139')]=![];});};Dialer['prototype'][_0xa3c0('0x146')]=_[_0xa3c0('0x147')](function(){var _0x1330eb=_[_0xa3c0('0x148')](this[_0xa3c0('0x22')],function(_0x5835b3){return _0x5835b3[_0xa3c0('0x149')];});var _0x41d9da=_['filter'](this['agents'],function(_0x385d66){return _0x385d66['online']&&_0x385d66[_0xa3c0('0x8d')]===_0xa3c0('0x8e');});if(_0x1330eb['length']>0x0&&_0x41d9da['length']>0x0){return Promise['resolve']()[_0xa3c0('0x3e')](cmHopper[_0xa3c0('0x14a')](_[_0xa3c0('0x14b')](_0x1330eb,'id'),previewRecallmeReminderInterval,_['map'](_0x41d9da,'id')))[_0xa3c0('0x3e')](function(_0x550a0a){for(var _0x18f3f1=0x0;_0x18f3f1<_0x550a0a[_0xa3c0('0x9e')];_0x18f3f1++){var _0x321fbb=_0x550a0a[_0x18f3f1][_0xa3c0('0x14c')][_0xa3c0('0x48')];if(_0x321fbb)io['to'](util[_0xa3c0('0x46')]('user:%s',_0x321fbb))['emit'](_0xa3c0('0x14d'),{'hopper':_0x550a0a[_0x18f3f1]});}})[_0xa3c0('0xa7')](function(_0x20bbdc){logger['error'](_0xa3c0('0x14e'),_0x20bbdc);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xa3c0('0x1c')][_0xa3c0('0x3d')]=function(){var _0x2229ac=this;setInterval(function(){_0x2229ac[_0xa3c0('0x14f')](_0x2229ac[_0xa3c0('0xc4')],'[uniqueid]');_0x2229ac[_0xa3c0('0x14f')](_0x2229ac[_0xa3c0('0x27')],_0xa3c0('0x150'));},0x32c8);};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x14f')]=function(_0x5da9fd,_0x515084){var _0x1f8884=this;for(var _0x56afa7 in _0x5da9fd){if(typeof _0x5da9fd[_0x56afa7]!==_0xa3c0('0xb3')){this[_0xa3c0('0x20')][_0xa3c0('0x1d')](function(){if(!_['isNil'](_0x5da9fd[_0x56afa7])){return ami[_0xa3c0('0xa0')]({'action':'status','channel':_0x5da9fd[_0x56afa7][_0xa3c0('0xf3')]})[_0xa3c0('0xa7')](function(_0x4b6de4){if(_0x4b6de4[_0xa3c0('0x6e')]===_0xa3c0('0x151')){setTimeout(function(){if(_0x5da9fd[_0x56afa7]&&_0x5da9fd[_0x56afa7][_0xa3c0('0xc6')]!==_0xa3c0('0xc7')){_0x1f8884[_0xa3c0('0xc8')](_0x1f8884['voiceQueues'][_0x5da9fd[_0x56afa7][_0xa3c0('0xc3')]]);logger[_0xa3c0('0x68')](_0xa3c0('0x152'),_0x515084,_0x56afa7,_0x5da9fd[_0x56afa7][_0xa3c0('0xc3')]);delete _0x5da9fd[_0x56afa7];}if(_0x5da9fd[_0x56afa7]&&_0x5da9fd[_0x56afa7]['type']===_0xa3c0('0xc7')){_0x1f8884[_0xa3c0('0xc8')](_0x1f8884['campaigns'][_0x5da9fd[_0x56afa7][_0xa3c0('0xc3')]]);logger[_0xa3c0('0x68')](_0xa3c0('0x153'),_0x515084,_0x56afa7,_0x5da9fd[_0x56afa7][_0xa3c0('0xc3')]);delete _0x5da9fd[_0x56afa7];}},0x2328);}});}});}}};Dialer[_0xa3c0('0x1c')]['getVoiceQueueRtPauses']=function(_0xa2f4d6){return Promise['resolve']()[_0xa3c0('0x3e')](voiceQueueRt['getVoiceQueueRtPauses'](_0xa2f4d6))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xa3c0('0x1c')]['updateOriginated']=function(_0xed797b){if(!_[_0xa3c0('0x40')](_0xed797b)&&_0xed797b!==null){if(typeof _0xed797b[_0xa3c0('0x84')]!=='undefined'){if(_0xed797b[_0xa3c0('0x84')]>0x0){_0xed797b[_0xa3c0('0x84')]-=0x1;}else{logger[_0xa3c0('0x68')](_0xa3c0('0x154'));}}}else{logger['error'](_0xa3c0('0x155'));}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x156')]=function(_0x90d917,_0x211033){var _0x22088c=this;return function(_0xd689dd){_0x22088c['updateOriginated'](_0x211033);logger[_0xa3c0('0x68')](_0x90d917,util[_0xa3c0('0x45')](_0xd689dd,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xa3c0('0x157')]=function(_0x73a8c1,_0xf44b96,_0xf3e8c1){var _0x2c8c35={'state':0x19,'statedesc':_0xa3c0('0x158')};this['updateOriginated'](_0xf44b96);this[_0xa3c0('0x12b')](_[_0xa3c0('0x62')](_0x2c8c35,_[_0xa3c0('0x78')](_0xf3e8c1,[_0xa3c0('0xed'),'ListId',_0xa3c0('0x159'),_0xa3c0('0xe0'),_0xa3c0('0xef')])),'[emptyContact][createHistory]',_0xa3c0('0x15a'));logger[_0xa3c0('0x68')](_0x73a8c1);};Dialer['prototype'][_0xa3c0('0x12b')]=function(_0x1f5d3a,_0xd1957e,_0x443a46){hopperUtils['createHistory'](_0x1f5d3a)[_0xa3c0('0xa7')](loggerCatch(_0xd1957e));hopperUtils['moveContactManagedDialer'](_0x1f5d3a)['catch'](loggerCatch(_0x443a46));};Dialer['prototype'][_0xa3c0('0x15b')]=function(_0x30134c,_0x483f03){hopperUtils['createHistory'](_0x30134c)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x136')));if(_0x483f03==0x0){hopperUtils[_0xa3c0('0x133')](_0x30134c)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x15c')));}};Dialer['prototype'][_0xa3c0('0x14e')]=function(_0x503f0f){return Promise[_0xa3c0('0xb4')]()[_0xa3c0('0x3e')](cmHopper[_0xa3c0('0x14a')](_0x503f0f['id'],previewRecallmeReminderInterval))[_0xa3c0('0x3e')](function(_0x497165){for(var _0x5f62c7=0x0;_0x5f62c7<_0x497165[_0xa3c0('0x9e')];_0x5f62c7++){var _0x4d6e3b=_0x497165[_0x5f62c7]['Agent'][_0xa3c0('0x48')];if(_0x4d6e3b)io['to'](util[_0xa3c0('0x46')](_0xa3c0('0x15d'),_0x4d6e3b))[_0xa3c0('0x41')](_0xa3c0('0x14d'),{'hopper':_0x497165[_0x5f62c7]});}})['catch'](function(){});};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x15e')]=function(_0xbe0cf6){var _0x34109a=this;return function(){_0x34109a[_0xa3c0('0x15f')](_0xbe0cf6);};};Dialer['prototype'][_0xa3c0('0x160')]=function(_0x396b06,_0x38dce9){var _0x572105=this;var _0x296a6f=uuid['v4']();this[_0xa3c0('0x27')][_0x296a6f]=new Action(_0x396b06,_0x38dce9,_0x296a6f);return new Promise(function(_0x4b6318,_0x1e2eeb){if(_[_0xa3c0('0x40')](_0x396b06)&&typeof _0x396b06!==_0xa3c0('0x161')){return _0x1e2eeb(msgResponse('originate',_0xa3c0('0x98'),_0xa3c0('0x162')));}if(_[_0xa3c0('0x40')](_0x38dce9[_0xa3c0('0x163')])||_0x38dce9[_0xa3c0('0x163')]===null){return _0x1e2eeb(msgResponse(_0xa3c0('0x164'),_0xa3c0('0x98'),_0xa3c0('0x165')));}var _0x515870={'XMD-CALLERID':_0x572105[_0xa3c0('0x27')][_0x296a6f][_0xa3c0('0x166')](),'XMD-AGI':_0x396b06[_0xa3c0('0x130')]?util[_0xa3c0('0x46')](_0xa3c0('0x167'),ipAgi,_0x396b06[_0xa3c0('0x130')]):_0xa3c0('0x168'),'XMD-AGIAFTER':_0x396b06[_0xa3c0('0xce')]?util[_0xa3c0('0x46')](_0xa3c0('0x167'),ipAgi,_0x396b06[_0xa3c0('0xce')]):_0xa3c0('0x168'),'XMD-QUEUE':utils[_0xa3c0('0x169')](_0x396b06)?util['format']('\x22%s,%s%s,,,%s\x22',_0x396b06[_0xa3c0('0x48')],_0x396b06['dialQueueOptions']||'',_0x396b06[_0xa3c0('0xcf')]?'c':'',_0x396b06[_0xa3c0('0xd2')]||0x3):_0xa3c0('0x168'),'XMD-CONTACTID':_0x38dce9[_0xa3c0('0xed')],'XMD-CDRTYPE':_0xa3c0('0x16a'),'CALLERID(all)':_0x572105[_0xa3c0('0x27')][_0x296a6f][_0xa3c0('0x166')](),'XMD-AMD':_0x396b06[_0xa3c0('0x112')]?_0xa3c0('0x140'):_0xa3c0('0x168'),'XMD-DESTINATION':_0xa3c0('0x16b')};if(_0x396b06[_0xa3c0('0x112')]){_0x515870[_0xa3c0('0x16c')]=_0x396b06[_0xa3c0('0x16d')]||0x9c4;_0x515870['XMD-AMDGREETING']=_0x396b06['dialAMDGreeting']||0x5dc;_0x515870[_0xa3c0('0x16e')]=_0x396b06[_0xa3c0('0x16f')]||0x320;_0x515870[_0xa3c0('0x170')]=_0x396b06['dialAMDTotalAnalysisTime']||0x1388;_0x515870[_0xa3c0('0x171')]=_0x396b06['dialAMDMinWordLength']||0x64;_0x515870[_0xa3c0('0x172')]=_0x396b06[_0xa3c0('0x173')]||0x32;_0x515870[_0xa3c0('0x174')]=_0x396b06[_0xa3c0('0x175')]||0x3;_0x515870[_0xa3c0('0x176')]=_0x396b06[_0xa3c0('0x177')]||0x100;_0x515870[_0xa3c0('0x178')]=_0x396b06[_0xa3c0('0x179')]||0x1388;}if(utils[_0xa3c0('0x169')](_0x396b06)){_0x515870[_0xa3c0('0x17a')]=_0x38dce9[_0xa3c0('0xe0')];}else{_0x515870[_0xa3c0('0x17b')]=_0x38dce9[_0xa3c0('0xef')];}var _0x2e4057=utils[_0xa3c0('0x17c')](_0x38dce9[_0xa3c0('0x17d')]);Object[_0xa3c0('0x145')](_0x515870,_0x2e4057);var _0x1a7ec5=_0x572105[_0xa3c0('0x8b')](_0x396b06[_0xa3c0('0x92')])?utils[_0xa3c0('0x17e')](_0x396b06['Trunk'][_0xa3c0('0x17f')],_0x396b06[_0xa3c0('0x180')],_0x396b06[_0xa3c0('0x181')]>0x0?utils[_0xa3c0('0x182')](_0x396b06[_0xa3c0('0x183')],_0x396b06[_0xa3c0('0x181')]):_0x396b06['dialOriginateCallerIdNumber']):utils[_0xa3c0('0x17e')](_[_0xa3c0('0xf6')](_0x396b06[_0xa3c0('0x93')])?_0x396b06[_0xa3c0('0x92')]['callerid']:_0x396b06[_0xa3c0('0x93')][_0xa3c0('0x17f')],_0x396b06[_0xa3c0('0x180')],_0x396b06['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xa3c0('0x182')](_0x396b06[_0xa3c0('0x183')],_0x396b06['dialRandomLastDigitCallerIdNumber']):_0x396b06[_0xa3c0('0x183')]);if(_0x1a7ec5){_0x515870[_0xa3c0('0x184')]=_0x572105[_0xa3c0('0x27')][_0x296a6f]['originatecalleridname']=utils['extractCalleridName'](_0x1a7ec5);_0x515870['XMD-ORIGINATECALLERIDNUM']=_0x38dce9[_0xa3c0('0x163')];}_0x396b06[_0xa3c0('0x185')]=_0x515870;return ami[_0xa3c0('0xa0')]({'actionid':_0x296a6f,'action':_0xa3c0('0x164'),'channel':_0x572105[_0xa3c0('0x8b')](_0x396b06[_0xa3c0('0x92')])?util[_0xa3c0('0x46')]('SIP/%s/%s%s',_0x396b06[_0xa3c0('0x92')]['name'],isNotNull(_0x396b06[_0xa3c0('0x186')])?_0x396b06[_0xa3c0('0x186')][_0xa3c0('0x187')]()||'':'',_0x396b06['dialCutDigit']>0x0?_0x38dce9['phone'][_0xa3c0('0x188')](_0x396b06[_0xa3c0('0x189')]):_0x38dce9[_0xa3c0('0x163')]):util['format'](_0xa3c0('0x18a'),_[_0xa3c0('0xf6')](_0x396b06[_0xa3c0('0x93')])?_0x396b06[_0xa3c0('0x92')][_0xa3c0('0x48')]:_0x396b06[_0xa3c0('0x93')][_0xa3c0('0x48')],isNotNull(_0x396b06[_0xa3c0('0x186')])?_0x396b06[_0xa3c0('0x186')][_0xa3c0('0x187')]()||'':'',_0x396b06[_0xa3c0('0x189')]>0x0?_0x38dce9[_0xa3c0('0x163')]['substring'](_0x396b06[_0xa3c0('0x189')]):_0x38dce9['phone']),'callerid':_0x1a7ec5,'Exten':_0xa3c0('0x16b'),'Context':_0xa3c0('0x18b'),'Priority':'1','variable':_0x515870,'timeout':(_0x396b06[_0xa3c0('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x296a6f})[_0xa3c0('0x3e')](function(_0x30bd9e){return _0x4b6318(_0x30bd9e);})[_0xa3c0('0xa7')](function(_0x84103f){_0x396b06['outboundOriginateFailureCallsDay']+=0x1;var _0x12e315=new History(_0x572105[_0xa3c0('0x27')][_0x296a6f]);logger[_0xa3c0('0x68')](util[_0xa3c0('0x46')]('[originateError]:\x20%s',JSON[_0xa3c0('0x77')](_0x84103f)));_0x12e315[_0xa3c0('0x71')]=0xe;_0x12e315['statedesc']=_0xa3c0('0x18d');_0x12e315[_0xa3c0('0x73')]=moment()['format'](_0xa3c0('0xc9'));_0x12e315[_0xa3c0('0xf1')]=_0x12e315[_0xa3c0('0x73')];hopperUtils[_0xa3c0('0xd0')](_0x12e315)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x18e')));_0x572105[_0xa3c0('0x133')](_0x12e315)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x18e')))[_0xa3c0('0x1f')](function(){delete _0x572105[_0xa3c0('0x27')][_0x296a6f];return _0x1e2eeb(msgResponse('originate',_0xa3c0('0x8a'),_0xa3c0('0x18f')));});});});};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x190')]=function(_0x467479,_0xc5d198,_0x2cad28){var _0x5e4edf=new History(_0xc5d198);if(_0x5e4edf['countbusyretry']+_0x5e4edf['countcongestionretry']+_0x5e4edf[_0xa3c0('0x11f')]+_0x5e4edf[_0xa3c0('0x120')]+_0x5e4edf['countdropretry']+_0x5e4edf[_0xa3c0('0xec')]+_0x5e4edf[_0xa3c0('0x11b')]+_0x5e4edf['countagentrejectretry']>=_0x2cad28['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x467479){case 0x3:if(_0x5e4edf[_0xa3c0('0x11f')]>=_0x2cad28['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xa3c0('0xdd')]({'active':![],'countnoanswerretry':_0x5e4edf['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28[_0xa3c0('0x191')],_0xa3c0('0xdf'))[_0xa3c0('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5e4edf[_0xa3c0('0xed')],'ListId':_0x5e4edf[_0xa3c0('0xee')],'VoiceQueueId':_0x5e4edf[_0xa3c0('0xe0')]||undefined,'CampaignId':_0x5e4edf[_0xa3c0('0xef')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x5e4edf[_0xa3c0('0x11e')]>=_0x2cad28[_0xa3c0('0x192')]-0x1){return!![];}hopperUtils[_0xa3c0('0xdd')]({'active':![],'countbusyretry':_0x5e4edf[_0xa3c0('0x11e')]+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28[_0xa3c0('0x193')],_0xa3c0('0xdf'))[_0xa3c0('0x46')](_0xa3c0('0xc9')),'ContactId':_0x5e4edf['ContactId'],'ListId':_0x5e4edf[_0xa3c0('0xee')],'VoiceQueueId':_0x5e4edf[_0xa3c0('0xe0')]||undefined,'CampaignId':_0x5e4edf['CampaignId']||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x194')));break;case 0x8:if(_0x5e4edf[_0xa3c0('0x12d')]>=_0x2cad28[_0xa3c0('0x195')]-0x1){return!![];}hopperUtils[_0xa3c0('0xdd')]({'active':![],'countcongestionretry':_0x5e4edf[_0xa3c0('0x12d')]+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28['dialCongestionRetryFrequency'],_0xa3c0('0xdf'))['format'](_0xa3c0('0xc9')),'ContactId':_0x5e4edf[_0xa3c0('0xed')],'ListId':_0x5e4edf[_0xa3c0('0xee')],'VoiceQueueId':_0x5e4edf['VoiceQueueId']||undefined,'CampaignId':_0x5e4edf[_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x196')));break;case 0x0:if(_0x5e4edf[_0xa3c0('0x120')]>=_0x2cad28[_0xa3c0('0x197')]-0x1){return!![];}else{hopperUtils[_0xa3c0('0xdd')]({'active':![],'countnosuchnumberretry':_0x5e4edf[_0xa3c0('0x120')]+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28['dialNoSuchNumberRetryFrequency'],'minutes')[_0xa3c0('0x46')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5e4edf['ContactId'],'ListId':_0x5e4edf[_0xa3c0('0xee')],'VoiceQueueId':_0x5e4edf[_0xa3c0('0xe0')]||undefined,'CampaignId':_0x5e4edf['CampaignId']||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x198')));}break;case 0xa:if(_0x5e4edf[_0xa3c0('0xd8')]>=_0x2cad28['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xa3c0('0xdd')]({'active':![],'countdropretry':_0x5e4edf[_0xa3c0('0xd8')]+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28[_0xa3c0('0xd9')],_0xa3c0('0xdf'))[_0xa3c0('0x46')](_0xa3c0('0xc9')),'ContactId':_0x5e4edf[_0xa3c0('0xed')],'ListId':_0x5e4edf[_0xa3c0('0xee')],'VoiceQueueId':_0x5e4edf[_0xa3c0('0xe0')]||undefined,'CampaignId':_0x5e4edf[_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x199')));break;case 0xb:if(_0x5e4edf[_0xa3c0('0xec')]>=_0x2cad28[_0xa3c0('0xeb')]-0x1){return!![];}hopperUtils[_0xa3c0('0xdd')]({'active':![],'countabandonedretry':_0x5e4edf[_0xa3c0('0xec')]+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28[_0xa3c0('0xe9')],_0xa3c0('0xdf'))[_0xa3c0('0x46')](_0xa3c0('0xc9')),'ContactId':_0x5e4edf[_0xa3c0('0xed')],'ListId':_0x5e4edf[_0xa3c0('0xee')],'VoiceQueueId':_0x5e4edf['VoiceQueueId']||undefined,'CampaignId':_0x5e4edf['CampaignId']||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0xf0')));break;case 0x13:if(_0x5e4edf[_0xa3c0('0x11b')]>=_0x2cad28['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x5e4edf[_0xa3c0('0x11b')]+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28[_0xa3c0('0x127')],'minutes')[_0xa3c0('0x46')](_0xa3c0('0xc9')),'ContactId':_0x5e4edf[_0xa3c0('0xed')],'ListId':_0x5e4edf['ListId'],'VoiceQueueId':_0x5e4edf['VoiceQueueId']||undefined,'CampaignId':_0x5e4edf[_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x128')));break;case 0x14:if(_0x5e4edf[_0xa3c0('0x121')]>=_0x2cad28[_0xa3c0('0x19a')]-0x1){return!![];}hopperUtils[_0xa3c0('0xdd')]({'active':![],'countagentrejectretry':_0x5e4edf[_0xa3c0('0x121')]+=0x1,'scheduledat':moment()[_0xa3c0('0xde')](_0x2cad28['dialAgentRejectRetryFrequency'],_0xa3c0('0xdf'))['format'](_0xa3c0('0xc9')),'ContactId':_0x5e4edf[_0xa3c0('0xed')],'ListId':_0x5e4edf[_0xa3c0('0xee')],'VoiceQueueId':_0x5e4edf['VoiceQueueId']||undefined,'CampaignId':_0x5e4edf[_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x19b')));break;default:return!![];}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x10e')]=function(_0x3de66d,_0x203656,_0x2a8b95){var _0x4f0121=this;var _0xd2518c=new History(_0x3de66d);var _0x48ffba=![];var _0x4b3ad3;var _0x22ebb4;return new Promise(function(_0x42240a,_0xa9883e){if(_[_0xa3c0('0x40')](_0x203656)&&typeof _0x203656!==_0xa3c0('0x161')){return _0xa9883e(msgResponse(_0xa3c0('0x19c'),_0xa3c0('0x98'),_0xa3c0('0x19d')));}if(_[_0xa3c0('0x40')](_0x2a8b95)&&typeof _0x2a8b95!=='object'){return _0xa9883e(msgResponse(_0xa3c0('0x19c'),_0xa3c0('0x98'),'evt\x20is\x20undefine'));}hopperUtils['verifyAdditionalPhones'](_0xd2518c,_0x2a8b95[_0xa3c0('0xcb')],_0x203656)['then'](function(_0x48c644){if(_0x48c644[_0xa3c0('0xdb')]==0x1)_0x48ffba=!![];switch(_0x2a8b95['reason']){case'0':_0x203656[_0xa3c0('0x19e')]+=0x1;_0xd2518c['state']=0x0;_0xd2518c['statedesc']='NoSuchNumber';_0xd2518c[_0xa3c0('0x120')]+=0x1;_0xd2518c['countglobal']+=0x1;ami[_0xa3c0('0x41')](_0xa3c0('0x19f'),ut['buildObj'](_0x3de66d,'nosuchnumber'));_0x4b3ad3=_0x203656[_0xa3c0('0x1a0')];_0x22ebb4=_0x203656[_0xa3c0('0xda')];hopperUtils[_0xa3c0('0xd0')](_0xd2518c)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x11d')));if(_0x4f0121[_0xa3c0('0x190')](0x0,_0x3de66d,_0x203656)&&!_0x48ffba){if(_0xd2518c[_0xa3c0('0x120')]>=_0x203656[_0xa3c0('0x197')]){_0x4f0121[_0xa3c0('0x125')](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1a1'));}else{_0x4f0121['stateGlobal'](_0xd2518c,_0x42240a,_0xa9883e,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x203656[_0xa3c0('0x1a2')]+=0x1;_0xd2518c[_0xa3c0('0x71')]=0x3;_0xd2518c[_0xa3c0('0x72')]=_0xa3c0('0x1a3');_0xd2518c['countnoanswerretry']+=0x1;_0xd2518c[_0xa3c0('0xe8')]+=0x1;var _0x158bf9=ut[_0xa3c0('0x1a4')](_0x3de66d,_0x203656);ami['emit'](_0xa3c0('0x1a5'),_0x158bf9);_0x4b3ad3=_0x203656[_0xa3c0('0x191')];_0x22ebb4=_0x203656[_0xa3c0('0xda')];hopperUtils[_0xa3c0('0xd0')](_0xd2518c)['catch'](loggerCatch(_0xa3c0('0x1a6')));if(_0x4f0121['checkRetriveMax'](0x3,_0x3de66d,_0x203656)&&!_0x48ffba){if(_0xd2518c['countnoanswerretry']>=_0x203656['dialNoAnswerMaxRetry']){_0x4f0121[_0xa3c0('0x125')](_0xd2518c,_0x42240a,_0xa9883e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4f0121['stateGlobal'](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1a7'));}}break;case'5':_0x203656[_0xa3c0('0x1a8')]+=0x1;_0xd2518c[_0xa3c0('0x71')]=0x5;_0xd2518c[_0xa3c0('0x72')]='Busy';_0xd2518c[_0xa3c0('0x11e')]+=0x1;_0xd2518c[_0xa3c0('0xe8')]+=0x1;ami[_0xa3c0('0x41')](_0xa3c0('0x1a9'),ut[_0xa3c0('0x11c')](_0x3de66d,'busy'));_0x4b3ad3=_0x203656[_0xa3c0('0x193')];_0x22ebb4=_0x203656['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0xd2518c)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x1aa')));if(_0x4f0121[_0xa3c0('0x190')](0x5,_0x3de66d,_0x203656)&&!_0x48ffba){if(_0xd2518c[_0xa3c0('0x11e')]>=_0x203656[_0xa3c0('0x192')]){_0x4f0121[_0xa3c0('0x125')](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1ab'));}else{_0x4f0121[_0xa3c0('0x1ac')](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1ab'));}}break;case'8':_0x203656[_0xa3c0('0x1ad')]+=0x1;_0xd2518c[_0xa3c0('0x71')]=0x8;_0xd2518c['statedesc']=_0xa3c0('0x1ae');_0xd2518c['countcongestionretry']+=0x1;_0xd2518c['countglobal']+=0x1;_0x4b3ad3=_0x203656[_0xa3c0('0x1af')];_0x22ebb4=_0x203656[_0xa3c0('0xda')];ami[_0xa3c0('0x41')](_0xa3c0('0x1b0'),ut[_0xa3c0('0x11c')](_0x3de66d,'congestion'));hopperUtils['createHistory'](_0xd2518c)['catch'](loggerCatch(_0xa3c0('0x1b1')));if(_0x4f0121[_0xa3c0('0x190')](0x8,_0x3de66d,_0x203656)&&!_0x48ffba){if(_0xd2518c[_0xa3c0('0x12d')]>=_0x203656['dialCongestionMaxRetry']){_0x4f0121[_0xa3c0('0x125')](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1b2'));}else{_0x4f0121[_0xa3c0('0x1ac')](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1b2'));}}break;case'11':_0x203656['outboundAbandonedCallsDay']+=0x1;_0xd2518c[_0xa3c0('0x71')]=0xb;_0xd2518c[_0xa3c0('0x72')]='Abandoned';_0xd2518c[_0xa3c0('0xec')]+=0x1;_0xd2518c[_0xa3c0('0xe8')]+=0x1;_0x4b3ad3=_0x203656['dialAbandonedRetryFrequency'];_0x22ebb4=_0x203656[_0xa3c0('0xda')];hopperUtils[_0xa3c0('0xd0')](_0xd2518c)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0xf2')));if(_0x4f0121[_0xa3c0('0x190')](0xb,_0x3de66d,_0x203656)&&!_0x48ffba){if(_0xd2518c[_0xa3c0('0xec')]>=_0x203656['dialAbandonedMaxRetry']){_0x4f0121['createStateFinal'](_0xd2518c,_0x42240a,_0xa9883e,'reason\x2011\x20abandoned');}else{_0x4f0121['stateGlobal'](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1b3'));}}break;case'20':_0x203656[_0xa3c0('0x1b4')]+=0x1;_0xd2518c[_0xa3c0('0x71')]=0x14;_0xd2518c[_0xa3c0('0x72')]=_0xa3c0('0x1b5');_0xd2518c['countagentrejectretry']+=0x1;_0xd2518c[_0xa3c0('0xe8')]+=0x1;_0x4b3ad3=_0x203656[_0xa3c0('0x1b6')];_0x22ebb4=_0x203656[_0xa3c0('0xda')];ami[_0xa3c0('0x41')](_0xa3c0('0x1b7'),ut[_0xa3c0('0x11c')](_0x3de66d,_0xa3c0('0x1b8')));hopperUtils['createHistory'](_0xd2518c)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x1b9')));if(_0x4f0121['checkRetriveMax'](0x14,_0x3de66d,_0x203656)&&!_0x48ffba){if(_0xd2518c['countagentrejectretry']>=_0x203656[_0xa3c0('0x19a')]){_0x4f0121[_0xa3c0('0x125')](_0xd2518c,_0x42240a,_0xa9883e,'reason\x2020\x20agentreject');}else{_0x4f0121[_0xa3c0('0x1ac')](_0xd2518c,_0x42240a,_0xa9883e,_0xa3c0('0x1ba'));}}break;default:_0x203656[_0xa3c0('0x138')]+=0x1;_0xd2518c['state']=0xc;_0xd2518c[_0xa3c0('0x72')]=_0x2a8b95['reason'];_0x4b3ad3=_0x203656[_0xa3c0('0x1b6')];_0x22ebb4=_0x203656['callAdditionalPhoneAfterMin'];hopperUtils[_0xa3c0('0xd0')](_0xd2518c)[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x1bb')));if(_0x4f0121[_0xa3c0('0x190')](_0x2a8b95[_0xa3c0('0xcb')],_0x3de66d,_0x203656)&&!_0x48ffba){if(_0xd2518c[_0xa3c0('0x11e')]+_0xd2518c[_0xa3c0('0x12d')]+_0xd2518c[_0xa3c0('0x11f')]+_0xd2518c[_0xa3c0('0x120')]+_0xd2518c[_0xa3c0('0xd8')]+_0xd2518c[_0xa3c0('0xec')]+_0xd2518c[_0xa3c0('0x11b')]+_0xd2518c[_0xa3c0('0x121')]>=_0x203656[_0xa3c0('0x122')]){_0x4f0121[_0xa3c0('0x1ac')](_0xd2518c,_0x42240a,_0xa9883e,_0x2a8b95[_0xa3c0('0xcb')]);}else{_0x4f0121['createStateFinal'](_0xd2518c,_0x42240a,_0xa9883e,_0x2a8b95[_0xa3c0('0xcb')]);}}}})[_0xa3c0('0x3e')](function(){if(_0x48ffba){hopperUtils[_0xa3c0('0xe4')](_0xd2518c,_0x4b3ad3,_0x22ebb4)[_0xa3c0('0x3e')](function(){return _0x42240a(0x1);});}});});};Dialer['prototype']['stateGlobal']=function(_0x5e9525,_0x14ef6a,_0x20516b,_0x3b0b50){var _0x489908=new Final(_0x5e9525);_0x489908[_0xa3c0('0x71')]=0xf;_0x489908['statedesc']=_0xa3c0('0x1bc');this[_0xa3c0('0x125')](_0x489908,_0x14ef6a,_0x20516b,_0x3b0b50);};Dialer['prototype']['createStateFinal']=function(_0x36592b,_0x5d880c,_0x9d2fa7,_0x5557fe){hopperUtils[_0xa3c0('0x133')](_0x36592b)['then'](function(){return _0x5d880c(msgResponse(_0xa3c0('0x19c'),_0xa3c0('0x10d'),_0x5557fe));})[_0xa3c0('0xa7')](function(){return _0x9d2fa7(msgResponse('[moveContactManagedDialer][0]','Failure',_0xa3c0('0x1bd')));});};Dialer[_0xa3c0('0x1c')]['predictive']=function(_0x352c86){var _0x18528c=_0x352c86[_0xa3c0('0x1be')]/0x64;var _0x8a80bd=_0x352c86[_0xa3c0('0xd3')]/(_0x352c86[_0xa3c0('0xd3')]+_0x352c86['outboundAnswerCallsDay']);var _0x1f7ab1=Math[_0xa3c0('0x1bf')](_0x352c86[_0xa3c0('0x1c0')]*(_0x352c86[_0xa3c0('0x1c1')]/0x64));var _0xc04a37=Math[_0xa3c0('0x1bf')](_0x352c86[_0xa3c0('0x1c0')]*(_0x352c86['predictiveIntervalMinThreshold']/0x64));var _0x3f694d=_0x352c86[_0xa3c0('0x13d')]+_0x352c86['talking'];var _0x1a52d5=Math[_0xa3c0('0x1c2')](_0x352c86[_0xa3c0('0x5c')]*_0x352c86['erlangAbandonmentRate']*_0x352c86[_0xa3c0('0x1c3')]*_0x352c86[_0xa3c0('0x1c4')]);if(_[_0xa3c0('0x40')](_0x352c86[_0xa3c0('0x28')])){if(!_[_0xa3c0('0x40')](_0x352c86['startPredictive'])){_0x352c86[_0xa3c0('0x65')]=undefined;loggerPredictive['error'](_0xa3c0('0x1c5'),_0xa3c0('0x1c6'));}if(!_['isUndefined'](_0x352c86['handlePredictive'])){loggerPredictive[_0xa3c0('0x68')](_0xa3c0('0x1c5'),_0xa3c0('0x1c7'));clearInterval(_0x352c86[_0xa3c0('0x66')]);_0x352c86[_0xa3c0('0x66')]=undefined;}_0x352c86[_0xa3c0('0x28')]=moment()[_0xa3c0('0x46')](_0xa3c0('0xc9'));loggerPredictive[_0xa3c0('0x4a')](_0x352c86[_0xa3c0('0x48')],_0xa3c0('0x1c8'),_0x352c86[_0xa3c0('0x28')]);this[_0xa3c0('0xba')](_0x352c86,0x1);}else if(ifInterval(_0x352c86[_0xa3c0('0x1c9')],_0x352c86[_0xa3c0('0x28')])){this[_0xa3c0('0xba')](_0x352c86,0x1);loggerPredictiveCalls['info'](_0xa3c0('0x1ca'),_0x352c86[_0xa3c0('0x28')],_0x352c86[_0xa3c0('0x48')]);_0x352c86[_0xa3c0('0x5c')]=0x0;_0x352c86[_0xa3c0('0xd4')]=0x0;}else if(_0x18528c<_0x8a80bd&&_0x352c86[_0xa3c0('0x1cb')]===_0xa3c0('0x1cc')){clearPredictiveAttributes(_0x352c86);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x1cd'),'Dropped\x20calls\x20day',_0x8a80bd,_0xa3c0('0x28'),_0x352c86[_0xa3c0('0x48')]);}else if(_0x1a52d5<_0x352c86[_0xa3c0('0xd4')]&&_0x352c86[_0xa3c0('0x1cb')]===_0xa3c0('0x1cc')){clearPredictiveAttributes(_0x352c86);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x1ce'),_0xa3c0('0x1cf'),_0x1a52d5,_0xa3c0('0x1d0'),_0x352c86['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x352c86['name']);}else if(!ifInterval(_0x352c86[_0xa3c0('0x1c9')],_0x352c86['startProgressive'])&&_[_0xa3c0('0x40')](_0x352c86[_0xa3c0('0x65')])&&!_['isUndefined'](_0x352c86[_0xa3c0('0x28')])){_0x352c86['startPredictive']=moment()[_0xa3c0('0x46')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xa3c0('0x4a')](_0x352c86['name'],_0xa3c0('0x1d1'),_0x352c86[_0xa3c0('0x65')]);hopperUtils[_0xa3c0('0x1d2')](_0x352c86[_0xa3c0('0x1c9')])['then'](this['getDataPredictive'](_0x352c86))[_0xa3c0('0x3e')](mergeDataErlangB(_0x352c86))['then'](this['startMethodPredictive'](_0x352c86))[_0xa3c0('0xa7')](loggerCatchPredictive(_0xa3c0('0x1d3'),_0x352c86));}else if(!ifInterval(_0x352c86['dialPredictiveInterval'],_0x352c86[_0xa3c0('0x65')])){_0x352c86['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x352c86[_0xa3c0('0x65')]=moment()[_0xa3c0('0x46')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x352c86[_0xa3c0('0x48')],_0xa3c0('0x1d4'),_0x352c86[_0xa3c0('0x65')]);clearInterval(_0x352c86['handlePredictive']);_0x352c86[_0xa3c0('0x66')]=undefined;hopperUtils[_0xa3c0('0x1d2')](_0x352c86[_0xa3c0('0x1c9')])[_0xa3c0('0x3e')](this[_0xa3c0('0x1d5')](_0x352c86))['then'](mergeDataErlangB(_0x352c86))['then'](this[_0xa3c0('0x1d6')](_0x352c86))[_0xa3c0('0xa7')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x352c86));}else if(_0x352c86[_0xa3c0('0x1c0')]&&_0x3f694d<_0x352c86[_0xa3c0('0x1c0')]-_0xc04a37){clearPredictiveAttributes(_0x352c86);loggerPredictive[_0xa3c0('0x4a')](_0x352c86[_0xa3c0('0x48')],_0xa3c0('0x1d7'),_0x3f694d,')\x20are\x20less\x20than\x20threshold\x20(',_0x352c86[_0xa3c0('0x1c0')],'-',_0xc04a37,'=',_0x352c86[_0xa3c0('0x1c0')]-_0xc04a37,')');}else if(_0x352c86['predictiveIntervalAvailable']&&_0x3f694d>_0x352c86['predictiveIntervalAvailable']+_0x1f7ab1){clearPredictiveAttributes(_0x352c86);loggerPredictive['info'](_0x352c86['name'],_0xa3c0('0x1d7'),_0x3f694d,_0xa3c0('0x1d8'),_0x352c86['predictiveIntervalAvailable'],'+',_0x1f7ab1,'=',_0x352c86[_0xa3c0('0x1c0')]+_0x1f7ab1,')');}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x1d5')]=function(_0x37a736){var _0x3fdf70=this;return function(_0x34bb96){return new Promise(function(_0x5b2975,_0x225bb6){_[_0xa3c0('0x62')](_0x37a736,_0x34bb96[0x0]);if(checkGetDataPredictive(_0x34bb96[0x0])){var _0x58d7ff=_0x37a736[_0xa3c0('0x1c0')]=_0x37a736[_0xa3c0('0x1d9')]+_0x37a736[_0xa3c0('0x13d')];var _0x430331=_0x37a736[_0xa3c0('0x1c9')]*0x3c;var _0x3ac055=_0x34bb96[0x0][_0xa3c0('0x56')]+_0x34bb96[0x0][_0xa3c0('0x53')];var _0x4033a2=(_0x34bb96[0x0][_0xa3c0('0x4e')]+_0x34bb96[0x0][_0xa3c0('0x50')]+_0x34bb96[0x0][_0xa3c0('0x52')])/_0x34bb96[0x0][_0xa3c0('0x4c')];_0x37a736['predictiveIntervalHitRate']=_0x4033a2>0x0?_0x4033a2:0x1;switch(_0x37a736[_0xa3c0('0x1cb')]){case'dropRate':var _0x4f5fd4=_0x37a736['dialPredictiveOptimizationPercentage']/0x64;return _0x3fdf70['abandonmentRate'](_0x58d7ff,_0x430331,_0x3ac055,_0x4033a2,_0x4f5fd4)[_0xa3c0('0x3e')](function(_0x4dba87){return _0x5b2975(_0x4dba87);});case _0xa3c0('0x1da'):var _0x5a9f3c=_0x37a736[_0xa3c0('0x1be')]/0x64;return _0x3fdf70[_0xa3c0('0x1db')](_0x58d7ff,_0x430331,_0x3ac055,_0x4033a2,_0x5a9f3c)['then'](function(_0x5b3059){return _0x5b2975(_0x5b3059);});default:return _0x225bb6(msgResponse(_0xa3c0('0x1dc'),_0xa3c0('0x98'),'Unknown\x20Predictive'));}}else{return _0x225bb6(msgResponse('[getDataPredictive]',_0xa3c0('0x98'),_0xa3c0('0x1dd')));}});};};Dialer['prototype'][_0xa3c0('0x1de')]=function(_0x1a7f23){var _0x372965=this;return function(_0x5d733e){return new Promise(function(_0xbe880,_0x57360a){_[_0xa3c0('0x62')](_0x1a7f23,_0x5d733e[0x0]);if(checkGetDataPredictive(_0x5d733e[0x0])){loggerPredictive[_0xa3c0('0x4a')](JSON['stringify'](_0x5d733e[0x0]));if(_0x1a7f23[_0xa3c0('0x1cb')]===_0xa3c0('0x1cc')){return _0x372965[_0xa3c0('0x1df')](_0x1a7f23['id'])[_0xa3c0('0x3e')](function(_0x155162){var _0x9b6158=_0x1a7f23[_0xa3c0('0x1e0')]-_0x155162[0x0][_0xa3c0('0x1e1')];var _0x986867=_0x1a7f23[_0xa3c0('0x1c9')]*0x3c;var _0x2c4c01=_0x5d733e[0x0][_0xa3c0('0x56')]+_0x5d733e[0x0]['predictiveIntervalAvgHoldtime'];var _0x27fad6=(_0x5d733e[0x0][_0xa3c0('0x4e')]+_0x5d733e[0x0][_0xa3c0('0x50')]+_0x5d733e[0x0][_0xa3c0('0x52')])/_0x5d733e[0x0]['predictiveIntervalTotalCalls'];var _0x4c6407=_0x1a7f23[_0xa3c0('0x1be')]/0x64;_0x1a7f23[_0xa3c0('0x1e2')]=_0x155162[0x0]['outboundQueuePauses']||0x0;_0x1a7f23[_0xa3c0('0x1c3')]=_0x27fad6>0x0?_0x27fad6:0x1;return _0x372965[_0xa3c0('0x1e3')](_0x9b6158,_0x986867,_0x2c4c01,_0x27fad6,_0x4c6407);})[_0xa3c0('0x3e')](function(_0x30f487){return _0xbe880(_0x30f487);})[_0xa3c0('0xa7')](function(_0x2a0564){return _0x57360a(msgResponse(_0xa3c0('0x1e4'),_0xa3c0('0x98'),JSON[_0xa3c0('0x77')](_0x2a0564)));});}if(_0x1a7f23[_0xa3c0('0x1cb')]===_0xa3c0('0x1da')){return _0x372965[_0xa3c0('0x1df')](_0x1a7f23['id'])['then'](function(_0x15a8f1){var _0x2c40d3=_0x1a7f23[_0xa3c0('0x1e0')]-_0x15a8f1[0x0][_0xa3c0('0x1e1')];var _0x42ef13=_0x1a7f23[_0xa3c0('0x1c9')]*0x3c;var _0x3fcf5e=_0x5d733e[0x0][_0xa3c0('0x56')]+_0x5d733e[0x0][_0xa3c0('0x53')];var _0x44b6ff=(_0x5d733e[0x0]['predictiveIntervalAnsweredCalls']+_0x5d733e[0x0][_0xa3c0('0x50')]+_0x5d733e[0x0][_0xa3c0('0x52')])/_0x5d733e[0x0][_0xa3c0('0x4c')];var _0x4f90d2=_0x1a7f23['dialPredictiveOptimizationPercentage']/0x64;_0x1a7f23['predictiveIntervalPauses']=_0x15a8f1[0x0]['outboundQueuePauses']||0x0;_0x1a7f23['predictiveIntervalHitRate']=_0x44b6ff>0x0?_0x44b6ff:0x1;return _0x372965['busyFactor'](_0x2c40d3,_0x42ef13,_0x3fcf5e,_0x44b6ff,_0x4f90d2);})[_0xa3c0('0x3e')](function(_0x3a8aa6){return _0xbe880(_0x3a8aa6);})[_0xa3c0('0xa7')](function(_0x359329){return _0x57360a(msgResponse(_0xa3c0('0x1e4'),_0xa3c0('0x98'),JSON[_0xa3c0('0x77')](_0x359329)));});}}else{return _0x57360a(msgResponse(_0xa3c0('0x1dc'),_0xa3c0('0x98'),_0xa3c0('0x1dd')));}});};};Dialer[_0xa3c0('0x1c')]['startMethodPredictive']=function(_0x5540f7){var _0x2dd3a0=this;return function(){var _0x4c5da0=0x0;var _0x44598c=Math['floor'](_0x5540f7['erlangCallToSecond']*0x3e8);if(_0x44598c>0x0){_0x44598c=_0x44598c<0x64?0x64:_0x44598c;loggerPredictive['info'](_0x5540f7[_0xa3c0('0x48')],_0xa3c0('0x1e5'),_0x44598c,'milliseconds');_0x5540f7[_0xa3c0('0x66')]=setInterval(function(){_0x2dd3a0['handlePredictive'](_0x5540f7);loggerPredictiveCalls[_0xa3c0('0x4a')](_0xa3c0('0x1e6'),_0x4c5da0+=0x1);},_0x44598c);}else{loggerPredictive[_0xa3c0('0x4a')](_0x5540f7[_0xa3c0('0x48')],'fail\x20to\x20scheduled\x20calls');}};};Dialer['prototype'][_0xa3c0('0x1e7')]=function(_0xa86cf1,_0xce7564){var _0x229c1e=this;return function(_0x1c582c){if(_['isEmpty'](_0x1c582c)){if(_[_0xa3c0('0xf6')](_0xce7564[_0xa3c0('0x159')])||!_0xce7564[_0xa3c0('0x1e8')]){if(_0xa86cf1[_0xa3c0('0xb8')]===_0xa3c0('0x9')){_0xa86cf1[_0xa3c0('0x74')]=_[_0xa3c0('0x40')](_0xa86cf1['queueStatusComplete'])?!![]:_0xa86cf1['queueStatusComplete'];var _0x11be8d=uuid['v4']();_0x229c1e[_0xa3c0('0x27')][_0x11be8d]=new Action(_0xa86cf1,_0xce7564,_0x11be8d);loggerBooked['info'](_0xa3c0('0x1e9'),_0x11be8d,_0xa3c0('0x1ea'),JSON[_0xa3c0('0x77')](_0xa86cf1[_0xa3c0('0x74')]),_0xa3c0('0x1eb'),_0xa86cf1['name']);if(_0xa86cf1[_0xa3c0('0x74')]){_0xa86cf1[_0xa3c0('0x74')]=![];_0x229c1e[_0xa3c0('0x2a')][_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xc3')]]=[];ami[_0xa3c0('0xa0')]({'actionid':_0x11be8d,'action':_0xa3c0('0x1ec'),'queue':_0xa86cf1[_0xa3c0('0x48')]})['catch'](function(){_0x229c1e['updateOriginated'](_0xa86cf1);hopperUtils[_0xa3c0('0xdd')]({'active':![],'ContactId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xed')],'ListId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xee')],'VoiceQueueId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xe0')]||undefined,'CampaignId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x1ed')));delete _0x229c1e[_0xa3c0('0x27')][_0x11be8d];});}else{loggerBooked[_0xa3c0('0x4a')](_0xa3c0('0x1ee'),JSON[_0xa3c0('0x77')](_0xa86cf1[_0xa3c0('0x74')]),_0xa3c0('0x1eb'),_0xa86cf1[_0xa3c0('0x48')]);_0x229c1e[_0xa3c0('0xc8')](_0xa86cf1);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xed')],'ListId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xee')],'VoiceQueueId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d][_0xa3c0('0xe0')]||undefined,'CampaignId':_0x229c1e[_0xa3c0('0x27')][_0x11be8d]['CampaignId']||undefined})['catch'](loggerCatch(_0xa3c0('0x1ed')));delete _0x229c1e[_0xa3c0('0x27')][_0x11be8d];}}else{return _0x229c1e[_0xa3c0('0x160')](_0xa86cf1,_0xce7564);}}else{if(utils['getSeconds'](undefined,_0xce7564[_0xa3c0('0x1ef')])<_0xa86cf1[_0xa3c0('0x1f0')]*0x3c){if(_0xce7564['Agent']&&!_0xce7564[_0xa3c0('0x14c')]['voicePause']){_0x229c1e[_0xa3c0('0x21')][_0xa3c0('0x104')](_0xce7564['id'])[_0xa3c0('0x1f')](function(){_0x229c1e[_0xa3c0('0xc8')](_0xa86cf1);});}else{hopperUtils[_0xa3c0('0x1f1')]({'active':![]},_0xce7564['id'],0x1)[_0xa3c0('0x1f')](function(){_0x229c1e[_0xa3c0('0xc8')](_0xa86cf1);});}}else{_0xa86cf1[_0xa3c0('0x1f2')]+=0x1;_0x229c1e[_0xa3c0('0xc8')](_0xa86cf1);if(_0xa86cf1[_0xa3c0('0x1f3')]){hopperUtils[_0xa3c0('0xdd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xce7564[_0xa3c0('0xed')],'ListId':_0xce7564['ListId'],'VoiceQueueId':_0xce7564['VoiceQueueId']||undefined,'CampaignId':_0xce7564[_0xa3c0('0xef')]||undefined})[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x1f4')));hopperUtils[_0xa3c0('0xd0')](createObjHistory(_0xa86cf1,_0xce7564,utils[_0xa3c0('0x6b')]['QUEUE_RECALL'],0x17,'RecallInQueue'))['catch'](loggerCatch(_0xa3c0('0x1f5')));}else{_0x229c1e[_0xa3c0('0x12b')](createObjHistory(_0xa86cf1,_0xce7564,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0xa3c0('0x1f6'),_0xa3c0('0x1f7'));}}}}else{_0xa86cf1['outboundBlacklistCallsDay']+=0x1;_0x229c1e[_0xa3c0('0x12b')](createObjHistory(_0xa86cf1,_0xce7564,utils[_0xa3c0('0x6b')]['BLACKLIST'],0xd,_0xa3c0('0x1f8')),_0xa3c0('0x1f9'),_0xa3c0('0x1fa'));throw _0xa3c0('0x1fb');}};};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x15f')]=function(_0x1cabaa){var _0x3d3c22=this;var _0x3f1829=_0x1cabaa[_0xa3c0('0x1fc')]-_0x1cabaa[_0xa3c0('0x84')];emitCampaignSummary(_0x1cabaa);if(_0x3f1829>0x0&&_0x1cabaa['temp']==0x0){if(_0x3f1829>this[_0xa3c0('0x26')]){_0x3f1829=this['maxNumberOriginate'];}_0x1cabaa[_0xa3c0('0x1fd')]=0x1;hopperUtils[_0xa3c0('0x1fe')](_0x1cabaa,_0x3f1829)[_0xa3c0('0x3e')](function(_0x167da6){_0x1cabaa[_0xa3c0('0x1fd')]=0x0;if(_0x167da6){if(!utils[_0xa3c0('0x1ff')](_0x167da6)){_0x1cabaa['message']=utils[_0xa3c0('0x6b')][_0xa3c0('0x6f')];logger[_0xa3c0('0x4a')]('[getContactCampaign2][Empty]'+_0x1cabaa[_0xa3c0('0x48')]);}else{_0x1cabaa[_0xa3c0('0x84')]+=_0x167da6[_0xa3c0('0x9e')];_0x1cabaa[_0xa3c0('0x6e')]=utils[_0xa3c0('0x6b')][_0xa3c0('0x200')];for(var _0x40732d=0x0;_0x40732d<_0x167da6['length'];_0x40732d+=0x1){_0x1cabaa[_0xa3c0('0x201')]+=0x1;if(_[_0xa3c0('0xf6')](_0x167da6[_0x40732d])||_['isNil'](_0x167da6[_0x40732d][_0xa3c0('0x17d')])||_[_0xa3c0('0xf6')](_0x167da6[_0x40732d]['phone'])){_0x3d3c22[_0xa3c0('0x157')](_0xa3c0('0x202'),_0x1cabaa,_0x167da6[_0x40732d]);}else{hopperUtils[_0xa3c0('0x203')](_[_0xa3c0('0x78')](_0x167da6[_0x40732d],[_0xa3c0('0xef'),'phone']))[_0xa3c0('0x3e')](_0x3d3c22[_0xa3c0('0x1e7')](_0x1cabaa,_0x167da6[_0x40732d]))['catch'](_0x3d3c22[_0xa3c0('0x156')]('[actionOriginateIvr]\x20',_0x1cabaa));}}}}})['catch'](loggerGetContactDialer(_0xa3c0('0x204'),_0x1cabaa,_0x3f1829));}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0xba')]=function(_0x575371,_0x24e235){var _0xeecc6f=this;var _0x38d1b3=[];if(_0x24e235<0x1||_0x575371['dialMethod']==='booked'){_0x24e235=0x1;}var _0xe9468f=Math['floor'](_0x575371['available']*_0x24e235)-_0x575371['originated'];if(_0x575371[_0xa3c0('0x205')]>0x0){var _0x2823f9=_0x575371[_0xa3c0('0x205')]-_0x575371['originated']-_0x575371[_0xa3c0('0x1d9')]-_0x575371['pTalking'];if(_0xe9468f>_0x2823f9){_0xe9468f=_0x2823f9;}}if(_0xe9468f>0x0&&_0x575371[_0xa3c0('0x1fd')]==0x0){if(_0x575371['dialMethod']===_0xa3c0('0x9')){_0xe9468f=0x1;}if(_0xe9468f>this[_0xa3c0('0x26')]){_0xe9468f=this[_0xa3c0('0x26')];}for(var _0x2e115f in this[_0xa3c0('0x24')]){if(typeof this[_0xa3c0('0x24')][_0x2e115f]!=='undefined'){if(this['agents'][_0x2e115f][_0xa3c0('0x71')]===_0xa3c0('0x206')&&this['agents'][_0x2e115f][_0xa3c0('0x8d')]===_0xa3c0('0x8e')){_0x38d1b3[_0xa3c0('0x9f')](this[_0xa3c0('0x24')][_0x2e115f]['id']);}}}_0x575371[_0xa3c0('0x1fd')]=0x1;hopperUtils[_0xa3c0('0x207')](_0x575371,_0x38d1b3,_0xe9468f)['then'](function(_0x471496){_0x575371[_0xa3c0('0x1fd')]=0x0;if(_0x471496){if(!utils[_0xa3c0('0x1ff')](_0x471496)){hopperUtils[_0xa3c0('0x208')](_0x575371)[_0xa3c0('0x3e')](sendMessageReschedule(_0x575371))[_0xa3c0('0xa7')](loggerCatch('[countReScheduled]\x20'));}else{_0x575371[_0xa3c0('0x84')]+=_0x471496[_0xa3c0('0x9e')];_0x575371[_0xa3c0('0x6e')]=_0x575371['dialMethod']===_0xa3c0('0x9')?utils[_0xa3c0('0x6b')][_0xa3c0('0x140')]:utils[_0xa3c0('0x6b')][_0xa3c0('0x200')];for(var _0x30ee1c=0x0;_0x30ee1c<_0x471496[_0xa3c0('0x9e')];_0x30ee1c+=0x1){if(_[_0xa3c0('0xf6')](_0x471496[_0x30ee1c])||_[_0xa3c0('0xf6')](_0x471496[_0x30ee1c][_0xa3c0('0x17d')])||_[_0xa3c0('0xf6')](_0x471496[_0x30ee1c][_0xa3c0('0x163')])){_0xeecc6f['emptyContact'](_0xa3c0('0x202'),_0x575371,_0x471496[_0x30ee1c]);}else{hopperUtils['checkIsBlackList'](_[_0xa3c0('0x78')](_0x471496[_0x30ee1c],[_0xa3c0('0xe0'),_0xa3c0('0x163')]))[_0xa3c0('0x3e')](_0xeecc6f[_0xa3c0('0x1e7')](_0x575371,_0x471496[_0x30ee1c]))[_0xa3c0('0xa7')](_0xeecc6f['loggerHandler'](_0xa3c0('0x202'),_0x575371));}}}}})[_0xa3c0('0xa7')](loggerGetContactDialer('[getContactDialer2]',_0x575371,_0xe9468f));}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x66')]=function(_0x5d0054){if(_0x5d0054['dialLimitQueue']>0x0){var _0x437dc3=_0x5d0054[_0xa3c0('0x205')]-_0x5d0054['originated']-_0x5d0054[_0xa3c0('0x1d9')];if(_0x437dc3>0x0&&_0x5d0054[_0xa3c0('0x1fd')]==0x0){this[_0xa3c0('0x209')](_0x5d0054);}else{loggerPredictiveCalls[_0xa3c0('0x4a')](_0xa3c0('0x20a'));}}else{this[_0xa3c0('0x209')](_0x5d0054);}};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x209')]=function(_0x1f47cd){var _0x4e4afc=this;var _0x27ae76=[];_0x1f47cd[_0xa3c0('0x84')]+=0x1;for(var _0x3e235e in this['agents']){if(typeof this[_0xa3c0('0x24')][_0x3e235e]!=='undefined'){if(this[_0xa3c0('0x24')][_0x3e235e][_0xa3c0('0x71')]==='not_inuse'&&this[_0xa3c0('0x24')][_0x3e235e][_0xa3c0('0x8d')]===_0xa3c0('0x8e')){_0x27ae76['push'](this[_0xa3c0('0x24')][_0x3e235e]['id']);}}}_0x1f47cd[_0xa3c0('0x1fd')]=0x1;return this[_0xa3c0('0x207')](_0x1f47cd['id'],_0x27ae76,0x1,_0x1f47cd[_0xa3c0('0x20b')],_0x1f47cd)[_0xa3c0('0x3e')](function(_0x34341f){_0x1f47cd[_0xa3c0('0x1fd')]=0x1;if(_0x34341f){if(!utils[_0xa3c0('0x1ff')](_0x34341f)){utils['checkContactLowerLimitOriginate'](_0x1f47cd,0x1,0x0);return hopperUtils['countReScheduled'](_0x1f47cd)['then'](sendMessageReschedule(_0x1f47cd))[_0xa3c0('0xa7')](loggerCatch(_0xa3c0('0x20c')));}else{_0x1f47cd[_0xa3c0('0x6e')]=utils[_0xa3c0('0x6b')]['RUNNING'];if(_['isNil'](_0x34341f[0x0])||_[_0xa3c0('0xf6')](_0x34341f[0x0]['Contact'])||_[_0xa3c0('0xf6')](_0x34341f[0x0]['phone'])){_0x4e4afc[_0xa3c0('0x157')](_0xa3c0('0x202'),_0x1f47cd,_0x34341f[0x0]);}else{return hopperUtils[_0xa3c0('0x20d')](_[_0xa3c0('0x78')](_0x34341f[0x0],[_0xa3c0('0xe0'),_0xa3c0('0x163')]))[_0xa3c0('0x3e')](_0x4e4afc[_0xa3c0('0x1e7')](_0x1f47cd,_0x34341f[0x0]))[_0xa3c0('0xa7')](_0x4e4afc[_0xa3c0('0x156')](_0xa3c0('0x20e'),_0x1f47cd));}}}})['catch'](loggerGetContactDialer(_0xa3c0('0x20f'),_0x1f47cd,0x1));};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x1e3')]=function(_0x3e0748,_0x487ca5,_0x4e9799,_0x4ee582,_0x251692,_0x2e9afb){loggerPredictive['info'](_0xa3c0('0x210'));loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x211'),_0x3e0748);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x487ca5);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x212'),_0x4e9799);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x213'),_0x4ee582);loggerPredictive[_0xa3c0('0x4a')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x251692);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x55'));return new Promise(function(_0x3097be,_0x821e52){if(_0x3e0748<=0x0||isNaN(_0x3e0748)){return _0x821e52(msgResponse('[abandonmentRate]',_0xa3c0('0x8a'),_0xa3c0('0x214')+_0x3e0748));}if(_0x4e9799<=0x0||isNaN(_0x4e9799)){return _0x821e52(msgResponse(_0xa3c0('0x215'),_0xa3c0('0x8a'),_0xa3c0('0x216')+_0x4e9799));}if(_0x4ee582<=0x0||isNaN(_0x4ee582)){return _0x821e52(msgResponse(_0xa3c0('0x215'),_0xa3c0('0x8a'),_0xa3c0('0x217')+_0x4ee582));}if(_0x487ca5<=0x0||isNaN(_0x487ca5)){return _0x821e52(msgResponse(_0xa3c0('0x215'),'Error','interval\x20=\x20'+_0x487ca5));}if(_0x251692<=0x0||isNaN(_0x251692)){return _0x821e52(msgResponse(_0xa3c0('0x215'),_0xa3c0('0x8a'),_0xa3c0('0x218')+_0x251692));}_0x2e9afb=_0x2e9afb||0x0;var _0x51b614=0x1/_0x4e9799;var _0xe0a793=0x0;var _0x5de602=0x0;var _0x467f09=0x0;var _0x3d7a26=0x0;for(var _0x586a04=0x0;_0x467f09<_0x251692;_0x586a04+=0x1){_0x5de602=_0x586a04/_0x487ca5;_0xe0a793=(_0x4ee582*_0x5de602+_0x2e9afb)/_0x51b614;_0x467f09=utils[_0xa3c0('0x219')](_0xe0a793,_0x3e0748);_0x3d7a26=_0xe0a793/_0x3e0748*(0x1-utils['erlangb'](_0xe0a793,_0x3e0748));}return _0x3097be({'erlangCalls':_0x586a04,'erlangCallToSecond':_0x487ca5/_0x586a04,'erlangAbandonmentRate':_0x467f09,'erlangBusyFactor':_0x3d7a26});});};Dialer[_0xa3c0('0x1c')][_0xa3c0('0x1db')]=function(_0x3d7039,_0x528c54,_0x215484,_0x1c5273,_0xe5ff9e,_0x342b78){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xa3c0('0x4a')]('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',_0x3d7039);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x21a'),_0x528c54);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x212'),_0x215484);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x213'),_0x1c5273);loggerPredictive[_0xa3c0('0x4a')](_0xa3c0('0x21b'),_0xe5ff9e);loggerPredictive['info'](_0xa3c0('0x55'));return new Promise(function(_0x554cd8,_0x2dbea2){if(_0x3d7039<=0x0||isNaN(_0x3d7039)){return _0x2dbea2(msgResponse(_0xa3c0('0x21c'),_0xa3c0('0x8a'),'m\x20=\x20'+_0x3d7039));}if(_0x215484<=0x0||isNaN(_0x215484)){return _0x2dbea2(msgResponse(_0xa3c0('0x21c'),'Error','Ts\x20=\x20'+_0x215484));}if(_0x1c5273<=0x0||isNaN(_0x1c5273)){return _0x2dbea2(msgResponse(_0xa3c0('0x21c'),_0xa3c0('0x8a'),'p\x20=\x20'+_0x1c5273));}if(_0x528c54<=0x0||isNaN(_0x528c54)){return _0x2dbea2(msgResponse(_0xa3c0('0x21c'),_0xa3c0('0x8a'),_0xa3c0('0x21d')+_0x528c54));}if(_0xe5ff9e<=0x0||isNaN(_0xe5ff9e)){return _0x2dbea2(msgResponse('[busyFactor]',_0xa3c0('0x8a'),_0xa3c0('0x21e')+_0xe5ff9e));}_0x342b78=_0x342b78||0x0;var _0x5659d4=0x1/_0x215484;var _0x415ca3=0x0;var _0x1b856e=0x0;var _0x585bf7=0x0;var _0x10c550=0x0;for(var _0x3a5295=0x0;_0x10c550<_0xe5ff9e;_0x3a5295+=0x1){_0x1b856e=_0x3a5295/_0x528c54;_0x415ca3=(_0x1c5273*_0x1b856e+_0x342b78)/_0x5659d4;_0x585bf7=utils[_0xa3c0('0x219')](_0x415ca3,_0x3d7039);_0x10c550=_0x415ca3/_0x3d7039*(0x1-utils[_0xa3c0('0x219')](_0x415ca3,_0x3d7039));}return _0x554cd8({'erlangCalls':_0x3a5295,'erlangCallToSecond':_0x528c54/_0x3a5295,'erlangAbandonmentRate':_0x585bf7,'erlangBusyFactor':_0x10c550});});};module[_0xa3c0('0x21f')]=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 0cd10af..37c1fe1 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 _0xc94c=['firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','lodash','moment','isNil','string','voiceQueue','name','Contact','phone','lastName','number','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper'];(function(_0x5e0b9b,_0x10e7f3){var _0x2b6bee=function(_0x5efb51){while(--_0x5efb51){_0x5e0b9b['push'](_0x5e0b9b['shift']());}};_0x2b6bee(++_0x10e7f3);}(_0xc94c,0x19c));var _0xcc94=function(_0x33d7a1,_0x7ff978){_0x33d7a1=_0x33d7a1-0x0;var _0x426e90=_0xc94c[_0x33d7a1];return _0x426e90;};'use strict';var util=require('util');var _=require(_0xcc94('0x0'));var moment=require(_0xcc94('0x1'));function checkNameSurname(_0x32a0ae,_0x5c3f3f,_0x4c99a0){var _0x118667='';if(!_[_0xcc94('0x2')](_0x5c3f3f)&&_0xcc94('0x3')===typeof _0x5c3f3f){_0x118667+=_0x5c3f3f;}if(!_[_0xcc94('0x2')](_0x4c99a0)&&_0xcc94('0x3')===typeof _0x4c99a0){_0x118667+='\x20'+_0x4c99a0;}if(_0x118667!==''){return _0x118667;}return _0x32a0ae;}function Action(_0x2e7195,_0x1a2b76,_0x1ea25f){this[_0xcc94('0x4')]=_0x2e7195;this['uniqueid']=_0x1ea25f||undefined;this[_0xcc94('0x5')]=checkNameSurname(_0x1a2b76[_0xcc94('0x6')][_0xcc94('0x7')],_0x1a2b76[_0xcc94('0x6')]['firstName'],_0x1a2b76['Contact'][_0xcc94('0x8')]);this[_0xcc94('0x9')]=_0x1a2b76['phone'];this[_0xcc94('0xa')]=_0x2e7195[_0xcc94('0x5')];this[_0xcc94('0xb')]=_0x1a2b76[_0xcc94('0xb')]||![];this[_0xcc94('0xc')]=_0x2e7195['type'];this['dialQueueTimeout']=_0x2e7195['dialQueueTimeout']||0x3;this['scheduledat']=_0x1a2b76[_0xcc94('0xd')];this['countbusyretry']=_0x1a2b76[_0xcc94('0xe')];this[_0xcc94('0xf')]=_0x1a2b76[_0xcc94('0xf')];this['countnoanswerretry']=_0x1a2b76[_0xcc94('0x10')];this[_0xcc94('0x11')]=_0x1a2b76[_0xcc94('0x11')];this[_0xcc94('0x12')]=_0x1a2b76[_0xcc94('0x12')];this[_0xcc94('0x13')]=_0x1a2b76[_0xcc94('0x13')];this[_0xcc94('0x14')]=_0x1a2b76[_0xcc94('0x14')];this[_0xcc94('0x15')]=_0x1a2b76[_0xcc94('0x15')];this[_0xcc94('0x16')]=_0x1a2b76[_0xcc94('0x16')];this[_0xcc94('0x17')]=_0x1a2b76[_0xcc94('0x17')];this[_0xcc94('0x18')]=_0x1a2b76[_0xcc94('0x18')];this[_0xcc94('0x19')]=_0x1a2b76['VoiceQueueId'];this[_0xcc94('0x1a')]=_0x1a2b76[_0xcc94('0x1a')];this[_0xcc94('0x1b')]=_0x1a2b76['id'];this['ContactFirstName']=_0x1a2b76[_0xcc94('0x6')][_0xcc94('0x1c')]||'';this[_0xcc94('0x1d')]=moment()[_0xcc94('0x1e')](_0xcc94('0x1f'));this[_0xcc94('0x20')]=_0x1a2b76[_0xcc94('0x20')];this[_0xcc94('0x21')]=_0x1a2b76['callbackuniqueid'];this[_0xcc94('0x22')]=_0x1a2b76[_0xcc94('0x22')];this[_0xcc94('0x23')]=_0x1a2b76[_0xcc94('0x23')];this[_0xcc94('0x24')]='';this[_0xcc94('0x25')]='';}Action[_0xcc94('0x26')][_0xcc94('0x27')]=function(){return util['format'](_0xcc94('0x28'),this[_0xcc94('0x5')],this['voiceQueue'][_0xcc94('0x29')]>0x0?this['number'][_0xcc94('0x2a')](this[_0xcc94('0x4')][_0xcc94('0x29')]):this[_0xcc94('0x9')]);};Action[_0xcc94('0x26')][_0xcc94('0x2b')]=function(){return this['queue'];};module['exports']=Action; \ No newline at end of file +var _0xd896=['callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','dialCutDigit','substring','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ListId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x475ef5,_0x1d4435){var _0x4109a4=function(_0x405e2b){while(--_0x405e2b){_0x475ef5['push'](_0x475ef5['shift']());}};_0x4109a4(++_0x1d4435);}(_0xd896,0x81));var _0x6d89=function(_0x5c406d,_0x430fdd){_0x5c406d=_0x5c406d-0x0;var _0x1d5827=_0xd896[_0x5c406d];return _0x1d5827;};'use strict';var util=require(_0x6d89('0x0'));var _=require('lodash');var moment=require(_0x6d89('0x1'));function checkNameSurname(_0x42d8f8,_0x414910,_0x50c4bd){var _0x289a11='';if(!_[_0x6d89('0x2')](_0x414910)&&_0x6d89('0x3')===typeof _0x414910){_0x289a11+=_0x414910;}if(!_[_0x6d89('0x2')](_0x50c4bd)&&_0x6d89('0x3')===typeof _0x50c4bd){_0x289a11+='\x20'+_0x50c4bd;}if(_0x289a11!==''){return _0x289a11;}return _0x42d8f8;}function Action(_0x4d0493,_0x5a2d51,_0x1ce158){this[_0x6d89('0x4')]=_0x4d0493;this[_0x6d89('0x5')]=_0x1ce158||undefined;this[_0x6d89('0x6')]=checkNameSurname(_0x5a2d51[_0x6d89('0x7')][_0x6d89('0x8')],_0x5a2d51['Contact']['firstName'],_0x5a2d51[_0x6d89('0x7')][_0x6d89('0x9')]);this[_0x6d89('0xa')]=_0x5a2d51[_0x6d89('0x8')];this[_0x6d89('0xb')]=_0x4d0493[_0x6d89('0x6')];this[_0x6d89('0xc')]=_0x5a2d51[_0x6d89('0xc')]||![];this['type']=_0x4d0493[_0x6d89('0xd')];this[_0x6d89('0xe')]=_0x4d0493[_0x6d89('0xe')]||0x3;this[_0x6d89('0xf')]=_0x5a2d51[_0x6d89('0xf')];this['countbusyretry']=_0x5a2d51['countbusyretry'];this[_0x6d89('0x10')]=_0x5a2d51[_0x6d89('0x10')];this[_0x6d89('0x11')]=_0x5a2d51[_0x6d89('0x11')];this[_0x6d89('0x12')]=_0x5a2d51[_0x6d89('0x12')];this[_0x6d89('0x13')]=_0x5a2d51[_0x6d89('0x13')];this[_0x6d89('0x14')]=_0x5a2d51[_0x6d89('0x14')];this['countmachineretry']=_0x5a2d51['countmachineretry'];this[_0x6d89('0x15')]=_0x5a2d51[_0x6d89('0x15')];this['ContactId']=_0x5a2d51['ContactId'];this[_0x6d89('0x16')]=_0x5a2d51[_0x6d89('0x16')];this['UserId']=_0x5a2d51['UserId'];this['VoiceQueueId']=_0x5a2d51['VoiceQueueId'];this[_0x6d89('0x17')]=_0x5a2d51['CampaignId'];this[_0x6d89('0x18')]=_0x5a2d51['id'];this[_0x6d89('0x19')]=_0x5a2d51[_0x6d89('0x7')][_0x6d89('0x1a')]||'';this[_0x6d89('0x1b')]=moment()[_0x6d89('0x1c')](_0x6d89('0x1d'));this[_0x6d89('0x1e')]=_0x5a2d51[_0x6d89('0x1e')];this[_0x6d89('0x1f')]=_0x5a2d51[_0x6d89('0x1f')];this[_0x6d89('0x20')]=_0x5a2d51[_0x6d89('0x20')];this[_0x6d89('0x21')]=_0x5a2d51[_0x6d89('0x21')];this[_0x6d89('0x22')]='';this[_0x6d89('0x23')]='';}Action[_0x6d89('0x24')]['getCaller']=function(){return util[_0x6d89('0x1c')]('\x22%s\x22\x20<%s>',this[_0x6d89('0x6')],this['voiceQueue'][_0x6d89('0x25')]>0x0?this[_0x6d89('0xa')][_0x6d89('0x26')](this['voiceQueue'][_0x6d89('0x25')]):this[_0x6d89('0xa')]);};Action['prototype']['getQueue']=function(){return this[_0x6d89('0xb')];};module[_0x6d89('0x27')]=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 69bd509..3696baa 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 _0x7742=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','queue'];(function(_0x30f881,_0xb20ecb){var _0x2d7837=function(_0x4e9c8a){while(--_0x4e9c8a){_0x30f881['push'](_0x30f881['shift']());}};_0x2d7837(++_0xb20ecb);}(_0x7742,0x12b));var _0x2774=function(_0x2bcaa0,_0x23375c){_0x2bcaa0=_0x2bcaa0-0x0;var _0x37b9d3=_0x7742[_0x2bcaa0];return _0x37b9d3;};'use strict';var moment=require(_0x2774('0x0'));var utils=require(_0x2774('0x1'));function AgentComplete(_0x297cce,_0x3a0ad5){this[_0x2774('0x2')]=0x4;this[_0x2774('0x3')]=_0x2774('0x4');this[_0x2774('0x5')]=_0x297cce[_0x2774('0x5')];this[_0x2774('0x6')]=_0x297cce[_0x2774('0x6')];this[_0x2774('0x7')]=_0x297cce[_0x2774('0x6')]==='outbound'?_0x2774('0x8'):_0x297cce['type'];this[_0x2774('0x9')]=_0x297cce[_0x2774('0x9')];this[_0x2774('0xa')]=_0x297cce[_0x2774('0xa')];this['countnoanswerretry']=_0x297cce[_0x2774('0xb')];this[_0x2774('0xc')]=_0x297cce[_0x2774('0x9')]+_0x297cce[_0x2774('0xa')]+_0x297cce[_0x2774('0xb')]+_0x297cce[_0x2774('0xd')]+_0x297cce[_0x2774('0xe')]+_0x297cce[_0x2774('0xf')]+_0x297cce[_0x2774('0x10')]+_0x297cce[_0x2774('0x11')];this[_0x2774('0xd')]=_0x297cce[_0x2774('0xd')];this[_0x2774('0xe')]=_0x297cce['countdropretry'];this['countabandonedretry']=_0x297cce[_0x2774('0xf')];this[_0x2774('0x10')]=_0x297cce['countmachineretry'];this[_0x2774('0x11')]=_0x297cce[_0x2774('0x11')];this[_0x2774('0x12')]=_0x3a0ad5[_0x2774('0x12')];this[_0x2774('0x13')]=_0x297cce['name'];this[_0x2774('0x14')]=_0x297cce[_0x2774('0x15')];this[_0x2774('0x16')]=_0x297cce['starttime'];this['responsetime']=_0x297cce[_0x2774('0x17')];this['answertime']=_0x297cce[_0x2774('0x18')];this['endtime']=moment()['format'](_0x2774('0x19'));this[_0x2774('0x1a')]=utils[_0x2774('0x1b')](_0x297cce[_0x2774('0x17')],_0x297cce[_0x2774('0x16')]);this[_0x2774('0x1c')]=utils[_0x2774('0x1b')](_0x297cce[_0x2774('0x18')],_0x297cce[_0x2774('0x17')]);this[_0x2774('0x1d')]=utils[_0x2774('0x1b')](this[_0x2774('0x1e')],_0x297cce[_0x2774('0x18')]);this[_0x2774('0x8')]=_0x3a0ad5[_0x2774('0x8')];this[_0x2774('0x1f')]=_0x3a0ad5[_0x2774('0x1f')];this[_0x2774('0x20')]=_0x3a0ad5[_0x2774('0x20')];this[_0x2774('0x21')]=_0x297cce[_0x2774('0x21')];this[_0x2774('0x22')]=_0x297cce['callbackuniqueid'];this[_0x2774('0x23')]=_0x297cce[_0x2774('0x23')];this[_0x2774('0x24')]=_0x297cce[_0x2774('0x24')];this[_0x2774('0x25')]=_0x297cce[_0x2774('0x25')];this[_0x2774('0x26')]=_0x297cce['ListId'];this[_0x2774('0x27')]=_0x297cce['UserId'];this[_0x2774('0x28')]=_0x297cce['VoiceQueueId'];this[_0x2774('0x29')]=_0x297cce[_0x2774('0x29')];this[_0x2774('0x2a')]=_0x297cce[_0x2774('0x2a')]||'';this['originatecalleridname']=_0x297cce['originatecalleridname']||'';this['agiafterat']=_0x297cce['agiafterat'];}module[_0x2774('0x2b')]=AgentComplete; \ No newline at end of file +var _0x0ea4=['countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','callback','callbackat','recallme','ContactId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x0ea4,0x1ec));var _0x40ea=function(_0x4226e5,_0x14fd26){_0x4226e5=_0x4226e5-0x0;var _0x1dcd33=_0x0ea4[_0x4226e5];return _0x1dcd33;};'use strict';var moment=require(_0x40ea('0x0'));var utils=require(_0x40ea('0x1'));function AgentComplete(_0x4323ef,_0x30cae4){this[_0x40ea('0x2')]=0x4;this[_0x40ea('0x3')]=_0x40ea('0x4');this[_0x40ea('0x5')]=_0x4323ef[_0x40ea('0x5')];this[_0x40ea('0x6')]=_0x4323ef['type'];this[_0x40ea('0x7')]=_0x4323ef['type']===_0x40ea('0x8')?_0x40ea('0x9'):_0x4323ef[_0x40ea('0x6')];this['countbusyretry']=_0x4323ef[_0x40ea('0xa')];this[_0x40ea('0xb')]=_0x4323ef[_0x40ea('0xb')];this[_0x40ea('0xc')]=_0x4323ef[_0x40ea('0xc')];this[_0x40ea('0xd')]=_0x4323ef['countbusyretry']+_0x4323ef['countcongestionretry']+_0x4323ef[_0x40ea('0xc')]+_0x4323ef[_0x40ea('0xe')]+_0x4323ef[_0x40ea('0xf')]+_0x4323ef[_0x40ea('0x10')]+_0x4323ef[_0x40ea('0x11')]+_0x4323ef[_0x40ea('0x12')];this[_0x40ea('0xe')]=_0x4323ef[_0x40ea('0xe')];this[_0x40ea('0xf')]=_0x4323ef[_0x40ea('0xf')];this[_0x40ea('0x10')]=_0x4323ef[_0x40ea('0x10')];this['countmachineretry']=_0x4323ef[_0x40ea('0x11')];this[_0x40ea('0x12')]=_0x4323ef[_0x40ea('0x12')];this[_0x40ea('0x13')]=_0x30cae4['uniqueid'];this['calleridname']=_0x4323ef['name'];this[_0x40ea('0x14')]=_0x4323ef[_0x40ea('0x15')];this['starttime']=_0x4323ef[_0x40ea('0x16')];this['responsetime']=_0x4323ef[_0x40ea('0x17')];this[_0x40ea('0x18')]=_0x4323ef[_0x40ea('0x18')];this[_0x40ea('0x19')]=moment()[_0x40ea('0x1a')](_0x40ea('0x1b'));this[_0x40ea('0x1c')]=utils[_0x40ea('0x1d')](_0x4323ef[_0x40ea('0x17')],_0x4323ef[_0x40ea('0x16')]);this[_0x40ea('0x1e')]=utils['getSeconds'](_0x4323ef[_0x40ea('0x18')],_0x4323ef['responsetime']);this[_0x40ea('0x1f')]=utils[_0x40ea('0x1d')](this['endtime'],_0x4323ef[_0x40ea('0x18')]);this['queue']=_0x30cae4[_0x40ea('0x9')];this['membername']=_0x30cae4['membername'];this['reason']=_0x30cae4['reason'];this[_0x40ea('0x20')]=_0x4323ef['callback'];this['callbackuniqueid']=_0x4323ef['callbackuniqueid'];this[_0x40ea('0x21')]=_0x4323ef[_0x40ea('0x21')];this[_0x40ea('0x22')]=_0x4323ef['recallme'];this[_0x40ea('0x23')]=_0x4323ef[_0x40ea('0x23')];this['ListId']=_0x4323ef['ListId'];this['UserId']=_0x4323ef['UserId'];this[_0x40ea('0x24')]=_0x4323ef['VoiceQueueId'];this[_0x40ea('0x25')]=_0x4323ef[_0x40ea('0x25')];this[_0x40ea('0x26')]=_0x4323ef[_0x40ea('0x26')]||'';this[_0x40ea('0x27')]=_0x4323ef[_0x40ea('0x27')]||'';this[_0x40ea('0x28')]=_0x4323ef[_0x40ea('0x28')];}module[_0x40ea('0x29')]=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 73d7a7b..77ad34c 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 _0x9086=['CampaignId','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','calleridname','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x5edf49,_0x598d93){var _0x4c6590=function(_0x45f646){while(--_0x45f646){_0x5edf49['push'](_0x5edf49['shift']());}};_0x4c6590(++_0x598d93);}(_0x9086,0x84));var _0x6908=function(_0x491468,_0x42f169){_0x491468=_0x491468-0x0;var _0x5b8c22=_0x9086[_0x491468];return _0x5b8c22;};'use strict';function Final(_0x50cfa6){this[_0x6908('0x0')]=_0x50cfa6[_0x6908('0x0')];this[_0x6908('0x1')]=_0x50cfa6[_0x6908('0x1')];this[_0x6908('0x2')]=_0x50cfa6['type'];this[_0x6908('0x3')]=_0x50cfa6[_0x6908('0x2')]===_0x6908('0x4')?'queue':_0x50cfa6[_0x6908('0x2')];this['countbusyretry']=_0x50cfa6['countbusyretry'];this['countcongestionretry']=_0x50cfa6['countcongestionretry'];this[_0x6908('0x5')]=_0x50cfa6['countnoanswerretry'];this[_0x6908('0x6')]=_0x50cfa6[_0x6908('0x7')]+_0x50cfa6['countcongestionretry']+_0x50cfa6[_0x6908('0x5')]+_0x50cfa6['countnosuchnumberretry']+_0x50cfa6[_0x6908('0x8')]+_0x50cfa6[_0x6908('0x9')]+_0x50cfa6[_0x6908('0xa')]+_0x50cfa6[_0x6908('0xb')];this['countnosuchnumberretry']=_0x50cfa6[_0x6908('0xc')];this[_0x6908('0x8')]=_0x50cfa6[_0x6908('0x8')];this[_0x6908('0x9')]=_0x50cfa6[_0x6908('0x9')];this[_0x6908('0xa')]=_0x50cfa6[_0x6908('0xa')];this[_0x6908('0xb')]=_0x50cfa6[_0x6908('0xb')];this[_0x6908('0xd')]=_0x50cfa6[_0x6908('0xd')];this['calleridname']=_0x50cfa6[_0x6908('0xe')];this['calleridnum']=_0x50cfa6['calleridnum'];this['starttime']=_0x50cfa6[_0x6908('0xf')];this[_0x6908('0x10')]=_0x50cfa6[_0x6908('0x10')];this[_0x6908('0x11')]=_0x50cfa6[_0x6908('0x10')];this['ringtime']=_0x50cfa6['ringtime']||0x0;this[_0x6908('0x12')]=_0x50cfa6['holdtime']||0x0;this[_0x6908('0x13')]=_0x50cfa6['talktime']||0x0;this[_0x6908('0x14')]=_0x50cfa6[_0x6908('0x14')];this[_0x6908('0x15')]=_0x50cfa6[_0x6908('0x15')];this[_0x6908('0x16')]=_0x50cfa6[_0x6908('0x16')];this[_0x6908('0x17')]=_0x50cfa6[_0x6908('0x17')];this[_0x6908('0x18')]=_0x50cfa6[_0x6908('0x18')];this[_0x6908('0x19')]=_0x50cfa6[_0x6908('0x19')];this['UserId']=_0x50cfa6[_0x6908('0x1a')];this[_0x6908('0x1b')]=_0x50cfa6['VoiceQueueId'];this['CampaignId']=_0x50cfa6[_0x6908('0x1c')];this['originatecalleridnum']=_0x50cfa6['originatecalleridnum']||'';this[_0x6908('0x1d')]=_0x50cfa6[_0x6908('0x1d')]||'';this[_0x6908('0x1e')]=_0x50cfa6[_0x6908('0x1e')];this[_0x6908('0x1f')]=_0x50cfa6[_0x6908('0x1f')];}module['exports']=Final; \ No newline at end of file +var _0x04a8=['talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime'];(function(_0x374dce,_0x17c32d){var _0x2a7745=function(_0x4a04bf){while(--_0x4a04bf){_0x374dce['push'](_0x374dce['shift']());}};_0x2a7745(++_0x17c32d);}(_0x04a8,0x10b));var _0x804a=function(_0x494f39,_0x1525de){_0x494f39=_0x494f39-0x0;var _0x2e53cc=_0x04a8[_0x494f39];return _0x2e53cc;};'use strict';function Final(_0x4d8685){this[_0x804a('0x0')]=_0x4d8685[_0x804a('0x0')];this[_0x804a('0x1')]=_0x4d8685[_0x804a('0x1')];this[_0x804a('0x2')]=_0x4d8685['type'];this[_0x804a('0x3')]=_0x4d8685['type']==='outbound'?_0x804a('0x4'):_0x4d8685[_0x804a('0x2')];this[_0x804a('0x5')]=_0x4d8685['countbusyretry'];this[_0x804a('0x6')]=_0x4d8685[_0x804a('0x6')];this[_0x804a('0x7')]=_0x4d8685[_0x804a('0x7')];this[_0x804a('0x8')]=_0x4d8685[_0x804a('0x5')]+_0x4d8685[_0x804a('0x6')]+_0x4d8685[_0x804a('0x7')]+_0x4d8685['countnosuchnumberretry']+_0x4d8685['countdropretry']+_0x4d8685[_0x804a('0x9')]+_0x4d8685[_0x804a('0xa')]+_0x4d8685[_0x804a('0xb')];this['countnosuchnumberretry']=_0x4d8685[_0x804a('0xc')];this['countdropretry']=_0x4d8685[_0x804a('0xd')];this[_0x804a('0x9')]=_0x4d8685[_0x804a('0x9')];this[_0x804a('0xa')]=_0x4d8685[_0x804a('0xa')];this[_0x804a('0xb')]=_0x4d8685[_0x804a('0xb')];this['queue']=_0x4d8685[_0x804a('0x4')];this[_0x804a('0xe')]=_0x4d8685[_0x804a('0xe')];this[_0x804a('0xf')]=_0x4d8685[_0x804a('0xf')];this[_0x804a('0x10')]=_0x4d8685[_0x804a('0x10')];this['responsetime']=_0x4d8685[_0x804a('0x11')];this[_0x804a('0x12')]=_0x4d8685[_0x804a('0x11')];this[_0x804a('0x13')]=_0x4d8685[_0x804a('0x13')]||0x0;this['holdtime']=_0x4d8685[_0x804a('0x14')]||0x0;this[_0x804a('0x15')]=_0x4d8685['talktime']||0x0;this[_0x804a('0x16')]=_0x4d8685[_0x804a('0x16')];this[_0x804a('0x17')]=_0x4d8685[_0x804a('0x17')];this['callbackat']=_0x4d8685[_0x804a('0x18')];this[_0x804a('0x19')]=_0x4d8685[_0x804a('0x19')];this[_0x804a('0x1a')]=_0x4d8685[_0x804a('0x1a')];this[_0x804a('0x1b')]=_0x4d8685[_0x804a('0x1b')];this[_0x804a('0x1c')]=_0x4d8685[_0x804a('0x1c')];this[_0x804a('0x1d')]=_0x4d8685['VoiceQueueId'];this[_0x804a('0x1e')]=_0x4d8685[_0x804a('0x1e')];this[_0x804a('0x1f')]=_0x4d8685['originatecalleridnum']||'';this[_0x804a('0x20')]=_0x4d8685[_0x804a('0x20')]||'';this[_0x804a('0x21')]=_0x4d8685[_0x804a('0x21')];this[_0x804a('0x22')]=_0x4d8685[_0x804a('0x22')];}module[_0x804a('0x23')]=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 bfcada3..0f8f541 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 _0x85e1=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','exports','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countglobal','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x33a314,_0x4d5c24){var _0x4981fe=function(_0x121dfc){while(--_0x121dfc){_0x33a314['push'](_0x33a314['shift']());}};_0x4981fe(++_0x4d5c24);}(_0x85e1,0x111));var _0x185e=function(_0x47d739,_0x1f2dc7){_0x47d739=_0x47d739-0x0;var _0x2c2473=_0x85e1[_0x47d739];return _0x2c2473;};'use strict';var moment=require(_0x185e('0x0'));var utils=require(_0x185e('0x1'));function Hangup(_0x51a9ea,_0x23d8a1){this[_0x185e('0x2')]=0x4;this[_0x185e('0x3')]='Answer';this[_0x185e('0x4')]=_0x51a9ea[_0x185e('0x4')];this['type']=_0x51a9ea[_0x185e('0x5')];this['campaigntype']=_0x51a9ea[_0x185e('0x5')]===_0x185e('0x6')?_0x185e('0x7'):_0x51a9ea[_0x185e('0x5')];this[_0x185e('0x8')]=_0x51a9ea[_0x185e('0x8')]||![];this[_0x185e('0x9')]=_0x51a9ea[_0x185e('0x9')];this['countcongestionretry']=_0x51a9ea['countcongestionretry'];this['countnoanswerretry']=_0x51a9ea['countnoanswerretry'];this[_0x185e('0xa')]=_0x51a9ea[_0x185e('0x9')]+_0x51a9ea[_0x185e('0xb')]+_0x51a9ea[_0x185e('0xc')]+_0x51a9ea[_0x185e('0xd')]+_0x51a9ea[_0x185e('0xe')]+_0x51a9ea[_0x185e('0xf')]+_0x51a9ea[_0x185e('0x10')]+_0x51a9ea[_0x185e('0x11')];this[_0x185e('0xd')]=_0x51a9ea[_0x185e('0xd')];this[_0x185e('0xe')]=_0x51a9ea[_0x185e('0xe')];this[_0x185e('0xf')]=_0x51a9ea[_0x185e('0xf')];this['countmachineretry']=_0x51a9ea[_0x185e('0x10')];this[_0x185e('0x11')]=_0x51a9ea[_0x185e('0x11')];this[_0x185e('0x12')]=_0x23d8a1['uniqueid'];this['calleridname']=_0x51a9ea[_0x185e('0x13')];this[_0x185e('0x14')]=_0x51a9ea[_0x185e('0x15')];this[_0x185e('0x16')]=_0x51a9ea['starttime'];this[_0x185e('0x17')]=_0x51a9ea[_0x185e('0x17')];this[_0x185e('0x18')]=moment()['format'](_0x185e('0x19'));this[_0x185e('0x1a')]=utils[_0x185e('0x1b')](_0x51a9ea['responsetime'],_0x51a9ea[_0x185e('0x16')]);this['holdtime']=0x0;this[_0x185e('0x1c')]=utils['getSeconds'](this[_0x185e('0x18')],_0x51a9ea[_0x185e('0x17')]);this[_0x185e('0x7')]=_0x51a9ea['queue'];this['membername']=_0x185e('0x1d');this[_0x185e('0x1e')]=_0x23d8a1[_0x185e('0x1f')];this[_0x185e('0x20')]=_0x51a9ea[_0x185e('0x20')];this[_0x185e('0x21')]=_0x51a9ea['callbackuniqueid'];this[_0x185e('0x22')]=_0x51a9ea[_0x185e('0x22')];this[_0x185e('0x23')]=_0x51a9ea['recallme'];this['ContactId']=_0x51a9ea[_0x185e('0x24')];this[_0x185e('0x25')]=_0x51a9ea['ListId'];this['UserId']=_0x51a9ea['UserId'];this[_0x185e('0x26')]=_0x51a9ea['VoiceQueueId'];this[_0x185e('0x27')]=_0x51a9ea[_0x185e('0x27')];}module[_0x185e('0x28')]=Hangup; \ No newline at end of file +var _0xbb9c=['outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','statedesc','Answer','scheduledat','type'];(function(_0x48caf9,_0x561dcb){var _0x42a263=function(_0x1282c7){while(--_0x1282c7){_0x48caf9['push'](_0x48caf9['shift']());}};_0x42a263(++_0x561dcb);}(_0xbb9c,0x18f));var _0xcbb9=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xbb9c[_0x12aaee];return _0x37c350;};'use strict';var moment=require(_0xcbb9('0x0'));var utils=require(_0xcbb9('0x1'));function Hangup(_0x5d6676,_0x441fa){this['state']=0x4;this[_0xcbb9('0x2')]=_0xcbb9('0x3');this[_0xcbb9('0x4')]=_0x5d6676[_0xcbb9('0x4')];this[_0xcbb9('0x5')]=_0x5d6676[_0xcbb9('0x5')];this['campaigntype']=_0x5d6676['type']===_0xcbb9('0x6')?_0xcbb9('0x7'):_0x5d6676[_0xcbb9('0x5')];this[_0xcbb9('0x8')]=_0x5d6676[_0xcbb9('0x8')]||![];this['countbusyretry']=_0x5d6676[_0xcbb9('0x9')];this[_0xcbb9('0xa')]=_0x5d6676['countcongestionretry'];this[_0xcbb9('0xb')]=_0x5d6676[_0xcbb9('0xb')];this[_0xcbb9('0xc')]=_0x5d6676[_0xcbb9('0x9')]+_0x5d6676[_0xcbb9('0xa')]+_0x5d6676[_0xcbb9('0xb')]+_0x5d6676[_0xcbb9('0xd')]+_0x5d6676[_0xcbb9('0xe')]+_0x5d6676[_0xcbb9('0xf')]+_0x5d6676['countmachineretry']+_0x5d6676[_0xcbb9('0x10')];this[_0xcbb9('0xd')]=_0x5d6676[_0xcbb9('0xd')];this[_0xcbb9('0xe')]=_0x5d6676[_0xcbb9('0xe')];this[_0xcbb9('0xf')]=_0x5d6676[_0xcbb9('0xf')];this[_0xcbb9('0x11')]=_0x5d6676[_0xcbb9('0x11')];this[_0xcbb9('0x10')]=_0x5d6676['countagentrejectretry'];this[_0xcbb9('0x12')]=_0x441fa[_0xcbb9('0x12')];this[_0xcbb9('0x13')]=_0x5d6676[_0xcbb9('0x14')];this[_0xcbb9('0x15')]=_0x5d6676[_0xcbb9('0x16')];this[_0xcbb9('0x17')]=_0x5d6676['starttime'];this[_0xcbb9('0x18')]=_0x5d6676[_0xcbb9('0x18')];this[_0xcbb9('0x19')]=moment()[_0xcbb9('0x1a')](_0xcbb9('0x1b'));this[_0xcbb9('0x1c')]=utils[_0xcbb9('0x1d')](_0x5d6676[_0xcbb9('0x18')],_0x5d6676['starttime']);this[_0xcbb9('0x1e')]=0x0;this[_0xcbb9('0x1f')]=utils[_0xcbb9('0x1d')](this[_0xcbb9('0x19')],_0x5d6676['responsetime']);this['queue']=_0x5d6676[_0xcbb9('0x7')];this[_0xcbb9('0x20')]=_0xcbb9('0x21');this[_0xcbb9('0x22')]=_0x441fa['cause-txt'];this[_0xcbb9('0x23')]=_0x5d6676['callback'];this[_0xcbb9('0x24')]=_0x5d6676[_0xcbb9('0x24')];this[_0xcbb9('0x25')]=_0x5d6676[_0xcbb9('0x25')];this[_0xcbb9('0x26')]=_0x5d6676[_0xcbb9('0x26')];this[_0xcbb9('0x27')]=_0x5d6676['ContactId'];this[_0xcbb9('0x28')]=_0x5d6676[_0xcbb9('0x28')];this[_0xcbb9('0x29')]=_0x5d6676['UserId'];this['VoiceQueueId']=_0x5d6676[_0xcbb9('0x2a')];this[_0xcbb9('0x2b')]=_0x5d6676['CampaignId'];}module[_0xcbb9('0x2c')]=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 4650294..d36d4ff 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 _0x9190=['getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','name','calleridnum','number','starttime','responsetime','endtime','ringtime'];(function(_0x2c8597,_0x1f0ea1){var _0xb7037f=function(_0x40054c){while(--_0x40054c){_0x2c8597['push'](_0x2c8597['shift']());}};_0xb7037f(++_0x1f0ea1);}(_0x9190,0x140));var _0x0919=function(_0x576d37,_0x492f6d){_0x576d37=_0x576d37-0x0;var _0x1a10ee=_0x9190[_0x576d37];return _0x1a10ee;};'use strict';var utils=require(_0x0919('0x0'));function History(_0xdff6ac){this['uniqueid']=_0xdff6ac['uniqueid'];this[_0x0919('0x1')]=_0xdff6ac['scheduledat']||undefined;this[_0x0919('0x2')]=_0xdff6ac[_0x0919('0x2')];this[_0x0919('0x3')]=_0xdff6ac['type']===_0x0919('0x4')?_0x0919('0x5'):_0xdff6ac['type'];this[_0x0919('0x6')]=_0xdff6ac[_0x0919('0x6')];this[_0x0919('0x7')]=_0xdff6ac[_0x0919('0x7')];this[_0x0919('0x8')]=_0xdff6ac[_0x0919('0x8')];this[_0x0919('0x9')]=_0xdff6ac[_0x0919('0x6')]+_0xdff6ac[_0x0919('0x7')]+_0xdff6ac['countnoanswerretry']+_0xdff6ac[_0x0919('0xa')]+_0xdff6ac[_0x0919('0xb')]+_0xdff6ac[_0x0919('0xc')]+_0xdff6ac[_0x0919('0xd')]+_0xdff6ac['countagentrejectretry'];this[_0x0919('0xa')]=_0xdff6ac[_0x0919('0xa')];this['countdropretry']=_0xdff6ac[_0x0919('0xb')];this['countabandonedretry']=_0xdff6ac[_0x0919('0xc')];this[_0x0919('0xd')]=_0xdff6ac[_0x0919('0xd')];this[_0x0919('0xe')]=_0xdff6ac['countagentrejectretry'];this['queue']=_0xdff6ac[_0x0919('0x5')];this['calleridname']=_0xdff6ac[_0x0919('0xf')];this[_0x0919('0x10')]=_0xdff6ac[_0x0919('0x11')];this[_0x0919('0x12')]=_0xdff6ac[_0x0919('0x12')];this[_0x0919('0x13')]=_0xdff6ac['responsetime'];this[_0x0919('0x14')]=_0xdff6ac['responsetime'];this[_0x0919('0x15')]=utils[_0x0919('0x16')](_0xdff6ac[_0x0919('0x13')],_0xdff6ac[_0x0919('0x12')]);this['holdtime']=0x0;this[_0x0919('0x17')]=0x0;this[_0x0919('0x18')]=_0xdff6ac[_0x0919('0x18')];this['callbackuniqueid']=_0xdff6ac[_0x0919('0x19')];this[_0x0919('0x1a')]=_0xdff6ac[_0x0919('0x1a')];this['recallme']=_0xdff6ac[_0x0919('0x1b')];this[_0x0919('0x1c')]=_0xdff6ac[_0x0919('0x1c')];this['ListId']=_0xdff6ac[_0x0919('0x1d')];this['UserId']=_0xdff6ac[_0x0919('0x1e')];this[_0x0919('0x1f')]=_0xdff6ac[_0x0919('0x1f')];this[_0x0919('0x20')]=_0xdff6ac['CampaignId'];this[_0x0919('0x21')]=_0xdff6ac[_0x0919('0x21')]||'';this[_0x0919('0x22')]=_0xdff6ac[_0x0919('0x22')]||'';this[_0x0919('0x23')]=_0xdff6ac[_0x0919('0x23')];this[_0x0919('0x24')]=_0xdff6ac['statedesc'];}module[_0x0919('0x25')]=History; \ No newline at end of file +var _0x560b=['countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','number','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x3537fb,_0x2c9d40){var _0xb91e66=function(_0x2026bd){while(--_0x2026bd){_0x3537fb['push'](_0x3537fb['shift']());}};_0xb91e66(++_0x2c9d40);}(_0x560b,0x118));var _0xb560=function(_0x2704a7,_0x4e4c8f){_0x2704a7=_0x2704a7-0x0;var _0x1612c6=_0x560b[_0x2704a7];return _0x1612c6;};'use strict';var utils=require('../utils');function History(_0x2fefe0){this[_0xb560('0x0')]=_0x2fefe0[_0xb560('0x0')];this[_0xb560('0x1')]=_0x2fefe0['scheduledat']||undefined;this[_0xb560('0x2')]=_0x2fefe0[_0xb560('0x2')];this[_0xb560('0x3')]=_0x2fefe0['type']===_0xb560('0x4')?_0xb560('0x5'):_0x2fefe0[_0xb560('0x2')];this['countbusyretry']=_0x2fefe0[_0xb560('0x6')];this[_0xb560('0x7')]=_0x2fefe0[_0xb560('0x7')];this[_0xb560('0x8')]=_0x2fefe0[_0xb560('0x8')];this[_0xb560('0x9')]=_0x2fefe0['countbusyretry']+_0x2fefe0[_0xb560('0x7')]+_0x2fefe0[_0xb560('0x8')]+_0x2fefe0[_0xb560('0xa')]+_0x2fefe0['countdropretry']+_0x2fefe0[_0xb560('0xb')]+_0x2fefe0[_0xb560('0xc')]+_0x2fefe0[_0xb560('0xd')];this[_0xb560('0xa')]=_0x2fefe0['countnosuchnumberretry'];this[_0xb560('0xe')]=_0x2fefe0[_0xb560('0xe')];this['countabandonedretry']=_0x2fefe0[_0xb560('0xb')];this['countmachineretry']=_0x2fefe0[_0xb560('0xc')];this['countagentrejectretry']=_0x2fefe0[_0xb560('0xd')];this[_0xb560('0x5')]=_0x2fefe0['queue'];this[_0xb560('0xf')]=_0x2fefe0['name'];this[_0xb560('0x10')]=_0x2fefe0[_0xb560('0x11')];this[_0xb560('0x12')]=_0x2fefe0['starttime'];this[_0xb560('0x13')]=_0x2fefe0[_0xb560('0x13')];this['endtime']=_0x2fefe0['responsetime'];this[_0xb560('0x14')]=utils[_0xb560('0x15')](_0x2fefe0[_0xb560('0x13')],_0x2fefe0[_0xb560('0x12')]);this[_0xb560('0x16')]=0x0;this[_0xb560('0x17')]=0x0;this['callback']=_0x2fefe0[_0xb560('0x18')];this[_0xb560('0x19')]=_0x2fefe0[_0xb560('0x19')];this[_0xb560('0x1a')]=_0x2fefe0[_0xb560('0x1a')];this[_0xb560('0x1b')]=_0x2fefe0[_0xb560('0x1b')];this[_0xb560('0x1c')]=_0x2fefe0[_0xb560('0x1c')];this[_0xb560('0x1d')]=_0x2fefe0[_0xb560('0x1d')];this['UserId']=_0x2fefe0['UserId'];this[_0xb560('0x1e')]=_0x2fefe0[_0xb560('0x1e')];this[_0xb560('0x1f')]=_0x2fefe0[_0xb560('0x1f')];this[_0xb560('0x20')]=_0x2fefe0[_0xb560('0x20')]||'';this[_0xb560('0x21')]=_0x2fefe0[_0xb560('0x21')]||'';this[_0xb560('0x22')]=_0x2fefe0[_0xb560('0x22')];this[_0xb560('0x23')]=_0x2fefe0[_0xb560('0x23')];}module['exports']=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 2d95688..249599b 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 _0xc709=['originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x22c5d6,_0x3df817){var _0x2ebb82=function(_0x566607){while(--_0x566607){_0x22c5d6['push'](_0x22c5d6['shift']());}};_0x2ebb82(++_0x3df817);}(_0xc709,0x7f));var _0x9c70=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xc709[_0x2211ed];return _0x4d78cc;};'use strict';var utils=require(_0x9c70('0x0'));function QueueCallerAbandon(_0x169093,_0x2238c3){this[_0x9c70('0x1')]=_0x169093[_0x9c70('0x1')];this[_0x9c70('0x2')]=_0x169093[_0x9c70('0x2')];this[_0x9c70('0x3')]=_0x169093[_0x9c70('0x2')]==='outbound'?_0x9c70('0x4'):_0x169093[_0x9c70('0x2')];this[_0x9c70('0x5')]=_0x169093[_0x9c70('0x5')];this[_0x9c70('0x6')]=_0x169093[_0x9c70('0x6')];this[_0x9c70('0x7')]=_0x169093['countnoanswerretry'];this[_0x9c70('0x8')]=_0x169093[_0x9c70('0x5')]+_0x169093['countcongestionretry']+_0x169093[_0x9c70('0x7')]+_0x169093[_0x9c70('0x9')]+_0x169093[_0x9c70('0xa')]+_0x169093[_0x9c70('0xb')]+_0x169093[_0x9c70('0xc')]+_0x169093[_0x9c70('0xd')];this['countnosuchnumberretry']=_0x169093[_0x9c70('0x9')];this[_0x9c70('0xa')]=_0x169093[_0x9c70('0xa')];this[_0x9c70('0xb')]=_0x169093[_0x9c70('0xb')];this[_0x9c70('0xc')]=_0x169093[_0x9c70('0xc')];this['countagentrejectretry']=_0x169093[_0x9c70('0xd')];this[_0x9c70('0xe')]=_0x2238c3[_0x9c70('0xe')];this[_0x9c70('0xf')]=_0x169093[_0x9c70('0x10')];this['calleridnum']=_0x169093[_0x9c70('0x11')];this[_0x9c70('0x12')]=_0x169093['starttime'];this[_0x9c70('0x13')]=_0x169093['responsetime'];this[_0x9c70('0x14')]=_0x169093[_0x9c70('0x14')];this[_0x9c70('0x15')]=_0x169093[_0x9c70('0x15')];this[_0x9c70('0x16')]=this[_0x9c70('0x14')];this['ringtime']=utils[_0x9c70('0x17')](_0x169093[_0x9c70('0x13')],_0x169093[_0x9c70('0x12')]);this[_0x9c70('0x18')]=utils[_0x9c70('0x17')](this['droptime'],_0x169093[_0x9c70('0x13')]);this['talktime']=0x0;this[_0x9c70('0x4')]=_0x2238c3[_0x9c70('0x4')];this[_0x9c70('0x19')]=_0x2238c3[_0x9c70('0x1a')];this[_0x9c70('0x1b')]=_0x2238c3['reason'];this[_0x9c70('0x1c')]=_0x169093['callback'];this[_0x9c70('0x1d')]=_0x169093[_0x9c70('0x1d')];this['callbackat']=_0x169093[_0x9c70('0x1e')];this[_0x9c70('0x1f')]=_0x169093[_0x9c70('0x1f')];this[_0x9c70('0x20')]=_0x169093['ContactId'];this[_0x9c70('0x21')]=_0x169093[_0x9c70('0x21')];this[_0x9c70('0x22')]=_0x169093[_0x9c70('0x22')];this[_0x9c70('0x23')]=_0x169093[_0x9c70('0x23')];this[_0x9c70('0x24')]=_0x169093[_0x9c70('0x24')];this['originatecalleridnum']=_0x169093['originatecalleridnum']||'';this[_0x9c70('0x25')]=_0x169093['originatecalleridname']||'';this[_0x9c70('0x26')]=_0x169093[_0x9c70('0x26')];this[_0x9c70('0x27')]=_0x169093[_0x9c70('0x27')];this[_0x9c70('0x28')]=_0x169093['statedesc'];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xf3cb=['countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','dropreason','endtime','getSeconds','holdtime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','countbusyretry'];(function(_0x28db45,_0x4ea2c1){var _0x4d0f1e=function(_0x2ca771){while(--_0x2ca771){_0x28db45['push'](_0x28db45['shift']());}};_0x4d0f1e(++_0x4ea2c1);}(_0xf3cb,0x175));var _0xbf3c=function(_0x3c816,_0x202e96){_0x3c816=_0x3c816-0x0;var _0xb82f08=_0xf3cb[_0x3c816];return _0xb82f08;};'use strict';var utils=require(_0xbf3c('0x0'));function QueueCallerAbandon(_0x4eb4c0,_0x2f2ed5){this[_0xbf3c('0x1')]=_0x4eb4c0[_0xbf3c('0x1')];this[_0xbf3c('0x2')]=_0x4eb4c0[_0xbf3c('0x2')];this[_0xbf3c('0x3')]=_0x4eb4c0['type']==='outbound'?'queue':_0x4eb4c0[_0xbf3c('0x2')];this[_0xbf3c('0x4')]=_0x4eb4c0['countbusyretry'];this[_0xbf3c('0x5')]=_0x4eb4c0[_0xbf3c('0x5')];this[_0xbf3c('0x6')]=_0x4eb4c0['countnoanswerretry'];this[_0xbf3c('0x7')]=_0x4eb4c0[_0xbf3c('0x4')]+_0x4eb4c0[_0xbf3c('0x5')]+_0x4eb4c0['countnoanswerretry']+_0x4eb4c0['countnosuchnumberretry']+_0x4eb4c0[_0xbf3c('0x8')]+_0x4eb4c0[_0xbf3c('0x9')]+_0x4eb4c0[_0xbf3c('0xa')]+_0x4eb4c0['countagentrejectretry'];this[_0xbf3c('0xb')]=_0x4eb4c0[_0xbf3c('0xb')];this[_0xbf3c('0x8')]=_0x4eb4c0[_0xbf3c('0x8')];this[_0xbf3c('0x9')]=_0x4eb4c0[_0xbf3c('0x9')];this[_0xbf3c('0xa')]=_0x4eb4c0[_0xbf3c('0xa')];this['countagentrejectretry']=_0x4eb4c0[_0xbf3c('0xc')];this[_0xbf3c('0xd')]=_0x2f2ed5[_0xbf3c('0xd')];this[_0xbf3c('0xe')]=_0x4eb4c0['name'];this[_0xbf3c('0xf')]=_0x4eb4c0[_0xbf3c('0x10')];this['starttime']=_0x4eb4c0[_0xbf3c('0x11')];this['responsetime']=_0x4eb4c0[_0xbf3c('0x12')];this['droptime']=_0x4eb4c0[_0xbf3c('0x13')];this[_0xbf3c('0x14')]=_0x4eb4c0[_0xbf3c('0x14')];this[_0xbf3c('0x15')]=this['droptime'];this['ringtime']=utils[_0xbf3c('0x16')](_0x4eb4c0[_0xbf3c('0x12')],_0x4eb4c0['starttime']);this[_0xbf3c('0x17')]=utils[_0xbf3c('0x16')](this[_0xbf3c('0x13')],_0x4eb4c0[_0xbf3c('0x12')]);this['talktime']=0x0;this['queue']=_0x2f2ed5[_0xbf3c('0x18')];this[_0xbf3c('0x19')]=_0x2f2ed5[_0xbf3c('0x1a')];this[_0xbf3c('0x1b')]=_0x2f2ed5[_0xbf3c('0x1b')];this[_0xbf3c('0x1c')]=_0x4eb4c0[_0xbf3c('0x1c')];this[_0xbf3c('0x1d')]=_0x4eb4c0[_0xbf3c('0x1d')];this[_0xbf3c('0x1e')]=_0x4eb4c0[_0xbf3c('0x1e')];this[_0xbf3c('0x1f')]=_0x4eb4c0[_0xbf3c('0x1f')];this[_0xbf3c('0x20')]=_0x4eb4c0['ContactId'];this[_0xbf3c('0x21')]=_0x4eb4c0[_0xbf3c('0x21')];this[_0xbf3c('0x22')]=_0x4eb4c0[_0xbf3c('0x22')];this['VoiceQueueId']=_0x4eb4c0[_0xbf3c('0x23')];this['CampaignId']=_0x4eb4c0[_0xbf3c('0x24')];this[_0xbf3c('0x25')]=_0x4eb4c0['originatecalleridnum']||'';this[_0xbf3c('0x26')]=_0x4eb4c0[_0xbf3c('0x26')]||'';this[_0xbf3c('0x27')]=_0x4eb4c0[_0xbf3c('0x27')];this[_0xbf3c('0x28')]=_0x4eb4c0[_0xbf3c('0x28')];this[_0xbf3c('0x29')]=_0x4eb4c0[_0xbf3c('0x29')];}module['exports']=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 f031821..539e28e 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 _0xb091=['swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones'];(function(_0x35c181,_0x3d21f7){var _0x1b33ff=function(_0x4ff444){while(--_0x4ff444){_0x35c181['push'](_0x35c181['shift']());}};_0x1b33ff(++_0x3d21f7);}(_0xb091,0x16e));var _0x1b09=function(_0xa3ec0a,_0x54cdec){_0xa3ec0a=_0xa3ec0a-0x0;var _0x4ed13c=_0xb091[_0xa3ec0a];return _0x4ed13c;};'use strict';var util=require('util');var logger=require(_0x1b09('0x0'))(_0x1b09('0x1'));var cmHopper=require(_0x1b09('0x2'));var cmHopperAdditionalPhone=require(_0x1b09('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x1b09('0x4'));function inspectError(_0x59af61){return util['inspect'](_0x59af61,{'showHidden':![],'depth':null});}function getContactDialer(_0x295863,_0x24d22c,_0x4e252c){return cmHopper[_0x1b09('0x5')](_0x295863['id'],_0x24d22c,_0x4e252c,_0x295863[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x5ce726){_0x295863[_0x1b09('0x8')]=0x0;logger[_0x1b09('0x9')](_0x1b09('0xa'),inspectError(_0x5ce726));});}exports[_0x1b09('0x5')]=getContactDialer;function getContactDialerIvr(_0x159b95,_0x3362e4){return cmHopper[_0x1b09('0xb')](_0x159b95['id'],_0x3362e4,_0x159b95[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x36aa1b){_0x159b95[_0x1b09('0x8')]=0x0;logger['error'](_0x1b09('0xc'),inspectError(_0x36aa1b));});}exports[_0x1b09('0xb')]=getContactDialerIvr;function countReScheduled(_0x5690cb){return cmHopper['countReScheduled'](_0x5690cb)[_0x1b09('0x7')](function(_0x4284ad){logger[_0x1b09('0x9')](_0x1b09('0xd'),inspectError(_0x4284ad));});}exports[_0x1b09('0xe')]=countReScheduled;function rescheduleContact(_0x3a44f1){return cmHopper[_0x1b09('0xf')](_0x3a44f1)['catch'](function(_0x37fdb2){logger['error'](_0x1b09('0x10'),inspectError(_0x37fdb2));});}exports[_0x1b09('0xf')]=rescheduleContact;function unlockContact(_0x11ab46,_0x37673e,_0x10b7eb){return cmHopper[_0x1b09('0x11')](_0x11ab46,_0x37673e,_0x10b7eb)[_0x1b09('0x7')](function(_0x33129b){logger[_0x1b09('0x9')](_0x1b09('0x12'),inspectError(_0x33129b));});}exports[_0x1b09('0x11')]=unlockContact;function moveContactManagedDialer(_0x231ef6){return cmHopper[_0x1b09('0x13')](_0x231ef6)['catch'](function(_0x214c6b){logger[_0x1b09('0x9')]('[moveContactManagedDialer]',inspectError(_0x214c6b));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0xe93ac4){return cmHopperBlack['checkIsBlackList'](_0xe93ac4)[_0x1b09('0x7')](function(_0x5bb127){logger[_0x1b09('0x9')](_0x1b09('0x14'),inspectError(_0x5bb127));});}exports[_0x1b09('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x1e8f97){return cmHopperBlack[_0x1b09('0x16')](_0x1e8f97)[_0x1b09('0x7')](function(_0x363e78){logger[_0x1b09('0x9')]('[checkIsBlackListIvr]',inspectError(_0x363e78));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x27f4f5,_0x41c786,_0x4ce7dc){return cmHopperAdditionalPhone[_0x1b09('0x17')](_0x27f4f5,_0x41c786,_0x4ce7dc)[_0x1b09('0x7')](function(_0x6e132c){logger[_0x1b09('0x9')]('[verifyAdditionalPhone]',inspectError(_0x6e132c));});}exports[_0x1b09('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x15be49,_0x4936d0,_0x2d3b86){return cmHopperAdditionalPhone[_0x1b09('0x18')](_0x15be49,_0x4936d0,_0x2d3b86)['catch'](function(_0x13c89c){logger[_0x1b09('0x9')](_0x1b09('0x19'),inspectError(_0x13c89c));});}exports[_0x1b09('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x547fbb){return cmHopperHistory[_0x1b09('0x1a')](_0x547fbb)[_0x1b09('0x7')](function(_0x532589){logger[_0x1b09('0x9')](_0x1b09('0x1b'),inspectError(_0x532589));});}exports[_0x1b09('0x1a')]=avgHandleTime;function createHistory(_0x1cbbd5){return cmHopperHistory[_0x1b09('0x1c')](_0x1cbbd5)[_0x1b09('0x7')](function(_0x34620f){logger['error'](_0x1b09('0x1d'),inspectError(_0x34620f));});}exports[_0x1b09('0x1c')]=createHistory; \ No newline at end of file +var _0x01d9=['rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','getContactDialerIvr','countReScheduled','[countReScheduled]'];(function(_0x56df89,_0x14945b){var _0x2a1e6f=function(_0x4871de){while(--_0x4871de){_0x56df89['push'](_0x56df89['shift']());}};_0x2a1e6f(++_0x14945b);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x901d('0x0'));var logger=require(_0x901d('0x1'))(_0x901d('0x2'));var cmHopper=require(_0x901d('0x3'));var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x901d('0x4'));var cmHopperHistory=require(_0x901d('0x5'));function inspectError(_0x247cfc){return util[_0x901d('0x6')](_0x247cfc,{'showHidden':![],'depth':null});}function getContactDialer(_0x214f38,_0x456f31,_0xb96b86){return cmHopper['getContactDialer'](_0x214f38['id'],_0x456f31,_0xb96b86,_0x214f38[_0x901d('0x7')])[_0x901d('0x8')](function(_0x21e1d7){_0x214f38[_0x901d('0x9')]=0x0;logger[_0x901d('0xa')](_0x901d('0xb'),inspectError(_0x21e1d7));});}exports[_0x901d('0xc')]=getContactDialer;function getContactDialerIvr(_0x2555e0,_0x15076e){return cmHopper[_0x901d('0xd')](_0x2555e0['id'],_0x15076e,_0x2555e0[_0x901d('0x7')])[_0x901d('0x8')](function(_0x1d3137){_0x2555e0['temp']=0x0;logger[_0x901d('0xa')]('[getContactDialerIvr]',inspectError(_0x1d3137));});}exports[_0x901d('0xd')]=getContactDialerIvr;function countReScheduled(_0x1fd1de){return cmHopper[_0x901d('0xe')](_0x1fd1de)[_0x901d('0x8')](function(_0x15ebaf){logger['error'](_0x901d('0xf'),inspectError(_0x15ebaf));});}exports[_0x901d('0xe')]=countReScheduled;function rescheduleContact(_0x3d00e4){return cmHopper[_0x901d('0x10')](_0x3d00e4)[_0x901d('0x8')](function(_0x14d99b){logger['error'](_0x901d('0x11'),inspectError(_0x14d99b));});}exports[_0x901d('0x10')]=rescheduleContact;function unlockContact(_0x11b0cc,_0x17d451,_0x1aba97){return cmHopper[_0x901d('0x12')](_0x11b0cc,_0x17d451,_0x1aba97)[_0x901d('0x8')](function(_0x407215){logger[_0x901d('0xa')](_0x901d('0x13'),inspectError(_0x407215));});}exports[_0x901d('0x12')]=unlockContact;function moveContactManagedDialer(_0x390c33){return cmHopper[_0x901d('0x14')](_0x390c33)[_0x901d('0x8')](function(_0x38f42b){logger[_0x901d('0xa')](_0x901d('0x15'),inspectError(_0x38f42b));});}exports[_0x901d('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x57d518){return cmHopperBlack[_0x901d('0x16')](_0x57d518)[_0x901d('0x8')](function(_0x4d27db){logger['error']('[checkIsBlackList]',inspectError(_0x4d27db));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x316a9f){return cmHopperBlack[_0x901d('0x17')](_0x316a9f)['catch'](function(_0xd2e0ac){logger[_0x901d('0xa')]('[checkIsBlackListIvr]',inspectError(_0xd2e0ac));});}exports[_0x901d('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x53ee69,_0x2402de,_0x3f80b9){return cmHopperAdditionalPhone[_0x901d('0x18')](_0x53ee69,_0x2402de,_0x3f80b9)[_0x901d('0x8')](function(_0x46e5c6){logger[_0x901d('0xa')]('[verifyAdditionalPhone]',inspectError(_0x46e5c6));});}exports[_0x901d('0x18')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x445392,_0xbc89a5,_0x1f0ee5){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x445392,_0xbc89a5,_0x1f0ee5)[_0x901d('0x8')](function(_0x23fd43){logger[_0x901d('0xa')](_0x901d('0x19'),inspectError(_0x23fd43));});}exports[_0x901d('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x56e4ec){return cmHopperHistory[_0x901d('0x1b')](_0x56e4ec)[_0x901d('0x8')](function(_0x14976e){logger[_0x901d('0xa')](_0x901d('0x1c'),inspectError(_0x14976e));});}exports[_0x901d('0x1b')]=avgHandleTime;function createHistory(_0x48e86e){return cmHopperHistory[_0x901d('0x1d')](_0x48e86e)['catch'](function(_0x128830){logger[_0x901d('0xa')](_0x901d('0x1e'),inspectError(_0x128830));});}exports[_0x901d('0x1d')]=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 29301a5..e7c14a1 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 _0xa057=['originated','Trunk','name','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','reachable','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','updatedAt','undefined','description','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','BLACKLIST','RESCHEDULED_CONTACTS','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','isPreviewCampaign','ivr','isIVRCampaign','type','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse'];(function(_0xe07a7d,_0x5cd6c4){var _0x32645c=function(_0x1edb43){while(--_0x1edb43){_0xe07a7d['push'](_0xe07a7d['shift']());}};_0x32645c(++_0x5cd6c4);}(_0xa057,0xea));var _0x7a05=function(_0x4e7010,_0x5b55fb){_0x4e7010=_0x4e7010-0x0;var _0x1e80a6=_0xa057[_0x4e7010];return _0x1e80a6;};'use strict';var _=require(_0x7a05('0x0'));var moment=require(_0x7a05('0x1'));var util=require(_0x7a05('0x2'));var logger=require(_0x7a05('0x3'))(_0x7a05('0x4'));var timezones=require(_0x7a05('0x5'))[_0x7a05('0x6')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x7a05('0x7'),'CONTACTS_RESCHEDULED':_0x7a05('0x8'),'DEACTIVATED':'DEACTIVATED','DISACTIVED':_0x7a05('0x9'),'EMPTY_INTERVAL':_0x7a05('0xa'),'INACTIVE':_0x7a05('0xb'),'NO_AGENTS_LOGGED':_0x7a05('0xc'),'NO_AVAILABLE_CONTACTS':_0x7a05('0xd'),'NULL_INTERVAL':_0x7a05('0xe'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x7a05('0xf'),'QUEUE_RECALL':_0x7a05('0x10'),'RECALL_TIMEOUT':_0x7a05('0x11'),'RUNNING':_0x7a05('0x12'),'UNKNOWN_TIMEZONE':_0x7a05('0x13'),'UNREACHABLE_TRUNK':_0x7a05('0x14')};exports[_0x7a05('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3d6c58){return _0x3d6c58['dialMethod']===_0x7a05('0x16');}exports[_0x7a05('0x17')]=isPreviewCampaign;function isIVRCampaign(_0x4ff0ff){return _0x4ff0ff['type']===_0x7a05('0x18');}exports[_0x7a05('0x19')]=isIVRCampaign;function isOutboundQueue(_0x54412b){return _0x54412b[_0x7a05('0x1a')]===_0x7a05('0x1b');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x5dabea){return _0x5dabea[_0x7a05('0x1c')];}exports[_0x7a05('0x1d')]=isQueueCampaignActive;function isIVRCampaignActive(_0x10bccb){return _0x10bccb[_0x7a05('0x1e')];}exports[_0x7a05('0x1f')]=isIVRCampaignActive;function getSeconds(_0x4c7c37,_0x408fdb){var _0x565935=moment(_0x4c7c37)[_0x7a05('0x20')](0x0);var _0x5a9dd2=moment(_0x408fdb)[_0x7a05('0x20')](0x0);return _0x565935[_0x7a05('0x21')](_0x5a9dd2,_0x7a05('0x22'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x5649b3,_0x433b91){var _0x2289a2=![];var _0x5a67cd=_0x5649b3[_0x7a05('0x23')]!==_0x433b91['dialMethod']||_0x5649b3['dialActive']!==_0x433b91[_0x7a05('0x1c')]||_0x5649b3['message']!==_0x433b91[_0x7a05('0x24')];var _0x15a28c=_0x5649b3['available']!==_0x433b91[_0x7a05('0x25')]||_0x5649b3[_0x7a05('0x26')]!==_0x433b91['loggedIn']||_0x5649b3[_0x7a05('0x27')]!==_0x433b91[_0x7a05('0x27')]||_0x5649b3['paused']!==_0x433b91[_0x7a05('0x28')]||_0x5649b3['talking']!==_0x433b91[_0x7a05('0x29')]||_0x5649b3[_0x7a05('0x2a')]!==_0x433b91['pTalking']||_0x5649b3[_0x7a05('0x2b')]!==_0x433b91[_0x7a05('0x2b')]||_0x5649b3[_0x7a05('0x2c')]!==_0x433b91['inUse']||_0x5649b3[_0x7a05('0x2d')]!==_0x433b91[_0x7a05('0x2d')];if(_0x5649b3['Trunk']&&_0x433b91[_0x7a05('0x2e')]){_0x2289a2=_0x5649b3['Trunk']['name']!==_0x433b91[_0x7a05('0x2e')][_0x7a05('0x2f')]||_0x5649b3[_0x7a05('0x2e')][_0x7a05('0x1e')]!==_0x433b91[_0x7a05('0x2e')]['active'];}return _0x5a67cd||_0x15a28c||_0x2289a2;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xe1901a){var _0x22d33a=null;var _0x149914=_0xe1901a[_0x7a05('0x30')];if(_[_0x7a05('0x31')](_0xe1901a['dialGlobalInterval'])||_[_0x7a05('0x31')](_0xe1901a[_0x7a05('0x32')])||_[_0x7a05('0x31')](_0xe1901a['Interval'][_0x7a05('0x33')])){_0x22d33a=CAMPAIGN_STATUS[_0x7a05('0x34')];}else if(_[_0x7a05('0x35')](_0xe1901a['dialGlobalInterval'])||_[_0x7a05('0x35')](_0xe1901a[_0x7a05('0x32')][_0x7a05('0x33')])){_0x22d33a=CAMPAIGN_STATUS[_0x7a05('0x36')];}else if(_0x149914&&!timezones[_0x149914]){_0x22d33a=CAMPAIGN_STATUS[_0x7a05('0x37')];}return _0x22d33a;}function checkAnyValidTrunk(_0x2b34fd,_0x3d9f58){var _0xbb104e=null;var _0x39c305='SIP/';var _0x112080=[_0x7a05('0x38'),'unmonitored'];var _0xa16343=!![];if(_0x2b34fd[_0x7a05('0x2e')]&&_0x2b34fd['Trunk'][_0x7a05('0x1e')]){_0x39c305+=_0x2b34fd[_0x7a05('0x2e')][_0x7a05('0x2f')];_0xbb104e=_0x3d9f58[_0x39c305];_0xa16343=_0x112080[_0x7a05('0x39')](_0xbb104e[_0x7a05('0x3a')]);}else if(_0x2b34fd['TrunkBackup']&&_0x2b34fd[_0x7a05('0x3b')][_0x7a05('0x1e')]){_0x39c305+=_0x2b34fd[_0x7a05('0x3b')][_0x7a05('0x2f')];_0xbb104e=_0x3d9f58[_0x39c305];_0xa16343=_0x112080['includes'](_0xbb104e['status']);}return _0xa16343;}function getQueueCampaignStatusMessage(_0x330e76,_0x1fc30c){var _0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3c')];var _0xdfa9b4=isPreviewCampaign(_0x330e76);if(!isQueueCampaignActive(_0x330e76)){if(_0xdfa9b4){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3d')];}else{if(_0x330e76[_0x7a05('0x2d')]===0x0&&_0x330e76[_0x7a05('0x29')]===0x0&&_0x330e76['waiting']===0x0&&(_0x330e76[_0x7a05('0x2a')]||0x0)===0x0){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3d')];}else{_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3e')];}}}else if(_0x330e76[_0x7a05('0x26')]===0x0){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x3f')];}else if(!checkAnyValidTrunk(_0x330e76,_0x1fc30c)){_0x30b581=CAMPAIGN_STATUS[_0x7a05('0x40')];}else if(!isPreviewCampaign(_0x330e76)){var _0x6c4d4b=checkAnyValidQueueCampaignInterval(_0x330e76);if(_0x6c4d4b){_0x30b581=_0x6c4d4b;}}return _0x30b581;}exports[_0x7a05('0x41')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x376912){var _0x14cfa7=CAMPAIGN_STATUS[_0x7a05('0x3e')];if(_0x376912[_0x7a05('0x2d')]===0x0&&_0x376912[_0x7a05('0x29')]===0x0&&_0x376912[_0x7a05('0x2b')]===0x0&&(_0x376912[_0x7a05('0x2a')]||0x0)===0x0){_0x14cfa7=CAMPAIGN_STATUS[_0x7a05('0x3d')];}return _0x14cfa7;}exports[_0x7a05('0x42')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1cc53a){var _0x202088=_0x1cc53a['match'](/"(.*?)"/);return _0x202088?_0x202088[0x1]:_0x1cc53a;}exports[_0x7a05('0x43')]=extractCalleridName;function getCallerId(_0x3f143c,_0x4adb69,_0x40fa45){if(!_[_0x7a05('0x44')](_0x40fa45)&&typeof _0x40fa45==='string'&&!_['isEmpty'](_0x40fa45)){if(!_[_0x7a05('0x44')](_0x4adb69)&&typeof _0x4adb69===_0x7a05('0x45')&&!_[_0x7a05('0x35')](_0x4adb69)){return util[_0x7a05('0x46')](_0x7a05('0x47'),_0x4adb69,_0x40fa45);}return util[_0x7a05('0x46')](_0x7a05('0x47'),_0x40fa45,_0x40fa45);}if(!_['isUndefined'](_0x3f143c)&&typeof _0x3f143c==='string'&&!_[_0x7a05('0x35')](_0x3f143c)){return _0x3f143c;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x2107d3,_0x58c2d3){var _0x3d3e31;var _0x8d5213;var _0x56e7e6;if(_0x58c2d3<=0x0){_0x58c2d3=0x1;}_0x3d3e31=new RegExp('\x5cw{0,'+_0x58c2d3+'}$');_0x8d5213=Math[_0x7a05('0x48')](0xa,_0x58c2d3-0x1);_0x56e7e6=Math['pow'](0xa,_0x58c2d3)-0x1;return util['format']('%s',_[_0x7a05('0x49')](_0x2107d3,_0x3d3e31,_[_0x7a05('0x4a')](_0x8d5213,_0x56e7e6)[_0x7a05('0x4b')]()));}exports[_0x7a05('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x2ac412){if(_0x2ac412[_0x7a05('0x2d')]&&_0x2ac412['originated']>0x0){_0x2ac412['originated']-=0x1;}else{logger[_0x7a05('0x4d')](_0x7a05('0x4e'));}}exports[_0x7a05('0x4f')]=decrementOriginate;function checkContactEmpty(_0x102f70){return _0x102f70&&_0x102f70[_0x7a05('0x50')]>0x0;}exports[_0x7a05('0x51')]=checkContactEmpty;function erlangb(_0x3f82e0,_0x3f4b6e){if(_0x3f4b6e===0x0){return 0x0;}var _0x4d5ea4=0x1;for(var _0x2276c2=0x1;_0x2276c2<=_0x3f4b6e;_0x2276c2+=0x1){_0x4d5ea4=0x1+_0x4d5ea4*_0x2276c2/_0x3f82e0;}return 0x1/_0x4d5ea4;}exports[_0x7a05('0x52')]=erlangb;function checkContactLowerLimitOriginate(_0x34a1c3,_0x1d0c35,_0x7f24d7){if(_0x1d0c35>_0x7f24d7){for(var _0x26d96b=0x0;_0x26d96b<_0x1d0c35-_0x7f24d7;_0x26d96b+=0x1){decrementOriginate(_0x34a1c3);}}}exports[_0x7a05('0x53')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1c69fa){var _0xbdf11={};var _0x1361a2=['id',_0x7a05('0x54'),_0x7a05('0x55'),_0x7a05('0x56')];const _0x2325ee=0xfa;if(_0x1c69fa){for(var _0x553081 in _0x1c69fa){if(typeof _0x1c69fa[_0x553081]!==_0x7a05('0x57')){if(!_['isNil'](_0x1c69fa[_0x553081])&&!_0x1361a2[_0x7a05('0x39')](_0x553081)){if(_0x553081===_0x7a05('0x58')&&_0x1c69fa[_0x553081][_0x7a05('0x50')]>_0x2325ee){_0xbdf11[_0x7a05('0x59')+_0x553081[_0x7a05('0x5a')]()]=_0x1c69fa[_0x553081][_0x7a05('0x4b')]()[_0x7a05('0x5b')](0x0,_0x2325ee);}else{_0xbdf11[_0x7a05('0x59')+_0x553081[_0x7a05('0x5a')]()]=_0x1c69fa[_0x553081];}}}}}return _0xbdf11;}exports[_0x7a05('0x5c')]=setXMDContactVariables; \ No newline at end of file +var _0x7673=['tags','updatedAt','undefined','XMD-','toUpperCase','toString','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','isPreviewCampaign','type','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','diff','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialGlobalInterval','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','SIP/','reachable','unmonitored','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','random','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','createdAt'];(function(_0x29c3b2,_0x3c12ac){var _0x4b3aa7=function(_0x622a9d){while(--_0x622a9d){_0x29c3b2['push'](_0x29c3b2['shift']());}};_0x4b3aa7(++_0x3c12ac);}(_0x7673,0x170));var _0x3767=function(_0x548483,_0x5e53ab){_0x548483=_0x548483-0x0;var _0x53afbd=_0x7673[_0x548483];return _0x53afbd;};'use strict';var _=require(_0x3767('0x0'));var moment=require(_0x3767('0x1'));var util=require(_0x3767('0x2'));var logger=require(_0x3767('0x3'))('dialer');var timezones=require(_0x3767('0x4'))[_0x3767('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x3767('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x3767('0x7'),'DISACTIVED':_0x3767('0x8'),'EMPTY_INTERVAL':_0x3767('0x9'),'INACTIVE':_0x3767('0xa'),'NO_AGENTS_LOGGED':_0x3767('0xb'),'NO_AVAILABLE_CONTACTS':_0x3767('0xc'),'NULL_INTERVAL':_0x3767('0xd'),'OVERTIME_INTERVAL':_0x3767('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x3767('0xf'),'QUEUE_RECALL':_0x3767('0x10'),'RECALL_TIMEOUT':_0x3767('0x11'),'RUNNING':_0x3767('0x12'),'UNKNOWN_TIMEZONE':_0x3767('0x13'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x3767('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x598acb){return _0x598acb['dialMethod']==='preview';}exports[_0x3767('0x15')]=isPreviewCampaign;function isIVRCampaign(_0x5ce30e){return _0x5ce30e[_0x3767('0x16')]==='ivr';}exports[_0x3767('0x17')]=isIVRCampaign;function isOutboundQueue(_0x555831){return _0x555831[_0x3767('0x16')]===_0x3767('0x18');}exports[_0x3767('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x340e6e){return _0x340e6e[_0x3767('0x1a')];}exports[_0x3767('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0x203b95){return _0x203b95[_0x3767('0x1c')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x2bf923,_0x1d475e){var _0x4c54f1=moment(_0x2bf923)['milliseconds'](0x0);var _0x3913a5=moment(_0x1d475e)['milliseconds'](0x0);return _0x4c54f1[_0x3767('0x1d')](_0x3913a5,'seconds');}exports[_0x3767('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x25e77a,_0x3b2a28){var _0x2f158d=![];var _0x3a74b7=_0x25e77a[_0x3767('0x1f')]!==_0x3b2a28[_0x3767('0x1f')]||_0x25e77a[_0x3767('0x1a')]!==_0x3b2a28[_0x3767('0x1a')]||_0x25e77a[_0x3767('0x20')]!==_0x3b2a28[_0x3767('0x20')];var _0x101ced=_0x25e77a[_0x3767('0x21')]!==_0x3b2a28[_0x3767('0x21')]||_0x25e77a[_0x3767('0x22')]!==_0x3b2a28[_0x3767('0x22')]||_0x25e77a[_0x3767('0x23')]!==_0x3b2a28['loggedInDb']||_0x25e77a['paused']!==_0x3b2a28[_0x3767('0x24')]||_0x25e77a[_0x3767('0x25')]!==_0x3b2a28[_0x3767('0x25')]||_0x25e77a[_0x3767('0x26')]!==_0x3b2a28[_0x3767('0x26')]||_0x25e77a[_0x3767('0x27')]!==_0x3b2a28[_0x3767('0x27')]||_0x25e77a[_0x3767('0x28')]!==_0x3b2a28[_0x3767('0x28')]||_0x25e77a[_0x3767('0x29')]!==_0x3b2a28[_0x3767('0x29')];if(_0x25e77a['Trunk']&&_0x3b2a28[_0x3767('0x2a')]){_0x2f158d=_0x25e77a['Trunk'][_0x3767('0x2b')]!==_0x3b2a28[_0x3767('0x2a')]['name']||_0x25e77a[_0x3767('0x2a')][_0x3767('0x1c')]!==_0x3b2a28[_0x3767('0x2a')][_0x3767('0x1c')];}return _0x3a74b7||_0x101ced||_0x2f158d;}exports[_0x3767('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2d3a28){var _0x53e23f=null;var _0x470967=_0x2d3a28['dialTimezone'];if(_['isNil'](_0x2d3a28[_0x3767('0x2d')])||_[_0x3767('0x2e')](_0x2d3a28[_0x3767('0x2f')])||_[_0x3767('0x2e')](_0x2d3a28[_0x3767('0x2f')][_0x3767('0x30')])){_0x53e23f=CAMPAIGN_STATUS[_0x3767('0x31')];}else if(_[_0x3767('0x32')](_0x2d3a28[_0x3767('0x2d')])||_[_0x3767('0x32')](_0x2d3a28['Interval'][_0x3767('0x30')])){_0x53e23f=CAMPAIGN_STATUS[_0x3767('0x33')];}else if(_0x470967&&!timezones[_0x470967]){_0x53e23f=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x53e23f;}function checkAnyValidTrunk(_0x380aff,_0x4c81db){var _0x161e95=null;var _0x2bd1fe=_0x3767('0x34');var _0x2dc6f3=[_0x3767('0x35'),_0x3767('0x36')];var _0x39a543=!![];if(_0x380aff[_0x3767('0x2a')]&&_0x380aff[_0x3767('0x2a')]['active']){_0x2bd1fe+=_0x380aff['Trunk']['name'];_0x161e95=_0x4c81db[_0x2bd1fe];_0x39a543=_0x2dc6f3[_0x3767('0x37')](_0x161e95[_0x3767('0x38')]);}else if(_0x380aff[_0x3767('0x39')]&&_0x380aff[_0x3767('0x39')][_0x3767('0x1c')]){_0x2bd1fe+=_0x380aff['TrunkBackup'][_0x3767('0x2b')];_0x161e95=_0x4c81db[_0x2bd1fe];_0x39a543=_0x2dc6f3[_0x3767('0x37')](_0x161e95[_0x3767('0x38')]);}return _0x39a543;}function getQueueCampaignStatusMessage(_0x23aef4,_0x511535){var _0x5e77ae=CAMPAIGN_STATUS['ACTIVE'];var _0x1e858f=isPreviewCampaign(_0x23aef4);if(!isQueueCampaignActive(_0x23aef4)){if(_0x1e858f){_0x5e77ae=CAMPAIGN_STATUS[_0x3767('0x3a')];}else{if(_0x23aef4[_0x3767('0x29')]===0x0&&_0x23aef4[_0x3767('0x25')]===0x0&&_0x23aef4[_0x3767('0x27')]===0x0&&(_0x23aef4[_0x3767('0x26')]||0x0)===0x0){_0x5e77ae=CAMPAIGN_STATUS['INACTIVE'];}else{_0x5e77ae=CAMPAIGN_STATUS[_0x3767('0x3b')];}}}else if(_0x23aef4[_0x3767('0x22')]===0x0){_0x5e77ae=CAMPAIGN_STATUS[_0x3767('0x3c')];}else if(!checkAnyValidTrunk(_0x23aef4,_0x511535)){_0x5e77ae=CAMPAIGN_STATUS[_0x3767('0x3d')];}else if(!isPreviewCampaign(_0x23aef4)){var _0x23c7c2=checkAnyValidQueueCampaignInterval(_0x23aef4);if(_0x23c7c2){_0x5e77ae=_0x23c7c2;}}return _0x5e77ae;}exports[_0x3767('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2e8928){var _0x18b394=CAMPAIGN_STATUS[_0x3767('0x3b')];if(_0x2e8928['originated']===0x0&&_0x2e8928['talking']===0x0&&_0x2e8928[_0x3767('0x27')]===0x0&&(_0x2e8928[_0x3767('0x26')]||0x0)===0x0){_0x18b394=CAMPAIGN_STATUS[_0x3767('0x3a')];}return _0x18b394;}exports[_0x3767('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1e733b){var _0x40ca4f=_0x1e733b['match'](/"(.*?)"/);return _0x40ca4f?_0x40ca4f[0x1]:_0x1e733b;}exports[_0x3767('0x40')]=extractCalleridName;function getCallerId(_0x20f0af,_0x16c860,_0x5e1bf7){if(!_[_0x3767('0x41')](_0x5e1bf7)&&typeof _0x5e1bf7===_0x3767('0x42')&&!_[_0x3767('0x32')](_0x5e1bf7)){if(!_['isUndefined'](_0x16c860)&&typeof _0x16c860===_0x3767('0x42')&&!_[_0x3767('0x32')](_0x16c860)){return util[_0x3767('0x43')](_0x3767('0x44'),_0x16c860,_0x5e1bf7);}return util[_0x3767('0x43')](_0x3767('0x44'),_0x5e1bf7,_0x5e1bf7);}if(!_['isUndefined'](_0x20f0af)&&typeof _0x20f0af===_0x3767('0x42')&&!_[_0x3767('0x32')](_0x20f0af)){return _0x20f0af;}return _0x3767('0x45');}exports[_0x3767('0x46')]=getCallerId;function getCallerIdRandom(_0x3fa9bc,_0x3ebf62){var _0x17c4be;var _0x3a0dfd;var _0x1523aa;if(_0x3ebf62<=0x0){_0x3ebf62=0x1;}_0x17c4be=new RegExp(_0x3767('0x47')+_0x3ebf62+'}$');_0x3a0dfd=Math[_0x3767('0x48')](0xa,_0x3ebf62-0x1);_0x1523aa=Math['pow'](0xa,_0x3ebf62)-0x1;return util[_0x3767('0x43')]('%s',_['replace'](_0x3fa9bc,_0x17c4be,_[_0x3767('0x49')](_0x3a0dfd,_0x1523aa)['toString']()));}exports[_0x3767('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x1b0753){if(_0x1b0753[_0x3767('0x29')]&&_0x1b0753[_0x3767('0x29')]>0x0){_0x1b0753['originated']-=0x1;}else{logger[_0x3767('0x4b')](_0x3767('0x4c'));}}exports[_0x3767('0x4d')]=decrementOriginate;function checkContactEmpty(_0x91fd1){return _0x91fd1&&_0x91fd1[_0x3767('0x4e')]>0x0;}exports[_0x3767('0x4f')]=checkContactEmpty;function erlangb(_0x47e5d9,_0x17b649){if(_0x17b649===0x0){return 0x0;}var _0x4066c7=0x1;for(var _0x32d981=0x1;_0x32d981<=_0x17b649;_0x32d981+=0x1){_0x4066c7=0x1+_0x4066c7*_0x32d981/_0x47e5d9;}return 0x1/_0x4066c7;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x29c8af,_0x23fb2d,_0x343bf6){if(_0x23fb2d>_0x343bf6){for(var _0x1e67f6=0x0;_0x1e67f6<_0x23fb2d-_0x343bf6;_0x1e67f6+=0x1){decrementOriginate(_0x29c8af);}}}exports[_0x3767('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x191f79){var _0x4d64f6={};var _0x117553=['id',_0x3767('0x51'),_0x3767('0x52'),_0x3767('0x53')];const _0x5c8b1f=0xfa;if(_0x191f79){for(var _0x26d979 in _0x191f79){if(typeof _0x191f79[_0x26d979]!==_0x3767('0x54')){if(!_[_0x3767('0x2e')](_0x191f79[_0x26d979])&&!_0x117553[_0x3767('0x37')](_0x26d979)){if(_0x26d979==='description'&&_0x191f79[_0x26d979]['length']>_0x5c8b1f){_0x4d64f6[_0x3767('0x55')+_0x26d979[_0x3767('0x56')]()]=_0x191f79[_0x26d979][_0x3767('0x57')]()[_0x3767('0x58')](0x0,_0x5c8b1f);}else{_0x4d64f6[_0x3767('0x55')+_0x26d979[_0x3767('0x56')]()]=_0x191f79[_0x26d979];}}}}}return _0x4d64f6;}exports[_0x3767('0x59')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 6be462c..85b1c8f 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(_0x205992,_0x4bd366){var _0x36c475=function(_0x2f5812){while(--_0x2f5812){_0x205992['push'](_0x205992['shift']());}};_0x36c475(++_0x4bd366);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x324d45,_0x44be6b){var _0x145e97=function(_0x41b501){while(--_0x41b501){_0x324d45['push'](_0x324d45['shift']());}};_0x145e97(++_0x44be6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 6ad7118..dc9e30b 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 _0x5dab=['Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','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','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','prototype','context','hasOwnProperty','exten','channel','uniqueid','name','info','\x20syncNewchannel\x20','channelstate','channelstatedesc','syncNewExten','variable','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','resolution','transferrate','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','fax','catch','\x20notify\x20','error','\x20receiveFax\x20','syncOriginateResponse','merge','response','reason','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','execOriginate','FaxAccountId','[Fax][execOriginate][success]'];(function(_0xe706ae,_0x52e822){var _0x19e176=function(_0x23d680){while(--_0x23d680){_0xe706ae['push'](_0xe706ae['shift']());}};_0x19e176(++_0x52e822);}(_0x5dab,0x183));var _0xb5da=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x5dab[_0x30ae5e];return _0x1f2e93;};'use strict';var util=require(_0xb5da('0x0'));var _=require(_0xb5da('0x1'));var BPromise=require(_0xb5da('0x2'));var uuid=require(_0xb5da('0x3'));var moment=require(_0xb5da('0x4'));var path=require(_0xb5da('0x5'));var tiff2pdf=require(_0xb5da('0x6'));var gs=require('./util/gs');var logger=require(_0xb5da('0x7'))('fax');var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0xb5da('0x8'));var ut=require('./util/util');var Action=require(_0xb5da('0x9'));var faxAccount=require(_0xb5da('0xa'));var attachment=require(_0xb5da('0xb'));var faxMessage=require(_0xb5da('0xc'));function Fax(_0xfd27f4){this[_0xb5da('0xd')]={};this[_0xb5da('0xe')]=_0xfd27f4[_0xb5da('0xe')];this[_0xb5da('0xf')]=_0xfd27f4[_0xb5da('0xf')];this[_0xb5da('0x10')]={};ami['on'](_0xb5da('0x11'),this[_0xb5da('0x12')][_0xb5da('0x13')](this));ami['on']('varset',this['syncVarSet'][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x14'),this[_0xb5da('0x15')][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x16'),this['syncNewExten'][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x17'),this[_0xb5da('0x18')][_0xb5da('0x13')](this));ami['on'](_0xb5da('0x19'),this[_0xb5da('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xb5da('0x1b'),this['syncOriginateResponse']['bind'](this));}Fax[_0xb5da('0x1c')][_0xb5da('0x12')]=function(_0x45378a){if(_0x45378a[_0xb5da('0x1d')]==='from-voip-provider'){for(var _0x28dcdf in this['faxAccounts']){if(this[_0xb5da('0xe')][_0xb5da('0x1e')](_0x28dcdf)){if(_0x45378a[_0xb5da('0x1f')]===this[_0xb5da('0xe')][_0x28dcdf]['localstationid']){this[_0xb5da('0xd')][_0x45378a['uniqueid']]={};this[_0xb5da('0xd')][_0x45378a['uniqueid']][_0xb5da('0x20')]=_0x45378a[_0xb5da('0x20')];this[_0xb5da('0xd')][_0x45378a[_0xb5da('0x21')]]['id']=this[_0xb5da('0xe')][_0x28dcdf]['id'];this[_0xb5da('0xd')][_0x45378a[_0xb5da('0x21')]][_0xb5da('0x22')]=this['faxAccounts'][_0x28dcdf][_0xb5da('0x22')];logger[_0xb5da('0x23')](_0x45378a[_0xb5da('0x21')],_0xb5da('0x24'));}}}}if(this[_0xb5da('0x10')][_0x45378a[_0xb5da('0x21')]]){this['channels'][_0x45378a['uniqueid']]={};this[_0xb5da('0xd')][_0x45378a[_0xb5da('0x21')]][_0xb5da('0x20')]=_0x45378a['channel'];logger['info'](_0x45378a[_0xb5da('0x21')],_0xb5da('0x24'));}};Fax[_0xb5da('0x1c')]['syncVarSet']=function(_0xe0051a){if(this[_0xb5da('0xd')][_0xe0051a[_0xb5da('0x21')]]){for(var _0x13ee39 in _0xe0051a['variable']){if(_0xe0051a['variable']['hasOwnProperty'](_0x13ee39)){this[_0xb5da('0xd')][_0xe0051a['uniqueid']][_0x13ee39]=_0xe0051a['value'];}}}};Fax[_0xb5da('0x1c')]['syncNewState']=function(_0x4c2cee){if(this[_0xb5da('0xd')][_0x4c2cee[_0xb5da('0x21')]]){this[_0xb5da('0xd')][_0x4c2cee[_0xb5da('0x21')]][_0xb5da('0x25')]=_0x4c2cee[_0xb5da('0x25')];this['channels'][_0x4c2cee[_0xb5da('0x21')]][_0xb5da('0x26')]=_0x4c2cee['channelstatedesc'];}};Fax[_0xb5da('0x1c')][_0xb5da('0x27')]=function(_0xaa8b7a){if(this[_0xb5da('0xd')][_0xaa8b7a['uniqueid']]){for(var _0x3cbfef in _0xaa8b7a[_0xb5da('0x28')]){if(_0xaa8b7a[_0xb5da('0x28')][_0xb5da('0x1e')](_0x3cbfef)){this['channels'][_0xaa8b7a[_0xb5da('0x21')]][_0x3cbfef]=_0xaa8b7a[_0xb5da('0x29')];}}}};Fax[_0xb5da('0x1c')][_0xb5da('0x18')]=function(_0x15e685){if(this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]]){this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]][_0xb5da('0x2a')]=_0x15e685[_0xb5da('0x2a')];this['channels'][_0x15e685[_0xb5da('0x21')]][_0xb5da('0x2b')]=_0x15e685['status'];this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]]['localstationid']=_0x15e685[_0xb5da('0x2c')];this[_0xb5da('0xd')][_0x15e685[_0xb5da('0x21')]][_0xb5da('0x2d')]=_0x15e685[_0xb5da('0x2d')];logger['info'](_0x15e685[_0xb5da('0x21')],_0xb5da('0x2e'));}};Fax[_0xb5da('0x1c')][_0xb5da('0x1a')]=function(_0x29f371){var _0x3d6e4f=this;if(this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]]){var _0x9d5758=this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]]['id'];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x2f')]=_0x29f371['remotestationid'];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]]['pagestransferred']=_0x29f371['pagestransferred'];this[_0xb5da('0xd')][_0x29f371['uniqueid']][_0xb5da('0x2c')]=_0x29f371[_0xb5da('0x2c')];this['channels'][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x30')]=_0x29f371['resolution'];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x31')]=_0x29f371['transferrate'];this[_0xb5da('0xd')][_0x29f371['uniqueid']][_0xb5da('0x2d')]=_0x29f371[_0xb5da('0x2d')];this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x32')]=_0x29f371['calleridnum'];if(this[_0xb5da('0xd')][_0x29f371[_0xb5da('0x21')]][_0xb5da('0x33')]>0x0){tiff2pdf(_0x29f371[_0xb5da('0x2d')],_0xb5da('0x34'),function(_0x5dbab2){logger[_0xb5da('0x23')](_0x29f371[_0xb5da('0x21')],'\x20result\x20conversion\x20file\x20',_0x5dbab2[_0xb5da('0x35')]);attachment[_0xb5da('0x36')]({'name':path[_0xb5da('0x37')](_0x29f371[_0xb5da('0x2d')])[_0xb5da('0x22')],'basename':path['parse'](_0x29f371[_0xb5da('0x2d')])[_0xb5da('0x22')]+_0xb5da('0x38'),'type':_0xb5da('0x39')})[_0xb5da('0x3a')](function(_0x20f7c6){faxAccount['notify'](_0x9d5758,{'from':_0x29f371['calleridnum'],'mapKey':_0xb5da('0x3b'),'body':path[_0xb5da('0x37')](_0x29f371[_0xb5da('0x2d')])[_0xb5da('0x22')]+_0xb5da('0x38'),'AttachmentId':_0x20f7c6['id']})[_0xb5da('0x3c')](function(_0x46ed49){logger['error'](_0x29f371['uniqueid'],_0xb5da('0x3d'),JSON['stringify'](_0x46ed49));});})['catch'](function(_0xea5954){logger[_0xb5da('0x3e')](_0x29f371['uniqueid'],_0xb5da('0x3f'),JSON['stringify'](_0xea5954));});});}logger['info'](_0x29f371[_0xb5da('0x21')],_0xb5da('0x3f'));}};Fax[_0xb5da('0x1c')][_0xb5da('0x40')]=function(_0x40eb16){if(this['actions'][_0x40eb16[_0xb5da('0x21')]]){_[_0xb5da('0x41')](this['channels'][_0x40eb16[_0xb5da('0x21')]],_['pick'](_0x40eb16,[_0xb5da('0x42'),_0xb5da('0x43')]));}};function updateStatus(_0x5a4496){if(_0x5a4496['AttachmentId']){faxMessage['update'](_0x5a4496['AttachmentId'],{'failMessage':_0xb5da('0x44')})[_0xb5da('0x3a')](function(_0x8aca71){ut[_0xb5da('0x45')]('[Fax][Message][Error][Updated]',_0x8aca71);})[_0xb5da('0x3c')](function(_0x493f5b){ut[_0xb5da('0x45')](_0xb5da('0x46'),_0x493f5b);});}else{ut[_0xb5da('0x45')](_0xb5da('0x47'));}}Fax[_0xb5da('0x1c')][_0xb5da('0x48')]=function(_0x249571,_0x2c82c6,_0x357449){var _0x27fe34=this;var _0x1d9e86={};if(_0x2c82c6){_0x1d9e86={'read':_0x2c82c6};}else{_0x1d9e86={'failMessage':_0x357449};}if(this['actions'][_0x249571][_0xb5da('0x49')]){faxMessage[_0xb5da('0x4a')](this[_0xb5da('0x10')][_0x249571][_0xb5da('0x49')],_0x1d9e86)[_0xb5da('0x3a')](function(_0x423354){ut[_0xb5da('0x45')](_0xb5da('0x4b'),_0x423354);})['catch'](function(_0x1ebd78){ut['logger'](_0xb5da('0x4c'),_0x1ebd78);})[_0xb5da('0x4d')](function(){delete _0x27fe34[_0xb5da('0xd')][_0x249571];delete _0x27fe34[_0xb5da('0x10')][_0x249571];});}else{ut[_0xb5da('0x45')](_0xb5da('0x4e'));delete this[_0xb5da('0xd')][_0x249571];delete this[_0xb5da('0x10')][_0x249571];}};Fax[_0xb5da('0x1c')][_0xb5da('0x4f')]=function(_0x2b70aa){var _0x377604=this;if(this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]]){if(this[_0xb5da('0x10')][_0x2b70aa['uniqueid']]){this['channels'][_0x2b70aa[_0xb5da('0x21')]]['id']=this[_0xb5da('0x10')][_0x2b70aa['uniqueid']]['id'];this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x22')]=this[_0xb5da('0x10')][_0x2b70aa['uniqueid']][_0xb5da('0x22')];}logger[_0xb5da('0x23')](_0x2b70aa[_0xb5da('0x21')],this[_0xb5da('0x10')][_0x2b70aa[_0xb5da('0x21')]]?_0xb5da('0x50'):_0xb5da('0x51'),JSON[_0xb5da('0x52')](this[_0xb5da('0xd')][_0x2b70aa['uniqueid']]));if(this[_0xb5da('0x10')][_0x2b70aa[_0xb5da('0x21')]]){if(this['channels'][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x53')]>0x0&&this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x17')]===_0xb5da('0x54')){this[_0xb5da('0x48')](_0x2b70aa[_0xb5da('0x21')],!![]);}else{this[_0xb5da('0x48')](_0x2b70aa[_0xb5da('0x21')],![],this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x55')]?'SENDING\x20FAILED:\x20'+this[_0xb5da('0xd')][_0x2b70aa[_0xb5da('0x21')]][_0xb5da('0x55')]:'SENDING\x20FAILED');}}}};Fax[_0xb5da('0x1c')]['send']=function(_0x452c87){var _0x2c2172=this;return new BPromise(function(_0x2efb51,_0x1cf401){_0x2c2172[_0xb5da('0x56')](_0x452c87,_0x2c2172[_0xb5da('0xe')][_0x452c87[_0xb5da('0x57')]])[_0xb5da('0x3a')](function(_0x10ced4){ut['logger'](_0xb5da('0x58'),_0x10ced4);_0x2efb51(ut[_0xb5da('0x35')](_0xb5da('0x59')));})[_0xb5da('0x3c')](function(_0x4e3cda){ut['logger'](_0xb5da('0x5a'),_0x4e3cda);updateStatus(_0x452c87);_0x1cf401(ut['message'](_0xb5da('0x5b')));});});};Fax[_0xb5da('0x1c')][_0xb5da('0x5c')]=function(_0x176fa3){var _0x19accf=this;return new BPromise(function(_0x45be6a,_0x4e9636){var _0x1c72cc=_0x19accf[_0xb5da('0x5d')](_0x19accf[_0xb5da('0xe')][_0x176fa3[_0xb5da('0x57')]][_0xb5da('0x5e')],_0x176fa3);if(_0x1c72cc[_0xb5da('0x5f')]){_0x45be6a(ut['message']('Trunk\x20Reachable'));}else{_0x4e9636(ut[_0xb5da('0x35')](_0x1c72cc[_0xb5da('0x35')]));}});};function originate(_0xb4505,_0xdc6d7a,_0xcbb6ae){return new BPromise(function(_0x120497,_0xc4c22a){if(_0xcbb6ae){var _0xdbc777=util['format'](_0xb5da('0x60'),path['parse'](_0xb4505['path'])[_0xb5da('0x22')],_0xb4505[_0xb5da('0x5')]);gs[_0xb5da('0x61')](_0xdbc777)[_0xb5da('0x3a')](function(){_0xb4505[_0xb5da('0x5')]=util[_0xb5da('0x62')](_0xb5da('0x63'),path[_0xb5da('0x37')](_0xb4505[_0xb5da('0x5')])['dir'],path[_0xb5da('0x37')](_0xb4505['path'])[_0xb5da('0x22')]);_0xdc6d7a[_0xb5da('0x64')]=_0xb4505[_0xb5da('0x5')];ut[_0xb5da('0x45')](_0xb5da('0x65'),'');ami['Action'](ut[_0xb5da('0x66')](_0xb4505,_0xdc6d7a))[_0xb5da('0x3a')](function(_0x51dd41){_0x120497(_0x51dd41);})['catch'](function(_0x12c068){_0xc4c22a(_0x12c068);});})[_0xb5da('0x3c')](function(_0x556a2c){_0xc4c22a(_0x556a2c);});}else{ami[_0xb5da('0x67')](ut[_0xb5da('0x66')](_0xb4505,_0xdc6d7a))['then'](function(_0x214391){_0x120497(_0x214391);})[_0xb5da('0x3c')](function(_0x67e62c){_0xc4c22a(_0x67e62c);});}});}Fax[_0xb5da('0x1c')][_0xb5da('0x56')]=function(_0x3243ee,_0x542e24){var _0x1a7311=this;return new BPromise(function(_0x4039d1,_0x223eeb){var _0x2fdb9d=uuid['v4']();var _0x2d95d0=ut[_0xb5da('0x68')](_0x3243ee,_0x542e24);_0x1a7311['actions'][_0x2fdb9d]=new Action(_0x2fdb9d,_0x542e24,_0x3243ee);var _0x4d9fb5=_0x1a7311[_0xb5da('0x10')][_0x2fdb9d];if(path['parse'](_0x3243ee[_0xb5da('0x5')])[_0xb5da('0x69')]==='.pdf'){originate(_0x4d9fb5,_0x2d95d0,!![])[_0xb5da('0x3a')](function(_0x23ccbf){_0x4039d1(_0x23ccbf);})[_0xb5da('0x3c')](function(_0x1c0dfa){_0x223eeb(_0x1c0dfa);});}else{originate(_0x4d9fb5,_0x2d95d0,![])[_0xb5da('0x3a')](function(_0x1db86b){_0x4039d1(_0x1db86b);})[_0xb5da('0x3c')](function(_0x434e25){_0x223eeb(_0x434e25);});}});};Fax['prototype'][_0xb5da('0x6a')]=function(_0x1b0fd8){return!_[_0xb5da('0x6b')](_0x1b0fd8)&&!_['isNil'](_0x1b0fd8[_0xb5da('0x22')])&&!_[_0xb5da('0x6b')](_0x1b0fd8[_0xb5da('0x6c')])&&_0x1b0fd8[_0xb5da('0x6c')]&&!_[_0xb5da('0x6b')](this[_0xb5da('0xf')][util[_0xb5da('0x62')]('SIP/%s',_0x1b0fd8['name'])])&&!_['isNil'](this[_0xb5da('0xf')][util['format'](_0xb5da('0x6d'),_0x1b0fd8['name'])][_0xb5da('0x2b')])&&(this[_0xb5da('0xf')][util[_0xb5da('0x62')](_0xb5da('0x6d'),_0x1b0fd8[_0xb5da('0x22')])]['status']===_0xb5da('0x6e')||this['trunks'][util[_0xb5da('0x62')](_0xb5da('0x6d'),_0x1b0fd8[_0xb5da('0x22')])][_0xb5da('0x2b')]===_0xb5da('0x6f'));};Fax[_0xb5da('0x1c')][_0xb5da('0x5d')]=function(_0x52ab58,_0xcabb56){if(!this[_0xb5da('0x6a')](_0x52ab58)){ut[_0xb5da('0x45')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0xb5da('0x6b')](_0x52ab58)?'':_0x52ab58[_0xb5da('0x22')]+_0xb5da('0x70'));return{'isValid':![],'message':_0xb5da('0x71')};}if(_[_0xb5da('0x6b')](_0xcabb56[_0xb5da('0x3b')])){ut[_0xb5da('0x45')](_0xb5da('0x72'),JSON[_0xb5da('0x52')](_0xcabb56));return{'isValid':![],'message':_0xb5da('0x73')};}if(_[_0xb5da('0x6b')](_0xcabb56[_0xb5da('0x5')])){ut[_0xb5da('0x45')](_0xb5da('0x74'),JSON[_0xb5da('0x52')](_0xcabb56));return{'isValid':![],'message':_0xb5da('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xb5da('0x76')]=Fax; \ No newline at end of file +var _0xecfe=['SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','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','Action','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','path','../ami','./rpcDb','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','bind','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','syncVarSet','value','channelstate','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','application/pdf','fax','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','finally','syncHangup','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20'];(function(_0x44438c,_0x150d7){var _0x51c71f=function(_0x5e4fde){while(--_0x5e4fde){_0x44438c['push'](_0x44438c['shift']());}};_0x51c71f(++_0x150d7);}(_0xecfe,0x18e));var _0xeecf=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xecfe[_0x249e96];return _0x17444c;};'use strict';var util=require('util');var _=require(_0xeecf('0x0'));var BPromise=require(_0xeecf('0x1'));var uuid=require(_0xeecf('0x2'));var moment=require('moment');var path=require(_0xeecf('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require('../../../config/logger')('fax');var ami=require(_0xeecf('0x4'));var rpcDb=require(_0xeecf('0x5'));var Channel=require('./channel');var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0xeecf('0x6'));var attachment=require(_0xeecf('0x7'));var faxMessage=require(_0xeecf('0x8'));function Fax(_0x52bd3d){this[_0xeecf('0x9')]={};this[_0xeecf('0xa')]=_0x52bd3d[_0xeecf('0xa')];this['trunks']=_0x52bd3d[_0xeecf('0xb')];this[_0xeecf('0xc')]={};ami['on'](_0xeecf('0xd'),this[_0xeecf('0xe')]['bind'](this));ami['on'](_0xeecf('0xf'),this['syncVarSet'][_0xeecf('0x10')](this));ami['on']('newstate',this[_0xeecf('0x11')][_0xeecf('0x10')](this));ami['on'](_0xeecf('0x12'),this[_0xeecf('0x13')][_0xeecf('0x10')](this));ami['on'](_0xeecf('0x14'),this[_0xeecf('0x15')][_0xeecf('0x10')](this));ami['on'](_0xeecf('0x16'),this['syncReceiveFax'][_0xeecf('0x10')](this));ami['on'](_0xeecf('0x17'),this['syncHangup'][_0xeecf('0x10')](this));ami['on'](_0xeecf('0x18'),this[_0xeecf('0x19')][_0xeecf('0x10')](this));}Fax['prototype']['syncNewchannel']=function(_0x40b052){if(_0x40b052[_0xeecf('0x1a')]===_0xeecf('0x1b')){for(var _0x5ba0ba in this[_0xeecf('0xa')]){if(this['faxAccounts'][_0xeecf('0x1c')](_0x5ba0ba)){if(_0x40b052[_0xeecf('0x1d')]===this[_0xeecf('0xa')][_0x5ba0ba][_0xeecf('0x1e')]){this[_0xeecf('0x9')][_0x40b052['uniqueid']]={};this['channels'][_0x40b052[_0xeecf('0x1f')]]['channel']=_0x40b052[_0xeecf('0x20')];this[_0xeecf('0x9')][_0x40b052[_0xeecf('0x1f')]]['id']=this[_0xeecf('0xa')][_0x5ba0ba]['id'];this[_0xeecf('0x9')][_0x40b052[_0xeecf('0x1f')]]['name']=this['faxAccounts'][_0x5ba0ba][_0xeecf('0x21')];logger[_0xeecf('0x22')](_0x40b052[_0xeecf('0x1f')],_0xeecf('0x23'));}}}}if(this[_0xeecf('0xc')][_0x40b052[_0xeecf('0x1f')]]){this[_0xeecf('0x9')][_0x40b052[_0xeecf('0x1f')]]={};this[_0xeecf('0x9')][_0x40b052['uniqueid']][_0xeecf('0x20')]=_0x40b052[_0xeecf('0x20')];logger['info'](_0x40b052[_0xeecf('0x1f')],_0xeecf('0x23'));}};Fax[_0xeecf('0x24')][_0xeecf('0x25')]=function(_0xcfd7b8){if(this[_0xeecf('0x9')][_0xcfd7b8['uniqueid']]){for(var _0x27ead1 in _0xcfd7b8['variable']){if(_0xcfd7b8['variable']['hasOwnProperty'](_0x27ead1)){this[_0xeecf('0x9')][_0xcfd7b8[_0xeecf('0x1f')]][_0x27ead1]=_0xcfd7b8[_0xeecf('0x26')];}}}};Fax[_0xeecf('0x24')][_0xeecf('0x11')]=function(_0x5d77d6){if(this[_0xeecf('0x9')][_0x5d77d6[_0xeecf('0x1f')]]){this[_0xeecf('0x9')][_0x5d77d6[_0xeecf('0x1f')]][_0xeecf('0x27')]=_0x5d77d6['channelstate'];this[_0xeecf('0x9')][_0x5d77d6['uniqueid']][_0xeecf('0x28')]=_0x5d77d6[_0xeecf('0x28')];}};Fax[_0xeecf('0x24')]['syncNewExten']=function(_0x39dfce){if(this[_0xeecf('0x9')][_0x39dfce[_0xeecf('0x1f')]]){for(var _0xe43f95 in _0x39dfce['variable']){if(_0x39dfce[_0xeecf('0x29')][_0xeecf('0x1c')](_0xe43f95)){this[_0xeecf('0x9')][_0x39dfce[_0xeecf('0x1f')]][_0xe43f95]=_0x39dfce[_0xeecf('0x26')];}}}};Fax[_0xeecf('0x24')][_0xeecf('0x15')]=function(_0x2746d7){if(this[_0xeecf('0x9')][_0x2746d7[_0xeecf('0x1f')]]){this['channels'][_0x2746d7[_0xeecf('0x1f')]][_0xeecf('0x2a')]=_0x2746d7[_0xeecf('0x2a')];this[_0xeecf('0x9')][_0x2746d7[_0xeecf('0x1f')]][_0xeecf('0x2b')]=_0x2746d7[_0xeecf('0x2b')];this[_0xeecf('0x9')][_0x2746d7['uniqueid']][_0xeecf('0x1e')]=_0x2746d7['localstationid'];this[_0xeecf('0x9')][_0x2746d7['uniqueid']][_0xeecf('0x2c')]=_0x2746d7[_0xeecf('0x2c')];logger[_0xeecf('0x22')](_0x2746d7['uniqueid'],_0xeecf('0x2d'));}};Fax['prototype'][_0xeecf('0x2e')]=function(_0x116705){var _0xa1946f=this;if(this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]]){var _0x1b04b8=this['channels'][_0x116705[_0xeecf('0x1f')]]['id'];this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]]['remotestationid']=_0x116705[_0xeecf('0x2f')];this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]][_0xeecf('0x30')]=_0x116705['pagestransferred'];this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]][_0xeecf('0x1e')]=_0x116705['localstationid'];this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]]['resolution']=_0x116705[_0xeecf('0x31')];this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]][_0xeecf('0x32')]=_0x116705[_0xeecf('0x32')];this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]][_0xeecf('0x2c')]=_0x116705['filename'];this[_0xeecf('0x9')][_0x116705[_0xeecf('0x1f')]][_0xeecf('0x33')]=_0x116705[_0xeecf('0x33')];if(this[_0xeecf('0x9')][_0x116705['uniqueid']][_0xeecf('0x30')]>0x0){tiff2pdf(_0x116705[_0xeecf('0x2c')],_0xeecf('0x34'),function(_0x483853){logger[_0xeecf('0x22')](_0x116705[_0xeecf('0x1f')],_0xeecf('0x35'),_0x483853[_0xeecf('0x36')]);attachment['create']({'name':path[_0xeecf('0x37')](_0x116705[_0xeecf('0x2c')])[_0xeecf('0x21')],'basename':path[_0xeecf('0x37')](_0x116705[_0xeecf('0x2c')])['name']+'.pdf','type':_0xeecf('0x38')})['then'](function(_0x36a37d){faxAccount['notify'](_0x1b04b8,{'from':_0x116705['calleridnum'],'mapKey':_0xeecf('0x39'),'body':path[_0xeecf('0x37')](_0x116705['filename'])[_0xeecf('0x21')]+_0xeecf('0x3a'),'AttachmentId':_0x36a37d['id']})[_0xeecf('0x3b')](function(_0x1ac9a4){logger[_0xeecf('0x3c')](_0x116705[_0xeecf('0x1f')],_0xeecf('0x3d'),JSON['stringify'](_0x1ac9a4));});})[_0xeecf('0x3b')](function(_0x201ab6){logger[_0xeecf('0x3c')](_0x116705[_0xeecf('0x1f')],'\x20receiveFax\x20',JSON[_0xeecf('0x3e')](_0x201ab6));});});}logger[_0xeecf('0x22')](_0x116705['uniqueid'],_0xeecf('0x3f'));}};Fax[_0xeecf('0x24')][_0xeecf('0x19')]=function(_0xd23165){if(this[_0xeecf('0xc')][_0xd23165[_0xeecf('0x1f')]]){_['merge'](this[_0xeecf('0x9')][_0xd23165['uniqueid']],_['pick'](_0xd23165,[_0xeecf('0x40'),_0xeecf('0x41')]));}};function updateStatus(_0x31e963){if(_0x31e963[_0xeecf('0x42')]){faxMessage[_0xeecf('0x43')](_0x31e963[_0xeecf('0x42')],{'failMessage':_0xeecf('0x44')})[_0xeecf('0x45')](function(_0x1cbd3d){ut[_0xeecf('0x46')]('[Fax][Message][Error][Updated]',_0x1cbd3d);})[_0xeecf('0x3b')](function(_0x868048){ut[_0xeecf('0x46')](_0xeecf('0x47'),_0x868048);});}else{ut[_0xeecf('0x46')](_0xeecf('0x48'));}}Fax[_0xeecf('0x24')]['updateStatus']=function(_0x494f9a,_0x5eb50e,_0xc3d9f7){var _0x2fee65=this;var _0x1ed60c={};if(_0x5eb50e){_0x1ed60c={'read':_0x5eb50e};}else{_0x1ed60c={'failMessage':_0xc3d9f7};}if(this[_0xeecf('0xc')][_0x494f9a]['AttachmentId']){faxMessage[_0xeecf('0x43')](this[_0xeecf('0xc')][_0x494f9a][_0xeecf('0x42')],_0x1ed60c)[_0xeecf('0x45')](function(_0x419a27){ut[_0xeecf('0x46')](_0xeecf('0x49'),_0x419a27);})[_0xeecf('0x3b')](function(_0x5b9b55){ut[_0xeecf('0x46')]('[Fax][Message][NoUpdate1]',_0x5b9b55);})[_0xeecf('0x4a')](function(){delete _0x2fee65[_0xeecf('0x9')][_0x494f9a];delete _0x2fee65[_0xeecf('0xc')][_0x494f9a];});}else{ut[_0xeecf('0x46')]('[Fax][Message][NoUpdate2]');delete this[_0xeecf('0x9')][_0x494f9a];delete this[_0xeecf('0xc')][_0x494f9a];}};Fax[_0xeecf('0x24')][_0xeecf('0x4b')]=function(_0x33ad0c){var _0x5dbbc8=this;if(this['channels'][_0x33ad0c[_0xeecf('0x1f')]]){if(this[_0xeecf('0xc')][_0x33ad0c[_0xeecf('0x1f')]]){this[_0xeecf('0x9')][_0x33ad0c[_0xeecf('0x1f')]]['id']=this[_0xeecf('0xc')][_0x33ad0c[_0xeecf('0x1f')]]['id'];this[_0xeecf('0x9')][_0x33ad0c['uniqueid']][_0xeecf('0x21')]=this[_0xeecf('0xc')][_0x33ad0c[_0xeecf('0x1f')]][_0xeecf('0x21')];}logger[_0xeecf('0x22')](_0x33ad0c[_0xeecf('0x1f')],this[_0xeecf('0xc')][_0x33ad0c['uniqueid']]?_0xeecf('0x4c'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this[_0xeecf('0x9')][_0x33ad0c[_0xeecf('0x1f')]]));if(this['actions'][_0x33ad0c['uniqueid']]){if(this[_0xeecf('0x9')][_0x33ad0c[_0xeecf('0x1f')]][_0xeecf('0x4d')]>0x0&&this['channels'][_0x33ad0c[_0xeecf('0x1f')]][_0xeecf('0x14')]===_0xeecf('0x4e')){this[_0xeecf('0x4f')](_0x33ad0c[_0xeecf('0x1f')],!![]);}else{this['updateStatus'](_0x33ad0c[_0xeecf('0x1f')],![],this[_0xeecf('0x9')][_0x33ad0c[_0xeecf('0x1f')]][_0xeecf('0x50')]?_0xeecf('0x51')+this[_0xeecf('0x9')][_0x33ad0c[_0xeecf('0x1f')]]['faxstatusstring']:_0xeecf('0x52'));}}}};Fax[_0xeecf('0x24')][_0xeecf('0x53')]=function(_0x450a34){var _0x364511=this;return new BPromise(function(_0x1137f5,_0xcedefe){_0x364511['execOriginate'](_0x450a34,_0x364511[_0xeecf('0xa')][_0x450a34[_0xeecf('0x54')]])[_0xeecf('0x45')](function(_0xebcee5){ut[_0xeecf('0x46')](_0xeecf('0x55'),_0xebcee5);_0x1137f5(ut['message'](_0xeecf('0x56')));})[_0xeecf('0x3b')](function(_0x4cb1c9){ut[_0xeecf('0x46')](_0xeecf('0x57'),_0x4cb1c9);updateStatus(_0x450a34);_0xcedefe(ut['message'](_0xeecf('0x58')));});});};Fax['prototype']['checkAfterSend']=function(_0x374130){var _0x116121=this;return new BPromise(function(_0x542031,_0x3e81fb){var _0x519913=_0x116121['checkTrunk'](_0x116121['faxAccounts'][_0x374130[_0xeecf('0x54')]][_0xeecf('0x59')],_0x374130);if(_0x519913[_0xeecf('0x5a')]){_0x542031(ut[_0xeecf('0x36')](_0xeecf('0x5b')));}else{_0x3e81fb(ut[_0xeecf('0x36')](_0x519913[_0xeecf('0x36')]));}});};function originate(_0x479cdc,_0x375104,_0x42df86){return new BPromise(function(_0x830805,_0x491cbb){if(_0x42df86){var _0x466215=util[_0xeecf('0x5c')](_0xeecf('0x5d'),path['parse'](_0x479cdc['path'])[_0xeecf('0x21')],_0x479cdc[_0xeecf('0x3')]);gs[_0xeecf('0x5e')](_0x466215)[_0xeecf('0x45')](function(){_0x479cdc[_0xeecf('0x3')]=util[_0xeecf('0x5c')](_0xeecf('0x5f'),path['parse'](_0x479cdc[_0xeecf('0x3')])[_0xeecf('0x60')],path['parse'](_0x479cdc[_0xeecf('0x3')])['name']);_0x375104[_0xeecf('0x61')]=_0x479cdc[_0xeecf('0x3')];ut[_0xeecf('0x46')](_0xeecf('0x62'),'');ami['Action'](ut[_0xeecf('0x63')](_0x479cdc,_0x375104))['then'](function(_0x2234ea){_0x830805(_0x2234ea);})[_0xeecf('0x3b')](function(_0x35a9bd){_0x491cbb(_0x35a9bd);});})['catch'](function(_0x41bd7a){_0x491cbb(_0x41bd7a);});}else{ami[_0xeecf('0x64')](ut['variablesAction'](_0x479cdc,_0x375104))[_0xeecf('0x45')](function(_0x790288){_0x830805(_0x790288);})[_0xeecf('0x3b')](function(_0x245876){_0x491cbb(_0x245876);});}});}Fax[_0xeecf('0x24')][_0xeecf('0x65')]=function(_0x2af27a,_0x52c8d1){var _0xfe7ed=this;return new BPromise(function(_0x4a6b95,_0x1e5ede){var _0x9abb64=uuid['v4']();var _0x49ff1b=ut[_0xeecf('0x66')](_0x2af27a,_0x52c8d1);_0xfe7ed[_0xeecf('0xc')][_0x9abb64]=new Action(_0x9abb64,_0x52c8d1,_0x2af27a);var _0x5ec982=_0xfe7ed[_0xeecf('0xc')][_0x9abb64];if(path[_0xeecf('0x37')](_0x2af27a['path'])[_0xeecf('0x67')]==='.pdf'){originate(_0x5ec982,_0x49ff1b,!![])[_0xeecf('0x45')](function(_0x1301b2){_0x4a6b95(_0x1301b2);})[_0xeecf('0x3b')](function(_0x276647){_0x1e5ede(_0x276647);});}else{originate(_0x5ec982,_0x49ff1b,![])[_0xeecf('0x45')](function(_0xe30fe5){_0x4a6b95(_0xe30fe5);})['catch'](function(_0x36ed79){_0x1e5ede(_0x36ed79);});}});};Fax[_0xeecf('0x24')][_0xeecf('0x68')]=function(_0x182c60){return!_[_0xeecf('0x69')](_0x182c60)&&!_[_0xeecf('0x69')](_0x182c60['name'])&&!_[_0xeecf('0x69')](_0x182c60[_0xeecf('0x6a')])&&_0x182c60['active']&&!_[_0xeecf('0x69')](this['trunks'][util['format'](_0xeecf('0x6b'),_0x182c60[_0xeecf('0x21')])])&&!_[_0xeecf('0x69')](this[_0xeecf('0xb')][util[_0xeecf('0x5c')](_0xeecf('0x6b'),_0x182c60['name'])][_0xeecf('0x2b')])&&(this[_0xeecf('0xb')][util[_0xeecf('0x5c')](_0xeecf('0x6b'),_0x182c60[_0xeecf('0x21')])][_0xeecf('0x2b')]===_0xeecf('0x6c')||this[_0xeecf('0xb')][util[_0xeecf('0x5c')]('SIP/%s',_0x182c60[_0xeecf('0x21')])]['status']===_0xeecf('0x6d'));};Fax[_0xeecf('0x24')][_0xeecf('0x6e')]=function(_0x4a59dd,_0x3465d5){if(!this['isTrunkReachable'](_0x4a59dd)){ut[_0xeecf('0x46')](_0xeecf('0x6f'),_[_0xeecf('0x69')](_0x4a59dd)?'':_0x4a59dd[_0xeecf('0x21')]+_0xeecf('0x70'));return{'isValid':![],'message':_0xeecf('0x71')};}if(_[_0xeecf('0x69')](_0x3465d5[_0xeecf('0x39')])){ut[_0xeecf('0x46')](_0xeecf('0x72'),JSON['stringify'](_0x3465d5));return{'isValid':![],'message':_0xeecf('0x73')};}if(_['isNil'](_0x3465d5['path'])){ut[_0xeecf('0x46')](_0xeecf('0x74'),JSON['stringify'](_0x3465d5));return{'isValid':![],'message':_0xeecf('0x75')};}return{'isValid':!![],'message':_0xeecf('0x76')};};module[_0xeecf('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 5f99ef9..fb32853 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 _0x40e2=['lodash','inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview'];(function(_0x47a897,_0x1f5728){var _0x30afe2=function(_0x46f1ff){while(--_0x46f1ff){_0x47a897['push'](_0x47a897['shift']());}};_0x30afe2(++_0x1f5728);}(_0x40e2,0xb7));var _0x240e=function(_0x1685c9,_0x1f272c){_0x1685c9=_0x1685c9-0x0;var _0x19b762=_0x40e2[_0x1685c9];return _0x19b762;};'use strict';var util=require(_0x240e('0x0'));var BPromise=require(_0x240e('0x1'));var logger=require(_0x240e('0x2'))(_0x240e('0x3'));var _=require(_0x240e('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x55b5e7){return function(_0x3e818a){logger['error'](_0x55b5e7,util[_0x240e('0x5')](_0x3e818a,{'showHidden':![],'depth':null}));};}exports[_0x240e('0x6')]=function(_0x4a0572,_0x522afa){return BPromise[_0x240e('0x7')]()[_0x240e('0x8')](faxAccount[_0x240e('0x6')](_0x4a0572,_0x522afa))[_0x240e('0x9')](loggerCatch(_0x240e('0xa')));}; \ No newline at end of file +var _0x8121=['../../../config/logger','preview','then','catch','[Notify]\x20','util','bluebird'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x8121,0x12b));var _0x1812=function(_0x236067,_0x27d1b9){_0x236067=_0x236067-0x0;var _0x4e7670=_0x8121[_0x236067];return _0x4e7670;};'use strict';var util=require(_0x1812('0x0'));var BPromise=require(_0x1812('0x1'));var logger=require(_0x1812('0x2'))(_0x1812('0x3'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x370fb0){return function(_0x236a78){logger['error'](_0x370fb0,util['inspect'](_0x236a78,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x576f7b,_0x496129){return BPromise['resolve']()[_0x1812('0x4')](faxAccount['notify'](_0x576f7b,_0x496129))[_0x1812('0x5')](loggerCatch(_0x1812('0x6')));}; \ 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 0266093..506db42 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 _0x504d=['Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info'];(function(_0x270d0c,_0x3b7e3a){var _0x620238=function(_0xba7526){while(--_0xba7526){_0x270d0c['push'](_0x270d0c['shift']());}};_0x620238(++_0x3b7e3a);}(_0x504d,0xc9));var _0xd504=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x504d[_0x75f869];return _0x10af8b;};'use strict';var util=require(_0xd504('0x0'));var logger=require(_0xd504('0x1'))(_0xd504('0x2'));var BPromise=require(_0xd504('0x3'));var exec=require(_0xd504('0x4'))[_0xd504('0x5')];exports[_0xd504('0x6')]=function(_0x367963){return new BPromise(function(_0x58a65f,_0x3de0a8){exec(_0x367963,function(_0x11c989,_0x1f006f,_0x5c89b7){logger[_0xd504('0x7')](_0xd504('0x8'),_0x1f006f);if(_0x11c989){logger[_0xd504('0x7')](_0xd504('0x8'),_0xd504('0x9'),util[_0xd504('0xa')](_0x11c989,{'showHidden':![],'depth':null}),_0x1f006f,_0x5c89b7);_0x3de0a8(_0x11c989);}_0x58a65f(_0x1f006f);});});}; \ No newline at end of file +var _0x32af=['exec','Exec\x20gs','\x20Error\x20:','../../../../config/logger','bluebird'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x32af,0x14d));var _0xf32a=function(_0x2afb28,_0x1dbed4){_0x2afb28=_0x2afb28-0x0;var _0x1751a4=_0x32af[_0x2afb28];return _0x1751a4;};'use strict';var util=require('util');var logger=require(_0xf32a('0x0'))('fax');var BPromise=require(_0xf32a('0x1'));var exec=require('child_process')[_0xf32a('0x2')];exports['execute']=function(_0x2e541d){return new BPromise(function(_0x539def,_0x50dc6e){exec(_0x2e541d,function(_0x5b6315,_0x1a5dce,_0x2d67c3){logger['info'](_0xf32a('0x3'),_0x1a5dce);if(_0x5b6315){logger['info'](_0xf32a('0x3'),_0xf32a('0x4'),util['inspect'](_0x5b6315,{'showHidden':![],'depth':null}),_0x1a5dce,_0x2d67c3);_0x50dc6e(_0x5b6315);}_0x539def(_0x1a5dce);});});}; \ 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 9228f6f..7329382 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 _0xdc84=['info','inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','logger'];(function(_0xb59853,_0x33378b){var _0x1b4954=function(_0x5f23b1){while(--_0x5f23b1){_0xb59853['push'](_0xb59853['shift']());}};_0x1b4954(++_0x33378b);}(_0xdc84,0x1d5));var _0x4dc8=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xdc84[_0x1ac6ec];return _0x48a489;};'use strict';var util=require(_0x4dc8('0x0'));var _=require(_0x4dc8('0x1'));var moment=require(_0x4dc8('0x2'));var logger=require(_0x4dc8('0x3'))(_0x4dc8('0x4'));exports['message']=function(_0xc9c36a){return{'message':_0xc9c36a};};exports[_0x4dc8('0x5')]=function(_0x3ee948,_0x1a8b94){logger[_0x4dc8('0x6')](_0x3ee948,util[_0x4dc8('0x7')](_0x1a8b94,{'showHidden':![],'depth':null}));};exports[_0x4dc8('0x8')]=function(_0x50a7ae,_0x146438){var _0x37461b={'XMF-ECM':_0x146438[_0x4dc8('0x9')],'XMF-HEADERINFO':_0x146438[_0x4dc8('0xa')],'XMF-MINRATE':_0x146438['minrate'],'XMF-MAXRATE':_0x146438['maxrate'],'XMF-MODEM':util[_0x4dc8('0xb')](_0x4dc8('0xc'),_0x146438[_0x4dc8('0xd')]),'XMF-GATEWAY':_0x146438[_0x4dc8('0xe')],'XMF-FAXDETECT':_0x146438[_0x4dc8('0xf')],'XMF-T38TIMEOUT':_0x146438[_0x4dc8('0x10')],'XMF-LOCALSTATIONID':_0x146438[_0x4dc8('0x11')],'XMF-PATH':_0x50a7ae[_0x4dc8('0x12')]};return _0x37461b;};exports['variablesAction']=function(_0x2d7dad,_0x1c2f1e){return{'actionid':_0x2d7dad[_0x4dc8('0x13')],'action':_0x4dc8('0x14'),'channel':_0x2d7dad[_0x4dc8('0x15')],'Exten':_0x4dc8('0x16'),'Context':_0x4dc8('0x17'),'Priority':'1','callerid':util[_0x4dc8('0xb')](_0x4dc8('0x18'),_0x2d7dad[_0x4dc8('0xa')]?_0x2d7dad[_0x4dc8('0xa')]:'',_0x2d7dad[_0x4dc8('0x11')]),'variable':_0x1c2f1e,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2d7dad[_0x4dc8('0x13')]};}; \ No newline at end of file +var _0x21de=['\x22%s\x22\x20<%s>','lodash','moment','fax','message','logger','info','inspect','ecm','headerinfo','maxrate','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','format'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x21de,0x1a5));var _0xe21d=function(_0x52a201,_0x2d99a7){_0x52a201=_0x52a201-0x0;var _0x3cc785=_0x21de[_0x52a201];return _0x3cc785;};'use strict';var util=require('util');var _=require(_0xe21d('0x0'));var moment=require(_0xe21d('0x1'));var logger=require('../../../../config/logger')(_0xe21d('0x2'));exports[_0xe21d('0x3')]=function(_0x64f746){return{'message':_0x64f746};};exports[_0xe21d('0x4')]=function(_0x520ec2,_0x28b263){logger[_0xe21d('0x5')](_0x520ec2,util[_0xe21d('0x6')](_0x28b263,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x59e1cc,_0x165a54){var _0x37dca3={'XMF-ECM':_0x165a54[_0xe21d('0x7')],'XMF-HEADERINFO':_0x165a54[_0xe21d('0x8')],'XMF-MINRATE':_0x165a54['minrate'],'XMF-MAXRATE':_0x165a54[_0xe21d('0x9')],'XMF-MODEM':util['format'](_0xe21d('0xa'),_0x165a54[_0xe21d('0xb')]),'XMF-GATEWAY':_0x165a54['gateway'],'XMF-FAXDETECT':_0x165a54['faxdetect'],'XMF-T38TIMEOUT':_0x165a54[_0xe21d('0xc')],'XMF-LOCALSTATIONID':_0x165a54[_0xe21d('0xd')],'XMF-PATH':_0x59e1cc[_0xe21d('0xe')]};return _0x37dca3;};exports[_0xe21d('0xf')]=function(_0x307718,_0x286cd8){return{'actionid':_0x307718[_0xe21d('0x10')],'action':_0xe21d('0x11'),'channel':_0x307718['channel'],'Exten':_0xe21d('0x12'),'Context':'from-sip','Priority':'1','callerid':util[_0xe21d('0x13')](_0xe21d('0x14'),_0x307718['headerinfo']?_0x307718[_0xe21d('0x8')]:'',_0x307718[_0xe21d('0xd')]),'variable':_0x286cd8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x307718[_0xe21d('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 269e3f5..e71dcaf 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 _0xb71a=['initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xb71a,0x16b));var _0xab71=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xb71a[_0x12ddb2];return _0x10b6dd;};'use strict';var util=require(_0xab71('0x0'));var moment=require(_0xab71('0x1'));var server=require(_0xab71('0x2'));var Realtime=require('./realtime');var Report=require(_0xab71('0x3'));var Acw=require(_0xab71('0x4'));var Trigger=require(_0xab71('0x5'));var Dialer=require(_0xab71('0x6'));var Preview=require(_0xab71('0x7'));var Fax=require(_0xab71('0x8'));var user=require(_0xab71('0x9'));var voiceQueue=require(_0xab71('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xab71('0xb'));var trunk=require(_0xab71('0xc'));var trigger=require(_0xab71('0xd'));var template=require(_0xab71('0xe'));var cmHopperHistory=require(_0xab71('0xf'));var campaign=require(_0xab71('0x10'));var voiceExtension=require(_0xab71('0x11'));var faxAccount=require(_0xab71('0x12'));var zendesk=require(_0xab71('0x13'));var salesforce=require(_0xab71('0x14'));var sugarcrm=require(_0xab71('0x15'));var freshdesk=require(_0xab71('0x16'));var desk=require(_0xab71('0x17'));var zoho=require(_0xab71('0x18'));var vtiger=require(_0xab71('0x19'));var freshsales=require(_0xab71('0x1a'));var servicenow=require(_0xab71('0x1b'));var dynamics365=require(_0xab71('0x1c'));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')(_0xab71('0x1d'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xab71('0x1e')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xab71('0x1f')]()[_0xab71('0x20')](user[_0xab71('0x21')]())[_0xab71('0x20')](realtime[_0xab71('0x22')]())[_0xab71('0x20')](user[_0xab71('0x23')]())[_0xab71('0x20')](realtime['initTelephones']())[_0xab71('0x20')](trunk['getTrunks']())[_0xab71('0x20')](realtime[_0xab71('0x24')]())[_0xab71('0x20')](voiceQueue[_0xab71('0x25')]())[_0xab71('0x20')](realtime[_0xab71('0x26')]())[_0xab71('0x20')](trigger['getTriggers']())[_0xab71('0x20')](realtime[_0xab71('0x27')]())[_0xab71('0x20')](template[_0xab71('0x28')]())[_0xab71('0x20')](realtime[_0xab71('0x29')]())[_0xab71('0x20')](zendesk['getZendeskAccounts']())[_0xab71('0x20')](realtime[_0xab71('0x2a')]())[_0xab71('0x20')](salesforce[_0xab71('0x2b')]())[_0xab71('0x20')](realtime[_0xab71('0x2c')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0xab71('0x20')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xab71('0x2d')]())['then'](realtime[_0xab71('0x2e')]())[_0xab71('0x20')](desk[_0xab71('0x2f')]())[_0xab71('0x20')](realtime['initDeskAccounts']())[_0xab71('0x20')](zoho[_0xab71('0x30')]())[_0xab71('0x20')](realtime[_0xab71('0x31')]())[_0xab71('0x20')](vtiger[_0xab71('0x32')]())['then'](realtime['initVtigerAccounts']())[_0xab71('0x20')](freshsales[_0xab71('0x33')]())[_0xab71('0x20')](realtime[_0xab71('0x34')]())[_0xab71('0x20')](servicenow[_0xab71('0x35')]())[_0xab71('0x20')](realtime['initServicenowAccounts']())[_0xab71('0x20')](dynamics365['getDynamics365Accounts']())[_0xab71('0x20')](realtime[_0xab71('0x36')]())[_0xab71('0x20')](campaign[_0xab71('0x37')]())[_0xab71('0x20')](realtime[_0xab71('0x38')]())[_0xab71('0x20')](voiceExtension['getVoiceExtensions']())['then'](realtime[_0xab71('0x39')]())[_0xab71('0x20')](faxAccount[_0xab71('0x3a')]())[_0xab71('0x20')](realtime['initFaxAccounts']())[_0xab71('0x20')](function(){return realtime;});}function initParams(){return Promise[_0xab71('0x1f')]()['then'](voiceQueueReport[_0xab71('0x3b')]())[_0xab71('0x20')](realtime[_0xab71('0x3c')]())[_0xab71('0x20')](cmHopperHistory[_0xab71('0x3d')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0xab71('0x20')](cmHopperHistory['getCampaignHopperHistory']())[_0xab71('0x20')](realtime[_0xab71('0x3e')]())[_0xab71('0x20')](voiceCallReport['getVoiceCallReports']())[_0xab71('0x20')](realtime[_0xab71('0x3f')]())[_0xab71('0x40')](function(_0x159813){logger['error'](_0xab71('0x41'),util[_0xab71('0x42')](_0x159813,{'showHidden':![],'depth':null}));});}function main(){return server[_0xab71('0x43')](realtime,preview,fax)[_0xab71('0x20')](function(){return initRealtime();})[_0xab71('0x20')](function(){return initParams();})['then'](function(){report[_0xab71('0x44')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3e3b39){logger['error'](_0xab71('0x45'),util[_0xab71('0x42')](_0x3e3b39,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x9518=['./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','error','[index.js][main]','util','moment','./server','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk'];(function(_0xd74328,_0x2160d1){var _0x5736f5=function(_0x4ca191){while(--_0x4ca191){_0xd74328['push'](_0xd74328['shift']());}};_0x5736f5(++_0x2160d1);}(_0x9518,0xce));var _0x8951=function(_0x5b93f8,_0xffefcd){_0x5b93f8=_0x5b93f8-0x0;var _0x1430ec=_0x9518[_0x5b93f8];return _0x1430ec;};'use strict';var util=require(_0x8951('0x0'));var moment=require(_0x8951('0x1'));var server=require(_0x8951('0x2'));var Realtime=require('./realtime');var Report=require(_0x8951('0x3'));var Acw=require(_0x8951('0x4'));var Trigger=require(_0x8951('0x5'));var Dialer=require(_0x8951('0x6'));var Preview=require('./preview');var Fax=require(_0x8951('0x7'));var user=require(_0x8951('0x8'));var voiceQueue=require(_0x8951('0x9'));var voiceQueueReport=require(_0x8951('0xa'));var voiceCallReport=require(_0x8951('0xb'));var trunk=require(_0x8951('0xc'));var trigger=require(_0x8951('0xd'));var template=require(_0x8951('0xe'));var cmHopperHistory=require(_0x8951('0xf'));var campaign=require(_0x8951('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x8951('0x11'));var zendesk=require(_0x8951('0x12'));var salesforce=require(_0x8951('0x13'));var sugarcrm=require(_0x8951('0x14'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x8951('0x15'));var zoho=require(_0x8951('0x16'));var vtiger=require(_0x8951('0x17'));var freshsales=require(_0x8951('0x18'));var servicenow=require(_0x8951('0x19'));var dynamics365=require(_0x8951('0x1a'));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(_0x8951('0x1b'))(_0x8951('0x1c'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8951('0x1d')](_0x8951('0x1e'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x8951('0x1e'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x8951('0x1f')]()[_0x8951('0x20')](user['getAgents']())[_0x8951('0x20')](realtime[_0x8951('0x21')]())[_0x8951('0x20')](user[_0x8951('0x22')]())[_0x8951('0x20')](realtime[_0x8951('0x23')]())[_0x8951('0x20')](trunk[_0x8951('0x24')]())[_0x8951('0x20')](realtime[_0x8951('0x25')]())[_0x8951('0x20')](voiceQueue[_0x8951('0x26')]())[_0x8951('0x20')](realtime[_0x8951('0x27')]())['then'](trigger[_0x8951('0x28')]())[_0x8951('0x20')](realtime[_0x8951('0x29')]())[_0x8951('0x20')](template['getTemplates']())[_0x8951('0x20')](realtime[_0x8951('0x2a')]())[_0x8951('0x20')](zendesk[_0x8951('0x2b')]())['then'](realtime[_0x8951('0x2c')]())[_0x8951('0x20')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x8951('0x2d')]())[_0x8951('0x20')](sugarcrm[_0x8951('0x2e')]())['then'](realtime[_0x8951('0x2f')]())['then'](freshdesk[_0x8951('0x30')]())['then'](realtime[_0x8951('0x31')]())['then'](desk['getDeskAccounts']())[_0x8951('0x20')](realtime[_0x8951('0x32')]())['then'](zoho[_0x8951('0x33')]())[_0x8951('0x20')](realtime[_0x8951('0x34')]())[_0x8951('0x20')](vtiger[_0x8951('0x35')]())['then'](realtime['initVtigerAccounts']())['then'](freshsales[_0x8951('0x36')]())[_0x8951('0x20')](realtime['initFreshsalesAccounts']())[_0x8951('0x20')](servicenow[_0x8951('0x37')]())[_0x8951('0x20')](realtime[_0x8951('0x38')]())[_0x8951('0x20')](dynamics365[_0x8951('0x39')]())[_0x8951('0x20')](realtime[_0x8951('0x3a')]())[_0x8951('0x20')](campaign[_0x8951('0x3b')]())[_0x8951('0x20')](realtime[_0x8951('0x3c')]())[_0x8951('0x20')](voiceExtension[_0x8951('0x3d')]())['then'](realtime['initVoiceExtensions']())[_0x8951('0x20')](faxAccount[_0x8951('0x3e')]())[_0x8951('0x20')](realtime[_0x8951('0x3f')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x8951('0x20')](voiceQueueReport['getVoiceQueueReports']())[_0x8951('0x20')](realtime[_0x8951('0x40')]())[_0x8951('0x20')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x8951('0x20')](realtime[_0x8951('0x41')]())[_0x8951('0x20')](cmHopperHistory[_0x8951('0x42')]())['then'](realtime[_0x8951('0x43')]())[_0x8951('0x20')](voiceCallReport[_0x8951('0x44')]())[_0x8951('0x20')](realtime['initVoiceCallReports']())[_0x8951('0x45')](function(_0x4ab67e){logger['error'](_0x8951('0x46'),util[_0x8951('0x47')](_0x4ab67e,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8951('0x48')](realtime,preview,fax)[_0x8951('0x20')](function(){return initRealtime();})['then'](function(){return initParams();})[_0x8951('0x20')](function(){report[_0x8951('0x49')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4ed8e4){logger[_0x8951('0x4a')](_0x8951('0x4b'),util[_0x8951('0x47')](_0x4ed8e4,{'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 83cd409..f915a85 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 _0x0c22=['name','fullname','state','stateTime','status','unknown','phone','interface','online','voiceStatus','onhold','local','prototype','toLowerCase','not_inuse','idle','talking','statePause','voiceStatusTime','accountcode','voiceStatusCallerIdNumber','voiceStatusQueue','stringify','format','user:%s','emit','user:ami:update','omit','exports','lodash','util','md5','../../../config/environment','redis','defaults'];(function(_0xafe951,_0x366ebd){var _0x3f287b=function(_0x77b99a){while(--_0x77b99a){_0xafe951['push'](_0xafe951['shift']());}};_0x3f287b(++_0x366ebd);}(_0x0c22,0x17b));var _0x20c2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0c22[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x20c2('0x0'));var util=require(_0x20c2('0x1'));var moment=require('moment');var md5=require(_0x20c2('0x2'));var Redis=require('ioredis');var config=require(_0x20c2('0x3'));config[_0x20c2('0x4')]=_[_0x20c2('0x5')](config[_0x20c2('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0xcd1232){this['id']=_0xcd1232['id']||0x0;this[_0x20c2('0x6')]=_0xcd1232[_0x20c2('0x6')]||'';this['email']=_0xcd1232['email']||'';this['accountcode']=_0xcd1232['accountcode']||'';this['fullname']=_0xcd1232[_0x20c2('0x7')]||'';this[_0x20c2('0x8')]='unknown';this[_0x20c2('0x9')]=0x0;this[_0x20c2('0xa')]=_0x20c2('0xb');this['address']='';this[_0x20c2('0xc')]='';this['mobile']='';this[_0x20c2('0xd')]='';this[_0x20c2('0xe')]=_0xcd1232['online']||![];this[_0x20c2('0xf')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0x20c2('0x10')]=![];this[_0x20c2('0x11')]=![];this[_0x20c2('0x2')]='';}Agent[_0x20c2('0x12')]['updateStatusRealtime']=function(_0x3bdfcb){var _0x27bb48;if(_0x3bdfcb&&_0x3bdfcb[_0x20c2('0x8')]){_0x27bb48=_0x3bdfcb[_0x20c2('0x8')][_0x20c2('0x13')]();switch(_0x27bb48){case _0x20c2('0x14'):_0x27bb48=_0x20c2('0x15');break;case'inuse':_0x27bb48=_0x20c2('0x16');break;}}if(_0x27bb48&&this[_0x20c2('0xf')]!==_0x27bb48||_0x3bdfcb[_0x20c2('0x17')]){this[_0x20c2('0x18')]=_['toNumber'](moment()['format']('x'));}if(_0x27bb48){this[_0x20c2('0xf')]=_0x27bb48;}var _0x47ece0={'id':this['id'],'name':this[_0x20c2('0x6')],'email':this['email'],'accountcode':this[_0x20c2('0x19')],'fullname':this['fullname'],'state':this[_0x20c2('0x8')],'stateTime':this[_0x20c2('0x9')],'status':this['status'],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x20c2('0xf')],'voiceStatusTime':this[_0x20c2('0x18')],'voiceStatusCallerIdNumber':this[_0x20c2('0x1a')],'voiceStatusQueue':this[_0x20c2('0x1b')],'interface':this[_0x20c2('0xd')],'onhold':this[_0x20c2('0x10')]};var _0x40f178=md5(JSON[_0x20c2('0x1c')](_0x47ece0));if(this[_0x20c2('0x2')]!==_0x40f178){this['md5']=_0x40f178;io['to'](util[_0x20c2('0x1d')](_0x20c2('0x1e'),_0x47ece0[_0x20c2('0x6')]))[_0x20c2('0x1f')](_0x20c2('0x20'),_[_0x20c2('0x21')](_0x47ece0,[_0x20c2('0xe')]));io[_0x20c2('0x1f')]('user:presence',_0x47ece0);}};module[_0x20c2('0x22')]=Agent; \ No newline at end of file +var _0x4f38=['voiceStatusQueue','onhold','local','prototype','state','toLowerCase','not_inuse','idle','statePause','format','status','stringify','user:%s','user:ami:update','emit','user:presence','exports','lodash','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','address','interface','online','voiceStatus','voiceStatusTime'];(function(_0x59d0dc,_0x446440){var _0x4cc2b7=function(_0x51aee8){while(--_0x51aee8){_0x59d0dc['push'](_0x59d0dc['shift']());}};_0x4cc2b7(++_0x446440);}(_0x4f38,0x1b5));var _0x84f3=function(_0x42970b,_0x13dcc5){_0x42970b=_0x42970b-0x0;var _0x28d314=_0x4f38[_0x42970b];return _0x28d314;};'use strict';var _=require(_0x84f3('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0x84f3('0x1'));var Redis=require(_0x84f3('0x2'));var config=require('../../../config/environment');config[_0x84f3('0x3')]=_[_0x84f3('0x4')](config[_0x84f3('0x3')],{'host':_0x84f3('0x5'),'port':0x18eb});var io=require(_0x84f3('0x6'))(new Redis(config[_0x84f3('0x3')]));function Agent(_0x452f93){this['id']=_0x452f93['id']||0x0;this[_0x84f3('0x7')]=_0x452f93[_0x84f3('0x7')]||'';this[_0x84f3('0x8')]=_0x452f93[_0x84f3('0x8')]||'';this['accountcode']=_0x452f93[_0x84f3('0x9')]||'';this[_0x84f3('0xa')]=_0x452f93[_0x84f3('0xa')]||'';this['state']=_0x84f3('0xb');this[_0x84f3('0xc')]=0x0;this['status']=_0x84f3('0xb');this[_0x84f3('0xd')]='';this['phone']='';this['mobile']='';this[_0x84f3('0xe')]='';this[_0x84f3('0xf')]=_0x452f93[_0x84f3('0xf')]||![];this[_0x84f3('0x10')]=_0x84f3('0xb');this[_0x84f3('0x11')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x84f3('0x12')]='';this[_0x84f3('0x13')]=![];this[_0x84f3('0x14')]=![];this[_0x84f3('0x1')]='';}Agent[_0x84f3('0x15')]['updateStatusRealtime']=function(_0x63d6e){var _0x15daed;if(_0x63d6e&&_0x63d6e[_0x84f3('0x16')]){_0x15daed=_0x63d6e[_0x84f3('0x16')][_0x84f3('0x17')]();switch(_0x15daed){case _0x84f3('0x18'):_0x15daed=_0x84f3('0x19');break;case'inuse':_0x15daed='talking';break;}}if(_0x15daed&&this[_0x84f3('0x10')]!==_0x15daed||_0x63d6e[_0x84f3('0x1a')]){this[_0x84f3('0x11')]=_['toNumber'](moment()[_0x84f3('0x1b')]('x'));}if(_0x15daed){this[_0x84f3('0x10')]=_0x15daed;}var _0x1a6e94={'id':this['id'],'name':this[_0x84f3('0x7')],'email':this[_0x84f3('0x8')],'accountcode':this[_0x84f3('0x9')],'fullname':this[_0x84f3('0xa')],'state':this['state'],'stateTime':this[_0x84f3('0xc')],'status':this[_0x84f3('0x1c')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x84f3('0x10')],'voiceStatusTime':this[_0x84f3('0x11')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x84f3('0x12')],'interface':this[_0x84f3('0xe')],'onhold':this[_0x84f3('0x13')]};var _0x4d2839=md5(JSON[_0x84f3('0x1d')](_0x1a6e94));if(this['md5']!==_0x4d2839){this['md5']=_0x4d2839;io['to'](util[_0x84f3('0x1b')](_0x84f3('0x1e'),_0x1a6e94['name']))['emit'](_0x84f3('0x1f'),_['omit'](_0x1a6e94,[_0x84f3('0xf')]));io[_0x84f3('0x20')](_0x84f3('0x21'),_0x1a6e94);}};module[_0x84f3('0x22')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 3584ff3..0da84d1 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 _0x463b=['dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry'];(function(_0x53816b,_0x2f9ba3){var _0x7f2259=function(_0x351304){while(--_0x351304){_0x53816b['push'](_0x53816b['shift']());}};_0x7f2259(++_0x2f9ba3);}(_0x463b,0x174));var _0xb463=function(_0x3c0808,_0x5bb24a){_0x3c0808=_0x3c0808-0x0;var _0x7c275d=_0x463b[_0x3c0808];return _0x7c275d;};'use strict';function Campaign(_0xe759cc){this['id']=_0xe759cc['id']||0x0;this['name']=_0xe759cc[_0xb463('0x0')]||'';this[_0xb463('0x1')]=_0xe759cc[_0xb463('0x1')]||_0xb463('0x2');this[_0xb463('0x3')]=0x0;this[_0xb463('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xb463('0x5')]=0x0;this[_0xb463('0x6')]='';this[_0xb463('0x7')]=!![];this['active']=_0xe759cc['active'];this['limitCalls']=_0xe759cc['limitCalls'];this['dialTimezone']=_0xe759cc[_0xb463('0x8')]||null;this[_0xb463('0x9')]=_0xe759cc[_0xb463('0x9')]?_0xe759cc[_0xb463('0x9')]:null;this[_0xb463('0xa')]=_0xe759cc[_0xb463('0xa')];this[_0xb463('0xb')]=_0xe759cc[_0xb463('0xb')];this[_0xb463('0xc')]=_0xe759cc[_0xb463('0xc')]||0x1e;this[_0xb463('0xd')]=_0xe759cc[_0xb463('0xd')];this[_0xb463('0xe')]=_0xe759cc[_0xb463('0xe')];this[_0xb463('0xf')]=_0xe759cc[_0xb463('0xf')];this[_0xb463('0x10')]=_0xe759cc[_0xb463('0x10')];this[_0xb463('0x11')]=_0xe759cc[_0xb463('0x11')];this[_0xb463('0x12')]=_0xe759cc[_0xb463('0x12')];this[_0xb463('0x13')]=_0xe759cc[_0xb463('0x13')];this[_0xb463('0x14')]=_0xe759cc[_0xb463('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xe759cc['dialNoSuchNumberRetryFrequency']||0x96;this[_0xb463('0x15')]=_0xe759cc[_0xb463('0x15')]||0x3;this[_0xb463('0x16')]=_0xe759cc[_0xb463('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0xe759cc[_0xb463('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0xe759cc[_0xb463('0x18')]||0x96;this[_0xb463('0x19')]=_0xe759cc[_0xb463('0x19')]||0x3;this[_0xb463('0x1a')]=_0xe759cc[_0xb463('0x1a')]||0x96;this[_0xb463('0x1b')]=_0xe759cc[_0xb463('0x1b')]||0x3;this[_0xb463('0x1c')]=_0xe759cc[_0xb463('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0xe759cc[_0xb463('0x1d')]||_0xb463('0x1e');this[_0xb463('0x1f')]=_0xe759cc[_0xb463('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0xe759cc[_0xb463('0x20')]||undefined;this[_0xb463('0x21')]=_0xe759cc[_0xb463('0x21')]||undefined;this['TrunkBackup']=_0xe759cc[_0xb463('0x22')]?_0xe759cc['TrunkBackup']:undefined;this['Trunk']=_0xe759cc[_0xb463('0x23')]?_0xe759cc['Trunk']:undefined;this[_0xb463('0x24')]=_0xe759cc[_0xb463('0x24')]?_0xe759cc[_0xb463('0x24')]:undefined;this[_0xb463('0x25')]=_0xe759cc['SquareProject']?_0xe759cc[_0xb463('0x25')]:undefined;this[_0xb463('0x26')]=_0xe759cc[_0xb463('0x25')]?_0xe759cc[_0xb463('0x25')]['name']:undefined;this[_0xb463('0x27')]=_0xe759cc[_0xb463('0x27')]||![];this[_0xb463('0x28')]=_0xe759cc[_0xb463('0x28')];this[_0xb463('0x29')]=_0xe759cc['dialAMDGreeting'];this[_0xb463('0x2a')]=_0xe759cc['dialAMDAfterGreetingSilence'];this[_0xb463('0x2b')]=_0xe759cc[_0xb463('0x2b')];this[_0xb463('0x2c')]=_0xe759cc[_0xb463('0x2c')];this[_0xb463('0x2d')]=_0xe759cc[_0xb463('0x2d')];this[_0xb463('0x2e')]=_0xe759cc[_0xb463('0x2e')];this[_0xb463('0x2f')]=_0xe759cc['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xe759cc[_0xb463('0x30')];}module[_0xb463('0x31')]=Campaign; \ No newline at end of file +var _0x4235=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x2bc7bc,_0x827ea){var _0xbae862=function(_0xdde795){while(--_0xdde795){_0x2bc7bc['push'](_0x2bc7bc['shift']());}};_0xbae862(++_0x827ea);}(_0x4235,0x1e1));var _0x5423=function(_0x493150,_0x107958){_0x493150=_0x493150-0x0;var _0x3fe8da=_0x4235[_0x493150];return _0x3fe8da;};'use strict';function Campaign(_0x48b76d){this['id']=_0x48b76d['id']||0x0;this[_0x5423('0x0')]=_0x48b76d[_0x5423('0x0')]||'';this['type']=_0x48b76d[_0x5423('0x1')]||_0x5423('0x2');this[_0x5423('0x3')]=0x0;this[_0x5423('0x4')]=0x0;this[_0x5423('0x5')]=0x0;this[_0x5423('0x6')]=0x0;this['message']='';this[_0x5423('0x7')]=!![];this[_0x5423('0x8')]=_0x48b76d[_0x5423('0x8')];this[_0x5423('0x9')]=_0x48b76d[_0x5423('0x9')];this['dialTimezone']=_0x48b76d[_0x5423('0xa')]||null;this[_0x5423('0xb')]=_0x48b76d[_0x5423('0xb')]?_0x48b76d[_0x5423('0xb')]:null;this[_0x5423('0xc')]=_0x48b76d[_0x5423('0xc')];this['dialOriginateCallerIdNumber']=_0x48b76d[_0x5423('0xd')];this[_0x5423('0xe')]=_0x48b76d[_0x5423('0xe')]||0x1e;this[_0x5423('0xf')]=_0x48b76d[_0x5423('0xf')];this[_0x5423('0x10')]=_0x48b76d[_0x5423('0x10')];this[_0x5423('0x11')]=_0x48b76d[_0x5423('0x11')];this[_0x5423('0x12')]=_0x48b76d[_0x5423('0x12')];this[_0x5423('0x13')]=_0x48b76d['dialNoAnswerMaxRetry'];this[_0x5423('0x14')]=_0x48b76d[_0x5423('0x14')];this[_0x5423('0x15')]=_0x48b76d[_0x5423('0x15')];this[_0x5423('0x16')]=_0x48b76d[_0x5423('0x16')]||0x3;this[_0x5423('0x17')]=_0x48b76d['dialNoSuchNumberRetryFrequency']||0x96;this[_0x5423('0x18')]=_0x48b76d[_0x5423('0x18')]||0x3;this[_0x5423('0x19')]=_0x48b76d['dialDropRetryFrequency']||0x96;this[_0x5423('0x1a')]=_0x48b76d['dialAbandonedMaxRetry']||0x3;this[_0x5423('0x1b')]=_0x48b76d[_0x5423('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x48b76d[_0x5423('0x1c')]||0x3;this[_0x5423('0x1d')]=_0x48b76d['dialMachineRetryFrequency']||0x96;this[_0x5423('0x1e')]=_0x48b76d[_0x5423('0x1e')]||0x3;this[_0x5423('0x1f')]=_0x48b76d[_0x5423('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x48b76d['dialOrderByScheduledAt']||'DESC';this[_0x5423('0x20')]=_0x48b76d[_0x5423('0x20')]||undefined;this[_0x5423('0x21')]=_0x48b76d[_0x5423('0x21')]||undefined;this[_0x5423('0x22')]=_0x48b76d[_0x5423('0x22')]||undefined;this[_0x5423('0x23')]=_0x48b76d[_0x5423('0x23')]?_0x48b76d[_0x5423('0x23')]:undefined;this['Trunk']=_0x48b76d[_0x5423('0x24')]?_0x48b76d[_0x5423('0x24')]:undefined;this[_0x5423('0x25')]=_0x48b76d['Interval']?_0x48b76d[_0x5423('0x25')]:undefined;this['SquareProject']=_0x48b76d[_0x5423('0x26')]?_0x48b76d[_0x5423('0x26')]:undefined;this[_0x5423('0x27')]=_0x48b76d['SquareProject']?_0x48b76d['SquareProject'][_0x5423('0x0')]:undefined;this['dialAMDActive']=_0x48b76d['dialAMDActive']||![];this[_0x5423('0x28')]=_0x48b76d['dialAMDInitialSilence'];this[_0x5423('0x29')]=_0x48b76d[_0x5423('0x29')];this[_0x5423('0x2a')]=_0x48b76d['dialAMDAfterGreetingSilence'];this[_0x5423('0x2b')]=_0x48b76d[_0x5423('0x2b')];this[_0x5423('0x2c')]=_0x48b76d[_0x5423('0x2c')];this['dialAMDBetweenWordsSilence']=_0x48b76d[_0x5423('0x2d')];this['dialAMDMaximumNumberOfWords']=_0x48b76d[_0x5423('0x2e')];this[_0x5423('0x2f')]=_0x48b76d[_0x5423('0x2f')];this[_0x5423('0x30')]=_0x48b76d['dialAMDMaximumWordLength'];}module[_0x5423('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 3423ee5..f6a7127 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 _0x5ec3=['tag','disposition','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','holdtime'];(function(_0x259264,_0xfe2f1f){var _0x333ff4=function(_0x366e5c){while(--_0x366e5c){_0x259264['push'](_0x259264['shift']());}};_0x333ff4(++_0xfe2f1f);}(_0x5ec3,0xf2));var _0x35ec=function(_0x347239,_0x1f0fc0){_0x347239=_0x347239-0x0;var _0x4bda66=_0x5ec3[_0x347239];return _0x4bda66;};'use strict';function Channel(){this[_0x35ec('0x0')]=null;this['channel']='';this[_0x35ec('0x1')]='';this[_0x35ec('0x2')]=0x0;this['calleridname']='';this[_0x35ec('0x3')]=undefined;this[_0x35ec('0x4')]=undefined;this['accountcode']=0x0;this[_0x35ec('0x5')]='';this[_0x35ec('0x6')]=0x0;this[_0x35ec('0x7')]=0x0;this[_0x35ec('0x8')]=0x0;this[_0x35ec('0x9')]=![];this[_0x35ec('0xa')]=null;this[_0x35ec('0xb')]=null;this[_0x35ec('0xc')]=![];this[_0x35ec('0xd')]=![];this['lastapplication']='';this[_0x35ec('0xe')]='';this[_0x35ec('0xf')]=0x0;this[_0x35ec('0x10')]=0x0;this[_0x35ec('0x11')]=0x0;this['type']=null;this[_0x35ec('0x12')]=null;this[_0x35ec('0x13')]=null;this['monitor']=![];this[_0x35ec('0x14')]=null;this[_0x35ec('0x15')]=null;this[_0x35ec('0x16')]=[];this[_0x35ec('0x17')]=undefined;this[_0x35ec('0x18')]=undefined;this['transferType']=undefined;this[_0x35ec('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x3609=['calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','endtime','unmanaged','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','disposition','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x11b19b,_0x213234){var _0x1daac1=function(_0x516d3b){while(--_0x516d3b){_0x11b19b['push'](_0x11b19b['shift']());}};_0x1daac1(++_0x213234);}(_0x3609,0x101));var _0x9360=function(_0x597fc0,_0x13a02a){_0x597fc0=_0x597fc0-0x0;var _0x4e6708=_0x3609[_0x597fc0];return _0x4e6708;};'use strict';function Channel(){this[_0x9360('0x0')]=null;this[_0x9360('0x1')]='';this[_0x9360('0x2')]='';this[_0x9360('0x3')]=0x0;this[_0x9360('0x4')]='';this[_0x9360('0x5')]=undefined;this[_0x9360('0x6')]=undefined;this['accountcode']=0x0;this[_0x9360('0x7')]='';this[_0x9360('0x8')]=0x0;this[_0x9360('0x9')]=0x0;this['exten']=0x0;this['answered']=![];this['answertime']=null;this[_0x9360('0xa')]=null;this[_0x9360('0xb')]=![];this['abandoned']=![];this[_0x9360('0xc')]='';this[_0x9360('0xd')]='';this[_0x9360('0xe')]=0x0;this[_0x9360('0xf')]=0x0;this[_0x9360('0x10')]=0x0;this[_0x9360('0x11')]=null;this[_0x9360('0x12')]=null;this[_0x9360('0x13')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x9360('0x14')]=null;this[_0x9360('0x15')]=[];this[_0x9360('0x16')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x9360('0x17')]=undefined;this[_0x9360('0x18')]=0x0;}module[_0x9360('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 973e318..17df6b5 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 _0x7245=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x2b0b1e,_0x114202){var _0x57ed7a=function(_0x409caa){while(--_0x409caa){_0x2b0b1e['push'](_0x2b0b1e['shift']());}};_0x57ed7a(++_0x114202);}(_0x7245,0x153));var _0x5724=function(_0x2a7127,_0x2beef0){_0x2a7127=_0x2a7127-0x0;var _0x5658d3=_0x7245[_0x2a7127];return _0x5658d3;};'use strict';function DeskAccount(_0x4d76b0){this['id']=_0x4d76b0['id']||0x0;this[_0x5724('0x0')]=_0x4d76b0[_0x5724('0x0')]||'';this[_0x5724('0x1')]=_0x4d76b0[_0x5724('0x1')]||'';this[_0x5724('0x2')]=_0x4d76b0[_0x5724('0x2')]||'';this[_0x5724('0x3')]=_0x4d76b0['authType']||'';this[_0x5724('0x4')]=_0x4d76b0[_0x5724('0x4')]||'';this[_0x5724('0x5')]=_0x4d76b0[_0x5724('0x5')]||'';this['consumerSecret']=_0x4d76b0[_0x5724('0x6')]||'';this[_0x5724('0x7')]=_0x4d76b0[_0x5724('0x7')]||'';this[_0x5724('0x8')]=_0x4d76b0[_0x5724('0x8')]||'';this[_0x5724('0x9')]=_0x4d76b0['type']||'';this[_0x5724('0xa')]=_0x4d76b0[_0x5724('0xa')]||'';this[_0x5724('0xb')]=_0x4d76b0['Configurations']||{};}module[_0x5724('0xc')]=DeskAccount; \ No newline at end of file +var _0x57ca=['tokenSecret','type','serverUrl','Configurations','name','username','authType','password','consumerKey','consumerSecret'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x57ca,0x1bc));var _0xa57c=function(_0x29eb89,_0x320a1f){_0x29eb89=_0x29eb89-0x0;var _0x1a2e9b=_0x57ca[_0x29eb89];return _0x1a2e9b;};'use strict';function DeskAccount(_0x1158e6){this['id']=_0x1158e6['id']||0x0;this[_0xa57c('0x0')]=_0x1158e6['name']||'';this['username']=_0x1158e6[_0xa57c('0x1')]||'';this['remoteUri']=_0x1158e6['remoteUri']||'';this[_0xa57c('0x2')]=_0x1158e6[_0xa57c('0x2')]||'';this[_0xa57c('0x3')]=_0x1158e6[_0xa57c('0x3')]||'';this['consumerKey']=_0x1158e6[_0xa57c('0x4')]||'';this[_0xa57c('0x5')]=_0x1158e6[_0xa57c('0x5')]||'';this['token']=_0x1158e6['token']||'';this[_0xa57c('0x6')]=_0x1158e6[_0xa57c('0x6')]||'';this[_0xa57c('0x7')]=_0x1158e6[_0xa57c('0x7')]||'';this[_0xa57c('0x8')]=_0x1158e6[_0xa57c('0x8')]||'';this[_0xa57c('0x9')]=_0x1158e6[_0xa57c('0x9')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 4c92027..6b543f9 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 _0x44e2=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x269616,_0x43b8be){var _0x13b25d=function(_0x24b783){while(--_0x24b783){_0x269616['push'](_0x269616['shift']());}};_0x13b25d(++_0x43b8be);}(_0x44e2,0xb0));var _0x244e=function(_0x455b18,_0x414a4e){_0x455b18=_0x455b18-0x0;var _0x367314=_0x44e2[_0x455b18];return _0x367314;};'use strict';function Dynamics365Account(_0x419a65){this['id']=_0x419a65['id']||0x0;this[_0x244e('0x0')]=_0x419a65[_0x244e('0x0')]||'';this[_0x244e('0x1')]=_0x419a65['username']||'';this[_0x244e('0x2')]=_0x419a65[_0x244e('0x2')]||'';this[_0x244e('0x3')]=_0x419a65[_0x244e('0x3')]||'';this[_0x244e('0x4')]=_0x419a65[_0x244e('0x4')]||'';this[_0x244e('0x5')]=_0x419a65[_0x244e('0x5')]||'';this[_0x244e('0x6')]=_0x419a65[_0x244e('0x6')]||{};this[_0x244e('0x7')]=_0x419a65['serverUrl']||'';this[_0x244e('0x8')]=_0x419a65[_0x244e('0x8')]||![];this[_0x244e('0x9')]=_0x419a65[_0x244e('0x9')]||{};this[_0x244e('0xa')]=_0x419a65['CloudProvider']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0xa9c8=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','CloudProvider','exports','name','username'];(function(_0x30e64e,_0x11d579){var _0x44cda2=function(_0x379d68){while(--_0x379d68){_0x30e64e['push'](_0x30e64e['shift']());}};_0x44cda2(++_0x11d579);}(_0xa9c8,0x18a));var _0x8a9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa9c8[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x1f73b4){this['id']=_0x1f73b4['id']||0x0;this[_0x8a9c('0x0')]=_0x1f73b4['name']||'';this[_0x8a9c('0x1')]=_0x1f73b4['username']||'';this[_0x8a9c('0x2')]=_0x1f73b4[_0x8a9c('0x2')]||'';this[_0x8a9c('0x3')]=_0x1f73b4[_0x8a9c('0x3')]||'';this[_0x8a9c('0x4')]=_0x1f73b4[_0x8a9c('0x4')]||'';this[_0x8a9c('0x5')]=_0x1f73b4[_0x8a9c('0x5')]||'';this[_0x8a9c('0x6')]=_0x1f73b4['clientSecret']||{};this[_0x8a9c('0x7')]=_0x1f73b4[_0x8a9c('0x7')]||'';this[_0x8a9c('0x8')]=_0x1f73b4[_0x8a9c('0x8')]||![];this['Configurations']=_0x1f73b4['Configurations']||{};this[_0x8a9c('0x9')]=_0x1f73b4[_0x8a9c('0x9')]||{};}module[_0x8a9c('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 a64dc9c..ca8651a 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 _0x4aef=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','v17,v27,v29','gateway','faxdetect'];(function(_0x2de9d0,_0x17bfc9){var _0x205b66=function(_0x58899b){while(--_0x58899b){_0x2de9d0['push'](_0x2de9d0['shift']());}};_0x205b66(++_0x17bfc9);}(_0x4aef,0x197));var _0xf4ae=function(_0x34d2a0,_0x6cde4f){_0x34d2a0=_0x34d2a0-0x0;var _0x505c5b=_0x4aef[_0x34d2a0];return _0x505c5b;};'use strict';function FaxAccount(_0x48cb5a){this['id']=_0x48cb5a['id']||0x0;this[_0xf4ae('0x0')]=_0x48cb5a[_0xf4ae('0x0')]||'';this[_0xf4ae('0x1')]=_0x48cb5a['description'];this[_0xf4ae('0x2')]=_0x48cb5a['ecm'];this[_0xf4ae('0x3')]=_0x48cb5a['headerinfo'];this[_0xf4ae('0x4')]=_0x48cb5a[_0xf4ae('0x4')];this[_0xf4ae('0x5')]=_0x48cb5a[_0xf4ae('0x5')]||0x960;this['maxrate']=_0x48cb5a['maxrate']||0x3840;this['modem']=_0x48cb5a['modem']||_0xf4ae('0x6');this[_0xf4ae('0x7')]=_0x48cb5a['gateway']||'no';this[_0xf4ae('0x8')]=_0x48cb5a[_0xf4ae('0x8')]||'no';this[_0xf4ae('0x9')]=_0x48cb5a[_0xf4ae('0x9')]||0x1388;this[_0xf4ae('0xa')]=_0x48cb5a[_0xf4ae('0xa')]||_0xf4ae('0xb');this[_0xf4ae('0xc')]=_0x48cb5a[_0xf4ae('0xc')]?_0x48cb5a[_0xf4ae('0xc')]:undefined;this['ListId']=_0x48cb5a[_0xf4ae('0xd')];this[_0xf4ae('0xe')]=_0x48cb5a[_0xf4ae('0xe')];}module[_0xf4ae('0xf')]=FaxAccount; \ No newline at end of file +var _0x815a=['ecm','headerinfo','localstationid','minrate','modem','gateway','t38timeout','tech','SIP','Trunk','ListId','key','name','description'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x815a,0x186));var _0xa815=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x815a[_0x52e363];return _0x3fc2b5;};'use strict';function FaxAccount(_0x594c7a){this['id']=_0x594c7a['id']||0x0;this[_0xa815('0x0')]=_0x594c7a[_0xa815('0x0')]||'';this['description']=_0x594c7a[_0xa815('0x1')];this['ecm']=_0x594c7a[_0xa815('0x2')];this[_0xa815('0x3')]=_0x594c7a['headerinfo'];this['localstationid']=_0x594c7a[_0xa815('0x4')];this['minrate']=_0x594c7a[_0xa815('0x5')]||0x960;this['maxrate']=_0x594c7a['maxrate']||0x3840;this[_0xa815('0x6')]=_0x594c7a[_0xa815('0x6')]||'v17,v27,v29';this[_0xa815('0x7')]=_0x594c7a[_0xa815('0x7')]||'no';this['faxdetect']=_0x594c7a['faxdetect']||'no';this['t38timeout']=_0x594c7a[_0xa815('0x8')]||0x1388;this[_0xa815('0x9')]=_0x594c7a[_0xa815('0x9')]||_0xa815('0xa');this['Trunk']=_0x594c7a[_0xa815('0xb')]?_0x594c7a['Trunk']:undefined;this['ListId']=_0x594c7a[_0xa815('0xc')];this[_0xa815('0xd')]=_0x594c7a[_0xa815('0xd')];}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 5764907..97a20e1 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 _0x4255=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3f534d,_0xa53214){var _0x32182e=function(_0x33379a){while(--_0x33379a){_0x3f534d['push'](_0x3f534d['shift']());}};_0x32182e(++_0xa53214);}(_0x4255,0x11e));var _0x5425=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4255[_0x5d2803];return _0xdcad2c;};'use strict';function FreshdeskAccount(_0x5ada60){this['id']=_0x5ada60['id']||0x0;this[_0x5425('0x0')]=_0x5ada60[_0x5425('0x0')]||'';this[_0x5425('0x1')]=_0x5ada60[_0x5425('0x1')]||'';this[_0x5425('0x2')]=_0x5ada60['token']||'';this['remoteUri']=_0x5ada60[_0x5425('0x3')]||'';this['serverUrl']=_0x5ada60[_0x5425('0x4')]||'';this[_0x5425('0x5')]=_0x5ada60['Configurations']||{};}module[_0x5425('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x6e07=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x45e534,_0x3ab027){var _0xb19184=function(_0x4f63dd){while(--_0x4f63dd){_0x45e534['push'](_0x45e534['shift']());}};_0xb19184(++_0x3ab027);}(_0x6e07,0x147));var _0x76e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e07[_0x14add3];return _0x4a174f;};'use strict';function FreshdeskAccount(_0x2aea6c){this['id']=_0x2aea6c['id']||0x0;this[_0x76e0('0x0')]=_0x2aea6c[_0x76e0('0x0')]||'';this[_0x76e0('0x1')]=_0x2aea6c[_0x76e0('0x1')]||'';this[_0x76e0('0x2')]=_0x2aea6c[_0x76e0('0x3')]||'';this[_0x76e0('0x4')]=_0x2aea6c[_0x76e0('0x4')]||'';this[_0x76e0('0x5')]=_0x2aea6c['serverUrl']||'';this[_0x76e0('0x6')]=_0x2aea6c['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index d789e1d..546f9d7 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 _0xd5b2=['token','remoteUri','serverUrl','exports','name','username','apiKey'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0xd5b2,0x10e));var _0x2d5b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xd5b2[_0x24237f];return _0x48298e;};'use strict';function FreshsalesAccount(_0x3d9fde){this['id']=_0x3d9fde['id']||0x0;this[_0x2d5b('0x0')]=_0x3d9fde[_0x2d5b('0x0')]||'';this['username']=_0x3d9fde[_0x2d5b('0x1')]||'';this[_0x2d5b('0x2')]=_0x3d9fde[_0x2d5b('0x3')]||'';this[_0x2d5b('0x4')]=_0x3d9fde[_0x2d5b('0x4')]||'';this[_0x2d5b('0x5')]=_0x3d9fde['serverUrl']||'';this['Configurations']=_0x3d9fde['Configurations']||{};}module[_0x2d5b('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x13f5=['username','apiKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x318516,_0x53293e){var _0x30d47f=function(_0x4d0591){while(--_0x4d0591){_0x318516['push'](_0x318516['shift']());}};_0x30d47f(++_0x53293e);}(_0x13f5,0xc3));var _0x513f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x13f5[_0x4a9fb1];return _0x348672;};'use strict';function FreshsalesAccount(_0x4edd23){this['id']=_0x4edd23['id']||0x0;this[_0x513f('0x0')]=_0x4edd23[_0x513f('0x0')]||'';this[_0x513f('0x1')]=_0x4edd23['username']||'';this[_0x513f('0x2')]=_0x4edd23['token']||'';this['remoteUri']=_0x4edd23[_0x513f('0x3')]||'';this[_0x513f('0x4')]=_0x4edd23[_0x513f('0x4')]||'';this[_0x513f('0x5')]=_0x4edd23[_0x513f('0x5')]||{};}module[_0x513f('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 66e8d52..d8deef4 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 _0x6c6d=['holdtime','assigned','motionChannel','voice','routealias','mohtime','exports','type','inbound','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','priority'];(function(_0xbdea63,_0x3a313e){var _0x454901=function(_0x3ce860){while(--_0x3ce860){_0xbdea63['push'](_0xbdea63['shift']());}};_0x454901(++_0x3a313e);}(_0x6c6d,0x89));var _0xd6c6=function(_0x3bf7d0,_0x2f0c82){_0x3bf7d0=_0x3bf7d0-0x0;var _0x9daf20=_0x6c6d[_0x3bf7d0];return _0x9daf20;};'use strict';function QueueReport(){this[_0xd6c6('0x0')]=_0xd6c6('0x1');this['uniqueid']='';this[_0xd6c6('0x2')]='';this[_0xd6c6('0x3')]='';this['queue']='';this[_0xd6c6('0x4')]=null;this[_0xd6c6('0x5')]=null;this[_0xd6c6('0x6')]=0x1;this['count']=0x1;this[_0xd6c6('0x7')]=![];this[_0xd6c6('0x8')]=null;this[_0xd6c6('0x9')]=![];this[_0xd6c6('0xa')]=null;this[_0xd6c6('0xb')]=![];this['queuecallerexitAt']=null;this[_0xd6c6('0xc')]=0x1;this[_0xd6c6('0xd')]='';this[_0xd6c6('0xe')]='';this[_0xd6c6('0xf')]='';this[_0xd6c6('0x10')]='';this[_0xd6c6('0x11')]='';this['exten']='';this[_0xd6c6('0x12')]='';this[_0xd6c6('0x13')]=0x0;this[_0xd6c6('0x14')]=![];this['lastAssignedTo']='';this[_0xd6c6('0x15')]=_0xd6c6('0x16');this[_0xd6c6('0x17')]=null;this[_0xd6c6('0x18')]=0x0;this['variables']={};}module[_0xd6c6('0x19')]=QueueReport; \ No newline at end of file +var _0x1a49=['accountcode','exten','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename'];(function(_0x3c3c4f,_0x9d637){var _0x3fdf49=function(_0x4727cf){while(--_0x4727cf){_0x3c3c4f['push'](_0x3c3c4f['shift']());}};_0x3fdf49(++_0x9d637);}(_0x1a49,0x124));var _0x91a4=function(_0x4f63c0,_0x399094){_0x4f63c0=_0x4f63c0-0x0;var _0x33f921=_0x1a49[_0x4f63c0];return _0x33f921;};'use strict';function QueueReport(){this[_0x91a4('0x0')]=_0x91a4('0x1');this[_0x91a4('0x2')]='';this[_0x91a4('0x3')]='';this[_0x91a4('0x4')]='';this[_0x91a4('0x5')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0x91a4('0x6')]=0x1;this[_0x91a4('0x7')]=0x1;this[_0x91a4('0x8')]=![];this['queuecallerabandonAt']=null;this[_0x91a4('0x9')]=![];this[_0x91a4('0xa')]=null;this['queuecallerexit']=![];this[_0x91a4('0xb')]=null;this[_0x91a4('0xc')]=0x1;this[_0x91a4('0xd')]='';this[_0x91a4('0xe')]='';this[_0x91a4('0xf')]='';this[_0x91a4('0x10')]='';this['context']='';this[_0x91a4('0x11')]='';this['priority']='';this['holdtime']=0x0;this['assigned']=![];this[_0x91a4('0x12')]='';this['motionChannel']='voice';this['routealias']=null;this[_0x91a4('0x13')]=0x0;this[_0x91a4('0x14')]={};}module[_0x91a4('0x15')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index fdaf9ab..46b9f30 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 _0xd9db=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x187842,_0x58331c){var _0x5dbcf3=function(_0x55faef){while(--_0x55faef){_0x187842['push'](_0x187842['shift']());}};_0x5dbcf3(++_0x58331c);}(_0xd9db,0x8a));var _0xbd9d=function(_0x3b99d8,_0x26f20b){_0x3b99d8=_0x3b99d8-0x0;var _0x46e759=_0xd9db[_0x3b99d8];return _0x46e759;};'use strict';function SalesforceAccount(_0x286478){this['id']=_0x286478['id']||0x0;this[_0xbd9d('0x0')]=_0x286478['name']||'';this[_0xbd9d('0x1')]=_0x286478[_0xbd9d('0x1')]||'';this[_0xbd9d('0x2')]=_0x286478[_0xbd9d('0x2')]||'';this[_0xbd9d('0x3')]=_0x286478[_0xbd9d('0x3')]||'';this[_0xbd9d('0x4')]=_0x286478[_0xbd9d('0x4')]||'';this[_0xbd9d('0x5')]=_0x286478[_0xbd9d('0x5')]||'';this[_0xbd9d('0x6')]=_0x286478['securityToken']||'';this['type']=_0x286478[_0xbd9d('0x7')]||_0xbd9d('0x8');this[_0xbd9d('0x9')]=_0x286478['serverUrl']||'';this[_0xbd9d('0xa')]=_0x286478[_0xbd9d('0xa')]||{};}module[_0xbd9d('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x2e2c=['name','username','remoteUri','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x1be027,_0x44ba89){var _0x2583a0=function(_0x2178aa){while(--_0x2178aa){_0x1be027['push'](_0x1be027['shift']());}};_0x2583a0(++_0x44ba89);}(_0x2e2c,0x160));var _0xc2e2=function(_0x3b5bca,_0x326805){_0x3b5bca=_0x3b5bca-0x0;var _0x39833=_0x2e2c[_0x3b5bca];return _0x39833;};'use strict';function SalesforceAccount(_0x1a1aaf){this['id']=_0x1a1aaf['id']||0x0;this[_0xc2e2('0x0')]=_0x1a1aaf[_0xc2e2('0x0')]||'';this[_0xc2e2('0x1')]=_0x1a1aaf[_0xc2e2('0x1')]||'';this[_0xc2e2('0x2')]=_0x1a1aaf[_0xc2e2('0x2')]||'';this['password']=_0x1a1aaf['password']||'';this['clientId']=_0x1a1aaf[_0xc2e2('0x3')]||'';this[_0xc2e2('0x4')]=_0x1a1aaf[_0xc2e2('0x4')]||'';this[_0xc2e2('0x5')]=_0x1a1aaf[_0xc2e2('0x5')]||'';this[_0xc2e2('0x6')]=_0x1a1aaf['type']||_0xc2e2('0x7');this['serverUrl']=_0x1a1aaf[_0xc2e2('0x8')]||'';this[_0xc2e2('0x9')]=_0x1a1aaf['Configurations']||{};}module[_0xc2e2('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 5da0618..281f766 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 _0x3597=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x554b32,_0x577efd){var _0x2d896d=function(_0x2f4a14){while(--_0x2f4a14){_0x554b32['push'](_0x554b32['shift']());}};_0x2d896d(++_0x577efd);}(_0x3597,0x156));var _0x7359=function(_0x1d3530,_0x59ae97){_0x1d3530=_0x1d3530-0x0;var _0x13868c=_0x3597[_0x1d3530];return _0x13868c;};'use strict';function ServicenowAccount(_0x53fffd){this['id']=_0x53fffd['id']||0x0;this['name']=_0x53fffd[_0x7359('0x0')]||'';this[_0x7359('0x1')]=_0x53fffd[_0x7359('0x1')]||'';this['password']=_0x53fffd['password']||'';this[_0x7359('0x2')]=_0x53fffd[_0x7359('0x2')]||'';this['serverUrl']=_0x53fffd[_0x7359('0x3')]||'';this[_0x7359('0x4')]=_0x53fffd['Configurations']||{};}module[_0x7359('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x54b6=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x349632,_0x55bd98){var _0x30c7b2=function(_0x51152a){while(--_0x51152a){_0x349632['push'](_0x349632['shift']());}};_0x30c7b2(++_0x55bd98);}(_0x54b6,0x19a));var _0x654b=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x54b6[_0x50aa2e];return _0x5e07f0;};'use strict';function ServicenowAccount(_0x3d2eeb){this['id']=_0x3d2eeb['id']||0x0;this[_0x654b('0x0')]=_0x3d2eeb[_0x654b('0x0')]||'';this[_0x654b('0x1')]=_0x3d2eeb['username']||'';this[_0x654b('0x2')]=_0x3d2eeb[_0x654b('0x2')]||'';this[_0x654b('0x3')]=_0x3d2eeb['remoteUri']||'';this[_0x654b('0x4')]=_0x3d2eeb[_0x654b('0x4')]||'';this[_0x654b('0x5')]=_0x3d2eeb[_0x654b('0x5')]||{};}module[_0x654b('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 1c28bed..a90413d 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 _0x36f3=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x36f3,0x19c));var _0x336f=function(_0x103bbf,_0x22a36a){_0x103bbf=_0x103bbf-0x0;var _0x25be40=_0x36f3[_0x103bbf];return _0x25be40;};'use strict';function SugarcrmAccount(_0x126b05){this['id']=_0x126b05['id']||0x0;this[_0x336f('0x0')]=_0x126b05[_0x336f('0x0')]||'';this[_0x336f('0x1')]=_0x126b05['username']||'';this[_0x336f('0x2')]=_0x126b05[_0x336f('0x2')]||'';this[_0x336f('0x3')]=_0x126b05[_0x336f('0x3')]||'';this[_0x336f('0x4')]=_0x126b05[_0x336f('0x4')]||'';this[_0x336f('0x5')]=_0x126b05[_0x336f('0x5')]||{};}module[_0x336f('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xa176=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x5eca0a,_0x27ad17){var _0x35241f=function(_0x5630f6){while(--_0x5630f6){_0x5eca0a['push'](_0x5eca0a['shift']());}};_0x35241f(++_0x27ad17);}(_0xa176,0xaa));var _0x6a17=function(_0x26900c,_0x4f888e){_0x26900c=_0x26900c-0x0;var _0x3c941c=_0xa176[_0x26900c];return _0x3c941c;};'use strict';function SugarcrmAccount(_0x55b6e2){this['id']=_0x55b6e2['id']||0x0;this[_0x6a17('0x0')]=_0x55b6e2['name']||'';this[_0x6a17('0x1')]=_0x55b6e2[_0x6a17('0x1')]||'';this['password']=_0x55b6e2[_0x6a17('0x2')]||'';this[_0x6a17('0x3')]=_0x55b6e2[_0x6a17('0x3')]||'';this[_0x6a17('0x4')]=_0x55b6e2['serverUrl']||'';this[_0x6a17('0x5')]=_0x55b6e2[_0x6a17('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 771701e..6db5723 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 _0x2ec8=['state','unknown','stateTime','status','address','exports','name','accountcode'];(function(_0x4b3680,_0x4026b6){var _0x14ec1b=function(_0x58082e){while(--_0x58082e){_0x4b3680['push'](_0x4b3680['shift']());}};_0x14ec1b(++_0x4026b6);}(_0x2ec8,0x6e));var _0x82ec=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2ec8[_0x5ddb1c];return _0x354adc;};'use strict';function Telephone(_0x34bf81){this['id']=_0x34bf81['id']||0x0;this[_0x82ec('0x0')]=_0x34bf81['name']||'';this['accountcode']=_0x34bf81[_0x82ec('0x1')]||'';this[_0x82ec('0x2')]=_0x82ec('0x3');this[_0x82ec('0x4')]=0x0;this[_0x82ec('0x5')]=_0x82ec('0x3');this[_0x82ec('0x6')]='';}module[_0x82ec('0x7')]=Telephone; \ No newline at end of file +var _0x65ef=['unknown','stateTime','status','address','exports','name','accountcode','state'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0x65ef,0x7d));var _0xf65e=function(_0x11753a,_0x2d1b0e){_0x11753a=_0x11753a-0x0;var _0x3d9a3d=_0x65ef[_0x11753a];return _0x3d9a3d;};'use strict';function Telephone(_0x436158){this['id']=_0x436158['id']||0x0;this[_0xf65e('0x0')]=_0x436158[_0xf65e('0x0')]||'';this[_0xf65e('0x1')]=_0x436158[_0xf65e('0x1')]||'';this[_0xf65e('0x2')]=_0xf65e('0x3');this[_0xf65e('0x4')]=0x0;this[_0xf65e('0x5')]='unknown';this[_0xf65e('0x6')]='';}module[_0xf65e('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 319218a..c61e793 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 _0xb10b=['name','html'];(function(_0x11fd53,_0x38cdb7){var _0x35050a=function(_0x37cf24){while(--_0x37cf24){_0x11fd53['push'](_0x11fd53['shift']());}};_0x35050a(++_0x38cdb7);}(_0xb10b,0x12a));var _0xbb10=function(_0x208b7a,_0x2e3baa){_0x208b7a=_0x208b7a-0x0;var _0x37b7ec=_0xb10b[_0x208b7a];return _0x37b7ec;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x329c92,_0x45d46c){var _0x130c5d=function(_0x1d388d){while(--_0x1d388d){_0x329c92['push'](_0x329c92['shift']());}};_0x130c5d(++_0x45d46c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 836def0..b842272 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 _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x163419,_0x37db68){var _0x1404cf=function(_0x40da17){while(--_0x40da17){_0x163419['push'](_0x163419['shift']());}};_0x1404cf(++_0x37db68);}(_0xda3f,0xec));var _0xfda3=function(_0x3cd400,_0x2a7fc8){_0x3cd400=_0x3cd400-0x0;var _0x5cd65d=_0xda3f[_0x3cd400];return _0x5cd65d;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x3d8cfd,_0x1c7494){var _0x2b92d8=function(_0x421160){while(--_0x421160){_0x3d8cfd['push'](_0x3d8cfd['shift']());}};_0x2b92d8(++_0x1c7494);}(_0xda2d,0x102));var _0xdda2=function(_0x1dc8f1,_0x395884){_0x1dc8f1=_0x1dc8f1-0x0;var _0x4d4504=_0xda2d[_0x1dc8f1];return _0x4d4504;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('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 7b2e85c..4aaa078 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 _0x54e7=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport'];(function(_0x1cef5c,_0x403f3d){var _0x4c4b5e=function(_0xbb6a79){while(--_0xbb6a79){_0x1cef5c['push'](_0x1cef5c['shift']());}};_0x4c4b5e(++_0x403f3d);}(_0x54e7,0x72));var _0x754e=function(_0x44ea7d,_0xe6516){_0x44ea7d=_0x44ea7d-0x0;var _0x16af83=_0x54e7[_0x44ea7d];return _0x16af83;};'use strict';function Trunk(_0x3253db){this['id']=_0x3253db['id']||0x0;this['active']=_0x3253db[_0x754e('0x0')]||![];this[_0x754e('0x1')]=_0x3253db[_0x754e('0x1')]||'';this['state']=_0x754e('0x2');this[_0x754e('0x3')]=0x0;this[_0x754e('0x4')]=_0x754e('0x2');this[_0x754e('0x5')]=_0x3253db[_0x754e('0x5')]&&_0x3253db[_0x754e('0x5')][_0x754e('0x6')](':')?_0x3253db[_0x754e('0x5')][_0x754e('0x7')](':')[0x0]:'';this[_0x754e('0x8')]='';this[_0x754e('0x9')]='';this[_0x754e('0xa')]='';this[_0x754e('0xb')]='';this[_0x754e('0xc')]='';this[_0x754e('0xd')]=_0x754e('0x2');this[_0x754e('0xe')]='';this[_0x754e('0xf')]='';this[_0x754e('0x10')]=_0x3253db[_0x754e('0x10')]||'';}module[_0x754e('0x11')]=Trunk; \ No newline at end of file +var _0xd9af=['stateTime','status','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','defaultuser','exports','name','state','unknown'];(function(_0x4fe681,_0x394488){var _0x17d65e=function(_0xd2e383){while(--_0xd2e383){_0x4fe681['push'](_0x4fe681['shift']());}};_0x17d65e(++_0x394488);}(_0xd9af,0x9d));var _0xfd9a=function(_0x36f47b,_0x94a76d){_0x36f47b=_0x36f47b-0x0;var _0x4c72bb=_0xd9af[_0x36f47b];return _0x4c72bb;};'use strict';function Trunk(_0x1ebddf){this['id']=_0x1ebddf['id']||0x0;this['active']=_0x1ebddf['active']||![];this[_0xfd9a('0x0')]=_0x1ebddf[_0xfd9a('0x0')]||'';this[_0xfd9a('0x1')]=_0xfd9a('0x2');this[_0xfd9a('0x3')]=0x0;this[_0xfd9a('0x4')]='unknown';this['registry']=_0x1ebddf[_0xfd9a('0x5')]&&_0x1ebddf[_0xfd9a('0x5')][_0xfd9a('0x6')](':')?_0x1ebddf['registry'][_0xfd9a('0x7')](':')[0x0]:'';this[_0xfd9a('0x8')]='';this[_0xfd9a('0x9')]='';this[_0xfd9a('0xa')]='';this[_0xfd9a('0xb')]='';this[_0xfd9a('0xc')]='';this[_0xfd9a('0xd')]=_0xfd9a('0x2');this['registrationtime']='';this['address']='';this['defaultuser']=_0x1ebddf[_0xfd9a('0xe')]||'';}module[_0xfd9a('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 8f5552f..1a78e4c 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 _0x218c=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x8d6ed2,_0x574627){var _0x1edb62=function(_0x55e22f){while(--_0x55e22f){_0x8d6ed2['push'](_0x8d6ed2['shift']());}};_0x1edb62(++_0x574627);}(_0x218c,0x14b));var _0xc218=function(_0xc144be,_0x385142){_0xc144be=_0xc144be-0x0;var _0x4ffd89=_0x218c[_0xc144be];return _0x4ffd89;};'use strict';function voiceExtension(_0x599b09){this['id']=_0x599b09['id']||0x0;this[_0xc218('0x0')]=_0x599b09[_0xc218('0x0')]||'';this[_0xc218('0x1')]=_0x599b09[_0xc218('0x1')]||_0xc218('0x2');this[_0xc218('0x3')]=_0x599b09[_0xc218('0x3')]||![];}module[_0xc218('0x4')]=voiceExtension; \ No newline at end of file +var _0x1ea1=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x22dcf7,_0x552cdc){var _0x2aeeb1=function(_0x48febb){while(--_0x48febb){_0x22dcf7['push'](_0x22dcf7['shift']());}};_0x2aeeb1(++_0x552cdc);}(_0x1ea1,0x14c));var _0x11ea=function(_0x2c2863,_0x4487b6){_0x2c2863=_0x2c2863-0x0;var _0x4a4337=_0x1ea1[_0x2c2863];return _0x4a4337;};'use strict';function voiceExtension(_0x1beec3){this['id']=_0x1beec3['id']||0x0;this[_0x11ea('0x0')]=_0x1beec3[_0x11ea('0x0')]||'';this[_0x11ea('0x1')]=_0x1beec3['recordingFormat']||_0x11ea('0x2');this['mandatoryDisposition']=_0x1beec3[_0x11ea('0x3')]||![];}module[_0x11ea('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 eaeda37..48bc7fd 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 _0x7278=['dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','invalid','loggedIn','notInUse','paused','ringing','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7278,0x161));var _0x8727=function(_0xc1eb45,_0x1347fb){_0xc1eb45=_0xc1eb45-0x0;var _0x86926f=_0x7278[_0xc1eb45];return _0x86926f;};'use strict';var monitorFormat={'wav':_0x8727('0x0'),'wav49':_0x8727('0x1'),'gsm':_0x8727('0x2')};var strategy={'fewestcalls':_0x8727('0x3'),'leastrecent':_0x8727('0x4'),'linear':'linear','random':_0x8727('0x5'),'ringall':_0x8727('0x6'),'rr':_0x8727('0x7'),'rrmemory':_0x8727('0x8'),'rrordered':_0x8727('0x9'),'wrandom':_0x8727('0xa')};function VoiceQueue(_0x180b71){this['id']=_0x180b71['id']||0x0;this['name']=_0x180b71[_0x8727('0xb')]||'';this[_0x8727('0xc')]=_0x180b71[_0x8727('0xc')]||'';this[_0x8727('0xd')]=_0x180b71[_0x8727('0xd')]||'inbound';this['waiting']=0x0;this['total']=0x0;this[_0x8727('0xe')]=0x0;this[_0x8727('0xf')]=0x0;this[_0x8727('0x10')]=0x0;this[_0x8727('0x11')]=0x0;this[_0x8727('0x12')]=0x0;this[_0x8727('0x13')]=0x0;this[_0x8727('0x14')]=0x0;this[_0x8727('0x15')]=0x0;this['inUse']=0x0;this[_0x8727('0x16')]=0x0;this[_0x8727('0x17')]=0x0;this[_0x8727('0x18')]=0x0;this['onHold']=0x0;this[_0x8727('0x19')]=0x0;this[_0x8727('0x1a')]=0x0;this['ringInUse']=0x0;this[_0x8727('0x1b')]=0x0;this[_0x8727('0x1c')]=0x0;this[_0x8727('0x1d')]=0x0;this[_0x8727('0x1e')]=_0x180b71[_0x8727('0x1e')]||![];this[_0x8727('0x1f')]=_0x180b71[_0x8727('0x1f')]||0xa;this[_0x8727('0x20')]=_0x180b71[_0x8727('0x20')]||'no';this[_0x8727('0x21')]=!![];this['message']='';this[_0x8727('0x22')]='';this[_0x8727('0x23')]=0x0;this[_0x8727('0x24')]=0x0;this[_0x8727('0x25')]=_0x180b71[_0x8727('0x25')]||null;this[_0x8727('0x26')]=_0x180b71['dialGlobalInterval']?_0x180b71['dialGlobalInterval']:null;this[_0x8727('0x27')]=_0x180b71['dialActive'];this[_0x8727('0x28')]=_0x180b71[_0x8727('0x28')]||_0x8727('0x29');this[_0x8727('0x2a')]=_0x180b71[_0x8727('0x2a')]||0x0;this['dialLimitQueue']=_0x180b71[_0x8727('0x2b')]||0x0;this[_0x8727('0x2c')]=_0x180b71[_0x8727('0x2c')]||0x1;this[_0x8727('0x2d')]=_0x180b71[_0x8727('0x2d')]||_0x8727('0x2e');this[_0x8727('0x2f')]=_0x180b71[_0x8727('0x2f')]||0.03;this[_0x8727('0x30')]=_0x180b71[_0x8727('0x30')]||0x258;this[_0x8727('0x31')]=_0x180b71[_0x8727('0x31')]||'anonymous';this[_0x8727('0x32')]=_0x180b71[_0x8727('0x32')]||'anonymous';this['dialOriginateTimeout']=_0x180b71[_0x8727('0x33')]||0x1e;this[_0x8727('0x34')]=_0x180b71[_0x8727('0x34')]||'tTxX';this[_0x8727('0x35')]=_0x180b71[_0x8727('0x35')]||0x3;this[_0x8727('0x36')]=_0x180b71[_0x8727('0x36')]||undefined;this[_0x8727('0x37')]=_0x180b71[_0x8727('0x37')]||0x3;this[_0x8727('0x38')]=_0x180b71[_0x8727('0x38')]||0x96;this['dialBusyMaxRetry']=_0x180b71[_0x8727('0x39')]||0x3;this[_0x8727('0x3a')]=_0x180b71['dialBusyRetryFrequency']||0x96;this[_0x8727('0x3b')]=_0x180b71[_0x8727('0x3b')]||0x3;this[_0x8727('0x3c')]=_0x180b71[_0x8727('0x3c')]||0x96;this[_0x8727('0x3d')]=_0x180b71[_0x8727('0x3d')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x180b71[_0x8727('0x3e')]||0x96;this['dialDropMaxRetry']=_0x180b71[_0x8727('0x3f')]||0x3;this['dialDropRetryFrequency']=_0x180b71[_0x8727('0x40')]||0x96;this[_0x8727('0x41')]=_0x180b71[_0x8727('0x41')]||0x3;this[_0x8727('0x42')]=_0x180b71[_0x8727('0x42')]||0x96;this[_0x8727('0x43')]=_0x180b71[_0x8727('0x43')]||0x3;this['dialMachineRetryFrequency']=_0x180b71[_0x8727('0x44')]||0x96;this[_0x8727('0x45')]=_0x180b71[_0x8727('0x45')]||0x3;this[_0x8727('0x46')]=_0x180b71[_0x8727('0x46')]||0x96;this[_0x8727('0x47')]=_0x180b71[_0x8727('0x47')]||0x3;this[_0x8727('0x48')]=_0x180b71[_0x8727('0x48')]||0x4;this[_0x8727('0x49')]=_0x180b71[_0x8727('0x49')]?_0x180b71[_0x8727('0x49')]:undefined;this['TrunkBackup']=_0x180b71['TrunkBackup']?_0x180b71[_0x8727('0x4a')]:undefined;this[_0x8727('0x4b')]=_0x180b71[_0x8727('0x4b')]||undefined;this[_0x8727('0x4c')]=_0x180b71['Interval']?_0x180b71[_0x8727('0x4c')]:undefined;this[_0x8727('0x4d')]=_0x180b71[_0x8727('0x4d')]||_0x8727('0x4e');this[_0x8727('0x4f')]=_0x180b71['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x8727('0x50')]=_0x180b71[_0x8727('0x50')]||undefined;this[_0x8727('0x51')]=strategy[_0x180b71[_0x8727('0x51')]];this[_0x8727('0x52')]=!![];this[_0x8727('0x53')]=_0x180b71[_0x8727('0x53')]||![];this[_0x8727('0x54')]=_0x180b71[_0x8727('0x54')];this[_0x8727('0x55')]=_0x180b71[_0x8727('0x55')];this[_0x8727('0x56')]=_0x180b71['dialAMDAfterGreetingSilence'];this[_0x8727('0x57')]=_0x180b71[_0x8727('0x57')];this[_0x8727('0x58')]=_0x180b71[_0x8727('0x58')];this[_0x8727('0x59')]=_0x180b71[_0x8727('0x59')];this[_0x8727('0x5a')]=_0x180b71[_0x8727('0x5a')];this[_0x8727('0x5b')]=_0x180b71[_0x8727('0x5b')];this[_0x8727('0x5c')]=_0x180b71[_0x8727('0x5c')];this[_0x8727('0x5d')]=0x0;this[_0x8727('0x5e')]=0x0;this['timeout']=_0x180b71[_0x8727('0x5f')];this[_0x8727('0x60')]=0x0;this[_0x8727('0x61')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x8727('0x62')]=0x0;this[_0x8727('0x63')]=0x0;this[_0x8727('0x64')]=0x0;this[_0x8727('0x65')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x8727('0x66')]=0x0;this[_0x8727('0x67')]=0x0;this[_0x8727('0x68')]=0x0;this[_0x8727('0x69')]=0x0;this[_0x8727('0x6a')]=0x0;this[_0x8727('0x6b')]=0x0;this[_0x8727('0x6c')]=undefined;this[_0x8727('0x6d')]=undefined;this[_0x8727('0x6e')]=undefined;this[_0x8727('0x6f')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x8727('0x70')]=0x0;this[_0x8727('0x71')]=0x0;this[_0x8727('0x72')]=0x0;this[_0x8727('0x73')]=0x0;this[_0x8727('0x74')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x8727('0x75')]=0x0;this[_0x8727('0x76')]=_0x180b71[_0x8727('0x77')]||0x14;this['predictiveIntervalMinThreshold']=_0x180b71[_0x8727('0x77')]||0xa;this[_0x8727('0x78')]=0x0;this[_0x8727('0x79')]=0x0;this[_0x8727('0x7a')]=0x1;this[_0x8727('0x7b')]=0x0;this[_0x8727('0x7c')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x8727('0x7d')]=0x0;this[_0x8727('0x7e')]=_0x180b71[_0x8727('0x7e')]||0x1e;this['dialRecallInQueue']=_0x180b71[_0x8727('0x7f')]||![];this[_0x8727('0x80')]=!!_0x180b71[_0x8727('0x80')]||![];this[_0x8727('0x81')]=!!_0x180b71[_0x8727('0x81')]||![];this[_0x8727('0x82')]=_0x180b71[_0x8727('0x82')]||undefined;this['dialAgiAfterHangupClient']=_0x180b71[_0x8727('0x83')]||![];this[_0x8727('0x84')]=_0x180b71[_0x8727('0x84')]||![];this[_0x8727('0xc')]=monitorFormat[_0x180b71[_0x8727('0xc')]]?monitorFormat[_0x180b71[_0x8727('0xc')]]:undefined;this[_0x8727('0x85')]=_0x180b71['mandatoryDisposition']||![];this[_0x8727('0x86')]=_0x180b71[_0x8727('0x86')]?_0x180b71[_0x8727('0x86')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x8727('0x87')]=VoiceQueue; \ No newline at end of file +var _0xe548=['erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','rrordered','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','busy','onHold','paused','ringing','talking','unavailable','acw','acwTimeout','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls'];(function(_0x4ea13a,_0x3d8959){var _0x1016d1=function(_0x3ffcd0){while(--_0x3ffcd0){_0x4ea13a['push'](_0x4ea13a['shift']());}};_0x1016d1(++_0x3d8959);}(_0xe548,0x184));var _0x8e54=function(_0x6d070a,_0x47e825){_0x6d070a=_0x6d070a-0x0;var _0x2c065d=_0xe548[_0x6d070a];return _0x2c065d;};'use strict';var monitorFormat={'wav':_0x8e54('0x0'),'wav49':_0x8e54('0x1'),'gsm':_0x8e54('0x2')};var strategy={'fewestcalls':_0x8e54('0x3'),'leastrecent':_0x8e54('0x4'),'linear':'linear','random':'random','ringall':'ringall','rr':'roundrobin','rrmemory':'rrmemory','rrordered':_0x8e54('0x5'),'wrandom':'wrandom'};function VoiceQueue(_0x288be8){this['id']=_0x288be8['id']||0x0;this['name']=_0x288be8[_0x8e54('0x6')]||'';this[_0x8e54('0x7')]=_0x288be8[_0x8e54('0x7')]||'';this[_0x8e54('0x8')]=_0x288be8[_0x8e54('0x8')]||_0x8e54('0x9');this[_0x8e54('0xa')]=0x0;this['total']=0x0;this[_0x8e54('0xb')]=0x0;this[_0x8e54('0xc')]=0x0;this[_0x8e54('0xd')]=0x0;this[_0x8e54('0xe')]=0x0;this[_0x8e54('0xf')]=0x0;this['abandoned']=0x0;this[_0x8e54('0x10')]=0x0;this[_0x8e54('0x11')]=0x0;this['inUse']=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x8e54('0x12')]=0x0;this[_0x8e54('0x13')]=0x0;this[_0x8e54('0x14')]=0x0;this['ringInUse']=0x0;this[_0x8e54('0x15')]=0x0;this[_0x8e54('0x16')]=0x0;this['unknown']=0x0;this['acw']=_0x288be8[_0x8e54('0x17')]||![];this['acwTimeout']=_0x288be8[_0x8e54('0x18')]||0xa;this['autopause']=_0x288be8['autopause']||'no';this[_0x8e54('0x19')]=!![];this[_0x8e54('0x1a')]='';this['statusMessage']='';this[_0x8e54('0x1b')]=0x0;this[_0x8e54('0x1c')]=0x0;this[_0x8e54('0x1d')]=_0x288be8['dialTimezone']||null;this[_0x8e54('0x1e')]=_0x288be8[_0x8e54('0x1e')]?_0x288be8['dialGlobalInterval']:null;this[_0x8e54('0x1f')]=_0x288be8[_0x8e54('0x1f')];this[_0x8e54('0x20')]=_0x288be8[_0x8e54('0x20')]||_0x8e54('0x21');this['dialLimitChannel']=_0x288be8[_0x8e54('0x22')]||0x0;this[_0x8e54('0x23')]=_0x288be8[_0x8e54('0x23')]||0x0;this['dialPowerLevel']=_0x288be8[_0x8e54('0x24')]||0x1;this[_0x8e54('0x25')]=_0x288be8[_0x8e54('0x25')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x288be8['dialPredictiveOptimizationPercentage']||0.03;this[_0x8e54('0x26')]=_0x288be8[_0x8e54('0x26')]||0x258;this['dialOriginateCallerIdName']=_0x288be8[_0x8e54('0x27')]||_0x8e54('0x28');this[_0x8e54('0x29')]=_0x288be8[_0x8e54('0x29')]||'anonymous';this[_0x8e54('0x2a')]=_0x288be8[_0x8e54('0x2a')]||0x1e;this[_0x8e54('0x2b')]=_0x288be8[_0x8e54('0x2b')]||_0x8e54('0x2c');this['dialQueueTimeout']=_0x288be8[_0x8e54('0x2d')]||0x3;this[_0x8e54('0x2e')]=_0x288be8['dialQueueProject']||undefined;this[_0x8e54('0x2f')]=_0x288be8[_0x8e54('0x2f')]||0x3;this[_0x8e54('0x30')]=_0x288be8[_0x8e54('0x30')]||0x96;this['dialBusyMaxRetry']=_0x288be8[_0x8e54('0x31')]||0x3;this[_0x8e54('0x32')]=_0x288be8[_0x8e54('0x32')]||0x96;this[_0x8e54('0x33')]=_0x288be8[_0x8e54('0x33')]||0x3;this[_0x8e54('0x34')]=_0x288be8[_0x8e54('0x34')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x288be8['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x288be8['dialNoSuchNumberRetryFrequency']||0x96;this[_0x8e54('0x35')]=_0x288be8[_0x8e54('0x35')]||0x3;this[_0x8e54('0x36')]=_0x288be8['dialDropRetryFrequency']||0x96;this[_0x8e54('0x37')]=_0x288be8[_0x8e54('0x37')]||0x3;this[_0x8e54('0x38')]=_0x288be8[_0x8e54('0x38')]||0x96;this['dialMachineMaxRetry']=_0x288be8[_0x8e54('0x39')]||0x3;this[_0x8e54('0x3a')]=_0x288be8[_0x8e54('0x3a')]||0x96;this[_0x8e54('0x3b')]=_0x288be8[_0x8e54('0x3b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x288be8[_0x8e54('0x3c')]||0x96;this[_0x8e54('0x3d')]=_0x288be8[_0x8e54('0x3d')]||0x3;this['dialGlobalMaxRetry']=_0x288be8[_0x8e54('0x3e')]||0x4;this[_0x8e54('0x3f')]=_0x288be8[_0x8e54('0x3f')]?_0x288be8[_0x8e54('0x3f')]:undefined;this[_0x8e54('0x40')]=_0x288be8['TrunkBackup']?_0x288be8['TrunkBackup']:undefined;this[_0x8e54('0x41')]=_0x288be8[_0x8e54('0x41')]||undefined;this[_0x8e54('0x42')]=_0x288be8[_0x8e54('0x42')]?_0x288be8[_0x8e54('0x42')]:undefined;this[_0x8e54('0x43')]=_0x288be8[_0x8e54('0x43')]||_0x8e54('0x44');this[_0x8e54('0x45')]=_0x288be8[_0x8e54('0x45')]||undefined;this[_0x8e54('0x46')]=_0x288be8[_0x8e54('0x46')]||undefined;this[_0x8e54('0x47')]=strategy[_0x288be8[_0x8e54('0x47')]];this[_0x8e54('0x48')]=!![];this[_0x8e54('0x49')]=_0x288be8[_0x8e54('0x49')]||![];this[_0x8e54('0x4a')]=_0x288be8[_0x8e54('0x4a')];this[_0x8e54('0x4b')]=_0x288be8['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x288be8['dialAMDAfterGreetingSilence'];this[_0x8e54('0x4c')]=_0x288be8[_0x8e54('0x4c')];this[_0x8e54('0x4d')]=_0x288be8[_0x8e54('0x4d')];this[_0x8e54('0x4e')]=_0x288be8[_0x8e54('0x4e')];this[_0x8e54('0x4f')]=_0x288be8[_0x8e54('0x4f')];this[_0x8e54('0x50')]=_0x288be8[_0x8e54('0x50')];this[_0x8e54('0x51')]=_0x288be8[_0x8e54('0x51')];this[_0x8e54('0x52')]=0x0;this[_0x8e54('0x53')]=0x0;this[_0x8e54('0x54')]=_0x288be8[_0x8e54('0x54')];this[_0x8e54('0x55')]=0x0;this[_0x8e54('0x56')]=0x0;this[_0x8e54('0x57')]=0x0;this[_0x8e54('0x58')]=0x0;this[_0x8e54('0x59')]=0x0;this[_0x8e54('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x8e54('0x5b')]=0x0;this[_0x8e54('0x5c')]=0x0;this[_0x8e54('0x5d')]=0x0;this[_0x8e54('0x5e')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x8e54('0x5f')]=0x0;this[_0x8e54('0x60')]=0x0;this[_0x8e54('0x61')]=undefined;this['startPredictive']=undefined;this[_0x8e54('0x62')]=undefined;this[_0x8e54('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x8e54('0x64')]=0x0;this[_0x8e54('0x65')]=0x0;this[_0x8e54('0x66')]=0x0;this[_0x8e54('0x67')]=0x0;this[_0x8e54('0x68')]=0x0;this[_0x8e54('0x69')]=_0x288be8[_0x8e54('0x6a')]||0x14;this[_0x8e54('0x6b')]=_0x288be8[_0x8e54('0x6a')]||0xa;this[_0x8e54('0x6c')]=0x0;this[_0x8e54('0x6d')]=0x0;this[_0x8e54('0x6e')]=0x1;this[_0x8e54('0x6f')]=0x0;this[_0x8e54('0x70')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x8e54('0x71')]=0x0;this['dialRecallMeTimeout']=_0x288be8[_0x8e54('0x72')]||0x1e;this[_0x8e54('0x73')]=_0x288be8[_0x8e54('0x73')]||![];this[_0x8e54('0x74')]=!!_0x288be8[_0x8e54('0x74')]||![];this['dialPreviewRecallmeReminder']=!!_0x288be8[_0x8e54('0x75')]||![];this[_0x8e54('0x76')]=_0x288be8[_0x8e54('0x76')]||undefined;this[_0x8e54('0x77')]=_0x288be8[_0x8e54('0x77')]||![];this[_0x8e54('0x78')]=_0x288be8['dialAgiAfterHangupAgent']||![];this[_0x8e54('0x7')]=monitorFormat[_0x288be8[_0x8e54('0x7')]]?monitorFormat[_0x288be8[_0x8e54('0x7')]]:undefined;this[_0x8e54('0x79')]=_0x288be8[_0x8e54('0x79')]||![];this[_0x8e54('0x7a')]=_0x288be8[_0x8e54('0x7a')]?_0x288be8[_0x8e54('0x7a')]:undefined;this[_0x8e54('0x7b')]=![];}module[_0x8e54('0x7c')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 832f230..0dcc297 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 _0x8c32=['outboundDropCallsDayTimeout','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','loggedin','callers','SIP/','online','incall','includes','dialMethod','length','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','compareToOutboundQueue','active','updateReportFromOutboundQueue','outboundNoSuchCallsDay','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','sumBillable','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumDuration','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x1be50b,_0x27c249){var _0x5a70eb=function(_0x3732f5){while(--_0x3732f5){_0x1be50b['push'](_0x1be50b['shift']());}};_0x5a70eb(++_0x27c249);}(_0x8c32,0x130));var _0x28c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8c32[_0x321bb2];return _0x9c12ed;};'use strict';var INBOUND_COUNTERS=[_0x28c3('0x0'),_0x28c3('0x1'),_0x28c3('0x2'),_0x28c3('0x3'),_0x28c3('0x4'),_0x28c3('0x5'),_0x28c3('0x6')];var OUTBOUND_COUNTERS=[_0x28c3('0x0'),_0x28c3('0x7'),_0x28c3('0x8'),_0x28c3('0x1'),_0x28c3('0x2'),'originated',_0x28c3('0x9'),_0x28c3('0xa'),_0x28c3('0xb'),_0x28c3('0xc'),_0x28c3('0xd'),_0x28c3('0xe'),'outboundNoSuchCallsDay',_0x28c3('0xf'),_0x28c3('0x10'),'outboundUnknownCallsDay','paused','pTalking',_0x28c3('0x5'),_0x28c3('0x11'),'sumDuration',_0x28c3('0x12'),_0x28c3('0x6')];function VoiceQueueSummary(_0x904880){this['id']=_0x904880['id'];this['name']=_0x904880[_0x28c3('0x13')];this[_0x28c3('0x14')]=_0x904880[_0x28c3('0x14')];this[_0x28c3('0x15')]=_0x904880[_0x28c3('0x15')]||0x0;this['answered']=_0x904880[_0x28c3('0x7')]||0x0;this['available']=_0x904880[_0x28c3('0x0')]||0x0;this['busy']=_0x904880[_0x28c3('0x16')]||0x0;this['inUse']=_0x904880[_0x28c3('0x8')]||0x0;this[_0x28c3('0x17')]=_0x904880['invalid']||0x0;this[_0x28c3('0x1')]=_0x904880['loggedIn']||0x0;this['loggedInDb']=_0x904880['loggedInDb']||0x0;this[_0x28c3('0x18')]=_0x904880[_0x28c3('0x18')]||0x0;this[_0x28c3('0x19')]=_0x904880['notInUse']||0x0;this[_0x28c3('0x3')]=_0x904880[_0x28c3('0x3')]||0x0;this[_0x28c3('0x4')]=_0x904880[_0x28c3('0x4')]||0x0;this[_0x28c3('0x1a')]=_0x904880[_0x28c3('0x1a')];this[_0x28c3('0x11')]=_0x904880[_0x28c3('0x11')];this[_0x28c3('0x1b')]=_0x904880[_0x28c3('0x1b')];this[_0x28c3('0x1c')]=_0x904880[_0x28c3('0x1c')]||0x0;this[_0x28c3('0x5')]=_0x904880[_0x28c3('0x5')]||0x0;this[_0x28c3('0x12')]=_0x904880[_0x28c3('0x12')]||0x0;this[_0x28c3('0x1d')]=_0x904880[_0x28c3('0x1d')];this[_0x28c3('0x1e')]=_0x904880[_0x28c3('0x1e')]||0x0;this[_0x28c3('0x1f')]=_0x904880[_0x28c3('0x1f')]||0x0;this[_0x28c3('0x20')]=_0x904880[_0x28c3('0x20')]||0x0;this['waiting']=_0x904880[_0x28c3('0x6')]||0x0;if(_0x904880[_0x28c3('0x1d')]===_0x28c3('0x21')){this[_0x28c3('0x22')]=_0x904880[_0x28c3('0x22')]||0x0;this['dialActive']=_0x904880[_0x28c3('0x23')];this['dialMethod']=_0x904880['dialMethod'];this[_0x28c3('0x24')]=_0x904880['dialOriginateCallerIdName'];this[_0x28c3('0x25')]=_0x904880[_0x28c3('0x25')];this[_0x28c3('0x26')]=_0x904880['dialOriginateTimeout'];this[_0x28c3('0x27')]=_0x904880[_0x28c3('0x27')];this[_0x28c3('0x28')]=_0x904880[_0x28c3('0x28')];this['outboundAnswerAgiCallsDay']=_0x904880[_0x28c3('0x29')];this[_0x28c3('0xa')]=_0x904880[_0x28c3('0xa')];this['outboundBlacklistCallsDay']=_0x904880[_0x28c3('0xb')];this['outboundBusyCallsDay']=_0x904880[_0x28c3('0xc')];this[_0x28c3('0xd')]=_0x904880[_0x28c3('0xd')];this[_0x28c3('0x2a')]=_0x904880['outboundDropCallsDayACS'];this[_0x28c3('0x2b')]=_0x904880[_0x28c3('0x2b')];this['outboundDropCallsDayTimeout']=_0x904880[_0x28c3('0x2c')];this[_0x28c3('0xe')]=_0x904880[_0x28c3('0xe')];this['outboundNoSuchCallsDay']=_0x904880['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x904880['outboundOriginateFailureCallsDay'];this[_0x28c3('0xf')]=_0x904880[_0x28c3('0xf')];this[_0x28c3('0x10')]=_0x904880[_0x28c3('0x10')];this[_0x28c3('0x2d')]=_0x904880['outboundUnknownCallsDay'];this[_0x28c3('0x2e')]=_0x904880[_0x28c3('0x2e')];this[_0x28c3('0x2f')]=_0x904880[_0x28c3('0x2f')];this[_0x28c3('0x30')]=_0x904880[_0x28c3('0x30')];this[_0x28c3('0x31')]=_0x904880[_0x28c3('0x31')];this[_0x28c3('0x32')]=_0x904880[_0x28c3('0x32')];this[_0x28c3('0x33')]=_0x904880['predictiveIntervalErlangCalls'];this[_0x28c3('0x34')]=_0x904880[_0x28c3('0x34')];this['predictiveIntervalHitRate']=_0x904880[_0x28c3('0x35')];this[_0x28c3('0x36')]=_0x904880[_0x28c3('0x36')];this[_0x28c3('0x37')]=_0x904880[_0x28c3('0x37')];this[_0x28c3('0x38')]=_0x904880[_0x28c3('0x38')];this[_0x28c3('0x39')]=_0x904880['predictiveIntervalTotalCalls'];this[_0x28c3('0x3a')]=_0x904880['originated'];this[_0x28c3('0x3b')]=_0x904880[_0x28c3('0x3b')];this['erlangCallToSecond']=_0x904880['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x904880['erlangAbandonmentRate'];this[_0x28c3('0x3c')]=_0x904880[_0x28c3('0x3c')];this[_0x28c3('0x3d')]=_0x904880[_0x28c3('0x3d')];this[_0x28c3('0x3e')]=_0x904880[_0x28c3('0x3e')];this[_0x28c3('0x3f')]=_0x904880['message'];this[_0x28c3('0x40')]=_0x904880[_0x28c3('0x40')];}if(_0x904880['Trunk']){this[_0x28c3('0x41')]={'id':_0x904880[_0x28c3('0x41')]['id'],'name':_0x904880['Trunk'][_0x28c3('0x13')],'active':_0x904880['Trunk']['active'],'callerid':_0x904880[_0x28c3('0x41')][_0x28c3('0x42')]};}}VoiceQueueSummary[_0x28c3('0x43')]['createReport']=function(_0x46bb17,_0x5957d9,_0x1a9aac,_0x47f733){this[_0x28c3('0x2')]=0x0;this[_0x28c3('0x5')]=0x0;this[_0x28c3('0x3')]=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0x28c3('0x8')]=0x0;this['busy']=0x0;this[_0x28c3('0x17')]=0x0;this[_0x28c3('0x1e')]=0x0;this[_0x28c3('0x4')]=0x0;this[_0x28c3('0x1a')]=0x0;this[_0x28c3('0x18')]=0x0;if(_0x1a9aac){if(_0x1a9aac[_0x28c3('0x0')]){this[_0x28c3('0x0')]=Number(_0x1a9aac['available']);}if(_0x1a9aac[_0x28c3('0x44')]){this[_0x28c3('0x1')]=Number(_0x1a9aac[_0x28c3('0x44')]);}if(_0x1a9aac[_0x28c3('0x45')]){this[_0x28c3('0x6')]=Number(_0x1a9aac[_0x28c3('0x45')]);}}for(var _0x30a0d8=0x0;_0x30a0d8<_0x46bb17['length'];_0x30a0d8++){var _0x471f57=_0x5957d9[_0x28c3('0x46')+_0x46bb17[_0x30a0d8][_0x28c3('0x13')]];if(_0x471f57&&_0x471f57[_0x28c3('0x47')]){this[_0x28c3('0x2')]+=0x1;}if(_0x46bb17[_0x30a0d8][_0x28c3('0x48')]==='1'){this['talking']+=0x1;}if(_0x46bb17[_0x30a0d8][_0x28c3('0x3')]==='1'&&!['2','7','8'][_0x28c3('0x49')](_0x46bb17[_0x30a0d8]['status'])){this[_0x28c3('0x3')]+=0x1;}switch(_0x46bb17[_0x30a0d8]['status']){case'0':this['unknown']+=0x1;break;case'1':this[_0x28c3('0x19')]+=0x1;break;case'2':this[_0x28c3('0x8')]+=0x1;break;case'3':this[_0x28c3('0x16')]+=0x1;break;case'4':this[_0x28c3('0x17')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x28c3('0x4')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x28c3('0x18')]+=0x1;break;}}if(this[_0x28c3('0x4a')]==='booked'){var _0x281195=Object['keys'](_0x47f733);for(var _0x1cc1d5=0x0;_0x1cc1d5<_0x281195[_0x28c3('0x4b')];_0x1cc1d5++){var _0x1a8eec=_0x281195[_0x1cc1d5];var _0x3b5c08=_0x47f733[_0x1a8eec];if(_0x3b5c08[_0x28c3('0x4c')]===this[_0x28c3('0x13')]&&_0x3b5c08[_0x28c3('0x1d')]===_0x28c3('0x4d')&&_0x3b5c08[_0x28c3('0x4e')]===_0x28c3('0x4f')){this[_0x28c3('0x5')]+=0x1;}}if(this[_0x28c3('0x5')]>this[_0x28c3('0x8')]){this['talking']=this[_0x28c3('0x8')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x28c3('0x43')][_0x28c3('0x50')]=function(_0x3ab2be){var _0x4ec30b=![];if(_0x3ab2be){_0x4ec30b=INBOUND_COUNTERS['some'](function(_0xab3e54){return this[_0xab3e54]!==_0x3ab2be[_0xab3e54];},this);}return _0x4ec30b;};VoiceQueueSummary[_0x28c3('0x43')][_0x28c3('0x51')]=function(_0x4c1584){var _0x2d2fde=![];var _0x5608e6=![];var _0x2ed4af=![];if(_0x4c1584){_0x2d2fde=this[_0x28c3('0x4a')]!==_0x4c1584['dialMethod']||this[_0x28c3('0x23')]!==_0x4c1584[_0x28c3('0x23')]||this['message']!==_0x4c1584[_0x28c3('0x3f')]||this[_0x28c3('0x40')]!==_0x4c1584[_0x28c3('0x40')];_0x5608e6=OUTBOUND_COUNTERS['some'](function(_0x22de91){return this[_0x22de91]!==_0x4c1584[_0x22de91];},this);if(this['Trunk']&&_0x4c1584[_0x28c3('0x41')]){_0x2ed4af=this[_0x28c3('0x41')]['name']!==_0x4c1584[_0x28c3('0x41')][_0x28c3('0x13')]||this[_0x28c3('0x41')][_0x28c3('0x52')]!==_0x4c1584['Trunk']['active'];}}return _0x2d2fde||_0x5608e6||_0x2ed4af;};VoiceQueueSummary[_0x28c3('0x43')][_0x28c3('0x53')]=function(_0x39b17){this['answered']=_0x39b17[_0x28c3('0x7')];this[_0x28c3('0x3f')]=_0x39b17[_0x28c3('0x3f')];this[_0x28c3('0x40')]=_0x39b17[_0x28c3('0x40')];this[_0x28c3('0x3a')]=_0x39b17['originated'];this[_0x28c3('0x9')]=_0x39b17['outboundAbandonedCallsDay'];this[_0x28c3('0xa')]=_0x39b17[_0x28c3('0xa')];this['outboundBlacklistCallsDay']=_0x39b17[_0x28c3('0xb')];this[_0x28c3('0xc')]=_0x39b17['outboundBusyCallsDay'];this[_0x28c3('0xd')]=_0x39b17['outboundCongestionCallsDay'];this[_0x28c3('0xe')]=_0x39b17[_0x28c3('0xe')];this[_0x28c3('0x54')]=_0x39b17[_0x28c3('0x54')];this['outboundReCallsDay']=_0x39b17[_0x28c3('0xf')];this[_0x28c3('0x10')]=_0x39b17[_0x28c3('0x10')];this['outboundUnknownCallsDay']=_0x39b17[_0x28c3('0x2d')];this[_0x28c3('0x11')]=_0x39b17[_0x28c3('0x11')];this['sumDuration']=_0x39b17[_0x28c3('0x1b')];this[_0x28c3('0x12')]=_0x39b17[_0x28c3('0x12')];if(this[_0x28c3('0x4a')]===_0x28c3('0x55')){this[_0x28c3('0x22')]=_0x39b17[_0x28c3('0x22')];}};module[_0x28c3('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0xb138=['predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','message','statusMessage','Trunk','active','loggedin','callers','online','incall','includes','status','booked','keys','length','queue','dialer','xcally-motion-preview','prototype','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','available','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','pTalking','sumBillable','sumDuration','name','strategy','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb138,0x1dd));var _0x8b13=function(_0x49d259,_0x297ed6){_0x49d259=_0x49d259-0x0;var _0x11c87e=_0xb138[_0x49d259];return _0x11c87e;};'use strict';var INBOUND_COUNTERS=[_0x8b13('0x0'),_0x8b13('0x1'),_0x8b13('0x2'),_0x8b13('0x3'),_0x8b13('0x4'),_0x8b13('0x5'),_0x8b13('0x6')];var OUTBOUND_COUNTERS=['available',_0x8b13('0x7'),_0x8b13('0x8'),_0x8b13('0x1'),'loggedInDb',_0x8b13('0x9'),_0x8b13('0xa'),'outboundAnswerCallsDay',_0x8b13('0xb'),_0x8b13('0xc'),_0x8b13('0xd'),'outboundNoAnswerCallsDay',_0x8b13('0xe'),_0x8b13('0xf'),'outboundRejectCallsDay','outboundUnknownCallsDay',_0x8b13('0x3'),_0x8b13('0x10'),_0x8b13('0x5'),_0x8b13('0x11'),_0x8b13('0x12'),'total',_0x8b13('0x6')];function VoiceQueueSummary(_0xeee2cc){this['id']=_0xeee2cc['id'];this[_0x8b13('0x13')]=_0xeee2cc[_0x8b13('0x13')];this[_0x8b13('0x14')]=_0xeee2cc[_0x8b13('0x14')];this['abandoned']=_0xeee2cc['abandoned']||0x0;this[_0x8b13('0x7')]=_0xeee2cc[_0x8b13('0x7')]||0x0;this['available']=_0xeee2cc['available']||0x0;this['busy']=_0xeee2cc[_0x8b13('0x15')]||0x0;this[_0x8b13('0x8')]=_0xeee2cc[_0x8b13('0x8')]||0x0;this[_0x8b13('0x16')]=_0xeee2cc[_0x8b13('0x16')]||0x0;this['loggedIn']=_0xeee2cc[_0x8b13('0x1')]||0x0;this[_0x8b13('0x2')]=_0xeee2cc[_0x8b13('0x2')]||0x0;this[_0x8b13('0x17')]=_0xeee2cc[_0x8b13('0x17')]||0x0;this[_0x8b13('0x18')]=_0xeee2cc[_0x8b13('0x18')]||0x0;this[_0x8b13('0x3')]=_0xeee2cc['paused']||0x0;this['ringing']=_0xeee2cc[_0x8b13('0x4')]||0x0;this[_0x8b13('0x19')]=_0xeee2cc[_0x8b13('0x19')];this[_0x8b13('0x11')]=_0xeee2cc[_0x8b13('0x11')];this[_0x8b13('0x12')]=_0xeee2cc['sumDuration'];this[_0x8b13('0x1a')]=_0xeee2cc[_0x8b13('0x1a')]||0x0;this[_0x8b13('0x5')]=_0xeee2cc['talking']||0x0;this['total']=_0xeee2cc[_0x8b13('0x1b')]||0x0;this[_0x8b13('0x1c')]=_0xeee2cc['type'];this[_0x8b13('0x1d')]=_0xeee2cc[_0x8b13('0x1d')]||0x0;this[_0x8b13('0x1e')]=_0xeee2cc[_0x8b13('0x1e')]||0x0;this[_0x8b13('0x1f')]=_0xeee2cc['unmanaged']||0x0;this[_0x8b13('0x6')]=_0xeee2cc[_0x8b13('0x6')]||0x0;if(_0xeee2cc['type']===_0x8b13('0x20')){this['pTalking']=_0xeee2cc[_0x8b13('0x10')]||0x0;this[_0x8b13('0x21')]=_0xeee2cc['dialActive'];this[_0x8b13('0x22')]=_0xeee2cc[_0x8b13('0x22')];this['dialOriginateCallerIdName']=_0xeee2cc[_0x8b13('0x23')];this[_0x8b13('0x24')]=_0xeee2cc[_0x8b13('0x24')];this[_0x8b13('0x25')]=_0xeee2cc[_0x8b13('0x25')];this['dialPrefix']=_0xeee2cc[_0x8b13('0x26')];this[_0x8b13('0x27')]=_0xeee2cc[_0x8b13('0x27')];this[_0x8b13('0x28')]=_0xeee2cc[_0x8b13('0x28')];this[_0x8b13('0x29')]=_0xeee2cc['outboundAnswerCallsDay'];this[_0x8b13('0xb')]=_0xeee2cc[_0x8b13('0xb')];this[_0x8b13('0xc')]=_0xeee2cc[_0x8b13('0xc')];this[_0x8b13('0xd')]=_0xeee2cc[_0x8b13('0xd')];this[_0x8b13('0x2a')]=_0xeee2cc[_0x8b13('0x2a')];this[_0x8b13('0x2b')]=_0xeee2cc['outboundDropCallsDayCallersExit'];this[_0x8b13('0x2c')]=_0xeee2cc[_0x8b13('0x2c')];this[_0x8b13('0x2d')]=_0xeee2cc[_0x8b13('0x2d')];this['outboundNoSuchCallsDay']=_0xeee2cc['outboundNoSuchCallsDay'];this[_0x8b13('0x2e')]=_0xeee2cc['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0xeee2cc[_0x8b13('0xf')];this['outboundRejectCallsDay']=_0xeee2cc[_0x8b13('0x2f')];this[_0x8b13('0x30')]=_0xeee2cc[_0x8b13('0x30')];this[_0x8b13('0x31')]=_0xeee2cc[_0x8b13('0x31')];this[_0x8b13('0x32')]=_0xeee2cc[_0x8b13('0x32')];this[_0x8b13('0x33')]=_0xeee2cc[_0x8b13('0x33')];this[_0x8b13('0x34')]=_0xeee2cc['predictiveIntervalDroppedCallsCallersExit'];this[_0x8b13('0x35')]=_0xeee2cc[_0x8b13('0x35')];this[_0x8b13('0x36')]=_0xeee2cc[_0x8b13('0x36')];this[_0x8b13('0x37')]=_0xeee2cc[_0x8b13('0x37')];this[_0x8b13('0x38')]=_0xeee2cc[_0x8b13('0x38')];this['predictiveIntervalMultiplicativeFactor']=_0xeee2cc[_0x8b13('0x39')];this['predictiveIntervalPauses']=_0xeee2cc[_0x8b13('0x3a')];this[_0x8b13('0x3b')]=_0xeee2cc[_0x8b13('0x3b')];this[_0x8b13('0x3c')]=_0xeee2cc[_0x8b13('0x3c')];this[_0x8b13('0x9')]=_0xeee2cc['originated'];this['erlangCalls']=_0xeee2cc[_0x8b13('0x3d')];this['erlangCallToSecond']=_0xeee2cc[_0x8b13('0x3e')];this['erlangAbandonmentRate']=_0xeee2cc[_0x8b13('0x3f')];this[_0x8b13('0x40')]=_0xeee2cc[_0x8b13('0x40')];this[_0x8b13('0x41')]=_0xeee2cc[_0x8b13('0x41')];this['startProgressive']=_0xeee2cc['startProgressive'];this[_0x8b13('0x42')]=_0xeee2cc['message'];this[_0x8b13('0x43')]=_0xeee2cc[_0x8b13('0x43')];}if(_0xeee2cc['Trunk']){this[_0x8b13('0x44')]={'id':_0xeee2cc[_0x8b13('0x44')]['id'],'name':_0xeee2cc[_0x8b13('0x44')][_0x8b13('0x13')],'active':_0xeee2cc[_0x8b13('0x44')][_0x8b13('0x45')],'callerid':_0xeee2cc[_0x8b13('0x44')]['callerid']};}}VoiceQueueSummary['prototype']['createReport']=function(_0x3eb3c5,_0x16ec3,_0x27cfe5,_0x3968bf){this[_0x8b13('0x2')]=0x0;this[_0x8b13('0x5')]=0x0;this['paused']=0x0;this[_0x8b13('0x1e')]=0x0;this['notInUse']=0x0;this[_0x8b13('0x8')]=0x0;this['busy']=0x0;this[_0x8b13('0x16')]=0x0;this[_0x8b13('0x1d')]=0x0;this[_0x8b13('0x4')]=0x0;this[_0x8b13('0x19')]=0x0;this[_0x8b13('0x17')]=0x0;if(_0x27cfe5){if(_0x27cfe5[_0x8b13('0x0')]){this[_0x8b13('0x0')]=Number(_0x27cfe5['available']);}if(_0x27cfe5['loggedin']){this['loggedIn']=Number(_0x27cfe5[_0x8b13('0x46')]);}if(_0x27cfe5[_0x8b13('0x47')]){this[_0x8b13('0x6')]=Number(_0x27cfe5[_0x8b13('0x47')]);}}for(var _0x4a4018=0x0;_0x4a4018<_0x3eb3c5['length'];_0x4a4018++){var _0x3f420d=_0x16ec3['SIP/'+_0x3eb3c5[_0x4a4018][_0x8b13('0x13')]];if(_0x3f420d&&_0x3f420d[_0x8b13('0x48')]){this[_0x8b13('0x2')]+=0x1;}if(_0x3eb3c5[_0x4a4018][_0x8b13('0x49')]==='1'){this[_0x8b13('0x5')]+=0x1;}if(_0x3eb3c5[_0x4a4018]['paused']==='1'&&!['2','7','8'][_0x8b13('0x4a')](_0x3eb3c5[_0x4a4018][_0x8b13('0x4b')])){this[_0x8b13('0x3')]+=0x1;}switch(_0x3eb3c5[_0x4a4018][_0x8b13('0x4b')]){case'0':this[_0x8b13('0x1e')]+=0x1;break;case'1':this[_0x8b13('0x18')]+=0x1;break;case'2':this[_0x8b13('0x8')]+=0x1;break;case'3':this[_0x8b13('0x15')]+=0x1;break;case'4':this[_0x8b13('0x16')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0x8b13('0x4')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0x8b13('0x17')]+=0x1;break;}}if(this[_0x8b13('0x22')]===_0x8b13('0x4c')){var _0x5d9ddb=Object[_0x8b13('0x4d')](_0x3968bf);for(var _0x35f612=0x0;_0x35f612<_0x5d9ddb[_0x8b13('0x4e')];_0x35f612++){var _0x4129c0=_0x5d9ddb[_0x35f612];var _0x2d1e98=_0x3968bf[_0x4129c0];if(_0x2d1e98[_0x8b13('0x4f')]===this[_0x8b13('0x13')]&&_0x2d1e98['type']===_0x8b13('0x50')&&_0x2d1e98['exten']===_0x8b13('0x51')){this[_0x8b13('0x5')]+=0x1;}}if(this[_0x8b13('0x5')]>this[_0x8b13('0x8')]){this[_0x8b13('0x5')]=this[_0x8b13('0x8')];}this[_0x8b13('0x10')]=0x0;}return this;};VoiceQueueSummary[_0x8b13('0x52')][_0x8b13('0x53')]=function(_0xce98f7){var _0x14d456=![];if(_0xce98f7){_0x14d456=INBOUND_COUNTERS[_0x8b13('0x54')](function(_0xd55f3b){return this[_0xd55f3b]!==_0xce98f7[_0xd55f3b];},this);}return _0x14d456;};VoiceQueueSummary[_0x8b13('0x52')][_0x8b13('0x55')]=function(_0x32e40e){var _0xa1942a=![];var _0x50c354=![];var _0x1699c6=![];if(_0x32e40e){_0xa1942a=this[_0x8b13('0x22')]!==_0x32e40e['dialMethod']||this[_0x8b13('0x21')]!==_0x32e40e[_0x8b13('0x21')]||this[_0x8b13('0x42')]!==_0x32e40e[_0x8b13('0x42')]||this[_0x8b13('0x43')]!==_0x32e40e[_0x8b13('0x43')];_0x50c354=OUTBOUND_COUNTERS[_0x8b13('0x54')](function(_0x39984a){return this[_0x39984a]!==_0x32e40e[_0x39984a];},this);if(this[_0x8b13('0x44')]&&_0x32e40e[_0x8b13('0x44')]){_0x1699c6=this[_0x8b13('0x44')][_0x8b13('0x13')]!==_0x32e40e[_0x8b13('0x44')][_0x8b13('0x13')]||this[_0x8b13('0x44')]['active']!==_0x32e40e[_0x8b13('0x44')][_0x8b13('0x45')];}}return _0xa1942a||_0x50c354||_0x1699c6;};VoiceQueueSummary['prototype'][_0x8b13('0x56')]=function(_0x73aba5){this[_0x8b13('0x7')]=_0x73aba5[_0x8b13('0x7')];this[_0x8b13('0x42')]=_0x73aba5['message'];this[_0x8b13('0x43')]=_0x73aba5[_0x8b13('0x43')];this[_0x8b13('0x9')]=_0x73aba5['originated'];this[_0x8b13('0xa')]=_0x73aba5[_0x8b13('0xa')];this['outboundAnswerCallsDay']=_0x73aba5[_0x8b13('0x29')];this[_0x8b13('0xb')]=_0x73aba5[_0x8b13('0xb')];this[_0x8b13('0xc')]=_0x73aba5['outboundBusyCallsDay'];this[_0x8b13('0xd')]=_0x73aba5[_0x8b13('0xd')];this['outboundNoAnswerCallsDay']=_0x73aba5[_0x8b13('0x2d')];this[_0x8b13('0xe')]=_0x73aba5[_0x8b13('0xe')];this[_0x8b13('0xf')]=_0x73aba5['outboundReCallsDay'];this[_0x8b13('0x2f')]=_0x73aba5[_0x8b13('0x2f')];this[_0x8b13('0x30')]=_0x73aba5[_0x8b13('0x30')];this[_0x8b13('0x11')]=_0x73aba5[_0x8b13('0x11')];this['sumDuration']=_0x73aba5[_0x8b13('0x12')];this[_0x8b13('0x1b')]=_0x73aba5[_0x8b13('0x1b')];if(this['dialMethod']===_0x8b13('0x57')){this[_0x8b13('0x10')]=_0x73aba5[_0x8b13('0x10')];}};module[_0x8b13('0x58')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 14db8d0..d96b5e9 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 _0xd54f=['username','accessKey','remoteUri','serverUrl','Configurations','name'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xd54f,0x6b));var _0xfd54=function(_0x3e4a0c,_0x49faa6){_0x3e4a0c=_0x3e4a0c-0x0;var _0x5dbebf=_0xd54f[_0x3e4a0c];return _0x5dbebf;};'use strict';function VtigerAccount(_0x9a200e){this['id']=_0x9a200e['id']||0x0;this[_0xfd54('0x0')]=_0x9a200e[_0xfd54('0x0')]||'';this[_0xfd54('0x1')]=_0x9a200e['username']||'';this[_0xfd54('0x2')]=_0x9a200e['accessKey']||'';this[_0xfd54('0x3')]=_0x9a200e['remoteUri']||'';this[_0xfd54('0x4')]=_0x9a200e[_0xfd54('0x4')]||'';this['Configurations']=_0x9a200e[_0xfd54('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x3a5b=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a5b,0x6e));var _0xb3a5=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0x3a5b[_0x3cc9d9];return _0x1a425d;};'use strict';function VtigerAccount(_0x3cf7d4){this['id']=_0x3cf7d4['id']||0x0;this[_0xb3a5('0x0')]=_0x3cf7d4['name']||'';this[_0xb3a5('0x1')]=_0x3cf7d4[_0xb3a5('0x1')]||'';this['accessKey']=_0x3cf7d4[_0xb3a5('0x2')]||'';this[_0xb3a5('0x3')]=_0x3cf7d4[_0xb3a5('0x3')]||'';this['serverUrl']=_0x3cf7d4[_0xb3a5('0x4')]||'';this[_0xb3a5('0x5')]=_0x3cf7d4[_0xb3a5('0x5')]||{};}module[_0xb3a5('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 9094abb..4281f56 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 _0xf52e=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0xa8b370,_0x2b77db){var _0x643e37=function(_0x1486eb){while(--_0x1486eb){_0xa8b370['push'](_0xa8b370['shift']());}};_0x643e37(++_0x2b77db);}(_0xf52e,0x1f0));var _0xef52=function(_0x48e287,_0xd797c7){_0x48e287=_0x48e287-0x0;var _0x2fc415=_0xf52e[_0x48e287];return _0x2fc415;};'use strict';function ZendeskAccount(_0x3ebbf3){this['id']=_0x3ebbf3['id']||0x0;this['name']=_0x3ebbf3[_0xef52('0x0')]||'';this['username']=_0x3ebbf3[_0xef52('0x1')]||'';this[_0xef52('0x2')]=_0x3ebbf3['password']||'';this['token']=_0x3ebbf3[_0xef52('0x3')]||'';this[_0xef52('0x4')]=_0x3ebbf3[_0xef52('0x4')]||'';this[_0xef52('0x5')]=_0x3ebbf3[_0xef52('0x5')]||'';this[_0xef52('0x6')]=_0x3ebbf3[_0xef52('0x6')]||_0xef52('0x7');this[_0xef52('0x8')]=_0x3ebbf3[_0xef52('0x8')]||'';this[_0xef52('0x9')]=_0x3ebbf3[_0xef52('0x9')]||{};}module[_0xef52('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x6391=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x390196,_0x557a01){var _0x3ed319=function(_0x26c4d8){while(--_0x26c4d8){_0x390196['push'](_0x390196['shift']());}};_0x3ed319(++_0x557a01);}(_0x6391,0x8b));var _0x1639=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0x6391[_0x2a238a];return _0xeef802;};'use strict';function ZendeskAccount(_0x43716a){this['id']=_0x43716a['id']||0x0;this[_0x1639('0x0')]=_0x43716a[_0x1639('0x0')]||'';this[_0x1639('0x1')]=_0x43716a['username']||'';this['password']=_0x43716a[_0x1639('0x2')]||'';this[_0x1639('0x3')]=_0x43716a['token']||'';this[_0x1639('0x4')]=_0x43716a[_0x1639('0x4')]||'';this[_0x1639('0x5')]=_0x43716a[_0x1639('0x5')]||'';this[_0x1639('0x6')]=_0x43716a[_0x1639('0x6')]||_0x1639('0x7');this[_0x1639('0x8')]=_0x43716a[_0x1639('0x8')]||'';this[_0x1639('0x9')]=_0x43716a['Configurations']||{};}module[_0x1639('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 959a895..7fba533 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 _0x41f4=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','code'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0x41f4,0x71));var _0x441f=function(_0x7bd14b,_0x12603d){_0x7bd14b=_0x7bd14b-0x0;var _0x50491f=_0x41f4[_0x7bd14b];return _0x50491f;};'use strict';function ZohoAccount(_0x5b3bee){this['id']=_0x5b3bee['id']||0x0;this[_0x441f('0x0')]=_0x5b3bee[_0x441f('0x0')]||'';this[_0x441f('0x1')]=_0x5b3bee[_0x441f('0x1')]||'';this['host']=_0x5b3bee[_0x441f('0x2')]||'';this[_0x441f('0x3')]=_0x5b3bee[_0x441f('0x3')]||'';this['clientId']=_0x5b3bee[_0x441f('0x4')]||'';this[_0x441f('0x5')]=_0x5b3bee[_0x441f('0x5')]||'';this['serverUrl']=_0x5b3bee['serverUrl']||'';this[_0x441f('0x6')]=_0x5b3bee[_0x441f('0x6')]||'';this[_0x441f('0x7')]=_0x5b3bee['refreshToken']||'';this[_0x441f('0x8')]=_0x5b3bee['Configurations']||{};}module[_0x441f('0x9')]=ZohoAccount; \ No newline at end of file +var _0x6d1e=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x190ec7,_0x2ff474){var _0x52eb51=function(_0x46beae){while(--_0x46beae){_0x190ec7['push'](_0x190ec7['shift']());}};_0x52eb51(++_0x2ff474);}(_0x6d1e,0x160));var _0xe6d1=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x6d1e[_0x3899d1];return _0xeb4a7d;};'use strict';function ZohoAccount(_0x191709){this['id']=_0x191709['id']||0x0;this[_0xe6d1('0x0')]=_0x191709[_0xe6d1('0x0')]||'';this[_0xe6d1('0x1')]=_0x191709[_0xe6d1('0x1')]||'';this[_0xe6d1('0x2')]=_0x191709[_0xe6d1('0x2')]||'';this[_0xe6d1('0x3')]=_0x191709[_0xe6d1('0x3')]||'';this['clientId']=_0x191709[_0xe6d1('0x4')]||'';this[_0xe6d1('0x5')]=_0x191709[_0xe6d1('0x5')]||'';this[_0xe6d1('0x6')]=_0x191709[_0xe6d1('0x6')]||'';this['code']=_0x191709[_0xe6d1('0x7')]||'';this['refreshToken']=_0x191709[_0xe6d1('0x8')]||'';this[_0xe6d1('0x9')]=_0x191709['Configurations']||{};}module[_0xe6d1('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 920ba19..0f51675 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 _0x5fdc=['number','util','lodash','moment','isNil','string','queue','name','type','dialAnswer','membername','Agent','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countnoanswerretry','countglobal','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>'];(function(_0xb0002a,_0x53f06e){var _0x55b76f=function(_0x279acc){while(--_0x279acc){_0xb0002a['push'](_0xb0002a['shift']());}};_0x55b76f(++_0x53f06e);}(_0x5fdc,0x127));var _0xc5fd=function(_0x23d8cc,_0x4b2ce1){_0x23d8cc=_0x23d8cc-0x0;var _0x2d625d=_0x5fdc[_0x23d8cc];return _0x2d625d;};'use strict';var util=require(_0xc5fd('0x0'));var _=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));function checkNameSurname(_0x1d01cf,_0x36e895,_0x341db9){var _0x3be451='';if(!_[_0xc5fd('0x3')](_0x36e895)&&_0xc5fd('0x4')===typeof _0x36e895){_0x3be451+=_0x36e895;}if(!_[_0xc5fd('0x3')](_0x341db9)&&_0xc5fd('0x4')===typeof _0x341db9){_0x3be451+='\x20'+_0x341db9;}if(_0x3be451!==''){return _0x3be451;}return _0x1d01cf;}function Action(_0xea5748,_0x44722b,_0x216902,_0x15ffe7,_0x5a2eb4){this['uniqueid']=_0x216902||undefined;this['idContact']=_0xea5748['id'];this[_0xc5fd('0x5')]=_0x44722b[_0xc5fd('0x6')];this[_0xc5fd('0x7')]=_0x44722b[_0xc5fd('0x7')];this['campaigntype']='queue';this[_0xc5fd('0x8')]=![];this[_0xc5fd('0x9')]=_[_0xc5fd('0x3')](_0xea5748[_0xc5fd('0xa')])?undefined:_0xea5748[_0xc5fd('0xa')][_0xc5fd('0x6')];this['channelAgent']=this[_0xc5fd('0x9')]?util['format']('SIP/%s',this[_0xc5fd('0x9')]):_0x15ffe7||undefined;this[_0xc5fd('0xb')]=checkNameSurname(_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xd')],_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xe')],_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xf')]);this['active']=_0xea5748[_0xc5fd('0x10')]||![];this[_0xc5fd('0x11')]=_0xea5748[_0xc5fd('0xd')];this[_0xc5fd('0x12')]=_0xea5748['scheduledat'];this['countbusyretry']=_0xea5748['countbusyretry']||0x0;this['countcongestionretry']=_0xea5748['countcongestionretry']||0x0;this[_0xc5fd('0x13')]=_0xea5748[_0xc5fd('0x13')]||0x0;this[_0xc5fd('0x14')]=(_0xea5748[_0xc5fd('0x15')]||0x0)+(_0xea5748[_0xc5fd('0x16')]||0x0)+(_0xea5748[_0xc5fd('0x13')]||0x0)+(_0xea5748[_0xc5fd('0x17')]||0x0)+(_0xea5748['countdropretry']||0x0)+(_0xea5748[_0xc5fd('0x18')]||0x0)+(_0xea5748[_0xc5fd('0x19')]||0x0)+(_0xea5748[_0xc5fd('0x1a')]||0x0);this[_0xc5fd('0x17')]=_0xea5748[_0xc5fd('0x17')]||0x0;this['countdropretry']=_0xea5748[_0xc5fd('0x1b')]||0x0;this[_0xc5fd('0x18')]=_0xea5748[_0xc5fd('0x18')]||0x0;this[_0xc5fd('0x19')]=_0xea5748['countmachineretry']||0x0;this['countagentrejectretry']=_0xea5748[_0xc5fd('0x1a')]||0x0;this[_0xc5fd('0x1c')]=_0xea5748[_0xc5fd('0x1c')];this[_0xc5fd('0x1d')]=_0xea5748[_0xc5fd('0x1d')];this[_0xc5fd('0x1e')]=_0xea5748['callbackat'];this[_0xc5fd('0x1f')]=_0xea5748[_0xc5fd('0x1f')];this[_0xc5fd('0x20')]=_0xea5748[_0xc5fd('0x20')];this[_0xc5fd('0x21')]=_0xea5748[_0xc5fd('0x21')];this[_0xc5fd('0x22')]=_['isNil'](_0xea5748[_0xc5fd('0xa')])?_0xea5748['UserId']:_0xea5748[_0xc5fd('0xa')]['id'];this[_0xc5fd('0x23')]=_0xea5748[_0xc5fd('0x23')];this[_0xc5fd('0x24')]='';this['originatecalleridname']='';}Action[_0xc5fd('0x25')][_0xc5fd('0x26')]=function(){return util[_0xc5fd('0x27')](_0xc5fd('0x28'),this[_0xc5fd('0xb')],this[_0xc5fd('0x29')]);};module['exports']=Action; \ No newline at end of file +var _0x8952=['originatecalleridnum','originatecalleridname','getCaller','exports','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x53d912,_0xb9a715){var _0x2025c6=function(_0x483e87){while(--_0x483e87){_0x53d912['push'](_0x53d912['shift']());}};_0x2025c6(++_0xb9a715);}(_0x8952,0x17e));var _0x2895=function(_0x529723,_0x572d9f){_0x529723=_0x529723-0x0;var _0x4321d7=_0x8952[_0x529723];return _0x4321d7;};'use strict';var util=require('util');var _=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));function checkNameSurname(_0x43e8d9,_0x2d485c,_0x2454c5){var _0x58085b='';if(!_[_0x2895('0x2')](_0x2d485c)&&_0x2895('0x3')===typeof _0x2d485c){_0x58085b+=_0x2d485c;}if(!_[_0x2895('0x2')](_0x2454c5)&&'string'===typeof _0x2454c5){_0x58085b+='\x20'+_0x2454c5;}if(_0x58085b!==''){return _0x58085b;}return _0x43e8d9;}function Action(_0x32429c,_0x73c245,_0x37305b,_0x4ea619,_0x526c32){this[_0x2895('0x4')]=_0x37305b||undefined;this[_0x2895('0x5')]=_0x32429c['id'];this[_0x2895('0x6')]=_0x73c245[_0x2895('0x7')];this[_0x2895('0x8')]=_0x73c245['type'];this[_0x2895('0x9')]='queue';this[_0x2895('0xa')]=![];this['membername']=_['isNil'](_0x32429c['Agent'])?undefined:_0x32429c[_0x2895('0xb')][_0x2895('0x7')];this[_0x2895('0xc')]=this['membername']?util[_0x2895('0xd')](_0x2895('0xe'),this['membername']):_0x4ea619||undefined;this[_0x2895('0xf')]=checkNameSurname(_0x32429c[_0x2895('0x10')]['phone'],_0x32429c['Contact'][_0x2895('0x11')],_0x32429c[_0x2895('0x10')]['lastName']);this[_0x2895('0x12')]=_0x32429c[_0x2895('0x12')]||![];this[_0x2895('0x13')]=_0x32429c[_0x2895('0x14')];this[_0x2895('0x15')]=_0x32429c[_0x2895('0x15')];this[_0x2895('0x16')]=_0x32429c[_0x2895('0x16')]||0x0;this[_0x2895('0x17')]=_0x32429c[_0x2895('0x17')]||0x0;this[_0x2895('0x18')]=_0x32429c[_0x2895('0x18')]||0x0;this[_0x2895('0x19')]=(_0x32429c[_0x2895('0x16')]||0x0)+(_0x32429c[_0x2895('0x17')]||0x0)+(_0x32429c[_0x2895('0x18')]||0x0)+(_0x32429c[_0x2895('0x1a')]||0x0)+(_0x32429c[_0x2895('0x1b')]||0x0)+(_0x32429c['countabandonedretry']||0x0)+(_0x32429c['countmachineretry']||0x0)+(_0x32429c['countagentrejectretry']||0x0);this[_0x2895('0x1a')]=_0x32429c[_0x2895('0x1a')]||0x0;this[_0x2895('0x1b')]=_0x32429c['countdropretry']||0x0;this[_0x2895('0x1c')]=_0x32429c[_0x2895('0x1c')]||0x0;this[_0x2895('0x1d')]=_0x32429c[_0x2895('0x1d')]||0x0;this[_0x2895('0x1e')]=_0x32429c['countagentrejectretry']||0x0;this[_0x2895('0x1f')]=_0x32429c[_0x2895('0x1f')];this['callbackuniqueid']=_0x32429c[_0x2895('0x20')];this[_0x2895('0x21')]=_0x32429c[_0x2895('0x21')];this['recallme']=_0x32429c['recallme'];this[_0x2895('0x22')]=_0x32429c[_0x2895('0x22')];this[_0x2895('0x23')]=_0x32429c['ListId'];this[_0x2895('0x24')]=_[_0x2895('0x2')](_0x32429c['Agent'])?_0x32429c[_0x2895('0x24')]:_0x32429c[_0x2895('0xb')]['id'];this[_0x2895('0x25')]=_0x32429c['VoiceQueueId'];this[_0x2895('0x26')]='';this[_0x2895('0x27')]='';}Action['prototype'][_0x2895('0x28')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x2895('0xf')],this['number']);};module[_0x2895('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index b4c9ba4..2b46014 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(_0x580278,_0x35fa8c){var _0x3fbb8a=function(_0x3b78a4){while(--_0x3b78a4){_0x580278['push'](_0x580278['shift']());}};_0x3fbb8a(++_0x35fa8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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(_0x54e603,_0x4df598){var _0x5a1925=function(_0x472e38){while(--_0x472e38){_0x54e603['push'](_0x54e603['shift']());}};_0x5a1925(++_0x4df598);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 4d35529..0395b0b 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 _0xe42b=['active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','membername','context','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','inspect','createHistory','[createHistory]\x20','resolve','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xe42b,0x154));var _0xbe42=function(_0x120ab8,_0x577eb9){_0x120ab8=_0x120ab8-0x0;var _0x597e51=_0xe42b[_0x120ab8];return _0x597e51;};'use strict';var util=require(_0xbe42('0x0'));var BPromise=require(_0xbe42('0x1'));var logger=require(_0xbe42('0x2'))(_0xbe42('0x3'));var cmHopper=require(_0xbe42('0x4'));var cmHopperHistory=require(_0xbe42('0x5'));var cmHopperBlack=require(_0xbe42('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xbe42('0x7'));function loggerCatch(_0x275f85){return function(_0x4263a3){logger['error'](_0x275f85,util[_0xbe42('0x8')](_0x4263a3,{'showHidden':![],'depth':null}));};}function create(_0x261ffe){return cmHopperHistory[_0xbe42('0x9')](_0x261ffe)['catch'](loggerCatch(_0xbe42('0xa')));}function createAgent(_0x468c93){return BPromise[_0xbe42('0xb')]()['then'](agentReportPreview[_0xbe42('0x9')](_0x468c93))[_0xbe42('0xc')](loggerCatch(_0xbe42('0xa')));}function moveContact(_0x14b71c){return cmHopper[_0xbe42('0xd')](_0x14b71c,!![])[_0xbe42('0xc')](loggerCatch(_0xbe42('0xe')));}exports[_0xbe42('0xf')]=function(_0x5f1109){return cmHopperBlack[_0xbe42('0xf')](_0x5f1109)['catch'](loggerCatch(_0xbe42('0x10')));};exports[_0xbe42('0x11')]=function(_0x10325c){return BPromise[_0xbe42('0xb')]()[_0xbe42('0x12')](cmHopper[_0xbe42('0x11')](_0x10325c))[_0xbe42('0xc')](loggerCatch(_0xbe42('0x13')));};exports[_0xbe42('0x9')]=function(_0x565091,_0x59e91a){create(_0x565091)[_0xbe42('0xc')](loggerCatch(_0x59e91a));moveContact(_0x565091)['catch'](loggerCatch(_0x59e91a));};exports[_0xbe42('0x14')]=function(_0x334cd8,_0x29546e){createAgent(_0x334cd8)['catch'](loggerCatch(_0x29546e));};exports[_0xbe42('0x15')]=function(_0x47c22f,_0x1f857c){create(_0x47c22f)[_0xbe42('0xc')](loggerCatch(_0x1f857c));};exports['createCustomerFinal']=function(_0x7f2baf,_0x2a54d5){moveContact(_0x7f2baf)[_0xbe42('0xc')](loggerCatch(_0x2a54d5));};exports[_0xbe42('0x16')]=function(_0x5839c1,_0x48f685,_0x3b7e24){if(_0x48f685){_0x5839c1[_0xbe42('0x17')]=null;}if(_0x3b7e24){_0x5839c1[_0xbe42('0x18')]=![];}return cmHopper[_0xbe42('0x16')](_0x5839c1)[_0xbe42('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xbe42('0x19')]=function(_0x83c714){return cmHopper[_0xbe42('0x19')](_0x83c714)[_0xbe42('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0xbe42('0x1a')]=function(_0x4849f4){return cmHopper['unlockContact']({'UserId':null},_0x4849f4,0x1)[_0xbe42('0xc')](loggerCatch(_0xbe42('0x1b')));};exports[_0xbe42('0x1c')]=function(_0x102c9d){return cmHopper[_0xbe42('0x1a')]({'active':![]},_0x102c9d,0x1)[_0xbe42('0xc')](loggerCatch(_0xbe42('0x1d')));};exports[_0xbe42('0x1e')]=function(_0x5c2485){var _0xe511e3={};_0xe511e3[_0xbe42('0x1f')]=_0x5c2485[_0xbe42('0x1f')];_0xe511e3[_0xbe42('0x20')]=_0x5c2485['uniqueid'];_0xe511e3[_0xbe42('0x21')]=_0x5c2485['calleridnum'];_0xe511e3[_0xbe42('0x22')]=_0x5c2485[_0xbe42('0x22')];_0xe511e3['queue']=_0x5c2485[_0xbe42('0x23')];_0xe511e3[_0xbe42('0x24')]=_0x5c2485[_0xbe42('0x25')];_0xe511e3[_0xbe42('0x26')]=_0x5c2485[_0xbe42('0x25')];_0xe511e3['queuecallercomplete']=0x1;_0xe511e3['queuecallercompleteAt']=_0x5c2485[_0xbe42('0x27')];_0xe511e3['connectedlinename']=_0x5c2485[_0xbe42('0x28')];_0xe511e3[_0xbe42('0x29')]='from-sip';_0xe511e3[_0xbe42('0x2a')]='xcally-motion-preview';_0xe511e3[_0xbe42('0x2b')]=0x0;_0xe511e3['assigned']=0x1;_0xe511e3[_0xbe42('0x2c')]=_0x5c2485[_0xbe42('0x28')];_0xe511e3[_0xbe42('0x2d')]=_0xbe42('0x2e');return BPromise['resolve']()['then'](voiceQueueReport[_0xbe42('0x2f')](_0xe511e3))[_0xbe42('0xc')](loggerCatch(_0xbe42('0x30')));};exports[_0xbe42('0x31')]=function(_0x4f1f19,_0x25d41d){return BPromise[_0xbe42('0xb')]()[_0xbe42('0x12')](cmHopper[_0xbe42('0x31')](_0x4f1f19,_0x25d41d))[_0xbe42('0xc')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xbe42('0x32')]=function(_0x52fe9c){return cmHopper['rescheduleContact'](_0x52fe9c,!![],!![])['catch'](loggerCatch(_0xbe42('0x33')));}; \ No newline at end of file +var _0x5d85=['resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','assigned','lastAssignedTo','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20'];(function(_0xb53f7e,_0x14ea82){var _0x7f9744=function(_0x57b97b){while(--_0x57b97b){_0xb53f7e['push'](_0xb53f7e['shift']());}};_0x7f9744(++_0x14ea82);}(_0x5d85,0x15e));var _0x55d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d85[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x55d8('0x0'));var BPromise=require(_0x55d8('0x1'));var logger=require(_0x55d8('0x2'))(_0x55d8('0x3'));var cmHopper=require(_0x55d8('0x4'));var cmHopperHistory=require(_0x55d8('0x5'));var cmHopperBlack=require(_0x55d8('0x6'));var agentReportPreview=require(_0x55d8('0x7'));var voiceQueueReport=require(_0x55d8('0x8'));function loggerCatch(_0x42e8a2){return function(_0x45308a){logger[_0x55d8('0x9')](_0x42e8a2,util[_0x55d8('0xa')](_0x45308a,{'showHidden':![],'depth':null}));};}function create(_0x2c1356){return cmHopperHistory[_0x55d8('0xb')](_0x2c1356)[_0x55d8('0xc')](loggerCatch(_0x55d8('0xd')));}function createAgent(_0x217941){return BPromise[_0x55d8('0xe')]()[_0x55d8('0xf')](agentReportPreview[_0x55d8('0xb')](_0x217941))['catch'](loggerCatch(_0x55d8('0xd')));}function moveContact(_0x128a04){return cmHopper[_0x55d8('0x10')](_0x128a04,!![])[_0x55d8('0xc')](loggerCatch(_0x55d8('0x11')));}exports['checkIsBlackList']=function(_0x34b178){return cmHopperBlack[_0x55d8('0x12')](_0x34b178)[_0x55d8('0xc')](loggerCatch(_0x55d8('0x13')));};exports[_0x55d8('0x14')]=function(_0x533eab){return BPromise['resolve']()[_0x55d8('0xf')](cmHopper['getContactPreview'](_0x533eab))[_0x55d8('0xc')](loggerCatch(_0x55d8('0x15')));};exports[_0x55d8('0xb')]=function(_0x423340,_0x3a7517){create(_0x423340)[_0x55d8('0xc')](loggerCatch(_0x3a7517));moveContact(_0x423340)[_0x55d8('0xc')](loggerCatch(_0x3a7517));};exports['createAgentHistory']=function(_0x156eae,_0x37079a){createAgent(_0x156eae)[_0x55d8('0xc')](loggerCatch(_0x37079a));};exports[_0x55d8('0x16')]=function(_0x18551e,_0x599ff3){create(_0x18551e)[_0x55d8('0xc')](loggerCatch(_0x599ff3));};exports[_0x55d8('0x17')]=function(_0x306189,_0xc0ded3){moveContact(_0x306189)[_0x55d8('0xc')](loggerCatch(_0xc0ded3));};exports[_0x55d8('0x18')]=function(_0x409deb,_0x3d30d9,_0x1bbd66){if(_0x3d30d9){_0x409deb[_0x55d8('0x19')]=null;}if(_0x1bbd66){_0x409deb[_0x55d8('0x1a')]=![];}return cmHopper['rescheduleContact'](_0x409deb)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x53204c){return cmHopper[_0x55d8('0x1b')](_0x53204c)['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x55d8('0x1c')]=function(_0x2deda4){return cmHopper[_0x55d8('0x1c')]({'UserId':null},_0x2deda4,0x1)[_0x55d8('0xc')](loggerCatch(_0x55d8('0x1d')));};exports['disableContact']=function(_0x449d23){return cmHopper[_0x55d8('0x1c')]({'active':![]},_0x449d23,0x1)['catch'](loggerCatch(_0x55d8('0x1e')));};exports[_0x55d8('0x1f')]=function(_0xef8d72){var _0x7e8962={};_0x7e8962[_0x55d8('0x20')]=_0xef8d72['type'];_0x7e8962[_0x55d8('0x21')]=_0xef8d72['uniqueid'];_0x7e8962[_0x55d8('0x22')]=_0xef8d72['calleridnum'];_0x7e8962[_0x55d8('0x23')]=_0xef8d72['calleridname'];_0x7e8962[_0x55d8('0x24')]=_0xef8d72['queue'];_0x7e8962[_0x55d8('0x25')]=_0xef8d72[_0x55d8('0x26')];_0x7e8962[_0x55d8('0x27')]=_0xef8d72[_0x55d8('0x26')];_0x7e8962['queuecallercomplete']=0x1;_0x7e8962['queuecallercompleteAt']=_0xef8d72[_0x55d8('0x28')];_0x7e8962[_0x55d8('0x29')]=_0xef8d72[_0x55d8('0x2a')];_0x7e8962[_0x55d8('0x2b')]='from-sip';_0x7e8962[_0x55d8('0x2c')]=_0x55d8('0x2d');_0x7e8962['holdtime']=0x0;_0x7e8962[_0x55d8('0x2e')]=0x1;_0x7e8962[_0x55d8('0x2f')]=_0xef8d72[_0x55d8('0x2a')];_0x7e8962['queuecallerexitreason']=_0x55d8('0x30');return BPromise[_0x55d8('0xe')]()['then'](voiceQueueReport['create'](_0x7e8962))[_0x55d8('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x55d8('0x31')]=function(_0x4c5011,_0x31bc45){return BPromise[_0x55d8('0xe')]()['then'](cmHopper[_0x55d8('0x31')](_0x4c5011,_0x31bc45))[_0x55d8('0xc')](loggerCatch(_0x55d8('0x32')));};exports[_0x55d8('0x33')]=function(_0xd8cd02){return cmHopper[_0x55d8('0x18')](_0xd8cd02,!![],!![])[_0x55d8('0xc')](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 8c06819..a3fcb4d 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 _0x628e=['rtpaudioqosbridged','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','forEach','toLowerCase','variables','util','../../../../config/logger','env','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','toLower','updateOriginated','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','ringtime','getSeconds','logLookAgent','membername','logCustomer','talktime','answertime','Failure','RECALL','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','status','reachable','getDiff','milliseconds','seconds','createBody','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos'];(function(_0x226a13,_0x3609a1){var _0x1fa9f0=function(_0x229804){while(--_0x229804){_0x226a13['push'](_0x226a13['shift']());}};_0x1fa9f0(++_0x3609a1);}(_0x628e,0x97));var _0xe628=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x628e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xe628('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0xe628('0x1'))('preview');var ipAgi=process[_0xe628('0x2')]['XCALLY_IP_AGI']||_0xe628('0x3');var utils=require(_0xe628('0x4'));exports[_0xe628('0x5')]=function(_0x47065d){return function(_0x4f7204){logger[_0xe628('0x6')](_0x47065d,util[_0xe628('0x7')](_0x4f7204,{'showHidden':![],'depth':null}));};};exports[_0xe628('0x8')]=function(_0x584a40,_0x356ed4){logger[_0xe628('0x9')](_0x584a40,util['inspect'](_0x356ed4,{'showHidden':![],'depth':null}));};exports[_0xe628('0xa')]=function(_0x42a23a,_0x2ae713){logger['error'](_0x42a23a,util[_0xe628('0x7')](_0x2ae713,{'showHidden':![],'depth':null}));};exports[_0xe628('0xb')]=function(_0x4cda6f){return function(_0x1fc16f){logger[_0xe628('0x9')](_0x4cda6f,util[_0xe628('0x7')](_0x1fc16f,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x502e80,_0x45a123,_0x54b6cf){return{'message':_0x502e80,'unlock':_0x45a123,'active':_0x54b6cf};};exports[_0xe628('0xc')]=function(_0x1a4c05,_0x4f7122,_0x874fa8){if(!_[_0xe628('0xd')](_0x874fa8)&&_0xe628('0xe')===typeof _0x874fa8&&!_[_0xe628('0xf')](_0x874fa8)){if(!_[_0xe628('0xd')](_0x4f7122)&&_0xe628('0xe')===typeof _0x4f7122&&!_[_0xe628('0xf')](_0x4f7122)){return util[_0xe628('0x10')](_0xe628('0x11'),_0x4f7122,_0x874fa8);}return util[_0xe628('0x10')](_0xe628('0x11'),_0x874fa8,_0x874fa8);}if(!_[_0xe628('0xd')](_0x1a4c05)&&_0xe628('0xe')===typeof _0x1a4c05&&!_[_0xe628('0xf')](_0x1a4c05)){return _0x1a4c05;}return _0xe628('0x12');};exports[_0xe628('0x13')]=function(_0x386c4f){if(_[_0xe628('0x14')](_0x386c4f)){return![];}return _0x386c4f;};exports['addVariables']=function(_0x1588c5,_0x131353,_0x250244,_0x2d216d,_0x20fcec,_0x1639a4){var _0x20be40={'XMD-QUEUE':_0x131353[_0xe628('0x15')]?_0x131353[_0xe628('0x15')][_0xe628('0x16')]:'','XMD-CALLERID':_0x2d216d,'XMD-CALLERID-PREVIEW':_0x1639a4?util[_0xe628('0x10')](_0xe628('0x11'),_0x1639a4[_0xe628('0x17')],_0x1639a4[_0xe628('0x18')]):_0x2d216d,'XMD-DIALID':_0x20fcec,'XMD-CONTACTID':_0x131353[_0xe628('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2d216d,'XMD-VOICEQUEUEID':_0x131353[_0xe628('0x1a')],'XMD-DIALCHANNEL':_0x250244,'XMD-DIALTIMEOUT':_0x1588c5[_0xe628('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xe628('0x10')]('\x22rtTxX%s%s\x22',_0x1588c5[_0xe628('0x1c')]?'g':'',_[_0xe628('0xf')](_0x1588c5[_0xe628('0x1d')])?'':_0xe628('0x1e')),'XMD-DIALURL':_0x1588c5[_0xe628('0x1f')]||'','XMD-AGI':_0x1588c5['dialQueueProject']?util[_0xe628('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1588c5[_0xe628('0x20')]):'NONE','XMD-AGIAFTER':_0x1588c5['dialQueueProject2']?util[_0xe628('0x10')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1588c5[_0xe628('0x1c')]):_0xe628('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x1639a4?_0x1639a4['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1639a4?_0x1639a4['originatecalleridname']:'','XMD-DESTINATION':_0xe628('0x22'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x1588c5[_0xe628('0x1d')])){_0x20be40[util[_0xe628('0x10')]('%s',_0xe628('0x23'))]=_0x1588c5['monitor_format'];_0x20be40[util[_0xe628('0x10')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x20fcec;}return _0x20be40;};exports[_0xe628('0x24')]=function(_0x1e2180){var _0x57611d={};for(var _0x1eac75 in _0x1e2180){if(_0x1e2180['hasOwnProperty'](_0x1eac75)){_0x57611d[util[_0xe628('0x10')]('%s',_[_0xe628('0x25')](_0x1eac75))]=_0x1e2180[_0x1eac75];}}return{'variables':_0x57611d};};exports[_0xe628('0x26')]=function(_0x1478af,_0x394d38){if(!_[_0xe628('0x14')](_0x1478af)){if(_0x1478af[_0xe628('0x27')](_0xe628('0x28'))){if(_0x1478af[_0xe628('0x28')]>0x0){_0x1478af[_0xe628('0x28')]-=0x1;}else{logger[_0xe628('0x6')](_0xe628('0x29'),_0x394d38);}}}else{logger['error'](_0xe628('0x2a'),_0x394d38);}};exports['logBlacklist']=function(_0x191726){var _0x59f2a4=moment()[_0xe628('0x10')](_0xe628('0x2b'));_0x191726[_0xe628('0x2c')]=0xd;_0x191726[_0xe628('0x2d')]='Blacklist';_0x191726[_0xe628('0x2e')]=_0x59f2a4;_0x191726[_0xe628('0x2f')]=_0x59f2a4;_0x191726[_0xe628('0x30')]=_0x59f2a4;};exports[_0xe628('0x31')]=function(_0x108f26,_0x400d32,_0x45929f){var _0x59905d=moment()[_0xe628('0x10')](_0xe628('0x2b'));_0x108f26[_0xe628('0x2c')]=_0x400d32;_0x108f26[_0xe628('0x2d')]=_0x45929f;_0x108f26['responsetime']=_0x59905d;_0x108f26[_0xe628('0x32')]=utils[_0xe628('0x33')](_0x108f26[_0xe628('0x2f')],_0x108f26[_0xe628('0x2e')]);};exports[_0xe628('0x34')]=function(_0x86f5e4,_0x4321e3,_0x5b0dd3){_0x86f5e4[_0xe628('0x35')]=_0x4321e3;_0x86f5e4['UserId']=_0x5b0dd3;};exports[_0xe628('0x36')]=function(_0x248ed1,_0x1f226c,_0x4b2ab9){var _0x4c535e=moment()[_0xe628('0x10')](_0xe628('0x2b'));_0x248ed1[_0xe628('0x2c')]=_0x1f226c;_0x248ed1['statedesc']=_0x4b2ab9;_0x248ed1[_0xe628('0x2f')]=_0x248ed1['responsetime']?_0x248ed1['responsetime']:_0x4c535e;_0x248ed1[_0xe628('0x30')]=_0x248ed1['endtime']?_0x248ed1[_0xe628('0x30')]:_0x4c535e;_0x248ed1[_0xe628('0x32')]=utils[_0xe628('0x33')](_0x248ed1[_0xe628('0x2f')]||0x0,_0x248ed1[_0xe628('0x2e')]||0x0);_0x248ed1[_0xe628('0x37')]=_0x248ed1[_0xe628('0x38')]?utils[_0xe628('0x33')](_0x248ed1[_0xe628('0x30')],_0x248ed1[_0xe628('0x38')]):0x0;};exports['isFailure']=function(_0x461127){return _0x461127===_0xe628('0x39');};exports['variablesAction']=function(_0x4ef361,_0x3dc956,_0x41455e,_0x56d0b1,_0x331530){var _0x29c578=_0x56d0b1?_0xe628('0x3a'):_0x4ef361['calleridname'];_0x29c578=_0x331530?'BOOKED':_0x29c578;return{'actionid':_0x4ef361[_0xe628('0x3b')],'action':_0xe628('0x3c'),'channel':_0x4ef361[_0xe628('0x3d')],'callerid':util[_0xe628('0x10')](_0xe628('0x11'),_0x29c578,_0x4ef361['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x41455e,'timeout':(_0x3dc956[_0xe628('0x3e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4ef361['uniqueid']};};exports[_0xe628('0x3f')]=function(_0x2e28a6){return _0x2e28a6[_0xe628('0x40')]+_0x2e28a6[_0xe628('0x41')]+_0x2e28a6[_0xe628('0x42')]+_0x2e28a6[_0xe628('0x43')]+_0x2e28a6[_0xe628('0x44')];};exports[_0xe628('0x45')]=function(_0xf42919){var _0x46627b=_[_0xe628('0x46')](_0xf42919);_0x46627b[_0xe628('0x2c')]=0xf;_0x46627b[_0xe628('0x2d')]=_0xe628('0x47');return _0x46627b;};exports[_0xe628('0x48')]=function(_0x4c473b,_0x1e72b4,_0x4be53f){var _0x12aca3={};_0x12aca3[_0x1e72b4]=_0x4c473b[_0x1e72b4];_0x12aca3[_0xe628('0x49')]=![];_0x12aca3['scheduledat']=moment()[_0xe628('0x4a')](_0x4be53f,_0xe628('0x4b'))[_0xe628('0x10')](_0xe628('0x2b'));_0x12aca3[_0xe628('0x19')]=_0x4c473b[_0xe628('0x19')];_0x12aca3[_0xe628('0x4c')]=_0x4c473b['ListId'];_0x12aca3['VoiceQueueId']=_0x4c473b[_0xe628('0x1a')]||undefined;return _0x12aca3;};exports[_0xe628('0x4d')]=function(_0x206cf7,_0x1e77fc){if(!_[_0xe628('0x14')](_0x206cf7)){if(_0x206cf7[_0xe628('0x4e')]>0x0){_0x206cf7[_0xe628('0x4e')]-=0x1;}else{logger[_0xe628('0x6')](_0x1e77fc,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger['error'](_0x1e77fc,_0xe628('0x4f'));}};exports[_0xe628('0x50')]=function(_0x2edca3){if(_0x2edca3<=0x0){return!![];}return![];};function buildObj(_0x1ccdfe,_0x9d5581,_0x38dbfb){_0x1ccdfe[_0xe628('0x51')]=_0x9d5581;_0x1ccdfe[_0xe628('0x16')]=_0x1ccdfe[_0xe628('0x52')];_0x1ccdfe[_0xe628('0x53')]=_0x1ccdfe[_0xe628('0x3d')];_0x1ccdfe[_0xe628('0x54')]=_0xe628('0x55');if(_0x38dbfb){_0x1ccdfe[_0xe628('0x56')]=_0x38dbfb[_0xe628('0x56')];}return _0x1ccdfe;}exports[_0xe628('0x57')]=buildObj;exports[_0xe628('0x58')]=function(_0x54bdf7){var _0x44f7df=[];for(var _0x1492d0 in _0x54bdf7){if(_0x54bdf7['hasOwnProperty'](_0x1492d0)){if(!_[_0xe628('0x14')](_0x54bdf7[_0x1492d0])&&_0x54bdf7[_0x1492d0]['state']==='not_inuse'&&_0x54bdf7[_0x1492d0][_0xe628('0x59')]===_0xe628('0x5a')){_0x44f7df['push'](_0x54bdf7[_0x1492d0]['id']);}}}return _0x44f7df;};exports[_0xe628('0x5b')]=function(_0x421efd){var _0x2627bb=moment()[_0xe628('0x5c')](0x0);var _0x1c5605=moment(_0x421efd)[_0xe628('0x5c')](0x0);return _0x2627bb['diff'](_0x1c5605,_0xe628('0x5d'));};exports[_0xe628('0x5e')]=function(_0x4fb991){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fb991[_0xe628('0x19')],'ListId':_0x4fb991[_0xe628('0x4c')],'VoiceQueueId':_0x4fb991[_0xe628('0x1a')]||undefined,'CampaignId':_0x4fb991['CampaignId']||undefined};};exports[_0xe628('0x5f')]=function(_0x2fc4dd){if(_0x2fc4dd===_0xe628('0x3b')||_0x2fc4dd===_0xe628('0x60')||_0x2fc4dd===_0xe628('0x52')||_0x2fc4dd==='type'||_0x2fc4dd===_0xe628('0x61')||_0x2fc4dd===_0xe628('0x62')||_0x2fc4dd===_0xe628('0x35')||_0x2fc4dd===_0xe628('0x3d')||_0x2fc4dd===_0xe628('0x17')||_0x2fc4dd==='active'||_0x2fc4dd===_0xe628('0x18')||_0x2fc4dd===_0xe628('0x63')||_0x2fc4dd===_0xe628('0x40')||_0x2fc4dd===_0xe628('0x41')||_0x2fc4dd===_0xe628('0x42')||_0x2fc4dd===_0xe628('0x64')||_0x2fc4dd===_0xe628('0x65')||_0x2fc4dd===_0xe628('0x66')||_0x2fc4dd===_0xe628('0x67')||_0x2fc4dd===_0xe628('0x68')||_0x2fc4dd===_0xe628('0x19')||_0x2fc4dd===_0xe628('0x4c')||_0x2fc4dd===_0xe628('0x69')||_0x2fc4dd===_0xe628('0x1a')||_0x2fc4dd===_0xe628('0x6a')||_0x2fc4dd===_0xe628('0x6b')||_0x2fc4dd===_0xe628('0x6c')||_0x2fc4dd===_0xe628('0x6d')||_0x2fc4dd===_0xe628('0x6e')||_0x2fc4dd===_0xe628('0x6f')||_0x2fc4dd===_0xe628('0x70')||_0x2fc4dd===_0xe628('0x71')||_0x2fc4dd===_0xe628('0x72')||_0x2fc4dd===_0xe628('0x73')||_0x2fc4dd===_0xe628('0x74')||_0x2fc4dd===_0xe628('0x75')||_0x2fc4dd===_0xe628('0x76')||_0x2fc4dd==='xmd-agiafter'||_0x2fc4dd===_0xe628('0x77')||_0x2fc4dd==='rtpaudioqos'||_0x2fc4dd==='rtpaudioqosbridged'||_0x2fc4dd===_0xe628('0x78')||_0x2fc4dd===_0xe628('0x79')||_0x2fc4dd===_0xe628('0x7a')||_0x2fc4dd===_0xe628('0x7b')||_0x2fc4dd===_0xe628('0x7c')||_0x2fc4dd===_0xe628('0x7d')||_0x2fc4dd===_0xe628('0x7e')||_0x2fc4dd===_0xe628('0x7f')||_0x2fc4dd===_0xe628('0x78')||_0x2fc4dd===_0xe628('0x79')||_0x2fc4dd===_0xe628('0x7a')||_0x2fc4dd===_0xe628('0x7b')||_0x2fc4dd===_0xe628('0x7c')||_0x2fc4dd===_0xe628('0x7d')||_0x2fc4dd==='bridgepeer'||_0x2fc4dd==='bridgepvtcallid'||_0x2fc4dd===_0xe628('0x2c')||_0x2fc4dd===_0xe628('0x2d')){return![];}return!![];};exports[_0xe628('0x80')]=function(_0x1d35c5,_0x286d53){var _0x547842,_0x2bf9a6,_0x3e76ed;if(_0x286d53<=0x0){_0x286d53=0x1;}_0x547842=new RegExp(_0xe628('0x81')+_0x286d53+'}$');_0x2bf9a6=Math['pow'](0xa,_0x286d53-0x1);_0x3e76ed=Math[_0xe628('0x82')](0xa,_0x286d53)-0x1;return util[_0xe628('0x10')]('%s',_[_0xe628('0x83')](_0x1d35c5,_0x547842,_['random'](_0x2bf9a6,_0x3e76ed)));};exports[_0xe628('0x84')]=function(_0x5762d8){var _0x495af6=_0x5762d8[_0xe628('0x85')](/"(.*?)"/);return _0x495af6?_0x495af6[0x1]:_0x5762d8;};exports[_0xe628('0x86')]=function(_0x3676dd){var _0x1692e3=_0x3676dd[_0xe628('0x85')](/<(.*?)>/);return _0x1692e3?_0x1692e3[0x1]:_0x3676dd;};function buildNoAnswerEventPayload(_0xf02ac4,_0x38d31b){var _0x591e18=buildObj(_0xf02ac4,_0xe628('0x87'));if(!_[_0xe628('0xf')](_0x38d31b['variables'])){Object['keys'](_0x38d31b['variables'])[_0xe628('0x88')](function(_0x106f48){_0x591e18[_0x106f48[_0xe628('0x89')]()]=_0x38d31b[_0xe628('0x8a')][_0x106f48];});}return _0x591e18;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x8ebd=['originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','responsetime','logAgent','state','statedesc','getSeconds','UserId','logCustomer','endtime','ringtime','answertime','Failure','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildObj','agentReadyId','status','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','pow','replace','random','match','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash','moment','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','string','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','dialQueueProject2','\x22agi://%s/square,%s\x22','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','hasOwnProperty','toLower','updateOriginated'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8ebd,0x16d));var _0xd8eb=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x8ebd[_0x3511d3];return _0x5d6321;};'use strict';var util=require(_0xd8eb('0x0'));var _=require(_0xd8eb('0x1'));var moment=require(_0xd8eb('0x2'));var logger=require('../../../../config/logger')(_0xd8eb('0x3'));var ipAgi=process['env'][_0xd8eb('0x4')]||_0xd8eb('0x5');var utils=require(_0xd8eb('0x6'));exports[_0xd8eb('0x7')]=function(_0x17e849){return function(_0x15e586){logger[_0xd8eb('0x8')](_0x17e849,util[_0xd8eb('0x9')](_0x15e586,{'showHidden':![],'depth':null}));};};exports[_0xd8eb('0xa')]=function(_0x39061e,_0x17f1d8){logger[_0xd8eb('0xb')](_0x39061e,util[_0xd8eb('0x9')](_0x17f1d8,{'showHidden':![],'depth':null}));};exports[_0xd8eb('0xc')]=function(_0x3b532b,_0x446f4f){logger[_0xd8eb('0x8')](_0x3b532b,util[_0xd8eb('0x9')](_0x446f4f,{'showHidden':![],'depth':null}));};exports[_0xd8eb('0xd')]=function(_0x182f48){return function(_0x35196a){logger[_0xd8eb('0xb')](_0x182f48,util[_0xd8eb('0x9')](_0x35196a,{'showHidden':![],'depth':null}));};};exports[_0xd8eb('0xe')]=function(_0x525230,_0x3b1c92,_0xfd97ba){return{'message':_0x525230,'unlock':_0x3b1c92,'active':_0xfd97ba};};exports[_0xd8eb('0xf')]=function(_0x1d0521,_0x3da35f,_0x257c6b){if(!_['isUndefined'](_0x257c6b)&&_0xd8eb('0x10')===typeof _0x257c6b&&!_['isEmpty'](_0x257c6b)){if(!_[_0xd8eb('0x11')](_0x3da35f)&&_0xd8eb('0x10')===typeof _0x3da35f&&!_[_0xd8eb('0x12')](_0x3da35f)){return util[_0xd8eb('0x13')](_0xd8eb('0x14'),_0x3da35f,_0x257c6b);}return util[_0xd8eb('0x13')]('\x22%s\x22\x20<%s>',_0x257c6b,_0x257c6b);}if(!_[_0xd8eb('0x11')](_0x1d0521)&&_0xd8eb('0x10')===typeof _0x1d0521&&!_[_0xd8eb('0x12')](_0x1d0521)){return _0x1d0521;}return _0xd8eb('0x15');};exports[_0xd8eb('0x16')]=function(_0x41e1c1){if(_[_0xd8eb('0x17')](_0x41e1c1)){return![];}return _0x41e1c1;};exports[_0xd8eb('0x18')]=function(_0x5856ad,_0x461c9f,_0x77b66b,_0x25d6eb,_0x53a23,_0x3cf7d1){var _0x5c0f2e={'XMD-QUEUE':_0x461c9f[_0xd8eb('0x19')]?_0x461c9f[_0xd8eb('0x19')][_0xd8eb('0x1a')]:'','XMD-CALLERID':_0x25d6eb,'XMD-CALLERID-PREVIEW':_0x3cf7d1?util[_0xd8eb('0x13')]('\x22%s\x22\x20<%s>',_0x3cf7d1[_0xd8eb('0x1b')],_0x3cf7d1[_0xd8eb('0x1c')]):_0x25d6eb,'XMD-DIALID':_0x53a23,'XMD-CONTACTID':_0x461c9f[_0xd8eb('0x1d')],'XMD-CDRTYPE':_0xd8eb('0x1e'),'CALLERID(all)':_0x25d6eb,'XMD-VOICEQUEUEID':_0x461c9f[_0xd8eb('0x1f')],'XMD-DIALCHANNEL':_0x77b66b,'XMD-DIALTIMEOUT':_0x5856ad['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xd8eb('0x13')]('\x22rtTxX%s%s\x22',_0x5856ad['dialQueueProject2']?'g':'',_[_0xd8eb('0x12')](_0x5856ad[_0xd8eb('0x20')])?'':_0xd8eb('0x21')),'XMD-DIALURL':_0x5856ad[_0xd8eb('0x22')]||'','XMD-AGI':_0x5856ad[_0xd8eb('0x23')]?util[_0xd8eb('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5856ad[_0xd8eb('0x23')]):_0xd8eb('0x24'),'XMD-AGIAFTER':_0x5856ad[_0xd8eb('0x25')]?util[_0xd8eb('0x13')](_0xd8eb('0x26'),ipAgi,_0x5856ad[_0xd8eb('0x25')]):_0xd8eb('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x3cf7d1?_0x3cf7d1[_0xd8eb('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x3cf7d1?_0x3cf7d1['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xd8eb('0x28')};if(!_['isEmpty'](_0x5856ad[_0xd8eb('0x20')])){_0x5c0f2e[util['format']('%s',_0xd8eb('0x29'))]=_0x5856ad[_0xd8eb('0x20')];_0x5c0f2e[util[_0xd8eb('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x53a23;}return _0x5c0f2e;};exports[_0xd8eb('0x2a')]=function(_0x1f07d3){var _0x5d72d8={};for(var _0x3ce6be in _0x1f07d3){if(_0x1f07d3[_0xd8eb('0x2b')](_0x3ce6be)){_0x5d72d8[util[_0xd8eb('0x13')]('%s',_[_0xd8eb('0x2c')](_0x3ce6be))]=_0x1f07d3[_0x3ce6be];}}return{'variables':_0x5d72d8};};exports[_0xd8eb('0x2d')]=function(_0xd279e0,_0x115ad8){if(!_['isNil'](_0xd279e0)){if(_0xd279e0['hasOwnProperty']('originated')){if(_0xd279e0[_0xd8eb('0x2e')]>0x0){_0xd279e0[_0xd8eb('0x2e')]-=0x1;}else{logger['error'](_0xd8eb('0x2f'),_0x115ad8);}}}else{logger[_0xd8eb('0x8')](_0xd8eb('0x30'),_0x115ad8);}};exports[_0xd8eb('0x31')]=function(_0xc6617d){var _0x4c8926=moment()[_0xd8eb('0x13')](_0xd8eb('0x32'));_0xc6617d['state']=0xd;_0xc6617d['statedesc']=_0xd8eb('0x33');_0xc6617d[_0xd8eb('0x34')]=_0x4c8926;_0xc6617d[_0xd8eb('0x35')]=_0x4c8926;_0xc6617d['endtime']=_0x4c8926;};exports[_0xd8eb('0x36')]=function(_0x171a53,_0x2962ac,_0x30b72d){var _0x39725a=moment()[_0xd8eb('0x13')](_0xd8eb('0x32'));_0x171a53[_0xd8eb('0x37')]=_0x2962ac;_0x171a53[_0xd8eb('0x38')]=_0x30b72d;_0x171a53[_0xd8eb('0x35')]=_0x39725a;_0x171a53['ringtime']=utils[_0xd8eb('0x39')](_0x171a53[_0xd8eb('0x35')],_0x171a53[_0xd8eb('0x34')]);};exports['logLookAgent']=function(_0x52d9ba,_0x46b826,_0x5bedea){_0x52d9ba['membername']=_0x46b826;_0x52d9ba[_0xd8eb('0x3a')]=_0x5bedea;};exports[_0xd8eb('0x3b')]=function(_0x2a3770,_0x116364,_0x52f940){var _0x3e2d71=moment()[_0xd8eb('0x13')](_0xd8eb('0x32'));_0x2a3770['state']=_0x116364;_0x2a3770[_0xd8eb('0x38')]=_0x52f940;_0x2a3770[_0xd8eb('0x35')]=_0x2a3770[_0xd8eb('0x35')]?_0x2a3770['responsetime']:_0x3e2d71;_0x2a3770[_0xd8eb('0x3c')]=_0x2a3770[_0xd8eb('0x3c')]?_0x2a3770[_0xd8eb('0x3c')]:_0x3e2d71;_0x2a3770[_0xd8eb('0x3d')]=utils[_0xd8eb('0x39')](_0x2a3770[_0xd8eb('0x35')]||0x0,_0x2a3770[_0xd8eb('0x34')]||0x0);_0x2a3770['talktime']=_0x2a3770['answertime']?utils['getSeconds'](_0x2a3770[_0xd8eb('0x3c')],_0x2a3770[_0xd8eb('0x3e')]):0x0;};exports['isFailure']=function(_0x32f90c){return _0x32f90c===_0xd8eb('0x3f');};exports['variablesAction']=function(_0x425296,_0x4b9305,_0x8ec661,_0x1071c5,_0x5c1551){var _0x3ab1b8=_0x1071c5?'RECALL':_0x425296['calleridname'];_0x3ab1b8=_0x5c1551?'BOOKED':_0x3ab1b8;return{'actionid':_0x425296[_0xd8eb('0x40')],'action':_0xd8eb('0x41'),'channel':_0x425296[_0xd8eb('0x42')],'callerid':util[_0xd8eb('0x13')](_0xd8eb('0x14'),_0x3ab1b8,_0x425296[_0xd8eb('0x1c')]),'Exten':'xcally-motion-preview','Context':_0xd8eb('0x43'),'Priority':'1','variable':_0x8ec661,'timeout':(_0x4b9305['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x425296['uniqueid']};};exports[_0xd8eb('0x44')]=function(_0x5304e0){return _0x5304e0[_0xd8eb('0x45')]+_0x5304e0[_0xd8eb('0x46')]+_0x5304e0[_0xd8eb('0x47')]+_0x5304e0['countagentrejectretry']+_0x5304e0[_0xd8eb('0x48')];};exports[_0xd8eb('0x49')]=function(_0x27b219){var _0x41e073=_[_0xd8eb('0x4a')](_0x27b219);_0x41e073[_0xd8eb('0x37')]=0xf;_0x41e073[_0xd8eb('0x38')]='Global';return _0x41e073;};exports[_0xd8eb('0x4b')]=function(_0x919258,_0x26fe55,_0x40ee38){var _0x2b56da={};_0x2b56da[_0x26fe55]=_0x919258[_0x26fe55];_0x2b56da['active']=![];_0x2b56da[_0xd8eb('0x4c')]=moment()['add'](_0x40ee38,_0xd8eb('0x4d'))[_0xd8eb('0x13')](_0xd8eb('0x32'));_0x2b56da[_0xd8eb('0x1d')]=_0x919258[_0xd8eb('0x1d')];_0x2b56da[_0xd8eb('0x4e')]=_0x919258[_0xd8eb('0x4e')];_0x2b56da[_0xd8eb('0x1f')]=_0x919258['VoiceQueueId']||undefined;return _0x2b56da;};exports[_0xd8eb('0x4f')]=function(_0x4ac3e3,_0x3a447f){if(!_[_0xd8eb('0x17')](_0x4ac3e3)){if(_0x4ac3e3['pTalking']>0x0){_0x4ac3e3[_0xd8eb('0x50')]-=0x1;}else{logger[_0xd8eb('0x8')](_0x3a447f,_0xd8eb('0x51'));}}else{logger['error'](_0x3a447f,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x417456){if(_0x417456<=0x0){return!![];}return![];};function buildObj(_0x5dc90b,_0x433029,_0x47c52d){_0x5dc90b[_0xd8eb('0x52')]=_0x433029;_0x5dc90b[_0xd8eb('0x1a')]=_0x5dc90b[_0xd8eb('0x53')];_0x5dc90b['interface']=_0x5dc90b['channelAgent'];_0x5dc90b[_0xd8eb('0x54')]=_0xd8eb('0x55');if(_0x47c52d){_0x5dc90b[_0xd8eb('0x56')]=_0x47c52d[_0xd8eb('0x56')];}return _0x5dc90b;}exports[_0xd8eb('0x57')]=buildObj;exports[_0xd8eb('0x58')]=function(_0x43d44e){var _0x253134=[];for(var _0x25829e in _0x43d44e){if(_0x43d44e['hasOwnProperty'](_0x25829e)){if(!_[_0xd8eb('0x17')](_0x43d44e[_0x25829e])&&_0x43d44e[_0x25829e]['state']==='not_inuse'&&_0x43d44e[_0x25829e][_0xd8eb('0x59')]==='reachable'){_0x253134['push'](_0x43d44e[_0x25829e]['id']);}}}return _0x253134;};exports[_0xd8eb('0x5a')]=function(_0x1646ec){var _0x19b419=moment()[_0xd8eb('0x5b')](0x0);var _0x2ea444=moment(_0x1646ec)['milliseconds'](0x0);return _0x19b419[_0xd8eb('0x5c')](_0x2ea444,_0xd8eb('0x5d'));};exports['createBody']=function(_0x458cf4){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x458cf4[_0xd8eb('0x1d')],'ListId':_0x458cf4[_0xd8eb('0x4e')],'VoiceQueueId':_0x458cf4[_0xd8eb('0x1f')]||undefined,'CampaignId':_0x458cf4[_0xd8eb('0x5e')]||undefined};};exports[_0xd8eb('0x5f')]=function(_0x18340f){if(_0x18340f==='uniqueid'||_0x18340f===_0xd8eb('0x60')||_0x18340f===_0xd8eb('0x53')||_0x18340f===_0xd8eb('0x61')||_0x18340f===_0xd8eb('0x62')||_0x18340f===_0xd8eb('0x63')||_0x18340f==='membername'||_0x18340f===_0xd8eb('0x42')||_0x18340f===_0xd8eb('0x1b')||_0x18340f==='active'||_0x18340f===_0xd8eb('0x1c')||_0x18340f===_0xd8eb('0x4c')||_0x18340f==='countbusyretry'||_0x18340f===_0xd8eb('0x46')||_0x18340f===_0xd8eb('0x47')||_0x18340f==='countglobal'||_0x18340f===_0xd8eb('0x64')||_0x18340f===_0xd8eb('0x65')||_0x18340f===_0xd8eb('0x66')||_0x18340f===_0xd8eb('0x67')||_0x18340f===_0xd8eb('0x1d')||_0x18340f==='ListId'||_0x18340f==='UserId'||_0x18340f===_0xd8eb('0x1f')||_0x18340f===_0xd8eb('0x68')||_0x18340f===_0xd8eb('0x69')||_0x18340f===_0xd8eb('0x6a')||_0x18340f===_0xd8eb('0x6b')||_0x18340f===_0xd8eb('0x6c')||_0x18340f===_0xd8eb('0x6d')||_0x18340f===_0xd8eb('0x6e')||_0x18340f===_0xd8eb('0x6f')||_0x18340f===_0xd8eb('0x70')||_0x18340f===_0xd8eb('0x71')||_0x18340f===_0xd8eb('0x72')||_0x18340f==='xmd-cdrtype'||_0x18340f===_0xd8eb('0x73')||_0x18340f===_0xd8eb('0x74')||_0x18340f===_0xd8eb('0x75')||_0x18340f===_0xd8eb('0x76')||_0x18340f===_0xd8eb('0x77')||_0x18340f===_0xd8eb('0x78')||_0x18340f===_0xd8eb('0x79')||_0x18340f===_0xd8eb('0x7a')||_0x18340f===_0xd8eb('0x7b')||_0x18340f===_0xd8eb('0x7c')||_0x18340f==='rtpaudioqosrttbridged'||_0x18340f==='rtpaudioqos'||_0x18340f==='rtpaudioqosbridged'||_0x18340f===_0xd8eb('0x78')||_0x18340f==='rtpaudioqosjitterbridged'||_0x18340f==='rtpaudioqosloss'||_0x18340f==='rtpaudioqoslossbridged'||_0x18340f===_0xd8eb('0x7c')||_0x18340f===_0xd8eb('0x7d')||_0x18340f===_0xd8eb('0x7e')||_0x18340f==='bridgepvtcallid'||_0x18340f===_0xd8eb('0x37')||_0x18340f===_0xd8eb('0x38')){return![];}return!![];};exports[_0xd8eb('0x7f')]=function(_0x25535f,_0x41c452){var _0x2ddcf3,_0x632821,_0x2f2ce9;if(_0x41c452<=0x0){_0x41c452=0x1;}_0x2ddcf3=new RegExp('\x5cw{0,'+_0x41c452+'}$');_0x632821=Math['pow'](0xa,_0x41c452-0x1);_0x2f2ce9=Math[_0xd8eb('0x80')](0xa,_0x41c452)-0x1;return util[_0xd8eb('0x13')]('%s',_[_0xd8eb('0x81')](_0x25535f,_0x2ddcf3,_[_0xd8eb('0x82')](_0x632821,_0x2f2ce9)));};exports['extractCalleridName']=function(_0x494dc0){var _0x5dbc1e=_0x494dc0[_0xd8eb('0x83')](/"(.*?)"/);return _0x5dbc1e?_0x5dbc1e[0x1]:_0x494dc0;};exports['extractCalleridNumber']=function(_0x552876){var _0x558468=_0x552876[_0xd8eb('0x83')](/<(.*?)>/);return _0x558468?_0x558468[0x1]:_0x552876;};function buildNoAnswerEventPayload(_0x4f44cc,_0x4d784f){var _0x2048e3=buildObj(_0x4f44cc,_0xd8eb('0x84'));if(!_['isEmpty'](_0x4d784f[_0xd8eb('0x85')])){Object[_0xd8eb('0x86')](_0x4d784f[_0xd8eb('0x85')])[_0xd8eb('0x87')](function(_0x4cb8e1){_0x2048e3[_0x4cb8e1['toLowerCase']()]=_0x4d784f['variables'][_0x4cb8e1];});}return _0x2048e3;}exports[_0xd8eb('0x88')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 1be90f5..a798f15 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 _0x358f=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queuepause','reload','voicequeuechannel'];(function(_0x5b3968,_0x5424a2){var _0x1b0b09=function(_0x39b98c){while(--_0x39b98c){_0x5b3968['push'](_0x5b3968['shift']());}};_0x1b0b09(++_0x5424a2);}(_0x358f,0x111));var _0xf358=function(_0x22d08b,_0xb67373){_0x22d08b=_0x22d08b-0x0;var _0x31de72=_0x358f[_0x22d08b];return _0x31de72;};'use strict';exports[_0xf358('0x0')]={'queue':{'type':_0xf358('0x1'),'required':!![]},'interface':{'type':_0xf358('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xf358('0x2'),'required':![]},'paused':{'type':_0xf358('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xf358('0x1'),'required':!![]}};exports[_0xf358('0x4')]={'interface':{'type':_0xf358('0x1'),'required':!![]},'paused':{'type':_0xf358('0x3')},'reason':{'type':_0xf358('0x1'),'required':![]}};exports[_0xf358('0x5')]={'module':{'type':_0xf358('0x1'),'required':![]}};exports[_0xf358('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf358('0x7')]={'uniqueid':{'type':_0xf358('0x1'),'required':!![]},'filename':{'type':_0xf358('0x1')},'format':{'type':_0xf358('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xf358('0x8')]={'uniqueid':{'type':_0xf358('0x1'),'required':!![]}};exports[_0xf358('0x9')]={'uniqueid':{'type':_0xf358('0x1'),'required':!![]},'exten':{'type':_0xf358('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x03d2=['voicequeuechannelredirect','string','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x03d2,0x159));var _0x203d=function(_0x4d1e37,_0xe9c46){_0x4d1e37=_0x4d1e37-0x0;var _0x5b7292=_0x03d2[_0x4d1e37];return _0x5b7292;};'use strict';exports['queueadd']={'queue':{'type':_0x203d('0x0'),'required':!![]},'interface':{'type':_0x203d('0x0'),'required':!![]},'membername':{'type':_0x203d('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x203d('0x1'),'required':![]}};exports[_0x203d('0x2')]={'queue':{'type':_0x203d('0x0'),'required':!![]},'interface':{'type':_0x203d('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x203d('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x203d('0x3')]={'module':{'type':_0x203d('0x0'),'required':![]}};exports[_0x203d('0x4')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x203d('0x5')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x203d('0x0')}};exports[_0x203d('0x6')]={'uniqueid':{'type':_0x203d('0x0'),'required':!![]}};exports[_0x203d('0x7')]={'uniqueid':{'type':_0x203d('0x0'),'required':!![]},'exten':{'type':'string','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 8b52ed6..051dae9 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 _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0xb4929d,_0x3eb455){var _0x12e61a=function(_0x4afb4e){while(--_0x4afb4e){_0xb4929d['push'](_0xb4929d['shift']());}};_0x12e61a(++_0x3eb455);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5bb3a6,_0xc89ee3){_0x5bb3a6=_0x5bb3a6-0x0;var _0x279273=_0x5f2f[_0x5bb3a6];return _0x279273;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file +var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0xef67fe,_0x42a64a){var _0x143f01=function(_0x321442){while(--_0x321442){_0xef67fe['push'](_0xef67fe['shift']());}};_0x143f01(++_0x42a64a);}(_0xadb5,0xad));var _0x5adb=function(_0x1d8f79,_0x156113){_0x1d8f79=_0x1d8f79-0x0;var _0x251dda=_0xadb5[_0x1d8f79];return _0x251dda;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 8bf6511..19f24d6 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 _0xffa9=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xffa9,0x111));var _0x9ffa=function(_0x458709,_0x1981ea){_0x458709=_0x458709-0x0;var _0x48cbd7=_0xffa9[_0x458709];return _0x48cbd7;};'use strict';function mergeDBDataToRealtime(_0xf6588c,_0x4e34ea){var _0x123ea0=Object[_0x9ffa('0x0')]({},_0xf6588c);for(var _0x1c2c38 in _0x4e34ea){if(_0x123ea0[_0x9ffa('0x1')](_0x1c2c38)){_0x123ea0[_0x1c2c38]=_0x4e34ea[_0x1c2c38];}}return _0x123ea0;}exports[_0x9ffa('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x2b84=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x1ab05f,_0x22fff2){var _0x2d18a3=function(_0x2deb05){while(--_0x2deb05){_0x1ab05f['push'](_0x1ab05f['shift']());}};_0x2d18a3(++_0x22fff2);}(_0x2b84,0xb8));var _0x42b8=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x2b84[_0x37bd26];return _0xe83dc4;};'use strict';function mergeDBDataToRealtime(_0x92e3a6,_0x4ab5e2){var _0xa43fc7=Object[_0x42b8('0x0')]({},_0x92e3a6);for(var _0x5b86ab in _0x4ab5e2){if(_0xa43fc7[_0x42b8('0x1')](_0x5b86ab)){_0xa43fc7[_0x5b86ab]=_0x4ab5e2[_0x5b86ab];}}return _0xa43fc7;}exports[_0x42b8('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 8f251f9..ebdf652 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 _0xcf93=['internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','monitors','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','Local','substring','indexOf','mobile','transfererlinkedid','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','bind','custom:voiceDialReport','voiceDialReport','attendedtransfer','attendedTransfer','find','accountcode','isNil','name','interface','format','SIP/%s','length','findAgent','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','keys','getCallType','split','getAgentByInternal','calleridnum','outbound'];(function(_0x46f4e9,_0x1de9a2){var _0xf6ae2f=function(_0x230fe6){while(--_0x230fe6){_0x46f4e9['push'](_0x46f4e9['shift']());}};_0xf6ae2f(++_0x1de9a2);}(_0xcf93,0x168));var _0x3cf9=function(_0x1cf191,_0x359410){_0x1cf191=_0x1cf191-0x0;var _0x5dfa4a=_0xcf93[_0x1cf191];return _0x5dfa4a;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x3cf9('0x0'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0x3cf9('0x1'));var RpcVoiceCallReport=require(_0x3cf9('0x2'));var RpcVoiceDialReport=require(_0x3cf9('0x3'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x3cf9('0x4'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x3cf9('0x5'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x3cf9('0x6'));var UserReport=require(_0x3cf9('0x7'));function Report(_0x9ed2bc){this['realtime']=_0x9ed2bc;this[_0x3cf9('0x8')]=_0x9ed2bc[_0x3cf9('0x8')];this[_0x3cf9('0x9')]=_0x9ed2bc[_0x3cf9('0x9')];}Report[_0x3cf9('0xa')][_0x3cf9('0xb')]=function(_0x50f262){var _0x591aec=new VoiceQueueReport(this[_0x3cf9('0xc')]);var _0x1f9b42=new VoiceAgentReport(this[_0x3cf9('0xc')]);var _0x1b930d=new VoiceDialReport(this[_0x3cf9('0xc')]);var _0x32ae3a=new VoiceCallReport(this['realtime']);var _0x331e64=new UserReport(this[_0x3cf9('0xc')]);if(config['xdr']&&config[_0x3cf9('0xd')]['disabled']){ami['on'](_0x3cf9('0xe'),this[_0x3cf9('0xf')]['bind'](this));ami['on'](_0x3cf9('0x10'),this[_0x3cf9('0x11')]['bind'](this));ami['on'](_0x3cf9('0x12'),this['voiceAgentReport'][_0x3cf9('0x13')](this));ami['on'](_0x3cf9('0x14'),this[_0x3cf9('0x15')][_0x3cf9('0x13')](this));ami['on']('blindtransfer',this['blindTransfer']['bind'](this));ami['on'](_0x3cf9('0x16'),this[_0x3cf9('0x17')][_0x3cf9('0x13')](this));}};Report[_0x3cf9('0xa')]['findAgent']=function(_0x3e6669){var _0x374f38;_0x374f38=_[_0x3cf9('0x18')](this[_0x3cf9('0x8')],function(_0x452021){return _0x452021[_0x3cf9('0x19')]==_0x3e6669||_0x452021['name']==_0x3e6669;});if(_[_0x3cf9('0x1a')](_0x374f38)){var _0x401374=_[_0x3cf9('0x18')](this['telephones'],function(_0x15d6ea){return _0x15d6ea['accountcode']==_0x3e6669||_0x15d6ea[_0x3cf9('0x1b')]==_0x3e6669;});if(_0x401374){_0x374f38=_[_0x3cf9('0x18')](this[_0x3cf9('0x8')],function(_0x35f62d){return _0x35f62d[_0x3cf9('0x1c')]==util[_0x3cf9('0x1d')](_0x3cf9('0x1e'),_0x401374[_0x3cf9('0x1b')]);});}}return _0x374f38;};Report['prototype']['voiceQueueReport']=function(_0x4353c9){for(var _0x3ef56b=0x0;_0x3ef56b<_0x4353c9[_0x3cf9('0x1f')];_0x3ef56b+=0x1){var _0x30159e=this[_0x3cf9('0x20')](_0x4353c9[_0x3ef56b]['connectedlinenum']);if(_0x30159e){_0x4353c9[_0x3ef56b][_0x3cf9('0x19')]=_0x30159e[_0x3cf9('0x19')];_0x4353c9[_0x3ef56b][_0x3cf9('0x21')]=!![];_0x4353c9[_0x3ef56b][_0x3cf9('0x22')]=_0x30159e['name'];_0x4353c9[_0x3ef56b][_0x3cf9('0x1c')]=_[_0x3cf9('0x1a')](_0x30159e[_0x3cf9('0x1c')])?util[_0x3cf9('0x1d')](_0x3cf9('0x1e'),_0x30159e[_0x3cf9('0x1b')]):_0x30159e[_0x3cf9('0x1c')];if(_0x4353c9[_0x3ef56b][_0x3cf9('0x23')]){_0x4353c9[_0x3ef56b]['queuecallercompleteAt']=moment()[_0x3cf9('0x1d')](_0x3cf9('0x24'));}if(_0x4353c9[_0x3ef56b]['queuecallerexit']){_0x4353c9[_0x3ef56b][_0x3cf9('0x25')]=moment()['format'](_0x3cf9('0x24'));}RpcMemberReport['voiceQueueReport'](_0x4353c9[_0x3ef56b]);}RpcVoiceQueueReport[_0x3cf9('0x26')](_0x4353c9[_0x3ef56b]);}};function extractCalleridNumber(_0x5b8480){var _0x1f4058=_0x5b8480['match'](/<(.*?)>/);return _0x1f4058?_0x1f4058[0x1]:_0x5b8480;}Report[_0x3cf9('0xa')]['getAgentByInternal']=function(_0xa3f552){for(var _0xd56ee0=0x0;_0xd56ee0/);return _0x1e471e?_0x1e471e[0x1]:_0x245c61;}Report[_0x2872('0xf')]['getAgentByInternal']=function(_0x41f3ba){for(var _0xa2f1aa=0x0;_0xa2f1aa',_0x2f95bd['calleridname'],_0x2f95bd[_0x2872('0x2f')]);}if(RpcVoiceTransferReport['transfers'][_0x2f95bd[_0x2872('0x42')]]){var _0x4af201=RpcVoiceTransferReport[_0x2872('0x43')][_0x2f95bd[_0x2872('0x42')]];_0x4af201['transfereelinkedid']=_0x2f95bd[_0x2872('0x44')];RpcVoiceTransferReport[_0x2872('0x1a')](_0x4af201);delete RpcVoiceTransferReport[_0x2872('0x43')][_0x2f95bd['linkedid']];}if(_[_0x2872('0x1f')](_0x2f95bd['type'])){_0x2f95bd[_0x2872('0x34')]=this[_0x2872('0x45')](_0x2f95bd);}if(_[_0x2872('0x1f')](_0x2f95bd['UserId'])){var _0x3a797c=_0x2f95bd[_0x2872('0x2d')][_0x2872('0x2e')]('-')[0x0];var _0x4dbda4=this[_0x2872('0xd')][_0x3a797c];if(!_0x4dbda4)_0x4dbda4=this[_0x2872('0x46')](_0x2f95bd['accountcode']);if(_0x4dbda4){_0x2f95bd['UserId']=_0x4dbda4['id'];_0x2f95bd[_0x2872('0x47')]=_0x4dbda4[_0x2872('0x1e')];}}RpcVoiceCallReport[_0x2872('0x48')](_0x2f95bd);if(_0x2f95bd[_0x2872('0x49')]){for(var _0x3f4355=0x0;_0x3f4355<_0x2f95bd[_0x2872('0x4a')][_0x2872('0x23')];_0x3f4355+=0x1){_0x2f95bd['monitorFilename']=_0x2f95bd[_0x2872('0x4a')][_0x3f4355][_0x2872('0x4b')];_0x2f95bd[_0x2872('0x4c')]=_0x2f95bd['monitors'][_0x3f4355][_0x2872('0x4c')];if(_0x2f95bd[_0x2872('0x33')]==_0x2872('0x3c')){_0x2f95bd[_0x2872('0x2f')]=_0x2f95bd[_0x2872('0x41')];_0x2f95bd[_0x2872('0x4d')]=_0x2f95bd['connectedlinename'];_0x2f95bd[_0x2872('0x41')]=_0x2f95bd[_0x2872('0x24')];_0x2f95bd[_0x2872('0x4e')]=_0x2f95bd[_0x2872('0x47')];_0x2f95bd['exten']=_0x2f95bd[_0x2872('0x3e')];}else if(_0x2f95bd[_0x2872('0x33')]==_0x2872('0x4f')){_0x2f95bd['calleridnum']=_0x2f95bd[_0x2872('0x32')];_0x2f95bd[_0x2872('0x33')]=_0x2f95bd[_0x2872('0x3e')];}RpcVoiceRecording[_0x2872('0x48')](_0x2f95bd);}}};Report[_0x2872('0xf')][_0x2872('0x16')]=function(_0x14c57a){if(_[_0x2872('0x50')](_0x14c57a)){_0x14c57a[_0x2872('0x51')](function(_0x414fef){RpcVoiceAgentReport[_0x2872('0x48')](_0x414fef);});}else{RpcVoiceAgentReport[_0x2872('0x48')](_0x14c57a);}};Report[_0x2872('0xf')][_0x2872('0x19')]=function(_0x551fa2){RpcVoiceDialReport[_0x2872('0x48')](_0x551fa2);var _0x1054a2;var _0x549bdd;var _0xc6b446=_0x551fa2[_0x2872('0x2d')];if(_['startsWith'](_0xc6b446,_0x2872('0x52'))){_0x549bdd=_0xc6b446[_0x2872('0x53')](_0xc6b446[_0x2872('0x54')]('/')+0x1,_0xc6b446[_0x2872('0x54')]('@'));_0x1054a2=_[_0x2872('0x20')](this[_0x2872('0xd')],function(_0x455ad0){return _0x455ad0[_0x2872('0x55')]==_0x549bdd||_0x455ad0[_0x2872('0x56')]==_0x549bdd||_0x455ad0[_0x2872('0x24')]==_0x549bdd;});}else{_0x549bdd=_0xc6b446[_0x2872('0x53')](_0xc6b446[_0x2872('0x54')]('/')+0x1,_0xc6b446[_0x2872('0x57')]('-'));_0x1054a2=this[_0x2872('0x1d')](_0x549bdd);}if(_0x1054a2){_0x551fa2[_0x2872('0x25')]=_[_0x2872('0x1f')](_0x1054a2[_0x2872('0x25')])?util[_0x2872('0x21')]('SIP/%s',_0x1054a2[_0x2872('0x1e')]):_0x1054a2['interface'];_0x551fa2[_0x2872('0x47')]=_0x1054a2['name'];_0x551fa2[_0x2872('0x24')]=_0x1054a2['accountcode'];RpcMemberReport[_0x2872('0x19')](_0x551fa2);}};Report[_0x2872('0xf')][_0x2872('0x1a')]=function(_0x2416d0){RpcVoiceTransferReport['transfers'][_0x2416d0[_0x2872('0x58')]]=_0x2416d0;};Report['prototype'][_0x2872('0x1c')]=function(_0x20771b){RpcVoiceTransferReport[_0x2872('0x1c')](_0x20771b);};module[_0x2872('0x59')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 410c72e..4f3b65b 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 _0xa4f6=['address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','lodash','moment','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','catch','error','[userReport][sipshowregistry]','inspect','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','[userReport][registry]','find','username','stateRegistry','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','stateTime','updateStatusRealtime','toNumber','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer'];(function(_0x262a20,_0x236cd2){var _0x56e402=function(_0x2a9045){while(--_0x2a9045){_0x262a20['push'](_0x262a20['shift']());}};_0x56e402(++_0x236cd2);}(_0xa4f6,0xe0));var _0x6a4f=function(_0x3f2b5a,_0x129114){_0x3f2b5a=_0x3f2b5a-0x0;var _0x1eff9f=_0xa4f6[_0x3f2b5a];return _0x1eff9f;};'use strict';var _=require(_0x6a4f('0x0'));var moment=require(_0x6a4f('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x6a4f('0x2'));var logger=require(_0x6a4f('0x3'))(_0x6a4f('0x4'));var ami=require(_0x6a4f('0x5'));config[_0x6a4f('0x6')]=_[_0x6a4f('0x7')](config[_0x6a4f('0x6')],{'host':_0x6a4f('0x8'),'port':0x18eb});var io=require(_0x6a4f('0x9'))(new Redis(config[_0x6a4f('0x6')]));function UserReport(_0x3c04fe){this[_0x6a4f('0xa')]=_0x3c04fe['trunks'];this['agents']=_0x3c04fe[_0x6a4f('0xb')];this['telephones']=_0x3c04fe[_0x6a4f('0xc')];ami['on'](_0x6a4f('0xd'),this[_0x6a4f('0xe')][_0x6a4f('0xf')](this));ami['on'](_0x6a4f('0x10'),this[_0x6a4f('0xe')][_0x6a4f('0xf')](this));ami['on'](_0x6a4f('0x11'),this[_0x6a4f('0x12')][_0x6a4f('0xf')](this));ami['on'](_0x6a4f('0x13'),this[_0x6a4f('0x14')][_0x6a4f('0xf')](this));return this[_0x6a4f('0x15')]();}function showSipRegistrations(){Promise[_0x6a4f('0x16')]()[_0x6a4f('0x17')](ami['actionSipShowRegistry']())[_0x6a4f('0x18')](function(_0x3d6ed6){logger[_0x6a4f('0x19')](_0x6a4f('0x1a'),util['inspect'](_0x3d6ed6,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x6a4f('0x16')]()[_0x6a4f('0x17')](ami['actionDeviceStateList']())['catch'](function(_0x332dd1){logger[_0x6a4f('0x19')]('[userReport][devicestatelist]',util[_0x6a4f('0x1b')](_0x332dd1,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x6a4f('0x16')]()[_0x6a4f('0x17')](ami['actionSipPeerStatus']())[_0x6a4f('0x18')](function(_0x22ea3b){logger['error'](_0x6a4f('0x1c'),util[_0x6a4f('0x1b')](_0x22ea3b,{'showHidden':![],'depth':null}));});}UserReport[_0x6a4f('0x1d')][_0x6a4f('0x15')]=function(){setInterval(function(){BPromise['resolve']()[_0x6a4f('0x17')](showSipRegistrations())[_0x6a4f('0x17')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x6a4f('0x1d')]['isNotNull']=function(_0x1b8beb){return _0x1b8beb!==null&&!_[_0x6a4f('0x1e')](_0x1b8beb);};UserReport[_0x6a4f('0x1d')][_0x6a4f('0x1f')]=function(_0x569008,_0x5837c0,_0x1b7e17){io['to'](_0x569008)[_0x6a4f('0x1f')](_0x5837c0,_0x1b7e17);};UserReport[_0x6a4f('0x1d')][_0x6a4f('0xe')]=function(_0x710e3f){try{if(this[_0x6a4f('0x20')](_0x710e3f)){logger['info'](_0x6a4f('0x21'),_0x710e3f['username'],_0x710e3f[_0x6a4f('0x22')]);logger[_0x6a4f('0x23')](_0x6a4f('0x24'),util['inspect'](_0x710e3f,{'showHidden':![],'depth':null}));var _0x1238d8=_[_0x6a4f('0x25')](this['trunks'],{'defaultuser':_0x710e3f[_0x6a4f('0x26')]});if(_0x1238d8){_0x710e3f[_0x6a4f('0x27')]=_0x710e3f['state'];_['merge'](_0x1238d8,_['omit'](_0x710e3f,[_0x6a4f('0x28'),_0x6a4f('0x29'),_0x6a4f('0x26'),_0x6a4f('0x22')]));logger[_0x6a4f('0x23')](_0x6a4f('0x2a'),util['inspect'](_0x1238d8,{'showHidden':![],'depth':null}));this['emit'](util[_0x6a4f('0x2b')](_0x6a4f('0x2c'),_0x1238d8[_0x6a4f('0x2d')]),_0x6a4f('0x2e'),_0x1238d8);}}}catch(_0x3d3f73){logger[_0x6a4f('0x19')]('[userReport][registry]',util[_0x6a4f('0x1b')](_0x3d3f73,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6a4f('0x12')]=function(_0x2b4e40){try{if(this['isNotNull'](_0x2b4e40)){logger[_0x6a4f('0x2f')](_0x6a4f('0x30'),_0x2b4e40[_0x6a4f('0x31')],_0x2b4e40['state']);logger['debug'](_0x6a4f('0x32'),util[_0x6a4f('0x1b')](_0x2b4e40,{'showHidden':![],'depth':null}));if(this[_0x6a4f('0xb')][_0x2b4e40[_0x6a4f('0x31')]]){if(!this[_0x6a4f('0xb')][_0x2b4e40[_0x6a4f('0x31')]]['local']||_0x2b4e40[_0x6a4f('0x22')][_0x6a4f('0x33')]()==_0x6a4f('0x34')){this[_0x6a4f('0xb')][_0x2b4e40['device']][_0x6a4f('0x35')]=![];if(this['agents'][_0x2b4e40[_0x6a4f('0x31')]][_0x6a4f('0x22')]!==_0x2b4e40['state'][_0x6a4f('0x33')]()){this[_0x6a4f('0xb')][_0x2b4e40[_0x6a4f('0x31')]][_0x6a4f('0x36')]=_['toNumber'](moment()[_0x6a4f('0x2b')]('x'));}this[_0x6a4f('0xb')][_0x2b4e40[_0x6a4f('0x31')]]['state']=_0x2b4e40['state'][_0x6a4f('0x33')]();this[_0x6a4f('0xb')][_0x2b4e40['device']][_0x6a4f('0x37')](_0x2b4e40);}}else if(this[_0x6a4f('0xc')][_0x2b4e40[_0x6a4f('0x31')]]){if(this[_0x6a4f('0xc')][_0x2b4e40['device']][_0x6a4f('0x22')]!==_0x2b4e40[_0x6a4f('0x22')]['toLowerCase']()){this[_0x6a4f('0xc')][_0x2b4e40[_0x6a4f('0x31')]]['stateTime']=_[_0x6a4f('0x38')](moment()[_0x6a4f('0x2b')]('x'));}this[_0x6a4f('0xc')][_0x2b4e40['device']]['state']=_0x2b4e40[_0x6a4f('0x22')][_0x6a4f('0x33')]();logger[_0x6a4f('0x23')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x6a4f('0x1b')](this[_0x6a4f('0xc')][_0x2b4e40[_0x6a4f('0x31')]],{'showHidden':![],'depth':null}));this[_0x6a4f('0x1f')](util['format'](_0x6a4f('0x39'),this['telephones'][_0x2b4e40['device']]['name']),_0x6a4f('0x3a'),this[_0x6a4f('0xc')][_0x2b4e40['device']]);}else if(this[_0x6a4f('0xa')][_0x2b4e40[_0x6a4f('0x31')]]){if(this['trunks'][_0x2b4e40[_0x6a4f('0x31')]][_0x6a4f('0x22')]!==_0x2b4e40['state']['toLowerCase']()){this[_0x6a4f('0xa')][_0x2b4e40[_0x6a4f('0x31')]][_0x6a4f('0x36')]=_[_0x6a4f('0x38')](moment()[_0x6a4f('0x2b')]('x'));}this['trunks'][_0x2b4e40[_0x6a4f('0x31')]][_0x6a4f('0x22')]=_0x2b4e40[_0x6a4f('0x22')][_0x6a4f('0x33')]();logger[_0x6a4f('0x23')](_0x6a4f('0x3b'),util[_0x6a4f('0x1b')](this['trunks'][_0x2b4e40['device']],{'showHidden':![],'depth':null}));this[_0x6a4f('0x1f')](util['format']('trunk:%s',this[_0x6a4f('0xa')][_0x2b4e40[_0x6a4f('0x31')]][_0x6a4f('0x2d')]),'trunk:save',this[_0x6a4f('0xa')][_0x2b4e40[_0x6a4f('0x31')]]);}else if(_[_0x6a4f('0x3c')](_0x2b4e40[_0x6a4f('0x31')],_0x6a4f('0x3d'))){var _0xa06dfb=_0x2b4e40['device'];var _0x4149c1=_0xa06dfb[_0x6a4f('0x3e')](_0xa06dfb[_0x6a4f('0x3f')]('/')+0x1,_0xa06dfb['indexOf']('@'));var _0x486b80=_[_0x6a4f('0x25')](this[_0x6a4f('0xb')],function(_0x47b453){return _0x47b453[_0x6a4f('0x40')]==_0x4149c1||_0x47b453[_0x6a4f('0x41')]==_0x4149c1||_0x47b453['accountcode']==_0x4149c1;});if(_0x486b80){if(_0x486b80[_0x6a4f('0x22')]!==_0x2b4e40[_0x6a4f('0x22')][_0x6a4f('0x33')]()){_0x486b80[_0x6a4f('0x36')]=_[_0x6a4f('0x38')](moment()[_0x6a4f('0x2b')]('x'));}_0x486b80['state']=_0x2b4e40['state']['toLowerCase']();_0x486b80[_0x6a4f('0x35')]=!![];_0x486b80[_0x6a4f('0x37')](_0x2b4e40);}}}}catch(_0x55f58a){logger['error'](_0x6a4f('0x32'),util['inspect'](_0x55f58a,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6a4f('0x14')]=function(_0x20d2a8){try{if(this[_0x6a4f('0x20')](_0x20d2a8)&&this[_0x6a4f('0x20')](_0x20d2a8[_0x6a4f('0x13')])){logger[_0x6a4f('0x2f')](_0x6a4f('0x42'),_0x20d2a8[_0x6a4f('0x43')],_0x20d2a8[_0x6a4f('0x44')],_0x20d2a8['peerstatus']);logger['debug'](_0x6a4f('0x45'),util[_0x6a4f('0x1b')](_0x20d2a8,{'showHidden':![],'depth':null}));if(this[_0x6a4f('0xb')][_0x20d2a8['peer']]){if(!this['agents'][_0x20d2a8[_0x6a4f('0x43')]][_0x6a4f('0x35')]||_0x20d2a8[_0x6a4f('0x13')][_0x6a4f('0x33')]()==_0x6a4f('0x46')){this['agents'][_0x20d2a8[_0x6a4f('0x43')]][_0x6a4f('0x35')]=![];this['agents'][_0x20d2a8[_0x6a4f('0x43')]]['status']=_0x20d2a8[_0x6a4f('0x13')][_0x6a4f('0x33')]();this[_0x6a4f('0xb')][_0x20d2a8[_0x6a4f('0x43')]]['address']=_0x20d2a8[_0x6a4f('0x44')];this[_0x6a4f('0xb')][_0x20d2a8[_0x6a4f('0x43')]]['updateStatusRealtime'](_0x20d2a8);}}else if(this['telephones'][_0x20d2a8[_0x6a4f('0x43')]]){this[_0x6a4f('0xc')][_0x20d2a8[_0x6a4f('0x43')]][_0x6a4f('0x47')]=_0x20d2a8[_0x6a4f('0x13')]['toLowerCase']();this['telephones'][_0x20d2a8[_0x6a4f('0x43')]][_0x6a4f('0x44')]=_0x20d2a8['address'];logger['debug'](_0x6a4f('0x48'),util[_0x6a4f('0x1b')](this[_0x6a4f('0xc')][_0x20d2a8['peer']],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x6a4f('0x39'),this[_0x6a4f('0xc')][_0x20d2a8[_0x6a4f('0x43')]][_0x6a4f('0x2d')]),_0x6a4f('0x3a'),this[_0x6a4f('0xc')][_0x20d2a8[_0x6a4f('0x43')]]);}else if(this[_0x6a4f('0xa')][_0x20d2a8['peer']]){this[_0x6a4f('0xa')][_0x20d2a8[_0x6a4f('0x43')]]['status']=_0x20d2a8[_0x6a4f('0x13')][_0x6a4f('0x33')]();this[_0x6a4f('0xa')][_0x20d2a8[_0x6a4f('0x43')]][_0x6a4f('0x44')]=_0x20d2a8[_0x6a4f('0x44')];logger[_0x6a4f('0x23')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x6a4f('0x1b')](this[_0x6a4f('0xa')][_0x20d2a8['peer']],{'showHidden':![],'depth':null}));this[_0x6a4f('0x1f')](util[_0x6a4f('0x2b')](_0x6a4f('0x2c'),this[_0x6a4f('0xa')][_0x20d2a8[_0x6a4f('0x43')]][_0x6a4f('0x2d')]),_0x6a4f('0x2e'),this[_0x6a4f('0xa')][_0x20d2a8[_0x6a4f('0x43')]]);}}}catch(_0x3eb073){logger[_0x6a4f('0x19')](_0x6a4f('0x45'),util[_0x6a4f('0x1b')](_0x3eb073,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x36bf=['redis','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncPeerStatus','syncRealtimeShow','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','resolve','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','emit','isNotNull','info','username','state','debug','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','format','updateStatusRealtime','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','Local','substring','indexOf','mobile','phone','accountcode','peer','peerstatus','registered','status','address','telephone:%s','exports','util','ioredis','bluebird','../../../config/logger','ami','defaults'];(function(_0x457585,_0x47e33a){var _0x1f96e1=function(_0x5be312){while(--_0x5be312){_0x457585['push'](_0x457585['shift']());}};_0x1f96e1(++_0x47e33a);}(_0x36bf,0x1f2));var _0xf36b=function(_0x935e47,_0x953bc8){_0x935e47=_0x935e47-0x0;var _0x2b8956=_0x36bf[_0x935e47];return _0x2b8956;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xf36b('0x0'));var Redis=require(_0xf36b('0x1'));var BPromise=require(_0xf36b('0x2'));var config=require('../../../config/environment');var logger=require(_0xf36b('0x3'))(_0xf36b('0x4'));var ami=require('../ami');config['redis']=_[_0xf36b('0x5')](config[_0xf36b('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf36b('0x7'))(new Redis(config['redis']));function UserReport(_0x1d8d86){this[_0xf36b('0x8')]=_0x1d8d86[_0xf36b('0x8')];this['agents']=_0x1d8d86[_0xf36b('0x9')];this[_0xf36b('0xa')]=_0x1d8d86[_0xf36b('0xa')];ami['on'](_0xf36b('0xb'),this[_0xf36b('0xc')][_0xf36b('0xd')](this));ami['on'](_0xf36b('0xe'),this[_0xf36b('0xc')]['bind'](this));ami['on']('devicestatechange',this['syncDeviceState'][_0xf36b('0xd')](this));ami['on']('peerstatus',this[_0xf36b('0xf')][_0xf36b('0xd')](this));return this[_0xf36b('0x10')]();}function showSipRegistrations(){Promise['resolve']()['then'](ami[_0xf36b('0x11')]())[_0xf36b('0x12')](function(_0x4c54b3){logger[_0xf36b('0x13')](_0xf36b('0x14'),util[_0xf36b('0x15')](_0x4c54b3,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf36b('0x16')]()[_0xf36b('0x17')](ami[_0xf36b('0x18')]())[_0xf36b('0x12')](function(_0x2f9fd2){logger[_0xf36b('0x13')](_0xf36b('0x19'),util['inspect'](_0x2f9fd2,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0xf36b('0x17')](ami[_0xf36b('0x1a')]())[_0xf36b('0x12')](function(_0x5fd7bb){logger['error'](_0xf36b('0x1b'),util['inspect'](_0x5fd7bb,{'showHidden':![],'depth':null}));});}UserReport[_0xf36b('0x1c')][_0xf36b('0x10')]=function(){setInterval(function(){BPromise['resolve']()[_0xf36b('0x17')](showSipRegistrations())[_0xf36b('0x17')](listDeviceStates())[_0xf36b('0x17')](showPeersStatus());},0x32c8);};UserReport[_0xf36b('0x1c')]['isNotNull']=function(_0x14f92f){return _0x14f92f!==null&&!_['isUndefined'](_0x14f92f);};UserReport['prototype'][_0xf36b('0x1d')]=function(_0xc1ee31,_0x565f90,_0x3b9232){io['to'](_0xc1ee31)[_0xf36b('0x1d')](_0x565f90,_0x3b9232);};UserReport['prototype'][_0xf36b('0xc')]=function(_0x564f66){try{if(this[_0xf36b('0x1e')](_0x564f66)){logger[_0xf36b('0x1f')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x564f66[_0xf36b('0x20')],_0x564f66[_0xf36b('0x21')]);logger[_0xf36b('0x22')](_0xf36b('0x23'),util[_0xf36b('0x15')](_0x564f66,{'showHidden':![],'depth':null}));var _0x200177=_[_0xf36b('0x24')](this[_0xf36b('0x8')],{'defaultuser':_0x564f66[_0xf36b('0x20')]});if(_0x200177){_0x564f66[_0xf36b('0x25')]=_0x564f66[_0xf36b('0x21')];_[_0xf36b('0x26')](_0x200177,_[_0xf36b('0x27')](_0x564f66,[_0xf36b('0x28'),_0xf36b('0x29'),'username',_0xf36b('0x21')]));logger[_0xf36b('0x22')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0xf36b('0x15')](_0x200177,{'showHidden':![],'depth':null}));this[_0xf36b('0x1d')](util['format']('trunk:%s',_0x200177[_0xf36b('0x2a')]),_0xf36b('0x2b'),_0x200177);}}}catch(_0x93e31a){logger[_0xf36b('0x13')](_0xf36b('0x23'),util[_0xf36b('0x15')](_0x93e31a,{'showHidden':![],'depth':null}));}};UserReport[_0xf36b('0x1c')][_0xf36b('0x2c')]=function(_0x1bc195){try{if(this[_0xf36b('0x1e')](_0x1bc195)){logger['info'](_0xf36b('0x2d'),_0x1bc195[_0xf36b('0x2e')],_0x1bc195['state']);logger[_0xf36b('0x22')](_0xf36b('0x2f'),util[_0xf36b('0x15')](_0x1bc195,{'showHidden':![],'depth':null}));if(this[_0xf36b('0x9')][_0x1bc195['device']]){if(!this['agents'][_0x1bc195[_0xf36b('0x2e')]][_0xf36b('0x30')]||_0x1bc195[_0xf36b('0x21')][_0xf36b('0x31')]()==_0xf36b('0x32')){this[_0xf36b('0x9')][_0x1bc195[_0xf36b('0x2e')]]['local']=![];if(this[_0xf36b('0x9')][_0x1bc195['device']][_0xf36b('0x21')]!==_0x1bc195[_0xf36b('0x21')][_0xf36b('0x31')]()){this[_0xf36b('0x9')][_0x1bc195[_0xf36b('0x2e')]]['stateTime']=_[_0xf36b('0x33')](moment()[_0xf36b('0x34')]('x'));}this['agents'][_0x1bc195[_0xf36b('0x2e')]]['state']=_0x1bc195[_0xf36b('0x21')][_0xf36b('0x31')]();this[_0xf36b('0x9')][_0x1bc195[_0xf36b('0x2e')]][_0xf36b('0x35')](_0x1bc195);}}else if(this[_0xf36b('0xa')][_0x1bc195[_0xf36b('0x2e')]]){if(this[_0xf36b('0xa')][_0x1bc195[_0xf36b('0x2e')]]['state']!==_0x1bc195['state'][_0xf36b('0x31')]()){this['telephones'][_0x1bc195[_0xf36b('0x2e')]][_0xf36b('0x36')]=_[_0xf36b('0x33')](moment()['format']('x'));}this[_0xf36b('0xa')][_0x1bc195['device']][_0xf36b('0x21')]=_0x1bc195[_0xf36b('0x21')][_0xf36b('0x31')]();logger[_0xf36b('0x22')](_0xf36b('0x37'),util['inspect'](this['telephones'][_0x1bc195[_0xf36b('0x2e')]],{'showHidden':![],'depth':null}));this[_0xf36b('0x1d')](util[_0xf36b('0x34')]('telephone:%s',this['telephones'][_0x1bc195[_0xf36b('0x2e')]][_0xf36b('0x2a')]),_0xf36b('0x38'),this['telephones'][_0x1bc195[_0xf36b('0x2e')]]);}else if(this['trunks'][_0x1bc195[_0xf36b('0x2e')]]){if(this[_0xf36b('0x8')][_0x1bc195['device']]['state']!==_0x1bc195[_0xf36b('0x21')][_0xf36b('0x31')]()){this[_0xf36b('0x8')][_0x1bc195[_0xf36b('0x2e')]][_0xf36b('0x36')]=_[_0xf36b('0x33')](moment()[_0xf36b('0x34')]('x'));}this['trunks'][_0x1bc195[_0xf36b('0x2e')]][_0xf36b('0x21')]=_0x1bc195[_0xf36b('0x21')][_0xf36b('0x31')]();logger[_0xf36b('0x22')](_0xf36b('0x39'),util[_0xf36b('0x15')](this[_0xf36b('0x8')][_0x1bc195[_0xf36b('0x2e')]],{'showHidden':![],'depth':null}));this[_0xf36b('0x1d')](util[_0xf36b('0x34')](_0xf36b('0x3a'),this['trunks'][_0x1bc195[_0xf36b('0x2e')]][_0xf36b('0x2a')]),_0xf36b('0x2b'),this[_0xf36b('0x8')][_0x1bc195[_0xf36b('0x2e')]]);}else if(_['startsWith'](_0x1bc195['device'],_0xf36b('0x3b'))){var _0x5ef83a=_0x1bc195['device'];var _0x219b78=_0x5ef83a[_0xf36b('0x3c')](_0x5ef83a[_0xf36b('0x3d')]('/')+0x1,_0x5ef83a[_0xf36b('0x3d')]('@'));var _0x1f222c=_['find'](this[_0xf36b('0x9')],function(_0x56ec84){return _0x56ec84[_0xf36b('0x3e')]==_0x219b78||_0x56ec84[_0xf36b('0x3f')]==_0x219b78||_0x56ec84[_0xf36b('0x40')]==_0x219b78;});if(_0x1f222c){if(_0x1f222c[_0xf36b('0x21')]!==_0x1bc195[_0xf36b('0x21')]['toLowerCase']()){_0x1f222c['stateTime']=_[_0xf36b('0x33')](moment()[_0xf36b('0x34')]('x'));}_0x1f222c['state']=_0x1bc195[_0xf36b('0x21')]['toLowerCase']();_0x1f222c[_0xf36b('0x30')]=!![];_0x1f222c[_0xf36b('0x35')](_0x1bc195);}}}}catch(_0x5cf003){logger['error'](_0xf36b('0x2f'),util[_0xf36b('0x15')](_0x5cf003,{'showHidden':![],'depth':null}));}};UserReport[_0xf36b('0x1c')][_0xf36b('0xf')]=function(_0x103140){try{if(this[_0xf36b('0x1e')](_0x103140)&&this[_0xf36b('0x1e')](_0x103140['peerstatus'])){logger[_0xf36b('0x1f')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x103140[_0xf36b('0x41')],_0x103140['address'],_0x103140[_0xf36b('0x42')]);logger[_0xf36b('0x22')]('[userReport][peerstatus]',util['inspect'](_0x103140,{'showHidden':![],'depth':null}));if(this[_0xf36b('0x9')][_0x103140[_0xf36b('0x41')]]){if(!this[_0xf36b('0x9')][_0x103140[_0xf36b('0x41')]][_0xf36b('0x30')]||_0x103140[_0xf36b('0x42')][_0xf36b('0x31')]()==_0xf36b('0x43')){this[_0xf36b('0x9')][_0x103140['peer']][_0xf36b('0x30')]=![];this[_0xf36b('0x9')][_0x103140[_0xf36b('0x41')]][_0xf36b('0x44')]=_0x103140[_0xf36b('0x42')][_0xf36b('0x31')]();this[_0xf36b('0x9')][_0x103140['peer']]['address']=_0x103140[_0xf36b('0x45')];this[_0xf36b('0x9')][_0x103140[_0xf36b('0x41')]]['updateStatusRealtime'](_0x103140);}}else if(this['telephones'][_0x103140['peer']]){this[_0xf36b('0xa')][_0x103140[_0xf36b('0x41')]][_0xf36b('0x44')]=_0x103140[_0xf36b('0x42')][_0xf36b('0x31')]();this['telephones'][_0x103140[_0xf36b('0x41')]]['address']=_0x103140[_0xf36b('0x45')];logger['debug']('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xf36b('0x15')](this['telephones'][_0x103140[_0xf36b('0x41')]],{'showHidden':![],'depth':null}));this[_0xf36b('0x1d')](util[_0xf36b('0x34')](_0xf36b('0x46'),this[_0xf36b('0xa')][_0x103140[_0xf36b('0x41')]][_0xf36b('0x2a')]),_0xf36b('0x38'),this[_0xf36b('0xa')][_0x103140[_0xf36b('0x41')]]);}else if(this[_0xf36b('0x8')][_0x103140[_0xf36b('0x41')]]){this[_0xf36b('0x8')][_0x103140[_0xf36b('0x41')]][_0xf36b('0x44')]=_0x103140[_0xf36b('0x42')][_0xf36b('0x31')]();this[_0xf36b('0x8')][_0x103140[_0xf36b('0x41')]][_0xf36b('0x45')]=_0x103140['address'];logger[_0xf36b('0x22')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xf36b('0x15')](this[_0xf36b('0x8')][_0x103140[_0xf36b('0x41')]],{'showHidden':![],'depth':null}));this[_0xf36b('0x1d')](util[_0xf36b('0x34')](_0xf36b('0x3a'),this[_0xf36b('0x8')][_0x103140[_0xf36b('0x41')]][_0xf36b('0x2a')]),_0xf36b('0x2b'),this[_0xf36b('0x8')][_0x103140[_0xf36b('0x41')]]);}}}catch(_0x104464){logger[_0xf36b('0x13')]('[userReport][peerstatus]',util['inspect'](_0x104464,{'showHidden':![],'depth':null}));}};module[_0xf36b('0x47')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 692e962..4a04400 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 _0x9813=['values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','blindtransfer','prototype','emit','isNotNull','isUndefined','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','queue','format','called','mandatoryDisposition','type','inbound','voice','assign','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','calleridnum','user:%s','membername','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','hasOwnProperty','info','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','routealias','merge','interface','destconnectedlinenum','accountcode','exten','custom:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','lastevent','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:'];(function(_0x5326f3,_0xade490){var _0x394455=function(_0x52534c){while(--_0x52534c){_0x5326f3['push'](_0x5326f3['shift']());}};_0x394455(++_0xade490);}(_0x9813,0x155));var _0x3981=function(_0xe9e1a,_0x3b0917){_0xe9e1a=_0xe9e1a-0x0;var _0x1f2005=_0x9813[_0xe9e1a];return _0x1f2005;};'use strict';var _=require('lodash');var moment=require(_0x3981('0x0'));var util=require(_0x3981('0x1'));var Redis=require(_0x3981('0x2'));var config=require(_0x3981('0x3'));var logger=require(_0x3981('0x4'))('ami');var ami=require('../ami');config[_0x3981('0x5')]=_[_0x3981('0x6')](config[_0x3981('0x5')],{'host':_0x3981('0x7'),'port':0x18eb});var io=require(_0x3981('0x8'))(new Redis(config[_0x3981('0x5')]));function VoiceAgentReport(_0x4050f3){this[_0x3981('0x9')]={};this[_0x3981('0xa')]=_0x4050f3[_0x3981('0x9')];this[_0x3981('0xb')]=_0x4050f3[_0x3981('0xb')];this[_0x3981('0xc')]=_0x4050f3['agents'];this[_0x3981('0xd')]={};ami['on']('agentcalled',this[_0x3981('0xe')][_0x3981('0xf')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x3981('0xf')](this));ami['on'](_0x3981('0x10'),this[_0x3981('0x11')][_0x3981('0xf')](this));ami['on'](_0x3981('0x12'),this[_0x3981('0x13')][_0x3981('0xf')](this));ami['on'](_0x3981('0x14'),this[_0x3981('0x15')][_0x3981('0xf')](this));ami['on']('varset',this[_0x3981('0x16')][_0x3981('0xf')](this));ami['on'](_0x3981('0x17'),this['syncHangup'][_0x3981('0xf')](this));ami['on']('musiconholdstart',this[_0x3981('0x18')][_0x3981('0xf')](this));ami['on'](_0x3981('0x19'),this['syncMusicOnHoldStop'][_0x3981('0xf')](this));ami['on'](_0x3981('0x1a'),this['syncAttendedTransfer'][_0x3981('0xf')](this));ami['on'](_0x3981('0x1b'),this['syncBlindTransfer'][_0x3981('0xf')](this));}VoiceAgentReport[_0x3981('0x1c')]['emit']=function(_0x10920b,_0x3025b7,_0x47845e){io['to'](_0x10920b)[_0x3981('0x1d')](_0x3025b7,_0x47845e);};VoiceAgentReport[_0x3981('0x1c')][_0x3981('0x1e')]=function(_0x2c96aa){return _0x2c96aa!==null&&!_[_0x3981('0x1f')](_0x2c96aa);};VoiceAgentReport[_0x3981('0x1c')][_0x3981('0xe')]=function(_0x69838e){try{if(this[_0x3981('0x1e')](_0x69838e)){logger['info'](_0x3981('0x20'),_0x69838e[_0x3981('0x21')],_0x69838e['membername'],_0x69838e[_0x3981('0x22')]);logger[_0x3981('0x23')](_0x3981('0x24'),_0x69838e[_0x3981('0x21')],util[_0x3981('0x25')](_0x69838e,{'showHidden':![],'depth':null}));if(_[_0x3981('0x1f')](this[_0x3981('0x9')][_0x69838e[_0x3981('0x21')]])){this['channels'][_0x69838e['uniqueid']]={};}var _0x202763=this[_0x3981('0xc')][_0x69838e['interface']];var _0x58ecc5=this[_0x3981('0x9')][_0x69838e[_0x3981('0x21')]][_0x69838e[_0x3981('0x22')]];var _0x3c1651=this[_0x3981('0xb')][_0x69838e[_0x3981('0x26')]];var _0x5c14df=this[_0x3981('0xd')][_0x69838e[_0x3981('0x21')]];if(_['isUndefined'](_0x58ecc5)){_0x58ecc5={'agentcalledAt':moment()[_0x3981('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x3981('0x28'),'mandatoryDisposition':_0x3c1651&&_0x3c1651[_0x3981('0x29')]?_0x3c1651[_0x3981('0x29')]:![],'type':_0x3c1651&&_0x3c1651[_0x3981('0x2a')]?_0x3c1651['type']:_0x3981('0x2b'),'variables':_0x5c14df,'motionChannel':_0x3981('0x2c')};}Object[_0x3981('0x2d')](_0x58ecc5,_[_0x3981('0x2e')](_0x69838e,[_0x3981('0x2f'),_0x3981('0x30')]));this[_0x3981('0x9')][_0x69838e[_0x3981('0x21')]][_0x69838e['destuniqueid']]=_0x58ecc5;logger[_0x3981('0x23')](_0x3981('0x31'),_0x69838e[_0x3981('0x21')],util[_0x3981('0x25')](_0x58ecc5,{'showHidden':![],'depth':null}));ami[_0x3981('0x1d')]('custom:agentcalled',_0x58ecc5);var _0x5439bc={'id':_0x202763['id'],'calleridnum':_0x58ecc5[_0x3981('0x32')],'queue':_0x58ecc5[_0x3981('0x26')],'variables':_0x58ecc5['variables'],'uniqueid':_0x69838e['uniqueid']};logger[_0x3981('0x23')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x69838e[_0x3981('0x21')],util[_0x3981('0x25')](_0x5439bc,{'showHidden':![],'depth':null}));this[_0x3981('0x1d')](util['format'](_0x3981('0x33'),_0x69838e[_0x3981('0x34')]),_0x3981('0x35'),_0x5439bc);}}catch(_0x57c657){logger[_0x3981('0x36')](_0x3981('0x37'),_0x69838e[_0x3981('0x21')],util['inspect'](_0x57c657,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3981('0x1c')][_0x3981('0x38')]=function(_0x6521ff){try{if(this['isNotNull'](_0x6521ff)){if(this['channels'][_0x6521ff['uniqueid']]){for(var _0x5b6b51 in this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]]){if(this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x3981('0x39')](_0x5b6b51)){if(_0x6521ff[_0x3981('0x22')]===_0x5b6b51){logger[_0x3981('0x3a')](_0x3981('0x3b'),_0x6521ff[_0x3981('0x21')],_0x6521ff['membername'],_0x6521ff[_0x3981('0x22')]);this[_0x3981('0x9')][_0x6521ff['uniqueid']][_0x5b6b51][_0x3981('0x3c')]=moment()['format'](_0x3981('0x3d'));this['channels'][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x3e')]=_0x6521ff[_0x3981('0x3e')];this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x3f')]=_0x6521ff[_0x3981('0x3f')];this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x40')]=_0x6521ff['destchannelstate'];this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x41')]=_0x6521ff[_0x3981('0x41')];this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51]['holdtime']=_0x6521ff[_0x3981('0x42')];this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51]['lastevent']=_0x3981('0x43');if(this[_0x3981('0xa')][this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51]['uniqueid']]){var _0x4c33fb=this[_0x3981('0xa')][this[_0x3981('0x9')][_0x6521ff['uniqueid']][_0x5b6b51][_0x3981('0x21')]]['routealias'];this['channels'][_0x6521ff['uniqueid']][_0x5b6b51][_0x3981('0x44')]=_0x4c33fb;_0x6521ff[_0x3981('0x44')]=_0x4c33fb;}_[_0x3981('0x45')](this[_0x3981('0xc')][_0x6521ff[_0x3981('0x46')]],_['pick'](_0x6521ff,[_0x3981('0x26'),_0x3981('0x47'),_0x3981('0x44')]));var _0x45fc93=this[_0x3981('0xc')][_0x6521ff[_0x3981('0x46')]];var _0x17a597={'id':_0x45fc93['id'],'name':_0x45fc93['name'],'agentconnected':!![],'destaccountcode':_0x45fc93[_0x3981('0x48')],'destconnectedlinenum':this['channels'][_0x6521ff[_0x3981('0x21')]][_0x6521ff[_0x3981('0x22')]][_0x3981('0x49')],'queue':this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x6521ff['destuniqueid']][_0x3981('0x26')],'routealias':this[_0x3981('0x9')][_0x6521ff['uniqueid']][_0x6521ff[_0x3981('0x22')]]['routealias'],'uniqueid':this['channels'][_0x6521ff['uniqueid']][_0x6521ff[_0x3981('0x22')]][_0x3981('0x21')]};ami[_0x3981('0x1d')](_0x3981('0x4a'),this['channels'][_0x6521ff[_0x3981('0x21')]][_0x6521ff['destuniqueid']]);this[_0x3981('0x1d')](util[_0x3981('0x27')](_0x3981('0x33'),_0x6521ff[_0x3981('0x34')]),'user:agentconnect',_0x17a597);}else if(!this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x10')]&&!this[_0x3981('0x9')][_0x6521ff['uniqueid']][_0x5b6b51][_0x3981('0x14')]){logger[_0x3981('0x3a')](_0x3981('0x4b'),_0x6521ff[_0x3981('0x21')],this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x34')],_0x5b6b51);this['channels'][_0x6521ff[_0x3981('0x21')]][_0x5b6b51]['agentringnoanswer']=!![];this['channels'][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x4c')]=moment()[_0x3981('0x27')](_0x3981('0x3d'));this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51]['answeredelsewheredestinationuniqueid']=_0x6521ff[_0x3981('0x22')];this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51]['answeredelsewheremembername']=_0x6521ff[_0x3981('0x34')];this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51][_0x3981('0x4d')]='answered_elsewhere';this['channels'][_0x6521ff['uniqueid']][_0x5b6b51][_0x3981('0x4e')]=_0x3981('0x4f');logger[_0x3981('0x23')](_0x3981('0x50'),_0x6521ff[_0x3981('0x21')],util[_0x3981('0x25')](this['channels'][_0x6521ff[_0x3981('0x21')]][_0x5b6b51],{'showHidden':![],'depth':null}));ami[_0x3981('0x1d')]('custom:agentansweredelsewhere',this[_0x3981('0x9')][_0x6521ff[_0x3981('0x21')]][_0x5b6b51]);}else{logger['debug'](_0x3981('0x51'),_0x6521ff[_0x3981('0x21')]);}}}}}}catch(_0x3b01cf){logger[_0x3981('0x36')](_0x3981('0x52'),_0x6521ff[_0x3981('0x21')],util['inspect'](_0x3b01cf,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3981('0x11')]=function(_0x45436a){try{if(this[_0x3981('0x1e')](_0x45436a)){logger[_0x3981('0x23')](_0x3981('0x53'),_0x45436a['uniqueid'],util[_0x3981('0x25')](_0x45436a,{'showHidden':![],'depth':null}));if(this[_0x3981('0x9')][_0x45436a['uniqueid']]&&this[_0x3981('0x9')][_0x45436a[_0x3981('0x21')]][_0x45436a[_0x3981('0x22')]]){logger[_0x3981('0x3a')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x45436a[_0x3981('0x21')],_0x45436a[_0x3981('0x34')],_0x45436a[_0x3981('0x22')]);var _0x1478da=this[_0x3981('0xc')][_0x45436a[_0x3981('0x46')]];var _0x5cf57a=this['channels'][_0x45436a['uniqueid']][_0x45436a['destuniqueid']];_0x5cf57a[_0x3981('0x10')]=!![];_0x5cf57a[_0x3981('0x4c')]=moment()['format'](_0x3981('0x3d'));_0x5cf57a[_0x3981('0x4d')]=_0x3981('0x54');_0x5cf57a['reason']=_0x3981('0x54');var _0x67f7fa={'id':_0x1478da['id'],'name':_0x1478da[_0x3981('0x55')],'queue':_0x5cf57a[_0x3981('0x26')],'uniqueid':_0x5cf57a['uniqueid']};logger[_0x3981('0x23')](_0x3981('0x56'),_0x45436a[_0x3981('0x21')],util[_0x3981('0x25')](_0x67f7fa,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x3981('0x33'),_0x1478da[_0x3981('0x55')]),_0x3981('0x57'),_0x67f7fa);ami[_0x3981('0x1d')](_0x3981('0x58'),_0x5cf57a);this[_0x3981('0x9')][_0x45436a[_0x3981('0x21')]][_0x45436a['destuniqueid']]=Object[_0x3981('0x2d')]({},_0x5cf57a);}}}catch(_0x1acef1){logger['error'](_0x3981('0x59'),_0x45436a[_0x3981('0x21')],util[_0x3981('0x25')](_0x1acef1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3981('0x1c')][_0x3981('0x13')]=function(_0x220d71){try{if(this['isNotNull'](_0x220d71)){logger['debug']('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x220d71[_0x3981('0x21')],util[_0x3981('0x25')](_0x220d71,{'showHidden':![],'depth':null}));if(this[_0x3981('0x9')][_0x220d71[_0x3981('0x21')]]){for(var _0xf0888d in this[_0x3981('0x9')][_0x220d71[_0x3981('0x21')]]){if(this[_0x3981('0x9')][_0x220d71[_0x3981('0x21')]][_0x3981('0x39')](_0xf0888d)&&!this['channels'][_0x220d71[_0x3981('0x21')]][_0xf0888d]['agentringnoanswer']&&!this['channels'][_0x220d71[_0x3981('0x21')]][_0xf0888d][_0x3981('0x14')]){logger[_0x3981('0x3a')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x220d71[_0x3981('0x21')],this[_0x3981('0x9')][_0x220d71['uniqueid']][_0xf0888d][_0x3981('0x34')],_0xf0888d);this['channels'][_0x220d71[_0x3981('0x21')]][_0xf0888d][_0x3981('0x10')]=!![];this[_0x3981('0x9')][_0x220d71[_0x3981('0x21')]][_0xf0888d][_0x3981('0x4c')]=moment()[_0x3981('0x27')](_0x3981('0x3d'));this['channels'][_0x220d71[_0x3981('0x21')]][_0xf0888d]['lastevent']=_0x3981('0x5a');this['channels'][_0x220d71[_0x3981('0x21')]][_0xf0888d][_0x3981('0x4e')]=_0x3981('0x5a');logger[_0x3981('0x23')](_0x3981('0x5b'),_0x220d71['uniqueid'],util[_0x3981('0x25')](this['channels'][_0x220d71[_0x3981('0x21')]][_0xf0888d],{'showHidden':![],'depth':null}));ami[_0x3981('0x1d')](_0x3981('0x5c'),this['channels'][_0x220d71[_0x3981('0x21')]][_0xf0888d]);}}}}}catch(_0x14236e){logger[_0x3981('0x36')]('[%s][voiceAgentReport][queuecallerabandon]',_0x220d71[_0x3981('0x21')],util[_0x3981('0x25')](_0x14236e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3981('0x15')]=function(_0x294773){try{if(this[_0x3981('0x1e')](_0x294773)){logger[_0x3981('0x23')](_0x3981('0x5d'),_0x294773[_0x3981('0x21')],util[_0x3981('0x25')](_0x294773,{'showHidden':![],'depth':null}));if(this[_0x3981('0x9')][_0x294773[_0x3981('0x21')]]){for(var _0x510aaa in this['channels'][_0x294773['uniqueid']]){if(this['channels'][_0x294773[_0x3981('0x21')]][_0x3981('0x39')](_0x510aaa)){if(this[_0x3981('0x9')][_0x294773['uniqueid']][_0x510aaa][_0x3981('0x3c')]&&!this['channels'][_0x294773['uniqueid']][_0x510aaa][_0x3981('0x14')]){logger[_0x3981('0x3a')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x294773[_0x3981('0x21')],this['channels'][_0x294773[_0x3981('0x21')]][_0x510aaa][_0x3981('0x34')],_0x510aaa);this['channels'][_0x294773[_0x3981('0x21')]][_0x510aaa][_0x3981('0x14')]=!![];this[_0x3981('0x9')][_0x294773['uniqueid']][_0x510aaa][_0x3981('0x5e')]=moment()[_0x3981('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x3981('0x9')][_0x294773['uniqueid']][_0x510aaa][_0x3981('0x4d')]=_0x3981('0x5f');this[_0x3981('0x9')][_0x294773[_0x3981('0x21')]][_0x510aaa][_0x3981('0x4e')]=_0x294773[_0x3981('0x4e')]==_0x3981('0x60')?_0x3981('0x61'):_0x294773[_0x3981('0x4e')];this[_0x3981('0x9')][_0x294773[_0x3981('0x21')]][_0x510aaa][_0x3981('0x62')]=_0x294773[_0x3981('0x62')];if(this[_0x3981('0xb')][_0x294773[_0x3981('0x26')]]&&this['voiceQueues'][_0x294773[_0x3981('0x26')]][_0x3981('0x63')]){this[_0x3981('0x9')][_0x294773[_0x3981('0x21')]][_0x510aaa][_0x3981('0x64')]=this[_0x3981('0xb')][_0x294773['queue']]['acwTimeout'];this[_0x3981('0x9')][_0x294773['uniqueid']][_0x510aaa][_0x3981('0x65')]=!![];}this[_0x3981('0xc')][_0x294773[_0x3981('0x46')]]=_['omit'](this[_0x3981('0xc')][_0x294773[_0x3981('0x46')]],['queue','destconnectedlinenum']);logger[_0x3981('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x294773['uniqueid'],util['inspect'](this['channels'][_0x294773['uniqueid']][_0x510aaa],{'showHidden':![],'depth':null}));ami[_0x3981('0x1d')](_0x3981('0x66'),this[_0x3981('0x9')][_0x294773[_0x3981('0x21')]][_0x510aaa]);logger[_0x3981('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x294773[_0x3981('0x21')],util[_0x3981('0x25')]({'id':this[_0x3981('0xc')][_0x294773[_0x3981('0x46')]]['id'],'destaccountcode':_0x294773[_0x3981('0x67')]},{'showHidden':![],'depth':null}));this[_0x3981('0x1d')](util[_0x3981('0x27')]('user:%s',_0x294773[_0x3981('0x34')]),_0x3981('0x68'),{'id':this[_0x3981('0xc')][_0x294773['interface']]['id'],'destaccountcode':Number(_0x294773['destaccountcode'])});}}}}}}catch(_0x3a5d80){logger[_0x3981('0x36')](_0x3981('0x69'),_0x294773[_0x3981('0x21')],util[_0x3981('0x25')](_0x3a5d80,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3981('0x1c')]['syncVarSet']=function(_0xb3d8df){try{if(this[_0x3981('0x1e')](_0xb3d8df)){logger[_0x3981('0x23')](_0x3981('0x6a'),_0xb3d8df[_0x3981('0x21')],util['inspect'](_0xb3d8df,{'showHidden':![],'depth':null}));this['addVariable'](_0xb3d8df[_0x3981('0x21')],_['keys'](_0xb3d8df['variable'])[0x0],_0xb3d8df[_0x3981('0x6b')]);if(this['channels'][_0xb3d8df[_0x3981('0x21')]]){for(var _0x4e9329 in this[_0x3981('0x9')][_0xb3d8df[_0x3981('0x21')]]){if(this[_0x3981('0x9')][_0xb3d8df[_0x3981('0x21')]][_0x3981('0x39')](_0x4e9329)){logger[_0x3981('0x3a')](_0x3981('0x6c'),_0xb3d8df[_0x3981('0x21')],_0x4e9329,_[_0x3981('0x6d')](_0xb3d8df['variable'])[0x0],_0xb3d8df['value']);if(_[_0x3981('0x1f')](this[_0x3981('0x9')][_0xb3d8df[_0x3981('0x21')]][_0x4e9329][_0x3981('0xd')])){this[_0x3981('0x9')][_0xb3d8df[_0x3981('0x21')]][_0x4e9329]['variables']={};}this[_0x3981('0x9')][_0xb3d8df[_0x3981('0x21')]][_0x4e9329]['variables']=this['variables'][_0xb3d8df[_0x3981('0x21')]];}}}}}catch(_0x179558){logger['error'](_0x3981('0x6e'),_0xb3d8df[_0x3981('0x21')],util[_0x3981('0x25')](_0x179558,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3981('0x1c')][_0x3981('0x6f')]=function(_0x5103a9,_0x511b00,_0x597186){var _0x37228d=['rtpaudioqos',_0x3981('0x70'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x3981('0x71'),_0x3981('0x72'),_0x3981('0x73'),_0x3981('0x74'),'sipcallid',_0x3981('0x75'),_0x3981('0x76'),_0x3981('0x77'),_0x3981('0x78'),_0x3981('0x79'),_0x3981('0x7a'),_0x3981('0x7b'),_0x3981('0x34'),_0x3981('0x7c'),_0x3981('0x7d')];if(!_[_0x3981('0x7e')](_0x511b00)&&!_['includes'](_0x37228d,_0x511b00)){if(_[_0x3981('0x1f')](this[_0x3981('0xd')][_0x5103a9])){this[_0x3981('0xd')][_0x5103a9]={};}this['variables'][_0x5103a9][_0x511b00]=_0x597186;}};VoiceAgentReport[_0x3981('0x1c')]['syncHangup']=function(_0x4af3b4){try{if(this[_0x3981('0x1e')](_0x4af3b4)){logger[_0x3981('0x23')](_0x3981('0x7f'),_0x4af3b4['uniqueid'],util[_0x3981('0x25')](_0x4af3b4,{'showHidden':![],'depth':null}));if(this['channels'][_0x4af3b4[_0x3981('0x21')]]){for(var _0x588b9b in this[_0x3981('0x9')][_0x4af3b4[_0x3981('0x21')]]){if(this[_0x3981('0x9')][_0x4af3b4['uniqueid']]['hasOwnProperty'](_0x588b9b)){if(this[_0x3981('0x9')][_0x4af3b4[_0x3981('0x21')]][_0x588b9b][_0x3981('0x4e')]==_0x3981('0x60')&&this[_0x3981('0x9')][_0x4af3b4[_0x3981('0x21')]][_0x588b9b][_0x3981('0x14')]){logger[_0x3981('0x3a')](_0x3981('0x80'),_0x4af3b4[_0x3981('0x21')],_0x588b9b);this[_0x3981('0x9')][_0x4af3b4['uniqueid']][_0x588b9b]['agentcompleteAt']=moment()[_0x3981('0x27')](_0x3981('0x3d'));}}}logger[_0x3981('0x23')](_0x3981('0x81'),_0x4af3b4[_0x3981('0x21')],util[_0x3981('0x25')](_[_0x3981('0x82')](this[_0x3981('0x9')][_0x4af3b4[_0x3981('0x21')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x3981('0x83'),_[_0x3981('0x82')](this['channels'][_0x4af3b4['uniqueid']]));delete this[_0x3981('0x9')][_0x4af3b4[_0x3981('0x21')]];}if(this[_0x3981('0xd')][_0x4af3b4[_0x3981('0x21')]]){delete this[_0x3981('0xd')][_0x4af3b4['uniqueid']];}}}catch(_0x2ff460){logger[_0x3981('0x36')](_0x3981('0x84'),_0x4af3b4[_0x3981('0x21')],util[_0x3981('0x25')](_0x2ff460,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x3981('0x85')]=function(_0x35fc1b){try{if(this['isNotNull'](_0x35fc1b)){logger['debug'](_0x3981('0x86'),_0x35fc1b[_0x3981('0x21')],util['inspect'](_0x35fc1b,{'showHidden':![],'depth':null}));if(this[_0x3981('0x9')][_0x35fc1b['transfereeuniqueid']]){for(var _0x5468f5 in this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]]){if(this[_0x3981('0x9')][_0x35fc1b['transfereeuniqueid']]['hasOwnProperty'](_0x5468f5)){if(_0x35fc1b[_0x3981('0x88')]===_0x5468f5){logger['info'](_0x3981('0x89'),_0x35fc1b['uniqueid'],this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]][_0x5468f5][_0x3981('0x34')],_0x5468f5);var _0x4b03e3=moment();this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]][_0x5468f5]['agentcomplete']=!![];this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]][_0x5468f5][_0x3981('0x5e')]=moment()['format'](_0x3981('0x3d'));this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]][_0x5468f5][_0x3981('0x4d')]=_0x3981('0x5f');this[_0x3981('0x9')][_0x35fc1b['transfereeuniqueid']][_0x5468f5][_0x3981('0x4e')]=_0x3981('0x60');this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]][_0x5468f5]['talktime']=_0x4b03e3['diff'](this['channels'][_0x35fc1b['transfereeuniqueid']][_0x5468f5]['agentconnectAt'],_0x3981('0x8a'));}}}}if(this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x8b')]]){var _0x49d885=this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x8b')]];this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x8b')]]=this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]];this[_0x3981('0x9')][_0x35fc1b[_0x3981('0x87')]]=_0x49d885;}}}catch(_0x5121e8){logger[_0x3981('0x36')](_0x3981('0x8c'),_0x35fc1b[_0x3981('0x21')],util[_0x3981('0x25')](_0x5121e8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3981('0x1c')]['syncBlindTransfer']=function(_0x5a2a73){try{if(this['isNotNull'](_0x5a2a73)){logger[_0x3981('0x23')](_0x3981('0x8d'),_0x5a2a73[_0x3981('0x21')],util['inspect'](_0x5a2a73,{'showHidden':![],'depth':null}));if(this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]]){for(var _0x21de1d in this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]]){if(this['channels'][_0x5a2a73['transfereeuniqueid']]['hasOwnProperty'](_0x21de1d)){if(_0x5a2a73[_0x3981('0x8e')]===_0x21de1d){logger[_0x3981('0x3a')](_0x3981('0x8f'),_0x5a2a73[_0x3981('0x21')],this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]][_0x21de1d][_0x3981('0x34')],_0x21de1d);var _0xef902c=moment();this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]][_0x21de1d][_0x3981('0x14')]=!![];this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]][_0x21de1d][_0x3981('0x5e')]=_0xef902c;this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]][_0x21de1d][_0x3981('0x4d')]=_0x3981('0x5f');this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]][_0x21de1d]['reason']=_0x3981('0x60');this[_0x3981('0x9')][_0x5a2a73[_0x3981('0x87')]][_0x21de1d][_0x3981('0x62')]=_0xef902c[_0x3981('0x90')](this['channels'][_0x5a2a73['transfereeuniqueid']][_0x21de1d][_0x3981('0x3c')],_0x3981('0x8a'));}}}}}}catch(_0x137863){logger[_0x3981('0x36')](_0x3981('0x91'),_0x5a2a73[_0x3981('0x21')],util[_0x3981('0x25')](_0x137863,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3981('0x1c')][_0x3981('0x18')]=function(_0xf2c1f3){var _0x5787a6='';try{if(this[_0x3981('0x1e')](_0xf2c1f3)){logger[_0x3981('0x23')](_0x3981('0x92'),_0xf2c1f3[_0x3981('0x21')],util['inspect'](_0xf2c1f3,{'showHidden':![],'depth':null}));if(_0xf2c1f3['channel']){_0x5787a6=_0xf2c1f3[_0x3981('0x93')]['substring'](0x0,_0xf2c1f3['channel'][_0x3981('0x94')]('-'));if(this[_0x3981('0xc')][_0x5787a6]){logger['info'](_0x3981('0x95'),_0xf2c1f3[_0x3981('0x21')],_0x5787a6);this[_0x3981('0xc')][_0x5787a6][_0x3981('0x96')]=!![];}}}}catch(_0x44b4ed){logger[_0x3981('0x36')]('[%s][voiceAgentReport][musiconholdstart]',_0xf2c1f3['uniqueid'],util[_0x3981('0x25')](_0x44b4ed,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x3981('0x1c')][_0x3981('0x97')]=function(_0x4e5c50){var _0x21cf79='';try{if(this[_0x3981('0x1e')](_0x4e5c50)){logger[_0x3981('0x23')](_0x3981('0x98'),_0x4e5c50[_0x3981('0x21')],util[_0x3981('0x25')](_0x4e5c50,{'showHidden':![],'depth':null}));if(_0x4e5c50[_0x3981('0x93')]){_0x21cf79=_0x4e5c50[_0x3981('0x93')][_0x3981('0x99')](0x0,_0x4e5c50[_0x3981('0x93')][_0x3981('0x94')]('-'));if(this[_0x3981('0xc')][_0x21cf79]){logger['info'](_0x3981('0x9a'),_0x4e5c50[_0x3981('0x21')],_0x21cf79);this[_0x3981('0xc')][_0x21cf79]['onhold']=![];}}}}catch(_0x3aec2e){logger[_0x3981('0x36')](_0x3981('0x9b'),_0x4e5c50[_0x3981('0x21')],util[_0x3981('0x25')](_0x3aec2e,{'showHidden':![],'depth':null}));}};module[_0x3981('0x9c')]=VoiceAgentReport; \ No newline at end of file +var _0x439c=['[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','transfer','talktime','acw','acwtime','acwTimeout','agentacw','destconnectedlinenum','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','syncHangup','[%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','complete','diff','seconds','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','onhold','lodash','moment','util','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','varset','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','channels','interface','format','mandatoryDisposition','type','inbound','voice','assign','omit','event','privilege','inspect','emit','custom:agentcalled','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','merge','pick','queue','name','accountcode','exten','custom:agentconnect','user:%s','user:agentconnect','agentcomplete'];(function(_0x1e584e,_0x3fdc98){var _0x3fd19b=function(_0x2d90c0){while(--_0x2d90c0){_0x1e584e['push'](_0x1e584e['shift']());}};_0x3fd19b(++_0x3fdc98);}(_0x439c,0x190));var _0xc439=function(_0x135f5f,_0x58a205){_0x135f5f=_0x135f5f-0x0;var _0x3dc675=_0x439c[_0x135f5f];return _0x3dc675;};'use strict';var _=require(_0xc439('0x0'));var moment=require(_0xc439('0x1'));var util=require(_0xc439('0x2'));var Redis=require('ioredis');var config=require(_0xc439('0x3'));var logger=require(_0xc439('0x4'))(_0xc439('0x5'));var ami=require('../ami');config[_0xc439('0x6')]=_[_0xc439('0x7')](config[_0xc439('0x6')],{'host':_0xc439('0x8'),'port':0x18eb});var io=require(_0xc439('0x9'))(new Redis(config[_0xc439('0x6')]));function VoiceAgentReport(_0x2ab1ad){this['channels']={};this[_0xc439('0xa')]=_0x2ab1ad['channels'];this[_0xc439('0xb')]=_0x2ab1ad[_0xc439('0xb')];this[_0xc439('0xc')]=_0x2ab1ad['agents'];this[_0xc439('0xd')]={};ami['on'](_0xc439('0xe'),this['syncAgentCalled'][_0xc439('0xf')](this));ami['on'](_0xc439('0x10'),this[_0xc439('0x11')]['bind'](this));ami['on'](_0xc439('0x12'),this['syncAgentRingNoAnswer'][_0xc439('0xf')](this));ami['on'](_0xc439('0x13'),this['syncQueueCallerAbandon'][_0xc439('0xf')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0xc439('0xf')](this));ami['on'](_0xc439('0x14'),this['syncVarSet'][_0xc439('0xf')](this));ami['on'](_0xc439('0x15'),this['syncHangup']['bind'](this));ami['on'](_0xc439('0x16'),this[_0xc439('0x17')][_0xc439('0xf')](this));ami['on'](_0xc439('0x18'),this['syncMusicOnHoldStop'][_0xc439('0xf')](this));ami['on']('attendedtransfer',this[_0xc439('0x19')][_0xc439('0xf')](this));ami['on'](_0xc439('0x1a'),this[_0xc439('0x1b')][_0xc439('0xf')](this));}VoiceAgentReport[_0xc439('0x1c')]['emit']=function(_0x283f46,_0x33d581,_0x5bf39f){io['to'](_0x283f46)['emit'](_0x33d581,_0x5bf39f);};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x1d')]=function(_0x5e7d0e){return _0x5e7d0e!==null&&!_[_0xc439('0x1e')](_0x5e7d0e);};VoiceAgentReport['prototype'][_0xc439('0x1f')]=function(_0x1887c5){try{if(this[_0xc439('0x1d')](_0x1887c5)){logger[_0xc439('0x20')](_0xc439('0x21'),_0x1887c5['uniqueid'],_0x1887c5[_0xc439('0x22')],_0x1887c5[_0xc439('0x23')]);logger[_0xc439('0x24')](_0xc439('0x25'),_0x1887c5[_0xc439('0x26')],util['inspect'](_0x1887c5,{'showHidden':![],'depth':null}));if(_[_0xc439('0x1e')](this['channels'][_0x1887c5[_0xc439('0x26')]])){this[_0xc439('0x27')][_0x1887c5['uniqueid']]={};}var _0x2487d9=this[_0xc439('0xc')][_0x1887c5[_0xc439('0x28')]];var _0x5b2f1d=this[_0xc439('0x27')][_0x1887c5[_0xc439('0x26')]][_0x1887c5[_0xc439('0x23')]];var _0x29fc32=this['voiceQueues'][_0x1887c5['queue']];var _0x3a4167=this['variables'][_0x1887c5[_0xc439('0x26')]];if(_[_0xc439('0x1e')](_0x5b2f1d)){_0x5b2f1d={'agentcalledAt':moment()[_0xc439('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','mandatoryDisposition':_0x29fc32&&_0x29fc32[_0xc439('0x2a')]?_0x29fc32['mandatoryDisposition']:![],'type':_0x29fc32&&_0x29fc32[_0xc439('0x2b')]?_0x29fc32[_0xc439('0x2b')]:_0xc439('0x2c'),'variables':_0x3a4167,'motionChannel':_0xc439('0x2d')};}Object[_0xc439('0x2e')](_0x5b2f1d,_[_0xc439('0x2f')](_0x1887c5,[_0xc439('0x30'),_0xc439('0x31')]));this['channels'][_0x1887c5[_0xc439('0x26')]][_0x1887c5[_0xc439('0x23')]]=_0x5b2f1d;logger[_0xc439('0x24')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x1887c5[_0xc439('0x26')],util[_0xc439('0x32')](_0x5b2f1d,{'showHidden':![],'depth':null}));ami[_0xc439('0x33')](_0xc439('0x34'),_0x5b2f1d);var _0x303162={'id':_0x2487d9['id'],'calleridnum':_0x5b2f1d['calleridnum'],'queue':_0x5b2f1d['queue'],'variables':_0x5b2f1d['variables'],'uniqueid':_0x1887c5[_0xc439('0x26')]};logger[_0xc439('0x24')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x1887c5[_0xc439('0x26')],util['inspect'](_0x303162,{'showHidden':![],'depth':null}));this[_0xc439('0x33')](util[_0xc439('0x29')]('user:%s',_0x1887c5[_0xc439('0x22')]),_0xc439('0x35'),_0x303162);}}catch(_0x593c44){logger[_0xc439('0x36')](_0xc439('0x37'),_0x1887c5[_0xc439('0x26')],util['inspect'](_0x593c44,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x11')]=function(_0xa4d459){try{if(this[_0xc439('0x1d')](_0xa4d459)){if(this[_0xc439('0x27')][_0xa4d459['uniqueid']]){for(var _0xf63029 in this[_0xc439('0x27')][_0xa4d459['uniqueid']]){if(this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]]['hasOwnProperty'](_0xf63029)){if(_0xa4d459[_0xc439('0x23')]===_0xf63029){logger['info'](_0xc439('0x38'),_0xa4d459['uniqueid'],_0xa4d459[_0xc439('0x22')],_0xa4d459[_0xc439('0x23')]);this[_0xc439('0x27')][_0xa4d459['uniqueid']][_0xf63029][_0xc439('0x39')]=moment()[_0xc439('0x29')](_0xc439('0x3a'));this[_0xc439('0x27')][_0xa4d459['uniqueid']][_0xf63029][_0xc439('0x3b')]=_0xa4d459[_0xc439('0x3b')];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x3c')]=_0xa4d459[_0xc439('0x3c')];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x3d')]=_0xa4d459['destchannelstate'];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029]['destchannelstatedesc']=_0xa4d459[_0xc439('0x3e')];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x3f')]=_0xa4d459['holdtime'];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x40')]=_0xc439('0x41');if(this['voiceChannels'][this['channels'][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x26')]]){var _0x1df89b=this[_0xc439('0xa')][this['channels'][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x26')]][_0xc439('0x42')];this[_0xc439('0x27')][_0xa4d459['uniqueid']][_0xf63029]['routealias']=_0x1df89b;_0xa4d459['routealias']=_0x1df89b;}_[_0xc439('0x43')](this[_0xc439('0xc')][_0xa4d459['interface']],_[_0xc439('0x44')](_0xa4d459,[_0xc439('0x45'),'destconnectedlinenum',_0xc439('0x42')]));var _0x46e6eb=this[_0xc439('0xc')][_0xa4d459[_0xc439('0x28')]];var _0x38b873={'id':_0x46e6eb['id'],'name':_0x46e6eb[_0xc439('0x46')],'agentconnected':!![],'destaccountcode':_0x46e6eb[_0xc439('0x47')],'destconnectedlinenum':this[_0xc439('0x27')][_0xa4d459['uniqueid']][_0xa4d459['destuniqueid']][_0xc439('0x48')],'queue':this['channels'][_0xa4d459['uniqueid']][_0xa4d459['destuniqueid']][_0xc439('0x45')],'routealias':this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xa4d459[_0xc439('0x23')]][_0xc439('0x42')],'uniqueid':this[_0xc439('0x27')][_0xa4d459['uniqueid']][_0xa4d459[_0xc439('0x23')]][_0xc439('0x26')]};ami[_0xc439('0x33')](_0xc439('0x49'),this['channels'][_0xa4d459['uniqueid']][_0xa4d459[_0xc439('0x23')]]);this[_0xc439('0x33')](util[_0xc439('0x29')](_0xc439('0x4a'),_0xa4d459['membername']),_0xc439('0x4b'),_0x38b873);}else if(!this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x12')]&&!this[_0xc439('0x27')][_0xa4d459['uniqueid']][_0xf63029][_0xc439('0x4c')]){logger[_0xc439('0x20')](_0xc439('0x4d'),_0xa4d459[_0xc439('0x26')],this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029]['membername'],_0xf63029);this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x12')]=!![];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x4e')]=moment()['format'](_0xc439('0x3a'));this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x4f')]=_0xa4d459[_0xc439('0x23')];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029]['answeredelsewheremembername']=_0xa4d459[_0xc439('0x22')];this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029][_0xc439('0x40')]=_0xc439('0x50');this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029]['reason']=_0xc439('0x50');logger['debug'](_0xc439('0x51'),_0xa4d459[_0xc439('0x26')],util[_0xc439('0x32')](this[_0xc439('0x27')][_0xa4d459['uniqueid']][_0xf63029],{'showHidden':![],'depth':null}));ami[_0xc439('0x33')]('custom:agentansweredelsewhere',this[_0xc439('0x27')][_0xa4d459[_0xc439('0x26')]][_0xf63029]);}else{logger[_0xc439('0x24')]('[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken',_0xa4d459[_0xc439('0x26')]);}}}}}}catch(_0x55d186){logger[_0xc439('0x36')](_0xc439('0x52'),_0xa4d459[_0xc439('0x26')],util[_0xc439('0x32')](_0x55d186,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x53')]=function(_0x38e4ee){try{if(this['isNotNull'](_0x38e4ee)){logger['debug'](_0xc439('0x54'),_0x38e4ee[_0xc439('0x26')],util[_0xc439('0x32')](_0x38e4ee,{'showHidden':![],'depth':null}));if(this[_0xc439('0x27')][_0x38e4ee['uniqueid']]&&this['channels'][_0x38e4ee[_0xc439('0x26')]][_0x38e4ee[_0xc439('0x23')]]){logger[_0xc439('0x20')](_0xc439('0x55'),_0x38e4ee[_0xc439('0x26')],_0x38e4ee['membername'],_0x38e4ee[_0xc439('0x23')]);var _0x8559b7=this[_0xc439('0xc')][_0x38e4ee[_0xc439('0x28')]];var _0x3c4eb7=this[_0xc439('0x27')][_0x38e4ee[_0xc439('0x26')]][_0x38e4ee[_0xc439('0x23')]];_0x3c4eb7[_0xc439('0x12')]=!![];_0x3c4eb7[_0xc439('0x4e')]=moment()['format'](_0xc439('0x3a'));_0x3c4eb7[_0xc439('0x40')]=_0xc439('0x56');_0x3c4eb7[_0xc439('0x57')]=_0xc439('0x56');var _0x121303={'id':_0x8559b7['id'],'name':_0x8559b7[_0xc439('0x46')],'queue':_0x3c4eb7['queue'],'uniqueid':_0x3c4eb7[_0xc439('0x26')]};logger[_0xc439('0x24')](_0xc439('0x58'),_0x38e4ee['uniqueid'],util['inspect'](_0x121303,{'showHidden':![],'depth':null}));this[_0xc439('0x33')](util[_0xc439('0x29')](_0xc439('0x4a'),_0x8559b7['name']),_0xc439('0x59'),_0x121303);ami[_0xc439('0x33')](_0xc439('0x5a'),_0x3c4eb7);this[_0xc439('0x27')][_0x38e4ee[_0xc439('0x26')]][_0x38e4ee[_0xc439('0x23')]]=Object['assign']({},_0x3c4eb7);}}}catch(_0x14dda){logger[_0xc439('0x36')](_0xc439('0x5b'),_0x38e4ee[_0xc439('0x26')],util[_0xc439('0x32')](_0x14dda,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')]['syncQueueCallerAbandon']=function(_0xe22c7c){try{if(this[_0xc439('0x1d')](_0xe22c7c)){logger[_0xc439('0x24')](_0xc439('0x5c'),_0xe22c7c[_0xc439('0x26')],util[_0xc439('0x32')](_0xe22c7c,{'showHidden':![],'depth':null}));if(this[_0xc439('0x27')][_0xe22c7c['uniqueid']]){for(var _0x32c21b in this[_0xc439('0x27')][_0xe22c7c['uniqueid']]){if(this[_0xc439('0x27')][_0xe22c7c[_0xc439('0x26')]][_0xc439('0x5d')](_0x32c21b)&&!this['channels'][_0xe22c7c['uniqueid']][_0x32c21b][_0xc439('0x12')]&&!this[_0xc439('0x27')][_0xe22c7c[_0xc439('0x26')]][_0x32c21b][_0xc439('0x4c')]){logger[_0xc439('0x20')](_0xc439('0x5e'),_0xe22c7c[_0xc439('0x26')],this[_0xc439('0x27')][_0xe22c7c[_0xc439('0x26')]][_0x32c21b]['membername'],_0x32c21b);this['channels'][_0xe22c7c[_0xc439('0x26')]][_0x32c21b][_0xc439('0x12')]=!![];this[_0xc439('0x27')][_0xe22c7c[_0xc439('0x26')]][_0x32c21b][_0xc439('0x4e')]=moment()['format'](_0xc439('0x3a'));this['channels'][_0xe22c7c[_0xc439('0x26')]][_0x32c21b]['lastevent']=_0xc439('0x5f');this[_0xc439('0x27')][_0xe22c7c[_0xc439('0x26')]][_0x32c21b][_0xc439('0x57')]=_0xc439('0x5f');logger[_0xc439('0x24')](_0xc439('0x60'),_0xe22c7c[_0xc439('0x26')],util[_0xc439('0x32')](this[_0xc439('0x27')][_0xe22c7c[_0xc439('0x26')]][_0x32c21b],{'showHidden':![],'depth':null}));ami['emit'](_0xc439('0x61'),this[_0xc439('0x27')][_0xe22c7c['uniqueid']][_0x32c21b]);}}}}}catch(_0x1ce210){logger[_0xc439('0x36')](_0xc439('0x62'),_0xe22c7c[_0xc439('0x26')],util['inspect'](_0x1ce210,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x63')]=function(_0x3d4b36){try{if(this['isNotNull'](_0x3d4b36)){logger[_0xc439('0x24')](_0xc439('0x64'),_0x3d4b36[_0xc439('0x26')],util[_0xc439('0x32')](_0x3d4b36,{'showHidden':![],'depth':null}));if(this[_0xc439('0x27')][_0x3d4b36['uniqueid']]){for(var _0x4301c3 in this[_0xc439('0x27')][_0x3d4b36['uniqueid']]){if(this[_0xc439('0x27')][_0x3d4b36['uniqueid']][_0xc439('0x5d')](_0x4301c3)){if(this[_0xc439('0x27')][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x39')]&&!this['channels'][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x4c')]){logger[_0xc439('0x20')](_0xc439('0x65'),_0x3d4b36[_0xc439('0x26')],this[_0xc439('0x27')][_0x3d4b36['uniqueid']][_0x4301c3][_0xc439('0x22')],_0x4301c3);this[_0xc439('0x27')][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x4c')]=!![];this['channels'][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x66')]=moment()[_0xc439('0x29')](_0xc439('0x3a'));this[_0xc439('0x27')][_0x3d4b36[_0xc439('0x26')]][_0x4301c3]['lastevent']='complete';this[_0xc439('0x27')][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x57')]=_0x3d4b36[_0xc439('0x57')]==_0xc439('0x67')?'agent':_0x3d4b36[_0xc439('0x57')];this['channels'][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x68')]=_0x3d4b36[_0xc439('0x68')];if(this[_0xc439('0xb')][_0x3d4b36[_0xc439('0x45')]]&&this[_0xc439('0xb')][_0x3d4b36[_0xc439('0x45')]][_0xc439('0x69')]){this['channels'][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x6a')]=this[_0xc439('0xb')][_0x3d4b36[_0xc439('0x45')]][_0xc439('0x6b')];this[_0xc439('0x27')][_0x3d4b36[_0xc439('0x26')]][_0x4301c3][_0xc439('0x6c')]=!![];}this[_0xc439('0xc')][_0x3d4b36[_0xc439('0x28')]]=_['omit'](this['agents'][_0x3d4b36[_0xc439('0x28')]],[_0xc439('0x45'),_0xc439('0x6d')]);logger[_0xc439('0x24')](_0xc439('0x6e'),_0x3d4b36['uniqueid'],util[_0xc439('0x32')](this[_0xc439('0x27')][_0x3d4b36[_0xc439('0x26')]][_0x4301c3],{'showHidden':![],'depth':null}));ami[_0xc439('0x33')](_0xc439('0x6f'),this[_0xc439('0x27')][_0x3d4b36['uniqueid']][_0x4301c3]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x3d4b36[_0xc439('0x26')],util[_0xc439('0x32')]({'id':this['agents'][_0x3d4b36[_0xc439('0x28')]]['id'],'destaccountcode':_0x3d4b36[_0xc439('0x70')]},{'showHidden':![],'depth':null}));this['emit'](util[_0xc439('0x29')](_0xc439('0x4a'),_0x3d4b36['membername']),_0xc439('0x71'),{'id':this[_0xc439('0xc')][_0x3d4b36[_0xc439('0x28')]]['id'],'destaccountcode':Number(_0x3d4b36[_0xc439('0x70')])});}}}}}}catch(_0x364353){logger[_0xc439('0x36')](_0xc439('0x72'),_0x3d4b36['uniqueid'],util['inspect'](_0x364353,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x73')]=function(_0x59c941){try{if(this[_0xc439('0x1d')](_0x59c941)){logger['debug']('[%s][voiceAgentReport][varset]\x20event:',_0x59c941['uniqueid'],util[_0xc439('0x32')](_0x59c941,{'showHidden':![],'depth':null}));this[_0xc439('0x74')](_0x59c941[_0xc439('0x26')],_[_0xc439('0x75')](_0x59c941[_0xc439('0x76')])[0x0],_0x59c941[_0xc439('0x77')]);if(this[_0xc439('0x27')][_0x59c941[_0xc439('0x26')]]){for(var _0x19850e in this[_0xc439('0x27')][_0x59c941[_0xc439('0x26')]]){if(this[_0xc439('0x27')][_0x59c941[_0xc439('0x26')]][_0xc439('0x5d')](_0x19850e)){logger[_0xc439('0x20')](_0xc439('0x78'),_0x59c941['uniqueid'],_0x19850e,_['keys'](_0x59c941[_0xc439('0x76')])[0x0],_0x59c941[_0xc439('0x77')]);if(_[_0xc439('0x1e')](this['channels'][_0x59c941[_0xc439('0x26')]][_0x19850e][_0xc439('0xd')])){this[_0xc439('0x27')][_0x59c941['uniqueid']][_0x19850e]['variables']={};}this[_0xc439('0x27')][_0x59c941['uniqueid']][_0x19850e][_0xc439('0xd')]=this[_0xc439('0xd')][_0x59c941[_0xc439('0x26')]];}}}}}catch(_0x25525c){logger[_0xc439('0x36')](_0xc439('0x79'),_0x59c941['uniqueid'],util['inspect'](_0x25525c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x74')]=function(_0x1820e0,_0x4e9aaa,_0x45a916){var _0x215146=[_0xc439('0x7a'),'rtpaudioqosbridged',_0xc439('0x7b'),'rtpaudioqosjitterbridged',_0xc439('0x7c'),_0xc439('0x7d'),_0xc439('0x7e'),_0xc439('0x7f'),_0xc439('0x80'),'sipuri','bridgepeer',_0xc439('0x81'),_0xc439('0x82'),_0xc439('0x83'),_0xc439('0x84'),_0xc439('0x85'),'membername',_0xc439('0x86'),'memberrealtime'];if(!_[_0xc439('0x87')](_0x4e9aaa)&&!_['includes'](_0x215146,_0x4e9aaa)){if(_[_0xc439('0x1e')](this[_0xc439('0xd')][_0x1820e0])){this[_0xc439('0xd')][_0x1820e0]={};}this[_0xc439('0xd')][_0x1820e0][_0x4e9aaa]=_0x45a916;}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x88')]=function(_0x5dba15){try{if(this['isNotNull'](_0x5dba15)){logger[_0xc439('0x24')](_0xc439('0x89'),_0x5dba15[_0xc439('0x26')],util['inspect'](_0x5dba15,{'showHidden':![],'depth':null}));if(this[_0xc439('0x27')][_0x5dba15[_0xc439('0x26')]]){for(var _0xa2b0b9 in this[_0xc439('0x27')][_0x5dba15['uniqueid']]){if(this[_0xc439('0x27')][_0x5dba15[_0xc439('0x26')]][_0xc439('0x5d')](_0xa2b0b9)){if(this['channels'][_0x5dba15[_0xc439('0x26')]][_0xa2b0b9]['reason']==_0xc439('0x67')&&this[_0xc439('0x27')][_0x5dba15[_0xc439('0x26')]][_0xa2b0b9]['agentcomplete']){logger[_0xc439('0x20')](_0xc439('0x8a'),_0x5dba15[_0xc439('0x26')],_0xa2b0b9);this[_0xc439('0x27')][_0x5dba15[_0xc439('0x26')]][_0xa2b0b9][_0xc439('0x66')]=moment()[_0xc439('0x29')](_0xc439('0x3a'));}}}logger[_0xc439('0x24')](_0xc439('0x8b'),_0x5dba15['uniqueid'],util[_0xc439('0x32')](_[_0xc439('0x8c')](this[_0xc439('0x27')][_0x5dba15[_0xc439('0x26')]]),{'showHidden':![],'depth':null}));ami[_0xc439('0x33')](_0xc439('0x8d'),_[_0xc439('0x8c')](this[_0xc439('0x27')][_0x5dba15['uniqueid']]));delete this[_0xc439('0x27')][_0x5dba15[_0xc439('0x26')]];}if(this[_0xc439('0xd')][_0x5dba15[_0xc439('0x26')]]){delete this[_0xc439('0xd')][_0x5dba15[_0xc439('0x26')]];}}}catch(_0x4dfb10){logger['error'](_0xc439('0x8e'),_0x5dba15[_0xc439('0x26')],util['inspect'](_0x4dfb10,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x19')]=function(_0x401f65){try{if(this[_0xc439('0x1d')](_0x401f65)){logger[_0xc439('0x24')](_0xc439('0x8f'),_0x401f65[_0xc439('0x26')],util[_0xc439('0x32')](_0x401f65,{'showHidden':![],'depth':null}));if(this['channels'][_0x401f65[_0xc439('0x90')]]){for(var _0x296538 in this['channels'][_0x401f65[_0xc439('0x90')]]){if(this[_0xc439('0x27')][_0x401f65['transfereeuniqueid']][_0xc439('0x5d')](_0x296538)){if(_0x401f65[_0xc439('0x91')]===_0x296538){logger[_0xc439('0x20')](_0xc439('0x92'),_0x401f65['uniqueid'],this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]][_0x296538][_0xc439('0x22')],_0x296538);var _0x1406b3=moment();this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]][_0x296538][_0xc439('0x4c')]=!![];this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]][_0x296538][_0xc439('0x66')]=moment()[_0xc439('0x29')](_0xc439('0x3a'));this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]][_0x296538]['lastevent']=_0xc439('0x93');this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]][_0x296538][_0xc439('0x57')]='transfer';this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]][_0x296538][_0xc439('0x68')]=_0x1406b3[_0xc439('0x94')](this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]][_0x296538]['agentconnectAt'],_0xc439('0x95'));}}}}if(this['channels'][_0x401f65['secondtransfereruniqueid']]){var _0x32d6cb=this[_0xc439('0x27')][_0x401f65['secondtransfereruniqueid']];this[_0xc439('0x27')][_0x401f65['secondtransfereruniqueid']]=this[_0xc439('0x27')][_0x401f65['transfereeuniqueid']];this[_0xc439('0x27')][_0x401f65[_0xc439('0x90')]]=_0x32d6cb;}}}catch(_0x4b07fd){logger['error'](_0xc439('0x96'),_0x401f65['uniqueid'],util[_0xc439('0x32')](_0x4b07fd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x1b')]=function(_0x27bdc7){try{if(this[_0xc439('0x1d')](_0x27bdc7)){logger[_0xc439('0x24')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x27bdc7[_0xc439('0x26')],util['inspect'](_0x27bdc7,{'showHidden':![],'depth':null}));if(this[_0xc439('0x27')][_0x27bdc7[_0xc439('0x90')]]){for(var _0x4ba090 in this[_0xc439('0x27')][_0x27bdc7[_0xc439('0x90')]]){if(this[_0xc439('0x27')][_0x27bdc7[_0xc439('0x90')]][_0xc439('0x5d')](_0x4ba090)){if(_0x27bdc7['transfereruniqueid']===_0x4ba090){logger[_0xc439('0x20')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x27bdc7[_0xc439('0x26')],this[_0xc439('0x27')][_0x27bdc7[_0xc439('0x90')]][_0x4ba090]['membername'],_0x4ba090);var _0x26471d=moment();this['channels'][_0x27bdc7[_0xc439('0x90')]][_0x4ba090][_0xc439('0x4c')]=!![];this[_0xc439('0x27')][_0x27bdc7[_0xc439('0x90')]][_0x4ba090][_0xc439('0x66')]=_0x26471d;this[_0xc439('0x27')][_0x27bdc7['transfereeuniqueid']][_0x4ba090][_0xc439('0x40')]=_0xc439('0x93');this[_0xc439('0x27')][_0x27bdc7[_0xc439('0x90')]][_0x4ba090]['reason']='transfer';this[_0xc439('0x27')][_0x27bdc7['transfereeuniqueid']][_0x4ba090][_0xc439('0x68')]=_0x26471d[_0xc439('0x94')](this[_0xc439('0x27')][_0x27bdc7[_0xc439('0x90')]][_0x4ba090][_0xc439('0x39')],_0xc439('0x95'));}}}}}}catch(_0x14fdbf){logger[_0xc439('0x36')]('[%s][voiceAgentReport][blindtransfer]',_0x27bdc7[_0xc439('0x26')],util['inspect'](_0x14fdbf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x17')]=function(_0x570f22){var _0xccc16a='';try{if(this['isNotNull'](_0x570f22)){logger['debug'](_0xc439('0x97'),_0x570f22[_0xc439('0x26')],util[_0xc439('0x32')](_0x570f22,{'showHidden':![],'depth':null}));if(_0x570f22[_0xc439('0x98')]){_0xccc16a=_0x570f22[_0xc439('0x98')][_0xc439('0x99')](0x0,_0x570f22[_0xc439('0x98')]['lastIndexOf']('-'));if(this[_0xc439('0xc')][_0xccc16a]){logger[_0xc439('0x20')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x570f22[_0xc439('0x26')],_0xccc16a);this[_0xc439('0xc')][_0xccc16a]['onhold']=!![];}}}}catch(_0x38b198){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x570f22[_0xc439('0x26')],util[_0xc439('0x32')](_0x38b198,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc439('0x1c')][_0xc439('0x9a')]=function(_0x4480ff){var _0xd585a8='';try{if(this[_0xc439('0x1d')](_0x4480ff)){logger[_0xc439('0x24')](_0xc439('0x9b'),_0x4480ff['uniqueid'],util[_0xc439('0x32')](_0x4480ff,{'showHidden':![],'depth':null}));if(_0x4480ff[_0xc439('0x98')]){_0xd585a8=_0x4480ff['channel'][_0xc439('0x99')](0x0,_0x4480ff[_0xc439('0x98')][_0xc439('0x9c')]('-'));if(this[_0xc439('0xc')][_0xd585a8]){logger[_0xc439('0x20')](_0xc439('0x9d'),_0x4480ff[_0xc439('0x26')],_0xd585a8);this['agents'][_0xd585a8][_0xc439('0x9e')]=![];}}}}catch(_0x36e361){logger[_0xc439('0x36')]('[%s][voiceAgentReport][musiconholdstop]',_0x4480ff[_0xc439('0x26')],util['inspect'](_0x36e361,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 398f1d3..01b3833 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 _0xdee3=['[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','keys','context','exten','destconnectedlinenum','connectedlinenum','format','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','channel','OutgoingSpoolFailed','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','pick','from-sip','split','undefined','user:%s','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','subtract','duration','seconds','includes','lastdata','startsWith','cdr(','match','type','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','diff','xcally-motion-preview','connectedlinename','destinationchannel','membername','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','push','rec','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','length','then','transferType','transferToInternal','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','transfercalleridnum','origtransferercalleridnum','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','origtransfereruniqueid','transfertargetuniqueid','origtransfererlinkedid','some','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][musiconholdstart]\x20event:','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','moment','util','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','varset','hangup','syncHangup','newcallerid','syncNewCallerId','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','emit','info'];(function(_0x3d22f2,_0x18d342){var _0x556517=function(_0x17a722){while(--_0x17a722){_0x3d22f2['push'](_0x3d22f2['shift']());}};_0x556517(++_0x18d342);}(_0xdee3,0x166));var _0x3dee=function(_0x32844d,_0x170b74){_0x32844d=_0x32844d-0x0;var _0x450a27=_0xdee3[_0x32844d];return _0x450a27;};'use strict';var _=require('lodash');var moment=require(_0x3dee('0x0'));var util=require(_0x3dee('0x1'));var path=require(_0x3dee('0x2'));var Redis=require('ioredis');var config=require(_0x3dee('0x3'));var logger=require(_0x3dee('0x4'))(_0x3dee('0x5'));var ami=require(_0x3dee('0x6'));var Channel=require(_0x3dee('0x7'));var RpcSetting=require(_0x3dee('0x8'));var applications=[_0x3dee('0x9'),_0x3dee('0xa'),_0x3dee('0xb'),_0x3dee('0xc'),_0x3dee('0xd'),_0x3dee('0xe')];var dispositions=[_0x3dee('0xf'),_0x3dee('0x10'),'FAILED',_0x3dee('0xf'),_0x3dee('0xf'),_0x3dee('0xf'),'ANSWERED',_0x3dee('0x11'),'FAILED',_0x3dee('0x10'),_0x3dee('0x10')];config[_0x3dee('0x12')]=_[_0x3dee('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3dee('0x14'))(new Redis(config['redis']));function VoiceCallReport(_0x40512e){this[_0x3dee('0x15')]=_0x40512e[_0x3dee('0x15')];this['agents']=_0x40512e[_0x3dee('0x16')];this[_0x3dee('0x17')]={};ami['on'](_0x3dee('0x18'),this[_0x3dee('0x19')][_0x3dee('0x1a')](this));ami['on'](_0x3dee('0x1b'),this[_0x3dee('0x19')][_0x3dee('0x1a')](this));ami['on'](_0x3dee('0x1c'),this[_0x3dee('0x1d')][_0x3dee('0x1a')](this));ami['on'](_0x3dee('0x1e'),this['syncNewState']['bind'](this));ami['on'](_0x3dee('0x1f'),this['syncVarSet'][_0x3dee('0x1a')](this));ami['on'](_0x3dee('0x20'),this[_0x3dee('0x21')][_0x3dee('0x1a')](this));ami['on'](_0x3dee('0x22'),this[_0x3dee('0x23')][_0x3dee('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x3dee('0x1a')](this));ami['on'](_0x3dee('0x24'),this['syncBlindTransfer'][_0x3dee('0x1a')](this));ami['on']('musiconholdstart',this[_0x3dee('0x25')][_0x3dee('0x1a')](this));ami['on'](_0x3dee('0x26'),this[_0x3dee('0x27')][_0x3dee('0x1a')](this));try{logger['info'](_0x3dee('0x28'));ami[_0x3dee('0x29')]();}catch(_0x525a08){logger[_0x3dee('0x2a')]('[voiceCallReport][coreshowchannels]',util[_0x3dee('0x2b')](_0x525a08,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x3dee('0x2c')][_0x3dee('0x2d')]=function(_0xb301d2){return _0xb301d2!==null&&!_['isUndefined'](_0xb301d2);};VoiceCallReport[_0x3dee('0x2c')][_0x3dee('0x2e')]=function(_0x212098,_0x4ce80e,_0x5a3d52){io['to'](_0x212098)['emit'](_0x4ce80e,_0x5a3d52);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x31585e){try{if(this[_0x3dee('0x2d')](_0x31585e)){logger[_0x3dee('0x2f')](_0x3dee('0x30'),_0x31585e[_0x3dee('0x31')],_0x31585e[_0x3dee('0x32')],_0x31585e[_0x3dee('0x33')]);logger[_0x3dee('0x34')](_0x3dee('0x35'),_0x31585e[_0x3dee('0x31')],util[_0x3dee('0x2b')](_0x31585e,{'showHidden':![],'depth':null}));if(_0x31585e[_0x3dee('0x31')]===_0x31585e[_0x3dee('0x36')]){if(!_[_0x3dee('0x37')](this[_0x3dee('0x15')][_0x31585e[_0x3dee('0x31')]])){_[_0x3dee('0x38')](this[_0x3dee('0x15')][_0x31585e['uniqueid']],_['pick'](_0x31585e,_[_0x3dee('0x39')](this[_0x3dee('0x15')][_0x31585e['uniqueid']])));}}if(_0x31585e[_0x3dee('0x3a')]==='from-sip'){var _0x29c173=this['agents'][_0x31585e['channel']['split']('-')[0x0]];if(_0x29c173){if(_0x31585e[_0x3dee('0x3b')]=='xcally-motion-preview'){_0x29c173[_0x3dee('0x3c')]=_0x31585e[_0x3dee('0x3d')];this['emit'](util[_0x3dee('0x3e')]('user:%s',_0x29c173[_0x3dee('0x3f')]),_0x3dee('0x40'),{'id':_0x29c173['id'],'destaccountcode':_0x29c173[_0x3dee('0x41')],'destconnectedlinenum':_0x31585e['connectedlinenum']});}}}}}catch(_0x3586f5){logger[_0x3dee('0x2a')](_0x3dee('0x42'),_0x31585e[_0x3dee('0x31')],util[_0x3dee('0x2b')](_0x3586f5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3dee('0x2c')][_0x3dee('0x1d')]=function(_0x18738f){try{if(this['isNotNull'](_0x18738f)){logger[_0x3dee('0x34')](_0x3dee('0x43'),_0x18738f['uniqueid'],util[_0x3dee('0x2b')](_0x18738f,{'showHidden':![],'depth':null}));if(this['channels'][_0x18738f[_0x3dee('0x31')]]){return;}if(_0x18738f[_0x3dee('0x44')]===_0x3dee('0x45')){return;}if(_0x18738f[_0x3dee('0x31')]!==_0x18738f[_0x3dee('0x36')]&&!this[_0x3dee('0x17')][_0x18738f[_0x3dee('0x36')]]){return;}logger[_0x3dee('0x2f')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x18738f[_0x3dee('0x31')],_0x18738f[_0x3dee('0x3a')],_0x18738f[_0x3dee('0x3b')]);this['channels'][_0x18738f['uniqueid']]=new Channel();this[_0x3dee('0x15')][_0x18738f[_0x3dee('0x31')]]['starttime']=moment()[_0x3dee('0x3e')](_0x3dee('0x46'));this[_0x3dee('0x15')][_0x18738f[_0x3dee('0x31')]][_0x3dee('0x47')]=dispositions[_[_0x3dee('0x48')](_0x18738f[_0x3dee('0x49')])];_['merge'](this[_0x3dee('0x15')][_0x18738f['uniqueid']],_[_0x3dee('0x4a')](_0x18738f,_[_0x3dee('0x39')](this['channels'][_0x18738f['uniqueid']])));if(_0x18738f[_0x3dee('0x3a')]===_0x3dee('0x4b')){var _0x380a44=this['agents'][_0x18738f[_0x3dee('0x44')][_0x3dee('0x4c')]('-')[0x0]];if(_0x380a44&&typeof _0x380a44['destconnectedlinenum']===_0x3dee('0x4d')){_0x380a44[_0x3dee('0x3c')]=_0x18738f[_0x3dee('0x3b')];logger[_0x3dee('0x34')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x18738f[_0x3dee('0x31')],util[_0x3dee('0x2b')]({'id':_0x380a44['id'],'destaccountcode':_0x380a44[_0x3dee('0x41')],'destconnectedlinenum':_0x18738f[_0x3dee('0x3b')]},{'showHidden':![],'depth':null}));this[_0x3dee('0x2e')](util[_0x3dee('0x3e')](_0x3dee('0x4e'),_0x380a44[_0x3dee('0x3f')]),'user:agentconnect',{'id':_0x380a44['id'],'destaccountcode':_0x380a44[_0x3dee('0x41')],'destconnectedlinenum':_0x18738f['exten']});}}}}catch(_0x831bf3){logger[_0x3dee('0x2a')](_0x3dee('0x4f'),_0x18738f['uniqueid'],util[_0x3dee('0x2b')](_0x831bf3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3dee('0x19')]=function(_0x516608){try{if(this['isNotNull'](_0x516608)){logger['debug'](_0x3dee('0x50'),_0x516608[_0x3dee('0x31')],util[_0x3dee('0x2b')](_0x516608,{'showHidden':![],'depth':null}));if(_0x516608[_0x3dee('0x44')]===_0x3dee('0x45')||_0x516608[_0x3dee('0x3b')]==='h')return;if(_0x516608['uniqueid']===_0x516608[_0x3dee('0x36')]||this[_0x3dee('0x17')][_0x516608[_0x3dee('0x36')]]){_0x516608[_0x3dee('0x51')]=_0x516608[_0x3dee('0x51')]?_0x516608[_0x3dee('0x51')][_0x3dee('0x52')]():undefined;_0x516608[_0x3dee('0x53')]=_0x516608['appdata']||_0x516608[_0x3dee('0x53')];if(_0x516608[_0x3dee('0x54')]&&!_0x516608[_0x3dee('0x54')]['startsWith'](_0x3dee('0x55'))&&_0x516608['application']!=='queue'){_0x516608[_0x3dee('0x53')]=_0x516608['applicationdata'][_0x3dee('0x52')]();}logger[_0x3dee('0x2f')](_0x3dee('0x56'),_0x516608[_0x3dee('0x31')],_0x516608['application'],_0x516608['applicationdata']);if(_[_0x3dee('0x37')](this[_0x3dee('0x15')][_0x516608[_0x3dee('0x31')]])){this['channels'][_0x516608[_0x3dee('0x31')]]=new Channel();this['channels'][_0x516608[_0x3dee('0x31')]][_0x3dee('0x57')]=_0x516608['duration']?moment()[_0x3dee('0x58')](moment[_0x3dee('0x59')](_0x516608[_0x3dee('0x59')])[_0x3dee('0x5a')](),_0x3dee('0x5a'))[_0x3dee('0x3e')](_0x3dee('0x46')):moment()[_0x3dee('0x3e')](_0x3dee('0x46'));this[_0x3dee('0x15')][_0x516608['uniqueid']][_0x3dee('0x47')]=_0x3dee('0xf');}_['merge'](this[_0x3dee('0x15')][_0x516608['uniqueid']],_[_0x3dee('0x4a')](_0x516608,_[_0x3dee('0x39')](this[_0x3dee('0x15')][_0x516608['uniqueid']])));if(_[_0x3dee('0x5b')](applications,_0x516608[_0x3dee('0x51')])){this['channels'][_0x516608['uniqueid']]['lastapplication']=_0x516608[_0x3dee('0x51')];this[_0x3dee('0x15')][_0x516608[_0x3dee('0x31')]][_0x3dee('0x5c')]=_0x516608[_0x3dee('0x53')];if(_0x516608['application']===_0x3dee('0x9')&&_[_0x3dee('0x5d')](_0x516608[_0x3dee('0x53')][_0x3dee('0x52')](),_0x3dee('0x5e'))){var _0x13ca16=_0x516608[_0x3dee('0x53')]['split']('=');var _0x36a6da=_0x13ca16[0x0]['toLowerCase']()[_0x3dee('0x5f')](/cdr\((.*)\)/);if(_0x36a6da){if(_0x36a6da[0x1]===_0x3dee('0x60')&&!_['isNil'](this['channels'][_0x516608[_0x3dee('0x31')]][_0x36a6da[0x1]]))return;this[_0x3dee('0x15')][_0x516608[_0x3dee('0x31')]][_0x36a6da[0x1]]=_0x13ca16[0x1];}}else if(_0x516608[_0x3dee('0x51')]===_0x3dee('0xa')){this[_0x3dee('0x15')][_0x516608[_0x3dee('0x31')]][_0x3dee('0xa')]=_0x516608[_0x3dee('0x53')][_0x3dee('0x4c')](',')[0x0];}}}}}catch(_0x6d798f){logger['error'](_0x3dee('0x61'),_0x516608[_0x3dee('0x31')],util['inspect'](_0x6d798f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x3dee('0x62')]=function(_0x1f0bb7){try{if(this[_0x3dee('0x2d')](_0x1f0bb7)){logger[_0x3dee('0x2f')](_0x3dee('0x63'),_0x1f0bb7['uniqueid'],_0x1f0bb7[_0x3dee('0x36')],_0x1f0bb7[_0x3dee('0x32')],_0x1f0bb7[_0x3dee('0x33')]);logger[_0x3dee('0x34')]('[%s][voiceCallReport][newstate]\x20event:',_0x1f0bb7[_0x3dee('0x31')],util[_0x3dee('0x2b')](_0x1f0bb7,{'showHidden':![],'depth':null}));if(_0x1f0bb7[_0x3dee('0x49')]!=='6')return;var _0x4cebe7=this[_0x3dee('0x16')][_0x1f0bb7['channel'][_0x3dee('0x4c')]('-')[0x0]];if(_0x1f0bb7[_0x3dee('0x31')]!==_0x1f0bb7[_0x3dee('0x36')]){var _0xd1fdb0=moment();if(this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]]){if(!this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x64')]){this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x64')]=!![];this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x65')]=_0xd1fdb0[_0x3dee('0x3e')](_0x3dee('0x46'));if(this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x57')]){this['channels'][_0x1f0bb7['linkedid']][_0x3dee('0x66')]=_0xd1fdb0[_0x3dee('0x67')](this[_0x3dee('0x15')][_0x1f0bb7['linkedid']][_0x3dee('0x57')],_0x3dee('0x5a'));}}this[_0x3dee('0x15')][_0x1f0bb7['linkedid']][_0x3dee('0x36')]=_0x1f0bb7[_0x3dee('0x31')];if(_0x1f0bb7[_0x3dee('0x33')]!==_0x3dee('0x68')){this['channels'][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x3d')]=_0x1f0bb7[_0x3dee('0x33')];}this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x69')]=_0x1f0bb7[_0x3dee('0x32')];this['channels'][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x6a')]=_0x1f0bb7[_0x3dee('0x44')];this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x47')]=dispositions[_['toNumber'](_0x1f0bb7[_0x3dee('0x49')])];if(_0x4cebe7){this['channels'][_0x1f0bb7[_0x3dee('0x36')]]['UserId']=_0x4cebe7['id'];this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x6b')]=_0x4cebe7[_0x3dee('0x3f')];}}if(this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]]){if(!this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]][_0x3dee('0x64')]){this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]][_0x3dee('0x64')]=!![];this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]]['answertime']=_0xd1fdb0[_0x3dee('0x3e')](_0x3dee('0x46'));if(this['channels'][_0x1f0bb7['uniqueid']]['starttime']){this['channels'][_0x1f0bb7[_0x3dee('0x31')]][_0x3dee('0x66')]=_0xd1fdb0[_0x3dee('0x67')](this[_0x3dee('0x15')][_0x1f0bb7['uniqueid']][_0x3dee('0x57')],_0x3dee('0x5a'));}}if(_0x1f0bb7['calleridnum']!==_0x3dee('0x68')){this[_0x3dee('0x15')][_0x1f0bb7['uniqueid']][_0x3dee('0x3d')]=_0x1f0bb7[_0x3dee('0x33')];}this['channels'][_0x1f0bb7[_0x3dee('0x31')]][_0x3dee('0x69')]=_0x1f0bb7[_0x3dee('0x32')];this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]][_0x3dee('0x6a')]=_0x1f0bb7['channel'];this['channels'][_0x1f0bb7['uniqueid']][_0x3dee('0x47')]=dispositions[_[_0x3dee('0x48')](_0x1f0bb7[_0x3dee('0x49')])];}}else{if(this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]]){if(_0x4cebe7){this[_0x3dee('0x15')][_0x1f0bb7['uniqueid']][_0x3dee('0x6c')]=_0x4cebe7['id'];this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]]['membername']=_0x4cebe7['name'];}}}if(_0x1f0bb7[_0x3dee('0x3a')]===_0x3dee('0x4b')){if(_0x4cebe7){_0x4cebe7[_0x3dee('0x3c')]=_0x1f0bb7[_0x3dee('0x3b')];var _0x214cc3,_0x4df7a0;if(this[_0x3dee('0x15')][_0x1f0bb7['uniqueid']]){_0x214cc3=this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x31')]][_0x3dee('0x6d')];_0x4df7a0=this['channels'][_0x1f0bb7[_0x3dee('0x31')]][_0x3dee('0xa')];}else if(this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]]){_0x214cc3=this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0x6d')];_0x4df7a0=this[_0x3dee('0x15')][_0x1f0bb7[_0x3dee('0x36')]][_0x3dee('0xa')];}_0x4cebe7[_0x3dee('0xa')]=_0x4df7a0;_0x4cebe7[_0x3dee('0x6d')]=_0x214cc3;var _0x4c665b={'id':_0x4cebe7['id'],'name':_0x4cebe7[_0x3dee('0x3f')],'agentconnected':!![],'destaccountcode':_0x4cebe7[_0x3dee('0x41')],'destconnectedlinenum':_0x1f0bb7[_0x3dee('0x3b')],'queue':_0x4df7a0||undefined,'routealias':_0x214cc3,'uniqueid':_0x1f0bb7[_0x3dee('0x36')]};logger['debug'](_0x3dee('0x6e'),_0x1f0bb7[_0x3dee('0x31')],util[_0x3dee('0x2b')](_0x4c665b,{'showHidden':![],'depth':null}));this[_0x3dee('0x2e')](util['format'](_0x3dee('0x4e'),_0x4cebe7[_0x3dee('0x3f')]),_0x3dee('0x40'),_0x4c665b);}}}}catch(_0x5b7516){logger[_0x3dee('0x2a')](_0x3dee('0x6f'),_0x1f0bb7[_0x3dee('0x31')],util[_0x3dee('0x2b')](_0x5b7516,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3dee('0x2c')]['syncMixMonitorFilename']=function(_0x4e44ba,_0x26dc7e){try{if(this['channels'][_0x4e44ba]){logger['info'](_0x3dee('0x70'),_0x4e44ba,_0x26dc7e);this[_0x3dee('0x15')][_0x4e44ba][_0x3dee('0x71')]=!![];if(_[_0x3dee('0x72')](_0x26dc7e,_0x3dee('0x73'))){_0x26dc7e=_0x26dc7e[_0x3dee('0x74')](_0x3dee('0x73'),_0x3dee('0x75'));}this['channels'][_0x4e44ba][_0x3dee('0x76')]=_0x26dc7e;var _0x30aa42=_['find'](this[_0x3dee('0x15')][_0x4e44ba]['monitors'],{'filename':_0x26dc7e});if(_['isNil'](_0x30aa42)){this['channels'][_0x4e44ba][_0x3dee('0x77')][_0x3dee('0x78')]({'filename':_0x26dc7e,'createdAt':moment()['format'](_0x3dee('0x46')),'mixmonitorid':'','status':_0x3dee('0x79')});}}}catch(_0x204e2c){logger[_0x3dee('0x2a')]('[%s][voiceCallReport][mixMonitorFilename]',_0x4e44ba,util['inspect'](_0x204e2c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3dee('0x2c')][_0x3dee('0x7a')]=function(_0x26a505){try{if(this['isNotNull'](_0x26a505)){logger[_0x3dee('0x34')](_0x3dee('0x7b'),_0x26a505[_0x3dee('0x31')],util[_0x3dee('0x2b')](_0x26a505,{'showHidden':![],'depth':null}));if(this[_0x3dee('0x15')][_0x26a505['uniqueid']]&&_0x26a505['channel']!=_0x3dee('0x45')){if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')])){if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')]['mixmonitor_filename'])){logger[_0x3dee('0x2f')](_0x3dee('0x7d'),_0x26a505[_0x3dee('0x31')],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x7f')](_0x26a505[_0x3dee('0x31')],_0x26a505[_0x3dee('0x7e')]);}else if(this['isNotNull'](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x80')])){logger[_0x3dee('0x2f')](_0x3dee('0x81'),_0x26a505['uniqueid'],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]][_0x3dee('0x33')]=_0x26a505[_0x3dee('0x7e')];}else if(this[_0x3dee('0x2d')](_0x26a505['variable'][_0x3dee('0x82')])){logger[_0x3dee('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x26a505[_0x3dee('0x31')],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]]['callerid']=_0x26a505[_0x3dee('0x7e')];}else if(this[_0x3dee('0x2d')](_0x26a505['variable'][_0x3dee('0x83')])){logger[_0x3dee('0x2f')](_0x3dee('0x84'),_0x26a505['uniqueid'],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]][_0x3dee('0x60')]=_0x26a505[_0x3dee('0x7e')];}else if(this['isNotNull'](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x85')])){logger[_0x3dee('0x2f')](_0x3dee('0x86'),_0x26a505[_0x3dee('0x31')],_0x26a505[_0x3dee('0x7e')][_0x3dee('0x4c')](',')[0x0]);this['channels'][_0x26a505['uniqueid']]['queue']=_0x26a505[_0x3dee('0x7e')]['split'](',')[0x0];}else if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x87')])){logger[_0x3dee('0x2f')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x26a505[_0x3dee('0x31')],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]][_0x3dee('0x88')]=_0x26a505[_0x3dee('0x7e')];}else if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x89')])){logger[_0x3dee('0x2f')](_0x3dee('0x8a'),_0x26a505[_0x3dee('0x31')],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]][_0x3dee('0x8b')]=_0x26a505['value'];}else if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x8c')])){logger[_0x3dee('0x2f')](_0x3dee('0x8d'),_0x26a505[_0x3dee('0x31')],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]][_0x3dee('0x8e')]=_0x26a505['value'];}else if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x8f')])){logger['info'](_0x3dee('0x90'),_0x26a505[_0x3dee('0x31')],_0x26a505['value']);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]][_0x3dee('0xa')]=_0x26a505[_0x3dee('0x7e')];}else if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x91')])){logger[_0x3dee('0x2f')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x26a505['uniqueid'],_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x31')]]['sipcalluniqueid']=_0x26a505[_0x3dee('0x7e')];}}}else if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')]['mixmonitor_filename'])){if(_0x26a505[_0x3dee('0x7e')]){var _0x37255d=path[_0x3dee('0x92')](_0x26a505[_0x3dee('0x7e')])[_0x3dee('0x3f')];logger[_0x3dee('0x2f')](_0x3dee('0x7d'),_0x37255d,_0x26a505[_0x3dee('0x7e')]);this[_0x3dee('0x7f')](_0x37255d,_0x26a505[_0x3dee('0x7e')]);}}else if(this[_0x3dee('0x15')][_0x26a505[_0x3dee('0x36')]]){if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')])){if(this[_0x3dee('0x2d')](_0x26a505[_0x3dee('0x7c')][_0x3dee('0x91')])){logger[_0x3dee('0x2f')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x26a505['linkedid'],_0x26a505['value']);this[_0x3dee('0x15')][_0x26a505['linkedid']][_0x3dee('0x93')]=_0x26a505[_0x3dee('0x7e')];}}}}}catch(_0x309640){logger[_0x3dee('0x2a')](_0x3dee('0x94'),_0x26a505['uniqueid'],util[_0x3dee('0x2b')](_0x309640,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x3dee('0x2c')][_0x3dee('0x21')]=function(_0x537771){try{if(this[_0x3dee('0x2d')](_0x537771)){logger[_0x3dee('0x34')]('[%s][voiceCallReport][hangup]\x20event:',_0x537771['uniqueid'],util[_0x3dee('0x2b')](_0x537771,{'showHidden':![],'depth':null}));if(this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]]){if(this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x36')]]){this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x36')]][_0x3dee('0x31')]=_0x537771[_0x3dee('0x31')];this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]]['linkedid']][_0x3dee('0x64')]=this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x64')];this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x36')]][_0x3dee('0x65')]=this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]]['answertime'];this[_0x3dee('0x15')][this['blindTransfers'][_0x537771[_0x3dee('0x36')]]['linkedid']]['destinationchannel']=this[_0x3dee('0x15')][this['blindTransfers'][_0x537771[_0x3dee('0x36')]][_0x3dee('0x36')]][_0x3dee('0x44')];this['channels'][this['blindTransfers'][_0x537771['linkedid']]['linkedid']][_0x3dee('0x47')]=this['channels'][_0x537771['uniqueid']][_0x3dee('0x47')];this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]]=this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]]['linkedid']];delete this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x36')]];}else if(this[_0x3dee('0x15')][this['blindTransfers'][_0x537771['linkedid']][_0x3dee('0x31')]]){this['channels'][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x31')]][_0x3dee('0x31')]=[this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x31')]][_0x3dee('0x36')],this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x31')]][_0x3dee('0x36')]=this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771['linkedid']][_0x3dee('0x31')]]['uniqueid']][0x0];this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x31')]][_0x3dee('0x64')]=this['channels'][_0x537771[_0x3dee('0x31')]][_0x3dee('0x64')];this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771['linkedid']][_0x3dee('0x31')]][_0x3dee('0x65')]=this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x65')];this['channels'][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]][_0x3dee('0x31')]]['destinationchannel']=this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771['linkedid']][_0x3dee('0x31')]][_0x3dee('0x44')];this['channels'][this['blindTransfers'][_0x537771['linkedid']][_0x3dee('0x31')]]['disposition']=this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]]['disposition'];this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]]=this[_0x3dee('0x15')][this['blindTransfers'][_0x537771[_0x3dee('0x36')]][_0x3dee('0x31')]];delete this[_0x3dee('0x15')][this[_0x3dee('0x17')][_0x537771[_0x3dee('0x36')]]['uniqueid']];}}if(this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]]){logger[_0x3dee('0x2f')](_0x3dee('0x95'),_0x537771[_0x3dee('0x31')],_0x537771[_0x3dee('0x96')]);var _0x52dca3=moment();this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x97')]=_0x52dca3['format'](_0x3dee('0x46'));this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x59')]=_0x52dca3[_0x3dee('0x67')](this[_0x3dee('0x15')][_0x537771['uniqueid']][_0x3dee('0x57')],_0x3dee('0x5a'));if(this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x64')]){this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]]['billableseconds']=_0x52dca3[_0x3dee('0x67')](this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x65')],_0x3dee('0x5a'));this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x66')]=this['channels'][_0x537771[_0x3dee('0x31')]][_0x3dee('0x59')]-this[_0x3dee('0x15')][_0x537771[_0x3dee('0x31')]][_0x3dee('0x98')];}if(_0x537771[_0x3dee('0x3a')]===_0x3dee('0x4b')){if(this[_0x3dee('0x16')][_0x537771[_0x3dee('0x44')][_0x3dee('0x4c')]('-')[0x0]]){this['agents'][_0x537771['channel'][_0x3dee('0x4c')]('-')[0x0]]=_[_0x3dee('0x99')](this[_0x3dee('0x16')][_0x537771[_0x3dee('0x44')][_0x3dee('0x4c')]('-')[0x0]],[_0x3dee('0x3c')]);logger[_0x3dee('0x34')](_0x3dee('0x9a'),_0x537771[_0x3dee('0x31')],util['inspect']({'id':this[_0x3dee('0x16')][_0x537771[_0x3dee('0x44')]['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x537771['channel']['split']('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0x3dee('0x3e')]('user:%s',this[_0x3dee('0x16')][_0x537771[_0x3dee('0x44')]['split']('-')[0x0]][_0x3dee('0x3f')]),'user:agentcomplete',{'id':this['agents'][_0x537771[_0x3dee('0x44')][_0x3dee('0x4c')]('-')[0x0]]['id'],'destaccountcode':this[_0x3dee('0x16')][_0x537771[_0x3dee('0x44')][_0x3dee('0x4c')]('-')[0x0]]['accountcode']});for(var _0x4752bb=0x0;_0x4752bb0x0?!![]:![];if(!_0x96cfed){return this[_0x733d('0x6f')](this[_0x733d('0x60')]['completeEvent']);}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x1c')]=function(_0x56f38c){var _0x25d351=this[_0x733d('0x60')]['id'];if(this[_0x733d('0x60')][_0x733d('0x63')][_0x25d351]&&this[_0x733d('0x60')][_0x733d('0x63')][_0x25d351][_0x56f38c[_0x733d('0x62')]]){this[_0x733d('0x60')]['queuestatus'][_0x25d351][_0x56f38c[_0x733d('0x62')]]['agents'][_0x733d('0x70')](_0x56f38c);}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x19')]=function(_0x287535){var _0x5ec812=this;try{if(this[_0x733d('0x5d')](_0x287535)&&this[_0x733d('0x5d')](_0x287535[_0x733d('0x51')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x287535,{'showHidden':![],'depth':null}));var _0x3aaceb=this[_0x733d('0x15')][_0x287535[_0x733d('0x51')]];if(_0x3aaceb){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x3aaceb[_0x733d('0x5b')]);this[_0x733d('0x60')][_0x733d('0x64')][_0x3aaceb[_0x733d('0x5b')]]={'summaryEvent':_0x287535};this['summary'][_0x733d('0x6e')]+=0x1;return ami[_0x733d('0x3d')]({'action':_0x733d('0x63'),'queue':_0x3aaceb[_0x733d('0x5b')]})[_0x733d('0x71')](function(_0x27d668){if(!_0x5ec812[_0x733d('0x60')][_0x733d('0x63')][_0x287535[_0x733d('0x62')]]){_0x5ec812[_0x733d('0x60')]['queuestatus'][_0x287535[_0x733d('0x62')]]={};}_0x5ec812[_0x733d('0x60')][_0x733d('0x63')][_0x287535[_0x733d('0x62')]][_0x27d668['actionid']]={'queue':_0x3aaceb[_0x733d('0x5b')],'agents':[]};})['catch'](function(_0x3556a1){throw _0x3556a1;});}}}catch(_0x4ac461){logger['error']('[voiceQueueReport][queuesummary]',util['inspect'](_0x4ac461,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x733d('0x6f')]=function(_0x2541b7){if(this[_0x733d('0x60')][_0x733d('0x6e')]>0x0){this[_0x733d('0x60')][_0x733d('0x72')]=_0x2541b7;return;}logger['debug'](_0x733d('0x73'),util['inspect'](_0x2541b7,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x733d('0x4a')](_0x733d('0x74'),{});};VoiceQueueReport[_0x733d('0xb')]['syncQueueCallerJoin']=function(_0x236fbc){try{if(this[_0x733d('0x5d')](_0x236fbc)){logger['debug'](_0x733d('0x75'),_0x236fbc[_0x733d('0x4e')],util['inspect'](_0x236fbc,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x733d('0x10')][_0x236fbc['uniqueid']])){this[_0x733d('0x10')][_0x236fbc[_0x733d('0x4e')]]=[];}if(_[_0x733d('0x5e')](this[_0x733d('0x13')][_0x236fbc[_0x733d('0x4e')]])){this['channels'][_0x236fbc['uniqueid']]={};}var _0xe1878a=new QueueReport();_0xe1878a[_0x733d('0x51')]=_0x236fbc[_0x733d('0x51')];_0xe1878a[_0x733d('0x59')]=this[_0x733d('0x15')][_0xe1878a[_0x733d('0x51')]]&&this[_0x733d('0x15')][_0xe1878a[_0x733d('0x51')]]['type']?this['voiceQueues'][_0xe1878a[_0x733d('0x51')]][_0x733d('0x59')]||_0x733d('0x6b'):_0x733d('0x6b');_0xe1878a[_0x733d('0x76')]=moment()['format'](_0x733d('0x77'));_0xe1878a[_0x733d('0x78')]=_0x236fbc[_0x733d('0x78')];_0xe1878a[_0x733d('0x79')]=_0x236fbc[_0x733d('0x79')];_0xe1878a['uniqueid']=_0x236fbc['uniqueid'];_0xe1878a[_0x733d('0x7a')]=this[_0x733d('0x13')][_0x236fbc['uniqueid']][_0x733d('0x7a')];logger[_0x733d('0x7b')](_0x733d('0x7c'),_0xe1878a[_0x733d('0x51')],_0xe1878a[_0x733d('0x59')]);Object['assign'](_0xe1878a,_[_0x733d('0x7d')](_0x236fbc,_[_0x733d('0x7e')](_0xe1878a)));this[_0x733d('0x10')][_0x236fbc['uniqueid']]['push'](_0xe1878a);this[_0x733d('0x13')][_0x236fbc['uniqueid']]=_0xe1878a;this[_0x733d('0x4b')](_0xe1878a,_0x733d('0x1d'));}}catch(_0x40126d){logger[_0x733d('0x42')](_0x733d('0x75'),_0x236fbc[_0x733d('0x4e')],util[_0x733d('0x44')](_0x40126d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x20')]=function(_0x1dc78f){try{if(this[_0x733d('0x5d')](_0x1dc78f)){logger['debug'](_0x733d('0x7f'),_0x1dc78f[_0x733d('0x4e')],util[_0x733d('0x44')](_0x1dc78f,{'showHidden':![],'depth':null}));if(this[_0x733d('0x10')][_0x1dc78f[_0x733d('0x4e')]]){var _0x1f974c=_[_0x733d('0x80')](this[_0x733d('0x10')][_0x1dc78f['uniqueid']]);_0x1f974c['queuecallercomplete']=![];_0x1f974c[_0x733d('0x81')]=null;_0x1f974c[_0x733d('0x82')]=_0x1dc78f[_0x733d('0x82')];_0x1f974c[_0x733d('0x83')]=_0x1dc78f[_0x733d('0x83')];_0x1f974c[_0x733d('0x1f')]=!![];_0x1f974c[_0x733d('0x84')]=moment()[_0x733d('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f974c[_0x733d('0x55')]=_0x733d('0x85');_0x1f974c[_0x733d('0x86')]=null;logger[_0x733d('0x7b')](_0x733d('0x87'),_0x1f974c[_0x733d('0x51')],_0x1f974c['type']);this[_0x733d('0x13')][_0x1dc78f['uniqueid']]=_0x1f974c;this[_0x733d('0x49')](_0x1f974c,_0x733d('0x1f'));}}}catch(_0x499728){logger[_0x733d('0x42')](_0x733d('0x7f'),_0x1dc78f[_0x733d('0x4e')],util[_0x733d('0x44')](_0x499728,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x22')]=function(_0xe5122){try{if(this[_0x733d('0x5d')](_0xe5122)){logger[_0x733d('0x4c')](_0x733d('0x88'),_0xe5122[_0x733d('0x4e')],util[_0x733d('0x44')](_0xe5122,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xe5122[_0x733d('0x4e')]]){var _0x269a72=_[_0x733d('0x80')](this[_0x733d('0x10')][_0xe5122['uniqueid']]);_0x269a72[_0x733d('0x89')]=moment()['format'](_0x733d('0x77'));_0x269a72[_0x733d('0x8a')]=_0xe5122[_0x733d('0x8a')];_0x269a72['connectedlinename']=_0xe5122[_0x733d('0x8b')];logger[_0x733d('0x7b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x269a72[_0x733d('0x51')],_0x269a72[_0x733d('0x59')],_0xe5122['connectedlinenum'],_0xe5122[_0x733d('0x8b')]);this[_0x733d('0x13')][_0xe5122[_0x733d('0x4e')]]=_0x269a72;this[_0x733d('0x4b')](_0x269a72,'queuecallerleave');}}}catch(_0x11cda8){logger[_0x733d('0x42')](_0x733d('0x88'),_0xe5122[_0x733d('0x4e')],util[_0x733d('0x44')](_0x11cda8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x25')]=function(_0x2a9e5d){try{if(this[_0x733d('0x5d')](_0x2a9e5d)){logger['debug'](_0x733d('0x8c'),_0x2a9e5d[_0x733d('0x4e')],util[_0x733d('0x44')](_0x2a9e5d,{'showHidden':![],'depth':null}));if(this[_0x733d('0x10')][_0x2a9e5d[_0x733d('0x4e')]]){var _0x1f5e7a=_[_0x733d('0x80')](this['queueReports'][_0x2a9e5d[_0x733d('0x4e')]]);_0x1f5e7a[_0x733d('0x39')]=!![];_0x1f5e7a[_0x733d('0x55')]=_0x733d('0x8d');logger[_0x733d('0x7b')](_0x733d('0x8e'),_0x1f5e7a[_0x733d('0x51')],_0x1f5e7a['type']);}}}catch(_0x38f277){logger[_0x733d('0x42')](_0x733d('0x8c'),_0x2a9e5d['uniqueid'],util[_0x733d('0x44')](_0x38f277,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0x23')]=function(_0x57aa32){try{if(this['isNotNull'](_0x57aa32)){logger[_0x733d('0x4c')]('[%s][voiceQueueReport][agentcomplete]',_0x57aa32[_0x733d('0x4e')],util[_0x733d('0x44')](_0x57aa32,{'showHidden':![],'depth':null}));if(this[_0x733d('0x10')][_0x57aa32[_0x733d('0x4e')]]){var _0x4ead5e=_[_0x733d('0x80')](this[_0x733d('0x10')][_0x57aa32[_0x733d('0x4e')]]);_0x4ead5e['queuecallerabandon']=![];_0x4ead5e[_0x733d('0x84')]=null;_0x4ead5e[_0x733d('0x8f')]=!![];_0x4ead5e['lastAssignedTo']=_0x57aa32[_0x733d('0x90')];_0x4ead5e['holdtime']=_0x57aa32['holdtime'];_0x4ead5e[_0x733d('0x39')]=!![];_0x4ead5e[_0x733d('0x38')]=![];_0x4ead5e['queuecallerexitAt']=null;if(!_0x4ead5e[_0x733d('0x91')]){if(_0x57aa32[_0x733d('0x92')]==_0x733d('0x91')){_0x4ead5e[_0x733d('0x55')]=_0x733d('0x93');logger[_0x733d('0x7b')](_0x733d('0x94'),_0x4ead5e[_0x733d('0x51')],_0x4ead5e[_0x733d('0x59')]);}else{if(_[_0x733d('0x95')](_0x57aa32['channel']['toLowerCase'](),'local/')){if(this[_0x733d('0x10')][_0x57aa32[_0x733d('0x96')]]){var _0x504f88=_[_0x733d('0x80')](this['queueReports'][_0x57aa32['linkedid']]);_0x504f88['queuecallercomplete']=![];_0x504f88[_0x733d('0x38')]=!![];_0x504f88['queuecallerexitAt']=moment(_0x4ead5e[_0x733d('0x76')])[_0x733d('0x97')](_0x57aa32['holdtime'],_0x733d('0x98'))[_0x733d('0x4f')](_0x733d('0x77'));_0x504f88[_0x733d('0x55')]=_0x733d('0x99');_0x504f88['transfer']=!![];_0x504f88[_0x733d('0x9a')]='FORWARD';_0x504f88['transferexten']=_0x57aa32['destexten'];_0x504f88['transferuniqueid']=_0x57aa32[_0x733d('0x4e')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x504f88[_0x733d('0x51')],_0x504f88[_0x733d('0x59')]);var _0x1dda58=this[_0x733d('0x10')][_0x57aa32[_0x733d('0x96')]];this['queueReports'][_0x57aa32[_0x733d('0x96')]]=this[_0x733d('0x10')][_0x57aa32['uniqueid']];this[_0x733d('0x10')][_0x57aa32[_0x733d('0x4e')]]=_0x1dda58;}}else{_0x4ead5e[_0x733d('0x55')]='COMPLETEDBY'+_0x57aa32['reason'][_0x733d('0x9b')]();logger['info'](_0x733d('0x9c'),_0x4ead5e['queue'],_0x4ead5e['type'],_0x4ead5e[_0x733d('0x55')]);}}}this[_0x733d('0x13')][_0x57aa32[_0x733d('0x4e')]]=_0x4ead5e;}}}catch(_0x5007f7){logger['error'](_0x733d('0x9d'),_0x57aa32[_0x733d('0x4e')],util[_0x733d('0x44')](_0x5007f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')]['syncVarSet']=function(_0x66dc45){try{if(this[_0x733d('0x5d')](_0x66dc45)){logger[_0x733d('0x4c')](_0x733d('0x9e'),_0x66dc45[_0x733d('0x4e')],util[_0x733d('0x44')](_0x66dc45,{'showHidden':![],'depth':null}));this['addVariable'](_0x66dc45[_0x733d('0x4e')],_['keys'](_0x66dc45[_0x733d('0x9f')])[0x0],_0x66dc45['value']);if(this[_0x733d('0x10')][_0x66dc45[_0x733d('0x4e')]]){var _0x6d9ac0=_[_0x733d('0x80')](this[_0x733d('0x10')][_0x66dc45[_0x733d('0x4e')]]);if(_0x6d9ac0){if(this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')])&&this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')][_0x733d('0x63')])){switch(_0x66dc45[_0x733d('0xa0')]){case _0x733d('0xa1'):_0x6d9ac0['queuecallerexit']=![];_0x6d9ac0[_0x733d('0xa2')]=null;break;case'TIMEOUT':_0x6d9ac0[_0x733d('0xa3')]=_0x733d('0xa4');_0x6d9ac0[_0x733d('0x38')]=!![];_0x6d9ac0[_0x733d('0xa2')]=moment()[_0x733d('0x4f')](_0x733d('0x77'));_0x6d9ac0['queuecallerleaveAt']=moment()[_0x733d('0x4f')](_0x733d('0x77'));logger['debug'](_0x733d('0xa5'),_0x66dc45[_0x733d('0x4e')],util[_0x733d('0x44')](_0x6d9ac0,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x6d9ac0);break;default:_0x6d9ac0[_0x733d('0x38')]=!![];_0x6d9ac0[_0x733d('0xa2')]=moment()[_0x733d('0x4f')](_0x733d('0x77'));_0x6d9ac0[_0x733d('0x89')]=moment()[_0x733d('0x4f')](_0x733d('0x77'));}_0x6d9ac0[_0x733d('0x1f')]=![];_0x6d9ac0[_0x733d('0x84')]=null;_0x6d9ac0['queuecallerexitreason']=_0x66dc45[_0x733d('0xa0')];this['channels'][_0x66dc45[_0x733d('0x4e')]]=_0x6d9ac0;this[_0x733d('0x49')](_0x6d9ac0,'varset');}else if(this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')])&&this[_0x733d('0x5d')](_0x66dc45[_0x733d('0x9f')][_0x733d('0xa6')])){if(!_0x6d9ac0[_0x733d('0x1f')]){_0x6d9ac0[_0x733d('0x38')]=!![];_0x6d9ac0[_0x733d('0xa2')]=moment()[_0x733d('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x6d9ac0[_0x733d('0x55')]=_0x733d('0xa7');_0x6d9ac0[_0x733d('0x89')]=moment()['format'](_0x733d('0x77'));this[_0x733d('0x13')][_0x66dc45['uniqueid']]=_0x6d9ac0;}}logger[_0x733d('0x7b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x66dc45['uniqueid'],_0x6d9ac0[_0x733d('0x51')],_0x6d9ac0[_0x733d('0x59')],_[_0x733d('0x7e')](_0x66dc45[_0x733d('0x9f')])[0x0],_0x66dc45[_0x733d('0xa0')]);_0x6d9ac0[_0x733d('0x17')]=this['variables'][_0x66dc45['uniqueid']];}}}}catch(_0x3910b6){logger[_0x733d('0x42')](_0x733d('0x9e'),_0x66dc45[_0x733d('0x4e')],util[_0x733d('0x44')](_0x3910b6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0xa8')]=function(_0x1aa8a8,_0x11519b,_0x396748){var _0x456582=[_0x733d('0xa9'),'rtpaudioqosbridged',_0x733d('0xaa'),_0x733d('0xab'),'rtpaudioqosloss',_0x733d('0xac'),'rtpaudioqosrtt',_0x733d('0xad'),_0x733d('0xae'),_0x733d('0xaf'),_0x733d('0xb0'),'bridgepvtcallid',_0x733d('0xb1'),_0x733d('0xb2'),_0x733d('0xb3'),'memberlastcall',_0x733d('0x90'),_0x733d('0xb4'),_0x733d('0xb5')];if(!_['isNil'](_0x11519b)&&!_[_0x733d('0xb6')](_0x456582,_0x11519b)){if(_[_0x733d('0x5e')](this[_0x733d('0x17')][_0x1aa8a8])){this[_0x733d('0x17')][_0x1aa8a8]={};}this[_0x733d('0x17')][_0x1aa8a8][_0x11519b]=_0x396748;}};VoiceQueueReport[_0x733d('0xb')][_0x733d('0xb7')]=function(_0x3b6f8b,_0x261272,_0x106c3d){try{var _0x3057b4={};if(this[_0x733d('0x10')][_0x3b6f8b]){for(var _0x511038=0x0;_0x5110380x0?!![]:![];if(!_0x18f30f){return this[_0x837e('0x1c')](this[_0x837e('0x4e')][_0x837e('0x72')]);}};VoiceQueueReport['prototype'][_0x837e('0x1e')]=function(_0x515135){var _0x21a05e=this[_0x837e('0x4e')]['id'];if(this[_0x837e('0x4e')][_0x837e('0x6e')][_0x21a05e]&&this[_0x837e('0x4e')]['queuestatus'][_0x21a05e][_0x515135[_0x837e('0x65')]]){this[_0x837e('0x4e')][_0x837e('0x6e')][_0x21a05e][_0x515135['actionid']][_0x837e('0x13')][_0x837e('0x73')](_0x515135);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x52607e){var _0x2fe527=this;try{if(this[_0x837e('0x60')](_0x52607e)&&this[_0x837e('0x60')](_0x52607e[_0x837e('0x57')])){logger[_0x837e('0x52')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x837e('0x47')](_0x52607e,{'showHidden':![],'depth':null}));var _0x2260f6=this[_0x837e('0x16')][_0x52607e[_0x837e('0x57')]];if(_0x2260f6){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x2260f6[_0x837e('0x69')]);this[_0x837e('0x4e')][_0x837e('0x68')][_0x2260f6[_0x837e('0x69')]]={'summaryEvent':_0x52607e};this['summary']['statusRequests']+=0x1;return ami[_0x837e('0x40')]({'action':_0x837e('0x6e'),'queue':_0x2260f6[_0x837e('0x69')]})[_0x837e('0x64')](function(_0x323a85){if(!_0x2fe527[_0x837e('0x4e')][_0x837e('0x6e')][_0x52607e[_0x837e('0x65')]]){_0x2fe527[_0x837e('0x4e')][_0x837e('0x6e')][_0x52607e[_0x837e('0x65')]]={};}_0x2fe527['summary']['queuestatus'][_0x52607e['actionid']][_0x323a85['actionid']]={'queue':_0x2260f6[_0x837e('0x69')],'agents':[]};})['catch'](function(_0x5ce46d){throw _0x5ce46d;});}}}catch(_0x2f47ca){logger[_0x837e('0x45')](_0x837e('0x66'),util[_0x837e('0x47')](_0x2f47ca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x837e('0xd')][_0x837e('0x1c')]=function(_0x159e60){if(this[_0x837e('0x4e')][_0x837e('0x71')]>0x0){this[_0x837e('0x4e')][_0x837e('0x72')]=_0x159e60;return;}logger[_0x837e('0x52')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x837e('0x47')](_0x159e60,{'showHidden':![],'depth':null}));this[_0x837e('0x4e')]=initializeSummary();ami[_0x837e('0x51')](_0x837e('0x74'),{});};VoiceQueueReport[_0x837e('0xd')][_0x837e('0x75')]=function(_0x5681da){try{if(this['isNotNull'](_0x5681da)){logger[_0x837e('0x52')](_0x837e('0x76'),_0x5681da[_0x837e('0x54')],util[_0x837e('0x47')](_0x5681da,{'showHidden':![],'depth':null}));if(_[_0x837e('0x61')](this[_0x837e('0x48')][_0x5681da['uniqueid']])){this[_0x837e('0x48')][_0x5681da[_0x837e('0x54')]]=[];}if(_['isUndefined'](this['channels'][_0x5681da[_0x837e('0x54')]])){this[_0x837e('0x14')][_0x5681da[_0x837e('0x54')]]={};}var _0x23e21a=new QueueReport();_0x23e21a['queue']=_0x5681da[_0x837e('0x57')];_0x23e21a[_0x837e('0x5c')]=this[_0x837e('0x16')][_0x23e21a[_0x837e('0x57')]]&&this[_0x837e('0x16')][_0x23e21a['queue']]['type']?this['voiceQueues'][_0x23e21a[_0x837e('0x57')]][_0x837e('0x5c')]||_0x837e('0x5d'):_0x837e('0x5d');_0x23e21a['queuecallerjoinAt']=moment()['format'](_0x837e('0x77'));_0x23e21a[_0x837e('0x78')]=_0x5681da[_0x837e('0x78')];_0x23e21a[_0x837e('0x79')]=_0x5681da[_0x837e('0x79')];_0x23e21a[_0x837e('0x54')]=_0x5681da[_0x837e('0x54')];_0x23e21a['routealias']=this['channels'][_0x5681da[_0x837e('0x54')]][_0x837e('0x7a')];logger[_0x837e('0x7b')](_0x837e('0x7c'),_0x23e21a[_0x837e('0x57')],_0x23e21a[_0x837e('0x5c')]);Object[_0x837e('0x6d')](_0x23e21a,_['pick'](_0x5681da,_[_0x837e('0x7d')](_0x23e21a)));this[_0x837e('0x48')][_0x5681da[_0x837e('0x54')]][_0x837e('0x73')](_0x23e21a);this[_0x837e('0x14')][_0x5681da[_0x837e('0x54')]]=_0x23e21a;this[_0x837e('0x7e')](_0x23e21a,_0x837e('0x21'));}}catch(_0x19caa8){logger['error'](_0x837e('0x76'),_0x5681da[_0x837e('0x54')],util[_0x837e('0x47')](_0x19caa8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x837e('0xd')][_0x837e('0x23')]=function(_0x366067){try{if(this[_0x837e('0x60')](_0x366067)){logger['debug'](_0x837e('0x7f'),_0x366067[_0x837e('0x54')],util[_0x837e('0x47')](_0x366067,{'showHidden':![],'depth':null}));if(this[_0x837e('0x48')][_0x366067['uniqueid']]){var _0x5193a8=_[_0x837e('0x80')](this['queueReports'][_0x366067[_0x837e('0x54')]]);_0x5193a8[_0x837e('0x3c')]=![];_0x5193a8[_0x837e('0x81')]=null;_0x5193a8[_0x837e('0x82')]=_0x366067[_0x837e('0x82')];_0x5193a8[_0x837e('0x83')]=_0x366067[_0x837e('0x83')];_0x5193a8[_0x837e('0x22')]=!![];_0x5193a8['queuecallerabandonAt']=moment()[_0x837e('0x55')](_0x837e('0x77'));_0x5193a8[_0x837e('0x84')]='ABANDONED';_0x5193a8['lastAssignedTo']=null;logger[_0x837e('0x7b')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x5193a8[_0x837e('0x57')],_0x5193a8['type']);this[_0x837e('0x14')][_0x366067['uniqueid']]=_0x5193a8;this[_0x837e('0x4f')](_0x5193a8,_0x837e('0x22'));}}}catch(_0x47cac9){logger['error'](_0x837e('0x7f'),_0x366067[_0x837e('0x54')],util[_0x837e('0x47')](_0x47cac9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x837e('0xd')]['syncQueueCallerLeave']=function(_0x454e4c){try{if(this[_0x837e('0x60')](_0x454e4c)){logger[_0x837e('0x52')](_0x837e('0x85'),_0x454e4c[_0x837e('0x54')],util['inspect'](_0x454e4c,{'showHidden':![],'depth':null}));if(this[_0x837e('0x48')][_0x454e4c[_0x837e('0x54')]]){var _0x581195=_[_0x837e('0x80')](this[_0x837e('0x48')][_0x454e4c[_0x837e('0x54')]]);_0x581195['queuecallerleaveAt']=moment()[_0x837e('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x581195[_0x837e('0x86')]=_0x454e4c['connectedlinenum'];_0x581195[_0x837e('0x87')]=_0x454e4c[_0x837e('0x87')];logger[_0x837e('0x7b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x581195[_0x837e('0x57')],_0x581195[_0x837e('0x5c')],_0x454e4c[_0x837e('0x86')],_0x454e4c[_0x837e('0x87')]);this[_0x837e('0x14')][_0x454e4c[_0x837e('0x54')]]=_0x581195;this[_0x837e('0x7e')](_0x581195,_0x837e('0x24'));}}}catch(_0x1a36b2){logger[_0x837e('0x45')](_0x837e('0x85'),_0x454e4c['uniqueid'],util[_0x837e('0x47')](_0x1a36b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x837e('0xd')][_0x837e('0x27')]=function(_0x55cbb3){try{if(this['isNotNull'](_0x55cbb3)){logger['debug'](_0x837e('0x88'),_0x55cbb3['uniqueid'],util[_0x837e('0x47')](_0x55cbb3,{'showHidden':![],'depth':null}));if(this[_0x837e('0x48')][_0x55cbb3[_0x837e('0x54')]]){var _0x12c8b4=_['last'](this[_0x837e('0x48')][_0x55cbb3[_0x837e('0x54')]]);_0x12c8b4['queuecallercomplete']=!![];_0x12c8b4[_0x837e('0x84')]=_0x837e('0x89');logger['info'](_0x837e('0x8a'),_0x12c8b4[_0x837e('0x57')],_0x12c8b4[_0x837e('0x5c')]);}}}catch(_0x346be9){logger[_0x837e('0x45')]('[%s][voiceQueueReport][agentconnect]',_0x55cbb3[_0x837e('0x54')],util['inspect'](_0x346be9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x837e('0xd')][_0x837e('0x26')]=function(_0x2a3610){try{if(this[_0x837e('0x60')](_0x2a3610)){logger[_0x837e('0x52')]('[%s][voiceQueueReport][agentcomplete]',_0x2a3610[_0x837e('0x54')],util[_0x837e('0x47')](_0x2a3610,{'showHidden':![],'depth':null}));if(this[_0x837e('0x48')][_0x2a3610['uniqueid']]){var _0xbc6a21=_[_0x837e('0x80')](this['queueReports'][_0x2a3610['uniqueid']]);_0xbc6a21['queuecallerabandon']=![];_0xbc6a21[_0x837e('0x8b')]=null;_0xbc6a21[_0x837e('0x8c')]=!![];_0xbc6a21['lastAssignedTo']=_0x2a3610[_0x837e('0x8d')];_0xbc6a21['holdtime']=_0x2a3610[_0x837e('0x82')];_0xbc6a21[_0x837e('0x3c')]=!![];_0xbc6a21[_0x837e('0x3b')]=![];_0xbc6a21[_0x837e('0x8e')]=null;if(!_0xbc6a21[_0x837e('0x8f')]){if(_0x2a3610[_0x837e('0x90')]==_0x837e('0x8f')){_0xbc6a21[_0x837e('0x84')]=_0x837e('0x91');logger['info'](_0x837e('0x92'),_0xbc6a21[_0x837e('0x57')],_0xbc6a21['type']);}else{if(_[_0x837e('0x93')](_0x2a3610[_0x837e('0x94')][_0x837e('0x95')](),_0x837e('0x96'))){if(this['queueReports'][_0x2a3610[_0x837e('0x97')]]){var _0x3aecf5=_[_0x837e('0x80')](this[_0x837e('0x48')][_0x2a3610[_0x837e('0x97')]]);_0x3aecf5[_0x837e('0x3c')]=![];_0x3aecf5['queuecallerexit']=!![];_0x3aecf5[_0x837e('0x8e')]=moment(_0xbc6a21['queuecallerjoinAt'])['add'](_0x2a3610[_0x837e('0x82')],'seconds')['format'](_0x837e('0x77'));_0x3aecf5[_0x837e('0x84')]=_0x837e('0x98');_0x3aecf5[_0x837e('0x8f')]=!![];_0x3aecf5[_0x837e('0x99')]='FORWARD';_0x3aecf5[_0x837e('0x9a')]=_0x2a3610['destexten'];_0x3aecf5[_0x837e('0x9b')]=_0x2a3610[_0x837e('0x54')];logger[_0x837e('0x7b')](_0x837e('0x9c'),_0x3aecf5[_0x837e('0x57')],_0x3aecf5['type']);var _0x9f3ebf=this[_0x837e('0x48')][_0x2a3610[_0x837e('0x97')]];this[_0x837e('0x48')][_0x2a3610[_0x837e('0x97')]]=this['queueReports'][_0x2a3610[_0x837e('0x54')]];this['queueReports'][_0x2a3610['uniqueid']]=_0x9f3ebf;}}else{_0xbc6a21[_0x837e('0x84')]=_0x837e('0x9d')+_0x2a3610['reason'][_0x837e('0x9e')]();logger[_0x837e('0x7b')](_0x837e('0x9f'),_0xbc6a21[_0x837e('0x57')],_0xbc6a21[_0x837e('0x5c')],_0xbc6a21[_0x837e('0x84')]);}}}this['channels'][_0x2a3610[_0x837e('0x54')]]=_0xbc6a21;}}}catch(_0x3526c0){logger[_0x837e('0x45')](_0x837e('0xa0'),_0x2a3610['uniqueid'],util['inspect'](_0x3526c0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x837e('0xd')]['syncVarSet']=function(_0x4320ea){try{if(this[_0x837e('0x60')](_0x4320ea)){logger[_0x837e('0x52')]('[%s][voiceQueueReport][varset]',_0x4320ea[_0x837e('0x54')],util[_0x837e('0x47')](_0x4320ea,{'showHidden':![],'depth':null}));this[_0x837e('0xa1')](_0x4320ea[_0x837e('0x54')],_['keys'](_0x4320ea['variable'])[0x0],_0x4320ea[_0x837e('0xa2')]);if(this[_0x837e('0x48')][_0x4320ea[_0x837e('0x54')]]){var _0x1557e5=_[_0x837e('0x80')](this[_0x837e('0x48')][_0x4320ea[_0x837e('0x54')]]);if(_0x1557e5){if(this[_0x837e('0x60')](_0x4320ea[_0x837e('0xa3')])&&this[_0x837e('0x60')](_0x4320ea[_0x837e('0xa3')][_0x837e('0x6e')])){switch(_0x4320ea[_0x837e('0xa2')]){case'CONTINUE':_0x1557e5[_0x837e('0x3b')]=![];_0x1557e5['queuecallerexitAt']=null;break;case _0x837e('0xa4'):_0x1557e5[_0x837e('0xa5')]='timeout';_0x1557e5['queuecallerexit']=!![];_0x1557e5[_0x837e('0x8e')]=moment()[_0x837e('0x55')](_0x837e('0x77'));_0x1557e5[_0x837e('0xa6')]=moment()['format'](_0x837e('0x77'));logger[_0x837e('0x52')](_0x837e('0xa7'),_0x4320ea[_0x837e('0x54')],util['inspect'](_0x1557e5,{'showHidden':![],'depth':null}));ami['emit'](_0x837e('0xa8'),_0x1557e5);break;default:_0x1557e5[_0x837e('0x3b')]=!![];_0x1557e5[_0x837e('0x8e')]=moment()[_0x837e('0x55')](_0x837e('0x77'));_0x1557e5[_0x837e('0xa6')]=moment()[_0x837e('0x55')](_0x837e('0x77'));}_0x1557e5[_0x837e('0x22')]=![];_0x1557e5[_0x837e('0x8b')]=null;_0x1557e5['queuecallerexitreason']=_0x4320ea[_0x837e('0xa2')];this['channels'][_0x4320ea[_0x837e('0x54')]]=_0x1557e5;this[_0x837e('0x4f')](_0x1557e5,_0x837e('0x28'));}else if(this[_0x837e('0x60')](_0x4320ea[_0x837e('0xa3')])&&this['isNotNull'](_0x4320ea[_0x837e('0xa3')]['queueposition'])){if(!_0x1557e5[_0x837e('0x22')]){_0x1557e5[_0x837e('0x3b')]=!![];_0x1557e5[_0x837e('0x8e')]=moment()[_0x837e('0x55')](_0x837e('0x77'));_0x1557e5[_0x837e('0x84')]=_0x837e('0xa9');_0x1557e5[_0x837e('0xa6')]=moment()['format'](_0x837e('0x77'));this[_0x837e('0x14')][_0x4320ea[_0x837e('0x54')]]=_0x1557e5;}}logger[_0x837e('0x7b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x4320ea[_0x837e('0x54')],_0x1557e5['queue'],_0x1557e5['type'],_[_0x837e('0x7d')](_0x4320ea[_0x837e('0xa3')])[0x0],_0x4320ea[_0x837e('0xa2')]);_0x1557e5[_0x837e('0x49')]=this['variables'][_0x4320ea[_0x837e('0x54')]];}}}}catch(_0x1378dc){logger[_0x837e('0x45')]('[%s][voiceQueueReport][varset]',_0x4320ea['uniqueid'],util['inspect'](_0x1378dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x837e('0xd')][_0x837e('0xa1')]=function(_0x54d99c,_0x3eb520,_0x236d65){var _0x3088c3=[_0x837e('0xaa'),_0x837e('0xab'),_0x837e('0xac'),_0x837e('0xad'),_0x837e('0xae'),_0x837e('0xaf'),_0x837e('0xb0'),_0x837e('0xb1'),_0x837e('0xb2'),_0x837e('0xb3'),_0x837e('0xb4'),_0x837e('0xb5'),_0x837e('0xb6'),_0x837e('0xb7'),_0x837e('0xb8'),_0x837e('0xb9'),_0x837e('0x8d'),_0x837e('0xba'),_0x837e('0xbb')];if(!_[_0x837e('0x3f')](_0x3eb520)&&!_[_0x837e('0xbc')](_0x3088c3,_0x3eb520)){if(_['isUndefined'](this[_0x837e('0x49')][_0x54d99c])){this[_0x837e('0x49')][_0x54d99c]={};}this[_0x837e('0x49')][_0x54d99c][_0x3eb520]=_0x236d65;}};VoiceQueueReport[_0x837e('0xd')]['handleHangup']=function(_0x46a44b,_0x465cbf,_0x1fbbf8){try{var _0xadc5e2={};if(this[_0x837e('0x48')][_0x46a44b]){for(var _0x2a89f5=0x0;_0x2a89f5=0x0?moment(_0x18296d[_0x619f('0x18')])['diff'](_0x18296d[_0x619f('0x17')],'seconds'):null,'data1':'outbound','data2':_0x18296d[_0x619f('0x11')],'data3':_0x18296d[_0x619f('0xf')],'data4':_0x18296d[_0x619f('0x1a')]||null,'role':_0x619f('0x10'),'internal':_0x18296d[_0x619f('0x11')]?_[_0x619f('0x12')](_0x18296d[_0x619f('0x11')]):undefined,'uniqueid':_0x18296d[_0x619f('0x13')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xcb69=['queue','accountcode','toNumber','uniqueid','voiceDialReport','membername','TALKING','endtime','starttime','seconds','outbound','exten','agent','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','queuecallerleaveAt','diff','calleridnum'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xcb69,0x195));var _0x9cb6=function(_0x211d0c,_0x1743de){_0x211d0c=_0x211d0c-0x0;var _0x58fc6b=_0xcb69[_0x211d0c];return _0x58fc6b;};'use strict';var moment=require(_0x9cb6('0x0'));var _=require(_0x9cb6('0x1'));var util=require(_0x9cb6('0x2'));var client=require('../client');exports[_0x9cb6('0x3')]=function(_0x35e3ae){var _0x3944a8=_0x35e3ae[_0x9cb6('0x4')]||_0x35e3ae['queuecallerexitAt'];return client[_0x9cb6('0x5')](_0x9cb6('0x6'),{'body':{'channel':_0x9cb6('0x7'),'membername':_0x35e3ae[_0x9cb6('0x8')],'interface':_[_0x9cb6('0x9')](_0x35e3ae[_0x9cb6('0xa')])?util[_0x9cb6('0xb')]('SIP/%s',_0x35e3ae[_0x9cb6('0x8')]):_0x35e3ae[_0x9cb6('0xa')],'type':'TALKING','enterAt':_0x35e3ae[_0x9cb6('0xc')],'exitAt':_0x3944a8,'duration':moment(_0x3944a8)[_0x9cb6('0xd')](_0x35e3ae[_0x9cb6('0xc')],'seconds'),'data1':'inbound','data2':_0x35e3ae[_0x9cb6('0xe')],'data3':_0x35e3ae['exten'],'data4':null,'data5':_0x35e3ae[_0x9cb6('0xf')],'role':'agent','internal':_0x35e3ae[_0x9cb6('0x10')]?_[_0x9cb6('0x11')](_0x35e3ae[_0x9cb6('0x10')]):undefined,'uniqueid':_0x35e3ae[_0x9cb6('0x12')]},'log':_0x9cb6('0x6')});};exports[_0x9cb6('0x13')]=function(_0x2f12e8){return client[_0x9cb6('0x5')](_0x9cb6('0x6'),{'body':{'channel':_0x9cb6('0x7'),'membername':_0x2f12e8[_0x9cb6('0x14')],'interface':_0x2f12e8[_0x9cb6('0xa')],'type':_0x9cb6('0x15'),'enterAt':_0x2f12e8['starttime'],'exitAt':_0x2f12e8[_0x9cb6('0x16')],'duration':moment(_0x2f12e8[_0x9cb6('0x16')])[_0x9cb6('0xd')](_0x2f12e8[_0x9cb6('0x17')],_0x9cb6('0x18'))>=0x0?moment(_0x2f12e8[_0x9cb6('0x16')])['diff'](_0x2f12e8[_0x9cb6('0x17')],_0x9cb6('0x18')):null,'data1':_0x9cb6('0x19'),'data2':_0x2f12e8[_0x9cb6('0x10')],'data3':_0x2f12e8[_0x9cb6('0x1a')],'data4':_0x2f12e8['dialstring']||null,'role':_0x9cb6('0x1b'),'internal':_0x2f12e8[_0x9cb6('0x10')]?_[_0x9cb6('0x11')](_0x2f12e8[_0x9cb6('0x10')]):undefined,'uniqueid':_0x2f12e8['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index aa5a23c..5af2181 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 _0x2b65=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0x2b65,0x131));var _0x52b6=function(_0x13eaae,_0x11ec0a){_0x13eaae=_0x13eaae-0x0;var _0x4493db=_0x2b65[_0x13eaae];return _0x4493db;};'use strict';var client=require(_0x52b6('0x0'));exports[_0x52b6('0x1')]=function(){return client[_0x52b6('0x2')](_0x52b6('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x52b6('0x4'),_0x52b6('0x5')]},'log':_0x52b6('0x6')});}; \ No newline at end of file +var _0x4a83=['stopRecordingOnTransfer','getSettings','Request','ShowSetting'];(function(_0x52953,_0x44eeb2){var _0x568f54=function(_0x595ffe){while(--_0x595ffe){_0x52953['push'](_0x52953['shift']());}};_0x568f54(++_0x44eeb2);}(_0x4a83,0x125));var _0x34a8=function(_0x2a8bad,_0x78213e){_0x2a8bad=_0x2a8bad-0x0;var _0x117a07=_0x4a83[_0x2a8bad];return _0x117a07;};'use strict';var client=require('../client');exports[_0x34a8('0x0')]=function(){return client[_0x34a8('0x1')](_0x34a8('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x34a8('0x3'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index d21ba05..4196374 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 _0x1ad2=['getTemplates','html','GetTemplate','../client'];(function(_0x26fb16,_0x4d40ad){var _0x1e6e90=function(_0x2dd264){while(--_0x2dd264){_0x26fb16['push'](_0x26fb16['shift']());}};_0x1e6e90(++_0x4d40ad);}(_0x1ad2,0x19b));var _0x21ad=function(_0xaf15c2,_0x3238c1){_0xaf15c2=_0xaf15c2-0x0;var _0x475398=_0x1ad2[_0xaf15c2];return _0x475398;};'use strict';var client=require(_0x21ad('0x0'));exports[_0x21ad('0x1')]=function(_0x4e0cc6){return function(_0x53e3ca){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x21ad('0x2')]},'log':_0x21ad('0x3')});};}; \ No newline at end of file +var _0x1186=['html','getTemplates','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1186,0xbe));var _0x6118=function(_0x5bfa64,_0x3d540d){_0x5bfa64=_0x5bfa64-0x0;var _0xcc95dd=_0x1186[_0x5bfa64];return _0xcc95dd;};'use strict';var client=require('../client');exports[_0x6118('0x0')]=function(_0x523f58){return function(_0x3f1f5d){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x6118('0x1'),_0x6118('0x2')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 8eda349..618183d 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 _0x64e3=['data3','data5','data6','data7','GetTrigger','../client','getTriggers','Request','name','Condition','AllConditions','field','value','AnyConditions','operator','data1','data2'];(function(_0x1de837,_0x225e84){var _0x46a186=function(_0xdbca57){while(--_0xdbca57){_0x1de837['push'](_0x1de837['shift']());}};_0x46a186(++_0x225e84);}(_0x64e3,0x17b));var _0x364e=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0x64e3[_0x5de1bc];return _0x19f4b8;};'use strict';var client=require(_0x364e('0x0'));exports[_0x364e('0x1')]=function(_0x22d7d0){return function(_0x14372a){return client[_0x364e('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x364e('0x3'),'channel','status'],'include':[{'model':_0x364e('0x4'),'as':_0x364e('0x5'),'attributes':['id',_0x364e('0x6'),'operator',_0x364e('0x7')]},{'model':_0x364e('0x4'),'as':_0x364e('0x8'),'attributes':['id',_0x364e('0x6'),_0x364e('0x9'),'value']},{'model':'Action','as':'Actions','attributes':['id','action',_0x364e('0xa'),_0x364e('0xb'),_0x364e('0xc'),'data4',_0x364e('0xd'),_0x364e('0xe'),_0x364e('0xf')]}]},'log':_0x364e('0x10')});};}; \ No newline at end of file +var _0x262d=['AnyConditions','action','data1','data2','data3','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field','operator','value'];(function(_0x4f4bd1,_0x1ec09a){var _0x23eed9=function(_0x3b272f){while(--_0x3b272f){_0x4f4bd1['push'](_0x4f4bd1['shift']());}};_0x23eed9(++_0x1ec09a);}(_0x262d,0x149));var _0xd262=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x262d[_0xbe200f];return _0x192597;};'use strict';var client=require(_0xd262('0x0'));exports[_0xd262('0x1')]=function(_0x5ed578){return function(_0x1bda52){return client[_0xd262('0x2')](_0xd262('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd262('0x4'),_0xd262('0x5')],'include':[{'model':_0xd262('0x6'),'as':_0xd262('0x7'),'attributes':['id',_0xd262('0x8'),_0xd262('0x9'),_0xd262('0xa')]},{'model':_0xd262('0x6'),'as':_0xd262('0xb'),'attributes':['id','field','operator',_0xd262('0xa')]},{'model':'Action','as':'Actions','attributes':['id',_0xd262('0xc'),_0xd262('0xd'),_0xd262('0xe'),_0xd262('0xf'),_0xd262('0x10'),_0xd262('0x11'),_0xd262('0x12'),_0xd262('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b0d13c3..a0eec45 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 _0xbfc0=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x3eeb13,_0x33d336){var _0x250f63=function(_0x3e0e9b){while(--_0x3e0e9b){_0x3eeb13['push'](_0x3eeb13['shift']());}};_0x250f63(++_0x33d336);}(_0xbfc0,0x125));var _0x0bfc=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0xbfc0[_0x564e9f];return _0x3a9f3e;};'use strict';var client=require(_0x0bfc('0x0'));exports[_0x0bfc('0x1')]=function(_0x1549a0){return function(_0x44ffdf){return client[_0x0bfc('0x2')](_0x0bfc('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0bfc('0x4'),_0x0bfc('0x5'),'defaultuser']},'log':_0x0bfc('0x3')});};}; \ No newline at end of file +var _0x6688=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x2c6810,_0x23c079){var _0x213881=function(_0x528021){while(--_0x528021){_0x2c6810['push'](_0x2c6810['shift']());}};_0x213881(++_0x23c079);}(_0x6688,0x10e));var _0x8668=function(_0x3c14c1,_0x224357){_0x3c14c1=_0x3c14c1-0x0;var _0x47c5ba=_0x6688[_0x3c14c1];return _0x47c5ba;};'use strict';var client=require(_0x8668('0x0'));exports[_0x8668('0x1')]=function(_0x60cf0b){return function(_0x50da57){return client[_0x8668('0x2')](_0x8668('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x8668('0x4'),_0x8668('0x5'),_0x8668('0x6')]},'log':_0x8668('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 2d34b23..503853c 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x2d1a72,_0x299152){var _0x581cb0=function(_0x493c9b){while(--_0x493c9b){_0x2d1a72['push'](_0x2d1a72['shift']());}};_0x581cb0(++_0x299152);}(_0x70e0,0x17b));var _0x070e=function(_0x12dbbc,_0x3b730e){_0x12dbbc=_0x12dbbc-0x0;var _0x21e8f1=_0x70e0[_0x12dbbc];return _0x21e8f1;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x3aa10c,_0x38c286){var _0x4da769=function(_0x406442){while(--_0x406442){_0x3aa10c['push'](_0x3aa10c['shift']());}};_0x4da769(++_0x38c286);}(_0x70e0,0x17b));var _0x070e=function(_0x3e1106,_0x119e09){_0x3e1106=_0x3e1106-0x0;var _0x3ec0c7=_0x70e0[_0x3e1106];return _0x3ec0c7;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 1cb4c47..df1cd2f 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 _0x6c43=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x5db339,_0x21b8fe){var _0x2370e8=function(_0x4d8cfd){while(--_0x4d8cfd){_0x5db339['push'](_0x5db339['shift']());}};_0x2370e8(++_0x21b8fe);}(_0x6c43,0x1c3));var _0x36c4=function(_0x5bc27a,_0x32e2d1){_0x5bc27a=_0x5bc27a-0x0;var _0x2c8a4d=_0x6c43[_0x5bc27a];return _0x2c8a4d;};'use strict';var client=require(_0x36c4('0x0'));exports['create']=function(_0x5d315f){return client[_0x36c4('0x1')](_0x36c4('0x2'),{'body':_0x5d315f,'log':_0x36c4('0x2')});};exports[_0x36c4('0x3')]=function(_0x15d906,_0x318b23,_0x2cb99e){return client[_0x36c4('0x1')]('UpdateVoiceAgentReport',{'body':_0x15d906,'options':{'where':{'uniqueid':_0x318b23,'interface':_0x2cb99e,'agentcomplete':!![]}},'log':_0x36c4('0x4')});}; \ No newline at end of file +var _0xa5be=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x156925,_0x496063){var _0x22372d=function(_0x393444){while(--_0x393444){_0x156925['push'](_0x156925['shift']());}};_0x22372d(++_0x496063);}(_0xa5be,0x1de));var _0xea5b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa5be[_0x618414];return _0x21c19a;};'use strict';var client=require(_0xea5b('0x0'));exports[_0xea5b('0x1')]=function(_0x3380a5){return client[_0xea5b('0x2')](_0xea5b('0x3'),{'body':_0x3380a5,'log':'CreateVoiceAgentReport'});};exports[_0xea5b('0x4')]=function(_0x427347,_0x47e400,_0x2fcd20){return client[_0xea5b('0x2')](_0xea5b('0x5'),{'body':_0x427347,'options':{'where':{'uniqueid':_0x47e400,'interface':_0x2fcd20,'agentcomplete':!![]}},'log':_0xea5b('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 08dd7fa..b7aa3ba 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 _0xb2fc=['getVoiceCallReports','startOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION'];(function(_0x2269c9,_0x25b537){var _0x2a60fe=function(_0x5df817){while(--_0x5df817){_0x2269c9['push'](_0x2269c9['shift']());}};_0x2a60fe(++_0x25b537);}(_0xb2fc,0x1d1));var _0xcb2f=function(_0x46c187,_0x5185f8){_0x46c187=_0x46c187-0x0;var _0x5d93ff=_0xb2fc[_0x46c187];return _0x5d93ff;};'use strict';var moment=require(_0xcb2f('0x0'));var util=require(_0xcb2f('0x1'));var _=require(_0xcb2f('0x2'));var client=require('../client');exports[_0xcb2f('0x3')]=function(_0x561495){return client[_0xcb2f('0x4')](_0xcb2f('0x5'),{'body':_[_0xcb2f('0x6')](_0x561495,{'source':_0x561495[_0xcb2f('0x7')],'destinationcontext':_0x561495[_0xcb2f('0x8')],'callerid':_0x561495['callerid'],'amaflags':_0xcb2f('0x9')}),'log':_0xcb2f('0x5')});};exports[_0xcb2f('0xa')]=function(){return function(){return client[_0xcb2f('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xcb2f('0xb')]('day')[_0xcb2f('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0xcb2f('0xc')](_0xcb2f('0xd'))]}},'attributes':[_0xcb2f('0xe'),_0xcb2f('0xf'),_0xcb2f('0x10'),_0xcb2f('0x11')]},'log':_0xcb2f('0x12')});};}; \ No newline at end of file +var _0x825c=['lodash','../client','create','Request','merge','calleridnum','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','billableseconds','GetVoiceCallReports'];(function(_0x43183d,_0x55b21f){var _0x36d056=function(_0x457aeb){while(--_0x457aeb){_0x43183d['push'](_0x43183d['shift']());}};_0x36d056(++_0x55b21f);}(_0x825c,0x154));var _0xc825=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x825c[_0x486f4a];return _0x135d99;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0xc825('0x0'));var client=require(_0xc825('0x1'));exports[_0xc825('0x2')]=function(_0xec5ed2){return client[_0xc825('0x3')]('CreateVoiceCallReport',{'body':_[_0xc825('0x4')](_0xec5ed2,{'source':_0xec5ed2[_0xc825('0x5')],'destinationcontext':_0xec5ed2['context'],'callerid':_0xec5ed2[_0xc825('0x6')],'amaflags':_0xc825('0x7')}),'log':_0xc825('0x8')});};exports[_0xc825('0x9')]=function(){return function(){return client[_0xc825('0x3')](_0xc825('0xa'),{'options':{'where':{'type':[_0xc825('0xb')],'createdAt':{'$between':[moment()[_0xc825('0xc')](_0xc825('0xd'))[_0xc825('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc825('0xf')]('day')[_0xc825('0xe')](_0xc825('0x10'))]}},'attributes':[_0xc825('0x11'),'disposition','duration',_0xc825('0x12')]},'log':_0xc825('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 0c86965..4709a92 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 _0xfa08=['../client','CreateVoiceDialReport'];(function(_0x147b94,_0x59d886){var _0x2f2b62=function(_0x321aae){while(--_0x321aae){_0x147b94['push'](_0x147b94['shift']());}};_0x2f2b62(++_0x59d886);}(_0xfa08,0x15c));var _0x8fa0=function(_0x4e82cc,_0x59b42b){_0x4e82cc=_0x4e82cc-0x0;var _0x53fa3f=_0xfa08[_0x4e82cc];return _0x53fa3f;};'use strict';var client=require(_0x8fa0('0x0'));exports['create']=function(_0x5d44c6){return client['Request'](_0x8fa0('0x1'),{'body':_0x5d44c6,'log':_0x8fa0('0x1')});}; \ No newline at end of file +var _0xccee=['CreateVoiceDialReport','create','Request'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0xccee,0x19f));var _0xecce=function(_0x6e5721,_0x50db98){_0x6e5721=_0x6e5721-0x0;var _0x53e345=_0xccee[_0x6e5721];return _0x53e345;};'use strict';var client=require('../client');exports[_0xecce('0x0')]=function(_0x5d401c){return client[_0xecce('0x1')](_0xecce('0x2'),{'body':_0x5d401c,'log':_0xecce('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 0787cda..2287759 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 _0x26c2=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x26c2,0x130));var _0x226c=function(_0x3699f5,_0x2095ba){_0x3699f5=_0x3699f5-0x0;var _0x19ecfc=_0x26c2[_0x3699f5];return _0x19ecfc;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x226c('0x0'),{'options':{'raw':!![],'attributes':['id',_0x226c('0x1'),_0x226c('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x226c('0x3')});};}; \ No newline at end of file +var _0x6a24=['getVoiceExtensions','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x181626,_0x4afcf0){var _0x2dfdf9=function(_0x3d7c72){while(--_0x3d7c72){_0x181626['push'](_0x181626['shift']());}};_0x2dfdf9(++_0x4afcf0);}(_0x6a24,0xd1));var _0x46a2=function(_0x5269d6,_0x3a783c){_0x5269d6=_0x5269d6-0x0;var _0x460ce4=_0x6a24[_0x5269d6];return _0x460ce4;};'use strict';var client=require(_0x46a2('0x0'));exports[_0x46a2('0x1')]=function(){return function(){return client['Request'](_0x46a2('0x2'),{'options':{'raw':!![],'attributes':['id',_0x46a2('0x3'),_0x46a2('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x46a2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 5990f34..1b00f7f 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 _0x96f2=['dialOriginateCallerIdNumber','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','TrunkBackup','active','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x96f2,0x195));var _0x296f=function(_0x41ff4b,_0x10bc07){_0x41ff4b=_0x41ff4b-0x0;var _0x59db9d=_0x96f2[_0x41ff4b];return _0x59db9d;};'use strict';var client=require(_0x296f('0x0'));exports[_0x296f('0x1')]=function(){return function(){return client['Request'](_0x296f('0x2'),{'options':{'raw':![],'attributes':['id',_0x296f('0x3'),_0x296f('0x4'),_0x296f('0x5'),_0x296f('0x6'),_0x296f('0x7'),_0x296f('0x8'),'dialActive',_0x296f('0x9'),_0x296f('0xa'),_0x296f('0xb'),'dialPowerLevel',_0x296f('0xc'),_0x296f('0xd'),_0x296f('0xe'),'dialOriginateCallerIdName',_0x296f('0xf'),'dialOriginateTimeout',_0x296f('0x10'),'dialQueueTimeout',_0x296f('0x11'),'dialCongestionMaxRetry',_0x296f('0x12'),_0x296f('0x13'),_0x296f('0x14'),_0x296f('0x15'),'dialNoAnswerRetryFrequency',_0x296f('0x16'),_0x296f('0x17'),_0x296f('0x18'),_0x296f('0x19'),_0x296f('0x1a'),_0x296f('0x1b'),_0x296f('0x1c'),_0x296f('0x1d'),_0x296f('0x1e'),_0x296f('0x1f'),'dialAMDMinWordLength',_0x296f('0x20'),_0x296f('0x21'),_0x296f('0x22'),_0x296f('0x23'),'timeout',_0x296f('0x24'),_0x296f('0x25'),_0x296f('0x26'),'dialAgiAfterHangupAgent',_0x296f('0x27'),_0x296f('0x28'),_0x296f('0x7'),_0x296f('0x29'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x296f('0x2a'),'dialNoSuchNumberRetryFrequency',_0x296f('0x2b'),_0x296f('0x2c'),_0x296f('0x2d'),_0x296f('0x2e'),_0x296f('0x2f'),_0x296f('0x30'),'dialAgentRejectMaxRetry',_0x296f('0x31'),_0x296f('0x32'),'dialPredictiveIntervalMaxThreshold',_0x296f('0x33'),_0x296f('0x34'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x296f('0x35'),'attributes':['id',_0x296f('0x3'),_0x296f('0x36'),'active']},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x296f('0x3')]},{'model':_0x296f('0x35'),'as':_0x296f('0x37'),'attributes':['id','name',_0x296f('0x36'),_0x296f('0x38')]},{'model':_0x296f('0x39'),'as':_0x296f('0x39'),'attributes':['id',_0x296f('0x3')],'include':[{'model':_0x296f('0x39'),'as':_0x296f('0x3a'),'attributes':['id','name',_0x296f('0x3b')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xf2cb=['Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','interval','getVoiceQueues','GetVoiceQueue','acw','autopause','monitor_format','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xf2cb,0x130));var _0xbf2c=function(_0x357128,_0x465325){_0x357128=_0x357128-0x0;var _0x260573=_0xf2cb[_0x357128];return _0x260573;};'use strict';var client=require('../client');exports[_0xbf2c('0x0')]=function(){return function(){return client['Request'](_0xbf2c('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xbf2c('0x2'),'acwTimeout',_0xbf2c('0x3'),_0xbf2c('0x4'),'type','dialActive',_0xbf2c('0x5'),_0xbf2c('0x6'),_0xbf2c('0x7'),_0xbf2c('0x8'),'dialPredictiveOptimization',_0xbf2c('0x9'),'dialPredictiveInterval',_0xbf2c('0xa'),'dialOriginateCallerIdNumber','dialOriginateTimeout',_0xbf2c('0xb'),_0xbf2c('0xc'),_0xbf2c('0xd'),'dialCongestionMaxRetry',_0xbf2c('0xe'),_0xbf2c('0xf'),_0xbf2c('0x10'),_0xbf2c('0x11'),_0xbf2c('0x12'),_0xbf2c('0x13'),_0xbf2c('0x14'),_0xbf2c('0x15'),'dialPrefix',_0xbf2c('0x16'),_0xbf2c('0x17'),_0xbf2c('0x18'),_0xbf2c('0x19'),'dialAMDAfterGreetingSilence',_0xbf2c('0x1a'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0xbf2c('0x1b'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0xbf2c('0x1c'),_0xbf2c('0x1d'),_0xbf2c('0x1e'),_0xbf2c('0x1f'),_0xbf2c('0x20'),'dialAgiAfterHangupClient',_0xbf2c('0x21'),'monitor_format',_0xbf2c('0x22'),_0xbf2c('0x23'),_0xbf2c('0x24'),_0xbf2c('0x25'),_0xbf2c('0x26'),'dialDropMaxRetry',_0xbf2c('0x27'),_0xbf2c('0x28'),_0xbf2c('0x29'),_0xbf2c('0x2a'),_0xbf2c('0x2b'),_0xbf2c('0x2c'),_0xbf2c('0x2d'),'mandatoryDisposition',_0xbf2c('0x2e'),_0xbf2c('0x2f'),_0xbf2c('0x30'),_0xbf2c('0x31')],'include':[{'model':'Trunk','as':_0xbf2c('0x32'),'attributes':['id',_0xbf2c('0x33'),'callerid',_0xbf2c('0x34')]},{'model':_0xbf2c('0x35'),'as':_0xbf2c('0x36'),'attributes':['id','name']},{'model':'Trunk','as':_0xbf2c('0x37'),'attributes':['id',_0xbf2c('0x33'),_0xbf2c('0x38'),_0xbf2c('0x34')]},{'model':_0xbf2c('0x39'),'as':_0xbf2c('0x39'),'attributes':['id',_0xbf2c('0x33')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xbf2c('0x33'),_0xbf2c('0x3a')]}]}]},'log':_0xbf2c('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4c63620..4c20279 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(_0x2b7734,_0x400c9e){var _0x111328=function(_0x114cb4){while(--_0x114cb4){_0x2b7734['push'](_0x2b7734['shift']());}};_0x111328(++_0x400c9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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(_0x185fb4,_0x538e54){var _0x29ad96=function(_0x5ce421){while(--_0x5ce421){_0x185fb4['push'](_0x185fb4['shift']());}};_0x29ad96(++_0x538e54);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 acd8397..c3bd9bb 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 _0xb4e3=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x112f04,_0x53cf9a){var _0x30ffaf=function(_0x32a95a){while(--_0x32a95a){_0x112f04['push'](_0x112f04['shift']());}};_0x30ffaf(++_0x53cf9a);}(_0xb4e3,0xd9));var _0x3b4e=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0xb4e3[_0x2f71f6];return _0x2b23ea;};'use strict';var client=require('../client');exports[_0x3b4e('0x0')]=function(_0x576ba3){return function(){return client[_0x3b4e('0x1')](_0x3b4e('0x2'),{'options':{'where':{'VoiceQueueId':_0x576ba3,'paused':!![]},'raw':!![]},'log':_0x3b4e('0x0')});};}; \ No newline at end of file +var _0xf3cb=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0xcc03bf,_0x1b95e5){var _0x32be90=function(_0x15caad){while(--_0x15caad){_0xcc03bf['push'](_0xcc03bf['shift']());}};_0x32be90(++_0x1b95e5);}(_0xf3cb,0x122));var _0xbf3c=function(_0x49bd92,_0x3082ac){_0x49bd92=_0x49bd92-0x0;var _0x459416=_0xf3cb[_0x49bd92];return _0x459416;};'use strict';var client=require(_0xbf3c('0x0'));exports[_0xbf3c('0x1')]=function(_0x4a13d0){return function(){return client[_0xbf3c('0x2')](_0xbf3c('0x3'),{'options':{'where':{'VoiceQueueId':_0x4a13d0,'paused':!![]},'raw':!![]},'log':_0xbf3c('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 58e5ac9..4a30874 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(_0x2dd8e4,_0x12592d){var _0x2904cd=function(_0x58e626){while(--_0x58e626){_0x2dd8e4['push'](_0x2dd8e4['shift']());}};_0x2904cd(++_0x12592d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x10be2c,_0x327db0){var _0x3caf72=function(_0x1e4e7a){while(--_0x1e4e7a){_0x10be2c['push'](_0x10be2c['shift']());}};_0x3caf72(++_0x327db0);}(_0x7a54,0x106));var _0x47a5=function(_0x126e3c,_0x189441){_0x126e3c=_0x126e3c-0x0;var _0xa8547f=_0x7a54[_0x126e3c];return _0xa8547f;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 5cdbe2c..022f0d8 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 _0xbaae=['transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereecontext','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','Request','result','transferercalleridname'];(function(_0x4bbf69,_0x117750){var _0x30152c=function(_0x4e004e){while(--_0x4e004e){_0x4bbf69['push'](_0x4bbf69['shift']());}};_0x30152c(++_0x117750);}(_0xbaae,0x16c));var _0xebaa=function(_0x222967,_0x399bf3){_0x222967=_0x222967-0x0;var _0x44fc55=_0xbaae[_0x222967];return _0x44fc55;};'use strict';var client=require(_0xebaa('0x0'));exports[_0xebaa('0x1')]={};exports[_0xebaa('0x2')]=function(_0x2f1c7e){return client[_0xebaa('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x2f1c7e[_0xebaa('0x4')],'transfererchannel':_0x2f1c7e['transfererchannel'],'transferercalleridnum':_0x2f1c7e['transferercalleridnum'],'transferercalleridname':_0x2f1c7e[_0xebaa('0x5')],'transfererconnectedlinenum':_0x2f1c7e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2f1c7e[_0xebaa('0x6')],'transfereraccountcode':_0x2f1c7e[_0xebaa('0x7')],'transferercontext':_0x2f1c7e[_0xebaa('0x8')],'transfererexten':_0x2f1c7e['transfererexten'],'transfererlinkedid':_0x2f1c7e[_0xebaa('0x9')],'transfereechannel':_0x2f1c7e[_0xebaa('0xa')],'transfereecalleridnum':_0x2f1c7e[_0xebaa('0xb')],'transfereecalleridname':_0x2f1c7e[_0xebaa('0xc')],'transfereeconnectedlinenum':_0x2f1c7e['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2f1c7e['transfereeconnectedlinename'],'transfereeaccountcode':_0x2f1c7e['transfereeaccountcode'],'transfereecontext':_0x2f1c7e[_0xebaa('0xd')],'transfereeexten':_0x2f1c7e['transfereeexten'],'transfereelinkedid':_0x2f1c7e['transfereelinkedid'],'isexternal':_0x2f1c7e[_0xebaa('0xe')],'context':_0x2f1c7e[_0xebaa('0xf')],'extension':_0x2f1c7e[_0xebaa('0x10')],'type':_0xebaa('0x11')},'log':_0xebaa('0x12')});};exports[_0xebaa('0x13')]=function(_0xc3976c){return client[_0xebaa('0x3')](_0xebaa('0x12'),{'body':{'result':_0xc3976c[_0xebaa('0x4')],'transfererchannel':_0xc3976c[_0xebaa('0x14')],'transferercalleridnum':_0xc3976c[_0xebaa('0x15')],'transferercalleridname':_0xc3976c[_0xebaa('0x16')],'transfererconnectedlinenum':_0xc3976c[_0xebaa('0x17')],'transfererconnectedlinename':_0xc3976c[_0xebaa('0x18')],'transfereraccountcode':_0xc3976c[_0xebaa('0x19')],'transferercontext':_0xc3976c['secondtransferercontext'],'transfererexten':_0xc3976c['secondtransfererexten'],'transfererlinkedid':_0xc3976c[_0xebaa('0x1a')],'transfereechannel':_0xc3976c[_0xebaa('0x1b')],'transfereecalleridnum':_0xc3976c[_0xebaa('0x1c')],'transfereecalleridname':_0xc3976c[_0xebaa('0x1d')],'transfereeconnectedlinenum':_0xc3976c[_0xebaa('0x1e')],'transfereeconnectedlinename':_0xc3976c['transfertargetconnectedlinename'],'transfereeaccountcode':_0xc3976c[_0xebaa('0x1f')],'transfereecontext':_0xc3976c[_0xebaa('0x20')],'transfereeexten':_0xc3976c[_0xebaa('0x21')],'transfereelinkedid':_0xc3976c[_0xebaa('0x22')],'isexternal':_0xc3976c['isexternal'],'context':_0xc3976c[_0xebaa('0x23')],'extension':_0xc3976c[_0xebaa('0x24')],'type':'attended'},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x0765=['CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer'];(function(_0x33a17b,_0x4e04ff){var _0x57e182=function(_0x5a62b7){while(--_0x5a62b7){_0x33a17b['push'](_0x33a17b['shift']());}};_0x57e182(++_0x4e04ff);}(_0x0765,0x165));var _0x5076=function(_0xacd9ec,_0x1ad7bb){_0xacd9ec=_0xacd9ec-0x0;var _0x259f28=_0x0765[_0xacd9ec];return _0x259f28;};'use strict';var client=require(_0x5076('0x0'));exports[_0x5076('0x1')]={};exports[_0x5076('0x2')]=function(_0x52fd5e){return client['Request'](_0x5076('0x3'),{'body':{'result':_0x52fd5e['result'],'transfererchannel':_0x52fd5e[_0x5076('0x4')],'transferercalleridnum':_0x52fd5e[_0x5076('0x5')],'transferercalleridname':_0x52fd5e[_0x5076('0x6')],'transfererconnectedlinenum':_0x52fd5e[_0x5076('0x7')],'transfererconnectedlinename':_0x52fd5e['transfererconnectedlinename'],'transfereraccountcode':_0x52fd5e[_0x5076('0x8')],'transferercontext':_0x52fd5e[_0x5076('0x9')],'transfererexten':_0x52fd5e[_0x5076('0xa')],'transfererlinkedid':_0x52fd5e[_0x5076('0xb')],'transfereechannel':_0x52fd5e[_0x5076('0xc')],'transfereecalleridnum':_0x52fd5e[_0x5076('0xd')],'transfereecalleridname':_0x52fd5e['transfereecalleridname'],'transfereeconnectedlinenum':_0x52fd5e[_0x5076('0xe')],'transfereeconnectedlinename':_0x52fd5e[_0x5076('0xf')],'transfereeaccountcode':_0x52fd5e[_0x5076('0x10')],'transfereecontext':_0x52fd5e[_0x5076('0x11')],'transfereeexten':_0x52fd5e[_0x5076('0x12')],'transfereelinkedid':_0x52fd5e['transfereelinkedid'],'isexternal':_0x52fd5e[_0x5076('0x13')],'context':_0x52fd5e[_0x5076('0x14')],'extension':_0x52fd5e['extension'],'type':_0x5076('0x15')},'log':_0x5076('0x3')});};exports[_0x5076('0x16')]=function(_0x315f57){return client['Request'](_0x5076('0x3'),{'body':{'result':_0x315f57[_0x5076('0x17')],'transfererchannel':_0x315f57[_0x5076('0x18')],'transferercalleridnum':_0x315f57[_0x5076('0x19')],'transferercalleridname':_0x315f57[_0x5076('0x1a')],'transfererconnectedlinenum':_0x315f57[_0x5076('0x1b')],'transfererconnectedlinename':_0x315f57[_0x5076('0x1c')],'transfereraccountcode':_0x315f57[_0x5076('0x1d')],'transferercontext':_0x315f57[_0x5076('0x1e')],'transfererexten':_0x315f57[_0x5076('0x1f')],'transfererlinkedid':_0x315f57[_0x5076('0x20')],'transfereechannel':_0x315f57[_0x5076('0x21')],'transfereecalleridnum':_0x315f57[_0x5076('0x22')],'transfereecalleridname':_0x315f57[_0x5076('0x23')],'transfereeconnectedlinenum':_0x315f57[_0x5076('0x24')],'transfereeconnectedlinename':_0x315f57[_0x5076('0x25')],'transfereeaccountcode':_0x315f57[_0x5076('0x26')],'transfereecontext':_0x315f57[_0x5076('0x27')],'transfereeexten':_0x315f57[_0x5076('0x28')],'transfereelinkedid':_0x315f57[_0x5076('0x29')],'isexternal':_0x315f57[_0x5076('0x13')],'context':_0x315f57[_0x5076('0x2a')],'extension':_0x315f57[_0x5076('0x2b')],'type':_0x5076('0x2c')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index b49a77a..0eafd5d 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 _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x2f3043,_0x4883cd){var _0x11e77e=function(_0x4ec86a){while(--_0x4ec86a){_0x2f3043['push'](_0x2f3043['shift']());}};_0x11e77e(++_0x4883cd);}(_0x7a54,0x106));var _0x47a5=function(_0x3f8fc4,_0xfc88dd){_0x3f8fc4=_0x3f8fc4-0x0;var _0x204223=_0x7a54[_0x3f8fc4];return _0x204223;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x2bebc2,_0x30f45b){var _0x361d8b=function(_0x439407){while(--_0x439407){_0x2bebc2['push'](_0x2bebc2['shift']());}};_0x361d8b(++_0x30f45b);}(_0x7a54,0x106));var _0x47a5=function(_0x5c9eb0,_0x57896d){_0x5c9eb0=_0x5c9eb0-0x0;var _0x482031=_0x7a54[_0x5c9eb0];return _0x482031;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+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 99e4bab..fb8cd05 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 _0x369d=['map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','trigger:%s','action','merge','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]'];(function(_0x1a7025,_0x19c274){var _0x21325c=function(_0x1a6291){while(--_0x1a6291){_0x1a7025['push'](_0x1a7025['shift']());}};_0x21325c(++_0x19c274);}(_0x369d,0x166));var _0xd369=function(_0x483cd6,_0x58eba6){_0x483cd6=_0x483cd6-0x0;var _0x2817f7=_0x369d[_0x483cd6];return _0x2817f7;};'use strict';var _=require(_0xd369('0x0'));var BPromise=require(_0xd369('0x1'));var Redis=require(_0xd369('0x2'));var util=require('util');var config=require(_0xd369('0x3'));var logger=require(_0xd369('0x4'))('trigger');var cmContactRpc=require(_0xd369('0x5'));config[_0xd369('0x6')]=_[_0xd369('0x7')](config[_0xd369('0x6')],{'host':_0xd369('0x8'),'port':0x18eb});var io=require(_0xd369('0x9'))(new Redis(config[_0xd369('0x6')]));function emit(_0xb8b844,_0x32c0a8,_0x376909,_0x2fcdaf,_0x4138d6){logger['info'](_0xd369('0xa'),_0xb8b844,_0x32c0a8['id'],_0x376909,_0x2fcdaf,JSON['stringify'](_0x4138d6));io['to'](_0x376909)[_0xd369('0xb')](_0x2fcdaf,_0x4138d6);}exports[_0xd369('0xc')]=function(_0x11f447,_0x4852e5,_0x53ded3,_0x3889da){var _0x3b9b5f,_0x3d43fa;var _0x5eb312={};var _0x53dede;var _0x3729ce=Number(_0x53ded3['data1']);var _0x1e1048=_0x53ded3[_0xd369('0xd')]?Boolean(Number(_0x53ded3[_0xd369('0xd')])):![];var _0x231b4d;var _0x14cccd=![];if(!_[_0xd369('0xe')](_0x53ded3[_0xd369('0xf')])){if(_0x53ded3['data5']=='1')_0x14cccd=!![];}if(!_0x14cccd){if(_0x3889da[_0xd369('0x10')]){_0x5eb312['id']=_0x3889da[_0xd369('0x10')];}}if(!_0x5eb312['id']){_0x5eb312[_0xd369('0x11')]=_0x3729ce;_0x231b4d=_0x53ded3[_0xd369('0x12')]&&_0x53ded3[_0xd369('0x12')]!=='0'?_0x53ded3[_0xd369('0x12')][_0xd369('0x13')](','):[_0xd369('0x14')];_0x5eb312[_0xd369('0x15')]=_['map'](_0x231b4d,function(_0x25b19e){var _0x5d6ee7={};_0x5d6ee7[_0x25b19e]=_0x3889da[_0xd369('0x16')]?_0x3889da['destcalleridnum']:_0x3889da[_0xd369('0x17')];return _0x5d6ee7;});_0x53dede=_0x3889da[_0xd369('0x16')]?_0x3889da[_0xd369('0x18')]:_0x3889da[_0xd369('0x17')];}var _0x2f7217=['id',_0xd369('0x19'),_0xd369('0x1a'),'phone',_0xd369('0x1b'),_0xd369('0x1c'),'ListId',_0xd369('0x1d'),'scheduledAt',_0xd369('0x1e')];var _0x506f75=_[_0xd369('0x1f')](_0x2f7217,_0x231b4d);BPromise[_0xd369('0x20')]()[_0xd369('0x21')](cmContactRpc[_0xd369('0x22')]({'attributes':_0x506f75,'where':_0x5eb312,'phone':_0x53dede}))['then'](function(_0x3c8055){_0x3d43fa=_0x3c8055;if(!_[_0xd369('0x23')](_0x3d43fa)){if(_0x3d43fa[_0xd369('0x24')]===0x1){_0x3b9b5f=_0x3d43fa[0x0];logger[_0xd369('0x25')](_0xd369('0x26'),_0x3889da[_0xd369('0x27')],_0x4852e5['id'],_0x3b9b5f['id']);}else{logger['info'](_0xd369('0x28'),_0x3889da[_0xd369('0x27')],_0x4852e5['id'],_[_0xd369('0x29')](_0x3d43fa,'id')[_0xd369('0x2a')](','));}return;}else{logger[_0xd369('0x25')](_0xd369('0x2b'),_0x3889da[_0xd369('0x27')],_0x4852e5['id']);var _0x2b99c3={'ListId':_0x3729ce};var _0x448194=_0x53ded3[_0xd369('0x2c')]&&_0x53ded3[_0xd369('0x2c')]!=='0'?_0x53ded3[_0xd369('0x2c')]:_0xd369('0x14');if(_0x1e1048){logger[_0xd369('0x25')](_0xd369('0x2d'),_0x3889da['uniqueid'],_0x4852e5['id']);_0x2b99c3[_0x448194]=_[_0xd369('0xe')](_0x3889da[_0xd369('0x16')])?_0x3889da[_0xd369('0x17')]:_0x3889da[_0xd369('0x18')];if(_[_0xd369('0xe')](_0x3889da[_0xd369('0x16')])){_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x2e')]&&_0x3889da[_0xd369('0x2e')]!==_0xd369('0x2f')?_0x3889da[_0xd369('0x2e')]:_0xd369('0x30');}else{_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x31')]&&_0x3889da[_0xd369('0x31')]!==''?_0x3889da[_0xd369('0x31')]:_0xd369('0x30');}return BPromise[_0xd369('0x20')]()[_0xd369('0x21')](cmContactRpc['createContact'](_0x2b99c3))['then'](function(_0x49ad39){_0x3b9b5f=_0x49ad39;_0x3d43fa[_0xd369('0x32')](_0x49ad39);if(_0x3b9b5f){logger['info'](_0xd369('0x33'),_0x3889da[_0xd369('0x27')],_0x4852e5['id'],_0x3b9b5f['id']);}return;});}else{logger[_0xd369('0x25')](_0xd369('0x34'),_0x3889da[_0xd369('0x27')],_0x4852e5['id']);_0x2b99c3[_0x448194]=_[_0xd369('0xe')](_0x3889da[_0xd369('0x16')])?_0x3889da[_0xd369('0x17')]:_0x3889da[_0xd369('0x18')];if(_['isNil'](_0x3889da['routeId'])){_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x2e')]&&_0x3889da['calleridname']!==_0xd369('0x2f')?_0x3889da[_0xd369('0x2e')]:_0xd369('0x30');}else{_0x2b99c3[_0xd369('0x19')]=_0x3889da[_0xd369('0x31')]&&_0x3889da[_0xd369('0x31')]!==_0xd369('0x2f')?_0x3889da[_0xd369('0x31')]:_0xd369('0x30');}_0x3b9b5f=_0x2b99c3;_0x3d43fa['push'](_0x2b99c3);return;}}})['then'](function(){if(_0x11f447){emit(_0x3889da[_0xd369('0x27')],_0x4852e5,util[_0xd369('0x35')]('user:%s',_0x11f447['name']),util['format'](_0xd369('0x36'),_0x53ded3[_0xd369('0x37')]['toLowerCase']()),{'evt':_[_0xd369('0x38')](_0x3889da,{'autoCreate':_0x1e1048}),'contact':_0x3b9b5f===undefined?{}:_0x3b9b5f,'contacts':_0x3d43fa[_0xd369('0x24')]===0x0?undefined:_0x3d43fa});}});}; \ No newline at end of file +var _0x7857=['ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','firstName','mobile','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird'];(function(_0xd24148,_0x115429){var _0x3baf17=function(_0x18342a){while(--_0x18342a){_0xd24148['push'](_0xd24148['shift']());}};_0x3baf17(++_0x115429);}(_0x7857,0x120));var _0x7785=function(_0x41dbbf,_0x145d29){_0x41dbbf=_0x41dbbf-0x0;var _0x30a6c3=_0x7857[_0x41dbbf];return _0x30a6c3;};'use strict';var _=require(_0x7785('0x0'));var BPromise=require(_0x7785('0x1'));var Redis=require(_0x7785('0x2'));var util=require(_0x7785('0x3'));var config=require(_0x7785('0x4'));var logger=require(_0x7785('0x5'))(_0x7785('0x6'));var cmContactRpc=require(_0x7785('0x7'));config[_0x7785('0x8')]=_[_0x7785('0x9')](config[_0x7785('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7785('0xa'))(new Redis(config[_0x7785('0x8')]));function emit(_0x43b666,_0x319daf,_0x11e5df,_0x36257a,_0x32a032){logger[_0x7785('0xb')]('[CM][%s][%s]',_0x43b666,_0x319daf['id'],_0x11e5df,_0x36257a,JSON[_0x7785('0xc')](_0x32a032));io['to'](_0x11e5df)[_0x7785('0xd')](_0x36257a,_0x32a032);}exports[_0x7785('0xe')]=function(_0x4521d1,_0x294a78,_0xd82d1a,_0x36ceef){var _0x36b7e8,_0x4f498c;var _0x6d2967={};var _0x4610cc;var _0x47fbbb=Number(_0xd82d1a[_0x7785('0xf')]);var _0x28eaac=_0xd82d1a[_0x7785('0x10')]?Boolean(Number(_0xd82d1a['data2'])):![];var _0x4e6324;var _0x489b59=![];if(!_[_0x7785('0x11')](_0xd82d1a['data5'])){if(_0xd82d1a[_0x7785('0x12')]=='1')_0x489b59=!![];}if(!_0x489b59){if(_0x36ceef[_0x7785('0x13')]){_0x6d2967['id']=_0x36ceef[_0x7785('0x13')];}}if(!_0x6d2967['id']){_0x6d2967[_0x7785('0x14')]=_0x47fbbb;_0x4e6324=_0xd82d1a['data3']&&_0xd82d1a[_0x7785('0x15')]!=='0'?_0xd82d1a[_0x7785('0x15')][_0x7785('0x16')](','):[_0x7785('0x17')];_0x6d2967[_0x7785('0x18')]=_[_0x7785('0x19')](_0x4e6324,function(_0x4a7c3c){var _0x3be227={};_0x3be227[_0x4a7c3c]=_0x36ceef['routeId']?_0x36ceef[_0x7785('0x1a')]:_0x36ceef[_0x7785('0x1b')];return _0x3be227;});_0x4610cc=_0x36ceef[_0x7785('0x1c')]?_0x36ceef[_0x7785('0x1a')]:_0x36ceef[_0x7785('0x1b')];}var _0x252214=['id',_0x7785('0x1d'),'lastName',_0x7785('0x17'),_0x7785('0x1e'),'fax',_0x7785('0x14'),_0x7785('0x1f'),_0x7785('0x20'),_0x7785('0x21')];var _0x499932=_[_0x7785('0x22')](_0x252214,_0x4e6324);BPromise[_0x7785('0x23')]()['then'](cmContactRpc[_0x7785('0x24')]({'attributes':_0x499932,'where':_0x6d2967,'phone':_0x4610cc}))[_0x7785('0x25')](function(_0x2b601a){_0x4f498c=_0x2b601a;if(!_['isEmpty'](_0x4f498c)){if(_0x4f498c[_0x7785('0x26')]===0x1){_0x36b7e8=_0x4f498c[0x0];logger[_0x7785('0xb')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x36ceef[_0x7785('0x27')],_0x294a78['id'],_0x36b7e8['id']);}else{logger[_0x7785('0xb')](_0x7785('0x28'),_0x36ceef['uniqueid'],_0x294a78['id'],_['map'](_0x4f498c,'id')['join'](','));}return;}else{logger[_0x7785('0xb')](_0x7785('0x29'),_0x36ceef[_0x7785('0x27')],_0x294a78['id']);var _0x2c04b2={'ListId':_0x47fbbb};var _0x2aa6d0=_0xd82d1a[_0x7785('0x2a')]&&_0xd82d1a['data4']!=='0'?_0xd82d1a[_0x7785('0x2a')]:'phone';if(_0x28eaac){logger[_0x7785('0xb')](_0x7785('0x2b'),_0x36ceef[_0x7785('0x27')],_0x294a78['id']);_0x2c04b2[_0x2aa6d0]=_['isNil'](_0x36ceef[_0x7785('0x1c')])?_0x36ceef[_0x7785('0x1b')]:_0x36ceef['destcalleridnum'];if(_[_0x7785('0x11')](_0x36ceef['routeId'])){_0x2c04b2['firstName']=_0x36ceef[_0x7785('0x2c')]&&_0x36ceef['calleridname']!==_0x7785('0x2d')?_0x36ceef[_0x7785('0x2c')]:_0x7785('0x2e');}else{_0x2c04b2[_0x7785('0x1d')]=_0x36ceef[_0x7785('0x2f')]&&_0x36ceef[_0x7785('0x2f')]!==_0x7785('0x2d')?_0x36ceef[_0x7785('0x2f')]:_0x7785('0x2e');}return BPromise[_0x7785('0x23')]()[_0x7785('0x25')](cmContactRpc[_0x7785('0x30')](_0x2c04b2))['then'](function(_0x496278){_0x36b7e8=_0x496278;_0x4f498c[_0x7785('0x31')](_0x496278);if(_0x36b7e8){logger['info'](_0x7785('0x32'),_0x36ceef[_0x7785('0x27')],_0x294a78['id'],_0x36b7e8['id']);}return;});}else{logger[_0x7785('0xb')](_0x7785('0x33'),_0x36ceef[_0x7785('0x27')],_0x294a78['id']);_0x2c04b2[_0x2aa6d0]=_[_0x7785('0x11')](_0x36ceef['routeId'])?_0x36ceef[_0x7785('0x1b')]:_0x36ceef['destcalleridnum'];if(_[_0x7785('0x11')](_0x36ceef[_0x7785('0x1c')])){_0x2c04b2[_0x7785('0x1d')]=_0x36ceef[_0x7785('0x2c')]&&_0x36ceef[_0x7785('0x2c')]!==_0x7785('0x2d')?_0x36ceef[_0x7785('0x2c')]:_0x7785('0x2e');}else{_0x2c04b2[_0x7785('0x1d')]=_0x36ceef[_0x7785('0x2f')]&&_0x36ceef[_0x7785('0x2f')]!==_0x7785('0x2d')?_0x36ceef['destcalleridname']:_0x7785('0x2e');}_0x36b7e8=_0x2c04b2;_0x4f498c[_0x7785('0x31')](_0x2c04b2);return;}}})[_0x7785('0x25')](function(){if(_0x4521d1){emit(_0x36ceef[_0x7785('0x27')],_0x294a78,util[_0x7785('0x34')](_0x7785('0x35'),_0x4521d1[_0x7785('0x36')]),util['format'](_0x7785('0x37'),_0xd82d1a[_0x7785('0x38')][_0x7785('0x39')]()),{'evt':_['merge'](_0x36ceef,{'autoCreate':_0x28eaac}),'contact':_0x36b7e8===undefined?{}:_0x36b7e8,'contacts':_0x4f498c['length']===0x0?undefined:_0x4f498c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 9a3c6aa..9ba2873 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 _0x92e3=['custom:timeout','custom:dialbegin','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','stringify','emit','clone','motionChannel','undefined','voice','inspect','checkTriggers','syncAgentDial','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','data3','isNil','data4','data5','800','data6','winapp','winApplication','winArguments','format','user:%s','name','action','jscripty','trigger:%s','exec','integration','urlforward','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','checkTrigger:\x20trigger','evt','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','agent','membername','lastevent','routeId','mailSubstatus','substatus','created','exports','util','lodash','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','popup','url','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon'];(function(_0x4e33c0,_0x555fda){var _0x1f7aa3=function(_0x2b688b){while(--_0x2b688b){_0x4e33c0['push'](_0x4e33c0['shift']());}};_0x1f7aa3(++_0x555fda);}(_0x92e3,0x1dc));var _0x392e=function(_0x35012e,_0xcd02d8){_0x35012e=_0x35012e-0x0;var _0x59597c=_0x92e3[_0x35012e];return _0x59597c;};'use strict';var util=require(_0x392e('0x0'));var _=require(_0x392e('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require('ioredis');var urlforward=require('./urlforward');var integration=require(_0x392e('0x2'));var cmContact=require(_0x392e('0x3'));var script=require(_0x392e('0x4'));var config=require(_0x392e('0x5'));var logger=require(_0x392e('0x6'))('trigger');var ami=require('../ami');config[_0x392e('0x7')]=_[_0x392e('0x8')](config[_0x392e('0x7')],{'host':_0x392e('0x9'),'port':0x18eb});var io=require(_0x392e('0xa'))(new Redis(config['redis']));var operators={'equals':function(_0x170997,_0x549635){return _0x170997==_0x549635;},'not_equals':function(_0x5075ca,_0x30da5c){return _0x5075ca!=_0x30da5c;}};var barAndWebActions=[_0x392e('0xb'),_0x392e('0xc'),'winapp'];function Trigger(_0x358d1f){this[_0x392e('0xd')]=_0x358d1f[_0x392e('0xd')];this[_0x392e('0xe')]=_0x358d1f[_0x392e('0xe')];this[_0x392e('0xf')]=_0x358d1f[_0x392e('0xf')];this[_0x392e('0x10')]=_0x358d1f[_0x392e('0x10')];this['voiceExtensions']=_0x358d1f[_0x392e('0x11')];this[_0x392e('0x12')]=_0x358d1f[_0x392e('0x12')];this[_0x392e('0x13')]=_0x358d1f['freshdeskAccounts'];this[_0x392e('0x14')]=_0x358d1f[_0x392e('0x14')];this[_0x392e('0x15')]=_0x358d1f[_0x392e('0x15')];this[_0x392e('0x16')]=_0x358d1f[_0x392e('0x16')];this[_0x392e('0x17')]=_0x358d1f[_0x392e('0x17')];this['vtigerAccounts']=_0x358d1f['vtigerAccounts'];this[_0x392e('0x18')]=_0x358d1f[_0x392e('0x18')];this[_0x392e('0x19')]=_0x358d1f[_0x392e('0x19')];this[_0x392e('0x1a')]=_0x358d1f[_0x392e('0x1a')];this[_0x392e('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x392e('0x14')],'freshdesk':this[_0x392e('0x13')],'sugarcrm':this[_0x392e('0x15')],'zoho':this[_0x392e('0x16')],'desk':this[_0x392e('0x17')],'vtiger':this[_0x392e('0x1c')],'dynamics365':this[_0x392e('0x19')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0x392e('0x1d'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x20'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x21'),this[_0x392e('0x1e')]['bind'](this));ami['on'](_0x392e('0x22'),this[_0x392e('0x1e')]['bind'](this));ami['on'](_0x392e('0x23'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on']('custom:agentnoanswer',this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on']('custom:agentbusy',this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x24'),this[_0x392e('0x1e')]['bind'](this));ami['on'](_0x392e('0x25'),this[_0x392e('0x1e')]['bind'](this));ami['on'](_0x392e('0x26'),this['syncCustomEvent'][_0x392e('0x1f')](this));ami['on'](_0x392e('0x27'),this['syncCustomEvent'][_0x392e('0x1f')](this));ami['on'](_0x392e('0x28'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x29'),this['syncAgentDial'][_0x392e('0x1f')](this));ami['on']('custom:dialconnect',this['syncAgentDial'][_0x392e('0x1f')](this));ami['on'](_0x392e('0x2a'),this['syncAgentDial'][_0x392e('0x1f')](this));ami['on'](_0x392e('0x2b'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x2c'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x2d'),this['syncCustomEvent'][_0x392e('0x1f')](this));ami['on'](_0x392e('0x2e'),this['syncCustomEvent'][_0x392e('0x1f')](this));ami['on'](_0x392e('0x2f'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x30'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x31'),this[_0x392e('0x1e')][_0x392e('0x1f')](this));ami['on'](_0x392e('0x32'),this['syncCustomEvent'][_0x392e('0x1f')](this));}Trigger[_0x392e('0x33')]['emit']=function(_0x1689c7,_0x4c6bbe,_0x5190e9){logger['info'](_0x1689c7,_0x4c6bbe,JSON[_0x392e('0x34')](_0x5190e9));io['to'](_0x1689c7)[_0x392e('0x35')](_0x4c6bbe,_0x5190e9);};Trigger[_0x392e('0x33')][_0x392e('0x1e')]=function(_0x361196){var _0x2abdca=_[_0x392e('0x36')](_0x361196);if(typeof _0x2abdca[_0x392e('0x37')]===_0x392e('0x38')){_0x2abdca[_0x392e('0x37')]=_0x392e('0x39');}logger['debug']('syncCustomEvent',util[_0x392e('0x3a')](_0x2abdca,{'showHidden':!![],'depth':null}));this[_0x392e('0x3b')](_0x2abdca);};Trigger[_0x392e('0x33')][_0x392e('0x3c')]=function(_0x3295c5){if(this[_0x392e('0xe')][_0x3295c5[_0x392e('0x3d')]]){this[_0x392e('0x1e')](_0x3295c5);}};Trigger['prototype'][_0x392e('0x3b')]=function(_0x1f9739){var _0x16ac8a;for(var _0xb6aa76 in this[_0x392e('0xd')]){if(this[_0x392e('0xd')][_0x392e('0x3e')](_0xb6aa76)){if(this[_0x392e('0xd')][_0xb6aa76][_0x392e('0x3f')]){_0x16ac8a=this[_0x392e('0x40')](this['triggers'][_0xb6aa76],_0x1f9739);if(_0x16ac8a){_[_0x392e('0x41')](_0x1f9739,_0x1f9739[_0x392e('0x42')]);for(var _0x4da157=0x0,_0x2fd887,_0x260904,_0x5a8fdb;_0x4da1570x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x20390d,_0xea5ad9){var _0x164c63=function(_0x2db86c){while(--_0x2db86c){_0x20390d['push'](_0x20390d['shift']());}};_0x164c63(++_0xea5ad9);}(_0x3e74,0x175));var _0x43e7=function(_0x4c6960,_0xfbbf4d){_0x4c6960=_0x4c6960-0x0;var _0x5de1dc=_0x3e74[_0x4c6960];return _0x5de1dc;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ 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 da656f7..85f531f 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 _0xba9f=['type','nameField','idField','indexOf','ticketType','assign','getString','/contacts(','Fields','phonecall','callDirection','queue','Descriptions','headers','substring','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','remoteUri','data7','tenantId','data5','POST','clientId','password','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','then','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','toLowerCase','outbound','calleridnum','/systemusers(','body','odata-entityid','lastIndexOf','destcalleridnum','telephone1','contacts?$select=','\x20eq\x20\x27','replace','%2b','enduserId','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','picklist'];(function(_0x11b6a8,_0x38b981){var _0x5537a9=function(_0x1f1699){while(--_0x1f1699){_0x11b6a8['push'](_0x11b6a8['shift']());}};_0x5537a9(++_0x38b981);}(_0xba9f,0x1bb));var _0xfba9=function(_0x49068f,_0x252a71){_0x49068f=_0x49068f-0x0;var _0x5a3090=_0xba9f[_0x49068f];return _0x5a3090;};'use strict';var _=require(_0xfba9('0x0'));var rp=require(_0xfba9('0x1'));var util=require('util');var intUtil=require('./util');var md5=require('md5');var Redis=require(_0xfba9('0x2'));var logger=require(_0xfba9('0x3'))(_0xfba9('0x4'));var config=require(_0xfba9('0x5'));config[_0xfba9('0x6')]=_['defaults'](config[_0xfba9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xfba9('0x7'))(new Redis(config[_0xfba9('0x6')]));function getAuthToken(_0x4f3da3,_0x10ffa1,_0x59ec28){if(_0x4f3da3['modernAuthentication']){_0x4f3da3[_0xfba9('0x8')]=_0x4f3da3['CloudProvider'][_0xfba9('0x9')];_0x4f3da3[_0xfba9('0xa')]=_0x4f3da3['CloudProvider']['data2'];return Promise['resolve'](_0x4f3da3['CloudProvider'][_0xfba9('0xb')]);}var _0x26ba3d={'method':_0xfba9('0xc'),'uri':_0x10ffa1,'form':{'client_id':_0x4f3da3[_0xfba9('0xd')],'resource':_0x4f3da3['remoteUri'],'username':_0x4f3da3['username'],'password':_0x4f3da3['password'],'grant_type':_0xfba9('0xe'),'client_secret':_0x4f3da3['clientSecret']},'json':!![]};return rp(_0x26ba3d)['then'](function(_0x304f41){return _0x304f41[_0xfba9('0xf')];})[_0xfba9('0x10')](function(_0xa8bbb4){logger['error']('['+[_0x59ec28[_0xfba9('0x11')]()]+_0xfba9('0x12'));return _0xa8bbb4[_0xfba9('0x13')];});}function getUser(_0x173a2d,_0x2c50d0,_0x4f3231,_0x2e0847,_0x558306,_0x2359ab){return new Promise(function(_0x4dd508,_0x4d11b0){return getAuthToken(_0x2c50d0,_0x2e0847,_0x2359ab)['then'](function(_0x18464c){var _0x54e51c={'method':_0xfba9('0x14'),'uri':_0x558306+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xfba9('0x15')+_0x18464c,'OData-Version':_0xfba9('0x16')},'json':!![]};return rp(_0x54e51c);})[_0xfba9('0x17')](function(_0x117b7f){var _0x1f0e98=_0x117b7f[_0xfba9('0x18')];var _0x16013b=![];var _0x4d75cb=null;if(!_[_0xfba9('0x19')](_0x4f3231)){if(intUtil[_0xfba9('0x1a')](_0x4f3231[_0xfba9('0x1b')])){_0x173a2d[_0xfba9('0x1c')]=_0x4f3231[_0xfba9('0x1b')];for(_0x4d75cb=0x0;_0x4d75cb<_0x1f0e98[_0xfba9('0x1d')];_0x4d75cb++){if(_0x1f0e98[_0x4d75cb][_0xfba9('0x1e')]===_0x4f3231[_0xfba9('0x1b')]&&!_0x1f0e98[_0x4d75cb][_0xfba9('0x1f')]){_0x16013b=!![];logger[_0xfba9('0x20')]('['+[_0x2359ab['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1f0e98[_0x4d75cb][_0xfba9('0x21')]+'!');_0x173a2d[_0xfba9('0x22')]=_0x1f0e98[_0x4d75cb][_0xfba9('0x21')];}}}}if(!_0x16013b){logger[_0xfba9('0x20')]('['+[_0x2359ab['toUpperCase']()]+_0xfba9('0x23'));_0x173a2d['userEmail']=_0x2c50d0[_0xfba9('0x24')];for(_0x4d75cb=0x0;_0x4d75cb<_0x1f0e98[_0xfba9('0x1d')];_0x4d75cb++){if(_0x1f0e98[_0x4d75cb][_0xfba9('0x1e')]===_0x2c50d0[_0xfba9('0x24')]){_0x173a2d[_0xfba9('0x22')]=_0x1f0e98[_0x4d75cb][_0xfba9('0x21')];}}}_0x4dd508(_0x173a2d);})[_0xfba9('0x10')](function(_0x19234d){_0x4d11b0(_0x19234d[_0xfba9('0x13')]);});});}function createEndUser(_0x42b446,_0x34c2a6,_0x479f7c,_0x54b405,_0x24da74,_0x48bd35,_0x2dca3a){return new Promise(function(_0x238ddb,_0x16b76a){return getAuthToken(_0x34c2a6,_0x479f7c,_0x48bd35)[_0xfba9('0x17')](function(_0x34c43e){var _0xa3746c=_0x48bd35[_0xfba9('0x25')]()===_0xfba9('0x26')?_0x24da74['destcalleridnum']:_0x24da74[_0xfba9('0x27')];var _0xca4505={'method':_0xfba9('0xc'),'uri':_0x54b405+'contacts','body':{'fullname':_0xa3746c,'firstname':_0xa3746c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfba9('0x28')+_0x42b446[_0xfba9('0x22')]+')'},'headers':{'Authorization':_0xfba9('0x15')+_0x34c43e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0xca4505[_0xfba9('0x29')][_0x2dca3a]=_0xa3746c;return rp(_0xca4505);})[_0xfba9('0x17')](function(_0xa165e0){var _0x36c13a=_0xa165e0['headers'][_0xfba9('0x2a')];var _0x10a7b1=_0x36c13a['substring'](_0x36c13a[_0xfba9('0x2b')]('(')+0x1,_0x36c13a[_0xfba9('0x2b')](')'));_0x42b446['enduserId']=_0x10a7b1;_0x238ddb(_0x42b446);})[_0xfba9('0x10')](function(_0x51778f){_0x16b76a(_0x51778f['message']);});});}function getEndUser(_0x18622c,_0x1edb73,_0x48437c,_0x3417c8,_0xceb13e,_0x3499b3,_0x1fe647,_0x1d9526){var _0x520d45=_0x3499b3[_0xfba9('0x25')]()===_0xfba9('0x26')?_0xceb13e[_0xfba9('0x2c')]:_0xceb13e[_0xfba9('0x27')];return getAuthToken(_0x1edb73,_0x48437c,_0x3499b3)['then'](function(_0x481182){_0x1d9526=_0x1d9526?_0x1d9526:_0xfba9('0x2d');var _0x27cae8={'method':_0xfba9('0x14'),'uri':_0x3417c8+_0xfba9('0x2e')+_0x1d9526+'&$filter='+_0x1d9526+_0xfba9('0x2f')+_0x520d45[_0xfba9('0x30')]('+',_0xfba9('0x31'))+'\x27','headers':{'Authorization':_0xfba9('0x15')+_0x481182,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x27cae8);})[_0xfba9('0x17')](function(_0x969482){var _0x1fffb1=![];if(!_0x969482)return _0x1fffb1;var _0x3f6bf4=_0x969482[_0xfba9('0x18')];for(var _0xa56f9e=0x0;_0xa56f9e<_0x3f6bf4['length'];_0xa56f9e++){if(_0x3f6bf4[_0xa56f9e][_0x1d9526]===_0x520d45){_0x1fffb1=!![];_0x18622c[_0xfba9('0x32')]=_0x3f6bf4[_0xa56f9e]['contactid'];}}return _0x1fffb1;})[_0xfba9('0x17')](function(_0x24b9f6){if(_0x24b9f6)return _0x18622c;if(_0x1fe647===_0xfba9('0x33')){logger[_0xfba9('0x20')]('['+[_0x3499b3['toUpperCase']()]+_0xfba9('0x34'));return _0x18622c;}return createEndUser(_0x18622c,_0x1edb73,_0x48437c,_0x3417c8,_0xceb13e,_0x3499b3,_0x1d9526)[_0xfba9('0x17')](function(_0x1e3364){logger[_0xfba9('0x20')]('['+[_0x3499b3['toUpperCase']()]+_0xfba9('0x35'),_0x1e3364[_0xfba9('0x32')]);return _0x1e3364;});});}function getCustomFields(_0x222048,_0x3b613f,_0x142884){var _0x3d1f56={};if(_0x222048[_0xfba9('0x1d')]>0x0){_[_0xfba9('0x36')](_0x222048,function(_0x38aece){if(_['includes']([_0xfba9('0x37'),_0xfba9('0x38')],_0x38aece[_0xfba9('0x39')])&&_0x38aece[_0xfba9('0x3a')]&&!_0x38aece['customField']){var _0x3531a6=_0x38aece[_0xfba9('0x3b')]['toLowerCase']();var _0x14833e=_0x3531a6['substring'](0x0,_0x3531a6[_0xfba9('0x3c')]('_'));var _0x298a19=_0x3531a6['substring'](_0x3531a6[_0xfba9('0x3c')]('_')+0x1);if(_0x14833e===_0x142884){_0x3d1f56[_0x298a19]=_0x38aece['content'];}}});}return _0x3d1f56;}function getTicket(_0x2c427f,_0xa3cb0d,_0x9b7847,_0x111e25,_0x510024,_0x5f48cd,_0x24c0b9){return new Promise(function(_0x56a57f,_0x1c6751){var _0xc6b66d;return getAuthToken(_0xa3cb0d,_0x9b7847,_0x24c0b9)['then'](function(_0x1810be){if(_0x5f48cd[_0xfba9('0x3d')]==='incident'){_0xc6b66d={'method':_0xfba9('0xc'),'uri':_0x111e25+'incidents','body':Object[_0xfba9('0x3e')]({},{'title':intUtil[_0xfba9('0x3f')](_0x5f48cd['Subjects'],_0x510024,'\x20'),'description':intUtil['getString'](_0x5f48cd['Descriptions'],_0x510024,'\x0a'),'customerid_contact@odata.bind':_0x2c427f[_0xfba9('0x32')]?_0xfba9('0x40')+_0x2c427f[_0xfba9('0x32')]+')':undefined,'ownerid@odata.bind':_0xfba9('0x28')+_0x2c427f[_0xfba9('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x5f48cd[_0xfba9('0x41')],_0x510024,_0x5f48cd[_0xfba9('0x3d')])),'headers':{'Authorization':_0xfba9('0x15')+_0x1810be,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5f48cd[_0xfba9('0x3d')]===_0xfba9('0x42')){var _0x4e87d4=_0x2c427f['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2c427f[_0xfba9('0x22')]+')','participationtypemask':_0x2c427f[_0xfba9('0x43')]===_0xfba9('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0xfba9('0x40')+_0x2c427f['enduserId']+')','participationtypemask':_0x2c427f[_0xfba9('0x43')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfba9('0x28')+_0x2c427f[_0xfba9('0x22')]+')','participationtypemask':_0x2c427f[_0xfba9('0x43')]===_0xfba9('0x44')?0x2:0x1}];_0xc6b66d={'method':_0xfba9('0xc'),'uri':_0x111e25+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0xfba9('0x3f')](_0x5f48cd['Subjects'],_0x510024,'\x20'),'phonenumber':String(_0x510024[_0xfba9('0x27')]),'description':intUtil[_0xfba9('0x3f')](_0x5f48cd[_0xfba9('0x45')],_0x510024,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2c427f[_0xfba9('0x32')]?_0xfba9('0x40')+_0x2c427f[_0xfba9('0x32')]+')':undefined,'ownerid@odata.bind':_0xfba9('0x28')+_0x2c427f['userId']+')','directioncode':_0x2c427f['callDirection']===_0xfba9('0x44')?![]:!![],'phonecall_activity_parties':_0x4e87d4},getCustomFields(_0x5f48cd[_0xfba9('0x41')],_0x510024,_0x5f48cd[_0xfba9('0x3d')])),'headers':{'Authorization':_0xfba9('0x15')+_0x1810be,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xc6b66d);})[_0xfba9('0x17')](function(_0xbb9039){var _0x270ee7=_0xbb9039[_0xfba9('0x46')][_0xfba9('0x2a')];var _0x39267a=_0x270ee7[_0xfba9('0x47')](_0x270ee7[_0xfba9('0x2b')]('(')+0x1,_0x270ee7['lastIndexOf'](')'));_0x2c427f[_0xfba9('0x48')]=_0x39267a;_0x56a57f(_0x2c427f);})[_0xfba9('0x10')](function(_0x29792d){_0x1c6751(_0x29792d[_0xfba9('0x13')]);});});}function emit(_0x5d3e72,_0x40c8c3,_0x40a78e,_0xd6b29d){var _0x2fa671={'uri':util[_0xfba9('0x49')](_0xfba9('0x4a'),_0x5d3e72,_0x40a78e,_0xd6b29d)};io['to'](util[_0xfba9('0x49')](_0xfba9('0x4b'),_0x40c8c3))['emit'](_0xfba9('0x4c'),_0x2fa671);}exports['cs']=function(_0x36d7d2,_0x439104,_0x1f672c,_0x5b32a4,_0x2af7fb,_0xf2bec6,_0x281a97,_0x2733c8){var _0x346e9a={};_0xf2bec6[_0xfba9('0x8')]=_0xf2bec6[_0xfba9('0x4d')]?intUtil[_0xfba9('0x4e')](_0xf2bec6['CloudProvider'][_0xfba9('0x9')]):intUtil[_0xfba9('0x4e')](_0xf2bec6['remoteUri']);_0xf2bec6['serverUrl']=intUtil[_0xfba9('0x4e')](_0xf2bec6[_0xfba9('0x4f')]);_0x346e9a['callDirection']=_0x2733c8===_0xfba9('0x44')||_0x2733c8===_0xfba9('0x50')?_0xfba9('0x44'):_0xfba9('0x26');var _0x301a77=_0xf2bec6[_0xfba9('0x4d')]?util[_0xfba9('0x49')](_0xfba9('0x51'),_0xf2bec6['CloudProvider']['data7']):util[_0xfba9('0x49')]('%s/api/data/v9.0/',_0xf2bec6[_0xfba9('0x8')]);var _0x5f1e27=util[_0xfba9('0x49')](_0xfba9('0x52'),_0xf2bec6[_0xfba9('0xa')]);var _0x48c9a2=util[_0xfba9('0x49')](_0xfba9('0x53'),_0xf2bec6[_0xfba9('0x4f')],_0x439104['uniqueid'],md5(_0x439104[_0xfba9('0x54')]));if(_0x2af7fb&&_0x2af7fb['monitor_format']){logger[_0xfba9('0x20')](_0xfba9('0x55'),_0xfba9('0x56'));_0x439104[_0xfba9('0x57')]=_0x48c9a2;}else if(_0x281a97&&_0x281a97[_0xfba9('0x58')]&&_0x281a97[_0xfba9('0x58')]!==_0xfba9('0x59')){logger[_0xfba9('0x20')]('[OUTBOUND]',_0xfba9('0x56'));_0x439104[_0xfba9('0x57')]=_0x48c9a2;}else{_0x439104[_0xfba9('0x57')]='';}return getUser(_0x346e9a,_0xf2bec6,_0x5b32a4,_0x5f1e27,_0x301a77,_0x2733c8)[_0xfba9('0x17')](function(_0x314e36){logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+_0xfba9('0x5a'),_0x314e36['userId']);logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+']\x20The\x20User\x20email\x20is:',_0x314e36['userEmail']);return getEndUser(_0x314e36,_0xf2bec6,_0x5f1e27,_0x301a77,_0x439104,_0x2733c8,_0x1f672c[_0xfba9('0x5b')],_0x1f672c[_0xfba9('0x5c')]);})[_0xfba9('0x17')](function(_0x43faed){logger['info']('['+_0x2733c8[_0xfba9('0x11')]()+_0xfba9('0x5d'),_0x43faed[_0xfba9('0x32')]);logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+_0xfba9('0x5e'),_0x439104[_0xfba9('0x27')]);return getTicket(_0x43faed,_0xf2bec6,_0x5f1e27,_0x301a77,_0x439104,_0x1f672c,_0x2733c8);})[_0xfba9('0x17')](function(_0x27ae25){logger[_0xfba9('0x20')](util[_0xfba9('0x49')]('['+_0x2733c8['toUpperCase']()+_0xfba9('0x5f'),_0x1f672c[_0xfba9('0x3d')],_0x27ae25[_0xfba9('0x48')]));logger[_0xfba9('0x20')](util[_0xfba9('0x49')]('['+_0x2733c8[_0xfba9('0x11')]()+']\x20Call\x20direction:\x20%s',_0x2733c8));if(_0x2733c8!==_0xfba9('0x50')&&_0x1f672c[_0xfba9('0x60')]){logger[_0xfba9('0x20')]('['+_0x2733c8[_0xfba9('0x11')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xf2bec6[_0xfba9('0x8')],_0x5b32a4['name'],_0x1f672c['ticketType'],_0x27ae25[_0xfba9('0x48')]);}})[_0xfba9('0x10')](function(_0x591211){logger[_0xfba9('0x61')]('['+_0x2733c8['toUpperCase']()+_0xfba9('0x62'),_0x591211[_0xfba9('0x13')]);console[_0xfba9('0x61')](_0xfba9('0x63'),_0x591211);});}; \ No newline at end of file +var _0x9719=[']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','idField','substring','ticketType','incident','incidents','getString','/contacts(','/systemusers(','phonecall','callDirection','queue','phonecalls','assign','Fields','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','error','Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','data5','POST','username','password','clientSecret','then','access_token',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','internalemailaddress','catch','destcalleridnum','calleridnum','contacts','userId','body','lastIndexOf','enduserId','toLowerCase','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing'];(function(_0x629479,_0x16f852){var _0x238e1f=function(_0x5575a3){while(--_0x5575a3){_0x629479['push'](_0x629479['shift']());}};_0x238e1f(++_0x16f852);}(_0x9719,0x108));var _0x9971=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9719[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var rp=require(_0x9971('0x0'));var util=require(_0x9971('0x1'));var intUtil=require('./util');var md5=require(_0x9971('0x2'));var Redis=require(_0x9971('0x3'));var logger=require(_0x9971('0x4'))(_0x9971('0x5'));var config=require(_0x9971('0x6'));config[_0x9971('0x7')]=_[_0x9971('0x8')](config[_0x9971('0x7')],{'host':_0x9971('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9971('0x7')]));function getAuthToken(_0x56dc2e,_0x2da07b,_0x40264a){if(_0x56dc2e[_0x9971('0xa')]){_0x56dc2e[_0x9971('0xb')]=_0x56dc2e[_0x9971('0xc')]['data7'];_0x56dc2e[_0x9971('0xd')]=_0x56dc2e['CloudProvider'][_0x9971('0xe')];return Promise[_0x9971('0xf')](_0x56dc2e[_0x9971('0xc')][_0x9971('0x10')]);}var _0x178910={'method':_0x9971('0x11'),'uri':_0x2da07b,'form':{'client_id':_0x56dc2e['clientId'],'resource':_0x56dc2e['remoteUri'],'username':_0x56dc2e[_0x9971('0x12')],'password':_0x56dc2e[_0x9971('0x13')],'grant_type':_0x9971('0x13'),'client_secret':_0x56dc2e[_0x9971('0x14')]},'json':!![]};return rp(_0x178910)[_0x9971('0x15')](function(_0xef2d32){return _0xef2d32[_0x9971('0x16')];})['catch'](function(_0x40c578){logger['error']('['+[_0x40264a['toUpperCase']()]+_0x9971('0x17'));return _0x40c578[_0x9971('0x18')];});}function getUser(_0x20733e,_0x555541,_0x375d49,_0x10d357,_0x3505f9,_0x499265){return new Promise(function(_0xefcbda,_0x13ca37){return getAuthToken(_0x555541,_0x10d357,_0x499265)[_0x9971('0x15')](function(_0x368100){var _0x436386={'method':_0x9971('0x19'),'uri':_0x3505f9+_0x9971('0x1a'),'headers':{'Authorization':_0x9971('0x1b')+_0x368100,'OData-Version':_0x9971('0x1c')},'json':!![]};return rp(_0x436386);})[_0x9971('0x15')](function(_0x54ff91){var _0x403955=_0x54ff91[_0x9971('0x1d')];var _0x1435b2=![];var _0x4862d4=null;if(!_['isNil'](_0x375d49)){if(intUtil[_0x9971('0x1e')](_0x375d49[_0x9971('0x1f')])){_0x20733e[_0x9971('0x20')]=_0x375d49[_0x9971('0x1f')];for(_0x4862d4=0x0;_0x4862d4<_0x403955[_0x9971('0x21')];_0x4862d4++){if(_0x403955[_0x4862d4]['internalemailaddress']===_0x375d49[_0x9971('0x1f')]&&!_0x403955[_0x4862d4][_0x9971('0x22')]){_0x1435b2=!![];logger[_0x9971('0x23')]('['+[_0x499265[_0x9971('0x24')]()]+_0x9971('0x25')+_0x403955[_0x4862d4]['systemuserid']+'!');_0x20733e['userId']=_0x403955[_0x4862d4][_0x9971('0x26')];}}}}if(!_0x1435b2){logger['info']('['+[_0x499265[_0x9971('0x24')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x20733e[_0x9971('0x20')]=_0x555541['username'];for(_0x4862d4=0x0;_0x4862d4<_0x403955['length'];_0x4862d4++){if(_0x403955[_0x4862d4][_0x9971('0x27')]===_0x555541[_0x9971('0x12')]){_0x20733e['userId']=_0x403955[_0x4862d4]['systemuserid'];}}}_0xefcbda(_0x20733e);})[_0x9971('0x28')](function(_0x36f799){_0x13ca37(_0x36f799[_0x9971('0x18')]);});});}function createEndUser(_0x5a78f8,_0x56f686,_0x122538,_0x511700,_0x3b0696,_0x3c3c1e,_0x52d6ee){return new Promise(function(_0xe3daad,_0x1a5b59){return getAuthToken(_0x56f686,_0x122538,_0x3c3c1e)[_0x9971('0x15')](function(_0x27a32e){var _0x4c524d=_0x3c3c1e['toLowerCase']()==='outbound'?_0x3b0696[_0x9971('0x29')]:_0x3b0696[_0x9971('0x2a')];var _0x1158dc={'method':_0x9971('0x11'),'uri':_0x511700+_0x9971('0x2b'),'body':{'fullname':_0x4c524d,'firstname':_0x4c524d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x5a78f8[_0x9971('0x2c')]+')'},'headers':{'Authorization':_0x9971('0x1b')+_0x27a32e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x1158dc[_0x9971('0x2d')][_0x52d6ee]=_0x4c524d;return rp(_0x1158dc);})['then'](function(_0x3c6ad2){var _0x1b4cd7=_0x3c6ad2['headers']['odata-entityid'];var _0x36f5c0=_0x1b4cd7['substring'](_0x1b4cd7['lastIndexOf']('(')+0x1,_0x1b4cd7[_0x9971('0x2e')](')'));_0x5a78f8[_0x9971('0x2f')]=_0x36f5c0;_0xe3daad(_0x5a78f8);})['catch'](function(_0x4c8f0b){_0x1a5b59(_0x4c8f0b[_0x9971('0x18')]);});});}function getEndUser(_0x20eb76,_0x519eaa,_0x92d4c6,_0x32bed1,_0x18e389,_0x1b7bdf,_0x1c47ca,_0x335569){var _0x4f162f=_0x1b7bdf[_0x9971('0x30')]()===_0x9971('0x31')?_0x18e389[_0x9971('0x29')]:_0x18e389[_0x9971('0x2a')];return getAuthToken(_0x519eaa,_0x92d4c6,_0x1b7bdf)[_0x9971('0x15')](function(_0x4c3d81){_0x335569=_0x335569?_0x335569:_0x9971('0x32');var _0x4eb71a={'method':_0x9971('0x19'),'uri':_0x32bed1+_0x9971('0x33')+_0x335569+_0x9971('0x34')+_0x335569+_0x9971('0x35')+_0x4f162f[_0x9971('0x36')]('+','%2b')+'\x27','headers':{'Authorization':_0x9971('0x1b')+_0x4c3d81,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4eb71a);})[_0x9971('0x15')](function(_0x32d599){var _0x1db81c=![];if(!_0x32d599)return _0x1db81c;var _0x54aa3a=_0x32d599['value'];for(var _0x4bdf80=0x0;_0x4bdf80<_0x54aa3a[_0x9971('0x21')];_0x4bdf80++){if(_0x54aa3a[_0x4bdf80][_0x335569]===_0x4f162f){_0x1db81c=!![];_0x20eb76[_0x9971('0x2f')]=_0x54aa3a[_0x4bdf80]['contactid'];}}return _0x1db81c;})['then'](function(_0x376655){if(_0x376655)return _0x20eb76;if(_0x1c47ca===_0x9971('0x37')){logger[_0x9971('0x23')]('['+[_0x1b7bdf[_0x9971('0x24')]()]+_0x9971('0x38'));return _0x20eb76;}return createEndUser(_0x20eb76,_0x519eaa,_0x92d4c6,_0x32bed1,_0x18e389,_0x1b7bdf,_0x335569)['then'](function(_0x584665){logger[_0x9971('0x23')]('['+[_0x1b7bdf['toUpperCase']()]+_0x9971('0x39'),_0x584665[_0x9971('0x2f')]);return _0x584665;});});}function getCustomFields(_0x2747f2,_0x55a66c,_0x83ebf9){var _0x28a341={};if(_0x2747f2[_0x9971('0x21')]>0x0){_[_0x9971('0x3a')](_0x2747f2,function(_0x2dd2af){if(_[_0x9971('0x3b')](['string',_0x9971('0x3c')],_0x2dd2af[_0x9971('0x3d')])&&_0x2dd2af[_0x9971('0x3e')]&&!_0x2dd2af['customField']){var _0x1a0205=_0x2dd2af[_0x9971('0x3f')][_0x9971('0x30')]();var _0x826388=_0x1a0205[_0x9971('0x40')](0x0,_0x1a0205['indexOf']('_'));var _0x30eeb8=_0x1a0205[_0x9971('0x40')](_0x1a0205['indexOf']('_')+0x1);if(_0x826388===_0x83ebf9){_0x28a341[_0x30eeb8]=_0x2dd2af['content'];}}});}return _0x28a341;}function getTicket(_0x1633ce,_0x3360e2,_0xa80ba5,_0x149934,_0x4a42fd,_0x5a528b,_0x3cf1de){return new Promise(function(_0x145ac0,_0x32b248){var _0x4460fe;return getAuthToken(_0x3360e2,_0xa80ba5,_0x3cf1de)[_0x9971('0x15')](function(_0xf3aa4b){if(_0x5a528b[_0x9971('0x41')]===_0x9971('0x42')){_0x4460fe={'method':_0x9971('0x11'),'uri':_0x149934+_0x9971('0x43'),'body':Object['assign']({},{'title':intUtil['getString'](_0x5a528b['Subjects'],_0x4a42fd,'\x20'),'description':intUtil[_0x9971('0x44')](_0x5a528b['Descriptions'],_0x4a42fd,'\x0a'),'customerid_contact@odata.bind':_0x1633ce[_0x9971('0x2f')]?_0x9971('0x45')+_0x1633ce[_0x9971('0x2f')]+')':undefined,'ownerid@odata.bind':_0x9971('0x46')+_0x1633ce[_0x9971('0x2c')]+')','caseorigincode':'1'},getCustomFields(_0x5a528b['Fields'],_0x4a42fd,_0x5a528b['ticketType'])),'headers':{'Authorization':_0x9971('0x1b')+_0xf3aa4b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5a528b['ticketType']===_0x9971('0x47')){var _0x8647dc=_0x1633ce['enduserId']?[{'partyid_systemuser@odata.bind':_0x9971('0x46')+_0x1633ce[_0x9971('0x2c')]+')','participationtypemask':_0x1633ce[_0x9971('0x48')]===_0x9971('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x9971('0x45')+_0x1633ce[_0x9971('0x2f')]+')','participationtypemask':_0x1633ce['callDirection']===_0x9971('0x49')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1633ce[_0x9971('0x2c')]+')','participationtypemask':_0x1633ce[_0x9971('0x48')]==='queue'?0x2:0x1}];_0x4460fe={'method':'POST','uri':_0x149934+_0x9971('0x4a'),'body':Object[_0x9971('0x4b')]({},{'subject':intUtil[_0x9971('0x44')](_0x5a528b['Subjects'],_0x4a42fd,'\x20'),'phonenumber':String(_0x4a42fd[_0x9971('0x2a')]),'description':intUtil['getString'](_0x5a528b['Descriptions'],_0x4a42fd,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1633ce['enduserId']?_0x9971('0x45')+_0x1633ce[_0x9971('0x2f')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x1633ce[_0x9971('0x2c')]+')','directioncode':_0x1633ce[_0x9971('0x48')]===_0x9971('0x49')?![]:!![],'phonecall_activity_parties':_0x8647dc},getCustomFields(_0x5a528b[_0x9971('0x4c')],_0x4a42fd,_0x5a528b['ticketType'])),'headers':{'Authorization':_0x9971('0x1b')+_0xf3aa4b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4460fe);})[_0x9971('0x15')](function(_0x20519b){var _0x2b7701=_0x20519b[_0x9971('0x4d')]['odata-entityid'];var _0x44d1d7=_0x2b7701['substring'](_0x2b7701[_0x9971('0x2e')]('(')+0x1,_0x2b7701['lastIndexOf'](')'));_0x1633ce[_0x9971('0x4e')]=_0x44d1d7;_0x145ac0(_0x1633ce);})[_0x9971('0x28')](function(_0x453855){_0x32b248(_0x453855[_0x9971('0x18')]);});});}function emit(_0x36968f,_0xeb0d6a,_0x1c30c4,_0x3fafb4){var _0x3aee88={'uri':util[_0x9971('0x4f')](_0x9971('0x50'),_0x36968f,_0x1c30c4,_0x3fafb4)};io['to'](util[_0x9971('0x4f')](_0x9971('0x51'),_0xeb0d6a))[_0x9971('0x52')]('trigger:browser:url',_0x3aee88);}exports['cs']=function(_0x28afc3,_0x38b92d,_0x5adf25,_0x1462ba,_0x4ba8a0,_0xeab64c,_0x50bc2d,_0x2a4188){var _0x2de410={};_0xeab64c[_0x9971('0xb')]=_0xeab64c['modernAuthentication']?intUtil[_0x9971('0x53')](_0xeab64c[_0x9971('0xc')][_0x9971('0x54')]):intUtil[_0x9971('0x53')](_0xeab64c[_0x9971('0xb')]);_0xeab64c[_0x9971('0x55')]=intUtil[_0x9971('0x53')](_0xeab64c[_0x9971('0x55')]);_0x2de410[_0x9971('0x48')]=_0x2a4188===_0x9971('0x49')||_0x2a4188===_0x9971('0x56')?'queue':_0x9971('0x31');var _0x40ba1e=_0xeab64c[_0x9971('0xa')]?util['format'](_0x9971('0x57'),_0xeab64c[_0x9971('0xc')][_0x9971('0x54')]):util[_0x9971('0x4f')]('%s/api/data/v9.0/',_0xeab64c['remoteUri']);var _0x5db72b=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0xeab64c[_0x9971('0xd')]);var _0x219ea2=util[_0x9971('0x4f')](_0x9971('0x58'),_0xeab64c[_0x9971('0x55')],_0x38b92d[_0x9971('0x59')],md5(_0x38b92d['uniqueid']));if(_0x4ba8a0&&_0x4ba8a0[_0x9971('0x5a')]){logger['info'](_0x9971('0x5b'),'Recording\x20is\x20enabled!');_0x38b92d[_0x9971('0x5c')]=_0x219ea2;}else if(_0x50bc2d&&_0x50bc2d[_0x9971('0x5d')]&&_0x50bc2d[_0x9971('0x5d')]!==_0x9971('0x5e')){logger[_0x9971('0x23')](_0x9971('0x5f'),_0x9971('0x60'));_0x38b92d[_0x9971('0x5c')]=_0x219ea2;}else{_0x38b92d[_0x9971('0x5c')]='';}return getUser(_0x2de410,_0xeab64c,_0x1462ba,_0x5db72b,_0x40ba1e,_0x2a4188)['then'](function(_0x4e018c){logger[_0x9971('0x23')]('['+_0x2a4188['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x4e018c['userId']);logger['info']('['+_0x2a4188['toUpperCase']()+_0x9971('0x61'),_0x4e018c['userEmail']);return getEndUser(_0x4e018c,_0xeab64c,_0x5db72b,_0x40ba1e,_0x38b92d,_0x2a4188,_0x5adf25[_0x9971('0x62')],_0x5adf25[_0x9971('0x63')]);})[_0x9971('0x15')](function(_0x200b5d){logger[_0x9971('0x23')]('['+_0x2a4188[_0x9971('0x24')]()+_0x9971('0x64'),_0x200b5d[_0x9971('0x2f')]);logger[_0x9971('0x23')]('['+_0x2a4188[_0x9971('0x24')]()+_0x9971('0x65'),_0x38b92d[_0x9971('0x2a')]);return getTicket(_0x200b5d,_0xeab64c,_0x5db72b,_0x40ba1e,_0x38b92d,_0x5adf25,_0x2a4188);})[_0x9971('0x15')](function(_0xee52af){logger['info'](util['format']('['+_0x2a4188[_0x9971('0x24')]()+_0x9971('0x66'),_0x5adf25['ticketType'],_0xee52af[_0x9971('0x4e')]));logger[_0x9971('0x23')](util[_0x9971('0x4f')]('['+_0x2a4188[_0x9971('0x24')]()+_0x9971('0x67'),_0x2a4188));if(_0x2a4188!=='unmanaged'&&_0x5adf25[_0x9971('0x68')]){logger[_0x9971('0x23')]('['+_0x2a4188[_0x9971('0x24')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xeab64c[_0x9971('0xb')],_0x1462ba['name'],_0x5adf25[_0x9971('0x41')],_0xee52af[_0x9971('0x4e')]);}})[_0x9971('0x28')](function(_0x1a098e){logger[_0x9971('0x69')]('['+_0x2a4188[_0x9971('0x24')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x1a098e[_0x9971('0x18')]);console['error'](_0x9971('0x6a'),_0x1a098e);});}; \ 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 1998ac5..4757548 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 _0x67ef=['push','content','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','Subjects','getString','Descriptions','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','length','find','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','GET','map','forEach','picklist','type','nameField','customField','includes','string','idField'];(function(_0x2b8a96,_0x30d1c6){var _0x319d3d=function(_0x2b9311){while(--_0x2b9311){_0x2b8a96['push'](_0x2b8a96['shift']());}};_0x319d3d(++_0x30d1c6);}(_0x67ef,0x7f));var _0xf67e=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x67ef[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xf67e('0x0'));var rp=require(_0xf67e('0x1'));var md5=require(_0xf67e('0x2'));var util=require(_0xf67e('0x3'));var Redis=require(_0xf67e('0x4'));var intUtil=require(_0xf67e('0x5'));var config=require('../../../../config/environment');var logger=require(_0xf67e('0x6'))('freshdesk');config[_0xf67e('0x7')]=_[_0xf67e('0x8')](config[_0xf67e('0x7')],{'host':_0xf67e('0x9'),'port':0x18eb});var io=require(_0xf67e('0xa'))(new Redis(config[_0xf67e('0x7')]));var headers={'Content-Type':_0xf67e('0xb'),'Accept':_0xf67e('0xb')};function emit(_0x4cec71,_0x5e6d9b,_0xb2be5a){io['to'](_0x4cec71)['emit'](_0x5e6d9b,_0xb2be5a);}function getTicket(_0x22a1bc,_0x3bd3b6,_0x4f137e,_0x3d821f,_0xd9d94a){logger[_0xf67e('0xc')](_0xf67e('0xd'));var _0x28fd9b=_['merge']({'responder_id':_0x3bd3b6['id'],'requester_id':_0x4f137e['id'],'name':util[_0xf67e('0xe')](_0xf67e('0xf'),_0xd9d94a['calleridname']),'phone':_0xd9d94a['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x3d821f[_0xf67e('0x10')],_0xd9d94a,'\x20'),'description':intUtil[_0xf67e('0x11')](_0x3d821f[_0xf67e('0x12')],_0xd9d94a,'
'),'tags':getTags(_0x3d821f['Tags'],_0xf67e('0x13'))},getCustomFields(_0x3d821f[_0xf67e('0x14')],_0xd9d94a));_0x28fd9b[_0xf67e('0x15')]=_[_0xf67e('0x16')](_[_0xf67e('0x17')](_0x28fd9b[_0xf67e('0x15')],'id'),_0xf67e('0x18'));return request({'uri':util[_0xf67e('0xe')](_0xf67e('0x19'),_0x22a1bc[_0xf67e('0x1a')]),'method':_0xf67e('0x1b'),'body':_0x28fd9b})[_0xf67e('0x1c')](function(_0x297fa1){logger[_0xf67e('0xc')](_0xf67e('0x1d'));return _0x297fa1;});}function getUser(_0x5425f4,_0x444e12){if(intUtil[_0xf67e('0x1e')](_0x444e12)){return request({'uri':util[_0xf67e('0xe')]('%s/api/v2/agents',_0x5425f4[_0xf67e('0x1a')]),'qs':{'email':_0x444e12}})[_0xf67e('0x1c')](function(_0x4cd61e){if(_0x4cd61e[_0xf67e('0x1f')]){logger['info']('Agent\x20found!');return _[_0xf67e('0x20')](_0x4cd61e,function(_0x54d98e){return _0x54d98e[_0xf67e('0x21')][_0xf67e('0x22')]===_0x444e12;});}else{logger[_0xf67e('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf67e('0xe')](_0xf67e('0x23'),_0x5425f4[_0xf67e('0x1a')])})[_0xf67e('0x1c')](function(_0x4e1dbf){logger[_0xf67e('0xc')]('Admin\x20account\x20selected.');return _0x4e1dbf;});}});}else{logger['info'](_0xf67e('0x24'));return request({'uri':util[_0xf67e('0xe')](_0xf67e('0x23'),_0x5425f4[_0xf67e('0x1a')])})[_0xf67e('0x1c')](function(_0x11bc50){logger[_0xf67e('0xc')](_0xf67e('0x25'));return _0x11bc50;});}}function getEndUser(_0x265b5c,_0x34e418,_0x1dd200){logger[_0xf67e('0xc')]('Searching\x20enduser\x20with\x20phone',_0x1dd200);return request({'uri':util['format'](_0xf67e('0x26'),_0x265b5c[_0xf67e('0x1a')]),'qs':{'phone':_0x1dd200}})[_0xf67e('0x1c')](function(_0xc31bdc){if(_0xc31bdc[_0xf67e('0x1f')]){logger[_0xf67e('0xc')](_0xf67e('0x27'));return _['find'](_0xc31bdc,{'phone':_0x1dd200});}else{logger[_0xf67e('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xf67e('0x26'),_0x265b5c[_0xf67e('0x1a')]),'method':_0xf67e('0x1b'),'body':{'name':_0x34e418,'phone':_0x1dd200}})[_0xf67e('0x1c')](function(_0x426a53){logger['info'](_0xf67e('0x28'));return _0x426a53;});}});}function getAuth(_0x40d9ca){return util[_0xf67e('0xe')](_0xf67e('0x29'),new Buffer(_0x40d9ca[_0xf67e('0x2a')]+':X')[_0xf67e('0x2b')](_0xf67e('0x2c')));}function request(_0x357d75){logger[_0xf67e('0x2d')]('[HTTP]',JSON[_0xf67e('0x2e')](_0x357d75));return rp(_[_0xf67e('0x8')](_0x357d75,{'method':_0xf67e('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x1b410d,_0x1b4847){var _0x1f8d9e=[];if(_0x1b410d&&_0x1b410d[_0xf67e('0x1f')]>0x0){_0x1f8d9e=_[_0xf67e('0x30')](_0x1b410d,_0x1b4847);}return _0x1f8d9e;}function getCustomFields(_0x241ff5,_0x5d3265){var _0x36d9b6=[];var _0x449de3={'custom_fields':[]};if(_0x241ff5[_0xf67e('0x1f')]>0x0){_[_0xf67e('0x31')](_0x241ff5,function(_0x35973a){if(_['includes'](['string',_0xf67e('0x32')],_0x35973a[_0xf67e('0x33')])&&_0x35973a[_0xf67e('0x34')]&&!_0x35973a[_0xf67e('0x35')]){_0x449de3[_0x35973a['nameField']['toLowerCase']()]=_0x35973a['content']['toString']();}else if(_[_0xf67e('0x36')]([_0xf67e('0x37'),_0xf67e('0x32')],_0x35973a['type'])&&_0x35973a[_0xf67e('0x38')]&&_0x35973a[_0xf67e('0x35')]){_0x449de3[_0xf67e('0x15')][_0xf67e('0x39')]({'id':_0x35973a['idField'],'value':_0x35973a[_0xf67e('0x3a')]['toString']()});}else if(_0x35973a[_0xf67e('0x33')]==='variable'&&_0x35973a[_0xf67e('0x3b')]&&_0x35973a[_0xf67e('0x38')]&&_0x35973a['customField']){_0x5d3265[_0x35973a[_0xf67e('0x3b')]]&&_0x449de3[_0xf67e('0x15')][_0xf67e('0x39')]({'id':_0x35973a['idField'],'value':_0x5d3265[_0x35973a[_0xf67e('0x3b')]][_0xf67e('0x2b')]()});}else if(_0x35973a['type']===_0xf67e('0x3c')&&_0x35973a['Variable']&&_0x35973a['Variable']['name']&&_0x35973a[_0xf67e('0x38')]&&_0x35973a[_0xf67e('0x35')]){_0x5d3265[_0x35973a[_0xf67e('0x3d')][_0xf67e('0x13')][_0xf67e('0x3e')]()]&&_0x449de3[_0xf67e('0x15')][_0xf67e('0x39')]({'id':_0x35973a[_0xf67e('0x38')],'value':_0x5d3265[_0x35973a[_0xf67e('0x3d')][_0xf67e('0x13')]['toLowerCase']()][_0xf67e('0x2b')]()});}});}return _0x449de3;}exports[_0xf67e('0x3f')]=function(_0x3d0395,_0x44fcdf,_0x3b13dd,_0xa8c3df,_0x2af6fa,_0x3fff98){var _0x55c0e0,_0x5322b2;_0x3fff98['remoteUri']=intUtil[_0xf67e('0x40')](_0x3fff98[_0xf67e('0x1a')]);_0x3fff98[_0xf67e('0x41')]=intUtil[_0xf67e('0x40')](_0x3fff98[_0xf67e('0x41')]);if(_0x2af6fa&&_0x2af6fa['monitor_format']){logger[_0xf67e('0xc')](_0xf67e('0x42'),_0xf67e('0x43'));_0x44fcdf[_0xf67e('0x44')]=util[_0xf67e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3fff98[_0xf67e('0x41')],_0x44fcdf['uniqueid'],md5(_0x44fcdf[_0xf67e('0x45')]));}else{_0x44fcdf[_0xf67e('0x44')]='';}headers[_0xf67e('0x46')]=getAuth(_0x3fff98);return getUser(_0x3fff98,_0xa8c3df[_0xf67e('0x22')])[_0xf67e('0x1c')](function(_0x521c32){_0x55c0e0=_0x521c32;logger[_0xf67e('0xc')](_0xf67e('0x47'),_0x55c0e0['id']);return getEndUser(_0x3fff98,_0x44fcdf[_0xf67e('0x48')],_0x44fcdf[_0xf67e('0x49')]);})[_0xf67e('0x1c')](function(_0x948459){_0x5322b2=_0x948459;logger[_0xf67e('0xc')](_0xf67e('0x4a'),_0x5322b2['id']);return getTicket(_0x3fff98,_0x55c0e0,_0x5322b2,_0x3b13dd,_0x44fcdf);})[_0xf67e('0x1c')](function(_0x29e7c2){if(_0x29e7c2&&_0x29e7c2['id']){logger[_0xf67e('0xc')](_0xf67e('0x1d'));logger[_0xf67e('0xc')]('The\x20Ticket\x20ID\x20is:',_0x29e7c2['id']);logger['info'](_0xf67e('0x42'),_0xf67e('0x4b'));emit(util[_0xf67e('0xe')](_0xf67e('0x4c'),_0xa8c3df[_0xf67e('0x13')]),_0xf67e('0x4d'),{'uri':util[_0xf67e('0xe')](_0xf67e('0x4e'),_0x3fff98['remoteUri'],_0x29e7c2['id'])});}})[_0xf67e('0x4f')](function(_0x4fe6cd){logger[_0xf67e('0x50')](_0xf67e('0x42'),JSON[_0xf67e('0x2e')](_0x4fe6cd));});};exports[_0xf67e('0x51')]=function(_0x5a225c,_0x389853,_0x79cae4,_0x19fd67,_0x260ab4,_0x4be977,_0x4abeba){var _0x493422,_0x4104a2;_0x4be977[_0xf67e('0x1a')]=intUtil[_0xf67e('0x40')](_0x4be977['remoteUri']);_0x4be977[_0xf67e('0x41')]=intUtil[_0xf67e('0x40')](_0x4be977['serverUrl']);if(_0x4abeba&&_0x4abeba['recordingFormat']&&_0x4abeba['recordingFormat']!==_0xf67e('0x52')){logger['info'](_0xf67e('0x53'),_0xf67e('0x43'));_0x389853[_0xf67e('0x44')]=util[_0xf67e('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4be977[_0xf67e('0x41')],_0x389853[_0xf67e('0x45')],md5(_0x389853['uniqueid']));}headers[_0xf67e('0x46')]=getAuth(_0x4be977);return getUser(_0x4be977,_0x19fd67[_0xf67e('0x22')])[_0xf67e('0x1c')](function(_0x43037a){_0x493422=_0x43037a;logger[_0xf67e('0xc')](_0xf67e('0x47'),_0x493422['id']);return getEndUser(_0x4be977,_0x389853[_0xf67e('0x54')],_0x389853[_0xf67e('0x55')]);})[_0xf67e('0x1c')](function(_0x5a1752){_0x4104a2=_0x5a1752;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4104a2['id']);return getTicket(_0x4be977,_0x493422,_0x4104a2,_0x79cae4,_0x389853);})['then'](function(_0x2cf46a){if(_0x2cf46a&&_0x2cf46a['id']){logger[_0xf67e('0xc')]('Ticket\x20created!');logger[_0xf67e('0xc')](_0xf67e('0x56'),_0x2cf46a['id']);logger[_0xf67e('0xc')](_0xf67e('0x53'),_0xf67e('0x4b'));emit(util['format']('user:%s',_0x19fd67[_0xf67e('0x13')]),_0xf67e('0x4d'),{'uri':util['format'](_0xf67e('0x4e'),_0x4be977['remoteUri'],_0x2cf46a['id'])});}})['catch'](function(_0x39bae5){logger[_0xf67e('0x50')](_0xf67e('0x53'),JSON['stringify'](_0x39bae5));});};exports[_0xf67e('0x57')]=function(_0x5a5810,_0x58c754,_0x23a4c5,_0x345821,_0x4d0794,_0x441c86){var _0x1d3f6f,_0x37c231;_0x441c86[_0xf67e('0x1a')]=intUtil[_0xf67e('0x40')](_0x441c86[_0xf67e('0x1a')]);_0x441c86[_0xf67e('0x41')]=intUtil['stripTrailingSlash'](_0x441c86['serverUrl']);if(_0x4d0794&&_0x4d0794[_0xf67e('0x58')]){logger[_0xf67e('0xc')]('['+_0x58c754[_0xf67e('0x59')][_0xf67e('0x5a')]()+']',_0xf67e('0x43'));_0x58c754[_0xf67e('0x44')]=util[_0xf67e('0xe')](_0xf67e('0x5b'),_0x441c86[_0xf67e('0x41')],_0x58c754['uniqueid'],md5(_0x58c754[_0xf67e('0x45')]));}else{_0x58c754['recordingURL']='';}headers['Authorization']=getAuth(_0x441c86);return getUser(_0x441c86,'')[_0xf67e('0x1c')](function(_0x5dccb5){_0x1d3f6f=_0x5dccb5;logger[_0xf67e('0xc')](_0xf67e('0x47'),_0x1d3f6f['id']);return getEndUser(_0x441c86,_0x58c754[_0xf67e('0x48')],_0x58c754[_0xf67e('0x49')]);})[_0xf67e('0x1c')](function(_0x1ac472){_0x37c231=_0x1ac472;logger[_0xf67e('0xc')]('The\x20Enduser\x20ID\x20is:',_0x37c231['id']);return getTicket(_0x441c86,_0x1d3f6f,_0x37c231,_0x23a4c5,_0x58c754);})[_0xf67e('0x1c')](function(_0x42797e){if(_0x42797e){logger[_0xf67e('0xc')](_0xf67e('0x1d'));logger[_0xf67e('0xc')](_0xf67e('0x56'),_0x42797e['id']);}})[_0xf67e('0x4f')](function(_0x30513b){logger[_0xf67e('0x50')]('['+_0x58c754['lastevent'][_0xf67e('0x5a')]()+']',JSON[_0xf67e('0x2e')](_0x30513b));});}; \ No newline at end of file +var _0x888a=['[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','freshdesk','redis','localhost','application/json','emit','Creating\x20new\x20ticket...','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','keyBy','custom_fields','value','remoteUri','POST','Ticket\x20created!','%s/api/v2/agents','length','info','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20created.','base64','debug','[HTTP]','stringify','GET','forEach','string','picklist','nameField','customField','toLowerCase','content','type','idField','push','toString','variable','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x888a,0xb5));var _0xa888=function(_0x19d772,_0x416536){_0x19d772=_0x19d772-0x0;var _0x1b7788=_0x888a[_0x19d772];return _0x1b7788;};'use strict';var _=require(_0xa888('0x0'));var rp=require(_0xa888('0x1'));var md5=require(_0xa888('0x2'));var util=require(_0xa888('0x3'));var Redis=require(_0xa888('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xa888('0x5'));config[_0xa888('0x6')]=_['defaults'](config['redis'],{'host':_0xa888('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa888('0x6')]));var headers={'Content-Type':_0xa888('0x8'),'Accept':_0xa888('0x8')};function emit(_0x15e2b8,_0x15b53b,_0x51c33c){io['to'](_0x15e2b8)[_0xa888('0x9')](_0x15b53b,_0x51c33c);}function getTicket(_0x42f469,_0x12becf,_0x2980c5,_0x3556f0,_0x1c5bd5){logger['info'](_0xa888('0xa'));var _0xe30d3e=_['merge']({'responder_id':_0x12becf['id'],'requester_id':_0x2980c5['id'],'name':util[_0xa888('0xb')]('Caller\x20-\x20%s',_0x1c5bd5[_0xa888('0xc')]),'phone':_0x1c5bd5[_0xa888('0xd')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa888('0xe')](_0x3556f0[_0xa888('0xf')],_0x1c5bd5,'\x20'),'description':intUtil[_0xa888('0xe')](_0x3556f0[_0xa888('0x10')],_0x1c5bd5,_0xa888('0x11')),'tags':getTags(_0x3556f0[_0xa888('0x12')],_0xa888('0x13'))},getCustomFields(_0x3556f0[_0xa888('0x14')],_0x1c5bd5));_0xe30d3e['custom_fields']=_[_0xa888('0x15')](_[_0xa888('0x16')](_0xe30d3e[_0xa888('0x17')],'id'),_0xa888('0x18'));return request({'uri':util[_0xa888('0xb')]('%s/api/v2/tickets',_0x42f469[_0xa888('0x19')]),'method':_0xa888('0x1a'),'body':_0xe30d3e})['then'](function(_0x29d8a7){logger['info'](_0xa888('0x1b'));return _0x29d8a7;});}function getUser(_0x44a77d,_0x577cd1){if(intUtil['validateEmail'](_0x577cd1)){return request({'uri':util[_0xa888('0xb')](_0xa888('0x1c'),_0x44a77d[_0xa888('0x19')]),'qs':{'email':_0x577cd1}})['then'](function(_0x4f0e73){if(_0x4f0e73[_0xa888('0x1d')]){logger[_0xa888('0x1e')](_0xa888('0x1f'));return _[_0xa888('0x20')](_0x4f0e73,function(_0x3f08e4){return _0x3f08e4[_0xa888('0x21')][_0xa888('0x22')]===_0x577cd1;});}else{logger[_0xa888('0x1e')](_0xa888('0x23'));return request({'uri':util['format'](_0xa888('0x24'),_0x44a77d[_0xa888('0x19')])})[_0xa888('0x25')](function(_0x3fa652){logger[_0xa888('0x1e')](_0xa888('0x26'));return _0x3fa652;});}});}else{logger[_0xa888('0x1e')](_0xa888('0x27'));return request({'uri':util[_0xa888('0xb')](_0xa888('0x24'),_0x44a77d['remoteUri'])})[_0xa888('0x25')](function(_0xbbe42e){logger[_0xa888('0x1e')](_0xa888('0x26'));return _0xbbe42e;});}}function getEndUser(_0x10316e,_0x686a57,_0x285a17){logger[_0xa888('0x1e')](_0xa888('0x28'),_0x285a17);return request({'uri':util['format'](_0xa888('0x29'),_0x10316e[_0xa888('0x19')]),'qs':{'phone':_0x285a17}})[_0xa888('0x25')](function(_0x25481d){if(_0x25481d[_0xa888('0x1d')]){logger[_0xa888('0x1e')]('Enduser\x20found!');return _[_0xa888('0x20')](_0x25481d,{'phone':_0x285a17});}else{logger[_0xa888('0x1e')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xa888('0xb')](_0xa888('0x29'),_0x10316e[_0xa888('0x19')]),'method':_0xa888('0x1a'),'body':{'name':_0x686a57,'phone':_0x285a17}})[_0xa888('0x25')](function(_0x2b2cf6){logger[_0xa888('0x1e')](_0xa888('0x2a'));return _0x2b2cf6;});}});}function getAuth(_0x5f532d){return util['format']('Basic\x20%s',new Buffer(_0x5f532d['apiKey']+':X')['toString'](_0xa888('0x2b')));}function request(_0x55d3b2){logger[_0xa888('0x2c')](_0xa888('0x2d'),JSON[_0xa888('0x2e')](_0x55d3b2));return rp(_['defaults'](_0x55d3b2,{'method':_0xa888('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x1d3612,_0x56f4a1){var _0x355998=[];if(_0x1d3612&&_0x1d3612['length']>0x0){_0x355998=_['map'](_0x1d3612,_0x56f4a1);}return _0x355998;}function getCustomFields(_0x210ff2,_0x45b361){var _0xe7e3ae=[];var _0x2f41f0={'custom_fields':[]};if(_0x210ff2[_0xa888('0x1d')]>0x0){_[_0xa888('0x30')](_0x210ff2,function(_0x4091a7){if(_['includes']([_0xa888('0x31'),_0xa888('0x32')],_0x4091a7['type'])&&_0x4091a7[_0xa888('0x33')]&&!_0x4091a7[_0xa888('0x34')]){_0x2f41f0[_0x4091a7['nameField'][_0xa888('0x35')]()]=_0x4091a7[_0xa888('0x36')]['toString']();}else if(_['includes']([_0xa888('0x31'),'picklist'],_0x4091a7[_0xa888('0x37')])&&_0x4091a7[_0xa888('0x38')]&&_0x4091a7[_0xa888('0x34')]){_0x2f41f0['custom_fields'][_0xa888('0x39')]({'id':_0x4091a7[_0xa888('0x38')],'value':_0x4091a7[_0xa888('0x36')][_0xa888('0x3a')]()});}else if(_0x4091a7[_0xa888('0x37')]===_0xa888('0x3b')&&_0x4091a7['variableName']&&_0x4091a7[_0xa888('0x38')]&&_0x4091a7[_0xa888('0x34')]){_0x45b361[_0x4091a7['variableName']]&&_0x2f41f0[_0xa888('0x17')]['push']({'id':_0x4091a7[_0xa888('0x38')],'value':_0x45b361[_0x4091a7['variableName']][_0xa888('0x3a')]()});}else if(_0x4091a7[_0xa888('0x37')]===_0xa888('0x3c')&&_0x4091a7[_0xa888('0x3d')]&&_0x4091a7['Variable'][_0xa888('0x13')]&&_0x4091a7['idField']&&_0x4091a7[_0xa888('0x34')]){_0x45b361[_0x4091a7[_0xa888('0x3d')][_0xa888('0x13')]['toLowerCase']()]&&_0x2f41f0['custom_fields']['push']({'id':_0x4091a7[_0xa888('0x38')],'value':_0x45b361[_0x4091a7[_0xa888('0x3d')]['name'][_0xa888('0x35')]()][_0xa888('0x3a')]()});}});}return _0x2f41f0;}exports[_0xa888('0x3e')]=function(_0x2786d3,_0x254c29,_0x3dcb55,_0x239af0,_0x1551ee,_0x440b4d){var _0x4bad30,_0x333699;_0x440b4d[_0xa888('0x19')]=intUtil['stripTrailingSlash'](_0x440b4d['remoteUri']);_0x440b4d[_0xa888('0x3f')]=intUtil[_0xa888('0x40')](_0x440b4d[_0xa888('0x3f')]);if(_0x1551ee&&_0x1551ee[_0xa888('0x41')]){logger[_0xa888('0x1e')](_0xa888('0x42'),'Recording\x20is\x20enabled!');_0x254c29['recordingURL']=util[_0xa888('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x440b4d['serverUrl'],_0x254c29[_0xa888('0x43')],md5(_0x254c29[_0xa888('0x43')]));}else{_0x254c29[_0xa888('0x44')]='';}headers[_0xa888('0x45')]=getAuth(_0x440b4d);return getUser(_0x440b4d,_0x239af0[_0xa888('0x22')])[_0xa888('0x25')](function(_0x2dc9a6){_0x4bad30=_0x2dc9a6;logger['info'](_0xa888('0x46'),_0x4bad30['id']);return getEndUser(_0x440b4d,_0x254c29['calleridname'],_0x254c29['calleridnum']);})[_0xa888('0x25')](function(_0x49d936){_0x333699=_0x49d936;logger[_0xa888('0x1e')](_0xa888('0x47'),_0x333699['id']);return getTicket(_0x440b4d,_0x4bad30,_0x333699,_0x3dcb55,_0x254c29);})['then'](function(_0x1be2d3){if(_0x1be2d3&&_0x1be2d3['id']){logger[_0xa888('0x1e')](_0xa888('0x1b'));logger[_0xa888('0x1e')](_0xa888('0x48'),_0x1be2d3['id']);logger['info'](_0xa888('0x42'),_0xa888('0x49'));emit(util[_0xa888('0xb')]('user:%s',_0x239af0[_0xa888('0x13')]),_0xa888('0x4a'),{'uri':util['format'](_0xa888('0x4b'),_0x440b4d[_0xa888('0x19')],_0x1be2d3['id'])});}})[_0xa888('0x4c')](function(_0x7fe1e0){logger[_0xa888('0x4d')](_0xa888('0x42'),JSON['stringify'](_0x7fe1e0));});};exports['outbound']=function(_0x4dee7d,_0x371a82,_0xc9dfa7,_0x466784,_0x30fde2,_0x48aa5d,_0xf3fb9a){var _0x42e2a5,_0xf8fe4e;_0x48aa5d[_0xa888('0x19')]=intUtil[_0xa888('0x40')](_0x48aa5d[_0xa888('0x19')]);_0x48aa5d[_0xa888('0x3f')]=intUtil[_0xa888('0x40')](_0x48aa5d['serverUrl']);if(_0xf3fb9a&&_0xf3fb9a['recordingFormat']&&_0xf3fb9a[_0xa888('0x4e')]!==_0xa888('0x4f')){logger[_0xa888('0x1e')](_0xa888('0x50'),_0xa888('0x51'));_0x371a82[_0xa888('0x44')]=util[_0xa888('0xb')](_0xa888('0x52'),_0x48aa5d[_0xa888('0x3f')],_0x371a82[_0xa888('0x43')],md5(_0x371a82[_0xa888('0x43')]));}headers[_0xa888('0x45')]=getAuth(_0x48aa5d);return getUser(_0x48aa5d,_0x466784[_0xa888('0x22')])[_0xa888('0x25')](function(_0x215625){_0x42e2a5=_0x215625;logger[_0xa888('0x1e')](_0xa888('0x46'),_0x42e2a5['id']);return getEndUser(_0x48aa5d,_0x371a82['destcalleridname'],_0x371a82[_0xa888('0x53')]);})[_0xa888('0x25')](function(_0x52053e){_0xf8fe4e=_0x52053e;logger['info'](_0xa888('0x47'),_0xf8fe4e['id']);return getTicket(_0x48aa5d,_0x42e2a5,_0xf8fe4e,_0xc9dfa7,_0x371a82);})[_0xa888('0x25')](function(_0x3c1d0f){if(_0x3c1d0f&&_0x3c1d0f['id']){logger[_0xa888('0x1e')](_0xa888('0x1b'));logger[_0xa888('0x1e')](_0xa888('0x48'),_0x3c1d0f['id']);logger[_0xa888('0x1e')](_0xa888('0x50'),_0xa888('0x49'));emit(util['format']('user:%s',_0x466784[_0xa888('0x13')]),_0xa888('0x4a'),{'uri':util[_0xa888('0xb')](_0xa888('0x4b'),_0x48aa5d['remoteUri'],_0x3c1d0f['id'])});}})[_0xa888('0x4c')](function(_0x7ca57d){logger[_0xa888('0x4d')]('[OUTBOUND]',JSON[_0xa888('0x2e')](_0x7ca57d));});};exports[_0xa888('0x54')]=function(_0x2324f6,_0xc022f4,_0x28aadc,_0x17d885,_0x46d5ba,_0x328082){var _0x13a33a,_0x596823;_0x328082[_0xa888('0x19')]=intUtil[_0xa888('0x40')](_0x328082[_0xa888('0x19')]);_0x328082[_0xa888('0x3f')]=intUtil[_0xa888('0x40')](_0x328082[_0xa888('0x3f')]);if(_0x46d5ba&&_0x46d5ba['monitor_format']){logger[_0xa888('0x1e')]('['+_0xc022f4[_0xa888('0x55')][_0xa888('0x56')]()+']',_0xa888('0x51'));_0xc022f4[_0xa888('0x44')]=util[_0xa888('0xb')](_0xa888('0x52'),_0x328082['serverUrl'],_0xc022f4['uniqueid'],md5(_0xc022f4[_0xa888('0x43')]));}else{_0xc022f4['recordingURL']='';}headers[_0xa888('0x45')]=getAuth(_0x328082);return getUser(_0x328082,'')[_0xa888('0x25')](function(_0x16beb7){_0x13a33a=_0x16beb7;logger[_0xa888('0x1e')](_0xa888('0x46'),_0x13a33a['id']);return getEndUser(_0x328082,_0xc022f4[_0xa888('0xc')],_0xc022f4[_0xa888('0xd')]);})[_0xa888('0x25')](function(_0x38d669){_0x596823=_0x38d669;logger[_0xa888('0x1e')](_0xa888('0x47'),_0x596823['id']);return getTicket(_0x328082,_0x13a33a,_0x596823,_0x28aadc,_0xc022f4);})[_0xa888('0x25')](function(_0x163d05){if(_0x163d05){logger['info'](_0xa888('0x1b'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x163d05['id']);}})[_0xa888('0x4c')](function(_0x49de79){logger[_0xa888('0x4d')]('['+_0xc022f4[_0xa888('0x55')]['toUpperCase']()+']',JSON[_0xa888('0x2e')](_0x49de79));});}; \ 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 c54ad5b..e640d2d 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 _0x8ccd=['./util','../../../../config/environment','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','then','length','email','adminId','info','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','&f=','&entities=contact','contacts','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','uniqueid','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','request-promise','md5','moment','bluebird','ioredis'];(function(_0x447aeb,_0x5ef19a){var _0x43d044=function(_0x2c6d58){while(--_0x2c6d58){_0x447aeb['push'](_0x447aeb['shift']());}};_0x43d044(++_0x5ef19a);}(_0x8ccd,0x190));var _0xd8cc=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x8ccd[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var rp=require(_0xd8cc('0x0'));var md5=require(_0xd8cc('0x1'));var util=require('util');var moment=require(_0xd8cc('0x2'));var Promise=require(_0xd8cc('0x3'));var Redis=require(_0xd8cc('0x4'));var intUtil=require(_0xd8cc('0x5'));var config=require(_0xd8cc('0x6'));var logger=require('../../../../config/logger')(_0xd8cc('0x7'));config[_0xd8cc('0x8')]=_[_0xd8cc('0x9')](config[_0xd8cc('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xd8cc('0xa'))(new Redis(config[_0xd8cc('0x8')]));function getAdminId(_0x25ba28,_0x3eb205,_0x5d3a30,_0x2192e1){return new Promise(function(_0x5ea0e1,_0x38ab30){var _0x5671db=![];var _0x36fb06={'method':_0xd8cc('0xb'),'uri':_0x2192e1+_0xd8cc('0xc'),'json':!![]};_0x36fb06[_0xd8cc('0xd')]=_0x5d3a30;logger['info']('Getting\x20admin\x20information');return rp(_0x36fb06)[_0xd8cc('0xe')](function(_0x898884){if(_0x898884){var _0x2ebead=_0x898884['users'];var _0x3b5475=null;for(_0x3b5475=0x0;_0x3b5475<_0x2ebead[_0xd8cc('0xf')];_0x3b5475++){if(_0x2ebead[_0x3b5475][_0xd8cc('0x10')]===_0x25ba28['adminEmail']){_0x25ba28[_0xd8cc('0x11')]=_0x2ebead[_0x3b5475]['id'];_0x5671db=!![];}}if(_0x5671db){logger[_0xd8cc('0x12')]('Admin\x20found:',_0x25ba28['adminId']);_0x5ea0e1(_0x25ba28);}else{_0x38ab30({'statusCode':0x194,'message':_0xd8cc('0x13')});}}else{_0x38ab30({'statusCode':0x194,'message':_0xd8cc('0x13')});}})[_0xd8cc('0x14')](function(_0x145ea7){logger[_0xd8cc('0x15')]('['+[_0x3eb205[_0xd8cc('0x16')]()]+']',_0x145ea7[_0xd8cc('0x17')]);_0x38ab30(_0x145ea7);});});}function getUser(_0xd81622,_0x2073b9,_0x533116){return function(_0x3e8884){return new Promise(function(_0x5ad04b,_0x4870b4){var _0x50fbd1={'method':_0xd8cc('0xb'),'uri':_0x533116+'/api/selector/owners','json':!![]};_0x50fbd1[_0xd8cc('0xd')]=_0x2073b9;logger['info'](_0xd8cc('0x18'));return rp(_0x50fbd1)[_0xd8cc('0xe')](function(_0x294e0e){if(_0x294e0e){var _0x1f0ef5=_0x294e0e[_0xd8cc('0x19')];var _0x7cae=![];var _0x599210=null;if(_0x3e8884[_0xd8cc('0x1a')]!==null){logger['info'](_0xd8cc('0x1b'),_0x3e8884[_0xd8cc('0x1a')]);_0x3e8884[_0xd8cc('0x1c')]=_0x3e8884[_0xd8cc('0x1a')];for(_0x599210=0x0;_0x599210<_0x1f0ef5['length'];_0x599210++){if(_0x1f0ef5[_0x599210]['email']===_0x3e8884['agentEmail']){_0x7cae=!![];_0x3e8884[_0xd8cc('0x1d')]=_0x1f0ef5[_0x599210]['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x1e'),_0x3e8884[_0xd8cc('0x1d')]);}}}if(!_0x7cae){logger['info'](_0xd8cc('0x1f'));_0x3e8884[_0xd8cc('0x1c')]=_0x3e8884[_0xd8cc('0x20')];_0x3e8884['userId']=_0x3e8884['adminId'];_0x7cae=!![];}if(_0x7cae){_0x5ad04b(_0x3e8884);}else{_0x4870b4({'statusCode':0x194,'message':_0xd8cc('0x13')});}}else{_0x4870b4({'statusCode':0x194,'message':_0xd8cc('0x13')});}})['catch'](function(_0x471c06){logger[_0xd8cc('0x15')]('['+[_0xd81622[_0xd8cc('0x16')]()]+']',_0x471c06['message']);_0x4870b4(_0x471c06);});});};}function searchContact(_0x4bdb7b,_0x49014d,_0x3d3758,_0x4566ef){return new Promise(function(_0x1818b8,_0x55d6a2){var _0x40ce2f={'method':'GET','headers':_0x49014d,'uri':_0x4bdb7b+'/api/lookup?q='+_0x4566ef+_0xd8cc('0x21')+_0x3d3758+_0xd8cc('0x22'),'json':!![]};rp(_0x40ce2f)[_0xd8cc('0xe')](function(_0x596b5c){var _0x150047=_['find'](_0x596b5c[_0xd8cc('0x23')][_0xd8cc('0x23')],[_0x3d3758,_0x4566ef]);_0x1818b8(_0x150047);})[_0xd8cc('0x14')](function(_0x12648c){_0x55d6a2(_0x12648c);});});}function getEndUser(_0x27ba16,_0x10108d,_0x26d558){return function(_0x5c62d0){return new Promise(function(_0x5de097,_0x1943e3){logger[_0xd8cc('0x12')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x5c62d0['contactNumber']));searchContact(_0x26d558,_0x10108d,_0xd8cc('0x24'),_0x5c62d0['contactNumber'])['then'](function(_0x39a34a){if(_0x39a34a){_0x5c62d0[_0xd8cc('0x25')]=_0x39a34a['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x26'),_0x5c62d0['endUserId']);return _0x5de097(_0x5c62d0);}searchContact(_0x26d558,_0x10108d,_0xd8cc('0x27'),_0x5c62d0[_0xd8cc('0x28')])['then'](function(_0x25f694){if(_0x25f694){_0x5c62d0['endUserId']=_0x25f694['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x29'),_0x5c62d0[_0xd8cc('0x25')]);return _0x5de097(_0x5c62d0);}createEndUser(_0x5c62d0,_0x27ba16,_0x10108d,_0x26d558)['then'](function(_0xc4af3c){logger[_0xd8cc('0x12')](_0xd8cc('0x2a'),_0xc4af3c['endUserId']);return _0x5de097(_0xc4af3c);});});})[_0xd8cc('0x14')](function(_0x1281ca){_0x1943e3(_0x1281ca);});});};}function createEndUser(_0x3275b8,_0x23282b,_0x8938e5,_0x20c623){return new Promise(function(_0x33c525,_0x140bf0){var _0x1c3f00=moment();var _0x2465b1={'method':_0xd8cc('0x2b'),'uri':_0x20c623+_0xd8cc('0x2c'),'body':{'contact':{'last_name':_0x3275b8[_0xd8cc('0x28')],'work_number':_0x3275b8[_0xd8cc('0x28')],'mobile_number':_0x3275b8['contactNumber'],'owner_id':_0x3275b8[_0xd8cc('0x1d')],'created_at':_0x1c3f00[_0xd8cc('0x2d')](_0xd8cc('0x2e'))}},'json':!![]};_0x2465b1[_0xd8cc('0xd')]=_0x8938e5;logger[_0xd8cc('0x12')](_0xd8cc('0x2f'));return rp(_0x2465b1)['then'](function(_0x4234d9){_0x3275b8[_0xd8cc('0x25')]=_0x4234d9[_0xd8cc('0x30')]['id'];_0x33c525(_0x3275b8);})[_0xd8cc('0x14')](function(_0x16bbd6){logger[_0xd8cc('0x15')]('['+[_0x23282b[_0xd8cc('0x16')]()]+']',_0x16bbd6[_0xd8cc('0x17')]);_0x140bf0(_0x16bbd6[_0xd8cc('0x17')]);});});}function getTicket(_0x4893d4,_0x31d73f,_0x20b7c0,_0x332b24,_0x12a338){return function(_0x263cf5){logger[_0xd8cc('0x12')](_0xd8cc('0x31'));return new Promise(function(_0x2bca5a,_0x5d4b21){var _0x4a7d76=moment();var _0x1a88e4={'method':_0xd8cc('0x2b'),'uri':_0x20b7c0+_0xd8cc('0x32'),'body':{'title':intUtil[_0xd8cc('0x33')](_0x332b24[_0xd8cc('0x34')],_0x12a338,'\x20'),'description':intUtil[_0xd8cc('0x33')](_0x332b24[_0xd8cc('0x35')],_0x12a338,'\x0a'),'owner_id':_0x263cf5[_0xd8cc('0x1d')],'creater_id':_0x263cf5[_0xd8cc('0x11')],'targetable_id':_0x263cf5['endUserId'],'targetable_type':_0xd8cc('0x36'),'created_at':_0x4a7d76[_0xd8cc('0x2d')](_0xd8cc('0x2e')),'due_date':_0x4a7d76[_0xd8cc('0x37')](0x1e,'m')[_0xd8cc('0x2d')](_0xd8cc('0x2e'))},'json':!![]};_0x1a88e4[_0xd8cc('0xd')]=_0x31d73f;return rp(_0x1a88e4)[_0xd8cc('0xe')](function(_0xea3e21){_0x263cf5[_0xd8cc('0x38')]=_0xea3e21[_0xd8cc('0x39')]['id'];logger[_0xd8cc('0x12')](_0xd8cc('0x3a'),_0x263cf5['ticketId']);_0x2bca5a(_0x263cf5);})[_0xd8cc('0x14')](function(_0x3f14b7){logger[_0xd8cc('0x15')]('['+[_0x4893d4[_0xd8cc('0x16')]()]+']',_0x3f14b7[_0xd8cc('0x17')]);_0x5d4b21(_0x3f14b7['message']);});});};}function emit(_0x1185a9,_0x474428,_0x4e716f){var _0x4f0c5b={'uri':_0x1185a9+'/contacts/'+_0x4e716f};io['to'](util[_0xd8cc('0x2d')](_0xd8cc('0x3b'),_0x474428))['emit'](_0xd8cc('0x3c'),_0x4f0c5b);}exports['cs']=function(_0x28d355,_0x5ef1f0,_0xa2bff6,_0x534e28,_0x102f5e,_0x5a78e9,_0x1f9ac5,_0x345031){var _0x381cef={};var _0xbcbb75={'Authorization':_0xd8cc('0x3d')+_0x5a78e9[_0xd8cc('0x3e')]};_0x5a78e9[_0xd8cc('0x3f')]=intUtil[_0xd8cc('0x40')](_0x5a78e9[_0xd8cc('0x3f')]);_0x5a78e9['serverUrl']=intUtil[_0xd8cc('0x40')](_0x5a78e9[_0xd8cc('0x41')]);var _0x1bf860=_0x5a78e9[_0xd8cc('0x3f')];_0x381cef[_0xd8cc('0x20')]=_0x5a78e9[_0xd8cc('0x42')];_0x381cef['contactNumber']=_0x345031[_0xd8cc('0x43')]()===_0xd8cc('0x44')?_0x5ef1f0[_0xd8cc('0x45')]:_0x5ef1f0['calleridnum'];_0x381cef[_0xd8cc('0x46')]=_0x345031===_0xd8cc('0x47')||_0x345031==='unmanaged'?_0xd8cc('0x47'):_0xd8cc('0x44');if(_0x534e28){_0x381cef['agentEmail']=_0x534e28[_0xd8cc('0x10')];}var _0x69c5b3=util[_0xd8cc('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a78e9[_0xd8cc('0x41')],_0x5ef1f0[_0xd8cc('0x48')],md5(_0x5ef1f0[_0xd8cc('0x48')]));if(_0x102f5e&&_0x102f5e['monitor_format']){logger[_0xd8cc('0x12')]('[QUEUE]',_0xd8cc('0x49'));_0x5ef1f0[_0xd8cc('0x4a')]=_0x69c5b3;}else if(_0x1f9ac5&&_0x1f9ac5['recordingFormat']&&_0x1f9ac5['recordingFormat']!==_0xd8cc('0x4b')){logger[_0xd8cc('0x12')](_0xd8cc('0x4c'),_0xd8cc('0x49'));_0x5ef1f0['recordingURL']=_0x69c5b3;}else{_0x5ef1f0['recordingURL']='';}return getAdminId(_0x381cef,_0x345031,_0xbcbb75,_0x1bf860)[_0xd8cc('0xe')](getUser(_0x345031,_0xbcbb75,_0x1bf860))['then'](getEndUser(_0x345031,_0xbcbb75,_0x1bf860))[_0xd8cc('0xe')](getTicket(_0x345031,_0xbcbb75,_0x1bf860,_0xa2bff6,_0x5ef1f0))[_0xd8cc('0xe')](function(_0x4a7a4a){logger[_0xd8cc('0x12')](util['format'](_0xd8cc('0x4d'),_0x4a7a4a[_0xd8cc('0x38')]));if(_0x345031!==_0xd8cc('0x4e')){logger[_0xd8cc('0x12')]('['+[_0x345031[_0xd8cc('0x16')]()]+']',_0xd8cc('0x4f'));emit(_0x1bf860,_0x534e28[_0xd8cc('0x50')],_0x4a7a4a[_0xd8cc('0x25')]);}})['catch'](function(_0x3a53c4){logger['error']('['+[_0x345031[_0xd8cc('0x16')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x3a53c4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6cb2=['POST','/api/contacts','contact','message','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','YYYY-MM-DDTHH:mm:ss','ticketId','task','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','calleridnum','queue','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','then','users','length','email','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','adminEmail','&f=','&entities=contact','find','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:'];(function(_0x49e379,_0x1b4c34){var _0x4d17e5=function(_0x24578e){while(--_0x24578e){_0x49e379['push'](_0x49e379['shift']());}};_0x4d17e5(++_0x1b4c34);}(_0x6cb2,0x19c));var _0x26cb=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x6cb2[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x26cb('0x0'));var rp=require(_0x26cb('0x1'));var md5=require(_0x26cb('0x2'));var util=require('util');var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x26cb('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x26cb('0x4'))('freshsales');config[_0x26cb('0x5')]=_['defaults'](config[_0x26cb('0x5')],{'host':_0x26cb('0x6'),'port':0x18eb});var io=require(_0x26cb('0x7'))(new Redis(config[_0x26cb('0x5')]));function getAdminId(_0x4a1093,_0x4fddcc,_0x2ef9c4,_0x11393a){return new Promise(function(_0x3d3f0f,_0x4d5971){var _0x42520e=![];var _0x429ac0={'method':_0x26cb('0x8'),'uri':_0x11393a+_0x26cb('0x9'),'json':!![]};_0x429ac0[_0x26cb('0xa')]=_0x2ef9c4;logger[_0x26cb('0xb')]('Getting\x20admin\x20information');return rp(_0x429ac0)[_0x26cb('0xc')](function(_0x5dbf89){if(_0x5dbf89){var _0x58e5e3=_0x5dbf89[_0x26cb('0xd')];var _0x23ae8b=null;for(_0x23ae8b=0x0;_0x23ae8b<_0x58e5e3[_0x26cb('0xe')];_0x23ae8b++){if(_0x58e5e3[_0x23ae8b][_0x26cb('0xf')]===_0x4a1093['adminEmail']){_0x4a1093[_0x26cb('0x10')]=_0x58e5e3[_0x23ae8b]['id'];_0x42520e=!![];}}if(_0x42520e){logger[_0x26cb('0xb')]('Admin\x20found:',_0x4a1093['adminId']);_0x3d3f0f(_0x4a1093);}else{_0x4d5971({'statusCode':0x194,'message':_0x26cb('0x11')});}}else{_0x4d5971({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x26cb('0x12')](function(_0x341acd){logger[_0x26cb('0x13')]('['+[_0x4fddcc[_0x26cb('0x14')]()]+']',_0x341acd['message']);_0x4d5971(_0x341acd);});});}function getUser(_0x29a731,_0x1a4cde,_0x2c665d){return function(_0x4d4431){return new Promise(function(_0x2e125a,_0x3b633b){var _0x52439c={'method':_0x26cb('0x8'),'uri':_0x2c665d+_0x26cb('0x9'),'json':!![]};_0x52439c[_0x26cb('0xa')]=_0x1a4cde;logger[_0x26cb('0xb')]('Getting\x20user\x20list');return rp(_0x52439c)[_0x26cb('0xc')](function(_0x8de731){if(_0x8de731){var _0x4b193e=_0x8de731[_0x26cb('0xd')];var _0x3fe21d=![];var _0x1de755=null;if(_0x4d4431[_0x26cb('0x15')]!==null){logger[_0x26cb('0xb')]('Getting\x20user\x20with\x20email',_0x4d4431[_0x26cb('0x15')]);_0x4d4431[_0x26cb('0x16')]=_0x4d4431['agentEmail'];for(_0x1de755=0x0;_0x1de755<_0x4b193e['length'];_0x1de755++){if(_0x4b193e[_0x1de755][_0x26cb('0xf')]===_0x4d4431['agentEmail']){_0x3fe21d=!![];_0x4d4431[_0x26cb('0x17')]=_0x4b193e[_0x1de755]['id'];logger[_0x26cb('0xb')](_0x26cb('0x18'),_0x4d4431[_0x26cb('0x17')]);}}}if(!_0x3fe21d){logger[_0x26cb('0xb')](_0x26cb('0x19'));_0x4d4431[_0x26cb('0x16')]=_0x4d4431[_0x26cb('0x1a')];_0x4d4431[_0x26cb('0x17')]=_0x4d4431[_0x26cb('0x10')];_0x3fe21d=!![];}if(_0x3fe21d){_0x2e125a(_0x4d4431);}else{_0x3b633b({'statusCode':0x194,'message':_0x26cb('0x11')});}}else{_0x3b633b({'statusCode':0x194,'message':_0x26cb('0x11')});}})[_0x26cb('0x12')](function(_0x1e5a5e){logger[_0x26cb('0x13')]('['+[_0x29a731[_0x26cb('0x14')]()]+']',_0x1e5a5e['message']);_0x3b633b(_0x1e5a5e);});});};}function searchContact(_0x57a557,_0x17a936,_0x4fff9d,_0x4612b2){return new Promise(function(_0x513d08,_0x3189e4){var _0x1a9435={'method':_0x26cb('0x8'),'headers':_0x17a936,'uri':_0x57a557+'/api/lookup?q='+_0x4612b2+_0x26cb('0x1b')+_0x4fff9d+_0x26cb('0x1c'),'json':!![]};rp(_0x1a9435)[_0x26cb('0xc')](function(_0x3f7fe1){var _0x39e818=_[_0x26cb('0x1d')](_0x3f7fe1['contacts']['contacts'],[_0x4fff9d,_0x4612b2]);_0x513d08(_0x39e818);})[_0x26cb('0x12')](function(_0x1df1e6){_0x3189e4(_0x1df1e6);});});}function getEndUser(_0x1b08eb,_0x2702d1,_0x5ee9ab){return function(_0x3cd8b4){return new Promise(function(_0x463307,_0x4b5fa4){logger[_0x26cb('0xb')](util[_0x26cb('0x1e')](_0x26cb('0x1f'),_0x3cd8b4[_0x26cb('0x20')]));searchContact(_0x5ee9ab,_0x2702d1,_0x26cb('0x21'),_0x3cd8b4[_0x26cb('0x20')])[_0x26cb('0xc')](function(_0x45e606){if(_0x45e606){_0x3cd8b4['endUserId']=_0x45e606['id'];logger[_0x26cb('0xb')](_0x26cb('0x22'),_0x3cd8b4[_0x26cb('0x23')]);return _0x463307(_0x3cd8b4);}searchContact(_0x5ee9ab,_0x2702d1,_0x26cb('0x24'),_0x3cd8b4[_0x26cb('0x20')])[_0x26cb('0xc')](function(_0x38857e){if(_0x38857e){_0x3cd8b4[_0x26cb('0x23')]=_0x38857e['id'];logger[_0x26cb('0xb')](_0x26cb('0x25'),_0x3cd8b4[_0x26cb('0x23')]);return _0x463307(_0x3cd8b4);}createEndUser(_0x3cd8b4,_0x1b08eb,_0x2702d1,_0x5ee9ab)[_0x26cb('0xc')](function(_0x9e185b){logger[_0x26cb('0xb')]('Contact\x20created:',_0x9e185b['endUserId']);return _0x463307(_0x9e185b);});});})[_0x26cb('0x12')](function(_0x420910){_0x4b5fa4(_0x420910);});});};}function createEndUser(_0x2d2752,_0x2f9642,_0xe8a36d,_0x557d2b){return new Promise(function(_0x1174fc,_0x59e5b6){var _0x1dd2cf=moment();var _0x40b46e={'method':_0x26cb('0x26'),'uri':_0x557d2b+_0x26cb('0x27'),'body':{'contact':{'last_name':_0x2d2752[_0x26cb('0x20')],'work_number':_0x2d2752['contactNumber'],'mobile_number':_0x2d2752[_0x26cb('0x20')],'owner_id':_0x2d2752['userId'],'created_at':_0x1dd2cf[_0x26cb('0x1e')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x40b46e[_0x26cb('0xa')]=_0xe8a36d;logger[_0x26cb('0xb')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x40b46e)['then'](function(_0x2ee42a){_0x2d2752[_0x26cb('0x23')]=_0x2ee42a[_0x26cb('0x28')]['id'];_0x1174fc(_0x2d2752);})[_0x26cb('0x12')](function(_0x27f9fa){logger[_0x26cb('0x13')]('['+[_0x2f9642[_0x26cb('0x14')]()]+']',_0x27f9fa[_0x26cb('0x29')]);_0x59e5b6(_0x27f9fa[_0x26cb('0x29')]);});});}function getTicket(_0x2dfe6d,_0x3b1d5b,_0x21033e,_0x39a86d,_0x3e3451){return function(_0x8f11c2){logger[_0x26cb('0xb')](_0x26cb('0x2a'));return new Promise(function(_0x401e04,_0x38b5bb){var _0x1e1f55=moment();var _0x3fd591={'method':_0x26cb('0x26'),'uri':_0x21033e+_0x26cb('0x2b'),'body':{'title':intUtil[_0x26cb('0x2c')](_0x39a86d[_0x26cb('0x2d')],_0x3e3451,'\x20'),'description':intUtil[_0x26cb('0x2c')](_0x39a86d[_0x26cb('0x2e')],_0x3e3451,'\x0a'),'owner_id':_0x8f11c2[_0x26cb('0x17')],'creater_id':_0x8f11c2[_0x26cb('0x10')],'targetable_id':_0x8f11c2[_0x26cb('0x23')],'targetable_type':'Contact','created_at':_0x1e1f55[_0x26cb('0x1e')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x1e1f55[_0x26cb('0x2f')](0x1e,'m')[_0x26cb('0x1e')](_0x26cb('0x30'))},'json':!![]};_0x3fd591[_0x26cb('0xa')]=_0x3b1d5b;return rp(_0x3fd591)[_0x26cb('0xc')](function(_0x1efba9){_0x8f11c2[_0x26cb('0x31')]=_0x1efba9[_0x26cb('0x32')]['id'];logger[_0x26cb('0xb')]('Task\x20created:',_0x8f11c2[_0x26cb('0x31')]);_0x401e04(_0x8f11c2);})[_0x26cb('0x12')](function(_0x476931){logger['error']('['+[_0x2dfe6d[_0x26cb('0x14')]()]+']',_0x476931[_0x26cb('0x29')]);_0x38b5bb(_0x476931[_0x26cb('0x29')]);});});};}function emit(_0x26e736,_0x205aaf,_0x1330dd){var _0x27a2a5={'uri':_0x26e736+'/contacts/'+_0x1330dd};io['to'](util[_0x26cb('0x1e')](_0x26cb('0x33'),_0x205aaf))[_0x26cb('0x34')](_0x26cb('0x35'),_0x27a2a5);}exports['cs']=function(_0x48ced7,_0x306d60,_0x11e542,_0x34f393,_0x22e0c2,_0x5a608f,_0x5881f4,_0x1f6b25){var _0x54da2c={};var _0x73349a={'Authorization':_0x26cb('0x36')+_0x5a608f[_0x26cb('0x37')]};_0x5a608f[_0x26cb('0x38')]=intUtil['stripTrailingSlash'](_0x5a608f[_0x26cb('0x38')]);_0x5a608f[_0x26cb('0x39')]=intUtil[_0x26cb('0x3a')](_0x5a608f['serverUrl']);var _0x44c1d3=_0x5a608f[_0x26cb('0x38')];_0x54da2c[_0x26cb('0x1a')]=_0x5a608f[_0x26cb('0x3b')];_0x54da2c[_0x26cb('0x20')]=_0x1f6b25[_0x26cb('0x3c')]()===_0x26cb('0x3d')?_0x306d60['destcalleridnum']:_0x306d60[_0x26cb('0x3e')];_0x54da2c['callDirection']=_0x1f6b25==='queue'||_0x1f6b25==='unmanaged'?_0x26cb('0x3f'):_0x26cb('0x3d');if(_0x34f393){_0x54da2c['agentEmail']=_0x34f393['email'];}var _0x294083=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a608f['serverUrl'],_0x306d60['uniqueid'],md5(_0x306d60[_0x26cb('0x40')]));if(_0x22e0c2&&_0x22e0c2[_0x26cb('0x41')]){logger[_0x26cb('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x306d60[_0x26cb('0x42')]=_0x294083;}else if(_0x5881f4&&_0x5881f4[_0x26cb('0x43')]&&_0x5881f4[_0x26cb('0x43')]!=='none'){logger['info'](_0x26cb('0x44'),_0x26cb('0x45'));_0x306d60[_0x26cb('0x42')]=_0x294083;}else{_0x306d60[_0x26cb('0x42')]='';}return getAdminId(_0x54da2c,_0x1f6b25,_0x73349a,_0x44c1d3)['then'](getUser(_0x1f6b25,_0x73349a,_0x44c1d3))[_0x26cb('0xc')](getEndUser(_0x1f6b25,_0x73349a,_0x44c1d3))[_0x26cb('0xc')](getTicket(_0x1f6b25,_0x73349a,_0x44c1d3,_0x11e542,_0x306d60))[_0x26cb('0xc')](function(_0x2392ec){logger['info'](util[_0x26cb('0x1e')](_0x26cb('0x46'),_0x2392ec['ticketId']));if(_0x1f6b25!==_0x26cb('0x47')){logger[_0x26cb('0xb')]('['+[_0x1f6b25[_0x26cb('0x14')]()]+']',_0x26cb('0x48'));emit(_0x44c1d3,_0x34f393[_0x26cb('0x49')],_0x2392ec['endUserId']);}})[_0x26cb('0x12')](function(_0x43c251){logger['error']('['+[_0x1f6b25[_0x26cb('0x14')]()]+_0x26cb('0x4a'),util['inspect'](_0x43c251,{'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 a382930..73227dd 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 _0x0f6a=['../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','toLowerCase','util','./zendesk','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','exec','includes','data1','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','log','unknown\x20integration'];(function(_0x2c7f4a,_0x393803){var _0x47c318=function(_0x55af07){while(--_0x55af07){_0x2c7f4a['push'](_0x2c7f4a['shift']());}};_0x47c318(++_0x393803);}(_0x0f6a,0x1b6));var _0xa0f6=function(_0x14c34e,_0x10d2dc){_0x14c34e=_0x14c34e-0x0;var _0x536c95=_0x0f6a[_0x14c34e];return _0x536c95;};'use strict';var _=require('lodash');var util=require(_0xa0f6('0x0'));var zendesk=require(_0xa0f6('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa0f6('0x2'));var zoho=require(_0xa0f6('0x3'));var desk=require(_0xa0f6('0x4'));var vtiger=require(_0xa0f6('0x5'));var servicenow=require(_0xa0f6('0x6'));var dynamics365=require(_0xa0f6('0x7'));var freshsales=require(_0xa0f6('0x8'));var integrations=[_0xa0f6('0x9'),_0xa0f6('0xa'),_0xa0f6('0xb'),_0xa0f6('0xc'),'zoho',_0xa0f6('0xd'),_0xa0f6('0xe'),_0xa0f6('0xf'),_0xa0f6('0x10'),'servicenow'];exports[_0xa0f6('0x11')]=function(_0x309405,_0x56862a,_0x2a6f4c,_0x1ae5a1,_0x3aed04,_0x3f45c2){if(_0x2a6f4c){if(_[_0xa0f6('0x12')](integrations,_0x309405[_0xa0f6('0x13')]['toLowerCase']())){try{var _0xf14274=null;var _0xb421f3='';var _0x12bbfe=_0x2a6f4c[_0x309405['data1']['toLowerCase']()];if(_0x12bbfe){var _0x1c17ac=_0x12bbfe[_0x309405[_0xa0f6('0x14')]];if(_0x1c17ac){var _0x2c620b=_[_0xa0f6('0x15')](_0x1c17ac[_0xa0f6('0x16')],{'id':parseInt(_0x309405[_0xa0f6('0x17')],0xa)});if(_0x2c620b){if(_0x1ae5a1){if(_0x3aed04&&_0x56862a[_0xa0f6('0x18')]){_0xb421f3=_0xa0f6('0x18');}else if(_0x56862a[_0xa0f6('0x19')]){_0xb421f3=_0xa0f6('0x1a');}else{console['log'](_0xa0f6('0x1b'),_0x56862a);}}else{_0xb421f3='unmanaged';}switch(_0x309405[_0xa0f6('0x13')]['toLowerCase']()){case _0xa0f6('0x9'):zendesk[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case'salesforce':salesforce[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xb'):sugarcrm[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xc'):freshdesk[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case'zoho':zoho[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xd'):desk[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0xe'):vtiger[_0xb421f3](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2);break;case _0xa0f6('0x10'):freshsales['cs'](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2,_0xb421f3);break;case'servicenow':servicenow['cs'](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2,_0xb421f3);break;case _0xa0f6('0xf'):dynamics365['cs'](_0x309405,_0x56862a,_0x2c620b,_0x1ae5a1,_0x3aed04,_0x1c17ac,_0x3f45c2,_0xb421f3);break;default:console[_0xa0f6('0x1c')](_0xa0f6('0x1d'));}}else{_0xf14274=require(_0xa0f6('0x1e'))(_0x309405[_0xa0f6('0x13')]['toLowerCase']());_0xf14274[_0xa0f6('0x1f')](_0xa0f6('0x20'),util[_0xa0f6('0x21')](_0xa0f6('0x22'),_0x309405[_0xa0f6('0x13')][_0xa0f6('0x23')](),_0x309405[_0xa0f6('0x17')]));}}else{_0xf14274=require(_0xa0f6('0x1e'))(_0x309405[_0xa0f6('0x13')][_0xa0f6('0x23')]());_0xf14274[_0xa0f6('0x1f')]('[EXEC]',util[_0xa0f6('0x21')]('%s\x20account\x20#%s\x20not\x20found',_0x309405[_0xa0f6('0x13')][_0xa0f6('0x23')](),_0x309405[_0xa0f6('0x14')]));}}else{}}catch(_0x26f398){console['error'](_0x26f398);}}}}; \ No newline at end of file +var _0x5620=['util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','find','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','freshsales','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash'];(function(_0x2acd35,_0x2b21df){var _0x272693=function(_0x118994){while(--_0x118994){_0x2acd35['push'](_0x2acd35['shift']());}};_0x272693(++_0x2b21df);}(_0x5620,0xe9));var _0x0562=function(_0xf738ad,_0x5e1d7f){_0xf738ad=_0xf738ad-0x0;var _0x598570=_0x5620[_0xf738ad];return _0x598570;};'use strict';var _=require(_0x0562('0x0'));var util=require(_0x0562('0x1'));var zendesk=require(_0x0562('0x2'));var salesforce=require(_0x0562('0x3'));var sugarcrm=require(_0x0562('0x4'));var freshdesk=require(_0x0562('0x5'));var zoho=require(_0x0562('0x6'));var desk=require(_0x0562('0x7'));var vtiger=require(_0x0562('0x8'));var servicenow=require(_0x0562('0x9'));var dynamics365=require(_0x0562('0xa'));var freshsales=require(_0x0562('0xb'));var integrations=[_0x0562('0xc'),_0x0562('0xd'),_0x0562('0xe'),'freshdesk',_0x0562('0xf'),_0x0562('0x10'),_0x0562('0x11'),_0x0562('0x12'),'freshsales',_0x0562('0x13')];exports[_0x0562('0x14')]=function(_0x30f58c,_0x314bcc,_0x14119c,_0x562aed,_0x1fcb59,_0x2c71ca){if(_0x14119c){if(_[_0x0562('0x15')](integrations,_0x30f58c[_0x0562('0x16')][_0x0562('0x17')]())){try{var _0x38c954=null;var _0x4f7b6c='';var _0x539a1b=_0x14119c[_0x30f58c[_0x0562('0x16')][_0x0562('0x17')]()];if(_0x539a1b){var _0x18bad2=_0x539a1b[_0x30f58c['data2']];if(_0x18bad2){var _0x4b5879=_[_0x0562('0x18')](_0x18bad2['Configurations'],{'id':parseInt(_0x30f58c['data3'],0xa)});if(_0x4b5879){if(_0x562aed){if(_0x1fcb59&&_0x314bcc[_0x0562('0x19')]){_0x4f7b6c=_0x0562('0x19');}else if(_0x314bcc[_0x0562('0x1a')]){_0x4f7b6c='outbound';}else{console[_0x0562('0x1b')](_0x0562('0x1c'),_0x314bcc);}}else{_0x4f7b6c=_0x0562('0x1d');}switch(_0x30f58c[_0x0562('0x16')][_0x0562('0x17')]()){case _0x0562('0xc'):zendesk[_0x4f7b6c](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca);break;case _0x0562('0xd'):salesforce[_0x4f7b6c](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca);break;case'sugarcrm':sugarcrm[_0x4f7b6c](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca);break;case _0x0562('0x1e'):freshdesk[_0x4f7b6c](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca);break;case'zoho':zoho[_0x4f7b6c](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca);break;case _0x0562('0x10'):desk[_0x4f7b6c](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca);break;case _0x0562('0x11'):vtiger[_0x4f7b6c](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca);break;case _0x0562('0x1f'):freshsales['cs'](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca,_0x4f7b6c);break;case _0x0562('0x13'):servicenow['cs'](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca,_0x4f7b6c);break;case _0x0562('0x12'):dynamics365['cs'](_0x30f58c,_0x314bcc,_0x4b5879,_0x562aed,_0x1fcb59,_0x18bad2,_0x2c71ca,_0x4f7b6c);break;default:console[_0x0562('0x1b')]('unknown\x20integration');}}else{_0x38c954=require(_0x0562('0x20'))(_0x30f58c['data1'][_0x0562('0x17')]());_0x38c954[_0x0562('0x21')](_0x0562('0x22'),util[_0x0562('0x23')](_0x0562('0x24'),_0x30f58c['data1']['toLowerCase'](),_0x30f58c[_0x0562('0x25')]));}}else{_0x38c954=require(_0x0562('0x20'))(_0x30f58c[_0x0562('0x16')][_0x0562('0x17')]());_0x38c954[_0x0562('0x21')]('[EXEC]',util['format'](_0x0562('0x26'),_0x30f58c[_0x0562('0x16')]['toLowerCase'](),_0x30f58c['data2']));}}else{}}catch(_0x345086){console[_0x0562('0x21')](_0x345086);}}}}; \ 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 2b4e2b5..7dd0fd1 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 _0xa63a=['upperFirst','forEach','includes','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','[QUEUE]','recordingFormat','none','[OUTBOUND]','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','./util','../../../../config/environment','redis','defaults','emit','assign','Subjects','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','Case','contact','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','find','execute','then','Email','info','Agent\x20%s\x20found.','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','Company','No\x20Company','format'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa63a,0xb9));var _0xaa63=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0xa63a[_0x40b2ed];return _0x18397d;};'use strict';var _=require(_0xaa63('0x0'));var rp=require(_0xaa63('0x1'));var moment=require(_0xaa63('0x2'));var BPromise=require(_0xaa63('0x3'));var md5=require('md5');var jsforce=require(_0xaa63('0x4'));var util=require(_0xaa63('0x5'));var Redis=require(_0xaa63('0x6'));var intUtil=require(_0xaa63('0x7'));var config=require(_0xaa63('0x8'));var logger=require('../../../../config/logger')('salesforce');config[_0xaa63('0x9')]=_[_0xaa63('0xa')](config[_0xaa63('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2fa089,_0x40415c,_0x448632){io['to'](_0x2fa089)[_0xaa63('0xb')](_0x40415c,_0x448632);}function getTicket(_0x25c6dd,_0xa3d59a,_0x303372,_0x30fce0,_0x7559d0,_0x46e427,_0x1a1f8c,_0x29b370){var _0x18b42b=Object[_0xaa63('0xc')]({},{'OwnerId':_0xa3d59a['id'],'Subject':intUtil['getString'](_0x30fce0[_0xaa63('0xd')],_0x7559d0,'\x20'),'Description':intUtil['getString'](_0x30fce0[_0xaa63('0xe')],_0x7559d0,'\x0a')},getCustomFields(_0x46e427,_0x7559d0));if(_0x303372){if(_0x30fce0[_0xaa63('0xf')]===_0xaa63('0x10')){_0x18b42b[_0xaa63('0x11')]=moment['utc']();_0x18b42b[_0xaa63('0x12')]=![];_0x18b42b[_0xaa63('0x13')]=![];if(_0x303372[_0xaa63('0x14')]==='contact'||_0x303372[_0xaa63('0x14')]===_0xaa63('0x15')){_0x18b42b[_0xaa63('0x16')]=_0x303372['id'];}else if(_0x303372['endUserType']===_0xaa63('0x17')){_0x18b42b[_0xaa63('0x18')]=_0x303372['id'];}}else if(_0x30fce0[_0xaa63('0xf')]===_0xaa63('0x19')){if(_0x303372[_0xaa63('0x14')]===_0xaa63('0x1a')){_0x18b42b['ContactId']=_0x303372['id'];}else if(_0x303372[_0xaa63('0x14')]===_0xaa63('0x17')){_0x18b42b[_0xaa63('0x1b')]=_0x303372['id'];}else if(_0x303372['endUserType']==='lead'&&_0x30fce0[_0xaa63('0x1c')]){_0x18b42b[_0x30fce0['leadId']]=_0x303372['id'];}else{logger['info'](_0xaa63('0x1d'));}}}return _0x1a1f8c['sobject'](_0x30fce0[_0xaa63('0xf')])[_0xaa63('0x1e')](_0x18b42b);}function getUser(_0x305c73,_0x5bddb8,_0x10f0d9){if(!_[_0xaa63('0x1f')](_0x5bddb8)&&intUtil[_0xaa63('0x20')](_0x5bddb8)){var _0x299537={'Email':_0x5bddb8};var _0x41c132={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x10f0d9[_0xaa63('0x21')]('User')[_0xaa63('0x22')](_0x299537,_0x41c132)[_0xaa63('0x23')]()[_0xaa63('0x24')](function(_0x1661f2){if(_0x1661f2['length']){var _0x3d3234=_['find'](_0x1661f2,function(_0x5554bd){return _0x5554bd[_0xaa63('0x25')]===_0x5bddb8;});if(_0x3d3234){logger[_0xaa63('0x26')](_0xaa63('0x27'),_0x5bddb8);return BPromise['resolve']({'id':_0x3d3234['Id'],'name':_0x3d3234['Name']});}}else{logger[_0xaa63('0x26')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5bddb8);return _0x10f0d9[_0xaa63('0x28')]()[_0xaa63('0x24')](function(_0x3f12f0){return BPromise['resolve']({'id':_0x3f12f0[_0xaa63('0x29')],'name':_0x3f12f0[_0xaa63('0x2a')]});});}});}else{logger[_0xaa63('0x26')](_0xaa63('0x2b'),_0x5bddb8);return _0x10f0d9['identity']()[_0xaa63('0x24')](function(_0x4cba16){return BPromise[_0xaa63('0x2c')]({'id':_0x4cba16[_0xaa63('0x29')],'name':_0x4cba16['display_name']});});}}function getEndUser(_0x3d5e39,_0x105bf3,_0x377de8,_0x5f0c1f,_0x5f335c){var _0x1eee92={'$or':{'Phone':_0x5f0c1f}};var _0x1ea35b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xaa63('0x2c')]()[_0xaa63('0x24')](function(){logger['info'](_0xaa63('0x2d'),_0x5f0c1f,_0x105bf3['moduleSearch']);switch(_0x105bf3[_0xaa63('0x2e')]){case _0xaa63('0x2f'):var _0x34e62a=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x31')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x31')]]=_0x5f0c1f;_[_0xaa63('0x32')](_0x34e62a[_0xaa63('0x33')],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x34'))[_0xaa63('0x22')](_0x34e62a,_0x1ea35b)['execute']()[_0xaa63('0x24')](function(_0x2254a9){if(_0x2254a9&&_0x2254a9[_0xaa63('0x35')]){return _0x2254a9;}else{var _0x1134ad=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x36')]){var _0x26a737={};_0x26a737[_0x105bf3['additionalSearchLead']]=_0x5f0c1f;_['merge'](_0x1134ad['$or'],_0x26a737);}return _0x5f335c['sobject'](_0xaa63('0x37'))[_0xaa63('0x22')](_0x1134ad,_0x1ea35b);}});case _0xaa63('0x38'):var _0x57f033=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x39')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x39')]]=_0x5f0c1f;_[_0xaa63('0x32')](_0x57f033['$or'],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')]('Account')[_0xaa63('0x22')](_0x57f033,_0x1ea35b)[_0xaa63('0x23')]()[_0xaa63('0x24')](function(_0x1ae47a){if(_0x1ae47a&&_0x1ae47a[_0xaa63('0x35')]){return _0x1ae47a;}else{var _0x47d98c=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3['additionalSearchContact']){var _0x17ee34={};_0x17ee34[_0x105bf3[_0xaa63('0x31')]]=_0x5f0c1f;_['merge'](_0x47d98c[_0xaa63('0x33')],_0x17ee34);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x34'))[_0xaa63('0x22')](_0x47d98c,_0x1ea35b)[_0xaa63('0x24')](function(_0x1196cb){if(_0x1196cb&&_0x1196cb['length']){return _0x1196cb;}else{var _0xbd6ae=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x36')]){var _0x572867={};_0x572867[_0x105bf3['additionalSearchLead']]=_0x5f0c1f;_[_0xaa63('0x32')](_0xbd6ae[_0xaa63('0x33')],_0x572867);}return _0x5f335c[_0xaa63('0x21')]('Lead')[_0xaa63('0x22')](_0xbd6ae,_0x1ea35b);}});}});case'contact':var _0x34e62a=_['cloneDeep'](_0x1eee92);if(_0x105bf3[_0xaa63('0x31')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x31')]]=_0x5f0c1f;_['merge'](_0x34e62a[_0xaa63('0x33')],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x34'))['find'](_0x34e62a,_0x1ea35b)[_0xaa63('0x23')]();case _0xaa63('0x15'):var _0xf0a1c6=_['cloneDeep'](_0x1eee92);if(_0x105bf3[_0xaa63('0x36')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x36')]]=_0x5f0c1f;_[_0xaa63('0x32')](_0xf0a1c6[_0xaa63('0x33')],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')]('Lead')[_0xaa63('0x22')](_0xf0a1c6,_0x1ea35b);case _0xaa63('0x17'):var _0x57f033=_[_0xaa63('0x30')](_0x1eee92);if(_0x105bf3[_0xaa63('0x39')]){var _0x1d69e1={};_0x1d69e1[_0x105bf3[_0xaa63('0x39')]]=_0x5f0c1f;_['merge'](_0x57f033['$or'],_0x1d69e1);}return _0x5f335c[_0xaa63('0x21')](_0xaa63('0x3a'))[_0xaa63('0x22')](_0x57f033,_0x1ea35b);default:return null;}})[_0xaa63('0x24')](function(_0x302988){if(_0x302988&&_0x302988[_0xaa63('0x35')]){var _0x297d4d=_[_0xaa63('0x3b')](_0x302988);if(_0x297d4d){return BPromise['resolve']({'id':_0x297d4d['Id'],'name':_0x297d4d[_0xaa63('0x3c')],'phone':_0x297d4d[_0xaa63('0x3d')],'endUserType':_0x297d4d[_0xaa63('0x3e')][_0xaa63('0x3f')][_0xaa63('0x40')]()});}}})[_0xaa63('0x24')](function(_0x540226){if(_0x540226){logger['info'](_0xaa63('0x41'),_0x540226['endUserType'],_0x5f0c1f);return BPromise[_0xaa63('0x2c')](_0x540226);}else{logger[_0xaa63('0x26')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x5f0c1f);var _0x1a7d1f={'Phone':_0x5f0c1f};if(_0x105bf3[_0xaa63('0x42')]){if(_0x105bf3[_0xaa63('0x42')]==='contact'){logger[_0xaa63('0x26')](_0xaa63('0x43'),_0x5f0c1f,_0x105bf3[_0xaa63('0x42')]);_0x1a7d1f['LastName']=_0x377de8!==_0xaa63('0x44')?_0x377de8:util['format'](_0xaa63('0x45'),_0x5f0c1f);}else if(_0x105bf3['moduleCreate']===_0xaa63('0x15')){logger[_0xaa63('0x26')](_0xaa63('0x43'),_0x5f0c1f,_0x105bf3[_0xaa63('0x42')]);_0x1a7d1f['LastName']=_0x377de8!==_0xaa63('0x44')?_0x377de8:util['format'](_0xaa63('0x45'),_0x5f0c1f);_0x1a7d1f[_0xaa63('0x46')]=_0xaa63('0x47');}else if(_0x105bf3[_0xaa63('0x42')]===_0xaa63('0x17')){logger[_0xaa63('0x26')](_0xaa63('0x43'),_0x5f0c1f,_0x105bf3[_0xaa63('0x42')]);_0x1a7d1f[_0xaa63('0x3c')]=_0x377de8!==_0xaa63('0x44')?_0x377de8:util[_0xaa63('0x48')]('Caller\x20-\x20%s',_0x5f0c1f);}else{return null;}}return _0x5f335c[_0xaa63('0x21')](_[_0xaa63('0x49')](_0x105bf3[_0xaa63('0x42')]))['create'](_0x1a7d1f)[_0xaa63('0x24')](function(_0x1d8fa3){return BPromise['resolve']({'id':_0x1d8fa3['id'],'endUserType':_0x105bf3[_0xaa63('0x42')]});});}});}function getCustomFields(_0x4d3ae5,_0x3a89d2){var _0x59da1b={};if(_0x4d3ae5[_0xaa63('0x35')]>0x0){_[_0xaa63('0x4a')](_0x4d3ae5,function(_0x3e3f34){if(_[_0xaa63('0x4b')](['string','picklist'],_0x3e3f34[_0xaa63('0x3f')])&&_0x3e3f34[_0xaa63('0x4c')]){_0x59da1b[_0x3e3f34['idField']]=_0x3e3f34['content'][_0xaa63('0x4d')]();}else if(_0x3e3f34[_0xaa63('0x3f')]===_0xaa63('0x4e')&&_0x3e3f34[_0xaa63('0x4f')]&&_0x3e3f34[_0xaa63('0x4c')]){_0x3a89d2[_0x3e3f34[_0xaa63('0x4f')]]&&(_0x59da1b[_0x3e3f34[_0xaa63('0x4c')]]=_0x3a89d2[_0x3e3f34[_0xaa63('0x4f')]][_0xaa63('0x4d')]());}else if(_0x3e3f34['type']===_0xaa63('0x50')&&_0x3e3f34[_0xaa63('0x51')]&&_0x3e3f34[_0xaa63('0x51')][_0xaa63('0x52')]&&_0x3e3f34['idField']){_0x3a89d2[_0x3e3f34[_0xaa63('0x51')][_0xaa63('0x52')]['toLowerCase']()]&&(_0x59da1b[_0x3e3f34[_0xaa63('0x4c')]]=_0x3a89d2[_0x3e3f34[_0xaa63('0x51')]['name'][_0xaa63('0x40')]()][_0xaa63('0x4d')]());}});}return _0x59da1b;}function getConnection(_0x2caaf6){var _0x55bd02=_0x2caaf6[_0xaa63('0x53')][_0xaa63('0x54')](_0x2caaf6[_0xaa63('0x55')]);var _0x521706=new jsforce[(_0xaa63('0x56'))]({'oauth2':{'loginUrl':_0x2caaf6['remoteUri']||_0xaa63('0x57'),'clientId':_0x2caaf6[_0xaa63('0x58')],'clientSecret':_0x2caaf6[_0xaa63('0x59')]}});return _0x521706[_0xaa63('0x5a')](_0x2caaf6[_0xaa63('0x5b')],_0x55bd02)[_0xaa63('0x24')](function(){logger[_0xaa63('0x26')](_0xaa63('0x5c'));return _0x521706;});}exports['queue']=function(_0x23d96a,_0x16dd88,_0x539b20,_0x1a90d2,_0xd4129b,_0x3b3f9f){var _0x13ab4e,_0x47dcbc,_0x4c297a,_0x609b8f;_0x3b3f9f[_0xaa63('0x5d')]=intUtil[_0xaa63('0x5e')](_0x3b3f9f[_0xaa63('0x5d')]);_0x3b3f9f[_0xaa63('0x5f')]=intUtil[_0xaa63('0x5e')](_0x3b3f9f[_0xaa63('0x5f')]);if(_0xd4129b&&_0xd4129b[_0xaa63('0x60')]){logger[_0xaa63('0x26')]('[QUEUE]',_0xaa63('0x61'));_0x16dd88[_0xaa63('0x62')]=util[_0xaa63('0x48')](_0xaa63('0x63'),_0x3b3f9f[_0xaa63('0x5d')],_0x16dd88[_0xaa63('0x64')],md5(_0x16dd88[_0xaa63('0x64')]));}else{_0x16dd88[_0xaa63('0x62')]='';}return getConnection(_0x3b3f9f)[_0xaa63('0x24')](function(_0x399cc4){_0x609b8f=_0x399cc4;return getUser(_0x3b3f9f,_0x1a90d2[_0xaa63('0x65')],_0x609b8f);})['then'](function(_0xfe34bd){_0x13ab4e=_0xfe34bd;return getEndUser(_0x3b3f9f,_0x539b20,_0x16dd88[_0xaa63('0x66')],_0x16dd88[_0xaa63('0x67')],_0x609b8f);})[_0xaa63('0x24')](function(_0xd912f8){_0x47dcbc=_0xd912f8;return getTicket(_0x3b3f9f,_0x13ab4e,_0x47dcbc,_0x539b20,_0x16dd88,_0x539b20[_0xaa63('0x68')],_0x609b8f,_0xaa63('0x69'));})['then'](function(_0x5bd025){_0x4c297a=_0x5bd025;logger[_0xaa63('0x26')](_0xaa63('0x6a'),_0x4c297a['id']);logger['info'](_0xaa63('0x6b'),_0x4c297a['id'],_0x1a90d2[_0xaa63('0x52')],_0x3b3f9f[_0xaa63('0x3f')]);switch(_0x3b3f9f[_0xaa63('0x3f')]){case _0xaa63('0x6c'):emit(util[_0xaa63('0x48')]('user:%s',_0x1a90d2[_0xaa63('0x52')]),_0xaa63('0x6d'),{'recordId':_0x4c297a['id']});break;case'newTab':emit(util[_0xaa63('0x48')](_0xaa63('0x6e'),_0x1a90d2[_0xaa63('0x52')]),'trigger:browser:url',{'uri':util[_0xaa63('0x48')]('%s/%s/e',_0x609b8f['instanceUrl'],_0x4c297a['id'])});break;default:logger['error'](_0xaa63('0x6f'));}})[_0xaa63('0x70')](function(_0x35bfa4){logger[_0xaa63('0x71')](_0xaa63('0x72'),_0x35bfa4);});};exports['outbound']=function(_0x28d81c,_0x4f4105,_0x277d8d,_0x1cffa6,_0x9cffa5,_0x37891b,_0x1968be){var _0x3b3561,_0x37940a,_0x15cacd,_0x51331e;_0x37891b[_0xaa63('0x5d')]=intUtil[_0xaa63('0x5e')](_0x37891b[_0xaa63('0x5d')]);_0x37891b[_0xaa63('0x5f')]=intUtil['stripTrailingSlash'](_0x37891b[_0xaa63('0x5f')]);if(_0x1968be&&_0x1968be[_0xaa63('0x73')]&&_0x1968be[_0xaa63('0x73')]!==_0xaa63('0x74')){logger[_0xaa63('0x26')](_0xaa63('0x75'),_0xaa63('0x61'));_0x4f4105[_0xaa63('0x62')]=util[_0xaa63('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x37891b[_0xaa63('0x5d')],_0x4f4105['uniqueid'],md5(_0x4f4105[_0xaa63('0x64')]));}return getConnection(_0x37891b)['then'](function(_0x35fa42){_0x51331e=_0x35fa42;return getUser(_0x37891b,_0x1cffa6[_0xaa63('0x65')],_0x51331e);})[_0xaa63('0x24')](function(_0x3058c2){_0x3b3561=_0x3058c2;return getEndUser(_0x37891b,_0x277d8d,_0x4f4105['destcalleridname'],_0x4f4105['destcalleridnum'],_0x51331e);})[_0xaa63('0x24')](function(_0x321663){_0x37940a=_0x321663;return getTicket(_0x37891b,_0x3b3561,_0x37940a,_0x277d8d,_0x4f4105,_0x277d8d[_0xaa63('0x68')],_0x51331e,_0xaa63('0x76'));})['then'](function(_0x5ec2fa){_0x15cacd=_0x5ec2fa;logger[_0xaa63('0x26')](_0xaa63('0x77'),_0x15cacd['id']);logger[_0xaa63('0x26')](_0xaa63('0x78'),_0x15cacd['id'],_0x1cffa6[_0xaa63('0x52')],_0x37891b['type']);switch(_0x37891b[_0xaa63('0x3f')]){case _0xaa63('0x6c'):emit(util[_0xaa63('0x48')](_0xaa63('0x6e'),_0x1cffa6[_0xaa63('0x52')]),_0xaa63('0x6d'),{'recordId':_0x15cacd['id']});break;case _0xaa63('0x79'):emit(util[_0xaa63('0x48')](_0xaa63('0x6e'),_0x1cffa6[_0xaa63('0x52')]),'trigger:browser:url',{'uri':util[_0xaa63('0x48')](_0xaa63('0x7a'),_0x51331e['instanceUrl'],_0x15cacd['id'])});break;default:logger['error'](_0xaa63('0x75'),_0xaa63('0x7b'));}})[_0xaa63('0x70')](function(_0x2a484d){logger[_0xaa63('0x71')]('[OUTBOUND]',_0x2a484d);});};exports[_0xaa63('0x7c')]=function(_0x33b598,_0x2033d0,_0x71f162,_0x36265d,_0x4d1d18,_0x5e5962){var _0x5e6f2d,_0x46a890,_0x162886,_0x28204e;_0x5e5962[_0xaa63('0x5d')]=intUtil['stripTrailingSlash'](_0x5e5962['serverUrl']);_0x5e5962[_0xaa63('0x5f')]=intUtil[_0xaa63('0x5e')](_0x5e5962[_0xaa63('0x5f')]);if(_0x4d1d18&&_0x4d1d18[_0xaa63('0x60')]){logger[_0xaa63('0x26')]('['+_0x2033d0[_0xaa63('0x7d')]['toUpperCase']()+']',_0xaa63('0x61'));_0x2033d0['recordingURL']=util[_0xaa63('0x48')](_0xaa63('0x63'),_0x5e5962['serverUrl'],_0x2033d0[_0xaa63('0x64')],md5(_0x2033d0[_0xaa63('0x64')]));}else{_0x2033d0['recordingURL']='';}return getConnection(_0x5e5962)['then'](function(_0x50bdd6){_0x28204e=_0x50bdd6;if(!_[_0xaa63('0x1f')](_0x36265d)){return getUser(_0x5e5962,_0x36265d['name'],_0x28204e);}else{return getUser(_0x5e5962,null,_0x28204e);}})[_0xaa63('0x24')](function(_0xf153c){_0x5e6f2d=_0xf153c;return getEndUser(_0x5e5962,_0x71f162,_0x2033d0[_0xaa63('0x66')],_0x2033d0[_0xaa63('0x67')],_0x28204e);})[_0xaa63('0x24')](function(_0x5d25f2){_0x46a890=_0x5d25f2;return getTicket(_0x5e5962,_0x5e6f2d,_0x46a890,_0x71f162,_0x2033d0,_0x71f162[_0xaa63('0x68')],_0x28204e);})[_0xaa63('0x24')](function(_0x4bda80){_0x162886=_0x4bda80;logger[_0xaa63('0x26')]('['+_0x2033d0[_0xaa63('0x7d')][_0xaa63('0x7e')]()+_0xaa63('0x7f'),_0x162886['id']);logger['info']('['+_0x2033d0[_0xaa63('0x7d')][_0xaa63('0x7e')]()+_0xaa63('0x80'),_0x5e5962[_0xaa63('0x3f')]);})[_0xaa63('0x70')](function(_0x4c15f3){logger[_0xaa63('0x71')]('['+_0x2033d0[_0xaa63('0x7d')][_0xaa63('0x7e')]()+']',_0x4c15f3);});}; \ No newline at end of file +var _0x90d4=['calleridname','calleridnum','Fields','queue','[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','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','isNil',']\x20Ticket\x20%s\x20created.','request-promise','moment','bluebird','md5','jsforce','util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','WhatId','Case','ContactId','account','AccountId','lead','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','execute','then','find','Email','info','resolve','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','toString','variable','variableName','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientId','clientSecret','username','Connection\x20established.','stripTrailingSlash','serverUrl','remoteUri','Recording\x20is\x20enabled!','recordingURL','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x5bffdb,_0x3383b0){var _0x10a6c6=function(_0x2a463c){while(--_0x2a463c){_0x5bffdb['push'](_0x5bffdb['shift']());}};_0x10a6c6(++_0x3383b0);}(_0x90d4,0x9e));var _0x490d=function(_0xd68077,_0xe8bde3){_0xd68077=_0xd68077-0x0;var _0x43ba11=_0x90d4[_0xd68077];return _0x43ba11;};'use strict';var _=require('lodash');var rp=require(_0x490d('0x0'));var moment=require(_0x490d('0x1'));var BPromise=require(_0x490d('0x2'));var md5=require(_0x490d('0x3'));var jsforce=require(_0x490d('0x4'));var util=require(_0x490d('0x5'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x490d('0x6'));var logger=require(_0x490d('0x7'))('salesforce');config[_0x490d('0x8')]=_['defaults'](config[_0x490d('0x8')],{'host':_0x490d('0x9'),'port':0x18eb});var io=require(_0x490d('0xa'))(new Redis(config[_0x490d('0x8')]));function emit(_0x4ecbc4,_0x29b815,_0x4ba832){io['to'](_0x4ecbc4)['emit'](_0x29b815,_0x4ba832);}function getTicket(_0x2a34be,_0x5bccf3,_0x10d021,_0x54161b,_0x5e1751,_0x33083b,_0x4faa92,_0x21dc35){var _0x12ca84=Object['assign']({},{'OwnerId':_0x5bccf3['id'],'Subject':intUtil['getString'](_0x54161b[_0x490d('0xb')],_0x5e1751,'\x20'),'Description':intUtil[_0x490d('0xc')](_0x54161b[_0x490d('0xd')],_0x5e1751,'\x0a')},getCustomFields(_0x33083b,_0x5e1751));if(_0x10d021){if(_0x54161b[_0x490d('0xe')]===_0x490d('0xf')){_0x12ca84[_0x490d('0x10')]=moment['utc']();_0x12ca84[_0x490d('0x11')]=![];_0x12ca84[_0x490d('0x12')]=![];if(_0x10d021[_0x490d('0x13')]===_0x490d('0x14')||_0x10d021[_0x490d('0x13')]==='lead'){_0x12ca84[_0x490d('0x15')]=_0x10d021['id'];}else if(_0x10d021[_0x490d('0x13')]==='account'){_0x12ca84[_0x490d('0x16')]=_0x10d021['id'];}}else if(_0x54161b[_0x490d('0xe')]===_0x490d('0x17')){if(_0x10d021[_0x490d('0x13')]===_0x490d('0x14')){_0x12ca84[_0x490d('0x18')]=_0x10d021['id'];}else if(_0x10d021['endUserType']===_0x490d('0x19')){_0x12ca84[_0x490d('0x1a')]=_0x10d021['id'];}else if(_0x10d021[_0x490d('0x13')]===_0x490d('0x1b')&&_0x54161b['leadId']){_0x12ca84[_0x54161b['leadId']]=_0x10d021['id'];}else{logger['info'](_0x490d('0x1c'));}}}return _0x4faa92[_0x490d('0x1d')](_0x54161b[_0x490d('0xe')])[_0x490d('0x1e')](_0x12ca84);}function getUser(_0x2a509d,_0x1fb0ea,_0xe0367b){if(!_['isNil'](_0x1fb0ea)&&intUtil[_0x490d('0x1f')](_0x1fb0ea)){var _0x52fcae={'Email':_0x1fb0ea};var _0x22668e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xe0367b[_0x490d('0x1d')](_0x490d('0x20'))['find'](_0x52fcae,_0x22668e)[_0x490d('0x21')]()[_0x490d('0x22')](function(_0x346554){if(_0x346554['length']){var _0x53470a=_[_0x490d('0x23')](_0x346554,function(_0x1ba9c9){return _0x1ba9c9[_0x490d('0x24')]===_0x1fb0ea;});if(_0x53470a){logger[_0x490d('0x25')]('Agent\x20%s\x20found.',_0x1fb0ea);return BPromise[_0x490d('0x26')]({'id':_0x53470a['Id'],'name':_0x53470a['Name']});}}else{logger[_0x490d('0x25')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1fb0ea);return _0xe0367b[_0x490d('0x27')]()[_0x490d('0x22')](function(_0x43d2af){return BPromise[_0x490d('0x26')]({'id':_0x43d2af[_0x490d('0x28')],'name':_0x43d2af[_0x490d('0x29')]});});}});}else{logger[_0x490d('0x25')](_0x490d('0x2a'),_0x1fb0ea);return _0xe0367b[_0x490d('0x27')]()[_0x490d('0x22')](function(_0x4a28f0){return BPromise[_0x490d('0x26')]({'id':_0x4a28f0[_0x490d('0x28')],'name':_0x4a28f0[_0x490d('0x29')]});});}}function getEndUser(_0x36562e,_0x4fffc3,_0x16d03c,_0x5a3e84,_0x26319c){var _0x2a9545={'$or':{'Phone':_0x5a3e84}};var _0x581958={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x490d('0x26')]()['then'](function(){logger[_0x490d('0x25')](_0x490d('0x2b'),_0x5a3e84,_0x4fffc3[_0x490d('0x2c')]);switch(_0x4fffc3[_0x490d('0x2c')]){case _0x490d('0x2d'):var _0x171e01=_[_0x490d('0x2e')](_0x2a9545);if(_0x4fffc3[_0x490d('0x2f')]){var _0x5280ae={};_0x5280ae[_0x4fffc3['additionalSearchContact']]=_0x5a3e84;_[_0x490d('0x30')](_0x171e01[_0x490d('0x31')],_0x5280ae);}return _0x26319c[_0x490d('0x1d')]('Contact')['find'](_0x171e01,_0x581958)[_0x490d('0x21')]()[_0x490d('0x22')](function(_0x43539f){if(_0x43539f&&_0x43539f[_0x490d('0x32')]){return _0x43539f;}else{var _0x171b6a=_['cloneDeep'](_0x2a9545);if(_0x4fffc3[_0x490d('0x33')]){var _0x2337c7={};_0x2337c7[_0x4fffc3[_0x490d('0x33')]]=_0x5a3e84;_[_0x490d('0x30')](_0x171b6a[_0x490d('0x31')],_0x2337c7);}return _0x26319c[_0x490d('0x1d')](_0x490d('0x34'))[_0x490d('0x23')](_0x171b6a,_0x581958);}});case _0x490d('0x35'):var _0x2ac8e8=_[_0x490d('0x2e')](_0x2a9545);if(_0x4fffc3[_0x490d('0x36')]){var _0x5280ae={};_0x5280ae[_0x4fffc3[_0x490d('0x36')]]=_0x5a3e84;_[_0x490d('0x30')](_0x2ac8e8[_0x490d('0x31')],_0x5280ae);}return _0x26319c[_0x490d('0x1d')](_0x490d('0x37'))[_0x490d('0x23')](_0x2ac8e8,_0x581958)['execute']()[_0x490d('0x22')](function(_0x336673){if(_0x336673&&_0x336673[_0x490d('0x32')]){return _0x336673;}else{var _0x322811=_[_0x490d('0x2e')](_0x2a9545);if(_0x4fffc3[_0x490d('0x2f')]){var _0x5046d2={};_0x5046d2[_0x4fffc3[_0x490d('0x2f')]]=_0x5a3e84;_[_0x490d('0x30')](_0x322811[_0x490d('0x31')],_0x5046d2);}return _0x26319c[_0x490d('0x1d')](_0x490d('0x38'))[_0x490d('0x23')](_0x322811,_0x581958)['then'](function(_0x140839){if(_0x140839&&_0x140839[_0x490d('0x32')]){return _0x140839;}else{var _0x4fe1c5=_[_0x490d('0x2e')](_0x2a9545);if(_0x4fffc3['additionalSearchLead']){var _0x33aaca={};_0x33aaca[_0x4fffc3[_0x490d('0x33')]]=_0x5a3e84;_[_0x490d('0x30')](_0x4fe1c5['$or'],_0x33aaca);}return _0x26319c[_0x490d('0x1d')](_0x490d('0x34'))[_0x490d('0x23')](_0x4fe1c5,_0x581958);}});}});case'contact':var _0x171e01=_[_0x490d('0x2e')](_0x2a9545);if(_0x4fffc3[_0x490d('0x2f')]){var _0x5280ae={};_0x5280ae[_0x4fffc3[_0x490d('0x2f')]]=_0x5a3e84;_[_0x490d('0x30')](_0x171e01[_0x490d('0x31')],_0x5280ae);}return _0x26319c[_0x490d('0x1d')]('Contact')['find'](_0x171e01,_0x581958)[_0x490d('0x21')]();case _0x490d('0x1b'):var _0x247d40=_['cloneDeep'](_0x2a9545);if(_0x4fffc3[_0x490d('0x33')]){var _0x5280ae={};_0x5280ae[_0x4fffc3[_0x490d('0x33')]]=_0x5a3e84;_[_0x490d('0x30')](_0x247d40[_0x490d('0x31')],_0x5280ae);}return _0x26319c[_0x490d('0x1d')](_0x490d('0x34'))[_0x490d('0x23')](_0x247d40,_0x581958);case _0x490d('0x19'):var _0x2ac8e8=_[_0x490d('0x2e')](_0x2a9545);if(_0x4fffc3[_0x490d('0x36')]){var _0x5280ae={};_0x5280ae[_0x4fffc3[_0x490d('0x36')]]=_0x5a3e84;_[_0x490d('0x30')](_0x2ac8e8[_0x490d('0x31')],_0x5280ae);}return _0x26319c[_0x490d('0x1d')]('Account')['find'](_0x2ac8e8,_0x581958);default:return null;}})[_0x490d('0x22')](function(_0x2926db){if(_0x2926db&&_0x2926db[_0x490d('0x32')]){var _0x4ba2e6=_['first'](_0x2926db);if(_0x4ba2e6){return BPromise[_0x490d('0x26')]({'id':_0x4ba2e6['Id'],'name':_0x4ba2e6[_0x490d('0x39')],'phone':_0x4ba2e6[_0x490d('0x3a')],'endUserType':_0x4ba2e6[_0x490d('0x3b')][_0x490d('0x3c')][_0x490d('0x3d')]()});}}})['then'](function(_0x1b8477){if(_0x1b8477){logger['info'](_0x490d('0x3e'),_0x1b8477[_0x490d('0x13')],_0x5a3e84);return BPromise[_0x490d('0x26')](_0x1b8477);}else{logger[_0x490d('0x25')](_0x490d('0x3f'),_0x5a3e84);var _0x4885b2={'Phone':_0x5a3e84};if(_0x4fffc3[_0x490d('0x40')]){if(_0x4fffc3[_0x490d('0x40')]===_0x490d('0x14')){logger['info'](_0x490d('0x41'),_0x5a3e84,_0x4fffc3[_0x490d('0x40')]);_0x4885b2[_0x490d('0x42')]=_0x16d03c!==_0x490d('0x43')?_0x16d03c:util['format'](_0x490d('0x44'),_0x5a3e84);}else if(_0x4fffc3[_0x490d('0x40')]===_0x490d('0x1b')){logger[_0x490d('0x25')](_0x490d('0x41'),_0x5a3e84,_0x4fffc3[_0x490d('0x40')]);_0x4885b2[_0x490d('0x42')]=_0x16d03c!==''?_0x16d03c:util['format'](_0x490d('0x44'),_0x5a3e84);_0x4885b2[_0x490d('0x45')]=_0x490d('0x46');}else if(_0x4fffc3[_0x490d('0x40')]==='account'){logger[_0x490d('0x25')](_0x490d('0x41'),_0x5a3e84,_0x4fffc3[_0x490d('0x40')]);_0x4885b2[_0x490d('0x39')]=_0x16d03c!==''?_0x16d03c:util['format'](_0x490d('0x44'),_0x5a3e84);}else{return null;}}return _0x26319c['sobject'](_[_0x490d('0x47')](_0x4fffc3[_0x490d('0x40')]))[_0x490d('0x1e')](_0x4885b2)[_0x490d('0x22')](function(_0x28f554){return BPromise[_0x490d('0x26')]({'id':_0x28f554['id'],'endUserType':_0x4fffc3[_0x490d('0x40')]});});}});}function getCustomFields(_0x2094fd,_0x3f4146){var _0x585585={};if(_0x2094fd[_0x490d('0x32')]>0x0){_[_0x490d('0x48')](_0x2094fd,function(_0x46148a){if(_['includes']([_0x490d('0x49'),_0x490d('0x4a')],_0x46148a['type'])&&_0x46148a[_0x490d('0x4b')]){_0x585585[_0x46148a['idField']]=_0x46148a['content'][_0x490d('0x4c')]();}else if(_0x46148a[_0x490d('0x3c')]===_0x490d('0x4d')&&_0x46148a[_0x490d('0x4e')]&&_0x46148a[_0x490d('0x4b')]){_0x3f4146[_0x46148a[_0x490d('0x4e')]]&&(_0x585585[_0x46148a[_0x490d('0x4b')]]=_0x3f4146[_0x46148a[_0x490d('0x4e')]][_0x490d('0x4c')]());}else if(_0x46148a['type']==='customVariable'&&_0x46148a['Variable']&&_0x46148a[_0x490d('0x4f')][_0x490d('0x50')]&&_0x46148a[_0x490d('0x4b')]){_0x3f4146[_0x46148a[_0x490d('0x4f')]['name'][_0x490d('0x3d')]()]&&(_0x585585[_0x46148a[_0x490d('0x4b')]]=_0x3f4146[_0x46148a['Variable']['name'][_0x490d('0x3d')]()]['toString']());}});}return _0x585585;}function getConnection(_0x4868e9){var _0x285304=_0x4868e9[_0x490d('0x51')][_0x490d('0x52')](_0x4868e9[_0x490d('0x53')]);var _0x32331a=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4868e9['remoteUri']||_0x490d('0x54'),'clientId':_0x4868e9[_0x490d('0x55')],'clientSecret':_0x4868e9[_0x490d('0x56')]}});return _0x32331a['login'](_0x4868e9[_0x490d('0x57')],_0x285304)[_0x490d('0x22')](function(){logger[_0x490d('0x25')](_0x490d('0x58'));return _0x32331a;});}exports['queue']=function(_0xde49c9,_0x3f74e6,_0x2e3bca,_0x190dcf,_0x5a446c,_0x5835b2){var _0x5e8b4c,_0x212bc6,_0x3bee08,_0xf79ece;_0x5835b2['serverUrl']=intUtil[_0x490d('0x59')](_0x5835b2[_0x490d('0x5a')]);_0x5835b2['remoteUri']=intUtil[_0x490d('0x59')](_0x5835b2[_0x490d('0x5b')]);if(_0x5a446c&&_0x5a446c['monitor_format']){logger[_0x490d('0x25')]('[QUEUE]',_0x490d('0x5c'));_0x3f74e6[_0x490d('0x5d')]=util[_0x490d('0x5e')](_0x490d('0x5f'),_0x5835b2[_0x490d('0x5a')],_0x3f74e6[_0x490d('0x60')],md5(_0x3f74e6[_0x490d('0x60')]));}else{_0x3f74e6[_0x490d('0x5d')]='';}return getConnection(_0x5835b2)[_0x490d('0x22')](function(_0xc2e562){_0xf79ece=_0xc2e562;return getUser(_0x5835b2,_0x190dcf[_0x490d('0x61')],_0xf79ece);})['then'](function(_0x27dd8f){_0x5e8b4c=_0x27dd8f;return getEndUser(_0x5835b2,_0x2e3bca,_0x3f74e6[_0x490d('0x62')],_0x3f74e6[_0x490d('0x63')],_0xf79ece);})[_0x490d('0x22')](function(_0xdb9fea){_0x212bc6=_0xdb9fea;return getTicket(_0x5835b2,_0x5e8b4c,_0x212bc6,_0x2e3bca,_0x3f74e6,_0x2e3bca[_0x490d('0x64')],_0xf79ece,_0x490d('0x65'));})[_0x490d('0x22')](function(_0x15d3f8){_0x3bee08=_0x15d3f8;logger['info'](_0x490d('0x66'),_0x3bee08['id']);logger[_0x490d('0x25')](_0x490d('0x67'),_0x3bee08['id'],_0x190dcf[_0x490d('0x50')],_0x5835b2[_0x490d('0x3c')]);switch(_0x5835b2['type']){case _0x490d('0x68'):emit(util[_0x490d('0x5e')](_0x490d('0x69'),_0x190dcf['name']),_0x490d('0x6a'),{'recordId':_0x3bee08['id']});break;case _0x490d('0x6b'):emit(util[_0x490d('0x5e')]('user:%s',_0x190dcf[_0x490d('0x50')]),'trigger:browser:url',{'uri':util['format'](_0x490d('0x6c'),_0xf79ece[_0x490d('0x6d')],_0x3bee08['id'])});break;default:logger[_0x490d('0x6e')](_0x490d('0x6f'));}})['catch'](function(_0x597785){logger['error'](_0x490d('0x70'),_0x597785);});};exports[_0x490d('0x71')]=function(_0x29eef8,_0x11ab2e,_0x3c7edc,_0x185170,_0x9068ba,_0x4b1e7b,_0x3840d0){var _0x106131,_0x1e300c,_0x3cb6a9,_0x53ad5f;_0x4b1e7b['serverUrl']=intUtil[_0x490d('0x59')](_0x4b1e7b['serverUrl']);_0x4b1e7b[_0x490d('0x5b')]=intUtil[_0x490d('0x59')](_0x4b1e7b[_0x490d('0x5b')]);if(_0x3840d0&&_0x3840d0[_0x490d('0x72')]&&_0x3840d0[_0x490d('0x72')]!=='none'){logger[_0x490d('0x25')](_0x490d('0x73'),'Recording\x20is\x20enabled!');_0x11ab2e[_0x490d('0x5d')]=util[_0x490d('0x5e')](_0x490d('0x5f'),_0x4b1e7b[_0x490d('0x5a')],_0x11ab2e[_0x490d('0x60')],md5(_0x11ab2e[_0x490d('0x60')]));}return getConnection(_0x4b1e7b)[_0x490d('0x22')](function(_0x152311){_0x53ad5f=_0x152311;return getUser(_0x4b1e7b,_0x185170[_0x490d('0x61')],_0x53ad5f);})[_0x490d('0x22')](function(_0x31da49){_0x106131=_0x31da49;return getEndUser(_0x4b1e7b,_0x3c7edc,_0x11ab2e[_0x490d('0x74')],_0x11ab2e[_0x490d('0x75')],_0x53ad5f);})[_0x490d('0x22')](function(_0x4c5cd7){_0x1e300c=_0x4c5cd7;return getTicket(_0x4b1e7b,_0x106131,_0x1e300c,_0x3c7edc,_0x11ab2e,_0x3c7edc[_0x490d('0x64')],_0x53ad5f,_0x490d('0x71'));})[_0x490d('0x22')](function(_0x261cab){_0x3cb6a9=_0x261cab;logger[_0x490d('0x25')](_0x490d('0x76'),_0x3cb6a9['id']);logger[_0x490d('0x25')](_0x490d('0x77'),_0x3cb6a9['id'],_0x185170['name'],_0x4b1e7b[_0x490d('0x3c')]);switch(_0x4b1e7b[_0x490d('0x3c')]){case _0x490d('0x68'):emit(util[_0x490d('0x5e')](_0x490d('0x69'),_0x185170[_0x490d('0x50')]),'trigger:salesforce:display',{'recordId':_0x3cb6a9['id']});break;case _0x490d('0x6b'):emit(util[_0x490d('0x5e')]('user:%s',_0x185170[_0x490d('0x50')]),_0x490d('0x78'),{'uri':util['format'](_0x490d('0x6c'),_0x53ad5f[_0x490d('0x6d')],_0x3cb6a9['id'])});break;default:logger[_0x490d('0x6e')](_0x490d('0x73'),_0x490d('0x79'));}})[_0x490d('0x7a')](function(_0x563375){logger[_0x490d('0x6e')](_0x490d('0x73'),_0x563375);});};exports[_0x490d('0x7b')]=function(_0x1fc9b2,_0x3dfc54,_0x557581,_0x5ed5bd,_0x57b150,_0x206be8){var _0x233c15,_0x2eeb44,_0x84a899,_0x211a6d;_0x206be8[_0x490d('0x5a')]=intUtil[_0x490d('0x59')](_0x206be8[_0x490d('0x5a')]);_0x206be8['remoteUri']=intUtil['stripTrailingSlash'](_0x206be8[_0x490d('0x5b')]);if(_0x57b150&&_0x57b150['monitor_format']){logger[_0x490d('0x25')]('['+_0x3dfc54[_0x490d('0x7c')][_0x490d('0x7d')]()+']',_0x490d('0x5c'));_0x3dfc54[_0x490d('0x5d')]=util[_0x490d('0x5e')](_0x490d('0x5f'),_0x206be8['serverUrl'],_0x3dfc54[_0x490d('0x60')],md5(_0x3dfc54[_0x490d('0x60')]));}else{_0x3dfc54[_0x490d('0x5d')]='';}return getConnection(_0x206be8)[_0x490d('0x22')](function(_0x219d39){_0x211a6d=_0x219d39;if(!_[_0x490d('0x7e')](_0x5ed5bd)){return getUser(_0x206be8,_0x5ed5bd['name'],_0x211a6d);}else{return getUser(_0x206be8,null,_0x211a6d);}})[_0x490d('0x22')](function(_0xb9551f){_0x233c15=_0xb9551f;return getEndUser(_0x206be8,_0x557581,_0x3dfc54[_0x490d('0x62')],_0x3dfc54[_0x490d('0x63')],_0x211a6d);})[_0x490d('0x22')](function(_0x15fbc1){_0x2eeb44=_0x15fbc1;return getTicket(_0x206be8,_0x233c15,_0x2eeb44,_0x557581,_0x3dfc54,_0x557581[_0x490d('0x64')],_0x211a6d);})[_0x490d('0x22')](function(_0x49eaf8){_0x84a899=_0x49eaf8;logger[_0x490d('0x25')]('['+_0x3dfc54[_0x490d('0x7c')][_0x490d('0x7d')]()+_0x490d('0x7f'),_0x84a899['id']);logger[_0x490d('0x25')]('['+_0x3dfc54[_0x490d('0x7c')][_0x490d('0x7d')]()+']\x20Integration\x20account\x20type\x20%s.',_0x206be8[_0x490d('0x3c')]);})[_0x490d('0x7a')](function(_0x520c96){logger[_0x490d('0x6e')]('['+_0x3dfc54[_0x490d('0x7c')][_0x490d('0x7d')]()+']',_0x520c96);});}; \ 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 28957e3..19d7eb9 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 _0xc1de=['type','nameField','content','toString','idField','customField','variableName','toLowerCase','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','assign','Subjects','getString','Descriptions','Fields','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','isNil','email','calleridnum','callDirection','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','servicenow','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','true','userId','catch',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','sys_id','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist'];(function(_0x5dee30,_0x54df56){var _0x236cb6=function(_0x1c2173){while(--_0x1c2173){_0x5dee30['push'](_0x5dee30['shift']());}};_0x236cb6(++_0x54df56);}(_0xc1de,0xaa));var _0xec1d=function(_0x420e5a,_0xd249dd){_0x420e5a=_0x420e5a-0x0;var _0x3721d8=_0xc1de[_0x420e5a];return _0x3721d8;};'use strict';var _=require('lodash');var Promise=require(_0xec1d('0x0'));var rp=require(_0xec1d('0x1'));var util=require(_0xec1d('0x2'));var md5=require(_0xec1d('0x3'));var Redis=require(_0xec1d('0x4'));var intUtil=require(_0xec1d('0x5'));var config=require(_0xec1d('0x6'));var logger=require('../../../../config/logger')(_0xec1d('0x7'));config[_0xec1d('0x8')]=_['defaults'](config['redis'],{'host':_0xec1d('0x9'),'port':0x18eb});var io=require(_0xec1d('0xa'))(new Redis(config[_0xec1d('0x8')]));function getAdminUser(_0x42b076,_0x15d070,_0x40a093,_0x586949,_0x2557e7,_0x2f7807){return new Promise(function(_0x13a156,_0x1fb35a){var _0x1dd83d={'method':'GET','uri':_0x586949+_0xec1d('0xb')+'&'+_0x2557e7+'&'+_0x2f7807,'auth':_0x15d070,'json':!![]};return rp(_0x1dd83d)[_0xec1d('0xc')](function(_0x31e231){if(_0x31e231[_0xec1d('0xd')][_0xec1d('0xe')]>0x0){_0x40a093[_0xec1d('0xf')]=_0x31e231[_0xec1d('0xd')][0x0]['sys_id'];}logger[_0xec1d('0x10')]('['+[_0x42b076['toUpperCase']()]+_0xec1d('0x11'),_0x40a093);_0x13a156(_0x40a093);})['catch'](function(_0xb44215){logger[_0xec1d('0x12')]('['+[_0x42b076[_0xec1d('0x13')]()]+']',_0xb44215[_0xec1d('0x14')]);_0x1fb35a(_0xb44215[_0xec1d('0x14')]);});});}function getUser(_0x353462,_0x44a9de,_0x5dbb32,_0x5d4e1b,_0x2edf38){return function(_0x3c9a5f){logger[_0xec1d('0x10')]('['+[_0x353462[_0xec1d('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x3c9a5f);return new Promise(function(_0x1ed3b,_0x5236a5){if(intUtil['validateEmail'](_0x3c9a5f[_0xec1d('0x15')])){var _0x403684={'method':_0xec1d('0x16'),'uri':_0x5dbb32+_0xec1d('0x17')+_0x3c9a5f['userEmail']+'&'+_0x5d4e1b+'&'+_0x2edf38,'auth':_0x44a9de,'json':!![]};logger[_0xec1d('0x10')]('['+[_0x353462[_0xec1d('0x13')]()]+_0xec1d('0x18'),_0x403684);return rp(_0x403684)[_0xec1d('0xc')](function(_0x1bce0e){logger[_0xec1d('0x10')]('['+[_0x353462['toUpperCase']()]+'],\x20getUser\x20entity',_0x1bce0e);if(_0x1bce0e['result'][_0xec1d('0xe')]>0x0&&String(_0x1bce0e[_0xec1d('0xd')][0x0]['active'])===_0xec1d('0x19')){_0x3c9a5f[_0xec1d('0x1a')]=_0x1bce0e['result'][0x0]['sys_id'];}else{_0x3c9a5f[_0xec1d('0x1a')]=_0x3c9a5f[_0xec1d('0xf')];_0x3c9a5f[_0xec1d('0x15')]=_0x3c9a5f['adminEmail'];}logger[_0xec1d('0x10')]('['+[_0x353462[_0xec1d('0x13')]()]+'],\x20getUser\x20crm',_0x3c9a5f);_0x1ed3b(_0x3c9a5f);})[_0xec1d('0x1b')](function(_0x558399){logger[_0xec1d('0x12')]('['+[_0x353462[_0xec1d('0x13')]()]+']',_0x558399[_0xec1d('0x14')]);_0x5236a5(_0x558399[_0xec1d('0x14')]);});}else{logger['info']('['+[_0x353462[_0xec1d('0x13')]()]+_0xec1d('0x1c'));_0x3c9a5f[_0xec1d('0x1a')]=_0x3c9a5f[_0xec1d('0xf')];_0x3c9a5f['userEmail']=_0x3c9a5f[_0xec1d('0x1d')];_0x1ed3b(_0x3c9a5f);}});};}function createEndUser(_0x262de7,_0x5709aa,_0x4f3eb8,_0x3a833c,_0x54b1c8){logger[_0xec1d('0x10')]('['+[_0x262de7[_0xec1d('0x13')]()]+_0xec1d('0x1e'),_0x4f3eb8);return new Promise(function(_0x369980,_0xfc0df4){var _0x53ef3c={'method':'POST','uri':_0x3a833c+_0xec1d('0x1f')+_0x54b1c8,'body':{'user_name':_0x4f3eb8[_0xec1d('0x20')],'roles':_0xec1d('0x21'),'first_name':_0x4f3eb8[_0xec1d('0x20')],'active':'true','date_format':_0xec1d('0x22'),'phone':_0x4f3eb8['endUserNumber']},'auth':_0x5709aa,'json':!![]};return rp(_0x53ef3c)[_0xec1d('0xc')](function(_0x4bbe8e){logger[_0xec1d('0x10')]('['+[_0x262de7[_0xec1d('0x13')]()]+_0xec1d('0x23'),_0x4bbe8e[_0xec1d('0xd')]);_0x4f3eb8[_0xec1d('0x24')]=_0x4bbe8e[_0xec1d('0xd')][_0xec1d('0x25')];_0x369980(_0x4f3eb8);})[_0xec1d('0x1b')](function(_0x84c46f){logger[_0xec1d('0x12')]('['+[_0x262de7[_0xec1d('0x13')]()]+']',_0x84c46f[_0xec1d('0x14')]);_0xfc0df4(_0x84c46f[_0xec1d('0x14')]);});});}function getEndUser(_0xcb7c2,_0x31496b,_0x250d77,_0x9b4542,_0x3af791){return function(_0x1f1da8){logger['info']('['+[_0xcb7c2[_0xec1d('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x1f1da8);return new Promise(function(_0x7b67c,_0x4378a2){var _0x29acb6={'method':_0xec1d('0x16'),'uri':_0x250d77+_0xec1d('0x26')+_0x1f1da8[_0xec1d('0x20')]+'&'+_0x9b4542+'&'+_0x3af791,'auth':_0x31496b,'json':!![]};return rp(_0x29acb6)[_0xec1d('0xc')](function(_0x49f6bc){if(_0x49f6bc[_0xec1d('0xd')][_0xec1d('0xe')]>0x0){_0x1f1da8['endUserId']=_0x49f6bc[_0xec1d('0xd')][0x0][_0xec1d('0x25')];logger[_0xec1d('0x10')]('['+[_0xcb7c2[_0xec1d('0x13')]()]+_0xec1d('0x27'),_0x1f1da8);_0x7b67c(_0x1f1da8);}else{return createEndUser(_0xcb7c2,_0x31496b,_0x1f1da8,_0x250d77,_0x9b4542)[_0xec1d('0xc')](function(_0x4c06e2){logger[_0xec1d('0x10')]('['+[_0xcb7c2[_0xec1d('0x13')]()]+_0xec1d('0x28'),_0x4c06e2);_0x7b67c(_0x4c06e2);});}})[_0xec1d('0x1b')](function(_0x15ddb8){logger[_0xec1d('0x12')]('['+[_0xcb7c2[_0xec1d('0x13')]()]+']',_0x15ddb8[_0xec1d('0x14')]);_0x4378a2(_0x15ddb8[_0xec1d('0x14')]);});});};}function getCustomFields(_0x2dfa12,_0x4838ec){var _0x4027ba={};if(_0x2dfa12[_0xec1d('0xe')]>0x0){_[_0xec1d('0x29')](_0x2dfa12,function(_0x5a7a84){if(_[_0xec1d('0x2a')](['string',_0xec1d('0x2b')],_0x5a7a84[_0xec1d('0x2c')])&&_0x5a7a84[_0xec1d('0x2d')]&&!_0x5a7a84['customField']){_0x4027ba[_0x5a7a84[_0xec1d('0x2d')]['toLowerCase']()]=_0x5a7a84[_0xec1d('0x2e')][_0xec1d('0x2f')]();}else if(_[_0xec1d('0x2a')](['string',_0xec1d('0x2b')],_0x5a7a84[_0xec1d('0x2c')])&&_0x5a7a84[_0xec1d('0x30')]&&_0x5a7a84[_0xec1d('0x31')]){_0x4027ba[_0x5a7a84['idField']['toLowerCase']()]=_0x5a7a84[_0xec1d('0x2e')][_0xec1d('0x2f')]();}else if(_0x5a7a84[_0xec1d('0x2c')]==='variable'&&_0x5a7a84[_0xec1d('0x32')]&&_0x5a7a84[_0xec1d('0x30')]&&_0x5a7a84['customField']){_0x4027ba[_0x5a7a84[_0xec1d('0x30')][_0xec1d('0x33')]()]=_0x4838ec[_0x5a7a84[_0xec1d('0x32')]][_0xec1d('0x2f')]();}else if(_0x5a7a84[_0xec1d('0x2c')]===_0xec1d('0x34')&&_0x5a7a84[_0xec1d('0x35')]&&_0x5a7a84[_0xec1d('0x35')][_0xec1d('0x36')]&&_0x5a7a84[_0xec1d('0x30')]&&_0x5a7a84[_0xec1d('0x31')]){_0x4027ba[_0x5a7a84[_0xec1d('0x30')][_0xec1d('0x33')]()]=_0x4838ec[_0x5a7a84[_0xec1d('0x35')][_0xec1d('0x36')][_0xec1d('0x33')]()][_0xec1d('0x2f')]();}});}return _0x4027ba;}function getTicket(_0x1a809c,_0x5ed707,_0x764b14,_0x3fca40,_0x357ba5,_0x1abb0e){return function(_0x421f97){logger['info']('['+[_0x1a809c[_0xec1d('0x13')]()]+_0xec1d('0x37'),_0x421f97);return new Promise(function(_0x376166,_0x42ce28){var _0x17499e=_0x1a809c[_0xec1d('0x33')]()==='outbound'?_0x421f97['userId']:_0x421f97['endUserId'];var _0x4ad88c={'method':_0xec1d('0x38'),'uri':_0x764b14+'incident'+'?'+_0x1abb0e,'body':Object[_0xec1d('0x39')]({},{'active':'true','caller_id':_0x17499e,'assigned_to':_0x421f97[_0xec1d('0x1a')],'short_description':intUtil['getString'](_0x3fca40[_0xec1d('0x3a')],_0x357ba5,'\x20'),'description':intUtil[_0xec1d('0x3b')](_0x3fca40[_0xec1d('0x3c')],_0x357ba5,'\x0a')},getCustomFields(_0x3fca40[_0xec1d('0x3d')],_0x357ba5)),'auth':_0x5ed707,'json':!![]};return rp(_0x4ad88c)[_0xec1d('0xc')](function(_0x5a09a1){logger[_0xec1d('0x10')]('['+[_0x1a809c[_0xec1d('0x13')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x5a09a1[_0xec1d('0xd')]);_0x421f97['ticketId']=_0x5a09a1['result']['sys_id'];_0x421f97[_0xec1d('0x3e')]=_0x5a09a1[_0xec1d('0xd')][_0xec1d('0x3f')];logger[_0xec1d('0x10')]('['+[_0x1a809c[_0xec1d('0x13')]()]+_0xec1d('0x40'),_0x421f97);_0x376166(_0x421f97);})[_0xec1d('0x1b')](function(_0x5a5f08){logger[_0xec1d('0x12')]('['+[_0x1a809c[_0xec1d('0x13')]()]+']',_0x5a5f08['message']);_0x42ce28(_0x5a5f08[_0xec1d('0x14')]);});});};}function createRemoteTag(_0x2aa10e,_0x38168a,_0x5466d4,_0x26da38){return new Promise(function(_0x436a5e,_0x59ae07){var _0x3cb2e2={'method':_0xec1d('0x38'),'uri':_0x5466d4+_0xec1d('0x41')+'?'+_0x26da38,'body':{'short_description':_0x2aa10e,'global':!![],'active':!![],'name':_0x2aa10e},'auth':_0x38168a,'json':!![]};return rp(_0x3cb2e2)[_0xec1d('0xc')](function(_0x5c289d){var _0x5bab0a=_0x5c289d['result']['sys_id'];_0x436a5e(_0x5bab0a);});});}function getRemoteTag(_0x5b84c2,_0x17e686,_0x3238dc,_0x40b465,_0x22e110){return new Promise(function(_0xb1e712,_0x58da92){var _0x11e0b2={'method':'GET','uri':_0x3238dc+_0xec1d('0x41')+'?sysparm_query=name%3D'+_0x5b84c2+'&'+_0x40b465,'auth':_0x17e686,'json':!![]};return rp(_0x11e0b2)[_0xec1d('0xc')](function(_0x24ec6e){if(_0x24ec6e['result'][_0xec1d('0xe')]>0x0){var _0x3c99b3=_0x24ec6e[_0xec1d('0xd')][0x0][_0xec1d('0x25')];_0xb1e712(_0x3c99b3);}else{return createRemoteTag(_0x5b84c2,_0x17e686,_0x3238dc,_0x40b465)[_0xec1d('0xc')](function(_0x5ef9a3){_0xb1e712(_0x5ef9a3);});}});});}function assignTagToIncident(_0x117784,_0x29b2f8,_0x18b7ea,_0x5e70d2,_0x1db5c1){return new Promise(function(_0x96326,_0x5b0cac){var _0x7ddd3e={'method':_0xec1d('0x38'),'uri':_0x18b7ea+_0xec1d('0x42')+'?'+_0x1db5c1,'body':{'label':_0x117784,'table':_0xec1d('0x43'),'id_type':_0xec1d('0x44'),'table_key':_0x5e70d2['ticketId'],'title':_0xec1d('0x45')+_0x5e70d2['ticketNumber'],'id_display':_0x5e70d2[_0xec1d('0x3e')]},'auth':_0x29b2f8,'json':!![]};return rp(_0x7ddd3e)[_0xec1d('0xc')](function(_0x45ecc4){_0x96326();})[_0xec1d('0x1b')](function(){_0x96326();});});}function manageTags(_0xc1f353,_0x4451ca,_0x280dcd,_0x47bae3,_0x26563e,_0x4a21d5,_0x48eeb2){return new Promise(function(_0x3cad69,_0x17c5d5){var _0x4626d1=[];_0x4451ca[_0xec1d('0x29')](function(_0x29da68){_0x4626d1[_0xec1d('0x46')](getRemoteTag(_0x29da68,_0x280dcd,_0x47bae3,_0x4a21d5,_0x48eeb2));});return Promise[_0xec1d('0x47')](_0x4626d1)[_0xec1d('0xc')](function(_0x169db1){if(_0x169db1['length']){logger[_0xec1d('0x10')]('['+[_0xc1f353[_0xec1d('0x13')]()]+_0xec1d('0x48'),_0x169db1);var _0x48938c=[];_0x169db1['forEach'](function(_0x587979){_0x48938c[_0xec1d('0x46')](assignTagToIncident(_0x587979,_0x280dcd,_0x47bae3,_0x26563e,_0x4a21d5));});return Promise['all'](_0x48938c)[_0xec1d('0xc')](function(){_0x3cad69();})[_0xec1d('0x1b')](function(){_0x3cad69();});}else{_0x3cad69();}});});}function getTags(_0x4ac7cf,_0x58dcd1,_0x1d9e33,_0x393c78,_0x355aa2,_0x39a786){return function(_0x3fc78a){return new Promise(function(_0xd2f5ca,_0x1bc302){var _0x4d3395=[];var _0x3ef728=_0x393c78[_0xec1d('0x49')];if(_0x3ef728&&_0x3ef728['length']>0x0){_0x4d3395=_[_0xec1d('0x4a')](_0x3ef728,'name');}if(_0x4d3395[_0xec1d('0xe')]>0x0){return manageTags(_0x4ac7cf,_0x4d3395,_0x58dcd1,_0x1d9e33,_0x3fc78a,_0x355aa2,_0x39a786)['then'](function(){_0xd2f5ca(_0x3fc78a);});}else{_0xd2f5ca(_0x3fc78a);}});};}function emit(_0x4d0764,_0x3d862b,_0x177a24){var _0x304ffb='%26sysparm_record_target%3Dincident'+_0xec1d('0x4b')+_0xec1d('0x4c')+_0xec1d('0x4d');var _0x57e2e9={'uri':_0x4d0764+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x177a24+_0x304ffb};io['to'](util[_0xec1d('0x4e')](_0xec1d('0x4f'),_0x3d862b))[_0xec1d('0x50')]('trigger:browser:url',_0x57e2e9);}exports['cs']=function(_0x1283dc,_0x54bcab,_0x59cd03,_0x32a13a,_0x313a42,_0x575959,_0x3f6fce,_0x1b9cae){var _0x2951c3={};var _0x222ada={'user':_0x575959['username'],'pass':_0x575959[_0xec1d('0x51')]};var _0xeef44c=_0xec1d('0x52');var _0x4a911f=_0xec1d('0x53');_0x575959['remoteUri']=intUtil[_0xec1d('0x54')](_0x575959[_0xec1d('0x55')]);_0x575959[_0xec1d('0x56')]=intUtil[_0xec1d('0x54')](_0x575959[_0xec1d('0x56')]);var _0x468d52=util[_0xec1d('0x4e')]('%s/api/now/table/',_0x575959[_0xec1d('0x55')]);_0x2951c3['userEmail']=!_[_0xec1d('0x57')](_0x32a13a)?_0x32a13a[_0xec1d('0x58')]:null;_0x2951c3[_0xec1d('0x1d')]=_0x575959[_0xec1d('0x58')];_0x2951c3[_0xec1d('0x20')]=_0x1b9cae[_0xec1d('0x33')]()==='outbound'?_0x54bcab['destcalleridnum']:_0x54bcab[_0xec1d('0x59')];_0x2951c3[_0xec1d('0x5a')]=_0x1b9cae==='queue'||_0x1b9cae===_0xec1d('0x5b')?'queue':_0xec1d('0x5c');var _0x43f159=util[_0xec1d('0x4e')](_0xec1d('0x5d'),_0x575959[_0xec1d('0x56')],_0x54bcab[_0xec1d('0x5e')],md5(_0x54bcab[_0xec1d('0x5e')]));if(_0x313a42&&_0x313a42[_0xec1d('0x5f')]){logger['info'](_0xec1d('0x60'),_0xec1d('0x61'));_0x54bcab[_0xec1d('0x62')]=_0x43f159;}else if(_0x3f6fce&&_0x3f6fce['recordingFormat']&&_0x3f6fce[_0xec1d('0x63')]!=='none'){logger[_0xec1d('0x10')](_0xec1d('0x64'),_0xec1d('0x61'));_0x54bcab[_0xec1d('0x62')]=_0x43f159;}else{_0x54bcab[_0xec1d('0x62')]='';}return getAdminUser(_0x1b9cae,_0x222ada,_0x2951c3,_0x468d52,_0x4a911f,_0xeef44c)[_0xec1d('0xc')](getUser(_0x1b9cae,_0x222ada,_0x468d52,_0x4a911f,_0xeef44c))['then'](getEndUser(_0x1b9cae,_0x222ada,_0x468d52,_0x4a911f,_0xeef44c))[_0xec1d('0xc')](getTicket(_0x1b9cae,_0x222ada,_0x468d52,_0x59cd03,_0x54bcab,_0x4a911f))[_0xec1d('0xc')](function(_0x4f623d){logger[_0xec1d('0x10')](util[_0xec1d('0x4e')](_0xec1d('0x65'),_0x4f623d[_0xec1d('0x66')]));logger[_0xec1d('0x10')](util[_0xec1d('0x4e')](_0xec1d('0x67'),_0x1b9cae));if(_0x1b9cae!==_0xec1d('0x5b')){logger[_0xec1d('0x10')]('['+[_0x1b9cae[_0xec1d('0x13')]()]+']',_0xec1d('0x68'));emit(_0x575959[_0xec1d('0x55')],_0x32a13a['name'],_0x4f623d[_0xec1d('0x66')]);}})[_0xec1d('0x1b')](function(_0x26b27b){logger[_0xec1d('0x12')]('['+[_0x1b9cae[_0xec1d('0x13')]()]+_0xec1d('0x69'),util[_0xec1d('0x6a')](_0x26b27b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf30a=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[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','inspect','lodash','bluebird','request-promise','util','md5','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','sys_id','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','true','System','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','toString','idField','content','variable','variableName','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','%s/api/now/table/','remoteUri','isNil','email','destcalleridnum','callDirection','unmanaged','queue'];(function(_0x22a972,_0x52aab7){var _0x325406=function(_0x170993){while(--_0x170993){_0x22a972['push'](_0x22a972['shift']());}};_0x325406(++_0x52aab7);}(_0xf30a,0x1c9));var _0xaf30=function(_0x3d4746,_0x23af49){_0x3d4746=_0x3d4746-0x0;var _0x3caee3=_0xf30a[_0x3d4746];return _0x3caee3;};'use strict';var _=require(_0xaf30('0x0'));var Promise=require(_0xaf30('0x1'));var rp=require(_0xaf30('0x2'));var util=require(_0xaf30('0x3'));var md5=require(_0xaf30('0x4'));var Redis=require('ioredis');var intUtil=require(_0xaf30('0x5'));var config=require(_0xaf30('0x6'));var logger=require('../../../../config/logger')('servicenow');config[_0xaf30('0x7')]=_[_0xaf30('0x8')](config[_0xaf30('0x7')],{'host':_0xaf30('0x9'),'port':0x18eb});var io=require(_0xaf30('0xa'))(new Redis(config[_0xaf30('0x7')]));function getAdminUser(_0x4b7b4a,_0x53660d,_0x3557be,_0x7959f9,_0x3bde69,_0x5a65c6){return new Promise(function(_0x5e74bf,_0x4aef19){var _0x2e46ac={'method':_0xaf30('0xb'),'uri':_0x7959f9+_0xaf30('0xc')+'&'+_0x3bde69+'&'+_0x5a65c6,'auth':_0x53660d,'json':!![]};return rp(_0x2e46ac)[_0xaf30('0xd')](function(_0xded333){if(_0xded333[_0xaf30('0xe')][_0xaf30('0xf')]>0x0){_0x3557be[_0xaf30('0x10')]=_0xded333[_0xaf30('0xe')][0x0]['sys_id'];}logger[_0xaf30('0x11')]('['+[_0x4b7b4a[_0xaf30('0x12')]()]+_0xaf30('0x13'),_0x3557be);_0x5e74bf(_0x3557be);})[_0xaf30('0x14')](function(_0x50c843){logger[_0xaf30('0x15')]('['+[_0x4b7b4a[_0xaf30('0x12')]()]+']',_0x50c843[_0xaf30('0x16')]);_0x4aef19(_0x50c843['message']);});});}function getUser(_0x4233db,_0x57fa0a,_0x1269b8,_0x2db83b,_0x508a13){return function(_0x2e6467){logger[_0xaf30('0x11')]('['+[_0x4233db['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x2e6467);return new Promise(function(_0x3f783d,_0x18a132){if(intUtil[_0xaf30('0x17')](_0x2e6467[_0xaf30('0x18')])){var _0xf27560={'method':_0xaf30('0xb'),'uri':_0x1269b8+_0xaf30('0x19')+_0x2e6467[_0xaf30('0x18')]+'&'+_0x2db83b+'&'+_0x508a13,'auth':_0x57fa0a,'json':!![]};logger['info']('['+[_0x4233db[_0xaf30('0x12')]()]+_0xaf30('0x1a'),_0xf27560);return rp(_0xf27560)['then'](function(_0x429914){logger[_0xaf30('0x11')]('['+[_0x4233db[_0xaf30('0x12')]()]+_0xaf30('0x1b'),_0x429914);if(_0x429914[_0xaf30('0xe')]['length']>0x0&&String(_0x429914[_0xaf30('0xe')][0x0][_0xaf30('0x1c')])==='true'){_0x2e6467[_0xaf30('0x1d')]=_0x429914[_0xaf30('0xe')][0x0][_0xaf30('0x1e')];}else{_0x2e6467[_0xaf30('0x1d')]=_0x2e6467[_0xaf30('0x10')];_0x2e6467[_0xaf30('0x18')]=_0x2e6467[_0xaf30('0x1f')];}logger[_0xaf30('0x11')]('['+[_0x4233db[_0xaf30('0x12')]()]+_0xaf30('0x20'),_0x2e6467);_0x3f783d(_0x2e6467);})[_0xaf30('0x14')](function(_0x2094cf){logger['error']('['+[_0x4233db['toUpperCase']()]+']',_0x2094cf[_0xaf30('0x16')]);_0x18a132(_0x2094cf[_0xaf30('0x16')]);});}else{logger['info']('['+[_0x4233db[_0xaf30('0x12')]()]+']\x20using\x20admin\x20profile');_0x2e6467[_0xaf30('0x1d')]=_0x2e6467['adminId'];_0x2e6467['userEmail']=_0x2e6467[_0xaf30('0x1f')];_0x3f783d(_0x2e6467);}});};}function createEndUser(_0x12bb9f,_0x463bee,_0x3071bb,_0x47d9ab,_0x30df6c){logger[_0xaf30('0x11')]('['+[_0x12bb9f[_0xaf30('0x12')]()]+_0xaf30('0x21'),_0x3071bb);return new Promise(function(_0x4eb503,_0xc061da){var _0x3dc9db={'method':_0xaf30('0x22'),'uri':_0x47d9ab+_0xaf30('0x23')+_0x30df6c,'body':{'user_name':_0x3071bb[_0xaf30('0x24')],'roles':'user','first_name':_0x3071bb[_0xaf30('0x24')],'active':_0xaf30('0x25'),'date_format':_0xaf30('0x26'),'phone':_0x3071bb[_0xaf30('0x24')]},'auth':_0x463bee,'json':!![]};return rp(_0x3dc9db)[_0xaf30('0xd')](function(_0x168876){logger[_0xaf30('0x11')]('['+[_0x12bb9f[_0xaf30('0x12')]()]+'],\x20EndUser\x20schema',_0x168876[_0xaf30('0xe')]);_0x3071bb[_0xaf30('0x27')]=_0x168876['result'][_0xaf30('0x1e')];_0x4eb503(_0x3071bb);})['catch'](function(_0x586141){logger['error']('['+[_0x12bb9f[_0xaf30('0x12')]()]+']',_0x586141[_0xaf30('0x16')]);_0xc061da(_0x586141['message']);});});}function getEndUser(_0x3ea369,_0x46d7ad,_0x35622a,_0x5d2965,_0x3ee120){return function(_0x58dbcf){logger[_0xaf30('0x11')]('['+[_0x3ea369[_0xaf30('0x12')]()]+_0xaf30('0x28'),_0x58dbcf);return new Promise(function(_0x1cc36a,_0x402fa2){var _0x1f548f={'method':_0xaf30('0xb'),'uri':_0x35622a+'sys_user?sysparm_query=phone%3D'+_0x58dbcf[_0xaf30('0x24')]+'&'+_0x5d2965+'&'+_0x3ee120,'auth':_0x46d7ad,'json':!![]};return rp(_0x1f548f)[_0xaf30('0xd')](function(_0x48fbd8){if(_0x48fbd8[_0xaf30('0xe')][_0xaf30('0xf')]>0x0){_0x58dbcf[_0xaf30('0x27')]=_0x48fbd8[_0xaf30('0xe')][0x0]['sys_id'];logger[_0xaf30('0x11')]('['+[_0x3ea369[_0xaf30('0x12')]()]+_0xaf30('0x29'),_0x58dbcf);_0x1cc36a(_0x58dbcf);}else{return createEndUser(_0x3ea369,_0x46d7ad,_0x58dbcf,_0x35622a,_0x5d2965)[_0xaf30('0xd')](function(_0x201e00){logger['info']('['+[_0x3ea369[_0xaf30('0x12')]()]+'],\x20createEndUser\x20crm',_0x201e00);_0x1cc36a(_0x201e00);});}})[_0xaf30('0x14')](function(_0x563243){logger['error']('['+[_0x3ea369[_0xaf30('0x12')]()]+']',_0x563243['message']);_0x402fa2(_0x563243[_0xaf30('0x16')]);});});};}function getCustomFields(_0x4d12dd,_0x14f887){var _0x4d479c={};if(_0x4d12dd[_0xaf30('0xf')]>0x0){_[_0xaf30('0x2a')](_0x4d12dd,function(_0x447061){if(_[_0xaf30('0x2b')](['string',_0xaf30('0x2c')],_0x447061[_0xaf30('0x2d')])&&_0x447061[_0xaf30('0x2e')]&&!_0x447061[_0xaf30('0x2f')]){_0x4d479c[_0x447061[_0xaf30('0x2e')][_0xaf30('0x30')]()]=_0x447061['content'][_0xaf30('0x31')]();}else if(_[_0xaf30('0x2b')](['string',_0xaf30('0x2c')],_0x447061[_0xaf30('0x2d')])&&_0x447061[_0xaf30('0x32')]&&_0x447061[_0xaf30('0x2f')]){_0x4d479c[_0x447061[_0xaf30('0x32')]['toLowerCase']()]=_0x447061[_0xaf30('0x33')][_0xaf30('0x31')]();}else if(_0x447061[_0xaf30('0x2d')]===_0xaf30('0x34')&&_0x447061['variableName']&&_0x447061[_0xaf30('0x32')]&&_0x447061[_0xaf30('0x2f')]){_0x4d479c[_0x447061[_0xaf30('0x32')]['toLowerCase']()]=_0x14f887[_0x447061[_0xaf30('0x35')]]['toString']();}else if(_0x447061['type']===_0xaf30('0x36')&&_0x447061['Variable']&&_0x447061['Variable'][_0xaf30('0x37')]&&_0x447061['idField']&&_0x447061[_0xaf30('0x2f')]){_0x4d479c[_0x447061[_0xaf30('0x32')][_0xaf30('0x30')]()]=_0x14f887[_0x447061[_0xaf30('0x38')][_0xaf30('0x37')][_0xaf30('0x30')]()][_0xaf30('0x31')]();}});}return _0x4d479c;}function getTicket(_0x264b4f,_0x5782ef,_0x393ee5,_0x590bee,_0x16c069,_0x5743ea){return function(_0x30ab1d){logger['info']('['+[_0x264b4f[_0xaf30('0x12')]()]+_0xaf30('0x39'),_0x30ab1d);return new Promise(function(_0x27435d,_0x3ce5eb){var _0x47261a=_0x264b4f[_0xaf30('0x30')]()===_0xaf30('0x3a')?_0x30ab1d[_0xaf30('0x1d')]:_0x30ab1d['endUserId'];var _0x16491d={'method':_0xaf30('0x22'),'uri':_0x393ee5+_0xaf30('0x3b')+'?'+_0x5743ea,'body':Object[_0xaf30('0x3c')]({},{'active':_0xaf30('0x25'),'caller_id':_0x47261a,'assigned_to':_0x30ab1d[_0xaf30('0x1d')],'short_description':intUtil[_0xaf30('0x3d')](_0x590bee['Subjects'],_0x16c069,'\x20'),'description':intUtil[_0xaf30('0x3d')](_0x590bee[_0xaf30('0x3e')],_0x16c069,'\x0a')},getCustomFields(_0x590bee[_0xaf30('0x3f')],_0x16c069)),'auth':_0x5782ef,'json':!![]};return rp(_0x16491d)[_0xaf30('0xd')](function(_0x169a02){logger[_0xaf30('0x11')]('['+[_0x264b4f[_0xaf30('0x12')]()]+_0xaf30('0x40'),_0x169a02['result']);_0x30ab1d[_0xaf30('0x41')]=_0x169a02[_0xaf30('0xe')]['sys_id'];_0x30ab1d['ticketNumber']=_0x169a02[_0xaf30('0xe')][_0xaf30('0x42')];logger[_0xaf30('0x11')]('['+[_0x264b4f['toUpperCase']()]+_0xaf30('0x43'),_0x30ab1d);_0x27435d(_0x30ab1d);})['catch'](function(_0x2ac1b9){logger['error']('['+[_0x264b4f[_0xaf30('0x12')]()]+']',_0x2ac1b9[_0xaf30('0x16')]);_0x3ce5eb(_0x2ac1b9[_0xaf30('0x16')]);});});};}function createRemoteTag(_0x880284,_0x3b00f0,_0x5d2a8a,_0x1d21bf){return new Promise(function(_0x2bb917,_0x3b5fb4){var _0x52282e={'method':'POST','uri':_0x5d2a8a+_0xaf30('0x44')+'?'+_0x1d21bf,'body':{'short_description':_0x880284,'global':!![],'active':!![],'name':_0x880284},'auth':_0x3b00f0,'json':!![]};return rp(_0x52282e)[_0xaf30('0xd')](function(_0x213cf7){var _0x54d6bb=_0x213cf7['result'][_0xaf30('0x1e')];_0x2bb917(_0x54d6bb);});});}function getRemoteTag(_0x26d00b,_0x439dee,_0x23d3ca,_0x1dd00e,_0x2eab1b){return new Promise(function(_0x242cfa,_0x1fa6de){var _0x3d24c8={'method':'GET','uri':_0x23d3ca+_0xaf30('0x44')+_0xaf30('0x45')+_0x26d00b+'&'+_0x1dd00e,'auth':_0x439dee,'json':!![]};return rp(_0x3d24c8)[_0xaf30('0xd')](function(_0x41e4de){if(_0x41e4de[_0xaf30('0xe')]['length']>0x0){var _0x3c58b5=_0x41e4de[_0xaf30('0xe')][0x0][_0xaf30('0x1e')];_0x242cfa(_0x3c58b5);}else{return createRemoteTag(_0x26d00b,_0x439dee,_0x23d3ca,_0x1dd00e)[_0xaf30('0xd')](function(_0x30f88e){_0x242cfa(_0x30f88e);});}});});}function assignTagToIncident(_0x57f352,_0x37a7ed,_0x3e912a,_0x530a61,_0x4afa47){return new Promise(function(_0x14336f,_0xe3661c){var _0xca1412={'method':_0xaf30('0x22'),'uri':_0x3e912a+_0xaf30('0x46')+'?'+_0x4afa47,'body':{'label':_0x57f352,'table':_0xaf30('0x3b'),'id_type':'Incident','table_key':_0x530a61[_0xaf30('0x41')],'title':_0xaf30('0x47')+_0x530a61['ticketNumber'],'id_display':_0x530a61[_0xaf30('0x48')]},'auth':_0x37a7ed,'json':!![]};return rp(_0xca1412)['then'](function(_0x4ef03f){_0x14336f();})['catch'](function(){_0x14336f();});});}function manageTags(_0x30cb39,_0x2abbf2,_0xc2f3c1,_0x584a3a,_0x558a50,_0x298f52,_0x43515c){return new Promise(function(_0xd1e2b3,_0x407c81){var _0x534aab=[];_0x2abbf2['forEach'](function(_0x31633d){_0x534aab[_0xaf30('0x49')](getRemoteTag(_0x31633d,_0xc2f3c1,_0x584a3a,_0x298f52,_0x43515c));});return Promise[_0xaf30('0x4a')](_0x534aab)[_0xaf30('0xd')](function(_0x15c877){if(_0x15c877['length']){logger[_0xaf30('0x11')]('['+[_0x30cb39[_0xaf30('0x12')]()]+_0xaf30('0x4b'),_0x15c877);var _0x5a1772=[];_0x15c877[_0xaf30('0x2a')](function(_0x537d8e){_0x5a1772[_0xaf30('0x49')](assignTagToIncident(_0x537d8e,_0xc2f3c1,_0x584a3a,_0x558a50,_0x298f52));});return Promise[_0xaf30('0x4a')](_0x5a1772)['then'](function(){_0xd1e2b3();})[_0xaf30('0x14')](function(){_0xd1e2b3();});}else{_0xd1e2b3();}});});}function getTags(_0x99b927,_0x3332f9,_0x365497,_0x46b924,_0x6b7905,_0x555a7f){return function(_0x35d48d){return new Promise(function(_0x2c0d17,_0x784c0f){var _0x42f9b9=[];var _0x1e9b57=_0x46b924[_0xaf30('0x4c')];if(_0x1e9b57&&_0x1e9b57[_0xaf30('0xf')]>0x0){_0x42f9b9=_[_0xaf30('0x4d')](_0x1e9b57,_0xaf30('0x37'));}if(_0x42f9b9[_0xaf30('0xf')]>0x0){return manageTags(_0x99b927,_0x42f9b9,_0x3332f9,_0x365497,_0x35d48d,_0x6b7905,_0x555a7f)['then'](function(){_0x2c0d17(_0x35d48d);});}else{_0x2c0d17(_0x35d48d);}});};}function emit(_0x31fcbb,_0x57d3ce,_0x4ffd21){var _0x4046f6=_0xaf30('0x4e')+_0xaf30('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xaf30('0x50');var _0x92d71f={'uri':_0x31fcbb+_0xaf30('0x51')+_0x4ffd21+_0x4046f6};io['to'](util[_0xaf30('0x52')](_0xaf30('0x53'),_0x57d3ce))[_0xaf30('0x54')]('trigger:browser:url',_0x92d71f);}exports['cs']=function(_0x11c07e,_0xe2b61b,_0x36f5ba,_0x229f89,_0xc381c1,_0x1e92f6,_0x257fae,_0x5eb3fc){var _0x4a94be={};var _0x24af48={'user':_0x1e92f6[_0xaf30('0x55')],'pass':_0x1e92f6[_0xaf30('0x56')]};var _0xa562ce=_0xaf30('0x57');var _0x392af6=_0xaf30('0x58');_0x1e92f6['remoteUri']=intUtil['stripTrailingSlash'](_0x1e92f6['remoteUri']);_0x1e92f6[_0xaf30('0x59')]=intUtil['stripTrailingSlash'](_0x1e92f6[_0xaf30('0x59')]);var _0x26be5a=util[_0xaf30('0x52')](_0xaf30('0x5a'),_0x1e92f6[_0xaf30('0x5b')]);_0x4a94be[_0xaf30('0x18')]=!_[_0xaf30('0x5c')](_0x229f89)?_0x229f89[_0xaf30('0x5d')]:null;_0x4a94be[_0xaf30('0x1f')]=_0x1e92f6[_0xaf30('0x5d')];_0x4a94be[_0xaf30('0x24')]=_0x5eb3fc[_0xaf30('0x30')]()==='outbound'?_0xe2b61b[_0xaf30('0x5e')]:_0xe2b61b['calleridnum'];_0x4a94be[_0xaf30('0x5f')]=_0x5eb3fc==='queue'||_0x5eb3fc===_0xaf30('0x60')?_0xaf30('0x61'):'outbound';var _0x32c7c0=util[_0xaf30('0x52')](_0xaf30('0x62'),_0x1e92f6[_0xaf30('0x59')],_0xe2b61b[_0xaf30('0x63')],md5(_0xe2b61b[_0xaf30('0x63')]));if(_0xc381c1&&_0xc381c1[_0xaf30('0x64')]){logger[_0xaf30('0x11')](_0xaf30('0x65'),_0xaf30('0x66'));_0xe2b61b[_0xaf30('0x67')]=_0x32c7c0;}else if(_0x257fae&&_0x257fae[_0xaf30('0x68')]&&_0x257fae[_0xaf30('0x68')]!==_0xaf30('0x69')){logger['info']('[OUTBOUND]',_0xaf30('0x66'));_0xe2b61b['recordingURL']=_0x32c7c0;}else{_0xe2b61b[_0xaf30('0x67')]='';}return getAdminUser(_0x5eb3fc,_0x24af48,_0x4a94be,_0x26be5a,_0x392af6,_0xa562ce)[_0xaf30('0xd')](getUser(_0x5eb3fc,_0x24af48,_0x26be5a,_0x392af6,_0xa562ce))[_0xaf30('0xd')](getEndUser(_0x5eb3fc,_0x24af48,_0x26be5a,_0x392af6,_0xa562ce))[_0xaf30('0xd')](getTicket(_0x5eb3fc,_0x24af48,_0x26be5a,_0x36f5ba,_0xe2b61b,_0x392af6))[_0xaf30('0xd')](function(_0x64312e){logger[_0xaf30('0x11')](util[_0xaf30('0x52')](_0xaf30('0x6a'),_0x64312e['ticketId']));logger[_0xaf30('0x11')](util[_0xaf30('0x52')](_0xaf30('0x6b'),_0x5eb3fc));if(_0x5eb3fc!==_0xaf30('0x60')){logger[_0xaf30('0x11')]('['+[_0x5eb3fc[_0xaf30('0x12')]()]+']',_0xaf30('0x6c'));emit(_0x1e92f6[_0xaf30('0x5b')],_0x229f89[_0xaf30('0x37')],_0x64312e['ticketId']);}})[_0xaf30('0x14')](function(_0x315777){logger[_0xaf30('0x15')]('['+[_0x5eb3fc[_0xaf30('0x12')]()]+_0xaf30('0x6d'),util[_0xaf30('0x6e')](_0x315777,{'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 b6efd9b..06e9fff 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 _0x6a71=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','lastevent','toUpperCase','isNil','Inbound','lodash','request-promise','bluebird','md5','ioredis','../../../../config/environment','defaults','redis','localhost','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','description','getString','Descriptions','date_start','replace','duration_hours','duration_minutes','parent_id','length','forEach','push','idField','variableName','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','toLowerCase','customField','custom_fields','content','variable','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','outbound','recordingFormat','none','destcalleridname','Outbound','users'];(function(_0x2d5dcf,_0xf71498){var _0x42a3e8=function(_0xaa41d8){while(--_0xaa41d8){_0x2d5dcf['push'](_0x2d5dcf['shift']());}};_0x42a3e8(++_0xf71498);}(_0x6a71,0x15f));var _0x16a7=function(_0x13cfca,_0x20fa91){_0x13cfca=_0x13cfca-0x0;var _0x950904=_0x6a71[_0x13cfca];return _0x950904;};'use strict';var _=require(_0x16a7('0x0'));var rp=require(_0x16a7('0x1'));var BPromise=require(_0x16a7('0x2'));var md5=require(_0x16a7('0x3'));var util=require('util');var Redis=require(_0x16a7('0x4'));var intUtil=require('./util');var config=require(_0x16a7('0x5'));var logger=require('../../../../config/logger')('sugarcrm');config['redis']=_[_0x16a7('0x6')](config[_0x16a7('0x7')],{'host':_0x16a7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16a7('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x163248,_0x33d021,_0x5b7d02){io['to'](_0x163248)[_0x16a7('0x9')](_0x33d021,_0x5b7d02);}function getTicket(_0x1fd44d,_0x8a99f4,_0x40472c,_0x5121b0,_0x5c6419,_0xd0c3b2,_0x24cde7,_0x131ddf){logger[_0x16a7('0xa')](_0x16a7('0xb'));var _0x10f923=new Date();var _0x13e93c=[{'name':_0x16a7('0xc'),'value':intUtil['getString'](_0x5121b0[_0x16a7('0xd')],_0x5c6419,'\x20')},{'name':_0x16a7('0xe'),'value':_0x8a99f4['id']},{'name':'created_by','value':_0x8a99f4['id']},{'name':_0x16a7('0xf'),'value':intUtil[_0x16a7('0x10')](_0x5121b0[_0x16a7('0x11')],_0x5c6419,'\x0a')},{'name':_0x16a7('0x12'),'value':_0x10f923['toISOString']()['slice'](0x0,0x13)[_0x16a7('0x13')]('T','\x20')},{'name':_0x16a7('0x14'),'value':'0'},{'name':_0x16a7('0x15'),'value':'15'},{'name':_0x16a7('0x16'),'value':_0x40472c['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0x40472c['name']},{'name':'direction','value':_0x131ddf}];if(_0xd0c3b2[_0x16a7('0x17')]){_[_0x16a7('0x18')](_0xd0c3b2,function(_0x2e5649){if(_0x5c6419[_0x2e5649['variableName']]){_0x13e93c[_0x16a7('0x19')]({'name':_0x2e5649[_0x16a7('0x1a')],'value':_0x5c6419[_0x2e5649[_0x16a7('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x16a7('0x1c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x24cde7['id'],'module_name':_0x16a7('0x1d'),'name_value_list':_0x13e93c})}});}function getAuth(_0x2badda){return util['format'](_0x16a7('0x1e'),new Buffer(_0x2badda[_0x16a7('0x1f')]+':X')[_0x16a7('0x20')](_0x16a7('0x21')));}function getServerInfo(_0x2550e6){return request({'form':{'method':_0x16a7('0x22'),'input_type':'JSON','response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x2550e6['id']})}});}function getUser(_0x1b544c,_0x324f22,_0x1def83){if(!_['isNil'](_0x324f22)){logger[_0x16a7('0xa')](_0x16a7('0x24'),_0x324f22);return request({'form':{'method':'get_entry_list','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x1def83['id'],'module_name':_0x16a7('0x25'),'query':util[_0x16a7('0x26')](_0x16a7('0x27'),_0x324f22),'order_by':'','offset':'0','select_fields':['id',_0x16a7('0xc'),_0x16a7('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x16a7('0x29')](function(_0x119d4e){if(_0x119d4e[_0x16a7('0x2a')]['length']){var _0x1b9d61=_[_0x16a7('0x2b')](_0x119d4e[_0x16a7('0x2a')],function(_0xcdba12){return _0xcdba12[_0x16a7('0x2c')][_0x16a7('0x28')][_0x16a7('0x2d')]===_0x324f22;});if(_0x1b9d61){logger[_0x16a7('0xa')]('Agent\x20found!');return BPromise[_0x16a7('0x2e')]({'id':_0x1b9d61[_0x16a7('0x2c')]['id']['value'],'name':_0x1b9d61[_0x16a7('0x2c')][_0x16a7('0xc')][_0x16a7('0x2d')]});}}logger[_0x16a7('0xa')](_0x16a7('0x2f'));return BPromise[_0x16a7('0x2e')]({'id':_0x1def83[_0x16a7('0x2c')][_0x16a7('0x30')][_0x16a7('0x2d')],'name':_0x1def83[_0x16a7('0x2c')][_0x16a7('0x28')][_0x16a7('0x2d')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x16a7('0x2e')]({'id':_0x1def83['name_value_list']['user_id'][_0x16a7('0x2d')],'name':_0x1def83[_0x16a7('0x2c')][_0x16a7('0x28')][_0x16a7('0x2d')]});}}function getEndUser(_0x58104a,_0x25f3d0,_0x46df1b,_0x29e378){logger[_0x16a7('0xa')](_0x16a7('0x31'),_0x46df1b);return request({'form':{'method':'get_entry_list','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x29e378['id'],'module_name':_0x16a7('0x32'),'query':util[_0x16a7('0x26')](_0x16a7('0x33'),_0x46df1b),'order_by':'','offset':'0','select_fields':['id',_0x16a7('0xc'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3aff47){if(_0x3aff47[_0x16a7('0x2a')]['length']){var _0x53d6e1=_[_0x16a7('0x2b')](_0x3aff47['entry_list'],function(_0xfdc7b0){return _0xfdc7b0[_0x16a7('0x2c')][_0x16a7('0x34')]['value']===_0x46df1b;});if(_0x53d6e1){logger[_0x16a7('0xa')](_0x16a7('0x35'));return BPromise[_0x16a7('0x2e')]({'id':_0x53d6e1['name_value_list']['id'][_0x16a7('0x2d')],'name':_0x53d6e1[_0x16a7('0x2c')]['name'][_0x16a7('0x2d')],'phone':_0x53d6e1[_0x16a7('0x2c')][_0x16a7('0x34')][_0x16a7('0x2d')]});}}else{logger['info'](_0x16a7('0x36'));return request({'form':{'method':'set_entry','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x29e378['id'],'module_name':_0x16a7('0x32'),'name_value_list':[{'name':_0x16a7('0x37'),'value':_0x25f3d0!==_0x16a7('0x38')?_0x25f3d0:util[_0x16a7('0x26')](_0x16a7('0x39'),_0x46df1b)},{'name':_0x16a7('0x34'),'value':_0x46df1b}]})}})[_0x16a7('0x29')](function(_0x1f510b){logger[_0x16a7('0xa')](_0x16a7('0x3a'));return BPromise['resolve']({'id':_0x1f510b['id'],'name':_0x1f510b[_0x16a7('0x2a')]['first_name'][_0x16a7('0x2d')],'phone':_0x1f510b['entry_list']['phone_home']['value']});});}});}function request(_0x113c9b){logger[_0x16a7('0x3b')](_0x16a7('0x3c'),JSON['stringify'](_0x113c9b));return rp(_[_0x16a7('0x3d')](def,_0x113c9b));}function getTags(_0x493475,_0x42b357){var _0x2436d3=[];if(_0x493475&&_0x493475[_0x16a7('0x17')]>0x0){_0x2436d3=_[_0x16a7('0x3e')](_0x493475,_0x42b357);}return _0x2436d3;}function getCustomFields(_0x591547,_0x398a2c){var _0x20cc26=[];var _0x58e9b5={'custom_fields':[]};if(_0x591547[_0x16a7('0x17')]>0x0){_['forEach'](_0x591547,function(_0x113301){if(_0x113301[_0x16a7('0x3f')]===_0x16a7('0x40')&&_0x113301['nameField']&&!_0x113301['customField']){_0x58e9b5[_0x113301['nameField'][_0x16a7('0x41')]()]=_0x113301['content']['toString']();}else if(_0x113301['type']===_0x16a7('0x40')&&_0x113301[_0x16a7('0x1a')]&&_0x113301[_0x16a7('0x42')]){_0x58e9b5[_0x16a7('0x43')][_0x16a7('0x19')]({'id':_0x113301[_0x16a7('0x1a')],'value':_0x113301[_0x16a7('0x44')]['toString']()});}else if(_0x113301['type']===_0x16a7('0x45')&&_0x113301['variableName']&&_0x113301[_0x16a7('0x1a')]&&_0x113301[_0x16a7('0x42')]){_0x398a2c[_0x113301[_0x16a7('0x1b')]]&&_0x58e9b5[_0x16a7('0x43')][_0x16a7('0x19')]({'id':_0x113301[_0x16a7('0x1a')],'value':_0x398a2c[_0x113301['variableName']][_0x16a7('0x20')]()});}else if(_0x113301['type']===_0x16a7('0x46')&&_0x113301[_0x16a7('0x47')]&&_0x113301[_0x16a7('0x47')][_0x16a7('0xc')]&&_0x113301[_0x16a7('0x1a')]&&_0x113301[_0x16a7('0x42')]){_0x398a2c[_0x113301[_0x16a7('0x47')][_0x16a7('0xc')]['toLowerCase']()]&&_0x58e9b5[_0x16a7('0x43')][_0x16a7('0x19')]({'id':_0x113301[_0x16a7('0x1a')],'value':_0x398a2c[_0x113301['Variable'][_0x16a7('0xc')][_0x16a7('0x41')]()][_0x16a7('0x20')]()});}});}return _0x58e9b5;}function getConnection(_0x5475d4){return request({'method':'POST','form':{'method':'login','input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'user_auth':{'user_name':_0x5475d4[_0x16a7('0x48')],'password':_0x5475d4[_0x16a7('0x49')],'encryption':_0x16a7('0x4a')},'application':_0x16a7('0x4b')})}})[_0x16a7('0x29')](function(_0x253327){var _0x515a0a=_0x253327;if(_0x515a0a['id']){def['sessionID']=_0x515a0a['id'];return BPromise[_0x16a7('0x2e')](_0x515a0a);}else{throw new Error(util[_0x16a7('0x26')]('Account\x20%d\x20is\x20not\x20valid',_0x5475d4['id']));}});}function setRelationship(_0x5c10bf,_0x41b67e,_0xf11a3b,_0x2041cc){return request({'form':{'method':_0x16a7('0x4c'),'input_type':_0x16a7('0x1c'),'response_type':_0x16a7('0x1c'),'rest_data':JSON[_0x16a7('0x23')]({'session':_0x5c10bf['id'],'module_name':'Calls','module_id':_0xf11a3b['id'],'link_field_name':_0x2041cc,'related_ids':[_0x41b67e['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x16a7('0x4d')]=function(_0x5e22e4,_0x376416,_0x20d2d7,_0x445c80,_0x4ca125,_0x464a6f){var _0x592209,_0x16f613,_0x1b441e,_0x2e35ec;_0x464a6f['remoteUri']=intUtil[_0x16a7('0x4e')](_0x464a6f[_0x16a7('0x4f')]);_0x464a6f['serverUrl']=intUtil['stripTrailingSlash'](_0x464a6f[_0x16a7('0x50')]);def[_0x16a7('0x51')]=util['format'](_0x16a7('0x52'),_0x464a6f[_0x16a7('0x4f')]);if(_0x4ca125&&_0x4ca125[_0x16a7('0x53')]){logger[_0x16a7('0xa')](_0x16a7('0x54'),_0x16a7('0x55'));_0x376416['recordingURL']=util[_0x16a7('0x26')](_0x16a7('0x56'),_0x464a6f[_0x16a7('0x50')],_0x376416[_0x16a7('0x57')],md5(_0x376416[_0x16a7('0x57')]));}else{_0x376416[_0x16a7('0x58')]='';}return getConnection(_0x464a6f)[_0x16a7('0x29')](function(_0x441153){_0x2e35ec=_0x441153;return getUser(_0x464a6f,_0x445c80[_0x16a7('0xc')],_0x2e35ec);})['then'](function(_0x27f616){_0x592209=_0x27f616;logger['info'](_0x16a7('0x59'),_0x592209['id']);return getEndUser(_0x464a6f,_0x376416[_0x16a7('0x5a')],_0x376416[_0x16a7('0x5b')],_0x2e35ec);})[_0x16a7('0x29')](function(_0x8d7c3){_0x16f613=_0x8d7c3;logger['info'](_0x16a7('0x5c'),_0x16f613['id']);return getTicket(_0x464a6f,_0x592209,_0x16f613,_0x20d2d7,_0x376416,_0x20d2d7[_0x16a7('0x5d')],_0x2e35ec,'Inbound');})[_0x16a7('0x29')](function(_0x13a2e1){_0x1b441e=_0x13a2e1;logger[_0x16a7('0xa')](_0x16a7('0x5e'));logger['info'](_0x16a7('0x5f'),_0x1b441e['id']);return setRelationship(_0x2e35ec,_0x592209,_0x1b441e,'users');})[_0x16a7('0x29')](function(){return setRelationship(_0x2e35ec,_0x16f613,_0x1b441e,_0x16a7('0x60'));})[_0x16a7('0x29')](function(){return getServerInfo(_0x2e35ec);})[_0x16a7('0x29')](function(_0x2df775){var _0x594dde=parseInt(_0x2df775[_0x16a7('0x61')][_0x16a7('0x62')](0x0));var _0x959b36=util[_0x16a7('0x26')](_0x16a7('0x63'),_0x464a6f['remoteUri'],_0x1b441e['id']);if(_0x594dde>0x6){_0x959b36=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x464a6f[_0x16a7('0x4f')],_0x1b441e['id']);}logger[_0x16a7('0xa')](_0x16a7('0x54'),_0x16a7('0x64'));emit(util[_0x16a7('0x26')]('user:%s',_0x445c80[_0x16a7('0xc')]),_0x16a7('0x65'),{'uri':_0x959b36});})[_0x16a7('0x66')](function(_0x594c48){logger['error'](_0x16a7('0x54'),JSON[_0x16a7('0x23')](_0x594c48));});};exports[_0x16a7('0x67')]=function(_0x426f5b,_0x17da0e,_0x2ec7bb,_0xbe9c80,_0xc075e9,_0x292299,_0x22fed7){var _0x4f13f9,_0x2e2303,_0x1a2c87,_0x5a9982;_0x292299['remoteUri']=intUtil[_0x16a7('0x4e')](_0x292299[_0x16a7('0x4f')]);_0x292299[_0x16a7('0x50')]=intUtil[_0x16a7('0x4e')](_0x292299[_0x16a7('0x50')]);def['uri']=util[_0x16a7('0x26')](_0x16a7('0x52'),_0x292299['remoteUri']);if(_0x22fed7&&_0x22fed7[_0x16a7('0x68')]&&_0x22fed7[_0x16a7('0x68')]!==_0x16a7('0x69')){logger[_0x16a7('0xa')]('[OUTBOUND]',_0x16a7('0x55'));_0x17da0e[_0x16a7('0x58')]=util[_0x16a7('0x26')](_0x16a7('0x56'),_0x292299[_0x16a7('0x50')],_0x17da0e[_0x16a7('0x57')],md5(_0x17da0e[_0x16a7('0x57')]));}return getConnection(_0x292299)[_0x16a7('0x29')](function(_0x31b6d9){_0x5a9982=_0x31b6d9;return getUser(_0x292299,_0xbe9c80['name'],_0x5a9982);})[_0x16a7('0x29')](function(_0x5388c4){_0x4f13f9=_0x5388c4;logger['info']('The\x20User\x20ID\x20is:',_0x4f13f9['id']);return getEndUser(_0x292299,_0x17da0e[_0x16a7('0x6a')],_0x17da0e['destcalleridnum'],_0x5a9982);})[_0x16a7('0x29')](function(_0x2af40e){_0x2e2303=_0x2af40e;logger[_0x16a7('0xa')](_0x16a7('0x5c'),_0x2e2303['id']);return getTicket(_0x292299,_0x4f13f9,_0x2e2303,_0x2ec7bb,_0x17da0e,_0x2ec7bb['Fields'],_0x5a9982,_0x16a7('0x6b'));})[_0x16a7('0x29')](function(_0x3b14e1){_0x1a2c87=_0x3b14e1;logger['info']('Ticket\x20created!');logger[_0x16a7('0xa')](_0x16a7('0x5f'),_0x1a2c87['id']);return setRelationship(_0x5a9982,_0x4f13f9,_0x1a2c87,_0x16a7('0x6c'));})[_0x16a7('0x29')](function(){return setRelationship(_0x5a9982,_0x2e2303,_0x1a2c87,_0x16a7('0x60'));})[_0x16a7('0x29')](function(){return getServerInfo(_0x5a9982);})['then'](function(_0x42b3f1){var _0x5001f5=parseInt(_0x42b3f1[_0x16a7('0x61')][_0x16a7('0x62')](0x0));var _0x280391=util[_0x16a7('0x26')](_0x16a7('0x63'),_0x292299[_0x16a7('0x4f')],_0x1a2c87['id']);if(_0x5001f5>0x6){_0x280391=util[_0x16a7('0x26')](_0x16a7('0x6d'),_0x292299[_0x16a7('0x4f')],_0x1a2c87['id']);}logger[_0x16a7('0xa')]('[OUTBOUND]',_0x16a7('0x64'));emit(util[_0x16a7('0x26')]('user:%s',_0xbe9c80['name']),'trigger:browser:url',{'uri':_0x280391});})[_0x16a7('0x66')](function(_0x5bb44f){logger[_0x16a7('0x6e')]('[OUTBOUND]',JSON[_0x16a7('0x23')](_0x5bb44f));});};exports['unmanaged']=function(_0x236474,_0x1fc29f,_0x2c6b95,_0x2a8875,_0x3f22b9,_0x4cb13d){var _0x579552,_0x38f9b7,_0x305132,_0x53da78;_0x4cb13d[_0x16a7('0x4f')]=intUtil['stripTrailingSlash'](_0x4cb13d['remoteUri']);_0x4cb13d[_0x16a7('0x50')]=intUtil[_0x16a7('0x4e')](_0x4cb13d[_0x16a7('0x50')]);def[_0x16a7('0x51')]=util[_0x16a7('0x26')](_0x16a7('0x52'),_0x4cb13d[_0x16a7('0x4f')]);if(_0x3f22b9&&_0x3f22b9['monitor_format']){logger['info']('['+_0x1fc29f[_0x16a7('0x6f')][_0x16a7('0x70')]()+']',_0x16a7('0x55'));_0x1fc29f[_0x16a7('0x58')]=util[_0x16a7('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4cb13d[_0x16a7('0x50')],_0x1fc29f['uniqueid'],md5(_0x1fc29f[_0x16a7('0x57')]));}else{_0x1fc29f[_0x16a7('0x58')]='';}return getConnection(_0x4cb13d)[_0x16a7('0x29')](function(_0x1a660e){_0x53da78=_0x1a660e;if(!_[_0x16a7('0x71')](_0x2a8875)){return getUser(_0x4cb13d,_0x2a8875['name'],_0x53da78);}else{return getUser(_0x4cb13d,null,_0x53da78);}})[_0x16a7('0x29')](function(_0x2c5d2f){_0x579552=_0x2c5d2f;logger['info'](_0x16a7('0x59'),_0x579552['id']);return getEndUser(_0x4cb13d,_0x1fc29f[_0x16a7('0x5a')],_0x1fc29f[_0x16a7('0x5b')],_0x53da78);})[_0x16a7('0x29')](function(_0x58b65d){_0x38f9b7=_0x58b65d;logger[_0x16a7('0xa')](_0x16a7('0x5c'),_0x38f9b7['id']);return getTicket(_0x4cb13d,_0x579552,_0x38f9b7,_0x2c6b95,_0x1fc29f,_0x2c6b95[_0x16a7('0x5d')],_0x53da78,_0x16a7('0x72'));})['then'](function(_0x99021c){_0x305132=_0x99021c;logger['info'](_0x16a7('0x5e'));logger[_0x16a7('0xa')](_0x16a7('0x5f'),_0x305132['id']);return setRelationship(_0x53da78,_0x579552,_0x305132,_0x16a7('0x6c'));})[_0x16a7('0x29')](function(){return setRelationship(_0x53da78,_0x38f9b7,_0x305132,_0x16a7('0x60'));})['then'](function(){return getServerInfo(_0x53da78);})[_0x16a7('0x66')](function(_0x5a5e9f){logger[_0x16a7('0x6e')]('['+_0x1fc29f[_0x16a7('0x6f')][_0x16a7('0x70')]()+']',JSON[_0x16a7('0x23')](_0x5a5e9f));});}; \ No newline at end of file +var _0x57ea=['set_entry','JSON','Calls','Basic\x20%s','toString','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','then','entry_list','length','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','debug','[HTTP]','merge','type','string','customField','nameField','toLowerCase','content','idField','variable','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','error','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','forEach','variableName','push'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x57ea,0x14c));var _0xa57e=function(_0x16e6db,_0x2e5a01){_0x16e6db=_0x16e6db-0x0;var _0x5a9151=_0x57ea[_0x16e6db];return _0x5a9151;};'use strict';var _=require(_0xa57e('0x0'));var rp=require(_0xa57e('0x1'));var BPromise=require('bluebird');var md5=require(_0xa57e('0x2'));var util=require(_0xa57e('0x3'));var Redis=require(_0xa57e('0x4'));var intUtil=require('./util');var config=require(_0xa57e('0x5'));var logger=require(_0xa57e('0x6'))(_0xa57e('0x7'));config['redis']=_[_0xa57e('0x8')](config['redis'],{'host':_0xa57e('0x9'),'port':0x18eb});var io=require(_0xa57e('0xa'))(new Redis(config[_0xa57e('0xb')]));var def={'method':_0xa57e('0xc'),'json':!![]};function emit(_0x5653b4,_0x18c613,_0x32290d){io['to'](_0x5653b4)[_0xa57e('0xd')](_0x18c613,_0x32290d);}function getTicket(_0x175ef5,_0x56b530,_0x3c7080,_0x3dfe13,_0x55f623,_0x4382cb,_0x446d42,_0xc8e3ef){logger[_0xa57e('0xe')](_0xa57e('0xf'));var _0xeb5756=new Date();var _0x1662c0=[{'name':_0xa57e('0x10'),'value':intUtil[_0xa57e('0x11')](_0x3dfe13[_0xa57e('0x12')],_0x55f623,'\x20')},{'name':_0xa57e('0x13'),'value':_0x56b530['id']},{'name':_0xa57e('0x14'),'value':_0x56b530['id']},{'name':_0xa57e('0x15'),'value':intUtil[_0xa57e('0x11')](_0x3dfe13[_0xa57e('0x16')],_0x55f623,'\x0a')},{'name':_0xa57e('0x17'),'value':_0xeb5756[_0xa57e('0x18')]()[_0xa57e('0x19')](0x0,0x13)[_0xa57e('0x1a')]('T','\x20')},{'name':_0xa57e('0x1b'),'value':'0'},{'name':_0xa57e('0x1c'),'value':'15'},{'name':_0xa57e('0x1d'),'value':_0x3c7080['id']},{'name':_0xa57e('0x1e'),'value':'Contacts'},{'name':'parent_name','value':_0x3c7080[_0xa57e('0x10')]},{'name':'direction','value':_0xc8e3ef}];if(_0x4382cb['length']){_[_0xa57e('0x1f')](_0x4382cb,function(_0x3b8302){if(_0x55f623[_0x3b8302[_0xa57e('0x20')]]){_0x1662c0[_0xa57e('0x21')]({'name':_0x3b8302['idField'],'value':_0x55f623[_0x3b8302['variableName']]});}});}return request({'form':{'method':_0xa57e('0x22'),'input_type':'JSON','response_type':_0xa57e('0x23'),'rest_data':JSON['stringify']({'session':_0x446d42['id'],'module_name':_0xa57e('0x24'),'name_value_list':_0x1662c0})}});}function getAuth(_0x41b066){return util['format'](_0xa57e('0x25'),new Buffer(_0x41b066['apiKey']+':X')[_0xa57e('0x26')]('base64'));}function getServerInfo(_0x6e7bc4){return request({'form':{'method':_0xa57e('0x27'),'input_type':_0xa57e('0x23'),'response_type':_0xa57e('0x23'),'rest_data':JSON[_0xa57e('0x28')]({'session':_0x6e7bc4['id']})}});}function getUser(_0x4556d6,_0x47394b,_0x295043){if(!_[_0xa57e('0x29')](_0x47394b)){logger[_0xa57e('0xe')](_0xa57e('0x2a'),_0x47394b);return request({'form':{'method':_0xa57e('0x2b'),'input_type':_0xa57e('0x23'),'response_type':_0xa57e('0x23'),'rest_data':JSON['stringify']({'session':_0x295043['id'],'module_name':_0xa57e('0x2c'),'query':util[_0xa57e('0x2d')](_0xa57e('0x2e'),_0x47394b),'order_by':'','offset':'0','select_fields':['id',_0xa57e('0x10'),_0xa57e('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa57e('0x30')](function(_0x2fbc1f){if(_0x2fbc1f[_0xa57e('0x31')][_0xa57e('0x32')]){var _0x4155c5=_['find'](_0x2fbc1f['entry_list'],function(_0x262194){return _0x262194[_0xa57e('0x33')][_0xa57e('0x2f')][_0xa57e('0x34')]===_0x47394b;});if(_0x4155c5){logger[_0xa57e('0xe')](_0xa57e('0x35'));return BPromise['resolve']({'id':_0x4155c5[_0xa57e('0x33')]['id'][_0xa57e('0x34')],'name':_0x4155c5['name_value_list'][_0xa57e('0x10')]['value']});}}logger[_0xa57e('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xa57e('0x36')]({'id':_0x295043[_0xa57e('0x33')][_0xa57e('0x37')][_0xa57e('0x34')],'name':_0x295043[_0xa57e('0x33')][_0xa57e('0x2f')][_0xa57e('0x34')]});});}else{logger[_0xa57e('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x295043[_0xa57e('0x33')]['user_id']['value'],'name':_0x295043[_0xa57e('0x33')][_0xa57e('0x2f')]['value']});}}function getEndUser(_0x55a1a6,_0x15c2a7,_0x2f35e3,_0x4c0003){logger[_0xa57e('0xe')](_0xa57e('0x38'),_0x2f35e3);return request({'form':{'method':_0xa57e('0x2b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xa57e('0x28')]({'session':_0x4c0003['id'],'module_name':_0xa57e('0x39'),'query':util[_0xa57e('0x2d')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x2f35e3),'order_by':'','offset':'0','select_fields':['id',_0xa57e('0x10'),_0xa57e('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3d4c62){if(_0x3d4c62['entry_list'][_0xa57e('0x32')]){var _0x15749=_[_0xa57e('0x3b')](_0x3d4c62[_0xa57e('0x31')],function(_0x59846a){return _0x59846a[_0xa57e('0x33')][_0xa57e('0x3a')][_0xa57e('0x34')]===_0x2f35e3;});if(_0x15749){logger[_0xa57e('0xe')](_0xa57e('0x3c'));return BPromise[_0xa57e('0x36')]({'id':_0x15749[_0xa57e('0x33')]['id']['value'],'name':_0x15749['name_value_list']['name']['value'],'phone':_0x15749[_0xa57e('0x33')]['phone_home'][_0xa57e('0x34')]});}}else{logger[_0xa57e('0xe')](_0xa57e('0x3d'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xa57e('0x23'),'rest_data':JSON[_0xa57e('0x28')]({'session':_0x4c0003['id'],'module_name':_0xa57e('0x39'),'name_value_list':[{'name':_0xa57e('0x3e'),'value':_0x15c2a7!==''?_0x15c2a7:util[_0xa57e('0x2d')](_0xa57e('0x3f'),_0x2f35e3)},{'name':_0xa57e('0x3a'),'value':_0x2f35e3}]})}})[_0xa57e('0x30')](function(_0x2039bc){logger['info']('Enduser\x20created.');return BPromise[_0xa57e('0x36')]({'id':_0x2039bc['id'],'name':_0x2039bc[_0xa57e('0x31')][_0xa57e('0x3e')][_0xa57e('0x34')],'phone':_0x2039bc[_0xa57e('0x31')][_0xa57e('0x3a')][_0xa57e('0x34')]});});}});}function request(_0x20c466){logger[_0xa57e('0x40')](_0xa57e('0x41'),JSON[_0xa57e('0x28')](_0x20c466));return rp(_[_0xa57e('0x42')](def,_0x20c466));}function getTags(_0x3ce9b7,_0x58cc44){var _0x1f8980=[];if(_0x3ce9b7&&_0x3ce9b7[_0xa57e('0x32')]>0x0){_0x1f8980=_['map'](_0x3ce9b7,_0x58cc44);}return _0x1f8980;}function getCustomFields(_0x528e63,_0x40ff35){var _0x394d00=[];var _0x490ab5={'custom_fields':[]};if(_0x528e63['length']>0x0){_['forEach'](_0x528e63,function(_0x27decf){if(_0x27decf[_0xa57e('0x43')]===_0xa57e('0x44')&&_0x27decf['nameField']&&!_0x27decf[_0xa57e('0x45')]){_0x490ab5[_0x27decf[_0xa57e('0x46')][_0xa57e('0x47')]()]=_0x27decf[_0xa57e('0x48')][_0xa57e('0x26')]();}else if(_0x27decf[_0xa57e('0x43')]===_0xa57e('0x44')&&_0x27decf[_0xa57e('0x49')]&&_0x27decf[_0xa57e('0x45')]){_0x490ab5['custom_fields'][_0xa57e('0x21')]({'id':_0x27decf[_0xa57e('0x49')],'value':_0x27decf[_0xa57e('0x48')]['toString']()});}else if(_0x27decf[_0xa57e('0x43')]===_0xa57e('0x4a')&&_0x27decf[_0xa57e('0x20')]&&_0x27decf[_0xa57e('0x49')]&&_0x27decf[_0xa57e('0x45')]){_0x40ff35[_0x27decf[_0xa57e('0x20')]]&&_0x490ab5['custom_fields'][_0xa57e('0x21')]({'id':_0x27decf[_0xa57e('0x49')],'value':_0x40ff35[_0x27decf[_0xa57e('0x20')]][_0xa57e('0x26')]()});}else if(_0x27decf[_0xa57e('0x43')]===_0xa57e('0x4b')&&_0x27decf['Variable']&&_0x27decf[_0xa57e('0x4c')][_0xa57e('0x10')]&&_0x27decf['idField']&&_0x27decf[_0xa57e('0x45')]){_0x40ff35[_0x27decf[_0xa57e('0x4c')]['name'][_0xa57e('0x47')]()]&&_0x490ab5['custom_fields'][_0xa57e('0x21')]({'id':_0x27decf[_0xa57e('0x49')],'value':_0x40ff35[_0x27decf[_0xa57e('0x4c')][_0xa57e('0x10')]['toLowerCase']()][_0xa57e('0x26')]()});}});}return _0x490ab5;}function getConnection(_0x2a3010){return request({'method':'POST','form':{'method':_0xa57e('0x4d'),'input_type':_0xa57e('0x23'),'response_type':_0xa57e('0x23'),'rest_data':JSON[_0xa57e('0x28')]({'user_auth':{'user_name':_0x2a3010['username'],'password':_0x2a3010[_0xa57e('0x4e')],'encryption':_0xa57e('0x4f')},'application':_0xa57e('0x50')})}})[_0xa57e('0x30')](function(_0xb35556){var _0x3fb7d9=_0xb35556;if(_0x3fb7d9['id']){def[_0xa57e('0x51')]=_0x3fb7d9['id'];return BPromise[_0xa57e('0x36')](_0x3fb7d9);}else{throw new Error(util[_0xa57e('0x2d')](_0xa57e('0x52'),_0x2a3010['id']));}});}function setRelationship(_0x2db84c,_0x38c569,_0x5d2e84,_0x1ad49d){return request({'form':{'method':_0xa57e('0x53'),'input_type':_0xa57e('0x23'),'response_type':_0xa57e('0x23'),'rest_data':JSON[_0xa57e('0x28')]({'session':_0x2db84c['id'],'module_name':_0xa57e('0x24'),'module_id':_0x5d2e84['id'],'link_field_name':_0x1ad49d,'related_ids':[_0x38c569['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x466dbe,_0x30bbca,_0x411e50,_0x3b5c5c,_0x25c3a7,_0x215ec5){var _0x1d0702,_0x43041e,_0x338e49,_0x196b45;_0x215ec5[_0xa57e('0x54')]=intUtil[_0xa57e('0x55')](_0x215ec5[_0xa57e('0x54')]);_0x215ec5[_0xa57e('0x56')]=intUtil['stripTrailingSlash'](_0x215ec5[_0xa57e('0x56')]);def[_0xa57e('0x57')]=util['format'](_0xa57e('0x58'),_0x215ec5[_0xa57e('0x54')]);if(_0x25c3a7&&_0x25c3a7['monitor_format']){logger[_0xa57e('0xe')](_0xa57e('0x59'),'Recording\x20is\x20enabled!');_0x30bbca[_0xa57e('0x5a')]=util[_0xa57e('0x2d')](_0xa57e('0x5b'),_0x215ec5[_0xa57e('0x56')],_0x30bbca[_0xa57e('0x5c')],md5(_0x30bbca[_0xa57e('0x5c')]));}else{_0x30bbca[_0xa57e('0x5a')]='';}return getConnection(_0x215ec5)[_0xa57e('0x30')](function(_0x5701ff){_0x196b45=_0x5701ff;return getUser(_0x215ec5,_0x3b5c5c[_0xa57e('0x10')],_0x196b45);})['then'](function(_0x10e126){_0x1d0702=_0x10e126;logger['info'](_0xa57e('0x5d'),_0x1d0702['id']);return getEndUser(_0x215ec5,_0x30bbca['calleridname'],_0x30bbca['calleridnum'],_0x196b45);})[_0xa57e('0x30')](function(_0x50475f){_0x43041e=_0x50475f;logger[_0xa57e('0xe')](_0xa57e('0x5e'),_0x43041e['id']);return getTicket(_0x215ec5,_0x1d0702,_0x43041e,_0x411e50,_0x30bbca,_0x411e50[_0xa57e('0x5f')],_0x196b45,_0xa57e('0x60'));})[_0xa57e('0x30')](function(_0x443c13){_0x338e49=_0x443c13;logger[_0xa57e('0xe')](_0xa57e('0x61'));logger[_0xa57e('0xe')](_0xa57e('0x62'),_0x338e49['id']);return setRelationship(_0x196b45,_0x1d0702,_0x338e49,'users');})[_0xa57e('0x30')](function(){return setRelationship(_0x196b45,_0x43041e,_0x338e49,_0xa57e('0x63'));})[_0xa57e('0x30')](function(){return getServerInfo(_0x196b45);})[_0xa57e('0x30')](function(_0x311f7b){var _0x57e550=parseInt(_0x311f7b[_0xa57e('0x64')][_0xa57e('0x65')](0x0));var _0x36f3a3=util['format'](_0xa57e('0x66'),_0x215ec5[_0xa57e('0x54')],_0x338e49['id']);if(_0x57e550>0x6){_0x36f3a3=util[_0xa57e('0x2d')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x215ec5['remoteUri'],_0x338e49['id']);}logger[_0xa57e('0xe')]('[QUEUE]',_0xa57e('0x67'));emit(util[_0xa57e('0x2d')](_0xa57e('0x68'),_0x3b5c5c[_0xa57e('0x10')]),_0xa57e('0x69'),{'uri':_0x36f3a3});})[_0xa57e('0x6a')](function(_0x528e7f){logger['error'](_0xa57e('0x59'),JSON['stringify'](_0x528e7f));});};exports[_0xa57e('0x6b')]=function(_0x84b535,_0x5eca9b,_0xc40381,_0x486457,_0x3f30c2,_0x32dbae,_0x3b9434){var _0x205924,_0x425012,_0x3e5dd0,_0x137999;_0x32dbae['remoteUri']=intUtil[_0xa57e('0x55')](_0x32dbae[_0xa57e('0x54')]);_0x32dbae[_0xa57e('0x56')]=intUtil['stripTrailingSlash'](_0x32dbae[_0xa57e('0x56')]);def[_0xa57e('0x57')]=util[_0xa57e('0x2d')](_0xa57e('0x58'),_0x32dbae['remoteUri']);if(_0x3b9434&&_0x3b9434[_0xa57e('0x6c')]&&_0x3b9434[_0xa57e('0x6c')]!==_0xa57e('0x6d')){logger[_0xa57e('0xe')](_0xa57e('0x6e'),_0xa57e('0x6f'));_0x5eca9b[_0xa57e('0x5a')]=util[_0xa57e('0x2d')](_0xa57e('0x5b'),_0x32dbae[_0xa57e('0x56')],_0x5eca9b['uniqueid'],md5(_0x5eca9b['uniqueid']));}return getConnection(_0x32dbae)[_0xa57e('0x30')](function(_0x30d9bc){_0x137999=_0x30d9bc;return getUser(_0x32dbae,_0x486457['name'],_0x137999);})[_0xa57e('0x30')](function(_0x394cf2){_0x205924=_0x394cf2;logger[_0xa57e('0xe')](_0xa57e('0x5d'),_0x205924['id']);return getEndUser(_0x32dbae,_0x5eca9b[_0xa57e('0x70')],_0x5eca9b[_0xa57e('0x71')],_0x137999);})[_0xa57e('0x30')](function(_0xb2084c){_0x425012=_0xb2084c;logger['info'](_0xa57e('0x5e'),_0x425012['id']);return getTicket(_0x32dbae,_0x205924,_0x425012,_0xc40381,_0x5eca9b,_0xc40381[_0xa57e('0x5f')],_0x137999,'Outbound');})['then'](function(_0x268b9e){_0x3e5dd0=_0x268b9e;logger[_0xa57e('0xe')](_0xa57e('0x61'));logger[_0xa57e('0xe')](_0xa57e('0x62'),_0x3e5dd0['id']);return setRelationship(_0x137999,_0x205924,_0x3e5dd0,_0xa57e('0x72'));})[_0xa57e('0x30')](function(){return setRelationship(_0x137999,_0x425012,_0x3e5dd0,'contacts');})[_0xa57e('0x30')](function(){return getServerInfo(_0x137999);})[_0xa57e('0x30')](function(_0x323a42){var _0x530401=parseInt(_0x323a42[_0xa57e('0x64')][_0xa57e('0x65')](0x0));var _0x48eb2b=util[_0xa57e('0x2d')](_0xa57e('0x66'),_0x32dbae[_0xa57e('0x54')],_0x3e5dd0['id']);if(_0x530401>0x6){_0x48eb2b=util[_0xa57e('0x2d')](_0xa57e('0x73'),_0x32dbae[_0xa57e('0x54')],_0x3e5dd0['id']);}logger['info'](_0xa57e('0x6e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xa57e('0x68'),_0x486457[_0xa57e('0x10')]),_0xa57e('0x69'),{'uri':_0x48eb2b});})['catch'](function(_0x36c348){logger[_0xa57e('0x74')](_0xa57e('0x6e'),JSON[_0xa57e('0x28')](_0x36c348));});};exports[_0xa57e('0x75')]=function(_0x22ce5f,_0x19b690,_0x26cd94,_0x574d1d,_0x193c92,_0x10c8de){var _0x5e83b1,_0x535ef5,_0x6cc98b,_0x280065;_0x10c8de[_0xa57e('0x54')]=intUtil['stripTrailingSlash'](_0x10c8de[_0xa57e('0x54')]);_0x10c8de[_0xa57e('0x56')]=intUtil[_0xa57e('0x55')](_0x10c8de[_0xa57e('0x56')]);def[_0xa57e('0x57')]=util['format'](_0xa57e('0x58'),_0x10c8de[_0xa57e('0x54')]);if(_0x193c92&&_0x193c92[_0xa57e('0x76')]){logger[_0xa57e('0xe')]('['+_0x19b690[_0xa57e('0x77')][_0xa57e('0x78')]()+']',_0xa57e('0x6f'));_0x19b690[_0xa57e('0x5a')]=util[_0xa57e('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x10c8de[_0xa57e('0x56')],_0x19b690[_0xa57e('0x5c')],md5(_0x19b690[_0xa57e('0x5c')]));}else{_0x19b690[_0xa57e('0x5a')]='';}return getConnection(_0x10c8de)[_0xa57e('0x30')](function(_0x2313e3){_0x280065=_0x2313e3;if(!_['isNil'](_0x574d1d)){return getUser(_0x10c8de,_0x574d1d['name'],_0x280065);}else{return getUser(_0x10c8de,null,_0x280065);}})['then'](function(_0x33b686){_0x5e83b1=_0x33b686;logger[_0xa57e('0xe')](_0xa57e('0x5d'),_0x5e83b1['id']);return getEndUser(_0x10c8de,_0x19b690['calleridname'],_0x19b690[_0xa57e('0x79')],_0x280065);})[_0xa57e('0x30')](function(_0x2da772){_0x535ef5=_0x2da772;logger['info'](_0xa57e('0x5e'),_0x535ef5['id']);return getTicket(_0x10c8de,_0x5e83b1,_0x535ef5,_0x26cd94,_0x19b690,_0x26cd94[_0xa57e('0x5f')],_0x280065,_0xa57e('0x60'));})[_0xa57e('0x30')](function(_0x2c241b){_0x6cc98b=_0x2c241b;logger[_0xa57e('0xe')](_0xa57e('0x61'));logger[_0xa57e('0xe')]('The\x20Ticket\x20ID\x20is:',_0x6cc98b['id']);return setRelationship(_0x280065,_0x5e83b1,_0x6cc98b,_0xa57e('0x72'));})[_0xa57e('0x30')](function(){return setRelationship(_0x280065,_0x535ef5,_0x6cc98b,_0xa57e('0x63'));})[_0xa57e('0x30')](function(){return getServerInfo(_0x280065);})[_0xa57e('0x6a')](function(_0x266d5e){logger[_0xa57e('0x74')]('['+_0x19b690[_0xa57e('0x77')][_0xa57e('0x78')]()+']',JSON['stringify'](_0x266d5e));});}; \ 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 48dd62a..412b70a 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 _0x5b2a=['string','key','format','%s:\x20%s','join','slice','substring','validateEmail','isNil','lodash','util','getString','sortBy','type','content','variable','variableName','customVariable','Variable','toLowerCase','push','toString','keyValue','keyType'];(function(_0x582d69,_0x406136){var _0x3ae6f8=function(_0x5e71c4){while(--_0x5e71c4){_0x582d69['push'](_0x582d69['shift']());}};_0x3ae6f8(++_0x406136);}(_0x5b2a,0x69));var _0xa5b2=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x5b2a[_0x1e393b];return _0x3d0bfe;};'use strict';var _=require(_0xa5b2('0x0'));var util=require(_0xa5b2('0x1'));exports[_0xa5b2('0x2')]=function(_0x5e72e5,_0x123fa4,_0x7efabd){var _0x3aa6d7=[];if(_0x5e72e5['length']>0x0){var _0xdec989=_[_0xa5b2('0x3')](_0x5e72e5,['id']);for(var _0x3a4e29=0x0;_0x3a4e29<_0xdec989['length'];_0x3a4e29++){var _0x5737ef=_0xdec989[_0x3a4e29];if(_0x5737ef[_0xa5b2('0x4')]==='string'){_0x3aa6d7['push'](_0x5737ef[_0xa5b2('0x5')]);}else if(_0x5737ef['type']===_0xa5b2('0x6')&&_0x5737ef[_0xa5b2('0x7')]){_0x123fa4[_0x5737ef[_0xa5b2('0x7')]]&&_0x3aa6d7['push'](_0x123fa4[_0x5737ef[_0xa5b2('0x7')]]['toString']());}else if(_0x5737ef['type']===_0xa5b2('0x8')&&_0x5737ef[_0xa5b2('0x9')]&&_0x5737ef[_0xa5b2('0x9')]['name']){_0x123fa4[_0x5737ef[_0xa5b2('0x9')]['name'][_0xa5b2('0xa')]()]&&_0x3aa6d7[_0xa5b2('0xb')](_0x123fa4[_0x5737ef[_0xa5b2('0x9')]['name'][_0xa5b2('0xa')]()][_0xa5b2('0xc')]());}else if(_0x5737ef['type']===_0xa5b2('0xd')){if(_0x5737ef[_0xa5b2('0xe')]===_0xa5b2('0xf')&&_0x5737ef[_0xa5b2('0x10')]){_0x3aa6d7[_0xa5b2('0xb')](util[_0xa5b2('0x11')](_0xa5b2('0x12'),_0x5737ef[_0xa5b2('0x10')],_0x5737ef['keyContent']));}else if(_0x5737ef[_0xa5b2('0xe')]===_0xa5b2('0x6')&&_0x5737ef[_0xa5b2('0x7')]&&_0x5737ef['key']){_0x123fa4[_0x5737ef['variableName']]&&_0x3aa6d7[_0xa5b2('0xb')](util[_0xa5b2('0x11')](_0xa5b2('0x12'),_0x5737ef[_0xa5b2('0x10')],_0x123fa4[_0x5737ef[_0xa5b2('0x7')]]));}else if(_0x5737ef[_0xa5b2('0xe')]===_0xa5b2('0x8')&&_0x5737ef[_0xa5b2('0x9')]&&_0x5737ef[_0xa5b2('0x9')]['name']&&_0x5737ef[_0xa5b2('0x10')]){_0x123fa4[_0x5737ef['Variable']['name'][_0xa5b2('0xa')]()]&&_0x3aa6d7['push'](util[_0xa5b2('0x11')](_0xa5b2('0x12'),_0x5737ef[_0xa5b2('0x10')],_0x123fa4[_0x5737ef[_0xa5b2('0x9')]['name']['toLowerCase']()]));}}}}return _0x3aa6d7[_0xa5b2('0x13')](_0x7efabd);};exports['stripTrailingSlash']=function(_0x49148a){var _0x6f349a=_0x49148a[_0xa5b2('0x14')](-0x1);if(_0x6f349a==='/'){_0x49148a=_0x49148a[_0xa5b2('0x15')](0x0,_0x49148a['lastIndexOf'](_0x6f349a));}return _0x49148a;};exports[_0xa5b2('0x16')]=function(_0xe2ad7b){if(!_[_0xa5b2('0x17')](_0xe2ad7b)&&_0xe2ad7b!==''){var _0x2e0cb4=/^(([^<>()\[\]\\.,;:\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 _0x2e0cb4['test'](String(_0xe2ad7b)[_0xa5b2('0xa')]());}else{return![];}}; \ No newline at end of file +var _0xed9b=['push','content','variable','variableName','toString','Variable','name','toLowerCase','keyValue','key','format','%s:\x20%s','customVariable','join','slice','substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','type','string'];(function(_0x3c486c,_0x4b79ce){var _0x93032f=function(_0x15645f){while(--_0x15645f){_0x3c486c['push'](_0x3c486c['shift']());}};_0x93032f(++_0x4b79ce);}(_0xed9b,0x117));var _0xbed9=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0xed9b[_0x479509];return _0x382da8;};'use strict';var _=require(_0xbed9('0x0'));var util=require(_0xbed9('0x1'));exports[_0xbed9('0x2')]=function(_0x378e05,_0x3ffbf6,_0x27aec4){var _0x3759b4=[];if(_0x378e05[_0xbed9('0x3')]>0x0){var _0x30baa8=_[_0xbed9('0x4')](_0x378e05,['id']);for(var _0x55f7df=0x0;_0x55f7df<_0x30baa8['length'];_0x55f7df++){var _0x4c8bb1=_0x30baa8[_0x55f7df];if(_0x4c8bb1[_0xbed9('0x5')]===_0xbed9('0x6')){_0x3759b4[_0xbed9('0x7')](_0x4c8bb1[_0xbed9('0x8')]);}else if(_0x4c8bb1['type']===_0xbed9('0x9')&&_0x4c8bb1[_0xbed9('0xa')]){_0x3ffbf6[_0x4c8bb1[_0xbed9('0xa')]]&&_0x3759b4[_0xbed9('0x7')](_0x3ffbf6[_0x4c8bb1[_0xbed9('0xa')]][_0xbed9('0xb')]());}else if(_0x4c8bb1[_0xbed9('0x5')]==='customVariable'&&_0x4c8bb1['Variable']&&_0x4c8bb1[_0xbed9('0xc')]['name']){_0x3ffbf6[_0x4c8bb1[_0xbed9('0xc')][_0xbed9('0xd')]['toLowerCase']()]&&_0x3759b4[_0xbed9('0x7')](_0x3ffbf6[_0x4c8bb1[_0xbed9('0xc')][_0xbed9('0xd')][_0xbed9('0xe')]()]['toString']());}else if(_0x4c8bb1[_0xbed9('0x5')]===_0xbed9('0xf')){if(_0x4c8bb1['keyType']===_0xbed9('0x6')&&_0x4c8bb1[_0xbed9('0x10')]){_0x3759b4[_0xbed9('0x7')](util[_0xbed9('0x11')](_0xbed9('0x12'),_0x4c8bb1[_0xbed9('0x10')],_0x4c8bb1['keyContent']));}else if(_0x4c8bb1['keyType']===_0xbed9('0x9')&&_0x4c8bb1['variableName']&&_0x4c8bb1[_0xbed9('0x10')]){_0x3ffbf6[_0x4c8bb1[_0xbed9('0xa')]]&&_0x3759b4[_0xbed9('0x7')](util['format'](_0xbed9('0x12'),_0x4c8bb1[_0xbed9('0x10')],_0x3ffbf6[_0x4c8bb1[_0xbed9('0xa')]]));}else if(_0x4c8bb1['keyType']===_0xbed9('0x13')&&_0x4c8bb1[_0xbed9('0xc')]&&_0x4c8bb1[_0xbed9('0xc')][_0xbed9('0xd')]&&_0x4c8bb1[_0xbed9('0x10')]){_0x3ffbf6[_0x4c8bb1[_0xbed9('0xc')][_0xbed9('0xd')][_0xbed9('0xe')]()]&&_0x3759b4['push'](util[_0xbed9('0x11')](_0xbed9('0x12'),_0x4c8bb1[_0xbed9('0x10')],_0x3ffbf6[_0x4c8bb1[_0xbed9('0xc')][_0xbed9('0xd')]['toLowerCase']()]));}}}}return _0x3759b4[_0xbed9('0x14')](_0x27aec4);};exports['stripTrailingSlash']=function(_0xc1866d){var _0x57cbab=_0xc1866d[_0xbed9('0x15')](-0x1);if(_0x57cbab==='/'){_0xc1866d=_0xc1866d[_0xbed9('0x16')](0x0,_0xc1866d[_0xbed9('0x17')](_0x57cbab));}return _0xc1866d;};exports['validateEmail']=function(_0x5b330e){if(!_[_0xbed9('0x18')](_0x5b330e)&&_0x5b330e!==''){var _0x14955a=/^(([^<>()\[\]\\.,;:\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 _0x14955a[_0xbed9('0x19')](String(_0x5b330e)[_0xbed9('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 62e8666..1412603 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 _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','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','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5800e4,_0x8ead45){var _0x1f8902=function(_0x5de2f6){while(--_0x5de2f6){_0x5800e4['push'](_0x5800e4['shift']());}};_0x1f8902(++_0x8ead45);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','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','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x2acd64,_0x4e8ce8){var _0x3d3fce=function(_0x5570df){while(--_0x5570df){_0x2acd64['push'](_0x2acd64['shift']());}};_0x3d3fce(++_0x4e8ce8);}(_0xe706,0xa3));var _0x6e70=function(_0x254abd,_0x1ab7f0){_0x254abd=_0x254abd-0x0;var _0x31bf1b=_0xe706[_0x254abd];return _0x31bf1b;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ 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 8c2291a..cf44bda 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 _0x102d=['email','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','destcalleridnum','The\x20Enduser\x20ID\x20is:','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','replace','inspect','unmanaged','toUpperCase','The\x20User\x20ID\x20is:','lastevent','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','format','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','Basic\x20%s','toString','base64','debug','forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','variable','variableName','custom_fields','push','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x102d,0x8c));var _0xd102=function(_0x1664bb,_0x280c18){_0x1664bb=_0x1664bb-0x0;var _0x4cdeb0=_0x102d[_0x1664bb];return _0x4cdeb0;};'use strict';var _=require('lodash');var rp=require(_0xd102('0x0'));var md5=require(_0xd102('0x1'));var util=require(_0xd102('0x2'));var Redis=require(_0xd102('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd102('0x4'))(_0xd102('0x5'));config[_0xd102('0x6')]=_[_0xd102('0x7')](config[_0xd102('0x6')],{'host':_0xd102('0x8'),'port':0x18eb});var io=require(_0xd102('0x9'))(new Redis(config[_0xd102('0x6')]));function emit(_0x2d0b47,_0x47c24a,_0x3d7512){io['to'](_0x2d0b47)[_0xd102('0xa')](_0x47c24a,_0x3d7512);}var headers={'Content-Type':_0xd102('0xb'),'Accept':_0xd102('0xb')};function getTicket(_0x2921ed,_0x1fc048,_0x21bb11,_0xa2f6f8,_0x4e41fe){logger[_0xd102('0xc')](_0xd102('0xd'));return request({'uri':util['format'](_0xd102('0xe'),_0x2921ed[_0xd102('0xf')]),'method':_0xd102('0x10'),'body':{'ticket':_[_0xd102('0x11')]({'requester_id':_0x21bb11['id'],'submitter_id':_0x1fc048?_0x1fc048['id']:undefined,'assignee_id':_0x1fc048?_0x1fc048['id']:undefined,'tags':getTags(_0xa2f6f8[_0xd102('0x12')],_0xd102('0x13')),'subject':intUtil[_0xd102('0x14')](_0xa2f6f8[_0xd102('0x15')],_0x4e41fe,'\x20'),'description':intUtil[_0xd102('0x14')](_0xa2f6f8[_0xd102('0x16')],_0x4e41fe,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0xa2f6f8[_0xd102('0x16')],_0x4e41fe,'\x0a')}},getCustomFields(_0xa2f6f8['Fields'],_0x4e41fe))}})[_0xd102('0x17')](function(_0x18a86e){logger['info'](_0xd102('0x18'));return _0x18a86e[_0xd102('0x19')];});}function getUser(_0x442f54,_0x25e7b1){if(intUtil[_0xd102('0x1a')](_0x25e7b1)){logger[_0xd102('0xc')](_0xd102('0x1b'),_0x25e7b1);return request({'uri':util['format'](_0xd102('0x1c'),_0x442f54['remoteUri']),'qs':{'query':util[_0xd102('0x1d')](_0xd102('0x1e'),_0x25e7b1)}})[_0xd102('0x17')](function(_0x11555a){if(_0x11555a[_0xd102('0x1f')]){logger[_0xd102('0xc')]('Agent\x20found!');return _[_0xd102('0x20')](_0x11555a['results'],{'email':_0x25e7b1,'role':_0xd102('0x21')});}else{logger[_0xd102('0xc')](_0xd102('0x22'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x23'),_0x442f54[_0xd102('0xf')])})[_0xd102('0x17')](function(_0x162ea3){logger[_0xd102('0xc')](_0xd102('0x24'));return _0x162ea3['user'];});}});}else{logger[_0xd102('0xc')](_0xd102('0x22'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x23'),_0x442f54[_0xd102('0xf')])})[_0xd102('0x17')](function(_0x5216df){logger[_0xd102('0xc')](_0xd102('0x24'));return _0x5216df[_0xd102('0x25')];});}}function getEndUser(_0x4710e5,_0x4f8130,_0x38591e){logger[_0xd102('0xc')](_0xd102('0x26'),_0x38591e);return request({'uri':util[_0xd102('0x1d')](_0xd102('0x1c'),_0x4710e5[_0xd102('0xf')]),'qs':{'query':util[_0xd102('0x1d')]('type:user\x20role:end-user\x20phone:%s',_0x38591e)}})[_0xd102('0x17')](function(_0x10ad2a){var _0x27cd2d;if(_0x10ad2a[_0xd102('0x27')][_0xd102('0x28')]){_0x10ad2a['results']=_[_0xd102('0x29')](_0x10ad2a[_0xd102('0x27')],{'suspended':![],'role':_0xd102('0x2a')});if(_0x10ad2a[_0xd102('0x27')]['length']){_0x27cd2d=_[_0xd102('0x2b')](_0x10ad2a[_0xd102('0x27')]);}}if(_0x27cd2d){logger['info'](_0xd102('0x2c'));return _0x27cd2d;}else{logger[_0xd102('0xc')](_0xd102('0x2d'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x2e'),_0x4710e5[_0xd102('0xf')]),'method':_0xd102('0x10'),'body':{'user':{'role':'end-user','name':util[_0xd102('0x1d')](_0xd102('0x2f'),_0x4f8130||_0x38591e),'phone':_0x38591e}}})[_0xd102('0x17')](function(_0x43bead){logger[_0xd102('0xc')](_0xd102('0x30'));return _0x43bead[_0xd102('0x25')];});}});}function getAuth(_0x34922f){var _0x1049ef;if(_0x34922f[_0xd102('0x31')]===_0xd102('0x32')){_0x1049ef=util[_0xd102('0x1d')](_0xd102('0x33'),_0x34922f[_0xd102('0x34')],_0x34922f[_0xd102('0x32')]);}else if(_0x34922f[_0xd102('0x31')]==='token'){_0x1049ef=util[_0xd102('0x1d')](_0xd102('0x35'),_0x34922f['username'],_0x34922f['token']);}return util[_0xd102('0x1d')](_0xd102('0x36'),new Buffer(_0x1049ef)[_0xd102('0x37')](_0xd102('0x38')));}function request(_0x448eb2){logger[_0xd102('0x39')]('[HTTP]',JSON['stringify'](_0x448eb2));return rp(_['defaults'](_0x448eb2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5ccd02,_0x570222){var _0x2ee293=[];if(_0x5ccd02&&_0x5ccd02['length']>0x0){_0x2ee293=_['map'](_0x5ccd02,_0x570222);}return _0x2ee293;}function getCustomFields(_0x23f0f7,_0x59eb4c){var _0x4afb83=[];var _0x360771={'custom_fields':[]};if(_0x23f0f7['length']>0x0){_[_0xd102('0x3a')](_0x23f0f7,function(_0x4b4317){if(_[_0xd102('0x3b')]([_0xd102('0x3c'),'picklist'],_0x4b4317[_0xd102('0x3d')])&&_0x4b4317['nameField']&&!_0x4b4317[_0xd102('0x3e')]){_0x360771[_0x4b4317[_0xd102('0x3f')][_0xd102('0x40')]()]=_0x4b4317[_0xd102('0x41')][_0xd102('0x37')]();}else if(_[_0xd102('0x3b')]([_0xd102('0x3c'),_0xd102('0x42')],_0x4b4317[_0xd102('0x3d')])&&_0x4b4317[_0xd102('0x43')]&&_0x4b4317[_0xd102('0x3e')]){_0x360771['custom_fields']['push']({'id':_0x4b4317[_0xd102('0x43')],'value':_0x4b4317[_0xd102('0x41')][_0xd102('0x37')]()});}else if(_0x4b4317[_0xd102('0x3d')]===_0xd102('0x44')&&_0x4b4317[_0xd102('0x45')]&&_0x4b4317[_0xd102('0x43')]&&_0x4b4317['customField']){_0x59eb4c[_0x4b4317[_0xd102('0x45')]]&&_0x360771[_0xd102('0x46')][_0xd102('0x47')]({'id':_0x4b4317['idField'],'value':_0x59eb4c[_0x4b4317['variableName']][_0xd102('0x37')]()});}else if(_0x4b4317[_0xd102('0x3d')]===_0xd102('0x48')&&_0x4b4317[_0xd102('0x49')]&&_0x4b4317[_0xd102('0x49')][_0xd102('0x13')]&&_0x4b4317[_0xd102('0x43')]&&_0x4b4317[_0xd102('0x3e')]){_0x59eb4c[_0x4b4317[_0xd102('0x49')]['name'][_0xd102('0x40')]()]&&_0x360771[_0xd102('0x46')][_0xd102('0x47')]({'id':_0x4b4317[_0xd102('0x43')],'value':_0x59eb4c[_0x4b4317[_0xd102('0x49')][_0xd102('0x13')]['toLowerCase']()][_0xd102('0x37')]()});}});}return _0x360771;}exports[_0xd102('0x4a')]=function(_0x125324,_0x1613f8,_0x578271,_0x4cd3d0,_0x45b837,_0x4e38dd){var _0xf28f62,_0x56cc55;_0x4e38dd[_0xd102('0xf')]=intUtil['stripTrailingSlash'](_0x4e38dd[_0xd102('0xf')]);_0x4e38dd[_0xd102('0x4b')]=intUtil[_0xd102('0x4c')](_0x4e38dd[_0xd102('0x4b')]);if(_0x45b837&&_0x45b837[_0xd102('0x4d')]){logger[_0xd102('0xc')](_0xd102('0x4e'),_0xd102('0x4f'));_0x1613f8[_0xd102('0x50')]=util[_0xd102('0x1d')](_0xd102('0x51'),_0x4e38dd[_0xd102('0x4b')],_0x1613f8['uniqueid'],md5(_0x1613f8[_0xd102('0x52')]));}else{_0x1613f8['recordingURL']='';}headers[_0xd102('0x53')]=getAuth(_0x4e38dd);return getUser(_0x4e38dd,_0x4cd3d0[_0xd102('0x54')])[_0xd102('0x17')](function(_0x238c4d){_0xf28f62=_0x238c4d;logger['info']('The\x20User\x20ID\x20is:',_0xf28f62['id']);return getEndUser(_0x4e38dd,_0x1613f8[_0xd102('0x55')],_0x1613f8[_0xd102('0x56')]);})[_0xd102('0x17')](function(_0x686b7a){_0x56cc55=_0x686b7a;logger[_0xd102('0xc')]('The\x20Enduser\x20ID\x20is:',_0x56cc55['id']);return getTicket(_0x4e38dd,_0xf28f62,_0x56cc55,_0x578271,_0x1613f8);})[_0xd102('0x17')](function(_0x37b9b2){if(_0x37b9b2){logger['info'](_0xd102('0x57'),_0x37b9b2['id']);switch(_0x4e38dd['type']){case _0xd102('0x58'):logger[_0xd102('0xc')](_0xd102('0x4e'),_0xd102('0x59'));return request({'uri':util[_0xd102('0x1d')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e38dd[_0xd102('0xf')],_0xf28f62['id'],_0x37b9b2['id']),'method':_0xd102('0x10')});case'newTab':logger[_0xd102('0xc')](_0xd102('0x4e'),_0xd102('0x5a'));emit(util[_0xd102('0x1d')](_0xd102('0x5b'),_0x4cd3d0['name']),_0xd102('0x5c'),{'uri':util['format']('%s/agent/tickets/%s',_0x4e38dd[_0xd102('0xf')]['replace'](_0xd102('0x5d'),''),_0x37b9b2['id'])});break;default:logger[_0xd102('0x5e')](_0xd102('0x4e'),_0xd102('0x5f'));}}})[_0xd102('0x60')](function(_0x120b1c){logger[_0xd102('0x5e')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x120b1c,{'showHidden':!![],'depth':null}));});};exports[_0xd102('0x61')]=function(_0x24c23d,_0x212e2e,_0x3ebb93,_0x25bced,_0xb697f3,_0x4535da,_0x30bdd2){var _0x4e16e3,_0x44c20c;_0x4535da[_0xd102('0xf')]=intUtil[_0xd102('0x4c')](_0x4535da[_0xd102('0xf')]);_0x4535da[_0xd102('0x4b')]=intUtil[_0xd102('0x4c')](_0x4535da[_0xd102('0x4b')]);if(_0x30bdd2&&_0x30bdd2[_0xd102('0x62')]&&_0x30bdd2[_0xd102('0x62')]!==_0xd102('0x63')){logger['info']('[OUTBOUND]',_0xd102('0x4f'));_0x212e2e[_0xd102('0x50')]=util[_0xd102('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4535da[_0xd102('0x4b')],_0x212e2e[_0xd102('0x52')],md5(_0x212e2e['uniqueid']));}headers['Authorization']=getAuth(_0x4535da);return getUser(_0x4535da,_0x25bced[_0xd102('0x54')])['then'](function(_0x1092f5){_0x4e16e3=_0x1092f5;logger[_0xd102('0xc')]('The\x20User\x20ID\x20is:',_0x4e16e3['id']);return getEndUser(_0x4535da,_0x212e2e['destcalleridname'],_0x212e2e[_0xd102('0x64')]);})[_0xd102('0x17')](function(_0x470982){_0x44c20c=_0x470982;logger['info'](_0xd102('0x65'),_0x44c20c['id']);return getTicket(_0x4535da,_0x4e16e3,_0x44c20c,_0x3ebb93,_0x212e2e);})[_0xd102('0x17')](function(_0x27f2db){if(_0x27f2db){logger[_0xd102('0xc')](_0xd102('0x57'),_0x27f2db['id']);switch(_0x4535da[_0xd102('0x3d')]){case _0xd102('0x58'):logger[_0xd102('0xc')](_0xd102('0x66'),_0xd102('0x59'));return request({'uri':util[_0xd102('0x1d')](_0xd102('0x67'),_0x4535da[_0xd102('0xf')],_0x4e16e3['id'],_0x27f2db['id']),'method':_0xd102('0x10')});case'newTab':logger[_0xd102('0xc')](_0xd102('0x66'),_0xd102('0x5a'));emit(util['format'](_0xd102('0x5b'),_0x25bced[_0xd102('0x13')]),'trigger:browser:url',{'uri':util[_0xd102('0x1d')](_0xd102('0x68'),_0x4535da[_0xd102('0xf')][_0xd102('0x69')](_0xd102('0x5d'),''),_0x27f2db['id'])});break;default:logger[_0xd102('0x5e')](_0xd102('0x66'),_0xd102('0x5f'));}}})[_0xd102('0x60')](function(_0x404815){logger[_0xd102('0x5e')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd102('0x6a')](_0x404815,{'showHidden':!![],'depth':null}));});};exports[_0xd102('0x6b')]=function(_0x5d1b4e,_0x2378e5,_0x10220e,_0x2a704d,_0x528d63,_0x343e2c){var _0x290d9,_0x633fbe;_0x343e2c['remoteUri']=intUtil[_0xd102('0x4c')](_0x343e2c[_0xd102('0xf')]);_0x343e2c['serverUrl']=intUtil[_0xd102('0x4c')](_0x343e2c[_0xd102('0x4b')]);if(_0x528d63&&_0x528d63['monitor_format']){logger[_0xd102('0xc')]('['+_0x2378e5['lastevent'][_0xd102('0x6c')]()+']',_0xd102('0x4f'));_0x2378e5[_0xd102('0x50')]=util['format'](_0xd102('0x51'),_0x343e2c[_0xd102('0x4b')],_0x2378e5['uniqueid'],md5(_0x2378e5['uniqueid']));}else{_0x2378e5[_0xd102('0x50')]='';}headers[_0xd102('0x53')]=getAuth(_0x343e2c);return getUser(_0x343e2c)[_0xd102('0x17')](function(_0x4da47a){_0x290d9=_0x4da47a;logger[_0xd102('0xc')](_0xd102('0x6d'),_0x290d9['id']);return getEndUser(_0x343e2c,_0x2378e5['calleridname'],_0x2378e5[_0xd102('0x56')]);})['then'](function(_0x480962){_0x633fbe=_0x480962;logger[_0xd102('0xc')](_0xd102('0x65'),_0x633fbe['id']);return getTicket(_0x343e2c,_0x290d9,_0x633fbe,_0x10220e,_0x2378e5);})[_0xd102('0x17')](function(_0x12c3f0){if(_0x12c3f0){logger[_0xd102('0xc')](_0xd102('0x57'),_0x12c3f0['id']);}})[_0xd102('0x60')](function(_0x2d8ab9){logger[_0xd102('0x5e')]('['+_0x2378e5[_0xd102('0x6e')][_0xd102('0x6c')]()+']'+_0xd102('0x6f'),util[_0xd102('0x6a')](_0x2d8ab9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd3b8=['Variable','toString','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','%s/channels/voice/agents/%d/tickets/%d/display.json','[OUTBOUND]','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','base64','debug','stringify','defaults','GET','map','forEach','includes','nameField','content','string','picklist','type','idField','custom_fields','push','variable','variableName','customField','customVariable','toLowerCase'];(function(_0x3a4203,_0xa6ff2e){var _0x1a5661=function(_0x584f45){while(--_0x584f45){_0x3a4203['push'](_0x3a4203['shift']());}};_0x1a5661(++_0xa6ff2e);}(_0xd3b8,0x97));var _0x8d3b=function(_0x21b99d,_0x46fbc9){_0x21b99d=_0x21b99d-0x0;var _0x31335a=_0xd3b8[_0x21b99d];return _0x31335a;};'use strict';var _=require(_0x8d3b('0x0'));var rp=require(_0x8d3b('0x1'));var md5=require('md5');var util=require(_0x8d3b('0x2'));var Redis=require(_0x8d3b('0x3'));var intUtil=require('./util');var config=require(_0x8d3b('0x4'));var logger=require(_0x8d3b('0x5'))(_0x8d3b('0x6'));config[_0x8d3b('0x7')]=_['defaults'](config[_0x8d3b('0x7')],{'host':_0x8d3b('0x8'),'port':0x18eb});var io=require(_0x8d3b('0x9'))(new Redis(config[_0x8d3b('0x7')]));function emit(_0x109b88,_0x588b97,_0x2c8cd4){io['to'](_0x109b88)[_0x8d3b('0xa')](_0x588b97,_0x2c8cd4);}var headers={'Content-Type':'application/json','Accept':_0x8d3b('0xb')};function getTicket(_0x256827,_0xeca1b0,_0x27ecf0,_0x331c8c,_0x1613c8){logger[_0x8d3b('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x8d3b('0xd')](_0x8d3b('0xe'),_0x256827[_0x8d3b('0xf')]),'method':'POST','body':{'ticket':_[_0x8d3b('0x10')]({'requester_id':_0x27ecf0['id'],'submitter_id':_0xeca1b0?_0xeca1b0['id']:undefined,'assignee_id':_0xeca1b0?_0xeca1b0['id']:undefined,'tags':getTags(_0x331c8c[_0x8d3b('0x11')],_0x8d3b('0x12')),'subject':intUtil[_0x8d3b('0x13')](_0x331c8c[_0x8d3b('0x14')],_0x1613c8,'\x20'),'description':intUtil[_0x8d3b('0x13')](_0x331c8c[_0x8d3b('0x15')],_0x1613c8,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8d3b('0x13')](_0x331c8c[_0x8d3b('0x15')],_0x1613c8,'\x0a')}},getCustomFields(_0x331c8c['Fields'],_0x1613c8))}})[_0x8d3b('0x16')](function(_0x4e5551){logger['info']('Ticket\x20created!');return _0x4e5551[_0x8d3b('0x17')];});}function getUser(_0x312755,_0x4b84a){if(intUtil[_0x8d3b('0x18')](_0x4b84a)){logger[_0x8d3b('0xc')](_0x8d3b('0x19'),_0x4b84a);return request({'uri':util[_0x8d3b('0xd')](_0x8d3b('0x1a'),_0x312755['remoteUri']),'qs':{'query':util[_0x8d3b('0xd')](_0x8d3b('0x1b'),_0x4b84a)}})[_0x8d3b('0x16')](function(_0x3c59ec){if(_0x3c59ec[_0x8d3b('0x1c')]){logger[_0x8d3b('0xc')](_0x8d3b('0x1d'));return _['find'](_0x3c59ec[_0x8d3b('0x1e')],{'email':_0x4b84a,'role':_0x8d3b('0x1f')});}else{logger[_0x8d3b('0xc')](_0x8d3b('0x20'));return request({'uri':util[_0x8d3b('0xd')](_0x8d3b('0x21'),_0x312755['remoteUri'])})[_0x8d3b('0x16')](function(_0x367446){logger[_0x8d3b('0xc')](_0x8d3b('0x22'));return _0x367446['user'];});}});}else{logger[_0x8d3b('0xc')](_0x8d3b('0x20'));return request({'uri':util[_0x8d3b('0xd')](_0x8d3b('0x21'),_0x312755[_0x8d3b('0xf')])})[_0x8d3b('0x16')](function(_0x27153b){logger[_0x8d3b('0xc')](_0x8d3b('0x22'));return _0x27153b[_0x8d3b('0x23')];});}}function getEndUser(_0x42281f,_0x4e1c39,_0x463210){logger[_0x8d3b('0xc')]('Searching\x20enduser\x20with\x20phone',_0x463210);return request({'uri':util['format'](_0x8d3b('0x1a'),_0x42281f[_0x8d3b('0xf')]),'qs':{'query':util[_0x8d3b('0xd')](_0x8d3b('0x24'),_0x463210)}})[_0x8d3b('0x16')](function(_0x341371){var _0x295dcb;if(_0x341371[_0x8d3b('0x1e')]['length']){_0x341371['results']=_['filter'](_0x341371[_0x8d3b('0x1e')],{'suspended':![],'role':_0x8d3b('0x25')});if(_0x341371[_0x8d3b('0x1e')][_0x8d3b('0x26')]){_0x295dcb=_[_0x8d3b('0x27')](_0x341371[_0x8d3b('0x1e')]);}}if(_0x295dcb){logger[_0x8d3b('0xc')](_0x8d3b('0x28'));return _0x295dcb;}else{logger[_0x8d3b('0xc')](_0x8d3b('0x29'));return request({'uri':util[_0x8d3b('0xd')](_0x8d3b('0x2a'),_0x42281f[_0x8d3b('0xf')]),'method':_0x8d3b('0x2b'),'body':{'user':{'role':_0x8d3b('0x25'),'name':util['format']('Caller\x20-\x20%s',_0x4e1c39||_0x463210),'phone':_0x463210}}})['then'](function(_0x40b78c){logger['info'](_0x8d3b('0x2c'));return _0x40b78c[_0x8d3b('0x23')];});}});}function getAuth(_0x2b5374){var _0x4a1132;if(_0x2b5374[_0x8d3b('0x2d')]===_0x8d3b('0x2e')){_0x4a1132=util[_0x8d3b('0xd')](_0x8d3b('0x2f'),_0x2b5374[_0x8d3b('0x30')],_0x2b5374[_0x8d3b('0x2e')]);}else if(_0x2b5374[_0x8d3b('0x2d')]===_0x8d3b('0x31')){_0x4a1132=util[_0x8d3b('0xd')](_0x8d3b('0x32'),_0x2b5374[_0x8d3b('0x30')],_0x2b5374[_0x8d3b('0x31')]);}return util[_0x8d3b('0xd')](_0x8d3b('0x33'),new Buffer(_0x4a1132)['toString'](_0x8d3b('0x34')));}function request(_0x53490d){logger[_0x8d3b('0x35')]('[HTTP]',JSON[_0x8d3b('0x36')](_0x53490d));return rp(_[_0x8d3b('0x37')](_0x53490d,{'method':_0x8d3b('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x1ef106,_0x15b2bc){var _0xfd1499=[];if(_0x1ef106&&_0x1ef106[_0x8d3b('0x26')]>0x0){_0xfd1499=_[_0x8d3b('0x39')](_0x1ef106,_0x15b2bc);}return _0xfd1499;}function getCustomFields(_0x32e78d,_0x6c49ac){var _0x8d6791=[];var _0x4cd760={'custom_fields':[]};if(_0x32e78d['length']>0x0){_[_0x8d3b('0x3a')](_0x32e78d,function(_0x2944dc){if(_[_0x8d3b('0x3b')](['string','picklist'],_0x2944dc['type'])&&_0x2944dc[_0x8d3b('0x3c')]&&!_0x2944dc['customField']){_0x4cd760[_0x2944dc[_0x8d3b('0x3c')]['toLowerCase']()]=_0x2944dc[_0x8d3b('0x3d')]['toString']();}else if(_['includes']([_0x8d3b('0x3e'),_0x8d3b('0x3f')],_0x2944dc[_0x8d3b('0x40')])&&_0x2944dc[_0x8d3b('0x41')]&&_0x2944dc['customField']){_0x4cd760[_0x8d3b('0x42')][_0x8d3b('0x43')]({'id':_0x2944dc[_0x8d3b('0x41')],'value':_0x2944dc[_0x8d3b('0x3d')]['toString']()});}else if(_0x2944dc[_0x8d3b('0x40')]===_0x8d3b('0x44')&&_0x2944dc[_0x8d3b('0x45')]&&_0x2944dc['idField']&&_0x2944dc[_0x8d3b('0x46')]){_0x6c49ac[_0x2944dc['variableName']]&&_0x4cd760[_0x8d3b('0x42')][_0x8d3b('0x43')]({'id':_0x2944dc[_0x8d3b('0x41')],'value':_0x6c49ac[_0x2944dc[_0x8d3b('0x45')]]['toString']()});}else if(_0x2944dc[_0x8d3b('0x40')]===_0x8d3b('0x47')&&_0x2944dc['Variable']&&_0x2944dc['Variable']['name']&&_0x2944dc['idField']&&_0x2944dc[_0x8d3b('0x46')]){_0x6c49ac[_0x2944dc['Variable'][_0x8d3b('0x12')][_0x8d3b('0x48')]()]&&_0x4cd760[_0x8d3b('0x42')][_0x8d3b('0x43')]({'id':_0x2944dc[_0x8d3b('0x41')],'value':_0x6c49ac[_0x2944dc[_0x8d3b('0x49')][_0x8d3b('0x12')]['toLowerCase']()][_0x8d3b('0x4a')]()});}});}return _0x4cd760;}exports[_0x8d3b('0x4b')]=function(_0x4e8fb4,_0x20079c,_0x29f4b7,_0x3a2eab,_0x181957,_0x335089){var _0xbb0441,_0x54a6c3;_0x335089[_0x8d3b('0xf')]=intUtil[_0x8d3b('0x4c')](_0x335089[_0x8d3b('0xf')]);_0x335089[_0x8d3b('0x4d')]=intUtil[_0x8d3b('0x4c')](_0x335089[_0x8d3b('0x4d')]);if(_0x181957&&_0x181957[_0x8d3b('0x4e')]){logger['info'](_0x8d3b('0x4f'),_0x8d3b('0x50'));_0x20079c['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x335089[_0x8d3b('0x4d')],_0x20079c[_0x8d3b('0x51')],md5(_0x20079c[_0x8d3b('0x51')]));}else{_0x20079c[_0x8d3b('0x52')]='';}headers[_0x8d3b('0x53')]=getAuth(_0x335089);return getUser(_0x335089,_0x3a2eab[_0x8d3b('0x54')])['then'](function(_0x10c7ff){_0xbb0441=_0x10c7ff;logger[_0x8d3b('0xc')](_0x8d3b('0x55'),_0xbb0441['id']);return getEndUser(_0x335089,_0x20079c[_0x8d3b('0x56')],_0x20079c[_0x8d3b('0x57')]);})[_0x8d3b('0x16')](function(_0x21ccf7){_0x54a6c3=_0x21ccf7;logger[_0x8d3b('0xc')](_0x8d3b('0x58'),_0x54a6c3['id']);return getTicket(_0x335089,_0xbb0441,_0x54a6c3,_0x29f4b7,_0x20079c);})['then'](function(_0x2bf943){if(_0x2bf943){logger['info'](_0x8d3b('0x59'),_0x2bf943['id']);switch(_0x335089[_0x8d3b('0x40')]){case _0x8d3b('0x5a'):logger[_0x8d3b('0xc')](_0x8d3b('0x4f'),_0x8d3b('0x5b'));return request({'uri':util[_0x8d3b('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x335089['remoteUri'],_0xbb0441['id'],_0x2bf943['id']),'method':_0x8d3b('0x2b')});case _0x8d3b('0x5c'):logger['info'](_0x8d3b('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x8d3b('0x5d'),_0x3a2eab[_0x8d3b('0x12')]),'trigger:browser:url',{'uri':util[_0x8d3b('0xd')]('%s/agent/tickets/%s',_0x335089[_0x8d3b('0xf')][_0x8d3b('0x5e')]('/api/v2',''),_0x2bf943['id'])});break;default:logger[_0x8d3b('0x5f')](_0x8d3b('0x4f'),_0x8d3b('0x60'));}}})[_0x8d3b('0x61')](function(_0x44cb7e){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x8d3b('0x62')](_0x44cb7e,{'showHidden':!![],'depth':null}));});};exports[_0x8d3b('0x63')]=function(_0x3e570d,_0x21b77c,_0x2881aa,_0x5aef0a,_0x296c2e,_0x2c9abd,_0x307b83){var _0x4467cb,_0x40eadd;_0x2c9abd['remoteUri']=intUtil[_0x8d3b('0x4c')](_0x2c9abd['remoteUri']);_0x2c9abd[_0x8d3b('0x4d')]=intUtil['stripTrailingSlash'](_0x2c9abd[_0x8d3b('0x4d')]);if(_0x307b83&&_0x307b83[_0x8d3b('0x64')]&&_0x307b83[_0x8d3b('0x64')]!==_0x8d3b('0x65')){logger[_0x8d3b('0xc')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x21b77c['recordingURL']=util[_0x8d3b('0xd')](_0x8d3b('0x66'),_0x2c9abd[_0x8d3b('0x4d')],_0x21b77c['uniqueid'],md5(_0x21b77c[_0x8d3b('0x51')]));}headers[_0x8d3b('0x53')]=getAuth(_0x2c9abd);return getUser(_0x2c9abd,_0x5aef0a[_0x8d3b('0x54')])[_0x8d3b('0x16')](function(_0x5c140f){_0x4467cb=_0x5c140f;logger[_0x8d3b('0xc')](_0x8d3b('0x55'),_0x4467cb['id']);return getEndUser(_0x2c9abd,_0x21b77c[_0x8d3b('0x67')],_0x21b77c['destcalleridnum']);})[_0x8d3b('0x16')](function(_0x520991){_0x40eadd=_0x520991;logger[_0x8d3b('0xc')](_0x8d3b('0x58'),_0x40eadd['id']);return getTicket(_0x2c9abd,_0x4467cb,_0x40eadd,_0x2881aa,_0x21b77c);})['then'](function(_0x1f8619){if(_0x1f8619){logger[_0x8d3b('0xc')](_0x8d3b('0x59'),_0x1f8619['id']);switch(_0x2c9abd['type']){case _0x8d3b('0x5a'):logger['info']('[OUTBOUND]',_0x8d3b('0x5b'));return request({'uri':util[_0x8d3b('0xd')](_0x8d3b('0x68'),_0x2c9abd['remoteUri'],_0x4467cb['id'],_0x1f8619['id']),'method':_0x8d3b('0x2b')});case'newTab':logger['info'](_0x8d3b('0x69'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8d3b('0xd')](_0x8d3b('0x5d'),_0x5aef0a[_0x8d3b('0x12')]),'trigger:browser:url',{'uri':util[_0x8d3b('0xd')](_0x8d3b('0x6a'),_0x2c9abd[_0x8d3b('0xf')][_0x8d3b('0x5e')](_0x8d3b('0x6b'),''),_0x1f8619['id'])});break;default:logger['error'](_0x8d3b('0x69'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x8d3b('0x61')](function(_0x1e5343){logger[_0x8d3b('0x5f')](_0x8d3b('0x6c'),util[_0x8d3b('0x62')](_0x1e5343,{'showHidden':!![],'depth':null}));});};exports[_0x8d3b('0x6d')]=function(_0x2af63a,_0x1ae588,_0x574f0a,_0x3dfa31,_0x5c5e63,_0xf8b636){var _0x332428,_0x753813;_0xf8b636['remoteUri']=intUtil[_0x8d3b('0x4c')](_0xf8b636[_0x8d3b('0xf')]);_0xf8b636[_0x8d3b('0x4d')]=intUtil['stripTrailingSlash'](_0xf8b636[_0x8d3b('0x4d')]);if(_0x5c5e63&&_0x5c5e63[_0x8d3b('0x4e')]){logger[_0x8d3b('0xc')]('['+_0x1ae588[_0x8d3b('0x6e')][_0x8d3b('0x6f')]()+']',_0x8d3b('0x50'));_0x1ae588[_0x8d3b('0x52')]=util['format'](_0x8d3b('0x66'),_0xf8b636['serverUrl'],_0x1ae588[_0x8d3b('0x51')],md5(_0x1ae588['uniqueid']));}else{_0x1ae588['recordingURL']='';}headers[_0x8d3b('0x53')]=getAuth(_0xf8b636);return getUser(_0xf8b636)[_0x8d3b('0x16')](function(_0x2adf02){_0x332428=_0x2adf02;logger['info'](_0x8d3b('0x55'),_0x332428['id']);return getEndUser(_0xf8b636,_0x1ae588[_0x8d3b('0x56')],_0x1ae588[_0x8d3b('0x57')]);})[_0x8d3b('0x16')](function(_0x3a0e6d){_0x753813=_0x3a0e6d;logger['info'](_0x8d3b('0x58'),_0x753813['id']);return getTicket(_0xf8b636,_0x332428,_0x753813,_0x574f0a,_0x1ae588);})[_0x8d3b('0x16')](function(_0x23f68a){if(_0x23f68a){logger['info'](_0x8d3b('0x59'),_0x23f68a['id']);}})[_0x8d3b('0x61')](function(_0x3d5706){logger[_0x8d3b('0x5f')]('['+_0x1ae588[_0x8d3b('0x6e')][_0x8d3b('0x6f')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x8d3b('0x62')](_0x3d5706,{'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 26694ee..e845a86 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 _0xf91d=['Call_Type','Fields','/crm/v2/Calls','SUCCESS','err','log','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','/api/voice/recordings/','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','length','forEach','picklist','idField','content','toString','type','variable','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','The\x20failing\x20result\x20is','catch','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','Zoho-oauthtoken\x20','data','code','details','Error:\x20','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','moduleCreate','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Who_Id','Last_Name','Full_Name','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','starttime','format','lastevent','called','Call_Result','Called','complete','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xf91d,0x155));var _0xdf91=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf91d[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xdf91('0x0'));var rp=require(_0xdf91('0x1'));var md5=require(_0xdf91('0x2'));var util=require(_0xdf91('0x3'));var intUtil=require(_0xdf91('0x4'));var moment=require(_0xdf91('0x5'));var Redis=require(_0xdf91('0x6'));var BPromise=require(_0xdf91('0x7'));var config=require(_0xdf91('0x8'));var logger=require('../../../../config/logger')(_0xdf91('0x9'));config[_0xdf91('0xa')]=_[_0xdf91('0xb')](config['redis'],{'host':_0xdf91('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x460774,_0x40d9eb,_0x5d710a){io['to'](_0x460774)[_0xdf91('0xd')](_0x40d9eb,_0x5d710a);}function request(_0x5e2038){logger[_0xdf91('0xe')](_0xdf91('0xf'),JSON[_0xdf91('0x10')](_0x5e2038));return rp(_0x5e2038);}function getCustomFields(_0x528a7f,_0x15ff50){var _0x1473aa={};if(_0x528a7f[_0xdf91('0x11')]>0x0){_[_0xdf91('0x12')](_0x528a7f,function(_0x59868e){if(_['includes'](['string',_0xdf91('0x13')],_0x59868e['type'])&&_0x59868e[_0xdf91('0x14')]){_0x1473aa[_0x59868e[_0xdf91('0x14')]]=_0x59868e[_0xdf91('0x15')][_0xdf91('0x16')]();}else if(_0x59868e[_0xdf91('0x17')]===_0xdf91('0x18')&&_0x59868e['variableName']&&_0x59868e[_0xdf91('0x14')]&&_0x15ff50[_0x59868e['variableName']]){_0x1473aa[_0x59868e[_0xdf91('0x14')]]=_0x15ff50[_0x59868e['variableName']]['toString']();}else if(_0x59868e[_0xdf91('0x17')]===_0xdf91('0x19')&&_0x59868e['Variable']&&_0x59868e[_0xdf91('0x1a')][_0xdf91('0x1b')]&&_0x59868e[_0xdf91('0x14')]&&_0x15ff50[_0x59868e[_0xdf91('0x1a')][_0xdf91('0x1b')][_0xdf91('0x1c')]()]){_0x1473aa[_0x59868e['idField']]=_0x15ff50[_0x59868e[_0xdf91('0x1a')][_0xdf91('0x1b')][_0xdf91('0x1c')]()]['toString']();}});}return _0x1473aa;}function getName(_0x294823){if(_0x294823[_0xdf91('0x1d')]('\x20')>0x0){var _0x427af8=_0x294823[_0xdf91('0x1e')](/ (.+)/);if(_0x427af8[0x1]){return _0x427af8;}}return[_0x294823,_0x294823];}var accountsTokens={};function getAccessToken(_0x2704fa){return new Promise(function(_0x15e91f,_0x2d83b6){if(!_['isNil'](accountsTokens[_0x2704fa['id']])&&!_[_0xdf91('0x1f')](accountsTokens[_0x2704fa['id']]['access_token'])){if(moment()[_0xdf91('0x20')](accountsTokens[_0x2704fa['id']][_0xdf91('0x21')])){_0x15e91f(accountsTokens[_0x2704fa['id']][_0xdf91('0x22')]);}}var _0x52cdc6;switch(_0x2704fa[_0xdf91('0x23')]){case'US':_0x52cdc6=_0xdf91('0x24');break;case'AU':_0x52cdc6='https://accounts.zoho.com.au';break;case'EU':_0x52cdc6=_0xdf91('0x25');break;case'IN':_0x52cdc6=_0xdf91('0x26');break;case'CN':_0x52cdc6=_0xdf91('0x27');break;default:_0x52cdc6=_0xdf91('0x25');break;}var _0x2b4bb8={'method':_0xdf91('0x28'),'uri':_0x52cdc6+_0xdf91('0x29'),'qs':{'refresh_token':_0x2704fa[_0xdf91('0x2a')],'client_id':_0x2704fa[_0xdf91('0x2b')],'client_secret':_0x2704fa[_0xdf91('0x2c')],'grant_type':_0xdf91('0x2d')},'json':!![]};return rp(_0x2b4bb8)['then'](function(_0x3922fe){accountsTokens[_0x2704fa['id']]={'access_token':_0x3922fe[_0xdf91('0x22')],'expires_in':moment()[_0xdf91('0x2e')](_0x3922fe['expires_in'],'seconds')};_0x15e91f(_0x3922fe[_0xdf91('0x22')]);})['catch'](function(_0x9aba18){logger[_0xdf91('0x2f')](_0xdf91('0x30'),_0x9aba18[_0xdf91('0x31')]);_0x2d83b6(_0x9aba18);});});}function getUser(_0x41d8f7,_0x3fd07d,_0xf75af6,_0xe097cc){logger[_0xdf91('0x32')](_0xdf91('0x33'));return request({'method':_0xdf91('0x34'),'uri':util['format'](_0xdf91('0x35'),_0x3fd07d),'qs':{'type':_0xdf91('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x41d8f7},'json':!![]})[_0xdf91('0x37')](function(_0x2552cb){if(_0x2552cb[_0xdf91('0x38')]){var _0x51a9f6=-0x1;if(_['isArrayLikeObject'](_0x2552cb[_0xdf91('0x38')])){if(!_[_0xdf91('0x1f')](_0xe097cc)){_0x51a9f6=_[_0xdf91('0x39')](_0x2552cb[_0xdf91('0x38')],function(_0x1337e3){return _0x1337e3[_0xdf91('0x3a')]===_0xe097cc;});}if(_0x51a9f6>=0x0){logger[_0xdf91('0x32')](_0xdf91('0x3b'));}else{logger[_0xdf91('0x32')](_0xdf91('0x3c'));_0x51a9f6=_['findIndex'](_0x2552cb[_0xdf91('0x38')],function(_0x44bb1f){return _0x44bb1f['profile'][_0xdf91('0x1b')]===_0xdf91('0x3d');});}return _0x2552cb['users'][_0x51a9f6];}else{if(_0x2552cb['user'][_0xdf91('0x3e')][_0xdf91('0x1b')]===_0xdf91('0x3d')){logger[_0xdf91('0x32')]('Using\x20the\x20admin\x20account!');user=_0x2552cb['user'];return user;}else{logger[_0xdf91('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xdf91('0x10')](_0x2552cb));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x2552cb));}}}else{logger[_0xdf91('0x2f')](_0xdf91('0x3f'),JSON[_0xdf91('0x10')](_0x2552cb));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x2552cb));}})[_0xdf91('0x40')](function(_0x2526bb){console[_0xdf91('0x2f')](_0x2526bb);});}function getZohoUser(_0x950043,_0x5d787b){return new BPromise(function(_0xfeb796,_0x52aca0){request(_0x950043)[_0xdf91('0x37')](function(_0x23ea64){var _0x5643c1=null;if(_0x23ea64){_0x5643c1=_0x23ea64['data'][0x0];_0x5643c1[_0xdf91('0x41')]=_0x5d787b;}_0xfeb796(_0x5643c1);})[_0xdf91('0x40')](function(_0xccc709){_0x52aca0(_0xccc709);});});}function createEndUser(_0x9aacbf,_0x30d16f,_0x1deaf7,_0x123a06,_0x25a7eb,_0x49856f){var _0x1deaf7=getName(_0x1deaf7);return request({'method':_0xdf91('0x28'),'uri':_0xdf91('0x42')+_0x30d16f+_0xdf91('0x43')+_[_0xdf91('0x44')](_0x49856f['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1deaf7[0x1],'First_Name':_0x1deaf7[0x0],'Phone':_0x123a06,'Owner':{'name':!_['isNil'](_0x25a7eb[_0xdf91('0x45')][_0xdf91('0x1b')])?_0x25a7eb[_0xdf91('0x45')][_0xdf91('0x1b')]:!_[_0xdf91('0x1f')](_0x25a7eb[_0xdf91('0x46')])?_0x25a7eb[_0xdf91('0x46')]+'\x20'+_0x25a7eb[_0xdf91('0x47')]:_0x25a7eb[_0xdf91('0x47')],'id':_0x25a7eb['id']}}]},'headers':{'Authorization':_0xdf91('0x48')+_0x9aacbf},'json':!![]})['then'](function(_0x2ca195){if(_0x2ca195&&_0x2ca195[_0xdf91('0x49')][0x0][_0xdf91('0x4a')]==='SUCCESS'){var _0x14c8f1=_0x2ca195[_0xdf91('0x49')][0x0][_0xdf91('0x4b')];_0x14c8f1[_0xdf91('0x41')]=_[_0xdf91('0x44')](_0x49856f['moduleCreate'])+'s';return _0x14c8f1;}logger[_0xdf91('0x2f')](_0xdf91('0x3f'),JSON[_0xdf91('0x10')](data));throw new Error(_0xdf91('0x4c')+JSON[_0xdf91('0x10')](data));})['catch'](function(_0x524b28){console['log'](_0xdf91('0x4d'),_0x524b28);});}function getEndUser(_0xd7b886,_0x41233e,_0x18772d,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8){var _0x22d00b={'method':_0xdf91('0x34'),'uri':'','headers':{'Authorization':_0xdf91('0x48')+_0xd7b886},'json':!![]};switch(_0x4315d8['moduleSearch']){case _0xdf91('0x4e'):_0x22d00b[_0xdf91('0x4f')]=_0xdf91('0x42')+_0x41233e+_0xdf91('0x50')+_0x5b1009+'))';return getZohoUser(_0x22d00b,_0xdf91('0x51'))[_0xdf91('0x37')](function(_0x31a221){if(_0x31a221)return _0x31a221;_0x22d00b[_0xdf91('0x4f')]=_0xdf91('0x42')+_0x41233e+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x5b1009+'))';return getZohoUser(_0x22d00b,_0xdf91('0x52'))[_0xdf91('0x37')](function(_0x4eafde){if(_0x4eafde)return _0x4eafde;if(_0x4315d8['moduleCreate']!=_0xdf91('0x53')){return createEndUser(_0xd7b886,_0x41233e,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8);}else{return{};}});});break;case _0xdf91('0x54'):_0x22d00b[_0xdf91('0x4f')]=_0xdf91('0x42')+_0x41233e+_0xdf91('0x50')+_0x5b1009+'))';return getZohoUser(_0x22d00b,_0xdf91('0x51'))[_0xdf91('0x37')](function(_0x1a177b){if(_0x1a177b)return _0x1a177b;if(_0x4315d8[_0xdf91('0x55')]!='nothing'){return createEndUser(_0xd7b886,_0x41233e,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8);}else{return{};}});break;case _0xdf91('0x56'):_0x22d00b[_0xdf91('0x4f')]='https://www.zohoapis.'+_0x41233e+_0xdf91('0x57')+_0x5b1009+'))';return getZohoUser(_0x22d00b,'Leads')[_0xdf91('0x37')](function(_0x4969a8){if(_0x4969a8)return _0x4969a8;if(_0x4315d8[_0xdf91('0x55')]!='nothing'){return createEndUser(_0xd7b886,_0x41233e,_0x328d95,_0x5b1009,_0x3a5b69,_0x4315d8);}else{return{};}});break;}}function getCall(_0x4d9aac,_0x3287bd,_0x5817c9,_0xece38f,_0x476b0b,_0x36c8f5,_0x746c8f,_0xc6fc5e){logger[_0xdf91('0x32')](_0xdf91('0x58'));var _0x53f50e={};_0x53f50e[_0xdf91('0x59')]={'name':!_[_0xdf91('0x1f')](_0xece38f['role'][_0xdf91('0x1b')])&&!_[_0xdf91('0x1f')](_0xece38f['profile'][_0xdf91('0x1b')])&&_0xece38f[_0xdf91('0x3e')][_0xdf91('0x1b')]==='administrator'?_0xece38f[_0xdf91('0x45')]['name']:!_[_0xdf91('0x1f')](_0xece38f[_0xdf91('0x46')])?_0xece38f[_0xdf91('0x46')]+'\x20'+_0xece38f[_0xdf91('0x47')]:_0xece38f[_0xdf91('0x47')],'id':_0xece38f['id']};_0x53f50e[_0xdf91('0x5a')]=intUtil[_0xdf91('0x5b')](_0x36c8f5[_0xdf91('0x5c')],_0x746c8f,'\x20');_0x53f50e[_0xdf91('0x5d')]=intUtil[_0xdf91('0x5b')](_0x36c8f5['Descriptions'],_0x746c8f,'\x0a');if(_0x476b0b[_0xdf91('0x41')]==='Contacts'){_0x53f50e[_0xdf91('0x5e')]={'name':!_[_0xdf91('0x1f')](_0x476b0b['Full_Name'])?_0x476b0b['Full_Name']:!_[_0xdf91('0x1f')](_0x476b0b['First_Name'])?_0x476b0b['First_Name']+'\x20'+_0x476b0b[_0xdf91('0x5f')]:_0x476b0b[_0xdf91('0x5f')],'id':_0x476b0b['id']};}if(_0x476b0b[_0xdf91('0x41')]===_0xdf91('0x52')){_0x53f50e['What_Id']={'name':!_[_0xdf91('0x1f')](_0x476b0b[_0xdf91('0x60')])?_0x476b0b[_0xdf91('0x60')]:!_[_0xdf91('0x1f')](_0x476b0b['First_Name'])?_0x476b0b[_0xdf91('0x61')]+'\x20'+_0x476b0b['Last_Name']:_0x476b0b['Last_Name'],'id':_0x476b0b['id']};_0x53f50e[_0xdf91('0x62')]=_[_0xdf91('0x44')](_0x476b0b[_0xdf91('0x41')]);}if(_0x746c8f[_0xdf91('0x63')]){_0x53f50e[_0xdf91('0x64')]=moment[_0xdf91('0x65')](parseInt(_0x746c8f[_0xdf91('0x63')])*0x3e8)['format'](_0xdf91('0x66'));}else if(_0x746c8f['answertime']&&_0x746c8f[_0xdf91('0x67')]){_0x53f50e[_0xdf91('0x64')]=moment['utc'](moment(_0x746c8f[_0xdf91('0x67')],_0xdf91('0x68'))['diff'](moment(_0x746c8f[_0xdf91('0x69')],_0xdf91('0x68'))))[_0xdf91('0x6a')](_0xdf91('0x66'));}switch(_0x746c8f[_0xdf91('0x6b')]){case _0xdf91('0x6c'):_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x6e');break;case _0xdf91('0x6f'):case'connect':_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x70');break;case _0xdf91('0x71'):_0x53f50e[_0xdf91('0x6d')]='Rejected';break;case _0xdf91('0x72'):_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x73');break;case _0xdf91('0x74'):_0x53f50e[_0xdf91('0x6d')]=_0xdf91('0x75');default:}_0x53f50e[_0xdf91('0x76')]=(_0xc6fc5e===_0xdf91('0x77')?moment(_0x746c8f[_0xdf91('0x69')])[_0xdf91('0x6a')](_0xdf91('0x68')):moment(_0x746c8f[_0xdf91('0x78')])['format'](_0xdf91('0x68')))||moment()[_0xdf91('0x6a')](_0xdf91('0x68'));_0x53f50e[_0xdf91('0x79')]=_0xc6fc5e||'Inbound';_0x53f50e=_['merge'](_0x53f50e,getCustomFields(_0x36c8f5[_0xdf91('0x7a')],_0x746c8f));return request({'method':_0xdf91('0x28'),'uri':_0xdf91('0x42')+_0x3287bd+_0xdf91('0x7b'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4d9aac},'body':{'data':[_0x53f50e]},'json':!![]})[_0xdf91('0x37')](function(_0x4daf9b){if(_0x4daf9b&&_0x4daf9b[_0xdf91('0x49')][0x0][_0xdf91('0x4a')]===_0xdf91('0x7c')){logger[_0xdf91('0x32')]('Call\x20created!');return{'id':_0x4daf9b[_0xdf91('0x49')][0x0]['details']['id']};}})[_0xdf91('0x40')](function(_0x2ccfed){logger[_0xdf91('0x32')](_0xdf91('0x7d'),_0x2ccfed[_0xdf91('0x31')]);console[_0xdf91('0x7e')]('err',_0x2ccfed);});}exports['queue']=function(_0x4ab906,_0x50990c,_0x585856,_0x2c79cd,_0x2d2ffa,_0x12b85b){var _0x482251,_0x4aa736,_0x24f7b3;_0x12b85b[_0xdf91('0x7f')]=intUtil[_0xdf91('0x80')](_0x12b85b[_0xdf91('0x7f')]);_0x12b85b[_0xdf91('0x81')]=intUtil['stripTrailingSlash'](_0x12b85b[_0xdf91('0x81')]);if(_0x2d2ffa&&_0x2d2ffa[_0xdf91('0x82')]){logger[_0xdf91('0x32')]('[QUEUE]',_0xdf91('0x83'));_0x50990c[_0xdf91('0x84')]=_0x12b85b['serverUrl']+'/api/voice/recordings/'+_0x50990c[_0xdf91('0x85')]+_0xdf91('0x86')+md5(_0x50990c[_0xdf91('0x85')]);}else{_0x50990c[_0xdf91('0x84')]='';}var _0x21013d=_0x12b85b['host']===_0xdf91('0x87')?'eu':_0xdf91('0x88');return getAccessToken(_0x12b85b)[_0xdf91('0x37')](function(_0x3bcd27){_0x24f7b3=_0x3bcd27;return getUser(_0x24f7b3,_0x21013d,_0x12b85b,_0x2c79cd[_0xdf91('0x3a')]);})[_0xdf91('0x37')](function(_0x4c48e0){_0x482251=_0x4c48e0;logger[_0xdf91('0x32')](_0xdf91('0x89'),_0x482251['id']);return getEndUser(_0x24f7b3,_0x21013d,_0x12b85b,_0x50990c[_0xdf91('0x8a')],_0x50990c[_0xdf91('0x8b')],_0x482251,_0x585856);})[_0xdf91('0x37')](function(_0x237105){_0x4aa736=_0x237105;return getCall(_0x24f7b3,_0x21013d,_0x12b85b,_0x482251,_0x4aa736,_0x585856,_0x50990c,'Inbound');})[_0xdf91('0x37')](function(_0x289d68){if(_0x289d68){logger[_0xdf91('0x32')](_0xdf91('0x8c'),_0x289d68['id']);logger['info'](_0xdf91('0x8d'),_0xdf91('0x8e'));emit(util[_0xdf91('0x6a')](_0xdf91('0x8f'),_0x2c79cd[_0xdf91('0x1b')]),'trigger:browser:url',{'uri':_0xdf91('0x90')+_0x12b85b[_0xdf91('0x7f')]+_0xdf91('0x91')+_0x289d68['id']});}})['catch'](function(_0xe04f38){logger[_0xdf91('0x2f')](_0xdf91('0x8d'),JSON['stringify'](_0xe04f38));});};exports[_0xdf91('0x77')]=function(_0x281579,_0x4342b4,_0x3deb2e,_0x33f910,_0x15e1ee,_0x535572,_0x58e2b1){var _0x35aefa,_0x58b645,_0x5b0cfc;_0x535572['host']=intUtil[_0xdf91('0x80')](_0x535572[_0xdf91('0x7f')]);_0x535572['serverUrl']=intUtil[_0xdf91('0x80')](_0x535572[_0xdf91('0x81')]);if(_0x58e2b1&&_0x58e2b1[_0xdf91('0x92')]&&_0x58e2b1[_0xdf91('0x92')]!==_0xdf91('0x93')){logger[_0xdf91('0x32')](_0xdf91('0x94'),_0xdf91('0x83'));_0x4342b4['recordingURL']=_0x535572[_0xdf91('0x81')]+'/api/voice/recordings/'+_0x4342b4[_0xdf91('0x85')]+_0xdf91('0x86')+md5(_0x4342b4[_0xdf91('0x85')]);}var _0x35359e=_0x535572[_0xdf91('0x7f')]===_0xdf91('0x87')?'eu':_0xdf91('0x88');return getAccessToken(_0x535572)['then'](function(_0x3ec626){_0x5b0cfc=_0x3ec626;return getUser(_0x5b0cfc,_0x35359e,_0x535572,_0x33f910[_0xdf91('0x3a')]);})['then'](function(_0x149986){_0x35aefa=_0x149986;logger['info'](_0xdf91('0x89'),_0x35aefa['id']);return getEndUser(_0x5b0cfc,_0x35359e,_0x535572,_0x4342b4[_0xdf91('0x95')],_0x4342b4[_0xdf91('0x96')],_0x35aefa,_0x3deb2e);})[_0xdf91('0x37')](function(_0x42fcce){_0x58b645=_0x42fcce;return getCall(_0x5b0cfc,_0x35359e,_0x535572,_0x35aefa,_0x58b645,_0x3deb2e,_0x4342b4,_0xdf91('0x97'));})[_0xdf91('0x37')](function(_0x103334){if(_0x103334){logger[_0xdf91('0x32')](_0xdf91('0x8c'),_0x103334['id']);logger[_0xdf91('0x32')](_0xdf91('0x94'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdf91('0x6a')](_0xdf91('0x8f'),_0x33f910[_0xdf91('0x1b')]),_0xdf91('0x98'),{'uri':'https://crm.'+_0x535572[_0xdf91('0x7f')]+_0xdf91('0x91')+_0x103334['id']});}})[_0xdf91('0x40')](function(_0x5e7b2f){logger[_0xdf91('0x2f')]('[OUTBOUND]',JSON['stringify'](_0x5e7b2f));});};exports['unmanaged']=function(_0x3d1ff0,_0x4b01fb,_0x233b5c,_0x3e7b36,_0x4e14e8,_0x57c0c0){var _0x4d30f4,_0x51ee9a,_0x4b8d9a;_0x57c0c0[_0xdf91('0x7f')]=intUtil['stripTrailingSlash'](_0x57c0c0[_0xdf91('0x7f')]);_0x57c0c0[_0xdf91('0x81')]=intUtil[_0xdf91('0x80')](_0x57c0c0[_0xdf91('0x81')]);if(_0x4e14e8&&_0x4e14e8['monitor_format']){logger[_0xdf91('0x32')]('['+_0x4b01fb[_0xdf91('0x6b')]['toUpperCase']()+']',_0xdf91('0x83'));_0x4b01fb[_0xdf91('0x84')]=_0x57c0c0[_0xdf91('0x81')]+_0xdf91('0x99')+_0x4b01fb[_0xdf91('0x85')]+_0xdf91('0x86')+md5(_0x4b01fb[_0xdf91('0x85')]);}else{_0x4b01fb[_0xdf91('0x84')]='';}var _0x2ef7d2=_0x57c0c0['host']===_0xdf91('0x87')?'eu':_0xdf91('0x88');return getAccessToken(_0x57c0c0)['then'](function(_0x4c6980){_0x4b8d9a=_0x4c6980;return getUser(_0x4b8d9a,_0x2ef7d2,_0x57c0c0);})['then'](function(_0x470e40){_0x4d30f4=_0x470e40;logger[_0xdf91('0x32')](_0xdf91('0x89'),_0x4d30f4['id']);return getEndUser(_0x4b8d9a,_0x2ef7d2,_0x57c0c0,_0x4b01fb[_0xdf91('0x8a')],_0x4b01fb[_0xdf91('0x8b')],_0x4d30f4,_0x233b5c);})[_0xdf91('0x37')](function(_0x525bc7){_0x51ee9a=_0x525bc7;return getCall(_0x4b8d9a,_0x2ef7d2,_0x57c0c0,_0x4d30f4,_0x51ee9a,_0x233b5c,_0x4b01fb,'Inbound');})['then'](function(_0x508541){if(_0x508541){logger[_0xdf91('0x32')](_0xdf91('0x8c'),_0x508541['id']);}})[_0xdf91('0x40')](function(_0x51a55b){logger['error']('['+_0x4b01fb[_0xdf91('0x6b')]['toUpperCase']()+']',JSON[_0xdf91('0x10')](_0x51a55b));});}; \ No newline at end of file +var _0x42cf=['length','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','POST','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','Leads','What_Id','Call_Duration','utc','talktime','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','format','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','util','./util','ioredis','../../../../config/environment','../../../../config/logger','defaults','localhost','emit','stringify'];(function(_0x357018,_0x1a75d6){var _0xe50e4b=function(_0x179e7e){while(--_0x179e7e){_0x357018['push'](_0x357018['shift']());}};_0xe50e4b(++_0x1a75d6);}(_0x42cf,0x11f));var _0xf42c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x42cf[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xf42c('0x0'));var rp=require(_0xf42c('0x1'));var md5=require('md5');var util=require(_0xf42c('0x2'));var intUtil=require(_0xf42c('0x3'));var moment=require('moment');var Redis=require(_0xf42c('0x4'));var BPromise=require('bluebird');var config=require(_0xf42c('0x5'));var logger=require(_0xf42c('0x6'))('zoho');config['redis']=_[_0xf42c('0x7')](config['redis'],{'host':_0xf42c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3334fe,_0x2548a2,_0x445ee6){io['to'](_0x3334fe)[_0xf42c('0x9')](_0x2548a2,_0x445ee6);}function request(_0x334a64){logger['debug']('[HTTP]',JSON[_0xf42c('0xa')](_0x334a64));return rp(_0x334a64);}function getCustomFields(_0x4b1487,_0x37a487){var _0x4ebe84={};if(_0x4b1487[_0xf42c('0xb')]>0x0){_['forEach'](_0x4b1487,function(_0x34ce44){if(_['includes']([_0xf42c('0xc'),_0xf42c('0xd')],_0x34ce44['type'])&&_0x34ce44[_0xf42c('0xe')]){_0x4ebe84[_0x34ce44['idField']]=_0x34ce44[_0xf42c('0xf')][_0xf42c('0x10')]();}else if(_0x34ce44[_0xf42c('0x11')]===_0xf42c('0x12')&&_0x34ce44[_0xf42c('0x13')]&&_0x34ce44['idField']&&_0x37a487[_0x34ce44['variableName']]){_0x4ebe84[_0x34ce44[_0xf42c('0xe')]]=_0x37a487[_0x34ce44[_0xf42c('0x13')]]['toString']();}else if(_0x34ce44['type']===_0xf42c('0x14')&&_0x34ce44[_0xf42c('0x15')]&&_0x34ce44['Variable'][_0xf42c('0x16')]&&_0x34ce44[_0xf42c('0xe')]&&_0x37a487[_0x34ce44[_0xf42c('0x15')][_0xf42c('0x16')][_0xf42c('0x17')]()]){_0x4ebe84[_0x34ce44[_0xf42c('0xe')]]=_0x37a487[_0x34ce44[_0xf42c('0x15')][_0xf42c('0x16')]['toLowerCase']()][_0xf42c('0x10')]();}});}return _0x4ebe84;}function getName(_0x48cce4){if(_0x48cce4['indexOf']('\x20')>0x0){var _0x2b7aa9=_0x48cce4[_0xf42c('0x18')](/ (.+)/);if(_0x2b7aa9[0x1]){return _0x2b7aa9;}}return[_0x48cce4,_0x48cce4];}var accountsTokens={};function getAccessToken(_0x58b017){return new Promise(function(_0x531ac4,_0x48c47){if(!_[_0xf42c('0x19')](accountsTokens[_0x58b017['id']])&&!_[_0xf42c('0x19')](accountsTokens[_0x58b017['id']][_0xf42c('0x1a')])){if(moment()['isBefore'](accountsTokens[_0x58b017['id']][_0xf42c('0x1b')])){_0x531ac4(accountsTokens[_0x58b017['id']][_0xf42c('0x1a')]);}}var _0x8aed81;switch(_0x58b017[_0xf42c('0x1c')]){case'US':_0x8aed81=_0xf42c('0x1d');break;case'AU':_0x8aed81=_0xf42c('0x1e');break;case'EU':_0x8aed81=_0xf42c('0x1f');break;case'IN':_0x8aed81=_0xf42c('0x20');break;case'CN':_0x8aed81=_0xf42c('0x21');break;default:_0x8aed81=_0xf42c('0x1f');break;}var _0x4f1dfd={'method':'POST','uri':_0x8aed81+_0xf42c('0x22'),'qs':{'refresh_token':_0x58b017[_0xf42c('0x23')],'client_id':_0x58b017[_0xf42c('0x24')],'client_secret':_0x58b017[_0xf42c('0x25')],'grant_type':_0xf42c('0x26')},'json':!![]};return rp(_0x4f1dfd)[_0xf42c('0x27')](function(_0x28b780){accountsTokens[_0x58b017['id']]={'access_token':_0x28b780[_0xf42c('0x1a')],'expires_in':moment()['add'](_0x28b780[_0xf42c('0x1b')],'seconds')};_0x531ac4(_0x28b780[_0xf42c('0x1a')]);})['catch'](function(_0x52ff8d){logger[_0xf42c('0x28')](_0xf42c('0x29'),_0x52ff8d[_0xf42c('0x2a')]);_0x48c47(_0x52ff8d);});});}function getUser(_0x4b2448,_0x5c74a2,_0x4da6a5,_0x29a34d){logger[_0xf42c('0x2b')](_0xf42c('0x2c'));return request({'method':_0xf42c('0x2d'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x5c74a2),'qs':{'type':_0xf42c('0x2e')},'headers':{'Authorization':_0xf42c('0x2f')+_0x4b2448},'json':!![]})['then'](function(_0x11f02d){if(_0x11f02d[_0xf42c('0x30')]){var _0x3d5dc9=-0x1;if(_[_0xf42c('0x31')](_0x11f02d['users'])){if(!_['isNil'](_0x29a34d)){_0x3d5dc9=_[_0xf42c('0x32')](_0x11f02d[_0xf42c('0x30')],function(_0x3c1ef0){return _0x3c1ef0[_0xf42c('0x33')]===_0x29a34d;});}if(_0x3d5dc9>=0x0){logger[_0xf42c('0x2b')]('Agent\x20found!');}else{logger[_0xf42c('0x2b')](_0xf42c('0x34'));_0x3d5dc9=_[_0xf42c('0x32')](_0x11f02d['users'],function(_0x37e0fd){return _0x37e0fd[_0xf42c('0x35')][_0xf42c('0x16')]===_0xf42c('0x36');});}return _0x11f02d[_0xf42c('0x30')][_0x3d5dc9];}else{if(_0x11f02d['user']['profile'][_0xf42c('0x16')]===_0xf42c('0x36')){logger[_0xf42c('0x2b')](_0xf42c('0x34'));user=_0x11f02d[_0xf42c('0x37')];return user;}else{logger[_0xf42c('0x28')](_0xf42c('0x38'),JSON['stringify'](_0x11f02d));throw new Error(_0xf42c('0x39')+JSON[_0xf42c('0xa')](_0x11f02d));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xf42c('0xa')](_0x11f02d));throw new Error(_0xf42c('0x39')+JSON[_0xf42c('0xa')](_0x11f02d));}})[_0xf42c('0x3a')](function(_0x3c5dcb){console[_0xf42c('0x28')](_0x3c5dcb);});}function getZohoUser(_0x283a9e,_0x3b8cce){return new BPromise(function(_0x23049d,_0x1cdfb9){request(_0x283a9e)[_0xf42c('0x27')](function(_0x2a0e1a){var _0x58ea06=null;if(_0x2a0e1a){_0x58ea06=_0x2a0e1a['data'][0x0];_0x58ea06[_0xf42c('0x3b')]=_0x3b8cce;}_0x23049d(_0x58ea06);})[_0xf42c('0x3a')](function(_0x589b43){_0x1cdfb9(_0x589b43);});});}function createEndUser(_0x39d18d,_0x1772df,_0x240b2a,_0x219c38,_0xd92fea,_0x5d0787){var _0x240b2a=getName(_0x240b2a);return request({'method':_0xf42c('0x3c'),'uri':'https://www.zohoapis.'+_0x1772df+_0xf42c('0x3d')+_[_0xf42c('0x3e')](_0x5d0787[_0xf42c('0x3f')])+'s','body':{'data':[{'Last_Name':_0x240b2a[0x1],'First_Name':_0x240b2a[0x0],'Phone':_0x219c38,'Owner':{'name':!_['isNil'](_0xd92fea[_0xf42c('0x40')][_0xf42c('0x16')])?_0xd92fea[_0xf42c('0x40')][_0xf42c('0x16')]:!_[_0xf42c('0x19')](_0xd92fea[_0xf42c('0x41')])?_0xd92fea[_0xf42c('0x41')]+'\x20'+_0xd92fea['last_name']:_0xd92fea[_0xf42c('0x42')],'id':_0xd92fea['id']}}]},'headers':{'Authorization':_0xf42c('0x2f')+_0x39d18d},'json':!![]})[_0xf42c('0x27')](function(_0x281169){if(_0x281169&&_0x281169[_0xf42c('0x43')][0x0][_0xf42c('0x44')]===_0xf42c('0x45')){var _0x33d40c=_0x281169['data'][0x0][_0xf42c('0x46')];_0x33d40c[_0xf42c('0x3b')]=_[_0xf42c('0x3e')](_0x5d0787[_0xf42c('0x3f')])+'s';return _0x33d40c;}logger[_0xf42c('0x28')](_0xf42c('0x38'),JSON[_0xf42c('0xa')](data));throw new Error('Error:\x20'+JSON[_0xf42c('0xa')](data));})[_0xf42c('0x3a')](function(_0x138236){console[_0xf42c('0x47')](_0xf42c('0x48'),_0x138236);});}function getEndUser(_0x4d332c,_0x340ba9,_0xfb8a7,_0x3b7dd4,_0x3f6a38,_0x216179,_0x3ac7ea){var _0x1fb79a={'method':_0xf42c('0x2d'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4d332c},'json':!![]};switch(_0x3ac7ea[_0xf42c('0x49')]){case _0xf42c('0x4a'):_0x1fb79a[_0xf42c('0x4b')]=_0xf42c('0x4c')+_0x340ba9+_0xf42c('0x4d')+_0x3f6a38+'))';return getZohoUser(_0x1fb79a,_0xf42c('0x4e'))[_0xf42c('0x27')](function(_0x1d6ced){if(_0x1d6ced)return _0x1d6ced;_0x1fb79a[_0xf42c('0x4b')]=_0xf42c('0x4c')+_0x340ba9+_0xf42c('0x4f')+_0x3f6a38+'))';return getZohoUser(_0x1fb79a,'Leads')['then'](function(_0x474af1){if(_0x474af1)return _0x474af1;if(_0x3ac7ea['moduleCreate']!=_0xf42c('0x50')){return createEndUser(_0x4d332c,_0x340ba9,_0x3b7dd4,_0x3f6a38,_0x216179,_0x3ac7ea);}else{return{};}});});break;case'contact':_0x1fb79a['uri']='https://www.zohoapis.'+_0x340ba9+_0xf42c('0x4d')+_0x3f6a38+'))';return getZohoUser(_0x1fb79a,'Contacts')[_0xf42c('0x27')](function(_0x2a687b){if(_0x2a687b)return _0x2a687b;if(_0x3ac7ea[_0xf42c('0x3f')]!=_0xf42c('0x50')){return createEndUser(_0x4d332c,_0x340ba9,_0x3b7dd4,_0x3f6a38,_0x216179,_0x3ac7ea);}else{return{};}});break;case'lead':_0x1fb79a['uri']='https://www.zohoapis.'+_0x340ba9+_0xf42c('0x4f')+_0x3f6a38+'))';return getZohoUser(_0x1fb79a,'Leads')['then'](function(_0x563700){if(_0x563700)return _0x563700;if(_0x3ac7ea['moduleCreate']!=_0xf42c('0x50')){return createEndUser(_0x4d332c,_0x340ba9,_0x3b7dd4,_0x3f6a38,_0x216179,_0x3ac7ea);}else{return{};}});break;}}function getCall(_0x2eb0ce,_0x18b848,_0x3865b4,_0x548db7,_0x3816fe,_0x574518,_0x1f5beb,_0x3f2dd7){logger[_0xf42c('0x2b')](_0xf42c('0x51'));var _0x2ecc2a={};_0x2ecc2a[_0xf42c('0x52')]={'name':!_[_0xf42c('0x19')](_0x548db7[_0xf42c('0x40')][_0xf42c('0x16')])&&!_[_0xf42c('0x19')](_0x548db7[_0xf42c('0x35')][_0xf42c('0x16')])&&_0x548db7[_0xf42c('0x35')][_0xf42c('0x16')]===_0xf42c('0x53')?_0x548db7['role']['name']:!_[_0xf42c('0x19')](_0x548db7[_0xf42c('0x41')])?_0x548db7[_0xf42c('0x41')]+'\x20'+_0x548db7['last_name']:_0x548db7['last_name'],'id':_0x548db7['id']};_0x2ecc2a[_0xf42c('0x54')]=intUtil[_0xf42c('0x55')](_0x574518[_0xf42c('0x56')],_0x1f5beb,'\x20');_0x2ecc2a['Description']=intUtil[_0xf42c('0x55')](_0x574518['Descriptions'],_0x1f5beb,'\x0a');if(_0x3816fe[_0xf42c('0x3b')]===_0xf42c('0x4e')){_0x2ecc2a[_0xf42c('0x57')]={'name':!_[_0xf42c('0x19')](_0x3816fe[_0xf42c('0x58')])?_0x3816fe[_0xf42c('0x58')]:!_[_0xf42c('0x19')](_0x3816fe['First_Name'])?_0x3816fe[_0xf42c('0x59')]+'\x20'+_0x3816fe[_0xf42c('0x5a')]:_0x3816fe[_0xf42c('0x5a')],'id':_0x3816fe['id']};}if(_0x3816fe[_0xf42c('0x3b')]===_0xf42c('0x5b')){_0x2ecc2a[_0xf42c('0x5c')]={'name':!_['isNil'](_0x3816fe[_0xf42c('0x58')])?_0x3816fe[_0xf42c('0x58')]:!_[_0xf42c('0x19')](_0x3816fe[_0xf42c('0x59')])?_0x3816fe[_0xf42c('0x59')]+'\x20'+_0x3816fe[_0xf42c('0x5a')]:_0x3816fe[_0xf42c('0x5a')],'id':_0x3816fe['id']};_0x2ecc2a['$se_module']=_[_0xf42c('0x3e')](_0x3816fe[_0xf42c('0x3b')]);}if(_0x1f5beb['talktime']){_0x2ecc2a[_0xf42c('0x5d')]=moment[_0xf42c('0x5e')](parseInt(_0x1f5beb[_0xf42c('0x5f')])*0x3e8)['format'](_0xf42c('0x60'));}else if(_0x1f5beb[_0xf42c('0x61')]&&_0x1f5beb[_0xf42c('0x62')]){_0x2ecc2a[_0xf42c('0x5d')]=moment[_0xf42c('0x5e')](moment(_0x1f5beb[_0xf42c('0x62')],_0xf42c('0x63'))[_0xf42c('0x64')](moment(_0x1f5beb[_0xf42c('0x65')],_0xf42c('0x63'))))[_0xf42c('0x66')](_0xf42c('0x60'));}switch(_0x1f5beb[_0xf42c('0x67')]){case'called':_0x2ecc2a[_0xf42c('0x68')]=_0xf42c('0x69');break;case _0xf42c('0x6a'):case'connect':_0x2ecc2a[_0xf42c('0x68')]=_0xf42c('0x6b');break;case _0xf42c('0x6c'):_0x2ecc2a[_0xf42c('0x68')]=_0xf42c('0x6d');break;case _0xf42c('0x6e'):_0x2ecc2a[_0xf42c('0x68')]='Abandoned';break;case _0xf42c('0x6f'):_0x2ecc2a[_0xf42c('0x68')]='Timeout';default:}_0x2ecc2a[_0xf42c('0x70')]=(_0x3f2dd7===_0xf42c('0x71')?moment(_0x1f5beb[_0xf42c('0x65')])[_0xf42c('0x66')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x1f5beb[_0xf42c('0x72')])['format'](_0xf42c('0x63')))||moment()[_0xf42c('0x66')](_0xf42c('0x63'));_0x2ecc2a[_0xf42c('0x73')]=_0x3f2dd7||_0xf42c('0x74');_0x2ecc2a=_[_0xf42c('0x75')](_0x2ecc2a,getCustomFields(_0x574518[_0xf42c('0x76')],_0x1f5beb));return request({'method':_0xf42c('0x3c'),'uri':_0xf42c('0x4c')+_0x18b848+_0xf42c('0x77'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2eb0ce},'body':{'data':[_0x2ecc2a]},'json':!![]})[_0xf42c('0x27')](function(_0x1eab4a){if(_0x1eab4a&&_0x1eab4a[_0xf42c('0x43')][0x0][_0xf42c('0x44')]===_0xf42c('0x45')){logger[_0xf42c('0x2b')](_0xf42c('0x78'));return{'id':_0x1eab4a[_0xf42c('0x43')][0x0][_0xf42c('0x46')]['id']};}})[_0xf42c('0x3a')](function(_0x3f7961){logger[_0xf42c('0x2b')](_0xf42c('0x79'),_0x3f7961['stack']);console[_0xf42c('0x47')]('err',_0x3f7961);});}exports[_0xf42c('0x7a')]=function(_0x520cde,_0x1fb144,_0x26040a,_0x2eae9f,_0x56fa90,_0xda9610){var _0x55fb9f,_0x271953,_0x5dd9e8;_0xda9610[_0xf42c('0x7b')]=intUtil[_0xf42c('0x7c')](_0xda9610[_0xf42c('0x7b')]);_0xda9610['serverUrl']=intUtil[_0xf42c('0x7c')](_0xda9610[_0xf42c('0x7d')]);if(_0x56fa90&&_0x56fa90[_0xf42c('0x7e')]){logger[_0xf42c('0x2b')](_0xf42c('0x7f'),'Recording\x20is\x20enabled!');_0x1fb144[_0xf42c('0x80')]=_0xda9610['serverUrl']+_0xf42c('0x81')+_0x1fb144[_0xf42c('0x82')]+_0xf42c('0x83')+md5(_0x1fb144[_0xf42c('0x82')]);}else{_0x1fb144[_0xf42c('0x80')]='';}var _0xebb440=_0xda9610[_0xf42c('0x7b')]===_0xf42c('0x84')?'eu':_0xf42c('0x85');return getAccessToken(_0xda9610)[_0xf42c('0x27')](function(_0xf2a16a){_0x5dd9e8=_0xf2a16a;return getUser(_0x5dd9e8,_0xebb440,_0xda9610,_0x2eae9f[_0xf42c('0x33')]);})['then'](function(_0x53388a){_0x55fb9f=_0x53388a;logger['info']('The\x20User\x20ID\x20is:',_0x55fb9f['id']);return getEndUser(_0x5dd9e8,_0xebb440,_0xda9610,_0x1fb144[_0xf42c('0x86')],_0x1fb144[_0xf42c('0x87')],_0x55fb9f,_0x26040a);})[_0xf42c('0x27')](function(_0x2d9e39){_0x271953=_0x2d9e39;return getCall(_0x5dd9e8,_0xebb440,_0xda9610,_0x55fb9f,_0x271953,_0x26040a,_0x1fb144,'Inbound');})[_0xf42c('0x27')](function(_0x44e47b){if(_0x44e47b){logger[_0xf42c('0x2b')]('The\x20Call\x20ID\x20is:',_0x44e47b['id']);logger[_0xf42c('0x2b')](_0xf42c('0x7f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf42c('0x66')](_0xf42c('0x88'),_0x2eae9f[_0xf42c('0x16')]),_0xf42c('0x89'),{'uri':_0xf42c('0x8a')+_0xda9610['host']+_0xf42c('0x8b')+_0x44e47b['id']});}})['catch'](function(_0x19f570){logger[_0xf42c('0x28')](_0xf42c('0x7f'),JSON['stringify'](_0x19f570));});};exports[_0xf42c('0x71')]=function(_0xb77524,_0x3370bf,_0x359f38,_0x38be39,_0x1a86ec,_0x24742c,_0x4ac6c2){var _0x58314c,_0x4be42e,_0x482455;_0x24742c[_0xf42c('0x7b')]=intUtil['stripTrailingSlash'](_0x24742c[_0xf42c('0x7b')]);_0x24742c[_0xf42c('0x7d')]=intUtil[_0xf42c('0x7c')](_0x24742c['serverUrl']);if(_0x4ac6c2&&_0x4ac6c2[_0xf42c('0x8c')]&&_0x4ac6c2['recordingFormat']!==_0xf42c('0x8d')){logger[_0xf42c('0x2b')](_0xf42c('0x8e'),'Recording\x20is\x20enabled!');_0x3370bf[_0xf42c('0x80')]=_0x24742c[_0xf42c('0x7d')]+_0xf42c('0x81')+_0x3370bf[_0xf42c('0x82')]+_0xf42c('0x83')+md5(_0x3370bf[_0xf42c('0x82')]);}var _0x2053f1=_0x24742c[_0xf42c('0x7b')]===_0xf42c('0x84')?'eu':_0xf42c('0x85');return getAccessToken(_0x24742c)[_0xf42c('0x27')](function(_0x578b53){_0x482455=_0x578b53;return getUser(_0x482455,_0x2053f1,_0x24742c,_0x38be39[_0xf42c('0x33')]);})[_0xf42c('0x27')](function(_0x694805){_0x58314c=_0x694805;logger[_0xf42c('0x2b')](_0xf42c('0x8f'),_0x58314c['id']);return getEndUser(_0x482455,_0x2053f1,_0x24742c,_0x3370bf[_0xf42c('0x90')],_0x3370bf['destcalleridnum'],_0x58314c,_0x359f38);})[_0xf42c('0x27')](function(_0x4ef9f8){_0x4be42e=_0x4ef9f8;return getCall(_0x482455,_0x2053f1,_0x24742c,_0x58314c,_0x4be42e,_0x359f38,_0x3370bf,'Outbound');})[_0xf42c('0x27')](function(_0x57db3d){if(_0x57db3d){logger[_0xf42c('0x2b')](_0xf42c('0x91'),_0x57db3d['id']);logger[_0xf42c('0x2b')]('[OUTBOUND]',_0xf42c('0x92'));emit(util['format']('user:%s',_0x38be39[_0xf42c('0x16')]),_0xf42c('0x89'),{'uri':_0xf42c('0x8a')+_0x24742c['host']+_0xf42c('0x8b')+_0x57db3d['id']});}})[_0xf42c('0x3a')](function(_0x2d7a5f){logger['error'](_0xf42c('0x8e'),JSON[_0xf42c('0xa')](_0x2d7a5f));});};exports['unmanaged']=function(_0x3cc531,_0x2d40ab,_0x2c0ee4,_0x86da6d,_0x4326d5,_0x1eb781){var _0x3e34f7,_0x3cfcb0,_0x94b2f2;_0x1eb781['host']=intUtil[_0xf42c('0x7c')](_0x1eb781['host']);_0x1eb781[_0xf42c('0x7d')]=intUtil[_0xf42c('0x7c')](_0x1eb781[_0xf42c('0x7d')]);if(_0x4326d5&&_0x4326d5[_0xf42c('0x7e')]){logger['info']('['+_0x2d40ab[_0xf42c('0x67')][_0xf42c('0x93')]()+']',_0xf42c('0x94'));_0x2d40ab[_0xf42c('0x80')]=_0x1eb781[_0xf42c('0x7d')]+_0xf42c('0x81')+_0x2d40ab[_0xf42c('0x82')]+_0xf42c('0x83')+md5(_0x2d40ab['uniqueid']);}else{_0x2d40ab[_0xf42c('0x80')]='';}var _0x3859b4=_0x1eb781['host']===_0xf42c('0x84')?'eu':_0xf42c('0x85');return getAccessToken(_0x1eb781)[_0xf42c('0x27')](function(_0xc4fbff){_0x94b2f2=_0xc4fbff;return getUser(_0x94b2f2,_0x3859b4,_0x1eb781);})['then'](function(_0x361949){_0x3e34f7=_0x361949;logger[_0xf42c('0x2b')](_0xf42c('0x8f'),_0x3e34f7['id']);return getEndUser(_0x94b2f2,_0x3859b4,_0x1eb781,_0x2d40ab[_0xf42c('0x86')],_0x2d40ab[_0xf42c('0x87')],_0x3e34f7,_0x2c0ee4);})[_0xf42c('0x27')](function(_0x218c23){_0x3cfcb0=_0x218c23;return getCall(_0x94b2f2,_0x3859b4,_0x1eb781,_0x3e34f7,_0x3cfcb0,_0x2c0ee4,_0x2d40ab,_0xf42c('0x74'));})[_0xf42c('0x27')](function(_0x5dbe82){if(_0x5dbe82){logger[_0xf42c('0x2b')](_0xf42c('0x91'),_0x5dbe82['id']);}})[_0xf42c('0x3a')](function(_0x3eed5f){logger[_0xf42c('0x28')]('['+_0x2d40ab['lastevent'][_0xf42c('0x93')]()+']',JSON['stringify'](_0x3eed5f));});}; \ 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 d726c5f..c81d369 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 _0x5489=['exec','data2','Script','data3','render','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','trigger'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x5489,0x15c));var _0x9548=function(_0x5d2942,_0x1bf2ff){_0x5d2942=_0x5d2942-0x0;var _0x332b83=_0x5489[_0x5d2942];return _0x332b83;};'use strict';var util=require(_0x9548('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x9548('0x1'));exports[_0x9548('0x2')]=function(_0xb4d06d,_0x4a359d){var _0x148716=_0xb4d06d[_0x9548('0x3')]?_0xb4d06d[_0x9548('0x3')]:_0x9548('0x4');var _0xdcc274=_0xb4d06d[_0x9548('0x5')]?Mustache[_0x9548('0x6')](_0xb4d06d[_0x9548('0x5')],_0x4a359d):_0x4a359d;sh['exec'](_0xdcc274,function(_0x557105,_0x54d331,_0x3fc75f){if(_0x557105!==0x0){logger['error'](util['format'](_0x9548('0x7'),_0x148716,_0xdcc274,_0x557105,_0x3fc75f));}else{logger['info'](util[_0x9548('0x8')](_0x9548('0x9'),_0x148716,_0xdcc274,_0x54d331));}});}; \ No newline at end of file +var _0x9f0e=['Script','data3','render','exec','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','data2'];(function(_0x3397c1,_0x55ae56){var _0x33a38b=function(_0x43e2d1){while(--_0x43e2d1){_0x3397c1['push'](_0x3397c1['shift']());}};_0x33a38b(++_0x55ae56);}(_0x9f0e,0x18d));var _0xe9f0=function(_0x2e27d2,_0x32972c){_0x2e27d2=_0x2e27d2-0x0;var _0x239e9e=_0x9f0e[_0x2e27d2];return _0x239e9e;};'use strict';var util=require(_0xe9f0('0x0'));var sh=require(_0xe9f0('0x1'));var Mustache=require(_0xe9f0('0x2'));var logger=require(_0xe9f0('0x3'))(_0xe9f0('0x4'));exports['exec']=function(_0x553d66,_0x2c64e8){var _0x2a5b65=_0x553d66[_0xe9f0('0x5')]?_0x553d66[_0xe9f0('0x5')]:_0xe9f0('0x6');var _0x327643=_0x553d66[_0xe9f0('0x7')]?Mustache[_0xe9f0('0x8')](_0x553d66[_0xe9f0('0x7')],_0x2c64e8):_0x2c64e8;sh[_0xe9f0('0x9')](_0x327643,function(_0x25d89f,_0x2fef0a,_0x12d839){if(_0x25d89f!==0x0){logger['error'](util[_0xe9f0('0xa')](_0xe9f0('0xb'),_0x2a5b65,_0x327643,_0x25d89f,_0x12d839));}else{logger['info'](util[_0xe9f0('0xa')](_0xe9f0('0xc'),_0x2a5b65,_0x327643,_0x2fef0a));}});}; \ 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 92d383a..19c7625 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 _0xf089=['then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','data2','name','message','request-promise','util','mustache','trigger','exec','data1','toUpperCase','render','data5','headers','parse','data6','error','stack','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x492322,_0x42e68c){var _0x1dfdbd=function(_0x2063d0){while(--_0x2063d0){_0x492322['push'](_0x492322['shift']());}};_0x1dfdbd(++_0x42e68c);}(_0xf089,0x83));var _0x9f08=function(_0x1e8fe3,_0x590dfe){_0x1e8fe3=_0x1e8fe3-0x0;var _0x1c10a8=_0xf089[_0x1e8fe3];return _0x1c10a8;};'use strict';var rp=require(_0x9f08('0x0'));var util=require(_0x9f08('0x1'));var _=require('lodash');var Mustache=require(_0x9f08('0x2'));var logger=require('../../../../config/logger')(_0x9f08('0x3'));exports[_0x9f08('0x4')]=function(_0xa9a5ad,_0x1741d3){var _0x59a566,_0x48fb4a;var _0x1ba7f3={'method':_0xa9a5ad[_0x9f08('0x5')][_0x9f08('0x6')](),'uri':Mustache[_0x9f08('0x7')](_0xa9a5ad['data2'],_0x1741d3),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xa9a5ad['data5'])==='number'&&parseInt(_0xa9a5ad[_0x9f08('0x8')])>=0x1&&parseInt(_0xa9a5ad['data5'])<=0xa?parseInt(_0xa9a5ad['data5'])*0x3e8:0x5*0x3e8};try{_0x1ba7f3[_0x9f08('0x9')]=_0xa9a5ad['data6']?JSON[_0x9f08('0xa')](Mustache[_0x9f08('0x7')](_0xa9a5ad[_0x9f08('0xb')],_0x1741d3)):{};}catch(_0x1295a0){logger[_0x9f08('0xc')](_0x1295a0[_0x9f08('0xd')]);}switch(_0xa9a5ad[_0x9f08('0x5')][_0x9f08('0x6')]()){case _0x9f08('0xe'):case _0x9f08('0xf'):_0x59a566=null;_0x1ba7f3['qs']=_0x1741d3;break;case _0x9f08('0x10'):case _0x9f08('0x11'):if(_0xa9a5ad['data7']){try{_0x59a566=JSON[_0x9f08('0xa')](Mustache[_0x9f08('0x7')](_0xa9a5ad[_0x9f08('0x12')],_0x1741d3));_0x1ba7f3[_0x9f08('0x13')]=_0x59a566;}catch(_0x2e45fb){logger[_0x9f08('0xc')](_0x2e45fb[_0x9f08('0xd')]);logger[_0x9f08('0xc')](_0x9f08('0x14'));}}else{_0x59a566=_0x1741d3;_0x1ba7f3[_0x9f08('0x13')]=_0x59a566;}break;}logger[_0x9f08('0x15')](util[_0x9f08('0x16')](_0x9f08('0x17'),_0xa9a5ad[_0x9f08('0x5')],_0xa9a5ad['data2'],JSON['stringify'](_0x1ba7f3)));rp(_0x1ba7f3)[_0x9f08('0x18')](function(_0x53e023){_0x59a566=!_[_0x9f08('0x19')](_0x59a566)?',\x20request\x20body:\x20'+_0x59a566:'';_0x48fb4a=typeof _0x53e023['body']==='object'?JSON['stringify'](_0x53e023[_0x9f08('0x13')]):_0x53e023[_0x9f08('0x13')];logger[_0x9f08('0x15')](util[_0x9f08('0x16')](_0x9f08('0x1a'),_0xa9a5ad[_0x9f08('0x5')],_0xa9a5ad['data2'],_0x53e023['statusCode'],_0x48fb4a));})['catch'](function(_0x221bc3){logger['error'](util[_0x9f08('0x16')](_0x9f08('0x1b'),_0xa9a5ad[_0x9f08('0x5')],_0xa9a5ad[_0x9f08('0x1c')],_0x221bc3['statusCode'],_0x221bc3[_0x9f08('0x1d')],_0x221bc3[_0x9f08('0x1e')]));});}; \ No newline at end of file +var _0xe51c=['exec','data1','render','data2','data5','number','headers','data6','parse','error','stack','toUpperCase','GET','DELETE','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil','object','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','mustache','trigger'];(function(_0x2b8d9e,_0x38f52a){var _0x380e14=function(_0xfc9680){while(--_0xfc9680){_0x2b8d9e['push'](_0x2b8d9e['shift']());}};_0x380e14(++_0x38f52a);}(_0xe51c,0xf7));var _0xce51=function(_0x2ee4f5,_0x5b790e){_0x2ee4f5=_0x2ee4f5-0x0;var _0x276d6b=_0xe51c[_0x2ee4f5];return _0x276d6b;};'use strict';var rp=require(_0xce51('0x0'));var util=require(_0xce51('0x1'));var _=require(_0xce51('0x2'));var Mustache=require(_0xce51('0x3'));var logger=require('../../../../config/logger')(_0xce51('0x4'));exports[_0xce51('0x5')]=function(_0xf23dbc,_0x4c384d){var _0x36195d,_0x3f742f;var _0x2a852b={'method':_0xf23dbc[_0xce51('0x6')]['toUpperCase'](),'uri':Mustache[_0xce51('0x7')](_0xf23dbc[_0xce51('0x8')],_0x4c384d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xf23dbc[_0xce51('0x9')])===_0xce51('0xa')&&parseInt(_0xf23dbc[_0xce51('0x9')])>=0x1&&parseInt(_0xf23dbc['data5'])<=0xa?parseInt(_0xf23dbc[_0xce51('0x9')])*0x3e8:0x5*0x3e8};try{_0x2a852b[_0xce51('0xb')]=_0xf23dbc[_0xce51('0xc')]?JSON[_0xce51('0xd')](Mustache[_0xce51('0x7')](_0xf23dbc[_0xce51('0xc')],_0x4c384d)):{};}catch(_0xc4d1fc){logger[_0xce51('0xe')](_0xc4d1fc[_0xce51('0xf')]);}switch(_0xf23dbc[_0xce51('0x6')][_0xce51('0x10')]()){case _0xce51('0x11'):case _0xce51('0x12'):_0x36195d=null;_0x2a852b['qs']=_0x4c384d;break;case'POST':case _0xce51('0x13'):if(_0xf23dbc[_0xce51('0x14')]){try{_0x36195d=JSON[_0xce51('0xd')](Mustache[_0xce51('0x7')](_0xf23dbc[_0xce51('0x14')],_0x4c384d));_0x2a852b['body']=_0x36195d;}catch(_0x2f68e0){logger[_0xce51('0xe')](_0x2f68e0[_0xce51('0xf')]);logger[_0xce51('0xe')](_0xce51('0x15'));}}else{_0x36195d=_0x4c384d;_0x2a852b[_0xce51('0x16')]=_0x36195d;}break;}logger['info'](util[_0xce51('0x17')](_0xce51('0x18'),_0xf23dbc[_0xce51('0x6')],_0xf23dbc['data2'],JSON['stringify'](_0x2a852b)));rp(_0x2a852b)[_0xce51('0x19')](function(_0x3b4a2a){_0x36195d=!_[_0xce51('0x1a')](_0x36195d)?',\x20request\x20body:\x20'+_0x36195d:'';_0x3f742f=typeof _0x3b4a2a[_0xce51('0x16')]===_0xce51('0x1b')?JSON[_0xce51('0x1c')](_0x3b4a2a['body']):_0x3b4a2a[_0xce51('0x16')];logger[_0xce51('0x1d')](util[_0xce51('0x17')](_0xce51('0x1e'),_0xf23dbc[_0xce51('0x6')],_0xf23dbc[_0xce51('0x8')],_0x3b4a2a[_0xce51('0x1f')],_0x3f742f));})[_0xce51('0x20')](function(_0x556c46){logger['error'](util['format'](_0xce51('0x21'),_0xf23dbc['data1'],_0xf23dbc['data2'],_0x556c46[_0xce51('0x1f')],_0x556c46[_0xce51('0x22')],_0x556c46[_0xce51('0x23')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 664f5c0..03ba6c4 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 _0x2136=['rpc','error','message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug'];(function(_0x3ee04d,_0x5cc30f){var _0x4facf7=function(_0x22ad69){while(--_0x22ad69){_0x3ee04d['push'](_0x3ee04d['shift']());}};_0x4facf7(++_0x5cc30f);}(_0x2136,0x105));var _0x6213=function(_0xb1c60b,_0x385134){_0xb1c60b=_0xb1c60b-0x0;var _0x4c391d=_0x2136[_0xb1c60b];return _0x4c391d;};'use strict';var jayson=require(_0x6213('0x0'));var BPromise=require('bluebird');var logger=require(_0x6213('0x1'))(_0x6213('0x2'));var client=jayson[_0x6213('0x3')][_0x6213('0x4')]({'port':0x2329});client[_0x6213('0x5')]=function(_0x53c412,_0x48d53d){return new BPromise(function(_0x33fb7e,_0x3da3d7){return client[_0x6213('0x6')](_0x53c412,_0x48d53d)[_0x6213('0x7')](function(_0x24ca81){logger[_0x6213('0x8')](_0x6213('0x9'),_0x6213('0x2'),_0x53c412,_0x48d53d,_0x24ca81);if(_0x24ca81['error']){logger[_0x6213('0xa')]('rpc','routing',_0x53c412,_0x24ca81[_0x6213('0xa')][_0x6213('0xb')],_0x48d53d);return _0x3da3d7(_0x24ca81['error'][_0x6213('0xb')]);}else{return _0x33fb7e(_0x24ca81[_0x6213('0xc')]);}})[_0x6213('0xd')](function(_0x41fa5b){logger[_0x6213('0xa')](_0x6213('0x9'),'routing',_0x53c412,_0x41fa5b,_0x48d53d);return _0x3da3d7(_0x41fa5b);});});};module[_0x6213('0xe')]=client; \ No newline at end of file +var _0xcec7=['rpc','error','routing','message','result','catch','exports','jayson/promise','../../config/logger','client','http','Request','request','then','debug'];(function(_0x1f7e82,_0x448fd4){var _0x3fc53f=function(_0x387d56){while(--_0x387d56){_0x1f7e82['push'](_0x1f7e82['shift']());}};_0x3fc53f(++_0x448fd4);}(_0xcec7,0x1c9));var _0x7cec=function(_0x42afde,_0x377195){_0x42afde=_0x42afde-0x0;var _0x5e9990=_0xcec7[_0x42afde];return _0x5e9990;};'use strict';var jayson=require(_0x7cec('0x0'));var BPromise=require('bluebird');var logger=require(_0x7cec('0x1'))('routing');var client=jayson[_0x7cec('0x2')][_0x7cec('0x3')]({'port':0x2329});client[_0x7cec('0x4')]=function(_0x1ef419,_0xf7a214){return new BPromise(function(_0x12558f,_0x1d3735){return client[_0x7cec('0x5')](_0x1ef419,_0xf7a214)[_0x7cec('0x6')](function(_0x3376e1){logger[_0x7cec('0x7')](_0x7cec('0x8'),'routing',_0x1ef419,_0xf7a214,_0x3376e1);if(_0x3376e1['error']){logger[_0x7cec('0x9')](_0x7cec('0x8'),_0x7cec('0xa'),_0x1ef419,_0x3376e1[_0x7cec('0x9')]['message'],_0xf7a214);return _0x1d3735(_0x3376e1[_0x7cec('0x9')][_0x7cec('0xb')]);}else{return _0x12558f(_0x3376e1[_0x7cec('0xc')]);}})[_0x7cec('0xd')](function(_0x400dff){logger[_0x7cec('0x9')](_0x7cec('0x8'),_0x7cec('0xa'),_0x1ef419,_0x400dff,_0xf7a214);return _0x1d3735(_0x400dff);});});};module[_0x7cec('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index d562f70..47a160d 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 _0x2925=['resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','Email\x20service\x20initialization','./rpc/setting','../../config/logger'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x2925,0x8d));var _0x5292=function(_0x45e504,_0x2171ea){_0x45e504=_0x45e504-0x0;var _0x2325d2=_0x2925[_0x45e504];return _0x2325d2;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0x5292('0x0'));var logger=require(_0x5292('0x1'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x5292('0x2')]()[_0x5292('0x3')](mailAccount[_0x5292('0x4')]())['then'](realtime[_0x5292('0x5')]())['then'](function(){email[_0x5292('0x6')](realtime[_0x5292('0x7')]);return realtime;});}function main(){return server[_0x5292('0x8')](realtime,email)['then'](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0x5292('0x3')](function(_0x43aba6){return setInterval(initRealtime,_0x43aba6[_0x5292('0x9')]*0x3e8);})['catch'](function(_0x2d1a77){logger['error'](_0x5292('0xa'),_0x2d1a77);});}main(); \ No newline at end of file +var _0xfe99=['mailAccounts','listen','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/setting','../../config/logger','email','then','getMailAccounts','refresh'];(function(_0x5603dc,_0x1f1644){var _0x301da7=function(_0x163218){while(--_0x163218){_0x5603dc['push'](_0x5603dc['shift']());}};_0x301da7(++_0x1f1644);}(_0xfe99,0xc8));var _0x9fe9=function(_0x430ab7,_0x4f321a){_0x430ab7=_0x430ab7-0x0;var _0x1b3e9d=_0xfe99[_0x430ab7];return _0x1b3e9d;};'use strict';var server=require('./server');var Realtime=require(_0x9fe9('0x0'));var EmailChannel=require(_0x9fe9('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x9fe9('0x2'));var logger=require(_0x9fe9('0x3'))(_0x9fe9('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x9fe9('0x5')](mailAccount[_0x9fe9('0x6')]())[_0x9fe9('0x5')](realtime['initMailAccounts']())['then'](function(){email[_0x9fe9('0x7')](realtime[_0x9fe9('0x8')]);return realtime;});}function main(){return server[_0x9fe9('0x9')](realtime,email)[_0x9fe9('0x5')](function(){return initRealtime();})[_0x9fe9('0x5')](function(){return setting['getSettings']();})[_0x9fe9('0x5')](function(_0x44c119){return setInterval(initRealtime,_0x44c119['loginMailFrequency']*0x3e8);})[_0x9fe9('0xa')](function(_0x48f7d1){logger[_0x9fe9('0xb')](_0x9fe9('0xc'),_0x48f7d1);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 00f3506..03e8e87 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 _0x38c3=['./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','mailAccount:update','refresh','provider','custom','service','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','isNil','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verify','exports','lodash','moment','md5','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter'];(function(_0x41f15f,_0x1a39ef){var _0x269a71=function(_0x52c50e){while(--_0x52c50e){_0x41f15f['push'](_0x41f15f['shift']());}};_0x269a71(++_0x1a39ef);}(_0x38c3,0x153));var _0x338c=function(_0x32ffb5,_0x3866b5){_0x32ffb5=_0x32ffb5-0x0;var _0x3cbd7a=_0x38c3[_0x32ffb5];return _0x3cbd7a;};'use strict';var _=require(_0x338c('0x0'));var moment=require(_0x338c('0x1'));var BPromise=require('bluebird');var md5=require(_0x338c('0x2'));var Redis=require('ioredis');var config=require(_0x338c('0x3'));var logger=require(_0x338c('0x4'))(_0x338c('0x5'));config['redis']=_['defaults'](config[_0x338c('0x6')],{'host':_0x338c('0x7'),'port':0x18eb});var io=require(_0x338c('0x8'))(new Redis(config['redis']));var EmailImap=require(_0x338c('0x9'));var EmailSmtp=require(_0x338c('0xa'));var mailAccount=require(_0x338c('0xb'));var md5Accounts={};function EmailChannel(_0x35e81d){logger[_0x338c('0xc')](_0x338c('0xd'));this[_0x338c('0xe')]=_0x35e81d[_0x338c('0xe')];this[_0x338c('0xf')]={};this[_0x338c('0x10')]=new EmailSmtp();}EmailChannel[_0x338c('0x11')][_0x338c('0x12')]=function(_0x46946c){var _0x14cd5=this[_0x338c('0xe')][_0x46946c];var _0x556c32={'id':_0x14cd5['id'],'name':_0x14cd5[_0x338c('0x13')],'key':_0x14cd5[_0x338c('0x14')],'active':_0x14cd5[_0x338c('0x15')],'Imap':{'status':_0x14cd5[_0x338c('0x16')]['status'],'messageStatus':_0x14cd5['Imap'][_0x338c('0x17')],'total':_0x14cd5[_0x338c('0x16')][_0x338c('0x18')]}};if(_['isNil'](md5Accounts[_0x46946c])){md5Accounts[_0x46946c]={};}var _0x448393=md5(JSON['stringify'](_0x556c32));if(md5Accounts[_0x46946c][_0x338c('0x2')]!==_0x448393){md5Accounts[_0x46946c][_0x338c('0x2')]=_0x448393;io[_0x338c('0x12')](_0x338c('0x19'),_0x556c32);}};EmailChannel[_0x338c('0x11')][_0x338c('0x1a')]=function(_0x463507){for(var _0x7fde0c in _0x463507){if(_0x463507['hasOwnProperty'](_0x7fde0c)){if(_0x463507[_0x7fde0c][_0x338c('0x16')]&&_0x463507[_0x7fde0c][_0x338c('0x15')]){var _0x33e4d7=_0x463507[_0x7fde0c][_0x338c('0x16')];if(!_0x33e4d7['service']&&_0x463507[_0x7fde0c][_0x338c('0x1b')]!==_0x338c('0x1c'))_0x33e4d7[_0x338c('0x1d')]=_0x463507[_0x7fde0c][_0x338c('0x1b')];if(!this[_0x338c('0xf')][_0x338c('0x1e')](_0x33e4d7['id'])){this['imapAccounts'][_0x33e4d7['id']]=new EmailImap(_0x33e4d7,_0x463507[_0x7fde0c][_0x338c('0x5')]);this['imapAccounts'][_0x33e4d7['id']]['on']('box',this[_0x338c('0x1f')][_0x338c('0x20')](this,_0x7fde0c));this['imapAccounts'][_0x33e4d7['id']]['on']('email',this[_0x338c('0x21')][_0x338c('0x20')](this,_0x7fde0c));this[_0x338c('0xf')][_0x33e4d7['id']]['on'](_0x338c('0x22'),this[_0x338c('0x23')]['bind'](this,_0x7fde0c));this['imapAccounts'][_0x33e4d7['id']]['on'](_0x338c('0x24'),this['handleImapError']['bind'](this,_0x7fde0c));}}else{if(_[_0x338c('0x25')](this[_0x338c('0xe')][_0x7fde0c]['Imap'])){this[_0x338c('0xe')][_0x7fde0c]['Imap']={};}this['mailAccounts'][_0x7fde0c][_0x338c('0x16')]['status']='disabled';this['mailAccounts'][_0x7fde0c]['Imap']['messageStatus']='';this[_0x338c('0x12')](_0x7fde0c);}}}};EmailChannel[_0x338c('0x11')]['handleImapBox']=function(_0x266782,_0x1fa262){if(this[_0x338c('0xe')][_0x266782]){this[_0x338c('0xe')][_0x266782]['Imap'][_0x338c('0x26')]=_0x338c('0x27');this[_0x338c('0xe')][_0x266782][_0x338c('0x16')][_0x338c('0x17')]=_0x1fa262[_0x338c('0x13')];if(_0x1fa262[_0x338c('0x28')]){this['mailAccounts'][_0x266782][_0x338c('0x16')]['total']=_0x1fa262[_0x338c('0x28')][_0x338c('0x18')];}return this['emit'](_0x266782);}};EmailChannel[_0x338c('0x11')]['handleImapEmail']=function(_0x2596f5,_0x53033c){logger[_0x338c('0xc')](_0x338c('0x29'),_0x53033c[_0x338c('0x2a')],_0x53033c['lastName'],_0x53033c[_0x338c('0x2b')],_0x2596f5);if(this[_0x338c('0xe')][_0x2596f5]){return mailAccount[_0x338c('0x2c')](_0x2596f5,_0x53033c)[_0x338c('0x2d')](function(_0xb7c47e){if(_0xb7c47e){logger[_0x338c('0xc')](_0x338c('0x2e'));}})[_0x338c('0x2f')](function(_0x1638e2){logger[_0x338c('0x24')](_0x338c('0x30'),JSON[_0x338c('0x31')](_0x1638e2));});}};EmailChannel[_0x338c('0x11')]['handleImapEnd']=function(_0x1a235f){if(this[_0x338c('0xe')][_0x1a235f]&&this[_0x338c('0xe')][_0x1a235f][_0x338c('0x16')]){if(this[_0x338c('0xf')][this[_0x338c('0xe')][_0x1a235f][_0x338c('0x16')]['id']]){delete this[_0x338c('0xf')][this[_0x338c('0xe')][_0x1a235f]['Imap']['id']];}this[_0x338c('0xe')][_0x1a235f]['Imap'][_0x338c('0x32')]=moment();this[_0x338c('0x12')](_0x1a235f);}};EmailChannel['prototype'][_0x338c('0x33')]=function(_0x3d9359,_0x2df060){if(this['mailAccounts'][_0x3d9359]){this[_0x338c('0xe')][_0x3d9359][_0x338c('0x16')]['status']=_0x338c('0x24');this['mailAccounts'][_0x3d9359][_0x338c('0x16')][_0x338c('0x17')]=_0x2df060;return this[_0x338c('0x12')](_0x3d9359);}};EmailChannel['prototype'][_0x338c('0x34')]=function(_0x30bc64,_0x846174){return this['smtp'][_0x338c('0x35')](_0x30bc64,_0x846174);};EmailChannel[_0x338c('0x11')][_0x338c('0x36')]=function(_0x3351b9){var _0x1ffbe7=this;if(this[_0x338c('0xe')][_0x3351b9['id']]){if(_[_0x338c('0x25')](this[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')])){this[_0x338c('0xe')][_0x3351b9['id']]['Smtp']={};}this[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')]['lastSync']=moment();return new BPromise(function(_0x2e7ecb,_0x6341f8){return _0x1ffbe7['smtp']['verify'](_0x3351b9)[_0x338c('0x2d')](function(_0x13a0af){_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')][_0x338c('0x26')]='verified';_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')]['messageStatus']='';_0x1ffbe7['emit'](_0x3351b9['id']);_0x2e7ecb(_0x13a0af);})[_0x338c('0x2f')](function(_0x5efd8e){_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')]['status']='error';_0x1ffbe7[_0x338c('0xe')][_0x3351b9['id']][_0x338c('0x37')][_0x338c('0x17')]=_0x5efd8e;_0x1ffbe7[_0x338c('0x12')](_0x3351b9['id']);_0x6341f8(_0x5efd8e);});});}return this[_0x338c('0x10')][_0x338c('0x38')](_0x3351b9);};module[_0x338c('0x39')]=EmailChannel; \ No newline at end of file +var _0xbc03=['lastSync','verify','verified','exports','bluebird','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','prototype','emit','key','Imap','messageStatus','total','md5','refresh','hasOwnProperty','active','service','provider','custom','box','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','handleImapBox','status','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','smtp','isNil','Smtp'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xbc03,0xe8));var _0x3bc0=function(_0x411e55,_0x500863){_0x411e55=_0x411e55-0x0;var _0x374330=_0xbc03[_0x411e55];return _0x374330;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x3bc0('0x0'));var md5=require('md5');var Redis=require(_0x3bc0('0x1'));var config=require(_0x3bc0('0x2'));var logger=require(_0x3bc0('0x3'))(_0x3bc0('0x4'));config[_0x3bc0('0x5')]=_[_0x3bc0('0x6')](config[_0x3bc0('0x5')],{'host':_0x3bc0('0x7'),'port':0x18eb});var io=require(_0x3bc0('0x8'))(new Redis(config[_0x3bc0('0x5')]));var EmailImap=require(_0x3bc0('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x3bc0('0xa'));var md5Accounts={};function EmailChannel(_0xcf0656){logger[_0x3bc0('0xb')](_0x3bc0('0xc'));this[_0x3bc0('0xd')]=_0xcf0656['mailAccounts'];this[_0x3bc0('0xe')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x3bc0('0xf')][_0x3bc0('0x10')]=function(_0x2b2af7){var _0x438d04=this[_0x3bc0('0xd')][_0x2b2af7];var _0x5659aa={'id':_0x438d04['id'],'name':_0x438d04['name'],'key':_0x438d04[_0x3bc0('0x11')],'active':_0x438d04['active'],'Imap':{'status':_0x438d04[_0x3bc0('0x12')]['status'],'messageStatus':_0x438d04['Imap'][_0x3bc0('0x13')],'total':_0x438d04[_0x3bc0('0x12')][_0x3bc0('0x14')]}};if(_['isNil'](md5Accounts[_0x2b2af7])){md5Accounts[_0x2b2af7]={};}var _0x34dfba=md5(JSON['stringify'](_0x5659aa));if(md5Accounts[_0x2b2af7][_0x3bc0('0x15')]!==_0x34dfba){md5Accounts[_0x2b2af7][_0x3bc0('0x15')]=_0x34dfba;io[_0x3bc0('0x10')]('mailAccount:update',_0x5659aa);}};EmailChannel[_0x3bc0('0xf')][_0x3bc0('0x16')]=function(_0x4eab11){for(var _0x4d3c72 in _0x4eab11){if(_0x4eab11[_0x3bc0('0x17')](_0x4d3c72)){if(_0x4eab11[_0x4d3c72][_0x3bc0('0x12')]&&_0x4eab11[_0x4d3c72][_0x3bc0('0x18')]){var _0x11cc48=_0x4eab11[_0x4d3c72][_0x3bc0('0x12')];if(!_0x11cc48[_0x3bc0('0x19')]&&_0x4eab11[_0x4d3c72][_0x3bc0('0x1a')]!==_0x3bc0('0x1b'))_0x11cc48[_0x3bc0('0x19')]=_0x4eab11[_0x4d3c72][_0x3bc0('0x1a')];if(!this[_0x3bc0('0xe')][_0x3bc0('0x17')](_0x11cc48['id'])){this[_0x3bc0('0xe')][_0x11cc48['id']]=new EmailImap(_0x11cc48,_0x4eab11[_0x4d3c72][_0x3bc0('0x4')]);this['imapAccounts'][_0x11cc48['id']]['on'](_0x3bc0('0x1c'),this['handleImapBox'][_0x3bc0('0x1d')](this,_0x4d3c72));this[_0x3bc0('0xe')][_0x11cc48['id']]['on']('email',this[_0x3bc0('0x1e')]['bind'](this,_0x4d3c72));this[_0x3bc0('0xe')][_0x11cc48['id']]['on'](_0x3bc0('0x1f'),this[_0x3bc0('0x20')][_0x3bc0('0x1d')](this,_0x4d3c72));this[_0x3bc0('0xe')][_0x11cc48['id']]['on'](_0x3bc0('0x21'),this[_0x3bc0('0x22')][_0x3bc0('0x1d')](this,_0x4d3c72));}}else{if(_['isNil'](this['mailAccounts'][_0x4d3c72][_0x3bc0('0x12')])){this[_0x3bc0('0xd')][_0x4d3c72][_0x3bc0('0x12')]={};}this['mailAccounts'][_0x4d3c72][_0x3bc0('0x12')]['status']=_0x3bc0('0x23');this[_0x3bc0('0xd')][_0x4d3c72][_0x3bc0('0x12')]['messageStatus']='';this[_0x3bc0('0x10')](_0x4d3c72);}}}};EmailChannel[_0x3bc0('0xf')][_0x3bc0('0x24')]=function(_0xb11900,_0x22bcb7){if(this[_0x3bc0('0xd')][_0xb11900]){this[_0x3bc0('0xd')][_0xb11900][_0x3bc0('0x12')][_0x3bc0('0x25')]=_0x3bc0('0x26');this['mailAccounts'][_0xb11900][_0x3bc0('0x12')]['messageStatus']=_0x22bcb7[_0x3bc0('0x27')];if(_0x22bcb7[_0x3bc0('0x28')]){this[_0x3bc0('0xd')][_0xb11900][_0x3bc0('0x12')][_0x3bc0('0x14')]=_0x22bcb7['messages'][_0x3bc0('0x14')];}return this['emit'](_0xb11900);}};EmailChannel[_0x3bc0('0xf')][_0x3bc0('0x1e')]=function(_0x7ac2c4,_0x29e99c){logger[_0x3bc0('0xb')](_0x3bc0('0x29'),_0x29e99c['firstName'],_0x29e99c[_0x3bc0('0x2a')],_0x29e99c[_0x3bc0('0x2b')],_0x7ac2c4);if(this['mailAccounts'][_0x7ac2c4]){return mailAccount[_0x3bc0('0x2c')](_0x7ac2c4,_0x29e99c)[_0x3bc0('0x2d')](function(_0x5c2873){if(_0x5c2873){logger[_0x3bc0('0xb')](_0x3bc0('0x2e'));}})[_0x3bc0('0x2f')](function(_0x11993a){logger[_0x3bc0('0x21')](_0x3bc0('0x30'),JSON['stringify'](_0x11993a));});}};EmailChannel['prototype'][_0x3bc0('0x20')]=function(_0x5d40b7){if(this[_0x3bc0('0xd')][_0x5d40b7]&&this[_0x3bc0('0xd')][_0x5d40b7][_0x3bc0('0x12')]){if(this['imapAccounts'][this[_0x3bc0('0xd')][_0x5d40b7][_0x3bc0('0x12')]['id']]){delete this['imapAccounts'][this[_0x3bc0('0xd')][_0x5d40b7][_0x3bc0('0x12')]['id']];}this['mailAccounts'][_0x5d40b7][_0x3bc0('0x12')]['lastSync']=moment();this[_0x3bc0('0x10')](_0x5d40b7);}};EmailChannel[_0x3bc0('0xf')][_0x3bc0('0x22')]=function(_0x190865,_0x4b13af){if(this[_0x3bc0('0xd')][_0x190865]){this[_0x3bc0('0xd')][_0x190865][_0x3bc0('0x12')]['status']='error';this[_0x3bc0('0xd')][_0x190865][_0x3bc0('0x12')][_0x3bc0('0x13')]=_0x4b13af;return this[_0x3bc0('0x10')](_0x190865);}};EmailChannel['prototype'][_0x3bc0('0x31')]=function(_0x4ee6ea,_0x111bcf){return this[_0x3bc0('0x32')]['send'](_0x4ee6ea,_0x111bcf);};EmailChannel[_0x3bc0('0xf')]['verifySmtp']=function(_0x1d08ff){var _0x496299=this;if(this[_0x3bc0('0xd')][_0x1d08ff['id']]){if(_[_0x3bc0('0x33')](this[_0x3bc0('0xd')][_0x1d08ff['id']][_0x3bc0('0x34')])){this[_0x3bc0('0xd')][_0x1d08ff['id']][_0x3bc0('0x34')]={};}this[_0x3bc0('0xd')][_0x1d08ff['id']][_0x3bc0('0x34')][_0x3bc0('0x35')]=moment();return new BPromise(function(_0x587817,_0x2b7776){return _0x496299[_0x3bc0('0x32')][_0x3bc0('0x36')](_0x1d08ff)[_0x3bc0('0x2d')](function(_0x16eb6a){_0x496299['mailAccounts'][_0x1d08ff['id']][_0x3bc0('0x34')][_0x3bc0('0x25')]=_0x3bc0('0x37');_0x496299[_0x3bc0('0xd')][_0x1d08ff['id']][_0x3bc0('0x34')]['messageStatus']='';_0x496299[_0x3bc0('0x10')](_0x1d08ff['id']);_0x587817(_0x16eb6a);})[_0x3bc0('0x2f')](function(_0x3b6c4d){_0x496299[_0x3bc0('0xd')][_0x1d08ff['id']][_0x3bc0('0x34')][_0x3bc0('0x25')]=_0x3bc0('0x21');_0x496299[_0x3bc0('0xd')][_0x1d08ff['id']][_0x3bc0('0x34')][_0x3bc0('0x13')]=_0x3b6c4d;_0x496299['emit'](_0x1d08ff['id']);_0x2b7776(_0x3b6c4d);});});}return this[_0x3bc0('0x32')][_0x3bc0('0x36')](_0x1d08ff);};module[_0x3bc0('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 61946ef..b789478 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 _0xea30=['handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','util','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','imap','ready','once','end','handleEnd','handleError','inherits','getAccount','connTimeout','authTimeout','service','user','generateXOAuth2Token','data5','password','anonymous@xcally.com','host','tls','autotls','required','prototype','handleReady','bind','emit','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','message'];(function(_0x242a2d,_0x4ed72e){var _0x762099=function(_0x4f20ab){while(--_0x4f20ab){_0x242a2d['push'](_0x242a2d['shift']());}};_0x762099(++_0x4ed72e);}(_0xea30,0x1a6));var _0x0ea3=function(_0x588742,_0x52257c){_0x588742=_0x588742-0x0;var _0x527ef5=_0xea30[_0x588742];return _0x527ef5;};'use strict';var _=require('lodash');var util=require(_0x0ea3('0x0'));var Imap=require('imap');var simpleParser=require(_0x0ea3('0x1'))[_0x0ea3('0x2')];var Iconv=require(_0x0ea3('0x3'))[_0x0ea3('0x4')];var EventEmitter=require('events')[_0x0ea3('0x5')];var utils=require(_0x0ea3('0x6'));var logger=require(_0x0ea3('0x7'))(_0x0ea3('0x8'));function EmailImap(_0x26965a,_0xcdcb99){this[_0x0ea3('0x9')]=_0x26965a[_0x0ea3('0x9')];this[_0x0ea3('0xa')]=this['getAccount'](_0x26965a,_0xcdcb99);this[_0x0ea3('0xb')]=new Imap(this[_0x0ea3('0xa')]);this[_0x0ea3('0xb')]['once'](_0x0ea3('0xc'),this['handleReady']['bind'](this));this[_0x0ea3('0xb')][_0x0ea3('0xd')](_0x0ea3('0xe'),this[_0x0ea3('0xf')]['bind'](this));this[_0x0ea3('0xb')]['on']('error',this[_0x0ea3('0x10')]['bind'](this));this[_0x0ea3('0xb')]['connect']();}util[_0x0ea3('0x11')](EmailImap,EventEmitter);EmailImap['prototype'][_0x0ea3('0x12')]=function(_0x49f68e,_0x28fd71){var _0x1dcd1f={'connTimeout':_0x49f68e[_0x0ea3('0x13')]?_0x49f68e[_0x0ea3('0x13')]*0x3e8:0x2710,'authTimeout':_0x49f68e[_0x0ea3('0x14')]?_0x49f68e[_0x0ea3('0x14')]*0x3e8:0x1388};if(_0x49f68e[_0x0ea3('0x15')]){_0x1dcd1f['user']=_0x49f68e[_0x0ea3('0x16')];if(_0x49f68e['modernAuthentication']){_0x1dcd1f['xoauth2']=utils[_0x0ea3('0x17')](_0x49f68e['CloudProvider'][_0x0ea3('0x18')],_0x49f68e[_0x0ea3('0x16')]);}else{_0x1dcd1f[_0x0ea3('0x19')]=_0x49f68e[_0x0ea3('0x19')];}}else{if(_0x49f68e['authentication']){_0x1dcd1f[_0x0ea3('0x16')]=_0x49f68e['user'];_0x1dcd1f['password']=_0x49f68e[_0x0ea3('0x19')];}}_0x1dcd1f[_0x0ea3('0x8')]=_0x28fd71||_0x49f68e['user']||_0x0ea3('0x1a');_0x1dcd1f['host']=_0x49f68e[_0x0ea3('0x1b')];_0x1dcd1f['port']=_0x49f68e['port']||0x3e1;if(_0x49f68e[_0x0ea3('0x1c')]){_0x1dcd1f[_0x0ea3('0x1c')]=!![];}else{_0x1dcd1f[_0x0ea3('0x1c')]=![];_0x1dcd1f[_0x0ea3('0x1d')]=_0x0ea3('0x1e');}return _0x1dcd1f;};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x20')]=function(){this[_0x0ea3('0xb')]['openBox'](this[_0x0ea3('0x9')],![],this['handleOpenBox'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')]['handleOpenBox']=function(_0x3f0fee,_0x32b04a){if(_0x3f0fee){this[_0x0ea3('0x10')](_0x3f0fee,!![]);}else{this[_0x0ea3('0x22')]('box',_0x32b04a);this[_0x0ea3('0x23')]();}};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x24')]=function(_0x558ea3){if(_0x558ea3){this[_0x0ea3('0x10')](_0x558ea3,!![]);}else{this[_0x0ea3('0xb')][_0x0ea3('0xe')]();}};EmailImap['prototype'][_0x0ea3('0x23')]=function(){this[_0x0ea3('0xb')][_0x0ea3('0x25')](['UNSEEN'],this[_0x0ea3('0x26')][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x26')]=function(_0x492c48,_0x149f05){if(_0x492c48){this[_0x0ea3('0x10')](_0x492c48,!![]);}else{if(_0x149f05[_0x0ea3('0x27')]){try{var _0x2c3d20=this[_0x0ea3('0xb')][_0x0ea3('0x28')](_0x149f05,{'bodies':'','markSeen':!![]});_0x2c3d20['on'](_0x0ea3('0x29'),this[_0x0ea3('0x2a')][_0x0ea3('0x21')](this));_0x2c3d20[_0x0ea3('0xd')](_0x0ea3('0x2b'),this[_0x0ea3('0x2c')]['bind'](this));_0x2c3d20[_0x0ea3('0xd')]('end',this[_0x0ea3('0x2d')][_0x0ea3('0x21')](this));}catch(_0x117e9b){logger[_0x0ea3('0x2b')](_0x117e9b);}}else{this[_0x0ea3('0xb')][_0x0ea3('0x2e')](!![],this['handleCloseBox'][_0x0ea3('0x21')](this));}}};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x2a')]=function(_0x235075){_0x235075['on'](_0x0ea3('0x2f'),this[_0x0ea3('0x30')][_0x0ea3('0x21')](this));_0x235075[_0x0ea3('0xd')]('attributes',this[_0x0ea3('0x31')][_0x0ea3('0x21')](this));_0x235075[_0x0ea3('0xd')]('end',this['handleMessageEnd'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x30')]=function(_0x28a7aa){simpleParser(_0x28a7aa,{'Iconv':Iconv},this[_0x0ea3('0x32')]['bind'](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x31')]=function(){};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x33')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x5029e3,_0x5b4f0e){if(_0x5029e3){logger[_0x0ea3('0x2b')](_0x5029e3);}else{var _0x283c72=this;utils[_0x0ea3('0x34')](this[_0x0ea3('0xa')],_0x5b4f0e,function(_0x2d25a7){_0x283c72['emit'](_0x0ea3('0x8'),_0x2d25a7);});}};EmailImap['prototype'][_0x0ea3('0x2d')]=function(){this[_0x0ea3('0xb')]['closeBox'](!![],this['handleCloseBox'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x2c')]=function(_0x11b83b){this[_0x0ea3('0x10')](_0x11b83b);this[_0x0ea3('0xb')]['closeBox'](!![],this['handleCloseBox'][_0x0ea3('0x21')](this));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0xf')]=function(){this[_0x0ea3('0x22')](_0x0ea3('0xe'));};EmailImap[_0x0ea3('0x1f')][_0x0ea3('0x10')]=function(_0x1489b2,_0x202fea){logger[_0x0ea3('0x2b')](_0x0ea3('0x10'),this[_0x0ea3('0xa')][_0x0ea3('0x8')],JSON[_0x0ea3('0x35')](_0x1489b2));var _0x4e857d='';if(_0x1489b2){if(_0x1489b2[_0x0ea3('0x36')]){_0x4e857d=_0x1489b2[_0x0ea3('0x36')];}else{for(var _0x226f10 in _0x1489b2){if(_0x1489b2[_0x0ea3('0x37')](_0x226f10)){_0x4e857d+=_[_0x0ea3('0x38')](_0x226f10)+':\x20'+_0x1489b2[_0x226f10]+'\x0a';}}}}if(_0x202fea){this['imap'][_0x0ea3('0xe')]();}else{this[_0x0ea3('0x22')](_0x0ea3('0x2b'),_0x4e857d);this[_0x0ea3('0x22')](_0x0ea3('0xe'));}};module[_0x0ea3('0x39')]=EmailImap; \ No newline at end of file +var _0xe7d4=['handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','mailparser','iconv','Iconv','events','EventEmitter','../../../config/logger','mailbox','account','getAccount','once','handleReady','end','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','required','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody'];(function(_0x1196ae,_0xc1d47d){var _0x144efb=function(_0xb32282){while(--_0xb32282){_0x1196ae['push'](_0x1196ae['shift']());}};_0x144efb(++_0xc1d47d);}(_0xe7d4,0x87));var _0x4e7d=function(_0x3e793d,_0x3d7a2b){_0x3e793d=_0x3e793d-0x0;var _0x6bb312=_0xe7d4[_0x3e793d];return _0x6bb312;};'use strict';var _=require(_0x4e7d('0x0'));var util=require('util');var Imap=require(_0x4e7d('0x1'));var simpleParser=require(_0x4e7d('0x2'))['simpleParser'];var Iconv=require(_0x4e7d('0x3'))[_0x4e7d('0x4')];var EventEmitter=require(_0x4e7d('0x5'))[_0x4e7d('0x6')];var utils=require('./utils');var logger=require(_0x4e7d('0x7'))('email');function EmailImap(_0x45d5d8,_0x54f863){this['mailbox']=_0x45d5d8[_0x4e7d('0x8')];this[_0x4e7d('0x9')]=this[_0x4e7d('0xa')](_0x45d5d8,_0x54f863);this[_0x4e7d('0x1')]=new Imap(this[_0x4e7d('0x9')]);this['imap'][_0x4e7d('0xb')]('ready',this[_0x4e7d('0xc')]['bind'](this));this[_0x4e7d('0x1')]['once'](_0x4e7d('0xd'),this['handleEnd'][_0x4e7d('0xe')](this));this[_0x4e7d('0x1')]['on'](_0x4e7d('0xf'),this[_0x4e7d('0x10')]['bind'](this));this['imap'][_0x4e7d('0x11')]();}util[_0x4e7d('0x12')](EmailImap,EventEmitter);EmailImap[_0x4e7d('0x13')][_0x4e7d('0xa')]=function(_0x5c1ad0,_0x14b820){var _0x1e7697={'connTimeout':_0x5c1ad0['connTimeout']?_0x5c1ad0[_0x4e7d('0x14')]*0x3e8:0x2710,'authTimeout':_0x5c1ad0[_0x4e7d('0x15')]?_0x5c1ad0[_0x4e7d('0x15')]*0x3e8:0x1388};if(_0x5c1ad0[_0x4e7d('0x16')]){_0x1e7697[_0x4e7d('0x17')]=_0x5c1ad0[_0x4e7d('0x17')];if(_0x5c1ad0[_0x4e7d('0x18')]){_0x1e7697[_0x4e7d('0x19')]=utils[_0x4e7d('0x1a')](_0x5c1ad0[_0x4e7d('0x1b')][_0x4e7d('0x1c')],_0x5c1ad0[_0x4e7d('0x17')]);}else{_0x1e7697['password']=_0x5c1ad0[_0x4e7d('0x1d')];}}else{if(_0x5c1ad0[_0x4e7d('0x1e')]){_0x1e7697[_0x4e7d('0x17')]=_0x5c1ad0['user'];_0x1e7697[_0x4e7d('0x1d')]=_0x5c1ad0[_0x4e7d('0x1d')];}}_0x1e7697[_0x4e7d('0x1f')]=_0x14b820||_0x5c1ad0[_0x4e7d('0x17')]||_0x4e7d('0x20');_0x1e7697[_0x4e7d('0x21')]=_0x5c1ad0['host'];_0x1e7697[_0x4e7d('0x22')]=_0x5c1ad0[_0x4e7d('0x22')]||0x3e1;if(_0x5c1ad0[_0x4e7d('0x23')]){_0x1e7697[_0x4e7d('0x23')]=!![];}else{_0x1e7697[_0x4e7d('0x23')]=![];_0x1e7697['autotls']=_0x4e7d('0x24');}return _0x1e7697;};EmailImap['prototype'][_0x4e7d('0xc')]=function(){this[_0x4e7d('0x1')][_0x4e7d('0x25')](this[_0x4e7d('0x8')],![],this[_0x4e7d('0x26')][_0x4e7d('0xe')](this));};EmailImap['prototype'][_0x4e7d('0x26')]=function(_0x2103c1,_0x1fa7be){if(_0x2103c1){this[_0x4e7d('0x10')](_0x2103c1,!![]);}else{this[_0x4e7d('0x27')](_0x4e7d('0x28'),_0x1fa7be);this[_0x4e7d('0x29')]();}};EmailImap[_0x4e7d('0x13')][_0x4e7d('0x2a')]=function(_0x107ac8){if(_0x107ac8){this[_0x4e7d('0x10')](_0x107ac8,!![]);}else{this[_0x4e7d('0x1')]['end']();}};EmailImap[_0x4e7d('0x13')][_0x4e7d('0x29')]=function(){this[_0x4e7d('0x1')]['search']([_0x4e7d('0x2b')],this[_0x4e7d('0x2c')][_0x4e7d('0xe')](this));};EmailImap[_0x4e7d('0x13')][_0x4e7d('0x2c')]=function(_0x337ed1,_0x274670){if(_0x337ed1){this[_0x4e7d('0x10')](_0x337ed1,!![]);}else{if(_0x274670[_0x4e7d('0x2d')]){try{var _0x25b3ed=this[_0x4e7d('0x1')][_0x4e7d('0x2e')](_0x274670,{'bodies':'','markSeen':!![]});_0x25b3ed['on'](_0x4e7d('0x2f'),this[_0x4e7d('0x30')][_0x4e7d('0xe')](this));_0x25b3ed[_0x4e7d('0xb')](_0x4e7d('0xf'),this[_0x4e7d('0x31')]['bind'](this));_0x25b3ed[_0x4e7d('0xb')](_0x4e7d('0xd'),this[_0x4e7d('0x32')][_0x4e7d('0xe')](this));}catch(_0x1d2108){logger[_0x4e7d('0xf')](_0x1d2108);}}else{this[_0x4e7d('0x1')][_0x4e7d('0x33')](!![],this['handleCloseBox'][_0x4e7d('0xe')](this));}}};EmailImap[_0x4e7d('0x13')][_0x4e7d('0x30')]=function(_0x4afd91){_0x4afd91['on'](_0x4e7d('0x34'),this[_0x4e7d('0x35')][_0x4e7d('0xe')](this));_0x4afd91[_0x4e7d('0xb')]('attributes',this[_0x4e7d('0x36')]['bind'](this));_0x4afd91['once'](_0x4e7d('0xd'),this[_0x4e7d('0x37')][_0x4e7d('0xe')](this));};EmailImap[_0x4e7d('0x13')]['handleMessageBody']=function(_0x2d788c){simpleParser(_0x2d788c,{'Iconv':Iconv},this[_0x4e7d('0x38')][_0x4e7d('0xe')](this));};EmailImap[_0x4e7d('0x13')][_0x4e7d('0x36')]=function(){};EmailImap[_0x4e7d('0x13')]['handleMessageEnd']=function(){};EmailImap[_0x4e7d('0x13')][_0x4e7d('0x38')]=function(_0x485e4d,_0x3e610c){if(_0x485e4d){logger[_0x4e7d('0xf')](_0x485e4d);}else{var _0x5c8bd9=this;utils[_0x4e7d('0x39')](this[_0x4e7d('0x9')],_0x3e610c,function(_0x2475e7){_0x5c8bd9[_0x4e7d('0x27')](_0x4e7d('0x1f'),_0x2475e7);});}};EmailImap['prototype'][_0x4e7d('0x32')]=function(){this[_0x4e7d('0x1')][_0x4e7d('0x33')](!![],this[_0x4e7d('0x2a')][_0x4e7d('0xe')](this));};EmailImap[_0x4e7d('0x13')][_0x4e7d('0x31')]=function(_0x31dc34){this[_0x4e7d('0x10')](_0x31dc34);this[_0x4e7d('0x1')][_0x4e7d('0x33')](!![],this[_0x4e7d('0x2a')][_0x4e7d('0xe')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x4e7d('0x27')](_0x4e7d('0xd'));};EmailImap['prototype']['handleError']=function(_0x3c64af,_0xf56f1d){logger['error'](_0x4e7d('0x10'),this['account'][_0x4e7d('0x1f')],JSON[_0x4e7d('0x3a')](_0x3c64af));var _0x1b1c6a='';if(_0x3c64af){if(_0x3c64af[_0x4e7d('0x3b')]){_0x1b1c6a=_0x3c64af[_0x4e7d('0x3b')];}else{for(var _0x2dea45 in _0x3c64af){if(_0x3c64af[_0x4e7d('0x3c')](_0x2dea45)){_0x1b1c6a+=_[_0x4e7d('0x3d')](_0x2dea45)+':\x20'+_0x3c64af[_0x2dea45]+'\x0a';}}}}if(_0xf56f1d){this[_0x4e7d('0x1')]['end']();}else{this[_0x4e7d('0x27')](_0x4e7d('0xf'),_0x1b1c6a);this[_0x4e7d('0x27')](_0x4e7d('0xd'));}};module[_0x4e7d('0x3e')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 740fbc3..f7ffba7 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 _0x3305=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile','sendMail','toString','verify'];(function(_0x4e0a62,_0x539721){var _0xfe8ea9=function(_0x3b79a8){while(--_0x3b79a8){_0x4e0a62['push'](_0x4e0a62['shift']());}};_0xfe8ea9(++_0x539721);}(_0x3305,0x119));var _0x5330=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3305[_0x42cae2];return _0x5f256f;};'use strict';var nodemailer=require(_0x5330('0x0'));var inlineBase64=require(_0x5330('0x1'));function EmailSmtp(){}EmailSmtp[_0x5330('0x2')][_0x5330('0x3')]=function(_0x333e4f,_0x590a08){return new Promise(function(_0x5e788d,_0x4b68ad){var _0x554bed=nodemailer[_0x5330('0x4')](_0x333e4f);_0x554bed['use'](_0x5330('0x5'),inlineBase64());_0x554bed[_0x5330('0x6')](_0x590a08,function(_0x58e426,_0x209274){if(_0x58e426){_0x4b68ad(_0x58e426[_0x5330('0x7')]());}else{_0x5e788d(_0x209274);}});});};EmailSmtp[_0x5330('0x2')][_0x5330('0x8')]=function(_0x14b4c1){return new Promise(function(_0x57a6ec,_0x6377b0){var _0x5c1c75=nodemailer[_0x5330('0x4')](_0x14b4c1);_0x5c1c75[_0x5330('0x8')](function(_0x8ed4cb,_0x3ab33f){if(_0x8ed4cb){_0x6377b0(_0x8ed4cb['toString']());}else{if(_0x3ab33f){_0x57a6ec(_0x3ab33f);}else{_0x6377b0('Not\x20verifired');}}});});};module[_0x5330('0x9')]=EmailSmtp; \ No newline at end of file +var _0x9742=['toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','prototype'];(function(_0x2f497f,_0x895196){var _0x196a22=function(_0x5dae58){while(--_0x5dae58){_0x2f497f['push'](_0x2f497f['shift']());}};_0x196a22(++_0x895196);}(_0x9742,0x163));var _0x2974=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9742[_0x20a584];return _0x4b41a8;};'use strict';var nodemailer=require(_0x2974('0x0'));var inlineBase64=require(_0x2974('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x2974('0x2')]=function(_0x13213a,_0x3c834d){return new Promise(function(_0x47429f,_0x4be3bd){var _0x151078=nodemailer[_0x2974('0x3')](_0x13213a);_0x151078[_0x2974('0x4')](_0x2974('0x5'),inlineBase64());_0x151078[_0x2974('0x6')](_0x3c834d,function(_0xaea72f,_0x39b413){if(_0xaea72f){_0x4be3bd(_0xaea72f['toString']());}else{_0x47429f(_0x39b413);}});});};EmailSmtp[_0x2974('0x7')]['verify']=function(_0x150d9b){return new Promise(function(_0x44ba23,_0x4f9ffe){var _0x58c494=nodemailer[_0x2974('0x3')](_0x150d9b);_0x58c494['verify'](function(_0x1786f0,_0x1553f3){if(_0x1786f0){_0x4f9ffe(_0x1786f0[_0x2974('0x8')]());}else{if(_0x1553f3){_0x44ba23(_0x1553f3);}else{_0x4f9ffe(_0x2974('0x9'));}}});});};module[_0x2974('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 f13e96f..d9040e2 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 _0xc0d8=['parser','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','push','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','slice','join','length','pop','html','test','replace','includes','attachments','forEach','filename','_SRC','_IMG','body','textAsHtml','0x1?_0xace6bd[_0x8c0d('0x12')](0x0,-0x1)[_0x8c0d('0x13')]('\x20'):_0x8eeb30['name'];}return'Anonymous';}function getLastName(_0x3dfd53){var _0x26c98d=_[_0x8c0d('0x8')](_0x3dfd53[_0x8c0d('0xd')]);if(_0x26c98d&&_0x26c98d[_0x8c0d('0xe')]){var _0x5a23f7=_0x26c98d[_0x8c0d('0xe')][_0x8c0d('0x11')](/\s+/);return _0x5a23f7[_0x8c0d('0x14')]>0x1?_0x5a23f7[_0x8c0d('0x15')]():'';}return'';}function getMails(_0x2a0c4d,_0x29b607){var _0x149a53='';for(var _0x5c7010=0x0;_0x5c7010<_0x29b607[_0x8c0d('0xd')][_0x8c0d('0x14')];_0x5c7010+=0x1){if(_0x29b607[_0x8c0d('0xd')][_0x5c7010][_0x8c0d('0x9')]!==_0x2a0c4d){if(!_['isEmpty'](_0x149a53)){_0x149a53+=',';}_0x149a53+=_0x29b607[_0x8c0d('0xd')][_0x5c7010]['name']||_0x29b607['value'][_0x5c7010][_0x8c0d('0x9')]||'';_0x149a53+='\x20<';_0x149a53+=_0x29b607[_0x8c0d('0xd')][_0x5c7010][_0x8c0d('0x9')]?_0x29b607[_0x8c0d('0xd')][_0x5c7010][_0x8c0d('0x9')]:'anonymous'+random[_0x8c0d('0xb')](0x6)+'@xcally.com';_0x149a53+='>';}}return _0x149a53;}function parseEmail(_0x477a04,_0x5bcba8,_0x2fa438){if(_0x5bcba8[_0x8c0d('0x16')]){var _0x5ef1fe=/)<[^<]*)*<\/script>/gi;while(_0x5ef1fe[_0x8c0d('0x17')](_0x5bcba8['html'])){_0x5bcba8[_0x8c0d('0x16')]=_0x5bcba8['html'][_0x8c0d('0x18')](_0x5ef1fe,'');}if(_0x5bcba8[_0x8c0d('0x16')][_0x8c0d('0x19')]('{_0x2d0453['push'](_0x1de905[_0x8c0d('0x1c')]);});var _0xe9e39=/]+>/g;var _0x42fa98=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xec2d8a=_0x5bcba8[_0x8c0d('0x16')][_0x8c0d('0x18')](_0x42fa98,_0x8c0d('0x1d'));var _0x37b6e8=_0xec2d8a['replace'](_0xe9e39,_0x8c0d('0x1e'));for(let _0x1023f9=0x0;_0x1023f9<_0x2d0453[_0x8c0d('0x14')];_0x1023f9++){var _0x5ad555=_0x37b6e8[_0x8c0d('0x18')](_0x8c0d('0x1e'),'\x20[Attachment:\x20'+_0x2d0453[_0x1023f9]+'\x20]');_0x37b6e8=_0x5ad555;}_0x5bcba8['html']=_0x37b6e8;}_0x2fa438[_0x8c0d('0x1f')]=_0x5bcba8[_0x8c0d('0x16')];}else{_0x2fa438[_0x8c0d('0x1f')]=_0x5bcba8[_0x8c0d('0x20')];}if(_0x2fa438['body']){_0x2fa438[_0x8c0d('0x1f')]=_0x2fa438[_0x8c0d('0x1f')][_0x8c0d('0x18')](/0x0){var _0x4be502=[_0x8c0d('0x30'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x2ad461=0x0;_0x2ad461<_0x5bcba8['headerLines'][_0x8c0d('0x14')];_0x2ad461++){var _0x24f93f=_[_0x8c0d('0x10')](_0x4be502,_0x5bcba8[_0x8c0d('0x2f')][_0x2ad461]['line']);if(_0x24f93f>=0x0){_0x2fa438[_0x8c0d('0x31')]=!![];}}}return _0x2fa438;}exports[_0x8c0d('0x32')]=function(_0x4bd5f2,_0x1b7965,_0x3143e0){var _0x4c0ab8={'from':getAddress(_0x1b7965[_0x8c0d('0x33')]),'firstName':getFirstName(_0x1b7965['from']),'lastName':getLastName(_0x1b7965['from']),'mapKey':_0x8c0d('0x6'),'message':{'from':getMails(_0x4bd5f2['email'],_0x1b7965[_0x8c0d('0x33')]),'to':_0x4bd5f2['email'],'cc':'','subject':_0x1b7965['subject']||'','messageId':_0x1b7965['messageId'],'inReplyTo':_0x1b7965[_0x8c0d('0x34')],'sentAt':moment(_0x1b7965[_0x8c0d('0x35')])[_0x8c0d('0x28')](_0x8c0d('0x36')),'attach':![],'attachments':[]}};if(!_0x1b7965[_0x8c0d('0x16')]&&!_0x1b7965[_0x8c0d('0x20')]){var _0x5ecf68=_[_0x8c0d('0x37')](_0x1b7965['attachments'],{'contentType':_0x8c0d('0x38')});if(_0x5ecf68[_0x8c0d('0x14')]){logger[_0x8c0d('0x39')](util['format'](_0x8c0d('0x3a'),_0x1b7965[_0x8c0d('0x3b')]));tnef[_0x8c0d('0x3c')](_[_0x8c0d('0x3d')](_0x5ecf68)[_0x8c0d('0x2d')],function(_0x49447e,_0x5fd46a){if(_0x5fd46a){_0x1b7965['html']=_0x5fd46a[_0x8c0d('0x3e')]||_0x8c0d('0x3f');if(_0x5fd46a['Attachments']){for(var _0x2a37b4=0x0;_0x2a37b4<_0x5fd46a['Attachments']['length'];_0x2a37b4++){var _0x361024=_0x5fd46a[_0x8c0d('0x40')][_0x2a37b4];_0x4c0ab8[_0x8c0d('0x22')]['attachments'][_0x8c0d('0x41')]({'filename':_0x361024[_0x8c0d('0x42')],'content':Buffer['from'](_0x361024[_0x8c0d('0x43')])});}}}_0x3143e0(parseEmail(_0x4bd5f2,_0x1b7965,_0x4c0ab8));});}else{_0x1b7965[_0x8c0d('0x16')]=_0x8c0d('0x3f');_0x3143e0(parseEmail(_0x4bd5f2,_0x1b7965,_0x4c0ab8));}}else{_0x3143e0(parseEmail(_0x4bd5f2,_0x1b7965,_0x4c0ab8));}};exports[_0x8c0d('0x44')]=function(_0x4d968b,_0x14f72f){var _0x356506=[_0x8c0d('0x45')+(_0x14f72f||''),_0x8c0d('0x46')+_0x4d968b,'',''];return Buffer[_0x8c0d('0x33')](_0x356506[_0x8c0d('0x13')](''),_0x8c0d('0x47'))[_0x8c0d('0x48')](_0x8c0d('0x49'));}; \ No newline at end of file +var _0xef84=['format','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','

Empty\x20message

','Attachments','Title','Data','utf-8','toString','base64','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','anonymous','generate','@xcally.com','name','address','substring','indexOf','length','join','split','pop','isEmpty','html','replace','forEach','push','filename','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','includes','bcc','attachments','attach','type','attachment-','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','from','subject','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info'];(function(_0x814aa,_0x252a4c){var _0x2073e8=function(_0x53e8bd){while(--_0x53e8bd){_0x814aa['push'](_0x814aa['shift']());}};_0x2073e8(++_0x252a4c);}(_0xef84,0x168));var _0x4ef8=function(_0x2d68e6,_0x4b0610){_0x2d68e6=_0x2d68e6-0x0;var _0x48f5a2=_0xef84[_0x2d68e6];return _0x48f5a2;};'use strict';var _=require(_0x4ef8('0x0'));var moment=require(_0x4ef8('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x4ef8('0x2'));var util=require(_0x4ef8('0x3'));var tnef=require(_0x4ef8('0x4'));var logger=require(_0x4ef8('0x5'))(_0x4ef8('0x6'));var config=require(_0x4ef8('0x7'));function getAddress(_0x441809){var _0x14f669=_[_0x4ef8('0x8')](_0x441809[_0x4ef8('0x9')]);return _0x14f669&&_0x14f669['address']?_0x14f669['address']:_0x4ef8('0xa')+random[_0x4ef8('0xb')](0x6)+_0x4ef8('0xc');}function getFirstName(_0x161195){var _0x163063=_[_0x4ef8('0x8')](_0x161195[_0x4ef8('0x9')]);if(_0x163063&&_0x163063[_0x4ef8('0xd')]){if(_0x163063['name']==_0x163063[_0x4ef8('0xe')]){return _0x163063[_0x4ef8('0xd')][_0x4ef8('0xf')](0x0,_0x163063[_0x4ef8('0xd')][_0x4ef8('0x10')]('@'));}var _0x37fe37=_0x163063['name']['split'](/\s+/);return _0x37fe37[_0x4ef8('0x11')]>0x1?_0x37fe37['slice'](0x0,-0x1)[_0x4ef8('0x12')]('\x20'):_0x163063[_0x4ef8('0xd')];}return'Anonymous';}function getLastName(_0x4bcd05){var _0x434b0c=_[_0x4ef8('0x8')](_0x4bcd05[_0x4ef8('0x9')]);if(_0x434b0c&&_0x434b0c[_0x4ef8('0xd')]){var _0x34e067=_0x434b0c['name'][_0x4ef8('0x13')](/\s+/);return _0x34e067['length']>0x1?_0x34e067[_0x4ef8('0x14')]():'';}return'';}function getMails(_0x329917,_0x77bc3a){var _0x303d23='';for(var _0x1db457=0x0;_0x1db457<_0x77bc3a[_0x4ef8('0x9')][_0x4ef8('0x11')];_0x1db457+=0x1){if(_0x77bc3a[_0x4ef8('0x9')][_0x1db457][_0x4ef8('0xe')]!==_0x329917){if(!_[_0x4ef8('0x15')](_0x303d23)){_0x303d23+=',';}_0x303d23+=_0x77bc3a[_0x4ef8('0x9')][_0x1db457][_0x4ef8('0xd')]||_0x77bc3a[_0x4ef8('0x9')][_0x1db457][_0x4ef8('0xe')]||'';_0x303d23+='\x20<';_0x303d23+=_0x77bc3a[_0x4ef8('0x9')][_0x1db457]['address']?_0x77bc3a[_0x4ef8('0x9')][_0x1db457]['address']:_0x4ef8('0xa')+random[_0x4ef8('0xb')](0x6)+_0x4ef8('0xc');_0x303d23+='>';}}return _0x303d23;}function parseEmail(_0xf42017,_0x240ca8,_0x4f53d9){if(_0x240ca8[_0x4ef8('0x16')]){var _0x26683c=/)<[^<]*)*<\/script>/gi;while(_0x26683c['test'](_0x240ca8[_0x4ef8('0x16')])){_0x240ca8['html']=_0x240ca8[_0x4ef8('0x16')][_0x4ef8('0x17')](_0x26683c,'');}if(_0x240ca8[_0x4ef8('0x16')]['includes']('{_0x569da0[_0x4ef8('0x19')](_0x473b88[_0x4ef8('0x1a')]);});var _0x294f6c=/]+>/g;var _0x424f36=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2d7349=_0x240ca8[_0x4ef8('0x16')][_0x4ef8('0x17')](_0x424f36,'_SRC');var _0x3bfa3e=_0x2d7349[_0x4ef8('0x17')](_0x294f6c,_0x4ef8('0x1b'));for(let _0x277c37=0x0;_0x277c37<_0x569da0[_0x4ef8('0x11')];_0x277c37++){var _0x434eba=_0x3bfa3e[_0x4ef8('0x17')]('_IMG',_0x4ef8('0x1c')+_0x569da0[_0x277c37]+_0x4ef8('0x1d'));_0x3bfa3e=_0x434eba;}_0x240ca8[_0x4ef8('0x16')]=_0x3bfa3e;}_0x4f53d9[_0x4ef8('0x1e')]=_0x240ca8[_0x4ef8('0x16')];}else{_0x4f53d9[_0x4ef8('0x1e')]=_0x240ca8[_0x4ef8('0x1f')];}if(_0x4f53d9['body']){_0x4f53d9[_0x4ef8('0x1e')]=_0x4f53d9['body'][_0x4ef8('0x17')](/0x0){var _0x887b75=[_0x4ef8('0x30'),_0x4ef8('0x31'),_0x4ef8('0x32')];for(var _0x30b9e6=0x0;_0x30b9e6<_0x240ca8[_0x4ef8('0x2f')][_0x4ef8('0x11')];_0x30b9e6++){var _0x5ceed0=_[_0x4ef8('0x10')](_0x887b75,_0x240ca8[_0x4ef8('0x2f')][_0x30b9e6][_0x4ef8('0x33')]);if(_0x5ceed0>=0x0){_0x4f53d9['isAutoreply']=!![];}}}return _0x4f53d9;}exports['parser']=function(_0xbcfef5,_0x215df6,_0x1fdb0a){var _0x1ee742={'from':getAddress(_0x215df6[_0x4ef8('0x34')]),'firstName':getFirstName(_0x215df6[_0x4ef8('0x34')]),'lastName':getLastName(_0x215df6[_0x4ef8('0x34')]),'mapKey':_0x4ef8('0x6'),'message':{'from':getMails(_0xbcfef5['email'],_0x215df6[_0x4ef8('0x34')]),'to':_0xbcfef5['email'],'cc':'','subject':_0x215df6[_0x4ef8('0x35')]||'','messageId':_0x215df6[_0x4ef8('0x36')],'inReplyTo':_0x215df6[_0x4ef8('0x37')],'sentAt':moment(_0x215df6[_0x4ef8('0x38')])['format'](_0x4ef8('0x39')),'attach':![],'attachments':[]}};if(!_0x215df6[_0x4ef8('0x16')]&&!_0x215df6[_0x4ef8('0x1f')]){var _0x3c58c3=_['filter'](_0x215df6[_0x4ef8('0x25')],{'contentType':_0x4ef8('0x3a')});if(_0x3c58c3[_0x4ef8('0x11')]){logger[_0x4ef8('0x3b')](util[_0x4ef8('0x3c')](_0x4ef8('0x3d'),_0x215df6[_0x4ef8('0x36')]));tnef[_0x4ef8('0x3e')](_['first'](_0x3c58c3)[_0x4ef8('0x2d')],function(_0x436b0b,_0x13216d){if(_0x13216d){_0x215df6[_0x4ef8('0x16')]=_0x13216d['BodyHTML']||_0x4ef8('0x3f');if(_0x13216d['Attachments']){for(var _0x219980=0x0;_0x219980<_0x13216d[_0x4ef8('0x40')][_0x4ef8('0x11')];_0x219980++){var _0x5f048c=_0x13216d[_0x4ef8('0x40')][_0x219980];_0x1ee742[_0x4ef8('0x20')][_0x4ef8('0x25')][_0x4ef8('0x19')]({'filename':_0x5f048c[_0x4ef8('0x41')],'content':Buffer[_0x4ef8('0x34')](_0x5f048c[_0x4ef8('0x42')])});}}}_0x1fdb0a(parseEmail(_0xbcfef5,_0x215df6,_0x1ee742));});}else{_0x215df6['html']=_0x4ef8('0x3f');_0x1fdb0a(parseEmail(_0xbcfef5,_0x215df6,_0x1ee742));}}else{_0x1fdb0a(parseEmail(_0xbcfef5,_0x215df6,_0x1ee742));}};exports['generateXOAuth2Token']=function(_0x2c004a,_0x28b563){var _0x365f4c=['user='+(_0x28b563||''),'auth=Bearer\x20'+_0x2c004a,'',''];return Buffer['from'](_0x365f4c['join'](''),_0x4ef8('0x43'))[_0x4ef8('0x44')](_0x4ef8('0x45'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 8a25eb9..bab898f 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 _0xcd6d=['Smtp','exports','lodash','name','Service','key','SERV','active','Imap'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xcd6d,0xfe));var _0xdcd6=function(_0xa67aa3,_0x40dcf5){_0xa67aa3=_0xa67aa3-0x0;var _0x587841=_0xcd6d[_0xa67aa3];return _0x587841;};'use strict';var _=require(_0xdcd6('0x0'));function MailAccount(_0x1f1433){this['id']=_0x1f1433['id']||0x0;this[_0xdcd6('0x1')]=_0x1f1433[_0xdcd6('0x1')]||_0xdcd6('0x2');this[_0xdcd6('0x3')]=_0x1f1433['key']||_0xdcd6('0x4');this[_0xdcd6('0x5')]=_0x1f1433['active']||![];this['Imap']=_0x1f1433[_0xdcd6('0x6')]||[];this[_0xdcd6('0x7')]=_0x1f1433[_0xdcd6('0x7')]||[];}module[_0xdcd6('0x8')]=MailAccount; \ No newline at end of file +var _0x1f4f=['key','active','Imap','Smtp','lodash','name','Service'];(function(_0x16ff43,_0x2dd414){var _0x3c6d41=function(_0x194fe9){while(--_0x194fe9){_0x16ff43['push'](_0x16ff43['shift']());}};_0x3c6d41(++_0x2dd414);}(_0x1f4f,0x18c));var _0xf1f4=function(_0x26409f,_0x2465b5){_0x26409f=_0x26409f-0x0;var _0x5d0875=_0x1f4f[_0x26409f];return _0x5d0875;};'use strict';var _=require(_0xf1f4('0x0'));function MailAccount(_0x30fd82){this['id']=_0x30fd82['id']||0x0;this['name']=_0x30fd82[_0xf1f4('0x1')]||_0xf1f4('0x2');this[_0xf1f4('0x3')]=_0x30fd82[_0xf1f4('0x3')]||'SERV';this[_0xf1f4('0x4')]=_0x30fd82[_0xf1f4('0x4')]||![];this['Imap']=_0x30fd82[_0xf1f4('0x5')]||[];this[_0xf1f4('0x6')]=_0x30fd82[_0xf1f4('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 72f9d75..e6101c5 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 _0xc47f=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xc47f,0x11c));var _0xfc47=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc47f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfc47('0x0'));var MailAccount=require(_0xfc47('0x1'));var Realtime=function(){this[_0xfc47('0x2')]={};};function freeIsNotKey(_0x53c588,_0x3b64ad,_0x4fe3f4){var _0x5e926c=_[_0xfc47('0x3')](_0x53c588,function(_0x39b142,_0x5e0959){return _0x39b142[_0x4fe3f4];});for(var _0x39ee9d in _0x3b64ad){if(_0x3b64ad[_0xfc47('0x4')](_0x39ee9d)){if(!_0x5e926c[_0x39ee9d]){delete _0x3b64ad[_0x39ee9d];}}}}Realtime[_0xfc47('0x5')][_0xfc47('0x6')]=function(_0x4db5a0,_0xacb7bd){for(var _0x5ca9ca in _0xacb7bd){if(_0x4db5a0['hasOwnProperty'](_0x5ca9ca)){_0x4db5a0[_0x5ca9ca]=_0xacb7bd[_0x5ca9ca];}}};Realtime[_0xfc47('0x5')][_0xfc47('0x7')]=function(){var _0x59bf73=this;return function(_0x44549d){if(_0x44549d){freeIsNotKey(_0x44549d,_0x59bf73[_0xfc47('0x2')],'id');for(var _0xf9bcc8=0x0,_0x498fa9={},_0x3e2f32={};_0xf9bcc8<_0x44549d[_0xfc47('0x8')];_0xf9bcc8+=0x1){_0x498fa9=_0x44549d[_0xf9bcc8];if(_[_0xfc47('0x9')](_0x59bf73[_0xfc47('0x2')][_0x498fa9['id']])){_0x59bf73[_0xfc47('0x2')][_0x498fa9['id']]=new MailAccount(_0x498fa9);}else{_[_0xfc47('0xa')](_0x59bf73[_0xfc47('0x2')][_0x498fa9['id']],_0x498fa9);}}}return _0x59bf73['mailAccounts'];};};module[_0xfc47('0xb')]=Realtime; \ No newline at end of file +var _0xe9c1=['hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge','exports','lodash','mailAccounts','mapKeys'];(function(_0xbce0f,_0x3a87e1){var _0x55358b=function(_0x41c383){while(--_0x41c383){_0xbce0f['push'](_0xbce0f['shift']());}};_0x55358b(++_0x3a87e1);}(_0xe9c1,0x1ec));var _0x1e9c=function(_0x944956,_0x45d6bc){_0x944956=_0x944956-0x0;var _0x3e7f54=_0xe9c1[_0x944956];return _0x3e7f54;};'use strict';var _=require(_0x1e9c('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x1e9c('0x1')]={};};function freeIsNotKey(_0x4eea24,_0x175334,_0x5338a4){var _0x1b32a0=_[_0x1e9c('0x2')](_0x4eea24,function(_0x4583a6,_0x4b467e){return _0x4583a6[_0x5338a4];});for(var _0x51f21d in _0x175334){if(_0x175334[_0x1e9c('0x3')](_0x51f21d)){if(!_0x1b32a0[_0x51f21d]){delete _0x175334[_0x51f21d];}}}}Realtime['prototype'][_0x1e9c('0x4')]=function(_0x31fc3a,_0x521350){for(var _0x47faff in _0x521350){if(_0x31fc3a['hasOwnProperty'](_0x47faff)){_0x31fc3a[_0x47faff]=_0x521350[_0x47faff];}}};Realtime[_0x1e9c('0x5')][_0x1e9c('0x6')]=function(){var _0x506459=this;return function(_0x568e9a){if(_0x568e9a){freeIsNotKey(_0x568e9a,_0x506459[_0x1e9c('0x1')],'id');for(var _0x2fe3b9=0x0,_0x908cc={},_0x560044={};_0x2fe3b9<_0x568e9a[_0x1e9c('0x7')];_0x2fe3b9+=0x1){_0x908cc=_0x568e9a[_0x2fe3b9];if(_[_0x1e9c('0x8')](_0x506459[_0x1e9c('0x1')][_0x908cc['id']])){_0x506459[_0x1e9c('0x1')][_0x908cc['id']]=new MailAccount(_0x908cc);}else{_[_0x1e9c('0x9')](_0x506459['mailAccounts'][_0x908cc['id']],_0x908cc);}}}return _0x506459[_0x1e9c('0x1')];};};module[_0x1e9c('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 bc9476a..71a21e3 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 _0x2d2c=['TemplateId','MailServerIn','Imap','service','type','data5','CloudProvider','MailServerOut','Smtp','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','email','key','ListId'];(function(_0x5512d4,_0x1cdf72){var _0x107ea9=function(_0x2478da){while(--_0x2478da){_0x5512d4['push'](_0x5512d4['shift']());}};_0x107ea9(++_0x1cdf72);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x4c4042,_0x1ea485){_0x4c4042=_0x4c4042-0x0;var _0xbd10dc=_0x2d2c[_0x4c4042];return _0xbd10dc;};'use strict';var client=require(_0xc2d2('0x0'));exports[_0xc2d2('0x1')]=function(){return function(){return client[_0xc2d2('0x2')](_0xc2d2('0x3'),{'options':{'attributes':['id',_0xc2d2('0x4'),_0xc2d2('0x5'),'service',_0xc2d2('0x6'),'active',_0xc2d2('0x7'),_0xc2d2('0x8'),_0xc2d2('0x9')],'raw':![],'include':[{'model':_0xc2d2('0xa'),'as':_0xc2d2('0xb'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xc2d2('0xc'),_0xc2d2('0xd'),_0xc2d2('0xe')],'as':_0xc2d2('0xf')}]},{'model':_0xc2d2('0x10'),'as':_0xc2d2('0x11'),'include':[{'model':_0xc2d2('0xf'),'attributes':['id',_0xc2d2('0x4'),_0xc2d2('0xc'),_0xc2d2('0xd'),_0xc2d2('0xe')],'as':_0xc2d2('0xf')}]}]},'log':'getMailAccount'});};};exports[_0xc2d2('0x12')]=function(_0x13a247,_0x1e0cbc){return client['Request'](_0xc2d2('0x13'),{'account':{'id':_0x13a247},'body':_0x1e0cbc,'log':_0xc2d2('0x13')});}; \ No newline at end of file +var _0x6f44=['TemplateId','Imap','CloudProvider','data5','Smtp','type','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','service','email','active','key','ListId'];(function(_0x2b97e3,_0x174493){var _0x2c329d=function(_0x3a2aca){while(--_0x3a2aca){_0x2b97e3['push'](_0x2b97e3['shift']());}};_0x2c329d(++_0x174493);}(_0x6f44,0x1ea));var _0x46f4=function(_0x216fa9,_0x134236){_0x216fa9=_0x216fa9-0x0;var _0x54b906=_0x6f44[_0x216fa9];return _0x54b906;};'use strict';var client=require(_0x46f4('0x0'));exports[_0x46f4('0x1')]=function(){return function(){return client['Request'](_0x46f4('0x2'),{'options':{'attributes':['id',_0x46f4('0x3'),_0x46f4('0x4'),_0x46f4('0x5'),_0x46f4('0x6'),_0x46f4('0x7'),_0x46f4('0x8'),_0x46f4('0x9'),_0x46f4('0xa')],'raw':![],'include':[{'model':'MailServerIn','as':_0x46f4('0xb'),'include':[{'model':_0x46f4('0xc'),'attributes':['id',_0x46f4('0x3'),'service','type',_0x46f4('0xd')],'as':_0x46f4('0xc')}]},{'model':'MailServerOut','as':_0x46f4('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0x46f4('0x3'),'service',_0x46f4('0xf'),_0x46f4('0xd')],'as':_0x46f4('0xc')}]}]},'log':_0x46f4('0x10')});};};exports[_0x46f4('0x11')]=function(_0x3f45a4,_0x187e3c){return client[_0x46f4('0x12')](_0x46f4('0x13'),{'account':{'id':_0x3f45a4},'body':_0x187e3c,'log':_0x46f4('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 4586809..014ca54 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 _0x54e8=['Request','ShowSetting','loginMailFrequency','GetSettings','getSettings'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x54e8,0x1bc));var _0x854e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x54e8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x854e('0x0')]=function(){return client[_0x854e('0x1')](_0x854e('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x854e('0x3')]},'log':_0x854e('0x4')});}; \ No newline at end of file +var _0x4680=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x40e4d4,_0x4b1565){var _0x157ea1=function(_0x464773){while(--_0x464773){_0x40e4d4['push'](_0x40e4d4['shift']());}};_0x157ea1(++_0x4b1565);}(_0x4680,0xca));var _0x0468=function(_0x133632,_0x14f783){_0x133632=_0x133632-0x0;var _0x4cee4d=_0x4680[_0x133632];return _0x4cee4d;};'use strict';var client=require(_0x0468('0x0'));exports[_0x0468('0x1')]=function(){return client[_0x0468('0x2')](_0x0468('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0468('0x4')]},'log':_0x0468('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index fb88d34..6f9cda9 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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 af83731..771740e 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 _0xa6c4=['sticky-session','ioredis','../../config/environment','createServer','listen','socket.io','polling','redis','defaults','adapter','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','lodash','http','express'];(function(_0x4d4a74,_0x344a11){var _0x5491d8=function(_0x400056){while(--_0x400056){_0x4d4a74['push'](_0x4d4a74['shift']());}};_0x5491d8(++_0x344a11);}(_0xa6c4,0x15d));var _0x4a6c=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0xa6c4[_0x450689];return _0x46ffb0;};'use strict';var _=require(_0x4a6c('0x0'));var http=require(_0x4a6c('0x1'));var express=require(_0x4a6c('0x2'));var sticky=require(_0x4a6c('0x3'));var Redis=require(_0x4a6c('0x4'));var config=require(_0x4a6c('0x5'));var app=express();var server=http[_0x4a6c('0x6')](app);server['timeout']=0xdbba0;if(sticky[_0x4a6c('0x7')](server,config['port'])){var socketio=require(_0x4a6c('0x8'))(server,{'transports':['websocket',_0x4a6c('0x9')]});config[_0x4a6c('0xa')]=_[_0x4a6c('0xb')](config[_0x4a6c('0xa')],{'host':'localhost','port':0x18eb});socketio[_0x4a6c('0xc')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x4a6c('0xa')])}));require(_0x4a6c('0xd'))['default']();require(_0x4a6c('0xe'))[_0x4a6c('0xf')](socketio);require(_0x4a6c('0x10'))[_0x4a6c('0xf')](app);require(_0x4a6c('0x11'))[_0x4a6c('0xf')](app);}else{server[_0x4a6c('0x12')]('listening',function(){console[_0x4a6c('0x13')](_0x4a6c('0x14'),config[_0x4a6c('0x15')]);});}exports=module['exports']=app; \ No newline at end of file +var _0x8ab8=['listening','log','exports','lodash','express','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','defaults','adapter','socket.io-redis','redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once'];(function(_0x181c61,_0x449b30){var _0x360944=function(_0x3d1e6e){while(--_0x3d1e6e){_0x181c61['push'](_0x181c61['shift']());}};_0x360944(++_0x449b30);}(_0x8ab8,0x1e3));var _0x88ab=function(_0x3cc501,_0x53a903){_0x3cc501=_0x3cc501-0x0;var _0x2291ab=_0x8ab8[_0x3cc501];return _0x2291ab;};'use strict';var _=require(_0x88ab('0x0'));var http=require('http');var express=require(_0x88ab('0x1'));var sticky=require('sticky-session');var Redis=require(_0x88ab('0x2'));var config=require(_0x88ab('0x3'));var app=express();var server=http[_0x88ab('0x4')](app);server[_0x88ab('0x5')]=0xdbba0;if(sticky[_0x88ab('0x6')](server,config[_0x88ab('0x7')])){var socketio=require(_0x88ab('0x8'))(server,{'transports':[_0x88ab('0x9'),_0x88ab('0xa')]});config['redis']=_[_0x88ab('0xb')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0x88ab('0xc')](require(_0x88ab('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x88ab('0xe')])}));require(_0x88ab('0xf'))[_0x88ab('0x10')]();require(_0x88ab('0x11'))[_0x88ab('0x10')](socketio);require(_0x88ab('0x12'))[_0x88ab('0x10')](app);require(_0x88ab('0x13'))['default'](app);}else{server[_0x88ab('0x14')](_0x88ab('0x15'),function(){console[_0x88ab('0x16')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config['port']);});}exports=module[_0x88ab('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 77e53e1..9663363 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 _0x1138=['message','result','catch','jayson/promise','bluebird','../../config/logger','client','request','debug','routing','error','rpc'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1138,0x18f));var _0x8113=function(_0x1cd5ee,_0x5741b3){_0x1cd5ee=_0x1cd5ee-0x0;var _0x4fce8f=_0x1138[_0x1cd5ee];return _0x4fce8f;};'use strict';var jayson=require(_0x8113('0x0'));var BPromise=require(_0x8113('0x1'));var logger=require(_0x8113('0x2'))('routing');var client=jayson[_0x8113('0x3')]['http']({'port':0x2329});client['Request']=function(_0x519e11,_0x426f77){return new BPromise(function(_0x5999f2,_0x5d6ce8){return client[_0x8113('0x4')](_0x519e11,_0x426f77)['then'](function(_0xc63dbb){logger[_0x8113('0x5')]('rpc',_0x8113('0x6'),_0x519e11,_0x426f77,_0xc63dbb);if(_0xc63dbb[_0x8113('0x7')]){logger[_0x8113('0x7')](_0x8113('0x8'),_0x8113('0x6'),_0x519e11,_0xc63dbb[_0x8113('0x7')][_0x8113('0x9')],_0x426f77);return _0x5d6ce8(_0xc63dbb[_0x8113('0x7')][_0x8113('0x9')]);}else{return _0x5999f2(_0xc63dbb[_0x8113('0xa')]);}})[_0x8113('0xb')](function(_0xce22cf){logger['error'](_0x8113('0x8'),_0x8113('0x6'),_0x519e11,_0xce22cf,_0x426f77);return _0x5d6ce8(_0xce22cf);});});};module['exports']=client; \ No newline at end of file +var _0x3d7d=['error','message','result','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc'];(function(_0xf17b29,_0x34fb09){var _0x747da8=function(_0x8f9121){while(--_0x8f9121){_0xf17b29['push'](_0xf17b29['shift']());}};_0x747da8(++_0x34fb09);}(_0x3d7d,0x9f));var _0xd3d7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x3d7d[_0x42cae2];return _0x5f256f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xd3d7('0x0'));var logger=require(_0xd3d7('0x1'))(_0xd3d7('0x2'));var client=jayson[_0xd3d7('0x3')][_0xd3d7('0x4')]({'port':0x2329});client[_0xd3d7('0x5')]=function(_0x54112f,_0x55260d){return new BPromise(function(_0xe3ea8e,_0x5d40d7){return client['request'](_0x54112f,_0x55260d)[_0xd3d7('0x6')](function(_0x50a4cf){logger[_0xd3d7('0x7')](_0xd3d7('0x8'),_0xd3d7('0x2'),_0x54112f,_0x55260d,_0x50a4cf);if(_0x50a4cf[_0xd3d7('0x9')]){logger['error']('rpc','routing',_0x54112f,_0x50a4cf[_0xd3d7('0x9')][_0xd3d7('0xa')],_0x55260d);return _0x5d40d7(_0x50a4cf[_0xd3d7('0x9')]['message']);}else{return _0xe3ea8e(_0x50a4cf[_0xd3d7('0xb')]);}})['catch'](function(_0x4c183e){logger[_0xd3d7('0x9')](_0xd3d7('0x8'),'routing',_0x54112f,_0x4c183e,_0x55260d);return _0x5d40d7(_0x4c183e);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 1d60efd..4a46833 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 _0x2f75=['log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch'];(function(_0x433541,_0x113f79){var _0x1aa32b=function(_0x4c80de){while(--_0x4c80de){_0x433541['push'](_0x433541['shift']());}};_0x1aa32b(++_0x113f79);}(_0x2f75,0x187));var _0x52f7=function(_0x50ea98,_0x27af6f){_0x50ea98=_0x50ea98-0x0;var _0x31b8b8=_0x2f75[_0x50ea98];return _0x31b8b8;};'use strict';var BPromise=require(_0x52f7('0x0'));var server=require(_0x52f7('0x1'));var Realtime=require(_0x52f7('0x2'));var user=require('./rpc/user');var interval=require(_0x52f7('0x3'));var openchannelQueue=require(_0x52f7('0x4'));var chatQueue=require(_0x52f7('0x5'));var smsQueue=require(_0x52f7('0x6'));var mailQueue=require(_0x52f7('0x7'));var faxQueue=require(_0x52f7('0x8'));var whatsappQueue=require(_0x52f7('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x52f7('0xa')]()[_0x52f7('0xb')](user[_0x52f7('0xc')]())['then'](realtime[_0x52f7('0xd')]())[_0x52f7('0xb')](interval['getIntervals']())[_0x52f7('0xb')](realtime[_0x52f7('0xe')]())[_0x52f7('0xb')](openchannelQueue[_0x52f7('0xf')]())[_0x52f7('0xb')](realtime[_0x52f7('0x10')]())['then'](chatQueue[_0x52f7('0x11')]())[_0x52f7('0xb')](realtime[_0x52f7('0x12')]())['then'](smsQueue[_0x52f7('0x13')]())[_0x52f7('0xb')](realtime[_0x52f7('0x14')]())[_0x52f7('0xb')](mailQueue[_0x52f7('0x15')]())[_0x52f7('0xb')](realtime[_0x52f7('0x16')]())['then'](faxQueue[_0x52f7('0x17')]())[_0x52f7('0xb')](realtime[_0x52f7('0x18')]())['then'](whatsappQueue[_0x52f7('0x19')]())[_0x52f7('0xb')](realtime[_0x52f7('0x1a')]())[_0x52f7('0xb')](function(){return realtime;});}function main(){return server[_0x52f7('0x1b')](realtime)['then'](function(_0x5132c1){return initRealtime();})[_0x52f7('0xb')](function(_0x50dec1){return setInterval(initRealtime,0x1388);})[_0x52f7('0x1c')](function(_0x210128){console[_0x52f7('0x1d')](_0x210128);});}main(); \ No newline at end of file +var _0xe266=['./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','listen','catch','log','bluebird','./realtime','./rpc/user'];(function(_0x154f27,_0x34adad){var _0xe33643=function(_0x30075d){while(--_0x30075d){_0x154f27['push'](_0x154f27['shift']());}};_0xe33643(++_0x34adad);}(_0xe266,0x14d));var _0x6e26=function(_0x5b5947,_0x11623c){_0x5b5947=_0x5b5947-0x0;var _0x7623e0=_0xe266[_0x5b5947];return _0x7623e0;};'use strict';var BPromise=require(_0x6e26('0x0'));var server=require('./server');var Realtime=require(_0x6e26('0x1'));var user=require(_0x6e26('0x2'));var interval=require(_0x6e26('0x3'));var openchannelQueue=require(_0x6e26('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x6e26('0x5'));var mailQueue=require(_0x6e26('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x6e26('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user[_0x6e26('0x8')]())[_0x6e26('0x9')](realtime[_0x6e26('0xa')]())['then'](interval[_0x6e26('0xb')]())[_0x6e26('0x9')](realtime[_0x6e26('0xc')]())[_0x6e26('0x9')](openchannelQueue[_0x6e26('0xd')]())[_0x6e26('0x9')](realtime[_0x6e26('0xe')]())['then'](chatQueue[_0x6e26('0xf')]())[_0x6e26('0x9')](realtime['initChatQueues']())[_0x6e26('0x9')](smsQueue[_0x6e26('0x10')]())[_0x6e26('0x9')](realtime[_0x6e26('0x11')]())['then'](mailQueue[_0x6e26('0x12')]())['then'](realtime[_0x6e26('0x13')]())[_0x6e26('0x9')](faxQueue[_0x6e26('0x14')]())[_0x6e26('0x9')](realtime['initFaxQueues']())[_0x6e26('0x9')](whatsappQueue['getWhatsappQueues']())['then'](realtime['initWhatsappQueues']())[_0x6e26('0x9')](function(){return realtime;});}function main(){return server[_0x6e26('0x15')](realtime)['then'](function(_0x468580){return initRealtime();})[_0x6e26('0x9')](function(_0x2e95c3){return setInterval(initRealtime,0x1388);})[_0x6e26('0x16')](function(_0x15ee53){console[_0x6e26('0x17')](_0x15ee53);});}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 adcfd9c..2dbbaee 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 _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(_0x4c9fa7,_0xdd2863){var _0x5c8182=function(_0x5303f3){while(--_0x5303f3){_0x4c9fa7['push'](_0x4c9fa7['shift']());}};_0x5c8182(++_0xdd2863);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xc4aa[_0x3511d3];return _0x5d6321;};'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 +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x19ed41,_0x4a09f4){var _0x435f19=function(_0x371363){while(--_0x371363){_0x19ed41['push'](_0x19ed41['shift']());}};_0x435f19(++_0x4a09f4);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x5fc3[_0x5f1617];return _0x3af5da;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 2bcb1bd..241f0f2 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 _0x3a28=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x5199e4,_0x5bb4f9){var _0x2a78d0=function(_0x41b465){while(--_0x41b465){_0x5199e4['push'](_0x5199e4['shift']());}};_0x2a78d0(++_0x5bb4f9);}(_0x3a28,0x1a7));var _0x83a2=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x3a28[_0x1969a7];return _0x3d665f;};'use strict';var BPromise=require(_0x83a2('0x0'));var jayson=require(_0x83a2('0x1'));var client=jayson[_0x83a2('0x2')][_0x83a2('0x3')]({'port':0x232b});function request(_0x97ee90,_0x1cdb96){return new BPromise(function(_0x314391,_0x50ec7b){return client[_0x83a2('0x4')](_0x97ee90,_0x1cdb96)['then'](function(_0x58eb77){if(_0x58eb77['error']){return _0x50ec7b(_0x58eb77[_0x83a2('0x5')][_0x83a2('0x6')]);}else{return _0x314391(_0x58eb77['result']);}})[_0x83a2('0x7')](function(_0xc415d8){return _0x50ec7b(_0xc415d8);});});}exports[_0x83a2('0x8')]=function(_0x3c50e7,_0xb6d37c){return request(_0x83a2('0x9'),{'account':_0x3c50e7,'message':_0xb6d37c});}; \ No newline at end of file +var _0x6fc9=['then','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client','request'];(function(_0x24f22d,_0x1f6649){var _0x321679=function(_0x2eb38d){while(--_0x2eb38d){_0x24f22d['push'](_0x24f22d['shift']());}};_0x321679(++_0x1f6649);}(_0x6fc9,0x92));var _0x96fc=function(_0xbd8b5b,_0x2e2ccf){_0xbd8b5b=_0xbd8b5b-0x0;var _0x3ef2d2=_0x6fc9[_0xbd8b5b];return _0x3ef2d2;};'use strict';var BPromise=require(_0x96fc('0x0'));var jayson=require(_0x96fc('0x1'));var client=jayson[_0x96fc('0x2')]['http']({'port':0x232b});function request(_0x503d7a,_0x44a345){return new BPromise(function(_0x537cf8,_0x5e93a3){return client[_0x96fc('0x3')](_0x503d7a,_0x44a345)[_0x96fc('0x4')](function(_0xea26b4){if(_0xea26b4['error']){return _0x5e93a3(_0xea26b4[_0x96fc('0x5')][_0x96fc('0x6')]);}else{return _0x537cf8(_0xea26b4[_0x96fc('0x7')]);}})['catch'](function(_0x56fd5f){return _0x5e93a3(_0x56fd5f);});});}exports[_0x96fc('0x8')]=function(_0x269b00,_0x396288){return request(_0x96fc('0x9'),{'account':_0x269b00,'message':_0x396288});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 1c91c3e..9bbf94d 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 _0x8c8b=['name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','getChannelStatus','Status','StatusTime','format','online','chatStatusTime','faxCurrentCapacity','smsCurrentCapacity','whatsappWaitingInteractions','stringify','emit','omit','exports','md5','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x58c58d,_0x427c97){var _0x194b21=function(_0x1e2fde){while(--_0x1e2fde){_0x58c58d['push'](_0x58c58d['shift']());}};_0x194b21(++_0x427c97);}(_0x8c8b,0xb8));var _0xb8c8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c8b[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var md5=require(_0xb8c8('0x0'));var moment=require(_0xb8c8('0x1'));var Redis=require(_0xb8c8('0x2'));var config=require(_0xb8c8('0x3'));config[_0xb8c8('0x4')]=_[_0xb8c8('0x5')](config[_0xb8c8('0x4')],{'host':_0xb8c8('0x6'),'port':0x18eb});var io=require(_0xb8c8('0x7'))(new Redis(config[_0xb8c8('0x4')]));function Agent(_0x52b3d1){this['id']=_0x52b3d1['id']||0x0;this[_0xb8c8('0x8')]=_0x52b3d1[_0xb8c8('0x8')]||'';this['voicePause']=_0x52b3d1[_0xb8c8('0x9')]||![];this[_0xb8c8('0xa')]=_0x52b3d1[_0xb8c8('0xa')]||![];this[_0xb8c8('0xb')]=_0x52b3d1[_0xb8c8('0xb')]||![];this[_0xb8c8('0xc')]=_0x52b3d1[_0xb8c8('0xc')]||![];this['smsPause']=_0x52b3d1[_0xb8c8('0xd')]||![];this[_0xb8c8('0xe')]=_0x52b3d1[_0xb8c8('0xe')]||![];this[_0xb8c8('0xf')]='unknown';this['chatStatusTime']=0x0;this[_0xb8c8('0x10')]=_0x52b3d1['chatCapacity']||0x0;this[_0xb8c8('0x11')]=0x0;this['mailStatus']=_0xb8c8('0x12');this[_0xb8c8('0x13')]=0x0;this['mailCapacity']=_0x52b3d1[_0xb8c8('0x14')]||0x0;this[_0xb8c8('0x15')]=0x0;this[_0xb8c8('0x16')]=_0xb8c8('0x12');this[_0xb8c8('0x17')]=0x0;this[_0xb8c8('0x18')]=_0x52b3d1['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0xb8c8('0x19')]=_0xb8c8('0x12');this['smsStatusTime']=0x0;this[_0xb8c8('0x1a')]=_0x52b3d1['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xb8c8('0x1b')]=_0xb8c8('0x12');this[_0xb8c8('0x1c')]=0x0;this['whatsappCapacity']=_0x52b3d1[_0xb8c8('0x1d')]||0x0;this[_0xb8c8('0x1e')]=0x0;this[_0xb8c8('0x1f')]=_0xb8c8('0x12');this[_0xb8c8('0x20')]=0x0;this[_0xb8c8('0x21')]=_0x52b3d1['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xb8c8('0x22')]=![];this[_0xb8c8('0x23')]=undefined;this['md5']='';this[_0xb8c8('0x24')]={};this['faxWaitingInteractions']={};this[_0xb8c8('0x25')]={};this[_0xb8c8('0x26')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0xb8c8('0x27')]();}Agent[_0xb8c8('0x28')]['getChannelStatus']=function(_0x4e7081){if(this[_0x4e7081+_0xb8c8('0x29')]>0x0){if(this[_0x4e7081+_0xb8c8('0x2a')]>0x0&&this[_0x4e7081+'CurrentCapacity']>=this[_0x4e7081+_0xb8c8('0x2a')]){return _0xb8c8('0x2b');}else{return _0xb8c8('0x2c');}}else{return _0xb8c8('0x2d');}};Agent['prototype'][_0xb8c8('0x27')]=function(){var _0x556b21=[_0xb8c8('0x2e'),_0xb8c8('0x2f'),'openchannel',_0xb8c8('0x30'),_0xb8c8('0x31'),_0xb8c8('0x32')];for(var _0x25337e=0x0;_0x25337e<_0x556b21['length'];_0x25337e+=0x1){var _0x58a421=this[_0xb8c8('0x33')](_0x556b21[_0x25337e]);if(this[_0x556b21[_0x25337e]+_0xb8c8('0x34')]!==_0x58a421){this[_0x556b21[_0x25337e]+_0xb8c8('0x35')]=_['toNumber'](moment()[_0xb8c8('0x36')]('x'));}this[_0x556b21[_0x25337e]+_0xb8c8('0x34')]=_0x58a421;}var _0x1c834b={'id':this['id'],'name':this[_0xb8c8('0x8')],'online':this[_0xb8c8('0x37')],'voicePause':this[_0xb8c8('0x9')],'chatPause':this[_0xb8c8('0xa')],'mailPause':this[_0xb8c8('0xb')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xb8c8('0xe')],'chatStatus':this[_0xb8c8('0xf')],'chatStatusTime':this[_0xb8c8('0x38')],'chatCapacity':this[_0xb8c8('0x10')],'chatCurrentCapacity':this[_0xb8c8('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xb8c8('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xb8c8('0x16')],'faxStatusTime':this[_0xb8c8('0x17')],'faxCapacity':this[_0xb8c8('0x18')],'faxCurrentCapacity':this[_0xb8c8('0x39')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xb8c8('0x1a')],'smsCurrentCapacity':this[_0xb8c8('0x3a')],'whatsappStatus':this[_0xb8c8('0x1b')],'whatsappStatusTime':this[_0xb8c8('0x1c')],'whatsappCapacity':this[_0xb8c8('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0xb8c8('0x1f')],'openchannelStatusTime':this[_0xb8c8('0x20')],'openchannelCapacity':this[_0xb8c8('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xb8c8('0x22')],'busyQueue':this[_0xb8c8('0x23')],'chatWaitingInteractions':this[_0xb8c8('0x24')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0xb8c8('0x25')],'openchannelWaitingInteractions':this[_0xb8c8('0x26')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xb8c8('0x3b')]};var _0x3ae30e=md5(JSON[_0xb8c8('0x3c')](_0x1c834b));if(this[_0xb8c8('0x0')]!==_0x3ae30e){this[_0xb8c8('0x0')]=_0x3ae30e;io[_0xb8c8('0x3d')]('user:routing:update',_[_0xb8c8('0x3e')](_0x1c834b,['online']));}};module[_0xb8c8('0x3f')]=Agent; \ No newline at end of file +var _0xf669=['chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','chat','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','format','Status','online','mailCurrentCapacity','smsStatus','whatsappWaitingInteractions','stringify','omit','exports','lodash','md5','moment','ioredis','redis','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime'];(function(_0x3eaa0d,_0x4fdf0b){var _0x274f05=function(_0x17e942){while(--_0x17e942){_0x3eaa0d['push'](_0x3eaa0d['shift']());}};_0x274f05(++_0x4fdf0b);}(_0xf669,0x139));var _0x9f66=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xf669[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x9f66('0x0'));var md5=require(_0x9f66('0x1'));var moment=require(_0x9f66('0x2'));var Redis=require(_0x9f66('0x3'));var config=require('../../../config/environment');config[_0x9f66('0x4')]=_['defaults'](config['redis'],{'host':_0x9f66('0x5'),'port':0x18eb});var io=require(_0x9f66('0x6'))(new Redis(config[_0x9f66('0x4')]));function Agent(_0x560ee4){this['id']=_0x560ee4['id']||0x0;this[_0x9f66('0x7')]=_0x560ee4[_0x9f66('0x7')]||'';this[_0x9f66('0x8')]=_0x560ee4[_0x9f66('0x8')]||![];this[_0x9f66('0x9')]=_0x560ee4[_0x9f66('0x9')]||![];this['mailPause']=_0x560ee4[_0x9f66('0xa')]||![];this[_0x9f66('0xb')]=_0x560ee4[_0x9f66('0xb')]||![];this[_0x9f66('0xc')]=_0x560ee4[_0x9f66('0xc')]||![];this[_0x9f66('0xd')]=_0x560ee4[_0x9f66('0xd')]||![];this[_0x9f66('0xe')]=_0x9f66('0xf');this[_0x9f66('0x10')]=0x0;this[_0x9f66('0x11')]=_0x560ee4['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this[_0x9f66('0x12')]=_0x9f66('0xf');this[_0x9f66('0x13')]=0x0;this[_0x9f66('0x14')]=_0x560ee4[_0x9f66('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x9f66('0x15')]=_0x9f66('0xf');this[_0x9f66('0x16')]=0x0;this['faxCapacity']=_0x560ee4[_0x9f66('0x17')]||0x0;this[_0x9f66('0x18')]=0x0;this['smsStatus']=_0x9f66('0xf');this[_0x9f66('0x19')]=0x0;this[_0x9f66('0x1a')]=_0x560ee4['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0x9f66('0x1b')]=_0x9f66('0xf');this[_0x9f66('0x1c')]=0x0;this[_0x9f66('0x1d')]=_0x560ee4['whatsappCapacity']||0x0;this[_0x9f66('0x1e')]=0x0;this[_0x9f66('0x1f')]=_0x9f66('0xf');this[_0x9f66('0x20')]=0x0;this[_0x9f66('0x21')]=_0x560ee4[_0x9f66('0x21')]||0x0;this[_0x9f66('0x22')]=0x0;this['busy']=![];this[_0x9f66('0x23')]=undefined;this[_0x9f66('0x1')]='';this[_0x9f66('0x24')]={};this[_0x9f66('0x25')]={};this[_0x9f66('0x26')]={};this[_0x9f66('0x27')]={};this[_0x9f66('0x28')]={};this['whatsappWaitingInteractions']={};this[_0x9f66('0x29')]();}Agent['prototype'][_0x9f66('0x2a')]=function(_0x1e9b47){if(this[_0x1e9b47+_0x9f66('0x2b')]>0x0){if(this[_0x1e9b47+_0x9f66('0x2c')]>0x0&&this[_0x1e9b47+_0x9f66('0x2b')]>=this[_0x1e9b47+_0x9f66('0x2c')]){return _0x9f66('0x2d');}else{return _0x9f66('0x2e');}}else{return _0x9f66('0x2f');}};Agent[_0x9f66('0x30')]['updateRealtime']=function(){var _0x32cf9a=['mail',_0x9f66('0x31'),_0x9f66('0x32'),_0x9f66('0x33'),_0x9f66('0x34'),_0x9f66('0x35')];for(var _0x180fa6=0x0;_0x180fa6<_0x32cf9a[_0x9f66('0x36')];_0x180fa6+=0x1){var _0x5cb1a5=this['getChannelStatus'](_0x32cf9a[_0x180fa6]);if(this[_0x32cf9a[_0x180fa6]+'Status']!==_0x5cb1a5){this[_0x32cf9a[_0x180fa6]+_0x9f66('0x37')]=_[_0x9f66('0x38')](moment()[_0x9f66('0x39')]('x'));}this[_0x32cf9a[_0x180fa6]+_0x9f66('0x3a')]=_0x5cb1a5;}var _0x2df0e5={'id':this['id'],'name':this[_0x9f66('0x7')],'online':this[_0x9f66('0x3b')],'voicePause':this[_0x9f66('0x8')],'chatPause':this[_0x9f66('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x9f66('0xc')],'faxPause':this[_0x9f66('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x9f66('0xe')],'chatStatusTime':this[_0x9f66('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x9f66('0x13')],'mailCapacity':this[_0x9f66('0x14')],'mailCurrentCapacity':this[_0x9f66('0x3c')],'faxStatus':this[_0x9f66('0x15')],'faxStatusTime':this[_0x9f66('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x9f66('0x18')],'smsStatus':this[_0x9f66('0x3d')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x9f66('0x1b')],'whatsappStatusTime':this[_0x9f66('0x1c')],'whatsappCapacity':this[_0x9f66('0x1d')],'whatsappCurrentCapacity':this[_0x9f66('0x1e')],'openchannelStatus':this[_0x9f66('0x1f')],'openchannelStatusTime':this[_0x9f66('0x20')],'openchannelCapacity':this[_0x9f66('0x21')],'openchannelCurrentCapacity':this[_0x9f66('0x22')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x9f66('0x24')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x9f66('0x26')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0x9f66('0x28')],'whatsappWaitingInteractions':this[_0x9f66('0x3e')]};var _0x4560f1=md5(JSON[_0x9f66('0x3f')](_0x2df0e5));if(this[_0x9f66('0x1')]!==_0x4560f1){this[_0x9f66('0x1')]=_0x4560f1;io['emit']('user:routing:update',_[_0x9f66('0x40')](_0x2df0e5,[_0x9f66('0x3b')]));}};module[_0x9f66('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 17edf8d..2a0db90 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 _0x4e93=['mapAgentsId','_rr','map','loggedIn','length','chatPause','paused','available','stringify','format','chat:queue:%s','emit','exports','lodash','md5','ioredis','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting'];(function(_0x287439,_0x1a3c46){var _0x2cfc83=function(_0x2ecff4){while(--_0x2ecff4){_0x287439['push'](_0x287439['shift']());}};_0x2cfc83(++_0x1a3c46);}(_0x4e93,0x1b1));var _0x34e9=function(_0x5ef539,_0x4217c9){_0x5ef539=_0x5ef539-0x0;var _0x2be138=_0x4e93[_0x5ef539];return _0x2be138;};'use strict';var _=require(_0x34e9('0x0'));var md5=require(_0x34e9('0x1'));var util=require('util');var Redis=require(_0x34e9('0x2'));var config=require('../../../config/environment');config[_0x34e9('0x3')]=_['defaults'](config[_0x34e9('0x3')],{'host':_0x34e9('0x4'),'port':0x18eb});var io=require(_0x34e9('0x5'))(new Redis(config[_0x34e9('0x3')]));function ChatQueue(_0xb52390){this['id']=_0xb52390['id']||0x0;this['name']=_0xb52390[_0x34e9('0x6')]||'';this[_0x34e9('0x7')]=_0xb52390[_0x34e9('0x7')]||0xa;this['strategy']=_0xb52390[_0x34e9('0x8')]||_0x34e9('0x9');this[_0x34e9('0xa')]=_0xb52390['Agents'];this['mapAgentsId']={};this[_0x34e9('0xb')]=0x0;this[_0x34e9('0x1')]='';this['updateRouting']();this[_0x34e9('0xc')]();}ChatQueue[_0x34e9('0xd')][_0x34e9('0xe')]=function(){var _0x1e96b7=this[_0x34e9('0xf')][_0x34e9('0x10')];this[_0x34e9('0xf')]=_[_0x34e9('0x11')](this[_0x34e9('0xa')],'id');this[_0x34e9('0xf')][_0x34e9('0x10')]=_0x1e96b7;};ChatQueue['prototype'][_0x34e9('0xc')]=function(){this[_0x34e9('0x12')]=0x0;this['paused']=0x0;for(var _0x5c6e1f=0x0;_0x5c6e1f=0x0?this[_0x34e9('0x16')]:0x0;var _0x4dad3c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x34e9('0x12')],'name':this[_0x34e9('0x6')],'paused':this[_0x34e9('0x15')],'waiting':this[_0x34e9('0xb')]};var _0x18d497=md5(JSON[_0x34e9('0x17')](_0x4dad3c));if(this[_0x34e9('0x1')]!==_0x18d497){this[_0x34e9('0x1')]=_0x18d497;io['to'](util[_0x34e9('0x18')](_0x34e9('0x19'),_0x4dad3c[_0x34e9('0x6')]))[_0x34e9('0x1a')]('chat_queue:save',_0x4dad3c);}};module[_0x34e9('0x1b')]=ChatQueue; \ No newline at end of file +var _0x0dce=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','chatPause','available','stringify','md5','format','chat:queue:%s','emit','chat_queue:save','util','ioredis','../../../config/environment','defaults','redis','localhost'];(function(_0x1c3375,_0x29cf53){var _0x179181=function(_0xc0207c){while(--_0xc0207c){_0x1c3375['push'](_0x1c3375['shift']());}};_0x179181(++_0x29cf53);}(_0x0dce,0x162));var _0xe0dc=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x0dce[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xe0dc('0x0'));var Redis=require(_0xe0dc('0x1'));var config=require(_0xe0dc('0x2'));config['redis']=_[_0xe0dc('0x3')](config[_0xe0dc('0x4')],{'host':_0xe0dc('0x5'),'port':0x18eb});var io=require(_0xe0dc('0x6'))(new Redis(config[_0xe0dc('0x4')]));function ChatQueue(_0x5281af){this['id']=_0x5281af['id']||0x0;this['name']=_0x5281af[_0xe0dc('0x7')]||'';this[_0xe0dc('0x8')]=_0x5281af[_0xe0dc('0x8')]||0xa;this['strategy']=_0x5281af[_0xe0dc('0x9')]||_0xe0dc('0xa');this[_0xe0dc('0xb')]=_0x5281af['Agents'];this[_0xe0dc('0xc')]={};this[_0xe0dc('0xd')]=0x0;this['md5']='';this[_0xe0dc('0xe')]();this[_0xe0dc('0xf')]();}ChatQueue[_0xe0dc('0x10')][_0xe0dc('0xe')]=function(){var _0x1e7773=this[_0xe0dc('0xc')][_0xe0dc('0x11')];this[_0xe0dc('0xc')]=_['map'](this[_0xe0dc('0xb')],'id');this[_0xe0dc('0xc')][_0xe0dc('0x11')]=_0x1e7773;};ChatQueue['prototype'][_0xe0dc('0xf')]=function(){this[_0xe0dc('0x12')]=0x0;this[_0xe0dc('0x13')]=0x0;for(var _0x4b205b=0x0;_0x4b205b=0x0?this['available']:0x0;var _0x2aaf9c={'id':this['id'],'available':this[_0xe0dc('0x17')],'loggedIn':this[_0xe0dc('0x12')],'name':this[_0xe0dc('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x1d5597=md5(JSON[_0xe0dc('0x18')](_0x2aaf9c));if(this[_0xe0dc('0x19')]!==_0x1d5597){this[_0xe0dc('0x19')]=_0x1d5597;io['to'](util[_0xe0dc('0x1a')](_0xe0dc('0x1b'),_0x2aaf9c[_0xe0dc('0x7')]))[_0xe0dc('0x1c')](_0xe0dc('0x1d'),_0x2aaf9c);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index a1ccceb..de548e5 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 _0x96df=['prototype','loggedIn','paused','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','lodash','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr'];(function(_0x1dda91,_0x1a0da4){var _0x1ac172=function(_0x4b05f2){while(--_0x4b05f2){_0x1dda91['push'](_0x1dda91['shift']());}};_0x1ac172(++_0x1a0da4);}(_0x96df,0x118));var _0xf96d=function(_0x3d6d80,_0x1689b7){_0x3d6d80=_0x3d6d80-0x0;var _0x30712a=_0x96df[_0x3d6d80];return _0x30712a;};'use strict';var _=require(_0xf96d('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf96d('0x1'));var config=require(_0xf96d('0x2'));config[_0xf96d('0x3')]=_[_0xf96d('0x4')](config[_0xf96d('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xf96d('0x5'))(new Redis(config[_0xf96d('0x3')]));function FaxQueue(_0x50d7f9){this['id']=_0x50d7f9['id']||0x0;this[_0xf96d('0x6')]=_0x50d7f9[_0xf96d('0x6')]||'';this['timeout']=_0x50d7f9[_0xf96d('0x7')]||0xa;this[_0xf96d('0x8')]=_0x50d7f9[_0xf96d('0x8')]||_0xf96d('0x9');this[_0xf96d('0xa')]=_0x50d7f9[_0xf96d('0xa')];this[_0xf96d('0xb')]={};this[_0xf96d('0xc')]=0x0;this[_0xf96d('0xd')]='';this[_0xf96d('0xe')]();this[_0xf96d('0xf')]();}FaxQueue['prototype'][_0xf96d('0xe')]=function(){var _0xca6f73=this['mapAgentsId'][_0xf96d('0x10')];this[_0xf96d('0xb')]=_['map'](this[_0xf96d('0xa')],'id');this[_0xf96d('0xb')][_0xf96d('0x10')]=_0xca6f73;};FaxQueue[_0xf96d('0x11')][_0xf96d('0xf')]=function(){this[_0xf96d('0x12')]=0x0;this[_0xf96d('0x13')]=0x0;for(var _0x3cd3ed=0x0;_0x3cd3ed=0x0?this[_0xf96d('0x15')]:0x0;var _0xa29848={'id':this['id'],'available':this[_0xf96d('0x15')],'loggedIn':this[_0xf96d('0x12')],'name':this[_0xf96d('0x6')],'paused':this['paused'],'waiting':this[_0xf96d('0xc')]};var _0x5e8b3a=md5(JSON[_0xf96d('0x16')](_0xa29848));if(this['md5']!==_0x5e8b3a){this[_0xf96d('0xd')]=_0x5e8b3a;io['to'](util[_0xf96d('0x17')](_0xf96d('0x18'),_0xa29848[_0xf96d('0x6')]))[_0xf96d('0x19')](_0xf96d('0x1a'),_0xa29848);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x2f7b=['format','fax:queue:%s','name','emit','fax_queue:save','lodash','md5','util','ioredis','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','_rr','map','prototype','paused','length','online','loggedIn','available','waiting'];(function(_0x3da72b,_0x4fd809){var _0xc64ac4=function(_0x387e50){while(--_0x387e50){_0x3da72b['push'](_0x3da72b['shift']());}};_0xc64ac4(++_0x4fd809);}(_0x2f7b,0x1bf));var _0xb2f7=function(_0x436de6,_0x308ed0){_0x436de6=_0x436de6-0x0;var _0x482366=_0x2f7b[_0x436de6];return _0x482366;};'use strict';var _=require(_0xb2f7('0x0'));var md5=require(_0xb2f7('0x1'));var util=require(_0xb2f7('0x2'));var Redis=require(_0xb2f7('0x3'));var config=require('../../../config/environment');config[_0xb2f7('0x4')]=_['defaults'](config[_0xb2f7('0x4')],{'host':_0xb2f7('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function FaxQueue(_0x10f275){this['id']=_0x10f275['id']||0x0;this['name']=_0x10f275['name']||'';this[_0xb2f7('0x6')]=_0x10f275[_0xb2f7('0x6')]||0xa;this[_0xb2f7('0x7')]=_0x10f275[_0xb2f7('0x7')]||_0xb2f7('0x8');this[_0xb2f7('0x9')]=_0x10f275[_0xb2f7('0x9')];this[_0xb2f7('0xa')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0xb2f7('0xb')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x3823c0=this[_0xb2f7('0xa')][_0xb2f7('0xc')];this[_0xb2f7('0xa')]=_[_0xb2f7('0xd')](this[_0xb2f7('0x9')],'id');this[_0xb2f7('0xa')]['_rr']=_0x3823c0;};FaxQueue[_0xb2f7('0xe')][_0xb2f7('0xb')]=function(){this['loggedIn']=0x0;this[_0xb2f7('0xf')]=0x0;for(var _0xab54ec=0x0;_0xab54ec=0x0?this[_0xb2f7('0x13')]:0x0;var _0x408ba6={'id':this['id'],'available':this[_0xb2f7('0x13')],'loggedIn':this[_0xb2f7('0x12')],'name':this['name'],'paused':this[_0xb2f7('0xf')],'waiting':this[_0xb2f7('0x14')]};var _0x277c4a=md5(JSON['stringify'](_0x408ba6));if(this[_0xb2f7('0x1')]!==_0x277c4a){this[_0xb2f7('0x1')]=_0x277c4a;io['to'](util[_0xb2f7('0x15')](_0xb2f7('0x16'),_0x408ba6[_0xb2f7('0x17')]))[_0xb2f7('0x18')](_0xb2f7('0x19'),_0x408ba6);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b0c7c57..e6e5d82 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 _0x6a52=['exports','Intervals'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x6a52,0x129));var _0x26a5=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x6a52[_0xf34109];return _0x570bfc;};'use strict';function Interval(_0x4c2b95){this['id']=_0x4c2b95['id']||0x0;this['name']=_0x4c2b95['name']||'';this[_0x26a5('0x0')]=_0x4c2b95[_0x26a5('0x0')]||{};}module[_0x26a5('0x1')]=Interval; \ No newline at end of file +var _0xf2ad=['name','Intervals','exports'];(function(_0x6893ee,_0x44ba6f){var _0x532615=function(_0x5afa2d){while(--_0x5afa2d){_0x6893ee['push'](_0x6893ee['shift']());}};_0x532615(++_0x44ba6f);}(_0xf2ad,0x75));var _0xdf2a=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0xf2ad[_0x4c73ac];return _0x9839ee;};'use strict';function Interval(_0x5bad12){this['id']=_0x5bad12['id']||0x0;this['name']=_0x5bad12[_0xdf2a('0x0')]||'';this[_0xdf2a('0x1')]=_0x5bad12[_0xdf2a('0x1')]||{};}module[_0xdf2a('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 b223fd2..2f168fe 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 _0x9919=['ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','md5','updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','mail:queue:%s','emit','mail_queue:save','exports'];(function(_0x225a46,_0x224368){var _0x3a1797=function(_0x4d1a73){while(--_0x4d1a73){_0x225a46['push'](_0x225a46['shift']());}};_0x3a1797(++_0x224368);}(_0x9919,0xc0));var _0x9991=function(_0x25ccbe,_0xc935c0){_0x25ccbe=_0x25ccbe-0x0;var _0x289529=_0x9919[_0x25ccbe];return _0x289529;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x9991('0x0'));var config=require(_0x9991('0x1'));config[_0x9991('0x2')]=_['defaults'](config[_0x9991('0x2')],{'host':_0x9991('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9991('0x2')]));function MailQueue(_0x635f74){this['id']=_0x635f74['id']||0x0;this['name']=_0x635f74[_0x9991('0x4')]||'';this[_0x9991('0x5')]=_0x635f74[_0x9991('0x5')]||0xa;this[_0x9991('0x6')]=_0x635f74['strategy']||'beepall';this[_0x9991('0x7')]=_0x635f74[_0x9991('0x7')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x9991('0x8')]='';this['updateRouting']();this[_0x9991('0x9')]();}MailQueue['prototype'][_0x9991('0xa')]=function(){var _0x20ddd0=this['mapAgentsId'][_0x9991('0xb')];this['mapAgentsId']=_['map'](this[_0x9991('0x7')],'id');this['mapAgentsId'][_0x9991('0xb')]=_0x20ddd0;};MailQueue[_0x9991('0xc')]['updateRealtime']=function(){this[_0x9991('0xd')]=0x0;this[_0x9991('0xe')]=0x0;for(var _0xef503b=0x0;_0xef503b=0x0?this['available']:0x0;var _0xe59e13={'id':this['id'],'available':this[_0x9991('0x11')],'loggedIn':this[_0x9991('0xd')],'name':this[_0x9991('0x4')],'paused':this['paused'],'waiting':this[_0x9991('0x12')]};var _0x242d0b=md5(JSON[_0x9991('0x13')](_0xe59e13));if(this[_0x9991('0x8')]!==_0x242d0b){this['md5']=_0x242d0b;io['to'](util['format'](_0x9991('0x14'),_0xe59e13[_0x9991('0x4')]))[_0x9991('0x15')](_0x9991('0x16'),_0xe59e13);}};module[_0x9991('0x17')]=MailQueue; \ No newline at end of file +var _0x85f9=['mailPause','available','name','stringify','format','emit','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x85f9,0x1ac));var _0x985f=function(_0x185e78,_0x2d08a0){_0x185e78=_0x185e78-0x0;var _0x4a7d21=_0x85f9[_0x185e78];return _0x4a7d21;};'use strict';var _=require('lodash');var md5=require(_0x985f('0x0'));var util=require(_0x985f('0x1'));var Redis=require(_0x985f('0x2'));var config=require(_0x985f('0x3'));config[_0x985f('0x4')]=_[_0x985f('0x5')](config[_0x985f('0x4')],{'host':_0x985f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function MailQueue(_0xaa701a){this['id']=_0xaa701a['id']||0x0;this['name']=_0xaa701a['name']||'';this[_0x985f('0x7')]=_0xaa701a[_0x985f('0x7')]||0xa;this[_0x985f('0x8')]=_0xaa701a[_0x985f('0x8')]||_0x985f('0x9');this['Agents']=_0xaa701a[_0x985f('0xa')];this[_0x985f('0xb')]={};this[_0x985f('0xc')]=0x0;this[_0x985f('0x0')]='';this[_0x985f('0xd')]();this[_0x985f('0xe')]();}MailQueue[_0x985f('0xf')][_0x985f('0xd')]=function(){var _0x59d2f6=this[_0x985f('0xb')][_0x985f('0x10')];this[_0x985f('0xb')]=_['map'](this[_0x985f('0xa')],'id');this[_0x985f('0xb')][_0x985f('0x10')]=_0x59d2f6;};MailQueue[_0x985f('0xf')]['updateRealtime']=function(){this[_0x985f('0x11')]=0x0;this[_0x985f('0x12')]=0x0;for(var _0x400360=0x0;_0x400360=0x0?this['available']:0x0;var _0x2818f8={'id':this['id'],'available':this[_0x985f('0x15')],'loggedIn':this[_0x985f('0x11')],'name':this[_0x985f('0x16')],'paused':this['paused'],'waiting':this['waiting']};var _0x3c5add=md5(JSON[_0x985f('0x17')](_0x2818f8));if(this[_0x985f('0x0')]!==_0x3c5add){this[_0x985f('0x0')]=_0x3c5add;io['to'](util[_0x985f('0x18')]('mail:queue:%s',_0x2818f8[_0x985f('0x16')]))[_0x985f('0x19')](_0x985f('0x1a'),_0x2818f8);}};module[_0x985f('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 8e66961..70147e1 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 _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x1261,0x144));var _0x1126=function(_0x42d0ed,_0x91a115){_0x42d0ed=_0x42d0ed-0x0;var _0x3f63f6=_0x1261[_0x42d0ed];return _0x3f63f6;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x1261,0x144));var _0x1126=function(_0x3f52ee,_0x468aab){_0x3f52ee=_0x3f52ee-0x0;var _0x4f7924=_0x1261[_0x3f52ee];return _0x4f7924;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 93b9d78..4d369f4 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 _0xcc73=['format','sms:queue:%s','exports','md5','util','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','smsPause','available'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcc73[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var md5=require(_0x3cc7('0x0'));var util=require(_0x3cc7('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3cc7('0x2')]=_['defaults'](config[_0x3cc7('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3cc7('0x2')]));function SmsQueue(_0xd060f7){this['id']=_0xd060f7['id']||0x0;this[_0x3cc7('0x3')]=_0xd060f7[_0x3cc7('0x3')]||'';this[_0x3cc7('0x4')]=_0xd060f7['timeout']||0xa;this[_0x3cc7('0x5')]=_0xd060f7[_0x3cc7('0x5')]||_0x3cc7('0x6');this[_0x3cc7('0x7')]=_0xd060f7['Agents'];this[_0x3cc7('0x8')]={};this[_0x3cc7('0x9')]=0x0;this[_0x3cc7('0x0')]='';this[_0x3cc7('0xa')]();this[_0x3cc7('0xb')]();}SmsQueue[_0x3cc7('0xc')][_0x3cc7('0xa')]=function(){var _0x57d9de=this['mapAgentsId'][_0x3cc7('0xd')];this['mapAgentsId']=_[_0x3cc7('0xe')](this[_0x3cc7('0x7')],'id');this[_0x3cc7('0x8')][_0x3cc7('0xd')]=_0x57d9de;};SmsQueue[_0x3cc7('0xc')][_0x3cc7('0xb')]=function(){this[_0x3cc7('0xf')]=0x0;this[_0x3cc7('0x10')]=0x0;for(var _0x2d1880=0x0;_0x2d1880=0x0?this[_0x3cc7('0x14')]:0x0;var _0xff4317={'id':this['id'],'available':this[_0x3cc7('0x14')],'loggedIn':this[_0x3cc7('0xf')],'name':this[_0x3cc7('0x3')],'paused':this[_0x3cc7('0x10')],'waiting':this[_0x3cc7('0x9')]};var _0x54f825=md5(JSON['stringify'](_0xff4317));if(this[_0x3cc7('0x0')]!==_0x54f825){this['md5']=_0x54f825;io['to'](util[_0x3cc7('0x15')](_0x3cc7('0x16'),_0xff4317[_0x3cc7('0x3')]))['emit']('sms_queue:save',_0xff4317);}};module[_0x3cc7('0x17')]=SmsQueue; \ No newline at end of file +var _0xde64=['sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','available','stringify','format'];(function(_0x2722fe,_0x5a1f25){var _0x1efb19=function(_0x20be7a){while(--_0x20be7a){_0x2722fe['push'](_0x2722fe['shift']());}};_0x1efb19(++_0x5a1f25);}(_0xde64,0x17c));var _0x4de6=function(_0x564f04,_0x398f13){_0x564f04=_0x564f04-0x0;var _0x36d45b=_0xde64[_0x564f04];return _0x36d45b;};'use strict';var _=require(_0x4de6('0x0'));var md5=require(_0x4de6('0x1'));var util=require(_0x4de6('0x2'));var Redis=require(_0x4de6('0x3'));var config=require(_0x4de6('0x4'));config[_0x4de6('0x5')]=_['defaults'](config[_0x4de6('0x5')],{'host':_0x4de6('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0xe0bed){this['id']=_0xe0bed['id']||0x0;this[_0x4de6('0x7')]=_0xe0bed['name']||'';this['timeout']=_0xe0bed[_0x4de6('0x8')]||0xa;this[_0x4de6('0x9')]=_0xe0bed[_0x4de6('0x9')]||_0x4de6('0xa');this[_0x4de6('0xb')]=_0xe0bed[_0x4de6('0xb')];this['mapAgentsId']={};this[_0x4de6('0xc')]=0x0;this[_0x4de6('0x1')]='';this[_0x4de6('0xd')]();this['updateRealtime']();}SmsQueue[_0x4de6('0xe')][_0x4de6('0xd')]=function(){var _0x2e205b=this[_0x4de6('0xf')][_0x4de6('0x10')];this['mapAgentsId']=_[_0x4de6('0x11')](this[_0x4de6('0xb')],'id');this[_0x4de6('0xf')]['_rr']=_0x2e205b;};SmsQueue[_0x4de6('0xe')][_0x4de6('0x12')]=function(){this[_0x4de6('0x13')]=0x0;this[_0x4de6('0x14')]=0x0;for(var _0x58b0c1=0x0;_0x58b0c1=0x0?this[_0x4de6('0x16')]:0x0;var _0x5aacb4={'id':this['id'],'available':this[_0x4de6('0x16')],'loggedIn':this[_0x4de6('0x13')],'name':this[_0x4de6('0x7')],'paused':this[_0x4de6('0x14')],'waiting':this[_0x4de6('0xc')]};var _0x360cf7=md5(JSON[_0x4de6('0x17')](_0x5aacb4));if(this[_0x4de6('0x1')]!==_0x360cf7){this[_0x4de6('0x1')]=_0x360cf7;io['to'](util[_0x4de6('0x18')]('sms:queue:%s',_0x5aacb4[_0x4de6('0x7')]))['emit'](_0x4de6('0x19'),_0x5aacb4);}};module[_0x4de6('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 1c2a76d..0c6e42f 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 _0xc612=['lodash','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports'];(function(_0x2299a5,_0x1cdddc){var _0x5942a0=function(_0x52f180){while(--_0x52f180){_0x2299a5['push'](_0x2299a5['shift']());}};_0x5942a0(++_0x1cdddc);}(_0xc612,0xcb));var _0x2c61=function(_0x153dcf,_0x147a98){_0x153dcf=_0x153dcf-0x0;var _0x13b173=_0xc612[_0x153dcf];return _0x13b173;};'use strict';var _=require(_0x2c61('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x2c61('0x1'));var config=require('../../../config/environment');config[_0x2c61('0x2')]=_[_0x2c61('0x3')](config[_0x2c61('0x2')],{'host':_0x2c61('0x4'),'port':0x18eb});var io=require(_0x2c61('0x5'))(new Redis(config[_0x2c61('0x2')]));function WhatsappQueue(_0x7d8a64){this['id']=_0x7d8a64['id']||0x0;this[_0x2c61('0x6')]=_0x7d8a64[_0x2c61('0x6')]||'';this[_0x2c61('0x7')]=_0x7d8a64['timeout']||0xa;this[_0x2c61('0x8')]=_0x7d8a64[_0x2c61('0x8')]||_0x2c61('0x9');this[_0x2c61('0xa')]=_0x7d8a64[_0x2c61('0xa')];this[_0x2c61('0xb')]={};this[_0x2c61('0xc')]=0x0;this[_0x2c61('0xd')]='';this['updateRouting']();this[_0x2c61('0xe')]();}WhatsappQueue[_0x2c61('0xf')][_0x2c61('0x10')]=function(){var _0x15cb09=this[_0x2c61('0xb')][_0x2c61('0x11')];this[_0x2c61('0xb')]=_[_0x2c61('0x12')](this[_0x2c61('0xa')],'id');this['mapAgentsId'][_0x2c61('0x11')]=_0x15cb09;};WhatsappQueue[_0x2c61('0xf')][_0x2c61('0xe')]=function(){this[_0x2c61('0x13')]=0x0;this[_0x2c61('0x14')]=0x0;for(var _0x56d3d9=0x0;_0x56d3d9=0x0?this[_0x2c61('0x17')]:0x0;var _0x59c484={'id':this['id'],'available':this[_0x2c61('0x17')],'loggedIn':this[_0x2c61('0x13')],'name':this['name'],'paused':this[_0x2c61('0x14')],'waiting':this['waiting']};var _0x7e8ca=md5(JSON[_0x2c61('0x18')](_0x59c484));if(this[_0x2c61('0xd')]!==_0x7e8ca){this[_0x2c61('0xd')]=_0x7e8ca;io['to'](util[_0x2c61('0x19')](_0x2c61('0x1a'),_0x59c484['name']))['emit'](_0x2c61('0x1b'),_0x59c484);}};module[_0x2c61('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xec2b=['updateRealtime','prototype','_rr','map','loggedIn','paused','whatsappPause','available','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0xec2b,0x186));var _0xbec2=function(_0x27e3a6,_0x1c2583){_0x27e3a6=_0x27e3a6-0x0;var _0xa1b8d6=_0xec2b[_0x27e3a6];return _0xa1b8d6;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xbec2('0x0'));var Redis=require(_0xbec2('0x1'));var config=require(_0xbec2('0x2'));config[_0xbec2('0x3')]=_[_0xbec2('0x4')](config[_0xbec2('0x3')],{'host':_0xbec2('0x5'),'port':0x18eb});var io=require(_0xbec2('0x6'))(new Redis(config[_0xbec2('0x3')]));function WhatsappQueue(_0x4b885f){this['id']=_0x4b885f['id']||0x0;this[_0xbec2('0x7')]=_0x4b885f[_0xbec2('0x7')]||'';this[_0xbec2('0x8')]=_0x4b885f[_0xbec2('0x8')]||0xa;this['strategy']=_0x4b885f[_0xbec2('0x9')]||_0xbec2('0xa');this[_0xbec2('0xb')]=_0x4b885f[_0xbec2('0xb')];this[_0xbec2('0xc')]={};this[_0xbec2('0xd')]=0x0;this[_0xbec2('0xe')]='';this[_0xbec2('0xf')]();this[_0xbec2('0x10')]();}WhatsappQueue[_0xbec2('0x11')]['updateRouting']=function(){var _0x2adfeb=this[_0xbec2('0xc')][_0xbec2('0x12')];this[_0xbec2('0xc')]=_[_0xbec2('0x13')](this[_0xbec2('0xb')],'id');this[_0xbec2('0xc')][_0xbec2('0x12')]=_0x2adfeb;};WhatsappQueue[_0xbec2('0x11')][_0xbec2('0x10')]=function(){this[_0xbec2('0x14')]=0x0;this[_0xbec2('0x15')]=0x0;for(var _0x51fd8d=0x0;_0x51fd8d=0x0?this[_0xbec2('0x17')]:0x0;var _0x5e3468={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbec2('0x14')],'name':this[_0xbec2('0x7')],'paused':this[_0xbec2('0x15')],'waiting':this[_0xbec2('0xd')]};var _0xeb8868=md5(JSON[_0xbec2('0x18')](_0x5e3468));if(this[_0xbec2('0xe')]!==_0xeb8868){this[_0xbec2('0xe')]=_0xeb8868;io['to'](util['format'](_0xbec2('0x19'),_0x5e3468[_0xbec2('0x7')]))[_0xbec2('0x1a')](_0xbec2('0x1b'),_0x5e3468);}};module[_0xbec2('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f262ece..d16c7de 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(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 567856e..5917eb4 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 _0x76a9=['updateChatInteraction','addTags','AddTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x37d53d,_0xebf4ba){var _0x4bdd56=function(_0x2a40cb){while(--_0x2a40cb){_0x37d53d['push'](_0x37d53d['shift']());}};_0x4bdd56(++_0xebf4ba);}(_0x76a9,0x183));var _0x976a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x76a9[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x976a('0x0'));exports['update']=function(_0x1faa7c,_0x3b7e24){return client[_0x976a('0x1')](_0x976a('0x2'),{'body':_0x3b7e24,'options':{'where':{'id':_0x1faa7c}},'log':_0x976a('0x3')});};exports[_0x976a('0x4')]=function(_0x53b0ff,_0x1a68cd){return client[_0x976a('0x1')](_0x976a('0x5'),{'body':_0x1a68cd,'options':{'where':{'id':_0x53b0ff}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xa30d=['Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction','updateChatInteraction'];(function(_0x20e52b,_0x5400bf){var _0x2a0e75=function(_0x1b6a85){while(--_0x1b6a85){_0x20e52b['push'](_0x20e52b['shift']());}};_0x2a0e75(++_0x5400bf);}(_0xa30d,0x11b));var _0xda30=function(_0x459a1e,_0x318fc9){_0x459a1e=_0x459a1e-0x0;var _0x2086cc=_0xa30d[_0x459a1e];return _0x2086cc;};'use strict';var client=require(_0xda30('0x0'));exports[_0xda30('0x1')]=function(_0x1eafac,_0x54f31e){return client['Request'](_0xda30('0x2'),{'body':_0x54f31e,'options':{'where':{'id':_0x1eafac}},'log':_0xda30('0x3')});};exports['addTags']=function(_0x2c5553,_0x1c3e98){return client[_0xda30('0x4')](_0xda30('0x5'),{'body':_0x1c3e98,'options':{'where':{'id':_0x2c5553}},'log':_0xda30('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 27dfaef..694ca9e 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 _0x4c61=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x4c61,0xda));var _0x14c6=function(_0x26773b,_0x15bebf){_0x26773b=_0x26773b-0x0;var _0x4b86cf=_0x4c61[_0x26773b];return _0x4b86cf;};'use strict';var client=require('../client');exports[_0x14c6('0x0')]=function(_0x22a9ef){return client[_0x14c6('0x1')](_0x14c6('0x2'),{'body':_0x22a9ef,'log':_0x14c6('0x3')});}; \ No newline at end of file +var _0x1f71=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x405fe8,_0xa55e2f){var _0x50e490=function(_0x566869){while(--_0x566869){_0x405fe8['push'](_0x405fe8['shift']());}};_0x50e490(++_0xa55e2f);}(_0x1f71,0x11e));var _0x11f7=function(_0x58a8a7,_0x4deb0a){_0x58a8a7=_0x58a8a7-0x0;var _0x48345f=_0x1f71[_0x58a8a7];return _0x48345f;};'use strict';var client=require(_0x11f7('0x0'));exports['create']=function(_0x2f939b){return client[_0x11f7('0x1')](_0x11f7('0x2'),{'body':_0x2f939b,'log':_0x11f7('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 14bf59b..f79eded 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 _0xf3ff=['User','online','chatPause','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0xd43e1d,_0x26a204){var _0x5c7332=function(_0x266a00){while(--_0x266a00){_0xd43e1d['push'](_0xd43e1d['shift']());}};_0x5c7332(++_0x26a204);}(_0xf3ff,0xae));var _0xff3f=function(_0x53b985,_0x438557){_0x53b985=_0x53b985-0x0;var _0x49806d=_0xf3ff[_0x53b985];return _0x49806d;};'use strict';var client=require(_0xff3f('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xff3f('0x1')](_0xff3f('0x2'),{'options':{'raw':![],'attributes':['id',_0xff3f('0x3'),_0xff3f('0x4'),_0xff3f('0x5')],'include':[{'model':_0xff3f('0x6'),'as':'Agents','attributes':['id',_0xff3f('0x3'),_0xff3f('0x7'),_0xff3f('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xeb79=['Agents','online','chatPause','Request','name','strategy'];(function(_0x54dc88,_0x3e0d12){var _0x552e41=function(_0x49f520){while(--_0x49f520){_0x54dc88['push'](_0x54dc88['shift']());}};_0x552e41(++_0x3e0d12);}(_0xeb79,0x87));var _0x9eb7=function(_0x295c5a,_0x154dad){_0x295c5a=_0x295c5a-0x0;var _0x334e9a=_0xeb79[_0x295c5a];return _0x334e9a;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x9eb7('0x0')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x9eb7('0x1'),'timeout',_0x9eb7('0x2')],'include':[{'model':'User','as':_0x9eb7('0x3'),'attributes':['id',_0x9eb7('0x1'),_0x9eb7('0x4'),_0x9eb7('0x5')]}]},'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 e7035d7..252a5c8 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 _0xee24=['UpdateChatQueueReport','DESC','create','CreateChatQueueReport','update','Request'];(function(_0x27636e,_0x5adf25){var _0xcf8be=function(_0x48c58a){while(--_0x48c58a){_0x27636e['push'](_0x27636e['shift']());}};_0xcf8be(++_0x5adf25);}(_0xee24,0x1a6));var _0x4ee2=function(_0x63b6d3,_0x13c87d){_0x63b6d3=_0x63b6d3-0x0;var _0x41a70c=_0xee24[_0x63b6d3];return _0x41a70c;};'use strict';var client=require('../client');exports[_0x4ee2('0x0')]=function(_0x2b4e8f){return client['Request'](_0x4ee2('0x1'),{'body':_0x2b4e8f,'log':_0x4ee2('0x1')});};exports[_0x4ee2('0x2')]=function(_0x34b373,_0x5546e1){return client[_0x4ee2('0x3')](_0x4ee2('0x4'),{'body':_0x5546e1,'options':{'where':{'uniqueid':_0x34b373},'order':[['id',_0x4ee2('0x5')]],'limit':0x1},'log':_0x4ee2('0x4')});}; \ No newline at end of file +var _0xaf5a=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','create'];(function(_0x2e4f96,_0x3f7d0c){var _0x548233=function(_0x213183){while(--_0x213183){_0x2e4f96['push'](_0x2e4f96['shift']());}};_0x548233(++_0x3f7d0c);}(_0xaf5a,0x144));var _0xaaf5=function(_0x2bf31e,_0x3d5db7){_0x2bf31e=_0x2bf31e-0x0;var _0x528176=_0xaf5a[_0x2bf31e];return _0x528176;};'use strict';var client=require('../client');exports[_0xaaf5('0x0')]=function(_0x4f294c){return client[_0xaaf5('0x1')](_0xaaf5('0x2'),{'body':_0x4f294c,'log':_0xaaf5('0x2')});};exports[_0xaaf5('0x3')]=function(_0x337a3,_0x277e58){return client[_0xaaf5('0x1')](_0xaaf5('0x4'),{'body':_0x277e58,'options':{'where':{'uniqueid':_0x337a3},'order':[['id','DESC']],'limit':0x1},'log':_0xaaf5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 700496d..538f36a 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(_0x5bc5fe,_0x2afaef){var _0x298ea7=function(_0x1c6bd5){while(--_0x1c6bd5){_0x5bc5fe['push'](_0x5bc5fe['shift']());}};_0x298ea7(++_0x2afaef);}(_0x7a54,0x106));var _0x47a5=function(_0x52473d,_0x2ebec5){_0x52473d=_0x52473d-0x0;var _0x11ed7f=_0x7a54[_0x52473d];return _0x11ed7f;};'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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7a54,0x106));var _0x47a5=function(_0x293dfe,_0x48de0c){_0x293dfe=_0x293dfe-0x0;var _0x451f5c=_0x7a54[_0x293dfe];return _0x451f5c;};'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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 7424b51..e1aae59 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 _0x1077=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x1d457e,_0x22f9a9){var _0x332b9d=function(_0x368991){while(--_0x368991){_0x1d457e['push'](_0x1d457e['shift']());}};_0x332b9d(++_0x22f9a9);}(_0x1077,0xb9));var _0x7107=function(_0x2b12eb,_0x71951a){_0x2b12eb=_0x2b12eb-0x0;var _0x485d1e=_0x1077[_0x2b12eb];return _0x485d1e;};'use strict';var client=require('../client');exports[_0x7107('0x0')]=function(_0x48e5df){return client[_0x7107('0x1')](_0x7107('0x2'),{'body':_0x48e5df,'log':_0x7107('0x3')});}; \ No newline at end of file +var _0xe6f6=['create','CreateFaxMessage','createFaxMessage'];(function(_0xd4edf8,_0x3b7119){var _0x157cc3=function(_0x545323){while(--_0x545323){_0xd4edf8['push'](_0xd4edf8['shift']());}};_0x157cc3(++_0x3b7119);}(_0xe6f6,0x1e0));var _0x6e6f=function(_0x36bf41,_0x1312be){_0x36bf41=_0x36bf41-0x0;var _0x4ccc22=_0xe6f6[_0x36bf41];return _0x4ccc22;};'use strict';var client=require('../client');exports[_0x6e6f('0x0')]=function(_0x46ac9d){return client['Request'](_0x6e6f('0x1'),{'body':_0x46ac9d,'log':_0x6e6f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index a9da0de..2cb21c6 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 _0x3567=['../client','getFaxQueues','Request','GetFaxQueue','name','strategy','User','Agents','online'];(function(_0x251296,_0x51d7a8){var _0x5f3ead=function(_0x354000){while(--_0x354000){_0x251296['push'](_0x251296['shift']());}};_0x5f3ead(++_0x51d7a8);}(_0x3567,0x15f));var _0x7356=function(_0x77c3a3,_0x2bc878){_0x77c3a3=_0x77c3a3-0x0;var _0xa42789=_0x3567[_0x77c3a3];return _0xa42789;};'use strict';var client=require(_0x7356('0x0'));exports[_0x7356('0x1')]=function(){return function(){return client[_0x7356('0x2')](_0x7356('0x3'),{'options':{'raw':![],'attributes':['id',_0x7356('0x4'),'timeout',_0x7356('0x5')],'include':[{'model':_0x7356('0x6'),'as':_0x7356('0x7'),'attributes':['id','name',_0x7356('0x8'),'faxPause']}]},'log':_0x7356('0x1')});};}; \ No newline at end of file +var _0x837c=['Request','name','timeout','strategy','Agents','online','../client','getFaxQueues'];(function(_0x51a473,_0x46b2c8){var _0x1ae37a=function(_0x1a5219){while(--_0x1a5219){_0x51a473['push'](_0x51a473['shift']());}};_0x1ae37a(++_0x46b2c8);}(_0x837c,0xe6));var _0xc837=function(_0x15c8ba,_0x2dbea5){_0x15c8ba=_0x15c8ba-0x0;var _0x311b51=_0x837c[_0x15c8ba];return _0x311b51;};'use strict';var client=require(_0xc837('0x0'));exports[_0xc837('0x1')]=function(){return function(){return client[_0xc837('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xc837('0x3'),_0xc837('0x4'),_0xc837('0x5')],'include':[{'model':'User','as':_0xc837('0x6'),'attributes':['id',_0xc837('0x3'),_0xc837('0x7'),'faxPause']}]},'log':_0xc837('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index be51fd9..7a42f73 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 _0x6286=['UpdateFaxQueueReport','create','Request','CreateFaxQueueReport','update'];(function(_0x5d61ef,_0x36ec09){var _0x55dd0e=function(_0xe6a021){while(--_0xe6a021){_0x5d61ef['push'](_0x5d61ef['shift']());}};_0x55dd0e(++_0x36ec09);}(_0x6286,0x1a5));var _0x6628=function(_0x88d72b,_0x161055){_0x88d72b=_0x88d72b-0x0;var _0x15a298=_0x6286[_0x88d72b];return _0x15a298;};'use strict';var client=require('../client');exports[_0x6628('0x0')]=function(_0x2aab20){return client[_0x6628('0x1')](_0x6628('0x2'),{'body':_0x2aab20,'log':_0x6628('0x2')});};exports[_0x6628('0x3')]=function(_0x57afc5,_0x53a451){return client['Request'](_0x6628('0x4'),{'body':_0x53a451,'options':{'where':{'uniqueid':_0x57afc5},'order':[['id','DESC']],'limit':0x1},'log':_0x6628('0x4')});}; \ No newline at end of file +var _0x7379=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x110ea4,_0x13786f){var _0x1fb518=function(_0x365a67){while(--_0x365a67){_0x110ea4['push'](_0x110ea4['shift']());}};_0x1fb518(++_0x13786f);}(_0x7379,0x14d));var _0x9737=function(_0x1007d3,_0x17ddaf){_0x1007d3=_0x1007d3-0x0;var _0xa1c123=_0x7379[_0x1007d3];return _0xa1c123;};'use strict';var client=require(_0x9737('0x0'));exports[_0x9737('0x1')]=function(_0xe9841a){return client[_0x9737('0x2')](_0x9737('0x3'),{'body':_0xe9841a,'log':_0x9737('0x3')});};exports[_0x9737('0x4')]=function(_0x35a660,_0x243e62){return client['Request'](_0x9737('0x5'),{'body':_0x243e62,'options':{'where':{'uniqueid':_0x35a660},'order':[['id',_0x9737('0x6')]],'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 9f33ae8..54d0fb7 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 _0x46fd=['Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0xaf114d,_0x2bf02f){var _0x3fa697=function(_0x477e9a){while(--_0x477e9a){_0xaf114d['push'](_0xaf114d['shift']());}};_0x3fa697(++_0x2bf02f);}(_0x46fd,0x191));var _0xd46f=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x46fd[_0x2070da];return _0x4f9fe1;};'use strict';var client=require(_0xd46f('0x0'));exports[_0xd46f('0x1')]=function(){return function(){return client[_0xd46f('0x2')](_0xd46f('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd46f('0x4')],'include':[{'model':'Interval','as':_0xd46f('0x5'),'attributes':['id',_0xd46f('0x4'),_0xd46f('0x6')]}]},'log':_0xd46f('0x1')});};}; \ No newline at end of file +var _0x4ad2=['GetInterval','name','Intervals','interval','../client','getIntervals'];(function(_0x4ac72c,_0x567883){var _0x26b32f=function(_0x883daf){while(--_0x883daf){_0x4ac72c['push'](_0x4ac72c['shift']());}};_0x26b32f(++_0x567883);}(_0x4ad2,0x16c));var _0x24ad=function(_0x53053e,_0x1b4ee2){_0x53053e=_0x53053e-0x0;var _0x46a4ec=_0x4ad2[_0x53053e];return _0x46a4ec;};'use strict';var client=require(_0x24ad('0x0'));exports[_0x24ad('0x1')]=function(){return function(){return client['Request'](_0x24ad('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x24ad('0x3')],'include':[{'model':'Interval','as':_0x24ad('0x4'),'attributes':['id',_0x24ad('0x3'),_0x24ad('0x5')]}]},'log':_0x24ad('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 0d441b2..3906a9a 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 _0x4cf8=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update'];(function(_0x549448,_0x1eb4f9){var _0x2fe710=function(_0xe9afc8){while(--_0xe9afc8){_0x549448['push'](_0x549448['shift']());}};_0x2fe710(++_0x1eb4f9);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x4cf8[_0x26b80e];return _0x84a8a8;};'use strict';var client=require(_0x84cf('0x0'));exports[_0x84cf('0x1')]=function(_0x287eb2,_0x2125ed){return client[_0x84cf('0x2')](_0x84cf('0x3'),{'body':_0x2125ed,'options':{'where':{'id':_0x287eb2}},'log':_0x84cf('0x4')});};exports[_0x84cf('0x5')]=function(_0x3bbbc3,_0x2d38c0){return client[_0x84cf('0x2')](_0x84cf('0x6'),{'body':_0x2d38c0,'options':{'where':{'id':_0x3bbbc3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x77e6=['addTags','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x24afd3,_0xcc36f0){var _0xffe96f=function(_0x4f9cb0){while(--_0x4f9cb0){_0x24afd3['push'](_0x24afd3['shift']());}};_0xffe96f(++_0xcc36f0);}(_0x77e6,0x1a6));var _0x677e=function(_0x49fbf2,_0x45cee1){_0x49fbf2=_0x49fbf2-0x0;var _0x499051=_0x77e6[_0x49fbf2];return _0x499051;};'use strict';var client=require(_0x677e('0x0'));exports[_0x677e('0x1')]=function(_0x3855c7,_0xa48f0c){return client[_0x677e('0x2')](_0x677e('0x3'),{'body':_0xa48f0c,'options':{'where':{'id':_0x3855c7}},'log':_0x677e('0x4')});};exports[_0x677e('0x5')]=function(_0x50231c,_0x2f0307){return client[_0x677e('0x2')]('AddTagsToMailInteraction',{'body':_0x2f0307,'options':{'where':{'id':_0x50231c}},'log':_0x677e('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 7ef754b..8ca186e 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 _0x3f13=['CreateMailMessage','../client','create','Request'];(function(_0x1ea5e2,_0x382cec){var _0x39380c=function(_0x27893b){while(--_0x27893b){_0x1ea5e2['push'](_0x1ea5e2['shift']());}};_0x39380c(++_0x382cec);}(_0x3f13,0xf5));var _0x33f1=function(_0x1744c4,_0x1256f5){_0x1744c4=_0x1744c4-0x0;var _0x57ccf3=_0x3f13[_0x1744c4];return _0x57ccf3;};'use strict';var client=require(_0x33f1('0x0'));exports[_0x33f1('0x1')]=function(_0x37bfef){return client[_0x33f1('0x2')](_0x33f1('0x3'),{'body':_0x37bfef,'log':'createMailMessage'});}; \ No newline at end of file +var _0x444d=['create','Request','createMailMessage'];(function(_0x25a33f,_0x47e52f){var _0x1487cc=function(_0x81f888){while(--_0x81f888){_0x25a33f['push'](_0x25a33f['shift']());}};_0x1487cc(++_0x47e52f);}(_0x444d,0xc3));var _0xd444=function(_0x2e9280,_0x44d032){_0x2e9280=_0x2e9280-0x0;var _0x17f9e5=_0x444d[_0x2e9280];return _0x17f9e5;};'use strict';var client=require('../client');exports[_0xd444('0x0')]=function(_0x1dcfbe){return client[_0xd444('0x1')]('CreateMailMessage',{'body':_0x1dcfbe,'log':_0xd444('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f3cd9a0..46bab2b 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 _0x1046=['online','mailPause','getMailQueues','Request','name','User','Agents'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x1046,0x8e));var _0x6104=function(_0x40315b,_0x4d306){_0x40315b=_0x40315b-0x0;var _0x1ce697=_0x1046[_0x40315b];return _0x1ce697;};'use strict';var client=require('../client');exports[_0x6104('0x0')]=function(){return function(){return client[_0x6104('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x6104('0x2'),'timeout','strategy'],'include':[{'model':_0x6104('0x3'),'as':_0x6104('0x4'),'attributes':['id','name',_0x6104('0x5'),_0x6104('0x6')]}]},'log':_0x6104('0x0')});};}; \ No newline at end of file +var _0x580b=['online','mailPause','../client','Request','name','timeout','User'];(function(_0x4b7700,_0xcd5128){var _0x3a5fa8=function(_0x69fff9){while(--_0x69fff9){_0x4b7700['push'](_0x4b7700['shift']());}};_0x3a5fa8(++_0xcd5128);}(_0x580b,0xf0));var _0xb580=function(_0x198c43,_0x24a259){_0x198c43=_0x198c43-0x0;var _0x57ad65=_0x580b[_0x198c43];return _0x57ad65;};'use strict';var client=require(_0xb580('0x0'));exports['getMailQueues']=function(){return function(){return client[_0xb580('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xb580('0x2'),_0xb580('0x3'),'strategy'],'include':[{'model':_0xb580('0x4'),'as':'Agents','attributes':['id',_0xb580('0x2'),_0xb580('0x5'),_0xb580('0x6')]}]},'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 5015987..4d8edbb 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 _0xe278=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x10aedc,_0x2d6197){var _0x1fafc0=function(_0x152c75){while(--_0x152c75){_0x10aedc['push'](_0x10aedc['shift']());}};_0x1fafc0(++_0x2d6197);}(_0xe278,0x12c));var _0x8e27=function(_0x142346,_0x16da28){_0x142346=_0x142346-0x0;var _0x560766=_0xe278[_0x142346];return _0x560766;};'use strict';var client=require(_0x8e27('0x0'));exports[_0x8e27('0x1')]=function(_0x1224ab){return client[_0x8e27('0x2')](_0x8e27('0x3'),{'body':_0x1224ab,'log':_0x8e27('0x3')});};exports[_0x8e27('0x4')]=function(_0x3d67eb,_0x5509dc){return client[_0x8e27('0x2')](_0x8e27('0x5'),{'body':_0x5509dc,'options':{'where':{'uniqueid':_0x3d67eb},'order':[['id',_0x8e27('0x6')]],'limit':0x1},'log':_0x8e27('0x5')});}; \ No newline at end of file +var _0x3ebb=['../client','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ebb,0x150));var _0xb3eb=function(_0x4bf2fd,_0x17917e){_0x4bf2fd=_0x4bf2fd-0x0;var _0x168836=_0x3ebb[_0x4bf2fd];return _0x168836;};'use strict';var client=require(_0xb3eb('0x0'));exports['create']=function(_0x3b8eb8){return client[_0xb3eb('0x1')](_0xb3eb('0x2'),{'body':_0x3b8eb8,'log':_0xb3eb('0x2')});};exports[_0xb3eb('0x3')]=function(_0xc18383,_0x29df4d){return client[_0xb3eb('0x1')](_0xb3eb('0x4'),{'body':_0x29df4d,'options':{'where':{'uniqueid':_0xc18383},'order':[['id',_0xb3eb('0x5')]],'limit':0x1},'log':_0xb3eb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 91b20c3..0783d3e 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 _0xd5e1=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x2ca69a,_0x50341f){var _0x4a2a2c=function(_0x252489){while(--_0x252489){_0x2ca69a['push'](_0x2ca69a['shift']());}};_0x4a2a2c(++_0x50341f);}(_0xd5e1,0x1a7));var _0x1d5e=function(_0x358111,_0x59e472){_0x358111=_0x358111-0x0;var _0x38ca1e=_0xd5e1[_0x358111];return _0x38ca1e;};'use strict';var client=require(_0x1d5e('0x0'));exports['update']=function(_0xa76505,_0x451920){return client[_0x1d5e('0x1')](_0x1d5e('0x2'),{'body':_0x451920,'options':{'where':{'id':_0xa76505}},'log':_0x1d5e('0x3')});};exports['addTags']=function(_0x13e0c1,_0x11e7b3){return client['Request'](_0x1d5e('0x4'),{'body':_0x11e7b3,'options':{'where':{'id':_0x13e0c1}},'log':_0x1d5e('0x5')});}; \ No newline at end of file +var _0x1657=['AddTagsToOpenchannelInteraction','../client','update','Request','UpdateOpenchannelInteraction','addTags'];(function(_0x21b514,_0x357214){var _0x1e38b0=function(_0x106f62){while(--_0x106f62){_0x21b514['push'](_0x21b514['shift']());}};_0x1e38b0(++_0x357214);}(_0x1657,0x1ed));var _0x7165=function(_0x4ab2da,_0x1c01a7){_0x4ab2da=_0x4ab2da-0x0;var _0x70f4d=_0x1657[_0x4ab2da];return _0x70f4d;};'use strict';var client=require(_0x7165('0x0'));exports[_0x7165('0x1')]=function(_0x5a669e,_0xcd9193){return client[_0x7165('0x2')](_0x7165('0x3'),{'body':_0xcd9193,'options':{'where':{'id':_0x5a669e}},'log':'updateOpenchannelInteraction'});};exports[_0x7165('0x4')]=function(_0x1e3606,_0x3ae2b7){return client[_0x7165('0x2')](_0x7165('0x5'),{'body':_0x3ae2b7,'options':{'where':{'id':_0x1e3606}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index c31d414..fc54150 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 _0xf93e=['CreateOpenchannelMessage','../client','Request'];(function(_0xc1cd01,_0x587986){var _0x29562c=function(_0x1a9caf){while(--_0x1a9caf){_0xc1cd01['push'](_0xc1cd01['shift']());}};_0x29562c(++_0x587986);}(_0xf93e,0x19f));var _0xef93=function(_0x21f884,_0x2b21f0){_0x21f884=_0x21f884-0x0;var _0x155de2=_0xf93e[_0x21f884];return _0x155de2;};'use strict';var client=require(_0xef93('0x0'));exports['create']=function(_0x4b26d0){return client[_0xef93('0x1')](_0xef93('0x2'),{'body':_0x4b26d0,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x95ba=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x12ee67,_0x19647d){var _0x212f91=function(_0x3a27c5){while(--_0x3a27c5){_0x12ee67['push'](_0x12ee67['shift']());}};_0x212f91(++_0x19647d);}(_0x95ba,0x168));var _0xa95b=function(_0x37cfb5,_0x1563fc){_0x37cfb5=_0x37cfb5-0x0;var _0x4d60e3=_0x95ba[_0x37cfb5];return _0x4d60e3;};'use strict';var client=require(_0xa95b('0x0'));exports[_0xa95b('0x1')]=function(_0x88c1d6){return client[_0xa95b('0x2')](_0xa95b('0x3'),{'body':_0x88c1d6,'log':_0xa95b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 0f8c0b5..b6736c4 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 _0xb530=['../client','getOpenchannelQueues','Request','name','timeout','User'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xb530,0x180));var _0x0b53=function(_0x547e11,_0x2db914){_0x547e11=_0x547e11-0x0;var _0x1056df=_0xb530[_0x547e11];return _0x1056df;};'use strict';var client=require(_0x0b53('0x0'));exports[_0x0b53('0x1')]=function(){return function(){return client[_0x0b53('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x0b53('0x3'),_0x0b53('0x4'),'strategy'],'include':[{'model':_0x0b53('0x5'),'as':'Agents','attributes':['id',_0x0b53('0x3'),'online','openchannelPause']}]},'log':_0x0b53('0x1')});};}; \ No newline at end of file +var _0x1a20=['strategy','User','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x222688,_0x46c5eb){var _0x437433=function(_0x29958c){while(--_0x29958c){_0x222688['push'](_0x222688['shift']());}};_0x437433(++_0x46c5eb);}(_0x1a20,0x14b));var _0x01a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1a20[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0x01a2('0x0')]=function(){return function(){return client[_0x01a2('0x1')](_0x01a2('0x2'),{'options':{'raw':![],'attributes':['id',_0x01a2('0x3'),_0x01a2('0x4'),_0x01a2('0x5')],'include':[{'model':_0x01a2('0x6'),'as':'Agents','attributes':['id','name','online',_0x01a2('0x7')]}]},'log':_0x01a2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index e19a951..9290349 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 _0xc1a9=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x1d7f1e,_0x323421){var _0x31e0f6=function(_0x2f1638){while(--_0x2f1638){_0x1d7f1e['push'](_0x1d7f1e['shift']());}};_0x31e0f6(++_0x323421);}(_0xc1a9,0x16f));var _0x9c1a=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0xc1a9[_0x3227c1];return _0x31fd48;};'use strict';var client=require(_0x9c1a('0x0'));exports[_0x9c1a('0x1')]=function(_0x531b71){return client[_0x9c1a('0x2')](_0x9c1a('0x3'),{'body':_0x531b71,'log':'CreateOpenchannelQueueReport'});};exports[_0x9c1a('0x4')]=function(_0x22e744,_0x1707d5){return client[_0x9c1a('0x2')](_0x9c1a('0x5'),{'body':_0x1707d5,'options':{'where':{'uniqueid':_0x22e744},'order':[['id',_0x9c1a('0x6')]],'limit':0x1},'log':_0x9c1a('0x5')});}; \ No newline at end of file +var _0xc302=['update','UpdateOpenchannelQueueReport','../client','Request','CreateOpenchannelQueueReport'];(function(_0x14ba26,_0x34176b){var _0x588bb3=function(_0x202cce){while(--_0x202cce){_0x14ba26['push'](_0x14ba26['shift']());}};_0x588bb3(++_0x34176b);}(_0xc302,0x17e));var _0x2c30=function(_0x4a1fc1,_0x3ebee0){_0x4a1fc1=_0x4a1fc1-0x0;var _0x3b35de=_0xc302[_0x4a1fc1];return _0x3b35de;};'use strict';var client=require(_0x2c30('0x0'));exports['create']=function(_0x524403){return client[_0x2c30('0x1')]('CreateOpenchannelQueueReport',{'body':_0x524403,'log':_0x2c30('0x2')});};exports[_0x2c30('0x3')]=function(_0x3ec7b4,_0x1f5df7){return client['Request'](_0x2c30('0x4'),{'body':_0x1f5df7,'options':{'where':{'uniqueid':_0x3ec7b4},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 03dc9b7..1fb99df 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 _0x639d=['addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','addTags'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x639d,0xbb));var _0xd639=function(_0x3733dd,_0x1dddb3){_0x3733dd=_0x3733dd-0x0;var _0x6dfc82=_0x639d[_0x3733dd];return _0x6dfc82;};'use strict';var client=require(_0xd639('0x0'));exports[_0xd639('0x1')]=function(_0xd1f88b,_0x4987ad){return client[_0xd639('0x2')](_0xd639('0x3'),{'body':_0x4987ad,'options':{'where':{'id':_0xd1f88b}},'log':'updateSmsInteraction'});};exports[_0xd639('0x4')]=function(_0x588a30,_0x19b990){return client['Request']('AddTagsToSmsInteraction',{'body':_0x19b990,'options':{'where':{'id':_0x588a30}},'log':_0xd639('0x5')});}; \ No newline at end of file +var _0xdb94=['addTagsToSmsInteraction','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x464925,_0x1746ef){var _0x13530b=function(_0x153a07){while(--_0x153a07){_0x464925['push'](_0x464925['shift']());}};_0x13530b(++_0x1746ef);}(_0xdb94,0xe5));var _0x4db9=function(_0x43d01a,_0x6bb8b8){_0x43d01a=_0x43d01a-0x0;var _0x8476bc=_0xdb94[_0x43d01a];return _0x8476bc;};'use strict';var client=require('../client');exports[_0x4db9('0x0')]=function(_0x1aa3d0,_0x5edca0){return client[_0x4db9('0x1')](_0x4db9('0x2'),{'body':_0x5edca0,'options':{'where':{'id':_0x1aa3d0}},'log':_0x4db9('0x3')});};exports[_0x4db9('0x4')]=function(_0x1f05d4,_0x592097){return client[_0x4db9('0x1')]('AddTagsToSmsInteraction',{'body':_0x592097,'options':{'where':{'id':_0x1f05d4}},'log':_0x4db9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 6a0545b..03a2dc8 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 _0xd4be=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd4be,0x1ad));var _0xed4b=function(_0x233b38,_0x17088f){_0x233b38=_0x233b38-0x0;var _0x14a31c=_0xd4be[_0x233b38];return _0x14a31c;};'use strict';var client=require(_0xed4b('0x0'));exports['create']=function(_0x37b902){return client[_0xed4b('0x1')](_0xed4b('0x2'),{'body':_0x37b902,'log':_0xed4b('0x3')});}; \ No newline at end of file +var _0xcf60=['CreateSmsMessage','create'];(function(_0x3048ea,_0x3838c2){var _0x1a13c4=function(_0x2c6a6b){while(--_0x2c6a6b){_0x3048ea['push'](_0x3048ea['shift']());}};_0x1a13c4(++_0x3838c2);}(_0xcf60,0x135));var _0x0cf6=function(_0x26e051,_0x403ee1){_0x26e051=_0x26e051-0x0;var _0x4501f7=_0xcf60[_0x26e051];return _0x4501f7;};'use strict';var client=require('../client');exports[_0x0cf6('0x0')]=function(_0xe59b12){return client['Request'](_0x0cf6('0x1'),{'body':_0xe59b12,'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 cb37598..982650c 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 _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x570255,_0x51094d){var _0x385959=function(_0x2dddf4){while(--_0x2dddf4){_0x570255['push'](_0x570255['shift']());}};_0x385959(++_0x51094d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb7e7[_0x173441];return _0x2423a8;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x24fc38,_0x2bfe8b){var _0x11be02=function(_0x4a285c){while(--_0x4a285c){_0x24fc38['push'](_0x24fc38['shift']());}};_0x11be02(++_0x2bfe8b);}(_0xe706,0xa3));var _0x6e70=function(_0x5cf1a1,_0x1ab924){_0x5cf1a1=_0x5cf1a1-0x0;var _0x52cbcc=_0xe706[_0x5cf1a1];return _0x52cbcc;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e5ba49f..0c7454d 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 _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x34e979,_0x51ce51){var _0x162659=function(_0x3d4b41){while(--_0x3d4b41){_0x34e979['push'](_0x34e979['shift']());}};_0x162659(++_0x51ce51);}(_0x3e74,0x175));var _0x43e7=function(_0x200a9b,_0x1777b9){_0x200a9b=_0x200a9b-0x0;var _0x5c3bdf=_0x3e74[_0x200a9b];return _0x5c3bdf;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x614c88,_0x184f02){var _0x1a768e=function(_0x4f204f){while(--_0x4f204f){_0x614c88['push'](_0x614c88['shift']());}};_0x1a768e(++_0x184f02);}(_0x008c,0x188));var _0xc008=function(_0x4ef77b,_0x6a3df){_0x4ef77b=_0x4ef77b-0x0;var _0x58d1a6=_0x008c[_0x4ef77b];return _0x58d1a6;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 14b2549..feac4ff 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(_0x5baa48,_0x46608b){var _0x2f757c=function(_0x4be03f){while(--_0x4be03f){_0x5baa48['push'](_0x5baa48['shift']());}};_0x2f757c(++_0x46608b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x44f519,_0x293a72){var _0x1aa4af=function(_0x588a4f){while(--_0x588a4f){_0x44f519['push'](_0x44f519['shift']());}};_0x1aa4af(++_0x293a72);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 369c19c..81daf6f 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 _0x0a6b=['updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','Request'];(function(_0xa324e4,_0x36a919){var _0x1c60dd=function(_0x5347be){while(--_0x5347be){_0xa324e4['push'](_0xa324e4['shift']());}};_0x1c60dd(++_0x36a919);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x511dd6,_0x5d294d){_0x511dd6=_0x511dd6-0x0;var _0x39f16b=_0x0a6b[_0x511dd6];return _0x39f16b;};'use strict';var client=require(_0xb0a6('0x0'));exports['update']=function(_0x5d7cd9,_0x50b658){return client[_0xb0a6('0x1')]('UpdateWhatsappInteraction',{'body':_0x50b658,'options':{'where':{'id':_0x5d7cd9}},'log':_0xb0a6('0x2')});};exports[_0xb0a6('0x3')]=function(_0x1d3b78,_0x544a64){return client[_0xb0a6('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x544a64,'options':{'where':{'id':_0x1d3b78}},'log':_0xb0a6('0x4')});}; \ No newline at end of file +var _0xf52f=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x208074,_0xe33905){var _0x329b06=function(_0x2b7d19){while(--_0x2b7d19){_0x208074['push'](_0x208074['shift']());}};_0x329b06(++_0xe33905);}(_0xf52f,0x113));var _0xff52=function(_0x241929,_0x1700d5){_0x241929=_0x241929-0x0;var _0x3f6ad9=_0xf52f[_0x241929];return _0x3f6ad9;};'use strict';var client=require(_0xff52('0x0'));exports[_0xff52('0x1')]=function(_0x3276ff,_0x4ff45d){return client[_0xff52('0x2')](_0xff52('0x3'),{'body':_0x4ff45d,'options':{'where':{'id':_0x3276ff}},'log':_0xff52('0x4')});};exports['addTags']=function(_0x23d018,_0x35337d){return client['Request'](_0xff52('0x5'),{'body':_0x35337d,'options':{'where':{'id':_0x23d018}},'log':_0xff52('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 7d13d1e..0dd16aa 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 _0xf1b0=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x2592ea,_0x935ff){var _0x3ba4ab=function(_0x4bfe72){while(--_0x4bfe72){_0x2592ea['push'](_0x2592ea['shift']());}};_0x3ba4ab(++_0x935ff);}(_0xf1b0,0xf3));var _0x0f1b=function(_0x130d82,_0x25f49b){_0x130d82=_0x130d82-0x0;var _0x112070=_0xf1b0[_0x130d82];return _0x112070;};'use strict';var client=require(_0x0f1b('0x0'));exports[_0x0f1b('0x1')]=function(_0x3604ec){return client[_0x0f1b('0x2')](_0x0f1b('0x3'),{'body':_0x3604ec,'log':_0x0f1b('0x4')});}; \ No newline at end of file +var _0x95c9=['../client','create','Request'];(function(_0x2f4500,_0x62861d){var _0x47812c=function(_0x5546ac){while(--_0x5546ac){_0x2f4500['push'](_0x2f4500['shift']());}};_0x47812c(++_0x62861d);}(_0x95c9,0xa2));var _0x995c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x95c9[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x995c('0x0'));exports[_0x995c('0x1')]=function(_0x27eecd){return client[_0x995c('0x2')]('CreateWhatsappMessage',{'body':_0x27eecd,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 7256b35..5d742c2 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 _0x20fc=['strategy','Agents','name','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x3880a9,_0xff5b2c){var _0x23f9d7=function(_0x244d2e){while(--_0x244d2e){_0x3880a9['push'](_0x3880a9['shift']());}};_0x23f9d7(++_0xff5b2c);}(_0x20fc,0xcb));var _0xc20f=function(_0x1d211b,_0x475f3b){_0x1d211b=_0x1d211b-0x0;var _0x47c88b=_0x20fc[_0x1d211b];return _0x47c88b;};'use strict';var client=require(_0xc20f('0x0'));exports[_0xc20f('0x1')]=function(){return function(){return client[_0xc20f('0x2')](_0xc20f('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xc20f('0x4')],'include':[{'model':'User','as':_0xc20f('0x5'),'attributes':['id',_0xc20f('0x6'),_0xc20f('0x7'),_0xc20f('0x8')]}]},'log':_0xc20f('0x1')});};}; \ No newline at end of file +var _0xfe20=['whatsappPause','getWhatsappQueues','Request','name','timeout','strategy','User','Agents','online'];(function(_0x2d15c4,_0x57eea5){var _0x24c893=function(_0x4189ad){while(--_0x4189ad){_0x2d15c4['push'](_0x2d15c4['shift']());}};_0x24c893(++_0x57eea5);}(_0xfe20,0x118));var _0x0fe2=function(_0x9c6c41,_0x2123fa){_0x9c6c41=_0x9c6c41-0x0;var _0x7a51ee=_0xfe20[_0x9c6c41];return _0x7a51ee;};'use strict';var client=require('../client');exports[_0x0fe2('0x0')]=function(){return function(){return client[_0x0fe2('0x1')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x0fe2('0x2'),_0x0fe2('0x3'),_0x0fe2('0x4')],'include':[{'model':_0x0fe2('0x5'),'as':_0x0fe2('0x6'),'attributes':['id',_0x0fe2('0x2'),_0x0fe2('0x7'),_0x0fe2('0x8')]}]},'log':_0x0fe2('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index b6db98f..22e0da6 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 _0x6bc4=['DESC','../client','create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport'];(function(_0x4a83a2,_0x1a05d1){var _0x55160e=function(_0x47b4c9){while(--_0x47b4c9){_0x4a83a2['push'](_0x4a83a2['shift']());}};_0x55160e(++_0x1a05d1);}(_0x6bc4,0x187));var _0x46bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc4[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x46bc('0x0'));exports[_0x46bc('0x1')]=function(_0x517b4b){return client[_0x46bc('0x2')]('CreateWhatsappQueueReport',{'body':_0x517b4b,'log':_0x46bc('0x3')});};exports['update']=function(_0x55dafa,_0x403c92){return client[_0x46bc('0x2')](_0x46bc('0x4'),{'body':_0x403c92,'options':{'where':{'uniqueid':_0x55dafa},'order':[['id',_0x46bc('0x5')]],'limit':0x1},'log':_0x46bc('0x4')});}; \ No newline at end of file +var _0xcb8b=['CreateWhatsappQueueReport','update','Request','UpdateWhatsappQueueReport','../client','create'];(function(_0x27f11f,_0x2256c8){var _0x3baf31=function(_0x7226e){while(--_0x7226e){_0x27f11f['push'](_0x27f11f['shift']());}};_0x3baf31(++_0x2256c8);}(_0xcb8b,0x130));var _0xbcb8=function(_0x133748,_0x3da5a4){_0x133748=_0x133748-0x0;var _0x29c1e7=_0xcb8b[_0x133748];return _0x29c1e7;};'use strict';var client=require(_0xbcb8('0x0'));exports[_0xbcb8('0x1')]=function(_0x35ae10){return client['Request'](_0xbcb8('0x2'),{'body':_0x35ae10,'log':_0xbcb8('0x2')});};exports[_0xbcb8('0x3')]=function(_0x16028f,_0x3cf813){return client[_0xbcb8('0x4')]('UpdateWhatsappQueueReport',{'body':_0x3cf813,'options':{'where':{'uniqueid':_0x16028f},'order':[['id','DESC']],'limit':0x1},'log':_0xbcb8('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 6f2fce9..5daa601 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 _0x001d=['consequence','validate','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase'];(function(_0x5b11c3,_0x5a54ca){var _0x216765=function(_0x498f51){while(--_0x498f51){_0x5b11c3['push'](_0x5b11c3['shift']());}};_0x216765(++_0x5a54ca);}(_0x001d,0x1c7));var _0xd001=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x001d[_0x5806c3];return _0x48ac77;};'use strict';var schema=require('validate');var _=require(_0xd001('0x0'));var util=require(_0xd001('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xd001('0x2'))(_0xd001('0x3'));var strategy=require(_0xd001('0x4'));var queue=schema({'name':{'type':_0xd001('0x5'),'required':!![],'message':_0xd001('0x6')},'timeout':{'type':_0xd001('0x7'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0xfe5959,_0x8d440f,_0x565e25){return logger[_0xd001('0x8')](util[_0xd001('0x9')](_0xd001('0xa'),_0xfe5959,_0x8d440f[_0xd001('0xb')],_0x565e25));}function handleFindAgent(_0x3bfcbe){return function(_0x80ce88){return _0x80ce88[_0xd001('0xb')][_0xd001('0xc')]()===_0x3bfcbe[_0xd001('0xc')]();};}exports[_0xd001('0xd')]=function(_0x58adb6,_0x27360d,_0x1f33a9,_0x344ec6){return function(_0x26a91d){try{var _0x538561={'name':_0x27360d[0x0],'timeout':_0x27360d[0x1]};var _0x412f25=queue[_0xd001('0xe')](_0x538561,{'typecast':!![]});if(_0x412f25['length']){logger['error'](_0xd001('0xf'),_0x58adb6,_[_0xd001('0x10')](_0x412f25,_0xd001('0x11'))[_0xd001('0x12')](',\x20'));_0x26a91d[_0xd001('0x13')]();}else{var _0x5af0e7=_[_0xd001('0x14')](_0x1f33a9[_0xd001('0x15')],handleFindAgent(_0x538561[_0xd001('0xb')]));if(_0x5af0e7){var _0x1eb3c8=(_0x538561['timeout']||0xa)*0x3e8;var _0x2bdf65,_0x3b1395;var _0x160433=seqqueue['createQueue'](_0x1eb3c8);_0x160433['id']=_0x58adb6;_0x160433[_0xd001('0x16')]=_0x1eb3c8;_0x160433[_0xd001('0x17')]=_0x344ec6[_0xd001('0x17')];writeLog(_0x58adb6,_0x5af0e7,util[_0xd001('0x9')]('START:%s',_0x1eb3c8));_0x1f33a9['rules'][_0x58adb6]['on'](_0xd001('0x18'),function(){logger[_0xd001('0x8')](_0xd001('0x19'),_0x58adb6);clearTimeout(_0x3b1395);_0x3b1395=undefined;_0x160433['close']();if(_0x1f33a9[_0xd001('0x1a')][_0x58adb6]){delete _0x1f33a9[_0xd001('0x1a')][_0x58adb6];}_0x26a91d[_0xd001('0x13')]();});_0x1f33a9[_0xd001('0x1a')][_0x58adb6]['on'](_0xd001('0x1b'),function(){if(_0x1f33a9[_0xd001('0x1a')][_0x58adb6]){delete _0x1f33a9[_0xd001('0x1a')][_0x58adb6];}});_0x3b1395=setTimeout(function(){logger['info'](_0xd001('0x1c'),_0x58adb6);clearTimeout(_0x3b1395);_0x160433[_0xd001('0x1d')]();_0x26a91d['next']();},_0x1eb3c8);strategy[_0xd001('0x1e')](_0x160433,_0x5af0e7,_0x1f33a9,_0x344ec6);}else{logger[_0xd001('0x1f')](_0xd001('0x20'),_0x58adb6,_0x538561['name']);_0x26a91d[_0xd001('0x13')]();}}}catch(_0x15551e){console[_0xd001('0x21')](_0x15551e);logger[_0xd001('0x1f')](_0xd001('0x22'),_0x58adb6,_0x15551e[_0xd001('0x23')]);_0x26a91d[_0xd001('0x13')]();}};}; \ No newline at end of file +var _0x52c7=['routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','timeout','createQueue','atimeout','channel','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x52c7,0x137));var _0x752c=function(_0x486008,_0x2b2d05){_0x486008=_0x486008-0x0;var _0x2fefc7=_0x52c7[_0x486008];return _0x2fefc7;};'use strict';var schema=require(_0x752c('0x0'));var _=require(_0x752c('0x1'));var util=require(_0x752c('0x2'));var seqqueue=require(_0x752c('0x3'));var logger=require('../../../../config/logger')(_0x752c('0x4'));var strategy=require(_0x752c('0x5'));var queue=schema({'name':{'type':_0x752c('0x6'),'required':!![],'message':_0x752c('0x7')},'timeout':{'type':_0x752c('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x1576bb,_0x521259,_0x4083e1){return logger[_0x752c('0x9')](util[_0x752c('0xa')](_0x752c('0xb'),_0x1576bb,_0x521259[_0x752c('0xc')],_0x4083e1));}function handleFindAgent(_0x43d614){return function(_0x138cf6){return _0x138cf6[_0x752c('0xc')][_0x752c('0xd')]()===_0x43d614[_0x752c('0xd')]();};}exports[_0x752c('0xe')]=function(_0xc99e5,_0x5418ee,_0x27e362,_0x5181de){return function(_0x1dd3d4){try{var _0x9028bf={'name':_0x5418ee[0x0],'timeout':_0x5418ee[0x1]};var _0x2b9a97=queue['validate'](_0x9028bf,{'typecast':!![]});if(_0x2b9a97[_0x752c('0xf')]){logger[_0x752c('0x10')](_0x752c('0x11'),_0xc99e5,_[_0x752c('0x12')](_0x2b9a97,_0x752c('0x13'))[_0x752c('0x14')](',\x20'));_0x1dd3d4[_0x752c('0x15')]();}else{var _0x1565df=_[_0x752c('0x16')](_0x27e362['agents'],handleFindAgent(_0x9028bf['name']));if(_0x1565df){var _0x3796b2=(_0x9028bf[_0x752c('0x17')]||0xa)*0x3e8;var _0x1d1f3b,_0x7a1a99;var _0x53c5ef=seqqueue[_0x752c('0x18')](_0x3796b2);_0x53c5ef['id']=_0xc99e5;_0x53c5ef[_0x752c('0x19')]=_0x3796b2;_0x53c5ef[_0x752c('0x1a')]=_0x5181de[_0x752c('0x1a')];writeLog(_0xc99e5,_0x1565df,util[_0x752c('0xa')]('START:%s',_0x3796b2));_0x27e362['rules'][_0xc99e5]['on'](_0x752c('0x1b'),function(){logger[_0x752c('0x9')](_0x752c('0x1c'),_0xc99e5);clearTimeout(_0x7a1a99);_0x7a1a99=undefined;_0x53c5ef[_0x752c('0x1d')]();if(_0x27e362[_0x752c('0x1e')][_0xc99e5]){delete _0x27e362[_0x752c('0x1e')][_0xc99e5];}_0x1dd3d4[_0x752c('0x15')]();});_0x27e362[_0x752c('0x1e')][_0xc99e5]['on']('complete',function(){if(_0x27e362['rules'][_0xc99e5]){delete _0x27e362[_0x752c('0x1e')][_0xc99e5];}});_0x7a1a99=setTimeout(function(){logger[_0x752c('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0xc99e5);clearTimeout(_0x7a1a99);_0x53c5ef[_0x752c('0x1d')]();_0x1dd3d4[_0x752c('0x1f')]();},_0x3796b2);strategy['agent'](_0x53c5ef,_0x1565df,_0x27e362,_0x5181de);}else{logger[_0x752c('0x10')](_0x752c('0x20'),_0xc99e5,_0x9028bf[_0x752c('0xc')]);_0x1dd3d4['stop']();}}}catch(_0x293c75){console['log'](_0x293c75);logger[_0x752c('0x10')](_0x752c('0x21'),_0xc99e5,_0x293c75[_0x752c('0x22')]);_0x1dd3d4['stop']();}};}; \ 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 d195ad3..7b99d2b 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 _0xa512=['routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','info','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','create','dialogState','Failed','next','catch','lodash','aws-sdk','./utils','../../../../config/logger'];(function(_0x140efd,_0x297310){var _0x5307f4=function(_0x5b56f8){while(--_0x5b56f8){_0x140efd['push'](_0x140efd['shift']());}};_0x5307f4(++_0x297310);}(_0xa512,0x1e6));var _0x2a51=function(_0x30dfa4,_0x1a6275){_0x30dfa4=_0x30dfa4-0x0;var _0x185b37=_0xa512[_0x30dfa4];return _0x185b37;};'use strict';var _=require(_0x2a51('0x0'));var moment=require('moment');var AWS=require(_0x2a51('0x1'));var utils=require(_0x2a51('0x2'));var logger=require(_0x2a51('0x3'))(_0x2a51('0x4'));var rpc={'chatMessage':require(_0x2a51('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2a51('0x6')),'faxMessage':require(_0x2a51('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x129717,_0x385553){return function(_0x3cc674){try{if(!_[_0x2a51('0x8')](this[_0x2a51('0x9')]['UserId'])){logger[_0x2a51('0xa')]('[%s][AMAZONLEX]\x20%s',_0x129717,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3cc674['next']();}var _0x3dae84={'ContactId':this[_0x2a51('0xb')]['id'],'sentAt':moment()['format'](_0x2a51('0xc')),'direction':_0x2a51('0xd')};if(this['channel']===_0x2a51('0xe')||this['channel']===_0x2a51('0xf')){_0x3dae84['phone']=this['interaction'][_0x2a51('0x10')];}var _0x4b732c=this[_0x2a51('0x11')];if(_0x4b732c===_0x2a51('0x12')){_0x3dae84[_0x2a51('0x13')]=this[_0x2a51('0x14')]['id'];}else{_0x3dae84[_[_0x2a51('0x15')](_0x4b732c)+'AccountId']=this[_0x2a51('0x14')]['id'];}_0x3dae84[_[_0x2a51('0x15')](_0x4b732c)+_0x2a51('0x16')]=this[_0x2a51('0x9')]['id'];if(this[_0x2a51('0x9')][_0x2a51('0x17')]){var _0x454367=_0x385553[0x4];if(!_[_0x2a51('0x18')](_0x454367)){_0x3dae84[_0x2a51('0x19')]=utils[_0x2a51('0x1a')](_0x454367,this);return rpc[_0x4b732c+_0x2a51('0x1b')]['create'](_0x3dae84)[_0x2a51('0x1c')](function(_0x58695a){logger[_0x2a51('0xa')]('[%s][AMAZONLEX]\x20%s',_0x129717,_0x3dae84[_0x2a51('0x19')]);})['catch'](function(_0x205215){logger[_0x2a51('0x1d')](_0x2a51('0x1e'),_0x129717,JSON[_0x2a51('0x1f')](_0x205215));})[_0x2a51('0x20')](function(){logger[_0x2a51('0xa')](_0x2a51('0x21'),_0x129717);_0x3cc674[_0x2a51('0x22')]();});}else{logger[_0x2a51('0xa')](_0x2a51('0x23'),_0x129717);_0x3cc674[_0x2a51('0x22')]();}}else{var _0x19b60a=this;var _0x12d8dd=new AWS[(_0x2a51('0x24'))]({'accessKeyId':_0x385553[0x0],'secretAccessKey':_0x385553[0x1],'region':_0x385553[0x2]});var _0x450c0f={'botAlias':_0x2a51('0x25'),'botName':_0x385553[0x3],'inputText':this[_0x2a51('0x26')][_0x2a51('0x19')],'userId':this[_0x2a51('0x11')]+':'+this[_0x2a51('0x9')]['id'][_0x2a51('0x27')]()};_0x12d8dd[_0x2a51('0x28')](_0x450c0f,function(_0x1c42ca,_0x4cb039){if(_0x1c42ca){logger['error'](_0x2a51('0x1e'),_0x129717,_0x1c42ca[_0x2a51('0x26')]);_0x3cc674['next']();}else if(_0x4cb039&&_0x4cb039[_0x2a51('0x26')]){_0x19b60a[_0x2a51('0x19')][_0x2a51('0x29')]=_0x4cb039;_0x3dae84[_0x2a51('0x19')]=_0x4cb039['message'];_0x3dae84[_0x2a51('0x2a')]=_0x2a51('0x29');_0x3dae84[_0x2a51('0x2b')]=JSON[_0x2a51('0x1f')](_0x4cb039);return rpc[_0x4b732c+'Message'][_0x2a51('0x2c')](_0x3dae84)['then'](function(_0x4c4161){logger[_0x2a51('0xa')](_0x2a51('0x1e'),_0x129717,_0x3dae84[_0x2a51('0x19')]);if(_0x4cb039[_0x2a51('0x2d')]==_0x2a51('0x2e')){_0x3cc674[_0x2a51('0x2f')]();}else{_0x3cc674['stop']();}})[_0x2a51('0x30')](function(_0x51db96){logger['error']('[%s][AMAZONLEX]\x20%s',_0x129717,JSON[_0x2a51('0x1f')](_0x51db96));_0x3cc674[_0x2a51('0x2f')]();});}else{_0x3cc674['next']();}});}}catch(_0xddb83e){logger['error'](_0x2a51('0x1e'),_0x129717,JSON[_0x2a51('0x1f')](_0xddb83e));_0x3cc674[_0x2a51('0x22')]();}};}; \ No newline at end of file +var _0x6c33=['[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','created','isEmpty','body','getMustacheRender','Message','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','postText','message','amazonlex','providerResponse','create','dialogState','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','info'];(function(_0x16e57d,_0x2cb7ba){var _0x40239c=function(_0x3cc8f0){while(--_0x3cc8f0){_0x16e57d['push'](_0x16e57d['shift']());}};_0x40239c(++_0x2cb7ba);}(_0x6c33,0x19b));var _0x36c3=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x6c33[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var moment=require(_0x36c3('0x0'));var AWS=require(_0x36c3('0x1'));var utils=require(_0x36c3('0x2'));var logger=require('../../../../config/logger')(_0x36c3('0x3'));var rpc={'chatMessage':require(_0x36c3('0x4')),'openchannelMessage':require(_0x36c3('0x5')),'mailMessage':require(_0x36c3('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x36c3('0x7')),'whatsappMessage':require(_0x36c3('0x8'))};exports[_0x36c3('0x9')]=function(_0x57fbcb,_0xf6536d){return function(_0x490fec){try{if(!_[_0x36c3('0xa')](this['interaction']['UserId'])){logger[_0x36c3('0xb')](_0x36c3('0xc'),_0x57fbcb,_0x36c3('0xd'));return _0x490fec[_0x36c3('0xe')]();}var _0x4b7178={'ContactId':this[_0x36c3('0xf')]['id'],'sentAt':moment()[_0x36c3('0x10')](_0x36c3('0x11')),'direction':_0x36c3('0x12')};if(this[_0x36c3('0x13')]==='sms'||this[_0x36c3('0x13')]===_0x36c3('0x14')){_0x4b7178['phone']=this['interaction'][_0x36c3('0x15')];}var _0x320ee8=this[_0x36c3('0x13')];if(_0x320ee8===_0x36c3('0x16')){_0x4b7178[_0x36c3('0x17')]=this[_0x36c3('0x18')]['id'];}else{_0x4b7178[_['upperFirst'](_0x320ee8)+_0x36c3('0x19')]=this[_0x36c3('0x18')]['id'];}_0x4b7178[_[_0x36c3('0x1a')](_0x320ee8)+_0x36c3('0x1b')]=this['interaction']['id'];if(this[_0x36c3('0x1c')][_0x36c3('0x1d')]){var _0x12cfd8=_0xf6536d[0x4];if(!_[_0x36c3('0x1e')](_0x12cfd8)){_0x4b7178[_0x36c3('0x1f')]=utils[_0x36c3('0x20')](_0x12cfd8,this);return rpc[_0x320ee8+_0x36c3('0x21')]['create'](_0x4b7178)[_0x36c3('0x22')](function(_0x1ef30c){logger[_0x36c3('0xb')](_0x36c3('0xc'),_0x57fbcb,_0x4b7178[_0x36c3('0x1f')]);})[_0x36c3('0x23')](function(_0x57fd48){logger[_0x36c3('0x24')]('[%s][AMAZONLEX]\x20%s',_0x57fbcb,JSON[_0x36c3('0x25')](_0x57fd48));})['finally'](function(){logger[_0x36c3('0xb')](_0x36c3('0x26'),_0x57fbcb);_0x490fec[_0x36c3('0x27')]();});}else{logger[_0x36c3('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x57fbcb);_0x490fec[_0x36c3('0x27')]();}}else{var _0x18abc0=this;var _0x41c28d=new AWS[(_0x36c3('0x28'))]({'accessKeyId':_0xf6536d[0x0],'secretAccessKey':_0xf6536d[0x1],'region':_0xf6536d[0x2]});var _0x220787={'botAlias':'$LATEST','botName':_0xf6536d[0x3],'inputText':this['message']['body'],'userId':this[_0x36c3('0x13')]+':'+this[_0x36c3('0x1c')]['id']['toString']()};_0x41c28d[_0x36c3('0x29')](_0x220787,function(_0xfb9bc3,_0x26c3b0){if(_0xfb9bc3){logger[_0x36c3('0x24')](_0x36c3('0xc'),_0x57fbcb,_0xfb9bc3[_0x36c3('0x2a')]);_0x490fec[_0x36c3('0xe')]();}else if(_0x26c3b0&&_0x26c3b0[_0x36c3('0x2a')]){_0x18abc0['body'][_0x36c3('0x2b')]=_0x26c3b0;_0x4b7178[_0x36c3('0x1f')]=_0x26c3b0[_0x36c3('0x2a')];_0x4b7178['providerName']=_0x36c3('0x2b');_0x4b7178[_0x36c3('0x2c')]=JSON[_0x36c3('0x25')](_0x26c3b0);return rpc[_0x320ee8+_0x36c3('0x21')][_0x36c3('0x2d')](_0x4b7178)[_0x36c3('0x22')](function(_0x46f0cf){logger[_0x36c3('0xb')](_0x36c3('0xc'),_0x57fbcb,_0x4b7178['body']);if(_0x26c3b0[_0x36c3('0x2e')]=='Failed'){_0x490fec['next']();}else{_0x490fec['stop']();}})[_0x36c3('0x23')](function(_0x2c79c7){logger[_0x36c3('0x24')](_0x36c3('0xc'),_0x57fbcb,JSON[_0x36c3('0x25')](_0x2c79c7));_0x490fec[_0x36c3('0xe')]();});}else{_0x490fec[_0x36c3('0xe')]();}});}}catch(_0x303a93){logger[_0x36c3('0x24')](_0x36c3('0xc'),_0x57fbcb,JSON[_0x36c3('0x25')](_0x303a93));_0x490fec[_0x36c3('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 39d0cbc..542aa77 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 _0x3872=['update','stop','lodash','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','','auto-replied','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3872,0x11e));var _0x2387=function(_0x48398f,_0x5a697b){_0x48398f=_0x48398f-0x0;var _0x1d6f0a=_0x3872[_0x48398f];return _0x1d6f0a;};'use strict';var _=require(_0x2387('0x0'));var moment=require(_0x2387('0x1'));var utils=require(_0x2387('0x2'));var logger=require('../../../../config/logger')(_0x2387('0x3'));var rpc={'chatMessage':require(_0x2387('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2387('0x5')),'smsMessage':require(_0x2387('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x2387('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x2387('0x8')),'smsInteraction':require(_0x2387('0x9')),'faxInteraction':require(_0x2387('0xa')),'whatsappInteraction':require(_0x2387('0xb'))};var mailRpc=require(_0x2387('0xc'));exports[_0x2387('0xd')]=function(_0x31b849,_0x3e9e93,_0x45d60d,_0x4749ce){return function(_0x1fa2ab){try{var _0x450667=this[_0x2387('0xe')];if(_0x450667==='mail'&&_0x4749ce[_0x2387('0xf')]['isAutoreply']){logger[_0x2387('0x10')](_0x2387('0x11'),_0x31b849,_0x2387('0x12'));return _0x1fa2ab[_0x2387('0x13')]();}if(_0x3e9e93[0x0]==='1'&&(_[_0x2387('0x14')](this[_0x2387('0x15')][_0x2387('0x16')])||!this[_0x2387('0x15')][_0x2387('0x16')])){logger[_0x2387('0x10')](_0x2387('0x11'),_0x31b849,_0x2387('0x17'));return _0x1fa2ab['next']();}if(_0x3e9e93[0x0]==='2'&&this[_0x2387('0x15')][_0x2387('0x18')]){logger['info'](_0x2387('0x19'),_0x31b849,_0x2387('0x1a'));return _0x1fa2ab[_0x2387('0x13')]();}var _0x2bf892={'ContactId':this[_0x2387('0x1b')]['id'],'sentAt':moment()[_0x2387('0x1c')](_0x2387('0x1d')),'direction':_0x2387('0x1e')};if(this[_0x2387('0xe')]===_0x2387('0x1f')){_0x2bf892['body']=utils[_0x2387('0x20')](_0x3e9e93[0x2],this);}else{_0x2bf892[_0x2387('0xf')]=utils[_0x2387('0x20')](_0x3e9e93[0x1],this);}if(this[_0x2387('0x21')]){_0x2bf892['to']=this[_0x2387('0x21')][_0x2387('0x22')]||'';if(this[_0x2387('0xe')]==='mail'&&_0x3e9e93[0x1]==='1'){_0x2bf892['cc']=this['message']['cc']||'';}_0x2bf892[_0x2387('0x22')]=this['message']['to']||'';_0x2bf892[_0x2387('0x23')]=this[_0x2387('0x21')][_0x2387('0x23')]||'';_0x2bf892[_0x2387('0x24')]=!![];if(this[_0x2387('0x21')][_0x2387('0x25')]){_0x2bf892['subject']='';_0x2bf892['subject']+=_[_0x2387('0x26')](this['message']['subject'],_0x2387('0x27'))?'':_0x2387('0x28');_0x2bf892[_0x2387('0x25')]+=this['message'][_0x2387('0x25')];}}if(this[_0x2387('0xe')]===_0x2387('0x29')){_0x2bf892[_0x2387('0x2a')]=this[_0x2387('0x2b')]['id'];}else{_0x2bf892[_[_0x2387('0x2c')](this[_0x2387('0xe')])+_0x2387('0x2d')]=this[_0x2387('0x2b')]['id'];}_0x2bf892[_['upperFirst'](this['channel'])+_0x2387('0x2e')]=this[_0x2387('0x15')]['id'];var _0x4d1c0f=this['interaction'];if(rpc[this[_0x2387('0xe')]+_0x2387('0x2f')]){if(this[_0x2387('0xe')]===_0x2387('0x1f')){_0x2bf892[_0x2387('0x30')]=this[_0x2387('0x21')][_0x2387('0x31')];_0x2bf892[_0x2387('0x32')]=_0x2387('0x33')+_[_0x2387('0x34')](_0x2bf892[_0x2387('0xf')],'','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','Message','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact'];(function(_0x563e72,_0x14f677){var _0x1c89bf=function(_0x4d22b5){while(--_0x4d22b5){_0x563e72['push'](_0x563e72['shift']());}};_0x1c89bf(++_0x14f677);}(_0x62e8,0xe8));var _0x862e=function(_0x28cb45,_0x1f20fd){_0x28cb45=_0x28cb45-0x0;var _0x2e0fee=_0x62e8[_0x28cb45];return _0x2e0fee;};'use strict';var _=require('lodash');var moment=require(_0x862e('0x0'));var utils=require(_0x862e('0x1'));var logger=require('../../../../config/logger')(_0x862e('0x2'));var rpc={'chatMessage':require(_0x862e('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x862e('0x4')),'smsMessage':require(_0x862e('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x862e('0x6')),'chatInteraction':require(_0x862e('0x7')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x862e('0x8')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x862e('0x9')),'whatsappInteraction':require(_0x862e('0xa'))};var mailRpc=require('../../mailRpc');exports[_0x862e('0xb')]=function(_0x13bee7,_0x263422,_0x58a6c0,_0x5ba888){return function(_0x369a65){try{var _0xcab8b1=this[_0x862e('0xc')];if(_0xcab8b1===_0x862e('0xd')&&_0x5ba888[_0x862e('0xe')][_0x862e('0xf')]){logger[_0x862e('0x10')](_0x862e('0x11'),_0x13bee7,_0x862e('0x12'));return _0x369a65[_0x862e('0x13')]();}if(_0x263422[0x0]==='1'&&(_[_0x862e('0x14')](this['interaction']['created'])||!this[_0x862e('0x15')][_0x862e('0x16')])){logger[_0x862e('0x10')](_0x862e('0x11'),_0x13bee7,_0x862e('0x17'));return _0x369a65[_0x862e('0x13')]();}if(_0x263422[0x0]==='2'&&this[_0x862e('0x15')][_0x862e('0x18')]){logger[_0x862e('0x10')](_0x862e('0x19'),_0x13bee7,_0x862e('0x1a'));return _0x369a65[_0x862e('0x13')]();}var _0x35410e={'ContactId':this[_0x862e('0x1b')]['id'],'sentAt':moment()['format'](_0x862e('0x1c')),'direction':_0x862e('0x1d')};if(this[_0x862e('0xc')]===_0x862e('0xd')){_0x35410e[_0x862e('0xe')]=utils[_0x862e('0x1e')](_0x263422[0x2],this);}else{_0x35410e[_0x862e('0xe')]=utils['getMustacheRender'](_0x263422[0x1],this);}if(this[_0x862e('0x1f')]){_0x35410e['to']=this[_0x862e('0x1f')][_0x862e('0x20')]||'';if(this[_0x862e('0xc')]===_0x862e('0xd')&&_0x263422[0x1]==='1'){_0x35410e['cc']=this[_0x862e('0x1f')]['cc']||'';}_0x35410e[_0x862e('0x20')]=this['message']['to']||'';_0x35410e['phone']=this[_0x862e('0x1f')][_0x862e('0x21')]||'';_0x35410e[_0x862e('0x22')]=!![];if(this['message'][_0x862e('0x23')]){_0x35410e[_0x862e('0x23')]='';_0x35410e[_0x862e('0x23')]+=_['startsWith'](this[_0x862e('0x1f')]['subject'],'Re:')?'':_0x862e('0x24');_0x35410e[_0x862e('0x23')]+=this[_0x862e('0x1f')][_0x862e('0x23')];}}if(this[_0x862e('0xc')]===_0x862e('0x25')){_0x35410e[_0x862e('0x26')]=this[_0x862e('0x27')]['id'];}else{_0x35410e[_['upperFirst'](this[_0x862e('0xc')])+'AccountId']=this[_0x862e('0x27')]['id'];}_0x35410e[_[_0x862e('0x28')](this[_0x862e('0xc')])+_0x862e('0x29')]=this[_0x862e('0x15')]['id'];var _0x46a800=this['interaction'];if(rpc[this['channel']+'Message']){if(this[_0x862e('0xc')]===_0x862e('0xd')){_0x35410e[_0x862e('0x2a')]=this[_0x862e('0x1f')][_0x862e('0x2b')];_0x35410e[_0x862e('0x2c')]=_0x862e('0x2d')+_[_0x862e('0x2e')](_0x35410e[_0x862e('0xe')],']+(>|$)/g,''),'priorityTrue':_0x3b055c[0x1],'priorityFalse':_0x3b055c[0x2]};var _0x31792a=gotoif[_0xa5c5('0x0')](_0x365eff,{'typecast':!![]});if(_0x31792a['length']){logger[_0xa5c5('0xe')]('[%s][GOTOIF]\x20%s',_0x1aee4f,_[_0xa5c5('0xf')](_0x31792a,_0xa5c5('0x10'))['join'](',\x20'));_0x1b38b0['stop']();}else{try{var _0x13e5ba=eval('('+_0x365eff[_0xa5c5('0x11')]+')');var _0x49fa28=_0x13e5ba?_0x365eff[_0xa5c5('0x12')]:_0x365eff[_0xa5c5('0x13')];logger['info'](_0xa5c5('0x14'),_0x1aee4f,_0x365eff['condition'],_0x13e5ba,_0x49fa28||_0xa5c5('0x15'));if(_0x49fa28){var _0x3e5de3=_[_0xa5c5('0x16')](_0x1b38b0[_0xa5c5('0x17')](),{'p':_0x49fa28});if(_0x3e5de3>=0x0){logger[_0xa5c5('0x18')](_0xa5c5('0x19'),_0x1aee4f,_0x49fa28||_0xa5c5('0x15'),_0x3e5de3);_0x1b38b0[_0xa5c5('0x15')](_0x3e5de3);}else{logger[_0xa5c5('0x18')](_0xa5c5('0x1a'),_0x1aee4f,_0x49fa28||_0xa5c5('0x15'));_0x1b38b0[_0xa5c5('0x1b')]();}}else{_0x1b38b0[_0xa5c5('0x15')]();}}catch(_0xff22fa){logger[_0xa5c5('0xe')](_0xa5c5('0x1c'),_0x1aee4f,_0xff22fa[_0xa5c5('0x10')]);_0x1b38b0[_0xa5c5('0x1b')]();}}}catch(_0x40edc3){logger[_0xa5c5('0xe')](_0xa5c5('0x1d'),_0x1aee4f,JSON[_0xa5c5('0x1e')](_0x40edc3));_0x1b38b0[_0xa5c5('0x1b')]();}};}; \ No newline at end of file +var _0x787d=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','length','[%s][GOTOIF]\x20%s','join','stop','condition','info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error'];(function(_0x1469db,_0x41900c){var _0x38ee99=function(_0x19e5f7){while(--_0x19e5f7){_0x1469db['push'](_0x1469db['shift']());}};_0x38ee99(++_0x41900c);}(_0x787d,0x152));var _0xd787=function(_0x1aed80,_0x3ca6f6){_0x1aed80=_0x1aed80-0x0;var _0x43961e=_0x787d[_0x1aed80];return _0x43961e;};'use strict';var schema=require('validate');var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xd787('0x0'));var logger=require(_0xd787('0x1'))(_0xd787('0x2'));var gotoif=schema({'condition':{'type':_0xd787('0x3'),'required':!![],'message':_0xd787('0x4')},'priorityTrue':{'type':_0xd787('0x5'),'message':_0xd787('0x6')},'priorityFalse':{'type':'number','message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xd787('0x7')]=function(_0x5206e8,_0x4b74e8){return function(_0x3ee77f){try{var _0xbf5017={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x4b74e8[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4b74e8[0x1],'priorityFalse':_0x4b74e8[0x2]};var _0x1eb4d3=gotoif['validate'](_0xbf5017,{'typecast':!![]});if(_0x1eb4d3[_0xd787('0x8')]){logger['error'](_0xd787('0x9'),_0x5206e8,_['map'](_0x1eb4d3,'message')[_0xd787('0xa')](',\x20'));_0x3ee77f[_0xd787('0xb')]();}else{try{var _0x19e483=eval('('+_0xbf5017[_0xd787('0xc')]+')');var _0x359da5=_0x19e483?_0xbf5017['priorityTrue']:_0xbf5017['priorityFalse'];logger[_0xd787('0xd')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5206e8,_0xbf5017[_0xd787('0xc')],_0x19e483,_0x359da5||_0xd787('0xe'));if(_0x359da5){var _0x39c6cb=_[_0xd787('0xf')](_0x3ee77f['rules'](),{'p':_0x359da5});if(_0x39c6cb>=0x0){logger[_0xd787('0xd')](_0xd787('0x10'),_0x5206e8,_0x359da5||_0xd787('0xe'),_0x39c6cb);_0x3ee77f[_0xd787('0xe')](_0x39c6cb);}else{logger[_0xd787('0xd')](_0xd787('0x11'),_0x5206e8,_0x359da5||_0xd787('0xe'));_0x3ee77f['stop']();}}else{_0x3ee77f[_0xd787('0xe')]();}}catch(_0x47aed4){logger[_0xd787('0x12')](_0xd787('0x13'),_0x5206e8,_0x47aed4['message']);_0x3ee77f['stop']();}}}catch(_0x3e1dfd){logger[_0xd787('0x12')](_0xd787('0x9'),_0x5206e8,JSON[_0xd787('0x14')](_0x3e1dfd));_0x3ee77f['stop']();}};}; \ 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 358d66c..314ca57 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 _0xb6e2=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','map','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info'];(function(_0x5645ad,_0x580ea3){var _0x17d292=function(_0xe66902){while(--_0xe66902){_0x5645ad['push'](_0x5645ad['shift']());}};_0x17d292(++_0x580ea3);}(_0xb6e2,0x1bc));var _0x2b6e=function(_0x3e54d5,_0x179556){_0x3e54d5=_0x3e54d5-0x0;var _0x35ad39=_0xb6e2[_0x3e54d5];return _0x35ad39;};'use strict';var schema=require(_0x2b6e('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x2b6e('0x1'));var gotop=schema({'priority':{'type':_0x2b6e('0x2'),'required':!![],'message':_0x2b6e('0x3')}});exports[_0x2b6e('0x4')]=function(_0x207691,_0x2d931e){return function(_0x6f0b04){try{var _0x31807f={'priority':_0x2d931e[0x0]};var _0x212a8e=gotop[_0x2b6e('0x0')](_0x31807f,{'typecast':!![]});if(_0x212a8e['length']){logger[_0x2b6e('0x5')](_0x2b6e('0x6'),_0x207691,_[_0x2b6e('0x7')](_0x212a8e,'message')['join'](',\x20'));_0x6f0b04[_0x2b6e('0x8')]();}else{logger['info'](_0x2b6e('0x9'),_0x207691,_0x31807f[_0x2b6e('0xa')]);if(_0x31807f['priority']){var _0xc33a94=_['findIndex'](_0x6f0b04[_0x2b6e('0xb')](),{'p':_0x31807f[_0x2b6e('0xa')]});if(_0xc33a94>=0x0){logger['info'](_0x2b6e('0xc'),_0x207691,_0x31807f[_0x2b6e('0xa')]||'next',_0xc33a94);_0x6f0b04[_0x2b6e('0xd')](_0xc33a94);}else{logger[_0x2b6e('0xe')](_0x2b6e('0xf'),_0x207691,_0x31807f['priority']||_0x2b6e('0xd'));_0x6f0b04[_0x2b6e('0x8')]();}}else{_0x6f0b04[_0x2b6e('0xd')]();}}}catch(_0x39dddf){logger['error']('[%s][GOTOP]\x20%s',_0x207691,JSON[_0x2b6e('0x10')](_0x39dddf));_0x6f0b04[_0x2b6e('0x8')]();}};}; \ No newline at end of file +var _0xfd64=['stringify','validate','../../../../config/logger','number','consequence','length','error','[%s][GOTOP]\x20%s','message','stop','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next'];(function(_0x4d7f3f,_0x4d2803){var _0x5d67cc=function(_0x2c37f4){while(--_0x2c37f4){_0x4d7f3f['push'](_0x4d7f3f['shift']());}};_0x5d67cc(++_0x4d2803);}(_0xfd64,0x1c3));var _0x4fd6=function(_0x34a8ca,_0xdb1c94){_0x34a8ca=_0x34a8ca-0x0;var _0x37f135=_0xfd64[_0x34a8ca];return _0x37f135;};'use strict';var schema=require(_0x4fd6('0x0'));var _=require('lodash');var logger=require(_0x4fd6('0x1'))('routing');var gotop=schema({'priority':{'type':_0x4fd6('0x2'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x4fd6('0x3')]=function(_0x552520,_0x2b7002){return function(_0x4cf68f){try{var _0x38fd94={'priority':_0x2b7002[0x0]};var _0x163eb3=gotop[_0x4fd6('0x0')](_0x38fd94,{'typecast':!![]});if(_0x163eb3[_0x4fd6('0x4')]){logger[_0x4fd6('0x5')](_0x4fd6('0x6'),_0x552520,_['map'](_0x163eb3,_0x4fd6('0x7'))['join'](',\x20'));_0x4cf68f[_0x4fd6('0x8')]();}else{logger[_0x4fd6('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0x552520,_0x38fd94[_0x4fd6('0xa')]);if(_0x38fd94['priority']){var _0x103dee=_[_0x4fd6('0xb')](_0x4cf68f['rules'](),{'p':_0x38fd94[_0x4fd6('0xa')]});if(_0x103dee>=0x0){logger[_0x4fd6('0x9')](_0x4fd6('0xc'),_0x552520,_0x38fd94['priority']||_0x4fd6('0xd'),_0x103dee);_0x4cf68f['next'](_0x103dee);}else{logger[_0x4fd6('0x9')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x552520,_0x38fd94[_0x4fd6('0xa')]||_0x4fd6('0xd'));_0x4cf68f['stop']();}}else{_0x4cf68f['next']();}}}catch(_0x5c56d3){logger[_0x4fd6('0x5')](_0x4fd6('0x6'),_0x552520,JSON[_0x4fd6('0xe')](_0x5c56d3));_0x4cf68f['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 5a449ca..9b9c089 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 _0xf8cd=['catch','error','stringify','stop','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','ChatWebsiteId','account','upperFirst','AccountId','channel','InteractionId','Message','create','then','info','[%s][MESSAGE]\x20%s','next'];(function(_0x1d2024,_0x200e6e){var _0x47820a=function(_0x47ce5b){while(--_0x47ce5b){_0x1d2024['push'](_0x1d2024['shift']());}};_0x47820a(++_0x200e6e);}(_0xf8cd,0xf7));var _0xdf8c=function(_0x20c960,_0x30452d){_0x20c960=_0x20c960-0x0;var _0x1a7ebf=_0xf8cd[_0x20c960];return _0x1a7ebf;};'use strict';var _=require(_0xdf8c('0x0'));var utils=require(_0xdf8c('0x1'));var logger=require('../../../../config/logger')(_0xdf8c('0x2'));var rpc={'chatMessage':require(_0xdf8c('0x3')),'openchannelMessage':require(_0xdf8c('0x4')),'mailMessage':require(_0xdf8c('0x5')),'smsMessage':require(_0xdf8c('0x6')),'faxMessage':require(_0xdf8c('0x7')),'whatsappMessage':require(_0xdf8c('0x8'))};exports[_0xdf8c('0x9')]=function(_0x1a92b4,_0x1280f4){return function(_0x13add2){try{var _0x4e7a2c={'body':utils[_0xdf8c('0xa')](_0x1280f4[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x4e7a2c[_0xdf8c('0xb')]=this[_0xdf8c('0xc')]['id'];}else{_0x4e7a2c[_[_0xdf8c('0xd')](this['channel'])+_0xdf8c('0xe')]=this['account']['id'];}_0x4e7a2c[_['upperFirst'](this[_0xdf8c('0xf')])+_0xdf8c('0x10')]=this['interaction']['id'];if(rpc[this['channel']+_0xdf8c('0x11')]){return rpc[this['channel']+'Message'][_0xdf8c('0x12')](_0x4e7a2c)[_0xdf8c('0x13')](function(_0x30e72d){logger[_0xdf8c('0x14')](_0xdf8c('0x15'),_0x1a92b4,_0x4e7a2c['body']);_0x13add2[_0xdf8c('0x16')]();})[_0xdf8c('0x17')](function(_0x19d354){logger[_0xdf8c('0x18')](_0xdf8c('0x15'),_0x1a92b4,JSON[_0xdf8c('0x19')](_0x19d354));_0x13add2[_0xdf8c('0x1a')]();});}}catch(_0x35664c){logger[_0xdf8c('0x18')](_0xdf8c('0x15'),_0x1a92b4,JSON[_0xdf8c('0x19')](_0x35664c));_0x13add2['stop']();}};}; \ No newline at end of file +var _0x1491=['error','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','then','info','[%s][MESSAGE]\x20%s','body','next','stringify','stop'];(function(_0x58c513,_0x15deec){var _0x4da4c4=function(_0x112a83){while(--_0x112a83){_0x58c513['push'](_0x58c513['shift']());}};_0x4da4c4(++_0x15deec);}(_0x1491,0x1b1));var _0x1149=function(_0x345c7b,_0x3c1284){_0x345c7b=_0x345c7b-0x0;var _0x514d0f=_0x1491[_0x345c7b];return _0x514d0f;};'use strict';var _=require(_0x1149('0x0'));var utils=require(_0x1149('0x1'));var logger=require(_0x1149('0x2'))(_0x1149('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x1149('0x4')),'mailMessage':require(_0x1149('0x5')),'smsMessage':require(_0x1149('0x6')),'faxMessage':require(_0x1149('0x7')),'whatsappMessage':require(_0x1149('0x8'))};exports[_0x1149('0x9')]=function(_0x2bf83d,_0x14b438){return function(_0x1ebf2b){try{var _0xaa7515={'body':utils[_0x1149('0xa')](_0x14b438[0x0],this),'ContactId':this[_0x1149('0xb')]['id']};if(this[_0x1149('0xc')]===_0x1149('0xd')){_0xaa7515[_0x1149('0xe')]=this[_0x1149('0xf')]['id'];}else{_0xaa7515[_[_0x1149('0x10')](this[_0x1149('0xc')])+_0x1149('0x11')]=this['account']['id'];}_0xaa7515[_[_0x1149('0x10')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x1149('0xc')]+'Message']){return rpc[this['channel']+_0x1149('0x12')]['create'](_0xaa7515)[_0x1149('0x13')](function(_0x3531e6){logger[_0x1149('0x14')](_0x1149('0x15'),_0x2bf83d,_0xaa7515[_0x1149('0x16')]);_0x1ebf2b[_0x1149('0x17')]();})['catch'](function(_0x4749f1){logger['error']('[%s][MESSAGE]\x20%s',_0x2bf83d,JSON[_0x1149('0x18')](_0x4749f1));_0x1ebf2b[_0x1149('0x19')]();});}}catch(_0x552de8){logger[_0x1149('0x1a')](_0x1149('0x15'),_0x2bf83d,JSON[_0x1149('0x18')](_0x552de8));_0x1ebf2b[_0x1149('0x19')]();}};}; \ 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 3a10bcd..90e0219 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 _0x7965=['next','error','stringify','./utils','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x4de59e,_0x28c4aa){var _0x4f0fbb=function(_0x11c6ce){while(--_0x11c6ce){_0x4de59e['push'](_0x4de59e['shift']());}};_0x4f0fbb(++_0x28c4aa);}(_0x7965,0x15b));var _0x5796=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x7965[_0x2132a3];return _0x21890c;};'use strict';var utils=require(_0x5796('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x5796('0x1')]=function(_0x267a41,_0xfcc2c8){return function(_0x37348e){try{logger[_0x5796('0x2')](_0x5796('0x3'),_0x267a41,utils[_0x5796('0x4')](_0xfcc2c8[0x0],this));_0x37348e[_0x5796('0x5')]();}catch(_0x19a3db){logger[_0x5796('0x6')](_0x5796('0x3'),_0x267a41,JSON[_0x5796('0x7')](_0x19a3db));_0x37348e['stop']();}};}; \ No newline at end of file +var _0x2945=['routing','consequence','info','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger'];(function(_0x577298,_0x351f89){var _0x42c0b0=function(_0x4cd43f){while(--_0x4cd43f){_0x577298['push'](_0x577298['shift']());}};_0x42c0b0(++_0x351f89);}(_0x2945,0x1b6));var _0x5294=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x2945[_0x35fb56];return _0x2fd52c;};'use strict';var utils=require(_0x5294('0x0'));var logger=require(_0x5294('0x1'))(_0x5294('0x2'));exports[_0x5294('0x3')]=function(_0x52a5f4,_0x417077){return function(_0x5d88e1){try{logger[_0x5294('0x4')]('[%s][NOOP]\x20%s',_0x52a5f4,utils[_0x5294('0x5')](_0x417077[0x0],this));_0x5d88e1[_0x5294('0x6')]();}catch(_0x57890d){logger[_0x5294('0x7')]('[%s][NOOP]\x20%s',_0x52a5f4,JSON[_0x5294('0x8')](_0x57890d));_0x5d88e1[_0x5294('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 d9d5f34..dba734b 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 _0x108f=['waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','AccountId','info','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','then','update\x20queue\x20report','timeout','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','atimeout','qtimeout','rules','close','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','ioredis','../../../../config/environment','routing','redis','defaults','localhost','queue_id','account','queue','from','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x108f,0xbe));var _0xf108=function(_0x29d05e,_0x285605){_0x29d05e=_0x29d05e-0x0;var _0x511abc=_0x108f[_0x29d05e];return _0x511abc;};'use strict';var schema=require(_0xf108('0x0'));var _=require(_0xf108('0x1'));var util=require(_0xf108('0x2'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xf108('0x3'));var config=require(_0xf108('0x4'));var logger=require('../../../../config/logger')(_0xf108('0x5'));var strategy=require('./strategy');config[_0xf108('0x6')]=_[_0xf108('0x7')](config[_0xf108('0x6')],{'host':_0xf108('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf108('0x6')]));var attributes=['id',_0xf108('0x9'),_0xf108('0xa'),_0xf108('0xb'),_0xf108('0xc'),'joinAt'];function emit(_0x3a824d,_0x3e07f4,_0x4e6b37){io['to'](_0x3a824d)['emit'](_0x3e07f4,_0x4e6b37);}function emitChannelQueueInteraction(_0x1631d7,_0x5809fa,_0x5814c3,_0x4111de,_0x477c7b,_0x2c0aef,_0x33c263,_0x3b8e5e){var _0x319833=_[_0xf108('0xd')](_0x5814c3);_0x319833[_0xf108('0x9')]=_0x3b8e5e;_0x319833[_0xf108('0xb')]=_0x5809fa;_0x319833[_0xf108('0xa')]=_0x4111de;_0x319833['id']=_0x477c7b;if(_0x2c0aef){attributes['push'](_['capitalize'](_0x1631d7)+'InteractionId');_0x33c263[util[_0xf108('0xe')](_0xf108('0xf'),_0x1631d7)][_0x477c7b]=_[_0xf108('0x10')](_0x319833,attributes);}else{delete _0x33c263[util['format'](_0xf108('0xf'),_0x1631d7)][_0x477c7b];}emit(util['format'](_0xf108('0x11'),_0x1631d7,_0x5809fa),util[_0xf108('0xe')](_0xf108('0x12'),_0x1631d7,_0x2c0aef?_0xf108('0x13'):_0xf108('0x14')),_['pick'](_0x319833,attributes));}var rpc={'openchannelQueueReport':require(_0xf108('0x15')),'mailQueueReport':require(_0xf108('0x16')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require(_0xf108('0x17')),'faxInteraction':require(_0xf108('0x18')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require(_0xf108('0x19')),'smsInteraction':require(_0xf108('0x1a')),'whatsappInteraction':require(_0xf108('0x1b'))};var queue=schema({'name':{'type':_0xf108('0x1c'),'required':!![],'message':_0xf108('0x1d')},'timeout':{'type':_0xf108('0x1e'),'message':_0xf108('0x1f')}});function startRouting(_0x80a9a2,_0x19b4b6,_0x38362c,_0x23b87f){if(_0x80a9a2&&_0x19b4b6&&_0x38362c){_0x19b4b6[_0xf108('0x20')]+=0x1;var _0x40ed2a={'uniqueid':_0x80a9a2,'from':_0x38362c[_0xf108('0x21')]?_0x38362c['body']['from']:'','joinAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'ContactId':_0x38362c[_0xf108('0x23')]?_0x38362c[_0xf108('0x23')]['id']:null,'ListId':_0x38362c[_0xf108('0x24')]?_0x38362c[_0xf108('0x24')]['id']:null};_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+'QueueId']=_0x19b4b6['id']||null;_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+_0xf108('0x27')]=_0x38362c['interaction']?_0x38362c[_0xf108('0x28')]['id']:null;_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+_0xf108('0x29')]=_0x38362c[_0xf108('0x2a')]?_0x38362c[_0xf108('0x2a')]['id']:null;_0x40ed2a[_[_0xf108('0x25')](_0x38362c[_0xf108('0x26')])+(_0x38362c[_0xf108('0x26')]!=='chat'?_0xf108('0x2b'):'WebsiteId')]=_0x38362c[_0xf108('0xa')]?_0x38362c[_0xf108('0xa')]['id']:null;logger[_0xf108('0x2c')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x80a9a2,_0x19b4b6[_0xf108('0x2d')]));emitChannelQueueInteraction(_0x38362c['channel'],_0x19b4b6['name'],_0x40ed2a,_0x38362c['account'][_0xf108('0x2d')],_0x38362c[_0xf108('0x2a')]['id'],!![],_0x23b87f,_0x19b4b6['id']);if(rpc[_0x38362c[_0xf108('0x26')]+'QueueReport']){return rpc[_0x38362c[_0xf108('0x26')]+_0xf108('0x2e')][_0xf108('0x2f')](_0x40ed2a)[_0xf108('0x30')](function(_0x121cb5){logger[_0xf108('0x31')](_0xf108('0x32'),_0x121cb5);});}}}function stopRouting(_0x592f09,_0x1f5974,_0x595a1d,_0x19386b){if(_0x592f09&&_0x1f5974){_0x1f5974[_0xf108('0x20')]-=0x1;var _0x53fc79={'leaveAt':moment()[_0xf108('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'reason':_0xf108('0x33')};logger[_0xf108('0x2c')](util[_0xf108('0xe')](_0xf108('0x34'),_0x592f09,_0x1f5974[_0xf108('0x2d')]));emitChannelQueueInteraction(_0x595a1d['channel'],_0x1f5974[_0xf108('0x2d')],_0x595a1d[_0xf108('0x21')],_0x595a1d[_0xf108('0xa')][_0xf108('0x2d')],_0x595a1d['message']['id'],![],_0x19386b,_0x1f5974['id']);return rpc[_0x595a1d[_0xf108('0x26')]+'Interaction'][_0xf108('0x35')](_0x595a1d[_0xf108('0x28')]['id'],{'queueId':_0x1f5974['id']})[_0xf108('0x36')](function(){if(rpc[_0x595a1d[_0xf108('0x26')]+'QueueReport']){return rpc[_0x595a1d[_0xf108('0x26')]+_0xf108('0x2e')][_0xf108('0x35')](_0x592f09,_0x53fc79)['catch'](function(_0x3d6f29){logger[_0xf108('0x31')](_0xf108('0x37'),_0x3d6f29);});}});}}function endRouting(_0x4dc504,_0x1b77cb,_0x5951e5,_0x110bee){if(_0x4dc504&&_0x1b77cb){_0x1b77cb['waiting']-=0x1;var _0x16c61f={'leaveAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'exitAt':moment()[_0xf108('0xe')](_0xf108('0x22')),'reason':_0xf108('0x38')};logger[_0xf108('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x4dc504,_0x1b77cb['name']));emitChannelQueueInteraction(_0x5951e5[_0xf108('0x26')],_0x1b77cb[_0xf108('0x2d')],_0x5951e5[_0xf108('0x21')],_0x5951e5[_0xf108('0xa')]['name'],_0x5951e5[_0xf108('0x2a')]['id'],![],_0x110bee);if(rpc[_0x5951e5[_0xf108('0x26')]+_0xf108('0x2e')]){return rpc[_0x5951e5[_0xf108('0x26')]+_0xf108('0x2e')]['update'](_0x4dc504,_0x16c61f)[_0xf108('0x30')](function(_0x2f54e0){logger[_0xf108('0x31')](_0xf108('0x37'),_0x2f54e0);});}}}function handleFindQueue(_0x167c35){return function(_0x4cc647){return _0x4cc647[_0xf108('0x2d')][_0xf108('0x39')]()===_0x167c35['toLowerCase']();};}exports[_0xf108('0x3a')]=function(_0x182ba2,_0x345786,_0x5c1485,_0x27e423){return function(_0x20a6e8){try{var _0x32d45e={'name':_0x345786[0x0],'timeout':_0x345786[0x1]};var _0x3d9591=queue[_0xf108('0x0')](_0x32d45e,{'typecast':!![]});if(_0x3d9591[_0xf108('0x3b')]){logger['error'](_0xf108('0x3c'),_0x182ba2,_[_0xf108('0x3d')](_0x3d9591,_0xf108('0x2a'))[_0xf108('0x3e')](',\x20'));_0x20a6e8[_0xf108('0x3f')]();}else{var _0x7a6664=_['find'](_0x5c1485[_0x27e423[_0xf108('0x26')]+_0xf108('0x40')],handleFindQueue(_0x32d45e[_0xf108('0x2d')]));if(_0x7a6664){startRouting(_0x182ba2,_0x7a6664,_0x27e423,_0x5c1485);var _0x4b02d9=(_0x7a6664['timeout']||0xa)*0x3e8;var _0x1b0433=(_0x32d45e[_0xf108('0x38')]||0x14)*0x3e8;var _0x50b8fc;if(_0x4b02d9>_0x1b0433){_0x1b0433=_0x4b02d9;}var _0x232a8f=seqqueue[_0xf108('0x41')](_0x4b02d9);_0x232a8f['id']=_0x182ba2;_0x232a8f[_0xf108('0x42')]=_0x4b02d9;_0x232a8f[_0xf108('0x43')]=_0x1b0433;_0x232a8f[_0xf108('0x26')]=_0x27e423[_0xf108('0x26')];_0x5c1485[_0xf108('0x44')][_0x182ba2]['on']('end',function(){logger[_0xf108('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x182ba2);stopRouting(_0x182ba2,_0x7a6664,_0x27e423,_0x5c1485);clearTimeout(_0x50b8fc);_0x50b8fc=undefined;_0x232a8f[_0xf108('0x45')](!![]);if(_0x5c1485[_0xf108('0x44')][_0x182ba2]){delete _0x5c1485[_0xf108('0x44')][_0x182ba2];}_0x20a6e8[_0xf108('0x3f')]();});_0x5c1485[_0xf108('0x44')][_0x182ba2]['on']('complete',function(){if(_0x5c1485['rules'][_0x182ba2]){delete _0x5c1485[_0xf108('0x44')][_0x182ba2];}});_0x50b8fc=setTimeout(function(){logger[_0xf108('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x182ba2);endRouting(_0x182ba2,_0x7a6664,_0x27e423,_0x5c1485);clearTimeout(_0x50b8fc);_0x232a8f['close'](!![]);_0x20a6e8['next']();},_0x1b0433);switch(_0x7a6664['strategy']){case _0xf108('0x46'):strategy[_0xf108('0x46')](_0x232a8f,_0x7a6664,_0x5c1485,_0x27e423);break;default:strategy[_0xf108('0x47')](_0x232a8f,_0x7a6664,_0x5c1485,_0x27e423);}}else{logger['error'](_0xf108('0x48'),_0x182ba2,_0x32d45e['name']);_0x20a6e8[_0xf108('0x3f')]();}}}catch(_0x5af2a7){logger[_0xf108('0x31')]('[%s][QUEUE]\x20%s',_0x182ba2,_0x5af2a7[_0xf108('0x49')]);_0x20a6e8[_0xf108('0x3f')]();}};}; \ No newline at end of file +var _0xbcf8=['create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','Interaction','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','util','moment','../../../../config/environment','routing','./strategy','defaults','redis','localhost','socket.io-emitter','account','queue','joinAt','emit','clone','queue_id','push','capitalize','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','from','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error'];(function(_0x36b7b6,_0x48eca0){var _0x25e8d5=function(_0x4523d6){while(--_0x4523d6){_0x36b7b6['push'](_0x36b7b6['shift']());}};_0x25e8d5(++_0x48eca0);}(_0xbcf8,0x1bd));var _0x8bcf=function(_0x15ddf2,_0x431803){_0x15ddf2=_0x15ddf2-0x0;var _0x2e87dd=_0xbcf8[_0x15ddf2];return _0x2e87dd;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x8bcf('0x0'));var seqqueue=require('seq-queue');var moment=require(_0x8bcf('0x1'));var Redis=require('ioredis');var config=require(_0x8bcf('0x2'));var logger=require('../../../../config/logger')(_0x8bcf('0x3'));var strategy=require(_0x8bcf('0x4'));config['redis']=_[_0x8bcf('0x5')](config[_0x8bcf('0x6')],{'host':_0x8bcf('0x7'),'port':0x18eb});var io=require(_0x8bcf('0x8'))(new Redis(config['redis']));var attributes=['id','queue_id',_0x8bcf('0x9'),_0x8bcf('0xa'),'from',_0x8bcf('0xb')];function emit(_0x1b3012,_0x3a76bd,_0x37b91c){io['to'](_0x1b3012)[_0x8bcf('0xc')](_0x3a76bd,_0x37b91c);}function emitChannelQueueInteraction(_0x128548,_0x1056f8,_0x4fb921,_0x2a79ce,_0x1dfd04,_0x21de11,_0x3e206c,_0x3e6491){var _0x238233=_[_0x8bcf('0xd')](_0x4fb921);_0x238233[_0x8bcf('0xe')]=_0x3e6491;_0x238233[_0x8bcf('0xa')]=_0x1056f8;_0x238233[_0x8bcf('0x9')]=_0x2a79ce;_0x238233['id']=_0x1dfd04;if(_0x21de11){attributes[_0x8bcf('0xf')](_[_0x8bcf('0x10')](_0x128548)+'InteractionId');_0x3e206c[util[_0x8bcf('0x11')]('%sQueuesWaitingInteractions',_0x128548)][_0x1dfd04]=_[_0x8bcf('0x12')](_0x238233,attributes);}else{delete _0x3e206c[util[_0x8bcf('0x11')]('%sQueuesWaitingInteractions',_0x128548)][_0x1dfd04];}emit(util[_0x8bcf('0x11')](_0x8bcf('0x13'),_0x128548,_0x1056f8),util[_0x8bcf('0x11')](_0x8bcf('0x14'),_0x128548,_0x21de11?_0x8bcf('0x15'):'remove'),_[_0x8bcf('0x12')](_0x238233,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x8bcf('0x16')),'smsQueueReport':require(_0x8bcf('0x17')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8bcf('0x18')),'chatInteraction':require(_0x8bcf('0x19')),'faxInteraction':require(_0x8bcf('0x1a')),'mailInteraction':require(_0x8bcf('0x1b')),'openchannelInteraction':require(_0x8bcf('0x1c')),'smsInteraction':require(_0x8bcf('0x1d')),'whatsappInteraction':require(_0x8bcf('0x1e'))};var queue=schema({'name':{'type':_0x8bcf('0x1f'),'required':!![],'message':_0x8bcf('0x20')},'timeout':{'type':'number','message':_0x8bcf('0x21')}});function startRouting(_0x12edf0,_0xf3d779,_0x5bbf74,_0xc460d8){if(_0x12edf0&&_0xf3d779&&_0x5bbf74){_0xf3d779['waiting']+=0x1;var _0xffc4a5={'uniqueid':_0x12edf0,'from':_0x5bbf74[_0x8bcf('0x22')]?_0x5bbf74[_0x8bcf('0x22')][_0x8bcf('0x23')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5bbf74[_0x8bcf('0x24')]?_0x5bbf74[_0x8bcf('0x24')]['id']:null,'ListId':_0x5bbf74['list']?_0x5bbf74[_0x8bcf('0x25')]['id']:null};_0xffc4a5[_[_0x8bcf('0x26')](_0x5bbf74[_0x8bcf('0x27')])+_0x8bcf('0x28')]=_0xf3d779['id']||null;_0xffc4a5[_['upperFirst'](_0x5bbf74[_0x8bcf('0x27')])+_0x8bcf('0x29')]=_0x5bbf74[_0x8bcf('0x2a')]?_0x5bbf74['interaction']['id']:null;_0xffc4a5[_[_0x8bcf('0x26')](_0x5bbf74['channel'])+_0x8bcf('0x2b')]=_0x5bbf74['message']?_0x5bbf74[_0x8bcf('0x2c')]['id']:null;_0xffc4a5[_['upperFirst'](_0x5bbf74[_0x8bcf('0x27')])+(_0x5bbf74[_0x8bcf('0x27')]!=='chat'?'AccountId':_0x8bcf('0x2d'))]=_0x5bbf74[_0x8bcf('0x9')]?_0x5bbf74[_0x8bcf('0x9')]['id']:null;logger[_0x8bcf('0x2e')](util['format'](_0x8bcf('0x2f'),_0x12edf0,_0xf3d779['name']));emitChannelQueueInteraction(_0x5bbf74[_0x8bcf('0x27')],_0xf3d779['name'],_0xffc4a5,_0x5bbf74['account'][_0x8bcf('0x30')],_0x5bbf74[_0x8bcf('0x2c')]['id'],!![],_0xc460d8,_0xf3d779['id']);if(rpc[_0x5bbf74[_0x8bcf('0x27')]+_0x8bcf('0x31')]){return rpc[_0x5bbf74[_0x8bcf('0x27')]+_0x8bcf('0x31')][_0x8bcf('0x32')](_0xffc4a5)[_0x8bcf('0x33')](function(_0xa015c3){logger[_0x8bcf('0x34')](_0x8bcf('0x35'),_0xa015c3);});}}}function stopRouting(_0x35c5c8,_0x344f03,_0x591b3d,_0x13ae78){if(_0x35c5c8&&_0x344f03){_0x344f03[_0x8bcf('0x36')]-=0x1;var _0x46ce45={'leaveAt':moment()[_0x8bcf('0x11')](_0x8bcf('0x37')),'acceptAt':moment()[_0x8bcf('0x11')](_0x8bcf('0x37')),'reason':'accepted'};logger[_0x8bcf('0x2e')](util[_0x8bcf('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x35c5c8,_0x344f03[_0x8bcf('0x30')]));emitChannelQueueInteraction(_0x591b3d[_0x8bcf('0x27')],_0x344f03[_0x8bcf('0x30')],_0x591b3d[_0x8bcf('0x22')],_0x591b3d[_0x8bcf('0x9')]['name'],_0x591b3d[_0x8bcf('0x2c')]['id'],![],_0x13ae78,_0x344f03['id']);return rpc[_0x591b3d[_0x8bcf('0x27')]+_0x8bcf('0x38')]['update'](_0x591b3d[_0x8bcf('0x2a')]['id'],{'queueId':_0x344f03['id']})['then'](function(){if(rpc[_0x591b3d['channel']+_0x8bcf('0x31')]){return rpc[_0x591b3d[_0x8bcf('0x27')]+_0x8bcf('0x31')][_0x8bcf('0x39')](_0x35c5c8,_0x46ce45)[_0x8bcf('0x33')](function(_0x27fd7f){logger[_0x8bcf('0x34')](_0x8bcf('0x3a'),_0x27fd7f);});}});}}function endRouting(_0x486806,_0x204c72,_0x269fe6,_0x36b092){if(_0x486806&&_0x204c72){_0x204c72[_0x8bcf('0x36')]-=0x1;var _0x4e239a={'leaveAt':moment()[_0x8bcf('0x11')](_0x8bcf('0x37')),'exitAt':moment()['format'](_0x8bcf('0x37')),'reason':_0x8bcf('0x3b')};logger[_0x8bcf('0x2e')](util[_0x8bcf('0x11')](_0x8bcf('0x3c'),_0x486806,_0x204c72[_0x8bcf('0x30')]));emitChannelQueueInteraction(_0x269fe6[_0x8bcf('0x27')],_0x204c72[_0x8bcf('0x30')],_0x269fe6[_0x8bcf('0x22')],_0x269fe6['account'][_0x8bcf('0x30')],_0x269fe6[_0x8bcf('0x2c')]['id'],![],_0x36b092);if(rpc[_0x269fe6[_0x8bcf('0x27')]+_0x8bcf('0x31')]){return rpc[_0x269fe6['channel']+_0x8bcf('0x31')]['update'](_0x486806,_0x4e239a)[_0x8bcf('0x33')](function(_0x220914){logger[_0x8bcf('0x34')](_0x8bcf('0x3a'),_0x220914);});}}}function handleFindQueue(_0x36d74b){return function(_0x4c21a9){return _0x4c21a9['name'][_0x8bcf('0x3d')]()===_0x36d74b[_0x8bcf('0x3d')]();};}exports[_0x8bcf('0x3e')]=function(_0x41ea03,_0x366e1f,_0x4385a5,_0x3482f6){return function(_0x580a71){try{var _0x6cb2c2={'name':_0x366e1f[0x0],'timeout':_0x366e1f[0x1]};var _0x48e6e9=queue['validate'](_0x6cb2c2,{'typecast':!![]});if(_0x48e6e9[_0x8bcf('0x3f')]){logger['error']('[%s][QUEUE]\x20%s',_0x41ea03,_[_0x8bcf('0x40')](_0x48e6e9,'message')[_0x8bcf('0x41')](',\x20'));_0x580a71[_0x8bcf('0x42')]();}else{var _0x167708=_[_0x8bcf('0x43')](_0x4385a5[_0x3482f6[_0x8bcf('0x27')]+_0x8bcf('0x44')],handleFindQueue(_0x6cb2c2[_0x8bcf('0x30')]));if(_0x167708){startRouting(_0x41ea03,_0x167708,_0x3482f6,_0x4385a5);var _0x59a960=(_0x167708[_0x8bcf('0x3b')]||0xa)*0x3e8;var _0x5d9278=(_0x6cb2c2[_0x8bcf('0x3b')]||0x14)*0x3e8;var _0x1d4d70;if(_0x59a960>_0x5d9278){_0x5d9278=_0x59a960;}var _0x5b6059=seqqueue[_0x8bcf('0x45')](_0x59a960);_0x5b6059['id']=_0x41ea03;_0x5b6059[_0x8bcf('0x46')]=_0x59a960;_0x5b6059[_0x8bcf('0x47')]=_0x5d9278;_0x5b6059[_0x8bcf('0x27')]=_0x3482f6[_0x8bcf('0x27')];_0x4385a5[_0x8bcf('0x48')][_0x41ea03]['on']('end',function(){logger[_0x8bcf('0x2e')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x41ea03);stopRouting(_0x41ea03,_0x167708,_0x3482f6,_0x4385a5);clearTimeout(_0x1d4d70);_0x1d4d70=undefined;_0x5b6059[_0x8bcf('0x49')](!![]);if(_0x4385a5[_0x8bcf('0x48')][_0x41ea03]){delete _0x4385a5[_0x8bcf('0x48')][_0x41ea03];}_0x580a71[_0x8bcf('0x42')]();});_0x4385a5['rules'][_0x41ea03]['on'](_0x8bcf('0x4a'),function(){if(_0x4385a5['rules'][_0x41ea03]){delete _0x4385a5['rules'][_0x41ea03];}});_0x1d4d70=setTimeout(function(){logger[_0x8bcf('0x2e')](_0x8bcf('0x4b'),_0x41ea03);endRouting(_0x41ea03,_0x167708,_0x3482f6,_0x4385a5);clearTimeout(_0x1d4d70);_0x5b6059[_0x8bcf('0x49')](!![]);_0x580a71[_0x8bcf('0x4c')]();},_0x5d9278);switch(_0x167708[_0x8bcf('0x4d')]){case _0x8bcf('0x4e'):strategy[_0x8bcf('0x4e')](_0x5b6059,_0x167708,_0x4385a5,_0x3482f6);break;default:strategy[_0x8bcf('0x4f')](_0x5b6059,_0x167708,_0x4385a5,_0x3482f6);}}else{logger[_0x8bcf('0x34')](_0x8bcf('0x50'),_0x41ea03,_0x6cb2c2[_0x8bcf('0x30')]);_0x580a71[_0x8bcf('0x42')]();}}}catch(_0xdab0ec){logger[_0x8bcf('0x34')](_0x8bcf('0x51'),_0x41ea03,_0xdab0ec[_0x8bcf('0x52')]);_0x580a71['stop']();}};}; \ 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 384566a..ee192c9 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 _0x5fd1=['forcedOwnership','channel','busy','busyQueue','saveWaitingNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','removeWaitingNotification','TIMEOUT','lodash','./util','../../../../../config/logger','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x522e69,_0x495eb0){var _0x4920e6=function(_0x288efe){while(--_0x288efe){_0x522e69['push'](_0x522e69['shift']());}};_0x4920e6(++_0x495eb0);}(_0x5fd1,0x155));var _0x15fd=function(_0x5ccc4f,_0x104b4b){_0x5ccc4f=_0x5ccc4f-0x0;var _0x36ad21=_0x5fd1[_0x5ccc4f];return _0x36ad21;};'use strict';var _=require(_0x15fd('0x0'));var uuid=require('uuid');var util=require(_0x15fd('0x1'));var logger=require(_0x15fd('0x2'))(_0x15fd('0x3'));var Agent=function(_0x50fc5a,_0x5d2d77,_0x370d34,_0x3138f3){this[_0x15fd('0x4')]=uuid['v4']();this['squeue']=_0x50fc5a;this[_0x15fd('0x5')]=_0x5d2d77;this[_0x15fd('0x6')]=_0x370d34;this[_0x15fd('0x3')]=_0x3138f3;this[_0x15fd('0x7')][_0x15fd('0x8')](this['handleRun'][_0x15fd('0x9')](this),this[_0x15fd('0xa')][_0x15fd('0x9')](this));this['squeue']['on'](_0x15fd('0xb'),this['handleTimeout'][_0x15fd('0x9')](this));this[_0x15fd('0x7')]['on']('drained',this['handleDrained']['bind'](this));};Agent[_0x15fd('0xc')][_0x15fd('0x8')]=function(){this[_0x15fd('0x7')][_0x15fd('0x8')](this[_0x15fd('0xd')][_0x15fd('0x9')](this),this[_0x15fd('0xa')][_0x15fd('0x9')](this));};Agent[_0x15fd('0xc')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x15fd('0xd')]=function(){logger[_0x15fd('0xe')](_0x15fd('0xf'),this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);if(_[_0x15fd('0x10')](this[_0x15fd('0x6')][_0x15fd('0x11')][this['agent']['id']])){logger['debug'](_0x15fd('0x12'),this['squeue']['id'],this[_0x15fd('0x5')]['id']);setTimeout(this['push'][_0x15fd('0x9')](this),0x3e8);}else{if(this[_0x15fd('0x3')][_0x15fd('0x13')]||util['isAgentAvailable'](this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],this[_0x15fd('0x7')][_0x15fd('0x14')],![])){this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']][_0x15fd('0x15')]=!![];this[_0x15fd('0x6')]['agents'][this['agent']['id']][_0x15fd('0x16')]=undefined;util[_0x15fd('0x17')](this[_0x15fd('0x6')],this[_0x15fd('0x3')],this[_0x15fd('0x5')],this[_0x15fd('0x7')][_0x15fd('0x14')]);util['showNotification'](this[_0x15fd('0x4')],this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']],null,this['routing']);util[_0x15fd('0x18')](this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']],_0x15fd('0x19')+(this[_0x15fd('0x3')]['forcedOwnership']?_0x15fd('0x1a'):''));}else{logger['debug'](_0x15fd('0x1b'),this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);setTimeout(this[_0x15fd('0x8')][_0x15fd('0x9')](this),0x3e8);}}};Agent[_0x15fd('0xc')][_0x15fd('0xa')]=function(_0xe650a3){if(_[_0x15fd('0x10')](this[_0x15fd('0x6')][_0x15fd('0x11')][this['agent']['id']])){return logger[_0x15fd('0xe')](_0x15fd('0x12'),this['squeue']['id'],this[_0x15fd('0x5')]['id']);}else{logger[_0x15fd('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x15fd('0x7')]['id'],this[_0x15fd('0x5')]['id']);util['hideNotification'](this[_0x15fd('0x4')],this[_0x15fd('0x7')]['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],null,this[_0x15fd('0x3')]);this['realtime'][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']][_0x15fd('0x15')]=![];this[_0x15fd('0x6')]['agents'][this[_0x15fd('0x5')]['id']][_0x15fd('0x16')]=undefined;util[_0x15fd('0x1c')](this[_0x15fd('0x6')],this[_0x15fd('0x3')],this[_0x15fd('0x5')],this['squeue'][_0x15fd('0x14')]);util[_0x15fd('0x18')](this['squeue']['id'],this[_0x15fd('0x6')][_0x15fd('0x11')][this[_0x15fd('0x5')]['id']],_0xe650a3?'STOP':_0x15fd('0x1d'));}if(!_0xe650a3){setTimeout(this[_0x15fd('0x8')][_0x15fd('0x9')](this),0x3e8);}};function agent(_0xbe50e7,_0x163380,_0x6b2ac8,_0x4d7259){return new Agent(_0xbe50e7,_0x163380,_0x6b2ac8,_0x4d7259);}module['exports']=agent; \ No newline at end of file +var _0x29d4=['routing','notificationId','squeue','agent','realtime','push','bind','timeout','handleDrained','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger'];(function(_0x13958f,_0x3144bf){var _0x3de5bc=function(_0x1dc61f){while(--_0x1dc61f){_0x13958f['push'](_0x13958f['shift']());}};_0x3de5bc(++_0x3144bf);}(_0x29d4,0x1a1));var _0x429d=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x29d4[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x429d('0x0'));var uuid=require('uuid');var util=require(_0x429d('0x1'));var logger=require(_0x429d('0x2'))(_0x429d('0x3'));var Agent=function(_0x472fc9,_0x45df1c,_0x4e287b,_0xc3989d){this[_0x429d('0x4')]=uuid['v4']();this[_0x429d('0x5')]=_0x472fc9;this[_0x429d('0x6')]=_0x45df1c;this[_0x429d('0x7')]=_0x4e287b;this[_0x429d('0x3')]=_0xc3989d;this[_0x429d('0x5')][_0x429d('0x8')](this['handleRun'][_0x429d('0x9')](this),this['handleTimeout'][_0x429d('0x9')](this));this[_0x429d('0x5')]['on'](_0x429d('0xa'),this['handleTimeout'][_0x429d('0x9')](this));this[_0x429d('0x5')]['on']('drained',this[_0x429d('0xb')][_0x429d('0x9')](this));};Agent[_0x429d('0xc')]['push']=function(){this[_0x429d('0x5')][_0x429d('0x8')](this[_0x429d('0xd')][_0x429d('0x9')](this),this['handleTimeout'][_0x429d('0x9')](this));};Agent[_0x429d('0xc')][_0x429d('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x429d('0xc')][_0x429d('0xd')]=function(){logger['debug'](_0x429d('0xe'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);if(_[_0x429d('0xf')](this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']])){logger[_0x429d('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}else{if(this['routing'][_0x429d('0x12')]||util[_0x429d('0x13')](this[_0x429d('0x5')]['id'],this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']],this[_0x429d('0x5')][_0x429d('0x14')],![])){this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']][_0x429d('0x15')]=!![];this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']][_0x429d('0x16')]=undefined;util[_0x429d('0x17')](this[_0x429d('0x7')],this[_0x429d('0x3')],this[_0x429d('0x6')],this[_0x429d('0x5')]['channel']);util[_0x429d('0x18')](this[_0x429d('0x4')],this['squeue']['id'],this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']],null,this[_0x429d('0x3')]);util['writeLog'](this[_0x429d('0x5')]['id'],this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']],_0x429d('0x19')+(this['routing'][_0x429d('0x12')]?_0x429d('0x1a'):''));}else{logger[_0x429d('0x11')](_0x429d('0x1b'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}}};Agent[_0x429d('0xc')]['handleTimeout']=function(_0x31cae6){if(_[_0x429d('0xf')](this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']])){return logger[_0x429d('0x11')](_0x429d('0x1c'),this[_0x429d('0x5')]['id'],this['agent']['id']);}else{logger[_0x429d('0x11')](_0x429d('0x1d'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);util[_0x429d('0x1e')](this[_0x429d('0x4')],this['squeue']['id'],this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']],null,this['routing']);this['realtime'][_0x429d('0x10')][this['agent']['id']][_0x429d('0x15')]=![];this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']]['busyQueue']=undefined;util[_0x429d('0x1f')](this[_0x429d('0x7')],this['routing'],this['agent'],this['squeue']['channel']);util['writeLog'](this[_0x429d('0x5')]['id'],this['realtime']['agents'][this[_0x429d('0x6')]['id']],_0x31cae6?_0x429d('0x20'):_0x429d('0x21'));}if(!_0x31cae6){setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}};function agent(_0x1a5d80,_0x4b23ab,_0x423dc8,_0x2c5fa5){return new Agent(_0x1a5d80,_0x4b23ab,_0x423dc8,_0x2c5fa5);}module[_0x429d('0x22')]=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 658bcce..9f7508a 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 _0xe48c=['bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','realtime','debug','isAgentAvailable','agents','channel','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','TIMEOUT','removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','queue','routing','push','handleRun'];(function(_0x2567f0,_0x4fa60){var _0x14852a=function(_0x55b95f){while(--_0x55b95f){_0x2567f0['push'](_0x2567f0['shift']());}};_0x14852a(++_0x4fa60);}(_0xe48c,0x107));var _0xce48=function(_0x31e2af,_0x125903){_0x31e2af=_0x31e2af-0x0;var _0x1d592a=_0xe48c[_0x31e2af];return _0x1d592a;};'use strict';var _=require(_0xce48('0x0'));var uuid=require('uuid');var util=require(_0xce48('0x1'));var logger=require(_0xce48('0x2'))('routing');var Beepall=function(_0x111a98,_0x4abe3c,_0x29fd34,_0x59b924){this[_0xce48('0x3')]=uuid['v4']();this[_0xce48('0x4')]=_0x111a98;this[_0xce48('0x5')]=_0x4abe3c;this['realtime']=_0x29fd34;this[_0xce48('0x6')]=_0x59b924;this[_0xce48('0x4')][_0xce48('0x7')](this[_0xce48('0x8')][_0xce48('0x9')](this),this[_0xce48('0xa')][_0xce48('0x9')](this));this[_0xce48('0x4')]['on'](_0xce48('0xb'),this[_0xce48('0xa')][_0xce48('0x9')](this));this['squeue']['on'](_0xce48('0xc'),this[_0xce48('0xd')][_0xce48('0x9')](this));};Beepall[_0xce48('0xe')][_0xce48('0x7')]=function(){this[_0xce48('0x4')][_0xce48('0x7')](this['handleRun']['bind'](this),this[_0xce48('0xa')][_0xce48('0x9')](this));};Beepall[_0xce48('0xe')][_0xce48('0xd')]=function(){this['handleTimeout'](!![]);};Beepall[_0xce48('0xe')]['handleRun']=function(){var _0x6ad2b=!![];if(!_[_0xce48('0xf')](this[_0xce48('0x5')])&&!_[_0xce48('0xf')](this[_0xce48('0x5')][_0xce48('0x10')])&&this['queue']['Agents'][_0xce48('0x11')]>0x0){for(var _0x3c1778=0x0,_0x1d00ec;_0x3c17780x0){for(var _0x529ce2=0x0,_0x4eb832;_0x529ce20x0&&_0x1e5078[_0xc7ff13+_0x11d2('0x25')]>=_0x1e5078[_0xc7ff13+_0x11d2('0x26')]){writeLog(_0xdac2d,_0x1e5078,_0xc7ff13[_0x11d2('0x27')]()+_0x11d2('0x28'));return![];}}return!![];};exports[_0x11d2('0x29')]=function(_0x5dd42a,_0x203ec4,_0xfecd81,_0x51f474,_0x41e9af){return sendNotification(!![],_0x5dd42a,_0x203ec4,_0xfecd81,_0x51f474,_0x41e9af);};exports['hideNotification']=function(_0x5ef7ba,_0x3b3c59,_0x4cb6d4,_0x9a635a,_0x39aac9){return sendNotification(![],_0x5ef7ba,_0x3b3c59,_0x4cb6d4,_0x9a635a,_0x39aac9);};exports[_0x11d2('0x2a')]=function(_0x426523,_0x1eeca4,_0x215c54){var _0x143a9d=_0x1eeca4[_0x11d2('0x2b')]['UserId'];if(!_0x143a9d&&_0x215c54){_0x143a9d=_0x215c54['id'];}var _0x190fd2=_[_0x11d2('0x2c')](_0x426523[_0x1eeca4[_0x11d2('0x2d')]+_0x11d2('0x2e')],function(_0x3bbe1a){var _0x28f56b=_[_0x11d2('0x2f')](_0x1eeca4[_0x11d2('0x2d')])+_0x11d2('0x30');return _0x3bbe1a[_0x28f56b]===_0x1eeca4[_0x11d2('0x2b')]['id'];});if(!_0x190fd2&&_0x143a9d&&_0x426523[_0x11d2('0x31')][_0x143a9d]){_0x190fd2=_[_0x11d2('0x2c')](_0x426523[_0x11d2('0x31')][_0x143a9d][_0x1eeca4[_0x11d2('0x2d')]+'WaitingInteractions'],function(_0x6cd69f){return _0x6cd69f['id']===_0x1eeca4[_0x11d2('0x2b')]['id'];});}return _0x190fd2;};exports[_0x11d2('0x32')]=function(_0x3ff175,_0x3132fb,_0x4a6ce8,_0x36379c){if(_0x4a6ce8&&_0x4a6ce8['id']&&_0x3ff175[_0x11d2('0x31')]&&_0x3ff175[_0x11d2('0x31')][_0x4a6ce8['id']]){_0x3ff175[_0x11d2('0x31')][_0x4a6ce8['id']][_0x36379c+_0x11d2('0x33')][_0x3132fb['message']['id']]={'id':_0x3132fb['interaction']['id']};}};exports[_0x11d2('0x34')]=function(_0x435641,_0x185099,_0x70419a,_0x3c9e6b){if(_0x70419a&&_0x70419a['id']&&_0x435641['agents']&&_0x435641['agents'][_0x70419a['id']]){delete _0x435641[_0x11d2('0x31')][_0x70419a['id']][_0x3c9e6b+'WaitingInteractions'][_0x185099[_0x11d2('0x17')]['id']];}};exports[_0x11d2('0x35')]=writeLog; \ No newline at end of file +var _0xcefd=['notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','message','user:%s','emit','notification:%s','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','interaction','channel','QueuesWaitingInteractions','capitalize','agents','some','WaitingInteractions','saveWaitingNotification','writeLog','lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','\x20interaction','name','account'];(function(_0x590941,_0x1981e0){var _0x43c7bc=function(_0x1cd545){while(--_0x1cd545){_0x590941['push'](_0x590941['shift']());}};_0x43c7bc(++_0x1981e0);}(_0xcefd,0x126));var _0xdcef=function(_0xce2ee4,_0x3fe1e1){_0xce2ee4=_0xce2ee4-0x0;var _0x3fd000=_0xcefd[_0xce2ee4];return _0x3fd000;};'use strict';var _=require(_0xdcef('0x0'));var util=require(_0xdcef('0x1'));var utils=require(_0xdcef('0x2'));var Redis=require('ioredis');var config=require(_0xdcef('0x3'));var logger=require(_0xdcef('0x4'))(_0xdcef('0x5'));config['redis']=_[_0xdcef('0x6')](config[_0xdcef('0x7')],{'host':_0xdcef('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdcef('0x7')]));function sendNotification(_0xcaa40a,_0x3fb1b7,_0x3260fe,_0x53e707,_0x56ee48,_0x8b30d4){var _0x2ad7b0=_0x8b30d4||{};var _0x16fd14=_0x3260fe['split']('.');var _0x1946c9={'uniqueid':_0x3fb1b7,'channel':_0x16fd14[0x0],'id':_0x16fd14[0x1],'title':_0x16fd14[0x0]+_0xdcef('0x9'),'interactionId':_0x16fd14[0x2],'queue':_0x56ee48?_0x56ee48[_0xdcef('0xa')]:null,'sound':_0x2ad7b0[_0xdcef('0xb')][_0xdcef('0xc')],'shake':_0x2ad7b0[_0xdcef('0xb')]['notificationShake']};try{if(!_0x2ad7b0['body']){_0x2ad7b0[_0xdcef('0xd')]={};}if(_0x56ee48){_0x2ad7b0[_0xdcef('0xd')]['queue']=_0x56ee48;}else if(_0x2ad7b0[_0xdcef('0xd')]['queue']){delete _0x2ad7b0['body'][_0xdcef('0xe')];}_0x1946c9[_0xdcef('0xf')]=utils[_0xdcef('0x10')](_0x2ad7b0[_0xdcef('0xb')][_0xdcef('0x11')],_0x2ad7b0);}catch(_0x3b6adf){_0x1946c9[_0xdcef('0xf')]=_0xdcef('0x12');logger[_0xdcef('0x13')](util[_0xdcef('0x14')](_0xdcef('0x15'),_0x3fb1b7,_0x3b6adf[_0xdcef('0x16')]));}io['to'](util['format'](_0xdcef('0x17'),_0x53e707['name']))[_0xdcef('0x18')](util[_0xdcef('0x14')](_0xdcef('0x19'),_0xcaa40a?_0xdcef('0x1a'):'remove'),_0x1946c9);}function writeLog(_0x4e320e,_0xe8e3a3,_0x19283a){return logger[_0xdcef('0x1b')](util[_0xdcef('0x14')](_0xdcef('0x1c'),_0x4e320e,_0xe8e3a3[_0xdcef('0xa')],_0x19283a));}exports[_0xdcef('0x1d')]=function(_0x510d1e,_0x417de7,_0x3160bf,_0x5865e9){if(_0x417de7[_0xdcef('0x1e')]){writeLog(_0x510d1e,_0x417de7,_0xdcef('0x1f'));return![];}if(!_0x417de7[_0xdcef('0x20')]){writeLog(_0x510d1e,_0x417de7,_0xdcef('0x21'));return![];}if(_0x417de7[_0x3160bf+_0xdcef('0x22')]){writeLog(_0x510d1e,_0x417de7,_0xdcef('0x23'));return![];}if(_0x5865e9&&_0x417de7[_0xdcef('0x24')](_0x3160bf+_0xdcef('0x25'))&&_0x417de7[_0xdcef('0x24')](_0x3160bf+_0xdcef('0x26'))){if(_0x417de7[_0x3160bf+_0xdcef('0x25')]>0x0&&_0x417de7[_0x3160bf+_0xdcef('0x26')]>=_0x417de7[_0x3160bf+_0xdcef('0x25')]){writeLog(_0x510d1e,_0x417de7,_0x3160bf[_0xdcef('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xdcef('0x28')]=function(_0x392cba,_0x313593,_0x50fdcb,_0x86b996,_0x2f8e0c){return sendNotification(!![],_0x392cba,_0x313593,_0x50fdcb,_0x86b996,_0x2f8e0c);};exports[_0xdcef('0x29')]=function(_0x1f80fe,_0x1b71c5,_0x7fce54,_0x560534,_0x4ef0d5){return sendNotification(![],_0x1f80fe,_0x1b71c5,_0x7fce54,_0x560534,_0x4ef0d5);};exports['checkWaitingNotifications']=function(_0x34ea2f,_0x46942b,_0x21f960){var _0x2aadc3=_0x46942b[_0xdcef('0x2a')]['UserId'];if(!_0x2aadc3&&_0x21f960){_0x2aadc3=_0x21f960['id'];}var _0xc6bbb3=_['some'](_0x34ea2f[_0x46942b[_0xdcef('0x2b')]+_0xdcef('0x2c')],function(_0x1d2801){var _0x5821bc=_[_0xdcef('0x2d')](_0x46942b[_0xdcef('0x2b')])+'InteractionId';return _0x1d2801[_0x5821bc]===_0x46942b['interaction']['id'];});if(!_0xc6bbb3&&_0x2aadc3&&_0x34ea2f[_0xdcef('0x2e')][_0x2aadc3]){_0xc6bbb3=_[_0xdcef('0x2f')](_0x34ea2f[_0xdcef('0x2e')][_0x2aadc3][_0x46942b[_0xdcef('0x2b')]+_0xdcef('0x30')],function(_0xe253ee){return _0xe253ee['id']===_0x46942b['interaction']['id'];});}return _0xc6bbb3;};exports[_0xdcef('0x31')]=function(_0x5e28f5,_0x346026,_0x55cc14,_0x5cf507){if(_0x55cc14&&_0x55cc14['id']&&_0x5e28f5[_0xdcef('0x2e')]&&_0x5e28f5[_0xdcef('0x2e')][_0x55cc14['id']]){_0x5e28f5[_0xdcef('0x2e')][_0x55cc14['id']][_0x5cf507+_0xdcef('0x30')][_0x346026['message']['id']]={'id':_0x346026['interaction']['id']};}};exports['removeWaitingNotification']=function(_0x147b29,_0x31ddd4,_0x590b5f,_0x5cb328){if(_0x590b5f&&_0x590b5f['id']&&_0x147b29[_0xdcef('0x2e')]&&_0x147b29['agents'][_0x590b5f['id']]){delete _0x147b29[_0xdcef('0x2e')][_0x590b5f['id']][_0x5cb328+_0xdcef('0x30')][_0x31ddd4[_0xdcef('0x16')]['id']];}};exports[_0xdcef('0x32')]=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 fe07b8c..3982989 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 _0xff98=['consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','shelljs','lodash','./utils','../../../../config/logger','string'];(function(_0xab39a,_0x9d1016){var _0x17bbe2=function(_0x5b4881){while(--_0x5b4881){_0xab39a['push'](_0xab39a['shift']());}};_0x17bbe2(++_0x9d1016);}(_0xff98,0x9c));var _0x8ff9=function(_0xa9e4b5,_0x12e966){_0xa9e4b5=_0xa9e4b5-0x0;var _0x356027=_0xff98[_0xa9e4b5];return _0x356027;};'use strict';var schema=require('validate');var sh=require(_0x8ff9('0x0'));var _=require(_0x8ff9('0x1'));var utils=require(_0x8ff9('0x2'));var logger=require(_0x8ff9('0x3'))('routing');var system=schema({'command':{'type':_0x8ff9('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x8ff9('0x5')]=function(_0x5be38f,_0x2fdb87){return function(_0x50c460){try{var _0x7b1d31={'command':_0x2fdb87[0x0]};var _0x2c11a2=system[_0x8ff9('0x6')](_0x7b1d31,{'typecast':!![]});if(_0x2c11a2[_0x8ff9('0x7')]){logger[_0x8ff9('0x8')](_0x8ff9('0x9'),_0x5be38f,_[_0x8ff9('0xa')](_0x2c11a2,_0x8ff9('0xb'))['join'](',\x20'));logger[_0x8ff9('0xc')](_0x8ff9('0xd'),_0x5be38f);_0x50c460[_0x8ff9('0xe')]();}else{var _0x725644=this;var _0xee279a=utils[_0x8ff9('0xf')](_0x2fdb87[0x0],this);logger[_0x8ff9('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5be38f,_0xee279a);sh['exec'](_['trim'](_0xee279a),function(_0x13986f,_0x18367c){logger[_0x8ff9('0xc')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x5be38f,_0x13986f);if(_0x13986f==0x0){var _0x3c655c=_0x18367c[_0x8ff9('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x8ff9('0x11')](_0x2fdb87[0x1])||_[_0x8ff9('0x12')](_0x2fdb87[0x1])){logger[_0x8ff9('0xc')](_0x8ff9('0x13'),_0x5be38f);_0x725644[_0x8ff9('0x14')][_0x2fdb87[0x1]]=_0x3c655c;}else{logger['info'](_0x8ff9('0x15'),_0x5be38f,_0x2fdb87[0x1],_0x3c655c);_0x725644[_0x8ff9('0x14')][_0x2fdb87[0x1]]=_0x3c655c;}}_0x50c460[_0x8ff9('0xe')]();});}}catch(_0x5b5a3e){logger[_0x8ff9('0x8')]('[%s][SYSTEM]\x20%s',_0x5be38f,_[_0x8ff9('0x16')](_0x5b5a3e)?JSON['stringify'](_0x5b5a3e):_0x5b5a3e);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5be38f);_0x50c460['next']();}};}; \ No newline at end of file +var _0xa44c=['length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate'];(function(_0x1f3e5a,_0x3b4227){var _0x5293bf=function(_0x226fa1){while(--_0x226fa1){_0x1f3e5a['push'](_0x1f3e5a['shift']());}};_0x5293bf(++_0x3b4227);}(_0xa44c,0x1a9));var _0xca44=function(_0x1bbf33,_0x4bd780){_0x1bbf33=_0x1bbf33-0x0;var _0x4b2839=_0xa44c[_0x1bbf33];return _0x4b2839;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require('lodash');var utils=require(_0xca44('0x0'));var logger=require(_0xca44('0x1'))(_0xca44('0x2'));var system=schema({'command':{'type':_0xca44('0x3'),'required':!![],'message':_0xca44('0x4')}});exports[_0xca44('0x5')]=function(_0x372a47,_0xe36820){return function(_0x11528f){try{var _0x46737f={'command':_0xe36820[0x0]};var _0x32d987=system[_0xca44('0x6')](_0x46737f,{'typecast':!![]});if(_0x32d987[_0xca44('0x7')]){logger[_0xca44('0x8')](_0xca44('0x9'),_0x372a47,_[_0xca44('0xa')](_0x32d987,_0xca44('0xb'))[_0xca44('0xc')](',\x20'));logger['info'](_0xca44('0xd'),_0x372a47);_0x11528f['next']();}else{var _0x52440a=this;var _0x578ce6=utils[_0xca44('0xe')](_0xe36820[0x0],this);logger['info'](_0xca44('0xf'),_0x372a47,_0x578ce6);sh[_0xca44('0x10')](_[_0xca44('0x11')](_0x578ce6),function(_0x2641d7,_0x457694){logger[_0xca44('0x12')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x372a47,_0x2641d7);if(_0x2641d7==0x0){var _0x43722d=_0x457694[_0xca44('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xca44('0x14')](_0xe36820[0x1])||_['isEmpty'](_0xe36820[0x1])){logger[_0xca44('0x12')](_0xca44('0x15'),_0x372a47);_0x52440a[_0xca44('0x16')][_0xe36820[0x1]]=_0x43722d;}else{logger[_0xca44('0x12')](_0xca44('0x17'),_0x372a47,_0xe36820[0x1],_0x43722d);_0x52440a['body'][_0xe36820[0x1]]=_0x43722d;}}_0x11528f[_0xca44('0x18')]();});}}catch(_0xb0ac6c){logger['error'](_0xca44('0x9'),_0x372a47,_[_0xca44('0x19')](_0xb0ac6c)?JSON[_0xca44('0x1a')](_0xb0ac6c):_0xb0ac6c);logger['info'](_0xca44('0xd'),_0x372a47);_0x11528f[_0xca44('0x18')]();}};}; \ 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 c2fb67c..3cad33a 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 _0xbbb0=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','map','message','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','[%s][TAG]\x20%s','stringify','isObject','validate','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x588f41,_0x4b7dbd){var _0x3b5aa8=function(_0x133053){while(--_0x133053){_0x588f41['push'](_0x588f41['shift']());}};_0x3b5aa8(++_0x4b7dbd);}(_0xbbb0,0x1c6));var _0x0bbb=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xbbb0[_0x9aada2];return _0x196dff;};'use strict';var schema=require(_0x0bbb('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x0bbb('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x0bbb('0x2')),'mailInteraction':require(_0x0bbb('0x3')),'faxInteraction':require(_0x0bbb('0x4')),'whatsappInteraction':require(_0x0bbb('0x5'))};var logger=require(_0x0bbb('0x6'))(_0x0bbb('0x7'));var tag=schema({'tag':{'type':_0x0bbb('0x8'),'required':!![],'message':_0x0bbb('0x9')}});exports[_0x0bbb('0xa')]=function(_0x3f5f9f,_0x32aa6b,_0x1e8ece,_0x2ba2bb){return function(_0xf8acfa){try{var _0x2b380b={'tag':_0x32aa6b[0x0]};var _0x3dbf78=tag[_0x0bbb('0x0')](_0x2b380b,{'typecast':!![]});if(_0x3dbf78['length']){logger[_0x0bbb('0xb')]('[%s][TAG]\x20%s',_0x3f5f9f,_[_0x0bbb('0xc')](_0x3dbf78,_0x0bbb('0xd'))['join'](',\x20'));logger[_0x0bbb('0xe')](_0x0bbb('0xf'),_0x3f5f9f);_0xf8acfa[_0x0bbb('0x10')]();}else{var _0x31d07f={'ids':[_0x32aa6b[0x0]]};if(rpc[_0x2ba2bb[_0x0bbb('0x11')]+_0x0bbb('0x12')]){rpc[_0x2ba2bb['channel']+_0x0bbb('0x12')][_0x0bbb('0x13')](_0x2ba2bb['interaction']['id'],_0x31d07f)[_0x0bbb('0x14')](function(_0x1bc7dc){logger[_0x0bbb('0xe')](_0x0bbb('0x15'),_0x3f5f9f,_0x32aa6b[0x1],_0x2ba2bb[_0x0bbb('0x11')],_0x2ba2bb[_0x0bbb('0x16')]['id']);})[_0x0bbb('0x17')](function(_0xc3ff9d){logger[_0x0bbb('0xb')](_0x0bbb('0x18'),_0x3f5f9f,JSON[_0x0bbb('0x19')](_0xc3ff9d));logger[_0x0bbb('0xe')](_0x0bbb('0xf'),_0x3f5f9f);})['finally'](function(){_0xf8acfa[_0x0bbb('0x10')]();});}}}catch(_0x2e7c95){logger[_0x0bbb('0xb')](_0x0bbb('0x18'),_0x3f5f9f,_[_0x0bbb('0x1a')](_0x2e7c95)?JSON[_0x0bbb('0x19')](_0x2e7c95):_0x2e7c95);logger[_0x0bbb('0xe')](_0x0bbb('0xf'),_0x3f5f9f);_0xf8acfa[_0x0bbb('0x10')]();}};}; \ No newline at end of file +var _0x2f64=['../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','Interaction','channel','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash'];(function(_0x584f66,_0x39a037){var _0x3908b4=function(_0x452df3){while(--_0x452df3){_0x584f66['push'](_0x584f66['shift']());}};_0x3908b4(++_0x39a037);}(_0x2f64,0x1c9));var _0x42f6=function(_0x527aab,_0x1bb5d8){_0x527aab=_0x527aab-0x0;var _0x549ef1=_0x2f64[_0x527aab];return _0x549ef1;};'use strict';var schema=require(_0x42f6('0x0'));var _=require(_0x42f6('0x1'));var rpc={'chatInteraction':require(_0x42f6('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x42f6('0x3')),'mailInteraction':require(_0x42f6('0x4')),'faxInteraction':require(_0x42f6('0x5')),'whatsappInteraction':require(_0x42f6('0x6'))};var logger=require(_0x42f6('0x7'))(_0x42f6('0x8'));var tag=schema({'tag':{'type':_0x42f6('0x9'),'required':!![],'message':_0x42f6('0xa')}});exports[_0x42f6('0xb')]=function(_0x4dbe82,_0x4c5586,_0x2ec871,_0x4da5b5){return function(_0x435790){try{var _0x49b34a={'tag':_0x4c5586[0x0]};var _0x45d609=tag[_0x42f6('0x0')](_0x49b34a,{'typecast':!![]});if(_0x45d609['length']){logger['error'](_0x42f6('0xc'),_0x4dbe82,_[_0x42f6('0xd')](_0x45d609,'message')[_0x42f6('0xe')](',\x20'));logger[_0x42f6('0xf')](_0x42f6('0x10'),_0x4dbe82);_0x435790[_0x42f6('0x11')]();}else{var _0x3e200e={'ids':[_0x4c5586[0x0]]};if(rpc[_0x4da5b5['channel']+_0x42f6('0x12')]){rpc[_0x4da5b5[_0x42f6('0x13')]+_0x42f6('0x12')]['addTags'](_0x4da5b5[_0x42f6('0x14')]['id'],_0x3e200e)[_0x42f6('0x15')](function(_0x174618){logger['info'](_0x42f6('0x16'),_0x4dbe82,_0x4c5586[0x1],_0x4da5b5['channel'],_0x4da5b5[_0x42f6('0x14')]['id']);})[_0x42f6('0x17')](function(_0x24af2b){logger['error'](_0x42f6('0xc'),_0x4dbe82,JSON[_0x42f6('0x18')](_0x24af2b));logger[_0x42f6('0xf')](_0x42f6('0x10'),_0x4dbe82);})[_0x42f6('0x19')](function(){_0x435790[_0x42f6('0x11')]();});}}}catch(_0x499677){logger['error'](_0x42f6('0xc'),_0x4dbe82,_[_0x42f6('0x1a')](_0x499677)?JSON[_0x42f6('0x18')](_0x499677):_0x499677);logger[_0x42f6('0xf')](_0x42f6('0x10'),_0x4dbe82);_0x435790[_0x42f6('0x11')]();}};}; \ 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 d58db91..f47f0a0 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 _0xa2ca=['login','params','utf8','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method'];(function(_0x461cea,_0x31ee88){var _0x22772e=function(_0x4ed6b4){while(--_0x4ed6b4){_0x461cea['push'](_0x461cea['shift']());}};_0x22772e(++_0x31ee88);}(_0xa2ca,0x9a));var _0xaa2c=function(_0x5bc05a,_0x23f34f){_0x5bc05a=_0x5bc05a-0x0;var _0x37fcf3=_0xa2ca[_0x5bc05a];return _0x37fcf3;};'use strict';var rp=require(_0xaa2c('0x0'));var logger=require(_0xaa2c('0x1'))(_0xaa2c('0x2'));var _=require(_0xaa2c('0x3'));var arr=[];exports[_0xaa2c('0x4')]=function(_0x3d66b9,_0x31f128){return function(_0x32228a){var _0x207cfc=_0x31f128[0xa];var _0x18050b=_0x31f128[0xb];var _0x449c7c=_0x31f128[0xc];var _0xebaa42=_0x31f128[0xd];var _0x23406d=_0x31f128[0xe];var _0x4131b3=_0x31f128[0xf][_0xaa2c('0x5')](/\n/g,_0xaa2c('0x6'));var _0x201d43=_0x31f128[0x10][_0xaa2c('0x5')](/\n/g,'\x20');if(!arr[_0xaa2c('0x7')](_0x18050b)){arr[_0xaa2c('0x8')](_0x18050b);var _0x3d23b5=_0x31f128[0x3];var _0x159ba7=_0x31f128[0x4];var _0x35806d=_0x31f128[0x1];var _0x506e0b=_0x31f128[0x0];var _0x5c26e2={};_0x5c26e2[_0xaa2c('0x9')]=_0x31f128[0x8]+_0xaa2c('0xa')+_0x449c7c+'|'+_0x207cfc+'|'+_0xebaa42+'|'+_0x18050b+'|'+_0x23406d;_0x5c26e2[_0xaa2c('0xb')]=_0x31f128[0x7]+_0xaa2c('0xa')+_0x449c7c+'|'+_0x207cfc+'|'+_0xebaa42+'|'+_0x18050b+'|'+_0x23406d+'|'+_0x4131b3+'|'+_0x201d43;_0x5c26e2[_0xaa2c('0xc')]=_0x31f128[0x9];var _0x43d69a={};_0x43d69a[_0xaa2c('0xd')]=_0xaa2c('0xe');_0x43d69a[_0xaa2c('0xf')]=_0xaa2c('0x10');var _0x41dd6d=[];_0x41dd6d[_0xaa2c('0x8')](_0x31f128[0x2]);_0x41dd6d['push'](_0x31f128[0x5]);_0x41dd6d[_0xaa2c('0x8')](_0x31f128[0x6]);_0x43d69a[_0xaa2c('0x11')]=_0x41dd6d;_0x43d69a['id']=0x1;var _0x38cdfc=JSON['stringify'](_0x43d69a);var _0x150965={'encoding':_0xaa2c('0x12'),'method':'POST','timeout':0x2710,'url':_0x3d23b5,'headers':{'Content-Type':_0xaa2c('0x13')},'body':_0x38cdfc};return rp(_0x150965)[_0xaa2c('0x14')](function(_0xbb5906){const _0x59573c=JSON[_0xaa2c('0x15')](_0xbb5906);if(!_0x59573c[_0xaa2c('0x16')]['logged']){throw new Error(_0xaa2c('0x17'));}var _0x5d0fbc=_0x18050b;var _0x31738c='channelId='+_0x35806d+'&serviceId='+_0x506e0b+_0xaa2c('0x18')+_0x5d0fbc+_0xaa2c('0x19')+JSON[_0xaa2c('0x1a')](_0x5c26e2);var _0x112d81=_0x159ba7+'?'+_0x31738c;return rp(_0x112d81);})[_0xaa2c('0x14')](function(_0x5c011d){logger[_0xaa2c('0x1b')](_0xaa2c('0x1c'),_0x3d66b9,_0x5c011d);_0x32228a[_0xaa2c('0x1d')]();})['catch'](function(_0x4c511d){logger['error'](_0xaa2c('0x1e'),_0x3d66b9,_[_0xaa2c('0x1f')](_0x4c511d)?JSON[_0xaa2c('0x1a')](_0x4c511d):_0x4c511d);_0x32228a[_0xaa2c('0x1d')]();});}else{logger['info'](_0xaa2c('0x20'),_0x3d66b9);_0x32228a[_0xaa2c('0x21')]();}};}; \ No newline at end of file +var _0xb583=['[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','lodash','consequence','replace','\x20-\x20','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','method','login','push','stringify','utf8','application/json-rpc','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject'];(function(_0x224616,_0x563fc1){var _0x3049af=function(_0x24512a){while(--_0x24512a){_0x224616['push'](_0x224616['shift']());}};_0x3049af(++_0x563fc1);}(_0xb583,0x1c2));var _0x3b58=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb583[_0x5b644e];return _0x49c6bf;};'use strict';var rp=require(_0x3b58('0x0'));var logger=require('../../../../config/logger')('routing');var _=require(_0x3b58('0x1'));var arr=[];exports[_0x3b58('0x2')]=function(_0x3bc97a,_0x2643a8){return function(_0x44e09a){var _0xb89679=_0x2643a8[0xa];var _0x384609=_0x2643a8[0xb];var _0x5e81c5=_0x2643a8[0xc];var _0x3614e4=_0x2643a8[0xd];var _0xf865ba=_0x2643a8[0xe];var _0x6bcfb4=_0x2643a8[0xf][_0x3b58('0x3')](/\n/g,_0x3b58('0x4'));var _0x2fcde4=_0x2643a8[0x10][_0x3b58('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x384609)){arr['push'](_0x384609);var _0x5e649c=_0x2643a8[0x3];var _0x345f2e=_0x2643a8[0x4];var _0x6fa925=_0x2643a8[0x1];var _0xb9668f=_0x2643a8[0x0];var _0x422fc3={};_0x422fc3[_0x3b58('0x5')]=_0x2643a8[0x8]+_0x3b58('0x6')+_0x5e81c5+'|'+_0xb89679+'|'+_0x3614e4+'|'+_0x384609+'|'+_0xf865ba;_0x422fc3[_0x3b58('0x7')]=_0x2643a8[0x7]+'?params='+_0x5e81c5+'|'+_0xb89679+'|'+_0x3614e4+'|'+_0x384609+'|'+_0xf865ba+'|'+_0x6bcfb4+'|'+_0x2fcde4;_0x422fc3[_0x3b58('0x8')]=_0x2643a8[0x9];var _0x419f4d={};_0x419f4d[_0x3b58('0x9')]='2.0';_0x419f4d[_0x3b58('0xa')]=_0x3b58('0xb');var _0x59923e=[];_0x59923e['push'](_0x2643a8[0x2]);_0x59923e['push'](_0x2643a8[0x5]);_0x59923e[_0x3b58('0xc')](_0x2643a8[0x6]);_0x419f4d['params']=_0x59923e;_0x419f4d['id']=0x1;var _0xd59403=JSON[_0x3b58('0xd')](_0x419f4d);var _0x207a27={'encoding':_0x3b58('0xe'),'method':'POST','timeout':0x2710,'url':_0x5e649c,'headers':{'Content-Type':_0x3b58('0xf')},'body':_0xd59403};return rp(_0x207a27)['then'](function(_0x2d0728){const _0x35a25a=JSON[_0x3b58('0x10')](_0x2d0728);if(!_0x35a25a[_0x3b58('0x11')][_0x3b58('0x12')]){throw new Error(_0x3b58('0x13'));}var _0x11681b=_0x384609;var _0x3dc0b9=_0x3b58('0x14')+_0x6fa925+'&serviceId='+_0xb9668f+_0x3b58('0x15')+_0x11681b+'&data='+JSON[_0x3b58('0xd')](_0x422fc3);var _0x25201c=_0x345f2e+'?'+_0x3dc0b9;return rp(_0x25201c);})[_0x3b58('0x16')](function(_0x581171){logger[_0x3b58('0x17')](_0x3b58('0x18'),_0x3bc97a,_0x581171);_0x44e09a[_0x3b58('0x19')]();})[_0x3b58('0x1a')](function(_0x2f4079){logger[_0x3b58('0x1b')](_0x3b58('0x1c'),_0x3bc97a,_[_0x3b58('0x1d')](_0x2f4079)?JSON[_0x3b58('0xd')](_0x2f4079):_0x2f4079);_0x44e09a[_0x3b58('0x19')]();});}else{logger[_0x3b58('0x17')](_0x3b58('0x1e'),_0x3bc97a);_0x44e09a[_0x3b58('0x1f')]();}};}; \ 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 8eb96f6..118f1ba 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(_0x4aa3d9,_0x34d948){var _0x14d216=function(_0x2ac7ea){while(--_0x2ac7ea){_0x4aa3d9['push'](_0x4aa3d9['shift']());}};_0x14d216(++_0x34d948);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x3e43ec,_0x11e681){var _0x382b46=function(_0x4a528e){while(--_0x4a528e){_0x3e43ec['push'](_0x3e43ec['shift']());}};_0x382b46(++_0x11e681);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 97d2588..9a895fe 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 _0xfae3=['notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','./applications/','Push\x20new\x20rule','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','find','chatQueues','available','paused','waiting','mailQueues','loggedIn','openchannelQueues','name','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','transfer','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflowv2','amazonlex','tag','TagId','tvox','account'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfae3,0xa1));var _0x3fae=function(_0x5a57a3,_0x2a7018){_0x5a57a3=_0x5a57a3-0x0;var _0x2ef960=_0xfae3[_0x5a57a3];return _0x2ef960;};'use strict';var _=require(_0x3fae('0x0'));var util=require(_0x3fae('0x1'));var path=require(_0x3fae('0x2'));var fs=require('fs');var jayson=require(_0x3fae('0x3'));var BPromise=require(_0x3fae('0x4'));var utils=require(_0x3fae('0x5'));var sUtils=require(_0x3fae('0x6'));var logger=require(_0x3fae('0x7'))(_0x3fae('0x8'));var rpc={'openchannelQueueReport':require(_0x3fae('0x9')),'mailQueueReport':require(_0x3fae('0xa')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x3fae('0xb')),'faxQueueReport':require(_0x3fae('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x28c778,_0x1f5ce2,_0x4a5f5c){return util[_0x3fae('0xd')](_0x3fae('0xe'),_0x28c778,_0x1f5ce2||0x0,_0x4a5f5c||0x0);}function getIntervals(_0x140ab3,_0x145e13){var _0x464cd8=[];if(!_[_0x3fae('0xf')](_0x145e13[_0x3fae('0x10')])&&!_[_0x3fae('0xf')](_0x140ab3[_0x145e13[_0x3fae('0x10')]])&&!_[_0x3fae('0xf')](_0x140ab3[_0x145e13[_0x3fae('0x10')]][_0x3fae('0x11')])){_0x464cd8=_[_0x3fae('0x12')](_0x140ab3[_0x145e13['IntervalId']][_0x3fae('0x11')],'interval');}else if(!_[_0x3fae('0xf')](_0x145e13[_0x3fae('0x13')])){_0x464cd8=[_0x145e13[_0x3fae('0x13')]];}return _0x464cd8;}exports[_0x3fae('0x14')]=function(_0x29b7e9){_0x29b7e9[_0x3fae('0x15')]={};return new BPromise(function(_0x13e5f0,_0x10afd4){var _0x390e74={'Start':function(_0x156464){var _0x22fb9f=this;return new Promise(function(_0x20513e,_0x341c61){if(_0x156464){try{var _0x38b6c1=[];var _0x1c32b0=getId(_0x156464[_0x3fae('0x16')],_0x156464[_0x3fae('0x17')]?_0x156464[_0x3fae('0x17')]['id']:0x0,_0x156464[_0x3fae('0x18')]?_0x156464[_0x3fae('0x18')]['id']:0x0);var _0x552f00=sUtils['checkWaitingNotifications'](_0x29b7e9,_0x156464);if(_0x156464[_0x3fae('0x19')]||!_0x552f00&&_0x156464[_0x3fae('0x1a')]&&_[_0x3fae('0x1b')](_0x156464['applications'])&&_0x156464[_0x3fae('0x1a')][_0x3fae('0x1c')]){for(var _0x4072fa=0x0;_0x4072fa<_0x156464[_0x3fae('0x1a')]['length'];_0x4072fa+=0x1){var _0x5aeb51=_0x156464[_0x3fae('0x1a')][_0x4072fa];if(fs[_0x3fae('0x1d')](path[_0x3fae('0x1e')](__dirname,_0x3fae('0x1a'),_0x5aeb51[_0x3fae('0x1f')]+_0x3fae('0x20')))){var _0xfe450b=[];switch(_0x5aeb51[_0x3fae('0x1f')][_0x3fae('0x21')]()){case _0x3fae('0x22'):var _0x10b996=_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');if(_0x156464[_0x3fae('0x16')]==='mail'){_0xfe450b[_0x3fae('0x25')](_0x10b996[0x0]);_0xfe450b[_0x3fae('0x25')](_0x10b996[0x1]);_0xfe450b[_0x3fae('0x25')](_0x10b996[_0x3fae('0x26')](0x2,_0x10b996[_0x3fae('0x1c')])[_0x3fae('0x1e')](','));}else{_0xfe450b[_0x3fae('0x25')](_0x10b996[0x0]);_0xfe450b[_0x3fae('0x25')](_0x10b996[_0x3fae('0x26')](0x1,_0x10b996['length'])[_0x3fae('0x1e')](','));}break;case'dialogflow':var _0x403e40=_0x5aeb51[_0x3fae('0x23')]['split'](',');_0xfe450b[_0x3fae('0x25')](_0x403e40[0x0]);_0xfe450b[_0x3fae('0x25')](_0x403e40[0x1]);_0xfe450b['push'](_0x403e40[_0x3fae('0x26')](0x2,_0x403e40[_0x3fae('0x1c')])[_0x3fae('0x1e')](','));break;case _0x3fae('0x27'):var _0x40e355=_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');_0xfe450b[_0x3fae('0x25')](_0x40e355[0x0]);_0xfe450b[_0x3fae('0x25')](_0x40e355[0x1]);_0xfe450b[_0x3fae('0x25')](_0x40e355[0x2]);_0xfe450b[_0x3fae('0x25')](_0x40e355[0x3]);_0xfe450b['push'](_0x40e355[_0x3fae('0x26')](0x4,_0x40e355[_0x3fae('0x1c')])[_0x3fae('0x1e')](','));break;case _0x3fae('0x28'):var _0x5a1bf3=_0x5aeb51[_0x3fae('0x23')]['split'](',');_0xfe450b['push'](_0x5a1bf3[0x0]);_0xfe450b[_0x3fae('0x25')](_0x5a1bf3[0x1]);_0xfe450b['push'](_0x5a1bf3[0x2]);_0xfe450b['push'](_0x5a1bf3[0x3]);_0xfe450b['push'](_0x5a1bf3[_0x3fae('0x26')](0x4,_0x5a1bf3['length'])[_0x3fae('0x1e')](','));break;case _0x3fae('0x17'):_0xfe450b[_0x3fae('0x25')](_0x5aeb51[_0x3fae('0x23')]);break;case _0x3fae('0x29'):_0xfe450b['push'](_0x5aeb51[_0x3fae('0x2a')]);_0xfe450b[_0x3fae('0x25')](_0x5aeb51[_0x3fae('0x23')]);break;case _0x3fae('0x2b'):var _0x3def7a=utils['getMustacheRender'](_0x156464[_0x3fae('0x2c')][_0x3fae('0x2d')],_0x156464);var _0x3ff3de=_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');_0xfe450b['push'](_0x3ff3de[0x0]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x1]);_0xfe450b['push'](_0x3ff3de[0x2]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x3]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x4]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x5]);_0xfe450b['push'](_0x3ff3de[0x6]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x7]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x8]);_0xfe450b[_0x3fae('0x25')](_0x3ff3de[0x9]);_0xfe450b['push'](_0x3ff3de[0xa]);_0xfe450b['push'](_0x156464[_0x3fae('0x18')]['id']);_0xfe450b[_0x3fae('0x25')](_0x156464[_0x3fae('0x17')]['id']);_0xfe450b['push'](_0x5aeb51[_0x3fae('0x2e')]);_0xfe450b[_0x3fae('0x25')](_0x156464[_0x3fae('0x18')][_0x3fae('0x2f')]);_0xfe450b['push'](_0x156464[_0x3fae('0x30')][_0x3fae('0x30')]);_0xfe450b[_0x3fae('0x25')](_0x3def7a);break;default:_0xfe450b=_[_0x3fae('0xf')](_0x5aeb51['appdata'])?[]:_0x5aeb51[_0x3fae('0x23')][_0x3fae('0x24')](',');}var _0x1bbdec={'id':util[_0x3fae('0xd')](_0x3fae('0x31'),_0x1c32b0,_0x5aeb51['id'],_0x5aeb51['app']),'condition':require(_0x3fae('0x32'))[_0x3fae('0x33')](_0x1c32b0,getIntervals(_0x29b7e9['intervals'],_0x5aeb51),_0x29b7e9),'consequence':require(_0x3fae('0x34')+_0x5aeb51[_0x3fae('0x1f')])['consequence'](_0x1c32b0,_0xfe450b,_0x29b7e9,_0x156464),'p':_0x5aeb51['priority']||0x0};logger['info'](_0x3fae('0x35'),_0x1bbdec['id'],_0x3fae('0x36'),getIntervals(_0x29b7e9[_0x3fae('0x37')],_0x5aeb51)[_0x3fae('0x1e')]('\x20|\x20'));_0x38b6c1[_0x3fae('0x25')](_0x1bbdec);}else{logger[_0x3fae('0x38')](_0x3fae('0x39'),path['join'](__dirname,_0x3fae('0x1a'),_0x5aeb51[_0x3fae('0x1f')]+_0x3fae('0x20')));}}_0x29b7e9['rules'][_0x1c32b0]=new RuleEngine(_0x38b6c1);_0x29b7e9[_0x3fae('0x15')][_0x1c32b0][_0x3fae('0x3a')](_0x156464,function(_0x2153f1){logger[_0x3fae('0x3b')]('Applications\x20executed',JSON[_0x3fae('0x3c')](_0x2153f1[_0x3fae('0x3d')]));if(_0x29b7e9[_0x3fae('0x15')][_0x1c32b0]){_0x29b7e9['rules'][_0x1c32b0][_0x3fae('0x3e')](_0x3fae('0x3f'));}});return _0x20513e({'code':0xc8,'message':_0x156464});}else{if(_0x552f00){logger[_0x3fae('0x3b')](util[_0x3fae('0xd')](_0x3fae('0x40'),_0x1c32b0));}else{logger['info'](_0x3fae('0x41'));}return _0x20513e({'code':0xc8,'message':_0x156464});}}catch(_0x4b314c){logger['error'](_0x4b314c['stack']);return _0x341c61(_0x22fb9f[_0x3fae('0x38')](0x1f4,_0x4b314c));}}return _0x341c61(_0x3fae('0x42'));});},'AcceptMessage':function(_0x3ce094){var _0x4e3f30=this;return new Promise(function(_0xae27b,_0x207ff1){if(_0x3ce094['agent']&&_0x3ce094[_0x3fae('0x43')]['id']){if(_0x29b7e9[_0x3fae('0x44')][_0x3ce094['agent']['id']]){_0x29b7e9['agents'][_0x3ce094['agent']['id']]['busy']=![];_0x29b7e9[_0x3fae('0x44')][_0x3ce094[_0x3fae('0x43')]['id']]['busyQueue']=undefined;}}if(_0x3ce094[_0x3fae('0x17')]&&_0x3ce094[_0x3fae('0x17')]['id']){try{var _0x1213b5=getId(_0x3ce094[_0x3fae('0x16')],_0x3ce094[_0x3fae('0x17')]?_0x3ce094[_0x3fae('0x17')]['id']:0x0,_0x3ce094[_0x3fae('0x18')]?_0x3ce094['interaction']['id']:0x0);if(_0x29b7e9['rules'][_0x1213b5]){_0x29b7e9['rules'][_0x1213b5][_0x3fae('0x3e')](_0x3fae('0x45'));if(rpc[_0x3ce094[_0x3fae('0x16')]+_0x3fae('0x46')]){rpc[_0x3ce094[_0x3fae('0x16')]+_0x3fae('0x46')][_0x3fae('0x47')](_0x1213b5,{'UserId':_0x3ce094[_0x3fae('0x17')][_0x3fae('0x48')]})[_0x3fae('0x49')](function(){logger['error'](_0x3fae('0x4a'));});}}return _0xae27b({'code':0xc8,'message':_0x3ce094});}catch(_0xfe941a){logger['error'](_0xfe941a[_0x3fae('0x4b')]);return _0x207ff1(_0x4e3f30[_0x3fae('0x38')](0x1f4,_0xfe941a));}}logger[_0x3fae('0x38')](_0x3fae('0x4c'));return _0x207ff1(_0x4e3f30[_0x3fae('0x38')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0xe2ff47){var _0x483323=this;return new Promise(function(_0x229544,_0x420153){if(_0xe2ff47[_0x3fae('0x43')]&&_0xe2ff47[_0x3fae('0x43')]['id']){try{if(_0x29b7e9[_0x3fae('0x44')][_0xe2ff47['agent']['id']]){_0x29b7e9['agents'][_0xe2ff47['agent']['id']]['busy']=![];_0x29b7e9['agents'][_0xe2ff47[_0x3fae('0x43')]['id']][_0x3fae('0x4d')]=undefined;}return _0x229544({'code':0xc8,'message':_0xe2ff47});}catch(_0x5e3aaa){logger[_0x3fae('0x38')](_0x5e3aaa[_0x3fae('0x4b')]);return _0x420153(_0x483323['error'](0x1f4,_0x5e3aaa));}}logger[_0x3fae('0x38')](_0x3fae('0x4c'));return _0x420153(_0x483323[_0x3fae('0x38')](0x1f4,_0x3fae('0x4c')));});},'AbandonInteraction':function(_0xfcc85d){var _0x36f515=this;return new Promise(function(_0x185bde,_0x5c7976){if(_0xfcc85d['channel']&&_0xfcc85d['interaction']&&_0xfcc85d['interaction']['id']){try{var _0xdbd5f1=getId(_0xfcc85d[_0x3fae('0x16')],_0xfcc85d[_0x3fae('0x17')]?_0xfcc85d[_0x3fae('0x17')]['id']:0x0,_0xfcc85d[_0x3fae('0x18')]?_0xfcc85d[_0x3fae('0x18')]['id']:0x0);if(_0x29b7e9[_0x3fae('0x15')][_0xdbd5f1]){_0x29b7e9[_0x3fae('0x15')][_0xdbd5f1][_0x3fae('0x3e')](_0x3fae('0x45'));}return _0x185bde({'code':0xc8,'message':_0xfcc85d});}catch(_0x3f9783){logger['error'](_0x3f9783['stack']);return _0x5c7976(_0x36f515[_0x3fae('0x38')](0x1f4,_0x3f9783));}}logger['error'](_0x3fae('0x4c'));return _0x5c7976(_0x36f515['error'](0x1f4,_0x3fae('0x4c')));});},'AgentCapacity':function(_0x28ac0f){var _0x3748dd=this;return new Promise(function(_0x1b8232,_0x38bb77){if(_0x29b7e9['agents'][_0x3fae('0x4e')](_0x28ac0f['id'])){for(var _0x4c3e01 in _0x28ac0f[_0x3fae('0x4f')]){if(_0x28ac0f['capacity']['hasOwnProperty'](_0x4c3e01)){if(_0x29b7e9[_0x3fae('0x44')][_0x28ac0f['id']]['hasOwnProperty'](_0x4c3e01+_0x3fae('0x50'))){_0x29b7e9[_0x3fae('0x44')][_0x28ac0f['id']][_0x4c3e01+_0x3fae('0x50')]=parseInt(_0x28ac0f[_0x3fae('0x4f')][_0x4c3e01],0xa);}}}_0x29b7e9['agents'][_0x28ac0f['id']]['updateRealtime']();return _0x1b8232({'code':0xc8,'message':_0x29b7e9[_0x3fae('0x44')][_0x28ac0f['id']]});}else{return _0x38bb77(_0x3748dd[_0x3fae('0x38')](0x1f4,_0x3fae('0x51')));}});},'Agents':function(_0x1f923e){return new Promise(function(_0x7d6725){var _0x273d5f=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x44')]);if(_0x1f923e&&_0x1f923e['id']){var _0x4d4f8c=_[_0x3fae('0x53')](_0x273d5f,function(_0x5887a0){return _0x5887a0['id']===_0x1f923e['id'];});_0x7d6725(_0x4d4f8c);}else{_0x7d6725({'count':_0x273d5f[_0x3fae('0x1c')],'rows':_0x273d5f});}});},'ChatQueues':function(){return new Promise(function(_0x2f2cd8){var _0x1ab047=[];for(var _0x2c4939 in _0x29b7e9[_0x3fae('0x54')]){if(_0x29b7e9['chatQueues'][_0x3fae('0x4e')](_0x2c4939)){var _0x294526=_0x29b7e9[_0x3fae('0x54')][_0x2c4939];var _0x5da4e7={'id':_0x294526['id'],'available':_0x294526[_0x3fae('0x55')],'loggedIn':_0x294526['loggedIn'],'name':_0x294526['name'],'paused':_0x294526[_0x3fae('0x56')],'waiting':_0x294526[_0x3fae('0x57')]};_0x1ab047[_0x3fae('0x25')](_0x5da4e7);}}_0x2f2cd8({'count':_0x1ab047[_0x3fae('0x1c')],'rows':_0x1ab047});});},'MailQueues':function(){return new Promise(function(_0xb48947){var _0x52538e=[];for(var _0x297073 in _0x29b7e9[_0x3fae('0x58')]){if(_0x29b7e9[_0x3fae('0x58')][_0x3fae('0x4e')](_0x297073)){var _0x39d9ae=_0x29b7e9[_0x3fae('0x58')][_0x297073];var _0x96d872={'id':_0x39d9ae['id'],'available':_0x39d9ae[_0x3fae('0x55')],'loggedIn':_0x39d9ae[_0x3fae('0x59')],'name':_0x39d9ae['name'],'paused':_0x39d9ae[_0x3fae('0x56')],'waiting':_0x39d9ae[_0x3fae('0x57')]};_0x52538e[_0x3fae('0x25')](_0x96d872);}}_0xb48947({'count':_0x52538e[_0x3fae('0x1c')],'rows':_0x52538e});});},'OpenchannelQueues':function(){return new Promise(function(_0x4a9366){var _0x269e41=[];for(var _0x589e95 in _0x29b7e9[_0x3fae('0x5a')]){if(_0x29b7e9[_0x3fae('0x5a')][_0x3fae('0x4e')](_0x589e95)){var _0x37b35c=_0x29b7e9['openchannelQueues'][_0x589e95];var _0x3ca092={'id':_0x37b35c['id'],'available':_0x37b35c[_0x3fae('0x55')],'loggedIn':_0x37b35c[_0x3fae('0x59')],'name':_0x37b35c[_0x3fae('0x5b')],'paused':_0x37b35c[_0x3fae('0x56')],'waiting':_0x37b35c['waiting']};_0x269e41['push'](_0x3ca092);}}_0x4a9366({'count':_0x269e41[_0x3fae('0x1c')],'rows':_0x269e41});});},'SmsQueues':function(){return new Promise(function(_0x8ae4c5){var _0x34005f=[];for(var _0x381b28 in _0x29b7e9['smsQueues']){if(_0x29b7e9[_0x3fae('0x5c')][_0x3fae('0x4e')](_0x381b28)){var _0x5635a2=_0x29b7e9[_0x3fae('0x5c')][_0x381b28];var _0x389ad3={'id':_0x5635a2['id'],'available':_0x5635a2[_0x3fae('0x55')],'loggedIn':_0x5635a2['loggedIn'],'name':_0x5635a2[_0x3fae('0x5b')],'paused':_0x5635a2[_0x3fae('0x56')],'waiting':_0x5635a2[_0x3fae('0x57')]};_0x34005f[_0x3fae('0x25')](_0x389ad3);}}_0x8ae4c5({'count':_0x34005f[_0x3fae('0x1c')],'rows':_0x34005f});});},'FaxQueues':function(){return new Promise(function(_0x41b3d7){var _0x5a39c5=[];for(var _0x359a4e in _0x29b7e9[_0x3fae('0x5d')]){if(_0x29b7e9[_0x3fae('0x5d')][_0x3fae('0x4e')](_0x359a4e)){var _0x152082=_0x29b7e9[_0x3fae('0x5d')][_0x359a4e];var _0x526799={'id':_0x152082['id'],'available':_0x152082[_0x3fae('0x55')],'loggedIn':_0x152082[_0x3fae('0x59')],'name':_0x152082[_0x3fae('0x5b')],'paused':_0x152082[_0x3fae('0x56')],'waiting':_0x152082[_0x3fae('0x57')]};_0x5a39c5[_0x3fae('0x25')](_0x526799);}}_0x41b3d7({'count':_0x5a39c5[_0x3fae('0x1c')],'rows':_0x5a39c5});});},'WhatsappQueues':function(){return new Promise(function(_0x29ac0f){var _0x291eed=[];for(var _0xcd9f67 in _0x29b7e9[_0x3fae('0x5e')]){if(_0x29b7e9[_0x3fae('0x5e')][_0x3fae('0x4e')](_0xcd9f67)){var _0x4be20d=_0x29b7e9[_0x3fae('0x5e')][_0xcd9f67];var _0x2e16bf={'id':_0x4be20d['id'],'available':_0x4be20d['available'],'loggedIn':_0x4be20d['loggedIn'],'name':_0x4be20d[_0x3fae('0x5b')],'paused':_0x4be20d[_0x3fae('0x56')],'waiting':_0x4be20d[_0x3fae('0x57')]};_0x291eed['push'](_0x2e16bf);}}_0x29ac0f({'count':_0x291eed[_0x3fae('0x1c')],'rows':_0x291eed});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x5212e2){var _0x417057=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x5f')]);_0x5212e2({'count':_0x417057[_0x3fae('0x1c')],'rows':_0x417057});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x23ab84){var _0x444770=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x60')]);_0x23ab84({'count':_0x444770['length'],'rows':_0x444770});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0xa7eb8b){var _0x4ffcd0=_[_0x3fae('0x52')](_0x29b7e9['openchannelQueuesWaitingInteractions']);_0xa7eb8b({'count':_0x4ffcd0['length'],'rows':_0x4ffcd0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3ef7e6){var _0x22ab0a=_[_0x3fae('0x52')](_0x29b7e9[_0x3fae('0x61')]);_0x3ef7e6({'count':_0x22ab0a[_0x3fae('0x1c')],'rows':_0x22ab0a});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x19615d){var _0x2f169d=_['values'](_0x29b7e9[_0x3fae('0x62')]);_0x19615d({'count':_0x2f169d[_0x3fae('0x1c')],'rows':_0x2f169d});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x21d1f7){var _0x235c4a=_['values'](_0x29b7e9['whatsappQueuesWaitingInteractions']);_0x21d1f7({'count':_0x235c4a[_0x3fae('0x1c')],'rows':_0x235c4a});});}};var _0x30bbf5=jayson[_0x3fae('0x63')](_0x390e74)[_0x3fae('0x64')]();_0x30bbf5['on'](_0x3fae('0x38'),function(_0x28855f){logger[_0x3fae('0x38')](JSON[_0x3fae('0x3c')](_0x28855f));return _0x10afd4(_0x28855f);});_0x30bbf5[_0x3fae('0x14')](0x232c,_0x3fae('0x65'),function(){console[_0x3fae('0x66')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x13e5f0('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xcac3=['listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','isArray','existsSync','join','app','appdata','split','mail','push','slice','length','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','127.0.0.1','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval'];(function(_0x3e7b39,_0x2c2110){var _0x4ad001=function(_0x3fd134){while(--_0x3fd134){_0x3e7b39['push'](_0x3e7b39['shift']());}};_0x4ad001(++_0x2c2110);}(_0xcac3,0x193));var _0x3cac=function(_0x11be52,_0x2ef4f4){_0x11be52=_0x11be52-0x0;var _0x5b0bf8=_0xcac3[_0x11be52];return _0x5b0bf8;};'use strict';var _=require('lodash');var util=require(_0x3cac('0x0'));var path=require(_0x3cac('0x1'));var fs=require('fs');var jayson=require(_0x3cac('0x2'));var BPromise=require(_0x3cac('0x3'));var utils=require(_0x3cac('0x4'));var sUtils=require(_0x3cac('0x5'));var logger=require(_0x3cac('0x6'))(_0x3cac('0x7'));var rpc={'openchannelQueueReport':require(_0x3cac('0x8')),'mailQueueReport':require(_0x3cac('0x9')),'chatQueueReport':require(_0x3cac('0xa')),'smsQueueReport':require(_0x3cac('0xb')),'faxQueueReport':require(_0x3cac('0xc')),'whatsappQueueReport':require(_0x3cac('0xd'))};var RuleEngine=require(_0x3cac('0xe'));function getId(_0x21365c,_0x13c1b9,_0x55670d){return util[_0x3cac('0xf')](_0x3cac('0x10'),_0x21365c,_0x13c1b9||0x0,_0x55670d||0x0);}function getIntervals(_0x3bcbed,_0x306664){var _0x131e0d=[];if(!_['isNil'](_0x306664[_0x3cac('0x11')])&&!_[_0x3cac('0x12')](_0x3bcbed[_0x306664[_0x3cac('0x11')]])&&!_[_0x3cac('0x12')](_0x3bcbed[_0x306664[_0x3cac('0x11')]]['Intervals'])){_0x131e0d=_['map'](_0x3bcbed[_0x306664[_0x3cac('0x11')]][_0x3cac('0x13')],_0x3cac('0x14'));}else if(!_[_0x3cac('0x12')](_0x306664[_0x3cac('0x14')])){_0x131e0d=[_0x306664[_0x3cac('0x14')]];}return _0x131e0d;}exports[_0x3cac('0x15')]=function(_0x4bee52){_0x4bee52[_0x3cac('0x16')]={};return new BPromise(function(_0x2db008,_0xf24623){var _0x281dfd={'Start':function(_0x4680aa){var _0x8d8927=this;return new Promise(function(_0x202437,_0x37e529){if(_0x4680aa){try{var _0x10fb70=[];var _0x37a233=getId(_0x4680aa[_0x3cac('0x17')],_0x4680aa[_0x3cac('0x18')]?_0x4680aa[_0x3cac('0x18')]['id']:0x0,_0x4680aa[_0x3cac('0x19')]?_0x4680aa[_0x3cac('0x19')]['id']:0x0);var _0x9c768f=sUtils[_0x3cac('0x1a')](_0x4bee52,_0x4680aa);if(_0x4680aa[_0x3cac('0x1b')]||!_0x9c768f&&_0x4680aa[_0x3cac('0x1c')]&&_[_0x3cac('0x1d')](_0x4680aa[_0x3cac('0x1c')])&&_0x4680aa[_0x3cac('0x1c')]['length']){for(var _0x14d84b=0x0;_0x14d84b<_0x4680aa[_0x3cac('0x1c')]['length'];_0x14d84b+=0x1){var _0x1d5d41=_0x4680aa[_0x3cac('0x1c')][_0x14d84b];if(fs[_0x3cac('0x1e')](path[_0x3cac('0x1f')](__dirname,_0x3cac('0x1c'),_0x1d5d41[_0x3cac('0x20')]+'.js'))){var _0x19010f=[];switch(_0x1d5d41['app']['toLowerCase']()){case'autoreply':var _0xf63f1d=_0x1d5d41[_0x3cac('0x21')][_0x3cac('0x22')](',');if(_0x4680aa[_0x3cac('0x17')]===_0x3cac('0x23')){_0x19010f[_0x3cac('0x24')](_0xf63f1d[0x0]);_0x19010f[_0x3cac('0x24')](_0xf63f1d[0x1]);_0x19010f[_0x3cac('0x24')](_0xf63f1d[_0x3cac('0x25')](0x2,_0xf63f1d[_0x3cac('0x26')])[_0x3cac('0x1f')](','));}else{_0x19010f[_0x3cac('0x24')](_0xf63f1d[0x0]);_0x19010f['push'](_0xf63f1d[_0x3cac('0x25')](0x1,_0xf63f1d[_0x3cac('0x26')])[_0x3cac('0x1f')](','));}break;case _0x3cac('0x27'):var _0xf8ef01=_0x1d5d41[_0x3cac('0x21')][_0x3cac('0x22')](',');_0x19010f[_0x3cac('0x24')](_0xf8ef01[0x0]);_0x19010f[_0x3cac('0x24')](_0xf8ef01[0x1]);_0x19010f[_0x3cac('0x24')](_0xf8ef01[_0x3cac('0x25')](0x2,_0xf8ef01[_0x3cac('0x26')])[_0x3cac('0x1f')](','));break;case _0x3cac('0x28'):var _0x309288=_0x1d5d41[_0x3cac('0x21')][_0x3cac('0x22')](',');_0x19010f[_0x3cac('0x24')](_0x309288[0x0]);_0x19010f[_0x3cac('0x24')](_0x309288[0x1]);_0x19010f[_0x3cac('0x24')](_0x309288[0x2]);_0x19010f[_0x3cac('0x24')](_0x309288[0x3]);_0x19010f[_0x3cac('0x24')](_0x309288[_0x3cac('0x25')](0x4,_0x309288['length'])[_0x3cac('0x1f')](','));break;case _0x3cac('0x29'):var _0x1163d2=_0x1d5d41[_0x3cac('0x21')][_0x3cac('0x22')](',');_0x19010f['push'](_0x1163d2[0x0]);_0x19010f['push'](_0x1163d2[0x1]);_0x19010f[_0x3cac('0x24')](_0x1163d2[0x2]);_0x19010f[_0x3cac('0x24')](_0x1163d2[0x3]);_0x19010f['push'](_0x1163d2[_0x3cac('0x25')](0x4,_0x1163d2['length'])['join'](','));break;case _0x3cac('0x18'):_0x19010f[_0x3cac('0x24')](_0x1d5d41['appdata']);break;case _0x3cac('0x2a'):_0x19010f[_0x3cac('0x24')](_0x1d5d41[_0x3cac('0x2b')]);_0x19010f[_0x3cac('0x24')](_0x1d5d41[_0x3cac('0x21')]);break;case _0x3cac('0x2c'):var _0x1052b6=utils[_0x3cac('0x2d')](_0x4680aa[_0x3cac('0x2e')]['notificationTemplate'],_0x4680aa);var _0x481c72=_0x1d5d41[_0x3cac('0x21')][_0x3cac('0x22')](',');_0x19010f[_0x3cac('0x24')](_0x481c72[0x0]);_0x19010f[_0x3cac('0x24')](_0x481c72[0x1]);_0x19010f[_0x3cac('0x24')](_0x481c72[0x2]);_0x19010f[_0x3cac('0x24')](_0x481c72[0x3]);_0x19010f[_0x3cac('0x24')](_0x481c72[0x4]);_0x19010f[_0x3cac('0x24')](_0x481c72[0x5]);_0x19010f['push'](_0x481c72[0x6]);_0x19010f[_0x3cac('0x24')](_0x481c72[0x7]);_0x19010f[_0x3cac('0x24')](_0x481c72[0x8]);_0x19010f['push'](_0x481c72[0x9]);_0x19010f[_0x3cac('0x24')](_0x481c72[0xa]);_0x19010f[_0x3cac('0x24')](_0x4680aa[_0x3cac('0x19')]['id']);_0x19010f['push'](_0x4680aa['message']['id']);_0x19010f[_0x3cac('0x24')](_0x1d5d41[_0x3cac('0x2f')]);_0x19010f[_0x3cac('0x24')](_0x4680aa[_0x3cac('0x19')][_0x3cac('0x30')]);_0x19010f[_0x3cac('0x24')](_0x4680aa[_0x3cac('0x31')][_0x3cac('0x31')]);_0x19010f[_0x3cac('0x24')](_0x1052b6);break;default:_0x19010f=_[_0x3cac('0x12')](_0x1d5d41[_0x3cac('0x21')])?[]:_0x1d5d41[_0x3cac('0x21')][_0x3cac('0x22')](',');}var _0x5320c3={'id':util[_0x3cac('0xf')]('%s:%s:%s',_0x37a233,_0x1d5d41['id'],_0x1d5d41[_0x3cac('0x20')]),'condition':require(_0x3cac('0x32'))[_0x3cac('0x33')](_0x37a233,getIntervals(_0x4bee52[_0x3cac('0x34')],_0x1d5d41),_0x4bee52),'consequence':require(_0x3cac('0x35')+_0x1d5d41['app'])[_0x3cac('0x36')](_0x37a233,_0x19010f,_0x4bee52,_0x4680aa),'p':_0x1d5d41[_0x3cac('0x37')]||0x0};logger[_0x3cac('0x38')](_0x3cac('0x39'),_0x5320c3['id'],_0x3cac('0x3a'),getIntervals(_0x4bee52[_0x3cac('0x34')],_0x1d5d41)[_0x3cac('0x1f')](_0x3cac('0x3b')));_0x10fb70[_0x3cac('0x24')](_0x5320c3);}else{logger[_0x3cac('0x3c')](_0x3cac('0x3d'),path[_0x3cac('0x1f')](__dirname,'applications',_0x1d5d41['app']+_0x3cac('0x3e')));}}_0x4bee52[_0x3cac('0x16')][_0x37a233]=new RuleEngine(_0x10fb70);_0x4bee52['rules'][_0x37a233][_0x3cac('0x3f')](_0x4680aa,function(_0x31c363){logger['info'](_0x3cac('0x40'),JSON[_0x3cac('0x41')](_0x31c363[_0x3cac('0x42')]));if(_0x4bee52[_0x3cac('0x16')][_0x37a233]){_0x4bee52[_0x3cac('0x16')][_0x37a233][_0x3cac('0x43')](_0x3cac('0x44'));}});return _0x202437({'code':0xc8,'message':_0x4680aa});}else{if(_0x9c768f){logger[_0x3cac('0x38')](util['format'](_0x3cac('0x45'),_0x37a233));}else{logger['info']('No\x20applications\x20to\x20execute');}return _0x202437({'code':0xc8,'message':_0x4680aa});}}catch(_0x3c6cac){logger[_0x3cac('0x3c')](_0x3c6cac['stack']);return _0x37e529(_0x8d8927[_0x3cac('0x3c')](0x1f4,_0x3c6cac));}}return _0x37e529(_0x3cac('0x46'));});},'AcceptMessage':function(_0xe841fd){var _0x3888c1=this;return new Promise(function(_0x1cdd22,_0x49f065){if(_0xe841fd[_0x3cac('0x47')]&&_0xe841fd[_0x3cac('0x47')]['id']){if(_0x4bee52['agents'][_0xe841fd[_0x3cac('0x47')]['id']]){_0x4bee52[_0x3cac('0x48')][_0xe841fd[_0x3cac('0x47')]['id']][_0x3cac('0x49')]=![];_0x4bee52['agents'][_0xe841fd[_0x3cac('0x47')]['id']][_0x3cac('0x4a')]=undefined;}}if(_0xe841fd[_0x3cac('0x18')]&&_0xe841fd[_0x3cac('0x18')]['id']){try{var _0x1260c6=getId(_0xe841fd['channel'],_0xe841fd[_0x3cac('0x18')]?_0xe841fd[_0x3cac('0x18')]['id']:0x0,_0xe841fd[_0x3cac('0x19')]?_0xe841fd['interaction']['id']:0x0);if(_0x4bee52[_0x3cac('0x16')][_0x1260c6]){_0x4bee52[_0x3cac('0x16')][_0x1260c6][_0x3cac('0x43')](_0x3cac('0x4b'));if(rpc[_0xe841fd['channel']+_0x3cac('0x4c')]){rpc[_0xe841fd[_0x3cac('0x17')]+'QueueReport'][_0x3cac('0x4d')](_0x1260c6,{'UserId':_0xe841fd['message'][_0x3cac('0x4e')]})[_0x3cac('0x4f')](function(){logger[_0x3cac('0x3c')]('error\x20update\x20queue\x20report');});}}return _0x1cdd22({'code':0xc8,'message':_0xe841fd});}catch(_0x503fca){logger['error'](_0x503fca[_0x3cac('0x50')]);return _0x49f065(_0x3888c1[_0x3cac('0x3c')](0x1f4,_0x503fca));}}logger['error'](_0x3cac('0x51'));return _0x49f065(_0x3888c1[_0x3cac('0x3c')](0x1f4,_0x3cac('0x51')));});},'RejectMessage':function(_0x5c0d01){var _0x5df2bd=this;return new Promise(function(_0x4edfed,_0x58f145){if(_0x5c0d01[_0x3cac('0x47')]&&_0x5c0d01[_0x3cac('0x47')]['id']){try{if(_0x4bee52['agents'][_0x5c0d01[_0x3cac('0x47')]['id']]){_0x4bee52[_0x3cac('0x48')][_0x5c0d01[_0x3cac('0x47')]['id']][_0x3cac('0x49')]=![];_0x4bee52['agents'][_0x5c0d01[_0x3cac('0x47')]['id']]['busyQueue']=undefined;}return _0x4edfed({'code':0xc8,'message':_0x5c0d01});}catch(_0x1dd31a){logger[_0x3cac('0x3c')](_0x1dd31a['stack']);return _0x58f145(_0x5df2bd['error'](0x1f4,_0x1dd31a));}}logger[_0x3cac('0x3c')](_0x3cac('0x51'));return _0x58f145(_0x5df2bd['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5afc73){var _0x2e5b6a=this;return new Promise(function(_0xfcddd4,_0x2607aa){if(_0x5afc73[_0x3cac('0x17')]&&_0x5afc73[_0x3cac('0x19')]&&_0x5afc73[_0x3cac('0x19')]['id']){try{var _0x4c42ba=getId(_0x5afc73[_0x3cac('0x17')],_0x5afc73[_0x3cac('0x18')]?_0x5afc73[_0x3cac('0x18')]['id']:0x0,_0x5afc73[_0x3cac('0x19')]?_0x5afc73[_0x3cac('0x19')]['id']:0x0);if(_0x4bee52[_0x3cac('0x16')][_0x4c42ba]){_0x4bee52[_0x3cac('0x16')][_0x4c42ba][_0x3cac('0x43')](_0x3cac('0x4b'));}return _0xfcddd4({'code':0xc8,'message':_0x5afc73});}catch(_0x31aba0){logger[_0x3cac('0x3c')](_0x31aba0[_0x3cac('0x50')]);return _0x2607aa(_0x2e5b6a[_0x3cac('0x3c')](0x1f4,_0x31aba0));}}logger['error']('message\x20is\x20empty');return _0x2607aa(_0x2e5b6a['error'](0x1f4,_0x3cac('0x51')));});},'AgentCapacity':function(_0x4f1fa3){var _0xadecd=this;return new Promise(function(_0x491da5,_0x9eed0b){if(_0x4bee52[_0x3cac('0x48')][_0x3cac('0x52')](_0x4f1fa3['id'])){for(var _0x1783d3 in _0x4f1fa3[_0x3cac('0x53')]){if(_0x4f1fa3['capacity'][_0x3cac('0x52')](_0x1783d3)){if(_0x4bee52[_0x3cac('0x48')][_0x4f1fa3['id']][_0x3cac('0x52')](_0x1783d3+_0x3cac('0x54'))){_0x4bee52[_0x3cac('0x48')][_0x4f1fa3['id']][_0x1783d3+_0x3cac('0x54')]=parseInt(_0x4f1fa3[_0x3cac('0x53')][_0x1783d3],0xa);}}}_0x4bee52[_0x3cac('0x48')][_0x4f1fa3['id']][_0x3cac('0x55')]();return _0x491da5({'code':0xc8,'message':_0x4bee52[_0x3cac('0x48')][_0x4f1fa3['id']]});}else{return _0x9eed0b(_0xadecd['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x336ef9){return new Promise(function(_0x29ae9a){var _0x2846ab=_[_0x3cac('0x56')](_0x4bee52[_0x3cac('0x48')]);if(_0x336ef9&&_0x336ef9['id']){var _0x3b4e32=_['find'](_0x2846ab,function(_0x3b3601){return _0x3b3601['id']===_0x336ef9['id'];});_0x29ae9a(_0x3b4e32);}else{_0x29ae9a({'count':_0x2846ab[_0x3cac('0x26')],'rows':_0x2846ab});}});},'ChatQueues':function(){return new Promise(function(_0x7cc025){var _0x1baa7b=[];for(var _0x43d943 in _0x4bee52['chatQueues']){if(_0x4bee52['chatQueues']['hasOwnProperty'](_0x43d943)){var _0x4eca60=_0x4bee52[_0x3cac('0x57')][_0x43d943];var _0x40a591={'id':_0x4eca60['id'],'available':_0x4eca60[_0x3cac('0x58')],'loggedIn':_0x4eca60['loggedIn'],'name':_0x4eca60[_0x3cac('0x59')],'paused':_0x4eca60[_0x3cac('0x5a')],'waiting':_0x4eca60[_0x3cac('0x5b')]};_0x1baa7b[_0x3cac('0x24')](_0x40a591);}}_0x7cc025({'count':_0x1baa7b[_0x3cac('0x26')],'rows':_0x1baa7b});});},'MailQueues':function(){return new Promise(function(_0x21b4ec){var _0x53acc6=[];for(var _0x2c2bfb in _0x4bee52['mailQueues']){if(_0x4bee52[_0x3cac('0x5c')][_0x3cac('0x52')](_0x2c2bfb)){var _0x2dc94d=_0x4bee52[_0x3cac('0x5c')][_0x2c2bfb];var _0x4b22a9={'id':_0x2dc94d['id'],'available':_0x2dc94d[_0x3cac('0x58')],'loggedIn':_0x2dc94d['loggedIn'],'name':_0x2dc94d[_0x3cac('0x59')],'paused':_0x2dc94d[_0x3cac('0x5a')],'waiting':_0x2dc94d[_0x3cac('0x5b')]};_0x53acc6[_0x3cac('0x24')](_0x4b22a9);}}_0x21b4ec({'count':_0x53acc6[_0x3cac('0x26')],'rows':_0x53acc6});});},'OpenchannelQueues':function(){return new Promise(function(_0x356ff0){var _0xba3d18=[];for(var _0x31f0b4 in _0x4bee52[_0x3cac('0x5d')]){if(_0x4bee52['openchannelQueues']['hasOwnProperty'](_0x31f0b4)){var _0x44b638=_0x4bee52[_0x3cac('0x5d')][_0x31f0b4];var _0x4f65a5={'id':_0x44b638['id'],'available':_0x44b638[_0x3cac('0x58')],'loggedIn':_0x44b638[_0x3cac('0x5e')],'name':_0x44b638[_0x3cac('0x59')],'paused':_0x44b638['paused'],'waiting':_0x44b638['waiting']};_0xba3d18[_0x3cac('0x24')](_0x4f65a5);}}_0x356ff0({'count':_0xba3d18[_0x3cac('0x26')],'rows':_0xba3d18});});},'SmsQueues':function(){return new Promise(function(_0x1cd7aa){var _0xd8036f=[];for(var _0xeaf51e in _0x4bee52[_0x3cac('0x5f')]){if(_0x4bee52[_0x3cac('0x5f')]['hasOwnProperty'](_0xeaf51e)){var _0xab20c0=_0x4bee52[_0x3cac('0x5f')][_0xeaf51e];var _0x21533b={'id':_0xab20c0['id'],'available':_0xab20c0[_0x3cac('0x58')],'loggedIn':_0xab20c0[_0x3cac('0x5e')],'name':_0xab20c0['name'],'paused':_0xab20c0[_0x3cac('0x5a')],'waiting':_0xab20c0['waiting']};_0xd8036f[_0x3cac('0x24')](_0x21533b);}}_0x1cd7aa({'count':_0xd8036f['length'],'rows':_0xd8036f});});},'FaxQueues':function(){return new Promise(function(_0x58270e){var _0xd7266a=[];for(var _0x51cd8a in _0x4bee52['faxQueues']){if(_0x4bee52[_0x3cac('0x60')]['hasOwnProperty'](_0x51cd8a)){var _0x3a995c=_0x4bee52[_0x3cac('0x60')][_0x51cd8a];var _0x1aea24={'id':_0x3a995c['id'],'available':_0x3a995c[_0x3cac('0x58')],'loggedIn':_0x3a995c[_0x3cac('0x5e')],'name':_0x3a995c[_0x3cac('0x59')],'paused':_0x3a995c[_0x3cac('0x5a')],'waiting':_0x3a995c['waiting']};_0xd7266a[_0x3cac('0x24')](_0x1aea24);}}_0x58270e({'count':_0xd7266a[_0x3cac('0x26')],'rows':_0xd7266a});});},'WhatsappQueues':function(){return new Promise(function(_0x2e9c3d){var _0x5ae3b9=[];for(var _0x5dbca8 in _0x4bee52[_0x3cac('0x61')]){if(_0x4bee52[_0x3cac('0x61')][_0x3cac('0x52')](_0x5dbca8)){var _0x51e6e8=_0x4bee52['whatsappQueues'][_0x5dbca8];var _0x3a42a4={'id':_0x51e6e8['id'],'available':_0x51e6e8['available'],'loggedIn':_0x51e6e8[_0x3cac('0x5e')],'name':_0x51e6e8[_0x3cac('0x59')],'paused':_0x51e6e8[_0x3cac('0x5a')],'waiting':_0x51e6e8[_0x3cac('0x5b')]};_0x5ae3b9[_0x3cac('0x24')](_0x3a42a4);}}_0x2e9c3d({'count':_0x5ae3b9[_0x3cac('0x26')],'rows':_0x5ae3b9});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2726bc){var _0x278244=_[_0x3cac('0x56')](_0x4bee52[_0x3cac('0x62')]);_0x2726bc({'count':_0x278244[_0x3cac('0x26')],'rows':_0x278244});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3fe17c){var _0xb19dfc=_[_0x3cac('0x56')](_0x4bee52[_0x3cac('0x63')]);_0x3fe17c({'count':_0xb19dfc['length'],'rows':_0xb19dfc});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x37feac){var _0x2445a8=_[_0x3cac('0x56')](_0x4bee52['openchannelQueuesWaitingInteractions']);_0x37feac({'count':_0x2445a8['length'],'rows':_0x2445a8});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x6ee414){var _0x5738ad=_[_0x3cac('0x56')](_0x4bee52[_0x3cac('0x64')]);_0x6ee414({'count':_0x5738ad[_0x3cac('0x26')],'rows':_0x5738ad});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x2d815b){var _0x1ddcc8=_[_0x3cac('0x56')](_0x4bee52[_0x3cac('0x65')]);_0x2d815b({'count':_0x1ddcc8[_0x3cac('0x26')],'rows':_0x1ddcc8});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x26ac88){var _0x34ff8c=_[_0x3cac('0x56')](_0x4bee52[_0x3cac('0x66')]);_0x26ac88({'count':_0x34ff8c[_0x3cac('0x26')],'rows':_0x34ff8c});});}};var _0x34cea7=jayson['server'](_0x281dfd)[_0x3cac('0x67')]();_0x34cea7['on']('error',function(_0x20ec70){logger['error'](JSON[_0x3cac('0x41')](_0x20ec70));return _0xf24623(_0x20ec70);});_0x34cea7['listen'](0x232c,_0x3cac('0x68'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2db008(_0x3cac('0x69')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c7d0289..8e6ac8e 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 _0x2b1e=['\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../config/logger','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join'];(function(_0x1c23eb,_0x36dbe8){var _0xa06fde=function(_0x416370){while(--_0x416370){_0x1c23eb['push'](_0x1c23eb['shift']());}};_0xa06fde(++_0x36dbe8);}(_0x2b1e,0xdf));var _0xe2b1=function(_0x37ed61,_0x4e6ba8){_0x37ed61=_0x37ed61-0x0;var _0x5ebe9c=_0x2b1e[_0x37ed61];return _0x5ebe9c;};'use strict';var _=require(_0xe2b1('0x0'));var iftime=require('../../../utils/iftime')['iftime'];var logger=require(_0xe2b1('0x1'))('routing');exports[_0xe2b1('0x2')]=function(_0x3e19b2,_0x192161,_0x1bb780){return function(_0x2f3ef7){if(_0x1bb780[_0xe2b1('0x3')]&&!_0x1bb780[_0xe2b1('0x3')][_0x3e19b2]){logger[_0xe2b1('0x4')](_0xe2b1('0x5'),_0x3e19b2);return _0x2f3ef7[_0xe2b1('0x6')]();}var _0x15f520=_0x192161[_0xe2b1('0x7')](function(_0x412c44){return iftime(_0x412c44);});var _0x4e5e8c=_[_0xe2b1('0x8')](_0x15f520);if(_0x4e5e8c){logger['info'](_0xe2b1('0x9'),_0x3e19b2,_0x192161[_0xe2b1('0xa')](_0xe2b1('0xb')),_0x4e5e8c);_0x2f3ef7['when'](_0x4e5e8c);}else{logger[_0xe2b1('0x4')](_0xe2b1('0xc'),_0x3e19b2,_0x192161['join'](_0xe2b1('0xb')));_0x2f3ef7[_0xe2b1('0x6')]();}};}; \ No newline at end of file +var _0xbcb9=['stop','map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','\x20|\x20','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','join','../../../utils/iftime','iftime','../../../config/logger','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x48571b,_0x5c6d8b){var _0x3d016d=function(_0x4ad75c){while(--_0x4ad75c){_0x48571b['push'](_0x48571b['shift']());}};_0x3d016d(++_0x5c6d8b);}(_0xbcb9,0x149));var _0x9bcb=function(_0x468048,_0x27e0ea){_0x468048=_0x468048-0x0;var _0x17d004=_0xbcb9[_0x468048];return _0x17d004;};'use strict';var _=require('lodash');var iftime=require(_0x9bcb('0x0'))[_0x9bcb('0x1')];var logger=require(_0x9bcb('0x2'))('routing');exports[_0x9bcb('0x3')]=function(_0x419899,_0x202eb5,_0x4e84f0){return function(_0x5493b6){if(_0x4e84f0[_0x9bcb('0x4')]&&!_0x4e84f0[_0x9bcb('0x4')][_0x419899]){logger[_0x9bcb('0x5')](_0x9bcb('0x6'),_0x419899);return _0x5493b6[_0x9bcb('0x7')]();}var _0x1ee583=_0x202eb5[_0x9bcb('0x8')](function(_0x3f265a){return iftime(_0x3f265a);});var _0x14c21c=_[_0x9bcb('0x9')](_0x1ee583);if(_0x14c21c){logger[_0x9bcb('0x5')](_0x9bcb('0xa'),_0x419899,_0x202eb5['join'](_0x9bcb('0xb')),_0x14c21c);_0x5493b6['when'](_0x14c21c);}else{logger[_0x9bcb('0x5')](_0x9bcb('0xc'),_0x419899,_0x202eb5[_0x9bcb('0xd')]('\x20|\x20'));_0x5493b6[_0x9bcb('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index fd1a713..43b4faf 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 _0xc900=['rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','uniqueid','agentcalledAt','now','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','lastevent','timeout','holdtime','ringtime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfereeuniqueid','agententerreason','clone','ATTENDED','secondtransfererexten','transfertargetuniqueid','calleridname','[%s][agents][attendedtransfer]','[%s][agents][hangup]','cause'];(function(_0x524997,_0x565a48){var _0x250ea4=function(_0x4a185c){while(--_0x4a185c){_0x524997['push'](_0x524997['shift']());}};_0x250ea4(++_0x565a48);}(_0xc900,0xb3));var _0x0c90=function(_0x4ffb92,_0x47f23c){_0x4ffb92=_0x4ffb92-0x0;var _0x252e1b=_0xc900[_0x4ffb92];return _0x252e1b;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x0c90('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x546406,_0x435691){utils['info'](util[_0x0c90('0x1')](_0x0c90('0x2'),_0x546406['uniqueid'],_0x546406[_0x0c90('0x3')],_0x546406[_0x0c90('0x4')],_0x546406[_0x0c90('0x5')],_0x546406[_0x0c90('0x6')],_0x546406[_0x0c90('0x7')],_0x546406[_0x0c90('0x8')],_0x546406['lastevent']));if(_0x546406[_0x0c90('0x4')]){utils[_0x0c90('0x9')](_0x546406[_0x0c90('0x4')])[_0x0c90('0xa')](function(_0x128656){if(_0x128656){_0x546406[_0x0c90('0xb')]=_0x128656[_0x0c90('0xb')];_0x546406[_0x0c90('0xc')]=_0x546406[_0x0c90('0xd')]?_0x128656[_0x0c90('0xe')]:![];_0x546406[_0x0c90('0xf')]=_0x546406[_0x0c90('0xc')]?_0x128656[_0x0c90('0x10')]:0x0;}utils['request'](_0x0c90('0x11'),_0x546406);});}else{utils['request'](_0x0c90('0x11'),_0x546406);}if(_0x435691){delete transfers[_0x546406['uniqueid']];}else{delete agents[_0x546406[_0x0c90('0x12')]];}}exports[_0x0c90('0x13')]=function(_0x4535a2){try{utils[_0x0c90('0x14')](util[_0x0c90('0x1')]('[%s][agents][agentcalled]',_0x4535a2[_0x0c90('0x15')]),_0x4535a2);agents[_0x4535a2[_0x0c90('0x12')]]=_0x4535a2;agents[_0x4535a2['destuniqueid']][_0x0c90('0x16')]=utils[_0x0c90('0x17')]();agents[_0x4535a2[_0x0c90('0x12')]]['lastevent']='called';agents[_0x4535a2[_0x0c90('0x12')]][_0x0c90('0x8')]=null;agents[_0x4535a2[_0x0c90('0x12')]][_0x0c90('0x18')]=null;utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x1a'),_0x4535a2['uniqueid'],agents[_0x4535a2[_0x0c90('0x12')]][_0x0c90('0x5')],_0x4535a2[_0x0c90('0x12')]));}catch(_0x26835c){utils['error'](util[_0x0c90('0x1')](_0x0c90('0x1b'),_0x4535a2[_0x0c90('0x15')]),_0x26835c);}};exports[_0x0c90('0x1c')]=function(_0x315932){try{if(!_[_0x0c90('0x1d')](agents[_0x315932['destuniqueid']])){utils[_0x0c90('0x14')](util['format'](_0x0c90('0x1e'),_0x315932[_0x0c90('0x15')]),_0x315932);utils['info'](util[_0x0c90('0x1')](_0x0c90('0x1f'),_0x315932[_0x0c90('0x15')],agents[_0x315932[_0x0c90('0x12')]][_0x0c90('0x5')],_0x315932[_0x0c90('0x12')]));agents[_0x315932['destuniqueid']][_0x0c90('0x1c')]=!![];agents[_0x315932[_0x0c90('0x12')]]['agentringnoanswerAt']=utils['now']();agents[_0x315932[_0x0c90('0x12')]][_0x0c90('0x20')]=_0x0c90('0x21');agents[_0x315932[_0x0c90('0x12')]]['reason']=_0x0c90('0x21');agents[_0x315932[_0x0c90('0x12')]][_0x0c90('0x22')]=_0x315932[_0x0c90('0x23')]?parseInt(_0x315932[_0x0c90('0x23')])/0x3e8:0x0;agents[_0x315932[_0x0c90('0x12')]]['talktime']=0x0;unanswered[_0x0c90('0x24')](_0x315932[_0x0c90('0x12')]);}}catch(_0x39f1b2){utils[_0x0c90('0x25')](util['format']('[%s][agents][agentringnoanswer]',_0x315932[_0x0c90('0x15')]),_0x39f1b2);}};exports[_0x0c90('0x26')]=function(_0x3bff04){try{_[_0x0c90('0x27')](agents,function(_0x119e09,_0x562664){if(_0x119e09[_0x0c90('0x15')]==_0x3bff04[_0x0c90('0x15')]&&!_[_0x0c90('0x28')](unanswered,_0x119e09['destuniqueid'])){utils[_0x0c90('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x3bff04[_0x0c90('0x15')]),_0x3bff04);utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x29'),_0x3bff04['uniqueid'],_0x119e09[_0x0c90('0x5')],_0x119e09['destuniqueid']));_0x119e09[_0x0c90('0x1c')]=!![];_0x119e09['agentringnoanswerAt']=utils[_0x0c90('0x17')]();_0x119e09[_0x0c90('0x20')]='abandoned';_0x119e09[_0x0c90('0x2a')]=_0x0c90('0x2b');_0x119e09[_0x0c90('0x22')]=_0x3bff04[_0x0c90('0x22')];_0x119e09[_0x0c90('0x2c')]=0x0;writeDB(_0x119e09);}});}catch(_0x1517c9){utils[_0x0c90('0x25')](util[_0x0c90('0x1')]('[%s][agents][queuecallerabandon]',_0x3bff04[_0x0c90('0x15')]),_0x1517c9);}};exports[_0x0c90('0x2d')]=function(_0x404f78){try{if(agents[_0x404f78[_0x0c90('0x12')]]){utils['debug'](util[_0x0c90('0x1')](_0x0c90('0x2e'),_0x404f78[_0x0c90('0x15')]),_0x404f78);utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x2f'),_0x404f78[_0x0c90('0x15')],agents[_0x404f78[_0x0c90('0x12')]]['membername'],_0x404f78[_0x0c90('0x12')]));agents[_0x404f78[_0x0c90('0x12')]]['agentconnectAt']=utils[_0x0c90('0x17')]();agents[_0x404f78[_0x0c90('0x12')]][_0x0c90('0x8')]=_0x404f78[_0x0c90('0x8')];agents[_0x404f78[_0x0c90('0x12')]]['connectedlinename']=_0x404f78[_0x0c90('0x18')];agents[_0x404f78[_0x0c90('0x12')]][_0x0c90('0x22')]=_0x404f78[_0x0c90('0x23')];agents[_0x404f78[_0x0c90('0x12')]][_0x0c90('0x20')]=_0x0c90('0x30');_[_0x0c90('0x27')](agents,function(_0x11a8e3,_0x4f0227){if(_0x11a8e3[_0x0c90('0x12')]!=_0x404f78['destuniqueid']&&_0x11a8e3[_0x0c90('0x15')]==_0x404f78['uniqueid']){_0x11a8e3[_0x0c90('0x2c')]=0x0;_0x11a8e3[_0x0c90('0x22')]=_0x404f78['ringtime'];_0x11a8e3['agentringnoanswer']=!![];_0x11a8e3[_0x0c90('0x31')]=utils['now']();_0x11a8e3[_0x0c90('0x20')]=_0x0c90('0x32');_0x11a8e3[_0x0c90('0x2a')]='answered_elsewhere';_0x11a8e3[_0x0c90('0x33')]=_0x404f78[_0x0c90('0x12')];_0x11a8e3[_0x0c90('0x34')]=_0x404f78[_0x0c90('0x5')];writeDB(_0x11a8e3);}});}}catch(_0x2139c3){utils[_0x0c90('0x25')](util['format'](_0x0c90('0x2e'),_0x404f78[_0x0c90('0x15')]),_0x2139c3);}};exports[_0x0c90('0xd')]=function(_0x399115){try{if(!_[_0x0c90('0x1d')](agents[_0x399115[_0x0c90('0x12')]])){utils[_0x0c90('0x14')](util['format'](_0x0c90('0x35'),_0x399115['uniqueid']),_0x399115);utils[_0x0c90('0x19')](util[_0x0c90('0x1')](_0x0c90('0x36'),_0x399115[_0x0c90('0x15')],agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x5')],_0x399115[_0x0c90('0x12')]));agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0xd')]=!![];agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x37')]=utils[_0x0c90('0x17')]();agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x2c')]=utils[_0x0c90('0x38')](agents[_0x399115['destuniqueid']][_0x0c90('0x37')],agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x39')]);agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x2a')]=_0x399115[_0x0c90('0x2a')];agents[_0x399115[_0x0c90('0x12')]][_0x0c90('0x20')]=_0x0c90('0x3a');writeDB(agents[_0x399115[_0x0c90('0x12')]]);}}catch(_0x2f25ad){utils[_0x0c90('0x25')](util[_0x0c90('0x1')](_0x0c90('0x35'),_0x399115['uniqueid']),_0x2f25ad);}};exports[_0x0c90('0x3b')]=function(_0x38f492){try{if(!_['isNil'](agents[_0x38f492['transfereruniqueid']])){utils['debug'](util[_0x0c90('0x1')](_0x0c90('0x3c'),_0x38f492[_0x0c90('0x15')]),_0x38f492);utils[_0x0c90('0x19')](util[_0x0c90('0x1')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x38f492[_0x0c90('0x15')],agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x5')],agents[_0x38f492['transfereruniqueid']][_0x0c90('0x15')]));agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x3e')]=!![];agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x3f')]=_0x0c90('0x40');agents[_0x38f492[_0x0c90('0x3d')]][_0x0c90('0x41')]=_0x38f492[_0x0c90('0x42')];agents[_0x38f492[_0x0c90('0x3d')]]['transferuniqueid']=agents[_0x38f492[_0x0c90('0x3d')]]['uniqueid'];}}catch(_0xda4331){utils[_0x0c90('0x25')](util[_0x0c90('0x1')](_0x0c90('0x3c'),_0x38f492[_0x0c90('0x15')]),_0xda4331);}};exports[_0x0c90('0x43')]=function(_0x58dcfc){try{utils['debug'](util['format']('[%s][agents][attendedtransfer]',_0x58dcfc[_0x0c90('0x44')]),_0x58dcfc);if(_0x58dcfc[_0x0c90('0x44')]==_0x58dcfc[_0x0c90('0x45')]){if(!_['isNil'](agents[_0x58dcfc[_0x0c90('0x46')]])){utils[_0x0c90('0x19')](util['format'](_0x0c90('0x47'),_0x58dcfc['origtransfereruniqueid'],agents[_0x58dcfc[_0x0c90('0x46')]][_0x0c90('0x5')]));agents[_0x58dcfc[_0x0c90('0x46')]][_0x0c90('0x3e')]=!![];agents[_0x58dcfc['secondtransfereruniqueid']][_0x0c90('0x3f')]='ATTENDED';agents[_0x58dcfc[_0x0c90('0x46')]][_0x0c90('0x41')]=_0x58dcfc['origtransfererexten'];agents[_0x58dcfc['secondtransfereruniqueid']]['transferuniqueid']=_0x58dcfc[_0x0c90('0x44')];}if(_0x58dcfc[_0x0c90('0x48')]&&agents[_0x58dcfc[_0x0c90('0x48')]]){agents[_0x58dcfc[_0x0c90('0x48')]][_0x0c90('0x49')]=0x1;transfers[_0x58dcfc['transfereeuniqueid']]=_[_0x0c90('0x4a')](agents[_0x58dcfc[_0x0c90('0x48')]]);transfers[_0x58dcfc['transfereeuniqueid']][_0x0c90('0x7')]=agents[_0x58dcfc['secondtransfereruniqueid']][_0x0c90('0x7')];transfers[_0x58dcfc[_0x0c90('0x48')]]['calleridname']=agents[_0x58dcfc[_0x0c90('0x46')]]['calleridname'];transfers[_0x58dcfc['transfereeuniqueid']]['agentcalledAt']=utils[_0x0c90('0x17')]();transfers[_0x58dcfc[_0x0c90('0x48')]][_0x0c90('0x39')]=utils[_0x0c90('0x17')]();transfers[_0x58dcfc['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x58dcfc[_0x0c90('0x48')]][_0x0c90('0x49')]=0x2;}}else if(_0x58dcfc[_0x0c90('0x46')]==_0x58dcfc['secondtransfererlinkedid']){if(!_[_0x0c90('0x1d')](agents[_0x58dcfc[_0x0c90('0x44')]])){utils[_0x0c90('0x19')](util['format'](_0x0c90('0x47'),_0x58dcfc[_0x0c90('0x44')],agents[_0x58dcfc[_0x0c90('0x44')]]['membername']));agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x3e')]=!![];agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x3f')]=_0x0c90('0x4b');agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x41')]=_0x58dcfc[_0x0c90('0x4c')];agents[_0x58dcfc[_0x0c90('0x44')]]['transferuniqueid']=_0x58dcfc['secondtransfereruniqueid'];}if(_0x58dcfc[_0x0c90('0x4d')]&&agents[_0x58dcfc[_0x0c90('0x4d')]]){agents[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x49')]=0x1;transfers[_0x58dcfc[_0x0c90('0x4d')]]=_[_0x0c90('0x4a')](agents[_0x58dcfc[_0x0c90('0x4d')]]);transfers[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x7')]=agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x7')];transfers[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x4e')]=agents[_0x58dcfc[_0x0c90('0x44')]][_0x0c90('0x4e')];transfers[_0x58dcfc['transfertargetuniqueid']][_0x0c90('0x16')]=utils[_0x0c90('0x17')]();transfers[_0x58dcfc[_0x0c90('0x4d')]]['agentconnectAt']=utils['now']();transfers[_0x58dcfc[_0x0c90('0x4d')]]['holdtime']=0x0;transfers[_0x58dcfc[_0x0c90('0x4d')]][_0x0c90('0x49')]=0x2;}}}catch(_0x57fb18){utils[_0x0c90('0x25')](util[_0x0c90('0x1')](_0x0c90('0x4f'),_0x58dcfc[_0x0c90('0x44')]),_0x57fb18);}};exports['hangup']=function(_0x5f2628){try{utils['debug'](util[_0x0c90('0x1')](_0x0c90('0x50'),_0x5f2628[_0x0c90('0x15')]),_0x5f2628);if(agents[_0x5f2628[_0x0c90('0x15')]]&&agents[_0x5f2628['uniqueid']][_0x0c90('0x2a')]==='timeout'){if(_0x5f2628[_0x0c90('0x51')]==='21'){agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')]='rejected';agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]=_0x0c90('0x52');}utils[_0x0c90('0x19')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5f2628[_0x0c90('0x15')],agents[_0x5f2628['uniqueid']][_0x0c90('0x5')],agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')],agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]));writeDB(agents[_0x5f2628[_0x0c90('0x15')]]);var _0x2321eb=unanswered[_0x0c90('0x53')](_0x5f2628[_0x0c90('0x15')]);if(_0x2321eb>-0x1){unanswered[_0x0c90('0x54')](_0x2321eb,0x1);}}if(transfers[_0x5f2628['uniqueid']]){transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0xd')]=!![];transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x37')]=utils[_0x0c90('0x17')]();transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2c')]=utils[_0x0c90('0x38')](transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x37')],transfers[_0x5f2628['uniqueid']][_0x0c90('0x39')]);transfers[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')]=_0x0c90('0x55');transfers[_0x5f2628['uniqueid']][_0x0c90('0x20')]=_0x0c90('0x3a');utils[_0x0c90('0x19')](util['format'](_0x0c90('0x56'),_0x5f2628[_0x0c90('0x15')],transfers[_0x5f2628['uniqueid']][_0x0c90('0x5')],transfers[_0x5f2628['uniqueid']][_0x0c90('0x2a')],transfers[_0x5f2628['uniqueid']]['lastevent']));writeDB(transfers[_0x5f2628[_0x0c90('0x15')]],!![]);}if(agents[_0x5f2628[_0x0c90('0x15')]]&&agents[_0x5f2628['uniqueid']]['agentconnectAt']){agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0xd')]=!![];agents[_0x5f2628['uniqueid']]['agentcompleteAt']=utils[_0x0c90('0x17')]();agents[_0x5f2628['uniqueid']][_0x0c90('0x2c')]=utils[_0x0c90('0x38')](agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x37')],agents[_0x5f2628[_0x0c90('0x15')]]['agentconnectAt']);agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x2a')]=agents[_0x5f2628[_0x0c90('0x15')]]['transfer']?'transfer':_0x0c90('0x55');agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]='complete';utils['info'](util['format'](_0x0c90('0x56'),_0x5f2628['uniqueid'],agents[_0x5f2628['uniqueid']]['membername'],agents[_0x5f2628['uniqueid']][_0x0c90('0x2a')],agents[_0x5f2628[_0x0c90('0x15')]][_0x0c90('0x20')]));writeDB(agents[_0x5f2628[_0x0c90('0x15')]]);}}catch(_0x16c383){utils['error'](util['format']('[%s][agents][hangup]',_0x5f2628[_0x0c90('0x15')]),_0x16c383);}}; \ No newline at end of file +var _0xa5fa=['[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertype','secondtransfererexten','transferuniqueid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','acw','acwTimeout','CreateVoiceAgentReport','request','uniqueid','destuniqueid','[%s][agents][agentcalled]','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','holdtime','ringtime','talktime','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','[%s][agents][blindtransfer]','attendedtransfer'];(function(_0x534e12,_0x1725aa){var _0x5f0400=function(_0x3208f4){while(--_0x3208f4){_0x534e12['push'](_0x534e12['shift']());}};_0x5f0400(++_0x1725aa);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x1bd3a2,_0x6b37a7){_0x1bd3a2=_0x1bd3a2-0x0;var _0x1bb4b7=_0xa5fa[_0x1bd3a2];return _0x1bb4b7;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var utils=require(_0xaa5f('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24d383,_0x1b7e1d){utils['info'](util[_0xaa5f('0x2')](_0xaa5f('0x3'),_0x24d383['uniqueid'],_0x24d383[_0xaa5f('0x4')],_0x24d383[_0xaa5f('0x5')],_0x24d383[_0xaa5f('0x6')],_0x24d383[_0xaa5f('0x7')],_0x24d383[_0xaa5f('0x8')],_0x24d383[_0xaa5f('0x9')],_0x24d383[_0xaa5f('0xa')]));if(_0x24d383[_0xaa5f('0x5')]){utils[_0xaa5f('0xb')](_0x24d383[_0xaa5f('0x5')])[_0xaa5f('0xc')](function(_0x4e5257){if(_0x4e5257){_0x24d383[_0xaa5f('0xd')]=_0x4e5257[_0xaa5f('0xd')];_0x24d383['agentacw']=_0x24d383['agentcomplete']?_0x4e5257[_0xaa5f('0xe')]:![];_0x24d383['acwtime']=_0x24d383['agentacw']?_0x4e5257[_0xaa5f('0xf')]:0x0;}utils['request'](_0xaa5f('0x10'),_0x24d383);});}else{utils[_0xaa5f('0x11')](_0xaa5f('0x10'),_0x24d383);}if(_0x1b7e1d){delete transfers[_0x24d383[_0xaa5f('0x12')]];}else{delete agents[_0x24d383[_0xaa5f('0x13')]];}}exports['agentcalled']=function(_0xbd4e10){try{utils['debug'](util[_0xaa5f('0x2')](_0xaa5f('0x14'),_0xbd4e10[_0xaa5f('0x12')]),_0xbd4e10);agents[_0xbd4e10[_0xaa5f('0x13')]]=_0xbd4e10;agents[_0xbd4e10[_0xaa5f('0x13')]]['agentcalledAt']=utils['now']();agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x15');agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0x9')]=null;agents[_0xbd4e10[_0xaa5f('0x13')]][_0xaa5f('0x16')]=null;utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x18'),_0xbd4e10[_0xaa5f('0x12')],agents[_0xbd4e10[_0xaa5f('0x13')]]['membername'],_0xbd4e10[_0xaa5f('0x13')]));}catch(_0x4c0a9d){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x14'),_0xbd4e10[_0xaa5f('0x12')]),_0x4c0a9d);}};exports[_0xaa5f('0x1a')]=function(_0x194691){try{if(!_[_0xaa5f('0x1b')](agents[_0x194691[_0xaa5f('0x13')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x1d'),_0x194691['uniqueid']),_0x194691);utils[_0xaa5f('0x17')](util['format'](_0xaa5f('0x1e'),_0x194691[_0xaa5f('0x12')],agents[_0x194691['destuniqueid']][_0xaa5f('0x6')],_0x194691[_0xaa5f('0x13')]));agents[_0x194691['destuniqueid']][_0xaa5f('0x1a')]=!![];agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x1f')]=utils[_0xaa5f('0x20')]();agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x21');agents[_0x194691[_0xaa5f('0x13')]]['reason']=_0xaa5f('0x21');agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x22')]=_0x194691['ringtime']?parseInt(_0x194691[_0xaa5f('0x23')])/0x3e8:0x0;agents[_0x194691[_0xaa5f('0x13')]][_0xaa5f('0x24')]=0x0;unanswered['push'](_0x194691[_0xaa5f('0x13')]);}}catch(_0x479f29){utils['error'](util[_0xaa5f('0x2')]('[%s][agents][agentringnoanswer]',_0x194691[_0xaa5f('0x12')]),_0x479f29);}};exports['queuecallerabandon']=function(_0x4c5dc0){try{_['forIn'](agents,function(_0x26a90d,_0x4ddebd){if(_0x26a90d[_0xaa5f('0x12')]==_0x4c5dc0[_0xaa5f('0x12')]&&!_['includes'](unanswered,_0x26a90d['destuniqueid'])){utils[_0xaa5f('0x1c')](util['format'](_0xaa5f('0x25'),_0x4c5dc0[_0xaa5f('0x12')]),_0x4c5dc0);utils['info'](util[_0xaa5f('0x2')](_0xaa5f('0x26'),_0x4c5dc0[_0xaa5f('0x12')],_0x26a90d['membername'],_0x26a90d[_0xaa5f('0x13')]));_0x26a90d[_0xaa5f('0x1a')]=!![];_0x26a90d['agentringnoanswerAt']=utils['now']();_0x26a90d['lastevent']='abandoned';_0x26a90d[_0xaa5f('0x27')]=_0xaa5f('0x28');_0x26a90d[_0xaa5f('0x22')]=_0x4c5dc0[_0xaa5f('0x22')];_0x26a90d[_0xaa5f('0x24')]=0x0;writeDB(_0x26a90d);}});}catch(_0x3bcaf6){utils[_0xaa5f('0x19')](util['format'](_0xaa5f('0x25'),_0x4c5dc0[_0xaa5f('0x12')]),_0x3bcaf6);}};exports[_0xaa5f('0x29')]=function(_0x1f3268){try{if(agents[_0x1f3268[_0xaa5f('0x13')]]){utils[_0xaa5f('0x1c')](util['format'](_0xaa5f('0x2a'),_0x1f3268[_0xaa5f('0x12')]),_0x1f3268);utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x2b'),_0x1f3268['uniqueid'],agents[_0x1f3268['destuniqueid']][_0xaa5f('0x6')],_0x1f3268[_0xaa5f('0x13')]));agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x2c')]=utils['now']();agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x9')]=_0x1f3268[_0xaa5f('0x9')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x16')]=_0x1f3268[_0xaa5f('0x16')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0x22')]=_0x1f3268[_0xaa5f('0x23')];agents[_0x1f3268[_0xaa5f('0x13')]][_0xaa5f('0xa')]='connect';_[_0xaa5f('0x2d')](agents,function(_0x2562ce,_0xcd9c30){if(_0x2562ce[_0xaa5f('0x13')]!=_0x1f3268[_0xaa5f('0x13')]&&_0x2562ce[_0xaa5f('0x12')]==_0x1f3268[_0xaa5f('0x12')]){_0x2562ce[_0xaa5f('0x24')]=0x0;_0x2562ce[_0xaa5f('0x22')]=_0x1f3268[_0xaa5f('0x23')];_0x2562ce['agentringnoanswer']=!![];_0x2562ce[_0xaa5f('0x1f')]=utils['now']();_0x2562ce[_0xaa5f('0xa')]=_0xaa5f('0x2e');_0x2562ce[_0xaa5f('0x27')]='answered_elsewhere';_0x2562ce[_0xaa5f('0x2f')]=_0x1f3268[_0xaa5f('0x13')];_0x2562ce[_0xaa5f('0x30')]=_0x1f3268['membername'];writeDB(_0x2562ce);}});}}catch(_0x12a8e4){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x2a'),_0x1f3268['uniqueid']),_0x12a8e4);}};exports[_0xaa5f('0x31')]=function(_0x2b2b4c){try{if(!_[_0xaa5f('0x1b')](agents[_0x2b2b4c[_0xaa5f('0x13')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x32'),_0x2b2b4c[_0xaa5f('0x12')]),_0x2b2b4c);utils['info'](util[_0xaa5f('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2b2b4c[_0xaa5f('0x12')],agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x6')],_0x2b2b4c[_0xaa5f('0x13')]));agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x31')]=!![];agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0x33')]=utils['now']();agents[_0x2b2b4c['destuniqueid']]['talktime']=utils[_0xaa5f('0x34')](agents[_0x2b2b4c['destuniqueid']][_0xaa5f('0x33')],agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0x2c')]);agents[_0x2b2b4c[_0xaa5f('0x13')]]['reason']=_0x2b2b4c[_0xaa5f('0x27')];agents[_0x2b2b4c[_0xaa5f('0x13')]][_0xaa5f('0xa')]=_0xaa5f('0x35');writeDB(agents[_0x2b2b4c[_0xaa5f('0x13')]]);}}catch(_0x1f9629){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x32'),_0x2b2b4c[_0xaa5f('0x12')]),_0x1f9629);}};exports[_0xaa5f('0x36')]=function(_0x2de737){try{if(!_[_0xaa5f('0x1b')](agents[_0x2de737[_0xaa5f('0x37')]])){utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')]('[%s][agents][blindtransfer]',_0x2de737[_0xaa5f('0x12')]),_0x2de737);utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x38'),_0x2de737[_0xaa5f('0x12')],agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x6')],agents[_0x2de737['transfereruniqueid']][_0xaa5f('0x12')]));agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x39')]=!![];agents[_0x2de737[_0xaa5f('0x37')]]['transfertype']=_0xaa5f('0x3a');agents[_0x2de737[_0xaa5f('0x37')]][_0xaa5f('0x3b')]=_0x2de737['extension'];agents[_0x2de737['transfereruniqueid']]['transferuniqueid']=agents[_0x2de737['transfereruniqueid']]['uniqueid'];}}catch(_0x509c61){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x3c'),_0x2de737[_0xaa5f('0x12')]),_0x509c61);}};exports[_0xaa5f('0x3d')]=function(_0x17b872){try{utils['debug'](util['format'](_0xaa5f('0x3e'),_0x17b872[_0xaa5f('0x3f')]),_0x17b872);if(_0x17b872['origtransfereruniqueid']==_0x17b872[_0xaa5f('0x40')]){if(!_[_0xaa5f('0x1b')](agents[_0x17b872[_0xaa5f('0x41')]])){utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x42'),_0x17b872[_0xaa5f('0x3f')],agents[_0x17b872['secondtransfereruniqueid']]['membername']));agents[_0x17b872[_0xaa5f('0x41')]][_0xaa5f('0x39')]=!![];agents[_0x17b872['secondtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x17b872[_0xaa5f('0x41')]]['transferexten']=_0x17b872[_0xaa5f('0x43')];agents[_0x17b872['secondtransfereruniqueid']]['transferuniqueid']=_0x17b872[_0xaa5f('0x3f')];}if(_0x17b872[_0xaa5f('0x44')]&&agents[_0x17b872[_0xaa5f('0x44')]]){agents[_0x17b872['transfereeuniqueid']][_0xaa5f('0x45')]=0x1;transfers[_0x17b872[_0xaa5f('0x44')]]=_[_0xaa5f('0x46')](agents[_0x17b872['transfereeuniqueid']]);transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x8')]=agents[_0x17b872['secondtransfereruniqueid']][_0xaa5f('0x8')];transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x47')]=agents[_0x17b872[_0xaa5f('0x41')]][_0xaa5f('0x47')];transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x48')]=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x44')]]['agentconnectAt']=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x22')]=0x0;transfers[_0x17b872[_0xaa5f('0x44')]][_0xaa5f('0x45')]=0x2;}}else if(_0x17b872[_0xaa5f('0x41')]==_0x17b872[_0xaa5f('0x49')]){if(!_[_0xaa5f('0x1b')](agents[_0x17b872['origtransfereruniqueid']])){utils[_0xaa5f('0x17')](util['format'](_0xaa5f('0x42'),_0x17b872[_0xaa5f('0x3f')],agents[_0x17b872[_0xaa5f('0x3f')]][_0xaa5f('0x6')]));agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x39')]=!![];agents[_0x17b872[_0xaa5f('0x3f')]][_0xaa5f('0x4a')]='ATTENDED';agents[_0x17b872[_0xaa5f('0x3f')]]['transferexten']=_0x17b872[_0xaa5f('0x4b')];agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x4c')]=_0x17b872[_0xaa5f('0x41')];}if(_0x17b872[_0xaa5f('0x4d')]&&agents[_0x17b872[_0xaa5f('0x4d')]]){agents[_0x17b872['transfertargetuniqueid']][_0xaa5f('0x45')]=0x1;transfers[_0x17b872[_0xaa5f('0x4d')]]=_['clone'](agents[_0x17b872['transfertargetuniqueid']]);transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x8')]=agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x8')];transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x47')]=agents[_0x17b872['origtransfereruniqueid']][_0xaa5f('0x47')];transfers[_0x17b872[_0xaa5f('0x4d')]]['agentcalledAt']=utils[_0xaa5f('0x20')]();transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x2c')]=utils['now']();transfers[_0x17b872[_0xaa5f('0x4d')]][_0xaa5f('0x22')]=0x0;transfers[_0x17b872['transfertargetuniqueid']][_0xaa5f('0x45')]=0x2;}}}catch(_0x309605){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')](_0xaa5f('0x3e'),_0x17b872['origtransfereruniqueid']),_0x309605);}};exports[_0xaa5f('0x4e')]=function(_0x2ba378){try{utils[_0xaa5f('0x1c')](util[_0xaa5f('0x2')](_0xaa5f('0x4f'),_0x2ba378['uniqueid']),_0x2ba378);if(agents[_0x2ba378[_0xaa5f('0x12')]]&&agents[_0x2ba378['uniqueid']][_0xaa5f('0x27')]===_0xaa5f('0x21')){if(_0x2ba378[_0xaa5f('0x50')]==='21'){agents[_0x2ba378[_0xaa5f('0x12')]]['reason']=_0xaa5f('0x51');agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x51');}utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2ba378['uniqueid'],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x6')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],agents[_0x2ba378[_0xaa5f('0x12')]]['lastevent']));writeDB(agents[_0x2ba378['uniqueid']]);var _0x104079=unanswered[_0xaa5f('0x52')](_0x2ba378['uniqueid']);if(_0x104079>-0x1){unanswered[_0xaa5f('0x53')](_0x104079,0x1);}}if(transfers[_0x2ba378['uniqueid']]){transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x31')]=!![];transfers[_0x2ba378['uniqueid']][_0xaa5f('0x33')]=utils[_0xaa5f('0x20')]();transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x24')]=utils[_0xaa5f('0x34')](transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x33')],transfers[_0x2ba378['uniqueid']][_0xaa5f('0x2c')]);transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')]='agent';transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x35');utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2ba378[_0xaa5f('0x12')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x6')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],transfers[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]));writeDB(transfers[_0x2ba378[_0xaa5f('0x12')]],!![]);}if(agents[_0x2ba378[_0xaa5f('0x12')]]&&agents[_0x2ba378[_0xaa5f('0x12')]]['agentconnectAt']){agents[_0x2ba378['uniqueid']][_0xaa5f('0x31')]=!![];agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x33')]=utils[_0xaa5f('0x20')]();agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x24')]=utils[_0xaa5f('0x34')](agents[_0x2ba378[_0xaa5f('0x12')]]['agentcompleteAt'],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x2c')]);agents[_0x2ba378[_0xaa5f('0x12')]]['reason']=agents[_0x2ba378['uniqueid']][_0xaa5f('0x39')]?_0xaa5f('0x39'):_0xaa5f('0x54');agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]=_0xaa5f('0x35');utils[_0xaa5f('0x17')](util[_0xaa5f('0x2')](_0xaa5f('0x55'),_0x2ba378[_0xaa5f('0x12')],agents[_0x2ba378['uniqueid']][_0xaa5f('0x6')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0x27')],agents[_0x2ba378[_0xaa5f('0x12')]][_0xaa5f('0xa')]));writeDB(agents[_0x2ba378['uniqueid']]);}}catch(_0x4183c0){utils[_0xaa5f('0x19')](util[_0xaa5f('0x2')]('[%s][agents][hangup]',_0x2ba378['uniqueid']),_0x4183c0);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 0c40c48..bcabff5 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 _0xe61a=['calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','noop','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','exten','context','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','hangup','[%s][calls][hangup]','callerid'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0xe61a,0xa6));var _0xae61=function(_0xbc90ad,_0x485602){_0xbc90ad=_0xbc90ad-0x0;var _0x5784f6=_0xe61a[_0xbc90ad];return _0x5784f6;};'use strict';var _=require(_0xae61('0x0'));var util=require(_0xae61('0x1'));var utils=require(_0xae61('0x2'));var dispositions=['NO\x20ANSWER',_0xae61('0x3'),_0xae61('0x3'),_0xae61('0x4'),_0xae61('0x4'),'NO\x20ANSWER',_0xae61('0x5'),'BUSY',_0xae61('0x3'),_0xae61('0x3'),'FAILED'];var channels={};function writeDB(_0x151129){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x8'),_0x151129[_0xae61('0x9')],_0x151129[_0xae61('0xa')],_0x151129[_0xae61('0xb')],_0x151129[_0xae61('0xc')],_0x151129[_0xae61('0xd')],_0x151129[_0xae61('0xe')],_0x151129[_0xae61('0xf')],_0x151129['lastevent']));if(_0x151129[_0xae61('0x10')]){utils[_0xae61('0x11')](_0x151129['accountcode'])[_0xae61('0x12')](function(_0x5a12e8){if(_0x5a12e8){_0x151129[_0xae61('0x13')]=_0x5a12e8['id'];}utils['request'](_0xae61('0x14'),_0x151129);});}else{utils['request'](_0xae61('0x14'),_0x151129);}if(channels[_0x151129['uniqueid']]){delete channels[_0x151129[_0xae61('0x9')]];}}exports[_0xae61('0x15')]=function(_0x5203a6){try{utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x17'),_0x5203a6[_0xae61('0x9')]),_0x5203a6);if(_0x5203a6[_0xae61('0x9')]==_0x5203a6[_0xae61('0x18')]&&_0x5203a6['channel']!=_0xae61('0x19')){utils[_0xae61('0x6')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x5203a6[_0xae61('0x9')],_0x5203a6['context'],_0x5203a6[_0xae61('0x1a')]));channels[_0x5203a6['uniqueid']]={'uniqueid':_0x5203a6[_0xae61('0x9')],'accountcode':_0x5203a6['accountcode'],'source':_0x5203a6[_0xae61('0xe')],'destination':_0x5203a6['exten'],'destinationcontext':_0x5203a6[_0xae61('0x1b')],'channel':_0x5203a6['channel'],'starttime':utils[_0xae61('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xae61('0x4'),'amaflags':_0xae61('0x1d')};}}catch(_0x15af74){utils['error'](util[_0xae61('0x7')](_0xae61('0x17'),_0x5203a6[_0xae61('0x9')]),_0x15af74);}};exports[_0xae61('0x1e')]=function(_0x5259b9){try{utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x1f'),_0x5259b9[_0xae61('0x9')]),_0x5259b9);if(!_[_0xae61('0x20')](channels[_0x5259b9['uniqueid']])&&_0x5259b9[_0xae61('0x21')]==0x6){utils['info'](util[_0xae61('0x7')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x5259b9[_0xae61('0x9')],_0x5259b9[_0xae61('0x1b')],_0x5259b9['channel']));if(_[_0xae61('0x20')](channels[_0x5259b9[_0xae61('0x9')]][_0xae61('0x22')])){channels[_0x5259b9[_0xae61('0x9')]]['systemanswertime']=utils[_0xae61('0x1c')]();}}else if(!_[_0xae61('0x20')](channels[_0x5259b9[_0xae61('0x18')]])&&_0x5259b9['channelstate']==0x6&&_0x5259b9[_0xae61('0x1b')]!=_0xae61('0x23')){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x24'),_0x5259b9[_0xae61('0x9')],_0x5259b9[_0xae61('0x18')],_0x5259b9['context'],_0x5259b9[_0xae61('0xa')]));channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x10')]=_0x5259b9[_0xae61('0x10')];channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x25')]=_0x5259b9[_0xae61('0xa')];if(_[_0xae61('0x20')](channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x26')])){channels[_0x5259b9[_0xae61('0x18')]]['answertime']=utils[_0xae61('0x1c')]();}channels[_0x5259b9[_0xae61('0x18')]][_0xae61('0x27')]=dispositions[_['toNumber'](_0x5259b9[_0xae61('0x21')])]||_0xae61('0x5');}}catch(_0x4617c1){utils[_0xae61('0x28')](util[_0xae61('0x7')]('[%s][calls][newstate]',_0x5259b9[_0xae61('0x9')]),_0x4617c1);}};exports[_0xae61('0x29')]=function(_0x3a1de3){try{if(!_[_0xae61('0x20')](channels[_0x3a1de3[_0xae61('0x9')]])){utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x2a'),_0x3a1de3[_0xae61('0x9')]),_0x3a1de3);if(_[_0xae61('0x20')](channels[_0x3a1de3['uniqueid']][_0xae61('0x2b')])){channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2b')]=_0x3a1de3[_0xae61('0x2c')]+'\x20<'+_0x3a1de3[_0xae61('0xe')]+'>';}utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x2d'),_0x3a1de3[_0xae61('0x9')],channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2b')],_0x3a1de3[_0xae61('0x2e')]));channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2f')]=utils['now']();channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x30')]=utils[_0xae61('0x31')](channels[_0x3a1de3[_0xae61('0x9')]]['endtime'],channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x32')]);channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x33')]=channels[_0x3a1de3[_0xae61('0x9')]]['answertime']?utils[_0xae61('0x31')](channels[_0x3a1de3[_0xae61('0x9')]][_0xae61('0x2f')],channels[_0x3a1de3['uniqueid']][_0xae61('0x26')]):0x0;writeDB(channels[_0x3a1de3[_0xae61('0x9')]]);}}catch(_0xb391ab){utils['error'](util[_0xae61('0x7')](_0xae61('0x2a'),_0x3a1de3[_0xae61('0x9')]),_0xb391ab);}};exports['attendedtransfer']=function(_0x288375){try{if(!_[_0xae61('0x20')](channels[_0x288375[_0xae61('0x34')]])){utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x35'),_0x288375[_0xae61('0x36')]),_0x288375);if(channels[_0x288375[_0xae61('0x34')]][_0xae61('0xa')]==_0x288375[_0xae61('0x37')]){utils[_0xae61('0x6')](util[_0xae61('0x7')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x288375['origtransfereruniqueid'],_0x288375[_0xae61('0x34')],_0x288375['secondtransfererchannel']));channels[_0x288375['localtwolinkedid']][_0xae61('0x25')]=_0x288375['secondtransfererchannel'];channels[_0x288375[_0xae61('0x34')]][_0xae61('0x38')]=_0xae61('0x39');}else if(channels[_0x288375[_0xae61('0x34')]]['channel']=_0x288375[_0xae61('0x3a')]){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x3b'),_0x288375[_0xae61('0x36')],_0x288375[_0xae61('0x34')],_0x288375[_0xae61('0x3c')]));channels[_0x288375[_0xae61('0x34')]][_0xae61('0x25')]=_0x288375['origtransfererchannel'];channels[_0x288375['localtwolinkedid']][_0xae61('0x38')]='_attended';}}}catch(_0x476d47){utils[_0xae61('0x28')](util[_0xae61('0x7')](_0xae61('0x35'),_0x288375[_0xae61('0x36')]),_0x476d47);}};exports['musiconholdstart']=function(_0xe812ed){try{if(!_['isNil'](channels[_0xe812ed[_0xae61('0x9')]])){utils['debug'](util['format'](_0xae61('0x3d'),_0xe812ed['uniqueid']),_0xe812ed);channels[_0xe812ed[_0xae61('0x9')]][_0xae61('0x3e')]=utils[_0xae61('0x1c')]();utils['info'](util[_0xae61('0x7')](_0xae61('0x3f'),_0xe812ed['uniqueid'],channels[_0xe812ed['uniqueid']][_0xae61('0x3e')]));}}catch(_0xddd8bb){utils['error'](util['format']('[%s][calls][musiconholdstart]',_0xe812ed[_0xae61('0x9')]),_0xddd8bb);}};exports[_0xae61('0x40')]=function(_0x2e57a8){try{if(!_[_0xae61('0x20')](channels[_0x2e57a8['uniqueid']])){utils[_0xae61('0x16')](util[_0xae61('0x7')]('[%s][calls][musiconholdstop]',_0x2e57a8[_0xae61('0x9')]),_0x2e57a8);if(!_['isNil'](channels[_0x2e57a8[_0xae61('0x9')]][_0xae61('0x3e')])){channels[_0x2e57a8[_0xae61('0x9')]]['mohtime']+=utils[_0xae61('0x31')](utils['now'](),channels[_0x2e57a8['uniqueid']][_0xae61('0x3e')]);utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x41'),_0x2e57a8[_0xae61('0x9')],channels[_0x2e57a8[_0xae61('0x9')]]['mohtime']));delete channels[_0x2e57a8[_0xae61('0x9')]][_0xae61('0x3e')];}}}catch(_0x57a36b){utils[_0xae61('0x28')](util[_0xae61('0x7')](_0xae61('0x42'),_0x2e57a8[_0xae61('0x9')]),_0x57a36b);}};exports[_0xae61('0x43')]=function(_0x4a019b){try{if(!_[_0xae61('0x20')](channels[_0x4a019b[_0xae61('0x9')]])){utils['debug'](util[_0xae61('0x7')](_0xae61('0x44'),_0x4a019b['uniqueid']),_0x4a019b);if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x46')])){utils['info'](util[_0xae61('0x7')](_0xae61('0x47'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x49')]=_0x4a019b[_0xae61('0x48')];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x4a')])){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x4b'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]]['destination']=_0x4a019b[_0xae61('0x48')];channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x2b')]='\x22'+_0x4a019b[_0xae61('0x48')]+_0xae61('0x4c')+_0x4a019b[_0xae61('0x48')]+'>';}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x4d')])||!_['isNil'](_0x4a019b[_0xae61('0x45')]['xmd-callerid'])){utils['info'](util[_0xae61('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4a019b[_0xae61('0x9')],!_[_0xae61('0x20')](_0x4a019b['variable'][_0xae61('0x4d')])?_0xae61('0x4d'):_0xae61('0x4e'),_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]]['callerid']=_0x4a019b['value'];}if(!_['isNil'](_0x4a019b[_0xae61('0x45')][_0xae61('0x4f')])||!_['isNil'](_0x4a019b[_0xae61('0x45')][_0xae61('0x50')])){utils[_0xae61('0x6')](util[_0xae61('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4a019b[_0xae61('0x9')],!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x4f')])?_0xae61('0x4f'):_0xae61('0x50'),_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b['uniqueid']][_0xae61('0x51')]=_0xae61('0x52');channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x53')]=_0x4a019b[_0xae61('0x48')];channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0xb')]=!![];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')]['xmd-contactid'])){utils[_0xae61('0x6')](util['format'](_0xae61('0x54'),_0x4a019b[_0xae61('0x9')],_0x4a019b['value']));channels[_0x4a019b['uniqueid']]['ContactId']=_0x4a019b[_0xae61('0x48')];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x55')])){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x56'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x57')]=_0x4a019b['value'];}if(!_[_0xae61('0x20')](_0x4a019b['variable'][_0xae61('0x58')])){utils[_0xae61('0x6')](util[_0xae61('0x7')](_0xae61('0x59'),_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]][_0xae61('0x5a')]=_0x4a019b[_0xae61('0x48')];}if(!_[_0xae61('0x20')](_0x4a019b[_0xae61('0x45')][_0xae61('0x5b')])){utils[_0xae61('0x6')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4a019b[_0xae61('0x9')],_0x4a019b[_0xae61('0x48')]));channels[_0x4a019b[_0xae61('0x9')]]['sipcallid']=_0x4a019b['value'];}}}catch(_0x2bda06){utils[_0xae61('0x28')](util[_0xae61('0x7')]('[%s][calls][varset]',_0x4a019b[_0xae61('0x9')]),_0x2bda06);}};exports[_0xae61('0x5c')]=function(_0x2be7d8){try{if(!_[_0xae61('0x20')](channels[_0x2be7d8[_0xae61('0x9')]])){utils[_0xae61('0x16')](util[_0xae61('0x7')](_0xae61('0x5d'),_0x2be7d8[_0xae61('0x9')]),_0x2be7d8);utils[_0xae61('0x6')](util['format'](_0xae61('0x5e'),_0x2be7d8[_0xae61('0x9')],_0x2be7d8[_0xae61('0x5f')],_0x2be7d8[_0xae61('0x60')]));if(_0x2be7d8[_0xae61('0x5f')][_0xae61('0x61')]()=='set'&&_[_0xae61('0x62')](_0x2be7d8[_0xae61('0x60')][_0xae61('0x61')](),_0xae61('0x63'))){var _0x43a0fe=_0x2be7d8[_0xae61('0x60')][_0xae61('0x64')]('=');var _0xa7b54c=_0x43a0fe[0x0][_0xae61('0x65')](_0x43a0fe[0x0]['lastIndexOf']('(')+0x1,_0x43a0fe[0x0][_0xae61('0x66')](')'));var _0x4bf0f3=_0x43a0fe[0x1];channels[_0x2be7d8[_0xae61('0x9')]][_0xa7b54c]=_0x4bf0f3;}if(!_['includes']([_0xae61('0x29'),_0xae61('0x67'),'execif','set',_0xae61('0x68')],_0x2be7d8[_0xae61('0x5f')][_0xae61('0x61')]())){channels[_0x2be7d8[_0xae61('0x9')]]['lastapplication']=_0x2be7d8[_0xae61('0x5f')];channels[_0x2be7d8['uniqueid']][_0xae61('0x53')]=_0x2be7d8[_0xae61('0x60')];}}}catch(_0x37cddc){utils[_0xae61('0x28')](util[_0xae61('0x7')](_0xae61('0x5d'),_0x2be7d8[_0xae61('0x9')]),_0x37cddc);}}; \ No newline at end of file +var _0xa4f1=['mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','variable','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','util','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','queue','membername','interface','calleridnum','getUserByInternal','then','UserId','CreateVoiceCallReport','request','newchannel','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','error','debug','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','accountcode','answertime','toNumber','hangup','[%s][calls][hangup]','callerid','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]'];(function(_0xe0f3ca,_0x12e10a){var _0x5db0fd=function(_0x886938){while(--_0x886938){_0xe0f3ca['push'](_0xe0f3ca['shift']());}};_0x5db0fd(++_0x12e10a);}(_0xa4f1,0x158));var _0x1a4f=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xa4f1[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require(_0x1a4f('0x0'));var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0x1a4f('0x1'),_0x1a4f('0x1'),_0x1a4f('0x2'),_0x1a4f('0x2'),_0x1a4f('0x2'),_0x1a4f('0x3'),_0x1a4f('0x4'),'FAILED',_0x1a4f('0x1'),'FAILED'];var channels={};function writeDB(_0x61c814){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x7'),_0x61c814[_0x1a4f('0x8')],_0x61c814['channel'],_0x61c814[_0x1a4f('0x9')],_0x61c814[_0x1a4f('0xa')],_0x61c814[_0x1a4f('0xb')],_0x61c814[_0x1a4f('0xc')],_0x61c814['connectedlinenum'],_0x61c814['lastevent']));if(_0x61c814['accountcode']){utils[_0x1a4f('0xd')](_0x61c814['accountcode'])[_0x1a4f('0xe')](function(_0x4c118e){if(_0x4c118e){_0x61c814[_0x1a4f('0xf')]=_0x4c118e['id'];}utils['request'](_0x1a4f('0x10'),_0x61c814);});}else{utils[_0x1a4f('0x11')](_0x1a4f('0x10'),_0x61c814);}if(channels[_0x61c814[_0x1a4f('0x8')]]){delete channels[_0x61c814['uniqueid']];}}exports[_0x1a4f('0x12')]=function(_0x499dc4){try{utils['debug'](util[_0x1a4f('0x6')](_0x1a4f('0x13'),_0x499dc4[_0x1a4f('0x8')]),_0x499dc4);if(_0x499dc4[_0x1a4f('0x8')]==_0x499dc4[_0x1a4f('0x14')]&&_0x499dc4[_0x1a4f('0x15')]!=_0x1a4f('0x16')){utils['info'](util['format'](_0x1a4f('0x17'),_0x499dc4['uniqueid'],_0x499dc4[_0x1a4f('0x18')],_0x499dc4['exten']));channels[_0x499dc4[_0x1a4f('0x8')]]={'uniqueid':_0x499dc4[_0x1a4f('0x8')],'accountcode':_0x499dc4['accountcode'],'source':_0x499dc4['calleridnum'],'destination':_0x499dc4[_0x1a4f('0x19')],'destinationcontext':_0x499dc4[_0x1a4f('0x18')],'channel':_0x499dc4['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1a4f('0x2'),'amaflags':'DOCUMENTATION'};}}catch(_0x302500){utils[_0x1a4f('0x1a')](util[_0x1a4f('0x6')](_0x1a4f('0x13'),_0x499dc4[_0x1a4f('0x8')]),_0x302500);}};exports['newstate']=function(_0x406884){try{utils[_0x1a4f('0x1b')](util[_0x1a4f('0x6')](_0x1a4f('0x1c'),_0x406884[_0x1a4f('0x8')]),_0x406884);if(!_['isNil'](channels[_0x406884[_0x1a4f('0x8')]])&&_0x406884[_0x1a4f('0x1d')]==0x6){utils['info'](util[_0x1a4f('0x6')](_0x1a4f('0x1e'),_0x406884[_0x1a4f('0x8')],_0x406884[_0x1a4f('0x18')],_0x406884[_0x1a4f('0x15')]));if(_[_0x1a4f('0x1f')](channels[_0x406884[_0x1a4f('0x8')]][_0x1a4f('0x20')])){channels[_0x406884['uniqueid']][_0x1a4f('0x20')]=utils[_0x1a4f('0x21')]();}}else if(!_[_0x1a4f('0x1f')](channels[_0x406884[_0x1a4f('0x14')]])&&_0x406884[_0x1a4f('0x1d')]==0x6&&_0x406884[_0x1a4f('0x18')]!=_0x1a4f('0x22')){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x23'),_0x406884[_0x1a4f('0x8')],_0x406884[_0x1a4f('0x14')],_0x406884[_0x1a4f('0x18')],_0x406884[_0x1a4f('0x15')]));channels[_0x406884[_0x1a4f('0x14')]]['accountcode']=_0x406884[_0x1a4f('0x24')];channels[_0x406884[_0x1a4f('0x14')]]['destinationchannel']=_0x406884[_0x1a4f('0x15')];if(_[_0x1a4f('0x1f')](channels[_0x406884['linkedid']]['answertime'])){channels[_0x406884[_0x1a4f('0x14')]][_0x1a4f('0x25')]=utils[_0x1a4f('0x21')]();}channels[_0x406884['linkedid']]['disposition']=dispositions[_[_0x1a4f('0x26')](_0x406884[_0x1a4f('0x1d')])]||_0x1a4f('0x3');}}catch(_0x4d2351){utils[_0x1a4f('0x1a')](util['format'](_0x1a4f('0x1c'),_0x406884[_0x1a4f('0x8')]),_0x4d2351);}};exports[_0x1a4f('0x27')]=function(_0x4317f8){try{if(!_[_0x1a4f('0x1f')](channels[_0x4317f8[_0x1a4f('0x8')]])){utils[_0x1a4f('0x1b')](util['format'](_0x1a4f('0x28'),_0x4317f8['uniqueid']),_0x4317f8);if(_[_0x1a4f('0x1f')](channels[_0x4317f8['uniqueid']][_0x1a4f('0x29')])){channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x29')]=_0x4317f8['calleridname']+'\x20<'+_0x4317f8['calleridnum']+'>';}utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x4317f8[_0x1a4f('0x8')],channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x29')],_0x4317f8['cause-txt']));channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x2a')]=utils[_0x1a4f('0x21')]();channels[_0x4317f8['uniqueid']][_0x1a4f('0x2b')]=utils[_0x1a4f('0x2c')](channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x2a')],channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x2d')]);channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x2e')]=channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x25')]?utils['diffTime'](channels[_0x4317f8[_0x1a4f('0x8')]][_0x1a4f('0x2a')],channels[_0x4317f8['uniqueid']][_0x1a4f('0x25')]):0x0;writeDB(channels[_0x4317f8[_0x1a4f('0x8')]]);}}catch(_0x172775){utils['error'](util[_0x1a4f('0x6')](_0x1a4f('0x28'),_0x4317f8['uniqueid']),_0x172775);}};exports[_0x1a4f('0x2f')]=function(_0x2cfccd){try{if(!_[_0x1a4f('0x1f')](channels[_0x2cfccd[_0x1a4f('0x30')]])){utils[_0x1a4f('0x1b')](util[_0x1a4f('0x6')](_0x1a4f('0x31'),_0x2cfccd[_0x1a4f('0x32')]),_0x2cfccd);if(channels[_0x2cfccd['localtwolinkedid']]['channel']==_0x2cfccd[_0x1a4f('0x33')]){utils[_0x1a4f('0x5')](util['format'](_0x1a4f('0x34'),_0x2cfccd[_0x1a4f('0x32')],_0x2cfccd[_0x1a4f('0x30')],_0x2cfccd[_0x1a4f('0x35')]));channels[_0x2cfccd[_0x1a4f('0x30')]]['destinationchannel']=_0x2cfccd['secondtransfererchannel'];channels[_0x2cfccd[_0x1a4f('0x30')]]['userfield']=_0x1a4f('0x36');}else if(channels[_0x2cfccd[_0x1a4f('0x30')]]['channel']=_0x2cfccd['transfertargetchannel']){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x34'),_0x2cfccd[_0x1a4f('0x32')],_0x2cfccd[_0x1a4f('0x30')],_0x2cfccd[_0x1a4f('0x37')]));channels[_0x2cfccd['localtwolinkedid']]['destinationchannel']=_0x2cfccd[_0x1a4f('0x37')];channels[_0x2cfccd[_0x1a4f('0x30')]]['userfield']=_0x1a4f('0x36');}}}catch(_0x363c82){utils[_0x1a4f('0x1a')](util[_0x1a4f('0x6')](_0x1a4f('0x31'),_0x2cfccd[_0x1a4f('0x32')]),_0x363c82);}};exports[_0x1a4f('0x38')]=function(_0xe0f78d){try{if(!_[_0x1a4f('0x1f')](channels[_0xe0f78d['uniqueid']])){utils[_0x1a4f('0x1b')](util['format'](_0x1a4f('0x39'),_0xe0f78d['uniqueid']),_0xe0f78d);channels[_0xe0f78d['uniqueid']]['musiconholdstartAt']=utils[_0x1a4f('0x21')]();utils['info'](util[_0x1a4f('0x6')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0xe0f78d[_0x1a4f('0x8')],channels[_0xe0f78d[_0x1a4f('0x8')]][_0x1a4f('0x3a')]));}}catch(_0x528cde){utils[_0x1a4f('0x1a')](util['format'](_0x1a4f('0x39'),_0xe0f78d['uniqueid']),_0x528cde);}};exports['musiconholdstop']=function(_0x32436f){try{if(!_[_0x1a4f('0x1f')](channels[_0x32436f['uniqueid']])){utils['debug'](util[_0x1a4f('0x6')](_0x1a4f('0x3b'),_0x32436f[_0x1a4f('0x8')]),_0x32436f);if(!_[_0x1a4f('0x1f')](channels[_0x32436f[_0x1a4f('0x8')]]['musiconholdstartAt'])){channels[_0x32436f[_0x1a4f('0x8')]][_0x1a4f('0x3c')]+=utils[_0x1a4f('0x2c')](utils[_0x1a4f('0x21')](),channels[_0x32436f[_0x1a4f('0x8')]][_0x1a4f('0x3a')]);utils['info'](util[_0x1a4f('0x6')](_0x1a4f('0x3d'),_0x32436f[_0x1a4f('0x8')],channels[_0x32436f['uniqueid']][_0x1a4f('0x3c')]));delete channels[_0x32436f['uniqueid']]['musiconholdstartAt'];}}}catch(_0x2c50bc){utils['error'](util[_0x1a4f('0x6')](_0x1a4f('0x3b'),_0x32436f[_0x1a4f('0x8')]),_0x2c50bc);}};exports[_0x1a4f('0x3e')]=function(_0x543b83){try{if(!_[_0x1a4f('0x1f')](channels[_0x543b83[_0x1a4f('0x8')]])){utils[_0x1a4f('0x1b')](util['format'](_0x1a4f('0x3f'),_0x543b83['uniqueid']),_0x543b83);if(!_['isNil'](_0x543b83['variable'][_0x1a4f('0x40')])){utils[_0x1a4f('0x5')](util['format'](_0x1a4f('0x41'),_0x543b83['uniqueid'],_0x543b83['value']));channels[_0x543b83['uniqueid']][_0x1a4f('0x42')]=_0x543b83[_0x1a4f('0x43')];}if(!_[_0x1a4f('0x1f')](_0x543b83[_0x1a4f('0x44')]['xmd-phone'])){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x45'),_0x543b83[_0x1a4f('0x8')],_0x543b83[_0x1a4f('0x43')]));channels[_0x543b83[_0x1a4f('0x8')]]['destination']=_0x543b83['value'];channels[_0x543b83['uniqueid']][_0x1a4f('0x29')]='\x22'+_0x543b83[_0x1a4f('0x43')]+_0x1a4f('0x46')+_0x543b83[_0x1a4f('0x43')]+'>';}if(!_['isNil'](_0x543b83['variable'][_0x1a4f('0x47')])||!_[_0x1a4f('0x1f')](_0x543b83[_0x1a4f('0x44')][_0x1a4f('0x48')])){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x49'),_0x543b83['uniqueid'],!_['isNil'](_0x543b83['variable']['xmd-callerid-preview'])?_0x1a4f('0x47'):_0x1a4f('0x48'),_0x543b83[_0x1a4f('0x43')]));channels[_0x543b83[_0x1a4f('0x8')]][_0x1a4f('0x29')]=_0x543b83[_0x1a4f('0x43')];}if(!_[_0x1a4f('0x1f')](_0x543b83[_0x1a4f('0x44')][_0x1a4f('0x4a')])||!_[_0x1a4f('0x1f')](_0x543b83[_0x1a4f('0x44')][_0x1a4f('0x4b')])){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x49'),_0x543b83[_0x1a4f('0x8')],!_[_0x1a4f('0x1f')](_0x543b83['variable'][_0x1a4f('0x4a')])?_0x1a4f('0x4a'):'xmcs-queue',_0x543b83[_0x1a4f('0x43')]));channels[_0x543b83[_0x1a4f('0x8')]][_0x1a4f('0x4c')]='Queue';channels[_0x543b83['uniqueid']][_0x1a4f('0x4d')]=_0x543b83[_0x1a4f('0x43')];channels[_0x543b83[_0x1a4f('0x8')]][_0x1a4f('0x9')]=!![];}if(!_[_0x1a4f('0x1f')](_0x543b83['variable']['xmd-contactid'])){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x4e'),_0x543b83[_0x1a4f('0x8')],_0x543b83[_0x1a4f('0x43')]));channels[_0x543b83['uniqueid']][_0x1a4f('0x4f')]=_0x543b83[_0x1a4f('0x43')];}if(!_[_0x1a4f('0x1f')](_0x543b83['variable']['xmd-cdrtype'])){utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')](_0x1a4f('0x50'),_0x543b83['uniqueid'],_0x543b83[_0x1a4f('0x43')]));channels[_0x543b83[_0x1a4f('0x8')]][_0x1a4f('0x51')]=_0x543b83[_0x1a4f('0x43')];}if(!_['isNil'](_0x543b83[_0x1a4f('0x44')]['outboundrouteid'])){utils['info'](util[_0x1a4f('0x6')](_0x1a4f('0x52'),_0x543b83['uniqueid'],_0x543b83[_0x1a4f('0x43')]));channels[_0x543b83[_0x1a4f('0x8')]][_0x1a4f('0x53')]=_0x543b83[_0x1a4f('0x43')];}if(!_[_0x1a4f('0x1f')](_0x543b83['variable'][_0x1a4f('0x54')])){utils['info'](util[_0x1a4f('0x6')](_0x1a4f('0x55'),_0x543b83[_0x1a4f('0x8')],_0x543b83[_0x1a4f('0x43')]));channels[_0x543b83['uniqueid']][_0x1a4f('0x54')]=_0x543b83[_0x1a4f('0x43')];}}}catch(_0x308c96){utils[_0x1a4f('0x1a')](util[_0x1a4f('0x6')](_0x1a4f('0x3f'),_0x543b83['uniqueid']),_0x308c96);}};exports[_0x1a4f('0x56')]=function(_0x54254c){try{if(!_[_0x1a4f('0x1f')](channels[_0x54254c[_0x1a4f('0x8')]])){utils[_0x1a4f('0x1b')](util[_0x1a4f('0x6')](_0x1a4f('0x57'),_0x54254c[_0x1a4f('0x8')]),_0x54254c);utils[_0x1a4f('0x5')](util[_0x1a4f('0x6')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x54254c[_0x1a4f('0x8')],_0x54254c[_0x1a4f('0x58')],_0x54254c[_0x1a4f('0x59')]));if(_0x54254c[_0x1a4f('0x58')][_0x1a4f('0x5a')]()=='set'&&_[_0x1a4f('0x5b')](_0x54254c[_0x1a4f('0x59')][_0x1a4f('0x5a')](),_0x1a4f('0x5c'))){var _0x18f7cf=_0x54254c[_0x1a4f('0x59')][_0x1a4f('0x5d')]('=');var _0x1522fe=_0x18f7cf[0x0][_0x1a4f('0x5e')](_0x18f7cf[0x0]['lastIndexOf']('(')+0x1,_0x18f7cf[0x0][_0x1a4f('0x5f')](')'));var _0x5176cd=_0x18f7cf[0x1];channels[_0x54254c[_0x1a4f('0x8')]][_0x1522fe]=_0x5176cd;}if(!_[_0x1a4f('0x60')]([_0x1a4f('0x27'),_0x1a4f('0x61'),_0x1a4f('0x62'),_0x1a4f('0x63'),_0x1a4f('0x64')],_0x54254c['application']['toLowerCase']())){channels[_0x54254c[_0x1a4f('0x8')]][_0x1a4f('0x4c')]=_0x54254c[_0x1a4f('0x58')];channels[_0x54254c[_0x1a4f('0x8')]][_0x1a4f('0x4d')]=_0x54254c[_0x1a4f('0x59')];}}}catch(_0x28df9f){utils[_0x1a4f('0x1a')](util['format'](_0x1a4f('0x57'),_0x54254c[_0x1a4f('0x8')]),_0x28df9f);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1ffe8ce..692016e 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 _0x4ff8=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','info'];(function(_0x469393,_0x247969){var _0x5f720d=function(_0x40aeb3){while(--_0x40aeb3){_0x469393['push'](_0x469393['shift']());}};_0x5f720d(++_0x247969);}(_0x4ff8,0x15e));var _0x84ff=function(_0x2a858f,_0x3385a0){_0x2a858f=_0x2a858f-0x0;var _0xe9b8ae=_0x4ff8[_0x2a858f];return _0xe9b8ae;};'use strict';var utils=require(_0x84ff('0x0'));exports['connect']=function(){utils[_0x84ff('0x1')](_0x84ff('0x2'));};exports[_0x84ff('0x3')]=function(){utils['info'](_0x84ff('0x4'));};exports[_0x84ff('0x5')]=function(){utils[_0x84ff('0x1')](_0x84ff('0x6'));};exports[_0x84ff('0x7')]=function(_0x233f46){utils[_0x84ff('0x7')](_0x84ff('0x8'),_0x233f46);};exports['close']=function(){utils[_0x84ff('0x1')](_0x84ff('0x9'));};exports[_0x84ff('0xa')]=function(_0xfc2c61){}; \ No newline at end of file +var _0xc433=['managerevent','./utils','info','[core]\x20connected','[core]\x20shutdown','error','[core]\x20error','close','[core]\x20close'];(function(_0x549a69,_0x1589f3){var _0x3d2812=function(_0x17794c){while(--_0x17794c){_0x549a69['push'](_0x549a69['shift']());}};_0x3d2812(++_0x1589f3);}(_0xc433,0x1b1));var _0x3c43=function(_0x2b89dc,_0x8bfa42){_0x2b89dc=_0x2b89dc-0x0;var _0x412762=_0xc433[_0x2b89dc];return _0x412762;};'use strict';var utils=require(_0x3c43('0x0'));exports['connect']=function(){utils[_0x3c43('0x1')](_0x3c43('0x2'));};exports['shutdown']=function(){utils['info'](_0x3c43('0x3'));};exports['fullybooted']=function(){utils[_0x3c43('0x1')]('[core]\x20fullybooted');};exports[_0x3c43('0x4')]=function(_0x4a32cf){utils[_0x3c43('0x4')](_0x3c43('0x5'),_0x4a32cf);};exports[_0x3c43('0x6')]=function(){utils['info'](_0x3c43('0x7'));};exports[_0x3c43('0x8')]=function(_0x26f551){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index b3361fd..b606c14 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 _0x21d5=['endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','connectedlinenum','dialstatus','request','uniqueid','debug','[%s][dials][newexten]','info','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','complete','duration','diffTime'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x21d5,0x161));var _0x521d=function(_0x3a4827,_0x8a4407){_0x3a4827=_0x3a4827-0x0;var _0xabf933=_0x21d5[_0x3a4827];return _0xabf933;};'use strict';var _=require(_0x521d('0x0'));var util=require(_0x521d('0x1'));var utils=require(_0x521d('0x2'));var dials={};function writeDB(_0x24bb60){utils['info'](util[_0x521d('0x3')](_0x521d('0x4'),_0x24bb60['uniqueid'],_0x24bb60[_0x521d('0x5')],_0x24bb60['dialstring'],_0x24bb60['calleridnum'],_0x24bb60[_0x521d('0x6')],_0x24bb60[_0x521d('0x7')]));utils[_0x521d('0x8')]('CreateVoiceDialReport',_0x24bb60);delete dials[_0x24bb60[_0x521d('0x9')]];}exports['newexten']=function(_0x46ed91){try{utils[_0x521d('0xa')](util[_0x521d('0x3')](_0x521d('0xb'),_0x46ed91['uniqueid']),_0x46ed91);utils[_0x521d('0xc')](util[_0x521d('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x46ed91[_0x521d('0x9')],_0x46ed91['application'],_0x46ed91[_0x521d('0xd')]));if(_0x46ed91['application'][_0x521d('0xe')]()==_0x521d('0xf')&&_[_0x521d('0x10')](_0x46ed91[_0x521d('0xd')][_0x521d('0xe')](),_0x521d('0x11'))){var _0x333428=_0x46ed91[_0x521d('0xd')][_0x521d('0x12')]('=');dials[_0x46ed91[_0x521d('0x9')]]={'routeId':_0x333428[0x1]};}}catch(_0x50ee42){utils[_0x521d('0x13')](util[_0x521d('0x3')](_0x521d('0xb'),_0x46ed91[_0x521d('0x9')]),_0x50ee42);}};exports[_0x521d('0x14')]=function(_0x1009fb){try{utils['debug'](util[_0x521d('0x3')](_0x521d('0x15'),_0x1009fb[_0x521d('0x9')]),_0x1009fb);if(!_[_0x521d('0x16')](_0x1009fb['variable'][_0x521d('0x17')])){utils[_0x521d('0xc')](util['format'](_0x521d('0x18'),_0x1009fb[_0x521d('0x9')],_0x1009fb['value']));dials[_0x1009fb['uniqueid']]={'routeId':_0x1009fb[_0x521d('0x19')]};}}catch(_0x1b323a){utils[_0x521d('0x13')](util[_0x521d('0x3')]('[%s][dials][varset]',_0x1009fb[_0x521d('0x9')]),_0x1b323a);}};exports[_0x521d('0x1a')]=function(_0x3b251d){try{if(!_[_0x521d('0x16')](dials[_0x3b251d['uniqueid']])){utils['debug'](util['format'](_0x521d('0x1b'),_0x3b251d[_0x521d('0x9')]),_0x3b251d);dials[_0x3b251d[_0x521d('0x9')]]=_[_0x521d('0x1c')](dials[_0x3b251d[_0x521d('0x9')]],_0x3b251d);dials[_0x3b251d[_0x521d('0x9')]][_0x521d('0x1d')]=utils[_0x521d('0x1e')]();dials[_0x3b251d[_0x521d('0x9')]][_0x521d('0x1f')]='called';utils[_0x521d('0xc')](util[_0x521d('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x3b251d[_0x521d('0x9')],dials[_0x3b251d['uniqueid']]['starttime']));}}catch(_0x405bf1){utils[_0x521d('0x13')](util[_0x521d('0x3')]('[%s][dials][dialbegin]',_0x3b251d['uniqueid']),_0x405bf1);}};exports['dialend']=function(_0x534f8b){try{if(!_['isNil'](dials[_0x534f8b[_0x521d('0x9')]])){utils[_0x521d('0xa')](util['format'](_0x521d('0x20'),_0x534f8b[_0x521d('0x9')]),_0x534f8b);dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x7')]=_0x534f8b[_0x521d('0x7')];if(_0x534f8b[_0x521d('0x7')]==_0x521d('0x21')){dials[_0x534f8b[_0x521d('0x9')]]=_[_0x521d('0x1c')](dials[_0x534f8b[_0x521d('0x9')]],_0x534f8b);dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x22')]=utils[_0x521d('0x1e')]();dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x1f')]=_0x521d('0x23');utils['info'](util[_0x521d('0x3')](_0x521d('0x24'),_0x534f8b[_0x521d('0x9')],_0x534f8b[_0x521d('0x7')],dials[_0x534f8b[_0x521d('0x9')]][_0x521d('0x22')]));}else{utils[_0x521d('0xc')](util[_0x521d('0x3')](_0x521d('0x25'),_0x534f8b[_0x521d('0x9')],_0x534f8b[_0x521d('0x7')]));}}}catch(_0x3ec5a7){utils[_0x521d('0x13')](util[_0x521d('0x3')](_0x521d('0x20'),_0x534f8b[_0x521d('0x9')]),_0x3ec5a7);}};exports[_0x521d('0x26')]=function(_0x2290db){try{if(!_[_0x521d('0x16')](dials[_0x2290db[_0x521d('0x9')]])){utils[_0x521d('0xa')](util[_0x521d('0x3')](_0x521d('0x27'),_0x2290db[_0x521d('0x9')]),_0x2290db);utils[_0x521d('0xc')](util[_0x521d('0x3')](_0x521d('0x28'),_0x2290db[_0x521d('0x9')],_0x2290db[_0x521d('0x29')],_0x2290db[_0x521d('0x2a')],_0x2290db[_0x521d('0x2b')]));dials[_0x2290db[_0x521d('0x9')]]=_[_0x521d('0x1c')](dials[_0x2290db[_0x521d('0x9')]],{'endtime':utils['now'](),'lastevent':_0x521d('0x2c')});dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2d')]=utils[_0x521d('0x2e')](dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2f')],dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x1d')]);dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x30')]=utils[_0x521d('0x2e')](dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x22')]||dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2f')],dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x1d')]);dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x31')]=dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x22')]?utils[_0x521d('0x2e')](dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x2f')],dials[_0x2290db[_0x521d('0x9')]][_0x521d('0x22')]):0x0;writeDB(dials[_0x2290db[_0x521d('0x9')]]);}}catch(_0x5b970d){utils[_0x521d('0x13')](util[_0x521d('0x3')]('[%s][dials][hangup]',_0x2290db[_0x521d('0x9')]),_0x5b970d);}}; \ No newline at end of file +var _0x87cb=['newexten','debug','[%s][dials][newexten]','info','application','appdata','toLowerCase','set','cdr(routeid)','split','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','dialend','[%s][dials][dialend]','answertime','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport'];(function(_0xea207,_0x5f395f){var _0x58ef7f=function(_0x8371fc){while(--_0x8371fc){_0xea207['push'](_0xea207['shift']());}};_0x58ef7f(++_0x5f395f);}(_0x87cb,0xe4));var _0xb87c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x87cb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb87c('0x0'));var util=require(_0xb87c('0x1'));var utils=require(_0xb87c('0x2'));var dials={};function writeDB(_0x19d885){utils['info'](util[_0xb87c('0x3')](_0xb87c('0x4'),_0x19d885[_0xb87c('0x5')],_0x19d885['channel'],_0x19d885[_0xb87c('0x6')],_0x19d885[_0xb87c('0x7')],_0x19d885[_0xb87c('0x8')],_0x19d885[_0xb87c('0x9')]));utils[_0xb87c('0xa')](_0xb87c('0xb'),_0x19d885);delete dials[_0x19d885['uniqueid']];}exports[_0xb87c('0xc')]=function(_0x259e7b){try{utils[_0xb87c('0xd')](util['format'](_0xb87c('0xe'),_0x259e7b[_0xb87c('0x5')]),_0x259e7b);utils[_0xb87c('0xf')](util[_0xb87c('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x259e7b[_0xb87c('0x5')],_0x259e7b[_0xb87c('0x10')],_0x259e7b[_0xb87c('0x11')]));if(_0x259e7b[_0xb87c('0x10')][_0xb87c('0x12')]()==_0xb87c('0x13')&&_['startsWith'](_0x259e7b['appdata'][_0xb87c('0x12')](),_0xb87c('0x14'))){var _0x24f15f=_0x259e7b['appdata'][_0xb87c('0x15')]('=');dials[_0x259e7b[_0xb87c('0x5')]]={'routeId':_0x24f15f[0x1]};}}catch(_0x24bcbe){utils['error'](util[_0xb87c('0x3')](_0xb87c('0xe'),_0x259e7b[_0xb87c('0x5')]),_0x24bcbe);}};exports[_0xb87c('0x16')]=function(_0x432b7e){try{utils[_0xb87c('0xd')](util[_0xb87c('0x3')](_0xb87c('0x17'),_0x432b7e[_0xb87c('0x5')]),_0x432b7e);if(!_[_0xb87c('0x18')](_0x432b7e['variable'][_0xb87c('0x19')])){utils[_0xb87c('0xf')](util[_0xb87c('0x3')](_0xb87c('0x1a'),_0x432b7e[_0xb87c('0x5')],_0x432b7e[_0xb87c('0x1b')]));dials[_0x432b7e[_0xb87c('0x5')]]={'routeId':_0x432b7e[_0xb87c('0x1b')]};}}catch(_0x2d4770){utils[_0xb87c('0x1c')](util[_0xb87c('0x3')](_0xb87c('0x17'),_0x432b7e[_0xb87c('0x5')]),_0x2d4770);}};exports['dialbegin']=function(_0x23fef0){try{if(!_[_0xb87c('0x18')](dials[_0x23fef0[_0xb87c('0x5')]])){utils[_0xb87c('0xd')](util[_0xb87c('0x3')](_0xb87c('0x1d'),_0x23fef0[_0xb87c('0x5')]),_0x23fef0);dials[_0x23fef0[_0xb87c('0x5')]]=_[_0xb87c('0x1e')](dials[_0x23fef0[_0xb87c('0x5')]],_0x23fef0);dials[_0x23fef0[_0xb87c('0x5')]][_0xb87c('0x1f')]=utils[_0xb87c('0x20')]();dials[_0x23fef0[_0xb87c('0x5')]][_0xb87c('0x21')]=_0xb87c('0x22');utils[_0xb87c('0xf')](util[_0xb87c('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x23fef0[_0xb87c('0x5')],dials[_0x23fef0['uniqueid']][_0xb87c('0x1f')]));}}catch(_0x25ab89){utils['error'](util[_0xb87c('0x3')]('[%s][dials][dialbegin]',_0x23fef0[_0xb87c('0x5')]),_0x25ab89);}};exports[_0xb87c('0x23')]=function(_0xb7b1ce){try{if(!_[_0xb87c('0x18')](dials[_0xb7b1ce[_0xb87c('0x5')]])){utils['debug'](util['format'](_0xb87c('0x24'),_0xb7b1ce['uniqueid']),_0xb7b1ce);dials[_0xb7b1ce[_0xb87c('0x5')]][_0xb87c('0x9')]=_0xb7b1ce[_0xb87c('0x9')];if(_0xb7b1ce['dialstatus']=='ANSWER'){dials[_0xb7b1ce['uniqueid']]=_[_0xb87c('0x1e')](dials[_0xb7b1ce[_0xb87c('0x5')]],_0xb7b1ce);dials[_0xb7b1ce[_0xb87c('0x5')]][_0xb87c('0x25')]=utils['now']();dials[_0xb7b1ce[_0xb87c('0x5')]]['lastevent']='connect';utils[_0xb87c('0xf')](util['format'](_0xb87c('0x26'),_0xb7b1ce[_0xb87c('0x5')],_0xb7b1ce['dialstatus'],dials[_0xb7b1ce[_0xb87c('0x5')]][_0xb87c('0x25')]));}else{utils[_0xb87c('0xf')](util['format'](_0xb87c('0x27'),_0xb7b1ce[_0xb87c('0x5')],_0xb7b1ce[_0xb87c('0x9')]));}}}catch(_0x3ce15a){utils[_0xb87c('0x1c')](util['format'](_0xb87c('0x24'),_0xb7b1ce[_0xb87c('0x5')]),_0x3ce15a);}};exports['hangup']=function(_0x2fc3d5){try{if(!_['isNil'](dials[_0x2fc3d5['uniqueid']])){utils['debug'](util[_0xb87c('0x3')](_0xb87c('0x28'),_0x2fc3d5[_0xb87c('0x5')]),_0x2fc3d5);utils[_0xb87c('0xf')](util[_0xb87c('0x3')](_0xb87c('0x29'),_0x2fc3d5[_0xb87c('0x5')],_0x2fc3d5['calleridnum'],_0x2fc3d5[_0xb87c('0x2a')],_0x2fc3d5[_0xb87c('0x2b')]));dials[_0x2fc3d5[_0xb87c('0x5')]]=_[_0xb87c('0x1e')](dials[_0x2fc3d5['uniqueid']],{'endtime':utils[_0xb87c('0x20')](),'lastevent':_0xb87c('0x2c')});dials[_0x2fc3d5[_0xb87c('0x5')]][_0xb87c('0x2d')]=utils[_0xb87c('0x2e')](dials[_0x2fc3d5[_0xb87c('0x5')]][_0xb87c('0x2f')],dials[_0x2fc3d5[_0xb87c('0x5')]][_0xb87c('0x1f')]);dials[_0x2fc3d5[_0xb87c('0x5')]]['holdtime']=utils[_0xb87c('0x2e')](dials[_0x2fc3d5[_0xb87c('0x5')]]['answertime']||dials[_0x2fc3d5[_0xb87c('0x5')]][_0xb87c('0x2f')],dials[_0x2fc3d5['uniqueid']][_0xb87c('0x1f')]);dials[_0x2fc3d5['uniqueid']]['billableseconds']=dials[_0x2fc3d5[_0xb87c('0x5')]][_0xb87c('0x25')]?utils[_0xb87c('0x2e')](dials[_0x2fc3d5[_0xb87c('0x5')]][_0xb87c('0x2f')],dials[_0x2fc3d5[_0xb87c('0x5')]][_0xb87c('0x25')]):0x0;writeDB(dials[_0x2fc3d5['uniqueid']]);}}catch(_0x2f240a){utils['error'](util[_0xb87c('0x3')](_0xb87c('0x28'),_0x2fc3d5[_0xb87c('0x5')]),_0x2f240a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 69662c2..e7a8151 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 _0x03af=['info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','production','asterisk','username','password'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x03af,0xbf));var _0xf03a=function(_0x409d5f,_0x49f44d){_0x409d5f=_0x409d5f-0x0;var _0x100008=_0x03af[_0x409d5f];return _0x100008;};var AsteriskManager=require(_0xf03a('0x0'));var config=require(_0xf03a('0x1'));var utils=require(_0xf03a('0x2'));var util=require(_0xf03a('0x3'));var isXDREnabled=config[_0xf03a('0x4')]&&config['xdr']['disabled']?!config[_0xf03a('0x4')][_0xf03a('0x5')]:!![];var isProduction=config['env']===_0xf03a('0x6')||![];var isLocalAsterisk=config[_0xf03a('0x4')]&&config[_0xf03a('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config['asterisk']['ip'],config[_0xf03a('0x7')][_0xf03a('0x8')],config['asterisk'][_0xf03a('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xf03a('0xa')](_0xf03a('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xf03a('0xc'));}else{var agents=require('./agents.controller');var calls=require(_0xf03a('0xd'));var queues=require(_0xf03a('0xe'));var recordings=require(_0xf03a('0xf'));var members=require('./members.controller');var dials=require(_0xf03a('0x10'));var transfers=require(_0xf03a('0x11'));var core=require(_0xf03a('0x12'));ami['on'](_0xf03a('0x13'),core[_0xf03a('0x13')]);ami['on'](_0xf03a('0x14'),core[_0xf03a('0x14')]);ami['on'](_0xf03a('0x15'),core['fullybooted']);ami['on'](_0xf03a('0x16'),core['error']);ami['on']('close',core[_0xf03a('0x17')]);ami['on']('managerevent',core[_0xf03a('0x18')]);ami['on'](_0xf03a('0x19'),function(_0x1b55ce){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][devicestatechange]',_0x1b55ce[_0xf03a('0x1c')]),_0x1b55ce);members[_0xf03a('0x19')](_0x1b55ce);}catch(_0x49daea){utils['error'](util['format'](_0xf03a('0x1d'),_0x1b55ce[_0xf03a('0x1c')]),_0x49daea);}});ami['on']('agentcalled',function(_0x8e2c59){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][agentcalled]',_0x8e2c59[_0xf03a('0x1e')]),_0x8e2c59);agents['agentcalled'](_0x8e2c59);}catch(_0x38faea){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x1f'),_0x8e2c59[_0xf03a('0x1e')]),_0x38faea);}});ami['on'](_0xf03a('0x20'),function(_0x12fd4c){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][agentringnoanswer]',_0x12fd4c[_0xf03a('0x1e')]),_0x12fd4c);agents[_0xf03a('0x20')](_0x12fd4c);}catch(_0x4ac52d){utils[_0xf03a('0x16')](util['format'](_0xf03a('0x21'),_0x12fd4c[_0xf03a('0x1e')]),_0x4ac52d);}});ami['on'](_0xf03a('0x22'),function(_0x6ef619){try{utils[_0xf03a('0x1a')](util['format'](_0xf03a('0x23'),_0x6ef619['uniqueid']),_0x6ef619);agents['agentconnect'](_0x6ef619);queues['agentconnect'](_0x6ef619);}catch(_0x280e3e){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x23'),_0x6ef619[_0xf03a('0x1e')]),_0x280e3e);}});ami['on'](_0xf03a('0x24'),function(_0x132609){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][agentcomplete]',_0x132609[_0xf03a('0x1e')]),_0x132609);agents[_0xf03a('0x24')](_0x132609);queues[_0xf03a('0x24')](_0x132609);members[_0xf03a('0x24')](_0x132609);}catch(_0x1ca279){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x25'),_0x132609[_0xf03a('0x1e')]),_0x1ca279);}});ami['on'](_0xf03a('0x26'),function(_0x428c77){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x27'),_0x428c77[_0xf03a('0x1e')]),_0x428c77);agents[_0xf03a('0x26')](_0x428c77);queues[_0xf03a('0x26')](_0x428c77);}catch(_0x423c6c){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x27'),_0x428c77[_0xf03a('0x1e')]),_0x423c6c);}});ami['on'](_0xf03a('0x28'),function(_0x1a1f23){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][queuecallerjoin]',_0x1a1f23[_0xf03a('0x1e')]),_0x1a1f23);queues[_0xf03a('0x28')](_0x1a1f23);recordings['queuecallerjoin'](_0x1a1f23);}catch(_0x1d33cc){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s][index][queuecallerjoin]',_0x1a1f23[_0xf03a('0x1e')]),_0x1d33cc);}});ami['on'](_0xf03a('0x29'),function(_0x253e77){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x2a'),_0x253e77[_0xf03a('0x1e')]),_0x253e77);queues[_0xf03a('0x29')](_0x253e77);}catch(_0x36e812){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x2a'),_0x253e77[_0xf03a('0x1e')]),_0x36e812);}});ami['on'](_0xf03a('0x2b'),function(_0x5d9102){try{utils[_0xf03a('0x1a')](util['format'](_0xf03a('0x2c'),_0x5d9102[_0xf03a('0x1e')]),_0x5d9102);queues[_0xf03a('0x2b')](_0x5d9102);calls[_0xf03a('0x2b')](_0x5d9102);}catch(_0x594d1d){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x2c'),_0x5d9102[_0xf03a('0x1e')]),_0x594d1d);}});ami['on'](_0xf03a('0x2d'),function(_0x41fe8e){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x2e'),_0x41fe8e[_0xf03a('0x1e')]),_0x41fe8e);queues[_0xf03a('0x2d')](_0x41fe8e);calls[_0xf03a('0x2d')](_0x41fe8e);}catch(_0x47d311){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x2e'),_0x41fe8e[_0xf03a('0x1e')]),_0x47d311);}});ami['on'](_0xf03a('0x2f'),function(_0x5d6fe0){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x30'),_0x5d6fe0[_0xf03a('0x1e')]),_0x5d6fe0);calls['newstate'](_0x5d6fe0);recordings[_0xf03a('0x2f')](_0x5d6fe0);}catch(_0x19fd0c){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s][index][newstate]',_0x5d6fe0[_0xf03a('0x1e')]),_0x19fd0c);}});ami['on'](_0xf03a('0x31'),function(_0x196afb){try{utils[_0xf03a('0x1a')](util['format'](_0xf03a('0x32'),_0x196afb['uniqueid']),_0x196afb);calls[_0xf03a('0x31')](_0x196afb);recordings[_0xf03a('0x31')](_0x196afb);dials['hangup'](_0x196afb);agents[_0xf03a('0x31')](_0x196afb);queues[_0xf03a('0x31')](_0x196afb);}catch(_0x1d32a8){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x32'),_0x196afb[_0xf03a('0x1e')]),_0x1d32a8);}});ami['on'](_0xf03a('0x33'),function(_0x362d0c){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][cdr]',_0x362d0c['uniqueid']),_0x362d0c);members['cdr'](_0x362d0c);}catch(_0x37134b){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x34'),_0x362d0c[_0xf03a('0x1e')]),_0x37134b);}});ami['on']('blindtransfer',function(_0x2daef4){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x35'),_0x2daef4[_0xf03a('0x1e')]),_0x2daef4);queues[_0xf03a('0x36')](_0x2daef4);agents[_0xf03a('0x36')](_0x2daef4);transfers['blindtransfer'](_0x2daef4);}catch(_0x32ce3d){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')](_0xf03a('0x35'),_0x2daef4[_0xf03a('0x1e')]),_0x32ce3d);}});ami['on'](_0xf03a('0x37'),function(_0x2dadb4){try{utils[_0xf03a('0x1a')](util['format']('[%s][index][attendedtransfer]',_0x2dadb4['origtransfereruniqueid']),_0x2dadb4);queues[_0xf03a('0x37')](_0x2dadb4);transfers[_0xf03a('0x37')](_0x2dadb4);agents['attendedtransfer'](_0x2dadb4);calls[_0xf03a('0x37')](_0x2dadb4);}catch(_0x49c0ae){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s][index][attendedtransfer]',_0x2dadb4[_0xf03a('0x38')]),_0x49c0ae);}});ami['on']('varset',function(_0x345477){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x39'),_0x345477[_0xf03a('0x1e')]),_0x345477);queues[_0xf03a('0x3a')](_0x345477);recordings[_0xf03a('0x3a')](_0x345477);calls[_0xf03a('0x3a')](_0x345477);dials[_0xf03a('0x3a')](_0x345477);}catch(_0x22ff64){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x39'),_0x345477['uniqueid']),_0x22ff64);}});ami['on'](_0xf03a('0x3b'),function(_0x3c334f){try{utils['debug'](util[_0xf03a('0x1b')](_0xf03a('0x3c'),_0x3c334f[_0xf03a('0x1e')]),_0x3c334f);calls[_0xf03a('0x3b')](_0x3c334f);recordings[_0xf03a('0x3b')](_0x3c334f);dials[_0xf03a('0x3b')](_0x3c334f);}catch(_0x3aa802){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x3c'),_0x3c334f[_0xf03a('0x1e')]),_0x3aa802);}});ami['on'](_0xf03a('0x3d'),function(_0x197254){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')]('[%s][index][newchannel]',_0x197254[_0xf03a('0x1e')]),_0x197254);calls[_0xf03a('0x3d')](_0x197254);recordings[_0xf03a('0x3d')](_0x197254);}catch(_0x546732){utils['error'](util[_0xf03a('0x1b')](_0xf03a('0x3e'),_0x197254[_0xf03a('0x1e')]),_0x546732);}});ami['on'](_0xf03a('0x3f'),function(_0x4e7f62){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x40'),_0x4e7f62[_0xf03a('0x1e')]),_0x4e7f62);dials['dialbegin'](_0x4e7f62);}catch(_0x4756bb){utils[_0xf03a('0x16')](util[_0xf03a('0x1b')]('[%s]dialbegin',_0x4e7f62[_0xf03a('0x1e')]),_0x4756bb);}});ami['on'](_0xf03a('0x41'),function(_0x493406){try{utils[_0xf03a('0x1a')](util[_0xf03a('0x1b')](_0xf03a('0x42'),_0x493406[_0xf03a('0x1e')]),_0x493406);dials[_0xf03a('0x41')](_0x493406);}catch(_0x5ea994){utils[_0xf03a('0x16')](util['format'](_0xf03a('0x42'),_0x493406[_0xf03a('0x1e')]),_0x5ea994);}});} \ No newline at end of file +var _0x3a2a=['./calls.controller','./queues.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','format','[%s][index][devicestatechange]','device','devicestatechange','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','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','util','xdr','disabled','env','production','local','asterisk','port','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller'];(function(_0x303d59,_0x521e27){var _0xcf4486=function(_0x1b5ae1){while(--_0x1b5ae1){_0x303d59['push'](_0x303d59['shift']());}};_0xcf4486(++_0x521e27);}(_0x3a2a,0x101));var _0xa3a2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3a2a[_0x17d9e3];return _0x14192d;};var AsteriskManager=require(_0xa3a2('0x0'));var config=require(_0xa3a2('0x1'));var utils=require('./utils');var util=require(_0xa3a2('0x2'));var isXDREnabled=config[_0xa3a2('0x3')]&&config['xdr']['disabled']?!config[_0xa3a2('0x3')][_0xa3a2('0x4')]:!![];var isProduction=config[_0xa3a2('0x5')]===_0xa3a2('0x6')||![];var isLocalAsterisk=config[_0xa3a2('0x3')]&&config[_0xa3a2('0x3')][_0xa3a2('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xa3a2('0x8')][_0xa3a2('0x9')],config[_0xa3a2('0x8')]['ip'],config[_0xa3a2('0x8')]['username'],config[_0xa3a2('0x8')]['password'],!![]);ami[_0xa3a2('0xa')]();if(!isXDREnabled){utils[_0xa3a2('0xb')](_0xa3a2('0xc'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xa3a2('0xb')](_0xa3a2('0xd'));}else{var agents=require(_0xa3a2('0xe'));var calls=require(_0xa3a2('0xf'));var queues=require(_0xa3a2('0x10'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xa3a2('0x11'));var transfers=require('./transfers.controller');var core=require(_0xa3a2('0x12'));ami['on'](_0xa3a2('0x13'),core[_0xa3a2('0x13')]);ami['on'](_0xa3a2('0x14'),core[_0xa3a2('0x14')]);ami['on'](_0xa3a2('0x15'),core[_0xa3a2('0x15')]);ami['on'](_0xa3a2('0x16'),core[_0xa3a2('0x16')]);ami['on']('close',core[_0xa3a2('0x17')]);ami['on']('managerevent',core[_0xa3a2('0x18')]);ami['on']('devicestatechange',function(_0x2b9f4e){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x1b'),_0x2b9f4e[_0xa3a2('0x1c')]),_0x2b9f4e);members[_0xa3a2('0x1d')](_0x2b9f4e);}catch(_0x50b9b3){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')]('[%s][index][devicestatechange]',_0x2b9f4e['device']),_0x50b9b3);}});ami['on'](_0xa3a2('0x1e'),function(_0x4bec6f){try{utils[_0xa3a2('0x19')](util['format'](_0xa3a2('0x1f'),_0x4bec6f[_0xa3a2('0x20')]),_0x4bec6f);agents['agentcalled'](_0x4bec6f);}catch(_0x166ce7){utils['error'](util[_0xa3a2('0x1a')](_0xa3a2('0x1f'),_0x4bec6f[_0xa3a2('0x20')]),_0x166ce7);}});ami['on'](_0xa3a2('0x21'),function(_0x370ebd){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x22'),_0x370ebd['uniqueid']),_0x370ebd);agents['agentringnoanswer'](_0x370ebd);}catch(_0x5b8396){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x22'),_0x370ebd['uniqueid']),_0x5b8396);}});ami['on'](_0xa3a2('0x23'),function(_0x2591e2){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x24'),_0x2591e2[_0xa3a2('0x20')]),_0x2591e2);agents[_0xa3a2('0x23')](_0x2591e2);queues[_0xa3a2('0x23')](_0x2591e2);}catch(_0x5566a0){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x24'),_0x2591e2[_0xa3a2('0x20')]),_0x5566a0);}});ami['on'](_0xa3a2('0x25'),function(_0x437ed4){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x26'),_0x437ed4['uniqueid']),_0x437ed4);agents[_0xa3a2('0x25')](_0x437ed4);queues[_0xa3a2('0x25')](_0x437ed4);members[_0xa3a2('0x25')](_0x437ed4);}catch(_0x4ac8ea){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')]('[%s][index][agentcomplete]',_0x437ed4[_0xa3a2('0x20')]),_0x4ac8ea);}});ami['on'](_0xa3a2('0x27'),function(_0x5eae39){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x28'),_0x5eae39[_0xa3a2('0x20')]),_0x5eae39);agents[_0xa3a2('0x27')](_0x5eae39);queues[_0xa3a2('0x27')](_0x5eae39);}catch(_0x1e36e1){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x28'),_0x5eae39[_0xa3a2('0x20')]),_0x1e36e1);}});ami['on'](_0xa3a2('0x29'),function(_0x572af6){try{utils[_0xa3a2('0x19')](util['format']('[%s][index][queuecallerjoin]',_0x572af6[_0xa3a2('0x20')]),_0x572af6);queues[_0xa3a2('0x29')](_0x572af6);recordings[_0xa3a2('0x29')](_0x572af6);}catch(_0xb845d8){utils['error'](util[_0xa3a2('0x1a')]('[%s][index][queuecallerjoin]',_0x572af6[_0xa3a2('0x20')]),_0xb845d8);}});ami['on'](_0xa3a2('0x2a'),function(_0x3208df){try{utils[_0xa3a2('0x19')](util['format'](_0xa3a2('0x2b'),_0x3208df[_0xa3a2('0x20')]),_0x3208df);queues[_0xa3a2('0x2a')](_0x3208df);}catch(_0x51634d){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x2b'),_0x3208df[_0xa3a2('0x20')]),_0x51634d);}});ami['on'](_0xa3a2('0x2c'),function(_0x8078f9){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x2d'),_0x8078f9[_0xa3a2('0x20')]),_0x8078f9);queues['musiconholdstart'](_0x8078f9);calls[_0xa3a2('0x2c')](_0x8078f9);}catch(_0x3ee584){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')]('[%s][index][musiconholdstart]',_0x8078f9[_0xa3a2('0x20')]),_0x3ee584);}});ami['on'](_0xa3a2('0x2e'),function(_0x460c0e){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x2f'),_0x460c0e[_0xa3a2('0x20')]),_0x460c0e);queues[_0xa3a2('0x2e')](_0x460c0e);calls[_0xa3a2('0x2e')](_0x460c0e);}catch(_0x2a01db){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x2f'),_0x460c0e[_0xa3a2('0x20')]),_0x2a01db);}});ami['on'](_0xa3a2('0x30'),function(_0x18ba6b){try{utils[_0xa3a2('0x19')](util['format']('[%s][index][newstate]',_0x18ba6b[_0xa3a2('0x20')]),_0x18ba6b);calls[_0xa3a2('0x30')](_0x18ba6b);recordings[_0xa3a2('0x30')](_0x18ba6b);}catch(_0x58b5b6){utils['error'](util[_0xa3a2('0x1a')]('[%s][index][newstate]',_0x18ba6b[_0xa3a2('0x20')]),_0x58b5b6);}});ami['on']('hangup',function(_0x265397){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x31'),_0x265397[_0xa3a2('0x20')]),_0x265397);calls['hangup'](_0x265397);recordings[_0xa3a2('0x32')](_0x265397);dials[_0xa3a2('0x32')](_0x265397);agents[_0xa3a2('0x32')](_0x265397);queues['hangup'](_0x265397);}catch(_0x2e410b){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x31'),_0x265397[_0xa3a2('0x20')]),_0x2e410b);}});ami['on'](_0xa3a2('0x33'),function(_0x119051){try{utils[_0xa3a2('0x19')](util['format'](_0xa3a2('0x34'),_0x119051[_0xa3a2('0x20')]),_0x119051);members[_0xa3a2('0x33')](_0x119051);}catch(_0x1d71e8){utils['error'](util[_0xa3a2('0x1a')](_0xa3a2('0x34'),_0x119051[_0xa3a2('0x20')]),_0x1d71e8);}});ami['on']('blindtransfer',function(_0x1dc221){try{utils[_0xa3a2('0x19')](util['format'](_0xa3a2('0x35'),_0x1dc221[_0xa3a2('0x20')]),_0x1dc221);queues[_0xa3a2('0x36')](_0x1dc221);agents[_0xa3a2('0x36')](_0x1dc221);transfers[_0xa3a2('0x36')](_0x1dc221);}catch(_0x5ac268){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x35'),_0x1dc221['uniqueid']),_0x5ac268);}});ami['on'](_0xa3a2('0x37'),function(_0x5c8763){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x38'),_0x5c8763[_0xa3a2('0x39')]),_0x5c8763);queues[_0xa3a2('0x37')](_0x5c8763);transfers[_0xa3a2('0x37')](_0x5c8763);agents['attendedtransfer'](_0x5c8763);calls[_0xa3a2('0x37')](_0x5c8763);}catch(_0x23cf07){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x38'),_0x5c8763[_0xa3a2('0x39')]),_0x23cf07);}});ami['on'](_0xa3a2('0x3a'),function(_0x1907b1){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x3b'),_0x1907b1[_0xa3a2('0x20')]),_0x1907b1);queues[_0xa3a2('0x3a')](_0x1907b1);recordings['varset'](_0x1907b1);calls[_0xa3a2('0x3a')](_0x1907b1);dials['varset'](_0x1907b1);}catch(_0x647705){utils['error'](util[_0xa3a2('0x1a')](_0xa3a2('0x3b'),_0x1907b1['uniqueid']),_0x647705);}});ami['on'](_0xa3a2('0x3c'),function(_0x5afedd){try{utils['debug'](util[_0xa3a2('0x1a')](_0xa3a2('0x3d'),_0x5afedd[_0xa3a2('0x20')]),_0x5afedd);calls['newexten'](_0x5afedd);recordings[_0xa3a2('0x3c')](_0x5afedd);dials[_0xa3a2('0x3c')](_0x5afedd);}catch(_0xdef7bf){utils['error'](util['format'](_0xa3a2('0x3d'),_0x5afedd['uniqueid']),_0xdef7bf);}});ami['on']('newchannel',function(_0x1b68af){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')]('[%s][index][newchannel]',_0x1b68af[_0xa3a2('0x20')]),_0x1b68af);calls[_0xa3a2('0x3e')](_0x1b68af);recordings['newchannel'](_0x1b68af);}catch(_0x515ba8){utils[_0xa3a2('0x16')](util[_0xa3a2('0x1a')](_0xa3a2('0x3f'),_0x1b68af[_0xa3a2('0x20')]),_0x515ba8);}});ami['on'](_0xa3a2('0x40'),function(_0x15ef2b){try{utils[_0xa3a2('0x19')](util['format']('[%s][index][dialbegin]',_0x15ef2b[_0xa3a2('0x20')]),_0x15ef2b);dials[_0xa3a2('0x40')](_0x15ef2b);}catch(_0x2db671){utils[_0xa3a2('0x16')](util['format'](_0xa3a2('0x41'),_0x15ef2b[_0xa3a2('0x20')]),_0x2db671);}});ami['on'](_0xa3a2('0x42'),function(_0x418470){try{utils[_0xa3a2('0x19')](util[_0xa3a2('0x1a')](_0xa3a2('0x43'),_0x418470['uniqueid']),_0x418470);dials['dialend'](_0x418470);}catch(_0x30ba3a){utils['error'](util['format'](_0xa3a2('0x43'),_0x418470[_0xa3a2('0x20')]),_0x30ba3a);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 90343a6..24a564b 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 _0x3cd1=['channel','data2','getUserByInterface','then','membername','name','internal','CreateMemberReport','getUserByName','split','catch','error','[%s][members][writeDB]','uniqueid','startsWith','debug','[%s][members][devicestatechange]','device','INUSE','BUSY','voice','agent','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','data1','type','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3cd1,0x112));var _0x13cd=function(_0x44d71f,_0x1f8f25){_0x44d71f=_0x44d71f-0x0;var _0x57e28b=_0x3cd1[_0x44d71f];return _0x57e28b;};'use strict';var _=require('lodash');var util=require(_0x13cd('0x0'));var utils=require(_0x13cd('0x1'));var members={};var exclude=[_0x13cd('0x2'),_0x13cd('0x3')];function writeDB(_0x105bd6){utils[_0x13cd('0x4')](util[_0x13cd('0x5')](_0x13cd('0x6'),_0x105bd6['uniqueid'],_0x105bd6[_0x13cd('0x7')],_0x105bd6[_0x13cd('0x8')],_0x105bd6[_0x13cd('0x9')],_0x105bd6['membername'],_0x105bd6['type']));if(_0x105bd6[_0x13cd('0x7')]){utils[_0x13cd('0xa')](_0x105bd6[_0x13cd('0x7')])[_0x13cd('0xb')](function(_0x5a9b59){if(_0x5a9b59){_0x105bd6[_0x13cd('0xc')]=_0x5a9b59[_0x13cd('0xd')];_0x105bd6[_0x13cd('0xe')]=_0x5a9b59['internal'];utils['request'](_0x13cd('0xf'),_0x105bd6);}else{utils[_0x13cd('0x10')](_0x105bd6[_0x13cd('0x7')][_0x13cd('0x11')]('/')[0x1])[_0x13cd('0xb')](function(_0x4041a1){if(_0x4041a1){_0x105bd6[_0x13cd('0xc')]=_0x4041a1['name'];_0x105bd6[_0x13cd('0xe')]=_0x4041a1[_0x13cd('0xe')];utils['request'](_0x13cd('0xf'),_0x105bd6);}});}})[_0x13cd('0x12')](function(_0x415eaa){utils[_0x13cd('0x13')](util[_0x13cd('0x5')](_0x13cd('0x14'),_0x105bd6[_0x13cd('0x15')]),_0x415eaa);});}delete members[_0x105bd6[_0x13cd('0x7')]];}function startsWith(_0x5cf7a4,_0x24b647){return _['some'](_0x5cf7a4,function(_0x3d790d){return _[_0x13cd('0x16')](_0x24b647,_0x3d790d);});}exports['devicestatechange']=function(_0x1bd779){try{utils[_0x13cd('0x17')](util[_0x13cd('0x5')](_0x13cd('0x18'),members[_0x1bd779[_0x13cd('0x19')]]?members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x15')]:_0x1bd779[_0x13cd('0x19')]),_0x1bd779);utils['info'](util[_0x13cd('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1bd779[_0x13cd('0x19')]]?members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x15')]:_0x1bd779[_0x13cd('0x19')],_0x1bd779['state'],_0x1bd779[_0x13cd('0x19')]));switch(_0x1bd779['state']){case _0x13cd('0x1a'):case _0x13cd('0x1b'):if(!startsWith(exclude,_0x1bd779[_0x13cd('0x19')])){members[_0x1bd779[_0x13cd('0x19')]]={'channel':_0x13cd('0x1c'),'interface':_0x1bd779[_0x13cd('0x19')],'type':'TALKING','enterAt':utils['now'](),'role':_0x13cd('0x1d')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x1bd779[_0x13cd('0x19')]])){members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x1e')]=utils['now']();members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x1f')]=utils[_0x13cd('0x20')](members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x1e')],members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x21')]);if(members[_0x1bd779[_0x13cd('0x19')]]['uniqueid']){writeDB(members[_0x1bd779[_0x13cd('0x19')]]);}}break;default:break;}}catch(_0x529613){utils[_0x13cd('0x13')](util[_0x13cd('0x5')]('[%s][members][devicestatechange]',members[_0x1bd779[_0x13cd('0x19')]]?members[_0x1bd779[_0x13cd('0x19')]][_0x13cd('0x15')]:_0x1bd779[_0x13cd('0x19')]),_0x529613);}};exports[_0x13cd('0x22')]=function(_0x2079d1){try{if(!_[_0x13cd('0x23')](members[_0x2079d1['interface']])){utils[_0x13cd('0x17')](util['format']('[%s][members][agentcomplete]',_0x2079d1[_0x13cd('0x15')]),_0x2079d1);utils['info'](util['format'](_0x13cd('0x24'),_0x2079d1['uniqueid'],_0x2079d1[_0x13cd('0x7')],_0x2079d1[_0x13cd('0x25')]));members[_0x2079d1[_0x13cd('0x7')]]=_[_0x13cd('0x26')](members[_0x2079d1[_0x13cd('0x7')]],{'data4':_0x2079d1[_0x13cd('0x25')],'uniqueid':_0x2079d1[_0x13cd('0x15')]});}}catch(_0x3e7806){utils[_0x13cd('0x13')](util[_0x13cd('0x5')]('[%s][members][agentcomplete]',_0x2079d1['uniqueid']),_0x3e7806);}};exports['cdr']=function(_0x1f8b45){try{utils[_0x13cd('0x17')](util[_0x13cd('0x5')]('[%s][members][cdr]',_0x1f8b45[_0x13cd('0x15')]),_0x1f8b45);if(_0x1f8b45[_0x13cd('0x8')]){var _0x71203c=_0x1f8b45[_0x13cd('0x8')][_0x13cd('0x11')]('-')[0x0];if(!_['isNil'](members[_0x71203c])){members[_0x71203c]=_[_0x13cd('0x26')](members[_0x71203c],{'data1':members[_0x71203c][_0x13cd('0x27')]||_0x1f8b45[_0x13cd('0x28')],'data2':members[_0x71203c][_0x13cd('0x9')]||_0x1f8b45[_0x13cd('0x29')],'data3':members[_0x71203c][_0x13cd('0x2a')]||_0x1f8b45[_0x13cd('0x2b')],'uniqueid':members[_0x71203c][_0x13cd('0x15')]||_0x1f8b45[_0x13cd('0x15')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1f8b45[_0x13cd('0x15')],members[_0x71203c]['data1'],members[_0x71203c][_0x13cd('0x9')],members[_0x71203c][_0x13cd('0x2a')]));if(members[_0x71203c][_0x13cd('0x1e')]){writeDB(members[_0x71203c]);}}}if(_0x1f8b45[_0x13cd('0x2c')]){var _0x17ec42=_0x1f8b45[_0x13cd('0x2c')][_0x13cd('0x11')]('-')[0x0];if(!_[_0x13cd('0x23')](members[_0x17ec42])){members[_0x17ec42]=_[_0x13cd('0x26')](members[_0x17ec42],{'data1':members[_0x17ec42][_0x13cd('0x27')]||_0x1f8b45['type'],'data2':members[_0x17ec42]['data2']||_0x1f8b45[_0x13cd('0x29')],'data3':members[_0x17ec42][_0x13cd('0x2a')]||_0x1f8b45[_0x13cd('0x2b')],'uniqueid':members[_0x17ec42][_0x13cd('0x15')]||_0x1f8b45[_0x13cd('0x15')]});utils['info'](util[_0x13cd('0x5')](_0x13cd('0x2d'),_0x1f8b45[_0x13cd('0x15')],members[_0x17ec42][_0x13cd('0x27')],members[_0x17ec42][_0x13cd('0x9')],members[_0x17ec42][_0x13cd('0x2a')]));if(members[_0x17ec42][_0x13cd('0x1e')]){writeDB(members[_0x17ec42]);}}}}catch(_0x492edf){utils[_0x13cd('0x13')](util[_0x13cd('0x5')](_0x13cd('0x2e'),_0x1f8b45[_0x13cd('0x15')]),_0x492edf);}}; \ No newline at end of file +var _0xcc8d=['startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','exitAt','duration','diffTime','enterAt','error','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','cdr','isNil','assign','data1','data2','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','source','util','./utils','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','[%s][members][writeDB]','some'];(function(_0x3eaf06,_0x1bf08d){var _0x4b16d2=function(_0xc1b0df){while(--_0xc1b0df){_0x3eaf06['push'](_0x3eaf06['shift']());}};_0x4b16d2(++_0x1bf08d);}(_0xcc8d,0xbb));var _0xdcc8=function(_0x4207a6,_0x3a3110){_0x4207a6=_0x4207a6-0x0;var _0x42b37a=_0xcc8d[_0x4207a6];return _0x42b37a;};'use strict';var _=require('lodash');var util=require(_0xdcc8('0x0'));var utils=require(_0xdcc8('0x1'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0xdc9cc2){utils[_0xdcc8('0x2')](util[_0xdcc8('0x3')](_0xdcc8('0x4'),_0xdc9cc2[_0xdcc8('0x5')],_0xdc9cc2[_0xdcc8('0x6')],_0xdc9cc2[_0xdcc8('0x7')],_0xdc9cc2['data2'],_0xdc9cc2[_0xdcc8('0x8')],_0xdc9cc2[_0xdcc8('0x9')]));if(_0xdc9cc2[_0xdcc8('0x6')]){utils[_0xdcc8('0xa')](_0xdc9cc2[_0xdcc8('0x6')])['then'](function(_0x2bdaff){if(_0x2bdaff){_0xdc9cc2[_0xdcc8('0x8')]=_0x2bdaff[_0xdcc8('0xb')];_0xdc9cc2[_0xdcc8('0xc')]=_0x2bdaff[_0xdcc8('0xc')];utils[_0xdcc8('0xd')](_0xdcc8('0xe'),_0xdc9cc2);}else{utils[_0xdcc8('0xf')](_0xdc9cc2[_0xdcc8('0x6')][_0xdcc8('0x10')]('/')[0x1])[_0xdcc8('0x11')](function(_0x312dd7){if(_0x312dd7){_0xdc9cc2['membername']=_0x312dd7[_0xdcc8('0xb')];_0xdc9cc2[_0xdcc8('0xc')]=_0x312dd7['internal'];utils[_0xdcc8('0xd')](_0xdcc8('0xe'),_0xdc9cc2);}});}})[_0xdcc8('0x12')](function(_0x378a27){utils['error'](util[_0xdcc8('0x3')](_0xdcc8('0x13'),_0xdc9cc2['uniqueid']),_0x378a27);});}delete members[_0xdc9cc2[_0xdcc8('0x6')]];}function startsWith(_0x54541f,_0x5f599){return _[_0xdcc8('0x14')](_0x54541f,function(_0xc04807){return _[_0xdcc8('0x15')](_0x5f599,_0xc04807);});}exports[_0xdcc8('0x16')]=function(_0x12ace8){try{utils[_0xdcc8('0x17')](util['format']('[%s][members][devicestatechange]',members[_0x12ace8['device']]?members[_0x12ace8['device']]['uniqueid']:_0x12ace8[_0xdcc8('0x18')]),_0x12ace8);utils['info'](util[_0xdcc8('0x3')](_0xdcc8('0x19'),members[_0x12ace8[_0xdcc8('0x18')]]?members[_0x12ace8[_0xdcc8('0x18')]][_0xdcc8('0x5')]:_0x12ace8['device'],_0x12ace8['state'],_0x12ace8[_0xdcc8('0x18')]));switch(_0x12ace8[_0xdcc8('0x1a')]){case _0xdcc8('0x1b'):case _0xdcc8('0x1c'):if(!startsWith(exclude,_0x12ace8[_0xdcc8('0x18')])){members[_0x12ace8[_0xdcc8('0x18')]]={'channel':_0xdcc8('0x1d'),'interface':_0x12ace8[_0xdcc8('0x18')],'type':_0xdcc8('0x1e'),'enterAt':utils[_0xdcc8('0x1f')](),'role':_0xdcc8('0x20')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x12ace8['device']])){members[_0x12ace8['device']][_0xdcc8('0x21')]=utils[_0xdcc8('0x1f')]();members[_0x12ace8[_0xdcc8('0x18')]][_0xdcc8('0x22')]=utils[_0xdcc8('0x23')](members[_0x12ace8[_0xdcc8('0x18')]][_0xdcc8('0x21')],members[_0x12ace8[_0xdcc8('0x18')]][_0xdcc8('0x24')]);if(members[_0x12ace8[_0xdcc8('0x18')]]['uniqueid']){writeDB(members[_0x12ace8[_0xdcc8('0x18')]]);}}break;default:break;}}catch(_0x938201){utils[_0xdcc8('0x25')](util['format'](_0xdcc8('0x26'),members[_0x12ace8['device']]?members[_0x12ace8[_0xdcc8('0x18')]][_0xdcc8('0x5')]:_0x12ace8[_0xdcc8('0x18')]),_0x938201);}};exports[_0xdcc8('0x27')]=function(_0x16c40c){try{if(!_['isNil'](members[_0x16c40c[_0xdcc8('0x6')]])){utils[_0xdcc8('0x17')](util[_0xdcc8('0x3')](_0xdcc8('0x28'),_0x16c40c['uniqueid']),_0x16c40c);utils['info'](util[_0xdcc8('0x3')](_0xdcc8('0x29'),_0x16c40c['uniqueid'],_0x16c40c[_0xdcc8('0x6')],_0x16c40c['queue']));members[_0x16c40c[_0xdcc8('0x6')]]=_['assign'](members[_0x16c40c[_0xdcc8('0x6')]],{'data4':_0x16c40c['queue'],'uniqueid':_0x16c40c[_0xdcc8('0x5')]});}}catch(_0x12e101){utils[_0xdcc8('0x25')](util['format'](_0xdcc8('0x28'),_0x16c40c['uniqueid']),_0x12e101);}};exports[_0xdcc8('0x2a')]=function(_0x262e07){try{utils['debug'](util['format']('[%s][members][cdr]',_0x262e07[_0xdcc8('0x5')]),_0x262e07);if(_0x262e07[_0xdcc8('0x7')]){var _0x2e506a=_0x262e07[_0xdcc8('0x7')][_0xdcc8('0x10')]('-')[0x0];if(!_[_0xdcc8('0x2b')](members[_0x2e506a])){members[_0x2e506a]=_[_0xdcc8('0x2c')](members[_0x2e506a],{'data1':members[_0x2e506a][_0xdcc8('0x2d')]||_0x262e07['type'],'data2':members[_0x2e506a][_0xdcc8('0x2e')]||_0x262e07['source'],'data3':members[_0x2e506a]['data3']||_0x262e07[_0xdcc8('0x2f')],'uniqueid':members[_0x2e506a][_0xdcc8('0x5')]||_0x262e07['uniqueid']});utils[_0xdcc8('0x2')](util['format'](_0xdcc8('0x30'),_0x262e07[_0xdcc8('0x5')],members[_0x2e506a][_0xdcc8('0x2d')],members[_0x2e506a][_0xdcc8('0x2e')],members[_0x2e506a][_0xdcc8('0x31')]));if(members[_0x2e506a]['exitAt']){writeDB(members[_0x2e506a]);}}}if(_0x262e07[_0xdcc8('0x32')]){var _0x4bf1b0=_0x262e07[_0xdcc8('0x32')]['split']('-')[0x0];if(!_[_0xdcc8('0x2b')](members[_0x4bf1b0])){members[_0x4bf1b0]=_[_0xdcc8('0x2c')](members[_0x4bf1b0],{'data1':members[_0x4bf1b0][_0xdcc8('0x2d')]||_0x262e07[_0xdcc8('0x9')],'data2':members[_0x4bf1b0]['data2']||_0x262e07[_0xdcc8('0x33')],'data3':members[_0x4bf1b0][_0xdcc8('0x31')]||_0x262e07[_0xdcc8('0x2f')],'uniqueid':members[_0x4bf1b0][_0xdcc8('0x5')]||_0x262e07['uniqueid']});utils[_0xdcc8('0x2')](util['format'](_0xdcc8('0x30'),_0x262e07[_0xdcc8('0x5')],members[_0x4bf1b0][_0xdcc8('0x2d')],members[_0x4bf1b0]['data2'],members[_0x4bf1b0][_0xdcc8('0x31')]));if(members[_0x4bf1b0]['exitAt']){writeDB(members[_0x4bf1b0]);}}}}catch(_0x1c2c10){utils[_0xdcc8('0x25')](util[_0xdcc8('0x3')]('[%s][members][cdr]',_0x262e07[_0xdcc8('0x5')]),_0x1c2c10);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index ad2e544..59e9a85 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 _0xbbe6=['secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','membername','queuecallerabandonAt','assigned','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDED','transferexten','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','mohtime','[%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'];(function(_0x556323,_0x270480){var _0x4218e5=function(_0x594b77){while(--_0x594b77){_0x556323['push'](_0x556323['shift']());}};_0x4218e5(++_0x270480);}(_0xbbe6,0xd9));var _0x6bbe=function(_0x190ccf,_0x3b3d84){_0x190ccf=_0x190ccf-0x0;var _0x2fc6a5=_0xbbe6[_0x190ccf];return _0x2fc6a5;};'use strict';var _=require(_0x6bbe('0x0'));var util=require(_0x6bbe('0x1'));var utils=require(_0x6bbe('0x2'));var queues={};function writeDB(_0x1f58b9){utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x5'),_0x1f58b9[_0x6bbe('0x6')],_0x1f58b9[_0x6bbe('0x7')],_0x1f58b9['queue'],_0x1f58b9[_0x6bbe('0x8')],_0x1f58b9[_0x6bbe('0x9')],_0x1f58b9[_0x6bbe('0xa')],_0x1f58b9['queuecallerexitreason']));if(_0x1f58b9[_0x6bbe('0xb')]){utils[_0x6bbe('0xc')](_0x1f58b9[_0x6bbe('0xb')])['then'](function(_0x11a38f){if(_0x11a38f){_0x1f58b9[_0x6bbe('0xd')]=_0x11a38f[_0x6bbe('0xd')];}utils[_0x6bbe('0xe')]('CreateVoiceQueueReport',_0x1f58b9);});}else{utils[_0x6bbe('0xe')](_0x6bbe('0xf'),_0x1f58b9);}if(_0x1f58b9[_0x6bbe('0x10')]){delete queues[_0x1f58b9['transfereduniqueid']];}else{delete queues[_0x1f58b9['uniqueid']];}}exports[_0x6bbe('0x11')]=function(_0x33aa33){try{utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x13'),_0x33aa33[_0x6bbe('0x6')]),_0x33aa33);utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x14'),_0x33aa33[_0x6bbe('0x6')],_0x33aa33[_0x6bbe('0xb')],_0x33aa33[_0x6bbe('0x15')]));queues[_0x33aa33[_0x6bbe('0x6')]]=_[_0x6bbe('0x16')](_0x33aa33,{'originalposition':_0x33aa33[_0x6bbe('0x15')],'queuecallerjoinAt':utils[_0x6bbe('0x17')](),'mohtime':0x0});}catch(_0x4dfffa){utils[_0x6bbe('0x18')](util['format'](_0x6bbe('0x13'),_0x33aa33['uniqueid']),_0x4dfffa);}};exports[_0x6bbe('0x19')]=function(_0x4747f2){try{if(!_[_0x6bbe('0x1a')](queues[_0x4747f2['uniqueid']])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x1b'),_0x4747f2[_0x6bbe('0x6')]),_0x4747f2);if(queues[_0x4747f2[_0x6bbe('0x6')]]['queuecallerleaveAt']){if(!queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x1c')]&&!queues[_0x4747f2[_0x6bbe('0x6')]]['queuecallerexit']){queues[_0x4747f2['uniqueid']][_0x6bbe('0x1d')]=!![];queues[_0x4747f2['uniqueid']][_0x6bbe('0x1e')]=utils[_0x6bbe('0x17')]();queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x20');}utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x21'),_0x4747f2[_0x6bbe('0x6')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x22')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));writeDB(queues[_0x4747f2['uniqueid']]);}else if(queues[_0x4747f2['uniqueid']][_0x6bbe('0x10')]){utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x23'),_0x4747f2[_0x6bbe('0x6')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x22')],queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x10')]));queues[queues[_0x4747f2['uniqueid']]['transfereduniqueid']]=queues[_0x4747f2[_0x6bbe('0x6')]];queues[queues[_0x4747f2[_0x6bbe('0x6')]][_0x6bbe('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x4747f2['uniqueid']];}}}catch(_0x4d93f9){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')]('[%s][queues][hangup]',_0x4747f2[_0x6bbe('0x6')]),_0x4d93f9);}};exports['varset']=function(_0x45c985){try{utils['debug'](util['format']('[%s][queues][varset]',_0x45c985[_0x6bbe('0x6')]),_0x45c985);if(!_[_0x6bbe('0x1a')](_0x45c985[_0x6bbe('0x24')][_0x6bbe('0x25')])&&_0x45c985[_0x6bbe('0x26')][_0x6bbe('0x27')]()!==_0x6bbe('0x28')){if(!_['isNil'](queues[_0x45c985[_0x6bbe('0x6')]])){queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x45c985[_0x6bbe('0x6')]]['queuecallerabandonAt']=null;queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x29')]=!![];queues[_0x45c985['uniqueid']][_0x6bbe('0x2a')]=utils[_0x6bbe('0x17')]();queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x45c985[_0x6bbe('0x26')][_0x6bbe('0x27')]();utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x2b'),_0x45c985[_0x6bbe('0x6')],queues[_0x45c985['uniqueid']][_0x6bbe('0x22')],_0x45c985[_0x6bbe('0x26')],queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));writeDB(queues[_0x45c985[_0x6bbe('0x6')]]);}}else if(!_[_0x6bbe('0x1a')](_0x45c985['variable'][_0x6bbe('0x2c')])){if(!_[_0x6bbe('0x1a')](queues[_0x45c985['uniqueid']])&&!queues[_0x45c985['uniqueid']][_0x6bbe('0x1c')]){queues[_0x45c985[_0x6bbe('0x6')]]['queuecallerabandon']=![];queues[_0x45c985[_0x6bbe('0x6')]]['queuecallerabandonAt']=null;queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x29')]=!![];queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x2a')]=utils[_0x6bbe('0x17')]();queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x2d');utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x45c985['uniqueid'],queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x22')],_0x45c985[_0x6bbe('0x26')],queues[_0x45c985[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));}}}catch(_0x3f173c){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')]('[%s][queues][varset]',_0x45c985[_0x6bbe('0x6')]),_0x3f173c);}};exports[_0x6bbe('0x1c')]=function(_0x3c6750){try{if(!_['isNil'](queues[_0x3c6750[_0x6bbe('0x6')]])){utils['debug'](util[_0x6bbe('0x4')](_0x6bbe('0x2e'),_0x3c6750[_0x6bbe('0x6')]),_0x3c6750);queues[_0x3c6750['uniqueid']][_0x6bbe('0x29')]=![];queues[_0x3c6750['uniqueid']][_0x6bbe('0x2a')]=null;queues[_0x3c6750[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=!![];queues[_0x3c6750[_0x6bbe('0x6')]]['queuecallerabandonAt']=utils['now']();queues[_0x3c6750[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x2f');utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3c6750[_0x6bbe('0x6')],queues[_0x3c6750[_0x6bbe('0x6')]][_0x6bbe('0x22')],queues[_0x3c6750[_0x6bbe('0x6')]]['queuecallerexitreason']));}}catch(_0x4134d5){utils[_0x6bbe('0x18')](util['format'](_0x6bbe('0x2e'),_0x3c6750[_0x6bbe('0x6')]),_0x4134d5);}};exports[_0x6bbe('0x30')]=function(_0x429e62){try{if(!_[_0x6bbe('0x1a')](queues[_0x429e62[_0x6bbe('0x6')]])){utils['debug'](util[_0x6bbe('0x4')]('[%s][queues][queuecallerleave]',_0x429e62[_0x6bbe('0x6')]),_0x429e62);utils['info'](util[_0x6bbe('0x4')](_0x6bbe('0x31'),_0x429e62[_0x6bbe('0x6')],queues[_0x429e62['uniqueid']]['name'],_0x429e62['connectedlinenum'],_0x429e62[_0x6bbe('0x32')]));queues[_0x429e62['uniqueid']][_0x6bbe('0x30')]=!![];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x33')]=utils[_0x6bbe('0x17')]();queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x34')]=utils[_0x6bbe('0x35')](queues[_0x429e62['uniqueid']]['queuecallerleaveAt'],queues[_0x429e62['uniqueid']][_0x6bbe('0x36')]);queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x15')]=_0x429e62[_0x6bbe('0x15')];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x37')]=_0x429e62[_0x6bbe('0x37')];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x38')]=_0x429e62[_0x6bbe('0x38')];queues[_0x429e62[_0x6bbe('0x6')]][_0x6bbe('0x32')]=_0x429e62[_0x6bbe('0x32')];}}catch(_0x5d1052){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')](_0x6bbe('0x39'),_0x429e62['uniqueid']),_0x5d1052);}};exports[_0x6bbe('0x3a')]=function(_0x98aa35){try{if(!_['isNil'](queues[_0x98aa35['uniqueid']])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x3b'),_0x98aa35['uniqueid']),_0x98aa35);utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x98aa35[_0x6bbe('0x6')],queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x22')],_0x98aa35[_0x6bbe('0x3c')],_0x98aa35['destaccountcode']));queues[_0x98aa35['uniqueid']][_0x6bbe('0x1c')]=![];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x3d')]=null;queues[_0x98aa35[_0x6bbe('0x6')]]['queuecallerexit']=![];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=null;queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x2a')]=null;queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x3e')]=!![];queues[_0x98aa35['uniqueid']][_0x6bbe('0xa')]=_0x98aa35['destaccountcode'];queues[_0x98aa35[_0x6bbe('0x6')]][_0x6bbe('0x8')]=_0x98aa35[_0x6bbe('0x3c')];}}catch(_0x1edf13){utils[_0x6bbe('0x18')](util['format']('[%s][queues][agentconnect]',_0x98aa35[_0x6bbe('0x6')]),_0x1edf13);}};exports['agentcomplete']=function(_0x3408fb){try{if(!_[_0x6bbe('0x1a')](queues[_0x3408fb['uniqueid']])){if(queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x33')]){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x3f'),_0x3408fb[_0x6bbe('0x6')]),_0x3408fb);queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1c')]=![];queues[_0x3408fb[_0x6bbe('0x6')]]['queuecallerabandonAt']=null;queues[_0x3408fb[_0x6bbe('0x6')]]['queuecallerexit']=![];queues[_0x3408fb['uniqueid']][_0x6bbe('0x2a')]=null;queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x3e')]=!![];queues[_0x3408fb['uniqueid']]['lastAssignedTo']=_0x3408fb[_0x6bbe('0x3c')];queues[_0x3408fb[_0x6bbe('0x6')]]['queuecallercomplete']=!![];queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1e')]=utils[_0x6bbe('0x17')]();if(_0x3408fb[_0x6bbe('0x40')]==_0x6bbe('0x41')){if(!queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x41')]){queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1f')]=_0x6bbe('0x42');}}else{queues[_0x3408fb['uniqueid']][_0x6bbe('0x1f')]='COMPLETEDBY'+_0x3408fb[_0x6bbe('0x40')]['toUpperCase']();}utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x43'),_0x3408fb[_0x6bbe('0x6')],queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x22')],_0x3408fb[_0x6bbe('0x3c')],queues[_0x3408fb[_0x6bbe('0x6')]][_0x6bbe('0x1f')]));writeDB(queues[_0x3408fb['uniqueid']]);}}}catch(_0x31c758){utils['error'](util[_0x6bbe('0x4')]('[%s][queues][agentcomplete]',_0x3408fb[_0x6bbe('0x6')]),_0x31c758);}};exports[_0x6bbe('0x44')]=function(_0x548304){try{if(!_[_0x6bbe('0x1a')](queues[_0x548304['transfereeuniqueid']])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x45'),_0x548304['uniqueid']),_0x548304);queues[_0x548304[_0x6bbe('0x46')]]['transfer']=!![];queues[_0x548304['transfereeuniqueid']][_0x6bbe('0x47')]='BLIND';queues[_0x548304[_0x6bbe('0x46')]]['transferexten']=_0x548304[_0x6bbe('0x48')];queues[_0x548304[_0x6bbe('0x46')]][_0x6bbe('0x49')]=_0x548304['transfereeuniqueid'];queues[_0x548304[_0x6bbe('0x46')]][_0x6bbe('0x1f')]=_0x6bbe('0x4a');utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x4b'),_0x548304['uniqueid'],queues[_0x548304[_0x6bbe('0x46')]][_0x6bbe('0x22')],_0x548304[_0x6bbe('0x46')],_0x548304[_0x6bbe('0x48')]));}}catch(_0x4453ad){utils[_0x6bbe('0x18')](util[_0x6bbe('0x4')](_0x6bbe('0x45'),_0x548304[_0x6bbe('0x6')]),_0x4453ad);}};exports[_0x6bbe('0x4c')]=function(_0x4a90ea){try{utils['debug'](util['format'](_0x6bbe('0x4d'),_0x4a90ea[_0x6bbe('0x4e')]),_0x4a90ea);if(_0x4a90ea[_0x6bbe('0x4e')]==_0x4a90ea['origtransfererlinkedid']){if(!_[_0x6bbe('0x1a')](queues[_0x4a90ea[_0x6bbe('0x4f')]])){utils['info'](util[_0x6bbe('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x4a90ea['origtransfereruniqueid'],queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x22')],_0x4a90ea[_0x6bbe('0x50')]));queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x41')]=!![];queues[_0x4a90ea[_0x6bbe('0x4f')]]['transfertype']=_0x6bbe('0x51');queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x52')]=_0x4a90ea[_0x6bbe('0x50')];queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x49')]=_0x4a90ea[_0x6bbe('0x4e')];queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x1f')]=_0x6bbe('0x53');}if(!_['isNil'](queues[_0x4a90ea[_0x6bbe('0x54')]])){if(_0x4a90ea['transfereelinkedid']&&queues[_0x4a90ea[_0x6bbe('0x55')]]){queues[_0x4a90ea['transfereelinkedid']][_0x6bbe('0x56')]=0x1;queues[_0x4a90ea[_0x6bbe('0x46')]]=_[_0x6bbe('0x57')](queues[_0x4a90ea[_0x6bbe('0x55')]]);queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x10')]=_0x4a90ea[_0x6bbe('0x58')];queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x56')]=0x2;queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x9')]=queues[_0x4a90ea['secondtransfererlinkedid']][_0x6bbe('0x9')];queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x59')]=queues[_0x4a90ea[_0x6bbe('0x4f')]]['calleridname'];queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x36')]=utils['now']();queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x33')]=utils[_0x6bbe('0x17')]();queues[_0x4a90ea[_0x6bbe('0x46')]]['holdtime']=0x0;queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x5a')]=0x0;utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x5b'),_0x4a90ea['origtransfereruniqueid'],queues[_0x4a90ea[_0x6bbe('0x46')]][_0x6bbe('0x22')],queues[_0x4a90ea['transfereeuniqueid']][_0x6bbe('0x9')],queues[_0x4a90ea[_0x6bbe('0x46')]]['calleridname']));}else{utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x5c'),_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x22')],_0x4a90ea[_0x6bbe('0x4f')]));queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x10')]=_0x4a90ea[_0x6bbe('0x4f')];}}}else if(_0x4a90ea['secondtransfereruniqueid']==_0x4a90ea['secondtransfererlinkedid']){if(!_[_0x6bbe('0x1a')](queues[_0x4a90ea['origtransfererlinkedid']])){utils[_0x6bbe('0x3')](util['format'](_0x6bbe('0x5d'),_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x22')],_0x4a90ea[_0x6bbe('0x5e')],_0x4a90ea['secondtransfererexten']));queues[_0x4a90ea['origtransfererlinkedid']]['transfer']=!![];queues[_0x4a90ea['origtransfererlinkedid']][_0x6bbe('0x47')]=_0x6bbe('0x51');queues[_0x4a90ea['origtransfererlinkedid']][_0x6bbe('0x52')]=_0x4a90ea[_0x6bbe('0x5f')];queues[_0x4a90ea['origtransfererlinkedid']]['transferuniqueid']=_0x4a90ea[_0x6bbe('0x5e')];queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x1f')]='ATTENDEDTRANSFER';}if(!_[_0x6bbe('0x1a')](queues[_0x4a90ea[_0x6bbe('0x4f')]])){if(_0x4a90ea['transfertargetlinkedid']&&queues[_0x4a90ea[_0x6bbe('0x60')]]){queues[_0x4a90ea[_0x6bbe('0x60')]][_0x6bbe('0x56')]=0x1;queues[_0x4a90ea['transfertargetuniqueid']]=_['clone'](queues[_0x4a90ea[_0x6bbe('0x60')]]);queues[_0x4a90ea['transfertargetuniqueid']][_0x6bbe('0x10')]=_0x4a90ea['transfertargetuniqueid'];queues[_0x4a90ea['transfertargetuniqueid']][_0x6bbe('0x56')]=0x2;queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x9')]=queues[_0x4a90ea[_0x6bbe('0x54')]][_0x6bbe('0x9')];queues[_0x4a90ea['transfertargetuniqueid']][_0x6bbe('0x59')]=queues[_0x4a90ea[_0x6bbe('0x54')]]['calleridname'];queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x36')]=utils['now']();queues[_0x4a90ea[_0x6bbe('0x58')]]['queuecallerleaveAt']=utils[_0x6bbe('0x17')]();queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x34')]=0x0;queues[_0x4a90ea[_0x6bbe('0x58')]]['mohtime']=0x0;utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x61'),_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x22')],queues[_0x4a90ea[_0x6bbe('0x58')]][_0x6bbe('0x10')],queues[_0x4a90ea['transfertargetuniqueid']]['calleridnum'],queues[_0x4a90ea[_0x6bbe('0x58')]]['calleridname']));}else{utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4a90ea[_0x6bbe('0x4e')],queues[_0x4a90ea[_0x6bbe('0x4f')]]['name'],_0x4a90ea[_0x6bbe('0x54')]));queues[_0x4a90ea[_0x6bbe('0x4f')]][_0x6bbe('0x10')]=_0x4a90ea[_0x6bbe('0x54')];}}}}catch(_0x3b8d77){utils[_0x6bbe('0x18')](util['format'](_0x6bbe('0x4d'),_0x4a90ea[_0x6bbe('0x4e')]),_0x3b8d77);}};exports[_0x6bbe('0x62')]=function(_0x536751){try{if(!_['isNil'](queues[_0x536751[_0x6bbe('0x6')]])){utils[_0x6bbe('0x12')](util[_0x6bbe('0x4')](_0x6bbe('0x63'),_0x536751[_0x6bbe('0x6')]),_0x536751);queues[_0x536751[_0x6bbe('0x6')]][_0x6bbe('0x64')]=utils[_0x6bbe('0x17')]();utils['info'](util[_0x6bbe('0x4')](_0x6bbe('0x65'),_0x536751[_0x6bbe('0x6')],queues[_0x536751['uniqueid']][_0x6bbe('0x22')],queues[_0x536751[_0x6bbe('0x6')]]['musiconholdstartAt']));}}catch(_0x379767){utils['error'](util[_0x6bbe('0x4')]('[%s][queues][musiconholdstart]',_0x536751[_0x6bbe('0x6')]),_0x379767);}};exports['musiconholdstop']=function(_0x333a5c){try{if(!_[_0x6bbe('0x1a')](queues[_0x333a5c[_0x6bbe('0x6')]])){if(!_[_0x6bbe('0x1a')](queues[_0x333a5c[_0x6bbe('0x6')]]['musiconholdstartAt'])){utils['debug'](util[_0x6bbe('0x4')](_0x6bbe('0x66'),_0x333a5c[_0x6bbe('0x6')]),_0x333a5c);queues[_0x333a5c['uniqueid']][_0x6bbe('0x5a')]+=utils[_0x6bbe('0x35')](utils[_0x6bbe('0x17')](),queues[_0x333a5c[_0x6bbe('0x6')]]['musiconholdstartAt']);utils[_0x6bbe('0x3')](util[_0x6bbe('0x4')](_0x6bbe('0x67'),_0x333a5c['uniqueid'],queues[_0x333a5c['uniqueid']]['name'],queues[_0x333a5c['uniqueid']][_0x6bbe('0x5a')]));delete queues[_0x333a5c['uniqueid']][_0x6bbe('0x64')];}}}catch(_0x3bbd24){utils[_0x6bbe('0x18')](util['format']('[%s][queues][musiconholdstop]',_0x333a5c[_0x6bbe('0x6')]),_0x3bbd24);}}; \ No newline at end of file +var _0x4408=['COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%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','holdtime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','assigned','accountcode','destaccountcode','lastAssignedTo','agentcomplete','[%s][queues][agentcomplete]','reason','transfer'];(function(_0x3c682a,_0x3d5cac){var _0x3be4f7=function(_0xaaa345){while(--_0xaaa345){_0x3c682a['push'](_0x3c682a['shift']());}};_0x3be4f7(++_0x3d5cac);}(_0x4408,0x1d8));var _0x8440=function(_0x330de9,_0x31f402){_0x330de9=_0x330de9-0x0;var _0x1d83b2=_0x4408[_0x330de9];return _0x1d83b2;};'use strict';var _=require('lodash');var util=require(_0x8440('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x3c3fb1){utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x3'),_0x3c3fb1['uniqueid'],_0x3c3fb1['channel'],_0x3c3fb1['queue'],_0x3c3fb1['lastAssignedTo'],_0x3c3fb1[_0x8440('0x4')],_0x3c3fb1['accountcode'],_0x3c3fb1[_0x8440('0x5')]));if(_0x3c3fb1[_0x8440('0x6')]){utils[_0x8440('0x7')](_0x3c3fb1[_0x8440('0x6')])[_0x8440('0x8')](function(_0x451bd3){if(_0x451bd3){_0x3c3fb1[_0x8440('0x9')]=_0x451bd3[_0x8440('0x9')];}utils[_0x8440('0xa')](_0x8440('0xb'),_0x3c3fb1);});}else{utils[_0x8440('0xa')]('CreateVoiceQueueReport',_0x3c3fb1);}if(_0x3c3fb1[_0x8440('0xc')]){delete queues[_0x3c3fb1[_0x8440('0xc')]];}else{delete queues[_0x3c3fb1[_0x8440('0xd')]];}}exports[_0x8440('0xe')]=function(_0xbbd43a){try{utils[_0x8440('0xf')](util[_0x8440('0x2')]('[%s][queues][queuecallerjoin]',_0xbbd43a[_0x8440('0xd')]),_0xbbd43a);utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x10'),_0xbbd43a[_0x8440('0xd')],_0xbbd43a[_0x8440('0x6')],_0xbbd43a[_0x8440('0x11')]));queues[_0xbbd43a[_0x8440('0xd')]]=_[_0x8440('0x12')](_0xbbd43a,{'originalposition':_0xbbd43a[_0x8440('0x11')],'queuecallerjoinAt':utils[_0x8440('0x13')](),'mohtime':0x0});}catch(_0x38c317){utils[_0x8440('0x14')](util[_0x8440('0x2')]('[%s][queues][queuecallerjoin]',_0xbbd43a[_0x8440('0xd')]),_0x38c317);}};exports[_0x8440('0x15')]=function(_0xf0539f){try{if(!_[_0x8440('0x16')](queues[_0xf0539f[_0x8440('0xd')]])){utils[_0x8440('0xf')](util[_0x8440('0x2')]('[%s][queues][hangup]',_0xf0539f[_0x8440('0xd')]),_0xf0539f);if(queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0x17')]){if(!queues[_0xf0539f[_0x8440('0xd')]]['queuecallerabandon']&&!queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0x18')]){queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0x19')]=!![];queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0x1a')]=utils[_0x8440('0x13')]();queues[_0xf0539f['uniqueid']]['queuecallerexitreason']=_0x8440('0x1b');}utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x1c'),_0xf0539f[_0x8440('0xd')],queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0x1d')],queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0x5')]));writeDB(queues[_0xf0539f['uniqueid']]);}else if(queues[_0xf0539f[_0x8440('0xd')]]['transfereduniqueid']){utils[_0x8440('0x1')](util['format'](_0x8440('0x1e'),_0xf0539f[_0x8440('0xd')],queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0x1d')],queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0xc')]));queues[queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0xc')]]=queues[_0xf0539f[_0x8440('0xd')]];queues[queues[_0xf0539f[_0x8440('0xd')]][_0x8440('0xc')]][_0x8440('0x1f')]=0x2;delete queues[_0xf0539f['uniqueid']];}}}catch(_0x404c26){utils[_0x8440('0x14')](util[_0x8440('0x2')](_0x8440('0x20'),_0xf0539f[_0x8440('0xd')]),_0x404c26);}};exports[_0x8440('0x21')]=function(_0x2db44d){try{utils[_0x8440('0xf')](util[_0x8440('0x2')]('[%s][queues][varset]',_0x2db44d[_0x8440('0xd')]),_0x2db44d);if(!_[_0x8440('0x16')](_0x2db44d['variable'][_0x8440('0x22')])&&_0x2db44d['value'][_0x8440('0x23')]()!==_0x8440('0x24')){if(!_[_0x8440('0x16')](queues[_0x2db44d[_0x8440('0xd')]])){queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x25')]=![];queues[_0x2db44d['uniqueid']][_0x8440('0x26')]=null;queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x18')]=!![];queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x27')]=utils[_0x8440('0x13')]();queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x5')]=_0x2db44d[_0x8440('0x28')][_0x8440('0x23')]();utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x29'),_0x2db44d[_0x8440('0xd')],queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x1d')],_0x2db44d['value'],queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x5')]));writeDB(queues[_0x2db44d[_0x8440('0xd')]]);}}else if(!_['isNil'](_0x2db44d[_0x8440('0x2a')][_0x8440('0x2b')])){if(!_[_0x8440('0x16')](queues[_0x2db44d[_0x8440('0xd')]])&&!queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x25')]){queues[_0x2db44d['uniqueid']][_0x8440('0x25')]=![];queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x26')]=null;queues[_0x2db44d['uniqueid']][_0x8440('0x18')]=!![];queues[_0x2db44d['uniqueid']][_0x8440('0x27')]=utils[_0x8440('0x13')]();queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x5')]=_0x8440('0x2c');utils['info'](util[_0x8440('0x2')](_0x8440('0x2d'),_0x2db44d['uniqueid'],queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x1d')],_0x2db44d['value'],queues[_0x2db44d[_0x8440('0xd')]][_0x8440('0x5')]));}}}catch(_0x1dee7d){utils[_0x8440('0x14')](util[_0x8440('0x2')](_0x8440('0x2e'),_0x2db44d['uniqueid']),_0x1dee7d);}};exports[_0x8440('0x25')]=function(_0x156c0c){try{if(!_[_0x8440('0x16')](queues[_0x156c0c[_0x8440('0xd')]])){utils[_0x8440('0xf')](util['format'](_0x8440('0x2f'),_0x156c0c['uniqueid']),_0x156c0c);queues[_0x156c0c[_0x8440('0xd')]][_0x8440('0x18')]=![];queues[_0x156c0c[_0x8440('0xd')]][_0x8440('0x27')]=null;queues[_0x156c0c[_0x8440('0xd')]][_0x8440('0x25')]=!![];queues[_0x156c0c[_0x8440('0xd')]]['queuecallerabandonAt']=utils[_0x8440('0x13')]();queues[_0x156c0c[_0x8440('0xd')]][_0x8440('0x5')]=_0x8440('0x30');utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x31'),_0x156c0c[_0x8440('0xd')],queues[_0x156c0c['uniqueid']]['name'],queues[_0x156c0c['uniqueid']][_0x8440('0x5')]));}}catch(_0x51341d){utils[_0x8440('0x14')](util[_0x8440('0x2')]('[%s][queues][queuecallerabandon]',_0x156c0c[_0x8440('0xd')]),_0x51341d);}};exports[_0x8440('0x32')]=function(_0x52fbf0){try{if(!_[_0x8440('0x16')](queues[_0x52fbf0['uniqueid']])){utils[_0x8440('0xf')](util[_0x8440('0x2')](_0x8440('0x33'),_0x52fbf0['uniqueid']),_0x52fbf0);utils[_0x8440('0x1')](util['format'](_0x8440('0x34'),_0x52fbf0[_0x8440('0xd')],queues[_0x52fbf0[_0x8440('0xd')]][_0x8440('0x1d')],_0x52fbf0[_0x8440('0x35')],_0x52fbf0['connectedlinename']));queues[_0x52fbf0[_0x8440('0xd')]][_0x8440('0x32')]=!![];queues[_0x52fbf0[_0x8440('0xd')]][_0x8440('0x17')]=utils['now']();queues[_0x52fbf0[_0x8440('0xd')]][_0x8440('0x36')]=utils['diffTime'](queues[_0x52fbf0[_0x8440('0xd')]]['queuecallerleaveAt'],queues[_0x52fbf0[_0x8440('0xd')]]['queuecallerjoinAt']);queues[_0x52fbf0['uniqueid']][_0x8440('0x11')]=_0x52fbf0[_0x8440('0x11')];queues[_0x52fbf0[_0x8440('0xd')]][_0x8440('0x37')]=_0x52fbf0['count'];queues[_0x52fbf0[_0x8440('0xd')]][_0x8440('0x35')]=_0x52fbf0[_0x8440('0x35')];queues[_0x52fbf0[_0x8440('0xd')]][_0x8440('0x38')]=_0x52fbf0[_0x8440('0x38')];}}catch(_0x42841f){utils[_0x8440('0x14')](util[_0x8440('0x2')]('[%s][queues][queuecallerleave]',_0x52fbf0[_0x8440('0xd')]),_0x42841f);}};exports[_0x8440('0x39')]=function(_0x5bfaf0){try{if(!_[_0x8440('0x16')](queues[_0x5bfaf0[_0x8440('0xd')]])){utils[_0x8440('0xf')](util['format'](_0x8440('0x3a'),_0x5bfaf0['uniqueid']),_0x5bfaf0);utils[_0x8440('0x1')](util[_0x8440('0x2')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5bfaf0['uniqueid'],queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x1d')],_0x5bfaf0[_0x8440('0x3b')],_0x5bfaf0['destaccountcode']));queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x25')]=![];queues[_0x5bfaf0[_0x8440('0xd')]]['queuecallerabandon']=![];queues[_0x5bfaf0['uniqueid']][_0x8440('0x26')]=null;queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x18')]=![];queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x5')]=null;queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x27')]=null;queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x3c')]=!![];queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x3d')]=_0x5bfaf0[_0x8440('0x3e')];queues[_0x5bfaf0[_0x8440('0xd')]][_0x8440('0x3f')]=_0x5bfaf0[_0x8440('0x3b')];}}catch(_0x3be281){utils[_0x8440('0x14')](util[_0x8440('0x2')](_0x8440('0x3a'),_0x5bfaf0[_0x8440('0xd')]),_0x3be281);}};exports[_0x8440('0x40')]=function(_0x1887d4){try{if(!_[_0x8440('0x16')](queues[_0x1887d4[_0x8440('0xd')]])){if(queues[_0x1887d4['uniqueid']][_0x8440('0x17')]){utils[_0x8440('0xf')](util['format'](_0x8440('0x41'),_0x1887d4['uniqueid']),_0x1887d4);queues[_0x1887d4[_0x8440('0xd')]][_0x8440('0x25')]=![];queues[_0x1887d4[_0x8440('0xd')]]['queuecallerabandon']=![];queues[_0x1887d4[_0x8440('0xd')]]['queuecallerabandonAt']=null;queues[_0x1887d4['uniqueid']][_0x8440('0x18')]=![];queues[_0x1887d4[_0x8440('0xd')]][_0x8440('0x27')]=null;queues[_0x1887d4[_0x8440('0xd')]][_0x8440('0x3c')]=!![];queues[_0x1887d4[_0x8440('0xd')]]['lastAssignedTo']=_0x1887d4['membername'];queues[_0x1887d4[_0x8440('0xd')]][_0x8440('0x19')]=!![];queues[_0x1887d4[_0x8440('0xd')]]['queuecallercompleteAt']=utils['now']();if(_0x1887d4[_0x8440('0x42')]==_0x8440('0x43')){if(!queues[_0x1887d4[_0x8440('0xd')]]['transfer']){queues[_0x1887d4[_0x8440('0xd')]][_0x8440('0x5')]='TRANSFER';}}else{queues[_0x1887d4['uniqueid']]['queuecallerexitreason']=_0x8440('0x44')+_0x1887d4[_0x8440('0x42')][_0x8440('0x23')]();}utils[_0x8440('0x1')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x1887d4[_0x8440('0xd')],queues[_0x1887d4[_0x8440('0xd')]][_0x8440('0x1d')],_0x1887d4[_0x8440('0x3b')],queues[_0x1887d4[_0x8440('0xd')]][_0x8440('0x5')]));writeDB(queues[_0x1887d4[_0x8440('0xd')]]);}}}catch(_0x2a836b){utils['error'](util[_0x8440('0x2')](_0x8440('0x41'),_0x1887d4[_0x8440('0xd')]),_0x2a836b);}};exports[_0x8440('0x45')]=function(_0x3aaf8c){try{if(!_[_0x8440('0x16')](queues[_0x3aaf8c[_0x8440('0x46')]])){utils['debug'](util[_0x8440('0x2')](_0x8440('0x47'),_0x3aaf8c[_0x8440('0xd')]),_0x3aaf8c);queues[_0x3aaf8c[_0x8440('0x46')]][_0x8440('0x43')]=!![];queues[_0x3aaf8c[_0x8440('0x46')]]['transfertype']=_0x8440('0x48');queues[_0x3aaf8c['transfereeuniqueid']][_0x8440('0x49')]=_0x3aaf8c[_0x8440('0x4a')];queues[_0x3aaf8c[_0x8440('0x46')]][_0x8440('0x4b')]=_0x3aaf8c[_0x8440('0x46')];queues[_0x3aaf8c[_0x8440('0x46')]]['queuecallerexitreason']=_0x8440('0x4c');utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x4d'),_0x3aaf8c['uniqueid'],queues[_0x3aaf8c[_0x8440('0x46')]][_0x8440('0x1d')],_0x3aaf8c[_0x8440('0x46')],_0x3aaf8c[_0x8440('0x4a')]));}}catch(_0x598f56){utils['error'](util[_0x8440('0x2')](_0x8440('0x47'),_0x3aaf8c[_0x8440('0xd')]),_0x598f56);}};exports[_0x8440('0x4e')]=function(_0x2f122b){try{utils['debug'](util['format'](_0x8440('0x4f'),_0x2f122b['origtransfereruniqueid']),_0x2f122b);if(_0x2f122b['origtransfereruniqueid']==_0x2f122b[_0x8440('0x50')]){if(!_['isNil'](queues[_0x2f122b['secondtransfererlinkedid']])){utils['info'](util['format'](_0x8440('0x51'),_0x2f122b['origtransfereruniqueid'],queues[_0x2f122b[_0x8440('0x52')]][_0x8440('0x1d')],_0x2f122b[_0x8440('0x53')]));queues[_0x2f122b['secondtransfererlinkedid']][_0x8440('0x43')]=!![];queues[_0x2f122b[_0x8440('0x52')]][_0x8440('0x54')]=_0x8440('0x55');queues[_0x2f122b[_0x8440('0x52')]][_0x8440('0x49')]=_0x2f122b['origtransfererexten'];queues[_0x2f122b[_0x8440('0x52')]][_0x8440('0x4b')]=_0x2f122b[_0x8440('0x56')];queues[_0x2f122b[_0x8440('0x52')]]['queuecallerexitreason']=_0x8440('0x57');}if(!_[_0x8440('0x16')](queues[_0x2f122b[_0x8440('0x50')]])){if(_0x2f122b[_0x8440('0x58')]&&queues[_0x2f122b[_0x8440('0x58')]]){queues[_0x2f122b[_0x8440('0x58')]]['queuecallerenterreason']=0x1;queues[_0x2f122b['transfereeuniqueid']]=_[_0x8440('0x59')](queues[_0x2f122b[_0x8440('0x58')]]);queues[_0x2f122b['transfereeuniqueid']][_0x8440('0xc')]=_0x2f122b['transfertargetuniqueid'];queues[_0x2f122b[_0x8440('0x46')]][_0x8440('0x1f')]=0x2;queues[_0x2f122b[_0x8440('0x46')]][_0x8440('0x4')]=queues[_0x2f122b[_0x8440('0x52')]][_0x8440('0x4')];queues[_0x2f122b['transfereeuniqueid']][_0x8440('0x5a')]=queues[_0x2f122b[_0x8440('0x52')]]['calleridname'];queues[_0x2f122b[_0x8440('0x46')]]['queuecallerjoinAt']=utils[_0x8440('0x13')]();queues[_0x2f122b['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x8440('0x13')]();queues[_0x2f122b[_0x8440('0x46')]][_0x8440('0x36')]=0x0;queues[_0x2f122b[_0x8440('0x46')]][_0x8440('0x5b')]=0x0;utils['info'](util[_0x8440('0x2')](_0x8440('0x5c'),_0x2f122b[_0x8440('0x56')],queues[_0x2f122b[_0x8440('0x46')]][_0x8440('0x1d')],queues[_0x2f122b[_0x8440('0x46')]][_0x8440('0x4')],queues[_0x2f122b[_0x8440('0x46')]]['calleridname']));}else{utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x5d'),_0x2f122b[_0x8440('0x56')],queues[_0x2f122b['origtransfererlinkedid']]['name'],_0x2f122b[_0x8440('0x52')]));queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0xc')]=_0x2f122b[_0x8440('0x52')];}}}else if(_0x2f122b[_0x8440('0x5e')]==_0x2f122b[_0x8440('0x52')]){if(!_[_0x8440('0x16')](queues[_0x2f122b[_0x8440('0x50')]])){utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x5f'),_0x2f122b[_0x8440('0x56')],queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0x1d')],_0x2f122b[_0x8440('0x5e')],_0x2f122b['secondtransfererexten']));queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0x43')]=!![];queues[_0x2f122b[_0x8440('0x50')]]['transfertype']=_0x8440('0x55');queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0x49')]=_0x2f122b[_0x8440('0x60')];queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0x4b')]=_0x2f122b['secondtransfereruniqueid'];queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0x5')]=_0x8440('0x57');}if(!_[_0x8440('0x16')](queues[_0x2f122b['secondtransfererlinkedid']])){if(_0x2f122b[_0x8440('0x61')]&&queues[_0x2f122b['transfertargetlinkedid']]){queues[_0x2f122b[_0x8440('0x61')]][_0x8440('0x1f')]=0x1;queues[_0x2f122b[_0x8440('0x62')]]=_[_0x8440('0x59')](queues[_0x2f122b['transfertargetlinkedid']]);queues[_0x2f122b[_0x8440('0x62')]][_0x8440('0xc')]=_0x2f122b[_0x8440('0x62')];queues[_0x2f122b['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x2f122b[_0x8440('0x62')]]['calleridnum']=queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0x4')];queues[_0x2f122b[_0x8440('0x62')]][_0x8440('0x5a')]=queues[_0x2f122b[_0x8440('0x50')]][_0x8440('0x5a')];queues[_0x2f122b[_0x8440('0x62')]][_0x8440('0x63')]=utils[_0x8440('0x13')]();queues[_0x2f122b[_0x8440('0x62')]][_0x8440('0x17')]=utils[_0x8440('0x13')]();queues[_0x2f122b['transfertargetuniqueid']][_0x8440('0x36')]=0x0;queues[_0x2f122b[_0x8440('0x62')]][_0x8440('0x5b')]=0x0;utils[_0x8440('0x1')](util['format'](_0x8440('0x64'),_0x2f122b['origtransfereruniqueid'],queues[_0x2f122b[_0x8440('0x62')]]['name'],queues[_0x2f122b[_0x8440('0x62')]]['transfereduniqueid'],queues[_0x2f122b[_0x8440('0x62')]][_0x8440('0x4')],queues[_0x2f122b['transfertargetuniqueid']]['calleridname']));}else{utils[_0x8440('0x1')](util[_0x8440('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x2f122b[_0x8440('0x56')],queues[_0x2f122b[_0x8440('0x52')]][_0x8440('0x1d')],_0x2f122b['origtransfererlinkedid']));queues[_0x2f122b[_0x8440('0x52')]]['transfereduniqueid']=_0x2f122b[_0x8440('0x50')];}}}}catch(_0x3f3742){utils[_0x8440('0x14')](util[_0x8440('0x2')](_0x8440('0x4f'),_0x2f122b['origtransfereruniqueid']),_0x3f3742);}};exports[_0x8440('0x65')]=function(_0xd7b28c){try{if(!_['isNil'](queues[_0xd7b28c['uniqueid']])){utils[_0x8440('0xf')](util[_0x8440('0x2')](_0x8440('0x66'),_0xd7b28c[_0x8440('0xd')]),_0xd7b28c);queues[_0xd7b28c[_0x8440('0xd')]]['musiconholdstartAt']=utils['now']();utils[_0x8440('0x1')](util[_0x8440('0x2')](_0x8440('0x67'),_0xd7b28c[_0x8440('0xd')],queues[_0xd7b28c[_0x8440('0xd')]][_0x8440('0x1d')],queues[_0xd7b28c[_0x8440('0xd')]][_0x8440('0x68')]));}}catch(_0x528556){utils['error'](util[_0x8440('0x2')](_0x8440('0x66'),_0xd7b28c[_0x8440('0xd')]),_0x528556);}};exports[_0x8440('0x69')]=function(_0x1cf9ed){try{if(!_[_0x8440('0x16')](queues[_0x1cf9ed[_0x8440('0xd')]])){if(!_[_0x8440('0x16')](queues[_0x1cf9ed[_0x8440('0xd')]][_0x8440('0x68')])){utils[_0x8440('0xf')](util['format'](_0x8440('0x6a'),_0x1cf9ed[_0x8440('0xd')]),_0x1cf9ed);queues[_0x1cf9ed[_0x8440('0xd')]][_0x8440('0x5b')]+=utils['diffTime'](utils[_0x8440('0x13')](),queues[_0x1cf9ed['uniqueid']][_0x8440('0x68')]);utils['info'](util[_0x8440('0x2')](_0x8440('0x6b'),_0x1cf9ed[_0x8440('0xd')],queues[_0x1cf9ed[_0x8440('0xd')]][_0x8440('0x1d')],queues[_0x1cf9ed[_0x8440('0xd')]]['mohtime']));delete queues[_0x1cf9ed[_0x8440('0xd')]][_0x8440('0x68')];}}}catch(_0x2d3e59){utils[_0x8440('0x14')](util[_0x8440('0x2')](_0x8440('0x6a'),_0x1cf9ed[_0x8440('0xd')]),_0x2d3e59);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d0a4299..37f516b 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 _0x29c1=['substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','varset','mixmonitor_filename','[%s][recordings][varset]','variable','value','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','application','appdata','toLowerCase','set','startsWith','cdr','split'];(function(_0x5d923a,_0x27b5a0){var _0x485b7d=function(_0x26f757){while(--_0x26f757){_0x5d923a['push'](_0x5d923a['shift']());}};_0x485b7d(++_0x27b5a0);}(_0x29c1,0x1c7));var _0x129c=function(_0x1bedcb,_0x26d012){_0x1bedcb=_0x1bedcb-0x0;var _0x485394=_0x29c1[_0x1bedcb];return _0x485394;};'use strict';var _=require(_0x129c('0x0'));var util=require(_0x129c('0x1'));var utils=require(_0x129c('0x2'));var recordings={};function writeDB(_0x279414){utils[_0x129c('0x3')](util[_0x129c('0x4')](_0x129c('0x5'),_0x279414[_0x129c('0x6')]));if(_0x279414[_0x129c('0x7')]){utils[_0x129c('0x8')](_0x279414[_0x129c('0x7')])['then'](function(_0x67d8dd){if(_0x67d8dd){_0x279414[_0x129c('0x9')]=_0x67d8dd[_0x129c('0xa')];_0x279414[_0x129c('0xb')]=_0x67d8dd['id'];}utils[_0x129c('0xc')](_0x129c('0xd'),_0x279414);});}else{utils[_0x129c('0xc')](_0x129c('0xd'),_0x279414);}}exports['newchannel']=function(_0x326177){try{utils[_0x129c('0xe')](util[_0x129c('0x4')](_0x129c('0xf'),_0x326177[_0x129c('0x6')]),_0x326177);if(_0x326177[_0x129c('0x6')]==_0x326177[_0x129c('0x10')]){utils[_0x129c('0x3')](util['format'](_0x129c('0x11'),_0x326177['uniqueid'],_0x326177['context'],_0x326177['exten']));recordings[_0x326177['uniqueid']]={'uniqueid':_0x326177[_0x129c('0x6')],'accountcode':_0x326177['accountcode'],'exten':_0x326177[_0x129c('0x12')],'context':_0x326177[_0x129c('0x13')],'channel':_0x326177[_0x129c('0x14')],'monitors':[]};}}catch(_0x51d514){utils[_0x129c('0x15')](util[_0x129c('0x4')](_0x129c('0xf'),_0x326177[_0x129c('0x6')]),_0x51d514);}};exports[_0x129c('0x16')]=function(_0x54f8ce){try{utils['debug'](util['format'](_0x129c('0x17'),_0x54f8ce[_0x129c('0x6')]),_0x54f8ce);if(!_[_0x129c('0x18')](recordings[_0x54f8ce[_0x129c('0x6')]])&&_0x54f8ce[_0x129c('0x19')]==0x6){utils[_0x129c('0x3')](util[_0x129c('0x4')](_0x129c('0x1a'),_0x54f8ce[_0x129c('0x6')],_0x54f8ce[_0x129c('0x13')],_0x54f8ce[_0x129c('0x14')]));}else if(!_[_0x129c('0x18')](recordings[_0x54f8ce['linkedid']])&&_0x54f8ce['channelstate']==0x6&&_0x54f8ce[_0x129c('0x13')]!=_0x129c('0x1b')){utils['info'](util[_0x129c('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x54f8ce[_0x129c('0x6')],_0x54f8ce[_0x129c('0x10')],_0x54f8ce[_0x129c('0x13')],_0x54f8ce[_0x129c('0x14')]));recordings[_0x54f8ce[_0x129c('0x10')]][_0x129c('0x7')]=_0x54f8ce[_0x129c('0x7')];}}catch(_0x35e272){utils[_0x129c('0x15')](util['format'](_0x129c('0x17'),_0x54f8ce[_0x129c('0x6')]),_0x35e272);}};exports[_0x129c('0x1c')]=function(_0x3dece5){try{if(!_[_0x129c('0x18')](_0x3dece5['variable'])&&!_[_0x129c('0x18')](_0x3dece5['variable'][_0x129c('0x1d')])){utils['debug'](util[_0x129c('0x4')](_0x129c('0x1e'),_0x3dece5[_0x129c('0x6')]),_0x3dece5);utils[_0x129c('0x3')](util[_0x129c('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x3dece5[_0x129c('0x6')],_0x3dece5[_0x129c('0x1f')],_0x3dece5[_0x129c('0x20')]));if(_['endsWith'](_0x3dece5[_0x129c('0x20')],_0x129c('0x21'))){_0x3dece5['value']=_0x3dece5['value']['replace'](_0x129c('0x21'),_0x129c('0x22'));}if(recordings[_0x3dece5[_0x129c('0x10')]]){var _0x901905=_[_0x129c('0x23')](recordings[_0x3dece5[_0x129c('0x10')]][_0x129c('0x24')],{'value':_0x3dece5[_0x129c('0x20')]});if(_[_0x129c('0x18')](_0x901905)){recordings[_0x3dece5[_0x129c('0x10')]][_0x129c('0x24')][_0x129c('0x25')]({'value':_0x3dece5['value']});}}}}catch(_0x5ef9a9){utils[_0x129c('0x15')](util[_0x129c('0x4')]('[%s][recordings][varset]',_0x3dece5[_0x129c('0x6')]),_0x5ef9a9);}};exports[_0x129c('0x26')]=function(_0x37cfbf){try{if(!_[_0x129c('0x18')](recordings[_0x37cfbf[_0x129c('0x6')]])){utils[_0x129c('0xe')](util[_0x129c('0x4')](_0x129c('0x27'),_0x37cfbf[_0x129c('0x6')]),_0x37cfbf);utils['info'](util[_0x129c('0x4')](_0x129c('0x28'),_0x37cfbf[_0x129c('0x6')],_0x37cfbf[_0x129c('0x29')],_0x37cfbf['calleridname'],_0x37cfbf[_0x129c('0x2a')]));recordings[_0x37cfbf[_0x129c('0x6')]]['calleridnum']=_0x37cfbf[_0x129c('0x29')];recordings[_0x37cfbf[_0x129c('0x6')]]['calleridname']=_0x37cfbf[_0x129c('0x2b')];recordings[_0x37cfbf[_0x129c('0x6')]]['connectedlinenum']=_0x37cfbf[_0x129c('0x2c')];recordings[_0x37cfbf[_0x129c('0x6')]][_0x129c('0x2d')]=_0x37cfbf[_0x129c('0x2d')];if(recordings[_0x37cfbf['uniqueid']][_0x129c('0x2e')]==_0x129c('0x2f')&&recordings[_0x37cfbf['uniqueid']][_0x129c('0x7')]){recordings[_0x37cfbf['uniqueid']][_0x129c('0x2c')]=recordings[_0x37cfbf[_0x129c('0x6')]]['accountcode'];recordings[_0x37cfbf[_0x129c('0x6')]][_0x129c('0x2d')]='';}recordings[_0x37cfbf[_0x129c('0x6')]][_0x129c('0x24')][_0x129c('0x30')](function(_0xa33739){var _0x5aa1f7=_['clone'](recordings[_0x37cfbf[_0x129c('0x6')]]);_0x5aa1f7[_0x129c('0x20')]=_0xa33739['value'];writeDB(_0x5aa1f7);});delete recordings[_0x37cfbf[_0x129c('0x6')]];}}catch(_0x1675c0){utils[_0x129c('0x15')](util[_0x129c('0x4')](_0x129c('0x27'),_0x37cfbf[_0x129c('0x6')]),_0x1675c0);}};exports[_0x129c('0x31')]=function(_0x13f050){try{if(!_[_0x129c('0x18')](recordings[_0x13f050['uniqueid']])){utils['debug'](util[_0x129c('0x4')]('[%s][recordings][newexten]',_0x13f050[_0x129c('0x6')]),_0x13f050);utils[_0x129c('0x3')](util[_0x129c('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x13f050[_0x129c('0x6')],_0x13f050[_0x129c('0x32')],_0x13f050[_0x129c('0x33')]));if(_0x13f050[_0x129c('0x32')][_0x129c('0x34')]()==_0x129c('0x35')&&_[_0x129c('0x36')](_0x13f050[_0x129c('0x33')][_0x129c('0x34')](),_0x129c('0x37'))){var _0x55b25e=_0x13f050[_0x129c('0x33')][_0x129c('0x38')]('=');var _0x1740d3=_0x55b25e[0x0][_0x129c('0x39')](_0x55b25e[0x0][_0x129c('0x3a')]('(')+0x1,_0x55b25e[0x0][_0x129c('0x3a')](')'));var _0x34ede7=_0x55b25e[0x1];recordings[_0x13f050[_0x129c('0x6')]][_0x1740d3]=_0x34ede7;}}}catch(_0x5be3fb){utils[_0x129c('0x15')](util[_0x129c('0x4')](_0x129c('0x3b'),_0x13f050[_0x129c('0x6')]),_0x5be3fb);}};exports[_0x129c('0x3c')]=function(_0x4099ce){try{if(!_[_0x129c('0x18')](recordings[_0x4099ce['uniqueid']])){utils[_0x129c('0xe')](util[_0x129c('0x4')](_0x129c('0x3d'),_0x4099ce[_0x129c('0x6')]),_0x4099ce);utils[_0x129c('0x3')](util[_0x129c('0x4')](_0x129c('0x3e'),_0x4099ce[_0x129c('0x6')],_0x4099ce['queue']));recordings[_0x4099ce[_0x129c('0x6')]]['queue']=_0x4099ce[_0x129c('0x3f')];}}catch(_0x178867){utils['error'](util[_0x129c('0x4')]('[%s][recordings][queuecallerjoin]',_0x4099ce[_0x129c('0x6')]),_0x178867);}}; \ No newline at end of file +var _0x28cd=['toLowerCase','set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','name','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','appdata','application'];(function(_0x3cfb0d,_0x4df584){var _0x3486b4=function(_0x1b0939){while(--_0x1b0939){_0x3cfb0d['push'](_0x3cfb0d['shift']());}};_0x3486b4(++_0x4df584);}(_0x28cd,0x177));var _0xd28c=function(_0x5d47e8,_0x2a2e4f){_0x5d47e8=_0x5d47e8-0x0;var _0x4169e0=_0x28cd[_0x5d47e8];return _0x4169e0;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xd28c('0x0'));var recordings={};function writeDB(_0x27353c){utils[_0xd28c('0x1')](util[_0xd28c('0x2')](_0xd28c('0x3'),_0x27353c[_0xd28c('0x4')]));if(_0x27353c[_0xd28c('0x5')]){utils[_0xd28c('0x6')](_0x27353c[_0xd28c('0x5')])['then'](function(_0x5c142a){if(_0x5c142a){_0x27353c['membername']=_0x5c142a[_0xd28c('0x7')];_0x27353c[_0xd28c('0x8')]=_0x5c142a['id'];}utils[_0xd28c('0x9')](_0xd28c('0xa'),_0x27353c);});}else{utils[_0xd28c('0x9')](_0xd28c('0xa'),_0x27353c);}}exports['newchannel']=function(_0x4e915b){try{utils[_0xd28c('0xb')](util[_0xd28c('0x2')](_0xd28c('0xc'),_0x4e915b[_0xd28c('0x4')]),_0x4e915b);if(_0x4e915b['uniqueid']==_0x4e915b[_0xd28c('0xd')]){utils[_0xd28c('0x1')](util[_0xd28c('0x2')](_0xd28c('0xe'),_0x4e915b[_0xd28c('0x4')],_0x4e915b[_0xd28c('0xf')],_0x4e915b['exten']));recordings[_0x4e915b[_0xd28c('0x4')]]={'uniqueid':_0x4e915b[_0xd28c('0x4')],'accountcode':_0x4e915b['accountcode'],'exten':_0x4e915b['exten'],'context':_0x4e915b[_0xd28c('0xf')],'channel':_0x4e915b['channel'],'monitors':[]};}}catch(_0x1c317e){utils[_0xd28c('0x10')](util[_0xd28c('0x2')](_0xd28c('0xc'),_0x4e915b[_0xd28c('0x4')]),_0x1c317e);}};exports['newstate']=function(_0x41565){try{utils[_0xd28c('0xb')](util[_0xd28c('0x2')](_0xd28c('0x11'),_0x41565[_0xd28c('0x4')]),_0x41565);if(!_[_0xd28c('0x12')](recordings[_0x41565[_0xd28c('0x4')]])&&_0x41565[_0xd28c('0x13')]==0x6){utils[_0xd28c('0x1')](util[_0xd28c('0x2')](_0xd28c('0x14'),_0x41565[_0xd28c('0x4')],_0x41565[_0xd28c('0xf')],_0x41565[_0xd28c('0x15')]));}else if(!_[_0xd28c('0x12')](recordings[_0x41565[_0xd28c('0xd')]])&&_0x41565[_0xd28c('0x13')]==0x6&&_0x41565['context']!=_0xd28c('0x16')){utils[_0xd28c('0x1')](util['format'](_0xd28c('0x17'),_0x41565[_0xd28c('0x4')],_0x41565[_0xd28c('0xd')],_0x41565[_0xd28c('0xf')],_0x41565[_0xd28c('0x15')]));recordings[_0x41565[_0xd28c('0xd')]][_0xd28c('0x5')]=_0x41565[_0xd28c('0x5')];}}catch(_0x21bd51){utils[_0xd28c('0x10')](util[_0xd28c('0x2')](_0xd28c('0x11'),_0x41565[_0xd28c('0x4')]),_0x21bd51);}};exports[_0xd28c('0x18')]=function(_0x537195){try{if(!_['isNil'](_0x537195['variable'])&&!_[_0xd28c('0x12')](_0x537195[_0xd28c('0x19')][_0xd28c('0x1a')])){utils['debug'](util[_0xd28c('0x2')]('[%s][recordings][varset]',_0x537195[_0xd28c('0x4')]),_0x537195);utils['info'](util[_0xd28c('0x2')](_0xd28c('0x1b'),_0x537195[_0xd28c('0x4')],_0x537195['variable'],_0x537195[_0xd28c('0x1c')]));if(_[_0xd28c('0x1d')](_0x537195['value'],_0xd28c('0x1e'))){_0x537195[_0xd28c('0x1c')]=_0x537195[_0xd28c('0x1c')][_0xd28c('0x1f')](_0xd28c('0x1e'),_0xd28c('0x20'));}if(recordings[_0x537195[_0xd28c('0xd')]]){var _0x2f2c77=_[_0xd28c('0x21')](recordings[_0x537195[_0xd28c('0xd')]][_0xd28c('0x22')],{'value':_0x537195[_0xd28c('0x1c')]});if(_['isNil'](_0x2f2c77)){recordings[_0x537195[_0xd28c('0xd')]]['monitors'][_0xd28c('0x23')]({'value':_0x537195[_0xd28c('0x1c')]});}}}}catch(_0x4c4f00){utils[_0xd28c('0x10')](util[_0xd28c('0x2')](_0xd28c('0x24'),_0x537195[_0xd28c('0x4')]),_0x4c4f00);}};exports[_0xd28c('0x25')]=function(_0x2bc071){try{if(!_[_0xd28c('0x12')](recordings[_0x2bc071['uniqueid']])){utils[_0xd28c('0xb')](util[_0xd28c('0x2')]('[%s][recordings][hangup]',_0x2bc071[_0xd28c('0x4')]),_0x2bc071);utils[_0xd28c('0x1')](util[_0xd28c('0x2')](_0xd28c('0x26'),_0x2bc071['uniqueid'],_0x2bc071[_0xd28c('0x27')],_0x2bc071[_0xd28c('0x28')],_0x2bc071[_0xd28c('0x29')]));recordings[_0x2bc071['uniqueid']][_0xd28c('0x27')]=_0x2bc071[_0xd28c('0x27')];recordings[_0x2bc071[_0xd28c('0x4')]][_0xd28c('0x28')]=_0x2bc071[_0xd28c('0x28')];recordings[_0x2bc071[_0xd28c('0x4')]][_0xd28c('0x2a')]=_0x2bc071[_0xd28c('0x2a')];recordings[_0x2bc071[_0xd28c('0x4')]][_0xd28c('0x2b')]=_0x2bc071[_0xd28c('0x2b')];if(recordings[_0x2bc071[_0xd28c('0x4')]][_0xd28c('0x2c')]=='outbound'&&recordings[_0x2bc071['uniqueid']]['accountcode']){recordings[_0x2bc071[_0xd28c('0x4')]][_0xd28c('0x2a')]=recordings[_0x2bc071['uniqueid']][_0xd28c('0x5')];recordings[_0x2bc071['uniqueid']][_0xd28c('0x2b')]='';}recordings[_0x2bc071['uniqueid']][_0xd28c('0x22')][_0xd28c('0x2d')](function(_0x53c38d){var _0x211939=_[_0xd28c('0x2e')](recordings[_0x2bc071[_0xd28c('0x4')]]);_0x211939[_0xd28c('0x1c')]=_0x53c38d[_0xd28c('0x1c')];writeDB(_0x211939);});delete recordings[_0x2bc071[_0xd28c('0x4')]];}}catch(_0xd53644){utils[_0xd28c('0x10')](util[_0xd28c('0x2')](_0xd28c('0x2f'),_0x2bc071[_0xd28c('0x4')]),_0xd53644);}};exports[_0xd28c('0x30')]=function(_0x340946){try{if(!_[_0xd28c('0x12')](recordings[_0x340946[_0xd28c('0x4')]])){utils['debug'](util[_0xd28c('0x2')](_0xd28c('0x31'),_0x340946[_0xd28c('0x4')]),_0x340946);utils[_0xd28c('0x1')](util[_0xd28c('0x2')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x340946[_0xd28c('0x4')],_0x340946['application'],_0x340946[_0xd28c('0x32')]));if(_0x340946[_0xd28c('0x33')][_0xd28c('0x34')]()==_0xd28c('0x35')&&_[_0xd28c('0x36')](_0x340946['appdata'][_0xd28c('0x34')](),_0xd28c('0x37'))){var _0x299c6a=_0x340946['appdata'][_0xd28c('0x38')]('=');var _0x10fbfc=_0x299c6a[0x0]['substring'](_0x299c6a[0x0][_0xd28c('0x39')]('(')+0x1,_0x299c6a[0x0][_0xd28c('0x39')](')'));var _0x31a97e=_0x299c6a[0x1];recordings[_0x340946['uniqueid']][_0x10fbfc]=_0x31a97e;}}}catch(_0x543546){utils[_0xd28c('0x10')](util['format'](_0xd28c('0x31'),_0x340946['uniqueid']),_0x543546);}};exports[_0xd28c('0x3a')]=function(_0x3c3a93){try{if(!_[_0xd28c('0x12')](recordings[_0x3c3a93[_0xd28c('0x4')]])){utils[_0xd28c('0xb')](util[_0xd28c('0x2')](_0xd28c('0x3b'),_0x3c3a93['uniqueid']),_0x3c3a93);utils['info'](util[_0xd28c('0x2')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x3c3a93['uniqueid'],_0x3c3a93[_0xd28c('0x3c')]));recordings[_0x3c3a93['uniqueid']]['queue']=_0x3c3a93['queue'];}}catch(_0x4c7b14){utils[_0xd28c('0x10')](util[_0xd28c('0x2')]('[%s][recordings][queuecallerjoin]',_0x3c3a93['uniqueid']),_0x4c7b14);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 89616b1..1efd44e 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 _0x24ed=['transfertargetcontext','transfertargetexten','error','origtransfereruniqueid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','uniqueid','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename'];(function(_0x8fca65,_0x1b5101){var _0x44cfbf=function(_0x352ae8){while(--_0x352ae8){_0x8fca65['push'](_0x8fca65['shift']());}};_0x44cfbf(++_0x1b5101);}(_0x24ed,0x1e4));var _0xd24e=function(_0x59bf80,_0x26d1af){_0x59bf80=_0x59bf80-0x0;var _0xbd40ab=_0x24ed[_0x59bf80];return _0xbd40ab;};'use strict';var _=require(_0xd24e('0x0'));var util=require('util');var utils=require(_0xd24e('0x1'));function writeDB(_0x161e1f){utils[_0xd24e('0x2')](util[_0xd24e('0x3')](_0xd24e('0x4'),_0x161e1f[_0xd24e('0x5')]===_0xd24e('0x6')?_0x161e1f['origtransfereruniqueid']:_0x161e1f[_0xd24e('0x7')],_0x161e1f[_0xd24e('0x5')]));utils['request'](_0xd24e('0x8'),_0x161e1f);}exports[_0xd24e('0x9')]=function(_0x201668){try{utils[_0xd24e('0xa')](util['format'](_0xd24e('0xb'),_0x201668['uniqueid']),_0x201668);utils[_0xd24e('0x2')](util[_0xd24e('0x3')](_0xd24e('0xc'),_0x201668['uniqueid'],_0x201668[_0xd24e('0xd')],_0x201668[_0xd24e('0xe')],_0x201668[_0xd24e('0xf')],_0x201668['transfereecalleridname']));_0x201668[_0xd24e('0x5')]=_0xd24e('0x10');writeDB(_0x201668);}catch(_0x10b542){utils['error'](util['format']('[%s][transfers][blindtransfer]',_0x201668[_0xd24e('0x7')]),_0x10b542);}};exports[_0xd24e('0x11')]=function(_0x4b4d46){try{utils[_0xd24e('0xa')](util[_0xd24e('0x3')](_0xd24e('0x12'),_0x4b4d46['origtransfereruniqueid']),_0x4b4d46);utils['info'](util[_0xd24e('0x3')](_0xd24e('0x13'),_0x4b4d46['origtransfereruniqueid'],_0x4b4d46[_0xd24e('0x14')],_0x4b4d46[_0xd24e('0x15')],_0x4b4d46[_0xd24e('0x16')],_0x4b4d46['transfertargetcalleridname']));_0x4b4d46=_[_0xd24e('0x17')](_0x4b4d46,{'transfererchannel':_0x4b4d46['origtransfererchannel'],'transferercalleridnum':_0x4b4d46['origtransferercalleridnum'],'transferercalleridname':_0x4b4d46[_0xd24e('0x15')],'transfererconnectedlinenum':_0x4b4d46[_0xd24e('0x18')],'transfererconnectedlinename':_0x4b4d46[_0xd24e('0x19')],'transfereraccountcode':_0x4b4d46[_0xd24e('0x1a')],'transferercontext':_0x4b4d46[_0xd24e('0x1b')],'transfererexten':_0x4b4d46['secondtransfererexten'],'transfererlinkedid':_0x4b4d46[_0xd24e('0x1c')],'context':_0x4b4d46[_0xd24e('0x1d')],'extension':_0x4b4d46['origtransfererexten'],'type':'attended'});if(_[_0xd24e('0x1e')](_0x4b4d46[_0xd24e('0x1f')])){_0x4b4d46=_[_0xd24e('0x17')](_0x4b4d46,{'transfereechannel':_0x4b4d46[_0xd24e('0x20')],'transfereecalleridnum':_0x4b4d46[_0xd24e('0x16')],'transfereecalleridname':_0x4b4d46[_0xd24e('0x21')],'transfereeconnectedlinenum':_0x4b4d46[_0xd24e('0x22')],'transfereeconnectedlinename':_0x4b4d46[_0xd24e('0x23')],'transfereeaccountcode':_0x4b4d46['transfertargetaccountcode'],'transfereecontext':_0x4b4d46[_0xd24e('0x24')],'transfereeexten':_0x4b4d46[_0xd24e('0x25')],'transfereelinkedid':_0x4b4d46['transfertargetlinkedid']});}writeDB(_0x4b4d46);}catch(_0x13658e){utils[_0xd24e('0x26')](util['format'](_0xd24e('0x12'),_0x4b4d46[_0xd24e('0x27')]),_0x13658e);}}; \ No newline at end of file +var _0xfefb=['info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','uniqueid'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xfefb,0x17a));var _0xbfef=function(_0x1143a0,_0x1029f7){_0x1143a0=_0x1143a0-0x0;var _0x4539f9=_0xfefb[_0x1143a0];return _0x4539f9;};'use strict';var _=require(_0xbfef('0x0'));var util=require(_0xbfef('0x1'));var utils=require(_0xbfef('0x2'));function writeDB(_0x4ad572){utils['info'](util[_0xbfef('0x3')](_0xbfef('0x4'),_0x4ad572[_0xbfef('0x5')]==='attended'?_0x4ad572[_0xbfef('0x6')]:_0x4ad572['uniqueid'],_0x4ad572[_0xbfef('0x5')]));utils[_0xbfef('0x7')](_0xbfef('0x8'),_0x4ad572);}exports[_0xbfef('0x9')]=function(_0x397e3e){try{utils[_0xbfef('0xa')](util[_0xbfef('0x3')]('[%s][transfers][blindtransfer]',_0x397e3e[_0xbfef('0xb')]),_0x397e3e);utils[_0xbfef('0xc')](util['format'](_0xbfef('0xd'),_0x397e3e[_0xbfef('0xb')],_0x397e3e[_0xbfef('0xe')],_0x397e3e[_0xbfef('0xf')],_0x397e3e[_0xbfef('0x10')],_0x397e3e['transfereecalleridname']));_0x397e3e[_0xbfef('0x5')]='blind';writeDB(_0x397e3e);}catch(_0x52614d){utils['error'](util[_0xbfef('0x3')]('[%s][transfers][blindtransfer]',_0x397e3e[_0xbfef('0xb')]),_0x52614d);}};exports['attendedtransfer']=function(_0x14326e){try{utils[_0xbfef('0xa')](util[_0xbfef('0x3')](_0xbfef('0x11'),_0x14326e['origtransfereruniqueid']),_0x14326e);utils['info'](util[_0xbfef('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x14326e[_0xbfef('0x6')],_0x14326e[_0xbfef('0x12')],_0x14326e[_0xbfef('0x13')],_0x14326e[_0xbfef('0x14')],_0x14326e[_0xbfef('0x15')]));_0x14326e=_['assign'](_0x14326e,{'transfererchannel':_0x14326e[_0xbfef('0x16')],'transferercalleridnum':_0x14326e[_0xbfef('0x12')],'transferercalleridname':_0x14326e['origtransferercalleridname'],'transfererconnectedlinenum':_0x14326e[_0xbfef('0x17')],'transfererconnectedlinename':_0x14326e[_0xbfef('0x18')],'transfereraccountcode':_0x14326e[_0xbfef('0x19')],'transferercontext':_0x14326e['secondtransferercontext'],'transfererexten':_0x14326e[_0xbfef('0x1a')],'transfererlinkedid':_0x14326e[_0xbfef('0x1b')],'context':_0x14326e['origtransferercontext'],'extension':_0x14326e['origtransfererexten'],'type':_0xbfef('0x1c')});if(_[_0xbfef('0x1d')](_0x14326e[_0xbfef('0x1e')])){_0x14326e=_[_0xbfef('0x1f')](_0x14326e,{'transfereechannel':_0x14326e[_0xbfef('0x20')],'transfereecalleridnum':_0x14326e[_0xbfef('0x14')],'transfereecalleridname':_0x14326e[_0xbfef('0x15')],'transfereeconnectedlinenum':_0x14326e[_0xbfef('0x21')],'transfereeconnectedlinename':_0x14326e[_0xbfef('0x22')],'transfereeaccountcode':_0x14326e['transfertargetaccountcode'],'transfereecontext':_0x14326e[_0xbfef('0x23')],'transfereeexten':_0x14326e[_0xbfef('0x24')],'transfereelinkedid':_0x14326e[_0xbfef('0x25')]});}writeDB(_0x14326e);}catch(_0x2711e0){utils[_0xbfef('0x26')](util[_0xbfef('0x3')](_0xbfef('0x11'),_0x14326e[_0xbfef('0x6')]),_0x2711e0);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 18621fb..3de8fca 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 _0xaadc=['catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','client','http','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found'];(function(_0x12cd8c,_0x21da4e){var _0x3827b9=function(_0x34266d){while(--_0x34266d){_0x12cd8c['push'](_0x12cd8c['shift']());}};_0x3827b9(++_0x21da4e);}(_0xaadc,0x134));var _0xcaad=function(_0x382cc3,_0x5489f1){_0x382cc3=_0x382cc3-0x0;var _0x4da9bb=_0xaadc[_0x382cc3];return _0x4da9bb;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xcaad('0x0'));var moment=require('moment');var util=require('util');var client=jayson[_0xcaad('0x1')][_0xcaad('0x2')]({'port':0x2329});var logger=require('../../config/logger')(_0xcaad('0x3'));exports[_0xcaad('0x4')]=function(_0x16de36,_0x437126){logger[_0xcaad('0x4')](_0x16de36,_0x437126?util[_0xcaad('0x5')](_0x437126,{'showHidden':![],'depth':null}):'');};exports[_0xcaad('0x6')]=function(_0x2e156d,_0x444a08){logger[_0xcaad('0x6')](_0x2e156d,_0x444a08?util['inspect'](_0x444a08,{'showHidden':![],'depth':null}):'');};exports[_0xcaad('0x7')]=function(_0x3e7bc9,_0x1e7933){logger[_0xcaad('0x7')](_0x3e7bc9,_0x1e7933?util[_0xcaad('0x5')](_0x1e7933,{'showHidden':![],'depth':null}):'');};exports[_0xcaad('0x8')]=function(_0x2219c1,_0x48932d){return client[_0xcaad('0x8')](_0x2219c1,{'body':_0x48932d})[_0xcaad('0x9')](function(_0x50004a){logger['debug'](_0xcaad('0xa'),_0x2219c1,_0x50004a?util['inspect'](_0x50004a,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x156d0b){logger['error']('[utils][request]\x20name:%s',_0x2219c1,_0x156d0b?util[_0xcaad('0x5')](_0x156d0b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5e9646){return client[_0xcaad('0x8')](_0xcaad('0xb'),{'options':{'raw':!![],'attributes':['id',_0xcaad('0xc'),_0xcaad('0xd'),_0xcaad('0xe')],'where':_0x5e9646,'limit':0x1}})[_0xcaad('0x9')](function(_0x26e6b2){logger[_0xcaad('0x6')](_0xcaad('0xf'),JSON['stringify'](_0x5e9646),_0x26e6b2?util['inspect'](_0x26e6b2,{'showHidden':![],'depth':null}):'');return _0x26e6b2[_0xcaad('0x10')][_0xcaad('0x11')]?_0x26e6b2[_0xcaad('0x10')][0x0]:null;});}exports[_0xcaad('0x12')]=function(_0x34f82f){return new BPromise(function(_0x4730c7,_0x16f530){if(_0x34f82f){return getUser({'internal':_0x34f82f})['then'](function(_0x5af0ff){logger[_0xcaad('0x4')](_0xcaad('0x13'),_0x34f82f,_0x5af0ff?_0xcaad('0x14'):'notfound');return _0x4730c7(_0x5af0ff);})[_0xcaad('0x15')](function(_0x449b1b){logger['error'](_0xcaad('0x16'),_0x449b1b?util[_0xcaad('0x5')](_0x449b1b,{'showHidden':![],'depth':null}):'');return _0x4730c7(null);});}return _0x4730c7(null);});};exports[_0xcaad('0x17')]=function(_0x33887d){return new BPromise(function(_0x48862c,_0x5339f0){if(_0x33887d){return getUser({'interface':_0x33887d})[_0xcaad('0x9')](function(_0x5c35e0){logger[_0xcaad('0x4')](_0xcaad('0x18'),_0x33887d,_0x5c35e0?_0xcaad('0x14'):_0xcaad('0x19'));return _0x48862c(_0x5c35e0);})[_0xcaad('0x15')](function(_0x48b7e7){logger['error'](_0xcaad('0x1a'),_0x48b7e7?util[_0xcaad('0x5')](_0x48b7e7,{'showHidden':![],'depth':null}):'');return _0x48862c(null);});}return _0x48862c(null);});};exports['getUserByName']=function(_0x247b7c){return new BPromise(function(_0x15b246,_0x3990f4){if(_0x247b7c){return getUser({'name':_0x247b7c})[_0xcaad('0x9')](function(_0x1b7cb9){logger['info'](_0xcaad('0x1b'),_0x247b7c,_0x1b7cb9?'found':_0xcaad('0x19'));return _0x15b246(_0x1b7cb9);})['catch'](function(_0x149943){logger[_0xcaad('0x7')]('[utils][getUserByName]',_0x149943?util['inspect'](_0x149943,{'showHidden':![],'depth':null}):'');return _0x15b246(null);});}return _0x15b246(null);});};exports[_0xcaad('0x1c')]=function(_0x2620eb){return new BPromise(function(_0x34dbfa,_0x19c156){if(_0x2620eb){return client[_0xcaad('0x8')](_0xcaad('0x1d'),{'options':{'raw':!![],'attributes':['id','name',_0xcaad('0x1e'),_0xcaad('0x1f'),_0xcaad('0x20')],'where':{'name':_0x2620eb},'limit':0x1}})['then'](function(_0x1b2140){logger[_0xcaad('0x6')](_0xcaad('0x21'),_0x2620eb,_0x1b2140?util['inspect'](_0x1b2140,{'showHidden':![],'depth':null}):'');logger[_0xcaad('0x4')](_0xcaad('0x22'),_0x2620eb,_0x1b2140?_0xcaad('0x14'):_0xcaad('0x19'));return _0x34dbfa(_0x1b2140[_0xcaad('0x10')]['length']?_0x1b2140['result'][0x0]:null);})['catch'](function(_0x2234e2){logger[_0xcaad('0x7')](_0xcaad('0x23'),_0x2234e2?util[_0xcaad('0x5')](_0x2234e2,{'showHidden':![],'depth':null}):'');return _0x34dbfa(null);});}return _0x34dbfa(null);});};exports[_0xcaad('0x24')]=function(_0x303425,_0x36a796){return moment(_0x303425)['add'](_0x36a796,'seconds')[_0xcaad('0x25')](_0xcaad('0x26'));};exports[_0xcaad('0x27')]=function(_0x2b981b,_0x52069c){return moment(_0x2b981b)['subtract'](_0x52069c,_0xcaad('0x28'))[_0xcaad('0x25')](_0xcaad('0x26'));};exports[_0xcaad('0x29')]=function(_0x252d20,_0x5760dd){return moment(_0x252d20)[_0xcaad('0x2a')](moment(_0x5760dd),_0xcaad('0x28'));};exports[_0xcaad('0x2b')]=function(_0x145610,_0x13c976){return parseInt(_0x145610,0xa)+parseInt(_0x13c976,0xa);};exports[_0xcaad('0x2c')]=function(){return moment()[_0xcaad('0x25')](_0xcaad('0x26'));};exports[_0xcaad('0x2d')]=function(_0x55ae70,_0x2badb7){if(_0x2badb7){return moment(_0x55ae70)[_0xcaad('0x2d')](_0x2badb7);}return!![];};exports[_0xcaad('0x2e')]=function(_0x309717,_0x4dfe0b){if(_0x4dfe0b){return moment(_0x309717)['isBefore'](_0x4dfe0b);}else if(_0x309717){return!![];}return![];}; \ No newline at end of file +var _0x3939=['acw','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','sumTime','now','isAfter','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue'];(function(_0x2b58f8,_0x14f865){var _0x2af05b=function(_0x2c2bf3){while(--_0x2c2bf3){_0x2b58f8['push'](_0x2b58f8['shift']());}};_0x2af05b(++_0x14f865);}(_0x3939,0xe8));var _0x9393=function(_0x2e82b6,_0x5c7960){_0x2e82b6=_0x2e82b6-0x0;var _0x23f11a=_0x3939[_0x2e82b6];return _0x23f11a;};'use strict';var BPromise=require(_0x9393('0x0'));var jayson=require(_0x9393('0x1'));var moment=require(_0x9393('0x2'));var util=require(_0x9393('0x3'));var client=jayson[_0x9393('0x4')][_0x9393('0x5')]({'port':0x2329});var logger=require(_0x9393('0x6'))(_0x9393('0x7'));exports[_0x9393('0x8')]=function(_0x34049a,_0x3786be){logger[_0x9393('0x8')](_0x34049a,_0x3786be?util[_0x9393('0x9')](_0x3786be,{'showHidden':![],'depth':null}):'');};exports[_0x9393('0xa')]=function(_0x5ed1e,_0x4054b2){logger['debug'](_0x5ed1e,_0x4054b2?util[_0x9393('0x9')](_0x4054b2,{'showHidden':![],'depth':null}):'');};exports[_0x9393('0xb')]=function(_0x268065,_0x47f2d2){logger['error'](_0x268065,_0x47f2d2?util[_0x9393('0x9')](_0x47f2d2,{'showHidden':![],'depth':null}):'');};exports[_0x9393('0xc')]=function(_0x444fe8,_0xc42c53){return client[_0x9393('0xc')](_0x444fe8,{'body':_0xc42c53})['then'](function(_0x2a66c){logger['debug'](_0x9393('0xd'),_0x444fe8,_0x2a66c?util[_0x9393('0x9')](_0x2a66c,{'showHidden':![],'depth':null}):'');})[_0x9393('0xe')](function(_0x2263e0){logger[_0x9393('0xb')](_0x9393('0xd'),_0x444fe8,_0x2263e0?util[_0x9393('0x9')](_0x2263e0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x1961d6){return client[_0x9393('0xc')](_0x9393('0xf'),{'options':{'raw':!![],'attributes':['id','internal',_0x9393('0x10'),_0x9393('0x11')],'where':_0x1961d6,'limit':0x1}})[_0x9393('0x12')](function(_0x55ff3b){logger['debug'](_0x9393('0x13'),JSON[_0x9393('0x14')](_0x1961d6),_0x55ff3b?util[_0x9393('0x9')](_0x55ff3b,{'showHidden':![],'depth':null}):'');return _0x55ff3b['result']['length']?_0x55ff3b[_0x9393('0x15')][0x0]:null;});}exports[_0x9393('0x16')]=function(_0x195454){return new BPromise(function(_0x1ca323,_0x4b78e7){if(_0x195454){return getUser({'internal':_0x195454})['then'](function(_0x7d8b05){logger[_0x9393('0x8')](_0x9393('0x17'),_0x195454,_0x7d8b05?'found':_0x9393('0x18'));return _0x1ca323(_0x7d8b05);})[_0x9393('0xe')](function(_0x5294ef){logger['error'](_0x9393('0x19'),_0x5294ef?util[_0x9393('0x9')](_0x5294ef,{'showHidden':![],'depth':null}):'');return _0x1ca323(null);});}return _0x1ca323(null);});};exports[_0x9393('0x1a')]=function(_0x240a16){return new BPromise(function(_0x119950,_0x3b507c){if(_0x240a16){return getUser({'interface':_0x240a16})[_0x9393('0x12')](function(_0x139435){logger[_0x9393('0x8')](_0x9393('0x1b'),_0x240a16,_0x139435?_0x9393('0x1c'):_0x9393('0x18'));return _0x119950(_0x139435);})[_0x9393('0xe')](function(_0x3d74c6){logger[_0x9393('0xb')]('[utils][getUserByInterface]',_0x3d74c6?util[_0x9393('0x9')](_0x3d74c6,{'showHidden':![],'depth':null}):'');return _0x119950(null);});}return _0x119950(null);});};exports['getUserByName']=function(_0x72d329){return new BPromise(function(_0x4cbff4,_0x498683){if(_0x72d329){return getUser({'name':_0x72d329})[_0x9393('0x12')](function(_0x532be5){logger[_0x9393('0x8')](_0x9393('0x1d'),_0x72d329,_0x532be5?_0x9393('0x1c'):_0x9393('0x18'));return _0x4cbff4(_0x532be5);})[_0x9393('0xe')](function(_0x37d522){logger['error'](_0x9393('0x1e'),_0x37d522?util[_0x9393('0x9')](_0x37d522,{'showHidden':![],'depth':null}):'');return _0x4cbff4(null);});}return _0x4cbff4(null);});};exports['getVoiceQueueByName']=function(_0x282703){return new BPromise(function(_0x28a8fe,_0x65533b){if(_0x282703){return client[_0x9393('0xc')](_0x9393('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x9393('0x10'),'type',_0x9393('0x20'),'acwTimeout'],'where':{'name':_0x282703},'limit':0x1}})['then'](function(_0x361319){logger[_0x9393('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x282703,_0x361319?util['inspect'](_0x361319,{'showHidden':![],'depth':null}):'');logger[_0x9393('0x8')](_0x9393('0x21'),_0x282703,_0x361319?'found':'notfound');return _0x28a8fe(_0x361319['result'][_0x9393('0x22')]?_0x361319[_0x9393('0x15')][0x0]:null);})[_0x9393('0xe')](function(_0x47b702){logger['error']('[utils][getVoiceQueueByName]',_0x47b702?util[_0x9393('0x9')](_0x47b702,{'showHidden':![],'depth':null}):'');return _0x28a8fe(null);});}return _0x28a8fe(null);});};exports[_0x9393('0x23')]=function(_0x1644d1,_0x49fc3f){return moment(_0x1644d1)['add'](_0x49fc3f,_0x9393('0x24'))[_0x9393('0x25')](_0x9393('0x26'));};exports['subtractTime']=function(_0x2e2088,_0x4126d0){return moment(_0x2e2088)[_0x9393('0x27')](_0x4126d0,_0x9393('0x24'))[_0x9393('0x25')](_0x9393('0x26'));};exports[_0x9393('0x28')]=function(_0x57bcc0,_0x31bc2e){return moment(_0x57bcc0)['diff'](moment(_0x31bc2e),'seconds');};exports[_0x9393('0x29')]=function(_0x24354d,_0x5ac8f3){return parseInt(_0x24354d,0xa)+parseInt(_0x5ac8f3,0xa);};exports[_0x9393('0x2a')]=function(){return moment()[_0x9393('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x9393('0x2b')]=function(_0x17baff,_0x282bb8){if(_0x282bb8){return moment(_0x17baff)[_0x9393('0x2b')](_0x282bb8);}return!![];};exports['isBefore']=function(_0x37ffa5,_0x129b34){if(_0x129b34){return moment(_0x37ffa5)['isBefore'](_0x129b34);}else if(_0x37ffa5){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 2d75f97..abe204e 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 _0x3a6a=['ensureDir','then','catch','user','data','timestamp','error','api','auth','set','client-side-logger','use','logger','body','\x20body=%s','format','method','x-forwarded-for','headers','responseTime','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','url','statusCode','device','other','agent_name','test','fs-extra','lodash','express-winston','path','util','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','client','name'];(function(_0x3e9bf7,_0x4305df){var _0x5769bf=function(_0x489093){while(--_0x489093){_0x3e9bf7['push'](_0x3e9bf7['shift']());}};_0x5769bf(++_0x4305df);}(_0x3a6a,0x15a));var _0xa3a6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a6a[_0xa464c9];return _0x3d73c4;};var fs=require(_0xa3a6('0x0'));var _=require(_0xa3a6('0x1'));var ewinston=require(_0xa3a6('0x2'));var path=require(_0xa3a6('0x3'));var util=require(_0xa3a6('0x4'));var fileLogger=require('./loggers')[_0xa3a6('0x5')];var safeTemplate=require('./safe-template')[_0xa3a6('0x6')];var maskSensitiveData=require(_0xa3a6('0x7'))[_0xa3a6('0x8')];function ClientSideLogger(){function _0x169f46(_0x36f666){var _0x36bad6=path[_0xa3a6('0x9')](_0xa3a6('0xa'),_0xa3a6('0xb'),'xcally');var _0x3b8bc8=path[_0xa3a6('0x9')](_0xa3a6('0xc'),_0x36f666['role']+'-'+_0x36f666[_0xa3a6('0xd')]);return fs[_0xa3a6('0xe')](path[_0xa3a6('0x9')](_0x36bad6,_0x3b8bc8))[_0xa3a6('0xf')](function(){var _0x33eba7=fileLogger(_0xa3a6('0xc'),path[_0xa3a6('0x9')](_0x36bad6,_0x3b8bc8));return _0x33eba7;})[_0xa3a6('0x10')](function(_0x45f3ff){throw _0x45f3ff;});}this[_0xa3a6('0xb')]=function(_0x2548bc,_0xf4a8b1,_0x29e0ec,_0xe13b91){return _0x169f46(_0x2548bc[_0xa3a6('0x11')])[_0xa3a6('0xf')](function(_0x302800){var _0x2d8cd5=_0x302800[_0xf4a8b1];return _0x2d8cd5;})['then'](function(_0x2dbdf5){var _0x310e8f=_0x2548bc['user']?_0x2548bc[_0xa3a6('0x11')]['id']:'no-user';var _0x34808a=_0xe13b91[_0xa3a6('0x12')];var _0x28a8ef=_0xe13b91[_0xa3a6('0x13')];var _0x1b88d5=new Date(Number(_0x28a8ef));return _0x2dbdf5(_0x310e8f,_0x1b88d5,_0x29e0ec,_0x34808a);})['catch'](function(_0x5b1249){fileLogger(_0xa3a6('0xc'))[_0xa3a6('0x14')](_0x5b1249);});};}function setupLoggers(_0x1f76a1){return new Promise(function(_0x359222){var _0x3f9d03=new ClientSideLogger();var _0x361d5e=fileLogger(_0xa3a6('0x15'));var _0x5ab3ee=fileLogger(_0xa3a6('0x16'));_0x1f76a1[_0xa3a6('0x17')](_0xa3a6('0x18'),_0x3f9d03);_0x1f76a1[_0xa3a6('0x19')](ewinston[_0xa3a6('0x1a')]({'winstonInstance':_0x361d5e,'meta':![],'statusLevels':!![],'msg':function(_0x3cd540,_0x5c73f0){var _0x3cabf4='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x3cd540[_0xa3a6('0x1b')])){_0x3cabf4+=_0xa3a6('0x1c');var _0x5cdd8f=_0x3cd540[_0xa3a6('0x1b')];maskSensitiveData(_0x5cdd8f);}return safeTemplate(util[_0xa3a6('0x1d')](_0x3cabf4,_0x3cd540[_0xa3a6('0x1e')],_0x3cd540['headers'][_0xa3a6('0x1f')]?_0x3cd540[_0xa3a6('0x20')][_0xa3a6('0x1f')]:_0x3cd540['connection']['remoteAddress']||_0x3cd540['ip'],_0x3cd540['url'],_0x5c73f0['statusCode'],_0x5c73f0[_0xa3a6('0x21')],_0x3cd540[_0xa3a6('0x11')]?_0x3cd540[_0xa3a6('0x11')]['id']:null,_0x3cd540[_0xa3a6('0x11')]?_0x3cd540[_0xa3a6('0x11')]['name']:null,_0x3cd540[_0xa3a6('0x11')]?_0x3cd540[_0xa3a6('0x11')][_0xa3a6('0x22')]:null,_0x5cdd8f?util['inspect'](_0x5cdd8f,![],null):''));}}));_0x1f76a1['use'](ewinston[_0xa3a6('0x1a')]({'winstonInstance':_0x5ab3ee,'meta':![],'statusLevels':!![],'msg':function(_0x1bec47,_0xd1e196){var _0x29fa6a=_0xa3a6('0x23');if(_0x1bec47[_0xa3a6('0x1b')]&&_0x1bec47['body']['device']&&_0x1bec47['body'][_0xa3a6('0x24')]){_0x29fa6a=_0xa3a6('0x25');}return util[_0xa3a6('0x1d')](_0x29fa6a,_0x1bec47[_0xa3a6('0x1e')],_0x1bec47[_0xa3a6('0x20')][_0xa3a6('0x1f')]?_0x1bec47[_0xa3a6('0x20')]['x-forwarded-for']:_0x1bec47[_0xa3a6('0x26')]['remoteAddress']||_0x1bec47['ip'],_0x1bec47[_0xa3a6('0x27')],_0xd1e196[_0xa3a6('0x28')],_0xd1e196[_0xa3a6('0x21')],_0x1bec47[_0xa3a6('0x11')]?_0x1bec47[_0xa3a6('0x11')]['id']:null,_0x1bec47[_0xa3a6('0x11')]?_0x1bec47[_0xa3a6('0x11')][_0xa3a6('0xd')]:null,_0x1bec47['user']?_0x1bec47[_0xa3a6('0x11')][_0xa3a6('0x22')]:null,_0x1bec47[_0xa3a6('0x1b')]&&_0x1bec47[_0xa3a6('0x1b')]['device']?_0x1bec47['body'][_0xa3a6('0x29')]:_0xa3a6('0x2a'),_0x1bec47['body']&&_0x1bec47[_0xa3a6('0x1b')][_0xa3a6('0x24')]?_0x1bec47[_0xa3a6('0x1b')][_0xa3a6('0x24')]:'',_0x1bec47[_0xa3a6('0x1b')]&&_0x1bec47['body'][_0xa3a6('0x2b')]?_0x1bec47[_0xa3a6('0x1b')][_0xa3a6('0x2b')]:'');},'ignoreRoute':function(_0x503056){var _0x184af5=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x184af5[_0xa3a6('0x2c')](_0x503056['url']);}}));return _0x359222();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0xd542=['format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','role','other','agent_name','test','fs-extra','express-winston','path','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','xcally','client','name','ensureDir','catch','log','user','then','data','error','api','set','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s'];(function(_0x42175f,_0x4a5bfb){var _0x409c17=function(_0x133184){while(--_0x133184){_0x42175f['push'](_0x42175f['shift']());}};_0x409c17(++_0x4a5bfb);}(_0xd542,0x18b));var _0x2d54=function(_0x141408,_0xc0e883){_0x141408=_0x141408-0x0;var _0x35a485=_0xd542[_0x141408];return _0x35a485;};var fs=require(_0x2d54('0x0'));var _=require('lodash');var ewinston=require(_0x2d54('0x1'));var path=require(_0x2d54('0x2'));var util=require('util');var fileLogger=require('./loggers')[_0x2d54('0x3')];var safeTemplate=require(_0x2d54('0x4'))[_0x2d54('0x5')];var maskSensitiveData=require(_0x2d54('0x6'))[_0x2d54('0x7')];function ClientSideLogger(){function _0x5bc0d3(_0x1c0566){var _0x212704=path[_0x2d54('0x8')](_0x2d54('0x9'),'log',_0x2d54('0xa'));var _0x3fe28b=path[_0x2d54('0x8')](_0x2d54('0xb'),_0x1c0566['role']+'-'+_0x1c0566[_0x2d54('0xc')]);return fs[_0x2d54('0xd')](path[_0x2d54('0x8')](_0x212704,_0x3fe28b))['then'](function(){var _0x5cb446=fileLogger(_0x2d54('0xb'),path[_0x2d54('0x8')](_0x212704,_0x3fe28b));return _0x5cb446;})[_0x2d54('0xe')](function(_0x5a4e67){throw _0x5a4e67;});}this[_0x2d54('0xf')]=function(_0x4c3c54,_0x38a442,_0x502a82,_0x3cb8c3){return _0x5bc0d3(_0x4c3c54[_0x2d54('0x10')])['then'](function(_0x2c14f8){var _0x320b4f=_0x2c14f8[_0x38a442];return _0x320b4f;})[_0x2d54('0x11')](function(_0x491e64){var _0x361c81=_0x4c3c54[_0x2d54('0x10')]?_0x4c3c54['user']['id']:'no-user';var _0x5510f5=_0x3cb8c3[_0x2d54('0x12')];var _0x2eac4f=_0x3cb8c3['timestamp'];var _0x4f99b9=new Date(Number(_0x2eac4f));return _0x491e64(_0x361c81,_0x4f99b9,_0x502a82,_0x5510f5);})[_0x2d54('0xe')](function(_0x4b6d0e){fileLogger(_0x2d54('0xb'))[_0x2d54('0x13')](_0x4b6d0e);});};}function setupLoggers(_0x5f39e5){return new Promise(function(_0x227942){var _0x4b2975=new ClientSideLogger();var _0x6feab9=fileLogger(_0x2d54('0x14'));var _0xab3442=fileLogger('auth');_0x5f39e5[_0x2d54('0x15')](_0x2d54('0x16'),_0x4b2975);_0x5f39e5['use'](ewinston[_0x2d54('0x17')]({'winstonInstance':_0x6feab9,'meta':![],'statusLevels':!![],'msg':function(_0x17dd5c,_0x20161a){var _0x31bb05=_0x2d54('0x18');if(!_[_0x2d54('0x19')](_0x17dd5c[_0x2d54('0x1a')])){_0x31bb05+=_0x2d54('0x1b');var _0x5499a1=_0x17dd5c[_0x2d54('0x1a')];maskSensitiveData(_0x5499a1);}return safeTemplate(util[_0x2d54('0x1c')](_0x31bb05,_0x17dd5c[_0x2d54('0x1d')],_0x17dd5c[_0x2d54('0x1e')][_0x2d54('0x1f')]?_0x17dd5c[_0x2d54('0x1e')]['x-forwarded-for']:_0x17dd5c[_0x2d54('0x20')][_0x2d54('0x21')]||_0x17dd5c['ip'],_0x17dd5c[_0x2d54('0x22')],_0x20161a[_0x2d54('0x23')],_0x20161a[_0x2d54('0x24')],_0x17dd5c[_0x2d54('0x10')]?_0x17dd5c[_0x2d54('0x10')]['id']:null,_0x17dd5c[_0x2d54('0x10')]?_0x17dd5c['user'][_0x2d54('0xc')]:null,_0x17dd5c['user']?_0x17dd5c['user']['role']:null,_0x5499a1?util[_0x2d54('0x25')](_0x5499a1,![],null):''));}}));_0x5f39e5[_0x2d54('0x26')](ewinston[_0x2d54('0x17')]({'winstonInstance':_0xab3442,'meta':![],'statusLevels':!![],'msg':function(_0x156667,_0x3ae499){var _0x5c24cb=_0x2d54('0x27');if(_0x156667[_0x2d54('0x1a')]&&_0x156667['body'][_0x2d54('0x28')]&&_0x156667[_0x2d54('0x1a')][_0x2d54('0x29')]){_0x5c24cb=_0x2d54('0x2a');}return util[_0x2d54('0x1c')](_0x5c24cb,_0x156667[_0x2d54('0x1d')],_0x156667['headers'][_0x2d54('0x1f')]?_0x156667[_0x2d54('0x1e')]['x-forwarded-for']:_0x156667[_0x2d54('0x20')][_0x2d54('0x21')]||_0x156667['ip'],_0x156667['url'],_0x3ae499['statusCode'],_0x3ae499['responseTime'],_0x156667[_0x2d54('0x10')]?_0x156667['user']['id']:null,_0x156667[_0x2d54('0x10')]?_0x156667[_0x2d54('0x10')]['name']:null,_0x156667['user']?_0x156667['user'][_0x2d54('0x2b')]:null,_0x156667[_0x2d54('0x1a')]&&_0x156667[_0x2d54('0x1a')]['device']?_0x156667['body'][_0x2d54('0x28')]:_0x2d54('0x2c'),_0x156667[_0x2d54('0x1a')]&&_0x156667[_0x2d54('0x1a')]['agent_id']?_0x156667[_0x2d54('0x1a')][_0x2d54('0x29')]:'',_0x156667[_0x2d54('0x1a')]&&_0x156667[_0x2d54('0x1a')][_0x2d54('0x2d')]?_0x156667[_0x2d54('0x1a')][_0x2d54('0x2d')]:'');},'ignoreRoute':function(_0x2ee661){var _0x2dc23b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2dc23b[_0x2d54('0x2e')](_0x2ee661[_0x2d54('0x22')]);}}));return _0x227942();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 680fb3b..70db3d5 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62aa=['min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','lodash','moment-timezone','map','source','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','circularDoWInterval','concat','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','includes','dowCompare','date','daysInMonth','max'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62aa,0x11a));var _0xa62a=function(_0x829915,_0x141db6){_0x829915=_0x829915-0x0;var _0xdb692b=_0x62aa[_0x829915];return _0xdb692b;};var _=require(_0xa62a('0x0'));var moment=require(_0xa62a('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][_0xa62a('0x2')](function(_0x488db8){return _0x488db8[_0xa62a('0x3')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE=_0xa62a('0x4');function throwIfDateNotValid(_0x1658ee){if(!_0x1658ee[_0xa62a('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x229976){var _0x348dd0=_0x229976[_0xa62a('0x6')](':')[_0xa62a('0x2')](function(_0x40ebb1){return parseInt(_0x40ebb1,0xa);});var _0x34aff5=_0x348dd0[0x0];var _0xf6b91=_0x348dd0[0x1];if(_0x34aff5<0x0||_0x34aff5>0x17||_0xf6b91<0x0||_0xf6b91>0x3b){throw new Error(EINVALID_DATE);}return[_0x34aff5,_0xf6b91];}function circularDoWInterval(_0x4a0c67,_0x36e2b2){if(_0x4a0c67===_0x36e2b2){return[_0x4a0c67];}else{var _0x3eaeca=moment['locale']();moment[_0xa62a('0x7')]('en');var _0x48922e=moment[_0xa62a('0x8')]()['map'](function(_0x4fad57){return _0x4fad57[_0xa62a('0x9')]();});moment['locale'](_0x3eaeca);var _0x16f002=_0x48922e[_0xa62a('0xa')](_0x4a0c67);var _0x12aac2=_0x48922e['indexOf'](_0x36e2b2);if(_0x12aac2>_0x16f002){return _0x48922e[_0xa62a('0xb')](_0x16f002,_0x12aac2+0x1);}else{var _0x1a99b6=_0x48922e[_0xa62a('0xb')](0x0,_0x12aac2+0x1);var _0x351a44=_0x48922e[_0xa62a('0xb')](_0x16f002);return _0x351a44['concat'](_0x1a99b6);}}}module[_0xa62a('0xc')][_0xa62a('0xd')]=circularDoWInterval;function circularMonthInterval(_0x199fe0,_0x391461){if(_0x199fe0===_0x391461){return[_0x199fe0];}else{var _0xe7c928=moment[_0xa62a('0x7')]();moment[_0xa62a('0x7')]('en');var _0x3f0b08=moment['monthsShort']()['map'](function(_0xa29ea2){return _0xa29ea2[_0xa62a('0x9')]();});moment[_0xa62a('0x7')](_0xe7c928);var _0x1b50dc=_0x3f0b08[_0xa62a('0xa')](_0x199fe0);var _0x4cbf76=_0x3f0b08[_0xa62a('0xa')](_0x391461);if(_0x4cbf76>_0x1b50dc){return _0x3f0b08[_0xa62a('0xb')](_0x1b50dc,_0x4cbf76+0x1);}else{var _0x33a29d=_0x3f0b08[_0xa62a('0xb')](0x0,_0x4cbf76+0x1);var _0x2d32cb=_0x3f0b08[_0xa62a('0xb')](_0x1b50dc);return _0x2d32cb[_0xa62a('0xe')](_0x33a29d);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x33d83d){var _0x2c9ac7=parseInt(_0x33d83d,0xa);if(_0x2c9ac7<0x1||_0x2c9ac7>0x1f){throw new Error(EINVALID_DATE);}return _0x2c9ac7;}function timeCompare(_0xbe8aeb,_0x270435,_0x2a26a9){var _0x46c1b3=_0xbe8aeb[_0xa62a('0xf')]();var _0x27a841=extractTime(_0x270435);var _0x2358a9=_0x27a841[0x0];var _0x40b8c3=_0x27a841[0x1];var _0x1712c3=_0xbe8aeb[_0xa62a('0xf')]()[_0xa62a('0x10')](_0x2358a9)[_0xa62a('0x11')](_0x40b8c3);throwIfDateNotValid(_0x1712c3);var _0x5c38a2=extractTime(_0x2a26a9);var _0x5026e7=_0x5c38a2[0x0];var _0x3d9043=_0x5c38a2[0x1];var _0x3cac82=_0xbe8aeb[_0xa62a('0xf')]()[_0xa62a('0x10')](_0x5026e7)['minutes'](_0x3d9043);throwIfDateNotValid(_0x3cac82);if(_0x3cac82[_0xa62a('0x12')](_0x1712c3)){var _0x567717=_0x46c1b3[_0xa62a('0xf')]()[_0xa62a('0x13')](_0xa62a('0x14'));var _0x4836f5=_0x46c1b3['clone']()[_0xa62a('0x15')](_0xa62a('0x14'));return _0x46c1b3[_0xa62a('0x16')](_0x1712c3,_0x4836f5,undefined,'[]')||_0x46c1b3[_0xa62a('0x16')](_0x567717,_0x3cac82,undefined,'[]');}else{return _0x46c1b3['isBetween'](_0x1712c3,_0x3cac82,undefined,'[]');}}module['exports'][_0xa62a('0x17')]=timeCompare;function dowCompare(_0x2b8d67,_0x83381f,_0x2153ca){var _0xb0c98f=_0x2b8d67[_0xa62a('0x7')]('en')[_0xa62a('0x18')]('ddd')[_0xa62a('0x9')]();return circularDoWInterval(_0x83381f,_0x2153ca)[_0xa62a('0x19')](_0xb0c98f);}module['exports'][_0xa62a('0x1a')]=dowCompare;function domCompare(_0x398eef,_0x9997fd,_0x94b037){var _0x597aec=_0x398eef[_0xa62a('0x1b')]();if(_0x9997fd===_0x94b037){return _0x597aec===_0x9997fd;}else{var _0x17c75f=_0x398eef[_0xa62a('0x1c')]();var _0x5cb9e6=_0x9997fd<_0x94b037;let _0x284b2b=![];var _0x44cca=0x0;var _0x557637=0x0;if(_0x5cb9e6){_0x44cca=Math[_0xa62a('0x1d')](0x1,_0x9997fd);_0x557637=Math[_0xa62a('0x1e')](_0x94b037,_0x17c75f);_0x284b2b=_0x597aec>=_0x44cca&&_0x597aec<=_0x557637;}else{_0x44cca=Math[_0xa62a('0x1e')](_0x9997fd,_0x17c75f);_0x557637=Math[_0xa62a('0x1d')](0x1,_0x94b037);_0x284b2b=_0x597aec>=_0x44cca||_0x597aec<=_0x557637;}return _0x284b2b;}}module[_0xa62a('0xc')][_0xa62a('0x1f')]=domCompare;function monthCompare(_0x258a84,_0x4e828e,_0x2f2f62){var _0x1ddcce=_0x258a84[_0xa62a('0x7')]('en')[_0xa62a('0x18')](_0xa62a('0x20'))[_0xa62a('0x9')]();return circularMonthInterval(_0x4e828e,_0x2f2f62)[_0xa62a('0x19')](_0x1ddcce);}module[_0xa62a('0xc')][_0xa62a('0x21')]=monthCompare;function iftime(_0x4b2b3b,_0x447260=moment['tz'][_0xa62a('0x22')](),_0x2593bf=moment()){if(!validateRx[_0xa62a('0x23')](_0x4b2b3b)){throw new Error(EINVALID_STRING);}else{var _0x2113b9=(moment[_0xa62a('0x24')](_0x2593bf)?_0x2593bf[_0xa62a('0xf')]():moment(_0x2593bf))['tz'](_0x447260)[_0xa62a('0x7')]('en');throwIfDateNotValid(_0x2113b9);var _0x167c5a=_0x4b2b3b['split'](',');var _0x323c90=_0x167c5a[0x0];var _0x7547d5=_0x167c5a[0x1];var _0x3ab564=_0x167c5a[0x2];var _0x44cede=_0x167c5a[0x3];let _0x576e0a=!![];if(_0x323c90!=='*'){var _0x3a863d=_0x323c90[_0xa62a('0x6')]('-');var _0x3b9459=_[_0xa62a('0x25')](_0x3a863d[0x0],0x5,'0');var _0x146156=_0x3a863d[_0xa62a('0x26')]===0x2?_[_0xa62a('0x25')](_0x3a863d[0x1],0x5,'0'):_0x3b9459;_0x576e0a=timeCompare(_0x2113b9,_0x3b9459,_0x146156);}let _0x14d00f=!![];if(_0x7547d5!=='*'){var _0x19b2d1=_0x7547d5['split']('-');var _0x29d754=_0x19b2d1[0x0];var _0x10698a=_0x19b2d1[_0xa62a('0x26')]===0x2?_0x19b2d1[0x1]:_0x29d754;_0x14d00f=dowCompare(_0x2113b9,_0x29d754,_0x10698a);}let _0x409652=!![];if(_0x3ab564!=='*'){var _0x45a590=_0x3ab564['split']('-');var _0x178645=parseDom(_0x45a590[0x0]);var _0x33b57b=_0x45a590['length']===0x2?parseDom(_0x45a590[0x1]):_0x178645;_0x409652=domCompare(_0x2113b9,_0x178645,_0x33b57b);}let _0x3ae163=!![];if(_0x44cede!=='*'){var _0x47d0a5=_0x44cede[_0xa62a('0x6')]('-');var _0x33eb6c=_0x47d0a5[0x0];var _0x296326=_0x47d0a5[_0xa62a('0x26')]===0x2?_0x47d0a5[0x1]:_0x47d0a5[0x0];_0x3ae163=monthCompare(_0x2113b9,_0x33eb6c,_0x296326);}return _0x576e0a&&_0x14d00f&&_0x409652&&_0x3ae163;}}module['exports']['iftime']=iftime; \ No newline at end of file +var _0xeece=['isMoment','padStart','length','iftime','lodash','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','circularDoWInterval','exports','circularMonthInterval','clone','hours','minutes','startOf','day','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','min','max','domCompare','MMM','monthCompare','guess'];(function(_0x466d9d,_0x368976){var _0x1c950c=function(_0x122f63){while(--_0x122f63){_0x466d9d['push'](_0x466d9d['shift']());}};_0x1c950c(++_0x368976);}(_0xeece,0x180));var _0xeeec=function(_0x3649d3,_0x283e04){_0x3649d3=_0x3649d3-0x0;var _0x44245a=_0xeece[_0x3649d3];return _0x44245a;};var _=require(_0xeeec('0x0'));var moment=require('moment-timezone');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][_0xeeec('0x1')](function(_0x2caa1f){return _0x2caa1f[_0xeeec('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xeeec('0x3');var EINVALID_DATE=_0xeeec('0x4');function throwIfDateNotValid(_0x2f7f2f){if(!_0x2f7f2f[_0xeeec('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x1952fa){var _0x2043d7=_0x1952fa[_0xeeec('0x6')](':')[_0xeeec('0x1')](function(_0x2f75c5){return parseInt(_0x2f75c5,0xa);});var _0x2cefd5=_0x2043d7[0x0];var _0x34502a=_0x2043d7[0x1];if(_0x2cefd5<0x0||_0x2cefd5>0x17||_0x34502a<0x0||_0x34502a>0x3b){throw new Error(EINVALID_DATE);}return[_0x2cefd5,_0x34502a];}function circularDoWInterval(_0x1e1621,_0x488596){if(_0x1e1621===_0x488596){return[_0x1e1621];}else{var _0x5c1de5=moment['locale']();moment[_0xeeec('0x7')]('en');var _0x19edde=moment['weekdaysShort']()[_0xeeec('0x1')](function(_0xbf15de){return _0xbf15de[_0xeeec('0x8')]();});moment['locale'](_0x5c1de5);var _0xf9d6a6=_0x19edde[_0xeeec('0x9')](_0x1e1621);var _0x3b3efa=_0x19edde[_0xeeec('0x9')](_0x488596);if(_0x3b3efa>_0xf9d6a6){return _0x19edde[_0xeeec('0xa')](_0xf9d6a6,_0x3b3efa+0x1);}else{var _0x40af34=_0x19edde['slice'](0x0,_0x3b3efa+0x1);var _0x217368=_0x19edde[_0xeeec('0xa')](_0xf9d6a6);return _0x217368[_0xeeec('0xb')](_0x40af34);}}}module['exports'][_0xeeec('0xc')]=circularDoWInterval;function circularMonthInterval(_0x37b2b1,_0x34e631){if(_0x37b2b1===_0x34e631){return[_0x37b2b1];}else{var _0x4ee6f8=moment['locale']();moment[_0xeeec('0x7')]('en');var _0xbd767d=moment['monthsShort']()['map'](function(_0x9196d4){return _0x9196d4['toLowerCase']();});moment[_0xeeec('0x7')](_0x4ee6f8);var _0x453920=_0xbd767d[_0xeeec('0x9')](_0x37b2b1);var _0x1067d8=_0xbd767d['indexOf'](_0x34e631);if(_0x1067d8>_0x453920){return _0xbd767d['slice'](_0x453920,_0x1067d8+0x1);}else{var _0x1cd9c9=_0xbd767d[_0xeeec('0xa')](0x0,_0x1067d8+0x1);var _0xa11a62=_0xbd767d['slice'](_0x453920);return _0xa11a62[_0xeeec('0xb')](_0x1cd9c9);}}}module[_0xeeec('0xd')][_0xeeec('0xe')]=circularMonthInterval;function parseDom(_0x89908){var _0x255ea0=parseInt(_0x89908,0xa);if(_0x255ea0<0x1||_0x255ea0>0x1f){throw new Error(EINVALID_DATE);}return _0x255ea0;}function timeCompare(_0x280e86,_0x4b8791,_0x100112){var _0x245bd8=_0x280e86['clone']();var _0xef0de4=extractTime(_0x4b8791);var _0x37a7a5=_0xef0de4[0x0];var _0x3568ea=_0xef0de4[0x1];var _0x19fba5=_0x280e86[_0xeeec('0xf')]()[_0xeeec('0x10')](_0x37a7a5)[_0xeeec('0x11')](_0x3568ea);throwIfDateNotValid(_0x19fba5);var _0x358515=extractTime(_0x100112);var _0xd522ac=_0x358515[0x0];var _0x5140c8=_0x358515[0x1];var _0x163cbe=_0x280e86[_0xeeec('0xf')]()[_0xeeec('0x10')](_0xd522ac)[_0xeeec('0x11')](_0x5140c8);throwIfDateNotValid(_0x163cbe);if(_0x163cbe['isBefore'](_0x19fba5)){var _0x5c6a3e=_0x245bd8[_0xeeec('0xf')]()[_0xeeec('0x12')](_0xeeec('0x13'));var _0x231ba5=_0x245bd8['clone']()['endOf'](_0xeeec('0x13'));return _0x245bd8['isBetween'](_0x19fba5,_0x231ba5,undefined,'[]')||_0x245bd8[_0xeeec('0x14')](_0x5c6a3e,_0x163cbe,undefined,'[]');}else{return _0x245bd8['isBetween'](_0x19fba5,_0x163cbe,undefined,'[]');}}module[_0xeeec('0xd')][_0xeeec('0x15')]=timeCompare;function dowCompare(_0x51c160,_0x35788d,_0x6bff8a){var _0xd62327=_0x51c160[_0xeeec('0x7')]('en')[_0xeeec('0x16')](_0xeeec('0x17'))['toLowerCase']();return circularDoWInterval(_0x35788d,_0x6bff8a)[_0xeeec('0x18')](_0xd62327);}module[_0xeeec('0xd')][_0xeeec('0x19')]=dowCompare;function domCompare(_0xf22379,_0x41abb3,_0x54c701){var _0x1de3fa=_0xf22379[_0xeeec('0x1a')]();if(_0x41abb3===_0x54c701){return _0x1de3fa===_0x41abb3;}else{var _0x267655=_0xf22379[_0xeeec('0x1b')]();var _0x1d0aef=_0x41abb3<_0x54c701;let _0x244167=![];var _0x2b1558=0x0;var _0x48c570=0x0;if(_0x1d0aef){_0x2b1558=Math['max'](0x1,_0x41abb3);_0x48c570=Math[_0xeeec('0x1c')](_0x54c701,_0x267655);_0x244167=_0x1de3fa>=_0x2b1558&&_0x1de3fa<=_0x48c570;}else{_0x2b1558=Math[_0xeeec('0x1c')](_0x41abb3,_0x267655);_0x48c570=Math[_0xeeec('0x1d')](0x1,_0x54c701);_0x244167=_0x1de3fa>=_0x2b1558||_0x1de3fa<=_0x48c570;}return _0x244167;}}module[_0xeeec('0xd')][_0xeeec('0x1e')]=domCompare;function monthCompare(_0x40433c,_0x494836,_0x427769){var _0x53c8d2=_0x40433c[_0xeeec('0x7')]('en')[_0xeeec('0x16')](_0xeeec('0x1f'))[_0xeeec('0x8')]();return circularMonthInterval(_0x494836,_0x427769)['includes'](_0x53c8d2);}module[_0xeeec('0xd')][_0xeeec('0x20')]=monthCompare;function iftime(_0x4f7cfc,_0x5d85e6=moment['tz'][_0xeeec('0x21')](),_0x1ddedc=moment()){if(!validateRx['test'](_0x4f7cfc)){throw new Error(EINVALID_STRING);}else{var _0x5adca4=(moment[_0xeeec('0x22')](_0x1ddedc)?_0x1ddedc[_0xeeec('0xf')]():moment(_0x1ddedc))['tz'](_0x5d85e6)[_0xeeec('0x7')]('en');throwIfDateNotValid(_0x5adca4);var _0x1f4f8c=_0x4f7cfc[_0xeeec('0x6')](',');var _0x4ce80e=_0x1f4f8c[0x0];var _0x8cc96e=_0x1f4f8c[0x1];var _0x503d3f=_0x1f4f8c[0x2];var _0x3e63e0=_0x1f4f8c[0x3];let _0x3cfbcf=!![];if(_0x4ce80e!=='*'){var _0x2f6f57=_0x4ce80e[_0xeeec('0x6')]('-');var _0x13ea45=_[_0xeeec('0x23')](_0x2f6f57[0x0],0x5,'0');var _0x17e1d6=_0x2f6f57['length']===0x2?_['padStart'](_0x2f6f57[0x1],0x5,'0'):_0x13ea45;_0x3cfbcf=timeCompare(_0x5adca4,_0x13ea45,_0x17e1d6);}let _0x3cf18e=!![];if(_0x8cc96e!=='*'){var _0x4180aa=_0x8cc96e[_0xeeec('0x6')]('-');var _0x54c18c=_0x4180aa[0x0];var _0x22f5a6=_0x4180aa[_0xeeec('0x24')]===0x2?_0x4180aa[0x1]:_0x54c18c;_0x3cf18e=dowCompare(_0x5adca4,_0x54c18c,_0x22f5a6);}let _0x33629b=!![];if(_0x503d3f!=='*'){var _0x46a451=_0x503d3f[_0xeeec('0x6')]('-');var _0x5dbfc3=parseDom(_0x46a451[0x0]);var _0x5ca19f=_0x46a451['length']===0x2?parseDom(_0x46a451[0x1]):_0x5dbfc3;_0x33629b=domCompare(_0x5adca4,_0x5dbfc3,_0x5ca19f);}let _0x1412a8=!![];if(_0x3e63e0!=='*'){var _0x21e7fa=_0x3e63e0[_0xeeec('0x6')]('-');var _0x527f9e=_0x21e7fa[0x0];var _0x41482f=_0x21e7fa[_0xeeec('0x24')]===0x2?_0x21e7fa[0x1]:_0x21e7fa[0x0];_0x1412a8=monthCompare(_0x5adca4,_0x527f9e,_0x41482f);}return _0x3cfbcf&&_0x3cf18e&&_0x33629b&&_0x1412a8;}}module[_0xeeec('0xd')][_0xeeec('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 564c272..303705a 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x952e=['[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','toUpperCase','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','util','moment','../config/environment','debugLevel','red','bold\x20white','bold\x20green','gray','bold\x20blue','/var/log/xcally','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','keys','meta','length'];(function(_0x14523d,_0x548920){var _0x1478c7=function(_0x2f13d8){while(--_0x2f13d8){_0x14523d['push'](_0x14523d['shift']());}};_0x1478c7(++_0x548920);}(_0x952e,0x103));var _0xe952=function(_0x1b6fa0,_0x27856e){_0x1b6fa0=_0x1b6fa0-0x0;var _0x2c7db9=_0x952e[_0x1b6fa0];return _0x2c7db9;};'use strict';var path=require('path');var util=require(_0xe952('0x0'));var moment=require(_0xe952('0x1'));var winston=require('winston');var config=require(_0xe952('0x2'));var debugLevel=config[_0xe952('0x3')]?config[_0xe952('0x3')]['toLowerCase']():'info';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':'redBG\x20white','error':_0xe952('0x4'),'warn':'bold\x20yellow','info':'white','print':_0xe952('0x5'),'success':_0xe952('0x6'),'http':_0xe952('0x7'),'verbose':'bold\x20magenta','debug':_0xe952('0x8'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0xd7b2f3,_0x38ba42,_0x5afa5d){var _0x3e56bd=_0xd7b2f3||_0xe952('0x9');return path['join'](_0x3e56bd,util[_0xe952('0xa')](_0xe952('0xb'),_0x38ba42,_0x5afa5d));}function formatter(_0x5b08ba,_0x33cfd3){_0x33cfd3[_0xe952('0xc')]=_0x33cfd3[_0xe952('0xc')]['replace'](/@@{/g,_0xe952('0xd'))[_0xe952('0xe')](/}@@/g,_0xe952('0xf'))[_0xe952('0xe')](/@{/g,'{{')[_0xe952('0xe')](/}@/g,'}}');return util['format'](_0xe952('0x10'),moment()[_0xe952('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),_0x33cfd3['level']['toUpperCase'](),_0x5b08ba,_0x33cfd3[_0xe952('0xc')]);}function fileFormat(_0x376c88,_0x1fa246){_0x1fa246[_0xe952('0xc')]=_0x1fa246['message'][_0xe952('0xe')](/@@{/g,'{{{')[_0xe952('0xe')](/}@@/g,_0xe952('0xf'))['replace'](/@{/g,'{{')[_0xe952('0xe')](/}@/g,'}}');var _0x58c097=_0x1fa246['meta']&&Object[_0xe952('0x11')](_0x1fa246[_0xe952('0x12')])[_0xe952('0x13')]?'\x0a\x09'+JSON['stringify'](_0x1fa246[_0xe952('0x12')]):'';return util['format'](_0xe952('0x14'),moment()[_0xe952('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1fa246[_0xe952('0x15')][_0xe952('0x16')](),_0x376c88,_0x1fa246[_0xe952('0xc')],_0x58c097);}function consoleLogger(){var _0x176c27=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe952('0x17'))][(_0xe952('0x18'))]({'level':_0xe952('0x19'),'json':![],'formatter':function(_0x4c1f6a){return formatter('',_0x4c1f6a);}})]});return _0x176c27;}function fileLogger(_0x12ec04,_0x4617f9){var _0x44b18d=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xe952('0x17'))]['File']({'name':util['format'](_0xe952('0x1a'),_0x12ec04,'error'),'filename':getLogFileName(_0x4617f9,_0x12ec04,_0xe952('0x1b')),'level':_0xe952('0x1b'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x344dc4){return fileFormat(_0x12ec04,_0x344dc4);}}),new winston[(_0xe952('0x17'))][(_0xe952('0x1c'))]({'name':util[_0xe952('0xa')]('%s-%s',_0x12ec04,debugLevel),'filename':getLogFileName(_0x4617f9,_0x12ec04,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x35d029){return fileFormat(_0x12ec04,_0x35d029);}}),new winston['transports'][(_0xe952('0x18'))]({'level':_0xe952('0x19'),'json':![],'formatter':function(_0x10cb26){return fileFormat(_0x12ec04,_0x10cb26);}})]});return _0x44b18d;}exports[_0xe952('0x1d')]=consoleLogger;exports[_0xe952('0x1e')]=fileLogger; \ No newline at end of file +var _0x5ac9=['redBG\x20white','red','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','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','warn','transports','File','%s-%s','error','Console','fileLogger','moment','winston','../config/environment','toLowerCase','info'];(function(_0x414a28,_0x36fa1d){var _0x1b9775=function(_0x40090c){while(--_0x40090c){_0x414a28['push'](_0x414a28['shift']());}};_0x1b9775(++_0x36fa1d);}(_0x5ac9,0xbe));var _0x95ac=function(_0x53527e,_0x17a1dd){_0x53527e=_0x53527e-0x0;var _0x36fd1e=_0x5ac9[_0x53527e];return _0x36fd1e;};'use strict';var path=require('path');var util=require('util');var moment=require(_0x95ac('0x0'));var winston=require(_0x95ac('0x1'));var config=require(_0x95ac('0x2'));var debugLevel=config['debugLevel']?config['debugLevel'][_0x95ac('0x3')]():_0x95ac('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':_0x95ac('0x5'),'error':_0x95ac('0x6'),'warn':'bold\x20yellow','info':_0x95ac('0x7'),'print':_0x95ac('0x8'),'success':_0x95ac('0x9'),'http':_0x95ac('0xa'),'verbose':_0x95ac('0xb'),'debug':_0x95ac('0xc'),'silly':_0x95ac('0xd')};winston[_0x95ac('0xe')](XC_LOG_COLORS);function getLogFileName(_0x5e912d,_0x2006bc,_0x151777){var _0x4b343e=_0x5e912d||_0x95ac('0xf');return path[_0x95ac('0x10')](_0x4b343e,util[_0x95ac('0x11')](_0x95ac('0x12'),_0x2006bc,_0x151777));}function formatter(_0x1893c3,_0x39299e){_0x39299e[_0x95ac('0x13')]=_0x39299e[_0x95ac('0x13')][_0x95ac('0x14')](/@@{/g,_0x95ac('0x15'))[_0x95ac('0x14')](/}@@/g,_0x95ac('0x16'))[_0x95ac('0x14')](/@{/g,'{{')[_0x95ac('0x14')](/}@/g,'}}');return util[_0x95ac('0x11')](_0x95ac('0x17'),moment()['format'](_0x95ac('0x18')),_0x39299e[_0x95ac('0x19')][_0x95ac('0x1a')](),_0x1893c3,_0x39299e[_0x95ac('0x13')]);}function fileFormat(_0x55496d,_0x14f769){_0x14f769['message']=_0x14f769[_0x95ac('0x13')][_0x95ac('0x14')](/@@{/g,'{{{')['replace'](/}@@/g,_0x95ac('0x16'))[_0x95ac('0x14')](/@{/g,'{{')[_0x95ac('0x14')](/}@/g,'}}');var _0x27f3d4=_0x14f769[_0x95ac('0x1b')]&&Object['keys'](_0x14f769['meta'])[_0x95ac('0x1c')]?'\x0a\x09'+JSON[_0x95ac('0x1d')](_0x14f769[_0x95ac('0x1b')]):'';return util[_0x95ac('0x11')](_0x95ac('0x1e'),moment()['format'](_0x95ac('0x18')),_0x14f769[_0x95ac('0x19')][_0x95ac('0x1a')](),_0x55496d,_0x14f769['message'],_0x27f3d4);}function consoleLogger(){var _0x60cede=new winston[(_0x95ac('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x95ac('0x20'),'json':![],'formatter':function(_0x3b4fdc){return formatter('',_0x3b4fdc);}})]});return _0x60cede;}function fileLogger(_0x4215a9,_0x273f9c){var _0x3c1e54=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x95ac('0x21'))][(_0x95ac('0x22'))]({'name':util[_0x95ac('0x11')](_0x95ac('0x23'),_0x4215a9,_0x95ac('0x24')),'filename':getLogFileName(_0x273f9c,_0x4215a9,_0x95ac('0x24')),'level':_0x95ac('0x24'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x74ada8){return fileFormat(_0x4215a9,_0x74ada8);}}),new winston['transports'][(_0x95ac('0x22'))]({'name':util[_0x95ac('0x11')](_0x95ac('0x23'),_0x4215a9,debugLevel),'filename':getLogFileName(_0x273f9c,_0x4215a9,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c6f94){return fileFormat(_0x4215a9,_0x5c6f94);}}),new winston[(_0x95ac('0x21'))][(_0x95ac('0x25'))]({'level':_0x95ac('0x20'),'json':![],'formatter':function(_0x51a0f9){return fileFormat(_0x4215a9,_0x51a0f9);}})]});return _0x3c1e54;}exports['consoleLogger']=consoleLogger;exports[_0x95ac('0x26')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 7931dd3..f5c074d 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 _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x1cb46c,_0x2ea1b1){var _0x52b911=function(_0x19bbab){while(--_0x19bbab){_0x1cb46c['push'](_0x1cb46c['shift']());}};_0x52b911(++_0x2ea1b1);}(_0xadb5,0xad));var _0x5adb=function(_0x485c2c,_0x5f2de1){_0x485c2c=_0x485c2c-0x0;var _0x5ad816=_0xadb5[_0x485c2c];return _0x5ad816;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x64978d,_0x41005e){var _0x3eed3f=function(_0x330b5b){while(--_0x330b5b){_0x64978d['push'](_0x64978d['shift']());}};_0x3eed3f(++_0x41005e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0x0b0e[_0x57928b];return _0x49aad6;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index f126d7a..6fb7100 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['\x5c$&','exports','replace'];(function(_0x424c95,_0x1a3267){var _0x263c44=function(_0x30b6fc){while(--_0x30b6fc){_0x424c95['push'](_0x424c95['shift']());}};_0x263c44(++_0x1a3267);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1601ef,_0x5bcf40){_0x1601ef=_0x1601ef-0x0;var _0x12d3a8=_0x5f2f[_0x1601ef];return _0x12d3a8;};module[_0xf5f2('0x0')]={'escapeRegExp'(_0x423dd9,_0x2dcf60=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x423dd9[_0xf5f2('0x1')](_0x2dcf60,_0xf5f2('0x2'));}}; \ No newline at end of file +var _0x53ec=['exports','replace','\x5c$&'];(function(_0x4b6fb6,_0x124259){var _0x12f723=function(_0x72770f){while(--_0x72770f){_0x4b6fb6['push'](_0x4b6fb6['shift']());}};_0x12f723(++_0x124259);}(_0x53ec,0x192));var _0xc53e=function(_0x336030,_0x4086ea){_0x336030=_0x336030-0x0;var _0x2b203b=_0x53ec[_0x336030];return _0x2b203b;};module[_0xc53e('0x0')]={'escapeRegExp'(_0x173f4d,_0x2d5f51=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x173f4d[_0xc53e('0x1')](_0x2d5f51,_0xc53e('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index afd6d90..40ce2d8 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 _0x896e=['map','isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x3ef743,_0x54eb90){var _0x596153=function(_0x3dc023){while(--_0x3dc023){_0x3ef743['push'](_0x3ef743['shift']());}};_0x596153(++_0x54eb90);}(_0x896e,0x1e9));var _0xe896=function(_0xcdedd0,_0x4c7564){_0xcdedd0=_0xcdedd0-0x0;var _0x20c704=_0x896e[_0xcdedd0];return _0x20c704;};var _=require(_0xe896('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x1bab19){return _0x1bab19==='{{'?_0xe896('0x1'):_0xe896('0x2');}function safeTemplate(_0x36085e){var _0x26d296=_0x36085e;if(typeof _0x36085e===_0xe896('0x3')){_0x26d296=_0x36085e[_0xe896('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xe896('0x5')](_0x36085e)){_0x26d296=_0x36085e[_0xe896('0x6')](function(_0x244f68){return safeTemplate(_0x244f68);});}else if(_[_0xe896('0x7')](_0x36085e)){_0x26d296=Object['keys'](_0x36085e)[_0xe896('0x8')](function(_0x7a0721,_0x3b902c){_0x7a0721[_0x3b902c]=safeTemplate(_0x36085e[_0x3b902c]);return _0x7a0721;},{});}return _0x26d296;}module[_0xe896('0x9')][_0xe896('0xa')]=safeTemplate; \ No newline at end of file +var _0x0598=['exports','safeTemplate','lodash','\x20}\x20}','string','replace','isPlainObject','keys'];(function(_0x385fd3,_0x3680b6){var _0x27c543=function(_0x3610cc){while(--_0x3610cc){_0x385fd3['push'](_0x385fd3['shift']());}};_0x27c543(++_0x3680b6);}(_0x0598,0x92));var _0x8059=function(_0xb39f91,_0x2f678b){_0xb39f91=_0xb39f91-0x0;var _0x1b3793=_0x0598[_0xb39f91];return _0x1b3793;};var _=require(_0x8059('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x8f4b1){return _0x8f4b1==='{{'?'{\x20{\x20':_0x8059('0x1');}function safeTemplate(_0x52c9bf){var _0x4dad54=_0x52c9bf;if(typeof _0x52c9bf===_0x8059('0x2')){_0x4dad54=_0x52c9bf[_0x8059('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x52c9bf)){_0x4dad54=_0x52c9bf['map'](function(_0x555fb5){return safeTemplate(_0x555fb5);});}else if(_[_0x8059('0x4')](_0x52c9bf)){_0x4dad54=Object[_0x8059('0x5')](_0x52c9bf)['reduce'](function(_0x5996d7,_0x248273){_0x5996d7[_0x248273]=safeTemplate(_0x52c9bf[_0x248273]);return _0x5996d7;},{});}return _0x4dad54;}module[_0x8059('0x6')][_0x8059('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 6dc6c7a..da5f146 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 _0xbbcb=['legacy-libs','apps','findIndex','name','motion2','env','string','pathExists','then','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','root','server/app.json','resolve'];(function(_0x2d3b67,_0x353755){var _0x4faca7=function(_0x4ffd9d){while(--_0x4ffd9d){_0x2d3b67['push'](_0x2d3b67['shift']());}};_0x4faca7(++_0x353755);}(_0xbbcb,0x176));var _0xbbbc=function(_0x1329c7,_0x419bed){_0x1329c7=_0x1329c7-0x0;var _0x1cb9fa=_0xbbcb[_0x1329c7];return _0x1cb9fa;};var fs=require(_0xbbbc('0x0'));var path=require(_0xbbbc('0x1'));var config=require(_0xbbbc('0x2'));var root=config[_0xbbbc('0x3')];var APP_JSON_PATH=path['resolve'](root,_0xbbbc('0x4'));var NODEPATH=path[_0xbbbc('0x5')](root,_0xbbbc('0x6'));function setLegacyLibsNodeEnvPath(_0x14938f){let _0xe176ff=![];if(Array['isArray'](_0x14938f[_0xbbbc('0x7')])){var _0x14f7fa=_0x14938f[_0xbbbc('0x7')][_0xbbbc('0x8')](function(_0x51ce58){return _0x51ce58[_0xbbbc('0x9')]===_0xbbbc('0xa');});if(_0x14f7fa>-0x1){var _0x5da13c=_0x14938f[_0xbbbc('0x7')][_0x14f7fa];if(typeof _0x5da13c[_0xbbbc('0xb')]['NODE_PATH']!==_0xbbbc('0xc')){_0x5da13c[_0xbbbc('0xb')]['NODE_PATH']=NODEPATH;_0xe176ff=!![];}}return{'appConfig':_0x14938f,'updated':_0xe176ff};}}function updateAppConfig(_0x3b4e2a){return fs[_0xbbbc('0xd')](APP_JSON_PATH)[_0xbbbc('0xe')](function(_0x1f66ff){if(_0x1f66ff){return fs['readJSON'](APP_JSON_PATH)[_0xbbbc('0xe')](function(_0x293c82){var _0x1f6deb=setLegacyLibsNodeEnvPath(_0x293c82);if(_0x1f6deb[_0xbbbc('0xf')]){_0x3b4e2a[_0xbbbc('0x10')](_0xbbbc('0x11'));return fs[_0xbbbc('0x12')](APP_JSON_PATH,_0x293c82,{'spaces':0x2});}else{return Promise[_0xbbbc('0x5')]();}});}else{return Promise[_0xbbbc('0x5')]();}});}module[_0xbbbc('0x13')]=updateAppConfig; \ No newline at end of file +var _0x8723=['writeJSON','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','apps','findIndex','name','motion2','env','NODE_PATH','string','pathExists','then','readJSON','updated','info'];(function(_0x2712df,_0x36b27d){var _0x25efaa=function(_0x1ee20b){while(--_0x1ee20b){_0x2712df['push'](_0x2712df['shift']());}};_0x25efaa(++_0x36b27d);}(_0x8723,0x1a6));var _0x3872=function(_0x42bf60,_0x218573){_0x42bf60=_0x42bf60-0x0;var _0x2892bc=_0x8723[_0x42bf60];return _0x2892bc;};var fs=require(_0x3872('0x0'));var path=require(_0x3872('0x1'));var config=require(_0x3872('0x2'));var root=config[_0x3872('0x3')];var APP_JSON_PATH=path[_0x3872('0x4')](root,_0x3872('0x5'));var NODEPATH=path[_0x3872('0x4')](root,_0x3872('0x6'));function setLegacyLibsNodeEnvPath(_0x354f03){let _0x5e450f=![];if(Array['isArray'](_0x354f03[_0x3872('0x7')])){var _0x653430=_0x354f03[_0x3872('0x7')][_0x3872('0x8')](function(_0x173555){return _0x173555[_0x3872('0x9')]===_0x3872('0xa');});if(_0x653430>-0x1){var _0x1cca4a=_0x354f03[_0x3872('0x7')][_0x653430];if(typeof _0x1cca4a[_0x3872('0xb')][_0x3872('0xc')]!==_0x3872('0xd')){_0x1cca4a[_0x3872('0xb')]['NODE_PATH']=NODEPATH;_0x5e450f=!![];}}return{'appConfig':_0x354f03,'updated':_0x5e450f};}}function updateAppConfig(_0x39b122){return fs[_0x3872('0xe')](APP_JSON_PATH)[_0x3872('0xf')](function(_0x2846a9){if(_0x2846a9){return fs[_0x3872('0x10')](APP_JSON_PATH)[_0x3872('0xf')](function(_0x3ec228){var _0x21369f=setLegacyLibsNodeEnvPath(_0x3ec228);if(_0x21369f[_0x3872('0x11')]){_0x39b122[_0x3872('0x12')]('Updating\x20app.json');return fs[_0x3872('0x13')](APP_JSON_PATH,_0x3ec228,{'spaces':0x2});}else{return Promise[_0x3872('0x4')]();}});}else{return Promise['resolve']();}});}module[_0x3872('0x14')]=updateAppConfig; \ No newline at end of file